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

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorDavid Karlaš <david.karlas@xamarin.com>2016-04-13 14:27:42 +0300
committerDavid Karlaš <david.karlas@xamarin.com>2016-04-13 14:27:42 +0300
commit751bbab2f08e55a1d1fd89b17620ebebf7d71891 (patch)
tree6cdbab36be6049898f348c29359efaac9aadb91c /main/src
parentfdcef13057a9c4a9bc924602c9b2b33c1da3bf63 (diff)
parent036b2fbc3b515ce36b4ddaf0cc76b6ffa63db9d3 (diff)
Merge master into newExceptionDialog
Diffstat (limited to 'main/src')
-rw-r--r--main/src/addins/AspNet/ChangeLog3359
-rw-r--r--main/src/addins/AspNet/Commands/AddControllerDialog.cs6
-rw-r--r--main/src/addins/AspNet/Commands/AddViewDialog.cs57
-rw-r--r--main/src/addins/AspNet/Commands/AddViewFromControllerCommandHandler.cs19
-rw-r--r--main/src/addins/AspNet/Commands/GoToControllerCommandHandler.cs87
-rw-r--r--main/src/addins/AspNet/Commands/GoToViewCommandHandler.cs12
-rw-r--r--main/src/addins/AspNet/Commands/MethodDeclarationAtCaret.cs118
-rw-r--r--main/src/addins/AspNet/Commands/MvcCommandsCommonHandler.cs19
-rw-r--r--main/src/addins/AspNet/Execution/AspNetExecutionHandler.cs7
-rw-r--r--main/src/addins/AspNet/Execution/BrowserLauncher.cs2
-rw-r--r--main/src/addins/AspNet/Execution/XspBrowserLauncherConsole.cs36
-rw-r--r--main/src/addins/AspNet/Execution/XspOptionsPanel.cs8
-rw-r--r--main/src/addins/AspNet/Execution/XspOptionsPanelWidget.cs4
-rw-r--r--main/src/addins/AspNet/Html/BaseHtmlEditorExtension.cs64
-rw-r--r--main/src/addins/AspNet/Html/DocTypeCompletionData.cs28
-rw-r--r--main/src/addins/AspNet/Html/HtmlEditorExtension.cs8
-rw-r--r--main/src/addins/AspNet/Html/HtmlParser.cs15
-rw-r--r--main/src/addins/AspNet/Html/HtmlPathCompletion.cs3
-rw-r--r--main/src/addins/AspNet/Makefile.am3
-rw-r--r--main/src/addins/AspNet/MonoDevelop.AspNet.csproj165
-rw-r--r--main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet.Gui/ASPNetCodeTranslator.cs44
-rw-r--r--main/src/addins/AspNet/ProjectPad/AspNetFolderNodeCommandHandler.cs20
-rw-r--r--main/src/addins/AspNet/ProjectPad/AspNetProjectNodeBuilderExtension.cs3
-rw-r--r--main/src/addins/AspNet/ProjectPad/AspNetProjectNodeCommandHandler.cs18
-rw-r--r--main/src/addins/AspNet/Projects/AspMvcProject.cs173
-rw-r--r--main/src/addins/AspNet/Projects/AspMvcProjectConfiguration.cs4
-rw-r--r--main/src/addins/AspNet/Projects/AspMvcProjectFlavor.cs96
-rw-r--r--main/src/addins/AspNet/Projects/AspNetAppProject.cs754
-rw-r--r--main/src/addins/AspNet/Projects/AspNetAppProjectBinding.cs84
-rw-r--r--main/src/addins/AspNet/Projects/AspNetAppProjectConfiguration.cs14
-rw-r--r--main/src/addins/AspNet/Projects/AspNetAppProjectFlavor.cs734
-rw-r--r--main/src/addins/AspNet/Projects/AspNetMSBuildImportProvider.cs2
-rw-r--r--main/src/addins/AspNet/Projects/AspNetMvcFileTemplateCondition.cs2
-rw-r--r--main/src/addins/AspNet/Projects/AspNetProjectTemplateWizardPage.cs23
-rw-r--r--main/src/addins/AspNet/Projects/AspNetProjectTemplateWizardPageWidget.cs137
-rw-r--r--main/src/addins/AspNet/Projects/AspNetStringTagProvider.cs4
-rw-r--r--main/src/addins/AspNet/Projects/GtkAspNetProjectTemplateWizardPageWidget.cs195
-rw-r--r--main/src/addins/AspNet/Properties/AddinInfo.cs2
-rw-r--r--main/src/addins/AspNet/Properties/AssemblyInfo.cs3
-rw-r--r--main/src/addins/AspNet/Properties/MonoDevelop.AspNet.addin.xml129
-rw-r--r--main/src/addins/AspNet/Razor/Dom/RazorCodeBlock.cs4
-rw-r--r--main/src/addins/AspNet/Razor/Dom/RazorCodeFragment.cs28
-rw-r--r--main/src/addins/AspNet/Razor/Dom/RazorComment.cs7
-rw-r--r--main/src/addins/AspNet/Razor/Dom/RazorDirective.cs4
-rw-r--r--main/src/addins/AspNet/Razor/Dom/RazorExplicitExpression.cs7
-rw-r--r--main/src/addins/AspNet/Razor/Dom/RazorExpression.cs7
-rw-r--r--main/src/addins/AspNet/Razor/Dom/RazorImplicitExpression.cs7
-rw-r--r--main/src/addins/AspNet/Razor/Dom/RazorStatement.cs4
-rw-r--r--main/src/addins/AspNet/Razor/Dom/RazorWorkbenchService.cs48
-rw-r--r--main/src/addins/AspNet/Razor/Generator/RazorTemplatePreprocessor.cs10
-rw-r--r--main/src/addins/AspNet/Razor/IRazorCompletionBuilder.cs33
-rw-r--r--main/src/addins/AspNet/Razor/OpenRazorDocument.cs94
-rw-r--r--main/src/addins/AspNet/Razor/Parser/RazorOutlineNode.cs4
-rw-r--r--main/src/addins/AspNet/Razor/Parser/StateEngineService.cs4
-rw-r--r--main/src/addins/AspNet/Razor/RazorCSharpEditorExtension.cs1315
-rw-r--r--main/src/addins/AspNet/Razor/RazorCSharpFormatter.cs107
-rw-r--r--main/src/addins/AspNet/Razor/RazorCSharpParsedDocument.cs10
-rw-r--r--main/src/addins/AspNet/Razor/RazorCSharpParser.cs342
-rw-r--r--main/src/addins/AspNet/Razor/RazorCSharpParserContext.cs100
-rw-r--r--main/src/addins/AspNet/Razor/RazorPageInfo.cs7
-rw-r--r--main/src/addins/AspNet/Razor/RazorSyntaxMode.cs5
-rw-r--r--main/src/addins/AspNet/Templates/Global.tt32
-rw-r--r--main/src/addins/AspNet/Templates/GlobalAsax.xft.xml35
-rw-r--r--main/src/addins/AspNet/Templates/Mvc/GlobalAsax.xft.xml68
-rw-r--r--main/src/addins/AspNet/Templates/Mvc/WebConfigApp.xft.xml151
-rw-r--r--main/src/addins/AspNet/Templates/Mvc/WebConfigViews.xft.xml54
-rw-r--r--main/src/addins/AspNet/Templates/MvcCommon/HomeControllerTest.cs2
-rw-r--r--main/src/addins/AspNet/Templates/Projects/EmptyMvcProject.xpt.xml59
-rw-r--r--main/src/addins/AspNet/Templates/Projects/EmptyProject.xpt.xml73
-rw-r--r--main/src/addins/AspNet/Templates/Projects/Files/Default.aspx12
-rw-r--r--main/src/addins/AspNet/Templates/Projects/Files/Default.aspx.cs14
-rw-r--r--main/src/addins/AspNet/Templates/Projects/Files/Default.aspx.designer.cs11
-rw-r--r--main/src/addins/AspNet/Templates/Projects/Files/RouteConfig.cs37
-rw-r--r--main/src/addins/AspNet/Templates/Projects/Files/Test.cs14
-rw-r--r--main/src/addins/AspNet/Templates/Projects/MvcProject.xpt.xml88
-rw-r--r--main/src/addins/AspNet/Templates/Projects/MvcProjectWithUnitTest.xpt.xml119
-rw-r--r--main/src/addins/AspNet/Templates/Projects/MvcRazorProject.xpt.xml71
-rw-r--r--main/src/addins/AspNet/Templates/Projects/MvcRazorProjectWithUnitTest.xpt.xml97
-rw-r--r--main/src/addins/AspNet/Templates/Projects/WebApplication.xpt.xml88
-rw-r--r--main/src/addins/AspNet/Templates/Projects/WebFormsProject.xpt.xml88
-rw-r--r--main/src/addins/AspNet/Templates/RouteConfig.cs19
-rw-r--r--main/src/addins/AspNet/Templates/WebApiConfig.cs21
-rw-r--r--main/src/addins/AspNet/Templates/WebConfig-Application.xft.xml58
-rw-r--r--main/src/addins/AspNet/Templates/WebForms/GlobalAsax-CodeBehind.xft.xml80
-rw-r--r--main/src/addins/AspNet/Templates/WebForms/GlobalAsax-Empty.xft.xml79
-rw-r--r--main/src/addins/AspNet/Templates/images/aspnet-empty-project.pngbin3653 -> 4509 bytes
-rw-r--r--main/src/addins/AspNet/Templates/images/aspnet-empty-project@2x.pngbin10450 -> 12290 bytes
-rw-r--r--main/src/addins/AspNet/Templates/images/aspnet-empty-project~dark.pngbin0 -> 4400 bytes
-rw-r--r--main/src/addins/AspNet/Templates/images/aspnet-empty-project~dark@2x.pngbin0 -> 12330 bytes
-rw-r--r--main/src/addins/AspNet/Templates/images/aspnet-wizard-page.pngbin0 -> 17741 bytes
-rw-r--r--main/src/addins/AspNet/Templates/images/aspnet-wizard-page@2x.pngbin0 -> 49563 bytes
-rw-r--r--main/src/addins/AspNet/Tests/MonoDevelop.AspNet.Tests.csproj22
-rw-r--r--main/src/addins/AspNet/Tests/Razor/Dom/RazorDocumentTrackerTests.cs79
-rw-r--r--main/src/addins/AspNet/Tests/Razor/RazorCompletionTesting.cs200
-rw-r--r--main/src/addins/AspNet/Tests/Razor/RazorCompletionTests.cs53
-rw-r--r--main/src/addins/AspNet/Tests/Razor/RazorParserTests.cs108
-rw-r--r--main/src/addins/AspNet/Tests/WebForms/WebFormsCompletionTests.cs49
-rw-r--r--main/src/addins/AspNet/Tests/WebForms/WebFormsTesting.cs63
-rw-r--r--main/src/addins/AspNet/WebForms/CSharp/CSharpProjector.cs109
-rw-r--r--main/src/addins/AspNet/WebForms/Dom/WebFormsBindingExpression.cs7
-rw-r--r--main/src/addins/AspNet/WebForms/Dom/WebFormsDirective.cs8
-rw-r--r--main/src/addins/AspNet/WebForms/Dom/WebFormsExpression.cs7
-rw-r--r--main/src/addins/AspNet/WebForms/Dom/WebFormsHtmlEncodedExpression.cs7
-rw-r--r--main/src/addins/AspNet/WebForms/Dom/WebFormsRenderBlock.cs7
-rw-r--r--main/src/addins/AspNet/WebForms/Dom/WebFormsRenderExpression.cs7
-rw-r--r--main/src/addins/AspNet/WebForms/Dom/WebFormsResourceExpression.cs7
-rw-r--r--main/src/addins/AspNet/WebForms/Dom/WebFormsServerComment.cs7
-rw-r--r--main/src/addins/AspNet/WebForms/ILanguageCompletionBuilder.cs27
-rw-r--r--main/src/addins/AspNet/WebForms/MasterContentFileDescriptionTemplate.cs8
-rw-r--r--main/src/addins/AspNet/WebForms/SuggestedHandlerCompletionData.cs32
-rw-r--r--main/src/addins/AspNet/WebForms/WebFormsCodeBehind.cs49
-rw-r--r--main/src/addins/AspNet/WebForms/WebFormsCodeBehindTypeNameCache.cs10
-rw-r--r--main/src/addins/AspNet/WebForms/WebFormsDirectiveCompletion.cs9
-rw-r--r--main/src/addins/AspNet/WebForms/WebFormsEditorExtension.cs464
-rw-r--r--main/src/addins/AspNet/WebForms/WebFormsMemberListBuilder.cs14
-rw-r--r--main/src/addins/AspNet/WebForms/WebFormsPageInfo.cs2
-rw-r--r--main/src/addins/AspNet/WebForms/WebFormsParsedDocument.cs14
-rw-r--r--main/src/addins/AspNet/WebForms/WebFormsParser.cs21
-rw-r--r--main/src/addins/AspNet/WebForms/WebFormsRegistrationCache.cs4
-rw-r--r--main/src/addins/AspNet/WebForms/WebFormsSyntaxMode.cs3
-rw-r--r--main/src/addins/AspNet/WebForms/WebFormsToolboxNode.cs9
-rw-r--r--main/src/addins/AspNet/WebForms/WebFormsTypeContext.cs196
-rw-r--r--main/src/addins/AspNet/gtk-gui/MonoDevelop.AspNet.Projects.GtkAspNetProjectTemplateWizardPageWidget.cs454
-rw-r--r--main/src/addins/AspNet/gtk-gui/generated.cs83
-rw-r--r--main/src/addins/AspNet/gtk-gui/gui.stetic575
-rw-r--r--main/src/addins/AspNet/packages.config12
-rw-r--r--main/src/addins/CBinding/AddinInfo.cs20
-rw-r--r--main/src/addins/CBinding/AssemblyInfo.cs9
-rw-r--r--main/src/addins/CBinding/CBinding.Autotools/AssemblyInfo.cs37
-rw-r--r--main/src/addins/CBinding/CBinding.Autotools/CAutotoolsSetup.cs74
-rw-r--r--main/src/addins/CBinding/CBinding.Autotools/CBinding.Autotools.csproj88
-rw-r--r--main/src/addins/CBinding/CBinding.Autotools/ChangeLog44
-rw-r--r--main/src/addins/CBinding/CBinding.addin.xml244
-rw-r--r--main/src/addins/CBinding/CBinding.csproj288
-rw-r--r--main/src/addins/CBinding/CLanguageBinding.cs62
-rw-r--r--main/src/addins/CBinding/ChangeLog1853
-rw-r--r--main/src/addins/CBinding/Compiler/CCompiler.cs137
-rw-r--r--main/src/addins/CBinding/Compiler/GNUCompiler.cs799
-rw-r--r--main/src/addins/CBinding/Compiler/GccCompiler.cs55
-rw-r--r--main/src/addins/CBinding/Compiler/GppCompiler.cs55
-rw-r--r--main/src/addins/CBinding/Compiler/ICompiler.cs76
-rw-r--r--main/src/addins/CBinding/CppLanguageBinding.cs59
-rwxr-xr-xmain/src/addins/CBinding/Gui/CTextEditorExtension.cs793
-rw-r--r--main/src/addins/CBinding/Gui/CodeGenerationPanel.cs369
-rw-r--r--main/src/addins/CBinding/Gui/CompilerPanel.cs127
-rw-r--r--main/src/addins/CBinding/Gui/DataProvider.cs215
-rw-r--r--main/src/addins/CBinding/Gui/EditPackagesDialog.cs569
-rw-r--r--main/src/addins/CBinding/Gui/GeneralOptionsPanel.cs198
-rw-r--r--main/src/addins/CBinding/Gui/OutputOptionsPanel.cs111
-rw-r--r--main/src/addins/CBinding/Gui/PackageDetails.cs89
-rw-r--r--main/src/addins/CBinding/Navigation/ClassNodeBuilder.cs140
-rw-r--r--main/src/addins/CBinding/Navigation/ClassPadEventArgs.cs53
-rw-r--r--main/src/addins/CBinding/Navigation/EnumerationNodeBuilder.cs113
-rw-r--r--main/src/addins/CBinding/Navigation/EnumeratorNodeBuilder.cs81
-rw-r--r--main/src/addins/CBinding/Navigation/FunctionNodeBuilder.cs97
-rw-r--r--main/src/addins/CBinding/Navigation/GlobalsNodeBuilder.cs136
-rw-r--r--main/src/addins/CBinding/Navigation/LanguageItemCommandHandler.cs50
-rw-r--r--main/src/addins/CBinding/Navigation/LanguageItemEventArgs.cs53
-rw-r--r--main/src/addins/CBinding/Navigation/MacroDefinitionsNodeBuilder.cs104
-rw-r--r--main/src/addins/CBinding/Navigation/MacroNodeBuilder.cs77
-rw-r--r--main/src/addins/CBinding/Navigation/MemberNodeBuilder.cs93
-rw-r--r--main/src/addins/CBinding/Navigation/NamespaceNodeBuilder.cs132
-rw-r--r--main/src/addins/CBinding/Navigation/ProjectNodeBuilderExtension.cs181
-rw-r--r--main/src/addins/CBinding/Navigation/StructureNodeBuilder.cs143
-rw-r--r--main/src/addins/CBinding/Navigation/TypedefNodeBuilder.cs84
-rw-r--r--main/src/addins/CBinding/Navigation/UnionNodeBuilder.cs143
-rw-r--r--main/src/addins/CBinding/Navigation/VariableNodeBuilder.cs96
-rw-r--r--main/src/addins/CBinding/ObjCLanguageBinding.cs62
-rw-r--r--main/src/addins/CBinding/ObjCppLanguageBinding.cs63
-rw-r--r--main/src/addins/CBinding/Parser/BsdCTagsManager.cs125
-rwxr-xr-xmain/src/addins/CBinding/Parser/CDocumentParser.cs228
-rw-r--r--main/src/addins/CBinding/Parser/CTagsManager.cs200
-rw-r--r--main/src/addins/CBinding/Parser/Class.cs48
-rw-r--r--main/src/addins/CBinding/Parser/CompilationUnitDataProvider.cs97
-rwxr-xr-xmain/src/addins/CBinding/Parser/DataProvider.cs129
-rw-r--r--main/src/addins/CBinding/Parser/Enumeration.cs48
-rw-r--r--main/src/addins/CBinding/Parser/Enumerator.cs45
-rw-r--r--main/src/addins/CBinding/Parser/ExuberantCTagsManager.cs163
-rw-r--r--main/src/addins/CBinding/Parser/Function.cs141
-rw-r--r--main/src/addins/CBinding/Parser/LanguageItem.cs257
-rw-r--r--main/src/addins/CBinding/Parser/Local.cs47
-rw-r--r--main/src/addins/CBinding/Parser/Macro.cs44
-rw-r--r--main/src/addins/CBinding/Parser/Member.cs105
-rw-r--r--main/src/addins/CBinding/Parser/Namespace.cs45
-rw-r--r--main/src/addins/CBinding/Parser/ProjectInformation.cs236
-rw-r--r--main/src/addins/CBinding/Parser/ProjectInformationManager.cs77
-rw-r--r--main/src/addins/CBinding/Parser/Structure.cs48
-rw-r--r--main/src/addins/CBinding/Parser/Tag.cs144
-rw-r--r--main/src/addins/CBinding/Parser/TagDatabaseManager.cs499
-rw-r--r--main/src/addins/CBinding/Parser/Typedef.cs48
-rw-r--r--main/src/addins/CBinding/Parser/Union.cs48
-rw-r--r--main/src/addins/CBinding/Parser/Variable.cs44
-rw-r--r--main/src/addins/CBinding/Project/CProject.cs553
-rw-r--r--main/src/addins/CBinding/Project/CProjectBinding.cs85
-rw-r--r--main/src/addins/CBinding/Project/CProjectConfiguration.cs229
-rw-r--r--main/src/addins/CBinding/Project/CProjectServiceExtension.cs70
-rw-r--r--main/src/addins/CBinding/Project/Package.cs323
-rw-r--r--main/src/addins/CBinding/Project/ProjectPackageCollection.cs110
-rw-r--r--main/src/addins/CBinding/Project/ProjectPackageEventArgs.cs57
-rw-r--r--main/src/addins/CBinding/ProjectPad/ProjectNodeExtension.cs59
-rw-r--r--main/src/addins/CBinding/ProjectPad/ProjectPackageNodeBuilder.cs103
-rw-r--r--main/src/addins/CBinding/ProjectPad/ProjectPackagesFolderNodeBuilder.cs198
-rw-r--r--main/src/addins/CBinding/ProjectPad/ProjectReferencesExtension.cs57
-rw-r--r--main/src/addins/CBinding/README7
-rw-r--r--main/src/addins/CBinding/gtk-gui/CBinding.CodeGenerationPanel.cs690
-rw-r--r--main/src/addins/CBinding/gtk-gui/CBinding.CompilerPanel.cs56
-rw-r--r--main/src/addins/CBinding/gtk-gui/CBinding.EditPackagesDialog.cs240
-rw-r--r--main/src/addins/CBinding/gtk-gui/CBinding.GeneralOptionsPanel.cs156
-rw-r--r--main/src/addins/CBinding/gtk-gui/CBinding.OutputOptionsPanel.cs158
-rw-r--r--main/src/addins/CBinding/gtk-gui/CBinding.PackageDetails.cs284
-rw-r--r--main/src/addins/CBinding/gtk-gui/generated.cs115
-rw-r--r--main/src/addins/CBinding/gtk-gui/gui.stetic2217
-rw-r--r--main/src/addins/CBinding/icons/union-16.pngbin338 -> 0 bytes
-rw-r--r--main/src/addins/CBinding/icons/union-private-16.pngbin544 -> 0 bytes
-rw-r--r--main/src/addins/CBinding/icons/union-protected-16.pngbin500 -> 0 bytes
-rw-r--r--main/src/addins/CBinding/icons/update.pngbin706 -> 0 bytes
-rw-r--r--main/src/addins/CBinding/templates/ConsoleCProject.xpt.xml41
-rw-r--r--main/src/addins/CBinding/templates/ConsoleCppProject.xpt.xml42
-rw-r--r--main/src/addins/CBinding/templates/ConsoleObjCProject.xpt.xml39
-rw-r--r--main/src/addins/CBinding/templates/EmptyCHeaderFile.xft.xml23
-rw-r--r--main/src/addins/CBinding/templates/EmptyCProject.xpt.xml28
-rw-r--r--main/src/addins/CBinding/templates/EmptyCSourceFile.xft.xml23
-rw-r--r--main/src/addins/CBinding/templates/EmptyCppHeaderFile.xft.xml23
-rw-r--r--main/src/addins/CBinding/templates/EmptyCppProject.xpt.xml28
-rw-r--r--main/src/addins/CBinding/templates/EmptyCppSourceFile.xft.xml23
-rw-r--r--main/src/addins/CBinding/templates/EmptyObjCProject.xpt.xml36
-rw-r--r--main/src/addins/CBinding/templates/EmptyObjCSourceFile.xft.xml23
-rw-r--r--main/src/addins/CBinding/templates/EmptyObjCppSourceFile.xft.xml23
-rw-r--r--main/src/addins/CBinding/templates/SharedLibraryCProject.xpt.xml44
-rw-r--r--main/src/addins/CBinding/templates/SharedLibraryCppProject.xpt.xml43
-rw-r--r--main/src/addins/CBinding/templates/StaticLibraryCProject.xpt.xml44
-rw-r--r--main/src/addins/CBinding/templates/StaticLibraryCppProject.xpt.xml44
-rw-r--r--main/src/addins/CSharpBinding/AddinInfo.cs4
-rw-r--r--main/src/addins/CSharpBinding/AspNet/ASPNetReferenceFinder.cs7
-rw-r--r--main/src/addins/CSharpBinding/AspNet/AspLanguageBuilder.cs107
-rw-r--r--main/src/addins/CSharpBinding/AspNet/CSharpBinding.AspNet.csproj10
-rw-r--r--main/src/addins/CSharpBinding/AspNet/ChangeLog88
-rw-r--r--main/src/addins/CSharpBinding/AspNet/RazorCSharpCompletionBuilder.cs95
-rw-r--r--main/src/addins/CSharpBinding/AssemblyInfo.cs8
-rw-r--r--main/src/addins/CSharpBinding/Autotools/Autotools.csproj5
-rw-r--r--main/src/addins/CSharpBinding/Autotools/CSharpAutotoolsSetup.cs6
-rw-r--r--main/src/addins/CSharpBinding/Autotools/ChangeLog72
-rw-r--r--main/src/addins/CSharpBinding/CSharpBinding.addin.xml222
-rw-r--r--main/src/addins/CSharpBinding/CSharpBinding.csproj700
-rw-r--r--main/src/addins/CSharpBinding/ChangeLog8899
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/CSharpOutlineTextEditorExtension.cs520
-rwxr-xr-xmain/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/OutlineNodeComparer.cs293
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/OutlineSettings.cs106
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/OutlineSortingPreferencesDialog.cs77
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/AddImport/AbstractAddImportCodeFixProvider.cs526
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/AddImport/CSharpAddImportCodeFixProvider.cs642
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/Async/AbstractAsyncCodeFix.cs88
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/Async/CSharpAddAsyncCodeFixProvider.cs229
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/Async/CSharpAddAwaitCodeFixProvider.cs147
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/Async/CSharpConvertToAsyncMethodCodeFixProvider.cs124
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/EncapsulateField/AbstractEncapsulateFieldRefactoringProvider.cs20
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/EncapsulateField/EncapsulateFieldCodeRefactoringProvider.cs13
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/FullyQualify/CSharpFullyQualifyCodeFixProvider.cs331
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateConstructor/AbstractGenerateMemberCodeFixProvider.cs106
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateConstructor/GenerateConstructorCodeFixProvider.cs63
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateEnumMember/GenerateEnumMemberCodeFixProvider.cs39
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateMethod/GenerateConversionCodeFixProvider.cs65
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateMethod/GenerateMethodCodeFixProvider.cs75
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateType/GenerateTypeCodeFixProvider.cs77
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateVariable/GenerateVariableCodeFixProvider.cs59
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/ImplementAbstractClass/ImplementAbstractClassCodeFixProvider.cs95
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/ImplementInterface/ImplementInterfaceCodeFixProvider.cs70
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/MoveTypeToFile/MoveTypeToFile.cs215
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/PredefinedCodeFixProviderNames.cs64
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/RemoveUnnecessaryCast/RemoveUnnecessaryCastCodeFixProvider.RemoveUnnecessaryCastFixAllProvider.cs42
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/RemoveUnnecessaryCast/RemoveUnnecessaryCastCodeFixProvider.cs122
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/RemoveUnnecessaryUsings/RemoveUnnecessaryUsingsCodeFixProvider.cs58
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.SimplifyTypeNamesFixAllProvider.cs29
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.cs143
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/AbstractGenerateAction.cs40
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/CodeGenerationOptions.cs219
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/CreateConstructorGenerator.cs230
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/EqualityMembersGenerator.cs319
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ExportCodeGenerator.cs262
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/GenerateCodeWindow.cs10
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ICodeGenerator.cs6
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ImplementInterfaceMembersGenerator.cs195
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/OverrideMembersGenerator.cs98
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/PartialGenerator.cs37
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/PropertyGenerator.cs72
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/RaiseEventMethodGenerator.cs124
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ReadonlyPropertyGenerator.cs4
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ToStringGenerator.cs97
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/WriteLineGenerator.cs78
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/CSharpSyntaxContext.cs574
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/CodeRefactoring.cs47
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/ConvertToEnum/ConvertToEnumCodeRefactoringProvider.cs504
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/ConvertToEnum/ConvertToEnumDialog.cs (renamed from main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/Actions/ConvertToEnumDialog.cs)0
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/ExtractMethod/ExtractMethodCodeRefactoringProvider.cs105
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/InlineTemporary/InlineTemporaryCodeRefactoringProvider.InitializerRewriter.cs105
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/InlineTemporary/InlineTemporaryCodeRefactoringProvider.ReferenceRewriter.cs106
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/InlineTemporary/InlineTemporaryCodeRefactoringProvider.cs575
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/IntroduceVariable/IntroduceVariableCodeRefactoringProvider.cs41
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/PredefinedCodeRefactoringProviderNames.cs47
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/Resources.cs98
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/TypeGuessing.cs384
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/UsingRefactorings/SortImportsCodeRefactoringProvider.cs118
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/AbstractParameterDataProvider.cs47
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/AnonymousMethodCompletionData.cs65
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ArrayTypeParameterDataProvider.cs5
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs1407
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CastCompletionData.cs76
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ConstructorParameterDataProvider.cs2
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CreateOverrideCompletionData.cs153
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CreatePartialCompletionData.cs144
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/DelegateDataProvider.cs98
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs191
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ImportSymbolCompletionData.cs158
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/IndexerParameterDataProvider.cs99
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MemberCompletionData.cs864
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MethodParameterDataProvider.cs92
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MonoCSharpCompletionEngine.cs104
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/NewOverrideCompletionData.cs119
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ObjectCreationCompletionData.cs155
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ProtocolCompletionData.cs158
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ProtocolMemberContextHandler.cs173
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCodeCompletionFactory.cs271
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCompletionCategory.cs63
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCompletionData.cs118
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynParameterHintingFactory.cs306
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynSymbolCompletionData.cs512
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/TypeParameterDataProvider.cs163
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/VariableCompletionData.cs60
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/DiagnosticCustomTags.cs35
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/IDEDiagnosticIds.cs43
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/MonoNameConventionPolicy.xml (renamed from main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/MonoNameConventionPolicy.xml)0
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionEditRuleDialog.cs211
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPanel.cs73
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPanelWidget.cs156
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPolicy.cs96
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionRule.cs587
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/MonoTODO/MonoTODODiagnosticAnalyzer.cs105
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/RemoveUnnecessaryCast/CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs42
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/RemoveUnnecessaryCast/RemoveUnnecessaryCastDiagnosticAnalyzerBase.cs85
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs50
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/RemoveUnnecessaryImports/RemoveUnnecessaryImportsDiagnosticAnalyzerBase.cs127
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/SimplifyTypeNames/CSharpSimplifyTypeNamesDiagnosticAnalyzer.cs153
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/SimplifyTypeNames/SimplifyTypeNamesDiagnosticAnalyzerBase.cs112
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/AbstractTokenBraceCompletionSession.cs162
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/CSharpAutoInsertBracketHandler.cs170
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/BracketCompletionSession.cs42
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/CharLiteralCompletionSession.cs47
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/CurlyBraceCompletionSession.cs40
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/InterpolatedStringCompletionSession.cs86
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/InterpolationCompletionSession.cs100
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/LessAndGreaterThanCompletionSession.cs114
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/ParenthesisCompletionSession.cs70
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/StringLiteralCompletionSession.cs68
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CSharpCodeGenerationService.cs330
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CodeGenerationDestination.cs47
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CodeGenerationHelpers.cs39
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CodeGenerationOptions.cs61
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CodeGenerationTypeParameterSymbol.cs89
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CodeGenerator.cs137
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/SyntaxAnnotationExtensions.cs58
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/CompletionContext.cs105
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/CompletionEngine.cs222
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/CompletionResult.cs127
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/CompletionTriggerInfo.cs102
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/CompletionTriggerReason.cs39
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/AttributeNamedParameterContextHandler.cs233
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/CastCompletionContextHandler.cs172
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/CompletionContextHandler.cs188
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/DelegateCreationContextHandler.cs285
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/EnumMemberContextHandler.cs137
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/ExplicitInterfaceContextHandler.cs154
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/ExternAliasContextHandler.cs73
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/FormatItemContextHandler.cs269
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/KeywordContextHandler.cs247
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/NamedParameterContextHandler.cs220
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/ObjectCreationContextHandler.cs231
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/ObjectInitializerContextHandler.cs253
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/OverrideContextHandler.cs431
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/PartialContextHandler.cs203
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/PreProcessorExpressionContextHandler.cs59
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/RegexContextHandler.cs170
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/RoslynRecommendationsCompletionContextHandler.cs188
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/SenderCompletionContextHandler.cs123
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/SnippetContextHandler.cs105
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/SpeculativeNameContextHandler.cs130
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/SpeculativeTContextHandler.cs104
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/XmlDocCommentContextHandler.cs400
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/EditorBrowsableBehavior.cs35
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ICompletionDataFactory.cs81
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AbstractKeywordRecommender.cs55
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AbstractSyntacticSingleKeywordRecommender.cs79
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AddKeywordRecommender.cs22
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AliasKeywordRecommender.cs36
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AsKeywordRecommender.cs21
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AscendingKeywordRecommender.cs21
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AssemblyKeywordRecommender.cs32
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AsyncKeywordRecommender.cs39
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AwaitKeywordRecommender.cs54
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/BaseKeywordRecommender.cs69
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/BoolKeywordRecommender.cs47
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/BreakKeywordRecommender.cs54
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ByKeywordRecommender.cs53
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ByteKeywordRecommender.cs49
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/CaseKeywordRecommender.cs41
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/CatchKeywordRecommender.cs21
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/CharKeywordRecommender.cs47
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/CheckedKeywordRecommender.cs24
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ChecksumKeywordRecommender.cs28
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ClassKeywordRecommender.cs44
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ConstKeywordRecommender.cs65
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ContinueKeywordRecommender.cs47
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DecimalKeywordRecommender.cs47
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DefaultKeywordRecommender.cs42
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DefineKeywordRecommender.cs25
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DelegateKeywordRecommender.cs53
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DescendingKeywordRecommender.cs21
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DisableKeywordRecommender.cs30
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DoKeywordRecommender.cs23
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DoubleKeywordRecommender.cs47
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DynamicKeywordRecommender.cs65
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ElifKeywordRecommender.cs21
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ElseKeywordRecommender.cs63
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/EndIfKeywordRecommender.cs21
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/EndRegionKeywordRecommender.cs21
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/EnumKeywordRecommender.cs37
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/EqualsKeywordRecommender.cs45
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ErrorKeywordRecommender.cs21
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/EventKeywordRecommender.cs44
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ExplicitKeywordRecommender.cs41
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ExternKeywordRecommender.cs100
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FalseKeywordRecommender.cs26
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FieldKeywordRecommender.cs30
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FinallyKeywordRecommender.cs22
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FixedKeywordRecommender.cs50
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FloatKeywordRecommender.cs47
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ForEachKeywordRecommender.cs23
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ForKeywordRecommender.cs23
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FromKeywordRecommender.cs24
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/GetKeywordRecommender.cs24
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/GlobalKeywordRecommender.cs42
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/GotoKeywordRecommender.cs23
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/GroupKeywordRecommender.cs32
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/HiddenKeywordRecommender.cs32
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/IfKeywordRecommender.cs24
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ImplicitKeywordRecommender.cs41
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/InKeywordRecommender.cs112
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/IntKeywordRecommender.cs48
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/InterfaceKeywordRecommender.cs38
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/InternalKeywordRecommender.cs69
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/IntoKeywordRecommender.cs117
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/IsKeywordRecommender.cs23
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/JoinKeywordRecommender.cs21
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/LetKeywordRecommender.cs32
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/LineKeywordRecommender.cs21
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/LockKeywordRecommender.cs23
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/LongKeywordRecommender.cs48
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/MethodKeywordRecommender.cs43
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ModuleKeywordRecommender.cs32
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/NameOfKeywordRecommender.cs34
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/NamespaceKeywordRecommender.cs160
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/NewKeywordRecommender.cs123
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/NullKeywordRecommender.cs52
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ObjectKeywordRecommender.cs46
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/OnKeywordRecommender.cs49
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/OperatorKeywordRecommender.cs36
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/OrderByKeywordRecommender.cs32
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/OutKeywordRecommender.cs30
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/OverrideKeywordRecommender.cs38
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ParamKeywordRecommender.cs37
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ParamsKeywordRecommender.cs21
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/PartialKeywordRecommender.cs64
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/PragmaKeywordRecommender.cs21
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/PrivateKeywordRecommender.cs87
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/PropertyKeywordRecommender.cs22
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ProtectedKeywordRecommender.cs74
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/PublicKeywordRecommender.cs60
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ReadOnlyKeywordRecommender.cs40
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/RefKeywordRecommender.cs27
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ReferenceKeywordRecommender.cs26
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/RegionKeywordRecommender.cs21
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/RemoveKeywordRecommender.cs22
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/RestoreKeywordRecommender.cs30
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ReturnKeywordRecommender.cs33
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SByteKeywordRecommender.cs48
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SealedKeywordRecommender.cs55
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SelectKeywordRecommender.cs38
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SetKeywordRecommender.cs24
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ShortKeywordRecommender.cs48
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SizeOfKeywordRecommender.cs24
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/StackAllocKeywordRecommender.cs42
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/StaticKeywordRecommender.cs83
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/StringKeywordRecommender.cs46
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/StructKeywordRecommender.cs40
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SwitchKeywordRecommender.cs23
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ThisKeywordRecommender.cs97
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ThrowKeywordRecommender.cs23
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/TrueKeywordRecommender.cs26
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/TryKeywordRecommender.cs23
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/TypeKeywordRecommender.cs21
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/TypeOfKeywordRecommender.cs34
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/TypeVarKeywordRecommender.cs51
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UIntKeywordRecommender.cs48
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ULongKeywordRecommender.cs48
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UShortKeywordRecommender.cs48
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UncheckedKeywordRecommender.cs24
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UndefKeywordRecommender.cs25
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UnsafeKeywordRecommender.cs74
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UsingKeywordRecommender.cs139
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/VarKeywordRecommender.cs36
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/VirtualKeywordRecommender.cs37
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/VoidKeywordRecommender.cs112
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/VolatileKeywordRecommender.cs40
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/WarningKeywordRecommender.cs34
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/WhenKeywordRecommender.cs21
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/WhereKeywordRecommender.cs142
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/WhileKeywordRecommender.cs50
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/YieldKeywordRecommender.cs21
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/EncapsulateField/AbstractEncapsulateFieldRefactoringProvider.cs21
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/EncapsulateField/AbstractEncapsulateFieldService.cs426
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/EncapsulateField/CSharpEncapsulateFieldService.cs193
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/EncapsulateField/EncapsulateFieldCodeAction.cs31
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/EncapsulateField/EncapsulateFieldResult.cs38
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/AbstractExtractMethodService.cs45
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/AbstractSyntaxTriviaService.Result.cs296
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/AbstractSyntaxTriviaService.cs131
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpExtractMethodService.cs27
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.Analyzer.cs136
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs392
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs242
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.CSharpCodeGenerator.MultipleStatementsCodeGenerator.cs139
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.CSharpCodeGenerator.SingleStatementCodeGenerator.cs87
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.CSharpCodeGenerator.cs583
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.FormattingProvider.cs66
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.PostProcessor.cs314
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.TriviaResult.cs161
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.cs128
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSelectionResult.ExpressionResult.cs140
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSelectionResult.StatementResult.cs88
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSelectionResult.cs207
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSelectionValidator.Validator.cs86
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSelectionValidator.cs486
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSyntaxTriviaService.cs16
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSyntaxTriviaServiceFactory.cs20
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/Extensions.cs285
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/Enums.cs55
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/Extensions.cs121
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ExtractMethodMatrix.cs229
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ExtractMethodOptions.cs17
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ExtractMethodResult.cs66
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ExtractMethodService.cs21
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/FailedExtractMethodResult.cs13
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/IExtractMethodService.cs16
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ISyntaxTriviaService.cs66
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/InsertionPoint.cs64
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.Analyzer.SymbolMapBuilder.cs79
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.Analyzer.cs957
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.AnalyzerResult.cs176
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.CodeGenerator.cs316
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.GeneratedCode.cs39
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.TriviaResult.cs181
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.TypeParameterCollector.cs57
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.VariableInfo.cs138
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.VariableSymbol.cs357
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.cs171
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/OperationStatus.cs68
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/OperationStatus_Statics.cs23
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/OperationStatus`1.cs29
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ParameterStyle.cs41
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ReturnStyle.cs23
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/SelectionResult.cs158
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/SelectionValidator.NullSelectionResult.cs52
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/SelectionValidator.cs185
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/SimpleExtractMethodResult.cs17
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/UniqueNameGenerator.cs28
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/VariableStyle.cs49
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/CSharpEditorFormattingService.cs292
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/CommonFormattingHelpers.cs372
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/FormattingHelpers.cs552
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/FormattingOptionsFactory.cs170
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/FormattingRangeHelper.cs434
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/Indent.cs249
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/AbstractCodeRefactoringResult.cs31
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/AbstractGenerateFromMembersService.cs160
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/GenerateConstructor/AbstractGenerateConstructorService.cs263
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/GenerateConstructor/CSharpGenerateConstructorService.cs53
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/GenerateConstructor/GenerateConstructorResult.cs17
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/GenerateFromMembersHelpers.cs36
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/AbstractCodeRefactoringResult.cs31
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/AbstractGenerateMemberService.cs138
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateConstructor/AbstractGenerateConstructorService.cs701
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateConstructor/CSharpGenerateConstructorService.cs279
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateConstructor/GenerateConstructorHelpers.cs35
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateDefaultConstructors/AbstractGenerateDefaultConstructorsService.cs239
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateDefaultConstructors/CSharpGenerateDefaultConstructorsService.cs48
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateDefaultConstructors/GenerateDefaultConstructorsResult.cs17
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateEnumMember/AbstractGenerateEnumMemberService.cs238
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateEnumMember/CSharpGenerateEnumMemberService.cs54
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/AbstractGenerateConversionService.cs136
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/AbstractGenerateMethodService.cs267
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/AbstractGenerateParameterizedMemberService.cs595
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/CSharpCommonGenerationServiceMethods.cs36
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/CSharpGenerateConversionService.cs233
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/CSharpGenerateMethodService.cs173
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/CSharpGenerateParameterizedMemberService.cs172
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/MethodGenerationKind.cs11
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateVariable/AbstractGenerateVariableService.cs710
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateVariable/CSharpGenerateVariableService.cs167
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateType/AbstractGenerateTypeService.cs1813
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateType/CSharpGenerateTypeService.cs941
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateType/GenerateTypeDialogOptions.cs27
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateType/GenerateTypeOptionsResult.cs55
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateType/TypeKindOptions.cs89
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GotoDefinition/GotoDefinitionHelpers.cs126
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GotoDefinition/GotoDefinitionService.cs114
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementAbstractClass/AbstractImplementAbstractClassService.Editor.cs167
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementAbstractClass/AbstractImplementAbstractClassService.State.cs70
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementAbstractClass/AbstractImplementAbstractClassService.cs35
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementAbstractClass/CSharpImplementAbstractClassService.cs46
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.CodeAction.cs560
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.CodeAction_Conflicts.cs89
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.CodeAction_Method.cs80
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.CodeAction_Property.cs150
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.DisposePatternCodeAction.cs150
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.State.cs84
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.cs109
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/CSharpImplementInterfaceService.cs170
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/CSharpIndentEngine.cs535
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/CacheIndentEngine.cs623
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/IDocumentIndentEngine.cs99
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/IStateMachineIndentEngine.cs60
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/ITextPasteHandler.cs52
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/IndentState.cs2026
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/NullIStateMachineIndentEngine.cs207
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/TextPasteIndentEngine.cs685
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.AbstractIntroduceVariableCodeAction.cs134
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.CodeAction.cs28
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.IntroduceVariableAllOccurrenceCodeAction.cs39
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State.cs271
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_Attribute.cs25
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_Block.cs38
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_ConstructorInitializer.cs43
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_Field.cs50
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_Parameter.cs36
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_Query.cs37
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.cs330
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/CSharpIntroduceVariableService.Rewriter.cs61
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/CSharpIntroduceVariableService.cs131
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/CSharpIntroduceVariableService_IntroduceField.cs199
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/CSharpIntroduceVariableService_IntroduceLocal.cs378
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/CSharpIntroduceVariableService_IntroduceQueryLocal.cs107
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/IntroduceVariableResult.cs33
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/OrganizeImports/CSharpOrganizeImportsService.Rewriter.cs87
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/OrganizeImports/CSharpOrganizeImportsService.cs56
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/IParameterHintingData.cs229
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/IParameterHintingDataFactory.cs47
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/ParameterHintingEngine.cs332
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/ParameterHintingResult.cs87
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/ParameterUtil.cs123
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsService.Rewriter.cs168
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsService.cs115
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/SemanticHighlighting/SemanticHighlightingVisitor.cs716
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormatter.cs111
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.cs1491
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingPolicyPanel.cs13
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingPolicyPanelWidget.cs28
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs1200
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpIndentVirtualSpaceManager.cs52
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs563
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextPasteHandler.cs94
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/NewFormattingProfileDialog.cs4
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormatter.cs272
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/AllmanCSharpPolicy.xml180
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/GNUCSharpPolicy.xml163
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/GNUTextStylePolicy.xml37
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/KRCSharpPolicy.xml180
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/MonoCSharpPolicy.xml182
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/SharpDevelopCSharpPolicy.xml164
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/WhitesmithsCSharpPolicy.xml164
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/AbstractKeywordHighlighter.cs74
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/CSharpSelectionSurroundingProvider.cs133
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs720
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs222
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AbstractAsyncHighlighter.cs88
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AsyncAnonymousMethodHighlighter.cs29
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AsyncMethodHighlighter.cs29
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AsyncParenthesizedLambdaHighlighter.cs29
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AsyncSimpleLambdaHighlighter.cs29
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AwaitHighlighter.cs35
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/CheckedExpressionHighlighter.cs28
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/CheckedStatementHighlighter.cs19
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/ConditionalPreprocessorHighlighter.cs32
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/IfStatementHighlighter.cs75
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/LockStatementHighlighter.cs19
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/LoopHighlighter.cs118
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/RegionHighlighter.cs33
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/ReturnStatementHighlighter.cs63
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/SwitchStatementHighlighter.cs77
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/TryStatementHighlighter.cs34
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/UnsafeStatementHighlighter.cs19
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/UsingStatementHighlighter.cs19
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/YieldStatementHighlighter.cs67
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/MoveToUsagesHandler.cs35
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindBaseSymbolsHandler.cs83
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindDerivedSymbolsHandler.cs125
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindExtensionMethodsHandler.cs90
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindImplementingMembersHandler.cs104
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindMemberOverloadsHandler.cs100
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/CSharpFoldingParser.cs22
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/CSharpParsedDocument.cs484
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/McsParser.cs4
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/TypeSystemProvider.cs454
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CSharpCompilerParameters.cs161
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CSharpProjectExtension.cs187
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CSharpProjectParameters.cs84
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CSharpResourceIdBuilder.cs12
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CodeGenerationPanel.cs28
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs37
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/PortableCSharpProjectFlavor.cs47
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/Actions/ConvertToEnumAction.cs503
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/Actions/MoveTypeToFile.cs167
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/ContextActionExtensions.cs69
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringContext.cs271
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringScript.cs377
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/NRefactoryCodeAction.cs82
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/NRefactoryCodeActionProvider.cs86
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/NRefactoryCodeActionSource.cs51
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/BaseNRefactoryIssueProvider.cs103
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/Issues/MonoTODOIssue.cs141
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NRefactoryCodeIssueSource.cs57
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NRefactoryIssueProvider.cs219
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/NameConventionEditRuleDialog.cs212
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/NameConventionPanel.cs72
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/NameConventionPanelWidget.cs157
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/NameConventionPolicy.cs97
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/NameConventionRule.cs131
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerationService.cs120
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs1470
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpFeaturesTextEditorExtension.cs144
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpFindReferencesProvider.cs290
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpJumpToDeclarationHandler.cs45
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpReferenceFinder.cs359
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CodeGenerationService.cs302
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/ConstructFixer.cs208
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/ExtractMethodCommandHandler.cs114
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/FindProjectReferenceUsagesHandler.cs112
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/FindReferencesHandler.cs191
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/GotoBaseDeclarationHandler.cs112
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/GotoDeclarationHandler.cs83
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/HelperMethods.cs167
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/OrganizeImportsCommandHandler.cs166
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/RefactoryCommands.cs304
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/RenameHandler.cs96
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Resolver/DebuggerExpressionResolver.cs171
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Resolver/HelperMethods.cs105
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Resolver/TextEditorResolverProvider.cs312
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Tooltips/LanguageItemTooltipProvider.cs366
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.UnitTests/CSharpNUnitSourceCodeLocationFinder.cs76
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.UnitTests/UnitTestTextEditorExtension.cs153
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp/AstAmbience.cs269
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp/AstStockIcons.cs315
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpAmbience.cs1374
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpBindingCompilerManager.cs18
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpBraceMatcher.cs134
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpLanguageBinding.cs149
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpNavigationTextEditorExtension.cs142
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp/DeclaredSymbolInfo.cs560
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp/ExpandSelectionHandler.cs99
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp/PathedDocumentTextEditorExtension.cs652
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp/ProjectSearchCategory.cs442
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp/SignatureMarkupCreator.cs1150
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonIndentEngine.cs307
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonIndentationTracker.cs70
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonTextEditorExtension.cs125
-rw-r--r--main/src/addins/CSharpBinding/Util/7BitEncodedInts.cs123
-rw-r--r--main/src/addins/CSharpBinding/Util/AccessibilityUtilities.cs67
-rw-r--r--main/src/addins/CSharpBinding/Util/AnnotationTable.cs275
-rw-r--r--main/src/addins/CSharpBinding/Util/ArgumentSyntaxExtensions.cs119
-rw-r--r--main/src/addins/CSharpBinding/Util/CSharpSemanticFactsService.cs270
-rw-r--r--main/src/addins/CSharpBinding/Util/CSharpSyntaxContext.cs572
-rw-r--r--main/src/addins/CSharpBinding/Util/CSharpSyntaxFactsService.cs1040
-rw-r--r--main/src/addins/CSharpBinding/Util/CSharpUtil.cs183
-rw-r--r--main/src/addins/CSharpBinding/Util/CastExpressionSyntaxExtensions.cs32
-rw-r--r--main/src/addins/CSharpBinding/Util/CloneableStack.cs201
-rw-r--r--main/src/addins/CSharpBinding/Util/CodeFixContextExtensions.cs37
-rw-r--r--main/src/addins/CSharpBinding/Util/CodeGenerationSymbolFactory.cs466
-rw-r--r--main/src/addins/CSharpBinding/Util/CodeRefactoringContextExtensions.cs43
-rw-r--r--main/src/addins/CSharpBinding/Util/CommonAccessibilityUtilities.cs75
-rw-r--r--main/src/addins/CSharpBinding/Util/CommonLocationExtensions.cs28
-rw-r--r--main/src/addins/CSharpBinding/Util/CommonSyntaxNodeOrTokenExtensions.cs36
-rw-r--r--main/src/addins/CSharpBinding/Util/CompilationExtensions.cs67
-rw-r--r--main/src/addins/CSharpBinding/Util/CompilationUnitSyntaxExtensions.cs202
-rw-r--r--main/src/addins/CSharpBinding/Util/ConflictResolver.cs114
-rw-r--r--main/src/addins/CSharpBinding/Util/CrefSyntaxExtensions.cs136
-rw-r--r--main/src/addins/CSharpBinding/Util/DirectiveSyntaxExtensions.cs56
-rw-r--r--main/src/addins/CSharpBinding/Util/DocumentExtensions.cs137
-rw-r--r--main/src/addins/CSharpBinding/Util/EnumValueUtilities.cs57
-rw-r--r--main/src/addins/CSharpBinding/Util/EnumerableExtensions.cs351
-rw-r--r--main/src/addins/CSharpBinding/Util/ExpressionSyntaxExtensions.cs2380
-rw-r--r--main/src/addins/CSharpBinding/Util/FastSerializer.cs1371
-rw-r--r--main/src/addins/CSharpBinding/Util/FindTokenHelper.cs141
-rw-r--r--main/src/addins/CSharpBinding/Util/FormatStringHelper.cs98
-rw-r--r--main/src/addins/CSharpBinding/Util/GeneratedCodeRecognitionService.cs92
-rw-r--r--main/src/addins/CSharpBinding/Util/Glyph.cs130
-rw-r--r--main/src/addins/CSharpBinding/Util/Hash.cs350
-rw-r--r--main/src/addins/CSharpBinding/Util/HelpLink.cs38
-rw-r--r--main/src/addins/CSharpBinding/Util/IAssemblySymbolExtensions.cs84
-rw-r--r--main/src/addins/CSharpBinding/Util/ICodeDefinitionFactoryExtensions.cs147
-rw-r--r--main/src/addins/CSharpBinding/Util/ICompilationExtensions.cs124
-rw-r--r--main/src/addins/CSharpBinding/Util/IDictionaryExtensions.cs90
-rw-r--r--main/src/addins/CSharpBinding/Util/IDocumentExtensions.cs45
-rw-r--r--main/src/addins/CSharpBinding/Util/IMethodSymbolExtensions.cs325
-rw-r--r--main/src/addins/CSharpBinding/Util/INamedTypeSymbolExtensions.cs518
-rw-r--r--main/src/addins/CSharpBinding/Util/INamespaceOrTypeSymbolExtensions.cs69
-rw-r--r--main/src/addins/CSharpBinding/Util/IParameterSymbolExtensions.cs43
-rw-r--r--main/src/addins/CSharpBinding/Util/IPropertySymbolExtensions.cs69
-rw-r--r--main/src/addins/CSharpBinding/Util/ISymbolExtensions.cs49
-rw-r--r--main/src/addins/CSharpBinding/Util/ITypeParameterSymbolExtensions.cs26
-rw-r--r--main/src/addins/CSharpBinding/Util/ITypeSymbolExtensions.cs1108
-rw-r--r--main/src/addins/CSharpBinding/Util/ImmutableArrayExtensions.cs60
-rw-r--r--main/src/addins/CSharpBinding/Util/LinkedListExtension.cs50
-rw-r--r--main/src/addins/CSharpBinding/Util/Matcher.cs188
-rw-r--r--main/src/addins/CSharpBinding/Util/MemberDeclarationSyntaxExtensions.cs341
-rw-r--r--main/src/addins/CSharpBinding/Util/NRefactory6Host.cs39
-rw-r--r--main/src/addins/CSharpBinding/Util/NameGenerator.cs159
-rw-r--r--main/src/addins/CSharpBinding/Util/NameSyntaxComparer.cs177
-rw-r--r--main/src/addins/CSharpBinding/Util/NameSyntaxExtensions.cs119
-rw-r--r--main/src/addins/CSharpBinding/Util/NamespaceDeclarationSyntaxExtensions.cs50
-rw-r--r--main/src/addins/CSharpBinding/Util/ObjectExtensions.cs7667
-rw-r--r--main/src/addins/CSharpBinding/Util/PredefinedOperator.cs32
-rw-r--r--main/src/addins/CSharpBinding/Util/QueryExpressionSyntaxExtensions.cs49
-rw-r--r--main/src/addins/CSharpBinding/Util/RefactoringHelpers.cs140
-rw-r--r--main/src/addins/CSharpBinding/Util/ReferenceComparer.cs39
-rw-r--r--main/src/addins/CSharpBinding/Util/ReflectionCompatibilityExtensions.cs127
-rw-r--r--main/src/addins/CSharpBinding/Util/SemanticDocument.cs30
-rw-r--r--main/src/addins/CSharpBinding/Util/SemanticEquivalence.cs69
-rw-r--r--main/src/addins/CSharpBinding/Util/SemanticMap.cs81
-rw-r--r--main/src/addins/CSharpBinding/Util/SemanticModelExtensions.cs622
-rw-r--r--main/src/addins/CSharpBinding/Util/SignatureComparer.cs94
-rw-r--r--main/src/addins/CSharpBinding/Util/SimpleNameSyntaxExtensions.cs64
-rw-r--r--main/src/addins/CSharpBinding/Util/SourceTextExtensions.cs191
-rw-r--r--main/src/addins/CSharpBinding/Util/SpecializedCollections.cs673
-rw-r--r--main/src/addins/CSharpBinding/Util/SpeculationAnalyzer.cs137
-rw-r--r--main/src/addins/CSharpBinding/Util/StringExtensions.cs551
-rw-r--r--main/src/addins/CSharpBinding/Util/StringPclExtensions.cs32
-rw-r--r--main/src/addins/CSharpBinding/Util/SymbolEquivalenceComparer.cs49
-rw-r--r--main/src/addins/CSharpBinding/Util/SymbolExtensions.cs1382
-rw-r--r--main/src/addins/CSharpBinding/Util/SymbolInfoExtensions.cs73
-rw-r--r--main/src/addins/CSharpBinding/Util/SymbolKeyExtensions.cs151
-rw-r--r--main/src/addins/CSharpBinding/Util/SymbolKeyResolutionExtensions.cs44
-rw-r--r--main/src/addins/CSharpBinding/Util/SyntacticDocument.cs39
-rw-r--r--main/src/addins/CSharpBinding/Util/SyntaxContext.cs180
-rw-r--r--main/src/addins/CSharpBinding/Util/SyntaxExtensions.cs550
-rw-r--r--main/src/addins/CSharpBinding/Util/SyntaxKindSet.cs112
-rw-r--r--main/src/addins/CSharpBinding/Util/SyntaxListExtension.cs33
-rw-r--r--main/src/addins/CSharpBinding/Util/SyntaxNodeExtensions.cs1721
-rw-r--r--main/src/addins/CSharpBinding/Util/SyntaxTokenExtensions.cs1111
-rw-r--r--main/src/addins/CSharpBinding/Util/SyntaxTreeExtensions.cs3322
-rw-r--r--main/src/addins/CSharpBinding/Util/SyntaxTriviaExtensions.cs209
-rw-r--r--main/src/addins/CSharpBinding/Util/SyntaxTriviaListExtensions.cs48
-rw-r--r--main/src/addins/CSharpBinding/Util/TaskExtensions.cs363
-rw-r--r--main/src/addins/CSharpBinding/Util/TextLineExtension.cs63
-rw-r--r--main/src/addins/CSharpBinding/Util/TokenComparer.cs83
-rw-r--r--main/src/addins/CSharpBinding/Util/TypeDeclarationSyntaxExtensions.cs321
-rw-r--r--main/src/addins/CSharpBinding/Util/TypeExtensions.cs154
-rw-r--r--main/src/addins/CSharpBinding/Util/TypeGenerator.cs104
-rw-r--r--main/src/addins/CSharpBinding/Util/TypeSyntaxComparer.cs64
-rw-r--r--main/src/addins/CSharpBinding/Util/TypeSyntaxExtensions.cs114
-rw-r--r--main/src/addins/CSharpBinding/Util/UsingsAndExternAliasesDirectiveComparer.cs121
-rw-r--r--main/src/addins/CSharpBinding/Util/UsingsAndExternAliasesOrganizer.cs63
-rw-r--r--main/src/addins/CSharpBinding/Util/ValueTuple.cs18
-rw-r--r--main/src/addins/CSharpBinding/Util/ValueTuple`2.cs57
-rw-r--r--main/src/addins/CSharpBinding/Util/WordParser.cs71
-rw-r--r--main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.cs94
-rw-r--r--main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionEditRuleDialog.cs394
-rw-r--r--main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionPanelWidget.cs95
-rw-r--r--main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Formatting.CSharpFormattingPolicyPanelWidget.cs6
-rw-r--r--main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs484
-rw-r--r--main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.cs8
-rw-r--r--main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Project.CodeGenerationPanelWidget.cs31
-rw-r--r--main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Project.CompilerOptionsPanelWidget.cs27
-rw-r--r--main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionEditRuleDialog.cs366
-rw-r--r--main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionPanelWidget.cs89
-rw-r--r--main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CodeGeneration.GenerateCodeWindow.cs6
-rw-r--r--main/src/addins/CSharpBinding/gtk-gui/generated.cs6
-rw-r--r--main/src/addins/CSharpBinding/gtk-gui/gui.stetic733
-rw-r--r--main/src/addins/CSharpBinding/templates/AssemblyInfo.xft.xml2
-rw-r--r--main/src/addins/CSharpBinding/templates/PortableLibrary.xpt.xml3
-rw-r--r--main/src/addins/CSharpBinding/templates/SharedAssetsProject.xpt.xml1
-rw-r--r--main/src/addins/ChangeLog183
-rw-r--r--main/src/addins/ChangeLogAddIn/AddLogEntryDialog.cs2
-rw-r--r--main/src/addins/ChangeLogAddIn/ChangeLog665
-rw-r--r--main/src/addins/ChangeLogAddIn/ChangeLogAddIn.addin.xml2
-rw-r--r--main/src/addins/ChangeLogAddIn/ChangeLogAddIn.cs26
-rw-r--r--main/src/addins/ChangeLogAddIn/ChangeLogAddIn.csproj10
-rw-r--r--main/src/addins/ChangeLogAddIn/ChangeLogService.cs10
-rw-r--r--main/src/addins/ChangeLogAddIn/CommitDialogExtensionWidget.cs4
-rw-r--r--main/src/addins/ChangeLogAddIn/ProjectOptionPanel.cs4
-rw-r--r--main/src/addins/ChangeLogAddIn/ProjectOptionPanelWidget.cs2
-rw-r--r--main/src/addins/ChangeLogAddIn/gtk-gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs44
-rw-r--r--main/src/addins/ChangeLogAddIn/gtk-gui/generated.cs34
-rw-r--r--main/src/addins/ChangeLogAddIn/gtk-gui/gui.stetic17
-rw-r--r--main/src/addins/Deployment/ChangeLog4
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment.Linux/AddinInfo.cs9
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment.Linux/ChangeLog517
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux.addin.xml13
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux.csproj30
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/BasicOptionPanel.cs7
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/BasicOptionPanelWidget.cs4
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopDisplayBinding.cs2
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopView.cs18
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/LinuxDeployData.cs54
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/AddinInfo.cs9
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/ChangeLog1092
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Commands/Commands.cs10
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployDialog.cs13
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployOperations.cs36
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DialogFileReplacePolicy.cs6
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/EditPackageDialog.cs2
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/EntrySelectionTree.cs53
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/InstallDialog.cs2
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/PackagingFeatureWidget.cs13
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/SourcesZipEditorWidget.cs12
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.NodeBuilders/PackageNodeBuilder.cs13
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.NodeBuilders/PackagingProjectNodeBuilder.cs15
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/BaseFuseFileCopyHandler.cs19
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/BinariesZipPackageBuilder.cs26
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/CommandPackageBuilder.cs46
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/LocalFileCopyHandler.cs8
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/SourcesZipPackageBuilder.cs37
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/SshFuseFileCopyHandler.cs2
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.addin.xml16
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.csproj90
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DefaultDeployServiceExtension.cs2
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DeployFile.cs8
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DeployProperties.cs67
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DeployService.cs23
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DeployServiceExtension.cs4
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/FileCopyConfiguration.cs2
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/FileCopyHandler.cs2
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/IFileCopyHandler.cs2
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/InstallResolver.cs10
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/Package.cs10
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/PackageBuilder.cs58
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/PackagingProject.cs34
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/UnknownPackageBuilder.cs2
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.FileReplaceDialog.cs77
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs59
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/generated.cs34
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/gui.stetic17
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16.pngbin448 -> 383 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16@2x.pngbin984 -> 855 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~dark.pngbin0 -> 383 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~dark@2x.pngbin0 -> 842 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~dark~sel.pngbin0 -> 281 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~dark~sel@2x.pngbin0 -> 576 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~sel.pngbin0 -> 281 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~sel@2x.pngbin0 -> 576 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32.pngbin984 -> 855 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32@2x.pngbin1993 -> 1741 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~dark.pngbin0 -> 842 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~dark@2x.pngbin0 -> 1754 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~dark~sel.pngbin0 -> 576 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~dark~sel@2x.pngbin0 -> 1198 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~sel.pngbin0 -> 576 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~sel@2x.pngbin0 -> 1198 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48.pngbin1390 -> 1039 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48@2x.pngbin3184 -> 2266 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~dark.pngbin0 -> 996 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~dark@2x.pngbin0 -> 2227 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~dark~sel.pngbin0 -> 726 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~dark~sel@2x.pngbin0 -> 1592 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~sel.pngbin0 -> 726 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~sel@2x.pngbin0 -> 1592 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/packaging-project.pngbin4572 -> 3038 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/packaging-project@2x.pngbin12488 -> 7253 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/packaging-project~dark.pngbin0 -> 2932 bytes
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/packaging-project~dark@2x.pngbin0 -> 7157 bytes
-rw-r--r--main/src/addins/GnomePlatform/ChangeLog236
-rw-r--r--main/src/addins/GnomePlatform/GnomePlatform.cs4
-rw-r--r--main/src/addins/ILAsmBinding/ChangeLog468
-rw-r--r--main/src/addins/ILAsmBinding/Gui/CompilerParametersPanelWidget.cs7
-rw-r--r--main/src/addins/ILAsmBinding/ILAsmBinding.addin.xml17
-rw-r--r--main/src/addins/ILAsmBinding/ILAsmBinding.csproj2
-rw-r--r--main/src/addins/ILAsmBinding/ILAsmCompilerManager.cs4
-rw-r--r--main/src/addins/ILAsmBinding/ILAsmLanguageBinding.cs95
-rw-r--r--main/src/addins/ILAsmBinding/ILAsmProject.cs56
-rw-r--r--main/src/addins/ILAsmBinding/Project/ILAsmCompilerParameters.cs2
-rw-r--r--main/src/addins/MacPlatform/ChangeLog861
-rw-r--r--main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs15
-rw-r--r--main/src/addins/MacPlatform/Dialogs/MacExceptionDialogHandler.cs260
-rw-r--r--main/src/addins/MacPlatform/Dialogs/MacOpenFileDialogHandler.cs11
-rw-r--r--main/src/addins/MacPlatform/Dialogs/MacSelectFileDialogHandler.cs1
-rw-r--r--main/src/addins/MacPlatform/Dialogs/SelectEncodingPopUpButton.cs1
-rw-r--r--main/src/addins/MacPlatform/ExtendedTitleBarDialogBackend.cs23
-rw-r--r--main/src/addins/MacPlatform/ExtendedTitleBarWindowBackend.cs24
-rw-r--r--main/src/addins/MacPlatform/MacExternalConsoleProcess.cs103
-rw-r--r--main/src/addins/MacPlatform/MacInterop/CoreFoundation.cs4
-rw-r--r--main/src/addins/MacPlatform/MacInterop/Keychain.cs6
-rw-r--r--main/src/addins/MacPlatform/MacInterop/LaunchServices.cs166
-rw-r--r--main/src/addins/MacPlatform/MacInterop/ProcessManager.cs21
-rw-r--r--main/src/addins/MacPlatform/MacPlatform.addin.xml1
-rw-r--r--main/src/addins/MacPlatform/MacPlatform.cs212
-rw-r--r--main/src/addins/MacPlatform/MacPlatform.csproj45
-rw-r--r--main/src/addins/MacPlatform/MacProxyCredentialProvider.cs4
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/AwesomeBar.cs188
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/ButtonBar.cs72
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/ButtonBarContainer.cs105
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/CALayerExtensions.cs57
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/CenteringSpace.cs132
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/MainToolbar.cs350
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/MultiResImage.cs103
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/RunButton.cs87
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/SearchBar.cs207
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/SelectorView.cs413
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/StatusBar.cs907
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/Styles.cs79
-rw-r--r--main/src/addins/MacPlatform/MimeMapLoader.cs72
-rw-r--r--main/src/addins/MacPlatform/ScreenMonitor.cs101
-rw-r--r--main/src/addins/MacPlatform/icons/build.pngbin1460 -> 280 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/build@2x.pngbin1642 -> 434 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/build~dark.pngbin0 -> 198 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/build~dark@2x.pngbin0 -> 289 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/continue.pngbin1470 -> 297 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/continue@2x.pngbin1646 -> 418 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/continue~dark.pngbin0 -> 177 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/continue~dark@2x.pngbin0 -> 244 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/device.pngbin1302 -> 152 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/device@2x.pngbin1416 -> 253 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/device~dark.pngbin0 -> 125 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/device~dark@2x.pngbin0 -> 188 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/project.pngbin1319 -> 136 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/project@2x.pngbin1397 -> 202 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/project~dark.pngbin0 -> 128 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/project~dark@2x.pngbin0 -> 174 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/stop.pngbin1261 -> 100 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/stop@2x.pngbin1283 -> 114 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/stop~dark.pngbin0 -> 100 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/stop~dark@2x.pngbin0 -> 114 bytes
-rw-r--r--main/src/addins/MacPlatform/maintoolbarbg~dark.pngbin0 -> 177 bytes
-rw-r--r--main/src/addins/MacPlatform/maintoolbarbg~dark@2x.pngbin0 -> 234 bytes
-rw-r--r--main/src/addins/Makefile.am4
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/ChangeLog1122
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser.addin.xml2
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser.csproj28
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserNavigationPoint.cs103
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserViewContent.cs106
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs621
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyLoader.cs37
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyReferenceFolder.cs1
-rwxr-xr-xmain/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/ColoredCSharpFormatter.cs20
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DisplayBinding.cs6
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DocumentationPanel.cs2
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/HelpExtensions.cs168
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/IAssemblyBrowserNodeBuilder.cs8
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/NRefactoryStock.cs232
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyBrowserTypeNodeBuilder.cs24
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyNodeBuilder.cs41
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyReferenceFolderNodeBuilder.cs6
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyResourceFolderNodeBuilder.cs4
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/BaseTypeFolderNodeBuilder.cs4
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomEventNodeBuilder.cs22
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomFieldNodeBuilder.cs22
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomMethodNodeBuilder.cs66
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomPropertyNodeBuilder.cs22
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomTypeNodeBuilder.cs77
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/ErrorNodeBuilder.cs2
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/NamespaceBuilder.cs8
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/ProjectNodeBuilder.cs51
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/ResourceNodeBuilder.cs2
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/XmlDocIdLib/XmlDocIdGenerator.cs44
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs94
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/generated.cs52
-rw-r--r--main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/gui.stetic29
-rw-r--r--main/src/addins/MonoDevelop.Autotools/AutotoolsContext.cs8
-rw-r--r--main/src/addins/MonoDevelop.Autotools/ChangeLog1742
-rw-r--r--main/src/addins/MonoDevelop.Autotools/Commands.cs10
-rw-r--r--main/src/addins/MonoDevelop.Autotools/FileNodeBuilderExtension.cs12
-rw-r--r--main/src/addins/MonoDevelop.Autotools/Handler.cs25
-rw-r--r--main/src/addins/MonoDevelop.Autotools/IMakefileHandler.cs4
-rw-r--r--main/src/addins/MonoDevelop.Autotools/MakefileData.cs55
-rw-r--r--main/src/addins/MonoDevelop.Autotools/MakefileGeneratorTool.cs5
-rw-r--r--main/src/addins/MonoDevelop.Autotools/MakefileOptionPanel.cs6
-rw-r--r--main/src/addins/MonoDevelop.Autotools/MakefileOptionPanelWidget.cs6
-rw-r--r--main/src/addins/MonoDevelop.Autotools/MakefileProject.cs16
-rw-r--r--main/src/addins/MonoDevelop.Autotools/MakefileProjectServiceExtension.cs185
-rw-r--r--main/src/addins/MonoDevelop.Autotools/MonoDevelop.Autotools.addin.xml10
-rw-r--r--main/src/addins/MonoDevelop.Autotools/MonoDevelop.Autotools.csproj1
-rw-r--r--main/src/addins/MonoDevelop.Autotools/PropertyProvider.cs4
-rw-r--r--main/src/addins/MonoDevelop.Autotools/SimpleProjectMakefileHandler.cs32
-rw-r--r--main/src/addins/MonoDevelop.Autotools/SolutionDeployer.cs16
-rw-r--r--main/src/addins/MonoDevelop.Autotools/SolutionMakefileHandler.cs58
-rw-r--r--main/src/addins/MonoDevelop.Autotools/TarballBuilderEditorWidget.cs2
-rw-r--r--main/src/addins/MonoDevelop.CodeMetrics/ChangeLog265
-rw-r--r--main/src/addins/MonoDevelop.Debugger.Gdb/ChangeLog365
-rw-r--r--main/src/addins/MonoDevelop.Debugger.Gdb/GdbSession.cs2
-rw-r--r--main/src/addins/MonoDevelop.Debugger.Soft/ChangeLog59
-rw-r--r--main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/AspNetSoftDebuggerEngine.cs5
-rw-r--r--main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/ChangeLog78
-rw-r--r--main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.Moonlight/ChangeLog90
-rw-r--r--main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/ChangeLog639
-rw-r--r--main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/CustomSoftDebuggerEngine.cs9
-rw-r--r--main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/SoftDebuggerEngine.cs18
-rw-r--r--main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/ChangeLog6
-rw-r--r--main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/AddinInfo.cs2
-rw-r--r--main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/ChangeLog49
-rw-r--r--main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/CorDebuggerEngine.cs9
-rw-r--r--main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/CorObjectAdaptor.cs4
-rw-r--r--main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32.csproj4
-rw-r--r--main/src/addins/MonoDevelop.Debugger/ChangeLog1439
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs16
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs7
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests.TestApp/ChangeLog19
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests.TestApp/TestEvaluation.cs49
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/BreakpointsAndSteppingTests.cs7
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/ChangeLog44
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/DebugTests.cs23
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/EvaluationTests.cs361
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/MonoDevelop.Debugger.Tests.csproj5
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.addin.xml20
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj365
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs103
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPropertiesDialog.cs78
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BusyEvaluatorDialog.cs37
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebugCommands.cs77
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebugExecutionHandlerFactory.cs104
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebugTextMarker.cs281
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerConsoleView.cs21
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs3
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs172
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DisassemblyView.cs229
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs18
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExpressionEvaluatorDialog.cs14
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Extensions.cs40
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/IDebuggerExpressionResolver.cs24
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ImmediatePad.cs13
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/InfoFrame.cs59
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Initializer.cs6
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/LocalsPad.cs2
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValuePad.cs20
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs123
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/PinnedWatchStore.cs2
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs49
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Styles.cs104
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/TextEntryWithCodeCompletion.cs32
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ThreadsPad.cs42
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16.pngbin940 -> 473 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16@2x.pngbin2618 -> 1174 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~dark.pngbin0 -> 469 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~dark@2x.pngbin0 -> 1171 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~dark~disabled.pngbin0 -> 469 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~dark~disabled@2x.pngbin0 -> 1151 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~disabled.pngbin0 -> 498 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~disabled@2x.pngbin0 -> 1207 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/continue-16~dark.pngbin0 -> 362 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/continue-16~dark@2x.pngbin0 -> 697 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-16.pngbin754 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-16@2x.pngbin807 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-22.pngbin1622 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-22@2x.pngbin1659 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-24.pngbin1621 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-24@2x.pngbin2612 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-32.pngbin1639 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-32@2x.pngbin2662 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/exception-48.pngbin0 -> 1356 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/exception-48@2x.pngbin0 -> 2649 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/exception-48~dark.pngbin0 -> 1272 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/exception-48~dark@2x.pngbin0 -> 2532 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-15.pngbin740 -> 511 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-15@2x.pngbin1703 -> 845 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-15~dark.pngbin0 -> 512 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-15~dark@2x.pngbin0 -> 848 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-disabled-15.pngbin637 -> 465 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-disabled-15@2x.pngbin1372 -> 814 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-disabled-15~dark.pngbin0 -> 503 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-disabled-15~dark@2x.pngbin0 -> 777 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-invalid-15.pngbin750 -> 406 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-invalid-15@2x.pngbin1525 -> 610 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-invalid-15~dark.pngbin0 -> 387 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-invalid-15~dark@2x.pngbin0 -> 596 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-execution-15.pngbin242 -> 122 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-execution-15@2x.pngbin425 -> 212 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-execution-15~dark.pngbin0 -> 122 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-execution-15~dark@2x.pngbin0 -> 212 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-stack-15.pngbin281 -> 226 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-stack-15@2x.pngbin669 -> 402 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-stack-15~dark.pngbin0 -> 218 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-stack-15~dark@2x.pngbin0 -> 398 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-15.pngbin631 -> 219 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-15@2x.pngbin1428 -> 336 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-15~dark.pngbin0 -> 223 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-15~dark@2x.pngbin0 -> 337 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-disabled-15.pngbin429 -> 219 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-disabled-15@2x.pngbin1084 -> 336 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-disabled-15~dark.pngbin0 -> 226 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-disabled-15~dark@2x.pngbin0 -> 335 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-invalid-15.pngbin578 -> 171 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-invalid-15@2x.pngbin1199 -> 296 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-invalid-15~dark.pngbin0 -> 170 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-invalid-15~dark@2x.pngbin0 -> 294 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/lightning-16.pngbin487 -> 338 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/lightning-16@2x.pngbin1171 -> 532 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/lightning-16~dark.pngbin0 -> 306 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/lightning-16~dark@2x.pngbin0 -> 500 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/lightning-16~dark~disabled.pngbin0 -> 316 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/lightning-16~dark~disabled@2x.pngbin0 -> 511 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/lightning-16~disabled.pngbin0 -> 314 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/lightning-16~disabled@2x.pngbin0 -> 506 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/continue-16.pngbin327 -> 275 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/continue-16@2x.pngbin376 -> 399 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/continue-16~dark.pngbin0 -> 166 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/continue-16~dark@2x.pngbin0 -> 232 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/pause-16.pngbin0 -> 101 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/pause-16@2x.pngbin0 -> 120 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/pause-16~dark.pngbin0 -> 98 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/pause-16~dark@2x.pngbin0 -> 116 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/pause.pngbin210 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/pause@2x.pngbin212 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16.pngbin247 -> 165 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16@2x.pngbin294 -> 244 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~dark.pngbin0 -> 160 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~dark@2x.pngbin0 -> 248 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~disabled.pngbin0 -> 161 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~disabled@2x.pngbin0 -> 254 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~disabled~dark.pngbin0 -> 161 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~disabled~dark@2x.pngbin0 -> 253 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16.pngbin249 -> 162 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16@2x.pngbin296 -> 238 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~dark.pngbin0 -> 162 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~dark@2x.pngbin0 -> 248 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~disabled.pngbin0 -> 166 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~disabled@2x.pngbin0 -> 253 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~disabled~dark.pngbin0 -> 166 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~disabled~dark@2x.pngbin0 -> 252 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16.pngbin426 -> 279 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16@2x.pngbin596 -> 496 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~dark.pngbin0 -> 273 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~dark@2x.pngbin0 -> 448 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~disabled.pngbin0 -> 273 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~disabled@2x.pngbin0 -> 492 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~disabled~dark.pngbin0 -> 271 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~disabled~dark@2x.pngbin0 -> 493 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16.pngbin0 -> 465 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16@2x.pngbin0 -> 1172 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~dark.pngbin0 -> 451 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~dark@2x.pngbin0 -> 1099 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~dark~sel.pngbin0 -> 343 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~dark~sel@2x.pngbin0 -> 675 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~sel.pngbin0 -> 343 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~sel@2x.pngbin0 -> 675 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16.pngbin513 -> 179 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16@2x.pngbin1309 -> 308 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~dark.pngbin0 -> 188 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~dark@2x.pngbin0 -> 306 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~dark~sel.pngbin0 -> 175 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~dark~sel@2x.pngbin0 -> 312 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~sel.pngbin0 -> 175 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~sel@2x.pngbin0 -> 312 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16.pngbin595 -> 155 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16@2x.pngbin1245 -> 259 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~dark.pngbin0 -> 156 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~dark@2x.pngbin0 -> 257 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~dark~sel.pngbin0 -> 157 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~dark~sel@2x.pngbin0 -> 243 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~sel.pngbin0 -> 157 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~sel@2x.pngbin0 -> 243 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16.pngbin713 -> 359 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16@2x.pngbin1843 -> 614 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~dark.pngbin0 -> 357 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~dark@2x.pngbin0 -> 556 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~dark~sel.pngbin0 -> 259 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~dark~sel@2x.pngbin0 -> 356 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~sel.pngbin0 -> 259 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~sel@2x.pngbin0 -> 356 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16.pngbin673 -> 263 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16@2x.pngbin1262 -> 702 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~dark.pngbin0 -> 266 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~dark@2x.pngbin0 -> 687 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~dark~sel.pngbin0 -> 206 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~dark~sel@2x.pngbin0 -> 468 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~sel.pngbin0 -> 206 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~sel@2x.pngbin0 -> 468 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pause-16~dark.pngbin0 -> 222 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/pause-16~dark@2x.pngbin0 -> 276 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16.pngbin754 -> 373 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16@2x.pngbin1835 -> 734 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~dark.pngbin0 -> 374 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~dark@2x.pngbin0 -> 719 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~dark~sel.pngbin0 -> 275 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~dark~sel@2x.pngbin0 -> 550 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~sel.pngbin0 -> 275 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~sel@2x.pngbin0 -> 550 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16.pngbin466 -> 229 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16@2x.pngbin974 -> 408 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~dark.pngbin0 -> 227 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~dark@2x.pngbin0 -> 406 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~dark~disabled.pngbin0 -> 219 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~dark~disabled@2x.pngbin0 -> 377 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~disabled.pngbin0 -> 222 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~disabled@2x.pngbin0 -> 392 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/step-in-16~dark.pngbin0 -> 310 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/step-in-16~dark@2x.pngbin0 -> 628 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/step-out-16~dark.pngbin0 -> 314 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/step-out-16~dark@2x.pngbin0 -> 612 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/step-over-16~dark.pngbin0 -> 519 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger/icons/step-over-16~dark@2x.pngbin0 -> 1198 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/ChangeLog2074
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ComponentNodeBuilder.cs4
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/PropertyPadTextEditorExtension.cs11
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/SolutionItemDescriptor.cs17
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/SolutionItemPropertyProvider.cs4
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/WorkspaceItemDescriptor.cs2
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/CodeTemplateToolboxProvider.cs8
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ComponentSelectorDialog.cs5
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/IToolboxLoader.cs2
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ItemToolboxNode.cs17
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs9
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs49
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/TypeReference.cs8
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.addin.xml1
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj92
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/BindingService.cs578
-rwxr-xr-xmain/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ClassOutlineNodeComparer.cs303
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ClassOutlineSettings.cs106
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ClassOutlineSortingPreferencesDialog.cs77
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs443
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/CodeBehind.cs47
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/CodeBehindWriter.cs47
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs9
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ErrorInFileException.cs8
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/MemberExistsException.cs252
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPad.cs14
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPadVisitor.cs4
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxPad.cs7
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxService.cs10
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/TypeNotFoundException.cs4
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/WrapperDesignView.cs71
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.ClassOutlineSortingPreferencesDialog.cs90
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs115
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/generated.cs34
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/gui.stetic136
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/compact-display-16.pngbin312 -> 148 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/compact-display-16@2x.pngbin600 -> 252 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/compact-display-16~dark.pngbin0 -> 148 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/compact-display-16~dark@2x.pngbin0 -> 247 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16.pngbin417 -> 206 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16@2x.pngbin805 -> 317 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~dark.pngbin0 -> 200 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~dark@2x.pngbin0 -> 313 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~dark~sel.pngbin0 -> 190 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~dark~sel@2x.pngbin0 -> 282 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~sel.pngbin0 -> 190 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~sel@2x.pngbin0 -> 282 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16.pngbin329 -> 188 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16@2x.pngbin597 -> 328 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~dark.pngbin0 -> 180 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~dark@2x.pngbin0 -> 323 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~dark~sel.pngbin0 -> 167 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~dark~sel@2x.pngbin0 -> 293 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~sel.pngbin0 -> 167 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~sel@2x.pngbin0 -> 293 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16.pngbin570 -> 339 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16@2x.pngbin1162 -> 635 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~dark.pngbin0 -> 337 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~dark@2x.pngbin0 -> 607 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~dark~sel.pngbin0 -> 252 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~dark~sel@2x.pngbin0 -> 479 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~sel.pngbin0 -> 252 bytes
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~sel@2x.pngbin0 -> 479 bytes
-rw-r--r--main/src/addins/MonoDevelop.DocFood/ChangeLog64
-rw-r--r--main/src/addins/MonoDevelop.DocFood/DocFood.addin.xml2
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/AcronymsPanelWidget.cs3
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/ExpansionsPanelWidget.cs3
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/NoTheReorderingWidget.cs3
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/OfTheReorderingWidget.cs3
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/OptionsPanelWidget.cs3
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/RulesPanelWidget.cs3
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.csproj35
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/Commands.cs109
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocFoodTextEditorExtension.cs145
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocGenerator.cs330
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/IfNotStatement.cs3
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/IfStatement.cs3
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/MemberVisitor.cs25
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/Node.cs7
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/Section.cs3
-rw-r--r--main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/SwitchStatement.cs11
-rw-r--r--main/src/addins/MonoDevelop.DocFood/gtk-gui/generated.cs1
-rw-r--r--main/src/addins/MonoDevelop.Gettext/ChangeLog1512
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/CatalogEditorView.cs25
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/GettextEditorDisplayBinding.cs4
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs162
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/Styles.cs66
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.NodeBuilders/ProjectFileNodeBuilderExtension.cs18
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.NodeBuilders/TranslationNodeBuilder.cs20
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs24
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.addin.xml30
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj192
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/Catalog.cs6
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/GettextFeatureWidget.cs6
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/GettextTool.cs9
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/IFileScanner.cs2
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/MakefileHandler.cs4
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/PropertyProvider.cs9
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/RegexFileScanner.cs2
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/StringEscaping.cs56
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/Translation.cs2
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationProject.cs103
-rw-r--r--main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationProjectOptionsDialog.cs16
-rw-r--r--main/src/addins/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs321
-rw-r--r--main/src/addins/MonoDevelop.Gettext/gtk-gui/generated.cs4
-rw-r--r--main/src/addins/MonoDevelop.Gettext/gtk-gui/gui.stetic113
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/done-16.pngbin825 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/done-16@2x.pngbin1943 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/error-16.pngbin894 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/error-16@2x.pngbin1967 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/file-locale-16.pngbin0 -> 250 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/file-locale-16@2x.pngbin0 -> 407 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~dark.pngbin0 -> 206 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~dark@2x.pngbin0 -> 350 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~dark~sel.pngbin0 -> 194 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~dark~sel@2x.pngbin0 -> 327 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~sel.pngbin0 -> 206 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~sel@2x.pngbin0 -> 361 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/file-locale-32.pngbin0 -> 407 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/file-locale-32@2x.pngbin0 -> 692 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~dark.pngbin0 -> 350 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~dark@2x.pngbin0 -> 556 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~dark~sel.pngbin0 -> 327 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~dark~sel@2x.pngbin0 -> 558 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~sel.pngbin0 -> 361 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~sel@2x.pngbin0 -> 717 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/gettext-overlay-16.pngbin546 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/gettext-overlay-32.pngbin1565 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/locale-16.pngbin0 -> 190 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/locale-16@2x.pngbin0 -> 263 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/locale-16~dark.pngbin0 -> 190 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/locale-16~dark@2x.pngbin0 -> 253 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/locale-16~dark~sel.pngbin0 -> 150 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/locale-16~dark~sel@2x.pngbin0 -> 268 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/locale-16~sel.pngbin0 -> 150 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/locale-16~sel@2x.pngbin0 -> 268 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/locale-project.pngbin0 -> 1651 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/locale-project@2x.pngbin0 -> 4349 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/locale-project~dark.pngbin0 -> 1559 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/locale-project~dark@2x.pngbin0 -> 4327 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/locale_16x16.pngbin777 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/locale_22x22.pngbin1210 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/locale_32x32.pngbin1769 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16.pngbin598 -> 248 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16@2x.pngbin1732 -> 609 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~dark.pngbin0 -> 244 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~dark@2x.pngbin0 -> 583 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~dark~sel.pngbin0 -> 207 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~dark~sel@2x.pngbin0 -> 483 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~sel.pngbin0 -> 207 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~sel@2x.pngbin0 -> 483 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/project-locale-16.pngbin0 -> 237 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/project-locale-16@2x.pngbin0 -> 400 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~dark.pngbin0 -> 229 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~dark@2x.pngbin0 -> 398 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~dark~sel.pngbin0 -> 198 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~dark~sel@2x.pngbin0 -> 332 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~sel.pngbin0 -> 198 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~sel@2x.pngbin0 -> 332 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32.pngbin0 -> 223 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32@2x.pngbin0 -> 346 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~dark.pngbin0 -> 223 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~dark@2x.pngbin0 -> 339 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~dark~sel.pngbin0 -> 187 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~dark~sel@2x.pngbin0 -> 350 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~sel.pngbin0 -> 187 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~sel@2x.pngbin0 -> 350 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/warning-16.pngbin669 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/icons/warning-16@2x.pngbin1348 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Gettext/templates/TranslationProject.xpt.xml3
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/ChangeLog2796
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/GtkDesignerOptionsPanelWidget.cs4
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs8
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs5
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs107
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs36
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ClassUtils.cs23
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs231
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs94
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs80
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs47
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs122
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs44
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs69
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs34
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs7
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs8
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs2
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs10
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs17
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.addin.xml9
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.csproj45
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/GtkDesignInfo.cs33
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ObjectsDocument.cs40
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ProjectResourceProvider.cs4
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ReferenceManager.cs12
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs10
-rw-r--r--[-rwxr-xr-x]main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/WidgetParser.cs176
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/libstetic/ChangeLog1748
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/libstetic/Placeholder.cs2
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/libstetic/PropertyEditorCell.cs3
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/libstetic/editor/PropertyTextEditor.cs83
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Text.cs2
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/libstetic/editor/TextEditor.cs83
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/libstetic/libstetic.csproj2
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/libsteticui/ChangeLog228
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/libsteticui/PropertyTree.cs2
-rw-r--r--main/src/addins/MonoDevelop.GtkCore2/ChangeLog2935
-rw-r--r--main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore.Commands/ChangeLog4
-rw-r--r--main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore.Dialogs/ChangeLog18
-rw-r--r--main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore.GuiBuilder/ChangeLog101
-rw-r--r--main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore.NodeBuilders/ChangeLog83
-rw-r--r--main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore/ChangeLog68
-rw-r--r--main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore2.addin.xml2
-rw-r--r--main/src/addins/MonoDevelop.GtkCore2/changes.patch2
-rw-r--r--main/src/addins/MonoDevelop.GtkCore2/gtk-gui/ChangeLog50
-rw-r--r--main/src/addins/MonoDevelop.GtkCore2/icons/ChangeLog5
-rw-r--r--main/src/addins/MonoDevelop.GtkCore2/libstetic/ChangeLog1793
-rw-r--r--main/src/addins/MonoDevelop.GtkCore2/libstetic/Placeholder.cs2
-rw-r--r--main/src/addins/MonoDevelop.GtkCore2/libstetic/PropertyEditorCell.cs1
-rw-r--r--main/src/addins/MonoDevelop.GtkCore2/libstetic/editor/ChangeLog16
-rw-r--r--main/src/addins/MonoDevelop.GtkCore2/libstetic/wrapper/ChangeLog12
-rw-r--r--main/src/addins/MonoDevelop.GtkCore2/libsteticui/ChangeLog431
-rw-r--r--main/src/addins/MonoDevelop.GtkCore2/libsteticui/PropertyTree.cs2
-rw-r--r--main/src/addins/MonoDevelop.GtkCore2/templates/ChangeLog4
-rw-r--r--main/src/addins/MonoDevelop.HexEditor/ChangeLog137
-rw-r--r--main/src/addins/MonoDevelop.HexEditor/Mono.MHex.Data/Buffer.cs11
-rw-r--r--main/src/addins/MonoDevelop.HexEditor/Mono.MHex/HexEditor.cs15
-rw-r--r--main/src/addins/MonoDevelop.HexEditor/Mono.MHex/HexEditorDebugger.cs2
-rw-r--r--main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj25
-rw-r--r--main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/DisplayBinding.cs2
-rw-r--r--main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorView.cs32
-rw-r--r--main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs3
-rw-r--r--main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/MonoDevelopHexEditorStyle.cs26
-rw-r--r--main/src/addins/MonoDevelop.Moonlight/ChangeLog828
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/AddinInfo.cs3
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/AssemblyInfo.cs7
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/AddPackagesHandler.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ManagePackagesHandler.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackageManagementStartupHandler.cs40
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackageReferenceNodeCommandHandler.cs30
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackageReferenceNodeCommands.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackagesCommandHandler.cs24
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ProjectPackagesFolderNodeCommandHandler.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ReinstallAllPackagesInProjectHandler.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/RestorePackagesHandler.cs14
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/RestorePackagesInProjectHandler.cs9
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/UpdateAllPackagesInProjectHandler.cs66
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/UpdateAllPackagesInSolutionHandler.cs74
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackageSourceDialog.UI.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackageSourceDialog.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackagesDialog.UI.cs39
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackagesDialog.cs42
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackagesDialogRunner.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/DialogExtensions.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/HyperlinkWidget.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/LicenseAcceptanceDialog.cs38
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageCellView.cs35
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageCellViewCheckBox.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageCellViewEventArgs.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageLicenseWidget.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsPanel.cs9
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsWidget.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourceCellRenderer.cs20
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesOptionsPanel.cs7
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesWidget.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackagesWidget.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PagedResultsWidget.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/SelectProjectsDialog.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/Styles.cs87
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/PackageReferenceNode.cs16
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/PackageReferenceNodeBuilder.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/PackageReferenceNodeDescriptor.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/PackageReferenceNodePropertyProvider.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectPackagesFolderNode.cs15
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectPackagesFolderNodeBuilder.cs15
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectPackagesProjectNodeBuilderExtension.cs20
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectReferenceNodeBuilderExtension.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectReferencesFromPackagesFolderNode.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectReferencesFromPackagesFolderNodeBuilder.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectReferencesNodeBuilderExtension.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Refactoring/PackageCodeDiagnosticProvider.cs104
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/ExceptionThrowingProcessPackageAction.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/ExceptionThrowingRegisteredPackageRepositories.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeBackgroundPackageActionRunner.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeDotNetProject.cs11
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeFileService.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeInstallPackageAction.cs20
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeLicenseAcceptanceService.cs45
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeMachineCache.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeNuGetPackageNewImportsHandler.cs48
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackage.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagementProject.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagementProjectFactory.cs3
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagementProjectService.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagementSolution.cs9
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManager.cs9
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagerFactory.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageOperationResolverFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageRepository.cs18
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageRepositoryFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageRepositoryFactoryEvents.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageViewModelFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProcess.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProgressMonitor.cs23
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProgressMonitorFactory.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProject.cs11
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProjectManager.cs16
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProjectSystemFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeRecentPackageRepository.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeRegisteredPackageRepositories.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSettings.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSolution.cs11
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSolutionPackageRepository.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSolutionPackageRepositoryFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeTask.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeTaskFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeUninstallPackageAction.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeUpdatePackageAction.cs20
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeUpdatedPackagesInSolution.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/ImportAndCondition.cs69
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/InstallPackageHelper.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/OneRegisteredPackageSourceHelper.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/PackageCollectionAssert.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/PackageSourceCollectionAssert.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/PageCollectionAssert.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/RecentPackageInfoCollectionAssert.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/SelectedProjectCollectionAssert.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableBackgroundPackageActionRunner.cs39
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableCheckForUpdatesTaskRunner.cs9
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableInstallPackageAction.cs19
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableMonoDevelopProjectSystem.cs17
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageCompatibilityChecker.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageCompatibilityRunner.cs14
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageFromRepository.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageManagementEventsMonitor.cs14
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageManagementOptions.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageViewModel.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackagesViewModel.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableProcessPackageAction.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableProjectManager.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableProjectPackagesFolderNode.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableSolutionPackageRepository.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableUpdatePackageAction.cs18
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableUpdatedPackagesInSolution.cs8
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableViewModelBase.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/UninstallPackageHelper.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/UpdatePackageHelper.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.csproj4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/AvailablePackagesViewModelTests.cs20
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/BackgroundPackageActionRunnerTests.cs49
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/DelegateCommandTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/DotNetProjectExtensionsTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/EnsureNuGetPackageBuildImportsTargetUpdaterTests.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/IPackageExtensionsTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/InstallPackageActionTests.cs72
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MSBuildProjectExtensionsTests.cs43
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MSBuildTargetsRestoredMonitorTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopPackageManagerFactoryTests.cs12
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopPackageManagerTests.cs151
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopProjectManagerTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopProjectSystemTests.cs71
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/OpenDotNetProjectTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageCompatibilityRunnerTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageFilesTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageFromRepositoryTests.cs16
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementEventsTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementLoggerTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementOptionsTests.cs8
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementOptionsViewModelTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementProjectTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementSelectedProjectTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementSelectedProjectsTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementSolutionTests.cs28
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageOperationMessageTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageReferenceNodeTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageReinstallerTests.cs3
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageRepositoryCacheTests.cs12
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageSourceViewModelTests.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageViewModelTests.cs8
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackagesViewModelTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ProcessPackageActionTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ProjectHelper.cs9
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ProjectTargetFrameworkMonitorTests.cs18
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RecentPackageInfoTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RecentPackageRepositoryTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ReducedPackageOperationsTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RegisteredPackageRepositoriesTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RegisteredPackageSourcesViewModelTests.cs18
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ReinstallPackageActionTests.cs23
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ReinstallProjectPackagesActionTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RestorePackagesActionTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/SettingProviderTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/SolutionPackageRepositoryPathTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/SolutionPackageRepositoryTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ThreadSafePackageManagementEventsTests.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UninstallPackageActionTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdateAllPackagesInProjectTests.cs20
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdateAllPackagesInSolutionTests.cs21
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdatePackageActionTests.cs72
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdatedPackagesInSolutionTests.cs99
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdatedPackagesTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UserAgentGeneratorForRepositoryRequestsTests.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.addin.xml10
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj125
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AcceptLicensesEventArgs.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AggregateExceptionErrorMessage.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AvailablePackagesViewModel.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/BackgroundPackageActionRunner.cs45
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatedPackagesAction.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesTask.cs17
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesTaskRunner.cs8
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ConfigSettingsFileSystem.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DefaultProjectTemplatePackageSource.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DelegateCommand.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectEventArgs.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectExtensions.cs12
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectImportEventArgs.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectProxy.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectReferenceEventArgs.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetSolutionEventArgs.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/EnsureNuGetPackageBuildImportsTargetUpdater.cs8
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FailingPackageRepository.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FallbackRepository.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileConflictResolver.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FilePathExtensions.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileRemover.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileRemovingEventArgs.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FolderBrowser.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IBackgroundPackageActionRunner.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ICommand.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ICompilerMessageView.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IDotNetProject.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IFileRemover.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IFolderBrowser.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ILicenseAcceptanceService.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMachinePackageCache.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMessageViewCategory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopPackageManager.cs53
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopPackageRepositoryFactory.cs48
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopProjectManager.cs42
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopProjectSystemFactory.cs39
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/INuGetPackageNewImportsHandler.cs37
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IOpenPackageReadMeMonitor.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageAction.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageActionRunner.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageExtensions.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageFromRepository.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageFromRepositoryExtensions.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementEvents.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementFileService.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementOutputMessagesView.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProgressMonitorFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProject.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProjectFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProjectService.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementSelectedProject.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementSolution.cs8
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagerFactory.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageOperationResolverFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryCache.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryExtensions.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryFactoryEvents.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageViewModelFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageViewModelParent.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProcess.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProject.cs7
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProjectBrowserUpdater.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPropertyService.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IRecentPackageRepository.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IRegisteredPackageRepositories.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISelectProjectsService.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISettingsFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISettingsProvider.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopPackageManager.cs53
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopPackageRepositoryFactory.cs48
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopProjectManager.cs42
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopProjectSystemFactory.cs39
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolution.cs3
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolutionPackageRepository.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolutionPackageRepositoryFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ITask.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ITaskFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IThreadSafePackageManagementEvents.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackageActions.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackageSettings.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackagesAction.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatedPackagesInSolution.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ImageCache.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ImageLoadedEventArgs.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ImageLoader.cs18
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstallPackageAction.cs17
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackageViewModel.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackageViewModelFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackagesViewModel.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs27
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceViewModel.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LocalCopyReferenceMaintainer.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MSBuildProjectExtensions.cs59
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MSBuildTargetsRestoredMonitor.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MachinePackageCache.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewModel.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewTitle.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MarkupString.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopAggregateRepository.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopCredentialProvider.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopHttpUserAgent.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopPackageManager.cs251
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopPackageManagerFactory.cs95
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopPackageRepositoryFactory.cs58
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopProjectManager.cs64
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopProjectSystem.cs498
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopProjectSystemFactory.cs42
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/NuGetPackageNewImportsHandler.cs65
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/NullOpenPackageReadMeMonitor.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/OpenDotNetProjects.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/OpenPackageReadmeMonitor.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageActionRunner.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageCompatibility.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageCompatibilityChecker.cs63
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageCompatibilityHandler.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageCompatibilityRunner.cs19
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFiles.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFilesForOperations.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFromRepository.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageLicenseViewModel.cs24
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageListViewTextFormatter.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementBackgroundDispatcher.cs96
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementCompilerMessageView.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEnumerableExtensions.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEvents.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEventsMonitor.cs23
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementFileService.cs8
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementLogger.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementMSBuildExtension.cs20
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementMessageViewCategory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOptions.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOptionsViewModel.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOutputMessagesView.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProgressMonitor.cs134
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProgressMonitorFactory.cs11
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProgressProvider.cs65
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProject.cs8
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectFactory.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectOperations.cs102
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectService.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementPropertyService.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSelectedProject.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSelectedProjects.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementServices.cs36
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolution.cs22
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolutionExtensions.cs9
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolutionProjectService.cs72
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementTask.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementTaskFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementViewModels.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationExceptionEventArgs.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationMessage.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationMessageLoggedEventArgs.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationsResolverFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageReferenceExtensions.cs13
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageReferenceMonitor.cs71
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageReinstaller.cs5
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRepositoryCache.cs14
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRepositoryFactoryEventArgs.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestoreRunner.cs34
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestoredEventArgs.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestorer.cs19
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSearchCriteria.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceConverter.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceExtensions.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModel.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModelChangedEventArgs.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModelCheckedEventArgs.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModelChecker.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageUpdateChecker.cs100
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModel.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelOperationLogger.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesForSelectedPageQuery.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesForSelectedPageResult.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesRequiringLicenseAcceptance.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesViewModel.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesViewModels.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Page.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Pages.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ParentPackageOperationEventArgs.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ParentPackagesOperationEventArgs.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PreventPackagesConfigFileBeingRemovedOnUpdateMonitor.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Process.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageAction.cs17
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageOperationsAction.cs29
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorExtensions.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorStatusMessage.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorStatusMessageFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectBrowserUpdater.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectExtensions.cs45
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectModifiedEventArgs.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectPackageReferenceFile.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectPackagesCompatibilityReport.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectProxy.cs17
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectReferenceExtensions.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectReloadedEventArgs.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTargetFramework.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTargetFrameworkChangedEventArgs.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTargetFrameworkMonitor.cs16
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplateNuGetPackageInstaller.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplatePackageRepositoryCache.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplatePackageSettingsFileName.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackageInfo.cs8
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackageRepository.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackagesViewModel.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReducedPackageOperations.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageRepositories.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSource.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourceSettings.cs29
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSources.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourcesViewModel.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredProjectTemplatePackageSources.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReinstallPackageAction.cs5
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReinstallPackageOperations.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReinstallProjectPackagesAction.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RemovedPackageReferenceMonitor.cs60
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ResolveFileConflictEventArgs.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RestoreBeforeUpdateAction.cs21
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RestorePackagesAction.cs6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SearchPackagesDataSource.cs102
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SearchPackagesSearchCategory.cs53
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsEventArgs.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsService.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsViewModel.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectedProjectsForInstalledPackages.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectedProjectsForUpdatedPackages.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SettingsFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SettingsProvider.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageManager.cs230
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageManagerFactory.cs95
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageRepositoryFactory.cs58
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectManager.cs64
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectSystem.cs469
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectSystemFactory.cs42
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionExtensions.cs11
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepository.cs10
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepositoryFactory.cs8
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepositoryPath.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionProxy.cs26
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ThreadSafePackageManagementEvents.cs12
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ThreadSafeProjectBrowserUpdater.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UninstallPackageAction.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdateAllPackagesInProject.cs9
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdateAllPackagesInSolution.cs7
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackageAction.cs24
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackageActions.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesAction.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesActionFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesProgressMonitorStatusMessage.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdateSolutionPackagesAction.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackageViewModel.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackageViewModelFactory.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackages.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesInProject.cs9
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesInSolution.cs52
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesMonitor.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesViewModel.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UserAgentGeneratorForRepositoryRequests.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ViewModelBase.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/WildcardVersionSpec.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.HyperlinkWidget.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.LicenseAcceptanceDialog.cs90
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.ManagePackagesDialog.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageLicenseWidget.cs7
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageManagementOptionsWidget.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageSourcesWidget.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackagesWidget.cs76
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PagedResultsWidget.cs31
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.SelectProjectsDialog.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/gtk-gui/generated.cs38
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/gtk-gui/gui.stetic188
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/package-48.pngbin0 -> 1039 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/package-48@2x.pngbin0 -> 2266 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/package-48~dark.pngbin0 -> 996 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/package-48~dark@2x.pngbin0 -> 2227 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/package-48~dark~sel.pngbin0 -> 726 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/package-48~dark~sel@2x.pngbin0 -> 1592 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/package-48~sel.pngbin0 -> 726 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/package-48~sel@2x.pngbin0 -> 1592 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32.pngbin1254 -> 607 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32@2x.pngbin2284 -> 1021 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~dark.pngbin0 -> 630 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~dark@2x.pngbin0 -> 1053 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~dark~sel.pngbin0 -> 496 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~dark~sel@2x.pngbin0 -> 1125 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~sel.pngbin0 -> 496 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~sel@2x.pngbin0 -> 1125 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16.pngbin589 -> 419 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16@2x.pngbin1304 -> 842 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~dark.pngbin0 -> 418 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~dark@2x.pngbin0 -> 855 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~dark~sel.pngbin0 -> 321 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~dark~sel@2x.pngbin0 -> 623 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~sel.pngbin0 -> 321 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~sel@2x.pngbin0 -> 623 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16.pngbin657 -> 265 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16@2x.pngbin1254 -> 607 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~dark.pngbin0 -> 260 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~dark@2x.pngbin0 -> 632 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~dark~sel.pngbin0 -> 240 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~dark~sel@2x.pngbin0 -> 498 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~sel.pngbin0 -> 240 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~sel@2x.pngbin0 -> 498 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/reference-48.pngbin1901 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/icons/reference-48@2x.pngbin3887 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/AddinInfo.cs2
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/AssemblyInfo.cs4
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/ChangeLog1991
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs401
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisOptions.cs10
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/FixableResult.cs35
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Fixes/GenericFix.cs61
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Fixes/RenameMemberFix.cs70
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/AnalysisOptionsPanel.cs3
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultMarker.cs17
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs169
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultsEditorExtension.cs138
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/IssueMarker.cs55
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Result.cs17
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Rules/Adaptors.cs42
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/AnalysisCodeAction.cs116
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeAction.cs117
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionAddinNode.cs75
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionContainer.cs119
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs979
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionPanelWidget.cs32
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionProvider.cs74
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeRefactoringDescriptor.cs101
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeRefactoringService.cs164
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/ICodeActionProviderSource.cs41
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/ValidCodeAction.cs47
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/ValidCodeDiagnosticAction.cs62
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ActionSummary.cs66
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/AnalyzersFromAssembly.cs110
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/BatchFixer.cs143
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/BuiltInCodeDiagnosticProvider.cs111
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CSharpSuppressionFixProvider.cs119
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeAnalysisBatchRunner.cs163
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticDescriptor.cs226
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticFixDescriptor.cs89
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticProvider.cs45
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticRunner.cs140
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeFix.cs93
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssue.cs108
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssueAddinNode.cs68
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePanelWidget.cs141
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssueProvider.cs207
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/DefaultCodeIssueCategories.cs44
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/DiagnosticResult.cs77
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/FileGroupingProvider.cs46
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ICodeIssueProviderSource.cs45
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ISuppressionFixProvider.cs63
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IssueSummary.cs236
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/AbstractGroupingProvider.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/AbstractGroupingProvider.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/ActionSummary.cs65
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/AnalysisState.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/AnalysisState.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/AnalysisStateChangeEventArgs.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/AnalysisStateChangeEventArgs.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/BatchFixer.cs141
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/CategoryGroupingProvider.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CategoryGroupingProvider.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/CodeAnalysisBatchRunner.cs162
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/CodeIssuePad.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePad.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/ExactIssueMatcher.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ExactIssueMatcher.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/FileGroupingProvider.cs46
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/GroupingDescriptionAttribute.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/GroupingDescriptionAttribute.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/GroupingProviderChainControl.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/GroupingProviderChainControl.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/GroupingProviderEventArgs.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/GroupingProviderEventArgs.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IActionMatcher.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IActionMatcher.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IGroupingProvider.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IGroupingProvider.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IIssueSummarySink.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IIssueSummarySink.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IIssueTreeNode.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IIssueTreeNode.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IssueGroup.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IssueGroup.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IssueGroupEventArgs.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IssueGroupEventArgs.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IssueMatch.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IssueMatch.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IssueSummary.cs236
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IssueTreeNodeEventArgs.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IssueTreeNodeEventArgs.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/NullGroupingProvider.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/NullGroupingProvider.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/ProjectGroupingProvider.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ProjectGroupingProvider.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/ProviderGroupingProvider.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ProviderGroupingProvider.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/AnalysisJobQueue.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/AnalysisJobQueue.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/CodeIssueEventArgs.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/CodeIssueEventArgs.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/IAnalysisJob.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/IAnalysisJob.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/IJobContext.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/IJobContext.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/JobContext.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/JobContext.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/JobSlice.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/JobSlice.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/JobStatus.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/JobStatus.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/ProgressMonitorWrapperJob.cs126
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/SimpleAnalysisJob.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/SimpleAnalysisJob.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/SeverityGroupingProvider.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/SeverityGroupingProvider.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/SolutionAnalysisJob.cs (renamed from main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/SolutionAnalysisJob.cs)0
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/ProgressMonitorWrapperJob.cs126
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameHandler.cs51
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameItemDialog.cs158
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameRefactoring.cs360
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameTextEditorExtension.cs49
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml72
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj253
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/AbstractRefactoringCommandHandler.cs90
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/Change.cs93
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/Commands.cs44
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/EncapsulateFieldDialog.cs469
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ExtensionMethods.cs148
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindDerivedClassesHandler.cs182
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindDerivedSymbolsHandler.cs67
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindExtensionMethodHandler.cs81
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindMemberOverloadsHandler.cs77
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindReferencesHandler.cs107
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindReferencesProvider.cs42
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/GotoDeclarationHandler.cs59
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ImportSymbolHandler.cs519
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/InsertionPointService.cs270
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/JumpToDeclarationHandler.cs45
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/OverridesImplementsDialog.cs400
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringOperation.cs74
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringOptions.cs171
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs30
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs449
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringSymbolInfo.cs129
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs441
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ResolveCommandHandler.cs578
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/gtk-gui/MonoDevelop.Refactoring.EncapsulateFieldDialog.cs6
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/gtk-gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs7
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/gtk-gui/generated.cs36
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/gtk-gui/gui.stetic19
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16.pngbin642 -> 396 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16@2x.pngbin1841 -> 885 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~dark.pngbin0 -> 381 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~dark@2x.pngbin0 -> 812 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~dark~sel.pngbin0 -> 305 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~dark~sel@2x.pngbin0 -> 582 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~sel.pngbin0 -> 310 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~sel@2x.pngbin0 -> 621 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16.pngbin329 -> 433 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16@2x.pngbin708 -> 940 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~dark.pngbin0 -> 414 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~dark@2x.pngbin0 -> 901 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~dark~sel.pngbin0 -> 291 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~dark~sel@2x.pngbin0 -> 624 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~sel.pngbin0 -> 291 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~sel@2x.pngbin0 -> 624 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16.pngbin335 -> 204 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16@2x.pngbin697 -> 397 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~dark.pngbin0 -> 204 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~dark@2x.pngbin0 -> 397 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~dark~sel.pngbin0 -> 204 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~dark~sel@2x.pngbin0 -> 395 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~sel.pngbin0 -> 204 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~sel@2x.pngbin0 -> 395 bytes
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/packages.config2
-rw-r--r--main/src/addins/MonoDevelop.RegexToolkit/ChangeLog466
-rw-r--r--main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj35
-rw-r--r--main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/Commands.cs39
-rw-r--r--main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/ElementHelpWidget.cs2
-rw-r--r--main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/RegexToolkitWidget.cs19
-rw-r--r--main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/ValidateActionCodeRefactoringProvider.cs117
-rw-r--r--main/src/addins/MonoDevelop.RegexToolkit/gtk-gui/MonoDevelop.RegexToolkit.ElementHelpWidget.cs5
-rw-r--r--main/src/addins/MonoDevelop.RegexToolkit/gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWidget.cs167
-rw-r--r--main/src/addins/MonoDevelop.RegexToolkit/gtk-gui/generated.cs34
-rw-r--r--main/src/addins/MonoDevelop.RegexToolkit/gtk-gui/gui.stetic38
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/AssemblyInfo.cs2
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/ChangeLog5017
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Extension/TemplateCodon.cs65
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Extension/TemplateExtensionNodeLoader.cs67
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.JSon/JSonIndentEngine.cs295
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.JSon/JSonIndentationTracker.cs86
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.JSon/JSonTextEditorExtension.cs131
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs12
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/ColorShemeEditor.cs17
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionAppearancePanel.cs17
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionCharactersPanel.cs5
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionOptionsPanel.cs28
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs8
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs62
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs16
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/NewColorShemeDialog.cs3
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/IQuickTaskProvider.cs40
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/IUsageProvider.cs55
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTask.cs80
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskMiniMapMode.cs33
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs599
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskStrip.cs63
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/DocumentLineWrapper.cs131
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/FoldSegmentWrapper.cs66
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/ITextDocumentWrapper.cs396
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/ImmutableTextTextSource.cs131
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/IndentationTrackerWrapper.cs83
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/ReadonlyDocumentSnapshot.cs184
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/SelectionSurroundingProviderWrapper.cs58
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/SemanticHighlightingSyntaxMode.cs236
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TextChangeEventArgsWrapper.cs37
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TextPasteHandlerWrapper.cs68
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TextSourceVersionWrapper.cs71
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs144
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.addin.xml82
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj230
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/AbstractUsagesExtension.cs8
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/AutoSave.cs220
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs41
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/Counters.cs1
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs73
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs96
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DefaultAutoInsertBracketHandler.cs108
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DynamicAbbrevHandler.cs195
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/EditActions.cs4
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/EditorFactory.cs87
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ErrorText.cs6
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs502
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/FileRegistry.cs46
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/GotoLineNumberWidget.cs29
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/HoverCloseButton.cs3
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ISourceEditorOptions.cs68
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/IdeViMode.cs168
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/LanguageItemWindow.cs4
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ListDataProviderWrapper.cs63
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MarkerOperationsHandler.cs4
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs7
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCommands.cs76
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs168
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs43
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/PinnedWatchWidget.cs8
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs78
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SearchInSelectionMarker.cs56
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorCommands.cs3
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs109
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorOptions.cs682
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorPrintOperation.cs13
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs2010
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs751
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs450
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SyntaxModeCodon.cs52
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SyntaxModeLoader.cs68
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SyntaxModeService.cs58
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/AsmLineMarker.cs48
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/DebugTextMarker.cs273
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/ErrorMarker.cs81
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/GrayOutMarker.cs123
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/LinkMarker.cs130
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/SmartTagMarker.cs162
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/UnitTestMarker.cs136
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/UrlTextLineMarker.cs56
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/UsageSegmentMarker.cs104
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/WavedLineMarker.cs135
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/searchoptions.pngbin765 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/searchoptions.svg151
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.GotoLineNumberWidget.cs55
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs288
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.ColorShemeEditor.cs273
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.CompletionAppearancePanel.cs207
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.CompletionOptionsPanel.cs147
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs162
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel.cs127
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs171
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog.cs83
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.PrintSettingsWidget.cs13
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs186
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/generated.cs87
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/gui.stetic181
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/find-options-22x32.pngbin0 -> 524 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/find-options-22x32@2x.pngbin0 -> 728 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/find-options-22x32~dark.pngbin0 -> 524 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/find-options-22x32~dark@2x.pngbin0 -> 728 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-bookmark-15.pngbin434 -> 348 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-bookmark-15@2x.pngbin1132 -> 636 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-bookmark-15~dark.pngbin0 -> 348 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-bookmark-15~dark@2x.pngbin0 -> 614 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-error-15.pngbin235 -> 228 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-error-15@2x.pngbin600 -> 497 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-warning-15.pngbin306 -> 230 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-warning-15@2x.pngbin700 -> 479 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/issues-busy-16.pngbin337 -> 259 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/issues-busy-16@2x.pngbin696 -> 532 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/issues-busy-16~dark.pngbin0 -> 273 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/issues-busy-16~dark@2x.pngbin0 -> 537 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/issues-error-16.pngbin325 -> 226 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/issues-error-16@2x.pngbin672 -> 409 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/issues-error-16~dark.pngbin0 -> 216 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/issues-error-16~dark@2x.pngbin0 -> 400 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/issues-ok-16.pngbin332 -> 220 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/issues-ok-16@2x.pngbin711 -> 417 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/issues-ok-16~dark.pngbin0 -> 215 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/issues-ok-16~dark@2x.pngbin0 -> 407 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/issues-suggestion-16.pngbin335 -> 226 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/issues-suggestion-16@2x.pngbin697 -> 401 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/issues-suggestion-16~dark.pngbin0 -> 226 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/issues-suggestion-16~dark@2x.pngbin0 -> 395 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/issues-warning-16.pngbin329 -> 221 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/issues-warning-16@2x.pngbin708 -> 410 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/issues-warning-16~dark.pngbin0 -> 222 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/issues-warning-16~dark@2x.pngbin0 -> 383 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16.pngbin0 -> 143 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16@2x.pngbin0 -> 329 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~dark.pngbin0 -> 142 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~dark@2x.pngbin0 -> 356 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~dark~sel.pngbin0 -> 139 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~dark~sel@2x.pngbin0 -> 328 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~sel.pngbin0 -> 139 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~sel@2x.pngbin0 -> 328 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-appearance-16.pngbin318 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-appearance-16@2x.pngbin935 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-behavior-16.pngbin318 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-behavior-16@2x.pngbin935 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16.pngbin444 -> 143 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16@2x.pngbin820 -> 211 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~dark.pngbin0 -> 143 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~dark@2x.pngbin0 -> 214 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~dark~sel.pngbin0 -> 138 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~dark~sel@2x.pngbin0 -> 197 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~sel.pngbin0 -> 138 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~sel@2x.pngbin0 -> 197 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16.pngbin456 -> 187 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16@2x.pngbin879 -> 295 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~dark.pngbin0 -> 187 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~dark@2x.pngbin0 -> 293 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~dark~sel.pngbin0 -> 183 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~dark~sel@2x.pngbin0 -> 273 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~sel.pngbin0 -> 183 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~sel@2x.pngbin0 -> 273 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16.pngbin813 -> 515 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16@2x.pngbin2225 -> 1376 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~dark.pngbin0 -> 498 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~dark@2x.pngbin0 -> 1269 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~dark~sel.pngbin0 -> 361 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~dark~sel@2x.pngbin0 -> 863 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~sel.pngbin0 -> 361 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~sel@2x.pngbin0 -> 863 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16.pngbin389 -> 190 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16@2x.pngbin675 -> 368 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~dark.pngbin0 -> 190 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~dark@2x.pngbin0 -> 370 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~dark~sel.pngbin0 -> 183 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~dark~sel@2x.pngbin0 -> 378 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~sel.pngbin0 -> 183 bytes
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~sel@2x.pngbin0 -> 378 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit.Runners/MonoDevelop.UnitTesting.NUnit.Runners.csproj39
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit.Runners/MyClass.cs36
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit.Runners/Properties/AssemblyInfo.cs52
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/AddinInfo.cs16
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/AssemblyInfo.cs (renamed from main/src/addins/NUnit/AssemblyInfo.cs)0
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/Makefile.am3
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit.csproj114
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/ExternalTestRunner.cs319
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitAssemblyTestSuite.cs763
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitProjectTestSuite.cs203
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitTestCase.cs75
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitTestSuite.cs100
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/RemoteTestResult.cs197
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/SystemTestProvider.cs72
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/TcpTestListener.cs219
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelopNUnit.addin.xml31
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/EventListenerWrapper.cs187
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/Makefile.am (renamed from main/src/addins/CBinding/Makefile.am)0
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/NUnit3Runner.csproj71
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/NUnitTestRunner.cs210
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/Program.cs42
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/packages.config5
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/Application.cs45
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/ExternalTestRunner.cs236
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/Makefile.am (renamed from main/src/addins/NUnit/NUnitRunner/Makefile.am)0
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/NUnitRunner.csproj71
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/NUnitTestRunner.cs207
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/packages.config (renamed from main/src/addins/NUnit/NUnitRunner/packages.config)0
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/NUnitAssemblyGroup.xpt.xml (renamed from main/src/addins/NUnit/templates/NUnitAssemblyGroup.xpt.xml)0
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/NUnitProject.xpt.xml (renamed from main/src/addins/NUnit/templates/NUnitProject.xpt.xml)0
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/NUnitProjectVBNet.xpt.xml (renamed from main/src/addins/NUnit/templates/NUnitProjectVBNet.xpt.xml)0
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/NUnitTestClass.xft.xml (renamed from main/src/addins/NUnit/templates/NUnitTestClass.xft.xml)0
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/images/nunit-library-project.pngbin0 -> 2255 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/images/nunit-library-project@2x.pngbin0 -> 5528 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/images/nunit-library-project~dark.pngbin0 -> 2270 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/images/nunit-library-project~dark@2x.pngbin0 -> 5617 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/AddinInfo.cs15
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/AssemblyInfo.cs9
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Commands/NUnitCommands.cs86
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/NUnitOptionsPanel.cs (renamed from main/src/addins/NUnit/Gui/NUnitOptionsPanel.cs)0
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/TestChart.cs407
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/TestNodeBuilder.cs197
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/TestPad.cs926
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/TestResultsPad.cs862
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/TestStatusIcon.cs74
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16.pngbin0 -> 280 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16@2x.pngbin0 -> 542 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~dark.pngbin0 -> 287 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~dark@2x.pngbin0 -> 526 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~dark~sel.pngbin0 -> 218 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~dark~sel@2x.pngbin0 -> 400 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~sel.pngbin0 -> 218 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~sel@2x.pngbin0 -> 400 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32.pngbin0 -> 375 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32@2x.pngbin0 -> 684 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~dark.pngbin0 -> 380 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~dark@2x.pngbin0 -> 682 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~dark~sel.pngbin0 -> 291 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~dark~sel@2x.pngbin0 -> 519 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~sel.pngbin0 -> 291 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~sel@2x.pngbin0 -> 519 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-failed-16.pngbin0 -> 417 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-failed-16@2x.pngbin0 -> 780 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-failed-16~dark.pngbin0 -> 407 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-failed-16~dark@2x.pngbin0 -> 756 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-inconclusive-16.pngbin0 -> 394 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-inconclusive-16@2x.pngbin0 -> 758 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-inconclusive-16~dark.pngbin0 -> 407 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-inconclusive-16~dark@2x.pngbin0 -> 745 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-loading-16.pngbin0 -> 485 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-loading-16@2x.pngbin0 -> 971 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-loading-16~dark.pngbin0 -> 494 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-loading-16~dark@2x.pngbin0 -> 983 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-mixed-results-16.pngbin0 -> 379 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-mixed-results-16@2x.pngbin0 -> 694 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-mixed-results-16~dark.pngbin0 -> 383 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-mixed-results-16~dark@2x.pngbin0 -> 674 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-not-yet-run-16.pngbin0 -> 317 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-not-yet-run-16@2x.pngbin0 -> 675 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-not-yet-run-16~dark.pngbin0 -> 314 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-not-yet-run-16~dark@2x.pngbin0 -> 696 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-running-16.pngbin0 -> 380 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-running-16@2x.pngbin0 -> 876 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-running-16~dark.pngbin0 -> 379 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-running-16~dark@2x.pngbin0 -> 845 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-skipped-16.pngbin0 -> 316 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-skipped-16@2x.pngbin0 -> 589 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-skipped-16~dark.pngbin0 -> 310 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-skipped-16~dark@2x.pngbin0 -> 563 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-success-16.pngbin0 -> 318 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-success-16@2x.pngbin0 -> 608 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-success-16~dark.pngbin0 -> 316 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-success-16~dark@2x.pngbin0 -> 594 bytes
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Makefile.am1
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj289
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/MonoDevelopNUnit.addin.xml129
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/README (renamed from main/src/addins/NUnit/README)0
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/AbstractResultsStore.cs407
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/AbstractUnitTestEditorExtension.cs373
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/BinaryResultsStore.cs98
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/GeneralTestOptions.cs43
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/IResultsStore.cs46
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/ITestProgressMonitor.cs45
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/ITestProvider.cs40
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/NUnitSourceCodeLocationFinder.cs70
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/RemoteUnhandledException.cs81
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/SolutionFolderTestGroup.cs96
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/SystemTestProvider.cs61
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/TestContext.cs73
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/UnitTest.cs453
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestCollection.cs91
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestGroup.cs197
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestMarkersExtension.cs50
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestProjectServiceExtension.cs131
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestResult.cs226
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestResultsStore.cs76
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestService.cs459
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestStatus.cs50
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/Services/WorkspaceTestGroup.cs85
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/TODO (renamed from main/src/addins/NUnit/TODO)0
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/gtk-gui/generated.cs29
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting/gtk-gui/gui.stetic13
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/ChangeLog655
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs86
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Dialogs/WCFConfigWidget.cs2
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs37
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.NodeBuilders/WebReferenceFolderNodeBuilder.cs16
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.NodeBuilders/WebReferenceNodeBuilder.cs6
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Resources/WebReferenceItem.pngbin4515 -> 0 bytes
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WCF/WCFMetadata.cs14
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WCF/WCFMetadataStorage.cs14
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WCF/WebServiceDiscoveryResultWCF.cs153
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WS/WebReferenceUrl.cs9
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WS/WebReferences.cs13
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WS/WebServiceDiscoveryResultWS.cs113
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.addin.xml3
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj50
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/DiscoveryProtocol.cs2
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/WebReferenceItem.cs6
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/WebReferencesService.cs5
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/WebServiceDiscoveryResult.cs15
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/gtk-gui/MonoDevelop.WebReferences.Dialogs.WCFConfigWidget.cs9
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/gtk-gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs26
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16.pngbin0 -> 301 bytes
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16@2x.pngbin0 -> 745 bytes
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~dark.pngbin0 -> 300 bytes
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~dark@2x.pngbin0 -> 797 bytes
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~dark~sel.pngbin0 -> 247 bytes
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~dark~sel@2x.pngbin0 -> 515 bytes
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~sel.pngbin0 -> 247 bytes
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~sel@2x.pngbin0 -> 515 bytes
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16.pngbin0 -> 528 bytes
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16@2x.pngbin0 -> 1394 bytes
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~dark.pngbin0 -> 498 bytes
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~dark@2x.pngbin0 -> 1262 bytes
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~dark~sel.pngbin0 -> 373 bytes
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~dark~sel@2x.pngbin0 -> 897 bytes
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~sel.pngbin0 -> 373 bytes
-rw-r--r--main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~sel@2x.pngbin0 -> 897 bytes
-rw-r--r--main/src/addins/MonoDeveloperExtensions/ChangeLog466
-rw-r--r--main/src/addins/MonoDeveloperExtensions/Commands.cs12
-rw-r--r--main/src/addins/MonoDeveloperExtensions/MonoDeveloperExtensions.addin.xml5
-rw-r--r--main/src/addins/MonoDeveloperExtensions/MonoDeveloperExtensions.csproj5
-rw-r--r--main/src/addins/MonoDeveloperExtensions/MonoMakefile.cs2
-rw-r--r--main/src/addins/MonoDeveloperExtensions/MonoMakefileFormat.cs204
-rw-r--r--main/src/addins/MonoDeveloperExtensions/MonoMakefileProjectExtension.cs350
-rw-r--r--main/src/addins/MonoDeveloperExtensions/MonoMakefileProjectReader.cs143
-rw-r--r--main/src/addins/MonoDeveloperExtensions/MonoMakefileSolutionExtension.cs41
-rw-r--r--main/src/addins/MonoDeveloperExtensions/MonoSolutionItemHandler.cs345
-rw-r--r--main/src/addins/MonoDeveloperExtensions/NUnit/AddinInfo.cs2
-rw-r--r--main/src/addins/MonoDeveloperExtensions/NUnit/ChangeLog19
-rw-r--r--main/src/addins/MonoDeveloperExtensions/NUnit/ExtensionModel.addin.xml2
-rw-r--r--main/src/addins/MonoDeveloperExtensions/NUnit/MonoTestProvider.cs31
-rw-r--r--main/src/addins/MonoDeveloperExtensions/NUnit/NUnit.csproj15
-rw-r--r--main/src/addins/NUnit/AddinInfo.cs15
-rw-r--r--main/src/addins/NUnit/ChangeLog1117
-rw-r--r--main/src/addins/NUnit/Commands/NUnitCommands.cs86
-rw-r--r--main/src/addins/NUnit/Gui/AbstractUnitTestEditorExtension.cs440
-rw-r--r--main/src/addins/NUnit/Gui/NUnitAssemblyGroupConfigurationNodeBuilder.cs128
-rw-r--r--main/src/addins/NUnit/Gui/NUnitAssemblyGroupNodeBuilder.cs123
-rw-r--r--main/src/addins/NUnit/Gui/TestAssemblyNodeBuilder.cs79
-rw-r--r--main/src/addins/NUnit/Gui/TestChart.cs407
-rw-r--r--main/src/addins/NUnit/Gui/TestNodeBuilder.cs207
-rw-r--r--main/src/addins/NUnit/Gui/TestPad.cs927
-rw-r--r--main/src/addins/NUnit/Gui/TestResultsPad.cs861
-rw-r--r--main/src/addins/NUnit/Gui/TestStatusIcon.cs74
-rw-r--r--main/src/addins/NUnit/Gui/UnitTestOptionsDialog.cs87
-rw-r--r--main/src/addins/NUnit/Gui/icons/pad-unit-test-16.pngbin553 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/pad-unit-test-16@2x.pngbin1180 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/pad-unit-test-results-16.pngbin526 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/pad-unit-test-results-16@2x.pngbin1047 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/project-nunit-overlay-32.pngbin563 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/project-nunit-overlay-32@2x.pngbin1225 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/unit-failed-16.pngbin649 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/unit-failed-16@2x.pngbin1502 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/unit-inconclusive-16.pngbin549 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/unit-inconclusive-16@2x.pngbin1209 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/unit-loading-16.pngbin563 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/unit-loading-16@2x.pngbin1287 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/unit-mixed-results-16.pngbin776 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/unit-mixed-results-16@2x.pngbin1847 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/unit-not-yet-run-16.pngbin567 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/unit-not-yet-run-16@2x.pngbin1381 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/unit-run-16.pngbin852 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/unit-run-16@2x.pngbin2157 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/unit-running-16.pngbin627 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/unit-running-16@2x.pngbin1468 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/unit-skipped-16.pngbin646 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/unit-skipped-16@2x.pngbin1514 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/unit-success-16.pngbin636 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Gui/icons/unit-success-16@2x.pngbin1473 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/Makefile.am3
-rw-r--r--main/src/addins/NUnit/MonoDevelop.NUnit.csproj278
-rw-r--r--main/src/addins/NUnit/MonoDevelopNUnit.addin.xml213
-rw-r--r--main/src/addins/NUnit/NUnitRunner/ChangeLog32
-rw-r--r--main/src/addins/NUnit/NUnitRunner/NUnitRunner.csproj64
-rw-r--r--main/src/addins/NUnit/NUnitRunner/NUnitTestRunner.cs219
-rw-r--r--main/src/addins/NUnit/Project/NUnitAssemblyGroupProject.cs223
-rw-r--r--main/src/addins/NUnit/Project/TestAssembly.cs74
-rw-r--r--main/src/addins/NUnit/Project/TestAssemblyCollection.cs79
-rw-r--r--main/src/addins/NUnit/Services/AbstractResultsStore.cs407
-rw-r--r--main/src/addins/NUnit/Services/BinaryResultsStore.cs98
-rw-r--r--main/src/addins/NUnit/Services/ExternalTestRunner.cs423
-rw-r--r--main/src/addins/NUnit/Services/GeneralTestOptions.cs43
-rw-r--r--main/src/addins/NUnit/Services/IResultsStore.cs46
-rw-r--r--main/src/addins/NUnit/Services/ITestProgressMonitor.cs46
-rw-r--r--main/src/addins/NUnit/Services/ITestProvider.cs41
-rw-r--r--main/src/addins/NUnit/Services/NUnitAssemblyTestSuite.cs759
-rw-r--r--main/src/addins/NUnit/Services/NUnitOptions.cs93
-rw-r--r--main/src/addins/NUnit/Services/NUnitProjectServiceExtension.cs71
-rw-r--r--main/src/addins/NUnit/Services/NUnitProjectTestSuite.cs193
-rw-r--r--main/src/addins/NUnit/Services/NUnitService.cs513
-rw-r--r--main/src/addins/NUnit/Services/NUnitTestCase.cs75
-rw-r--r--main/src/addins/NUnit/Services/NUnitTestSuite.cs100
-rw-r--r--main/src/addins/NUnit/Services/SolutionFolderTestGroup.cs107
-rw-r--r--main/src/addins/NUnit/Services/SystemTestProvider.cs67
-rw-r--r--main/src/addins/NUnit/Services/TcpTestListener.cs217
-rw-r--r--main/src/addins/NUnit/Services/TestContext.cs72
-rw-r--r--main/src/addins/NUnit/Services/UnitTest.cs672
-rw-r--r--main/src/addins/NUnit/Services/UnitTestCollection.cs91
-rw-r--r--main/src/addins/NUnit/Services/UnitTestGroup.cs198
-rw-r--r--main/src/addins/NUnit/Services/UnitTestResult.cs226
-rw-r--r--main/src/addins/NUnit/Services/UnitTestResultsStore.cs76
-rw-r--r--main/src/addins/NUnit/Services/UnitTestStatus.cs50
-rw-r--r--main/src/addins/NUnit/Services/WorkspaceTestGroup.cs86
-rw-r--r--main/src/addins/NUnit/gtk-gui/MonoDevelop.NUnit.NUnitOptionsWidget.cs206
-rw-r--r--main/src/addins/NUnit/gtk-gui/generated.cs81
-rw-r--r--main/src/addins/NUnit/gtk-gui/gui.stetic245
-rw-r--r--main/src/addins/NUnit/packages.config5
-rw-r--r--main/src/addins/NUnit/templates/images/nunit-library-project.pngbin4301 -> 0 bytes
-rw-r--r--main/src/addins/NUnit/templates/images/nunit-library-project@2x.pngbin11739 -> 0 bytes
-rw-r--r--main/src/addins/TextTemplating/ChangeLog9
-rw-r--r--main/src/addins/TextTemplating/Mono.TextTemplating.Tests/ChangeLog65
-rw-r--r--main/src/addins/TextTemplating/Mono.TextTemplating.Tests/EngineTests.cs72
-rw-r--r--main/src/addins/TextTemplating/Mono.TextTemplating.Tests/Mono.TextTemplating.Tests.csproj2
-rw-r--r--main/src/addins/TextTemplating/Mono.TextTemplating.Tests/TextTemplatingSessionTests.cs57
-rw-r--r--main/src/addins/TextTemplating/Mono.TextTemplating/AssemblyInfo.cs2
-rw-r--r--main/src/addins/TextTemplating/Mono.TextTemplating/ChangeLog212
-rw-r--r--main/src/addins/TextTemplating/Mono.TextTemplating/Microsoft.VisualStudio.TextTemplating/TextTemplatingSession.cs16
-rw-r--r--main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating.nuspec14
-rw-r--r--main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/CompiledTemplate.cs14
-rw-r--r--main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/TemplateGenerator.cs64
-rw-r--r--main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/TemplatingEngine.cs7
-rw-r--r--main/src/addins/TextTemplating/MonoDevelop.TextTemplating/ChangeLog191
-rw-r--r--main/src/addins/TextTemplating/MonoDevelop.TextTemplating/Gui/T4EditorExtension.cs57
-rw-r--r--main/src/addins/TextTemplating/MonoDevelop.TextTemplating/MonoDevelop.TextTemplating.csproj14
-rw-r--r--main/src/addins/TextTemplating/MonoDevelop.TextTemplating/Parser/T4ParsedDocument.cs36
-rw-r--r--main/src/addins/TextTemplating/MonoDevelop.TextTemplating/Parser/T4Parser.cs15
-rw-r--r--main/src/addins/TextTemplating/MonoDevelop.TextTemplating/T4FileTemplate.cs10
-rw-r--r--main/src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingFileGenerator.cs7
-rw-r--r--main/src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingFilePreprocessor.cs8
-rw-r--r--main/src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingService.cs2
-rw-r--r--main/src/addins/TextTemplating/TextTransform/ChangeLog25
-rw-r--r--main/src/addins/TextTemplating/TextTransform/TextTransform.cs32
-rw-r--r--main/src/addins/VBNetBinding/ChangeLog1306
-rw-r--r--main/src/addins/VBNetBinding/Gui/ConfigurationOptionsPanel.cs3
-rw-r--r--main/src/addins/VBNetBinding/Gui/ImportsOptionsPanel.cs3
-rw-r--r--main/src/addins/VBNetBinding/Gui/ProjectOptionsPanel.cs4
-rw-r--r--main/src/addins/VBNetBinding/Gui/ProjectOptionsPanelWidget.cs46
-rw-r--r--main/src/addins/VBNetBinding/Project/Import.cs6
-rw-r--r--main/src/addins/VBNetBinding/Project/ImprovedCodeDomProvider.cs40
-rw-r--r--main/src/addins/VBNetBinding/Project/VBCompilerParameters.cs4
-rw-r--r--main/src/addins/VBNetBinding/Project/VBNetResourceIdBuilder.cs12
-rw-r--r--main/src/addins/VBNetBinding/Project/VBProjectExtension.cs145
-rw-r--r--main/src/addins/VBNetBinding/Project/VBProjectParameters.cs109
-rw-r--r--main/src/addins/VBNetBinding/VBBindingCompilerServices.cs10
-rw-r--r--main/src/addins/VBNetBinding/VBLanguageBinding.cs111
-rw-r--r--main/src/addins/VBNetBinding/VBNetBinding.addin.xml18
-rw-r--r--main/src/addins/VBNetBinding/VBNetBinding.csproj4
-rw-r--r--main/src/addins/VBNetBinding/templates/AssemblyInfo.xft.xml2
-rw-r--r--main/src/addins/VersionControl/ChangeLog1323
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseGitRepositoryTests.cs70
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseRepositoryTests.cs59
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj20
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/ChangeLog133
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/Commands.cs12
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/CredentialsDialog.cs65
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditBranchDialog.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCommitDialogExtension.cs15
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCommitDialogExtensionWidget.cs12
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitConfigurationDialog.cs14
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCredentials.cs41
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitNodeBuilderExtension.cs22
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitOptionsPanel.cs3
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitOptionsPanelWidget.cs6
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs177
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitSelectRevisionDialog.cs52
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitService.cs55
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitUtil.cs1
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitVersionControl.cs69
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/MergeDialog.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/ProjectTemplateHandler.cs5
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/StashManagerDialog.cs25
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/TfsSmartSubtransport.cs10
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.CredentialsDialog.cs54
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/generated.cs52
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/gui.stetic17
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix/SvnClient.cs72
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/ChangeLog365
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.Gui/WorkingCopyFormatDialog.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs65
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs45
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnRevision.cs6
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs35
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/gtk-gui/generated.cs38
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/gtk-gui/gui.stetic5
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/ChangeLog1483
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitDialog.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs3
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs11
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlGeneralOptionsPanel.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlPolicyPanel.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlSolutionOptionsPanel.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BaseView.cs91
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameView.cs97
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs224
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CellRendererDiff.cs82
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ChangeSetView.cs10
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CommonTextEditorOptions.cs383
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ComparisonWidget.cs64
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffParser.cs13
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffView.cs28
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffWidget.cs18
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DropDownBox.cs9
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.cs98
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogView.cs33
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs175
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeView.cs38
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeWidget.cs14
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs92
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Styles.cs145
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/SubviewAttachmentHandler.cs19
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/VersionControlDocumentInfo.cs16
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj583
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/AddRemoveMoveCommand.cs6
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/BlameCommand.cs7
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CheckoutCommand.cs145
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Commands.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CommitCommand.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CommitDialogExtension.cs3
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CreatePatchCommand.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultBlameViewHandler.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultDiffViewHandler.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultLogViewHandler.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultMergeViewHandler.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DiffCommand.cs7
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IRepositoryEditor.cs57
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IVersionControlViewHandler.cs25
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IgnoreCommand.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/LockCommand.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/LogCommand.cs25
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/MergeCommand.cs7
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/PublishCommand.cs81
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Repository.cs156
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/ResolveConflictsCommand.cs58
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertCommand.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertRevisionsCommands.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Revision.cs37
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Task.cs79
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UnknownRepository.cs26
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UnlockCommand.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UpdateCommand.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs38
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlCommandHandler.cs6
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlException.cs6
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlFileSystemExtension.cs18
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlItem.cs23
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlNodeExtension.cs165
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlService.cs131
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlSystem.cs19
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlTask.cs80
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionInfoCache.cs130
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionStatus.cs16
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/VersionControl.addin.xml27
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.CommitMessageStylePanelWidget.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Views.DiffWidget.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Views.LogWidget.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/generated.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16.pngbin342 -> 316 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16@2x.pngbin459 -> 391 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~dark.pngbin0 -> 348 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~dark@2x.pngbin0 -> 469 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~dark~sel.pngbin0 -> 325 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~dark~sel@2x.pngbin0 -> 424 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~sel.pngbin0 -> 325 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~sel@2x.pngbin0 -> 424 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16.pngbin577 -> 334 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16@2x.pngbin1287 -> 499 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~dark.pngbin0 -> 333 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~dark@2x.pngbin0 -> 510 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~dark~disabled.pngbin0 -> 289 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~dark~disabled@2x.pngbin0 -> 482 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~disabled.pngbin0 -> 304 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~disabled@2x.pngbin0 -> 507 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16.pngbin491 -> 423 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16@2x.pngbin1016 -> 817 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~dark.pngbin0 -> 396 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~dark@2x.pngbin0 -> 787 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~dark~disabled.pngbin0 -> 383 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~dark~disabled@2x.pngbin0 -> 790 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~disabled.pngbin0 -> 396 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~disabled@2x.pngbin0 -> 779 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16.pngbin885 -> 496 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16@2x.pngbin2247 -> 907 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~dark.pngbin0 -> 484 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~dark@2x.pngbin0 -> 916 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~dark~disabled.pngbin0 -> 468 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~dark~disabled@2x.pngbin0 -> 914 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~disabled.pngbin0 -> 506 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~disabled@2x.pngbin0 -> 946 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16.pngbin302 -> 324 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16@2x.pngbin439 -> 401 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~dark.pngbin0 -> 319 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~dark@2x.pngbin0 -> 413 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~dark~sel.pngbin0 -> 320 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~dark~sel@2x.pngbin0 -> 415 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~sel.pngbin0 -> 320 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~sel@2x.pngbin0 -> 415 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16.pngbin478 -> 243 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16@2x.pngbin964 -> 375 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~dark.pngbin0 -> 191 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~dark@2x.pngbin0 -> 308 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~dark~disabled.pngbin0 -> 184 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~dark~disabled@2x.pngbin0 -> 301 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~disabled.pngbin0 -> 223 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~disabled@2x.pngbin0 -> 354 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/gutter-added-15.pngbin0 -> 131 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/gutter-added-15@2x.pngbin0 -> 163 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/gutter-removed-15.pngbin0 -> 111 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/gutter-removed-15@2x.pngbin0 -> 138 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16.pngbin269 -> 297 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16@2x.pngbin405 -> 290 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~dark.pngbin0 -> 360 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~dark@2x.pngbin0 -> 430 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~dark~sel.pngbin0 -> 333 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~dark~sel@2x.pngbin0 -> 415 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~sel.pngbin0 -> 333 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~sel@2x.pngbin0 -> 415 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/local-status-16.pngbin800 -> 463 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/local-status-16@2x.pngbin1956 -> 960 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/local-status-16~dark.pngbin0 -> 442 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/local-status-16~dark@2x.pngbin0 -> 942 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16.pngbin240 -> 343 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16@2x.pngbin367 -> 406 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~dark.pngbin0 -> 347 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~dark@2x.pngbin0 -> 530 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~dark~sel.pngbin0 -> 354 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~dark~sel@2x.pngbin0 -> 478 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~sel.pngbin0 -> 354 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~sel@2x.pngbin0 -> 478 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16.pngbin280 -> 326 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16@2x.pngbin390 -> 433 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~dark.pngbin0 -> 349 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~dark@2x.pngbin0 -> 515 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~dark~sel.pngbin0 -> 354 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~dark~sel@2x.pngbin0 -> 478 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~sel.pngbin0 -> 354 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~sel@2x.pngbin0 -> 478 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/log-16.pngbin429 -> 336 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/log-16@2x.pngbin944 -> 762 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/log-16~dark.pngbin0 -> 305 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/log-16~dark@2x.pngbin0 -> 681 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16.pngbin298 -> 302 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16@2x.pngbin413 -> 390 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~dark.pngbin0 -> 338 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~dark@2x.pngbin0 -> 465 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~dark~sel.pngbin0 -> 309 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~dark~sel@2x.pngbin0 -> 416 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~sel.pngbin0 -> 309 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~sel@2x.pngbin0 -> 416 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16.pngbin885 -> 530 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16@2x.pngbin2247 -> 1092 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~dark.pngbin0 -> 508 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~dark@2x.pngbin0 -> 1046 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~dark~sel.pngbin0 -> 353 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~dark~sel@2x.pngbin0 -> 721 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~sel.pngbin0 -> 353 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~sel@2x.pngbin0 -> 721 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16.pngbin821 -> 401 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16@2x.pngbin1909 -> 608 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~dark.pngbin0 -> 386 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~dark@2x.pngbin0 -> 624 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~dark~sel.pngbin0 -> 335 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~dark~sel@2x.pngbin0 -> 488 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~sel.pngbin0 -> 335 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~sel@2x.pngbin0 -> 488 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16.pngbin0 -> 416 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16@2x.pngbin0 -> 754 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~dark.pngbin0 -> 403 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~dark@2x.pngbin0 -> 732 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~dark~sel.pngbin0 -> 284 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~dark~sel@2x.pngbin0 -> 523 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~sel.pngbin0 -> 284 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~sel@2x.pngbin0 -> 523 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-general-16.pngbin413 -> 0 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-general-16@2x.pngbin723 -> 0 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16.pngbin807 -> 434 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16@2x.pngbin1973 -> 742 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~dark.pngbin0 -> 426 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~dark@2x.pngbin0 -> 739 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~dark~disabled.pngbin0 -> 403 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~dark~disabled@2x.pngbin0 -> 697 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~disabled.pngbin0 -> 429 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~disabled@2x.pngbin0 -> 690 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16.pngbin821 -> 434 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16@2x.pngbin1909 -> 715 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~dark.pngbin0 -> 424 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~dark@2x.pngbin0 -> 707 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~dark~disabled.pngbin0 -> 401 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~dark~disabled@2x.pngbin0 -> 670 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~disabled.pngbin0 -> 419 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~disabled@2x.pngbin0 -> 700 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16.pngbin892 -> 521 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16@2x.pngbin2231 -> 976 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~dark.pngbin0 -> 512 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~dark@2x.pngbin0 -> 987 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~dark~disabled.pngbin0 -> 464 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~dark~disabled@2x.pngbin0 -> 874 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~disabled.pngbin0 -> 485 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~disabled@2x.pngbin0 -> 925 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16.pngbin828 -> 475 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16@2x.pngbin1984 -> 1030 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~dark.pngbin0 -> 449 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~dark@2x.pngbin0 -> 1022 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~dark~disabled.pngbin0 -> 442 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~dark~disabled@2x.pngbin0 -> 942 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~disabled.pngbin0 -> 463 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~disabled@2x.pngbin0 -> 960 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16.pngbin337 -> 307 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16@2x.pngbin497 -> 393 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~dark.pngbin0 -> 340 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~dark@2x.pngbin0 -> 454 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~dark~sel.pngbin0 -> 312 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~dark~sel@2x.pngbin0 -> 420 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~sel.pngbin0 -> 312 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~sel@2x.pngbin0 -> 420 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16.pngbin353 -> 318 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16@2x.pngbin491 -> 407 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~dark.pngbin0 -> 359 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~dark@2x.pngbin0 -> 483 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~dark~sel.pngbin0 -> 318 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~dark~sel@2x.pngbin0 -> 424 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~sel.pngbin0 -> 318 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~sel@2x.pngbin0 -> 424 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/repository-16.pngbin413 -> 204 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/repository-16@2x.pngbin723 -> 251 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/repository-16~dark.pngbin0 -> 199 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/repository-16~dark@2x.pngbin0 -> 253 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16.pngbin911 -> 478 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16@2x.pngbin2242 -> 966 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~dark.pngbin0 -> 464 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~dark@2x.pngbin0 -> 936 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~dark~disabled.pngbin0 -> 444 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~dark~disabled@2x.pngbin0 -> 912 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~disabled.pngbin0 -> 467 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~disabled@2x.pngbin0 -> 917 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16.pngbin629 -> 209 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16@2x.pngbin1275 -> 351 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~dark.pngbin0 -> 225 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~dark@2x.pngbin0 -> 360 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~dark~disabled.pngbin0 -> 212 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~dark~disabled@2x.pngbin0 -> 352 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~disabled.pngbin0 -> 200 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~disabled@2x.pngbin0 -> 349 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16.pngbin304 -> 320 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16@2x.pngbin400 -> 403 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~dark.pngbin0 -> 348 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~dark@2x.pngbin0 -> 519 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~dark~sel.pngbin0 -> 354 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~dark~sel@2x.pngbin0 -> 478 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~sel.pngbin0 -> 354 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~sel@2x.pngbin0 -> 478 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16.pngbin251 -> 216 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16@2x.pngbin384 -> 293 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~dark.pngbin0 -> 250 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~dark@2x.pngbin0 -> 330 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~dark~sel.pngbin0 -> 199 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~dark~sel@2x.pngbin0 -> 260 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~sel.pngbin0 -> 199 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~sel@2x.pngbin0 -> 260 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16.pngbin503 -> 197 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16@2x.pngbin1017 -> 234 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~dark.pngbin0 -> 202 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~dark@2x.pngbin0 -> 235 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~dark~disabled.pngbin0 -> 198 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~dark~disabled@2x.pngbin0 -> 227 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~disabled.pngbin0 -> 194 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~disabled@2x.pngbin0 -> 229 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16.pngbin539 -> 355 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16@2x.pngbin1156 -> 638 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~dark.pngbin0 -> 340 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~dark@2x.pngbin0 -> 608 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~dark~disabled.pngbin0 -> 329 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~dark~disabled@2x.pngbin0 -> 606 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~disabled.pngbin0 -> 331 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~disabled@2x.pngbin0 -> 595 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16.pngbin424 -> 176 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16@2x.pngbin858 -> 217 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~dark.pngbin0 -> 176 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~dark@2x.pngbin0 -> 212 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~dark~disabled.pngbin0 -> 179 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~dark~disabled@2x.pngbin0 -> 210 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~disabled.pngbin0 -> 172 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~disabled@2x.pngbin0 -> 210 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16.pngbin536 -> 175 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16@2x.pngbin1138 -> 202 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~dark.pngbin0 -> 175 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~dark@2x.pngbin0 -> 202 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~dark~disabled.pngbin0 -> 179 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~dark~disabled@2x.pngbin0 -> 204 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~disabled.pngbin0 -> 172 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~disabled@2x.pngbin0 -> 206 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16.pngbin548 -> 294 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16@2x.pngbin1176 -> 353 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~dark.pngbin0 -> 305 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~dark@2x.pngbin0 -> 362 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~dark~disabled.pngbin0 -> 286 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~dark~disabled@2x.pngbin0 -> 343 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~disabled.pngbin0 -> 288 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~disabled@2x.pngbin0 -> 343 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/version-control-16.pngbin833 -> 416 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/version-control-16@2x.pngbin2042 -> 754 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/version-control-16~dark.pngbin0 -> 403 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/version-control-16~dark@2x.pngbin0 -> 732 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16.pngbin299 -> 214 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16@2x.pngbin378 -> 290 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~dark.pngbin0 -> 240 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~dark@2x.pngbin0 -> 330 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~dark~sel.pngbin0 -> 199 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~dark~sel@2x.pngbin0 -> 260 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~sel.pngbin0 -> 199 bytes
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~sel@2x.pngbin0 -> 260 bytes
-rw-r--r--main/src/addins/VersionControl/Subversion.Win32/SvnSharpClient.cs81
-rw-r--r--main/src/addins/WindowsPlatform/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialog.cs11
-rw-r--r--main/src/addins/WindowsPlatform/WindowsAPICodePack/Shell/PropertySystem/ShellProperty.cs5
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/ChangeLog182
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/CommonFileDialogExtensions.cs2
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/OpenFileDialogHandler.cs29
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/GdkWin32.cs6
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/ImageBox.cs167
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/ImageHelper.cs76
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/JumpList.cs2
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/ComboMenu.cs316
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/DottedSeparator.xaml17
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/DottedSeparator.xaml.cs39
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/IconButton.xaml25
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/IconButton.xaml.cs241
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/SearchBar.xaml22
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/SearchBar.xaml.cs140
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/SimpleMenuItem.cs39
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/SimpleMenuItem.xaml212
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/StatusBar.xaml72
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/StatusBar.xaml.cs376
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/TitleBar.xaml12
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/TitleBar.xaml.cs30
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/TitleMenuItem.cs264
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/ToolBar.xaml33
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/Toolbar.xaml.cs29
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFToolbar.cs276
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/Styles.cs364
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/Styles.xaml640
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs108
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj205
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/WindowsProxyCredentialProvider.cs4
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/build.pngbin0 -> 503 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/build~dark.pngbin0 -> 548 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/build~hover.pngbin0 -> 506 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/build~hover~dark.pngbin0 -> 668 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/build~pressed.pngbin0 -> 522 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/build~pressed~dark.pngbin0 -> 712 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute.pngbin0 -> 590 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute~dark.pngbin0 -> 620 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute~hover.pngbin0 -> 673 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute~hover~dark.pngbin0 -> 681 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute~pressed.pngbin0 -> 673 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute~pressed~dark.pngbin0 -> 686 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug.pngbin0 -> 410 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug~dark.pngbin0 -> 387 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug~hover.pngbin0 -> 396 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug~hover~dark.pngbin0 -> 387 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug~pressed.pngbin0 -> 400 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug~pressed~dark.pngbin0 -> 428 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug.pngbin0 -> 135 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug~dark.pngbin0 -> 135 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug~hover.pngbin0 -> 149 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug~hover~dark.pngbin0 -> 149 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug~pressed.pngbin0 -> 150 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug~pressed~dark.pngbin0 -> 149 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug.pngbin0 -> 210 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug~dark.pngbin0 -> 200 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug~hover.pngbin0 -> 235 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug~hover~dark.pngbin0 -> 234 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug~pressed.pngbin0 -> 241 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug~pressed~dark.pngbin0 -> 235 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug.pngbin0 -> 201 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug~dark.pngbin0 -> 189 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug~hover.pngbin0 -> 223 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug~hover~dark.pngbin0 -> 223 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug~pressed.pngbin0 -> 234 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug~pressed~dark.pngbin0 -> 223 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug.pngbin0 -> 386 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug~dark.pngbin0 -> 359 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug~hover.pngbin0 -> 391 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug~hover~dark.pngbin0 -> 389 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug~pressed.pngbin0 -> 389 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug~pressed~dark.pngbin0 -> 396 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop.pngbin0 -> 171 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop~dark.pngbin0 -> 171 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop~hover.pngbin0 -> 170 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop~hover~dark.pngbin0 -> 177 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop~pressed.pngbin0 -> 171 bytes
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop~pressed~dark.pngbin0 -> 176 bytes
-rw-r--r--main/src/addins/Xml/Completion/EmptyXmlCompletionProvider.cs34
-rw-r--r--main/src/addins/Xml/Completion/IXmlCompletionProvider.cs18
-rw-r--r--main/src/addins/Xml/Completion/InferredXmlCompletionProvider.cs34
-rw-r--r--main/src/addins/Xml/Completion/XmlCompletionData.cs32
-rw-r--r--main/src/addins/Xml/Completion/XmlSchemaCompletionData.cs119
-rw-r--r--main/src/addins/Xml/Completion/XmlTagCompletionData.cs14
-rw-r--r--main/src/addins/Xml/Dom/XAttribute.cs7
-rw-r--r--main/src/addins/Xml/Dom/XCData.cs7
-rw-r--r--main/src/addins/Xml/Dom/XClosingTag.cs6
-rw-r--r--main/src/addins/Xml/Dom/XComment.cs8
-rw-r--r--main/src/addins/Xml/Dom/XContainer.cs6
-rw-r--r--main/src/addins/Xml/Dom/XDocType.cs9
-rw-r--r--main/src/addins/Xml/Dom/XDocument.cs6
-rw-r--r--main/src/addins/Xml/Dom/XElement.cs8
-rw-r--r--main/src/addins/Xml/Dom/XNode.cs7
-rw-r--r--main/src/addins/Xml/Dom/XObject.cs19
-rw-r--r--main/src/addins/Xml/Dom/XProcessingInstruction.cs8
-rw-r--r--main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs451
-rw-r--r--main/src/addins/Xml/Editor/XmlDocumentParser.cs36
-rw-r--r--main/src/addins/Xml/Editor/XmlEditorOptionsPanel.cs6
-rw-r--r--main/src/addins/Xml/Editor/XmlEditorService.cs680
-rw-r--r--main/src/addins/Xml/Editor/XmlParsedDocument.cs18
-rw-r--r--main/src/addins/Xml/Editor/XmlSchemasPanel.cs4
-rw-r--r--main/src/addins/Xml/Editor/XmlSchemasPanelWidget.cs14
-rw-r--r--main/src/addins/Xml/Editor/XmlTextEditorExtension.cs727
-rw-r--r--main/src/addins/Xml/Formatting/XmlFormatter.cs22
-rw-r--r--main/src/addins/Xml/Formatting/XmlFormatterWriter.cs22
-rw-r--r--main/src/addins/Xml/Formatting/XmlFormattingPolicyPanel.cs4
-rw-r--r--main/src/addins/Xml/Formatting/XmlFormattingPolicyPanelWidget.cs5
-rw-r--r--main/src/addins/Xml/MSBuild/MSBuildResolveContext.cs2
-rw-r--r--main/src/addins/Xml/MSBuild/MSBuildTextEditorExtension.cs20
-rw-r--r--main/src/addins/Xml/MonoDevelop.Xml.csproj43
-rw-r--r--main/src/addins/Xml/Parser/XmlClosingTagState.cs6
-rw-r--r--main/src/addins/Xml/Parser/XmlCommentState.cs1
-rw-r--r--main/src/addins/Xml/Parser/XmlDocTypeState.cs7
-rw-r--r--main/src/addins/Xml/Parser/XmlParser.cs54
-rw-r--r--main/src/addins/Xml/Parser/XmlRootState.cs8
-rw-r--r--main/src/addins/Xml/Parser/XmlTagState.cs91
-rw-r--r--main/src/addins/Xml/Properties/MonoDevelop.XmlEditor.addin.xml5
-rw-r--r--main/src/addins/Xml/Tests/Formatting/XmlFormatterTests.cs83
-rw-r--r--main/src/addins/Xml/Tests/MonoDevelop.Xml.Tests.csproj9
-rw-r--r--main/src/addins/Xml/Tests/Parser/ParsingTests.cs20
-rw-r--r--main/src/addins/Xml/Tests/Parser/TestXmlParser.cs6
-rw-r--r--main/src/addins/Xml/Tests/Schema/AbstractElementTestFixture.cs32
-rw-r--r--main/src/addins/Xml/Tests/Schema/AllElementTestFixture.cs24
-rw-r--r--main/src/addins/Xml/Tests/Schema/AttributeAnnotationTestFixture.cs23
-rw-r--r--main/src/addins/Xml/Tests/Schema/AttributeGroupRefTestFixture.cs25
-rw-r--r--main/src/addins/Xml/Tests/Schema/AttributeRefTestFixture.cs25
-rw-r--r--main/src/addins/Xml/Tests/Schema/AttributeValueAnnotationTestFixture.cs13
-rw-r--r--main/src/addins/Xml/Tests/Schema/ChildElementAttributesTestFixture.cs16
-rw-r--r--main/src/addins/Xml/Tests/Schema/ChoiceTestFixture.cs29
-rw-r--r--main/src/addins/Xml/Tests/Schema/ComplexContentExtensionTestFixture.cs37
-rw-r--r--main/src/addins/Xml/Tests/Schema/DuplicateElementTestFixture.cs19
-rw-r--r--main/src/addins/Xml/Tests/Schema/ElementAnnotationTestFixture.cs23
-rw-r--r--main/src/addins/Xml/Tests/Schema/ElementRefAnnotationTestFixture.cs14
-rw-r--r--main/src/addins/Xml/Tests/Schema/ElementWithAttributeSchemaTestFixture.cs21
-rw-r--r--main/src/addins/Xml/Tests/Schema/EnumAttributeValueTestFixture.cs19
-rw-r--r--main/src/addins/Xml/Tests/Schema/ExtensionElementTestFixture.cs63
-rw-r--r--main/src/addins/Xml/Tests/Schema/GroupRefCompositorTestFixture.cs25
-rw-r--r--main/src/addins/Xml/Tests/Schema/GroupRefTestFixture.cs31
-rw-r--r--main/src/addins/Xml/Tests/Schema/MissingSchemaElementTestFixture.cs13
-rw-r--r--main/src/addins/Xml/Tests/Schema/NestedAttributeGroupRefTestFixture.cs34
-rw-r--r--main/src/addins/Xml/Tests/Schema/NestedChoiceTestFixture.cs34
-rw-r--r--main/src/addins/Xml/Tests/Schema/NestedElementSchemaTestFixture.cs17
-rw-r--r--main/src/addins/Xml/Tests/Schema/NestedSequenceTestFixture.cs30
-rw-r--r--main/src/addins/Xml/Tests/Schema/ReferencedElementsTestFixture.cs50
-rw-r--r--main/src/addins/Xml/Tests/Schema/RestrictionElementTestFixture.cs60
-rw-r--r--main/src/addins/Xml/Tests/Schema/SchemaTestFixtureBase.cs11
-rw-r--r--main/src/addins/Xml/Tests/Schema/SequencedChoiceTestFixture.cs28
-rw-r--r--main/src/addins/Xml/Tests/Schema/SimpleContentWithAttributeTestFixture.cs14
-rw-r--r--main/src/addins/Xml/Tests/Schema/SingleElementSchemaTestFixture.cs22
-rw-r--r--main/src/addins/Xml/Tests/Schema/TwoElementSchemaTestFixture.cs28
-rw-r--r--main/src/addins/Xml/Tests/Schema/XhtmlStrictSchemaTestFixture.cs19
-rw-r--r--main/src/addins/Xml/Tests/Schema/XsdSchemaTestFixture.cs86
-rw-r--r--main/src/addins/Xml/icons/prefs-xml-16.pngbin422 -> 256 bytes
-rw-r--r--main/src/addins/Xml/icons/prefs-xml-16@2x.pngbin917 -> 501 bytes
-rw-r--r--main/src/addins/Xml/icons/prefs-xml-16~dark.pngbin0 -> 212 bytes
-rw-r--r--main/src/addins/Xml/icons/prefs-xml-16~dark@2x.pngbin0 -> 456 bytes
-rw-r--r--main/src/addins/Xml/icons/prefs-xml-16~dark~sel.pngbin0 -> 207 bytes
-rw-r--r--main/src/addins/Xml/icons/prefs-xml-16~dark~sel@2x.pngbin0 -> 403 bytes
-rw-r--r--main/src/addins/Xml/icons/prefs-xml-16~sel.pngbin0 -> 224 bytes
-rw-r--r--main/src/addins/Xml/icons/prefs-xml-16~sel@2x.pngbin0 -> 453 bytes
-rw-r--r--main/src/addins/Xml/icons/prefs-xml-schemas-16.pngbin422 -> 0 bytes
-rw-r--r--main/src/addins/Xml/icons/prefs-xml-schemas-16@2x.pngbin917 -> 0 bytes
-rw-r--r--main/src/core/ChangeLog19
-rw-r--r--main/src/core/Mono.Texteditor/ChangeLog7179
-rw-r--r--main/src/core/Mono.Texteditor/Makefile.am4
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting.Regex/Regex.cs21
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/ColorScheme.cs452
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SemanticRule.cs2
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxMode.cs28
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs24
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs71
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs12
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/AvlTree.cs774
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/ImmutableText.cs712
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/ImmutableTextTextReader.cs72
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextBreaker.cs2
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextFileUtility.cs146
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/NewViEditMode.cs125
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViActionMaps.cs277
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViActions.cs12
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViBuilderContext.cs322
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViBuilders.cs206
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViCommandMap.cs103
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViEditor.cs314
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViEditorActions.cs60
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViKeyNotation.cs424
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViMacro.cs63
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViMark.cs86
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViMode.cs1155
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViModeAbortException.cs54
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViStatusArea.cs168
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViWordFindStrategy.cs196
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.csproj38
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/ClipboardActions.cs67
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/DeleteActions.cs67
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/MiscActions.cs85
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/BookmarkMarker.cs11
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Caret.cs6
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Document/BufferedTextReader.cs93
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DiffTracker.cs2
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentLine.cs13
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentUpdateRequest.cs23
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Document/GapBuffer.cs599
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Document/IBuffer.cs131
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LazyLineSplitter.cs206
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LineSplitter.cs2
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Document/PrimitiveLineSplitter.cs8
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Document/StringBuffer.cs70
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs252
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/EditMode.cs20
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/ActionMargin.cs10
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/CodeSegmentEditorWindow.cs8
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs21
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/DashedLineMargin.cs4
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldMarkerMargin.cs45
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldingScreenbackgroundRenderer.cs4
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs2
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GutterMargin.cs12
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/HslColor.cs2
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/ITooltipProvider.cs10
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/IconMargin.cs8
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/LayoutCache.cs37
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/Margin.cs6
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/MonoTextEditor.cs1284
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs318
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextEditor.cs1255
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs533
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TooltipProvider.cs16
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/HeightTree.cs7
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/HelperMethods.cs5
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/IIndentationTracker.cs17
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/ITextEditorOptions.cs34
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/InsertionCursorEditMode.cs19
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/LineBackgroundMarker.cs4
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/MarginMarker.cs10
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Selection.cs5
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/SimpleEditMode.cs45
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Styles.cs83
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs137
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorOptions.cs64
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/TextLineMarker.cs27
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/TextLinkEditMode.cs22
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/TextSegmentMarker.cs24
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/UnderlineMarker.cs5
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/UrlMarker.cs3
-rw-r--r--main/src/core/Mono.Texteditor/Styles/DarkStyle.json247
-rw-r--r--main/src/core/Mono.Texteditor/Styles/DefaultStyle.json237
-rw-r--r--main/src/core/Mono.Texteditor/Styles/GruvboxStyle.json231
-rw-r--r--main/src/core/Mono.Texteditor/Styles/LightStyle.json246
-rw-r--r--main/src/core/Mono.Texteditor/Styles/MonokaiStyle.json466
-rw-r--r--main/src/core/Mono.Texteditor/Styles/NightshadeStyle.json516
-rw-r--r--main/src/core/Mono.Texteditor/Styles/OblivionStyle.json483
-rw-r--r--main/src/core/Mono.Texteditor/Styles/SolarizedDarkStyle.json461
-rw-r--r--main/src/core/Mono.Texteditor/Styles/SolarizedLightStyle.json438
-rw-r--r--main/src/core/Mono.Texteditor/Styles/TangoStyle.json366
-rw-r--r--main/src/core/Mono.Texteditor/Styles/VisualStudioStyle.json258
-rw-r--r--main/src/core/Mono.Texteditor/SyntaxModes/CSharpSyntaxMode.xml40
-rw-r--r--main/src/core/Mono.Texteditor/SyntaxModes/FSharpSyntaxMode.xml273
-rw-r--r--main/src/core/Mono.Texteditor/SyntaxModes/VBNetSyntaxMode.xml1
-rw-r--r--main/src/core/MonoDevelop.Core/AssemblyInfo.cs3
-rw-r--r--main/src/core/MonoDevelop.Core/ChangeLog4056
-rw-r--r--main/src/core/MonoDevelop.Core/CoreExtensions.cs40
-rw-r--r--main/src/core/MonoDevelop.Core/MSBuild/CodeSharing.CSharp.targets2
-rw-r--r--main/src/core/MonoDevelop.Core/MSBuild/CodeSharing.Common.Default.props2
-rw-r--r--main/src/core/MonoDevelop.Core/MSBuild/CodeSharing.Common.props2
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/AssemblyContext.cs33
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/ComposedAssemblyContext.cs11
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs49
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/SystemAssemblyService.cs43
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetFramework.cs10
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetRuntime.cs11
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/BinaryMessage.cs748
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/DefaultExecutionHandler.cs3
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/DotNetExecutionHandler.cs2
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ExternalConsoleFactory.cs44
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IConsole.cs44
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IConsoleFactory.cs37
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IDebugConsole.cs35
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IExecutionHandler.cs3
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IProcessAsyncOperation.cs53
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/LocalConsole.cs32
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/MonoPlatformExecutionHandler.cs23
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/MultipleOperationConsoles.cs474
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/NativePlatformExecutionHandler.cs5
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/OperationConsole.cs157
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/OperationConsoleFactory.cs81
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/OutputProgressMonitor.cs45
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessAsyncOperation.cs62
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessHostController.cs116
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessService.cs104
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessWrapper.cs104
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/RemoteProcessConnection.cs661
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/RemoteProcessServer.cs313
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.FileSystem/DefaultFileSystemExtension.cs9
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.FileSystem/FileSystemExtension.cs11
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Instrumentation/InstrumentationService.cs40
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Logging/AssertLoggingTraceListener.cs22
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedAsyncOperation.cs112
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedOperationMonitor.cs77
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs186
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AsyncOperation.cs134
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs39
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProjectLoadProgressMonitor.cs17
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/FilteredProgressMonitor.cs8
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/IProjectLoadProgressMonitor.cs37
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/NullAsyncOperation.cs73
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/NullProgressMonitor.cs242
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ProgressStatusMonitor.cs11
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ProjectLoadProgressMonitor.cs53
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/SimpleProgressMonitor.cs77
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/SynchronizedProgressMonitor.cs139
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/WrappedProgressMonitor.cs115
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/ClassDataType.cs33
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataCollection.cs111
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataDeletedValue.cs42
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataItem.cs25
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataNode.cs6
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/GenericCollectionHandler.cs14
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/ILoadController.cs37
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/SerializationContext.cs17
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/XmlDataSerializer.cs30
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.StringParsing/StringTagModelExtensions.cs52
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/BacktrackingStringMatcher.cs22
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/ISegment.cs421
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/ITextSource.cs215
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/ITextSourceVersion.cs74
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/StringTextSource.cs195
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextChangeEventArgs.cs135
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextFileUtility.cs959
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextSourceVersionProvider.cs136
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/UnicodeNewLine.cs366
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Web/RequestHelper.cs99
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.addin.xml138
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj291
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/ApplicationService.cs3
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/AsyncEventHandler.cs36
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/BrandingService.cs54
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/FilePath.cs32
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/FileService.cs1619
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/FileWriteableState.cs52
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/Gettext.cs48
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/IApplication.cs3
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/IAsyncOperation.cs46
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/IProgressMonitor.cs70
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs2
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/ProgressMonitor.cs791
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/Properties.cs67
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/PropertyBag.cs95
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/PropertyService.cs94
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs185
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/StringParserService.cs14
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/UserProfile.cs3
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/WebRequestHelper.cs21
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/DotNetProjectNode.cs77
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/DotNetProjectSubtypeNode.cs214
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/DotNetProjectTypeNode.cs68
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/FlavorTypeCondition.cs46
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/IFileFormat.cs70
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/IPathHandler.cs41
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/IResourceHandler.cs50
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ISolutionItemHandler.cs98
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ImportRedirectTypeNode.cs40
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ItemTypeCondition.cs46
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ItemTypeNode.cs123
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/LanguageBindingCodon.cs59
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/LanguageBindingExtensionNode.cs74
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/MSBuildProjectExtensionNode.cs46
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectBindingCodon.cs48
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectExtensionUtil.cs147
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectMigrationHandler.cs85
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectMigrationHandlerNode.cs45
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectModelExtensionNode.cs45
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectTypeNode.cs96
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemExtensionNode.cs105
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemHandler.cs91
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemNode.cs57
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemTypeNode.cs123
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/TypeTagCondition.cs71
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1DotNetProjectHandler.cs420
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1FileFormat.cs189
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1ProjectService.cs53
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1SolutionEntityItemHandler.cs47
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1SolutionItemHandler.cs59
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionAndExpression.cs92
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionExpression.cs42
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionFactorExpresion.cs126
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionFunctionExpression.cs121
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionNotExpression.cs75
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionOrExpression.cs88
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionParser.cs250
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionRelationalExpression.cs167
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionTokenizer.cs301
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ExpressionParseException.cs58
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/InvalidProjectFileException.cs192
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/Token.cs96
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/CompiledAssemblyProjectMSBuildHandler.cs68
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/IMSBuildGlobalPropertyProvider.cs36
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/IMSBuildImportProvider.cs36
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildExtension.cs49
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildFileFormat.cs353
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildHandler.cs172
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildImportAttribute.cs41
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProject.cs1096
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs2216
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectService.cs821
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MergeToProjectAttribute.cs43
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/RemoteProjectBuilder.cs275
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/SlnData.cs141
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/SlnFileFormat.cs1338
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/TargetsAvailableCondition.cs60
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MD1/MD1DotNetProjectHandler.cs440
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MD1/MD1FileFormat.cs158
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MD1/MD1ProjectService.cs47
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionAndExpression.cs100
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionExpression.cs46
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionFactorExpresion.cs139
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionFunctionExpression.cs131
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionNotExpression.cs80
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionOrExpression.cs94
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionParser.cs293
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionRelationalExpression.cs232
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionTokenizer.cs325
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ExpressionEvaluationException.cs57
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ExpressionParseException.cs57
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/Token.cs128
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs698
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/EscapingUtilities.cs296
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/FileUtil.cs98
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMSBuildGlobalPropertyProvider.cs36
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMSBuildProject.cs519
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMSBuildProjectObject.cs34
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMSBuildPropertyEvaluated.cs58
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMSBuildPropertySet.cs392
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMetadataProperty.cs60
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IntrinsicFunctions.cs416
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildChoose.cs105
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildElement.cs69
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEngine.cs115
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEngineManager.cs76
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEngineV12.cs192
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEngineV4.cs212
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEvaluationContext.cs767
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildFileFormat.cs371
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildFileFormatException.cs36
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildImport.cs119
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildImportAttribute.cs41
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildImportGroup.cs92
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildItem.cs225
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildItemGroup.cs91
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildObject.cs428
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProject.cs1108
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectExtensions.cs108
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectFromFile.cs324
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectInstance.cs233
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs1239
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProperty.cs504
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyCore.cs119
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyEvaluated.cs131
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyGroup.cs451
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyGroupEvaluated.cs292
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildTarget.cs250
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildTask.cs79
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildValueType.cs75
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildWhitespace.cs308
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildXmlElement.cs154
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildXmlNode.cs168
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildXmlReader.cs151
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MergeToProjectAttribute.cs43
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/ProjectEvaluationException.cs40
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteProjectBuilder.cs438
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/SlnFile.cs1046
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/SlnFileFormat.cs782
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/TargetsAvailableCondition.cs60
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/UnknownSolutionItemTypeException.cs64
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/DotNetNamingPolicy.cs16
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicyBag.cs6
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicyDictionary.cs2
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicyService.cs2
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProject.cs212
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProjectBinding.cs58
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProjectMSBuildExtension.cs60
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProjectMSBuildHandler.cs143
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/DocGenerator.cs4
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/IEditableTextFile.cs47
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/ITextFileProvider.cs38
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/TextFile.cs72
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/AsyncCriticalSection.cs88
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/AuthorInformation.cs24
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildAction.cs8
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildEventHandler.cs8
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildResult.cs47
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildTool.cs47
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ChainedExtension.cs113
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CleanEventHandler.cs6
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CombineEntryRenamedEventArgs.cs2
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CompiledAssemblyProject.cs80
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConditionedPropertyCollection.cs269
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConfigurationEventHandler.cs2
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConfigurationKind.cs37
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConfigurationParameters.cs82
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConfigurationSelector.cs4
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommand.cs69
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommandCollection.cs18
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommandExtension.cs101
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DefaultConfigurationSelector.cs2
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetAssemblyProject.cs108
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetCompilerParameters.cs88
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs1044
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectBinding.cs76
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectConfiguration.cs81
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectExtension.cs140
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectParameters.cs40
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExecutionContext.cs10
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportDotNetProjectTypeAttribute.cs45
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportProjectFlavorAttribute.cs48
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportProjectItemTypeAttribute.cs43
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportProjectModelExtensionAttribute.cs36
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportProjectTypeAttribute.cs45
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportSolutionItemTypeAttribute.cs62
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExtensionChain.cs95
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/FileFormat.cs104
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/FileFormatManager.cs106
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/GenericProject.cs21
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/GenericProjectBinding.cs59
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/HelpService.cs169
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IBuildTarget.cs69
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IConfigurationTarget.cs12
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IDotNetFileContainer.cs2
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IDotNetLanguageBinding.cs50
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ILanguageBinding.cs52
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IMSBuildFileObject.cs37
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IProjectBinding.cs59
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IPropertySet.cs60
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IWorkspaceObject.cs54
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemCollection.cs141
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemConfiguration.cs44
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemConfigurationCollection.cs16
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemConfigurationSelector.cs2
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/LanguageBinding.cs108
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/LanguageBindingService.cs66
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/MSBuildSerializationExtension.cs67
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/MSBuildSupport.cs49
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PathBasedProjectItem.cs62
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PortableDotNetProject.cs100
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PortableDotNetProjectBinding.cs57
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PortableDotNetProjectFlavor.cs88
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs2329
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectConfiguration.cs207
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectConvertTool.cs18
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectCreateInformation.cs25
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectCreateParameters.cs19
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs233
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFeature.cs39
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFile.cs206
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFileCollection.cs46
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItem.cs138
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItemCollection.cs77
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItemEventArgs.cs17
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItemMetadata.cs361
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectOperationContext.cs7
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectParameters.cs73
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectReference.cs278
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs687
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs468
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SimpleProjectItem.cs37
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Solution.cs620
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionConfiguration.cs34
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionConfigurationCollection.cs14
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionConfigurationSelector.cs6
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionDataSectionAttribute.cs44
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionEntityItem.cs654
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionExtension.cs156
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolder.cs438
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolderItem.cs512
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolderItemCollection.cs62
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItem.cs1939
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemConfiguration.cs10
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemConfigurationCollection.cs24
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemEventArgs.cs16
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemExtension.cs285
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemFactory.cs36
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemReference.cs8
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/TargetEvaluationResult.cs15
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ThreadSafeAttribute.cs34
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownConfiguration.cs3
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownProject.cs78
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownSolutionItem.cs57
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownWorkspaceItem.cs24
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Workspace.cs241
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceItem.cs588
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceItemCollection.cs58
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceItemExtension.cs79
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceObject.cs615
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceObjectExtension.cs100
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceObjectReader.cs67
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceSerializationExtension.cs79
-rw-r--r--main/src/core/MonoDevelop.Core/packages.config8
-rw-r--r--main/src/core/MonoDevelop.Ide/AssemblyInfo.cs13
-rw-r--r--main/src/core/MonoDevelop.Ide/ChangeLog19649
-rw-r--r--main/src/core/MonoDevelop.Ide/ExtensionModel/Commands.addin.xml121
-rw-r--r--main/src/core/MonoDevelop.Ide/ExtensionModel/DefaultPolicyPanels.addin.xml2
-rw-r--r--main/src/core/MonoDevelop.Ide/ExtensionModel/GlobalOptionsDialog.addin.xml6
-rw-r--r--main/src/core/MonoDevelop.Ide/ExtensionModel/ItemOptionPanels.addin.xml25
-rw-r--r--main/src/core/MonoDevelop.Ide/ExtensionModel/MainMenu.addin.xml9
-rw-r--r--main/src/core/MonoDevelop.Ide/ExtensionModel/MimeTypes.addin.xml9
-rw-r--r--main/src/core/MonoDevelop.Ide/ExtensionModel/MonoDevelop.Ide.addin.xml62
-rw-r--r--main/src/core/MonoDevelop.Ide/ExtensionModel/Pads.addin.xml6
-rw-r--r--main/src/core/MonoDevelop.Ide/ExtensionModel/StockIcons.addin.xml410
-rw-r--r--main/src/core/MonoDevelop.Ide/ExtensionModel/Templates.addin.xml11
-rw-r--r--main/src/core/MonoDevelop.Ide/Makefile.am4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkNotebookResult.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkTreeModelResult.cs18
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkWidgetResult.cs9
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs9
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/ObjectResult.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AppQuery.cs16
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AppResult.cs14
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs15
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestService.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestSession.cs26
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/DataTransferObjects.cs60
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/Axis.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs207
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/Serie.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands.ExtensionNodes/LinkItemCodon.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandEntry.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandEntrySet.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandFrame.cs39
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandHandler.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs249
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenu.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuItem.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandRouterContainer.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToggleToolButton.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolButton.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolbar.cs79
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/KeyBindingManager.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/LinkCommandEntry.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/MenuToolButton.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs16
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebookTab.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockWindow.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs354
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/ArrowWindow.cs136
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockGrip.cs72
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbar.cs411
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrame.cs400
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrameLayout.cs42
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrameStatus.cs45
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarPanel.cs1034
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarPosition.cs52
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarStatus.cs71
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockedPosition.cs81
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FixedPanel.cs270
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FloatingDock.cs65
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FloatingPosition.cs75
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/IDockBar.cs37
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/PlaceholderWindow.cs55
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs27
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs76
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs11
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs19
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroup.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroupItem.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItem.cs79
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs49
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs189
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemToolbar.cs100
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockObject.cs14
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockPositionType.cs39
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockVisualStyle.cs18
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/PlaceholderWindow.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/TabStrip.cs24
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-close-9.pngbin236 -> 126 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-close-9@2x.pngbin603 -> 197 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-close-9~dark.pngbin0 -> 127 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-close-9~dark@2x.pngbin0 -> 197 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-dock-9.pngbin212 -> 136 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-dock-9@2x.pngbin468 -> 165 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-dock-9~dark.pngbin0 -> 136 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-dock-9~dark@2x.pngbin0 -> 165 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-minimize-9.pngbin199 -> 127 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-minimize-9@2x.pngbin402 -> 152 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-minimize-9~dark.pngbin0 -> 127 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-minimize-9~dark@2x.pngbin0 -> 152 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/ErrorDialog.cs76
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarDialogBackend.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarWindowBackend.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/PlatformDialog.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/TextQuestionDialog.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/CommandSearchCategory.cs125
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ConfigurationMerger.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/FileSearchCategory.cs210
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ISearchDataSource.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ISearchResultCallback.cs36
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs20
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs44
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ProjectSearchCategory.cs357
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ResultsDataSource.cs27
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/RoundButton.cs71
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchCategory.cs40
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchInSolutionSearchCategory.cs92
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupSearchPattern.cs39
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupWindow.cs538
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchResult.cs287
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs142
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusAreaBuildTheme.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusAreaTheme.cs41
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-left-cap-normal~dark.pngbin0 -> 255 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-left-cap-normal~dark@2x.pngbin0 -> 524 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-left-cap-pressed~dark.pngbin0 -> 196 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-left-cap-pressed~dark@2x.pngbin0 -> 367 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-middle-cap-normal~dark.pngbin0 -> 170 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-middle-cap-normal~dark@2x.pngbin0 -> 235 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-middle-cap-pressed~dark.pngbin0 -> 135 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-middle-cap-pressed~dark@2x.pngbin0 -> 236 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-right-cap-normal~dark.pngbin0 -> 275 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-right-cap-normal~dark@2x.pngbin0 -> 563 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-right-cap-pressed~dark.pngbin0 -> 196 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-right-cap-pressed~dark@2x.pngbin0 -> 386 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-disabled-32~dark.pngbin0 -> 929 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-disabled-32~dark@2x.pngbin0 -> 2169 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-hover-32~dark.pngbin0 -> 1137 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-hover-32~dark@2x.pngbin0 -> 2762 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-normal-32~dark.pngbin0 -> 1137 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-normal-32~dark@2x.pngbin0 -> 2762 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-pressed-32~dark.pngbin0 -> 645 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-pressed-32~dark@2x.pngbin0 -> 1536 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-build-disabled-32~dark.pngbin0 -> 316 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-build-disabled-32~dark@2x.pngbin0 -> 524 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-build-normal-32~dark.pngbin0 -> 421 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-build-normal-32~dark@2x.pngbin0 -> 918 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-execute-disabled-32~dark.pngbin0 -> 315 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-execute-disabled-32~dark@2x.pngbin0 -> 502 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-execute-normal-32~dark.pngbin0 -> 467 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-execute-normal-32~dark@2x.pngbin0 -> 958 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-stop-disabled-32~dark.pngbin0 -> 125 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-stop-disabled-32~dark@2x.pngbin0 -> 207 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-stop-normal-32~dark.pngbin0 -> 228 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-stop-normal-32~dark@2x.pngbin0 -> 304 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/BooleanEditorCell.cs42
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs13
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/ColorEditorCell.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/ExpandableObjectEditor.cs61
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/FlagsSelectorDialog.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/PropertyTextEditor.cs306
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/TextEditor.cs306
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/TextEditorDialog.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/EditorManager.cs134
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs64
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs24
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs30
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkColors.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/Theme.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/ThemeContext.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/ThemeEngine.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ButtonEvent.cs63
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CairoExtensions.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererComboBox.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs17
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactDialog.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenu.cs40
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs12
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsMac.cs61
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuItem.cs11
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuItemCollection.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuTreeView.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs153
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Dialog.cs67
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs57
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ExtendedLabel.cs42
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileChooserAction.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileSelector.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FixedWidthWrapLabel.cs13
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkGestures.cs252
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs178
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs1365
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HelperMethods.cs163
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HslColor.cs292
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeDialog.cs46
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs367
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeWindow.cs38
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs74
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/InfoBar.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Mac/MDMenu.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Mac/Util.cs23
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButton.cs9
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MiniButton.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs260
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs72
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWidget.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWindow.cs68
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWindowTheme.cs203
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs66
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SelectFolderDialog.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TabLabel.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs77
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipPopoverWindow.cs47
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs22
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TreeViewCellContainer.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/VPanedThin.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Window.cs67
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/WindowTransparencyDecorator.cs116
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWPFWidget.cs156
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CodeCompletionContextEventArgs.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionCategory.cs50
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionData.cs134
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionDataList.cs24
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs576
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionWindowManager.cs138
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/DisplayFlags.cs42
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ICompletionKeyHandler.cs55
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ICompletionWidget.cs19
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs377
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWindow.cs289
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/MemberCompletionData.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/MruCache.cs67
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/MutableCompletionDataList.cs14
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterDataProvider.cs78
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterHintingData.cs67
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterHintingResult.cs114
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindow.cs157
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs186
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs135
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/AbstractCodeFormatter.cs120
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormatter.cs140
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormatterExtensionNode.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormatterService.cs24
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormattingCommands.cs109
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/DefaultCodeFormatter.cs22
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/IAdvancedCodeFormatter.cs64
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/ICodeFormatter.cs56
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs127
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateCodon.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateCompletionData.cs16
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateListDataProvider.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs31
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs45
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs59
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs222
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/IListDataProvider.cs51
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/PadCodon.cs40
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/ProjectActiveCondition.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/SolutionPadCodon.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/CustomStringTagProvider.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/EditCommands.cs107
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/HelpCommands.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ProjectCommands.cs135
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/TextEditorCommands.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ToolsCommands.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ViewCommands.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/CustomTool.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/CustomToolService.cs221
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/MSBuildCustomTool.cs21
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/PublicResXFileCodeGenerator.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/ResXFileCodeGenerator.cs116
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/ThreadAsyncOperation.cs120
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs39
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentFileStorage.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentOpen.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/AbstractBraceMatcher.cs63
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/AbstractNavigationExtension.cs251
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/AbstractUsagesExtension.cs248
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/AutoInsertBracketTextEditorExtension.cs72
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/BraceMatcherTextEditorExtension.cs154
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/BraceMatchingResult.cs51
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/CompletionTextEditorExtension.cs659
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/DefaultCommandTextEditorExtension.cs652
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/ErrorHandlerTextEditorExtension.cs240
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/FoldingTextEditorExtension.cs151
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/IQuickTaskProvider.cs41
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/IndentationTracker.cs54
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/KeyDescriptor.cs220
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/ModifierKeys.cs40
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/QuickTask.cs76
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/SelectionSurroundingProvider.cs57
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/SpecialKey.cs48
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/TextEditorExtension.cs126
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/TextPasteHandler.cs64
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/Usage.cs49
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/AmbientColor.cs187
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ChunkStyle.cs173
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ColorDescriptionAttribute.cs47
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ColorScheme.cs1072
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ColoredSegment.cs64
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/IStreamProvider.cs88
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/SemanticHighlighting.cs76
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/SyntaxModeService.cs259
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/TemplateCodon.cs64
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/TemplateExtensionNodeLoader.cs55
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Util/Diff.cs587
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Util/SimpleBracketMatcher.cs277
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Util/SimpleReadonlyDocument.cs421
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/AutoSave.cs172
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Commands/DynamicAbbrevHandler.cs193
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/CustomEditorOptions.cs192
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DefaultSourceEditorOptions.cs777
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DocumentContext.cs170
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DocumentLocation.cs237
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DocumentRegion.cs181
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/EditActions.cs516
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/EditSession.cs180
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/FileSettingsStore.cs73
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/FoldSegmentFactory.cs86
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/IDocumentLine.cs113
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/IFoldSegment.cs74
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/IReadonlyTextDocument.cs246
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextDocument.cs140
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextEditorOptions.cs125
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextLineMarker.cs80
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextSegmentMarker.cs92
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/IUnitTestMarker.cs38
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InsertionCursorEventArgs.cs51
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InsertionModeOptions.cs88
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InsertionPoint.cs119
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/IEditorActionHost.cs123
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextEditorFactory.cs44
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextEditorImpl.cs221
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextMarkerFactory.cs58
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/LineEventArgs.cs48
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/MessageBubbles/MessageBubbleCommands.cs77
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/IProjectionExtension.cs39
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedCompletionExtension.cs465
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedDocumentContext.cs151
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedFilterCompletionTextEditorExtension.cs204
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedSegment.cs94
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedSemanticHighlighting.cs106
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedTooltipProvider.cs94
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/Projection.cs154
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/SegmentTree.cs804
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/SelectionMode.cs33
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs1427
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorDisplayBinding.cs114
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorFactory.cs124
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorType.cs39
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs330
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextLink.cs136
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextLinkModeEventArgs.cs43
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextLinkModeOptions.cs66
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextMarkerFactory.cs133
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextMarkerMouseEventArgs.cs49
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipExtensionNode.cs49
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs189
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/WordFindStrategy.cs37
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/CommandExecutionContext.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/CustomExecutionMode.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/ExecutionModeCommandService.cs21
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/ParameterizedExecutionHandler.cs52
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/TargetedExecutionHandler.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Extensions/MimeTypeNode.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Extensions/OptionsDialogSection.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Extensions/OptionsPanelNode.cs13
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs29
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs150
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindReplace.cs48
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/ISearchProgressMonitor.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/MemberCollector.cs236
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/MemberReference.cs29
-rwxr-xr-xmain/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/ReferencesFinder.cs321
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/Scope.cs86
-rwxr-xr-xmain/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchCollector.cs272
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchProgressMonitor.cs111
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResult.cs46
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultPad.cs34
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs319
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontChooserPanel.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontChooserPanelWidget.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs43
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs463
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ITreeNavigator.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/LogView.cs201
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/NodeBuilder.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/NodeState.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/PadTreeView.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ProjectSelectorWidget.cs52
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TransactedTreeBuilder.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeBuilder.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeNodeNavigator.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs524
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/DocumentStateTracker.cs19
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IEditableTextBuffer.cs70
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IEncodedTextContent.cs41
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IExtensibleTextEditor.cs43
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IFoldable.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IOpenNamedElementHandler.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IPathedDocument.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ISmartIndenter.cs63
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ISupportsProjectReload.cs62
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ITextBuffer.cs46
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ITextEditorResolver.cs37
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs181
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/AboutMonoDevelopTabPage.cs18
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/AddinLoadErrorDialog.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs19
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FeedbackDialog.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkAlertDialog.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkErrorDialog.cs185
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/IOptionsPanel.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ItemOptionsDialog.cs16
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ItemOptionsPanel.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MimeTypePolicyOptionsPanel.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MimeTypePolicyOptionsSection.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsDialog.cs32
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs56
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiMessageDialog.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiTaskProgressDialog.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs103
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsPanel.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/PolicyOptionsPanel.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs25
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SelectFileFormatDialog.cs11
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/TipOfTheDay.cs11
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AddInsOptionsPanel.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AssemblyFoldersPanel.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AuthorInformationPanel.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildMessagePanel.cs16
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs22
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/GlobalAuthorInformationPanel.cs15
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs104
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs9
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs15
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LogAgentOptionsPanel.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MaintenanceOptionsPanel.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MonoRuntimePanel.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/SdkLocationPanel.cs12
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs36
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TextStylePolicyPanel.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPad.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPadWidget.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassData.cs32
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassNodeBuilder.cs108
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs18
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/EventNodeBuilder.cs20
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/FieldNodeBuilder.cs12
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/MemberNodeBuilder.cs36
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/MemberNodeCommandHandler.cs11
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/MethodNodeBuilder.cs12
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceData.cs64
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs255
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/PropertyNodeBuilder.cs12
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ReferenceNodeBuilder.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/SolutionNodeBuilder.cs39
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs38
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ImplicitFrameworkAssemblyReferenceNodeBuilder.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/PortableFrameworkSubsetNodeBuilder.cs65
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs41
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolder.cs14
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs36
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs82
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectPadContextMenu.addin.xml2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceFolderNodeBuilder.cs53
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs12
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectSolutionPad.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs56
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderFileNodeBuilder.cs19
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs167
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs105
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFile.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs15
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs14
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/WorkspaceNodeBuilder.cs78
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs82
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs210
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs15
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TaskListPad.cs29
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractAttachableViewContent.cs49
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractBaseViewContent.cs91
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractPadContent.cs92
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractViewContent.cs168
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/BaseViewContent.cs166
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/CommonTextEditorOptions.cs90
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ConfigurationComboBox.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs238
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DisplayBindingService.cs30
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DockItemToolbarLoader.cs12
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs750
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs13
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentToolbar.cs102
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentView.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/FileViewer.cs9
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/GtkSynchronizationContext.cs53
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/GuiSyncContext.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenTextEditorViewContent.cs96
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenWorkbenchWindow.cs26
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IAttachableViewContent.cs40
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IBaseViewContent.cs48
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IDisplayBinding.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContainer.cs36
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContent.cs40
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IViewContent.cs64
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IWorkbenchWindow.cs20
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/InternalLog.cs178
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/LayoutComboBox.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadContent.cs81
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadFontChanger.cs9
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProgressMonitors.cs107
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProjectLoadProgressMonitor.cs15
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs103
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SideBar.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/StartupInfo.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/StatusProgressMonitor.cs46
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/StockIcons.cs19
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs624
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SyncContext.cs224
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs122
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewContent.cs166
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs363
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchMemento.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchWindow.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/DocumentNavigationPoint.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs14
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationPoint.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/TextFileNavigationPoint.cs16
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ProgressMonitoring/BaseProgressMonitor.cs310
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ProgressMonitoring/MessageDialogProgressMonitor.cs66
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ProgressMonitoring/MultiTaskDialogProgressMonitor.cs46
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ProgressMonitoring/ProgressBarMonitor.cs90
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/BaseDirectoryPanel.cs12
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/BaseDirectoryPanelWidget.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeAnalysisPanel.cs18
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeFormattingPanel.cs18
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineBuildOptions.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineConfigurationPanel.cs16
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineInformationPanel.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineMSBuildOptions.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CommonAssemblySigningPreferences.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandPanel.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandPanelWidget.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandWidget.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/GeneralProjectOptions.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/NamespaceSynchronisationPanel.cs18
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/OutputOptionsPanel.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/PortableRuntimeOptionsPanel.cs23
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/RunOptionsPanel.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/RuntimeOptionsPanel.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/SolutionItemConfigurationsPanel.cs9
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/StartupOptionsPanel.cs15
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddExternalFileDialog.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddMimeTypeDialog.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ApplyPolicyDialog.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs12
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/CombineOptionsDialog.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ConfirmProjectDeleteDialog.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs17
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ExportProjectPolicyDialog.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ExportSolutionDialog.cs24
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/FinalProjectConfigurationPage.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs72
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs18
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectConfigurationWidget.cs9
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectFolderPreviewWidget.cs27
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCategoryCellRenderer.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs15
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/INewProjectController.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/IdeFileSystemExtensionExtension.cs64
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ImportProjectPolicyDialog.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs52
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectConfiguration.cs47
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectController.cs134
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/PackageReferencePanel.cs236
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectFileSelectorDialog.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectOptionsDialog.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectReferencePanel.cs18
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectSelectorDialog.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs12
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.StandardHeader/StandardHeaderPolicyPanel.cs44
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksChangedEventHandler.cs43
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksView.cs277
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/ITaskListView.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/ProjectCommentTags.cs93
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/Task.cs281
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskListEntry.cs292
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskService.cs18
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs191
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs104
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs18
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CombinedTagModel.cs54
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/DirectoryTemplate.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplate.cs59
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplateReference.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplateTagsModifier.cs121
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ISolutionItemDescriptor.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ParentProjectFileTemplateCondition.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectCreateInformationExtensions.cs40
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectDescriptor.cs72
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs32
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/PropertyDescriptionTemplate.cs82
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ResourceFileDescriptionTemplate.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs164
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SolutionDescriptor.cs11
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SolutionItemDescriptor.cs11
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/TemplateConditionEvaluator.cs60
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/TextFileDescriptionTemplate.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/FileExtension.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/FileExtensionEventArgs.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/FileLineExtension.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/HorizontalAlignment.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/LineCountEventArgs.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TextEditorService.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TextFileEventArgs.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TextLineMarkerExtension.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TopLevelWidgetExtension.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/VerticalAlignment.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/Ambience.cs684
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/AmbienceService.cs559
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/AmbienceTooltipProvider.cs42
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/CodeGenerationService.cs580
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/CodeGenerator.cs70
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/Comment.cs13
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ConditionalRegion.cs88
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/DocumentTrackingService.cs59
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/Error.cs216
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/FoldingRegion.cs16
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/IFoldingParser.cs41
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/IRefactoringContext.cs41
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MetadataReferenceCache.cs177
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopPersistentStorageServiceFactory.cs254
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopProjectCacheHostServiceFactory.cs134
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopProjectContent.cs109
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceText.cs132
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceTextContainer.cs101
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopTemporaryStorageServiceFactory.cs276
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopTextLoader.cs71
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs1253
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDocDocumentationProvider.cs149
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/NR5CompatibiltyExtensions.cs396
-rwxr-xr-xmain/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/NetAmbience.cs367
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/OutputFlags.cs65
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/OutputSettings.cs268
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ParsedDocument.cs347
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ParsedFileEventArgs.cs44
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/PreProcessorDefine.cs58
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ProjectCacheService.cs676
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ProjectCommentTags.cs80
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ProjectContentEventArgs.cs52
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/SolutionSizeTracker.cs91
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/StockIcons.cs311
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/Tag.cs11
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemOutputTrackingNode.cs61
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemParser.cs125
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemParserNode.cs32
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs2744
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService_WorkspaceHandling.cs485
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/WorkspaceId.cs70
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs52
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/IUpdateHandler.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/UpdateService.cs18
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/DefaultWelcomePage.cs14
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/IWelcomePageProvider.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/Style.cs154
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageBarButton.cs33
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFeedItem.cs66
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFirstRun.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageLinkButton.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs197
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageOptionPanel.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageRecentProjectsList.cs64
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageSection.cs31
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageTipOfTheDaySection.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageWidget.cs37
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/link-chat.pngbin1545 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/link-cloud.pngbin1396 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/link-heart.pngbin1520 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/link-info.pngbin1707 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/new_solution.pngbin1191 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/open_solution.pngbin1085 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/starburst.pngbin154299 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-chat-16.pngbin0 -> 193 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-chat-16@2x.pngbin0 -> 309 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-chat-16~dark.pngbin0 -> 196 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-chat-16~dark@2x.pngbin0 -> 309 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-info-16.pngbin0 -> 159 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-info-16@2x.pngbin0 -> 255 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-info-16~dark.pngbin0 -> 158 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-info-16~dark@2x.pngbin0 -> 252 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-md-16.pngbin0 -> 333 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-md-16@2x.pngbin0 -> 733 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-md-16~dark.pngbin0 -> 335 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-md-16~dark@2x.pngbin0 -> 733 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-support-16.pngbin0 -> 131 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-support-16@2x.pngbin0 -> 178 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-support-16~dark.pngbin0 -> 131 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-support-16~dark@2x.pngbin0 -> 179 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-new-solution-16.pngbin0 -> 102 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-new-solution-16@2x.pngbin0 -> 124 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-new-solution-16~dark.pngbin0 -> 100 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-new-solution-16~dark@2x.pngbin0 -> 125 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-open-solution-16.pngbin0 -> 99 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-open-solution-16@2x.pngbin0 -> 132 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-open-solution-16~dark.pngbin0 -> 100 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-open-solution-16~dark@2x.pngbin0 -> 133 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj6260
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs53
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DispatchService.cs348
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/FeedbackService.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/HelpOperations.cs24
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs23
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdePreferences.cs348
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs146
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeVersionInfo.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs207
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs134
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs1145
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs579
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Services.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/TaskUtil.cs52
-rw-r--r--main/src/core/MonoDevelop.Ide/branding/AboutImage.pngbin107951 -> 2787 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/branding/AboutImage@2x.pngbin0 -> 5239 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/branding/WelcomePage_Logo.pngbin46887 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/branding/WelcomePage_TopBorderRepeat.pngbin1426 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/branding/welcome-logo.pngbin0 -> 2809 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/branding/welcome-logo@2x.pngbin0 -> 5222 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/branding/welcome-tile.pngbin0 -> 83 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/branding/welcome-tile@2x.pngbin0 -> 86 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Execution.MonoExecutionParametersWidget.cs23
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs18
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs26
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs11
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs31
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs55
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs212
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs30
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.ProgressMonitoring.ProgressBarMonitor.cs49
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.AddExternalFileDialog.cs30
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.AddMimeTypeDialog.cs14
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.DeleteConfigDialog.cs23
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.GtkProjectConfigurationWidget.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.GtkProjectFolderPreviewWidget.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.NewFileDialog.cs23
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.OptionPanels.CodeFormattingPanelWidget.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.ProjectFileSelectorDialog.cs26
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.SelectReferenceDialog.cs96
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.SelectEncodingsDialog.cs73
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.StandardHeader.StandardHeaderPolicyPanelWidget.cs42
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/generated.cs37
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/gui.stetic220
-rw-r--r--main/src/core/MonoDevelop.Ide/gtk-gui/objects.xml241
-rw-r--r--main/src/core/MonoDevelop.Ide/gtkrc178
-rw-r--r--main/src/core/MonoDevelop.Ide/gtkrc.mac370
-rw-r--r--main/src/core/MonoDevelop.Ide/gtkrc.mac-dark504
-rw-r--r--main/src/core/MonoDevelop.Ide/gtkrc.mac-yosemite26
-rw-r--r--main/src/core/MonoDevelop.Ide/gtkrc.win32350
-rw-r--r--main/src/core/MonoDevelop.Ide/gtkrc.win32-dark454
-rw-r--r--main/src/core/MonoDevelop.Ide/gtkrc.win32-vista351
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/about-md-16.pngbin0 -> 590 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/about-md-16@2x.pngbin0 -> 1558 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/about-md-16~dark.pngbin0 -> 601 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/about-md-16~dark@2x.pngbin0 -> 1608 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/about-md-16~dark~disabled.pngbin0 -> 545 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/about-md-16~dark~disabled@2x.pngbin0 -> 1424 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/about-md-16~disabled.pngbin0 -> 555 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/about-md-16~disabled@2x.pngbin0 -> 1537 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/add-16.pngbin424 -> 408 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/add-16@2x.pngbin848 -> 840 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/add-16~dark.pngbin0 -> 401 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/add-16~dark@2x.pngbin0 -> 829 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/add-16~dark~disabled.pngbin0 -> 376 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/add-16~dark~disabled@2x.pngbin0 -> 773 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/add-16~disabled.pngbin0 -> 385 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/add-16~disabled@2x.pngbin0 -> 818 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/add-namespace-16.pngbin680 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/assembly-project-16.pngbin497 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/assembly-project-16@2x.pngbin938 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/assembly-reference-overlay-16.pngbin235 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/assembly-reference-overlay-16@2x.pngbin406 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/bookmark-clear-all-16.pngbin0 -> 348 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/bookmark-clear-all-16@2x.pngbin0 -> 894 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/bookmark-clear-all-16~dark.pngbin0 -> 348 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/bookmark-clear-all-16~dark@2x.pngbin0 -> 869 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/bookmark-next-16.pngbin0 -> 353 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/bookmark-next-16@2x.pngbin0 -> 713 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/bookmark-next-16~dark.pngbin0 -> 369 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/bookmark-next-16~dark@2x.pngbin0 -> 701 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/bookmark-prev-16.pngbin0 -> 356 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/bookmark-prev-16@2x.pngbin0 -> 722 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/bookmark-prev-16~dark.pngbin0 -> 373 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/bookmark-prev-16~dark@2x.pngbin0 -> 691 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/bookmark-toggle-16.pngbin0 -> 355 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/bookmark-toggle-16@2x.pngbin0 -> 646 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/bookmark-toggle-16~dark.pngbin0 -> 356 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/bookmark-toggle-16~dark@2x.pngbin0 -> 629 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-16.pngbin0 -> 107 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-16@2x.pngbin0 -> 194 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-16~dark.pngbin0 -> 107 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-16~dark@2x.pngbin0 -> 194 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-normal-16.pngbin288 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-normal-16@2x.pngbin646 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breadcrumb-prev-16.pngbin0 -> 107 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breadcrumb-prev-16@2x.pngbin0 -> 200 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breadcrumb-prev-16~dark.pngbin0 -> 107 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breadcrumb-prev-16~dark@2x.pngbin0 -> 200 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breadcrumb-previous-normal-16.pngbin288 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breadcrumb-previous-normal-16@2x.pngbin658 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-16.pngbin940 -> 473 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-16@2x.pngbin2618 -> 1174 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-16~dark.pngbin0 -> 469 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-16~dark@2x.pngbin0 -> 1171 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-16~dark~disabled.pngbin0 -> 469 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-16~dark~disabled@2x.pngbin0 -> 1151 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-16~disabled.pngbin0 -> 498 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-16~disabled@2x.pngbin0 -> 1207 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16.pngbin797 -> 559 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16@2x.pngbin2008 -> 1293 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~dark.pngbin0 -> 693 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~dark@2x.pngbin0 -> 1422 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~dark~disabled.pngbin0 -> 634 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~dark~disabled@2x.pngbin0 -> 1588 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~disabled.pngbin0 -> 647 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~disabled@2x.pngbin0 -> 1631 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16.pngbin770 -> 445 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16@2x.pngbin1971 -> 1055 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~dark.pngbin0 -> 471 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~dark@2x.pngbin0 -> 1198 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~dark~disabled.pngbin0 -> 469 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~dark~disabled@2x.pngbin0 -> 1151 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~disabled.pngbin0 -> 498 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~disabled@2x.pngbin0 -> 1207 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16.pngbin857 -> 423 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16@2x.pngbin2172 -> 805 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~dark.pngbin0 -> 413 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~dark@2x.pngbin0 -> 765 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~dark~disabled.pngbin0 -> 402 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~dark~disabled@2x.pngbin0 -> 735 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~disabled.pngbin0 -> 431 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~disabled@2x.pngbin0 -> 834 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16.pngbin947 -> 555 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16@2x.pngbin2613 -> 1302 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~dark.pngbin0 -> 543 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~dark@2x.pngbin0 -> 1289 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~dark~disabled.pngbin0 -> 495 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~dark~disabled@2x.pngbin0 -> 1177 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~disabled.pngbin0 -> 530 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~disabled@2x.pngbin0 -> 1243 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16.pngbin932 -> 630 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16@2x.pngbin2485 -> 1440 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~dark.pngbin0 -> 626 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~dark@2x.pngbin0 -> 1527 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~dark~disabled.pngbin0 -> 469 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~dark~disabled@2x.pngbin0 -> 1151 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~disabled.pngbin0 -> 498 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~disabled@2x.pngbin0 -> 1207 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/bug-16.pngbin0 -> 413 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/bug-16@2x.pngbin0 -> 779 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/bug-16~dark.pngbin0 -> 403 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/bug-16~dark@2x.pngbin0 -> 778 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/build-project-16.pngbin614 -> 190 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/build-project-16@2x.pngbin0 -> 305 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/build-project-16~dark.pngbin0 -> 194 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/build-project-16~dark@2x.pngbin0 -> 302 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/build-solution-16.pngbin589 -> 219 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/build-solution-16@2x.pngbin0 -> 311 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/build-solution-16~dark.pngbin0 -> 222 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/build-solution-16~dark@2x.pngbin0 -> 308 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-16.pngbin878 -> 504 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-16@2x.pngbin2015 -> 959 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-16~dark.pngbin0 -> 487 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-16~dark@2x.pngbin0 -> 940 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-16~dark~disabled.pngbin0 -> 447 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-16~dark~disabled@2x.pngbin0 -> 902 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-16~disabled.pngbin0 -> 493 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-16~disabled@2x.pngbin0 -> 937 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16.pngbin741 -> 470 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16@2x.pngbin1677 -> 906 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~dark.pngbin0 -> 500 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~dark@2x.pngbin0 -> 973 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~dark~disabled.pngbin0 -> 447 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~dark~disabled@2x.pngbin0 -> 902 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~disabled.pngbin0 -> 493 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~disabled@2x.pngbin0 -> 937 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16.pngbin0 -> 526 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16@2x.pngbin0 -> 961 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~dark.pngbin0 -> 507 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~dark@2x.pngbin0 -> 956 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~dark~disabled.pngbin0 -> 453 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~dark~disabled@2x.pngbin0 -> 875 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~disabled.pngbin0 -> 490 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~disabled@2x.pngbin0 -> 936 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/clear-16.pngbin660 -> 240 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/clear-16@2x.pngbin1395 -> 344 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/clear-16~dark.pngbin0 -> 245 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/clear-16~dark@2x.pngbin0 -> 343 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/clear-16~dark~disabled.pngbin0 -> 241 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/clear-16~dark~disabled@2x.pngbin0 -> 338 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/clear-16~disabled.pngbin0 -> 242 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/clear-16~disabled@2x.pngbin0 -> 338 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/clear-all-bookmarks-16.pngbin535 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/close-all-documents-16.pngbin429 -> 291 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/close-all-documents-16@2x.pngbin0 -> 456 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/close-all-documents-16~dark.pngbin0 -> 297 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/close-all-documents-16~dark@2x.pngbin0 -> 489 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/close-solution-16.pngbin1307 -> 254 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/close-solution-16@2x.pngbin0 -> 492 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/close-solution-16~dark.pngbin0 -> 255 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/close-solution-16~dark@2x.pngbin0 -> 493 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/columns-one-16.pngbin0 -> 154 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/columns-one-16@2x.pngbin0 -> 230 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/columns-one-16~dark.pngbin0 -> 147 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/columns-one-16~dark@2x.pngbin0 -> 229 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/columns-two-16.pngbin0 -> 152 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/columns-two-16@2x.pngbin0 -> 250 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/columns-two-16~dark.pngbin0 -> 159 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/columns-two-16~dark@2x.pngbin0 -> 247 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/command-16.pngbin692 -> 376 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/command-16@2x.pngbin1584 -> 1080 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/command-16~dark.pngbin0 -> 369 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/command-16~dark@2x.pngbin0 -> 949 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/command-16~dark~sel.pngbin0 -> 268 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/command-16~dark~sel@2x.pngbin0 -> 587 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/command-16~sel.pngbin0 -> 268 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/command-16~sel@2x.pngbin0 -> 587 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/comment-16.pngbin491 -> 396 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/comment-16@2x.pngbin1016 -> 779 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/comment-16~dark.pngbin0 -> 383 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/comment-16~dark@2x.pngbin0 -> 790 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/copy-16.pngbin388 -> 203 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/copy-16@2x.pngbin724 -> 322 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/copy-16~dark.pngbin0 -> 202 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/copy-16~dark@2x.pngbin0 -> 322 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/cut-16.pngbin0 -> 491 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/cut-16@2x.pngbin0 -> 1043 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/cut-16~dark.pngbin0 -> 453 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/cut-16~dark@2x.pngbin0 -> 1004 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/disclose-arrow-down-16.pngbin530 -> 447 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/disclose-arrow-down-16@2x.pngbin1480 -> 782 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/disclose-arrow-down-16~dark.pngbin0 -> 380 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/disclose-arrow-down-16~dark@2x.pngbin0 -> 743 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/disclose-arrow-up-16.pngbin563 -> 453 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/disclose-arrow-up-16@2x.pngbin1430 -> 747 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/disclose-arrow-up-16~dark.pngbin0 -> 394 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/disclose-arrow-up-16~dark@2x.pngbin0 -> 727 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-16.pngbin838 -> 450 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-16@2x.pngbin1956 -> 723 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-16~dark.pngbin0 -> 449 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-16~dark@2x.pngbin0 -> 758 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-16~dark~sel.pngbin0 -> 309 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-16~dark~sel@2x.pngbin0 -> 485 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-16~sel.pngbin0 -> 309 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-16~sel@2x.pngbin0 -> 485 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-24.pngbin1378 -> 589 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-24@2x.pngbin3064 -> 1120 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-24~dark.pngbin0 -> 588 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-24~dark@2x.pngbin0 -> 1109 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-24~dark~sel.pngbin0 -> 391 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-24~dark~sel@2x.pngbin0 -> 832 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-24~sel.pngbin0 -> 391 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-24~sel@2x.pngbin0 -> 832 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-32.pngbin1956 -> 723 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-32@2x.pngbin4467 -> 1330 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-32~dark.pngbin0 -> 758 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-32~dark@2x.pngbin0 -> 1313 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-32~dark~sel.pngbin0 -> 485 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-32~dark~sel@2x.pngbin0 -> 1021 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-32~sel.pngbin0 -> 485 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-32~sel@2x.pngbin0 -> 1021 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-48.pngbin3064 -> 1120 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-48@2x.pngbin7145 -> 2282 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-48~dark.pngbin0 -> 1109 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-48~dark@2x.pngbin0 -> 2251 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-48~dark~sel.pngbin0 -> 832 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-48~dark~sel@2x.pngbin0 -> 1895 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-48~sel.pngbin0 -> 832 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/done-48~sel@2x.pngbin0 -> 1895 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/edit-16.pngbin838 -> 367 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/edit-16@2x.pngbin2128 -> 732 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/edit-16~dark.pngbin0 -> 356 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/edit-16~dark@2x.pngbin0 -> 735 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/edit-16~dark~disabled.pngbin0 -> 339 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/edit-16~dark~disabled@2x.pngbin0 -> 696 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/edit-16~disabled.pngbin0 -> 373 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/edit-16~disabled@2x.pngbin0 -> 704 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/edit-find-next-16.pngbin869 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/edit-select-all-16.pngbin441 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-class-16.pngbin429 -> 265 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-class-16@2x.pngbin893 -> 608 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-class-16~dark.pngbin0 -> 266 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-class-16~dark@2x.pngbin0 -> 649 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-class-16~dark~sel.pngbin0 -> 256 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-class-16~dark~sel@2x.pngbin0 -> 514 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-class-16~sel.pngbin0 -> 256 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-class-16~sel@2x.pngbin0 -> 514 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-constant-16.pngbin326 -> 267 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-constant-16@2x.pngbin592 -> 558 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark.pngbin0 -> 260 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark@2x.pngbin0 -> 542 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark~sel.pngbin0 -> 223 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark~sel@2x.pngbin0 -> 390 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-constant-16~sel.pngbin0 -> 223 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-constant-16~sel@2x.pngbin0 -> 390 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-delegate-16.pngbin406 -> 271 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-delegate-16@2x.pngbin853 -> 531 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-delegate-16~dark.pngbin0 -> 262 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-delegate-16~dark@2x.pngbin0 -> 553 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-delegate-16~dark~sel.pngbin0 -> 251 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-delegate-16~dark~sel@2x.pngbin0 -> 473 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-delegate-16~sel.pngbin0 -> 251 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-delegate-16~sel@2x.pngbin0 -> 473 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-enum-16.pngbin0 -> 225 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-enum-16@2x.pngbin0 -> 359 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-enum-16~dark.pngbin0 -> 238 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-enum-16~dark@2x.pngbin0 -> 365 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-enum-16~dark~sel.pngbin0 -> 215 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-enum-16~dark~sel@2x.pngbin0 -> 363 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-enum-16~sel.pngbin0 -> 215 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-enum-16~sel@2x.pngbin0 -> 363 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-enumeration-16.pngbin411 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-enumeration-16@2x.pngbin773 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-event-16.pngbin288 -> 210 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-event-16@2x.pngbin502 -> 243 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-event-16~dark.pngbin0 -> 206 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-event-16~dark@2x.pngbin0 -> 242 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-event-16~dark~sel.pngbin0 -> 178 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-event-16~dark~sel@2x.pngbin0 -> 217 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-event-16~sel.pngbin0 -> 178 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-event-16~sel@2x.pngbin0 -> 217 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-exception-16.pngbin399 -> 210 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-exception-16@2x.pngbin869 -> 340 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-exception-16~dark.pngbin0 -> 210 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-exception-16~dark@2x.pngbin0 -> 348 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-exception-16~dark~sel.pngbin0 -> 216 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-exception-16~dark~sel@2x.pngbin0 -> 378 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-exception-16~sel.pngbin0 -> 216 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-exception-16~sel@2x.pngbin0 -> 378 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16.pngbin459 -> 282 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16@2x.pngbin967 -> 481 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~dark.pngbin0 -> 282 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~dark@2x.pngbin0 -> 499 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~dark~sel.pngbin0 -> 216 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~dark~sel@2x.pngbin0 -> 361 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~sel.pngbin0 -> 216 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~sel@2x.pngbin0 -> 361 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-field-16.pngbin278 -> 196 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-field-16@2x.pngbin477 -> 234 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-field-16~dark.pngbin0 -> 204 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-field-16~dark@2x.pngbin0 -> 243 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-field-16~dark~sel.pngbin0 -> 166 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-field-16~dark~sel@2x.pngbin0 -> 212 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-field-16~sel.pngbin0 -> 166 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-field-16~sel@2x.pngbin0 -> 212 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-fs-field-16.pngbin450 -> 301 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-fs-field-16@2x.pngbin817 -> 502 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~dark.pngbin0 -> 295 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~dark@2x.pngbin0 -> 504 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~dark~sel.pngbin0 -> 242 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~dark~sel@2x.pngbin0 -> 430 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~sel.pngbin0 -> 242 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~sel@2x.pngbin0 -> 430 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-interface-16.pngbin363 -> 214 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-interface-16@2x.pngbin684 -> 333 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-interface-16~dark.pngbin0 -> 212 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-interface-16~dark@2x.pngbin0 -> 335 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-interface-16~dark~sel.pngbin0 -> 215 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-interface-16~dark~sel@2x.pngbin0 -> 342 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-interface-16~sel.pngbin0 -> 215 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-interface-16~sel@2x.pngbin0 -> 342 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-keyword-16.pngbin290 -> 260 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-keyword-16@2x.pngbin565 -> 497 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-keyword-16~dark.pngbin0 -> 244 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-keyword-16~dark@2x.pngbin0 -> 474 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-keyword-16~dark~sel.pngbin0 -> 188 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-keyword-16~dark~sel@2x.pngbin0 -> 371 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-keyword-16~sel.pngbin0 -> 188 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-keyword-16~sel@2x.pngbin0 -> 371 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-method-16.pngbin369 -> 257 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-method-16@2x.pngbin694 -> 456 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-method-16~dark.pngbin0 -> 249 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-method-16~dark@2x.pngbin0 -> 462 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-method-16~dark~sel.pngbin0 -> 239 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-method-16~dark~sel@2x.pngbin0 -> 415 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-method-16~sel.pngbin0 -> 239 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-method-16~sel@2x.pngbin0 -> 415 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-method-new-16.pngbin479 -> 301 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-method-new-16@2x.pngbin1002 -> 510 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-method-new-16~dark.pngbin0 -> 291 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-method-new-16~dark@2x.pngbin0 -> 523 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-method-new-16~dark~sel.pngbin0 -> 260 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-method-new-16~dark~sel@2x.pngbin0 -> 444 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-method-new-16~sel.pngbin0 -> 260 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-method-new-16~sel@2x.pngbin0 -> 444 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-module-16.pngbin455 -> 262 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-module-16@2x.pngbin967 -> 545 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-module-16~dark.pngbin0 -> 259 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-module-16~dark@2x.pngbin0 -> 562 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-module-16~dark~sel.pngbin0 -> 277 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-module-16~dark~sel@2x.pngbin0 -> 539 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-module-16~sel.pngbin0 -> 277 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-module-16~sel@2x.pngbin0 -> 539 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-namespace-16.pngbin456 -> 273 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-namespace-16@2x.pngbin1026 -> 539 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-namespace-16~dark.pngbin0 -> 274 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-namespace-16~dark@2x.pngbin0 -> 547 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-namespace-16~dark~sel.pngbin0 -> 230 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-namespace-16~dark~sel@2x.pngbin0 -> 488 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-namespace-16~sel.pngbin0 -> 230 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-namespace-16~sel@2x.pngbin0 -> 488 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16.pngbin557 -> 316 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16@2x.pngbin1090 -> 599 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~dark.pngbin0 -> 322 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~dark@2x.pngbin0 -> 620 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~dark~sel.pngbin0 -> 264 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~dark~sel@2x.pngbin0 -> 520 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~sel.pngbin0 -> 264 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~sel@2x.pngbin0 -> 520 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-property-16.pngbin314 -> 235 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-property-16@2x.pngbin572 -> 362 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-property-16~dark.pngbin0 -> 240 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-property-16~dark@2x.pngbin0 -> 386 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-property-16~dark~sel.pngbin0 -> 201 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-property-16~dark~sel@2x.pngbin0 -> 316 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-property-16~sel.pngbin0 -> 201 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-property-16~sel@2x.pngbin0 -> 316 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16.pngbin0 -> 121 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16@2x.pngbin0 -> 170 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~dark.pngbin0 -> 117 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~dark@2x.pngbin0 -> 160 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~dark~sel.pngbin0 -> 117 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~dark~sel@2x.pngbin0 -> 180 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~sel.pngbin0 -> 117 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~sel@2x.pngbin0 -> 180 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-struct-16.pngbin0 -> 317 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-struct-16@2x.pngbin0 -> 729 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-struct-16~dark.pngbin0 -> 319 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-struct-16~dark@2x.pngbin0 -> 714 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-struct-16~dark~sel.pngbin0 -> 263 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-struct-16~dark~sel@2x.pngbin0 -> 559 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-struct-16~sel.pngbin0 -> 263 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-struct-16~sel@2x.pngbin0 -> 559 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-structure-16.pngbin470 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-structure-16@2x.pngbin991 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-template-16.pngbin305 -> 108 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-template-16@2x.pngbin574 -> 190 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-template-16~dark.pngbin0 -> 108 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-template-16~dark@2x.pngbin0 -> 187 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-template-16~dark~sel.pngbin0 -> 105 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-template-16~dark~sel@2x.pngbin0 -> 166 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-template-16~sel.pngbin0 -> 105 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-template-16~sel@2x.pngbin0 -> 166 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16.pngbin420 -> 195 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16@2x.pngbin1028 -> 336 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~dark.pngbin0 -> 184 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~dark@2x.pngbin0 -> 295 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~dark~sel.pngbin0 -> 184 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~dark~sel@2x.pngbin0 -> 261 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~sel.pngbin0 -> 184 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~sel@2x.pngbin0 -> 261 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-type-16.pngbin408 -> 222 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-type-16@2x.pngbin742 -> 335 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-type-16~dark.pngbin0 -> 222 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-type-16~dark@2x.pngbin0 -> 338 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-type-16~dark~sel.pngbin0 -> 210 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-type-16~dark~sel@2x.pngbin0 -> 342 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-type-16~sel.pngbin0 -> 210 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-type-16~sel@2x.pngbin0 -> 342 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-variable-16.pngbin484 -> 261 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-variable-16@2x.pngbin958 -> 472 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-variable-16~dark.pngbin0 -> 264 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-variable-16~dark@2x.pngbin0 -> 497 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-variable-16~dark~sel.pngbin0 -> 219 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-variable-16~dark~sel@2x.pngbin0 -> 352 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-variable-16~sel.pngbin0 -> 219 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-variable-16~sel@2x.pngbin0 -> 352 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-an-protected-overlay-16.pngbin170 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-an-protected-overlay-16@2x.pngbin302 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16.pngbin0 -> 185 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16@2x.pngbin0 -> 318 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~dark.pngbin0 -> 169 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~dark@2x.pngbin0 -> 261 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~dark~sel.pngbin0 -> 224 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~dark~sel@2x.pngbin0 -> 361 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~sel.pngbin0 -> 224 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~sel@2x.pngbin0 -> 361 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-or-protected-overlay-16.pngbin170 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-or-protected-overlay-16@2x.pngbin298 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-overlay-16.pngbin170 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-overlay-16@2x.pngbin300 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16.pngbin0 -> 326 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16@2x.pngbin0 -> 388 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~dark.pngbin0 -> 319 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~dark@2x.pngbin0 -> 352 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~dark~sel.pngbin0 -> 257 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~dark~sel@2x.pngbin0 -> 289 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~sel.pngbin0 -> 257 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~sel@2x.pngbin0 -> 357 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16.pngbin0 -> 215 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16@2x.pngbin0 -> 326 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~dark.pngbin0 -> 205 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~dark@2x.pngbin0 -> 287 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~dark~sel.pngbin0 -> 208 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~dark~sel@2x.pngbin0 -> 291 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~sel.pngbin0 -> 208 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~sel@2x.pngbin0 -> 291 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-private-overlay-16.pngbin176 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-private-overlay-16@2x.pngbin309 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16.pngbin0 -> 231 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16@2x.pngbin0 -> 367 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~dark.pngbin0 -> 209 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~dark@2x.pngbin0 -> 277 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~dark~sel.pngbin0 -> 226 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~dark~sel@2x.pngbin0 -> 332 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~sel.pngbin0 -> 226 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~sel@2x.pngbin0 -> 332 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16.pngbin0 -> 219 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16@2x.pngbin0 -> 320 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~dark.pngbin0 -> 207 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~dark@2x.pngbin0 -> 288 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~dark~sel.pngbin0 -> 208 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~dark~sel@2x.pngbin0 -> 291 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~sel.pngbin0 -> 208 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~sel@2x.pngbin0 -> 291 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-overlay-16.pngbin165 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-overlay-16@2x.pngbin284 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16.pngbin0 -> 235 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16@2x.pngbin0 -> 361 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~dark.pngbin0 -> 232 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~dark@2x.pngbin0 -> 304 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~dark~sel.pngbin0 -> 226 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~dark~sel@2x.pngbin0 -> 332 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~sel.pngbin0 -> 226 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~sel@2x.pngbin0 -> 332 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-static-overlay-16.pngbin233 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/element-visibility-static-overlay-16@2x.pngbin360 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-16.pngbin894 -> 411 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-16@2x.pngbin1967 -> 810 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-16~dark.pngbin0 -> 394 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-16~dark@2x.pngbin0 -> 782 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-16~dark~sel.pngbin0 -> 258 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-16~dark~sel@2x.pngbin0 -> 516 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-16~sel.pngbin0 -> 258 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-16~sel@2x.pngbin0 -> 516 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-24.pngbin1398 -> 614 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-24@2x.pngbin3092 -> 1169 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-24~dark.pngbin0 -> 602 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-24~dark@2x.pngbin0 -> 1095 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-24~dark~sel.pngbin0 -> 375 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-24~dark~sel@2x.pngbin0 -> 772 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-24~sel.pngbin0 -> 375 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-24~sel@2x.pngbin0 -> 772 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-32.pngbin1967 -> 810 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-32@2x.pngbin4309 -> 1515 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-32~dark.pngbin0 -> 782 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-32~dark@2x.pngbin0 -> 1480 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-32~dark~sel.pngbin0 -> 516 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-32~dark~sel@2x.pngbin0 -> 1095 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-32~sel.pngbin0 -> 516 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-32~sel@2x.pngbin0 -> 1095 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-48.pngbin3092 -> 1169 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-48@2x.pngbin6846 -> 2545 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-48~dark.pngbin0 -> 1095 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-48~dark@2x.pngbin0 -> 2307 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-48~dark~sel.pngbin0 -> 772 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-48~dark~sel@2x.pngbin0 -> 1864 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-48~sel.pngbin0 -> 772 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/error-48~sel@2x.pngbin0 -> 1864 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/execute-16.pngbin0 -> 314 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/execute-16@2x.pngbin0 -> 487 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/execute-16~dark.pngbin0 -> 313 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/execute-16~dark@2x.pngbin0 -> 469 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/execute-16~dark~disabled.pngbin0 -> 296 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/execute-16~dark~disabled@2x.pngbin0 -> 465 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/execute-16~disabled.pngbin0 -> 282 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/execute-16~disabled@2x.pngbin0 -> 439 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/execute-all-16.pngbin0 -> 294 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/execute-all-16@2x.pngbin0 -> 565 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/execute-all-16~dark.pngbin0 -> 288 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/execute-all-16~dark@2x.pngbin0 -> 559 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/execute-all-16~dark~disabled.pngbin0 -> 279 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/execute-all-16~dark~disabled@2x.pngbin0 -> 522 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/execute-all-16~disabled.pngbin0 -> 272 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/execute-all-16~disabled@2x.pngbin0 -> 523 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/feedback-16.pngbin528 -> 255 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/feedback-16@2x.pngbin1218 -> 393 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/feedback-16~dark.pngbin0 -> 245 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/feedback-16~dark@2x.pngbin0 -> 385 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/feedback-16~dark~disabled.pngbin0 -> 249 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/feedback-16~dark~disabled@2x.pngbin0 -> 365 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/feedback-16~disabled.pngbin0 -> 255 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/feedback-16~disabled@2x.pngbin0 -> 418 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-class-16.pngbin0 -> 250 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-class-16@2x.pngbin0 -> 523 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-class-16~dark.pngbin0 -> 208 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-class-16~dark@2x.pngbin0 -> 486 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-class-16~dark~sel.pngbin0 -> 201 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-class-16~dark~sel@2x.pngbin0 -> 452 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-class-16~sel.pngbin0 -> 219 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-class-16~sel@2x.pngbin0 -> 463 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-class-32.pngbin885 -> 523 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-class-32@2x.pngbin1733 -> 1143 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-class-32~dark.pngbin0 -> 486 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-class-32~dark@2x.pngbin0 -> 978 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-class-32~dark~sel.pngbin0 -> 452 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-class-32~dark~sel@2x.pngbin0 -> 818 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-class-32~sel.pngbin0 -> 463 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-class-32~sel@2x.pngbin0 -> 993 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-css-16.pngbin0 -> 227 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-css-16@2x.pngbin0 -> 792 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-css-16~dark.pngbin0 -> 188 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-css-16~dark@2x.pngbin0 -> 671 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-css-16~dark~sel.pngbin0 -> 184 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-css-16~dark~sel@2x.pngbin0 -> 509 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-css-16~sel.pngbin0 -> 202 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-css-16~sel@2x.pngbin0 -> 539 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-css-32.pngbin0 -> 792 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-css-32@2x.pngbin0 -> 1693 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-css-32~dark.pngbin0 -> 671 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-css-32~dark@2x.pngbin0 -> 1513 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-css-32~dark~sel.pngbin0 -> 509 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-css-32~dark~sel@2x.pngbin0 -> 1124 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-css-32~sel.pngbin0 -> 539 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-css-32~sel@2x.pngbin0 -> 1305 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-enum-16.pngbin0 -> 246 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-enum-16@2x.pngbin0 -> 466 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-enum-16~dark.pngbin0 -> 204 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-enum-16~dark@2x.pngbin0 -> 430 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-enum-16~dark~sel.pngbin0 -> 198 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-enum-16~dark~sel@2x.pngbin0 -> 401 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-enum-16~sel.pngbin0 -> 217 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-enum-16~sel@2x.pngbin0 -> 413 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-enum-32.pngbin0 -> 466 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-enum-32@2x.pngbin0 -> 821 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-enum-32~dark.pngbin0 -> 430 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-enum-32~dark@2x.pngbin0 -> 673 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-enum-32~dark~sel.pngbin0 -> 401 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-enum-32~dark~sel@2x.pngbin0 -> 640 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-enum-32~sel.pngbin0 -> 413 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-enum-32~sel@2x.pngbin0 -> 773 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-enumeration-32.pngbin887 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-enumeration-32@2x.pngbin1688 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-generic-16.pngbin321 -> 186 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-generic-16@2x.pngbin558 -> 295 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-generic-16~dark.pngbin0 -> 141 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-generic-16~dark@2x.pngbin0 -> 231 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-generic-16~dark~sel.pngbin0 -> 132 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-generic-16~dark~sel@2x.pngbin0 -> 221 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-generic-16~sel.pngbin0 -> 153 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-generic-16~sel@2x.pngbin0 -> 251 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-generic-32.pngbin558 -> 295 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-generic-32@2x.pngbin988 -> 557 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-generic-32~dark.pngbin0 -> 231 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-generic-32~dark@2x.pngbin0 -> 427 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-generic-32~dark~sel.pngbin0 -> 221 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-generic-32~dark~sel@2x.pngbin0 -> 414 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-generic-32~sel.pngbin0 -> 251 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-generic-32~sel@2x.pngbin0 -> 522 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-gtk-16.pngbin0 -> 249 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-gtk-16@2x.pngbin0 -> 364 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-gtk-16~dark.pngbin0 -> 219 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-gtk-16~dark@2x.pngbin0 -> 318 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-gtk-16~dark~sel.pngbin0 -> 200 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-gtk-16~dark~sel@2x.pngbin0 -> 291 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-gtk-16~sel.pngbin0 -> 206 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-gtk-16~sel@2x.pngbin0 -> 325 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-gtk-32.pngbin778 -> 364 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-gtk-32@2x.pngbin1357 -> 789 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-gtk-32~dark.pngbin0 -> 318 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-gtk-32~dark@2x.pngbin0 -> 673 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-gtk-32~dark~sel.pngbin0 -> 291 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-gtk-32~dark~sel@2x.pngbin0 -> 590 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-gtk-32~sel.pngbin0 -> 325 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-gtk-32~sel@2x.pngbin0 -> 706 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-header-16.pngbin474 -> 231 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-header-16@2x.pngbin1022 -> 552 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-header-16~dark.pngbin0 -> 176 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-header-16~dark@2x.pngbin0 -> 509 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-header-16~dark~sel.pngbin0 -> 173 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-header-16~dark~sel@2x.pngbin0 -> 431 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-header-16~sel.pngbin0 -> 203 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-header-16~sel@2x.pngbin0 -> 439 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-header-32.pngbin1022 -> 552 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-header-32@2x.pngbin2244 -> 1043 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-header-32~dark.pngbin0 -> 509 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-header-32~dark@2x.pngbin0 -> 989 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-header-32~dark~sel.pngbin0 -> 431 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-header-32~dark~sel@2x.pngbin0 -> 854 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-header-32~sel.pngbin0 -> 439 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-header-32~sel@2x.pngbin0 -> 902 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-image-16.pngbin0 -> 439 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-image-16@2x.pngbin0 -> 797 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-image-16~dark.pngbin0 -> 373 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-image-16~dark@2x.pngbin0 -> 714 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-image-16~dark~sel.pngbin0 -> 302 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-image-16~dark~sel@2x.pngbin0 -> 597 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-image-16~sel.pngbin0 -> 342 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-image-16~sel@2x.pngbin0 -> 671 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-image-32.pngbin0 -> 797 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-image-32@2x.pngbin0 -> 1946 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-image-32~dark.pngbin0 -> 714 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-image-32~dark@2x.pngbin0 -> 1726 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-image-32~dark~sel.pngbin0 -> 597 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-image-32~dark~sel@2x.pngbin0 -> 1413 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-image-32~sel.pngbin0 -> 671 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-image-32~sel@2x.pngbin0 -> 1614 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-information-16.pngbin0 -> 210 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-information-16@2x.pngbin0 -> 743 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-information-16~dark.pngbin0 -> 171 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-information-16~dark@2x.pngbin0 -> 653 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-information-16~dark~sel.pngbin0 -> 163 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-information-16~dark~sel@2x.pngbin0 -> 454 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-information-16~sel.pngbin0 -> 188 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-information-16~sel@2x.pngbin0 -> 529 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-information-32.pngbin0 -> 743 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-information-32@2x.pngbin0 -> 1561 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-information-32~dark.pngbin0 -> 653 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-information-32~dark@2x.pngbin0 -> 1338 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-information-32~dark~sel.pngbin0 -> 454 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-information-32~dark~sel@2x.pngbin0 -> 1088 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-information-32~sel.pngbin0 -> 529 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-information-32~sel@2x.pngbin0 -> 1129 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-interface-16.pngbin0 -> 238 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-interface-16@2x.pngbin0 -> 429 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-interface-16~dark.pngbin0 -> 199 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-interface-16~dark@2x.pngbin0 -> 401 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-interface-16~dark~sel.pngbin0 -> 191 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-interface-16~dark~sel@2x.pngbin0 -> 395 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-interface-16~sel.pngbin0 -> 206 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-interface-16~sel@2x.pngbin0 -> 390 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-interface-32.pngbin804 -> 429 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-interface-32@2x.pngbin1632 -> 778 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-interface-32~dark.pngbin0 -> 401 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-interface-32~dark@2x.pngbin0 -> 627 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-interface-32~dark~sel.pngbin0 -> 395 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-interface-32~dark~sel@2x.pngbin0 -> 594 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-interface-32~sel.pngbin0 -> 390 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-interface-32~sel@2x.pngbin0 -> 723 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-resource-16.pngbin361 -> 321 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-resource-16@2x.pngbin621 -> 685 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-resource-16~dark.pngbin0 -> 299 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-resource-16~dark@2x.pngbin0 -> 646 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-resource-16~dark~sel.pngbin0 -> 241 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-resource-16~dark~sel@2x.pngbin0 -> 528 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-resource-16~sel.pngbin0 -> 248 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-resource-16~sel@2x.pngbin0 -> 528 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-resource-32.pngbin621 -> 685 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-resource-32@2x.pngbin1053 -> 1251 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-resource-32~dark.pngbin0 -> 646 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-resource-32~dark@2x.pngbin0 -> 1222 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-resource-32~dark~sel.pngbin0 -> 528 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-resource-32~dark~sel@2x.pngbin0 -> 1061 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-resource-32~sel.pngbin0 -> 528 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-resource-32~sel@2x.pngbin0 -> 1147 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-script-16.pngbin478 -> 401 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-script-16@2x.pngbin1014 -> 769 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-script-16~dark.pngbin0 -> 354 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-script-16~dark@2x.pngbin0 -> 654 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-script-16~dark~sel.pngbin0 -> 304 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-script-16~dark~sel@2x.pngbin0 -> 544 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-script-16~sel.pngbin0 -> 311 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-script-16~sel@2x.pngbin0 -> 605 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-script-32.pngbin1014 -> 769 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-script-32@2x.pngbin2249 -> 1521 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-script-32~dark.pngbin0 -> 654 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-script-32~dark@2x.pngbin0 -> 1323 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-script-32~dark~sel.pngbin0 -> 544 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-script-32~dark~sel@2x.pngbin0 -> 1109 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-script-32~sel.pngbin0 -> 605 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-script-32~sel@2x.pngbin0 -> 1269 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-source-16.pngbin482 -> 295 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-source-16@2x.pngbin1033 -> 614 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-source-16~dark.pngbin0 -> 280 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-source-16~dark@2x.pngbin0 -> 563 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-source-16~dark~sel.pngbin0 -> 232 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-source-16~dark~sel@2x.pngbin0 -> 447 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-source-16~sel.pngbin0 -> 246 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-source-16~sel@2x.pngbin0 -> 478 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-source-32.pngbin1033 -> 614 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-source-32@2x.pngbin1955 -> 1313 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-source-32~dark.pngbin0 -> 563 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-source-32~dark@2x.pngbin0 -> 1140 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-source-32~dark~sel.pngbin0 -> 447 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-source-32~dark~sel@2x.pngbin0 -> 964 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-source-32~sel.pngbin0 -> 478 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-source-32~sel@2x.pngbin0 -> 1122 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-struct-16.pngbin0 -> 279 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-struct-16@2x.pngbin0 -> 544 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-struct-16~dark.pngbin0 -> 230 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-struct-16~dark@2x.pngbin0 -> 486 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-struct-16~dark~sel.pngbin0 -> 217 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-struct-16~dark~sel@2x.pngbin0 -> 465 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-struct-16~sel.pngbin0 -> 235 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-struct-16~sel@2x.pngbin0 -> 468 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-struct-32.pngbin915 -> 544 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-struct-32@2x.pngbin1793 -> 1195 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-struct-32~dark.pngbin0 -> 486 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-struct-32~dark@2x.pngbin0 -> 1048 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-struct-32~dark~sel.pngbin0 -> 465 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-struct-32~dark~sel@2x.pngbin0 -> 895 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-struct-32~sel.pngbin0 -> 468 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-struct-32~sel@2x.pngbin0 -> 1042 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-text-16.pngbin386 -> 217 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-text-16@2x.pngbin927 -> 456 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-text-16~dark.pngbin0 -> 169 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-text-16~dark@2x.pngbin0 -> 391 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-text-16~dark~sel.pngbin0 -> 164 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-text-16~dark~sel@2x.pngbin0 -> 346 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-text-16~sel.pngbin0 -> 187 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-text-16~sel@2x.pngbin0 -> 379 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-text-32.pngbin927 -> 456 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-text-32@2x.pngbin1752 -> 938 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-text-32~dark.pngbin0 -> 391 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-text-32~dark@2x.pngbin0 -> 811 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-text-32~dark~sel.pngbin0 -> 346 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-text-32~dark~sel@2x.pngbin0 -> 721 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-text-32~sel.pngbin0 -> 379 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-text-32~sel@2x.pngbin0 -> 845 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-unit-test-16.pngbin0 -> 344 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-unit-test-16@2x.pngbin0 -> 596 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~dark.pngbin0 -> 289 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~dark@2x.pngbin0 -> 550 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~dark~sel.pngbin0 -> 258 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~dark~sel@2x.pngbin0 -> 451 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~sel.pngbin0 -> 273 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~sel@2x.pngbin0 -> 479 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-unit-test-32.pngbin845 -> 596 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-unit-test-32@2x.pngbin1543 -> 1164 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~dark.pngbin0 -> 550 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~dark@2x.pngbin0 -> 1034 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~dark~sel.pngbin0 -> 451 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~dark~sel@2x.pngbin0 -> 917 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~sel.pngbin0 -> 479 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~sel@2x.pngbin0 -> 1045 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-web-16.pngbin494 -> 385 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-web-16@2x.pngbin995 -> 1076 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-web-16~dark.pngbin0 -> 371 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-web-16~dark@2x.pngbin0 -> 920 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-web-16~dark~sel.pngbin0 -> 276 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-web-16~dark~sel@2x.pngbin0 -> 746 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-web-16~sel.pngbin0 -> 283 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-web-16~sel@2x.pngbin0 -> 782 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-web-32.pngbin995 -> 1076 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-web-32@2x.pngbin2055 -> 2603 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-web-32~dark.pngbin0 -> 920 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-web-32~dark@2x.pngbin0 -> 2314 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-web-32~dark~sel.pngbin0 -> 746 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-web-32~dark~sel@2x.pngbin0 -> 1791 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-web-32~sel.pngbin0 -> 782 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-web-32~sel@2x.pngbin0 -> 1874 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-xml-16.pngbin422 -> 260 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-xml-16@2x.pngbin917 -> 492 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-xml-16~dark.pngbin0 -> 212 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-xml-16~dark@2x.pngbin0 -> 450 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-xml-16~dark~sel.pngbin0 -> 207 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-xml-16~dark~sel@2x.pngbin0 -> 403 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-xml-16~sel.pngbin0 -> 224 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-xml-16~sel@2x.pngbin0 -> 453 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-xml-32.pngbin917 -> 492 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-xml-32@2x.pngbin1787 -> 810 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-xml-32~dark.pngbin0 -> 450 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-xml-32~dark@2x.pngbin0 -> 789 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-xml-32~dark~sel.pngbin0 -> 403 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-xml-32~dark~sel@2x.pngbin0 -> 790 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-xml-32~sel.pngbin0 -> 453 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/file-xml-32~sel@2x.pngbin0 -> 894 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-16.pngbin826 -> 500 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-16@2x.pngbin2045 -> 898 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-16~dark.pngbin0 -> 460 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-16~dark@2x.pngbin0 -> 848 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-16~dark~sel.pngbin0 -> 342 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-16~dark~sel@2x.pngbin0 -> 607 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-16~sel.pngbin0 -> 342 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-16~sel@2x.pngbin0 -> 607 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-and-replace-16.pngbin869 -> 509 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-and-replace-16@2x.pngbin2184 -> 944 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~dark.pngbin0 -> 469 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~dark@2x.pngbin0 -> 902 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~dark~sel.pngbin0 -> 348 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~dark~sel@2x.pngbin0 -> 626 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~sel.pngbin0 -> 348 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~sel@2x.pngbin0 -> 626 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-in-files-16.pngbin671 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-next-16.pngbin0 -> 512 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-next-16@2x.pngbin0 -> 935 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-next-16~dark.pngbin0 -> 470 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-next-16~dark@2x.pngbin0 -> 887 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-prev-16.pngbin0 -> 514 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-prev-16@2x.pngbin0 -> 942 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-prev-16~dark.pngbin0 -> 477 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/find-prev-16~dark@2x.pngbin0 -> 888 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-assets-16.pngbin0 -> 246 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-assets-16@2x.pngbin0 -> 345 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-assets-16~dark.pngbin0 -> 254 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-assets-16~dark@2x.pngbin0 -> 356 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-assets-16~dark~sel.pngbin0 -> 194 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-assets-16~dark~sel@2x.pngbin0 -> 293 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-assets-16~sel.pngbin0 -> 194 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-assets-16~sel@2x.pngbin0 -> 293 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-component-16.pngbin0 -> 304 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-component-16@2x.pngbin0 -> 584 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-component-16~dark.pngbin0 -> 297 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-component-16~dark@2x.pngbin0 -> 564 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-component-16~dark~sel.pngbin0 -> 218 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-component-16~dark~sel@2x.pngbin0 -> 447 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-component-16~sel.pngbin0 -> 218 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-component-16~sel@2x.pngbin0 -> 447 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-component-mac-16.pngbin684 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-component-mac-16@2x.pngbin1595 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-component-win-16.pngbin794 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-component-win-16@2x.pngbin2333 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-generic-16.pngbin0 -> 191 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-generic-16@2x.pngbin0 -> 267 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-generic-16~dark.pngbin0 -> 188 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-generic-16~dark@2x.pngbin0 -> 265 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-generic-16~dark~sel.pngbin0 -> 150 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-generic-16~dark~sel@2x.pngbin0 -> 213 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-generic-16~sel.pngbin0 -> 150 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-generic-16~sel@2x.pngbin0 -> 213 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-generic-mac-16.pngbin351 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-generic-mac-16@2x.pngbin771 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-generic-win-16.pngbin652 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-generic-win-16@2x.pngbin1842 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-new-16.pngbin669 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-resource-16.pngbin0 -> 264 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-resource-16@2x.pngbin0 -> 537 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-resource-16~dark.pngbin0 -> 281 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-resource-16~dark@2x.pngbin0 -> 550 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-resource-16~dark~sel.pngbin0 -> 216 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-resource-16~dark~sel@2x.pngbin0 -> 405 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-resource-16~sel.pngbin0 -> 216 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-resource-16~sel@2x.pngbin0 -> 405 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-solution-16.pngbin0 -> 241 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-solution-16@2x.pngbin0 -> 332 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-solution-16~dark.pngbin0 -> 245 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-solution-16~dark@2x.pngbin0 -> 347 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-solution-16~dark~sel.pngbin0 -> 195 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-solution-16~dark~sel@2x.pngbin0 -> 270 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-solution-16~sel.pngbin0 -> 195 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-solution-16~sel@2x.pngbin0 -> 272 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-special-mac-16.pngbin578 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-special-mac-16@2x.pngbin1191 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-special-win-16.pngbin728 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-special-win-16@2x.pngbin1995 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-web-reference-mac-16.pngbin671 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-web-reference-mac-16@2x.pngbin1519 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-web-reference-win-16.pngbin785 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/folder-web-reference-win-16@2x.pngbin2248 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/fullscreen-16.pngbin0 -> 178 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/fullscreen-16@2x.pngbin0 -> 308 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/fullscreen-16~dark.pngbin0 -> 178 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/fullscreen-16~dark@2x.pngbin0 -> 308 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/fullscreen-16~dark~sel.pngbin0 -> 175 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/fullscreen-16~dark~sel@2x.pngbin0 -> 305 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/fullscreen-16~sel.pngbin0 -> 175 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/fullscreen-16~sel@2x.pngbin0 -> 305 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-back-16.pngbin435 -> 107 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-back-16@2x.pngbin833 -> 208 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-back-16~dark.pngbin0 -> 107 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-back-16~dark@2x.pngbin0 -> 208 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-back-16~dark~disabled.pngbin0 -> 107 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-back-16~dark~disabled@2x.pngbin0 -> 200 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-back-16~disabled.pngbin0 -> 107 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-back-16~disabled@2x.pngbin0 -> 200 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-down-16.pngbin466 -> 131 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-down-16@2x.pngbin867 -> 215 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-down-16~dark.pngbin0 -> 131 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-down-16~dark@2x.pngbin0 -> 215 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-down-16~dark~disabled.pngbin0 -> 131 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-down-16~dark~disabled@2x.pngbin0 -> 207 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-down-16~disabled.pngbin0 -> 130 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-down-16~disabled@2x.pngbin0 -> 207 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-forward-16.pngbin441 -> 107 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-forward-16@2x.pngbin824 -> 201 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-forward-16~dark.pngbin0 -> 107 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-forward-16~dark@2x.pngbin0 -> 201 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-forward-16~dark~disabled.pngbin0 -> 107 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-forward-16~dark~disabled@2x.pngbin0 -> 194 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-forward-16~disabled.pngbin0 -> 107 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-forward-16~disabled@2x.pngbin0 -> 194 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-to-line-16.pngbin0 -> 222 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-to-line-16@2x.pngbin0 -> 392 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-to-line-16~dark.pngbin0 -> 219 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-to-line-16~dark@2x.pngbin0 -> 377 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-to-matching-brace-16.pngbin0 -> 225 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-to-matching-brace-16@2x.pngbin0 -> 548 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-to-matching-brace-16~dark.pngbin0 -> 226 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-to-matching-brace-16~dark@2x.pngbin0 -> 540 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-up-16.pngbin452 -> 125 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-up-16@2x.pngbin905 -> 218 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-up-16~dark.pngbin0 -> 125 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-up-16~dark@2x.pngbin0 -> 218 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-up-16~dark~disabled.pngbin0 -> 125 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-up-16~dark~disabled@2x.pngbin0 -> 211 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-up-16~disabled.pngbin0 -> 124 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/go-up-16~disabled@2x.pngbin0 -> 211 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/goto-next-bookmark-16.pngbin578 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/goto-prev-bookmark-16.pngbin601 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/group-by-category-16.pngbin524 -> 142 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/group-by-category-16@2x.pngbin1038 -> 221 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/group-by-category-16~dark.pngbin0 -> 142 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/group-by-category-16~dark@2x.pngbin0 -> 219 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/help-16.pngbin0 -> 473 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/help-16@2x.pngbin0 -> 957 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/help-16~dark.pngbin0 -> 473 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/help-16~dark@2x.pngbin0 -> 985 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/help-16~dark~sel.pngbin0 -> 307 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/help-16~dark~sel@2x.pngbin0 -> 661 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/help-16~sel.pngbin0 -> 307 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/help-16~sel@2x.pngbin0 -> 661 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/home-16.pngbin494 -> 167 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/home-16@2x.pngbin1140 -> 220 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/home-16~dark.pngbin0 -> 167 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/home-16~dark@2x.pngbin0 -> 220 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/home-16~dark~sel.pngbin0 -> 165 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/home-16~dark~sel@2x.pngbin0 -> 218 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/home-16~sel.pngbin0 -> 165 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/home-16~sel@2x.pngbin0 -> 218 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/indent-16.pngbin0 -> 157 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/indent-16@2x.pngbin0 -> 262 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/indent-16~dark.pngbin0 -> 157 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/indent-16~dark@2x.pngbin0 -> 262 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-16.pngbin793 -> 346 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-16@2x.pngbin1870 -> 618 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-16~dark.pngbin0 -> 354 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-16~dark@2x.pngbin0 -> 623 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-16~dark~sel.pngbin0 -> 261 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-16~dark~sel@2x.pngbin0 -> 460 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-16~sel.pngbin0 -> 261 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-16~sel@2x.pngbin0 -> 460 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-24.pngbin1219 -> 505 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-24@2x.pngbin2948 -> 1024 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-24~dark.pngbin0 -> 505 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-24~dark@2x.pngbin0 -> 1020 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-24~dark~sel.pngbin0 -> 396 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-24~dark~sel@2x.pngbin0 -> 734 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-24~sel.pngbin0 -> 396 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-24~sel@2x.pngbin0 -> 734 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-32.pngbin1870 -> 618 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-32@2x.pngbin4322 -> 1125 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-32~dark.pngbin0 -> 623 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-32~dark@2x.pngbin0 -> 1119 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-32~dark~sel.pngbin0 -> 460 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-32~dark~sel@2x.pngbin0 -> 986 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-32~sel.pngbin0 -> 460 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-32~sel@2x.pngbin0 -> 986 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-48.pngbin2948 -> 1024 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-48@2x.pngbin6933 -> 2166 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-48~dark.pngbin0 -> 1020 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-48~dark@2x.pngbin0 -> 2166 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-48~dark~sel.pngbin0 -> 734 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-48~dark~sel@2x.pngbin0 -> 1870 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-48~sel.pngbin0 -> 734 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/information-48~sel@2x.pngbin0 -> 1870 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/invalid-reference-overlay-16.pngbin283 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/invalid-reference-overlay-16@2x.pngbin658 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/jump-to-16.pngbin453 -> 168 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/jump-to-16@2x.pngbin1100 -> 312 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/jump-to-16~dark.pngbin0 -> 168 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/jump-to-16~dark@2x.pngbin0 -> 310 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/jump-to-16~dark~disabled.pngbin0 -> 163 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/jump-to-16~dark~disabled@2x.pngbin0 -> 301 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/jump-to-16~disabled.pngbin0 -> 164 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/jump-to-16~disabled@2x.pngbin0 -> 302 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/link-overlay-16.pngbin397 -> 334 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/link-overlay-16@2x.pngbin651 -> 469 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/link-overlay-16~dark.pngbin0 -> 382 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/link-overlay-16~dark@2x.pngbin0 -> 573 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/link-overlay-16~dark~sel.pngbin0 -> 351 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/link-overlay-16~dark~sel@2x.pngbin0 -> 504 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/link-overlay-16~sel.pngbin0 -> 351 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/link-overlay-16~sel@2x.pngbin0 -> 504 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/live-16.pngbin0 -> 360 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/live-16@2x.pngbin0 -> 652 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/live-16~dark.pngbin0 -> 357 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/live-16~dark@2x.pngbin0 -> 651 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/live-16~dark~sel.pngbin0 -> 292 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/live-16~dark~sel@2x.pngbin0 -> 532 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/live-16~sel.pngbin0 -> 292 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/live-16~sel@2x.pngbin0 -> 532 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-building-1-16.pngbin251 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-building-1-16@2x.pngbin363 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-building-2-16.pngbin313 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-building-2-16@2x.pngbin505 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-building-3-16.pngbin402 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-building-3-16@2x.pngbin709 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-building-4-16.pngbin372 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-building-4-16@2x.pngbin572 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-building-5-16.pngbin245 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-building-5-16@2x.pngbin412 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-1-16.pngbin380 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-1-16@2x.pngbin785 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-2-16.pngbin396 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-2-16@2x.pngbin758 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-3-16.pngbin463 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-3-16@2x.pngbin1043 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-4-16.pngbin445 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-4-16@2x.pngbin1013 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-5-16.pngbin426 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-5-16@2x.pngbin896 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-6-16.pngbin399 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-6-16@2x.pngbin845 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-error-16.pngbin394 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-error-16@2x.pngbin742 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-error-count-16.pngbin347 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-error-count-16@2x.pngbin670 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-opening-1-16.pngbin333 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-opening-1-16@2x.pngbin628 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-opening-2-16.pngbin405 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-opening-2-16@2x.pngbin758 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-opening-3-16.pngbin419 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-opening-3-16@2x.pngbin796 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-opening-4-16.pngbin460 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-opening-4-16@2x.pngbin896 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-opening-5-16.pngbin471 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-opening-5-16@2x.pngbin833 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-opening-6-16.pngbin471 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-opening-6-16@2x.pngbin741 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-parsing-16.pngbin209 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-parsing-16@2x.pngbin471 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-1-16.pngbin175 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-1-16@2x.pngbin229 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-2-16.pngbin208 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-2-16@2x.pngbin256 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-3-16.pngbin211 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-3-16@2x.pngbin281 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-4-16.pngbin216 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-4-16@2x.pngbin277 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-5-16.pngbin184 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-5-16@2x.pngbin228 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-6-16.pngbin196 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-6-16@2x.pngbin242 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-1-16.pngbin192 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-1-16@2x.pngbin248 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-2-16.pngbin206 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-2-16@2x.pngbin270 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-3-16.pngbin230 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-3-16@2x.pngbin289 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-4-16.pngbin198 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-4-16@2x.pngbin247 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-5-16.pngbin208 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-5-16@2x.pngbin256 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-6-16.pngbin190 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-6-16@2x.pngbin234 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-ready-16.pngbin525 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-ready-16@2x.pngbin1331 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-searching-1-16.pngbin356 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-searching-1-16@2x.pngbin797 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-searching-2-16.pngbin358 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-searching-2-16@2x.pngbin795 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-searching-3-16.pngbin357 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-searching-3-16@2x.pngbin793 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-searching-4-16.pngbin357 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-searching-4-16@2x.pngbin797 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-success-16.pngbin381 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-success-16@2x.pngbin682 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-1-16.pngbin401 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-1-16@2x.pngbin831 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-2-16.pngbin427 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-2-16@2x.pngbin888 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-3-16.pngbin422 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-3-16@2x.pngbin882 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-4-16.pngbin437 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-4-16@2x.pngbin916 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-5-16.pngbin416 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-5-16@2x.pngbin846 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-6-16.pngbin423 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-6-16@2x.pngbin872 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-updates-paused-16.pngbin385 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-updates-paused-16@2x.pngbin788 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-updates-ready-16.pngbin401 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-updates-ready-16@2x.pngbin831 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-1-16.pngbin302 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-1-16@2x.pngbin575 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-2-16.pngbin407 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-2-16@2x.pngbin863 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-3-16.pngbin441 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-3-16@2x.pngbin839 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-4-16.pngbin435 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-4-16@2x.pngbin829 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-5-16.pngbin402 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-5-16@2x.pngbin864 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-warning-16.pngbin325 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-warning-16@2x.pngbin818 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-warning-count-16.pngbin317 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/mac/status-warning-count-16@2x.pngbin685 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/media-play-16.pngbin642 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/media-play-16@2x.pngbin1319 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/missing-image-16.pngbin453 -> 174 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/missing-image-16@2x.pngbin1379 -> 272 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/missing-image-32.pngbin0 -> 272 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/missing-image-32@2x.pngbin0 -> 554 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/missing-image-48.pngbin0 -> 421 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/missing-image-48@2x.pngbin0 -> 816 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/navigate-next-16.pngbin848 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/navigate-previous-16.pngbin862 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-folder-16.pngbin0 -> 184 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-folder-16@2x.pngbin0 -> 279 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-folder-16~dark.pngbin0 -> 173 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-folder-16~dark@2x.pngbin0 -> 248 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-namespace-16.pngbin0 -> 294 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-namespace-16@2x.pngbin0 -> 470 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-namespace-16~dark.pngbin0 -> 291 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-namespace-16~dark@2x.pngbin0 -> 470 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-project-16.pngbin0 -> 169 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-project-16@2x.pngbin0 -> 242 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-project-16~dark.pngbin0 -> 162 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-project-16~dark@2x.pngbin0 -> 239 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-solution-16.pngbin0 -> 178 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-solution-16@2x.pngbin0 -> 264 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-solution-16~dark.pngbin0 -> 169 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-solution-16~dark@2x.pngbin0 -> 263 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-solution-folder-16.pngbin0 -> 228 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-solution-folder-16@2x.pngbin0 -> 344 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-solution-folder-16~dark.pngbin0 -> 219 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-solution-folder-16~dark@2x.pngbin0 -> 316 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-workspace-16.pngbin0 -> 179 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-workspace-16@2x.pngbin0 -> 277 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-workspace-16~dark.pngbin0 -> 170 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/new-workspace-16~dark@2x.pngbin0 -> 275 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/open-16.pngbin637 -> 235 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/open-16@2x.pngbin0 -> 360 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/open-16~dark.pngbin0 -> 234 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/open-16~dark@2x.pngbin0 -> 321 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-16.pngbin448 -> 383 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-16@2x.pngbin984 -> 855 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-16~dark.pngbin0 -> 383 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-16~dark@2x.pngbin0 -> 842 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-16~dark~sel.pngbin0 -> 281 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-16~dark~sel@2x.pngbin0 -> 576 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-16~sel.pngbin0 -> 281 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-16~sel@2x.pngbin0 -> 576 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-24.pngbin701 -> 519 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-24@2x.pngbin1390 -> 1039 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-24~dark.pngbin0 -> 505 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-24~dark@2x.pngbin0 -> 996 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-24~dark~sel.pngbin0 -> 384 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-24~dark~sel@2x.pngbin0 -> 726 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-24~sel.pngbin0 -> 384 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-24~sel@2x.pngbin0 -> 726 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-32.pngbin984 -> 855 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-32@2x.pngbin1993 -> 1741 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-32~dark.pngbin0 -> 842 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-32~dark@2x.pngbin0 -> 1754 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-32~dark~sel.pngbin0 -> 576 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-32~dark~sel@2x.pngbin0 -> 1198 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-32~sel.pngbin0 -> 576 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-32~sel@2x.pngbin0 -> 1198 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-48.pngbin1390 -> 1039 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-48@2x.pngbin3184 -> 2266 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-48~dark.pngbin0 -> 996 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-48~dark@2x.pngbin0 -> 2227 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-48~dark~sel.pngbin0 -> 726 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-48~dark~sel@2x.pngbin0 -> 1592 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-48~sel.pngbin0 -> 726 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-48~sel@2x.pngbin0 -> 1592 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-source-16.pngbin657 -> 265 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-source-16@2x.pngbin1254 -> 607 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-source-16~dark.pngbin0 -> 260 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-source-16~dark@2x.pngbin0 -> 630 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-source-16~dark~sel.pngbin0 -> 240 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-source-16~dark~sel@2x.pngbin0 -> 496 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-source-16~sel.pngbin0 -> 240 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/package-source-16~sel@2x.pngbin0 -> 496 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-application-output-16.pngbin550 -> 248 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-application-output-16@2x.pngbin1162 -> 283 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~dark.pngbin0 -> 242 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~dark@2x.pngbin0 -> 312 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~dark~sel.pngbin0 -> 218 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~dark~sel@2x.pngbin0 -> 260 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~sel.pngbin0 -> 210 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~sel@2x.pngbin0 -> 273 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-classes-16.pngbin0 -> 259 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-classes-16@2x.pngbin0 -> 600 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-classes-16~dark.pngbin0 -> 261 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-classes-16~dark@2x.pngbin0 -> 596 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-classes-16~dark~sel.pngbin0 -> 256 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-classes-16~dark~sel@2x.pngbin0 -> 514 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-classes-16~sel.pngbin0 -> 256 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-classes-16~sel@2x.pngbin0 -> 514 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-16.pngbin406 -> 377 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-16@2x.pngbin821 -> 755 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~dark.pngbin0 -> 366 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~dark@2x.pngbin0 -> 691 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~dark~sel.pngbin0 -> 265 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~dark~sel@2x.pngbin0 -> 456 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~sel.pngbin0 -> 265 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~sel@2x.pngbin0 -> 456 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16.pngbin513 -> 392 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16@2x.pngbin955 -> 722 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark.pngbin0 -> 381 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark@2x.pngbin0 -> 703 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark~disabled.pngbin0 -> 366 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark~disabled@2x.pngbin0 -> 691 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark~sel.pngbin0 -> 265 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark~sel@2x.pngbin0 -> 456 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~disabled.pngbin0 -> 377 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~disabled@2x.pngbin0 -> 755 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~sel.pngbin0 -> 265 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~sel@2x.pngbin0 -> 456 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16.pngbin538 -> 346 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16@2x.pngbin1060 -> 543 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark.pngbin0 -> 348 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark@2x.pngbin0 -> 547 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark~disabled.pngbin0 -> 348 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark~disabled@2x.pngbin0 -> 547 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark~sel.pngbin0 -> 255 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark~sel@2x.pngbin0 -> 421 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~disabled.pngbin0 -> 346 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~disabled@2x.pngbin0 -> 543 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~sel.pngbin0 -> 255 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~sel@2x.pngbin0 -> 421 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-generic-16.pngbin0 -> 174 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-generic-16@2x.pngbin0 -> 262 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-generic-16~dark.pngbin0 -> 168 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-generic-16~dark@2x.pngbin0 -> 259 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-generic-16~dark~sel.pngbin0 -> 159 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-generic-16~dark~sel@2x.pngbin0 -> 223 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-generic-16~sel.pngbin0 -> 159 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-generic-16~sel@2x.pngbin0 -> 223 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-generic-pad-16.pngbin480 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-generic-pad-16@2x.pngbin990 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-help-16.pngbin629 -> 422 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-help-16@2x.pngbin1479 -> 884 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-help-16~dark.pngbin0 -> 410 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-help-16~dark@2x.pngbin0 -> 839 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-help-16~dark~sel.pngbin0 -> 323 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-help-16~dark~sel@2x.pngbin0 -> 608 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-help-16~sel.pngbin0 -> 323 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-help-16~sel@2x.pngbin0 -> 608 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-immediate-16.pngbin512 -> 248 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-immediate-16@2x.pngbin1117 -> 283 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~dark.pngbin0 -> 242 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~dark@2x.pngbin0 -> 312 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~dark~sel.pngbin0 -> 218 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~dark~sel@2x.pngbin0 -> 260 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~sel.pngbin0 -> 210 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~sel@2x.pngbin0 -> 273 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-search-16.pngbin0 -> 368 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-search-16@2x.pngbin0 -> 759 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-search-16~dark.pngbin0 -> 344 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-search-16~dark@2x.pngbin0 -> 740 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-search-16~dark~sel.pngbin0 -> 261 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-search-16~dark~sel@2x.pngbin0 -> 507 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-search-16~sel.pngbin0 -> 261 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-search-16~sel@2x.pngbin0 -> 507 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-search-results-16.pngbin826 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-search-results-16@2x.pngbin2045 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-solution-16.pngbin0 -> 178 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-solution-16@2x.pngbin0 -> 267 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-solution-16~dark.pngbin0 -> 169 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-solution-16~dark@2x.pngbin0 -> 260 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-solution-16~dark~sel.pngbin0 -> 157 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-solution-16~dark~sel@2x.pngbin0 -> 235 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-solution-16~sel.pngbin0 -> 157 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-solution-16~sel@2x.pngbin0 -> 235 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-task-list-16.pngbin436 -> 356 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-task-list-16@2x.pngbin847 -> 686 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~dark.pngbin0 -> 346 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~dark@2x.pngbin0 -> 658 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~dark~sel.pngbin0 -> 236 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~dark~sel@2x.pngbin0 -> 434 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~sel.pngbin0 -> 236 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~sel@2x.pngbin0 -> 434 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/parser-16.pngbin592 -> 543 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/parser-16@2x.pngbin1253 -> 1237 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/parser-16~dark.pngbin0 -> 493 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/parser-16~dark@2x.pngbin0 -> 1220 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/parser-16~dark~sel.pngbin0 -> 344 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/parser-16~dark~sel@2x.pngbin0 -> 698 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/parser-16~sel.pngbin0 -> 344 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/parser-16~sel@2x.pngbin0 -> 698 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/paste-16.pngbin0 -> 198 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/paste-16@2x.pngbin0 -> 377 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/paste-16~dark.pngbin0 -> 204 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/paste-16~dark@2x.pngbin0 -> 369 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-down-16.pngbin790 -> 476 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-down-16@2x.pngbin1782 -> 954 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark.pngbin0 -> 455 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark@2x.pngbin0 -> 931 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark~disabled.pngbin0 -> 439 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark~disabled@2x.pngbin0 -> 855 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark~sel.pngbin0 -> 293 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark~sel@2x.pngbin0 -> 599 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-down-16~disabled.pngbin0 -> 459 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-down-16~disabled@2x.pngbin0 -> 913 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-down-16~sel.pngbin0 -> 293 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-down-16~sel@2x.pngbin0 -> 599 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-up-16.pngbin708 -> 357 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-up-16@2x.pngbin1673 -> 764 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark.pngbin0 -> 355 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark@2x.pngbin0 -> 756 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark~disabled.pngbin0 -> 335 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark~disabled@2x.pngbin0 -> 696 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark~sel.pngbin0 -> 264 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark~sel@2x.pngbin0 -> 530 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-up-16~disabled.pngbin0 -> 328 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-up-16~disabled@2x.pngbin0 -> 739 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-up-16~sel.pngbin0 -> 264 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/pin-up-16~sel@2x.pngbin0 -> 530 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-android-16.pngbin893 -> 378 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-android-16@2x.pngbin2184 -> 575 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-android-16~dark.pngbin0 -> 379 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-android-16~dark@2x.pngbin0 -> 551 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-android-16~dark~sel.pngbin0 -> 302 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-android-16~dark~sel@2x.pngbin0 -> 465 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-android-16~sel.pngbin0 -> 302 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-android-16~sel@2x.pngbin0 -> 465 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-cross-platform-16.pngbin953 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-cross-platform-16@2x.pngbin2419 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16.pngbin0 -> 477 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16@2x.pngbin0 -> 945 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~dark.pngbin0 -> 466 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~dark@2x.pngbin0 -> 903 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~dark~sel.pngbin0 -> 347 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~dark~sel@2x.pngbin0 -> 656 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~sel.pngbin0 -> 347 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~sel@2x.pngbin0 -> 656 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-ios-16.pngbin917 -> 162 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-ios-16@2x.pngbin2222 -> 245 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-ios-16~dark.pngbin0 -> 177 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-ios-16~dark@2x.pngbin0 -> 265 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-ios-16~dark~sel.pngbin0 -> 158 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-ios-16~dark~sel@2x.pngbin0 -> 230 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-ios-16~sel.pngbin0 -> 141 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-ios-16~sel@2x.pngbin0 -> 212 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-mac-16.pngbin903 -> 438 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-mac-16@2x.pngbin2202 -> 833 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-mac-16~dark.pngbin0 -> 429 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-mac-16~dark@2x.pngbin0 -> 831 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-mac-16~dark~sel.pngbin0 -> 312 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-mac-16~dark~sel@2x.pngbin0 -> 517 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-mac-16~sel.pngbin0 -> 312 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-mac-16~sel@2x.pngbin0 -> 517 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-other-16.pngbin913 -> 508 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-other-16@2x.pngbin2194 -> 987 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-other-16~dark.pngbin0 -> 433 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-other-16~dark@2x.pngbin0 -> 937 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-other-16~dark~sel.pngbin0 -> 295 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-other-16~dark~sel@2x.pngbin0 -> 577 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-other-16~sel.pngbin0 -> 295 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-other-16~sel@2x.pngbin0 -> 577 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-tvos-16.pngbin0 -> 319 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-tvos-16@2x.pngbin0 -> 546 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~dark.pngbin0 -> 314 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~dark@2x.pngbin0 -> 530 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~dark~sel.pngbin0 -> 240 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~dark~sel@2x.pngbin0 -> 432 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~sel.pngbin0 -> 240 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~sel@2x.pngbin0 -> 432 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-watchos-16.pngbin0 -> 404 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-watchos-16@2x.pngbin0 -> 941 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~dark.pngbin0 -> 387 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~dark@2x.pngbin0 -> 900 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~dark~sel.pngbin0 -> 292 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~dark~sel@2x.pngbin0 -> 604 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~sel.pngbin0 -> 287 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~sel@2x.pngbin0 -> 559 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/plugin-menu-16.pngbin0 -> 320 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/plugin-menu-16@2x.pngbin0 -> 526 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/plugin-menu-16~dark.pngbin0 -> 318 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/plugin-menu-16~dark@2x.pngbin0 -> 500 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/popup-close-16.pngbin229 -> 137 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/popup-close-16@2x.pngbin508 -> 234 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/popup-close-16~dark.pngbin0 -> 138 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/popup-close-16~dark@2x.pngbin0 -> 235 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/popup-close-hover-16.pngbin566 -> 137 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/popup-close-hover-16@2x.pngbin1645 -> 230 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/popup-close-hover-16~dark.pngbin0 -> 138 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/popup-close-hover-16~dark@2x.pngbin0 -> 230 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preferences-16.pngbin654 -> 177 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preferences-16@2x.pngbin1446 -> 425 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preferences-16~dark.pngbin0 -> 177 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preferences-16~dark@2x.pngbin0 -> 432 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16.pngbin609 -> 515 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16@2x.pngbin1626 -> 1066 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~dark.pngbin0 -> 465 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~dark@2x.pngbin0 -> 883 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~dark~sel.pngbin0 -> 336 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~dark~sel@2x.pngbin0 -> 658 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~sel.pngbin0 -> 361 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~sel@2x.pngbin0 -> 767 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-build-16.pngbin471 -> 266 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-build-16@2x.pngbin1228 -> 522 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-build-16~dark.pngbin0 -> 260 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-build-16~dark@2x.pngbin0 -> 532 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-build-16~dark~sel.pngbin0 -> 188 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-build-16~dark~sel@2x.pngbin0 -> 356 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-build-16~sel.pngbin0 -> 188 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-build-16~sel@2x.pngbin0 -> 356 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16.pngbin408 -> 189 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16@2x.pngbin768 -> 294 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~dark.pngbin0 -> 189 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~dark@2x.pngbin0 -> 293 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~dark~sel.pngbin0 -> 185 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~dark~sel@2x.pngbin0 -> 274 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~sel.pngbin0 -> 185 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~sel@2x.pngbin0 -> 274 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16.pngbin305 -> 175 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16@2x.pngbin574 -> 302 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~dark.pngbin0 -> 136 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~dark@2x.pngbin0 -> 273 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~dark~sel.pngbin0 -> 132 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~dark~sel@2x.pngbin0 -> 232 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~sel.pngbin0 -> 157 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~sel@2x.pngbin0 -> 262 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-csharp-16.pngbin482 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-csharp-16@2x.pngbin1033 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16.pngbin477 -> 294 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16@2x.pngbin932 -> 470 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~dark.pngbin0 -> 291 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~dark@2x.pngbin0 -> 470 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~dark~sel.pngbin0 -> 260 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~dark~sel@2x.pngbin0 -> 412 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~sel.pngbin0 -> 260 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~sel@2x.pngbin0 -> 412 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16.pngbin512 -> 248 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16@2x.pngbin1117 -> 283 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~dark.pngbin0 -> 242 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~dark@2x.pngbin0 -> 312 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~dark~sel.pngbin0 -> 218 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~dark~sel@2x.pngbin0 -> 260 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~sel.pngbin0 -> 210 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~sel@2x.pngbin0 -> 273 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16.pngbin516 -> 333 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16@2x.pngbin1124 -> 690 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~dark.pngbin0 -> 325 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~dark@2x.pngbin0 -> 691 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~dark~sel.pngbin0 -> 264 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~dark~sel@2x.pngbin0 -> 509 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~sel.pngbin0 -> 264 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~sel@2x.pngbin0 -> 509 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-generic-16.pngbin538 -> 376 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-generic-16@2x.pngbin1518 -> 1080 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~dark.pngbin0 -> 369 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~dark@2x.pngbin0 -> 949 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~dark~sel.pngbin0 -> 268 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~dark~sel@2x.pngbin0 -> 587 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~sel.pngbin0 -> 268 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~sel@2x.pngbin0 -> 587 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-header-16.pngbin0 -> 226 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-header-16@2x.pngbin0 -> 558 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-header-16~dark.pngbin0 -> 176 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-header-16~dark@2x.pngbin0 -> 518 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-header-16~dark~sel.pngbin0 -> 173 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-header-16~dark~sel@2x.pngbin0 -> 431 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-header-16~sel.pngbin0 -> 203 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-header-16~sel@2x.pngbin0 -> 439 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16.pngbin656 -> 301 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16@2x.pngbin1719 -> 649 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~dark.pngbin0 -> 318 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~dark@2x.pngbin0 -> 676 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~dark~sel.pngbin0 -> 264 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~dark~sel@2x.pngbin0 -> 557 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~sel.pngbin0 -> 264 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~sel@2x.pngbin0 -> 557 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-language-16.pngbin598 -> 248 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-language-16@2x.pngbin1732 -> 609 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-language-16~dark.pngbin0 -> 244 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-language-16~dark@2x.pngbin0 -> 583 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-language-16~dark~sel.pngbin0 -> 207 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-language-16~dark~sel@2x.pngbin0 -> 483 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-language-16~sel.pngbin0 -> 207 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-language-16~sel@2x.pngbin0 -> 483 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16.pngbin377 -> 248 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16@2x.pngbin738 -> 468 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~dark.pngbin0 -> 259 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~dark@2x.pngbin0 -> 470 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~dark~sel.pngbin0 -> 214 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~dark~sel@2x.pngbin0 -> 325 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~sel.pngbin0 -> 214 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~sel@2x.pngbin0 -> 325 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16.pngbin437 -> 242 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16@2x.pngbin888 -> 385 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~dark.pngbin0 -> 247 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~dark@2x.pngbin0 -> 388 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~dark~sel.pngbin0 -> 220 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~dark~sel@2x.pngbin0 -> 336 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~sel.pngbin0 -> 220 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~sel@2x.pngbin0 -> 336 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-play-16.pngbin526 -> 253 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-play-16@2x.pngbin1253 -> 532 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-play-16~dark.pngbin0 -> 267 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-play-16~dark@2x.pngbin0 -> 512 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-play-16~dark~sel.pngbin0 -> 179 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-play-16~dark~sel@2x.pngbin0 -> 328 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-play-16~sel.pngbin0 -> 179 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-play-16~sel@2x.pngbin0 -> 328 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16.pngbin351 -> 184 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16@2x.pngbin771 -> 279 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~dark.pngbin0 -> 173 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~dark@2x.pngbin0 -> 248 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~dark~sel.pngbin0 -> 150 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~dark~sel@2x.pngbin0 -> 213 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~sel.pngbin0 -> 150 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~sel@2x.pngbin0 -> 213 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-source-16.pngbin0 -> 308 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-source-16@2x.pngbin0 -> 649 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-source-16~dark.pngbin0 -> 280 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-source-16~dark@2x.pngbin0 -> 572 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-source-16~dark~sel.pngbin0 -> 232 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-source-16~dark~sel@2x.pngbin0 -> 447 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-source-16~sel.pngbin0 -> 246 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-source-16~sel@2x.pngbin0 -> 478 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-standard-header-16.pngbin364 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-standard-header-16@2x.pngbin703 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16.pngbin402 -> 207 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16@2x.pngbin822 -> 338 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~dark.pngbin0 -> 194 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~dark@2x.pngbin0 -> 336 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~dark~sel.pngbin0 -> 153 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~dark~sel@2x.pngbin0 -> 257 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~sel.pngbin0 -> 153 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~sel@2x.pngbin0 -> 257 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-updates-16.pngbin797 -> 446 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-updates-16@2x.pngbin1922 -> 890 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~dark.pngbin0 -> 431 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~dark@2x.pngbin0 -> 841 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~dark~sel.pngbin0 -> 325 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~dark~sel@2x.pngbin0 -> 657 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~sel.pngbin0 -> 325 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~sel@2x.pngbin0 -> 657 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-16.pngbin0 -> 341 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-16@2x.pngbin0 -> 716 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-16~dark.pngbin0 -> 287 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-16~dark@2x.pngbin0 -> 570 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-16~dark~sel.pngbin0 -> 252 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-16~dark~sel@2x.pngbin0 -> 476 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-16~sel.pngbin0 -> 257 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-16~sel@2x.pngbin0 -> 496 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-active-16.pngbin555 -> 334 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-active-16@2x.pngbin1594 -> 630 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-hover-16.pngbin562 -> 342 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-hover-16@2x.pngbin1508 -> 711 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-hover-16~dark.pngbin0 -> 313 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-hover-16~dark@2x.pngbin0 -> 594 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-hover-16~dark~sel.pngbin0 -> 214 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-hover-16~dark~sel@2x.pngbin0 -> 377 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-hover-16~sel.pngbin0 -> 228 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-hover-16~sel@2x.pngbin0 -> 436 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-normal-16.pngbin532 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-normal-16@2x.pngbin1416 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-selected-16.pngbin207 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/preview-selected-16@2x.pngbin410 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/print-16.pngbin0 -> 250 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/print-16@2x.pngbin0 -> 428 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/print-16~dark.pngbin0 -> 264 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/print-16~dark@2x.pngbin0 -> 445 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-128.pngbin2011 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-128@2x.pngbin4610 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-16.pngbin320 -> 169 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-16@2x.pngbin495 -> 246 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-16~dark.pngbin0 -> 168 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-16~dark@2x.pngbin0 -> 249 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-16~dark~sel.pngbin0 -> 147 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-16~dark~sel@2x.pngbin0 -> 221 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-16~sel.pngbin0 -> 147 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-16~sel@2x.pngbin0 -> 221 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-32.pngbin495 -> 242 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-32@2x.pngbin957 -> 518 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-32~dark.pngbin0 -> 239 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-32~dark@2x.pngbin0 -> 507 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-32~dark~sel.pngbin0 -> 221 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-32~dark~sel@2x.pngbin0 -> 477 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-32~sel.pngbin0 -> 221 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-32~sel@2x.pngbin0 -> 477 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-64.pngbin957 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-64@2x.pngbin2011 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-assembly-16.pngbin0 -> 296 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-assembly-16@2x.pngbin0 -> 697 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-assembly-16~dark.pngbin0 -> 302 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-assembly-16~dark@2x.pngbin0 -> 675 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-assembly-16~dark~sel.pngbin0 -> 214 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-assembly-16~dark~sel@2x.pngbin0 -> 516 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-assembly-16~sel.pngbin0 -> 214 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-assembly-16~sel@2x.pngbin0 -> 516 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32.pngbin552 -> 320 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32@2x.pngbin1182 -> 399 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~dark.pngbin0 -> 327 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~dark@2x.pngbin0 -> 472 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~dark~sel.pngbin0 -> 251 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~dark~sel@2x.pngbin0 -> 373 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~sel.pngbin0 -> 252 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~sel@2x.pngbin0 -> 375 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32.pngbin0 -> 207 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32@2x.pngbin0 -> 471 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~dark.pngbin0 -> 214 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~dark@2x.pngbin0 -> 465 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~dark~sel.pngbin0 -> 199 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~dark~sel@2x.pngbin0 -> 378 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~sel.pngbin0 -> 184 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~sel@2x.pngbin0 -> 368 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-gui-overlay-32.pngbin362 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-gui-overlay-32@2x.pngbin618 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32.pngbin588 -> 493 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32@2x.pngbin1320 -> 1217 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~dark.pngbin0 -> 453 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~dark@2x.pngbin0 -> 1364 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~dark~sel.pngbin0 -> 363 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~dark~sel@2x.pngbin0 -> 1152 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~sel.pngbin0 -> 383 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~sel@2x.pngbin0 -> 916 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-new-16.pngbin1318 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32.pngbin563 -> 375 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32@2x.pngbin1225 -> 684 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~dark.pngbin0 -> 380 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~dark@2x.pngbin0 -> 682 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~dark~sel.pngbin0 -> 291 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~dark~sel@2x.pngbin0 -> 519 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~sel.pngbin0 -> 291 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~sel@2x.pngbin0 -> 519 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32.pngbin542 -> 466 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32@2x.pngbin1199 -> 956 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~dark.pngbin0 -> 463 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~dark@2x.pngbin0 -> 977 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~dark~sel.pngbin0 -> 365 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~dark~sel@2x.pngbin0 -> 755 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~sel.pngbin0 -> 365 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~sel@2x.pngbin0 -> 755 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-reference-overlay-16.pngbin187 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-reference-overlay-16@2x.pngbin270 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32.pngbin654 -> 408 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32@2x.pngbin2081 -> 1342 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~dark.pngbin0 -> 419 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~dark@2x.pngbin0 -> 1294 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~dark~sel.pngbin0 -> 306 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~dark~sel@2x.pngbin0 -> 1000 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~sel.pngbin0 -> 306 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~sel@2x.pngbin0 -> 1000 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-status-error-16.pngbin430 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-status-error-16@2x.pngbin763 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-status-information-16.pngbin368 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-status-information-16@2x.pngbin672 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-status-warning-16.pngbin290 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-status-warning-16@2x.pngbin508 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-web-32.pngbin0 -> 651 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-web-32@2x.pngbin0 -> 1717 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-web-32~dark.pngbin0 -> 616 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-web-32~dark@2x.pngbin0 -> 1699 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-web-32~dark~sel.pngbin0 -> 463 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-web-32~dark~sel@2x.pngbin0 -> 1213 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-web-32~sel.pngbin0 -> 463 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-web-32~sel@2x.pngbin0 -> 1213 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-web-overlay-32.pngbin635 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/project-web-overlay-32@2x.pngbin1173 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/properties-16.pngbin329 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/properties-16@2x.pngbin597 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-16.pngbin833 -> 452 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-16@2x.pngbin2034 -> 917 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-16~dark.pngbin0 -> 466 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-16~dark@2x.pngbin0 -> 934 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-16~dark~sel.pngbin0 -> 307 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-16~dark~sel@2x.pngbin0 -> 661 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-16~sel.pngbin0 -> 307 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-16~sel@2x.pngbin0 -> 661 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-24.pngbin1302 -> 734 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-24@2x.pngbin3133 -> 1512 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-24~dark.pngbin0 -> 741 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-24~dark@2x.pngbin0 -> 1575 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-24~dark~sel.pngbin0 -> 498 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-24~dark~sel@2x.pngbin0 -> 1048 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-24~sel.pngbin0 -> 498 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-24~sel@2x.pngbin0 -> 1048 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-32.pngbin2034 -> 917 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-32@2x.pngbin4528 -> 1746 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-32~dark.pngbin0 -> 934 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-32~dark@2x.pngbin0 -> 1784 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-32~dark~sel.pngbin0 -> 661 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-32~dark~sel@2x.pngbin0 -> 1345 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-32~sel.pngbin0 -> 661 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-32~sel@2x.pngbin0 -> 1345 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-48.pngbin3133 -> 1512 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-48@2x.pngbin7240 -> 3132 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-48~dark.pngbin0 -> 1575 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-48~dark@2x.pngbin0 -> 3201 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-48~dark~sel.pngbin0 -> 1048 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-48~dark~sel@2x.pngbin0 -> 2497 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-48~sel.pngbin0 -> 1048 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/question-48~sel@2x.pngbin0 -> 2497 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/redo-16.pngbin0 -> 357 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/redo-16@2x.pngbin0 -> 711 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/redo-16~dark.pngbin0 -> 364 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/redo-16~dark@2x.pngbin0 -> 698 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/redo-16~dark~disabled.pngbin0 -> 325 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/redo-16~dark~disabled@2x.pngbin0 -> 632 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/redo-16~disabled.pngbin0 -> 342 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/redo-16~disabled@2x.pngbin0 -> 705 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-16.pngbin589 -> 459 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-16@2x.pngbin1304 -> 961 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-16~dark.pngbin0 -> 452 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-16~dark@2x.pngbin0 -> 958 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-16~dark~sel.pngbin0 -> 350 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-16~dark~sel@2x.pngbin0 -> 658 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-16~sel.pngbin0 -> 350 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-16~sel@2x.pngbin0 -> 658 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-assembly-16.pngbin0 -> 512 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-assembly-16@2x.pngbin0 -> 1052 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~dark.pngbin0 -> 501 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~dark@2x.pngbin0 -> 1045 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~dark~sel.pngbin0 -> 369 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~dark~sel@2x.pngbin0 -> 704 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~sel.pngbin0 -> 369 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~sel@2x.pngbin0 -> 704 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-invalid-16.pngbin0 -> 554 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-invalid-16@2x.pngbin0 -> 1194 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~dark.pngbin0 -> 537 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~dark@2x.pngbin0 -> 1172 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~dark~sel.pngbin0 -> 380 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~dark~sel@2x.pngbin0 -> 766 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~sel.pngbin0 -> 380 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~sel@2x.pngbin0 -> 766 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-project-16.pngbin0 -> 477 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-project-16@2x.pngbin0 -> 1002 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-project-16~dark.pngbin0 -> 466 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-project-16~dark@2x.pngbin0 -> 1001 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-project-16~dark~sel.pngbin0 -> 368 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-project-16~dark~sel@2x.pngbin0 -> 687 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-project-16~sel.pngbin0 -> 368 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/reference-project-16~sel@2x.pngbin0 -> 687 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/refresh-16.pngbin788 -> 354 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/refresh-16@2x.pngbin1825 -> 707 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/refresh-16~dark.pngbin0 -> 363 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/refresh-16~dark@2x.pngbin0 -> 698 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/refresh-16~dark~disabled.pngbin0 -> 334 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/refresh-16~dark~disabled@2x.pngbin0 -> 639 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/refresh-16~disabled.pngbin0 -> 339 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/refresh-16~disabled@2x.pngbin0 -> 655 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/region-16.pngbin0 -> 391 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/region-16@2x.pngbin0 -> 803 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/region-16~dark.pngbin0 -> 388 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/region-16~dark@2x.pngbin0 -> 782 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/region-16~dark~sel.pngbin0 -> 304 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/region-16~dark~sel@2x.pngbin0 -> 575 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/region-16~sel.pngbin0 -> 304 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/region-16~sel@2x.pngbin0 -> 575 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/remove-16.pngbin583 -> 462 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/remove-16@2x.pngbin1355 -> 953 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/remove-16~dark.pngbin0 -> 448 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/remove-16~dark@2x.pngbin0 -> 914 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/remove-16~dark~disabled.pngbin0 -> 434 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/remove-16~dark~disabled@2x.pngbin0 -> 901 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/remove-16~disabled.pngbin0 -> 444 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/remove-16~disabled@2x.pngbin0 -> 945 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/replace-in-files-16.pngbin732 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/revert-16.pngbin0 -> 478 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/revert-16@2x.pngbin0 -> 966 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/revert-16~dark.pngbin0 -> 464 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/revert-16~dark@2x.pngbin0 -> 936 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/revert-16~dark~disabled.pngbin0 -> 444 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/revert-16~dark~disabled@2x.pngbin0 -> 912 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/revert-16~disabled.pngbin0 -> 467 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/revert-16~disabled@2x.pngbin0 -> 917 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/run-unit-tests-16.pngbin0 -> 280 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/run-unit-tests-16@2x.pngbin0 -> 542 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/run-unit-tests-16~dark.pngbin0 -> 287 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/run-unit-tests-16~dark@2x.pngbin0 -> 526 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/save-16.pngbin536 -> 197 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/save-16@2x.pngbin0 -> 252 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/save-16~dark.pngbin0 -> 237 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/save-16~dark@2x.pngbin0 -> 283 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/save-all-16.pngbin561 -> 257 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/save-all-16@2x.pngbin0 -> 333 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/save-all-16~dark.pngbin0 -> 270 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/save-all-16~dark@2x.pngbin0 -> 373 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-clear-16.pngbin655 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-clear-16@2x.pngbin1845 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-clear-mac-16.pngbin0 -> 360 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-clear-mac-16@2x.pngbin0 -> 746 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-clear-mac-16~dark.pngbin0 -> 355 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-clear-mac-16~dark@2x.pngbin0 -> 702 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24.pngbin0 -> 378 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24~dark.pngbin0 -> 378 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24~hover.pngbin0 -> 361 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24~hover~dark.pngbin0 -> 361 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24~pressed.pngbin0 -> 330 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24~pressed~dark.pngbin0 -> 340 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-search-16.pngbin531 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-search-16@2x.pngbin1466 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-search-mac-16.pngbin0 -> 368 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-search-mac-16@2x.pngbin0 -> 759 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-search-mac-16~dark.pngbin0 -> 344 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-search-mac-16~dark@2x.pngbin0 -> 740 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24.pngbin0 -> 397 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24~dark.pngbin0 -> 397 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24~hover.pngbin0 -> 469 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24~hover~dark.pngbin0 -> 469 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24~pressed.pngbin0 -> 425 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24~pressed~dark.pngbin0 -> 451 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/select-all-16.pngbin0 -> 493 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/select-all-16@2x.pngbin0 -> 1068 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/select-all-16~dark.pngbin0 -> 479 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/select-all-16~dark@2x.pngbin0 -> 1020 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/select-all-16~dark~disabled.pngbin0 -> 447 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/select-all-16~dark~disabled@2x.pngbin0 -> 1011 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/select-all-16~disabled.pngbin0 -> 462 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/select-all-16~disabled@2x.pngbin0 -> 1045 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-128.pngbin2748 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-128@2x.pngbin5548 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-16.pngbin461 -> 177 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-16@2x.pngbin845 -> 270 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-16~dark.pngbin0 -> 178 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-16~dark@2x.pngbin0 -> 270 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-16~dark~sel.pngbin0 -> 157 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-16~dark~sel@2x.pngbin0 -> 235 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-16~sel.pngbin0 -> 157 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-16~sel@2x.pngbin0 -> 235 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-32.pngbin845 -> 264 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-32@2x.pngbin1578 -> 579 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-32~dark.pngbin0 -> 263 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-32~dark@2x.pngbin0 -> 560 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-32~dark~sel.pngbin0 -> 235 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-32~dark~sel@2x.pngbin0 -> 527 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-32~sel.pngbin0 -> 235 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-32~sel@2x.pngbin0 -> 527 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-64.pngbin1578 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-64@2x.pngbin2748 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-folder-new-16.pngbin1328 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/solution-new-16.pngbin1315 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/sort-alphabetically-16.pngbin484 -> 237 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/sort-alphabetically-16@2x.pngbin964 -> 498 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/sort-alphabetically-16~dark.pngbin0 -> 240 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/sort-alphabetically-16~dark@2x.pngbin0 -> 497 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-1.pngbin369 -> 297 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-1@2x.pngbin1002 -> 525 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-1~dark.pngbin0 -> 301 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-1~dark@2x.pngbin0 -> 504 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-1~dark~sel.pngbin0 -> 211 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-1~dark~sel@2x.pngbin0 -> 365 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-1~sel.pngbin0 -> 211 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-1~sel@2x.pngbin0 -> 365 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-2.pngbin458 -> 343 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-2@2x.pngbin1338 -> 834 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-2~dark.pngbin0 -> 349 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-2~dark@2x.pngbin0 -> 808 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-2~dark~sel.pngbin0 -> 286 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-2~dark~sel@2x.pngbin0 -> 554 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-2~sel.pngbin0 -> 286 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-2~sel@2x.pngbin0 -> 554 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-3.pngbin441 -> 411 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-3@2x.pngbin1312 -> 796 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-3~dark.pngbin0 -> 361 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-3~dark@2x.pngbin0 -> 756 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-3~dark~sel.pngbin0 -> 266 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-3~dark~sel@2x.pngbin0 -> 548 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-3~sel.pngbin0 -> 266 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-3~sel@2x.pngbin0 -> 548 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-4.pngbin491 -> 419 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-4@2x.pngbin1312 -> 810 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-4~dark.pngbin0 -> 361 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-4~dark@2x.pngbin0 -> 788 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-4~dark~sel.pngbin0 -> 273 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-4~dark~sel@2x.pngbin0 -> 547 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-4~sel.pngbin0 -> 273 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-4~sel@2x.pngbin0 -> 547 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-5.pngbin443 -> 333 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-5@2x.pngbin1325 -> 816 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-5~dark.pngbin0 -> 324 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-5~dark@2x.pngbin0 -> 805 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-5~dark~sel.pngbin0 -> 287 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-5~dark~sel@2x.pngbin0 -> 566 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-5~sel.pngbin0 -> 287 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-14-5~sel@2x.pngbin0 -> 566 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-1.pngbin0 -> 308 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-1@2x.pngbin0 -> 539 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-1~dark.pngbin0 -> 311 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-1~dark@2x.pngbin0 -> 517 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-1~dark~sel.pngbin0 -> 212 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-1~dark~sel@2x.pngbin0 -> 372 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-1~sel.pngbin0 -> 212 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-1~sel@2x.pngbin0 -> 372 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-2.pngbin0 -> 352 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-2@2x.pngbin0 -> 856 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-2~dark.pngbin0 -> 362 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-2~dark@2x.pngbin0 -> 831 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-2~dark~sel.pngbin0 -> 293 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-2~dark~sel@2x.pngbin0 -> 566 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-2~sel.pngbin0 -> 293 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-2~sel@2x.pngbin0 -> 566 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-3.pngbin0 -> 421 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-3@2x.pngbin0 -> 818 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-3~dark.pngbin0 -> 371 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-3~dark@2x.pngbin0 -> 777 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-3~dark~sel.pngbin0 -> 271 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-3~dark~sel@2x.pngbin0 -> 570 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-3~sel.pngbin0 -> 271 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-3~sel@2x.pngbin0 -> 570 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-4.pngbin0 -> 427 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-4@2x.pngbin0 -> 833 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-4~dark.pngbin0 -> 369 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-4~dark@2x.pngbin0 -> 806 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-4~dark~sel.pngbin0 -> 277 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-4~dark~sel@2x.pngbin0 -> 568 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-4~sel.pngbin0 -> 277 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-4~sel@2x.pngbin0 -> 568 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-5.pngbin0 -> 343 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-5@2x.pngbin0 -> 842 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-5~dark.pngbin0 -> 333 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-5~dark@2x.pngbin0 -> 827 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-5~dark~sel.pngbin0 -> 289 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-5~dark~sel@2x.pngbin0 -> 576 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-5~sel.pngbin0 -> 289 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-16-5~sel@2x.pngbin0 -> 576 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-1.pngbin549 -> 384 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-1@2x.pngbin1431 -> 779 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-1~dark.pngbin0 -> 362 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-1~dark@2x.pngbin0 -> 765 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-1~dark~sel.pngbin0 -> 301 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-1~dark~sel@2x.pngbin0 -> 490 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-1~sel.pngbin0 -> 301 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-1~sel@2x.pngbin0 -> 490 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-2.pngbin623 -> 520 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-2@2x.pngbin1953 -> 1227 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-2~dark.pngbin0 -> 515 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-2~dark@2x.pngbin0 -> 1224 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-2~dark~sel.pngbin0 -> 381 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-2~dark~sel@2x.pngbin0 -> 782 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-2~sel.pngbin0 -> 381 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-2~sel@2x.pngbin0 -> 782 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-3.pngbin653 -> 521 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-3@2x.pngbin1906 -> 1124 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-3~dark.pngbin0 -> 487 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-3~dark@2x.pngbin0 -> 1129 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-3~dark~sel.pngbin0 -> 378 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-3~dark~sel@2x.pngbin0 -> 796 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-3~sel.pngbin0 -> 378 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-3~sel@2x.pngbin0 -> 796 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-4.pngbin631 -> 517 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-4@2x.pngbin1901 -> 1152 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-4~dark.pngbin0 -> 484 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-4~dark@2x.pngbin0 -> 1132 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-4~dark~sel.pngbin0 -> 381 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-4~dark~sel@2x.pngbin0 -> 765 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-4~sel.pngbin0 -> 381 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-4~sel@2x.pngbin0 -> 765 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-5.pngbin605 -> 509 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-5@2x.pngbin1921 -> 1262 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-5~dark.pngbin0 -> 486 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-5~dark@2x.pngbin0 -> 1213 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-5~dark~sel.pngbin0 -> 375 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-5~dark~sel@2x.pngbin0 -> 807 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-5~sel.pngbin0 -> 375 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-18-5~sel@2x.pngbin0 -> 807 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-normal-1-16.pngbin393 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-normal-1-16@2x.pngbin1032 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-normal-2-16.pngbin479 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-normal-2-16@2x.pngbin1392 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-normal-3-16.pngbin465 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-normal-3-16@2x.pngbin1350 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-normal-4-16.pngbin516 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-normal-4-16@2x.pngbin1368 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-normal-5-16.pngbin467 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-normal-5-16@2x.pngbin1375 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-selected-1-16.pngbin205 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-selected-1-16@2x.pngbin404 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-selected-2-16.pngbin310 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-selected-2-16@2x.pngbin587 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-selected-3-16.pngbin300 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-selected-3-16@2x.pngbin570 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-selected-4-16.pngbin297 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-selected-4-16@2x.pngbin573 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-selected-5-16.pngbin302 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/spinner-selected-5-16@2x.pngbin587 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/star-16.pngbin632 -> 294 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/star-16@2x.pngbin1341 -> 753 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/star-16~dark.pngbin0 -> 274 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/star-16~dark@2x.pngbin0 -> 711 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/star-hover-16.pngbin604 -> 294 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/star-hover-16@2x.pngbin1343 -> 749 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/star-overlay-16.pngbin531 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/star-overlay-16@2x.pngbin1030 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/star-overlay-hover-16.pngbin506 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/star-overlay-hover-16@2x.pngbin1014 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-1-14.pngbin297 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-1-14@2x.pngbin704 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-1-16.pngbin0 -> 245 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-1-16@2x.pngbin0 -> 366 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-1-16~dark.pngbin0 -> 198 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-1-16~dark@2x.pngbin0 -> 287 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-2-14.pngbin419 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-2-14@2x.pngbin1103 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-2-16.pngbin0 -> 309 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-2-16@2x.pngbin0 -> 514 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-2-16~dark.pngbin0 -> 249 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-2-16~dark@2x.pngbin0 -> 354 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-3-14.pngbin562 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-3-14@2x.pngbin1555 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-3-16.pngbin0 -> 406 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-3-16@2x.pngbin0 -> 718 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-3-16~dark.pngbin0 -> 315 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-3-16~dark@2x.pngbin0 -> 443 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-4-14.pngbin468 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-4-14@2x.pngbin1229 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-4-16.pngbin0 -> 375 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-4-16@2x.pngbin0 -> 579 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-4-16~dark.pngbin0 -> 276 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-4-16~dark@2x.pngbin0 -> 385 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-5-14.pngbin279 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-5-14@2x.pngbin753 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-5-16.pngbin0 -> 253 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-5-16@2x.pngbin0 -> 419 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-5-16~dark.pngbin0 -> 174 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-building-5-16~dark@2x.pngbin0 -> 281 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-1-14.pngbin548 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-1-14@2x.pngbin1597 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-1-16.pngbin0 -> 438 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-1-16@2x.pngbin0 -> 928 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-1-16~dark.pngbin0 -> 279 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-1-16~dark@2x.pngbin0 -> 635 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-2-14.pngbin570 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-2-14@2x.pngbin1675 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-2-16.pngbin0 -> 467 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-2-16@2x.pngbin0 -> 981 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-2-16~dark.pngbin0 -> 310 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-2-16~dark@2x.pngbin0 -> 665 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-3-14.pngbin617 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-3-14@2x.pngbin1760 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-3-16.pngbin0 -> 491 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-3-16@2x.pngbin0 -> 1113 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-3-16~dark.pngbin0 -> 303 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-3-16~dark@2x.pngbin0 -> 738 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-4-14.pngbin522 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-4-14@2x.pngbin1521 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-4-16.pngbin0 -> 495 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-4-16@2x.pngbin0 -> 1179 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-4-16~dark.pngbin0 -> 338 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-4-16~dark@2x.pngbin0 -> 753 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-5-14.pngbin566 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-5-14@2x.pngbin1538 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-5-16.pngbin0 -> 402 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-5-16@2x.pngbin0 -> 806 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-5-16~dark.pngbin0 -> 272 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-5-16~dark@2x.pngbin0 -> 535 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-6-14.pngbin508 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-6-14@2x.pngbin1482 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-6-16.pngbin0 -> 417 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-6-16@2x.pngbin0 -> 869 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-6-16~dark.pngbin0 -> 287 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-connecting-6-16~dark@2x.pngbin0 -> 594 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-error-16.pngbin0 -> 346 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-error-16@2x.pngbin0 -> 699 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-error-16~dark.pngbin0 -> 340 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-error-16~dark@2x.pngbin0 -> 665 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-error-count-16.pngbin0 -> 357 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-error-count-16@2x.pngbin0 -> 778 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-error-count-16~dark.pngbin0 -> 233 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-error-count-16~dark@2x.pngbin0 -> 500 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-failure-14.pngbin559 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-failure-14@2x.pngbin1639 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-instrumentation-16.pngbin0 -> 413 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-instrumentation-16@2x.pngbin0 -> 803 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-instrumentation-16~dark.pngbin0 -> 418 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-instrumentation-16~dark@2x.pngbin0 -> 837 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-1-14.pngbin498 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-1-14@2x.pngbin1229 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-1-16.pngbin0 -> 354 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-1-16@2x.pngbin0 -> 662 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-1-16~dark.pngbin0 -> 252 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-1-16~dark@2x.pngbin0 -> 402 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-2-14.pngbin581 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-2-14@2x.pngbin1424 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-2-16.pngbin0 -> 416 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-2-16@2x.pngbin0 -> 770 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-2-16~dark.pngbin0 -> 315 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-2-16~dark@2x.pngbin0 -> 571 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-3-14.pngbin572 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-3-14@2x.pngbin1512 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-3-16.pngbin0 -> 409 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-3-16@2x.pngbin0 -> 807 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-3-16~dark.pngbin0 -> 319 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-3-16~dark@2x.pngbin0 -> 620 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-4-14.pngbin638 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-4-14@2x.pngbin1671 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-4-16.pngbin0 -> 472 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-4-16@2x.pngbin0 -> 959 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-4-16~dark.pngbin0 -> 350 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-4-16~dark@2x.pngbin0 -> 676 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-5-14.pngbin612 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-5-14@2x.pngbin1629 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-5-16.pngbin0 -> 471 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-5-16@2x.pngbin0 -> 864 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-5-16~dark.pngbin0 -> 342 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-5-16~dark@2x.pngbin0 -> 579 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-6-14.pngbin612 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-6-14@2x.pngbin1599 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-6-16.pngbin0 -> 471 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-6-16@2x.pngbin0 -> 787 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-6-16~dark.pngbin0 -> 342 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-opening-6-16~dark@2x.pngbin0 -> 536 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-parsing-16.pngbin0 -> 549 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-parsing-16@2x.pngbin0 -> 1237 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-parsing-16~dark.pngbin0 -> 493 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-parsing-16~dark@2x.pngbin0 -> 1212 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-1-14.pngbin249 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-1-14@2x.pngbin601 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-1-16.pngbin0 -> 183 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-1-16@2x.pngbin0 -> 235 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-1-16~dark.pngbin0 -> 155 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-1-16~dark@2x.pngbin0 -> 202 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-2-14.pngbin288 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-2-14@2x.pngbin680 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-2-16.pngbin0 -> 200 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-2-16@2x.pngbin0 -> 250 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-2-16~dark.pngbin0 -> 183 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-2-16~dark@2x.pngbin0 -> 233 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-3-14.pngbin323 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-3-14@2x.pngbin767 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-3-16.pngbin0 -> 215 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-3-16@2x.pngbin0 -> 282 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-3-16~dark.pngbin0 -> 205 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-3-16~dark@2x.pngbin0 -> 279 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-4-14.pngbin283 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-4-14@2x.pngbin612 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-4-16.pngbin0 -> 217 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-4-16@2x.pngbin0 -> 271 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-4-16~dark.pngbin0 -> 205 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-4-16~dark@2x.pngbin0 -> 265 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-5-14.pngbin289 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-5-14@2x.pngbin643 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-5-16.pngbin0 -> 190 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-5-16@2x.pngbin0 -> 228 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-5-16~dark.pngbin0 -> 182 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-5-16~dark@2x.pngbin0 -> 220 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-6-14.pngbin287 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-6-14@2x.pngbin595 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-6-16.pngbin0 -> 194 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-6-16@2x.pngbin0 -> 239 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-6-16~dark.pngbin0 -> 188 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pulling-6-16~dark@2x.pngbin0 -> 232 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-1-14.pngbin299 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-1-14@2x.pngbin707 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-1-16.pngbin0 -> 199 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-1-16@2x.pngbin0 -> 255 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-1-16~dark.pngbin0 -> 174 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-1-16~dark@2x.pngbin0 -> 225 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-2-14.pngbin321 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-2-14@2x.pngbin775 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-2-16.pngbin0 -> 208 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-2-16@2x.pngbin0 -> 271 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-2-16~dark.pngbin0 -> 203 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-2-16~dark@2x.pngbin0 -> 254 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-3-14.pngbin334 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-3-14@2x.pngbin794 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-3-16.pngbin0 -> 229 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-3-16@2x.pngbin0 -> 289 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-3-16~dark.pngbin0 -> 208 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-3-16~dark@2x.pngbin0 -> 262 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-4-14.pngbin285 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-4-14@2x.pngbin675 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-4-16.pngbin0 -> 199 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-4-16@2x.pngbin0 -> 247 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-4-16~dark.pngbin0 -> 193 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-4-16~dark@2x.pngbin0 -> 241 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-5-14.pngbin262 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-5-14@2x.pngbin575 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-5-16.pngbin0 -> 207 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-5-16@2x.pngbin0 -> 255 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-5-16~dark.pngbin0 -> 197 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-5-16~dark@2x.pngbin0 -> 248 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-6-14.pngbin249 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-6-14@2x.pngbin464 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-6-16.pngbin0 -> 188 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-6-16@2x.pngbin0 -> 232 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-6-16~dark.pngbin0 -> 179 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-pushing-6-16~dark@2x.pngbin0 -> 222 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-ready-14.pngbin570 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-ready-14@2x.pngbin1675 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-ready-16.pngbin0 -> 503 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-ready-16@2x.pngbin0 -> 1248 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-ready-16~dark.pngbin0 -> 520 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-ready-16~dark@2x.pngbin0 -> 1281 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-1-14.pngbin485 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-1-14@2x.pngbin1371 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-1-16.pngbin0 -> 360 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-1-16@2x.pngbin0 -> 731 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-1-16~dark.pngbin0 -> 264 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-1-16~dark@2x.pngbin0 -> 502 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-2-14.pngbin488 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-2-14@2x.pngbin1386 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-2-16.pngbin0 -> 360 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-2-16@2x.pngbin0 -> 741 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-2-16~dark.pngbin0 -> 265 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-2-16~dark@2x.pngbin0 -> 500 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-3-14.pngbin501 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-3-14@2x.pngbin1410 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-3-16.pngbin0 -> 369 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-3-16@2x.pngbin0 -> 759 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-3-16~dark.pngbin0 -> 262 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-3-16~dark@2x.pngbin0 -> 507 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-4-14.pngbin501 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-4-14@2x.pngbin1373 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-4-16.pngbin0 -> 362 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-4-16@2x.pngbin0 -> 755 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-4-16~dark.pngbin0 -> 262 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-searching-4-16~dark@2x.pngbin0 -> 510 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-success-14.pngbin580 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-success-14@2x.pngbin1598 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-success-16.pngbin0 -> 349 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-success-16@2x.pngbin0 -> 694 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-success-16~dark.pngbin0 -> 233 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-success-16~dark@2x.pngbin0 -> 525 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-1-16.pngbin0 -> 462 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-1-16@2x.pngbin0 -> 923 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-1-16~dark.pngbin0 -> 310 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-1-16~dark@2x.pngbin0 -> 646 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-16.png (renamed from main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-16.png)bin401 -> 401 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-16@2x.png (renamed from main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-16@2x.png)bin831 -> 831 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-2-16.pngbin0 -> 463 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-2-16@2x.pngbin0 -> 1001 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-2-16~dark.pngbin0 -> 332 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-2-16~dark@2x.pngbin0 -> 672 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-3-16.pngbin0 -> 440 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-3-16@2x.pngbin0 -> 945 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-3-16~dark.pngbin0 -> 335 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-3-16~dark@2x.pngbin0 -> 699 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-4-16.pngbin0 -> 439 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-4-16@2x.pngbin0 -> 971 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-4-16~dark.pngbin0 -> 339 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-4-16~dark@2x.pngbin0 -> 754 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-5-16.pngbin0 -> 458 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-5-16@2x.pngbin0 -> 951 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-5-16~dark.pngbin0 -> 345 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-5-16~dark@2x.pngbin0 -> 716 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-6-16.pngbin0 -> 471 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-6-16@2x.pngbin0 -> 978 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-6-16~dark.pngbin0 -> 316 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-6-16~dark@2x.pngbin0 -> 681 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-paused-16.pngbin0 -> 410 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-paused-16@2x.pngbin0 -> 889 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-paused-16~dark.pngbin0 -> 291 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-paused-16~dark@2x.pngbin0 -> 610 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-ready-16.pngbin0 -> 462 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-ready-16@2x.pngbin0 -> 923 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-ready-16~dark.pngbin0 -> 310 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-updates-ready-16~dark@2x.pngbin0 -> 646 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-1-14.pngbin369 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-1-14@2x.pngbin1002 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-1-16.pngbin0 -> 300 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-1-16@2x.pngbin0 -> 550 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-1-16~dark.pngbin0 -> 207 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-1-16~dark@2x.pngbin0 -> 403 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-2-14.pngbin458 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-2-14@2x.pngbin1338 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-2-16.pngbin0 -> 414 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-2-16@2x.pngbin0 -> 895 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-2-16~dark.pngbin0 -> 310 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-2-16~dark@2x.pngbin0 -> 587 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-3-14.pngbin441 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-3-14@2x.pngbin1312 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-3-16.pngbin0 -> 468 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-3-16@2x.pngbin0 -> 835 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-3-16~dark.pngbin0 -> 298 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-3-16~dark@2x.pngbin0 -> 583 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-4-14.pngbin491 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-4-14@2x.pngbin1312 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-4-16.pngbin0 -> 458 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-4-16@2x.pngbin0 -> 853 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-4-16~dark.pngbin0 -> 300 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-4-16~dark@2x.pngbin0 -> 569 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-5-14.pngbin443 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-5-14@2x.pngbin1325 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-5-16.pngbin0 -> 379 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-5-16@2x.pngbin0 -> 873 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-5-16~dark.pngbin0 -> 302 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-waiting-5-16~dark@2x.pngbin0 -> 579 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-warning-14.pngbin394 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-warning-14@2x.pngbin1216 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-warning-16.pngbin0 -> 334 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-warning-16@2x.pngbin0 -> 697 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-warning-16~dark.pngbin0 -> 326 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-warning-16~dark@2x.pngbin0 -> 678 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-warning-count-16.pngbin0 -> 320 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-warning-count-16@2x.pngbin0 -> 690 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-warning-count-16~dark.pngbin0 -> 253 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/status-warning-count-16~dark@2x.pngbin0 -> 499 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/stop-16.pngbin648 -> 120 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/stop-16@2x.pngbin1408 -> 149 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/stop-16~dark.pngbin0 -> 119 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/stop-16~dark@2x.pngbin0 -> 147 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/stop-16~dark~disabled.pngbin0 -> 120 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/stop-16~dark~disabled@2x.pngbin0 -> 143 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/stop-16~disabled.pngbin0 -> 120 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/stop-16~disabled@2x.pngbin0 -> 143 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tab-close-9.pngbin0 -> 126 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tab-close-9@2x.pngbin0 -> 197 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tab-close-9~dark.pngbin0 -> 127 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tab-close-9~dark@2x.pngbin0 -> 197 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tab-dirty-9.pngbin0 -> 218 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tab-dirty-9@2x.pngbin0 -> 443 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tab-dirty-9~dark.pngbin0 -> 212 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tab-dirty-9~dark@2x.pngbin0 -> 413 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-menu-12.pngbin0 -> 217 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-menu-12@2x.pngbin0 -> 280 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-menu-12~dark.pngbin0 -> 190 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-menu-12~dark@2x.pngbin0 -> 253 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-menu-hover-12.pngbin0 -> 198 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-menu-hover-12@2x.pngbin0 -> 265 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-menu-hover-12~dark.pngbin0 -> 199 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-menu-hover-12~dark@2x.pngbin0 -> 261 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-next-12.pngbin226 -> 104 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-next-12@2x.pngbin526 -> 182 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-next-12~dark.pngbin0 -> 105 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-next-12~dark@2x.pngbin0 -> 182 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-next-hover-12.pngbin0 -> 105 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-next-hover-12@2x.pngbin0 -> 189 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-next-hover-12~dark.pngbin0 -> 105 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-next-hover-12~dark@2x.pngbin0 -> 185 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-prev-12.pngbin233 -> 106 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-prev-12@2x.pngbin536 -> 190 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-prev-12~dark.pngbin0 -> 106 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-prev-12~dark@2x.pngbin0 -> 190 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-prev-hover-12.pngbin0 -> 106 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-prev-hover-12@2x.pngbin0 -> 197 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-prev-hover-12~dark.pngbin0 -> 106 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tabbar-prev-hover-12~dark@2x.pngbin0 -> 194 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/toggle-bookmark-16.pngbin608 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tree-popup-button-down.pngbin762 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tree-popup-button-down@2x.pngbin2091 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tree-popup-button-hover.pngbin668 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tree-popup-button-hover@2x.pngbin1699 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tree-popup-button.pngbin659 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/tree-popup-button@2x.pngbin1659 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/undo-16.pngbin785 -> 348 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/undo-16@2x.pngbin1958 -> 680 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/undo-16~dark.pngbin0 -> 334 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/undo-16~dark@2x.pngbin0 -> 644 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/undo-16~dark~disabled.pngbin0 -> 328 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/undo-16~dark~disabled@2x.pngbin0 -> 637 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/undo-16~disabled.pngbin0 -> 338 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/undo-16~disabled@2x.pngbin0 -> 707 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/unindent-16.pngbin0 -> 143 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/unindent-16@2x.pngbin0 -> 268 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/unindent-16~dark.pngbin0 -> 143 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/unindent-16~dark@2x.pngbin0 -> 268 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/unstar-16.pngbin635 -> 346 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/unstar-16@2x.pngbin1475 -> 904 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/unstar-16~dark.pngbin0 -> 354 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/unstar-16~dark@2x.pngbin0 -> 919 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/unstar-hover-16.pngbin618 -> 341 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/unstar-hover-16@2x.pngbin1528 -> 909 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/unstar-overlay-16.pngbin558 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/unstar-overlay-16@2x.pngbin1228 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/unstar-overlay-hover-16.pngbin484 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/unstar-overlay-hover-16@2x.pngbin1100 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/updates-16.pngbin797 -> 417 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/updates-16@2x.pngbin1922 -> 698 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/updates-16~dark.pngbin0 -> 409 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/updates-16~dark@2x.pngbin0 -> 709 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/updates-16~dark~disabled.pngbin0 -> 392 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/updates-16~dark~disabled@2x.pngbin0 -> 670 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/updates-16~disabled.pngbin0 -> 410 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/updates-16~disabled@2x.pngbin0 -> 700 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-16.pngbin669 -> 369 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-16@2x.pngbin1348 -> 764 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-16~dark.pngbin0 -> 351 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-16~dark@2x.pngbin0 -> 737 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-16~dark~sel.pngbin0 -> 255 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-16~dark~sel@2x.pngbin0 -> 557 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-16~sel.pngbin0 -> 255 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-16~sel@2x.pngbin0 -> 557 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-24.pngbin890 -> 532 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-24@2x.pngbin2305 -> 1104 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-24~dark.pngbin0 -> 528 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-24~dark@2x.pngbin0 -> 1049 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-24~dark~sel.pngbin0 -> 388 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-24~dark~sel@2x.pngbin0 -> 873 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-24~sel.pngbin0 -> 388 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-24~sel@2x.pngbin0 -> 873 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-32.pngbin1348 -> 764 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-32@2x.pngbin3445 -> 1510 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-32~dark.pngbin0 -> 737 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-32~dark@2x.pngbin0 -> 1413 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-32~dark~sel.pngbin0 -> 557 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-32~dark~sel@2x.pngbin0 -> 1200 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-32~sel.pngbin0 -> 557 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-32~sel@2x.pngbin0 -> 1200 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-48.pngbin2305 -> 1104 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-48@2x.pngbin5183 -> 2192 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-48~dark.pngbin0 -> 1049 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-48~dark@2x.pngbin0 -> 2126 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-48~dark~sel.pngbin0 -> 873 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-48~dark~sel@2x.pngbin0 -> 1960 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-48~sel.pngbin0 -> 873 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-48~sel@2x.pngbin0 -> 1960 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-8.pngbin243 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-8@2x.pngbin669 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-overlay-9.pngbin1112 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/warning-overlay-9@2x.pngbin1454 -> 0 bytes
-rw-r--r--[-rwxr-xr-x]main/src/core/MonoDevelop.Ide/icons/web-search-16.pngbin849 -> 573 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/web-search-16@2x.pngbin0 -> 1499 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/web-search-16~dark.pngbin0 -> 543 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/web-search-16~dark@2x.pngbin0 -> 1406 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/web-search-16~dark~disabled.pngbin0 -> 527 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/web-search-16~dark~disabled@2x.pngbin0 -> 1366 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/web-search-16~disabled.pngbin0 -> 535 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/web-search-16~disabled@2x.pngbin0 -> 1348 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/workspace-16.pngbin486 -> 179 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/workspace-16@2x.pngbin801 -> 277 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/workspace-16~dark.pngbin0 -> 179 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/workspace-16~dark@2x.pngbin0 -> 284 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/workspace-16~dark~sel.pngbin0 -> 159 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/workspace-16~dark~sel@2x.pngbin0 -> 244 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/workspace-16~sel.pngbin0 -> 159 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/workspace-16~sel@2x.pngbin0 -> 244 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/workspace-32.pngbin801 -> 277 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/workspace-32@2x.pngbin1760 -> 629 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/workspace-32~dark.pngbin0 -> 275 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/workspace-32~dark@2x.pngbin0 -> 623 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/workspace-32~dark~sel.pngbin0 -> 244 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/workspace-32~dark~sel@2x.pngbin0 -> 568 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/workspace-32~sel.pngbin0 -> 244 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/workspace-32~sel@2x.pngbin0 -> 568 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-actual-16.pngbin0 -> 494 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-actual-16@2x.pngbin0 -> 883 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~dark.pngbin0 -> 481 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~dark@2x.pngbin0 -> 864 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~dark~sel.pngbin0 -> 343 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~dark~sel@2x.pngbin0 -> 687 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~sel.pngbin0 -> 343 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~sel@2x.pngbin0 -> 687 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-in-16.pngbin428 -> 471 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-in-16@2x.pngbin1018 -> 854 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-in-16~dark.pngbin0 -> 457 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-in-16~dark@2x.pngbin0 -> 834 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-in-16~dark~sel.pngbin0 -> 327 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-in-16~dark~sel@2x.pngbin0 -> 627 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-in-16~sel.pngbin0 -> 327 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-in-16~sel@2x.pngbin0 -> 627 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-out-16.pngbin354 -> 467 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-out-16@2x.pngbin828 -> 836 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-out-16~dark.pngbin0 -> 451 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-out-16~dark@2x.pngbin0 -> 815 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-out-16~dark~sel.pngbin0 -> 317 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-out-16~dark~sel@2x.pngbin0 -> 619 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-out-16~sel.pngbin0 -> 317 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/icons/zoom-out-16~sel@2x.pngbin0 -> 619 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/padbar-active.9.pngbin0 -> 123 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/padbar-active@2x.9.pngbin0 -> 146 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/padbar-active~dark.9.pngbin0 -> 127 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/padbar-active~dark@2x.9.pngbin0 -> 150 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/padbar-back.9.pngbin0 -> 117 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/padbar-back@2x.9.pngbin0 -> 132 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/padbar-back~dark.9.pngbin0 -> 117 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/padbar-back~dark@2x.9.pngbin0 -> 133 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/padbar-inactive.9.pngbin0 -> 127 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/padbar-inactive@2x.9.pngbin0 -> 147 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/padbar-inactive~dark.9.pngbin0 -> 126 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/padbar-inactive~dark@2x.9.pngbin0 -> 149 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/tabbar-active.9.pngbin0 -> 494 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/tabbar-active@2x.9.pngbin0 -> 909 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/tabbar-active~dark.9.pngbin0 -> 485 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/tabbar-active~dark@2x.9.pngbin0 -> 858 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/tabbar-back.9.pngbin0 -> 117 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/tabbar-back@2x.9.pngbin0 -> 132 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/tabbar-back~dark.9.pngbin0 -> 117 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/tabbar-back~dark@2x.9.pngbin0 -> 133 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/tabbar-inactive.9.pngbin0 -> 469 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/tabbar-inactive@2x.9.pngbin0 -> 781 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/tabbar-inactive~dark.9.pngbin0 -> 444 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/resources/tabbar-inactive~dark@2x.9.pngbin0 -> 769 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/AppManifest.xft.xml82
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/EmptyClass.xft.xml2
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/EmptyEnum.xft.xml2
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/EmptyInterface.xft.xml2
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/EmptyStruct.xft.xml2
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/blank-solution.pngbin3487 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/blank-solution@2x.pngbin9980 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/console-project.pngbin3699 -> 1823 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/console-project@2x.pngbin10676 -> 4777 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/console-project~dark.pngbin0 -> 1881 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/console-project~dark@2x.pngbin0 -> 4921 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/generic-project.pngbin2375 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/generic-project@2x.pngbin7218 -> 0 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/gtk2-project.pngbin3448 -> 1877 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/gtk2-project@2x.pngbin10173 -> 4891 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/gtk2-project~dark.pngbin0 -> 1901 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/gtk2-project~dark@2x.pngbin0 -> 4939 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/library-project.pngbin4726 -> 3641 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/library-project@2x.pngbin12948 -> 9398 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/library-project~dark.pngbin0 -> 3415 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/library-project~dark@2x.pngbin0 -> 9161 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/pcl-project.pngbin4878 -> 3585 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/pcl-project@2x.pngbin13090 -> 8461 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/pcl-project~dark.pngbin0 -> 3503 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/pcl-project~dark@2x.pngbin0 -> 8436 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/project.pngbin0 -> 1434 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/project@2x.pngbin0 -> 3967 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/project~dark.pngbin0 -> 1396 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/project~dark@2x.pngbin0 -> 3951 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/shared-project.pngbin4692 -> 3618 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/shared-project@2x.pngbin12823 -> 8673 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/shared-project~dark.pngbin0 -> 3549 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/shared-project~dark@2x.pngbin0 -> 8561 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/solution.pngbin0 -> 1604 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/solution@2x.pngbin0 -> 4342 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/solution~dark.pngbin0 -> 1562 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/solution~dark@2x.pngbin0 -> 4251 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/workspace.pngbin3647 -> 1700 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/workspace@2x.pngbin10286 -> 4552 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/workspace~dark.pngbin0 -> 1647 bytes
-rw-r--r--main/src/core/MonoDevelop.Ide/templates/images/workspace~dark@2x.pngbin0 -> 4495 bytes
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/AssemblyInfo.v12.0.cs2
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/AssemblyInfo.v14.0.cs2
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/AssemblyInfo.v4.0.cs2
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/ChangeLog41
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/Main.cs2
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.csproj1
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.dotnet.v12.0.csproj8
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.dotnet.v14.0.csproj7
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.dotnet.v4.0.csproj1
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.v4.0.csproj1
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.Shared.cs173
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.cs74
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.v4.0.cs73
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ConsoleLogger.cs2
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/IBuildEngine.cs3
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ILogWriter.cs9
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/IProjectBuilder.cs7
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/LocalLogger.cs2
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/MSBuildEvaluatedItem.cs2
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/MSBuildResult.cs2
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/MSBuildTargetResult.cs2
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.Shared.cs72
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.cs40
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.v4.0.cs90
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/BuildEngine.Shared.cs320
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/IBuildEngine.cs43
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/ILogWriter.cs57
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/IProjectBuilder.cs44
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/MSBuildEvaluatedItem.cs56
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/MSBuildResult.cs69
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/MSBuildTargetResult.cs140
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/Main.cs50
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/MonoDevelop.Projects.MSBuild.Shared.projitems27
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/MonoDevelop.Projects.MSBuild.Shared.shproj13
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/ProjectBuilder.Shared.cs186
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/RemoteBuildEngineMessages.cs195
-rw-r--r--main/src/core/MonoDevelop.Startup/ChangeLog365
-rw-r--r--main/src/core/MonoDevelop.Startup/MonoDevelop.Startup.csproj37
-rw-r--r--main/src/core/MonoDevelop.Startup/MonoDevelop.exe.addins1
-rw-r--r--main/src/core/MonoDevelop.Startup/app.config8
-rw-r--r--main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/MiscActionsTest.cs22
-rw-r--r--main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/AvlTreeTests.cs285
-rw-r--r--main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/BufferTests.cs331
-rw-r--r--main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/DocumentTests.cs206
-rw-r--r--main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/HtmlWriterTests.cs10
-rw-r--r--main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/LineSplitterTests.cs15
-rw-r--r--main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/RtfWriterTests.cs6
-rw-r--r--main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/SmartIndentModeTests.cs7
-rw-r--r--main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/SyntaxHighlightingTests.cs22
-rw-r--r--main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/ViTests.cs575
-rw-r--r--main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/VirtualIndentModeTests.cs110
-rw-r--r--main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj3
-rw-r--r--main/src/tools/ChangeLog9
-rw-r--r--main/src/tools/Makefile.am2
-rw-r--r--main/src/tools/SharpCoco/ChangeLog8
-rw-r--r--main/src/tools/SharpCoco/Makefile.am22
-rw-r--r--main/src/tools/SharpCoco/readme.txt14
-rw-r--r--main/src/tools/SharpCoco/src/AssemblyInfo.cs32
-rw-r--r--main/src/tools/SharpCoco/src/Coco.atg432
-rw-r--r--main/src/tools/SharpCoco/src/Coco.cs71
-rw-r--r--main/src/tools/SharpCoco/src/DFA.cs889
-rw-r--r--main/src/tools/SharpCoco/src/Parser.cs761
-rw-r--r--main/src/tools/SharpCoco/src/Parser.frame120
-rw-r--r--main/src/tools/SharpCoco/src/ParserGen.cs430
-rw-r--r--main/src/tools/SharpCoco/src/Scanner.cs688
-rw-r--r--main/src/tools/SharpCoco/src/Scanner.frame222
-rw-r--r--main/src/tools/SharpCoco/src/Tab.cs1068
-rw-r--r--main/src/tools/SharpCoco/src/Trace.cs37
-rw-r--r--main/src/tools/mdhost/ChangeLog148
-rw-r--r--main/src/tools/mdhost/app.config6
-rw-r--r--main/src/tools/mdmonitor/ChangeLog70
-rw-r--r--main/src/tools/mdmonitor/InstrumenationChartView.cs547
-rw-r--r--main/src/tools/mdmonitor/InstrumentationChartView.cs546
-rw-r--r--main/src/tools/mdmonitor/InstrumentationViewerDialog.cs16
-rw-r--r--main/src/tools/mdmonitor/TimeLineView.cs4
-rw-r--r--main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumenationChartView.cs215
-rw-r--r--main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationChartView.cs215
-rw-r--r--main/src/tools/mdmonitor/gtk-gui/generated.cs14
-rw-r--r--main/src/tools/mdmonitor/gtk-gui/gui.stetic239
-rw-r--r--main/src/tools/mdmonitor/mdmonitor.csproj4
-rw-r--r--main/src/tools/mdtool/ChangeLog134
-rw-r--r--main/src/tools/mdtool/app.config4
-rw-r--r--main/src/tools/mdtool/mdtool.csproj23
-rw-r--r--main/src/tools/mdtool/src/mdtool.cs77
6998 files changed, 245598 insertions, 222242 deletions
diff --git a/main/src/addins/AspNet/ChangeLog b/main/src/addins/AspNet/ChangeLog
deleted file mode 100644
index 4b94c7347a..0000000000
--- a/main/src/addins/AspNet/ChangeLog
+++ /dev/null
@@ -1,3359 +0,0 @@
-2010-07-21 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.AspNet.csproj:
- * MonoDevelop.AspNet/WebTypeManager.cs:
- * MonoDevelop.AspNet/AspNetAppProject.cs: Track API changes.
-
-2010-07-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet/AspNetSyntaxMode.cs: Track API changes.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet/AspNetToolboxNode.cs:
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Track API
- changes.-
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet/AspNetToolboxNode.cs:
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Use
- TextEditorData infrastructure.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet.Gui/HtmlEditorExtension.cs:
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Track API
- changes.
-
-2010-07-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet/AspNetSyntaxMode.cs: Track API changes.
-
-2010-07-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet/AspNetSyntaxMode.cs: Changed
- highlighting.
-
-2010-07-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet/AspNetSyntaxMode.cs: Track API changes.
-
-2010-07-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Fixed 'Bug
- 621658 - Parameter hints disappear afterkeystroke'.
-
-2010-07-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.AspNet.Gui/ILanguageCompletionBuilder.cs: Worked
- on 'Bug 621658 - Parameter hints disappear afterkeystroke'.
-
-2010-07-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetSyntaxMode.cs: Added styles for
- templated regions in files, e.g. ASP.NET and T4.
-
-2010-07-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Html/HtmlParser.cs:
- * MonoDevelop.AspNet/CodeBehind.cs:
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.AspNet.Parser/AspNetParser.cs:
- * MonoDevelop.AspNet/AspNetParserService.cs:
- * MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs: Track
- ProjectDomService/Parser API.
-
- * MonoDevelop.AspNet.addin.xml: Track ProjectDomService/Parser
- API. Also, treat spark files as html.
-
-2010-07-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspProjectDom.cs: Workaround for gmcs
- bug.
-
-2010-06-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet/AspNetSyntaxMode.cs: Fixed 'Bug 611859 -
- aspx highlighting issues'.
-
-2010-06-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/AspNetExecutionHandler.cs: Track api
- changes.
-
-2010-06-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetFileDescriptionTemplate.cs: Track
- SingleFileDescription template API.
-
-2010-06-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet/AspNetSyntaxMode.cs: Fixed 'Bug 611558 -
- Phantom text in editor after typing </script>'.
-
-2010-06-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Partial
- support for HTML encoded expressions and script blocks.
-
-2010-06-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.StateEngine/AspNetDom.cs:
- * MonoDevelop.AspNet.StateEngine/AspNetExpressionState.cs: Add
- support for HTML encoded expressions in the state engine.
-
- * MonoDevelop.AspNet.StateEngine/HtmlTagState.cs:
- * MonoDevelop.AspNet.StateEngine/HtmlScriptBodyState.cs:
- Support for HTML script blocks.
-
- * Makefile.am:
- * MonoDevelop.AspNet.csproj: Added file to project.
-
-2010-06-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.AspNet.Gui/ILanguageCompletionBuilder.cs: Worked
- on ASP.NET completion.
-
-2010-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet.csproj: Don't require a specific M.A
- version.
-
-2010-05-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/CodeBehind.cs: Moved duplicate field
- elimination code into re-usable method.
-
- * MonoDevelop.AspNet.Gui/AspProjectDom.cs:
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.AspNet.Gui/ILanguageCompletionBuilder.cs: Added
- support for CodeBeside members in embedded completion.
-
- * MonoDevelop.AspNet.Parser/MemberListVisitor.cs: Collect
- locations of items.
-
-2010-05-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.AspNet.csproj:
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.AspNet/RegistrationCache.cs:
- * MonoDevelop.AspNet/ProjectRegisteredControls.cs: Change the
- file info caches so that they don't constantly stat the
- disk. Instead, they use the project file events to flush
- items.
-
-2010-05-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/ProjectRegisteredControls.cs: Fix control
- registration.
-
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Use
- directory for config search, not filename.
-
-2010-05-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Get the web.config
- name from the project. Fixes Bug 610066 - Adding a reference
- to an ASP.NET MVC project causes Web.config to be renamed
- "web.config".
-
-
-2010-05-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser/PageInfo.cs: More granular version
- of the NRE fix.
-
-2010-05-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser/PageInfo.cs: Fix an NRE.
-
-2010-05-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/WebTypeManager.cs: Cache ProjectDoms.
-
-2010-05-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.AspNet.csproj: Added AspProjectDom to project.
-
- * MonoDevelop.AspNet.Gui/ILanguageCompletionBuilder.cs:
- DocumentInfo now contains the usings, ProjectDoms, script
- region list, class name, base type.
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Only
- rebuild the DocumentInfo when we get a new
- AspNetParsedDocument, not on every keystroke. Track APIs.
-
- * MonoDevelop.AspNet.Gui/AspProjectDom.cs: Moved from
- DomWrapper in AspNetCompletion.cs.
-
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Added
- APIs for getting the usings and ProjectDoms for the
- document.
-
-2010-05-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Missed a file in
- previous commit.
-
-2010-05-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.AspNet.Gui/ILanguageCompletionBuilder.cs: Pass
- the full list of usings to the ILanguageCompletionBuilder.
-
- * MonoDevelop.AspNet/WebTypeManager.cs:
- * MonoDevelop.AspNet/ProjectRegisteredControls.cs:
- Registration cache now tracks imports and assembly
- registrations.
-
- * Makefile.am:
- * MonoDevelop.AspNet.csproj: Add Sysytem.Xml.Linq reference.
-
-2010-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Html/PathCompletion.cs:
- * MonoDevelop.AspNet/MasterContentFileDescriptionTemplate.cs:
- Fix incorrect use of ShowCustomDialog/RunCustomDialog.
-
-2010-05-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/CodeBehind.cs:
- * MonoDevelop.AspNet.Parser/MemberListVisitor.cs:
- * MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs: Fixed Bug
- 524051 - .as?x.designer.cs code generated by MonoDevelop
- includes fields already present in the main class.
-
-2010-05-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/CodeBehind.cs:
- * MonoDevelop.AspNet/WebTypeManager.cs:
- * MonoDevelop.AspNet/AspNetToolboxNode.cs:
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.AspNet.Parser/WebFormReferenceManager.cs:
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Move
- all the WebTypeManager static utility-type methods onto a
- WebTypeContext class. Reduces arguments and will make it
- easier to cache stuff.
-
-2010-05-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/WebTypeManager.cs: Added method for
- getting the IType for an HTML control.
-
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Added
- method for looking up IType of arbitrary tag.
-
-2010-05-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProjectBinding.cs: Fix creating
- ASP.NET single file projects. Fixes Bug 603521 - Command
- errors opening aspx file.
-
-2010-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Deployment/WebDeployService.cs:
- * MonoDevelop.AspNet.Deployment/WebDeployOptionsPanelWidget.cs:
- Clean up dialog placement.
-
-2010-05-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Make
- prefix generation and directive insertion APIs more
- flexible.
-
- * MonoDevelop.AspNet.Parser/PageInfo.cs: Make it possible to
- inject directives to an existing info.
-
- * Makefile.am:
- * MonoDevelop.AspNet.csproj:
- * MonoDevelop.AspNet.Parser/PageDirectiveVisitor.cs: Removed
- unneeded class.
-
- * MonoDevelop.AspNet/AspNetToolboxNode.cs: Use new
- ItextToolboxItem and DocumentReferenceManager APIs to insert
- new directives into the DOM only when the item is actually
- inserted into the editor. Fixes Bug 543721 - Auto-added
- control directives sometimes fail.
-
-2010-05-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser/PageInfo.cs:
- * MonoDevelop.AspNet.Parser/AspNetParser.cs:
- * MonoDevelop.AspNet.Parser.Dom/RootNode.cs:
- * MonoDevelop.AspNet.Parser/AspNetParsedDocument.cs: Collect
- more information from the document for C# completion.
-
-2010-05-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.AspNet.csproj:
- * MonoDevelop.AspNet/CodeBehind.cs:
- * MonoDevelop.AspNet.Parser/Document.cs:
- * MonoDevelop.AspNet.Parser/PageInfo.cs:
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.AspNet/AspNetSyntaxMode.cs:
- * MonoDevelop.AspNet/AspNetToolboxNode.cs:
- * MonoDevelop.AspNet.Parser/AspNetParser.cs:
- * MonoDevelop.AspNet.Parser.Dom/RootNode.cs:
- * MonoDevelop.AspNet/AspNetToolboxProvider.cs:
- * MonoDevelop.AspNet.Parser/PageInfoVisitor.cs:
- * MonoDevelop.AspNet.Parser/MemberListVisitor.cs:
- * MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs:
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.AspNet.Parser/AspNetParsedDocument.cs:
- * MonoDevelop.AspNet.Parser/PageDirectiveVisitor.cs:
- * MonoDevelop.AspNet.Parser/WebFormReferenceManager.cs:
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs:
- * MonoDevelop.AspNet/MasterContentFileDescriptionTemplate.cs:
- Heavy refactoring and tidying of ASP.NET parser code to
- support future changes.
-
-2010-05-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.AspNet/AspNetAppProjectConfiguration.cs: Fix Bug
- 602154 - bin/ directory not created when building ASP.Net
- Web Application template.
-
-2010-05-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Html/PathCompletion.cs:
- * MonoDevelop.Html/DocTypeCompletionData.cs:
- * MonoDevelop.AspNet.Gui/BaseHtmlEditorExtension.cs:
- * MonoDevelop.AspNet.Parser/SuggestedHandlerCompletionData.cs:
- Track API changes.
-
-2010-05-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.AspNet/AspNetExecutionHandler.cs: Fix checks to
- allow .NET 4.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Html/PathCompletion.cs:
- * MonoDevelop.Html/DocTypeCompletionData.cs:
- * MonoDevelop.AspNet.Parser/SuggestedHandlerCompletionData.cs:
- Track API changes.
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet/AspNetSyntaxMode.cs:
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Worked on
- ASP.NET highlighting.
-
-2010-04-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Worked on
- ASP.NET completion.
-
-2010-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet.Gui/ILanguageCompletionBuilder.cs:
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Worked on
- ASP.NET completion.
-
-2010-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet.Gui/ILanguageCompletionBuilder.cs: fixed
- ASP.NET completion.
-
-2010-04-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.AspNet.Gui/ILanguageCompletionBuilder.cs: Worked
- on ASP.NET completion.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.AspNet.addin.xml: Bumped MD version.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet.csproj: Remove import off mono.addins
- targets.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.AspNet.csproj:
- * MonoDevelop.AspNet.addin.xml:
- * MonoDevelop.Html/PathCompletion.cs:
- * MonoDevelop.AspNet/XspParameters.cs:
- * MonoDevelop.AspNet/WebTypeManager.cs:
- * MonoDevelop.Html/HtmlSchemaService.cs:
- * MonoDevelop.AspNet.Parser/Document.cs:
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.AspNet.Parser/Directive.cs:
- * MonoDevelop.AspNet/AspNetToolboxNode.cs:
- * MonoDevelop.AspNet.Gui/BrowserLauncher.cs:
- * MonoDevelop.AspNet.Gui/XspOptionsPanel.cs:
- * MonoDevelop.Html/DocTypeCompletionData.cs:
- * MonoDevelop.AspNet.Completion/SimpleLists.cs:
- * MonoDevelop.Html/HtmlCompletionDataProvider.cs:
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.AspNet.Gui/BaseHtmlEditorExtension.cs:
- * MonoDevelop.AspNet.Deployment/WebDeployService.cs:
- * MonoDevelop.AspNet.Deployment/WebDeployCommands.cs:
- * MonoDevelop.AspNet.Gui/AspNetConfigurationPanel.cs:
- * MonoDevelop.AspNet/AspNetAppProjectConfiguration.cs:
- * MonoDevelop.AspNet.Gui/ILanguageCompletionBuilder.cs:
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs:
- * MonoDevelop.AspNet.Deployment/WebDeployLaunchDialog.cs:
- * MonoDevelop.AspNet.Deployment/WebDeployOptionsPanel.cs:
- * MonoDevelop.AspNet/ProjectFolderNodeBuilderExtension.cs:
- * MonoDevelop.AspNet/MasterContentFileDescriptionTemplate.cs:
- * MonoDevelop.AspNet.Parser/SuggestedHandlerCompletionData.cs:
- Merged MD.Projects into MD.Core, and MD.Projects.Gui,
- MD.Core.Gui and MD.Components into MD.Ide.
-
-2010-03-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser/Directive.cs:
- * MonoDevelop.AspNet.Deployment/AspNetDeployServiceExtension.cs:
- Track ProjectFile Link API.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Html/PathCompletion.cs:
- * MonoDevelop.Html/DocTypeCompletionData.cs:
- * MonoDevelop.AspNet.Parser/SuggestedHandlerCompletionData.cs:
- Track api changes.
-
-2010-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet.addin.xml: Added some conditions to avoid
- early loading of extensions.
-
- * MonoDevelop.AspNet.Gui/HtmlEditorExtension.cs:
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: File
- extensions are now declared in the node metadata.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.AspNet.Gui.XspOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.AspNet.Deployment.WebTargetEditor.cs:
- * gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployTargetEditor.cs:
- * gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployLaunchDialog.cs:
- * gtk-gui/MonoDevelop.AspNet.Gui.AspNetConfigurationPanelWidget.cs:
- * gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployOptionsPanelWidget.cs:
- Flush.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/AspNetMSBuildImportProvider.cs: Track api
- changes.
-
-2010-01-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Html/PathCompletion.cs:
- * MonoDevelop.Html/DocTypeCompletionData.cs:
- * MonoDevelop.AspNet.Parser/SuggestedHandlerCompletionData.cs:
- Track API changes.
-
-2010-01-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs: Implement
- the new SupportsItem method.
-
-2010-01-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet/LineInterceptingTextWriter.cs: fixed
- possible null ref.
-
-2010-01-07 mkrueger <${AuthorEmail}>
-
- * MonoDevelop.AspNet/LineInterceptingTextWriter.cs: Fixed null
- reference exception.
-
-2009-12-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetExecutionHandler.cs: Use "xsp1" not
- "xsp", but include a fallback so that it still works without
- wrapper scripts, as xsp1 is xsp.exe.
-
-2009-12-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.AspNet.csproj:
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.AspNet/LineInterceptingTextWriter.cs: Move the
- LineInterceptingTextWriter to another file and make it
- public. Implement proper support for crlf.
-
-2009-12-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Scan a few more
- output lines to check whether xsp has started.
-
-2009-12-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.AspNet.Gui/BrowserLauncher.cs: Scan xsp output
- for "Listening on port: " to detect when it's started,
- instead of polling the server.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Deployment/WebDeployService.cs: Name
- threads to make debugging easier.
-
-2009-12-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.AspNet.Gui/ILanguageCompletionBuilder.cs: Worked
- on ASP.NET code completion.
-
-2009-12-01 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.AspNet.csproj:
- * MonoDevelop.AspNet.addin.xml:
- * MonoDevelop.AspNet.Parser.Dom/RootNode.cs:
- * MonoDevelop.AspNet.Parser.Dom/ExpressionNode.cs:
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.AspNet.Gui/ILanguageCompletionBuilder.cs: Worked
- on ASP.NET code completion.
-
-2009-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs:
- * MonoDevelop.AspNet.Deployment/WebDeployService.cs:
- * MonoDevelop.AspNet.Deployment/AspNetDeployServiceExtension.cs:
- Introduced the ConfigurationSelector class to all methods
- that previously took a configuration name as string. This
- eliminates the ambiguity between solution configuration
- names and project configuration names.
-
-2009-11-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Track API. Set
- UserAssemblyPaths. Get correct configuration.
-
- * MonoDevelop.AspNet/AspNetExecutionCommand.cs: Add property
- for list of user assemblies.
-
-2009-11-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Fix bad
- flags manipulation. Fixes Bug 556514 - asp.net Autogenerated
- function are not public.
-
-2009-11-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/CodeBehind.cs: Strip the implicit
- namespace from the generated compilation unit. Required for
- VB.
-
-2009-11-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProjectConfiguration.cs:
- Simplify creation of new ASP.NET MVC configurations.
-
-2009-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.csproj: Wire the soft debug addin into
- the build.
-
-2009-10-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/BrowserLauncher.cs: Fake a
- IProcessAsyncOperation so that is can be returned from an
- execution handler.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.AspNet.addin.xml: Bump MD version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.AspNet.Gui.XspOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.AspNet.Deployment.WebTargetEditor.cs:
- * gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployTargetEditor.cs:
- * gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployLaunchDialog.cs:
- * gtk-gui/MonoDevelop.AspNet.Gui.AspNetConfigurationPanelWidget.cs:
- * gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployOptionsPanelWidget.cs:
- Flush.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Track
- namespace renamings.
-
-2009-10-08 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.AspNet.csproj: Mark *-sharp references,
- with SpecificVersion=false. Import md.targets .
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.AspNet.addin.xml: Bump MD version.
-
-2009-10-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.AspNet.csproj: Update.
-
- * MonoDevelop.Html/PathCompletion.cs: Creates completion lists
- for picking file paths.
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.AspNet.Gui/BaseHtmlEditorExtension.cs: Tweak API
- so classes can return completion lists instead of modifying
- one they're given.
-
- * MonoDevelop.AspNet.Parser/Directive.cs: Complete paths for
- register src and for masterpagefile. Finally fix the
- register directive attribute completion too.
-
-2009-10-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.Html/DocTypeCompletionData.cs:
- * MonoDevelop.AspNet/ProjectRegisteredControls.cs:
- * MonoDevelop.AspNet.Parser/WebFormReferenceManager.cs: Use
- ordinal string compares where appropriate.
-
-2009-10-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Take
- tag name into account when resolving type from control
- registration directives. Only compare prefix once per
- directive, and use case-insensitive ordinal comparisons.
- Fixes bug #543727.
-
-2009-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/WebTypeManager.cs:
- * MonoDevelop.AspNet/AspNetAppProject.cs: Resolve user
- controls from referenced projects. Fixes "Bug 519651 -
- Custom Controls cannot be registered in ASP.NET pages".
-
-2009-09-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployLaunchDialog.cs:
- Enable horizontal scroll so the dialog doesn't get
- oversized.
-
-2009-09-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Tidy up a
- few things, and fix some FIXMEs.
-
-2009-09-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/CodeBehind.cs:
- * MonoDevelop.AspNet/AspNetAppProject.cs: Add a cache for
- codebehind type names.
-
- * MonoDevelop.AspNet/ProjectRegisteredControls.cs: Factor out
- FileInfoCache from the control registration cache, so we can
- use it for a type name cache.
-
- * MonoDevelop.AspNet/WebTypeManager.cs: Type UserControls with
- the type of this CodeBehind, if it can be looked up.
-
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Fix a
- couple of small bugs in UserControl type lookups.
-
-2009-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Found a better way
- of removing the encoding declaration from the header.
-
-2009-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Omit the xml
- declaration when saving the .config file, because it is
- declaring the utf-16 encoding, which wrong when saving the
- content to a utf-8 file. Fixes bug #537846 - Editing
- .aspx-files throws 'Error in text editor extension
- chain'-exception.
-
-2009-09-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet\AspNetExecutionHandler.cs: Set DEVPATH to
- the path of xsp. Required on Windows, so that .NET can find
- Mono.Web.
-
- * MonoDevelop.AspNet\AspNetAppProject.cs: Moved the XSP check
- to the execution handler.
-
-2009-09-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Html/DocTypeCompletionData.cs:
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.AspNet.Parser/SuggestedHandlerCompletionData.cs:
- Track API changes.
-
-2009-09-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet.csproj: Don't require a specific version
- for Mono.Addins.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.AspNet/AspNetExecutionCommand.cs:
- * MonoDevelop.AspNet/AspNetExecutionHandler.cs: Run xsp on the
- correct target runtime. Support using a bundled xsp if it
- doesn't exist in the target runtime.
-
-2009-08-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.AspNet.csproj:
- * MonoDevelop.AspNet.addin.xml:
- * MonoDevelop.AspNet/AspNetMSBuildImportProvider.cs: Use the
- new extension point for generating msbuild imports.
-
-2009-08-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/WebTypeManager.cs:
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.AspNet/AspNetToolboxLoader.cs:
- * MonoDevelop.AspNet/AspNetToolboxProvider.cs: Use the new
- AssemblyContext class to query and resolve assemblies.
-
-2009-08-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.csproj: Include the ASP.NET MVC and
- TextTemplating addins in the main solution and build.
-
-2009-08-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.csproj: Don't local-copy project references.
-
-2009-08-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProjectConfiguration.cs:
- Override and implement CopyFrom. Should allow the config
- editing panel to store values.
-
-2009-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.csproj: Don't local copy assemblies.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.AspNet.Gui.AspNetConfigurationPanelWidget.cs:
- Flush.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployTargetEditor.cs:
- * gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployLaunchDialog.cs:
- Flush.
-
-2009-07-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetConfigurationPanel.cs:
- * MonoDevelop.AspNet.Gui/AspNetConfigurationPanelWidget.cs:
- Remove unnecessary field.
-
-2009-07-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * AspNetAddIn.csproj:
- * MonoDevelop.AspNet.Gui/AspNetFileSelector.cs:
- * gtk-gui/MonoDevelop.AspNet.Gui.AspNetFileSelector.cs:
- * MonoDevelop.AspNet/MasterContentFileDescriptionTemplate.cs:
- Move AspNetFileSelector to
- MonoDevelop.Project.Gui.Dialogs.ProjectFileSelectorDialog.
-
-2009-07-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProjectBinding.cs: Track api
- changes. Patch by Viktoria Dudka.
-
-2009-07-17 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * AspNetAddIn.csproj: Fixed build.
-
-2009-07-16 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * AspNetAddIn.csproj:
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Started to
- work on ASP.NET code completion.
-
-2009-07-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet/AspNetSyntaxMode.cs: Worked on
- highlighting support for code blocks.
-
-2009-07-14 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * AspNetAddIn.csproj:
- * MonoDevelop.AspNet.addin.xml:
- * MonoDevelop.AspNet/AspNetSyntaxMode.cs: Added ASP.NET C#
- region syntax highlighting.
-
-2009-07-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Properly map the
- configuration name to a configuration.
-
-2009-07-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Templates/WebForm-Empty.xft.xml:
- * Templates/WebApplication.xpt.xml:
- * Templates/MasterPage-Empty.xft.xml:
- * Templates/WebForm-CodeBehind.xft.xml:
- * Templates/MasterPage-CodeBehind.xft.xml:
- * Templates/WebForm-CodeBehindNonPartial.xft.xml:
- * Templates/MasterPage-CodeBehindNonPartial.xft.xml: Make head
- tag into server tag so that theming works. Patch from
- Alfredo De Vito.
-
-2009-07-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/CodeBehind.cs: Move CodeBehindWriter from
- MonoDevelop.AspNet to MonoDevelop.DesignerSupport.
-
-2009-06-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/AspNetToolboxNode.cs:
- * MonoDevelop.AspNet.Gui/BrowserLauncher.cs:
- * MonoDevelop.AspNet.Gui/AspNetFileSelector.cs: Use the new
- DesktopService instead of PlatformService.
-
-2009-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/WebTypeManager.cs: Track assembly lookup
- APIs. Fix bad logic that could cause NRE.
-
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.AspNet/AspNetToolboxLoader.cs:
- * MonoDevelop.AspNet/AspNetToolboxProvider.cs: Track assembly
- lookup APIs.
-
-2009-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/AspNetFileDescriptionTemplate.cs:
- * MonoDevelop.AspNet/MasterContentFileDescriptionTemplate.cs:
- Track api changes.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet\CodeBehind.cs:
- * MonoDevelop.AspNet\AspNetAppProject.cs:
- * MonoDevelop.AspNet.Gui\AspNetFileSelector.cs:
- * MonoDevelop.AspNet\ProjectFolderNodeBuilderExtension.cs: Use
- the new FilePath class for handling file and directory
- paths.
-
-2009-04-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.AspNet/AspNetExecutionCommand.cs: Added
- TargetRuntime parameter to AspNetExecutionComand.
-
-2009-04-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet/AspNetFileDescriptionTemplate.cs: Track
- API changes.
-
-2009-04-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/CodeBehind.cs: Notify fileservice when a
- file that isn't open has been changed. Fixes "Bug 496278 -
- C# completion doesn't update when designer codebehind is
- updated".
-
-2009-04-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Templates/WebContentForm-CodeBehind.xft.xml: Fix the
- DependsOn value. Thanks to Dax@daxxfiles.net for the patch.
-
-2009-04-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * AspNetAddIn.csproj:
- * MonoDevelop.AspNet.addin.xml:
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.AspNet/AspNetExecutionHandler.cs:
- * MonoDevelop.AspNet/AspNetExecutionCommand.cs: Use an
- IExecutionHandler and an ExecutionCommand to handle the
- execution of asp.net projects. This will allow supporting
- special execution modes such as debug or profile.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetFileSelector.cs: Renamed
- PixbufService to ImageService.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetFileSelector.cs: Track API
- changes.
-
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * AspNetAddin.csproj: don't require specific gtk-sharp version.
-
-2009-04-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetFileSelector.cs: Removed icon
- service.
-
-2009-04-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/WebTypeManager.cs:
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.AspNet/AspNetToolboxNode.cs:
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Moved
- SystemAssemblyService and related classes to the namespace
- MonoDevelop.Core.Assemblies.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.AspNet.addin.xml: Bump MD version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/WebTypeManager.cs:
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.AspNet/AspNetToolboxNode.cs:
- * MonoDevelop.AspNet/AspNetToolboxLoader.cs:
- * MonoDevelop.AspNet/AspNetToolboxProvider.cs:
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Track
- api changes to support multiple target runtimes.
-
-2009-04-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/MasterContentFileDescriptionTemplate.cs:
- Add a using.
-
-2009-03-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Fix output directory
- for newly created projects, since DotNetProject changes it
- during project creation.
-
-2009-03-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Html/HtmlParser.cs:
- * MonoDevelop.AspNet.Parser/AspNetParser.cs:
- * MonoDevelop.AspNet/MasterContentFileDescriptionTemplate.cs:
- Track API changes.
-
-2009-03-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Migrate bad output
- directories from MD1 format. Set proper output directory for
- new configurations.
-
- * MonoDevelop.AspNet/AspNetAppProjectConfiguration.cs: Remove
- output directory hacks.
-
-2009-03-13 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.AspNet.Deployment.WebTargetEditor.cs:
- Making some strings not translatable.
-
-2009-03-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/CodeBehind.cs: Work around text editor
- bug (#484574) that caused modifications to open files not to
- be saved. Only try to save files that we've modified.
-
- * MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs: Force type
- database to update during build. Fixes "Bug 484122 -
- [Regression] Default C# Asp.Net template fails to compile".
- Remove dead code.
-
-2009-03-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetFileSelector.cs: Show
- directories that contain project files, even if the
- directories aren't explicitly in the project. Don't
- duplicate directories that have children that are explictly
- in the project.
-
-2009-03-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Don't crash
- on documents without doctypes. Better root element
- completion for web controls and master children.
-
-2009-03-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.AspNet.Gui/BaseHtmlEditorExtension.cs: Track
- doctype parsing changes. Fix jumping to selections.
-
-2009-03-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Changed the way
- execution handlers work. We are not using platform ids
- anymore. Instead, we use command strings when looking for
- execution handlers. IExecutionHandlerFactory has been
- removed and now everything is handled by IExecutionHandler,
- which has a new CanExecute method. This model is more simple
- and more generic.
-
-2009-02-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/ProjectFolderNodeBuilderExtension.cs:
- Save the project after adding a special folder.
-
-2009-02-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/ProjectFolderNodeBuilderExtension.cs:
- More efficient query for existing folders. Attach node
- builder to more limited range of node types. Show special
- folders even if they exist in the project, or users might
- get confused when the menu vanishes.
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Slim down the list
- of special folders to ones for web apps rather than sites.
- Make virtual.
-
- * MonoDevelop.AspNet.addin.xml: Remove unused attribute.
-
-2009-02-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/CodeBehind.cs:
- * MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs: Move
- codebehind generation code from VerifyCodeBehindBuildStep to
- CodeBehind and refactor it into something more re-usable.
-
-2009-02-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Fix swapped
- parameters in ResolveVirtualPath.
-
- * MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs: Generate
- strongly typed master accessor property if the MasterType
- directive is present.
-
-2009-02-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser/PageInfo.cs: More properties in
- ToString.
-
- * MonoDevelop.AspNet.Parser/PageInfoVisitor.cs: Ignore case of
- MasterType directive.
-
-2009-02-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * Templates/WebContentForm.xft.xml:
- * Templates/NestedMasterPage.xft.xml:
- * Templates/WebContentForm-CodeBehind.xft.xml:
- * Templates/NestedMasterPage-CodeBehind.xft.xml: Fix
- MasterPageFile attribute name.
-
-2009-02-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser/Directive.cs: Add completion for
- MasterType directive.
-
-2009-02-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetFileSelector.cs: Diplay project
- tree and its icons correctly.
-
-2009-02-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/MasterContentFileDescriptionTemplate.cs:
- Add new template type that allows user to pick a master page
- and stubs out content regions.
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * AspNetAddIn.csproj:
- * MonoDevelop.AspNet.addin.xml: Updated.
-
- * Templates/MasterPage-Empty.xft.xml:
- * Templates/MasterPage-CodeBehind.xft.xml:
- * Templates/MasterPage-CodeBehindNonPartial.xft.xml: Correct
- names.
-
- * Templates/WebContentForm.xft.xml:
- * Templates/NestedMasterPage.xft.xml:
- * Templates/WebContentForm-CodeBehind.xft.xml:
- * Templates/NestedMasterPage-CodeBehind.xft.xml: New
- templates.
-
- * MonoDevelop.AspNet.Gui/AspNetFileSelector.cs:
- * gtk-gui/MonoDevelop.AspNet.Gui.AspNetFileSelector.cs: Added
- a UI for picking a master page.
-
- * MonoDevelop.AspNet.Parser/ContentPlaceHolderVisitor.cs: A
- visitor for finding the contentplaceholder ids of a master
- page.
-
-2009-02-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Add methods for
- handling virtual paths.
-
- * MonoDevelop.AspNet.Parser/PageInfo.cs:
- * MonoDevelop.AspNet.Parser/PageInfoVisitor.cs: Capture
- MasterPageType info.
-
-2009-02-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet.addin.xml: Track merge of the project pad
- context menu.
-
-2009-02-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetFileDescriptionTemplate.cs: Track
- API.
-
-2009-02-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Add an attempt at
- resolving assemblies from bin.
-
-2009-02-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/WebTypeManager.cs:
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Track
- assembly database API behaviour. Improve assembly resolution
- error handling. Fixes "Bug 477476 - Template for ASP.Net Web
- Application doesn't work by default." and restores ASP.NET
- code completion and codebehind generation.
-
-2009-02-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/HtmlEditorExtension.cs:
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Track API.
-
-2009-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * AspNetAddIn.csproj: Copy schemas to output directory.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Remove
- unnecessary "base" instance access, as csc doesn't like it.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.mdp:
- * AspNetAddIn.csproj: Migrated to MSBuild file format.
-
-2009-02-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Track
- BindingService API.
-
-2009-02-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Allow
- forced completion for fields/properties in expressions.
-
- * MonoDevelop.AspNet.StateEngine/AspNetFreeState.cs: Add
- rollback so that expressions can be differentiated. Fixes
- field/property completion in expressions.
-
-2009-02-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser/SuggestedHandlerCompletionData.cs:
- Track BindingService API. Fixes event completion bugs.
-
-2009-02-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/WebTypeManager.cs:
- * MonoDevelop.AspNet/ProjectRegisteredControls.cs:
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs:
- Implement full type lookup and listing mechanisms for
- controls registered in web.config. Enables full code
- completion for these controls. Fixes "Bug 470488 - Controls
- registered in web.config do not have code completion".
-
-2009-02-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Add a
- ControlRegistrationCache to the project to cache web.config
- control registrations.
-
- * MonoDevelop.AspNet/ProjectRegisteredControls.cs: Use a
- custom class for encapsulating registration info instead of
- TagPrefixInfo, so we can attach extra data.
-
- * MonoDevelop.AspNet/WebTypeManager.cs: Use project's
- ControlRegistrationCache for type lookups.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.AspNet.addin.xml: Bump MD version.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.AspNet.Gui.XspOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.AspNet.Deployment.WebTargetEditor.cs:
- * gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployTargetEditor.cs:
- * gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployLaunchDialog.cs:
- * gtk-gui/MonoDevelop.AspNet.Gui.AspNetConfigurationPanelWidget.cs:
- *
- gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployOptionsPanelWidget.cs:
- Flush.
-
-2009-01-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetFileDescriptionTemplate.cs: Propagate a
- policy parent SolutionItem through project/file creation so that
- policies can always be resolved correctly.
-
-2009-01-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * AspNetAddIn.mdp:
- * MonoDevelop.AspNet/ProjectRegisteredControls.cs: Add a class to load
- and cache control registrations from web.config files. It's intended
- to be bound to the AspNetAppProject, for documents to look to for
- completion and resolving types.
-
-2009-01-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/WebTypeManager.cs: Don't pass a null
- TargetFramework to SystemAssemblySevice, or it explodes. Propagate
- project info to the web.config handler so that it can resolve
- assemblies with the correct TargetFramework.
-
-2009-01-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: If the
- special-casing of the asp prefix to System.Web.dll fails to resolve
- the type, do a full lookup. Fixes the asp prefix with other controls,
- as is common with e.g. System.Web.Extensions.
-
-2009-01-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser/MemberListVisitor.cs: Log type resolution
- errors to the document's error list.
-
- * MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs: Make sure the
- member list is initialised before outputting errors, so that type
- resolution errors show up in the error pad. Treat them as warnings
- until we can be 100% sure that they're not mistakes on MD's part.
-
-2009-01-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Execute xsp in the project's
- BaseDirectory, not the SourceDirectory, since the bin directory is
- already assumed to be in BaseDirectory, and SourceDirectory seems to
- be obsolete. Fixes running ASP.NET csproj projects in certain
- circumstances.
-
-2009-01-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/BaseHtmlEditorExtension.cs: Remove closing tag
- completion as the base class handles it now.
-
-2009-01-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.AspNet/AspNetAppProjectBinding.cs:
- * MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs:
- * MonoDevelop.AspNet.Parser/AspNetParsedDocument.cs:
- * MonoDevelop.AspNet.MD1Serialization/MD1AspNetCustomDataItem.cs: Track
- DetermineWebSubtype API.
-
- * Templates/WebForm-Empty.xft.xml:
- * Templates/WebApplication.xpt.xml:
- * Templates/WebControl-Empty.xft.xml:
- * Templates/WebHandler-Empty.xft.xml:
- * Templates/GlobalAsax-Empty.xft.xml:
- * Templates/WebService-Empty.xft.xml:
- * Templates/MasterPage-Empty.xft.xml:
- * Templates/WebConfig-SubDir.xft.xml:
- * Templates/WebForm-CodeBehind.xft.xml:
- * Templates/WebConfig-Application.xft.xml:
- * Templates/MasterPage-CodeBehind.xft.xml:
- * Templates/WebHandler-CodeBehind.xft.xml:
- * Templates/WebService-CodeBehind.xft.xml:
- * Templates/GlobalAsax-CodeBehind.xft.xml:
- * Templates/WebControl-CodeBehind.xft.xml:
- * Templates/WebForm-CodeBehindNonPartial.xft.xml:
- * Templates/MasterPage-CodeBehindNonPartial.xft.xml:
- * Templates/WebControl-CodeBehindNonPartial.xft.xml: Don't explicitly
- set a build action, since it was wrong for MSBuild files, and the
- default works fine.
-
-2009-01-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Deployment/AspNetDeployServiceExtension.cs: Deploy
- all files marked as "Content" rather than all ASP.NET files.
-
-2009-01-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Add JavaScript to WebSubType.
-
-2009-01-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Add css, xhtml, html, htm to
- the WebSubTypes enum. This means that their default build action is
- "Content", so they get deployed by default. Should fix "Bug 466855 -
- CSS files in App_Themes/theme_name/ are not deployed".
-
-2009-01-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Don't try to update web.config
- when references are removed during project loading. Fixes "Bug 465852
- - MonoDevelop 2.0 (trunk) does not load ASP.NET projects from 1.0."
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.mdp: All projects now require fx 3.5.
-
-2008-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/WebTypeManager.cs:
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.AspNet/AspNetToolboxNode.cs:
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Track API
- changes.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.mdp: Don't require a specific version of Mono.Addins.
-
-2008-12-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Ignore
- PersistChildrenAttribute, as it does more harm than good. It's
- essentially the opposite of ParseChildrenAttribute, but it's often
- incorrectly set, whereas ParseChildrenAttribute is almost invariably
- correct. Also, assume that any property tagged with a
- TemplateContainerAttribute has an InnerProperty persistence mode.
-
-2008-12-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Add TODO markers for
- ParseChildrenAttribute.ChildControlType support.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Implemented CanExecute.
-
- * MonoDevelop.AspNet.Gui/BrowserLauncher.cs: Track api changes.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Make it work for parallel build.
-
-2008-12-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.addin.xml: Set correct packing for Web deployment
- panel.
-
-2008-12-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.addin.xml: Move options panels to more appropriate
- categories.
-
- * gtk-gui/gui.stetic: Flush.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * AspNetAddIn.mdp:
- * AssemblyInfo.cs: Add AssemblyInfo.cs files that are autogenerated from
- the addin manifests.
-
-2008-11-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Use
- DocumentationService to look up class documentation lazily.
-
-2008-11-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: If project's CompileTarget
- isn't "Library", automatically fix it, since older versions of MD did
- not set it correctly.
-
-2008-11-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Html/HtmlParser.cs: Implement multiple root element
- validation since parser no longer handles this.
-
-2008-11-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Improve accuracy of
- completions for controls' children. Add support for completing
- properties' childen.
-
- * MonoDevelop.AspNet/WebTypeManager.cs:
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Extend lookup
- methods to be able to look for types other than Control.
-
-2008-11-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.StateEngine/HtmlTagState.cs: Improve error location
- precision for implicitly self-closing tags.
-
-2008-11-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Improve element
- completion.
-
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Make
- AspTagCompletionData public.
-
- * MonoDevelop.AspNet.Gui/BaseHtmlEditorExtension.cs: Expose methods to
- subclass.
-
-2008-11-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Use ASP.NET
- serialisation attributes to improve completion. Display properties as
- children when appropriate; don't display properties as attributes or
- controls as children when inappropriate.
-
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Add a shortcut
- for HTML controls.
-
-2008-11-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * Templates/WebApplication.xpt.xml: Fix case of asp:button.
-
- * MonoDevelop.AspNet/WebTypeManager.cs: Make sure all type name lookups
- are case insensitive (seems that MonoDevelop's defaults changed).
- Fixes Bug 445850 - [Regression] The C# Asp Web application template
- fails to compile .
-
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Trivial 1.1 to
- 2.0 API update.
-
-2008-11-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.StateEngine/HtmlTagState.cs:
- * MonoDevelop.AspNet.StateEngine/HtmlClosingTagState.cs: Implement new
- parser states that handle implicit tag closing for HTML.
-
- * Makefile.am:
- * AspNetAddIn.mdp: Updated.
-
- * MonoDevelop.Html/HtmlParser.cs:
- * MonoDevelop.AspNet.Gui/BaseHtmlEditorExtension.cs:
- * MonoDevelop.AspNet.StateEngine/AspNetFreeState.cs: Use the new HTML
- parsing states.
-
- * MonoDevelop.Html/ElementTypes.cs: Lookups to determine if an HTML tags
- is block/inline/empty/paragraph.
-
-2008-11-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/BaseHtmlEditorExtension.cs: Flag schema for
- update when doctype changes.
-
-2008-11-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/WebTypeManager.cs: Use project to resolve target
- .NET version for assemblies.
-
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Resolve types
- of items from register directives. Lazy-load descriptions.
-
-2008-11-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/WebTypeManager.cs:
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Include
- controls referenced by Register directives when listing tags.
-
-2008-11-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.addin.xml: Specify position for build step.
-
- * MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs: Enable designer class
- updating for UserControls and MasterPages.
-
-2008-11-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/BaseHtmlEditorExtension.cs: Split out the HTML
- editor extension. Add document outlining.
-
- * Makefile.am:
- * AspNetAddIn.mdp: Updated.
-
- * MonoDevelop.AspNet.addin.xml:
- * MonoDevelop.Html/HtmlParser.cs: Added an HTML parser.
-
- * MonoDevelop.AspNet.Gui/HtmlEditorExtension.cs: Split out the HTML
- editor extension. Add document outlining. Mostly extracted from
- Moonlight addin.
-
-2008-11-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * AspNetAddIn.mdp:
- * MonoDevelop.AspNet.Gui/HtmlTextEditorExtension.cs:
- * MonoDevelop.AspNet.Gui/BaseHtmlEditorExtension.cs: Renamed file.
-
-2008-11-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.AspNet.Gui/HtmlTextEditorExtension.cs: Move re-usable HTML
- editing into base class in preparation for other changes.
-
-2008-11-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/HtmlTextEditorExtension.cs: Tidy up
- doctype->schema resolution code, and only try to resolve doctype when
- it changes. Use case-insensitive completion.
-
-2008-11-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Track fix in text
- editor's completion line/col indexing. It's now 1-indexed, as it
- should be. Fix attribute value type resolution fallback.
-
- * MonoDevelop.AspNet.Parser/Document.cs: Comment out some noisy debug
- code.
-
-2008-11-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Use new API; move default
- build action code into GetDefaultBuildAction override.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet.addin.xml: Bump MD version.
-
-2008-11-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Override new
- IsLibraryBasedProjectType property, consolidating code in base class.
-
-2008-11-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Set CompileTarget to library
- on base class, not just overriding the values on the property. Fixes
- Bug 436275 - MD ASP.Net project does not build in VS2005.
-
-2008-11-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Track MD core API to re-enable
- running of ASP.NET projects.
-
-2008-10-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet.addin.xml: fixed 'Bug 399737 - Code completion
- busted for referenced assemblies that are not in GAC, are outside of
- the solution, and which are referenced by other non-GAC outside
- referenced assemblies'.
-
-2008-10-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Fix directive name
- completion triggering.
-
-2008-10-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.StateEngine/AspNetDom.cs:
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.AspNet.StateEngine/AspNetDirectiveState.cs:
- * MonoDevelop.AspNet.StateEngine/AspNetExpressionState.cs:
- * MonoDevelop.AspNet.StateEngine/AspNetServerCommentState.cs: Changed
- Xml StateEngine from offset-based positions to line/column positions.
-
-2008-10-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Better default build action
- for auto-added codebehind files.
-
-2008-10-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/CodeBehind.cs:
- * MonoDevelop.AspNet/AspNetAppProject.cs:
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Moved
- codebehind/designer lookup functionality to
- MonoDevelop.DesignerSupport.
-
-2008-10-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Add simple
- field/property completions in render and databinding expressions.
-
-2008-10-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Finally fix event
- handler completion with the new MD Code DOM.
-
-2008-10-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * AspNetAddIn.mdp: Updated.
-
- * MonoDevelop.AspNet.addin.xml: Enable HtmlEditorExtension for HTML
- completion.
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.AspNet.Gui/HtmlTextEditorExtension.cs: Refactor HTML
- completion from AspNetEditorExtension into an HtmlEditorExtension
- base class.
-
-2008-10-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Completion/SimpleLists.cs: Remove unused methods.
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Move code to base
- class. Implement more directive completions.
-
- * MonoDevelop.AspNet.Parser/Directive.cs: Change API to alter lists
- instead of creating them.
-
-2008-10-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Move more into the
- base class. Implement directive name completion.
-
- * MonoDevelop.AspNet.Parser/Directive.cs: Remove unused parameters.
-
-2008-10-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser.Internal/AspParser.cs: Improve error
- reporting.
-
-2008-10-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Track API. Work
- around some bugs in directive completion until they're fixed
- properly.
-
- * Makefile.am:
- * AspNetAddIn.mdp: Updated.
-
- * MonoDevelop.AspNet.Completion/SimpleLists.cs: Add utility methods for
- simple completion lists with default values.
-
- * MonoDevelop.AspNet.Parser/Directive.cs: Add attribute completion for
- all directives. Some work towards completing directive names and
- values.
-
- * MonoDevelop.AspNet.Parser/AspNetParsedDocument.cs: Add a WebSubType
- property.
-
-2008-10-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser/Directive.cs: Add more attributes.
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Remove code that's
- moved to base class.
-
-2008-10-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser/Directive.cs:
- * MonoDevelop.Html/HtmlCompletionDataProvider.cs:
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.Html/DocTypeCompletionDataProvider.cs: Track APIs.
-
- * Makefile.am:
- * AspNetAddIn.mdp: Updated.
-
-2008-10-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Html/DocTypeCompletionData.cs:
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs:
- * MonoDevelop.AspNet.Parser/SuggestedHandlerCompletionData.cs: Track
- CompletionData API.
-
-2008-10-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser/Directive.cs: Track API.
-
- * Makefile.am:
- * AspNetAddIn.mdp: Updated.
-
- * MonoDevelop.AspNet.Parser/SimpleCompletionData.cs: Moved to
- MonoDevelop.Projects.Gui.
-
- * MonoDevelop.AspNet.Parser/AspNetCompilationUnit.cs: Not needed;
- deleted.
-
-2008-10-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Html/DocTypeCompletionData.cs:
- * MonoDevelop.AspNet.Parser/SimpleCompletionData.cs:
- * MonoDevelop.AspNet.Parser/SuggestedHandlerCompletionData.cs: Track
- API.
-
-2008-10-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Moved lots of code
- down to the BaseXmlEditorExtension.
- * AspNetAddIn.mdp, Makefile.am: Updated.
- * MonoDevelop.AspNet.Parser/AspNetParsedDocument.cs: Renamed. Add
- NonSerializable flag.
-
-2008-10-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs,
- MonoDevelop.AspNet.Parser/SimpleCompletionData.cs,
- MonoDevelop.AspNet.Parser/Directive.cs: Enable some simple
- completion for directive attributes.
-
-2008-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Track API.
- * MonoDevelop.AspNet.addin.xml, MonoDevelop.AspNet.MD1Serialization,
- MonoDevelop.AspNet.MD1Serialization/MD1AspNetCustomDataItem.cs,
- MonoDevelop.AspNet.MD1Serialization/md1format.xml,
- MonoDevelop.AspNet.Deployment/WebDeployService.cs,
- MonoDevelop.AspNet.Deployment/WebDeployResolver.cs,
- MonoDevelop.AspNet.Deployment/AspNetDeployServiceExtension.cs,
- AspNetAddIn.mdp, Makefile.am: Integrate deployment with the
- deployment service chnages; makes it much cleaner. Track "arbitrary
- build action" API changes; this improves compatibility with VS Web
- Apps.
-
-2008-09-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Html/DocTypeCompletionData.cs,
- MonoDevelop.AspNet.Parser/SuggestedHandlerCompletionData.cs,
- MonoDevelop.AspNet.Parser/SimpleCompletionData.cs: Implemented
- IComparable <ICompletionData>.
-
-2008-09-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs,
- MonoDevelop.AspNet.Parser/AspNetCompilationUnit.cs,
- MonoDevelop.AspNet.Parser/AspNetParser.cs,
- MonoDevelop.AspNet.Parser/CompilationUnitVisitor.cs,
- MonoDevelop.AspNet/AspNetParserService.cs,
- MonoDevelop.AspNet/AspNetToolboxNode.cs,
- MonoDevelop.AspNet/CodeBehind.cs,
- MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs: Track API.
-
-2008-09-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser/CompilationUnitVisitor.cs: Track API.
-
-2008-09-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Html/HtmlCompletionDataProvider.cs,
- MonoDevelop.Html/DocTypeCompletionDataProvider.cs,
- MonoDevelop.AspNet.Parser/SimpleCompletionData.cs: Track api
- changes.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.AspNet.Gui.XspOptionsPanelWidget.cs,
- gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployLaunchDialog.cs,
- gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployTargetEditor.cs,
- gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployOptionsPanelWidget.cs,
- gtk-gui/MonoDevelop.AspNet.Gui.AspNetConfigurationPanelWidget.cs,
- gtk-gui/MonoDevelop.AspNet.Deployment.WebTargetEditor.cs: Updated
- generated code.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs,
- MonoDevelop.AspNet/AspNetToolboxNode.cs,
- MonoDevelop.AspNet/WebTypeManager.cs: Track api changes.
-
-2008-09-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am, AspNetAddIn.mdp: Updated.
- * MonoDevelop.AspNet.Parser/SimpleCompletionData.cs: Utility completion
- data classes -- in C#3!
- * MonoDevelop.AspNet.Parser/Directive.cs: Work-in-progress on directive
- completion.
-
-2008-09-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet/CodeBehind.cs,
- MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs,
- MonoDevelop.AspNet/AspNetParserService.cs,
- MonoDevelop.AspNet/AspNetToolboxNode.cs,
- MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs,
- MonoDevelop.AspNet.Parser/CompilationUnitVisitor.cs,
- MonoDevelop.AspNet.Parser/AspNetParser.cs: Changed compilation
- unit/document meta information interface.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/ProjectFolderNodeBuilderExtension.cs: Moved the
- extensible tree view to its own directory.
-
-2008-09-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet/AspNetToolboxNode.cs, AspNetAddIn.mdp: Changes
- caused by parser service change.
-
-2008-08-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Fix attribute value
- completion.
-
-2008-08-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.StateEngine/AspNetFreeState.cs: Replace C#3
- automatic properties into C# 2 properties. Fixes build on Mono <
- 1.9. Thanks to Joshua Simmons for the patch.
-
-2008-08-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser.Internal/AspTokenizer.cs,
- MonoDevelop.AspNet.Parser.Internal/Directive.cs,
- MonoDevelop.AspNet.Parser.Internal/AspParser.cs,
- MonoDevelop.AspNet.Parser.Internal/Location.cs,
- MonoDevelop.AspNet.Parser.Internal/ParseException.cs,
- MonoDevelop.AspNet.Parser.Dom/ILocation.cs: Update from mcs SVN
- HEAD. Fixes "Bug 409109 - The ASP.NET Editor crashes if you leave a
- tag opened".
-
-2008-08-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Use Loading property instead
- of filename nullness hack.
- * MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs: Simplify code
- generation appraoch for partial classes: if the file.aspx (etc)
- file is newer than the corresponding file.aspx.designer.* file,
- regenerate the designer class entirely. This means that we no
- longer require refactoring support, so the feature now works with
- Boo and VB.NET.
-
-
-
- Also remove support for adding members to non-partial CodeBehind
- classes.
- * MonoDevelop.AspNet/AspNetAppProjectConfiguration.cs,
- MonoDevelop.AspNet.Gui/AspNetConfigurationPanelWidget.cs,
- gtk-gui/MonoDevelop.AspNet.Gui.AspNetConfigurationPanelWidget.cs,
- gtk-gui/gui.stetic: Remove option for autogenerating members in
- non-partial CodeBehind classes. Add an option for disabling
- Codebehind updating altogether.
-
-2008-08-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs: Add null check.
-
-2008-08-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.StateEngine/AspNetExpressionState.cs,
- MonoDevelop.AspNet.StateEngine/AspNetAttributeValueState.cs,
- MonoDevelop.AspNet.StateEngine/AspNetFreeState.cs,
- MonoDevelop.AspNet.StateEngine/AspNetSpeculativeExpressionState.cs,
- MonoDevelop.AspNet.StateEngine/AspNetServerCommentState.cs:
- Implement attribute value expressions.
- * AspNetAddIn.mdp, Makefile.am: Updated.
-
-2008-07-31 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Show all kinds of
- nodes in the path bar, and allow selecting them.
- * MonoDevelop.AspNet.StateEngine/AspNetDirectiveState.cs,
- MonoDevelop.AspNet.StateEngine/AspNetExpressionState.cs: Fix start
- offsets.
- * MonoDevelop.AspNet.StateEngine/AspNetDom.cs: Add friendly
- representations.
- * MonoDevelop.AspNet.StateEngine/AspNetSpeculativeExpressionState.cs,
- MonoDevelop.AspNet.StateEngine/AspNetFreeState.cs: Implement
- speculatives states. Works for expressions and server comments
- within tags, though not within attributes.
-
-2008-07-31 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/WebTypeManager.cs,
- MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Clean up
- System.Web lookup code.
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Fix the System.Web
- fallbacks using new DOM. Respect project's runtime version.
-
-2008-07-31 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Add comment and
- CDATA completion. Only trigger tag completion in the free state.
- * MonoDevelop.AspNet/WebTypeManager.cs: Simplify lookups using new
- DOM's methods. They're still broken due to the DOM database
- returning bad values.
-
-2008-07-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/WebTypeManager.cs,
- MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: More porting to
- new DOM.
- * MonoDevelop.AspNet.StateEngine/AspNetSpeculativeExpressionState.cs: A
- "speculative state" to replace the MalformedTagState. Can create a
- server comment, or
- * MonoDevelop.AspNet.StateEngine/AspNetServerCommentState.cs: Tidying
- up.
- * AspNetAddIn.mdp, Makefile.am: Updated.
-
-2008-07-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.StateEngine/AspNetExpressionState.cs,
- MonoDevelop.AspNet.StateEngine/AspNetFreeState.cs,
- MonoDevelop.AspNet.StateEngine/AspNetServerCommentState.cs,
- MonoDevelop.AspNet.StateEngine/AspNetDirectiveState.cs: API change
- to allow more that one character of rollback.
-
-2008-07-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Filter out
- attributes that are already in the tag.
-
-2008-07-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.StateEngine/AspNetExpressionState.cs: Complete the
- handling of expressions (in free state).
-
-2008-07-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.StateEngine/AspNetServerCommentState.cs: Implement
- server comments handling (in the free state).
-
-2008-07-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.StateEngine/AspNetFreeState.cs,
- MonoDevelop.AspNet.StateEngine/AspNetDirectiveState.cs,
- MonoDevelop.AspNet.StateEngine/AspNetDom.cs: Complete the handling
- of directives. Server comments and expressions are still broken.
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Continue port to new
- DOM. Enable AspNetFreeState parser instead of XML one.
- * MonoDevelop.AspNet.Parser/AspNetParser.cs: Remove debug code.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs,
- MonoDevelop.AspNet/AspNetParserService.cs,
- MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Translated old
- code to new dom.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet/CodeBehind.cs,
- MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs,
- MonoDevelop.AspNet.Parser/SuggestedHandlerCompletionData.cs:
- Changes for converted refactoring infrastructure.
-
-2008-07-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetToolboxNode.cs,
- MonoDevelop.AspNet/WebTypeManager.cs,
- MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs,
- MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Partial port
- to new DOM. A *few* features are working again, but it's not nearly
- done. Need to be able to get assembly parse contexts to make
- progress.
-
-2008-07-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Fix document outline
- view with new parser infrastructure.
-
-2008-07-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs,
- MonoDevelop.AspNet/AspNetLanguageBinding.cs,
- MonoDevelop.AspNet.addin.xml,
- MonoDevelop.AspNet.Parser/AspNetCompilationUnit.cs,
- MonoDevelop.AspNet.Parser/CompilationUnitVisitor.cs,
- MonoDevelop.AspNet.Parser/AspNetExpressionFinder.cs,
- MonoDevelop.AspNet.Parser/AspNetParser.cs,
- MonoDevelop.AspNet.Parser/LocatedParserException.cs: Port to new
- parser infrastructure so the ASP.NET pages get parsed.
- * MonoDevelop.AspNet.StateEngine/AspNetExpressionState.cs,
- MonoDevelop.AspNet.StateEngine/AspNetServerCommentState.cs,
- MonoDevelop.AspNet.StateEngine/AspNetDom.cs,
- MonoDevelop.AspNet.StateEngine/AspNetDirectiveState.cs: More
- in-progress work on ASP.NET extensions to the XML parser.
- * AspNetAddIn.mdp, Makefile.am: Updated.
-
-2008-07-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.StateEngine/AspNetExpressionState.cs,
- MonoDevelop.AspNet.StateEngine/AspNetAttributeValueState.cs,
- MonoDevelop.AspNet.StateEngine/AspNetFreeState.cs,
- MonoDevelop.AspNet.StateEngine/AspNetDom.cs: Commit initial work on
- ASP.NET parser extensions.
- * Makefile.am, AspNetAddIn.mdp: Updated.
-
-2008-07-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Put path bar update
- on a timeout so that it doesn't make selection too laggy.
-
-2008-07-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Improve triggering
- of attribute value completion.
-
-2008-07-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: For
- System.Drawing.Color names colours autocompletion entries, use a
- block of the colour as the icon. Don't show system colours.
-
-2008-07-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Implemented node
- selection with the path bar using the new parser. Much more
- reliable, but still breaks on selecting the node the caret's in.
- * gtk-gui/objects.xml, AspNetAddIn.mdp, Makefile.am: Removed
- objects.xml.
-
-2008-07-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.StateEngine/AspNetSpecialState.cs: Unneeded;
- removed.
- * MonoDevelop.AspNet.StateEngine/AspNetFreeState.cs: Stubbed.
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Use the new XML
- parser for ASP.NET completion.
- * gtk-gui/objects.xml, gtk-gui/gui.stetic, AspNetAddIn.mdp,
- Makefile.am: Updated.
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Fix tag prefix
- auto-generation logic.
- * MonoDevelop.AspNet.Parser/CompilationUnitVisitor.cs: Don't fold
- regions by default.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet.Deployment/WebDeployTarget.cs,
- MonoDevelop.AspNet/AspNetAppProject.cs,
- MonoDevelop.AspNet/AspNetAppProjectBinding.cs,
- MonoDevelop.AspNet/AspNetAppProjectConfiguration.cs,
- MonoDevelop.AspNet/AspNetToolboxNode.cs,
- MonoDevelop.AspNet/XspParameters.cs: Moved serialization engine to
- MonoDevelop.Core. Use new syntax for specifying attribute scope.
-
-2008-07-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet.addin.xml: Added javascript mime type (Bug 400896
- - Syntax Mode for Javascript).
-
-2008-06-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.StateEngine/AspNetSpecialState.cs,
- MonoDevelop.AspNet.StateEngine/AspNetFreeState.cs,
- MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Rework stack
- cloning and character rejection mechanisms in XML/ASP state engine.
-
-2008-06-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser/SuggestedHandlerCompletionData.cs: Track
- API.
-
-2008-06-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/CodeBehind.cs: Use case-insensitive checks on
- filenames.
-
-2008-06-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Track BindingService
- API. Fix possible skipping of Gdk.Threads.Leave().
- * MonoDevelop.Html/DocTypeCompletionDataProvider.cs,
- MonoDevelop.Html/HtmlCompletionDataProvider.cs,
- MonoDevelop.Html/HtmlSchemaService.cs: Minor change to doctype
- completion data API.
-
-2008-06-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Fix a logic error that caused
- an exception when creating a new file group with a CodeBehind file
- but no designer file.
- * Templates/WebApplication.xpt.xml: Move event hander to the user code
- class, not the designer class. Add protected button member because
- some languagee bindings can't auto-add it. Fixes "Bug 400301 -
- [Regression] The default VB Asp.Net template fails to compile".
-
-2008-06-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Templates/WebService-CodeBehind.xft.xml,
- Templates/WebHandler-CodeBehind.xft.xml,
- Templates/WebForm-CodeBehindNonPartial.xft.xml,
- Templates/WebForm-CodeBehind.xft.xml,
- Templates/WebControl-CodeBehindNonPartial.xft.xml,
- Templates/WebControl-CodeBehind.xft.xml,
- Templates/MasterPage-CodeBehindNonPartial.xft.xml,
- Templates/GlobalAsax-CodeBehind.xft.xml,
- Templates/MasterPage-CodeBehind.xft.xml: Set grouping/dependencies
- on new files.
- * MonoDevelop.AspNet/AspNetAppProject.cs: Set grouping dependencies on
- added files, and auto-add parents/children.
-
-2008-06-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser/AspNetCompilationUnit.cs: Remove old
- CodeBehind grouping mechanism.
-
-2008-06-10 Andres G. Aragoneses <aaragoneses@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Implement feature to allow
- unmanaged project references in a managed project (bug#397490).
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet.addin.xml: Bump MD version.
-
-2008-06-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProjectConfiguration.cs: Fix path of
- compiled output assembly.
-
-2008-05-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Fixes for ASP.NET projects
- with new project model.
- * Templates/WebApplication.xpt.xml: Add some "Hello World"-type code to
- new ASP.NET C# projects. Fixes "Bug 361348 - C# ASP.Net template
- doesn't indicate by default that it's working when run".
-
-2008-05-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser/PageInfoVisitor.cs: Actually prevent
- register directives overwriting page info with blank info.
-
-2008-05-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Fix ASP.NET projects loading
- with the new project model. There *may* be problems with build
- paths.
- * MonoDevelop.AspNet.Parser/PageInfoVisitor.cs: Prevent register
- directives overwriting page info with blank info.
-
-2008-05-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetToolboxNode.cs,
- MonoDevelop.AspNet/WebTypeManager.cs, Makefile.am, AspNetAddIn.mdp,
- MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs,
- MonoDevelop.AspNet.Parser/PageDirectiveVisitor.cs: Implemented
- auto-adding of register directives and project references when a
- control is added from the toolbox.
-
-2008-05-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Html/HtmlSchemaService.cs,
- MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Remove threaded
- schema loading. Implement an alternative lazy schema loading
- system.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet.addin.xml: Merged the extension points for project
- and solution option panels into a single extension point. A single
- extension point will now be used for all kinds of items. Extension
- conditions can be used to make panels visible only for some
- specific item types.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs,
- MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs: Replaced
- ICompilerResult/DefaultCompilerResult/CompilerResults by a new
- BuildResult class, which has owner information at error level, so
- it is possible to know which project generated an error when
- building a solution. Updated Task and TaskService to use the new
- owner information.
-
-2008-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Filter out runtime versions
- that aren't 1.1 or 2.0.
-
-2008-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetToolboxLoader.cs: Record the supported
- runtime versions.
- * MonoDevelop.AspNet/AspNetToolboxNode.cs: Filter the item from the
- text editor toolbox if the supported runtimes don't match the
- current project.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: The Deserialize event may not
- be called in some file formats, so don't use it to control the
- project loading.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProjectBinding.cs,
- MonoDevelop.AspNet/AspNetAppProject.cs,
- MonoDevelop.AspNet/CodeBehind.cs,
- MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs,
- MonoDevelop.AspNet/AspNetParserService.cs,
- MonoDevelop.AspNet/AspNetToolboxNode.cs,
- MonoDevelop.AspNet/WebTypeManager.cs,
- MonoDevelop.AspNet/AspNetAppProjectConfiguration.cs,
- MonoDevelop.AspNet.addin.xml,
- MonoDevelop.AspNet.Deployment/WebDeployService.cs,
- MonoDevelop.AspNet.Deployment/WebDeployOptionsPanel.cs,
- MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs,
- MonoDevelop.AspNet.Gui/AspNetConfigurationPanel.cs,
- MonoDevelop.AspNet.Gui/AspNetConfigurationPanelWidget.cs,
- MonoDevelop.AspNet.Gui/XspOptionsPanel.cs,
- MonoDevelop.AspNet.Gui/XspOptionsPanelWidget.cs,
- gtk-gui/gui.stetic, AspNetAddIn.mdp, Makefile.am,
- MonoDevelop.AspNet.Parser/WebFormReferenceManager.cs,
- MonoDevelop.AspNet.Parser/SuggestedHandlerCompletionData.cs,
- MonoDevelop.AspNet.Parser/Document.cs: New project model changes.
-
-2008-05-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Remove conditional build for ASP.NET support; there's no
- longer any reason to disable it.
-
-2008-05-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetToolboxNode.cs: Change ITextToolboxNode API
- so that nodes have more control over when they're shown.
-
-2008-05-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetToolboxProvider.cs: Moved from AspNetEdit.
- * MonoDevelop.AspNet/AspNetToolboxLoader.cs: Implement correct loading
- of items in System.Web 1.1.
- * MonoDevelop.AspNet/AspNetToolboxNode.cs: Improve support for default
- tag text. Markup for property grid.
- * MonoDevelop.AspNet.addin.xml: Register provider moved from
- AspNetEdit.
- * Makefile.am, AspNetAddIn.mdp: Updated.
-
-2008-05-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetDisplayBinding.cs: Remove unneeded display
- binding.
- * MonoDevelop.AspNet/AspNetAppProject.cs: Remove bound WebTypeManager
- instance.
- * MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs: Add copyright.
- * MonoDevelop.AspNet/AspNetToolboxLoader.cs,
- MonoDevelop.AspNet/AspNetToolboxNode.cs: Toolbox loader for ASP.NET
- toolbox items that makes then available to the text editor too.
- * MonoDevelop.AspNet/AspNetParserService.cs: A place for parser-access
- convenience methods.
- * MonoDevelop.AspNet/WebTypeManager.cs: Make static. Take project as
- argument rather than being bound to it.
- * MonoDevelop.AspNet.addin.xml: Register new toolbox loader. Update
- mimetypes. Remove unneeded display binding.
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Prevent some NREs.
- * AspNetAddIn.mdp, Makefile.am: Updated.
- * MonoDevelop.AspNet.Parser/Document.cs: If bound project is null, look
- it up.
- * MonoDevelop.AspNet.Parser/CompilationUnitVisitor.cs: Prevent possible
- NRE.
- * MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Add
- functionality for looking up and generating prefixes, for text
- toolbox nodes.
-
-2008-05-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Fix positions when
- selecting nodes.
-
-2008-05-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Use a data func for
- the outline treeview. Shorten many overlong lines.
-
-2008-05-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser.Dom/ParentNode.cs: Make parent nodes
- enumerable.
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Implement document
- outline support for ASP.NET documents. Still a couple of issues:
- the parser doesn't provide the document at startup, so it won't
- show anything until the file is changed. It also may have
- performance problems on large files.
-
-2008-05-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs,
- MonoDevelop.AspNet/CodeBehind.cs,
- MonoDevelop.AspNet/VerifyCodeBehindBuildStep.cs,
- MonoDevelop.AspNet.Parser/Document.cs,
- MonoDevelop.AspNet.Parser/CompilationUnitVisitor.cs,
- MonoDevelop.AspNet.Parser/AspNetParser.cs,
- MonoDevelop.AspNet.Parser/PageInfoVisitor.cs,
- MonoDevelop.AspNet.Parser/PageInfo.cs,
- MonoDevelop.AspNet.Parser/AspNetCompilationUnit.cs: Replace
- direscrt use of the ASP.NET docuemnt parser with use of the parser
- service. Flesh out the parsed compilation units.
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Use compilation
- units from parser service instead of parsing on every keystroke.
- * AspNetAddIn.mdp, Makefile.am: Updated
-
-2008-05-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.addin.xml,
- MonoDevelop.AspNet/AspNetCodeBehindProvider.cs: Remove use of
- removed extension point.
-
-2008-04-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetLanguageBinding.cs,
- MonoDevelop.Html/HtmlCompletionDataProvider.cs,
- MonoDevelop.AspNet.addin.xml, Makefile.am, AspNetAddIn.mdp,
- MonoDevelop.AspNet.Parser/Document.cs,
- MonoDevelop.AspNet.Parser/CompilationUnitVisitor.cs,
- MonoDevelop.AspNet.Parser/AspNetExpressionFinder.cs,
- MonoDevelop.AspNet.Parser/AspNetParser.cs,
- MonoDevelop.AspNet.Parser/AspNetCompilationUnit.cs: Add support for
- simple folding and error underlining in ASP.NET pages.
- * MonoDevelop.AspNet.Parser.Dom/RootNode.cs: Add support for simple
- folding and error underlining in ASP.NET pages. Fix mimetypes.
-
-2008-04-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Add ability to
- select paths (partially working).
-
-2008-04-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Implement path bar
- support.
- * AspNetAddIn.mdp, Makefile.am,
- MonoDevelop.AspNet.Parser/AspNetIndentStack.cs: Remove old indent
- stack.
-
-2008-04-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.StateEngine/AspNetSpecialState.cs,
- MonoDevelop.AspNet.StateEngine/AspNetFreeState.cs: Change XML state
- engine API to allow cloning a single node (as an alternative to the
- whole stack).
-
-2008-04-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.StateEngine/AspNetFreeState.cs: Add support for
- XML processing instructions.
-
-2008-04-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.StateEngine/AspNetSpecialState.cs,
- MonoDevelop.AspNet.StateEngine/AspNetFreeState.cs: Minimal states
- for ASP.NET parsing. Still need to handle expressions within
- attribute values.
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Use new state engine
- for triggering completion. Haven't exorcised full document parse
- yet -- need it for doctype etc. Also need it (but low-priority,
- threaded?) for filtering existing attributes.
- * Makefile.am, AspNetAddIn.mdp: Updated.
-
-2008-04-14 Michael Hutchinson <mhutchinson@novell.com>
-
-
-
-2008-04-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/WebTypeManager.cs: Remove debug code.
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Greatly improve
- completion triggering behaviour. Most noticeable with tag
- attributes.
-
-2008-04-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Add server-side
- comments to completion list.
- * MonoDevelop.AspNet.Parser/AspNetIndentStack.cs: Add more states,
- document all the states' meaning, and handle closing some states.
-
-2008-04-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Html/HtmlSchema.cs: Avoid unused variable warning.
- * gtk-gui/gui.stetic: Updated.
- * MonoDevelop.AspNet.Parser/AspNetIndentStack.cs: Woked on indent
- stack. Not complete yet.
-
-2008-04-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AspNet.addin.xml: Use the new mime type extension to
- register new file types.
-
-2008-04-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Add completion for
- colours, enums and booleans. Walk into base members when attempting
- attribute completion.
-
-2008-04-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/CodeBehind.cs: Add method for getting a
- non-designer class.
- * MonoDevelop.AspNet/WebTypeManager.cs,
- MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Add various
- control lookup methods, including listing of ASP.NET controls.
- * MonoDevelop.Html/HtmlSchema.cs: Minor cleanup.
- * MonoDevelop.Html/HtmlSchemaService.cs: Improve lazy loading. Allow
- forced preloading in a thread.
- * MonoDevelop.AspNet.addin.xml: Remove HTML 4 Transitional doctype
- extension, as it's a hardcoded default.
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Track API. Implement
- ASP.NET control and attribute completion. Implement attribute value
- completion (and handler stubbing) for events. Improve completion
- triggering accuracy. Add documentation for completion items.
- Implement close tag completion for parent tags. Lazily load HTML
- schemas, and use default schema while they load. Force HTML schema
- service to load in background when docuement opened.
- * AspNetAddIn.mdp, Makefile.am: Updated.
- * MonoDevelop.AspNet.Parser/SuggestedHandlerCompletionData.cs:
- Completion data type that inserts a method into a class if it's
- picked.
- * MonoDevelop.AspNet.Parser/AspNetIndentStack.cs: Partial (still
- unused) implementation of indenter stack.
-
-2008-04-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser.Dom/RootNode.cs: Fix build and close
- correct tags.
-
-2008-04-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser.Dom/ParentNode.cs,
- MonoDevelop.AspNet.Parser.Dom/RootNode.cs: Add a mechanism for
- determining/indicating whether a tag has been closed.
- * MonoDevelop.Html/DocTypeCompletionData.cs: Remove debug message.
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Implement closing
- tag completion for unclosed tags. Reduce spurious completion
- triggering.
-
-2008-04-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Schemas, Schemas/xhtml1-transitional.xsd, Schemas/W3C-License.html,
- Schemas/xhtml1-strict.xsd, Schemas/readme.txt,
- Schemas/xhtml1-frameset.xsd: Add W3C XHTML 1.0 schemas.
- * MonoDevelop.Html/DocTypeCompletionData.cs,
- MonoDevelop.Html/DocTypeCompletionDataProvider.cs: Implement
- completion provider for doctype declarations.
- * MonoDevelop.Html/HtmlSchema.cs: Change to an association between an
- doctype and an IXmlCompletionProvider from the XmlEditor.
- * MonoDevelop.Html/HtmlSchemaService.cs: Load doctypes and associated
- schemas from extension point. Expose default doctypes, and
- mechanisms for getting completion providers for any registered
- doctype, as well as a completion provider for doctypes themselves.
- * MonoDevelop.Html/DocTypeExtensionNode.cs,
- MonoDevelop.AspNet.addin.xml: Added HTML(/SGML/XML) doctypes as an
- extension point.
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Implement HTML code
- completion for aspx files.
- * Makefile.am, AspNetAddIn.mdp: Updated.
-
-2008-03-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Deployment/WebDeployLaunchDialog.cs: Fix namespace
- of panel.
-
-2008-03-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Templates/WebConfig-SubDir.xft.xml:
- * Templates/WebConfig-Application.xft.xml: Improve descriptions.
-
-2008-03-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet/AspNetAppProject.cs: Improve browser launching code.
- * MonoDevelop.AspNet.Gui/BrowserLauncher.cs: Move browser launcher code and
- make it into a re-usable IAsyncOperation.
- * AspNetAddIn.mdp, Makefile.am: Updated.
- * MonoDevelop.AspNet.Parser/Regexes.cs: Improve server tag regex.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AspNet.Deployment/WebDeployService.cs,
- MonoDevelop.AspNet/XspParameters.cs,
- MonoDevelop.AspNet/AspNetAppProject.cs: Worked on gnome hig compliant
- alerts.
-
-2008-03-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs: Improve ASP.NET code
- completion. Now parser updates on-the-fly and suggestions are
- contextual.
- * gtk-gui/gui.stetic, AspNetAddIn.mdp, Makefile.am: Updated.
- * MonoDevelop.AspNet.Parser.Dom/ParentNode.cs,
- MonoDevelop.AspNet.Parser.Dom/Node.cs: Minor API name change.
- * MonoDevelop.AspNet.Parser.Dom/RootNode.cs: Catch and collect
- parser-reported exceptions rather than blowing up.
- * MonoDevelop.Html, MonoDevelop.Html/HtmlSchema.cs,
- MonoDevelop.Html/HtmlSchemaService.cs: Skeletion of system for
- schema-controlled HTML completion.
- * MonoDevelop.AspNet.Parser/Document.cs,
- MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs: Make it easier to
- build a parser document directly rather than going through the project.
- * MonoDevelop.AspNet.Parser/Regexes.cs: Utility class, unused right now.
- * MonoDevelop.AspNet.Parser/LocatedParserException.cs: Allow flagging error
- as a warning.
-
-2008-03-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser.Internal/ParseException.cs: Fix ILocation
- capturing.
- * MonoDevelop.AspNet.Parser.Dom/ParentNode.cs,
- MonoDevelop.AspNet.Parser.Dom/Visitor.cs,
- MonoDevelop.AspNet.Parser.Dom/TagNode.cs: Implement QuickExit so that
- visitor can terminate early.
- * MonoDevelop.AspNet.Parser.Dom/RootNode.cs: Add some support for implicit
- tag closing like in HTML4, making parser more robust with sloppy input.
- Implement QuickExit so that visitor can terminate early.
- * MonoDevelop.AspNet.Parser/LocatedParserException.cs: Fix possible NREs.
- Override ToString().
- * MonoDevelop.AspNet.Parser/PageInfoVisitor.cs: Capture doctype. Use quick
- exit when desired information found.
-
-2008-02-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Gui/AspNetEditorExtension.cs, Makefile.am,
- AspNetAddIn.mdp, MonoDevelop.AspNet.addin.xml: Add the beginnings of a
- code completion system for ASP.NET.
- * MonoDevelop.AspNet.Parser.Dom/ParentNode.cs,
- MonoDevelop.AspNet.Parser.Dom/TagNode.cs,
- MonoDevelop.AspNet.Parser.Dom/Node.cs,
- MonoDevelop.AspNet.Parser.Dom/RootNode.cs,
- MonoDevelop.AspNet.Parser/Document.cs: Improve error resilience. Improve
- debug messages. Finish the node search system.
-
-2008-02-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AspNet.Parser/Internal:
- * MonoDevelop.AspNet.Parser/Tree:
- * MonoDevelop.AspNet.Parser.Internal:
- * MonoDevelop.AspNet.Parser.Dom:
- * AspNetAddIn.mdp:
- * Makefile.am: Finish restructuring directories to reflect namespaces.
-
- * MonoDevelop.AspNet.addin.xml: Clean up whitespace.
-
-2008-02-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * Deployment, MonoDevelop.AspNet, Gui, Parser,
- MonoDevelop.AspNet.Deployment, MonoDevelop.AspNet.Gui, Project,
- AspNetAddIn.mdp, Makefile.am, MonoDevelop.AspNet.Parser: Restructure
- directories to reflect namespaces.
-
-2008-02-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * Deployment/WebDeployService.cs, Deployment/WebDeployCommands.cs,
- Deployment/WebDeployLaunchDialog.cs,
- Deployment/WebDeployOptionsPanel.cs,
- Deployment/WebDeployOptionsPanelWidget.cs,
- Gui/AspNetConfigurationPanel.cs, Gui/AspNetConfigurationPanelWidget.cs,
- Gui/XspOptionsPanel.cs, Gui/XspOptionsPanelWidget.cs,
- Project/AspNetDisplayBinding.cs, Project/AspNetCommands.cs,
- Project/ProjectFolderNodeBuilderExtension.cs,
- Project/AspNetAppProjectBinding.cs,
- Project/AspNetMSBuildProjectExtension.cs, Project/XspParameters.cs,
- Project/AspNetAppProject.cs, Project/CodeBehind.cs,
- Project/VerifyCodeBehindBuildStep.cs,
- Project/AspNetAppProjectConfiguration.cs,
- Project/AspNetCodeBehindProvider.cs,
- Project/AspNetFileDescriptionTemplate.cs, Project/WebTypeManager.cs,
- gtk-gui/MonoDevelop.AspNet.Gui.XspOptionsPanelWidget.cs,
- gtk-gui/AspNetAddIn.AspNetConfigurationPanelWidget.cs,
- gtk-gui/AspNetAddIn.XspOptionsPanelWidget.cs,
- gtk-gui/MonoDevelop.AspNet.Gui.AspNetConfigurationPanelWidget.cs,
- gtk-gui/gui.stetic, AspNetAddIn.addin.xml, AspNetAddIn.mdp, Makefile.am,
- Parser/Tree/ParentNode.cs, Parser/Tree/ServerCommentNode.cs,
- Parser/Tree/Visitor.cs, Parser/Tree/ServerIncludeNode.cs,
- Parser/Tree/ILocation.cs, Parser/Tree/TagNode.cs,
- Parser/Tree/DirectiveNode.cs, Parser/Tree/Node.cs,
- Parser/Tree/ExpressionNode.cs, Parser/Tree/RootNode.cs,
- Parser/Tree/TextNode.cs, Parser/WebFormReferenceManager.cs,
- Parser/DebugStringVisitor.cs, Parser/Document.cs,
- Parser/MemberListVisitor.cs, Parser/LocatedParserException.cs,
- Parser/Internal/TagType.cs, Parser/Internal/AspTokenizer.cs,
- Parser/Internal/Directive.cs, Parser/Internal/AspParser.cs,
- Parser/Internal/TagAttributes.cs, Parser/Internal/Location.cs,
- Parser/Internal/ParseException.cs, Parser/Internal/StrUtils.cs,
- Parser/DocumentReferenceManager.cs, Parser/PageInfoVisitor.cs,
- MonoDevelop.AspNet.addin.xml: Finish renaming AspNetAddIn and its
- corresponding namespaces to MonoDevelop.Aspnet.
-
-2008-02-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/AspNetFileDescriptionTemplate.cs: Fix string formatting call.
-
-2008-02-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * AspNetAddIn.mdp, Makefile.am, Parser/Tree/ParentNode.cs,
- Parser/Tree/ServerCommentNode.cs, Parser/Tree/Visitor.cs,
- Parser/Tree/TagNode.cs, Parser/Tree/DirectiveNode.cs,
- Parser/Tree/Node.cs, Parser/Tree/ExpressionNode.cs,
- Parser/Tree/RootNode.cs, Parser/Tree/TextNode.cs,
- Parser/DebugStringVisitor.cs, Parser/Document.cs,
- Parser/Internal/Location.cs: Implement dumping a debug view of the parse
- tree, and binary searching for the parse node at a given location in the
- file.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * AspNetAddIn.mdp, Makefile.am: Removed some unused glade and gnome-sharp
- references (only the unused). But I'll continue to remove glade, we need
- to lower the dependency tree a bit.
-
-2008-02-20 Marek Safar <marek.safar@gmail.com>
-
- * Project/VerifyCodeBehindBuildStep.cs: Fixed missing parenthesis.
-
-2008-02-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/IAspNetLanguageBinding.cs,
- Project/AspNetFileDescriptionTemplate.cs,
- Templates/WebService-CodeBehind.xft.xml,
- Templates/WebForm-CodeBehind.xft.xml,
- Templates/MasterPage-Empty.xft.xml,
- Templates/WebControl-CodeBehindNonPartial.xft.xml,
- Templates/WebService-Empty.xft.xml,
- Templates/WebHandler-CodeBehind.xft.xml,
- Templates/WebForm-Empty.xft.xml,
- Templates/WebControl-CodeBehind.xft.xml,
- Templates/MasterPage-CodeBehindNonPartial.xft.xml,
- Templates/WebConfig-Application.xft.xml,
- Templates/WebHandler-Empty.xft.xml, Templates/GlobalAsax-Empty.xft.xml,
- Templates/WebControl-Empty.xft.xml,
- Templates/MasterPage-CodeBehind.xft.xml,
- Templates/WebForm-CodeBehindNonPartial.xft.xml: Add a mechanism for
- having the ASP.NET language code be different from MD's internal
- language codes, and use it to make VB.NET pages work OOTB.
- * AspNetAddIn.mdp, Makefile.am: Updated.
- * Parser/Tree/Visitor.cs, Parser/Tree/ExpressionNode.cs,
- Parser/Tree/RootNode.cs: The way the parser's currently used, it doesn't
- need to understand expressions, so rather than throwing a
- NotImplementedException, just insert them into the AST and carry on.
- Means that CodeBehind generation can be used for a much larger subset of
- aspx pages.
-
-2008-02-09 Mike Krüger <mkrueger@novell.com>
-
- * AspNetAddIn.addin.xml, AspNetAddIn.mdp, Makefile.am: Removed source editor
- dependency.
-
-2008-02-05 Mike Krüger <mkrueger@novell.com>
-
- * AspNetAddIn.addin.xml: Structured main menu.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.addin.xml: Update MD version.
-
-2008-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.addin.xml: Updated add-in category and description.
-
-2008-01-19 Ankit Jain <jankit@novell.com>
-
- * AspNetMSBuildProjectExtension.cs: Track changes in MSBuildProjectExtension.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * Templates/WebService-CodeBehind.xft.xml,
- Templates/WebForm-CodeBehind.xft.xml,
- Templates/MasterPage-Empty.xft.xml,
- Templates/WebControl-CodeBehindNonPartial.xft.xml,
- Templates/WebConfig-SubDir.xft.xml, Templates/WebService-Empty.xft.xml,
- Templates/WebHandler-CodeBehind.xft.xml,
- Templates/WebForm-Empty.xft.xml,
- Templates/GlobalAsax-CodeBehind.xft.xml,
- Templates/WebControl-CodeBehind.xft.xml,
- Templates/MasterPage-CodeBehindNonPartial.xft.xml,
- Templates/WebConfig-Application.xft.xml,
- Templates/WebApplication-Empty.xpt.xml,
- Templates/WebHandler-Empty.xft.xml, Templates/GlobalAsax-Empty.xft.xml,
- Templates/WebControl-Empty.xft.xml,
- Templates/MasterPage-CodeBehind.xft.xml,
- Templates/WebForm-CodeBehindNonPartial.xft.xml,
- Templates/WebApplication.xpt.xml: Make template categories translatable.
-
-2008-01-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/VerifyCodeBehindBuildStep.cs: Only try to add members to
- CodeBehind if the needed refactoring options are supported.
-
-2008-01-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Templates/WebService-CodeBehind.xft.xml,
- Templates/WebForm-CodeBehind.xft.xml,
- Templates/WebControl-CodeBehindNonPartial.xft.xml,
- Templates/WebService-Empty.xft.xml,
- Templates/WebHandler-CodeBehind.xft.xml,
- Templates/WebControl-CodeBehind.xft.xml,
- Templates/MasterPage-CodeBehindNonPartial.xft.xml,
- Templates/WebHandler-Empty.xft.xml,
- Templates/MasterPage-CodeBehind.xft.xml,
- Templates/WebForm-CodeBehindNonPartial.xft.xml: Use ${EscapedIdentifier}
- instead of ${Name} so that files can be created with names like
- "Default" and work correctly in VB.NET.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.mdp: Updated project files. The order of extended properties
- won't change anymore.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/AspNetAppProject.cs: Moved PlatformService to MD.Core.Gui. Removed
- old FileIconService class, which is now implemented in PlatformService.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * Deployment/WebDeployTargetEditor.cs: Track api changes.
- * gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployLaunchDialog.cs,
- gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployOptionsPanelWidget.cs,
- gtk-gui/gui.stetic: Updated.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/AspNetAppProject.cs: API cleanup.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/AspNetAddIn.XspOptionsPanelWidget.cs,
- gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployTargetEditor.cs,
- gtk-gui/gui.stetic: Fix alignment of some labels.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.addin.xml: Bump add-in versions.
-
-2007-12-06 Geoff Norton <gnorton@novell.com>
-
- * Project/AspNetAppProject.cs: Use PlatformService to launch a browser
- instead of Gnome.Url.Show.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/objects.xml, AspNetAddIn.addin.xml, AspNetAddIn.mdp, Makefile.am:
- Directory reorganization.
-
-2007-11-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/AspNetAppProject.cs: Don't try to compile if no files are set to
- compile, as compilers/bindings (e.g. CSharpBinding) will error out if no
- files are set to compile.
-
-2007-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Deployment/WebDeployService.cs, Project/AspNetAppProject.cs,
- Parser/Document.cs: Track LoggingService API changes.
-
-2007-11-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/VerifyCodeBehindBuildStep.cs: Use RootCombine instead of
- CurrentOpenCombine when possible.
-
-2007-10-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * Deployment/WebDeployService.cs, Deployment/WebDeployCommands.cs,
- Deployment/WebDeployLaunchDialog.cs,
- gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployLaunchDialog.cs,
- gtk-gui/gui.stetic: Enable web deploy dialog even if no targets exist,
- but add a button for editng/adding targets. Fixes "Bug 337804 - Web
- Deployment should be easier to configure".
-
-2007-10-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/AspNetAppProjectConfiguration.cs: Fix "Bug 337819 - Directory
- change warning shown when creating a new Web Project.". Re-opens "Bug
- 333419 - Output dir in ASP.NET project don't work", though it's now
- possible to work around the latter by setting an XML attribute in the
- project file.
-
-2007-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.addin.xml: Use the html file icon for some known asp.net
- files.
-
-2007-10-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * AspNetAddIn.addin.xml: Use WebHandler-CodeBehind template.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.addin.xml: Bump MD version.
-
-2007-10-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/VerifyCodeBehindBuildStep.cs: Fix string formatting index in a
- gettext call.
-
-2007-10-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/AspNetAppProject.cs: No need to handle monitor's cancel request,
- as AggregatedOperationMonitor does this for us.
-
-2007-10-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * Templates/WebApplication-Empty.xpt.xml, Templates/WebApplication.xpt.xml:
- Updated project icons.
-
-2007-10-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/WebTypeManager.cs: Don't do web.config control lookups for 1.1
- projects.
- * Parser/WebFormReferenceManager.cs: Track API change.
- * Parser/MemberListVisitor.cs, Parser/DocumentReferenceManager.cs: Handle
- the "type" property of "input" HTML controls.
-
-2007-10-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/AspNetAppProject.cs, Project/VerifyCodeBehindBuildStep.cs,
- Parser/MemberListVisitor.cs, Parser/LocatedParserException.cs,
- Parser/Internal/ParseException.cs: Rework error handling to include
- location info for document parse errors.
- * Project/WebTypeManager.cs, Parser/WebFormReferenceManager.cs,
- Parser/DocumentReferenceManager.cs: Rework type lookups for registered
- controls. Now handles custom controls and user controls, whether
- registered in aspx file or web.config.
- * AspNetAddIn.mdp, Makefile.am: Updated.
- * Parser/Document.cs: Collect parse errors instead of dying in constructor.
-
-2007-10-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/AspNetAppProject.cs: Copy refs to output path during compile. Not
- sure it's necessary, as the Run/Deploy commands do the copy too, and
- people shouldn't be running their site without executing one of these
- commands first. However, we have had a few bug reports about this
- behaviour, so it's better to do what people expect.
- * Project/VerifyCodeBehindBuildStep.cs: Report ASP.NET parser and Codebehind
- member generation errors as compile warnings, with file/line number
- info. Use Gettext for i18n of warnings.
- * AspNetAddIn.mdp: Updated.
-
-2007-10-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/AspNetAppProjectConfiguration.cs: Allowing changing the output
- directory to a directory other than "bin", but only after warning the
- user that this may prevent the projct from running/deploying correctly.
- Enables some unusual use cases, and doesn't affect other people.
-
-2007-10-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/VerifyCodeBehindBuildStep.cs: Change how partial classes are
- handled during code generation to work around the fact that they don't
- have all of the information that the 'full' class does.
-
-2007-10-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/AspNetAppProject.cs: Use xsp2 if using 2.0 runtime (regression
- introduced in previous commit).
-
-2007-10-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/AspNetAppProject.cs: Launch xsp directly rather than via SH. Made
- possible by changes to IExecutionHandler/ProcessService allowing setting
- environment variables on new console processes. Fixes xsp shutdown (xsp
- instances were not closes and were blocking ports). Hopefully fixes
- #330327.
-
- Also, don't force copy output refs.
-
-2007-10-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Deployment/WebDeployService.cs: Build before deploying.
- * Deployment/WebDeployTargetEditor.cs: Catch errors if file copy handler
- can't be found.
-
-2007-10-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/VerifyCodeBehindBuildStep.cs: Make errors in Codebehind generation
- into warnings rather than preventing build.
-
-2007-09-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/AspNetAppProject.cs: Check for xsp before running it.
-
-2007-09-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * Deployment/WebTargetEditor.cs, Deployment/WebDeployService.cs,
- Deployment/WebDeployCommands.cs, Deployment/WebDeployResolver.cs,
- Deployment/WebDeployTargetCollection.cs, Deployment/WebDeployTarget.cs,
- Deployment/WebDeployWindow.cs, Deployment/WebDeployLaunchDialog.cs,
- Deployment/WebDeployOptionsPanel.cs,
- Deployment/WebDeployTargetEditor.cs,
- Deployment/WebDeployOptionsPanelWidget.cs, AspNetAddIn.addin.xml,
- gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployLaunchDialog.cs,
- gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployTargetEditor.cs,
- gtk-gui/MonoDevelop.AspNet.Deployment.WebDeployOptionsPanelWidget.cs,
- gtk-gui/MonoDevelop.AspNet.Deployment.WebTargetEditor.cs: Add new web
- deployment UI and services.
- * Project/AspNetAppProject.cs: Add WebDeployTargets property. Use new web
- targets when returning DeployFiles. Fix NRE when language binding not
- recognised.
- * gtk-gui/generated.cs, gtk-gui/AspNetAddIn.XspOptionsPanelWidget.cs,
- gtk-gui/objects.xml, gtk-gui/gui.stetic, AspNetAddIn.mdp, Makefile.am,
- Gui/XspOptionsPanel.cs: Updated.
-
-2007-09-27 Ankit Jain <jankit@novell.com>
-
- Add support for VS2005 WebApplication projects.
- * Project/AspNetMSBuildProjectExtension.cs: New.
- * AspNetAddIn.addin.xml: Add Extension.
- * AspNetAddIn.mdp: Update.
- * Makefile.am: Update.
-
-2007-09-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/AspNetAppProject.cs: Make write-safe by using TextFile API rather
- than direct save.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.addin.xml: Bump MD version.
-
-2007-09-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/AspNetAppProject.cs: Added reference change handlers to update the
- referenced assembly list in web.config.
-
-2007-09-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/XspOptionsPanelWidget.cs,
- gtk-gui/AspNetAddIn.XspOptionsPanelWidget.cs, gtk-gui/gui.stetic: Fix
- bugs from stetic conversion: panel status update handler and permissible
- port range setting.
- * Project/AspNetAppProject.cs: Restructure execution code to handle errors
- better and make it possible to set MONO_OPTIONS="--debug" when calling
- xsp.
-
-2007-09-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/XspOptionsPanel.cs, Gui/XspOptionsPanelWidget.cs, AspNetAddIn.glade,
- gtk-gui/generated.cs,
- gtk-gui/AspNetAddIn.AspNetConfigurationPanelWidget.cs,
- gtk-gui/AspNetAddIn.XspOptionsPanelWidget.cs, gtk-gui/gui.stetic,
- AspNetAddIn.mdp, Makefile.am: Migrate XspOptionsPanel from glade to
- stetic.
- * Gui/AspNetConfigurationPanelWidget.cs,
- Project/AspNetFileDescriptionTemplate.cs: Remove unused fields.
-
-2007-09-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/ProjectFolderNodeBuilderExtension.cs, Project/AspNetCommands.cs,
- AspNetAddIn.addin.xml, AspNetAddIn.mdp, Makefile.am: Add a command/menu
- for creating ASP.NET special directories.
- * Project/AspNetAppProject.cs: Add more WebSubtypes. Use GettextCatalog for
- MessageService call. Add method for discovering non-existent special
- ASP.NET directories.
- * Project/VerifyCodeBehindBuildStep.cs: Don't prevent compilation if
- documents can't be parsed.
-
-2007-09-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/AspNetAppProject.cs: Fire SetDefaultBuildAction only when adding
- new files, not when deserialising the project. Add a "Code" WebSubtype.
- * AspNetAddIn.addin.xml, AspNetAddIn.mdp, Makefile.am,
- Templates/WebConfig-SubDir.xft.xml,
- Templates/WebConfig-Application.xft.xml: Add Web.config templates.
- * Templates/WebForm-CodeBehind.xft.xml,
- Templates/GlobalAsax-CodeBehind.xft.xml,
- Templates/WebControl-CodeBehind.xft.xml,
- Templates/GlobalAsax-Empty.xft.xml,
- Templates/MasterPage-CodeBehind.xft.xml: More tweaks to templates.
- * Templates/WebApplication.xpt.xml: Add web.config to default project
- template.
-
-2007-09-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * AspNetAddIn.addin.xml, AspNetAddIn.mdp, Makefile.am: Updated.
- * Templates/WebService-CodeBehind.xft.xml,
- Templates/WebForm-CodeBehind.xft.xml,
- Templates/MasterPage-Empty.xft.xml, Templates/WebService-Empty.xft.xml,
- Templates/WebForm-Empty.xft.xml,
- Templates/WebHandler-CodeBehind.xft.xml,
- Templates/WebControl-CodeBehind.xft.xml,
- Templates/WebHandler-Empty.xft.xml,
- Templates/MasterPage-CodeBehind.xft.xml,
- Templates/WebControl-Empty.xft.xml, Templates/WebApplication.xpt.xml:
- Remove deprecated FileOptions node.
- * Templates/WebControl-CodeBehindNonPartial.xft.xml,
- Templates/MasterPage-CodeBehindNonPartial.xft.xml,
- Templates/WebForm-CodeBehindNonPartial.xft.xml: Add non-partial-type
- templates.
- * Templates/GlobalAsax-CodeBehind.xft.xml,
- Templates/GlobalAsax-Empty.xft.xml: Add Global.asax templates.
- * Templates/WebApplication-Empty.xpt.xml: Add empty project template.
-
-2007-09-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Templates/WebService-CodeBehind.xft.xml,
- Templates/WebHandler-Empty.xft.xml, Templates/WebService-Empty.xft.xml,
- Templates/WebControl-Empty.xft.xml, Templates/WebForm-Empty.xft.xml,
- Templates/WebHandler-CodeBehind.xft.xml: Limit to be shown for ASP.NET
- projects.
- * Templates/WebControl-CodeBehind.xft.xml,
- Templates/WebForm-CodeBehind.xft.xml: Limit to be shown for ASP.NET
- projects. Require partial class support.
- * Templates/MasterPage-Empty.xft.xml: Limit to be shown for ASP.NET
- projects. Require 2.0 runtime.
- * Templates/MasterPage-CodeBehind.xft.xml: Limit to be shown for ASP.NET
- projects. Require 2.0 runtime. Require partial class support.
-
-2007-09-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/AspNetAppProject.cs: Set correct BuildAction for added ASP.NET
- files. Convert cachedDocuments to generic collection.
-
-2007-09-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * AspNetAddIn.addin.xml, AspNetAddIn.mdp, Makefile.am,
- Templates/CodeBehindWebControl.xft.xml,
- Templates/CodeBehindWebForm.xft.xml,
- Templates/CodeBehindWebHandler.xft.xml,
- Templates/CodeBehindWebService.xft.xml,
- Templates/EmptyWebControl.xft.xml, Templates/EmptyWebForm.xft.xml,
- Templates/EmptyWebHandler.xft.xml, Templates/EmptyWebService.xft.xml,
- Templates/MasterPage-CodeBehind.xft.xml,
- Templates/MasterPage-Empty.xft.xml,
- Templates/MasterPageWithCodeBehind.xft.xml,
- Templates/MasterPageWithNoCodeBehind.xft.xml,
- Templates/WebControl-CodeBehind.xft.xml,
- Templates/WebControl-Empty.xft.xml,
- Templates/WebForm-CodeBehind.xft.xml, Templates/WebForm-Empty.xft.xml,
- Templates/WebHandler-CodeBehind.xft.xml,
- Templates/WebHandler-Empty.xft.xml,
- Templates/WebService-CodeBehind.xft.xml,
- Templates/WebService-Empty.xft.xml, Templates/WebApplication.xpt.xml:
- Rename template files.
-
-2007-09-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Templates/CodeBehindWebControl.xft.xml,
- Templates/CodeBehindWebForm.xft.xml,
- Templates/MasterPageWithCodeBehind.xft.xml: Use SuppressAutoOpen to stop
- designer CodeBehind files from opening automatically when created.
-
-2007-09-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Templates/WebApplication.xpt.xml: Use new FileReferenceTemplate to
- reference CodeBehindWebForm instead of duplicating whole template.
-
-2007-09-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/XspParameters.cs: Fix some compile warnings.
- * Templates/CodeBehindWebHandler.xft.xml, Templates/EmptyWebForm.xft.xml,
- Templates/CodeBehindWebControl.xft.xml,
- Templates/CodeBehindWebService.xft.xml,
- Templates/CodeBehindWebForm.xft.xml,
- Templates/MasterPageWithNoCodeBehind.xft.xml,
- Templates/MasterPageWithCodeBehind.xft.xml,
- Templates/EmptyWebHandler.xft.xml, Templates/WebApplication.xpt.xml,
- Templates/EmptyWebControl.xft.xml, Templates/EmptyWebService.xft.xml:
- Use partial classes where possible. Default to deploying ASP.NET files
- rather than building them. Remove "Hello world" code. Default to 2.0
- runtime.
-
-2007-08-31 Mike Krüger <mkrueger@novell.com>
-
- * Gui/AspNetConfigurationPanel.cs, Gui/AspNetConfigurationPanelWidget.cs,
- Gui/XspOptionsPanel.cs: Changes due to new property infrastructure.
-
-2007-08-31 Ankit Jain <jankit@novell.com>
-
- * Templates/WebApplication.xpt.xml: Set BuildAction for aspx file to
- FileCopy.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.addin.xml, AspNetAddIn.mdp, Makefile.am: Reorganized the
- extension point hierarchy. Embedded all add-in manifests as resources.
-
-2007-08-01 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * AspNetAppProject.cs: Fix the IDeployable implementation. The target
- directory names should be handled by an ASP.NET-specific
- IDirectoryResolver, not the GetDeployFiles method.
-
-2007-07-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.mdp: Updated.
-
-2007-06-19 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Project/CodeBehind.cs: Oops, remove some development code in which
- caused sharing violations.
-
-2007-06-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/AspNetAddIn.AspNetConfigurationPanelWidget.cs,
- AspNetAddIn.mdp: Changed some old 2.4 dependencies to 2.8. Use
- GettextCatalog for localizable strings.
-
-2007-06-18 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Gui/AspNetConfigurationPanel.cs,
- Gui/AspNetConfigurationPanelWidget.cs, AspNetAddIn.glade,
- gtk-gui/generated.cs,
- gtk-gui/AspNetAddIn.AspNetConfigurationPanelWidget.cs,
- gtk-gui/objects.xml, gtk-gui/gui.stetic: More Stetic! Convert
- configuration panel widget from Glade to Stetic.
- * Project/CodeBehind.cs: Some shared code for handling CodeBehind.
- * Project/VerifyCodeBehindBuildStep.cs: Use partial classes if they're
- present.
- * Project/AspNetAppProjectConfiguration.cs: Silence the error when user
- picks non-library target type. Rename AutoGenerateCodeBehindMembers
- to GenerateNonPartialCodeBehindMembers.
- * Project/AspNetCodeBehindProvider.cs: Use code from Codebehind class.
- * AspNetAddIn.mdp, Makefile.am: Added files.
-
-2007-06-08 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Parser/Document.cs: Report parse errors on console, not in dialogue.
-
- * Parser/PageInfoVisitor.cs: Add CodeFile property.
-
-2007-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.addin.xml: Fix typo.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.mdp: Copy the .addins.xml file to the output dir.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.mdp: Don't copy project references.
-
-2007-05-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.mdp, Makefile.am: Reference shared assemblies from the
- correct location.
-
-2007-05-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.addin.xml: Fix add-in dependency.
-
-2007-05-07 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Project/VerifyCodeBehindBuildStep.cs: Make updating files thread-safe.
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.addin.xml, AspNetAddIn.mdp, Makefile.am: Migration to
- Mono.Addins.
-
-2007-04-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/AspNetAppProject.cs: Track api changes.
-
-2007-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/AspNetAppProject.cs: Track api changes.
- * AspNetAddIn.addin.xml, Makefile.am: Added dependency to
- MonoDevelop.Deployment.
- * AspNetAddIn.mdp: Don't copy referenced assemblies.
-
-2007-02-25 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Project/AspNetAppProject.cs:
- Remove DoPreBuild override as it's a deprecated build extension point.
- Now set AspNetAppProjectConfiguration.SourceDirectory via a FileName
- override, which is more robust.
- Implement GetDeployFiles to handle ASP.NET bin folder.
-
-2007-02-21 Ankit Jain <jankit@novell.com>
-
- * Project/VerifyCodeBehindBuildStep.cs: Warn the user if
- AutoGenerateCodeBehindMembers is false.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.addin.xml: Change add-in versions to 0.13.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetAddIn.mdp, Makefile.am: Synchronized the MD project and the
- Makefile
-
-2007-02-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/VerifyCodeBehindBuildStep.cs, AspNetAddIn.addin.xml,
- AspNetAddIn.mdp: Replace the IBuildStep implementation by a
- ProjectServiceExtension subclass. IBuildStep is not available
- anymore.
-
-2007-02-05 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Templates/MasterPageWithCodeBehind.xft.xml:
- * Project/AspNetDisplayBinding.cs:
- * Parser/PageInfoVisitor.cs: Fix errors in last commit that came from
- my misunderstanding of how the CodeBehind model doesn't apply to
- MasterPages. The CodeBehindService will need support for the
- CodeBeside model at some point.
-
-2007-02-04 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Parser/Tree/DirectiveNode.cs: Workaround for parser bug, so that
- Codebehind for MasterPages can be found.
-
- * Parser/Internal/*: Update from mcs class tree.
-
- * Parser/PageInfoVisitor.cs:
- * Project/AspNetDisplayBinding.cs: Handle MasterPages.
-
-2007-02-04 John Anderson <sontek@gmail.com>
-
- * Templates/MasterPageWithNoCodeBehind.xft.xml:
- * Templates/MasterPageWithCodeBehind.xft.xml:
- * Makefile.am:
- * AspNetAddIn.mdp:
- * AspNetAddIn.addin.xml: Added templates for MasterPages.
-
-2007-02-01 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Project/AspNetAppProject.cs: More informative error messages.
-
- * Project/AspNetCodeBehindProvider.cs: Track API changes.
-
-2007-01-18 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Templates/CodeBehindWebControl.xft.xml: Use the proper filename
- rather than "Default".
-
-2007-01-18 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * AspNetAddIn/Parser/Internal/TagType.cs:
- * AspNetAddIn/Parser/Internal/AspParser.cs:
- * AspNetAddIn/Parser/Internal/ParseException.cs:
- Make classes and members public so that AspNetAddIn's parser can
- consume them. Can revert this when AspNetEdit uses the whole parser
- rather that just the tokeniser as it does ATM.
-
-2006-09-19 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * AspNetAddIn.mdp: Updated.
-
-2006-09-16 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Gui/AspNetConfigurationPanel.cs:
- * AspNetAddIn.glade:
- * Project/AspNetAppProjectConfiguration.cs:
- * AspNetAddIn.addin.xml:
- * Project/VerifyCodeBehindBuildStep.cs:
- Added a new option that can be used to disable compilation-time
- CodeBehind verification for different configurations.
-
- * Makefile.am:
- * AspNetAddIn.mdp: Add Gui/AspNetConfigurationPanel.cs to the build.
-
-2006-09-13 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Project/AspNetAppProject.cs: Fix parsed document caching. Check if file
- can be parsed before parsing, instead of at cache lookup.
-
-2006-08-21 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Project/AspNetDisplayBinding.cs:
- * Project/AspNetAppProject.cs:
- * Parser/PageInfoVisitor.cs: Add support for Global.asax CodeBehind.
-
- * Project/AspNetCodeBehindProvider.cs:
- * Project/AspNetAppProject.cs: Don't try to create Documents for files
- that we can't parse.
-
- * Project/AspNetAppProject.cs: Improve web server launch checking code.
-
-2006-08-21 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Project/VerifyCodeBehindBuildStep.cs: Make sure modified files are
- saved before compilation.
- Update the parser database to make sure our parse information is
- valid.
-
- * Project/AspNetAppProject.cs: Add an operation cancel handler.
-
- * Parser/Document.cs: trap file loading exceptions.
-
-2006-08-05 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Project/VerifyCodeBehindBuildStep.cs:
- Track changes in BindingService.
- * AspNetAddIn.mdp: Remove nonexistent file.
-
-2006-07-25 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Project/AspNetAppProject.cs:
- Become aware of Project.DoPreBuild; let it create the correct output
- directory for us.
- * Project/VerifyCodeBehindBuildStep.cs:
- Refactored some functionality into Monodevelop.DesignerSupport.
- BindingService.
-
-
-2006-07-21 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Project/AspNetAppProject.cs:
- * Project/VerifyCodeBehindBuildStep.cs:
- Move Codebehind verification into a separate build step.
-
- * Project/CodeBehindClassBuilder.cs:
- * Project/AspNetCodeBehindProvider.cs:
- Deleted. Functionality moved to MonoDevelop.DesignerSupport.
- * Project/AspNetAppProject.cs:
- * AspNetAddIn.addin.xml:
- * Project/CodeBehindProjectFileExtension.cs:
- Implement CodeBehindProvider architecture.
-
- * Parser/PageInfoVisitor.cs:
- Find CodeBehind info for more filetypes.
-
- * Templates/CodeBehindWebHandler.xft.xml:
- * Templates/CodeBehindWebControl.xft.xml:
- * Templates/CodeBehindWebForm.xft.xml:
- * Templates/WebApplication.xpt.xml:
- Remove unnecessary underscores in CodeBehind class names.
-
- * Templates/CodeBehindWebService.xft.xml:
- * Templates/EmptyWebService.xft.xml:
- New templates.
-
-
- * Project/AspNetDisplayBinding.cs:
- New file. For now, makes it possible to open ASP.NET mime types.
-
- * AspNetAddIn.addin.xml:
- * Makefile.am:
- * AspNetAddIn.mdp:
- Include new files, remove old ones.
-
-2006-07-04 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Templates/CodeBehindWebControl.xft.xml:
- * Templates/CodeBehindWebForm.xft.xml:
-
- * Project/AspNetAppProject.cs:
- * Project/CodeBehindProjectFileExtension.cs:
- Don't always throw exceptions when CodeBehind not found.
-
- * AspNetAddIn.addin.xml:
- * Project/CodeBehindProjectFileExtension.cs:
- Change "HideCodeBehind" option to "ShowCodeBehindFiles"
-
- * Project/AspNetFileDescriptionTemplate.cs:
- Move translation functionality to child CodeTranslationFileDescriptionTemplate.
- Move name substitution functionality to SingleFileDescriptionTemplate.
-
- * Templates/CodeBehindWebHandler.xft.xml:
- * Templates/EmptyWebForm.xft.xml:
- * Templates/CodeBehindWebControl.xft.xml:
- * Templates/CodeBehindWebForm.xft.xml:
- * Templates/EmptyWebHandler.xft.xml:
- * Templates/WebApplication.xpt.xml:
- * Templates/EmptyWebControl.xft.xml:
- Track AspNetFileDescriptionTemplate changes.
diff --git a/main/src/addins/AspNet/Commands/AddControllerDialog.cs b/main/src/addins/AspNet/Commands/AddControllerDialog.cs
index 603e60dbf0..7cce727a93 100644
--- a/main/src/addins/AspNet/Commands/AddControllerDialog.cs
+++ b/main/src/addins/AspNet/Commands/AddControllerDialog.cs
@@ -29,6 +29,7 @@ using System.Collections.Generic;
using Gtk;
using MonoDevelop.Core;
using MonoDevelop.AspNet.Projects;
+using MonoDevelop.Projects;
namespace MonoDevelop.AspNet.Commands
{
@@ -57,13 +58,14 @@ namespace MonoDevelop.AspNet.Commands
}
}
- public AddControllerDialog (AspNetAppProject project)
+ public AddControllerDialog (DotNetProject project)
{
Build ();
+ var ext = project.GetService<AspNetAppProjectFlavor> ();
provider = project.LanguageBinding.GetCodeDomProvider ();
- loadedTemplateList = project.GetCodeTemplates ("AddController");
+ loadedTemplateList = ext.GetCodeTemplates ("AddController");
bool foundEmptyTemplate = false;
int templateIndex = 0;
foreach (string file in loadedTemplateList) {
diff --git a/main/src/addins/AspNet/Commands/AddViewDialog.cs b/main/src/addins/AspNet/Commands/AddViewDialog.cs
index c7e2dc7460..4f107b31f5 100644
--- a/main/src/addins/AspNet/Commands/AddViewDialog.cs
+++ b/main/src/addins/AspNet/Commands/AddViewDialog.cs
@@ -27,22 +27,25 @@
using System;
using System.IO;
using System.Collections.Generic;
+using System.Threading.Tasks;
using PP = System.IO.Path;
-using MonoDevelop.Ide;
+using Gtk;
+using Microsoft.CodeAnalysis;
using MonoDevelop.Core;
-using ICSharpCode.NRefactory.TypeSystem;
+using MonoDevelop.Ide;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.AspNet.Projects;
-using MonoDevelop.AspNet.WebForms.Dom;
using MonoDevelop.AspNet.WebForms;
-using Gtk;
+using MonoDevelop.Projects;
+using MonoDevelop.AspNet.WebForms.Dom;
namespace MonoDevelop.AspNet.Commands
{
class AddViewDialog : Dialog
{
- readonly AspNetAppProject project;
+ readonly DotNetProject project;
+ readonly AspNetAppProjectFlavor aspFlavor;
IDictionary<string, IList<string>> loadedTemplateList;
IDictionary<string, ListStore> templateStore;
ListStore dataClassStore;
@@ -61,9 +64,10 @@ namespace MonoDevelop.AspNet.Commands
CheckButton partialCheck, stronglyTypedCheck, masterCheck;
Alignment typePanel, masterPanel;
- public AddViewDialog (AspNetAppProject project)
+ public AddViewDialog (DotNetProject project)
{
this.project = project;
+ aspFlavor = project.GetService<AspNetAppProjectFlavor> ();
Build ();
@@ -73,14 +77,14 @@ namespace MonoDevelop.AspNet.Commands
loadedTemplateList = new Dictionary<string, IList<string>> ();
foreach (var engine in viewEngines) {
viewEngineCombo.AppendText (engine);
- loadedTemplateList[engine] = project.GetCodeTemplates ("AddView", engine);
+ loadedTemplateList[engine] = aspFlavor.GetCodeTemplates ("AddView", engine);
}
viewEngineCombo.Active = 0;
InitializeTemplateStore (loadedTemplateList);
ContentPlaceHolders = new List<string> ();
- string siteMaster = project.VirtualToLocalPath ("~/Views/Shared/Site.master", null);
+ string siteMaster = aspFlavor.VirtualToLocalPath ("~/Views/Shared/Site.master", null);
if (project.Files.GetFile (siteMaster) != null)
masterEntry.Text = "~/Views/Shared/Site.master";
@@ -221,7 +225,7 @@ namespace MonoDevelop.AspNet.Commands
IEnumerable<string> GetProperViewEngines ()
{
yield return "Aspx";
- if (project.SupportsRazorViewEngine)
+ if (aspFlavor.SupportsRazorViewEngine)
yield return "Razor";
}
@@ -278,12 +282,13 @@ namespace MonoDevelop.AspNet.Commands
Validate ();
}
- protected void UpdateTypePanelSensitivity (object sender, EventArgs e)
+ protected async void UpdateTypePanelSensitivity (object sender, EventArgs e)
{
bool enabled = typePanel.Sensitive = stronglyTypedCheck.Active;
if (enabled && classDataProvider == null) {
- classDataProvider = new TypeDataProvider (project);
+ classDataProvider = new TypeDataProvider ();
+ await classDataProvider.GetTypes (project);
dataClassStore = new ListStore (typeof (string));
foreach (var item in classDataProvider.TypeNamesList)
dataClassStore.AppendValues (item);
@@ -307,7 +312,7 @@ namespace MonoDevelop.AspNet.Commands
return false;
if (!IsPartialView && HasMaster && ActiveViewEngine != "Razor") {
- if (String.IsNullOrEmpty (MasterFile) || !File.Exists (project.VirtualToLocalPath (oldMaster, null)))
+ if (String.IsNullOrEmpty (MasterFile) || !File.Exists (aspFlavor.VirtualToLocalPath (oldMaster, null)))
return false;
//PrimaryPlaceHolder can be empty
//Layout Page can be empty in Razor Views - it's usually set in _ViewStart.cshtml file
@@ -341,14 +346,14 @@ namespace MonoDevelop.AspNet.Commands
};
try {
if (MessageService.RunCustomDialog (dialog) == (int) ResponseType.Ok)
- masterEntry.Text = project.LocalToVirtualPath (dialog.SelectedFile.FilePath);
+ masterEntry.Text = aspFlavor.LocalToVirtualPath (dialog.SelectedFile.FilePath);
} finally {
dialog.Destroy ();
dialog.Dispose ();
}
}
- protected virtual void MasterChanged (object sender, EventArgs e)
+ protected virtual async void MasterChanged (object sender, EventArgs e)
{
if (IsPartialView || !HasMaster)
return;
@@ -360,11 +365,11 @@ namespace MonoDevelop.AspNet.Commands
primaryPlaceholderStore.Clear ();
ContentPlaceHolders.Clear ();
- string realPath = project.VirtualToLocalPath (oldMaster, null);
+ string realPath = aspFlavor.VirtualToLocalPath (oldMaster, null);
if (!File.Exists (realPath))
return;
- var pd = TypeSystemService.ParseFile (project, realPath) as WebFormsParsedDocument;
+ var pd = await TypeSystemService.ParseFile (project, realPath) as WebFormsParsedDocument;
if (pd != null) {
try {
@@ -468,22 +473,18 @@ namespace MonoDevelop.AspNet.Commands
class TypeDataProvider
{
- public List<ITypeDefinition> TypesList { get; private set; }
- public List<string> TypeNamesList { get; private set; }
- Ambience ambience;
-
- public TypeDataProvider (MonoDevelop.Projects.DotNetProject project)
+ public List<INamedTypeSymbol> TypesList { get; private set; }
+ public List<string> TypeNamesList { get; private set; }
+
+ public async Task GetTypes (MonoDevelop.Projects.DotNetProject project)
{
- TypeNamesList = new List<string> ();
- var ctx = TypeSystemService.GetCompilation (project);
- TypesList = new List<ITypeDefinition> (ctx.MainAssembly.GetAllTypeDefinitions ());
- this.ambience = AmbienceService.GetAmbience (project.LanguageName);
+ TypeNamesList = new List<string> ();
+ var ctx = await TypeSystemService.GetCompilationAsync (project);
+ TypesList = new List<INamedTypeSymbol> (ctx.GetAllTypesInMainAssembly ());
foreach (var typeDef in TypesList) {
- TypeNamesList.Add (ambience.GetString ((IEntity)typeDef, OutputFlags.IncludeGenerics | OutputFlags.UseFullName | OutputFlags.IncludeMarkup));
+ TypeNamesList.Add (Ambience.EscapeText (typeDef.ToDisplayString (SymbolDisplayFormat.CSharpErrorMessageFormat)));
}
}
}
}
}
-
-
diff --git a/main/src/addins/AspNet/Commands/AddViewFromControllerCommandHandler.cs b/main/src/addins/AspNet/Commands/AddViewFromControllerCommandHandler.cs
index f24df75a1c..2c437a46ba 100644
--- a/main/src/addins/AspNet/Commands/AddViewFromControllerCommandHandler.cs
+++ b/main/src/addins/AspNet/Commands/AddViewFromControllerCommandHandler.cs
@@ -28,6 +28,7 @@ using System;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide;
using MonoDevelop.AspNet.Projects;
+using MonoDevelop.Projects;
namespace MonoDevelop.AspNet.Commands
{
@@ -41,20 +42,16 @@ namespace MonoDevelop.AspNet.Commands
protected override void Run ()
{
var doc = IdeApp.Workbench.ActiveDocument;
- var project = (AspNetAppProject)doc.Project;
- var currentLocation = doc.Editor.Caret.Location;
+ var project = (DotNetProject)doc.Project;
- string controllerName = doc.ParsedDocument.GetTopLevelTypeDefinition (currentLocation).Name;
- int pos = controllerName.LastIndexOf ("Controller", StringComparison.Ordinal);
- if (pos > 0)
- controllerName = controllerName.Remove (pos);
+ var method = MethodDeclarationAtCaret.Create (doc);
+ string controllerName = method.GetParentMvcControllerName ();
+ string path = doc.FileName.ParentDirectory.ParentDirectory.Combine ("Views", controllerName);
- string path = doc.FileName.ParentDirectory.ParentDirectory.Combine ("Views", controllerName);
- string actionName = doc.ParsedDocument.GetMember (currentLocation).Name;
- AddView (project, path, actionName);
+ AddView (project, path, method.Name);
}
- public static void AddView (AspNetAppProject project, string path, string name)
+ public static void AddView (DotNetProject project, string path, string name)
{
var provider = project.LanguageBinding.GetCodeDomProvider ();
if (provider == null)
@@ -127,7 +124,7 @@ namespace MonoDevelop.AspNet.Commands
if (System.IO.File.Exists (outputFile)) {
project.AddFile (outputFile);
- IdeApp.ProjectOperations.Save (project);
+ IdeApp.ProjectOperations.SaveAsync (project);
}
}
}
diff --git a/main/src/addins/AspNet/Commands/GoToControllerCommandHandler.cs b/main/src/addins/AspNet/Commands/GoToControllerCommandHandler.cs
index ed2251cb31..2d5c091f3f 100644
--- a/main/src/addins/AspNet/Commands/GoToControllerCommandHandler.cs
+++ b/main/src/addins/AspNet/Commands/GoToControllerCommandHandler.cs
@@ -1,47 +1,53 @@
-//
-// GoToControllerCommandHandler.cs
-//
-// Author:
-// Piotr Dowgiallo <sparekd@gmail.com>
-//
-// Copyright (c) 2012 Piotr Dowgiallo
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
+//
+// GoToControllerCommandHandler.cs
+//
+// Author:
+// Piotr Dowgiallo <sparekd@gmail.com>
+//
+// Copyright (c) 2012 Piotr Dowgiallo
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
using System;
using System.Linq;
-using ICSharpCode.NRefactory.TypeSystem;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.AspNet.Projects;
using MonoDevelop.Components.Commands;
using MonoDevelop.Core;
using MonoDevelop.Ide;
-using MonoDevelop.AspNet.Projects;
-
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Refactoring;
+
namespace MonoDevelop.AspNet.Commands
{
-
class GoToControllerCommandHandler : CommandHandler
{
protected override void Update (CommandInfo info)
{
var doc = IdeApp.Workbench.ActiveDocument;
- AspNetAppProject project;
- if (doc == null || (project = doc.Project as AspNetAppProject) == null || !project.IsAspMvcProject) {
+ if (doc == null || doc.Project == null) {
+ info.Enabled = info.Visible = false;
+ return;
+ }
+ var aspFlavor = doc.Project.GetService<AspNetAppProjectFlavor> ();
+ if (aspFlavor == null || !aspFlavor.IsAspMvcProject) {
info.Enabled = info.Visible = false;
return;
}
@@ -50,17 +56,26 @@ namespace MonoDevelop.AspNet.Commands
info.Enabled = info.Visible = false;
}
- protected override void Run ()
+ protected override async void Run ()
{
var doc = IdeApp.Workbench.ActiveDocument;
var name = doc.FileName.ParentDirectory.FileName;
- var controller = doc.ProjectContent.GetAllTypeDefinitions ().FirstOrDefault (t => t.Name == name + "Controller");
+ var controller = await FindController (doc.Project, name);
if (controller != null)
- IdeApp.Workbench.OpenDocument (controller.UnresolvedFile.FileName, doc.Project);
+ await RefactoringService.RoslynJumpToDeclaration (controller, doc.Project);
else
MessageService.ShowError ("Matching controller cannot be found.");
}
+
+ async Task<INamedTypeSymbol> FindController (MonoDevelop.Projects.Project project, string name)
+ {
+ var compilation = await TypeSystemService.GetCompilationAsync (project);
+ if (compilation == null)
+ return null;
+
+ return compilation.GetAllTypesInMainAssembly ()
+ .FirstOrDefault (symbol => symbol.Name == name + "Controller");
+ }
}
-
}
diff --git a/main/src/addins/AspNet/Commands/GoToViewCommandHandler.cs b/main/src/addins/AspNet/Commands/GoToViewCommandHandler.cs
index cbdfed0257..f84173bdca 100644
--- a/main/src/addins/AspNet/Commands/GoToViewCommandHandler.cs
+++ b/main/src/addins/AspNet/Commands/GoToViewCommandHandler.cs
@@ -26,7 +26,6 @@
using System;
using System.IO;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Components.Commands;
using MonoDevelop.Core;
using MonoDevelop.Ide;
@@ -43,17 +42,12 @@ namespace MonoDevelop.AspNet.Commands
protected override void Run ()
{
var doc = IdeApp.Workbench.ActiveDocument;
- var currentLocation = doc.Editor.Caret.Location;
+ var method = MethodDeclarationAtCaret.Create (doc);
+ string controllerName = method.GetParentMvcControllerName ();
- var controller = doc.ParsedDocument.GetTopLevelTypeDefinition (currentLocation);
- string controllerName = controller.Name;
- int pos = controllerName.LastIndexOf ("Controller", StringComparison.Ordinal);
- if (pos > 0)
- controllerName = controllerName.Remove (pos);
-
var baseDirectory = doc.FileName.ParentDirectory.ParentDirectory;
- string actionName = doc.ParsedDocument.GetMember (currentLocation).Name;
+ string actionName = method.Name;
var viewFoldersPaths = new [] {
baseDirectory.Combine ("Views", controllerName),
baseDirectory.Combine ("Views", "Shared")
diff --git a/main/src/addins/AspNet/Commands/MethodDeclarationAtCaret.cs b/main/src/addins/AspNet/Commands/MethodDeclarationAtCaret.cs
new file mode 100644
index 0000000000..83ba6b4db2
--- /dev/null
+++ b/main/src/addins/AspNet/Commands/MethodDeclarationAtCaret.cs
@@ -0,0 +1,118 @@
+//
+// MethodAtCaret.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Linq;
+using MonoDevelop.Ide.Gui;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace MonoDevelop.AspNet.Commands
+{
+ class MethodDeclarationAtCaret
+ {
+ MethodDeclarationAtCaret ()
+ {
+ }
+
+ public static readonly MethodDeclarationAtCaret NullMethodDeclaration = new MethodDeclarationAtCaret ();
+
+ public bool IsMethodFound {
+ get {
+ return TypeDeclaration != null && MethodDeclaration != null;
+ }
+ }
+
+ public TypeDeclarationSyntax TypeDeclaration { get; private set; }
+ public MethodDeclarationSyntax MethodDeclaration { get; private set; }
+
+ public string Name {
+ get {
+ if (MethodDeclaration != null)
+ return MethodDeclaration.Identifier.ValueText;
+ return String.Empty;
+ }
+ }
+
+ public static MethodDeclarationAtCaret Create (MonoDevelop.Ide.Gui.Document doc)
+ {
+ var parsedDocument = doc.AnalysisDocument;
+ if (parsedDocument == null)
+ return NullMethodDeclaration;
+
+ SyntaxNode root = null;
+ if (!parsedDocument.TryGetSyntaxRoot (out root))
+ return NullMethodDeclaration;
+
+ SyntaxNode currentNode;
+ try {
+ int caretOffset = doc.Editor.CaretOffset;
+ currentNode = root.FindNode (TextSpan.FromBounds (caretOffset, caretOffset));
+ } catch (Exception) {
+ return NullMethodDeclaration;
+ }
+
+ var currentType = currentNode.AncestorsAndSelf ().OfType<TypeDeclarationSyntax> ().FirstOrDefault ();
+ var currentMethod = currentNode.AncestorsAndSelf ().OfType<MethodDeclarationSyntax> ().FirstOrDefault ();
+
+ return new MethodDeclarationAtCaret {
+ TypeDeclaration = currentType,
+ MethodDeclaration = currentMethod
+ };
+ }
+
+ public bool IsParentMvcController ()
+ {
+ return TypeDeclaration.Identifier.ValueText.EndsWith ("Controller", StringComparison.OrdinalIgnoreCase);
+ }
+
+ public bool IsMvcViewMethod ()
+ {
+ var correctReturnTypes = new [] { "ActionResult", "ViewResultBase", "ViewResult", "PartialViewResult" };
+
+ string returnTypeName = MethodDeclaration.ReturnType.ToString ();
+
+ return MethodDeclaration.Modifiers.Any (t => t.Kind () == SyntaxKind.PublicKeyword) &&
+ correctReturnTypes.Any (t => t == returnTypeName);
+ }
+
+ public string GetParentMvcControllerName ()
+ {
+ if (TypeDeclaration == null)
+ return String.Empty;
+
+ string controllerName = TypeDeclaration.Identifier.ValueText;
+ int pos = controllerName.LastIndexOf ("Controller", StringComparison.Ordinal);
+ if (pos > 0)
+ controllerName = controllerName.Remove (pos);
+
+ return controllerName;
+ }
+ }
+}
+
diff --git a/main/src/addins/AspNet/Commands/MvcCommandsCommonHandler.cs b/main/src/addins/AspNet/Commands/MvcCommandsCommonHandler.cs
index 03fa16fb63..8f8acfc539 100644
--- a/main/src/addins/AspNet/Commands/MvcCommandsCommonHandler.cs
+++ b/main/src/addins/AspNet/Commands/MvcCommandsCommonHandler.cs
@@ -26,7 +26,6 @@
using System;
using System.Linq;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide;
using MonoDevelop.AspNet.Projects;
@@ -38,23 +37,21 @@ namespace MonoDevelop.AspNet.Commands
public static void Update (CommandInfo info)
{
var doc = IdeApp.Workbench.ActiveDocument;
- AspNetAppProject project;
- if (doc == null || (project = doc.Project as AspNetAppProject) == null || !project.IsAspMvcProject || doc.ParsedDocument == null) {
+ if (doc == null || doc.Project == null || doc.ParsedDocument == null) {
info.Enabled = info.Visible = false;
return;
}
-
- var currentLocation = doc.Editor.Caret.Location;
- var topLevelType = doc.ParsedDocument.GetTopLevelTypeDefinition (currentLocation);
- if (topLevelType == null || !topLevelType.Name.EndsWith ("Controller", StringComparison.Ordinal)) {
+ var aspFlavor = doc.Project.GetService<AspNetAppProjectFlavor> ();
+ if (aspFlavor == null || !aspFlavor.IsAspMvcProject) {
info.Enabled = info.Visible = false;
return;
}
- var correctReturnTypes = new [] { "ActionResult", "ViewResultBase", "ViewResult", "PartialViewResult" };
- var member = doc.ParsedDocument.GetMember (currentLocation) as IUnresolvedMethod;
- if (member == null || !member.IsPublic || correctReturnTypes.All (t => t != member.ReturnType.ToString ()))
- info.Enabled = info.Visible = false;
+ var method = MethodDeclarationAtCaret.Create (doc);
+ if (method.IsMethodFound && method.IsParentMvcController () && method.IsMvcViewMethod ())
+ return;
+
+ info.Enabled = info.Visible = false;
}
}
}
diff --git a/main/src/addins/AspNet/Execution/AspNetExecutionHandler.cs b/main/src/addins/AspNet/Execution/AspNetExecutionHandler.cs
index 2e0dcca894..07dd65991f 100644
--- a/main/src/addins/AspNet/Execution/AspNetExecutionHandler.cs
+++ b/main/src/addins/AspNet/Execution/AspNetExecutionHandler.cs
@@ -89,7 +89,7 @@ namespace MonoDevelop.AspNet.Execution
return cmd != null && !string.IsNullOrEmpty (GetXspName (cmd));
}
- public IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
+ public ProcessAsyncOperation Execute (ExecutionCommand command, OperationConsole console)
{
var cmd = (AspNetExecutionCommand) command;
var xspPath = GetXspPath (cmd);
@@ -102,6 +102,11 @@ namespace MonoDevelop.AspNet.Execution
evars.Add (v.Key, v.Value);
}
+ //HACK: work around Mono trying to create registry in non-writable location
+ if (cmd.TargetRuntime is MonoTargetRuntime && !Platform.IsWindows) {
+ evars ["MONO_REGISTRY_PATH"] = UserProfile.Current.TempDir.Combine ("aspnet-registry");
+ }
+
//if it's a script, use a native execution handler
if (xspPath.Extension != ".exe") {
//set mono debug mode if project's in debug mode
diff --git a/main/src/addins/AspNet/Execution/BrowserLauncher.cs b/main/src/addins/AspNet/Execution/BrowserLauncher.cs
index 6a03216721..628b4cdd00 100644
--- a/main/src/addins/AspNet/Execution/BrowserLauncher.cs
+++ b/main/src/addins/AspNet/Execution/BrowserLauncher.cs
@@ -35,7 +35,7 @@ namespace MonoDevelop.AspNet.Execution
{
static class BrowserLauncher
{
- public static IProcessAsyncOperation LaunchDefaultBrowser (string url)
+ public static ProcessAsyncOperation LaunchDefaultBrowser (string url)
{
try {
DesktopService.ShowUrl (url);
diff --git a/main/src/addins/AspNet/Execution/XspBrowserLauncherConsole.cs b/main/src/addins/AspNet/Execution/XspBrowserLauncherConsole.cs
index c62fea6de7..c515dcb6eb 100644
--- a/main/src/addins/AspNet/Execution/XspBrowserLauncherConsole.cs
+++ b/main/src/addins/AspNet/Execution/XspBrowserLauncherConsole.cs
@@ -30,35 +30,33 @@ using MonoDevelop.Core.Execution;
namespace MonoDevelop.AspNet.Execution
{
- class XspBrowserLauncherConsole : IConsole
+ class XspBrowserLauncherConsole : OperationConsole
{
- readonly IConsole real;
+ readonly OperationConsole real;
LineInterceptingTextWriter outWriter;
- Action <string> launchBrowser;
+ Action <string> launchBrowser;
+ IDisposable cancelReg;
const int MAX_WATCHED_LINES = 30;
- public XspBrowserLauncherConsole (IConsole real, Action <string> launchBrowser)
+ public XspBrowserLauncherConsole (OperationConsole real, Action <string> launchBrowser)
{
this.real = real;
- this.launchBrowser = launchBrowser;
+ this.launchBrowser = launchBrowser;
+ cancelReg = real.CancellationToken.Register (CancellationSource.Cancel);
}
- public void Dispose ()
+ public override void Dispose ()
{
- real.Dispose ();
+ cancelReg.Dispose ();
+ real.Dispose ();
}
-
- public event EventHandler CancelRequested {
- add { real.CancelRequested += value; }
- remove { real.CancelRequested -= value; }
- }
-
- public TextReader In {
+
+ public override TextReader In {
get { return real.In; }
}
- public TextWriter Out {
+ public override TextWriter Out {
get {
if (outWriter == null)
outWriter = new LineInterceptingTextWriter (real.Out, delegate {
@@ -75,16 +73,12 @@ namespace MonoDevelop.AspNet.Execution
}
}
- public TextWriter Error {
+ public override TextWriter Error {
get { return real.Error; }
}
- public TextWriter Log {
+ public override TextWriter Log {
get { return real.Log; }
}
-
- public bool CloseOnDispose {
- get { return real.CloseOnDispose; }
- }
}
}
diff --git a/main/src/addins/AspNet/Execution/XspOptionsPanel.cs b/main/src/addins/AspNet/Execution/XspOptionsPanel.cs
index 6bd97b965d..5a97bb0c15 100644
--- a/main/src/addins/AspNet/Execution/XspOptionsPanel.cs
+++ b/main/src/addins/AspNet/Execution/XspOptionsPanel.cs
@@ -29,7 +29,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.AspNet.Projects;
@@ -39,14 +39,14 @@ namespace MonoDevelop.AspNet.Execution
{
XspOptionsPanelWidget panel;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
- return panel = new XspOptionsPanelWidget ((AspNetAppProject) ConfiguredProject);
+ return panel = new XspOptionsPanelWidget (ConfiguredProject.GetService<AspNetAppProjectFlavor> ());
}
public override void ApplyChanges ()
{
- panel.Store ((AspNetAppProject) ConfiguredProject);
+ panel.Store (ConfiguredProject.GetService<AspNetAppProjectFlavor> ());
}
}
}
diff --git a/main/src/addins/AspNet/Execution/XspOptionsPanelWidget.cs b/main/src/addins/AspNet/Execution/XspOptionsPanelWidget.cs
index 18126f4836..39ff9e1f25 100644
--- a/main/src/addins/AspNet/Execution/XspOptionsPanelWidget.cs
+++ b/main/src/addins/AspNet/Execution/XspOptionsPanelWidget.cs
@@ -46,7 +46,7 @@ namespace MonoDevelop.AspNet.Execution
readonly FileEntry certLocation = new FileEntry ();
readonly Entry passwordEntry = new Entry { InvisibleChar = '●' };
- public XspOptionsPanelWidget (AspNetAppProject project)
+ public XspOptionsPanelWidget (AspNetAppProjectFlavor project)
{
Build ();
@@ -165,7 +165,7 @@ namespace MonoDevelop.AspNet.Execution
ShowAll ();
}
- public void Store (AspNetAppProject project)
+ public void Store (AspNetAppProjectFlavor project)
{
XspParameters xPar = project.XspParameters;
diff --git a/main/src/addins/AspNet/Html/BaseHtmlEditorExtension.cs b/main/src/addins/AspNet/Html/BaseHtmlEditorExtension.cs
index b20a67c689..9050fd647e 100644
--- a/main/src/addins/AspNet/Html/BaseHtmlEditorExtension.cs
+++ b/main/src/addins/AspNet/Html/BaseHtmlEditorExtension.cs
@@ -34,7 +34,9 @@ using MonoDevelop.Core;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.AspNet.Html.Parser;
using MonoDevelop.Xml.Parser;
-using MonoDevelop.Xml.Dom;
+using MonoDevelop.Xml.Dom;
+using System.Threading.Tasks;
+using System.Threading;
namespace MonoDevelop.AspNet.Html
{
@@ -84,7 +86,7 @@ namespace MonoDevelop.AspNet.Html
return new XmlRootState (new HtmlTagState (), new HtmlClosingTagState (true));
}
- public override void Initialize ()
+ protected override void Initialize ()
{
base.Initialize ();
@@ -94,73 +96,71 @@ namespace MonoDevelop.AspNet.Html
#endregion
- protected override void GetElementCompletions (CompletionDataList list)
+ protected override async Task<CompletionDataList> GetElementCompletions (CancellationToken token)
{
+ var list = new CompletionDataList ();
XName parentName = GetParentElementName (0);
- AddHtmlTagCompletionData (list, Schema, parentName);
+ await AddHtmlTagCompletionData (list, Schema, parentName, token);
AddMiscBeginTags (list);
//FIXME: don't show this after any elements
if (DocType == null)
list.Add ("!DOCTYPE", "md-literal", GettextCatalog.GetString ("Document type"));
+ return list;
}
- protected override CompletionDataList GetDocTypeCompletions ()
+ protected override Task<CompletionDataList> GetDocTypeCompletions (CancellationToken token)
{
- return new CompletionDataList (from DocTypeCompletionData dat
+ return Task.FromResult (new CompletionDataList (from DocTypeCompletionData dat
in HtmlSchemaService.DocTypeCompletionData
- select (CompletionData) dat);
+ select (CompletionData) dat));
}
- protected override CompletionDataList GetAttributeCompletions (IAttributedXObject attributedOb,
- Dictionary<string, string> existingAtts)
+ protected override async Task<CompletionDataList> GetAttributeCompletions (IAttributedXObject attributedOb,
+ Dictionary<string, string> existingAtts, CancellationToken token)
{
- if (attributedOb is XElement && !attributedOb.Name.HasPrefix) {
- var list = new CompletionDataList ();
- AddHtmlAttributeCompletionData (list, Schema, attributedOb.Name, existingAtts);
- return list;
- }
- return null;
+ var list = new CompletionDataList ();
+ if (attributedOb is XElement && !attributedOb.Name.HasPrefix)
+ await AddHtmlAttributeCompletionData (list, Schema, attributedOb.Name, existingAtts, token);
+ return list;
}
- protected override CompletionDataList GetAttributeValueCompletions (IAttributedXObject ob, XAttribute att)
+ protected override async Task<CompletionDataList> GetAttributeValueCompletions (IAttributedXObject ob, XAttribute att, CancellationToken token)
{
- if (ob is XElement && !ob.Name.HasPrefix) {
- var list = new CompletionDataList ();
- AddHtmlAttributeValueCompletionData (list, Schema, ob.Name, att.Name);
- return list;
- }
- return null;
+ var list = new CompletionDataList ();
+ if (ob is XElement && !ob.Name.HasPrefix)
+ await AddHtmlAttributeValueCompletionData (list, Schema, ob.Name, att.Name, token);
+ return list;
}
#region HTML data
- protected static void AddHtmlTagCompletionData (CompletionDataList list, HtmlSchema schema, XName parentName)
+ protected static async Task AddHtmlTagCompletionData (CompletionDataList list, HtmlSchema schema, XName parentName, CancellationToken token)
{
if (schema == null)
return;
if (parentName.IsValid) {
- list.AddRange (schema.CompletionProvider.GetChildElementCompletionData (parentName.FullName.ToLower ()));
+ list.AddRange (await schema.CompletionProvider.GetChildElementCompletionData (parentName.FullName.ToLower (), token));
} else {
- list.AddRange (schema.CompletionProvider.GetElementCompletionData ());
+ list.AddRange (await schema.CompletionProvider.GetElementCompletionData (token));
}
}
- protected void AddHtmlAttributeCompletionData (CompletionDataList list, HtmlSchema schema,
- XName tagName, Dictionary<string, string> existingAtts)
+ protected async Task AddHtmlAttributeCompletionData (CompletionDataList list, HtmlSchema schema,
+ XName tagName, Dictionary<string, string> existingAtts, CancellationToken token)
{
//add atts only if they're not aready in the tag
- foreach (var datum in schema.CompletionProvider.GetAttributeCompletionData (tagName.FullName.ToLower ()))
+ foreach (var datum in await schema.CompletionProvider.GetAttributeCompletionData (tagName.FullName.ToLower (), token))
if (existingAtts == null || !existingAtts.ContainsKey (datum.DisplayText))
list.Add (datum);
}
- protected void AddHtmlAttributeValueCompletionData (CompletionDataList list, HtmlSchema schema,
- XName tagName, XName attributeName)
+ protected async Task AddHtmlAttributeValueCompletionData (CompletionDataList list, HtmlSchema schema,
+ XName tagName, XName attributeName, CancellationToken token)
{
- list.AddRange (schema.CompletionProvider.GetAttributeValueCompletionData (tagName.FullName,
- attributeName.FullName));
+ list.AddRange (await schema.CompletionProvider.GetAttributeValueCompletionData (tagName.FullName,
+ attributeName.FullName, token));
}
#endregion
diff --git a/main/src/addins/AspNet/Html/DocTypeCompletionData.cs b/main/src/addins/AspNet/Html/DocTypeCompletionData.cs
index 583293ab43..571f8e0125 100644
--- a/main/src/addins/AspNet/Html/DocTypeCompletionData.cs
+++ b/main/src/addins/AspNet/Html/DocTypeCompletionData.cs
@@ -29,6 +29,7 @@
using System;
using MonoDevelop.Core;
using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Ide.Editor.Extension;
namespace MonoDevelop.AspNet.Html
{
@@ -61,24 +62,21 @@ namespace MonoDevelop.AspNet.Html
get { return name; }
}
- public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
- MonoDevelop.Ide.Gui.Content.IEditableTextBuffer buf = window.CompletionWidget as MonoDevelop.Ide.Gui.Content.IEditableTextBuffer;
+ var buf = window.CompletionWidget;
if (buf != null) {
- using (var undo = buf.OpenUndoGroup ()) {
- int deleteStartOffset = window.CodeCompletionContext.TriggerOffset;
- if (text.StartsWith (docTypeStart)) {
- int start = window.CodeCompletionContext.TriggerOffset - docTypeStart.Length;
- if (start >= 0) {
- string readback = buf.GetText (start, window.CodeCompletionContext.TriggerOffset);
- if (string.Compare (readback, docTypeStart, StringComparison.OrdinalIgnoreCase) == 0)
- deleteStartOffset -= docTypeStart.Length;
- }
+ int deleteStartOffset = window.CodeCompletionContext.TriggerOffset;
+ if (text.StartsWith (docTypeStart)) {
+ int start = window.CodeCompletionContext.TriggerOffset - docTypeStart.Length;
+ if (start >= 0) {
+ string readback = buf.GetText (start, window.CodeCompletionContext.TriggerOffset);
+ if (string.Compare (readback, docTypeStart, StringComparison.OrdinalIgnoreCase) == 0)
+ deleteStartOffset -= docTypeStart.Length;
}
-
- buf.DeleteText (deleteStartOffset, buf.CursorPosition - deleteStartOffset);
- buf.InsertText (buf.CursorPosition, text);
- }
+ }
+
+ buf.Replace (deleteStartOffset, buf.CaretOffset - deleteStartOffset, text);
}
}
}
diff --git a/main/src/addins/AspNet/Html/HtmlEditorExtension.cs b/main/src/addins/AspNet/Html/HtmlEditorExtension.cs
index c287c6f7f0..b8913eadcd 100644
--- a/main/src/addins/AspNet/Html/HtmlEditorExtension.cs
+++ b/main/src/addins/AspNet/Html/HtmlEditorExtension.cs
@@ -26,9 +26,9 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.Html
{
@@ -86,11 +86,11 @@ namespace MonoDevelop.AspNet.Html
XElement el = n as XElement;
if (el != null && el.IsClosed && el.ClosingTag.Region.End > region.End) {
- region = new DomRegion (region.Begin, el.ClosingTag.Region.End);
+ region = new DocumentRegion (region.Begin, el.ClosingTag.Region.End);
}
- int s = Editor.Document.LocationToOffset (region.BeginLine, region.BeginColumn );
- int e = Editor.Document.LocationToOffset (region.EndLine, region.EndColumn);
+ int s = Editor.LocationToOffset (region.BeginLine, region.BeginColumn );
+ int e = Editor.LocationToOffset (region.EndLine, region.EndColumn);
if (e > s && s > -1)
Editor.SetSelection (s, e);
}
diff --git a/main/src/addins/AspNet/Html/HtmlParser.cs b/main/src/addins/AspNet/Html/HtmlParser.cs
index 6938328c0c..05f80ff6b3 100644
--- a/main/src/addins/AspNet/Html/HtmlParser.cs
+++ b/main/src/addins/AspNet/Html/HtmlParser.cs
@@ -30,21 +30,20 @@ using System;
using System.Collections.Generic;
using System.IO;
-using ICSharpCode.NRefactory.TypeSystem;
-
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Projects;
using MonoDevelop.Xml.Dom;
using MonoDevelop.Xml.Parser;
using MonoDevelop.AspNet.Html.Parser;
+using MonoDevelop.Core.Text;
namespace MonoDevelop.AspNet.Html
{
public class HtmlParser : TypeSystemParser
{
- public override ParsedDocument Parse (bool storeAst, string fileName, TextReader tr, Project project = null)
+ public override System.Threading.Tasks.Task<ParsedDocument> Parse (ParseOptions parseOptions, System.Threading.CancellationToken cancellationToken)
{
- var doc = new MonoDevelop.Xml.Editor.XmlParsedDocument (fileName);
+ var doc = new MonoDevelop.Xml.Editor.XmlParsedDocument (parseOptions.FileName);
doc.Flags = ParsedDocumentFlags.NonSerializable;
try {
@@ -52,16 +51,16 @@ namespace MonoDevelop.AspNet.Html
new XmlRootState (new HtmlTagState (), new HtmlClosingTagState (true)),
true);
- xmlParser.Parse (tr);
+ xmlParser.Parse (parseOptions.Content.CreateReader ());
doc.XDocument = xmlParser.Nodes.GetRoot ();
- doc.Add (xmlParser.Errors);
+ doc.AddRange (xmlParser.Errors);
if (doc.XDocument != null)
- doc.Add (Validate (doc.XDocument));
+ doc.AddRange (Validate (doc.XDocument));
}
catch (Exception ex) {
MonoDevelop.Core.LoggingService.LogError ("Unhandled error parsing HTML document", ex);
}
- return doc;
+ return System.Threading.Tasks.Task.FromResult((ParsedDocument)doc);
}
IEnumerable<Error> Validate (XDocument doc)
diff --git a/main/src/addins/AspNet/Html/HtmlPathCompletion.cs b/main/src/addins/AspNet/Html/HtmlPathCompletion.cs
index bbb3eb29f7..76493955a1 100644
--- a/main/src/addins/AspNet/Html/HtmlPathCompletion.cs
+++ b/main/src/addins/AspNet/Html/HtmlPathCompletion.cs
@@ -30,6 +30,7 @@ using MonoDevelop.Projects;
using MonoDevelop.Core;
using System.Text.RegularExpressions;
using MonoDevelop.Ide;
+using MonoDevelop.Ide.Editor.Extension;
namespace MonoDevelop.AspNet.Html
{
@@ -116,7 +117,7 @@ namespace MonoDevelop.AspNet.Html
get { throw new InvalidOperationException (); }
}
- public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
string text;
var dialog = new MonoDevelop.Ide.Projects.ProjectFileSelectorDialog (proj, "", pattern);
diff --git a/main/src/addins/AspNet/Makefile.am b/main/src/addins/AspNet/Makefile.am
index 2dc30cad76..270cff592f 100644
--- a/main/src/addins/AspNet/Makefile.am
+++ b/main/src/addins/AspNet/Makefile.am
@@ -1,4 +1,5 @@
include $(top_srcdir)/xbuild.include
EXTRA_DIST += \
$(wildcard lib/*) \
- $(wildcard Templates/MvcCommon/*.cshtml)
+ $(wildcard Templates/MvcCommon/*.cshtml)\
+ $(wildcard Templates/Projects/Files/*.aspx)
diff --git a/main/src/addins/AspNet/MonoDevelop.AspNet.csproj b/main/src/addins/AspNet/MonoDevelop.AspNet.csproj
index d2f9baffe1..ea87d0944f 100644
--- a/main/src/addins/AspNet/MonoDevelop.AspNet.csproj
+++ b/main/src/addins/AspNet/MonoDevelop.AspNet.csproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -71,16 +71,6 @@
<Name>MonoDevelop.SourceEditor</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
- <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
- <Name>ICSharpCode.NRefactory</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory.CSharp\ICSharpCode.NRefactory.CSharp.csproj">
- <Project>{53DCA265-3C3C-42F9-B647-F72BA678122B}</Project>
- <Name>ICSharpCode.NRefactory.CSharp</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\MonoDevelop.Debugger\MonoDevelop.Debugger.csproj">
<Project>{2357AABD-08C7-4808-A495-8FF2D3CDFDB0}</Project>
<Name>MonoDevelop.Debugger</Name>
@@ -120,22 +110,58 @@
<HintPath>..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="System.Web.Razor">
- <HintPath>..\..\..\packages\Microsoft.AspNet.Razor.3.2.2\lib\net45\System.Web.Razor.dll</HintPath>
+ <HintPath>..\..\..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll</HintPath>
+ <Private>False</Private>
</Reference>
<Reference Include="System.Web.Helpers">
- <HintPath>..\..\..\packages\Microsoft.AspNet.WebPages.3.2.2\lib\net45\System.Web.Helpers.dll</HintPath>
- </Reference>
- <Reference Include="System.Web.WebPages">
- <HintPath>..\..\..\packages\Microsoft.AspNet.WebPages.3.2.2\lib\net45\System.Web.WebPages.dll</HintPath>
+ <HintPath>..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll</HintPath>
+ <Private>False</Private>
</Reference>
<Reference Include="System.Web.WebPages.Deployment">
- <HintPath>..\..\..\packages\Microsoft.AspNet.WebPages.3.2.2\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
+ <HintPath>..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Web.WebPages">
+ <HintPath>..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll</HintPath>
+ <Private>False</Private>
</Reference>
<Reference Include="System.Web.WebPages.Razor">
- <HintPath>..\..\..\packages\Microsoft.AspNet.WebPages.3.2.2\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
+ <HintPath>..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
+ <Private>False</Private>
</Reference>
<Reference Include="System.Web.Mvc">
- <HintPath>..\..\..\packages\Microsoft.AspNet.Mvc.5.2.2\lib\net45\System.Web.Mvc.dll</HintPath>
+ <HintPath>..\..\..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Web.Mvc" Condition="!Exists('$(SolutionDir)\..\.git')" />
+ <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
+ <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
+ <Name>ICSharpCode.NRefactory</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ <Reference Include="System.Reflection.Metadata">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Reflection.Metadata.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Collections.Immutable">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Collections.Immutable.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.Workspaces">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.Workspaces.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.CSharp.Workspaces">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.CSharp.Workspaces.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.CSharp">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
+ <Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
@@ -163,6 +189,7 @@
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System.Xml.Linq" />
+ <Reference Include="Mono.Cairo" />
<Reference Include="Mono.Posix" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Runtime.Serialization" />
@@ -177,6 +204,21 @@
<EmbeddedResource Include="Templates\images\aspnet-empty-project%402x.png">
<LogicalName>aspnet-empty-project@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="Templates\images\aspnet-empty-project~dark.png">
+ <LogicalName>aspnet-empty-project~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Templates\images\aspnet-empty-project~dark%402x.png">
+ <LogicalName>aspnet-empty-project~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="gtk-gui\gui.stetic">
+ <LogicalName>gui.stetic</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Templates\images\aspnet-wizard-page.png">
+ <LogicalName>aspnet-wizard-page.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Templates\images\aspnet-wizard-page%402x.png">
+ <LogicalName>aspnet-wizard-page@2x.png</LogicalName>
+ </EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Compile Include="Html\HtmlSchemaService.cs" />
@@ -195,10 +237,7 @@
<Compile Include="Razor\EditorParserFixed\RazorEditorParser.cs" />
<Compile Include="Razor\EditorParserFixed\RazorEditorTrace.cs" />
<Compile Include="Razor\EditorParserFixed\RazorResources.Designer.cs" />
- <Compile Include="Projects\AspMvcProject.cs" />
<Compile Include="Projects\AspMvcProjectConfiguration.cs" />
- <Compile Include="Projects\AspNetAppProject.cs" />
- <Compile Include="Projects\AspNetAppProjectBinding.cs" />
<Compile Include="Projects\AspNetAppProjectConfiguration.cs" />
<Compile Include="Projects\AspNetMSBuildImportProvider.cs" />
<Compile Include="WebForms\MasterContentFileDescriptionTemplate.cs" />
@@ -300,10 +339,19 @@
<Compile Include="Razor\RazorCSharpParsedDocument.cs" />
<Compile Include="Razor\RazorPageInfo.cs" />
<Compile Include="WebForms\WebFormsTypeContext.cs" />
+ <Compile Include="Projects\AspMvcProjectFlavor.cs" />
+ <Compile Include="Projects\AspNetAppProjectFlavor.cs" />
+ <Compile Include="WebForms\CSharp\CSharpProjector.cs" />
<Compile Include="Projects\AspNetProjectTemplateWizard.cs" />
- <Compile Include="Projects\AspNetProjectTemplateWizardPageWidget.cs" />
<Compile Include="Projects\AspNetProjectTemplateWizardPage.cs" />
<Compile Include="Projects\AspNetStringTagProvider.cs" />
+ <Compile Include="Commands\MethodDeclarationAtCaret.cs" />
+ <Compile Include="Razor\Dom\RazorWorkbenchService.cs" />
+ <Compile Include="Razor\RazorCSharpParserContext.cs" />
+ <Compile Include="Razor\OpenRazorDocument.cs" />
+ <Compile Include="gtk-gui\generated.cs" />
+ <Compile Include="Projects\GtkAspNetProjectTemplateWizardPageWidget.cs" />
+ <Compile Include="gtk-gui\MonoDevelop.AspNet.Projects.GtkAspNetProjectTemplateWizardPageWidget.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Makefile.am" />
@@ -326,9 +374,6 @@
<None Include="Templates\Mvc\Controller.xft.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Templates\Mvc\GlobalAsax.xft.xml">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
<None Include="Templates\Mvc\LayoutPage.xft.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@@ -350,9 +395,6 @@
<None Include="Templates\Mvc\ViewPageRazor.xft.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Templates\Mvc\WebConfigApp.xft.xml">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
<None Include="Templates\Mvc\WebConfigViews.xft.xml">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -363,12 +405,6 @@
<None Include="Templates\WebConfig-SubDir.xft.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Templates\WebForms\GlobalAsax-Empty.xft.xml">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="Templates\WebForms\GlobalAsax-CodeBehind.xft.xml">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
<None Include="Templates\WebForms\MasterPage-CodeBehind.xft.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@@ -435,58 +471,69 @@
<None Include="Templates\MvcCommon\ViewPageRazor.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Templates\Projects\MvcProjectWithUnitTest.xpt.xml">
+ <None Include="..\..\..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll">
+ <Link>System.Web.Mvc.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Templates\Projects\MvcProject.xpt.xml">
+ <None Include="..\..\..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll">
+ <Link>System.Web.Razor.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Templates\Projects\EmptyProject.xpt.xml">
+ <None Include="..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll">
+ <Link>System.Web.Helpers.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Templates\Projects\EmptyMvcProject.xpt.xml">
+ <None Include="..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll">
+ <Link>System.Web.WebPages.Deployment.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Templates\Projects\MvcRazorProject.xpt.xml">
- <SubType>Designer</SubType>
+ <None Include="..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll">
+ <Link>System.Web.WebPages.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Templates\Projects\MvcRazorProjectWithUnitTest.xpt.xml">
+ <None Include="..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll">
+ <Link>System.Web.WebPages.Razor.dll</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll">
+ <Link>Microsoft.Web.Infrastructure.dll</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="packages.config" />
+ <None Include="Templates\Projects\MvcProject.xpt.xml">
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Templates\Projects\WebApplication.xpt.xml">
+ <None Include="Templates\Projects\EmptyProject.xpt.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="..\..\..\packages\Microsoft.AspNet.Mvc.5.2.2\lib\net45\System.Web.Mvc.dll">
- <Link>System.Web.Mvc.dll</Link>
+ <None Include="Templates\Projects\WebFormsProject.xpt.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="..\..\..\packages\Microsoft.AspNet.Razor.3.2.2\lib\net45\System.Web.Razor.dll">
- <Link>System.Web.Razor.dll</Link>
+ <None Include="Templates\Projects\Files\Default.aspx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="..\..\..\packages\Microsoft.AspNet.WebPages.3.2.2\lib\net45\System.Web.Helpers.dll">
- <Link>System.Web.Helpers.dll</Link>
+ <None Include="Templates\Projects\Files\Default.aspx.designer.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="..\..\..\packages\Microsoft.AspNet.WebPages.3.2.2\lib\net45\System.Web.WebPages.Deployment.dll">
- <Link>System.Web.WebPages.Deployment.dll</Link>
+ <None Include="Templates\Projects\Files\Default.aspx.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="..\..\..\packages\Microsoft.AspNet.WebPages.3.2.2\lib\net45\System.Web.WebPages.dll">
- <Link>System.Web.WebPages.dll</Link>
+ <None Include="Templates\GlobalAsax.xft.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="..\..\..\packages\Microsoft.AspNet.WebPages.3.2.2\lib\net45\System.Web.WebPages.Razor.dll">
- <Link>System.Web.WebPages.Razor.dll</Link>
+ <None Include="Templates\Global.tt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll">
- <Link>Microsoft.Web.Infrastructure.dll</Link>
+ <None Include="Templates\RouteConfig.cs">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="Templates\WebApiConfig.cs">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="Templates\Projects\Files\Test.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="Html\Schemas\readme.txt">
@@ -529,7 +576,9 @@
<Folder Include="Commands\" />
<Folder Include="ProjectPad\" />
<Folder Include="Templates\Projects\" />
+ <Folder Include="Templates\Projects\Files\" />
<Folder Include="Templates\images\" />
+ <Folder Include="WebForms\CSharp\" />
</ItemGroup>
<Target Name="BeforeBuild">
<PropertyGroup>
diff --git a/main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet.Gui/ASPNetCodeTranslator.cs b/main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet.Gui/ASPNetCodeTranslator.cs
new file mode 100644
index 0000000000..2cac45c952
--- /dev/null
+++ b/main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet.Gui/ASPNetCodeTranslator.cs
@@ -0,0 +1,44 @@
+//
+// ASPNetCodeTranslator.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide.TypeSystem;
+using Microsoft.CodeAnalysis.Text;
+
+namespace MonoDevelop.AspNet.Gui
+{
+ class ASPNetCodeTranslator : CodeTranslator
+ {
+ public override bool CanTranslate (string fromMimeType, string toMimeType)
+ {
+ return false;
+ }
+
+ public override CodeMapping GetMapping (string fromMimeType, string toMimeType, SourceText textSource)
+ {
+ return null;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/AspNet/ProjectPad/AspNetFolderNodeCommandHandler.cs b/main/src/addins/AspNet/ProjectPad/AspNetFolderNodeCommandHandler.cs
index 1a79ed3373..bcbab2276b 100644
--- a/main/src/addins/AspNet/ProjectPad/AspNetFolderNodeCommandHandler.cs
+++ b/main/src/addins/AspNet/ProjectPad/AspNetFolderNodeCommandHandler.cs
@@ -31,7 +31,8 @@ using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.Ide.Gui.Pads.ProjectPad;
using MonoDevelop.Ide;
using MonoDevelop.AspNet.Projects;
-using MonoDevelop.AspNet.Commands;
+using MonoDevelop.AspNet.Commands;
+using MonoDevelop.Projects;
namespace MonoDevelop.AspNet.ProjectPad
{
@@ -40,8 +41,9 @@ namespace MonoDevelop.AspNet.ProjectPad
[CommandUpdateHandler (AspNetCommands.AddController)]
public void AddControllerUpdate (CommandInfo info)
{
- var project = CurrentNode.GetParentDataItem (typeof (AspNetAppProject), true) as AspNetAppProject;
- if (project == null || !project.IsAspMvcProject) {
+ var project = CurrentNode.GetParentDataItem (typeof (DotNetProject), true) as DotNetProject;
+ var aspFlavor = project != null ? project.GetService<AspNetAppProjectFlavor> () : null;
+ if (aspFlavor == null || !aspFlavor.IsAspMvcProject) {
info.Enabled = info.Visible = false;
return;
}
@@ -54,7 +56,7 @@ namespace MonoDevelop.AspNet.ProjectPad
[CommandHandler (AspNetCommands.AddController)]
public void AddController ()
{
- var project = (AspNetAppProject) CurrentNode.GetParentDataItem (typeof (AspNetAppProject), true);
+ var project = (DotNetProject) CurrentNode.GetParentDataItem (typeof (DotNetProject), true);
object currentItem = CurrentNode.DataItem;
@@ -68,7 +70,7 @@ namespace MonoDevelop.AspNet.ProjectPad
nav.Expanded = true;
}
- public static void AddController (AspNetAppProject project, string path, string name)
+ public static void AddController (DotNetProject project, string path, string name)
{
var provider = project.LanguageBinding.GetCodeDomProvider ();
if (provider == null)
@@ -121,15 +123,15 @@ namespace MonoDevelop.AspNet.ProjectPad
if (System.IO.File.Exists (outputFile)) {
project.AddFile (outputFile);
- IdeApp.ProjectOperations.Save (project);
+ IdeApp.ProjectOperations.SaveAsync (project);
}
}
[CommandUpdateHandler (AspNetCommands.AddView)]
public void AddViewUpdate (CommandInfo info)
{
- var project = CurrentNode.GetParentDataItem (typeof (AspNetAppProject), true) as AspNetAppProject;
- if (project == null || !project.IsAspMvcProject) {
+ var project = CurrentNode.GetParentDataItem<DotNetProject> (true);
+ if (project == null || !project.HasFlavor<AspNetAppProjectFlavor>() || !project.GetFlavor<AspNetAppProjectFlavor>().IsAspMvcProject) {
info.Enabled = info.Visible = false;
return;
}
@@ -142,7 +144,7 @@ namespace MonoDevelop.AspNet.ProjectPad
[CommandHandler (AspNetCommands.AddView)]
public void AddView ()
{
- var project = (AspNetAppProject) CurrentNode.GetParentDataItem (typeof (AspNetAppProject), true);
+ var project = CurrentNode.GetParentDataItem<DotNetProject> (true);
object currentItem = CurrentNode.DataItem;
diff --git a/main/src/addins/AspNet/ProjectPad/AspNetProjectNodeBuilderExtension.cs b/main/src/addins/AspNet/ProjectPad/AspNetProjectNodeBuilderExtension.cs
index da125b8376..572f5e864b 100644
--- a/main/src/addins/AspNet/ProjectPad/AspNetProjectNodeBuilderExtension.cs
+++ b/main/src/addins/AspNet/ProjectPad/AspNetProjectNodeBuilderExtension.cs
@@ -29,6 +29,7 @@ using System;
using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.AspNet.Projects;
+using MonoDevelop.Projects;
namespace MonoDevelop.AspNet.ProjectPad
{
@@ -36,7 +37,7 @@ namespace MonoDevelop.AspNet.ProjectPad
{
public override bool CanBuildNode (Type dataType)
{
- return typeof(AspNetAppProject).IsAssignableFrom (dataType);
+ return typeof(DotNetProject).IsAssignableFrom (dataType);
}
public override Type CommandHandlerType {
diff --git a/main/src/addins/AspNet/ProjectPad/AspNetProjectNodeCommandHandler.cs b/main/src/addins/AspNet/ProjectPad/AspNetProjectNodeCommandHandler.cs
index 3bf027f7c8..df18ea1e35 100644
--- a/main/src/addins/AspNet/ProjectPad/AspNetProjectNodeCommandHandler.cs
+++ b/main/src/addins/AspNet/ProjectPad/AspNetProjectNodeCommandHandler.cs
@@ -42,21 +42,25 @@ namespace MonoDevelop.AspNet.ProjectPad
[CommandHandler (AspNetCommands.AddAspNetDirectory)]
public void OnAddSpecialDirectory (object ob)
{
- AspNetAppProject proj = CurrentNode.DataItem as AspNetAppProject;
+ var proj = CurrentNode.DataItem as DotNetProject;
if (proj == null)
return;
proj.AddDirectory ((string) ob);
- IdeApp.ProjectOperations.Save (proj);
+ IdeApp.ProjectOperations.SaveAsync (proj);
}
[CommandUpdateHandler (AspNetCommands.AddAspNetDirectory)]
public void OnAddSpecialDirectoryUpdate (CommandArrayInfo info)
{
- AspNetAppProject proj = CurrentNode.DataItem as AspNetAppProject;
- if (proj == null)
- return;
-
- List<string> dirs = new List<string> (proj.GetSpecialDirectories ());
+ var proj = CurrentNode.DataItem as DotNetProject;
+ if (proj == null)
+ return;
+
+ var asp = proj.GetFlavor<AspNetAppProjectFlavor> ();
+ if (asp == null)
+ return;
+
+ List<string> dirs = new List<string> (asp.GetSpecialDirectories ());
dirs.Sort ();
List<FilePath> fullPaths = new List<FilePath> (dirs.Count);
foreach (string s in dirs)
diff --git a/main/src/addins/AspNet/Projects/AspMvcProject.cs b/main/src/addins/AspNet/Projects/AspMvcProject.cs
deleted file mode 100644
index 8161c25ee2..0000000000
--- a/main/src/addins/AspNet/Projects/AspMvcProject.cs
+++ /dev/null
@@ -1,173 +0,0 @@
-//
-// AspMvcProject.cs
-//
-// Author:
-// Michael Hutchinson <mhutchinson@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc. (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-using System.Xml;
-using MonoDevelop.Projects;
-
-namespace MonoDevelop.AspNet.Projects
-{
- abstract class AspMvcProject : AspNetAppProject
- {
- protected AspMvcProject ()
- {
- }
-
- protected AspMvcProject (string languageName)
- : base (languageName)
- {
- }
-
- protected AspMvcProject (string languageName, ProjectCreateInformation info, XmlElement projectOptions)
- : base (languageName, info, projectOptions)
- {
- }
-
- public override SolutionItemConfiguration CreateConfiguration (string name)
- {
- var conf = new AspMvcProjectConfiguration (name);
- conf.CopyFrom (base.CreateConfiguration (name));
- return conf;
- }
-
- public override IEnumerable<string> GetProjectTypes ()
- {
- yield return "AspNetMvc";
- foreach (var t in base.GetProjectTypes ())
- yield return t;
- }
-
- public override bool SupportsFramework (MonoDevelop.Core.Assemblies.TargetFramework framework)
- {
- return framework.CanReferenceAssembliesTargetingFramework (MonoDevelop.Core.Assemblies.TargetFrameworkMoniker.NET_3_5);
- }
-
- public override bool IsAspMvcProject {
- get {
- return true;
- }
- }
- }
-
- class AspMvc1Project : AspMvcProject
- {
- public AspMvc1Project ()
- {
- }
-
- public AspMvc1Project (string languageName)
- : base (languageName)
- {
- }
-
- public AspMvc1Project (string languageName, ProjectCreateInformation info, XmlElement projectOptions)
- : base (languageName, info, projectOptions)
- {
- }
-
- protected override string GetDefaultAspNetMvcVersion ()
- {
- return "1.0.0.0";
- }
- }
-
- class AspMvc2Project : AspMvcProject
- {
- public AspMvc2Project ()
- {
- }
-
- public AspMvc2Project (string languageName)
- : base (languageName)
- {
- }
-
- public AspMvc2Project (string languageName, ProjectCreateInformation info, XmlElement projectOptions)
- : base (languageName, info, projectOptions)
- {
- }
-
- protected override string GetDefaultAspNetMvcVersion ()
- {
- return "2.0.0.0";
- }
- }
-
- class AspMvc3Project : AspMvcProject
- {
- public AspMvc3Project ()
- {
- }
-
- public AspMvc3Project (string languageName)
- : base (languageName)
- {
- }
-
- public AspMvc3Project (string languageName, ProjectCreateInformation info, XmlElement projectOptions)
- : base (languageName, info, projectOptions)
- {
- }
-
- public override bool SupportsFramework (MonoDevelop.Core.Assemblies.TargetFramework framework)
- {
- return framework.CanReferenceAssembliesTargetingFramework (MonoDevelop.Core.Assemblies.TargetFrameworkMoniker.NET_4_0);
- }
-
- protected override string GetDefaultAspNetMvcVersion ()
- {
- return "3.0.0.0";
- }
- }
-
- class AspMvc4Project : AspMvcProject
- {
- public AspMvc4Project ()
- {
- }
-
- public AspMvc4Project (string languageName)
- : base (languageName)
- {
- }
-
- public AspMvc4Project (string languageName, ProjectCreateInformation info, XmlElement projectOptions)
- : base (languageName, info, projectOptions)
- {
- }
-
- public override bool SupportsFramework (MonoDevelop.Core.Assemblies.TargetFramework framework)
- {
- return framework.CanReferenceAssembliesTargetingFramework (MonoDevelop.Core.Assemblies.TargetFrameworkMoniker.NET_4_0);
- }
-
- protected override string GetDefaultAspNetMvcVersion ()
- {
- return "4.0.0.0";
- }
- }
-}
diff --git a/main/src/addins/AspNet/Projects/AspMvcProjectConfiguration.cs b/main/src/addins/AspNet/Projects/AspMvcProjectConfiguration.cs
index 743a6109fc..0043076fd7 100644
--- a/main/src/addins/AspNet/Projects/AspMvcProjectConfiguration.cs
+++ b/main/src/addins/AspNet/Projects/AspMvcProjectConfiguration.cs
@@ -36,9 +36,5 @@ namespace MonoDevelop.AspNet.Projects
public AspMvcProjectConfiguration (string name) : base (name)
{
}
-
- public AspMvcProjectConfiguration () : base ()
- {
- }
}
}
diff --git a/main/src/addins/AspNet/Projects/AspMvcProjectFlavor.cs b/main/src/addins/AspNet/Projects/AspMvcProjectFlavor.cs
new file mode 100644
index 0000000000..fef6694739
--- /dev/null
+++ b/main/src/addins/AspNet/Projects/AspMvcProjectFlavor.cs
@@ -0,0 +1,96 @@
+//
+// AspMvcProject.cs
+//
+// Author:
+// Michael Hutchinson <mhutchinson@novell.com>
+//
+// Copyright (c) 2009 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Xml;
+using MonoDevelop.Projects;
+
+namespace MonoDevelop.AspNet.Projects
+{
+ abstract class AspMvcProjectFlavor : AspNetAppProjectFlavor
+ {
+ protected override SolutionItemConfiguration OnCreateConfiguration (string name, ConfigurationKind kind)
+ {
+ var conf = new AspMvcProjectConfiguration (name);
+ conf.CopyFrom (base.OnCreateConfiguration (name, kind));
+ return conf;
+ }
+
+ protected override bool OnGetSupportsFramework (MonoDevelop.Core.Assemblies.TargetFramework framework)
+ {
+ return framework.CanReferenceAssembliesTargetingFramework (MonoDevelop.Core.Assemblies.TargetFrameworkMoniker.NET_3_5);
+ }
+
+ public override bool IsAspMvcProject {
+ get {
+ return true;
+ }
+ }
+ }
+
+ class AspMvc1ProjectFlavor : AspMvcProjectFlavor
+ {
+ protected override string GetDefaultAspNetMvcVersion ()
+ {
+ return "1.0.0.0";
+ }
+ }
+
+ class AspMvc2ProjectFlavor : AspMvcProjectFlavor
+ {
+ protected override string GetDefaultAspNetMvcVersion ()
+ {
+ return "2.0.0.0";
+ }
+ }
+
+ class AspMvc3ProjectFlavor : AspMvcProjectFlavor
+ {
+ protected override bool OnGetSupportsFramework (MonoDevelop.Core.Assemblies.TargetFramework framework)
+ {
+ return framework.CanReferenceAssembliesTargetingFramework (MonoDevelop.Core.Assemblies.TargetFrameworkMoniker.NET_4_0);
+ }
+
+ protected override string GetDefaultAspNetMvcVersion ()
+ {
+ return "3.0.0.0";
+ }
+ }
+
+ class AspMvc4ProjectFlavor : AspMvcProjectFlavor
+ {
+ protected override bool OnGetSupportsFramework (MonoDevelop.Core.Assemblies.TargetFramework framework)
+ {
+ return framework.CanReferenceAssembliesTargetingFramework (MonoDevelop.Core.Assemblies.TargetFrameworkMoniker.NET_4_0);
+ }
+
+ protected override string GetDefaultAspNetMvcVersion ()
+ {
+ return "4.0.0.0";
+ }
+ }
+}
diff --git a/main/src/addins/AspNet/Projects/AspNetAppProject.cs b/main/src/addins/AspNet/Projects/AspNetAppProject.cs
deleted file mode 100644
index 87a77861cc..0000000000
--- a/main/src/addins/AspNet/Projects/AspNetAppProject.cs
+++ /dev/null
@@ -1,754 +0,0 @@
-//
-// AspNetAppProject.cs: ASP.NET "Web Application" project type
-//
-// Authors:
-// Michael Hutchinson <m.j.hutchinson@gmail.com>
-//
-// Copyright (C) 2006 Michael Hutchinson
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Xml;
-
-using ICSharpCode.NRefactory.TypeSystem;
-
-using MonoDevelop.Core;
-using MonoDevelop.Core.Assemblies;
-using MonoDevelop.Core.Execution;
-using MonoDevelop.Core.ProgressMonitoring;
-using MonoDevelop.Core.Serialization;
-using MonoDevelop.Ide.Desktop;
-using MonoDevelop.Ide;
-using MonoDevelop.Ide.TypeSystem;
-using MonoDevelop.Projects;
-using MonoDevelop.AspNet.Execution;
-using MonoDevelop.AspNet.WebForms;
-
-namespace MonoDevelop.AspNet.Projects
-{
- [DataInclude (typeof(AspNetAppProjectConfiguration))]
- public class AspNetAppProject : DotNetAssemblyProject
- {
- [ItemProperty("XspParameters", IsExternal=true)]
- XspParameters xspParameters = new XspParameters ();
-
- WebFormsRegistrationCache registrationCache;
- WebFormsCodeBehindTypeNameCache codebehindTypeNameCache;
-
- #region properties
-
- public override IEnumerable<string> GetProjectTypes ()
- {
- yield return "AspNetApp";
- foreach (var t in base.GetProjectTypes ())
- yield return t;
- }
-
- public override bool IsLibraryBasedProjectType {
- get { return true; }
- }
-
- public XspParameters XspParameters {
- get { return xspParameters; }
- }
-
- internal WebFormsRegistrationCache RegistrationCache {
- get {
- if (registrationCache == null)
- registrationCache = new WebFormsRegistrationCache (this);
- return registrationCache;
- }
- }
-
- #endregion
-
- #region constructors
-
- public AspNetAppProject ()
- {
- Init ();
- }
-
- public AspNetAppProject (string languageName)
- : base (languageName)
- {
- Init ();
- }
-
- public AspNetAppProject (string languageName, ProjectCreateInformation info, XmlElement projectOptions)
- : base (languageName, info, projectOptions)
- {
- Init ();
-
- var binPath = info == null? (FilePath)"bin" : info.BinPath;
- foreach (var cfg in Configurations.Cast<AspNetAppProjectConfiguration> ())
- cfg.OutputDirectory = binPath;
- }
-
- public override SolutionItemConfiguration CreateConfiguration (string name)
- {
- var conf = new AspNetAppProjectConfiguration (name);
- conf.CopyFrom (base.CreateConfiguration (name));
- conf.OutputDirectory = BaseDirectory.IsNullOrEmpty? "bin" : (string)BaseDirectory.Combine ("bin");
- return conf;
- }
-
- void Init ()
- {
- codebehindTypeNameCache = new WebFormsCodeBehindTypeNameCache (this);
- }
-
- public new AspNetAppProjectConfiguration GetConfiguration (ConfigurationSelector configuration)
- {
- return (AspNetAppProjectConfiguration) base.GetConfiguration (configuration);
- }
-
- #endregion
-
- public override void Dispose ()
- {
- codebehindTypeNameCache.Dispose ();
- RegistrationCache.Dispose ();
- base.Dispose ();
- }
-
- #region build/prebuild/execute
-
-
- protected override BuildResult DoBuild (IProgressMonitor monitor, ConfigurationSelector configuration)
- {
- //if no files are set to compile, then some compilers will error out
- //though this is valid with ASP.NET apps, so we just avoid calling the compiler in this case
- bool needsCompile = false;
- foreach (ProjectFile pf in Files) {
- if (pf.BuildAction == BuildAction.Compile) {
- needsCompile = true;
- break;
- }
- }
-
- if (needsCompile)
- return base.DoBuild (monitor, configuration);
- return new BuildResult ();
- }
-
- ExecutionCommand CreateExecutionCommand (ConfigurationSelector config, AspNetAppProjectConfiguration configuration)
- {
- return new AspNetExecutionCommand {
- ClrVersion = configuration.ClrVersion,
- DebugMode = configuration.DebugMode,
- XspParameters = XspParameters,
- BaseDirectory = BaseDirectory,
- TargetRuntime = TargetRuntime,
- TargetFramework = TargetFramework,
- UserAssemblyPaths = GetUserAssemblyPaths (config),
- EnvironmentVariables = configuration.EnvironmentVariables,
- };
- }
-
- protected override bool OnGetCanExecute (ExecutionContext context, ConfigurationSelector configuration)
- {
- var cmd = CreateExecutionCommand (configuration, GetConfiguration (configuration));
- return context.ExecutionHandler.CanExecute (cmd);
- }
-
- protected override void DoExecute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
- {
- //check XSP is available
-
- var cfg = GetConfiguration (configuration);
- var cmd = CreateExecutionCommand (configuration, cfg);
- var browserExcTarget = (BrowserExecutionTarget) context.ExecutionTarget;
-
- IConsole console = null;
- var operationMonitor = new AggregatedOperationMonitor (monitor);
-
- bool isXsp = true; //FIXME: fix this when it might not be true - should delegate to the ExecutionHandler
-
- try {
- //HACK: check XSP exists first, because error UX is cleaner w/o displaying a blank console pad.
- if (isXsp) {
- try {
- AspNetExecutionHandler.GetXspPath ((AspNetExecutionCommand)cmd);
- } catch (UserException ex) {
- MessageService.ShowError (
- GettextCatalog.GetString ("Could not launch ASP.NET web server"),
- ex.Message);
- throw;
- }
- }
-
- if (cfg.ExternalConsole)
- console = context.ExternalConsoleFactory.CreateConsole (!cfg.PauseConsoleOutput);
- else
- console = context.ConsoleFactory.CreateConsole (!cfg.PauseConsoleOutput);
-
- // The running Port value is now captured in the XspBrowserLauncherConsole object
- string url = String.Format ("http://{0}", XspParameters.Address);
-
-
- if (isXsp) {
- console = new XspBrowserLauncherConsole (console, delegate (string port) {
- if (browserExcTarget != null)
- browserExcTarget.DesktopApp.Launch (String.Format("{0}:{1}", url, port));
- else
- BrowserLauncher.LaunchDefaultBrowser (String.Format("{0}:{1}", url, port));
- });
- }
-
- monitor.Log.WriteLine ("Running web server...");
-
- var op = context.ExecutionHandler.Execute (cmd, console);
- operationMonitor.AddOperation (op); //handles cancellation
-
- if (!isXsp) {
- if (browserExcTarget != null)
- browserExcTarget.DesktopApp.Launch (url);
- else
- BrowserLauncher.LaunchDefaultBrowser (url);
- }
-
- op.WaitForCompleted ();
-
- monitor.Log.WriteLine ("The web server exited with code: {0}", op.ExitCode);
-
- } catch (Exception ex) {
- if (!(ex is UserException)) {
- LoggingService.LogError ("Could not launch ASP.NET web server.", ex);
- }
- monitor.ReportError ("Could not launch web server.", ex);
- } finally {
- operationMonitor.Dispose ();
- if (console != null)
- console.Dispose ();
- }
- }
-
- #endregion
-
- #region File utility methods
-
- public WebSubtype DetermineWebSubtype (ProjectFile file)
- {
- if (LanguageBinding != null && LanguageBinding.IsSourceCodeFile (file.FilePath))
- return WebSubtype.Code;
- return DetermineWebSubtype (file.Name);
- }
-
- public static WebSubtype DetermineWebSubtype (string fileName)
- {
- string extension = Path.GetExtension (fileName);
- if (extension == null)
- return WebSubtype.None;
- extension = extension.ToUpperInvariant ().TrimStart ('.');
-
- //NOTE: No way to identify WebSubtype.Code from here
- //use the instance method for that
- switch (extension) {
- case "ASPX":
- return WebSubtype.WebForm;
- case "MASTER":
- return WebSubtype.MasterPage;
- case "ASHX":
- return WebSubtype.WebHandler;
- case "ASCX":
- return WebSubtype.WebControl;
- case "ASMX":
- return WebSubtype.WebService;
- case "ASAX":
- return WebSubtype.Global;
- case "GIF":
- case "PNG":
- case "JPG":
- return WebSubtype.WebImage;
- case "SKIN":
- return WebSubtype.WebSkin;
- case "CONFIG":
- return WebSubtype.Config;
- case "BROWSER":
- return WebSubtype.BrowserDefinition;
- case "AXD":
- return WebSubtype.Axd;
- case "SITEMAP":
- return WebSubtype.Sitemap;
- case "CSS":
- return WebSubtype.Css;
- case "XHTML":
- case "HTML":
- case "HTM":
- return WebSubtype.Html;
- case "JS":
- return WebSubtype.JavaScript;
- case "LESS":
- return WebSubtype.Less;
- case "SASS":
- case "SCSS":
- return WebSubtype.Sass;
- case "EOT":
- case "TTF":
- case "OTF":
- case "WOFF":
- return WebSubtype.Font;
- case "SVG":
- return WebSubtype.Svg;
- case "STYL":
- return WebSubtype.Stylus;
- case "CSHTML":
- return WebSubtype.Razor;
- default:
- return WebSubtype.None;
- }
- }
-
- #endregion
-
- #region special files
-
- #endregion
-
- public ProjectFile ResolveVirtualPath (string virtualPath, string relativeToFile)
- {
- string name = VirtualToLocalPath (virtualPath, relativeToFile);
- if (name == null)
- return null;
- return Files.GetFile (name);
- }
-
- public string VirtualToLocalPath (string virtualPath, string relativeToFile)
- {
- if (string.IsNullOrEmpty (virtualPath) || virtualPath [0] == '/' || virtualPath.IndexOf (':') > -1)
- return null;
-
- FilePath relativeToDir;
- if (virtualPath.Length > 1 && virtualPath[0] == '~') {
- if (virtualPath[1] == '/')
- virtualPath = virtualPath.Substring (2);
- else
- virtualPath = virtualPath.Substring (1);
- relativeToDir = BaseDirectory;
- } else {
- relativeToDir = String.IsNullOrEmpty (relativeToFile)
- ? BaseDirectory
- : (FilePath) Path.GetDirectoryName (relativeToFile);
- }
-
- virtualPath = virtualPath.Replace ('/', Path.DirectorySeparatorChar);
- return relativeToDir.Combine (virtualPath).FullPath;
- }
-
- public string LocalToVirtualPath (string filename)
- {
- string rel = FileService.AbsoluteToRelativePath (BaseDirectory, filename);
- return "~/" + rel.Replace (Path.DirectorySeparatorChar, '/');
- }
-
- public string LocalToVirtualPath (ProjectFile file)
- {
- return LocalToVirtualPath (file.FilePath);
- }
-
- #region Reference handling
-
- protected override void OnReferenceAddedToProject (ProjectReferenceEventArgs e)
- {
- //short-circuit if the project is being deserialised
- if (Loading) {
- base.OnReferenceAddedToProject (e);
- return;
- }
-
- UpdateWebConfigRefs ();
-
- base.OnReferenceAddedToProject (e);
- }
-
- protected override void OnReferenceRemovedFromProject (ProjectReferenceEventArgs e)
- {
- //short-circuit if the project is being deserialised
- if (Loading) {
- base.OnReferenceAddedToProject (e);
- return;
- }
-
- UpdateWebConfigRefs ();
-
- base.OnReferenceRemovedFromProject (e);
- }
-
- void UpdateWebConfigRefs ()
- {
- var refs = new List<string> ();
- foreach (var reference in References) {
- //local copied assemblies are copied to the bin directory so ASP.NET references them automatically
- if (reference.LocalCopy && (reference.ReferenceType == ReferenceType.Project || reference.ReferenceType == ReferenceType.Assembly))
- continue;
- if (string.IsNullOrEmpty (reference.Reference))
- continue;
- //these assemblies are referenced automatically by ASP.NET
- if (WebFormsRegistrationCache.IsDefaultReference (reference.Reference))
- continue;
- //bypass non dotnet projects
- if ((reference.ReferenceType == ReferenceType.Project) &&
- (!(reference.OwnerProject.ParentSolution.FindProjectByName (reference.Reference) is DotNetProject)))
- continue;
- refs.Add (reference.Reference);
- }
-
- var webConfig = GetWebConfig ();
- if (webConfig == null || !File.Exists (webConfig.FilePath))
- return;
-
- var textFile = TextFileProvider.Instance.GetEditableTextFile (webConfig.FilePath);
- //use textfile API because it's write safe (writes out to another file then moves)
- if (textFile == null)
- textFile = MonoDevelop.Projects.Text.TextFile.ReadFile (webConfig.FilePath);
-
- //can't use System.Web.Configuration.WebConfigurationManager, as it can only access virtual paths within an app
- //so need full manual handling
- try {
- var doc = new XmlDocument ();
-
- //FIXME: PreserveWhitespace doesn't handle whitespace in attribute lists
- //doc.PreserveWhitespace = true;
- doc.LoadXml (textFile.Text);
-
- //hunt our way to the assemblies element, creating elements if necessary
- XmlElement configElement = doc.DocumentElement;
- if (configElement == null || string.Compare (configElement.Name, "configuration", StringComparison.OrdinalIgnoreCase) != 0) {
- configElement = (XmlElement) doc.AppendChild (doc.CreateNode (XmlNodeType.Document, "configuration", null));
- }
- XmlElement webElement = GetNamedXmlElement (doc, configElement, "system.web");
- XmlElement compilationNode = GetNamedXmlElement (doc, webElement, "compilation");
- XmlElement assembliesNode = GetNamedXmlElement (doc, compilationNode, "assemblies");
-
- List<XmlNode> existingAdds = new List<XmlNode> ();
- foreach (XmlNode node in assembliesNode)
- if (string.Compare (node.Name, "add", StringComparison.OrdinalIgnoreCase) == 0)
- existingAdds.Add (node);
-
- //add refs to the doc if they're not in it
- foreach (string reference in refs) {
- int index = 0;
- bool found = false;
- while (index < existingAdds.Count) {
- XmlNode node = existingAdds [index];
- XmlAttribute att = (XmlAttribute)node.Attributes.GetNamedItem ("assembly");
- if (att == null)
- continue;
- string refAtt = att.Value;
- if (refAtt != null && refAtt == reference) {
- existingAdds.RemoveAt (index);
- found = true;
- break;
- }
- index++;
- }
- if (!found) {
- XmlElement newAdd = doc.CreateElement ("add");
- XmlAttribute newAtt = doc.CreateAttribute ("assembly");
- newAtt.Value = reference;
- newAdd.Attributes.Append (newAtt);
- assembliesNode.AppendChild (newAdd);
- }
- }
-
- //any nodes that weren't removed from the existingAdds list are old/redundant, so remove from doc
- foreach (XmlNode node in existingAdds)
- assembliesNode.RemoveChild (node);
-
- StringWriter sw = new StringWriter ();
- XmlTextWriter tw = new XmlTextWriter (sw);
- tw.Formatting = Formatting.Indented;
- doc.WriteTo (tw);
- tw.Flush ();
- textFile.Text = sw.ToString ();
-
- MonoDevelop.Projects.Text.TextFile tf = textFile as MonoDevelop.Projects.Text.TextFile;
- if (tf != null)
- tf.Save ();
- } catch (Exception e) {
- LoggingService.LogWarning ("Could not modify application web.config in project " + Name, e);
- }
- }
-
-
- XmlElement GetNamedXmlElement (XmlDocument doc, XmlElement parent, string name)
- {
- XmlElement result = null;
- foreach (XmlNode node in parent.ChildNodes) {
- XmlElement elem = node as XmlElement;
- if (elem != null && string.Compare (elem.Name, name, StringComparison.OrdinalIgnoreCase) == 0) {
- result = elem;
- break;
- }
- }
- if (result == null) {
- result = (XmlElement) parent.AppendChild (doc.CreateElement (name));
- }
- return result;
- }
-
- ProjectFile GetWebConfig ()
- {
- var webConf = BaseDirectory.Combine ("web.config");
- foreach (var file in Files)
- if (string.Compare (file.FilePath.ToString (), webConf, StringComparison.OrdinalIgnoreCase) == 0)
- return file;
- return null;
- }
-
- bool IsWebConfig (FilePath file)
- {
- var webConf = BaseDirectory.Combine ("web.config");
- return (string.Compare (file, webConf, StringComparison.OrdinalIgnoreCase) == 0);
- }
-
- #endregion
-
- #region File event handlers
-
- protected override void OnFileAddedToProject (ProjectFileEventArgs e)
- {
- //short-circuit if the project is being deserialised
- if (Loading) {
- base.OnFileAddedToProject (e);
- return;
- }
-
- bool webConfigChange = false;
- List<string> filesToAdd = new List<string> ();
-
- foreach (ProjectFileEventInfo fargs in e) {
- IEnumerable<string> files = MonoDevelop.DesignerSupport.CodeBehind.GuessDependencies
- (this, fargs.ProjectFile, groupedExtensions);
- if (files != null)
- filesToAdd.AddRange (files);
- if (IsWebConfig (fargs.ProjectFile.FilePath))
- webConfigChange = true;
- }
-
- if (webConfigChange)
- UpdateWebConfigRefs ();
-
- //let the base fire the event before we add files
- //don't want to fire events out of order of files being added
- base.OnFileAddedToProject (e);
-
- //make sure that the parent and child files are in the project
- foreach (string file in filesToAdd) {
- //NOTE: this only adds files if they are not already in the project
- AddFile (file);
- }
- }
-
- public override string GetDefaultBuildAction (string fileName)
- {
-
- WebSubtype type = DetermineWebSubtype (fileName);
- switch (type) {
- case WebSubtype.Code:
- return BuildAction.Compile;
- case WebSubtype.None:
- return base.GetDefaultBuildAction (fileName);
- default:
- return BuildAction.Content;
- }
- }
-
- static string[] groupedExtensions = { ".aspx", ".master", ".ashx", ".ascx", ".asmx", ".asax" };
-
- #endregion
-
- public virtual IEnumerable<string> GetSpecialDirectories ()
- {
- yield return "App_Browsers";
- yield return "App_Data";
- yield return "App_GlobalResources";
- yield return "App_LocalResources";
- yield return "Theme";
-
- if (IsAspMvcProject) {
- yield return "Views";
- yield return "Models";
- yield return "Controllers";
- }
-
- // For "web site" projects
- // "App_WebReferences", "App_Resources","App_Themes", "App_Code",
- }
-
- protected override IList<string> GetCommonBuildActions ()
- {
- return new [] {
- BuildAction.None,
- BuildAction.Compile,
- BuildAction.Content,
- BuildAction.EmbeddedResource,
- };
- }
-
- public string GetCodebehindTypeName (string fileName)
- {
- lock (codebehindTypeNameCache)
- return codebehindTypeNameCache.GetCodeBehindTypeName (fileName);
- }
-
- public IList<string> GetCodeTemplates (string type, string subtype = null)
- {
- var files = new List<string> ();
- var names = new HashSet<string> ();
-
- string asmDir = Path.GetDirectoryName (typeof (AspNetAppProject).Assembly.Location);
- string lang = LanguageName;
- if (lang == "C#") {
- lang = "CSharp";
- }
-
- if (subtype != null) {
- type = Path.Combine (type, subtype);
- }
-
- var dirs = new [] {
- Path.Combine (BaseDirectory, "CodeTemplates", type),
- Path.Combine (BaseDirectory, "CodeTemplates", lang, type),
- Path.Combine (asmDir, "CodeTemplates", type),
- Path.Combine (asmDir, "CodeTemplates", lang, type),
- };
-
- foreach (string directory in dirs)
- if (Directory.Exists (directory))
- foreach (string file in Directory.GetFiles (directory, "*.tt", SearchOption.TopDirectoryOnly))
- if (names.Add (Path.GetFileName (file)))
- files.Add (file);
-
- return files;
- }
-
- protected override void PopulateSupportFileList (FileCopySet list, ConfigurationSelector configuration)
- {
- base.PopulateSupportFileList (list, configuration);
-
- //HACK: workaround for MD not local-copying package references
- foreach (MonoDevelop.Projects.ProjectReference projectReference in References) {
- if (projectReference.Package != null && projectReference.Package.Name == "system.web.mvc") {
- if (projectReference.ReferenceType == ReferenceType.Package)
- foreach (SystemAssembly assem in projectReference.Package.Assemblies)
- list.Add (assem.Location);
- break;
- }
- }
- }
-
- public string GetAspNetMvcVersion ()
- {
- foreach (var pref in References) {
- if (pref.Reference.IndexOf ("System.Web.Mvc", StringComparison.OrdinalIgnoreCase) < 0)
- continue;
- switch (pref.ReferenceType) {
- case ReferenceType.Assembly:
- case ReferenceType.Package:
- foreach (var f in pref.GetReferencedFileNames (null)) {
- if (Path.GetFileNameWithoutExtension (f) != "System.Web.Mvc" || !File.Exists (f))
- continue;
- return AssemblyName.GetAssemblyName (f).Version.ToString ();
- }
- break;
- default:
- continue;
- }
- }
-
- if (IsAspMvcProject)
- return GetDefaultAspNetMvcVersion ();
-
- return null;
- }
-
- public bool SupportsRazorViewEngine {
- get {
- return References.Any (r => r.Reference.StartsWith ("System.Web.WebPages.Razor", StringComparison.Ordinal));
- }
- }
-
- protected virtual string GetDefaultAspNetMvcVersion ()
- {
- return "5.2";
- }
-
- public virtual bool IsAspMvcProject {
- get {
- return References.Any (r => r.Reference.StartsWith ("System.Web.Mvc", StringComparison.Ordinal));
- }
- }
-
- public bool IsAspWebApiProject {
- get {
- return References.Any (r => r.Reference.StartsWith ("System.Web.Http.WebHost", StringComparison.Ordinal));
- }
- }
-
- public virtual bool IsAspWebFormsProject {
- get {
- return Files.Any (f => f.Name.EndsWith (".aspx", StringComparison.Ordinal));
- }
- }
-
- class BrowserExecutionTarget : ExecutionTarget
- {
- string name, id;
- public BrowserExecutionTarget (string id, string displayName, DesktopApplication app){
- this.name = displayName;
- this.id = id;
- this.DesktopApp = app;
- }
-
- public override string Name {
- get { return name; }
- }
-
- public override string Id {
- get { return id; }
- }
-
- public DesktopApplication DesktopApp { get; private set; }
- }
-
- protected override IEnumerable<ExecutionTarget> OnGetExecutionTargets (ConfigurationSelector configuration)
- {
- var apps = new List<ExecutionTarget> ();
- foreach (var browser in MonoDevelop.Ide.DesktopService.GetApplications ("test.html")) {
- if (browser.IsDefault)
- apps.Insert (0, new BrowserExecutionTarget (browser.Id,browser.DisplayName,browser));
- else
- apps.Add (new BrowserExecutionTarget (browser.Id,browser.DisplayName,browser));
- }
- return apps;
- }
- }
-}
diff --git a/main/src/addins/AspNet/Projects/AspNetAppProjectBinding.cs b/main/src/addins/AspNet/Projects/AspNetAppProjectBinding.cs
deleted file mode 100644
index 3a89feac81..0000000000
--- a/main/src/addins/AspNet/Projects/AspNetAppProjectBinding.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// AspNetAppProjectBinding.cs: Project binding for AspNetAppProject
-//
-// Authors:
-// Michael Hutchinson <m.j.hutchinson@gmail.com>
-//
-// Copyright (C) 2006 Michael Hutchinson
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using MonoDevelop.Core;
-using MonoDevelop.Projects;
-using MonoDevelop.Core.Serialization;
-using System.Xml;
-
-namespace MonoDevelop.AspNet.Projects
-{
- //based heavily on DotNetProjectBinding
- public class AspNetAppProjectBinding : IProjectBinding
- {
-
- public string Name {
- get { return "AspNetApp"; }
- }
-
- public Project CreateProject (ProjectCreateInformation info, XmlElement projectOptions)
- {
- string lang = projectOptions.GetAttribute ("language");
- return CreateProject (lang, info, projectOptions);
- }
-
- public Project CreateProject (string language, ProjectCreateInformation info, XmlElement projectOptions)
- {
- return new AspNetAppProject (language, info, projectOptions);
- }
-
- public Project CreateSingleFileProject (string file)
- {
- //TODO: get page language
- string language = "C#";
-
- var info = new ProjectCreateInformation () {
- ProjectName = Path.GetFileNameWithoutExtension (file),
- SolutionPath = Path.GetDirectoryName (file),
- ProjectBasePath = Path.GetDirectoryName (file),
- };
- var project = CreateProject (language, info, null);
- project.Files.Add (new ProjectFile (file));
- return project;
- }
-
- public bool CanCreateSingleFileProject (string sourceFile)
- {
- WebSubtype type = AspNetAppProject.DetermineWebSubtype (sourceFile);
-
- return ((type == WebSubtype.WebForm)
- || (type == WebSubtype.WebHandler)
- || (type == WebSubtype.WebService));
- }
- }
-}
diff --git a/main/src/addins/AspNet/Projects/AspNetAppProjectConfiguration.cs b/main/src/addins/AspNet/Projects/AspNetAppProjectConfiguration.cs
index cc20b7151b..a48276e837 100644
--- a/main/src/addins/AspNet/Projects/AspNetAppProjectConfiguration.cs
+++ b/main/src/addins/AspNet/Projects/AspNetAppProjectConfiguration.cs
@@ -37,20 +37,8 @@ namespace MonoDevelop.AspNet.Projects
{
public class AspNetAppProjectConfiguration : DotNetProjectConfiguration
{
- public AspNetAppProjectConfiguration (string name) : base (name)
+ public AspNetAppProjectConfiguration (string id) : base (id)
{
}
-
- public AspNetAppProjectConfiguration ()
- {
- }
-
- public override void CopyFrom (ItemConfiguration configuration)
- {
- base.CopyFrom (configuration);
- var cfg = configuration as AspNetAppProjectConfiguration;
- if (cfg == null)
- return;
- }
}
}
diff --git a/main/src/addins/AspNet/Projects/AspNetAppProjectFlavor.cs b/main/src/addins/AspNet/Projects/AspNetAppProjectFlavor.cs
new file mode 100644
index 0000000000..1527fa9c43
--- /dev/null
+++ b/main/src/addins/AspNet/Projects/AspNetAppProjectFlavor.cs
@@ -0,0 +1,734 @@
+//
+// AspNetAppProject.cs: ASP.NET "Web Application" project type
+//
+// Authors:
+// Michael Hutchinson <m.j.hutchinson@gmail.com>
+//
+// Copyright (C) 2006 Michael Hutchinson
+//
+//
+// This source code is licenced under The MIT License:
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Xml;
+
+using MonoDevelop.Core;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Core.Assemblies;
+using MonoDevelop.Core.Execution;
+using MonoDevelop.Core.ProgressMonitoring;
+using MonoDevelop.Core.Serialization;
+using MonoDevelop.Ide.Desktop;
+using MonoDevelop.Ide;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Projects;
+using MonoDevelop.AspNet.Execution;
+using MonoDevelop.AspNet.WebForms;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.AspNet.Projects
+{
+ [DataInclude (typeof(AspNetAppProjectConfiguration))]
+ public class AspNetAppProjectFlavor : DotNetProjectExtension
+ {
+ [ItemProperty("XspParameters", IsExternal=true)]
+ XspParameters xspParameters = new XspParameters ();
+
+ WebFormsRegistrationCache registrationCache;
+ WebFormsCodeBehindTypeNameCache codebehindTypeNameCache;
+
+ #region properties
+
+ protected override DotNetProjectFlags OnGetDotNetProjectFlags ()
+ {
+ return base.OnGetDotNetProjectFlags () | DotNetProjectFlags.IsLibrary;
+ }
+
+ public XspParameters XspParameters {
+ get { return xspParameters; }
+ }
+
+ internal WebFormsRegistrationCache RegistrationCache {
+ get {
+ if (registrationCache == null)
+ registrationCache = new WebFormsRegistrationCache (Project);
+ return registrationCache;
+ }
+ }
+
+ #endregion
+
+ #region constructors
+
+ protected override void Initialize ()
+ {
+ base.Initialize ();
+ codebehindTypeNameCache = new WebFormsCodeBehindTypeNameCache (Project);
+ }
+
+ protected override void OnInitializeFromTemplate (ProjectCreateInformation projectCreateInfo, XmlElement template)
+ {
+ base.OnInitializeFromTemplate (projectCreateInfo, template);
+
+ var binPath = projectCreateInfo == null? (FilePath)"bin" : projectCreateInfo.BinPath;
+ foreach (var cfg in Project.Configurations.Cast<DotNetProjectConfiguration> ())
+ cfg.OutputDirectory = binPath;
+ }
+
+ protected override SolutionItemConfiguration OnCreateConfiguration (string name, ConfigurationKind kind)
+ {
+ var conf = new AspNetAppProjectConfiguration (name);
+ conf.CopyFrom (base.OnCreateConfiguration (name, kind));
+ conf.OutputDirectory = Project.BaseDirectory.IsNullOrEmpty? "bin" : (string)Project.BaseDirectory.Combine ("bin");
+ return conf;
+ }
+
+ public AspNetAppProjectConfiguration GetConfiguration (ConfigurationSelector configuration)
+ {
+ return (AspNetAppProjectConfiguration) Project.GetConfiguration (configuration);
+ }
+
+ #endregion
+
+ public override void Dispose ()
+ {
+ codebehindTypeNameCache.Dispose ();
+ RegistrationCache.Dispose ();
+ base.Dispose ();
+ }
+
+ #region build/prebuild/execute
+
+ protected override ProjectFeatures OnGetSupportedFeatures ()
+ {
+ return base.OnGetSupportedFeatures () | ProjectFeatures.Execute;
+ }
+
+ protected override Task<BuildResult> OnBuild (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
+ {
+ //if no files are set to compile, then some compilers will error out
+ //though this is valid with ASP.NET apps, so we just avoid calling the compiler in this case
+ bool needsCompile = false;
+ foreach (ProjectFile pf in Project.Files) {
+ if (pf.BuildAction == BuildAction.Compile) {
+ needsCompile = true;
+ break;
+ }
+ }
+
+ if (needsCompile)
+ return base.OnBuild (monitor, configuration, operationContext);
+ return Task.FromResult (BuildResult.CreateSuccess ());
+ }
+
+ ExecutionCommand CreateExecutionCommand (ConfigurationSelector config, AspNetAppProjectConfiguration configuration)
+ {
+ return new AspNetExecutionCommand {
+ ClrVersion = configuration.ClrVersion,
+ DebugMode = configuration.DebugSymbols,
+ XspParameters = XspParameters,
+ BaseDirectory = Project.BaseDirectory,
+ TargetRuntime = Project.TargetRuntime,
+ TargetFramework = Project.TargetFramework,
+ UserAssemblyPaths = Project.GetUserAssemblyPaths (config),
+ EnvironmentVariables = configuration.EnvironmentVariables,
+ };
+ }
+
+ protected override bool OnGetCanExecute (ExecutionContext context, ConfigurationSelector configuration)
+ {
+ var cmd = CreateExecutionCommand (configuration, GetConfiguration (configuration));
+ return context.ExecutionHandler.CanExecute (cmd);
+ }
+
+ protected async override Task OnExecute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ {
+ //check XSP is available
+
+ var cfg = GetConfiguration (configuration);
+ var cmd = CreateExecutionCommand (configuration, cfg);
+ var browserExcTarget = (BrowserExecutionTarget) context.ExecutionTarget;
+
+ OperationConsole console = null;
+
+ bool isXsp = true; //FIXME: fix this when it might not be true - should delegate to the ExecutionHandler
+
+ try {
+ //HACK: check XSP exists first, because error UX is cleaner w/o displaying a blank console pad.
+ if (isXsp) {
+ try {
+ AspNetExecutionHandler.GetXspPath ((AspNetExecutionCommand)cmd);
+ } catch (UserException ex) {
+ MessageService.ShowError (
+ GettextCatalog.GetString ("Could not launch ASP.NET web server"),
+ ex.Message);
+ throw;
+ }
+ }
+
+ if (cfg.ExternalConsole)
+ console = context.ExternalConsoleFactory.CreateConsole (!cfg.PauseConsoleOutput, monitor.CancellationToken);
+ else
+ console = context.ConsoleFactory.CreateConsole (monitor.CancellationToken);
+
+ // The running Port value is now captured in the XspBrowserLauncherConsole object
+ string url = String.Format ("http://{0}", XspParameters.Address);
+
+
+ if (isXsp) {
+ console = new XspBrowserLauncherConsole (console, delegate (string port) {
+ if (browserExcTarget != null)
+ browserExcTarget.DesktopApp.Launch (String.Format("{0}:{1}", url, port));
+ else
+ BrowserLauncher.LaunchDefaultBrowser (String.Format("{0}:{1}", url, port));
+ });
+ }
+
+ monitor.Log.WriteLine ("Running web server...");
+
+ var op = context.ExecutionHandler.Execute (cmd, console);
+
+ if (!isXsp) {
+ if (browserExcTarget != null)
+ browserExcTarget.DesktopApp.Launch (url);
+ else
+ BrowserLauncher.LaunchDefaultBrowser (url);
+ }
+
+ using (monitor.CancellationToken.Register (op.Cancel))
+ await op.Task;
+
+ monitor.Log.WriteLine ("The web server exited with code: {0}", op.ExitCode);
+
+ } catch (Exception ex) {
+ if (!(ex is UserException)) {
+ LoggingService.LogError ("Could not launch ASP.NET web server.", ex);
+ }
+ monitor.ReportError ("Could not launch web server.", ex);
+ } finally {
+ if (console != null)
+ console.Dispose ();
+ }
+ }
+
+ #endregion
+
+ #region File utility methods
+
+ public WebSubtype DetermineWebSubtype (ProjectFile file)
+ {
+ if (Project.LanguageBinding != null && Project.LanguageBinding.IsSourceCodeFile (file.FilePath))
+ return WebSubtype.Code;
+ return DetermineWebSubtype (file.Name);
+ }
+
+ public static WebSubtype DetermineWebSubtype (string fileName)
+ {
+ string extension = Path.GetExtension (fileName);
+ if (extension == null)
+ return WebSubtype.None;
+ extension = extension.ToUpperInvariant ().TrimStart ('.');
+
+ //NOTE: No way to identify WebSubtype.Code from here
+ //use the instance method for that
+ switch (extension) {
+ case "ASPX":
+ return WebSubtype.WebForm;
+ case "MASTER":
+ return WebSubtype.MasterPage;
+ case "ASHX":
+ return WebSubtype.WebHandler;
+ case "ASCX":
+ return WebSubtype.WebControl;
+ case "ASMX":
+ return WebSubtype.WebService;
+ case "ASAX":
+ return WebSubtype.Global;
+ case "GIF":
+ case "PNG":
+ case "JPG":
+ return WebSubtype.WebImage;
+ case "SKIN":
+ return WebSubtype.WebSkin;
+ case "CONFIG":
+ return WebSubtype.Config;
+ case "BROWSER":
+ return WebSubtype.BrowserDefinition;
+ case "AXD":
+ return WebSubtype.Axd;
+ case "SITEMAP":
+ return WebSubtype.Sitemap;
+ case "CSS":
+ return WebSubtype.Css;
+ case "XHTML":
+ case "HTML":
+ case "HTM":
+ return WebSubtype.Html;
+ case "JS":
+ return WebSubtype.JavaScript;
+ case "LESS":
+ return WebSubtype.Less;
+ case "SASS":
+ case "SCSS":
+ return WebSubtype.Sass;
+ case "EOT":
+ case "TTF":
+ case "OTF":
+ case "WOFF":
+ return WebSubtype.Font;
+ case "SVG":
+ return WebSubtype.Svg;
+ case "STYL":
+ return WebSubtype.Stylus;
+ case "CSHTML":
+ return WebSubtype.Razor;
+ default:
+ return WebSubtype.None;
+ }
+ }
+
+ #endregion
+
+ #region special files
+
+ #endregion
+
+ public ProjectFile ResolveVirtualPath (string virtualPath, string relativeToFile)
+ {
+ string name = VirtualToLocalPath (virtualPath, relativeToFile);
+ if (name == null)
+ return null;
+ return Project.Files.GetFile (name);
+ }
+
+ public string VirtualToLocalPath (string virtualPath, string relativeToFile)
+ {
+ if (string.IsNullOrEmpty (virtualPath) || virtualPath [0] == '/' || virtualPath.IndexOf (':') > -1)
+ return null;
+
+ FilePath relativeToDir;
+ if (virtualPath.Length > 1 && virtualPath[0] == '~') {
+ if (virtualPath[1] == '/')
+ virtualPath = virtualPath.Substring (2);
+ else
+ virtualPath = virtualPath.Substring (1);
+ relativeToDir = Project.BaseDirectory;
+ } else {
+ relativeToDir = String.IsNullOrEmpty (relativeToFile)
+ ? Project.BaseDirectory
+ : (FilePath) Path.GetDirectoryName (relativeToFile);
+ }
+
+ virtualPath = virtualPath.Replace ('/', Path.DirectorySeparatorChar);
+ return relativeToDir.Combine (virtualPath).FullPath;
+ }
+
+ public string LocalToVirtualPath (string filename)
+ {
+ string rel = FileService.AbsoluteToRelativePath (Project.BaseDirectory, filename);
+ return "~/" + rel.Replace (Path.DirectorySeparatorChar, '/');
+ }
+
+ public string LocalToVirtualPath (ProjectFile file)
+ {
+ return LocalToVirtualPath (file.FilePath);
+ }
+
+ #region Reference handling
+
+ protected override void OnReferenceAddedToProject (ProjectReferenceEventArgs e)
+ {
+ //short-circuit if the project is being deserialised
+ if (Project.Loading) {
+ base.OnReferenceAddedToProject (e);
+ return;
+ }
+
+ UpdateWebConfigRefs ();
+
+ base.OnReferenceAddedToProject (e);
+ }
+
+ protected override void OnReferenceRemovedFromProject (ProjectReferenceEventArgs e)
+ {
+ //short-circuit if the project is being deserialised
+ if (Project.Loading) {
+ base.OnReferenceAddedToProject (e);
+ return;
+ }
+
+ UpdateWebConfigRefs ();
+
+ base.OnReferenceRemovedFromProject (e);
+ }
+
+ void UpdateWebConfigRefs ()
+ {
+ var refs = new List<string> ();
+ foreach (var reference in Project.References) {
+ //local copied assemblies are copied to the bin directory so ASP.NET references them automatically
+ if (reference.LocalCopy && (reference.ReferenceType == ReferenceType.Project || reference.ReferenceType == ReferenceType.Assembly))
+ continue;
+ if (string.IsNullOrEmpty (reference.Reference))
+ continue;
+ //these assemblies are referenced automatically by ASP.NET
+ if (WebFormsRegistrationCache.IsDefaultReference (reference.Reference))
+ continue;
+ //bypass non dotnet projects
+ if ((reference.ReferenceType == ReferenceType.Project) &&
+ (!(reference.ResolveProject (reference.OwnerProject.ParentSolution) is DotNetProject)))
+ continue;
+ refs.Add (reference.Reference);
+ }
+
+ var webConfig = GetWebConfig ();
+ if (webConfig == null || !File.Exists (webConfig.FilePath))
+ return;
+
+ //use textfile API because it's write safe (writes out to another file then moves)
+ var textFile = MonoDevelop.Ide.TextFileProvider.Instance.GetEditableTextFile (webConfig.FilePath);
+
+ //can't use System.Web.Configuration.WebConfigurationManager, as it can only access virtual paths within an app
+ //so need full manual handling
+ try {
+ var doc = new XmlDocument ();
+
+ //FIXME: PreserveWhitespace doesn't handle whitespace in attribute lists
+ //doc.PreserveWhitespace = true;
+ doc.LoadXml (textFile.Text);
+
+ //hunt our way to the assemblies element, creating elements if necessary
+ XmlElement configElement = doc.DocumentElement;
+ if (configElement == null || string.Compare (configElement.Name, "configuration", StringComparison.OrdinalIgnoreCase) != 0) {
+ configElement = (XmlElement) doc.AppendChild (doc.CreateNode (XmlNodeType.Document, "configuration", null));
+ }
+ XmlElement webElement = GetNamedXmlElement (doc, configElement, "system.web");
+ XmlElement compilationNode = GetNamedXmlElement (doc, webElement, "compilation");
+ XmlElement assembliesNode = GetNamedXmlElement (doc, compilationNode, "assemblies");
+
+ List<XmlNode> existingAdds = new List<XmlNode> ();
+ foreach (XmlNode node in assembliesNode)
+ if (string.Compare (node.Name, "add", StringComparison.OrdinalIgnoreCase) == 0)
+ existingAdds.Add (node);
+
+ //add refs to the doc if they're not in it
+ foreach (string reference in refs) {
+ int index = 0;
+ bool found = false;
+ while (index < existingAdds.Count) {
+ XmlNode node = existingAdds [index];
+ XmlAttribute att = (XmlAttribute)node.Attributes.GetNamedItem ("assembly");
+ if (att == null)
+ continue;
+ string refAtt = att.Value;
+ if (refAtt != null && refAtt == reference) {
+ existingAdds.RemoveAt (index);
+ found = true;
+ break;
+ }
+ index++;
+ }
+ if (!found) {
+ XmlElement newAdd = doc.CreateElement ("add");
+ XmlAttribute newAtt = doc.CreateAttribute ("assembly");
+ newAtt.Value = reference;
+ newAdd.Attributes.Append (newAtt);
+ assembliesNode.AppendChild (newAdd);
+ }
+ }
+
+ //any nodes that weren't removed from the existingAdds list are old/redundant, so remove from doc
+ foreach (XmlNode node in existingAdds)
+ assembliesNode.RemoveChild (node);
+
+ StringWriter sw = new StringWriter ();
+ XmlTextWriter tw = new XmlTextWriter (sw);
+ tw.Formatting = Formatting.Indented;
+ doc.WriteTo (tw);
+ tw.Flush ();
+ textFile.Text = sw.ToString ();
+ textFile.WriteTextTo (textFile.FileName);
+ } catch (Exception e) {
+ LoggingService.LogWarning ("Could not modify application web.config in project " + Project.Name, e);
+ }
+ }
+
+
+ XmlElement GetNamedXmlElement (XmlDocument doc, XmlElement parent, string name)
+ {
+ XmlElement result = null;
+ foreach (XmlNode node in parent.ChildNodes) {
+ XmlElement elem = node as XmlElement;
+ if (elem != null && string.Compare (elem.Name, name, StringComparison.OrdinalIgnoreCase) == 0) {
+ result = elem;
+ break;
+ }
+ }
+ if (result == null) {
+ result = (XmlElement) parent.AppendChild (doc.CreateElement (name));
+ }
+ return result;
+ }
+
+ ProjectFile GetWebConfig ()
+ {
+ var webConf = Project.BaseDirectory.Combine ("web.config");
+ foreach (var file in Project.Files)
+ if (string.Compare (file.FilePath.ToString (), webConf, StringComparison.OrdinalIgnoreCase) == 0)
+ return file;
+ return null;
+ }
+
+ bool IsWebConfig (FilePath file)
+ {
+ var webConf = Project.BaseDirectory.Combine ("web.config");
+ return (string.Compare (file, webConf, StringComparison.OrdinalIgnoreCase) == 0);
+ }
+
+ #endregion
+
+ #region File event handlers
+
+ protected override void OnFileAddedToProject (ProjectFileEventArgs e)
+ {
+ //short-circuit if the project is being deserialised
+ if (Project.Loading) {
+ base.OnFileAddedToProject (e);
+ return;
+ }
+
+ bool webConfigChange = false;
+ List<string> filesToAdd = new List<string> ();
+
+ foreach (ProjectFileEventInfo fargs in e) {
+ IEnumerable<string> files = MonoDevelop.DesignerSupport.CodeBehind.GuessDependencies
+ (Project, fargs.ProjectFile, groupedExtensions);
+ if (files != null)
+ filesToAdd.AddRange (files);
+ if (IsWebConfig (fargs.ProjectFile.FilePath))
+ webConfigChange = true;
+ }
+
+ if (webConfigChange)
+ UpdateWebConfigRefs ();
+
+ //let the base fire the event before we add files
+ //don't want to fire events out of order of files being added
+ base.OnFileAddedToProject (e);
+
+ //make sure that the parent and child files are in the project
+ foreach (string file in filesToAdd) {
+ //NOTE: this only adds files if they are not already in the project
+ Project.AddFile (file);
+ }
+ }
+
+ protected override string OnGetDefaultBuildAction (string fileName)
+ {
+
+ WebSubtype type = DetermineWebSubtype (fileName);
+ switch (type) {
+ case WebSubtype.Code:
+ return BuildAction.Compile;
+ case WebSubtype.None:
+ return base.OnGetDefaultBuildAction (fileName);
+ default:
+ return BuildAction.Content;
+ }
+ }
+
+ static string[] groupedExtensions = { ".aspx", ".master", ".ashx", ".ascx", ".asmx", ".asax" };
+
+ #endregion
+
+ public virtual IEnumerable<string> GetSpecialDirectories ()
+ {
+ yield return "App_Browsers";
+ yield return "App_Data";
+ yield return "App_GlobalResources";
+ yield return "App_LocalResources";
+ yield return "Theme";
+
+ if (IsAspMvcProject) {
+ yield return "Views";
+ yield return "Models";
+ yield return "Controllers";
+ }
+
+ // For "web site" projects
+ // "App_WebReferences", "App_Resources","App_Themes", "App_Code",
+ }
+
+ protected override IList<string> OnGetCommonBuildActions ()
+ {
+ return new [] {
+ BuildAction.None,
+ BuildAction.Compile,
+ BuildAction.Content,
+ BuildAction.EmbeddedResource,
+ };
+ }
+
+ public string GetCodebehindTypeName (string fileName)
+ {
+ lock (codebehindTypeNameCache)
+ return codebehindTypeNameCache.GetCodeBehindTypeName (fileName);
+ }
+
+ public IList<string> GetCodeTemplates (string type, string subtype = null)
+ {
+ var files = new List<string> ();
+ var names = new HashSet<string> ();
+
+ string asmDir = Path.GetDirectoryName (GetType().Assembly.Location);
+ string lang = Project.LanguageName;
+ if (lang == "C#") {
+ lang = "CSharp";
+ }
+
+ if (subtype != null) {
+ type = Path.Combine (type, subtype);
+ }
+
+ var dirs = new [] {
+ Path.Combine (Project.BaseDirectory, "CodeTemplates", type),
+ Path.Combine (Project.BaseDirectory, "CodeTemplates", lang, type),
+ Path.Combine (asmDir, "CodeTemplates", type),
+ Path.Combine (asmDir, "CodeTemplates", lang, type),
+ };
+
+ foreach (string directory in dirs)
+ if (Directory.Exists (directory))
+ foreach (string file in Directory.GetFiles (directory, "*.tt", SearchOption.TopDirectoryOnly))
+ if (names.Add (Path.GetFileName (file)))
+ files.Add (file);
+
+ return files;
+ }
+
+ protected override void OnPopulateSupportFileList (FileCopySet list, ConfigurationSelector configuration)
+ {
+ base.OnPopulateSupportFileList (list, configuration);
+
+ //HACK: workaround for MD not local-copying package references
+ foreach (MonoDevelop.Projects.ProjectReference projectReference in Project.References) {
+ if (projectReference.Package != null && projectReference.Package.Name == "system.web.mvc") {
+ if (projectReference.ReferenceType == ReferenceType.Package)
+ foreach (SystemAssembly assem in projectReference.Package.Assemblies)
+ list.Add (assem.Location);
+ break;
+ }
+ }
+ }
+
+ public string GetAspNetMvcVersion ()
+ {
+ foreach (var pref in Project.References) {
+ if (pref.Reference.IndexOf ("System.Web.Mvc", StringComparison.OrdinalIgnoreCase) < 0)
+ continue;
+ switch (pref.ReferenceType) {
+ case ReferenceType.Assembly:
+ case ReferenceType.Package:
+ foreach (var f in pref.GetReferencedFileNames (null)) {
+ if (Path.GetFileNameWithoutExtension (f) != "System.Web.Mvc" || !File.Exists (f))
+ continue;
+ return AssemblyName.GetAssemblyName (f).Version.ToString ();
+ }
+ break;
+ default:
+ continue;
+ }
+ }
+
+ if (IsAspMvcProject)
+ return GetDefaultAspNetMvcVersion ();
+
+ return null;
+ }
+
+ public bool SupportsRazorViewEngine {
+ get {
+ return Project.References.Any (r => r.Reference.StartsWith ("System.Web.WebPages.Razor", StringComparison.Ordinal));
+ }
+ }
+
+ protected virtual string GetDefaultAspNetMvcVersion ()
+ {
+ return "5.2";
+ }
+
+ public virtual bool IsAspMvcProject {
+ get {
+ return Project.References.Any (r => r.Reference.StartsWith ("System.Web.Mvc", StringComparison.Ordinal));
+ }
+ }
+
+ public bool IsAspWebApiProject {
+ get {
+ return Project.References.Any (r => r.Reference.StartsWith ("System.Web.Http.WebHost", StringComparison.Ordinal));
+ }
+ }
+
+ public virtual bool IsAspWebFormsProject {
+ get {
+ return Project.Files.Any (f => f.Name.EndsWith (".aspx", StringComparison.Ordinal));
+ }
+ }
+
+ class BrowserExecutionTarget : ExecutionTarget
+ {
+ string name, id;
+ public BrowserExecutionTarget (string id, string displayName, DesktopApplication app){
+ this.name = displayName;
+ this.id = id;
+ this.DesktopApp = app;
+ }
+
+ public override string Name {
+ get { return name; }
+ }
+
+ public override string Id {
+ get { return id; }
+ }
+
+ public DesktopApplication DesktopApp { get; private set; }
+ }
+
+ protected override IEnumerable<ExecutionTarget> OnGetExecutionTargets (ConfigurationSelector configuration)
+ {
+ var apps = new List<ExecutionTarget> ();
+ foreach (var browser in MonoDevelop.Ide.DesktopService.GetApplications ("test.html")) {
+ if (browser.IsDefault)
+ apps.Insert (0, new BrowserExecutionTarget (browser.Id,browser.DisplayName,browser));
+ else
+ apps.Add (new BrowserExecutionTarget (browser.Id,browser.DisplayName,browser));
+ }
+ return apps;
+ }
+ }
+}
diff --git a/main/src/addins/AspNet/Projects/AspNetMSBuildImportProvider.cs b/main/src/addins/AspNet/Projects/AspNetMSBuildImportProvider.cs
index 40deaca04d..634c5edd0c 100644
--- a/main/src/addins/AspNet/Projects/AspNetMSBuildImportProvider.cs
+++ b/main/src/addins/AspNet/Projects/AspNetMSBuildImportProvider.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
using MonoDevelop.Projects;
-using MonoDevelop.Projects.Formats.MSBuild;
+using MonoDevelop.Projects.MSBuild;
using Mono.Addins;
using MonoDevelop.AspNet.Projects;
diff --git a/main/src/addins/AspNet/Projects/AspNetMvcFileTemplateCondition.cs b/main/src/addins/AspNet/Projects/AspNetMvcFileTemplateCondition.cs
index 0a4f581ad1..d30fc4ae14 100644
--- a/main/src/addins/AspNet/Projects/AspNetMvcFileTemplateCondition.cs
+++ b/main/src/addins/AspNet/Projects/AspNetMvcFileTemplateCondition.cs
@@ -50,7 +50,7 @@ namespace MonoDevelop.AspNet.Projects
if (proj == null)
return true;
- var aspProj = proj as AspNetAppProject;
+ var aspProj = proj.GetFlavor<AspNetAppProjectFlavor> ();
if (aspProj == null)
return false;
diff --git a/main/src/addins/AspNet/Projects/AspNetProjectTemplateWizardPage.cs b/main/src/addins/AspNet/Projects/AspNetProjectTemplateWizardPage.cs
index 6fa701717b..c410d543ea 100644
--- a/main/src/addins/AspNet/Projects/AspNetProjectTemplateWizardPage.cs
+++ b/main/src/addins/AspNet/Projects/AspNetProjectTemplateWizardPage.cs
@@ -26,14 +26,15 @@
using MonoDevelop.Ide.Templates;
using MonoDevelop.Core;
+using MonoDevelop.Core.StringParsing;
namespace MonoDevelop.AspNet.Projects
{
class AspNetProjectTemplateWizardPage : WizardPage
{
- readonly string title = GettextCatalog.GetString ("Web Project Options");
+ readonly string title = GettextCatalog.GetString ("Configure your Web project");
readonly AspNetProjectTemplateWizard wizard;
- AspNetProjectTemplateWizardPageWidget view;
+ GtkAspNetProjectTemplateWizardPageWidget view;
bool includeTestProject;
@@ -74,7 +75,7 @@ namespace MonoDevelop.AspNet.Projects
}
public bool AspNetMvcEnabled {
- get { return wizard.Parameters.GetBoolean (aspNetMvc); }
+ get { return wizard.Parameters.GetBoolValue (aspNetMvc); }
set {
wizard.Parameters [aspNetMvc] = value.ToString ();
UpdateCanMoveNext ();
@@ -86,7 +87,7 @@ namespace MonoDevelop.AspNet.Projects
}
public bool AspNetWebFormsEnabled {
- get { return wizard.Parameters.GetBoolean (aspNetWebForms); }
+ get { return wizard.Parameters.GetBoolValue (aspNetWebForms); }
set {
wizard.Parameters [aspNetWebForms] = value.ToString ();
UpdateCanMoveNext ();
@@ -98,7 +99,7 @@ namespace MonoDevelop.AspNet.Projects
}
public bool AspNetWebApiEnabled {
- get { return wizard.Parameters.GetBoolean (aspNetWebApi); }
+ get { return wizard.Parameters.GetBoolValue (aspNetWebApi); }
set {
wizard.Parameters [aspNetWebApi] = value.ToString ();
UpdateCanMoveNext ();
@@ -118,9 +119,17 @@ namespace MonoDevelop.AspNet.Projects
get { return title; }
}
- protected override object CreateNativeWidget ()
+ protected override object CreateNativeWidget<T> ()
{
- return view ?? (view = new AspNetProjectTemplateWizardPageWidget (this));
+ return view ?? (view = new GtkAspNetProjectTemplateWizardPageWidget (this));
+ }
+
+ protected override void Dispose (bool disposing)
+ {
+ if (view != null) {
+ view.Dispose ();
+ view = null;
+ }
}
}
}
diff --git a/main/src/addins/AspNet/Projects/AspNetProjectTemplateWizardPageWidget.cs b/main/src/addins/AspNet/Projects/AspNetProjectTemplateWizardPageWidget.cs
deleted file mode 100644
index b494c58a7d..0000000000
--- a/main/src/addins/AspNet/Projects/AspNetProjectTemplateWizardPageWidget.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-//
-// AspNetProjectTemplateWizardPageWidget.cs
-//
-// Author:
-// Michael Hutchinson <m.j.hutchinson@gmail.com>
-//
-// Copyright (c) 2015 Xamarin Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using Gtk;
-using Gdk;
-
-namespace MonoDevelop.AspNet.Projects
-{
- class AspNetProjectTemplateWizardPageWidget : HBox
- {
- readonly AspNetProjectTemplateWizardPage page;
-
- public AspNetProjectTemplateWizardPageWidget (AspNetProjectTemplateWizardPage page)
- {
- this.page = page;
-
- Build ();
-
- includeTestProjectCheck.Active = page.IncludeTestProject;
- }
-
- CheckButton includeTestProjectCheck;
- CheckButton includeMvcCheck;
- CheckButton includeWebFormsCheck;
- CheckButton includeWebApiCheck;
-
- void Build ()
- {
- var backgroundColor = new Color (225, 228, 232);
-
- var box = new VBox { BorderWidth = 12, Spacing = 12 };
- var eb = new EventBox { Child = box };
- eb.ModifyBg (StateType.Normal, backgroundColor);
- var infoEB = new EventBox { WidthRequest = 280 };
- infoEB.ModifyBg (StateType.Normal, new Color (255, 255, 255));
- PackStart (eb, true, true, 0);
- PackStart (infoEB, false, false, 0);
-
- var frameworkLabel = new Label ("Include references and folders for:") { Xalign = 0 };
- box.PackStart (frameworkLabel, false, false, 0);
- var frameworkBox = new VBox { Spacing = 6 };
- box.PackStart (new Alignment (0, 0, 0, 0) { LeftPadding = 24, Child = frameworkBox } , false, false, 0);
-
- if (page.AspNetMvcMutable || page.AspNetMvcEnabled) {
- includeMvcCheck = CreateFancyCheckButton (
- "MVC",
- "Modern programming model. Unit testable, choice of templating languages."
- );
- includeMvcCheck.Active = page.AspNetMvcEnabled;
- includeMvcCheck.Toggled += (sender, e) => {
- page.AspNetMvcEnabled = includeMvcCheck.Active;
- };
- includeMvcCheck.Sensitive = page.AspNetMvcMutable;
- frameworkBox.PackStart (includeMvcCheck, false, false, 0);
- }
-
- if (page.AspNetWebFormsMutable || page.AspNetWebFormsEnabled) {
- includeWebFormsCheck = CreateFancyCheckButton (
- "Web Forms",
- "Stateful programming model similar to desktop applications."
- );
- includeWebFormsCheck.Active = page.AspNetWebFormsEnabled;
- includeWebFormsCheck.Toggled += (sender, e) => {
- page.AspNetWebFormsEnabled = includeWebFormsCheck.Active;
- };
- includeWebFormsCheck.Sensitive = page.AspNetWebFormsMutable;
- frameworkBox.PackStart (includeWebFormsCheck, false, false, 0);
- }
-
- if (page.AspNetWebApiMutable || page.AspNetWebApiEnabled) {
- includeWebApiCheck = CreateFancyCheckButton (
- "Web API",
- "Framework for creating HTTP web services."
- );
- includeWebApiCheck.Active = page.AspNetWebApiEnabled;
- includeWebApiCheck.Toggled += (sender, e) => {
- page.AspNetWebApiEnabled = includeWebApiCheck.Active;
- };
- includeWebApiCheck.Sensitive = page.AspNetWebApiMutable;
- frameworkBox.PackStart (includeWebApiCheck, false, false, 0);
- }
-
- includeTestProjectCheck = CreateFancyCheckButton (
- "Include Unit Test Project",
- "Add a Unit Test Project for testing the Web Project using NUnit."
- );
- includeTestProjectCheck.Toggled += (sender, e) => {
- page.IncludeTestProject = includeTestProjectCheck.Active;
- };
-
- box.PackStart (includeTestProjectCheck, false, false, 0);
-
- ShowAll ();
- }
-
- static CheckButton CreateFancyCheckButton (string title, string detail)
- {
- var button = new CheckButton ();
- var box = new VBox { Spacing = 4 };
- var titleLabel = new Label {
- Markup = "<b>" + GLib.Markup.EscapeText (title) + "</b>",
- Xalign = 0
- };
- box.PackStart (titleLabel, false, false, 0);
- var detailLabel = new Label {
- Text = detail,
- Xalign = 0
- };
- box.PackStart (detailLabel, false, false, 0);
- button.Child = new Alignment (0, 0, 0, 0) { LeftPadding = 6, Child = box };
- return button;
- }
- }
-}
diff --git a/main/src/addins/AspNet/Projects/AspNetStringTagProvider.cs b/main/src/addins/AspNet/Projects/AspNetStringTagProvider.cs
index 93ceb0eba8..503b2267c2 100644
--- a/main/src/addins/AspNet/Projects/AspNetStringTagProvider.cs
+++ b/main/src/addins/AspNet/Projects/AspNetStringTagProvider.cs
@@ -31,7 +31,7 @@ using MonoDevelop.Core.StringParsing;
namespace MonoDevelop.AspNet.Projects
{
[Mono.Addins.Extension]
- class AspNetStringTagProvider : StringTagProvider<AspNetAppProject>
+ class AspNetStringTagProvider : StringTagProvider<AspNetAppProjectFlavor>
{
public override IEnumerable<StringTagDescription> GetTags ()
{
@@ -40,7 +40,7 @@ namespace MonoDevelop.AspNet.Projects
yield return new StringTagDescription ("UsesAspNetWebApi", "Whether the project uses ASP.NET Web API");
}
- public override object GetTagValue (AspNetAppProject instance, string tag)
+ public override object GetTagValue (AspNetAppProjectFlavor instance, string tag)
{
switch (tag) {
case "USESASPNETMVC":
diff --git a/main/src/addins/AspNet/Projects/GtkAspNetProjectTemplateWizardPageWidget.cs b/main/src/addins/AspNet/Projects/GtkAspNetProjectTemplateWizardPageWidget.cs
new file mode 100644
index 0000000000..699afe4c5a
--- /dev/null
+++ b/main/src/addins/AspNet/Projects/GtkAspNetProjectTemplateWizardPageWidget.cs
@@ -0,0 +1,195 @@
+//
+// GtkAspNetProjectTemplateWizardPageWidget.cs
+//
+// Author:
+// Michael Hutchinson <m.j.hutchinson@gmail.com>
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Gdk;
+using Gtk;
+using Mono.TextEditor;
+using MonoDevelop.Components;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.AspNet.Projects
+{
+ [System.ComponentModel.ToolboxItem (true)]
+ partial class GtkAspNetProjectTemplateWizardPageWidget : Gtk.Bin
+ {
+ AspNetProjectTemplateWizardPage wizardPage;
+ ImageView backgroundImageView;
+ Xwt.Drawing.Image backgroundImage;
+
+ public GtkAspNetProjectTemplateWizardPageWidget ()
+ {
+ this.Build ();
+
+ if (Platform.IsMac) {
+ int labelPaddingHeight = 5;
+ if (IsYosemiteOrHigher ())
+ labelPaddingHeight--;
+ includeLabelPadding.HeightRequest = labelPaddingHeight;
+ testingLabelPadding.HeightRequest = labelPaddingHeight;
+
+ int leftPaddingWidth = 28;
+ mvcDescriptionLeftHandPadding.WidthRequest = leftPaddingWidth;
+ webFormsDescriptionLeftHandPadding.WidthRequest = leftPaddingWidth;
+ webApiDescriptionLeftHandPadding.WidthRequest = leftPaddingWidth;
+ includeUnitTestProjectDescriptionLeftHandPadding.WidthRequest = leftPaddingWidth;
+ }
+
+ double scale = GtkWorkarounds.GetPixelScale ();
+
+ backgroundImage = Xwt.Drawing.Image.FromResource ("aspnet-wizard-page.png");
+ backgroundImageView = new ImageView (backgroundImage);
+ backgroundImageView.Xalign = (float)(1/scale);
+ backgroundImageView.Yalign = (float)(1/scale);
+ backgroundLargeImageVBox.PackStart (backgroundImageView, true, true, 0);
+
+ var separatorColor = Ide.Gui.Styles.NewProjectDialog.ProjectConfigurationSeparatorColor.ToGdkColor ();
+ var backgroundColor = Ide.Gui.Styles.NewProjectDialog.ProjectConfigurationLeftHandBackgroundColor.ToGdkColor ();
+ testingSeparator.ModifyBg (StateType.Normal, separatorColor);
+
+ leftBorderEventBox.ModifyBg (StateType.Normal, backgroundColor);
+ configurationTopEventBox.ModifyBg (StateType.Normal, backgroundColor);
+ configurationTableEventBox.ModifyBg (StateType.Normal, backgroundColor);
+ configurationBottomEventBox.ModifyBg (StateType.Normal, backgroundColor);
+ backgroundLargeImageEventBox.ModifyBg (StateType.Normal, backgroundColor);
+
+ if (Platform.IsWindows && scale > 1.0)
+ ScaleWidgets (scale);
+ }
+
+ public GtkAspNetProjectTemplateWizardPageWidget (AspNetProjectTemplateWizardPage wizardPage)
+ : this ()
+ {
+ WizardPage = wizardPage;
+ }
+
+ void ScaleWidgets (double scale)
+ {
+ ScaleWidgetsWidth (scale, new Widget[] {
+ leftBorderEventBox,
+ configurationVBox,
+ includeLabelPadding,
+ testingLabelPadding,
+ paddingLabel,
+ testingSeparator,
+ mvcDescriptionLeftHandPadding,
+ mvcDescriptionLabel,
+ webFormsDescriptionLeftHandPadding,
+ webFormsDescriptionLabel,
+ webApiDescriptionLeftHandPadding,
+ webApiDescriptionLabel,
+ includeUnitTestProjectDescriptionLabel,
+ includeUnitTestProjectDescriptionLeftHandPadding
+ });
+
+ ScaleWidgetsHeight (scale, new Widget[] {
+ includeLabelPadding,
+ testingLabelPadding,
+ testingSeparator
+ });
+ }
+
+ void ScaleWidgetsWidth (double scale, Widget[] widgets)
+ {
+ foreach (Widget widget in widgets) {
+ widget.WidthRequest = (int)(widget.WidthRequest * scale);
+ }
+ }
+
+ void ScaleWidgetsHeight (double scale, Widget[] widgets)
+ {
+ foreach (Widget widget in widgets) {
+ widget.HeightRequest = (int)(widget.HeightRequest * scale);
+ }
+ }
+
+ public override void Dispose ()
+ {
+ Dispose (backgroundImage);
+ }
+
+ void Dispose (IDisposable disposable)
+ {
+ if (disposable != null) {
+ disposable.Dispose ();
+ }
+ }
+
+ public AspNetProjectTemplateWizardPage WizardPage {
+ get { return wizardPage; }
+ set {
+ wizardPage = value;
+ LoadWizardPageInfo ();
+ }
+ }
+
+ void LoadWizardPageInfo ()
+ {
+ if (wizardPage.AspNetMvcMutable || wizardPage.AspNetMvcEnabled) {
+ includeMvcCheck.Active = wizardPage.AspNetMvcEnabled;
+ includeMvcCheck.Toggled += (sender, e) => {
+ wizardPage.AspNetMvcEnabled = includeMvcCheck.Active;
+ };
+ mvcVBox.Sensitive = wizardPage.AspNetMvcMutable;
+ }
+
+ if (wizardPage.AspNetWebFormsMutable || wizardPage.AspNetWebFormsEnabled) {
+ includeWebFormsCheck.Active = wizardPage.AspNetWebFormsEnabled;
+ includeWebFormsCheck.Toggled += (sender, e) => {
+ wizardPage.AspNetWebFormsEnabled = includeWebFormsCheck.Active;
+ };
+ webFormsVBox.Sensitive = wizardPage.AspNetWebFormsMutable;
+ } else {
+ RemoveFromTable (webFormsVBox);
+ }
+
+ if (wizardPage.AspNetWebApiMutable || wizardPage.AspNetWebApiEnabled) {
+ includeWebApiCheck.Active = wizardPage.AspNetWebApiEnabled;
+ includeWebApiCheck.Toggled += (sender, e) => {
+ wizardPage.AspNetWebApiEnabled = includeWebApiCheck.Active;
+ };
+ webApiVBox.Sensitive = wizardPage.AspNetWebApiMutable;
+ }
+
+ includeTestProjectCheck.Toggled += (sender, e) => {
+ wizardPage.IncludeTestProject = includeTestProjectCheck.Active;
+ };
+ }
+
+ void RemoveFromTable (Widget widget)
+ {
+ configurationTable.Remove (widget);
+ widget.Destroy ();
+ }
+
+ bool IsYosemiteOrHigher ()
+ {
+ return Platform.OSVersion >= MacSystemInformation.Yosemite;
+ }
+ }
+}
+
diff --git a/main/src/addins/AspNet/Properties/AddinInfo.cs b/main/src/addins/AspNet/Properties/AddinInfo.cs
index 703d5f8b35..e7986424ec 100644
--- a/main/src/addins/AspNet/Properties/AddinInfo.cs
+++ b/main/src/addins/AspNet/Properties/AddinInfo.cs
@@ -14,4 +14,4 @@ using Mono.Addins;
[assembly:AddinDependency ("DesignerSupport", MonoDevelop.BuildInfo.Version)]
[assembly:AddinDependency ("Xml", MonoDevelop.BuildInfo.Version)]
[assembly:AddinDependency ("SourceEditor2", MonoDevelop.BuildInfo.Version)]
-[assembly:AddinDependency ("TextTemplating", MonoDevelop.BuildInfo.Version)] \ No newline at end of file
+[assembly:AddinDependency ("TextTemplating", MonoDevelop.BuildInfo.Version)]
diff --git a/main/src/addins/AspNet/Properties/AssemblyInfo.cs b/main/src/addins/AspNet/Properties/AssemblyInfo.cs
index 6508a7210d..c509a6f3af 100644
--- a/main/src/addins/AspNet/Properties/AssemblyInfo.cs
+++ b/main/src/addins/AspNet/Properties/AssemblyInfo.cs
@@ -1,9 +1,12 @@
// Autogenerated from MonoDevelop.AspNet.addin.xml
using System.Reflection;
+using System.Runtime.CompilerServices;
[assembly: AssemblyProduct ("MonoDevelop")]
[assembly: AssemblyTitle ("ASP.NET Project Support")]
[assembly: AssemblyDescription ("Support for ASP.NET projects, including editing, compiling, previewing and deploying to remote servers.")]
[assembly: AssemblyVersion ("2.6")]
[assembly: AssemblyCopyright ("MIT X11")]
+[assembly: InternalsVisibleTo("MonoDevelop.AspNet.Tests")]
+[assembly: InternalsVisibleTo("MonoDevelop.CSharpBinding.AspNet")]
diff --git a/main/src/addins/AspNet/Properties/MonoDevelop.AspNet.addin.xml b/main/src/addins/AspNet/Properties/MonoDevelop.AspNet.addin.xml
index 975e13f9b1..391260d6ef 100644
--- a/main/src/addins/AspNet/Properties/MonoDevelop.AspNet.addin.xml
+++ b/main/src/addins/AspNet/Properties/MonoDevelop.AspNet.addin.xml
@@ -5,67 +5,65 @@
<Import assembly = "System.Web.Mvc.dll" />
<Import assembly = "System.Web.Razor.dll" />
<Import assembly = "System.Web.WebPages.Deployment.dll" />
- <Import assembly = "System.Web.WebPages.dll" />
<Import assembly = "System.Web.WebPages.Razor.dll" />
+ <Import assembly = "System.Web.WebPages.dll" />
+ <Import file = "Html/Schemas/xhtml1-frameset.xsd" />
<Import file = "Html/Schemas/xhtml1-strict.xsd" />
<Import file = "Html/Schemas/xhtml1-transitional.xsd" />
- <Import file = "Html/Schemas/xhtml1-frameset.xsd" />
- <Import file = "Templates/WebForms/GlobalAsax-Empty.xft.xml"/>
- <Import file = "Templates/WebForms/GlobalAsax-CodeBehind.xft.xml"/>
<Import file = "Templates/WebForms/MasterPage-CodeBehind.xft.xml"/>
<Import file = "Templates/WebForms/MasterPage-Empty.xft.xml"/>
+ <Import file = "Templates/WebForms/NestedMasterPage-CodeBehind.xft.xml"/>
<Import file = "Templates/WebForms/NestedMasterPage.xft.xml"/>
+ <Import file = "Templates/WebForms/WebContentForm-CodeBehind.xft.xml"/>
<Import file = "Templates/WebForms/WebContentForm.xft.xml"/>
+ <Import file = "Templates/WebForms/WebControl-CodeBehind.xft.xml"/>
<Import file = "Templates/WebForms/WebControl-Empty.xft.xml"/>
<Import file = "Templates/WebForms/WebForm-CodeBehind.xft.xml"/>
- <Import file = "Templates/WebForms/NestedMasterPage-CodeBehind.xft.xml"/>
- <Import file = "Templates/WebForms/WebControl-CodeBehind.xft.xml"/>
<Import file = "Templates/WebForms/WebForm-Empty.xft.xml"/>
<Import file = "Templates/WebForms/WebHandler-CodeBehind.xft.xml"/>
- <Import file = "Templates/WebForms/WebService-Empty.xft.xml"/>
- <Import file = "Templates/WebForms/WebService-CodeBehind.xft.xml"/>
<Import file = "Templates/WebForms/WebHandler-Empty.xft.xml"/>
- <Import file = "Templates/WebForms/WebContentForm-CodeBehind.xft.xml"/>
+ <Import file = "Templates/WebForms/WebService-CodeBehind.xft.xml"/>
+ <Import file = "Templates/WebForms/WebService-Empty.xft.xml"/>
<Import file = "Templates/Mvc/Controller.xft.xml"/>
- <Import file = "Templates/Mvc/ViewPage.xft.xml"/>
- <Import file = "Templates/Mvc/ViewContentPage.xft.xml"/>
+ <Import file = "Templates/Mvc/LayoutPage.xft.xml" />
+ <Import file = "Templates/Mvc/PartialViewPageRazor.xft.xml" />
<Import file = "Templates/Mvc/UserControl.xft.xml"/>
+ <Import file = "Templates/Mvc/ViewContentPage.xft.xml"/>
<Import file = "Templates/Mvc/ViewMasterPage.xft.xml" />
- <Import file = "Templates/Mvc/GlobalAsax.xft.xml"/>
- <Import file = "Templates/Mvc/WebConfigApp.xft.xml"/>
- <Import file = "Templates/Mvc/WebConfigViews.xft.xml"/>
- <Import file = "Templates/Mvc/LayoutPage.xft.xml" />
+ <Import file = "Templates/Mvc/ViewPage.xft.xml"/>
<Import file = "Templates/Mvc/ViewPageRazor.xft.xml" />
- <Import file = "Templates/Mvc/PartialViewPageRazor.xft.xml" />
+ <Import file = "Templates/Mvc/WebConfigViews.xft.xml"/>
- <Import file = "Templates/Projects/EmptyMvcProject.xpt.xml" />
<Import file = "Templates/Projects/EmptyProject.xpt.xml" />
<Import file = "Templates/Projects/MvcProject.xpt.xml" />
- <Import file = "Templates/Projects/MvcProjectWithUnitTest.xpt.xml" />
- <Import file = "Templates/Projects/MvcRazorProject.xpt.xml" />
- <Import file = "Templates/Projects/MvcRazorProjectWithUnitTest.xpt.xml"/>
- <Import file = "Templates/Projects/WebApplication.xpt.xml"/>
+ <Import file = "Templates/Projects/WebFormsProject.xpt.xml"/>
+
+ <Import file = "Templates/Projects/Files/Default.aspx"/>
+ <Import file = "Templates/Projects/Files/Default.aspx.cs"/>
+ <Import file = "Templates/Projects/Files/Default.aspx.designer.cs"/>
- <Import file = "Templates/MvcCommon/_Layout.cshtml"/>
- <Import file = "Templates/MvcCommon/_ViewStart.cshtml"/>
<Import file = "Templates/MvcCommon/Error.cshtml"/>
<Import file = "Templates/MvcCommon/HomeController.cs"/>
<Import file = "Templates/MvcCommon/HomeControllerTest.cs"/>
<Import file = "Templates/MvcCommon/Index.cshtml"/>
<Import file = "Templates/MvcCommon/ViewPageRazor.cshtml"/>
+ <Import file = "Templates/MvcCommon/_Layout.cshtml"/>
+ <Import file = "Templates/MvcCommon/_ViewStart.cshtml"/>
+ <Import file = "Templates/GlobalAsax.xft.xml"/>
+ <Import file = "Templates/PreprocessedRazorTemplate.xft.xml" />
+ <Import file = "Templates/RouteConfig.cs"/>
+ <Import file = "Templates/WebApiConfig.cs"/>
<Import file = "Templates/WebConfig-Application.xft.xml"/>
<Import file = "Templates/WebConfig-SubDir.xft.xml"/>
- <Import file = "Templates/PreprocessedRazorTemplate.xft.xml" />
-
+ <Import file = "CodeTemplates/CSharp/AddController/ControllerWithEmptyReadAndWriteActions.tt" />
+ <Import file = "CodeTemplates/CSharp/AddController/Empty.tt" />
<Import file = "CodeTemplates/CSharp/AddView/Aspx/Empty.tt" />
<Import file = "CodeTemplates/CSharp/AddView/Razor/Empty.tt" />
- <Import file = "CodeTemplates/CSharp/AddController/Empty.tt" />
- <Import file = "CodeTemplates/CSharp/AddController/ControllerWithEmptyReadAndWriteActions.tt" />
<Import file = "Razor/Razor-templates.xml" />
</Runtime>
@@ -83,20 +81,12 @@
</ExtensionPoint>
<Extension path = "/MonoDevelop/Ide/ProjectTemplates">
- <ProjectTemplate id = "AspNet-EmptyMvcProject"
- file = "Templates/Projects/EmptyMvcProject.xpt.xml" />
- <ProjectTemplate id = "AspNet-EmptyProject"
+ <ProjectTemplate id = "MonoDevelop.AspNet.EmptyProject"
file = "Templates/Projects/EmptyProject.xpt.xml" />
- <ProjectTemplate id = "AspNet-MvcProject"
+ <ProjectTemplate id = "MonoDevelop.AspNet.MvcProject"
file = "Templates/Projects/MvcProject.xpt.xml" />
- <ProjectTemplate id = "AspNet-MvcProjectWithUnitTest"
- file = "Templates/Projects/MvcProjectWithUnitTest.xpt.xml" />
- <ProjectTemplate id = "AspNet-MvcRazorProject"
- file = "Templates/Projects/MvcRazorProject.xpt.xml" />
- <ProjectTemplate id = "AspNet-MvcRazorProjectWithUnitTest"
- file = "Templates/Projects/MvcRazorProjectWithUnitTest.xpt.xml"/>
- <ProjectTemplate id = "AspNet-WebApplication"
- file = "Templates/Projects/WebApplication.xpt.xml"/>
+ <ProjectTemplate id = "MonoDevelop.AspNet.WebApplication"
+ file = "Templates/Projects/WebFormsProject.xpt.xml"/>
</Extension>
<Extension path = "/MonoDevelop/Ide/FileTemplates">
@@ -130,10 +120,8 @@
<FileTemplate id = "NestedMasterPage-CodeBehind"
file = "Templates/WebForms/NestedMasterPage-CodeBehind.xft.xml" />
- <FileTemplate id = "GlobalAsax-Empty"
- file = "Templates/WebForms/GlobalAsax-Empty.xft.xml" />
- <FileTemplate id = "GlobalAsax-CodeBehind"
- file = "Templates/WebForms/GlobalAsax-CodeBehind.xft.xml" />
+ <FileTemplate id = "GlobalAsax"
+ file = "Templates/GlobalAsax.xft.xml" />
<FileTemplate id = "WebConfig-Application"
file = "Templates/WebConfig-Application.xft.xml" />
@@ -155,10 +143,6 @@
file = "Templates/Mvc/UserControl.xft.xml"/>
<FileTemplate id = "AspMvcViewMasterPage"
file = "Templates/Mvc/ViewMasterPage.xft.xml" />
- <FileTemplate id = "AspMvcGlobalAsax"
- file = "Templates/Mvc/GlobalAsax.xft.xml" />
- <FileTemplate id = "AspMvcWebConfigApp"
- file = "Templates/Mvc/WebConfigApp.xft.xml" />
<FileTemplate id = "AspMvcWebConfigViews"
file = "Templates/Mvc/WebConfigViews.xft.xml" />
<FileTemplate id = "AspMvcViewPageRazor"
@@ -185,32 +169,28 @@
extensions = "*.htm,*.html"/>
</Extension>
- <Extension path = "/MonoDevelop/ProjectModel/ProjectBindings">
- <ProjectBinding id = "AspNetApp" class = "MonoDevelop.AspNet.Projects.AspNetAppProjectBinding" />
- </Extension>
-
- <Extension path = "/MonoDevelop/ProjectModel/MSBuildItemTypes">
- <DotNetProjectSubtype
+ <Extension path = "/MonoDevelop/ProjectModel/ProjectModelExtensions">
+ <ProjectFlavor
guid="{603C0E0B-DB56-11DC-BE95-000D561079B0}"
- type="MonoDevelop.AspNet.Projects.AspMvc1Project"
- useXBuild="true" />
- <DotNetProjectSubtype
+ type="MonoDevelop.AspNet.Projects.AspMvc1ProjectFlavor"
+ alias="AspNetMvc1" />
+ <ProjectFlavor
guid="{F85E285D-A4E0-4152-9332-AB1D724D3325}"
- type="MonoDevelop.AspNet.Projects.AspMvc2Project"
- useXBuild="true" />
- <DotNetProjectSubtype
+ type="MonoDevelop.AspNet.Projects.AspMvc2ProjectFlavor"
+ alias="AspNetMvc2" />
+ <ProjectFlavor
guid="{E53F8FEA-EAE0-44A6-8774-FFD645390401}"
- type="MonoDevelop.AspNet.Projects.AspMvc3Project"
- useXBuild="true" />
- <DotNetProjectSubtype
+ type="MonoDevelop.AspNet.Projects.AspMvc3ProjectFlavor"
+ alias="AspNetMvc3" />
+ <ProjectFlavor
guid="{E3E379DF-F4C6-4180-9B81-6769533ABE47}"
- type="MonoDevelop.AspNet.Projects.AspMvc4Project"
- useXBuild="true" />
- <DotNetProjectSubtype
- id="MonoDevelop.AspNet.Projects.AspNetAppProject"
+ type="MonoDevelop.AspNet.Projects.AspMvc4ProjectFlavor"
+ alias="AspNetMvc4" />
+ <ProjectFlavor
+ id="MonoDevelop.AspNet.Projects.AspNetAppProjectFlavor"
guid="{349C5851-65DF-11DA-9384-00065B846F21}"
- type="MonoDevelop.AspNet.Projects.AspNetAppProject"
- useXBuild="true" />
+ type="MonoDevelop.AspNet.Projects.AspNetAppProjectFlavor"
+ alias="AspNetApp" />
</Extension>
<Extension path = "/MonoDevelop/TypeSystem/Parser">
@@ -224,7 +204,7 @@
</Extension>
<Extension path = "/MonoDevelop/ProjectModel/Gui/ItemOptionPanels/Run">
- <Condition id="ItemType" value="MonoDevelop.AspNet.Projects.AspNetAppProject">
+ <Condition id="FlavorType" value="MonoDevelop.AspNet.Projects.AspNetAppProjectFlavor">
<Section id = "XspOptions"
_label = "XSP Web Server"
class = "MonoDevelop.AspNet.Execution.XspOptionsPanel"/>
@@ -269,11 +249,9 @@
</Extension>
<Extension path = "/MonoDevelop/Ide/ContextMenu/ProjectPad/Add">
- <Condition id="ItemType" value="MonoDevelop.AspNet.Projects.AspNetAppProject">
- <ItemSet id = "AspNetDirectories" _label = "ASP.NET Directory" insertafter = "MonoDevelop.Ide.Commands.ProjectCommands.NewFolder" autohide = "true">
- <CommandItem id = "MonoDevelop.AspNet.Commands.AspNetCommands.AddAspNetDirectory" />
- </ItemSet>
- </Condition>
+ <ItemSet id = "AspNetDirectories" _label = "ASP.NET Directory" insertafter = "MonoDevelop.Ide.Commands.ProjectCommands.NewFolder" autohide = "true">
+ <CommandItem id = "MonoDevelop.AspNet.Commands.AspNetCommands.AddAspNetDirectory" />
+ </ItemSet>
</Extension>
<Extension path = "/MonoDevelop/Ide/ContextMenu/ProjectPad/Add">
@@ -316,9 +294,6 @@
<MimeType id="application/javascript" _description="Javascript source code" icon="md-html-file-icon" isText="true">
<File pattern="*.js" />
</MimeType>
- <MimeType id="text/css" _description="CSS document" icon="md-html-file-icon" isText="true">
- <File pattern="*.css" />
- </MimeType>
<MimeType id="text/x-less" _description="LESS, CSS document" icon="md-html-file-icon" isText="true">
<File pattern="*.less" />
</MimeType>
diff --git a/main/src/addins/AspNet/Razor/Dom/RazorCodeBlock.cs b/main/src/addins/AspNet/Razor/Dom/RazorCodeBlock.cs
index c6928acbfd..b8386bec5d 100644
--- a/main/src/addins/AspNet/Razor/Dom/RazorCodeBlock.cs
+++ b/main/src/addins/AspNet/Razor/Dom/RazorCodeBlock.cs
@@ -25,14 +25,14 @@
// THE SOFTWARE.
using MonoDevelop.Xml.Parser;
-using ICSharpCode.NRefactory;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.Razor.Dom
{
public class RazorCodeBlock : RazorCodeFragment
{
- public RazorCodeBlock (TextLocation start) : base (start)
+ public RazorCodeBlock (DocumentLocation start) : base (start)
{
}
diff --git a/main/src/addins/AspNet/Razor/Dom/RazorCodeFragment.cs b/main/src/addins/AspNet/Razor/Dom/RazorCodeFragment.cs
index 19ff98708b..6387e36ba3 100644
--- a/main/src/addins/AspNet/Razor/Dom/RazorCodeFragment.cs
+++ b/main/src/addins/AspNet/Razor/Dom/RazorCodeFragment.cs
@@ -25,16 +25,16 @@
// THE SOFTWARE.
using System.Linq;
-using ICSharpCode.NRefactory;
-using Mono.TextEditor;
using MonoDevelop.Ide;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Util;
namespace MonoDevelop.AspNet.Razor.Dom
{
public abstract class RazorCodeFragment : XContainer
{
- protected RazorCodeFragment (TextLocation start) : base (start)
+ protected RazorCodeFragment (DocumentLocation start) : base (start)
{
}
@@ -44,34 +44,32 @@ namespace MonoDevelop.AspNet.Razor.Dom
public string Name { get; set; }
- public TextLocation? FirstBracket { get; set; }
+ public DocumentLocation? FirstBracket { get; set; }
- public TextDocument Document {
+ public ITextDocument Document {
get {
- if (IdeApp.Workbench.ActiveDocument != null && IdeApp.Workbench.ActiveDocument.Editor != null)
- return IdeApp.Workbench.ActiveDocument.Editor.Document;
- return null;
+ return RazorWorkbenchService.ActiveDocument;
}
}
- public bool IsEndingBracket (TextLocation bracketLocation)
+ public bool IsEndingBracket (DocumentLocation bracketLocation)
{
// If document isn't entirely loaded
- if (Document == null || Document.Lines.Count () < Region.BeginLine)
+ if (Document == null || Document.LineCount < Region.BeginLine)
return false;
if (!FirstBracket.HasValue && !FindFirstBracket (bracketLocation))
return false;
- int firstBracketOffset = Document.GetOffset (FirstBracket.Value);
- int currentBracketOffset = Document.GetOffset (bracketLocation);
+ int firstBracketOffset = Document.LocationToOffset (FirstBracket.Value);
+ int currentBracketOffset = Document.LocationToOffset (bracketLocation);
- return Document.GetMatchingBracketOffset (firstBracketOffset) == currentBracketOffset;
+ return SimpleBracketMatcher.GetMatchingBracketOffset (Document, firstBracketOffset) == currentBracketOffset;
}
- public bool FindFirstBracket (TextLocation currentLocation)
+ public bool FindFirstBracket (DocumentLocation currentLocation)
{
- if (Document.Lines.Count () < Region.BeginLine)
+ if (Document == null || Document.LineCount < Region.BeginLine)
return false;
int firstBracketPosition = Document.GetTextBetween (Region.Begin, currentLocation).IndexOf ('{');
diff --git a/main/src/addins/AspNet/Razor/Dom/RazorComment.cs b/main/src/addins/AspNet/Razor/Dom/RazorComment.cs
index 1cb572a9d6..a9a11503bb 100644
--- a/main/src/addins/AspNet/Razor/Dom/RazorComment.cs
+++ b/main/src/addins/AspNet/Razor/Dom/RazorComment.cs
@@ -24,19 +24,18 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.Razor.Dom
{
public class RazorComment : XNode
{
- public RazorComment (DomRegion region) : base (region)
+ public RazorComment (DocumentRegion region) : base (region)
{
}
- public RazorComment (TextLocation start) : base (start)
+ public RazorComment (DocumentLocation start) : base (start)
{
}
diff --git a/main/src/addins/AspNet/Razor/Dom/RazorDirective.cs b/main/src/addins/AspNet/Razor/Dom/RazorDirective.cs
index 7b1755d9a9..3eaebabb49 100644
--- a/main/src/addins/AspNet/Razor/Dom/RazorDirective.cs
+++ b/main/src/addins/AspNet/Razor/Dom/RazorDirective.cs
@@ -24,14 +24,14 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using ICSharpCode.NRefactory;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.Razor.Dom
{
public class RazorDirective : RazorCodeFragment
{
- public RazorDirective (TextLocation start) : base (start)
+ public RazorDirective (DocumentLocation start) : base (start)
{
}
diff --git a/main/src/addins/AspNet/Razor/Dom/RazorExplicitExpression.cs b/main/src/addins/AspNet/Razor/Dom/RazorExplicitExpression.cs
index 15cbfc6637..80dcdae361 100644
--- a/main/src/addins/AspNet/Razor/Dom/RazorExplicitExpression.cs
+++ b/main/src/addins/AspNet/Razor/Dom/RazorExplicitExpression.cs
@@ -24,19 +24,18 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.Razor.Dom
{
public class RazorExplicitExpression : RazorExpression
{
- public RazorExplicitExpression (DomRegion region) : base (region)
+ public RazorExplicitExpression (DocumentRegion region) : base (region)
{
}
- public RazorExplicitExpression (TextLocation start) : base (start)
+ public RazorExplicitExpression (DocumentLocation start) : base (start)
{
}
diff --git a/main/src/addins/AspNet/Razor/Dom/RazorExpression.cs b/main/src/addins/AspNet/Razor/Dom/RazorExpression.cs
index ef1ef4af95..81119710db 100644
--- a/main/src/addins/AspNet/Razor/Dom/RazorExpression.cs
+++ b/main/src/addins/AspNet/Razor/Dom/RazorExpression.cs
@@ -24,19 +24,18 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.Razor.Dom
{
public abstract class RazorExpression : XNode
{
- protected RazorExpression (DomRegion region) : base (region)
+ protected RazorExpression (DocumentRegion region) : base (region)
{
}
- protected RazorExpression (TextLocation start) : base (start)
+ protected RazorExpression (DocumentLocation start) : base (start)
{
}
diff --git a/main/src/addins/AspNet/Razor/Dom/RazorImplicitExpression.cs b/main/src/addins/AspNet/Razor/Dom/RazorImplicitExpression.cs
index f87a500d74..9536a8b592 100644
--- a/main/src/addins/AspNet/Razor/Dom/RazorImplicitExpression.cs
+++ b/main/src/addins/AspNet/Razor/Dom/RazorImplicitExpression.cs
@@ -24,19 +24,18 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.Razor.Dom
{
public class RazorImplicitExpression : RazorExpression
{
- public RazorImplicitExpression (DomRegion region) : base (region)
+ public RazorImplicitExpression (DocumentRegion region) : base (region)
{
}
- public RazorImplicitExpression (TextLocation start) : base (start)
+ public RazorImplicitExpression (DocumentLocation start) : base (start)
{
}
diff --git a/main/src/addins/AspNet/Razor/Dom/RazorStatement.cs b/main/src/addins/AspNet/Razor/Dom/RazorStatement.cs
index 7af1bbfccf..83fa1d7444 100644
--- a/main/src/addins/AspNet/Razor/Dom/RazorStatement.cs
+++ b/main/src/addins/AspNet/Razor/Dom/RazorStatement.cs
@@ -24,15 +24,15 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using ICSharpCode.NRefactory;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.Razor.Dom
{
public class RazorStatement : RazorCodeFragment
{
- public RazorStatement (TextLocation start) : base (start)
+ public RazorStatement (DocumentLocation start) : base (start)
{
}
diff --git a/main/src/addins/AspNet/Razor/Dom/RazorWorkbenchService.cs b/main/src/addins/AspNet/Razor/Dom/RazorWorkbenchService.cs
new file mode 100644
index 0000000000..97280a15fd
--- /dev/null
+++ b/main/src/addins/AspNet/Razor/Dom/RazorWorkbenchService.cs
@@ -0,0 +1,48 @@
+//
+// RazorWorkbenchService.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using MonoDevelop.Ide;
+using MonoDevelop.Ide.Editor;
+
+namespace MonoDevelop.AspNet.Razor.Dom
+{
+ internal static class RazorWorkbenchService
+ {
+ public static ITextDocument ActiveDocument {
+ get {
+ return GetActiveDocument ();
+ }
+ }
+
+ internal static Func<ITextDocument> GetActiveDocument = () => {
+ if (IdeApp.Workbench.ActiveDocument != null && IdeApp.Workbench.ActiveDocument.Editor != null)
+ return IdeApp.Workbench.ActiveDocument.Editor;
+ return null;
+ };
+ }
+}
+
diff --git a/main/src/addins/AspNet/Razor/Generator/RazorTemplatePreprocessor.cs b/main/src/addins/AspNet/Razor/Generator/RazorTemplatePreprocessor.cs
index 6d7a73c175..28136349c2 100644
--- a/main/src/addins/AspNet/Razor/Generator/RazorTemplatePreprocessor.cs
+++ b/main/src/addins/AspNet/Razor/Generator/RazorTemplatePreprocessor.cs
@@ -28,6 +28,8 @@ using System;
using System.CodeDom.Compiler;
using System.Linq;
using MonoDevelop.Core;
+using MonoDevelop.TextTemplating;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CustomTools;
using MonoDevelop.Projects;
@@ -35,18 +37,18 @@ namespace MonoDevelop.AspNet.Razor.Generator
{
class RazorTemplatePreprocessor : ISingleFileCustomTool
{
- public IAsyncOperation Generate (IProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
+ public Task Generate (ProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
{
- return new ThreadAsyncOperation (delegate {
+ return Task.Run (delegate {
try {
GenerateInternal (monitor, file, result);
} catch (Exception ex) {
result.UnhandledException = ex;
}
- }, result);
+ });
}
- static void GenerateInternal (IProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
+ static void GenerateInternal (ProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
{
if (file.Project.SupportedLanguages.All (l => l != "C#")) {
const string msg = "Razor templates are only supported in C# projects";
diff --git a/main/src/addins/AspNet/Razor/IRazorCompletionBuilder.cs b/main/src/addins/AspNet/Razor/IRazorCompletionBuilder.cs
index 242408e9bc..2beed8acba 100644
--- a/main/src/addins/AspNet/Razor/IRazorCompletionBuilder.cs
+++ b/main/src/addins/AspNet/Razor/IRazorCompletionBuilder.cs
@@ -25,45 +25,48 @@
// THE SOFTWARE.
using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Ide.Gui;
-using ICSharpCode.NRefactory.TypeSystem;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.Razor
{
// Based on MonoDevelop.AspNet.Gui.ILanguageCompletionBuilder
- public interface IRazorCompletionBuilder
+ interface IRazorCompletionBuilder
{
bool SupportsLanguage (string language);
- ICompletionWidget CreateCompletionWidget (Document document, UnderlyingDocumentInfo docInfo);
- ICompletionDataList HandlePopupCompletion (Document realDocument, UnderlyingDocumentInfo docInfo);
- ICompletionDataList HandleCompletion (Document realDocument, CodeCompletionContext completionContext,
- UnderlyingDocumentInfo docInfo, char currentChar, ref int triggerWordLength);
- ParameterDataProvider HandleParameterCompletion (Document realDocument, CodeCompletionContext completionContext,
+ ICompletionWidget CreateCompletionWidget (TextEditor editor, DocumentContext context, UnderlyingDocumentInfo docInfo);
+ Task<ICompletionDataList> HandlePopupCompletion (TextEditor editor, DocumentContext context, UnderlyingDocumentInfo docInfo);
+ Task<ICompletionDataList> HandleCompletion (TextEditor editor, DocumentContext context, CodeCompletionContext completionContext,
+ UnderlyingDocumentInfo docInfo, char currentChar, CancellationToken token);
+ Task<MonoDevelop.Ide.CodeCompletion.ParameterHintingResult> HandleParameterCompletion (TextEditor editor, DocumentContext context, CodeCompletionContext completionContext,
UnderlyingDocumentInfo docInfo, char completionChar);
- bool GetParameterCompletionCommandOffset (Document realDocument, UnderlyingDocumentInfo docInfo, out int cpos);
- int GetCurrentParameterIndex (Document realDocument, UnderlyingDocumentInfo docInfo, int startOffset);
+ // bool GetParameterCompletionCommandOffset (TextEditor editor, DocumentContext context, UnderlyingDocumentInfo docInfo, out int cpos);
+ Task<int> GetCurrentParameterIndex (TextEditor editor, DocumentContext context, UnderlyingDocumentInfo docInfo, int startOffset);
}
public class UnderlyingDocument : Document
{
internal ParsedDocument HiddenParsedDocument;
- internal ICompilation HiddenCompilation;
public override ParsedDocument ParsedDocument {
get { return HiddenParsedDocument; }
}
- public override ICompilation Compilation {
- get { return HiddenCompilation; }
- }
-
public UnderlyingDocument (IWorkbenchWindow window)
: base (window)
{
}
+
+ internal Microsoft.CodeAnalysis.Document HiddenAnalysisDocument;
+
+ public override Microsoft.CodeAnalysis.Document AnalysisDocument {
+ get { return HiddenAnalysisDocument; }
+ }
}
public class UnderlyingDocumentInfo
@@ -73,7 +76,7 @@ namespace MonoDevelop.AspNet.Razor
public UnderlyingDocument UnderlyingDocument { get; set; }
}
- public static class RazorCompletionBuilderService
+ static class RazorCompletionBuilderService
{
static List<IRazorCompletionBuilder> builder = new List<IRazorCompletionBuilder> ();
diff --git a/main/src/addins/AspNet/Razor/OpenRazorDocument.cs b/main/src/addins/AspNet/Razor/OpenRazorDocument.cs
new file mode 100644
index 0000000000..39613f9b67
--- /dev/null
+++ b/main/src/addins/AspNet/Razor/OpenRazorDocument.cs
@@ -0,0 +1,94 @@
+//
+// OpenRazorDocument.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Threading;
+using System.Web.Razor;
+using MonoDevelop.Ide.Editor;
+
+namespace MonoDevelop.AspNet.Razor
+{
+ class OpenRazorDocument : IDisposable
+ {
+ ITextDocument document;
+ ChangeInfo lastChange;
+
+ public OpenRazorDocument (ITextDocument document)
+ {
+ this.document = document;
+ document.TextChanging += OnTextReplacing;
+ }
+
+ public void Dispose ()
+ {
+ document.TextChanging -= OnTextReplacing;
+ if (ParseComplete != null) {
+ ParseComplete.Dispose ();
+ ParseComplete = null;
+ }
+ if (EditorParser != null) {
+ EditorParser.Dispose ();
+ EditorParser = null;
+ }
+ }
+
+ public ITextDocument Document {
+ get { return document; }
+ }
+
+ public string FileName {
+ get { return document.FileName; }
+ }
+
+ public MonoDevelop.Web.Razor.EditorParserFixed.RazorEditorParser EditorParser { get; set; }
+ public DocumentParseCompleteEventArgs CapturedArgs { get; set; }
+ public AutoResetEvent ParseComplete { get; set; }
+
+ public ChangeInfo LastTextChange {
+ get { return lastChange; }
+ }
+
+ public void ClearLastTextChange ()
+ {
+ lock (document)
+ lastChange = null;
+ }
+
+ void OnTextReplacing (object sender, MonoDevelop.Core.Text.TextChangeEventArgs e)
+ {
+ lock (document) {
+ if (lastChange == null)
+ lastChange = new ChangeInfo (e.Offset, new System.Web.Razor.Text.SeekableTextReader ((sender as MonoDevelop.Ide.Editor.ITextDocument).Text));
+ if (e.ChangeDelta > 0) {
+ lastChange.Length += e.InsertionLength;
+ } else {
+ lastChange.Length -= e.RemovalLength;
+ }
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/AspNet/Razor/Parser/RazorOutlineNode.cs b/main/src/addins/AspNet/Razor/Parser/RazorOutlineNode.cs
index 2028da9383..7d58ea9a93 100644
--- a/main/src/addins/AspNet/Razor/Parser/RazorOutlineNode.cs
+++ b/main/src/addins/AspNet/Razor/Parser/RazorOutlineNode.cs
@@ -25,16 +25,16 @@
// THE SOFTWARE.
using System.Web.Razor.Parser.SyntaxTree;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Xml.Dom;
using MonoDevelop.AspNet.WebForms.Dom;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.Razor.Parser
{
class RazorOutlineNode
{
public string Name { get; set; }
- public DomRegion Location { get; set; }
+ public DocumentRegion Location { get; set; }
public RazorOutlineNode (XElement el)
{
diff --git a/main/src/addins/AspNet/Razor/Parser/StateEngineService.cs b/main/src/addins/AspNet/Razor/Parser/StateEngineService.cs
index 92f0e8f315..be9a3a58a2 100644
--- a/main/src/addins/AspNet/Razor/Parser/StateEngineService.cs
+++ b/main/src/addins/AspNet/Razor/Parser/StateEngineService.cs
@@ -25,10 +25,10 @@
// THE SOFTWARE.
using System.Diagnostics;
-using ICSharpCode.NRefactory;
using MonoDevelop.Core;
using MonoDevelop.Xml.Dom;
using MonoDevelop.Xml.Parser;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.Razor.Parser
{
@@ -39,7 +39,7 @@ namespace MonoDevelop.AspNet.Razor.Parser
EndCodeFragment<T> (context, context.LocationMinus (minus));
}
- public static void EndCodeFragment<T> (IXmlParserContext context, TextLocation loc) where T : XNode
+ public static void EndCodeFragment<T> (IXmlParserContext context, DocumentLocation loc) where T : XNode
{
var top = context.Nodes.Pop ();
var node = top as T;
diff --git a/main/src/addins/AspNet/Razor/RazorCSharpEditorExtension.cs b/main/src/addins/AspNet/Razor/RazorCSharpEditorExtension.cs
index 99bde2109f..1fc3994145 100644
--- a/main/src/addins/AspNet/Razor/RazorCSharpEditorExtension.cs
+++ b/main/src/addins/AspNet/Razor/RazorCSharpEditorExtension.cs
@@ -1,641 +1,674 @@
-//
-// RazorCSharpEditorExtension.cs
-//
-// Author:
-// Piotr Dowgiallo <sparekd@gmail.com>
-//
-// Copyright (c) 2012 Piotr Dowgiallo
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text.RegularExpressions;
-using System.Web.Razor.Generator;
-using System.Web.Razor.Parser.SyntaxTree;
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.Completion;
-using ICSharpCode.NRefactory.TypeSystem;
-using Mono.TextEditor;
-using MonoDevelop.Core;
-using MonoDevelop.Ide.CodeCompletion;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.TypeSystem;
-using MonoDevelop.Xml.Dom;
-using MonoDevelop.Xml.Parser;
-using MonoDevelop.AspNet.Html;
-using MonoDevelop.AspNet.Razor.Dom;
-using MonoDevelop.AspNet.Razor.Parser;
-
-namespace MonoDevelop.AspNet.Razor
-{
- public class RazorCSharpEditorExtension : BaseHtmlEditorExtension
- {
- protected RazorCSharpParsedDocument razorDocument;
- protected UnderlyingDocumentInfo hiddenInfo;
- IRazorCompletionBuilder completionBuilder;
-
- bool isInCSharpContext;
- static readonly Regex DocTypeRegex = new Regex (@"(?:PUBLIC|public)\s+""(?<fpi>[^""]*)""\s+""(?<uri>[^""]*)""");
-
- ICompletionWidget defaultCompletionWidget;
- Document defaultDocument;
-
- RazorSyntaxMode syntaxMode;
-
- UnderlyingDocument HiddenDoc {
- get { return hiddenInfo.UnderlyingDocument; }
- }
-
- RazorPageInfo PageInfo {
- get { return razorDocument.PageInfo; }
- }
-
- protected override XmlRootState CreateRootState ()
- {
- return new RazorRootState ();
- }
-
- public override string CompletionLanguage {
- get {
- return "Razor";
- }
- }
- public override void Initialize ()
- {
- base.Initialize ();
-
- defaultCompletionWidget = CompletionWidget;
- defaultDocument = Document;
- completionBuilder = RazorCompletionBuilderService.GetBuilder ("C#");
-
- defaultDocument.Editor.Document.TextReplacing += UnderlyingDocument_TextReplacing;
- defaultDocument.Editor.Caret.PositionChanged += delegate
- {
- OnCompletionContextChanged (CompletionWidget, EventArgs.Empty);
- };
- syntaxMode = new RazorSyntaxMode (Document);
- defaultDocument.Editor.Document.SyntaxMode = syntaxMode;
-
- }
-
- public override void Dispose ()
- {
- if (syntaxMode != null) {
- defaultDocument.Editor.Document.SyntaxMode = null;
- syntaxMode.Dispose ();
- syntaxMode = null;
- }
- defaultDocument.Editor.Document.TextReplacing -= UnderlyingDocument_TextReplacing;
- base.Dispose ();
- }
-
- // Handles text modifications in hidden document
- void UnderlyingDocument_TextReplacing (object sender, DocumentChangeEventArgs e)
- {
- if (razorDocument == null)
- return;
-
- EnsureUnderlyingDocumentSet ();
- int off = CalculateCaretPosition (e.Offset);
-
- if (e.RemovalLength > 0) {
- int removalLength = e.RemovalLength;
- if (off + removalLength > HiddenDoc.Editor.Length)
- removalLength = HiddenDoc.Editor.Length - off;
- HiddenDoc.Editor.Remove (new TextSegment (off, removalLength));
- }
- if (e.InsertionLength > 0) {
- if (isInCSharpContext)
- HiddenDoc.Editor.Insert (off, e.InsertedText.Text);
- else // Insert spaces to correctly calculate offsets until next reparse
- HiddenDoc.Editor.Insert (off, new String (' ', e.InsertionLength));
- }
- if (codeFragment != null)
- codeFragment.EndOffset += (e.InsertionLength - e.RemovalLength);
- }
-
- protected override void OnParsedDocumentUpdated ()
- {
- base.OnParsedDocumentUpdated ();
- try {
- razorDocument = CU as RazorCSharpParsedDocument;
- if (razorDocument == null || razorDocument.PageInfo.CSharpParsedFile == null)
- return;
-
- CreateDocType ();
-
- // Don't update C# code in hiddenInfo when:
- // 1) We are in a RazorState, and the completion window is visible,
- // it'll freeze (or disappear if we call OnCompletionContextChanged).
- // 2) We're in the middle of writing a Razor expression - if we're in an incorrect state,
- // the generated code migh be behind what we've been already written.
-
- var state = Tracker.Engine.CurrentState;
- if (state is RazorState && CompletionWindowManager.IsVisible ||
- (!updateNeeded && (state is RazorSpeculativeState || state is RazorExpressionState)))
- UpdateHiddenDocument (false);
- else {
- UpdateHiddenDocument ();
- updateNeeded = false;
- }
- } catch (Exception e) {
- LoggingService.LogError ("Error while updating razor completion.", e);
- }
- }
-
- void CreateDocType ()
- {
- DocType = new XDocType (TextLocation.Empty);
- var matches = DocTypeRegex.Match (razorDocument.PageInfo.DocType);
- if (matches.Success) {
- DocType.PublicFpi = matches.Groups ["fpi"].Value;
- DocType.Uri = matches.Groups ["uri"].Value;
- }
- }
-
- void EnsureUnderlyingDocumentSet ()
- {
- if (hiddenInfo == null)
- UpdateHiddenDocument ();
- }
-
- void UpdateHiddenDocument (bool updateSourceCode = true)
- {
- if (!updateSourceCode && hiddenInfo != null) {
- hiddenInfo.UnderlyingDocument.HiddenParsedDocument = razorDocument.PageInfo.CSharpParsedFile;
- hiddenInfo.UnderlyingDocument.HiddenCompilation = razorDocument.PageInfo.Compilation;
- return;
- }
-
- hiddenInfo = new UnderlyingDocumentInfo ();
-
- var viewContent = new HiddenTextEditorViewContent ();
- viewContent.Project = Document.Project;
- viewContent.ContentName = "Generated.cs"; // Use a name with .cs extension to get csharp ambience
- viewContent.Text = razorDocument.PageInfo.CSharpCode;
-
- var workbenchWindow = new HiddenWorkbenchWindow ();
- workbenchWindow.ViewContent = viewContent;
- hiddenInfo.UnderlyingDocument = new UnderlyingDocument (workbenchWindow) {
- HiddenParsedDocument = razorDocument.PageInfo.CSharpParsedFile,
- HiddenCompilation = razorDocument.PageInfo.Compilation
- };
-
- // completion window needs this
- hiddenInfo.UnderlyingDocument.Editor.Parent = Editor.Parent;
-
- currentMappings = razorDocument.PageInfo.GeneratorResults.DesignTimeLineMappings;
- codeFragment = null;
- }
-
- #region Code completion
-
- XObject prevNode;
- bool updateNeeded;
-
- public override bool KeyPress (Gdk.Key key, char keyChar, Gdk.ModifierType modifier)
- {
- Tracker.UpdateEngine ();
- if (razorDocument == null)
- return NonCSharpCompletion (key, keyChar, modifier);
-
- var n = Tracker.Engine.Nodes.Peek ();
- if (prevNode is RazorExpression && !(n is RazorExpression))
- updateNeeded = true;
- prevNode = n;
-
- var state = Tracker.Engine.CurrentState;
- int off = document.Editor.Caret.Offset;
-
- char previousChar = off > 0 ? document.Editor.GetCharAt (off - 1) : ' ';
- char beforePrevious = off > 1 ? document.Editor.GetCharAt (off - 2) : ' ';
-
- // Determine completion context here, before calling base method to set the context correctly
-
- // Rule out Razor comments, html, transition sign (@) and e-mail addresses
- if (state is RazorCommentState || (previousChar != '@' && !(state is RazorState)) || keyChar == '@'
- || (previousChar == '@' && Char.IsLetterOrDigit (beforePrevious)))
- return NonCSharpCompletion (key, keyChar, modifier);
-
- // Determine if we are inside generics
- if (previousChar == '<') {
- var codeState = state as RazorCodeFragmentState;
- if (codeState == null || !codeState.IsInsideGenerics)
- return NonCSharpCompletion (key, keyChar, modifier);
- }
- // Determine whether we begin an html tag or generics
- else if (keyChar == '<' && (n is XElement || !Char.IsLetterOrDigit (previousChar)))
- return NonCSharpCompletion (key, keyChar, modifier);
- // Determine whether we are inside html text or in code
- else if (previousChar != '@' && n is XElement && !(state is RazorSpeculativeState) && !(state is RazorExpressionState))
- return NonCSharpCompletion (key, keyChar, modifier);
-
- // We're in C# context
- InitializeCodeCompletion ();
- SwitchToHidden ();
-
- bool result;
- try {
- result = base.KeyPress (key, keyChar, modifier);
- if (/*EnableParameterInsight &&*/ (keyChar == ',' || keyChar == ')') && CanRunParameterCompletionCommand ())
- base.RunParameterCompletionCommand ();
- } finally {
- SwitchToReal ();
- }
-
- return result;
- }
-
- protected void SwitchToHidden ()
- {
- isInCSharpContext = true;
- document = HiddenDoc;
- CompletionWidget = completionBuilder.CreateCompletionWidget (defaultDocument, hiddenInfo);
- }
-
- protected void SwitchToReal ()
- {
- isInCSharpContext = false;
- document = defaultDocument;
- CompletionWidget = defaultCompletionWidget;
- }
-
- bool NonCSharpCompletion (Gdk.Key key, char keyChar, Gdk.ModifierType modifier)
- {
- isInCSharpContext = false;
- return base.KeyPress (key, keyChar, modifier);
- }
-
- protected void InitializeCodeCompletion ()
- {
- EnsureUnderlyingDocumentSet ();
- hiddenInfo.OriginalCaretPosition = defaultDocument.Editor.Caret.Offset;
- hiddenInfo.CaretPosition = CalculateCaretPosition ();
- HiddenDoc.Editor.Caret.Offset = hiddenInfo.CaretPosition;
- }
-
- class CodeFragment
- {
- public int StartOffset { get; set; }
- public int StartRealOffset { get; set; }
- public int EndOffset { get; set; }
-
- public CodeFragment ()
- {}
-
- public CodeFragment (int startOff, int startRealOff, int endOffset)
- {
- StartOffset = startOff;
- StartRealOffset = startRealOff;
- EndOffset = endOffset;
- }
- }
-
- int GetDefaultPosition ()
- {
- var type = razorDocument.PageInfo.CSharpParsedFile.TopLevelTypeDefinitions.FirstOrDefault ();
- if (type == null) {
- return -1;
- }
- var method = type.Members.FirstOrDefault (m => m.Name == "Execute");
- if (method == null) {
- return -1;
- }
- return HiddenDoc.Editor.LocationToOffset (method.BodyRegion.Begin) + 1;
- }
-
- IDictionary<int, GeneratedCodeMapping> currentMappings;
- CodeFragment codeFragment;
-
- int CalculateCaretPosition ()
- {
- return CalculateCaretPosition (defaultDocument.Editor.Caret.Offset);
- }
-
- int CalculateCaretPosition (int currentOffset)
- {
- if (codeFragment != null) {
- int diff = currentOffset - codeFragment.StartRealOffset;
- int off = codeFragment.StartOffset + diff;
- if (diff >= 0 && off <= codeFragment.EndOffset)
- return off;
- }
-
- KeyValuePair<int, GeneratedCodeMapping> map;
-
- var defaultPosition = GetDefaultPosition ();
- if (defaultPosition < 0) {
- defaultPosition = 0;
- }
-
- // If it's first line of code, create a default temp mapping, and use it until next reparse
- if (currentMappings.Count == 0) {
- string newLine = "\r\n#line 0 \r\n ";
- HiddenDoc.Editor.Insert (defaultPosition, newLine);
- map = new KeyValuePair<int, GeneratedCodeMapping> (0, new GeneratedCodeMapping (currentOffset - 1, 0, 0, 0, 0));
- currentMappings.Add (map);
- } else {
- var result = currentMappings.Where (m => m.Value.StartOffset <= currentOffset);
- if (!result.Any ())
- return defaultPosition;
- map = result.Last ();
- }
-
- string pattern = "#line " + map.Key + " ";
- int pos = HiddenDoc.Editor.Document.IndexOf (pattern, 0, HiddenDoc.Editor.Document.TextLength, StringComparison.Ordinal);
- if (pos == -1 || !map.Value.StartOffset.HasValue)
- return defaultPosition;
-
- int startRealOff = map.Value.StartOffset.Value;
- int offDifference = currentOffset - (startRealOff + map.Value.CodeLength);
- var line = HiddenDoc.Editor.Document.GetLineByOffset (pos);
- int endHiddenOff = line.NextLine.Offset + map.Value.StartGeneratedColumn + map.Value.CodeLength;
-
- int hiddenOff;
-
- // If off is inside the map
- if (offDifference <= 0) {
- int delta = currentOffset - startRealOff;
- hiddenOff = line.NextLine.Offset + map.Value.StartGeneratedColumn + delta - 1;
- codeFragment = new CodeFragment (hiddenOff, currentOffset, endHiddenOff);
- } else {
- // It's a new code fragment - create a temp mapping, and use it until next reparse
- int key = currentMappings.Last ().Key + 1;
- string newLine = "\r\n#line " + key + " \r\n ";
- int newOff = endHiddenOff;
-
- if (HiddenDoc.Editor.GetCharAt (newOff) == '\n')
- newOff++;
-
- // We start a new mapping right after the preceding one, but need to include the difference
- // between mapping's start and the current offset
- HiddenDoc.Editor.Insert (newOff, newLine);
- HiddenDoc.Editor.Insert (newOff + newLine.Length, new String (' ', offDifference) + " \r\n");
-
- var newMap = new KeyValuePair<int, GeneratedCodeMapping> (key, new GeneratedCodeMapping (
- startRealOff + map.Value.CodeLength, 0, 0, 0, offDifference));
- currentMappings.Add (newMap);
- hiddenOff = newOff + newLine.Length + offDifference;
- codeFragment = new CodeFragment (newOff + newLine.Length, newMap.Value.StartOffset.Value,
- newOff + newLine.Length + offDifference);
- }
-
- return hiddenOff;
- }
-
- public override ICompletionDataList HandleCodeCompletion (CodeCompletionContext completionContext,
- char completionChar, ref int triggerWordLength)
- {
-// if (!EnableCodeCompletion)
-// return null;
-
- char previousChar = defaultDocument.Editor.Caret.Offset > 1 ? defaultDocument.Editor.GetCharAt (
- defaultDocument.Editor.Caret.Offset - 2) : ' ';
-
- // Don't show completion window when directive's name is being typed
- var directive = Tracker.Engine.Nodes.Peek () as RazorDirective;
- if (directive != null && !directive.FirstBracket.HasValue)
- return null;
-
- if (hiddenInfo != null && isInCSharpContext) {
- var list = (CompletionDataList) completionBuilder.HandleCompletion (defaultDocument, completionContext,
- hiddenInfo, completionChar, ref triggerWordLength);
-
- if (list != null) {
- //filter out the C# templates, many of them are not valid
- int oldCount = list.Count;
- list = FilterCSharpTemplates (list);
- int templates = list.Count - oldCount;
-
- if (previousChar == '@') {
- RazorCompletion.AddAllRazorSymbols (list, razorDocument.PageInfo.HostKind);
- }
- if (templates > 0) {
- AddFilteredRazorTemplates (list, previousChar == '@', true);
- }
- }
- return list;
- }
-
- return base.HandleCodeCompletion (completionContext, completionChar, ref triggerWordLength);
- }
-
- //recreating the list is over 2x as fast as using remove operations, saves typically 10ms
- static CompletionDataList FilterCSharpTemplates (CompletionDataList list)
- {
- var newList = new CompletionDataList () {
- AutoCompleteEmptyMatch = list.AutoCompleteEmptyMatch,
- AutoCompleteUniqueMatch = list.AutoCompleteUniqueMatch,
- AutoSelect = list.AutoSelect,
- CloseOnSquareBrackets = list.CloseOnSquareBrackets,
- CompletionSelectionMode = list.CompletionSelectionMode,
- DefaultCompletionString = list.DefaultCompletionString,
- IsSorted = list.IsSorted,
- };
- foreach (var l in list) {
- var c = l as CompletionData;
- if (c == null || (c.Icon.Name != "md-template" && c.Icon.Name != "md-template-surroundwith"))
- newList.Add (c);
- }
- return newList;
- }
-
- static void AddFilteredRazorTemplates (CompletionDataList list, bool atTemplates, bool stripLeadingAt)
- {
- //add the razor templates then filter them based on whether we follow an @ char, so we don't have
- //lots of duplicates
- int count = list.Count;
- MonoDevelop.Ide.CodeTemplates.CodeTemplateService.AddCompletionDataForMime ("text/x-cshtml", list);
- for (int i = count; i < list.Count; i++) {
- var d = (CompletionData) list[i];
- if (atTemplates) {
- if (d.CompletionText[0] != '@') {
- list.RemoveAt (i);
- } else if (stripLeadingAt) {
- //avoid inserting a double-@, which would not expand correctly
- d.CompletionText = d.CompletionText.Substring (1);
- }
- } else if (d.CompletionText[0] == '@') {
- list.RemoveAt (i);
- }
- }
- }
-
- protected override ICompletionDataList HandleCodeCompletion (CodeCompletionContext completionContext,
- bool forced, ref int triggerWordLength)
- {
-// if (!EnableCodeCompletion)
-// return null;
-
- var currentLocation = new TextLocation (completionContext.TriggerLine, completionContext.TriggerLineOffset);
- char currentChar = completionContext.TriggerOffset < 1 ? ' ' : Buffer.GetCharAt (completionContext.TriggerOffset - 1);
-
- var codeState = Tracker.Engine.CurrentState as RazorCodeFragmentState;
- if (currentChar == '<' && codeState != null) {
- if (!codeState.IsInsideParentheses && !codeState.IsInsideGenerics) {
- var list = new CompletionDataList ();
- GetElementCompletions (list);
- return list;
- }
- } else if (currentChar == '>' && Tracker.Engine.CurrentState is RazorCodeFragmentState)
- return ClosingTagCompletion (EditableBuffer, currentLocation);
-
- return base.HandleCodeCompletion (completionContext, forced, ref triggerWordLength);
- }
-
- //we override to ensure we get parent element name even if there's a razor node in between
- protected override void GetElementCompletions (CompletionDataList list)
- {
- var el = Tracker.Engine.Nodes.OfType<XElement> ().FirstOrDefault ();
- var parentName = el == null ? new XName () : el.Name;
-
- AddHtmlTagCompletionData (list, Schema, parentName);
- AddMiscBeginTags (list);
-
- //FIXME: don't show this after any elements
- if (DocType == null)
- list.Add ("!DOCTYPE", "md-literal", MonoDevelop.Core.GettextCatalog.GetString ("Document type"));
- }
-
- public override ICompletionDataList CodeCompletionCommand (CodeCompletionContext completionContext)
- {
- if (hiddenInfo != null && (isInCSharpContext || Tracker.Engine.CurrentState is RazorState)
- && !(Tracker.Engine.Nodes.Peek () is XElement)) {
- InitializeCodeCompletion ();
- return completionBuilder.HandlePopupCompletion (defaultDocument, hiddenInfo);
- }
-
- return base.CodeCompletionCommand (completionContext);
- }
-
- public override bool GetParameterCompletionCommandOffset (out int cpos)
- {
- if (hiddenInfo != null && isInCSharpContext)
- return completionBuilder.GetParameterCompletionCommandOffset (defaultDocument, hiddenInfo, out cpos);
-
- return base.GetParameterCompletionCommandOffset (out cpos);
- }
-
- public override int GetCurrentParameterIndex (int startOffset)
- {
- if (hiddenInfo != null && isInCSharpContext) {
- return completionBuilder.GetCurrentParameterIndex (defaultDocument, hiddenInfo, startOffset);
- }
-
- return base.GetCurrentParameterIndex (startOffset);
- }
-
- public override ParameterDataProvider HandleParameterCompletion (CodeCompletionContext completionContext,
- char completionChar)
- {
- if (hiddenInfo != null && isInCSharpContext) {
- return completionBuilder.HandleParameterCompletion (defaultDocument, completionContext,
- hiddenInfo, completionChar);
- }
-
- return base.HandleParameterCompletion (completionContext, completionChar);
- }
-
- #endregion
-
- #region Document outline
-
- protected override void RefillOutlineStore (ParsedDocument doc, Gtk.TreeStore store)
- {
- var htmlRoot = razorDocument.PageInfo.HtmlRoot;
- var razorRoot = razorDocument.PageInfo.RazorRoot;
- var blocks = new List<Block> ();
- GetBlocks (razorRoot, blocks);
- BuildTreeChildren (store, Gtk.TreeIter.Zero, htmlRoot, blocks);
- }
-
- void GetBlocks (Block root, IList<Block> blocks)
- {
- foreach (var block in root.Children.Where (n => n.IsBlock).Select (n => n as Block)) {
- if (block.Type != BlockType.Markup)
- blocks.Add (block);
- if (block.Type != BlockType.Helper)
- GetBlocks (block, blocks);
- }
- }
-
- protected override void InitializeOutlineColumns (MonoDevelop.Ide.Gui.Components.PadTreeView outlineTree)
- {
- outlineTree.TextRenderer.Xpad = 0;
- outlineTree.TextRenderer.Ypad = 0;
- outlineTree.AppendColumn ("OutlineNode", outlineTree.TextRenderer, new Gtk.TreeCellDataFunc (OutlineTreeDataFunc));
- }
-
- protected override void OutlineSelectionChanged (object selection)
- {
- SelectNode ((RazorOutlineNode)selection);
- }
-
- void BuildTreeChildren (Gtk.TreeStore store, Gtk.TreeIter parent, XContainer p, IList<Block> blocks)
- {
- foreach (XNode node in p.Nodes) {
- var el = node as XElement;
- if (el == null) {
- var startLoc = node.Region.Begin;
- var endLoc = node.Region.End;
- var doc = defaultDocument.Editor.Document;
-
- var blocksBetween = blocks.Where (n => n.Start.AbsoluteIndex >= doc.GetOffset (startLoc)
- && n.Start.AbsoluteIndex <= doc.GetOffset (endLoc));
-
- foreach (var block in blocksBetween) {
- var outlineNode = new RazorOutlineNode (block) {
- Location = new DomRegion (doc.OffsetToLocation (block.Start.AbsoluteIndex),
- doc.OffsetToLocation (block.Start.AbsoluteIndex + block.Length))
- };
- if (!parent.Equals (Gtk.TreeIter.Zero))
- store.AppendValues (parent, outlineNode);
- else
- store.AppendValues (outlineNode);
- }
- continue;
- }
-
- Gtk.TreeIter childIter;
- if (!parent.Equals (Gtk.TreeIter.Zero))
- childIter = store.AppendValues (parent, new RazorOutlineNode(el));
- else
- childIter = store.AppendValues (new RazorOutlineNode(el));
-
- BuildTreeChildren (store, childIter, el, blocks);
- }
- }
-
- void OutlineTreeDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
- {
- Gtk.CellRendererText txtRenderer = (Gtk.CellRendererText)cell;
- RazorOutlineNode n = (RazorOutlineNode)model.GetValue (iter, 0);
- txtRenderer.Text = n.Name;
- }
-
- void SelectNode (RazorOutlineNode n)
- {
- EditorSelect (n.Location);
- }
-
- #endregion
- }
-}
+//
+// RazorCSharpEditorExtension.cs
+//
+// Author:
+// Piotr Dowgiallo <sparekd@gmail.com>
+//
+// Copyright (c) 2012 Piotr Dowgiallo
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Web.Razor.Generator;
+using System.Web.Razor.Parser.SyntaxTree;
+using Mono.TextEditor;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Xml.Dom;
+using MonoDevelop.Xml.Parser;
+using MonoDevelop.AspNet.Html;
+using MonoDevelop.AspNet.Razor.Dom;
+using MonoDevelop.AspNet.Razor.Parser;
+using MonoDevelop.Ide.Editor.Extension;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace MonoDevelop.AspNet.Razor
+{
+ public class RazorCSharpEditorExtension : BaseHtmlEditorExtension
+ {
+ protected RazorCSharpParsedDocument razorDocument;
+ internal UnderlyingDocumentInfo hiddenInfo;
+ IRazorCompletionBuilder completionBuilder;
+
+ bool isInCSharpContext;
+ static readonly Regex DocTypeRegex = new Regex (@"(?:PUBLIC|public)\s+""(?<fpi>[^""]*)""\s+""(?<uri>[^""]*)""");
+
+ ICompletionWidget defaultCompletionWidget;
+ MonoDevelop.Ide.Editor.TextEditor defaultEditor;
+ DocumentContext defaultDocumentContext;
+
+ RazorSyntaxMode syntaxMode;
+
+ UnderlyingDocument HiddenDoc {
+ get { return hiddenInfo.UnderlyingDocument; }
+ }
+
+ RazorPageInfo PageInfo {
+ get { return razorDocument.PageInfo; }
+ }
+
+ protected override XmlRootState CreateRootState ()
+ {
+ return new RazorRootState ();
+ }
+
+ public override string CompletionLanguage {
+ get {
+ return "Razor";
+ }
+ }
+
+ public RazorCSharpEditorExtension ()
+ {
+ }
+
+ /// <summary>
+ /// Used by unit tests.
+ /// </summary>
+ internal RazorCSharpEditorExtension (MonoDevelop.Ide.Gui.Document doc, RazorCSharpParsedDocument parsedDoc, bool cSharpContext)
+ {
+ razorDocument = parsedDoc;
+ Initialize (doc.Editor, doc);
+ if (cSharpContext) {
+ InitializeCodeCompletion ();
+ SwitchToHidden ();
+ }
+ }
+
+ protected override void Initialize ()
+ {
+ base.Initialize ();
+
+ defaultCompletionWidget = CompletionWidget;
+ defaultDocumentContext = DocumentContext;
+ defaultEditor = Editor;
+ completionBuilder = RazorCompletionBuilderService.GetBuilder ("C#");
+
+ defaultEditor.TextChanging += UnderlyingDocument_TextReplacing;
+ syntaxMode = new RazorSyntaxMode (DocumentContext);
+ var textEditorData = DocumentContext.GetContent<TextEditorData> ();
+ if (textEditorData != null)
+ textEditorData.Document.SyntaxMode = syntaxMode;
+ }
+
+ public override void Dispose ()
+ {
+ if (syntaxMode != null) {
+ var textEditorData = DocumentContext.GetContent<TextEditorData> ();
+ if (textEditorData != null)
+ textEditorData.Document.SyntaxMode = null;
+ syntaxMode.Dispose ();
+ syntaxMode = null;
+ }
+ defaultEditor.TextChanging -= UnderlyingDocument_TextReplacing;
+ base.Dispose ();
+ }
+
+ // Handles text modifications in hidden document
+ void UnderlyingDocument_TextReplacing (object sender, TextChangeEventArgs e)
+ {
+ if (razorDocument == null)
+ return;
+
+ EnsureUnderlyingDocumentSet ();
+ int off = CalculateCaretPosition (e.Offset);
+
+ if (e.RemovalLength > 0) {
+ int removalLength = e.RemovalLength;
+ if (off + removalLength > HiddenDoc.Editor.Length)
+ removalLength = HiddenDoc.Editor.Length - off;
+ HiddenDoc.Editor.RemoveText (off, removalLength);
+ }
+ if (e.InsertionLength > 0) {
+ if (isInCSharpContext) {
+ HiddenDoc.Editor.InsertText (off, e.InsertedText.Text);
+ HiddenDoc.HiddenAnalysisDocument = HiddenDoc.HiddenAnalysisDocument.WithText (Microsoft.CodeAnalysis.Text.SourceText.From (HiddenDoc.Editor.Text));
+ } else // Insert spaces to correctly calculate offsets until next reparse
+ HiddenDoc.Editor.InsertText (off, new String (' ', e.InsertionLength));
+ }
+ if (codeFragment != null)
+ codeFragment.EndOffset += (e.InsertionLength - e.RemovalLength);
+ }
+
+ protected override void OnParsedDocumentUpdated ()
+ {
+ base.OnParsedDocumentUpdated ();
+ try {
+ razorDocument = CU as RazorCSharpParsedDocument;
+ if (razorDocument == null || razorDocument.PageInfo.CSharpSyntaxTree == null)
+ return;
+
+ CreateDocType ();
+
+ // Don't update C# code in hiddenInfo when:
+ // 1) We are in a RazorState, and the completion window is visible,
+ // it'll freeze (or disappear if we call OnCompletionContextChanged).
+ // 2) We're in the middle of writing a Razor expression - if we're in an incorrect state,
+ // the generated code migh be behind what we've been already written.
+
+ var state = Tracker.Engine.CurrentState;
+ if (state is RazorState && CompletionWindowManager.IsVisible ||
+ (!updateNeeded && (state is RazorSpeculativeState || state is RazorExpressionState)))
+ UpdateHiddenDocument (false);
+ else {
+ UpdateHiddenDocument ();
+ updateNeeded = false;
+ }
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while updating razor completion.", e);
+ }
+ }
+
+ void CreateDocType ()
+ {
+ DocType = new XDocType (MonoDevelop.Ide.Editor.DocumentLocation.Empty);
+ var matches = DocTypeRegex.Match (razorDocument.PageInfo.DocType);
+ if (matches.Success) {
+ DocType.PublicFpi = matches.Groups ["fpi"].Value;
+ DocType.Uri = matches.Groups ["uri"].Value;
+ }
+ }
+
+ void EnsureUnderlyingDocumentSet ()
+ {
+ if (hiddenInfo == null)
+ UpdateHiddenDocument ();
+ }
+
+ void UpdateHiddenDocument (bool updateSourceCode = true)
+ {
+ if (!updateSourceCode && hiddenInfo != null) {
+ hiddenInfo.UnderlyingDocument.HiddenParsedDocument = razorDocument.PageInfo.ParsedDocument;
+ return;
+ } else if (updateSourceCode && hiddenInfo != null) {
+ hiddenInfo.UnderlyingDocument.Editor.Text = razorDocument.PageInfo.CSharpCode;
+ hiddenInfo.UnderlyingDocument.HiddenParsedDocument = razorDocument.PageInfo.ParsedDocument;
+ hiddenInfo.UnderlyingDocument.HiddenAnalysisDocument = razorDocument.PageInfo.AnalysisDocument;
+ currentMappings = razorDocument.PageInfo.GeneratorResults.DesignTimeLineMappings;
+ codeFragment = null;
+ return;
+ }
+
+ hiddenInfo = new UnderlyingDocumentInfo ();
+
+ var viewContent = new HiddenTextEditorViewContent ();
+ viewContent.Project = DocumentContext.Project;
+ viewContent.ContentName = "Generated.cs"; // Use a name with .cs extension to get csharp ambience
+ viewContent.Text = razorDocument.PageInfo.CSharpCode;
+
+ var workbenchWindow = new HiddenWorkbenchWindow ();
+ workbenchWindow.ViewContent = viewContent;
+ hiddenInfo.UnderlyingDocument = new UnderlyingDocument (workbenchWindow) {
+ HiddenParsedDocument = razorDocument.PageInfo.ParsedDocument,
+ HiddenAnalysisDocument = razorDocument.PageInfo.AnalysisDocument
+ };
+
+ // completion window needs this
+ Gtk.Widget editor = hiddenInfo.UnderlyingDocument.Editor;
+ editor.Parent = ((Gtk.Widget)Editor).Parent;
+
+ currentMappings = razorDocument.PageInfo.GeneratorResults.DesignTimeLineMappings;
+ codeFragment = null;
+ }
+
+ #region Code completion
+
+ XObject prevNode;
+ bool updateNeeded;
+
+ public override bool KeyPress (KeyDescriptor descriptor)
+ {
+ Tracker.UpdateEngine ();
+ if (razorDocument == null)
+ return NonCSharpCompletion (descriptor);
+
+ var n = Tracker.Engine.Nodes.Peek ();
+ if (prevNode is RazorExpression && !(n is RazorExpression))
+ updateNeeded = true;
+ prevNode = n;
+ var state = Tracker.Engine.CurrentState;
+ int off = Editor.CaretOffset;
+
+ char previousChar = off > 0 ? Editor.GetCharAt (off - 1) : ' ';
+ char beforePrevious = off > 1 ? Editor.GetCharAt (off - 2) : ' ';
+
+ // Determine completion context here, before calling base method to set the context correctly
+
+ // Rule out Razor comments, html, transition sign (@) and e-mail addresses
+ if (state is RazorCommentState || (previousChar != '@' && !(state is RazorState)) || descriptor.KeyChar == '@'
+ || (previousChar == '@' && Char.IsLetterOrDigit (beforePrevious)))
+ return NonCSharpCompletion (descriptor);
+
+ // Determine if we are inside generics
+ if (previousChar == '<') {
+ var codeState = state as RazorCodeFragmentState;
+ if (codeState == null || !codeState.IsInsideGenerics)
+ return NonCSharpCompletion (descriptor);
+ }
+ // Determine whether we begin an html tag or generics
+ else if (descriptor.KeyChar == '<' && (n is XElement || !Char.IsLetterOrDigit (previousChar)))
+ return NonCSharpCompletion (descriptor);
+ // Determine whether we are inside html text or in code
+ else if (previousChar != '@' && n is XElement && !(state is RazorSpeculativeState) && !(state is RazorExpressionState))
+ return NonCSharpCompletion (descriptor);
+
+ // We're in C# context
+ InitializeCodeCompletion ();
+ SwitchToHidden ();
+
+ bool result;
+ try {
+ result = base.KeyPress (descriptor);
+ if (/*EnableParameterInsight &&*/ (descriptor.KeyChar == ',' || descriptor.KeyChar == ')') && CanRunParameterCompletionCommand ())
+ base.RunParameterCompletionCommand ();
+ } finally {
+ SwitchToReal ();
+ }
+
+ return result;
+ }
+
+ protected void SwitchToHidden ()
+ {
+ isInCSharpContext = true;
+ DocumentContext = HiddenDoc;
+ Editor = HiddenDoc.Editor;
+ CompletionWidget = completionBuilder.CreateCompletionWidget (defaultEditor, defaultDocumentContext, hiddenInfo);
+ }
+
+ protected void SwitchToReal ()
+ {
+ isInCSharpContext = false;
+ DocumentContext = defaultDocumentContext;
+ Editor = defaultEditor;
+ CompletionWidget = defaultCompletionWidget;
+ }
+
+ bool NonCSharpCompletion (KeyDescriptor descriptor)
+ {
+ isInCSharpContext = false;
+ return base.KeyPress (descriptor);
+ }
+
+ protected void InitializeCodeCompletion ()
+ {
+ EnsureUnderlyingDocumentSet ();
+ hiddenInfo.OriginalCaretPosition = defaultEditor.CaretOffset;
+ hiddenInfo.CaretPosition = CalculateCaretPosition ();
+ HiddenDoc.Editor.CaretOffset = hiddenInfo.CaretPosition;
+ }
+
+ class CodeFragment
+ {
+ public int StartOffset { get; set; }
+ public int StartRealOffset { get; set; }
+ public int EndOffset { get; set; }
+
+ public CodeFragment ()
+ {}
+
+ public CodeFragment (int startOff, int startRealOff, int endOffset)
+ {
+ StartOffset = startOff;
+ StartRealOffset = startRealOff;
+ EndOffset = endOffset;
+ }
+ }
+
+ int GetDefaultPosition ()
+ {
+ var root = razorDocument.PageInfo.CSharpSyntaxTree?.GetRoot ();
+ if (root == null)
+ return -1;
+
+ var type = root.DescendantNodes ().OfType<TypeDeclarationSyntax> ().FirstOrDefault ();
+ if (type == null) {
+ return -1;
+ }
+ var method = type.DescendantNodes ()
+ .OfType <MethodDeclarationSyntax> ()
+ .FirstOrDefault (m => m.Identifier.ValueText == "Execute");
+ if (method == null) {
+ return -1;
+ }
+ var location = method.Body.GetLocation ();
+ return location.SourceSpan.Start + 1;
+ }
+
+ IDictionary<int, GeneratedCodeMapping> currentMappings;
+ CodeFragment codeFragment;
+
+ int CalculateCaretPosition ()
+ {
+ return CalculateCaretPosition (defaultEditor.CaretOffset);
+ }
+
+ int CalculateCaretPosition (int currentOffset)
+ {
+ if (codeFragment != null) {
+ int diff = currentOffset - codeFragment.StartRealOffset;
+ int off = codeFragment.StartOffset + diff;
+ if (diff >= 0 && off <= codeFragment.EndOffset)
+ return off;
+ }
+
+ KeyValuePair<int, GeneratedCodeMapping> map;
+
+ var defaultPosition = GetDefaultPosition ();
+ if (defaultPosition < 0) {
+ defaultPosition = 0;
+ }
+
+ // If it's first line of code, create a default temp mapping, and use it until next reparse
+ if (currentMappings.Count == 0) {
+ string newLine = "\r\n#line 0 \r\n ";
+ HiddenDoc.Editor.InsertText (defaultPosition, newLine);
+ map = new KeyValuePair<int, GeneratedCodeMapping> (0, new GeneratedCodeMapping (currentOffset - 1, 0, 0, 0, 0));
+ currentMappings.Add (map);
+ } else {
+ var result = currentMappings.Where (m => m.Value.StartOffset <= currentOffset);
+ if (!result.Any ())
+ return defaultPosition;
+ map = result.Last ();
+ }
+
+ string pattern = "#line " + map.Key + " ";
+ int pos = HiddenDoc.Editor.Text.IndexOf (pattern, 0, HiddenDoc.Editor.Length, StringComparison.Ordinal);
+ if (pos == -1 || !map.Value.StartOffset.HasValue)
+ return defaultPosition;
+
+ int startRealOff = map.Value.StartOffset.Value;
+ int offDifference = currentOffset - (startRealOff + map.Value.CodeLength);
+ var line = HiddenDoc.Editor.GetLineByOffset (pos);
+ int endHiddenOff = line.NextLine.Offset + map.Value.StartGeneratedColumn + map.Value.CodeLength;
+
+ int hiddenOff;
+
+ // If off is inside the map
+ if (offDifference <= 0) {
+ int delta = currentOffset - startRealOff;
+ hiddenOff = line.NextLine.Offset + map.Value.StartGeneratedColumn + delta - 1;
+ codeFragment = new CodeFragment (hiddenOff, currentOffset, endHiddenOff);
+ } else {
+ // It's a new code fragment - create a temp mapping, and use it until next reparse
+ int key = currentMappings.Last ().Key + 1;
+ string newLine = "\r\n#line " + key + " \r\n ";
+ int newOff = endHiddenOff;
+
+ if (HiddenDoc.Editor.GetCharAt (newOff) == '\n')
+ newOff++;
+
+ // We start a new mapping right after the preceding one, but need to include the difference
+ // between mapping's start and the current offset
+ HiddenDoc.Editor.InsertText (newOff, newLine);
+ HiddenDoc.Editor.InsertText (newOff + newLine.Length, new String (' ', offDifference) + " \r\n");
+
+ var newMap = new KeyValuePair<int, GeneratedCodeMapping> (key, new GeneratedCodeMapping (
+ startRealOff + map.Value.CodeLength, 0, 0, 0, offDifference));
+ currentMappings.Add (newMap);
+ hiddenOff = newOff + newLine.Length + offDifference;
+ codeFragment = new CodeFragment (newOff + newLine.Length, newMap.Value.StartOffset.Value,
+ newOff + newLine.Length + offDifference);
+ }
+
+ return hiddenOff;
+ }
+
+ public override async System.Threading.Tasks.Task<ICompletionDataList> HandleCodeCompletionAsync (CodeCompletionContext completionContext, char completionChar, System.Threading.CancellationToken token)
+ {
+ char previousChar = defaultEditor.CaretOffset > 1 ? defaultEditor.GetCharAt (
+ defaultEditor.CaretOffset - 2) : ' ';
+
+ // Don't show completion window when directive's name is being typed
+ var directive = Tracker.Engine.Nodes.Peek () as RazorDirective;
+ if (directive != null && !directive.FirstBracket.HasValue)
+ return null;
+
+ if (hiddenInfo != null && isInCSharpContext) {
+ var list = (CompletionDataList) await completionBuilder.HandleCompletion (defaultEditor, defaultDocumentContext, completionContext,
+ hiddenInfo, completionChar, token);
+
+ if (list != null) {
+ //filter out the C# templates, many of them are not valid
+ int oldCount = list.Count;
+ list = FilterCSharpTemplates (list);
+ int templates = list.Count - oldCount;
+
+ if (previousChar == '@') {
+ RazorCompletion.AddAllRazorSymbols (list, razorDocument.PageInfo.HostKind);
+ }
+ if (templates > 0) {
+ AddFilteredRazorTemplates (list, previousChar == '@', true);
+ }
+ }
+ return list;
+ }
+
+ return await base.HandleCodeCompletionAsync (completionContext, completionChar, token);
+ }
+
+ //recreating the list is over 2x as fast as using remove operations, saves typically 10ms
+ static CompletionDataList FilterCSharpTemplates (CompletionDataList list)
+ {
+ var newList = new CompletionDataList () {
+ AutoCompleteEmptyMatch = list.AutoCompleteEmptyMatch,
+ AutoCompleteUniqueMatch = list.AutoCompleteUniqueMatch,
+ AutoSelect = list.AutoSelect,
+ CloseOnSquareBrackets = list.CloseOnSquareBrackets,
+ CompletionSelectionMode = list.CompletionSelectionMode,
+ DefaultCompletionString = list.DefaultCompletionString,
+ IsSorted = list.IsSorted,
+ TriggerWordLength = list.TriggerWordLength
+ };
+ foreach (var l in list) {
+ var c = l as CompletionData;
+ if (c == null || (c.Icon.Name != "md-template" && c.Icon.Name != "md-template-surroundwith"))
+ newList.Add (c);
+ }
+ return newList;
+ }
+
+ static void AddFilteredRazorTemplates (CompletionDataList list, bool atTemplates, bool stripLeadingAt)
+ {
+ //add the razor templates then filter them based on whether we follow an @ char, so we don't have
+ //lots of duplicates
+ int count = list.Count;
+ MonoDevelop.Ide.CodeTemplates.CodeTemplateService.AddCompletionDataForMime ("text/x-cshtml", list);
+ for (int i = count; i < list.Count; i++) {
+ var d = (CompletionData) list[i];
+ if (atTemplates) {
+ if (d.CompletionText[0] != '@') {
+ list.RemoveAt (i);
+ } else if (stripLeadingAt) {
+ //avoid inserting a double-@, which would not expand correctly
+ d.CompletionText = d.CompletionText.Substring (1);
+ }
+ } else if (d.CompletionText[0] == '@') {
+ list.RemoveAt (i);
+ }
+ }
+ }
+
+ protected override async Task<ICompletionDataList> HandleCodeCompletion (
+ CodeCompletionContext completionContext, bool forced, CancellationToken token)
+ {
+ var currentLocation = new MonoDevelop.Ide.Editor.DocumentLocation (completionContext.TriggerLine, completionContext.TriggerLineOffset);
+ char currentChar = completionContext.TriggerOffset < 1 ? ' ' : Editor.GetCharAt (completionContext.TriggerOffset - 1);
+
+ var codeState = Tracker.Engine.CurrentState as RazorCodeFragmentState;
+ if (currentChar == '<' && codeState != null) {
+ if (!codeState.IsInsideParentheses && !codeState.IsInsideGenerics) {
+ var list = await GetElementCompletions (token);
+ return list;
+ }
+ } else if (currentChar == '>' && Tracker.Engine.CurrentState is RazorCodeFragmentState)
+ return ClosingTagCompletion (Editor, currentLocation);
+
+ return await base.HandleCodeCompletion (completionContext, forced, token);
+ }
+
+ //we override to ensure we get parent element name even if there's a razor node in between
+ protected override async Task<CompletionDataList> GetElementCompletions (CancellationToken token)
+ {
+ var list = new CompletionDataList ();
+ var el = Tracker.Engine.Nodes.OfType<XElement> ().FirstOrDefault ();
+ var parentName = el == null ? new XName () : el.Name;
+
+ await AddHtmlTagCompletionData (list, Schema, parentName, token);
+ AddMiscBeginTags (list);
+
+ //FIXME: don't show this after any elements
+ if (DocType == null)
+ list.Add ("!DOCTYPE", "md-literal", MonoDevelop.Core.GettextCatalog.GetString ("Document type"));
+ return list;
+ }
+
+ public override Task<ICompletionDataList> CodeCompletionCommand (CodeCompletionContext completionContext)
+ {
+ if (hiddenInfo != null && (isInCSharpContext || Tracker.Engine.CurrentState is RazorState)
+ && !(Tracker.Engine.Nodes.Peek () is XElement)) {
+ InitializeCodeCompletion ();
+ return completionBuilder.HandlePopupCompletion (defaultEditor, defaultDocumentContext, hiddenInfo);
+ }
+
+ return base.CodeCompletionCommand (completionContext);
+ }
+ /*
+ public override bool GetParameterCompletionCommandOffset (out int cpos)
+ {
+ if (hiddenInfo != null && isInCSharpContext)
+ return completionBuilder.GetParameterCompletionCommandOffset (defaultEditor, defaultDocumentContext, hiddenInfo, out cpos);
+
+ return base.GetParameterCompletionCommandOffset (out cpos);
+ }*/
+ public override Task<int> GetCurrentParameterIndex (int startOffset, CancellationToken token)
+ {
+ if (hiddenInfo != null && isInCSharpContext) {
+ return completionBuilder.GetCurrentParameterIndex (defaultEditor, defaultDocumentContext, hiddenInfo, startOffset);
+ }
+
+ return base.GetCurrentParameterIndex (startOffset, token);
+ }
+
+ public override Task<MonoDevelop.Ide.CodeCompletion.ParameterHintingResult> HandleParameterCompletionAsync (
+ CodeCompletionContext completionContext, char completionChar, CancellationToken token)
+ {
+ if (hiddenInfo != null && isInCSharpContext) {
+ return completionBuilder.HandleParameterCompletion (defaultEditor, defaultDocumentContext, completionContext,
+ hiddenInfo, completionChar);
+ }
+
+ return base.HandleParameterCompletionAsync (completionContext, completionChar, token);
+ }
+
+ #endregion
+
+ #region Document outline
+
+ protected override void RefillOutlineStore (ParsedDocument doc, Gtk.TreeStore store)
+ {
+ var htmlRoot = razorDocument.PageInfo.HtmlRoot;
+ var razorRoot = razorDocument.PageInfo.RazorRoot;
+ var blocks = new List<Block> ();
+ GetBlocks (razorRoot, blocks);
+ BuildTreeChildren (store, Gtk.TreeIter.Zero, htmlRoot, blocks);
+ }
+
+ void GetBlocks (Block root, IList<Block> blocks)
+ {
+ foreach (var block in root.Children.Where (n => n.IsBlock).Select (n => n as Block)) {
+ if (block.Type != BlockType.Markup)
+ blocks.Add (block);
+ if (block.Type != BlockType.Helper)
+ GetBlocks (block, blocks);
+ }
+ }
+
+ protected override void InitializeOutlineColumns (MonoDevelop.Ide.Gui.Components.PadTreeView outlineTree)
+ {
+ outlineTree.TextRenderer.Xpad = 0;
+ outlineTree.TextRenderer.Ypad = 0;
+ outlineTree.AppendColumn ("OutlineNode", outlineTree.TextRenderer, new Gtk.TreeCellDataFunc (OutlineTreeDataFunc));
+ }
+
+ protected override void OutlineSelectionChanged (object selection)
+ {
+ SelectNode ((RazorOutlineNode)selection);
+ }
+
+ void BuildTreeChildren (Gtk.TreeStore store, Gtk.TreeIter parent, XContainer p, IList<Block> blocks)
+ {
+ foreach (XNode node in p.Nodes) {
+ var el = node as XElement;
+ if (el == null) {
+ var startLoc = node.Region.Begin;
+ var endLoc = node.Region.End;
+ var doc = defaultEditor;
+
+ var blocksBetween = blocks.Where (n => n.Start.AbsoluteIndex >= doc.LocationToOffset (startLoc.Line, startLoc.Column)
+ && n.Start.AbsoluteIndex <= doc.LocationToOffset (endLoc.Line, endLoc.Column));
+
+ foreach (var block in blocksBetween) {
+ var outlineNode = new RazorOutlineNode (block) {
+ Location = new MonoDevelop.Ide.Editor.DocumentRegion (doc.OffsetToLocation (block.Start.AbsoluteIndex),
+ doc.OffsetToLocation (block.Start.AbsoluteIndex + block.Length))
+ };
+ if (!parent.Equals (Gtk.TreeIter.Zero))
+ store.AppendValues (parent, outlineNode);
+ else
+ store.AppendValues (outlineNode);
+ }
+ continue;
+ }
+
+ Gtk.TreeIter childIter;
+ if (!parent.Equals (Gtk.TreeIter.Zero))
+ childIter = store.AppendValues (parent, new RazorOutlineNode(el));
+ else
+ childIter = store.AppendValues (new RazorOutlineNode(el));
+
+ BuildTreeChildren (store, childIter, el, blocks);
+ }
+ }
+
+ void OutlineTreeDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
+ {
+ Gtk.CellRendererText txtRenderer = (Gtk.CellRendererText)cell;
+ RazorOutlineNode n = (RazorOutlineNode)model.GetValue (iter, 0);
+ txtRenderer.Text = n.Name;
+ }
+
+ void SelectNode (RazorOutlineNode n)
+ {
+ EditorSelect (n.Location);
+ }
+
+ #endregion
+ }
+}
diff --git a/main/src/addins/AspNet/Razor/RazorCSharpFormatter.cs b/main/src/addins/AspNet/Razor/RazorCSharpFormatter.cs
index 560408db69..4baecea24f 100644
--- a/main/src/addins/AspNet/Razor/RazorCSharpFormatter.cs
+++ b/main/src/addins/AspNet/Razor/RazorCSharpFormatter.cs
@@ -1,53 +1,54 @@
-//
-// RazorCSharpCodeFormatter.cs
-//
-// Author:
-// Piotr Dowgiallo <sparekd@gmail.com>
-//
-// Copyright (c) 2012 Piotr Dowgiallo
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System.Collections.Generic;
-using MonoDevelop.Ide.CodeFormatting;
-using MonoDevelop.Projects.Policies;
-
-namespace MonoDevelop.AspNet.Razor
-{
- public class RazorCSharpFormatter : AbstractAdvancedFormatter
- {
- public override bool SupportsOnTheFlyFormatting { get { return true; } }
- public override bool SupportsCorrectingIndent { get { return true; } }
-
- public override void CorrectIndenting (PolicyContainer policyParent,
- IEnumerable<string> mimeTypeChain, Mono.TextEditor.TextEditorData data, int line)
- {
- }
-
- public override string FormatText (PolicyContainer policyParent,
- IEnumerable<string> mimeTypeChain, string input, int startOffset, int endOffset)
- {
- return null;
- }
-
- public override void OnTheFlyFormat (Ide.Gui.Document doc, int startOffset, int endOffset)
- {
- }
- }
-}
+//
+// RazorCSharpCodeFormatter.cs
+//
+// Author:
+// Piotr Dowgiallo <sparekd@gmail.com>
+//
+// Copyright (c) 2012 Piotr Dowgiallo
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Collections.Generic;
+using MonoDevelop.Ide.CodeFormatting;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Projects.Policies;
+
+namespace MonoDevelop.AspNet.Razor
+{
+ public class RazorCSharpFormatter : AbstractCodeFormatter
+ {
+ public override bool SupportsOnTheFlyFormatting { get { return true; } }
+ public override bool SupportsCorrectingIndent { get { return true; } }
+ public override bool SupportsPartialDocumentFormatting { get { return true; } }
+
+ protected override void CorrectIndentingImplementation (PolicyContainer policyParent, TextEditor editor, int line)
+ {
+ }
+
+ protected override Core.Text.ITextSource FormatImplementation (PolicyContainer policyParent, string mimeType, Core.Text.ITextSource input, int startOffset, int length)
+ {
+ return input.CreateSnapshot (startOffset, length);
+ }
+
+ protected override void OnTheFlyFormatImplementation (TextEditor editor, DocumentContext context, int startOffset, int length)
+ {
+ }
+
+ }
+}
diff --git a/main/src/addins/AspNet/Razor/RazorCSharpParsedDocument.cs b/main/src/addins/AspNet/Razor/RazorCSharpParsedDocument.cs
index 3cac236d41..28b287fed5 100644
--- a/main/src/addins/AspNet/Razor/RazorCSharpParsedDocument.cs
+++ b/main/src/addins/AspNet/Razor/RazorCSharpParsedDocument.cs
@@ -26,6 +26,7 @@
using System.Collections.Generic;
using MonoDevelop.Ide.TypeSystem;
+using System.Linq;
namespace MonoDevelop.AspNet.Razor
{
@@ -38,10 +39,15 @@ namespace MonoDevelop.AspNet.Razor
PageInfo = pageInfo;
Flags |= ParsedDocumentFlags.NonSerializable;
if (PageInfo.Errors != null)
- Add (PageInfo.Errors);
+ AddRange (PageInfo.Errors);
}
- public override IEnumerable<FoldingRegion> Foldings {
+ public override System.Threading.Tasks.Task<IReadOnlyList<FoldingRegion>> GetFoldingsAsync (System.Threading.CancellationToken cancellationToken)
+ {
+ return System.Threading.Tasks.Task.FromResult((IReadOnlyList<FoldingRegion>)Foldings.ToList ());
+ }
+
+ public IEnumerable<FoldingRegion> Foldings {
get {
if (PageInfo.FoldingRegions != null) {
foreach (var region in PageInfo.FoldingRegions) {
diff --git a/main/src/addins/AspNet/Razor/RazorCSharpParser.cs b/main/src/addins/AspNet/Razor/RazorCSharpParser.cs
index d83d2c002e..2c20cd3d30 100644
--- a/main/src/addins/AspNet/Razor/RazorCSharpParser.cs
+++ b/main/src/addins/AspNet/Razor/RazorCSharpParser.cs
@@ -40,10 +40,6 @@ using System.Web.Razor.Text;
using System.Web.WebPages.Razor;
using System.Web.WebPages.Razor.Configuration;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem.Implementation;
-
-using Mono.TextEditor;
using MonoDevelop.Core;
using MonoDevelop.Ide;
@@ -53,149 +49,189 @@ using MonoDevelop.Projects;
using MonoDevelop.AspNet.Projects;
using MonoDevelop.AspNet.WebForms.Parser;
using MonoDevelop.AspNet.Razor.Parser;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
namespace MonoDevelop.AspNet.Razor
{
public class RazorCSharpParser : TypeSystemParser
{
- MonoDevelop.Web.Razor.EditorParserFixed.RazorEditorParser editorParser;
- DocumentParseCompleteEventArgs capturedArgs;
- AutoResetEvent parseComplete;
- ChangeInfo lastChange;
- string lastParsedFile;
- TextDocument currentDocument;
- AspNetAppProject aspProject;
- DotNetProject project;
- IList<TextDocument> openDocuments;
-
- public IList<TextDocument> OpenDocuments { get { return openDocuments; } }
+ IList<OpenRazorDocument> openDocuments;
+ IList<OpenRazorDocument> documentsPendingDispose;
+
+ internal IList<OpenRazorDocument> OpenDocuments { get { return openDocuments; } }
public RazorCSharpParser ()
{
- openDocuments = new List<TextDocument> ();
+ openDocuments = new List<OpenRazorDocument> ();
+ documentsPendingDispose = new List<OpenRazorDocument> ();
IdeApp.Exited += delegate {
//HACK: workaround for Mono's not shutting downs IsBackground threads in WaitAny calls
- if (editorParser != null) {
- DisposeCurrentParser ();
- }
+ DisposeDocuments (documentsPendingDispose);
+ DisposeDocuments (openDocuments);
};
}
- public override ParsedDocument Parse (bool storeAst, string fileName, System.IO.TextReader content, Project project = null)
+ public override System.Threading.Tasks.Task<ParsedDocument> Parse (MonoDevelop.Ide.TypeSystem.ParseOptions parseOptions, CancellationToken cancellationToken)
{
- currentDocument = openDocuments.FirstOrDefault (d => d != null && d.FileName == fileName);
- // We need document and project to be loaded to correctly initialize Razor Host.
- this.project = project as DotNetProject;
- if (currentDocument == null && !TryAddDocument (fileName))
- return new RazorCSharpParsedDocument (fileName, new RazorCSharpPageInfo ());
+ OpenRazorDocument currentDocument = GetDocument (parseOptions.FileName);
+ if (currentDocument == null)
+ return System.Threading.Tasks.Task.FromResult ((ParsedDocument)new RazorCSharpParsedDocument (parseOptions.FileName, new RazorCSharpPageInfo ()));
+
+ var context = new RazorCSharpParserContext (parseOptions, currentDocument);
- this.aspProject = project as AspNetAppProject;
+ lock (currentDocument) {
+ return Parse (context, cancellationToken);
+ }
+ }
+
+ OpenRazorDocument GetDocument (string fileName)
+ {
+ lock (this) {
+ DisposeDocuments (documentsPendingDispose);
- EnsureParserInitializedFor (fileName);
+ OpenRazorDocument currentDocument = openDocuments.FirstOrDefault (d => d != null && d.FileName == fileName);
+ // We need document and project to be loaded to correctly initialize Razor Host.
+ if (currentDocument == null && !TryAddDocument (fileName, out currentDocument))
+ return null;
+
+ return currentDocument;
+ }
+ }
+
+ void DisposeDocuments (IEnumerable<OpenRazorDocument> documents)
+ {
+ try {
+ foreach (OpenRazorDocument document in documents.Reverse ()) {
+ document.Dispose ();
+ documentsPendingDispose.Remove (document);
+ }
+ } catch (Exception ex) {
+ LoggingService.LogError ("Dispose pending Razor document error.", ex);
+ }
+ }
+
+ System.Threading.Tasks.Task<ParsedDocument> Parse (RazorCSharpParserContext context, CancellationToken cancellationToken)
+ {
+ EnsureParserInitializedFor (context);
var errors = new List<Error> ();
- using (var source = new SeekableTextReader (content)) {
- var textChange = CreateTextChange (source);
- var parseResult = editorParser.CheckForStructureChanges (textChange);
+ using (var source = new SeekableTextReader (context.Content.CreateReader ())) {
+ var textChange = CreateTextChange (context, source);
+ var parseResult = context.EditorParser.CheckForStructureChanges (textChange);
if (parseResult == PartialParseResult.Rejected) {
- parseComplete.WaitOne ();
- if (!capturedArgs.GeneratorResults.Success)
- GetRazorErrors (errors);
+ context.RazorDocument.ParseComplete.WaitOne ();
+ if (!context.CapturedArgs.GeneratorResults.Success)
+ GetRazorErrors (context, errors);
}
}
- ParseHtmlDocument (errors);
- CreateCSharpParsedDocument ();
- ClearLastChange ();
+ ParseHtmlDocument (context, errors);
+ CreateCSharpParsedDocument (context);
+ context.ClearLastTextChange ();
RazorHostKind kind = RazorHostKind.WebPage;
- if (editorParser.Host is WebCodeRazorHost) {
+ if (context.EditorParser.Host is WebCodeRazorHost) {
kind = RazorHostKind.WebCode;
- } else if (editorParser.Host is MonoDevelop.AspNet.Razor.Generator.PreprocessedRazorHost) {
+ } else if (context.EditorParser.Host is MonoDevelop.AspNet.Razor.Generator.PreprocessedRazorHost) {
kind = RazorHostKind.Template;
}
+ var model = context.AnalysisDocument.GetSemanticModelAsync (cancellationToken).Result;
var pageInfo = new RazorCSharpPageInfo () {
- HtmlRoot = htmlParsedDocument,
- GeneratorResults = capturedArgs.GeneratorResults,
- Spans = editorParser.CurrentParseTree.Flatten (),
- CSharpParsedFile = parsedCodeFile,
- CSharpCode = csharpCode,
+ HtmlRoot = context.HtmlParsedDocument,
+ GeneratorResults = context.CapturedArgs.GeneratorResults,
+ Spans = context.EditorParser.CurrentParseTree.Flatten (),
+ CSharpSyntaxTree = context.ParsedSyntaxTree,
+ ParsedDocument = new DefaultParsedDocument ("generated.cs") { Ast = model },
+ AnalysisDocument = context.AnalysisDocument,
+ CSharpCode = context.CSharpCode,
Errors = errors,
- FoldingRegions = GetFoldingRegions (),
- Comments = comments,
- Compilation = CreateCompilation (),
+ FoldingRegions = GetFoldingRegions (context),
+ Comments = context.Comments,
HostKind = kind,
};
- return new RazorCSharpParsedDocument (fileName, pageInfo);
+ return System.Threading.Tasks.Task.FromResult((ParsedDocument)new RazorCSharpParsedDocument (context.FileName, pageInfo));
}
- bool TryAddDocument (string fileName)
+ bool TryAddDocument (string fileName, out OpenRazorDocument currentDocument)
{
+ currentDocument = null;
if (string.IsNullOrEmpty (fileName))
return false;
var guiDoc = IdeApp.Workbench.GetDocument (fileName);
if (guiDoc != null && guiDoc.Editor != null) {
- currentDocument = guiDoc.Editor.Document;
- currentDocument.TextReplacing += OnTextReplacing;
+ currentDocument = new OpenRazorDocument (guiDoc.Editor);
lock (this) {
- var newDocs = new List<TextDocument> (openDocuments);
+ var newDocs = new List<OpenRazorDocument> (openDocuments);
newDocs.Add (currentDocument);
openDocuments = newDocs;
}
+ var closedDocument = currentDocument;
guiDoc.Closed += (sender, args) =>
{
- var doc = sender as Document;
- if (doc.Editor != null && doc.Editor.Document != null) {
+ var doc = (Ide.Gui.Document)sender;
+ if (doc.Editor != null) {
lock (this) {
- openDocuments = new List<TextDocument> (openDocuments.Where (d => d != doc.Editor.Document));
+ openDocuments = new List<OpenRazorDocument> (openDocuments.Where (d => d.FileName != doc.Editor.FileName));
}
}
- if (lastParsedFile == doc.FileName && editorParser != null) {
- DisposeCurrentParser ();
- }
+ TryDisposingDocument (closedDocument);
+ closedDocument = null;
};
return true;
}
return false;
}
- void EnsureParserInitializedFor (string fileName)
+ void TryDisposingDocument (OpenRazorDocument document)
{
- if (lastParsedFile == fileName && editorParser != null)
- return;
+ if (Monitor.TryEnter (document)) {
+ try {
+ document.Dispose ();
+ } finally {
+ Monitor.Exit (document);
+ }
+ } else {
+ lock (this) {
+ documentsPendingDispose.Add (document);
+ }
+ }
+ }
- if (editorParser != null)
- DisposeCurrentParser ();
+ void EnsureParserInitializedFor (RazorCSharpParserContext context)
+ {
+ if (context.EditorParser != null)
+ return;
- CreateParserFor (fileName);
+ CreateParserFor (context);
}
- void CreateParserFor (string fileName)
+ void CreateParserFor (RazorCSharpParserContext context)
{
- editorParser = new MonoDevelop.Web.Razor.EditorParserFixed.RazorEditorParser (CreateRazorHost (fileName), fileName);
+ context.EditorParser = new MonoDevelop.Web.Razor.EditorParserFixed.RazorEditorParser (CreateRazorHost (context), context.FileName);
- parseComplete = new AutoResetEvent (false);
- editorParser.DocumentParseComplete += (sender, args) =>
+ context.RazorDocument.ParseComplete = new AutoResetEvent (false);
+ context.EditorParser.DocumentParseComplete += (sender, args) =>
{
- capturedArgs = args;
- parseComplete.Set ();
+ context.RazorDocument.CapturedArgs = args;
+ context.RazorDocument.ParseComplete.Set ();
};
-
- lastParsedFile = fileName;
}
- RazorEngineHost CreateRazorHost (string fileName)
+ static RazorEngineHost CreateRazorHost (RazorCSharpParserContext context)
{
- if (project != null) {
- var projectFile = project.GetProjectFile (fileName);
+ if (context.Project != null) {
+ var projectFile = context.Project.GetProjectFile (context.FileName);
if (projectFile != null && projectFile.Generator == "RazorTemplatePreprocessor") {
- return new MonoDevelop.AspNet.Razor.Generator.PreprocessedRazorHost (fileName) {
+ return new MonoDevelop.AspNet.Razor.Generator.PreprocessedRazorHost (context.FileName) {
DesignTimeMode = true,
EnableLinePragmas = false,
};
@@ -203,15 +239,15 @@ namespace MonoDevelop.AspNet.Razor
}
string virtualPath = "~/Views/Default.cshtml";
- if (aspProject != null)
- virtualPath = aspProject.LocalToVirtualPath (fileName);
+ if (context.AspProject != null)
+ virtualPath = context.AspProject.LocalToVirtualPath (context.FileName);
WebPageRazorHost host = null;
// Try to create host using web.config file
var webConfigMap = new WebConfigurationFileMap ();
- if (aspProject != null) {
- var vdm = new VirtualDirectoryMapping (aspProject.BaseDirectory.Combine ("Views"), true, "web.config");
+ if (context.AspProject != null) {
+ var vdm = new VirtualDirectoryMapping (context.AspProject.Project.BaseDirectory.Combine ("Views"), true, "web.config");
webConfigMap.VirtualDirectories.Add ("/", vdm);
}
Configuration configuration;
@@ -224,13 +260,13 @@ namespace MonoDevelop.AspNet.Razor
//TODO: use our assemblies, not the project's
var rws = configuration.GetSectionGroup (RazorWebSectionGroup.GroupName) as RazorWebSectionGroup;
if (rws != null) {
- host = WebRazorHostFactory.CreateHostFromConfig (rws, virtualPath, fileName);
+ host = WebRazorHostFactory.CreateHostFromConfig (rws, virtualPath, context.FileName);
host.DesignTimeMode = true;
}
}
if (host == null) {
- host = new MvcWebPageRazorHost (virtualPath, fileName) { DesignTimeMode = true };
+ host = new MvcWebPageRazorHost (virtualPath, context.FileName) { DesignTimeMode = true };
// Add default namespaces from Razor section
host.NamespaceImports.Add ("System.Web.Mvc");
host.NamespaceImports.Add ("System.Web.Mvc.Ajax");
@@ -241,22 +277,9 @@ namespace MonoDevelop.AspNet.Razor
return host;
}
- void DisposeCurrentParser ()
- {
- editorParser.Dispose ();
- editorParser = null;
- parseComplete.Dispose ();
- parseComplete = null;
- ClearLastChange ();
- }
-
- void ClearLastChange ()
- {
- lastChange = null;
- }
-
- TextChange CreateTextChange (SeekableTextReader source)
+ static TextChange CreateTextChange (RazorCSharpParserContext context, SeekableTextReader source)
{
+ ChangeInfo lastChange = context.GetLastTextChange ();
if (lastChange == null)
return new TextChange (0, 0, new SeekableTextReader (String.Empty), 0, source.Length, source);
if (lastChange.DeleteChange)
@@ -266,24 +289,21 @@ namespace MonoDevelop.AspNet.Razor
lastChange.AbsoluteLength, source);
}
- void GetRazorErrors (List<Error> errors)
+ static void GetRazorErrors (RazorCSharpParserContext context, List<Error> errors)
{
- foreach (var error in capturedArgs.GeneratorResults.ParserErrors) {
+ foreach (var error in context.CapturedArgs.GeneratorResults.ParserErrors) {
int off = error.Location.AbsoluteIndex;
if (error.Location.CharacterIndex > 0 && error.Length == 1)
off--;
- errors.Add (new Error (ErrorType.Error, error.Message, currentDocument.OffsetToLocation (off)));
+ errors.Add (new Error (ErrorType.Error, error.Message, context.Document.OffsetToLocation (off)));
}
}
- MonoDevelop.Xml.Dom.XDocument htmlParsedDocument;
- IList<Comment> comments;
-
- void ParseHtmlDocument (List<Error> errors)
+ static void ParseHtmlDocument (RazorCSharpParserContext context, List<Error> errors)
{
var sb = new StringBuilder ();
var spanList = new List<Span> ();
- comments = new List<Comment> ();
+ context.Comments = new List<Comment> ();
Action<Span> action = (Span span) =>
{
@@ -305,59 +325,59 @@ namespace MonoDevelop.AspNet.Razor
ClosingTag = "*@",
CommentType = CommentType.Block,
};
- comment.Region = new DomRegion (
- currentDocument.OffsetToLocation (span.Start.AbsoluteIndex - comment.OpenTag.Length),
- currentDocument.OffsetToLocation (span.Start.AbsoluteIndex + span.Length + comment.ClosingTag.Length));
- comments.Add (comment);
+ comment.Region = new MonoDevelop.Ide.Editor.DocumentRegion (
+ context.Document.OffsetToLocation (span.Start.AbsoluteIndex - comment.OpenTag.Length),
+ context.Document.OffsetToLocation (span.Start.AbsoluteIndex + span.Length + comment.ClosingTag.Length));
+ context.Comments.Add (comment);
}
}
};
- editorParser.CurrentParseTree.Accept (new CallbackVisitor (action));
+ context.EditorParser.CurrentParseTree.Accept (new CallbackVisitor (action));
var parser = new MonoDevelop.Xml.Parser.XmlParser (new WebFormsRootState (), true);
try {
parser.Parse (new StringReader (sb.ToString ()));
} catch (Exception ex) {
- LoggingService.LogError ("Unhandled error parsing html in Razor document '" + (lastParsedFile ?? "") + "'", ex);
+ LoggingService.LogError ("Unhandled error parsing html in Razor document '" + (context.FileName ?? "") + "'", ex);
}
- htmlParsedDocument = parser.Nodes.GetRoot ();
+ context.HtmlParsedDocument = parser.Nodes.GetRoot ();
errors.AddRange (parser.Errors);
}
- IEnumerable<FoldingRegion> GetFoldingRegions ()
+ static IEnumerable<FoldingRegion> GetFoldingRegions (RazorCSharpParserContext context)
{
var foldingRegions = new List<FoldingRegion> ();
- GetHtmlFoldingRegions (foldingRegions);
- GetRazorFoldingRegions (foldingRegions);
+ GetHtmlFoldingRegions (context, foldingRegions);
+ GetRazorFoldingRegions (context, foldingRegions);
return foldingRegions;
}
- void GetHtmlFoldingRegions (List<FoldingRegion> foldingRegions)
+ static void GetHtmlFoldingRegions (RazorCSharpParserContext context, List<FoldingRegion> foldingRegions)
{
- if (htmlParsedDocument != null) {
- var d = new MonoDevelop.AspNet.WebForms.WebFormsParsedDocument (null, WebSubtype.Html, null, htmlParsedDocument);
+ if (context.HtmlParsedDocument != null) {
+ var d = new MonoDevelop.AspNet.WebForms.WebFormsParsedDocument (null, WebSubtype.Html, null, context.HtmlParsedDocument);
foldingRegions.AddRange (d.Foldings);
}
}
- void GetRazorFoldingRegions (List<FoldingRegion> foldingRegions)
+ static void GetRazorFoldingRegions (RazorCSharpParserContext context, List<FoldingRegion> foldingRegions)
{
var blocks = new List<Block> ();
- GetBlocks (editorParser.CurrentParseTree, blocks);
+ GetBlocks (context.EditorParser.CurrentParseTree, blocks);
foreach (var block in blocks) {
- var beginLine = currentDocument.GetLineByOffset (block.Start.AbsoluteIndex);
- var endLine = currentDocument.GetLineByOffset (block.Start.AbsoluteIndex + block.Length);
+ var beginLine = context.Document.GetLineByOffset (block.Start.AbsoluteIndex);
+ var endLine = context.Document.GetLineByOffset (block.Start.AbsoluteIndex + block.Length);
if (beginLine != endLine)
foldingRegions.Add (new FoldingRegion (RazorUtils.GetShortName (block),
- new DomRegion (currentDocument.OffsetToLocation (block.Start.AbsoluteIndex),
- currentDocument.OffsetToLocation (block.Start.AbsoluteIndex + block.Length))));
+ new DocumentRegion (context.Document.OffsetToLocation (block.Start.AbsoluteIndex),
+ context.Document.OffsetToLocation (block.Start.AbsoluteIndex + block.Length))));
}
}
- void GetBlocks (Block root, IList<Block> blocks)
+ static void GetBlocks (Block root, IList<Block> blocks)
{
foreach (var block in root.Children.Where (n => n.IsBlock).Select (n => n as Block)) {
if (block.Type != BlockType.Comment && block.Type != BlockType.Markup)
@@ -367,27 +387,33 @@ namespace MonoDevelop.AspNet.Razor
}
}
- ParsedDocumentDecorator parsedCodeFile;
- string csharpCode;
-
- void CreateCSharpParsedDocument ()
+ static void CreateCSharpParsedDocument (RazorCSharpParserContext context)
{
- var parser = new ICSharpCode.NRefactory.CSharp.CSharpParser ();
- ICSharpCode.NRefactory.CSharp.SyntaxTree unit;
- csharpCode = CreateCodeFile ();
- using (var sr = new StringReader (csharpCode)) {
- unit = parser.Parse (sr, "Generated.cs");
+ if (context.Project == null)
+ return;
+
+ context.CSharpCode = CreateCodeFile (context);
+ context.ParsedSyntaxTree = CSharpSyntaxTree.ParseText (Microsoft.CodeAnalysis.Text.SourceText.From (context.CSharpCode));
+
+ var originalProject = TypeSystemService.GetCodeAnalysisProject (context.Project);
+ if (originalProject != null) {
+ string fileName = context.FileName + ".g.cs";
+ var documentId = TypeSystemService.GetDocumentId (originalProject.Id, fileName);
+ if (documentId == null) {
+ context.AnalysisDocument = originalProject.AddDocument (
+ fileName,
+ context.ParsedSyntaxTree?.GetRoot ());
+ } else {
+ context.AnalysisDocument = TypeSystemService.GetCodeAnalysisDocument (documentId);
+ }
}
- unit.Freeze ();
- var parsedDoc = unit.ToTypeSystem ();
- parsedCodeFile = new ParsedDocumentDecorator (parsedDoc) { Ast = unit };
}
- string CreateCodeFile ()
+ static string CreateCodeFile (RazorCSharpParserContext context)
{
- var unit = capturedArgs.GeneratorResults.GeneratedCode;
- System.CodeDom.Compiler.CodeDomProvider provider = project != null
- ? project.LanguageBinding.GetCodeDomProvider ()
+ var unit = context.CapturedArgs.GeneratorResults.GeneratedCode;
+ System.CodeDom.Compiler.CodeDomProvider provider = context.Project != null
+ ? context.Project.LanguageBinding.GetCodeDomProvider ()
: new Microsoft.CSharp.CSharpCodeProvider ();
using (var sw = new StringWriter ()) {
provider.GenerateCodeFromCompileUnit (unit, sw, new System.CodeDom.Compiler.CodeGeneratorOptions () {
@@ -400,42 +426,6 @@ namespace MonoDevelop.AspNet.Razor
return sw.ToString ();
}
}
-
- // Creates compilation that includes underlying C# file for Razor view
- ICompilation CreateCompilation ()
- {
- if (project != null) {
- return TypeSystemService.GetProjectContext (project).AddOrUpdateFiles (parsedCodeFile.ParsedFile).CreateCompilation ();
- }
- return new SimpleCompilation (
- new DefaultUnresolvedAssembly (Path.ChangeExtension (parsedCodeFile.FileName, ".dll")),
- GetDefaultAssemblies ()
- );
- }
-
- //FIXME: make this better reflect the real set of assemblies used by razor
- static IEnumerable<IUnresolvedAssembly> GetDefaultAssemblies ()
- {
- var runtime = Runtime.SystemAssemblyService.DefaultRuntime;
- var fx = Runtime.SystemAssemblyService.GetTargetFramework (MonoDevelop.Core.Assemblies.TargetFrameworkMoniker.NET_4_5);
- if (!runtime.IsInstalled (fx))
- fx = Runtime.SystemAssemblyService.GetTargetFramework (MonoDevelop.Core.Assemblies.TargetFrameworkMoniker.NET_4_0);
- foreach (var assembly in new [] { "System", "System.Core", "System.Xml", "System.Web.Mvc,Version=3.0.0.0" }) {
- var path = Runtime.SystemAssemblyService.DefaultAssemblyContext.GetAssemblyLocation (assembly, fx);
- yield return TypeSystemService.LoadAssemblyContext (runtime, fx, path);
- }
- }
-
- void OnTextReplacing (object sender, DocumentChangeEventArgs e)
- {
- if (lastChange == null)
- lastChange = new ChangeInfo (e.Offset, new SeekableTextReader((sender as TextDocument).Text));
- if (e.ChangeDelta > 0) {
- lastChange.Length += e.InsertionLength;
- } else {
- lastChange.Length -= e.RemovalLength;
- }
- }
}
class ChangeInfo
diff --git a/main/src/addins/AspNet/Razor/RazorCSharpParserContext.cs b/main/src/addins/AspNet/Razor/RazorCSharpParserContext.cs
new file mode 100644
index 0000000000..133c48235c
--- /dev/null
+++ b/main/src/addins/AspNet/Razor/RazorCSharpParserContext.cs
@@ -0,0 +1,100 @@
+//
+// RazorCSharpParserContext.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Web.Razor;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.AspNet.Projects;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Projects;
+using MonoDevelop.Xml.Dom;
+
+namespace MonoDevelop.AspNet.Razor
+{
+ class RazorCSharpParserContext
+ {
+ MonoDevelop.Ide.TypeSystem.ParseOptions parseOptions;
+ OpenRazorDocument razorDocument;
+
+ public RazorCSharpParserContext (MonoDevelop.Ide.TypeSystem.ParseOptions parseOptions, OpenRazorDocument razorDocument)
+ {
+ this.parseOptions = parseOptions;
+ this.razorDocument = razorDocument;
+ }
+
+ public DotNetProject Project {
+ get { return parseOptions.Project as DotNetProject; }
+ }
+
+ public AspNetAppProjectFlavor AspProject {
+ get { return parseOptions.Project.As<AspNetAppProjectFlavor> (); }
+ }
+
+ public string FileName {
+ get { return parseOptions.FileName; }
+ }
+
+ public ITextSource Content {
+ get { return parseOptions.Content; }
+ }
+
+ public ITextDocument Document {
+ get { return razorDocument.Document; }
+ }
+
+ public OpenRazorDocument RazorDocument {
+ get { return razorDocument; }
+ }
+
+ public SyntaxTree ParsedSyntaxTree { get; set; }
+ public string CSharpCode { get; set; }
+ public Microsoft.CodeAnalysis.Document AnalysisDocument { get; set; }
+ public XDocument HtmlParsedDocument { get; set; }
+ public IList<Comment> Comments { get; set; }
+ public MonoDevelop.Web.Razor.EditorParserFixed.RazorEditorParser EditorParser {
+ get { return razorDocument.EditorParser; }
+ set { razorDocument.EditorParser = value; }
+ }
+
+ public DocumentParseCompleteEventArgs CapturedArgs {
+ get { return razorDocument.CapturedArgs; }
+ }
+
+ public ChangeInfo GetLastTextChange ()
+ {
+ return razorDocument.LastTextChange;
+ }
+
+ public void ClearLastTextChange ()
+ {
+ razorDocument.ClearLastTextChange ();
+ }
+ }
+}
+
diff --git a/main/src/addins/AspNet/Razor/RazorPageInfo.cs b/main/src/addins/AspNet/Razor/RazorPageInfo.cs
index 53f1c80d2e..722adccc30 100644
--- a/main/src/addins/AspNet/Razor/RazorPageInfo.cs
+++ b/main/src/addins/AspNet/Razor/RazorPageInfo.cs
@@ -27,9 +27,9 @@
using System.Collections.Generic;
using System.Web.Razor;
using System.Web.Razor.Parser.SyntaxTree;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Xml.Dom;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.AspNet.Razor
{
@@ -54,8 +54,9 @@ namespace MonoDevelop.AspNet.Razor
public class RazorCSharpPageInfo : RazorPageInfo
{
- public ParsedDocumentDecorator CSharpParsedFile { get; set; }
- public ICompilation Compilation { get; set; }
+ public SyntaxTree CSharpSyntaxTree { get; set; }
+ public ParsedDocument ParsedDocument { get; set; }
+ public Microsoft.CodeAnalysis.Document AnalysisDocument { get; set; }
public string CSharpCode { get; set; }
}
diff --git a/main/src/addins/AspNet/Razor/RazorSyntaxMode.cs b/main/src/addins/AspNet/Razor/RazorSyntaxMode.cs
index 1a07191a9e..8c0cb7e854 100644
--- a/main/src/addins/AspNet/Razor/RazorSyntaxMode.cs
+++ b/main/src/addins/AspNet/Razor/RazorSyntaxMode.cs
@@ -40,12 +40,13 @@ using MonoDevelop.AspNet.Razor.Parser;
using MonoDevelop.Ide;
using RazorSpan = System.Web.Razor.Parser.SyntaxTree.Span;
using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.Razor
{
public class RazorSyntaxMode : SyntaxMode, IDisposable
{
- public RazorSyntaxMode (Document doc)
+ public RazorSyntaxMode (DocumentContext doc)
{
this.guiDocument = doc;
guiDocument.DocumentParsed += HandleDocumentParsed;
@@ -80,7 +81,7 @@ namespace MonoDevelop.AspNet.Razor
IList<RazorSpan> currentSpans;
State currentState;
IList<Chunk> chunks;
- Document guiDocument;
+ DocumentContext guiDocument;
public override IEnumerable<Chunk> GetChunks (ColorScheme style, DocumentLine line, int offset, int length)
{
diff --git a/main/src/addins/AspNet/Templates/Global.tt b/main/src/addins/AspNet/Templates/Global.tt
new file mode 100644
index 0000000000..11cbbbe770
--- /dev/null
+++ b/main/src/addins/AspNet/Templates/Global.tt
@@ -0,0 +1,32 @@
+<#@ template language="C#" #>
+<#
+bool webApi = IsTrue ("UsesAspNetWebApi");
+bool mvc = IsTrue ("UsesAspNetMvc");
+#>
+using System.Web;
+<# if (mvc) { #>
+using System.Web.Mvc;
+using System.Web.Routing;
+<# } #>
+<# if (webApi) { #>
+using System.Web.Http;
+<# } #>
+
+namespace <#=Tags["Namespace"]#>
+{
+ public class Global : HttpApplication
+ {
+ protected void Application_Start()
+ {
+<# if (mvc) { #>
+ AreaRegistration.RegisterAllAreas();
+<# } #>
+<# if (webApi) { #>
+ GlobalConfiguration.Configure(WebApiConfig.Register);
+<# } #>
+<# if (mvc) { #>
+ RouteConfig.RegisterRoutes(RouteTable.Routes);
+<# } #>
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/AspNet/Templates/GlobalAsax.xft.xml b/main/src/addins/AspNet/Templates/GlobalAsax.xft.xml
new file mode 100644
index 0000000000..3015f99067
--- /dev/null
+++ b/main/src/addins/AspNet/Templates/GlobalAsax.xft.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<Template Originator="Piotr Dowgiallo"
+ Created="2012/05/16"
+ LastModified="2012/05/16">
+
+ <!-- Template Header -->
+ <TemplateConfiguration>
+ <_Name>ASP.NET Global.asax</_Name>
+ <_Category>ASP.NET</_Category>
+ <Icon>md-html-file-icon</Icon>
+ <LanguageName>C#</LanguageName>
+ <ProjectType>AspNetApp</ProjectType>
+ <DefaultFilename IsFixed="True">Global.asax</DefaultFilename>
+ <_Description>Creates an ASP.NET Global.asax file.</_Description>
+ </TemplateConfiguration>
+
+ <Conditions>
+ <ParentProject PermittedCreationPaths="" ExcludedFiles="/Global.asax:/App_Start/WebApiConfig.cs:/App_Start/RouteConfig.cs" />
+ </Conditions>
+
+ <!-- Template Content -->
+ <TemplateFiles>
+ <File name="Global.asax" SuppressAutoOpen="true">
+<![CDATA[<%@ Application Inherits="${Namespace}.Global" %>
+]]>
+ </File>
+ <T4File name="Global.asax.cs" DependsOn="Global.asax" src="Global.tt" AddStandardHeader="true" />
+ <Directory name="App_Start" if="UsesAspNetWebApi">
+ <File name="WebApiConfig.cs" src="WebApiConfig.cs" SuppressAutoOpen="true" />
+ </Directory>
+ <Directory name="App_Start" if="UsesAspNetMvc">
+ <File name="RouteConfig.cs" src="RouteConfig.cs" SuppressAutoOpen="true" />
+ </Directory>
+ </TemplateFiles>
+</Template>
diff --git a/main/src/addins/AspNet/Templates/Mvc/GlobalAsax.xft.xml b/main/src/addins/AspNet/Templates/Mvc/GlobalAsax.xft.xml
deleted file mode 100644
index 666cbdd11b..0000000000
--- a/main/src/addins/AspNet/Templates/Mvc/GlobalAsax.xft.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0"?>
-<Template Originator="Piotr Dowgiallo"
- Created="2012/05/16"
- LastModified="2012/05/16">
-
- <!-- Template Header -->
- <TemplateConfiguration>
- <_Name>ASP.NET MVC Global.asax</_Name>
- <_Category>ASP.NET MVC</_Category>
- <Icon>md-html-file-icon</Icon>
- <LanguageName>C#</LanguageName>
- <ProjectType>AspNetApp</ProjectType>
- <DefaultFilename IsFixed="True">Global.asax</DefaultFilename>
- <_Description>Creates an ASP.NET MVC Global.asax file.</_Description>
- </TemplateConfiguration>
-
- <Conditions>
- <ParentProject PermittedCreationPaths="" ExcludedFiles="/Global.asax" />
- <AspNetMvc />
- </Conditions>
-
- <!-- Template Content -->
- <TemplateFiles>
- <File name="Global.asax">
-<![CDATA[<%@ Application Inherits="${Namespace}.MvcApplication" %>
-]]>
- </File>
- <File name="Global.asax.cs" DependsOn="Global.asax" >
-<![CDATA[
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
-using System.Web.Mvc;
-using System.Web.Routing;
-
-namespace ${Namespace}
-{
- public class MvcApplication : System.Web.HttpApplication
- {
- public static void RegisterRoutes(RouteCollection routes)
- {
- routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
-
- routes.MapRoute(
- "Default",
- "{controller}/{action}/{id}",
- new { controller = "Home", action = "Index", id = "" }
- );
-
- }
-
- public static void RegisterGlobalFilters(GlobalFilterCollection filters)
- {
- filters.Add(new HandleErrorAttribute());
- }
-
- protected void Application_Start()
- {
- AreaRegistration.RegisterAllAreas();
- RegisterGlobalFilters(GlobalFilters.Filters);
- RegisterRoutes(RouteTable.Routes);
- }
- }
-}]]>
- </File>
- </TemplateFiles>
-</Template>
diff --git a/main/src/addins/AspNet/Templates/Mvc/WebConfigApp.xft.xml b/main/src/addins/AspNet/Templates/Mvc/WebConfigApp.xft.xml
deleted file mode 100644
index 81e9c17aef..0000000000
--- a/main/src/addins/AspNet/Templates/Mvc/WebConfigApp.xft.xml
+++ /dev/null
@@ -1,151 +0,0 @@
-<?xml version="1.0"?>
-<Template
- Originator="Piotr Dowgiallo"
- Created="2012/05/16"
- LastModified="2012/05/16">
-
- <!-- Template Header -->
- <TemplateConfiguration>
- <_Name>ASP.NET MVC Application Configuration</_Name>
- <_Category>ASP.NET MVC</_Category>
- <Icon>md-html-file-icon</Icon>
- <LanguageName>C#</LanguageName>
- <ProjectType>AspNetApp</ProjectType>
- <DefaultFilename IsFixed="True">Web.config</DefaultFilename>
- <_Description>Creates an ASP.NET MVC Web.config file for an application.</_Description>
- </TemplateConfiguration>
-
- <Conditions>
- <ParentProject PermittedCreationPaths="" ExcludedFiles="Web.config" RequireProject="True"/>
- <AspNetMvc />
- </Conditions>
-
- <!-- Template Content -->
- <TemplateFiles>
- <File name="Web.config">
-<![CDATA[<?xml version="1.0" ?>
-<!--
-Web.config file for ${ProjectName}.
-
-The settings that can be used in this file are documented at
-http://www.mono-project.com/Config_system.web and
-http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
--->
-<configuration>
- <configSections>
- <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
- <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
- <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
- <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
- <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
- <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
- <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
- <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
- </sectionGroup>
- </sectionGroup>
- </sectionGroup>
- </configSections>
- <system.web>
- <!--
- Set compilation debug="true" to insert debugging
- symbols into the compiled page. Because this
- affects performance, set this value to true only
- during development.
- -->
- <compilation defaultLanguage="C#" debug="false">
- <assemblies>
- <add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
- <add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- <add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- <add assembly="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
- <add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
- <add assembly="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
- <add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
- <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
- <add assembly="Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- </assemblies>
- </compilation>
-
- <customErrors mode="RemoteOnly">
- </customErrors>
- <pages>
- <controls>
- <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- </controls>
-
- <namespaces>
- <add namespace="System.Web.Mvc"/>
- <add namespace="System.Web.Mvc.Ajax"/>
- <add namespace="System.Web.Mvc.Html"/>
- <add namespace="System.Web.Routing"/>
- <add namespace="System.Web.Helpers" />
- <add namespace="System.Web.WebPages"/>
- <add namespace="System.Linq"/>
- <add namespace="System.Collections.Generic"/>
- </namespaces>
- </pages>
-
- <authorization>
- <allow users="*" />
- </authorization>
-
- <httpHandlers>
- <remove verb="*" path="*.asmx"/>
- <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
- <add verb="*" path="*.mvc" validate="false" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- </httpHandlers>
-
- <httpModules>
- <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
- <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
- </httpModules>
-
- <trace
- enabled="false"
- localOnly="true"
- pageOutput="false"
- requestLimit="10"
- traceMode="SortByTime"
- />
-
- <globalization
- requestEncoding="utf-8"
- responseEncoding="utf-8"
- />
-
- </system.web>
-
- <system.codedom>
- <compilers>
- <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4"
- type="Microsoft.CSharp.CSharpCodeProvider, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
- <providerOption name="CompilerVersion" value="v4.0"/>
- <providerOption name="WarnAsError" value="false"/>
- </compiler>
- <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4"
- type="Microsoft.VisualBasic.VBCodeProvider, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
- <providerOption name="CompilerVersion" value="v4.0"/>
- <providerOption name="OptionInfer" value="true"/>
- <providerOption name="WarnAsError" value="false"/>
- </compiler>
- </compilers>
- </system.codedom>
-
- <system.web.extensions/>
-
- <appSettings>
- <add key="webpages:Version" value="3.0.0.0"/>
- <add key="ClientValidationEnabled" value="true"/>
- <add key="UnobtrusiveJavaScriptEnabled" value="true"/>
- </appSettings>
-</configuration>
-]]>
- </File>
- </TemplateFiles>
-</Template>
-
diff --git a/main/src/addins/AspNet/Templates/Mvc/WebConfigViews.xft.xml b/main/src/addins/AspNet/Templates/Mvc/WebConfigViews.xft.xml
index d3f058935b..1e273f35ad 100644
--- a/main/src/addins/AspNet/Templates/Mvc/WebConfigViews.xft.xml
+++ b/main/src/addins/AspNet/Templates/Mvc/WebConfigViews.xft.xml
@@ -1,9 +1,5 @@
<?xml version="1.0"?>
-<Template
- Originator="Piotr Dowgiallo"
- Created="2012/05/16"
- LastModified="2012/05/16">
-
+<Template>
<!-- Template Header -->
<TemplateConfiguration>
<_Name>ASP.NET MVC Views Configuration</_Name>
@@ -16,14 +12,15 @@
</TemplateConfiguration>
<Conditions>
- <ParentProject PermittedCreationPaths="/Views" ExcludedFiles="Web.config" />
- <AspNetMvc razor = "true" />
+ <ParentProject PermittedCreationPaths="Views" ExcludedFiles="Web.config" />
+ <AspNetMvc />
</Conditions>
<!-- Template Content -->
<TemplateFiles>
<File name="Web.config">
<![CDATA[<?xml version="1.0"?>
+
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
@@ -32,48 +29,29 @@
</sectionGroup>
</configSections>
- <system.web>
- <httpHandlers>
- <add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
- </httpHandlers>
-
- <!--
- Enabling request validation in view pages would cause validation to occur
- after the input has already been processed by the controller. By default
- MVC performs request validation before a controller processes the input.
- To change this behavior apply the ValidateInputAttribute to a
- controller or action.
- -->
- <pages validateRequest="false"
- pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
- pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
- userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
- <controls>
- <add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
- </controls>
- </pages>
- </system.web>
-
- <system.webServer>
- <validation validateIntegratedModeConfiguration="false"/>
- <handlers>
- <remove name="BlockViewHandler"/>
- <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
- </handlers>
- </system.webServer>
-
<system.web.webPages.razor>
- <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
+ <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
+ <add namespace="${Namespace}" />
</namespaces>
</pages>
</system.web.webPages.razor>
+ <appSettings>
+ <add key="webpages:Enabled" value="false" />
+ </appSettings>
+
+ <system.webServer>
+ <handlers>
+ <remove name="BlockViewHandler"/>
+ <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
+ </handlers>
+ </system.webServer>
</configuration>]]>
</File>
</TemplateFiles>
diff --git a/main/src/addins/AspNet/Templates/MvcCommon/HomeControllerTest.cs b/main/src/addins/AspNet/Templates/MvcCommon/HomeControllerTest.cs
index 1ae3e934c3..ab6fddeb3e 100644
--- a/main/src/addins/AspNet/Templates/MvcCommon/HomeControllerTest.cs
+++ b/main/src/addins/AspNet/Templates/MvcCommon/HomeControllerTest.cs
@@ -24,7 +24,7 @@ namespace ${Namespace}
var mvcName = typeof(Controller).Assembly.GetName ();
var isMono = Type.GetType ("Mono.Runtime") != null;
- var expectedVersion = mvcName.Version.Major;
+ var expectedVersion = mvcName.Version.Major + "." + mvcName.Version.Minor;
var expectedRuntime = isMono? "Mono" : ".NET";
// Assert
diff --git a/main/src/addins/AspNet/Templates/Projects/EmptyMvcProject.xpt.xml b/main/src/addins/AspNet/Templates/Projects/EmptyMvcProject.xpt.xml
deleted file mode 100644
index b2bb7d0318..0000000000
--- a/main/src/addins/AspNet/Templates/Projects/EmptyMvcProject.xpt.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0"?>
-<Template originator="Michael Hutchinson"
- created="2009/02/17"
- lastModified="2012/05/17">
-
- <!-- Template Header -->
- <TemplateConfiguration>
- <_Name>Empty ASP.NET MVC Project</_Name>
- <Category>other/aspnet/general</Category>
- <Icon>md-project-web</Icon>
- <Image id="md-aspnet-empty-project" />
- <LanguageName>C#</LanguageName>
- <_Description>Creates an empty ASP.NET MVC Web Project.</_Description>
- </TemplateConfiguration>
-
- <!-- Actions -->
- <Actions>
- </Actions>
-
- <!-- Template Content -->
- <Combine name = "${ProjectName}" directory = ".">
- <Options>
- <StartupProject>${ProjectName}</StartupProject>
- </Options>
-
- <Project name = "${ProjectName}" directory = "." type = "AspNetApp">
- <Options TargetFrameworkVersion = "4.5" />
- <References>
- <Reference type="Package" refto="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <Reference type="Package" refto="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <Reference type="Package" refto="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <Reference type="Package" refto="System.Core" />
- <Reference type="Package" refto="System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <Reference type="Package" refto="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
- <Reference type="Package" refto="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
- <Reference type="Package" refto="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
- <Reference type="Package" refto="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
- <Reference type="Package" refto="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
- <Reference type="Package" refto="System.Xml.Linq" />
- <Reference type="Package" refto="System.Core" />
- <Reference type="Package" refto="Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- </References>
- <Packages>
- <Package Id="Microsoft.AspNet.Mvc" Version="5.2"/>
- </Packages>
- <Files>
- <Directory name="Content" />
- <Directory name="Controllers" />
- <Directory name="Models" />
- <Directory name="Scripts" />
- <Directory name="Views">
- <FileTemplateReference TemplateID="AspMvcWebConfigViews" name="Web.config" SuppressAutoOpen="true" />
- </Directory>
- <FileTemplateReference TemplateID="AspMvcWebConfigApp" name="Web.config" SuppressAutoOpen="true" />
- <FileTemplateReference TemplateID="AspMvcGlobalAsax" name="Global.asax" SuppressAutoOpen="true" />
- </Files>
- </Project>
- </Combine>
-</Template>
diff --git a/main/src/addins/AspNet/Templates/Projects/EmptyProject.xpt.xml b/main/src/addins/AspNet/Templates/Projects/EmptyProject.xpt.xml
index 80e5b1f6ae..7c60a760a3 100644
--- a/main/src/addins/AspNet/Templates/Projects/EmptyProject.xpt.xml
+++ b/main/src/addins/AspNet/Templates/Projects/EmptyProject.xpt.xml
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
-<Template originator="Michael Hutchinson"
- created="2006/06/06"
- lastModified="2006/06/06">
+<Template originator="Michael Hutchinson"
+ created="2009/02/17"
+ lastModified="2012/05/17">
<!-- Template Header -->
<TemplateConfiguration>
@@ -10,7 +10,9 @@
<Icon>md-project-web</Icon>
<Image id="md-aspnet-empty-project" />
<LanguageName>C#</LanguageName>
- <_Description>Creates an empty ASP.NET Web Application project.</_Description>
+ <_Description>Creates an empty ASP.NET Web Project.</_Description>
+ <Wizard>MonoDevelop.AspNet.ProjectTemplateWizard</Wizard>
+ <SupportedParameters>UsesAspNetMvc;UsesAspNetWebApi</SupportedParameters>
</TemplateConfiguration>
<!-- Actions -->
@@ -24,14 +26,67 @@
</Options>
<Project name = "${ProjectName}" directory = "." type = "AspNetApp">
- <Options />
+ <Options TargetFrameworkVersion = "4.5" />
<References>
- <Reference type="Package" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <Reference type="Package" refto="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <Reference type="Package" refto="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <Reference type="Package" refto="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <Reference type="Package" refto="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <Reference type="Package" refto="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <Reference type="Package" refto="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <Reference type="Package" refto="System.Core" />
+ <Reference type="Package" refto="System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <Reference type="Package" refto="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
+ <Reference type="Package" refto="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+ <Reference type="Package" refto="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
+ <Reference type="Package" refto="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+ <Reference type="Package" refto="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
+ <Reference type="Package" refto="System.Xml.Linq" />
+ <Reference type="Package" refto="System.Core" />
+ <Reference type="Package" refto="Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</References>
+ <Packages>
+ <Package Id="Microsoft.AspNet.Mvc" Version="5.2.3" if="UsesAspNetMvc" />
+ <Package id="Microsoft.AspNet.WebApi" version="5.2.3" if="UsesAspNetWebApi" />
+ <package id="Newtonsoft.Json" version="6.0.8" if="UsesAspNetWebApi" />
+ </Packages>
<Files>
+ <Directory name="Content" if="UsesAspNetMvc" />
+ <Directory name="Controllers" if="UsesAspNetMvc" />
+ <Directory name="Models" if="UsesAspNetMvc" />
+ <Directory name="Scripts" if="UsesAspNetMvc" />
+ <Directory name="Views" if="UsesAspNetMvc">
+ <FileTemplateReference TemplateID="AspMvcWebConfigViews" name="Web.config" SuppressAutoOpen="true" />
+ </Directory>
+ <FileTemplateReference TemplateID="WebConfig-Application" name="Web.config" SuppressAutoOpen="true" />
+ <FileTemplateReference TemplateID="GlobalAsax" name="Global.asax" SuppressAutoOpen="true" />
+ </Files>
+ </Project>
+ <Project name = "${ProjectName}.Tests" directory = "${ProjectName}.Tests" if="IncludeTestProject">
+ <Options Target = "Library" TargetFrameworkVersion = "4.5" />
+ <References>
+ <Reference type="Package" refto="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <Reference type="Package" refto="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <Reference type="Package" refto="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <Reference type="Package" refto="System.Core" />
+ <Reference type="Package" refto="System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <Reference type="Package" refto="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
+ <Reference type="Package" refto="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+ <Reference type="Package" refto="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
+ <Reference type="Package" refto="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+ <Reference type="Package" refto="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
+ <Reference type="Package" refto="System.Xml.Linq" />
+ <Reference type="Package" refto="Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <Reference type="Project" refto="${ProjectName}" />
+ </References>
+ <Packages>
+ <Package ID="NUnit" Version="2.6.4" />
+ <Package ID="Microsoft.AspNet.Mvc" Version="5.2.3" if="UsesAspNetMvc"/>
+ <Package id="Microsoft.AspNet.WebApi" version="5.2.3" if="UsesAspNetWebApi" />
+ <package id="Newtonsoft.Json" version="6.0.8" if="UsesAspNetWebApi" />
+ </Packages>
+ <Files>
+ <Directory name="Controllers" if="UsesAspNetMvc">
+ <File name="Test.cs" src="Files/Test.cs" />
+ </Directory>
+ <File name="Test.cs" src="Files/Test.cs" if="!UsesAspNetMvc" />
</Files>
</Project>
</Combine>
diff --git a/main/src/addins/AspNet/Templates/Projects/Files/Default.aspx b/main/src/addins/AspNet/Templates/Projects/Files/Default.aspx
new file mode 100644
index 0000000000..bc57610bad
--- /dev/null
+++ b/main/src/addins/AspNet/Templates/Projects/Files/Default.aspx
@@ -0,0 +1,12 @@
+<%@ Page Language="C#" Inherits="${Namespace}.${EscapedIdentifier}" %>
+<!DOCTYPE html>
+<html>
+<head runat="server">
+ <title>${Name}</title>
+</head>
+<body>
+ <form id="form1" runat="server">
+ <asp:Button id="button1" runat="server" Text="Click me!" OnClick="button1Clicked" />
+ </form>
+</body>
+</html> \ No newline at end of file
diff --git a/main/src/addins/AspNet/Templates/Projects/Files/Default.aspx.cs b/main/src/addins/AspNet/Templates/Projects/Files/Default.aspx.cs
new file mode 100644
index 0000000000..b32fba12c6
--- /dev/null
+++ b/main/src/addins/AspNet/Templates/Projects/Files/Default.aspx.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Web;
+using System.Web.UI;
+
+namespace ${Namespace} {
+
+ public partial class ${EscapedIdentifier} : System.Web.UI.Page
+ {
+ public void button1Clicked (object sender, EventArgs args)
+ {
+ button1.Text = "You clicked me";
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/AspNet/Templates/Projects/Files/Default.aspx.designer.cs b/main/src/addins/AspNet/Templates/Projects/Files/Default.aspx.designer.cs
new file mode 100644
index 0000000000..fd7b24f3f5
--- /dev/null
+++ b/main/src/addins/AspNet/Templates/Projects/Files/Default.aspx.designer.cs
@@ -0,0 +1,11 @@
+using System;
+using System.Web;
+using System.Web.UI;
+
+namespace ${Namespace} {
+
+ public partial class ${EscapedIdentifier}
+ {
+ protected System.Web.UI.WebControls.Button button1;
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/AspNet/Templates/Projects/Files/RouteConfig.cs b/main/src/addins/AspNet/Templates/Projects/Files/RouteConfig.cs
deleted file mode 100644
index 89330994d8..0000000000
--- a/main/src/addins/AspNet/Templates/Projects/Files/RouteConfig.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// RouteConfig.cs
-//
-// Author:
-// Michael Hutchinson <mhutch@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-
-namespace MonoDevelop.AspNet.Templates.Projects.Files
-{
- public class RouteConfig
- {
- public RouteConfig ()
- {
- }
- }
-}
-
diff --git a/main/src/addins/AspNet/Templates/Projects/Files/Test.cs b/main/src/addins/AspNet/Templates/Projects/Files/Test.cs
new file mode 100644
index 0000000000..56790fd50c
--- /dev/null
+++ b/main/src/addins/AspNet/Templates/Projects/Files/Test.cs
@@ -0,0 +1,14 @@
+using NUnit.Framework;
+using System;
+
+namespace ${Namespace}
+{
+ [TestFixture]
+ public class Test
+ {
+ [Test]
+ public void TestCase ()
+ {
+ }
+ }
+}
diff --git a/main/src/addins/AspNet/Templates/Projects/MvcProject.xpt.xml b/main/src/addins/AspNet/Templates/Projects/MvcProject.xpt.xml
index 05398f1b7e..f4f7171077 100644
--- a/main/src/addins/AspNet/Templates/Projects/MvcProject.xpt.xml
+++ b/main/src/addins/AspNet/Templates/Projects/MvcProject.xpt.xml
@@ -1,7 +1,7 @@
-<?xml version="1.0"?>
+<?xml version="1.0"?>
<Template originator="Piotr Dowgiallo"
- created="2012/05/16"
- lastModified="2012/05/16">
+ created="2012/06/05"
+ lastModified="2012/06/05">
<!-- Template Header -->
<TemplateConfiguration>
@@ -10,7 +10,10 @@
<Icon>md-project-web</Icon>
<Image id="md-aspnet-empty-project" />
<LanguageName>C#</LanguageName>
- <_Description>Creates an ASP.NET MVC Web Project.</_Description>
+ <_Description>Creates an ASP.NET MVC Web Project with Razor Views.</_Description>
+ <Wizard>MonoDevelop.AspNet.ProjectTemplateWizard</Wizard>
+ <DefaultParameters>UsesAspNetMvc=true</DefaultParameters>
+ <SupportedParameters>UsesAspNetWebApi</SupportedParameters>
</TemplateConfiguration>
@@ -39,12 +42,14 @@
<Reference type="Package" refto="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<Reference type="Package" refto="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
<Reference type="Package" refto="System.Xml.Linq" />
- <Reference type="Package" refto="Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- </References>
- <Packages>
- <Package ID="Microsoft.AspNet.Mvc" Version="5.2" />
- </Packages>
- <Files>
+ <Reference type="Package" refto="Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ </References>
+ <Packages>
+ <Package ID="Microsoft.AspNet.Mvc" Version="5.2.3" />
+ <Package id="Microsoft.AspNet.WebApi" version="5.2.3" if="UsesAspNetWebApi" />
+ <package id="Newtonsoft.Json" version="6.0.8" if="UsesAspNetWebApi" />
+ </Packages>
+ <Files>
<Directory name="Content" />
<Directory name="Controllers">
<File name="HomeController.cs" src="../MvcCommon/HomeController.cs" />
@@ -54,38 +59,45 @@
<Directory name="Views">
<FileTemplateReference TemplateID="AspMvcWebConfigViews" name="Web.config" SuppressAutoOpen="true" />
<Directory name="Home">
- <File name="Index.aspx">
-<![CDATA[<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
-<!DOCTYPE html>
-<html>
-<head runat="server">
- <title></title>
-</head>
-<body>
- <h2>Welcome to ASP.NET MVC <%: ViewData["Version"] %> on <%: ViewData["Runtime"] %>!</h2>
-</body>
-]]>
- </File>
+ <File name="Index.cshtml" src="../MvcCommon/Index.cshtml" />
</Directory>
<Directory name="Shared">
- <File name="Error.aspx">
-<![CDATA[<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
-<!DOCTYPE html>
-<html>
-<head>
- <title>Error</title>
-</head>
-<body>
- <div>
- <h2>An error occurred while processing your request.</h2>
- </div>
-</body>
-]]>
- </File>
+ <File name="_Layout.cshtml" src="../MvcCommon/_Layout.cshtml" />
+ <File name="Error.cshtml" src="../MvcCommon/Error.cshtml" />
</Directory>
+ <File name="_ViewStart.cshtml" src="../MvcCommon/_ViewStart.cshtml" />
+ </Directory>
+ <FileTemplateReference TemplateID="WebConfig-Application" name="Web.config" SuppressAutoOpen="true" />
+ <FileTemplateReference TemplateID="GlobalAsax" name="Global.asax" SuppressAutoOpen="true" />
+ </Files>
+ </Project>
+ <Project name = "${ProjectName}.Tests" directory = "${ProjectName}.Tests" if="IncludeTestProject">
+ <Options Target = "Library" TargetFrameworkVersion = "4.5" />
+ <References>
+ <Reference type="Package" refto="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <Reference type="Package" refto="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <Reference type="Package" refto="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <Reference type="Package" refto="System.Core" />
+ <Reference type="Package" refto="System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <Reference type="Package" refto="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
+ <Reference type="Package" refto="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+ <Reference type="Package" refto="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
+ <Reference type="Package" refto="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+ <Reference type="Package" refto="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
+ <Reference type="Package" refto="System.Xml.Linq" />
+ <Reference type="Package" refto="Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <Reference type="Project" refto="${ProjectName}" />
+ </References>
+ <Packages>
+ <Package ID="NUnit" Version="2.6.4" />
+ <Package ID="Microsoft.AspNet.Mvc" Version="5.2.3" />
+ <Package id="Microsoft.AspNet.WebApi" version="5.2.3" if="UsesAspNetWebApi" />
+ <package id="Newtonsoft.Json" version="6.0.8" if="UsesAspNetWebApi" />
+ </Packages>
+ <Files>
+ <Directory name="Controllers">
+ <File name="HomeControllerTest.cs" src="../MvcCommon/HomeControllerTest.cs" />
</Directory>
- <FileTemplateReference TemplateID="AspMvcWebConfigApp" name="Web.config" SuppressAutoOpen="true" />
- <FileTemplateReference TemplateID="AspMvcGlobalAsax" name="Global.asax" SuppressAutoOpen="true" />
</Files>
</Project>
</Combine>
diff --git a/main/src/addins/AspNet/Templates/Projects/MvcProjectWithUnitTest.xpt.xml b/main/src/addins/AspNet/Templates/Projects/MvcProjectWithUnitTest.xpt.xml
deleted file mode 100644
index 461e8a19a3..0000000000
--- a/main/src/addins/AspNet/Templates/Projects/MvcProjectWithUnitTest.xpt.xml
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0"?>
-<Template originator="Piotr Dowgiallo"
- created="2012/06/05"
- lastModified="2012/06/05">
-
- <!-- Template Header -->
- <TemplateConfiguration>
- <_Name>ASP.NET MVC Project with Unit Tests</_Name>
- <Category>other/aspnet/general</Category>
- <Icon>md-project-web</Icon>
- <Image id="md-aspnet-empty-project" />
- <LanguageName>C#</LanguageName>
- <_Description>Creates an ASP.NET MVC Web Project with a Unit Test Project.</_Description>
- </TemplateConfiguration>
-
-
- <!-- Actions -->
- <Actions>
- <Open filename = "Controllers/HomeController.cs"/>
- </Actions>
-
- <!-- Template Content -->
- <Combine name = "${ProjectName}" directory = ".">
- <Options>
- <StartupProject>${ProjectName}</StartupProject>
- </Options>
-
- <Project name = "${ProjectName}" directory = "." type = "AspNetApp">
- <Options TargetFrameworkVersion = "4.5" />
- <References>
- <Reference type="Package" refto="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <Reference type="Package" refto="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <Reference type="Package" refto="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <Reference type="Package" refto="System.Core" />
- <Reference type="Package" refto="System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <Reference type="Package" refto="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
- <Reference type="Package" refto="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
- <Reference type="Package" refto="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
- <Reference type="Package" refto="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
- <Reference type="Package" refto="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
- <Reference type="Package" refto="System.Xml.Linq" />
- <Reference type="Package" refto="Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- </References>
- <Packages>
- <Package ID="Microsoft.AspNet.Mvc" Version="5.2" />
- </Packages>
- <Files>
- <Directory name="Content" />
- <Directory name="Controllers">
- <File name="HomeController.cs" src="../MvcCommon/HomeController.cs" />
- </Directory>
- <Directory name="Models" />
- <Directory name="Scripts" />
- <Directory name="Views">
- <FileTemplateReference TemplateID="AspMvcWebConfigViews" name="Web.config" SuppressAutoOpen="true" />
- <Directory name="Home">
- <File name="Index.aspx">
-<![CDATA[<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
-<!DOCTYPE html>
-<html>
-<head runat="server">
- <title></title>
-</head>
-<body>
- <h2>Welcome to ASP.NET MVC <%: ViewData["Version"] %> on <%: ViewData["Runtime"] %>!</h2>
-</body>
-]]>
- </File>
- </Directory>
- <Directory name="Shared">
- <File name="Error.aspx">
-<![CDATA[<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
-<!DOCTYPE html>
-<html>
-<head>
- <title>Error</title>
-</head>
-<body>
- <div>
- <h2>An error occurred while processing your request.</h2>
- </div>
-</body>
-]]>
- </File>
- </Directory>
- </Directory>
- <FileTemplateReference TemplateID="AspMvcWebConfigApp" name="Web.config" SuppressAutoOpen="true" />
- <FileTemplateReference TemplateID="AspMvcGlobalAsax" name="Global.asax" SuppressAutoOpen="true" />
- </Files>
- </Project>
- <Project name = "${ProjectName}.Tests" directory = "${ProjectName}.Tests">
- <Options Target = "Library" TargetFrameworkVersion = "4.5" />
- <References>
- <Reference type="Package" refto="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <Reference type="Package" refto="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <Reference type="Package" refto="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <Reference type="Package" refto="System.Core" />
- <Reference type="Package" refto="System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <Reference type="Package" refto="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
- <Reference type="Package" refto="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
- <Reference type="Package" refto="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
- <Reference type="Package" refto="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
- <Reference type="Package" refto="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
- <Reference type="Package" refto="System.Xml.Linq" />
- <Reference type="Package" refto="Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <Reference type="Project" refto="${ProjectName}" />
- </References>
- <Packages>
- <Package ID="Microsoft.AspNet.Mvc" Version="5.2" />
- <Package ID="NUnit" Version="2.6.3" />
- </Packages>
- <Files>
- <Directory name="Controllers">
- <File name="HomeControllerTest.cs" src="../MvcCommon/HomeControllerTest.cs" />
- </Directory>
- </Files>
- </Project>
- </Combine>
-</Template> \ No newline at end of file
diff --git a/main/src/addins/AspNet/Templates/Projects/MvcRazorProject.xpt.xml b/main/src/addins/AspNet/Templates/Projects/MvcRazorProject.xpt.xml
deleted file mode 100644
index 94f7e6a3a9..0000000000
--- a/main/src/addins/AspNet/Templates/Projects/MvcRazorProject.xpt.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0"?>
-<Template originator="Piotr Dowgiallo"
- created="2012/06/04"
- lastModified="2012/06/04">
-
- <!-- Template Header -->
- <TemplateConfiguration>
- <_Name>ASP.NET MVC Razor Project</_Name>
- <Category>other/aspnet/general</Category>
- <Icon>md-project-web</Icon>
- <Image id="md-aspnet-empty-project" />
- <LanguageName>C#</LanguageName>
- <_Description>Creates an ASP.NET MVC Project with Razor Views.</_Description>
- <GroupId>md-mvc-razor-project</GroupId>
- </TemplateConfiguration>
-
-
- <!-- Actions -->
- <Actions>
- <Open filename = "Controllers/HomeController.cs"/>
- </Actions>
-
- <!-- Template Content -->
- <Combine name = "${ProjectName}" directory = ".">
- <Options>
- <StartupProject>${ProjectName}</StartupProject>
- </Options>
-
- <Project name = "${ProjectName}" directory = "." type = "AspNetApp">
- <Options TargetFrameworkVersion = "4.5" />
- <References>
- <Reference type="Package" refto="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <Reference type="Package" refto="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <Reference type="Package" refto="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <Reference type="Package" refto="System.Core" />
- <Reference type="Package" refto="System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <Reference type="Package" refto="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
- <Reference type="Package" refto="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
- <Reference type="Package" refto="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
- <Reference type="Package" refto="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
- <Reference type="Package" refto="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
- <Reference type="Package" refto="System.Xml.Linq" />
- <Reference type="Package" refto="Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- </References>
- <Packages>
- <Package ID="Microsoft.AspNet.Mvc" Version="5.2" />
- </Packages>
- <Files>
- <Directory name="Content" />
- <Directory name="Controllers">
- <File name="HomeController.cs" src="../MvcCommon/HomeController.cs" />
- </Directory>
- <Directory name="Models" />
- <Directory name="Scripts" />
- <Directory name="Views">
- <FileTemplateReference TemplateID="AspMvcWebConfigViews" name="Web.config" SuppressAutoOpen="true" />
- <Directory name="Home">
- <File name="Index.cshtml" src="../MvcCommon/Index.cshtml" />
- </Directory>
- <Directory name="Shared">
- <File name="_Layout.cshtml" src="../MvcCommon/_Layout.cshtml" />
- <File name="Error.cshtml" src="../MvcCommon/Error.cshtml" />
- </Directory>
- <File name="_ViewStart.cshtml" src="../MvcCommon/_ViewStart.cshtml" />
- </Directory>
- <FileTemplateReference TemplateID="AspMvcWebConfigApp" name="Web.config" SuppressAutoOpen="true" />
- <FileTemplateReference TemplateID="AspMvcGlobalAsax" name="Global.asax" SuppressAutoOpen="true" />
- </Files>
- </Project>
- </Combine>
-</Template>
diff --git a/main/src/addins/AspNet/Templates/Projects/MvcRazorProjectWithUnitTest.xpt.xml b/main/src/addins/AspNet/Templates/Projects/MvcRazorProjectWithUnitTest.xpt.xml
deleted file mode 100644
index abda80aecb..0000000000
--- a/main/src/addins/AspNet/Templates/Projects/MvcRazorProjectWithUnitTest.xpt.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0"?>
-<Template originator="Piotr Dowgiallo"
- created="2012/06/05"
- lastModified="2012/06/05">
-
- <!-- Template Header -->
- <TemplateConfiguration>
- <_Name>ASP.NET MVC Razor Project with Unit Tests</_Name>
- <Category>other/aspnet/general</Category>
- <Icon>md-project-web</Icon>
- <Image id="md-aspnet-empty-project" />
- <LanguageName>C#</LanguageName>
- <_Description>Creates an ASP.NET MVC Web Project with Razor Views and a Unit Test Project.</_Description>
- </TemplateConfiguration>
-
-
- <!-- Actions -->
- <Actions>
- <Open filename = "Controllers/HomeController.cs"/>
- </Actions>
-
- <!-- Template Content -->
- <Combine name = "${ProjectName}" directory = ".">
- <Options>
- <StartupProject>${ProjectName}</StartupProject>
- </Options>
-
- <Project name = "${ProjectName}" directory = "." type = "AspNetApp">
- <Options TargetFrameworkVersion = "4.5" />
- <References>
- <Reference type="Package" refto="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <Reference type="Package" refto="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <Reference type="Package" refto="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <Reference type="Package" refto="System.Core" />
- <Reference type="Package" refto="System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <Reference type="Package" refto="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
- <Reference type="Package" refto="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
- <Reference type="Package" refto="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
- <Reference type="Package" refto="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
- <Reference type="Package" refto="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
- <Reference type="Package" refto="System.Xml.Linq" />
- <Reference type="Package" refto="Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- </References>
- <Packages>
- <Package ID="Microsoft.AspNet.Mvc" Version="5.2" />
- </Packages>
- <Files>
- <Directory name="Content" />
- <Directory name="Controllers">
- <File name="HomeController.cs" src="../MvcCommon/HomeController.cs" />
- </Directory>
- <Directory name="Models" />
- <Directory name="Scripts" />
- <Directory name="Views">
- <FileTemplateReference TemplateID="AspMvcWebConfigViews" name="Web.config" SuppressAutoOpen="true" />
- <Directory name="Home">
- <File name="Index.cshtml" src="../MvcCommon/Index.cshtml" />
- </Directory>
- <Directory name="Shared">
- <File name="_Layout.cshtml" src="../MvcCommon/_Layout.cshtml" />
- <File name="Error.cshtml" src="../MvcCommon/Error.cshtml" />
- </Directory>
- <File name="_ViewStart.cshtml" src="../MvcCommon/_ViewStart.cshtml" />
- </Directory>
- <FileTemplateReference TemplateID="AspMvcWebConfigApp" name="Web.config" SuppressAutoOpen="true" />
- <FileTemplateReference TemplateID="AspMvcGlobalAsax" name="Global.asax" SuppressAutoOpen="true" />
- </Files>
- </Project>
- <Project name = "${ProjectName}.Tests" directory = "${ProjectName}.Tests">
- <Options Target = "Library" TargetFrameworkVersion = "4.5" />
- <References>
- <Reference type="Package" refto="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <Reference type="Package" refto="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <Reference type="Package" refto="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <Reference type="Package" refto="System.Core" />
- <Reference type="Package" refto="System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <Reference type="Package" refto="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
- <Reference type="Package" refto="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
- <Reference type="Package" refto="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
- <Reference type="Package" refto="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
- <Reference type="Package" refto="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
- <Reference type="Package" refto="System.Xml.Linq" />
- <Reference type="Package" refto="Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <Reference type="Project" refto="${ProjectName}" />
- </References>
- <Packages>
- <Package ID="Microsoft.AspNet.Mvc" Version="5.2" />
- <Package ID="NUnit" Version="2.6.3" />
- </Packages>
- <Files>
- <Directory name="Controllers">
- <File name="HomeControllerTest.cs" src="../MvcCommon/HomeControllerTest.cs" />
- </Directory>
- </Files>
- </Project>
- </Combine>
-</Template>
diff --git a/main/src/addins/AspNet/Templates/Projects/WebApplication.xpt.xml b/main/src/addins/AspNet/Templates/Projects/WebApplication.xpt.xml
deleted file mode 100644
index 0fe41abce8..0000000000
--- a/main/src/addins/AspNet/Templates/Projects/WebApplication.xpt.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0"?>
-<Template originator="Michael Hutchinson"
- created="2006/06/06"
- lastModified="2006/06/06">
-
- <!-- Template Header -->
- <TemplateConfiguration>
- <_Name>ASP.NET Project</_Name>
- <Category>other/aspnet/general</Category>
- <Icon>md-project-web</Icon>
- <Image id="md-aspnet-empty-project" />
- <LanguageName>C#</LanguageName>
- <_Description>Creates a new ASP.NET Web Application project.</_Description>
- </TemplateConfiguration>
-
- <!-- Actions -->
- <Actions>
- <Open filename = "Default.aspx"/>
- </Actions>
-
- <!-- Template Content -->
- <Combine name = "${ProjectName}" directory = ".">
- <Options>
- <StartupProject>${ProjectName}</StartupProject>
- </Options>
-
- <Project name = "${ProjectName}" directory = "." type = "AspNetApp">
- <Options />
- <References>
- <Reference type="Package" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <Reference type="Package" refto="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <Reference type="Package" refto="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <Reference type="Package" refto="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- </References>
- <Files>
- <FileTemplateReference TemplateID="GlobalAsax-CodeBehind" name="Global.asax" />
- <FileTemplateReference TemplateID="WebConfig-Application" name="web.config" />
-
- <File name="Default.aspx" DefaultExtension=".aspx">
-<![CDATA[<%@ Page Language="C#" Inherits="${Namespace}.${EscapedIdentifier}" %>
-<!DOCTYPE html>
-<html>
-<head runat="server">
- <title>${Name}</title>
-</head>
-<body>
- <form id="form1" runat="server">
- <asp:Button id="button1" runat="server" Text="Click me!" OnClick="button1Clicked" />
- </form>
-</body>
-</html>
-]]>
- </File>
- <File name="Default.aspx.cs">
-<![CDATA[using System;
-using System.Web;
-using System.Web.UI;
-
-namespace ${Namespace} {
-
- public partial class ${EscapedIdentifier} : System.Web.UI.Page
- {
- public void button1Clicked (object sender, EventArgs args)
- {
- button1.Text = "You clicked me";
- }
- }
-}
-]]>
- </File>
- <File name="Default.aspx.designer.cs" ShowAutogenerationNotice="True" AddStandardHeader="False" SuppressAutoOpen="True">
-<![CDATA[using System;
-using System.Web;
-using System.Web.UI;
-
-namespace ${Namespace} {
-
- public partial class ${EscapedIdentifier}
- {
- protected System.Web.UI.WebControls.Button button1;
- }
-}
-]]>
- </File>
- </Files>
- </Project>
- </Combine>
-</Template>
diff --git a/main/src/addins/AspNet/Templates/Projects/WebFormsProject.xpt.xml b/main/src/addins/AspNet/Templates/Projects/WebFormsProject.xpt.xml
new file mode 100644
index 0000000000..9f7a3e9f7a
--- /dev/null
+++ b/main/src/addins/AspNet/Templates/Projects/WebFormsProject.xpt.xml
@@ -0,0 +1,88 @@
+<?xml version="1.0"?>
+<Template originator="Michael Hutchinson"
+ created="2006/06/06"
+ lastModified="2006/06/06">
+
+ <!-- Template Header -->
+ <TemplateConfiguration>
+ <_Name>ASP.NET Web Forms Project</_Name>
+ <Category>other/aspnet/general</Category>
+ <Icon>md-project-web</Icon>
+ <Image id="md-aspnet-empty-project" />
+ <LanguageName>C#</LanguageName>
+ <_Description>Creates a new ASP.NET Web Forms Project.</_Description>
+ <Wizard>MonoDevelop.AspNet.ProjectTemplateWizard</Wizard>
+ <DefaultParameters>UsesAspNetWebForms=true</DefaultParameters>
+ <SupportedParameters>UsesAspNetWebApi;UsesAspNetMvc</SupportedParameters>
+ </TemplateConfiguration>
+
+ <!-- Actions -->
+ <Actions>
+ <Open filename = "Default.aspx"/>
+ </Actions>
+
+ <!-- Template Content -->
+ <Combine name = "${ProjectName}" directory = ".">
+ <Options>
+ <StartupProject>${ProjectName}</StartupProject>
+ </Options>
+
+ <Project name = "${ProjectName}" directory = "." type = "AspNetApp">
+ <Options />
+ <References>
+ <Reference type="Package" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <Reference type="Package" refto="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <Reference type="Package" refto="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <Reference type="Package" refto="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ </References>
+ <Packages>
+ <Package Id="Microsoft.AspNet.Mvc" Version="5.2.3" if="UsesAspNetMvc" />
+ <Package id="Microsoft.AspNet.WebApi" version="5.2.3" if="UsesAspNetWebApi" />
+ <package id="Newtonsoft.Json" version="6.0.8" if="UsesAspNetWebApi" />
+ </Packages>
+ <Files>
+ <Directory name="Content" if="UsesAspNetMvc" />
+ <Directory name="Controllers" if="UsesAspNetMvc" />
+ <Directory name="Models" if="UsesAspNetMvc" />
+ <Directory name="Scripts" if="UsesAspNetMvc" />
+ <Directory name="Views" if="UsesAspNetMvc">
+ <FileTemplateReference TemplateID="AspMvcWebConfigViews" name="Web.config" SuppressAutoOpen="true" />
+ </Directory>
+ <FileTemplateReference TemplateID="GlobalAsax" name="Global.asax" />
+ <FileTemplateReference TemplateID="WebConfig-Application" name="web.config" />
+
+ <File name="Default.aspx" src="Files/Default.aspx" />
+ <File name="Default.aspx.cs" src="Files/Default.aspx.cs" />
+ <File name="Default.aspx.designer.cs" src="Files/Default.aspx.designer.cs" ShowAutogenerationNotice="True" AddStandardHeader="False" SuppressAutoOpen="True" />
+ </Files>
+ </Project>
+ <Project name = "${ProjectName}.Tests" directory = "${ProjectName}.Tests" if="IncludeTestProject">
+ <Options Target = "Library" TargetFrameworkVersion = "4.5" />
+ <References>
+ <Reference type="Package" refto="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <Reference type="Package" refto="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <Reference type="Package" refto="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <Reference type="Package" refto="System.Core" />
+ <Reference type="Package" refto="System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <Reference type="Package" refto="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
+ <Reference type="Package" refto="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+ <Reference type="Package" refto="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
+ <Reference type="Package" refto="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
+ <Reference type="Package" refto="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" SpecificVersion="false" />
+ <Reference type="Package" refto="System.Xml.Linq" />
+ <Reference type="Package" refto="Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <Reference type="Project" refto="${ProjectName}" />
+ </References>
+ <Packages>
+ <Package ID="NUnit" Version="2.6.4" />
+ <Package ID="Microsoft.AspNet.Mvc" Version="5.2.3" if="UsesAspNetMvc"/>
+ <Package id="Microsoft.AspNet.WebApi" version="5.2.3" if=" " />
+ <package id="Newtonsoft.Json" version="6.0.8" if=" " />
+ </Packages>
+ <Files>
+ <Directory name="Controllers" if="UsesAspNetMvc" />
+ <File name="Test.cs" src="Files/Test.cs" />
+ </Files>
+ </Project>
+ </Combine>
+</Template>
diff --git a/main/src/addins/AspNet/Templates/RouteConfig.cs b/main/src/addins/AspNet/Templates/RouteConfig.cs
new file mode 100644
index 0000000000..a6bf882278
--- /dev/null
+++ b/main/src/addins/AspNet/Templates/RouteConfig.cs
@@ -0,0 +1,19 @@
+using System.Web.Mvc;
+using System.Web.Routing;
+
+namespace ${Namespace}
+{
+ public class RouteConfig
+ {
+ public static void RegisterRoutes(RouteCollection routes)
+ {
+ routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
+
+ routes.MapRoute(
+ name: "Default",
+ url: "{controller}/{action}/{id}",
+ defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
+ );
+ }
+ }
+}
diff --git a/main/src/addins/AspNet/Templates/WebApiConfig.cs b/main/src/addins/AspNet/Templates/WebApiConfig.cs
new file mode 100644
index 0000000000..58b9d5332c
--- /dev/null
+++ b/main/src/addins/AspNet/Templates/WebApiConfig.cs
@@ -0,0 +1,21 @@
+using System.Web.Http;
+
+namespace ${Namespace}
+{
+ public static class WebApiConfig
+ {
+ public static void Register(HttpConfiguration config)
+ {
+ // Web API configuration and services
+
+ // Web API routes
+ config.MapHttpAttributeRoutes();
+
+ config.Routes.MapHttpRoute(
+ name: "DefaultApi",
+ routeTemplate: "api/{controller}/{id}",
+ defaults: new { id = RouteParameter.Optional }
+ );
+ }
+ }
+}
diff --git a/main/src/addins/AspNet/Templates/WebConfig-Application.xft.xml b/main/src/addins/AspNet/Templates/WebConfig-Application.xft.xml
index 954d3d418c..41e786594e 100644
--- a/main/src/addins/AspNet/Templates/WebConfig-Application.xft.xml
+++ b/main/src/addins/AspNet/Templates/WebConfig-Application.xft.xml
@@ -11,17 +11,17 @@
<Icon>md-html-file-icon</Icon>
<LanguageName>C#</LanguageName>
<ProjectType>AspNetApp</ProjectType>
- <DefaultFilename IsFixed="True">web.config</DefaultFilename>
- <_Description>Creates an ASP.NET web.config file for an application.</_Description>
+ <DefaultFilename IsFixed="True">Web.config</DefaultFilename>
+ <_Description>Creates an ASP.NET Web.config file for an application.</_Description>
</TemplateConfiguration>
<Conditions>
- <ParentProject PermittedCreationPaths="" ExcludedFiles="web.config" RequireProject="True"/>
+ <ParentProject PermittedCreationPaths="" ExcludedFiles="Web.config" RequireProject="True"/>
</Conditions>
<!-- Template Content -->
<TemplateFiles>
- <File name="web.config">
+ <File name="Web.config">
<![CDATA[<?xml version="1.0" ?>
<!--
Web.config file for ${ProjectName}.
@@ -31,53 +31,9 @@ http://www.mono-project.com/Config_system.web and
http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
-->
<configuration>
- <system.web>
- <compilation
- defaultLanguage="C#"
- debug="true"
- >
- <assemblies>
- </assemblies>
- </compilation>
-
- <customErrors
- mode="RemoteOnly"
- >
- </customErrors>
-
- <authentication
- mode="None"
- >
- </authentication>
-
- <authorization>
- <allow users="*" />
- </authorization>
-
- <httpHandlers>
- </httpHandlers>
-
- <trace
- enabled="false"
- localOnly="true"
- pageOutput="false"
- requestLimit="10"
- traceMode="SortByTime"
- />
-
- <sessionState
- mode="InProc"
- cookieless="false"
- timeout="20"
- />
-
- <globalization
- requestEncoding="utf-8"
- responseEncoding="utf-8"
- />
-
- <pages>
- </pages>
+ <system.web>
+ <compilation debug="true" targetFramework="4.5" />
+ <httpRuntime targetFramework="4.5" />
</system.web>
</configuration>
]]>
diff --git a/main/src/addins/AspNet/Templates/WebForms/GlobalAsax-CodeBehind.xft.xml b/main/src/addins/AspNet/Templates/WebForms/GlobalAsax-CodeBehind.xft.xml
deleted file mode 100644
index caf20e8713..0000000000
--- a/main/src/addins/AspNet/Templates/WebForms/GlobalAsax-CodeBehind.xft.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0"?>
-<Template Originator="Michael Hutchinson"
- Created="2006/08/21"
- LastModified="2006/08/21">
-
- <!-- Template Header -->
- <TemplateConfiguration>
- <_Name>Global.asax with CodeBehind</_Name>
- <_Category>ASP.NET Web Forms</_Category>
- <Icon>md-html-file-icon</Icon>
- <LanguageName>C#</LanguageName>
- <ProjectType>AspNetApp</ProjectType>
- <DefaultFilename IsFixed="True">Global.asax</DefaultFilename>
- <_Description>Creates an ASP.NET Global.asax file with a CodeBehind class.</_Description>
- </TemplateConfiguration>
-
- <Conditions>
- <ParentProject PermittedCreationPaths="" ExcludedFiles="/Global.asax" />
- </Conditions>
-
- <!-- Template Content -->
- <TemplateFiles>
- <File name="Global.asax">
-<![CDATA[<%@ Application Inherits="${Namespace}.Global" %>]]>
- </File>
- <File name="Global.asax.cs" DependsOn="Global.asax" >
-<![CDATA[using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Web;
-using System.Web.SessionState;
-
-namespace ${Namespace}
-{
- public class Global : System.Web.HttpApplication
- {
- protected void Application_Start (Object sender, EventArgs e)
- {
-
- }
-
- protected void Session_Start (Object sender, EventArgs e)
- {
-
- }
-
- protected void Application_BeginRequest (Object sender, EventArgs e)
- {
-
- }
-
- protected void Application_EndRequest (Object sender, EventArgs e)
- {
-
- }
-
- protected void Application_AuthenticateRequest (Object sender, EventArgs e)
- {
-
- }
-
- protected void Application_Error (Object sender, EventArgs e)
- {
-
- }
-
- protected void Session_End (Object sender, EventArgs e)
- {
-
- }
-
- protected void Application_End (Object sender, EventArgs e)
- {
-
- }
- }
-}]]>
- </File>
- </TemplateFiles>
-</Template>
diff --git a/main/src/addins/AspNet/Templates/WebForms/GlobalAsax-Empty.xft.xml b/main/src/addins/AspNet/Templates/WebForms/GlobalAsax-Empty.xft.xml
deleted file mode 100644
index f525d6722c..0000000000
--- a/main/src/addins/AspNet/Templates/WebForms/GlobalAsax-Empty.xft.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0"?>
-<Template Originator="Michael Hutchinson"
- Created="2006/08/21"
- LastModified="2006/08/21">
-
- <!-- Template Header -->
- <TemplateConfiguration>
- <_Name>Global.asax</_Name>
- <_Category>ASP.NET Web Forms</_Category>
- <Icon>md-html-file-icon</Icon>
- <LanguageName>C#</LanguageName>
- <ProjectType>AspNetApp</ProjectType>
- <DefaultFilename IsFixed="True">Global.asax</DefaultFilename>
- <_Description>Creates an ASP.NET Global.asax file.</_Description>
- </TemplateConfiguration>
-
- <Conditions>
- <ParentProject PermittedCreationPaths="" ExcludedFiles="/Global.asax" />
- </Conditions>
-
- <!-- Template Content -->
- <TemplateFiles>
- <File name="Global.asax">
-<![CDATA[<%@ Application Language="C#" %>
-<script runat="server">
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Web;
-using System.Web.SessionState;
-
-namespace ${Namespace}
-{
- public class Global : System.Web.HttpApplication
- {
- protected void Application_Start (Object sender, EventArgs e)
- {
-
- }
-
- protected void Session_Start (Object sender, EventArgs e)
- {
-
- }
-
- protected void Application_BeginRequest (Object sender, EventArgs e)
- {
-
- }
-
- protected void Application_EndRequest (Object sender, EventArgs e)
- {
-
- }
-
- protected void Application_AuthenticateRequest (Object sender, EventArgs e)
- {
-
- }
-
- protected void Application_Error (Object sender, EventArgs e)
- {
-
- }
-
- protected void Session_End (Object sender, EventArgs e)
- {
-
- }
-
- protected void Application_End (Object sender, EventArgs e)
- {
-
- }
- }
-}]]>
- </File>
- </TemplateFiles>
-</Template>
diff --git a/main/src/addins/AspNet/Templates/images/aspnet-empty-project.png b/main/src/addins/AspNet/Templates/images/aspnet-empty-project.png
index 3fffa8a82b..df0b78b1f9 100644
--- a/main/src/addins/AspNet/Templates/images/aspnet-empty-project.png
+++ b/main/src/addins/AspNet/Templates/images/aspnet-empty-project.png
Binary files differ
diff --git a/main/src/addins/AspNet/Templates/images/aspnet-empty-project@2x.png b/main/src/addins/AspNet/Templates/images/aspnet-empty-project@2x.png
index 6451bfae20..7b4464f373 100644
--- a/main/src/addins/AspNet/Templates/images/aspnet-empty-project@2x.png
+++ b/main/src/addins/AspNet/Templates/images/aspnet-empty-project@2x.png
Binary files differ
diff --git a/main/src/addins/AspNet/Templates/images/aspnet-empty-project~dark.png b/main/src/addins/AspNet/Templates/images/aspnet-empty-project~dark.png
new file mode 100644
index 0000000000..54123c375a
--- /dev/null
+++ b/main/src/addins/AspNet/Templates/images/aspnet-empty-project~dark.png
Binary files differ
diff --git a/main/src/addins/AspNet/Templates/images/aspnet-empty-project~dark@2x.png b/main/src/addins/AspNet/Templates/images/aspnet-empty-project~dark@2x.png
new file mode 100644
index 0000000000..9e3cf6c4aa
--- /dev/null
+++ b/main/src/addins/AspNet/Templates/images/aspnet-empty-project~dark@2x.png
Binary files differ
diff --git a/main/src/addins/AspNet/Templates/images/aspnet-wizard-page.png b/main/src/addins/AspNet/Templates/images/aspnet-wizard-page.png
new file mode 100644
index 0000000000..a0cfc66c9e
--- /dev/null
+++ b/main/src/addins/AspNet/Templates/images/aspnet-wizard-page.png
Binary files differ
diff --git a/main/src/addins/AspNet/Templates/images/aspnet-wizard-page@2x.png b/main/src/addins/AspNet/Templates/images/aspnet-wizard-page@2x.png
new file mode 100644
index 0000000000..c8c6b1da38
--- /dev/null
+++ b/main/src/addins/AspNet/Templates/images/aspnet-wizard-page@2x.png
Binary files differ
diff --git a/main/src/addins/AspNet/Tests/MonoDevelop.AspNet.Tests.csproj b/main/src/addins/AspNet/Tests/MonoDevelop.AspNet.Tests.csproj
index 32b81dba69..1d1f24991c 100644
--- a/main/src/addins/AspNet/Tests/MonoDevelop.AspNet.Tests.csproj
+++ b/main/src/addins/AspNet/Tests/MonoDevelop.AspNet.Tests.csproj
@@ -38,6 +38,26 @@
<Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference Include="System.Reflection.Metadata">
+ <HintPath>..\..\..\..\external\roslyn\Binaries\Release\System.Reflection.Metadata.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Collections.Immutable">
+ <HintPath>..\..\..\..\external\roslyn\Binaries\Release\System.Collections.Immutable.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.Workspaces">
+ <HintPath>..\..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.Workspaces.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis">
+ <HintPath>..\..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.CSharp">
+ <HintPath>..\..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Razor\Dom\RazorCodeBlockParsingTests.cs" />
@@ -55,6 +75,8 @@
<Compile Include="Razor\RazorCompletionTests.cs" />
<Compile Include="Html\HtmlParsingTests.cs" />
<Compile Include="Html\HtmlImplicitClosingTests.cs" />
+ <Compile Include="Razor\Dom\RazorDocumentTrackerTests.cs" />
+ <Compile Include="Razor\RazorParserTests.cs" />
<Compile Include="WebForms\WebFormsSyntaxModeTests.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
diff --git a/main/src/addins/AspNet/Tests/Razor/Dom/RazorDocumentTrackerTests.cs b/main/src/addins/AspNet/Tests/Razor/Dom/RazorDocumentTrackerTests.cs
new file mode 100644
index 0000000000..f16fe1deb1
--- /dev/null
+++ b/main/src/addins/AspNet/Tests/Razor/Dom/RazorDocumentTrackerTests.cs
@@ -0,0 +1,79 @@
+//
+// RazorDocumentTrackerTests.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using MonoDevelop.AspNet.Razor.Dom;
+using MonoDevelop.AspNet.Razor.Parser;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Xml.Parser;
+using NUnit.Framework;
+using UnitTests;
+
+namespace MonoDevelop.AspNet.Tests.Razor.Dom
+{
+ [TestFixture]
+ public class RazorDocumentTrackerTests : TestBase
+ {
+ Func<ITextDocument> originalGetActiveDocument;
+ TextEditor editor;
+
+ [SetUp]
+ public void SetUp ()
+ {
+ originalGetActiveDocument = RazorWorkbenchService.GetActiveDocument;
+ editor = TextEditorFactory.CreateNewEditor ();
+ editor.MimeType = "text/x-cshtml";
+ RazorWorkbenchService.GetActiveDocument = () => {
+ return editor;
+ };
+ }
+
+ [TearDown]
+ public override void TearDown ()
+ {
+ RazorWorkbenchService.GetActiveDocument = originalGetActiveDocument;
+ base.TearDown ();
+ }
+
+ [Test]
+ public void StateShouldBeRazorRootStateAfterCodeBlock ()
+ {
+ editor.Text =
+@"@{
+}
+
+";
+ var parser = new XmlParser (new RazorRootState (), false);
+ var tracker = new DocumentStateTracker<XmlParser> (parser, editor);
+ editor.CaretLine = 3;
+ tracker.UpdateEngine ();
+
+ Assert.IsInstanceOf<RazorRootState> (tracker.Engine.CurrentState);
+ }
+ }
+}
+
diff --git a/main/src/addins/AspNet/Tests/Razor/RazorCompletionTesting.cs b/main/src/addins/AspNet/Tests/Razor/RazorCompletionTesting.cs
index 7da98546eb..a82c38ef35 100644
--- a/main/src/addins/AspNet/Tests/Razor/RazorCompletionTesting.cs
+++ b/main/src/addins/AspNet/Tests/Razor/RazorCompletionTesting.cs
@@ -1,34 +1,37 @@
-//
-// RazorCompletionTesting.cs
-//
-// Author:
-// Piotr Dowgiallo <sparekd@gmail.com>
-//
-// Copyright (c) 2012 Piotr Dowgiallo
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
+//
+// RazorCompletionTesting.cs
+//
+// Author:
+// Piotr Dowgiallo <sparekd@gmail.com>
+//
+// Copyright (c) 2012 Piotr Dowgiallo
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
using System.IO;
+using System.Threading;
+using System.Threading.Tasks;
using ICSharpCode.NRefactory.Completion;
using MonoDevelop.AspNet.Projects;
using MonoDevelop.AspNet.Razor;
using MonoDevelop.AspNet.Razor.Parser;
+using MonoDevelop.Core.Text;
using MonoDevelop.CSharpBinding;
using MonoDevelop.CSharpBinding.Tests;
using MonoDevelop.Ide.CodeCompletion;
@@ -41,47 +44,78 @@ namespace MonoDevelop.AspNet.Tests.Razor
//largely copied from MonoDevelop.AspNet.Tests.AspNetTesting
static class RazorCompletionTesting
- {
+ {
+// TODO: Roslyn port
static readonly string extension = ".cshtml";
- public static CompletionDataList CreateRazorCtrlSpaceProvider (string text, bool isInCSharpContext)
+ public static Task<CompletionDataList> CreateRazorCtrlSpaceProvider (string text, bool isInCSharpContext)
{
return CreateProvider (text, isInCSharpContext, true);
}
- public static CompletionDataList CreateProvider (string text, bool isInCSharpContext = false, bool isCtrlSpace = false)
+ public static async Task<CompletionDataList> CreateProvider (string text, bool isInCSharpContext = false, bool isCtrlSpace = false)
{
- string editorText;
- TestViewContent sev;
-
- var textEditorCompletion = CreateEditor (text, isInCSharpContext, out editorText, out sev);
+ var ed = await CreateEditor (text, isInCSharpContext);
int cursorPosition = text.IndexOf ('$');
- int triggerWordLength = 1;
- var ctx = textEditorCompletion.GetCodeCompletionContext (isInCSharpContext, sev);
+ var ctx = GetCodeCompletionContext (isInCSharpContext, ed.View, ed.Extension.hiddenInfo.UnderlyingDocument);
+
+ if (isCtrlSpace) {
+ var result = await ed.Extension.CodeCompletionCommand (ctx) as CompletionDataList;
+ TypeSystemServiceTestExtensions.UnloadSolution (solution);
+ return result;
+ } else {
+ var task = ed.Extension.HandleCodeCompletionAsync (ctx, ed.EditorText [cursorPosition - 1], default(CancellationToken));
+ TypeSystemServiceTestExtensions.UnloadSolution (solution);
+ if (task != null) {
+ return await task as CompletionDataList;
+ }
+ return null;
+ }
+ }
- if (isCtrlSpace)
- return textEditorCompletion.CodeCompletionCommand (ctx) as CompletionDataList;
+ static CodeCompletionContext GetCodeCompletionContext (bool cSharpContext, TestViewContent sev, UnderlyingDocument underlyingDocument)
+ {
+ var ctx = new CodeCompletionContext ();
+ if (!cSharpContext)
+ ctx.TriggerOffset = sev.CursorPosition;
else
- return textEditorCompletion.HandleCodeCompletion (ctx, editorText[cursorPosition - 1], ref triggerWordLength) as CompletionDataList;
+ ctx.TriggerOffset = underlyingDocument.Editor.CaretOffset;
+
+ int line, column;
+ sev.GetLineColumnFromPosition (ctx.TriggerOffset, out line, out column);
+ ctx.TriggerLine = line;
+ ctx.TriggerLineOffset = column - 1;
+
+ return ctx;
}
- public static IParameterDataProvider CreateProvider (string text)
+ public static async Task<ParameterHintingResult> CreateParameterProvider (string text)
{
- string editorText;
- TestViewContent sev;
+ var ed = await CreateEditor (text, true);
- var textEditorCompletion = CreateEditor (text, true, out editorText, out sev);
int cursorPosition = text.IndexOf ('$');
- var ctx = textEditorCompletion.GetCodeCompletionContext (true, sev);
- return textEditorCompletion.HandleParameterCompletion (ctx, editorText[cursorPosition - 1]);
+ var ctx = GetCodeCompletionContext (true, ed.View, ed.Extension.hiddenInfo.UnderlyingDocument);
+ var task = ed.Extension.HandleParameterCompletionAsync (ctx, ed.EditorText[cursorPosition - 1], default(CancellationToken));
+ if (task != null) {
+ return await task;
+ }
+ return null;
}
- static RazorTestingEditorExtension CreateEditor (string text, bool isInCSharpContext, out string editorText,
- out TestViewContent sev)
+ static Solution solution;
+
+ class EditorInfo
+ {
+ public RazorCSharpEditorExtension Extension;
+ public string EditorText;
+ public TestViewContent View;
+ }
+
+ static async Task<EditorInfo> CreateEditor (string text, bool isInCSharpContext)
{
- string parsedText;
+ string parsedText, editorText;
int cursorPosition = text.IndexOf ('$');
int endPos = text.IndexOf ('$', cursorPosition + 1);
if (endPos == -1)
@@ -92,17 +126,13 @@ namespace MonoDevelop.AspNet.Tests.Razor
cursorPosition = endPos - 1;
}
- var project = new AspNetAppProject ("C#");
+ var project = Services.ProjectService.CreateProject ("C#", "AspNetApp");
project.FileName = UnitTests.TestBase.GetTempFile (".csproj");
string file = UnitTests.TestBase.GetTempFile (extension);
project.AddFile (file);
- var pcw = TypeSystemService.LoadProject (project);
- TypeSystemService.ForceUpdate (pcw);
- pcw.ReconnectAssemblyReferences ();
-
- sev = new TestViewContent ();
+ var sev = new TestViewContent ();
sev.Project = project;
sev.ContentName = file;
sev.Text = editorText;
@@ -111,13 +141,32 @@ namespace MonoDevelop.AspNet.Tests.Razor
var tww = new TestWorkbenchWindow ();
tww.ViewContent = sev;
- var doc = new Document (tww);
+ var doc = new TestDocument (tww);
+ doc.Editor.FileName = sev.ContentName;
+ doc.UpdateProject (project);
+
+ solution = new MonoDevelop.Projects.Solution ();
+ solution.DefaultSolutionFolder.AddItem (project);
+ solution.AddConfiguration ("", true);
+ await TypeSystemServiceTestExtensions.LoadSolution (solution);
+
var parser = new RazorTestingParser {
Doc = doc
};
- var parsedDoc = parser.Parse (false, sev.ContentName, new StringReader (parsedText), project);
-
- return new RazorTestingEditorExtension (doc, parsedDoc as RazorCSharpParsedDocument, isInCSharpContext);
+ var options = new ParseOptions {
+ Project = project,
+ FileName = sev.ContentName,
+ Content = new StringTextSource (parsedText)
+ };
+ var parsedDoc = await parser.Parse (options, default(CancellationToken)) as RazorCSharpParsedDocument;
+ doc.HiddenParsedDocument = parsedDoc;
+
+ var editorExtension = new RazorCSharpEditorExtension (doc, parsedDoc as RazorCSharpParsedDocument, isInCSharpContext);
+ return new EditorInfo {
+ Extension = editorExtension,
+ EditorText = editorText,
+ View = sev
+ };
}
}
@@ -125,40 +174,11 @@ namespace MonoDevelop.AspNet.Tests.Razor
{
public Document Doc { get; set; }
- public override ParsedDocument Parse (bool storeAst, string fileName, System.IO.TextReader content, Project project = null)
- {
- Doc.Editor.Document.FileName = fileName;
- OpenDocuments.Add (Doc.Editor.Document);
- return base.Parse (storeAst, fileName, content, project);
- }
- }
-
- public class RazorTestingEditorExtension : RazorCSharpEditorExtension
- {
- public RazorTestingEditorExtension (Document doc, RazorCSharpParsedDocument parsedDoc, bool cSharpContext)
- {
- razorDocument = parsedDoc;
- Initialize (doc);
- if (cSharpContext) {
- InitializeCodeCompletion ();
- SwitchToHidden ();
- }
- }
-
- public CodeCompletionContext GetCodeCompletionContext (bool cSharpContext, TestViewContent sev)
+ public override System.Threading.Tasks.Task<ParsedDocument> Parse (ParseOptions parseOptions, System.Threading.CancellationToken cancellationToken)
{
- var ctx = new CodeCompletionContext ();
- if (!cSharpContext)
- ctx.TriggerOffset = sev.CursorPosition;
- else
- ctx.TriggerOffset = hiddenInfo.UnderlyingDocument.Editor.Caret.Offset;
-
- int line, column;
- sev.GetLineColumnFromPosition (ctx.TriggerOffset, out line, out column);
- ctx.TriggerLine = line;
- ctx.TriggerLineOffset = column - 1;
-
- return ctx;
+ Doc.Editor.FileName = parseOptions.FileName;
+ OpenDocuments.Add (new OpenRazorDocument (Doc.Editor));
+ return base.Parse (parseOptions, cancellationToken);
}
}
}
diff --git a/main/src/addins/AspNet/Tests/Razor/RazorCompletionTests.cs b/main/src/addins/AspNet/Tests/Razor/RazorCompletionTests.cs
index 98b36239c4..15bd1f5d40 100644
--- a/main/src/addins/AspNet/Tests/Razor/RazorCompletionTests.cs
+++ b/main/src/addins/AspNet/Tests/Razor/RazorCompletionTests.cs
@@ -24,36 +24,36 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+using System.Threading.Tasks;
using NUnit.Framework;
using UnitTests;
namespace MonoDevelop.AspNet.Tests.Razor
{
- [Ignore ("Not working")]
[TestFixture]
class RazorCompletionTests : TestBase
{
[Test]
- public void HtmlTagsCompletion ()
+ public async Task HtmlTagsCompletion ()
{
- var provider = RazorCompletionTesting.CreateProvider ("<$", false);
+ var provider = await RazorCompletionTesting.CreateProvider ("<$", false);
Assert.IsNotNull (provider);
Assert.IsNotNull (provider.Find ("p"));
Assert.IsNotNull (provider.Find ("div"));
}
[Test]
- public void NestedHtmlTagsCompletion ()
+ public async Task NestedHtmlTagsCompletion ()
{
- var provider = RazorCompletionTesting.CreateProvider ("<div><ul><$ </ul></div>", false);
+ var provider = await RazorCompletionTesting.CreateProvider ("<div><ul><$ </ul></div>", false);
Assert.IsNotNull (provider);
Assert.IsNotNull (provider.Find ("li"));
}
[Test]
- public void RazorDirectivesAndStatementsCompletion ()
+ public async Task RazorDirectivesAndStatementsCompletion ()
{
- var provider = RazorCompletionTesting.CreateProvider ("@m$", true);
+ var provider = await RazorCompletionTesting.CreateProvider ("@m$", true);
Assert.IsNotNull (provider);
Assert.IsNotNull (provider.Find ("model"));
Assert.IsNotNull (provider.Find ("sessionstate"));
@@ -63,54 +63,57 @@ namespace MonoDevelop.AspNet.Tests.Razor
Assert.IsNotNull (provider.Find ("functions"));
Assert.IsNotNull (provider.Find ("helper"));
Assert.IsNotNull (provider.Find ("inherits"));
- Assert.IsNotNull (provider.Find ("for"));
- Assert.IsNotNull (provider.Find ("foreach"));
- Assert.IsNotNull (provider.Find ("while"));
- Assert.IsNotNull (provider.Find ("do"));
- Assert.IsNotNull (provider.Find ("lock"));
- Assert.IsNotNull (provider.Find ("switch"));
- Assert.IsNotNull (provider.Find ("if"));
- Assert.IsNotNull (provider.Find ("try"));
+
+ // TODO: Roslyn - the following are not working.
+ // They work for Ctrl+Space completion but not with completion as you type.
+// Assert.IsNotNull (provider.Find ("for"));
+// Assert.IsNotNull (provider.Find ("foreach"));
+// Assert.IsNotNull (provider.Find ("while"));
+// Assert.IsNotNull (provider.Find ("do"));
+// Assert.IsNotNull (provider.Find ("lock"));
+// Assert.IsNotNull (provider.Find ("switch"));
+// Assert.IsNotNull (provider.Find ("if"));
+// Assert.IsNotNull (provider.Find ("try"));
}
[Test]
- public void CSharpIdentifiersCompletion ()
+ public async Task CSharpIdentifiersCompletion ()
{
- var provider = RazorCompletionTesting.CreateProvider ("@{ i$ }", true);
+ var provider = await RazorCompletionTesting.CreateProvider ("@{ i$ }", true);
Assert.IsNotNull (provider);
Assert.IsNotNull (provider.Find ("int"));
Assert.IsNotNull (provider.Find ("var"));
}
[Test]
- public void CSharpIdentifiersCtrlSpaceCompletion ()
+ public async Task CSharpIdentifiersCtrlSpaceCompletion ()
{
- var provider = RazorCompletionTesting.CreateRazorCtrlSpaceProvider ("@{ $ }", true);
+ var provider = await RazorCompletionTesting.CreateRazorCtrlSpaceProvider ("@{ $ }", true);
Assert.IsNotNull (provider);
Assert.IsNotNull (provider.Find ("int"));
Assert.IsNotNull (provider.Find ("var"));
}
[Test]
- public void CSharpMembersCompletion ()
+ public async Task CSharpMembersCompletion ()
{
- var provider = RazorCompletionTesting.CreateProvider ("@{ Char.$ }", true);
+ var provider = await RazorCompletionTesting.CreateProvider ("@{ Char.$ }", true);
Assert.IsNotNull (provider);
Assert.IsNotNull (provider.Find ("IsLetter"));
}
[Test]
- public void CSharpMembersCtrlSpaceCompletion ()
+ public async Task CSharpMembersCtrlSpaceCompletion ()
{
- var provider = RazorCompletionTesting.CreateRazorCtrlSpaceProvider ("@{ Char.Is$ }", true);
+ var provider = await RazorCompletionTesting.CreateRazorCtrlSpaceProvider ("@{ Char.Is$ }", true);
Assert.IsNotNull (provider);
Assert.IsNotNull (provider.Find ("IsLetter"));
}
[Test]
- public void CSharpParametersCompletion ()
+ public async Task CSharpParametersCompletion ()
{
- var provider = RazorCompletionTesting.CreateProvider ("@{ Char.IsLetter($ }");
+ var provider = await RazorCompletionTesting.CreateParameterProvider ("@{ Char.IsLetter($ }");
Assert.IsNotNull (provider);
Assert.AreEqual (2, provider.Count);
}
diff --git a/main/src/addins/AspNet/Tests/Razor/RazorParserTests.cs b/main/src/addins/AspNet/Tests/Razor/RazorParserTests.cs
new file mode 100644
index 0000000000..dd378a1ac9
--- /dev/null
+++ b/main/src/addins/AspNet/Tests/Razor/RazorParserTests.cs
@@ -0,0 +1,108 @@
+//
+// RazorParserTests.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using MonoDevelop.AspNet.Projects;
+using MonoDevelop.AspNet.Razor;
+using MonoDevelop.Core.Text;
+using MonoDevelop.CSharpBinding;
+using MonoDevelop.CSharpBinding.Tests;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Projects;
+using NUnit.Framework;
+using UnitTests;
+
+namespace MonoDevelop.AspNet.Tests.Razor
+{
+ [TestFixture]
+ public class RazorParserTests : TestBase
+ {
+ Solution solution;
+
+ [TearDown]
+ public override void TearDown ()
+ {
+ TypeSystemServiceTestExtensions.UnloadSolution (solution);
+ base.TearDown ();
+ }
+
+ [Test]
+ public async Task PreprocessedFileUsesPreprocessorRazorHost ()
+ {
+ var document = await Parse ("@{ }", isPreprocessed: true);
+ var method = document.PageInfo.CSharpSyntaxTree
+ .GetRoot ()
+ .DescendantNodes ()
+ .OfType <MethodDeclarationSyntax> ()
+ .FirstOrDefault (m => m.Identifier.ValueText == "Generate");
+
+ Assert.IsNotNull (method);
+ }
+
+ async Task<RazorCSharpParsedDocument> Parse (string text, bool isPreprocessed)
+ {
+ var project = Services.ProjectService.CreateDotNetProject ("C#", "AspNetApp");
+
+ project.FileName = UnitTests.TestBase.GetTempFile (".csproj");
+ string file = UnitTests.TestBase.GetTempFile (".cshtml");
+ ProjectFile projectFile = project.AddFile (file);
+ if (isPreprocessed)
+ projectFile.Generator = "RazorTemplatePreprocessor";
+
+ var sev = new TestViewContent ();
+ sev.Project = project;
+ sev.ContentName = file;
+ sev.Text = text;
+
+ var tww = new TestWorkbenchWindow ();
+ tww.ViewContent = sev;
+
+ var doc = new TestDocument (tww);
+ doc.Editor.FileName = sev.ContentName;
+ doc.UpdateProject (project);
+
+ solution = new MonoDevelop.Projects.Solution ();
+ solution.DefaultSolutionFolder.AddItem (project);
+ solution.AddConfiguration ("", true);
+ await TypeSystemServiceTestExtensions.LoadSolution (solution);
+
+ var parser = new RazorTestingParser {
+ Doc = doc
+ };
+ var options = new ParseOptions {
+ Project = project,
+ FileName = file,
+ Content = new StringTextSource (text)
+ };
+ return (RazorCSharpParsedDocument)parser.Parse (options, default(CancellationToken)).Result;
+ }
+ }
+}
+
diff --git a/main/src/addins/AspNet/Tests/WebForms/WebFormsCompletionTests.cs b/main/src/addins/AspNet/Tests/WebForms/WebFormsCompletionTests.cs
index 0c041400dc..7357b046e2 100644
--- a/main/src/addins/AspNet/Tests/WebForms/WebFormsCompletionTests.cs
+++ b/main/src/addins/AspNet/Tests/WebForms/WebFormsCompletionTests.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System;
+using System.Threading.Tasks;
using NUnit.Framework;
namespace MonoDevelop.AspNet.Tests.WebForms
@@ -33,50 +34,50 @@ namespace MonoDevelop.AspNet.Tests.WebForms
class WebFormsCompletionTests : UnitTests.TestBase
{
[Test]
- public void DirectiveCompletion ()
+ public async Task DirectiveCompletion ()
{
- var provider = WebFormsTesting.CreateProvider (@"<%@ $ %>", ".aspx");
+ var provider = await WebFormsTesting.CreateProvider (@"<%@ $ %>", ".aspx");
Assert.IsNotNull (provider);
Assert.AreEqual (9, provider.Count);
Assert.IsNotNull (provider.Find ("Page"));
Assert.IsNotNull (provider.Find ("Register"));
- provider = WebFormsTesting.CreateProvider (@"<%@ $ %>", ".master");
+ provider = await WebFormsTesting.CreateProvider (@"<%@ $ %>", ".master");
Assert.IsNotNull (provider);
Assert.AreEqual (7, provider.Count);
Assert.IsNotNull (provider.Find ("Master"));
Assert.IsNotNull (provider.Find ("Register"));
- provider = WebFormsTesting.CreateProvider (@"<%@ $ %>", ".ascx");
+ provider = await WebFormsTesting.CreateProvider (@"<%@ $ %>", ".ascx");
Assert.IsNotNull (provider);
Assert.AreEqual (7, provider.Count);
Assert.IsNotNull (provider.Find ("Control"));
Assert.IsNotNull (provider.Find ("Register"));
- provider = WebFormsTesting.CreateProvider (@"<%@$ %>", ".aspx");
+ provider = await WebFormsTesting.CreateProvider (@"<%@$ %>", ".aspx");
Assert.IsNull (provider);
- provider = WebFormsTesting.CreateProvider (@"<%@ $ %>", ".aspx");
+ provider = await WebFormsTesting.CreateProvider (@"<%@ $ %>", ".aspx");
Assert.IsNull (provider);
}
[Test]
- public void DirectiveAttributeCompletion ()
+ public async Task DirectiveAttributeCompletion ()
{
- var provider = WebFormsTesting.CreateProvider (@"<%@ Page A$ %>", ".aspx");
+ var provider = await WebFormsTesting.CreateProvider (@"<%@ Page A$ %>", ".aspx");
Assert.IsNotNull (provider);
Assert.AreEqual (41, provider.Count);
Assert.IsNotNull (provider.Find ("StyleSheetTheme"));
Assert.IsNotNull (provider.Find ("Inherits"));
- provider = WebFormsTesting.CreateProvider (@"<%@ Master A$ %>", ".master");
+ provider = await WebFormsTesting.CreateProvider (@"<%@ Master A$ %>", ".master");
Assert.IsNotNull (provider);
Assert.AreEqual (18, provider.Count);
Assert.IsNull (provider.Find ("StyleSheetTheme"));
Assert.IsNotNull (provider.Find ("MasterPageFile"));
Assert.IsNotNull (provider.Find ("Inherits"));
- provider = WebFormsTesting.CreateProvider (@"<%@ Control A$ %>", ".ascx");
+ provider = await WebFormsTesting.CreateProvider (@"<%@ Control A$ %>", ".ascx");
Assert.IsNotNull (provider);
Assert.AreEqual (17, provider.Count);
Assert.IsNull (provider.Find ("StyleSheetTheme"));
@@ -85,22 +86,22 @@ namespace MonoDevelop.AspNet.Tests.WebForms
[Test]
[Ignore ("Not working")]
- public void DirectiveAttributeCtrlSpaceCompletion ()
+ public async Task DirectiveAttributeCtrlSpaceCompletion ()
{
- var provider = WebFormsTesting.CreateProvider (@"<%@ Page $ %>", ".aspx", true);
+ var provider = await WebFormsTesting.CreateProvider (@"<%@ Page $ %>", ".aspx", true);
Assert.IsNotNull (provider);
Assert.AreEqual (41, provider.Count);
Assert.IsNotNull (provider.Find ("StyleSheetTheme"));
Assert.IsNotNull (provider.Find ("Inherits"));
- provider = WebFormsTesting.CreateProvider (@"<%@ Master $ %>", ".master", true);
+ provider = await WebFormsTesting.CreateProvider (@"<%@ Master $ %>", ".master", true);
Assert.IsNotNull (provider);
Assert.AreEqual (18, provider.Count);
Assert.IsNull (provider.Find ("StyleSheetTheme"));
Assert.IsNotNull (provider.Find ("MasterPageFile"));
Assert.IsNotNull (provider.Find ("Inherits"));
- provider = WebFormsTesting.CreateProvider (@"<%@ Control $ %>", ".ascx", true);
+ provider = await WebFormsTesting.CreateProvider (@"<%@ Control $ %>", ".ascx", true);
Assert.IsNotNull (provider);
Assert.AreEqual (17, provider.Count);
Assert.IsNull (provider.Find ("StyleSheetTheme"));
@@ -111,9 +112,9 @@ namespace MonoDevelop.AspNet.Tests.WebForms
<!DOCTYPE html>
<html>
";
- void HeadBodyCompletion (bool ctrlSpace)
+ async Task HeadBodyCompletion (bool ctrlSpace)
{
- var provider = WebFormsTesting.CreateProvider (pageStart + "<$", ".aspx", ctrlSpace);
+ var provider = await WebFormsTesting.CreateProvider (pageStart + "<$", ".aspx", ctrlSpace);
Assert.IsNotNull (provider);
Assert.IsNotNull (provider.Find ("head"));
Assert.IsNotNull (provider.Find ("body"));
@@ -123,29 +124,29 @@ namespace MonoDevelop.AspNet.Tests.WebForms
}
[Test]
- public void HeadBodyCompletionAuto ()
+ public async Task HeadBodyCompletionAuto ()
{
- HeadBodyCompletion (false);
+ await HeadBodyCompletion (false);
}
[Test]
- public void HeadBodyCompletionCtrlSpace ()
+ public async Task HeadBodyCompletionCtrlSpace ()
{
- HeadBodyCompletion (true);
+ await HeadBodyCompletion (true);
}
[Test]
- public void TagPropertiesAuto ()
+ public async Task TagPropertiesAuto ()
{
- var provider = WebFormsTesting.CreateProvider (pageStart + "<asp:Button r$", ".aspx");
+ var provider = await WebFormsTesting.CreateProvider (pageStart + "<asp:Button r$", ".aspx");
Assert.IsNotNull (provider.Find ("runat=\"server\""));
Assert.IsNotNull (provider.Find ("BorderStyle"));
}
[Test]
- public void TagPropertiesCtrlSpace ()
+ public async Task TagPropertiesCtrlSpace ()
{
- var provider = WebFormsTesting.CreateProvider (pageStart + "<asp:Button $", ".aspx", true);
+ var provider = await WebFormsTesting.CreateProvider (pageStart + "<asp:Button $", ".aspx", true);
Assert.IsNotNull (provider.Find ("runat=\"server\""));
Assert.IsNotNull (provider.Find ("id"));
Assert.IsNotNull (provider.Find ("BorderStyle"));
diff --git a/main/src/addins/AspNet/Tests/WebForms/WebFormsTesting.cs b/main/src/addins/AspNet/Tests/WebForms/WebFormsTesting.cs
index 4f8e2444d9..1f8273e471 100644
--- a/main/src/addins/AspNet/Tests/WebForms/WebFormsTesting.cs
+++ b/main/src/addins/AspNet/Tests/WebForms/WebFormsTesting.cs
@@ -25,8 +25,11 @@
// THE SOFTWARE.
using System.IO;
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.AspNet.Projects;
using MonoDevelop.AspNet.WebForms;
+using MonoDevelop.Core.Text;
using MonoDevelop.CSharpBinding;
using MonoDevelop.CSharpBinding.Tests;
using MonoDevelop.Ide.CodeCompletion;
@@ -39,25 +42,38 @@ namespace MonoDevelop.AspNet.Tests.WebForms
//largely copied from RazorCompletionTesting
static class WebFormsTesting
{
- public static CompletionDataList CreateProvider (string text, string extension, bool isCtrlSpace = false)
+ public static async Task<CompletionDataList> CreateProvider (string text, string extension, bool isCtrlSpace = false)
{
- string editorText;
- TestViewContent sev;
-
- var textEditorCompletion = CreateEditor (text, extension, out editorText, out sev);
+ var result = await CreateEditor (text, extension);
+ var textEditorCompletion = result.Extension;
+ string editorText = result.EditorText;
+ TestViewContent sev = result.ViewContent;
int cursorPosition = text.IndexOf ('$');
- int triggerWordLength = 1;
var ctx = textEditorCompletion.GetCodeCompletionContext (sev);
if (isCtrlSpace)
- return textEditorCompletion.CodeCompletionCommand (ctx) as CompletionDataList;
- else
- return textEditorCompletion.HandleCodeCompletion (ctx, editorText[cursorPosition - 1], ref triggerWordLength) as CompletionDataList;
+ return await textEditorCompletion.CodeCompletionCommand (ctx) as CompletionDataList;
+ else {
+ var task = textEditorCompletion.HandleCodeCompletionAsync (ctx, editorText [cursorPosition - 1]);
+ if (task != null) {
+ return await task as CompletionDataList;
+ }
+ return null;
+ }
}
- static WebFormsTestingEditorExtension CreateEditor (string text, string extension, out string editorText, out TestViewContent sev)
+ struct CreateEditorResult
{
+ public WebFormsTestingEditorExtension Extension;
+ public string EditorText;
+ public TestViewContent ViewContent;
+ }
+
+ static async Task<CreateEditorResult> CreateEditor (string text, string extension)
+ {
+ string editorText;
+ TestViewContent sev;
string parsedText;
int cursorPosition = text.IndexOf ('$');
int endPos = text.IndexOf ('$', cursorPosition + 1);
@@ -69,17 +85,13 @@ namespace MonoDevelop.AspNet.Tests.WebForms
cursorPosition = endPos - 1;
}
- var project = new AspNetAppProject ("C#");
- project.References.Add (new ProjectReference (ReferenceType.Package, "System"));
- project.References.Add (new ProjectReference (ReferenceType.Package, "System.Web"));
+ var project = Services.ProjectService.CreateDotNetProject ("C#");
+ project.References.Add (ProjectReference.CreateAssemblyReference ("System"));
+ project.References.Add (ProjectReference.CreateAssemblyReference ("System.Web"));
project.FileName = UnitTests.TestBase.GetTempFile (".csproj");
string file = UnitTests.TestBase.GetTempFile (extension);
project.AddFile (file);
- var pcw = TypeSystemService.LoadProject (project);
- TypeSystemService.ForceUpdate (pcw);
- pcw.ReconnectAssemblyReferences ();
-
sev = new TestViewContent ();
sev.Project = project;
sev.ContentName = file;
@@ -90,19 +102,28 @@ namespace MonoDevelop.AspNet.Tests.WebForms
tww.ViewContent = sev;
var doc = new TestDocument (tww);
- doc.Editor.Document.FileName = sev.ContentName;
+ doc.Editor.FileName = sev.ContentName;
var parser = new WebFormsParser ();
- var parsedDoc = (WebFormsParsedDocument) parser.Parse (false, sev.ContentName, new StringReader (parsedText), project);
+ var options = new ParseOptions {
+ Project = project,
+ FileName = sev.ContentName,
+ Content = new StringTextSource (parsedText)
+ };
+ var parsedDoc = await parser.Parse (options, default(CancellationToken)) as WebFormsParsedDocument;
doc.HiddenParsedDocument = parsedDoc;
- return new WebFormsTestingEditorExtension (doc);
+ return new CreateEditorResult {
+ Extension = new WebFormsTestingEditorExtension (doc),
+ EditorText = editorText,
+ ViewContent = sev
+ };
}
public class WebFormsTestingEditorExtension : WebFormsEditorExtension
{
public WebFormsTestingEditorExtension (Document doc)
{
- Initialize (doc);
+ Initialize (doc.Editor, doc);
}
public CodeCompletionContext GetCodeCompletionContext (TestViewContent sev)
diff --git a/main/src/addins/AspNet/WebForms/CSharp/CSharpProjector.cs b/main/src/addins/AspNet/WebForms/CSharp/CSharpProjector.cs
new file mode 100644
index 0000000000..3bf093be49
--- /dev/null
+++ b/main/src/addins/AspNet/WebForms/CSharp/CSharpProjector.cs
@@ -0,0 +1,109 @@
+//
+// CSharpProjector.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Text;
+using System.Collections.Generic;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.AspNet.WebForms.Dom;
+using System.Threading.Tasks;
+using MonoDevelop.Ide.Editor.Projection;
+using MonoDevelop.Core.Text;
+
+namespace MonoDevelop.AspNet.WebForms.CSharp
+{
+ public class CSharpProjector
+ {
+ public Task<Projection> CreateProjection (DocumentInfo info, IReadonlyTextDocument data, bool buildExpressions)
+ {
+ if (info == null)
+ throw new ArgumentNullException ("info");
+ if (data == null)
+ throw new ArgumentNullException ("data");
+ var document = new StringBuilder ();
+
+ WriteUsings (info.Imports, document);
+ var segBuilder = System.Collections.Immutable.ImmutableList<ProjectedSegment>.Empty.ToBuilder ();
+
+ foreach (var node in info.XScriptBlocks) {
+ var start = data.LocationToOffset (node.Region.Begin.Line, node.Region.Begin.Column) + 2;
+ var end = data.LocationToOffset (node.Region.End.Line, node.Region.End.Column) - 2;
+
+ segBuilder.Add (new ProjectedSegment (start, document.Length, end - start));
+
+ document.AppendLine (data.GetTextBetween (start, end));
+ }
+ if (buildExpressions) {
+ WriteClassDeclaration (info, document);
+ document.AppendLine ("{");
+ document.AppendLine ("void Generated ()");
+ document.AppendLine ("{");
+ //Console.WriteLine ("start:" + location.BeginLine +"/" +location.BeginColumn);
+
+ foreach (var node in info.XExpressions) {
+ bool isBlock = node is WebFormsRenderBlock;
+
+ var start = data.LocationToOffset (node.Region.Begin.Line, node.Region.Begin.Column) + 2;
+ var end = data.LocationToOffset (node.Region.End.Line, node.Region.End.Column) - 2;
+
+ if (!isBlock) {
+ document.Append ("WriteLine (");
+ start += 1;
+ }
+
+ string expr = data.GetTextBetween (start, end);
+ segBuilder.Add (new ProjectedSegment (start, document.Length, expr.Length));
+ document.Append (expr);
+ if (!isBlock)
+ document.Append (");");
+ }
+ document.AppendLine ("}");
+ document.AppendLine ("}");
+ }
+ return Task.FromResult(new Projection (
+ TextEditorFactory.CreateNewDocument (new StringTextSource (document.ToString ()), info.AspNetDocument.FileName + ".g.cs", "text/x-csharp"),
+ segBuilder.ToImmutable ()
+ ));
+ }
+
+ static void WriteUsings (IEnumerable<string> usings, StringBuilder builder)
+ {
+ foreach (var u in usings) {
+ builder.Append ("using ");
+ builder.Append (u);
+ builder.AppendLine (";");
+ }
+ }
+
+ static void WriteClassDeclaration (DocumentInfo info, StringBuilder builder)
+ {
+ builder.Append ("partial class ");
+ builder.Append (info.ClassName);
+ builder.Append (" : ");
+ builder.AppendLine (info.BaseType);
+ }
+ }
+}
+
diff --git a/main/src/addins/AspNet/WebForms/Dom/WebFormsBindingExpression.cs b/main/src/addins/AspNet/WebForms/Dom/WebFormsBindingExpression.cs
index 37c5893f40..c9b2a02fa7 100644
--- a/main/src/addins/AspNet/WebForms/Dom/WebFormsBindingExpression.cs
+++ b/main/src/addins/AspNet/WebForms/Dom/WebFormsBindingExpression.cs
@@ -24,19 +24,18 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.WebForms.Dom
{
public class WebFormsBindingExpression : WebFormsExpression
{
- public WebFormsBindingExpression (DomRegion region) : base (region)
+ public WebFormsBindingExpression (DocumentRegion region) : base (region)
{
}
- public WebFormsBindingExpression (TextLocation start) : base (start)
+ public WebFormsBindingExpression (DocumentLocation start) : base (start)
{
}
diff --git a/main/src/addins/AspNet/WebForms/Dom/WebFormsDirective.cs b/main/src/addins/AspNet/WebForms/Dom/WebFormsDirective.cs
index 744e6480e6..e17e59e022 100644
--- a/main/src/addins/AspNet/WebForms/Dom/WebFormsDirective.cs
+++ b/main/src/addins/AspNet/WebForms/Dom/WebFormsDirective.cs
@@ -26,8 +26,8 @@
using System.Diagnostics;
using System.Text;
-using ICSharpCode.NRefactory;
-using MonoDevelop.Xml.Dom;
+using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.WebForms.Dom
{
@@ -36,12 +36,12 @@ namespace MonoDevelop.AspNet.WebForms.Dom
XName name;
XAttributeCollection attributes;
- public WebFormsDirective (TextLocation start) : base (start)
+ public WebFormsDirective (DocumentLocation start) : base (start)
{
attributes = new XAttributeCollection (this);
}
- public WebFormsDirective (TextLocation start, XName name) : this (start)
+ public WebFormsDirective (DocumentLocation start, XName name) : this (start)
{
this.name = name;
}
diff --git a/main/src/addins/AspNet/WebForms/Dom/WebFormsExpression.cs b/main/src/addins/AspNet/WebForms/Dom/WebFormsExpression.cs
index c67eff4f37..8013a9fe45 100644
--- a/main/src/addins/AspNet/WebForms/Dom/WebFormsExpression.cs
+++ b/main/src/addins/AspNet/WebForms/Dom/WebFormsExpression.cs
@@ -25,19 +25,18 @@
// THE SOFTWARE.
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.WebForms.Dom
{
public abstract class WebFormsExpression : XNode
{
- protected WebFormsExpression (DomRegion region) : base (region)
+ protected WebFormsExpression (DocumentRegion region) : base (region)
{
}
- protected WebFormsExpression (TextLocation start) : base (start)
+ protected WebFormsExpression (DocumentLocation start) : base (start)
{
}
diff --git a/main/src/addins/AspNet/WebForms/Dom/WebFormsHtmlEncodedExpression.cs b/main/src/addins/AspNet/WebForms/Dom/WebFormsHtmlEncodedExpression.cs
index f83c02287c..4d82c64543 100644
--- a/main/src/addins/AspNet/WebForms/Dom/WebFormsHtmlEncodedExpression.cs
+++ b/main/src/addins/AspNet/WebForms/Dom/WebFormsHtmlEncodedExpression.cs
@@ -24,20 +24,19 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.WebForms.Dom
{
public class WebFormsHtmlEncodedExpression : WebFormsExpression
{
- public WebFormsHtmlEncodedExpression (DomRegion region) : base (region)
+ public WebFormsHtmlEncodedExpression (DocumentRegion region) : base (region)
{
}
- public WebFormsHtmlEncodedExpression (TextLocation start) : base (start)
+ public WebFormsHtmlEncodedExpression (DocumentLocation start) : base (start)
{
}
diff --git a/main/src/addins/AspNet/WebForms/Dom/WebFormsRenderBlock.cs b/main/src/addins/AspNet/WebForms/Dom/WebFormsRenderBlock.cs
index 3c715302b6..adb357e1b3 100644
--- a/main/src/addins/AspNet/WebForms/Dom/WebFormsRenderBlock.cs
+++ b/main/src/addins/AspNet/WebForms/Dom/WebFormsRenderBlock.cs
@@ -26,19 +26,18 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.WebForms.Dom
{
public class WebFormsRenderBlock : XNode
{
- public WebFormsRenderBlock (DomRegion region) : base (region)
+ public WebFormsRenderBlock (DocumentRegion region) : base (region)
{
}
- public WebFormsRenderBlock (TextLocation start) : base (start)
+ public WebFormsRenderBlock (DocumentLocation start) : base (start)
{
}
diff --git a/main/src/addins/AspNet/WebForms/Dom/WebFormsRenderExpression.cs b/main/src/addins/AspNet/WebForms/Dom/WebFormsRenderExpression.cs
index 479ec8ba31..d881836fc0 100644
--- a/main/src/addins/AspNet/WebForms/Dom/WebFormsRenderExpression.cs
+++ b/main/src/addins/AspNet/WebForms/Dom/WebFormsRenderExpression.cs
@@ -24,19 +24,18 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.WebForms.Dom
{
public class WebFormsRenderExpression : WebFormsExpression
{
- public WebFormsRenderExpression (DomRegion region) : base (region)
+ public WebFormsRenderExpression (DocumentRegion region) : base (region)
{
}
- public WebFormsRenderExpression (TextLocation start) : base (start)
+ public WebFormsRenderExpression (DocumentLocation start) : base (start)
{
}
diff --git a/main/src/addins/AspNet/WebForms/Dom/WebFormsResourceExpression.cs b/main/src/addins/AspNet/WebForms/Dom/WebFormsResourceExpression.cs
index 26038b655c..4ffe73e8ed 100644
--- a/main/src/addins/AspNet/WebForms/Dom/WebFormsResourceExpression.cs
+++ b/main/src/addins/AspNet/WebForms/Dom/WebFormsResourceExpression.cs
@@ -24,20 +24,19 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Xml.Parser;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.WebForms.Dom
{
public class WebFormsResourceExpression : WebFormsExpression
{
- public WebFormsResourceExpression (DomRegion region) : base (region)
+ public WebFormsResourceExpression (DocumentRegion region) : base (region)
{
}
- public WebFormsResourceExpression (TextLocation start) : base (start)
+ public WebFormsResourceExpression (DocumentLocation start) : base (start)
{
}
diff --git a/main/src/addins/AspNet/WebForms/Dom/WebFormsServerComment.cs b/main/src/addins/AspNet/WebForms/Dom/WebFormsServerComment.cs
index 675a854916..a35a720a36 100644
--- a/main/src/addins/AspNet/WebForms/Dom/WebFormsServerComment.cs
+++ b/main/src/addins/AspNet/WebForms/Dom/WebFormsServerComment.cs
@@ -25,19 +25,18 @@
// THE SOFTWARE.
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.WebForms.Dom
{
public class WebFormsServerComment : XNode
{
- public WebFormsServerComment (DomRegion region) : base (region)
+ public WebFormsServerComment (DocumentRegion region) : base (region)
{
}
- public WebFormsServerComment (TextLocation start) : base (start)
+ public WebFormsServerComment (DocumentLocation start) : base (start)
{
}
diff --git a/main/src/addins/AspNet/WebForms/ILanguageCompletionBuilder.cs b/main/src/addins/AspNet/WebForms/ILanguageCompletionBuilder.cs
index bd559c56d5..41a22f1779 100644
--- a/main/src/addins/AspNet/WebForms/ILanguageCompletionBuilder.cs
+++ b/main/src/addins/AspNet/WebForms/ILanguageCompletionBuilder.cs
@@ -26,13 +26,14 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.NRefactory.TypeSystem;
using Mono.TextEditor;
using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Ide.Editor;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Xml.Dom;
using MonoDevelop.AspNet.Projects;
using MonoDevelop.AspNet.WebForms.Dom;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.AspNet.WebForms
{
@@ -86,20 +87,18 @@ namespace MonoDevelop.AspNet.WebForms
/// </summary>
public class DocumentInfo
{
- public DocumentInfo (ICompilation dom, WebFormsParsedDocument aspNetParsedDocument, IEnumerable<string> imports)
+ public DocumentInfo (WebFormsParsedDocument aspNetParsedDocument, IEnumerable<string> imports)
{
- this.Dom = dom;
this.AspNetDocument = aspNetParsedDocument;
this.Imports = imports;
BuildExpressionAndScriptsLists ();
}
- public ICompilation Dom { get; private set; }
public WebFormsParsedDocument AspNetDocument { get; private set; }
public ParsedDocument ParsedDocument { get; set; }
public IEnumerable<string> Imports { get; private set; }
- public IUnresolvedTypeDefinition CodeBesideClass { get; set; }
+ public INamedTypeSymbol CodeBesideClass { get; set; }
public string BaseType {
get {
@@ -163,16 +162,16 @@ namespace MonoDevelop.AspNet.WebForms
{
bool SupportsLanguage (string language);
- ParsedDocument BuildDocument (DocumentInfo info, TextEditorData textEditorData);
+ ParsedDocument BuildDocument (DocumentInfo info, MonoDevelop.Ide.Editor.TextEditor textEditorData);
- ICompletionWidget CreateCompletionWidget (MonoDevelop.Ide.Gui.Document realDocument, LocalDocumentInfo localInfo);
-
- LocalDocumentInfo BuildLocalDocument (DocumentInfo info, TextEditorData textEditorData, string expressionText, string textAfterCaret, bool isExpression);
-
- ICompletionDataList HandlePopupCompletion (MonoDevelop.Ide.Gui.Document realDocument, DocumentInfo info, LocalDocumentInfo localInfo);
- ICompletionDataList HandleCompletion (MonoDevelop.Ide.Gui.Document realDocument, CodeCompletionContext completionContext, DocumentInfo info, LocalDocumentInfo localInfo, char currentChar, ref int triggerWordLength);
- ParameterDataProvider HandleParameterCompletion (MonoDevelop.Ide.Gui.Document realDocument, CodeCompletionContext completionContext, DocumentInfo info, LocalDocumentInfo localInfo, char completionChar);
- bool GetParameterCompletionCommandOffset (MonoDevelop.Ide.Gui.Document realDocument, DocumentInfo info, LocalDocumentInfo localInfo, out int cpos);
+// ICompletionWidget CreateCompletionWidget (MonoDevelop.Ide.Editor.TextEditor realEditor, DocumentContext realContext, LocalDocumentInfo localInfo);
+//
+// LocalDocumentInfo BuildLocalDocument (DocumentInfo info, MonoDevelop.Ide.Editor.TextEditor textEditorData, string expressionText, string textAfterCaret, bool isExpression);
+//
+// ICompletionDataList HandlePopupCompletion (MonoDevelop.Ide.Editor.TextEditor realEditor, DocumentContext realContext, DocumentInfo info, LocalDocumentInfo localInfo);
+// ICompletionDataList HandleCompletion (MonoDevelop.Ide.Editor.TextEditor realEditor, DocumentContext realContext, CodeCompletionContext completionContext, DocumentInfo info, LocalDocumentInfo localInfo, char currentChar, ref int triggerWordLength);
+// ParameterHintingResult HandleParameterCompletion (MonoDevelop.Ide.Editor.TextEditor realEditor, DocumentContext realContext, CodeCompletionContext completionContext, DocumentInfo info, LocalDocumentInfo localInfo, char completionChar);
+// bool GetParameterCompletionCommandOffset (MonoDevelop.Ide.Editor.TextEditor realEditor, DocumentContext realContext, DocumentInfo info, LocalDocumentInfo localInfo, out int cpos);
}
public static class LanguageCompletionBuilderService
diff --git a/main/src/addins/AspNet/WebForms/MasterContentFileDescriptionTemplate.cs b/main/src/addins/AspNet/WebForms/MasterContentFileDescriptionTemplate.cs
index 4316a08c44..12f658bb6b 100644
--- a/main/src/addins/AspNet/WebForms/MasterContentFileDescriptionTemplate.cs
+++ b/main/src/addins/AspNet/WebForms/MasterContentFileDescriptionTemplate.cs
@@ -38,7 +38,7 @@ namespace MonoDevelop.AspNet.WebForms
{
public class MasterContentFileDescriptionTemplate : SingleFileDescriptionTemplate
{
- public override void ModifyTags (SolutionItem policyParent, Project project, string language, string identifier, string fileName, ref Dictionary<string,string> tags)
+ public override void ModifyTags (SolutionFolderItem policyParent, Project project, string language, string identifier, string fileName, ref Dictionary<string,string> tags)
{
base.ModifyTags (policyParent, project, language, identifier, fileName, ref tags);
if (fileName == null)
@@ -47,13 +47,13 @@ namespace MonoDevelop.AspNet.WebForms
tags ["AspNetMaster"] = "";
tags ["AspNetMasterContent"] = "";
- AspNetAppProject aspProj = project as AspNetAppProject;
+ var aspProj = project.GetService<AspNetAppProjectFlavor> ();
if (aspProj == null)
throw new InvalidOperationException ("MasterContentFileDescriptionTemplate is only valid for ASP.NET projects");
ProjectFile masterPage = null;
- var dialog = new MonoDevelop.Ide.Projects.ProjectFileSelectorDialog (aspProj, null, "*.master");
+ var dialog = new MonoDevelop.Ide.Projects.ProjectFileSelectorDialog (project, null, "*.master");
try {
dialog.Title = GettextCatalog.GetString ("Select a Master Page...");
int response = MonoDevelop.Ide.MessageService.RunCustomDialog (dialog);
@@ -69,7 +69,7 @@ namespace MonoDevelop.AspNet.WebForms
tags ["AspNetMaster"] = aspProj.LocalToVirtualPath (masterPage);
try {
- var pd = TypeSystemService.ParseFile (project, masterPage.FilePath)
+ var pd = TypeSystemService.ParseFile (project, masterPage.FilePath).Result
as WebFormsParsedDocument;
if (pd == null)
return;
diff --git a/main/src/addins/AspNet/WebForms/SuggestedHandlerCompletionData.cs b/main/src/addins/AspNet/WebForms/SuggestedHandlerCompletionData.cs
index 1e7d7dca23..9c779f2a55 100644
--- a/main/src/addins/AspNet/WebForms/SuggestedHandlerCompletionData.cs
+++ b/main/src/addins/AspNet/WebForms/SuggestedHandlerCompletionData.cs
@@ -32,24 +32,25 @@ using MonoDevelop.Core;
using MonoDevelop.Projects;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.DesignerSupport;
-using ICSharpCode.NRefactory.TypeSystem;
using System.Linq;
+using MonoDevelop.Ide.Editor.Extension;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.AspNet.WebForms
{
class SuggestedHandlerCompletionData : CompletionData
{
- readonly Project project;
+ readonly MonoDevelop.Projects.Project project;
readonly CodeMemberMethod methodInfo;
- readonly IType codeBehindClass;
- readonly IUnresolvedTypeDefinition codeBehindClassPart;
+ readonly INamedTypeSymbol codeBehindClass;
+ readonly Location codeBehindClassLocation;
- public SuggestedHandlerCompletionData (Project project, CodeMemberMethod methodInfo, IType codeBehindClass, IUnresolvedTypeDefinition codeBehindClassPart)
+ public SuggestedHandlerCompletionData (MonoDevelop.Projects.Project project, CodeMemberMethod methodInfo, INamedTypeSymbol codeBehindClass, Location codeBehindClassLocation)
{
this.project = project;
this.methodInfo = methodInfo;
this.codeBehindClass = codeBehindClass;
- this.codeBehindClassPart = codeBehindClassPart;
+ this.codeBehindClassLocation = codeBehindClassLocation;
}
public override IconId Icon {
@@ -74,22 +75,21 @@ namespace MonoDevelop.AspNet.WebForms
}
}
- public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
//insert the method name
- MonoDevelop.Ide.Gui.Content.IEditableTextBuffer buf = window.CompletionWidget as MonoDevelop.Ide.Gui.Content.IEditableTextBuffer;
+ var buf = window.CompletionWidget;
if (buf != null) {
- using (var undo = buf.OpenUndoGroup ()) {
- buf.DeleteText (window.CodeCompletionContext.TriggerOffset, buf.CursorPosition - window.CodeCompletionContext.TriggerOffset);
- buf.InsertText (buf.CursorPosition, methodInfo.Name);
- }
+ buf.Replace (window.CodeCompletionContext.TriggerOffset, buf.CaretOffset - window.CodeCompletionContext.TriggerOffset, methodInfo.Name);
}
//generate the codebehind method
- if (codeBehindClassPart != null && project != null)
- BindingService.AddMemberToClass (project, codeBehindClass.GetDefinition (), codeBehindClassPart, methodInfo, false);
- else
- BindingService.AddMemberToClass (project, codeBehindClass.GetDefinition (), codeBehindClass.GetDefinition ().Parts.First (), methodInfo, false);
+
+ // TODO: Roslyn port.
+// if (codeBehindClassLocation != null && project != null)
+// BindingService.AddMemberToClass (project, codeBehindClass, codeBehindClassLocation, methodInfo, false);
+// else
+// BindingService.AddMemberToClass (project, codeBehindClass, codeBehindClass.Locations.First (), methodInfo, false);
}
}
}
diff --git a/main/src/addins/AspNet/WebForms/WebFormsCodeBehind.cs b/main/src/addins/AspNet/WebForms/WebFormsCodeBehind.cs
index bfdce9399f..d735e979ca 100644
--- a/main/src/addins/AspNet/WebForms/WebFormsCodeBehind.cs
+++ b/main/src/addins/AspNet/WebForms/WebFormsCodeBehind.cs
@@ -33,13 +33,14 @@ using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Linq;
+using System.Threading;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Core;
using MonoDevelop.DesignerSupport;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Projects;
using MonoDevelop.AspNet.Projects;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.AspNet.WebForms
{
@@ -47,7 +48,7 @@ namespace MonoDevelop.AspNet.WebForms
{
public static string GetCodeBehindClassName (ProjectFile file)
{
- AspNetAppProject proj = file.Project as AspNetAppProject;
+ var proj = file.Project.GetService<AspNetAppProjectFlavor> ();
if (proj == null)
return null;
return proj.GetCodebehindTypeName (file.Name);
@@ -55,26 +56,26 @@ namespace MonoDevelop.AspNet.WebForms
public static ProjectFile GetDesignerFile (ProjectFile file)
{
- var project = file.Project as AspNetAppProject;
+ var ext = file.Project.GetService<AspNetAppProjectFlavor> ();
- var type = AspNetAppProject.DetermineWebSubtype (file.FilePath);
+ var type = AspNetAppProjectFlavor.DetermineWebSubtype (file.FilePath);
if (type != WebSubtype.WebForm && type != WebSubtype.WebControl && type != WebSubtype.MasterPage)
return null;
- var dfName = project.LanguageBinding.GetFileName (file.FilePath + ".designer");
- return project.Files.GetFile (dfName);
+ var dfName = ext.Project.LanguageBinding.GetFileName (file.FilePath + ".designer");
+ return ext.Project.Files.GetFile (dfName);
}
public static BuildResult UpdateDesignerFile (
CodeBehindWriter writer,
- AspNetAppProject project,
+ DotNetProject project,
ProjectFile file, ProjectFile designerFile
)
{
var result = new BuildResult ();
//parse the ASP.NET file
- var parsedDocument = TypeSystemService.ParseFile (project, file.FilePath) as WebFormsParsedDocument;
+ var parsedDocument = TypeSystemService.ParseFile (project, file.FilePath).Result as WebFormsParsedDocument;
if (parsedDocument == null) {
result.AddError (string.Format ("Failed to parse file '{0}'", file.Name));
return result;
@@ -91,7 +92,7 @@ namespace MonoDevelop.AspNet.WebForms
return result;
}
- static void AddErrorsToResult (BuildResult result, string filename, IList<Error> errors)
+ static void AddErrorsToResult (BuildResult result, string filename, IEnumerable<Error> errors)
{
foreach (var err in errors) {
if (err.ErrorType == ErrorType.Warning)
@@ -102,7 +103,7 @@ namespace MonoDevelop.AspNet.WebForms
}
public static BuildResult GenerateCodeBehind (
- AspNetAppProject project,
+ DotNetProject project,
string filename,
WebFormsParsedDocument document,
out CodeCompileUnit ccu)
@@ -110,7 +111,7 @@ namespace MonoDevelop.AspNet.WebForms
ccu = null;
var result = new BuildResult ();
string className = document.Info.InheritedClass;
- AddErrorsToResult (result, filename, document.Errors);
+ AddErrorsToResult (result, filename, document.GetErrorsAsync().Result);
if (result.ErrorCount > 0)
return result;
@@ -118,6 +119,7 @@ namespace MonoDevelop.AspNet.WebForms
return result;
var refman = new WebFormsTypeContext { Project = project, Doc = document };
+ refman.CreateCompilation (default(CancellationToken)).Wait ();
var memberList = new WebFormsMemberListBuilder (refman, document.XDocument);
memberList.Build ();
@@ -149,10 +151,11 @@ namespace MonoDevelop.AspNet.WebForms
masterTypeName = document.Info.MasterPageTypeName;
} else if (!String.IsNullOrEmpty (document.Info.MasterPageTypeVPath)) {
try {
- ProjectFile resolvedMaster = project.ResolveVirtualPath (document.Info.MasterPageTypeVPath, document.FileName);
+ var ext = project.GetService<AspNetAppProjectFlavor> ();
+ ProjectFile resolvedMaster = ext.ResolveVirtualPath (document.Info.MasterPageTypeVPath, document.FileName);
WebFormsParsedDocument masterParsedDocument = null;
if (resolvedMaster != null)
- masterParsedDocument = TypeSystemService.ParseFile (project, resolvedMaster.FilePath) as WebFormsParsedDocument;
+ masterParsedDocument = TypeSystemService.ParseFile (project, resolvedMaster.FilePath).Result as WebFormsParsedDocument;
if (masterParsedDocument != null && !String.IsNullOrEmpty (masterParsedDocument.Info.InheritedClass))
masterTypeName = masterParsedDocument.Info.InheritedClass;
} catch (Exception ex) {
@@ -184,14 +187,13 @@ namespace MonoDevelop.AspNet.WebForms
if (memberList.Members.Count == 0)
return result;
- var dom = refman.Compilation;
- var cls = ReflectionHelper.ParseReflectionName (className).Resolve (dom);
+ var cls = refman.GetTypeByMetadataName (className);
var members = GetDesignerMembers (memberList.Members.Values, cls, filename);
//add fields for each control in the page
foreach (var member in members) {
- var type = new CodeTypeReference (member.Type.FullName);
+ var type = new CodeTypeReference (member.Type.ToDisplayString (SymbolDisplayFormat.CSharpErrorMessageFormat));
typeDecl.Members.Add (new CodeMemberField (type, member.Name) { Attributes = MemberAttributes.Family });
}
return result;
@@ -204,22 +206,23 @@ namespace MonoDevelop.AspNet.WebForms
/// <returns>The filtered list of non-conflicting members.</returns>
// TODO: check compatibilty with existing members
public static IEnumerable<CodeBehindMember> GetDesignerMembers (
- IEnumerable<CodeBehindMember> members, IType cls, string designerFile)
+ IEnumerable<CodeBehindMember> members, INamedTypeSymbol cls, string designerFile)
{
var existingMembers = new HashSet<string> ();
while (cls != null) {
- if (cls.GetDefinition () == null)
- break;
+// if (cls.GetDefinition () == null)
+// break;
foreach (var member in cls.GetMembers ()) {
- if (member.Accessibility == Accessibility.Private || member.Accessibility == Accessibility.Internal)
+ if (member.DeclaredAccessibility == Accessibility.Private || member.DeclaredAccessibility == Accessibility.Internal)
continue;
- if (member.Region.FileName == designerFile)
+ if (member.Locations.Any (loc => loc.IsInSource && loc.SourceTree.FilePath == designerFile))
continue;
existingMembers.Add (member.Name);
}
- if (cls.DirectBaseTypes.All (t => t.Kind == TypeKind.Interface))
+ // TODO: check
+ if (cls.Interfaces.Any ())
break;
- cls = cls.DirectBaseTypes.First(t => t.Kind != TypeKind.Interface);
+ cls = cls.BaseType;
}
return members.Where (m => !existingMembers.Contains (m.Name));
}
diff --git a/main/src/addins/AspNet/WebForms/WebFormsCodeBehindTypeNameCache.cs b/main/src/addins/AspNet/WebForms/WebFormsCodeBehindTypeNameCache.cs
index 526911a74f..4e998fe458 100644
--- a/main/src/addins/AspNet/WebForms/WebFormsCodeBehindTypeNameCache.cs
+++ b/main/src/addins/AspNet/WebForms/WebFormsCodeBehindTypeNameCache.cs
@@ -31,20 +31,22 @@ using MonoDevelop.Core;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Ide;
using MonoDevelop.AspNet.WebForms;
-using MonoDevelop.AspNet.Projects;
+using MonoDevelop.AspNet.Projects;
+using MonoDevelop.Projects;
+using MonoDevelop.Core.Text;
namespace MonoDevelop.AspNet.WebForms
{
- class WebFormsCodeBehindTypeNameCache : ProjectFileCache<AspNetAppProject,string>
+ class WebFormsCodeBehindTypeNameCache : ProjectFileCache<Project,string>
{
- public WebFormsCodeBehindTypeNameCache (AspNetAppProject proj) : base (proj)
+ public WebFormsCodeBehindTypeNameCache (Project proj) : base (proj)
{
}
protected override string GenerateInfo (string filename)
{
try {
- var doc = TypeSystemService.ParseFile (filename, DesktopService.GetMimeTypeForUri (filename), File.ReadAllText (filename)) as WebFormsParsedDocument;
+ var doc = TypeSystemService.ParseFile (null, filename, DesktopService.GetMimeTypeForUri (filename), StringTextSource.ReadFrom (filename)).Result as WebFormsParsedDocument;
if (doc != null && !string.IsNullOrEmpty (doc.Info.InheritedClass))
return doc.Info.InheritedClass;
} catch (Exception ex) {
diff --git a/main/src/addins/AspNet/WebForms/WebFormsDirectiveCompletion.cs b/main/src/addins/AspNet/WebForms/WebFormsDirectiveCompletion.cs
index 54839d53ae..a7ded63cf7 100644
--- a/main/src/addins/AspNet/WebForms/WebFormsDirectiveCompletion.cs
+++ b/main/src/addins/AspNet/WebForms/WebFormsDirectiveCompletion.cs
@@ -36,6 +36,7 @@ using System.Web.UI;
using MonoDevelop.Core;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.AspNet.Projects;
+using MonoDevelop.Projects;
namespace MonoDevelop.AspNet.WebForms
{
@@ -94,7 +95,7 @@ namespace MonoDevelop.AspNet.WebForms
}
- public static CompletionDataList GetAttributeValues (AspNetAppProject project, FilePath fromFile, string directiveName, string attribute)
+ public static CompletionDataList GetAttributeValues (DotNetProject project, FilePath fromFile, string directiveName, string attribute)
{
switch (directiveName.ToLowerInvariant ()) {
case "page":
@@ -105,7 +106,7 @@ namespace MonoDevelop.AspNet.WebForms
return null;
}
- public static CompletionDataList GetAttributes (AspNetAppProject project, string directiveName,
+ public static CompletionDataList GetAttributes (DotNetProject project, string directiveName,
Dictionary<string, string> existingAtts)
{
var list = new CompletionDataList ();
@@ -199,7 +200,7 @@ namespace MonoDevelop.AspNet.WebForms
list.Add (s);
}
- static CompletionDataList GetPageAttributeValues (AspNetAppProject project, FilePath fromFile, string attribute)
+ static CompletionDataList GetPageAttributeValues (Project project, FilePath fromFile, string attribute)
{
var list = new CompletionDataList ();
switch (attribute.ToLowerInvariant ()) {
@@ -346,7 +347,7 @@ namespace MonoDevelop.AspNet.WebForms
return list.Count > 0? list : null;
}
- static CompletionDataList GetRegisterAttributeValues (AspNetAppProject project, FilePath fromFile, string attribute)
+ static CompletionDataList GetRegisterAttributeValues (Project project, FilePath fromFile, string attribute)
{
switch (attribute.ToLowerInvariant ()) {
case "src":
diff --git a/main/src/addins/AspNet/WebForms/WebFormsEditorExtension.cs b/main/src/addins/AspNet/WebForms/WebFormsEditorExtension.cs
index 96a0239b78..69a199a86e 100644
--- a/main/src/addins/AspNet/WebForms/WebFormsEditorExtension.cs
+++ b/main/src/addins/AspNet/WebForms/WebFormsEditorExtension.cs
@@ -31,15 +31,15 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text.RegularExpressions;
-
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.TypeSystem;
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Core;
using MonoDevelop.DesignerSupport;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide.Editor;
using MonoDevelop.AspNet.Html;
using MonoDevelop.AspNet.Html.Parser;
using MonoDevelop.AspNet.Projects;
@@ -48,23 +48,29 @@ using S = MonoDevelop.Xml.Parser;
using MonoDevelop.AspNet.WebForms.Dom;
using MonoDevelop.Xml.Parser;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Projects;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.Editor.Extension;
+using MonoDevelop.Ide.Editor.Projection;
namespace MonoDevelop.AspNet.WebForms
{
- public class WebFormsEditorExtension : BaseHtmlEditorExtension
+ class WebFormsEditorExtension : BaseHtmlEditorExtension
{
- static readonly Regex DocTypeRegex = new Regex (@"(?:PUBLIC|public)\s+""(?<fpi>[^""]*)""\s+""(?<uri>[^""]*)""");
+ static readonly System.Text.RegularExpressions.Regex DocTypeRegex = new System.Text.RegularExpressions.Regex (@"(?:PUBLIC|public)\s+""(?<fpi>[^""]*)""\s+""(?<uri>[^""]*)""");
WebFormsParsedDocument aspDoc;
- AspNetAppProject project;
+ DotNetProject project;
WebFormsTypeContext refman = new WebFormsTypeContext ();
ILanguageCompletionBuilder documentBuilder;
- LocalDocumentInfo localDocumentInfo;
+ Projection localDocumentProjection;
DocumentInfo documentInfo;
ICompletionWidget defaultCompletionWidget;
- MonoDevelop.Ide.Gui.Document defaultDocument;
+ DocumentContext defaultDocumentContext;
+ TextEditor defaultEditor;
+ TextEditor projectedEditor;
bool HasDoc { get { return aspDoc != null; } }
@@ -89,54 +95,53 @@ namespace MonoDevelop.AspNet.WebForms
aspDoc = CU as WebFormsParsedDocument;
if (HasDoc)
refman.Doc = aspDoc;
-
- var newProj = Document.Project as AspNetAppProject;
+
+ var newProj = base.DocumentContext.Project as DotNetProject;
if (newProj != null) {
project = newProj;
refman.Project = newProj;
}
-
- documentBuilder = HasDoc ? LanguageCompletionBuilderService.GetBuilder (aspDoc.Info.Language) : null;
-
- if (documentBuilder != null) {
- documentInfo = new DocumentInfo (refman.Compilation, aspDoc, refman.GetUsings ());
- documentInfo.ParsedDocument = documentBuilder.BuildDocument (documentInfo, Editor);
- documentInfo.CodeBesideClass = CreateCodeBesideClass (documentInfo, refman);
+
+ if (HasDoc) {
+ documentInfo = new DocumentInfo (aspDoc, refman.GetUsings ());
+// localDocumentProjection = new MonoDevelop.AspNet.WebForms.CSharp.CSharpProjector ().CreateProjection (documentInfo, Editor, true).Result;
+// projectedEditor = localDocumentProjection.CreateProjectedEditor (DocumentContext);
+// Editor.SetOrUpdateProjections (DocumentContext, new [] { localDocumentProjection });
}
}
- static IUnresolvedTypeDefinition CreateCodeBesideClass (DocumentInfo info, WebFormsTypeContext refman)
+ static INamedTypeSymbol CreateCodeBesideClass (DocumentInfo info, WebFormsTypeContext refman)
{
- var memberList = new WebFormsMemberListBuilder (refman, info.AspNetDocument.XDocument);
- memberList.Build ();
- var t = new ICSharpCode.NRefactory.TypeSystem.Implementation.DefaultUnresolvedTypeDefinition (info.ClassName);
- var dom = refman.Compilation;
- var baseType = ReflectionHelper.ParseReflectionName (info.BaseType).Resolve (dom);
- foreach (var m in WebFormsCodeBehind.GetDesignerMembers (memberList.Members.Values, baseType, null)) {
- t.Members.Add (new ICSharpCode.NRefactory.TypeSystem.Implementation.DefaultUnresolvedField (t, m.Name) {
- Accessibility = Accessibility.Protected,
- ReturnType = m.Type.ToTypeReference ()
- });
- }
- return t;
+ //TODO: Roslyn port
+// var memberList = new WebFormsMemberListBuilder (refman, info.AspNetDocument.XDocument);
+// memberList.Build ();
+// var t = new ICSharpCode.NRefactory.TypeSystem.Implementation.DefaultUnresolvedTypeDefinition (info.ClassName);
+// var dom = refman.Compilation;
+// var baseType = ReflectionHelper.ParseReflectionName (info.BaseType).Resolve (dom);
+// foreach (var m in WebFormsCodeBehind.GetDesignerMembers (memberList.Members.Values, baseType, null)) {
+// t.Members.Add (new ICSharpCode.NRefactory.TypeSystem.Implementation.DefaultUnresolvedField (t, m.Name) {
+// Accessibility = Accessibility.Protected,
+// ReturnType = m.Type.ToTypeReference ()
+// });
+// }
+// return t;
+ return null;
}
- protected override ICompletionDataList HandleCodeCompletion (CodeCompletionContext completionContext,
- bool forced, ref int triggerWordLength)
+ protected override Task<ICompletionDataList> HandleCodeCompletion (
+ CodeCompletionContext completionContext, bool forced, CancellationToken token)
{
- ITextBuffer buf = Buffer;
// completionChar may be a space even if the current char isn't, when ctrl-space is fired t
- char currentChar = completionContext.TriggerOffset < 1? ' ' : buf.GetCharAt (completionContext.TriggerOffset - 1);
+ char currentChar = completionContext.TriggerOffset < 1? ' ' : Editor.GetCharAt (completionContext.TriggerOffset - 1);
//char previousChar = completionContext.TriggerOffset < 2? ' ' : buf.GetCharAt (completionContext.TriggerOffset - 2);
-
-
+
//directive names
if (Tracker.Engine.CurrentState is WebFormsDirectiveState) {
var directive = Tracker.Engine.Nodes.Peek () as WebFormsDirective;
if (HasDoc && directive != null && directive.Region.BeginLine == completionContext.TriggerLine &&
directive.Region.BeginColumn + 3 == completionContext.TriggerLineOffset)
{
- return WebFormsDirectiveCompletion.GetDirectives (aspDoc.Type);
+ return Task.FromResult ((ICompletionDataList)WebFormsDirectiveCompletion.GetDirectives (aspDoc.Type));
}
return null;
}
@@ -145,8 +150,9 @@ namespace MonoDevelop.AspNet.WebForms
if (HasDoc && directive != null && directive.Region.BeginLine == completionContext.TriggerLine &&
directive.Region.BeginColumn + 4 == completionContext.TriggerLineOffset && char.IsLetter (currentChar))
{
- triggerWordLength = 1;
- return WebFormsDirectiveCompletion.GetDirectives (aspDoc.Type);
+ completionContext.TriggerWordLength = 1;
+ completionContext.TriggerOffset -= 1;
+ return Task.FromResult ((ICompletionDataList)WebFormsDirectiveCompletion.GetDirectives (aspDoc.Type));
}
return null;
}
@@ -157,14 +163,14 @@ namespace MonoDevelop.AspNet.WebForms
if (currentChar == '<' && !(isAspExprState || Tracker.Engine.CurrentState is XmlRootState)) {
var list = new CompletionDataList ();
AddAspBeginExpressions (list);
- return list;
+ return Task.FromResult ((ICompletionDataList)list);
}
if (!HasDoc || aspDoc.Info.DocType == null) {
//FIXME: get doctype from master page
DocType = null;
} else {
- DocType = new XDocType (TextLocation.Empty);
+ DocType = new XDocType (DocumentLocation.Empty);
var matches = DocTypeRegex.Match (aspDoc.Info.DocType);
DocType.PublicFpi = matches.Groups["fpi"].Value;
DocType.Uri = matches.Groups["uri"].Value;
@@ -192,7 +198,7 @@ namespace MonoDevelop.AspNet.WebForms
}
- return base.HandleCodeCompletion (completionContext, forced, ref triggerWordLength);
+ return base.HandleCodeCompletion (completionContext, forced, token);
}
//case insensitive, no prefix
@@ -203,56 +209,53 @@ namespace MonoDevelop.AspNet.WebForms
public void InitializeCodeCompletion (char ch)
{
- int caretOffset = Document.Editor.Caret.Offset;
+ int caretOffset = Editor.CaretOffset;
int start = caretOffset - Tracker.Engine.CurrentStateLength;
- if (Document.Editor.GetCharAt (start) == '=')
+ if (Editor.GetCharAt (start) == '=')
start++;
- string sourceText = Document.Editor.GetTextBetween (start, caretOffset);
+ string sourceText = Editor.GetTextBetween (start, caretOffset);
if (ch != '\0')
sourceText += ch;
- string textAfterCaret = Document.Editor.GetTextBetween (caretOffset, Math.Min (Document.Editor.Length, Math.Max (caretOffset, Tracker.Engine.Position + Tracker.Engine.CurrentStateLength - 2)));
+ string textAfterCaret = Editor.GetTextBetween (caretOffset, Math.Min (Editor.Length, Math.Max (caretOffset, Tracker.Engine.Position + Tracker.Engine.CurrentStateLength - 2)));
- if (documentBuilder == null){
- localDocumentInfo = null;
+ if (documentBuilder == null) {
+ localDocumentProjection = null;
return;
}
- localDocumentInfo = documentBuilder.BuildLocalDocument (documentInfo, Editor, sourceText, textAfterCaret, true);
-
- var viewContent = new MonoDevelop.Ide.Gui.HiddenTextEditorViewContent ();
- viewContent.Project = Document.Project;
- viewContent.ContentName = localDocumentInfo.ParsedLocalDocument.FileName;
-
- viewContent.Text = localDocumentInfo.LocalDocument;
- viewContent.GetTextEditorData ().Caret.Offset = localDocumentInfo.CaretPosition;
-
- var workbenchWindow = new MonoDevelop.Ide.Gui.HiddenWorkbenchWindow ();
- workbenchWindow.ViewContent = viewContent;
- localDocumentInfo.HiddenDocument = new HiddenDocument (workbenchWindow) {
- HiddenParsedDocument = localDocumentInfo.ParsedLocalDocument
- };
+
+// var viewContent = new MonoDevelop.Ide.Gui.HiddenTextEditorViewContent ();
+// viewContent.Project = DocumentContext.Project;
+// viewContent.ContentName = localDocumentInfo.ParsedLocalDocument.FileName;
+//
+// viewContent.Text = localDocumentInfo.LocalDocument;
+// viewContent.Editor.CaretOffset = localDocumentInfo.CaretPosition;
+//
+// var workbenchWindow = new MonoDevelop.Ide.Gui.HiddenWorkbenchWindow ();
+// workbenchWindow.ViewContent = viewContent;
+// localDocumentInfo.HiddenDocument = new HiddenDocument (workbenchWindow) {
+// HiddenParsedDocument = localDocumentInfo.ParsedLocalDocument
+// };
}
- public override ICompletionDataList CodeCompletionCommand (CodeCompletionContext completionContext)
+ public override Task<ICompletionDataList> CodeCompletionCommand (CodeCompletionContext completionContext)
{
- //completion for ASP.NET expressions
+/* //completion for ASP.NET expressions
// TODO: Detect <script> state here !!!
if (documentBuilder != null && Tracker.Engine.CurrentState is WebFormsExpressionState) {
InitializeCodeCompletion ('\0');
- return documentBuilder.HandlePopupCompletion (defaultDocument, documentInfo, localDocumentInfo);
- }
+ return documentBuilder.HandlePopupCompletion (defaultEditor, defaultDocumentContext, documentInfo, localDocumentInfo);
+ }*/
return base.CodeCompletionCommand (completionContext);
}
- public override void Initialize ()
+ protected override void Initialize ()
{
base.Initialize ();
defaultCompletionWidget = CompletionWidget;
- defaultDocument = document;
- defaultDocument.Editor.Caret.PositionChanged += delegate {
- OnCompletionContextChanged (CompletionWidget, EventArgs.Empty);
- };
- defaultDocument.Saved += AsyncUpdateDesignerFile;
+ defaultDocumentContext = DocumentContext;
+ defaultEditor = Editor;
+ defaultDocumentContext.Saved += AsyncUpdateDesignerFile;
OnParsedDocumentUpdated ();
}
@@ -282,55 +285,51 @@ namespace MonoDevelop.AspNet.WebForms
}
});
}
-
- public override ICompletionDataList HandleCodeCompletion (
- CodeCompletionContext completionContext, char completionChar, ref int triggerWordLength)
- {
- if (localDocumentInfo == null)
- return base.HandleCodeCompletion (completionContext, completionChar, ref triggerWordLength);
- localDocumentInfo.HiddenDocument.Editor.InsertAtCaret (completionChar.ToString ());
- return documentBuilder.HandleCompletion (defaultDocument, completionContext, documentInfo, localDocumentInfo, completionChar, ref triggerWordLength);
- }
- public override bool KeyPress (Gdk.Key key, char keyChar, Gdk.ModifierType modifier)
+ // TODO: Roslyn port
+//
+// public override ICompletionDataList HandleCodeCompletionAsync (
+// CodeCompletionContext completionContext, char completionChar, ref int triggerWordLength)
+// {
+// if (localDocumentInfo == null)
+// return base.HandleCodeCompletionAsync (completionContext, completionChar, ref triggerWordLength);
+// localDocumentInfo.HiddenDocument.Editor.InsertAtCaret (completionChar.ToString ());
+// return documentBuilder.HandleCompletion (defaultEditor, defaultDocumentContext, completionContext, documentInfo, localDocumentInfo, completionChar, ref triggerWordLength);
+// }
+
+ public override bool KeyPress (KeyDescriptor descriptor)
{
Tracker.UpdateEngine ();
bool isAspExprState = Tracker.Engine.CurrentState is WebFormsExpressionState;
if (documentBuilder == null || !isAspExprState)
- return base.KeyPress (key, keyChar, modifier);
+ return base.KeyPress (descriptor);
InitializeCodeCompletion ('\0');
- document = localDocumentInfo.HiddenDocument;
- CompletionWidget = documentBuilder.CreateCompletionWidget (defaultDocument, localDocumentInfo);
+// DocumentContext = localDocumentInfo.HiddenDocument;
+// Editor = localDocumentInfo.HiddenDocument.Editor;
+// CompletionWidget = documentBuilder.CreateCompletionWidget (localDocumentInfo.HiddenDocument.Editor, localDocumentInfo.HiddenDocument, localDocumentInfo);
bool result;
try {
- result = base.KeyPress (key, keyChar, modifier);
- if (PropertyService.Get ("EnableParameterInsight", true) && (keyChar == ',' || keyChar == ')') && CanRunParameterCompletionCommand ()) {
+ result = base.KeyPress (descriptor);
+ if (PropertyService.Get ("EnableParameterInsight", true) && (descriptor.KeyChar == ',' || descriptor.KeyChar == ')') && CanRunParameterCompletionCommand ()) {
RunParameterCompletionCommand ();
}
} finally {
- document = defaultDocument;
+ DocumentContext = defaultDocumentContext;
+ Editor = defaultEditor;
CompletionWidget = defaultCompletionWidget;
}
return result;
}
-
- public override bool GetParameterCompletionCommandOffset (out int cpos)
- {
- /*if (Tracker.Engine.CurrentState is AspNetExpressionState && documentBuilder != null && localDocumentInfo != null) {
- var result = documentBuilder.GetParameterCompletionCommandOffset (defaultDocument, documentInfo, localDocumentInfo, out cpos);
- return result;
- }*/
- return base.GetParameterCompletionCommandOffset (out cpos);
- }
-
- public override ParameterDataProvider HandleParameterCompletion (CodeCompletionContext completionContext, char completionChar)
- {
-/* if (Tracker.Engine.CurrentState is AspNetExpressionState && documentBuilder != null && localDocumentInfo != null) {
- return documentBuilder.HandleParameterCompletion (defaultDocument, completionContext, documentInfo, localDocumentInfo, completionChar);
- }*/
-
- return base.HandleParameterCompletion (completionContext, completionChar);
- }
+
+// TODO: Roslyn port
+// public override ParameterHintingResult HandleParameterCompletionAsync (CodeCompletionContext completionContext, char completionChar)
+// {
+///* if (Tracker.Engine.CurrentState is AspNetExpressionState && documentBuilder != null && localDocumentInfo != null) {
+// return documentBuilder.HandleParameterCompletion (defaultDocument, completionContext, documentInfo, localDocumentInfo, completionChar);
+// }*/
+//
+// return base.HandleParameterCompletionAsync (completionContext, completionChar);
+// }
/*public override void RunParameterCompletionCommand ()
{
@@ -350,12 +349,15 @@ namespace MonoDevelop.AspNet.WebForms
}
}*/
- protected override void GetElementCompletions (CompletionDataList list)
+ protected override async Task<CompletionDataList> GetElementCompletions (CancellationToken token)
{
+ var list = new CompletionDataList ();
XName parentName = GetParentElementName (0);
-
- IType controlClass = null;
-
+
+ INamedTypeSymbol controlClass = null;
+
+ await refman.CreateCompilation (token);
+
if (parentName.HasPrefix) {
controlClass = refman.GetControlType (parentName.Prefix, parentName.Name);
} else {
@@ -363,13 +365,13 @@ namespace MonoDevelop.AspNet.WebForms
if (grandparentName.IsValid && grandparentName.HasPrefix)
controlClass = refman.GetControlType (grandparentName.Prefix, grandparentName.Name);
}
-
+
//we're just in HTML
if (controlClass == null) {
//root element?
if (!parentName.IsValid) {
if (aspDoc.Info.Subtype == WebSubtype.WebControl) {
- AddHtmlTagCompletionData (list, Schema, new XName ("div"));
+ await AddHtmlTagCompletionData (list, Schema, new XName ("div"), token);
AddAspBeginExpressions (list);
list.AddRange (refman.GetControlCompletionData ());
AddMiscBeginTags (list);
@@ -380,11 +382,11 @@ namespace MonoDevelop.AspNet.WebForms
} else {
AddAspBeginExpressions (list);
list.AddRange (refman.GetControlCompletionData ());
- base.GetElementCompletions (list);
+ list.AddRange (await base.GetElementCompletions (token));
}
- return;
+ return list;
}
-
+
string defaultProp;
bool childrenAsProperties = AreChildrenAsProperties (controlClass, out defaultProp);
if (defaultProp != null && defaultProp.Length == 0)
@@ -396,85 +398,86 @@ namespace MonoDevelop.AspNet.WebForms
list.AddRange (refman.GetControlCompletionData ());
AddMiscBeginTags (list);
//TODO: get correct parent for Content tags
- AddHtmlTagCompletionData (list, Schema, new XName ("body"));
- return;
+ await AddHtmlTagCompletionData (list, Schema, new XName ("body"), token);
+ return list;
}
//children of properties
if (childrenAsProperties && (!parentName.HasPrefix || defaultProp != null)) {
string propName = defaultProp ?? parentName.Name;
- IProperty property =
- controlClass.GetProperties ()
+ IPropertySymbol property =
+ controlClass.GetMembers ().OfType<IPropertySymbol> ()
.FirstOrDefault (x => string.Equals (propName, x.Name, StringComparison.OrdinalIgnoreCase));
if (property == null)
- return;
+ return list;
//sanity checks on attributes
switch (GetPersistenceMode (property)) {
case System.Web.UI.PersistenceMode.Attribute:
case System.Web.UI.PersistenceMode.EncodedInnerDefaultProperty:
- return;
+ return list;
case System.Web.UI.PersistenceMode.InnerDefaultProperty:
if (!parentName.HasPrefix)
- return;
+ return list;
break;
case System.Web.UI.PersistenceMode.InnerProperty:
if (parentName.HasPrefix)
- return;
+ return list;
break;
}
//check if allows freeform ASP/HTML content
- if (property.ReturnType.ToString () == "System.Web.UI.ITemplate") {
+ if (property.GetReturnType ().GetFullName () == "System.Web.UI.ITemplate") {
AddAspBeginExpressions (list);
AddMiscBeginTags (list);
- AddHtmlTagCompletionData (list, Schema, new XName ("body"));
+ await AddHtmlTagCompletionData (list, Schema, new XName ("body"), token);
list.AddRange (refman.GetControlCompletionData ());
- return;
+ return list;
}
-
+
//FIXME:unfortunately ASP.NET doesn't seem to have enough type information / attributes
//to be able to resolve the correct child types here
//so we assume it's a list and have a quick hack to find arguments of strongly typed ILists
- IType collectionType = property.ReturnType;
+ ITypeSymbol collectionType = property.GetReturnType ();
if (collectionType == null) {
list.AddRange (refman.GetControlCompletionData ());
- return;
+ return list;
}
-
+
string addStr = "Add";
- IMethod meth = collectionType.GetMethods ().FirstOrDefault (m => m.Parameters.Count == 1 && m.Name == addStr);
-
+ IMethodSymbol meth = collectionType.GetMembers ().OfType<IMethodSymbol> ().FirstOrDefault (m => m.Parameters.Length == 1 && m.Name == addStr);
+
if (meth != null) {
- IType argType = meth.Parameters [0].Type;
- var type = ReflectionHelper.ParseReflectionName ("System.Web.UI.Control").Resolve (argType.GetDefinition ().Compilation);
- if (argType != null && argType.IsBaseType (type)) {
+ var argType = meth.Parameters [0].Type as INamedTypeSymbol;
+ INamedTypeSymbol type = refman.GetTypeByMetadataName ("System.Web.UI.Control");
+ if (argType != null && type != null && argType.IsDerivedFromClass (type)) {
list.AddRange (refman.GetControlCompletionData (argType));
- return;
+ return list;
}
}
list.AddRange (refman.GetControlCompletionData ());
- return;
+ return list;
}
//properties as children of controls
if (parentName.HasPrefix && childrenAsProperties) {
- foreach (IProperty prop in GetUniqueMembers<IProperty> (controlClass.GetProperties ()))
+ foreach (IPropertySymbol prop in GetUniqueMembers<IPropertySymbol> (controlClass.GetMembers ().OfType <IPropertySymbol> ()))
if (GetPersistenceMode (prop) != System.Web.UI.PersistenceMode.Attribute)
- list.Add (prop.Name, prop.GetStockIcon (), AmbienceService.GetSummaryMarkup (prop));
- return;
+ list.Add (prop.Name, prop.GetStockIcon (), Ambience.GetSummaryMarkup (prop));
}
+ return list;
}
- protected override CompletionDataList GetAttributeCompletions (IAttributedXObject attributedOb,
- Dictionary<string, string> existingAtts)
+ protected override async Task<CompletionDataList> GetAttributeCompletions (
+ IAttributedXObject attributedOb,
+ Dictionary<string, string> existingAtts, CancellationToken token)
{
- var list = base.GetAttributeCompletions (attributedOb, existingAtts) ?? new CompletionDataList ();
+ var list = (await base.GetAttributeCompletions (attributedOb, existingAtts, token)) ?? new CompletionDataList ();
if (attributedOb is XElement) {
if (!existingAtts.ContainsKey ("runat"))
@@ -494,6 +497,7 @@ namespace MonoDevelop.AspNet.WebForms
existingAtts["ID"] = "";
if (attributedOb.Name.HasPrefix) {
+ await refman.CreateCompilation (token);
AddAspAttributeCompletionData (list, attributedOb.Name, existingAtts);
}
@@ -503,18 +507,19 @@ namespace MonoDevelop.AspNet.WebForms
return list.Count > 0? list : null;
}
- protected override CompletionDataList GetAttributeValueCompletions (IAttributedXObject ob, XAttribute att)
+ protected override async Task<CompletionDataList> GetAttributeValueCompletions (IAttributedXObject ob, XAttribute att, CancellationToken token)
{
- var list = base.GetAttributeValueCompletions (ob, att) ?? new CompletionDataList ();
+ var list = (await base.GetAttributeValueCompletions (ob, att, token)) ?? new CompletionDataList ();
if (ob is XElement) {
if (ob.Name.HasPrefix) {
string id = ob.GetId ();
if (string.IsNullOrEmpty (id) || string.IsNullOrEmpty (id.Trim ()))
id = null;
+ await refman.CreateCompilation (token);
AddAspAttributeValueCompletionData (list, ob.Name, att.Name, id);
}
} else if (ob is WebFormsDirective) {
- return WebFormsDirectiveCompletion.GetAttributeValues (project, Document.FileName, ob.Name.FullName, att.Name.FullName);
+ return WebFormsDirectiveCompletion.GetAttributeValues (project, DocumentContext.Name, ob.Name.FullName, att.Name.FullName);
}
return list.Count > 0? list : null;
}
@@ -528,26 +533,26 @@ namespace MonoDevelop.AspNet.WebForms
if (!(expr is WebFormsBindingExpression || expr is WebFormsRenderExpression))
return null;
- IType codeBehindClass;
+ INamedTypeSymbol codeBehindClass;
if (!GetCodeBehind (out codeBehindClass))
return null;
//list just the class's properties, not properties on base types
var list = new CompletionDataList ();
- list.AddRange (from p in codeBehindClass.GetProperties ()
- where p.IsPublic || p.IsPublic
+ list.AddRange (from p in codeBehindClass.GetMembers ().OfType<IPropertySymbol> ()
+ where p.DeclaredAccessibility == Accessibility.Public
select new AspAttributeCompletionData (p));
- list.AddRange (from p in codeBehindClass.GetFields ()
- where p.IsProtected || p.IsPublic
+ list.AddRange (from p in codeBehindClass.GetMembers ().OfType<IFieldSymbol> ()
+ where p.DeclaredAccessibility == Accessibility.Protected || p.DeclaredAccessibility == Accessibility.Public
select new AspAttributeCompletionData (p));
return list.Count > 0? list : null;
}
- bool GetCodeBehind (out IType codeBehindClass)
+ bool GetCodeBehind (out INamedTypeSymbol codeBehindClass)
{
if (HasDoc && !string.IsNullOrEmpty (aspDoc.Info.InheritedClass)) {
- codeBehindClass = ReflectionHelper.ParseReflectionName (aspDoc.Info.InheritedClass).Resolve (refman.Compilation);
+ codeBehindClass = refman.GetTypeByMetadataName (aspDoc.Info.InheritedClass);
return codeBehindClass != null;
}
@@ -556,7 +561,6 @@ namespace MonoDevelop.AspNet.WebForms
}
#region ASP.NET data
-
void AddAspBeginExpressions (CompletionDataList list)
{
list.Add ("%", "md-literal", GettextCatalog.GetString ("ASP.NET render block"));
@@ -564,12 +568,12 @@ namespace MonoDevelop.AspNet.WebForms
list.Add ("%@", "md-literal", GettextCatalog.GetString ("ASP.NET directive"));
list.Add ("%#", "md-literal", GettextCatalog.GetString ("ASP.NET databinding expression"));
list.Add ("%--", "md-literal", GettextCatalog.GetString ("ASP.NET server-side comment"));
-
+
//valid on 2.0+ runtime only
if (ProjClrVersion != ClrVersion.Net_1_1) {
list.Add ("%$", "md-literal", GettextCatalog.GetString ("ASP.NET resource expression"));
}
-
+
//valid on 4.0+ runtime only
if (ProjClrVersion != ClrVersion.Net_4_0) {
list.Add ("%:", "md-literal", GettextCatalog.GetString ("ASP.NET HTML encoded expression"));
@@ -580,52 +584,63 @@ namespace MonoDevelop.AspNet.WebForms
{
Debug.Assert (name.IsValid);
Debug.Assert (name.HasPrefix);
-
- IType controlClass = refman.GetControlType (name.Prefix, name.Name);
+
+ INamedTypeSymbol controlClass = refman.GetControlType (name.Prefix, name.Name);
if(controlClass != null)
AddControlMembers (list, controlClass, existingAtts);
}
-
- void AddControlMembers (CompletionDataList list, IType controlClass, Dictionary<string, string> existingAtts)
+
+ void AddControlMembers (CompletionDataList list, INamedTypeSymbol controlClass, Dictionary<string, string> existingAtts)
{
//add atts only if they're not already in the tag
- foreach (var prop in GetUniqueMembers<IProperty> (controlClass.GetProperties ()))
- if (prop.Accessibility == Accessibility.Public && (existingAtts == null || !existingAtts.ContainsKey (prop.Name)))
- if (GetPersistenceMode (prop) == System.Web.UI.PersistenceMode.Attribute)
- list.Add (new AspAttributeCompletionData (prop));
-
+ foreach (var prop in GetUniqueMembers<IPropertySymbol> (GetAllMembers<IPropertySymbol> (controlClass)))
+ if (prop.DeclaredAccessibility == Accessibility.Public && (existingAtts == null || !existingAtts.ContainsKey (prop.Name)))
+ if (GetPersistenceMode (prop) == System.Web.UI.PersistenceMode.Attribute)
+ list.Add (new AspAttributeCompletionData (prop));
+
//similarly add events
- foreach (var eve in GetUniqueMembers<IEvent> (controlClass.GetEvents ())) {
+ foreach (var eve in GetUniqueMembers<IEventSymbol> (GetAllMembers<IEventSymbol> (controlClass))) {
string eveName = "On" + eve.Name;
- if (eve.Accessibility == Accessibility.Public && (existingAtts == null || !existingAtts.ContainsKey (eveName)))
+ if (eve.DeclaredAccessibility == Accessibility.Public && (existingAtts == null || !existingAtts.ContainsKey (eveName)))
list.Add (new AspAttributeCompletionData (eve, eveName));
}
}
-
+
+ IEnumerable<T> GetAllMembers<T> (INamedTypeSymbol type)
+ {
+ INamedTypeSymbol currentType = type;
+ while (currentType != null) {
+ foreach (T member in currentType.GetMembers ().OfType<T> ())
+ yield return member;
+
+ currentType = currentType.BaseType;
+ }
+ }
+
void AddAspAttributeValueCompletionData (CompletionDataList list, XName tagName, XName attName, string id)
{
Debug.Assert (tagName.IsValid && tagName.HasPrefix);
Debug.Assert (attName.IsValid && !attName.HasPrefix);
-
- IType controlClass = refman.GetControlType (tagName.Prefix, tagName.Name);
+
+ INamedTypeSymbol controlClass = refman.GetControlType (tagName.Prefix, tagName.Name);
if (controlClass == null)
return;
//find the codebehind class
- IType codeBehindClass;
+ INamedTypeSymbol codeBehindClass;
GetCodeBehind (out codeBehindClass);
-
+
//if it's an event, suggest compatible methods
if (codeBehindClass != null && attName.Name.StartsWith ("On", StringComparison.Ordinal)) {
string eventName = attName.Name.Substring (2);
- foreach (IEvent ev in controlClass.GetEvents ()) {
+ foreach (IEventSymbol ev in controlClass.GetAccessibleMembersInThisAndBaseTypes<IEventSymbol> (controlClass)) {
if (ev.Name == eventName) {
var domMethod = BindingService.MDDomToCodeDomMethod (ev);
if (domMethod == null)
return;
- foreach (IMethod meth
+ foreach (IMethodSymbol meth
in BindingService.GetCompatibleMethodsInClass (codeBehindClass, ev)) {
list.Add (meth.Name, "md-method",
GettextCatalog.GetString ("A compatible method in the CodeBehind class"));
@@ -645,7 +660,7 @@ namespace MonoDevelop.AspNet.WebForms
list.Add (
new SuggestedHandlerCompletionData (project, domMethod, codeBehindClass,
- CodeBehind.GetNonDesignerClass (codeBehindClass))
+ CodeBehind.GetNonDesignerClassLocation (codeBehindClass))
);
return;
}
@@ -653,17 +668,17 @@ namespace MonoDevelop.AspNet.WebForms
}
//if it's a property and is an enum or bool, suggest valid values
- foreach (IProperty prop in controlClass.GetProperties ()) {
+ foreach (IPropertySymbol prop in GetAllMembers<IPropertySymbol> (controlClass)) {
if (prop.Name != attName.Name)
continue;
//boolean completion
- if (prop.ReturnType.Equals (refman.Compilation.FindType (KnownTypeCode.Boolean))) {
+ if (prop.GetReturnType ().Equals (refman.GetTypeByMetadataName ("System.Boolean"))) {
AddBooleanCompletionData (list);
return;
}
//color completion
- if (prop.ReturnType.Equals (refman.Compilation.FindType (typeof(System.Drawing.Color)))) {
+ if (prop.GetReturnType ().Equals (refman.GetTypeByMetadataName ("System.Drawing.Color"))) {
var conv = new System.Drawing.ColorConverter ();
foreach (System.Drawing.Color c in conv.GetStandardValues (null)) {
if (c.IsSystemColor)
@@ -675,17 +690,17 @@ namespace MonoDevelop.AspNet.WebForms
}
//enum completion
- IType retCls = prop.ReturnType;
- if (retCls != null && retCls.Kind == TypeKind.Enum) {
- foreach (var enumVal in retCls.GetFields ())
- if (enumVal.IsPublic && enumVal.IsStatic)
- list.Add (enumVal.Name, "md-literal", AmbienceService.GetSummaryMarkup (enumVal));
+ var retCls = prop.GetReturnType () as INamedTypeSymbol;
+ if (retCls != null && retCls.TypeKind == TypeKind.Enum) {
+ foreach (var enumVal in GetAllMembers<IFieldSymbol> (retCls))
+ if (enumVal.DeclaredAccessibility == Accessibility.Public && enumVal.IsStatic)
+ list.Add (enumVal.Name, "md-literal", Ambience.GetSummaryMarkup (enumVal));
return;
}
}
}
-
- static IEnumerable<T> GetUniqueMembers<T> (IEnumerable<T> members) where T : IMember
+
+ static IEnumerable<T> GetUniqueMembers<T> (IEnumerable<T> members) where T : ISymbol
{
var existingItems = new Dictionary<string,bool> ();
foreach (T item in members) {
@@ -701,53 +716,51 @@ namespace MonoDevelop.AspNet.WebForms
list.Add ("true", "md-literal");
list.Add ("false", "md-literal");
}
-
#endregion
-
+
#region Querying types' attributes
-
- static System.Web.UI.PersistenceMode GetPersistenceMode (IProperty prop)
+ static System.Web.UI.PersistenceMode GetPersistenceMode (IPropertySymbol prop)
{
- foreach (var att in prop.Attributes) {
- if (att.AttributeType.ReflectionName == "System.Web.UI.PersistenceModeAttribute") {
- var expr = att.PositionalArguments.FirstOrDefault ();
- if (expr == null) {
- LoggingService.LogWarning ("Unknown expression type {0} in IAttribute parameter", expr);
+ foreach (var att in prop.GetAttributes ()) {
+ if (att.AttributeClass.GetFullName () == "System.Web.UI.PersistenceModeAttribute") {
+ var expr = att.ConstructorArguments.FirstOrDefault ();
+ if (expr.IsNull) {
+ LoggingService.LogWarning ("Unknown expression type {0} in Attribute parameter", expr);
return System.Web.UI.PersistenceMode.Attribute;
}
- return (System.Web.UI.PersistenceMode) expr.ConstantValue;
+ return (System.Web.UI.PersistenceMode) expr.Value;
}
- if (att.AttributeType.ReflectionName == "System.Web.UI.TemplateContainerAttribute") {
+ if (att.AttributeClass.GetFullName () == "System.Web.UI.TemplateContainerAttribute") {
return System.Web.UI.PersistenceMode.InnerProperty;
}
}
return System.Web.UI.PersistenceMode.Attribute;
}
-
- static bool AreChildrenAsProperties (IType type, out string defaultProperty)
+
+ static bool AreChildrenAsProperties (INamedTypeSymbol type, out string defaultProperty)
{
bool childrenAsProperties = false;
defaultProperty = "";
- IAttribute att = GetAttributes (type, "System.Web.UI.ParseChildrenAttribute").FirstOrDefault ();
+ AttributeData att = GetAttributes (type, "System.Web.UI.ParseChildrenAttribute").FirstOrDefault ();
if (att == null)
return childrenAsProperties;
- var posArgs = att.PositionalArguments;
- if (posArgs.Count == 0)
+ var posArgs = att.ConstructorArguments;
+ if (posArgs.Length == 0)
return childrenAsProperties;
- if (posArgs.Count > 0) {
+ if (posArgs.Length > 0) {
var expr = posArgs [0];
- if (expr == null) {
- LoggingService.LogWarning ("Unknown expression type {0} in IAttribute parameter", expr);
+ if (expr.IsNull) {
+ LoggingService.LogWarning ("Unknown expression type {0} in Attribute parameter", expr);
return false;
}
- if (expr.ConstantValue is bool) {
- childrenAsProperties = (bool)expr.ConstantValue;
+ if (expr.Value is bool) {
+ childrenAsProperties = (bool)expr.Value;
} else {
//TODO: implement this
LoggingService.LogWarning ("ASP.NET completion does not yet handle ParseChildrenAttribute (Type)");
@@ -755,34 +768,34 @@ namespace MonoDevelop.AspNet.WebForms
}
}
- if (posArgs.Count > 1) {
+ if (posArgs.Length > 1) {
var expr = posArgs [1];
- if (expr == null || !(expr.ConstantValue is string)) {
+ if (expr.IsNull || !(expr.Value is string)) {
LoggingService.LogWarning ("Unknown expression '{0}' in IAttribute parameter", expr);
return false;
}
- defaultProperty = (string)expr.ConstantValue;
+ defaultProperty = (string)expr.Value;
}
var namedArgs = att.NamedArguments;
- if (namedArgs.Count > 0) {
- if (namedArgs.Any (p => p.Key.Name == "ChildrenAsProperties")) {
- var expr = namedArgs.First (p => p.Key.Name == "ChildrenAsProperties").Value;
- if (expr == null) {
+ if (namedArgs.Length > 0) {
+ if (namedArgs.Any (p => p.Key == "ChildrenAsProperties")) {
+ var expr = namedArgs.First (p => p.Key == "ChildrenAsProperties").Value;
+ if (expr.IsNull) {
LoggingService.LogWarning ("Unknown expression type {0} in IAttribute parameter", expr);
return false;
}
- childrenAsProperties = (bool)expr.ConstantValue;
+ childrenAsProperties = (bool)expr.Value;
}
- if (namedArgs.Any (p => p.Key.Name == "DefaultProperty")) {
- var expr = namedArgs.First (p => p.Key.Name == "DefaultProperty").Value;
- if (expr == null) {
+ if (namedArgs.Any (p => p.Key == "DefaultProperty")) {
+ var expr = namedArgs.First (p => p.Key == "DefaultProperty").Value;
+ if (expr.IsNull) {
LoggingService.LogWarning ("Unknown expression type {0} in IAttribute parameter", expr);
return false;
}
- defaultProperty = (string)expr.ConstantValue;
+ defaultProperty = (string)expr.Value;
}
- if (namedArgs.Any (p => p.Key.Name == "ChildControlType")) {
+ if (namedArgs.Any (p => p.Key == "ChildControlType")) {
//TODO: implement this
LoggingService.LogWarning ("ASP.NET completion does not yet handle ParseChildrenAttribute (Type)");
return false;
@@ -792,20 +805,19 @@ namespace MonoDevelop.AspNet.WebForms
return childrenAsProperties;
}
- static IEnumerable<IAttribute> GetAttributes (IType type, string attName)
+ static IEnumerable<AttributeData> GetAttributes (INamedTypeSymbol type, string attName)
{
- foreach (var att in type.GetDefinition ().Attributes) {
- if (att.AttributeType.ReflectionName == attName)
+ foreach (AttributeData att in type.GetAttributes()) {
+ if (att.AttributeClass.GetFullName () == attName)
yield return att;
}
- foreach (IType t2 in type.GetAllBaseTypes ()) {
- foreach (IAttribute att in t2.GetDefinition ().Attributes)
- if (att.AttributeType.ReflectionName == attName)
+ foreach (INamedTypeSymbol t2 in type.GetAllBaseClasses ()) {
+ foreach (AttributeData att in t2.GetAttributes ())
+ if (att.AttributeClass.GetFullName () == attName)
yield return att;
}
}
-
#endregion
}
}
diff --git a/main/src/addins/AspNet/WebForms/WebFormsMemberListBuilder.cs b/main/src/addins/AspNet/WebForms/WebFormsMemberListBuilder.cs
index 65783b3d8d..5ea9c7cba6 100644
--- a/main/src/addins/AspNet/WebForms/WebFormsMemberListBuilder.cs
+++ b/main/src/addins/AspNet/WebForms/WebFormsMemberListBuilder.cs
@@ -34,13 +34,13 @@ using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.TypeSystem;
-
using MonoDevelop.Core;
using MonoDevelop.AspNet.WebForms;
using MonoDevelop.AspNet.WebForms.Dom;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.TypeSystem;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AspNet.WebForms
{
@@ -86,7 +86,7 @@ namespace MonoDevelop.AspNet.WebForms
);
} else {
string controlType = element.Attributes.GetValue (new XName ("type"), true);
- IType type = docRefMan.GetType (element.Name.Prefix, element.Name.Name, controlType);
+ var type = docRefMan.GetType (element.Name.Prefix, element.Name.Name, controlType);
if (type == null) {
Errors.Add (
@@ -111,7 +111,7 @@ namespace MonoDevelop.AspNet.WebForms
public class CodeBehindMember
{
- public CodeBehindMember (string name, IType type, TextLocation location)
+ public CodeBehindMember (string name, INamedTypeSymbol type, DocumentLocation location)
{
this.Name = name;
this.Type = type;
@@ -119,7 +119,7 @@ namespace MonoDevelop.AspNet.WebForms
}
public string Name { get; private set; }
- public IType Type { get; private set; }
- public TextLocation Location { get; private set; }
+ public INamedTypeSymbol Type { get; private set; }
+ public DocumentLocation Location { get; private set; }
}
}
diff --git a/main/src/addins/AspNet/WebForms/WebFormsPageInfo.cs b/main/src/addins/AspNet/WebForms/WebFormsPageInfo.cs
index 48fcf3138e..5220656f16 100644
--- a/main/src/addins/AspNet/WebForms/WebFormsPageInfo.cs
+++ b/main/src/addins/AspNet/WebForms/WebFormsPageInfo.cs
@@ -28,11 +28,11 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.AspNet.Projects;
using MonoDevelop.AspNet.WebForms.Dom;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.TypeSystem;
namespace MonoDevelop.AspNet.WebForms
{
diff --git a/main/src/addins/AspNet/WebForms/WebFormsParsedDocument.cs b/main/src/addins/AspNet/WebForms/WebFormsParsedDocument.cs
index 0089aea70e..c45a609628 100644
--- a/main/src/addins/AspNet/WebForms/WebFormsParsedDocument.cs
+++ b/main/src/addins/AspNet/WebForms/WebFormsParsedDocument.cs
@@ -29,11 +29,12 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Xml.Dom;
using MonoDevelop.AspNet.Projects;
using MonoDevelop.AspNet.WebForms.Dom;
+using MonoDevelop.Ide.Editor;
+using System.Linq;
namespace MonoDevelop.AspNet.WebForms
{
@@ -51,8 +52,13 @@ namespace MonoDevelop.AspNet.WebForms
public WebFormsPageInfo Info { get; private set; }
public WebSubtype Type { get; private set; }
-
- public override IEnumerable<FoldingRegion> Foldings {
+
+ public override System.Threading.Tasks.Task<IReadOnlyList<FoldingRegion>> GetFoldingsAsync (System.Threading.CancellationToken cancellationToken)
+ {
+ return System.Threading.Tasks.Task.FromResult((IReadOnlyList<FoldingRegion>)Foldings.ToList ());
+ }
+
+ public IEnumerable<FoldingRegion> Foldings {
get {
if (XDocument == null)
yield break;
@@ -70,7 +76,7 @@ namespace MonoDevelop.AspNet.WebForms
yield return new FoldingRegion (
string.Format ("<{0}#{1}... >", el.Name.FullName, controlId),
- new DomRegion (el.Region.Begin, el.ClosingTag.Region.End));
+ new DocumentRegion (el.Region.Begin, el.ClosingTag.Region.End));
}
continue;
}
diff --git a/main/src/addins/AspNet/WebForms/WebFormsParser.cs b/main/src/addins/AspNet/WebForms/WebFormsParser.cs
index 03f19b91be..ba38dd44d7 100644
--- a/main/src/addins/AspNet/WebForms/WebFormsParser.cs
+++ b/main/src/addins/AspNet/WebForms/WebFormsParser.cs
@@ -30,7 +30,6 @@ using System;
using System.Collections.Generic;
using System.IO;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Core;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Projects;
@@ -38,12 +37,14 @@ using MonoDevelop.Xml.Dom;
using MonoDevelop.Xml.Parser;
using MonoDevelop.AspNet.Projects;
using MonoDevelop.AspNet.WebForms.Parser;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
namespace MonoDevelop.AspNet.WebForms
{
public class WebFormsParser : TypeSystemParser
{
- public override ParsedDocument Parse (bool storeAst, string fileName, TextReader tr, Project project = null)
+ public override System.Threading.Tasks.Task<ParsedDocument> Parse (ParseOptions parseOptions, System.Threading.CancellationToken cancellationToken)
{
var info = new WebFormsPageInfo ();
var errors = new List<Error> ();
@@ -54,9 +55,9 @@ namespace MonoDevelop.AspNet.WebForms
);
try {
- parser.Parse (tr);
+ parser.Parse (parseOptions.Content.CreateReader ());
} catch (Exception ex) {
- LoggingService.LogError ("Unhandled error parsing ASP.NET document '" + (fileName ?? "") + "'", ex);
+ LoggingService.LogError ("Unhandled error parsing ASP.NET document '" + (parseOptions.FileName ?? "") + "'", ex);
errors.Add (new Error (ErrorType.Error, "Unhandled error parsing ASP.NET document: " + ex.Message));
}
@@ -67,20 +68,20 @@ namespace MonoDevelop.AspNet.WebForms
XDocument xDoc = parser.Nodes.GetRoot ();
info.Populate (xDoc, errors);
- var type = AspNetAppProject.DetermineWebSubtype (fileName);
+ var type = AspNetAppProjectFlavor.DetermineWebSubtype (parseOptions.FileName);
if (type != info.Subtype) {
if (info.Subtype == WebSubtype.None) {
- errors.Add (new Error (ErrorType.Error, "File directive is missing", 1, 1));
+ errors.Add (new Error (ErrorType.Error, "File directive is missing", new DocumentLocation (1, 1)));
} else {
type = info.Subtype;
- errors.Add (new Error (ErrorType.Warning, "File directive does not match page extension", 1, 1));
+ errors.Add (new Error (ErrorType.Warning, "File directive does not match page extension", new DocumentLocation (1, 1)));
}
}
- var result = new WebFormsParsedDocument (fileName, type, info, xDoc);
- result.Add (errors);
+ var result = new WebFormsParsedDocument (parseOptions.FileName, type, info, xDoc);
+ result.AddRange (errors);
- return result;
+ return System.Threading.Tasks.Task.FromResult((ParsedDocument)result);
}
}
}
diff --git a/main/src/addins/AspNet/WebForms/WebFormsRegistrationCache.cs b/main/src/addins/AspNet/WebForms/WebFormsRegistrationCache.cs
index 6b3b6217ef..30fd42a2a7 100644
--- a/main/src/addins/AspNet/WebForms/WebFormsRegistrationCache.cs
+++ b/main/src/addins/AspNet/WebForms/WebFormsRegistrationCache.cs
@@ -38,9 +38,9 @@ using MonoDevelop.AspNet.Projects;
namespace MonoDevelop.AspNet.WebForms
{
- class WebFormsRegistrationCache : ProjectFileCache<AspNetAppProject,RegistrationInfo>
+ class WebFormsRegistrationCache : ProjectFileCache<DotNetProject,RegistrationInfo>
{
- public WebFormsRegistrationCache (AspNetAppProject project) : base (project)
+ public WebFormsRegistrationCache (DotNetProject project) : base (project)
{
}
diff --git a/main/src/addins/AspNet/WebForms/WebFormsSyntaxMode.cs b/main/src/addins/AspNet/WebForms/WebFormsSyntaxMode.cs
index 44942b8354..f641ef2adc 100644
--- a/main/src/addins/AspNet/WebForms/WebFormsSyntaxMode.cs
+++ b/main/src/addins/AspNet/WebForms/WebFormsSyntaxMode.cs
@@ -25,8 +25,9 @@
// THE SOFTWARE.
using System;
-using System.Collections.Generic;
using System.Linq;
+using System.Collections.Generic;
+using System.Xml;
using System.Text;
using MonoDevelop.Core;
using Mono.TextEditor;
diff --git a/main/src/addins/AspNet/WebForms/WebFormsToolboxNode.cs b/main/src/addins/AspNet/WebForms/WebFormsToolboxNode.cs
index 6ccccbddc5..2d7c8c3a28 100644
--- a/main/src/addins/AspNet/WebForms/WebFormsToolboxNode.cs
+++ b/main/src/addins/AspNet/WebForms/WebFormsToolboxNode.cs
@@ -30,7 +30,6 @@ using System;
using System.ComponentModel;
using System.Drawing.Design;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Core;
using MonoDevelop.Core.Assemblies;
using MonoDevelop.Core.Serialization;
@@ -124,9 +123,9 @@ namespace MonoDevelop.AspNet.WebForms
//FIXME: only do this on the insert, not the preview - or remove it afterwards
RegisterReference (document.Project);
- var database = document.Compilation;
+ var database = document.GetCompilationAsync ().Result;
- var cls = database.FindType (Type.Load ());
+ var cls = database.GetTypeByMetadataName (Type.Load ().FullName);
if (cls == null)
return tag;
@@ -157,7 +156,7 @@ namespace MonoDevelop.AspNet.WebForms
public bool IsCompatibleWith (MonoDevelop.Ide.Gui.Document document)
{
- switch (AspNetAppProject.DetermineWebSubtype (document.FileName)) {
+ switch (AspNetAppProjectFlavor.DetermineWebSubtype (document.FileName)) {
case WebSubtype.WebForm:
case WebSubtype.MasterPage:
case WebSubtype.WebControl:
@@ -167,7 +166,7 @@ namespace MonoDevelop.AspNet.WebForms
}
var clrVersion = ClrVersion.Net_2_0;
- var aspProj = document.Project as AspNetAppProject;
+ var aspProj = document.Project as DotNetProject;
if (aspProj != null && aspProj.TargetFramework.ClrVersion != ClrVersion.Default)
clrVersion = aspProj.TargetFramework.ClrVersion;
diff --git a/main/src/addins/AspNet/WebForms/WebFormsTypeContext.cs b/main/src/addins/AspNet/WebForms/WebFormsTypeContext.cs
index 40f949abec..bab3d82ae7 100644
--- a/main/src/addins/AspNet/WebForms/WebFormsTypeContext.cs
+++ b/main/src/addins/AspNet/WebForms/WebFormsTypeContext.cs
@@ -34,9 +34,6 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem.Implementation;
-using Mono.TextEditor;
using MonoDevelop.Core.Assemblies;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Ide.TypeSystem;
@@ -45,13 +42,18 @@ using MonoDevelop.Xml.Dom;
using MonoDevelop.AspNet.Projects;
using MonoDevelop.AspNet.WebForms.Dom;
using System.Reflection;
+using MonoDevelop.Ide.Editor;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using System.Threading;
+using System.Threading.Tasks;
namespace MonoDevelop.AspNet.WebForms
{
- public class WebFormsTypeContext
+ class WebFormsTypeContext
{
- ICompilation compilation;
- AspNetAppProject project;
+ Compilation compilation;
+ DotNetProject project;
WebFormsParsedDocument doc;
public WebFormsParsedDocument Doc {
@@ -66,7 +68,7 @@ namespace MonoDevelop.AspNet.WebForms
}
}
- public AspNetAppProject Project {
+ public DotNetProject Project {
get {
return project;
}
@@ -78,11 +80,9 @@ namespace MonoDevelop.AspNet.WebForms
}
}
- public ICompilation Compilation {
+ public AspNetAppProjectFlavor ProjectFlavor {
get {
- if (compilation == null)
- UpdateCompilation ();
- return compilation;
+ return project != null ? project.GetFlavor<AspNetAppProjectFlavor> () : null;
}
}
@@ -100,14 +100,17 @@ namespace MonoDevelop.AspNet.WebForms
}
}
- void UpdateCompilation ()
+ public async Task CreateCompilation (CancellationToken token)
{
+ if (compilation != null)
+ return;
+
const string dummyAsmName = "CompiledAspNetPage";
- IUnresolvedAssembly asm = new DefaultUnresolvedAssembly (dummyAsmName);
- compilation = new SimpleCompilation (asm, GetReferencedAssemblies ());
+ compilation = CSharpCompilation.Create (dummyAsmName)
+ .AddReferences (await GetReferencedAssemblies (token));
}
- public IType GetType (string tagPrefix, string tagName, string htmlTypeAttribute)
+ public INamedTypeSymbol GetType (string tagPrefix, string tagName, string htmlTypeAttribute)
{
if (tagPrefix == null || tagPrefix.Length < 1)
return HtmlControlTypeLookup (tagName, htmlTypeAttribute);
@@ -140,7 +143,7 @@ namespace MonoDevelop.AspNet.WebForms
return GetControlCompletionData (AssemblyTypeLookup ("System.Web.UI", "Control"));
}
- public IEnumerable<CompletionData> GetControlCompletionData (IType baseType)
+ public IEnumerable<CompletionData> GetControlCompletionData (INamedTypeSymbol baseType)
{
var names = new HashSet<string> ();
@@ -148,7 +151,7 @@ namespace MonoDevelop.AspNet.WebForms
var ard = rd as WebFormsPageInfo.AssemblyRegisterDirective;
if (ard != null) {
string prefix = ard.TagPrefix + ":";
- foreach (IType cls in ListControlClasses (baseType, ard.Namespace))
+ foreach (var cls in ListControlClasses (baseType, ard.Namespace, compilation))
if (names.Add (prefix + cls.Name))
yield return new AspTagCompletionData (prefix, cls);
continue;
@@ -160,7 +163,7 @@ namespace MonoDevelop.AspNet.WebForms
}
}
- public IType GetControlType (string tagPrefix, string tagName)
+ public INamedTypeSymbol GetControlType (string tagPrefix, string tagName)
{
if (String.IsNullOrEmpty (tagPrefix))
return null;
@@ -186,14 +189,14 @@ namespace MonoDevelop.AspNet.WebForms
return AssemblyTypeLookup ("System.Web.UI", "Control");
}
- public string GetTagPrefix (IType control)
+ public string GetTagPrefix (INamedTypeSymbol control)
{
- if (control.Namespace == "System.Web.UI.HtmlControls")
+ if (control.ContainingNamespace.GetFullName () == "System.Web.UI.HtmlControls")
return string.Empty;
foreach (var rd in GetControls ()) {
var ard = rd as WebFormsPageInfo.AssemblyRegisterDirective;
- if (ard != null && ard.Namespace == control.Namespace)
+ if (ard != null && ard.Namespace == control.ContainingNamespace.GetFullName ())
return ard.TagPrefix;
}
@@ -208,7 +211,7 @@ namespace MonoDevelop.AspNet.WebForms
/// <summary>
/// Gets a tag prefix, also returning the directive that would have to be added if necessary.
/// </summary>
- public string GetTagPrefixWithNewDirective (IType control, string assemblyName, string desiredPrefix,
+ public string GetTagPrefixWithNewDirective (INamedTypeSymbol control, string assemblyName, string desiredPrefix,
out WebFormsPageInfo.RegisterDirective directiveNeededToAdd)
{
directiveNeededToAdd = null;
@@ -223,14 +226,14 @@ namespace MonoDevelop.AspNet.WebForms
var an = SystemAssemblyService.ParseAssemblyName (assemblyName);
- directiveNeededToAdd = new WebFormsPageInfo.AssemblyRegisterDirective (prefix, control.Namespace, an.Name);
+ directiveNeededToAdd = new WebFormsPageInfo.AssemblyRegisterDirective (prefix, control.ContainingNamespace.GetFullName (), an.Name);
return prefix;
}
#region "Refactoring" operations -- things that modify the file
- string GetPrefix (IType control)
+ string GetPrefix (INamedTypeSymbol control)
{
//FIXME: make this work
/*
@@ -264,7 +267,7 @@ namespace MonoDevelop.AspNet.WebForms
}
*/
//generate a new prefix base on initials of namespace
- string[] namespaces = control.Namespace.Split ('.');
+ string[] namespaces = control.ContainingNamespace.GetFullName ().Split ('.');
char[] charr = new char[namespaces.Length];
for (int i = 0; i < charr.Length; i++)
charr[i] = char.ToLower (namespaces[i][0]);
@@ -288,7 +291,7 @@ namespace MonoDevelop.AspNet.WebForms
return p != null? p.Value as string : null;
}
- public void AddRegisterDirective (WebFormsPageInfo.RegisterDirective directive, TextEditorData editor, bool preserveCaretPosition)
+ public void AddRegisterDirective (WebFormsPageInfo.RegisterDirective directive, TextEditor editor, bool preserveCaretPosition)
{
if (doc == null)
return;
@@ -300,16 +303,17 @@ namespace MonoDevelop.AspNet.WebForms
doc.Info.RegisteredTags.Add (directive);
var line = Math.Max (node.Region.EndLine, node.Region.BeginLine);
- var pos = editor.Document.LocationToOffset (line, editor.Document.GetLine (line - 1).Length);
+ var pos = editor.LocationToOffset (line, editor.GetLine (line - 1).Length);
if (pos < 0)
return;
using (var undo = editor.OpenUndoGroup ()) {
- var oldCaret = editor.Caret.Offset;
-
- var inserted = editor.Insert (pos, editor.EolMarker + directive);
+ var oldCaret = editor.CaretOffset;
+ var text = editor.FormatString (pos, editor.EolMarker + directive);
+ var inserted = text.Length;
+ editor.InsertText (pos, text);
if (preserveCaretPosition) {
- editor.Caret.Offset = (pos < oldCaret)? oldCaret + inserted : oldCaret;
+ editor.CaretOffset = (pos < oldCaret)? oldCaret + inserted : oldCaret;
}
}
}
@@ -335,8 +339,8 @@ namespace MonoDevelop.AspNet.WebForms
IList<RegistrationInfo> GetRegistrationInfos ()
{
- if (project != null && doc != null)
- return project.RegistrationCache.GetInfosForPath (Path.GetDirectoryName (doc.FileName));
+ if (ProjectFlavor != null && doc != null)
+ return ProjectFlavor.RegistrationCache.GetInfosForPath (Path.GetDirectoryName (doc.FileName));
return new[] { WebFormsRegistrationCache.MachineRegistrationInfo };
}
@@ -373,43 +377,51 @@ namespace MonoDevelop.AspNet.WebForms
return usings;
}
- IEnumerable<IAssemblyReference> GetReferencedAssemblies ()
+ async Task<IEnumerable<MetadataReference>> GetReferencedAssemblies (CancellationToken token)
{
- var references = new HashSet<IAssemblyReference> ();
+ var references = new HashSet<MetadataReference> ();
- if (project != null)
- references.Add (TypeSystemService.GetCompilation (project).MainAssembly.UnresolvedAssembly);
+ if (project != null) {
+ var result = await TypeSystemService.GetCompilationAsync (project, token);
+ if (result != null)
+ references.Add (result.ToMetadataReference ());
+ }
+ var tasks = new List<Task<MetadataReference>> ();
if (doc != null)
- foreach (var asm in doc.Info.Assemblies.Select (a => a.Name).Select (name => GetReferencedAssembly (name)))
- references.Add (asm);
+ foreach (var t in doc.Info.Assemblies.Select (a => a.Name).Select (name => GetReferencedAssembly (name, token)))
+ tasks.Add (t);
+
+ foreach (var t in GetRegisteredAssemblies ().Select (name => GetReferencedAssembly (name, token)))
+ tasks.Add (t);
- foreach (var asm in GetRegisteredAssemblies ().Select (name => GetReferencedAssembly (name)))
+ MetadataReference[] assemblies = await Task.WhenAll (tasks);
+ foreach (var asm in assemblies)
references.Add (asm);
references.Remove (null);
return references;
- }
+ }
- IAssemblyReference GetReferencedAssembly (string assemblyName)
+ async Task<MetadataReference> GetReferencedAssembly (string assemblyName, CancellationToken token)
{
var parsed = SystemAssemblyService.ParseAssemblyName (assemblyName);
if (string.IsNullOrEmpty (parsed.Name))
return null;
- var r = GetProjectReference (parsed);
+ var r = await GetProjectReference (parsed, token);
if (r != null)
return r;
string path = GetAssemblyPath (assemblyName);
if (path != null)
- return TypeSystemService.LoadAssemblyContext (TargetRuntime, TargetFramework, path);
+ return LoadMetadataReference (path);
return null;
}
- IAssemblyReference GetProjectReference (AssemblyName parsed)
+ async Task<MetadataReference> GetProjectReference (AssemblyName parsed, CancellationToken token)
{
if (project == null)
return null;
@@ -420,20 +432,33 @@ namespace MonoDevelop.AspNet.WebForms
if (reference.ReferenceType == ReferenceType.Package || reference.ReferenceType == ReferenceType.Assembly) {
foreach (string refPath in reference.GetReferencedFileNames (null))
if (Path.GetFileName (refPath) == dllName)
- return TypeSystemService.LoadAssemblyContext (project.TargetRuntime, project.TargetFramework, refPath);
+ return LoadMetadataReference (refPath);
}
else
if (reference.ReferenceType == ReferenceType.Project && parsed.Name == reference.Reference) {
- var p = project.ParentSolution.FindProjectByName (reference.Reference) as DotNetProject;
+ var p = reference.ResolveProject (project.ParentSolution) as DotNetProject;
if (p == null)
continue;
- return TypeSystemService.GetCompilation (p).MainAssembly.UnresolvedAssembly;
+ var result = await TypeSystemService.GetCompilationAsync (p);
+ if (result != null) {
+ return result.ToMetadataReference ();
+ }
+ return null;
}
}
return null;
}
+ MetadataReference LoadMetadataReference (string path)
+ {
+ var projectId = Microsoft.CodeAnalysis.ProjectId.CreateNewId ("WebFormsTypeContext");
+ var reference = MetadataReferenceCache.LoadReference (projectId, path);
+ MetadataReferenceCache.RemoveReferences (projectId);
+
+ return reference;
+ }
+
string GetAssemblyPath (string assemblyName)
{
var parsed = SystemAssemblyService.ParseAssemblyName (assemblyName);
@@ -543,7 +568,7 @@ namespace MonoDevelop.AspNet.WebForms
}
}
- IType HtmlControlTypeLookup (string tagName, string typeAttribute)
+ INamedTypeSymbol HtmlControlTypeLookup (string tagName, string typeAttribute)
{
var str = HtmlControlLookup (tagName, typeAttribute);
if (str != null)
@@ -551,41 +576,51 @@ namespace MonoDevelop.AspNet.WebForms
return null;
}
- static IEnumerable<IType> ListControlClasses (IType baseType, string namespac)
+ static IEnumerable<INamedTypeSymbol> ListControlClasses (INamedTypeSymbol baseType, string namespac, Compilation compilation)
{
- var baseTypeDefinition = baseType.GetDefinition ();
+ var baseTypeDefinition = baseType;
if (baseTypeDefinition == null)
yield break;
//return classes if they derive from system.web.ui.control
- foreach (var type in baseTypeDefinition.GetSubTypeDefinitions ().Where (t => t.Namespace == namespac))
- if (!type.IsAbstract && type.IsPublic)
+ foreach (var type in GetSubTypes (baseTypeDefinition, compilation).Where (t => TypeHasNamespace (t, namespac)))
+ if (!type.IsAbstract && type.DeclaredAccessibility == Accessibility.Public)
yield return type;
- if (!baseTypeDefinition.IsAbstract && baseTypeDefinition.IsPublic && baseTypeDefinition.Namespace == namespac) {
+ if (!baseTypeDefinition.IsAbstract && baseTypeDefinition.DeclaredAccessibility == Accessibility.Public && TypeHasNamespace (baseTypeDefinition, namespac)) {
yield return baseType;
}
}
- IType AssemblyTypeLookup (string namespac, string tagName)
+ static IEnumerable<INamedTypeSymbol> GetSubTypes (INamedTypeSymbol baseType, Compilation compilation)
+ {
+ return compilation.GlobalNamespace.GetAllTypes().Where (t => t.IsDerivedFromClass (baseType));
+ }
+
+ static bool TypeHasNamespace (INamedTypeSymbol type, string namespac)
+ {
+ return type.ContainingNamespace != null && type.ContainingNamespace.GetFullName () == namespac;
+ }
+
+ INamedTypeSymbol AssemblyTypeLookup (string namespac, string tagName)
{
var fullName = namespac + "." + tagName;
- var type = ReflectionHelper.ParseReflectionName (fullName).Resolve (Compilation);
- if (type.Kind == TypeKind.Unknown)
+ var type = compilation.GetTypeByMetadataName (fullName);
+ if (type == null || type.Kind == SymbolKind.ErrorType)
return null;
return type;
}
- public string GetControlPrefix (IType control)
+ public string GetControlPrefix (INamedTypeSymbol control)
{
- if (control.Namespace == "System.Web.UI.WebControls")
+ if (control.ContainingNamespace.ToDisplayString (SymbolDisplayFormat.CSharpErrorMessageFormat) == "System.Web.UI.WebControls")
return "asp";
- if (control.Namespace == "System.Web.UI.HtmlControls")
+ if (control.ContainingNamespace.ToDisplayString (SymbolDisplayFormat.CSharpErrorMessageFormat) == "System.Web.UI.HtmlControls")
return string.Empty;
//todo: handle user controls
foreach (var info in GetControls ().OfType<WebFormsPageInfo.AssemblyRegisterDirective> ()) {
- if (info.Namespace == control.Namespace) {
+ if (info.Namespace == control.ContainingNamespace.ToDisplayString (SymbolDisplayFormat.CSharpErrorMessageFormat)) {
if (AssemblyTypeLookup (info.Namespace, control.Name) != null)
return info.TagPrefix;
}
@@ -597,57 +632,62 @@ namespace MonoDevelop.AspNet.WebForms
public string GetUserControlTypeName (string virtualPath)
{
string typeName = null;
- if (project != null && doc != null) {
- string absolute = project.VirtualToLocalPath (virtualPath, doc.FileName);
- typeName = project.GetCodebehindTypeName (absolute);
+ if (ProjectFlavor != null && doc != null) {
+ string absolute = ProjectFlavor.VirtualToLocalPath (virtualPath, doc.FileName);
+ typeName = ProjectFlavor.GetCodebehindTypeName (absolute);
}
return typeName ?? "System.Web.UI.UserControl";
}
- IType GetUserControlType (string virtualPath)
+ INamedTypeSymbol GetUserControlType (string virtualPath)
{
var name = GetUserControlTypeName (virtualPath);
- var type = ReflectionHelper.ParseReflectionName (name).Resolve (Compilation);
- if (type.Kind == TypeKind.Unknown)
+ var type = compilation.GetTypeByMetadataName (name);
+ if (type.Kind == SymbolKind.ErrorType)
return null;
return type;
}
+
+ public INamedTypeSymbol GetTypeByMetadataName (string fullyQualifiedMetadataName)
+ {
+ return compilation.GetTypeByMetadataName (fullyQualifiedMetadataName);
+ }
}
class AspTagCompletionData : CompletionData
{
- readonly IType cls;
+ readonly INamedTypeSymbol cls;
- public AspTagCompletionData (string prefix, IType cls)
+ public AspTagCompletionData (string prefix, INamedTypeSymbol cls)
: base (prefix + cls.Name, Gtk.Stock.GoForward)
{
this.cls = cls;
}
- public override TooltipInformation CreateTooltipInformation (bool smartWrap)
+ public override async Task<TooltipInformation> CreateTooltipInformation (bool smartWrap, CancellationToken token)
{
- var tt = base.CreateTooltipInformation (smartWrap);
- tt.SignatureMarkup = cls.FullName;
- tt.SummaryMarkup = AmbienceService.GetSummaryMarkup (cls.GetDefinition ());
+ var tt = await base.CreateTooltipInformation (smartWrap, token);
+ tt.SignatureMarkup = cls.GetFullName ();
+ tt.SummaryMarkup = await Task.Run (() => Ambience.GetSummaryMarkup (cls));
return tt;
}
}
class AspAttributeCompletionData : CompletionData
{
- readonly IMember member;
+ readonly Microsoft.CodeAnalysis.ISymbol member;
- public AspAttributeCompletionData (IMember member, string name = null)
+ public AspAttributeCompletionData (Microsoft.CodeAnalysis.ISymbol member, string name = null)
: base (name ?? member.Name, member.GetStockIcon ())
{
this.member = member;
}
- public override TooltipInformation CreateTooltipInformation (bool smartWrap)
+ public override async Task<TooltipInformation> CreateTooltipInformation (bool smartWrap, CancellationToken token)
{
- var tt = base.CreateTooltipInformation (smartWrap);
+ var tt = await base.CreateTooltipInformation (smartWrap, token);
tt.SignatureMarkup = member.Name;
- tt.SummaryMarkup = AmbienceService.GetSummaryMarkup (member);
+ tt.SummaryMarkup = await Task.Run (() => Ambience.GetSummaryMarkup (member));
return tt;
}
}
diff --git a/main/src/addins/AspNet/gtk-gui/MonoDevelop.AspNet.Projects.GtkAspNetProjectTemplateWizardPageWidget.cs b/main/src/addins/AspNet/gtk-gui/MonoDevelop.AspNet.Projects.GtkAspNetProjectTemplateWizardPageWidget.cs
new file mode 100644
index 0000000000..1c1fca1d19
--- /dev/null
+++ b/main/src/addins/AspNet/gtk-gui/MonoDevelop.AspNet.Projects.GtkAspNetProjectTemplateWizardPageWidget.cs
@@ -0,0 +1,454 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace MonoDevelop.AspNet.Projects
+{
+ internal partial class GtkAspNetProjectTemplateWizardPageWidget
+ {
+ private global::Gtk.HBox mainHBox;
+
+ private global::Gtk.EventBox leftBorderEventBox;
+
+ private global::Gtk.VBox configurationVBox;
+
+ private global::Gtk.EventBox configurationTopEventBox;
+
+ private global::Gtk.EventBox configurationTableEventBox;
+
+ private global::Gtk.Table configurationTable;
+
+ private global::Gtk.VBox includeLabelVBox;
+
+ private global::Gtk.Label includeLabelPadding;
+
+ private global::Gtk.Label includeLabel;
+
+ private global::Gtk.VBox includeUnitTestProjectVBox;
+
+ private global::Gtk.CheckButton includeTestProjectCheck;
+
+ private global::Gtk.HBox includeUnitTestProjectDescriptionHBox;
+
+ private global::Gtk.Label includeUnitTestProjectDescriptionLeftHandPadding;
+
+ private global::Gtk.Label includeUnitTestProjectDescriptionLabel;
+
+ private global::Gtk.VBox mvcVBox;
+
+ private global::Gtk.CheckButton includeMvcCheck;
+
+ private global::Gtk.HBox mvcDescriptionHBox;
+
+ private global::Gtk.Label mvcDescriptionLeftHandPadding;
+
+ private global::Gtk.Label mvcDescriptionLabel;
+
+ private global::Gtk.Label paddingLabel;
+
+ private global::Gtk.VBox testingLabelVBox;
+
+ private global::Gtk.Label testingLabelPadding;
+
+ private global::Gtk.Label testingLabel;
+
+ private global::Gtk.DrawingArea testingSeparator;
+
+ private global::Gtk.VBox webApiVBox;
+
+ private global::Gtk.CheckButton includeWebApiCheck;
+
+ private global::Gtk.HBox webApiDescriptionHBox;
+
+ private global::Gtk.Label webApiDescriptionLeftHandPadding;
+
+ private global::Gtk.Label webApiDescriptionLabel;
+
+ private global::Gtk.VBox webFormsVBox;
+
+ private global::Gtk.CheckButton includeWebFormsCheck;
+
+ private global::Gtk.HBox webFormsDescriptionHBox;
+
+ private global::Gtk.Label webFormsDescriptionLeftHandPadding;
+
+ private global::Gtk.Label webFormsDescriptionLabel;
+
+ private global::Gtk.EventBox configurationBottomEventBox;
+
+ private global::Gtk.EventBox backgroundLargeImageEventBox;
+
+ private global::Gtk.VBox backgroundLargeImageVBox;
+
+ protected virtual void Build ()
+ {
+ global::Stetic.Gui.Initialize (this);
+ // Widget MonoDevelop.AspNet.Projects.GtkAspNetProjectTemplateWizardPageWidget
+ global::Stetic.BinContainer.Attach (this);
+ this.Name = "MonoDevelop.AspNet.Projects.GtkAspNetProjectTemplateWizardPageWidget";
+ // Container child MonoDevelop.AspNet.Projects.GtkAspNetProjectTemplateWizardPageWidget.Gtk.Container+ContainerChild
+ this.mainHBox = new global::Gtk.HBox ();
+ this.mainHBox.Name = "mainHBox";
+ // Container child mainHBox.Gtk.Box+BoxChild
+ this.leftBorderEventBox = new global::Gtk.EventBox ();
+ this.leftBorderEventBox.WidthRequest = 30;
+ this.leftBorderEventBox.Name = "leftBorderEventBox";
+ this.mainHBox.Add (this.leftBorderEventBox);
+ global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.mainHBox [this.leftBorderEventBox]));
+ w1.Position = 0;
+ w1.Expand = false;
+ // Container child mainHBox.Gtk.Box+BoxChild
+ this.configurationVBox = new global::Gtk.VBox ();
+ this.configurationVBox.WidthRequest = 440;
+ this.configurationVBox.Name = "configurationVBox";
+ // Container child configurationVBox.Gtk.Box+BoxChild
+ this.configurationTopEventBox = new global::Gtk.EventBox ();
+ this.configurationTopEventBox.Name = "configurationTopEventBox";
+ this.configurationVBox.Add (this.configurationTopEventBox);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.configurationVBox [this.configurationTopEventBox]));
+ w2.Position = 0;
+ // Container child configurationVBox.Gtk.Box+BoxChild
+ this.configurationTableEventBox = new global::Gtk.EventBox ();
+ this.configurationTableEventBox.Name = "configurationTableEventBox";
+ // Container child configurationTableEventBox.Gtk.Container+ContainerChild
+ this.configurationTable = new global::Gtk.Table (((uint)(6)), ((uint)(3)), false);
+ this.configurationTable.Name = "configurationTable";
+ this.configurationTable.RowSpacing = ((uint)(7));
+ this.configurationTable.ColumnSpacing = ((uint)(6));
+ // Container child configurationTable.Gtk.Table+TableChild
+ this.includeLabelVBox = new global::Gtk.VBox ();
+ this.includeLabelVBox.Name = "includeLabelVBox";
+ // Container child includeLabelVBox.Gtk.Box+BoxChild
+ this.includeLabelPadding = new global::Gtk.Label ();
+ this.includeLabelPadding.WidthRequest = 0;
+ this.includeLabelPadding.HeightRequest = 3;
+ this.includeLabelPadding.Name = "includeLabelPadding";
+ this.includeLabelVBox.Add (this.includeLabelPadding);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.includeLabelVBox [this.includeLabelPadding]));
+ w3.Position = 0;
+ w3.Expand = false;
+ w3.Fill = false;
+ // Container child includeLabelVBox.Gtk.Box+BoxChild
+ this.includeLabel = new global::Gtk.Label ();
+ this.includeLabel.Name = "includeLabel";
+ this.includeLabel.Xpad = 5;
+ this.includeLabel.Xalign = 1F;
+ this.includeLabel.Yalign = 0F;
+ this.includeLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Include:");
+ this.includeLabel.Justify = ((global::Gtk.Justification)(1));
+ this.includeLabelVBox.Add (this.includeLabel);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.includeLabelVBox [this.includeLabel]));
+ w4.Position = 1;
+ w4.Expand = false;
+ w4.Fill = false;
+ this.configurationTable.Add (this.includeLabelVBox);
+ global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.configurationTable [this.includeLabelVBox]));
+ w5.XOptions = ((global::Gtk.AttachOptions)(4));
+ w5.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child configurationTable.Gtk.Table+TableChild
+ this.includeUnitTestProjectVBox = new global::Gtk.VBox ();
+ this.includeUnitTestProjectVBox.Name = "includeUnitTestProjectVBox";
+ // Container child includeUnitTestProjectVBox.Gtk.Box+BoxChild
+ this.includeTestProjectCheck = new global::Gtk.CheckButton ();
+ this.includeTestProjectCheck.CanFocus = true;
+ this.includeTestProjectCheck.Name = "includeTestProjectCheck";
+ this.includeTestProjectCheck.Label = global::Mono.Unix.Catalog.GetString ("Include Unit Test Project");
+ this.includeTestProjectCheck.Active = true;
+ this.includeTestProjectCheck.DrawIndicator = true;
+ this.includeTestProjectCheck.UseUnderline = true;
+ this.includeUnitTestProjectVBox.Add (this.includeTestProjectCheck);
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.includeUnitTestProjectVBox [this.includeTestProjectCheck]));
+ w6.Position = 0;
+ w6.Expand = false;
+ w6.Fill = false;
+ // Container child includeUnitTestProjectVBox.Gtk.Box+BoxChild
+ this.includeUnitTestProjectDescriptionHBox = new global::Gtk.HBox ();
+ this.includeUnitTestProjectDescriptionHBox.Name = "includeUnitTestProjectDescriptionHBox";
+ // Container child includeUnitTestProjectDescriptionHBox.Gtk.Box+BoxChild
+ this.includeUnitTestProjectDescriptionLeftHandPadding = new global::Gtk.Label ();
+ this.includeUnitTestProjectDescriptionLeftHandPadding.WidthRequest = 21;
+ this.includeUnitTestProjectDescriptionLeftHandPadding.Name = "includeUnitTestProjectDescriptionLeftHandPadding";
+ this.includeUnitTestProjectDescriptionHBox.Add (this.includeUnitTestProjectDescriptionLeftHandPadding);
+ global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.includeUnitTestProjectDescriptionHBox [this.includeUnitTestProjectDescriptionLeftHandPadding]));
+ w7.Position = 0;
+ w7.Expand = false;
+ w7.Fill = false;
+ // Container child includeUnitTestProjectDescriptionHBox.Gtk.Box+BoxChild
+ this.includeUnitTestProjectDescriptionLabel = new global::Gtk.Label ();
+ this.includeUnitTestProjectDescriptionLabel.WidthRequest = 255;
+ this.includeUnitTestProjectDescriptionLabel.Name = "includeUnitTestProjectDescriptionLabel";
+ this.includeUnitTestProjectDescriptionLabel.Xalign = 0F;
+ this.includeUnitTestProjectDescriptionLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span size=\'smaller\' color=\'grey\'>Add a Unit Test Project for testing the Web Pro" +
+ "ject using NUnit</span>");
+ this.includeUnitTestProjectDescriptionLabel.UseMarkup = true;
+ this.includeUnitTestProjectDescriptionLabel.Wrap = true;
+ this.includeUnitTestProjectDescriptionHBox.Add (this.includeUnitTestProjectDescriptionLabel);
+ global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.includeUnitTestProjectDescriptionHBox [this.includeUnitTestProjectDescriptionLabel]));
+ w8.Position = 1;
+ w8.Expand = false;
+ w8.Fill = false;
+ this.includeUnitTestProjectVBox.Add (this.includeUnitTestProjectDescriptionHBox);
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.includeUnitTestProjectVBox [this.includeUnitTestProjectDescriptionHBox]));
+ w9.Position = 1;
+ w9.Expand = false;
+ w9.Fill = false;
+ this.configurationTable.Add (this.includeUnitTestProjectVBox);
+ global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.configurationTable [this.includeUnitTestProjectVBox]));
+ w10.TopAttach = ((uint)(4));
+ w10.BottomAttach = ((uint)(5));
+ w10.LeftAttach = ((uint)(1));
+ w10.RightAttach = ((uint)(2));
+ w10.XOptions = ((global::Gtk.AttachOptions)(4));
+ w10.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child configurationTable.Gtk.Table+TableChild
+ this.mvcVBox = new global::Gtk.VBox ();
+ this.mvcVBox.Name = "mvcVBox";
+ // Container child mvcVBox.Gtk.Box+BoxChild
+ this.includeMvcCheck = new global::Gtk.CheckButton ();
+ this.includeMvcCheck.CanFocus = true;
+ this.includeMvcCheck.Name = "includeMvcCheck";
+ this.includeMvcCheck.Label = global::Mono.Unix.Catalog.GetString ("MVC");
+ this.includeMvcCheck.Active = true;
+ this.includeMvcCheck.DrawIndicator = true;
+ this.includeMvcCheck.UseUnderline = true;
+ this.mvcVBox.Add (this.includeMvcCheck);
+ global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.mvcVBox [this.includeMvcCheck]));
+ w11.Position = 0;
+ w11.Expand = false;
+ w11.Fill = false;
+ // Container child mvcVBox.Gtk.Box+BoxChild
+ this.mvcDescriptionHBox = new global::Gtk.HBox ();
+ this.mvcDescriptionHBox.Name = "mvcDescriptionHBox";
+ // Container child mvcDescriptionHBox.Gtk.Box+BoxChild
+ this.mvcDescriptionLeftHandPadding = new global::Gtk.Label ();
+ this.mvcDescriptionLeftHandPadding.WidthRequest = 21;
+ this.mvcDescriptionLeftHandPadding.Name = "mvcDescriptionLeftHandPadding";
+ this.mvcDescriptionHBox.Add (this.mvcDescriptionLeftHandPadding);
+ global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.mvcDescriptionHBox [this.mvcDescriptionLeftHandPadding]));
+ w12.Position = 0;
+ w12.Expand = false;
+ w12.Fill = false;
+ // Container child mvcDescriptionHBox.Gtk.Box+BoxChild
+ this.mvcDescriptionLabel = new global::Gtk.Label ();
+ this.mvcDescriptionLabel.WidthRequest = 255;
+ this.mvcDescriptionLabel.Name = "mvcDescriptionLabel";
+ this.mvcDescriptionLabel.Xalign = 0F;
+ this.mvcDescriptionLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span size=\'smaller\' color=\'grey\'>Modern programming model. Unit testable, choice" +
+ " of templating languages</span>");
+ this.mvcDescriptionLabel.UseMarkup = true;
+ this.mvcDescriptionLabel.Wrap = true;
+ this.mvcDescriptionHBox.Add (this.mvcDescriptionLabel);
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.mvcDescriptionHBox [this.mvcDescriptionLabel]));
+ w13.Position = 1;
+ w13.Expand = false;
+ w13.Fill = false;
+ this.mvcVBox.Add (this.mvcDescriptionHBox);
+ global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.mvcVBox [this.mvcDescriptionHBox]));
+ w14.Position = 1;
+ w14.Expand = false;
+ w14.Fill = false;
+ this.configurationTable.Add (this.mvcVBox);
+ global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.configurationTable [this.mvcVBox]));
+ w15.LeftAttach = ((uint)(1));
+ w15.RightAttach = ((uint)(2));
+ w15.XOptions = ((global::Gtk.AttachOptions)(4));
+ w15.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child configurationTable.Gtk.Table+TableChild
+ this.paddingLabel = new global::Gtk.Label ();
+ this.paddingLabel.WidthRequest = 132;
+ this.paddingLabel.Name = "paddingLabel";
+ this.paddingLabel.Justify = ((global::Gtk.Justification)(1));
+ this.configurationTable.Add (this.paddingLabel);
+ global::Gtk.Table.TableChild w16 = ((global::Gtk.Table.TableChild)(this.configurationTable [this.paddingLabel]));
+ w16.TopAttach = ((uint)(5));
+ w16.BottomAttach = ((uint)(6));
+ w16.XOptions = ((global::Gtk.AttachOptions)(4));
+ w16.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child configurationTable.Gtk.Table+TableChild
+ this.testingLabelVBox = new global::Gtk.VBox ();
+ this.testingLabelVBox.Name = "testingLabelVBox";
+ // Container child testingLabelVBox.Gtk.Box+BoxChild
+ this.testingLabelPadding = new global::Gtk.Label ();
+ this.testingLabelPadding.WidthRequest = 0;
+ this.testingLabelPadding.HeightRequest = 3;
+ this.testingLabelPadding.Name = "testingLabelPadding";
+ this.testingLabelVBox.Add (this.testingLabelPadding);
+ global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.testingLabelVBox [this.testingLabelPadding]));
+ w17.Position = 0;
+ w17.Expand = false;
+ w17.Fill = false;
+ // Container child testingLabelVBox.Gtk.Box+BoxChild
+ this.testingLabel = new global::Gtk.Label ();
+ this.testingLabel.Name = "testingLabel";
+ this.testingLabel.Xpad = 5;
+ this.testingLabel.Xalign = 1F;
+ this.testingLabel.Yalign = 0F;
+ this.testingLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Testing:");
+ this.testingLabel.Justify = ((global::Gtk.Justification)(1));
+ this.testingLabelVBox.Add (this.testingLabel);
+ global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.testingLabelVBox [this.testingLabel]));
+ w18.Position = 1;
+ w18.Expand = false;
+ w18.Fill = false;
+ this.configurationTable.Add (this.testingLabelVBox);
+ global::Gtk.Table.TableChild w19 = ((global::Gtk.Table.TableChild)(this.configurationTable [this.testingLabelVBox]));
+ w19.TopAttach = ((uint)(4));
+ w19.BottomAttach = ((uint)(5));
+ w19.XOptions = ((global::Gtk.AttachOptions)(4));
+ w19.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child configurationTable.Gtk.Table+TableChild
+ this.testingSeparator = new global::Gtk.DrawingArea ();
+ this.testingSeparator.WidthRequest = 440;
+ this.testingSeparator.HeightRequest = 1;
+ this.testingSeparator.Name = "testingSeparator";
+ this.configurationTable.Add (this.testingSeparator);
+ global::Gtk.Table.TableChild w20 = ((global::Gtk.Table.TableChild)(this.configurationTable [this.testingSeparator]));
+ w20.TopAttach = ((uint)(3));
+ w20.BottomAttach = ((uint)(4));
+ w20.RightAttach = ((uint)(3));
+ w20.YPadding = ((uint)(10));
+ w20.XOptions = ((global::Gtk.AttachOptions)(4));
+ w20.YOptions = ((global::Gtk.AttachOptions)(0));
+ // Container child configurationTable.Gtk.Table+TableChild
+ this.webApiVBox = new global::Gtk.VBox ();
+ this.webApiVBox.Name = "webApiVBox";
+ // Container child webApiVBox.Gtk.Box+BoxChild
+ this.includeWebApiCheck = new global::Gtk.CheckButton ();
+ this.includeWebApiCheck.CanFocus = true;
+ this.includeWebApiCheck.Name = "includeWebApiCheck";
+ this.includeWebApiCheck.Label = global::Mono.Unix.Catalog.GetString ("Web API");
+ this.includeWebApiCheck.Active = true;
+ this.includeWebApiCheck.DrawIndicator = true;
+ this.includeWebApiCheck.UseUnderline = true;
+ this.webApiVBox.Add (this.includeWebApiCheck);
+ global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.webApiVBox [this.includeWebApiCheck]));
+ w21.Position = 0;
+ w21.Expand = false;
+ w21.Fill = false;
+ // Container child webApiVBox.Gtk.Box+BoxChild
+ this.webApiDescriptionHBox = new global::Gtk.HBox ();
+ this.webApiDescriptionHBox.Name = "webApiDescriptionHBox";
+ // Container child webApiDescriptionHBox.Gtk.Box+BoxChild
+ this.webApiDescriptionLeftHandPadding = new global::Gtk.Label ();
+ this.webApiDescriptionLeftHandPadding.WidthRequest = 21;
+ this.webApiDescriptionLeftHandPadding.Name = "webApiDescriptionLeftHandPadding";
+ this.webApiDescriptionHBox.Add (this.webApiDescriptionLeftHandPadding);
+ global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.webApiDescriptionHBox [this.webApiDescriptionLeftHandPadding]));
+ w22.Position = 0;
+ w22.Expand = false;
+ w22.Fill = false;
+ // Container child webApiDescriptionHBox.Gtk.Box+BoxChild
+ this.webApiDescriptionLabel = new global::Gtk.Label ();
+ this.webApiDescriptionLabel.WidthRequest = 255;
+ this.webApiDescriptionLabel.Name = "webApiDescriptionLabel";
+ this.webApiDescriptionLabel.Xalign = 0F;
+ this.webApiDescriptionLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span size=\'smaller\' color=\'grey\'>Framework for creating HTTP web services</span>" +
+ "");
+ this.webApiDescriptionLabel.UseMarkup = true;
+ this.webApiDescriptionLabel.Wrap = true;
+ this.webApiDescriptionHBox.Add (this.webApiDescriptionLabel);
+ global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.webApiDescriptionHBox [this.webApiDescriptionLabel]));
+ w23.Position = 1;
+ w23.Expand = false;
+ w23.Fill = false;
+ this.webApiVBox.Add (this.webApiDescriptionHBox);
+ global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.webApiVBox [this.webApiDescriptionHBox]));
+ w24.Position = 1;
+ w24.Expand = false;
+ w24.Fill = false;
+ this.configurationTable.Add (this.webApiVBox);
+ global::Gtk.Table.TableChild w25 = ((global::Gtk.Table.TableChild)(this.configurationTable [this.webApiVBox]));
+ w25.TopAttach = ((uint)(2));
+ w25.BottomAttach = ((uint)(3));
+ w25.LeftAttach = ((uint)(1));
+ w25.RightAttach = ((uint)(2));
+ w25.XOptions = ((global::Gtk.AttachOptions)(4));
+ w25.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child configurationTable.Gtk.Table+TableChild
+ this.webFormsVBox = new global::Gtk.VBox ();
+ this.webFormsVBox.Name = "webFormsVBox";
+ // Container child webFormsVBox.Gtk.Box+BoxChild
+ this.includeWebFormsCheck = new global::Gtk.CheckButton ();
+ this.includeWebFormsCheck.CanFocus = true;
+ this.includeWebFormsCheck.Name = "includeWebFormsCheck";
+ this.includeWebFormsCheck.Label = global::Mono.Unix.Catalog.GetString ("Web Forms");
+ this.includeWebFormsCheck.Active = true;
+ this.includeWebFormsCheck.DrawIndicator = true;
+ this.includeWebFormsCheck.UseUnderline = true;
+ this.webFormsVBox.Add (this.includeWebFormsCheck);
+ global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.webFormsVBox [this.includeWebFormsCheck]));
+ w26.Position = 0;
+ w26.Expand = false;
+ w26.Fill = false;
+ // Container child webFormsVBox.Gtk.Box+BoxChild
+ this.webFormsDescriptionHBox = new global::Gtk.HBox ();
+ this.webFormsDescriptionHBox.Name = "webFormsDescriptionHBox";
+ // Container child webFormsDescriptionHBox.Gtk.Box+BoxChild
+ this.webFormsDescriptionLeftHandPadding = new global::Gtk.Label ();
+ this.webFormsDescriptionLeftHandPadding.WidthRequest = 21;
+ this.webFormsDescriptionLeftHandPadding.Name = "webFormsDescriptionLeftHandPadding";
+ this.webFormsDescriptionHBox.Add (this.webFormsDescriptionLeftHandPadding);
+ global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.webFormsDescriptionHBox [this.webFormsDescriptionLeftHandPadding]));
+ w27.Position = 0;
+ w27.Expand = false;
+ w27.Fill = false;
+ // Container child webFormsDescriptionHBox.Gtk.Box+BoxChild
+ this.webFormsDescriptionLabel = new global::Gtk.Label ();
+ this.webFormsDescriptionLabel.WidthRequest = 255;
+ this.webFormsDescriptionLabel.Name = "webFormsDescriptionLabel";
+ this.webFormsDescriptionLabel.Xalign = 0F;
+ this.webFormsDescriptionLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span size=\'smaller\' color=\'grey\'>Stateful programming model similar to desktop a" +
+ "pplications</span>");
+ this.webFormsDescriptionLabel.UseMarkup = true;
+ this.webFormsDescriptionLabel.Wrap = true;
+ this.webFormsDescriptionHBox.Add (this.webFormsDescriptionLabel);
+ global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.webFormsDescriptionHBox [this.webFormsDescriptionLabel]));
+ w28.Position = 1;
+ w28.Expand = false;
+ w28.Fill = false;
+ this.webFormsVBox.Add (this.webFormsDescriptionHBox);
+ global::Gtk.Box.BoxChild w29 = ((global::Gtk.Box.BoxChild)(this.webFormsVBox [this.webFormsDescriptionHBox]));
+ w29.Position = 1;
+ w29.Expand = false;
+ w29.Fill = false;
+ this.configurationTable.Add (this.webFormsVBox);
+ global::Gtk.Table.TableChild w30 = ((global::Gtk.Table.TableChild)(this.configurationTable [this.webFormsVBox]));
+ w30.TopAttach = ((uint)(1));
+ w30.BottomAttach = ((uint)(2));
+ w30.LeftAttach = ((uint)(1));
+ w30.RightAttach = ((uint)(2));
+ w30.XOptions = ((global::Gtk.AttachOptions)(4));
+ w30.YOptions = ((global::Gtk.AttachOptions)(4));
+ this.configurationTableEventBox.Add (this.configurationTable);
+ this.configurationVBox.Add (this.configurationTableEventBox);
+ global::Gtk.Box.BoxChild w32 = ((global::Gtk.Box.BoxChild)(this.configurationVBox [this.configurationTableEventBox]));
+ w32.Position = 1;
+ w32.Expand = false;
+ w32.Fill = false;
+ // Container child configurationVBox.Gtk.Box+BoxChild
+ this.configurationBottomEventBox = new global::Gtk.EventBox ();
+ this.configurationBottomEventBox.Name = "configurationBottomEventBox";
+ this.configurationVBox.Add (this.configurationBottomEventBox);
+ global::Gtk.Box.BoxChild w33 = ((global::Gtk.Box.BoxChild)(this.configurationVBox [this.configurationBottomEventBox]));
+ w33.Position = 2;
+ this.mainHBox.Add (this.configurationVBox);
+ global::Gtk.Box.BoxChild w34 = ((global::Gtk.Box.BoxChild)(this.mainHBox [this.configurationVBox]));
+ w34.Position = 1;
+ w34.Expand = false;
+ w34.Fill = false;
+ // Container child mainHBox.Gtk.Box+BoxChild
+ this.backgroundLargeImageEventBox = new global::Gtk.EventBox ();
+ this.backgroundLargeImageEventBox.Name = "backgroundLargeImageEventBox";
+ // Container child backgroundLargeImageEventBox.Gtk.Container+ContainerChild
+ this.backgroundLargeImageVBox = new global::Gtk.VBox ();
+ this.backgroundLargeImageVBox.Name = "backgroundLargeImageVBox";
+ this.backgroundLargeImageEventBox.Add (this.backgroundLargeImageVBox);
+ this.mainHBox.Add (this.backgroundLargeImageEventBox);
+ global::Gtk.Box.BoxChild w36 = ((global::Gtk.Box.BoxChild)(this.mainHBox [this.backgroundLargeImageEventBox]));
+ w36.Position = 2;
+ this.Add (this.mainHBox);
+ if ((this.Child != null)) {
+ this.Child.ShowAll ();
+ }
+ this.Hide ();
+ }
+ }
+}
diff --git a/main/src/addins/AspNet/gtk-gui/generated.cs b/main/src/addins/AspNet/gtk-gui/generated.cs
new file mode 100644
index 0000000000..97249fd82d
--- /dev/null
+++ b/main/src/addins/AspNet/gtk-gui/generated.cs
@@ -0,0 +1,83 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace Stetic
+{
+ internal class Gui
+ {
+ private static bool initialized;
+
+ internal static void Initialize (Gtk.Widget iconRenderer)
+ {
+ if ((Stetic.Gui.initialized == false)) {
+ Stetic.Gui.initialized = true;
+ }
+ }
+ }
+
+ internal class BinContainer
+ {
+ private Gtk.Widget child;
+
+ private Gtk.UIManager uimanager;
+
+ public static BinContainer Attach (Gtk.Bin bin)
+ {
+ BinContainer bc = new BinContainer ();
+ bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested);
+ bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated);
+ bin.Added += new Gtk.AddedHandler (bc.OnAdded);
+ return bc;
+ }
+
+ private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args)
+ {
+ if ((this.child != null)) {
+ args.Requisition = this.child.SizeRequest ();
+ }
+ }
+
+ private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args)
+ {
+ if ((this.child != null)) {
+ this.child.Allocation = args.Allocation;
+ }
+ }
+
+ private void OnAdded (object sender, Gtk.AddedArgs args)
+ {
+ this.child = args.Widget;
+ }
+
+ public void SetUiManager (Gtk.UIManager uim)
+ {
+ this.uimanager = uim;
+ this.child.Realized += new System.EventHandler (this.OnRealized);
+ }
+
+ private void OnRealized (object sender, System.EventArgs args)
+ {
+ if ((this.uimanager != null)) {
+ Gtk.Widget w;
+ w = this.child.Toplevel;
+ if (((w != null)
+ && typeof(Gtk.Window).IsInstanceOfType (w))) {
+ ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup);
+ this.uimanager = null;
+ }
+ }
+ }
+ }
+
+ internal class ActionGroups
+ {
+ public static Gtk.ActionGroup GetActionGroup (System.Type type)
+ {
+ return Stetic.ActionGroups.GetActionGroup (type.FullName);
+ }
+
+ public static Gtk.ActionGroup GetActionGroup (string name)
+ {
+ return null;
+ }
+ }
+}
diff --git a/main/src/addins/AspNet/gtk-gui/gui.stetic b/main/src/addins/AspNet/gtk-gui/gui.stetic
new file mode 100644
index 0000000000..f1125be1ca
--- /dev/null
+++ b/main/src/addins/AspNet/gtk-gui/gui.stetic
@@ -0,0 +1,575 @@
+<?xml version="1.0" encoding="utf-8"?>
+<stetic-interface>
+ <configuration>
+ <images-root-path>..</images-root-path>
+ <target-gtk-version>2.12</target-gtk-version>
+ </configuration>
+ <import>
+ <widget-library name="../../../../build/bin/MonoDevelop.Ide.dll" />
+ <widget-library name="../../../../build/AddIns/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.dll" />
+ <widget-library name="../../../../build/bin/Mono.TextEditor.dll" />
+ <widget-library name="../../../../build/AddIns/MonoDevelop.Refactoring/MonoDevelop.Refactoring.dll" />
+ <widget-library name="../../../../build/AddIns/DisplayBindings/SourceEditor/MonoDevelop.SourceEditor2.dll" />
+ <widget-library name="../../../../build/AddIns/MonoDevelop.Debugger/MonoDevelop.Debugger.dll" />
+ <widget-library name="../../../../build/AddIns/MonoDevelop.TextTemplating/MonoDevelop.TextTemplating.dll" />
+ <widget-library name="../../../../build/AddIns/Xml/MonoDevelop.Xml.dll" />
+ <widget-library name="../../../../build/AddIns/AspNet/MonoDevelop.AspNet.dll" internal="true" />
+ </import>
+ <widget class="Gtk.Bin" id="MonoDevelop.AspNet.Projects.GtkAspNetProjectTemplateWizardPageWidget" design-size="644 395">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <property name="GeneratePublic">False</property>
+ <child>
+ <widget class="Gtk.HBox" id="mainHBox">
+ <property name="MemberName" />
+ <child>
+ <widget class="Gtk.EventBox" id="leftBorderEventBox">
+ <property name="MemberName" />
+ <property name="WidthRequest">30</property>
+ <child>
+ <placeholder />
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">False</property>
+ <property name="Expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.VBox" id="configurationVBox">
+ <property name="MemberName" />
+ <property name="WidthRequest">440</property>
+ <child>
+ <widget class="Gtk.EventBox" id="configurationTopEventBox">
+ <property name="MemberName" />
+ <child>
+ <placeholder />
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.EventBox" id="configurationTableEventBox">
+ <property name="MemberName" />
+ <child>
+ <widget class="Gtk.Table" id="configurationTable">
+ <property name="MemberName" />
+ <property name="NRows">6</property>
+ <property name="NColumns">3</property>
+ <property name="RowSpacing">7</property>
+ <property name="ColumnSpacing">6</property>
+ <child>
+ <placeholder />
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ <child>
+ <widget class="Gtk.VBox" id="includeLabelVBox">
+ <property name="MemberName" />
+ <child>
+ <widget class="Gtk.Label" id="includeLabelPadding">
+ <property name="MemberName" />
+ <property name="WidthRequest">0</property>
+ <property name="HeightRequest">3</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">False</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="includeLabel">
+ <property name="MemberName" />
+ <property name="Xpad">5</property>
+ <property name="Xalign">1</property>
+ <property name="Yalign">0</property>
+ <property name="LabelProp" translatable="yes">Include:</property>
+ <property name="Justify">Right</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="AutoSize">True</property>
+ <property name="XOptions">Fill</property>
+ <property name="YOptions">Fill</property>
+ <property name="XExpand">False</property>
+ <property name="XFill">True</property>
+ <property name="XShrink">False</property>
+ <property name="YExpand">False</property>
+ <property name="YFill">True</property>
+ <property name="YShrink">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.VBox" id="includeUnitTestProjectVBox">
+ <property name="MemberName" />
+ <child>
+ <widget class="Gtk.CheckButton" id="includeTestProjectCheck">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Label" translatable="yes">Include Unit Test Project</property>
+ <property name="Active">True</property>
+ <property name="DrawIndicator">True</property>
+ <property name="HasLabel">True</property>
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="includeUnitTestProjectDescriptionHBox">
+ <property name="MemberName" />
+ <child>
+ <widget class="Gtk.Label" id="includeUnitTestProjectDescriptionLeftHandPadding">
+ <property name="MemberName" />
+ <property name="WidthRequest">21</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="includeUnitTestProjectDescriptionLabel">
+ <property name="MemberName" />
+ <property name="WidthRequest">255</property>
+ <property name="Xalign">0</property>
+ <property name="LabelProp" translatable="yes">&lt;span size='smaller' color='grey'&gt;Add a Unit Test Project for testing the Web Project using NUnit&lt;/span&gt;</property>
+ <property name="UseMarkup">True</property>
+ <property name="Wrap">True</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="TopAttach">4</property>
+ <property name="BottomAttach">5</property>
+ <property name="LeftAttach">1</property>
+ <property name="RightAttach">2</property>
+ <property name="AutoSize">True</property>
+ <property name="XOptions">Fill</property>
+ <property name="YOptions">Fill</property>
+ <property name="XExpand">False</property>
+ <property name="XFill">True</property>
+ <property name="XShrink">False</property>
+ <property name="YExpand">False</property>
+ <property name="YFill">True</property>
+ <property name="YShrink">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.VBox" id="mvcVBox">
+ <property name="MemberName" />
+ <child>
+ <widget class="Gtk.CheckButton" id="includeMvcCheck">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Label" translatable="yes">MVC</property>
+ <property name="Active">True</property>
+ <property name="DrawIndicator">True</property>
+ <property name="HasLabel">True</property>
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="mvcDescriptionHBox">
+ <property name="MemberName" />
+ <child>
+ <widget class="Gtk.Label" id="mvcDescriptionLeftHandPadding">
+ <property name="MemberName" />
+ <property name="WidthRequest">21</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="mvcDescriptionLabel">
+ <property name="MemberName" />
+ <property name="WidthRequest">255</property>
+ <property name="Xalign">0</property>
+ <property name="LabelProp" translatable="yes">&lt;span size='smaller' color='grey'&gt;Modern programming model. Unit testable, choice of templating languages&lt;/span&gt;</property>
+ <property name="UseMarkup">True</property>
+ <property name="Wrap">True</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="LeftAttach">1</property>
+ <property name="RightAttach">2</property>
+ <property name="AutoSize">True</property>
+ <property name="XOptions">Fill</property>
+ <property name="YOptions">Fill</property>
+ <property name="XExpand">False</property>
+ <property name="XFill">True</property>
+ <property name="XShrink">False</property>
+ <property name="YExpand">False</property>
+ <property name="YFill">True</property>
+ <property name="YShrink">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="paddingLabel">
+ <property name="MemberName" />
+ <property name="WidthRequest">132</property>
+ <property name="Justify">Right</property>
+ </widget>
+ <packing>
+ <property name="TopAttach">5</property>
+ <property name="BottomAttach">6</property>
+ <property name="AutoSize">True</property>
+ <property name="XOptions">Fill</property>
+ <property name="YOptions">Fill</property>
+ <property name="XExpand">False</property>
+ <property name="XFill">True</property>
+ <property name="XShrink">False</property>
+ <property name="YExpand">False</property>
+ <property name="YFill">True</property>
+ <property name="YShrink">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.VBox" id="testingLabelVBox">
+ <property name="MemberName" />
+ <child>
+ <widget class="Gtk.Label" id="testingLabelPadding">
+ <property name="MemberName" />
+ <property name="WidthRequest">0</property>
+ <property name="HeightRequest">3</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">False</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="testingLabel">
+ <property name="MemberName" />
+ <property name="Xpad">5</property>
+ <property name="Xalign">1</property>
+ <property name="Yalign">0</property>
+ <property name="LabelProp" translatable="yes">Testing:</property>
+ <property name="Justify">Right</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="TopAttach">4</property>
+ <property name="BottomAttach">5</property>
+ <property name="AutoSize">True</property>
+ <property name="XOptions">Fill</property>
+ <property name="YOptions">Fill</property>
+ <property name="XExpand">False</property>
+ <property name="XFill">True</property>
+ <property name="XShrink">False</property>
+ <property name="YExpand">False</property>
+ <property name="YFill">True</property>
+ <property name="YShrink">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.DrawingArea" id="testingSeparator">
+ <property name="MemberName" />
+ <property name="WidthRequest">440</property>
+ <property name="HeightRequest">1</property>
+ </widget>
+ <packing>
+ <property name="TopAttach">3</property>
+ <property name="BottomAttach">4</property>
+ <property name="RightAttach">3</property>
+ <property name="YPadding">10</property>
+ <property name="AutoSize">False</property>
+ <property name="XOptions">Fill</property>
+ <property name="YOptions">0</property>
+ <property name="XExpand">False</property>
+ <property name="XFill">True</property>
+ <property name="XShrink">False</property>
+ <property name="YExpand">False</property>
+ <property name="YFill">False</property>
+ <property name="YShrink">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.VBox" id="webApiVBox">
+ <property name="MemberName" />
+ <child>
+ <widget class="Gtk.CheckButton" id="includeWebApiCheck">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Label" translatable="yes">Web API</property>
+ <property name="Active">True</property>
+ <property name="DrawIndicator">True</property>
+ <property name="HasLabel">True</property>
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="webApiDescriptionHBox">
+ <property name="MemberName" />
+ <child>
+ <widget class="Gtk.Label" id="webApiDescriptionLeftHandPadding">
+ <property name="MemberName" />
+ <property name="WidthRequest">21</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="webApiDescriptionLabel">
+ <property name="MemberName" />
+ <property name="WidthRequest">255</property>
+ <property name="Xalign">0</property>
+ <property name="LabelProp" translatable="yes">&lt;span size='smaller' color='grey'&gt;Framework for creating HTTP web services&lt;/span&gt;</property>
+ <property name="UseMarkup">True</property>
+ <property name="Wrap">True</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="TopAttach">2</property>
+ <property name="BottomAttach">3</property>
+ <property name="LeftAttach">1</property>
+ <property name="RightAttach">2</property>
+ <property name="AutoSize">True</property>
+ <property name="XOptions">Fill</property>
+ <property name="YOptions">Fill</property>
+ <property name="XExpand">False</property>
+ <property name="XFill">True</property>
+ <property name="XShrink">False</property>
+ <property name="YExpand">False</property>
+ <property name="YFill">True</property>
+ <property name="YShrink">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.VBox" id="webFormsVBox">
+ <property name="MemberName" />
+ <child>
+ <widget class="Gtk.CheckButton" id="includeWebFormsCheck">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Label" translatable="yes">Web Forms</property>
+ <property name="Active">True</property>
+ <property name="DrawIndicator">True</property>
+ <property name="HasLabel">True</property>
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="webFormsDescriptionHBox">
+ <property name="MemberName" />
+ <child>
+ <widget class="Gtk.Label" id="webFormsDescriptionLeftHandPadding">
+ <property name="MemberName" />
+ <property name="WidthRequest">21</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="webFormsDescriptionLabel">
+ <property name="MemberName" />
+ <property name="WidthRequest">255</property>
+ <property name="Xalign">0</property>
+ <property name="LabelProp" translatable="yes">&lt;span size='smaller' color='grey'&gt;Stateful programming model similar to desktop applications&lt;/span&gt;</property>
+ <property name="UseMarkup">True</property>
+ <property name="Wrap">True</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="TopAttach">1</property>
+ <property name="BottomAttach">2</property>
+ <property name="LeftAttach">1</property>
+ <property name="RightAttach">2</property>
+ <property name="AutoSize">True</property>
+ <property name="XOptions">Fill</property>
+ <property name="YOptions">Fill</property>
+ <property name="XExpand">False</property>
+ <property name="XFill">True</property>
+ <property name="XShrink">False</property>
+ <property name="YExpand">False</property>
+ <property name="YFill">True</property>
+ <property name="YShrink">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.EventBox" id="configurationBottomEventBox">
+ <property name="MemberName" />
+ <child>
+ <placeholder />
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.EventBox" id="backgroundLargeImageEventBox">
+ <property name="MemberName" />
+ <child>
+ <widget class="Gtk.VBox" id="backgroundLargeImageVBox">
+ <property name="MemberName" />
+ <child>
+ <placeholder />
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</stetic-interface> \ No newline at end of file
diff --git a/main/src/addins/AspNet/packages.config b/main/src/addins/AspNet/packages.config
index ad0c448553..cdf928d566 100644
--- a/main/src/addins/AspNet/packages.config
+++ b/main/src/addins/AspNet/packages.config
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="Microsoft.AspNet.Mvc" version="5.2.2" targetFramework="net45" />
- <package id="Microsoft.AspNet.Razor" version="3.2.2" targetFramework="net45" />
- <package id="Microsoft.AspNet.WebPages" version="3.2.2" targetFramework="net45" />
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net45" />
+ <package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net45" />
+ <package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
-</packages> \ No newline at end of file
+</packages>
diff --git a/main/src/addins/CBinding/AddinInfo.cs b/main/src/addins/CBinding/AddinInfo.cs
deleted file mode 100644
index 2d04910221..0000000000
--- a/main/src/addins/CBinding/AddinInfo.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-
-using System;
-using Mono.Addins;
-using Mono.Addins.Description;
-
-[assembly:Addin ("CBinding",
- Namespace = "MonoDevelop",
- Version = MonoDevelop.BuildInfo.Version,
- Category = "Language bindings")]
-
-[assembly:AddinName ("C/C++ Language Binding")]
-[assembly:AddinDescription ("C/C++ Language binding")]
-
-[assembly:AddinDependency ("Core", MonoDevelop.BuildInfo.Version)]
-[assembly:AddinDependency ("Ide", MonoDevelop.BuildInfo.Version)]
-[assembly:AddinDependency ("DesignerSupport", MonoDevelop.BuildInfo.Version)]
-[assembly:AddinDependency ("Deployment", MonoDevelop.BuildInfo.Version)]
-[assembly:AddinDependency ("Deployment.Linux", MonoDevelop.BuildInfo.Version)]
-[assembly:AddinDependency ("Refactoring", MonoDevelop.BuildInfo.Version)]
-[assembly:AddinDependency ("SourceEditor2", MonoDevelop.BuildInfo.Version)]
diff --git a/main/src/addins/CBinding/AssemblyInfo.cs b/main/src/addins/CBinding/AssemblyInfo.cs
deleted file mode 100644
index bec073d8a8..0000000000
--- a/main/src/addins/CBinding/AssemblyInfo.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-// Autogenerated from CBinding.addin.xml
-
-using System.Reflection;
-
-[assembly: AssemblyProduct ("MonoDevelop")]
-[assembly: AssemblyTitle ("C/C++ Language Binding")]
-[assembly: AssemblyDescription ("C/C++ Language binding")]
-[assembly: AssemblyVersion ("2.6")]
-[assembly: AssemblyCopyright ("MIT X11")]
diff --git a/main/src/addins/CBinding/CBinding.Autotools/AssemblyInfo.cs b/main/src/addins/CBinding/CBinding.Autotools/AssemblyInfo.cs
deleted file mode 100644
index bd09d18668..0000000000
--- a/main/src/addins/CBinding/CBinding.Autotools/AssemblyInfo.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// AssemblyInfo.cs created with MonoDevelop
-// User: marcos at 5:00 PM 8/6/2007
-//
-// To change standard headers go to Edit->Preferences->Coding->Standard Headers
-//
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-// Information about this assembly is defined by the following
-// attributes.
-//
-// change them to the information which is associated with the assembly
-// you compile.
-
-[assembly: AssemblyTitle("")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// The assembly version has following format :
-//
-// Major.Minor.Build.Revision
-//
-// You can specify all values by your own or you can build default build and revision
-// numbers with the '*' character (the default):
-
-[assembly: AssemblyVersion("1.0.0.0")]
-
-// The following attributes specify the key for the sign of your assembly. See the
-// .NET Framework documentation for more information about signing.
-// This is not required, if you don't want signing let these attributes like they're.
-//[assembly: AssemblyDelaySign(false)]
-//[assembly: AssemblyKeyFile("")]
diff --git a/main/src/addins/CBinding/CBinding.Autotools/CAutotoolsSetup.cs b/main/src/addins/CBinding/CBinding.Autotools/CAutotoolsSetup.cs
deleted file mode 100644
index afa2f9e7c5..0000000000
--- a/main/src/addins/CBinding/CBinding.Autotools/CAutotoolsSetup.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// CAutotoolsSetup.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Autotools;
-
-using CBinding;
-
-namespace CBinding.Autotools
-{
- public class CAutotoolsSetup : ISimpleAutotoolsSetup
- {
- public string GetCompilerCommand (Project project, string configuration)
- {
- if (!CanDeploy (project))
- throw new Exception ("Not a deployable project.");
-
- CProject cproj = project as CProject;
-
- return cproj.Compiler.CompilerCommand;
- }
-
- // FIXME: Currently only the compiler flags are sent, no linker flags are sent.
- public string GetCompilerFlags (Project project, string configuration)
- {
- if (!CanDeploy (project))
- throw new Exception ("Not a deployable project.");
-
- CProjectConfiguration config = project.Configurations[configuration] as CProjectConfiguration;
-
- if (config == null)
- return string.Empty;
-
- CProject cproj = project as CProject;
-
- return cproj.Compiler.GetCompilerFlags (cproj, config);
- }
-
- public bool CanDeploy (Project project)
- {
- return project is CProject;
- }
- }
-} \ No newline at end of file
diff --git a/main/src/addins/CBinding/CBinding.Autotools/CBinding.Autotools.csproj b/main/src/addins/CBinding/CBinding.Autotools/CBinding.Autotools.csproj
deleted file mode 100644
index 5cb50bacca..0000000000
--- a/main/src/addins/CBinding/CBinding.Autotools/CBinding.Autotools.csproj
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{B841F25D-4F6D-4E0D-885F-212B54381F28}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AssemblyName>MonoDevelop.CBinding.Autotools</AssemblyName>
- <RootNamespace>CBinding.Autotools</RootNamespace>
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>True</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\..\..\..\build\AddIns\BackendBindings\</OutputPath>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <ConsolePause>False</ConsolePause>
- <Execution>
- <Execution clr-version="Net_2_0" />
- </Execution>
- <DefineConstants>DEBUG</DefineConstants>
- <NoWarn>1591;1573</NoWarn>
- <DocumentationFile>..\..\..\..\build\AddIns\BackendBindings\MonoDevelop.CBinding.Autotools.xml</DocumentationFile>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>True</Optimize>
- <OutputPath>..\..\..\..\build\AddIns\BackendBindings\</OutputPath>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <ConsolePause>False</ConsolePause>
- <Execution>
- <Execution clr-version="Net_2_0" />
- </Execution>
- <DebugSymbols>true</DebugSymbols>
- <NoWarn>1591;1573</NoWarn>
- <DocumentationFile>..\..\..\..\build\AddIns\BackendBindings\MonoDevelop.CBinding.Autotools.xml</DocumentationFile>
- </PropertyGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\MonoDevelop.Autotools\MonoDevelop.Autotools.csproj">
- <Project>{CFC02FEC-BDF4-40B9-94D6-35E73F76A92E}</Project>
- <Name>MonoDevelop.Autotools</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\CBinding.csproj">
- <Project>{7B57882B-AD46-469B-84E7-06DF98D11468}</Project>
- <Name>CBinding</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
- <Project>{7525BB88-6142-4A26-93B9-A30C6983390A}</Project>
- <Name>MonoDevelop.Core</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\Deployment\MonoDevelop.Deployment\MonoDevelop.Deployment.csproj">
- <Project>{9BC670A8-1851-40EC-9685-279F4C98433D}</Project>
- <Name>MonoDevelop.Deployment</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\..\core\MonoDevelop.Ide\MonoDevelop.Ide.csproj">
- <Project>{27096E7F-C91C-4AC6-B289-6897A701DF21}</Project>
- <Name>MonoDevelop.Ide</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\MonoDevelop.DesignerSupport\MonoDevelop.DesignerSupport.csproj">
- <Project>{2C24D515-4A2C-445C-8419-C09231913CFA}</Project>
- <Name>MonoDevelop.DesignerSupport</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
- <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
- <Name>Mono.TextEditor</Name>
- <Private>False</Private>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <Reference Include="System" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="CAutotoolsSetup.cs" />
- <Compile Include="AssemblyInfo.cs" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-</Project>
diff --git a/main/src/addins/CBinding/CBinding.Autotools/ChangeLog b/main/src/addins/CBinding/CBinding.Autotools/ChangeLog
deleted file mode 100644
index 16c000d5b6..0000000000
--- a/main/src/addins/CBinding/CBinding.Autotools/ChangeLog
+++ /dev/null
@@ -1,44 +0,0 @@
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.Autotools.csproj: Merged MD.Projects into MD.Core,
- and MD.Projects.Gui, MD.Core.Gui and MD.Components into
- MD.Ide.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.Autotools.csproj: Flush.
-
-2009-10-13 Ankit Jain <jankit@novell.com>
-
- * CBinding.Autotools.csproj: Import md.targets .
-
-2009-06-19 Mike Krüger <mkrueger@novell.com>
-
- * AssemblyInfo.cs: Commented out empty assembly key file
- attribute (Bug 513981 - Project template causes CS1726
- errors).
-
-2009-02-18 Mike Krüger <mkrueger@novell.com>
-
- * CAutotoolsSetup.cs: Fixed 'Bug 456971 - ${ProjectDir} Not
- updating for currently building project'.
-
-2009-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * CBinding.Autotools.csproj: More refs to keep csc happy.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * CBinding.Autotools.csproj: Don't local-copy other addins'
- dlls.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * CBinding.Autotools.csproj: More explicit references to keep
- csc happy.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.Autotools.mdp:
- * CBinding.Autotools.csproj: Migrated to MSBuild file format.
-
diff --git a/main/src/addins/CBinding/CBinding.addin.xml b/main/src/addins/CBinding/CBinding.addin.xml
deleted file mode 100644
index 35cb77e26d..0000000000
--- a/main/src/addins/CBinding/CBinding.addin.xml
+++ /dev/null
@@ -1,244 +0,0 @@
-<ExtensionModel>
-
- <Extension path = "/MonoDevelop/Core/StockIcons">
- <StockIcon stockid = "md-union" resource = "union-16.png" size="Menu"/>
- <StockIcon stockid = "md-protected-union" resource = "union-protected-16.png" size="Menu"/>
- <StockIcon stockid = "md-private-union" resource = "union-private-16.png" size="Menu"/>
- <StockIcon stockid = "md-c-file" icon = "md-file-source" size="Menu" />
- <StockIcon stockid = "md-h-file" icon = "md-file-header" size="Menu" />
- <StockIcon stockid = "md-cpp-file" icon = "md-file-source" size="Menu" />
- </Extension>
-
- <Extension path = "/MonoDevelop/Ide/FileFilters">
- <FileFilter
- id = "CPP"
- insertbefore = "AllFiles"
- _label = "C++ Files"
- extensions = "*.cpp,*.h,*.hpp,*.cxx,*.cc,*.hh,*.hxx"/>
- <FileFilter
- id = "C"
- insertbefore = "AllFiles"
- _label = "C Files"
- extensions = "*.c,*.h"/>
- <FileFilter
- id = "Objective C"
- insertbefore = "AllFiles"
- _label = "Objective C Files"
- extensions = "*.m,*.h"/>
- <FileFilter
- id = "Objective C++"
- insertbefore = "AllFiles"
- _label = "Objective C++ Files"
- extensions = "*.mm,*.M,*.h"/>
- </Extension>
-
- <Extension path = "/MonoDevelop/Ide/FileTemplates">
- <FileTemplate id = "EmptyCSourceFile" resource = "EmptyCSourceFile.xft.xml"/>
- <FileTemplate id = "EmptyCHeaderFile" resource = "EmptyCHeaderFile.xft.xml"/>
- <FileTemplate id = "EmptyCppSourceFile" resource = "EmptyCppSourceFile.xft.xml"/>
- <FileTemplate id = "EmptyCppHeaderFile" resource = "EmptyCppHeaderFile.xft.xml"/>
- <FileTemplate id = "EmptyObjCSourceFile" resource = "EmptyObjCSourceFile.xft.xml"/>
- <FileTemplate id = "EmptyObjCppSourceFile" resource = "EmptyObjCppSourceFile.xft.xml"/>
- </Extension>
-
- <Extension path = "/MonoDevelop/Ide/ProjectTemplates">
- <!-- C -->
- <ProjectTemplate id = "EmptyCProject" resource = "EmptyCProject.xpt.xml"/>
- <ProjectTemplate id = "SharedLibraryCProject" resource = "SharedLibraryCProject.xpt.xml"/>
- <ProjectTemplate id = "StaticLibraryCProject" resource = "StaticLibraryCProject.xpt.xml"/>
- <ProjectTemplate id = "ConsoleCProject" resource = "ConsoleCProject.xpt.xml"/>
-
- <!-- C++ -->
- <ProjectTemplate id = "EmptyCppProject" resource = "EmptyCppProject.xpt.xml"/>
- <ProjectTemplate id = "SharedLibraryCppProject" resource = "SharedLibraryCppProject.xpt.xml"/>
- <ProjectTemplate id = "StaticLibraryCppProject" resource = "StaticLibraryCppProject.xpt.xml"/>
- <ProjectTemplate id = "ConsoleCppProject" resource = "ConsoleCppProject.xpt.xml"/>
-
- <!-- ObjC -->
- <ProjectTemplate id = "ConsoleObjCProject" resource = "ConsoleObjCProject.xpt.xml"/>
- </Extension>
-
- <Extension path = "/MonoDevelop/Core/MimeTypes">
- <MimeType id="text/x-csrc" icon="md-c-file" isText="true">
- <File pattern="*.c" />
- </MimeType>
- <MimeType id="text/x-chdr" icon="md-h-file" isText="true">
- <File pattern="*.h" />
- </MimeType>
- <MimeType id="text/x-c++src" icon="md-cpp-file" isText="true">
- <File pattern="*.cpp" />
- <File pattern="*.cc" />
- <File pattern="*.cxx" />
- </MimeType>
- <MimeType id="text/x-c++hdr" icon="md-h-file" isText="true">
- <File pattern="*.hpp" />
- <File pattern="*.hh" />
- <File pattern="*.hxx" />
- </MimeType>
- <MimeType id="text/x-objcsrc" icon="md-c-file" isText="true">
- <File pattern="*.m" />
- </MimeType>
- <MimeType id="text/x-objc++src" icon="md-cpp-file" isText="true">
- <File pattern="*.mm" />
- <File pattern="*.M" />
- </MimeType>
- </Extension>
-
- <Extension path = "/MonoDevelop/ProjectModel/ProjectBindings">
- <ProjectBinding id = "CProject" class = "CBinding.CProjectBinding"/>
- </Extension>
-
- <Extension path = "/MonoDevelop/ProjectModel/LanguageBindings">
- <LanguageBinding
- id = "C"
- supportedextensions = ".c,.h"
- class = "CBinding.CLanguageBinding"/>
- <LanguageBinding
- id = "CPP"
- supportedextensions = ".cpp,.cxx,.cc,.h,.hpp,.hh,.hxx"
- class = "CBinding.CppLanguageBinding"/>
- <LanguageBinding
- id = "Objective C"
- supportedextensions = ".m,.h"
- class = "CBinding.ObjCLanguageBinding"/>
- <LanguageBinding
- id = "Objective C++"
- supportedextensions = ".mm,.M"
- class = "CBinding.ObjCppLanguageBinding"/>
- </Extension>
-
- <Extension path = "/MonoDevelop/Ide/GlobalOptionsDialog/Projects">
- <Section
- id = "CBindingOptions"
- _label = "C/C++"
- class = "CBinding.GeneralOptionsPanelBinding"/>
- </Extension>
-
- <Extension path = "/MonoDevelop/ProjectModel/Gui/ItemOptionPanels/Build">
- <Condition id = "ItemType" value = "CBinding.CProject">
- <Section
- id = "CompilerPanel"
- _label = "Compiler"
- insertafter = "Compile"
- class = "CBinding.CompilerPanelBinding"/>
- <Section
- id = "CodeGenerationPanel"
- _label = "Code Generation"
- class = "CBinding.CodeGenerationPanelBinding"/>
- <Section
- id = "OutputOptionsPanel"
- _label = "Output"
- class = "CBinding.OutputOptionsPanelBinding"/>
- </Condition>
- </Extension>
-
- <ExtensionPoint path = "/CBinding/Views/ProjectBrowser/ContextMenu/PackagesFolderNode" name = "Packages folder context menu">
- <Description>Context menu for packages folder in the solution pad.</Description>
- <ExtensionNodeSet id = "MonoDevelop.Components.Commands.ItemSet"/>
- </ExtensionPoint>
-
- <ExtensionPoint path = "/CBinding/Views/ProjectBrowser/ContextMenu/PackageNode" name = "ProjectPackage context menu">
- <Description>Context menu for a package in the solution pad.</Description>
- <ExtensionNodeSet id = "MonoDevelop.Components.Commands.ItemSet"/>
- </ExtensionPoint>
-
- <Extension path = "/MonoDevelop/Ide/Pads/ProjectPad">
- <NodeBuilder id = "CBinding.ProjectPad.ProjectReferencesExtension" class = "CBinding.ProjectPad.ProjectReferencesExtension"/>
- <NodeBuilder id = "CBinding.ProjectPad.ProjectNodeExtension" class = "CBinding.ProjectPad.ProjectNodeExtension"/>
- <NodeBuilder id = "CBinding.ProjectPad.ProjectPackagesFolderNodeBuilder" class = "CBinding.ProjectPad.ProjectPackagesFolderNodeBuilder"/>
- <NodeBuilder id = "CBinding.ProjectPad.ProjectPackageNodeBuilder" class = "CBinding.ProjectPad.ProjectPackageNodeBuilder"/>
- </Extension>
-
- <Extension path = "/MonoDevelop/Ide/Pads/ClassPad">
- <NodeBuilder id = "CBinding.Navigation.ProjectNodeBuilderExtension" class = "CBinding.Navigation.ProjectNodeBuilderExtension"/>
- <NodeBuilder id = "CBinding.Navigation.NamespaceNodeBuilder" class = "CBinding.Navigation.NamespaceNodeBuilder"/>
- <NodeBuilder id = "CBinding.Navigation.FunctionNodeBuilder" class = "CBinding.Navigation.FunctionNodeBuilder"/>
- <NodeBuilder id = "CBinding.Navigation.GlobalsNodeBuilder" class = "CBinding.Navigation.GlobalsNodeBuilder"/>
- <NodeBuilder id = "CBinding.Navigation.ClassNodeBuilder" class = "CBinding.Navigation.ClassNodeBuilder"/>
- <NodeBuilder id = "CBinding.Navigation.StructureNodeBuilder" class = "CBinding.Navigation.StructureNodeBuilder"/>
- <NodeBuilder id = "CBinding.Navigation.MemberNodeBuilder" class = "CBinding.Navigation.MemberNodeBuilder"/>
- <NodeBuilder id = "CBinding.Navigation.VariableNodeBuilder" class = "CBinding.Navigation.VariableNodeBuilder"/>
- <NodeBuilder id = "CBinding.Navigation.MacroDefinitionsNodeBuilder" class = "CBinding.Navigation.MacroDefinitionsNodeBuilder"/>
- <NodeBuilder id = "CBinding.Navigation.MacroNodeBuilder" class = "CBinding.Navigation.MacroNodeBuilder"/>
- <NodeBuilder id = "CBinding.Navigation.EnumerationNodeBuilder" class = "CBinding.Navigation.EnumerationNodeBuilder"/>
- <NodeBuilder id = "CBinding.Navigation.EnumeratorNodeBuilder" class = "CBinding.Navigation.EnumeratorNodeBuilder"/>
- <NodeBuilder id = "CBinding.Navigation.UnionNodeBuilder" class = "CBinding.Navigation.UnionNodeBuilder"/>
- <NodeBuilder id = "CBinding.Navigation.TypedefNodeBuilder" class = "CBinding.Navigation.TypedefNodeBuilder"/>
- </Extension>
-
- <Extension path = "/MonoDevelop/Ide/Commands">
- <Category _name = "C/C++" id = "C/C++">
- <Command id = "CBinding.CProjectCommands.AddPackage" _label = "Edit Packages..." />
- <Command id = "CBinding.CProjectCommands.UpdateClassPad" _label = "Update class pad" />
- <Command id = "CBinding.CProjectCommands.ShowPackageDetails" _label = "Details..." />
- </Category>
- </Extension>
-
- <Extension path = "/CBinding/Views/ProjectBrowser/ContextMenu/PackagesFolderNode">
- <CommandItem id = "CBinding.CProjectCommands.AddPackage"/>
- <CommandItem id = "MonoDevelop.Ide.Commands.EditCommands.Paste"/>
- </Extension>
-
- <Extension path = "/MonoDevelop/Ide/ContextMenu/ClassPad/Project">
- <CommandItem id = "CBinding.CProjectCommands.UpdateClassPad"/>
- </Extension>
-
- <Extension path = "/CBinding/Views/ProjectBrowser/ContextMenu/PackageNode">
- <CommandItem id = "CBinding.CProjectCommands.ShowPackageDetails"/>
- <SeparatorItem id = "Separator1" />
- <CommandItem id = "MonoDevelop.Ide.Commands.EditCommands.Copy"/>
- <CommandItem id = "MonoDevelop.Ide.Commands.EditCommands.Delete"/>
- </Extension>
-
- <Extension path = "/MonoDevelop/ProjectModel/ProjectServiceExtensions">
- <Condition id="ItemType" value="CBinding.CProject">
- <Class id = "ExtraSteps" class = "CBinding.CProjectServiceExtension"/>
- </Condition>
- </Extension>
-
- <Extension path = "/MonoDevelop/Ide/TextEditorExtensions">
- <Class fileExtensions=".c,.cpp,.cxx,.cc,.h,.hpp,.hh,.hxx,.m,.mm,.M" class = "CBinding.CTextEditorExtension" />
- </Extension>
-
- <Extension path = "/MonoDevelop/ProjectModel/SerializableClasses">
- <DataType class = "CBinding.CProjectConfiguration"/>
- <DataType class = "CBinding.CProject"/>
- <DataType class = "CBinding.GccCompiler"/>
- <DataType class = "CBinding.GppCompiler"/>
- <DataType class = "CBinding.Package"/>
- </Extension>
-
- <Extension path = "/MonoDevelop/ProjectModel/MSBuildItemTypes">
- <SolutionItem type="CBinding.CProject" extension="cproj" guid="{2857B73E-F847-4B02-9238-064979017E93}"/>
- </Extension>
-
-<!-- Current Autotools AddIn is very .NET specific
- <Module>
- <Runtime>
- <Import assembly = "CBinding.Autotools.dll"/>
- </Runtime>
-
- <Dependencies>
- <Addin id = "MonoDevelop.Autotools" version = "4.2.3"/>
- </Dependencies>
-
- <Extension path = "/Autotools/SimpleSetups">
- <Class class = "CBinding.Autotools.CAutotoolsSetup"/>
- </Extension>
- </Module>
--->
-
- <Extension path = "/MonoDevelop/TypeSystem/Parser">
- <Parser class="CBinding.Parser.CDocumentParser" mimeType = "text/x-csrc, text/x-chdr, text/x-c++src, text/x-c++hdr, text/x-objcsrc, text/x-objc++src" />
- </Extension>
-
- <Extension path="/MonoDevelop/SourceEditor2/ContextMenu/Editor">
- <Condition id="FileType" fileExtensions=".c,.cpp,.cxx,.cc,.h,.hpp,.hh,.hxx,.m,.mm,.M">
- <CommandItem id = "MonoDevelop.Refactoring.RefactoryCommands.GotoDeclaration" insertafter="MonoDevelop.SourceEditor.SourceEditorCommands.MarkerOperations" />
- </Condition>
- </Extension>
-
- <Extension path = "/MonoDevelop/Ide/CompletionCharacters">
- <Complete language="C/C++" commitOnSpace="True" commitChars="{}[]().,:;+-*/%&amp;|^!~=&lt;&gt;?@#'&quot;\"/>
- </Extension>
-</ExtensionModel>
diff --git a/main/src/addins/CBinding/CBinding.csproj b/main/src/addins/CBinding/CBinding.csproj
deleted file mode 100644
index 94f0eb7bb6..0000000000
--- a/main/src/addins/CBinding/CBinding.csproj
+++ /dev/null
@@ -1,288 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{7B57882B-AD46-469B-84E7-06DF98D11468}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AssemblyName>MonoDevelop.CBinding</AssemblyName>
- <RootNamespace>CBinding</RootNamespace>
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>True</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>False</Optimize>
- <OutputPath>..\..\..\build\AddIns\BackendBindings\</OutputPath>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <ConsolePause>False</ConsolePause>
- <Execution>
- <Execution clr-version="Net_2_0" />
- </Execution>
- <AssemblyOriginatorKeyFile>.</AssemblyOriginatorKeyFile>
- <DefineConstants>DEBUG</DefineConstants>
- <NoWarn>1591;1573</NoWarn>
- <DocumentationFile>..\..\..\build\AddIns\BackendBindings\MonoDevelop.CBinding.xml</DocumentationFile>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>True</Optimize>
- <OutputPath>..\..\..\build\AddIns\BackendBindings\</OutputPath>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <ConsolePause>False</ConsolePause>
- <Execution>
- <Execution clr-version="Net_2_0" />
- </Execution>
- <DebugSymbols>true</DebugSymbols>
- <NoWarn>1591;1573</NoWarn>
- <DocumentationFile>..\..\..\build\AddIns\BackendBindings\MonoDevelop.CBinding.xml</DocumentationFile>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Xml" />
- <Reference Include="Mono.Posix" />
- <Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
- <SpecificVersion>False</SpecificVersion>
- </Reference>
- <Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
- <SpecificVersion>False</SpecificVersion>
- </Reference>
- <Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
- <SpecificVersion>False</SpecificVersion>
- </Reference>
- <Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
- <SpecificVersion>False</SpecificVersion>
- </Reference>
- <Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
- <SpecificVersion>False</SpecificVersion>
- </Reference>
- <Reference Include="System.Core" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\core\MonoDevelop.Ide\MonoDevelop.Ide.csproj">
- <Project>{27096E7F-C91C-4AC6-B289-6897A701DF21}</Project>
- <Name>MonoDevelop.Ide</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
- <Project>{7525BB88-6142-4A26-93B9-A30C6983390A}</Project>
- <Name>MonoDevelop.Core</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\Deployment\MonoDevelop.Deployment\MonoDevelop.Deployment.csproj">
- <Project>{9BC670A8-1851-40EC-9685-279F4C98433D}</Project>
- <Name>MonoDevelop.Deployment</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\Deployment\MonoDevelop.Deployment.Linux\MonoDevelop.Deployment.Linux.csproj">
- <Project>{BA9020AD-A2D1-47C8-9A7C-756162C38296}</Project>
- <Name>MonoDevelop.Deployment.Linux</Name>
- <Private>False</Private>
- </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="..\MonoDevelop.DesignerSupport\MonoDevelop.DesignerSupport.csproj">
- <Project>{2C24D515-4A2C-445C-8419-C09231913CFA}</Project>
- <Name>MonoDevelop.DesignerSupport</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
- <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
- <Name>Mono.TextEditor</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\MonoDevelop.Refactoring\MonoDevelop.Refactoring.csproj">
- <Project>{100568FC-F4E8-439B-94AD-41D11724E45B}</Project>
- <Name>MonoDevelop.Refactoring</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
- <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
- <Name>ICSharpCode.NRefactory</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\MonoDevelop.Debugger\MonoDevelop.Debugger.csproj">
- <Project>{2357AABD-08C7-4808-A495-8FF2D3CDFDB0}</Project>
- <Name>MonoDevelop.Debugger</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\..\external\mono-addins\Mono.Addins\Mono.Addins.csproj">
- <Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
- <Name>Mono.Addins</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\..\external\debugger-libs\Mono.Debugging\Mono.Debugging.csproj">
- <Project>{90C99ADB-7D4B-4EB4-98C2-40BD1B14C7D2}</Project>
- <Name>Mono.Debugging</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\..\external\xwt\Xwt\Xwt.csproj">
- <Project>{92494904-35FA-4DC9-BDE9-3A3E87AC49D3}</Project>
- <Name>Xwt</Name>
- <Private>False</Private>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <None Include="Makefile.am" />
- <None Include="README" />
- </ItemGroup>
- <ItemGroup>
- <EmbeddedResource Include="CBinding.addin.xml">
- <LogicalName>CBinding.addin.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="templates\EmptyCProject.xpt.xml">
- <LogicalName>EmptyCProject.xpt.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="templates\EmptyCSourceFile.xft.xml">
- <LogicalName>EmptyCSourceFile.xft.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="templates\EmptyCppProject.xpt.xml">
- <LogicalName>EmptyCppProject.xpt.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="gtk-gui\gui.stetic">
- <LogicalName>gui.stetic</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="templates\EmptyCHeaderFile.xft.xml">
- <LogicalName>EmptyCHeaderFile.xft.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="templates\EmptyCppHeaderFile.xft.xml">
- <LogicalName>EmptyCppHeaderFile.xft.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="templates\EmptyCppSourceFile.xft.xml">
- <LogicalName>EmptyCppSourceFile.xft.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="templates\SharedLibraryCProject.xpt.xml">
- <LogicalName>SharedLibraryCProject.xpt.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="templates\SharedLibraryCppProject.xpt.xml">
- <LogicalName>SharedLibraryCppProject.xpt.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="templates\StaticLibraryCProject.xpt.xml">
- <LogicalName>StaticLibraryCProject.xpt.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="templates\StaticLibraryCppProject.xpt.xml">
- <LogicalName>StaticLibraryCppProject.xpt.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="templates\ConsoleCProject.xpt.xml">
- <LogicalName>ConsoleCProject.xpt.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="templates\ConsoleCppProject.xpt.xml">
- <LogicalName>ConsoleCppProject.xpt.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="templates\ConsoleObjCProject.xpt.xml">
- <LogicalName>ConsoleObjCProject.xpt.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="templates\EmptyObjCSourceFile.xft.xml">
- <LogicalName>EmptyObjCSourceFile.xft.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="templates\EmptyObjCppSourceFile.xft.xml">
- <LogicalName>EmptyObjCppSourceFile.xft.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\union-private-16.png">
- <LogicalName>union-private-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\union-protected-16.png">
- <LogicalName>union-protected-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\union-16.png">
- <LogicalName>union-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\update.png">
- <LogicalName>update.png</LogicalName>
- </EmbeddedResource>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Project\CProject.cs" />
- <Compile Include="Project\CProjectBinding.cs" />
- <Compile Include="Project\CProjectConfiguration.cs" />
- <Compile Include="gtk-gui\generated.cs" />
- <Compile Include="Gui\CodeGenerationPanel.cs" />
- <Compile Include="Compiler\CCompiler.cs" />
- <Compile Include="Compiler\GccCompiler.cs" />
- <Compile Include="Compiler\GppCompiler.cs" />
- <Compile Include="Compiler\GNUCompiler.cs" />
- <Compile Include="Gui\CompilerPanel.cs" />
- <Compile Include="gtk-gui\CBinding.CodeGenerationPanel.cs" />
- <Compile Include="gtk-gui\CBinding.CompilerPanel.cs" />
- <Compile Include="Compiler\ICompiler.cs" />
- <Compile Include="Project\ProjectPackageCollection.cs" />
- <Compile Include="Gui\EditPackagesDialog.cs" />
- <Compile Include="gtk-gui\CBinding.EditPackagesDialog.cs" />
- <Compile Include="CLanguageBinding.cs" />
- <Compile Include="Project\Package.cs" />
- <Compile Include="Project\ProjectPackageEventArgs.cs" />
- <Compile Include="Gui\OutputOptionsPanel.cs" />
- <Compile Include="gtk-gui\CBinding.OutputOptionsPanel.cs" />
- <Compile Include="Project\CProjectServiceExtension.cs" />
- <Compile Include="Navigation\ProjectNodeBuilderExtension.cs" />
- <Compile Include="Navigation\NamespaceNodeBuilder.cs" />
- <Compile Include="ProjectPad\ProjectReferencesExtension.cs" />
- <Compile Include="ProjectPad\ProjectPackagesFolderNodeBuilder.cs" />
- <Compile Include="ProjectPad\ProjectPackageNodeBuilder.cs" />
- <Compile Include="ProjectPad\ProjectNodeExtension.cs" />
- <Compile Include="Navigation\FunctionNodeBuilder.cs" />
- <Compile Include="Navigation\GlobalsNodeBuilder.cs" />
- <Compile Include="Navigation\ClassNodeBuilder.cs" />
- <Compile Include="Navigation\LanguageItemCommandHandler.cs" />
- <Compile Include="Navigation\StructureNodeBuilder.cs" />
- <Compile Include="Navigation\MemberNodeBuilder.cs" />
- <Compile Include="Navigation\VariableNodeBuilder.cs" />
- <Compile Include="Navigation\MacroNodeBuilder.cs" />
- <Compile Include="Navigation\MacroDefinitionsNodeBuilder.cs" />
- <Compile Include="Navigation\EnumerationNodeBuilder.cs" />
- <Compile Include="Navigation\EnumeratorNodeBuilder.cs" />
- <Compile Include="Navigation\UnionNodeBuilder.cs" />
- <Compile Include="Navigation\TypedefNodeBuilder.cs" />
- <Compile Include="Navigation\LanguageItemEventArgs.cs" />
- <Compile Include="Navigation\ClassPadEventArgs.cs" />
- <Compile Include="Parser\ProjectInformation.cs" />
- <Compile Include="Parser\ProjectInformationManager.cs" />
- <Compile Include="Parser\TagDatabaseManager.cs" />
- <Compile Include="Parser\Tag.cs" />
- <Compile Include="Gui\CTextEditorExtension.cs" />
- <Compile Include="Gui\DataProvider.cs" />
- <Compile Include="Parser\Class.cs" />
- <Compile Include="Parser\Enumeration.cs" />
- <Compile Include="Parser\Enumerator.cs" />
- <Compile Include="Parser\Function.cs" />
- <Compile Include="Parser\LanguageItem.cs" />
- <Compile Include="Parser\Macro.cs" />
- <Compile Include="Parser\Member.cs" />
- <Compile Include="Parser\Namespace.cs" />
- <Compile Include="Parser\Structure.cs" />
- <Compile Include="Parser\Typedef.cs" />
- <Compile Include="Parser\Union.cs" />
- <Compile Include="Parser\Variable.cs" />
- <Compile Include="CppLanguageBinding.cs" />
- <Compile Include="Gui\GeneralOptionsPanel.cs" />
- <Compile Include="gtk-gui\CBinding.GeneralOptionsPanel.cs" />
- <Compile Include="Parser\Local.cs" />
- <Compile Include="Gui\PackageDetails.cs" />
- <Compile Include="gtk-gui\CBinding.PackageDetails.cs" />
- <Compile Include="AssemblyInfo.cs" />
- <Compile Include="Parser\CDocumentParser.cs" />
- <Compile Include="ObjCLanguageBinding.cs" />
- <Compile Include="ObjCppLanguageBinding.cs" />
- <Compile Include="Parser\CompilationUnitDataProvider.cs" />
- <Compile Include="Parser\DataProvider.cs" />
- <Compile Include="Parser\CTagsManager.cs" />
- <Compile Include="Parser\ExuberantCTagsManager.cs" />
- <Compile Include="Parser\BsdCTagsManager.cs" />
- <Compile Include="AddinInfo.cs" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <ProjectExtensions>
- <MonoDevelop>
- <Properties>
- <Deployment.LinuxDeployData scriptName="cbinding" />
- </Properties>
- </MonoDevelop>
- </ProjectExtensions>
-</Project>
diff --git a/main/src/addins/CBinding/CLanguageBinding.cs b/main/src/addins/CBinding/CLanguageBinding.cs
deleted file mode 100644
index ca0c3d91ac..0000000000
--- a/main/src/addins/CBinding/CLanguageBinding.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// CLanguageBinding.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-using Mono.Addins;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Core;
-
-namespace CBinding
-{
- public class CLanguageBinding : ILanguageBinding
- {
- public string Language {
- get { return "C"; }
- }
-
- public string SingleLineCommentTag { get { return null; } }
- public string BlockCommentStartTag { get { return "/*"; } }
- public string BlockCommentEndTag { get { return "*/"; } }
-
- public bool IsSourceCodeFile (FilePath fileName)
- {
- return fileName.ToString ().EndsWith (".c", StringComparison.OrdinalIgnoreCase);
- }
-
- public FilePath GetFileName (FilePath baseName)
- {
- return baseName + ".c";
- }
- }
-}
diff --git a/main/src/addins/CBinding/ChangeLog b/main/src/addins/CBinding/ChangeLog
deleted file mode 100644
index 65a8cfb638..0000000000
--- a/main/src/addins/CBinding/ChangeLog
+++ /dev/null
@@ -1,1853 +0,0 @@
-2010-07-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CTextEditorExtension.cs: Fixed the C return command.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * Gui/DataProvider.cs:
- * Navigation/LanguageItemCommandHandler.cs: Track API changes.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CBinding.csproj:
- * Gui/CTextEditorExtension.cs: Track API changes.
-
-2010-07-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/DataProvider.cs: Track API changes.
-
-2010-07-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * CBinding.addin.xml:
- * Parser/CDocumentParser.cs: Track ProjectDomService/Parser
- API.
-
-2010-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/CProject.cs: Allow setting the External Console flag
- in the options.
-
- * templates/ConsoleCProject.xpt.xml:
- * templates/ConsoleCppProject.xpt.xml: Set the external
- console flag for console projects.
-
-2010-05-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/CProjectBinding.cs: Only create single file projects
- for C/C++ files.
-
-2010-05-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * Compiler/GNUCompiler.cs: Don't include the generic () errors
- in the errors list. Don't reverse order of errors from
- compiler.
-
-2010-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * CBinding.csproj:
- * gtk-gui/gui.stetic:
- * Gui/AddPathDialog.cs:
- * Gui/AddLibraryDialog.cs:
- * Gui/OutputOptionsPanel.cs:
- * Gui/CodeGenerationPanel.cs:
- * gtk-gui/CBinding.AddPathDialog.cs:
- * gtk-gui/CBinding.AddLibraryDialog.cs:
- * gtk-gui/CBinding.OutputOptionsPanel.cs:
- * gtk-gui/CBinding.CodeGenerationPanel.cs:
- * ProjectPad/ProjectPackagesFolderNodeBuilder.cs: Clean up
- dialog placement.
-
-2010-05-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * CBinding.csproj:
- * CBinding.addin.xml:
- * Project/CProject.cs:
- * Gui/CTextEditorExtension.cs:
- * Gui/SwapSourceHeaderCommand.cs: Replaced the 'Swap
- Source/Header' command by a handler for the 'Switch between
- related files' command.
-
-2010-05-11 Mike Krüger <mkrueger@novell.com>
-
- * Gui/DataProvider.cs: Track API changes.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * Gui/DataProvider.cs: Track API changes.
-
-2010-03-26 Levi Bard <levi@unity3d.com>
-
- * Project/CProject.cs: Fix linking for library projects whose
- names are prefixed with lib. Fixes #587298.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * CBinding.addin.xml: Bumped MD version.
-
-2010-03-18 Levi Bard <levi@unity3d.com>
-
- * Gui/DataProvider.cs:
- * Gui/CTextEditorExtension.cs: Track API changes.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.csproj: Remove import off mono.addins targets.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * CBinding.csproj:
- * CBinding.addin.xml:
- * gtk-gui/gui.stetic:
- * Project/CProject.cs:
- * Gui/DataProvider.cs:
- * Gui/CompilerPanel.cs:
- * Compiler/CCompiler.cs:
- * Parser/LanguageItem.cs:
- * Compiler/GppCompiler.cs:
- * Compiler/GNUCompiler.cs:
- * Compiler/GccCompiler.cs:
- * Gui/EditPackagesDialog.cs:
- * Gui/OutputOptionsPanel.cs:
- * Parser/CDocumentParser.cs:
- * Gui/GeneralOptionsPanel.cs:
- * Gui/CodeGenerationPanel.cs:
- * Gui/CTextEditorExtension.cs:
- * Navigation/UnionNodeBuilder.cs:
- * Navigation/MacroNodeBuilder.cs:
- * Navigation/ClassNodeBuilder.cs:
- * Gui/SwapSourceHeaderCommand.cs:
- * Navigation/MemberNodeBuilder.cs:
- * Navigation/GlobalsNodeBuilder.cs:
- * Navigation/TypedefNodeBuilder.cs:
- * Navigation/FunctionNodeBuilder.cs:
- * Navigation/VariableNodeBuilder.cs:
- * Navigation/StructureNodeBuilder.cs:
- * Navigation/NamespaceNodeBuilder.cs:
- * Navigation/EnumeratorNodeBuilder.cs:
- * Navigation/EnumerationNodeBuilder.cs:
- * ProjectPad/ProjectPackageNodeBuilder.cs:
- * gtk-gui/CBinding.CodeGenerationPanel.cs:
- * Navigation/LanguageItemCommandHandler.cs:
- * Navigation/MacroDefinitionsNodeBuilder.cs:
- * Navigation/ProjectNodeBuilderExtension.cs:
- * ProjectPad/ProjectPackagesFolderNodeBuilder.cs: Merged
- MD.Projects into MD.Core, and MD.Projects.Gui, MD.Core.Gui
- and MD.Components into MD.Ide.
-
-2010-03-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/CProject.cs: Track ProjectFile Link API.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/DataProvider.cs: Track api changes.
-
-2010-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.addin.xml: Added some conditions to avoid early
- loading of extensions.
-
- * Gui/CTextEditorExtension.cs: File extensions are now
- declared in the node metadata.
-
-2010-02-04 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Compiler/GNUCompiler.cs: Support gcc "note" errortype.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/CBinding.CompilerPanel.cs:
- * gtk-gui/CBinding.AddPathDialog.cs:
- * gtk-gui/CBinding.PackageDetails.cs:
- * gtk-gui/CBinding.AddLibraryDialog.cs:
- * gtk-gui/CBinding.OutputOptionsPanel.cs:
- * gtk-gui/CBinding.EditPackagesDialog.cs:
- * gtk-gui/CBinding.CodeGenerationPanel.cs:
- * gtk-gui/CBinding.GeneralOptionsPanel.cs: Flush.
-
-2010-01-27 Mike Krüger <mkrueger@novell.com>
-
- * Gui/DataProvider.cs: Track API changes.
-
-2010-01-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/CProjectServiceExtension.cs: Enable extension only
- for C projects.
-
-2010-01-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * CBinding.addin.xml: Reverted the fix for Bug 468416 because
- it marked .h as c++ headers, which is the wrong mimetype.
-
-2010-01-04 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Parser/TagDatabaseManager.cs: Allow parsing of headers
- included from packages.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Parser/TagDatabaseManager.cs: Name threads to make debugging
- easier.
-
-2009-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/CProject.cs:
- * Gui/CompilerPanel.cs:
- * Gui/EditPackagesDialog.cs:
- * Project/CProjectServiceExtension.cs:
- * ProjectPad/ProjectPackagesFolderNodeBuilder.cs: Introduced
- the ConfigurationSelector class to all methods that
- previously took a configuration name as string. This
- eliminates the ambiguity between solution configuration
- names and project configuration names.
-
-2009-11-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/CProject.cs: Track API. Get correct configuration.
-
-2009-11-06 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Parser/CDocumentParser.cs:
- * Parser/TagDatabaseManager.cs: Lock projectinfo on update.
-
-2009-11-06 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Gui/EditPackagesDialog.cs: Don't let bad packages break
- scanning.
-
-2009-11-06 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Gui/DataProvider.cs: Escape text for parameter completion.
-
-2009-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CompilerPanel.cs:
- * Gui/EditPackagesDialog.cs:
- * ProjectPad/ProjectPackagesFolderNodeBuilder.cs: Use the
- correct method for getting the active configuration.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * CBinding.addin.xml: Bump MD version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/CBinding.AddPathDialog.cs:
- * gtk-gui/CBinding.CompilerPanel.cs:
- * gtk-gui/CBinding.PackageDetails.cs:
- * gtk-gui/CBinding.AddLibraryDialog.cs:
- * gtk-gui/CBinding.EditPackagesDialog.cs:
- * gtk-gui/CBinding.OutputOptionsPanel.cs:
- * gtk-gui/CBinding.CodeGenerationPanel.cs:
- * gtk-gui/CBinding.GeneralOptionsPanel.cs: Flush.
-
-2009-10-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/CProject.cs:
- * Project/CProjectServiceExtension.cs: Properly resolve active
- configuration.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * CBinding.addin.xml: Bump MD version.
-
-2009-10-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * CBinding.csproj:
- * CBinding.addin.xml:
- * Gui/CTextEditorExtension.cs:
- * Gui/SwapSourceHeaderCommand.cs: Only show the swap
- source/header command contextually. Fixes "Bug 544022 -
- "Swap source/header" is visible in context menu for all
- files".
-
-2009-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * Compiler/GNUCompiler.cs: Fix bug #478735 - Can't link a
- library with a dot in the name.
-
-2009-09-12 Mike Krüger <mkrueger@novell.com>
-
- * Gui/DataProvider.cs:
- * Gui/CTextEditorExtension.cs: Track API changes.
-
-2009-09-09 Christian Hergert <chris@dronelabs.com>
-
- * Gui/OutputOptionsPanel.cs:
- * Gui/CodeGenerationPanel.cs:
- * ProjectPad/ProjectPackagesFolderNodeBuilder.cs: Set dialogs
- transient to the gtk window of the calling widget.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.csproj: Updated dependencies. We now depend on gtk#
- 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-18 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Parser/TagDatabaseManager.cs: Clear file info before update.
-
-2009-08-18 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Parser/Member.cs:
- * Gui/CTextEditorExtension.cs:
- * Parser/TagDatabaseManager.cs:
- Fix C and C++ completion.
-
-2009-08-17 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Parser/ProjectInformation.cs: Fix #530826.
-
-2009-08-13 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Parser/ProjectInformationManager.cs: Fix NRE.
-
-2009-08-12 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * CBinding.addin.xml:
- * Makefile.am:
- * Parser/CDocumentParser.cs:
- * CBinding.csproj:
- Allows the quickfinder and folds list to be populated
- from the existing ctags database. Fixes #513382.
-
-2009-08-12 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Project/CProject.cs:
- * Parser/TagDatabaseManager.cs:
- * Parser/ProjectInformation.cs: Remove info from parse db when
- a file is removed from the project. Fixes #398632.
-
-2009-08-12 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Compiler/GNUCompiler.cs: Be more helpful on unparsable
- compiler/linker failure. Fixes #487964.
-
-2009-08-12 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * CBinding.addin.xml: Make supported file extensions more
- comprehensive and consistent.
-
-2009-08-12 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * CBinding.addin.xml: Set appropriate extension point for
- editor context menu command. Fixes #508838.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/CBinding.PackageDetails.cs: Flush.
-
-2009-07-29 Mike Krüger <mkrueger@novell.com>
-
- * Gui/DataProvider.cs: Track API changes.
-
-2009-07-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/CProjectBinding.cs: Track api changes. Patch by
- Viktoria Dudka.
-
-2009-07-08 Mike Krüger <mkrueger@novell.com>
-
- * Gui/DataProvider.cs: Added range check.
-
-2009-06-29 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Compiler/GNUCompiler.cs: Localize output parser.
- Fixes #501898.
-
-2009-06-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/TagDatabaseManager.cs: Use the new DesktopService
- instead of PlatformService.
-
-2009-06-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/CProject.cs: Track api changes.
-
-2009-06-13 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CTextEditorExtension.cs: Applied patch "Bug 512617 -
- [PATCH] Deleting a selected line with Enter, got "Error in
- text editor extension chain.".
-
-2009-04-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * CLanguageBinding.cs:
- * CppLanguageBinding.cs: Track comment tag API.
-
-2009-04-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/CProject.cs: Track api changes in IExecutionHandler.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * templates/ConsoleCProject.xpt.xml:
- * templates/EmptyCSourceFile.xft.xml:
- * templates/EmptyCHeaderFile.xft.xml:
- * templates/ConsoleCppProject.xpt.xml:
- * templates/EmptyCppHeaderFile.xft.xml:
- * templates/EmptyCppSourceFile.xft.xml:
- * templates/StaticLibraryCProject.xpt.xml:
- * templates/SharedLibraryCProject.xpt.xml:
- * templates/SharedLibraryCppProject.xpt.xml:
- * templates/StaticLibraryCppProject.xpt.xml: Fixed "Bug 491090
- - Standard Header doesn't work".
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * Gui/CTextEditorExtension.cs:
- * gtk-gui/CBinding.AddPathDialog.cs:
- * gtk-gui/CBinding.AddLibraryDialog.cs: Track api changes.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * CBinding.csproj: don't require specific gtk-sharp version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * CBinding.addin.xml: Bump MD version.
-
-2009-03-13 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/CBinding.PackageDetails.cs: Making some strings not
- translatable.
-
-2009-03-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/CProject.cs: Changed the way execution handlers
- work. We are not using platform ids anymore. Instead, we use
- command strings when looking for execution handlers.
- IExecutionHandlerFactory has been removed and now everything
- is handled by IExecutionHandler, which has a new CanExecute
- method. This model is more simple and more generic.
-
-2009-02-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * CBinding.csproj: Don't use 'make' to build.
-
-2009-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Project/Package.cs:
- * Project/CProject.cs:
- * Compiler/ICompiler.cs:
- * Compiler/CCompiler.cs:
- * Compiler/GNUCompiler.cs: Fixed 'Bug 456971 - ${ProjectDir}
- Not updating for currently building project'.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CTextEditorExtension.cs: Rename second 'openingLine'
- variable, as csc is more picky about multiple locals with
- the same name in switches.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * CBinding.csproj: Flush MD's removal of newline at end of
- file that was introduced by manually editing with gedit.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * CBinding.csproj: Remove invalid ApplicationIcon value that
- broke the build in VS.
-
-2009-02-07 Mike Krüger <mkrueger@novell.com>
-
- * Parser/TagDatabaseManager.cs: fixed compiler warnings.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/CBinding.AddPathDialog.cs:
- * gtk-gui/CBinding.CompilerPanel.cs:
- * gtk-gui/CBinding.PackageDetails.cs:
- * gtk-gui/CBinding.AddLibraryDialog.cs:
- * gtk-gui/CBinding.EditPackagesDialog.cs:
- * gtk-gui/CBinding.OutputOptionsPanel.cs:
- * gtk-gui/CBinding.CodeGenerationPanel.cs:
- * gtk-gui/CBinding.GeneralOptionsPanel.cs: Flush.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.mds:
- * CBinding.mdp:
- * CBinding.csproj: Migrated to MSBuild file format.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * CBinding.addin.xml: Bump MD version.
-
-2009-01-27 Mike Krüger <mkrueger@novell.com>
-
- * CBinding.addin.xml: fixed "Bug 468416 - *.h aren't colorized as c++
- headers".
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * CBinding.mdp: Flush project format changes.
-
-2009-01-21 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CTextEditorExtension.cs: fixed bug 'Bug 467553 - Enter key doesn't
- delete selected text'.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.mdp:
- * CBinding.Autotools/CBinding.Autotools.mdp: All projects now require fx
- 3.5.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.mdp: Don't require a specific version of Mono.Addins.
-
-2008-12-06 Mitchell Wheeler <mitchell.wheeler@gmail.com>
-
- * CBinding.addin.xml: Added C++ header mimetype.
-
-2008-12-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CTextEditorExtension.cs: Track api changes.
-
-2008-12-05 Mitchell Wheeler <mitchell.wheeler@gmail.com>
-
- * Gui/CodeGenerationPanel.cs: Fixed typo causing include directories to be
- duplicated when switching between configurations.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * CBinding.mdp:
- * AssemblyInfo.cs: Add AssemblyInfo.cs files that are autogenerated from
- the addin manifests.
-
-2008-11-23 Mitchell Wheeler <mitchell.wheeler@gmail.com>
-
- * Gui/CTextEditorExtension.cs: Trailing whitespace after the
- cursor when inserting a new line will no longer copy additional
- whitespace into the next line.
-
-2008-11-23 Mitchell Wheeler <mitchell.wheeler@gmail.com>
-
- * Gui/CTextEditorExtension.cs: Fixed index out of range
- exception when attempting to add a new line to the
- beginning of a file.
-
-2008-11-23 Mitchell Wheeler <mitchell.wheeler@gmail.com>
-
- * Gui/CTextEditorExtension.cs: Refactored code relating to auto
- indentation - making it more maintainable/extensible for the
- future in addition to fixing various indentation errors under
- certain circumstances.
-
-2008-11-21 Mike Krüger <mkrueger@novell.com>
-
- * Gui/DataProvider.cs: fixed 'Bug 447040 - Error in text editor
- extension chain (new case)'.
-
-2008-11-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CTextEditorExtension.cs: Fix Bug 446207 - [Regression] C
- auto-formatting screws up.
-
-2008-11-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/CProject.cs: Allow running C projects.
-
- * Makefile.am: Fix parallel build issues.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.addin.xml: Bump MD version.
-
-2008-10-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/DataProvider.cs:
- * Gui/CTextEditorExtension.cs: Track APIs.
-
-2008-10-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/DataProvider.cs: Track CompletionData API.
-
-2008-10-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/DataProvider.cs: Track API.
-
-2008-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/CProject.cs: Track API.
-
-2008-09-29 Mike Krüger <mkrueger@novell.com>
-
- * Gui/DataProvider.cs: implemented IComparable.
-
-2008-09-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/DataProvider.cs: Track api changes.
-
-2008-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.mdp: Updated projects.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/CBinding.PackageDetails.cs, gtk-gui/generated.cs,
- gtk-gui/CBinding.EditPackagesDialog.cs,
- gtk-gui/CBinding.AddPathDialog.cs,
- gtk-gui/CBinding.CodeGenerationPanel.cs,
- gtk-gui/CBinding.GeneralOptionsPanel.cs,
- gtk-gui/CBinding.CompilerPanel.cs,
- gtk-gui/CBinding.OutputOptionsPanel.cs,
- gtk-gui/CBinding.AddLibraryDialog.cs: Updated generated code.
-
-2008-09-08 Mitchell Wheeler <mitchell.wheeler@gmail.com>
-
- * Gui/CTextEditorExtension.cs, Gui/AddLibraryDialog.cs,
- Navigation/LanguageItemCommandHandler.cs,
- Project/CProjectConfiguration.cs, Project/CProject.cs,
- gtk-gui/CBinding.PackageDetails.cs, gtk-gui/generated.cs,
- gtk-gui/CBinding.EditPackagesDialog.cs,
- gtk-gui/CBinding.AddPathDialog.cs,
- gtk-gui/CBinding.CodeGenerationPanel.cs,
- gtk-gui/CBinding.GeneralOptionsPanel.cs,
- gtk-gui/CBinding.CompilerPanel.cs,
- gtk-gui/CBinding.OutputOptionsPanel.cs,
- gtk-gui/CBinding.AddLibraryDialog.cs, gtk-gui/gui.stetic,
- Compiler/GNUCompiler.cs: Fixed various (dependency parsing,
- compiling, linking) bugs, so the binding now properly handles
- pathnames with spaces, and use the appropriate project
- configuration information. Started removing various gcc-specific
- library naming conventions from 'generic' areas of the C Binding
- codebase... Compiled object & dependency files are now stored in the
- output directory, so they no longer pollute the source tree.
- * Parser/Tag.cs, Parser/ProjectInformation.cs,
- Parser/TagDatabaseManager.cs, Parser/LanguageItem.cs,
- Parser/Member.cs: Fixed various ctags parsing bugs, in relation to
- pathnames containing spaces; Tag information now references code by
- file & line number, to avoid potential cases where the pattern
- matches more than just the expected section.
- * md1format.xml: Updated MD1 file format serialization to serialize
- libraries (library paths still broken?).
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * ProjectPad/ProjectPackagesFolderNodeBuilder.cs,
- ProjectPad/ProjectPackageNodeBuilder.cs,
- ProjectPad/ProjectReferencesExtension.cs,
- ProjectPad/ProjectNodeExtension.cs,
- Navigation/TypedefNodeBuilder.cs,
- Navigation/StructureNodeBuilder.cs, Navigation/MacroNodeBuilder.cs,
- Navigation/ProjectNodeBuilderExtension.cs,
- Navigation/ClassNodeBuilder.cs, Navigation/MemberNodeBuilder.cs,
- Navigation/EnumeratorNodeBuilder.cs,
- Navigation/LanguageItemCommandHandler.cs,
- Navigation/GlobalsNodeBuilder.cs,
- Navigation/FunctionNodeBuilder.cs,
- Navigation/VariableNodeBuilder.cs,
- Navigation/EnumerationNodeBuilder.cs,
- Navigation/UnionNodeBuilder.cs, Navigation/NamespaceNodeBuilder.cs,
- Navigation/MacroDefinitionsNodeBuilder.cs: Moved the extensible
- tree view to its own directory.
-
-2008-08-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * CBinding.addin.xml, ProjectPad/ProjectResourcesExtension.cs,
- CBinding.mdp, Makefile.am: Remove the "resources folder" feature.
- Resources are now shown in the solution tree like any other files.
- For a detailed explanation see "Bug 381430 - [PATCH] Display
- resource files in main project tree".
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * CLanguageBinding.cs, CppLanguageBinding.cs: Translated old code to
- new dom.
-
-2008-07-21 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Project/ProjectPackageCollection.cs: Cleanup. Fixes bug #390419.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * md1format.xml, Project/CProject.cs, Project/CProjectConfiguration.cs,
- Project/Package.cs: Moved serialization engine to MonoDevelop.Core.
- Use new syntax for specifying attribute scope.
-
-2008-06-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/CProject.cs: Don't set the build action for files when
- loading a project. Fixes bug #402336.
-
-2008-06-22 Mitchell Wheeler <mitchell.wheeler@gmail.com>
-
- * Compiler/GNUCompiler.cs: Fix bug#379620.
-
-2008-06-22 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * Gui/EditPackagesDialog.cs: Change the way of distinguishing tabs not
- to rely on strings that may be translated.
- * gtk-gui/CBinding.EditPackagesDialog.cs, gtk-gui/gui.stetic: Use
- custom label names.
-
-2008-06-21 Mitchell Wheeler <mitchell.wheeler@gmail.com>
-
- * Gui/EditPackagesDialog.cs: Re-check if there is a selected
- package before setting the package details button to sensitive
- on tab/page change.
- Fixes new steps to reproduce the bug 398789.
-
-2008-06-10 Marcos David Marín Amador <marcosmarin@gmail.com>
-
- * Gui/EditPackagesDialog.cs: Check if there is a selected package
- before setting the package details button to sensitive.
- Fixes bug 398789.
-
-2008-06-04 Marcos David Marín Amador <marcosmarin@gmail.com>
-
- * Gui/GeneralOptionsPanel.cs, Parser/TagDatabaseManager.cs: Don't
- parse local valriables by default.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/CProject.cs: The configuration parameter of GetDeployFiles is
- a solution configuration, so it needs to get the mapped project
- configuration name. Track some api changes.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.addin.xml: Bump MD version.
-
-2008-05-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/CProject.cs: Properly set debug mode when creating a project.
-
-2008-05-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CodeGenerationPanel.cs, md1format.xml, CBinding.addin.xml,
- CBinding.mdp, Project/CProjectConfiguration.cs,
- Project/CCompilationParameters.cs, Project/CProject.cs,
- Makefile.am, Compiler/GNUCompiler.cs: Removed
- CCompilationParameters because it is not really needed like in the
- .net case. Also changed the name used to serialize some properties,
- to better match the msbuild model. Added a serialization map
- (md1format.xml) for backwards compatibility with the old mdp
- format.
-
-2008-05-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/CProject.cs: BaseDirectory can't be used until the project
- has been saved. Fixes bug 393945 - Can not create new C Binding
- project.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.addin.xml: Merged the extension points for project and
- solution option panels into a single extension point. A single
- extension point will now be used for all kinds of items. Extension
- conditions can be used to make panels visible only for some
- specific item types.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.addin.xml: Show build options in the build section.
- * Project/CProjectConfiguration.cs: Fix nullref. Fixes bug #393422.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/CProjectServiceExtension.cs, Project/CProject.cs,
- Compiler/CCompiler.cs, Compiler/ICompiler.cs,
- Compiler/GNUCompiler.cs: Replaced
- ICompilerResult/DefaultCompilerResult/CompilerResults by a new
- BuildResult class, which has owner information at error level, so
- it is possible to know which project generated an error when
- building a solution. Updated Task and TaskService to use the new
- owner information.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/OutputOptionsPanel.cs, Gui/EditPackagesDialog.cs,
- Gui/CodeGenerationPanel.cs, Gui/CompilerPanel.cs,
- CBinding.addin.xml, ProjectPad/ProjectPackagesFolderNodeBuilder.cs,
- ProjectPad/ProjectPackageNodeBuilder.cs, CBinding.mdp,
- Parser/TagDatabaseManager.cs,
- Navigation/ProjectNodeBuilderExtension.cs,
- Project/CProjectConfiguration.cs, Project/CProjectBinding.cs,
- Project/CProjectServiceExtension.cs, Project/CProject.cs,
- gtk-gui/gui.stetic, Compiler/GNUCompiler.cs: New project model
- changes.
-
-2008-05-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * CBinding.addin.xml: Set "isText" attribute on the mimetype
- definitions.
-
-2008-04-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CTextEditorExtension.cs: Track API change.
-
-2008-04-13 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Parser/TagDatabaseManager.cs: Fixed bug that prevented system tags from
- being written and parsed.
-
-2008-04-13 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/EditPackagesDialog.cs, gtk-gui/CBinding.EditPackagesDialog.cs,
- gtk-gui/gui.stetic: Made details button unsensitive until a package is
- selected.
-
-2008-04-13 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/EditPackagesDialog.cs, CBinding.addin.xml,
- ProjectPad/ProjectPackageNodeBuilder.cs, Project/CProject.cs: Added a
- command to the Package context menu to see the details on the package
- and fixed a bug where packages could not be added to a project.
-
-2008-04-13 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * CBinding.addin.xml: Commented out a wrong extension point. Will find the
- correct one later.
-
-2008-04-12 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/PackageDetails.cs, Gui/EditPackagesDialog.cs, CBinding.addin.xml,
- ProjectPad/ProjectPackagesFolderNodeBuilder.cs,
- ProjectPad/ProjectPackageNodeBuilder.cs, CBinding.mdp,
- Project/Package.cs, Project/ProjectPackageCollection.cs,
- Project/ProjectPackageEventArgs.cs, Project/ProjectPackage.cs,
- Project/CProject.cs, gtk-gui/CBinding.PackageDetails.cs,
- gtk-gui/CBinding.EditPackagesDialog.cs,
- gtk-gui/CBinding.CodeGenerationPanel.cs, gtk-gui/gui.stetic,
- Makefile.am, Compiler/CCompiler.cs: Changed the class ProjectPackage to
- just Package and created a package details dialog that can be seen from
- the EditPackagesDialog.
-
-2008-04-12 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/EditPackagesDialog.cs, gtk-gui/CBinding.EditPackagesDialog.cs,
- gtk-gui/gui.stetic: Fixed bug 369688 - Find as you type doesn't work in
- the dialog where you select the project references.
-
-2008-04-12 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/EditPackagesDialog.cs: Alphabetically sort the list of packages and
- did some formatting.
-
-2008-04-11 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * CBinding.addin.xml, Gui/CTextEditorExtension.cs,
- Project/CProject.cs: Enable source/header swapping with a keybinding
- and menu items
-
-2008-04-10 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/EditPackagesDialog.cs: Fixed bug 368755: "MD should not guess if a
- reference is managed or unmanaged relying on cflags"
-
-2008-04-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.addin.xml: Use the new mime type extension to register new
- file types.
-
-2008-04-03 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Parser/TagDatabaseManager.cs: Fixed mismatched single-quote.
-
-2008-03-29 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Parser/Function.cs: No longer attempt to find prototypes.
- * Parser/TagDatabaseManager.cs: No longer generate prototype tags.
- * Gui/GeneralOptionsPanel.cs: changed completion for local variables
- and memeber to on by default.
-
-2008-03-29 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Parser/*: Add best-guess completion for members and
- (optionally, default off) local variables.
-
-2008-03-21 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Compiler/GNUCompiler.cs: Instead of having the Include and Lib Paths
- marked as ProjectPathItemProperty now mark them as regular
- ItemProperties and instead added functionality to insert and parse
- macros like ${ProjectDir} and ${CombineDir} in the Include and Lib
- Paths.
-
-2008-03-19 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Parser/TagDatabaseManager.cs: Search project include paths
- for relatively-pathed includes.
-
-2008-03-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CTextEditorExtension.cs: Only smart-indent when smart-indenting
- is enabled. Respect tabs/spaces setting.
-
-2008-03-16 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/OutputOptionsPanel.cs: Fix bug where the pauseCheckbox control could
- be greyed out when it should be souldn't.
-
-2008-03-14 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Compiler/GNUCompiler.cs: Insert into front of list instead of at the end,
- fixes bug 368478: "Multi-line build errors are displayed out of order ".
-
-2008-03-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/GeneralOptionsPanel.cs, CBinding.addin.xml: Use new options
- dialog infrastructure.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * Parser/LanguageItem.cs, Project/CProject.cs, Compiler/CCompiler.cs: Worked
- on gnome hig compliant alerts.
-
-2008-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * ProjectPad/ProjectPackageNodeBuilder.cs: Handle the delete key in
- TreeViewPad, so it will work event if the shortcut is not defined.
-
-2008-02-19 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Compiler/GNUCompiler.cs: Handle better CleanPrecompiledHeaders, fixes bug
- 361045.
-
-2008-02-14 Geoff Norton <gnorton@novell.com>
-
- * Parser/TagDatabaseManager.cs: Disable the ctag implementation on OSX
- as the ctags that apple ships is entirely incompatible with this parser.
-
-2008-02-13 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Compiler/GNUCompiler.cs: Make sure directory exists before attempting to
- delete it.
-
-2008-02-13 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Compiler/GNUCompiler.cs: Use string.Join instead of custom method.
-
-2008-02-09 Mike Krüger <mkrueger@novell.com>
-
- * CBinding.addin.xml, CBinding.mdp, Makefile.am: Removed source editor
- dependency.
-
-2008-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Parser/TagDatabaseManager.cs: Improve error handling. Should fix "Bug
- 359567 - MonoDevelop crashes when creating/opening C++ Console Project".
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.addin.xml: Update MD version.
-
-2008-01-22 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Compiler/GNUCompiler.cs: Removed useless code.
-
-2008-01-18 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Parser/TagDatabaseManager.cs: Cache tags into a hash table and see if they
- had been previously cached before looking for them again.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/StaticLibraryCProject.xpt.xml,
- templates/StaticLibraryCppProject.xpt.xml,
- templates/EmptyCProject.xpt.xml, templates/EmptyCSourceFile.xft.xml,
- templates/EmptyCppProject.xpt.xml, templates/EmptyCppSourceFile.xft.xml,
- templates/ConsoleCProject.xpt.xml, templates/ConsoleCppProject.xpt.xml,
- templates/EmptyCHeaderFile.xft.xml,
- templates/EmptyCppHeaderFile.xft.xml,
- templates/SharedLibraryCProject.xpt.xml,
- templates/SharedLibraryCppProject.xpt.xml: Make template categories
- translatable.
-
-2008-01-12 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Parser/TagDatabaseManager.cs: Only lock the parsingJobs queue object.
-
-2008-01-11 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Parser/TagDatabaseManager.cs: When searching for a tag instead of doing a
- linear search do a binary search (ctags output sorted tag files).
- Greatly improves parsing speed. Also removed some unused methods.
-
-2008-01-08 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/EditPackagesDialog.cs: Make sure packages are not repeated if the
- system has more than one copy of the same package in different
- directories.
- * Parser/TagDatabaseManager.cs: Changed the name of a propery.
-
-2008-01-07 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Project/CProject.cs: Deploy resources in the correct way.
-
-2008-01-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * Parser/TagDatabaseManager.cs: Only try to parse tags if ctags and gcc are
- installed.
-
-2007-12-31 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Compiler/GNUCompiler.cs: Report errors in the same order as they were
- outputted by the compiler and parse linker output to form better linker
- error reports.
-
-2007-12-31 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Project/CProject.cs: Copy deployment files to output directory when
- building the project.
-
-2007-12-28 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/GeneralOptionsPanel.cs, CBinding.addin.xml,
- Parser/TagDatabaseManager.cs, CBinding.mdp, Project/CProject.cs,
- gtk-gui/CBinding.EditPackagesDialog.cs,
- gtk-gui/CBinding.CodeGenerationPanel.cs, gtk-gui/objects.xml,
- gtk-gui/CBinding.GeneralOptionsPanel.cs, gtk-gui/gui.stetic,
- Makefile.am: Added a general configuration panel for CBinding where you
- can choose the default compiler for new C and C++ projects as well as
- set if you want to parse system tags or not.
- * Compiler/GppCompiler.cs, Compiler/GccCompiler.cs: Changed compiler names.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.mdp: Updated project files. The order of extended properties
- won't change anymore.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.addin.xml: Bump add-in versions.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.mdp, Makefile.am: Add missing reference.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.addin.xml, CBinding.mdp, CBinding.mds,
- CBinding.Autotools/CBinding.Autotools.mdp, Makefile.am: Directory
- reorganization.
-
-2007-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.mdp, gtk-gui/gui.stetic: Updated paths.
-
-2007-11-23 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Compiler/GNUCompiler.cs: Should fix bug #343098
-
- gcc/g++ failed if path had white spaces.
-
-2007-11-17 Christian Hergert <christian.hergert@gmail.com>
-
- * Gui/EditPackagesDialog.cs: Check if string is null or empty before using
- it to prevent crash.
-
-2007-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Parser/TagDatabaseManager.cs: Track LoggingService API changes.
-
-2007-11-06 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Navigation/ProjectNodeBuilderExtension.cs: Moved all the threading for the
- parsing of source files to the TagDatabaseManager, parsing jobs are
- placed on a queue and dispatched by a single thread. Fixes bug 336368.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.addin.xml: Bump MD version.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.addin.xml: Track changes in the Icon extension node.
-
-2007-10-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * Compiler/GNUCompiler.cs: Handle cancellation of build.
-
-2007-10-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/EditPackagesDialog.cs: Normalise pkg-config paths so that comparison
- to avoid duplication works correctly. Add lib64 to default paths.
- * Project/CProjectConfiguration.cs: Add configuration option to disable
- precompilation of headers.
- * Project/CProjectServiceExtension.cs: Pass cleanup to ICompiler.Clean.
- * Compiler/CCompiler.cs, Compiler/ICompiler.cs: Add Clean method and
- SupportsPrecompiledHeaders property.
- * Compiler/GNUCompiler.cs: Reworked process launching so that it handles
- output as it's generated. (fixes "Bug 336363 - [CBinding, possibly all
- MD] MD hangs when a compile output is long"). Headers are now
- precompiled if they're set to "compile", and precompilation errors are
- reported. Clean precompiled headers when appropriate. Pass package flags
- to header precompilation. Report build phases to monitor, also using
- gettext.
-
-2007-10-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * icons/text-x-c++src.32x32.png, templates/EmptyCHeaderFile.xft.xml,
- templates/EmptyCppHeaderFile.xft.xml,
- templates/EmptyCppSourceFile.xft.xml,
- templates/EmptyCSourceFile.xft.xml: Use tango file icons. Removed
- obsolete icons.
-
-2007-10-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.mdp, templates/StaticLibraryCProject.xpt.xml,
- templates/StaticLibraryCppProject.xpt.xml,
- templates/EmptyCProject.xpt.xml, templates/EmptyCppProject.xpt.xml,
- templates/ConsoleCProject.xpt.xml, templates/ConsoleCppProject.xpt.xml,
- templates/SharedLibraryCProject.xpt.xml,
- templates/SharedLibraryCppProject.xpt.xml, Makefile.am,
- icons/C.Project.ConsoleProject, icons/C.Project.SharedLibrary,
- icons/Cpp.Project.Empty, icons/C.Project.Empty,
- icons/C.Project.StaticLibrary, icons/c-icon-32.png,
- icons/cpp-icon-32.png: Updated project icons. Use the base project icon
- with an overlay to show the type.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.mdp, CBinding.mds, CBinding.Autotools/CBinding.Autotools.mdp:
- Project file names updated by change in MD path functions.
-
-2007-10-20 Chris Howie <bzximian.3.crazycomputers@neverbox.com>
-
- * Project/CProject.cs: Don't assume LD_LIBRARY_PATH is set.
-
-2007-10-12 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Navigation/ProjectNodeBuilderExtension.cs: If exuberant-ctags is not
- installed, instead of showing an error message dialog, put an error
- message in the class pad in the project node.
-
-2007-10-05 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/CodeGenerationPanel.cs, Project/CCompilationParameters.cs,
- gtk-gui/CBinding.CodeGenerationPanel.cs, gtk-gui/gui.stetic,
- Compiler/GNUCompiler.cs: Added "Treat warnings as errors" option to code
- generation panel and implemented it for gcc and g++.
- * Parser/TagDatabaseManager.cs: Suppressed unused variable warning and added
- checks for faulty ctags tags.
-
-2007-10-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * CBinding.mdp, gtk-gui/gui.stetic: Target GTK# 2.8.
- * Project/CProject.cs: Track execution API changes.
-
-2007-09-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.mdp: Don't local copy references.
-
-2007-09-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/TagDatabaseManager.cs: Don't crash if the compiler can't be found.
- * Compiler/GNUCompiler.cs: Check for the compiler before trying to compile.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * CBinding.addin.xml: Bump MD version.
-
-2007-09-17 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Parser/Function.cs, Parser/TagDatabaseManager.cs,
- Navigation/ProjectNodeBuilderExtension.cs: Make sure ctags process exits
- and fixed several null pointer exceptions.
-
-2007-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs, gtk-gui/CBinding.EditPackagesDialog.cs,
- gtk-gui/CBinding.AddPathDialog.cs,
- gtk-gui/CBinding.CodeGenerationPanel.cs,
- gtk-gui/CBinding.CompilerPanel.cs,
- gtk-gui/CBinding.OutputOptionsPanel.cs,
- gtk-gui/CBinding.AddLibraryDialog.cs: Updated.
-
-2007-09-14 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * CBinding.mdp: Set path to configure.in in Makefile integration.
-
-2007-09-14 Martin Dederer <martindederer@gmx.de>
-
- * Compiler/GNUCompiler.cs: Added method to expand backticked portions
- in compiler-/ linker-arguments
-
-2007-09-07 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * CBinding.Autotools: Set svn:ignore property on
- CBinding.Autotools.pidb
-
-2007-09-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CTextEditorExtension.cs: Track api changes.
- * CBinding.mdp: Use gtk# 2.8.
-
-2007-09-07 <>
-
- * Makefile.am: Check ENABLE_C to find out if assembly should be compiled or
- not.
-
-2007-09-05 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Navigation/ProjectNodeBuilderExtension.cs: Update ClassPad when the
- project starts without having to save a file.
-
-2007-09-04 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/CodeGenerationPanel.cs, Compiler/GNUCompiler.cs: Change newlines into
- spaces from ExtraCompiler/LinkerArgs right before compilation so the
- newline and spaces are conserved when serializing the project.
-
-2007-09-03 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Gui/OutputOptionsPanel.cs, Gui/CodeGenerationPanel.cs,
- Gui/CompilerPanel.cs, Parser/TagDatabaseManager.cs: Adapt to new api
- changes.
-
-2007-09-01 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/CompilerPanel.cs, Project/CProject.cs: Allow changing the project's
- language from C to C++ and vice versa by changing the compiler in the
- compiler panel.
-
-2007-09-01 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Compiler/GNUCompiler.cs: Fixed ccache implementation, though I'm still not
- sure if ccache should be used in the linking stage (Its currently not
- used, and I think thats correct).
-
-2007-08-31 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/EditPackagesDialog.cs, gtk-gui/CBinding.EditPackagesDialog.cs,
- gtk-gui/gui.stetic: Ignore case when searching for a pkg-pcackages
- version.
- * Compiler/CCompiler.cs, Compiler/GNUCompiler.cs: No longer call bash.
-
-2007-08-30 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * gtk-gui/CBinding.CodeGenerationPanel.cs, gtk-gui/gui.stetic: Still more
- CodeGenerationPanel UI improving. I think it is now good enough for now.
-
-2007-08-29 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * gtk-gui/CBinding.CodeGenerationPanel.cs, gtk-gui/gui.stetic: Improved UI,
- could still use more improvement.
-
-2007-08-28 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Project/CProjectConfiguration.cs: rewrote naming convetion handling.
-
-2007-08-20 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/CompilerPanel.cs, Project/CProjectConfiguration.cs,
- gtk-gui/CBinding.CodeGenerationPanel.cs,
- gtk-gui/CBinding.CompilerPanel.cs, gtk-gui/gui.stetic,
- Compiler/CCompiler.cs, Compiler/ICompiler.cs, Compiler/GNUCompiler.cs:
- Added support for ccache.
-
-2007-08-19 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * templates/EmptyCSourceFile.xft.xml, templates/EmptyCppSourceFile.xft.xml,
- templates/EmptyCHeaderFile.xft.xml,
- templates/EmptyCppHeaderFile.xft.xml: Fixed some default values.
- * Project/CProject.cs: Fixed a bug where the deploy state of files was not
- persistent.
-
-2007-08-18 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Project/ProjectPackageCollection.cs: Added a ToStringArray method to
- easily get an array of the names of the packages the collection
- contains.
- * Project/CProject.cs: Fixed up the deployment pkg-config package and
- improved deployment.
- * Compiler/CCompiler.cs, Compiler/ICompiler.cs, Compiler/GNUCompiler.cs:
- Added a GenerateDefineFlags method which is used to write the deployed
- pkg-config package.
-
-2007-08-17 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Project/CProject.cs: Fixed a null pointer exception and changed library
- deployments to ProgramFilesRoot.
-
-2007-08-17 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Project/CProject.cs: Enhanced deployment.
-
-2007-08-16 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * CLanguageBinding.cs: Made C specific.
- * CppLanguageBinding.cs: Needed so that templates can have C++ files.
- * CBinding.addin.xml: Bumped version to 0.15.0
-
- Seperated file filter for C and C++.
-
- Added project templates for Shared Library, Static Library and Console
- Project for both C and C++.
-
- Added a seperate language binding for C and one for C++ (this was
- necessary to have project templates that include C++ files).
- * CBinding.mdp, templates/StaticLibraryCProject.xpt.xml,
- templates/StaticLibraryCppProject.xpt.xml,
- templates/ConsoleCProject.xpt.xml, templates/ConsoleCppProject.xpt.xml,
- templates/SharedLibraryCProject.xpt.xml,
- templates/SharedLibraryCppProject.xpt.xml, Makefile.am,
- icons/C.Project.ConsoleProject, icons/C.Project.SharedLibrary,
- icons/C.Project.StaticLibrary: New templates for Shared Library, Static
- Library and Console Project for C and C++.
- * README: Added icon licence information.
-
-2007-08-15 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * CBinding.addin.xml, CBinding.mdp, Project/CProject.cs, Makefile.am:
- Implemented IDeployable.
-
-2007-08-15 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Project/CProject.cs: Write all directories with header files to the
- project's pkg-config package.
-
-2007-08-14 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * gtk-gui/CBinding.OutputOptionsPanel.cs, gtk-gui/gui.stetic: Make output
- entry editable.
-
-2007-08-14 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Project/CProjectServiceExtension.cs: Update the project's pkg package
- every time it is compiled.
-
-2007-08-13 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/EditPackagesDialog.cs, ProjectPad/ProjectPackagesFolderNodeBuilder.cs,
- Project/CProjectConfiguration.cs, Project/CProject.cs: Allow CProjects
- to depend on other CProjects that compile into a shared object as well
- as static libraries.
-
-2007-08-13 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/DataProvider.cs, CBinding.addin.xml, Navigation/UnionNodeBuilder.cs:
- Added the union icons to the stock icons so I don't have to create my
- own pixbuf in the union node builder and now I can use the proper union
- icon in the completion widget.
-
-2007-08-12 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Parser/TagDatabaseManager.cs: Parse functions from it's prototype if
- possible instead of waiting for the implementation, if it is an inline
- function parse it with that.
-
-2007-08-12 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * CBinding.addin.xml, ProjectPad/ProjectResourcesExtension.cs, Makefile.am:
- Hide the resources node in the project pad for CProjects.
-
-2007-08-12 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * CBinding.addin.xml: Added the paste command to the packages folder node's
- context menu and the copy command to the package node's context menu.
-
-2007-08-11 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Project/CProjectConfiguration.cs: Make paths relative to project folder.
-
-2007-08-09 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/DataProvider.cs, Parser/Function.cs: Support for constant methods.
- * CBinding.addin.xml: Fixed addin-breaker-typo-from-hell.
-
-2007-08-09 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * CBinding.addin.xml, CBinding.mdp: Some corrections.
-
-2007-08-09 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * CBinding.addin.xml, CBinding.mdp, Makefile.am: Updated the paths and
- embedded the .addin.xml into the assembly
-
-2007-08-08 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/CTextEditorExtension.cs, Gui/DataProvider.cs,
- Parser/ProjectInformation.cs, Parser/Function.cs,
- Parser/TagDatabaseManager.cs: Parse and complete for included system
- files too.
-
-2007-08-07 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/OutputOptionsPanel.cs, Gui/AddLibraryDialog.cs,
- Gui/EditPackagesDialog.cs, Gui/AddPathDialog.cs,
- Gui/CodeGenerationPanel.cs, gtk-gui/CBinding.EditPackagesDialog.cs,
- gtk-gui/CBinding.AddPathDialog.cs,
- gtk-gui/CBinding.CodeGenerationPanel.cs,
- gtk-gui/CBinding.OutputOptionsPanel.cs,
- gtk-gui/CBinding.AddLibraryDialog.cs, gtk-gui/gui.stetic: Updated
- widgets.
-
-2007-08-07 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * CBinding.addin.xml, gtk-gui/CBinding.CodeGenerationPanel.cs: Removed
- autotools support since it is currently very .NET specific.
-
-2007-08-06 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * CBinding.addin.xml, CBinding.mdp, CBinding.mds,
- CBinding.Autotools/AssemblyInfo.cs,
- CBinding.Autotools/CAutotoolsSetup.cs,
- CBinding.Autotools/CBinding.Autotools.mdp, Compiler/CCompiler.cs,
- Compiler/ICompiler.cs, Compiler/GNUCompiler.cs: Started work on
- supporting makefile generation.
-
-2007-08-06 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/DataProvider.cs: Use correct icons.
-
-2007-08-06 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Navigation/ProjectNodeBuilderExtension.cs,
- ProjectPad/ProjectPackagesFolderNodeBuilder.cs: Adjusted to new API
- changes.
-
-2007-08-03 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/CTextEditorExtension.cs: Added support for '::' completion.
- * Gui/DataProvider.cs: Changed the completion icon of a typedef to match the
- icon used in the class pad.
- * Makefile.am, CBinding.addin.xml, CBinding.mdp,
- templates/EmptyCSourceFile.xft.xml,
- templates/EmptyCppSourceFile.xft.xml,
- templates/EmptyCHeaderFile.xft.xml,
- templates/EmptyCppHeaderFile.xft.xml: Added file templates and changed
- icons.
- * Parser/ProjectInformation.cs: Added some helper methods.
- * Parser/Function.cs: Overrided the Equals and GetHasCode methods so that it
- uses the function's parameters too.
-
-2007-07-26 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Navigation/ProjectNodeBuilderExtension.cs,
- Gui/CTextEditorExtension.cs, Project/CProject.cs,
- Parser/Enumerator.cs, Parser/Function.cs, Parser/Enumeration.cs,
- Parser/Union.cs, Parser/TagDatabaseManager.cs, Parser/Namespace.cs,
- Parser/Typedef.cs, Parser/Structure.cs, Parser/LanguageItem.cs,
- Parser/Class.cs, Parser/Member.cs: Now a file's tags are updated
- when the file is saved. Also, instead of writing the tags to a file
- I now write them to stdout and parse them from there since I now
- parse per file instead of the entire project.
-
-2007-07-25 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Navigation/ProjectNodeBuilderExtension.cs,
- Parser/TagDatabaseManager.cs: It is now possible to update tags for
- only one source file instead of the entire project (though it's
- curently not in use anywhere).
-
- When it does this it creates a tags file for the source file and
- the included non system headers and parses that file.
-
- I'm not sure where this code should be called.
- * Navigation/LanguageItemEventArgs.cs, Navigation/ClassPadEventArgs.cs:
- Made these subclass EventArgs.
- * Gui/CTextEditorExtension.cs, Gui/DataProvider.cs: Implemented simple
- code completion by pressing ctrl+space.
-
-2007-07-24 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/DataProvider.cs: Make the name of the method bold.
-
-2007-07-22 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Navigation/Enumerator.cs, Navigation/Function.cs,
- Navigation/Variable.cs, Navigation/Enumeration.cs,
- Navigation/Union.cs, Navigation/Namespace.cs,
- Navigation/Typedef.cs, Navigation/Structure.cs,
- Navigation/Macro.cs, Navigation/LanguageItem.cs,
- Navigation/Class.cs, Navigation/Member.cs: Moved to
- CBinding.Parser.
- * Gui/CTextEditorExtension.cs, Gui/DataProvider.cs, Parser/Tag.cs,
- Parser/TagDatabaseManager.cs, CBinding.mdp: Implemented simple
- parameters completion.
-
-2007-07-19 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Compiler/GNUCompiler.cs: Send -fPIC to the compiler if the compile
- target is a shared library (Is this really needed?).
-
-2007-07-19 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Compiler/GNUCompiler.cs: Fixed a bug in dependency tracking.
-
-2007-07-18 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/EditPackagesDialog.cs, Project/ProjectPackageCollection.cs,
- Project/CProject.cs, gtk-gui/CBinding.EditPackagesDialog.cs,
- gtk-gui/gui.stetic, CBinding.addin.xml,
- ProjectPad/ProjectPackagesFolderNodeBuilder.cs: Fixed several bugs.
- * Makefile.am, ProjectPad/ProjectPackageNodeBuilder.cs,
- icons/Icons.16x16.ProjectReference, CBinding.mdp: Project packages
- have a different icon.
-
-2007-07-17 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/EditPackagesDialog.cs, gtk-gui/CBinding.EditPackagesDialog.cs,
- gtk-gui/gui.stetic: Got the edit packages dialog to work with
- adding packages from projects in the combine (though it's a bit
- buggy)
-
-2007-07-15 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/EditPackagesDialog.cs, Project/ProjectPackage.cs,
- Project/CProjectServiceExtension.cs, Project/CProject.cs,
- Compiler/CCompiler.cs,
- ProjectPad/ProjectPackagesFolderNodeBuilder.cs,
- ProjectPad/ProjectPackageNodeBuilder.cs: Projects can now depend on
- other projects in the solution (currently only projects that
- compile into a static library).
-
-2007-07-14 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Compiler/GNUCompiler.cs: Implemented dependency tracking. Dependency
- tracking is treated as a side effect of compiling.
-
-2007-07-14 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/CTextEditorExtension.cs, CBinding.addin.xml, CBinding.mdp,
- Makefile.am: Implemented a better formatting strategy (using a text
- editor extension).
-
-2007-07-13 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Gui/CTextEditorExtension.cs, CBinding.addin.xml, CBinding.mdp,
- CFormattingStrategy.cs, Makefile.am: Implemented a very simple
- FormattingStrategy.
- * Project/CProject.cs: Changed the project type from 'C/C++' to
- 'Native'.
-
-2007-07-13 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Navigation/StructureNodeBuilder.cs,
- Navigation/ProjectNodeBuilderExtension.cs,
- Navigation/MemberNodeBuilder.cs, Navigation/Function.cs,
- Navigation/Enumeration.cs, Navigation/GlobalsNodeBuilder.cs,
- Navigation/VariableNodeBuilder.cs,
- Navigation/EnumerationNodeBuilder.cs, Navigation/Member.cs,
- Navigation/MacroDefinitionsNodeBuilder.cs,
- Navigation/Enumerator.cs, Navigation/ClassNodeBuilder.cs,
- Navigation/Variable.cs, Navigation/Union.cs,
- Navigation/Namespace.cs, Navigation/Typedef.cs,
- Navigation/Structure.cs, Navigation/Macro.cs,
- Navigation/LanguageItem.cs, Navigation/FunctionNodeBuilder.cs,
- Navigation/UnionNodeBuilder.cs, Navigation/Class.cs,
- Navigation/NamespaceNodeBuilder.cs, Makefile.am, CBinding.mdp,
- Parser/TagDatabaseManager.cs, Parser/Tag.cs,
- Parser/ProjectInformation.cs, Parser/ProjectInformationManager.cs:
- Seperated the navigation stuff from the parsing stuff.
-
-2007-07-13 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * ProjectPad/ProjectPackageNodeBuilder.cs: Implemented dragging and
- dropping of packages.
-
-2007-07-12 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Project/CProjectConfiguration.cs: Fixed a bug which was causing the
- app to go into an infinite loop.
-
-2007-07-12 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Project/CProjectServiceExtension.cs: Removed the need to invoke bash
- when removing object code files.
- * Compiler/GNUCompiler.cs: Small fixes.
-
-2007-07-12 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Project/CProjectConfiguration.cs, Project/CProject.cs,
- Compiler/GNUCompiler.cs: Inplemented support for precompiled header
- files in gcc and g++.
- * CBinding.addin.xml: Fixed something I had broken.
-
-2007-07-10 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Navigation/ProjectNodeBuilderExtension.cs,
- Navigation/ClassPadEventArgs.cs, Project/CProject.cs, Makefile.am,
- CBinding.addin.xml, icons/update,
- ProjectPad/ProjectPackagesFolderNodeBuilder.cs, CBinding.mdp: The
- class pad tree is now built in a seperate thread so it does not
- block the UI while it is being built.
-
-2007-07-07 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Navigation/GlobalsNodeBuilder.cs: Fixes class pad bug when there are
- multiple C projects open.
-
-2007-07-06 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Navigation/StructureNodeBuilder.cs, Navigation/ClassNodeBuilder.cs:
- The "Show Public Api Only" class pad option is now considered.
-
-2007-07-06 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Navigation/ProjectNodeBuilderExtension.cs,
- Navigation/TagDatabaseManager.cs, Navigation/GlobalsNodeBuilder.cs:
- Undid the work I had started on getting the tree built in the
- background because I have to think more about how I'm going to
- implement that.
-
-2007-07-05 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Navigation/ProjectNodeBuilderExtension.cs,
- Navigation/LanguageItemEventArgs.cs,
- Navigation/TagDatabaseManager.cs,
- Navigation/ProjectNavigationInformation.cs,
- Navigation/GlobalsNodeBuilder.cs,
- Navigation/LanguageItemCommandHandler.cs,
- Project/ProjectPackageEventArgs.cs, Makefile.am, CBinding.mdp:
- Started work on making the class pad tree get created in the
- background in a seperate thread.
-
-2007-07-03 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Navigation/TypedefNodeBuilder.cs, Navigation/StructureNodeBuilder.cs,
- Navigation/Function.cs, Navigation/Enumeration.cs,
- Navigation/TagDatabaseManager.cs,
- Navigation/ProjectNavigationInformation.cs,
- Navigation/GlobalsNodeBuilder.cs, Navigation/Member.cs,
- Navigation/Tag.cs, Navigation/ClassNodeBuilder.cs,
- Navigation/Union.cs, Navigation/Structure.cs,
- Navigation/Typedef.cs, Navigation/FunctionNodeBuilder.cs,
- Navigation/LanguageItem.cs, Navigation/Class.cs,
- Navigation/UnionNodeBuilder.cs, Navigation/NamespaceNodeBuilder.cs,
- gtk-gui/gui.stetic, Makefile.am, CBinding.addin.xml,
- icons/Icons.16x16.ProtectedUnion, icons/Icons.16x16.PrivateUnion,
- icons/Icons.16x16.Union, CBinding.mdp: Added support for typedefs
- and unions in the class pad.
-
-2007-07-02 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Navigation/Tag.cs, Navigation/StructureNodeBuilder.cs,
- Navigation/Enumerator.cs, Navigation/ClassNodeBuilder.cs,
- Navigation/Enumeration.cs, Navigation/TagDatabaseManager.cs,
- Navigation/ProjectNavigationInformation.cs,
- Navigation/EnumeratorNodeBuilder.cs,
- Navigation/GlobalsNodeBuilder.cs, Navigation/LanguageItem.cs,
- Navigation/EnumerationNodeBuilder.cs,
- Navigation/NamespaceNodeBuilder.cs, Makefile.am,
- CBinding.addin.xml, CBinding.mdp: Added support for enumerations
- and their respective enumerators in the class pad.
- * Navigation/LanguageItemCommandHandler.cs: Small change which fixes a
- bug when double clicking a macro definition.
-
-2007-07-02 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * CBinding.addin.xml: Fixed a typo.
-
-2007-07-02 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Navigation/Tag.cs, Navigation/MacroNodeBuilder.cs,
- Navigation/ProjectNodeBuilderExtension.cs,
- Navigation/TagDatabaseManager.cs,
- Navigation/ProjectNavigationInformation.cs,
- Navigation/GlobalsNodeBuilder.cs, Navigation/Macro.cs,
- Navigation/MacroDefinitionsNodeBuilder.cs, Makefile.am,
- CBinding.addin.xml, CBinding.mdp: Added support for macro
- definitions to appear in the class pad. They will appear in a
- special node called "Macro Definitions".
-
-2007-07-02 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Navigation/Tag.cs, Navigation/Variable.cs,
- Navigation/TagDatabaseManager.cs,
- Navigation/ProjectNavigationInformation.cs,
- Navigation/GlobalsNodeBuilder.cs,
- Navigation/VariableNodeBuilder.cs, Makefile.am, CBinding.addin.xml,
- CBinding.mdp: Added support for global variables to be added to the
- class pad. Also fixed options sent to ctags so macro difinitions
- can now be easily handled.
-
-2007-07-01 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Navigation/Tag.cs, Navigation/StructureNodeBuilder.cs,
- Navigation/ClassNodeBuilder.cs, Navigation/MemberNodeBuilder.cs,
- Navigation/TagDatabaseManager.cs,
- Navigation/ProjectNavigationInformation.cs, Navigation/Member.cs,
- Makefile.am, CBinding.addin.xml, CBinding.mdp: Added support for
- members.
- * Navigation/Function.cs, Navigation/Namespace.cs, Navigation/Class.cs:
- Removed some unused usings.
-
-2007-07-01 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Navigation/Tag.cs, Navigation/Function.cs,
- Navigation/TagDatabaseManager.cs, Navigation/LanguageItem.cs:
- Separated the parse structure from the parser.
-
-2007-07-01 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Navigation/Tag.cs, Navigation/LanguageItem.cs: Optimized memory usage
- by parsing fields as the tags a read in.
-
-2007-06-30 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Navigation/StructureNodeBuilder.cs,
- Navigation/ProjectNodeBuilderExtension.cs,
- Navigation/ClassNodeBuilder.cs, Navigation/Function.cs,
- Navigation/TagDatabaseManager.cs,
- Navigation/ProjectNavigationInformation.cs,
- Navigation/Namespace.cs, Navigation/LanguageItemCommandHandler.cs,
- Navigation/Structure.cs, Navigation/GlobalsNodeBuilder.cs,
- Navigation/LanguageItem.cs, Navigation/FunctionNodeBuilder.cs,
- Navigation/Class.cs, Navigation/NamespaceNodeBuilder.cs,
- Makefile.am, CBinding.addin.xml, CBinding.mdp: Added structures to
- the class pad and refactored the code a bit more.
-
-2007-06-29 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Navigation/Tag.cs, Navigation/TagDatabaseManager.cs,
- Navigation/Namespace.cs,
- Navigation/ProjectNavigationInformation.cs,
- Navigation/ProjectNodeBuilderExtension.cs,
- Navigation/GlobalsNodeBuilder.cs, Navigation/ClassNodeBuilder.cs,
- Navigation/LanguageItem.cs, Navigation/Function.cs,
- Navigation/Class.cs, Navigation/NamespaceNodeBuilder.cs,
- gtk-gui/gui.stetic, Makefile.am, CBinding.addin.xml, CBinding.mdp:
- Added support for classes in the class pad and refactored the code
- a bit.
-
-2007-06-27 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Navigation/Tag.cs: Created a new enum for access modifiers.
- * Navigation/TagDatabaseManager.cs: ctags now also creates tags for
- function prototypes. (needed to identify a function's namespace if
- any).
- * Navigation/Namespace.cs: Changed the separator between parent/child
- namespaces in a namespace's FullName to :: from .
- * Navigation/ProjectNavigationInformation.cs: Added functions field.
- * Navigation/ProjectNodeBuilderExtension.cs: Added the special
- "Globals" node.
- * Navigation/GlobalsNodeBuilder.cs, Navigation/FunctionNodeBuilder.cs,
- Navigation/Function.cs: Added support for functions in the Class
- Pad, global functions that are not in any namespace are placed in a
- special "Globals" node.
- * Navigation/NamespaceNodeBuilder.cs: This namespace's global functions
- are now added.
- * Makefile.am, ProjectPad/ProjectPackagesFolderNodeBuilder.cs,
- ProjectPad/ProjectPackageNodeBuilder.cs,
- ProjectPad/ProjectReferencesExtension.cs,
- ProjectPad/ProjectNodeExtension.cs, CBinding.mdp: Moved to folder
- and namespace ProjectPad
- * CBinding.addin.xml: Added support for functions in the Class Pad,
- global functions are placed in a special "Globals" node.
-
-2007-06-26 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * gtk-gui/CBinding.EditPackagesDialog.cs,
- gtk-gui/CBinding.CodeGenerationPanel.cs, gtk-gui/gui.stetic:
- Improved spacing a bit.
-
-2007-06-26 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Navigation/Tag.cs: Fixed up a bit.
- * Navigation/TagDatabaseManager.cs: The entire tag database for each
- project is managed here.
- * Navigation/Namespace.cs, Navigation/ProjectNodeBuilderExtension.cs,
- Navigation/NamespaceNodeBuilder.cs, CBinding.addin.xml: Namespaces
- now appear in the Class Pad.
- * Navigation/ProjectNavigationInformation.cs,
- Navigation/ProjectNavigationInformationManager.cs: Information on a
- project's navigation information is kept and managed here.
- * Makefile.am, CBinding.mdp: Added new files.
-
-2007-06-25 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Navigation/Tag.cs, Navigation/Namespace.cs,
- Navigation/ProjectNodeBuilderExtension.cs, CBinding.addin.xml:
- Started work on code navigation.
-
-2007-06-25 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Project/CProjectServiceExtension.cs, Project/CProject.cs,
- Makefile.am, CBinding.addin.xml, CBinding.mdp, Completion.cs: Got
- rid of anything related to CTagsCompletion.
-
-2007-06-24 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Project/CProject.cs: Changed to accomodate the new CTagsCompletion
- design
- * Completion.cs: This is where CBinding will specify more specialized
- behavior for the CTagsCompletion AddIn
-
-2007-06-22 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Project/CProject.cs: Made a very simple implementation of
- AddTagsToProvider which is the method where the logic about which
- tags shoud be added to the completion list window takes place.
-
-2007-06-21 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Gui/EditPackagesDialog.cs: Added a package icon to both packages
- columns.
- * Project/CProjectBinding.cs, Project/CProject.cs: Implemented
- CreateSingleFileProject
-
-2007-06-20 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Gui/OutputOptionsPanel.cs, Project/CProject.cs,
- gtk-gui/CBinding.EditPackagesDialog.cs,
- gtk-gui/CBinding.CodeGenerationPanel.cs, Compiler/GNUCompiler.cs:
- Fixed a few bugs.
-
-2007-06-19 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Project/CProject.cs: Fixed bug where only projects that had a binary
- target got correctly cleaned.
-
-2007-06-19 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Gui/ProjectPackagesFolderNodeBuilder.cs: Changed the package
- added/removed handlers to just call UpdateAll from the builder.
-
-2007-06-19 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Gui/ProjectPackagesFolderNodeBuilder.cs: Changed the node builder so
- that it registeres even handlers correctly
- * Project/ProjectPackageCollection.cs, Project/CProject.cs: Removed the
- SetProject method and replaced it with and internal get/set
- property.
-
-2007-06-19 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Project/CProject.cs: CProject does want it's tags written.
-
-2007-06-18 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Project/CProjectServiceExtension.cs, Project/CProject.cs: Changed to
- accomodate the new CTagsCompletion design.
-
-2007-06-17 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Compiler/GNUCompiler.cs: Added debug information creation for the
- Debug configuration and fixed bug where the target output was not
- buing built when it should be.
-
-2007-06-17 Marcos David Marin Amador <MarcosMarin@gmail.com>
-
- * Gui/CodeGenerationPanel.cs, Project/CCompilationParameters.cs,
- Project/CProject.cs, Compiler/GNUCompiler.cs: The extra compiler
- and extra linker options is now shown is an TextView in the code
- generation panel and I added define symbols support.
-
diff --git a/main/src/addins/CBinding/Compiler/CCompiler.cs b/main/src/addins/CBinding/Compiler/CCompiler.cs
deleted file mode 100644
index b5c99430d1..0000000000
--- a/main/src/addins/CBinding/Compiler/CCompiler.cs
+++ /dev/null
@@ -1,137 +0,0 @@
-//
-// CCompiler.cs: asbtract class that provides some basic implementation for ICompiler
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Text;
-using System.CodeDom.Compiler;
-
-using MonoDevelop.Core;
-using MonoDevelop.Core.Execution;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide;
-
-namespace CBinding
-{
- public abstract class CCompiler : ICompiler
- {
- protected string compilerCommand;
- protected string linkerCommand;
-
- public abstract string Name {
- get;
- }
-
- public abstract Language Language {
- get;
- }
-
- public string CompilerCommand {
- get { return compilerCommand; }
- }
-
- public abstract bool SupportsCcache {
- get;
- }
-
- public abstract bool SupportsPrecompiledHeaders {
- get;
- }
-
- public abstract string GetCompilerFlags (Project project, CProjectConfiguration configuration);
-
- public abstract string GetDefineFlags (Project project, CProjectConfiguration configuration);
-
- public abstract BuildResult Compile (
- Project project,
- ProjectFileCollection projectFiles,
- ProjectPackageCollection packages,
- CProjectConfiguration configuration,
- IProgressMonitor monitor);
-
- public abstract void Clean (ProjectFileCollection projectFiles, CProjectConfiguration configuration, IProgressMonitor monitor);
-
- protected abstract void ParseCompilerOutput (string errorString, CompilerResults cr);
-
- protected abstract void ParseLinkerOutput (string errorString, CompilerResults cr);
-
- protected string GeneratePkgLinkerArgs (ProjectPackageCollection packages)
- {
- return GeneratePkgConfigArgs (packages, "--libs");
- }
-
- protected string GeneratePkgCompilerArgs (ProjectPackageCollection packages)
- {
- return GeneratePkgConfigArgs (packages, "--cflags");
- }
-
- protected static string GeneratePkgConfigArgs (ProjectPackageCollection packages, string pkgConfigArg)
- {
- if (packages == null || packages.Count < 1)
- return string.Empty;
- string originalPkgConfigPath = Environment.GetEnvironmentVariable ("PKG_CONFIG_PATH");
- string pkgConfigPath = originalPkgConfigPath;
-
- StringBuilder libs = new StringBuilder ();
-
- foreach (Package p in packages) {
- if (Path.IsPathRooted (p.File)) {
- pkgConfigPath = string.Format ("{0}{1}{2}", pkgConfigPath, Path.PathSeparator, Path.GetDirectoryName (p.File));
- libs.Append (Path.GetFileNameWithoutExtension (p.File) + " ");
- } else {
- libs.Append (p.File + " ");
- }
- }
-
- string args = string.Format ("{0} \"{1}\"", pkgConfigArg, libs.ToString ().Trim ());
-
- StringWriter output = new StringWriter ();
- ProcessWrapper proc = new ProcessWrapper ();
-
- try {
- Environment.SetEnvironmentVariable ("PKG_CONFIG_PATH", pkgConfigPath);
- proc = Runtime.ProcessService.StartProcess ("pkg-config", args, null, null);
- proc.WaitForExit ();
-
- string line;
- while ((line = proc.StandardOutput.ReadLine ()) != null)
- output.WriteLine (line);
- } catch (Exception ex) {
- MessageService.ShowError ("You need to have pkg-config installed");
- } finally {
- proc.Close ();
- Environment.SetEnvironmentVariable ("PKG_CONFIG_PATH", originalPkgConfigPath);
- }
-
- return output.ToString ();
- }
- }
-}
diff --git a/main/src/addins/CBinding/Compiler/GNUCompiler.cs b/main/src/addins/CBinding/Compiler/GNUCompiler.cs
deleted file mode 100644
index b75471a9ff..0000000000
--- a/main/src/addins/CBinding/Compiler/GNUCompiler.cs
+++ /dev/null
@@ -1,799 +0,0 @@
-//
-// GNUCompiler.cs: Provides most functionality to compile using a GNU compiler (gcc and g++)
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-// Mitchell Wheeler <mitchell.wheeler@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.CodeDom.Compiler;
-
-using MonoDevelop.Core;
-using MonoDevelop.Core.Execution;
-using MonoDevelop.Core.ProgressMonitoring;
-using MonoDevelop.Projects;
-
-namespace CBinding
-{
- public abstract class GNUCompiler : CCompiler
- {
- bool appsChecked;
- bool compilerFound;
- bool linkerFound;
-
- public override BuildResult Compile (
- Project project,
- ProjectFileCollection projectFiles,
- ProjectPackageCollection packages,
- CProjectConfiguration configuration,
- IProgressMonitor monitor)
- {
- if (!appsChecked) {
- appsChecked = true;
- compilerFound = CheckApp (compilerCommand);
- linkerFound = CheckApp (linkerCommand);
- }
-
- if (!compilerFound) {
- BuildResult cres = new BuildResult ();
- cres.AddError ("Compiler not found: " + compilerCommand);
- return cres;
- }
-
- if (!linkerFound) {
- BuildResult cres = new BuildResult ();
- cres.AddError ("Linker not found: " + linkerCommand);
- return cres;
- }
-
- CompilerResults cr = new CompilerResults (new TempFileCollection ());
- bool success = true;
- string compilerArgs = GetCompilerFlags (project, configuration) + " " + GeneratePkgCompilerArgs (packages);
-
- string outputName = Path.Combine (configuration.OutputDirectory,
- configuration.CompiledOutputName);
-
- // Precompile header files and place them in prec/<config_name>/
- if (configuration.PrecompileHeaders) {
- string precDir = Path.Combine (configuration.IntermediateOutputDirectory, "prec");
- string precConfigDir = Path.Combine (precDir, configuration.Id);
- if (!Directory.Exists (precDir))
- Directory.CreateDirectory (precDir);
- if (!Directory.Exists (precConfigDir))
- Directory.CreateDirectory (precConfigDir);
-
- if (!PrecompileHeaders (projectFiles, configuration, compilerArgs, monitor, cr))
- success = false;
- } else {
- //old headers could interfere with the build
- CleanPrecompiledHeaders (configuration);
- }
-
- //compile source to object files
- monitor.BeginTask (GettextCatalog.GetString ("Compiling source to object files"), 1);
- foreach (ProjectFile f in projectFiles) {
- if (!success) break;
- if (f.Subtype == Subtype.Directory || f.BuildAction != BuildAction.Compile || CProject.IsHeaderFile (f.FilePath))
- continue;
-
- if (configuration.UseCcache || NeedsCompiling (f, configuration))
- success = DoCompilation (f, configuration, compilerArgs, monitor, cr, configuration.UseCcache);
- }
- if (success)
- monitor.Step (1);
- monitor.EndTask ();
-
- if (success) {
- switch (configuration.CompileTarget)
- {
- case CBinding.CompileTarget.Bin:
- MakeBin (project, projectFiles, configuration, packages, cr, monitor, outputName);
- break;
- case CBinding.CompileTarget.StaticLibrary:
- MakeStaticLibrary (project, projectFiles, configuration, packages, cr, monitor, outputName);
- break;
- case CBinding.CompileTarget.SharedLibrary:
- MakeSharedLibrary (project, projectFiles, configuration, packages, cr, monitor, outputName);
- break;
- }
- }
-
- return new BuildResult (cr, "");
- }
-
- public override bool SupportsCcache {
- get { return true; }
- }
-
- public override bool SupportsPrecompiledHeaders {
- get { return true; }
- }
-
- Dictionary<string, string> GetStringTags (Project project)
- {
- Dictionary<string, string> result = new Dictionary<string, string> (StringComparer.InvariantCultureIgnoreCase);
- result["PROJECTDIR"] = project.BaseDirectory;
- result["PROJECTFILENAME"] = project.FileName;
- return result;
- }
-
- public override string GetCompilerFlags (Project project, CProjectConfiguration configuration)
- {
- StringBuilder args = new StringBuilder ();
-
- if (configuration.DebugMode)
- args.Append ("-g ");
-
- if (configuration.CompileTarget == CBinding.CompileTarget.SharedLibrary)
- args.Append ("-fPIC ");
-
- switch (configuration.WarningLevel)
- {
- case WarningLevel.None:
- args.Append ("-w ");
- break;
- case WarningLevel.Normal:
- // nothing
- break;
- case WarningLevel.All:
- args.Append ("-Wall ");
- break;
- }
-
- if (configuration.WarningsAsErrors)
- args.Append ("-Werror ");
-
- args.Append ("-O" + configuration.OptimizationLevel + " ");
-
- if (configuration.ExtraCompilerArguments != null && configuration.ExtraCompilerArguments.Length > 0) {
- string extraCompilerArgs = ExpandBacktickedParameters(configuration.ExtraCompilerArguments.Replace ('\n', ' '));
- args.Append (extraCompilerArgs + " ");
- }
-
- if (configuration.DefineSymbols != null && configuration.DefineSymbols.Length > 0)
- args.Append (ProcessDefineSymbols (configuration.DefineSymbols) + " ");
-
- if (configuration.Includes != null)
- foreach (string inc in configuration.Includes)
- args.Append ("-I\"" + StringParserService.Parse (inc, GetStringTags (project)) + "\" ");
-
- if (configuration.PrecompileHeaders) {
- string precdir = Path.Combine (configuration.IntermediateOutputDirectory, "prec");
- precdir = Path.Combine (precdir, configuration.Id);
- args.Append ("-I\"" + precdir + "\"");
- }
-
- return args.ToString ();
- }
-
- public override string GetDefineFlags (Project project, CProjectConfiguration configuration)
- {
- return ProcessDefineSymbols (configuration.DefineSymbols);
- }
-
- private bool NeedsCompiling (ProjectFile file, CProjectConfiguration configuration)
- {
- string objectFile = Path.Combine(configuration.OutputDirectory, Path.GetFileName(file.Name));
- objectFile = Path.ChangeExtension(objectFile, ".o");
- if (!File.Exists (objectFile))
- return true;
-
- string[] dependedOnFiles = DependedOnFiles (file, configuration);
- if (dependedOnFiles == null) {
- return true;
- }
-
- DateTime lastObjectTime = File.GetLastWriteTime (objectFile);
-
- try {
- foreach (string depfile in dependedOnFiles) {
- if (File.GetLastWriteTime (depfile) > lastObjectTime) {
- return true;
- }
- }
- } catch (IOException e) {
- // This means the dependency file is telling us our source file
- // depends on a file that no longer exists, all this means is that
- // the dependency file is outdated. We should just ignore this
- // since the dependency file will be automatically updated when
- // the source file is compiled.
- e.ToString (); // suppress warning.
- }
-
- return false;
- }
-
- /// <summary>
- /// Returns an array of depended on files or null if the
- /// file containing the depended on files (.d) does does not exist.
- /// </summary>
- private string[] DependedOnFiles (ProjectFile file, CProjectConfiguration configuration)
- {
- List<string> dependencies = new List<string> ();
- string dependenciesFile = Path.Combine(configuration.OutputDirectory, Path.GetFileName(file.Name));
- dependenciesFile = Path.ChangeExtension(dependenciesFile, ".d");
-
- if (!File.Exists (dependenciesFile))
- return null;
-
- // It always depends on itself ;)
- dependencies.Add (file.Name);
-
- string temp;
- using (StreamReader reader = new StreamReader (dependenciesFile)) {
- while ((temp = reader.ReadLine ()) != null) {
- // TODO: We really should be using a regex here,
- // this will have issues with pathnames containing double spaces.
- string depfile = temp.Replace(" \\", String.Empty).Trim();
-
- // Ignore empty strings & object files...
- if(String.IsNullOrEmpty(depfile) ||
- depfile.EndsWith(".o:") || depfile.EndsWith(".o"))
- continue;
-
- dependencies.Add(depfile.Replace(@"\ ", " "));
- }
- }
-
- return dependencies.ToArray();
- }
-
- private bool PrecompileHeaders (ProjectFileCollection projectFiles,
- CProjectConfiguration configuration,
- string args,
- IProgressMonitor monitor,
- CompilerResults cr)
- {
- monitor.BeginTask (GettextCatalog.GetString ("Precompiling headers"), 1);
- bool success = true;
-
- foreach (ProjectFile file in projectFiles) {
- if (file.Subtype == Subtype.Code && CProject.IsHeaderFile (file.Name)) {
- string precomp = Path.Combine (configuration.IntermediateOutputDirectory, "prec");
- precomp = Path.Combine (precomp, configuration.Id);
- precomp = Path.Combine (precomp, Path.GetFileName (file.Name) + ".ghc");
- if (file.BuildAction == BuildAction.Compile) {
- if (!File.Exists (precomp) || configuration.UseCcache || File.GetLastWriteTime (file.Name) > File.GetLastWriteTime (precomp)) {
- if (DoPrecompileHeader (file, precomp, args, monitor, cr) == false) {
- success = false;
- break;
- }
- }
- } else {
- //remove old files or they'll interfere with the build
- if (File.Exists (precomp))
- File.Delete (precomp);
- }
- }
-
- }
- if (success)
- monitor.Step (1);
- monitor.EndTask ();
- return success;
- }
-
- private bool DoPrecompileHeader (ProjectFile file, string output, string args, IProgressMonitor monitor, CompilerResults cr)
- {
- string completeArgs = String.Format ("\"{0}\" {1} -o {2}", file.Name, args, output);
- string errorOutput;
- int exitCode = ExecuteCommand (compilerCommand, completeArgs, Path.GetDirectoryName (output), monitor, out errorOutput);
- ParseCompilerOutput (errorOutput, cr);
- return (exitCode == 0);
- }
-
- static readonly string[] libraryExtensions = { ".so", ".a", ".dll", ".dylib" };
- /// <summary>
- /// Checks whether a library can be linked with -lbasename
- /// </summary>
- /// <remarks>
- /// This should return true iff directory is empty or in
- /// the configured library paths, and library is of the form blah
- /// or libblah.(a|so|dll|dylib),
- /// </remarks>
- internal bool IsStandardLibrary(CProjectConfiguration configuration,
- string directory, string library,
- ref string std_lib)
- {
- std_lib = library;
-
- if(!(String.IsNullOrEmpty(directory) ||
- configuration.LibPaths.Contains(directory)))
- return false;
-
- string libraryExtension = Path.GetExtension (library);
-
- foreach (string extension in libraryExtensions)
- {
- if (libraryExtension.Equals (extension, StringComparison.OrdinalIgnoreCase)) {
- if (library.StartsWith("lib", StringComparison.OrdinalIgnoreCase)) {
- std_lib = std_lib.Substring(3);
- return true;
- } else {
- return false;
- }
- }
- }
-
- return true;
- }
-
- private void MakeBin (Project project,
- ProjectFileCollection projectFiles,
- CProjectConfiguration configuration,
- ProjectPackageCollection packages,
- CompilerResults cr,
- IProgressMonitor monitor, string outputName)
- {
- if (!NeedsUpdate (projectFiles, configuration, outputName)) return;
-
- string objectFiles = string.Join (" ", ObjectFiles (projectFiles, configuration, true));
- string pkgargs = GeneratePkgLinkerArgs (packages);
- StringBuilder args = new StringBuilder ();
-
- if (configuration.ExtraLinkerArguments != null && configuration.ExtraLinkerArguments.Length > 0) {
- string extraLinkerArgs = ExpandBacktickedParameters(configuration.ExtraLinkerArguments.Replace ('\n', ' '));
- args.Append (extraLinkerArgs + " ");
- }
-
- if (configuration.LibPaths != null)
- foreach (string libpath in configuration.LibPaths)
- args.Append ("-L\"" + StringParserService.Parse (libpath, GetStringTags (project)) + "\" ");
-
- if (configuration.Libs != null) {
- foreach (string lib in configuration.Libs) {
- string directory = Path.GetDirectoryName(lib);
- string library = Path.GetFileName(lib);
-
- // Is this a 'standard' (as in, uses an orthodox naming convention) library..?
- string link_lib = String.Empty;
- if(IsStandardLibrary(configuration, directory, library, ref link_lib))
- args.Append ("-l\"" + link_lib + "\" ");
- // If not, reference the library by it's full pathname.
- else
- args.Append ("\"" + lib + "\" ");
- }
- }
-
- string linker_args = string.Format ("-o \"{0}\" {1} {2} {3}",
- outputName, objectFiles, pkgargs, args.ToString ());
-
- monitor.BeginTask (GettextCatalog.GetString ("Generating binary \"{0}\" from object files", Path.GetFileName (outputName)), 1);
-
- string errorOutput;
- int exitCode = ExecuteCommand (linkerCommand, linker_args, Path.GetDirectoryName (outputName), monitor, out errorOutput);
- if (exitCode == 0)
- monitor.Step (1);
- monitor.EndTask ();
-
- ParseCompilerOutput (errorOutput, cr);
- ParseLinkerOutput (errorOutput, cr);
- CheckReturnCode (exitCode, cr);
- }
-
- private void MakeStaticLibrary (Project project,
- ProjectFileCollection projectFiles,
- CProjectConfiguration configuration,
- ProjectPackageCollection packages,
- CompilerResults cr,
- IProgressMonitor monitor, string outputName)
- {
- if (!NeedsUpdate (projectFiles, configuration, outputName)) return;
-
- string objectFiles = string.Join (" ", ObjectFiles (projectFiles, configuration, true));
- string args = string.Format ("rcs \"{0}\" {1}", outputName, objectFiles);
-
- monitor.BeginTask (GettextCatalog.GetString ("Generating static library {0} from object files", Path.GetFileName (outputName)), 1);
-
- string errorOutput;
- int exitCode = ExecuteCommand ("ar", args, Path.GetDirectoryName (outputName), monitor, out errorOutput);
- if (exitCode == 0)
- monitor.Step (1);
- monitor.EndTask ();
-
- ParseCompilerOutput (errorOutput, cr);
- ParseLinkerOutput (errorOutput, cr);
- CheckReturnCode (exitCode, cr);
- }
-
- private void MakeSharedLibrary(Project project,
- ProjectFileCollection projectFiles,
- CProjectConfiguration configuration,
- ProjectPackageCollection packages,
- CompilerResults cr,
- IProgressMonitor monitor, string outputName)
- {
- if (!NeedsUpdate (projectFiles, configuration, outputName)) return;
-
- string objectFiles = string.Join (" ", ObjectFiles (projectFiles, configuration, true));
- string pkgargs = GeneratePkgLinkerArgs (packages);
- StringBuilder args = new StringBuilder ();
-
- if (configuration.ExtraLinkerArguments != null && configuration.ExtraLinkerArguments.Length > 0) {
- string extraLinkerArgs = ExpandBacktickedParameters(configuration.ExtraLinkerArguments.Replace ('\n', ' '));
- args.Append (extraLinkerArgs + " ");
- }
-
- if (configuration.LibPaths != null)
- foreach (string libpath in configuration.LibPaths)
- args.Append ("-L\"" + StringParserService.Parse (libpath, GetStringTags (project)) + "\" ");
-
- if (configuration.Libs != null) {
- foreach (string lib in configuration.Libs) {
- string directory = Path.GetDirectoryName(lib);
- string library = Path.GetFileName(lib);
-
- // Is this a 'standard' (as in, uses an orthodox naming convention) library..?
- string link_lib = String.Empty;
- if(IsStandardLibrary(configuration, directory, library, ref link_lib))
- args.Append ("-l\"" + link_lib + "\" ");
- // If not, reference the library by it's full pathname.
- else
- args.Append ("\"" + lib + "\" ");
- }
- }
-
- string linker_args = string.Format ("-shared -o \"{0}\" {1} {2} {3}",
- outputName, objectFiles, pkgargs, args.ToString ());
-
- monitor.BeginTask (GettextCatalog.GetString ("Generating shared object \"{0}\" from object files", Path.GetFileName (outputName)), 1);
-
- string errorOutput;
- int exitCode = ExecuteCommand (linkerCommand , linker_args, Path.GetDirectoryName (outputName), monitor, out errorOutput);
- if (exitCode == 0)
- monitor.Step (1);
- monitor.EndTask ();
-
- ParseCompilerOutput (errorOutput, cr);
- ParseLinkerOutput (errorOutput, cr);
- CheckReturnCode (exitCode, cr);
- }
-
- int ExecuteCommand (string command, string args, string baseDirectory, IProgressMonitor monitor, out string errorOutput)
- {
- errorOutput = string.Empty;
- int exitCode = -1;
-
- using (var swError = new StringWriter ()) {
- using (var chainedError = new LogTextWriter ()) {
- chainedError.ChainWriter (monitor.Log);
- chainedError.ChainWriter (swError);
-
- monitor.Log.WriteLine ("{0} {1}", command, args);
-
- using (var operationMonitor = new AggregatedOperationMonitor (monitor)) {
- using (ProcessWrapper p = Runtime.ProcessService.StartProcess (command, args, baseDirectory, monitor.Log, chainedError, null)) {
- operationMonitor.AddOperation (p); //handles cancellation
-
- p.WaitForOutput ();
- chainedError.UnchainWriter (monitor.Log);
- chainedError.UnchainWriter (swError);
-
- errorOutput = swError.ToString ();
- exitCode = p.ExitCode;
-
- if (monitor.IsCancelRequested) {
- monitor.Log.WriteLine (GettextCatalog.GetString ("Build cancelled"));
- monitor.ReportError (GettextCatalog.GetString ("Build cancelled"), null);
- if (exitCode == 0)
- exitCode = -1;
- }
- }
- }
- }
- }
-
- return exitCode;
- }
-
- private string ProcessDefineSymbols (string symbols)
- {
- StringBuilder processed = new StringBuilder (symbols);
-
- // Take care of multi adyacent spaces
- for (int i = 0; i < processed.Length; i++) {
- if (i + 1 < processed.Length &&
- processed[i] == ' ' &&
- processed[i + 1] == ' ') {
- processed.Remove (i--, 1);
- }
- }
-
- return processed.ToString ()
- .Trim ()
- .Replace (" ", " -D")
- .Insert (0, "-D");
- }
-
- /// <summary>
- /// Compiles a single source file into object code
- /// and creates a file with it's dependencies.
- /// </summary>
- private bool DoCompilation (ProjectFile file,
- CProjectConfiguration configuration,
- string args,
- IProgressMonitor monitor,
- CompilerResults cr,
- bool use_ccache)
- {
-
- string outputName = Path.Combine(configuration.OutputDirectory, Path.GetFileName(Path.ChangeExtension (file.Name, ".o")));
-
- string compiler_args = string.Format ("{0} -MMD \"{1}\" {2} -c -o \"{3}\"",
- (use_ccache ? compilerCommand : string.Empty), file.Name, args, outputName);
-
- string errorOutput;
- int exitCode = ExecuteCommand ((use_ccache ? "ccache" : compilerCommand), compiler_args, configuration.OutputDirectory, monitor, out errorOutput);
-
- ParseCompilerOutput (errorOutput, cr);
- CheckReturnCode (exitCode, cr);
- return exitCode == 0;
- }
-
- /// <summary>
- /// Gets the files that get compiled into object code.
- /// </summary>
- /// <param name="projectFiles">
- /// A <see cref="ProjectFileCollection"/>
- /// The project's files, extracts from here the files that get compiled into object code.
- /// </param>
- /// <param name="configuration">
- /// A <see cref="CProjectConfiguration"/>
- /// The configuration to get the object files for...
- /// </param>
- /// <param name="withQuotes">
- /// A <see cref="System.Boolean"/>
- /// If true, it will surround each object file with quotes
- /// so that gcc has no problem with paths that contain spaces.
- /// </param>
- /// <returns>
- /// An array of strings, each string is the name of a file
- /// that will get compiled into object code. The file name
- /// will already have the .o extension.
- /// </returns>
- private string[] ObjectFiles (ProjectFileCollection projectFiles, CProjectConfiguration configuration, bool withQuotes)
- {
- if(projectFiles.Count == 0)
- return new string[] {};
-
- List<string> objectFiles = new List<string> ();
-
- foreach (ProjectFile f in projectFiles) {
- if (f.BuildAction == BuildAction.Compile) {
- string PathName = Path.Combine(configuration.OutputDirectory, Path.GetFileNameWithoutExtension(f.Name) + ".o");
-
- if(File.Exists(PathName) == false)
- continue;
-
- if (!withQuotes)
- objectFiles.Add (PathName);
- else
- objectFiles.Add ("\"" + PathName + "\"");
- }
- }
-
- return objectFiles.ToArray ();
- }
-
- public override void Clean (ProjectFileCollection projectFiles, CProjectConfiguration configuration, IProgressMonitor monitor)
- {
- //clean up object files
- foreach (string oFile in ObjectFiles(projectFiles, configuration, false)) {
- if (File.Exists (oFile))
- File.Delete (oFile);
-
- string dFile = Path.ChangeExtension (oFile, ".d");
- if (File.Exists (dFile))
- File.Delete (dFile);
- }
-
- CleanPrecompiledHeaders (configuration);
- }
-
- void CleanPrecompiledHeaders (CProjectConfiguration configuration)
- {
- if (string.IsNullOrEmpty (configuration.IntermediateOutputDirectory))
- return;
-
- string precDir = Path.Combine (configuration.IntermediateOutputDirectory, "prec");
-
- if (Directory.Exists (precDir))
- Directory.Delete (precDir, true);
- }
-
- private bool NeedsUpdate (ProjectFileCollection projectFiles, CProjectConfiguration configuration, string target)
- {
- if (!File.Exists (target))
- return true;
-
- foreach (string obj in ObjectFiles (projectFiles, configuration, false))
- if (File.GetLastWriteTime (obj) > File.GetLastWriteTime (target))
- return true;
-
- return false;
- }
-
- protected override void ParseCompilerOutput (string errorString, CompilerResults cr)
- {
- TextReader reader = new StringReader (errorString);
- string next;
-
- while ((next = reader.ReadLine ()) != null) {
- CompilerError error = CreateErrorFromErrorString (next, reader);
- if (error != null)
- cr.Errors.Add (error);
- }
-
- reader.Close ();
- }
-
- private static Regex withColRegex = new Regex (
- @"^\s*(?<file>.*):(?<line>\d*):(?<column>\d*):\s*(?<level>.*)\s*:\s(?<message>.*)",
- RegexOptions.Compiled | RegexOptions.ExplicitCapture);
- private static Regex noColRegex = new Regex (
- @"^\s*(?<file>.*):(?<line>\d*):\s*(?<level>.*)\s*:\s(?<message>.*)",
- RegexOptions.Compiled | RegexOptions.ExplicitCapture);
- private static Regex linkerRegex = new Regex (
- @"^\s*(?<file>[^:]*):(?<line>\d*):\s*(?<message>.*)",
- RegexOptions.Compiled | RegexOptions.ExplicitCapture);
-
- private CompilerError CreateErrorFromErrorString (string errorString, TextReader reader)
- {
- CompilerError error = new CompilerError ();
- string warning = GettextCatalog.GetString ("warning");
- string note = GettextCatalog.GetString ("note");
-
- Match match = withColRegex.Match (errorString);
-
- if (match.Success)
- {
- error.FileName = match.Groups["file"].Value;
- error.Line = int.Parse (match.Groups["line"].Value);
- error.Column = int.Parse (match.Groups["column"].Value);
- error.IsWarning = (match.Groups["level"].Value.Equals (warning, StringComparison.Ordinal) ||
- match.Groups["level"].Value.Equals (note, StringComparison.Ordinal));
- error.ErrorText = match.Groups["message"].Value;
-
- return error;
- }
-
- match = noColRegex.Match (errorString);
-
- if (match.Success)
- {
- error.FileName = match.Groups["file"].Value;
- error.Line = int.Parse (match.Groups["line"].Value);
- error.IsWarning = (match.Groups["level"].Value.Equals (warning, StringComparison.Ordinal) ||
- match.Groups["level"].Value.Equals (note, StringComparison.Ordinal));
- error.ErrorText = match.Groups["message"].Value;
-
- // Skip messages that begin with ( and end with ), since they're generic.
- //Attempt to capture multi-line versions too.
- if (error.ErrorText.StartsWith ("(")) {
- string error_continued = error.ErrorText;
- do {
- if (error_continued.EndsWith (")"))
- return null;
- } while ((error_continued = reader.ReadLine ()) != null);
- }
-
- return error;
- }
-
- return null;
- }
-
- protected override void ParseLinkerOutput (string errorString, CompilerResults cr)
- {
- TextReader reader = new StringReader (errorString);
- string next;
-
- while ((next = reader.ReadLine ()) != null) {
- CompilerError error = CreateLinkerErrorFromErrorString (next);
- if (error != null)
- cr.Errors.Insert (0, error);
- }
-
- reader.Close ();
- }
-
- private CompilerError CreateLinkerErrorFromErrorString (string errorString)
- {
- CompilerError error = new CompilerError ();
-
- Match linkerMatch = linkerRegex.Match (errorString);
-
- if (linkerMatch.Success)
- {
- error.FileName = linkerMatch.Groups["file"].Value;
- error.Line = int.Parse (linkerMatch.Groups["line"].Value);
- error.ErrorText = linkerMatch.Groups["message"].Value;
-
- return error;
- }
-
- return null;
- }
-
- // expands backticked portions of the parameter-list using "sh" and "echo"
- // TODO: Do this ourselves, relying on sh/echo - and launching an entire process just for this is ... excessive.
- public string ExpandBacktickedParameters (string tmp)
- {
- // 1) Quadruple \ required, to escape both echo's and sh's escape character filtering
- // 2) \\\" required inside of echo, to translate into \" in sh, so it translates back as a " to MD...
- string parameters = "-c \"echo " + tmp.Replace("\\", "\\\\\\\\").Replace("\"", "\\\\\\\"") + "\"";
-
- var p = Process.Start (new ProcessStartInfo ("sh", parameters) {
- UseShellExecute = false,
- RedirectStandardOutput = true
- });
- p.Start ();
- p.WaitForExit ();
-
- //TODO: use async reads so we don't deadlock if stdout fills up
- //TODO: check return code
- return p.StandardOutput.ReadToEnd ().Trim ();
- }
-
- bool CheckApp (string app)
- {
- try {
- ProcessWrapper p = Runtime.ProcessService.StartProcess (app, "--version", null, null);
- p.WaitForOutput ();
- return true;
- } catch {
- return false;
- }
- }
-
- /// <summary>
- /// Checks a compilation return code,
- /// and adds an error result if the compiler results
- /// show no errors.
- /// </summary>
- /// <param name="returnCode">
- /// A <see cref="System.Int32"/>: A process return code
- /// </param>
- /// <param name="cr">
- /// A <see cref="CompilerResults"/>: The return code from a compilation run
- /// </param>
- void CheckReturnCode (int returnCode, CompilerResults cr)
- {
- cr.NativeCompilerReturnValue = returnCode;
- if (0 != returnCode && 0 == cr.Errors.Count) {
- cr.Errors.Add (new CompilerError (string.Empty, 0, 0, string.Empty,
- GettextCatalog.GetString ("Build failed - check build output for details")));
- }
- }
- }
-}
diff --git a/main/src/addins/CBinding/Compiler/GccCompiler.cs b/main/src/addins/CBinding/Compiler/GccCompiler.cs
deleted file mode 100644
index fb9fb40a81..0000000000
--- a/main/src/addins/CBinding/Compiler/GccCompiler.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// GccCompiler.cs: Provides functionality to compile using gcc
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using Mono.Addins;
-
-
-namespace CBinding
-{
- [Extension ("/CBinding/Compilers")]
- public class GccCompiler : GNUCompiler
- {
- public override string Name {
- get { return "gcc"; }
- }
-
- public override Language Language {
- get { return Language.C; }
- }
-
- public GccCompiler ()
- {
- compilerCommand = "gcc";
- linkerCommand = "gcc";
- }
- }
-}
diff --git a/main/src/addins/CBinding/Compiler/GppCompiler.cs b/main/src/addins/CBinding/Compiler/GppCompiler.cs
deleted file mode 100644
index cdaa66cecb..0000000000
--- a/main/src/addins/CBinding/Compiler/GppCompiler.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// GppCompiler.cs: Provides functionality to compile using g++
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using Mono.Addins;
-
-
-namespace CBinding
-{
- [Extension ("/CBinding/Compilers")]
- public class GppCompiler : GNUCompiler
- {
- public override string Name {
- get { return "g++"; }
- }
-
- public override Language Language {
- get { return Language.CPP; }
- }
-
- public GppCompiler ()
- {
- compilerCommand = "g++";
- linkerCommand = "g++";
- }
- }
-}
diff --git a/main/src/addins/CBinding/Compiler/ICompiler.cs b/main/src/addins/CBinding/Compiler/ICompiler.cs
deleted file mode 100644
index edb2b80c96..0000000000
--- a/main/src/addins/CBinding/Compiler/ICompiler.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// ICompiler.cs: interface that must be implemented by any class that wants
-// to provide a compiler for the CBinding addin.
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using Mono.Addins;
-
-using MonoDevelop.Core;
-using MonoDevelop.Projects;
-
-namespace CBinding
-{
- [TypeExtensionPoint ("/CBinding/Compilers")]
- public interface ICompiler
- {
- string Name {
- get;
- }
-
- Language Language {
- get;
- }
-
- string CompilerCommand {
- get;
- }
-
- bool SupportsCcache {
- get;
- }
-
- bool SupportsPrecompiledHeaders {
- get;
- }
-
- string GetCompilerFlags (Project project, CProjectConfiguration configuration);
-
- string GetDefineFlags (Project project, CProjectConfiguration configuration);
-
- BuildResult Compile (
- Project project,
- ProjectFileCollection projectFiles,
- ProjectPackageCollection packages,
- CProjectConfiguration configuration,
- IProgressMonitor monitor);
-
- void Clean (ProjectFileCollection projectFiles, CProjectConfiguration configuration, IProgressMonitor monitor);
- }
-}
diff --git a/main/src/addins/CBinding/CppLanguageBinding.cs b/main/src/addins/CBinding/CppLanguageBinding.cs
deleted file mode 100644
index 3054db393c..0000000000
--- a/main/src/addins/CBinding/CppLanguageBinding.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// CppLanguageBinding.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marín Amador
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.IO;
-
-using Mono.Addins;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Core;
-
-namespace CBinding
-{
- public class CppLanguageBinding : ILanguageBinding
- {
- public string Language {
- get { return "CPP"; }
- }
-
- public string SingleLineCommentTag { get { return "//"; } }
- public string BlockCommentStartTag { get { return "/*"; } }
- public string BlockCommentEndTag { get { return "*/"; } }
-
- public bool IsSourceCodeFile (FilePath fileName)
- {
- return fileName.ToString ().EndsWith (".cpp", StringComparison.OrdinalIgnoreCase);
- }
-
- public FilePath GetFileName (FilePath baseName)
- {
- return baseName + ".cpp";
- }
- }
-}
diff --git a/main/src/addins/CBinding/Gui/CTextEditorExtension.cs b/main/src/addins/CBinding/Gui/CTextEditorExtension.cs
deleted file mode 100755
index 690baf3ea6..0000000000
--- a/main/src/addins/CBinding/Gui/CTextEditorExtension.cs
+++ /dev/null
@@ -1,793 +0,0 @@
-//
-// CTextEditorExtension.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Text;
-using System.Linq;
-using System.Collections.Generic;
-
-using MonoDevelop.Core;
-using MonoDevelop.Ide;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Content;
-using MonoDevelop.Ide.CodeCompletion;
-using MonoDevelop.Components;
-using MonoDevelop.Components.Commands;
-
-using CBinding.Parser;
-using Mono.TextEditor;
-using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.Completion;
-
-namespace CBinding
-{
- public class CTextEditorExtension : CompletionTextEditorExtension, IPathedDocument
- {
- // Allowed chars to be next to an identifier
- private static char[] allowedChars = new char[] {
- '.', ':', ' ', '\t', '=', '*', '+', '-', '/', '%', ',', '&',
- '|', '^', '{', '}', '[', ']', '(', ')', '\n', '!', '?', '<', '>'
- };
-
- // Allowed Chars to be next to an identifier excluding ':' (to get the full name in '::' completion).
- private static char[] allowedCharsMinusColon = new char[] {
- '.', ' ', '\t', '=', '*', '+', '-', '/', '%', ',', '&', '|',
- '^', '{', '}', '[', ']', '(', ')', '\n', '!', '?', '<', '>'
- };
-
- /// <summary>
- /// A delegate for getting completion data
- /// </summary>
- private delegate CompletionDataList GetMembersForExtension (CTextEditorExtension self, string completionExtension, string completionText);
-
- /// <summary>
- /// An associative array containing each completion-triggering extension
- /// and its respective callback
- /// </summary>
- private static KeyValuePair<string, GetMembersForExtension>[] completionExtensions = new KeyValuePair<string, GetMembersForExtension>[] {
- new KeyValuePair<string, GetMembersForExtension>("::", GetItemMembers),
- new KeyValuePair<string, GetMembersForExtension>("->", GetInstanceMembers),
- new KeyValuePair<string, GetMembersForExtension>(".", GetInstanceMembers)
- };
-
- protected Mono.TextEditor.TextEditorData textEditorData{ get; set; }
-
- public override string CompletionLanguage {
- get {
- return "C/C++";
- }
- }
- static bool IsOpenBrace (char c)
- {
- return c == '(' || c == '{' || c == '<' || c == '[';
- }
- static bool IsCloseBrace (char c)
- {
- return c == ')' || c == '}' || c == '>' || c == ']';
- }
-
- static bool IsBrace (char c)
- {
- return IsOpenBrace (c) || IsCloseBrace (c);
- }
-
- static int SearchMatchingBracket (TextEditorData editor, int offset, char openBracket, char closingBracket, int direction)
- {
- bool isInString = false;
- bool isInChar = false;
- bool isInBlockComment = false;
- int depth = -1;
- while (offset >= 0 && offset < editor.Length) {
- char ch = editor.GetCharAt (offset);
- switch (ch) {
- case '/':
- if (isInBlockComment)
- isInBlockComment = editor.GetCharAt (offset + direction) != '*';
- if (!isInString && !isInChar && offset - direction < editor.Length)
- isInBlockComment = offset > 0 && editor.GetCharAt (offset - direction) == '*';
- break;
- case '"':
- if (!isInChar && !isInBlockComment)
- isInString = !isInString;
- break;
- case '\'':
- if (!isInString && !isInBlockComment)
- isInChar = !isInChar;
- break;
- default :
- if (ch == closingBracket) {
- if (!(isInString || isInChar || isInBlockComment))
- --depth;
- } else if (ch == openBracket) {
- if (!(isInString || isInChar || isInBlockComment)) {
- ++depth;
- if (depth == 0)
- return offset;
- }
- }
- break;
- }
- offset += direction;
- }
- return -1;
- }
-
- static int GetClosingBraceForLine (TextEditorData editor, DocumentLine line, out int openingLine)
- {
- int offset = SearchMatchingBracket (editor, line.Offset, '{', '}', -1);
- if (offset == -1) {
- openingLine = -1;
- return -1;
- }
-
- openingLine = editor.Document.OffsetToLineNumber (offset);
- return offset;
- }
-
- public override bool KeyPress (Gdk.Key key, char keyChar, Gdk.ModifierType modifier)
- {
- var line = Editor.Document.GetLine (Editor.Caret.Line);
- string lineText = Editor.GetLineText (Editor.Caret.Line);
- int lineCursorIndex = Math.Min (lineText.Length, Editor.Caret.Column);
-
- // Smart Indentation
- if (Document.Editor.Options.IndentStyle == IndentStyle.Smart)
- {
- if (keyChar == '}') {
- // Only indent if the brace is preceeded by whitespace.
- if(AllWhiteSpace(lineText.Substring(0, lineCursorIndex))) {
- int braceOpeningLine;
- if(GetClosingBraceForLine(Editor, line, out braceOpeningLine) >= 0)
- {
- Editor.Replace (line.Offset, line.Length, GetIndent(Editor, braceOpeningLine, 0) + "}" + lineText.Substring(lineCursorIndex));
- Editor.Document.CommitLineUpdate (line);
- return false;
- }
- }
- } else {
- switch(key)
- {
- case Gdk.Key.Return:
- // Calculate additional indentation, if any.
- char finalChar = '\0';
- char nextChar = '\0';
- string indent = String.Empty;
- if (!String.IsNullOrEmpty (Editor.SelectedText)) {
- int cursorPos = Editor.SelectionRange.Offset;
-
- Editor.DeleteSelectedText ();
- Editor.Caret.Offset = cursorPos;
-
- lineText = Editor.GetLineText (Editor.Caret.Line);
- lineCursorIndex = Editor.Caret.Column;
- // System.Console.WriteLine(TextEditorData.Caret.Offset);
- }
- if(lineText.Length > 0)
- {
- if(lineCursorIndex > 0)
- finalChar = lineText[Math.Min(lineCursorIndex, lineText.Length) - 1];
-
- if(lineCursorIndex < lineText.Length)
- nextChar = lineText[lineCursorIndex];
-
- if(finalChar == '{')
- indent = Document.Editor.Options.IndentationString;
- }
-
- // If the next character is an closing brace, indent it appropriately.
- if(IsBrace(nextChar) && !IsOpenBrace(nextChar))
- {
- int openingLine;
- if(GetClosingBraceForLine (Editor, line, out openingLine) >= 0)
- {
- Editor.InsertAtCaret (Editor.EolMarker + GetIndent(Editor, openingLine, 0));
- return false;
- }
- }
-
- // Default indentation method
- Editor.InsertAtCaret (Editor.EolMarker + indent + GetIndent(Editor, Editor.Document.OffsetToLineNumber (line.Offset), lineCursorIndex));
-
- return false;
-
- }
- }
- }
-
- return base.KeyPress (key, keyChar, modifier);
- }
-
- public override ICompletionDataList HandleCodeCompletion (CodeCompletionContext completionContext, char completionChar, ref int triggerWordLength)
- {
- string lineText = Editor.GetLineText (completionContext.TriggerLine).TrimEnd();
-
- // If the line ends with a matched extension, invoke its handler
- foreach (KeyValuePair<string, GetMembersForExtension> pair in completionExtensions) {
- if (lineText.EndsWith(pair.Key)) {
- lineText = lineText.Substring (0, lineText.Length - pair.Key.Length);
-
- int nameStart = lineText.LastIndexOfAny (allowedCharsMinusColon) + 1;
- string itemName = lineText.Substring (nameStart).Trim ();
-
- if (string.IsNullOrEmpty (itemName))
- return null;
-
- return pair.Value (this, pair.Key, itemName);
- }
- }
-
- if (char.IsLetter (completionChar)) {
- // Aggressive completion
- ICompletionDataList list = GlobalComplete ();
- triggerWordLength = ResetTriggerOffset (completionContext);
- return list;
- }
-
- return null;
- }
-
-// public override ICompletionDataList HandleCodeCompletion (
-// CodeCompletionContext completionContext, char completionChar)
-// {
-// int triggerWordLength = 0;
-// return HandleCodeCompletion (completionContext, completionChar, ref triggerWordLength);
-//
-// string lineText = Editor.GetLineText (completionContext.TriggerLine).TrimEnd();
-//
-// // If the line ends with a matched extension, invoke its handler
-// foreach (KeyValuePair<string, GetMembersForExtension> pair in completionExtensions) {
-// if (lineText.EndsWith(pair.Key)) {
-// lineText = lineText.Substring (0, lineText.Length - pair.Key.Length);
-//
-// int nameStart = lineText.LastIndexOfAny (allowedCharsMinusColon) + 1;
-// string itemName = lineText.Substring (nameStart).Trim ();
-//
-// if (string.IsNullOrEmpty (itemName))
-// return null;
-//
-// return pair.Value (this, pair.Key, itemName);
-// }
-// }
-//
-// return null;
-// }
-
- public override ICompletionDataList CodeCompletionCommand (
- CodeCompletionContext completionContext)
- {
- int pos = completionContext.TriggerOffset;
- string lineText = Editor.GetLineText (Editor.Caret.Line).Trim();
-
- foreach (KeyValuePair<string, GetMembersForExtension> pair in completionExtensions) {
- if(lineText.EndsWith(pair.Key)) {
- int triggerWordLength = completionContext.TriggerWordLength;
- return HandleCodeCompletion (completionContext, Editor.GetCharAt (pos), ref triggerWordLength);
- }
- }
-
- return GlobalComplete ();
- }
-
- /// <summary>
- /// Gets contained members for a namespace or class
- /// </summary>
- /// <param name="self">
- /// The current CTextEditorExtension
- /// <see cref="CTextEditorExtension"/>
- /// </param>
- /// <param name="completionExtension">
- /// The extension that triggered the completion
- /// (e.g. "::")
- /// <see cref="System.String"/>
- /// </param>
- /// <param name="completionText">
- /// The identifier that triggered the completion
- /// (e.g. "Foo::")
- /// <see cref="System.String"/>
- /// </param>
- /// <returns>
- /// Completion data for the namespace or class
- /// <see cref="CompletionDataList"/>
- /// </returns>
- private static CompletionDataList GetItemMembers (CTextEditorExtension self, string completionExtension, string completionText) {
- return self.GetMembersOfItem (completionText);
- }
-
- /// <summary>
- /// Gets contained members for an instance
- /// </summary>
- /// <param name="self">
- /// The current CTextEditorExtension
- /// <see cref="CTextEditorExtension"/>
- /// </param>
- /// <param name="completionExtension">
- /// The extension that triggered the completion
- /// (e.g. "->")
- /// <see cref="System.String"/>
- /// </param>
- /// <param name="completionText">
- /// The identifier that triggered the completion
- /// (e.g. "blah->")
- /// <see cref="System.String"/>
- /// </param>
- /// <returns>
- /// Completion data for the instance
- /// <see cref="CompletionDataList"/>
- /// </returns>
- private static CompletionDataList GetInstanceMembers (CTextEditorExtension self, string completionExtension, string completionText) {
- return self.GetMembersOfInstance (completionText, ("->" == completionExtension));
- }
-
- private CompletionDataList GetMembersOfItem (string itemFullName)
- {
- CProject project = Document.Project as CProject;
-
- if (project == null)
- return null;
-
- ProjectInformation info = ProjectInformationManager.Instance.Get (project);
- CompletionDataList list = new CompletionDataList ();
- list.AutoSelect = false;
-
- LanguageItem container = null;
-
- string currentFileName = Document.FileName;
- bool in_project = false;
-
- foreach (LanguageItem li in info.Containers ()) {
- if (itemFullName == li.FullName) {
- container = li;
- in_project = true;
- }
- }
-
- if (!in_project && info.IncludedFiles.ContainsKey (currentFileName)) {
- foreach (CBinding.Parser.FileInformation fi in info.IncludedFiles[currentFileName]) {
- foreach (LanguageItem li in fi.Containers ()) {
- if (itemFullName == li.FullName)
- container = li;
- }
- }
- }
-
- if (container == null)
- return null;
-
- if (in_project) {
- AddItemsWithParent (list, info.AllItems (), container);
- } else {
- foreach (CBinding.Parser.FileInformation fi in info.IncludedFiles[currentFileName]) {
- AddItemsWithParent (list, fi.AllItems (), container);
- }
- }
-
- return list;
- }
-
- /// <summary>
- /// Adds completion data for children to a list
- /// </summary>
- /// <param name="list">
- /// The list to which completion data will be added
- /// <see cref="CompletionDataList"/>
- /// </param>
- /// <param name="items">
- /// A list of items to search
- /// <see cref="IEnumerable"/>
- /// </param>
- /// <param name="parent">
- /// The parent that will be matched
- /// </param>
- public static void AddItemsWithParent(CompletionDataList list, IEnumerable<LanguageItem> items, LanguageItem parent) {
- foreach (LanguageItem li in items) {
- if (li.Parent != null && li.Parent.Equals (parent))
- list.Add (new CompletionData (li));
- }
- }
-
-
- /// <summary>
- /// Gets completion data for a given instance
- /// </summary>
- /// <param name="instanceName">
- /// The identifier of the instance
- /// <see cref="System.String"/>
- /// </param>
- /// <param name="isPointer">
- /// Whether the instance in question is a pointer
- /// <see cref="System.Boolean"/>
- /// </param>
- /// <returns>
- /// Completion data for the instance
- /// <see cref="CompletionDataList"/>
- /// </returns>
- private CompletionDataList GetMembersOfInstance (string instanceName, bool isPointer)
- {
- CProject project = Document.Project as CProject;
-
- if (project == null)
- return null;
-
- ProjectInformation info = ProjectInformationManager.Instance.Get (project);
- CompletionDataList list = new CompletionDataList ();
- list.AutoSelect = false;
-
- string container = null;
-
- string currentFileName = Document.FileName;
- bool in_project = false;
-
- // Find the typename of the instance
- foreach (Member li in info.Members ) {
- if (instanceName == li.Name && li.IsPointer == isPointer) {
- container = li.InstanceType;
- in_project = true;
- break;
- }
- }
-
- // Search included files
- if (!in_project && info.IncludedFiles.ContainsKey (currentFileName)) {
- foreach (CBinding.Parser.FileInformation fi in info.IncludedFiles[currentFileName]) {
- foreach (Member li in fi.Members) {
- if (instanceName == li.Name && li.IsPointer == isPointer) {
- container = li.InstanceType;
- break;
- }
- }
- }
- }
-
- if (null == container) {
- // Search locals
- foreach (Local li in info.Locals ) {
- if (instanceName == li.Name && li.IsPointer == isPointer && currentFileName == li.File) {
- container = li.InstanceType;
- in_project = true;
- break;
- }
- }
- }
-
- // Not found
- if (container == null)
- return null;
-
- // Get the LanguageItem corresponding to the typename
- // and populate completion data accordingly
- if (in_project) {
- AddMembersWithParent (list, info.InstanceMembers (), container);
- } else {
- foreach (CBinding.Parser.FileInformation fi in info.IncludedFiles[currentFileName]) {
- AddMembersWithParent (list, fi.InstanceMembers (), container);
- }
- }
-
- return list;
- }
-
- /// <summary>
- /// Adds completion data for children to a list
- /// </summary>
- /// <param name="list">
- /// The list to which completion data will be added
- /// <see cref="CompletionDataList"/>
- /// </param>
- /// <param name="items">
- /// A list of items to search
- /// <see cref="IEnumerable"/>
- /// </param>
- /// <param name="parentName">
- /// The name of the parent that will be matched
- /// <see cref="System.String"/>
- /// </param>
- public static void AddMembersWithParent(CompletionDataList list, IEnumerable<LanguageItem> items, string parentName) {
- foreach (LanguageItem li in items) {
- if (li.Parent != null && li.Parent.Name.EndsWith (parentName))
- list.Add (new CompletionData (li));
- }
- }
-
- private ICompletionDataList GlobalComplete ()
- {
- CProject project = Document.Project as CProject;
-
- if (project == null)
- return null;
-
- ProjectInformation info = ProjectInformationManager.Instance.Get (project);
-
- CompletionDataList list = new CompletionDataList ();
- list.AutoSelect = false;
-
- foreach (LanguageItem li in info.Containers ())
- if (li.Parent == null)
- list.Add (new CompletionData (li));
-
- foreach (Function f in info.Functions)
- if (f.Parent == null)
- list.Add (new CompletionData (f));
-
- foreach (Enumerator e in info.Enumerators)
- list.Add (new CompletionData (e));
-
- foreach (Macro m in info.Macros)
- list.Add (new CompletionData (m));
-
- string currentFileName = Document.FileName;
-
- if (info.IncludedFiles.ContainsKey (currentFileName)) {
- foreach (CBinding.Parser.FileInformation fi in info.IncludedFiles[currentFileName]) {
- foreach (LanguageItem li in fi.Containers ())
- if (li.Parent == null)
- list.Add (new CompletionData (li));
-
- foreach (Function f in fi.Functions)
- if (f.Parent == null)
- list.Add (new CompletionData (f));
-
- foreach (Enumerator e in fi.Enumerators)
- list.Add (new CompletionData (e));
-
- foreach (Macro m in fi.Macros)
- list.Add (new CompletionData (m));
- }
- }
-
- return list;
- }
-
- public override MonoDevelop.Ide.CodeCompletion.ParameterDataProvider HandleParameterCompletion (
- CodeCompletionContext completionContext, char completionChar)
- {
- if (completionChar != '(')
- return null;
-
- CProject project = Document.Project as CProject;
-
- if (project == null)
- return null;
-
- ProjectInformation info = ProjectInformationManager.Instance.Get (project);
- string lineText = Editor.GetLineText (Editor.Caret.Line).TrimEnd ();
- if (lineText.EndsWith (completionChar.ToString (), StringComparison.Ordinal))
- lineText = lineText.Remove (lineText.Length-1).TrimEnd ();
-
- int nameStart = lineText.LastIndexOfAny (allowedChars);
-
- nameStart++;
-
- string functionName = lineText.Substring (nameStart).Trim ();
-
- if (string.IsNullOrEmpty (functionName))
- return null;
-
- return new ParameterDataProvider (nameStart, Document, info, functionName);
- }
-
- private bool AllWhiteSpace (string lineText)
- {
- // We will almost definately need a faster method than this
- foreach (char c in lineText)
- if (!char.IsWhiteSpace (c))
- return false;
-
- return true;
- }
-
- // Snatched from DefaultFormattingStrategy
- private string GetIndent (TextEditorData d, int lineNumber, int terminateIndex)
- {
- string lineText = d.GetLineText (lineNumber);
- if(terminateIndex > 0)
- lineText = terminateIndex < lineText.Length ? lineText.Substring(0, terminateIndex) : lineText;
-
- StringBuilder whitespaces = new StringBuilder ();
-
- foreach (char ch in lineText) {
- if (!char.IsWhiteSpace (ch))
- break;
- whitespaces.Append (ch);
- }
-
- return whitespaces.ToString ();
- }
-
- [CommandHandler (MonoDevelop.DesignerSupport.Commands.SwitchBetweenRelatedFiles)]
- protected void Run ()
- {
- var cp = this.Document.Project as CProject;
- if (cp != null) {
- string match = cp.MatchingFile (this.Document.FileName);
- if (match != null)
- MonoDevelop.Ide.IdeApp.Workbench.OpenDocument (match, true);
- }
- }
-
- [CommandUpdateHandler (MonoDevelop.DesignerSupport.Commands.SwitchBetweenRelatedFiles)]
- protected void Update (CommandInfo info)
- {
- var cp = this.Document.Project as CProject;
- info.Visible = info.Visible = cp != null && cp.MatchingFile (this.Document.FileName) != null;
- }
-
- #region IPathedDocument implementation
-
- public event EventHandler<DocumentPathChangedEventArgs> PathChanged;
-
- public Gtk.Widget CreatePathWidget (int index)
- {
- PathEntry[] path = CurrentPath;
- if (null == path || 0 > index || path.Length <= index) {
- return null;
- }
-
- object tag = path[index].Tag;
- DropDownBoxListWindow.IListDataProvider provider = null;
- if (tag is ParsedDocument) {
- provider = new CompilationUnitDataProvider (Document);
- } else {
- provider = new DataProvider (Document, tag, GetAmbience ());
- }
-
- DropDownBoxListWindow window = new DropDownBoxListWindow (provider);
- window.SelectItem (tag);
- return window;
- }
-
- public PathEntry[] CurrentPath {
- get;
- private set;
- }
-
- protected virtual void OnPathChanged (DocumentPathChangedEventArgs args)
- {
- if (PathChanged != null)
- PathChanged (this, args);
- }
-
- #endregion
-
- // Yoinked from C# binding
- void UpdatePath (object sender, Mono.TextEditor.DocumentLocationEventArgs e)
- {
- /* var unit = Document.ParsedDocument;
- if (unit == null)
- return;
-
- var loc = Document.Editor.Caret.Location;
-
- var result = new List<PathEntry> ();
- var amb = GetAmbience ();
- var type = unit.GetInnermostTypeDefinition (loc.Line, loc.Column) ?? unit.TopLevelTypeDefinitions.FirstOrDefault ();
- var curType = type;
- object lastTag = unit;
- while (curType != null) {
- var markup = amb.GetString ((IEntity)curType, OutputFlags.IncludeGenerics | OutputFlags.IncludeParameters | OutputFlags.ReformatDelegates | OutputFlags.IncludeMarkup);
- result.Insert (0, new PathEntry (ImageService.GetPixbuf (type.GetStockIcon (), Gtk.IconSize.Menu), curType.IsObsolete () ? "<s>" + markup + "</s>" : markup) { Tag = lastTag });
- lastTag = curType;
- curType = curType.DeclaringTypeDefinition;
- }
-
- var member = type.Members.FirstOrDefault (m => m.Region.IsInside (loc.Line, loc.Column));
- if (member != null) {
- var ctx = Document.ParsedDocument.ParsedFile.GetTypeResolveContext (Document.Compilation, member.Region.Begin);;
- var markup = amb.GetString (member.CreateResolved (ctx), OutputFlags.IncludeGenerics | OutputFlags.IncludeParameters | OutputFlags.ReformatDelegates | OutputFlags.IncludeMarkup);
- result.Add (new PathEntry (ImageService.GetPixbuf (member.GetStockIcon (), Gtk.IconSize.Menu), member.IsObsolete () ? "<s>" + markup + "</s>" : markup) { Tag = lastTag });
- }
-
- PathEntry noSelection = null;
- if (type == null) {
- noSelection = new PathEntry (GettextCatalog.GetString ("No selection")) { Tag = unit };
- } else if (member == null && type.Kind != TypeKind.Delegate)
- noSelection = new PathEntry (GettextCatalog.GetString ("No selection")) { Tag = type };
- if (noSelection != null)
- result.Add (noSelection);
- var prev = CurrentPath;
- CurrentPath = result.ToArray ();
- OnPathChanged (new DocumentPathChangedEventArgs (prev));*/
- }
-
- public override void Initialize ()
- {
- base.Initialize ();
- textEditorData = Document.Editor;
- UpdatePath (null, null);
- textEditorData.Caret.PositionChanged += UpdatePath;
- Document.DocumentParsed += delegate { UpdatePath (null, null); };
- }
-
- /// <summary>
- /// Move the completion trigger offset to the beginning of the current token
- /// </summary>
- protected virtual int ResetTriggerOffset (CodeCompletionContext completionContext)
- {
- int i = completionContext.TriggerOffset;
- if (i >= Editor.Length)
- return 0;
- int accumulator = 0;
-
- for (;
- 1 < i && char.IsLetterOrDigit (Editor.GetCharAt (i));
- --i, ++accumulator);
- completionContext.TriggerOffset = i-1;
- return accumulator+1;
- }// ResetTriggerOffset
-
- [CommandHandler (MonoDevelop.Refactoring.RefactoryCommands.GotoDeclaration)]
- public void GotoDeclaration ()
- {
- LanguageItem item = GetLanguageItemAt (Editor.Caret.Location);
- if (item != null)
- IdeApp.Workbench.OpenDocument ((FilePath)item.File, (int)item.Line, 1);
- }
-
- [CommandUpdateHandler (MonoDevelop.Refactoring.RefactoryCommands.GotoDeclaration)]
- public void CanGotoDeclaration (CommandInfo item)
- {
- item.Visible = (GetLanguageItemAt (Editor.Caret.Location) != null);
- item.Bypass = !item.Visible;
- }
-
- private LanguageItem GetLanguageItemAt (DocumentLocation location)
- {
- CProject project = Document.Project as CProject;
- string token = GetTokenAt (location);
- if (project != null && !string.IsNullOrEmpty (token)) {
- ProjectInformation info = ProjectInformationManager.Instance.Get (project);
- return info.AllItems ().FirstOrDefault (i => i.Name.Equals (token, StringComparison.Ordinal));
- }
-
- return null;
- }
-
- private string GetTokenAt (DocumentLocation location)
- {
- int lineOffset = location.Column-1;
- string line = Editor.GetLineText (location.Line);
- if (line.Length == 0)
- return "";
- if (lineOffset >= line.Length)
- lineOffset = line.Length - 1;
- int first = line.LastIndexOfAny (allowedChars, lineOffset) + 1;
- int last = line.IndexOfAny (allowedChars, lineOffset);
- if (last < 0) last = line.Length - 1;
- string token = string.Empty;
-
- if (first >= 0 && first < last && last < line.Length) {
- token = line.Substring (first, last-first);
- }
- return token.Trim ();
- }
- }
-}
diff --git a/main/src/addins/CBinding/Gui/CodeGenerationPanel.cs b/main/src/addins/CBinding/Gui/CodeGenerationPanel.cs
deleted file mode 100644
index 6740df3b2e..0000000000
--- a/main/src/addins/CBinding/Gui/CodeGenerationPanel.cs
+++ /dev/null
@@ -1,369 +0,0 @@
-//
-// CodeGenerationPanel.cs: Code generation panel to configure project
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Gui.Dialogs;
-using MonoDevelop.Components;
-using MonoDevelop.Ide;
-
-namespace CBinding
-{
- public partial class CodeGenerationPanel : Gtk.Bin
- {
- private CProjectConfiguration configuration;
- private Gtk.ListStore libStore = new Gtk.ListStore (typeof(string));
- private Gtk.ListStore libPathStore = new Gtk.ListStore (typeof(string));
- private Gtk.ListStore includePathStore = new Gtk.ListStore (typeof(string));
-
- static string[,] quickPathInsertMenu = new string[,] {
- {GettextCatalog.GetString ("_Project Directory"), "${ProjectDir}"},
- {GettextCatalog.GetString ("_Root Solution Directory"), "${CombineDir}"},
- };
-
- public CodeGenerationPanel ()
- {
- this.Build ();
-
- Gtk.CellRendererText textRenderer = new Gtk.CellRendererText ();
-
- libTreeView.Model = libStore;
- libTreeView.HeadersVisible = false;
- libTreeView.AppendColumn ("Library", textRenderer, "text", 0);
-
- libPathTreeView.Model = libPathStore;
- libPathTreeView.HeadersVisible = false;
- libPathTreeView.AppendColumn ("Library", textRenderer, "text", 0);
-
- includePathTreeView.Model = includePathStore;
- includePathTreeView.HeadersVisible = false;
- includePathTreeView.AppendColumn ("Include", textRenderer, "text", 0);
-
- new MenuButtonEntry (libPathEntry, quickInsertLibButton, quickPathInsertMenu);
- new MenuButtonEntry (includePathEntry, quickInsertIncludeButton, quickPathInsertMenu);
- }
-
- public void Load (CProjectConfiguration config)
- {
- configuration = config;
-
- switch (configuration.WarningLevel)
- {
- case WarningLevel.None:
- noWarningRadio.Active = true;
- break;
- case WarningLevel.Normal:
- normalWarningRadio.Active = true;
- break;
- case WarningLevel.All:
- allWarningRadio.Active = true;
- break;
- }
-
- warningsAsErrorsCheckBox.Active = configuration.WarningsAsErrors;
-
- optimizationSpinButton.Value = configuration.OptimizationLevel;
-
- switch (configuration.CompileTarget)
- {
- case CBinding.CompileTarget.Bin:
- targetComboBox.Active = 0;
- break;
- case CBinding.CompileTarget.StaticLibrary:
- targetComboBox.Active = 1;
- break;
- case CBinding.CompileTarget.SharedLibrary:
- targetComboBox.Active = 2;
- break;
- }
-
- extraCompilerTextView.Buffer.Text = configuration.ExtraCompilerArguments;
-
- extraLinkerTextView.Buffer.Text = configuration.ExtraLinkerArguments;
-
- defineSymbolsTextEntry.Text = configuration.DefineSymbols;
-
- libStore.Clear ();
- foreach (string lib in configuration.Libs)
- libStore.AppendValues (lib);
-
- libPathStore.Clear ();
- foreach (string libPath in configuration.LibPaths)
- libPathStore.AppendValues (libPath);
-
- includePathStore.Clear ();
- foreach (string includePath in configuration.Includes)
- includePathStore.AppendValues (includePath);
- }
-
- private void OnIncludePathAdded (object sender, EventArgs e)
- {
- if (includePathEntry.Text.Length > 0) {
- includePathStore.AppendValues (includePathEntry.Text);
- includePathEntry.Text = string.Empty;
- }
- }
-
- private void OnIncludePathRemoved (object sender, EventArgs e)
- {
- Gtk.TreeIter iter;
- includePathTreeView.Selection.GetSelected (out iter);
- includePathStore.Remove (ref iter);
- }
-
- private void OnLibPathAdded (object sender, EventArgs e)
- {
- if (libPathEntry.Text.Length > 0) {
- libPathStore.AppendValues (libPathEntry.Text);
- libPathEntry.Text = string.Empty;
- }
- }
-
- private void OnLibPathRemoved (object sender, EventArgs e)
- {
- Gtk.TreeIter iter;
- libPathTreeView.Selection.GetSelected (out iter);
- libPathStore.Remove (ref iter);
- }
-
- private void OnLibAdded (object sender, EventArgs e)
- {
- if (libAddEntry.Text.Length > 0) {
- libStore.AppendValues (libAddEntry.Text);
- libAddEntry.Text = string.Empty;
- }
- }
-
- private void OnLibRemoved (object sender, EventArgs e)
- {
- Gtk.TreeIter iter;
- libTreeView.Selection.GetSelected (out iter);
- libStore.Remove (ref iter);
- }
-
- // TODO: This is platform specific... the C Binding should have a global list of 'standard' library dirs...
- internal const string DEFAULT_LIB_DIR = "/usr/lib";
- internal const string DEFAULT_INCLUDE_DIR = "/usr/lib";
- internal const string STATIC_LIB_FILTER = "*.a";
- internal const string DYNAMIC_LIB_FILTER = "*.so";
-
- private void OnBrowseButtonClick (object sender, EventArgs e)
- {
- var dialog = new MonoDevelop.Components.SelectFileDialog (GettextCatalog.GetString ("Add Library")) {
- TransientFor = (Gtk.Window) Toplevel,
- CurrentFolder = DEFAULT_LIB_DIR,
- };
-
- dialog.AddFilter (GettextCatalog.GetString ("Static Library"), STATIC_LIB_FILTER);
- dialog.AddFilter (GettextCatalog.GetString ("Dynamic Library"), DYNAMIC_LIB_FILTER);
- dialog.AddAllFilesFilter ();
-
- if (dialog.Run ())
- libAddEntry.Text = dialog.SelectedFile;
- }
-
- private void OnIncludePathBrowseButtonClick (object sender, EventArgs e)
- {
- var dialog = new MonoDevelop.Components.SelectFolderDialog (GettextCatalog.GetString ("Add Path")) {
- TransientFor = (Gtk.Window) Toplevel,
- CurrentFolder = DEFAULT_INCLUDE_DIR,
- };
-
- if (dialog.Run ())
- includePathEntry.Text = dialog.SelectedFile;
- }
-
- private void OnLibPathBrowseButtonClick (object sender, EventArgs e)
- {
- var dialog = new MonoDevelop.Components.SelectFolderDialog (GettextCatalog.GetString ("Add Path")) {
- TransientFor = (Gtk.Window) Toplevel,
- CurrentFolder = DEFAULT_LIB_DIR,
- };
-
- if (dialog.Run ())
- libPathEntry.Text = dialog.SelectedFile;
- }
-
- public bool Store ()
- {
- if (configuration == null)
- return false;
-
- string line;
- Gtk.TreeIter iter;
-
- if (noWarningRadio.Active)
- configuration.WarningLevel = WarningLevel.None;
- else if (normalWarningRadio.Active)
- configuration.WarningLevel = WarningLevel.Normal;
- else
- configuration.WarningLevel = WarningLevel.All;
-
- configuration.WarningsAsErrors = warningsAsErrorsCheckBox.Active;
-
- configuration.OptimizationLevel = (int)optimizationSpinButton.Value;
-
- switch (targetComboBox.ActiveText)
- {
- case "Executable":
- configuration.CompileTarget = CBinding.CompileTarget.Bin;
- break;
- case "Static Library":
- configuration.CompileTarget = CBinding.CompileTarget.StaticLibrary;
- break;
- case "Shared Object":
- configuration.CompileTarget = CBinding.CompileTarget.SharedLibrary;
- break;
- }
-
- configuration.ExtraCompilerArguments = extraCompilerTextView.Buffer.Text;
-
- configuration.ExtraLinkerArguments = extraLinkerTextView.Buffer.Text;
-
- configuration.DefineSymbols = defineSymbolsTextEntry.Text;
-
- libStore.GetIterFirst (out iter);
- configuration.Libs.Clear ();
- while (libStore.IterIsValid (iter)) {
- line = (string)libStore.GetValue (iter, 0);
- configuration.Libs.Add (line);
- libStore.IterNext (ref iter);
- }
-
- libPathStore.GetIterFirst (out iter);
- configuration.LibPaths.Clear ();
- while (libPathStore.IterIsValid (iter)) {
- line = (string)libPathStore.GetValue (iter, 0);
- configuration.LibPaths.Add (line);
- libPathStore.IterNext (ref iter);
- }
-
- includePathStore.GetIterFirst (out iter);
- configuration.Includes.Clear ();
- while (includePathStore.IterIsValid (iter)) {
- line = (string)includePathStore.GetValue (iter, 0);
- configuration.Includes.Add (line);
- includePathStore.IterNext (ref iter);
- }
-
- return true;
- }
-
- protected virtual void OnLibAddEntryChanged (object sender, EventArgs e)
- {
- if (string.IsNullOrEmpty (libAddEntry.Text))
- addLibButton.Sensitive = false;
- else
- addLibButton.Sensitive = true;
- }
-
- protected virtual void OnLibTreeViewCursorChanged (object sender, System.EventArgs e)
- {
- removeLibButton.Sensitive = true;
- }
-
- protected virtual void OnRemoveLibButtonClicked (object sender, System.EventArgs e)
- {
- removeLibButton.Sensitive = false;
- }
-
- protected virtual void OnIncludePathEntryChanged (object sender, System.EventArgs e)
- {
- if (string.IsNullOrEmpty (includePathEntry.Text))
- includePathAddButton.Sensitive = false;
- else
- includePathAddButton.Sensitive = true;
- }
-
- protected virtual void OnLibPathEntryChanged (object sender, System.EventArgs e)
- {
- if (string.IsNullOrEmpty (libPathEntry.Text))
- libPathAddButton.Sensitive = false;
- else
- libPathAddButton.Sensitive = true;
- }
-
- protected virtual void OnIncludePathTreeViewCursorChanged (object sender, System.EventArgs e)
- {
- includePathRemoveButton.Sensitive = true;
- }
-
- protected virtual void OnIncludePathRemoveButtonClicked (object sender, System.EventArgs e)
- {
- includePathRemoveButton.Sensitive = false;
- }
-
- protected virtual void OnLibPathTreeViewCursorChanged (object sender, System.EventArgs e)
- {
- libPathRemoveButton.Sensitive = true;
- }
-
- protected virtual void OnLibPathRemoveButtonClicked (object sender, System.EventArgs e)
- {
- libPathRemoveButton.Sensitive = false;
- }
-
- protected virtual void OnLibAddEntryActivated (object sender, System.EventArgs e)
- {
- OnLibAdded (this, new EventArgs ());
- }
-
- protected virtual void OnIncludePathEntryActivated (object sender, System.EventArgs e)
- {
- OnIncludePathAdded (this, new EventArgs ());
- }
-
- protected virtual void OnLibPathEntryActivated (object sender, System.EventArgs e)
- {
- OnLibPathAdded (this, new EventArgs ());
- }
- }
-
- public class CodeGenerationPanelBinding : MultiConfigItemOptionsPanel
- {
- private CodeGenerationPanel panel;
-
- public override Gtk.Widget CreatePanelWidget ()
- {
- return panel = new CodeGenerationPanel ();
- }
-
- public override void LoadConfigData ()
- {
- panel.Load ((CProjectConfiguration) CurrentConfiguration);
- }
-
- public override void ApplyChanges ()
- {
- panel.Store ();
- }
- }
-}
diff --git a/main/src/addins/CBinding/Gui/CompilerPanel.cs b/main/src/addins/CBinding/Gui/CompilerPanel.cs
deleted file mode 100644
index 4beaa0e61a..0000000000
--- a/main/src/addins/CBinding/Gui/CompilerPanel.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// CompilerPanel.cs: Allows the user to select what compiler to use for their project
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using Mono.Addins;
-
-using MonoDevelop.Ide.Gui.Dialogs;
-using MonoDevelop.Ide;
-
-namespace CBinding
-{
- public partial class CompilerPanel : Gtk.Bin
- {
- private CProject project;
- private object[] compilers;
- private ICompiler active_compiler;
-
- public CompilerPanel (CProject project)
- {
- this.Build ();
-
- this.project = project;
-
- compilers = AddinManager.GetExtensionObjects ("/CBinding/Compilers");
-
- foreach (ICompiler compiler in compilers) {
- compilerComboBox.AppendText (compiler.Name);
- }
-
- int active = 0;
- Gtk.TreeIter iter;
- Gtk.ListStore store = (Gtk.ListStore)compilerComboBox.Model;
- store.GetIterFirst (out iter);
- while (store.IterIsValid (iter)) {
- if ((string)store.GetValue (iter, 0) == project.Compiler.Name) {
- break;
- }
- store.IterNext (ref iter);
- active++;
- }
-
- compilerComboBox.Active = active;
-
- useCcacheCheckBox.Active = ((CProjectConfiguration)project.GetConfiguration (IdeApp.Workspace.ActiveConfiguration)).UseCcache;
-
- Update ();
- }
-
- public void Store ()
- {
- if (project == null)
- return;
-
- if (!active_compiler.Equals (project.Compiler)) {
- project.Compiler = active_compiler;
- project.Language = active_compiler.Language;
- }
-
- // Update use_ccache for all configurations
- foreach (CProjectConfiguration conf in project.Configurations)
- conf.UseCcache = useCcacheCheckBox.Active;
- }
-
- protected virtual void OnCompilerComboBoxChanged (object sender, EventArgs e)
- {
- Update ();
- }
-
- private void Update ()
- {
- foreach (ICompiler compiler in compilers) {
- if (compilerComboBox.ActiveText == compiler.Name) {
- active_compiler = compiler;
- break;
- }
- }
-
- if (active_compiler.SupportsCcache)
- useCcacheCheckBox.Sensitive = true;
- else
- useCcacheCheckBox.Sensitive = false;
- }
- }
-
- public class CompilerPanelBinding : ItemOptionsPanel
- {
- CompilerPanel panel;
-
- public override Gtk.Widget CreatePanelWidget ()
- {
- return panel = new CompilerPanel ((CProject)ConfiguredProject);
- }
-
- public override void ApplyChanges ()
- {
- panel.Store ();
- }
- }
-}
diff --git a/main/src/addins/CBinding/Gui/DataProvider.cs b/main/src/addins/CBinding/Gui/DataProvider.cs
deleted file mode 100644
index 1027c44d44..0000000000
--- a/main/src/addins/CBinding/Gui/DataProvider.cs
+++ /dev/null
@@ -1,215 +0,0 @@
-//
-// DataProvider.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-
-
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.CodeCompletion;
-
-using CBinding.Parser;
-using MonoDevelop.Core;
-using ICSharpCode.NRefactory.Completion;
-
-namespace CBinding
-{
- public class ParameterDataProvider : MonoDevelop.Ide.CodeCompletion.ParameterDataProvider
- {
- private Mono.TextEditor.TextEditorData editor;
- private List<Function> functions = new List<Function> ();
-
- public ParameterDataProvider (int startOffset, Document document, ProjectInformation info, string functionName) :base (startOffset)
- {
- this.editor = document.Editor;
-
- foreach (Function f in info.Functions) {
- if (f.Name == functionName) {
- functions.Add (f);
- }
- }
-
- string currentFile = document.FileName;
-
- if (info.IncludedFiles.ContainsKey (currentFile)) {
- foreach (CBinding.Parser.FileInformation fi in info.IncludedFiles[currentFile]) {
- foreach (Function f in fi.Functions) {
- if (f.Name == functionName) {
- functions.Add (f);
- }
- }
- }
- }
- }
-
- // Returns the number of methods
- public override int Count {
- get { return functions.Count; }
- }
-
- // Returns the index of the parameter where the cursor is currently positioned.
- // -1 means the cursor is outside the method parameter list
- // 0 means no parameter entered
- // > 0 is the index of the parameter (1-based)
- public int GetCurrentParameterIndex (ICompletionWidget widget, CodeCompletionContext ctx)
- {
- int cursor = widget.CurrentCodeCompletionContext.TriggerOffset;
- int i = ctx.TriggerOffset;
- if (i < 0 || i >= editor.Length || editor.GetCharAt (i) == ')')
- return -1;
-
- if (i > cursor)
- return -1;
- else if (i == cursor)
- return 0;
-
- int parameterIndex = 1;
-
- while (i++ < cursor) {
- if (i >= widget.TextLength)
- break;
- char ch = widget.GetChar (i);
- if (ch == ',')
- parameterIndex++;
- else if (ch == ')')
- return -1;
- }
-
- return parameterIndex;
- }
-
- // Returns the markup to use to represent the specified method overload
- // in the parameter information window.
- public string GetHeading (int overload, string[] parameterMarkup, int currentParameter)
- {
- Function function = functions[overload];
- string paramTxt = string.Join (", ", parameterMarkup);
-
- int len = function.FullName.LastIndexOf ("::");
- string prename = null;
-
- if (len > 0)
- prename = GLib.Markup.EscapeText (function.FullName.Substring (0, len + 2));
-
- string cons = string.Empty;
-
- if (function.IsConst)
- cons = " const";
-
- return prename + "<b>" + function.Name + "</b>" + " (" + paramTxt + ")" + cons;
- }
-
- public string GetDescription (int overload, int currentParameter)
- {
- return "";
- }
-
- // Returns the text to use to represent the specified parameter
- public string GetParameterDescription (int overload, int paramIndex)
- {
- Function function = functions[overload];
-
- return GLib.Markup.EscapeText (function.Parameters[paramIndex]);
- }
-
- // Returns the number of parameters of the specified method
- public override int GetParameterCount (int overload)
- {
- return functions[overload].Parameters.Length;
- }
- public override string GetParameterName (int overload, int paramIndex)
- {
- return "";
- }
- public override bool AllowParameterList (int overload)
- {
- return false;
- }
- }
-
- public class CompletionData : MonoDevelop.Ide.CodeCompletion.CompletionData
- {
- private IconId image;
- private string text;
- private string description;
- private string completion_string;
-
- public CompletionData (LanguageItem item)
- {
- if (item is Class)
- image = Stock.Class;
- else if (item is Structure)
- image = Stock.Struct;
- else if (item is Union)
- image = "md-union";
- else if (item is Enumeration)
- image = Stock.Enum;
- else if (item is Enumerator)
- image = Stock.Literal;
- else if (item is Function)
- image = Stock.Method;
- else if (item is Namespace)
- image = Stock.NameSpace;
- else if (item is Typedef)
- image = Stock.Interface;
- else if (item is Member)
- image = Stock.Field;
- else if (item is Variable)
- image = Stock.Field;
- else if (item is Macro)
- image = Stock.Literal;
- else
- image = Stock.Literal;
-
- this.text = item.Name;
- this.completion_string = item.Name;
- this.description = string.Empty;
- }
-
- public override IconId Icon {
- get { return image; }
- }
-
- public override string DisplayText {
- get { return text; }
- }
-
- public override string Description {
- get { return description; }
- }
-
- public override string CompletionText {
- get { return completion_string; }
- }
- }
-
-}
diff --git a/main/src/addins/CBinding/Gui/EditPackagesDialog.cs b/main/src/addins/CBinding/Gui/EditPackagesDialog.cs
deleted file mode 100644
index d7cd1f8adb..0000000000
--- a/main/src/addins/CBinding/Gui/EditPackagesDialog.cs
+++ /dev/null
@@ -1,569 +0,0 @@
-//
-// EditPackagesDialog.cs: Allows you to add and remove pkg-config packages to the project
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Collections.Generic;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Ide;
-using MonoDevelop.Components;
-
-namespace CBinding
-{
- public partial class EditPackagesDialog : Gtk.Dialog
- {
- private Gtk.ListStore normalPackageListStore = new Gtk.ListStore (typeof(bool), typeof(string), typeof(string));
- private Gtk.ListStore projectPackageListStore = new Gtk.ListStore (typeof(bool), typeof(string), typeof(string));
- private Gtk.ListStore selectedPackageListStore = new Gtk.ListStore (typeof(string), typeof(string));
- private CProject project;
- private ProjectPackageCollection selectedPackages = new ProjectPackageCollection ();
- private List<Package> packagesOfProjects;
- private List<Package> packages = new List<Package> ();
-
- // Column IDs
- const int NormalPackageToggleID = 0;
- const int NormalPackageNameID = 1;
- const int NormalPackageVersionID = 2;
-
- const int ProjectPackageToggleID = 0;
- const int ProjectPackageNameID = 1;
- const int ProjectPackageVersionID = 2;
-
- const int SelectedPackageNameID = 0;
- const int SelectedPackageVersionID = 1;
-
- public EditPackagesDialog(CProject project)
- {
- this.Build();
-
- this.project = project;
-
- selectedPackages.Project = project;
- selectedPackages.AddRange (project.Packages);
-
- Gtk.CellRendererText textRenderer = new Gtk.CellRendererText ();
-
- CellRendererImage pixbufRenderer = new CellRendererImage ();
- pixbufRenderer.StockId = "md-package";
-
- normalPackageListStore.DefaultSortFunc = NormalPackageCompareNodes;
- projectPackageListStore.DefaultSortFunc = ProjectPackageCompareNodes;
- selectedPackageListStore.DefaultSortFunc = SelectedPackageCompareNodes;
-
- normalPackageListStore.SetSortColumnId (NormalPackageNameID, Gtk.SortType.Ascending);
- projectPackageListStore.SetSortColumnId (ProjectPackageNameID, Gtk.SortType.Ascending);
- selectedPackageListStore.SetSortColumnId (SelectedPackageNameID, Gtk.SortType.Ascending);
-
- normalPackageTreeView.SearchColumn = NormalPackageNameID;
- projectPackageTreeView.SearchColumn = ProjectPackageNameID;
- selectedPackageTreeView.SearchColumn = SelectedPackageNameID;
-
- // <!-- Normal packages -->
-
- Gtk.CellRendererToggle normalPackageToggleRenderer = new Gtk.CellRendererToggle ();
- normalPackageToggleRenderer.Activatable = true;
- normalPackageToggleRenderer.Toggled += OnNormalPackageToggled;
- normalPackageToggleRenderer.Xalign = 0;
-
- Gtk.TreeViewColumn normalPackageColumn = new Gtk.TreeViewColumn ();
- normalPackageColumn.Title = "Package";
- normalPackageColumn.PackStart (pixbufRenderer, false);
- normalPackageColumn.PackStart (textRenderer, true);
- normalPackageColumn.AddAttribute (textRenderer, "text", NormalPackageNameID);
-
- normalPackageTreeView.Model = normalPackageListStore;
- normalPackageTreeView.HeadersVisible = true;
- normalPackageTreeView.AppendColumn ("", normalPackageToggleRenderer, "active", NormalPackageToggleID);
- normalPackageTreeView.AppendColumn (normalPackageColumn);
- normalPackageTreeView.AppendColumn ("Version", textRenderer, "text", NormalPackageVersionID);
-
- // <!-- Project packages -->
-
- Gtk.CellRendererToggle projectPackageToggleRenderer = new Gtk.CellRendererToggle ();
- projectPackageToggleRenderer.Activatable = true;
- projectPackageToggleRenderer.Toggled += OnProjectPackageToggled;
- projectPackageToggleRenderer.Xalign = 0;
-
- Gtk.TreeViewColumn projectPackageColumn = new Gtk.TreeViewColumn ();
- projectPackageColumn.Title = "Package";
- projectPackageColumn.PackStart (pixbufRenderer, false);
- projectPackageColumn.PackStart (textRenderer, true);
- projectPackageColumn.AddAttribute (textRenderer, "text", ProjectPackageNameID);
-
- projectPackageTreeView.Model = projectPackageListStore;
- projectPackageTreeView.HeadersVisible = true;
- projectPackageTreeView.AppendColumn ("", projectPackageToggleRenderer, "active", ProjectPackageToggleID);
- projectPackageTreeView.AppendColumn (projectPackageColumn);
- projectPackageTreeView.AppendColumn ("Version", textRenderer, "text", ProjectPackageVersionID);
-
-
- // <!-- Selected packages -->
-
- Gtk.TreeViewColumn selectedPackageColumn = new Gtk.TreeViewColumn ();
- selectedPackageColumn.Title = "Package";
- selectedPackageColumn.PackStart (pixbufRenderer, false);
- selectedPackageColumn.PackStart (textRenderer, true);
- selectedPackageColumn.AddAttribute (textRenderer, "text", SelectedPackageNameID);
-
- selectedPackageTreeView.Model = selectedPackageListStore;
- selectedPackageTreeView.HeadersVisible = true;
- selectedPackageTreeView.AppendColumn (selectedPackageColumn);
- selectedPackageTreeView.AppendColumn ("Version", textRenderer, "text", SelectedPackageVersionID);
-
- // Fill up the project tree view
- packagesOfProjects = GetPackagesOfProjects (project);
-
- foreach (Package p in packagesOfProjects) {
- if (p.Name == project.Name) continue;
-
- packages.Add (p);
- string version = p.Version;
- bool inProject = selectedPackages.Contains (p);
-
- if (!IsPackageInStore (projectPackageListStore, p.Name, version, ProjectPackageNameID, ProjectPackageVersionID)) {
- projectPackageListStore.AppendValues (inProject, p.Name, version);
-
- if (inProject)
- selectedPackageListStore.AppendValues (p.Name, version);
- }
- }
-
- // Fill up the normal tree view
- foreach (string dir in ScanDirs ()) {
- if (Directory.Exists (dir)) {
- DirectoryInfo di = new DirectoryInfo (dir);
- FileInfo[] availablePackages = di.GetFiles ("*.pc");
-
- foreach (FileInfo f in availablePackages) {
- if (!IsValidPackage (f.FullName)) {
- continue;
- }
-
- Package package = new Package (f.FullName);
-
- packages.Add (package);
-
- string name = package.Name;
- string version = package.Version;
- bool inProject = selectedPackages.Contains (package);
-
- if (!IsPackageInStore (normalPackageListStore, name, version, NormalPackageNameID, NormalPackageVersionID)) {
- normalPackageListStore.AppendValues (inProject, name, version);
-
- if (inProject)
- selectedPackageListStore.AppendValues (name, version);
- }
- }
- }
- }
- }
-
- private List<Package> GetPackagesOfProjects (Project project)
- {
- List<Package> packages = new List<Package>();
- Package package;
-
- foreach (SolutionItem c in project.ParentFolder.Items) {
- if (null != c && c is CProject) {
- CProject cproj = (CProject)c;
- CProjectConfiguration conf = (CProjectConfiguration)cproj.GetConfiguration (IdeApp.Workspace.ActiveConfiguration);
- if (conf.CompileTarget != CBinding.CompileTarget.Bin) {
- cproj.WriteMDPkgPackage (conf.Selector);
- package = new Package (cproj);
- packages.Add (package);
- }
- }
- }
-
- return packages;
- }
-
- private bool IsPackageInStore (Gtk.ListStore store, string pname, string pversion, int pname_col, int pversion_col)
- {
- Gtk.TreeIter search_iter;
- bool has_elem = store.GetIterFirst (out search_iter);
-
- if (has_elem) {
- while (true) {
- string name = (string)store.GetValue (search_iter, pname_col);
- string version = (string)store.GetValue (search_iter, pversion_col);
-
- if (name == pname && version == pversion)
- return true;
-
- if (!store.IterNext (ref search_iter))
- break;
- }
- }
-
- return false;
- }
-
- private string[] ScanDirs ()
- {
- List<string> dirs = new List<string> ();
- string pkg_var = Environment.GetEnvironmentVariable ("PKG_CONFIG_PATH");
- string[] pkg_paths;
-
- dirs.Add ("/usr/lib/pkgconfig");
- dirs.Add ("/usr/lib64/pkgconfig");
- dirs.Add ("/usr/share/pkgconfig");
- dirs.Add ("/usr/local/lib/pkgconfig");
- dirs.Add ("/usr/local/share/pkgconfig");
- dirs.Add ("/usr/lib/x86_64-linux-gnu/pkgconfig");
-
- if (pkg_var == null) return dirs.ToArray ();
-
- pkg_paths = pkg_var.Split (':');
-
- foreach (string dir in pkg_paths) {
- if (string.IsNullOrEmpty (dir))
- continue;
- string dirPath = System.IO.Path.GetFullPath (dir);
- if (!dirs.Contains (dirPath) && !string.IsNullOrEmpty (dir)) {
- dirs.Add (dir);
- }
- }
-
- return dirs.ToArray ();
- }
-
- private void OnOkButtonClick (object sender, EventArgs e)
- {
- // Use this instead of clear, since clear seems to not update the packages tree
- while (project.Packages.Count > 0) {
- project.Packages.RemoveAt (0);
- }
-
- project.Packages.AddRange (selectedPackages);
-
- Destroy ();
- }
-
- private void OnCancelButtonClick (object sender, EventArgs e)
- {
- Destroy ();
- }
-
- private void OnRemoveButtonClick (object sender, EventArgs e)
- {
- Gtk.TreeIter iter;
-
- selectedPackageTreeView.Selection.GetSelected (out iter);
-
- if (!selectedPackageListStore.IterIsValid (iter)) return;
-
- string package = (string)selectedPackageListStore.GetValue (iter, SelectedPackageNameID);
- bool isProject = false;
-
- foreach (Package p in selectedPackages) {
- if (p.Name == package) {
- isProject = p.IsProject;
- selectedPackages.Remove (p);
- break;
- }
- }
-
- selectedPackageListStore.Remove (ref iter);
-
- if (!isProject) {
- Gtk.TreeIter search_iter;
- bool has_elem = normalPackageListStore.GetIterFirst (out search_iter);
-
- if (has_elem) {
- while (true) {
- string current = (string)normalPackageListStore.GetValue (search_iter, NormalPackageNameID);
-
- if (current.Equals (package)) {
- normalPackageListStore.SetValue (search_iter, NormalPackageToggleID, false);
- break;
- }
-
- if (!normalPackageListStore.IterNext (ref search_iter))
- break;
- }
- }
- } else {
- Gtk.TreeIter search_iter;
- bool has_elem = projectPackageListStore.GetIterFirst (out search_iter);
-
- if (has_elem) {
- while (true) {
- string current = (string)projectPackageListStore.GetValue (search_iter, ProjectPackageNameID);
-
- if (current.Equals (package)) {
- projectPackageListStore.SetValue (search_iter, ProjectPackageToggleID, false);
- break;
- }
-
- if (!projectPackageListStore.IterNext (ref search_iter))
- break;
- }
- }
- }
- }
-
- private void OnNormalPackageToggled (object sender, Gtk.ToggledArgs args)
- {
- Gtk.TreeIter iter;
- bool old = true;
- string name;
- string version;
-
- if (normalPackageListStore.GetIter (out iter, new Gtk.TreePath (args.Path))) {
- old = (bool)normalPackageListStore.GetValue (iter, NormalPackageToggleID);
- normalPackageListStore.SetValue (iter, NormalPackageToggleID, !old);
- }
-
- name = (string)normalPackageListStore.GetValue (iter, NormalPackageNameID);
- version = (string)normalPackageListStore.GetValue(iter, NormalPackageVersionID);
-
- if (old == false) {
- selectedPackageListStore.AppendValues (name, version);
-
- foreach (Package package in packages) {
- if (package.Name == name && package.Version == version) {
- selectedPackages.Add (package);
- break;
- }
- }
-
- } else {
- Gtk.TreeIter search_iter;
- bool has_elem = selectedPackageListStore.GetIterFirst (out search_iter);
-
- if (has_elem) {
- while (true) {
- string current = (string)selectedPackageListStore.GetValue (search_iter, SelectedPackageNameID);
-
- if (current.Equals (name)) {
- selectedPackageListStore.Remove (ref search_iter);
- foreach (Package p in selectedPackages) {
- if (p.Name == name) {
- selectedPackages.Remove (p);
- break;
- }
- }
-
- break;
- }
-
- if (!selectedPackageListStore.IterNext (ref search_iter))
- break;
- }
- }
- }
- }
-
- private void OnProjectPackageToggled (object sender, Gtk.ToggledArgs args)
- {
- Gtk.TreeIter iter;
- bool old = true;
- string name;
- string version;
-
- if (projectPackageListStore.GetIter (out iter, new Gtk.TreePath (args.Path))) {
- old = (bool)projectPackageListStore.GetValue (iter, ProjectPackageToggleID);
- projectPackageListStore.SetValue (iter, ProjectPackageToggleID, !old);
- }
-
- name = (string)projectPackageListStore.GetValue (iter, ProjectPackageNameID);
- version = (string)projectPackageListStore.GetValue(iter, ProjectPackageVersionID);
-
- if (old == false) {
- selectedPackageListStore.AppendValues (name, version);
-
- foreach (Package p in packagesOfProjects) {
- if (p.Name == name) {
- selectedPackages.Add (p);
- break;
- }
- }
- } else {
- Gtk.TreeIter search_iter;
- bool has_elem = selectedPackageListStore.GetIterFirst (out search_iter);
-
- if (has_elem)
- {
- while (true) {
- string current = (string)selectedPackageListStore.GetValue (search_iter, SelectedPackageNameID);
-
- if (current.Equals (name)) {
- selectedPackageListStore.Remove (ref search_iter);
- foreach (Package p in selectedPackages) {
- if (p.Name == name) {
- selectedPackages.Remove (p);
- break;
- }
- }
-
- break;
- }
-
- if (!selectedPackageListStore.IterNext (ref search_iter))
- break;
- }
- }
- }
- }
-
- private bool IsValidPackage (string package)
- {
- bool valid = false;
- try {
- using (StreamReader reader = new StreamReader (package)) {
- string line;
-
- while ((line = reader.ReadLine ()) != null) {
- if (line.StartsWith ("Libs:", true, null) && line.Contains (" -l")) {
- valid = true;
- break;
- }
- }
- }
- } catch {
- // Invalid file, permission error, broken symlink
- }
-
- return valid;
- }
-
- int NormalPackageCompareNodes (Gtk.TreeModel model, Gtk.TreeIter a, Gtk.TreeIter b)
- {
- string name1 = (string)model.GetValue (a, NormalPackageNameID);
- string name2 = (string)model.GetValue (b, NormalPackageNameID);
- return string.Compare (name1, name2, true);
- }
-
- int ProjectPackageCompareNodes (Gtk.TreeModel model, Gtk.TreeIter a, Gtk.TreeIter b)
- {
- string name1 = (string)model.GetValue (a, ProjectPackageNameID);
- string name2 = (string)model.GetValue (b, ProjectPackageNameID);
- return string.Compare (name1, name2, true);
- }
-
- int SelectedPackageCompareNodes (Gtk.TreeModel model, Gtk.TreeIter a, Gtk.TreeIter b)
- {
- string name1 = (string)model.GetValue (a, SelectedPackageNameID);
- string name2 = (string)model.GetValue (b, SelectedPackageNameID);
- return string.Compare (name1, name2, true);
- }
-
- protected virtual void OnSelectedPackagesTreeViewCursorChanged (object sender, System.EventArgs e)
- {
- removeButton.Sensitive = true;
- }
-
- protected virtual void OnRemoveButtonClicked (object sender, System.EventArgs e)
- {
- removeButton.Sensitive = false;
- }
-
- protected virtual void OnDetailsButtonClicked (object sender, System.EventArgs e)
- {
- Gtk.TreeIter iter;
- Gtk.Widget active_tab = notebook1.Children [notebook1.Page];
- string tab_label = notebook1.GetTabLabelText (active_tab);
- string name = string.Empty;
- string version = string.Empty;
- Package package = null;
-
- if (tab_label == "System Packages") {
- normalPackageTreeView.Selection.GetSelected (out iter);
- name = (string)normalPackageListStore.GetValue (iter, NormalPackageNameID);
- version = (string)normalPackageListStore.GetValue (iter, NormalPackageVersionID);
- } else if (tab_label == "Project Packages") {
- projectPackageTreeView.Selection.GetSelected (out iter);
- name = (string)projectPackageListStore.GetValue (iter, ProjectPackageNameID);
- version = (string)projectPackageListStore.GetValue (iter, ProjectPackageVersionID);
- } else {
- return;
- }
-
- foreach (Package p in packages) {
- if (p.Name == name && p.Version == version) {
- package = p;
- break;
- }
- }
-
- if (package == null)
- return;
-
- PackageDetails details = new PackageDetails (package);
- details.Modal = true;
- details.Show ();
- }
-
- protected virtual void OnNonSelectedPackageCursorChanged (object o, EventArgs e)
- {
- Gtk.TreeIter iter;
- Gtk.Widget active_tab = notebook1.Children [notebook1.Page];
- Gtk.Widget active_label = notebook1.GetTabLabel (active_tab);
-
- bool sensitive = false;
-
- if (active_label == this.labelSystemPackages) {
- normalPackageTreeView.Selection.GetSelected (out iter);
- if (normalPackageListStore.IterIsValid (iter))
- sensitive = true;
- } else if (active_label == this.labelProjectPackages) {
- projectPackageTreeView.Selection.GetSelected (out iter);
- if (projectPackageListStore.IterIsValid (iter))
- sensitive = true;
- } else {
- return;
- }
-
- detailsButton.Sensitive = sensitive;
- }
-
- protected virtual void OnNotebook1SwitchPage (object o, Gtk.SwitchPageArgs args)
- {
- Gtk.TreeIter iter;
- Gtk.Widget active_tab = notebook1.Children [notebook1.Page];
-
- switch(notebook1.GetTabLabelText (active_tab))
- {
- case "System Packages":
- normalPackageTreeView.Selection.GetSelected (out iter);
- detailsButton.Sensitive = normalPackageListStore.IterIsValid (iter);
- break;
-
- case "Project Packages":
- projectPackageTreeView.Selection.GetSelected (out iter);
- detailsButton.Sensitive = projectPackageListStore.IterIsValid (iter);
- break;
- }
- }
- }
-}
diff --git a/main/src/addins/CBinding/Gui/GeneralOptionsPanel.cs b/main/src/addins/CBinding/Gui/GeneralOptionsPanel.cs
deleted file mode 100644
index 5187231f59..0000000000
--- a/main/src/addins/CBinding/Gui/GeneralOptionsPanel.cs
+++ /dev/null
@@ -1,198 +0,0 @@
-//
-// GeneralOptionsPanel.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-
-using Mono.Addins;
-
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Gui.Dialogs;
-using MonoDevelop.Components;
-
-namespace CBinding
-{
- [System.ComponentModel.Category("MonoDevelop.CBinding")]
- [System.ComponentModel.ToolboxItem(true)]
- public partial class GeneralOptionsPanel : Gtk.Bin
- {
- ICompiler default_c_compiler;
- List<ICompiler> c_compilers = new List<ICompiler> ();
-
- ICompiler default_cpp_compiler;
- List<ICompiler> cpp_compilers = new List<ICompiler> ();
-
- public GeneralOptionsPanel ()
- {
- this.Build ();
-
- object[] compilers = AddinManager.GetExtensionObjects ("/CBinding/Compilers");
-
- foreach (ICompiler compiler in compilers) {
- if (compiler.Language == Language.C) {
- c_compilers.Add (compiler);
- } else if (compiler.Language == Language.CPP) {
- cpp_compilers.Add (compiler);
- }
- }
-
- foreach (ICompiler compiler in c_compilers)
- cCombo.AppendText (compiler.Name);
-
- foreach (ICompiler compiler in cpp_compilers)
- cppCombo.AppendText (compiler.Name);
-
- string c_compiler = PropertyService.Get<string> ("CBinding.DefaultCCompiler", new GccCompiler ().Name);
- string cpp_compiler = PropertyService.Get<string> ("CBinding.DefaultCppCompiler", new GppCompiler ().Name);
- ctagsEntry.Text = PropertyService.Get<string> ("CBinding.CTagsExecutable", "ctags");
- parseSystemTagsCheck.Active = PropertyService.Get<bool> ("CBinding.ParseSystemTags", true);
- parseLocalVariablesCheck.Active = PropertyService.Get<bool> ("CBinding.ParseLocalVariables", false);
-
- foreach (ICompiler compiler in c_compilers) {
- if (compiler.Name == c_compiler) {
- default_c_compiler = compiler;
- }
- }
-
- if (default_c_compiler == null)
- default_c_compiler = new GccCompiler ();
-
- foreach (ICompiler compiler in cpp_compilers) {
- if (compiler.Name == cpp_compiler) {
- default_cpp_compiler = compiler;
- }
- }
-
- if (default_cpp_compiler == null)
- default_cpp_compiler = new GppCompiler ();
-
- int active;
- Gtk.TreeIter iter;
- Gtk.ListStore store;
-
- active = 0;
- store = (Gtk.ListStore)cCombo.Model;
- store.GetIterFirst (out iter);
-
- while (store.IterIsValid (iter)) {
- if ((string)store.GetValue (iter, 0) == default_c_compiler.Name) {
- break;
- }
- store.IterNext (ref iter);
- active++;
- }
-
- cCombo.Active = active;
-
- active = 0;
- store = (Gtk.ListStore)cppCombo.Model;
- store.GetIterFirst (out iter);
-
- while (store.IterIsValid (iter)) {
- if ((string)store.GetValue (iter, 0) == default_cpp_compiler.Name) {
- break;
- }
- store.IterNext (ref iter);
- active++;
- }
-
- cppCombo.Active = active;
- }
-
- public bool Store ()
- {
- PropertyService.Set ("CBinding.DefaultCCompiler", default_c_compiler.Name);
- PropertyService.Set ("CBinding.DefaultCppCompiler", default_cpp_compiler.Name);
- PropertyService.Set ("CBinding.CTagsExecutable", ctagsEntry.Text.Trim ());
- PropertyService.Set ("CBinding.ParseSystemTags", parseSystemTagsCheck.Active);
- PropertyService.Set ("CBinding.ParseLocalVariables", parseLocalVariablesCheck.Active);
- PropertyService.SaveProperties ();
- try {
- // Flush cached system tags, which are ctags-version-specific
- System.IO.Directory.Delete (Parser.CTagsManager.SystemTagsDirectory);
- System.IO.Directory.CreateDirectory (Parser.CTagsManager.SystemTagsDirectory);
- } catch {
- }
- return true;
- }
-
- protected virtual void OnCComboChanged (object sender, System.EventArgs e)
- {
- string activeCompiler = cCombo.ActiveText;
-
- foreach (ICompiler compiler in c_compilers) {
- if (compiler.Name == activeCompiler) {
- default_c_compiler = compiler;
- }
- }
-
- if (default_c_compiler == null)
- default_c_compiler = new GccCompiler ();
- }
-
- protected virtual void OnCppComboChanged (object sender, System.EventArgs e)
- {
- string activeCompiler = cppCombo.ActiveText;
-
- foreach (ICompiler compiler in cpp_compilers) {
- if (compiler.Name == activeCompiler) {
- default_cpp_compiler = compiler;
- }
- }
-
- if (default_cpp_compiler == null)
- default_cpp_compiler = new GppCompiler ();
- }
-
- protected virtual void OnCtagsBrowseClicked (object sender, System.EventArgs e)
- {
- OpenFileDialog dialog = new OpenFileDialog (GettextCatalog.GetString ("Choose ctags executable"), FileChooserAction.Open);
- if (dialog.Run ())
- ctagsEntry.Text = dialog.SelectedFile;
- }
- }
-
- public class GeneralOptionsPanelBinding : OptionsPanel
- {
- private GeneralOptionsPanel panel;
-
- public override Gtk.Widget CreatePanelWidget ()
- {
- panel = new GeneralOptionsPanel ();
- return panel;
- }
-
- public override void ApplyChanges ()
- {
- panel.Store ();
- }
- }
-}
diff --git a/main/src/addins/CBinding/Gui/OutputOptionsPanel.cs b/main/src/addins/CBinding/Gui/OutputOptionsPanel.cs
deleted file mode 100644
index cfa9fead06..0000000000
--- a/main/src/addins/CBinding/Gui/OutputOptionsPanel.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-//
-// OutputOptionsPanel.cs: configure output options
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using Mono.Addins;
-
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Projects;
-using MonoDevelop.Ide.Gui.Dialogs;
-
-namespace CBinding
-{
- public partial class OutputOptionsPanel : Gtk.Bin
- {
- private CProjectConfiguration configuration;
-
- public OutputOptionsPanel ()
- {
- this.Build ();
- table1.RowSpacing = 3;
- }
-
- public void Load (CProjectConfiguration configuration)
- {
- this.configuration = configuration;
-
- outputNameTextEntry.Text = configuration.Output;
- outputEntry.Path = configuration.OutputDirectory;
- parametersTextEntry.Text = configuration.CommandLineParameters;
-
- if (externalConsoleCheckbox.Active)
- pauseCheckbox.Sensitive = true;
-
- externalConsoleCheckbox.Active = configuration.ExternalConsole;
- pauseCheckbox.Active = configuration.PauseConsoleOutput;
- }
-
- public void Store ()
- {
- if (configuration == null)
- return;
-
- if (outputNameTextEntry != null && outputNameTextEntry.Text.Length > 0)
- configuration.Output = outputNameTextEntry.Text.Trim ();
-
- var newPath = outputEntry.Path.Trim ();
- if (!string.IsNullOrEmpty (newPath))
- configuration.OutputDirectory = newPath;
-
- if (parametersTextEntry.Text != null && parametersTextEntry.Text.Length > 0)
- configuration.CommandLineParameters = parametersTextEntry.Text.Trim ();
-
- configuration.ExternalConsole = externalConsoleCheckbox.Active;
- configuration.PauseConsoleOutput = pauseCheckbox.Active;
- }
-
- protected virtual void OnExternalConsoleCheckboxClicked (object sender, System.EventArgs e)
- {
- pauseCheckbox.Sensitive = externalConsoleCheckbox.Active;
- }
- }
-
- public class OutputOptionsPanelBinding : MultiConfigItemOptionsPanel
- {
- private OutputOptionsPanel panel;
-
- public override Gtk.Widget CreatePanelWidget ()
- {
- return panel = new OutputOptionsPanel ();
- }
-
- public override void LoadConfigData ()
- {
- panel.Load ((CProjectConfiguration) CurrentConfiguration);
- }
-
- public override void ApplyChanges ()
- {
- panel.Store ();
- }
- }
-}
diff --git a/main/src/addins/CBinding/Gui/PackageDetails.cs b/main/src/addins/CBinding/Gui/PackageDetails.cs
deleted file mode 100644
index c35b7f8b62..0000000000
--- a/main/src/addins/CBinding/Gui/PackageDetails.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-//
-// PackageDetails.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace CBinding
-{
- public partial class PackageDetails : Gtk.Dialog
- {
- Gtk.ListStore requiresStore = new Gtk.ListStore (typeof(string));
- Gtk.ListStore libPathsStore = new Gtk.ListStore (typeof(string));
- Gtk.ListStore libsStore = new Gtk.ListStore (typeof(string));
- Gtk.ListStore cflagsStore = new Gtk.ListStore (typeof(string));
-
- public PackageDetails (Package package)
- {
- this.Build();
-
- package.ParsePackage ();
-
- Gtk.CellRendererText textRenderer = new Gtk.CellRendererText ();
-
- requiresTreeView.Model = requiresStore;
- requiresTreeView.AppendColumn ("Requires", textRenderer, "text", 0);
- requiresTreeView.HeadersVisible = false;
-
- libPathsTreeView.Model = libPathsStore;
- libPathsTreeView.AppendColumn ("LibPaths", textRenderer, "text", 0);
- libPathsTreeView.HeadersVisible = false;
-
- libsTreeView.Model = libsStore;
- libsTreeView.AppendColumn ("Libs", textRenderer, "text", 0);
- libsTreeView.HeadersVisible = false;
-
- cflagsTreeView.Model = cflagsStore;
- cflagsTreeView.AppendColumn ("CFlags", textRenderer, "text", 0);
- cflagsTreeView.HeadersVisible = false;
-
- nameLabel.Text = package.Name;
- descriptionLabel.Text = package.Description;
- versionLabel.Text = package.Version;
-
- foreach (string req in package.Requires)
- requiresStore.AppendValues (req);
-
- foreach (string libpath in package.LibPaths)
- libPathsStore.AppendValues (libpath);
-
- foreach (string lib in package.Libs)
- libsStore.AppendValues (lib);
-
- foreach (string cflag in package.CFlags)
- cflagsStore.AppendValues (cflag);
- }
-
- protected virtual void OnButtonOkClicked (object sender, System.EventArgs e)
- {
- Destroy ();
- }
- }
-}
diff --git a/main/src/addins/CBinding/Navigation/ClassNodeBuilder.cs b/main/src/addins/CBinding/Navigation/ClassNodeBuilder.cs
deleted file mode 100644
index 157ad64978..0000000000
--- a/main/src/addins/CBinding/Navigation/ClassNodeBuilder.cs
+++ /dev/null
@@ -1,140 +0,0 @@
-//
-// FunctionNodeBuilder.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using Mono.Addins;
-
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Pads;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui.Components;
-
-using CBinding.Parser;
-
-namespace CBinding.Navigation
-{
- public class ClassNodeBuilder : TypeNodeBuilder
- {
- public override Type NodeDataType {
- get { return typeof(Class); }
- }
-
- public override Type CommandHandlerType {
- get { return typeof(LanguageItemCommandHandler); }
- }
-
- public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
- {
- return ((Class)dataObject).Name;
- }
-
- public override void BuildNode (ITreeBuilder treeBuilder,
- object dataObject,
- NodeInfo nodeInfo)
- {
- Class c = (Class)dataObject;
-
- nodeInfo.Label = c.Name;
-
- switch (c.Access)
- {
- case AccessModifier.Public:
- nodeInfo.Icon = Context.GetIcon (Stock.Class);
- break;
- case AccessModifier.Protected:
- nodeInfo.Icon = Context.GetIcon (Stock.ProtectedClass);
- break;
- case AccessModifier.Private:
- nodeInfo.Icon = Context.GetIcon (Stock.PrivateClass);
- break;
- }
- }
-
- public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
- {
- CProject p = treeBuilder.GetParentDataItem (typeof(CProject), false) as CProject;
-
- if (p == null) return;
-
- ProjectInformation info = ProjectInformationManager.Instance.Get (p);
-
- bool publicOnly = treeBuilder.Options["PublicApiOnly"];
- Class thisClass = (Class)dataObject;
-
- // Classes
- foreach (Class c in info.Classes)
- if (c.Parent != null && c.Parent.Equals (thisClass) && (!publicOnly || c.Access == AccessModifier.Public))
- treeBuilder.AddChild (c);
-
- // Structures
- foreach (Structure s in info.Structures)
- if (s.Parent != null && s.Parent.Equals (thisClass) && (!publicOnly || s.Access == AccessModifier.Public))
- treeBuilder.AddChild (s);
-
- // Unions
- foreach (Union u in info.Unions)
- if (u.Parent != null && u.Parent.Equals (thisClass) && (!publicOnly || u.Access == AccessModifier.Public))
- treeBuilder.AddChild (u);
-
- // Enumerations
- foreach (Enumeration e in info.Enumerations)
- if (e.Parent != null && e.Parent.Equals (thisClass) && (!publicOnly || e.Access == AccessModifier.Public))
- treeBuilder.AddChild (e);
-
- // Typedefs
- foreach (Typedef t in info.Typedefs)
- if (t.Parent != null && t.Parent.Equals (thisClass) && (!publicOnly || t.Access == AccessModifier.Public))
- treeBuilder.AddChild (t);
-
- // Functions
- foreach (Function f in info.Functions)
- if (f.Parent != null && f.Parent.Equals (thisClass) && (!publicOnly || f.Access == AccessModifier.Public))
- treeBuilder.AddChild (f);
-
- // Members
- foreach (Member m in info.Members)
- if (m.Parent != null && m.Parent.Equals (thisClass) && (!publicOnly || m.Access == AccessModifier.Public))
- treeBuilder.AddChild (m);
- }
-
- public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
- {
- return true;
- }
-
- public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
- {
- return -1;
- }
- }
-}
diff --git a/main/src/addins/CBinding/Navigation/ClassPadEventArgs.cs b/main/src/addins/CBinding/Navigation/ClassPadEventArgs.cs
deleted file mode 100644
index f878c2c69d..0000000000
--- a/main/src/addins/CBinding/Navigation/ClassPadEventArgs.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// ClassPadEventHandler.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using MonoDevelop.Projects;
-
-namespace CBinding.Navigation
-{
- public delegate void ClassPadEventHandler (ClassPadEventArgs e);
-
- public class ClassPadEventArgs : EventArgs
- {
- private Project project;
-
- public ClassPadEventArgs (Project project)
- {
- this.project = project;
- }
-
- public Project Project {
- get { return project; }
- }
- }
-}
diff --git a/main/src/addins/CBinding/Navigation/EnumerationNodeBuilder.cs b/main/src/addins/CBinding/Navigation/EnumerationNodeBuilder.cs
deleted file mode 100644
index 65836cea2f..0000000000
--- a/main/src/addins/CBinding/Navigation/EnumerationNodeBuilder.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-//
-// EnumerationNodeBuilder.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using Mono.Addins;
-
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Pads;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui.Components;
-
-using CBinding.Parser;
-
-namespace CBinding.Navigation
-{
- public class EnumerationNodeBuilder : TypeNodeBuilder
- {
- public override Type NodeDataType {
- get { return typeof(Enumeration); }
- }
-
- public override Type CommandHandlerType {
- get { return typeof(LanguageItemCommandHandler); }
- }
-
- public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
- {
- return ((Enumeration)dataObject).Name;
- }
-
- public override void BuildNode (ITreeBuilder treeBuilder,
- object dataObject,
- NodeInfo nodeInfo)
- {
- Enumeration e = (Enumeration)dataObject;
-
- nodeInfo.Label = e.Name;
-
- switch (e.Access)
- {
- case AccessModifier.Public:
- nodeInfo.Icon = Context.GetIcon (Stock.Enum);
- break;
- case AccessModifier.Protected:
- nodeInfo.Icon = Context.GetIcon (Stock.ProtectedEnum);
- break;
- case AccessModifier.Private:
- nodeInfo.Icon = Context.GetIcon (Stock.PrivateEnum);
- break;
- }
- }
-
- public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
- {
- CProject p = treeBuilder.GetParentDataItem (typeof(CProject), false) as CProject;
-
- if (p == null) return;
-
- ProjectInformation info = ProjectInformationManager.Instance.Get (p);
-
- Enumeration thisEnumeration = (Enumeration)dataObject;
-
- // Enumerators
- foreach (Enumerator e in info.Enumerators)
- if (e.Parent != null && e.Parent.Equals (thisEnumeration))
- treeBuilder.AddChild (e);
- }
-
- public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
- {
- return true;
- }
-
- public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
- {
- if (otherNode.DataItem is Structure)
- return 1;
- else
- return -1;
- }
- }
-}
-
diff --git a/main/src/addins/CBinding/Navigation/EnumeratorNodeBuilder.cs b/main/src/addins/CBinding/Navigation/EnumeratorNodeBuilder.cs
deleted file mode 100644
index 697d405feb..0000000000
--- a/main/src/addins/CBinding/Navigation/EnumeratorNodeBuilder.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// EnumeratorNodeBuilder.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using Mono.Addins;
-
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Pads;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui.Components;
-
-using CBinding.Parser;
-
-namespace CBinding.Navigation
-{
- public class EnumeratorNodeBuilder : TypeNodeBuilder
- {
- public override Type NodeDataType {
- get { return typeof(Enumerator); }
- }
-
- public override Type CommandHandlerType {
- get { return typeof(LanguageItemCommandHandler); }
- }
-
- public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
- {
- return ((Enumerator)dataObject).Name;
- }
-
- public override void BuildNode (ITreeBuilder treeBuilder,
- object dataObject,
- NodeInfo nodeInfo)
- {
- Enumerator e = (Enumerator)dataObject;
-
- nodeInfo.Label = e.Name;
- nodeInfo.Icon = Context.GetIcon (Stock.Literal);
- }
-
- public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
- {
- return false;
- }
-
- public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
- {
- return DefaultSort;
- }
- }
-} \ No newline at end of file
diff --git a/main/src/addins/CBinding/Navigation/FunctionNodeBuilder.cs b/main/src/addins/CBinding/Navigation/FunctionNodeBuilder.cs
deleted file mode 100644
index a19d24cd50..0000000000
--- a/main/src/addins/CBinding/Navigation/FunctionNodeBuilder.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// FunctionNodeBuilder.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-using Mono.Addins;
-
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Pads;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui.Components;
-
-using CBinding.Parser;
-
-namespace CBinding.Navigation
-{
- public class FunctionNodeBuilder : TypeNodeBuilder
- {
- public override Type NodeDataType {
- get { return typeof(Function); }
- }
-
- public override Type CommandHandlerType {
- get { return typeof(LanguageItemCommandHandler); }
- }
-
- public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
- {
- return ((Function)dataObject).Name;
- }
-
- public override void BuildNode (ITreeBuilder treeBuilder,
- object dataObject,
- NodeInfo nodeInfo)
- {
- Function f = (Function)dataObject;
-
- nodeInfo.Label = f.Name;
-
- switch (f.Access)
- {
- case AccessModifier.Public:
- nodeInfo.Icon = Context.GetIcon (Stock.Method);
- break;
- case AccessModifier.Protected:
- nodeInfo.Icon = Context.GetIcon (Stock.ProtectedMethod);
- break;
- case AccessModifier.Private:
- nodeInfo.Icon = Context.GetIcon (Stock.PrivateMethod);
- break;
- }
- }
-
- public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
- {
- return false;
- }
-
- public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
- {
- if (otherNode.DataItem is Typedef)
- return 1;
- else
- return -1;
- }
- }
-}
diff --git a/main/src/addins/CBinding/Navigation/GlobalsNodeBuilder.cs b/main/src/addins/CBinding/Navigation/GlobalsNodeBuilder.cs
deleted file mode 100644
index 4b74bea219..0000000000
--- a/main/src/addins/CBinding/Navigation/GlobalsNodeBuilder.cs
+++ /dev/null
@@ -1,136 +0,0 @@
-//
-// GlobalsNodeBuilder.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using Mono.Addins;
-
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Pads;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui.Components;
-
-using CBinding.Parser;
-
-namespace CBinding.Navigation
-{
- public class Globals
- {
- private Project project;
-
- public Globals (Project project)
- {
- this.project = project;
- }
-
- public Project Project {
- get { return project; }
- }
- }
-
- public class GlobalsNodeBuilder : TypeNodeBuilder
- {
- public override Type NodeDataType {
- get { return typeof(Globals); }
- }
-
- public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
- {
- return "Globals";
- }
-
- public override void BuildNode (ITreeBuilder treeBuilder,
- object dataObject,
- NodeInfo nodeInfo)
- {
- nodeInfo.Label = "Globals";
- nodeInfo.Icon = Context.GetIcon (Stock.OpenFolder);
- nodeInfo.ClosedIcon = Context.GetIcon (Stock.ClosedFolder);
- }
-
- public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
- {
- CProject p = treeBuilder.GetParentDataItem (typeof(CProject), false) as CProject;
-
- if (p == null) return;
-
- ProjectInformation info = ProjectInformationManager.Instance.Get (p);
-
- // Classes
- foreach (Class c in info.Classes)
- if (c.Parent == null)
- treeBuilder.AddChild (c);
-
- // Structures
- foreach (Structure s in info.Structures)
- if (s.Parent == null)
- treeBuilder.AddChild (s);
-
- // Unions
- foreach (Union u in info.Unions)
- if (u.Parent == null)
- treeBuilder.AddChild (u);
-
- // Enumerations
- foreach (Enumeration e in info.Enumerations)
- if (e.Parent == null)
- treeBuilder.AddChild (e);
-
- // Typedefs
- foreach (Typedef t in info.Typedefs)
- if (t.Parent == null)
- treeBuilder.AddChild (t);
-
- // Functions
- foreach (Function f in info.Functions)
- if (f.Parent == null)
- treeBuilder.AddChild (f);
-
- // Variables
- foreach (Variable v in info.Variables)
- treeBuilder.AddChild (v);
- }
-
- public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
- {
- return true;
- }
-
- public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
- {
- if (otherNode.DataItem is Structure)
- return 1;
- else
- return -1;
- }
- }
-}
diff --git a/main/src/addins/CBinding/Navigation/LanguageItemCommandHandler.cs b/main/src/addins/CBinding/Navigation/LanguageItemCommandHandler.cs
deleted file mode 100644
index cddd0e13a7..0000000000
--- a/main/src/addins/CBinding/Navigation/LanguageItemCommandHandler.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// FunctionNodeBuilder.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Components;
-using CBinding.Parser;
-using MonoDevelop.Ide;
-
-namespace CBinding.Navigation
-{
- public class LanguageItemCommandHandler : NodeCommandHandler
- {
- public override void ActivateItem ()
- {
- LanguageItem item = (LanguageItem)CurrentNode.DataItem;
- Document doc = IdeApp.Workbench.OpenDocument (item.File);
- //bool isMacro = item is Macro;
-
- doc.Editor.SetCaretTo ((int)item.Line, 0); // TODO: get column?
- }
- }
-}
diff --git a/main/src/addins/CBinding/Navigation/LanguageItemEventArgs.cs b/main/src/addins/CBinding/Navigation/LanguageItemEventArgs.cs
deleted file mode 100644
index 52733c5268..0000000000
--- a/main/src/addins/CBinding/Navigation/LanguageItemEventArgs.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// LanguageItemEventArgs.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using CBinding.Parser;
-
-namespace CBinding.Navigation
-{
- public delegate void LanguageItemEventHandler (object sender, LanguageItemEventArgs e);
-
- public class LanguageItemEventArgs : EventArgs
- {
- LanguageItem item;
-
- public LanguageItemEventArgs (LanguageItem item)
- {
- this.item = item;
- }
-
- public LanguageItem Item {
- get { return item; }
- }
- }
-}
diff --git a/main/src/addins/CBinding/Navigation/MacroDefinitionsNodeBuilder.cs b/main/src/addins/CBinding/Navigation/MacroDefinitionsNodeBuilder.cs
deleted file mode 100644
index 458ae14ced..0000000000
--- a/main/src/addins/CBinding/Navigation/MacroDefinitionsNodeBuilder.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// MacroDefinitionsNodeBuilder.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using Mono.Addins;
-
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Pads;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui.Components;
-
-using CBinding.Parser;
-
-namespace CBinding.Navigation
-{
- public class MacroDefinitions
- {
- private Project project;
-
- public MacroDefinitions (Project project)
- {
- this.project = project;
- }
-
- public Project Project {
- get { return project; }
- }
- }
-
- public class MacroDefinitionsNodeBuilder : TypeNodeBuilder
- {
- public override Type NodeDataType {
- get { return typeof(MacroDefinitions); }
- }
-
- public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
- {
- return "Macro Definitions";
- }
-
- public override void BuildNode (ITreeBuilder treeBuilder,
- object dataObject,
- NodeInfo nodeInfo)
- {
- nodeInfo.Label = "Macro Definitions";
- nodeInfo.Icon = Context.GetIcon (Stock.OpenFolder);
- nodeInfo.ClosedIcon = Context.GetIcon (Stock.ClosedFolder);
- }
-
- public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
- {
- CProject p = treeBuilder.GetParentDataItem (typeof(CProject), false) as CProject;
-
- if (p == null) return;
-
- ProjectInformation info = ProjectInformationManager.Instance.Get (p);
-
- foreach (Macro m in info.Macros)
- treeBuilder.AddChild (m);
- }
-
- public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
- {
- return true;
- }
-
- public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
- {
- if (otherNode.DataItem is Globals)
- return 1;
- else
- return -1;
- }
- }
-} \ No newline at end of file
diff --git a/main/src/addins/CBinding/Navigation/MacroNodeBuilder.cs b/main/src/addins/CBinding/Navigation/MacroNodeBuilder.cs
deleted file mode 100644
index 7dcf065320..0000000000
--- a/main/src/addins/CBinding/Navigation/MacroNodeBuilder.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// MacroNodeBuilder.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-using Mono.Addins;
-
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Pads;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui.Components;
-
-using CBinding.Parser;
-
-namespace CBinding.Navigation
-{
- public class MacroNodeBuilder : TypeNodeBuilder
- {
- public override Type NodeDataType {
- get { return typeof(Macro); }
- }
-
- public override Type CommandHandlerType {
- get { return typeof(LanguageItemCommandHandler); }
- }
-
- public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
- {
- return ((Macro)dataObject).Name;
- }
-
- public override void BuildNode (ITreeBuilder treeBuilder,
- object dataObject,
- NodeInfo nodeInfo)
- {
- Macro m = (Macro)dataObject;
-
- nodeInfo.Label = m.Name;
- nodeInfo.Icon = Context.GetIcon (Stock.Literal);
- }
-
- public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
- {
- return false;
- }
- }
-} \ No newline at end of file
diff --git a/main/src/addins/CBinding/Navigation/MemberNodeBuilder.cs b/main/src/addins/CBinding/Navigation/MemberNodeBuilder.cs
deleted file mode 100644
index 51821b2408..0000000000
--- a/main/src/addins/CBinding/Navigation/MemberNodeBuilder.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// FunctionNodeBuilder.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-using Mono.Addins;
-
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Pads;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui.Components;
-
-using CBinding.Parser;
-
-namespace CBinding.Navigation
-{
- public class MemberNodeBuilder : TypeNodeBuilder
- {
- public override Type NodeDataType {
- get { return typeof(Member); }
- }
-
- public override Type CommandHandlerType {
- get { return typeof(LanguageItemCommandHandler); }
- }
-
- public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
- {
- return ((Member)dataObject).Name;
- }
-
- public override void BuildNode (ITreeBuilder treeBuilder,
- object dataObject,
- NodeInfo nodeInfo)
- {
- Member m = (Member)dataObject;
-
- nodeInfo.Label = m.Name;
-
- switch (m.Access)
- {
- case AccessModifier.Public:
- nodeInfo.Icon = Context.GetIcon (Stock.Field);
- break;
- case AccessModifier.Protected:
- nodeInfo.Icon = Context.GetIcon (Stock.ProtectedField);
- break;
- case AccessModifier.Private:
- nodeInfo.Icon = Context.GetIcon (Stock.PrivateField);
- break;
- }
- }
-
- public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
- {
- return false;
- }
-
- public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
- {
- return 1;
- }
- }
-}
diff --git a/main/src/addins/CBinding/Navigation/NamespaceNodeBuilder.cs b/main/src/addins/CBinding/Navigation/NamespaceNodeBuilder.cs
deleted file mode 100644
index 2086a910f1..0000000000
--- a/main/src/addins/CBinding/Navigation/NamespaceNodeBuilder.cs
+++ /dev/null
@@ -1,132 +0,0 @@
-//
-// NamespaceNodeBuilder.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using Mono.Addins;
-
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Pads;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui.Components;
-
-using CBinding.Parser;
-
-namespace CBinding.Navigation
-{
- public class NamespaceNodeBuilder : TypeNodeBuilder
- {
- public override Type NodeDataType {
- get { return typeof(Namespace); }
- }
-
- public override Type CommandHandlerType {
- get { return typeof (LanguageItemCommandHandler); }
- }
-
- public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
- {
- if (thisNode.Options["NestedNamespaces"])
- return ((Namespace)dataObject).Name;
- else
- return ((Namespace)dataObject).FullName;
- }
-
- public override void BuildNode (ITreeBuilder treeBuilder,
- object dataObject,
- NodeInfo nodeInfo)
- {
- if (treeBuilder.Options["NestedNamespaces"])
- nodeInfo.Label = ((Namespace)dataObject).Name;
- else
- nodeInfo.Label = ((Namespace)dataObject).FullName;
-
- nodeInfo.Icon = Context.GetIcon (Stock.NameSpace);
- }
-
- public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
- {
- CProject p = treeBuilder.GetParentDataItem (typeof(CProject), false) as CProject;
-
- if (p == null) return;
-
- ProjectInformation info = ProjectInformationManager.Instance.Get (p);
-
- Namespace thisNamespace = ((Namespace)dataObject);
-
- // Namespaces
- if (treeBuilder.Options["NestedNamespaces"])
- foreach (Namespace n in info.Namespaces)
- if (n.Parent != null && n.Parent.Equals (thisNamespace))
- treeBuilder.AddChild (n);
-
- // Classes
- foreach (Class c in info.Classes)
- if (c.Parent != null && c.Parent.Equals (thisNamespace))
- treeBuilder.AddChild (c);
-
- // Structures
- foreach (Structure s in info.Structures)
- if (s.Parent != null && s.Parent.Equals (thisNamespace))
- treeBuilder.AddChild (s);
-
- // Unions
- foreach (Union u in info.Unions)
- if (u.Parent != null && u.Parent.Equals (thisNamespace))
- treeBuilder.AddChild (u);
-
- // Enumerations
- foreach (Enumeration e in info.Enumerations)
- if (e.Parent != null && e.Parent.Equals (thisNamespace))
- treeBuilder.AddChild (e);
-
- // Typedefs
- foreach (Typedef t in info.Typedefs)
- if (t.Parent != null && t.Parent.Equals (thisNamespace))
- treeBuilder.AddChild (t);
-
- // Functions
- foreach (Function f in info.Functions)
- if (f.Parent != null && f.Parent.Equals (thisNamespace))
- treeBuilder.AddChild (f);
- }
-
- public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
- {
- return true;
- }
-
- public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
- {
- return -1;
- }
- }
-}
diff --git a/main/src/addins/CBinding/Navigation/ProjectNodeBuilderExtension.cs b/main/src/addins/CBinding/Navigation/ProjectNodeBuilderExtension.cs
deleted file mode 100644
index 0022146b60..0000000000
--- a/main/src/addins/CBinding/Navigation/ProjectNodeBuilderExtension.cs
+++ /dev/null
@@ -1,181 +0,0 @@
-//
-// ProjectNodeBuilderExtension.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Core.Execution;
-using MonoDevelop.Core;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.Ide.Gui.Components;
-using CBinding;
-using CBinding.Parser;
-using MonoDevelop.Ide;
-
-namespace CBinding.Navigation
-{
- public class ProjectNodeBuilderExtension : NodeBuilderExtension
- {
- public ClassPadEventHandler finishedBuildingTreeHandler;
-
- public override bool CanBuildNode (Type dataType)
- {
- return typeof(CProject).IsAssignableFrom (dataType);
- }
-
- public override Type CommandHandlerType {
- get { return typeof(ProjectNodeBuilderExtensionHandler); }
- }
-
- protected override void Initialize ()
- {
- finishedBuildingTreeHandler = (ClassPadEventHandler)DispatchService.GuiDispatch (new ClassPadEventHandler (OnFinishedBuildingTree));
-
- TagDatabaseManager.Instance.FileUpdated += finishedBuildingTreeHandler;
- }
-
- public override void Dispose ()
- {
- TagDatabaseManager.Instance.FileUpdated -= finishedBuildingTreeHandler;
- }
-
- public static void CreatePadTree (object o)
- {
- CProject p = o as CProject;
- if (o == null) return;
-
- try {
- foreach (ProjectFile f in p.Files) {
- if (f.BuildAction == BuildAction.Compile)
- TagDatabaseManager.Instance.UpdateFileTags (p, f.Name);
- }
- } catch (IOException) {
- return;
- }
- }
-
- private bool check_ctags = false;
- private bool have_ctags = false;
-
- private void CheckForCtags ()
- {
- check_ctags = true;
- have_ctags = TagDatabaseManager.Instance.DepsInstalled;
- }
-
- public override void BuildNode (ITreeBuilder treeBuilder,
- object dataObject,
- NodeInfo nodeInfo)
- {
- if (!check_ctags)
- CheckForCtags ();
-
- CProject p = dataObject as CProject;
-
- if (p == null)
- return;
-
- if (!have_ctags) {
- nodeInfo.Label = string.Format ("{0} <span foreground='red' size='small'>(CTags not installed)</span>", p.Name);
- }
- }
-
-
- public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
- {
- CProject p = dataObject as CProject;
-
- if (p == null) return;
-
- bool nestedNamespaces = builder.Options["NestedNamespaces"];
-
- ProjectInformation info = ProjectInformationManager.Instance.Get (p);
-
- // Namespaces
- foreach (Namespace n in info.Namespaces) {
- if (nestedNamespaces) {
- if (n.Parent == null) {
- builder.AddChild (n);
- }
- } else {
- builder.AddChild (n);
- }
- }
-
- // Globals
- builder.AddChild (info.Globals);
-
- // Macro Definitions
- builder.AddChild (info.MacroDefinitions);
- }
-
- public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
- {
- return true;
- }
-
- private void OnFinishedBuildingTree (ClassPadEventArgs e)
- {
- ITreeBuilder builder = Context.GetTreeBuilder (e.Project);
- if (null != builder)
- builder.UpdateChildren ();
- }
- }
-
- public class ProjectNodeBuilderExtensionHandler : NodeCommandHandler
- {
-// public override void ActivateItem ()
-// {
-// CProject p = CurrentNode.DataItem as CProject;
-//
-// if (p == null) return;
-//
-// Thread builderThread = new Thread (new ParameterizedThreadStart (ProjectNodeBuilderExtension.CreatePadTree));
-// builderThread.Name = "PadBuilder";
-// builderThread.IsBackground = true;
-// builderThread.Start (p);
-// }
-
- [CommandHandler (CProjectCommands.UpdateClassPad)]
- public void UpdateClassPad ()
- {
- CProject p = CurrentNode.DataItem as CProject;
-
- if (p == null) return;
-
- foreach (ProjectFile f in p.Files) {
- if (f.BuildAction == BuildAction.Compile)
- TagDatabaseManager.Instance.UpdateFileTags (p, f.Name);
- }
- }
- }
-}
diff --git a/main/src/addins/CBinding/Navigation/StructureNodeBuilder.cs b/main/src/addins/CBinding/Navigation/StructureNodeBuilder.cs
deleted file mode 100644
index c5909841a3..0000000000
--- a/main/src/addins/CBinding/Navigation/StructureNodeBuilder.cs
+++ /dev/null
@@ -1,143 +0,0 @@
-//
-// StructureNodeBuilder.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-using Mono.Addins;
-
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Pads;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui.Components;
-
-using CBinding.Parser;
-
-namespace CBinding.Navigation
-{
- public class StructureNodeBuilder : TypeNodeBuilder
- {
- public override Type NodeDataType {
- get { return typeof(Structure); }
- }
-
- public override Type CommandHandlerType {
- get { return typeof(LanguageItemCommandHandler); }
- }
-
- public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
- {
- return ((Structure)dataObject).Name;
- }
-
- public override void BuildNode (ITreeBuilder treeBuilder,
- object dataObject,
- NodeInfo nodeInfo)
- {
- Structure s = (Structure)dataObject;
-
- nodeInfo.Label = s.Name;
-
- switch (s.Access)
- {
- case AccessModifier.Public:
- nodeInfo.Icon = Context.GetIcon (Stock.Struct);
- break;
- case AccessModifier.Protected:
- nodeInfo.Icon = Context.GetIcon (Stock.ProtectedStruct);
- break;
- case AccessModifier.Private:
- nodeInfo.Icon = Context.GetIcon (Stock.PrivateStruct);
- break;
- }
- }
-
- public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
- {
- CProject p = treeBuilder.GetParentDataItem (typeof(CProject), false) as CProject;
-
- if (p == null) return;
-
- bool publicOnly = treeBuilder.Options["PublicApiOnly"];
- ProjectInformation info = ProjectInformationManager.Instance.Get (p);
-
- Structure thisStruct = (Structure)dataObject;
-
- // Classes
- foreach (Class c in info.Classes)
- if (c.Parent != null && c.Parent.Equals (thisStruct) && (!publicOnly || c.Access == AccessModifier.Public))
- treeBuilder.AddChild (c);
-
- // Structures
- foreach (Structure s in info.Structures)
- if (s.Parent != null && s.Parent.Equals (thisStruct) && (!publicOnly || s.Access == AccessModifier.Public))
- treeBuilder.AddChild (s);
-
- // Unions
- foreach (Union u in info.Unions)
- if (u.Parent != null && u.Parent.Equals (thisStruct) && (!publicOnly || u.Access == AccessModifier.Public))
- treeBuilder.AddChild (u);
-
- // Enumerations
- foreach (Enumeration e in info.Enumerations)
- if (e.Parent != null && e.Parent.Equals (thisStruct) && (!publicOnly || e.Access == AccessModifier.Public))
- treeBuilder.AddChild (e);
-
- // Typedefs
- foreach (Typedef t in info.Typedefs)
- if (t.Parent != null && t.Parent.Equals (thisStruct) && (!publicOnly || t.Access == AccessModifier.Public))
- treeBuilder.AddChild (t);
-
- // Functions
- foreach (Function f in info.Functions)
- if (f.Parent != null && f.Parent.Equals (thisStruct) && (!publicOnly || f.Access == AccessModifier.Public))
- treeBuilder.AddChild (f);
-
- // Members
- foreach (Member m in info.Members)
- if (m.Parent != null && m.Parent.Equals (thisStruct) && (!publicOnly || m.Access == AccessModifier.Public))
- treeBuilder.AddChild (m);
- }
-
- public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
- {
- return true;
- }
-
- public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
- {
- if (otherNode.DataItem is Class)
- return 1;
- else
- return -1;
- }
- }
-}
diff --git a/main/src/addins/CBinding/Navigation/TypedefNodeBuilder.cs b/main/src/addins/CBinding/Navigation/TypedefNodeBuilder.cs
deleted file mode 100644
index d94ec9fbab..0000000000
--- a/main/src/addins/CBinding/Navigation/TypedefNodeBuilder.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// TypedefNodeBuilder.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-using Mono.Addins;
-
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Pads;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui.Components;
-
-using CBinding.Parser;
-
-namespace CBinding.Navigation
-{
- public class TypedefNodeBuilder : TypeNodeBuilder
- {
- public override Type NodeDataType {
- get { return typeof(Typedef); }
- }
-
- public override Type CommandHandlerType {
- get { return typeof(LanguageItemCommandHandler); }
- }
-
- public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
- {
- return ((Typedef)dataObject).Name;
- }
-
- public override void BuildNode (ITreeBuilder treeBuilder,
- object dataObject,
- NodeInfo nodeInfo)
- {
- Typedef t = (Typedef)dataObject;
-
- nodeInfo.Label = t.Name;
- nodeInfo.Icon = Context.GetIcon (Stock.Interface);
- }
-
- public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
- {
- return false;
- }
-
- public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
- {
- if (otherNode.DataItem is Enumeration)
- return 1;
- else
- return -1;
- }
- }
-}
diff --git a/main/src/addins/CBinding/Navigation/UnionNodeBuilder.cs b/main/src/addins/CBinding/Navigation/UnionNodeBuilder.cs
deleted file mode 100644
index d68b26ff61..0000000000
--- a/main/src/addins/CBinding/Navigation/UnionNodeBuilder.cs
+++ /dev/null
@@ -1,143 +0,0 @@
-//
-// UnionNodeBuilder.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Reflection;
-
-using Mono.Addins;
-
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Pads;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui.Components;
-
-using CBinding.Parser;
-
-namespace CBinding.Navigation
-{
- public class UnionNodeBuilder : TypeNodeBuilder
- {
- public override Type NodeDataType {
- get { return typeof(Union); }
- }
-
- public override Type CommandHandlerType {
- get { return typeof(LanguageItemCommandHandler); }
- }
-
- public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
- {
- return ((Union)dataObject).Name;
- }
-
- public override void BuildNode (ITreeBuilder treeBuilder,
- object dataObject,
- NodeInfo nodeInfo)
- {
- Union u = (Union)dataObject;
-
- nodeInfo.Label = u.Name;
-
- switch (u.Access)
- {
- case AccessModifier.Public:
- nodeInfo.Icon = Context.GetIcon ("md-union");
- break;
- case AccessModifier.Protected:
- nodeInfo.Icon = Context.GetIcon ("md-protected-union");
- break;
- case AccessModifier.Private:
- nodeInfo.Icon = Context.GetIcon ("md-private-union");
- break;
- }
- }
-
- public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
- {
- CProject p = treeBuilder.GetParentDataItem (typeof(CProject), false) as CProject;
-
- if (p == null) return;
-
- ProjectInformation info = ProjectInformationManager.Instance.Get (p);
-
- Union thisUnion = (Union)dataObject;
-
- // Classes
- foreach (Class c in info.Classes)
- if (c.Parent != null && c.Parent.Equals (thisUnion))
- treeBuilder.AddChild (c);
-
- // Structures
- foreach (Structure s in info.Structures)
- if (s.Parent != null && s.Parent.Equals (thisUnion))
- treeBuilder.AddChild (s);
-
- // Unions
- foreach (Union u in info.Unions)
- if (u.Parent != null && u.Parent.Equals (thisUnion))
- treeBuilder.AddChild (u);
-
- // Enumerations
- foreach (Enumeration e in info.Enumerations)
- if (e.Parent != null && e.Parent.Equals (thisUnion))
- treeBuilder.AddChild (e);
-
- // Typedefs
- foreach (Typedef t in info.Typedefs)
- if (t.Parent != null && t.Parent.Equals (thisUnion))
- treeBuilder.AddChild (t);
-
- // Functions
- foreach (Function f in info.Functions)
- if (f.Parent != null && f.Parent.Equals (thisUnion))
- treeBuilder.AddChild (f);
-
- // Members
- foreach (Member m in info.Members)
- if (m.Parent != null && m.Parent.Equals (thisUnion))
- treeBuilder.AddChild (m);
- }
-
- public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
- {
- return true;
- }
-
- public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
- {
- if (otherNode.DataItem is Structure)
- return 1;
- else
- return -1;
- }
- }
-}
diff --git a/main/src/addins/CBinding/Navigation/VariableNodeBuilder.cs b/main/src/addins/CBinding/Navigation/VariableNodeBuilder.cs
deleted file mode 100644
index 587b53df6d..0000000000
--- a/main/src/addins/CBinding/Navigation/VariableNodeBuilder.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// VariableNodeBuilder.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-using Mono.Addins;
-
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Pads;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui.Components;
-
-using CBinding.Parser;
-
-namespace CBinding.Navigation
-{
- public class VariableNodeBuilder : TypeNodeBuilder
- {
- public override Type NodeDataType {
- get { return typeof(Variable); }
- }
-
- public override Type CommandHandlerType {
- get { return typeof(LanguageItemCommandHandler); }
- }
-
- public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
- {
- return ((Variable)dataObject).Name;
- }
-
- public override void BuildNode (ITreeBuilder treeBuilder,
- object dataObject,
- NodeInfo nodeInfo)
- {
- Variable v = (Variable)dataObject;
-
- nodeInfo.Label = v.Name;
-
- switch (v.Access)
- {
- case AccessModifier.Public:
- nodeInfo.Icon = Context.GetIcon (Stock.Field);
- break;
- case AccessModifier.Protected:
- nodeInfo.Icon = Context.GetIcon (Stock.ProtectedField);
- break;
- case AccessModifier.Private:
- nodeInfo.Icon = Context.GetIcon (Stock.PrivateField);
- break;
- }
- }
-
- public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
- {
- return false;
- }
-
- public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
- {
- if (otherNode.DataItem is Function)
- return 1;
- else
- return -1;
- }
- }
-}
diff --git a/main/src/addins/CBinding/ObjCLanguageBinding.cs b/main/src/addins/CBinding/ObjCLanguageBinding.cs
deleted file mode 100644
index 13bb348c35..0000000000
--- a/main/src/addins/CBinding/ObjCLanguageBinding.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// ObjCLanguageBinding.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-using Mono.Addins;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Core;
-
-namespace CBinding
-{
- public class ObjCLanguageBinding : ILanguageBinding
- {
- public string Language {
- get { return "Objective C"; }
- }
-
- public string SingleLineCommentTag { get { return "//"; } }
- public string BlockCommentStartTag { get { return "/*"; } }
- public string BlockCommentEndTag { get { return "*/"; } }
-
- public bool IsSourceCodeFile (FilePath fileName)
- {
- return fileName.ToString ().EndsWith (".m", StringComparison.Ordinal);
- }
-
- public FilePath GetFileName (FilePath baseName)
- {
- return baseName + ".m";
- }
- }
-}
diff --git a/main/src/addins/CBinding/ObjCppLanguageBinding.cs b/main/src/addins/CBinding/ObjCppLanguageBinding.cs
deleted file mode 100644
index 7581260bcb..0000000000
--- a/main/src/addins/CBinding/ObjCppLanguageBinding.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// ObjCLanguageBinding.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-using Mono.Addins;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Core;
-
-namespace CBinding
-{
- public class ObjCppLanguageBinding : ILanguageBinding
- {
- public string Language {
- get { return "Objective C++"; }
- }
-
- public string SingleLineCommentTag { get { return "//"; } }
- public string BlockCommentStartTag { get { return "/*"; } }
- public string BlockCommentEndTag { get { return "*/"; } }
-
- public bool IsSourceCodeFile (FilePath fileName)
- {
- return fileName.ToString ().EndsWith (".mm", StringComparison.OrdinalIgnoreCase) ||
- fileName.ToString ().EndsWith (".M", StringComparison.Ordinal);
- }
-
- public FilePath GetFileName (FilePath baseName)
- {
- return baseName + ".mm";
- }
- }
-}
diff --git a/main/src/addins/CBinding/Parser/BsdCTagsManager.cs b/main/src/addins/CBinding/Parser/BsdCTagsManager.cs
deleted file mode 100644
index 6f21867b19..0000000000
--- a/main/src/addins/CBinding/Parser/BsdCTagsManager.cs
+++ /dev/null
@@ -1,125 +0,0 @@
-//
-// BsdCTagsManager.cs
-//
-// Author:
-// Levi Bard <levi@unity3d.com>
-//
-// Copyright (c) 2010 Levi Bard
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.IO;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Collections.Generic;
-
-using MonoDevelop.Core;
-using MonoDevelop.Core.Execution;
-
-namespace CBinding.Parser
-{
- public class BsdCTagsManager: CTagsManager
- {
- #region implemented abstract members of CBinding.Parser.CTagsManager
-
- protected override IEnumerable<string> GetTags (FileInformation fileInfo)
- {
- string tagFileName = Path.GetFileName (fileInfo.FileName) + ".tag";
- string tagFullFileName = Path.Combine (SystemTagsDirectory, tagFileName);
-
- string ctags_options = string.Format ("-dtx '{0}'", fileInfo.FileName);
- string ctags_output = string.Empty;
-
- if (!File.Exists (tagFullFileName) || File.GetLastWriteTimeUtc (tagFullFileName) < File.GetLastWriteTimeUtc (fileInfo.FileName)) {
- ctags_output = GetOutputFromProcess (CTagsExecutable, ctags_options, Environment.CurrentDirectory);
- File.WriteAllText (tagFullFileName, ctags_output);
- }
-
- return ctags_output.Split (newlines, StringSplitOptions.RemoveEmptyEntries);
- }
-
- static readonly char[] newlines = {'\r','\n'};
- protected override IEnumerable<string> GetTags (MonoDevelop.Projects.Project project, string filename, IEnumerable<string> headers)
- {
- StringBuilder ctags_kinds = new StringBuilder ("-dtx");
-
- ctags_kinds.AppendFormat (" '{0}'", filename);
- foreach (string header in headers) {
- ctags_kinds.AppendFormat (" '{0}'", header);
- }
-
- string output = GetOutputFromProcess (CTagsExecutable, ctags_kinds.ToString (), project.BaseDirectory);
- if (output != null)
- return output.Split (newlines, StringSplitOptions.RemoveEmptyEntries);
- return null;
- }
-
- public override void FillFileInformation (FileInformation fileInfo)
- {
- IEnumerable<string> ctags_output = GetTags (fileInfo);
- if (ctags_output == null) return;
-
- foreach (string tagEntry in ctags_output) {
- if (tagEntry.StartsWith ("!_")) continue;
-
- Tag tag = ParseTag (tagEntry);
-
- if (tag != null)
- AddInfo (fileInfo, tag, tagEntry);
- }
-
- fileInfo.IsFilled = true;
- }
-
-
- // Format: symbol line file fulltext (there may not be any whitespace between symbol and line)
- static readonly Regex tagExpression = new Regex (@"\s*(?<symbol>[^\s]+?)\s*(?<line>\d+)\s+(?<file>[^\s]+)\s+(?<raw>.*)", RegexOptions.Compiled);
-
- public override Tag ParseTag (string tagEntry)
- {
- try {
- Match tagMatch = tagExpression.Match (tagEntry);
- if (tagMatch == null) return null;
-
- TagKind kind = TagKind.Member;
- string signature = tagMatch.Groups["raw"].Value;
- int start = signature.IndexOf ('(');
- int end = signature.LastIndexOf (')');
-
- if (start >= 0 && end > start) {
- // Attempt to parse out method parameter block
- signature = signature.Substring (start, end - start + 1);
- kind = TagKind.Function; // TODO: improve kind guessing
- }
- return new Tag (tagMatch.Groups["symbol"].Value,
- tagMatch.Groups["file"].Value,
- ulong.Parse (tagMatch.Groups["line"].Value)+1,
- kind, AccessModifier.Public,
- null, null, null, null, null, signature);
- } catch (Exception ex) {
- LoggingService.LogWarning (string.Format ("Error parsing tag {0}", tagEntry), ex);
- }
- return null;
- }
-
- #endregion
-
- }
-}
-
diff --git a/main/src/addins/CBinding/Parser/CDocumentParser.cs b/main/src/addins/CBinding/Parser/CDocumentParser.cs
deleted file mode 100755
index 0d13cfbbe7..0000000000
--- a/main/src/addins/CBinding/Parser/CDocumentParser.cs
+++ /dev/null
@@ -1,228 +0,0 @@
-//
-// CDocumentParser.cs
-//
-// Author:
-// Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-//
-// Copyright (c) 2009 Levi Bard
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.IO;
-using System.Collections.Generic;
-using System.Text.RegularExpressions;
-
-using MonoDevelop.Core;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide;
-using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem.Implementation;
-
-namespace CBinding.Parser
-{
- /// <summary>
- /// Ctags-based document parser helper
- /// </summary>
- public class CDocumentParser: TypeSystemParser
- {
- public override ParsedDocument Parse (bool storeAst, string fileName, TextReader reader, Project project = null)
- {
- var doc = new DefaultParsedDocument (fileName);
- doc.Flags |= ParsedDocumentFlags.NonSerializable;
- ProjectInformation pi = ProjectInformationManager.Instance.Get (project);
-
- string content = reader.ReadToEnd ();
- string[] contentLines = content.Split (new string[]{Environment.NewLine}, StringSplitOptions.None);
-
- var globals = new DefaultUnresolvedTypeDefinition ("", GettextCatalog.GetString ("(Global Scope)"));
- lock (pi) {
- // Add containers to type list
- foreach (LanguageItem li in pi.Containers ()) {
- if (null == li.Parent && FilePath.Equals (li.File, fileName)) {
- var tmp = AddLanguageItem (pi, globals, li, contentLines) as IUnresolvedTypeDefinition;
- if (null != tmp){ doc.TopLevelTypeDefinitions.Add (tmp); }
- }
- }
-
- // Add global category for unscoped symbols
- foreach (LanguageItem li in pi.InstanceMembers ()) {
- if (null == li.Parent && FilePath.Equals (li.File, fileName)) {
- AddLanguageItem (pi, globals, li, contentLines);
- }
- }
- }
-
- doc.TopLevelTypeDefinitions.Add (globals);
- return doc;
- }
-
- /// <summary>
- /// Finds the end of a function's definition by matching braces.
- /// </summary>
- /// <param name="content">
- /// A <see cref="System.String"/> array: each line of the content to be searched.
- /// </param>
- /// <param name="startLine">
- /// A <see cref="System.Int32"/>: The earliest line at which the function may start.
- /// </param>
- /// <returns>
- /// A <see cref="System.Int32"/>: The detected end of the function.
- /// </returns>
- static int FindFunctionEnd (string[] content, int startLine) {
- int start = FindFunctionStart (content, startLine);
- if (0 > start){ return startLine; }
-
- int count = 0;
-
- for (int i= start; i<content.Length; ++i) {
- foreach (char c in content[i]) {
- switch (c) {
- case '{':
- ++count;
- break;
- case '}':
- if (0 >= --count) {
- return i;
- }
- break;
- }
- }
- }
-
- return startLine;
- }
-
- /// <summary>
- /// Finds the start of a function's definition.
- /// </summary>
- /// <param name="content">
- /// A <see cref="System.String"/> array: each line of the content to be searched.
- /// </param>
- /// <param name="startLine">
- /// A <see cref="System.Int32"/>: The earliest line at which the function may start.
- /// </param>
- /// <returns>
- /// A <see cref="System.Int32"/>: The detected start of the function
- /// definition, or -1.
- /// </returns>
- static int FindFunctionStart (string[] content, int startLine) {
- int semicolon = -1;
- int bracket = -1;
-
- for (int i=startLine; i<content.Length; ++i) {
- semicolon = content[i].IndexOf (';');
- bracket = content[i].IndexOf ('{');
- if (0 <= semicolon) {
- return (0 > bracket ^ semicolon < bracket)? -1: i;
- } else if (0 <= bracket) {
- return i;
- }
- }
-
- return -1;
- }
-
- static readonly Regex paramExpression = new Regex (@"(?<type>[^\s]+)\s+(?<subtype>[*&]*)(?<name>[^\s[]+)(?<array>\[.*)?", RegexOptions.Compiled);
-
- static object AddLanguageItem (ProjectInformation pi, DefaultUnresolvedTypeDefinition klass, LanguageItem li, string[] contentLines)
- {
-
- if (li is Class || li is Structure || li is Enumeration) {
- var type = LanguageItemToIType (pi, li, contentLines);
- klass.NestedTypes.Add (type);
- return type;
- }
-
- if (li is Function) {
- var method = FunctionToIMethod (pi, klass, (Function)li, contentLines);
- klass.Members.Add (method);
- return method;
- }
-
- var field = LanguageItemToIField (klass, li, contentLines);
- klass.Members.Add (field);
- return field;
- }
-
- /// <summary>
- /// Create an IMember from a LanguageItem,
- /// using the source document to locate declaration bounds.
- /// </summary>
- /// <param name="pi">
- /// A <see cref="ProjectInformation"/> for the current project.
- /// </param>
- /// <param name="item">
- /// A <see cref="LanguageItem"/>: The item to convert.
- /// </param>
- /// <param name="contentLines">
- /// A <see cref="System.String[]"/>: The document in which item is defined.
- /// </param>
- static DefaultUnresolvedTypeDefinition LanguageItemToIType (ProjectInformation pi, LanguageItem item, string[] contentLines)
- {
- var klass = new DefaultUnresolvedTypeDefinition ("", item.File);
- if (item is Class || item is Structure) {
- klass.Region = new DomRegion ((int)item.Line, 1, FindFunctionEnd (contentLines, (int)item.Line-1) + 2, 1);
- klass.Kind = item is Class ? TypeKind.Class : TypeKind.Struct;
- foreach (LanguageItem li in pi.AllItems ()) {
- if (klass.Equals (li.Parent) && FilePath.Equals (li.File, item.File))
- AddLanguageItem (pi, klass, li, contentLines);
- }
- return klass;
- }
-
- klass.Region = new DomRegion ((int)item.Line, 1, (int)item.Line + 1, 1);
- klass.Kind = TypeKind.Enum;
- return klass;
- }
-
- static IUnresolvedField LanguageItemToIField (IUnresolvedTypeDefinition type, LanguageItem item, string[] contentLines)
- {
- var result = new DefaultUnresolvedField (type, item.Name);
- result.Region = new DomRegion ((int)item.Line, 1, (int)item.Line + 1, 1);
- return result;
- }
-
- static IUnresolvedMethod FunctionToIMethod (ProjectInformation pi, IUnresolvedTypeDefinition type, Function function, string[] contentLines)
- {
- var method = new DefaultUnresolvedMethod (type, function.Name);
- method.Region = new DomRegion ((int)function.Line, 1, FindFunctionEnd (contentLines, (int)function.Line-1)+2, 1);
-
- Match match;
- bool abort = false;
- var parameters = new List<IUnresolvedParameter> ();
- foreach (string parameter in function.Parameters) {
- match = paramExpression.Match (parameter);
- if (null == match) {
- abort = true;
- break;
- }
- var typeRef = new DefaultUnresolvedTypeDefinition (string.Format ("{0}{1}{2}", match.Groups["type"].Value, match.Groups["subtype"].Value, match.Groups["array"].Value));
- var p = new DefaultUnresolvedParameter (typeRef, match.Groups["name"].Value);
- parameters.Add (p);
- }
- if (!abort)
- parameters.ForEach (p => method.Parameters.Add (p));
- return method;
- }
-
-
- }
-}
diff --git a/main/src/addins/CBinding/Parser/CTagsManager.cs b/main/src/addins/CBinding/Parser/CTagsManager.cs
deleted file mode 100644
index a26645836d..0000000000
--- a/main/src/addins/CBinding/Parser/CTagsManager.cs
+++ /dev/null
@@ -1,200 +0,0 @@
-//
-// CTagsManager.cs
-//
-// Author:
-// Levi Bard <levi@unity3d.com>
-//
-// Copyright (c) 2010 Levi Bard
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.IO;
-using System.Collections.Generic;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Linq;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Core;
-using MonoDevelop.Core.Execution;
-
-namespace CBinding.Parser
-{
- public abstract class CTagsManager
- {
- public abstract Tag ParseTag (string tagEntry);
- protected abstract IEnumerable<string> GetTags (FileInformation fileInfo);
- protected abstract IEnumerable<string> GetTags (Project project, string filename, IEnumerable<string> headers);
-
- public static readonly string SystemTagsDirectory = UserProfile.Current.CacheDir.Combine ("CTagsData");
-
- public static string CTagsExecutable {
- get { return PropertyService.Get<string> ("CBinding.CTagsExecutable", "ctags"); }
- }
-
- static CTagsManager ()
- {
- try {
- Directory.CreateDirectory (SystemTagsDirectory);
- } catch (IOException ioe) {
- LoggingService.LogError ("Error creating system tags directory", ioe);
- }
- }
-
- protected virtual void AddInfo (FileInformation info, Tag tag, string ctags_output)
- {
- switch (tag.Kind)
- {
- case TagKind.Class:
- Class c = new Class (tag, info.Project, ctags_output);
- if (!info.Classes.Contains (c))
- info.Classes.Add (c);
- break;
- case TagKind.Enumeration:
- Enumeration e = new Enumeration (tag, info.Project, ctags_output);
- if (!info.Enumerations.Contains (e))
- info.Enumerations.Add (e);
- break;
- case TagKind.Enumerator:
- Enumerator en= new Enumerator (tag, info.Project, ctags_output);
- if (!info.Enumerators.Contains (en))
- info.Enumerators.Add (en);
- break;
- case TagKind.ExternalVariable:
- break;
- case TagKind.Function:
- Function f = new Function (tag, info.Project, ctags_output);
- if (!info.Functions.Contains (f))
- info.Functions.Add (f);
- break;
- case TagKind.Local:
- Local lo = new Local (tag, info.Project, ctags_output);
- if(!info.Locals.Contains (lo))
- info.Locals.Add (lo);
- break;
- case TagKind.Macro:
- Macro m = new Macro (tag, info.Project);
- if (!info.Macros.Contains (m))
- info.Macros.Add (m);
- break;
- case TagKind.Member:
- Member me = new Member (tag, info.Project, ctags_output);
- if (!info.Members.Contains (me))
- info.Members.Add (me);
- break;
- case TagKind.Namespace:
- Namespace n = new Namespace (tag, info.Project, ctags_output);
- if (!info.Namespaces.Contains (n))
- info.Namespaces.Add (n);
- break;
- case TagKind.Prototype:
- Function fu = new Function (tag, info.Project, ctags_output);
- if (!info.Functions.Contains (fu))
- info.Functions.Add (fu);
- break;
- case TagKind.Structure:
- Structure s = new Structure (tag, info.Project, ctags_output);
- if (!info.Structures.Contains (s))
- info.Structures.Add (s);
- break;
- case TagKind.Typedef:
- Typedef t = new Typedef (tag, info.Project, ctags_output);
- if (!info.Typedefs.Contains (t))
- info.Typedefs.Add (t);
- break;
- case TagKind.Union:
- Union u = new Union (tag, info.Project, ctags_output);
- if (!info.Unions.Contains (u))
- info.Unions.Add (u);
- break;
- case TagKind.Variable:
- Variable v = new Variable (tag, info.Project);
- if (!info.Variables.Contains (v))
- info.Variables.Add (v);
- break;
- default:
- break;
- }
- }
-
- public virtual void FillFileInformation (FileInformation fileInfo)
- {
- IEnumerable<string> ctags_output = GetTags (fileInfo);
-
- foreach (string tagEntry in ctags_output) {
- if (tagEntry.StartsWith ("!_")) continue;
-
- Tag tag = ParseTag (tagEntry);
-
- if (tag != null)
- AddInfo (fileInfo, tag, tagEntry);
- }
-
- fileInfo.IsFilled = true;
- }
-
- public virtual void DoUpdateFileTags (MonoDevelop.Projects.Project project, string filename, IEnumerable<string> headers)
- {
- ProjectInformation info = ProjectInformationManager.Instance.Get (project);
-
- lock (info) {
- info.RemoveFileInfo (filename);
-
- IEnumerable<string> tags = GetTags (project, filename, headers);
- if (tags == null) return;
-
- foreach (string tagEntry in tags) {
- if (tagEntry.StartsWith ("!_")) continue;
-
- Tag tag = ParseTag (tagEntry);
-
- if (tag != null)
- AddInfo (info, tag, tagEntry);
- }
- }
- }
-
- public static string GetOutputFromProcess (string executable, string args, string baseDirectory)
- {
- string processOutput = null;
- ProcessWrapper p = null;
- StringWriter output = null,
- error = null;
- try {
- output = new StringWriter ();
- error = new StringWriter ();
-
- p = Runtime.ProcessService.StartProcess (executable, args, baseDirectory, output, error, null);
- p.WaitForOutput (10000);
-
- if (p.HasExited) {
- processOutput = output.ToString ();
- }
- } finally {
- if (p != null)
- p.Dispose ();
- if (output != null)
- output.Dispose ();
- }
-
- return processOutput;
- }
- }
-}
-
diff --git a/main/src/addins/CBinding/Parser/Class.cs b/main/src/addins/CBinding/Parser/Class.cs
deleted file mode 100644
index 4099c6e8c3..0000000000
--- a/main/src/addins/CBinding/Parser/Class.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// Class.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using MonoDevelop.Projects;
-
-namespace CBinding.Parser
-{
- public class Class : LanguageItem
- {
- public Class (Tag tag, Project project, string ctags_output) : base (tag, project)
- {
- if (GetNamespace (tag, ctags_output)) return;
- if (GetClass (tag, ctags_output)) return;
- if (GetStructure (tag, ctags_output)) return;
- if (GetUnion (tag, ctags_output)) return;
- }
- }
-}
diff --git a/main/src/addins/CBinding/Parser/CompilationUnitDataProvider.cs b/main/src/addins/CBinding/Parser/CompilationUnitDataProvider.cs
deleted file mode 100644
index 70c59b68ec..0000000000
--- a/main/src/addins/CBinding/Parser/CompilationUnitDataProvider.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// CompilationUnitDataProvider.cs
-//
-// Author:
-// Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-//
-// Copyright (c) 2010 Levi Bard
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Linq;
-
-using MonoDevelop.Ide;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Content;
-using MonoDevelop.Ide.CodeCompletion;
-using MonoDevelop.Components;
-
-using Gtk;
-
-namespace CBinding.Parser
-{
- // Yoinked from C# binding
- public class CompilationUnitDataProvider : DropDownBoxListWindow.IListDataProvider
- {
- Document Document { get; set; }
-
- public CompilationUnitDataProvider (Document document)
- {
- this.Document = document;
- }
-
- #region IListDataProvider implementation
- public void Reset () { }
-
- public string GetMarkup (int n)
- {
- return GLib.Markup.EscapeText (Document.ParsedDocument.UserRegions.ElementAt (n).Name);
- }
-
- internal static Xwt.Drawing.Image Pixbuf
- {
- get { return ImageService.GetIcon (Gtk.Stock.Add, IconSize.Menu); }
- }
-
- public Xwt.Drawing.Image GetIcon (int n)
- {
- return Pixbuf;
- }
-
- public object GetTag (int n)
- {
- return Document.ParsedDocument.UserRegions.ElementAt (n);
- }
-
-
- public void ActivateItem (int n)
- {
- var reg = Document.ParsedDocument.UserRegions.ElementAt (n);
- MonoDevelop.Ide.Gui.Content.IExtensibleTextEditor extEditor = Document.GetContent<MonoDevelop.Ide.Gui.Content.IExtensibleTextEditor> ();
- if (extEditor != null)
- extEditor.SetCaretTo (Math.Max (1, reg.Region.BeginLine), reg.Region.BeginColumn);
- }
-
- public int IconCount
- {
- get {
- if (Document.ParsedDocument == null)
- return 0;
- return Document.ParsedDocument.UserRegions.Count ();
- }
- }
-
- #endregion
- }
-}
-
diff --git a/main/src/addins/CBinding/Parser/DataProvider.cs b/main/src/addins/CBinding/Parser/DataProvider.cs
deleted file mode 100755
index 201f06ac4c..0000000000
--- a/main/src/addins/CBinding/Parser/DataProvider.cs
+++ /dev/null
@@ -1,129 +0,0 @@
-//
-// DataProvider.cs
-//
-// Author:
-// Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-//
-// Copyright (c) 2010 Levi Bard
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections.Generic;
-
-using MonoDevelop.Ide;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Content;
-using MonoDevelop.Ide.CodeCompletion;
-using MonoDevelop.Components;
-
-using Gtk;
-using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem;
-
-namespace CBinding.Parser
-{
- // Yoinked from C# binding
- public class DataProvider : DropDownBoxListWindow.IListDataProvider
- {
- object tag;
- Ambience amb;
- List<IUnresolvedEntity> memberList = new List<IUnresolvedEntity> ();
-
- Document Document {
- get;
- set;
- }
-
- public DataProvider (Document doc, object tag, Ambience amb)
- {
- this.Document = doc;
- this.tag = tag;
- this.amb = amb;
- Reset ();
- }
-
- #region IListDataProvider implementation
- public void Reset ()
- {
- memberList.Clear ();
- if (tag is IUnresolvedFile) {
- var types = new Stack<IUnresolvedTypeDefinition> (((IUnresolvedFile)tag).TopLevelTypeDefinitions);
- while (types.Count > 0) {
- var type = types.Pop ();
- memberList.Add (type);
- foreach (var innerType in type.NestedTypes)
- types.Push (innerType);
- }
- } else if (tag is IUnresolvedTypeDefinition) {
- memberList.AddRange (((IUnresolvedTypeDefinition)tag).Members);
- }
- memberList.Sort ((x, y) => String.Compare (GetString (amb, x), GetString (amb, y), StringComparison.OrdinalIgnoreCase));
- }
-
- string GetString (Ambience amb, IUnresolvedEntity x)
- {
- var ctx = new SimpleTypeResolveContext (Document.Compilation.MainAssembly);
- IEntity rx = null;
- if (x is IUnresolvedMember)
- rx = ((IUnresolvedMember)x).CreateResolved (ctx);
-
- if (tag is IUnresolvedFile)
- return amb.GetString (rx, OutputFlags.IncludeGenerics | OutputFlags.IncludeParameters | OutputFlags.UseFullInnerTypeName | OutputFlags.ReformatDelegates);
- return amb.GetString (rx, OutputFlags.IncludeGenerics | OutputFlags.IncludeParameters | OutputFlags.ReformatDelegates);
- }
-
- public string GetMarkup (int n)
- {
- var m = memberList[n];
-// if (m.IsObsolete ())
-// return "<s>" + GLib.Markup.EscapeText (GetString (amb, m)) + "</s>";
- return GLib.Markup.EscapeText (GetString (amb, m));
- }
-
- public Xwt.Drawing.Image GetIcon (int n)
- {
- return ImageService.GetIcon (memberList[n].GetStockIcon (), Gtk.IconSize.Menu);
- }
-
- public object GetTag (int n)
- {
- return memberList[n];
- }
-
- public void ActivateItem (int n)
- {
- var member = memberList[n];
- MonoDevelop.Ide.Gui.Content.IExtensibleTextEditor extEditor = Document.GetContent<MonoDevelop.Ide.Gui.Content.IExtensibleTextEditor> ();
- if (extEditor != null)
- extEditor.SetCaretTo (Math.Max (1, member.Region.BeginLine), Math.Max (1, member.Region.BeginColumn));
- }
-
- public int IconCount {
- get {
- return memberList.Count;
- }
- }
- #endregion
- }
-}
-
diff --git a/main/src/addins/CBinding/Parser/Enumeration.cs b/main/src/addins/CBinding/Parser/Enumeration.cs
deleted file mode 100644
index adac66a33b..0000000000
--- a/main/src/addins/CBinding/Parser/Enumeration.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// Enumeration.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using MonoDevelop.Projects;
-
-namespace CBinding.Parser
-{
- public class Enumeration : LanguageItem
- {
- public Enumeration (Tag tag, Project project, string ctags_output) : base (tag, project)
- {
- if (GetNamespace (tag, ctags_output)) return;
- if (GetClass (tag, ctags_output)) return;
- if (GetStructure (tag, ctags_output)) return;
- if (GetUnion (tag, ctags_output)) return;
- }
- }
-}
diff --git a/main/src/addins/CBinding/Parser/Enumerator.cs b/main/src/addins/CBinding/Parser/Enumerator.cs
deleted file mode 100644
index fe3af8ab6e..0000000000
--- a/main/src/addins/CBinding/Parser/Enumerator.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// Tag.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using MonoDevelop.Projects;
-
-namespace CBinding.Parser
-{
- public class Enumerator : LanguageItem
- {
- public Enumerator (Tag tag, Project project, string ctags_output) : base (tag, project)
- {
- GetEnumeration (tag, ctags_output);
- }
- }
-}
diff --git a/main/src/addins/CBinding/Parser/ExuberantCTagsManager.cs b/main/src/addins/CBinding/Parser/ExuberantCTagsManager.cs
deleted file mode 100644
index 2042b64e40..0000000000
--- a/main/src/addins/CBinding/Parser/ExuberantCTagsManager.cs
+++ /dev/null
@@ -1,163 +0,0 @@
-//
-// ExuberantCTagsManager.cs
-//
-// Author:
-// Levi Bard <levi@unity3d.com>
-//
-// Copyright (c) 2010 Levi Bard
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.IO;
-using System.Text;
-using System.Linq;
-using System.Collections.Generic;
-
-using MonoDevelop.Core;
-using MonoDevelop.Core.Execution;
-
-namespace CBinding.Parser
-{
- public class ExuberantCTagsManager: CTagsManager
- {
- #region implemented abstract members of CBinding.Parser.CTagsManager
-
- protected override IEnumerable<string> GetTags (FileInformation fileInfo)
- {
- string tagFileName = Path.GetFileName (fileInfo.FileName) + ".tag";
- string tagFullFileName = Path.Combine (SystemTagsDirectory, tagFileName);
- string ctags_kinds = "--C++-kinds=+px";
- string ctags_output = string.Empty;
-
- if (PropertyService.Get<bool> ("CBinding.ParseLocalVariables", true))
- ctags_kinds += "l";
-
- string ctags_options = ctags_kinds + " --fields=+aStisk-fz --language-force=C++ --excmd=number --line-directives=yes -f '" + tagFullFileName + "' '" + fileInfo.FileName + "'";
-
- if (!File.Exists (tagFullFileName) || File.GetLastWriteTimeUtc (tagFullFileName) < File.GetLastWriteTimeUtc (fileInfo.FileName)) {
- GetOutputFromProcess (CTagsExecutable, ctags_options, Environment.CurrentDirectory);
- }
- try {
- ctags_output = File.ReadAllText (tagFullFileName);
- } catch (IOException ioe) {
- LoggingService.LogError ("Error updating system tags", ioe);
- }
-
- return ctags_output.Split (newlines, StringSplitOptions.RemoveEmptyEntries);
- }
-
- public override Tag ParseTag (string tagEntry)
- {
- string file;
- UInt64 line;
- string name;
- string tagField;
- TagKind kind;
- AccessModifier access = AccessModifier.Public;
- string _class = null;
- string _namespace = null;
- string _struct = null;
- string _union = null;
- string _enum = null;
- string signature = null;
-
- int i1 = tagEntry.IndexOf ('\t');
- name = tagEntry.Substring (0, tagEntry.IndexOf ('\t'));
-
- i1 += 1;
- int i2 = tagEntry.IndexOf ('\t', i1);
- file = tagEntry.Substring (i1, i2 - i1);
-
- i1 = i2 + 1;
- i2 = tagEntry.IndexOf (";\"", i1);
- line = UInt64.Parse(tagEntry.Substring (i1, i2 - i1));
-
- i1 = i2 + 3;
- kind = (TagKind)tagEntry[i1];
-
- i1 += 2;
- tagField = (tagEntry.Length > i1? tagField = tagEntry.Substring(i1) : String.Empty);
-
- string[] fields = tagField.Split ('\t');
- int index;
-
- foreach (string field in fields) {
- index = field.IndexOf (':');
-
- // TODO: Support friend modifier
- if (index > 0) {
- string key = field.Substring (0, index);
- string val = field.Substring (index + 1);
-
- switch (key) {
- case "access":
- try {
- access = (AccessModifier)System.Enum.Parse (typeof(AccessModifier), val, true);
- } catch (ArgumentException) {
- }
- break;
- case "class":
- _class = val;
- break;
- case "namespace":
- _namespace = val;
- break;
- case "struct":
- _struct = val;
- break;
- case "union":
- _union = val;
- break;
- case "enum":
- _enum = val;
- break;
- case "signature":
- signature = val;
- break;
- }
- }
- }
-
- return new Tag (name, file, line, kind, access, _class, _namespace, _struct, _union, _enum, signature);
- }
-
- static readonly char[] newlines = {'\r','\n'};
- protected override IEnumerable<string> GetTags (MonoDevelop.Projects.Project project, string filename, IEnumerable<string> headers)
- {
- StringBuilder ctags_kinds = new StringBuilder ("--C++-kinds=+px");
-
- if (PropertyService.Get<bool> ("CBinding.ParseLocalVariables", true))
- ctags_kinds.Append ("+l");
-
- // Maybe we should only ask for locals for 'local' files? (not external #includes?)
- ctags_kinds.AppendFormat (" --fields=+aStisk-fz --language-force=C++ --excmd=number --line-directives=yes -f - '{0}'", filename);
- foreach (string header in headers) {
- ctags_kinds.AppendFormat (" '{0}'", header);
- }
-
- string output = GetOutputFromProcess (CTagsExecutable, ctags_kinds.ToString (), project.BaseDirectory);
- if (output != null)
- return output.Split (newlines, StringSplitOptions.RemoveEmptyEntries);
- return null;
- }
-
- #endregion
- }
-}
-
diff --git a/main/src/addins/CBinding/Parser/Function.cs b/main/src/addins/CBinding/Parser/Function.cs
deleted file mode 100644
index 09d12dbd21..0000000000
--- a/main/src/addins/CBinding/Parser/Function.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-//
-// Function.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using MonoDevelop.Projects;
-
-namespace CBinding.Parser
-{
- public class Function : LanguageItem
- {
- private string[] parameters;
- private string signature;
- private bool is_const = false;
-
- public Function (Tag tag, Project project, string ctags_output) : base (tag, project)
- {
- signature = tag.Signature;
- ParseSignature (tag.Signature);
-
- if (GetNamespace (tag, ctags_output)) return;
- if (GetClass (tag, ctags_output)) return;
- if (GetStructure (tag, ctags_output)) return;
- if (GetUnion (tag, ctags_output)) return;
-
- // TODO: Remove all this when sure it is no longer needed
- // (because we no longer generate prototype tags).
-// if (tag.Kind == TagKind.Prototype) {
-// Access = tag.Access;
-// if (GetNamespace (tag, ctags_output)) return;
-// if (GetClass (tag, ctags_output)) return;
-// if (GetStructure (tag, ctags_output)) return;
-// if (GetUnion (tag, ctags_output)) return;
-// } else {
-// // If it is not a prototype tag, we attempt to get the prototype tag
-// // we need the prototype tag because the implementation tag
-// // marks the belonging namespace as a if it were a class
-// // and it does not have the access field.
-// Tag prototypeTag = TagDatabaseManager.Instance.FindTag (Name, TagKind.Prototype, ctags_output);
-//
-// if (prototypeTag == null) {
-// // It does not have a prototype tag which means it is inline
-// // and when it is inline it does have all the info we need
-//
-// if (GetNamespace (tag, ctags_output)) return;
-// if (GetClass (tag, ctags_output)) return;
-// if (GetStructure (tag, ctags_output)) return;
-// if (GetUnion (tag, ctags_output)) return;
-//
-// return;
-// }
-//
-// // we need to re-get the access
-// Access = prototypeTag.Access;
-//
-// if (GetNamespace (prototypeTag, ctags_output)) return;
-// if (GetClass (prototypeTag, ctags_output)) return;
-// if (GetStructure (prototypeTag, ctags_output)) return;
-// if (GetUnion (prototypeTag, ctags_output)) return;
-// }
- }
-
- private void ParseSignature (string signature)
- {
- if (null == signature) return;
-
- string sig = signature;
-
- if (signature.EndsWith ("const")) {
- is_const = true;
- sig = signature.Substring (0, signature.Length - 6);
- sig = sig.Substring (1, sig.Length - 2);
- } else {
- sig = signature.Substring (1, signature.Length - 2);
- }
-
- parameters = sig.Split (',');
-
- for (int i = 0; i < parameters.Length; i++)
- parameters[i] = parameters[i].Trim ();
- }
-
- public string[] Parameters {
- get { return parameters; }
- }
-
- public string Signature {
- get { return signature; }
- }
-
- public bool IsConst {
- get { return is_const; }
- }
-
- public override bool Equals (object o)
- {
- Function other = o as Function;
-
- if (other != null &&
- FullName == other.FullName &&
- Project.Equals(other.Project) &&
- Signature == other.Signature)
- return true;
-
- return false;
- }
-
- public override int GetHashCode ()
- {
- return base.GetHashCode () + parameters.GetHashCode ();
- }
- }
-}
diff --git a/main/src/addins/CBinding/Parser/LanguageItem.cs b/main/src/addins/CBinding/Parser/LanguageItem.cs
deleted file mode 100644
index f5a5ec69d4..0000000000
--- a/main/src/addins/CBinding/Parser/LanguageItem.cs
+++ /dev/null
@@ -1,257 +0,0 @@
-//
-// LanguageItem.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Ide;
-using MonoDevelop.Core;
-
-namespace CBinding.Parser
-{
- public class LanguageItem
- {
- private Project project;
- private string name;
- private string file;
- private UInt64 line;
- private AccessModifier access;
- private LanguageItem parent;
-
- public LanguageItem (Tag tag, Project project)
- {
- this.project = project;
- this.name = tag.Name;
- this.file = tag.File;
- this.line = tag.Line;
- this.access = tag.Access;
- }
-
- /// <summary>
- /// Attempts to get the namespace encompasing the function
- /// returns true on success and false if it does not have one.
- /// NOTE: if it's a method then even if the class it belongs to
- /// has a namespace the method will not have a namespace since
- /// it should be placed under the class node and not the namespace node
- /// </summary>
- protected bool GetNamespace (Tag tag, string ctags_output)
- {
- string n;
-
- if ((n = tag.Namespace) != null) {
- int index = n.LastIndexOf (':');
-
- if (index > 0)
- n = n.Substring (index + 1);
-
- try {
- Tag namespaceTag = TagDatabaseManager.Instance.FindTag (
- n, TagKind.Namespace, ctags_output);
-
- if (namespaceTag != null)
- parent = new Namespace (namespaceTag, project, ctags_output);
-
- } catch (IOException ex) {
- LoggingService.LogInternalError (ex);
- return false;
- }
-
- return true;
- }
-
- return false;
- }
-
- protected bool GetClass (Tag tag, string ctags_output)
- {
- string c;
-
- if ((c = tag.Class) != null) {
- int index = c.LastIndexOf (':');
-
- if (index > 0)
- c = c.Substring (index + 1);
-
- try {
- Tag classTag = TagDatabaseManager.Instance.FindTag (
- c, TagKind.Class, ctags_output);
-
- if (classTag != null)
- parent = new Class (classTag, project, ctags_output);
-
- } catch (IOException ex) {
- LoggingService.LogInternalError (ex);
- return false;
- }
-
- return true;
- }
-
- return false;
- }
-
- protected bool GetStructure (Tag tag, string ctags_output)
- {
- string s;
-
- if ((s = tag.Structure) != null) {
- int index = s.LastIndexOf (':');
-
- if (index > 0)
- s = s.Substring (index + 1);
-
- try {
- Tag classTag = TagDatabaseManager.Instance.FindTag (
- s, TagKind.Structure, ctags_output);
-
- if (classTag != null)
- parent = new Structure (classTag, project, ctags_output);
-
- } catch (IOException ex) {
- LoggingService.LogInternalError (ex);
- return false;
- }
-
- return true;
- }
-
- return false;
- }
-
- protected bool GetEnumeration (Tag tag, string ctags_output)
- {
- string e;
-
- if ((e = tag.Enum) != null) {
- int index = e.LastIndexOf (':');
-
- if (index > 0)
- e = e.Substring (index + 1);
-
- try {
- Tag enumTag = TagDatabaseManager.Instance.FindTag (
- e, TagKind.Enumeration, ctags_output);
-
- if (enumTag != null)
- parent = new Enumeration (enumTag, project, ctags_output);
-
- } catch (IOException ex) {
- LoggingService.LogInternalError (ex);
- return false;
- }
-
- return true;
- }
-
- return false;
- }
-
- protected bool GetUnion (Tag tag, string ctags_output)
- {
- string u;
-
- if ((u = tag.Union) != null) {
- int index = u.LastIndexOf (':');
-
- if (index > 0)
- u = u.Substring (index + 1);
-
- try {
- Tag unionTag = TagDatabaseManager.Instance.FindTag (
- u, TagKind.Union, ctags_output);
-
- if (unionTag != null)
- parent = new Union (unionTag, project, ctags_output);
-
- } catch (IOException ex) {
- LoggingService.LogInternalError (ex);
- return false;
- }
-
- return true;
- }
-
- return false;
- }
-
- public Project Project {
- get { return project; }
- }
-
- public LanguageItem Parent {
- get { return parent; }
- set { parent = value; }
- }
-
- public string Name {
- get { return name; }
- }
-
- public string FullName {
- get {
- if (Parent != null)
- return Parent.FullName + "::" + Name;
- return Name;
- }
- }
-
- public string File {
- get { return file; }
- }
-
- public UInt64 Line {
- get { return line; }
- }
-
- public AccessModifier Access {
- get { return access; }
- set { access = value; }
- }
-
- public override bool Equals (object o)
- {
- LanguageItem other = o as LanguageItem;
-
- if (other != null &&
- other.FullName.Equals (FullName) &&
- other.Project.Equals (project))
- return true;
-
- return false;
- }
-
- public override int GetHashCode ()
- {
- return (name + file + line.ToString() + project.Name).GetHashCode ();
- }
- }
-}
diff --git a/main/src/addins/CBinding/Parser/Local.cs b/main/src/addins/CBinding/Parser/Local.cs
deleted file mode 100644
index 06dd51fff0..0000000000
--- a/main/src/addins/CBinding/Parser/Local.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// Member.cs
-//
-// Authors:
-// Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-//
-// Copyright (C) 2008 Levi Bard
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using MonoDevelop.Projects;
-
-namespace CBinding.Parser
-{
- /// <summary>
- /// Class for local variables
- /// </summary>
- public class Local : Member
- {
- public Local (Tag tag, Project project, string ctags_output) : base (tag, project, ctags_output)
- {
- }
- }
-}
diff --git a/main/src/addins/CBinding/Parser/Macro.cs b/main/src/addins/CBinding/Parser/Macro.cs
deleted file mode 100644
index 14d709b8a7..0000000000
--- a/main/src/addins/CBinding/Parser/Macro.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// Macro.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using MonoDevelop.Projects;
-
-namespace CBinding.Parser
-{
- public class Macro : LanguageItem
- {
- public Macro (Tag tag, Project project) : base (tag, project)
- {
- }
- }
-}
diff --git a/main/src/addins/CBinding/Parser/Member.cs b/main/src/addins/CBinding/Parser/Member.cs
deleted file mode 100644
index 46c46ede7b..0000000000
--- a/main/src/addins/CBinding/Parser/Member.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-//
-// Member.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Text.RegularExpressions;
-
-using MonoDevelop.Projects;
-
-namespace CBinding.Parser
-{
- public class Member : LanguageItem
- {
- public string InstanceType {
- get{ return instanceType; }
- }
- protected string instanceType;
-
- public bool IsPointer {
- get{ return isPointer; }
- }
- protected bool isPointer;
-
- public Member (Tag tag, Project project, string ctags_output) : base (tag, project)
- {
- GetInstanceType (tag);
-
- if (GetClass (tag, ctags_output)) return;
- if (GetStructure (tag, ctags_output)) return;
- if (GetUnion (tag, ctags_output)) return;
- }
-
- /// <summary>
- /// Regex for deriving the type of a variable,
- /// and whether it's a pointer,
- /// from an expression, e.g.
- /// static Foo::bar<string> *blah = NULL;
- /// </summary>
- public static Regex InstanceTypeExpression = new Regex (
- @"^\s*((static|friend|const|mutable|extern|struct|union|\w*::|<[\w><:]*>)\s*)*(?<type>\w[\w\d]*)\s*(<.*>)?\s*(?<pointer>[*])?",
- RegexOptions.Compiled);
-
- /// <summary>
- /// Populates an instance's instanceType and isPointer fields
- /// by matching its pattern against InstanceTypeExpression
- /// </summary>
- /// <param name="tag">
- /// The partially-populated tag of an instance
- /// <see cref="Tag"/>
- /// </param>
- /// <returns>
- /// Whether the regex was successfully matched
- /// <see cref="System.Boolean"/>
- /// </returns>
- protected bool GetInstanceType (Tag tag) {
- try {
- string declaration = null;
-
- using (StreamReader reader = new StreamReader (tag.File)) {
- for (ulong i=0; i<tag.Line; ++i) {
- declaration = reader.ReadLine ();
- }
- }
-
- Match m = InstanceTypeExpression.Match (declaration);
-
- if (null != m) {
- instanceType = m.Groups["type"].Value;
- isPointer = m.Groups["pointer"].Success;
- return true;
- }
- } catch { }
-
- return false;
- }
- }
-}
diff --git a/main/src/addins/CBinding/Parser/Namespace.cs b/main/src/addins/CBinding/Parser/Namespace.cs
deleted file mode 100644
index 061daf1cbe..0000000000
--- a/main/src/addins/CBinding/Parser/Namespace.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// Namespace.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using MonoDevelop.Projects;
-
-namespace CBinding.Parser
-{
- public class Namespace : LanguageItem
- {
- public Namespace (Tag tag, Project project, string ctags_output) : base (tag, project)
- {
- GetNamespace (tag, ctags_output);
- }
- }
-}
diff --git a/main/src/addins/CBinding/Parser/ProjectInformation.cs b/main/src/addins/CBinding/Parser/ProjectInformation.cs
deleted file mode 100644
index 86417b2254..0000000000
--- a/main/src/addins/CBinding/Parser/ProjectInformation.cs
+++ /dev/null
@@ -1,236 +0,0 @@
-//
-// ProjectInformation.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-
-using MonoDevelop.Projects;
-
-using CBinding.Navigation;
-
-namespace CBinding.Parser
-{
- public class FileInformation
- {
- protected Project project;
-
- protected List<Namespace> namespaces = new List<Namespace> ();
- protected List<Function> functions = new List<Function> ();
- protected List<Class> classes = new List<Class> ();
- protected List<Structure> structures = new List<Structure> ();
- protected List<Member> members = new List<Member> ();
- protected List<Variable> variables = new List<Variable> ();
- protected List<Macro> macros = new List<Macro> ();
- protected List<Enumeration> enumerations = new List<Enumeration> ();
- protected List<Enumerator> enumerators = new List<Enumerator> ();
- protected List<Union> unions = new List<Union> ();
- protected List<Typedef> typedefs = new List<Typedef> ();
- protected List<Local> locals = new List<Local> ();
-
- private string file_name;
- private bool is_filled = false;
-
- public FileInformation (Project project)
- {
- this.project = project;
- this.file_name = null;
- }
-
- public FileInformation (Project project, string filename)
- {
- this.project = project;
- this.file_name = filename;
- }
-
- public void Clear ()
- {
- namespaces.Clear ();
- functions.Clear ();
- classes.Clear ();
- structures.Clear ();
- members.Clear ();
- variables.Clear ();
- macros.Clear ();
- enumerations.Clear ();
- enumerators.Clear ();
- unions.Clear ();
- typedefs.Clear ();
- locals.Clear ();
- }
-
- /// <summary>
- /// Remove a file's parse information from the database.
- /// </summary>
- public void RemoveFileInfo(string filename)
- {
- namespaces.RemoveAll(delegate(Namespace item){ return item.File == filename; });
- functions.RemoveAll(delegate(Function item){ return item.File == filename; });
- classes.RemoveAll(delegate(Class item){ return item.File == filename; });
- structures.RemoveAll(delegate(Structure item){ return item.File == filename; });
- members.RemoveAll(delegate(Member item){ return item.File == filename; });
- variables.RemoveAll(delegate(Variable item){ return item.File == filename; });
- macros.RemoveAll(delegate(Macro item){ return item.File == filename; });
- enumerations.RemoveAll(delegate(Enumeration item){ return item.File == filename; });
- enumerators.RemoveAll(delegate(Enumerator item){ return item.File == filename; });
- unions.RemoveAll(delegate(Union item){ return item.File == filename; });
- typedefs.RemoveAll(delegate(Typedef item){ return item.File == filename; });
- locals.RemoveAll(delegate(Local item){ return item.File == filename; });
- }
-
- public IEnumerable<LanguageItem> Containers ()
- {
- List<LanguageItem> containers = new List<LanguageItem> ();
-
- containers.AddRange ((LanguageItem[])namespaces.ToArray());
- containers.AddRange ((LanguageItem[])classes.ToArray());
- containers.AddRange ((LanguageItem[])structures.ToArray());
- containers.AddRange ((LanguageItem[])enumerations.ToArray());
- containers.AddRange ((LanguageItem[])unions.ToArray());
-
- return containers;
- }
-
- // Functions, fields
- public IEnumerable<LanguageItem> InstanceMembers ()
- {
- List<LanguageItem> instanceMembers = new List<LanguageItem> ();
-
- instanceMembers.AddRange ((LanguageItem[])functions.ToArray());
- instanceMembers.AddRange ((LanguageItem[])members.ToArray());
-
- return instanceMembers;
- }
-
- // All items except macros
- public IEnumerable<LanguageItem> AllItems ()
- {
- List<LanguageItem> allItems = new List<LanguageItem> ();
-
- allItems.AddRange (Containers ());
- allItems.AddRange (InstanceMembers ());
- allItems.AddRange ((LanguageItem[])variables.ToArray());
- allItems.AddRange ((LanguageItem[])enumerators.ToArray());
- allItems.AddRange ((LanguageItem[])typedefs.ToArray());
- allItems.AddRange ((LanguageItem[])locals.ToArray());
-
- return allItems;
- }
-
- public Project Project {
- get { return project; }
- }
-
- public List<Namespace> Namespaces {
- get { return namespaces; }
- }
-
- public List<Function> Functions {
- get { return functions; }
- }
-
- public List<Class> Classes {
- get { return classes; }
- }
-
- public List<Structure> Structures {
- get { return structures; }
- }
-
- public List<Member> Members {
- get { return members; }
- }
-
- public List<Variable> Variables {
- get { return variables; }
- }
-
- public List<Macro> Macros {
- get { return macros; }
- }
-
- public List<Enumeration> Enumerations {
- get { return enumerations; }
- }
-
- public List<Enumerator> Enumerators {
- get { return enumerators; }
- }
-
- public List<Union> Unions {
- get { return unions; }
- }
-
- public List<Typedef> Typedefs {
- get { return typedefs; }
- }
-
- public List<Local> Locals {
- get { return locals; }
- }
-
- public string FileName {
- get { return file_name; }
- set { file_name = value; }
- }
-
- public bool IsFilled {
- get { return is_filled; }
- set { is_filled = value; }
- }
- }
-
- // TODO: Update this such that it either supports multiple configurations - or is used in a configuration specific manner.
- public class ProjectInformation : FileInformation
- {
- private Globals globals;
- private MacroDefinitions macroDefs;
-
- private Dictionary<string, List<FileInformation>> includedFiles = new Dictionary<string, List<FileInformation>> ();
-
- public ProjectInformation (Project project) : base (project)
- {
- globals = new Globals (project);
- macroDefs = new MacroDefinitions (project);
- }
-
- public Globals Globals {
- get { return globals; }
- }
-
- public MacroDefinitions MacroDefinitions {
- get { return macroDefs; }
- }
-
- public Dictionary<string, List<FileInformation>> IncludedFiles {
- get { return includedFiles; }
- }
- }
-}
diff --git a/main/src/addins/CBinding/Parser/ProjectInformationManager.cs b/main/src/addins/CBinding/Parser/ProjectInformationManager.cs
deleted file mode 100644
index ee94704334..0000000000
--- a/main/src/addins/CBinding/Parser/ProjectInformationManager.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// ProjectInformationManager.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-
-using MonoDevelop.Projects;
-
-using CBinding.Navigation;
-
-namespace CBinding.Parser
-{
- /// <summary>
- /// Singleton class to manage the navigation information of each project
- /// </summary>
- public class ProjectInformationManager
- {
- private static ProjectInformationManager instance;
- private List<ProjectInformation> projects = new List<ProjectInformation> ();
-
- private ProjectInformationManager ()
- {
- }
-
- public ProjectInformation Get (Project project)
- {
- foreach (ProjectInformation p in projects) {
- if (p.Project == project ||
- (null != project && project.Equals (p.Project))) {
- return p;
- }
- }
-
- ProjectInformation newinfo = new ProjectInformation (project);
- projects.Add (newinfo);
-
- return newinfo;
- }
-
- public static ProjectInformationManager Instance {
- get {
- if (instance == null)
- instance = new ProjectInformationManager ();
-
- return instance;
- }
- }
- }
-}
diff --git a/main/src/addins/CBinding/Parser/Structure.cs b/main/src/addins/CBinding/Parser/Structure.cs
deleted file mode 100644
index e8c11cdb22..0000000000
--- a/main/src/addins/CBinding/Parser/Structure.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// Structure.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using MonoDevelop.Projects;
-
-namespace CBinding.Parser
-{
- public class Structure : LanguageItem
- {
- public Structure (Tag tag, Project project, string ctags_output) : base (tag, project)
- {
- if (GetNamespace (tag, ctags_output)) return;
- if (GetClass (tag, ctags_output)) return;
- if (GetStructure (tag, ctags_output)) return;
- if (GetUnion (tag, ctags_output)) return;
- }
- }
-}
diff --git a/main/src/addins/CBinding/Parser/Tag.cs b/main/src/addins/CBinding/Parser/Tag.cs
deleted file mode 100644
index b2c02aaabb..0000000000
--- a/main/src/addins/CBinding/Parser/Tag.cs
+++ /dev/null
@@ -1,144 +0,0 @@
-//
-// Tag.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-namespace CBinding.Parser
-{
- public enum TagKind {
- Class = 'c',
- Macro = 'd',
- Enumerator = 'e',
- Function = 'f',
- Enumeration = 'g',
- Local = 'l',
- Member = 'm',
- Namespace = 'n',
- Prototype = 'p',
- Structure = 's',
- Typedef = 't',
- Union = 'u',
- Variable = 'v',
- ExternalVariable = 'x',
- Unknown = ' '
- }
-
- public enum AccessModifier {
- Private,
- Protected,
- Public
- }
-
- public class Tag
- {
- private string name;
- private string file;
- private UInt64 line;
- private TagKind kind;
- private AccessModifier access;
- private string field_class;
- private string field_namespace;
- private string field_struct;
- private string field_union;
- private string field_enum;
- private string field_signature;
-
- public Tag (string name,
- string file,
- UInt64 line,
- TagKind kind,
- AccessModifier access,
- string field_class,
- string field_namespace,
- string field_struct,
- string field_union,
- string field_enum,
- string field_signature)
- {
- this.name = name;
- this.file = file;
- this.line = line;
- this.kind = kind;
- this.access = access;
- this.field_class = field_class;
- this.field_namespace = field_namespace;
- this.field_struct = field_struct;
- this.field_union = field_union;
- this.field_enum = field_enum;
- this.field_signature = field_signature;
- }
-
- public string Name {
- get { return name; }
- }
-
- public string File {
- get { return file; }
- }
-
- public UInt64 Line {
- get { return line; }
- }
-
- public TagKind Kind {
- get { return kind; }
- }
-
- public AccessModifier Access {
- get { return access; }
- }
-
- public string Class {
- get { return field_class; }
- }
-
- public string Namespace {
- get { return field_namespace; }
- }
-
- public string Structure {
- get { return field_struct; }
- }
-
- public string Union {
- get { return field_union; }
- }
-
- public string Enum {
- get { return field_enum; }
- }
-
- public string Signature {
- get { return field_signature; }
- }
- }
-}
diff --git a/main/src/addins/CBinding/Parser/TagDatabaseManager.cs b/main/src/addins/CBinding/Parser/TagDatabaseManager.cs
deleted file mode 100644
index c88d2c4db0..0000000000
--- a/main/src/addins/CBinding/Parser/TagDatabaseManager.cs
+++ /dev/null
@@ -1,499 +0,0 @@
-//
-// TagDatabaseManager.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-// Mitchell Wheeler <mitchell.wheeler@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Text;
-using System.Linq;
-using System.Text.RegularExpressions;
-using System.Collections.Generic;
-using System.Threading;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Core;
-using MonoDevelop.Core.Execution;
-using MonoDevelop.Ide.Gui;
-
-using CBinding.Navigation;
-
-// TODO
-// Generic, language independant 'TagDatabaseManager'
-// Parsing of ctags data into a Sqlite database, for easy/efficient access & updates.
-//
-namespace CBinding.Parser
-{
- /// <summary>
- /// Singleton class to manage tag databases
- /// </summary>
- class TagDatabaseManager
- {
- private static TagDatabaseManager instance;
- private Queue<ProjectFilePair> parsingJobs = new Queue<ProjectFilePair> ();
- private Thread parsingThread;
- private CTagsManager ctags;
-
- public event ClassPadEventHandler FileUpdated;
-
- bool ctagsInstalled = false;
- bool checkedCtagsInstalled = false;
-
- private TagDatabaseManager()
- {
- }
-
- public static TagDatabaseManager Instance
- {
- get {
- if (instance == null)
- instance = new TagDatabaseManager ();
-
- return instance;
- }
- }
-
- public bool DepsInstalled {
- get {
- if (!checkedCtagsInstalled) {
- checkedCtagsInstalled = true;
-
- try {
- var output = new StringWriter ();
- Runtime.ProcessService.StartProcess (CTagsManager.CTagsExecutable, "--version", null, output, null, null).WaitForExit ();
- if (Platform.IsMac && !output.ToString ().StartsWith ("Exuberant", StringComparison.Ordinal)) {
- System.Console.WriteLine ("Fallback to OSX ctags");
- ctags = new BsdCTagsManager ();
- } else {
- ctags = new ExuberantCTagsManager ();
- }
- } catch {
- LoggingService.LogWarning ("Cannot update C/C++ tags database because exuberant ctags is not installed.");
- return false;
- }
- try {
- Runtime.ProcessService.StartProcess ("gcc", "--version", null, null).WaitForOutput ();
- } catch {
- LoggingService.LogWarning ("Cannot update C/C++ tags database because gcc is not installed.");
- return false;
- }
- lock (parsingJobs) {
- ctagsInstalled = true;
- }
- }
- return ctagsInstalled && ctags != null;
- }
- set {
- //don't assume that the caller is correct :-)
- if (value)
- checkedCtagsInstalled = false; //wil re-determine ctagsInstalled on next getting
- else
- ctagsInstalled = false;
- }
- }
-
- private string[] Headers (Project project, string filename, bool with_system)
- {
- List<string> headers = new List<string> ();
- CProject cproject = project as CProject;
- if (cproject == null){ return headers.ToArray(); }
-
- StringBuilder output = new StringBuilder ();
- StringBuilder option = new StringBuilder ("-M");
- if (!with_system) {
- option.Append("M");
- }
-
- option.Append (" -MG ");
- foreach (Package package in cproject.Packages) {
- package.ParsePackage ();
- option.AppendFormat ("{0} ", string.Join(" ", package.CFlags.ToArray ()));
- }
-
- ProcessWrapper p = null;
- try {
- p = Runtime.ProcessService.StartProcess ("gcc", option.ToString () + filename.Replace(@"\ ", " ").Replace(" ", @"\ "), null, null);
- p.WaitForOutput ();
-
- // Doing the below completely breaks header parsing
- // // Skip first two lines (.o & .c* files) - WARNING, sometimes this is compacted to 1 line... we need a better way of handling this.
- // if(p.StandardOutput.ReadLine () == null) return new string[0]; // object file
- // if(p.StandardOutput.ReadLine () == null) return new string[0]; // compile file
-
- string line;
- while ((line = p.StandardOutput.ReadLine ()) != null)
- output.Append (line);
- } catch (Exception ex) {
- LoggingService.LogError (ex.ToString ());
- return new string [0];
- }
- finally {
- if(p != null)
- p.Dispose();
- }
-
- MatchCollection files = Regex.Matches(output.ToString().Replace(@" \", String.Empty), @" (?<file>([^ \\]|(\\ ))+)", RegexOptions.IgnoreCase);
-
- foreach (Match match in files) {
- string depfile = findFileInIncludes(project, match.Groups["file"].Value.Trim());
-
- headers.Add (depfile.Replace(@"\ ", " ").Replace(" ", @"\ "));
- }
-
- return headers.ToArray ();
- }
-
- /// <summary>
- /// Finds a file in a project's include path(s)
- /// </summary>
- /// <param name="project">
- /// The project whose include path is to be searched
- /// <see cref="Project"/>
- /// </param>
- /// <param name="filename">
- /// A portion of a full file path
- /// <see cref="System.String"/>
- /// </param>
- /// <returns>
- /// The full found path, or filename if not found
- /// <see cref="System.String"/>
- /// </returns>
- private static string findFileInIncludes (Project project, string filename) {
- CProjectConfiguration conf = project.DefaultConfiguration as CProjectConfiguration;
- string fullpath = string.Empty;
-
- if (!Path.IsPathRooted (filename)) {
- // Check against base directory
- fullpath = findFileInPath (filename, project.BaseDirectory);
- if (string.Empty != fullpath) return fullpath;
-
- if (conf != null) {
- // Check project's additional configuration includes
- foreach (string p in conf.Includes) {
- fullpath = findFileInPath (filename, p);
- if (string.Empty != fullpath) return fullpath;
- }
- }
- }
-
- return filename;
- }
-
- /// <summary>
- /// Finds a file in a subdirectory of a given path
- /// </summary>
- /// <param name="relativeFilename">
- /// A portion of a full file path
- /// <see cref="System.String"/>
- /// </param>
- /// <param name="path">
- /// The path beneath which to look for relativeFilename
- /// <see cref="System.String"/>
- /// </param>
- /// <returns>
- /// The full path, or string.Empty if not found
- /// <see cref="System.String"/>
- /// </returns>
- private static string findFileInPath (string relativeFilename, string path) {
- string tmp = Path.Combine (path, relativeFilename);
-
- if (Path.IsPathRooted (relativeFilename))
- return relativeFilename;
- else if (File.Exists (tmp))
- return tmp;
-
- if (Directory.Exists (path)) {
- foreach (string subdir in Directory.GetDirectories (path)) {
- tmp = findFileInPath (relativeFilename, subdir);
- if (string.Empty != tmp) return tmp;
- }
- }
-
- return string.Empty;
- }
-
- private void UpdateSystemTags (Project project, string filename, IEnumerable<string> includedFiles)
- {
- if (!DepsInstalled)
- return;
- ProjectInformation info = ProjectInformationManager.Instance.Get (project);
- List<FileInformation> files;
-
- lock (info) {
- if (!info.IncludedFiles.ContainsKey (filename)) {
- files = new List<FileInformation> ();
- info.IncludedFiles.Add (filename, files);
- } else {
- files = info.IncludedFiles[filename];
- }
-
- foreach (string includedFile in includedFiles) {
- bool contains = false;
-
- foreach (FileInformation fi in files) {
- if (fi.FileName == includedFile) {
- contains = true;
- }
- }
-
- if (!contains) {
- FileInformation newFileInfo = new FileInformation (project, includedFile);
- files.Add (newFileInfo);
- ctags.FillFileInformation (newFileInfo);
- }
-
- contains = false;
- }
- }
- }
-
- private void ParsingThread ()
- {
- try {
- while (parsingJobs.Count > 0) {
- ProjectFilePair p;
-
- lock (parsingJobs) {
- p = parsingJobs.Dequeue ();
- }
-
- string[] headers = Headers (p.Project, p.File, false);
- ctags.DoUpdateFileTags (p.Project, p.File, headers);
- OnFileUpdated (new ClassPadEventArgs (p.Project));
-
- if (PropertyService.Get<bool> ("CBinding.ParseSystemTags", true))
- UpdateSystemTags (p.Project, p.File, Headers (p.Project, p.File, true).Except (headers));
-
- if (cache.Count > cache_size)
- cache.Clear ();
- }
- } catch (Exception ex) {
- LoggingService.LogError ("Unhandled error updating parser database. Disabling C/C++ parsing.", ex);
- DepsInstalled = false;
- return;
- }
- }
-
- public void UpdateFileTags (Project project, string filename)
- {
- if (!DepsInstalled)
- return;
-
- ProjectFilePair p = new ProjectFilePair (project, filename);
-
- lock (parsingJobs) {
- if (!parsingJobs.Contains (p))
- parsingJobs.Enqueue (p);
- }
-
- if (parsingThread == null || !parsingThread.IsAlive) {
- parsingThread = new Thread (ParsingThread);
- parsingThread.Name = "Tag database parser";
- parsingThread.IsBackground = true;
- parsingThread.Priority = ThreadPriority.Lowest;
- parsingThread.Start();
- }
- }
-
- Tag BinarySearch (string[] ctags_lines, TagKind kind, string name)
- {
- int low;
- int high = ctags_lines.Length - 2; // last element is an empty string (because of the Split)
- int mid;
- int start_index = 0;
-
- // Skip initial comment lines
- while (ctags_lines[start_index].StartsWith ("!_"))
- start_index++;
-
- low = start_index;
-
- while (low <= high) {
- mid = (low + high) / 2;
- string entry = ctags_lines[mid];
- string tag_name = entry.Substring (0, entry.IndexOf ('\t'));
- int res = string.CompareOrdinal (tag_name, name);
-
- if (res < 0) {
- low = mid + 1;
- } else if (res > 0) {
- high = mid - 1;
- } else {
- // The tag we are at has the same name than the one we are looking for
- // but not necessarily the same type, the actual tag we are looking
- // for might be higher up or down, so we try both, starting with going down.
- int save = mid;
- bool going_down = true;
- bool eof = false;
-
- while (true) {
- Tag tag = ctags.ParseTag (entry);
-
- if (tag == null)
- return null;
-
- if (tag.Kind == kind && tag_name == name)
- return tag;
-
- if (going_down) {
- mid++;
-
- if (mid >= ctags_lines.Length - 1)
- eof = true;
-
- if (!eof) {
- entry = ctags_lines[mid];
- tag_name = entry.Substring (0, entry.IndexOf ('\t'));
-
- if (tag_name != name) {
- going_down = false;
- mid = save - 1;
- }
- } else {
- going_down = false;
- mid = save - 1;
- }
- } else { // going up
- mid--;
-
- if (mid < start_index)
- return null;
-
- entry = ctags_lines[mid];
- tag_name = entry.Substring (0, entry.IndexOf ('\t'));
-
- if (tag_name != name)
- return null;
- }
- }
- }
- }
-
- return null;
- }
-
- private struct SemiTag
- {
- readonly internal string name;
- readonly internal TagKind kind;
-
- internal SemiTag (string name, TagKind kind)
- {
- this.name = name;
- this.kind = kind;
- }
-
- public override int GetHashCode ()
- {
- return (name + kind.ToString ()).GetHashCode ();
- }
- }
-
- private const int cache_size = 10000;
- private Dictionary<SemiTag, Tag> cache = new Dictionary<SemiTag, Tag> ();
-
- public Tag FindTag (string name, TagKind kind, string ctags_output)
- {
- SemiTag semiTag = new SemiTag (name, kind);
-
- if (cache.ContainsKey (semiTag))
- return cache[semiTag];
- else {
- string[] ctags_lines = ctags_output.Split ('\n');
- Tag tag = BinarySearch (ctags_lines, kind, name);
- cache.Add (semiTag, tag);
-
- return tag;
- }
- }
-
- /// <summary>
- /// Remove a file's parse information from the database.
- /// </summary>
- /// <param name="project">
- /// A <see cref="Project"/>: The project to which the file belongs.
- /// </param>
- /// <param name="filename">
- /// A <see cref="System.String"/>: The file.
- /// </param>
- public void RemoveFileInfo(Project project, string filename)
- {
- ProjectInformation info = ProjectInformationManager.Instance.Get (project);
- lock (info){ info.RemoveFileInfo(filename); }
- OnFileUpdated(new ClassPadEventArgs (project));
- }
-
- /// <summary>
- /// Wrapper method for the FileUpdated event.
- /// </summary>
- void OnFileUpdated (ClassPadEventArgs args)
- {
- if (null != FileUpdated){ FileUpdated(args); }
- }
-
- private class ProjectFilePair
- {
- string file;
- Project project;
-
- public ProjectFilePair (Project project, string file)
- {
- this.project = project;
- this.file = file;
- }
-
- public string File {
- get { return file; }
- }
-
- public Project Project {
- get { return project; }
- }
-
- public override bool Equals (object other)
- {
- ProjectFilePair o = other as ProjectFilePair;
-
- if (o == null)
- return false;
-
- if (file == o.File && project == o.Project)
- return true;
- else
- return false;
- }
-
- public override int GetHashCode ()
- {
- return (project.ToString() + file).GetHashCode ();
- }
- }
- }
-}
diff --git a/main/src/addins/CBinding/Parser/Typedef.cs b/main/src/addins/CBinding/Parser/Typedef.cs
deleted file mode 100644
index 09b3e7f390..0000000000
--- a/main/src/addins/CBinding/Parser/Typedef.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// Typedef.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using MonoDevelop.Projects;
-
-namespace CBinding.Parser
-{
- public class Typedef : LanguageItem
- {
- public Typedef (Tag tag, Project project, string ctags_output) : base (tag, project)
- {
- if (GetNamespace (tag, ctags_output)) return;
- if (GetClass (tag, ctags_output)) return;
- if (GetStructure (tag, ctags_output)) return;
- if (GetUnion (tag, ctags_output)) return;
- }
- }
-}
diff --git a/main/src/addins/CBinding/Parser/Union.cs b/main/src/addins/CBinding/Parser/Union.cs
deleted file mode 100644
index d569111f41..0000000000
--- a/main/src/addins/CBinding/Parser/Union.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// Union.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using MonoDevelop.Projects;
-
-namespace CBinding.Parser
-{
- public class Union : LanguageItem
- {
- public Union (Tag tag, Project project, string ctags_output) : base (tag, project)
- {
- if (GetNamespace (tag, ctags_output)) return;
- if (GetClass (tag, ctags_output)) return;
- if (GetStructure (tag, ctags_output)) return;
- if (GetUnion (tag, ctags_output)) return;
- }
- }
-} \ No newline at end of file
diff --git a/main/src/addins/CBinding/Parser/Variable.cs b/main/src/addins/CBinding/Parser/Variable.cs
deleted file mode 100644
index bc9179b823..0000000000
--- a/main/src/addins/CBinding/Parser/Variable.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// Variable.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using MonoDevelop.Projects;
-
-namespace CBinding.Parser
-{
- public class Variable : LanguageItem
- {
- public Variable (Tag tag, Project project) : base (tag, project)
- {
- }
- }
-}
diff --git a/main/src/addins/CBinding/Project/CProject.cs b/main/src/addins/CBinding/Project/CProject.cs
deleted file mode 100644
index 231830b4f0..0000000000
--- a/main/src/addins/CBinding/Project/CProject.cs
+++ /dev/null
@@ -1,553 +0,0 @@
-//
-// CProject.cs: C/C++ Project
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Xml;
-using System.Collections.Generic;
-using System.ComponentModel;
-
-using Mono.Addins;
-
-using MonoDevelop.Core;
-using MonoDevelop.Core.Execution;
-using MonoDevelop.Core.ProgressMonitoring;
-using MonoDevelop.Projects;
-using MonoDevelop.Core.Serialization;
-using MonoDevelop.Deployment;
-using MonoDevelop.Deployment.Linux;
-using CBinding.Parser;
-using MonoDevelop.Ide;
-
-namespace CBinding
-{
- public enum Language {
- C,
- CPP,
- OBJC,
- OBJCPP
- }
-
- public enum CProjectCommands {
- AddPackage,
- UpdateClassPad,
- ShowPackageDetails,
- GotoDeclaration,
- }
-
- [DataInclude(typeof(CProjectConfiguration))]
- public class CProject : Project, IDeployable
- {
- [ItemProperty ("Compiler", ValueType = typeof(CCompiler))]
- private ICompiler compiler_manager;
-
- [ItemProperty ("Language")]
- private Language language;
-
- [ItemProperty("Target")]
- CBinding.CompileTarget target = CBinding.CompileTarget.Bin;
-
- private ProjectPackageCollection packages = new ProjectPackageCollection ();
-
- public event ProjectPackageEventHandler PackageAddedToProject;
- public event ProjectPackageEventHandler PackageRemovedFromProject;
-
- /// <summary>
- /// Extensions for C/C++ source files
- /// </summary>
- public static string[] SourceExtensions = { ".C", ".CC", ".CPP", ".CXX", ".M", ".MM" };
-
- /// <summary>
- /// Extensions for C/C++ header files
- /// </summary>
- public static string[] HeaderExtensions = { ".H", ".HH", ".HPP", ".HXX" };
-
- private void Init ()
- {
- packages.Project = this;
-
- if (IdeApp.IsInitialized)
- IdeApp.Workspace.ItemAddedToSolution += OnEntryAddedToCombine;
- }
-
- public CProject ()
- {
- Init ();
- }
-
- public CProject (ProjectCreateInformation info,
- XmlElement projectOptions, string language)
- {
- Init ();
- string binPath = ".";
-
- if (info != null) {
- Name = info.ProjectName;
- binPath = info.BinPath;
- }
-
- switch (language)
- {
- case "C":
- this.language = Language.C;
- break;
- case "CPP":
- this.language = Language.CPP;
- break;
- case "Objective C":
- this.language = Language.OBJC;
- break;
- case "Objective C++":
- this.language = Language.OBJCPP;
- break;
- }
-
- Compiler = null; // use default compiler depending on language
-
- CProjectConfiguration configuration =
- (CProjectConfiguration)CreateConfiguration ("Debug");
-
- configuration.DefineSymbols = "DEBUG MONODEVELOP";
- configuration.DebugMode = true;
-
- Configurations.Add (configuration);
-
- configuration =
- (CProjectConfiguration)CreateConfiguration ("Release");
-
- configuration.DebugMode = false;
- configuration.OptimizationLevel = 3;
- configuration.DefineSymbols = "MONODEVELOP";
- Configurations.Add (configuration);
-
- foreach (CProjectConfiguration c in Configurations) {
- c.OutputDirectory = Path.Combine (binPath, c.Id);
- c.SourceDirectory = info.ProjectBasePath;
- c.Output = Name;
-
- if (projectOptions != null) {
- if (projectOptions.Attributes["Target"] != null) {
- c.CompileTarget = (CBinding.CompileTarget)Enum.Parse (
- typeof(CBinding.CompileTarget),
- projectOptions.Attributes["Target"].InnerText);
- }
- if (projectOptions.GetAttribute ("ExternalConsole") == "True") {
- c.ExternalConsole = true;
- c.PauseConsoleOutput = true;
- }
- if (projectOptions.Attributes["PauseConsoleOutput"] != null) {
- c.PauseConsoleOutput = bool.Parse (
- projectOptions.Attributes["PauseConsoleOutput"].InnerText);
- }
- if (projectOptions.Attributes["CompilerArgs"].InnerText != null) {
- c.ExtraCompilerArguments = projectOptions.Attributes["CompilerArgs"].InnerText;
- }
- if (projectOptions.Attributes["LinkerArgs"].InnerText != null) {
- c.ExtraLinkerArguments = projectOptions.Attributes["LinkerArgs"].InnerText;
- }
- }
- }
- }
-
- public override IEnumerable<string> GetProjectTypes ()
- {
- yield return "Native";
- }
-
- public override string[] SupportedLanguages {
- get { return new string[] { "C", "CPP", "Objective C", "Objective C++" }; }
- }
-
- public CompileTarget CompileTarget {
- get { return target; }
- set { target = value; }
- }
-
- public override bool IsCompileable (string fileName)
- {
- string ext = Path.GetExtension (fileName.ToUpper ());
-
- if (language == Language.C) {
- return (ext == ".C");
- } else {
- return (0 <= Array.IndexOf (SourceExtensions, ext));
- }
- }
-
- public override IEnumerable<SolutionItem> GetReferencedItems (ConfigurationSelector configuration)
- {
- foreach (var p in base.GetReferencedItems (configuration))
- yield return p;
-
- if (ParentSolution == null)
- yield break;
-
- foreach (Package p in Packages) {
- if (p.IsProject && p.Name != Name) {
- var cp = ParentSolution.FindProjectByName (p.Name) as CProject;
- if (cp != null)
- yield return cp;
- }
- }
- }
-
- public static bool IsHeaderFile (string filename)
- {
- return (0 <= Array.IndexOf (HeaderExtensions, Path.GetExtension (filename.ToUpper ())));
- }
-
- /// <summary>
- /// Ths pkg-config package is for internal MonoDevelop use only, it is not deployed.
- /// </summary>
- public void WriteMDPkgPackage (ConfigurationSelector configuration)
- {
- string pkgfile = Path.Combine (BaseDirectory, Name + ".md.pc");
-
- CProjectConfiguration config = (CProjectConfiguration)GetConfiguration (configuration);
-
- List<string> headerDirectories = new List<string> ();
-
- foreach (ProjectFile f in Files) {
- if (IsHeaderFile (f.Name)) {
- string dir = Path.GetDirectoryName (f.FilePath);
-
- if (!headerDirectories.Contains (dir)) {
- headerDirectories.Add (dir);
- }
- }
- }
-
- using (StreamWriter writer = new StreamWriter (pkgfile)) {
- writer.WriteLine ("Name: {0}", Name);
- writer.WriteLine ("Description: {0}", Description);
- writer.WriteLine ("Version: {0}", Version);
- writer.WriteLine ("Libs: -L\"{0}\" -l{1}", config.OutputDirectory, config.Output.StartsWith ("lib", StringComparison.OrdinalIgnoreCase)?
- config.Output.Substring (3):
- config.Output);
-// writer.WriteLine ("Cflags: -I{0}", BaseDirectory);
- writer.WriteLine ("Cflags: -I\"{0}\"", string.Join ("\" -I\"", headerDirectories.ToArray ()));
- }
-
- // If this project compiles into a shared object we need to
- // export the output path to the LD_LIBRARY_PATH
- string literal = "LD_LIBRARY_PATH";
- string ld_library_path = Environment.GetEnvironmentVariable (literal);
-
- if (string.IsNullOrEmpty (ld_library_path)) {
- Environment.SetEnvironmentVariable (literal, config.OutputDirectory);
- } else if (!ld_library_path.Contains (config.OutputDirectory)) {
- ld_library_path = string.Format ("{0}:{1}", config.OutputDirectory, ld_library_path);
- Environment.SetEnvironmentVariable (literal, ld_library_path);
- }
- }
-
- /// <summary>
- /// This is the pkg-config package that gets deployed.
- /// <returns>The pkg-config package's filename</returns>
- /// </summary>
- private string WriteDeployablePgkPackage (Project project, CProjectConfiguration config)
- {
- // FIXME: This should probably be grabed from somewhere.
- string prefix = "/usr/local";
- string pkgfile = Path.Combine (BaseDirectory, Name + ".pc");
-
- using (StreamWriter writer = new StreamWriter (pkgfile)) {
- writer.WriteLine ("prefix={0}", prefix);
- writer.WriteLine ("exec_prefix=${prefix}");
- writer.WriteLine ("libdir=${exec_prefix}/lib");
- writer.WriteLine ("includedir=${prefix}/include");
- writer.WriteLine ();
- writer.WriteLine ("Name: {0}", Name);
- writer.WriteLine ("Description: {0}", Description);
- writer.WriteLine ("Version: {0}", Version);
- writer.WriteLine ("Requires: {0}", string.Join (" ", Packages.ToStringArray ()));
- // TODO: How should I get this?
- writer.WriteLine ("Conflicts: {0}", string.Empty);
- writer.Write ("Libs: -L${libdir} ");
- writer.WriteLine ("-l{0}", config.Output.StartsWith ("lib", StringComparison.OrdinalIgnoreCase)?
- config.Output.Substring (3):
- config.Output);
- writer.Write ("Cflags: -I${includedir}/");
- writer.WriteLine ("{0} {1}", Name, Compiler.GetDefineFlags (project, config));
- }
-
- return pkgfile;
- }
-
- protected override BuildResult DoBuild (IProgressMonitor monitor, ConfigurationSelector configuration)
- {
- CProjectConfiguration pc = (CProjectConfiguration) GetConfiguration (configuration);
- pc.SourceDirectory = BaseDirectory;
-
- return compiler_manager.Compile (this,
- Files, packages,
- pc,
- monitor);
- }
-
- protected virtual ExecutionCommand CreateExecutionCommand (CProjectConfiguration conf)
- {
- string app = Path.Combine (conf.OutputDirectory, conf.Output);
- NativeExecutionCommand cmd = new NativeExecutionCommand (app);
- cmd.Arguments = conf.CommandLineParameters;
- cmd.WorkingDirectory = Path.GetFullPath (conf.OutputDirectory);
- cmd.EnvironmentVariables = conf.EnvironmentVariables;
- return cmd;
- }
-
- protected override bool OnGetCanExecute (ExecutionContext context, ConfigurationSelector solutionConfiguration)
- {
- CProjectConfiguration conf = (CProjectConfiguration) GetConfiguration (solutionConfiguration);
- ExecutionCommand cmd = CreateExecutionCommand (conf);
- return (target == CBinding.CompileTarget.Bin) && context.ExecutionHandler.CanExecute (cmd);
- }
-
- protected override void DoExecute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
- {
- CProjectConfiguration conf = (CProjectConfiguration) GetConfiguration (configuration);
- bool pause = conf.PauseConsoleOutput;
- IConsole console;
-
- if (conf.CompileTarget != CBinding.CompileTarget.Bin) {
- MessageService.ShowMessage ("Compile target is not an executable!");
- return;
- }
-
- monitor.Log.WriteLine ("Running project...");
-
- if (conf.ExternalConsole)
- console = context.ExternalConsoleFactory.CreateConsole (!pause);
- else
- console = context.ConsoleFactory.CreateConsole (!pause);
-
- AggregatedOperationMonitor operationMonitor = new AggregatedOperationMonitor (monitor);
-
- try {
- ExecutionCommand cmd = CreateExecutionCommand (conf);
- if (!context.ExecutionHandler.CanExecute (cmd)) {
- monitor.ReportError ("Cannot execute \"" + conf.Output + "\". The selected execution mode is not supported for C projects.", null);
- return;
- }
-
- IProcessAsyncOperation op = context.ExecutionHandler.Execute (cmd, console);
-
- operationMonitor.AddOperation (op);
- op.WaitForCompleted ();
-
- monitor.Log.WriteLine ("The operation exited with code: {0}", op.ExitCode);
- } catch (Exception ex) {
- LoggingService.LogError (string.Format ("Cannot execute \"{0}\"", conf.Output), ex);
- monitor.ReportError ("Cannot execute \"" + conf.Output + "\"", ex);
- } finally {
- operationMonitor.Dispose ();
- console.Dispose ();
- }
- }
-
- public override FilePath GetOutputFileName (ConfigurationSelector configuration)
- {
- CProjectConfiguration conf = (CProjectConfiguration) GetConfiguration (configuration);
- return conf.OutputDirectory.Combine (conf.CompiledOutputName);
- }
-
- public override SolutionItemConfiguration CreateConfiguration (string name)
- {
- CProjectConfiguration conf = new CProjectConfiguration ();
-
- conf.Name = name;
-
- return conf;
- }
-
- public Language Language {
- get { return language; }
- set { language = value; }
- }
-
- public ICompiler Compiler {
- get { return compiler_manager; }
- set {
- if (value != null) {
- compiler_manager = value;
- } else {
- object[] compilers = AddinManager.GetExtensionObjects ("/CBinding/Compilers");
- string compiler;
-
- // TODO: This should depend on platform (eg: windows would be mingw or msvc)
- if (language == Language.C)
- compiler = PropertyService.Get ("CBinding.DefaultCCompiler", new GccCompiler ().Name);
- else
- compiler = PropertyService.Get ("CBinding.DefaultCppCompiler", new GppCompiler ().Name);
-
- foreach (ICompiler c in compilers) {
- if (compiler == c.Name) {
- compiler_manager = c;
- }
- }
- }
- }
- }
-
- [Browsable(false)]
- [ItemProperty ("Packages")]
- public ProjectPackageCollection Packages {
- get { return packages; }
- set {
- packages = value;
- packages.Project = this;
- }
- }
-
- protected override void OnFileAddedToProject (ProjectFileEventArgs args)
- {
- base.OnFileAddedToProject (args);
-
- foreach (ProjectFileEventInfo e in args) {
- if (!Loading && !IsCompileable (e.ProjectFile.Name) &&
- e.ProjectFile.BuildAction == BuildAction.Compile) {
- e.ProjectFile.BuildAction = BuildAction.None;
- }
-
- if (e.ProjectFile.BuildAction == BuildAction.Compile)
- TagDatabaseManager.Instance.UpdateFileTags (this, e.ProjectFile.Name);
- }
- }
-
- protected override void OnFileChangedInProject (ProjectFileEventArgs e)
- {
- base.OnFileChangedInProject (e);
-
- foreach (ProjectFileEventInfo fe in e)
- TagDatabaseManager.Instance.UpdateFileTags (this, fe.ProjectFile.Name);
- }
-
- protected override void OnFileRemovedFromProject (ProjectFileEventArgs e)
- {
- base.OnFileRemovedFromProject (e);
-
- foreach (ProjectFileEventInfo fe in e)
- TagDatabaseManager.Instance.RemoveFileInfo (this, fe.ProjectFile.Name);
- }
-
-
- private static void OnEntryAddedToCombine (object sender, SolutionItemEventArgs e)
- {
- CProject p = e.SolutionItem as CProject;
-
- if (p == null)
- return;
-
- foreach (ProjectFile f in p.Files)
- TagDatabaseManager.Instance.UpdateFileTags (p, f.Name);
- }
-
- internal void NotifyPackageRemovedFromProject (Package package)
- {
- PackageRemovedFromProject (this, new ProjectPackageEventArgs (this, package));
- }
-
- internal void NotifyPackageAddedToProject (Package package)
- {
- PackageAddedToProject (this, new ProjectPackageEventArgs (this, package));
- }
-
- public DeployFileCollection GetDeployFiles (ConfigurationSelector configuration)
- {
- DeployFileCollection deployFiles = new DeployFileCollection ();
-
- CProjectConfiguration conf = (CProjectConfiguration) GetConfiguration (configuration);
- CompileTarget target = conf.CompileTarget;
-
- // Headers and resources
- foreach (ProjectFile f in Files) {
- if (f.BuildAction == BuildAction.Content) {
- string targetDirectory =
- (IsHeaderFile (f.Name) ? TargetDirectory.Include : TargetDirectory.ProgramFiles);
-
- deployFiles.Add (new DeployFile (this, f.FilePath, f.ProjectVirtualPath, targetDirectory));
- }
- }
-
- // Output
- string output = GetOutputFileName (configuration);
- if (!string.IsNullOrEmpty (output)) {
- string targetDirectory = string.Empty;
-
- switch (target) {
- case CompileTarget.Bin:
- targetDirectory = TargetDirectory.ProgramFiles;
- break;
- case CompileTarget.SharedLibrary:
- targetDirectory = TargetDirectory.ProgramFiles;
- break;
- case CompileTarget.StaticLibrary:
- targetDirectory = TargetDirectory.ProgramFiles;
- break;
- }
-
- deployFiles.Add (new DeployFile (this, output, Path.GetFileName (output), targetDirectory));
- }
-
- // PkgPackage
- if (target != CompileTarget.Bin) {
- string pkgfile = WriteDeployablePgkPackage (this, conf);
- deployFiles.Add (new DeployFile (this, Path.Combine (BaseDirectory, pkgfile), pkgfile, LinuxTargetDirectory.PkgConfig));
- }
-
- return deployFiles;
- }
-
- /// <summary>
- /// Finds the corresponding source or header file
- /// </summary>
- /// <param name="sourceFile">
- /// The name of the file to be matched
- /// <see cref="System.String"/>
- /// </param>
- /// <returns>
- /// The corresponding file, or null if not found
- /// <see cref="System.String"/>
- /// </returns>
- public string MatchingFile (string sourceFile) {
- string filenameStub = Path.GetFileNameWithoutExtension (sourceFile);
- bool wantHeader = !CProject.IsHeaderFile (sourceFile);
-
- foreach (ProjectFile file in this.Files) {
- if (filenameStub == Path.GetFileNameWithoutExtension (file.Name)
- && (wantHeader == IsHeaderFile (file.Name))) {
- return file.Name;
- }
- }
-
- return null;
- }
- }
-}
diff --git a/main/src/addins/CBinding/Project/CProjectBinding.cs b/main/src/addins/CBinding/Project/CProjectBinding.cs
deleted file mode 100644
index db379d8763..0000000000
--- a/main/src/addins/CBinding/Project/CProjectBinding.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-//
-// CProjectBinding.cs: binding with the CProject
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Xml;
-using System.IO;
-
-using Mono.Addins;
-
-using MonoDevelop.Projects;
-
-namespace CBinding
-{
- public class CProjectBinding : IProjectBinding
- {
- public string Name {
- get { return "C/C++"; }
- }
-
- public Project CreateProject (ProjectCreateInformation info,
- XmlElement projectOptions)
- {
- string language = projectOptions.GetAttribute ("language");
- return new CProject (info, projectOptions, language);
- }
-
- public Project CreateSingleFileProject (string sourceFile)
- {
- var info = new ProjectCreateInformation () {
- ProjectName = Path.GetFileNameWithoutExtension (sourceFile),
- SolutionPath = Path.GetDirectoryName (sourceFile),
- ProjectBasePath = Path.GetDirectoryName (sourceFile),
- };
-
- Project project = new CProject (info, null, GetLanguage (sourceFile));
- project.Files.Add (new ProjectFile (sourceFile));
- return project;
- }
-
- string GetLanguage (string filename)
- {
- switch (Path.GetExtension (filename.ToLower ())) {
- case ".c":
- return "C";
- case ".cpp":
- case ".cxx":
- return "CPP";
- default:
- return null;
- }
- }
-
- public bool CanCreateSingleFileProject (string sourceFile)
- {
- return GetLanguage (sourceFile) != null;
- }
- }
-}
diff --git a/main/src/addins/CBinding/Project/CProjectConfiguration.cs b/main/src/addins/CBinding/Project/CProjectConfiguration.cs
deleted file mode 100644
index baf48b2a8a..0000000000
--- a/main/src/addins/CBinding/Project/CProjectConfiguration.cs
+++ /dev/null
@@ -1,229 +0,0 @@
-//
-// CProjectConfiguration.cs: Configuration for C/C++ projects
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-
-using Mono.Addins;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Core.Serialization;
-
-namespace CBinding
-{
- public enum CompileTarget {
- Bin,
- StaticLibrary,
- SharedLibrary
- };
-
- // TODO: Warning levels should be compiler specific...
- public enum WarningLevel {
- None,
- Normal,
- All
- }
-
- // I believe it would be in the C/C++ binding's best interest to let the configuration determine
- // which compiler to use... currently the project as a whole does this - which isn't necessarily as flexible
- // as some may require...
- public class CProjectConfiguration : ProjectConfiguration
- {
- [ItemProperty("OutputName")]
- string output = string.Empty;
-
- [ItemProperty("CompileTarget")]
- CBinding.CompileTarget target = CBinding.CompileTarget.Bin;
-
- [ItemProperty ("Includes")]
- [ItemProperty ("Include", Scope = "*", ValueType = typeof(string))]
- private ArrayList includes = new ArrayList ();
-
- [ItemProperty ("LibPaths")]
- [ItemProperty ("LibPath", Scope = "*", ValueType = typeof(string))]
- private ArrayList libpaths = new ArrayList ();
-
- [ItemProperty ("Libs")]
- [ItemProperty ("Lib", Scope = "*", ValueType = typeof(string))]
- private ArrayList libs = new ArrayList ();
-
- [ItemProperty ("WarningLevel", DefaultValue=WarningLevel.Normal)]
- private WarningLevel warning_level = WarningLevel.Normal;
-
- [ItemProperty ("WarningsAsErrors", DefaultValue=false)]
- private bool warnings_as_errors = false;
-
- [ItemProperty ("OptimizationLevel", DefaultValue=0)]
- private int optimization = 0;
-
- [ItemProperty ("ExtraCompilerArguments", DefaultValue="")]
- private string extra_compiler_args = string.Empty;
-
- [ItemProperty ("ExtraLinkerArguments", DefaultValue="")]
- private string extra_linker_args = string.Empty;
-
- [ItemProperty ("DefineSymbols", DefaultValue="")]
- private string define_symbols = string.Empty;
-
- [ProjectPathItemProperty ("SourceDirectory", DefaultValue=null)]
- private string source_directory_path;
-
- [ItemProperty ("UseCcache", DefaultValue=false)]
- private bool use_ccache = false;
-
- [ItemProperty ("PrecompileHeaders", DefaultValue=true)]
- private bool precompileHeaders = true;
-
- public string Output {
- get { return output; }
- set { output = value; }
- }
-
- public CompileTarget CompileTarget {
- get { return target; }
- set { target = value; }
- }
-
- // TODO: This should be revised to use the naming conventions depending on OS & compiler...
- public string CompiledOutputName {
- get {
- string suffix = string.Empty;
- string prefix = string.Empty;
-
- switch (target)
- {
- case CompileTarget.Bin:
- break;
- case CompileTarget.StaticLibrary:
- if (!Output.StartsWith ("lib"))
- prefix = "lib";
- if (!Output.EndsWith (".a"))
- suffix = ".a";
- break;
- case CompileTarget.SharedLibrary:
- if (!Output.StartsWith ("lib"))
- prefix = "lib";
- if (!Output.EndsWith (".so"))
- suffix = ".so";
- break;
- }
-
- return string.Format("{0}{1}{2}", prefix, Output, suffix);
- }
- }
-
- public string SourceDirectory {
- get { return source_directory_path; }
- set { source_directory_path = value; }
- }
-
- public ArrayList Includes {
- get { return includes; }
- set { includes = value; }
- }
-
- public ArrayList LibPaths {
- get { return libpaths; }
- set { libpaths = value; }
- }
-
- public ArrayList Libs {
- get { return libs; }
- set { libs = value; }
- }
-
- public bool UseCcache {
- get { return use_ccache; }
- set { use_ccache = value; }
- }
-
- public bool PrecompileHeaders {
- get { return precompileHeaders; }
- set { precompileHeaders = value; }
- }
-
- public WarningLevel WarningLevel {
- get { return warning_level; }
- set { warning_level = value; }
- }
-
- public bool WarningsAsErrors {
- get { return warnings_as_errors; }
- set { warnings_as_errors = value; }
- }
-
- public int OptimizationLevel {
- get { return optimization; }
- set {
- if (value >= 0 && value <= 3)
- optimization = value;
- else
- optimization = 0;
- }
- }
-
- public string ExtraCompilerArguments {
- get { return extra_compiler_args; }
- set { extra_compiler_args = value; }
- }
-
- public string ExtraLinkerArguments {
- get { return extra_linker_args; }
- set { extra_linker_args = value; }
- }
-
- public string DefineSymbols {
- get { return define_symbols; }
- set { define_symbols = value; }
- }
-
- public override void CopyFrom (ItemConfiguration configuration)
- {
- base.CopyFrom (configuration);
- CProjectConfiguration conf = (CProjectConfiguration)configuration;
-
- output = conf.output;
- target = conf.target;
- includes = conf.includes;
- libpaths = conf.libpaths;
- libs = conf.libs;
- source_directory_path = conf.source_directory_path;
- use_ccache = conf.use_ccache;
-
- warning_level = conf.warning_level;
- warnings_as_errors = conf.warnings_as_errors;
- optimization = conf.optimization;
- extra_compiler_args = conf.extra_compiler_args;
- extra_linker_args = conf.extra_linker_args;
- define_symbols = conf.define_symbols;
- }
- }
-}
diff --git a/main/src/addins/CBinding/Project/CProjectServiceExtension.cs b/main/src/addins/CBinding/Project/CProjectServiceExtension.cs
deleted file mode 100644
index 22775dc090..0000000000
--- a/main/src/addins/CBinding/Project/CProjectServiceExtension.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// CProjectServiceExtension.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Text;
-
-using Mono.Addins;
-
-using MonoDevelop.Core;
-using MonoDevelop.Projects;
-using MonoDevelop.Core.Execution;
-
-namespace CBinding
-{
- public class CProjectServiceExtension : ProjectServiceExtension
- {
- public override bool SupportsItem (IBuildTarget item)
- {
- return item is CProject;
- }
-
- protected override BuildResult Build (IProgressMonitor monitor, SolutionEntityItem entry, ConfigurationSelector configuration)
- {
- CProject project = (CProject) entry;
- CProjectConfiguration conf = (CProjectConfiguration) project.GetConfiguration (configuration);
- if (conf.CompileTarget != CompileTarget.Bin)
- project.WriteMDPkgPackage (configuration);
-
- return base.Build (monitor, entry, configuration);
- }
-
- protected override void Clean (IProgressMonitor monitor, SolutionEntityItem entry, ConfigurationSelector configuration)
- {
- base.Clean (monitor, entry, configuration);
-
- CProject project = (CProject) entry;
- CProjectConfiguration conf = (CProjectConfiguration) project.GetConfiguration (configuration);
- project.Compiler.Clean (project.Files, conf, monitor);
- }
- }
-}
diff --git a/main/src/addins/CBinding/Project/Package.cs b/main/src/addins/CBinding/Project/Package.cs
deleted file mode 100644
index 33a91ce3b0..0000000000
--- a/main/src/addins/CBinding/Project/Package.cs
+++ /dev/null
@@ -1,323 +0,0 @@
-//
-// ProjectPackage.cs: A pkg-config package
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Text;
-using System.Collections.Generic;
-
-using Mono.Addins;
-
-using MonoDevelop.Core;
-using MonoDevelop.Core.Serialization;
-
-namespace CBinding
-{
- public class Package
- {
- [ItemProperty ("file")]
- private string file;
-
- [ItemProperty ("name")]
- private string name;
-
- [ItemProperty ("IsProject")]
- private bool is_project;
-
- private string description;
- private string version;
- private List<string> requires = new List<string>();
- private List<string> libPaths = new List<string>();
- private List<string> libs = new List<string>();
- private List<string> cflags = new List<string>();
- private Dictionary<string, string> vars = new Dictionary<string,string> ();
-
- public Package (string file)
- {
- this.file = file;
- this.is_project = false;
-
- ParsePackageEssentials ();
- }
-
- public Package (CProject project)
- {
- name = project.Name;
- file = Path.Combine (project.BaseDirectory, name + ".md.pc");
- is_project = true;
-
- ParsePackageEssentials ();
- }
-
- public Package ()
- {
- }
-
- void ParsePackageEssentials ()
- {
- string line;
-
- using (StreamReader reader = new StreamReader (file)) {
- while ((line = reader.ReadLine ()) != null) {
- if (line.StartsWith ("Name")) {
- name = line.Split (':')[1].TrimStart ();
- continue;
- }
-
- if (line.StartsWith ("Version")) {
- version = line.Split (':')[1].TrimStart ();
- }
- }
- }
- }
-
- bool parsed = false;
- public void ParsePackage ()
- {
- if (parsed)
- return;
-
- string line;
-
- using (StreamReader reader = new StreamReader (file)) {
- while ((line = reader.ReadLine ()) != null) {
- if (line.StartsWith ("#"))
- continue;
-
- if (line.IndexOf ('=') >= 0)
- ParseVar (line);
-
- if (line.IndexOf (':') >= 0)
- ParseProperty (line);
- }
- }
-
- parsed = true;
- }
-
- void ParseVar (string line)
- {
- int i = line.IndexOf ('=');
- string key = line.Substring (0, i);
- string value = line.Substring (i+1, line.Length - i-1).Trim ();
- string parsedValue = StringParserService.Parse (value, CustomTags ());
-
- vars.Add (key, parsedValue);
- }
-
- void ParseProperty (string line)
- {
- int i = line.IndexOf (':');
- string key = line.Substring (0, i);
- string value = StringParserService.Parse (line.Substring (i+1, line.Length - i-1).Trim (), CustomTags ());
-
- if (value.Length <= 0)
- return;
-
- switch (key) {
- case "Name":
- name = value;
- break;
- case "Description":;
- description = ProcessDescription (value);
- break;
- case "Version":
- version = value;
- break;
- case "Requires":
- ParseRequires (value);
- break;
- case "Libs":
- ParseLibs (value);
- break;
- case "Cflags":
- ParseCFlags (value);
- break;
- }
- }
-
- void ParseRequires (string reqsline)
- {
- string[] splitted = reqsline.Split (' ');
-
- foreach (string str in splitted) {
- if (str.Trim () == string.Empty)
- continue;
- Requires.Add (str);
- }
- }
-
- void ParseLibs (string libline)
- {
- int i = 0;
- string lib;
-
- while (true) {
- i = libline.IndexOf ('-', i);
-
- if (i < 0)
- break;
-
- int count = 0;
-
- while (libline.Length > (count+i+2) && libline[count+i+2] != ' ')
- count++;
-
- lib = libline.Substring (i+2, count);
-
- if (libline[i+1] == 'L') {
- libPaths.Add (lib);
- } else if (libline[i+1] == 'l') {
- libs.Add (lib);
- }
-
- i++;
- }
- }
-
- void ParseCFlags (string cflagsline)
- {
- string[] splitted = cflagsline.Split (' ');
-
- foreach (string str in splitted) {
- if (str.Trim () == string.Empty)
- continue;
- CFlags.Add (str);
- }
- }
-
- /// <summary>
- /// Insert '\n's to make sure string isn't too long.
- /// </summary>
- /// <param name="desc">
- /// The unprocessed description.
- /// A <see cref="System.String"/>
- /// </param>
- /// <returns>
- /// The processed description.
- /// A <see cref="System.String"/>
- /// </returns>
- string ProcessDescription (string desc)
- {
- int length = 80;
-
- if (desc.Length <= length)
- return desc;
-
- StringBuilder builder = new StringBuilder (desc);
- int i = 0;
- int lines = 1;
-
- while (i < desc.Length) {
- i++;
-
- if (i > lines * length) {
- lines++;
-
- do {
- i--;
- } while (desc [i] != ' ');
-
- builder.Replace (' ', '\n', i, 1);
- }
- }
-
- return builder.ToString ();
- }
-
- Dictionary<string, string> CustomTags ()
- {
- Dictionary<string, string> customTags = new Dictionary<string, string> (StringComparer.InvariantCultureIgnoreCase);
- int i = 0;
-
- foreach (KeyValuePair<string, string> kvp in vars) {
- customTags.Add (kvp.Key, kvp.Value);
- i++;
- }
-
- return customTags;
- }
-
- public string File {
- get { return file; }
- set { file = value; }
- }
-
- public string Name {
- get { return name; }
- set { name = value; }
- }
-
- public bool IsProject {
- get { return is_project; }
- set { is_project = value; }
- }
-
- public string Version {
- get { return version; }
- set { version = value; }
- }
-
- public string Description {
- get { return description; }
- }
-
- public List<string> Requires {
- get { return requires; }
- }
-
- public List<string> LibPaths {
- get { return libPaths; }
- }
-
- public List<string> Libs {
- get { return libs; }
- }
-
- public List<string> CFlags {
- get { return cflags; }
- }
-
- public override bool Equals (object o)
- {
- Package other = o as Package;
-
- if (other == null) return false;
-
- return other.File.Equals (file);
- }
-
- public override int GetHashCode ()
- {
- return (name + version).GetHashCode ();
- }
- }
-}
diff --git a/main/src/addins/CBinding/Project/ProjectPackageCollection.cs b/main/src/addins/CBinding/Project/ProjectPackageCollection.cs
deleted file mode 100644
index 3a29ee5c90..0000000000
--- a/main/src/addins/CBinding/Project/ProjectPackageCollection.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-//
-// ProjectPackageCollection.cs: Collection of pkg-config packages for the prject
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-
-using Mono.Addins;
-
-namespace CBinding
-{
- [Serializable()]
- public class ProjectPackageCollection : Collection<Package>
- {
- private CProject project;
-
- internal CProject Project {
- get { return project; }
- set { project = value; }
- }
-
- public ProjectPackageCollection ()
- {
- }
-
- public void AddRange (IEnumerable<Package> packages)
- {
- foreach (Package p in packages)
- Add (p);
- }
-
- protected override void ClearItems()
- {
- if (project != null) {
- List<Package> list = new List<Package> (Items);
- base.ClearItems ();
- foreach (Package p in list) {
- project.NotifyPackageRemovedFromProject (p);
- }
- }
- }
-
- protected override void InsertItem (int index, Package value)
- {
- base.InsertItem (index, value);
- if (project != null) {
- project.NotifyPackageAddedToProject (value);
- }
- }
-
- protected override void RemoveItem (int index)
- {
- Package p = Items [index];
- base.RemoveItem (index);
- if (project != null) {
- project.NotifyPackageRemovedFromProject (p);
- }
- }
-
- protected override void SetItem (int index, Package item)
- {
- Package oldValue = Items [index];
- base.SetItem (index, item);
- if (project != null) {
- project.NotifyPackageRemovedFromProject (oldValue);
- project.NotifyPackageAddedToProject (item);
- }
- }
-
- public string[] ToStringArray ()
- {
- string[] array = new string[Count];
- int i = 0;
-
- foreach (Package p in Items)
- array[i++] = p.Name;
-
- return array;
- }
- }
-}
diff --git a/main/src/addins/CBinding/Project/ProjectPackageEventArgs.cs b/main/src/addins/CBinding/Project/ProjectPackageEventArgs.cs
deleted file mode 100644
index 492ba85716..0000000000
--- a/main/src/addins/CBinding/Project/ProjectPackageEventArgs.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// ProjectPackageEventArgs.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace CBinding
-{
- public delegate void ProjectPackageEventHandler (object sender, ProjectPackageEventArgs e);
-
- public class ProjectPackageEventArgs : EventArgs
- {
- CProject project;
- Package package;
-
- public ProjectPackageEventArgs(CProject project, Package package)
- {
- this.project = project;
- this.package = package;
- }
-
- public CProject Project {
- get { return project; }
- }
-
- public Package Package {
- get { return package; }
- }
- }
-}
diff --git a/main/src/addins/CBinding/ProjectPad/ProjectNodeExtension.cs b/main/src/addins/CBinding/ProjectPad/ProjectNodeExtension.cs
deleted file mode 100644
index 10b6fbbb37..0000000000
--- a/main/src/addins/CBinding/ProjectPad/ProjectNodeExtension.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// ProjectNodeExtension.cs: Adds the packages node to a CProject
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-
-using Mono.Addins;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui.Pads;
-using MonoDevelop.Ide.Gui.Components;
-
-namespace CBinding.ProjectPad
-{
- public class ProjectNodeExtension : NodeBuilderExtension
- {
- public override bool CanBuildNode (Type dataType)
- {
- return typeof(CProject).IsAssignableFrom (dataType);
- }
-
- public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
- {
- CProject p = dataObject as CProject;
-
- if (p == null) return;
-
- builder.AddChild (p.Packages);
- }
- }
-}
diff --git a/main/src/addins/CBinding/ProjectPad/ProjectPackageNodeBuilder.cs b/main/src/addins/CBinding/ProjectPad/ProjectPackageNodeBuilder.cs
deleted file mode 100644
index 6c460d9aac..0000000000
--- a/main/src/addins/CBinding/ProjectPad/ProjectPackageNodeBuilder.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// ProjectPackageNodeBuilder.cs
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Reflection;
-
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.Ide.Gui.Components;
-using MonoDevelop.Ide;
-
-namespace CBinding.ProjectPad
-{
- public class ProjectPackageNodeBuilder : TypeNodeBuilder
- {
- public override Type NodeDataType {
- get { return typeof(Package); }
- }
-
- public override Type CommandHandlerType {
- get { return typeof(PackageNodeCommandHandler); }
- }
-
- public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
- {
- return ((Package)dataObject).File;
- }
-
- public override string ContextMenuAddinPath {
- get { return "/CBinding/Views/ProjectBrowser/ContextMenu/PackageNode"; }
- }
-
- public override void BuildNode (ITreeBuilder treeBuilder,
- object dataObject,
- NodeInfo nodeInfo)
- {
- nodeInfo.Label = ((Package)dataObject).Name;
-
- if (((Package)dataObject).IsProject)
- nodeInfo.Icon = Context.GetIcon ("md-reference-project");
- else
- nodeInfo.Icon = Context.GetIcon (Stock.Reference);
- }
- }
-
- public class PackageNodeCommandHandler : NodeCommandHandler
- {
- public override void DeleteItem ()
- {
- Package package = (Package)CurrentNode.DataItem;
- CProject project = (CProject)CurrentNode.GetParentDataItem (
- typeof(CProject), false);
-
- project.Packages.Remove (package);
-
- IdeApp.ProjectOperations.Save (project);
- }
-
- public override DragOperation CanDragNode ()
- {
- return DragOperation.Copy;
- }
-
- [CommandHandler (CBinding.CProjectCommands.ShowPackageDetails)]
- public void ShowPackageDetails ()
- {
- Package package = (Package)CurrentNode.DataItem;
-
- package.ParsePackage ();
-
- PackageDetails details = new CBinding.PackageDetails (package);
- details.Show ();
- }
- }
-}
diff --git a/main/src/addins/CBinding/ProjectPad/ProjectPackagesFolderNodeBuilder.cs b/main/src/addins/CBinding/ProjectPad/ProjectPackagesFolderNodeBuilder.cs
deleted file mode 100644
index 0108efab3b..0000000000
--- a/main/src/addins/CBinding/ProjectPad/ProjectPackagesFolderNodeBuilder.cs
+++ /dev/null
@@ -1,198 +0,0 @@
-//
-// ProjectPackagesFolderNodeBuilder.cs: Node to control the packages in the project
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using MonoDevelop.Components.Commands;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Components;
-using MonoDevelop.Ide;
-
-namespace CBinding.ProjectPad
-{
- public class ProjectPackagesFolderNodeBuilder : TypeNodeBuilder
- {
- ProjectPackageEventHandler addedHandler;
- ProjectPackageEventHandler removedHandler;
-
- public override Type NodeDataType {
- get { return typeof(ProjectPackageCollection); }
- }
-
- public override void OnNodeAdded (object dataObject)
- {
- CProject project = ((ProjectPackageCollection)dataObject).Project;
- if (project == null) return;
- project.PackageAddedToProject += addedHandler;
- project.PackageRemovedFromProject += removedHandler;
- }
-
- public override void OnNodeRemoved (object dataObject)
- {
- CProject project = ((ProjectPackageCollection)dataObject).Project;
- if (project == null) return;
- project.PackageAddedToProject -= addedHandler;
- project.PackageRemovedFromProject -= removedHandler;
- }
-
- public override Type CommandHandlerType {
- get { return typeof(ProjectPackagesFolderNodeCommandHandler); }
- }
-
- protected override void Initialize ()
- {
- addedHandler = (ProjectPackageEventHandler)DispatchService.GuiDispatch (new ProjectPackageEventHandler (OnAddPackage));
- removedHandler = (ProjectPackageEventHandler)DispatchService.GuiDispatch (new ProjectPackageEventHandler (OnRemovePackage));
- }
-
- public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
- {
- return "Packages";
- }
-
- public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
- {
- nodeInfo.Label = "Packages";
- nodeInfo.Icon = Context.GetIcon (Stock.OpenReferenceFolder);
- nodeInfo.ClosedIcon = Context.GetIcon (Stock.ClosedReferenceFolder);
- }
-
- public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
- {
- return ((ProjectPackageCollection)dataObject).Count > 0;
- }
-
- public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
- {
- ProjectPackageCollection packages = (ProjectPackageCollection)dataObject;
-
- foreach (Package p in packages)
- treeBuilder.AddChild (p);
- }
-
- public override string ContextMenuAddinPath {
- get { return "/CBinding/Views/ProjectBrowser/ContextMenu/PackagesFolderNode"; }
- }
-
- public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
- {
- return -1;
- }
-
- private void OnAddPackage (object sender, ProjectPackageEventArgs e)
- {
- ITreeBuilder builder = Context.GetTreeBuilder (e.Project.Packages);
- if (builder != null)
- builder.UpdateAll ();
- }
-
- private void OnRemovePackage (object sender, ProjectPackageEventArgs e)
- {
- ITreeBuilder builder = Context.GetTreeBuilder (e.Project.Packages);
- if (builder != null)
- builder.UpdateAll ();
- }
- }
-
- public class ProjectPackagesFolderNodeCommandHandler : NodeCommandHandler
- {
- [CommandHandler (CBinding.CProjectCommands.AddPackage)]
- public void AddPackageToProject ()
- {
- CProject project = (CProject)CurrentNode.GetParentDataItem (
- typeof(CProject), false);
-
- using (var dlg = new EditPackagesDialog (project))
- MessageService.ShowCustomDialog (dlg);
-
- IdeApp.ProjectOperations.Save (project);
- CurrentNode.Expanded = true;
- }
-
- // Currently only accepts packages and projects that compile into a static library
- public override bool CanDropNode (object dataObject, DragOperation operation)
- {
- if (dataObject is Package)
- return true;
-
- if (dataObject is CProject) {
- CProject project = (CProject)dataObject;
-
- if (((ProjectPackageCollection)CurrentNode.DataItem).Project.Equals (project))
- return false;
-
- CProjectConfiguration config = (CProjectConfiguration)project.GetConfiguration (IdeApp.Workspace.ActiveConfiguration);
-
- if (config.CompileTarget != CBinding.CompileTarget.Bin)
- return true;
- }
-
- return false;
- }
-
- public override DragOperation CanDragNode ()
- {
- return DragOperation.Copy | DragOperation.Move;
- }
-
- public override void OnNodeDrop (object dataObject, DragOperation operation)
- {
- if (dataObject is Package) {
- Package package = (Package)dataObject;
- ITreeNavigator nav = CurrentNode;
-
- CProject dest = nav.GetParentDataItem (typeof(CProject), true) as CProject;
- nav.MoveToObject (dataObject);
- CProject source = nav.GetParentDataItem (typeof(CProject), true) as CProject;
-
- dest.Packages.Add (package);
- IdeApp.ProjectOperations.Save (dest);
-
- if (operation == DragOperation.Move) {
- source.Packages.Remove (package);
- IdeApp.ProjectOperations.Save (source);
- }
- } else if (dataObject is CProject) {
- CProject draggedProject = (CProject)dataObject;
- CProject destProject = (CurrentNode.DataItem as ProjectPackageCollection).Project;
-
- draggedProject.WriteMDPkgPackage (IdeApp.Workspace.ActiveConfiguration);
-
- Package package = new Package (draggedProject);
-
- if (!destProject.Packages.Contains (package)) {
- destProject.Packages.Add (package);
- IdeApp.ProjectOperations.Save (destProject);
- }
- }
- }
- }
-}
diff --git a/main/src/addins/CBinding/ProjectPad/ProjectReferencesExtension.cs b/main/src/addins/CBinding/ProjectPad/ProjectReferencesExtension.cs
deleted file mode 100644
index 8ca4e4afc9..0000000000
--- a/main/src/addins/CBinding/ProjectPad/ProjectReferencesExtension.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// ProjectReferencesExtension.cs: Hides the ProjectReferencesNode if this is a C/C++ project
-//
-// Authors:
-// Marcos David Marin Amador <MarcosMarin@gmail.com>
-//
-// Copyright (C) 2007 Marcos David Marin Amador
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using Mono.Addins;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui.Pads;
-using MonoDevelop.Ide.Gui.Components;
-
-namespace CBinding.ProjectPad
-{
- public class ProjectReferencesExtension : NodeBuilderExtension
- {
- public override bool CanBuildNode (Type dataType)
- {
- return typeof(ProjectReferenceCollection).IsAssignableFrom (dataType);
- }
-
- public override void GetNodeAttributes (ITreeNavigator parentNode, object dataObject, ref NodeAttributes attributes)
- {
- Project p = parentNode.DataItem as Project;
-
- if (p is CProject)
- attributes |= NodeAttributes.Hidden;
- }
- }
-}
diff --git a/main/src/addins/CBinding/README b/main/src/addins/CBinding/README
deleted file mode 100644
index f4f1ced796..0000000000
--- a/main/src/addins/CBinding/README
+++ /dev/null
@@ -1,7 +0,0 @@
-The following icons might be under the GPL licence and might have to be replaced.
-
-C.Project.ConsoleProject, C.Project.SharedLibrary: These icons were taken and
-slightly modified from the CSharpBinding.
-
-C.Project.StaticLibrary: This icon was taken with no modifications from
-MonoDevelop.Core.Gui
diff --git a/main/src/addins/CBinding/gtk-gui/CBinding.CodeGenerationPanel.cs b/main/src/addins/CBinding/gtk-gui/CBinding.CodeGenerationPanel.cs
deleted file mode 100644
index 3b3b4a1cb8..0000000000
--- a/main/src/addins/CBinding/gtk-gui/CBinding.CodeGenerationPanel.cs
+++ /dev/null
@@ -1,690 +0,0 @@
-
-// This file has been generated by the GUI designer. Do not modify.
-namespace CBinding
-{
- public partial class CodeGenerationPanel
- {
- private global::Gtk.Notebook notebook1;
- private global::Gtk.VBox vbox6;
- private global::Gtk.Table table1;
- private global::Gtk.Label label4;
- private global::Gtk.Label label5;
- private global::Gtk.Label label6;
- private global::Gtk.SpinButton optimizationSpinButton;
- private global::Gtk.ComboBox targetComboBox;
- private global::Gtk.VBox vbox1;
- private global::Gtk.RadioButton noWarningRadio;
- private global::Gtk.RadioButton normalWarningRadio;
- private global::Gtk.RadioButton allWarningRadio;
- private global::Gtk.CheckButton warningsAsErrorsCheckBox;
- private global::Gtk.HBox hbox1;
- private global::Gtk.Label label12;
- private global::Gtk.Entry defineSymbolsTextEntry;
- private global::Gtk.Frame frame2;
- private global::Gtk.Alignment GtkAlignment;
- private global::Gtk.Table table5;
- private global::Gtk.Label label11;
- private global::Gtk.Label label7;
- private global::Gtk.ScrolledWindow scrolledwindow4;
- private global::Gtk.TextView extraCompilerTextView;
- private global::Gtk.ScrolledWindow scrolledwindow5;
- private global::Gtk.TextView extraLinkerTextView;
- private global::Gtk.Label GtkLabel12;
- private global::Gtk.Label label1;
- private global::Gtk.Table table2;
- private global::Gtk.Button addLibButton;
- private global::Gtk.Label label8;
- private global::Gtk.Entry libAddEntry;
- private global::Gtk.ScrolledWindow scrolledwindow1;
- private global::Gtk.TreeView libTreeView;
- private global::Gtk.VBox vbox4;
- private global::Gtk.Button browseButton;
- private global::Gtk.Button removeLibButton;
- private global::Gtk.Label label2;
- private global::Gtk.VBox vbox7;
- private global::Gtk.Table table4;
- private global::Gtk.HBox hbox2;
- private global::Gtk.Entry libPathEntry;
- private global::Gtk.Button quickInsertLibButton;
- private global::Gtk.Label label10;
- private global::Gtk.Button libPathAddButton;
- private global::Gtk.ScrolledWindow scrolledwindow3;
- private global::Gtk.TreeView libPathTreeView;
- private global::Gtk.VBox vbox3;
- private global::Gtk.Button libPathBrowseButton;
- private global::Gtk.Button libPathRemoveButton;
- private global::Gtk.Table table3;
- private global::Gtk.HBox hbox3;
- private global::Gtk.Entry includePathEntry;
- private global::Gtk.Button quickInsertIncludeButton;
- private global::Gtk.Button includePathAddButton;
- private global::Gtk.Label label9;
- private global::Gtk.ScrolledWindow scrolledwindow2;
- private global::Gtk.TreeView includePathTreeView;
- private global::Gtk.VBox vbox5;
- private global::Gtk.Button includePathBrowseButton;
- private global::Gtk.Button includePathRemoveButton;
- private global::Gtk.Label label3;
-
- protected virtual void Build ()
- {
- global::Stetic.Gui.Initialize (this);
- // Widget CBinding.CodeGenerationPanel
- global::Stetic.BinContainer.Attach (this);
- this.Name = "CBinding.CodeGenerationPanel";
- // Container child CBinding.CodeGenerationPanel.Gtk.Container+ContainerChild
- this.notebook1 = new global::Gtk.Notebook ();
- this.notebook1.CanFocus = true;
- this.notebook1.Name = "notebook1";
- this.notebook1.CurrentPage = 0;
- // Container child notebook1.Gtk.Notebook+NotebookChild
- this.vbox6 = new global::Gtk.VBox ();
- this.vbox6.Name = "vbox6";
- this.vbox6.Spacing = 3;
- // Container child vbox6.Gtk.Box+BoxChild
- this.table1 = new global::Gtk.Table (((uint)(3)), ((uint)(2)), false);
- this.table1.Name = "table1";
- this.table1.RowSpacing = ((uint)(5));
- this.table1.ColumnSpacing = ((uint)(5));
- this.table1.BorderWidth = ((uint)(2));
- // Container child table1.Gtk.Table+TableChild
- this.label4 = new global::Gtk.Label ();
- this.label4.Name = "label4";
- this.label4.Xpad = 10;
- this.label4.Xalign = 0F;
- this.label4.LabelProp = global::Mono.Unix.Catalog.GetString ("Warning Level:");
- this.table1.Add (this.label4);
- global::Gtk.Table.TableChild w1 = ((global::Gtk.Table.TableChild)(this.table1 [this.label4]));
- w1.XOptions = ((global::Gtk.AttachOptions)(4));
- w1.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.label5 = new global::Gtk.Label ();
- this.label5.Name = "label5";
- this.label5.Xpad = 10;
- this.label5.Xalign = 0F;
- this.label5.LabelProp = global::Mono.Unix.Catalog.GetString ("Optimization Level:");
- this.table1.Add (this.label5);
- global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1 [this.label5]));
- w2.TopAttach = ((uint)(1));
- w2.BottomAttach = ((uint)(2));
- w2.XOptions = ((global::Gtk.AttachOptions)(4));
- w2.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.label6 = new global::Gtk.Label ();
- this.label6.Name = "label6";
- this.label6.Xpad = 10;
- this.label6.Xalign = 0F;
- this.label6.LabelProp = global::Mono.Unix.Catalog.GetString ("Target:");
- this.table1.Add (this.label6);
- global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1 [this.label6]));
- w3.TopAttach = ((uint)(2));
- w3.BottomAttach = ((uint)(3));
- w3.XOptions = ((global::Gtk.AttachOptions)(4));
- w3.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.optimizationSpinButton = new global::Gtk.SpinButton (0, 3, 1);
- this.optimizationSpinButton.CanFocus = true;
- this.optimizationSpinButton.Name = "optimizationSpinButton";
- this.optimizationSpinButton.Adjustment.PageIncrement = 10;
- this.optimizationSpinButton.ClimbRate = 1;
- this.optimizationSpinButton.Numeric = true;
- this.table1.Add (this.optimizationSpinButton);
- global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1 [this.optimizationSpinButton]));
- w4.TopAttach = ((uint)(1));
- w4.BottomAttach = ((uint)(2));
- w4.LeftAttach = ((uint)(1));
- w4.RightAttach = ((uint)(2));
- w4.XOptions = ((global::Gtk.AttachOptions)(4));
- w4.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.targetComboBox = global::Gtk.ComboBox.NewText ();
- this.targetComboBox.AppendText (global::Mono.Unix.Catalog.GetString ("Executable"));
- this.targetComboBox.AppendText (global::Mono.Unix.Catalog.GetString ("Static Library"));
- this.targetComboBox.AppendText (global::Mono.Unix.Catalog.GetString ("Shared Object"));
- this.targetComboBox.Name = "targetComboBox";
- this.table1.Add (this.targetComboBox);
- global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1 [this.targetComboBox]));
- w5.TopAttach = ((uint)(2));
- w5.BottomAttach = ((uint)(3));
- w5.LeftAttach = ((uint)(1));
- w5.RightAttach = ((uint)(2));
- w5.XOptions = ((global::Gtk.AttachOptions)(4));
- w5.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.vbox1 = new global::Gtk.VBox ();
- this.vbox1.Name = "vbox1";
- this.vbox1.Spacing = 1;
- // Container child vbox1.Gtk.Box+BoxChild
- this.noWarningRadio = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("no warnings"));
- this.noWarningRadio.CanFocus = true;
- this.noWarningRadio.Name = "noWarningRadio";
- this.noWarningRadio.Active = true;
- this.noWarningRadio.DrawIndicator = true;
- this.noWarningRadio.UseUnderline = true;
- this.noWarningRadio.Group = new global::GLib.SList (global::System.IntPtr.Zero);
- this.vbox1.Add (this.noWarningRadio);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.noWarningRadio]));
- w6.Position = 0;
- w6.Expand = false;
- w6.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.normalWarningRadio = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("normal"));
- this.normalWarningRadio.CanFocus = true;
- this.normalWarningRadio.Name = "normalWarningRadio";
- this.normalWarningRadio.DrawIndicator = true;
- this.normalWarningRadio.UseUnderline = true;
- this.normalWarningRadio.Group = this.noWarningRadio.Group;
- this.vbox1.Add (this.normalWarningRadio);
- global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.normalWarningRadio]));
- w7.Position = 1;
- w7.Expand = false;
- w7.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.allWarningRadio = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("all"));
- this.allWarningRadio.CanFocus = true;
- this.allWarningRadio.Name = "allWarningRadio";
- this.allWarningRadio.DrawIndicator = true;
- this.allWarningRadio.UseUnderline = true;
- this.allWarningRadio.Group = this.noWarningRadio.Group;
- this.vbox1.Add (this.allWarningRadio);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.allWarningRadio]));
- w8.Position = 2;
- w8.Expand = false;
- w8.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.warningsAsErrorsCheckBox = new global::Gtk.CheckButton ();
- this.warningsAsErrorsCheckBox.CanFocus = true;
- this.warningsAsErrorsCheckBox.Name = "warningsAsErrorsCheckBox";
- this.warningsAsErrorsCheckBox.Label = global::Mono.Unix.Catalog.GetString ("Treat warnings as errors");
- this.warningsAsErrorsCheckBox.DrawIndicator = true;
- this.warningsAsErrorsCheckBox.UseUnderline = true;
- this.vbox1.Add (this.warningsAsErrorsCheckBox);
- global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.warningsAsErrorsCheckBox]));
- w9.Position = 3;
- w9.Expand = false;
- w9.Fill = false;
- this.table1.Add (this.vbox1);
- global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table1 [this.vbox1]));
- w10.LeftAttach = ((uint)(1));
- w10.RightAttach = ((uint)(2));
- w10.XOptions = ((global::Gtk.AttachOptions)(4));
- w10.YOptions = ((global::Gtk.AttachOptions)(4));
- this.vbox6.Add (this.table1);
- global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.table1]));
- w11.Position = 0;
- w11.Expand = false;
- w11.Fill = false;
- // Container child vbox6.Gtk.Box+BoxChild
- this.hbox1 = new global::Gtk.HBox ();
- this.hbox1.Name = "hbox1";
- this.hbox1.Spacing = 6;
- // Container child hbox1.Gtk.Box+BoxChild
- this.label12 = new global::Gtk.Label ();
- this.label12.Name = "label12";
- this.label12.Xpad = 13;
- this.label12.Xalign = 0F;
- this.label12.LabelProp = global::Mono.Unix.Catalog.GetString ("Define Symbols:");
- this.hbox1.Add (this.label12);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label12]));
- w12.Position = 0;
- w12.Expand = false;
- w12.Fill = false;
- // Container child hbox1.Gtk.Box+BoxChild
- this.defineSymbolsTextEntry = new global::Gtk.Entry ();
- this.defineSymbolsTextEntry.TooltipMarkup = "A space seperated list of symbols to define.";
- this.defineSymbolsTextEntry.CanFocus = true;
- this.defineSymbolsTextEntry.Name = "defineSymbolsTextEntry";
- this.defineSymbolsTextEntry.IsEditable = true;
- this.defineSymbolsTextEntry.InvisibleChar = '●';
- this.hbox1.Add (this.defineSymbolsTextEntry);
- global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.defineSymbolsTextEntry]));
- w13.Position = 1;
- w13.Padding = ((uint)(14));
- this.vbox6.Add (this.hbox1);
- global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.hbox1]));
- w14.Position = 1;
- w14.Expand = false;
- w14.Fill = false;
- // Container child vbox6.Gtk.Box+BoxChild
- this.frame2 = new global::Gtk.Frame ();
- this.frame2.Name = "frame2";
- this.frame2.ShadowType = ((global::Gtk.ShadowType)(0));
- this.frame2.LabelYalign = 0F;
- // Container child frame2.Gtk.Container+ContainerChild
- this.GtkAlignment = new global::Gtk.Alignment (0F, 0F, 1F, 1F);
- this.GtkAlignment.Name = "GtkAlignment";
- this.GtkAlignment.LeftPadding = ((uint)(12));
- // Container child GtkAlignment.Gtk.Container+ContainerChild
- this.table5 = new global::Gtk.Table (((uint)(2)), ((uint)(2)), false);
- this.table5.Name = "table5";
- this.table5.RowSpacing = ((uint)(6));
- this.table5.ColumnSpacing = ((uint)(9));
- this.table5.BorderWidth = ((uint)(6));
- // Container child table5.Gtk.Table+TableChild
- this.label11 = new global::Gtk.Label ();
- this.label11.Name = "label11";
- this.label11.Xalign = 0F;
- this.label11.LabelProp = global::Mono.Unix.Catalog.GetString ("Extra Linker Options");
- this.table5.Add (this.label11);
- global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table5 [this.label11]));
- w15.LeftAttach = ((uint)(1));
- w15.RightAttach = ((uint)(2));
- w15.XOptions = ((global::Gtk.AttachOptions)(4));
- w15.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table5.Gtk.Table+TableChild
- this.label7 = new global::Gtk.Label ();
- this.label7.Name = "label7";
- this.label7.Xalign = 0F;
- this.label7.LabelProp = global::Mono.Unix.Catalog.GetString ("Extra Compiler Options");
- this.table5.Add (this.label7);
- global::Gtk.Table.TableChild w16 = ((global::Gtk.Table.TableChild)(this.table5 [this.label7]));
- w16.XOptions = ((global::Gtk.AttachOptions)(4));
- w16.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table5.Gtk.Table+TableChild
- this.scrolledwindow4 = new global::Gtk.ScrolledWindow ();
- this.scrolledwindow4.CanFocus = true;
- this.scrolledwindow4.Name = "scrolledwindow4";
- this.scrolledwindow4.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child scrolledwindow4.Gtk.Container+ContainerChild
- this.extraCompilerTextView = new global::Gtk.TextView ();
- this.extraCompilerTextView.TooltipMarkup = "A newline seperated list of extra options to send to the compiler.\nOne option can be in more than one line.\nExample:\n\t`pkg-config\n\t--cflags\n\tcairo`";
- this.extraCompilerTextView.CanFocus = true;
- this.extraCompilerTextView.Name = "extraCompilerTextView";
- this.scrolledwindow4.Add (this.extraCompilerTextView);
- this.table5.Add (this.scrolledwindow4);
- global::Gtk.Table.TableChild w18 = ((global::Gtk.Table.TableChild)(this.table5 [this.scrolledwindow4]));
- w18.TopAttach = ((uint)(1));
- w18.BottomAttach = ((uint)(2));
- // Container child table5.Gtk.Table+TableChild
- this.scrolledwindow5 = new global::Gtk.ScrolledWindow ();
- this.scrolledwindow5.CanFocus = true;
- this.scrolledwindow5.Name = "scrolledwindow5";
- this.scrolledwindow5.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child scrolledwindow5.Gtk.Container+ContainerChild
- this.extraLinkerTextView = new global::Gtk.TextView ();
- this.extraLinkerTextView.TooltipMarkup = "A newline seperated list of extra options to send to the linker.\nOne option can be in more than one line.\nExample:\n\t`pkg-config\n\t--libs\n\tcairo`";
- this.extraLinkerTextView.CanFocus = true;
- this.extraLinkerTextView.Name = "extraLinkerTextView";
- this.scrolledwindow5.Add (this.extraLinkerTextView);
- this.table5.Add (this.scrolledwindow5);
- global::Gtk.Table.TableChild w20 = ((global::Gtk.Table.TableChild)(this.table5 [this.scrolledwindow5]));
- w20.TopAttach = ((uint)(1));
- w20.BottomAttach = ((uint)(2));
- w20.LeftAttach = ((uint)(1));
- w20.RightAttach = ((uint)(2));
- w20.YOptions = ((global::Gtk.AttachOptions)(4));
- this.GtkAlignment.Add (this.table5);
- this.frame2.Add (this.GtkAlignment);
- this.GtkLabel12 = new global::Gtk.Label ();
- this.GtkLabel12.Name = "GtkLabel12";
- this.GtkLabel12.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Extra Options</b>");
- this.GtkLabel12.UseMarkup = true;
- this.frame2.LabelWidget = this.GtkLabel12;
- this.vbox6.Add (this.frame2);
- global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.frame2]));
- w23.Position = 2;
- this.notebook1.Add (this.vbox6);
- // Notebook tab
- this.label1 = new global::Gtk.Label ();
- this.label1.Name = "label1";
- this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("Code Generation");
- this.notebook1.SetTabLabel (this.vbox6, this.label1);
- this.label1.ShowAll ();
- // Container child notebook1.Gtk.Notebook+NotebookChild
- this.table2 = new global::Gtk.Table (((uint)(2)), ((uint)(3)), false);
- this.table2.Name = "table2";
- this.table2.RowSpacing = ((uint)(10));
- this.table2.ColumnSpacing = ((uint)(10));
- this.table2.BorderWidth = ((uint)(3));
- // Container child table2.Gtk.Table+TableChild
- this.addLibButton = new global::Gtk.Button ();
- this.addLibButton.Sensitive = false;
- this.addLibButton.CanFocus = true;
- this.addLibButton.Name = "addLibButton";
- this.addLibButton.UseUnderline = true;
- this.addLibButton.Label = global::Mono.Unix.Catalog.GetString ("Add");
- this.table2.Add (this.addLibButton);
- global::Gtk.Table.TableChild w25 = ((global::Gtk.Table.TableChild)(this.table2 [this.addLibButton]));
- w25.LeftAttach = ((uint)(2));
- w25.RightAttach = ((uint)(3));
- w25.XOptions = ((global::Gtk.AttachOptions)(4));
- w25.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table2.Gtk.Table+TableChild
- this.label8 = new global::Gtk.Label ();
- this.label8.Name = "label8";
- this.label8.LabelProp = global::Mono.Unix.Catalog.GetString ("Library:");
- this.table2.Add (this.label8);
- global::Gtk.Table.TableChild w26 = ((global::Gtk.Table.TableChild)(this.table2 [this.label8]));
- w26.XOptions = ((global::Gtk.AttachOptions)(4));
- w26.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table2.Gtk.Table+TableChild
- this.libAddEntry = new global::Gtk.Entry ();
- this.libAddEntry.CanFocus = true;
- this.libAddEntry.Name = "libAddEntry";
- this.libAddEntry.IsEditable = true;
- this.libAddEntry.InvisibleChar = '●';
- this.table2.Add (this.libAddEntry);
- global::Gtk.Table.TableChild w27 = ((global::Gtk.Table.TableChild)(this.table2 [this.libAddEntry]));
- w27.LeftAttach = ((uint)(1));
- w27.RightAttach = ((uint)(2));
- w27.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table2.Gtk.Table+TableChild
- this.scrolledwindow1 = new global::Gtk.ScrolledWindow ();
- this.scrolledwindow1.CanFocus = true;
- this.scrolledwindow1.Name = "scrolledwindow1";
- this.scrolledwindow1.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child scrolledwindow1.Gtk.Container+ContainerChild
- this.libTreeView = new global::Gtk.TreeView ();
- this.libTreeView.CanFocus = true;
- this.libTreeView.Name = "libTreeView";
- this.scrolledwindow1.Add (this.libTreeView);
- this.table2.Add (this.scrolledwindow1);
- global::Gtk.Table.TableChild w29 = ((global::Gtk.Table.TableChild)(this.table2 [this.scrolledwindow1]));
- w29.TopAttach = ((uint)(1));
- w29.BottomAttach = ((uint)(2));
- w29.LeftAttach = ((uint)(1));
- w29.RightAttach = ((uint)(2));
- // Container child table2.Gtk.Table+TableChild
- this.vbox4 = new global::Gtk.VBox ();
- this.vbox4.Name = "vbox4";
- this.vbox4.Spacing = 6;
- // Container child vbox4.Gtk.Box+BoxChild
- this.browseButton = new global::Gtk.Button ();
- this.browseButton.CanFocus = true;
- this.browseButton.Name = "browseButton";
- this.browseButton.UseUnderline = true;
- this.browseButton.Label = global::Mono.Unix.Catalog.GetString ("Browse...");
- this.vbox4.Add (this.browseButton);
- global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.browseButton]));
- w30.Position = 0;
- w30.Expand = false;
- w30.Fill = false;
- // Container child vbox4.Gtk.Box+BoxChild
- this.removeLibButton = new global::Gtk.Button ();
- this.removeLibButton.Sensitive = false;
- this.removeLibButton.CanFocus = true;
- this.removeLibButton.Name = "removeLibButton";
- this.removeLibButton.UseUnderline = true;
- this.removeLibButton.Label = global::Mono.Unix.Catalog.GetString ("Remove");
- this.vbox4.Add (this.removeLibButton);
- global::Gtk.Box.BoxChild w31 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.removeLibButton]));
- w31.Position = 1;
- w31.Expand = false;
- w31.Fill = false;
- this.table2.Add (this.vbox4);
- global::Gtk.Table.TableChild w32 = ((global::Gtk.Table.TableChild)(this.table2 [this.vbox4]));
- w32.TopAttach = ((uint)(1));
- w32.BottomAttach = ((uint)(2));
- w32.LeftAttach = ((uint)(2));
- w32.RightAttach = ((uint)(3));
- w32.XOptions = ((global::Gtk.AttachOptions)(4));
- this.notebook1.Add (this.table2);
- global::Gtk.Notebook.NotebookChild w33 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.table2]));
- w33.Position = 1;
- // Notebook tab
- this.label2 = new global::Gtk.Label ();
- this.label2.Name = "label2";
- this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Libraries");
- this.notebook1.SetTabLabel (this.table2, this.label2);
- this.label2.ShowAll ();
- // Container child notebook1.Gtk.Notebook+NotebookChild
- this.vbox7 = new global::Gtk.VBox ();
- this.vbox7.Name = "vbox7";
- this.vbox7.Spacing = 6;
- this.vbox7.BorderWidth = ((uint)(3));
- // Container child vbox7.Gtk.Box+BoxChild
- this.table4 = new global::Gtk.Table (((uint)(2)), ((uint)(3)), false);
- this.table4.Name = "table4";
- this.table4.RowSpacing = ((uint)(10));
- this.table4.ColumnSpacing = ((uint)(10));
- // Container child table4.Gtk.Table+TableChild
- this.hbox2 = new global::Gtk.HBox ();
- this.hbox2.Name = "hbox2";
- this.hbox2.Spacing = 6;
- // Container child hbox2.Gtk.Box+BoxChild
- this.libPathEntry = new global::Gtk.Entry ();
- this.libPathEntry.CanFocus = true;
- this.libPathEntry.Name = "libPathEntry";
- this.libPathEntry.IsEditable = true;
- this.libPathEntry.InvisibleChar = '●';
- this.hbox2.Add (this.libPathEntry);
- global::Gtk.Box.BoxChild w34 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.libPathEntry]));
- w34.Position = 0;
- // Container child hbox2.Gtk.Box+BoxChild
- this.quickInsertLibButton = new global::Gtk.Button ();
- this.quickInsertLibButton.TooltipMarkup = "Insert a macro.";
- this.quickInsertLibButton.CanFocus = true;
- this.quickInsertLibButton.Name = "quickInsertLibButton";
- this.quickInsertLibButton.UseUnderline = true;
- this.quickInsertLibButton.Label = global::Mono.Unix.Catalog.GetString (">");
- this.hbox2.Add (this.quickInsertLibButton);
- global::Gtk.Box.BoxChild w35 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.quickInsertLibButton]));
- w35.Position = 1;
- w35.Expand = false;
- w35.Fill = false;
- this.table4.Add (this.hbox2);
- global::Gtk.Table.TableChild w36 = ((global::Gtk.Table.TableChild)(this.table4 [this.hbox2]));
- w36.LeftAttach = ((uint)(1));
- w36.RightAttach = ((uint)(2));
- w36.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.label10 = new global::Gtk.Label ();
- this.label10.Name = "label10";
- this.label10.LabelProp = global::Mono.Unix.Catalog.GetString ("Library:");
- this.table4.Add (this.label10);
- global::Gtk.Table.TableChild w37 = ((global::Gtk.Table.TableChild)(this.table4 [this.label10]));
- w37.XOptions = ((global::Gtk.AttachOptions)(4));
- w37.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.libPathAddButton = new global::Gtk.Button ();
- this.libPathAddButton.Sensitive = false;
- this.libPathAddButton.CanFocus = true;
- this.libPathAddButton.Name = "libPathAddButton";
- this.libPathAddButton.UseUnderline = true;
- this.libPathAddButton.Label = global::Mono.Unix.Catalog.GetString ("Add");
- this.table4.Add (this.libPathAddButton);
- global::Gtk.Table.TableChild w38 = ((global::Gtk.Table.TableChild)(this.table4 [this.libPathAddButton]));
- w38.LeftAttach = ((uint)(2));
- w38.RightAttach = ((uint)(3));
- w38.XOptions = ((global::Gtk.AttachOptions)(4));
- w38.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.scrolledwindow3 = new global::Gtk.ScrolledWindow ();
- this.scrolledwindow3.CanFocus = true;
- this.scrolledwindow3.Name = "scrolledwindow3";
- this.scrolledwindow3.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child scrolledwindow3.Gtk.Container+ContainerChild
- this.libPathTreeView = new global::Gtk.TreeView ();
- this.libPathTreeView.CanFocus = true;
- this.libPathTreeView.Name = "libPathTreeView";
- this.scrolledwindow3.Add (this.libPathTreeView);
- this.table4.Add (this.scrolledwindow3);
- global::Gtk.Table.TableChild w40 = ((global::Gtk.Table.TableChild)(this.table4 [this.scrolledwindow3]));
- w40.TopAttach = ((uint)(1));
- w40.BottomAttach = ((uint)(2));
- w40.LeftAttach = ((uint)(1));
- w40.RightAttach = ((uint)(2));
- // Container child table4.Gtk.Table+TableChild
- this.vbox3 = new global::Gtk.VBox ();
- this.vbox3.Name = "vbox3";
- this.vbox3.Spacing = 6;
- // Container child vbox3.Gtk.Box+BoxChild
- this.libPathBrowseButton = new global::Gtk.Button ();
- this.libPathBrowseButton.CanFocus = true;
- this.libPathBrowseButton.Name = "libPathBrowseButton";
- this.libPathBrowseButton.UseUnderline = true;
- this.libPathBrowseButton.Label = global::Mono.Unix.Catalog.GetString ("Browse...");
- this.vbox3.Add (this.libPathBrowseButton);
- global::Gtk.Box.BoxChild w41 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.libPathBrowseButton]));
- w41.Position = 0;
- w41.Expand = false;
- w41.Fill = false;
- // Container child vbox3.Gtk.Box+BoxChild
- this.libPathRemoveButton = new global::Gtk.Button ();
- this.libPathRemoveButton.Sensitive = false;
- this.libPathRemoveButton.CanFocus = true;
- this.libPathRemoveButton.Name = "libPathRemoveButton";
- this.libPathRemoveButton.UseUnderline = true;
- this.libPathRemoveButton.Label = global::Mono.Unix.Catalog.GetString ("Remove");
- this.vbox3.Add (this.libPathRemoveButton);
- global::Gtk.Box.BoxChild w42 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.libPathRemoveButton]));
- w42.Position = 1;
- w42.Expand = false;
- w42.Fill = false;
- this.table4.Add (this.vbox3);
- global::Gtk.Table.TableChild w43 = ((global::Gtk.Table.TableChild)(this.table4 [this.vbox3]));
- w43.TopAttach = ((uint)(1));
- w43.BottomAttach = ((uint)(2));
- w43.LeftAttach = ((uint)(2));
- w43.RightAttach = ((uint)(3));
- w43.XOptions = ((global::Gtk.AttachOptions)(4));
- this.vbox7.Add (this.table4);
- global::Gtk.Box.BoxChild w44 = ((global::Gtk.Box.BoxChild)(this.vbox7 [this.table4]));
- w44.Position = 0;
- // Container child vbox7.Gtk.Box+BoxChild
- this.table3 = new global::Gtk.Table (((uint)(2)), ((uint)(3)), false);
- this.table3.Name = "table3";
- this.table3.RowSpacing = ((uint)(10));
- this.table3.ColumnSpacing = ((uint)(10));
- // Container child table3.Gtk.Table+TableChild
- this.hbox3 = new global::Gtk.HBox ();
- this.hbox3.Name = "hbox3";
- this.hbox3.Spacing = 6;
- // Container child hbox3.Gtk.Box+BoxChild
- this.includePathEntry = new global::Gtk.Entry ();
- this.includePathEntry.CanFocus = true;
- this.includePathEntry.Name = "includePathEntry";
- this.includePathEntry.IsEditable = true;
- this.includePathEntry.InvisibleChar = '●';
- this.hbox3.Add (this.includePathEntry);
- global::Gtk.Box.BoxChild w45 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.includePathEntry]));
- w45.Position = 0;
- // Container child hbox3.Gtk.Box+BoxChild
- this.quickInsertIncludeButton = new global::Gtk.Button ();
- this.quickInsertIncludeButton.TooltipMarkup = "Insert a macro.";
- this.quickInsertIncludeButton.CanFocus = true;
- this.quickInsertIncludeButton.Name = "quickInsertIncludeButton";
- this.quickInsertIncludeButton.UseUnderline = true;
- this.quickInsertIncludeButton.Label = global::Mono.Unix.Catalog.GetString (">");
- this.hbox3.Add (this.quickInsertIncludeButton);
- global::Gtk.Box.BoxChild w46 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.quickInsertIncludeButton]));
- w46.Position = 1;
- w46.Expand = false;
- w46.Fill = false;
- this.table3.Add (this.hbox3);
- global::Gtk.Table.TableChild w47 = ((global::Gtk.Table.TableChild)(this.table3 [this.hbox3]));
- w47.LeftAttach = ((uint)(1));
- w47.RightAttach = ((uint)(2));
- w47.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table3.Gtk.Table+TableChild
- this.includePathAddButton = new global::Gtk.Button ();
- this.includePathAddButton.Sensitive = false;
- this.includePathAddButton.CanFocus = true;
- this.includePathAddButton.Name = "includePathAddButton";
- this.includePathAddButton.UseUnderline = true;
- this.includePathAddButton.Label = global::Mono.Unix.Catalog.GetString ("Add");
- this.table3.Add (this.includePathAddButton);
- global::Gtk.Table.TableChild w48 = ((global::Gtk.Table.TableChild)(this.table3 [this.includePathAddButton]));
- w48.LeftAttach = ((uint)(2));
- w48.RightAttach = ((uint)(3));
- w48.XOptions = ((global::Gtk.AttachOptions)(4));
- w48.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table3.Gtk.Table+TableChild
- this.label9 = new global::Gtk.Label ();
- this.label9.Name = "label9";
- this.label9.LabelProp = global::Mono.Unix.Catalog.GetString ("Include:");
- this.table3.Add (this.label9);
- global::Gtk.Table.TableChild w49 = ((global::Gtk.Table.TableChild)(this.table3 [this.label9]));
- w49.XOptions = ((global::Gtk.AttachOptions)(4));
- w49.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table3.Gtk.Table+TableChild
- this.scrolledwindow2 = new global::Gtk.ScrolledWindow ();
- this.scrolledwindow2.CanFocus = true;
- this.scrolledwindow2.Name = "scrolledwindow2";
- this.scrolledwindow2.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child scrolledwindow2.Gtk.Container+ContainerChild
- this.includePathTreeView = new global::Gtk.TreeView ();
- this.includePathTreeView.CanFocus = true;
- this.includePathTreeView.Name = "includePathTreeView";
- this.scrolledwindow2.Add (this.includePathTreeView);
- this.table3.Add (this.scrolledwindow2);
- global::Gtk.Table.TableChild w51 = ((global::Gtk.Table.TableChild)(this.table3 [this.scrolledwindow2]));
- w51.TopAttach = ((uint)(1));
- w51.BottomAttach = ((uint)(2));
- w51.LeftAttach = ((uint)(1));
- w51.RightAttach = ((uint)(2));
- // Container child table3.Gtk.Table+TableChild
- this.vbox5 = new global::Gtk.VBox ();
- this.vbox5.Name = "vbox5";
- this.vbox5.Spacing = 6;
- // Container child vbox5.Gtk.Box+BoxChild
- this.includePathBrowseButton = new global::Gtk.Button ();
- this.includePathBrowseButton.CanFocus = true;
- this.includePathBrowseButton.Name = "includePathBrowseButton";
- this.includePathBrowseButton.UseUnderline = true;
- this.includePathBrowseButton.Label = global::Mono.Unix.Catalog.GetString ("Browse...");
- this.vbox5.Add (this.includePathBrowseButton);
- global::Gtk.Box.BoxChild w52 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.includePathBrowseButton]));
- w52.Position = 0;
- w52.Expand = false;
- w52.Fill = false;
- // Container child vbox5.Gtk.Box+BoxChild
- this.includePathRemoveButton = new global::Gtk.Button ();
- this.includePathRemoveButton.Sensitive = false;
- this.includePathRemoveButton.CanFocus = true;
- this.includePathRemoveButton.Name = "includePathRemoveButton";
- this.includePathRemoveButton.UseUnderline = true;
- this.includePathRemoveButton.Label = global::Mono.Unix.Catalog.GetString ("Remove");
- this.vbox5.Add (this.includePathRemoveButton);
- global::Gtk.Box.BoxChild w53 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.includePathRemoveButton]));
- w53.Position = 1;
- w53.Expand = false;
- w53.Fill = false;
- this.table3.Add (this.vbox5);
- global::Gtk.Table.TableChild w54 = ((global::Gtk.Table.TableChild)(this.table3 [this.vbox5]));
- w54.TopAttach = ((uint)(1));
- w54.BottomAttach = ((uint)(2));
- w54.LeftAttach = ((uint)(2));
- w54.RightAttach = ((uint)(3));
- w54.XOptions = ((global::Gtk.AttachOptions)(4));
- this.vbox7.Add (this.table3);
- global::Gtk.Box.BoxChild w55 = ((global::Gtk.Box.BoxChild)(this.vbox7 [this.table3]));
- w55.Position = 1;
- this.notebook1.Add (this.vbox7);
- global::Gtk.Notebook.NotebookChild w56 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.vbox7]));
- w56.Position = 2;
- // Notebook tab
- this.label3 = new global::Gtk.Label ();
- this.label3.Name = "label3";
- this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("Paths");
- this.notebook1.SetTabLabel (this.vbox7, this.label3);
- this.label3.ShowAll ();
- this.Add (this.notebook1);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
- }
- this.Show ();
- this.browseButton.Clicked += new global::System.EventHandler (this.OnBrowseButtonClick);
- this.removeLibButton.Clicked += new global::System.EventHandler (this.OnRemoveLibButtonClicked);
- this.removeLibButton.Clicked += new global::System.EventHandler (this.OnLibRemoved);
- this.libTreeView.CursorChanged += new global::System.EventHandler (this.OnLibTreeViewCursorChanged);
- this.libAddEntry.Changed += new global::System.EventHandler (this.OnLibAddEntryChanged);
- this.libAddEntry.Activated += new global::System.EventHandler (this.OnLibAddEntryActivated);
- this.addLibButton.Clicked += new global::System.EventHandler (this.OnLibAdded);
- this.libPathBrowseButton.Clicked += new global::System.EventHandler (this.OnLibPathBrowseButtonClick);
- this.libPathRemoveButton.Clicked += new global::System.EventHandler (this.OnLibPathRemoveButtonClicked);
- this.libPathRemoveButton.Clicked += new global::System.EventHandler (this.OnLibPathRemoved);
- this.libPathTreeView.CursorChanged += new global::System.EventHandler (this.OnLibPathTreeViewCursorChanged);
- this.libPathAddButton.Clicked += new global::System.EventHandler (this.OnLibPathAdded);
- this.libPathEntry.Changed += new global::System.EventHandler (this.OnLibPathEntryChanged);
- this.libPathEntry.Activated += new global::System.EventHandler (this.OnLibPathEntryActivated);
- this.includePathBrowseButton.Clicked += new global::System.EventHandler (this.OnIncludePathBrowseButtonClick);
- this.includePathRemoveButton.Clicked += new global::System.EventHandler (this.OnIncludePathRemoveButtonClicked);
- this.includePathRemoveButton.Clicked += new global::System.EventHandler (this.OnIncludePathRemoved);
- this.includePathTreeView.CursorChanged += new global::System.EventHandler (this.OnIncludePathTreeViewCursorChanged);
- this.includePathAddButton.Clicked += new global::System.EventHandler (this.OnIncludePathAdded);
- this.includePathEntry.Changed += new global::System.EventHandler (this.OnIncludePathEntryChanged);
- this.includePathEntry.Activated += new global::System.EventHandler (this.OnIncludePathEntryActivated);
- }
- }
-}
diff --git a/main/src/addins/CBinding/gtk-gui/CBinding.CompilerPanel.cs b/main/src/addins/CBinding/gtk-gui/CBinding.CompilerPanel.cs
deleted file mode 100644
index be3c43f1ce..0000000000
--- a/main/src/addins/CBinding/gtk-gui/CBinding.CompilerPanel.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-
-// This file has been generated by the GUI designer. Do not modify.
-namespace CBinding
-{
- public partial class CompilerPanel
- {
- private global::Gtk.Table table2;
- private global::Gtk.ComboBox compilerComboBox;
- private global::Gtk.CheckButton useCcacheCheckBox;
-
- protected virtual void Build ()
- {
- global::Stetic.Gui.Initialize (this);
- // Widget CBinding.CompilerPanel
- global::Stetic.BinContainer.Attach (this);
- this.Name = "CBinding.CompilerPanel";
- // Container child CBinding.CompilerPanel.Gtk.Container+ContainerChild
- this.table2 = new global::Gtk.Table (((uint)(3)), ((uint)(3)), false);
- this.table2.Name = "table2";
- this.table2.RowSpacing = ((uint)(6));
- this.table2.ColumnSpacing = ((uint)(6));
- // Container child table2.Gtk.Table+TableChild
- this.compilerComboBox = global::Gtk.ComboBox.NewText ();
- this.compilerComboBox.Name = "compilerComboBox";
- this.table2.Add (this.compilerComboBox);
- global::Gtk.Table.TableChild w1 = ((global::Gtk.Table.TableChild)(this.table2 [this.compilerComboBox]));
- w1.TopAttach = ((uint)(1));
- w1.BottomAttach = ((uint)(2));
- w1.LeftAttach = ((uint)(1));
- w1.RightAttach = ((uint)(2));
- w1.XOptions = ((global::Gtk.AttachOptions)(4));
- w1.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table2.Gtk.Table+TableChild
- this.useCcacheCheckBox = new global::Gtk.CheckButton ();
- this.useCcacheCheckBox.CanFocus = true;
- this.useCcacheCheckBox.Name = "useCcacheCheckBox";
- this.useCcacheCheckBox.Label = global::Mono.Unix.Catalog.GetString ("Use ccache");
- this.useCcacheCheckBox.DrawIndicator = true;
- this.useCcacheCheckBox.UseUnderline = true;
- this.table2.Add (this.useCcacheCheckBox);
- global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table2 [this.useCcacheCheckBox]));
- w2.TopAttach = ((uint)(2));
- w2.BottomAttach = ((uint)(3));
- w2.LeftAttach = ((uint)(1));
- w2.RightAttach = ((uint)(2));
- w2.XOptions = ((global::Gtk.AttachOptions)(4));
- w2.YOptions = ((global::Gtk.AttachOptions)(4));
- this.Add (this.table2);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
- }
- this.Show ();
- this.compilerComboBox.Changed += new global::System.EventHandler (this.OnCompilerComboBoxChanged);
- }
- }
-}
diff --git a/main/src/addins/CBinding/gtk-gui/CBinding.EditPackagesDialog.cs b/main/src/addins/CBinding/gtk-gui/CBinding.EditPackagesDialog.cs
deleted file mode 100644
index d2ac0eb869..0000000000
--- a/main/src/addins/CBinding/gtk-gui/CBinding.EditPackagesDialog.cs
+++ /dev/null
@@ -1,240 +0,0 @@
-
-// This file has been generated by the GUI designer. Do not modify.
-namespace CBinding
-{
- public partial class EditPackagesDialog
- {
- private global::Gtk.VPaned vpaned1;
- private global::Gtk.HBox hbox1;
- private global::Gtk.Notebook notebook1;
- private global::Gtk.ScrolledWindow scrolledwindow1;
- private global::Gtk.TreeView normalPackageTreeView;
- private global::Gtk.Label labelSystemPackages;
- private global::Gtk.ScrolledWindow scrolledwindow3;
- private global::Gtk.TreeView projectPackageTreeView;
- private global::Gtk.Label labelProjectPackages;
- private global::Gtk.VBox vbox3;
- private global::Gtk.Fixed fixed1;
- private global::Gtk.Button detailsButton;
- private global::Gtk.Table table1;
- private global::Gtk.Label label3;
- private global::Gtk.ScrolledWindow scrolledwindow2;
- private global::Gtk.TreeView selectedPackageTreeView;
- private global::Gtk.VBox vbox2;
- private global::Gtk.Button removeButton;
- private global::Gtk.Button buttonCancel;
- private global::Gtk.Button buttonOk;
-
- protected virtual void Build ()
- {
- global::Stetic.Gui.Initialize (this);
- // Widget CBinding.EditPackagesDialog
- this.Name = "CBinding.EditPackagesDialog";
- this.Title = global::Mono.Unix.Catalog.GetString ("Edit packages");
- this.Modal = true;
- // Internal child CBinding.EditPackagesDialog.VBox
- global::Gtk.VBox w1 = this.VBox;
- w1.Name = "dialog1_VBox";
- w1.BorderWidth = ((uint)(2));
- // Container child dialog1_VBox.Gtk.Box+BoxChild
- this.vpaned1 = new global::Gtk.VPaned ();
- this.vpaned1.CanFocus = true;
- this.vpaned1.Name = "vpaned1";
- this.vpaned1.Position = 183;
- this.vpaned1.BorderWidth = ((uint)(6));
- // Container child vpaned1.Gtk.Paned+PanedChild
- this.hbox1 = new global::Gtk.HBox ();
- this.hbox1.Name = "hbox1";
- this.hbox1.Spacing = 6;
- // Container child hbox1.Gtk.Box+BoxChild
- this.notebook1 = new global::Gtk.Notebook ();
- this.notebook1.CanFocus = true;
- this.notebook1.Name = "notebook1";
- this.notebook1.CurrentPage = 0;
- // Container child notebook1.Gtk.Notebook+NotebookChild
- this.scrolledwindow1 = new global::Gtk.ScrolledWindow ();
- this.scrolledwindow1.CanFocus = true;
- this.scrolledwindow1.Name = "scrolledwindow1";
- this.scrolledwindow1.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child scrolledwindow1.Gtk.Container+ContainerChild
- this.normalPackageTreeView = new global::Gtk.TreeView ();
- this.normalPackageTreeView.CanFocus = true;
- this.normalPackageTreeView.Name = "normalPackageTreeView";
- this.scrolledwindow1.Add (this.normalPackageTreeView);
- this.notebook1.Add (this.scrolledwindow1);
- // Notebook tab
- this.labelSystemPackages = new global::Gtk.Label ();
- this.labelSystemPackages.Name = "labelSystemPackages";
- this.labelSystemPackages.LabelProp = global::Mono.Unix.Catalog.GetString ("System Packages");
- this.notebook1.SetTabLabel (this.scrolledwindow1, this.labelSystemPackages);
- this.labelSystemPackages.ShowAll ();
- // Container child notebook1.Gtk.Notebook+NotebookChild
- this.scrolledwindow3 = new global::Gtk.ScrolledWindow ();
- this.scrolledwindow3.CanFocus = true;
- this.scrolledwindow3.Name = "scrolledwindow3";
- this.scrolledwindow3.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child scrolledwindow3.Gtk.Container+ContainerChild
- this.projectPackageTreeView = new global::Gtk.TreeView ();
- this.projectPackageTreeView.CanFocus = true;
- this.projectPackageTreeView.Name = "projectPackageTreeView";
- this.scrolledwindow3.Add (this.projectPackageTreeView);
- this.notebook1.Add (this.scrolledwindow3);
- global::Gtk.Notebook.NotebookChild w5 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.scrolledwindow3]));
- w5.Position = 1;
- // Notebook tab
- this.labelProjectPackages = new global::Gtk.Label ();
- this.labelProjectPackages.Name = "labelProjectPackages";
- this.labelProjectPackages.LabelProp = global::Mono.Unix.Catalog.GetString ("Project Packages");
- this.notebook1.SetTabLabel (this.scrolledwindow3, this.labelProjectPackages);
- this.labelProjectPackages.ShowAll ();
- this.hbox1.Add (this.notebook1);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.notebook1]));
- w6.Position = 0;
- // Container child hbox1.Gtk.Box+BoxChild
- this.vbox3 = new global::Gtk.VBox ();
- this.vbox3.Name = "vbox3";
- this.vbox3.Spacing = 6;
- // Container child vbox3.Gtk.Box+BoxChild
- this.fixed1 = new global::Gtk.Fixed ();
- this.fixed1.HeightRequest = 21;
- this.fixed1.Name = "fixed1";
- this.fixed1.HasWindow = false;
- this.vbox3.Add (this.fixed1);
- global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.fixed1]));
- w7.Position = 0;
- w7.Expand = false;
- w7.Fill = false;
- // Container child vbox3.Gtk.Box+BoxChild
- this.detailsButton = new global::Gtk.Button ();
- this.detailsButton.WidthRequest = 33;
- this.detailsButton.HeightRequest = 33;
- this.detailsButton.Sensitive = false;
- this.detailsButton.CanFocus = true;
- this.detailsButton.Name = "detailsButton";
- this.detailsButton.UseUnderline = true;
- this.detailsButton.Label = global::Mono.Unix.Catalog.GetString ("...");
- this.vbox3.Add (this.detailsButton);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.detailsButton]));
- w8.Position = 1;
- w8.Expand = false;
- w8.Fill = false;
- this.hbox1.Add (this.vbox3);
- global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox3]));
- w9.Position = 1;
- w9.Expand = false;
- w9.Fill = false;
- this.vpaned1.Add (this.hbox1);
- global::Gtk.Paned.PanedChild w10 = ((global::Gtk.Paned.PanedChild)(this.vpaned1 [this.hbox1]));
- w10.Resize = false;
- // Container child vpaned1.Gtk.Paned+PanedChild
- this.table1 = new global::Gtk.Table (((uint)(2)), ((uint)(2)), false);
- this.table1.Name = "table1";
- this.table1.RowSpacing = ((uint)(6));
- this.table1.ColumnSpacing = ((uint)(6));
- // Container child table1.Gtk.Table+TableChild
- this.label3 = new global::Gtk.Label ();
- this.label3.Name = "label3";
- this.label3.Xalign = 0F;
- this.label3.Yalign = 0F;
- this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("Selected packages:");
- this.table1.Add (this.label3);
- global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table1 [this.label3]));
- w11.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.scrolledwindow2 = new global::Gtk.ScrolledWindow ();
- this.scrolledwindow2.CanFocus = true;
- this.scrolledwindow2.Name = "scrolledwindow2";
- this.scrolledwindow2.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child scrolledwindow2.Gtk.Container+ContainerChild
- this.selectedPackageTreeView = new global::Gtk.TreeView ();
- this.selectedPackageTreeView.CanFocus = true;
- this.selectedPackageTreeView.Name = "selectedPackageTreeView";
- this.scrolledwindow2.Add (this.selectedPackageTreeView);
- this.table1.Add (this.scrolledwindow2);
- global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table1 [this.scrolledwindow2]));
- w13.TopAttach = ((uint)(1));
- w13.BottomAttach = ((uint)(2));
- w13.XOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.vbox2 = new global::Gtk.VBox ();
- this.vbox2.Name = "vbox2";
- this.vbox2.Spacing = 6;
- // Container child vbox2.Gtk.Box+BoxChild
- this.removeButton = new global::Gtk.Button ();
- this.removeButton.TooltipMarkup = "Remove selected package from the project.";
- this.removeButton.WidthRequest = 33;
- this.removeButton.HeightRequest = 33;
- this.removeButton.Sensitive = false;
- this.removeButton.CanFocus = true;
- this.removeButton.Name = "removeButton";
- this.removeButton.UseUnderline = true;
- this.removeButton.Label = "";
- global::Gtk.Image w14 = new global::Gtk.Image ();
- w14.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-remove", global::Gtk.IconSize.Menu);
- this.removeButton.Image = w14;
- this.vbox2.Add (this.removeButton);
- global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.removeButton]));
- w15.Position = 0;
- w15.Expand = false;
- w15.Fill = false;
- this.table1.Add (this.vbox2);
- global::Gtk.Table.TableChild w16 = ((global::Gtk.Table.TableChild)(this.table1 [this.vbox2]));
- w16.TopAttach = ((uint)(1));
- w16.BottomAttach = ((uint)(2));
- w16.LeftAttach = ((uint)(1));
- w16.RightAttach = ((uint)(2));
- w16.XOptions = ((global::Gtk.AttachOptions)(4));
- this.vpaned1.Add (this.table1);
- w1.Add (this.vpaned1);
- global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(w1 [this.vpaned1]));
- w18.Position = 0;
- w18.Padding = ((uint)(3));
- // Internal child CBinding.EditPackagesDialog.ActionArea
- global::Gtk.HButtonBox w19 = this.ActionArea;
- w19.Name = "dialog1_ActionArea";
- w19.Spacing = 6;
- w19.BorderWidth = ((uint)(5));
- w19.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
- // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
- this.buttonCancel = new global::Gtk.Button ();
- this.buttonCancel.CanDefault = true;
- this.buttonCancel.CanFocus = true;
- this.buttonCancel.Name = "buttonCancel";
- this.buttonCancel.UseStock = true;
- this.buttonCancel.UseUnderline = true;
- this.buttonCancel.Label = "gtk-cancel";
- this.AddActionWidget (this.buttonCancel, -6);
- global::Gtk.ButtonBox.ButtonBoxChild w20 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w19 [this.buttonCancel]));
- w20.Expand = false;
- w20.Fill = false;
- // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
- this.buttonOk = new global::Gtk.Button ();
- this.buttonOk.CanDefault = true;
- this.buttonOk.CanFocus = true;
- this.buttonOk.Name = "buttonOk";
- this.buttonOk.UseStock = true;
- this.buttonOk.UseUnderline = true;
- this.buttonOk.Label = "gtk-ok";
- this.AddActionWidget (this.buttonOk, -5);
- global::Gtk.ButtonBox.ButtonBoxChild w21 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w19 [this.buttonOk]));
- w21.Position = 1;
- w21.Expand = false;
- w21.Fill = false;
- if ((this.Child != null)) {
- this.Child.ShowAll ();
- }
- this.DefaultWidth = 580;
- this.DefaultHeight = 449;
- this.Hide ();
- this.notebook1.SwitchPage += new global::Gtk.SwitchPageHandler (this.OnNotebook1SwitchPage);
- this.normalPackageTreeView.CursorChanged += new global::System.EventHandler (this.OnNonSelectedPackageCursorChanged);
- this.projectPackageTreeView.CursorChanged += new global::System.EventHandler (this.OnNonSelectedPackageCursorChanged);
- this.detailsButton.Clicked += new global::System.EventHandler (this.OnDetailsButtonClicked);
- this.removeButton.Clicked += new global::System.EventHandler (this.OnRemoveButtonClicked);
- this.removeButton.Clicked += new global::System.EventHandler (this.OnRemoveButtonClick);
- this.selectedPackageTreeView.CursorChanged += new global::System.EventHandler (this.OnSelectedPackagesTreeViewCursorChanged);
- this.buttonCancel.Clicked += new global::System.EventHandler (this.OnCancelButtonClick);
- this.buttonOk.Clicked += new global::System.EventHandler (this.OnOkButtonClick);
- }
- }
-}
diff --git a/main/src/addins/CBinding/gtk-gui/CBinding.GeneralOptionsPanel.cs b/main/src/addins/CBinding/gtk-gui/CBinding.GeneralOptionsPanel.cs
deleted file mode 100644
index 9bcbecfade..0000000000
--- a/main/src/addins/CBinding/gtk-gui/CBinding.GeneralOptionsPanel.cs
+++ /dev/null
@@ -1,156 +0,0 @@
-
-// This file has been generated by the GUI designer. Do not modify.
-namespace CBinding
-{
- public partial class GeneralOptionsPanel
- {
- private global::Gtk.Table table1;
- private global::Gtk.ComboBox cCombo;
- private global::Gtk.ComboBox cppCombo;
- private global::Gtk.Button ctagsBrowse;
- private global::Gtk.Entry ctagsEntry;
- private global::Gtk.Label label1;
- private global::Gtk.Label label2;
- private global::Gtk.Label label3;
- private global::Gtk.CheckButton parseLocalVariablesCheck;
- private global::Gtk.CheckButton parseSystemTagsCheck;
-
- protected virtual void Build ()
- {
- global::Stetic.Gui.Initialize (this);
- // Widget CBinding.GeneralOptionsPanel
- global::Stetic.BinContainer.Attach (this);
- this.Name = "CBinding.GeneralOptionsPanel";
- // Container child CBinding.GeneralOptionsPanel.Gtk.Container+ContainerChild
- this.table1 = new global::Gtk.Table (((uint)(5)), ((uint)(3)), false);
- this.table1.Name = "table1";
- this.table1.RowSpacing = ((uint)(6));
- this.table1.ColumnSpacing = ((uint)(6));
- // Container child table1.Gtk.Table+TableChild
- this.cCombo = global::Gtk.ComboBox.NewText ();
- this.cCombo.TooltipMarkup = "Default compiler to use for new C projects.";
- this.cCombo.Name = "cCombo";
- this.table1.Add (this.cCombo);
- global::Gtk.Table.TableChild w1 = ((global::Gtk.Table.TableChild)(this.table1 [this.cCombo]));
- w1.LeftAttach = ((uint)(1));
- w1.RightAttach = ((uint)(2));
- w1.XOptions = ((global::Gtk.AttachOptions)(4));
- w1.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.cppCombo = global::Gtk.ComboBox.NewText ();
- this.cppCombo.TooltipMarkup = "Default compiler to use for new C++ projects.";
- this.cppCombo.Name = "cppCombo";
- this.table1.Add (this.cppCombo);
- global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1 [this.cppCombo]));
- w2.TopAttach = ((uint)(1));
- w2.BottomAttach = ((uint)(2));
- w2.LeftAttach = ((uint)(1));
- w2.RightAttach = ((uint)(2));
- w2.XOptions = ((global::Gtk.AttachOptions)(4));
- w2.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.ctagsBrowse = new global::Gtk.Button ();
- this.ctagsBrowse.CanFocus = true;
- this.ctagsBrowse.Name = "ctagsBrowse";
- this.ctagsBrowse.UseUnderline = true;
- this.ctagsBrowse.Label = global::Mono.Unix.Catalog.GetString ("Browse");
- global::Gtk.Image w3 = new global::Gtk.Image ();
- w3.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-open", global::Gtk.IconSize.Menu);
- this.ctagsBrowse.Image = w3;
- this.table1.Add (this.ctagsBrowse);
- global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1 [this.ctagsBrowse]));
- w4.TopAttach = ((uint)(2));
- w4.BottomAttach = ((uint)(3));
- w4.LeftAttach = ((uint)(2));
- w4.RightAttach = ((uint)(3));
- w4.XOptions = ((global::Gtk.AttachOptions)(4));
- w4.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.ctagsEntry = new global::Gtk.Entry ();
- this.ctagsEntry.CanFocus = true;
- this.ctagsEntry.Name = "ctagsEntry";
- this.ctagsEntry.IsEditable = true;
- this.ctagsEntry.InvisibleChar = '●';
- this.table1.Add (this.ctagsEntry);
- global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1 [this.ctagsEntry]));
- w5.TopAttach = ((uint)(2));
- w5.BottomAttach = ((uint)(3));
- w5.LeftAttach = ((uint)(1));
- w5.RightAttach = ((uint)(2));
- w5.XOptions = ((global::Gtk.AttachOptions)(4));
- w5.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.label1 = new global::Gtk.Label ();
- this.label1.Name = "label1";
- this.label1.Xpad = 10;
- this.label1.Xalign = 1F;
- this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("Default C Compiler:");
- this.table1.Add (this.label1);
- global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1 [this.label1]));
- w6.XOptions = ((global::Gtk.AttachOptions)(4));
- w6.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.label2 = new global::Gtk.Label ();
- this.label2.Name = "label2";
- this.label2.Xpad = 10;
- this.label2.Xalign = 1F;
- this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Default C++ Compiler:");
- this.table1.Add (this.label2);
- global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1 [this.label2]));
- w7.TopAttach = ((uint)(1));
- w7.BottomAttach = ((uint)(2));
- w7.XOptions = ((global::Gtk.AttachOptions)(4));
- w7.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.label3 = new global::Gtk.Label ();
- this.label3.Name = "label3";
- this.label3.Xpad = 10;
- this.label3.Xalign = 1F;
- this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("CTags: ");
- this.label3.Justify = ((global::Gtk.Justification)(1));
- this.table1.Add (this.label3);
- global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table1 [this.label3]));
- w8.TopAttach = ((uint)(2));
- w8.BottomAttach = ((uint)(3));
- w8.XOptions = ((global::Gtk.AttachOptions)(4));
- w8.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.parseLocalVariablesCheck = new global::Gtk.CheckButton ();
- this.parseLocalVariablesCheck.CanFocus = true;
- this.parseLocalVariablesCheck.Name = "parseLocalVariablesCheck";
- this.parseLocalVariablesCheck.Label = global::Mono.Unix.Catalog.GetString ("Parse Local Variables");
- this.parseLocalVariablesCheck.DrawIndicator = true;
- this.parseLocalVariablesCheck.UseUnderline = true;
- this.table1.Add (this.parseLocalVariablesCheck);
- global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table1 [this.parseLocalVariablesCheck]));
- w9.TopAttach = ((uint)(4));
- w9.BottomAttach = ((uint)(5));
- w9.XPadding = ((uint)(10));
- w9.XOptions = ((global::Gtk.AttachOptions)(4));
- w9.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.parseSystemTagsCheck = new global::Gtk.CheckButton ();
- this.parseSystemTagsCheck.TooltipMarkup = "Choose whether you want to parse system tags or not, if you do you will get completion for things like printf, but the tag parsing process will take considerably longer.";
- this.parseSystemTagsCheck.CanFocus = true;
- this.parseSystemTagsCheck.Name = "parseSystemTagsCheck";
- this.parseSystemTagsCheck.Label = global::Mono.Unix.Catalog.GetString ("Parse System Tags");
- this.parseSystemTagsCheck.DrawIndicator = true;
- this.parseSystemTagsCheck.UseUnderline = true;
- this.table1.Add (this.parseSystemTagsCheck);
- global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table1 [this.parseSystemTagsCheck]));
- w10.TopAttach = ((uint)(3));
- w10.BottomAttach = ((uint)(4));
- w10.XPadding = ((uint)(10));
- w10.XOptions = ((global::Gtk.AttachOptions)(4));
- w10.YOptions = ((global::Gtk.AttachOptions)(4));
- this.Add (this.table1);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
- }
- this.Show ();
- this.ctagsBrowse.Clicked += new global::System.EventHandler (this.OnCtagsBrowseClicked);
- this.cppCombo.Changed += new global::System.EventHandler (this.OnCppComboChanged);
- this.cCombo.Changed += new global::System.EventHandler (this.OnCComboChanged);
- }
- }
-}
diff --git a/main/src/addins/CBinding/gtk-gui/CBinding.OutputOptionsPanel.cs b/main/src/addins/CBinding/gtk-gui/CBinding.OutputOptionsPanel.cs
deleted file mode 100644
index 46ab68872e..0000000000
--- a/main/src/addins/CBinding/gtk-gui/CBinding.OutputOptionsPanel.cs
+++ /dev/null
@@ -1,158 +0,0 @@
-
-// This file has been generated by the GUI designer. Do not modify.
-namespace CBinding
-{
- public partial class OutputOptionsPanel
- {
- private global::Gtk.VBox vbox2;
- private global::Gtk.Table table1;
- private global::Gtk.Label label1;
- private global::Gtk.Label label2;
- private global::Gtk.Label label3;
- private global::Gtk.Label label4;
- private global::MonoDevelop.Components.FolderEntry outputEntry;
- private global::Gtk.Entry outputNameTextEntry;
- private global::Gtk.Entry parametersTextEntry;
- private global::Gtk.CheckButton externalConsoleCheckbox;
- private global::Gtk.CheckButton pauseCheckbox;
-
- protected virtual void Build ()
- {
- global::Stetic.Gui.Initialize (this);
- // Widget CBinding.OutputOptionsPanel
- global::Stetic.BinContainer.Attach (this);
- this.Name = "CBinding.OutputOptionsPanel";
- // Container child CBinding.OutputOptionsPanel.Gtk.Container+ContainerChild
- this.vbox2 = new global::Gtk.VBox ();
- this.vbox2.Name = "vbox2";
- this.vbox2.Spacing = 6;
- this.vbox2.BorderWidth = ((uint)(3));
- // Container child vbox2.Gtk.Box+BoxChild
- this.table1 = new global::Gtk.Table (((uint)(4)), ((uint)(2)), false);
- this.table1.Name = "table1";
- this.table1.RowSpacing = ((uint)(6));
- this.table1.ColumnSpacing = ((uint)(6));
- this.table1.BorderWidth = ((uint)(3));
- // Container child table1.Gtk.Table+TableChild
- this.label1 = new global::Gtk.Label ();
- this.label1.Name = "label1";
- this.label1.Xalign = 0F;
- this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Output</b>");
- this.label1.UseMarkup = true;
- this.table1.Add (this.label1);
- global::Gtk.Table.TableChild w1 = ((global::Gtk.Table.TableChild)(this.table1 [this.label1]));
- w1.XOptions = ((global::Gtk.AttachOptions)(4));
- w1.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.label2 = new global::Gtk.Label ();
- this.label2.Name = "label2";
- this.label2.Xalign = 0F;
- this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Output Name:");
- this.table1.Add (this.label2);
- global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1 [this.label2]));
- w2.TopAttach = ((uint)(1));
- w2.BottomAttach = ((uint)(2));
- w2.XPadding = ((uint)(15));
- w2.XOptions = ((global::Gtk.AttachOptions)(4));
- w2.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.label3 = new global::Gtk.Label ();
- this.label3.Name = "label3";
- this.label3.Xalign = 0F;
- this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("Output Path:");
- this.table1.Add (this.label3);
- global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1 [this.label3]));
- w3.TopAttach = ((uint)(2));
- w3.BottomAttach = ((uint)(3));
- w3.XPadding = ((uint)(15));
- w3.XOptions = ((global::Gtk.AttachOptions)(4));
- w3.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.label4 = new global::Gtk.Label ();
- this.label4.Name = "label4";
- this.label4.Xalign = 0F;
- this.label4.LabelProp = global::Mono.Unix.Catalog.GetString ("Parameters:");
- this.table1.Add (this.label4);
- global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1 [this.label4]));
- w4.TopAttach = ((uint)(3));
- w4.BottomAttach = ((uint)(4));
- w4.XPadding = ((uint)(15));
- w4.XOptions = ((global::Gtk.AttachOptions)(4));
- w4.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.outputEntry = new global::MonoDevelop.Components.FolderEntry ();
- this.outputEntry.Name = "outputEntry";
- this.table1.Add (this.outputEntry);
- global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1 [this.outputEntry]));
- w5.TopAttach = ((uint)(2));
- w5.BottomAttach = ((uint)(3));
- w5.LeftAttach = ((uint)(1));
- w5.RightAttach = ((uint)(2));
- w5.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.outputNameTextEntry = new global::Gtk.Entry ();
- this.outputNameTextEntry.CanFocus = true;
- this.outputNameTextEntry.Name = "outputNameTextEntry";
- this.outputNameTextEntry.IsEditable = true;
- this.outputNameTextEntry.InvisibleChar = '●';
- this.table1.Add (this.outputNameTextEntry);
- global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1 [this.outputNameTextEntry]));
- w6.TopAttach = ((uint)(1));
- w6.BottomAttach = ((uint)(2));
- w6.LeftAttach = ((uint)(1));
- w6.RightAttach = ((uint)(2));
- w6.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.parametersTextEntry = new global::Gtk.Entry ();
- this.parametersTextEntry.CanFocus = true;
- this.parametersTextEntry.Name = "parametersTextEntry";
- this.parametersTextEntry.IsEditable = true;
- this.parametersTextEntry.InvisibleChar = '●';
- this.table1.Add (this.parametersTextEntry);
- global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1 [this.parametersTextEntry]));
- w7.TopAttach = ((uint)(3));
- w7.BottomAttach = ((uint)(4));
- w7.LeftAttach = ((uint)(1));
- w7.RightAttach = ((uint)(2));
- w7.XOptions = ((global::Gtk.AttachOptions)(4));
- w7.YOptions = ((global::Gtk.AttachOptions)(4));
- this.vbox2.Add (this.table1);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.table1]));
- w8.Position = 0;
- w8.Expand = false;
- w8.Fill = false;
- // Container child vbox2.Gtk.Box+BoxChild
- this.externalConsoleCheckbox = new global::Gtk.CheckButton ();
- this.externalConsoleCheckbox.CanFocus = true;
- this.externalConsoleCheckbox.Name = "externalConsoleCheckbox";
- this.externalConsoleCheckbox.Label = global::Mono.Unix.Catalog.GetString ("Run on e_xternal console");
- this.externalConsoleCheckbox.Active = true;
- this.externalConsoleCheckbox.DrawIndicator = true;
- this.externalConsoleCheckbox.UseUnderline = true;
- this.vbox2.Add (this.externalConsoleCheckbox);
- global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.externalConsoleCheckbox]));
- w9.Position = 1;
- w9.Expand = false;
- w9.Fill = false;
- // Container child vbox2.Gtk.Box+BoxChild
- this.pauseCheckbox = new global::Gtk.CheckButton ();
- this.pauseCheckbox.Sensitive = false;
- this.pauseCheckbox.CanFocus = true;
- this.pauseCheckbox.Name = "pauseCheckbox";
- this.pauseCheckbox.Label = global::Mono.Unix.Catalog.GetString ("Pause _console output");
- this.pauseCheckbox.DrawIndicator = true;
- this.pauseCheckbox.UseUnderline = true;
- this.vbox2.Add (this.pauseCheckbox);
- global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.pauseCheckbox]));
- w10.Position = 2;
- w10.Expand = false;
- w10.Fill = false;
- this.Add (this.vbox2);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
- }
- this.Show ();
- this.externalConsoleCheckbox.Clicked += new global::System.EventHandler (this.OnExternalConsoleCheckboxClicked);
- }
- }
-}
diff --git a/main/src/addins/CBinding/gtk-gui/CBinding.PackageDetails.cs b/main/src/addins/CBinding/gtk-gui/CBinding.PackageDetails.cs
deleted file mode 100644
index c1a4b13353..0000000000
--- a/main/src/addins/CBinding/gtk-gui/CBinding.PackageDetails.cs
+++ /dev/null
@@ -1,284 +0,0 @@
-
-// This file has been generated by the GUI designer. Do not modify.
-namespace CBinding
-{
- public partial class PackageDetails
- {
- private global::Gtk.VBox vbox3;
- private global::Gtk.Table table1;
- private global::Gtk.Label descriptionLabel;
- private global::Gtk.Label label7;
- private global::Gtk.Label label8;
- private global::Gtk.Label label9;
- private global::Gtk.Label nameLabel;
- private global::Gtk.Label versionLabel;
- private global::Gtk.VBox vbox4;
- private global::Gtk.Label label13;
- private global::Gtk.ScrolledWindow scrolledwindow1;
- private global::Gtk.TreeView requiresTreeView;
- private global::Gtk.VBox vbox2;
- private global::Gtk.Label label1;
- private global::Gtk.HBox hbox1;
- private global::Gtk.ScrolledWindow scrolledwindow2;
- private global::Gtk.TreeView libPathsTreeView;
- private global::Gtk.ScrolledWindow scrolledwindow3;
- private global::Gtk.TreeView libsTreeView;
- private global::Gtk.VBox vbox5;
- private global::Gtk.Label label2;
- private global::Gtk.ScrolledWindow scrolledwindow4;
- private global::Gtk.TreeView cflagsTreeView;
- private global::Gtk.Button buttonOk;
-
- protected virtual void Build ()
- {
- global::Stetic.Gui.Initialize (this);
- // Widget CBinding.PackageDetails
- this.Name = "CBinding.PackageDetails";
- this.Title = global::Mono.Unix.Catalog.GetString ("Package Details");
- this.WindowPosition = ((global::Gtk.WindowPosition)(4));
- // Internal child CBinding.PackageDetails.VBox
- global::Gtk.VBox w1 = this.VBox;
- w1.Name = "dialog1_VBox";
- w1.BorderWidth = ((uint)(2));
- // Container child dialog1_VBox.Gtk.Box+BoxChild
- this.vbox3 = new global::Gtk.VBox ();
- this.vbox3.Name = "vbox3";
- this.vbox3.Spacing = 6;
- this.vbox3.BorderWidth = ((uint)(3));
- // Container child vbox3.Gtk.Box+BoxChild
- this.table1 = new global::Gtk.Table (((uint)(3)), ((uint)(2)), false);
- this.table1.Name = "table1";
- this.table1.RowSpacing = ((uint)(6));
- this.table1.ColumnSpacing = ((uint)(6));
- // Container child table1.Gtk.Table+TableChild
- this.descriptionLabel = new global::Gtk.Label ();
- this.descriptionLabel.Name = "descriptionLabel";
- this.descriptionLabel.Xalign = 0F;
- this.descriptionLabel.Yalign = 0F;
- this.descriptionLabel.LabelProp = "label12";
- this.table1.Add (this.descriptionLabel);
- global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1 [this.descriptionLabel]));
- w2.TopAttach = ((uint)(2));
- w2.BottomAttach = ((uint)(3));
- w2.LeftAttach = ((uint)(1));
- w2.RightAttach = ((uint)(2));
- w2.XOptions = ((global::Gtk.AttachOptions)(4));
- w2.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.label7 = new global::Gtk.Label ();
- this.label7.Name = "label7";
- this.label7.Xalign = 0F;
- this.label7.LabelProp = global::Mono.Unix.Catalog.GetString ("Name:");
- this.table1.Add (this.label7);
- global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1 [this.label7]));
- w3.XOptions = ((global::Gtk.AttachOptions)(4));
- w3.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.label8 = new global::Gtk.Label ();
- this.label8.Name = "label8";
- this.label8.Xalign = 0F;
- this.label8.LabelProp = global::Mono.Unix.Catalog.GetString ("Version:");
- this.table1.Add (this.label8);
- global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1 [this.label8]));
- w4.TopAttach = ((uint)(1));
- w4.BottomAttach = ((uint)(2));
- w4.XOptions = ((global::Gtk.AttachOptions)(4));
- w4.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.label9 = new global::Gtk.Label ();
- this.label9.Name = "label9";
- this.label9.Xalign = 0F;
- this.label9.Yalign = 0F;
- this.label9.LabelProp = global::Mono.Unix.Catalog.GetString ("Description:");
- this.table1.Add (this.label9);
- global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1 [this.label9]));
- w5.TopAttach = ((uint)(2));
- w5.BottomAttach = ((uint)(3));
- w5.XOptions = ((global::Gtk.AttachOptions)(4));
- w5.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.nameLabel = new global::Gtk.Label ();
- this.nameLabel.Name = "nameLabel";
- this.nameLabel.Xalign = 0F;
- this.nameLabel.LabelProp = "label10";
- this.table1.Add (this.nameLabel);
- global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1 [this.nameLabel]));
- w6.LeftAttach = ((uint)(1));
- w6.RightAttach = ((uint)(2));
- w6.XOptions = ((global::Gtk.AttachOptions)(4));
- w6.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.versionLabel = new global::Gtk.Label ();
- this.versionLabel.Name = "versionLabel";
- this.versionLabel.Xalign = 0F;
- this.versionLabel.LabelProp = "label11";
- this.table1.Add (this.versionLabel);
- global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1 [this.versionLabel]));
- w7.TopAttach = ((uint)(1));
- w7.BottomAttach = ((uint)(2));
- w7.LeftAttach = ((uint)(1));
- w7.RightAttach = ((uint)(2));
- w7.XOptions = ((global::Gtk.AttachOptions)(4));
- w7.YOptions = ((global::Gtk.AttachOptions)(4));
- this.vbox3.Add (this.table1);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.table1]));
- w8.Position = 0;
- w8.Expand = false;
- w8.Fill = false;
- // Container child vbox3.Gtk.Box+BoxChild
- this.vbox4 = new global::Gtk.VBox ();
- this.vbox4.Name = "vbox4";
- this.vbox4.Spacing = 6;
- // Container child vbox4.Gtk.Box+BoxChild
- this.label13 = new global::Gtk.Label ();
- this.label13.Name = "label13";
- this.label13.Xalign = 0F;
- this.label13.LabelProp = global::Mono.Unix.Catalog.GetString ("Requires:");
- this.vbox4.Add (this.label13);
- global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.label13]));
- w9.Position = 0;
- w9.Expand = false;
- w9.Fill = false;
- // Container child vbox4.Gtk.Box+BoxChild
- this.scrolledwindow1 = new global::Gtk.ScrolledWindow ();
- this.scrolledwindow1.CanFocus = true;
- this.scrolledwindow1.Name = "scrolledwindow1";
- this.scrolledwindow1.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child scrolledwindow1.Gtk.Container+ContainerChild
- global::Gtk.Viewport w10 = new global::Gtk.Viewport ();
- w10.ShadowType = ((global::Gtk.ShadowType)(0));
- // Container child GtkViewport.Gtk.Container+ContainerChild
- this.requiresTreeView = new global::Gtk.TreeView ();
- this.requiresTreeView.CanFocus = true;
- this.requiresTreeView.Name = "requiresTreeView";
- w10.Add (this.requiresTreeView);
- this.scrolledwindow1.Add (w10);
- this.vbox4.Add (this.scrolledwindow1);
- global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.scrolledwindow1]));
- w13.Position = 1;
- this.vbox3.Add (this.vbox4);
- global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.vbox4]));
- w14.Position = 1;
- // Container child vbox3.Gtk.Box+BoxChild
- this.vbox2 = new global::Gtk.VBox ();
- this.vbox2.Name = "vbox2";
- this.vbox2.Spacing = 6;
- // Container child vbox2.Gtk.Box+BoxChild
- this.label1 = new global::Gtk.Label ();
- this.label1.Name = "label1";
- this.label1.Xalign = 0F;
- this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("Libs:");
- this.vbox2.Add (this.label1);
- global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.label1]));
- w15.Position = 0;
- w15.Expand = false;
- w15.Fill = false;
- // Container child vbox2.Gtk.Box+BoxChild
- this.hbox1 = new global::Gtk.HBox ();
- this.hbox1.Name = "hbox1";
- this.hbox1.Spacing = 6;
- // Container child hbox1.Gtk.Box+BoxChild
- this.scrolledwindow2 = new global::Gtk.ScrolledWindow ();
- this.scrolledwindow2.CanFocus = true;
- this.scrolledwindow2.Name = "scrolledwindow2";
- this.scrolledwindow2.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child scrolledwindow2.Gtk.Container+ContainerChild
- global::Gtk.Viewport w16 = new global::Gtk.Viewport ();
- w16.ShadowType = ((global::Gtk.ShadowType)(0));
- // Container child GtkViewport1.Gtk.Container+ContainerChild
- this.libPathsTreeView = new global::Gtk.TreeView ();
- this.libPathsTreeView.CanFocus = true;
- this.libPathsTreeView.Name = "libPathsTreeView";
- w16.Add (this.libPathsTreeView);
- this.scrolledwindow2.Add (w16);
- this.hbox1.Add (this.scrolledwindow2);
- global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.scrolledwindow2]));
- w19.Position = 0;
- // Container child hbox1.Gtk.Box+BoxChild
- this.scrolledwindow3 = new global::Gtk.ScrolledWindow ();
- this.scrolledwindow3.CanFocus = true;
- this.scrolledwindow3.Name = "scrolledwindow3";
- this.scrolledwindow3.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child scrolledwindow3.Gtk.Container+ContainerChild
- global::Gtk.Viewport w20 = new global::Gtk.Viewport ();
- w20.ShadowType = ((global::Gtk.ShadowType)(0));
- // Container child GtkViewport2.Gtk.Container+ContainerChild
- this.libsTreeView = new global::Gtk.TreeView ();
- this.libsTreeView.CanFocus = true;
- this.libsTreeView.Name = "libsTreeView";
- w20.Add (this.libsTreeView);
- this.scrolledwindow3.Add (w20);
- this.hbox1.Add (this.scrolledwindow3);
- global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.scrolledwindow3]));
- w23.Position = 1;
- this.vbox2.Add (this.hbox1);
- global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1]));
- w24.Position = 1;
- this.vbox3.Add (this.vbox2);
- global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.vbox2]));
- w25.Position = 2;
- // Container child vbox3.Gtk.Box+BoxChild
- this.vbox5 = new global::Gtk.VBox ();
- this.vbox5.Name = "vbox5";
- this.vbox5.Spacing = 6;
- // Container child vbox5.Gtk.Box+BoxChild
- this.label2 = new global::Gtk.Label ();
- this.label2.Name = "label2";
- this.label2.Xalign = 0F;
- this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("CFlags:");
- this.vbox5.Add (this.label2);
- global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.label2]));
- w26.Position = 0;
- w26.Expand = false;
- w26.Fill = false;
- // Container child vbox5.Gtk.Box+BoxChild
- this.scrolledwindow4 = new global::Gtk.ScrolledWindow ();
- this.scrolledwindow4.CanFocus = true;
- this.scrolledwindow4.Name = "scrolledwindow4";
- this.scrolledwindow4.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child scrolledwindow4.Gtk.Container+ContainerChild
- global::Gtk.Viewport w27 = new global::Gtk.Viewport ();
- w27.ShadowType = ((global::Gtk.ShadowType)(0));
- // Container child GtkViewport3.Gtk.Container+ContainerChild
- this.cflagsTreeView = new global::Gtk.TreeView ();
- this.cflagsTreeView.CanFocus = true;
- this.cflagsTreeView.Name = "cflagsTreeView";
- w27.Add (this.cflagsTreeView);
- this.scrolledwindow4.Add (w27);
- this.vbox5.Add (this.scrolledwindow4);
- global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.scrolledwindow4]));
- w30.Position = 1;
- this.vbox3.Add (this.vbox5);
- global::Gtk.Box.BoxChild w31 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.vbox5]));
- w31.Position = 3;
- w1.Add (this.vbox3);
- global::Gtk.Box.BoxChild w32 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox3]));
- w32.Position = 0;
- // Internal child CBinding.PackageDetails.ActionArea
- global::Gtk.HButtonBox w33 = this.ActionArea;
- w33.Name = "dialog1_ActionArea";
- w33.Spacing = 6;
- w33.BorderWidth = ((uint)(5));
- w33.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
- // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
- this.buttonOk = new global::Gtk.Button ();
- this.buttonOk.CanDefault = true;
- this.buttonOk.CanFocus = true;
- this.buttonOk.Name = "buttonOk";
- this.buttonOk.UseStock = true;
- this.buttonOk.UseUnderline = true;
- this.buttonOk.Label = "gtk-ok";
- this.AddActionWidget (this.buttonOk, -5);
- global::Gtk.ButtonBox.ButtonBoxChild w34 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w33 [this.buttonOk]));
- w34.Expand = false;
- w34.Fill = false;
- if ((this.Child != null)) {
- this.Child.ShowAll ();
- }
- this.DefaultWidth = 608;
- this.DefaultHeight = 518;
- this.Hide ();
- this.buttonOk.Clicked += new global::System.EventHandler (this.OnButtonOkClicked);
- }
- }
-}
diff --git a/main/src/addins/CBinding/gtk-gui/generated.cs b/main/src/addins/CBinding/gtk-gui/generated.cs
deleted file mode 100644
index 0ada9fc5f0..0000000000
--- a/main/src/addins/CBinding/gtk-gui/generated.cs
+++ /dev/null
@@ -1,115 +0,0 @@
-
-// This file has been generated by the GUI designer. Do not modify.
-namespace Stetic
-{
- internal class Gui
- {
- private static bool initialized;
-
- internal static void Initialize (Gtk.Widget iconRenderer)
- {
- if ((Stetic.Gui.initialized == false)) {
- Stetic.Gui.initialized = true;
- }
- }
- }
-
- internal class BinContainer
- {
- private Gtk.Widget child;
- private Gtk.UIManager uimanager;
-
- public static BinContainer Attach (Gtk.Bin bin)
- {
- BinContainer bc = new BinContainer ();
- bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested);
- bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated);
- bin.Added += new Gtk.AddedHandler (bc.OnAdded);
- return bc;
- }
-
- private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args)
- {
- if ((this.child != null)) {
- args.Requisition = this.child.SizeRequest ();
- }
- }
-
- private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args)
- {
- if ((this.child != null)) {
- this.child.Allocation = args.Allocation;
- }
- }
-
- private void OnAdded (object sender, Gtk.AddedArgs args)
- {
- this.child = args.Widget;
- }
-
- public void SetUiManager (Gtk.UIManager uim)
- {
- this.uimanager = uim;
- this.child.Realized += new System.EventHandler (this.OnRealized);
- }
-
- private void OnRealized (object sender, System.EventArgs args)
- {
- if ((this.uimanager != null)) {
- Gtk.Widget w;
- w = this.child.Toplevel;
- if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) {
- ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup);
- this.uimanager = null;
- }
- }
- }
- }
-
- internal class IconLoader
- {
- public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size)
- {
- Gdk.Pixbuf res = widget.RenderIcon (name, size, null);
- if ((res != null)) {
- return res;
- } else {
- int sz;
- int sy;
- global::Gtk.Icon.SizeLookup (size, out sz, out sy);
- try {
- return Gtk.IconTheme.Default.LoadIcon (name, sz, 0);
- } catch (System.Exception) {
- if ((name != "gtk-missing-image")) {
- return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size);
- } else {
- Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz);
- Gdk.GC gc = new Gdk.GC (pmap);
- gc.RgbFgColor = new Gdk.Color (255, 255, 255);
- pmap.DrawRectangle (gc, true, 0, 0, sz, sz);
- gc.RgbFgColor = new Gdk.Color (0, 0, 0);
- pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1));
- gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
- gc.RgbFgColor = new Gdk.Color (255, 0, 0);
- pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4)));
- pmap.DrawLine (gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)));
- return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
- }
- }
- }
- }
- }
-
- internal class ActionGroups
- {
- public static Gtk.ActionGroup GetActionGroup (System.Type type)
- {
- return Stetic.ActionGroups.GetActionGroup (type.FullName);
- }
-
- public static Gtk.ActionGroup GetActionGroup (string name)
- {
- return null;
- }
- }
-}
diff --git a/main/src/addins/CBinding/gtk-gui/gui.stetic b/main/src/addins/CBinding/gtk-gui/gui.stetic
deleted file mode 100644
index d1bef0d978..0000000000
--- a/main/src/addins/CBinding/gtk-gui/gui.stetic
+++ /dev/null
@@ -1,2217 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<stetic-interface>
- <configuration>
- <images-root-path>..</images-root-path>
- <target-gtk-version>2.12</target-gtk-version>
- </configuration>
- <import>
- <widget-library name="../../../../build/bin/MonoDevelop.Ide.dll" />
- <widget-library name="../../../../build/AddIns/MonoDevelop.Deployment/MonoDevelop.Deployment.Linux.dll" />
- <widget-library name="../../../../build/AddIns/DisplayBindings/SourceEditor/MonoDevelop.SourceEditor2.dll" />
- <widget-library name="../../../../build/AddIns/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.dll" />
- <widget-library name="../../../../build/bin/Mono.TextEditor.dll" />
- <widget-library name="../../../../build/AddIns/MonoDevelop.Refactoring/MonoDevelop.Refactoring.dll" />
- <widget-library name="../../../../build/AddIns/BackendBindings/MonoDevelop.CBinding.dll" internal="true" />
- </import>
- <widget class="Gtk.Bin" id="CBinding.CodeGenerationPanel" design-size="611 396">
- <property name="MemberName" />
- <child>
- <widget class="Gtk.Notebook" id="notebook1">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="CurrentPage">0</property>
- <child>
- <widget class="Gtk.VBox" id="vbox6">
- <property name="MemberName" />
- <property name="Spacing">3</property>
- <child>
- <widget class="Gtk.Table" id="table1">
- <property name="MemberName" />
- <property name="NRows">3</property>
- <property name="NColumns">2</property>
- <property name="RowSpacing">5</property>
- <property name="ColumnSpacing">5</property>
- <property name="BorderWidth">2</property>
- <child>
- <widget class="Gtk.Label" id="label4">
- <property name="MemberName" />
- <property name="Xpad">10</property>
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">Warning Level:</property>
- </widget>
- <packing>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label5">
- <property name="MemberName" />
- <property name="Xpad">10</property>
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">Optimization Level:</property>
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label6">
- <property name="MemberName" />
- <property name="Xpad">10</property>
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">Target:</property>
- </widget>
- <packing>
- <property name="TopAttach">2</property>
- <property name="BottomAttach">3</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.SpinButton" id="optimizationSpinButton">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Upper">3</property>
- <property name="PageIncrement">10</property>
- <property name="StepIncrement">1</property>
- <property name="ClimbRate">1</property>
- <property name="Numeric">True</property>
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.ComboBox" id="targetComboBox">
- <property name="MemberName" />
- <property name="IsTextCombo">True</property>
- <property name="Items" translatable="yes">Executable
-Static Library
-Shared Object</property>
- </widget>
- <packing>
- <property name="TopAttach">2</property>
- <property name="BottomAttach">3</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.VBox" id="vbox1">
- <property name="MemberName" />
- <property name="Spacing">1</property>
- <child>
- <widget class="Gtk.RadioButton" id="noWarningRadio">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Label" translatable="yes">no warnings</property>
- <property name="Active">True</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- <property name="Group">group1</property>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.RadioButton" id="normalWarningRadio">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Label" translatable="yes">normal</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- <property name="Group">group1</property>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.RadioButton" id="allWarningRadio">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Label" translatable="yes">all</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- <property name="Group">group1</property>
- </widget>
- <packing>
- <property name="Position">2</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.CheckButton" id="warningsAsErrorsCheckBox">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Label" translatable="yes">Treat warnings as errors</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- </widget>
- <packing>
- <property name="Position">3</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.HBox" id="hbox1">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.Label" id="label12">
- <property name="MemberName" />
- <property name="Xpad">13</property>
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">Define Symbols:</property>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Entry" id="defineSymbolsTextEntry">
- <property name="MemberName" />
- <property name="Tooltip" translatable="yes">A space seperated list of symbols to define.</property>
- <property name="CanFocus">True</property>
- <property name="IsEditable">True</property>
- <property name="InvisibleChar">●</property>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">False</property>
- <property name="Padding">14</property>
- </packing>
- </child>
- <child>
- <placeholder />
- </child>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Frame" id="frame2">
- <property name="MemberName" />
- <property name="ShadowType">None</property>
- <property name="LabelYalign">0</property>
- <child>
- <widget class="Gtk.Alignment" id="GtkAlignment">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="Yalign">0</property>
- <property name="LeftPadding">12</property>
- <child>
- <widget class="Gtk.Table" id="table5">
- <property name="MemberName" />
- <property name="NRows">2</property>
- <property name="NColumns">2</property>
- <property name="RowSpacing">6</property>
- <property name="ColumnSpacing">9</property>
- <property name="BorderWidth">6</property>
- <child>
- <widget class="Gtk.Label" id="label11">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">Extra Linker Options</property>
- </widget>
- <packing>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label7">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">Extra Compiler Options</property>
- </widget>
- <packing>
- <property name="AutoSize">False</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.ScrolledWindow" id="scrolledwindow4">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="ShadowType">In</property>
- <child>
- <widget class="Gtk.TextView" id="extraCompilerTextView">
- <property name="MemberName" />
- <property name="Tooltip" translatable="yes">A newline seperated list of extra options to send to the compiler.
-One option can be in more than one line.
-Example:
- `pkg-config
- --cflags
- cairo`</property>
- <property name="CanFocus">True</property>
- <property name="Text" translatable="yes" />
- </widget>
- </child>
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="AutoSize">False</property>
- <property name="XExpand">True</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">True</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.ScrolledWindow" id="scrolledwindow5">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="ShadowType">In</property>
- <child>
- <widget class="Gtk.TextView" id="extraLinkerTextView">
- <property name="MemberName" />
- <property name="Tooltip" translatable="yes">A newline seperated list of extra options to send to the linker.
-One option can be in more than one line.
-Example:
- `pkg-config
- --libs
- cairo`</property>
- <property name="CanFocus">True</property>
- <property name="Text" translatable="yes" />
- </widget>
- </child>
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">False</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">True</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- <child>
- <widget class="Gtk.Label" id="GtkLabel12">
- <property name="MemberName" />
- <property name="LabelProp" translatable="yes">&lt;b&gt;Extra Options&lt;/b&gt;</property>
- <property name="UseMarkup">True</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="Position">2</property>
- <property name="AutoSize">False</property>
- </packing>
- </child>
- </widget>
- </child>
- <child>
- <widget class="Gtk.Label" id="label1">
- <property name="MemberName" />
- <property name="LabelProp" translatable="yes">Code Generation</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Table" id="table2">
- <property name="MemberName" />
- <property name="NRows">2</property>
- <property name="NColumns">3</property>
- <property name="RowSpacing">10</property>
- <property name="ColumnSpacing">10</property>
- <property name="BorderWidth">3</property>
- <child>
- <placeholder />
- </child>
- <child>
- <widget class="Gtk.Button" id="addLibButton">
- <property name="MemberName" />
- <property name="Sensitive">False</property>
- <property name="CanFocus">True</property>
- <property name="Type">TextOnly</property>
- <property name="Label" translatable="yes">Add</property>
- <property name="UseUnderline">True</property>
- <signal name="Clicked" handler="OnLibAdded" />
- </widget>
- <packing>
- <property name="LeftAttach">2</property>
- <property name="RightAttach">3</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label8">
- <property name="MemberName" />
- <property name="LabelProp" translatable="yes">Library:</property>
- </widget>
- <packing>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Entry" id="libAddEntry">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="IsEditable">True</property>
- <property name="InvisibleChar">●</property>
- <signal name="Changed" handler="OnLibAddEntryChanged" />
- <signal name="Activated" handler="OnLibAddEntryActivated" />
- </widget>
- <packing>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">True</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.ScrolledWindow" id="scrolledwindow1">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="ShadowType">In</property>
- <child>
- <widget class="Gtk.TreeView" id="libTreeView">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <signal name="CursorChanged" handler="OnLibTreeViewCursorChanged" />
- </widget>
- </child>
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XExpand">True</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">True</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.VBox" id="vbox4">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.Button" id="browseButton">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Type">TextOnly</property>
- <property name="Label" translatable="yes">Browse...</property>
- <property name="UseUnderline">True</property>
- <signal name="Clicked" handler="OnBrowseButtonClick" />
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Button" id="removeLibButton">
- <property name="MemberName" />
- <property name="Sensitive">False</property>
- <property name="CanFocus">True</property>
- <property name="Type">TextOnly</property>
- <property name="Label" translatable="yes">Remove</property>
- <property name="UseUnderline">True</property>
- <signal name="Clicked" handler="OnRemoveLibButtonClicked" />
- <signal name="Clicked" handler="OnLibRemoved" />
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <placeholder />
- </child>
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="LeftAttach">2</property>
- <property name="RightAttach">3</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">True</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="Position">1</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label2">
- <property name="MemberName" />
- <property name="LabelProp" translatable="yes">Libraries</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.VBox" id="vbox7">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <property name="BorderWidth">3</property>
- <child>
- <widget class="Gtk.Table" id="table4">
- <property name="MemberName" />
- <property name="NRows">2</property>
- <property name="NColumns">3</property>
- <property name="RowSpacing">10</property>
- <property name="ColumnSpacing">10</property>
- <child>
- <placeholder />
- </child>
- <child>
- <widget class="Gtk.HBox" id="hbox2">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.Entry" id="libPathEntry">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="IsEditable">True</property>
- <property name="InvisibleChar">●</property>
- <signal name="Changed" handler="OnLibPathEntryChanged" />
- <signal name="Activated" handler="OnLibPathEntryActivated" />
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Button" id="quickInsertLibButton">
- <property name="MemberName" />
- <property name="Tooltip" translatable="yes">Insert a macro.</property>
- <property name="CanFocus">True</property>
- <property name="Type">TextOnly</property>
- <property name="Label" translatable="yes">&gt;</property>
- <property name="UseUnderline">True</property>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <placeholder />
- </child>
- </widget>
- <packing>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">True</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label10">
- <property name="MemberName" />
- <property name="LabelProp" translatable="yes">Library:</property>
- </widget>
- <packing>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Button" id="libPathAddButton">
- <property name="MemberName" />
- <property name="Sensitive">False</property>
- <property name="CanFocus">True</property>
- <property name="Type">TextOnly</property>
- <property name="Label" translatable="yes">Add</property>
- <property name="UseUnderline">True</property>
- <signal name="Clicked" handler="OnLibPathAdded" />
- </widget>
- <packing>
- <property name="LeftAttach">2</property>
- <property name="RightAttach">3</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.ScrolledWindow" id="scrolledwindow3">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="ShadowType">In</property>
- <child>
- <widget class="Gtk.TreeView" id="libPathTreeView">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <signal name="CursorChanged" handler="OnLibPathTreeViewCursorChanged" />
- </widget>
- </child>
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XExpand">True</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">True</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.VBox" id="vbox3">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.Button" id="libPathBrowseButton">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Type">TextOnly</property>
- <property name="Label" translatable="yes">Browse...</property>
- <property name="UseUnderline">True</property>
- <signal name="Clicked" handler="OnLibPathBrowseButtonClick" />
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Button" id="libPathRemoveButton">
- <property name="MemberName" />
- <property name="Sensitive">False</property>
- <property name="CanFocus">True</property>
- <property name="Type">TextOnly</property>
- <property name="Label" translatable="yes">Remove</property>
- <property name="UseUnderline">True</property>
- <signal name="Clicked" handler="OnLibPathRemoveButtonClicked" />
- <signal name="Clicked" handler="OnLibPathRemoved" />
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <placeholder />
- </child>
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="LeftAttach">2</property>
- <property name="RightAttach">3</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">True</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Table" id="table3">
- <property name="MemberName" />
- <property name="NRows">2</property>
- <property name="NColumns">3</property>
- <property name="RowSpacing">10</property>
- <property name="ColumnSpacing">10</property>
- <child>
- <placeholder />
- </child>
- <child>
- <widget class="Gtk.HBox" id="hbox3">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.Entry" id="includePathEntry">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="IsEditable">True</property>
- <property name="InvisibleChar">●</property>
- <signal name="Changed" handler="OnIncludePathEntryChanged" />
- <signal name="Activated" handler="OnIncludePathEntryActivated" />
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Button" id="quickInsertIncludeButton">
- <property name="MemberName" />
- <property name="Tooltip" translatable="yes">Insert a macro.</property>
- <property name="CanFocus">True</property>
- <property name="Type">TextOnly</property>
- <property name="Label" translatable="yes">&gt;</property>
- <property name="UseUnderline">True</property>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <placeholder />
- </child>
- </widget>
- <packing>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">True</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Button" id="includePathAddButton">
- <property name="MemberName" />
- <property name="Sensitive">False</property>
- <property name="CanFocus">True</property>
- <property name="Type">TextOnly</property>
- <property name="Label" translatable="yes">Add</property>
- <property name="UseUnderline">True</property>
- <signal name="Clicked" handler="OnIncludePathAdded" />
- </widget>
- <packing>
- <property name="LeftAttach">2</property>
- <property name="RightAttach">3</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label9">
- <property name="MemberName" />
- <property name="LabelProp" translatable="yes">Include:</property>
- </widget>
- <packing>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.ScrolledWindow" id="scrolledwindow2">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="ShadowType">In</property>
- <child>
- <widget class="Gtk.TreeView" id="includePathTreeView">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <signal name="CursorChanged" handler="OnIncludePathTreeViewCursorChanged" />
- </widget>
- </child>
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XExpand">True</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">True</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.VBox" id="vbox5">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.Button" id="includePathBrowseButton">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Type">TextOnly</property>
- <property name="Label" translatable="yes">Browse...</property>
- <property name="UseUnderline">True</property>
- <signal name="Clicked" handler="OnIncludePathBrowseButtonClick" />
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Button" id="includePathRemoveButton">
- <property name="MemberName" />
- <property name="Sensitive">False</property>
- <property name="CanFocus">True</property>
- <property name="Type">TextOnly</property>
- <property name="Label" translatable="yes">Remove</property>
- <property name="UseUnderline">True</property>
- <signal name="Clicked" handler="OnIncludePathRemoveButtonClicked" />
- <signal name="Clicked" handler="OnIncludePathRemoved" />
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <placeholder />
- </child>
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="LeftAttach">2</property>
- <property name="RightAttach">3</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">True</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- </packing>
- </child>
- <child>
- <placeholder />
- </child>
- </widget>
- <packing>
- <property name="Position">2</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label3">
- <property name="MemberName" />
- <property name="LabelProp" translatable="yes">Paths</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="Gtk.Bin" id="CBinding.CompilerPanel" design-size="300 300">
- <property name="MemberName" />
- <child>
- <widget class="Gtk.Table" id="table2">
- <property name="MemberName" />
- <property name="NRows">3</property>
- <property name="NColumns">3</property>
- <property name="RowSpacing">6</property>
- <property name="ColumnSpacing">6</property>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <widget class="Gtk.ComboBox" id="compilerComboBox">
- <property name="MemberName" />
- <property name="IsTextCombo">True</property>
- <property name="Items" translatable="yes" />
- <signal name="Changed" handler="OnCompilerComboBoxChanged" />
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.CheckButton" id="useCcacheCheckBox">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Label" translatable="yes">Use ccache</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- </widget>
- <packing>
- <property name="TopAttach">2</property>
- <property name="BottomAttach">3</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="Gtk.Dialog" id="CBinding.EditPackagesDialog" design-size="580 449">
- <property name="MemberName" />
- <property name="Visible">False</property>
- <property name="Title" translatable="yes">Edit packages</property>
- <property name="Modal">True</property>
- <property name="Buttons">2</property>
- <property name="HelpButton">False</property>
- <child internal-child="VBox">
- <widget class="Gtk.VBox" id="dialog1_VBox">
- <property name="MemberName" />
- <property name="BorderWidth">2</property>
- <child>
- <widget class="Gtk.VPaned" id="vpaned1">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Position">183</property>
- <property name="BorderWidth">6</property>
- <child>
- <widget class="Gtk.HBox" id="hbox1">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.Notebook" id="notebook1">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="CurrentPage">0</property>
- <signal name="SwitchPage" handler="OnNotebook1SwitchPage" />
- <child>
- <widget class="Gtk.ScrolledWindow" id="scrolledwindow1">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="ShadowType">In</property>
- <child>
- <widget class="Gtk.TreeView" id="normalPackageTreeView">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <signal name="CursorChanged" handler="OnNonSelectedPackageCursorChanged" />
- </widget>
- </child>
- </widget>
- </child>
- <child>
- <widget class="Gtk.Label" id="labelSystemPackages">
- <property name="MemberName" />
- <property name="LabelProp" translatable="yes">System Packages</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.ScrolledWindow" id="scrolledwindow3">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="ShadowType">In</property>
- <child>
- <widget class="Gtk.TreeView" id="projectPackageTreeView">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <signal name="CursorChanged" handler="OnNonSelectedPackageCursorChanged" />
- </widget>
- </child>
- </widget>
- <packing>
- <property name="Position">1</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="labelProjectPackages">
- <property name="MemberName" />
- <property name="LabelProp" translatable="yes">Project Packages</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.VBox" id="vbox3">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.Fixed" id="fixed1">
- <property name="MemberName" />
- <property name="HeightRequest">21</property>
- <property name="HasWindow">False</property>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">False</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Button" id="detailsButton">
- <property name="MemberName" />
- <property name="WidthRequest">33</property>
- <property name="HeightRequest">33</property>
- <property name="Sensitive">False</property>
- <property name="CanFocus">True</property>
- <property name="Type">TextOnly</property>
- <property name="Label" translatable="yes">...</property>
- <property name="UseUnderline">True</property>
- <signal name="Clicked" handler="OnDetailsButtonClicked" />
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <placeholder />
- </child>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <placeholder />
- </child>
- </widget>
- <packing>
- <property name="Resize">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Table" id="table1">
- <property name="MemberName" />
- <property name="NRows">2</property>
- <property name="NColumns">2</property>
- <property name="RowSpacing">6</property>
- <property name="ColumnSpacing">6</property>
- <child>
- <placeholder />
- </child>
- <child>
- <widget class="Gtk.Label" id="label3">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="Yalign">0</property>
- <property name="LabelProp" translatable="yes">Selected packages:</property>
- </widget>
- <packing>
- <property name="AutoSize">False</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">True</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.ScrolledWindow" id="scrolledwindow2">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="ShadowType">In</property>
- <child>
- <widget class="Gtk.TreeView" id="selectedPackageTreeView">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <signal name="CursorChanged" handler="OnSelectedPackagesTreeViewCursorChanged" />
- </widget>
- </child>
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">True</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.VBox" id="vbox2">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.Button" id="removeButton">
- <property name="MemberName" />
- <property name="WidthRequest">33</property>
- <property name="HeightRequest">33</property>
- <property name="Sensitive">False</property>
- <property name="Tooltip">Remove selected package from the project.</property>
- <property name="CanFocus">True</property>
- <property name="Type">TextAndIcon</property>
- <property name="Icon">stock:gtk-remove Menu</property>
- <property name="Label" />
- <property name="UseUnderline">True</property>
- <signal name="Clicked" handler="OnRemoveButtonClicked" />
- <signal name="Clicked" handler="OnRemoveButtonClick" />
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">False</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">True</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Padding">3</property>
- </packing>
- </child>
- </widget>
- </child>
- <child internal-child="ActionArea">
- <widget class="Gtk.HButtonBox" id="dialog1_ActionArea">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <property name="BorderWidth">5</property>
- <property name="Size">2</property>
- <property name="LayoutStyle">End</property>
- <child>
- <widget class="Gtk.Button" id="buttonCancel">
- <property name="MemberName" />
- <property name="CanDefault">True</property>
- <property name="CanFocus">True</property>
- <property name="UseStock">True</property>
- <property name="Type">StockItem</property>
- <property name="StockId">gtk-cancel</property>
- <property name="ResponseId">-6</property>
- <signal name="Clicked" handler="OnCancelButtonClick" />
- <property name="label">gtk-cancel</property>
- </widget>
- <packing>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Button" id="buttonOk">
- <property name="MemberName" />
- <property name="CanDefault">True</property>
- <property name="CanFocus">True</property>
- <property name="UseStock">True</property>
- <property name="Type">StockItem</property>
- <property name="StockId">gtk-ok</property>
- <property name="ResponseId">-5</property>
- <signal name="Clicked" handler="OnOkButtonClick" />
- <property name="label">gtk-ok</property>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="Gtk.Bin" id="CBinding.OutputOptionsPanel" design-size="412 273">
- <property name="MemberName" />
- <child>
- <widget class="Gtk.VBox" id="vbox2">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <property name="BorderWidth">3</property>
- <child>
- <widget class="Gtk.Table" id="table1">
- <property name="MemberName" />
- <property name="NRows">4</property>
- <property name="NColumns">2</property>
- <property name="RowSpacing">6</property>
- <property name="ColumnSpacing">6</property>
- <property name="BorderWidth">3</property>
- <child>
- <placeholder />
- </child>
- <child>
- <widget class="Gtk.Label" id="label1">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">&lt;b&gt;Output&lt;/b&gt;</property>
- <property name="UseMarkup">True</property>
- </widget>
- <packing>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label2">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">Output Name:</property>
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="XPadding">15</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label3">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">Output Path:</property>
- </widget>
- <packing>
- <property name="TopAttach">2</property>
- <property name="BottomAttach">3</property>
- <property name="XPadding">15</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label4">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">Parameters:</property>
- </widget>
- <packing>
- <property name="TopAttach">3</property>
- <property name="BottomAttach">4</property>
- <property name="XPadding">15</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="MonoDevelop.Components.FolderEntry" id="outputEntry">
- <property name="MemberName" />
- </widget>
- <packing>
- <property name="TopAttach">2</property>
- <property name="BottomAttach">3</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">False</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">True</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Entry" id="outputNameTextEntry">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="IsEditable">True</property>
- <property name="InvisibleChar">●</property>
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">False</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">True</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Entry" id="parametersTextEntry">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="IsEditable">True</property>
- <property name="InvisibleChar">●</property>
- </widget>
- <packing>
- <property name="TopAttach">3</property>
- <property name="BottomAttach">4</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.CheckButton" id="externalConsoleCheckbox">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Label" translatable="yes">Run on e_xternal console</property>
- <property name="Active">True</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- <signal name="Clicked" handler="OnExternalConsoleCheckboxClicked" />
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.CheckButton" id="pauseCheckbox">
- <property name="MemberName" />
- <property name="Sensitive">False</property>
- <property name="CanFocus">True</property>
- <property name="Label" translatable="yes">Pause _console output</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- </widget>
- <packing>
- <property name="Position">2</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="Gtk.Bin" id="CBinding.GeneralOptionsPanel" design-size="457 300">
- <property name="MemberName" />
- <child>
- <widget class="Gtk.Table" id="table1">
- <property name="MemberName" />
- <property name="NRows">5</property>
- <property name="NColumns">3</property>
- <property name="RowSpacing">6</property>
- <property name="ColumnSpacing">6</property>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <widget class="Gtk.ComboBox" id="cCombo">
- <property name="MemberName" />
- <property name="Tooltip" translatable="yes">Default compiler to use for new C projects.</property>
- <property name="IsTextCombo">True</property>
- <property name="Items" translatable="yes" />
- <signal name="Changed" handler="OnCComboChanged" />
- </widget>
- <packing>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.ComboBox" id="cppCombo">
- <property name="MemberName" />
- <property name="Tooltip" translatable="yes">Default compiler to use for new C++ projects.</property>
- <property name="IsTextCombo">True</property>
- <property name="Items" translatable="yes" />
- <signal name="Changed" handler="OnCppComboChanged" />
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Button" id="ctagsBrowse">
- <property name="MemberName">ctagsBrowse</property>
- <property name="CanFocus">True</property>
- <property name="Type">TextAndIcon</property>
- <property name="Icon">stock:gtk-open Menu</property>
- <property name="Label" translatable="yes">Browse</property>
- <property name="UseUnderline">True</property>
- <signal name="Clicked" handler="OnCtagsBrowseClicked" />
- </widget>
- <packing>
- <property name="TopAttach">2</property>
- <property name="BottomAttach">3</property>
- <property name="LeftAttach">2</property>
- <property name="RightAttach">3</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Entry" id="ctagsEntry">
- <property name="MemberName">ctagsEntry</property>
- <property name="CanFocus">True</property>
- <property name="IsEditable">True</property>
- <property name="InvisibleChar">●</property>
- </widget>
- <packing>
- <property name="TopAttach">2</property>
- <property name="BottomAttach">3</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label1">
- <property name="MemberName" />
- <property name="Xpad">10</property>
- <property name="Xalign">1</property>
- <property name="LabelProp" translatable="yes">Default C Compiler:</property>
- </widget>
- <packing>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label2">
- <property name="MemberName" />
- <property name="Xpad">10</property>
- <property name="Xalign">1</property>
- <property name="LabelProp" translatable="yes">Default C++ Compiler:</property>
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label3">
- <property name="MemberName" />
- <property name="Xpad">10</property>
- <property name="Xalign">1</property>
- <property name="LabelProp" translatable="yes">CTags: </property>
- <property name="Justify">Right</property>
- </widget>
- <packing>
- <property name="TopAttach">2</property>
- <property name="BottomAttach">3</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.CheckButton" id="parseLocalVariablesCheck">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Label" translatable="yes">Parse Local Variables</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- </widget>
- <packing>
- <property name="TopAttach">4</property>
- <property name="BottomAttach">5</property>
- <property name="XPadding">10</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.CheckButton" id="parseSystemTagsCheck">
- <property name="MemberName" />
- <property name="Tooltip" translatable="yes">Choose whether you want to parse system tags or not, if you do you will get completion for things like printf, but the tag parsing process will take considerably longer.</property>
- <property name="CanFocus">True</property>
- <property name="Label" translatable="yes">Parse System Tags</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- </widget>
- <packing>
- <property name="TopAttach">3</property>
- <property name="BottomAttach">4</property>
- <property name="XPadding">10</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="Gtk.Dialog" id="CBinding.PackageDetails" design-size="608 518">
- <property name="MemberName" />
- <property name="Visible">False</property>
- <property name="Title" translatable="yes">Package Details</property>
- <property name="WindowPosition">CenterOnParent</property>
- <property name="Buttons">1</property>
- <property name="HelpButton">False</property>
- <child internal-child="VBox">
- <widget class="Gtk.VBox" id="dialog1_VBox">
- <property name="MemberName" />
- <property name="BorderWidth">2</property>
- <child>
- <widget class="Gtk.VBox" id="vbox3">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <property name="BorderWidth">3</property>
- <child>
- <widget class="Gtk.Table" id="table1">
- <property name="MemberName" />
- <property name="NRows">3</property>
- <property name="NColumns">2</property>
- <property name="RowSpacing">6</property>
- <property name="ColumnSpacing">6</property>
- <child>
- <widget class="Gtk.Label" id="descriptionLabel">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="Yalign">0</property>
- <property name="LabelProp">label12</property>
- </widget>
- <packing>
- <property name="TopAttach">2</property>
- <property name="BottomAttach">3</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label7">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">Name:</property>
- </widget>
- <packing>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label8">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">Version:</property>
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label9">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="Yalign">0</property>
- <property name="LabelProp" translatable="yes">Description:</property>
- </widget>
- <packing>
- <property name="TopAttach">2</property>
- <property name="BottomAttach">3</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="nameLabel">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp">label10</property>
- </widget>
- <packing>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="versionLabel">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp">label11</property>
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.VBox" id="vbox4">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.Label" id="label13">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">Requires:</property>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.ScrolledWindow" id="scrolledwindow1">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="ShadowType">In</property>
- <child>
- <widget class="Gtk.Viewport" id="GtkViewport">
- <property name="MemberName" />
- <property name="ShadowType">None</property>
- <child>
- <widget class="Gtk.TreeView" id="requiresTreeView">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="ShowScrollbars">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- </packing>
- </child>
- <child>
- <placeholder />
- </child>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.VBox" id="vbox2">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.Label" id="label1">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">Libs:</property>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.HBox" id="hbox1">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.ScrolledWindow" id="scrolledwindow2">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="ShadowType">In</property>
- <child>
- <widget class="Gtk.Viewport" id="GtkViewport1">
- <property name="MemberName" />
- <property name="ShadowType">None</property>
- <child>
- <widget class="Gtk.TreeView" id="libPathsTreeView">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="ShowScrollbars">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.ScrolledWindow" id="scrolledwindow3">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="ShadowType">In</property>
- <child>
- <widget class="Gtk.Viewport" id="GtkViewport2">
- <property name="MemberName" />
- <property name="ShadowType">None</property>
- <child>
- <widget class="Gtk.TreeView" id="libsTreeView">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="ShowScrollbars">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- </packing>
- </child>
- <child>
- <placeholder />
- </child>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- </packing>
- </child>
- <child>
- <placeholder />
- </child>
- </widget>
- <packing>
- <property name="Position">2</property>
- <property name="AutoSize">True</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.VBox" id="vbox5">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.Label" id="label2">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">CFlags:</property>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.ScrolledWindow" id="scrolledwindow4">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="ShadowType">In</property>
- <child>
- <widget class="Gtk.Viewport" id="GtkViewport3">
- <property name="MemberName" />
- <property name="ShadowType">None</property>
- <child>
- <widget class="Gtk.TreeView" id="cflagsTreeView">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="ShowScrollbars">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- </packing>
- </child>
- <child>
- <placeholder />
- </child>
- </widget>
- <packing>
- <property name="Position">3</property>
- <property name="AutoSize">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- </packing>
- </child>
- </widget>
- </child>
- <child internal-child="ActionArea">
- <widget class="Gtk.HButtonBox" id="dialog1_ActionArea">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <property name="BorderWidth">5</property>
- <property name="Size">1</property>
- <property name="LayoutStyle">End</property>
- <child>
- <widget class="Gtk.Button" id="buttonOk">
- <property name="MemberName" />
- <property name="CanDefault">True</property>
- <property name="CanFocus">True</property>
- <property name="UseStock">True</property>
- <property name="Type">StockItem</property>
- <property name="StockId">gtk-ok</property>
- <property name="ResponseId">-5</property>
- <signal name="Clicked" handler="OnButtonOkClicked" />
- <property name="label">gtk-ok</property>
- </widget>
- <packing>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
-</stetic-interface> \ No newline at end of file
diff --git a/main/src/addins/CBinding/icons/union-16.png b/main/src/addins/CBinding/icons/union-16.png
deleted file mode 100644
index 40aae0f994..0000000000
--- a/main/src/addins/CBinding/icons/union-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/CBinding/icons/union-private-16.png b/main/src/addins/CBinding/icons/union-private-16.png
deleted file mode 100644
index cc32f48cb7..0000000000
--- a/main/src/addins/CBinding/icons/union-private-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/CBinding/icons/union-protected-16.png b/main/src/addins/CBinding/icons/union-protected-16.png
deleted file mode 100644
index df75b65512..0000000000
--- a/main/src/addins/CBinding/icons/union-protected-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/CBinding/icons/update.png b/main/src/addins/CBinding/icons/update.png
deleted file mode 100644
index b977611a78..0000000000
--- a/main/src/addins/CBinding/icons/update.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/CBinding/templates/ConsoleCProject.xpt.xml b/main/src/addins/CBinding/templates/ConsoleCProject.xpt.xml
deleted file mode 100644
index 7145e507a3..0000000000
--- a/main/src/addins/CBinding/templates/ConsoleCProject.xpt.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0"?>
-<Template
- originator = "Marcos David Marin Amador"
- created = "08/16/2007"
- lastModified = "08/16/2007">
-
- <!-- Template Header -->
- <TemplateConfiguration>
- <_Name>Console Project</_Name>
- <Category>other/misc/c</Category>
- <Icon>md-project-console</Icon>
- <Image id="md-console-project" />
- <LanguageName>C</LanguageName>
- <_Description>Creates simple hello world C project.</_Description>
- <DefaultFilename>ConsoleCProject</DefaultFilename>
- <GroupId>md-project-console</GroupId>
- </TemplateConfiguration>
-
- <!-- Template Content -->
- <Combine name = "${ProjectName}" directory = ".">
- <Project name = "${ProjectName}" directory = "." type = "C/C++">
- <Options
- Target = "Bin"
- ExternalConsole = "True"
- CompilerArgs = ""
- LinkerArgs = ""/>
-
- <Files>
- <File name = "main.c" AddStandardHeader="True"><![CDATA[#include <stdio.h>
-
-int main (int argc, char *argv[])
-{
- printf ("Hello world!\n");
-
- return 0;
-}
-]]></File>
- </Files>
- </Project>
- </Combine>
-</Template>
diff --git a/main/src/addins/CBinding/templates/ConsoleCppProject.xpt.xml b/main/src/addins/CBinding/templates/ConsoleCppProject.xpt.xml
deleted file mode 100644
index f6b109f9db..0000000000
--- a/main/src/addins/CBinding/templates/ConsoleCppProject.xpt.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-<Template
- originator = "Marcos David Marin Amador"
- created = "08/16/2007"
- lastModified = "08/16/2007">
-
- <!-- Template Header -->
- <TemplateConfiguration>
- <_Name>Console Project</_Name>
- <Category>other/misc/c</Category>
- <Icon>md-project-console</Icon>
- <Image id="md-console-project" />
- <LanguageName>CPP</LanguageName>
- <_Description>Creates simple hello world C++ project.</_Description>
- <DefaultFilename>ConsoleCppProject</DefaultFilename>
- <GroupId>md-project-console</GroupId>
- </TemplateConfiguration>
-
- <!-- Template Content -->
- <Combine name = "${ProjectName}" directory = ".">
- <Project name = "${ProjectName}" directory = "." type = "C/C++">
- <Options
- Target = "Bin"
- ExternalConsole = "True"
- CompilerArgs = ""
- LinkerArgs = ""/>
-
- <Files>
- <File name = "main.cpp" AddStandardHeader="True"><![CDATA[#include <iostream>
-using namespace std;
-
-int main (int argc, char *argv[])
-{
- cout << "Hello world!" << endl;
-
- return 0;
-}
-]]></File>
- </Files>
- </Project>
- </Combine>
-</Template>
diff --git a/main/src/addins/CBinding/templates/ConsoleObjCProject.xpt.xml b/main/src/addins/CBinding/templates/ConsoleObjCProject.xpt.xml
deleted file mode 100644
index fa7b3c5c39..0000000000
--- a/main/src/addins/CBinding/templates/ConsoleObjCProject.xpt.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0"?>
-<Template
- originator = "Levi Bard"
- created = "07/30/2010"
- lastModified = "07/30/2010">
-
- <!-- Template Header -->
- <TemplateConfiguration>
- <_Name>Console Project</_Name>
- <Category>other/misc/c</Category>
- <Icon>md-project-console</Icon>
- <Image id="md-console-project" />
- <LanguageName>Objective C</LanguageName>
- <_Description>Creates simple hello world Objective C project.</_Description>
- <DefaultFilename>ConsoleObjCProject</DefaultFilename>
- <GroupId>md-project-console</GroupId>
- </TemplateConfiguration>
-
- <!-- Template Content -->
- <Combine name = "${ProjectName}" directory = ".">
- <Project name = "${ProjectName}" directory = "." type = "C/C++">
- <Options
- Target = "Bin"
- ExternalConsole = "True"
- CompilerArgs = ""
- LinkerArgs = ""/>
-
- <Files>
- <File name = "main.m" AddStandardHeader="True"><![CDATA[#import <stdio.h>
-
-int main( int argc, const char *argv[] ) {
- printf( "hello world\n" );
- return 0;
-}
-]]></File>
- </Files>
- </Project>
- </Combine>
-</Template>
diff --git a/main/src/addins/CBinding/templates/EmptyCHeaderFile.xft.xml b/main/src/addins/CBinding/templates/EmptyCHeaderFile.xft.xml
deleted file mode 100644
index d9d2de4d4c..0000000000
--- a/main/src/addins/CBinding/templates/EmptyCHeaderFile.xft.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<Template
- Originator="Marcos David Marin Amador"
- Language="C"
- Created="08/03/2007"
- LastModified="08/03/2007">
-
- <TemplateConfiguration>
- <_Name>Empty C Header File</_Name>
- <Icon>md-file-header</Icon>
- <_Category>General</_Category>
- <LanguageName>C</LanguageName>
- <_Description>Creates an empty C header file.</_Description>
- <DefaultFilename>EmptyCHeaderFile</DefaultFilename>
- </TemplateConfiguration>
-
- <TemplateFiles>
- <File DefaultExtension=".h" AddStandardHeader="True"/>
- </TemplateFiles>
-
- <FileOptions/>
-
-</Template>
diff --git a/main/src/addins/CBinding/templates/EmptyCProject.xpt.xml b/main/src/addins/CBinding/templates/EmptyCProject.xpt.xml
deleted file mode 100644
index a1deb60974..0000000000
--- a/main/src/addins/CBinding/templates/EmptyCProject.xpt.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-<Template
- originator = "Marcos David Marin Amador"
- created = "04/12/2007"
- lastModified = "06/13/2007">
-
- <!-- Template Header -->
- <TemplateConfiguration>
- <_Name>Empty Project</_Name>
- <Category>other/misc/c</Category>
- <Icon>md-project</Icon>
- <LanguageName>C</LanguageName>
- <_Description>Creates an empty C solution.</_Description>
- <DefaultFilename>EmptyCProject</DefaultFilename>
- <GroupId>md-empty-project</GroupId>
- </TemplateConfiguration>
-
- <!-- Template Content -->
- <Combine name = "${ProjectName}" directory = ".">
- <Project name = "${ProjectName}" directory = "." type = "C/C++">
- <Options
- Target = "Bin"
- PauseConsoleOutput = "True"
- CompilerArgs = ""
- LinkerArgs = ""/>
- </Project>
- </Combine>
-</Template>
diff --git a/main/src/addins/CBinding/templates/EmptyCSourceFile.xft.xml b/main/src/addins/CBinding/templates/EmptyCSourceFile.xft.xml
deleted file mode 100644
index 4937e8f135..0000000000
--- a/main/src/addins/CBinding/templates/EmptyCSourceFile.xft.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<Template
- Originator="Marcos David Marin Amador"
- Language="C"
- Created="08/03/2007"
- LastModified="08/03/2007">
-
- <TemplateConfiguration>
- <_Name>Empty C Source File</_Name>
- <Icon>md-file-source</Icon>
- <_Category>General</_Category>
- <LanguageName>C</LanguageName>
- <_Description>Creates an empty C source file.</_Description>
- <DefaultFilename>EmptyCSourceFile</DefaultFilename>
- </TemplateConfiguration>
-
- <TemplateFiles>
- <File DefaultExtension=".c" AddStandardHeader="True"/>
- </TemplateFiles>
-
- <FileOptions/>
-
-</Template>
diff --git a/main/src/addins/CBinding/templates/EmptyCppHeaderFile.xft.xml b/main/src/addins/CBinding/templates/EmptyCppHeaderFile.xft.xml
deleted file mode 100644
index ae70dde9b8..0000000000
--- a/main/src/addins/CBinding/templates/EmptyCppHeaderFile.xft.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<Template
- Originator="Marcos David Marin Amador"
- Language="CPP"
- Created="08/03/2007"
- LastModified="08/03/2007">
-
- <TemplateConfiguration>
- <_Name>Empty C++ Header File</_Name>
- <Icon>md-file-header</Icon>
- <_Category>General</_Category>
- <LanguageName>CPP</LanguageName>
- <_Description>Creates an empty C++ header file.</_Description>
- <DefaultFilename>EmptyCppHeaderFile</DefaultFilename>
- </TemplateConfiguration>
-
- <TemplateFiles>
- <File DefaultExtension=".h" AddStandardHeader="True"/>
- </TemplateFiles>
-
- <FileOptions/>
-
-</Template>
diff --git a/main/src/addins/CBinding/templates/EmptyCppProject.xpt.xml b/main/src/addins/CBinding/templates/EmptyCppProject.xpt.xml
deleted file mode 100644
index 9d0b2df2aa..0000000000
--- a/main/src/addins/CBinding/templates/EmptyCppProject.xpt.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-<Template
- originator = "Marcos David Marin Amador"
- created = "04/17/2007"
- lastModified = "06/13/2007">
-
- <!-- Template Header -->
- <TemplateConfiguration>
- <_Name>Empty Project</_Name>
- <Category>other/misc/c</Category>
- <Icon>md-project</Icon>
- <LanguageName>CPP</LanguageName>
- <_Description>Creates an empty C++ solution.</_Description>
- <DefaultFilename>EmptyCppProject</DefaultFilename>
- <GroupId>md-empty-project</GroupId>
- </TemplateConfiguration>
-
- <!-- Template Content -->
- <Combine name = "${ProjectName}" directory = ".">
- <Project name = "${ProjectName}" directory = "." type = "C/C++">
- <Options
- Target = "Bin"
- PauseConsoleOutput = "True"
- CompilerArgs = ""
- LinkerArgs = ""/>
- </Project>
- </Combine>
-</Template>
diff --git a/main/src/addins/CBinding/templates/EmptyCppSourceFile.xft.xml b/main/src/addins/CBinding/templates/EmptyCppSourceFile.xft.xml
deleted file mode 100644
index e6c6ef83a1..0000000000
--- a/main/src/addins/CBinding/templates/EmptyCppSourceFile.xft.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<Template
- Originator="Marcos David Marin Amador"
- Language="CPP"
- Created="08/03/2007"
- LastModified="08/03/2007">
-
- <TemplateConfiguration>
- <_Name>Empty C++ Source File</_Name>
- <Icon>md-file-source</Icon>
- <_Category>General</_Category>
- <LanguageName>CPP</LanguageName>
- <_Description>Creates an empty C++ source file.</_Description>
- <DefaultFilename>EmptyCppSourceFile</DefaultFilename>
- </TemplateConfiguration>
-
- <TemplateFiles>
- <File DefaultExtension=".cpp" AddStandardHeader="True"/>
- </TemplateFiles>
-
- <FileOptions/>
-
-</Template>
diff --git a/main/src/addins/CBinding/templates/EmptyObjCProject.xpt.xml b/main/src/addins/CBinding/templates/EmptyObjCProject.xpt.xml
deleted file mode 100644
index 210d4784ad..0000000000
--- a/main/src/addins/CBinding/templates/EmptyObjCProject.xpt.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0"?>
-<Template
- originator = "Levi Bard"
- created = "07/30/2010"
- lastModified = "07/30/2010">
-
- <!-- Template Header -->
- <TemplateConfiguration>
- <_Name>Console Project</_Name>
- <_Category>C</_Category>
- <Icon>md-project-console|res:c-icon-32.png</Icon>
- <LanguageName>Objective C</LanguageName>
- <_Description>Creates simple hello world Objective C project.</_Description>
- </TemplateConfiguration>
-
- <!-- Template Content -->
- <Combine name = "${ProjectName}" directory = ".">
- <Project name = "${ProjectName}" directory = "." type = "C/C++">
- <Options
- Target = "Bin"
- ExternalConsole = "True"
- CompilerArgs = ""
- LinkerArgs = ""/>
-
- <Files>
- <File name = "main.m" AddStandardHeader="True"><![CDATA[#import <stdio.h>
-
-int main( int argc, const char *argv[] ) {
- printf( "hello world\n" );
- return 0;
-}
-]]></File>
- </Files>
- </Project>
- </Combine>
-</Template>
diff --git a/main/src/addins/CBinding/templates/EmptyObjCSourceFile.xft.xml b/main/src/addins/CBinding/templates/EmptyObjCSourceFile.xft.xml
deleted file mode 100644
index 489aefc677..0000000000
--- a/main/src/addins/CBinding/templates/EmptyObjCSourceFile.xft.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<Template
- Originator="Levi Bard"
- Language="Objective C"
- Created="07/10/2010"
- LastModified="07/10/2010">
-
- <TemplateConfiguration>
- <_Name>Empty Objective C Source File</_Name>
- <Icon>md-file-source</Icon>
- <_Category>General</_Category>
- <LanguageName>Objective C</LanguageName>
- <_Description>Creates an empty Objective C source file.</_Description>
- <DefaultFilename>EmptyObjCSourceFile</DefaultFilename>
- </TemplateConfiguration>
-
- <TemplateFiles>
- <File DefaultExtension=".m" DefaultName="EmptyObjCSourceFile" AddStandardHeader="True"/>
- </TemplateFiles>
-
- <FileOptions/>
-
-</Template>
diff --git a/main/src/addins/CBinding/templates/EmptyObjCppSourceFile.xft.xml b/main/src/addins/CBinding/templates/EmptyObjCppSourceFile.xft.xml
deleted file mode 100644
index 550603c408..0000000000
--- a/main/src/addins/CBinding/templates/EmptyObjCppSourceFile.xft.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<Template
- Originator="Levi Bard"
- Language="Objective C++"
- Created="07/10/2010"
- LastModified="07/10/2010">
-
- <TemplateConfiguration>
- <_Name>Empty Objective C++ Source File</_Name>
- <Icon>md-file-source</Icon>
- <_Category>General</_Category>
- <LanguageName>Objective C++</LanguageName>
- <_Description>Creates an empty Objective C++ source file.</_Description>
- <DefaultFilename>EmptyObjCppSourceFile</DefaultFilename>
- </TemplateConfiguration>
-
- <TemplateFiles>
- <File DefaultExtension=".mm" DefaultName="EmptyObjCppSourceFile" AddStandardHeader="True"/>
- </TemplateFiles>
-
- <FileOptions/>
-
-</Template>
diff --git a/main/src/addins/CBinding/templates/SharedLibraryCProject.xpt.xml b/main/src/addins/CBinding/templates/SharedLibraryCProject.xpt.xml
deleted file mode 100644
index 0349b2dad3..0000000000
--- a/main/src/addins/CBinding/templates/SharedLibraryCProject.xpt.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0"?>
-<Template
- originator = "Marcos David Marin Amador"
- created = "08/16/2007"
- lastModified = "08/16/2007">
-
- <!-- Template Header -->
- <TemplateConfiguration>
- <_Name>Shared Library</_Name>
- <Category>other/misc/c</Category>
- <Icon>md-project-library</Icon>
- <Image id="md-library-project" />
- <LanguageName>C</LanguageName>
- <_Description>Creates simple shared library C project.</_Description>
- <DefaultFilename>SharedLibraryCProject</DefaultFilename>
- <GroupId>md-shared-library-project</GroupId>
- </TemplateConfiguration>
-
- <!-- Template Content -->
- <Combine name = "${ProjectName}" directory = ".">
- <Project name = "${ProjectName}" directory = "." type = "C/C++">
- <Options
- Target = "SharedLibrary"
- PauseConsoleOutput = "True"
- CompilerArgs = ""
- LinkerArgs = ""/>
-
- <Files>
- <File name = "main.h" AddStandardHeader="True"><![CDATA[
-#ifndef __MAIN_H__
-#define __MAIN_H__
-
-/* Add function prototypes here */
-
-#endif
-]]></File>
- <File name = "main.c"><![CDATA[#include "main.h"
-
-/* Add function definitions here */
-]]></File>
- </Files>
- </Project>
- </Combine>
-</Template>
diff --git a/main/src/addins/CBinding/templates/SharedLibraryCppProject.xpt.xml b/main/src/addins/CBinding/templates/SharedLibraryCppProject.xpt.xml
deleted file mode 100644
index 52f47fa589..0000000000
--- a/main/src/addins/CBinding/templates/SharedLibraryCppProject.xpt.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0"?>
-<Template
- originator = "Marcos David Marin Amador"
- created = "08/16/2007"
- lastModified = "08/16/2007">
-
- <!-- Template Header -->
- <TemplateConfiguration>
- <_Name>Shared Library</_Name>
- <Category>other/misc/c</Category>
- <Icon>md-project-library</Icon>
- <Image id="md-library-project" />
- <LanguageName>CPP</LanguageName>
- <_Description>Creates simple shared library C++ project.</_Description>
- <DefaultFilename>SharedLibraryCppProject</DefaultFilename>
- <GroupId>md-shared-library-project</GroupId>
- </TemplateConfiguration>
-
- <!-- Template Content -->
- <Combine name = "${ProjectName}" directory = ".">
- <Project name = "${ProjectName}" directory = "." type = "C/C++">
- <Options
- Target = "SharedLibrary"
- PauseConsoleOutput = "True"
- CompilerArgs = ""
- LinkerArgs = ""/>
-
- <Files>
- <File name = "main.h" AddStandardHeader="True"><![CDATA[#ifndef __MAIN_H__
-#define __MAIN_H__
-
-// Add function prototypes here
-
-#endif
-]]></File>
- <File name = "main.cpp" AddStandardHeader="True"><![CDATA[#include "main.h"
-
-// Add function definitions here
-]]></File>
- </Files>
- </Project>
- </Combine>
-</Template>
diff --git a/main/src/addins/CBinding/templates/StaticLibraryCProject.xpt.xml b/main/src/addins/CBinding/templates/StaticLibraryCProject.xpt.xml
deleted file mode 100644
index 88150e2653..0000000000
--- a/main/src/addins/CBinding/templates/StaticLibraryCProject.xpt.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0"?>
-<Template
- originator = "Marcos David Marin Amador"
- created = "08/16/2007"
- lastModified = "08/16/2007">
-
- <!-- Template Header -->
- <TemplateConfiguration>
- <_Name>Static Library</_Name>
- <Category>other/misc/c</Category>
- <Icon>md-project-library</Icon>
- <Image id="md-library-project" />
- <LanguageName>C</LanguageName>
- <_Description>Creates simple static library C project.</_Description>
- <DefaultFilename>StaticLibraryCProject</DefaultFilename>
- <GroupId>md-static-library-project</GroupId>
- </TemplateConfiguration>
-
- <!-- Template Content -->
- <Combine name = "${ProjectName}" directory = ".">
- <Project name = "${ProjectName}" directory = "." type = "C/C++">
- <Options
- Target = "StaticLibrary"
- PauseConsoleOutput = "True"
- CompilerArgs = ""
- LinkerArgs = ""/>
-
- <Files>
- <File name = "main.h" AddStandardHeader="True"><![CDATA[#ifndef __MAIN_H__
-#define __MAIN_H__
-
-/* Add function prototypes here */
-
-#endif
-]]></File>
- <File name = "main.c" AddStandardHeader="True"><![CDATA[#include "main.h"
-
-/* Add function definitions here */
-]]></File>
- </Files>
- </Project>
- </Combine>
-</Template>
-
diff --git a/main/src/addins/CBinding/templates/StaticLibraryCppProject.xpt.xml b/main/src/addins/CBinding/templates/StaticLibraryCppProject.xpt.xml
deleted file mode 100644
index 14d0d3580e..0000000000
--- a/main/src/addins/CBinding/templates/StaticLibraryCppProject.xpt.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0"?>
-<Template
- originator = "Marcos David Marin Amador"
- created = "08/16/2007"
- lastModified = "08/16/2007">
-
- <!-- Template Header -->
- <TemplateConfiguration>
- <_Name>Static Library</_Name>
- <Category>other/misc/c</Category>
- <Icon>md-project-library</Icon>
- <Image id="md-library-project" />
- <LanguageName>CPP</LanguageName>
- <_Description>Creates simple static library C++ project.</_Description>
- <DefaultFilename>StaticLibraryCppProject</DefaultFilename>
- <GroupId>md-static-library-project</GroupId>
- </TemplateConfiguration>
-
- <!-- Template Content -->
- <Combine name = "${ProjectName}" directory = ".">
- <Project name = "${ProjectName}" directory = "." type = "C/C++">
- <Options
- Target = "StaticLibrary"
- PauseConsoleOutput = "True"
- CompilerArgs = ""
- LinkerArgs = ""/>
-
- <Files>
- <File name = "main.h" AddStandardHeader="True"><![CDATA[
-#ifndef __MAIN_H__
-#define __MAIN_H__
-
-// Add function prototypes here
-
-#endif
-]]></File>
- <File name = "main.cpp" AddStandardHeader="True"><![CDATA[#include "main.h"
-
-// Add function definitions here
-]]></File>
- </Files>
- </Project>
- </Combine>
-</Template>
diff --git a/main/src/addins/CSharpBinding/AddinInfo.cs b/main/src/addins/CSharpBinding/AddinInfo.cs
index 90e1d63e5c..0a0160f9fc 100644
--- a/main/src/addins/CSharpBinding/AddinInfo.cs
+++ b/main/src/addins/CSharpBinding/AddinInfo.cs
@@ -15,8 +15,8 @@ using Mono.Addins.Description;
[assembly:AddinDependency ("Ide", MonoDevelop.BuildInfo.Version)]
[assembly:AddinDependency ("Refactoring", MonoDevelop.BuildInfo.Version)]
[assembly:AddinDependency ("SourceEditor2", MonoDevelop.BuildInfo.Version)]
-[assembly:AddinDependency ("NUnit", MonoDevelop.BuildInfo.Version)]
+[assembly:AddinDependency ("UnitTesting", MonoDevelop.BuildInfo.Version)]
// Submodules
[assembly:AddinModule ("MonoDevelop.CSharpBinding.Autotools.dll")]
-[assembly:AddinModule ("MonoDevelop.CSharpBinding.AspNet.dll")]
+[assembly:AddinModule ("MonoDevelop.CSharpBinding.AspNet.dll")] \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/AspNet/ASPNetReferenceFinder.cs b/main/src/addins/CSharpBinding/AspNet/ASPNetReferenceFinder.cs
index 1484fe7b1d..72e11efbc1 100644
--- a/main/src/addins/CSharpBinding/AspNet/ASPNetReferenceFinder.cs
+++ b/main/src/addins/CSharpBinding/AspNet/ASPNetReferenceFinder.cs
@@ -23,12 +23,14 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+/*
using System.Collections.Generic;
using MonoDevelop.Core;
using MonoDevelop.Ide.FindInFiles;
using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide.Editor;
using MonoDevelop.AspNet.WebForms;
namespace MonoDevelop.CSharp.Refactoring
@@ -40,7 +42,7 @@ namespace MonoDevelop.CSharp.Refactoring
IncludeDocumentation = true;
}
- IEnumerable<DomRegion> SearchMember (IEntity member, ITypeResolveContext dom, FilePath fileName, Mono.TextEditor.TextEditorData editor, Mono.TextEditor.TextDocument buildDocument, List<LocalDocumentInfo.OffsetInfo> offsetInfos, ParsedDocument parsedDocument)
+ IEnumerable<DomRegion> SearchMember (IEntity member, ITypeResolveContext dom, FilePath fileName, TextEditor editor, ITextDocument buildDocument, List<LocalDocumentInfo.OffsetInfo> offsetInfos, ParsedDocument parsedDocument)
{ // TODO: Type system conversion.
yield break;
// var resolver = new NRefactoryResolver (dom, parsedDocument.CompilationUnit, ICSharpCode.OldNRefactory.SupportedLanguage.CSharp, editor, fileName);
@@ -58,7 +60,7 @@ namespace MonoDevelop.CSharp.Refactoring
// yield return new DomRegion (fileName, loc.Line, loc.Column, loc.Line, loc.Column + result.Name.Lenhth);
// }
}
- public override IEnumerable<MemberReference> FindReferences (MonoDevelop.Projects.Project project, IProjectContent content, IEnumerable<FilePath> files, IProgressMonitor monitor, IEnumerable<object> searchedMembers)
+ public override IEnumerable<MemberReference> FindReferences (MonoDevelop.Projects.Project project, IProjectContent content, IEnumerable<FilePath> files, ProgressMonitor monitor, IEnumerable<object> searchedMembers)
{ // TODO: Type system conversion.
yield break;
// var editor = TextFileProvider.Instance.GetTextEditorData (fileName);
@@ -93,3 +95,4 @@ namespace MonoDevelop.CSharp.Refactoring
}
}
+*/ \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/AspNet/AspLanguageBuilder.cs b/main/src/addins/CSharpBinding/AspNet/AspLanguageBuilder.cs
index 4e1fc93617..e6e4eaf509 100644
--- a/main/src/addins/CSharpBinding/AspNet/AspLanguageBuilder.cs
+++ b/main/src/addins/CSharpBinding/AspNet/AspLanguageBuilder.cs
@@ -23,17 +23,25 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-
+/*
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
-using Mono.TextEditor;
using MonoDevelop.AspNet.WebForms;
using MonoDevelop.AspNet.WebForms.Dom;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.TypeSystem;
+using ICSharpCode.NRefactory.TypeSystem;
+using MonoDevelop.CSharp.Parser;
+using System.IO;
+using ICSharpCode.NRefactory.Completion;
+using MonoDevelop.AspNet.StateEngine;
+using MonoDevelop.Xml.StateEngine;
+using ICSharpCode.NRefactory6.CSharp.Completion;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
namespace MonoDevelop.CSharp.Completion
{
@@ -67,9 +75,8 @@ namespace MonoDevelop.CSharp.Completion
builder.Append (" : ");
builder.AppendLine (info.BaseType);
}
-
- public LocalDocumentInfo BuildLocalDocument (DocumentInfo info, TextEditorData data,
- string expressionText, string textAfterCaret, bool isExpression)
+
+ LocalDocumentInfo ILanguageCompletionBuilder.BuildLocalDocument (DocumentInfo info, MonoDevelop.Ide.Editor.TextEditor data, string expressionText, string textAfterCaret, bool isExpression)
{
var sb = new StringBuilder ();
@@ -84,12 +91,12 @@ namespace MonoDevelop.CSharp.Completion
foreach (var node in info.XExpressions) {
bool isBlock = node is WebFormsRenderBlock;
- if (node.Region.Begin.Line > data.Caret.Line || node.Region.Begin.Line == data.Caret.Line && node.Region.Begin.Column > data.Caret.Column - 5)
+ if (node.Region.Begin.Line > data.CaretLine || node.Region.Begin.Line == data.CaretLine && node.Region.Begin.Column > data.CaretColumn - 5)
continue;
//Console.WriteLine ("take xprt:" + expressions.Key.BeginLine +"/" +expressions.Key.BeginColumn);
- var start = data.Document.LocationToOffset (node.Region.Begin.Line, node.Region.Begin.Column) + 2;
- var end = data.Document.LocationToOffset (node.Region.End.Line, node.Region.End.Column) - 2;
+ var start = data.LocationToOffset (node.Region.Begin.Line, node.Region.Begin.Column) + 2;
+ var end = data.LocationToOffset (node.Region.End.Line, node.Region.End.Column) - 2;
if (!isBlock) {
sb.Append ("WriteLine (");
@@ -114,53 +121,52 @@ namespace MonoDevelop.CSharp.Completion
result.LocalDocument = sb.ToString ();
result.CaretPosition = caretPosition;
- result.OriginalCaretPosition = data.Caret.Offset;
+ result.OriginalCaretPosition = data.CaretOffset;
result.ParsedLocalDocument = Parse (info.AspNetDocument.FileName, sb.ToString ());
return result;
}
- public ICompletionDataList HandlePopupCompletion (Document realDocument, DocumentInfo info, LocalDocumentInfo localInfo)
+ public ICompletionDataList HandlePopupCompletion (TextEditor realEditor, DocumentContext realContext, DocumentInfo info, LocalDocumentInfo localInfo)
{
CodeCompletionContext codeCompletionContext;
- using (var completion = CreateCompletion (realDocument, info, localInfo, out codeCompletionContext)) {
+ using (var completion = CreateCompletion (realEditor, realContext, info, localInfo, out codeCompletionContext)) {
return completion.CodeCompletionCommand (codeCompletionContext);
}
}
- public ICompletionDataList HandleCompletion (Document realDocument, CodeCompletionContext completionContext, DocumentInfo info, LocalDocumentInfo localInfo, char currentChar, ref int triggerWordLength)
+ public ICompletionDataList HandleCompletion (TextEditor realEditor, DocumentContext realContext, CodeCompletionContext completionContext, DocumentInfo info, LocalDocumentInfo localInfo, char currentChar, ref int triggerWordLength)
{
CodeCompletionContext ccc;
- using (var completion = CreateCompletion (realDocument, info, localInfo, out ccc)) {
- return completion.HandleCodeCompletion (completionContext, currentChar, ref triggerWordLength);
+ using (var completion = CreateCompletion (realEditor, realContext, info, localInfo, out ccc)) {
+ return completion.HandleCodeCompletionAsync (completionContext, currentChar, ref triggerWordLength);
}
}
- public ParameterDataProvider HandleParameterCompletion (Document realDocument, CodeCompletionContext completionContext, DocumentInfo info, LocalDocumentInfo localInfo, char completionChar)
+ public ParameterHintingResult HandleParameterCompletion (TextEditor realEditor, DocumentContext realContext, CodeCompletionContext completionContext, DocumentInfo info, LocalDocumentInfo localInfo, char completionChar)
{
CodeCompletionContext ccc;
- using (var completion = CreateCompletion (realDocument, info, localInfo, out ccc)) {
- return completion.HandleParameterCompletion (completionContext, completionChar);
+ using (var completion = CreateCompletion (realEditor, realContext, info, localInfo, out ccc)) {
+ return completion.HandleParameterCompletionAsync (completionContext, completionChar);
}
}
- public bool GetParameterCompletionCommandOffset (Document realDocument, DocumentInfo info, LocalDocumentInfo localInfo, out int cpos)
+ public bool GetParameterCompletionCommandOffset (TextEditor realEditor, DocumentContext realContext, DocumentInfo info, LocalDocumentInfo localInfo, out int cpos)
{
CodeCompletionContext codeCompletionContext;
- using (var completion = CreateCompletion (realDocument, info, localInfo, out codeCompletionContext)) {
- return completion.GetParameterCompletionCommandOffset (out cpos);
+ using (var completion = CreateCompletion (realEditor, realContext, info, localInfo, out codeCompletionContext)) {
+ int wlen;
+ return completion.GetCompletionCommandOffset (out cpos, out wlen);
}
}
- public ICompletionWidget CreateCompletionWidget (Document realDocument, LocalDocumentInfo localInfo)
+ public ICompletionWidget CreateCompletionWidget (TextEditor realEditor, DocumentContext realContext, LocalDocumentInfo localInfo)
{
- return new AspCompletionWidget (realDocument, localInfo);
+ return new AspCompletionWidget (realEditor, localInfo);
}
- CSharpCompletionTextEditorExtension CreateCompletion (Document realDocument, DocumentInfo info, LocalDocumentInfo localInfo, out CodeCompletionContext codeCompletionContext)
+ CSharpCompletionTextEditorExtension CreateCompletion (TextEditor realEditor, DocumentContext realContext, DocumentInfo info, LocalDocumentInfo localInfo, out CodeCompletionContext codeCompletionContext)
{
- var doc = new TextDocument () {
- Text = localInfo.LocalDocument,
- };
+ var doc = TextEditorFactory.CreateNewDocument (new StringTextSource (localInfo.LocalDocument), realEditor.FileName + ".cs");
var documentLocation = doc.OffsetToLocation (localInfo.CaretPosition);
codeCompletionContext = new CodeCompletionContext () {
@@ -170,16 +176,16 @@ namespace MonoDevelop.CSharp.Completion
};
return new CSharpCompletionTextEditorExtension (localInfo.HiddenDocument) {
- CompletionWidget = CreateCompletionWidget (realDocument, localInfo)
+ CompletionWidget = CreateCompletionWidget (realEditor, realContext, localInfo)
};
}
class AspCompletionWidget : ICompletionWidget
{
- Document realDocument;
+ TextEditor realDocument;
LocalDocumentInfo localInfo;
- public AspCompletionWidget (Document realDocument, LocalDocumentInfo localInfo)
+ public AspCompletionWidget (TextEditor realDocument, LocalDocumentInfo localInfo)
{
this.realDocument = realDocument;
this.localInfo = localInfo;
@@ -188,7 +194,7 @@ namespace MonoDevelop.CSharp.Completion
#region ICompletionWidget implementation
public CodeCompletionContext CurrentCodeCompletionContext {
get {
- int delta = realDocument.Editor.Caret.Offset - localInfo.OriginalCaretPosition;
+ int delta = realDocument.CaretOffset - localInfo.OriginalCaretPosition;
return CreateCodeCompletionContext (localInfo.CaretPosition + delta);
}
}
@@ -217,10 +223,10 @@ namespace MonoDevelop.CSharp.Completion
public CodeCompletionContext CreateCodeCompletionContext (int triggerOffset)
{
- var savedCtx = realDocument.GetContent<ICompletionWidget> ().CreateCodeCompletionContext (realDocument.Editor.Caret.Offset + triggerOffset - localInfo.CaretPosition);
+ var savedCtx = realDocument.GetContent<ICompletionWidget> ().CreateCodeCompletionContext (realDocument.CaretOffset + triggerOffset - localInfo.CaretPosition);
CodeCompletionContext result = new CodeCompletionContext ();
result.TriggerOffset = triggerOffset;
- DocumentLocation loc = localInfo.HiddenDocument.Editor.Document.OffsetToLocation (triggerOffset);
+ var loc = localInfo.HiddenDocument.Editor.OffsetToLocation (triggerOffset);
result.TriggerLine = loc.Line;
result.TriggerLineOffset = loc.Column - 1;
@@ -234,9 +240,9 @@ namespace MonoDevelop.CSharp.Completion
{
if (ctx == null)
return null;
- int min = Math.Min (ctx.TriggerOffset, localInfo.HiddenDocument.Editor.Caret.Offset);
- int max = Math.Max (ctx.TriggerOffset, localInfo.HiddenDocument.Editor.Caret.Offset);
- return localInfo.HiddenDocument.Editor.Document.GetTextBetween (min, max);
+ int min = Math.Min (ctx.TriggerOffset, localInfo.HiddenDocument.Editor.CaretOffset);
+ int max = Math.Max (ctx.TriggerOffset, localInfo.HiddenDocument.Editor.CaretOffset);
+ return localInfo.HiddenDocument.Editor.GetTextBetween (min, max);
}
public void SetCompletionText (CodeCompletionContext ctx, string partial_word, string complete_word)
@@ -249,7 +255,7 @@ namespace MonoDevelop.CSharp.Completion
CodeCompletionContext translatedCtx = new CodeCompletionContext ();
int offset = localInfo.OriginalCaretPosition + ctx.TriggerOffset - localInfo.CaretPosition;
translatedCtx.TriggerOffset = offset;
- DocumentLocation loc = localInfo.HiddenDocument.Editor.Document.OffsetToLocation (offset);
+ var loc = localInfo.HiddenDocument.Editor.OffsetToLocation (offset);
translatedCtx.TriggerLine = loc.Line;
translatedCtx.TriggerLineOffset = loc.Column - 1;
translatedCtx.TriggerWordLength = ctx.TriggerWordLength;
@@ -258,13 +264,16 @@ namespace MonoDevelop.CSharp.Completion
public int CaretOffset {
get {
- return localInfo.HiddenDocument.Editor.Caret.Offset;
+ return localInfo.HiddenDocument.Editor.CaretOffset;
+ }
+ set {
+ localInfo.HiddenDocument.Editor.CaretOffset = value;
}
}
public int TextLength {
get {
- return localInfo.HiddenDocument.Editor.Document.TextLength;
+ return localInfo.HiddenDocument.Editor.Length;
}
}
@@ -279,28 +288,33 @@ namespace MonoDevelop.CSharp.Completion
return Gtk.Widget.DefaultStyle;
}
}
+
+ void ICompletionWidget.AddSkipChar (int cursorPosition, char c)
+ {
+ // ignore
+ }
#endregion
}
-
- public ParsedDocument BuildDocument (DocumentInfo info, TextEditorData data)
+
+ ParsedDocument ILanguageCompletionBuilder.BuildDocument (DocumentInfo info, MonoDevelop.Ide.Editor.TextEditor data)
{
var docStr = BuildDocumentString (info, data);
return Parse (info.AspNetDocument.FileName, docStr);
}
- public string BuildDocumentString (DocumentInfo info, TextEditorData data, List<LocalDocumentInfo.OffsetInfo> offsetInfos = null, bool buildExpressions = false)
+ public string BuildDocumentString (DocumentInfo info, MonoDevelop.Ide.Editor.TextEditor data, List<LocalDocumentInfo.OffsetInfo> offsetInfos = null, bool buildExpressions = false)
{
var document = new StringBuilder ();
WriteUsings (info.Imports, document);
foreach (var node in info.XScriptBlocks) {
- var start = data.Document.LocationToOffset (node.Region.Begin.Line, node.Region.Begin.Column) + 2;
- var end = data.Document.LocationToOffset (node.Region.End.Line, node.Region.End.Column) - 2;
+ var start = data.LocationToOffset (node.Region.Begin.Line, node.Region.Begin.Column) + 2;
+ var end = data.LocationToOffset (node.Region.End.Line, node.Region.End.Column) - 2;
if (offsetInfos != null)
offsetInfos.Add (new LocalDocumentInfo.OffsetInfo (start, document.Length, end - start));
- document.AppendLine (data.Document.GetTextBetween (start, end));
+ document.AppendLine (data.GetTextBetween (start, end));
}
if (buildExpressions) {
WriteClassDeclaration (info, document);
@@ -312,8 +326,8 @@ namespace MonoDevelop.CSharp.Completion
foreach (var node in info.XExpressions) {
bool isBlock = node is WebFormsRenderBlock;
- var start = data.Document.LocationToOffset (node.Region.Begin.Line, node.Region.Begin.Column) + 2;
- var end = data.Document.LocationToOffset (node.Region.End.Line, node.Region.End.Column) - 2;
+ var start = data.LocationToOffset (node.Region.Begin.Line, node.Region.Begin.Column) + 2;
+ var end = data.LocationToOffset (node.Region.End.Line, node.Region.End.Column) - 2;
if (!isBlock) {
document.Append ("WriteLine (");
@@ -335,3 +349,4 @@ namespace MonoDevelop.CSharp.Completion
}
}
}
+*/ \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/AspNet/CSharpBinding.AspNet.csproj b/main/src/addins/CSharpBinding/AspNet/CSharpBinding.AspNet.csproj
index 5c7536b6d6..8813be65c6 100644
--- a/main/src/addins/CSharpBinding/AspNet/CSharpBinding.AspNet.csproj
+++ b/main/src/addins/CSharpBinding/AspNet/CSharpBinding.AspNet.csproj
@@ -70,11 +70,6 @@
<Name>MonoDevelop.DesignerSupport</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
- <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
- <Name>Mono.TextEditor</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\..\MonoDevelop.Refactoring\MonoDevelop.Refactoring.csproj">
<Project>{100568FC-F4E8-439B-94AD-41D11724E45B}</Project>
<Name>MonoDevelop.Refactoring</Name>
@@ -95,11 +90,6 @@
<Name>MonoDevelop.Deployment</Name>
<Private>False</Private>
</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="..\..\MonoDevelop.Debugger\MonoDevelop.Debugger.csproj">
<Project>{2357AABD-08C7-4808-A495-8FF2D3CDFDB0}</Project>
<Name>MonoDevelop.Debugger</Name>
diff --git a/main/src/addins/CSharpBinding/AspNet/ChangeLog b/main/src/addins/CSharpBinding/AspNet/ChangeLog
deleted file mode 100644
index a065cb6c71..0000000000
--- a/main/src/addins/CSharpBinding/AspNet/ChangeLog
+++ /dev/null
@@ -1,88 +0,0 @@
-2010-07-20 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.AspNet.csproj: Added reference for window
- builds.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * AspLanguageBuilder.cs: Track API changes.
-
-2010-07-15 Mike Krüger <mkrueger@novell.com>
-
- * AspLanguageBuilder.cs: Fixed 'Bug 621658 - Parameter hints
- disappear afterkeystroke'.
-
-2010-07-15 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * AspLanguageBuilder.cs:
- * CSharpBinding.AspNet.csproj: Worked on 'Bug 621658 -
- Parameter hints disappear afterkeystroke'.
-
-2010-06-02 Mike Krüger <mkrueger@novell.com>
-
- * AspLanguageBuilder.cs: Worked on ASP.NET completion.
-
-2010-05-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * AspLanguageBuilder.cs: Track API.
-
-2010-05-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * AspLanguageBuilder.cs: Track API. Moved a lot of generic
- logic out to DocumentInfo.
-
-2010-05-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * AspLanguageBuilder.cs: Use the list of usings.
-
-2010-05-20 Mike Krüger <mkrueger@novell.com>
-
- * AspLanguageBuilder.cs: Fixed local lookup for ASP.NET.
-
-2010-05-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * AspLanguageBuilder.cs: Fix type name and base class, and add
- usings.
-
-2010-05-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * AspLanguageBuilder.cs: Heavy refactoring and tidying of
- ASP.NET parser code to support future changes.
-
-2010-04-20 Mike Krüger <mkrueger@novell.com>
-
- * AspLanguageBuilder.cs: Worked on ASP.NET completion.
-
-2010-04-20 Mike Krüger <mkrueger@novell.com>
-
- * AspLanguageBuilder.cs: Fixed ASP.NET completion.
-
-2010-04-19 Mike Krüger <mkrueger@novell.com>
-
- * AspLanguageBuilder.cs: Worked on ASP.NET completion.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * AspLanguageBuilder.cs:
- * CSharpBinding.AspNet.csproj: Merged MD.Projects into
- MD.Core, and MD.Projects.Gui, MD.Core.Gui and MD.Components
- into MD.Ide.
-
-2010-03-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * CSharpBinding.AspNet.csproj: Don't local-copy project refs,
- as it duplicates assemblies and breaks running on .NET.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Add missing file.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspLanguageBuilder.cs:
- * CSharpBinding.AspNet.csproj: Moved AspLanguageBuilder to its
- own assembly and module. Dropped Asp.Net dependency.
-
diff --git a/main/src/addins/CSharpBinding/AspNet/RazorCSharpCompletionBuilder.cs b/main/src/addins/CSharpBinding/AspNet/RazorCSharpCompletionBuilder.cs
index 974f8ba511..6a39304a4f 100644
--- a/main/src/addins/CSharpBinding/AspNet/RazorCSharpCompletionBuilder.cs
+++ b/main/src/addins/CSharpBinding/AspNet/RazorCSharpCompletionBuilder.cs
@@ -25,11 +25,15 @@
// THE SOFTWARE.
using System;
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.CSharp.Completion;
using MonoDevelop.Ide.CodeCompletion;
-using Mono.TextEditor;
using MonoDevelop.Ide.Gui;
+//using ICSharpCode.NRefactory6.CSharp.Completion;
using MonoDevelop.AspNet.Razor;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.TypeSystem;
namespace MonoDevelop.CSharp.Completion
{
@@ -42,7 +46,7 @@ namespace MonoDevelop.CSharp.Completion
return language == "C#";
}
- CSharpCompletionTextEditorExtension CreateCompletion (Document realDocument, UnderlyingDocumentInfo docInfo,
+ CSharpCompletionTextEditorExtension CreateCompletion (MonoDevelop.Ide.Editor.TextEditor editor, DocumentContext context, UnderlyingDocumentInfo docInfo,
out CodeCompletionContext codeCompletionContext)
{
var documentLocation = docInfo.UnderlyingDocument.Editor.OffsetToLocation (docInfo.CaretPosition);
@@ -54,69 +58,73 @@ namespace MonoDevelop.CSharp.Completion
};
return new CSharpCompletionTextEditorExtension (docInfo.UnderlyingDocument) {
- CompletionWidget = CreateCompletionWidget (realDocument, docInfo)
+ CompletionWidget = CreateCompletionWidget (editor, context, docInfo)
};
}
- CSharpCompletionTextEditorExtension CreateCompletionAndUpdate (Document realDocument, UnderlyingDocumentInfo docInfo,
+ CSharpCompletionTextEditorExtension CreateCompletionAndUpdate (MonoDevelop.Ide.Editor.TextEditor editor, DocumentContext context, UnderlyingDocumentInfo docInfo,
out CodeCompletionContext codeCompletionContext)
{
- var completion = CreateCompletion (realDocument, docInfo, out codeCompletionContext);
+ var completion = CreateCompletion (editor, context, docInfo, out codeCompletionContext);
completion.UpdateParsedDocument ();
return completion;
}
- public ICompletionWidget CreateCompletionWidget (Document realDocument, UnderlyingDocumentInfo docInfo)
+ public ICompletionWidget CreateCompletionWidget (MonoDevelop.Ide.Editor.TextEditor editor, DocumentContext context, UnderlyingDocumentInfo docInfo)
{
- return new RazorCompletionWidget (realDocument, docInfo);
+ return new RazorCompletionWidget (editor, context, docInfo);
}
- public ICompletionDataList HandlePopupCompletion (Document realDocument, UnderlyingDocumentInfo docInfo)
+ public Task<ICompletionDataList> HandlePopupCompletion (MonoDevelop.Ide.Editor.TextEditor editor, DocumentContext context, UnderlyingDocumentInfo docInfo)
{
CodeCompletionContext ccc;
- var completion = CreateCompletionAndUpdate (realDocument, docInfo, out ccc);
+ var completion = CreateCompletionAndUpdate (editor, context, docInfo, out ccc);
return completion.CodeCompletionCommand (ccc);
}
- public ICompletionDataList HandleCompletion (Document realDocument, CodeCompletionContext completionContext,
- UnderlyingDocumentInfo docInfo, char currentChar, ref int triggerWordLength)
+ public Task<ICompletionDataList> HandleCompletion (MonoDevelop.Ide.Editor.TextEditor editor, DocumentContext context, CodeCompletionContext completionContext,
+ UnderlyingDocumentInfo docInfo, char currentChar, CancellationToken token)
{
CodeCompletionContext ccc;
- var completion = CreateCompletionAndUpdate (realDocument, docInfo, out ccc);
- return completion.HandleCodeCompletion (completionContext, currentChar, ref triggerWordLength);
+ var completion = CreateCompletionAndUpdate (editor, context, docInfo, out ccc);
+ return completion.HandleCodeCompletionAsync (completionContext, currentChar, token);
}
- public ParameterDataProvider HandleParameterCompletion (Document realDocument, CodeCompletionContext completionContext,
+ public Task<ParameterHintingResult> HandleParameterCompletion (MonoDevelop.Ide.Editor.TextEditor editor, DocumentContext context, CodeCompletionContext completionContext,
UnderlyingDocumentInfo docInfo, char completionChar)
{
CodeCompletionContext ccc;
- var completion = CreateCompletionAndUpdate (realDocument, docInfo, out ccc);
- return completion.HandleParameterCompletion (completionContext, completionChar);
+ var completion = CreateCompletionAndUpdate (editor, context, docInfo, out ccc);
+ return completion.HandleParameterCompletionAsync (completionContext, completionChar);
}
- public bool GetParameterCompletionCommandOffset (Document realDocument, UnderlyingDocumentInfo docInfo, out int cpos)
- {
- CodeCompletionContext ccc;
- var completion = CreateCompletionAndUpdate (realDocument, docInfo, out ccc);
- return completion.GetParameterCompletionCommandOffset (out cpos);
- }
+// public bool GetParameterCompletionCommandOffset (MonoDevelop.Ide.Editor.TextEditor editor, DocumentContext context, UnderlyingDocumentInfo docInfo, out int cpos)
+// {
+// CodeCompletionContext ccc;
+// var completion = CreateCompletionAndUpdate (editor, context, docInfo, out ccc);
+// return completion.GetParameterCompletionCommandOffset (out cpos);
+// }
- public int GetCurrentParameterIndex (Document realDocument, UnderlyingDocumentInfo docInfo, int startOffset)
+ public Task<int> GetCurrentParameterIndex (MonoDevelop.Ide.Editor.TextEditor editor, DocumentContext context, UnderlyingDocumentInfo docInfo, int startOffset)
{
CodeCompletionContext ccc;
- var completion = CreateCompletionAndUpdate (realDocument, docInfo, out ccc);
- return completion.GetCurrentParameterIndex (startOffset);
+ var completion = CreateCompletionAndUpdate (editor, context, docInfo, out ccc);
+ return completion.GetCurrentParameterIndex (startOffset, default(CancellationToken));
}
}
class RazorCompletionWidget : ICompletionWidget
{
- Document realDocument;
+ DocumentContext realDocumentContext;
+
+ MonoDevelop.Ide.Editor.TextEditor realEditor;
+
UnderlyingDocumentInfo docInfo;
- public RazorCompletionWidget (Document realDocument, UnderlyingDocumentInfo docInfo)
+ public RazorCompletionWidget (MonoDevelop.Ide.Editor.TextEditor editor, DocumentContext context, UnderlyingDocumentInfo docInfo)
{
- this.realDocument = realDocument;
+ this.realEditor = editor;
+ this.realDocumentContext = context;
this.docInfo = docInfo;
}
@@ -131,6 +139,13 @@ namespace MonoDevelop.CSharp.Completion
public event EventHandler CompletionContextChanged;
+ protected virtual void OnCompletionContextChanged (EventArgs e)
+ {
+ var handler = CompletionContextChanged;
+ if (handler != null)
+ handler (this, e);
+ }
+
public string GetText (int startOffset, int endOffset)
{
endOffset = Math.Min (endOffset, TextLength);
@@ -156,11 +171,11 @@ namespace MonoDevelop.CSharp.Completion
public CodeCompletionContext CreateCodeCompletionContext (int triggerOffset)
{
- var savedCtx = realDocument.GetContent<ICompletionWidget> ().CreateCodeCompletionContext (
- realDocument.Editor.Caret.Offset + triggerOffset - docInfo.CaretPosition);
+ var savedCtx = realDocumentContext.GetContent<ICompletionWidget> ().CreateCodeCompletionContext (
+ realEditor.CaretOffset + triggerOffset - docInfo.CaretPosition);
var result = new CodeCompletionContext ();
result.TriggerOffset = triggerOffset;
- var loc = docInfo.UnderlyingDocument.Editor.Document.OffsetToLocation (triggerOffset);
+ var loc = docInfo.UnderlyingDocument.Editor.OffsetToLocation (triggerOffset);
result.TriggerLine = loc.Line;
result.TriggerLineOffset = loc.Column - 1;
@@ -177,7 +192,7 @@ namespace MonoDevelop.CSharp.Completion
return null;
int min = Math.Min (ctx.TriggerOffset, CaretOffset);
int max = Math.Max (ctx.TriggerOffset, CaretOffset);
- return docInfo.UnderlyingDocument.Editor.Document.GetTextBetween (min, max);
+ return docInfo.UnderlyingDocument.Editor.GetTextBetween (min, max);
}
public void SetCompletionText (CodeCompletionContext ctx, string partial_word, string complete_word)
@@ -193,25 +208,28 @@ namespace MonoDevelop.CSharp.Completion
var translatedCtx = new CodeCompletionContext ();
translatedCtx.TriggerOffset = offset;
- var loc = docInfo.UnderlyingDocument.Editor.Document.OffsetToLocation (offset);
+ var loc = docInfo.UnderlyingDocument.Editor.OffsetToLocation (offset);
translatedCtx.TriggerLine = loc.Line;
translatedCtx.TriggerLineOffset = loc.Column - 1;
translatedCtx.TriggerWordLength = ctx.TriggerWordLength;
- realDocument.GetContent<ICompletionWidget> ().SetCompletionText (
+ realDocumentContext.GetContent<ICompletionWidget> ().SetCompletionText (
translatedCtx, partial_word, complete_word, wordOffset);
}
public int CaretOffset
{
get {
- return docInfo.UnderlyingDocument.Editor.Caret.Offset;
+ return docInfo.UnderlyingDocument.Editor.CaretOffset;
+ }
+ set {
+ docInfo.UnderlyingDocument.Editor.CaretOffset = value;
}
}
public int TextLength
{
get {
- return docInfo.UnderlyingDocument.Editor.Document.TextLength;
+ return docInfo.UnderlyingDocument.Editor.Length;
}
}
@@ -229,6 +247,11 @@ namespace MonoDevelop.CSharp.Completion
}
}
+ public double ZoomLevel {
+ get {
+ return 1d;
+ }
+ }
#endregion
}
}
diff --git a/main/src/addins/CSharpBinding/AssemblyInfo.cs b/main/src/addins/CSharpBinding/AssemblyInfo.cs
index 255ca3be25..754c5f2e56 100644
--- a/main/src/addins/CSharpBinding/AssemblyInfo.cs
+++ b/main/src/addins/CSharpBinding/AssemblyInfo.cs
@@ -8,4 +8,10 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyDescription ("CSharp Language Binding")]
[assembly: AssemblyVersion ("2.6")]
[assembly: AssemblyCopyright ("MIT X11")]
-[assembly: InternalsVisibleTo("UnitTests")] \ No newline at end of file
+[assembly: InternalsVisibleTo("UnitTests")]
+[assembly: InternalsVisibleTo("MonoDevelop.CSharpBinding.AspNet")]
+[assembly: InternalsVisibleTo("MonoDevelop.CSharpBinding.Tests")]
+[assembly: InternalsVisibleTo("MonoDevelop.DocFood")]
+[assembly: InternalsVisibleTo("Xamarin.Forms.Addin")]
+[assembly: InternalsVisibleTo("MonoDevelop.GtkCore")]
+[assembly: InternalsVisibleTo("MonoDevelop.IPhone")]
diff --git a/main/src/addins/CSharpBinding/Autotools/Autotools.csproj b/main/src/addins/CSharpBinding/Autotools/Autotools.csproj
index c6e075378a..f6784fc266 100644
--- a/main/src/addins/CSharpBinding/Autotools/Autotools.csproj
+++ b/main/src/addins/CSharpBinding/Autotools/Autotools.csproj
@@ -61,11 +61,6 @@
<Name>CSharpBinding</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
- <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
- <Name>Mono.TextEditor</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\..\MonoDevelop.Refactoring\MonoDevelop.Refactoring.csproj">
<Project>{100568FC-F4E8-439B-94AD-41D11724E45B}</Project>
<Name>MonoDevelop.Refactoring</Name>
diff --git a/main/src/addins/CSharpBinding/Autotools/CSharpAutotoolsSetup.cs b/main/src/addins/CSharpBinding/Autotools/CSharpAutotoolsSetup.cs
index 70434664bb..74eb99329f 100644
--- a/main/src/addins/CSharpBinding/Autotools/CSharpAutotoolsSetup.cs
+++ b/main/src/addins/CSharpBinding/Autotools/CSharpAutotoolsSetup.cs
@@ -10,7 +10,7 @@ using System.Text.RegularExpressions;
namespace CSharpBinding.Autotools
{
- public class CSharpAutotoolsSetup : ISimpleAutotoolsSetup
+ class CSharpAutotoolsSetup : ISimpleAutotoolsSetup
{
public string GetCompilerCommand ( Project project, string configuration )
{
@@ -44,7 +44,7 @@ namespace CSharpBinding.Autotools
if ( config == null ) return "";
CSharpCompilerParameters parameters = (CSharpCompilerParameters) config.CompilationParameters;
- CSharpProjectParameters projectParameters = (CSharpProjectParameters) config.ProjectParameters;
+ ICSharpProject projectParameters = config.ParentItem as ICSharpProject;
StringWriter writer = new StringWriter();
@@ -64,7 +64,7 @@ namespace CSharpBinding.Autotools
writer.Write(" \"-nowarn:" + parameters.NoWarnings + '"');
}
- if(config.DebugMode) {
+ if(config.DebugSymbols) {
writer.Write(" -debug");
//Check whether we have a DEBUG define
bool hasDebugDefine = false;
diff --git a/main/src/addins/CSharpBinding/Autotools/ChangeLog b/main/src/addins/CSharpBinding/Autotools/ChangeLog
deleted file mode 100644
index 72efcd008c..0000000000
--- a/main/src/addins/CSharpBinding/Autotools/ChangeLog
+++ /dev/null
@@ -1,72 +0,0 @@
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * Autotools.csproj: Merged MD.Projects into MD.Core, and
- MD.Projects.Gui, MD.Core.Gui and MD.Components into MD.Ide.
-
-2010-03-09 Mike Krüger <mkrueger@novell.com>
-
- * Autotools.csproj: Worked on new formatter/parser.
-
-2010-01-06 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am: fixed 'Bug 568484 - NRE in resolver'.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * CSharpAutotoolsSetup.cs: Renamed some namespaces.
-
-2009-10-08 Ankit Jain <jankit@novell.com>
-
- * Autotools.csproj: Use \ instead of '/' in the Import.
-
-2009-10-08 Ankit Jain <jankit@novell.com>
-
- * Autotools.csproj: Add md.targets .
-
-2009-08-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * Autotools.csproj: Don't make local copies of project
- references.
-
-2009-07-03 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Autotools.csproj: Worked on refactoring support.
-
-2009-04-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * Autotools.csproj: Flush reference version number.
-
-2009-03-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * Autotools.csproj: Don't local-copy project refs.
-
-2009-03-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Autotools.csproj: Don't local-copy project refs.
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * Autotools.csproj: Moved text editor to core
-
-2009-03-10 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Autotools.csproj: Monodevelop changed the reference a bit.
-
-2009-03-10 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Autotools.csproj: Updated nrefactory references.
-
-2009-02-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpAutotoolsSetup.cs: Moved some properties from
- configuration parameters to project parameters.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * Autotools.mdp:
- * Autotools.csproj: Migrated to MSBuild file format.
-
diff --git a/main/src/addins/CSharpBinding/CSharpBinding.addin.xml b/main/src/addins/CSharpBinding/CSharpBinding.addin.xml
index 8ac2fe8f96..15e1d2e01d 100644
--- a/main/src/addins/CSharpBinding/CSharpBinding.addin.xml
+++ b/main/src/addins/CSharpBinding/CSharpBinding.addin.xml
@@ -1,30 +1,85 @@
<ExtensionModel>
-
- <ConditionType id="MSBuildTargetIsAvailable" type="MonoDevelop.Projects.Formats.MSBuild.TargetsAvailableCondition" />
+
+ <!-- Extension Points -->
+ <ExtensionPoint path = "/MonoDevelop/CSharp/Completion/ContextHandler">
+ <ExtensionNode name="Class"/>
+ </ExtensionPoint>
+
+ <!-- Extensions -->
<Extension path = "/MonoDevelop/Ide/Commands">
<Command id = "MonoDevelop.CodeGeneration.CodeGenerationCommands.ShowCodeGenerationWindow"
_label = "S_how Code Generation Window"
shortcut = "Alt|Insert"
macShortcut = "Meta|I" />
- </Extension>
-
+ <Command id = "MonoDevelop.CSharp.Refactoring.FindProjectReferenceUsages"
+ defaultHandler = "MonoDevelop.CSharp.Refactoring.FindProjectReferenceUsagesHandler"
+ _label = "_Find reference usages"/>
+ <Command id = "MonoDevelop.CSharp.Navigation.FindExtensionMethods"
+ defaultHandler = "MonoDevelop.CSharp.Navigation.FindExtensionMethodsHandler"
+ _label = "Extension Methods"/>
+ <Command id = "MonoDevelop.Refactoring.Navigation.FindBaseSymbols"
+ defaultHandler = "MonoDevelop.CSharp.Navigation.FindBaseSymbolsHandler"
+ _label = "Base Symbols"/>
+ <Command id = "MonoDevelop.Refactoring.Navigation.FindDerivedSymbols"
+ defaultHandler = "MonoDevelop.CSharp.Refactoring.FindDerivedSymbolsHandler"
+ _label = "Derived Symbols"/>
+ <Command id = "MonoDevelop.CSharp.Navigation.FindMemberOverloads"
+ defaultHandler = "MonoDevelop.CSharp.Navigation.FindMemberOverloadsHandler"
+ _label = "Member Overloads"/>
+ <Command id = "MonoDevelop.CSharp.Navigation.FindImplementingMembers"
+ defaultHandler = "MonoDevelop.CSharp.Navigation.FindImplementingMembersHandler"
+ _label = "Implementing Members"/>
+ </Extension>
+
+ <Extension path = "/MonoDevelop/Ide/Commands/Refactoring">
+<!-- <Command id = "MonoDevelop.Refactoring.RefactoryCommands.Resolve"
+ defaultHandler = "MonoDevelop.CSharp.Refactoring.ResolveCommandHandler"
+ type="array"
+ _label = "Resolve"/> -->
+ <Command id = "MonoDevelop.CSharp.Refactoring.ExtractMethodCommand"
+ defaultHandler = "MonoDevelop.CSharp.Refactoring.ExtractMethodCommandHandler"
+ _label = "Extract Method"
+ _description = "Extracts a method"
+ />
+ <Command id = "MonoDevelop.Refactoring.RefactoryCommands.CurrentRefactoryOperations"
+ defaultHandler = "MonoDevelop.CSharp.Refactoring.CurrentRefactoryOperationsHandler"
+ type="array"
+ _label = "Refactory Operations" />
+ <Command id = "MonoDevelop.CSharp.Refactoring.OrganizeImportsCommand"
+ defaultHandler = "MonoDevelop.CSharp.Refactoring.OrganizeImportsCommandHandler"
+ _label = "_Sort Usings"
+ />
+ <Command id = "MonoDevelop.CSharp.Refactoring.RemoveUnusedImportsCommand"
+ defaultHandler = "MonoDevelop.CSharp.Refactoring.RemoveUnusedImportsCommandHandler"
+ _label = "_Remove Unused Usings"
+ />
+ <Command id = "MonoDevelop.CSharp.Refactoring.SortAndRemoveImportsCommand"
+ defaultHandler = "MonoDevelop.CSharp.Refactoring.SortAndRemoveImportsCommandHandler"
+ _label = "R_emove and Sort"
+ />
+ </Extension>
+
+ <Extension path = "/MonoDevelop/Ide/Commands/CodeNavigation">
+ <Command id = "MonoDevelop.Refactoring.RefactoryCommands.GotoDeclaration"
+ _label = "_Go to Declaration"
+ shortcut = "F12"
+ macShortcut = "Meta|D"/>
+ </Extension>
+
+
<Extension path = "/MonoDevelop/ProjectModel/MSBuildItemTypes">
- <DotNetProject
+ <DotNetProjectType
language="C#"
extension="csproj"
guid="{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
- import="$(MSBuildBinPath)\Microsoft.CSharp.targets"
- resourceHandler="MonoDevelop.CSharp.Project.CSharpResourceIdBuilder"
+ type="MonoDevelop.CSharp.Project.CSharpProject"
/>
+ </Extension>
+
+ <Extension path = "/MonoDevelop/ProjectModel/ProjectModelExtensions">
<Condition id="MSBuildTargetIsAvailable" target="$(MSBuildExtensionsPath)\Microsoft\Portable\v4.0\Microsoft.Portable.CSharp.targets">
- <DotNetProjectSubtype
- guid="{786C830F-07A1-408B-BD7F-6EE04809D6DB}"
- type="MonoDevelop.Projects.PortableDotNetProject"
- useXBuild="true">
- <AddImport language="C#" projects="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
- <RemoveImport language="C#" projects="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- </DotNetProjectSubtype>
+ <ProjectFlavor guid="{786C830F-07A1-408B-BD7F-6EE04809D6DB}" type="MonoDevelop.CSharp.Project.PortableCSharpProjectFlavor" alias="C#PortableLibrary"/>
</Condition>
</Extension>
@@ -34,13 +89,13 @@
</Extension>
<Extension path = "/MonoDevelop/Ide/ProjectTemplates">
- <ProjectTemplate id = "CSharpConsoleProject" resource = "ConsoleProject.xpt.xml"/>
- <ProjectTemplate id = "CSharpEmptyProject" resource = "EmptyProject.xpt.xml"/>
- <ProjectTemplate id = "CSharpGtkSharp2Project" resource = "GtkSharp2Project.xpt.xml"/>
- <ProjectTemplate id = "CSharpLibrary" resource = "Library.xpt.xml"/>
- <ProjectTemplate id = "CSharpSharedAssetsProject" resource = "SharedAssetsProject.xpt.xml"/>
+ <ProjectTemplate id = "MonoDevelop.CSharp.ConsoleProject" resource = "ConsoleProject.xpt.xml"/>
+ <ProjectTemplate id = "MonoDevelop.CSharp.EmptyProject" resource = "EmptyProject.xpt.xml"/>
+ <ProjectTemplate id = "MonoDevelop.CSharp.GtkSharp2Project" resource = "GtkSharp2Project.xpt.xml"/>
+ <ProjectTemplate id = "MonoDevelop.CSharp.Library" resource = "Library.xpt.xml"/>
+ <ProjectTemplate id = "MonoDevelop.CSharp.SharedProject" resource = "SharedAssetsProject.xpt.xml"/>
<Condition id="MSBuildTargetIsAvailable" target="$(MSBuildExtensionsPath)\Microsoft\Portable\v4.0\Microsoft.Portable.CSharp.targets">
- <ProjectTemplate id = "CSharpPortableLibrary" resource = "PortableLibrary.xpt.xml" />
+ <ProjectTemplate id = "MonoDevelop.CSharp.PortableLibrary" resource = "PortableLibrary.xpt.xml" />
</Condition>
</Extension>
@@ -52,7 +107,7 @@
</Extension>
<Extension path = "/MonoDevelop/ProjectModel/Gui/ItemOptionPanels/Build/General">
- <Condition id="ActiveLanguage" value="C#">
+ <Condition id="ProjectTypeId" value="C#">
<Panel id = "CSharpCompilerOptionsPanel"
_label = "C#"
class = "MonoDevelop.CSharp.Project.CompilerOptionsPanel"/>
@@ -60,7 +115,7 @@
</Extension>
<Extension path = "/MonoDevelop/ProjectModel/Gui/ItemOptionPanels/Build/Compiler">
- <Condition id="ActiveLanguage" value="C#">
+ <Condition id="ProjectTypeId" value="C#">
<Panel id = "CSharpCodeGenerationPanel"
_label = "Compiler"
class = "MonoDevelop.CSharp.Project.CodeGenerationPanel"/>
@@ -68,9 +123,12 @@
</Extension>
<Extension path = "/MonoDevelop/ProjectModel/LanguageBindings">
- <LanguageBinding id = "CSharp"
- supportedextensions = ".cs"
- class = "MonoDevelop.CSharp.CSharpLanguageBinding" />
+ <LanguageBinding id = "C#"
+ extensions = ".cs"
+ singleLineCommentTag = "//"
+ blockCommentStartTag = "/*"
+ blockCommentEndTag = "*/"
+ codeDomType = "MonoDevelop.CSharp.CSharpEnhancedCodeProvider" />
</Extension>
<Extension path = "/MonoDevelop/Ide/ReferenceFinder">
@@ -78,11 +136,6 @@
class = "MonoDevelop.CSharp.Refactoring.CSharpReferenceFinder" />
</Extension>
- <Extension path = "/MonoDevelop/ProjectModel/SerializableClasses">
- <DataType class = "MonoDevelop.CSharp.Project.CSharpCompilerParameters" />
- <DataType class = "MonoDevelop.CSharp.Project.CSharpProjectParameters" />
- </Extension>
-
<Extension path = "/MonoDevelop/Ide/TextEditorExtensions">
<!-- indent engine must be before the completion text editor engine,
otherwise stuff like
@@ -102,6 +155,10 @@
<Class fileExtensions = ".cs" class = "MonoDevelop.CSharp.Highlighting.HighlightUsagesExtension" />
<Class fileExtensions = ".cs" class = "MonoDevelop.CSharp.PathedDocumentTextEditorExtension" />
<Class fileExtensions = ".cs" class = "MonoDevelop.CSharp.UnitTestTextEditorExtension" />
+ <Class fileExtensions = ".cs" class = "MonoDevelop.CSharp.ClassOutline.CSharpOutlineTextEditorExtension" />
+ <Class fileExtensions = ".cs" class = "MonoDevelop.CSharp.CSharpNavigationTextEditorExtension" />
+ <Class fileExtensions = ".json" class = "MonoDevelop.JSon.JSonTextEditorExtension" />
+ <Class class = "MonoDevelop.CSharp.Refactoring.CSharpFeaturesTextEditorExtension" />
</Extension>
<Extension path = "/MonoDevelop/Core/StockIcons">
@@ -122,8 +179,8 @@
<Formatter mimeType="text/x-csharp" class="MonoDevelop.CSharp.Formatting.CSharpFormatter" />
</Extension>
- <Extension path = "/MonoDevelop/TypeSystem/Ambiences">
- <Ambience mimeType="text/x-csharp" class = "MonoDevelop.CSharp.CSharpAmbience" />
+ <Extension path = "/MonoDevelop/TypeSystem/AmbienceTooltipProviders">
+ <Provider mimeType="text/x-csharp" class = "MonoDevelop.CSharp.CSharpAmbience" />
</Extension>
<Extension path = "/MonoDevelop/TypeSystem/Parser">
@@ -152,7 +209,7 @@
<Extension path = "/MonoDevelop/ProjectModel/PolicySets" >
<PolicySet id="1TBS" _name="SharpDevelop style (1TBS)" allowDiffSerialize="false">
- <Policies resource="SharpDevelopCSharpPolicy.xml" />
+ <Policies resource="KRCSharpPolicy.xml" />
<Policies resource="InvariantTextStylePolicy.xml" />
</PolicySet>
</Extension>
@@ -161,24 +218,11 @@
<Policies resource="AllmanCSharpPolicy.xml" />
</Extension>
- <Extension path = "/MonoDevelop/ProjectModel/PolicySets" >
- <PolicySet id="Whitesmiths" _name="Whitesmiths style" allowDiffSerialize="false">
- <Policies resource="WhitesmithsCSharpPolicy.xml" />
- <Policies resource="InvariantTextStylePolicy.xml" />
- </PolicySet>
- </Extension>
-
- <Extension path = "/MonoDevelop/ProjectModel/PolicySets" >
- <PolicySet id="GNU" _name="GNU style" allowDiffSerialize="false">
- <Policies resource="GNUCSharpPolicy.xml" />
- <Policies resource="GNUTextStylePolicy.xml" />
- </PolicySet>
- </Extension>
-
<Extension path = "/MonoDevelop/ProjectModel/Gui/MimeTypePolicyPanels">
<Panel id = "CSharpFormatting" _label = "C# Format" mimeType="text/x-csharp" class = "MonoDevelop.CSharp.Formatting.CSharpFormattingPolicyPanel" />
</Extension>
+<!--
<Extension path = "/MonoDevelop/Refactoring/CodeActions">
<Action mimeType="text/x-csharp"
_title = "Move type to another file"
@@ -189,10 +233,10 @@
_description = "Converts constant fields to enumeration"
class = "MonoDevelop.CSharp.Refactoring.CodeActions.ConvertToEnumAction" />
</Extension>
-
+
<Extension path = "/MonoDevelop/Refactoring/CodeIssues">
<CodeIssue mimeType="text/x-csharp" severity = "Error" class="MonoDevelop.CSharp.Refactoring.CodeIssues.MonoTODOIssue"/>
- </Extension>
+ </Extension> -->
<Extension path = "/MonoDevelop/Ide/TextEditorResolver">
<Resolver class = "MonoDevelop.CSharp.Resolver.TextEditorResolverProvider" mimeType="text/x-csharp" />
@@ -224,36 +268,29 @@
</Extension>
<Extension path = "/MonoDevelop/Refactoring/CodeGenerators">
+
<Class class = "MonoDevelop.CodeGeneration.CreateConstructorGenerator" />
<Class class = "MonoDevelop.CodeGeneration.ReadonlyPropertyGenerator" />
<Class class = "MonoDevelop.CodeGeneration.PropertyGenerator" />
- <Class class = "MonoDevelop.CodeGeneration.ImplementInterfaceMembersGenerator" />
+<!-- <Class class = "MonoDevelop.CodeGeneration.ImplementInterfaceMembersGenerator" /> -->
<Class class = "MonoDevelop.CodeGeneration.RequiredProtocolMemberGenerator" />
<Class class = "MonoDevelop.CodeGeneration.OptionalProtocolMemberGenerator" />
<Class class = "MonoDevelop.CodeGeneration.PartialGenerator" />
<Class class = "MonoDevelop.CodeGeneration.OverrideMembersGenerator" />
<Class class = "MonoDevelop.CodeGeneration.ToStringGenerator" />
<Class class = "MonoDevelop.CodeGeneration.RaiseEventMethodGenerator" />
- <Class class = "MonoDevelop.CodeGeneration.EqualityMembersGenerator" />
+<!-- <Class class = "MonoDevelop.CodeGeneration.EqualityMembersGenerator" /> -->
<Class class = "MonoDevelop.CodeGeneration.WriteLineGenerator" />
</Extension>
- <Extension path = "/MonoDevelop/Refactoring/CodeActionSource">
- <Source class ="MonoDevelop.CSharp.Refactoring.CodeActions.NRefactoryCodeActionSource"/>
- </Extension>
-
- <Extension path = "/MonoDevelop/Refactoring/CodeIssueSource">
- <Source class ="MonoDevelop.CSharp.Refactoring.CodeIssues.NRefactoryCodeIssueSource"/>
- </Extension>
-
<Extension path = "/MonoDevelop/ProjectModel/Gui/DefaultPolicyPanels/SourceCode">
- <Section id="NameConventions" _label="Name Conventions" fill = "true" class="MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionPanel" icon="md-prefs-name-conventions" />
+ <Section id="NameConventions" _label="Name Conventions" fill = "true" class="MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionPanel" icon="md-prefs-name-conventions" />
</Extension>
<Extension path = "/MonoDevelop/ProjectModel/Gui/ItemOptionPanels/SourceCode">
- <Section id="NameConventions" _label="Name Conventions" fill = "true" class="MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionPanel" icon="md-prefs-name-conventions" />
+ <Section id="NameConventions" _label="Name Conventions" fill = "true" class="MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionPanel" icon="md-prefs-name-conventions" />
</Extension>
<Extension path = "/MonoDevelop/Ide/GlobalOptionsDialog/SourceCode">
- <Section id="NameConventions" _label="Name Conventions" fill = "true" class="MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionPanel" icon="md-prefs-name-conventions" />
+ <Section id="NameConventions" _label="Name Conventions" fill = "true" class="MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionPanel" icon="md-prefs-name-conventions" />
</Extension>
<Extension path = "/MonoDevelop/SourceEditor2/TooltipProviders">
@@ -263,4 +300,63 @@
<Extension path = "/MonoDevelop/Ide/CompletionCharacters">
<Complete language="C#" commitOnSpace="True" commitChars="{}[]().,:;+-*/%&amp;|^!~=&lt;&gt;?@#'&quot;\"/>
</Extension>
-</ExtensionModel>
+
+ <Extension path = "/MonoDevelop/SourceEditor2/ContextMenu/Editor">
+ <Condition id="FileType" mimeTypes="text/x-csharp">
+ <CommandItem id = "MonoDevelop.Refactoring.RefactoryCommands.CurrentRefactoryOperations" insertafter="MonoDevelop.SourceEditor.SourceEditorCommands.MarkerOperations" insertbefore="MonoDevelop.Debugger.DebugCommands.ExpressionEvaluator"/>
+
+ <ItemSet id = "Navigate" _label = "Navigate">
+ <CommandItem id = "MonoDevelop.Refactoring.RefactoryCommands.FindReferences"/>
+ <CommandItem id = "MonoDevelop.Refactoring.RefactoryCommands.FindAllReferences"/>
+ <CommandItem id = "MonoDevelop.Refactoring.Navigation.FindBaseSymbols"/>
+ <CommandItem id = "MonoDevelop.Refactoring.Navigation.FindDerivedSymbols"/>
+ <SeparatorItem id = "Separator1" />
+
+ <CommandItem id = "MonoDevelop.CSharp.Navigation.FindExtensionMethods"/>
+ <CommandItem id = "MonoDevelop.CSharp.Navigation.FindMemberOverloads"/>
+ <CommandItem id = "MonoDevelop.CSharp.Navigation.FindImplementingMembers"/>
+ </ItemSet>
+
+
+ <ItemSet id = "Organize Imports" _label = "Organize Usings" insertafter="MonoDevelop.Ide.Commands.TextEditorCommands.ShowCodeTemplateWindow">
+ <CommandItem id = "MonoDevelop.CSharp.Refactoring.RemoveUnusedImportsCommand"/>
+ <CommandItem id = "MonoDevelop.CSharp.Refactoring.OrganizeImportsCommand"/>
+ <CommandItem id = "MonoDevelop.CSharp.Refactoring.SortAndRemoveImportsCommand"/>
+ </ItemSet>
+ </Condition>
+ </Extension>
+
+ <Extension path = "/MonoDevelop/CSharp/Completion/ContextHandler">
+ <Class class="MonoDevelop.CSharp.Completion.ProtocolMemberContextHandler" />
+ </Extension>
+
+ <Extension path = "/MonoDevelop/Ide/BraceMatcher">
+ <Class class="MonoDevelop.CSharp.CSharpBraceMatcher" />
+ </Extension>
+
+ <Extension path = "/MonoDevelop/Ide/ContextMenu/ProjectPad">
+ <Condition id="ItemType" value="ProjectReference|Reference">
+ <CommandItem id = "MonoDevelop.CSharp.Refactoring.FindProjectReferenceUsages" />
+ </Condition>
+ </Extension>
+
+ <Extension path="/MonoDevelop/Ide/SearchCategories">
+ <Class class="MonoDevelop.CSharp.ProjectSearchCategory" />
+ </Extension>
+
+ <Extension path = "/MonoDevelop/Refactoring/FindReferencesProvider">
+ <Class class="MonoDevelop.CSharp.Refactoring.CSharpFindReferencesProvider" />
+ </Extension>
+
+ <Extension path = "/MonoDevelop/Refactoring/JumpToDeclarationHandler">
+ <Class class="MonoDevelop.CSharp.Refactoring.CSharpJumpToDeclarationHandler" />
+ </Extension>
+
+ <Extension path = "/MonoDevelop/UnitTesting/NUnitSourceCodeLocationFinder">
+ <Class class="MonoDevelop.CSharp.UnitTests.CSharpNUnitSourceCodeLocationFinder" />
+ </Extension>
+
+ <Extension path = "/MonoDevelop/Ide/AutoInsertBracketHandler">
+ <Class class="MonoDevelop.CSharp.Features.AutoInsertBracket.CSharpAutoInsertBracketHandler" insertbefore="Default"/>
+ </Extension>
+</ExtensionModel> \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/CSharpBinding.csproj b/main/src/addins/CSharpBinding/CSharpBinding.csproj
index 180eb11cbd..7e33495d05 100644
--- a/main/src/addins/CSharpBinding/CSharpBinding.csproj
+++ b/main/src/addins/CSharpBinding/CSharpBinding.csproj
@@ -3,13 +3,13 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{07CC7654-27D6-421D-A64C-0FFA40456FA2}</ProjectGuid>
<OutputType>Library</OutputType>
<AssemblyName>MonoDevelop.CSharpBinding</AssemblyName>
<RootNamespace>CSharpBinding</RootNamespace>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
@@ -52,11 +52,6 @@
<Name>MonoDevelop.Ide</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
- <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
- <Name>Mono.TextEditor</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\MonoDevelop.Debugger\MonoDevelop.Debugger.csproj">
<Project>{2357AABD-08C7-4808-A495-8FF2D3CDFDB0}</Project>
<Name>MonoDevelop.Debugger</Name>
@@ -67,11 +62,6 @@
<Name>MonoDevelop.DesignerSupport</Name>
<Private>False</Private>
</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="..\MonoDevelop.Refactoring\MonoDevelop.Refactoring.csproj">
<Project>{100568FC-F4E8-439B-94AD-41D11724E45B}</Project>
<Name>MonoDevelop.Refactoring</Name>
@@ -117,19 +107,25 @@
<Name>Xwt</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\NUnit\MonoDevelop.NUnit.csproj">
- <Project>{A7A4246D-CEC4-42DF-A3C1-C31B9F51C4EC}</Project>
- <Name>MonoDevelop.NUnit</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory.CSharp.Refactoring\ICSharpCode.NRefactory.CSharp.Refactoring.csproj">
<Project>{2A705FC6-1A9E-4941-9E47-254D79F2D9D5}</Project>
<Name>ICSharpCode.NRefactory.CSharp.Refactoring</Name>
+ <Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory.Xml\ICSharpCode.NRefactory.Xml.csproj">
<Project>{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}</Project>
<Name>ICSharpCode.NRefactory.Xml</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\..\external\RefactoringEssentials\RefactoringEssentials\RefactoringEssentials.csproj">
+ <Project>{C465A5DC-AD28-49A2-89C0-F81838814A7E}</Project>
+ <Name>RefactoringEssentials</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\MonoDevelop.UnitTesting\MonoDevelop.UnitTesting.csproj">
+ <Project>{A7A4246D-CEC4-42DF-A3C1-C31B9F51C4EC}</Project>
+ <Name>MonoDevelop.UnitTesting</Name>
+ <Private>False</Private>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
@@ -153,6 +149,34 @@
</Reference>
<Reference Include="System.Core" />
<Reference Include="Mono.Cairo" />
+ <Reference Include="System.Composition.AttributedModel">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Composition.AttributedModel.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Reflection.Metadata">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Reflection.Metadata.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Collections.Immutable">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Collections.Immutable.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.Workspaces">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.Workspaces.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.CSharp.Workspaces">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.CSharp.Workspaces.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.CSharp">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="templates\ConsoleProject.xpt.xml">
@@ -191,27 +215,15 @@
<EmbeddedResource Include="MonoDevelop.CSharp.Formatting\policies\MonoCSharpPolicy.xml">
<LogicalName>MonoCSharpPolicy.xml</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="MonoDevelop.CSharp.Formatting\policies\SharpDevelopCSharpPolicy.xml">
- <LogicalName>SharpDevelopCSharpPolicy.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="MonoDevelop.CSharp.Formatting\policies\WhitesmithsCSharpPolicy.xml">
- <LogicalName>WhitesmithsCSharpPolicy.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="MonoDevelop.CSharp.Formatting\policies\GNUCSharpPolicy.xml">
- <LogicalName>GNUCSharpPolicy.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="MonoDevelop.CSharp.Formatting\policies\GNUTextStylePolicy.xml">
- <LogicalName>GNUTextStylePolicy.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="MonoDevelop.CSharp.Refactoring.CodeIssues\NamingInspection\MonoNameConventionPolicy.xml">
- <LogicalName>MonoNameConventionPolicy.xml</LogicalName>
- </EmbeddedResource>
<EmbeddedResource Include="templates\PortableLibrary.xpt.xml">
<LogicalName>PortableLibrary.xpt.xml</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="templates\SharedAssetsProject.xpt.xml">
<LogicalName>SharedAssetsProject.xpt.xml</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.CSharp.Diagnostics\InconsistentNaming\MonoNameConventionPolicy.xml">
+ <LogicalName>MonoNameConventionPolicy.xml</LogicalName>
+ </EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Compile Include="gtk-gui\generated.cs" />
@@ -222,7 +234,6 @@
<Compile Include="MonoDevelop.CSharp.Formatting\CSharpFormattingPolicyPanel.cs" />
<Compile Include="MonoDevelop.CSharp.Formatting\CSharpFormatter.cs" />
<Compile Include="MonoDevelop.CSharp.Project\CSharpCompilerParameters.cs" />
- <Compile Include="MonoDevelop.CSharp.Project\CSharpProjectParameters.cs" />
<Compile Include="MonoDevelop.CSharp.Project\CSharpResourceIdBuilder.cs" />
<Compile Include="MonoDevelop.CSharp.Project\CodeGenerationPanel.cs" />
<Compile Include="MonoDevelop.CSharp.Project\CompilerOptionsPanelWidget.cs" />
@@ -230,8 +241,6 @@
<Compile Include="gtk-gui\MonoDevelop.CSharp.Project.CompilerOptionsPanelWidget.cs" />
<Compile Include="MonoDevelop.CSharp\CSharpBindingCompilerManager.cs" />
<Compile Include="MonoDevelop.CSharp\CSharpEnhancedCodeProvider.cs" />
- <Compile Include="MonoDevelop.CSharp\CSharpLanguageBinding.cs" />
- <Compile Include="MonoDevelop.CSharp.Resolver\TextEditorResolverProvider.cs" />
<Compile Include="MonoDevelop.CSharp.Formatting\Indent.cs" />
<Compile Include="MonoDevelop.CSharp.Formatting\OnTheFlyFormatter.cs" />
<Compile Include="MonoDevelop.CSharp.Highlighting\HighlightUsagesExtension.cs" />
@@ -248,18 +257,8 @@
<Compile Include="MonoDevelop.CSharp\CSharpAmbience.cs" />
<Compile Include="MonoDevelop.CSharp\PathedDocumentTextEditorExtension.cs" />
<Compile Include="MonoDevelop.CSharp.Completion\CSharpCompletionTextEditorExtension.cs" />
- <Compile Include="MonoDevelop.CSharp.Completion\MemberCompletionData.cs">
- <DependentUpon>IndexerParameterDataProvider.cs</DependentUpon>
- </Compile>
- <Compile Include="MonoDevelop.CSharp.Completion\DelegateDataProvider.cs" />
- <Compile Include="MonoDevelop.CSharp.Refactoring\CSharpReferenceFinder.cs" />
- <Compile Include="MonoDevelop.CSharp.Completion\ConstructorParameterDataProvider.cs" />
- <Compile Include="MonoDevelop.CSharp.Completion\MethodParameterDataProvider.cs" />
<Compile Include="MonoDevelop.CSharp.Refactoring\CSharpCodeGenerator.cs" />
- <Compile Include="MonoDevelop.CSharp.Completion\NewOverrideCompletionData.cs" />
<Compile Include="MonoDevelop.CSharp.Completion\EventCreationCompletionData.cs" />
- <Compile Include="MonoDevelop.CSharp.Completion\VariableCompletionData.cs" />
- <Compile Include="MonoDevelop.CSharp.Completion\IndexerParameterDataProvider.cs" />
<Compile Include="MonoDevelop.CSharp.Refactoring\HelperMethods.cs" />
<Compile Include="MonoDevelop.CSharp.Parser\CSharpFoldingParser.cs" />
<Compile Include="MonoDevelop.CSharp.CodeGeneration\AbstractGenerateAction.cs" />
@@ -277,45 +276,567 @@
<Compile Include="MonoDevelop.CSharp.Formatting\CSharpIndentVirtualSpaceManager.cs" />
<Compile Include="MonoDevelop.CSharp.CodeGeneration\ReadonlyPropertyGenerator.cs" />
<Compile Include="MonoDevelop.CSharp.CodeGeneration\RaiseEventMethodGenerator.cs" />
- <Compile Include="MonoDevelop.CSharp.Refactoring.CodeActions\ContextActionExtensions.cs" />
- <Compile Include="MonoDevelop.CSharp.Refactoring.CodeActions\MDRefactoringContext.cs" />
- <Compile Include="MonoDevelop.CSharp.Refactoring.CodeActions\Actions\MoveTypeToFile.cs" />
- <Compile Include="MonoDevelop.CSharp.Refactoring.CodeActions\MDRefactoringScript.cs" />
- <Compile Include="MonoDevelop.CSharp.Refactoring.CodeIssues\NRefactoryCodeIssueSource.cs" />
- <Compile Include="MonoDevelop.CSharp.Refactoring.CodeActions\NRefactoryCodeActionSource.cs" />
- <Compile Include="MonoDevelop.CSharp.Refactoring.CodeIssues\NamingInspection\NameConventionRule.cs" />
- <Compile Include="MonoDevelop.CSharp.Refactoring.CodeIssues\NamingInspection\NameConventionEditRuleDialog.cs" />
- <Compile Include="MonoDevelop.CSharp.Refactoring.CodeIssues\NamingInspection\NameConventionPanel.cs" />
- <Compile Include="MonoDevelop.CSharp.Refactoring.CodeIssues\NamingInspection\NameConventionPanelWidget.cs" />
- <Compile Include="gtk-gui\MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionEditRuleDialog.cs" />
- <Compile Include="gtk-gui\MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionPanelWidget.cs" />
- <Compile Include="MonoDevelop.CSharp.Refactoring.CodeIssues\NamingInspection\NameConventionPolicy.cs" />
- <Compile Include="MonoDevelop.CSharp.Refactoring.CodeActions\NRefactoryCodeActionProvider.cs" />
- <Compile Include="MonoDevelop.CSharp.Refactoring.CodeIssues\NRefactoryIssueProvider.cs" />
- <Compile Include="MonoDevelop.CSharp.Refactoring.CodeActions\NRefactoryCodeAction.cs" />
<Compile Include="MonoDevelop.CSharp.Tooltips\LanguageItemTooltipProvider.cs" />
<Compile Include="MonoDevelop.CSharp\AstAmbience.cs" />
<Compile Include="MonoDevelop.CSharp\AstStockIcons.cs" />
- <Compile Include="MonoDevelop.CSharp.Completion\AbstractParameterDataProvider.cs" />
<Compile Include="MonoDevelop.CSharp.Highlighting\CSharpSelectionSurroundingProvider.cs" />
<Compile Include="MonoDevelop.CSharp\SignatureMarkupCreator.cs" />
- <Compile Include="MonoDevelop.CSharp.Completion\ArrayTypeParameterDataProvider.cs" />
<Compile Include="MonoDevelop.CSharp.CodeGeneration\ImplementInterfaceMembersGenerator.cs" />
- <Compile Include="MonoDevelop.CSharp.Completion\TypeParameterDataProvider.cs" />
- <Compile Include="MonoDevelop.CSharp.Refactoring.CodeActions\Actions\ConvertToEnumAction.cs" />
- <Compile Include="MonoDevelop.CSharp.Refactoring.CodeActions\Actions\ConvertToEnumDialog.cs" />
<Compile Include="MonoDevelop.CSharp.UnitTests\UnitTestTextEditorExtension.cs" />
- <Compile Include="MonoDevelop.CSharp.Refactoring.CodeIssues\BaseNRefactoryIssueProvider.cs" />
<Compile Include="MonoDevelop.CSharp.CodeGeneration\PartialGenerator.cs" />
<Compile Include="AddinInfo.cs" />
- <Compile Include="MonoDevelop.CSharp.Refactoring.CodeIssues\Issues\MonoTODOIssue.cs" />
<Compile Include="MonoDevelop.CSharp.Refactoring\CSharpCodeGenerationService.cs" />
<Compile Include="MonoDevelop.CSharp.CodeGeneration\ExportCodeGenerator.cs" />
- <Compile Include="MonoDevelop.CSharp.Completion\MonoCSharpCompletionEngine.cs" />
- <Compile Include="MonoDevelop.CSharp.Completion\ProtocolCompletionData.cs" />
+ <Compile Include="MonoDevelop.CSharp.Project\CSharpProjectExtension.cs" />
+ <Compile Include="MonoDevelop.CSharp.Project\PortableCSharpProjectFlavor.cs" />
+ <Compile Include="MonoDevelop.CSharp.Completion\RoslynSymbolCompletionData.cs" />
+ <Compile Include="MonoDevelop.CSharp.Completion\RoslynCodeCompletionFactory.cs" />
+ <Compile Include="MonoDevelop.CSharp.Completion\RoslynParameterHintingFactory.cs" />
+ <Compile Include="MonoDevelop.CSharp.ClassOutline\CSharpOutlineTextEditorExtension.cs" />
+ <Compile Include="MonoDevelop.CSharp.ClassOutline\OutlineSortingPreferencesDialog.cs" />
+ <Compile Include="gtk-gui\MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.cs" />
+ <Compile Include="MonoDevelop.CSharp.ClassOutline\OutlineSettings.cs" />
+ <Compile Include="MonoDevelop.CSharp.ClassOutline\OutlineNodeComparer.cs" />
+ <Compile Include="MonoDevelop.CSharp.Completion\ProtocolCompletionData.cs">
+ <DependentUpon>ProtocolMemberContextHandler.cs</DependentUpon>
+ </Compile>
+ <Compile Include="MonoDevelop.CSharp.Formatting\CSharpTextPasteHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Completion\CreateOverrideCompletionData.cs" />
+ <Compile Include="MonoDevelop.CSharp.Completion\CreatePartialCompletionData.cs" />
+ <Compile Include="MonoDevelop.CSharp.Resolver\TextEditorResolverProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.Parser\CSharpParsedDocument.cs" />
+ <Compile Include="MonoDevelop.CSharp.Resolver\DebuggerExpressionResolver.cs" />
+ <Compile Include="MonoDevelop.CSharp.Completion\ImportSymbolCompletionData.cs" />
+ <Compile Include="MonoDevelop.CSharp.Completion\ProtocolMemberContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Completion\AnonymousMethodCompletionData.cs" />
+ <Compile Include="MonoDevelop.CSharp.Completion\ObjectCreationCompletionData.cs" />
+ <Compile Include="MonoDevelop.CSharp.Completion\CastCompletionData.cs" />
+ <Compile Include="MonoDevelop.CSharp.Completion\RoslynCompletionData.cs" />
+ <Compile Include="MonoDevelop.JSon\JSonIndentationTracker.cs" />
+ <Compile Include="MonoDevelop.JSon\JSonIndentEngine.cs" />
+ <Compile Include="MonoDevelop.JSon\JSonTextEditorExtension.cs" />
+ <Compile Include="MonoDevelop.CSharp.Refactoring\ExtractMethodCommandHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Refactoring\RefactoryCommands.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\AddImport\CSharpAddImportCodeFixProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\AddImport\AbstractAddImportCodeFixProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\FullyQualify\CSharpFullyQualifyCodeFixProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\PredefinedCodeFixProviderNames.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\Async\CSharpConvertToAsyncMethodCodeFixProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\Async\CSharpAddAwaitCodeFixProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\Async\CSharpAddAsyncCodeFixProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\Async\AbstractAsyncCodeFix.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\MoveTypeToFile\MoveTypeToFile.cs" />
+ <Compile Include="MonoDevelop.CSharp.Refactoring\GotoDeclarationHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\GenerateConstructor\AbstractGenerateMemberCodeFixProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\GenerateMethod\GenerateConversionCodeFixProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\GenerateMethod\GenerateMethodCodeFixProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\GenerateVariable\GenerateVariableCodeFixProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\ImplementAbstractClass\ImplementAbstractClassCodeFixProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\ImplementInterface\ImplementInterfaceCodeFixProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.Completion\RoslynCompletionCategory.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeRefactorings\IntroduceVariable\IntroduceVariableCodeRefactoringProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeRefactorings\PredefinedCodeRefactoringProviderNames.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.InitializerRewriter.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.ReferenceRewriter.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeRefactorings\ExtractMethod\ExtractMethodCodeRefactoringProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\GenerateType\GenerateTypeCodeFixProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.Diagnostics\DiagnosticCustomTags.cs" />
+ <Compile Include="MonoDevelop.CSharp.Diagnostics\IDEDiagnosticIds.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\SimplifyTypeNames\SimplifyTypeNamesCodeFixProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\SimplifyTypeNames\SimplifyTypeNamesCodeFixProvider.SimplifyTypeNamesFixAllProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\RemoveUnnecessaryUsings\RemoveUnnecessaryUsingsCodeFixProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.Diagnostics\RemoveUnnecessaryCast\RemoveUnnecessaryCastDiagnosticAnalyzerBase.cs" />
+ <Compile Include="MonoDevelop.CSharp.Diagnostics\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs" />
+ <Compile Include="MonoDevelop.CSharp.Diagnostics\RemoveUnnecessaryImports\RemoveUnnecessaryImportsDiagnosticAnalyzerBase.cs" />
+ <Compile Include="MonoDevelop.CSharp.Diagnostics\RemoveUnnecessaryImports\CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs" />
+ <Compile Include="MonoDevelop.CSharp.Diagnostics\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs" />
+ <Compile Include="MonoDevelop.CSharp.Diagnostics\SimplifyTypeNames\CSharpSimplifyTypeNamesDiagnosticAnalyzer.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\RemoveUnnecessaryCast\RemoveUnnecessaryCastCodeFixProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\RemoveUnnecessaryCast\RemoveUnnecessaryCastCodeFixProvider.RemoveUnnecessaryCastFixAllProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.Diagnostics\MonoTODO\MonoTODODiagnosticAnalyzer.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeRefactorings\ConvertToEnum\ConvertToEnumDialog.cs" />
+ <Compile Include="MonoDevelop.CSharp.Diagnostics\InconsistentNaming\NameConventionEditRuleDialog.cs" />
+ <Compile Include="MonoDevelop.CSharp.Diagnostics\InconsistentNaming\NameConventionPanel.cs" />
+ <Compile Include="MonoDevelop.CSharp.Diagnostics\InconsistentNaming\NameConventionPanelWidget.cs" />
+ <Compile Include="MonoDevelop.CSharp.Diagnostics\InconsistentNaming\NameConventionPolicy.cs" />
+ <Compile Include="MonoDevelop.CSharp.Diagnostics\InconsistentNaming\NameConventionRule.cs" />
+ <Compile Include="gtk-gui\MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionPanelWidget.cs" />
+ <Compile Include="gtk-gui\MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionEditRuleDialog.cs" />
+ <Compile Include="MonoDevelop.CSharp.Refactoring\CSharpFeaturesTextEditorExtension.cs" />
+ <Compile Include="MonoDevelop.CSharp.Refactoring\RenameHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Refactoring\FindReferencesHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Refactoring\GotoBaseDeclarationHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Refactoring\CodeGenerationService.cs" />
+ <Compile Include="MonoDevelop.CSharp\CSharpBraceMatcher.cs" />
+ <Compile Include="MonoDevelop.CSharp.Refactoring\FindProjectReferenceUsagesHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateFromMembers\GenerateConstructor\AbstractGenerateConstructorService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateFromMembers\GenerateConstructor\CSharpGenerateConstructorService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateFromMembers\GenerateConstructor\GenerateConstructorResult.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateFromMembers\AbstractCodeRefactoringResult.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateFromMembers\AbstractGenerateFromMembersService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateFromMembers\GenerateFromMembersHelpers.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateMember\GenerateConstructor\AbstractGenerateConstructorService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateMember\GenerateConstructor\CSharpGenerateConstructorService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateMember\GenerateConstructor\GenerateConstructorHelpers.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateMember\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateMember\GenerateDefaultConstructors\CSharpGenerateDefaultConstructorsService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateMember\GenerateDefaultConstructors\GenerateDefaultConstructorsResult.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateMember\GenerateEnumMember\AbstractGenerateEnumMemberService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateMember\GenerateEnumMember\CSharpGenerateEnumMemberService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateMember\GenerateParameterizedMember\AbstractGenerateConversionService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateMember\GenerateParameterizedMember\AbstractGenerateMethodService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateMember\GenerateParameterizedMember\CSharpCommonGenerationServiceMethods.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateMember\GenerateParameterizedMember\CSharpGenerateConversionService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateMember\GenerateParameterizedMember\CSharpGenerateMethodService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateMember\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateMember\GenerateParameterizedMember\MethodGenerationKind.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateMember\GenerateVariable\AbstractGenerateVariableService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateMember\GenerateVariable\CSharpGenerateVariableService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateMember\AbstractCodeRefactoringResult.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateMember\AbstractGenerateMemberService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateType\AbstractGenerateTypeService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateType\CSharpGenerateTypeService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateType\GenerateTypeDialogOptions.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateType\GenerateTypeOptionsResult.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GenerateType\TypeKindOptions.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GotoDefinition\GotoDefinitionHelpers.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\GotoDefinition\GotoDefinitionService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ImplementAbstractClass\AbstractImplementAbstractClassService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ImplementAbstractClass\AbstractImplementAbstractClassService.Editor.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ImplementAbstractClass\AbstractImplementAbstractClassService.State.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ImplementAbstractClass\CSharpImplementAbstractClassService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ImplementInterface\AbstractImplementInterfaceService.CodeAction.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ImplementInterface\AbstractImplementInterfaceService.CodeAction_Conflicts.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ImplementInterface\AbstractImplementInterfaceService.CodeAction_Method.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ImplementInterface\AbstractImplementInterfaceService.CodeAction_Property.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ImplementInterface\AbstractImplementInterfaceService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ImplementInterface\AbstractImplementInterfaceService.DisposePatternCodeAction.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ImplementInterface\AbstractImplementInterfaceService.State.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ImplementInterface\CSharpImplementInterfaceService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IndentEngine\CacheIndentEngine.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IndentEngine\CSharpIndentEngine.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IndentEngine\IDocumentIndentEngine.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IndentEngine\IndentState.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IndentEngine\IStateMachineIndentEngine.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IndentEngine\ITextPasteHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IndentEngine\NullIStateMachineIndentEngine.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IndentEngine\TextPasteIndentEngine.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IntroduceVariable\AbstractIntroduceVariableService.AbstractIntroduceVariableCodeAction.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IntroduceVariable\AbstractIntroduceVariableService.CodeAction.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IntroduceVariable\AbstractIntroduceVariableService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IntroduceVariable\AbstractIntroduceVariableService.IntroduceVariableAllOccurrenceCodeAction.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IntroduceVariable\AbstractIntroduceVariableService.State.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IntroduceVariable\AbstractIntroduceVariableService.State_Attribute.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IntroduceVariable\AbstractIntroduceVariableService.State_Block.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IntroduceVariable\AbstractIntroduceVariableService.State_ConstructorInitializer.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IntroduceVariable\AbstractIntroduceVariableService.State_Field.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IntroduceVariable\AbstractIntroduceVariableService.State_Parameter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IntroduceVariable\AbstractIntroduceVariableService.State_Query.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IntroduceVariable\CSharpIntroduceVariableService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IntroduceVariable\CSharpIntroduceVariableService.Rewriter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IntroduceVariable\CSharpIntroduceVariableService_IntroduceField.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IntroduceVariable\CSharpIntroduceVariableService_IntroduceQueryLocal.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\IntroduceVariable\IntroduceVariableResult.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\OrganizeImports\CSharpOrganizeImportsService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\OrganizeImports\CSharpOrganizeImportsService.Rewriter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ParameterHinting\IParameterHintingData.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ParameterHinting\IParameterHintingDataFactory.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ParameterHinting\ParameterHintingEngine.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ParameterHinting\ParameterHintingResult.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ParameterHinting\ParameterUtil.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\RemoveUnnecessaryImports\CSharpRemoveUnnecessaryImportsService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\RemoveUnnecessaryImports\CSharpRemoveUnnecessaryImportsService.Rewriter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\SemanticHighlighting\SemanticHighlightingVisitor.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Formatter\CommonFormattingHelpers.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Formatter\CSharpEditorFormattingService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Formatter\FormattingHelpers.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Formatter\FormattingOptionsFactory.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Formatter\FormattingRangeHelper.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Formatter\Indent.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\CSharp\CSharpExtractMethodService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\CSharp\CSharpMethodExtractor.Analyzer.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\CSharp\CSharpMethodExtractor.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\CSharp\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\CSharp\CSharpMethodExtractor.CSharpCodeGenerator.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\CSharp\CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\CSharp\CSharpMethodExtractor.CSharpCodeGenerator.MultipleStatementsCodeGenerator.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\CSharp\CSharpMethodExtractor.CSharpCodeGenerator.SingleStatementCodeGenerator.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\CSharp\CSharpMethodExtractor.FormattingProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\CSharp\CSharpMethodExtractor.PostProcessor.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\CSharp\CSharpMethodExtractor.TriviaResult.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\CSharp\CSharpSelectionResult.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\CSharp\CSharpSelectionResult.ExpressionResult.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\CSharp\CSharpSelectionResult.StatementResult.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\CSharp\CSharpSelectionValidator.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\CSharp\CSharpSelectionValidator.Validator.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\CSharp\CSharpSyntaxTriviaService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\CSharp\CSharpSyntaxTriviaServiceFactory.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\CSharp\Extensions.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\AbstractExtractMethodService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\AbstractSyntaxTriviaService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\AbstractSyntaxTriviaService.Result.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\Enums.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\Extensions.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\ExtractMethodMatrix.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\ExtractMethodOptions.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\ExtractMethodResult.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\ExtractMethodService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\FailedExtractMethodResult.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\IExtractMethodService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\InsertionPoint.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\ISyntaxTriviaService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\MethodExtractor.Analyzer.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\MethodExtractor.Analyzer.SymbolMapBuilder.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\MethodExtractor.AnalyzerResult.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\MethodExtractor.CodeGenerator.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\MethodExtractor.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\MethodExtractor.GeneratedCode.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\MethodExtractor.TriviaResult.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\MethodExtractor.TypeParameterCollector.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\MethodExtractor.VariableInfo.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\MethodExtractor.VariableSymbol.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\OperationStatus.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\OperationStatus_Statics.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\OperationStatus`1.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\ParameterStyle.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\ReturnStyle.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\SelectionResult.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\SelectionValidator.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\SelectionValidator.NullSelectionResult.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\SimpleExtractMethodResult.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\UniqueNameGenerator.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\ExtractMethod\VariableStyle.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\AttributeNamedParameterContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\AbstractKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\AbstractSyntacticSingleKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\AddKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\AliasKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\AscendingKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\AsKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\AssemblyKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\AsyncKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\AwaitKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\BaseKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\BoolKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\BreakKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ByKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ByteKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\CaseKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\CatchKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\CharKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\CheckedKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ChecksumKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ClassKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ConstKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ContinueKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\DecimalKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\DefaultKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\DefineKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\DelegateKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\DescendingKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\DisableKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\DoKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\DoubleKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\DynamicKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ElifKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ElseKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\EndIfKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\EndRegionKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\EnumKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\EqualsKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ErrorKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\EventKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ExplicitKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ExternKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\FalseKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\FieldKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\FinallyKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\FixedKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\FloatKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ForEachKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ForKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\FromKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\GetKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\GlobalKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\GotoKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\GroupKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\HiddenKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\IfKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ImplicitKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\InKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\InterfaceKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\InternalKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\IntKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\IntoKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\IsKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\JoinKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\LetKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\LineKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\LockKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\LongKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\MethodKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ModuleKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\NameOfKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\NamespaceKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\NewKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\NullKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ObjectKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\OnKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\OperatorKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\OrderByKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\OutKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\OverrideKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ParamKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ParamsKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\PartialKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\PragmaKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\PrivateKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\PropertyKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ProtectedKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\PublicKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ReadOnlyKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ReferenceKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\RefKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\RegionKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\RemoveKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\RestoreKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ReturnKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\SByteKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\SealedKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\SelectKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\SetKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ShortKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\SizeOfKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\StackAllocKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\StaticKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\StringKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\StructKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\SwitchKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ThisKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ThrowKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\TrueKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\TryKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\TypeKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\TypeOfKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\TypeVarKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\UIntKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\ULongKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\UncheckedKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\UndefKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\UnsafeKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\UShortKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\UsingKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\VarKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\VirtualKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\VoidKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\VolatileKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\WarningKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\WhenKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\WhereKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\WhileKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\KeywordRecommender\YieldKeywordRecommender.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\CompletionContext.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\CompletionEngine.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\CompletionResult.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\CompletionTriggerInfo.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\CompletionTriggerReason.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\EditorBrowsableBehavior.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ICompletionDataFactory.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\CastCompletionContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\CompletionContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\DelegateCreationContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\EnumMemberContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\ExplicitInterfaceContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\ExternAliasContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\FormatItemContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\KeywordContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\NamedParameterContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\ObjectCreationContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\ObjectInitializerContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\OverrideContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\PartialContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\PreProcessorExpressionContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\RoslynRecommendationsCompletionContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\SenderCompletionContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\SnippetContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\SpeculativeNameContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\SpeculativeTContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\XmlDocCommentContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp\DeclaredSymbolInfo.cs" />
+ <Compile Include="MonoDevelop.CSharp\ProjectSearchCategory.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\CodeGeneration\CodeGenerationDestination.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\CodeGeneration\CodeGenerationHelpers.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\CodeGeneration\CodeGenerationOptions.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\CodeGeneration\CodeGenerationTypeParameterSymbol.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\CodeGeneration\CodeGenerator.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\CodeGeneration\CSharpCodeGenerationService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\CodeGeneration\SyntaxAnnotationExtensions.cs" />
+ <Compile Include="Util\7BitEncodedInts.cs" />
+ <Compile Include="Util\AnnotationTable.cs" />
+ <Compile Include="Util\ArgumentSyntaxExtensions.cs" />
+ <Compile Include="Util\CastExpressionSyntaxExtensions.cs" />
+ <Compile Include="Util\CloneableStack.cs" />
+ <Compile Include="Util\CodeFixContextExtensions.cs" />
+ <Compile Include="Util\CodeGenerationSymbolFactory.cs" />
+ <Compile Include="Util\CodeRefactoringContextExtensions.cs" />
+ <Compile Include="Util\CommonAccessibilityUtilities.cs" />
+ <Compile Include="Util\CommonLocationExtensions.cs" />
+ <Compile Include="Util\CommonSyntaxNodeOrTokenExtensions.cs" />
+ <Compile Include="Util\CompilationExtensions.cs" />
+ <Compile Include="Util\CompilationUnitSyntaxExtensions.cs" />
+ <Compile Include="Util\CrefSyntaxExtensions.cs" />
+ <Compile Include="Util\CSharpSemanticFactsService.cs" />
+ <Compile Include="Util\CSharpSyntaxContext.cs" />
+ <Compile Include="Util\CSharpSyntaxFactsService.cs" />
+ <Compile Include="Util\CSharpUtil.cs" />
+ <Compile Include="Util\DocumentExtensions.cs" />
+ <Compile Include="Util\EnumerableExtensions.cs" />
+ <Compile Include="Util\EnumValueUtilities.cs" />
+ <Compile Include="Util\ExpressionSyntaxExtensions.cs" />
+ <Compile Include="Util\FastSerializer.cs" />
+ <Compile Include="Util\FindTokenHelper.cs" />
+ <Compile Include="Util\FormatStringHelper.cs" />
+ <Compile Include="Util\GeneratedCodeRecognitionService.cs" />
+ <Compile Include="Util\Hash.cs" />
+ <Compile Include="Util\HelpLink.cs" />
+ <Compile Include="Util\IAssemblySymbolExtensions.cs" />
+ <Compile Include="Util\ICodeDefinitionFactoryExtensions.cs" />
+ <Compile Include="Util\ICompilationExtensions.cs" />
+ <Compile Include="Util\IDictionaryExtensions.cs" />
+ <Compile Include="Util\IDocumentExtensions.cs" />
+ <Compile Include="Util\IMethodSymbolExtensions.cs" />
+ <Compile Include="Util\ImmutableArrayExtensions.cs" />
+ <Compile Include="Util\INamedTypeSymbolExtensions.cs" />
+ <Compile Include="Util\INamespaceOrTypeSymbolExtensions.cs" />
+ <Compile Include="Util\IParameterSymbolExtensions.cs" />
+ <Compile Include="Util\IPropertySymbolExtensions.cs" />
+ <Compile Include="Util\ISymbolExtensions.cs" />
+ <Compile Include="Util\ITypeParameterSymbolExtensions.cs" />
+ <Compile Include="Util\ITypeSymbolExtensions.cs" />
+ <Compile Include="Util\LinkedListExtension.cs" />
+ <Compile Include="Util\Matcher.cs" />
+ <Compile Include="Util\MemberDeclarationSyntaxExtensions.cs" />
+ <Compile Include="Util\NameGenerator.cs" />
+ <Compile Include="Util\NamespaceDeclarationSyntaxExtensions.cs" />
+ <Compile Include="Util\NameSyntaxComparer.cs" />
+ <Compile Include="Util\NameSyntaxExtensions.cs" />
+ <Compile Include="Util\NRefactory6Host.cs" />
+ <Compile Include="Util\ObjectExtensions.cs" />
+ <Compile Include="Util\PredefinedOperator.cs" />
+ <Compile Include="Util\QueryExpressionSyntaxExtensions.cs" />
+ <Compile Include="Util\RefactoringHelpers.cs" />
+ <Compile Include="Util\ReferenceComparer.cs" />
+ <Compile Include="Util\ReflectionCompatibilityExtensions.cs" />
+ <Compile Include="Util\SemanticDocument.cs" />
+ <Compile Include="Util\SemanticEquivalence.cs" />
+ <Compile Include="Util\SemanticMap.cs" />
+ <Compile Include="Util\SemanticModelExtensions.cs" />
+ <Compile Include="Util\SignatureComparer.cs" />
+ <Compile Include="Util\SimpleNameSyntaxExtensions.cs" />
+ <Compile Include="Util\SourceTextExtensions.cs" />
+ <Compile Include="Util\SpecializedCollections.cs" />
+ <Compile Include="Util\SpeculationAnalyzer.cs" />
+ <Compile Include="Util\StringExtensions.cs" />
+ <Compile Include="Util\StringPclExtensions.cs" />
+ <Compile Include="Util\SymbolEquivalenceComparer.cs" />
+ <Compile Include="Util\SymbolExtensions.cs" />
+ <Compile Include="Util\SymbolInfoExtensions.cs" />
+ <Compile Include="Util\SymbolKeyExtensions.cs" />
+ <Compile Include="Util\SymbolKeyResolutionExtensions.cs" />
+ <Compile Include="Util\SyntacticDocument.cs" />
+ <Compile Include="Util\SyntaxContext.cs" />
+ <Compile Include="Util\SyntaxExtensions.cs" />
+ <Compile Include="Util\SyntaxKindSet.cs" />
+ <Compile Include="Util\SyntaxListExtension.cs" />
+ <Compile Include="Util\SyntaxNodeExtensions.cs" />
+ <Compile Include="Util\SyntaxTokenExtensions.cs" />
+ <Compile Include="Util\SyntaxTreeExtensions.cs" />
+ <Compile Include="Util\SyntaxTriviaExtensions.cs" />
+ <Compile Include="Util\SyntaxTriviaListExtensions.cs" />
+ <Compile Include="Util\TaskExtensions.cs" />
+ <Compile Include="Util\TextLineExtension.cs" />
+ <Compile Include="Util\TokenComparer.cs" />
+ <Compile Include="Util\TypeDeclarationSyntaxExtensions.cs" />
+ <Compile Include="Util\TypeExtensions.cs" />
+ <Compile Include="Util\TypeGenerator.cs" />
+ <Compile Include="Util\TypeSyntaxComparer.cs" />
+ <Compile Include="Util\TypeSyntaxExtensions.cs" />
+ <Compile Include="Util\UsingsAndExternAliasesDirectiveComparer.cs" />
+ <Compile Include="Util\UsingsAndExternAliasesOrganizer.cs" />
+ <Compile Include="Util\ValueTuple.cs" />
+ <Compile Include="Util\ValueTuple`2.cs" />
+ <Compile Include="Util\WordParser.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeRefactorings\CodeRefactoring.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeRefactorings\CSharpSyntaxContext.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeRefactorings\TypeGuessing.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeRefactorings\Resources.cs" />
+ <Compile Include="MonoDevelop.CSharp\CSharpNavigationTextEditorExtension.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\EncapsulateField\AbstractEncapsulateFieldRefactoringProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\EncapsulateField\AbstractEncapsulateFieldService.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\EncapsulateField\EncapsulateFieldCodeAction.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\EncapsulateField\EncapsulateFieldResult.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\EncapsulateField\EncapsulateFieldCodeRefactoringProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeFixes\EncapsulateField\AbstractEncapsulateFieldRefactoringProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\EncapsulateField\CSharpEncapsulateFieldService.cs" />
+ <Compile Include="Util\ConflictResolver.cs" />
+ <Compile Include="Util\AccessibilityUtilities.cs" />
+ <Compile Include="Util\Glyph.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\Completion\ContextHandler\RegexContextHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Refactoring\CSharpFindReferencesProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.Refactoring\CSharpJumpToDeclarationHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.UnitTests\CSharpNUnitSourceCodeLocationFinder.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\AutoInsertBracket\CSharpAutoInsertBracketHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\AutoInsertBracket\AbstractTokenBraceCompletionSession.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\AutoInsertBracket\Sessions\BracketCompletionSession.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\AutoInsertBracket\Sessions\CharLiteralCompletionSession.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\AutoInsertBracket\Sessions\CurlyBraceCompletionSession.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\AutoInsertBracket\Sessions\InterpolatedStringCompletionSession.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\AutoInsertBracket\Sessions\LessAndGreaterThanCompletionSession.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\AutoInsertBracket\Sessions\ParenthesisCompletionSession.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\AutoInsertBracket\Sessions\StringLiteralCompletionSession.cs" />
+ <Compile Include="MonoDevelop.CSharp.Features\AutoInsertBracket\Sessions\InterpolationCompletionSession.cs" />
+ <Compile Include="MonoDevelop.CSharp.Highlighting\KeywordHighlighters\AbstractAsyncHighlighter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Highlighting\KeywordHighlighters\AsyncAnonymousMethodHighlighter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Highlighting\KeywordHighlighters\AsyncMethodHighlighter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Highlighting\KeywordHighlighters\AsyncParenthesizedLambdaHighlighter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Highlighting\KeywordHighlighters\AsyncSimpleLambdaHighlighter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Highlighting\KeywordHighlighters\AwaitHighlighter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Highlighting\KeywordHighlighters\CheckedExpressionHighlighter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Highlighting\KeywordHighlighters\CheckedStatementHighlighter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Highlighting\KeywordHighlighters\ConditionalPreprocessorHighlighter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Highlighting\KeywordHighlighters\IfStatementHighlighter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Highlighting\KeywordHighlighters\LockStatementHighlighter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Highlighting\KeywordHighlighters\LoopHighlighter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Highlighting\KeywordHighlighters\RegionHighlighter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Highlighting\KeywordHighlighters\ReturnStatementHighlighter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Highlighting\KeywordHighlighters\SwitchStatementHighlighter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Highlighting\KeywordHighlighters\TryStatementHighlighter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Highlighting\KeywordHighlighters\UnsafeStatementHighlighter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Highlighting\KeywordHighlighters\UsingStatementHighlighter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Highlighting\KeywordHighlighters\YieldStatementHighlighter.cs" />
+ <Compile Include="MonoDevelop.CSharp.Highlighting\AbstractKeywordHighlighter.cs" />
+ <Compile Include="Util\DirectiveSyntaxExtensions.cs" />
+ <Compile Include="MonoDevelop.CSharp.Refactoring\OrganizeImportsCommandHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.CodeRefactorings\UsingRefactorings\SortImportsCodeRefactoringProvider.cs" />
+ <Compile Include="MonoDevelop.CSharp.Navigation\FindMemberOverloadsHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Navigation\FindExtensionMethodsHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Navigation\FindDerivedSymbolsHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Navigation\FindBaseSymbolsHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Navigation\FindImplementingMembersHandler.cs" />
+ <Compile Include="MonoDevelop.CSharp.Refactoring\ConstructFixer.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Makefile.am" />
+ <None Include="MonoDevelop.CSharp.Completion\MethodParameterDataProvider.cs" />
+ <None Include="MonoDevelop.CSharp.Completion\ConstructorParameterDataProvider.cs" />
+ <None Include="MonoDevelop.CSharp.Completion\ArrayTypeParameterDataProvider.cs" />
+ <None Include="MonoDevelop.CSharp.Completion\AbstractParameterDataProvider.cs" />
+ <None Include="MonoDevelop.CSharp.CodeRefactorings\ConvertToEnum\ConvertToEnumCodeRefactoringProvider.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
@@ -329,13 +850,42 @@
<Folder Include="MonoDevelop.CSharp.Completion\" />
<Folder Include="MonoDevelop.CSharp.CodeGeneration\" />
<Folder Include="MonoDevelop.CSharp.Formatting\policies\" />
- <Folder Include="MonoDevelop.CSharp.Refactoring.CodeActions\" />
- <Folder Include="MonoDevelop.CSharp.Refactoring.CodeActions\Actions\" />
- <Folder Include="MonoDevelop.CSharp.Refactoring.CodeIssues\" />
- <Folder Include="MonoDevelop.CSharp.Refactoring.CodeIssues\NamingInspection\" />
<Folder Include="MonoDevelop.CSharp.Tooltips\" />
<Folder Include="MonoDevelop.CSharp.UnitTests\" />
- <Folder Include="MonoDevelop.CSharp.Refactoring.CodeIssues\Issues\" />
<Folder Include="icons\" />
+ <Folder Include="MonoDevelop.CSharp.ClassOutline\" />
+ <Folder Include="MonoDevelop.CSharp.NRefactoryWrapper\" />
+ <Folder Include="MonoDevelop.JSon\" />
+ <Folder Include="MonoDevelop.CSharp.CodeFixes\" />
+ <Folder Include="MonoDevelop.CSharp.CodeFixes\AddImport\" />
+ <Folder Include="MonoDevelop.CSharp.CodeFixes\FullyQualify\" />
+ <Folder Include="MonoDevelop.CSharp.CodeFixes\Async\" />
+ <Folder Include="MonoDevelop.CSharp.CodeFixes\MoveTypeToFile\" />
+ <Folder Include="MonoDevelop.CSharp.CodeFixes\GenerateConstructor\" />
+ <Folder Include="MonoDevelop.CSharp.CodeFixes\GenerateEnumMember\" />
+ <Folder Include="MonoDevelop.CSharp.CodeFixes\GenerateMethod\" />
+ <Folder Include="MonoDevelop.CSharp.CodeFixes\GenerateVariable\" />
+ <Folder Include="MonoDevelop.CSharp.CodeFixes\ImplementAbstractClass\" />
+ <Folder Include="MonoDevelop.CSharp.CodeFixes\ImplementInterface\" />
+ <Folder Include="MonoDevelop.CSharp.CodeRefactorings\" />
+ <Folder Include="MonoDevelop.CSharp.CodeRefactorings\IntroduceVariable\" />
+ <Folder Include="MonoDevelop.CSharp.CodeRefactorings\InlineTemporary\" />
+ <Folder Include="MonoDevelop.CSharp.CodeRefactorings\ExtractMethod\" />
+ <Folder Include="MonoDevelop.CSharp.CodeFixes\GenerateType\" />
+ <Folder Include="MonoDevelop.CSharp.Diagnostics\" />
+ <Folder Include="MonoDevelop.CSharp.CodeFixes\SimplifyTypeNames\" />
+ <Folder Include="MonoDevelop.CSharp.CodeFixes\RemoveUnnecessaryUsings\" />
+ <Folder Include="MonoDevelop.CSharp.Diagnostics\RemoveUnnecessaryCast\" />
+ <Folder Include="MonoDevelop.CSharp.Diagnostics\RemoveUnnecessaryImports\" />
+ <Folder Include="MonoDevelop.CSharp.Diagnostics\SimplifyTypeNames\" />
+ <Folder Include="MonoDevelop.CSharp.CodeFixes\RemoveUnnecessaryCast\" />
+ <Folder Include="MonoDevelop.CSharp.Diagnostics\MonoTODO\" />
+ <Folder Include="MonoDevelop.CSharp.CodeRefactorings\ConvertToEnum\" />
+ <Folder Include="MonoDevelop.CSharp.CodeFixes\EncapsulateField\" />
+ <Folder Include="MonoDevelop.CSharp.Features\AutoInsertBracket\" />
+ <Folder Include="MonoDevelop.CSharp.Features\AutoInsertBracket\Sessions\" />
+ <Folder Include="MonoDevelop.CSharp.Highlighting\KeywordHighlighters\" />
+ <Folder Include="MonoDevelop.CSharp.CodeRefactorings\UsingRefactorings\" />
+ <Folder Include="MonoDevelop.CSharp.Navigation\" />
</ItemGroup>
</Project>
diff --git a/main/src/addins/CSharpBinding/ChangeLog b/main/src/addins/CSharpBinding/ChangeLog
deleted file mode 100644
index 348d98119a..0000000000
--- a/main/src/addins/CSharpBinding/ChangeLog
+++ /dev/null
@@ -1,8899 +0,0 @@
-2010-07-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs: Used
- fast text search.
-
-2010-07-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Fixed 'Bug 625064 - Internal classes aren't suggested for
- completion'.
-
-2010-07-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- fixed highlight usages extension.
-
-2010-07-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NewCSharpExpressionFinder.cs:
- * MonoDevelop.CSharp.Resolver/TextEditorResolverProvider.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- No longer transform the editor contents to text when using
- the expression finder - the expression finder now uses the
- text editor directly.
-
-2010-07-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs: Added
- check for #else span.
-
-2010-07-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs:
- * MonoDevelop.CSharp.Refactoring/CSharpRefactorer.cs:
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- Worked on text edior performance issues / needed to
- restructure the resolver/member reference collector a bit.
-
-2010-07-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/NRefactoryParser.cs: Don't parse
- method bodies for the MonoDevelop dom (skipping these is
- much faster & more memory efficient).
-
-2010-07-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs: Track
- API changes.
-
-2010-07-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/CSharpParser.cs: Updated to new
- mcs.
-
-2010-07-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs: Fixed
- 'Bug 623308 - ArgumentOutOfRangeException after typing ( for
- method params'.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/NRefactoryParser.cs:
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs:
- * MonoDevelop.CSharp.Highlighting/MoveToUsagesHandler.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- Track API changes.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/NRefactoryParser.cs:
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs:
- * MonoDevelop.CSharp.Resolver/NewCSharpExpressionFinder.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- * MonoDevelop.CSharp.Completion/NRefactoryParameterDataProvider.cs:
- * MonoDevelop.CSharp.Completion/NRefactoryIndexerParameterDataProvider.cs:
- * MonoDevelop.CSharp.Completion/NRefactoryTemplateParameterDataProvider.cs:
- Track API changes.
-
-2010-07-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs: Track
- API changes.
-
-2010-07-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs:
- * MonoDevelop.CSharp.Resolver/TextEditorResolverProvider.cs:
- Track API changes.
-
-2010-07-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- * MonoDevelop.CSharp.Completion/NRefactoryParameterDataProvider.cs:
- * MonoDevelop.CSharp.Completion/NRefactoryIndexerParameterDataProvider.cs:
- * MonoDevelop.CSharp.Completion/NRefactoryTemplateParameterDataProvider.cs:
- Worked on 'Bug 621658 - Parameter hints disappear
- afterkeystroke'.
-
-2010-07-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * CSharpBinding.addin.xml:
- * MonoDevelop.CSharp.Parser/NRefactoryParser.cs:
- * MonoDevelop.CSharp.Resolver/TextEditorResolverProvider.cs:
- Track ProjectDomService/Parser API.
-
-2010-07-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Dom/CSharpAmbience.cs:
- * MonoDevelop.CSharp.Resolver/TextEditorResolverProvider.cs:
- * MonoDevelop.CSharp.Completion/NRefactoryParameterDataProvider.cs:
- Enhanced support for keyword like names.
-
-2010-07-08 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Completion/DropDownBoxListWindow.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- * MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs:
- Worked on version control gui.
-
-2010-07-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpIndentEngineStack.cs:
- added bounds check
-
-2010-07-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpIndentEngineStack.cs:
- added bounds check
-
-2010-07-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpIndentEngineStack.cs:
- Indenting should now reflect the mono style.
-
-2010-07-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpIndentEngineStack.cs:
- Indenting should now reflect the mono style.
-
-2010-07-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Worked on region box.
-
-2010-07-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Region combo is now separated from the rest of the path.
-
-2010-07-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs: Fixed 'Bug
- 615992 - Intellisense broken when calling generic method.'.
-
-2010-07-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Fixed 'Bug 619799 - Renaming variable also invokes
- auto-complete'.
-
-2010-07-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Dom/CSharpAmbience.cs:
- * MonoDevelop.CSharp.Completion/DropDownBoxListWindow.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Worked on quick navigation bar
-
-2010-07-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Improved handling of inner classes.
-
-2010-07-02 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Completion/DropDownBoxListWindow.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- C# editor extension now uses the IPathedDocument subsystem.
-
-2010-07-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Fixed 'Bug 618676 - C# code editor removes "override" word
- after choosing one of intellisense variants'.
-
-2010-06-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/CSharpParser.cs: Added support for
- fixed fields & constants.
-
-2010-06-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/CSharpParser.cs: Fields are now
- working.
-
-2010-06-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Submitted patch from Tom Spink <tspink@gmail.com>: Update to
- generic code completion
-
-2010-06-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs: fixed
- bug in abstract member overriding.
-
-2010-06-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/TextEditorResolverProvider.cs:
- Added bounds check.
-
-2010-06-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- Only update changed lines.
-
-2010-06-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/TextEditorResolverProvider.cs:
- Fixed 'Bug 615988 - Go to declaration not available on
- generic methods'.
-
-2010-06-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- Fixed 'Bug 615983 - Refactoring does not include object
- initializers'.
-
-2010-06-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Formatting/DomIndentationVisitor.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/DestructorDeclaration.cs:
- Worked on C# parser.
-
-2010-06-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/CSharpParser.cs: Updated parser to
- Marek's new LocationsBag/latest mcs changes.
-
-2010-06-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.xml:
- Removed 'DoNotChange' option - will be availble with the
- next gen formatter (fixes Bug 615763 - C# code formatting
- throws exception when choosing "Do not change" from menu).
-
-2010-06-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- Fixed 'Bug 615702 - In-place variable renaming can't rename
- foreach loop variables'.
-
-2010-06-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Formatting/DomIndentationVisitor.cs:
- Worked on new parser/formatter.
-
-2010-06-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- * MonoDevelop.CSharp.Completion/NRefactoryParameterDataProvider.cs:
- Fixed 'Bug 615182 - Tooltip sometimes stays up too long'.
-
-2010-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.cs:
- Remove debug writelines.
-
-2010-06-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Optimized performance.
-
-2010-06-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- Respect UTF-8 coordinates in highlight usages extension.
-
-2010-06-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Fixed unit test.
-
-2010-06-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Fixed 'Bug 614045 - Types hidden by members are not
- formatted properly by ambience'.
-
-2010-06-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CSharp/CSharpBindingCompilerManager.cs: Track
- api changes.
-
-2010-06-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- update line when removing marker.
-
-2010-06-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- Fix build.
-
-2010-06-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CSharp.Completion/NewOverrideCompletionData.cs:
- Track API. Fix region offset.
-
- * MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs: Track
- API. Include both body regions for properties.
-
-2010-06-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs: Track
- API. Emit regions for members.
-
- * MonoDevelop.CSharp.Completion/NewOverrideCompletionData.cs:
- Use body regions to select body or place caret, and to
- remove generated body when GenerateBody is false.
-
-2010-06-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs: Fix
- property getter in overrides.
-
-2010-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/ConsoleProject.xpt.xml: Set the external console
- flag for console projects.
-
-2010-06-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs: Track
- API changes.
-
-2010-06-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs:
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs:
- * MonoDevelop.CSharp.Completion/NewOverrideCompletionData.cs:
- Fixed LINQ resolve error.
-
-2010-06-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Dom/CSharpAmbience.cs: handled other case
- of unresolveable types.
-
-2010-06-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Dom/CSharpAmbience.cs: make it clearer
- that the type can't be resolved.
-
-2010-06-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Dom/CSharpAmbience.cs:
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs: Handled
- unresolved return types
-
-2010-06-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs:
- Corrected base call.
-
-2010-06-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs:
- Corrected type name output.
-
-2010-06-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs:
- Removed some code duplication.
-
-2010-06-02 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Refactoring/CodeGenerator.cs:
- * MonoDevelop.CSharp.Refactoring/CSharpRefactorer.cs:
- * MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs:
- * MonoDevelop.CSharp.Completion/NewOverrideCompletionData.cs:
- Code generator get's now used by code completion auto
- generation & insert code feature.
-
-2010-06-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs:
- Worked on code generation.
-
-2010-06-01 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * CSharpBinding.addin.xml:
- * MonoDevelop.CSharp.Refactoring/CodeGenerator.cs:
- * MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs:
- Worked on c# code generation.
-
-2010-06-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs: Fixed
- 'Bug 610241 - #elif Coloring Messed'.
-
-2010-05-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/MoveToUsagesHandler.cs:
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- Worked on highight usage extensions & Bug 610048 - Sometimes
- symbol highlight is not cleared.
-
-2010-05-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Handled multiple type overloads.
-
-2010-05-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Fixed 'Bug 610011 - Extension methods incorrectly trump real
- members'.
-
-2010-05-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs: Fixed 'Bug
- 610006 - Intellisense gives members of return type of
- functions even when that function isn't invoked'.
-
-2010-05-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NewCSharpExpressionFinder.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Fixed 'Bug 609999 - Intellisense confuses Array initializers
- with object initializers'.
-
-
-2010-05-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp/CSharpBindingCompilerManager.cs: Fixed
- 'Bug 608910 - Getting a "File not found" exception in
- monodevelop that doesn't allow me to build :('.
-
-2010-05-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NewCSharpExpressionFinder.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Fixed 'Bug 609528 - No Intellisense for LINQ join'.
-
-2010-05-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Dom/CSharpAmbience.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Fixed 'Bug 600624 - Property initializer completion
- unreliable'.
-
-2010-05-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- Track API changes.
-
-2010-05-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Dom/CSharpAmbience.cs: UseFullName flag
- works now for members.
-
-2010-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs: Fix grammar.
-
-2010-05-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Fixed local lookup for ASP.NET.
-
-2010-05-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- Disabled paste formatting (Bug 606041 - Additional blank
- line after every text line then text is pasted from
- clipboard).
-
-2010-05-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- Fixed 'Bug 606884 - Control-enter in doc comments doesn't
- prefix the new line'.
-
-2010-05-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/MemberCompletionData.cs: Fixed
- 'Bug 606959 - switch case completion doesn't handle
- namespaces properly'.
-
-2010-05-20 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Completion/CompletionTextLinkMode.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- * MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs:
- Implemented request in 'Bug 607366 - Text link mode can
- break texteditor badly'.
-
-2010-05-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- Improved semicolon auto placement.
-
-2010-05-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NewCSharpExpressionFinder.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Fixed 'Bug 534680 - LINQ keywords missing from
- Intellisense'.
-
-2010-05-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Dom/CSharpAmbience.cs: Fixed 'Bug 606506
- - Types of fields are not shown'
-
-2010-05-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- * MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs:
- Fixed 'Bug 606212 - Allow delegate renaming straight after
- creation'.
-
-2010-05-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Implemented 'Bug 606227 - Search reodering not available for
- "override" completions.'.
-
-
-2010-05-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- Unsubscribe editor events.
-
-2010-05-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- catch exception in highighit usages extension.
-
-2010-05-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- Fixed 'Bug 606217 - Auto-placed semi-colon doesn't take
- account of comments'
-
-2010-05-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Fixed 'Bug 606048 - Parameter insight re-shows on every
- newline even when disabled'.
-
-2010-05-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs: Fixed 'Bug
- 605235 - Inaccessible functions do not show "Goto
- Declaration" in context menu'.
-
-2010-05-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Fixed 'Bug 604593 - Autocomplete list sorting wrong when
- grouping by class.'.
-
-2010-05-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/NRefactoryParameterDataProvider.cs:
- fixed 'Bug 605134 - NRE when using (an abstract class ctor?)
- MulticastDelegate ctor'.
-
-2010-05-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- Added some bounds checking.
-
-2010-05-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/MemberCompletionData.cs: Set
- obsolete flag for obsolete members.
-
-2010-05-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/MoveToUsagesHandler.cs:
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- Implemented 'Bug 605009 - Control-shift-up/down do not work
- until highlight triggers'.
-
-2010-05-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- Fixed 'Bug 605008 - Weird symbol highlighting'.
-
-2010-05-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- set text editor for the resolver.
-
-2010-05-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs:
- * MonoDevelop.CSharp.Completion/MemberCompletionData.cs:
- * MonoDevelop.CSharp.Completion/NewOverrideCompletionData.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- * MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs:
- Track API changes.
-
-2010-05-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpFormatter.cs:
- * MonoDevelop.CSharp.Dom/Expressions/QueryExpression.cs: Fixed
- compile warnings.
-
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- Optimized highlight usages extension & find member visitor.
-
-2010-05-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/HighlightCSharpSemanticRule.cs:
- Fixed 'Bug 604558 - Wrong code syntax highlighting when
- previous line have a comment'.
-
-2010-05-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- Fixed 'Bug 603971 - Symbol highlight combined with search
- highlight looks ugly'.
-
-2010-05-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Fixed 'Bug 603733 - Pressing '!' with the autocomplete
- window open breaks'.
-
-2010-05-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- speed up the findmemberastvisitor.
-
-2010-05-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- Only re-indent if there is need.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- Make use of the new Document.Dom property.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- * MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs:
- Fixed 'Bug 603282 - Autogenerated method name is invalid'.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- fixed 'Bug 603344 - Matching in completion list'.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- fixed find member references for local variables.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs: Fixed
- local variable off by 1 error.
-
-2010-05-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * CSharpBinding.addin.xml:
- * templates/GladeSharp2Project.xpt.xml:
- * templates/GnomeSharp2Project.xpt.xml:
- * templates/GtkSharp2ProjectMac.xpt.xml: Remove deprecated
- Gnome# and Glade# project types, and add a Mac-specific GTK
- template that doesn't use Stetic.
-
-2010-05-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/MemberCompletionData.cs: Fixed
- 'Bug 596609 - Parameters tooltips not escaping generics in
- markup'.
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NewCSharpExpressionFinder.cs:
- Dispose the lexer after use.
-
-2010-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoCSharpPolicy.xml: Added attribute to explicitly allow
- differential serialization for a policy (which is disabled
- by default).
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * CSharpBinding.addin.xml: Set mac shortcut.
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * CSharpBinding.addin.xml:
- * MonoDevelop.CSharp.Highlighting/MoveToUsagesHandler.cs:
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- Fixed 'Bug 601436 - Command to cycle through highlighted
- references'.
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs: Fixed 'Bug
- 601350 - Null ref in highlighting/tooltips'.
-
-2010-04-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- Fixed 'Bug 600994 - Method highlight should match all
- methods of the generic class'.
-
-2010-04-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpFormatter.cs:
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- Fixed 'Bug 601028 - Move line reindenting flattens indents'.
-
-2010-04-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- Fixed 'Bug 601007 - Error in highlight usages extension.'.
-
-2010-04-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- fixed 'Bug 601021 - Identifier highlighting assumes
- constructors but draws box incorrectly'.
-
-2010-04-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs: fixed
- 'Bug 601169 - IntelliSense ignores inner classes'.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/MemberCompletionData.cs:
- * MonoDevelop.CSharp.Completion/NewOverrideCompletionData.cs:
- fixed 'Bug 600617 - Generic params in override completion
- are doubly escaped'.
-
-2010-04-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CSharp.Formatting\CSharpFormatter.cs: Use the
- correct EOL marker.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/MemberCompletionData.cs: Track
- API changes.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- fixed 'Bug 600273 - as/is completion too restrictive'.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- fixed 'Bug 599632 – Completion list should be in suggest
- mode for generic parameter declaration'.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/CodeGenerator.cs: Fixed 'Bug
- 599627 - Implement implicit interface generated wrong code'.
-
-2010-04-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs: fixed
- code completion issue.
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * templates/GladeSharp2Project.xpt.xml:
- * templates/GnomeSharp2Project.xpt.xml: Fixed some templates.
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- Fixed 'Bug 598831 - Symbol highlight should not activate
- while there is a selection'.
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- Fixed 'Bug 598822 - Symbol highlight has wrong position with
- qualified names'.
-
-2010-04-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- Fixed possible null reference.
-
-2010-04-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/CSharpNRefactoryASTProvider.cs:
- Fixed 'Bug 598563 - NRE right-clicking on symbol in
- standalone file'.
-
-2010-04-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Worked on ASP.NET completion.
-
-2010-04-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- Raised highlight usages delay.
-
-2010-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Fixed 'Bug 597671 - The += completion does not handle inner
- class eventargs properly'.
-
-2010-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Patch applied from Tom Spink <tspink@gmail.com>: Where
- Constraint Completion
-
-2010-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- Fixed 'Bug 597717 - Incorrect indentation using smart
- indent'.
-
-2010-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- Fixed 'Bug 597663 - Symbol highlight hides and re-shows at
- end of word'.
-
-2010-04-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs: Added
- null check.
-
-2010-04-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/NRefactoryParser.cs:
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- Optimized HighlightUsagesExtension (no additional re-parse).
-
-2010-04-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpFormatter.cs:
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs: Fixed
- code completion bug.
-
-2010-04-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs: fixed
- possible null ref.
-
-2010-04-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- Implemented 'Bug 595598 - Intelligent placing of
- semi-colons'.
-
-
-2010-04-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpFormatter.cs:
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- Implemented 'Bug 595587 - Move code block to correct depth
- when Alt+arrow moving'.
-
-2010-04-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- Fixed 'Bug 595606 - Refactoring (renaming) can alter
- unrelated classes'.
-
-2010-04-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- de-activated usage highlighting in text link mode.
-
-2010-04-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- Made usage highlighter more robust.
-
-2010-04-12 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * CSharpBinding.addin.xml:
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- * MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs:
- * MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs:
- Implemented 'Bug 595230 - Highlight all usages of symbol
- under cursor'.
-
-2010-04-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/NewOverrideCompletionData.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Implemented 'Bug 595198 - Override completion should select
- body so it can be deleted'.
-
-2010-04-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Fix NRE when opening a file with no open project.
-
-2010-04-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs:
- * MonoDevelop.CSharp.Resolver/TextEditorResolverProvider.cs:
- Fixed 'Bug 578195 - Wrong ctor shown on base() call'.
-
-2010-04-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpIndentEngine.cs: Fixed
- 'Bug 415469 - return ternary in a switch is not tabbed
- properly'.
-
-2010-04-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/CSharpNRefactoryASTProvider.cs:
- Added a 'last errors' property.
-
-2010-04-08 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * CSharpBinding.csproj:
- * CSharpBinding.addin.xml:
- * MonoDevelop.CSharp.Formatting/FormattingPanel.cs:
- * MonoDevelop.CSharp.Formatting/CSharpIndentEngine.cs:
- * MonoDevelop.CSharp.Formatting/CSharpIndentEngineStack.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormattingProperties.cs:
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- * gtk-gui/MonoDevelop.CSharp.Formatting.FormattingPanelWidget.cs:
- * MonoDevelop.CSharp.Completion/NRefactoryParameterDataProvider.cs:
- Fixed 'Bug 579358 - Smart indenter does not use policies,
- separate prefs confusing'.
-
-2010-04-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs: Fixed
- 'Bug 576354 - Type inference failure'.
-
-2010-04-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/OnTheFlyFormatter.cs:
- * MonoDevelop.CSharp.Formatting/DomIndentationVisitor.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.xml:
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- Added option for 'Bug 593635 - Auto-formatting doesn't allow
- single-line if statements'.
-
-2010-04-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpFormatter.cs: fixed
- possible null ref.
-
-2010-04-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs: Fixed 'Bug
- 592120 - Type resolver bug with this.Property[]'.
-
-2010-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CSharp\CSharpBindingCompilerManager.cs: On
- windows, make sure the compiler output is written and read
- using utf8.
-
-2010-03-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- handled cast exception.
-
-2010-03-24 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Formatting/DomSpacingVisitor.cs:
- * MonoDevelop.CSharp.Formatting/OnTheFlyFormatter.cs:
- * MonoDevelop.CSharp.Formatting/DomIndentationVisitor.cs:
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- Worked on new formatter.
-
-2010-03-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Dom/TypeMembers/AbstractMember.cs:
- * MonoDevelop.CSharp.Dom/Expressions/CastExpression.cs:
- * MonoDevelop.CSharp.Dom/Statements/ForeachStatement.cs:
- * MonoDevelop.CSharp.Dom/Expressions/QueryExpression.cs:
- * MonoDevelop.CSharp.Dom/Statements/TryCatchStatement.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/DelegateDeclaration.cs:
- * MonoDevelop.CSharp.Dom/Expressions/ObjectCreateExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/MemberReferenceExpression.cs:
- * MonoDevelop.CSharp.Dom/Statements/VariableDeclarationStatement.cs:
- Changed return type properties.
-
-2010-03-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Dom/Expressions/QueryExpression.cs:
- Worked on LINQ expressions.
-
-2010-03-23 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Dom/FullTypeName.cs:
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Dom/ICSharpDomVisitor.cs:
- * MonoDevelop.CSharp.Dom/AbtractCSharpDomVisitor.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/Constraint.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/TypeDeclaration.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/MethodDeclaration.cs:
- * MonoDevelop.CSharp.Dom/Expressions/IdentifierExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/MemberReferenceExpression.cs:
- Handled templates & constraints.
-
-2010-03-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/TextEditorResolverProvider.cs:
- Removed duplicate section.
-
-2010-03-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/TextEditorResolverProvider.cs:
- Submittet patch send by ' Eugene Kulabuhov
- <eugene.kulabuhov@gmail.com>': Fixed MemberResolveResult
- clause incorrectly handling MethodResolveResult type as
- well.
-
-2010-03-23 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Dom/ICSharpDomVisitor.cs:
- * MonoDevelop.CSharp.Dom/AbtractCSharpDomVisitor.cs:
- * MonoDevelop.CSharp.Formatting/DomSpacingVisitor.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/FieldDeclaration.cs:
- * MonoDevelop.CSharp.Dom/Expressions/LambdaExpression.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/MethodDeclaration.cs:
- * MonoDevelop.CSharp.Dom/Expressions/ArgListExpression.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/IndexerDeclaration.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/ArgumentDeclaration.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/OperatorDeclaration.cs:
- * MonoDevelop.CSharp.Dom/Expressions/StackAllocExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/InvocationExpression.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/ConstructorDeclaration.cs:
- * MonoDevelop.CSharp.Dom/Expressions/BaseReferenceExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/AnonymousMethodExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/ArrayObjectCreateExpression.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/ParameterDeclarationExpression.cs:
- Worked on new DOM.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * CSharpBinding.addin.xml: Bumped MD version.
-
-2010-03-22 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Dom/ICSharpDomVisitor.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormatter.cs:
- * MonoDevelop.CSharp.Dom/AbtractCSharpDomVisitor.cs:
- * MonoDevelop.CSharp.Formatting/DomSpacingVisitor.cs:
- * MonoDevelop.CSharp.Formatting/DomIndentationVisitor.cs:
- * MonoDevelop.CSharp.Dom/Expressions/IndexerExpression.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.xml:
- * MonoDevelop.CSharp.Dom/TypeMembers/IndexerDeclaration.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/OperatorDeclaration.cs:
- * MonoDevelop.CSharp.Dom/Expressions/ObjectCreateExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/ArrayObjectCreateExpression.cs:
- Worked on new dom/parser/formatter.
-
-2010-03-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Formatting/DomSpacingVisitor.cs:
- * MonoDevelop.CSharp.Dom/Statements/WhileStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/IfElseStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/SwitchStatement.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/EventDeclaration.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/TypeDeclaration.cs:
- * MonoDevelop.CSharp.Formatting/DomIndentationVisitor.cs:
- * MonoDevelop.CSharp.Dom/Statements/TryCatchStatement.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/PropertyDeclaration.cs:
- Worked on new formatting engine/parser/dom.
-
-2010-03-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Dom/Statements/IfElseStatement.cs:
- * MonoDevelop.CSharp.Formatting/DomIndentationVisitor.cs:
- Worked on indenter.
-
-2010-03-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CSharp/CSharpBindingCompilerManager.cs: Always
- use the full file name for assembly references. Some
- assemblies from core packages are not located in the
- compiler directory, so a full file name is required.
-
-2010-03-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/Indent.cs:
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Dom/Statements/BlockStatement.cs:
- * MonoDevelop.CSharp.Formatting/DomIndentationVisitor.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.xml:
- Worked on indenter.
-
-2010-03-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs: fixed
- potential ms build problem.
-
-2010-03-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs: Fixed failing
- unit test.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.csproj: Remove import off mono.addins targets.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * CSharpBinding.csproj:
- * CSharpBinding.addin.xml:
- * MonoDevelop.CSharp.Dom/CSharpAmbience.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormatter.cs:
- * MonoDevelop.CSharp.Formatting/FormattingPanel.cs:
- * MonoDevelop.CSharp.Project/CodeGenerationPanel.cs:
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs:
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs:
- * MonoDevelop.CSharp.Completion/MemberCompletionData.cs:
- * MonoDevelop.CSharp.Project/CSharpCompilerParameters.cs:
- * MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs:
- * MonoDevelop.CSharp.Resolver/TextEditorResolverProvider.cs:
- * MonoDevelop.CSharp.Completion/NewOverrideCompletionData.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- * MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicyPanel.cs:
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- * MonoDevelop.CSharp.Highlighting/HighlightCSharpSemanticRule.cs:
- * MonoDevelop.CSharp.Completion/NRefactoryParameterDataProvider.cs:
- * MonoDevelop.CSharp.Completion/NRefactoryIndexerParameterDataProvider.cs:
- * MonoDevelop.CSharp.Completion/NRefactoryTemplateParameterDataProvider.cs:
- Merged MD.Projects into MD.Core, and MD.Projects.Gui,
- MD.Core.Gui and MD.Components into MD.Ide.
-
-2010-03-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs: Fixed 'Bug
- 588223 - Intellisense does not recognize nested generics
- correctly.'.
-
-2010-03-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Dom/CSharpAmbience.cs:
- * MonoDevelop.CSharp.Completion/NRefactoryTemplateParameterDataProvider.cs:
- Fixed 'Bug 588366 - Intellisense broken for nested generic
- types'.
-
-2010-03-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Dom/CSharpAmbience.cs:
- * MonoDevelop.CSharp.Completion/MemberCompletionData.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- * MonoDevelop.CSharp.Completion/NRefactoryTemplateParameterDataProvider.cs:
- Fixed 'Bug 588220 - No intellisense for generic methods.'.
-
-2010-03-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs:
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs:
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- * MonoDevelop.CSharp.Resolver/NewCSharpExpressionFinder.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- * MonoDevelop.CSharp.Highlighting/HighlightCSharpSemanticRule.cs:
- * MonoDevelop.CSharp.Completion/NRefactoryParameterDataProvider.cs:
- Track API changes.
-
-2010-03-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- Fixed 'Bug 587530 – for/foreach rename refactoring ignores
- the scope'.
-
-2010-03-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/CSharpParser.cs: Handled generated
- blocks/fixed some unit tests.
-
-2010-03-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Dom/Statements/ForStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/LockStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/YieldStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/FixedStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/UsingStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/WhileStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/EmptyStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/CheckedStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/ForeachStatement.cs:
- * MonoDevelop.CSharp.Formatting/DomIndentationVisitor.cs:
- * MonoDevelop.CSharp.Dom/Statements/UncheckedStatement.cs:
- * MonoDevelop.CSharp.Dom/Expressions/PointerReferenceExpression.cs:
- Worked on new indenter/dom.
-
-2010-03-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/NRefactoryParser.cs:
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs: Fixed 2nd
- bug described in 'Bug 586304 - Intellisense does not show
- several linq extenion methods when using nested generic
- type'.
-
-2010-03-10 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Dom/CSharpTokenNode.cs:
- * MonoDevelop.CSharp.Dom/ICSharpDomVisitor.cs:
- * MonoDevelop.CSharp.Dom/CSharpModifierToken.cs:
- * MonoDevelop.CSharp.Dom/AbtractCSharpDomVisitor.cs:
- * MonoDevelop.CSharp.Formatting/DomIndentationVisitor.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/PropertyDeclaration.cs:
- Worked on indenting engine.
-
-2010-03-09 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Formatting/Indent.cs:
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs:
- * MonoDevelop.CSharp.Dom/AbtractCSharpDomVisitor.cs:
- * MonoDevelop.CSharp.Formatting/DomSpacingVisitor.cs:
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs:
- * MonoDevelop.CSharp.Formatting/DomFormattingVisitor.cs:
- * MonoDevelop.CSharp.Formatting/DomIndentationVisitor.cs:
- * MonoDevelop.CSharp.Dom/Expressions/ThisReferenceExpression.cs:
- Worked on new formatter/parser.
-
-2010-03-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * CSharpBinding.csproj: Don't local-copy project refs, as it
- duplicates assemblies and breaks running on .NET.
-
-2010-03-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/DomFormattingVisitor.cs:
- * MonoDevelop.CSharp.Resolver/NewCSharpExpressionFinder.cs:
- Removed debug message.
-
-2010-03-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Dom/Statements/SwitchStatement.cs:
- * MonoDevelop.CSharp.Formatting/DomFormattingVisitor.cs:
- * MonoDevelop.CSharp.Dom/Expressions/TypeOfExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/SizeOfExpression.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/MethodDeclaration.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.cs:
- * MonoDevelop.CSharp.Dom/Expressions/CheckedExpression.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.xml:
- * MonoDevelop.CSharp.Dom/Expressions/UncheckedExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/AssignmentExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/ParenthesizedExpression.cs:
- Worked on dom/formatter/parser.
-
-2010-03-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- Fixed 'Bug 585454 - Lacking one reference to an enum type'.
-
-2010-03-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CSharp.Project/CSharpResourceIdBuilder.cs: Track
- ProjectFile Link API.
-
-2010-03-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/TextEditorResolverProvider.cs:
- fixed bug in resolver provider.
-
-2010-03-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NewCSharpExpressionFinder.cs:
- fix unit test.
-
-2010-03-03 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * CSharpBinding.addin.xml:
- * MonoDevelop.CSharp.Resolver/TextEditorResolverProvider.cs:
- Refactored text editor resolve providers. Language bindings
- now can provide own providers.
-
-2010-03-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Formatting/DomFormattingVisitor.cs:
- * MonoDevelop.CSharp.Resolver/NewCSharpExpressionFinder.cs:
- Fixed 'FindExpression' in expression finder.
-
-2010-03-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Dom/CSharpTokenNode.cs:
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Dom/Statements/UsingStatement.cs:
- * MonoDevelop.CSharp.Formatting/DomFormattingVisitor.cs:
- Worked on DOM formatter/parser.
-
-2010-03-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/CSharpParser.cs: Convert operator
- declaration bodies.
-
-2010-03-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs: Fix the rest
- of the failing DomProperty tests.
-
-2010-03-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CSharp.Parser/NRefactoryParser.cs: Fix indexer
- assignment that caused failing unit tests.
-
-2010-03-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/NRefactoryParser.cs: Fixed 'Bug
- 583515 - No code completion for set-only properties'.
-
-2010-03-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs: When a member
- can't be resolved, a special resolve result is created.
-
-2010-03-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Dom/CSharpAmbience.cs: Ambiences can now
- format delegates & take formatting policies.
-
-2010-02-26 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Dom/Identifier.cs:
- * MonoDevelop.CSharp.Dom/ICSharpNode.cs:
- * MonoDevelop.CSharp.Dom/FullTypeName.cs:
- * MonoDevelop.CSharp.Dom/CSharpTokenNode.cs:
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Dom/AbstractCSharpNode.cs:
- * MonoDevelop.CSharp.Dom/Expressions/CastExpression.cs:
- * MonoDevelop.CSharp.Formatting/DomFormattingVisitor.cs:
- * MonoDevelop.CSharp.Formatting/DomIndentationVisitor.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.cs:
- * MonoDevelop.CSharp.Dom/Expressions/PrimitiveExpression.cs:
- Worked on formatting visitor/dom.
-
-2010-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/NewOverrideCompletionData.cs:
- Now using the BaseRefactorer.IsMonoTouchModelMember method.
-
-2010-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/NRefactoryParser.cs:
- * MonoDevelop.CSharp.Completion/NewOverrideCompletionData.cs:
- * gtk-gui/MonoDevelop.CSharp.Formatting.FormattingPanelWidget.cs:
- Worked on 'Bug 583014 - Need a way to stop override
- generating base call'.
-
-2010-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Dom/Statements/LockStatement.cs:
- * MonoDevelop.CSharp.Formatting/DomFormattingVisitor.cs:
- * MonoDevelop.CSharp.Dom/Statements/TryCatchStatement.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.cs:
- * gtk-gui/MonoDevelop.CSharp.Formatting.FormattingPanelWidget.cs:
- Worked on formatting visitor/dom.
-
-2010-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs: fixed failing
- unit test.
-
-2010-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Dom/Statements/ForStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/WhileStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/IfElseStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/ForeachStatement.cs:
- * MonoDevelop.CSharp.Formatting/DomFormattingVisitor.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.cs:
- * MonoDevelop.CSharp.Dom/Expressions/PrimitiveExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/InvocationExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/ConditionalExpression.cs:
- Worked on DOM & formatting visitor.
-
-2010-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/NewOverrideCompletionData.cs:
- Fixed 'Bug 583014 - Need a way to stop override generating
- base call'.
-
-2010-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Dom/CSharpAmbience.cs: Fixed 'Bug 583006
- - Enum members are prefixed with an enum name, in the
- Document Outline pad' / applied patch from Alexander
- Cherniuk <ts33kr@gmail.com>
-
-2010-02-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Dom/Identifier.cs:
- * MonoDevelop.CSharp.Dom/FullTypeName.cs:
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Dom/ICSharpDomVisitor.cs:
- * MonoDevelop.CSharp.Dom/AbtractCSharpDomVisitor.cs:
- * MonoDevelop.CSharp.Formatting/DomFormattingVisitor.cs:
- * MonoDevelop.CSharp.Dom/Expressions/BinaryOperatorExpression.cs:
- Worked on c# formatter & dom.
-
-2010-02-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CSharp/CSharpBindingCompilerManager.cs: Fix
- skipping duplicate refs.
-
-2010-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpIndentEngine.cs:
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- Implemented 'Bug 429265 - #region reindentation does not
- work with autocompletion'
-
-2010-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs: fixed
- 'Bug 582016 – Switching build configuration does not
- re-highlight conditional comments'.
-
-2010-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpIndentEngine.cs: fixed
- 'Bug 429265 - #region reindentation does not work with
- autocompletion'.
-
-2010-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs: fixed
- pre processor tag highlighting.
-
-2010-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs: fixed
- 'Bug 582021 - parsing of nested conditional comments is
- broken'.
-
-
-2010-02-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj: Fix build.
-
-2010-02-23 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs:
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs: Fixed
- 'Bug 582017 - C# Generic Type Constraints'.
-
-2010-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Dom/Statements/FixedStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/ForeachStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/TryCatchStatement.cs:
- Worked on dom.
-
-2010-02-22 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.CSharp.Formatting/CSharpFormatter.cs: fixed 'Bug
- 578439 - Return key acts crazy in MonoDevelop'.
-
-2010-02-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs: Fixed bug in
- array item lookup.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNet:
- * Makefile.am:
- * CSharpBinding.csproj:
- * CSharpBinding.addin.xml:
- * MonoDevelop.CSharp.Completion/AspLanguageBuilder.cs: Moved
- AspLanguageBuilder to its own assembly and module. Dropped
- Asp.Net dependency.
-
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- Filtering by extension is now done by the document.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CSharp.Completion/MemberCompletionData.cs: Track
- api changes.
-
-2010-02-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs: Fixed
- 'Bug 580427 - Exception, then crash while editing text.'.
-
-2010-02-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Categories are now sorted.
-
-2010-02-16 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Dom/Identifier.cs:
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Dom/ICSharpDomVisitor.cs:
- * MonoDevelop.CSharp.Dom/AbtractCSharpDomVisitor.cs:
- * MonoDevelop.CSharp.Dom/Statements/GotoStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/WhileStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/IfElseStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/ExpressionStatement.cs:
- Worked on new C# DOM.
-
-2010-02-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- * MonoDevelop.CSharp.Completion/NRefactoryParameterDataProvider.cs:
- Fixed 'Bug 576336 - Parameter tooltip window stops working'.
-
-2010-02-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs:
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs: Fixed
- 'Bug 577225 - Inconsistent autocomplete on returned value of
- generic method.'.
-
-2010-02-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Formatting/DomFormattingVisitor.cs:
- worked on c# parser.
-
-2010-02-08 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Dom/ICSharpDomVisitor.cs:
- * MonoDevelop.CSharp.Dom/AbtractCSharpDomVisitor.cs:
- * MonoDevelop.CSharp.Dom/Expressions/IsExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/AsExpression.cs:
- * MonoDevelop.CSharp.Dom/Statements/EmptyStatement.cs:
- * MonoDevelop.CSharp.Dom/Expressions/TypeOfExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/SizeOfExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/ConditionalExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/DefaultValueExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/UnaryOperatorExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/ThisReferenceExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/BinaryOperatorExpression.cs:
- Worked on parser/new dom.
-
-2010-02-07 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Dom/FullTypeName.cs:
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Formatting/DomFormattingVisitor.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/OperatorDeclaration.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/PropertyDeclaration.cs:
- worked on mcs based parser/new dom.
-
-2010-02-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Formatting/DomFormattingVisitor.cs:
- Worked on DOM visitor.
-
-2010-02-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Dom/ICSharpNode.cs:
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Dom/CompilationUnit.cs:
- * MonoDevelop.CSharp.Dom/ICSharpDomVisitor.cs:
- * MonoDevelop.CSharp.Dom/AbtractCSharpDomVisitor.cs:
- * MonoDevelop.CSharp.Formatting/DomFormattingVisitor.cs:
- Worked on mcs parser/dom.
-
-2010-02-02 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Dom/Identifier.cs:
- * MonoDevelop.CSharp.Dom/CSharpTokenNode.cs:
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Dom/CompilationUnit.cs:
- * MonoDevelop.CSharp.Dom/AbtractCSharpDomVisitor.cs:
- * MonoDevelop.CSharp.Formatting/DomFormattingVisitor.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/TypeDeclaration.cs:
- Worked on new dom/gmcs based parser.
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- fixed code completion activation in some cases.
-
-2010-02-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- added completion context for boolean variables (case:
- "varName = ").
-
-2010-01-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NewCSharpExpressionFinder.cs:
- handle collection initalizers.
-
-2010-01-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NewCSharpExpressionFinder.cs:
- fixed intellisense bug found by Marek.
-
-2010-01-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Kill debug code that spammed MD's stdout.
-
-2010-01-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/MemberCompletionData.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Track API changes.
-
-2010-01-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml: Remove unused extension.
-
-2010-01-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Added '!' as special closing key.
-
-2010-01-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpFormatter.cs: fixed bug
- in auto formatting.
-
-2010-01-20 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.xml:
- * gtk-gui/MonoDevelop.CSharp.Formatting.FormattingPanelWidget.cs:
- * gtk-gui/MonoDevelop.CSharp.Project.CodeGenerationPanelWidget.cs:
- * gtk-gui/MonoDevelop.CSharp.Project.CompilerOptionsPanelWidget.cs:
- Implemented 'Bug 550947 - Arrays initailizers should not
- automatically be split on multiple lines'.
-
-2010-01-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.cs:
- brace forcement is now saved.
-
-2010-01-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpFormatter.cs:
- * MonoDevelop.CSharp.Refactoring/CSharpNRefactoryASTProvider.cs:
- Track api changes.
-
-2010-01-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- fixed 'Bug 571175 - ArgumentNullException in C# code
- completion'.
-
-2010-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj: Fix NRefactory project reference
- AGAIN.
-
-2010-01-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpFormatter.cs: removed
- debug messages.
-
-2010-01-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpFormatter.cs: fixed 'Bug
- 569545 - [Windows] TextEditor sometimes adds LF on Windows'.
-
-2010-01-06 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs: fixed 'Bug
- 568484 - NRE in resolver'.
-
-2010-01-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs: fixed
- 'Bug 566544 - Locals and parameters are often not
- completed'.
-
-2010-01-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs:
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs: Fixed
- 'Bug 568204 - Inconsistency in resolution'.
-
-2010-01-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Dom/CSharpAmbience.cs: Fixed 'Bug 567906
- - Given error of .NET 3.0 in .NET 3.5 project'.
-
-2010-01-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs: defines
- get updated by the source editor on parse event.
-
-2010-01-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs: fixed 'Bug
- 561964 - Wrong type in tooltip when there are two properties
- with the same name'.
-
-2010-01-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs: fixed
- 'Bug 561589 - Infinite loop throwing an exception crashes
- system'.
-
-2010-01-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs: fixed
- 'Bug 560510 - Preprocessor enabled code shows as comment
- anyway'.
-
-2009-12-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/GtkSharp2Project.xpt.xml:
- * templates/GnomeSharp2Project.xpt.xml:
- * templates/GladeSharp2Project.xpt.xml: Set correct assembly
- target for gui projects.
-
-2009-12-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CSharp/CSharpBindingCompilerManager.cs: If C#
- compiler crashes, copy the stderr file to the monitor,
- report error message telling user to look there, and log
- location of the temp response/stderr/stdout files and avoid
- deleting them. Fixes "Bug 515013 - Compiling; a method call
- on an object that does not exist produces incomprehensible
- /tmp/*.tmp error".
-
-2009-12-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs:
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs:
- * MonoDevelop.CSharp.Completion/AspLanguageBuilder.cs: Worked
- on ASP.NET support.
-
-2009-12-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs: fixed
- unit test.
-
-2009-12-01 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * CSharpBinding.addin.xml:
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs:
- * MonoDevelop.CSharp.Completion/AspLanguageBuilder.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Worked on ASP.NET completion.
-
-2009-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CSharp/CSharpLanguageBinding.cs:
- * MonoDevelop.CSharp/CSharpBindingCompilerManager.cs:
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs:
- * MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs:
- Introduced the ConfigurationSelector class to all methods
- that previously took a configuration name as string. This
- eliminates the ambiguity between solution configuration
- names and project configuration names.
-
-2009-11-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CSharp/CSharpBindingCompilerManager.cs: Use
- correct property for identifying runtime.
-
-2009-11-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CSharp/CSharpBindingCompilerManager.cs: Ignore
- the platform flag with Mono <= 2.4, because mcs/gmcs didn't
- support it.
-
-2009-11-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CSharp/CSharpBindingCompilerManager.cs: Emit the
- target platform option. Fixes bug #557146.
-
-2009-11-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/MemberCompletionData.cs: Fixed
- possible null ref exception.
-
-2009-11-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Fixed 'var a = new int' case.
-
-2009-11-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs:
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs: Fixed
- 'Bug 555672 - Crash when trying to autocomplete'.
-
-2009-11-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs: Fixed 'Bug
- 555523 - C# code completion gets confused by extension
- methods with same names as properties'.
-
-2009-11-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/MemberCompletionData.cs: Fixed
- 'Bug 555504 - Completion of generic types commits <T>'.
-
-2009-11-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/MemberCompletionData.cs: Fixed
- 'Bug 554376 - Overridden members show in completion as
- overloads'.
-
-2009-11-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/MemberCompletionData.cs: Fixed
- 'Bug 554688 - Accesting param name from completion list
- commits param type'.
-
-2009-11-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/MemberCompletionData.cs: Fixed
- 'Bug 554376 - Overridden members show in completion as
- overloads'.
-
-2009-11-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp/CustomCSharpCodeGenerator.cs: Remove the
- forked code generator.
-
-2009-11-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CSharp/CSharpEnhancedCodeProvider.cs: Disable
- Mike's custom CodeDOM generator as it's totally broken for
- delegates, and breaks web refs. Had to stay late to push out
- a stable bugfix release for this, and missed the last train
- home.
-
-2009-11-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Fixed 'Bug 553101 – Enum completion does not use type
- aliases'.
-
-2009-11-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- * MonoDevelop.CSharp.Completion/NRefactoryParameterDataProvider.cs:
- Fixed 'Bug 552332 - Parameter insight re-shows inside anon
- delegates on every newline'.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * CSharpBinding.addin.xml: Bump MD version.
-
-2009-10-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/HighlightCSharpSemanticRule.cs:
- Fixed 'Bug 551068 - Semantic highlighting crashes MD.'.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.CSharp.Formatting.FormattingPanelWidget.cs:
- * gtk-gui/MonoDevelop.CSharp.Project.CodeGenerationPanelWidget.cs:
- * gtk-gui/MonoDevelop.CSharp.Project.CompilerOptionsPanelWidget.cs:
- Flush.
-
-2009-10-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs:
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs:
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- Fixed 'Bug 549858 - Refactoring does not change properties
- in lambda expressions'.
-
-2009-10-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/CodeGenerator.cs: fixed Bug
- 550024 - "resolve using" moves cursor to the added using.
-
-2009-10-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs: Fixed
- 'Bug 549864 - Intellisense does not work properly with
- expressions'.
-
-2009-10-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs: Fixed
- faling unit test.
-
-2009-10-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Respect the parameter insight option.
-
-2009-10-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/CodeGenerator.cs: Fixed "Bug
- 549130 - "resolve" adds using st. at wrong place when
- namespace and classname conflict".
-
-2009-10-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- * MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs:
- Fixed 'Bug 548941 - Generated event handler doesn't account
- for missing using statements'.
-
-2009-10-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs:
- implemented 'Bug 548711 - generated event handlers names
- should always contain "Handle"'.
-
-2009-10-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/CSharpNRefactoryASTProvider.cs:
- handled in extract method.
-
-2009-10-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/CSharpNRefactoryASTProvider.cs:
- Fixed 'Bug 548367 - Extract method adds an unwanted newline
- at the end'.
-
-2009-10-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/CodeGenerator.cs: Overworked
- new member positioning code.
-
-2009-10-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/CSharpNRefactoryASTProvider.cs:
- Fix 'Bug 545270 - Move type to another file - part 1'.
-
-2009-10-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- Fixed 'Bug 547949 - Rename partial classes does not rename
- both classes'.
-
-2009-10-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp/CustomCSharpCodeGenerator.cs: Fixed
- private implementation type output again.
-
-2009-10-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Filter out special names from override completion.
-
-2009-10-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CSharp/CustomCSharpCodeGenerator.cs: Tidy and
- fix compilation.
-
-2009-10-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CSharp/CustomCSharpCodeGenerator.cs: Restore
- support for snippet and entry point members.
-
-2009-10-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CSharp/CustomCSharpCodeGenerator.cs: Commit the
- first type newline removal hack, tidied up.
-
-2009-10-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CSharp/CSharpEnhancedCodeProvider.cs: Re-enable
- the custom generator.
-
- * MonoDevelop.CSharp/CustomCSharpCodeGenerator.cs: Add
- comments to header about minimising changes so we can sync
- from original.
-
-2009-10-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CSharp/CSharpEnhancedCodeProvider.cs: Disable
- the custom generator for now, as it's broken.
-
- * MonoDevelop.CSharp/CustomCSharpCodeGenerator.cs: Revert to a
- clean import (except the MonoTODO -> //TODO) so that it's
- easier to see what changes we've made to the original.
-
-2009-10-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- Fixed 'Bug 547611 - renaming a variable does not rename in
- this() invocation'.
-
-2009-10-19 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp/CustomCSharpCodeGenerator.cs:
- * MonoDevelop.CSharp/CSharpEnhancedCodeProvider.cs: Added
- custom C# CodeDOM provider (fixing Bug 547947 - the default
- text when creating a new class has too many newlines and an
- issue with explicit interface member name generation).
-
-2009-10-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NewCSharpExpressionFinder.cs:
- Fixed 'Bug 547645 - Intellisense in Object-Initializer does
- not work if Namespace is used'.
-
-2009-10-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/NewOverrideCompletionData.cs:
- Fixed 'Bug 547470 - Override completion for "protected
- internal" is wrong'.
-
-2009-10-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/HighlightCSharpSemanticRule.cs:
- Fixed 'Bug 546143 - Semantic Type Highlighting does not work
- on attributes.'.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs: worked on
- constructor initalizer resolving.
-
-2009-10-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj: Fix build.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs:
- Disabled conditionditional highlighting for debugger files.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs: Fixed 'Bug
- 540054 - 'Go to Declaration' goes wrong when methods are
- overloaded'.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs: Special
- handling of field names & typenames (same as for
- properties).
-
-2009-10-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Highlighting/HighlightCSharpSemanticRule.cs:
- Fixed 'Bug 546392 - exception in highlighting'.
-
-2009-10-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- Fixed 'Bug 546016 - EventHandler code completion not working
- if there is no space after +='.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * md1format.xml: track namespace changes.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- Fixed 'Bug 545667 - Exception when autoformatting'.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Completion/NRefactoryParameterDataProvider.cs:
- Don't show return type for constructors.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.CSharp:
- * gtk-gui/gui.stetic:
- * CSharpBinding.csproj:
- * Gui/CSharpAmbience.cs:
- * Gui/ResolveVisitor.cs:
- * Gui/FormattingPanel.cs:
- * Parser/CodeGenerator.cs:
- * CSharpBinding.addin.xml:
- * CSharpLanguageBinding.cs:
- * Parser/CSharpFormatter.cs:
- * Gui/NRefactoryResolver.cs:
- * MonoDevelop.CSharp.Project:
- * Parser/NRefactoryParser.cs:
- * Syntax/CSharpSyntaxMode.cs:
- * Gui/CodeGenerationPanel.cs:
- * Gui/MemberCompletionData.cs:
- * MonoDevelop.CSharp.Resolver:
- * MonoDevelop.CSharp.Completion:
- * MonoDevelop.CSharp.Formatting:
- * CSharpEnhancedCodeProvider.cs:
- * MonoDevelop.CSharp.Refactoring:
- * Parser/FindMemberAstVisitor.cs:
- * MonoDevelop.CSharp.Highlighting:
- * CSharpBindingCompilerManager.cs:
- * Gui/NewCSharpExpressionFinder.cs:
- * Gui/NewOverrideCompletionData.cs:
- * Gui/CSharpTextEditorCompletion.cs:
- * Gui/CompilerOptionsPanelWidget.cs:
- * Gui/CSharpTextEditorIndentation.cs:
- * Gui/EventCreationCompletionData.cs:
- * Project/CSharpResourceIdBuilder.cs:
- * Project/CSharpProjectParameters.cs:
- * Project/CSharpCompilerParameters.cs:
- * Syntax/HighlightCSharpSemanticRule.cs:
- * Parser/CSharpNRefactoryASTProvider.cs:
- * Gui/NRefactoryParameterDataProvider.cs:
- * Gui/NRefactoryDocumentMetaInformation.cs:
- * FormattingStrategy/CSharpIndentEngine.cs:
- * MonoDevelop.CSharp.Dom/CSharpAmbience.cs:
- * MonoDevelop.CSharp/CSharpLanguageBinding.cs:
- * FormattingStrategy/CSharpFormattingPolicy.cs:
- * MonoDevelop.CSharp.Resolver/ResolveVisitor.cs:
- * MonoDevelop.CSharp.Parser/NRefactoryParser.cs:
- * FormattingStrategy/CSharpIndentEngineStack.cs:
- * Gui/NRefactoryIndexerParameterDataProvider.cs:
- * FormattingStrategy/CSharpFormattingPolicy.xml:
- * Gui/NRefactoryTemplateParameterDataProvider.cs:
- * gtk-gui/CSharpBinding.FormattingPanelWidget.cs:
- * MonoDevelop.CSharp.Refactoring/CodeGenerator.cs:
- * MonoDevelop.CSharp/CSharpEnhancedCodeProvider.cs:
- * MonoDevelop.CSharp.Formatting/FormattingPanel.cs:
- * FormattingStrategy/CSharpFormattingProperties.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormatter.cs:
- * MonoDevelop.CSharp.Resolver/NRefactoryResolver.cs:
- * FormattingStrategy/CSharpFormattingPolicyPanel.cs:
- * MonoDevelop.CSharp.Project/CodeGenerationPanel.cs:
- * gtk-gui/CSharpBinding.CodeGenerationPanelWidget.cs:
- * MonoDevelop.CSharp/CSharpBindingCompilerManager.cs:
- * MonoDevelop.CSharp.Formatting/CSharpIndentEngine.cs:
- * MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs:
- * gtk-gui/CSharpBinding.CompilerOptionsPanelWidget.cs:
- * MonoDevelop.CSharp.Project/CSharpResourceIdBuilder.cs:
- * MonoDevelop.CSharp.Project/CSharpProjectParameters.cs:
- * MonoDevelop.CSharp.Completion/MemberCompletionData.cs:
- * MonoDevelop.CSharp.Project/CSharpCompilerParameters.cs:
- * MonoDevelop.CSharp.Refactoring/FindMemberAstVisitor.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.cs:
- * MonoDevelop.CSharp.Formatting/CSharpIndentEngineStack.cs:
- * MonoDevelop.CSharp.Resolver/NewCSharpExpressionFinder.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.xml:
- * MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs:
- * MonoDevelop.CSharp.Completion/NewOverrideCompletionData.cs:
- * MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormattingProperties.cs:
- * MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs:
- * MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:
- * MonoDevelop.CSharp.Formatting/CSharpFormattingPolicyPanel.cs:
- * MonoDevelop.CSharp.Refactoring/CSharpNRefactoryASTProvider.cs:
- * gtk-gui/MonoDevelop.CSharp.Formatting.FormattingPanelWidget.cs:
- * MonoDevelop.CSharp.Highlighting/HighlightCSharpSemanticRule.cs:
- * gtk-gui/MonoDevelop.CSharp.Project.CodeGenerationPanelWidget.cs:
- * MonoDevelop.CSharp.Completion/NRefactoryParameterDataProvider.cs:
- * gtk-gui/MonoDevelop.CSharp.Project.CompilerOptionsPanelWidget.cs:
- * MonoDevelop.CSharp.Resolver/NRefactoryDocumentMetaInformation.cs:
- * MonoDevelop.CSharp.Completion/NRefactoryIndexerParameterDataProvider.cs:
- * MonoDevelop.CSharp.Completion/NRefactoryTemplateParameterDataProvider.cs:
- Renamed some namespaces.
-
-2009-10-08 Ankit Jain <jankit@novell.com>
-
- * CSharpBinding.csproj: Use \ instead of '/' in the Import.
-
-2009-10-08 Ankit Jain <jankit@novell.com>
-
- * CSharpBinding.csproj: Add md.targets .
-
-2009-10-08 Mike Krüger <mkrueger@novell.com>
-
- * Parser/FindMemberAstVisitor.cs: Fixed 'Bug 545361 - Method
- -> Rename doesn't update instance in delegate constructor'.
-
-2009-10-08 Mike Krüger <mkrueger@novell.com>
-
- * Syntax/HighlightCSharpSemanticRule.cs: Fixed "Bug 545332 -
- Crashing monodevelop".
-
-2009-10-08 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: fixed ambience output for some return
- types.
-
-2009-10-08 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/NRefactoryParameterDataProvider.cs: Fixed 'Bug 545196 -
- Exception in C# completion'.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Add timer.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpLanguageBinding.cs:
- * Gui/CodeGenerationPanel.cs: Assign the target plaform when
- creating compilation parameters. Add some counters.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * CSharpBinding.addin.xml: Bump MD version.
-
-2009-10-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs: Added ambience to documentation
- output.
-
-2009-10-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs:
- * Gui/NRefactoryParameterDataProvider.cs: Worked on
- documentation output.
-
-2009-10-05 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Use IsAccessibleFrom
- method in override completion.
-
-2009-10-05 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryParameterDataProvider.cs: fixed extension
- methods output.
-
-2009-10-02 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Fixed 'typeof (' context
- (primitive types were missing).
-
-2009-10-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * Gui/CodeGenerationPanel.cs:
- * Project/CSharpCompilerParameters.cs:
- * gtk-gui/CSharpBinding.CodeGenerationPanelWidget.cs: Allow
- setting the platform target.
-
-2009-09-30 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: Fixed tab as reindent.
-
-2009-09-30 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: Fixed 'Bug 542976 - Type
- resolution problem'.
-
-2009-09-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CSharp.Parser\CSharpParser.cs: Mono.CSharp is
- not available on windows.
-
-2009-09-29 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs:
- * FormattingStrategy/CSharpIndentEngine.cs: Optimized indent
- engine.
-
- * Parser/NRefactoryParser.cs: Fields now get their body region
- set to the variable declaration bounds (required for looking
- up in multiple field declaration: Type field1, field2,
- field3;).
-
-2009-09-28 Mike Krüger <mkrueger@novell.com>
-
- * CSharpBindingCompilerManager.cs: Used correct context.
-
-2009-09-28 Mike Krüger <mkrueger@novell.com>
-
- * CSharpBindingCompilerManager.cs: Building packages that have
- required packages now works.
-
-2009-09-25 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Parser:
- * MonoDevelop.CSharp.Parser/CSharpParser.cs:
- * MonoDevelop.CSharp.Dom/ICSharpDomVisitor.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/TypeDeclaration.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/EnumDeclaration.cs:
- Added enumdeclaration node.
-
-2009-09-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CSharp.Dom/GeneralScope/AttributeSection.cs:
- Added attribute target enum.
-
-2009-09-25 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs:
- * Gui/NRefactoryParameterDataProvider.cs: Fixed 'Bug 542015 -
- Superfluous overloads'.
-
-2009-09-24 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Dom/Identifier.cs:
- * MonoDevelop.CSharp.Dom/ICSharpNode.cs:
- * Syntax/HighlightCSharpSemanticRule.cs:
- * MonoDevelop.CSharp.Dom/ICSharpDomVisitor.cs:
- * MonoDevelop.CSharp.Dom/AbstractCSharpNode.cs:
- * MonoDevelop.CSharp.Dom/QualifiedIdentifier.cs:
- * MonoDevelop.CSharp.Dom/Expressions/Identifier.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/Attribute.cs:
- * MonoDevelop.CSharp.Dom/Statements/ForStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/GotoStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/LockStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/EmptyStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/BlockStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/FixedStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/LabelStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/BreakStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/UsingStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/ThrowStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/YieldStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/WhileStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/ReturnStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/SwitchStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/UnsafeStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/IfElseStatement.cs:
- * MonoDevelop.CSharp.Dom/Expressions/CastExpression.cs:
- * MonoDevelop.CSharp.Dom/Statements/ForeachStatement.cs:
- * MonoDevelop.CSharp.Dom/Expressions/QueryExpression.cs:
- * MonoDevelop.CSharp.Dom/Statements/CheckedStatement.cs:
- * MonoDevelop.CSharp.Dom/Statements/TryCatchStatement.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/EventDeclaration.cs:
- * MonoDevelop.CSharp.Dom/Expressions/TypeOfExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/SizeOfExpression.cs:
- * MonoDevelop.CSharp.Dom/Statements/ContinueStatement.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/FieldDeclaration.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/TypeDeclaration.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/UsingDeclaration.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/AttributeSection.cs:
- * MonoDevelop.CSharp.Dom/Expressions/CheckedExpression.cs:
- * MonoDevelop.CSharp.Dom/Statements/UncheckedStatement.cs:
- * MonoDevelop.CSharp.Dom/Expressions/IndexerExpression.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/MethodDeclaration.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/IndexerDeclaration.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/AbstractMemberBase.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/PropertyDeclaration.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/VariableInitializer.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/ArgumentDeclaration.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/OperatorDeclaration.cs:
- * MonoDevelop.CSharp.Dom/Expressions/PrimitiveExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/QualifiedIdentifier.cs:
- * MonoDevelop.CSharp.Dom/Expressions/UncheckedExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/StackAllocExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/IdentifierExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/InvocationExpression.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/DelegateDeclaration.cs:
- * MonoDevelop.CSharp.Dom/Expressions/AssignmentExpression.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/DestructorDeclaration.cs:
- * MonoDevelop.CSharp.Dom/Expressions/ConditionalExpression.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/NamespaceDeclaration.cs:
- * MonoDevelop.CSharp.Dom/Expressions/ObjectCreateExpression.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/ConstructorDeclaration.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/UsingAliasDeclaration.cs:
- * MonoDevelop.CSharp.Dom/Expressions/NullReferenceExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/ParenthesizedExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/BaseReferenceExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/ThisReferenceExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/UnaryOperatorExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/BinaryOperatorExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/AnonymousMethodExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/MemberReferenceExpression.cs:
- * MonoDevelop.CSharp.Dom/Expressions/PointerReferenceExpression.cs:
- * MonoDevelop.CSharp.Dom/Statements/VariableDeclarationStatement.cs:
- Worked on C# DOM.
-
-2009-09-23 Mike Krüger <mkrueger@novell.com>
-
- * Syntax/HighlightCSharpSemanticRule.cs: Added some checks.
-
-2009-09-23 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Dom/Statements:
- * MonoDevelop.CSharp.Dom/TypeMembers:
- * MonoDevelop.CSharp.Dom/Expressions:
- * MonoDevelop.CSharp.Dom/GeneralScope:
- * MonoDevelop.CSharp.Dom/Attribute.cs:
- * MonoDevelop.CSharp.Dom/Identifier.cs:
- * Syntax/HighlightCSharpSemanticRule.cs:
- * MonoDevelop.CSharp.Dom/TypeDeclaration.cs:
- * MonoDevelop.CSharp.Dom/AttributeSection.cs:
- * MonoDevelop.CSharp.Dom/UsingDeclaration.cs:
- * MonoDevelop.CSharp.Dom/DelegateDeclaration.cs:
- * MonoDevelop.CSharp.Dom/QualifiedIdentifier.cs:
- * MonoDevelop.CSharp.Dom/NamespaceDeclaration.cs:
- * MonoDevelop.CSharp.Dom/UsingAliasDeclaration.cs:
- * MonoDevelop.CSharp.Dom/Expressions/Identifier.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/Attribute.cs:
- * MonoDevelop.CSharp.Dom/Statements/BlockStatement.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/AbstractMember.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/EventDeclaration.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/FieldDeclaration.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/TypeDeclaration.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/MethodDeclaration.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/AttributeSection.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/UsingDeclaration.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/AbstractMemberBase.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/IndexerDeclaration.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/VariableInitializer.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/ArgumentDeclaration.cs:
- * MonoDevelop.CSharp.Dom/Expressions/QualifiedIdentifier.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/OperatorDeclaration.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/PropertyDeclaration.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/DelegateDeclaration.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/NamespaceDeclaration.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/DestructorDeclaration.cs:
- * MonoDevelop.CSharp.Dom/GeneralScope/UsingAliasDeclaration.cs:
- * MonoDevelop.CSharp.Dom/TypeMembers/ConstructorDeclaration.cs:
- Worked on C# DOM.
-
-2009-09-23 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj: Renamed file.
-
-2009-09-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Syntax/CSharpSyntaxMode.cs:
- * Syntax/HighlightCSharpSemanticRule.cs:
- * Syntax/HighlightPropertiesSemanticRule.cs: Reactivated
- semantic highlighting.
-
-2009-09-22 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoDevelop.CSharp.Dom:
- * MonoDevelop.CSharp.Dom/Attribute.cs:
- * MonoDevelop.CSharp.Dom/Identifier.cs:
- * MonoDevelop.CSharp.Dom/TypeDeclaration.cs:
- * MonoDevelop.CSharp.Dom/AttributeSection.cs:
- * MonoDevelop.CSharp.Dom/UsingDeclaration.cs:
- * MonoDevelop.CSharp.Dom/DelegateDeclaration.cs:
- * MonoDevelop.CSharp.Dom/QualifiedIdentifier.cs:
- * MonoDevelop.CSharp.Dom/NamespaceDeclaration.cs:
- * MonoDevelop.CSharp.Dom/UsingAliasDeclaration.cs: Worked on
- c# dom.
-
-2009-09-21 Mike Krüger <mkrueger@novell.com>
-
- * FormattingStrategy/CSharpFormattingPolicy.cs:
- * FormattingStrategy/CSharpFormattingPolicy.xml: Fixed 'Bug
- 540466 - Code formatter "place else on new line" is broken'.
-
-2009-09-21 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs:
- * Parser/CSharpFormatter.cs:
- * Gui/MemberCompletionData.cs:
- * Parser/FindMemberAstVisitor.cs:
- * Gui/CSharpTextEditorCompletion.cs: Renamed IDomVisitable ->
- INode
-
-2009-09-18 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs:
- * Gui/MemberCompletionData.cs: Show type of type.
- (class/interface/struct ...)
-
-2009-09-18 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: Show return type for constants
- (Math.PI).
-
-2009-09-18 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: c# ambience now use the
- FullInnerTypeName setting.
-
-2009-09-18 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Fixed wrong code
- completion popup.
-
-2009-09-18 Mike Krüger <mkrueger@novell.com>
-
- * Syntax/CSharpSyntaxMode.cs: handled null exception.
-
-2009-09-18 Mike Krüger <mkrueger@novell.com>
-
- * Syntax/CSharpSyntaxMode.cs: handled possible null reference.
-
-2009-09-18 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: Use more advanced
- GetComponentType method instead of a custom version (removes
- code duplication). Fixes 'Bug 540095 - Code completion
- issues with dictionaries in foreach'.
-
-2009-09-17 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs:
- * Parser/CodeGenerator.cs: Fixed explicit interfaces.
-
-2009-09-17 Mike Krüger <mkrueger@novell.com>
-
- * Parser/NRefactoryParser.cs:
- * Gui/NewOverrideCompletionData.cs:
- * Gui/CSharpTextEditorCompletion.cs: Correctly set valid
- region/improved method overriding.
-
-2009-09-17 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs: Fixed on the fly format bug.
-
-2009-09-16 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: Enums are no longer printed sealed.
-
-2009-09-16 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/NewCSharpExpressionFinder.cs:
- * Gui/CSharpTextEditorCompletion.cs: Fixed 'Bug 539327 -
- Intellisense does not work with default (type) keywork'.
-
-2009-09-16 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/NewCSharpExpressionFinder.cs:
- * Gui/CSharpTextEditorCompletion.cs: Fixed "Bug 539320 - No
- intellisense for delegate attributes".
-
-2009-09-16 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/CSharpTextEditorCompletion.cs: Fixed 'Bug 539318 -
- duplicate var suggestion'.
-
-2009-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs: Added short way to format whole
- document.
-
-2009-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs: worked on formatting.
-
-2009-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs: Worked on code formatting.
-
-2009-09-12 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Added auto complete empty
- match == false for 'hint' enum completion.
-
-2009-09-12 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewOverrideCompletionData.cs:
- * Gui/CSharpTextEditorCompletion.cs:
- * Gui/EventCreationCompletionData.cs:
- * Gui/NRefactoryParameterDataProvider.cs:
- * Gui/NRefactoryIndexerParameterDataProvider.cs:
- * Gui/NRefactoryTemplateParameterDataProvider.cs: Track API
- changes.
-
-2009-09-12 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: removed debug message.
-
-2009-09-11 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs: worked on formatting.
-
-2009-09-11 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs: Fixed "Bug 538296 -
- Autocompletion makes weird indentation on svn build".
-
-2009-09-11 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs:
- * Gui/NRefactoryResolver.cs: Fixed "Bug 538208 - Go to
- declaration not working over a generic method...".
-
-2009-09-10 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs:
- * Gui/CSharpTextEditorIndentation.cs: Track API changes/worked
- on code formatter.
-
-2009-09-08 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs: Improved formatting merge
- algorithm (fixing Bug 537374 - On-the-fly formatting: New
- line incorrectly inserted in property).
-
-2009-09-08 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs:
- * Parser/FindMemberAstVisitor.cs: Removed debug message.
-
-2009-09-08 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: fixed "Bug 537187 - When
- 'interpret tab as reindent' option is set, code templates
- don't work".
-
-2009-09-08 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs: Fixed "Bug 537318 - Text curser
- misplaced on automatic refactoring (adding spaces etc. when
- pressing ';')".
-
-2009-09-08 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: fixed "Bug 537187 - When
- 'interpret tab as reindent' option is set, code templates
- don't work".
-
-2009-09-03 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: fixed c# ambience for nested types
- (they work a bit different now).
-
-2009-09-02 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: Made a better fix for the explicit
- member bug (but a recreation of the code completion database
- is required to make it work).
-
-2009-09-02 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: Fixed failing unit test.
-
-2009-09-02 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: Fixed "Bug 536111 - Nested generic
- types should not show <> on code completion".
-
-2009-09-01 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpNRefactoryASTProvider.cs: Implementet
- parsetypereference.
-
-2009-09-01 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: Fixed "Bug 535187 - Resolver
- result wrong when property name matches type".
-
-2009-08-31 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs: Fixed unit tests.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: Improved attribute output.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs:
- * Parser/CSharpFormatter.cs:
- * Gui/NRefactoryResolver.cs:
- * Parser/NRefactoryParser.cs:
- * Syntax/CSharpSyntaxMode.cs:
- * Parser/FindMemberAstVisitor.cs:
- * Gui/NewCSharpExpressionFinder.cs:
- * Syntax/HighlightPropertiesSemanticRule.cs:
- * Gui/NRefactoryIndexerParameterDataProvider.cs: Fixed unit
- test failures & compiler warnings.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.csproj: Updated dependencies. We now depend on
- gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-26 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: Fixed removing of
- selection for insert/remove indent commands.
-
-2009-08-26 Mike Krüger <mkrueger@novell.com>
-
- * Parser/FindMemberAstVisitor.cs: Optimized find all
- references operation.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBindingCompilerManager.cs: Fixed regex for parsing
- errors. The line+column group is optional in csc.
-
-2009-08-25 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs: Fixed "Bug 533986 - Autoformat:
- issue when pressing enter at the end of a line".
-
-2009-08-25 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: Use GetContent instead
- of casting.
-
-2009-08-25 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: fixed possible null
- reference exception.
-
-2009-08-25 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: Fixed "Bug 533683 - File
- header automatically expanded".
-
-2009-08-25 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryParameterDataProvider.cs:
- * Gui/NRefactoryIndexerParameterDataProvider.cs: Indexer xml
- docs are now displayed.
-
-2009-08-25 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryIndexerParameterDataProvider.cs:
- * Gui/NRefactoryTemplateParameterDataProvider.cs: Worked on
- data providers.
-
-2009-08-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Fix windows build.
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryIndexerParameterDataProvider.cs: Remvoved
- duplicate indexer.
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * Gui/CSharpTextEditorCompletion.cs:
- * Gui/NRefactoryIndexerParameterDataProvider.cs:
- * Gui/NRefactoryTemplateParameterDataProvider.cs: Implemented
- Bug 361573 - Code completion for indexers not working.
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewOverrideCompletionData.cs: Fixed 'Bug 533681 - Method
- overriding always uses full namespaces'.
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * CSharpEnhancedCodeProvider.cs: Track API changes
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewCSharpExpressionFinder.cs: It's now possible to
- determine the parent expression contexts.
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryParameterDataProvider.cs: Fixed "Bug 533369 -
- Overloads should be ordered".
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Fixed "Bug 531035 -
- Automcompleted delegate callback generation for TEventArgs
- could be better".
-
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * Parser/FindMemberAstVisitor.cs: Fixed "Bug 528329 - Find
- class references returns incorrect reference".
-
-2009-08-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/SharpDevelopTree:
- * Parser/LanguageItemVisitor.cs:
- * Parser/CSharpExpressionFinder.cs: Remove unused stuff.
-
-2009-08-15 Mike Krüger <mkrueger@novell.com>
-
- * Parser/FindMemberAstVisitor.cs: Fixed "Bug 531525 -
- Refactoring + Renaming fails for delegate"
-
-2009-08-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.csproj: Don't make local copies of project
- references.
-
-2009-08-04 Mike Krüger <mkrueger@novell.com>
-
- * Syntax/CSharpSyntaxMode.cs: fixed "Bug 527655 - Preprocessor
- disabled code still makes "if" coloured".
-
-2009-08-04 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryParameterDataProvider.cs: Added new line for
- parameterless methods summary documentation.
-
-2009-08-03 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewOverrideCompletionData.cs:
- * FormattingStrategy/CSharpIndentEngine.cs: Fixed "Bug 507668
- - Wrong smart-indentation behavior in monodevelop solution
- itself".
-
-2009-08-03 Mike Krüger <mkrueger@novell.com>
-
- * FormattingStrategy/CSharpIndentEngine.cs: fixed "Bug 527151
- – smart indent: indents "too much" after "new O () { ... }"
- object initialisation without trailing ','".
-
-2009-08-01 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: Fixed "Bug 527338 - Wrong type
- shown in tooltip when param name clashes with field name".
-
-2009-07-31 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewCSharpExpressionFinder.cs: Fixed failing unit test.
-
-2009-07-31 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewCSharpExpressionFinder.cs: Fixed 'Bug 526667 - wrong
- code completion in object initialisation (new O() {...};)'.
-
-2009-07-30 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs:
- * Gui/NRefactoryParameterDataProvider.cs: Worked on xml
- documentation display.
-
-2009-07-30 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: Added null check.
-
-2009-07-29 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs:
- * Parser/FindMemberAstVisitor.cs:
- * Gui/NRefactoryParameterDataProvider.cs:
- * Gui/NRefactoryTemplateParameterDataProvider.cs: Handled
- parameter documentation.
-
-2009-07-29 Mike Krüger <mkrueger@novell.com>
-
- * Parser/NRefactoryParser.cs:
- * Gui/MemberCompletionData.cs: Custom xml documentation is now
- used (Bug 525260 - Custom documentation not shown in code
- completion.).
-
-2009-07-29 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs: Fixed bug in code formatter.
-
-2009-07-29 Mike Krüger <mkrueger@novell.com>
-
- * Parser/FindMemberAstVisitor.cs: Implemented search in xml
- comments for members/types.
-
-2009-07-29 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs:
- * Parser/FindMemberAstVisitor.cs: Implmented search in xml
- documentation (currently this works only for parameters).
-
-2009-07-28 Mike Krüger <mkrueger@novell.com>
-
- * Parser/FindMemberAstVisitor.cs: Fixed possible null
- reference exception.
-
-2009-07-28 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs:
- * Gui/NRefactoryResolver.cs:
- * Syntax/CSharpSyntaxMode.cs:
- * Gui/NewCSharpExpressionFinder.cs: Fixed failing LINQ unit
- tests.
-
-2009-07-28 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs:
- * Gui/NewCSharpExpressionFinder.cs:
- * Gui/CSharpTextEditorIndentation.cs:
- * FormattingStrategy/CSharpIndentEngineStack.cs: Worked on "on
- the fly" code formatting.
-
-2009-07-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Parser/FindMemberAstVisitor.cs: Fixed "Bug 524879 - Rename
- on variable in "using" leaks into other scopes".
-
-2009-07-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Parser/FindMemberAstVisitor.cs: Fixed "Bug 524877 -
- Incomplete rename with on variable declared in foreach
- statements".
-
-2009-07-24 Mike Krüger <mkrueger@novell.com>
-
- * Parser/FindMemberAstVisitor.cs: Fixed "Bug 524873 -
- Parameter renaming problem when type contains parameter
- name".
-
-2009-07-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBindingCompilerManager.cs: Let the runtime find the
- correct compiler path.
-
-2009-07-23 Mike Krüger <mkrueger@novell.com>
-
- * Parser/FindMemberAstVisitor.cs: Fixed "Bug 524318 - Cannot
- rename caught exception declarations".
-
-2009-07-23 Mike Krüger <mkrueger@novell.com>
-
- * Syntax/CSharpSyntaxMode.cs:
- * Parser/FindMemberAstVisitor.cs:
- * Syntax/HighlightPropertiesSemanticRule.cs: Removed debug
- messages.
-
-2009-07-22 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpNRefactoryASTProvider.cs: fixed build.
-
-2009-07-22 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpNRefactoryASTProvider.cs: handled possible
- parser exceptions.
-
-2009-07-22 Mike Krüger <mkrueger@novell.com>
-
- * Syntax/CSharpSyntaxMode.cs: Correctly copying syntax mode
- properties.
-
-2009-07-20 Mike Krüger <mkrueger@novell.com>
-
- * FormattingStrategy/CSharpFormattingPolicy.cs:
- * FormattingStrategy/CSharpFormattingPolicy.xml: Added brace
- forcement pretty print options.
-
-2009-07-20 Mike Krüger <mkrueger@novell.com>
-
- * Parser/FindMemberAstVisitor.cs: Fixed "Bug 523334 - Find
- references misses a field inside a property".
-
-2009-07-17 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpNRefactoryASTProvider.cs: removed debug
- message.
-
-2009-07-16 Mike Krüger <mkrueger@novell.com>
-
- * Syntax/CSharpSyntaxMode.cs: Fixed '#if' section highlighting
- bug with more than one defined symbol separated by ','
-
-2009-07-16 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: C# text editor extension
- can now be reused by the ASP.NET text editor extension.
-
-2009-07-14 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpNRefactoryASTProvider.cs: implemented new parse
- function.
-
-2009-07-09 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpNRefactoryASTProvider.cs: Track api changes.
-
-2009-07-08 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs:
- * Gui/NRefactoryParameterDataProvider.cs: Fixed "Bug 518548 -
- Completion is very annoying on lambda parameters".
-
-2009-07-08 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Fixed partial completion.
-
-2009-07-07 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: Fixed the code completion on
- interface members.
-
-2009-07-06 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs: Fixed automatic namespace import
- (removed redundant newline).
-
-2009-07-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: Added range check (fixes
- a possible exception on del/backspace).
-
-2009-07-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Fixed "Bug 518544 - "new"
- completion after "var" is almost unusably slow".
-
-2009-07-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewOverrideCompletionData.cs:
- * Gui/CSharpTextEditorCompletion.cs: Implemented "Bug 518542 -
- Partial method completion".
-
-2009-07-04 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: Added range check.
-
-2009-07-03 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: Implemented special
- backspace/del behaviour inside strings as suggested by
- lluis.
-
-2009-07-03 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * CSharpBinding.csproj:
- * CSharpBinding.addin.xml:
- * Parser/CSharpFormatter.cs:
- * Parser/CSharpNRefactoryASTProvider.cs: Worked on refactoring
- support.
-
-2009-07-02 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewCSharpExpressionFinder.cs: Fixed "Bug 518547 -
- Property initializer completion populates from wrong type".
-
-2009-06-29 Mike Krüger <mkrueger@novell.com>
-
- * Parser/NRefactoryParser.cs: fixed possible null reference
- exception.
-
-2009-06-24 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs:
- * Gui/CSharpTextEditorIndentation.cs: Overworked the formatted
- text insertion algorithm.
-
-2009-06-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/CSharpFormatter.cs: Use the new DesktopService
- instead of PlatformService.
-
-2009-06-23 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs: Worked on formatter.
-
-2009-06-23 Mike Krüger <mkrueger@novell.com>
-
- * FormattingStrategy/CSharpFormattingPolicy.cs:
- * FormattingStrategy/CSharpFormattingPolicy.xml: Added format
- option for anonymous methods.
-
-2009-06-23 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs:
- * Gui/CSharpTextEditorIndentation.cs: Worked on formatter.
-
-2009-06-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: Added null checks.
-
-2009-06-23 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs:
- * Gui/CSharpTextEditorIndentation.cs: Worked on formatter.
-
-2009-06-22 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs:
- * Gui/CSharpTextEditorIndentation.cs: Fixed tab key multi line
- formatting. worked on formatter.
-
-2009-06-22 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs: Worked on output formatter.
-
-2009-06-22 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs:
- * Gui/CSharpTextEditorIndentation.cs: Fixed template
- insertion/worked on code formatter.
-
-2009-06-19 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs:
- * Gui/CSharpTextEditorIndentation.cs: Worked on code
- formatting
-
-2009-06-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs:
- * Gui/CSharpTextEditorCompletion.cs: Fixed "Bug 514563 -
- Inconsistent treatment of nullable types for comments and
- information".
-
-2009-06-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: Fixed "Bug 514284 - Tab
- key doesn't work for plain text files (with tab as reindent
- option set)".
-
-2009-06-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: fixed "Bug 514283 -
- Using tab to reindent only works from the begining of the
- line".
-
-2009-06-19 Mike Krüger <mkrueger@novell.com>
-
- * templates/AssemblyInfo.xft.xml: Fixed "Bug 513981 - Project
- template causes CS1726 errors".
-
-2009-06-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * CSharpEnhancedCodeProvider.cs: Pass specials to CodeDOM
- visitor so it can collect comments.
-
- * Gui/CompilerOptionsPanelWidget.cs: Don't explode when
- ITypeResolveContext is null.
-
-2009-06-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui\CSharpTextEditorCompletion.cs: Remove debug message.
-
- * Parser\NRefactoryParser.cs: Assign a default visibility flag
- for types which don't have one explicitly set in code.
-
- * templates\GtkSharp2Project.xpt.xml: atk-sharp is a
- dependency of gtk-sharp, so it has to be added too to the
- project (.NET complains about it).
-
-2009-06-18 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs:
- * Gui/NRefactoryResolver.cs:
- * Gui/CSharpTextEditorIndentation.cs:
- * FormattingStrategy/CSharpFormattingPolicy.cs:
- * FormattingStrategy/CSharpFormattingPolicy.xml: Worked on
- code formatting.
-
-2009-06-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/NRefactoryParser.cs: Fix issue with detection of
- generic constraints.
-
-2009-06-18 Mike Krüger <mkrueger@novell.com>
-
- * FormattingStrategy/CSharpFormattingPolicy.cs: Corrected
- default settings
-
-2009-06-15 Mike Krüger <mkrueger@novell.com>
-
- * Parser/FindMemberAstVisitor.cs: Fixed "Bug 504555 - Right
- clicking on a variable name and selecting rename does not
- work properly.".
-
-2009-06-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs:
- * Gui/NRefactoryParameterDataProvider.cs: Fixed "Bug 512820 –
- Different number of overloads reported for same method".
-
-2009-06-12 Mike Krüger <mkrueger@novell.com>
-
- * Syntax/CSharpSyntaxMode.cs: Track api changes.
-
-2009-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/CSharpFormatter.cs: Add support for per-mimetype
- policies.
-
-2009-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * MonoCSharpPolicy.xml:
- * CSharpBinding.addin.xml: Register the c# formatting panel
- and the Mono policy set.
-
- * FormattingStrategy/CSharpFormattingPolicy.cs:
- * FormattingStrategy/CSharpFormattingPolicyPanel.cs: Converted
- to mime-type formatting panel.
-
-2009-06-09 Mike Krüger <mkrueger@novell.com>
-
- * FormattingStrategy/CSharpIndentEngine.cs: Fixed "Bug 510222
- - Newline after colon of conditional does not have correct
- tabbing".
-
-2009-06-09 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: Fixed "Bug 510919 - Code completion
- does not show interface method when not using a local var".
-
-2009-06-09 Mike Krüger <mkrueger@novell.com>
-
- * Parser/FindMemberAstVisitor.cs: Fixed find member visitor
- bug.
-
-2009-06-08 Mike Krüger <mkrueger@novell.com>
-
- * Parser/FindMemberAstVisitor.cs: Fixed "Bug 510771 - Find
- references finds invalid references".
-
-2009-06-05 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * CSharpBinding.addin.xml:
- * Parser/CSharpFormatter.cs:
- * FormattingStrategy/CSharpFormattingPolicy.cs:
- * FormattingStrategy/CSharpFormattingPolicyPanel.cs:
- * FormattingStrategy/CSharpFormattingStyleDefinition.xml:
- Worked on C# formatter it should now fit better in the
- policy system.
-
-2009-06-04 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs:
- * Gui/NRefactoryParameterDataProvider.cs: Fixed "Bug 509620 -
- Auto-completion shows empty constructor when there are no
- constructors available (because of being private)".
-
-2009-06-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.csproj: Set correct resource id.
-
-2009-06-02 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: Fixed "Bug 509019 - Autocomplete for
- new generic of array omits brackets".
-
-2009-06-02 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Fixed "Bug 507063 - XML
- auto-comment doesn't work for indexers or properties".
-
-2009-06-02 Mike Krüger <mkrueger@novell.com>
-
- * Parser/FindMemberAstVisitor.cs: Fixed "Bug 507737 - Renaming
- parameter of method renames parameter occurrences in other
- methods in the same file".
-
-2009-05-25 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am: Corrected makefile.
-
-2009-05-25 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * FormattingStrategy/CSharpFormattingPolicy.cs:
- * FormattingStrategy/CSharpFormattingPolicy.xml: Worked on C#
- formatting policy.
-
-2009-05-25 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Fixed "Bug 506707 - Code
- completion shows fully qualified class names when using
- alias directive is used."
-
-2009-05-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpLanguageBinding.cs: Add support for .net 4.0.
-
- * CSharpBindingCompilerManager.cs: Properly locate the
- compiler when running on MS.NET.
-
-2009-05-14 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * Syntax/CSharpSyntaxMode.cs:
- * Syntax/HighlightPropertiesSemanticRule.cs: Added semantic
- rules to the c# syntax mode.
-
-2009-05-14 Mike Krüger <mkrueger@novell.com>
-
- * Syntax/CSharpSyntaxMode.cs: Worked on preprocessor semantic
- highlighting.
-
-2009-05-14 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/CSharpBinding.CodeGenerationPanelWidget.cs: Applied
- patch Eberhard Beilharz <eb1@sil.org> from (Bug 503410 -
- Can't set warning level to 4).
-
-2009-05-13 Mike Krüger <mkrueger@novell.com>
-
- * Parser/NRefactoryParser.cs:
- * Syntax/CSharpSyntaxMode.cs: Worked on semantic
- highlighting/fixed bug that could cause a crash with invalid
- pre processor if blocks.
-
-2009-05-12 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Syntax/CSharpSyntaxMode.cs: Worked on pre processor semantic
- highlighting.
-
-2009-05-12 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs:
- * Syntax/CSharpSyntaxMode.cs:
- * Gui/CSharpTextEditorCompletion.cs: Fixed 'Bug 501999 -
- Intellisense completion of new array: put cursor inside
- brackets'
-
-2009-05-08 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs:
- * Gui/NRefactoryResolver.cs: Fixed query expression resolving
- bug.
-
-2009-05-08 Mike Krüger <mkrueger@novell.com>
-
- * Syntax:
- * Makefile.am:
- * CSharpBinding.csproj:
- * CSharpBinding.addin.xml:
- * Syntax/CSharpSyntaxMode.cs: Added c# syntax mode.
-
-2009-05-04 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: Fixed a bug that code completion
- shows up for not declared members ("string s; s.c."
- shouldn't complete anymore)
-
-2009-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBindingCompilerManager.cs: Don't use -pkg to reference
- assemblies, use the full assembly path. Don't add the
- default utf8 codepage option when building with csc. Move
- the /noconfig option out of the response file, csc doesn't
- like it. Properly build with csc when targeting MS.NET.
-
-2009-05-04 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Fixed "Bug 500001 – Auto
- XML comment (///) for struct grabs params and returns from
- following function".
-
-2009-05-04 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Fixed "Bug 499819 -
- "true." or "false." doesn't trigger code completion".
-
-2009-05-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/MemberCompletionData.cs: Fix duplicate filtering, so
- that unnecessary "overloads" don't show up.
-
-2009-04-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBindingCompilerManager.cs: Remove unnecessary compiler
- params parsing.
-
-2009-04-28 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs:
- * Gui/EventCreationCompletionData.cs: Fixed/Improved the
- create event handler feature.
-
-2009-04-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBindingCompilerManager.cs: Use correct environment for
- building the project, according to the target runtime.
-
-2009-04-27 Mike Krüger <mkrueger@novell.com>
-
- * CSharpBinding.csproj:
- * Gui/NewOverrideCompletionData.cs: Fixed "Bug 497991 -
- Completion of "overriding" an interface member results in a
- call to base".
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * CSharpBinding.addin.xml: Changed copyright tag.
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * AssemblyInfo.cs: Changed assembly info.
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewOverrideCompletionData.cs: "overriding" interface
- members is now public.
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Fixed 'Bug 495275 -
- override completion popup no longer includes unimplemented
- members from interfaces'.
-
- * Parser/NRefactoryParser.cs:
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * Parser/NRefactoryParser.cs: fixed "Bug 497829 - MD cannot
- open file due to NullReferenceException in C# binding".
-
-2009-04-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * CSharpLanguageBinding.cs: Track comment tag API.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * Gui/EventCreationCompletionData.cs: Track api changes.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * CSharpBinding.csproj: don't require specific gtk-sharp version.
- * Gui/CSharpTextEditorCompletion.cs: fix a csc error.
-
-2009-04-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * CSharpBindingCompilerManager.cs: Use
- ToolsEnvironmentVariables from the current runtime.
-
-2009-04-17 Mike Krüger <mkrueger@novell.com>
-
- * CSharpLanguageBinding.cs:
- * Gui/CodeGenerationPanel.cs:
- * CSharpBindingCompilerManager.cs:
- * Gui/CompilerOptionsPanelWidget.cs:
- * Project/CSharpCompilerParameters.cs: Worked on C# backend
- binding.
-
-2009-04-17 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * CSharpBinding.addin.xml:
- * CSharpLanguageBinding.cs:
- * icons/csharp-project-16.png: Removed icon service.
-
-2009-04-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBindingCompilerManager.cs: Moved SystemAssemblyService
- and related classes to the namespace
- MonoDevelop.Core.Assemblies.
-
-2009-04-16 Mike Krüger <mkrueger@novell.com>
-
- * FormattingStrategy/CSharpIndentEngine.cs: fixed 'Bug 494568
- - Indentation after C# labels is wrong.'.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * CSharpBinding.addin.xml: Bump MD version.
-
-2009-04-09 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed "Bug 429034 - Class alias
- completion not working properly".
-
-2009-04-09 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Parser/FindMemberAstVisitor.cs: Fixed "Bug 493202 - List
- References on private constructor yields nothing".
-
-2009-04-08 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: Activated virtual
- leading whitespace feature.
-
-2009-04-08 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: Fixed possible null ref
- exception.
-
-2009-04-07 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs:
- * Parser/NRefactoryParser.cs:
- * Gui/NRefactoryTemplateParameterDataProvider.cs: Added name
- validator (for Bug 414735 - Rename refactoring should not
- allow invalid names).
-
-2009-04-07 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs: Implemented "Bug 492675 - New line
- & ; at end of line".
-
-2009-04-06 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs: fixed bug in add namespace import
- method.
-
-2009-04-06 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs: AddNamespace import is now atomar.
-
-2009-04-06 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs:
- * Gui/NRefactoryResolver.cs: Added "resolve namespace"
- feature.
-
-2009-04-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed "Bug 438696 - Error
- in text editor extension chain.".
-
-2009-04-03 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Implemented "Bug 325527 -
- Make C# intellisense smarted for base classes".
-
-2009-04-03 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs:
- * Gui/MemberCompletionData.cs:
- * Gui/NRefactoryParameterDataProvider.cs: Added some tooltip
- formatting. Extension methods are marked. Method description
- is shown in the parameter window.
-
-2009-04-02 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs:
- * Gui/NRefactoryResolver.cs: Fixed "Bug 491020 - Wrong typeof
- intellisense".
-
-2009-04-02 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs:
- * Gui/NRefactoryResolver.cs: Fixed "Bug 491017 - No
- intellisense for static LINQ queries".
-
-2009-04-02 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: Fixed failing unit test.
-
-2009-04-01 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: removed debug messages.
-
-2009-04-01 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed "Bug 491016 - No
- intellisense for lambdas inside linq query".
-
-2009-04-01 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Added "var" to the
- completion list.
-
-2009-04-01 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed "Bug 487226 - No
- intellisense in LINQ queries" - 2.
-
-2009-04-01 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed "Bug 487237 - Broken lambda
- intellisense".
-
-2009-04-01 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed "Bug 487226 - No
- intellisense in LINQ queries".
-
-2009-03-31 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: Worked on C#3 lambda resolving.
-
-2009-03-30 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Removed debug message.
-
-2009-03-30 Mike Krüger <mkrueger@novell.com>
-
- * Parser/NRefactoryParser.cs: implemented 'Bug 363627 - MD
- text editor does not show folding symbols for preprocessor
- directives'.
-
-2009-03-30 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs:
- * Gui/NRefactoryTemplateParameterDataProvider.cs: Implemented
- "Bug 324888 - Auto complete not activating in generics".
-
- * Makefile.am:
- * CSharpBinding.csproj:
-
-2009-03-30 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Implemented "Bug 324989 -
- code completion doesn't strip off 'Attribute' part in
- Attributes".
-
-2009-03-27 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: Added 'from ... group ... into
- VAR' case.
-
-2009-03-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs:
- * Gui/NRefactoryResolver.cs:
- * Gui/NewCSharpExpressionFinder.cs: Worked on lambda resolving
- (fixing bug 'Bug 487203 - Extension methods not working').
-
-2009-03-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs: Fixed "Bug 487209 - Incorrent
- intellisense for partial methods".
-
-2009-03-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: Fixed "Bug 487218 - var does not work
- with arrays".
-
-2009-03-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: fixed "Bug 487228 - No intellisense
- for implicit arrays".
-
-2009-03-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewCSharpExpressionFinder.cs: Fixed "Bug 487236 - Object
- initializer completion uses wrong type".
-
-2009-03-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Fixed "Bug 487246 - No
- intellisense for extension methods".
-
-2009-03-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: Fixed possible null ref.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewCSharpExpressionFinder.cs: Added support for
- contextual templates.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs: Fixed Header.
-
-2009-03-21 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/MemberCompletionData.cs: Worked on template callbacks.
-
-2009-03-21 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/NewCSharpExpressionFinder.cs:
- * Gui/NewOverrideCompletionData.cs:
- * Gui/EventCreationCompletionData.cs:
- * Gui/NRefactoryParameterDataProvider.cs: Fixed compilation
- error.
-
-2009-03-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/GtkSharp2Project.xpt.xml: Don't require specific
- GTK# versions.
-
-2009-03-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/CSharpTextEditorCompletion.cs: Track API changes.
-
- * Gui/CSharpTextEditorIndentation.cs: changed naming.
-
-2009-03-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: Fix build.
-
-2009-03-17 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: Fixed caret end pos.
-
-2009-03-17 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs:
- * FormattingStrategy/CSharpIndentEngine.cs: Added auto string
- concat when return is hit inside a string.
-
-2009-03-17 Mike Krüger <mkrueger@novell.com>
-
- * Parser/NRefactoryParser.cs: Renamed method.
-
-2009-03-17 Mike Krüger <mkrueger@novell.com>
-
- * Parser/NRefactoryParser.cs: fixed 'Bug 485783 - Class/method
- navigation bar doesn't honor "Define symbols:" project
- setting when parsing file'.
-
-2009-03-17 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs:
- * Parser/NRefactoryParser.cs: Track API changes.
-
-2009-03-17 Mike Krüger <mkrueger@novell.com>
-
- * Parser/FindMemberAstVisitor.cs: fixed 'Bug 485610 - Can't
- rename a variable'.
-
-2009-03-16 Mike Krüger <mkrueger@novell.com>
-
- * FormattingStrategy/CSharpFormattingStyleDefinition.xml:
- Added option categories.
-
-2009-03-16 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Added new code completion
- context (local variable naming proposal).
-
-2009-03-16 Mike Krüger <mkrueger@novell.com>
-
- * FormattingStrategy/CSharpFormattingStyleDefinition.xml:
- Added place in new line options.
-
-2009-03-15 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpFormatter.cs:
- * FormattingStrategy/CSharpFormattingStyleDefinition.xml:
- Worked on code formatting.
-
-2009-03-15 Mike Krüger <mkrueger@novell.com>
-
- * FormattingStrategy/CSharpFormattingStyleDefinition.xml:
- Added some formatting options.
-
-2009-03-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * CSharpBinding.csproj: Don't local-copy project refs.
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * FormattingStrategy/CSharpFormattingStyleDefinition.xml:
- Added some options.
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * CSharpBinding.csproj: Moved text editor to core
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * CSharpBinding.addin.xml:
- * Parser/CSharpFormatter.cs:
- * FormattingStrategy/CSharpFormattingStyleDefinition.xml:
- Worked on code formatting.
-
-2009-03-12 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * CSharpBinding.addin.xml:
- * Parser/CSharpFormatter.cs:
- * FormattingStrategy/CSharpFormattingStyleDefinition.xml:
- Worked on code formatter.
-
-2009-03-11 Mike Krüger <mkrueger@novell.com>
-
- * FormattingStrategy/CSharpFormattingStyleDefinition.xml:
- Worked on code formatting.
-
-2009-03-10 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * CSharpBinding.addin.xml:
- * FormattingStrategy/CSharpFormattingStyleDefinition.xml:
- Added format style definition
-
-2009-03-10 Mike Krüger <mkrueger@novell.com>
-
- * Parser/NRefactoryParser.cs: fixed comment position.
-
-2009-03-10 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: added new constructor.
-
-2009-03-10 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * CSharpBinding.csproj:
- * Gui/NewCSharpExpressionFinder.cs: Updated nrefactory
- references.
-
-2009-03-05 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: Handled output of anonymous types.
-
-2009-03-05 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: fixed type name.
-
-2009-03-05 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
-
- * Gui/ResolveVisitor.cs: Using new anonymous type
- representation.
-
-2009-03-05 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs:
- * Gui/NRefactoryResolver.cs:
- * FormattingStrategy/CSharpIndentEngine.cs: Worked on lambda
- code completion.
-
-2009-03-03 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs:
- * Gui/CSharpTextEditorCompletion.cs: Worked on icons for
- parameters/local variables and keywords.
-
-2009-03-03 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewCSharpExpressionFinder.cs: added bounds check.
-
-2009-03-02 Mike Krüger <mkrueger@novell.com>
-
- * Parser/FindMemberAstVisitor.cs: fixed "Bug 480492 - Find
- field references returns incorrect references".
-
-2009-02-27 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/NewCSharpExpressionFinder.cs:
- * Gui/CSharpTextEditorCompletion.cs: Fixed "Bug 479983 - No C#
- completion for object initializers".
-
-2009-02-27 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed "Bug 479986 -
- Incorrect new completion for var".
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.csproj: Flush.
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * md1format.xml:
- * CSharpBindingCompilerManager.cs:
- * Project/CSharpCompilerParameters.cs: Added support for
- WarningsNotAsErrors, although there is no gui for setting it
- because it is not supported by mcs.
-
-2009-02-26 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryParameterDataProvider.cs: fixed 'Bug 479757 -
- Parameters of a Method when opening Parenthesis result in a
- blank "Tooltip".'
-
-2009-02-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * CSharpBinding.addin.xml: Register CSharpProjectParameters as
- serializable.
-
-2009-02-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * md1format.xml:
- * gtk-gui/gui.stetic:
- * CSharpBinding.csproj:
- * CSharpLanguageBinding.cs:
- * CSharpBindingCompilerManager.cs:
- * Gui/CompilerOptionsPanelWidget.cs:
- * Project/CSharpProjectParameters.cs:
- * Project/CSharpCompilerParameters.cs:
- * gtk-gui/CSharpBinding.CompilerOptionsPanelWidget.cs: Moved
- some properties from configuration parameters to project
- parameters.
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CompilerOptionsPanelWidget.cs: Changed override Destroy
- --> override OnDestroyed.
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Parser/FindMemberAstVisitor.cs: fixed "Bug 427453 - The
- rename operations are not working (for local variables)"
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CompilerOptionsPanelWidget.cs: worked on ressource
- de-allocation.
-
-2009-02-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: Fixed 'Bug 472597 - New completion
- does not include array types'.
-
-2009-02-24 Mike Krüger <mkrueger@novell.com>
-
- * Parser/NRefactoryParser.cs: fixed "Bug 478702 - Underline on
- syntax error not working properly when using preprocessor
- directives and inheritance".
-
-2009-02-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: Added support for some undocumented
- keywords.
-
-2009-02-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewCSharpExpressionFinder.cs: Removed debug message.
-
-2009-02-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs:
- * Gui/NewOverrideCompletionData.cs: Fixed "Bug 478703 -
- Override completion fails to include parameter modifiers in
- method generation".
-
-2009-02-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs:
- * Gui/NRefactoryResolver.cs: Fixed some type resolving issues.
-
-2009-02-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: Fixed failing unit test.
-
-2009-02-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed inner type access issues.
-
-2009-02-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/NewCSharpExpressionFinder.cs:
- * Gui/CSharpTextEditorCompletion.cs: Handled
- AttributeArguments context. Fixing bug 'Bug 478490 -
- Autocomplete Attribute Properties'.
-
-2009-02-21 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: fixed "Bug 472104 -
- Cursor misplaced when pressing tab".
-
-2009-02-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Parser/FindMemberAstVisitor.cs: Fixed "Bug 477374 - Find
- references... doesn't find all references".
-
-2009-02-19 Mike Krüger <mkrueger@novell.com>
-
- * Parser/NRefactoryParser.cs: enum fields now have the correct
- return type.
-
-2009-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs: Fixed "Bug 404706 - Refactorer is
- not aware of existing regions when inserting members".
-
-2009-02-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBindingCompilerManager.cs: Track api changes.
-
- * Project/CSharpResourceIdBuilder.cs: Allow line breaks when
- reading literals.
-
-2009-02-17 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 434979 -
- Automagic insertion of XML comments doesn't work as
- intended'.
-
-2009-02-16 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: Removed double space in namespace
- output.
-
-2009-02-16 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Parser/FindMemberAstVisitor.cs: Fixed bug "Bug 325171 -
- Rename fails with overloads".
-
-2009-02-16 Mike Krüger <mkrueger@novell.com>
-
- * Parser/FindMemberAstVisitor.cs: Fixed "Bug 391066 - Rename
- not offered for generic classes".
-
-2009-02-13 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: fixed type output issues in the c#
- ambience.
-
-2009-02-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpLanguageBinding.cs:
- * Parser/NRefactoryParser.cs:
- * CSharpBindingCompilerManager.cs: Track API changes. Use the
- new ProjectItem collection.
-
-2009-02-11 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed test case 470954_bis
-
-2009-02-11 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed "Bug 474447 - Wrong
- completion of namespaces".
-
-2009-02-11 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: Optimized ResolveIdentifier and
- prevented endless loop.
-
-2009-02-11 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed "Bug 470954 - using
- System.Windows.Forms is not honored".
-
-2009-02-10 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/MemberCompletionData.cs:
- * Gui/CSharpTextEditorCompletion.cs: Fixed "Bug 350862 -
- Autocomplete bug with enums".
-
-2009-02-10 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed small namespace access bug.
-
-2009-02-10 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: worked on is/as
- completion.
-
-2009-02-10 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewCSharpExpressionFinder.cs:
- * Gui/CSharpTextEditorCompletion.cs: Added new "<Type> x = y
- as $" completion case.
-
-2009-02-09 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: now using
- IsAccessibleFrom for constructor accessible tests (for more
- complex cases than bug 473849).
-
-
-2009-02-09 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed "Bug 473849 -
- Classes with no visible constructor shouldn't appear in
- "new" completion".
-
-2009-02-09 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed "Bug 473686 - Constants are
- not included in code completion".
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * CSharpBinding.csproj: Don't local-copy other addins' dlls.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Rename a couple of
- variables, as csc is more picky about multiple locals with
- the same name in switches.
-
- * gtk-gui/gui.stetic: Updated.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * CSharpBinding.csproj: Don't treat warning as errors, because
- csc still outputs warnings for this project.
-
-2009-02-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 472092 -
- 'yield return new' includes incaccessible members'.
-
-2009-02-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: Fixing C#3 query expressions.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.mds:
- * CSharpBinding.mdp:
- * CSharpBinding.csproj: Migrated to MSBuild file format.
-
-2009-02-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/MemberCompletionData.cs: Avoid an InvalidCastException
- in the case where an overloads's member is not the same type
- as the main member. Not sure why this would happen, but it
- just did.
-
-2009-02-05 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * Gui/MemberCompletionData.cs:
-
- * Gui/NewCSharpExpressionFinder.cs: fixed 'Bug 471937 - Code
- completion of 'new' showing invorrect entries'.
-
-2009-02-05 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: fixed "Bug 472714 -
- MonoDevelop automatic indentation does not follow "Convert
- tabs to spaces" option".
-
-2009-02-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/MemberCompletionData.cs: Better sorting of overloads.
-
-2009-02-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/MemberCompletionData.cs: Don't auto-insert <T>. Sort
- overloads. Always display <> in the name when there is a
- generic overload.
-
-2009-02-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpAmbience.cs: Handle HideGenericParameterNames
- flag.
-
-2009-02-04 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: fixed "Bug 466719 - Code completion
- doesn't activate with '.' inside expression using '::'
- operator.".
-
-2009-02-04 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed "Bug 469910 -
- Incorrect type resolution on attributes".
-
-2009-02-04 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed 'Bug 471935 - Code
- completion window not showing in MD1CustomDataItem.cs'.
-
-2009-02-03 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: disabled caret beyond
- eol feature.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * CSharpBinding.addin.xml: Bump MD version.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.mdp:
- * gtk-gui/gui.stetic: Fix target gtk# version.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.mdp:
- * gtk-gui/CSharpBinding.CompilerOptionsPanelWidget.cs:
- Updated.
-
-2009-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/CSharpResourceIdBuilder.cs: Track api changes.
-
-2009-01-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.mdp:
- * Autotools/Makefile.am:
- * Gui/CSharpAmbience.cs:
- * Parser/NRefactoryParser.cs:
- * Parser/FindMemberAstVisitor.cs:
- * Gui/CSharpTextEditorCompletion.cs: Add support for constraints in
- generic methods.
-
-2009-01-30 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: Added virtual spaces based on
- indentation level.
-
-2009-01-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/NRefactoryParser.cs: Track api changes.
-
-2009-01-27 Mike Krüger <mkrueger@novell.com>
-
- * Parser/mcs:
- * Makefile.am:
- * Parser/mcs/mcs:
- * CSharpBinding.mdp:
- * Parser/mcs/dom.cs:
- * gtk-gui/gui.stetic:
- * Parser/mcs/mcs/PLAN:
- * Parser/mcs/mcs/TODO:
- * Parser/mcs/External:
- * Parser/mcs/mcs/NOTES:
- * gtk-gui/generated.cs:
- * Parser/mcs/mcs/OTODO:
- * Parser/mcs/mcs/README:
- * Gui/ResolveVisitor.cs:
- * Parser/mcs/mcs/doc.cs:
- * Parser/mcs/mcs/linq.cs:
- * Parser/mcs/mcs/mcs.sln:
- * Parser/mcs/mcs/enum.cs:
- * Parser/mcs/mcs/decl.cs:
- * Parser/mcs/mcs/const.cs:
- * Parser/mcs/mcs/OPTIMIZE:
- * Parser/mcs/mcs/cfold.cs:
- * Parser/mcs/mcs/ecore.cs:
- * Parser/mcs/mcs/Makefile:
- * Parser/mcs/cs-parser.cs:
- * Parser/CodeGenerator.cs:
- * Parser/mcs/mcs/gmcs.sln:
- * Parser/mcs/mcs/class.cs:
- * Parser/mcs/mcs/assign.cs:
- * Parser/mcs/mcs/ChangeLog:
- * Parser/mcs/mcs/driver.cs:
- * Parser/mcs/mcs/lambda.cs:
- * Parser/mcs/mcs/report.cs:
- * Parser/mcs/mcs/support.cs:
- * Parser/mcs/mcs/codegen.cs:
- * Parser/mcs/mcs/generic.cs:
- * Gui/NRefactoryResolver.cs:
- * Parser/mcs/mcs/convert.cs:
- * Parser/mcs/mcs/pending.cs:
- * Parser/mcs/mcs/literal.cs:
- * Parser/mcs/mcs/mcs.csproj:
- * Parser/mcs/mcs/constant.cs:
- * Parser/mcs/mcs/nullable.cs:
- * Parser/mcs/mcs/gmcs.csproj:
- * Parser/mcs/mcs/delegate.cs:
- * Parser/mcs/mcs/location.cs:
- * Parser/mcs/mcs/lambda.todo:
- * Parser/mcs/mcs/parameter.cs:
- * Parser/mcs/mcs/compiler.doc:
- * Parser/mcs/mcs/modifiers.cs:
- * Parser/mcs/mcs/namespace.cs:
- * Parser/mcs/mcs/anonymous.cs:
- * Parser/mcs/mcs/statement.cs:
- * Parser/mcs/mcs/iterators.cs:
- * Parser/mcs/mcs/attribute.cs:
- * Parser/mcs/mcs/roottypes.cs:
- * Parser/mcs/mcs/expression.cs:
- * Parser/mcs/mcs/cs-parser.jay:
- * Parser/mcs/mcs/generic-mcs.cs:
- * Parser/mcs/mcs/mcs.exe.config:
- * Parser/mcs/mcs/typemanager.cs:
- * Parser/mcs/mcs/rootcontext.cs:
- * Parser/mcs/mcs/flowanalysis.cs:
- * Parser/mcs/mcs/symbolwriter.cs:
- * Parser/mcs/mcs/gmcs.exe.config:
- * Parser/mcs/mcs/cs-tokenizer.cs:
- * Parser/mcs/mcs/mcs.exe.sources:
- * Parser/mcs/mcs/AssemblyInfo.cs:
- * Parser/mcs/mcs/gmcs.exe.sources:
- * Parser/mcs/mcs/doc-bootstrap.cs:
- * Parser/mcs/mcs/smcs.exe.sources:
- * Gui/CSharpTextEditorCompletion.cs:
- * Gui/CSharpTextEditorIndentation.cs:
- * Parser/mcs/mcs/smcs.exe.sources-xml:
- * Parser/mcs/External/CryptoConvert.cs:
- * Parser/mcs/External/MonoSymbolFile.cs:
- * Gui/NRefactoryParameterDataProvider.cs:
- * Parser/mcs/External/MonoSymbolTable.cs:
- * Parser/mcs/External/MonoSymbolWriter.cs:
- * gtk-gui/CSharpBinding.FormattingPanelWidget.cs:
- * gtk-gui/CSharpBinding.CodeGenerationPanelWidget.cs:
- * gtk-gui/CSharpBinding.CompilerOptionsPanelWidget.cs: Removed unused
- code. Fixed compiler warnings.
-
-2009-01-27 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: Fixed an unneccessary space printing before for
- type names (affected code completion as well).
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * CSharpBinding.mdp:
- * gtk-gui/gui.stetic:
- * Autotools/Autotools.mdp: Flush project format changes.
-
-2009-01-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/ResolveVisitor.cs:
- * Gui/NRefactoryResolver.cs:
- * Parser/NRefactoryParser.cs:
- * Gui/NewCSharpExpressionFinder.cs:
- * Gui/CSharpTextEditorCompletion.cs:
- * Gui/NRefactoryParameterDataProvider.cs: Provide the calling class in
- all type queries. It is required to resolve generic arguments.
-
- * CSharpBinding.mdp: Updated.
-
-2009-01-27 Ankit Jain <jankit@novell.com>
-
- Fix bug #352703.
- * CSharpBindingCompilerManager.cs (Compile): Format define symbols list
- to be semi-colon separated.
-
-2009-01-26 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: Handled invalid endpos.
-
-2009-01-23 Mike Krüger <mkrueger@novell.com>
-
- * Parser/NRefactoryParser.cs: Corrected delegate location.
-
- * Gui/CSharpAmbience.cs: Attribute postfix no longer print when
- outputting attributes.
-
-2009-01-21 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 464788 - Variable shows
- up twice in completion list.'.
-
-2009-01-21 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed 'Bug 464787 - completion doesn't
- update fast enough'.
-
-2009-01-20 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Parser/NRefactoryParser.cs: Added support for explicit events. Fixing
- bug "Bug 467507 - No completion of base members inside explicit
- events".
-
-2009-01-16 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: Handled theoretical null ref exception (But
- I wasn't able to produce a test case).
-
-2009-01-16 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed "Bug 466694 - Generic type parameters
- missing from completion".
-
-2009-01-16 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Fixed 'Bug 466692 - Missing
- completion for return/break keywords after yield'.
-
-2009-01-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: fixed 'Bug 466337 - Incorrect intelisense for
- class attribute'.
-
-2009-01-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed "Bug 466329 - Autocomplete
- doesn't activate with "_"".
-
-2009-01-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: worked on csharpambience markup.
-
-2009-01-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 466149 - Code completion
- activates inside a string.'.
-
-2009-01-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Added global keyword. Fixing 'Bug 466063 - Missing keyword
- 'global' from code completion'.
-
-2009-01-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/MemberCompletionData.cs:
- * Gui/CSharpTextEditorCompletion.cs: Performance optimizations in
- AddCompletionData. Reduce calls to Ambience.GetString.
-
- * Gui/CSharpAmbience.cs: Optimizations. In Visit(IType), avoid creating
- a StringBuilder when the result is just the class name.
-
-2009-01-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/CSharpTextEditorCompletion.cs: Track api changes.
-
-2009-01-09 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs:
- * Gui/NRefactoryResolver.cs:
- * Parser/NRefactoryParser.cs:
- * Parser/FindMemberAstVisitor.cs: Worked on refactoring code/fixing Bug
- 456576 - refactor: rename field is not working.
-
-2009-01-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Fix warning.
-
- * md1format.xml:
- * Project/CSharpCompilerParameters.cs: Store the LangVersion string
- using the msbuild format. For MD1, use the old format. Fixes bug
- #461104 - Setting C# language version on project does not parse in
- VS.Net 2008.
-
-2009-01-07 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: Worked on on the fly type resolving.
-
-2009-01-07 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: fixed "Bug 463783 - Method Navigator does not
- show indexer parameters".
-
-2009-01-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: Corrected variable scope.
-
-2009-01-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed 'Bug 457237 - code completion doesn't
- show static methods when setting global variable'.
-
-2009-01-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed 'Bug 457003 - code completion shows
- variables out of scope'.
-
-2009-01-05 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: Fixed unit test for bug 323283.
-
-2009-01-05 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: Fixed anonymous class unit test.
-
-2009-01-05 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed "Bug 460234 - Invalid options
- shown when typing 'override'".
-
-2008-12-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs:
- * Gui/NRefactoryParameterDataProvider.cs: Optimize
- GetParameterCompletionCommandOffset. It was a cause of important
- slowdowns in the editor when pressing return.
-
-2008-12-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Optimized. Do nothing in
- HandleParameterCompletion unless the char is going to trigger a
- parameter completion.
-
- * md1format.xml: Added missing property.
-
- * CSharpBindingCompilerManager.cs: Improve error message when an
- assembly is not found.
-
- * gtk-gui/gui.stetic: Update.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.mdp:
- * Autotools/Autotools.mdp: All projects now require fx 3.5.
-
-2008-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBindingCompilerManager.cs:
- * Autotools/CSharpAutotoolsSetup.cs: Track API changes.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.mdp: Don't require a specific version of Mono.Addins.
-
-2008-12-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs:
- * Gui/CSharpTextEditorIndentation.cs: Track api changes.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/MemberCompletionData.cs: Use full names in the description of the
- members. Fixes bug #450931 - Autocomplete without namespaces is
- confusing.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * AssemblyInfo.cs:
- * CSharpBinding.mdp: Add AssemblyInfo.cs files that are autogenerated
- from the addin manifests.
-
-2008-11-29 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs:
- * Gui/MemberCompletionData.cs:
- * Gui/NewOverrideCompletionData.cs:
- * Gui/NRefactoryParameterDataProvider.cs: Refactored
- ambiences/domoutputvisitor.
-
-2008-11-28 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: taken back last change.
-
-2008-11-28 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: added strongly typed overloads for getstring.
-
-2008-11-27 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: Worked on c# ambience.
-
-2008-11-26 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: fixed some ambience bugs.
-
-2008-11-25 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs: fixed 'Bug 434240 - Cannot explicitly
- implement events'.
-
-2008-11-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 447985 - Exception
- display tip is inaccurate for derived (custom) exceptions'.
-
-2008-11-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpAmbience.cs: Don't try to prepend a return type to
- finalisers.
-
-2008-11-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpAmbience.cs: Format finalisers correctly.
-
-2008-11-19 Mike Krüger <mkrueger@novell.com>
-
- * Parser/NRefactoryParser.cs: fixed folding region bug.
-
-2008-11-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: worked on c# ambience.
-
-2008-11-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs:
- * Gui/CSharpTextEditorCompletion.cs: worked on "Bug 444547 - Invalid
- options shown when completing 'new' operator".
-
-2008-11-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed 'Bug 444911 - Refactor options not
- shown'.
-
-2008-11-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs:
- * Gui/NRefactoryParameterDataProvider.cs: fixed 'Bug 444463 - Function
- completion lacks 'out' keywords in params'.
-
-2008-11-19 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs: fixed 'Bug 446177 - Encapsulate field
- operation renames incorrect variable names in external files'.
-
-2008-11-19 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs: fixed 'Bug 445774 - Renaming class badly
- broken; results in many errors'.
-
-2008-11-18 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryParameterDataProvider.cs: fixed 'Bug 444112 - Generic
- parameters missing in code completion'.
-
-2008-11-18 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs: fixed 'Bug 355948 - Rename refactoring does
- not rename within #ifdef blocks'.
-
-2008-11-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBindingCompilerManager.cs: Don't add the codepage:utf8 option if
- the user selected another codepage. Fix by Ernesto Carrea.
-
-2008-11-17 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 444542 - Weird options
- shown for 'as' operator'.
-
-2008-11-17 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed 'Bug 444538 - Namespaces missing when
- completing 'new' operator'.
-
-2008-11-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/MemberCompletionData.cs: Remove unused code.
-
-2008-11-14 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: fixed 'Bug 444110 - Code completion doesn't
- activate'.
-
-2008-11-14 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: Fixed full namespace display of members.
-
- * Gui/CSharpTextEditorCompletion.cs: Worked on new completion.
-
-2008-11-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Fix completion location off-by-one.
- Fixes extra char that was added at end of namespaces.
-
-2008-11-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/CSharpTextEditorCompletion.cs: Move template completion code to
- MonoDevelop.Ide.
-
- * Makefile.am:
- * CSharpBinding.mdp: Updated.
-
- * Gui/CodeTemplateCompletionData.cs: Unused, remove.
-
-2008-11-12 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/CodeTemplateCompletionData.cs: Added double tab templates.
-
-2008-11-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * Autotools/Makefile.am: Fix issue with parallel building.
-
- * Gui/MemberCompletionData.cs: Don't use the description to
- differentiate overloads, since it has to query info from monodoc and
- that's very slow. Use the help url instead, which seems to work fine
- as id.
-
-2008-11-12 Mike Krüger <mike@icsharpcode.net>
-
- * Gui/MemberCompletionData.cs:
- * Gui/CodeTemplateCompletionData.cs:
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 443493 - C# completion
- should not trigger at start of existing words'.
-
-2008-11-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Track fix in text editor's
- completion line/col indexing. It's now 1-indexed, as it should be.
- Allow triggering after ( and {. Don't aggressively trigger before a
- non-whitespace/punctuation char. Replace "location" field with
- parameter usage, so it's easier to follow the usage. Refactor out
- some expression finder creation so it's all done in one place.
-
-2008-11-11 Mike Krüger <mike@icsharpcode.net>
-
- * Gui/MemberCompletionData.cs: fixed 'Bug 441621 - Ctrl-space in middle
- of word does not overwrite rest of word'.
-
-2008-11-11 Mike Krüger <mike@icsharpcode.net>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed completion popup for
- string/char literals.
-
-2008-11-11 Mike Krüger <mike@icsharpcode.net>
-
- * Gui/NewOverrideCompletionData.cs:
- * Gui/CSharpTextEditorCompletion.cs: fixed "Bug 442728 - Code completion
- for 'override' is not aware of namespaces".
-
-2008-11-11 Mike Krüger <mike@icsharpcode.net>
-
- * Gui/CSharpTextEditorCompletion.cs:
- * FormattingStrategy/CSharpIndentEngine.cs: fixed 'Bug 443453 -
- Parameter completion and comments'.
-
-2008-11-11 Mike Krüger <mike@icsharpcode.net>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 443493 - C# completion
- should not trigger at start of existing words'.
-
-2008-11-10 Mike Krüger <mike@icsharpcode.net>
-
- * Gui/CSharpTextEditorCompletion.cs: Added enable auto completion
- option.
-
-2008-11-07 Mike Krüger <mike@icsharpcode.net>
-
- * Parser/CodeGenerator.cs:
- * Gui/NRefactoryResolver.cs:
- * Parser/NRefactoryParser.cs: fixed 'Bug 364779 - When I click "Find All
- References" monodevevlop crashes'.
-
-2008-11-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/NRefactoryResolver.cs: Disable debug message.
-
-2008-11-06 Mike Krüger <mike@icsharpcode.net>
-
- * Gui/NRefactoryResolver.cs: fixed 'Bug 442127 - "Find all references"
- hit uncancelable infinite loop, 100% CPU'.
-
-2008-11-06 Mike Krüger <mike@icsharpcode.net>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/CodeTemplateCompletionData.cs:
- * Gui/CSharpTextEditorCompletion.cs: Code templates are now shown in
- code completion list, when auto insert is enabled.
-
-2008-11-06 Mike Krüger <mike@icsharpcode.net>
-
- * Gui/NRefactoryResolver.cs: fixed 'Bug 442047 - 'Go to declaration'
- missing for vars'.
-
-2008-11-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Return mutable completion lists
- when appropriate. Fixes Bug 440641 - "Parsing files" message not
- shown anymore in the completion window.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml: Bump MD version.
-
-2008-11-05 Mike Krüger <mike@icsharpcode.net>
-
- * Gui/ResolveVisitor.cs:
- * Parser/NRefactoryParser.cs: fixed bug 'Bug 441671 - Finalisers show up
- in code completion'.
-
-2008-11-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CompilerOptionsPanelWidget.cs: Disable CompileTarget and MainClass
- setting when project.IsLibraryBasedProjectType. Prevents messing up
- ASP.NET and Moonlight projects.
-
-2008-11-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBindingCompilerManager.cs:
- * Gui/CompilerOptionsPanelWidget.cs: Allow setting the Main class for
- libraries.
-
-2008-11-04 Mike Krüger <mike@icsharpcode.net>
-
- * Parser/CodeGenerator.cs: worked on refactoring.
-
-2008-11-04 Mike Krüger <mike@icsharpcode.net>
-
- * Parser/CodeGenerator.cs: Worked on refactoring.
-
-2008-11-04 Mike Krüger <mike@icsharpcode.net>
-
- * Parser/CodeGenerator.cs: fixed 'Bug 404906 - variable refactor -> rename freezes MD'.
-
-2008-11-03 Mike Krüger <mike@icsharpcode.net>
-
- * Parser/CodeGenerator.cs:
- * Gui/NRefactoryResolver.cs: worked on refactoring operations.
-
-2008-11-03 Mike Krüger <mike@icsharpcode.net>
-
- * Gui/NRefactoryParameterDataProvider.cs: fixed 'Bug 439960 - Return
- type not shown in tool tip'.
-
-2008-10-31 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: fixed bug in parameter output.
-
-2008-10-31 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs:
- * Gui/NRefactoryResolver.cs:
- * Gui/CSharpTextEditorCompletion.cs:
- * Gui/NRefactoryParameterDataProvider.cs: fixed 'Bug 439963 - Lacking
- members in code completion'
-
-2008-10-31 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed possible null reference.
-
-2008-10-30 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewCSharpExpressionFinder.cs:
- * Gui/CSharpTextEditorCompletion.cs: worked on "new" completion.
-
-2008-10-30 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/NewCSharpExpressionFinder.cs: Worked on "new" completion.
-
-2008-10-30 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/NRefactoryParameterDataProvider.cs: fixed 'Bug 432438 - Incorrect
- autocomplete for delegates'.
-
-2008-10-30 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/CSharpTextEditorCompletion.cs: Fixed 'Bug 432434 - Code completion
- doesn't work with subclasses'.
-
-2008-10-30 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 436312 - Couldn't deal
- well with elements which have generic and non-generic presence at the
- same time'.
-
-2008-10-30 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed duplicate member bug.
-
-2008-10-30 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 436705 - code completion
- for constructors does not handle class name collisions properly'.
-
-2008-10-30 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: using type reference parsing for object
- creation.
-
-2008-10-30 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 432434 - Code completion
- doesn't work with subclasses'.
-
-2008-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBindingCompilerManager.cs: Write the comand used for compiling
- to the output. Fixes bug #430499.
-
-2008-10-29 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed bug 'Bug 439601 - Intellisense Broken
- For Partial Classes'.
-
-2008-10-28 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed 'Bug 325173 - Clashes resolved
- incorrectly'.
-
-2008-10-28 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs:
- * Gui/NRefactoryParameterDataProvider.cs: fixed 'Bug 439446 - Invoking
- events has extra completion options'.
-
-2008-10-28 Mike Krüger <mkrueger@novell.com>
-
- * CSharpBinding.addin.xml: removed old ambience reference.
-
-2008-10-28 Mike Krüger <mkrueger@novell.com>
-
- * CSharpBinding.addin.xml: moved ambience extension node to project
- model.
-
-2008-10-28 Mike Krüger <mkrueger@novell.com>
-
- * CSharpBinding.addin.xml: fixed 'Bug 399737 - Code completion busted
- for referenced assemblies that are not in GAC, are outside of the
- solution, and which are referenced by other non-GAC outside
- referenced assemblies'.
-
-2008-10-28 Mike Krüger <mkrueger@novell.com>
-
- * Gui/EventCreationCompletionData.cs: event creation is now done with a
- stringbuilder.
-
-2008-10-28 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs:
- * Gui/EventCreationCompletionData.cs: Worked on event handler
- completion.
-
-2008-10-27 Mike Krüger <mkrueger@novell.com>
-
- * Gui/EventCreationCompletionData.cs: handled instantiated types for
- event completion.
-
-2008-10-27 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: Removed duplicate method.
-
-2008-10-27 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs:
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 434705 - No autocomplete
- offered if not assigning result of 'new' to a variable'.
-
-2008-10-27 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed possible null reference
- exception.
-
-2008-10-27 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: Fixed 'Bug 438699 - Code completion shows
- too many options'.
-
-2008-10-27 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewOverrideCompletionData.cs: fixed setter generation in override
- completion.
-
-2008-10-27 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed "Bug 436870 - Inheriting from
- base class gives bad code completion (reopened)"
-
-2008-10-27 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryParameterDataProvider.cs: fixed 'Bug 432727 - No
- completion if no constructor'.
-
-2008-10-27 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewCSharpExpressionFinder.cs: fixed 'Bug 434705 - No autocomplete
- offered if not assigning result of 'new' to a variable'.
-
-2008-10-27 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/NRefactoryParameterDataProvider.cs: Removed debug messages.
-
-2008-10-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewOverrideCompletionData.cs: fixed override bug.
-
-2008-10-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 438708 - Changing
- namespace results in MD hanging'.
-
-2008-10-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/CSharpTextEditorCompletion.cs:
- * Gui/NRefactoryParameterDataProvider.cs: fixed
-Bug 434706 -
- Autocomplete should expand on pressing comma
-Bug 434717 - No
- completion for nullable types
-
- * Gui/CSharpAmbience.cs: Fixed a null reference exception.
-
-2008-10-22 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: C# ambience can now print instantiated types.
-
-2008-10-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/AssemblyInfo.xft.xml: Use an AssemblyVersion that'll build
- with csc. Fixes "Bug 436273 - created AssemblyInfo.cs does not build
- on VS2005".
-
-2008-10-20 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed "Bug 436870 - Inheriting from
- base class gives bad code completion".
-
-2008-10-20 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewOverrideCompletionData.cs: fixed Bug 436951 - Overriding an
- abstract property is incorrect.
-
-2008-10-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Autotools/Autotools.mdp, Autotools/Makefile.am: Fix build.
-
-2008-10-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewOverrideCompletionData.cs:
- * Gui/CSharpTextEditorCompletion.cs:
- * Gui/EventCreationCompletionData.cs: fixed 'Bug 436320 - Autocomplete
- does not show compatible event handlers'.
-
-2008-10-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 434701 - No autocomplete
- in attributes'.
-
-2008-10-18 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/CSharpTextEditorCompletion.cs:
- * Gui/EventCreationCompletionData.cs: Worked on event completion.
-
-2008-10-17 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 434705 - No autocomplete
- offered if not assigning result of 'new' to a variable'.
-
-2008-10-16 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/MemberCompletionData.cs:
- * Gui/CSharpTextEditorCompletion.cs:
- * Gui/NRefactoryParameterDataProvider.cs: fixed 'Bug 434701 - No
- autocomplete in attributes'.
-
-2008-10-16 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 434705 - No autocomplete
- offered if not assigning result of 'new' to a variable'.
-
-2008-10-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed 'Bug 434770 - No autocomplete on
- array types'.
-
-2008-10-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/MemberCompletionData.cs: Tidy up last commit.
-
-2008-10-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/MemberCompletionData.cs: Fix accidentally marking all overloads as
- obsolete.
-
-2008-10-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/CSharpTextEditorCompletion.cs: Track APIs.
-
-2008-10-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/MemberCompletionData.cs:
- * Gui/NewOverrideCompletionData.cs:
- * Gui/CSharpTextEditorCompletion.cs: Track CompletionData API.
-
-2008-10-09 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs:
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 431803 - Autocomplete
- not giving any options'.
-
-2008-10-09 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs:
- * Gui/NRefactoryResolver.cs:
- * Gui/NewCSharpExpressionFinder.cs:
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 432681 - Incorrect
- completion in nested classes'.
-
-2008-10-09 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed possible null reference.
-
-2008-10-09 Mike Krüger <mkrueger@novell.com>
-
- * Parser/NRefactoryParser.cs: fixed 'Bug 433410 - Code folding toggle in
- the wrong place'.
-
-2008-10-09 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed some bugs with parameters,
-
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 433735 - Autocomplete of
- `using' statement behaves like `using' directive'.
-
-2008-10-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/MemberCompletionData.cs: Make code more readable.
-
-2008-10-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/NRefactoryResolver.cs: Track API changes.
-
-2008-10-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Track API.
-
- * Gui/MemberCompletionData.cs: Don't subclass CodeCompletionData, but
- implement interfaces directly so we have more control over the API.
- Don't mark as obsolete if some overloads are not obsolete.
-
-2008-10-08 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/CSharpTextEditorCompletion.cs: fixed regression bug.
-
-2008-10-08 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs:
- * Gui/NewCSharpExpressionFinder.cs:
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 432681 - Incorrect
- completion in nested classes'.
-
-2008-10-08 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: fixed 'Bug 429025 - Code completion of 'base'
- doesn't work'.
-
-2008-10-08 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs: fixed possible null references.
-
-2008-10-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/MemberCompletionData.cs: Re-implement sinking obsolete members to
- the bottom, but in a non-broken way this time.
-
-2008-10-07 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryParameterDataProvider.cs: fixed 'Bug 432727 - No
- completion if no constructor'.
-
-2008-10-07 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs, Gui/NRefactoryResolver.cs,
- Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 431382 - Code
- completion should strip Attribute suffix from classes deriving from
- System.Attribute'.
-
-2008-10-07 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs: fixed possible null reference in
- compare.
-
-2008-10-07 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs: fixed 'Bug 430813 - Completion list
- feels really broken when items are not sorted alphabetically'.
-
-2008-10-07 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryParameterDataProvider.cs, Gui/CSharpAmbience.cs,
- Gui/CSharpTextEditorCompletion.cs: Worked on code completion.
-
-2008-10-07 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/CSharpTextEditorCompletion.cs: fixed
- 'Bug 431761 - Code completion is incorrect'.
-
-2008-10-07 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs: fixed +-1 error.
-
-2008-10-07 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed possible null reference.
-
-2008-10-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: fixed 'base' bug.
-
-2008-10-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs: fixed 'Bug 432436 -
- Code completion shouldn't activate before the equals when declaring
- variables'.
-
-2008-10-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs, Gui/NRefactoryResolver.cs,
- Gui/CSharpTextEditorCompletion.cs: fixed Bug 432435 - Code
- completion shows 'List', not List<T>.
-
-2008-10-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed Bug 432658 - Incorrect completion
- when calling an extension method from inside another extension
- method.
-
-2008-10-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorIndentation.cs: Fixed a bug in tab as reindent
- command.
-
-2008-10-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed 'Bug 431797 - Code completion
- showing invalid options'.
-
-2008-10-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 431759 - Code
- completion should not happen in #region directives'.
-
-2008-10-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed 'Bug 431764 - Completion doesn't
- work in properties'.
-
-2008-10-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryParameterDataProvider.cs,
- Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 432437 - No
- completion when invoking delegates'.
-
-2008-10-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Updated xml comment tag
- descriptions from ECMA 364.
-
-2008-10-02 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 431462 - Code
- completion generally unusable with with 'using' aliases'.
-
-2008-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * CSharpBindingCompilerManager.cs: Track API.
-
-2008-09-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/MemberCompletionData.cs: Fix NRE that broke completion.
-
-2008-09-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Autotools/CSharpAutotoolsSetup.cs: Fix bug #394501 - tarball
- generated don't add -keyfile:<strong_name_file>.snk in MAKE command
- in Makefile.in.
-
-2008-09-29 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 430393 - "// test/"
- generates <summary> comment'.
-
-2008-09-29 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs: moved obsolete members at the bottom of
- the list.
-
-2008-09-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * Parser/NRefactoryParser.cs: Track API.
-
-2008-09-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CodeGenerationPanel.cs: Properly read and store the "warnings as
- errors" flag.
- * Project/CSharpCompilerParameters.cs: Added PlatformTarget property.
- Other minor fixes.
-
-2008-09-26 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: Worked on csharp ambience.
-
-2008-09-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * Parser/NRefactoryParser.cs: Track API.
-
-2008-09-25 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: fixed 'Bug 424499 - Member list should display
- normal members and explicitly implemented members differently'.
-
-2008-09-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * Parser/NRefactoryParser.cs: Fix line/column of errors.
-
-2008-09-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: fixed anonymous type bug.
-
-2008-09-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs, Gui/CSharpTextEditorCompletion.cs: Show
- extension parameter for static resolve.
-
-2008-09-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs, Gui/NewOverrideCompletionData.cs,
- Gui/ResolveVisitor.cs, Gui/NRefactoryParameterDataProvider.cs,
- Gui/CSharpAmbience.cs: Added support for C#3.0 extension methods.
-
-2008-09-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryParameterDataProvider.cs,
- Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 427702 - Code
- Completion: 'is' and 'as' completion not working properly'.
-
-2008-09-24 Mike Krüger <mkrueger@novell.com>
-
- * Parser/NRefactoryParser.cs: Worked on tag comments.
-
-2008-09-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Worked on ctrl+space code
- completion.
-
-2008-09-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 429034 - Class alias
- completion not working properly'.
-
-2008-09-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryParameterDataProvider.cs,
- Gui/CSharpTextEditorCompletion.cs: Added missing constructor
- accessible check.
-
-2008-09-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryParameterDataProvider.cs,
- Gui/CSharpTextEditorCompletion.cs, Parser/NRefactoryParser.cs:
- fixed 'Bug 427448 - Code Completion: completion of constructor
- parameters not working'.
-
-2008-09-23 Mike Krüger <mkrueger@novell.com>
-
- * Parser/NRefactoryParser.cs: Added pre processor #if directive
- foldings.
-
-2008-09-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryParameterDataProvider.cs, Gui/CSharpAmbience.cs: fixed
- 'Bug 429040 - Parameter completion tooltip not highlighting current
- parameter'.
-
-2008-09-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs, Gui/ResolveVisitor.cs: fixed 'Bug 429035
- - Completion of string.IsNullOrEmpty throws an exception'.
-
-2008-09-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewOverrideCompletionData.cs: fixed 'Bug 429032 - Override
- completion elements can't be selected by name'.
-
-2008-09-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs, Gui/CSharpTextEditorCompletion.cs: fixed
- 'Bug 429029 - Override completion missing some methods'.
-
-2008-09-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed 'Bug 429024 - Code
- completion list shown for 'using' when inside a comment or string'
-
-2008-09-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewOverrideCompletionData.cs, Gui/CSharpTextEditorCompletion.cs:
- fixed 'Bug 428387 - Code Completion: 'override' completion is
- incorrect for interfaces'.
-
-2008-09-22 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Worked on ctrl+space command.
-
-2008-09-22 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: Generic method parameters are now emitted.
-
-2008-09-22 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs: fixed 'Bug 367716 - Code completion
- shows obsolete functions'.
-
-2008-09-22 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed bug 'Bug 427511 - Code
- Completion not working for files not belonging to a project'.
-
-2008-09-22 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: Resolver now throws an argumentnull
- exception, when dom is not set.
-
-2008-09-20 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs, Gui/CSharpTextEditorCompletion.cs: removed
- debug messages.
-
-2008-09-20 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs, Parser/NRefactoryParser.cs: Added operator
- overload handling.
-
-2008-09-20 Mike Krüger <mkrueger@novell.com>
-
- * Parser/NRefactoryParser.cs: Operators are now converted.
-
-2008-09-20 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewCSharpExpressionFinder.cs, Gui/CSharpTextEditorCompletion.cs:
- Fixed 'Bug 427375 - Code Completion: Incorrect completion of
- "using"'
-
-2008-09-20 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Removed duplicate get/set in
- property declaration.
-
-2008-09-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed 'Bug 427734 - Code Completion issues
- with enums'.
-
-2008-09-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed.
-
-2008-09-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: forget one commit.
-
-2008-09-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: fixed 'Bug 427649 - Code Completion: protected
- methods shown in code completion'.
-
-2008-09-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs, Gui/CSharpTextEditorCompletion.cs: fixed 'Bug
- 405000 - Namespace alias qualifier operator (::) does not trigger
- code completion'.
-
-2008-09-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: fixed 'Bug 397930 - Navigation to generic
- method not working correctly'.
-
-2008-09-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs: Found cleaner way
- for method resolve result.
-
-2008-09-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Track api changes.
- * gtk-gui/objects.xml, gtk-gui/gui.stetic: Flush.
-
-2008-09-18 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: fixed "Bug 427294 - Code Completion:
- completion on values returned by methods doesn't work".
-
-2008-09-18 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed "Bug 427286 - Code
- Completion: completion done without showing the completion list".
-
-2008-09-18 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed "Bug 427284 - Code
- Completion: class list shows the full name of classes".
-
-2008-09-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CompilerOptionsPanelWidget.cs: Properly store properties in the
- project configurations. The project's configuration list can't be
- used because it is duplicated by the properties dialog while it is
- being edited.
- * Parser/NRefactoryParser.cs: Parse positional and named attribute
- arguments.
-
-2008-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.mdp: Updated projects.
-
-2008-09-17 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs, Gui/NRefactoryResolver.cs,
- Gui/CSharpTextEditorCompletion.cs: Fixed code completion issue.
-
-2008-09-17 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Some changes required for unit
- testing.
-
-2008-09-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/MemberCompletionData.cs: Improve rendering of documentation. The
- new EscapeText call also fixes bug #416842.
-
-2008-09-16 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/NRefactoryParameterDataProvider.cs,
- Gui/CSharpTextEditorCompletion.cs: Removed some debug messages.
-
-2008-09-16 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/NewCSharpExpressionFinder.cs,
- Gui/CSharpTextEditorCompletion.cs: fixed regression 325081.
-
-2008-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed possible null reference exception.
-
-2008-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewCSharpExpressionFinder.cs, Gui/CSharpTextEditorCompletion.cs:
- added namespace expression context.
-
-2008-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed code completion bug.
-
-2008-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: added typeof ( context.
-
-2008-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: added base class context.
-
-2008-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed regression 334620.
-
-2008-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed regression 325509.
-
-2008-09-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/MemberCompletionData.cs: Use the EmitMarkup flag when generating
- member documentation.
- * Gui/CSharpAmbience.cs: Escape '<' and '>' when emitting type names
- with markup.
-
-2008-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewCSharpExpressionFinder.cs: fixed regression 324908
-
-2008-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryParameterDataProvider.cs, Gui/CSharpAmbience.cs: fixed
- regression 324907.
-
-2008-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Fixed offset for method
- completion.
-
-2008-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: fixed regression 323317.
-
-2008-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: fixed regression from 323283.
-
-2008-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed regression from 321306.
-
-2008-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/CSharpTextEditorCompletion.cs: Fixed
- regression from bug 318834.
-
-2008-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpAmbience.cs: Ambiences now take care of the IncludeGenerics
- flag.
-
-2008-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed code completion list bug.
-
-2008-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/CSharpTextEditorCompletion.cs: fixed
- cc bug.
-
-2008-09-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml: Run the completion extension before the
- indentation extension. Fixes tab completion of 'override'.
-
-2008-09-12 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs: fixed bug in code completion list.
-
-2008-09-12 Mike Krüger <mkrueger@novell.com>
-
- * Gui/MemberCompletionData.cs, Gui/CSharpAmbience.cs,
- Gui/CSharpTextEditorCompletion.cs: Worked on code completion.
-
-2008-09-12 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewOverrideCompletionData.cs, Gui/CSharpTextEditorCompletion.cs:
- Worked on override completion.
-
-2008-09-12 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Fixed bug in override completion.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Autotools/Autotools.mdp, gtk-gui/generated.cs,
- gtk-gui/CSharpBinding.CodeGenerationPanelWidget.cs,
- gtk-gui/CSharpBinding.CompilerOptionsPanelWidget.cs,
- gtk-gui/CSharpBinding.FormattingPanelWidget.cs, gtk-gui/gui.stetic:
- Updated generated code.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CompilerOptionsPanelWidget.cs, Gui/CSharpTextEditorCompletion.cs,
- Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs: Track api
- changes.
-
-2008-09-11 Mike Krüger <mkrueger@novell.com>
-
- * Parser/NRefactoryParser.cs: Worked on fold information update.
-
-2008-09-10 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: Added missing search type.
-
-2008-09-10 Mike Krüger <mkrueger@novell.com>
-
- * Parser/NRefactoryParser.cs: recognizing using/namespace import
- differences
-
-2008-09-10 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryDocumentMetaInformation.cs, Parser/DomParser.cs,
- Parser/NRefactoryParser.cs: Changed compilation unit/document meta
- information interface.
-
-2008-09-09 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Added duplicate namespace filter.
-
-2008-09-09 Mike Krüger <mkrueger@novell.com>
-
- * Parser/DomParser.cs, Parser/NRefactoryParser.cs: Some changes caused
- by interface changes.
-
-2008-09-08 Mike Krüger <mkrueger@novell.com>
-
- * Parser/DomParser.cs, Parser/NRefactoryParser.cs: Fixed some issues
- found by unit testing.
-
-2008-09-05 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Parser/DomParser.cs,
- Parser/NRefactoryParser.cs: Worked on dom/refactoring.
-
-2008-09-05 Mike Krüger <mkrueger@novell.com>
-
- * Parser/NRefactoryParser.cs: fixed bug with namespace resolving.
-
-2008-09-04 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: Fixed inner type bug.
-
-2008-09-04 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryParameterDataProvider.cs, CSharpBinding.addin.xml,
- CSharpBinding.mdp, Parser/NRefactoryParser.cs, gtk-gui/gui.stetic,
- Makefile.am: Added nrefactory based parser.
-
-2008-08-21 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: fixed possible null ref.
-
-2008-08-20 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs,
- Parser/DomParser.cs: Worked on indexer resolving.
-
-2008-08-20 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs,
- Gui/NRefactoryParameterDataProvider.cs,
- Gui/NewCSharpExpressionFinder.cs: Fixed some accessibility issues.
-
-2008-08-19 Mike Krüger <mkrueger@novell.com>
-
- * Parser/DomParser.cs: Fixed type modifiers (fixes some bugs in
- stetic).
-
-2008-08-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Parser/DomParser.cs,
- Parser/CodeGenerator.cs: Worked on resolving/code generation.
-
-2008-08-18 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs, Gui/NRefactoryParameterDataProvider.cs,
- Gui/CSharpTextEditorCompletion.cs: Worked on completion.
-
-2008-08-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs,
- Gui/NRefactoryParameterDataProvider.cs,
- Gui/CSharpTextEditorCompletion.cs,
- Gui/CSharpTextEditorIndentation.cs: Worked on completion.
-
-2008-08-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/CSharpTextEditorCompletion.cs,
- Parser/DomParser.cs, Parser/CodeGenerator.cs,
- Parser/LanguageItemVisitor.cs,
- Parser/SharpDevelopTree/GenericParameter.cs,
- Parser/SharpDevelopTree/Destructor.cs,
- Parser/SharpDevelopTree/Method.cs,
- Parser/SharpDevelopTree/ReturnType.cs,
- Parser/SharpDevelopTree/Class.cs,
- Parser/SharpDevelopTree/Constructor.cs,
- Parser/SharpDevelopTree/AttributeSection.cs,
- Parser/CSharpExpressionFinder.cs, Makefile.am: worked on code
- completion/dom/enum completion,
-
-2008-08-13 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs,
- Parser/CodeGenerator.cs: Worked on some todos.
-
-2008-08-08 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs: Worked on some TODOS in the code generator.
-
-2008-08-08 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewOverrideCompletionData.cs, Gui/CSharpTextEditorCompletion.cs:
- Added ToString method auto generation.
-
-2008-08-07 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/CSharpAmbience.cs,
- Parser/CodeGenerator.cs: Worked on dom.
-
-2008-08-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/CSharpTextEditorCompletion.cs,
- Parser/DomParser.cs: Worked on code completion.
-
-2008-08-05 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs: Fixed resolver bug.
-
-2008-08-04 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs, Gui/CSharpAmbience.cs, Parser/DomParser.cs:
- Worked on ambiences and resolving
-
-2008-08-04 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs,
- Gui/CSharpTextEditorCompletion.cs: Worked on C#3 code completion.
-
-2008-08-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs,
- Gui/CSharpTextEditorIndentation.cs: Share the state engine between
- these two editor extensions. Should improve performance a fair bit.
-
-2008-08-01 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: added some changes for return type
- representation.
-
-2008-07-31 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs,
- Gui/CSharpTextEditorIndentation.cs: Only attach to C# documents.
-
-2008-07-31 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpParameterDataProvider.cs, Gui/OverrideCompletionData.cs,
- CSharpBinding.mdp, Parser/DomParser.cs, Parser/Parser.cs,
- Parser/CSharpVisitor.cs, Parser/Resolver.cs, Parser/TypeVisitor.cs,
- Parser/LanguageItemVisitor.cs, Parser/ExpressionFinder.cs,
- Parser/CSharpExpressionFinder.cs, CSharpAmbience.cs, Makefile.am:
- Removed outdated files.
-
-2008-07-31 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs,
- Gui/NewCSharpExpressionFinder.cs: Worked on C#3 code completion.
-
-2008-07-30 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs, Gui/CSharpTextEditorIndentation.cs:
- Worked on text editor indentation.
-
-2008-07-30 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs: some changes due to
- dom changes.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * CSharpLanguageBinding.cs, Gui/CSharpParameterDataProvider.cs,
- Gui/CSharpTextEditorExtension.cs, Gui/NewCSharpExpressionFinder.cs,
- Gui/OverrideCompletionData.cs, Gui/CSharpAmbience.cs,
- Gui/CodeGenerationPanel.cs, Gui/CompilerOptionsPanelWidget.cs,
- Parser/Parser.cs, Parser/CSharpVisitor.cs, Parser/CodeGenerator.cs,
- Parser/Resolver.cs, Parser/TypeVisitor.cs,
- Parser/LanguageItemVisitor.cs, Parser/ExpressionFinder.cs,
- Parser/SharpDevelopTree/GenericParameter.cs,
- Parser/SharpDevelopTree/Destructor.cs,
- Parser/SharpDevelopTree/Method.cs,
- Parser/SharpDevelopTree/ReturnType.cs,
- Parser/SharpDevelopTree/Class.cs,
- Parser/SharpDevelopTree/Constructor.cs,
- Parser/SharpDevelopTree/AttributeSection.cs,
- Parser/CSharpExpressionFinder.cs, CSharpAmbience.cs: Translated old
- code to new dom.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs, Parser/CodeGenerator.cs: Changes
- for converted refactoring infrastructure.
-
-2008-07-28 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs, Parser/LanguageItemVisitor.cs: Fixed some
- nrefactory stuff.
-
-2008-07-28 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryDocumentMetaInformation.cs, Parser/Parser.cs: Some
- changes for nrefactory.
-
-2008-07-28 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryDocumentMetaInformation.cs, Gui/ResolveVisitor.cs,
- Parser/Parser.cs, Parser/CodeGenerator.cs, Parser/TypeVisitor.cs,
- Parser/LanguageItemVisitor.cs: Some changes that make the
- csharpbinding compile with the new nrefactory.
-
-2008-07-27 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewOverrideCompletionData.cs, Gui/CSharpTextEditorCompletion.cs,
- Gui/NRefactoryDocumentMetaInformation.cs,
- Gui/MemberCompletionData.cs, Gui/NRefactoryResolver.cs,
- Gui/ResolveVisitor.cs, Gui/NewCSharpExpressionFinder.cs,
- Gui/CSharpAmbience.cs, Parser/DomParser.cs, CSharpAmbience.cs:
- Worked on code completion/new dom.
-
-2008-07-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs, Gui/CSharpTextEditorExtension.cs:
- Track API.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/CSharpCompilerParameters.cs: Moved serialization engine to
- MonoDevelop.Core. Use new syntax for specifying attribute scope.
-
-2008-07-17 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/NRefactoryParameterDataProvider.cs,
- Gui/CSharpTextEditorCompletion.cs: Worked on code completion.
-
-2008-07-16 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: fixed bug in ctrl+space completion
- data.
-
-2008-07-16 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs,
- Gui/NRefactoryParameterDataProvider.cs,
- Gui/CSharpTextEditorCompletion.cs: some bugfixes.
-
-2008-07-16 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs,
- Gui/NRefactoryParameterDataProvider.cs,
- Gui/CSharpTextEditorCompletion.cs: Added xml documentation
- support/bugfixes.
-
-2008-07-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/NewCSharpExpressionFinder.cs,
- Gui/CSharpTextEditorCompletion.cs: Worked on 'new' completion.
-
-2008-07-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs, Parser/DomParser.cs: Fixed namespace resolve
- bug.
-
-2008-07-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs: Fixed possible null reference exception.
-
-2008-07-14 Mike Krüger <mkrueger@novell.com>
-
- * Parser/DomParser.cs: Changes due to recent dom parser changes.
-
-2008-07-14 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs: Fixed inner types.
-
-2008-07-13 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorCompletion.cs: Worked on ctrl+space completion.
-
-2008-07-13 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs,
- Gui/CSharpTextEditorCompletion.cs: Worked on code completion.
-
-2008-07-12 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs: Some code
- completion fixes.
-
-2008-07-12 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewOverrideCompletionData.cs, Gui/CSharpAmbience.cs,
- Gui/CSharpTextEditorCompletion.cs, Parser/DomParser.cs: Added C#
- ambience for new dom. Worked on override completion.
-
-2008-07-11 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NewOverrideCompletionData.cs, Gui/NewCSharpExpressionFinder.cs,
- Gui/OverrideCompletionData.cs, Gui/CSharpTextEditorCompletion.cs,
- Parser/DomParser.cs: Worked on code completion.
-
-2008-07-11 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs,
- Gui/CSharpTextEditorCompletion.cs,
- Gui/CSharpTextEditorExtension.cs: Added xml/preprocessor completion
- to the new completion class.
-
-2008-07-10 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs,
- Gui/NRefactoryParameterDataProvider.cs,
- Gui/CSharpTextEditorCompletion.cs, Parser/DomParser.cs: Worked on
- code completion.
-
-2008-07-10 Mike Krüger <mkrueger@novell.com>
-
- * CSharpBinding.addin.xml: accidentally checked in new code completion
- enabled addin file.
-
-2008-07-10 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs,
- Gui/NewCSharpExpressionFinder.cs,
- Gui/CSharpTextEditorCompletion.cs, Parser/DomParser.cs: Worked on
- code completion. Added new expression finder from sharpdevelop3
- (LGPL).
-
-2008-07-09 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs, Gui/NRefactoryParameterDataProvider.cs: Worked
- on new dom.
-
-2008-07-09 Mike Krüger <mkrueger@novell.com>
-
- * CSharpBinding.addin.xml: switched back to old code completion.
-
-2008-07-09 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs, Gui/NRefactoryParameterDataProvider.cs,
- Gui/CSharpParameterDataProvider.cs,
- Gui/CSharpTextEditorCompletion.cs: Worked on method completion.
-
-2008-07-08 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs,
- Gui/CSharpTextEditorCompletion.cs: Worked on completion.
-
-2008-07-07 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/CSharpTextEditorCompletion.cs,
- Parser/DomParser.cs, Parser/mcs/dom.cs: Worked on completion.
-
-2008-07-07 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs,
- Gui/CSharpTextEditorCompletion.cs: Worked on code completion.
-
-2008-07-04 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/CSharpTextEditorCompletion.cs: Worked
- on text editor completion.
-
-2008-07-04 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Parser.cs: fixed Bug 405930 - FoldingRegions in compilation
- units are all folded by default.
-
-2008-07-04 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ResolveVisitor.cs, Gui/CSharpTextEditorCompletion.cs: Worked on
- completion.
-
-2008-06-25 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs,
- Gui/CSharpTextEditorCompletion.cs: Worked on code completion.
-
-2008-06-25 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs: Worked on
- nrefactory resolver.
-
-2008-06-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/ResolveVisitor.cs,
- Gui/CSharpTextEditorCompletion.cs, Parser/DomParser.cs,
- Parser/Resolver.cs, Parser/CSharpExpressionFinder.cs, Makefile.am:
- Worked on code completion
-
-2008-06-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Fix preprocessor directive
- completion. Short out completion when indent engine says inside
- string or comment.
- * FormattingStrategy/CSharpIndentEngine.cs: Add methods to check if
- inside preprocessor directive or comment/string.
-
-2008-06-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * FormattingStrategy/CSharpIndentEngineStack.cs,
- FormattingStrategy/CSharpIndentEngine.cs: Capture keywords for
- proprocessor directives. Pop #region/#endregion directives back
- out.
-
-2008-06-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Added tab == reindent function.
-
-2008-06-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Parser/CodeGenerator.cs: Implement creation of folding regions, and
- copy workaround in ImplementMember to new ImplementMembers
- override.
-
-2008-06-20 Ankit Jain <jankit@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs (FindOverridables): Move to
- CodeRefactorer and use that.
-
-2008-06-19 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NRefactoryResolver.cs, Gui/CSharpTextEditorCompletion.cs,
- Gui/CSharpTextEditorExtension.cs: Worked on code completion with
- the new dom.
-
-2008-06-13 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs, Parser/DomParserOld.cs,
- Parser/DomParser.cs, Parser/CSharpExpressionFinder.cs: Worked on
- new expression finder.
-
-2008-06-10 Andres G. Aragoneses <aaragoneses@novell.com>
-
- * CSharpBindingCompilerManager.cs: Implement feature to allow unmanaged
- project references in a managed project (bug#397490).
-
-2008-06-04 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: fixed 'Bug 396798 - Smart
- Indendation mode doesn't work with tab-to-space-conversion
- enabled'.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml: Bump MD version.
-
-2008-05-28 Mike Krüger <mkrueger@novell.com>
-
- * Parser/DomParser.cs: Worked on dom parser.
-
-2008-05-27 Mike Krüger <mkrueger@novell.com>
-
- * Parser/DomParser.cs: Fixed some bugs in the new dom parsing.
-
-2008-05-27 Mike Krüger <mkrueger@novell.com>
-
- * Parser/DomParser.cs: Added new dom & new class browser.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml: Merged the extension points for project and
- solution option panels into a single extension point. A single
- extension point will now be used for all kinds of items. Extension
- conditions can be used to make panels visible only for some
- specific item types.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpLanguageBinding.cs, CSharpBindingCompilerManager.cs: Replaced
- ICompilerResult/DefaultCompilerResult/CompilerResults by a new
- BuildResult class, which has owner information at error level, so
- it is possible to know which project generated an error when
- building a solution. Updated Task and TaskService to use the new
- owner information.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/OverrideCompletionData.cs, Gui/CodeGenerationPanel.cs,
- Gui/CompilerOptionsPanelWidget.cs, CSharpBinding.addin.xml,
- md1format.xml, CSharpBinding.mdp, Parser/Parser.cs,
- CSharpBindingCompilerManager.cs,
- Project/CSharpResourceIdBuilder.cs,
- Project/CSharpCompilerParameters.cs, gtk-gui/gui.stetic,
- Makefile.am: New project model changes.
-
-2008-05-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * CSharpBinding.addin.xml: Set "isText" attribute on the mimetype
- definitions.
-
-2008-04-24 Mike Krüger <mkrueger@novell.com>
-
- * Parser/DomParser.cs: Worked on mcs integration.
-
-2008-04-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Fix indexer range crasher. Thanks
- to Atsushi Eno and Joseph Lombrozo for spotting this.
-
-2008-04-18 Marek Safar <marek.safar@gmail.com>
-
- * Parser/mcs/**: Exposed most of the type container members.
-
-2008-04-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * FormattingStrategy/CSharpIndentEngine.cs: Implement
- IDocumentStateEngine so that state tracking logic can be moved into
- MonoDevelop.Ide.
- * Gui/CSharpTextEditorExtension.cs: Move state tracking logic into
- MonoDevelop.Ide. Tidy some things into regions.
-
-2008-04-17 Marek Safar <marek.safar@gmail.com>
-
- * Parser/mcs/**
- * Parser/DomParser.cs: Added top level types info.
-
-2008-04-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Track API change. Remove char code
- translation hack.
- * Gui/CompilerOptionsPanelWidget.cs: Fix minor GTK warning.
-
-2008-04-16 Marek Safar <marek.safar@gmail.com>
-
- * Parser/mcs/**: Initial top level DOM support.
-
- * Parser/DomParser.cs: Updated.
-
- * Makefile.am: Updated.
-
-2008-04-16 Marek Safar <marek.safar@gmail.com>
-
- * Parser/mcs/cs-parser.cs: Sync with /mcs/mcs
-
- * Makefile.am: Updated.
-
-2008-04-15 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Parser.cs: fixed Bug 379224 - Folded XML-comment should
- contain content of <summary/>
-
-2008-04-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/CodeGenerator.cs: Fix potential infinite loop.
-
-2008-04-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml: Use the new mime type extension to register
- new file types.
- * Parser/CSharpVisitor.cs: Remove debug code.
-
-2008-04-10 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am: updated makefile.am
-
-2008-04-10 Mike Krüger <mkrueger@novell.com>
-
- * Parser/mcs/typemanager.cs: fixes compilation error.
-
-2008-04-10 Mike Krüger <mkrueger@novell.com>
-
- * CSharpBinding.addin.xml, CSharpBinding.mdp, Parser/DomParser.cs,
- Parser/mcs, Parser/mcs/report.cs, Parser/mcs/generic.cs,
- Parser/mcs/support.cs, Parser/mcs/typemanager.cs,
- Parser/mcs/cs-tokenizer.cs, Parser/mcs/External,
- Parser/mcs/External/MonoSymbolWriter.cs,
- Parser/mcs/External/MonoSymbolFile.cs,
- Parser/mcs/External/CryptoConvert.cs,
- Parser/mcs/External/MonoSymbolTable.cs,
- Parser/mcs/doc-bootstrap.cs, Parser/mcs/lambda.cs,
- Parser/mcs/parameter.cs, Parser/mcs/modifiers.cs,
- Parser/mcs/pending.cs, Parser/mcs/rootcontext.cs,
- Parser/mcs/namespace.cs, Parser/mcs/literal.cs,
- Parser/mcs/ecore.cs, Parser/mcs/linq.cs, Parser/mcs/class.cs,
- Parser/mcs/decl.cs, Parser/mcs/location.cs,
- Parser/mcs/roottypes.cs, Parser/mcs/delegate.cs,
- Parser/mcs/flowanalysis.cs, Parser/mcs/iterators.cs,
- Parser/mcs/cs-parser.jay, Parser/mcs/convert.cs,
- Parser/mcs/assign.cs, Parser/mcs/const.cs, Parser/mcs/cfold.cs,
- Parser/mcs/anonymous.cs, Parser/mcs/constant.cs,
- Parser/mcs/driver.cs, Parser/mcs/AssemblyInfo.cs,
- Parser/mcs/generic-mcs.cs, Parser/mcs/nullable.cs,
- Parser/mcs/cs-parser.cs, Parser/mcs/expression.cs,
- Parser/mcs/symbolwriter.cs, Parser/mcs/attribute.cs,
- Parser/mcs/enum.cs, Parser/mcs/statement.cs, Parser/mcs/doc.cs,
- Makefile.am, Parser/mcs/codegen.cs: Worked on mcs parser layer
- * Parser/Parser.cs: fixed 'Bug 378432 - Comments should not fold if
- they are not the first text on the line'.
-
-2008-04-02 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Resolver.cs: Fixed namespace bug.
-
-2008-04-02 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Parser.cs: fixed typo
-
-2008-04-02 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Parser.cs: fixed comment positioning.
-
-2008-04-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Parser/Parser.cs: Fix build on Mono head, where gmcs's ternary
- operator precedence is behaving differently for some reason.
-
-2008-04-01 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Parser.cs: No longer generating folding regions for single
- line comments.
-
-2008-03-31 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpVisitor.cs: added location information for using
- statements.
-
-2008-03-31 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Parser.cs: Added folding regions for comments.
-
-2008-03-28 Peter Johanson <peter@peterjohanson.com>
-
- * Parser/Resolver.cs: Make "value" resolve properly to System.Array
- when in the setter for a property that's an array type.
-
-2008-03-27 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Resolver.cs: Added patch from Jan Oravec to fix Bug 372380 -
- MD crash.
-
-2008-03-21 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Resolver.cs: fixed Bug 372380 - MD crash.
-
-2008-03-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Fix CS0136 error with csc (see gmcs
- "Bug 370414 - Missing CS0136").
-
-2008-03-13 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Resolver.cs: fixed typo.
-
-2008-03-13 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Resolver.cs: Fixed Bug 367270 - MD crash.
-
-2008-03-12 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CodeGenerationPanel.cs, Parser/Resolver.cs,
- Parser/ExpressionFinder.cs,
- gtk-gui/CSharpBinding.FormattingPanelWidget.cs: Fixed compiler
- warnings, fixed Bug 369476 - NRE in C# binding crashed text editor.
-
-2008-03-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/FormattingPanel.cs, CSharpBinding.addin.xml,
- gtk-gui/CSharpBinding.CodeGenerationPanelWidget.cs,
- gtk-gui/CSharpBinding.CompilerOptionsPanelWidget.cs,
- gtk-gui/CSharpBinding.FormattingPanelWidget.cs: Use new options
- dialog infrastructure.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CompilerOptionsPanelWidget.cs,
- gtk-gui/CSharpBinding.CodeGenerationPanelWidget.cs,
- gtk-gui/CSharpBinding.CompilerOptionsPanelWidget.cs: Worked on gnome hig
- compliant alerts.
-
-2008-02-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/CodeGenerator.cs: Fix line/column check. Positions are
- 1-based.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * CSharpBinding.mdp, Makefile.am: Removed some unused glade and gnome-sharp
- references (only the unused). But I'll continue to remove glade, we need
- to lower the dependency tree a bit.
-
-2008-02-09 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs, Gui/FormattingPanel.cs,
- CSharpBinding.addin.xml, CSharpBinding.mdp,
- FormattingStrategy/CSharpFormattingStrategy.cs,
- gtk-gui/CSharpBinding.CodeGenerationPanelWidget.cs,
- gtk-gui/CSharpBinding.CompilerOptionsPanelWidget.cs, Makefile.am:
- Removed SourceEditor dependency.
-
-2008-02-05 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Parser.cs: Fixed #region ... #endregion end region position.
-
-2008-02-04 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpVisitor.cs: Corrected type location.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml: Update MD version.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/ConsoleProject.xpt.xml, templates/GnomeSharp2Project.xpt.xml,
- templates/GtkSharp2Project.xpt.xml,
- templates/GladeSharp2Project.xpt.xml, templates/Library.xpt.xml,
- templates/EmptyCSharpFile.xft.xml, templates/EmptyProject.xpt.xml,
- templates/AssemblyInfo.xft.xml: Make template categories translatable.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * CSharpBindingCompilerManager.cs: Manually create CompilerError for certain
- errors, as the CreateErrorFromString method returned null in that
- scenario. Fixes error caused by trying to use a null CompilerError.
-
-2008-01-14 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: fixed Bug 350881 - Code completion not
- working in a specific case.
-
-2008-01-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * CSharpLanguageBinding.cs, CSharpBindingCompilerManager.cs: Don't always
- set the DEBUG define when debug info is emitted. However, add it to the
- defines list for new debug configurations.
-
-2008-01-10 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs: Fixed Bug 350864 - Refactory tools - renaming.
-
-2008-01-10 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Resolver.cs: Fixed 350861: Autocomplete displays hidden items
-
-2008-01-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs, Parser/Resolver.cs: Fixed some infinite
- loops when a class inherits from itself due to invalid code. Fixes bug
- #350855.
-
-2008-01-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * CSharpBindingCompilerManager.cs: Check C# compiler exit code to detect
- when it crashes. Should fix "Bug 351347 - MD ignores mcs/gmcs crash".
-
-2007-12-31 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/AssemblyInfo.xft.xml: Add revision to version number.
- * templates/EmptyCSharpFile.xft.xml: Use standard header instead of
- hardcoded header.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.mdp: Updated project files. The order of extended properties
- won't change anymore.
-
-2007-12-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * CSharpBinding.addin.xml: Updated. Prefix C# templates IDs with "CSharp" so
- that they're not invading the generic part of the unique ID landscape.
- * CSharpBinding.mdp, Makefile.am: Updated.
- * templates/ConsoleProject.xpt.xml, templates/GnomeSharp2Project.xpt.xml,
- templates/GtkSharp2Project.xpt.xml, templates/AssemblyInfo.xft.xml,
- templates/GladeSharp2Project.xpt.xml, templates/Library.xpt.xml: Move
- common files out of project templates to ease maintenance. Make
- AssemblyInfo more readable. Enable standard headers.
- * templates/GnomeSharpProject.xpt.xml, templates/GtkSharpProject.xpt.xml,
- templates/GladeSharpProject.xpt.xml,
- templates/GnomeSharpProgram.xft.xml: Remove obsolete templates.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs, Parser/CodeGenerator.cs,
- Parser/ExpressionFinder.cs: Fix warnings.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml: Bump add-in versions.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml, Autotools/Autotools.mdp, Autotools/Makefile.am,
- CSharpBinding.mdp, CSharpBinding.mds, gtk-gui/gui.stetic, Makefile.am:
- Directory reorganization.
-
-2007-12-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Fix for "Bug 345774 - "override"
- statement completion include members internal to another assembly.".
-
-2007-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Implement completion of symbols when
- typing #if or #elif.
-
-2007-11-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CompilerOptionsPanelWidget.cs: Load existing LangVersion value.
-
-2007-11-23 Andreia Gaita <avidigal@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: When a comma is typed in a method call,
- check that code completion is active before calling it
-
-2007-11-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * CSharpLanguageBinding.cs: Add support for 2.1 profile.
- * Gui/ChooseRuntimePanel.cs: Unused; delete.
- * Gui/CodeGenerationPanel.cs, Gui/CompilerOptionsPanelWidget.cs,
- gtk-gui/CSharpBinding.CodeGenerationPanelWidget.cs,
- gtk-gui/CSharpBinding.CompilerOptionsPanelWidget.cs: Add support for
- LangVersion and AdditionalArgs. Move options from per-config to
- per-project.
- * CSharpBinding.addin.xml, CSharpBinding.mdp, gtk-gui/objects.xml,
- gtk-gui/gui.stetic, Makefile.am: Updated.
- * Autotools/CSharpAutotoolsSetup.cs: Add support for 2.1 profile, additional
- args and langversion.
- * CSharpBindingCompilerManager.cs: Add support for 2.1 profile, additional
- args, nowarn and langversion.
- * Project/CSharpCompilerParameters.cs: Add support for LangVersion and
- AdditionalArgs.
-
-2007-11-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/CSharpCompilerParameters.cs: Removed some obsolete attributes.
-
-2007-11-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Fix distcheck by disabling automatic running of unit
- tests in check target, as their running is somewhat broken.
-
-2007-11-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * CSharpEnhancedCodeProvider.cs: Use non-obsolete APIs.
- * Parser/CodeGenerator.cs: Track API change.
-
-2007-11-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Fix invalid cast. Fixes bug #342607.
-
-2007-11-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Fix "Bug 342124 - Tab should indent,
- regardless of the position of the cursor", as its behaviour was
- confusingly inconsistent. Remove some unused code.
-
-2007-11-16 Mike Krüger <mkrueger@novell.com>
-
- * Parser/TypeVisitor.cs, CSharpBindingCompilerManager.cs: Fixed "Bug 341901
- - MD and CS0618 warning results". And a possible nullreference exception
- in TypeVisitor.
-
-2007-11-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Don't interpret tab as a reindent
- command when there's a selection. Fixes "Bug 341319 - Tab not working
- correctly". Also, remove a load of dead code.
-
-2007-11-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/OverrideCompletionData.cs: When generating overrides, only call the
- base if it's non-abstract and not an interface, else generate a
- NotImplementedException. Fixes "Bug 341495 - Problem with auto-generated
- code for overriden methods".
-
-2007-11-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Fix completion of 'new'.
-
-2007-11-13 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Resolver.cs: Fixed "Bug 339209 - App crashes when trying to list
- members in base class when you derive from current class".
-
-2007-11-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Completion check for '#' must be done
- relative to trigger offset. Fixes bug #338382.
-
-2007-11-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/CSharpVisitor.cs: Set the explicit declaration type for indexers.
- * Parser/CodeGenerator.cs: Workaround for bug in the code generator. Generic
- private implementation types are not generated correctly when they are
- generic.
-
-2007-11-12 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: see/seealso tags are now generated with
- cref (xml doc completion).
-
-2007-11-12 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Fixed "Bug 340875 - Bugs while using XML
- comments".
-
-2007-11-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Fix part 1 of "Bug 340875 - Bugs
- while using XML comments". Smart indent for newlines in doc comments
- was being triggered by the Enter command with the autocompletion
- dropdown.
-
-2007-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Parser/CodeGenerator.cs, CSharpBindingCompilerManager.cs: Track
- LoggingService API changes.
-
-2007-11-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Don't try to look back at chars before
- the beginning of the buffer when deciding how to handle tabs.
- Restructure/comment the affected code so it's easier to understand.
- Fixes "Bug 340270 - Ctrl+Tab caused exception".
-
-2007-11-08 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs, Parser/Resolver.cs: Fixed "Bug 335140 -
- MD does not exlude this class from base classes list".
-
-2007-11-07 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Fixed "Bug 339480 - Crash in XML comment
- autocompletion".
-
-2007-11-06 Zach Lute <zach.lute@gmail.com>
-
- * Gui/CSharpTextEditorExtension.cs: Added missing null check to fix
- Bug #339445.
-
-2007-11-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Override TextChanged in order to update
- Smart Indent engine correctly when buffer is modified before its cursor.
-
-2007-11-06 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs: Fixed "Bug 336598 - Renaming variables by
- refactoring replaces matches in the replace string" and "Bug 335977 -
- Rename refactoring does not rename instance in foreach".
-
-2007-11-06 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Resolver.cs: Fixed "Bug 337658 - MD intellisense does not work for
- `value'".
-
-2007-11-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * FormattingStrategy/CSharpIndentEngine.cs: Properly collapse folded
- statements when a block is opened. Fixes the first complaint in "Bug
- 338383 - MD ignores existing source code structure.".
-
-2007-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBindingCompilerManager.cs: Provide a better error message in case of
- type load error in the compiler. Fixes bug #325380.
-
-2007-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Include generic type parameters in completion list.
- Fixes bug #334620.
-
-2007-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Implemented completion context for
- "SomeEnum e =". In this case the completion list will show the enum
- name. Fixes bug #335142.
-
-2007-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Include in the completion list the classes from parent
- namespaces. Fixes bug #338394.
-
-2007-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Improved completion of 'namespace'
- keyword. Fixes bug #338392.
-
-2007-11-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Restore IsAsResolve logic. Is/as are used for
- downcasting, so it only makes sense to return subclasses of the provided
- type.
-
-2007-10-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Don't try to look back past first
- char in buffer when checking whether to run completion code.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml: Bump MD version.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml: Track changes in the Icon extension node.
-
-2007-10-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Avoid calling
- expressionFinder.FindExpression on every keystroke, as it calls
- FilterComments, which is very expensive (recorded 6% in statistical
- profiling, the most time spent in any managed non-runtime method). It's
- only called when the keystroke is completable -- not ideal, but an
- improvement.
-
-2007-10-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Removed GenerateDocComments' dependency
- on indentEngine.
-
-2007-10-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Minor optimisation.
-
-2007-10-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Read context to end of line when
- reindenting. Fixes "Bug 324985 - operator '::' behaves like goto label
- in smart indentation".
-
-2007-10-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: If indent engine says line needs to be
- reindented, check it's as a result of an inserted character rather than
- just navigating around the code.
-
-2007-10-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Don't insert a tab if it's interpreted
- as a reindent command.
-
-2007-10-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBindingCompilerManager.cs: Make compilation work when the key file
- contains white spaces. Fixes bug #336107.
-
-2007-10-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.mdp, icons/C#.File.EmptyFile, icons/C#.File.Form,
- icons/C#.File.FullFile, icons/C#.File.NewClass, icons/C#.File.WebFile,
- icons/C#.Project.FullProject, icons/C#.Project.ServiceProject,
- icons/C#.Project.UserControl, icons/C#.Project.WebProject,
- icons/C#.ProjectIcon, Makefile.am, templates/EmptyCSharpFile.xft.xml,
- templates/GnomeSharpProgram.xft.xml: Use tango file icons. Removed
- obsolete icons.
-
-2007-10-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.mdp, templates/ConsoleProject.xpt.xml,
- templates/GtkSharpProject.xpt.xml, templates/GnomeSharpProject.xpt.xml,
- templates/GnomeSharp2Project.xpt.xml,
- templates/GtkSharp2Project.xpt.xml, templates/GnomeSharpProgram.xft.xml,
- templates/GladeSharpProject.xpt.xml,
- templates/GladeSharp2Project.xpt.xml, templates/Library.xpt.xml,
- templates/EmptyProject.xpt.xml, Makefile.am, icons/C#.Project.Form,
- icons/C#.Project.Library, icons/C#.Project.DOSProject,
- icons/csharp-icon-32.png, icons/C#.Project.EmptyProject: Updated project
- icons. Use the base project icon with an overlay to show the type.
-
-2007-10-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Refactored the keypress code to separate
- out the indent engine and doc comments, also splitting up the indent
- handling code into three phases. Renamed "engine" to "indentEngine".
- Improved handling of auto-commenting on newlines. Fixed "Bug 335824 -
- Better handling of the 'tab' key". Fixed "Bug 326289 - MD texteditor is
- painfully slow" by caching old indent stacks and bulk-copying characters
- during large updates.
-
-2007-10-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Fixed "Bug 335145 - Intellisense
- displays wrong entries for typeof statement".
-
-2007-10-23 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Resolver.cs: Fixed "Bug 335133 - Intellisense does not display
- object members for interfaces".
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml, Makefile.am, templates/GtkSharpWindow.xft.xml:
- Removed the Gtk.Window template, because the Stetic addin already
- provides a template for creating windows.
- * Autotools/Autotools.mdp, CSharpBinding.mdp, CSharpBinding.mds: Updated.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/OverrideCompletionData.cs: Flags for showing return types and
- parameters must be explicitely specified now.
-
-2007-10-18 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpParameterDataProvider.cs, Gui/CSharpTextEditorExtension.cs:
- Fixed "Bug 325509 - Inaccessible methods displayed in autocomplete".
-
-2007-10-17 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Resolver.cs: changed is/as resolve.
-
-2007-10-17 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Resolver.cs: Fixed "Bug 334236 - Intellisense does not work for
- `is' keyword".
-
-2007-10-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Let TypeNameResolver fill the names using the compiled
- unit. Helps fixing bug #325081.
-
-2007-10-17 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CSharpVisitor.cs: Modified visitor to handle explicit declarations.
-
-2007-10-16 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Resolver.cs: fixed "Bug 325528 - Intellisense contains multiple
- entries of same namespace".
-
-2007-10-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.mdp, Parser/TypeNameResolver.cs, Makefile.am: Moved
- TypeNameResolver to MD.Projects.
-
-2007-10-15 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Fixed "Bug 333140 - Xml comment
- generation only works when using "Smart" indentation".
-
-2007-10-12 Mike Krüger <mkrueger@novell.com>
-
- * CSharpBindingCompilerManager.cs: Applied changes that were neccassary for
- to the new FileService.
-
-2007-10-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpAmbience.cs: Always show parameter types.
-
-2007-10-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpAmbience.cs: Properly show the method name for conversion operators.
-
-2007-10-04 Zach Lute <zach.lute@gmail.com>
-
- * Parser/CSharpVisitor.cs: Added support for implicit/explicit operators as
- methods. (Bug #330503)
-
-2007-10-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpAmbience.cs: Formatting fixes.
-
-2007-10-09 Mike Krüger <mkrueger@novell.com>
-
- * CSharpAmbience.cs: Changed the C# ambience to recognize the new conversion
- flags.
-
-2007-10-09 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Parser.cs: Fixed "Bug 331772 - Unable to handle conditional class
- definition".
-
-2007-10-09 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Fixed "Bug 331000 - Auto-generation of
- XML comment tags sometimes incorrect".
-
-2007-10-09 Ankit Jain <jankit@novell.com>
-
- * CSharpBindingCompilerManger.cs: Moved code for building resources to
- DotNetProject.
-
-2007-10-08 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs: fixed "Bug 325223 - Interface refactory doesn't
- implement correctly (4 bugs)".
-
-2007-10-08 Mike Krüger <mkrueger@novell.com>
-
- * Parser/ExpressionFinder.cs: Worked on "Bug 330717 - Error while updating
- status of command. CurrentRefactoryOperations". Need to get reply, if
- this bug is fixed (couldn't reproduce the problem).
-
-2007-10-05 Ankit Jain <jankit@novell.com>
-
- * Autotools/CSharpAutotoolsSetup.cs (GetCompilerFlags): Correctly emit
- flag for optimization. Don't emit -define:DEBUG if its already defined
- in DefineSymbols.
-
-2007-10-05 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: fixed Bug 325523 - MD override
- auto-implementation ignores existing implementations.
-
-2007-10-05 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: fixed Bug 330793 - Delegate
- autocommenting crashes.
-
-2007-10-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/CSharpVisitor.cs, Parser/Resolver.cs: Properly resolve aliases
- bound to instantiated generic types. Fixes bug #324844.
- * Parser/TypeNameResolver.cs: Resolve aliased class names.
-
-2007-10-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpParameterDataProvider.cs, Gui/CSharpTextEditorExtension.cs:
- Implemented support for the Show Parameter List command. Also, show the
- parameter list when typing a comma. Fixes bug #324876.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml: Bump MD version.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Don't set the Editor.CursorPosition
- property if position hasn't really changed, since it will raise the
- completion context change event, which closes the completion window.
-
-2007-09-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/CodeGenerator.cs: Fix regex in RenameClass. Class name may end with
- ":".
-
-2007-09-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/CodeGenerator.cs: Fix renaming of partial classes. It was using the
- wrong IClass to get the line and column.
-
-2007-09-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: When completing 'override', show
- overridables for System.Object.
-
-2007-09-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/OverrideCompletionData.cs: Generate call to base class when overriding
- method. Fixes bug #325524.
-
-2007-09-18 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Fixed Bug 325438 - New doc completion
- slowing me down.
-
-2007-09-15 Jérémie Laval <jeremie.laval@gmail.com>
-
- * Parser/Parser.cs: Added support for parsing error retrieval from NRefactory.
-
-2007-09-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/OverrideCompletionData.cs, Gui/CSharpTextEditorExtension.cs,
- CSharpAmbience.cs: Make proper use of ITypeNameResolver everywhere to
- resolve type names of parameters, methods, etc. Fixes bug #82854.
- * Parser/TypeNameResolver.cs: Fix name resolution for aliases.
-
-2007-09-14 Jeffrey Stedfast <fejj@novell.com>
-
- * FormattingStrategy/CSharpIndentEngine.cs (PushColon): Handle the
- :: operator. Fixes bug #82316.
-
-2007-09-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Minor fix.
- * Parser/TypeNameResolver.cs: Remove debug code.
-
-2007-09-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs, Parser/Resolver.cs,
- Parser/TypeNameResolver.cs: Implement support for ITypeResolver. Add
- parameter completion support for delegate invocations. Fixes bug #82264
- and #82238.
- * CSharpBinding.mdp: Fix warning level. Added new file.
- * CSharpAmbience.cs: Track API changes.
- * Makefile.am: Updated.
-
-2007-09-14 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs: Fixed 82425:Renaming a base method doesn't rename
- overrides. (Fixed for properties too).
-
-2007-09-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpParameterDataProvider.cs: Improved method formatting.
- * Gui/CSharpTextEditorExtension.cs, Parser/Resolver.cs: When resolving a
- type, take into account parameter types for methods and classes. Fixes
- bug #82209.
-
-2007-09-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpAmbience.cs: The name of a delegate is the name of the class, not
- the return type of the invoke method. Don't show the delegate parameters
- unless the 'show class modifiers' flag is set.
-
-2007-09-13 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs: Fixed re opened 82311: Rename fails when we have
- two variables that are called the same. (another issue).
-
-2007-09-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/LanguageItemVisitor.cs: Properly resolve "this". Fixes bug #82503.
-
-2007-09-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Allow showing intrinsic names only when
- resolving is, as or new.
- * Gui/FormattingPanel.cs, CSharpBinding.mdp,
- gtk-gui/CSharpBinding.FormattingPanelWidget.cs, gtk-gui/gui.stetic:
- Updated.
- * Parser/Resolver.cs: The text editor extension needs internalResolve to
- return the real array types, not only System.Array. Fixes bug #82831.
- * CSharpAmbience.cs: Add support for the new UseIntrinsicNames flag.
-
-2007-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Don't include abstract classes in the
- 'new' completion list.
-
-2007-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/TypeVisitor.cs: Use the fully qualified name when returning the
- type for array items. Fixes bug #82830.
-
-2007-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs, Parser/TypeVisitor.cs: The 'this' reference is not
- valid outside of a class member. Fix for bug #82743.
-
-2007-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/ChooseRuntimePanel.cs, Gui/CodeGenerationPanel.cs,
- FormattingStrategy/CSharpFormattingStrategy.cs, CSharpAmbience.cs: Fix
- warnings.
- * Gui/CSharpTextEditorExtension.cs, Parser/Resolver.cs: Disable code
- completion inside enum declarations. Fixes bug #82541. Removed some
- warnings.
- * gtk-gui/generated.cs, gtk-gui/CSharpBinding.CodeGenerationPanelWidget.cs,
- gtk-gui/CSharpBinding.FormattingPanelWidget.cs, gtk-gui/gui.stetic:
- Updated.
-
-2007-09-12 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Fixed 82770: MonoDevelop should keep in
- comments when return is pressed.
-
-2007-09-12 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Fixed 82768: Move cursor after new
- summary comment.
-
-2007-09-12 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs: Fixed 82311: Rename fails when we have two
- variables that are called the same.
-
-2007-09-11 Ankit Jain <jankit@novell.com>
-
- * CSharpBindingCompilerManager.cs (Compile): Pass /warn: command line
- param.
-
-2007-09-11 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs: Fixed 82500: Rename refactoring enum value
- crashes MonoDevelop.
-
-2007-09-10 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Resolver.cs: Fixed 82760: Nul ref enableing autocomplete.
-
-2007-09-10 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Fixed 82223: Overload selection does not
- work when breaking the line.
-
-2007-09-10 <>
-
- * Gui/CSharpTextEditorExtension.cs: Fixed 82683: MonoDevelop should generate
- XML documentation when /// is typed.
-
-2007-09-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Track api changes.
-
-2007-09-07 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Resolver.cs: Fixed 82505: No autocomplete for static members. Fixed
- some other resolve cases too. (non static members only in non static
- methods)
-
-2007-09-07 Mike Krüger <mkrueger@novell.com>
-
- * Parser/CodeGenerator.cs: Handled bug 82714: Invalid offset in text editor.
-
-2007-08-31 Mike Krüger <mkrueger@novell.com>
-
- * Gui/ChooseRuntimePanel.cs, Gui/CodeGenerationPanel.cs,
- Gui/FormattingPanel.cs, Parser/Resolver.cs,
- FormattingStrategy/CSharpFormattingStrategy.cs,
- FormattingStrategy/CSharpFormattingProperties.cs,
- gtk-gui/CSharpBinding.CodeGenerationPanelWidget.cs,
- gtk-gui/CSharpBinding.FormattingPanelWidget.cs, CSharpAmbience.cs:
- Changes due to new property infrastructure.
-
-2007-08-24 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Fixed 82555: Xml comments activating
- incorrectly.
-
-2007-08-23 Mike Krüger <mkrueger@novell.com>
-
- * CSharpEnhancedCodeProvider.cs, Parser/Parser.cs, Parser/CSharpVisitor.cs,
- Parser/CodeGenerator.cs, Parser/Resolver.cs, Parser/TypeVisitor.cs,
- Parser/LanguageItemVisitor.cs,
- Parser/SharpDevelopTree/GenericParameter.cs,
- Parser/SharpDevelopTree/Destructor.cs,
- Parser/SharpDevelopTree/Method.cs,
- Parser/SharpDevelopTree/ReturnType.cs, Parser/SharpDevelopTree/Class.cs,
- Parser/SharpDevelopTree/Constructor.cs: Changed to the latest NRefactory
- version.
-
-2007-08-23 Ankit Jain <jankit@novell.com>
-
- * CSharpBindingCompilerManager.cs (GetResourceId): Set the resource id
- correctly even if resgen is not required.
-
-2007-08-23 Ankit Jain <jankit@novell.com>
-
- Fix bug #82533.
- * CSharpBindingCompilerManager.cs (GetResourceId): Generate .resources
- with resgen only if required.
-
-2007-08-21 Andrés G. Aragoneses <knocte@gmail.com>
-
- Improve fix for bug #82398.
- * CSharpBindingCompilerManager.cs (GetResourceId): Use MONO_IOMAP=drive,
- and only on Unix.
-
-2007-08-20 Ankit Jain <jankit@novell.com>
-
- * CSharpBindingCompilerManager.cs (Compile): Add all build files to the
- list of files to be compiled. Don't filter with CanCompile.
-
-2007-08-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: When listing the members of an enum, return enum
- members only (it is correct to call static methods using an enum type
- reference, but it doesn't make much sense). Fixes bug #82250.
-
-2007-08-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Method parameters must be resolved before class
- members. Fixes bug #82391.
-
-2007-08-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Fix possible infinite recursion (bug #82303).
-
-2007-08-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Properly set the showStatic flag after finding a
- member in SearchMember. Fixes a problem with nested classes and enums:
- members were not properly shown.
-
-2007-08-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Properly resolve inner class names. Fixes part of
- #82414.
-
-2007-08-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: When resolving a var name, parameters have priority
- over fields.
-
-2007-08-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Include arguments in the resolve list for CtrlSpace.
- Fixes bug #82391.
-
-2007-08-14 Ankit Jain <jankit@novell.com>
-
- Fix bug #82398.
- * CSharpBindingCompilerManager.cs (GetResourceId): Run resgen with
- MONO_IOMAP=all.
-
-2007-08-14 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs,
- FormattingStrategy/CSharpIndentEngineStack.cs,
- FormattingStrategy/CSharpIndentEngine.cs: Added support for
- documentation comments
-
- (fixes bug 78578: Add XML Comment support to MonoDevelop and
- integrate with tooltips).
-
- + Auto complete of /// tags
-
- + code completion for the xml documentation tags
-
- + auto generation of a header body
-
-2007-08-13 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Started to work on xml comment tag
- support.
-
-2007-08-10 Ankit Jain <jankit@novell.com>
-
- Fix bug #82394.
- * CSharpBindingCompilerManager.cs (Compile): Abort build if error while
- generating resources.
- (GetResourceId): Refactor slightly to report error. Also, parse
- the line/col number for the CompilerError.
- (RegexErrorLinePos): New.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml, Autotools/Makefile.am, CSharpBinding.mdp,
- Makefile.am: Reorganized the extension point hierarchy. Embedded all
- add-in manifests as resources.
-
-2007-07-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/CSharpSessionStateWebService.xft.xml,
- templates/CSharpWebService.xft.xml: Removed unused files.
-
-2007-07-30 Jeffrey Stedfast <fejj@novell.com>
-
- * Parser/CodeGenerator.cs: Add ctor references too. Fixes bug
- #82204.
-
- * Gui/CSharpTextEditorExtension.cs: Handle indent-region by
- resetting state so that we don't get confused.
-
-2007-07-27 Jeffrey Stedfast <fejj@novell.com>
-
- * FormattingStrategy/CSharpFormattingStrategy.cs (FormatLine):
- Fixed to be a no-op.
-
-2007-07-25 Jeffrey Stedfast <fejj@novell.com>
-
- Fixes for bug #82179.
-
- * FormattingStrategy/CSharpIndentEngineStack.cs (Push): Added a
- second Push() method allowing the caller to force a particular
- indent.
-
- * FormattingStrategy/CSharpIndentEngine.cs (PushOpenBrace): Trim
- the indent level as we pop FoldedStatements and use
- stack.PeekKeyword(0) instead of stack.PeekKeyword(1).
- (PushFoldedStatement): We no longer stop pushing folded statements
- for any reason, we simply push a folded statement with a set
- indent in those cases (needed for keeping proper track of
- keywords).
-
-2007-07-24 Jeffrey Stedfast <fejj@novell.com>
-
- Part of the fix for bug #82114.
-
- * Parser/CodeGenerator.cs: Override a few more Visit() methods so
- that we pick up class references in CastExpressions,
- VariableDeclarations and ObjectCreateExpressions.
- (AddUniqueReference): New method to add only unique references
- to the collection.
-
-2007-07-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBindingCompilerManager.cs: Write the compiler command used to
- compile the project to the log.
-
-2007-07-18 Jeffrey Stedfast <fejj@novell.com>
-
- * FormattingStrategy/CSharpIndentEngine.cs: A few fixes, including
- one for bug #82055.
-
- * Gui/CSharpTextEditorExtension.cs (IsInUsing): Simplified.
- (GetPreviousToken): Fixed bug #82131.
-
-2007-07-17 Jeffrey Stedfast <fejj@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs (KeyPress): Fixed a bug caused
- when using any key other than Enter to auto-complete (e.g. using a
- '(' or something).
-
-2007-07-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: When resolving a type, include the enclosing
- namespace in the namespace search list. Fixes bug #81865.
- * CSharpBindingCompilerManager.cs: Make sure all output is read after
- running the compilation process. Should fix bug #82092.
-
-2007-07-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Properly resolve type names qualified with a
- namespace alias. Fixes bug #81999.
-
-2007-07-12 Jeffrey Stedfast <fejj@novell.com>
-
- * FormattingStrategy/CSharpIndentEngine.cs (PushNewLine): If we
- just popped a single-line comment, we need to do more processing.
-
-2007-07-11 Ankit Jain <jankit@novell.com>
-
- Fix bug#82024.
- * CSharpBindingCompilerManager.cs (DoCompilation): Workaround for a bug
- in ProcessStartInfo.
-
-2007-07-06 Jeffrey Stedfast <fejj@novell.com>
-
- * Parser/CodeGenerator.cs (Visit::PropertyDeclaration):
- Implemented to fix bug #82020.
-
-2007-07-05 Jeffrey Stedfast <fejj@novell.com>
-
- * Parser/CodeGenerator.cs: (Visit::FieldReferenceExpression):
- Don't limit ourselves to just Fields and Properties. Fixes bug
- #81963.
- (Visit::IdentifierExpression): When checking of a LocalVariable is
- within bounds, use Region.BeginColumn instead of Region.EndColumn
- and swap on which LocalVariable instance we check. Fixes part of
- bug #82020.
-
-2007-07-05 Jeffrey Stedfast <fejj@novell.com>
-
- * Parser/CodeGenerator.cs: Sanity check that both begin and end
- are != -1 to prevent a crash.
- (Visit): When adding a typeDeclaration to the list of references,
- don't add it using the StartLocation - instead, we need to find
- the actual reference offset using StartLocation as a hint. This
- fixes bug #82017.
-
-2007-07-03 Mike Krüger <mkrueger@novell.com>
-
- * CSharpBindingCompilerManager.cs: added signing support.
-
-2007-06-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBindingCompilerManager.cs: Implemented support for additional
- gac roots specified in packages.
-
-2007-06-20 Jeffrey Stedfast <fejj@gnome.org>
-
- Fixes a SmartIndenting bug reported by Latexer on IRC.
-
- * FormattingStrategy/CSharpIndentEngine.cs (PushOpenBrace): When
- inside a Case statement, only use nSpaces = -1 when we are either
- on the line where the case/default label was entered or if the
- first non-lwsp char is the '{', else use nSpaces = 0 so that we
- indent properly.
-
- * FormattingStrategy/CSharpIndentEngineStack.cs (Push): When
- pushing a new Block inside a Case, we can still add an indent
- level if nSpaces != -1.
-
-2007-06-19 Mike Krueger <mkrueger@novell.com>
-
- Changed the C# file icon to look a bit more like gnome.
-
-2007-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * Autotools/Autotools.mdp, CSharpBinding.mdp: Removed unused elements.
-
-2007-05-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Added protection against infinite loop in
- ResolveIdentifier. Fixes bug #81769.
-
-2007-05-25 Jeffrey Stedfast <fejj@gnome.org>
-
- * Parser/CodeGenerator.cs (EncapsulateFieldImpGetSet):
- Implemented.
-
-2007-05-24 Jeffrey Stedfast <fejj@novell.com>
-
- * Parser/TypeVisitor.cs (Visit::IdentifierExpression): Scan parent
- namespaces of the calling class as well. Fixes bug #81543.
-
-2007-05-23 Jeffrey Stedfast <fejj@novell.com>
-
- * Parser/CodeGenerator.cs (GetOptions): Override our base
- implementation.
-
-2007-05-23 Jeffrey Stedfast <fejj@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs:
- MonoDevelop.SourceEditor.Properties namespace no longer exists.
-
- * FormattingStrategy/CSharpIndentEngine.cs: Same.
-
- * Gui/OverrideCompletionData.cs: Same.
-
- * Gui/FormattingPanel.cs: Same.
-
-2007-05-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/TypeVisitor.cs: When resolving an identifier, look first in
- class members, then look for types. Fixes bug #81542.
-
-2007-05-21 Jeffrey Stedfast <fejj@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs (KeyPress): If a region of text
- is selected, then simply pass it along to our base implementation
- and reset our engine state if the region begins somewhere before
- the engine's cursor. Fixes bug #81620.
-
-2007-05-18 Jeffrey Stedfast <fejj@novell.com>
-
- * Parser/CodeGenerator.cs (IsMatchedField): New convenience
- function to do some trivial checks to make sure the 'match' isn't
- in the middle of some other field name (e.g. if the field we are
- looking for is a substring of another field name, we don't want to
- match in the middle of some other field).
- (GetMemberNamePosition): Fixed the IField case to be a bit more
- correct.
- (GetMemberBounds): Overridden base class' implementation for
- IFields so that we can get the subregion for a field declaration
- if it is in the middle of other field declarations within the same
- statement region.
-
-2007-05-19 Ankit Jain <jankit@novell.com>
-
- * CodeGenerationPanel.cs: GetProjectParserContext can fail, handle
- that.
- (Store): Save mainClass and Win32Icon only when relevant.
-
-2007-05-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Cursor already moved to
- position 2 after typing '#'.
-
-2007-05-16 Jeffrey Stedfast <fejj@novell.com>
-
- * Parser/CodeGenerator.cs (EncapsulateField): Implemented so that
- get/set actually have code statements.
-
-2007-05-14 Jeffrey Stedfast <fejj@novell.com>
-
- * Parser/CodeGenerator.cs (RenameClass): Handle renaming of structs,
- enums, and interfaces too.
-
-2007-05-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Include const fields in the static field list.
- Fixes bug #81078.
- * CSharpBinding.mds, gtk-gui/gui.stetic: Updated.
-
-2007-05-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: (GetPreviousToken): Return tokens
- composed by a single char which is not a letter of digits.
-
-2007-05-14 Jeffrey Stedfast <fejj@novell.com>
-
- * Parser/CodeGenerator.cs: Comment out our own implementation of
- AddMember, throwing a NotImplementedException() in generated code
- can be annoying sometimes.
-
-2007-05-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml: Don't use the MD namespace in add-in
- dependencies, since the c# add-in is alread declared in the MS
- namespace.
-
-2007-05-11 Jeffrey Stedfast <fejj@novell.com>
-
- * Parser/CodeGenerator.cs (AddMember): Override default
- implementation so that we can add a statement to throw a
- NotImplementedException.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.mds: Added new c# binding solution.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Autotools/Autotools.mdp, Autotools/Makefile.am: Added project for the
- autotools assembly.
-
-2007-05-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.mdp: Don't copy assembly references.
-
-2007-05-08 Jeffrey Stedfast <fejj@novell.com>
-
- * Parser/CodeGenerator.cs (GetMemberNamePosition): Fixed to
- support IIndexers.
- (FindParameterReference): Updated for API changes, no longer takes
- an IMethod argument.
- (Visit): Fixed up a bit since params can be parented by either an
- IMethod or an IIndexer.
-
-2007-05-04 Jeffrey Stedfast <fejj@novell.com>
-
- * Parser/CodeGenerator.cs (GetParameterNamePosition): Implemented.
-
- * Parser/Resolver.cs (GetMethod): Check if the cursor is within the
- declaration bounds as well, so that parameter searching works.
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Test/Test.cs, Gui/ChooseRuntimePanel.cs, Gui/CodeGenerationPanel.cs,
- CSharpBinding.addin.xml, CSharpBinding.mdp, Makefile.am: Migration
- to Mono.Addins.
-
-2007-05-03 Jeffrey Stedfast <fejj@novell.com>
-
- * Parser/CodeGenerator.cs (GetMemberNamePosition): Fixed IEvent
- and IProperty logic and also greatly simplified the overall code.
-
-2007-05-03 Jeffrey Stedfast <fejj@novell.com>
-
- * Parser/CodeGenerator.cs (FindVariableNamePosition): New
- overloaded function to get the offset of a variable name.
- (FindVariableReferences): New.
- (FindParameterReferences): New.
- (Visit): Added logic for matching LocalVariable and IParameters.
-
-2007-05-02 Jeffrey Stedfast <fejj@novell.com>
-
- * Parser/CodeGenerator.cs (RenameClass): Rename all parts of the class
- (in case the class is a partial class).
-
-2007-05-01 Jeffrey Stedfast <fejj@novell.com>
-
- * Parser/CodeGenerator.cs (CreateReference): Trim the name to the
- base name (we don't want the FullyQualifiedName). Also do some
- fixing of the offset since the expression start offset begins
- before the name of the type (e.g. it includes
- public/private/etc modifiers).
-
-2007-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.mdp: Don't copy referenced assemblies.
- * CSharpBindingCompilerManager.cs: Avoid compiler warning.
-
-2007-04-09 Jeffrey Stedfast <fejj@novell.com>
-
- * FormattingStrategy/CSharpIndentEngineStack.cs: If we are pushing
- a new FoldedStatement, we want to indent another level even if our
- parent is a case-statement (unlike what we do for new Blocks).
-
-2007-03-23 Jeffrey Stedfast <fejj@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs (GetPreviousToken):
- Reimplemented to use GetCharAt().
- (KeyPress): Invalidate engine state if some key-code we don't
- handle changes the buffer before our cursor position.
-
-2007-03-21 Ankit Jain <jankit@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs (HandleCodeCompletion): Handle
- code completion for sub namespaces.
- (IsInUsing): New.
- (GetPreviousToken): Handle the case when token starts at the first
- position in the file.
-
-2007-03-20 Jeffrey Stedfast <fejj@novell.com>
-
- * Gui/CSharpParameterDataProvider.cs (GetCurrentParameterIndex):
- Rewritten to use my CSharpIndentEngine parse tree to hopefully
- solve bug #80883 once and for all.
-
- * Gui/CSharpTextEditorExtension.cs (KeyPress): Instead of using
- engine.IsInsideMultiLineComment when deciding whether or not to
- reindent the line, use engine.LineBeganInsideMultiLineComment
- since that's what we really wanted to know.
-
- * FormattingStrategy/CSharpIndentEngine.cs: Added more convenience
- state properties (such as StackDepth and
- LineBeaganInside[VerbatimString,MultiLineComment].
-
-2007-03-19 Jeffrey Stedfast <fejj@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs (KeyPress): If the before/after
- indent text is identical, then don't replace the text - instead
- calculate what the cursor position would be and set it. (found a
- way to avoid the text selection that occurs when you set
- CursorPosition).
-
- * FormattingStrategy/CSharpIndentEngine.cs (Push): Fix bug #81189
- by resetting popVerbarim when we pop the verbatim string literal
- off the stack
-
-2007-03-16 Jeffrey Stedfast <fejj@novell.com>
-
- * Gui/OverrideCompletionData.cs (InsertMethod, InsertProperty):
- (InsertEvent, InsertIndexer): Use spaces rather than tabs for
- indenting when appropriate. Fixes bug #81168.
-
- * Gui/CSharpTextEditorExtension.cs (GetDirectiveCompletionData):
- Add #pragma to the directives. Fixes bug #81131.
-
-2007-03-14 Jeffrey Stedfast <fejj@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs (KeyPress): Fixed a bug where
- if you typed the full completion text and then used <Enter> to
- complete the fully-typed completion text, the Smart Indent code
- would indent the next line even though it shouldn't have done so.
-
-2007-03-14 Ankit Jain <jankit@novell.com>
-
- * CSharpBindingCompilerManager.cs (Compile): Use 'fname' as the
- filename to embed. It is updated appropriately by GetResourceId().
-
-2007-03-13 Miguel de Icaza <miguel@novell.com>
-
- * CSharpBindingCompilerManager.cs (Compile): an old patch that I
- had lying on my hard drive. When using WinExe targets, pass the
- "winexe" flag to the compiler.
-
- Also pass the actual compiled resource file to be embedded, not
- the source file.
-
-2007-03-13 Jeffrey Stedfast <fejj@novell.com>
-
- * FormattingStrategy/CSharpIndentEngine.cs (PushFoldedStatement):
- Push one anyway if our keyword (or our parent's keyword) is a loop
- or if-else keyword.
-
-2007-03-11 Jeffrey Stedfast <fejj@gnome.org>
-
- * Gui/CSharpTextEditorExtension.cs (KeyPress): Simplified a bit.
- (KeyPress): Changed the logic for the tab-completion check, if
- more than a single char has been inserted then it should be
- considered to be tab-completion.
- (KeyPress): Don't reindent multi-line comment lines unless they
- begin with a '*', in which case the user probably wants to realign
- them (if the first char on the line isn't a '*' then it might be a
- commented-out block of code, we don't want to reindent that).
-
-2007-03-10 Jeffrey Stedfast <fejj@gnome.org>
-
- * FormattingStrategy/CSharpIndentEngineStack.cs (Push): We now
- have an Inside.Case type to implement.
-
- * FormattingStrategy/CSharpIndentEngine.cs (PushColon): Push a
- Inside.Case onto the stack if appropriate and check
- FormattingProperties.IndentCaseLabels to see how we should handle
- indenting for case labels.
- (PushSemicolon): Always set keyword to String.Empty
- (PushOpenBrace): Changed the way we handle psuing a new block onto
- the stack if we our parent is Inside.Case (the logic is the same,
- but the check is a bit different now).
- (PushCloseBrace): If our parent is Inside.Case, then we can pop
- that along with the switch block.
-
- * FormattingStrategy/CSharpFormattingProperties.cs
- (IndentCaseLabels): Implemented.
-
-2007-03-09 Jeffrey Stedfast <fejj@novell.com>
-
- * CSharp.glade: Removed, no longer in use.
-
- * CSharpBinding.addin.xml: Add the c# Formatting options panel to
- the options dialog under the Text Editor options.
-
- * gtk-gui/gui.stetic: Added a new custom FormattingPanelWidget.
-
- * Gui/FormattingPanel.cs: New source file implementing a
- "Formatting" options panel specific to c#.
-
-2007-03-09 Jeffrey Stedfast <fejj@novell.com>
-
- * FormattingStrategy/CSharpIndentEngine.cs (PushColon): Respect
- the style settings for indenting goto labels.
-
- * FormattingStrategy/CSharpFormattingProperties.cs: New source
- file for c#-specific formatting properties.
-
-2007-03-09 Jeffrey Stedfast <fejj@novell.com>
-
- * FormattingStrategy/CSharpIndentEngine.cs (Push): Fixed a goof
- from yesterday's commit.
-
- * Gui/CSharpTextEditorExtension.cs (KeyPress): Rearranged some
- logic a bit to optimize seeking in the text buffer using arrow
- keys.
-
-2007-03-08 Jeffrey Stedfast <fejj@novell.com>
-
- * FormattingStrategy/CSharpIndentEngine.cs: Got rid of the hack
- that used this.commentEndedAt which was not only nasty, but didn't
- even always work right to begin with.
-
-2007-03-07 Jeffrey Stedfast <fejj@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs (KeyPress): Same sort of fix as
- earlier wrt the user hitting Tab. If the user hits <Enter> and the
- base class does not insert a '\n', then it means the user has just
- accepted an auto-completed selection. In this case, return -
- there's nothing left for us to do.
-
- * FormattingStrategy/CSharpIndentEngineStack.cs (Push): Added a
- work-around for pushing a multi-line anonmymous method {} block
- inside a ParenList (e.g. as a callback argument).
-
- * FormattingStrategy/CSharpIndentEngine.cs (PushHash): Doh, how
- did I overlook this method when integrating my IndentEngine into
- MD?
- (PushNewLine): Properly handle multi-line array assignments.
-
- Fix for making "default :" (as opposed to "default:") inside a
- switch-statement work as it should, lwsp is not significant here.
-
- * FormattingStrategy/CSharpIndentEngine.cs (PushOpenParen): Clear
- the keyword after pushing a new ParenList onto the stack, when the
- ParenList is popped, the keyword is restored.
- (Reset): Changed the semantics of wordStart, this now initializes
- to -1 instead of 0.
- (PushNewLine): Reset wordStart back to -1.
- (Push): When checking for a keyword, we don't need to use
- lastNonLwsp anymore, just use wordStart.
- (Push): wordStart should always be set to point to the beginning
- of a word token (and never to word-delimiting chars like it was
- before).
-
-2007-03-07 Jeffrey Stedfast <fejj@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs (KeyPress): Fixed a bug
- preventing tab-completion from working by chaining the KeyPress()
- to the parent.
-
-2007-03-07 Jeffrey Stedfast <fejj@novell.com>
-
- * FormattingStrategy/CSharpIndentEngine.cs: Fixed bug #81065 by
- looking at the last significant char on the line. Also now keeping
- the last char typed as part of the state so as to avoid having to
- linebuf.ToString() and then look.
-
-2007-03-06 Jeffrey Stedfast <fejj@novell.com>
-
- * FormattingStrategy/CSharpIndentEngine.cs: New class to aid in
- smart indenting.
-
- * FormattingStrategy/CSharpIndentEngineStack.cs: A broken out
- piece of CSharpIndentEngine.cs to compartamentalize it a bit.
-
- * FormattingStrategy/CSharpFormattingStrategy.cs
- (SmartIndentLine): Don't do any indenting, Smart Indent is handled
- elsewhere for now.
- (FormatLine): Simplified, because this now only has to worry about '>'
-
- * Gui/CSharpTextEditorExtension.cs (KeyPress): Implement our hooks
- into Smart Indenting here.
-
-2007-02-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/OverrideCompletionData.cs, Gui/CSharpParameterDataProvider.cs,
- FormattingStrategy/CSharpFormattingStrategy.cs: Track api changes.
-
-2007-02-26 Jeffrey Stedfast <fejj@novell.com>
-
- * FormattingStrategy/CSharpFormattingStrategy.cs
- (SmartIndentLine): Instead of wrapping the entire body of the
- function in an if-block, fix it so we swap the logic thus reducing
- the indent level of the main body making it easier to read (more
- likely to fit in the width of your editor window).
- (IsInsideStringOrComment): Completely rewritten to take into
- consideration verbatim string literals, char literals, and
- escaping inside string literals.
- (IsInsideDocumentationComment): Same.
-
-2007-02-24 Zach Lute <zach.lute@gmail.com>
-
- * Gui/CSharpParameterDataProvider.cs: GetCurrentParameterIndex() now
- takes whether or not a comma is inside a string literal into account
- when determining the index. Fixes bug #80883.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Don't show completion windo for
- "using" keyword when written inside a class. Fixes bug #80868.
- * Parser/Resolver.cs: Removed unneeded parameter and fix potential
- nullref.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml: Change add-in versions to 0.13.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: When checking for accessibility take into account
- the qualifier type. There are some restrictions when accessing to
- protected members from incorrect qualifier types.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs, Parser/LanguageItemVisitor.cs: Properly resolve
- generic type identifiers. Fixes bug #80840.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/LanguageItemVisitor.cs, Parser/TypeVisitor.cs: When resolving
- a field reference, look for static members if instance members
- can't be found. Fixes bug #80841.
-
-2007-02-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.mdp: Added project reference for NRefactory.
- * Parser/CSharpVisitor.cs: Collect parameter flags when parsing a
- method. Fixes bug #80814.
-
-2007-02-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Allow crossing line boundaries when
- looking for tokens. Fixes bug #80719.
- * CSharpBindingCompilerManager.cs: Handle internal packages.
-
-2007-02-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpAmbience.cs: When converting a class, honor
- UseFullyQualifiedName flag.
- * Makefile.am: distcheck fixes
-
-2007-02-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.mdp: Updated.
- * gtk-gui/CSharpBinding.CodeGenerationPanelWidget.cs,
- gtk-gui/gui.stetic: Translation fixes.
-
-2007-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/OverrideCompletionData.cs: Moved from CSharpTextEditorExtension.
- * Gui/CSharpParameterDataProvider.cs, Gui/CSharpTextEditorExtension.cs,
- CSharpBinding.mdp, Makefile.am: Implemented support for parameter
- information window.
- * Parser/Resolver.cs: When searching a class, look in the calling class
- namespace before looking in using directives. Some fixes for
- generic types.
- * Parser/CodeGenerator.cs: Some fixes for generic types.
- * Parser/SharpDevelopTree/ReturnType.cs: Use our own system type table,
- since the one from NRefactory has some VB types and does case
- insensitive lookups.
- * CSharpAmbience.cs: Added some ConvertTypeName calls to show the
- correct name for instantiated generic types.
-
-2007-02-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.mdp,
- gtk-gui/CSharpBinding.CodeGenerationPanelWidget.cs,
- gtk-gui/gui.stetic, Makefile.am: i18n fixes.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: Cosmetic fixes in code completion
- of "new".
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs, Parser/Resolver.cs: Implemented
- code completion for "throw new". Don't show interfaces and abstract
- classes when completing "new".
- * Parser/Parser.cs: Removed.
- * CSharpAmbience.cs: Make sure instantiated generic classes are shown
- with the correct name.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs: When typing '#', move it to the
- first column is there is no other text before. Implemented code
- completion for compiler directives. Don't show sealed methods in
- the overridable list.
-
-2007-02-02 Ankit Jain <jankit@novell.com>
-
- * CSharpBindingCompilerManager.cs (Compile): Move resource compiling code
- to ..
- (GetResourceId): .. here. Improve error messages.
-
-2007-02-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs, Parser/Resolver.cs,
- CSharpAmbience.cs: Code completion of overridable members. Yay!
-
-2007-02-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/CodeGenerator.cs: Properly look for property references.
-
-2007-01-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Properly resolve alias directives. Fixes bug
- #80248.
-
-2007-01-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/LanguageItemVisitor.cs: Properly resolve calls to local
- instance methods.
-
-2007-01-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/CSharpVisitor.cs: When creating an enum, explicitely add the
- System.Enum base class. Make enum files "const".
- * Parser/Resolver.cs: Removed some debug code. Show enum fields only
- when resolving the type only. Fixes bug #80088.
-
-2007-01-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Fix overloaded operator filter.
-
-2007-01-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/CSharpVisitor.cs, Parser/TypeVisitor.cs: Implemented support
- for overloaded operators.
- * Parser/Resolver.cs: Exclude operators from the resolve list.
- * Parser/LanguageItemVisitor.cs: When resolving overloads, try to find
- the closes matching signature.
- * Parser/ExpressionFinder.cs, Parser/SharpDevelopTree/Method.cs: Fix
- warnings.
- * CSharpAmbience.cs: Properly format method names for overloaded
- operators.
-
-2007-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/CSharpBinding.CodeGenerationPanelWidget.cs,
- gtk-gui/gui.stetic: Updated.
-
-2007-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CodeGenerationPanel.cs, CSharpBindingCompilerManager.cs,
- Project/CSharpCompilerParameters.cs: Implemented support for
- CodePage and Win32Icon options.
- * CSharpBinding.mdp, Makefile.am: Updated.
- * gtk-gui/CSharpBinding.CodeGenerationPanelWidget.cs,
- gtk-gui/generated.cs, gtk-gui/gui.stetic: Implement the options
- panel using stetic.
-
-2007-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CSharpTextEditorExtension.cs, CSharpBinding.addin.xml: Created
- new text editor extension to properly support code completion.
- * CSharpBinding.mdp, Makefile.am: Updated.
- * Parser/CSharpVisitor.cs, Parser/TypeVisitor.cs,
- Parser/LanguageItemVisitor.cs,
- Parser/SharpDevelopTree/Destructor.cs,
- Parser/SharpDevelopTree/Method.cs,
- Parser/SharpDevelopTree/ReturnType.cs,
- Parser/SharpDevelopTree/Constructor.cs: Track api changes.
- * Parser/Resolver.cs: Track api changes. Properly resolve instantiated
- generic types.
- * CSharpAmbience.cs: Properly show generic type names.
-
-2007-01-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/LanguageItemVisitor.cs: Properly resolve method overloads.
- Fixes bug #77418.
-
-2007-01-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.mdp: Removed old dependency.
- * Parser/TypeVisitor.cs, Parser/SharpDevelopTree/ReturnType.cs: Take
- into account that the parser returns array dimensions starting at
- 0, not at 1. Fixed some issues when resolving indexer types. Fixes
- bug #79382.
- * Parser/LanguageItemVisitor.cs: When visiting an indexer, if there is
- no indexer (it can be an array access), return the target type.
- * templates/GtkSharp2Project.xpt.xml: Fix template.
-
-2007-01-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/GtkSharp2Project.xpt.xml: Use the new partial class model.
-
-2007-01-11 Ankit Jain <jankit@novell.com>
-
- * CSharpBindingCompilerManager.cs (Compile): Echo resgen command line
- for debugging purpose.
-
-2007-01-11 Ankit Jain <jankit@novell.com>
-
- * CSharpBindingCompilerManager.cs (Compile): .resx file has paths
- relative to the .resx file itself.
-
-2006-12-21 Ankit Jain <jankit@novell.com>
-
- * CSharpBindingCompilerManager.cs (Compile): Use project's base
- directory as the working directory when invoking the compiler.
- (DoCompilation): Add param 'working_dir'.
-
-2006-12-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBindingCompilerManager.cs: Track changes in FileService API.
-
-2006-12-15 Ankit Jain <jankit@novell.com>
-
- * CSharpBindingCompilerManager.cs (Compile): Filename arg to resgen
- should be quoted.
-
-2006-12-15 Ankit Jain <jankit@novell.com>
-
- * CSharpBindingCompilerManager.cs (Compile): Use resgen to convert .resx
- to embeddable resource format (.resources). Handle 'null' resourceId.
-
-2006-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.mdp, Parser/SharpDevelopTree/CompilationUnit.cs,
- Parser/SharpDevelopTree/Indexer.cs,
- Parser/SharpDevelopTree/Parameter.cs,
- Parser/SharpDevelopTree/Event.cs, Parser/SharpDevelopTree/Field.cs,
- Parser/SharpDevelopTree/Property.cs, Makefile.am: Removed some
- unnecessary Default* subclasses.
- * Parser/Parser.cs, Parser/CSharpVisitor.cs, Parser/Resolver.cs,
- Parser/SharpDevelopTree/Destructor.cs,
- Parser/SharpDevelopTree/Method.cs,
- Parser/SharpDevelopTree/ReturnType.cs,
- Parser/SharpDevelopTree/Class.cs,
- Parser/SharpDevelopTree/Constructor.cs,
- Parser/SharpDevelopTree/AttributeSection.cs: Renamed Abstract*
- classes to Default*. Removed some unnecessary Default* subclasses.
-
-2006-12-13 Ankit Jain <jankit@novell.com>
-
- * Project/CSharpCompilerParameters.cs (Win32Resource): New.
- * CSharpBindingCompilerManager.cs (Compile): Generate
- option for Win32Resource. Don't generate option for win32icon
- if win32resource is defined.
-
-2006-12-12 Ankit Jain <jankit@novell.com>
-
- * CSharpBindingCompilerManager.cs (Compile): Use ProjectFile.ResourceId
- for embedded resources.
-
-2006-11-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Parser.cs: Why ParseMethodModies was set to false?
- re-enabling. Fixes local variable code completion.
-
-2006-11-14 Ankit Jain <jankit@novell.com>
-
- * Gui/CodeGenerationPanel.cs (CodeGenerationPanelWidget.ctor): Add
- missing 'Module' option for compile target.
-
-2006-11-13 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * Parser/SharpDevelopTree/CompilationUnit.cs: returning Tag colection
- * Parser/Parser.cs: filling comments into compilation unit
-
-2006-11-11 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * Gui/CodeGenerationPanel.cs: fix for bug 79199
-
-2006-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Fixed null check.
-
-2006-09-12 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * CSharpBindingCompilerManager.cs: Fixed win32 pathing issues, removed old mcs-specific compiler options (that weren't being used since [g]mcs options have been aligned with csc options), removed /bin/sh dependence.
- * Project/CSharpCompilerParameters.cs: Changed default compiler to mcs.
-
-2006-09-12 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * Parser/CSharpVisitor.cs: Fixed compile warning.
- * CSharpAmbience.cs: Track changes in Ambience.
-
-2006-09-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding/CSharpAmbience.cs: Avoid appending the class
- name twice.
-
-2006-08-07 Philip Turnbull <philip.turnbull@gmail.com>
-
- * CSharpBinding/CSharpBinding.addin.xml:
- Changed CSharpAmbience name from 'CSharp' to 'C#'.
-
- * CSharpBinding/CSharpAmbience.cs:
- Track API changes in Ambience.
-
-2006-08-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Added null check.
-
-2006-07-30 Matej Urbas <matej.urbas@gmail.com>
-
- * CSharpAmbience.cs: Fixed a curious null exception.
- * Parser/CSharpVisitor.cs: Updated the visitor to store generic data as
- parsed by NRefactory.
- * Parser/LanguageItemVisitor.cs:
- * Parser/TypeVisitor.cs: Updated the way various expressions are
- treated in the code - to accommodate to new data for generics.
- * Parser/SharpDevelopTree/ReturnType.cs: Added support for generics in
- return types.
-
- * Parser/SharpDevelopTree/GenericParameter.cs: The new file
- * CSharpBinding.mdp: Added the new file to the project.
- * Makefile.am: Added the new file to the project.
-
-2006-07-28 Matej Urbas <matej.urbas@gmail.com>
-
- * CSharpAmbience.cs: Fixed the way generics and delegates are shown in the
- code completion popup, and made some optimizations along the way.
-
-2006-07-23 Matej Urbas <matej.urbas@gmail.com>
-
- * CSharpAmbience.cs: Small cosmetic corrections when converting generic
- types
-
-2006-07-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Autotools/CSharpAutotoolsSetup.cs: Support compilation with gmcs.
- * CSharpBindingCompilerManager.cs: Track changes in SystemAssemblyService.
-
-2006-07-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Use a more meaningful name for the "current unit".
- Store the name of the file being resolved in currentFile.
- Changed SearchVariable, so it now returns a LocalVariable object,
- with all information, including the region.
- * Parser/LanguageItemVisitor.cs: Fix crash when processing indexers.
- Return valid values for object creation expressions.
- * Parser/SharpDevelopTree/ReturnType.cs: Added constructor which
- takes a properly resolved class as parameter.
-
-2006-07-10 Alejandro Serrano <trupill@yahoo.es>
-
- * CSharpAmbience.cs: Add support for generics ambience.
- * Autotools/Makefile.am: Fixed error on compilation because
- of a not found reference.
-
-2006-07-05 Matej Urbas <matej.urbas@gmail.com>
-
- * CSharpAmbience.cs: Fixed a regression that displayed all base types of a
- class to be of PersistentReturnType type.
- * Parser/CodeGenerator.cs:
- * Parser/CSharpVisitor.cs:
- * Parser/Resolver.cs: Updated to use ReturnType as BaseTypes in IClass
- instances.
-
-2006-07-04 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * CSharpEnhancedCodeProvider.cs: Fix parsing of imports
-
-2006-07-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpLanguageBinding.cs:
- * CSharpBindingCompilerManager.cs: Track changes in ProjectReference.
- Removed obsolete GenerateMakefile method.
- * Parser/CodeGenerator.cs: Fix member reference location.
- * Parser/ExpressionFinder.cs: Fix warning.
- * CSharpBinding.addin.xml: Updated versions.
-
-2006-06-29 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * CSharpBinding.mdp:
- * Makefile.am:
- * CSharpEnhancedCodeProvider.cs:
- New file, implements CodeDom methods CreateParser and Parse.
-
- * CSharpLanguageBinding.cs: Use new CSharpEnhancedCodeProvider.
-
- * CSharpBinding.addin.xml: Bump version so that AspNetAddIn can take
- a dependency on the CodeProvider's CreateParser method.
-
-2006-06-15 Scott Ellington <scott.ellington@gmail.com>
-
- * Autotools/CSharpAutotoolsSetup.cs:
-
-2006-06-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml: Use the DataType element instead fof Class
- to declare serializable types.
-
-2006-06-07 Scott Ellington <scott.ellington@gmail.com>
-
- * CSharpBinding.addin.xml:
- * Autotools/CSharpAutotoolsSetup.cs:
- * Autotools/Makefile.am:
- * Makefile.am:
- Add optional module for implementing simple autotools support
-
-2006-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Parser.cs:
- * Parser/CSharpVisitor.cs:
- * Parser/Resolver.cs:
- * Parser/TypeVisitor.cs:
- * Parser/CodeGenerator.cs:
- * Parser/LanguageItemVisitor.cs:
- * Parser/ExpressionFinder.cs:
- * Parser/SharpDevelopTree/Destructor.cs:
- * Parser/SharpDevelopTree/Indexer.cs:
- * Parser/SharpDevelopTree/Method.cs:
- * Parser/SharpDevelopTree/Event.cs:
- * Parser/SharpDevelopTree/ReturnType.cs:
- * Parser/SharpDevelopTree/Field.cs:
- * Parser/SharpDevelopTree/Property.cs:
- * Parser/SharpDevelopTree/Class.cs:
- * Parser/SharpDevelopTree/Constructor.cs:
- * parse.cs:
- * Makefile.am: Use the new NRefactory library.
-
-2006-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml: Updated versions.
- * CSharpBinding.mdp: Updated.
-
-2006-04-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Fix nullref caused by delegates not having
- a region or bodyRegion. Fixes bug #78143.
-
-2006-04-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpLanguageBinding.cs: Implement GetSupportedClrVersions.
- * CSharpBinding.addin.xml: Added panel por selecting the target
- runtime version.
- * CSharpBindingCompilerManager.cs: Support compilation for .net 2.0.
-
- * Parser/ExpressionFinder.cs:
- * Parser/LanguageItemVisitor.cs: Fixed warnings.
-
-2006-04-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/GladeSharpProject.xpt.xml:
- * templates/GladeSharp2Project.xpt.xml: Remove gnome dependency
- from the glade file template. Fix by Sebastian Dröge.
-
-2006-04-07 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * CSharpBinding.addin.xml: renamed attributes in FileFilter Extension
-
-2006-04-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Reference nunit libraries using $(NUNIT_LIBS).
-
-2006-04-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/GtkSharp2Project.xpt.xml: Fix window
- constructor.
-
-2006-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml: Updated references.
-
-2006-03-24 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * templates/ConsoleProject.xpt.xml: Added namespace clause.
-
-2006-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.mdp: Updated.
- * Makefile.am: Use an unified format. Patch by Matze Braun.
- * CSharpBinding.addin.xml: Updated add-in versions.
-
-2006-03-24 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * Test:
- * Test/Test.cs:
- * Makefile.am:
- Added an initial test which validates that the resolver
- can resolve namespaces.
-
-2006-03-17 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * Parser/Parser.cs:
- * Parser/Resolver.cs:
- Removed unused MonodocResolver.
-
-2006-03-16 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * Parser/LanguageItemVisitor.cs: Make sure that composite
- namespaces are parsed correctly.
-
-2006-03-12 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * CSharp.glade: Marking some strings not to be translated. Not include balast in pot file.
-
-2006-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/CodeGenerator.cs: Fixed issues when finding class
- references. Add text line to found references.
- * Parser/LanguageItemVisitor.cs: Properly resolve primitive
- type aliases.
-
-2006-03-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * CSharpBinding.addin.xml: Moved some templates to MD.Ide.
-
-2006-03-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/CSharpVisitor.cs: Added null check.
-
-2006-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/GtkSharp2Project.xpt.xml: Use the new template syntax.
-
-2006-02-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/CSharpVisitor.cs: Generate parse information for
- delegates.
-
-2006-01-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs:
- * Parser/Parser.cs: Track changes in parser api.
-
-2006-01-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml: Removed BlankCombine template (now
- in MonoDevelop.Ide).
- * Parser/CodeGenerator.cs: Properly find members referenced
- in subclasses.
- * Parser/LanguageItemVisitor.cs: Visit methods must always
- return a ILanguageItem.
-
- * templates/GtkSharpProject.xpt.xml:
- * templates/GnomeSharp2Project.xpt.xml:
- * templates/GladeSharp2Project.xpt.xml:
- * templates/GnomeSharpProject.xpt.xml:
- * templates/GladeSharpProject.xpt.xml: Moved to a Samples subcategories
- for now, to reduce clutter.
-
-2006-01-15 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * Parser/CSharpVisitor.cs: Make sure that a null modifier
- is not passed to the Field constructor which is the case
- for enum members. Fixes bug 77080.
-
-2006-01-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/GtkSharpProject.xpt.xml:
- * templates/GnomeSharp2Project.xpt.xml:
- * templates/GladeSharp2Project.xpt.xml:
- * templates/GnomeSharpProject.xpt.xml:
- * templates/GtkSharp2Project.xpt.xml:
- * templates/GladeSharpProject.xpt.xml: Moved project templates to
- the C# category, since they are C# templates.
-
-2006-01-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * CSharpBinding.mdp: Added Parser/LanguageItemVisitor.cs.
-
- * Parser/Parser.cs: Track api changes. Implemented ResolveIdentifier.
- * Parser/CSharpVisitor.cs: Store attribute values in CodeExpression
- instances.
- * Parser/Resolver.cs: Implemented ResolveIdentifier.
- * Parser/ExpressionFinder.cs: Updated from SharpDevelop.
- * Parser/SharpDevelopTree/AttributeSection.cs: Track api changes.
-
-2005-12-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/CodeGenerator.cs: Track api changes. Added support for
- renaming other member types (untested).
-
-2005-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Parser.cs: Track api changes.
- * CSharpLanguageBinding.cs: Implemented the new methods in
- IDotNetLanguageBinding.
- * CSharpBinding.addin.xml: Removed some templates that don't really
- belong here.
- * CSharpBinding/CSharpBinding.mdp: Updated.
-
- * Parser/SharpDevelopTree/AttributeSection.cs:
- * Parser/CSharpVisitor.cs: Properly collect region and attribute
- information. This is a patch by Alex Gomes.
- Also: properly set the declaring type to class members.
-
- * Parser/Resolver.cs: Added two new methods: ResolveExpressionType
- returns the type of an arbitrary expression. ResolveIdentifier returns
- information about an identifier.
-
- * Parser/SharpDevelopTree/Indexer.cs:
- * Parser/SharpDevelopTree/Method.cs:
- * Parser/SharpDevelopTree/Parameter.cs:
- * Parser/SharpDevelopTree/Event.cs:
- * Parser/SharpDevelopTree/Field.cs:
- * Parser/SharpDevelopTree/Property.cs:
- * Parser/SharpDevelopTree/Class.cs:
- * Parser/SharpDevelopTree/Constructor.cs:
- * Parser/SharpDevelopTree/Destructor.cs: Set the declaring type to
- class members.
-
- * templates/*: Set the correct category, language and project type.
- * Parser/CodeGenerator.cs: Initial implementation of IRefactorer.
-
-2005-11-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/GtkSharpProject.xpt.xml:
- * templates/GnomeSharp2Project.xpt.xml:
- * templates/GladeSharp2Project.xpt.xml:
- * templates/ConsoleProject.xpt.xml:
- * templates/GnomeSharpProject.xpt.xml:
- * templates/GtkSharp2Project.xpt.xml:
- * templates/GladeSharpProject.xpt.xml:
- * templates/Library.xpt.xml: Added a reference to the System assembly
- in all project templates.
-
- * Makefile.am: Rebuild the assembly when resources are modified.
-
-2005-11-09 John Luke <john.luke@gmail.com>
-
- * FormattingStrategy/CSharpFormattingStrategy.cs:
- use trimlineAboveText to decide whether to indent things
- like single line if, else, for, etc.
- second half of fix for bug # 76652
-
-2005-10-28 John Luke <john.luke@gmail.com>
-
- * FormattingStrategy/CSharpFormattingStrategy.cs:
- improve indentLine slightly, we want the indention +
- trimmed line, not the addional whitespace in front of it
- remove some old disabled/unported code
-
-2005-10-23 John Luke <john.luke@gmail.com>
-
- * CSharpBinding.addin.xml: add FormattingStrategy
-
-2005-10-11 John Luke <john.luke@gmail.com>
-
- * CSharpAmbience.cs: comment out SharpAssembly stuff
-
-2005-10-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml: Fixed incorrect class name.
-
-2005-10-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml: Fixed addin header information.
- Use "id" attribuet instead of "name" to identify addins.
-
-2005-10-06 John Luke <john.luke@gmail.com>
-
- * CSharpBindingCompilerManager (GenerateMakefile): fix mistaken
- empty statement warning
-
-2005-10-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml:
- * CSharpLanguageBinding.cs: Register serializable types in the addin
- configuration file.
-
-2005-10-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBinding.addin.xml: Added addin dependencies.
-
-2005-09-23 Peter Johanson <latexer@gentoo.org>
-
- * CSharpBindingCompilerManager.cs: Fix mcs location detection.
-
-2005-08-20 Peter Johanson <latexer@gentoo.org>
-
- * templates/GnomeSharp2Project.xpt.xml:
- * templates/GladeSharp2Project.xpt.xml:
- * templates/GtkSharp2Project.xpt.xml: Change gtk-sharp references to
- match new assembly versions.
-
-2005-08-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpAmbience.cs: Don't include the inheritance tree when converting
- an enum.
-
-2005-08-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/*:
- * CSharpBinding.addin.xml: Properly reference resource icons and
- templates.
- * Makefile.am: Embed icon and templates as resources.
-
-2005-08-10 Ben Motmans <ben.motmans@gmail.com>
-
- * CSharpBinding.mdp: references update
-
-2005-08-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBindingCompilerManager.cs: Disable implicit references to
- system assemblies. All references must now be explicitely specified.
-
-2005-08-06 Ben Motmans <ben.motmans@gmail.com>
-
- * CSharpBindingCompilerManager.cs: correctly parse mcs errors.
-
-2005-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Parser.cs:
- * Parser/Resolver.cs:
- * Gui/CodeGenerationPanel.cs: Use the new IParserContext API.
-
- * Parser/TypeVisitor.cs: Made the class internal.
-
-2005-07-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharp.glade:
- * Gui/CodeGenerationPanel.cs: Use a combo entry for the main class
- field. Disable that entry when building a library.
-
-2005-07-14 Ben Motmans <ben.motmans@gmail.com>
-
- * templates/GladeSharp2Project.xpt.xml:
- removed duplicate reference to glade-sharp-2.0
-
-2005-07-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/CSharpCompilerParameters.cs: Implement ICloneable.
- * CSharpLanguageBinding.cs: CreateCompilationParameters now returns an
- ICloneable.
-
-2005-05-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharp.glade: Several fixes to make the dialogs more conforming
- to the HIG.
-
-2005-04-17 John Luke <john.luke@gmail.com>
-
- * Makefile.am: fix distcheck
-
-2005-04-09 John Luke <john.luke@gmail.com>
-
- * PrettyPrinter: kill (it was empty)
- * Parser/ExpressionFinder.cs: remove redundent assignment
- to fix warning
- * Gui/CodeGenerationPanel.cs: remove unused StringParserService
- section
-
-2005-03-20 John Luke <john.luke@gmail.com>
-
- * CSharpBindingCompilerManager.cs: display warning on invalid
- reference lookup, partial fix for bug #70645
-
-2005-03-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Track api changes.
-
-2005-02-16 Ben Motmans <ben.motmans@gmail.com>
-
- * ConsoleProject.xpt.xml:
- * CSharpSessionStateWebService.xpt.xml:
- * CSharpWebService.xpt.xml:
- * Library.xpt.xml:
- Consistent naming
-
- * GladeSharp2Project.xpt.xml:
- * GnomeSharp2Project.xpt.xml:
- * GtkSharp2Project.xpt.xml:
- * CSharpBinding.addin.xml:
- * Makefile.am:
- Added templates
-
-2005-02-18 John Luke <john.luke@gmail.com>
-
- * CSharpCompilerManager.cs: pass /optimize if enabled
-
-2005-02-05 John Luke <john.luke@gmail.com>
-
- * Gui/CodeGenerationPanel.cs: enable doc generation
-
-2005-02-01 John Luke <john.luke@gmail.com>
-
- * Parser/Parser.cs: use ErrorInfo
-
-2005-01-28 John Luke <john.luke@gmail.com>
-
- * Parser/Resolver.cs (IsAccessible):
- internal should return true
- fixes bug# 60526
-
-2005-01-28 John Luke <john.luke@gmail.com>
-
- * Parser/Resolver.cs: remove incorrect special case
- for properties that made them visible to completion
- incorrectly on static to instance and vice-versa
- fixes bug# 69741
-
-2005-01-28 John Luke <john.luke@gmail.com>
-
- * Parser/Parser.cs: update to CanParse
- * Parser/*.cs: update some minor fixes from SD
-
-2005-01-27 John Luke <john.luke@gmail.com>
-
- * CSharpBindingCompilerManager.cs:
- * Parser/CSharpVisitor.cs:
- * Parser/Resolver.cs:
- * FormattingStrategy/CSharpFormattingStrategy.cs: comment out
- some unused lines that produced warnings
-
-2005-01-27 John Luke <john.luke@gmail.com>
-
- * CSharp.glade: update to new glade format
- * Gui/CodeGenerationPanel.cs:
- * CSharp.glade: use ComboBox instead of OptionMenu
-
-2005-01-26 John Luke <john.luke@gmail.com>
-
- * templates/GtkSharpProject.xpt.xml
- * templates/GnomeSharpProgram.xft.xml
- * templates/GladeSharpProject.xpt.xml: clean up,
- consistent naming, spacing, tabbing
-
-2005-01-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpLanguageBinding.cs:
- * CSharpBindingCompilerManager.cs: Use the new progress monitor API.
-
-2005-01-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpLanguageBinding.cs:
- * Gui/ChooseRuntimePanel.cs:
- * Gui/CodeGenerationPanel.cs:
- * CSharpBindingCompilerManager.cs:
- * CSharpBinding.addin.xml:
- * Parser/Parser.cs:
- * Parser/Resolver.cs: Follow architecture changes.
-
- * Project/CSharpCompilerParameters.cs: Moved some parameters and enum
- definitions to DotNetProjectConfiguration.
-
- * CSharp.glade:
- * Gui/OutputOptionsPanel.cs: Removed dialog now implemented in Monodevelop.Base.
-
- * Project/CSharpProject.cs:
- * CSharpBindingExecutionManager.cs.in: Removed. Not needed any more.
-
- * Makefile.am: Updated.
-
-2004-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * CSharpBindingCompilerManager.cs: StatusBarService.ProgressMonitor is
- not a StatusBar widget any more.
-
-2004-12-09 Todd Berman <tberman@off.net>
-
- * CSharpBindingCompilerManager.cs: mcs in Mono 1.1.3 now outputs error
- on stderr instead of stdout. The old code just inspected stdout, now
- we look at both.
-
-2004-12-08 Everaldo Canuto <everaldo_canuto@yahoo.com.br>
-
- * CSharpBindingCompilerManager.cs: Add support to multiple compilers
- in Makefiles generated by MonoDevelop.
-
-2004-12-07 Alexandre Gomes <alexmipego@hotmail.com>
-
- * CSharpLanguageBinding.cs: Added CommentTag to be used by (Un)CommentCode
-
-2004-11-16 Todd Berman <tberman@off.net>
-
- * CSharpBindingCompilerManager.cs: Properly output local assembly
- references.
-
-2004-11-09 Todd Berman <tberman@off.net>
-
- * CSharpBindingCompilerManager.cs: Use SAS for assembly detection.
- This doesnt seem to break anything for me.
-
-2004-11-05 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Parser/Parser.cs: Added HandlesFileExtension to work with new
- IParser
-
-2004-11-01 Todd Berman <tberman@off.net>
-
- * CSharpBindingExecutionManager.cs.in: Add fu to actually properly run
- the execute script.
-
-2004-09-25 Peter Johanson <latexer@gentoo.org>
-
- * CSharpBindingCompilerManager.cs: Hack to a hack to fix compilation
- on 1.1.1 with the new corlib location.
-
-2004-09-20 Valters Svabe <valters@inbox.lv>
-
- * CSharpBindingExecutionManager.cs.in: Respect PauseConsoleOutput
- option.
-
-2004-07-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: When locating the inner or outer classes, get the
- class from the parser service, since it has all type names resolved
- (the one got from the compilation unit does not).
-
-2004-07-05 Todd Berman <tberman@off.net>
-
- * CSharpBindingExecutionManager.cs: removed.
- * CSharpBindingExecutionManager.cs.in: Added
- * Makefile.am: modified.
- This patch is from Marcin Krzyzanowski <krzak@pld-linux.org> and it
- fixes mint issues.
-
-2004-07-04 John Luke <jluke@cfl.rr.com>
-
- * Gui/OutputOptionsPanel.cs: use MessageService, remove ResourceService
-
-2004-07-01 Todd Berman <tberman@off.net>
-
- * Parser/Resolver.cs: fix up CtrlSpace resolving to add this. members
- to the completion window. We need to figure out what is causing the
- public class MyWindow : Window not working but the public class
- MyWindow : Gtk.Window still works and this stuff will look good.
- * Gui/OutputOptionsPanel.cs: remove dup'd namespace.
-
-2004-06-22 John Luke <jluke@cfl.rr.com>
-
- * CSharpBindingCompilerManager.cs: be explicit when copying the
- assembly to avoid silent failures (use build/bin/. not build/bin)
-
-2004-06-17 John Luke <jluke@cfl.rr.com>
-
- * Gui/OutputOptionsPanel.cs: Use MonoDevelop.Gui.Widgets.FileSelector
- instead of Gtk.FileSelection
-
-2004-05-30 Lluis Sanchez Gual <lluis@ximian.com>
-
- * Parser/Resolver.cs: Resolve base classes using a deep search in all
- project references. In SearchType, fixed namespace lookup so it works
- for inner classes as well.
-
-2004-05-27 Todd Berman <tberman@sevenl.net>
-
- * CSharpBindingCompilerManager.cs: fix up projects with space in
- their name.
-
-2004-05-26 Todd Berman <tberman@sevenl.net>
-
- * CSharpBindingCompilerManager.cs: more makefile magic.
-
-2004-05-25 Todd Berman <tberman@sevenl.net>
-
- * Parser/Parser.cs: Update MonodocResolver and IsAsResolver.
- * Parser/Resolver.cs: Update MonodocResolver and IsAsResolver
-
-2004-05-25 Lluis Sanchez Gual <lluis@ximian.com>
-
- * Parser/Parser.cs: Set the file name to the region of each parsed class.
- Added IProject parameter in CtrlSpace and Resolve.
- * Parser/Resolver.cs: Added IProject parameter where needed. Use new
- methods in IParserService.
-
-2004-05-25 Todd Berman <tberman@sevenl.net>
-
- * CSharpLanguageBinding.cs: signature change for GenerateMakefile
- * CSharpBindingCompilerManager.cs: lots of new stuff, make run compat
- stuff, etc, etc
-
-2004-05-22 Todd Berman <tberman@sevenl.net>
-
- * CSharpBindingCompilerManager.cs: add "s to work around potential
- spaces... spaces... urgh. closes bug #58840
-
-2004-05-18 Todd Berman <tberman@sevenl.net>
-
- * CSharpBindingCompilerManager.cs: add a warning to the top of the
- makefiles.
-
-2004-05-18 Todd Berman <tberman@sevenl.net>
-
- * CSharpBindingCompilerManager.cs: change from /option to -option
-
-2004-05-16 Todd Berman <tberman@sevenl.net>
-
- * CSharpBindingCompilerManager.cs: output a much better makefile.
- now using /pkg, checking for deps, etc.
- * Parser/Parser.cs: passthrough for Monodoc resolver.
- * Parser/Resolver.cs: New resolver for identifying a type and sending
- back a monodoc url for it. It needs to be worked on to return proper
- M: style urls in addition to T: style urls.
-
-2004-05-08 Todd Berman <tberman@sevenl.net>
-
- * CSharpBindingCompilerManager.cs: output /define and /main properly.
-
-2004-05-08 Todd Berman <tberman@sevenl.net>
-
- * CSharpBindingCompilerManager.cs: output /unsafe properly.
-
-2004-04-29 Todd Berman <tberman@sevenl.net>
-
- * CSharpBindingCompilerManager.cs: add a clean target
-
-2004-04-28 Todd Berman <tberman@sevenl.net>
-
- * CSharpBindingExecutionManager.cs: People running apps from the IDE
- can be assumed to want line numbers if we can give them. Adding --debug
- to the execution.
-
-2004-04-28 Todd Berman <tberman@sevenl.net>
-
- * CSharpBindingCompilerManager.cs: add code for project references.
-
-2004-04-28 Todd Berman <tberman@sevenl.net>
-
- * CSharpBindingCompilerManger.cs: add code for assembly references
- and embeding resources.
-
-2004-04-28 Todd Berman <tberman@sevenl.net>
-
- * CSharpLanguageBinding.cs: implemented GetMakefile passthru.
- * CSharpBindingCompilerManager.cs: dirty dirty dirty first draft run
- through of GenerateMakefile, I have tested this with exactly *one*
- project, and that is all, just wanted to get something in svn.
-
-2004-04-24 Todd Berman <tberman@sevenl.net>
-
- * Parser/Parser.cs: new IsAsResolver passthrough.
- * Parser/Resolver.cs: new IsAsResolver to manage some (limited)
- completion there.
-
-2004-04-23 John Luke <jluke@cfl.rr.com>
-
- * CsharpBindingCompilerManager.cs: add /codepage:utf8
-
-2004-04-19 Todd Berman <tberman@sevenl.net>
-
- * Parser/Resolver.cs: Turn local variables into a properly consumable
- type for code completion.
-
-2004-04-09 Todd Berman <tberman@sevenl.net>
-
- * CSharpBindingCompilerManager.cs: Show that something is going
- on so people dont get too worried. (Speed might need some work)
- * Makefile.am: add glib
-
-2004-04-04 John Luke <jluke@cfl.rr.com>
-
- * CSharpBindingExecutionManager.cs: improve error message
-
-2004-04-03 Todd Berman <tberman@sevenl.net>
-
- * Gui/OutputOptionsPanel.cs:
- * Gui/CodeGenerationPanel.cs: gettextify
-
-2004-04-03 Todd Berman <tberman@sevenl.net>
-
- * Project/CSharpCompilerParameters.cs: duh, refix library target bug
-
-2004-04-01 Todd Berman <tberman@sevenl.net>
-
- * Gui/OutputOptionsPanel.cs: parse resource string, closes bug #56325
-
-2004-03-31 Todd Berman <tberman@sevenl.net>
-
- * CSharpBindingExecutionManager.cs: dont test CompileTarget, for now
- assume *everything* is being run in a terminal and pausing for output.
-
-2004-03-31 Todd Berman <tberman@sevenl.net>
-
- * Makefile.am: i think this fixed nick's bug.
-
-2004-03-28 John Luke <jluke@cfl.rr.com>
-
- * Parser/Resolver.cs: comment some CWL's that were causing exceptions
-
-2003-03-27 Todd Berman <tberman@sevenl.net>
-
- * *: update parser and other things from upstream.
-
-2003-03-26 John Luke <jluke@cfl.rr.com>
-
- * CSharpBindingExecutionManager.cs: use xterm instead of
- gnome-terminal, fixes bug #53689 and also works when people
- don't have gnome-terminal installed
-
-2004-03-22 Todd Berman <tberman@sevenl.net>
-
- * Project/CSharpCompilerParameters.cs: reverse WinExe and Library in
- the enum, closing bug #55881. fix from vdaron
-
-2004-03-21 Todd Berman <tberman@sevenl.net>
-
- * Parser/Parser.cs:
- * Parser/CSharpVisitor.cs:
- * Parser/Resolver.cs:
- * Parser/TypeVisitor.cs:
- * Parser/SharpDevelopTree/Indexer.cs:
- * Parser/SharpDevelopTree/Method.cs:
- * Parser/SharpDevelopTree/Event.cs:
- * Parser/SharpDevelopTree/ReturnType.cs:
- * Parser/SharpDevelopTree/Field.cs:
- * Parser/SharpDevelopTree/Property.cs:
- * Parser/SharpDevelopTree/Constructor.cs:
- * Parser/SharpDevelopTree/Class.cs: changes to reflect brand spankin
- new parser. (from #D)
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/CSharpOutlineTextEditorExtension.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/CSharpOutlineTextEditorExtension.cs
new file mode 100644
index 0000000000..8ee2f4e5f1
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/CSharpOutlineTextEditorExtension.cs
@@ -0,0 +1,520 @@
+//
+// ClassOutlineTextEditorExtension.cs
+//
+// Author:
+// Michael Hutchinson <mhutchinson@novell.com>
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using Gtk;
+
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Ide;
+using MonoDevelop.Components;
+using MonoDevelop.Components.Docking;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.DesignerSupport;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis.CSharp;
+using MonoDevelop.Projects;
+using MonoDevelop.Ide.Editor.Extension;
+using MonoDevelop.Ide.Editor;
+
+namespace MonoDevelop.CSharp.ClassOutline
+{
+ /// <summary>
+ /// Displays a types and members outline of the current document.
+ /// </summary>
+ /// <remarks>
+ /// Document types and members are displayed in a tree view.
+ /// The displayed nodes can be sorted by changing the sorting properties state.
+ /// The sort behaviour is serialized into MonoDevelopProperties.xml.
+ /// Nodes with lower sortKey value will be sorted before nodes with higher value.
+ /// Nodes with equal sortKey will be sorted by string comparison of the name of the nodes.
+ /// The string comparison ignores symbols (e.g. sort 'Foo()' next to '~Foo()').
+ /// </remarks>
+ /// <seealso cref="MonoDevelop.CSharp.ClassOutline.OutlineNodeComparer"/>
+ /// <seealso cref="MonoDevelop.CSharp.ClassOutline.OutlineSettings"/>
+ class CSharpOutlineTextEditorExtension : TextEditorExtension, IOutlinedDocument
+ {
+ SemanticModel lastCU = null;
+
+ MonoDevelop.Ide.Gui.Components.PadTreeView outlineTreeView;
+ TreeStore outlineTreeStore;
+ TreeModelSort outlineTreeModelSort;
+ Widget[] toolbarWidgets;
+ AstAmbience astAmbience;
+
+ OutlineNodeComparer comparer;
+ OutlineSettings settings;
+
+ bool refreshingOutline;
+ bool disposed;
+ bool outlineReady;
+
+
+ public override bool IsValidInContext (DocumentContext context)
+ {
+ return LanguageBindingService.GetBindingPerFileName (context.Name) != null;
+ }
+
+ protected override void Initialize ()
+ {
+ base.Initialize ();
+
+ if (DocumentContext != null)
+ DocumentContext.DocumentParsed += UpdateDocumentOutline;
+ astAmbience = new AstAmbience (TypeSystemService.Workspace.Options);
+ }
+
+ public override void Dispose ()
+ {
+ if (disposed)
+ return;
+ disposed = true;
+ if (DocumentContext != null)
+ DocumentContext.DocumentParsed -= UpdateDocumentOutline;
+ RemoveRefillOutlineStoreTimeout ();
+ lastCU = null;
+ settings = null;
+ comparer = null;
+ base.Dispose ();
+ }
+
+ Widget IOutlinedDocument.GetOutlineWidget ()
+ {
+ if (outlineTreeView != null)
+ return outlineTreeView;
+
+ outlineTreeStore = new TreeStore (typeof(object));
+ outlineTreeModelSort = new TreeModelSort (outlineTreeStore);
+
+ settings = OutlineSettings.Load ();
+ comparer = new OutlineNodeComparer (new AstAmbience (TypeSystemService.Workspace.Options), settings, outlineTreeModelSort);
+
+ outlineTreeModelSort.SetSortFunc (0, comparer.CompareNodes);
+ outlineTreeModelSort.SetSortColumnId (0, SortType.Ascending);
+
+ outlineTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView (outlineTreeStore);
+
+ var pixRenderer = new CellRendererImage ();
+ pixRenderer.Xpad = 0;
+ pixRenderer.Ypad = 0;
+
+ outlineTreeView.TextRenderer.Xpad = 0;
+ outlineTreeView.TextRenderer.Ypad = 0;
+
+ TreeViewColumn treeCol = new TreeViewColumn ();
+ treeCol.PackStart (pixRenderer, false);
+
+ treeCol.SetCellDataFunc (pixRenderer, new TreeCellDataFunc (OutlineTreeIconFunc));
+ treeCol.PackStart (outlineTreeView.TextRenderer, true);
+
+ treeCol.SetCellDataFunc (outlineTreeView.TextRenderer, new TreeCellDataFunc (OutlineTreeTextFunc));
+ outlineTreeView.AppendColumn (treeCol);
+
+ outlineTreeView.HeadersVisible = false;
+
+ outlineTreeView.Selection.Changed += delegate {
+ JumpToDeclaration (false);
+ };
+
+ outlineTreeView.RowActivated += delegate {
+ JumpToDeclaration (true);
+ };
+
+ var analysisDocument = DocumentContext.ParsedDocument;
+ if (analysisDocument != null)
+ lastCU = analysisDocument.GetAst<SemanticModel> ();
+
+ outlineTreeView.Realized += delegate { RefillOutlineStore (); };
+ UpdateSorting ();
+
+ var sw = new CompactScrolledWindow ();
+ sw.Add (outlineTreeView);
+ sw.ShowAll ();
+ return sw;
+ }
+
+ IEnumerable<Widget> IOutlinedDocument.GetToolbarWidgets ()
+ {
+ if (toolbarWidgets != null)
+ return toolbarWidgets;
+
+ var groupToggleButton = new ToggleButton {
+ Image = new ImageView (Ide.Gui.Stock.GroupByCategory, IconSize.Menu),
+ TooltipText = GettextCatalog.GetString ("Group entries by type"),
+ Active = settings.IsGrouped,
+ };
+ groupToggleButton.Toggled += delegate {
+ if (groupToggleButton.Active == settings.IsGrouped)
+ return;
+ settings.IsGrouped = groupToggleButton.Active;
+ UpdateSorting ();
+ };
+
+ var sortAlphabeticallyToggleButton = new ToggleButton {
+ Image = new ImageView (Ide.Gui.Stock.SortAlphabetically, IconSize.Menu),
+ TooltipText = GettextCatalog.GetString ("Sort entries alphabetically"),
+ Active = settings.IsSorted,
+ };
+ sortAlphabeticallyToggleButton.Toggled += delegate {
+ if (sortAlphabeticallyToggleButton.Active == settings.IsSorted)
+ return;
+ settings.IsSorted = sortAlphabeticallyToggleButton.Active;
+ UpdateSorting ();
+ };
+
+ var preferencesButton = new DockToolButton (Ide.Gui.Stock.Options) {
+ TooltipText = GettextCatalog.GetString ("Open preferences dialog"),
+ };
+ preferencesButton.Clicked += delegate {
+ using (var dialog = new OutlineSortingPreferencesDialog (settings)) {
+ if (MonoDevelop.Ide.MessageService.ShowCustomDialog (dialog) == (int)Gtk.ResponseType.Ok) {
+ dialog.SaveSettings ();
+ comparer = new OutlineNodeComparer (new AstAmbience (TypeSystemService.Workspace.Options), settings, outlineTreeModelSort);
+ UpdateSorting ();
+ }
+ }
+ };
+
+ return toolbarWidgets = new Widget[] {
+ groupToggleButton,
+ sortAlphabeticallyToggleButton,
+ new VSeparator (),
+ preferencesButton,
+ };
+ }
+
+ void JumpToDeclaration (bool focusEditor)
+ {
+ if (!outlineReady)
+ return;
+ TreeIter iter;
+ if (!outlineTreeView.Selection.GetSelected (out iter))
+ return;
+
+ var o = outlineTreeStore.GetValue (IsSorting () ? outlineTreeModelSort.ConvertIterToChildIter (iter) : iter, 0);
+
+ var syntaxNode = o as SyntaxNode;
+ if (syntaxNode != null) {
+ Editor.CaretOffset = syntaxNode.SpanStart;
+ } else {
+ Editor.CaretOffset = ((SyntaxTrivia)o).SpanStart;
+ }
+
+ if (focusEditor)
+ Editor.GrabFocus ();
+ }
+
+ static void OutlineTreeIconFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
+ {
+ var pixRenderer = (CellRendererImage)cell;
+ object o = model.GetValue (iter, 0);
+ if (o is SyntaxNode) {
+ pixRenderer.Image = ImageService.GetIcon (((SyntaxNode)o).GetStockIcon (), IconSize.Menu);
+ } else if (o is SyntaxTrivia) {
+ pixRenderer.Image = ImageService.GetIcon (Ide.Gui.Stock.Region, IconSize.Menu);
+ }
+ }
+
+ void OutlineTreeTextFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
+ {
+ var txtRenderer = (CellRendererText)cell;
+ object o = model.GetValue (iter, 0);
+ var syntaxNode = o as SyntaxNode;
+ if (syntaxNode != null) {
+ txtRenderer.Markup = astAmbience.GetEntityMarkup (syntaxNode);
+ } else if (o is SyntaxTrivia) {
+ txtRenderer.Text = ((SyntaxTrivia)o).ToString ();
+ }
+ }
+
+ void IOutlinedDocument.ReleaseOutlineWidget ()
+ {
+ if (outlineTreeView == null)
+ return;
+ var w = (ScrolledWindow)outlineTreeView.Parent;
+ w.Destroy ();
+ if (outlineTreeModelSort != null) {
+ outlineTreeModelSort.Dispose ();
+ outlineTreeModelSort = null;
+ }
+ if (outlineTreeStore != null) {
+ outlineTreeStore.Dispose ();
+ outlineTreeStore = null;
+ }
+ outlineTreeView = null;
+ settings = null;
+ foreach (var tw in toolbarWidgets)
+ tw.Destroy ();
+ toolbarWidgets = null;
+ comparer = null;
+ }
+
+ void RemoveRefillOutlineStoreTimeout ()
+ {
+ if (refillOutlineStoreId == 0)
+ return;
+ GLib.Source.Remove (refillOutlineStoreId);
+ refillOutlineStoreId = 0;
+ }
+
+ uint refillOutlineStoreId;
+ void UpdateDocumentOutline (object sender, EventArgs args)
+ {
+ var analysisDocument = DocumentContext.ParsedDocument;
+ if (analysisDocument == null)
+ return;
+ lastCU = analysisDocument.GetAst<SemanticModel> ();
+ //limit update rate to 3s
+ if (!refreshingOutline) {
+ refreshingOutline = true;
+ refillOutlineStoreId = GLib.Timeout.Add (3000, RefillOutlineStore);
+ }
+ }
+
+ bool RefillOutlineStore ()
+ {
+ Runtime.AssertMainThread ();
+ Gdk.Threads.Enter ();
+ refreshingOutline = false;
+ if (outlineTreeStore == null || !outlineTreeView.IsRealized) {
+ refillOutlineStoreId = 0;
+ return false;
+ }
+
+ outlineReady = false;
+ outlineTreeStore.Clear ();
+ if (lastCU != null) {
+ BuildTreeChildren (outlineTreeStore, TreeIter.Zero, lastCU);
+ TreeIter it;
+ if (IsSorting ()) {
+ if (outlineTreeModelSort.GetIterFirst (out it))
+ outlineTreeView.Selection.SelectIter (it);
+ } else {
+ if (outlineTreeStore.GetIterFirst (out it))
+ outlineTreeView.Selection.SelectIter (it);
+ }
+
+ outlineTreeView.ExpandAll ();
+ }
+ outlineReady = true;
+
+ Gdk.Threads.Leave ();
+
+ //stop timeout handler
+ refillOutlineStoreId = 0;
+ return false;
+ }
+
+ class TreeVisitor : CSharpSyntaxWalker
+ {
+ TreeStore store;
+ TreeIter curIter;
+
+ public TreeVisitor (TreeStore store, TreeIter curIter) : base (SyntaxWalkerDepth.Trivia)
+ {
+ this.store = store;
+ this.curIter = curIter;
+ }
+
+ TreeIter Append (object node)
+ {
+ if (!curIter.Equals (TreeIter.Zero))
+ return store.AppendValues (curIter, node);
+ return store.AppendValues (node);
+ }
+
+ public override void VisitTrivia (SyntaxTrivia trivia)
+ {
+ switch (trivia.Kind ()) {
+ case SyntaxKind.RegionDirectiveTrivia:
+ curIter = Append (trivia);
+ break;
+ case SyntaxKind.EndRegionDirectiveTrivia:
+ TreeIter parent;
+ if (store.IterParent (out parent, curIter))
+ curIter = parent;
+ break;
+ }
+ base.VisitTrivia (trivia);
+ }
+
+ void VisitBody (SyntaxNode node)
+ {
+ var oldIter = curIter;
+
+ foreach (var syntaxNodeOrToken in node.ChildNodesAndTokens ()) {
+ var syntaxNode = syntaxNodeOrToken.AsNode ();
+ if (syntaxNode != null) {
+ Visit (syntaxNode);
+ } else {
+ var syntaxToken = syntaxNodeOrToken.AsToken ();
+ if (syntaxToken.Kind () == SyntaxKind.OpenBraceToken)
+ curIter = Append (node);
+ VisitToken (syntaxToken);
+ }
+ }
+ curIter = oldIter;
+
+ }
+
+ public override void VisitNamespaceDeclaration (NamespaceDeclarationSyntax node)
+ {
+ VisitBody (node);
+ }
+
+ public override void VisitClassDeclaration (ClassDeclarationSyntax node)
+ {
+ VisitBody (node);
+ }
+
+ public override void VisitStructDeclaration (StructDeclarationSyntax node)
+ {
+ VisitBody (node);
+ }
+
+ public override void VisitEnumDeclaration (EnumDeclarationSyntax node)
+ {
+ VisitBody (node);
+ }
+
+ public override void VisitInterfaceDeclaration (InterfaceDeclarationSyntax node)
+ {
+ VisitBody (node);
+ }
+
+ public override void VisitDelegateDeclaration (DelegateDeclarationSyntax node)
+ {
+ base.VisitDelegateDeclaration (node);
+ Append (node);
+ }
+
+ public override void VisitFieldDeclaration (FieldDeclarationSyntax node)
+ {
+ base.VisitFieldDeclaration (node);
+ foreach (var v in node.Declaration.Variables)
+ Append (v);
+ }
+
+ public override void VisitPropertyDeclaration (PropertyDeclarationSyntax node)
+ {
+ base.VisitPropertyDeclaration (node);
+ Append (node);
+ }
+
+ public override void VisitIndexerDeclaration (IndexerDeclarationSyntax node)
+ {
+ base.VisitIndexerDeclaration (node);
+ Append (node);
+ }
+
+ public override void VisitMethodDeclaration (MethodDeclarationSyntax node)
+ {
+ base.VisitMethodDeclaration (node);
+ Append (node);
+ }
+
+ public override void VisitOperatorDeclaration (OperatorDeclarationSyntax node)
+ {
+ base.VisitOperatorDeclaration (node);
+ Append (node);
+ }
+
+ public override void VisitConstructorDeclaration (ConstructorDeclarationSyntax node)
+ {
+ base.VisitConstructorDeclaration (node);
+ Append (node);
+ }
+
+ public override void VisitDestructorDeclaration (DestructorDeclarationSyntax node)
+ {
+ base.VisitDestructorDeclaration (node);
+ Append (node);
+ }
+
+ public override void VisitEventDeclaration (EventDeclarationSyntax node)
+ {
+ base.VisitEventDeclaration (node);
+ Append (node);
+ }
+
+ public override void VisitEventFieldDeclaration (EventFieldDeclarationSyntax node)
+ {
+ base.VisitEventFieldDeclaration (node);
+ foreach (var v in node.Declaration.Variables)
+ Append (v);
+ }
+
+ public override void VisitEnumMemberDeclaration (EnumMemberDeclarationSyntax node)
+ {
+ base.VisitEnumMemberDeclaration (node);
+ Append (node);
+ }
+
+ public override void VisitBlock (BlockSyntax node)
+ {
+ // skip
+ }
+ }
+
+
+ static void BuildTreeChildren (TreeStore store, TreeIter parent, SemanticModel parsedDocument)
+ {
+ if (parsedDocument == null)
+ return;
+
+ var root = parsedDocument.SyntaxTree.GetRoot ();
+
+ var visitor = new TreeVisitor (store, parent);
+ visitor.Visit (root);
+ }
+
+ void UpdateSorting ()
+ {
+ if (IsSorting ()) {
+ // Sort the model, sort keys may have changed.
+ // Only setting the column again does not re-sort so we set the function instead.
+ outlineTreeModelSort.SetSortFunc (0, comparer.CompareNodes);
+ outlineTreeView.Model = outlineTreeModelSort;
+ } else {
+ outlineTreeView.Model = outlineTreeStore;
+ }
+
+ // Because sorting the tree by setting the sort function also collapses the tree view we expand
+ // the whole tree.
+ outlineTreeView.ExpandAll ();
+ }
+
+ bool IsSorting ()
+ {
+ return settings.IsGrouped || settings.IsSorted;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/OutlineNodeComparer.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/OutlineNodeComparer.cs
new file mode 100755
index 0000000000..ea844666b0
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/OutlineNodeComparer.cs
@@ -0,0 +1,293 @@
+//
+// ClassOutlineNodeComparer.cs
+//
+// Authors:
+// Helmut Duregger <helmutduregger@gmx.at>
+//
+// Copyright (c) 2010 Helmut Duregger
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Xml.Serialization;
+
+using Gtk;
+
+using MonoDevelop.Core;
+using MonoDevelop.Ide.TypeSystem;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
+
+namespace MonoDevelop.CSharp.ClassOutline
+{
+ /// <remarks>
+ /// This implementation uses a primary sort key (int based on node's group) and
+ /// a secondary sort key (string based on node's name) for comparison.
+ /// </remarks>
+ /// <seealso cref="MonoDevelop.CSharp.ClassOutline.OutlineSettings"/>
+ class OutlineNodeComparer : IComparer<TreeIter>
+ {
+ const string DEFAULT_REGION_NAME = "region";
+
+ AstAmbience ambience;
+ TreeModel model;
+ OutlineSettings settings;
+ int[] groupTable;
+
+ /// <param name="ambience">
+ /// The ambience used on retrieval of node names.
+ /// </param>
+ /// <param name="settings">
+ /// The properties used on retrieval of node sort keys and sorting settings.
+ /// </param>
+ /// <param name="model">
+ /// The model containing the nodes to compare.
+ /// </param>
+ public OutlineNodeComparer (AstAmbience ambience, OutlineSettings settings, TreeModel model)
+ {
+ this.ambience = ambience;
+ this.settings = settings;
+ this.model = model;
+ BuildGroupTable ();
+ }
+
+ public int Compare (TreeIter a, TreeIter b)
+ {
+ return CompareNodes (model, a, b);
+ }
+
+ /// <summary>
+ /// Compares nodes by primary (group) and secondary (name) sort keys depending on
+ /// sort properties.
+ /// </summary>
+ /// <remarks>
+ /// For methods, constructors and destructors are sorted at the top.
+ /// </remarks>
+ /// <param name="model">
+ /// The TreeModel that the iterators refer to.
+ /// </param>
+ /// <param name="node1">
+ /// The first tree node that will be compared.
+ /// </param>
+ /// <param name="node2">
+ /// The second tree node that will be compared.
+ /// </param>
+ /// <returns>
+ /// Less than zero if nodeA &lt; nodeB
+ /// Zero if nodeA == nodeB.
+ /// Greater than zero if nodeA &gt; nodeB.
+ /// </returns>
+ public int CompareNodes (TreeModel model, TreeIter node1, TreeIter node2)
+ {
+ object o1 = model.GetValue (node1, 0);
+ object o2 = model.GetValue (node2, 0);
+ if (o1 == null) {
+ return o2 == null? 0 : 1;
+ } else if (o2 == null) {
+ return -1;
+ }
+
+ if (settings.IsGrouped) {
+ int groupOrder = GetGroupPriority (o1) - GetGroupPriority (o2);
+ if (groupOrder != 0)
+ return groupOrder;
+
+ var m1 = o1 as BaseMethodDeclarationSyntax;
+ if (m1 != null)
+ return CompareMethods (m1, (BaseMethodDeclarationSyntax)o2, settings.IsSorted);
+ }
+
+ if (settings.IsSorted)
+ return CompareName (o1, o2);
+
+ return CompareRegion (o1, o2);
+ }
+
+ int CompareName (object o1, object o2)
+ {
+ var sort = string.Compare (
+ GetSortName (o1),
+ GetSortName (o2),
+ System.Globalization.CultureInfo.CurrentCulture,
+ System.Globalization.CompareOptions.IgnoreSymbols);
+ if (sort == 0)
+ return CompareRegion (o1, o2);
+ return sort;
+ }
+
+ int CompareMethods (BaseMethodDeclarationSyntax m1, BaseMethodDeclarationSyntax m2, bool isSortingAlphabetically)
+ {
+ // Here we sort constructors before finalizers before other methods.
+ // Remember that two constructors have the same name.
+
+ // Sort constructors at top.
+
+ bool isCtor1 = m1 is ConstructorDeclarationSyntax;
+ bool isCtor2 = m2 is ConstructorDeclarationSyntax;
+
+ if (isCtor1) {
+ if (isCtor2)
+ return CompareRegion (m1, m2);
+ else
+ return -1;
+ } else if (isCtor2) {
+ return 1;
+ }
+
+ // Sort finalizers after constructors.
+ //
+ // Sorting two finalizers even though this is not valid C#. This gives a correct
+ // outline during editing.
+
+ bool isFinalizer1 = IsFinalizer (m1);
+ bool isFinalizer2 = IsFinalizer (m2);
+
+ if (isFinalizer1) {
+ if (isFinalizer2)
+ return CompareRegion (m1, m2);
+ else
+ return -1;
+ } else if (isFinalizer2) {
+ return 1;
+ }
+
+ if (isSortingAlphabetically)
+ return CompareName (m1, m2);
+ else
+ return CompareRegion (m1, m2);
+ }
+
+ bool IsConstructor (object node)
+ {
+ return node is ConstructorDeclarationSyntax;
+ }
+
+ bool IsFinalizer (object node)
+ {
+ return node is DestructorDeclarationSyntax;
+ }
+
+ const int GROUP_INDEX_REGIONS = 0;
+ const int GROUP_INDEX_NAMESPACES = 1;
+ const int GROUP_INDEX_TYPES = 2;
+ const int GROUP_INDEX_FIELDS = 3;
+ const int GROUP_INDEX_PROPERTIES = 4;
+ const int GROUP_INDEX_EVENTS = 5;
+ const int GROUP_INDEX_METHODS = 6;
+
+ void BuildGroupTable ()
+ {
+ groupTable = new int[7];
+ int i = -10;
+ foreach (var g in settings.GroupOrder) {
+ switch (g) {
+ case OutlineSettings.GroupRegions:
+ groupTable[GROUP_INDEX_REGIONS] = i++;
+ break;
+ case OutlineSettings.GroupNamespaces:
+ groupTable[GROUP_INDEX_NAMESPACES] = i++;
+ break;
+ case OutlineSettings.GroupTypes:
+ groupTable[GROUP_INDEX_TYPES] = i++;
+ break;
+ case OutlineSettings.GroupFields:
+ groupTable[GROUP_INDEX_FIELDS] = i++;
+ break;
+ case OutlineSettings.GroupProperties:
+ groupTable[GROUP_INDEX_PROPERTIES] = i++;
+ break;
+ case OutlineSettings.GroupEvents:
+ groupTable[GROUP_INDEX_EVENTS] = i++;
+ break;
+ case OutlineSettings.GroupMethods:
+ groupTable[GROUP_INDEX_METHODS] = i++;
+ break;
+ }
+ }
+ }
+
+ int GetGroupPriority (object node)
+ {
+ if (node is SyntaxTrivia)
+ return groupTable[GROUP_INDEX_REGIONS];
+ if (node is string)
+ return groupTable[GROUP_INDEX_NAMESPACES];
+ if (node is BaseTypeDeclarationSyntax)
+ return groupTable[GROUP_INDEX_TYPES];
+ if (node is FieldDeclarationSyntax)
+ return groupTable[GROUP_INDEX_FIELDS];
+ if (node is PropertyDeclarationSyntax)
+ return groupTable[GROUP_INDEX_PROPERTIES];
+ if (node is EventDeclarationSyntax || node is EventFieldDeclarationSyntax)
+ return groupTable[GROUP_INDEX_EVENTS];
+ if (node is BaseMethodDeclarationSyntax)
+ return groupTable[GROUP_INDEX_METHODS];
+ return 0;
+ }
+
+ /// <summary>
+ /// Returns the name of the node that should be used as a secondary sort key.
+ /// </summary>
+ /// <param name="node">
+ /// A node in the tree. Expected to be either an IMember or a FoldingRegion.
+ /// </param>
+ /// <returns>
+ /// A string representing the secondary sort key.
+ /// The empty string if node is neither an IMember nor a FoldingRegion.
+ /// </returns>
+ string GetSortName (object node)
+ {
+ if (node is SyntaxNode) {
+ // Return the name without type or parameters
+ return ambience.GetEntityMarkup ((SyntaxNode)node);
+ }
+
+ if (node is SyntaxTrivia) {
+ // Return trimmed region name or fallback
+ string name = ((SyntaxTrivia)node).ToString ().Trim ();
+
+ // ClassOutlineTextEditorExtension uses a fallback name for regions
+ // so we do the same here with a slighty different name.
+ if (name.Length == 0)
+ name = DEFAULT_REGION_NAME;
+
+ return name;
+ }
+
+ return string.Empty;
+ }
+
+ internal static int GetOffset (object o)
+ {
+ var m = o as SyntaxNode;
+ if (m != null)
+ return m.SpanStart;
+ // if (o is FoldingRegion)
+ // return ((FoldingRegion)o).Region;
+ return 0;
+ }
+
+ internal static int CompareRegion (object o1, object o2)
+ {
+ return GetOffset (o1).CompareTo (GetOffset (o2));
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/OutlineSettings.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/OutlineSettings.cs
new file mode 100644
index 0000000000..8f6a63a96d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/OutlineSettings.cs
@@ -0,0 +1,106 @@
+//
+// ClassOutlineSortingProperties.cs
+//
+// Authors:
+// Helmut Duregger <helmutduregger@gmx.at>
+//
+// Copyright (c) 2010 Helmut Duregger
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Xml.Serialization;
+using System.Linq;
+
+using MonoDevelop.Core;
+
+namespace MonoDevelop.CSharp.ClassOutline
+{
+ /// <summary>
+ /// Stores sorting status and is serialized to configuration properties.
+ /// </summary>
+ /// <remarks>
+ /// Stores the sorting configuration, e.g. if the class outline is currently sorted
+ /// or what primary sort key values the individual node groups have. This class is
+ /// serialized to the configuration file MonoDevelopProperties.xml.
+ /// </remarks>
+ /// <seealso cref="MonoDevelop.CSharp.ClassOutline.CSharpOutlineTextEditorExtension"/>
+ class OutlineSettings
+ {
+ const string KEY_GROUP_ORDER = "MonoDevelop.DesignerSupport.ClassOutline.GroupOrder";
+ const string KEY_IS_GROUPED = "MonoDevelop.DesignerSupport.ClassOutline.IsGrouped";
+ const string KEY_IS_SORTED = "MonoDevelop.DesignerSupport.ClassOutline.IsSorted";
+
+ public const string GroupRegions = "Regions";
+ public const string GroupNamespaces = "Namespaces";
+ public const string GroupTypes = "Types";
+ public const string GroupFields = "Fields";
+ public const string GroupProperties = "Properties";
+ public const string GroupEvents = "Events";
+ public const string GroupMethods = "Methods";
+
+ static Dictionary<string,string> groupNames = new Dictionary<string, string> {
+ { GroupRegions, GettextCatalog.GetString ("Regions") },
+ { GroupNamespaces, GettextCatalog.GetString ("Namespaces") },
+ { GroupTypes, GettextCatalog.GetString ("Types") },
+ { GroupProperties, GettextCatalog.GetString ("Properties") },
+ { GroupFields, GettextCatalog.GetString ("Fields") },
+ { GroupEvents, GettextCatalog.GetString ("Events") },
+ { GroupMethods, GettextCatalog.GetString ("Methods") },
+ };
+
+ OutlineSettings ()
+ {
+ }
+
+ public static OutlineSettings Load ()
+ {
+ var cs = new OutlineSettings ();
+ cs.IsGrouped = PropertyService.Get (KEY_IS_GROUPED, false);
+ cs.IsSorted = PropertyService.Get (KEY_IS_SORTED, false);
+
+ string s = PropertyService.Get (KEY_GROUP_ORDER, "");
+ if (s.Length == 0) {
+ cs.GroupOrder = groupNames.Keys.ToArray ();
+ } else {
+ cs.GroupOrder = s.Split (new char[] {','}, StringSplitOptions.RemoveEmptyEntries);
+ }
+ return cs;
+ }
+
+ public void Save ()
+ {
+ PropertyService.Set (KEY_IS_GROUPED, IsGrouped);
+ PropertyService.Set (KEY_IS_SORTED, IsSorted);
+ PropertyService.Set (KEY_GROUP_ORDER, string.Join (",", GroupOrder));
+ }
+
+ public static string GetGroupName (string group)
+ {
+ return groupNames [group];
+ }
+
+ public IList<string> GroupOrder { get; set; }
+ public bool IsGrouped { get; set; }
+ public bool IsSorted { get; set; }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/OutlineSortingPreferencesDialog.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/OutlineSortingPreferencesDialog.cs
new file mode 100644
index 0000000000..713bca748e
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/OutlineSortingPreferencesDialog.cs
@@ -0,0 +1,77 @@
+//
+// SortingPreferencesDialog.cs
+//
+// Authors:
+// Helmut Duregger <helmutduregger@gmx.at>
+//
+// Copyright (c) 2011 Helmut Duregger
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+
+using Gtk;
+
+using MonoDevelop.Core;
+
+
+namespace MonoDevelop.CSharp.ClassOutline
+{
+ /// <summary>
+ /// Provides a priority list of the groups that items in the class outline can be grouped in.
+ /// </summary>
+ /// <remarks>
+ /// The user can sort the list with button presses and thereby change the order of groups
+ /// in the outline, while grouping is active.
+ /// </remarks>
+ partial class OutlineSortingPreferencesDialog : Dialog
+ {
+ OutlineSettings settings;
+
+ public OutlineSortingPreferencesDialog (OutlineSettings settings)
+ {
+ this.Build ();
+
+ priorityList.Model = new ListStore (typeof (string), typeof (string));
+ priorityList.AppendColumn ("", new CellRendererText (), "text", 1);
+
+ priorityList.Model.Clear ();
+ foreach (string g in settings.GroupOrder) {
+ priorityList.Model.AppendValues (g, OutlineSettings.GetGroupName (g));
+ }
+
+ this.settings = settings;
+ }
+
+ public void SaveSettings ()
+ {
+ TreeIter iter;
+ if (priorityList.Model.GetIterFirst (out iter)) {
+ var order = new List<string> ();
+ do {
+ order.Add ((string) priorityList.Model.GetValue (iter, 0));
+ } while (priorityList.Model.IterNext (ref iter));
+ settings.GroupOrder = order;
+ }
+ settings.Save ();
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/AddImport/AbstractAddImportCodeFixProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/AddImport/AbstractAddImportCodeFixProvider.cs
new file mode 100644
index 0000000000..29a9f41fc2
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/AddImport/AbstractAddImportCodeFixProvider.cs
@@ -0,0 +1,526 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.FindSymbols;
+using Microsoft.CodeAnalysis.Internal.Log;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Roslyn.Utilities;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeFixes;
+using MonoDevelop.Ide.TypeSystem;
+using RefactoringEssentials;
+
+namespace MonoDevelop.CSharp.CodeFixes
+{
+ internal abstract partial class AbstractAddImportCodeFixProvider : CodeFixProvider
+ {
+ protected abstract bool IgnoreCase { get; }
+
+ protected abstract bool CanAddImport(SyntaxNode node, CancellationToken cancellationToken);
+ protected abstract bool CanAddImportForMethod(Diagnostic diagnostic, ref SyntaxNode node);
+ protected abstract bool CanAddImportForNamespace(Diagnostic diagnostic, ref SyntaxNode node);
+ protected abstract bool CanAddImportForQuery(Diagnostic diagnostic, ref SyntaxNode node);
+ protected abstract bool CanAddImportForType(Diagnostic diagnostic, ref SyntaxNode node);
+
+ protected abstract ISet<INamespaceSymbol> GetNamespacesInScope(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken);
+ protected abstract ITypeSymbol GetQueryClauseInfo(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken);
+ protected abstract string GetDescription(INamespaceOrTypeSymbol symbol, SemanticModel semanticModel, SyntaxNode root);
+ protected abstract Task<Document> AddImportAsync(SyntaxNode contextNode, INamespaceOrTypeSymbol symbol, Document documemt, bool specialCaseSystem, CancellationToken cancellationToken);
+ protected abstract bool IsViableExtensionMethod(IMethodSymbol method, SyntaxNode expression, SemanticModel semanticModel, CancellationToken cancellationToken);
+ protected abstract IEnumerable<ITypeSymbol> GetProposedTypes(string name, List<ITypeSymbol> accessibleTypeSymbols, SemanticModel semanticModel, ISet<INamespaceSymbol> namespacesInScope);
+ internal abstract bool IsViableField(IFieldSymbol field, SyntaxNode expression, SemanticModel semanticModel, CancellationToken cancellationToken);
+ internal abstract bool IsViableProperty(IPropertySymbol property, SyntaxNode expression, SemanticModel semanticModel, CancellationToken cancellationToken);
+ internal abstract bool IsAddMethodContext(SyntaxNode node, SemanticModel semanticModel);
+
+ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
+ {
+ var document = context.Document;
+ var span = context.Span;
+ var diagnostics = context.Diagnostics;
+ var cancellationToken = context.CancellationToken;
+
+ var project = document.Project;
+ var diagnostic = diagnostics.First();
+ var model = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait (false);
+ if (model.IsFromGeneratedCode (context.CancellationToken))
+ return;
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ if (root.FullSpan.Length < span.Start)
+ return;
+ var ancestors = root.FindToken(span.Start, findInsideTrivia: true).GetAncestors<SyntaxNode>();
+ if (!ancestors.Any())
+ {
+ return;
+ }
+
+ var node = ancestors.FirstOrDefault(n => n.Span.Contains(span) && n != root);
+ if (node == null)
+ {
+ return;
+ }
+
+ var placeSystemNamespaceFirst = true; //document.Project.Solution.Workspace.Options.GetOption(Microsoft.CodeAnalysis.Shared.Options.OrganizerOptions.PlaceSystemNamespaceFirst, document.Project.Language);
+
+ if (!cancellationToken.IsCancellationRequested)
+ {
+ if (this.CanAddImport(node, cancellationToken))
+ {
+ var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ //var containingType = semanticModel.GetEnclosingNamedType(node.SpanStart, cancellationToken);
+ //var containingTypeOrAssembly = containingType ?? (ISymbol)semanticModel.Compilation.Assembly;
+ var namespacesInScope = this.GetNamespacesInScope(semanticModel, node, cancellationToken);
+
+ var matchingTypesNamespaces = await this.GetNamespacesForMatchingTypesAsync(project, diagnostic, node, semanticModel, namespacesInScope, cancellationToken).ConfigureAwait(false);
+ var matchingTypes = await this.GetMatchingTypesAsync(project, diagnostic, node, semanticModel, namespacesInScope, cancellationToken).ConfigureAwait(false);
+ var matchingNamespaces = await this.GetNamespacesForMatchingNamespacesAsync(project, diagnostic, node, semanticModel, namespacesInScope, cancellationToken).ConfigureAwait(false);
+ var matchingExtensionMethodsNamespaces = await this.GetNamespacesForMatchingExtensionMethodsAsync(project, diagnostic, node, semanticModel, namespacesInScope, cancellationToken).ConfigureAwait(false);
+ var matchingFieldsAndPropertiesAsync = await this.GetNamespacesForMatchingFieldsAndPropertiesAsync(project, diagnostic, node, semanticModel, namespacesInScope, cancellationToken).ConfigureAwait(false);
+ var queryPatternsNamespaces = await this.GetNamespacesForQueryPatternsAsync(project, diagnostic, node, semanticModel, namespacesInScope, cancellationToken).ConfigureAwait(false);
+
+ if (matchingTypesNamespaces != null || matchingNamespaces != null || matchingExtensionMethodsNamespaces != null || matchingFieldsAndPropertiesAsync != null || queryPatternsNamespaces != null || matchingTypes != null)
+ {
+ matchingTypesNamespaces = matchingTypesNamespaces ?? SpecializedCollections.EmptyList<INamespaceSymbol>();
+ matchingNamespaces = matchingNamespaces ?? SpecializedCollections.EmptyList<INamespaceSymbol>();
+ matchingExtensionMethodsNamespaces = matchingExtensionMethodsNamespaces ?? SpecializedCollections.EmptyList<INamespaceSymbol>();
+ matchingFieldsAndPropertiesAsync = matchingFieldsAndPropertiesAsync ?? SpecializedCollections.EmptyList<INamespaceSymbol>();
+ queryPatternsNamespaces = queryPatternsNamespaces ?? SpecializedCollections.EmptyList<INamespaceSymbol>();
+ matchingTypes = matchingTypes ?? SpecializedCollections.EmptyList<ITypeSymbol>();
+
+ var proposedImports =
+ matchingTypesNamespaces.Cast<INamespaceOrTypeSymbol> ()
+ .Concat (matchingNamespaces.Cast<INamespaceOrTypeSymbol> ())
+ .Concat (matchingExtensionMethodsNamespaces.Cast<INamespaceOrTypeSymbol> ())
+ .Concat (matchingFieldsAndPropertiesAsync.Cast<INamespaceOrTypeSymbol> ())
+ .Concat (queryPatternsNamespaces.Cast<INamespaceOrTypeSymbol> ())
+ .Concat (matchingTypes.Cast<INamespaceOrTypeSymbol> ())
+ .Distinct ()
+ .Where (NotNull)
+ .Where (NotGlobalNamespace)
+ .ToList ();
+ proposedImports.Sort (INamespaceOrTypeSymbolExtensions.CompareNamespaceOrTypeSymbols);
+ proposedImports = proposedImports.Take (8).ToList ();
+
+ if (proposedImports.Count > 0)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+
+ foreach (var import in proposedImports)
+ {
+ var action = new DocumentChangeAction(
+ node.Span,
+ DiagnosticSeverity.Error,
+ this.GetDescription(import, semanticModel, node),
+ (c) => this.AddImportAsync(node, import, document, placeSystemNamespaceFirst, cancellationToken)
+ );
+
+ context.RegisterCodeFix(action, diagnostic);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private async Task<IEnumerable<INamespaceSymbol>> GetNamespacesForMatchingTypesAsync(
+ Microsoft.CodeAnalysis.Project project,
+ Diagnostic diagnostic,
+ SyntaxNode node,
+ SemanticModel semanticModel,
+ ISet<INamespaceSymbol> namespacesInScope,
+ CancellationToken cancellationToken)
+ {
+ if (!this.CanAddImportForType(diagnostic, ref node))
+ {
+ return null;
+ }
+
+ string name;
+ int arity;
+ bool inAttributeContext, hasIncompleteParentMember;
+ CalculateContext(node, out name, out arity, out inAttributeContext, out hasIncompleteParentMember);
+
+ var symbols = await GetTypeSymbols(project, node, semanticModel, name, inAttributeContext, cancellationToken).ConfigureAwait(false);
+ if (symbols == null)
+ {
+ return null;
+ }
+
+ return GetNamespacesForMatchingTypesAsync(semanticModel, namespacesInScope, arity, inAttributeContext, hasIncompleteParentMember, symbols);
+ }
+
+ private IEnumerable<INamespaceSymbol> GetNamespacesForMatchingTypesAsync(SemanticModel semanticModel, ISet<INamespaceSymbol> namespacesInScope, int arity, bool inAttributeContext, bool hasIncompleteParentMember, IEnumerable<ITypeSymbol> symbols)
+ {
+ var accessibleTypeSymbols = symbols
+ .Where(s => s.ContainingSymbol is INamespaceSymbol
+ && ArityAccessibilityAndAttributeContextAreCorrect(
+ semanticModel, s, arity,
+ inAttributeContext, hasIncompleteParentMember))
+ .ToList();
+
+ return GetProposedNamespaces(
+ accessibleTypeSymbols.Select(s => s.ContainingNamespace),
+ semanticModel,
+ namespacesInScope);
+ }
+
+ private async Task<IEnumerable<ITypeSymbol>> GetMatchingTypesAsync(
+ Microsoft.CodeAnalysis.Project project,
+ Diagnostic diagnostic,
+ SyntaxNode node,
+ SemanticModel semanticModel,
+ ISet<INamespaceSymbol> namespacesInScope,
+ CancellationToken cancellationToken)
+ {
+ if (!this.CanAddImportForType(diagnostic, ref node))
+ {
+ return null;
+ }
+
+ string name;
+ int arity;
+ bool inAttributeContext, hasIncompleteParentMember;
+ CalculateContext(node, out name, out arity, out inAttributeContext, out hasIncompleteParentMember);
+
+ var symbols = await GetTypeSymbols(project, node, semanticModel, name, inAttributeContext, cancellationToken).ConfigureAwait(false);
+ if (symbols == null)
+ {
+ return null;
+ }
+
+ return GetMatchingTypes(semanticModel, namespacesInScope, name, arity, inAttributeContext, symbols, hasIncompleteParentMember);
+ }
+
+ private async Task<IEnumerable<INamespaceSymbol>> GetNamespacesForMatchingNamespacesAsync(
+ Microsoft.CodeAnalysis.Project project,
+ Diagnostic diagnostic,
+ SyntaxNode node,
+ SemanticModel semanticModel,
+ ISet<INamespaceSymbol> namespacesInScope,
+ CancellationToken cancellationToken)
+ {
+ if (!this.CanAddImportForNamespace(diagnostic, ref node))
+ {
+ return null;
+ }
+
+ string name;
+ int arity;
+ node.GetNameAndArityOfSimpleName(out name, out arity);
+
+ if (ExpressionBinds(node, semanticModel, cancellationToken))
+ {
+ return null;
+ }
+
+ var symbols = await SymbolFinder.FindDeclarationsAsync(
+ project, name, this.IgnoreCase, SymbolFilter.Namespace, cancellationToken).ConfigureAwait(false);
+
+ return GetProposedNamespaces(
+ symbols.OfType<INamespaceSymbol>().Select(n => n.ContainingNamespace),
+ semanticModel,
+ namespacesInScope);
+ }
+
+ private async Task<IEnumerable<INamespaceSymbol>> GetNamespacesForMatchingExtensionMethodsAsync(
+ Microsoft.CodeAnalysis.Project project,
+ Diagnostic diagnostic,
+ SyntaxNode node,
+ SemanticModel semanticModel,
+ ISet<INamespaceSymbol> namespacesInScope,
+ CancellationToken cancellationToken)
+ {
+ if (!this.CanAddImportForMethod(diagnostic, ref node))
+ {
+ return null;
+ }
+
+ var expression = node.Parent;
+
+ var extensionMethods = SpecializedCollections.EmptyEnumerable<INamespaceSymbol>();
+ var symbols = await GetSymbolsAsync(project, node, semanticModel, cancellationToken).ConfigureAwait(false);
+ if (symbols != null)
+ {
+ extensionMethods = FilterForExtensionMethods(semanticModel, namespacesInScope, expression, symbols, cancellationToken);
+ }
+
+ var addMethods = SpecializedCollections.EmptyEnumerable<INamespaceSymbol>();
+ var methodSymbols = await GetAddMethodsAsync(project, diagnostic, node, semanticModel, namespacesInScope, expression, cancellationToken).ConfigureAwait(false);
+ if (methodSymbols != null)
+ {
+ addMethods = GetProposedNamespaces(
+ methodSymbols.Select(s => s.ContainingNamespace),
+ semanticModel,
+ namespacesInScope);
+ }
+
+ return extensionMethods.Concat(addMethods);
+ }
+
+ private async Task<IEnumerable<INamespaceSymbol>> GetNamespacesForMatchingFieldsAndPropertiesAsync(
+ Microsoft.CodeAnalysis.Project project,
+ Diagnostic diagnostic,
+ SyntaxNode node,
+ SemanticModel semanticModel,
+ ISet<INamespaceSymbol> namespacesInScope,
+ CancellationToken cancellationToken)
+ {
+ if (!this.CanAddImportForMethod(diagnostic, ref node))
+ {
+ return null;
+ }
+
+ var expression = node.Parent;
+
+ var symbols = await GetSymbolsAsync(project, node, semanticModel, cancellationToken).ConfigureAwait(false);
+
+ if (symbols != null)
+ {
+ return FilterForFieldsAndProperties(semanticModel, namespacesInScope, expression, symbols, cancellationToken);
+ }
+
+ return null;
+ }
+
+ private IEnumerable<INamespaceSymbol> FilterForFieldsAndProperties(SemanticModel semanticModel, ISet<INamespaceSymbol> namespacesInScope, SyntaxNode expression, IEnumerable<ISymbol> symbols, CancellationToken cancellationToken)
+ {
+ var propertySymbols = symbols
+ .OfType<IPropertySymbol>()
+ .Where(property => property.ContainingType?.IsAccessibleWithin(semanticModel.Compilation.Assembly) == true &&
+ IsViableProperty(property, expression, semanticModel, cancellationToken))
+ .ToList();
+
+ var fieldSymbols = symbols
+ .OfType<IFieldSymbol>()
+ .Where(field => field.ContainingType?.IsAccessibleWithin(semanticModel.Compilation.Assembly) == true &&
+ IsViableField(field, expression, semanticModel, cancellationToken))
+ .ToList();
+
+ return GetProposedNamespaces(
+ propertySymbols.Select(s => s.ContainingNamespace).Concat(fieldSymbols.Select(s => s.ContainingNamespace)),
+ semanticModel,
+ namespacesInScope);
+ }
+
+ private Task<IEnumerable<ISymbol>> GetSymbolsAsync(
+ Microsoft.CodeAnalysis.Project project,
+ SyntaxNode node,
+ SemanticModel semanticModel,
+ CancellationToken cancellationToken)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+
+ // See if the name binds. If it does, there's nothing further we need to do.
+ if (ExpressionBinds(node, semanticModel, cancellationToken, checkForExtensionMethods: true))
+ {
+ return Task.FromResult (Enumerable.Empty<ISymbol>());
+ }
+
+ string name;
+ int arity;
+ node.GetNameAndArityOfSimpleName(out name, out arity);
+ if (name == null)
+ {
+ return Task.FromResult (Enumerable.Empty<ISymbol>());
+ }
+
+ return SymbolFinder.FindDeclarationsAsync(project, name, this.IgnoreCase, SymbolFilter.Member, cancellationToken);
+ }
+
+ private async Task<IEnumerable<IMethodSymbol>> GetAddMethodsAsync(
+ Microsoft.CodeAnalysis.Project project,
+ Diagnostic diagnostic,
+ SyntaxNode node,
+ SemanticModel semanticModel,
+ ISet<INamespaceSymbol> namespacesInScope,
+ SyntaxNode expression,
+ CancellationToken cancellationToken)
+ {
+ string name;
+ int arity;
+ node.GetNameAndArityOfSimpleName(out name, out arity);
+ if (name != null)
+ {
+ return SpecializedCollections.EmptyEnumerable<IMethodSymbol>();
+ }
+
+ if (IsAddMethodContext(node, semanticModel))
+ {
+ var symbols = await SymbolFinder.FindDeclarationsAsync(project, "Add", this.IgnoreCase, SymbolFilter.Member, cancellationToken).ConfigureAwait(false);
+ return symbols
+ .OfType<IMethodSymbol>()
+ .Where(method => method.IsExtensionMethod &&
+ method.ContainingType?.IsAccessibleWithin(semanticModel.Compilation.Assembly) == true &&
+ IsViableExtensionMethod(method, expression, semanticModel, cancellationToken));
+ }
+
+ return SpecializedCollections.EmptyEnumerable<IMethodSymbol>();
+ }
+
+ private IEnumerable<INamespaceSymbol> FilterForExtensionMethods(SemanticModel semanticModel, ISet<INamespaceSymbol> namespacesInScope, SyntaxNode expression, IEnumerable<ISymbol> symbols, CancellationToken cancellationToken)
+ {
+ var extensionMethodSymbols = symbols
+ .OfType<IMethodSymbol>()
+ .Where(method => method.IsExtensionMethod &&
+ method.ContainingType?.IsAccessibleWithin(semanticModel.Compilation.Assembly) == true &&
+ IsViableExtensionMethod(method, expression, semanticModel, cancellationToken))
+ .ToList();
+
+ return GetProposedNamespaces(
+ extensionMethodSymbols.Select(s => s.ContainingNamespace),
+ semanticModel,
+ namespacesInScope);
+ }
+
+ private async Task<IEnumerable<INamespaceSymbol>> GetNamespacesForQueryPatternsAsync(
+ Microsoft.CodeAnalysis.Project project,
+ Diagnostic diagnostic,
+ SyntaxNode node,
+ SemanticModel semanticModel,
+ ISet<INamespaceSymbol> namespacesInScope,
+ CancellationToken cancellationToken)
+ {
+ if (!this.CanAddImportForQuery(diagnostic, ref node))
+ {
+ return null;
+ }
+
+ ITypeSymbol type = this.GetQueryClauseInfo(semanticModel, node, cancellationToken);
+ if (type == null)
+ {
+ return null;
+ }
+
+ // find extension methods named "Select"
+ var symbols = await SymbolFinder.FindDeclarationsAsync(project, "Select", this.IgnoreCase, SymbolFilter.Member, cancellationToken).ConfigureAwait(false);
+
+ var extensionMethodSymbols = symbols
+ .OfType<IMethodSymbol>()
+ .Where(s => s.IsExtensionMethod && IsViableExtensionMethod(type, s))
+ .ToList();
+
+ return GetProposedNamespaces(
+ extensionMethodSymbols.Select(s => s.ContainingNamespace),
+ semanticModel,
+ namespacesInScope);
+ }
+
+ private bool IsViableExtensionMethod(
+ ITypeSymbol typeSymbol,
+ IMethodSymbol method)
+ {
+ return typeSymbol != null && method.ReduceExtensionMethod(typeSymbol) != null;
+ }
+
+ private static bool ArityAccessibilityAndAttributeContextAreCorrect(
+ SemanticModel semanticModel,
+ ITypeSymbol symbol,
+ int arity,
+ bool inAttributeContext,
+ bool hasIncompleteParentMember)
+ {
+ return (arity == 0 || symbol.GetArity() == arity || hasIncompleteParentMember)
+ && symbol.IsAccessibleWithin(semanticModel.Compilation.Assembly)
+ && (!inAttributeContext || symbol.IsAttribute());
+ }
+
+ private async Task<IEnumerable<ITypeSymbol>> GetTypeSymbols(
+ Microsoft.CodeAnalysis.Project project,
+ SyntaxNode node,
+ SemanticModel semanticModel,
+ string name,
+ bool inAttributeContext,
+ CancellationToken cancellationToken)
+ {
+ if (cancellationToken.IsCancellationRequested)
+ {
+ return null;
+ }
+
+ if (ExpressionBinds(node, semanticModel, cancellationToken))
+ {
+ return null;
+ }
+
+ var symbols = await SymbolFinder.FindDeclarationsAsync(project, name, this.IgnoreCase, SymbolFilter.Type, cancellationToken).ConfigureAwait(false);
+
+ // also lookup type symbols with the "Attribute" suffix.
+ if (inAttributeContext)
+ {
+ symbols = symbols.Concat(
+ await SymbolFinder.FindDeclarationsAsync(project, name + "Attribute", this.IgnoreCase, SymbolFilter.Type, cancellationToken).ConfigureAwait(false));
+ }
+
+ return symbols.OfType<ITypeSymbol>();
+ }
+
+ private IEnumerable<ITypeSymbol> GetMatchingTypes(SemanticModel semanticModel, ISet<INamespaceSymbol> namespacesInScope, string name, int arity, bool inAttributeContext, IEnumerable<ITypeSymbol> symbols, bool hasIncompleteParentMember)
+ {
+ var accessibleTypeSymbols = symbols
+ .Where(s => ArityAccessibilityAndAttributeContextAreCorrect(
+ semanticModel, s, arity,
+ inAttributeContext, hasIncompleteParentMember))
+ .ToList();
+
+ return GetProposedTypes(
+ name,
+ accessibleTypeSymbols,
+ semanticModel,
+ namespacesInScope);
+ }
+
+ private static void CalculateContext(SyntaxNode node, out string name, out int arity, out bool inAttributeContext, out bool hasIncompleteParentMember)
+ {
+ // Has to be a simple identifier or generic name.
+ node.GetNameAndArityOfSimpleName(out name, out arity);
+
+ inAttributeContext = node.IsAttributeName();
+ hasIncompleteParentMember = node.HasIncompleteParentMember();
+ }
+
+ protected bool ExpressionBinds(SyntaxNode expression, SemanticModel semanticModel, CancellationToken cancellationToken, bool checkForExtensionMethods = false)
+ {
+ // See if the name binds to something other then the error type. If it does, there's nothing further we need to do.
+ // For extension methods, however, we will continue to search if there exists any better matched method.
+ cancellationToken.ThrowIfCancellationRequested();
+ var symbolInfo = semanticModel.GetSymbolInfo(expression, cancellationToken);
+ if (symbolInfo.CandidateReason == CandidateReason.OverloadResolutionFailure && !checkForExtensionMethods)
+ {
+ return true;
+ }
+
+ return symbolInfo.Symbol != null;
+ }
+
+ protected IEnumerable<INamespaceSymbol> GetProposedNamespaces(
+ IEnumerable<INamespaceSymbol> namespaces,
+ SemanticModel semanticModel,
+ ISet<INamespaceSymbol> namespacesInScope)
+ {
+ // We only want to offer to add a using if we don't already have one.
+ return
+ namespaces.Where(n => !n.IsGlobalNamespace)
+ .Select(n => semanticModel.Compilation.GetCompilationNamespace(n) ?? n)
+ .Where(n => n != null && !namespacesInScope.Contains(n));
+ }
+
+ private static bool NotGlobalNamespace(INamespaceOrTypeSymbol symbol)
+ {
+ return symbol.IsNamespace ? !((INamespaceSymbol)symbol).IsGlobalNamespace : true;
+ }
+
+ private static bool NotNull(INamespaceOrTypeSymbol symbol)
+ {
+ return symbol != null;
+ }
+
+
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/AddImport/CSharpAddImportCodeFixProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/AddImport/CSharpAddImportCodeFixProvider.cs
new file mode 100644
index 0000000000..994bd39571
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/AddImport/CSharpAddImportCodeFixProvider.cs
@@ -0,0 +1,642 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Composition;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.FindSymbols;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Simplification;
+using Roslyn.Utilities;
+using MonoDevelop.CSharp.CodeFixes;
+using ICSharpCode.NRefactory6.CSharp;
+
+namespace MonoDevelop.CSharp.CodeFixes
+{
+ [ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.AddUsingOrImport), Shared]
+ class CSharpAddImportCodeFixProvider : AbstractAddImportCodeFixProvider
+ {
+ /// <summary>
+ /// name does not exist in context
+ /// </summary>
+ private const string CS0103 = "CS0103";
+
+ /// <summary>
+ /// type or namespace could not be found
+ /// </summary>
+ private const string CS0246 = "CS0246";
+
+ /// <summary>
+ /// wrong number of type args
+ /// </summary>
+ private const string CS0305 = "CS0305";
+
+ /// <summary>
+ /// type does not contain a definition of method or extension method
+ /// </summary>
+ private const string CS1061 = "CS1061";
+
+ /// <summary>
+ /// cannot find implementation of query pattern
+ /// </summary>
+ private const string CS1935 = "CS1935";
+
+ /// <summary>
+ /// The non-generic type 'A' cannot be used with type arguments
+ /// </summary>
+ private const string CS0308 = "CS0308";
+
+ /// <summary>
+ /// 'A' is inaccessible due to its protection level
+ /// </summary>
+ private const string CS0122 = "CS0122";
+
+ /// <summary>
+ /// The using alias 'A' cannot be used with type arguments
+ /// </summary>
+ private const string CS0307 = "CS0307";
+
+ /// <summary>
+ /// 'A' is not an attribute class
+ /// </summary>
+ private const string CS0616 = "CS0616";
+
+ /// <summary>
+ /// ; expected.
+ /// </summary>
+ private const string CS1002 = "CS1002";
+
+ /// <summary>
+ /// Syntax error, 'A' expected
+ /// </summary>
+ private const string CS1003 = "CS1003";
+
+ /// <summary>
+ /// cannot convert from 'int' to 'string'
+ /// </summary>
+ private const string CS1503 = "CS1503";
+
+ /// <summary>
+ /// XML comment on 'construct' has syntactically incorrect cref attribute 'name'
+ /// </summary>
+ private const string CS1574 = "CS1574";
+
+ /// <summary>
+ /// Invalid type for parameter 'parameter number' in XML comment cref attribute
+ /// </summary>
+ private const string CS1580 = "CS1580";
+
+ /// <summary>
+ /// Invalid return type in XML comment cref attribute
+ /// </summary>
+ private const string CS1581 = "CS1581";
+
+ /// <summary>
+ /// XML comment has syntactically incorrect cref attribute
+ /// </summary>
+ private const string CS1584 = "CS1584";
+
+ public override ImmutableArray<string> FixableDiagnosticIds
+ {
+ get
+ {
+ return ImmutableArray.Create(
+ CS0103,
+ CS0246,
+ CS0305,
+ CS1061,
+ CS1935,
+ CS0308,
+ CS0122,
+ CS0307,
+ CS0616,
+ CS1002,
+ CS1003,
+ CS1503,
+ CS1574,
+ CS1580,
+ CS1581,
+ CS1584);
+ }
+ }
+
+ protected override bool IgnoreCase
+ {
+ get { return false; }
+ }
+
+ protected override bool CanAddImport(SyntaxNode node, CancellationToken cancellationToken)
+ {
+ if (cancellationToken.IsCancellationRequested)
+ {
+ return false;
+ }
+
+ return node.CanAddUsingDirectives(cancellationToken);
+ }
+
+ protected override bool CanAddImportForMethod(Diagnostic diagnostic, ref SyntaxNode node)
+ {
+ switch (diagnostic.Id)
+ {
+ case CS1061:
+ if (node.IsKind(SyntaxKind.ConditionalAccessExpression))
+ {
+ node = (node as ConditionalAccessExpressionSyntax).WhenNotNull;
+ }
+ else if (node.IsKind(SyntaxKind.MemberBindingExpression))
+ {
+ node = (node as MemberBindingExpressionSyntax).Name;
+ }
+ else if (node.Parent.IsKind(SyntaxKind.CollectionInitializerExpression))
+ {
+ return true;
+ }
+
+ break;
+ case CS0122:
+ break;
+
+ case CS1503:
+ //// look up its corresponding method name
+ var parent = node.GetAncestor<InvocationExpressionSyntax>();
+ if (parent == null)
+ {
+ return false;
+ }
+
+ var method = parent.Expression as MemberAccessExpressionSyntax;
+ if (method != null)
+ {
+ node = method.Name;
+ }
+
+ break;
+
+ default:
+ return false;
+ }
+
+ var simpleName = node as SimpleNameSyntax;
+ if (!simpleName.IsParentKind(SyntaxKind.SimpleMemberAccessExpression) &&
+ !simpleName.IsParentKind(SyntaxKind.MemberBindingExpression))
+ {
+ return false;
+ }
+
+ var memberAccess = simpleName.Parent as MemberAccessExpressionSyntax;
+ var memberBinding = simpleName.Parent as MemberBindingExpressionSyntax;
+ if (memberAccess.IsParentKind(SyntaxKind.SimpleMemberAccessExpression) ||
+ memberAccess.IsParentKind(SyntaxKind.ElementAccessExpression) ||
+ memberBinding.IsParentKind(SyntaxKind.SimpleMemberAccessExpression) ||
+ memberBinding.IsParentKind(SyntaxKind.ElementAccessExpression))
+ {
+ return false;
+ }
+
+ if (!node.IsMemberAccessExpressionName())
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ protected override bool CanAddImportForNamespace(Diagnostic diagnostic, ref SyntaxNode node)
+ {
+ return false;
+ }
+
+ protected override bool CanAddImportForQuery(Diagnostic diagnostic, ref SyntaxNode node)
+ {
+ if (diagnostic.Id != CS1935)
+ {
+ return false;
+ }
+
+ return node.AncestorsAndSelf().Any(n => n is QueryExpressionSyntax && !(n.Parent is QueryContinuationSyntax));
+ }
+
+ protected override bool CanAddImportForType(Diagnostic diagnostic, ref SyntaxNode node)
+ {
+ switch (diagnostic.Id)
+ {
+ case CS0103:
+ case CS0246:
+ case CS0305:
+ case CS0308:
+ case CS0122:
+ case CS0307:
+ case CS0616:
+ case CS1003:
+ case CS1580:
+ case CS1581:
+ break;
+
+ case CS1002:
+ //// only lookup errors inside ParenthesizedLambdaExpression e.g., () => { ... }
+ if (node.Ancestors().OfType<ParenthesizedLambdaExpressionSyntax>().Any())
+ {
+ if (node is SimpleNameSyntax)
+ {
+ break;
+ }
+ else if (node is BlockSyntax || node is MemberAccessExpressionSyntax || node is BinaryExpressionSyntax)
+ {
+ var last = node.DescendantNodes().OfType<SimpleNameSyntax>().LastOrDefault();
+ if (!TryFindStandaloneType(ref node))
+ {
+ node = node.DescendantNodes().OfType<SimpleNameSyntax>().FirstOrDefault();
+ }
+ else
+ {
+ node = last;
+ }
+ }
+ }
+ else
+ {
+ return false;
+ }
+
+ break;
+
+ case CS1574:
+ case CS1584:
+ var cref = node as QualifiedCrefSyntax;
+ if (cref != null)
+ {
+ node = cref.Container;
+ }
+
+ break;
+
+ default:
+ return false;
+ }
+
+ return TryFindStandaloneType(ref node);
+ }
+
+ private static bool TryFindStandaloneType(ref SyntaxNode node)
+ {
+ var qn = node as QualifiedNameSyntax;
+ if (qn != null)
+ {
+ node = GetLeftMostSimpleName(qn);
+ }
+
+ var simpleName = node as SimpleNameSyntax;
+ return simpleName.LooksLikeStandaloneTypeName();
+ }
+
+ private static SimpleNameSyntax GetLeftMostSimpleName(QualifiedNameSyntax qn)
+ {
+ while (qn != null)
+ {
+ var left = qn.Left;
+ var simpleName = left as SimpleNameSyntax;
+ if (simpleName != null)
+ {
+ return simpleName;
+ }
+
+ qn = left as QualifiedNameSyntax;
+ }
+
+ return null;
+ }
+
+ protected override ISet<INamespaceSymbol> GetNamespacesInScope(
+ SemanticModel semanticModel,
+ SyntaxNode node,
+ CancellationToken cancellationToken)
+ {
+ return semanticModel.GetUsingNamespacesInScope(node);
+ }
+
+ protected override ITypeSymbol GetQueryClauseInfo(
+ SemanticModel semanticModel,
+ SyntaxNode node,
+ CancellationToken cancellationToken)
+ {
+ var query = node.AncestorsAndSelf().OfType<QueryExpressionSyntax>().First();
+
+ if (InfoBoundSuccessfully(semanticModel.GetQueryClauseInfo(query.FromClause, cancellationToken)))
+ {
+ return null;
+ }
+
+ foreach (var clause in query.Body.Clauses)
+ {
+ if (InfoBoundSuccessfully(semanticModel.GetQueryClauseInfo(clause, cancellationToken)))
+ {
+ return null;
+ }
+ }
+
+ if (InfoBoundSuccessfully(semanticModel.GetSymbolInfo(query.Body.SelectOrGroup, cancellationToken)))
+ {
+ return null;
+ }
+
+ var fromClause = query.FromClause;
+ return semanticModel.GetTypeInfo(fromClause.Expression, cancellationToken).Type;
+ }
+
+ private bool InfoBoundSuccessfully(SymbolInfo symbolInfo)
+ {
+ return InfoBoundSuccessfully(symbolInfo.Symbol);
+ }
+
+ private bool InfoBoundSuccessfully(QueryClauseInfo semanticInfo)
+ {
+ return InfoBoundSuccessfully(semanticInfo.OperationInfo);
+ }
+
+ private static bool InfoBoundSuccessfully(ISymbol operation)
+ {
+ operation = operation.GetOriginalUnreducedDefinition();
+ return operation != null;
+ }
+
+ protected override string GetDescription(INamespaceOrTypeSymbol namespaceSymbol, SemanticModel semanticModel, SyntaxNode contextNode)
+ {
+ var root = GetCompilationUnitSyntaxNode(contextNode);
+
+ // No localization necessary
+ string externAliasString;
+ if (TryGetExternAliasString(namespaceSymbol, semanticModel, root, out externAliasString))
+ {
+ return string.Format ("extern alias {0};", externAliasString);
+ }
+
+ string namespaceString;
+ if (TryGetNamespaceString(namespaceSymbol, root, false, null, out namespaceString))
+ {
+ return string.Format ("using {0};", namespaceString);
+ }
+
+ // If we get here then neither a namespace or a an extern alias can be added.
+ // There is no valid string to show to the user and there is
+ // likely a bug in that we should know about.
+ throw new InvalidOperationException ();
+ }
+
+ protected override async Task<Document> AddImportAsync(
+ SyntaxNode contextNode,
+ INamespaceOrTypeSymbol namespaceSymbol,
+ Document document,
+ bool placeSystemNamespaceFirst,
+ CancellationToken cancellationToken)
+ {
+ var root = GetCompilationUnitSyntaxNode(contextNode, cancellationToken);
+ var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ var simpleUsingDirective = GetUsingDirective(root, namespaceSymbol, semanticModel, fullyQualify: false);
+ var externAliasUsingDirective = GetExternAliasUsingDirective(root, namespaceSymbol, semanticModel);
+ if (externAliasUsingDirective != null)
+ {
+ root = root.AddExterns(
+ externAliasUsingDirective
+ .WithAdditionalAnnotations(Formatter.Annotation));
+ }
+
+ if (simpleUsingDirective != null)
+ {
+ // Because of the way usings can be nested inside of namespace declarations,
+ // we need to check if the usings must be fully qualified so as not to be
+ // ambiguous with the containing namespace.
+ if (UsingsAreContainedInNamespace(contextNode))
+ {
+ // When we add usings we try and place them, as best we can, where the user
+ // wants them according to their settings. This means we can't just add the fully-
+ // qualified usings and expect the simplifier to take care of it, the usings have to be
+ // simplified before we attempt to add them to the document.
+ // You might be tempted to think that we could call
+ // AddUsings -> Simplifier -> SortUsings
+ // But this will clobber the users using settings without asking. Instead we create a new
+ // Document and check if our using can be simplified. Worst case we need to back out the
+ // fully qualified change and reapply with the simple name.
+ var fullyQualifiedUsingDirective = GetUsingDirective(root, namespaceSymbol, semanticModel, fullyQualify: true);
+ SyntaxNode newRoot = root.AddUsingDirective(
+ fullyQualifiedUsingDirective, contextNode, placeSystemNamespaceFirst,
+ Formatter.Annotation);
+ var newDocument = document.WithSyntaxRoot(newRoot);
+ var newSemanticModel = await newDocument.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ newRoot = await newDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ var newUsing = newRoot
+ .DescendantNodes().OfType<UsingDirectiveSyntax>().Where(uds => uds.IsEquivalentTo(fullyQualifiedUsingDirective, topLevel: true)).Single();
+ var speculationAnalyzer = new SpeculationAnalyzer(newUsing.Name, simpleUsingDirective.Name, newSemanticModel, cancellationToken);
+ if (speculationAnalyzer.ReplacementChangesSemantics())
+ {
+ // Not fully qualifying the using causes to refer to a different namespace so we need to keep it as is.
+ return newDocument;
+ }
+ else
+ {
+ // It does not matter if it is fully qualified or simple so lets return the simple name.
+ return document.WithSyntaxRoot(root.AddUsingDirective(
+ simpleUsingDirective, contextNode, placeSystemNamespaceFirst,
+ Formatter.Annotation));
+ }
+ }
+ else
+ {
+ // simple form
+ return document.WithSyntaxRoot(root.AddUsingDirective(
+ simpleUsingDirective, contextNode, placeSystemNamespaceFirst,
+ Formatter.Annotation));
+ }
+ }
+
+ return document.WithSyntaxRoot(root);
+ }
+
+ private static ExternAliasDirectiveSyntax GetExternAliasUsingDirective(CompilationUnitSyntax root, INamespaceOrTypeSymbol namespaceSymbol, SemanticModel semanticModel)
+ {
+ string externAliasString;
+ if (TryGetExternAliasString(namespaceSymbol, semanticModel, root, out externAliasString))
+ {
+ return SyntaxFactory.ExternAliasDirective(SyntaxFactory.Identifier(externAliasString));
+ }
+
+ return null;
+ }
+
+ private UsingDirectiveSyntax GetUsingDirective(CompilationUnitSyntax root, INamespaceOrTypeSymbol namespaceSymbol, SemanticModel semanticModel, bool fullyQualify)
+ {
+ string namespaceString;
+ string externAliasString;
+ TryGetExternAliasString(namespaceSymbol, semanticModel, root, out externAliasString);
+ if (externAliasString != null)
+ {
+ if (TryGetNamespaceString(namespaceSymbol, root, false, externAliasString, out namespaceString))
+ {
+ return SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(namespaceString));
+ }
+
+ return null;
+ }
+
+ if (TryGetNamespaceString(namespaceSymbol, root, fullyQualify, null, out namespaceString))
+ {
+ return SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(namespaceString));
+ }
+
+ return null;
+ }
+
+ private bool UsingsAreContainedInNamespace(SyntaxNode contextNode)
+ {
+ return contextNode.GetAncestor<NamespaceDeclarationSyntax>()?.DescendantNodes().OfType<UsingDirectiveSyntax>().FirstOrDefault() != null;
+ }
+
+ private static bool TryGetExternAliasString(INamespaceOrTypeSymbol namespaceSymbol, SemanticModel semanticModel, CompilationUnitSyntax root, out string externAliasString)
+ {
+ externAliasString = null;
+ var metadataReference = semanticModel.Compilation.GetMetadataReference(namespaceSymbol.ContainingAssembly);
+ if (metadataReference == null)
+ {
+ return false;
+ }
+
+ var properties = metadataReference.Properties;
+ var aliases = properties.Aliases;
+ if (aliases.IsDefaultOrEmpty)
+ {
+ return false;
+ }
+
+ aliases = properties.Aliases.Where(a => a != MetadataReferenceProperties.GlobalAlias).ToImmutableArray();
+ if (!aliases.Any())
+ {
+ return false;
+ }
+
+ externAliasString = aliases.First();
+ return ShouldAddExternAlias(aliases, root);
+ }
+
+ private static bool TryGetNamespaceString(INamespaceOrTypeSymbol namespaceSymbol, CompilationUnitSyntax root, bool fullyQualify, string alias, out string namespaceString)
+ {
+ namespaceString = fullyQualify
+ ? namespaceSymbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)
+ : namespaceSymbol.ToDisplayString();
+
+ if (alias != null)
+ {
+ namespaceString = alias + "::" + namespaceString;
+ }
+
+ return ShouldAddUsing(namespaceString, root);
+ }
+
+ private static bool ShouldAddExternAlias(ImmutableArray<string> aliases, CompilationUnitSyntax root)
+ {
+ var identifiers = root.DescendantNodes().OfType<ExternAliasDirectiveSyntax>().Select(e => e.Identifier.ToString());
+ var externAliases = aliases.Where(a => identifiers.Contains(a));
+ return !externAliases.Any();
+ }
+
+ private static bool ShouldAddUsing(string usingDirective, CompilationUnitSyntax root)
+ {
+ return !root.Usings.Select(u => u.Name.ToString()).Contains(usingDirective);
+ }
+
+ private static CompilationUnitSyntax GetCompilationUnitSyntaxNode(SyntaxNode contextNode, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return (CompilationUnitSyntax)contextNode.SyntaxTree.GetRoot(cancellationToken);
+ }
+
+ protected override bool IsViableExtensionMethod(IMethodSymbol method, SyntaxNode expression, SemanticModel semanticModel, CancellationToken cancellationToken)
+ {
+ var leftExpression = expression.GetExpressionOfMemberAccessExpression() ?? expression.GetExpressionOfConditionalMemberAccessExpression();
+ if (leftExpression == null)
+ {
+ if (expression.IsKind(SyntaxKind.CollectionInitializerExpression))
+ {
+ leftExpression = expression.GetAncestor<ObjectCreationExpressionSyntax>();
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ var semanticInfo = semanticModel.GetTypeInfo(leftExpression, cancellationToken);
+ var leftExpressionType = semanticInfo.Type;
+
+ return leftExpressionType != null && method.ReduceExtensionMethod(leftExpressionType) != null;
+ }
+
+ protected override IEnumerable<ITypeSymbol> GetProposedTypes(string name, List<ITypeSymbol> accessibleTypeSymbols, SemanticModel semanticModel, ISet<INamespaceSymbol> namespacesInScope)
+ {
+ if (accessibleTypeSymbols == null)
+ {
+ yield break;
+ }
+
+ foreach (var typeSymbol in accessibleTypeSymbols)
+ {
+ if ((typeSymbol != null) && (typeSymbol.ContainingType != null) && typeSymbol.ContainingType.IsStatic)
+ {
+ yield return typeSymbol.ContainingType;
+ }
+ }
+ }
+
+ internal override bool IsViableField(IFieldSymbol field, SyntaxNode expression, SemanticModel semanticModel, CancellationToken cancellationToken)
+ {
+ return IsViablePropertyOrField(field, expression, semanticModel, cancellationToken);
+ }
+
+ internal override bool IsViableProperty(IPropertySymbol property, SyntaxNode expression, SemanticModel semanticModel, CancellationToken cancellationToken)
+ {
+ return IsViablePropertyOrField(property, expression, semanticModel, cancellationToken);
+ }
+
+ private bool IsViablePropertyOrField(ISymbol propertyOrField, SyntaxNode expression, SemanticModel semanticModel, CancellationToken cancellationToken)
+ {
+ if (!propertyOrField.IsStatic)
+ {
+ return false;
+ }
+
+ var leftName = (expression as MemberAccessExpressionSyntax)?.Expression as SimpleNameSyntax;
+ if (leftName == null)
+ {
+ return false;
+ }
+
+ return string.Compare(propertyOrField.ContainingType.Name, leftName.Identifier.Text, this.IgnoreCase) == 0;
+ }
+
+ internal override bool IsAddMethodContext(SyntaxNode node, SemanticModel semanticModel)
+ {
+ if (node.Parent.IsKind(SyntaxKind.CollectionInitializerExpression))
+ {
+ var objectCreationExpressionSyntax = node.GetAncestor<ObjectCreationExpressionSyntax>();
+ if (objectCreationExpressionSyntax == null)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/Async/AbstractAsyncCodeFix.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/Async/AbstractAsyncCodeFix.cs
new file mode 100644
index 0000000000..263d637f26
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/Async/AbstractAsyncCodeFix.cs
@@ -0,0 +1,88 @@
+//
+// AbstractAsyncCodeFix.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Collections.Immutable;
+using System.Linq;
+using System.Composition;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Formatting;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.FindSymbols;
+using Microsoft.CodeAnalysis.CodeActions;
+using ICSharpCode.NRefactory6.CSharp;
+using MonoDevelop.CSharp.CodeFixes;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using RefactoringEssentials;
+
+namespace MonoDevelop.CSharp.CodeFixes
+{
+
+ internal abstract partial class AbstractAsyncCodeFix : CodeFixProvider
+ {
+ protected abstract Task<CodeAction> GetCodeFix(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostic, CancellationToken cancellationToken);
+
+ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
+ {
+ var model = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait (false);
+ if (model.IsFromGeneratedCode (context.CancellationToken))
+ return;
+ var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
+
+ SyntaxNode node;
+ if (!TryGetNode(root, context.Span, out node))
+ {
+ return;
+ }
+
+ var diagnostic = context.Diagnostics.FirstOrDefault();
+
+ var codeAction = await GetCodeFix(root, node, context.Document, diagnostic, context.CancellationToken).ConfigureAwait(false);
+
+ if (codeAction != null)
+ {
+ context.RegisterCodeFix(codeAction, diagnostic);
+ }
+ }
+
+ private bool TryGetNode(SyntaxNode root, Microsoft.CodeAnalysis.Text.TextSpan span, out SyntaxNode node)
+ {
+ node = null;
+ var ancestors = root.FindToken(span.Start).GetAncestors<SyntaxNode>();
+ if (!ancestors.Any())
+ {
+ return false;
+ }
+
+ node = ancestors.FirstOrDefault(n => n.Span.Contains(span) && n != root);
+ return node != null;
+ }
+ }
+
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/Async/CSharpAddAsyncCodeFixProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/Async/CSharpAddAsyncCodeFixProvider.cs
new file mode 100644
index 0000000000..a5fcc5b4b2
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/Async/CSharpAddAsyncCodeFixProvider.cs
@@ -0,0 +1,229 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Immutable;
+using System.Composition;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.CodeActions;
+using RefactoringEssentials;
+using MonoDevelop.CSharp.CodeFixes;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.CSharp.CodeFixes
+{
+ internal abstract partial class AbstractAddAsyncAwaitCodeFixProvider : AbstractAsyncCodeFix
+ {
+ protected abstract string GetDescription(Diagnostic diagnostic, SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken);
+ protected abstract Task<SyntaxNode> GetNewRoot(SyntaxNode root, SyntaxNode oldNode, SemanticModel semanticModel, Diagnostic diagnostic, Document document, CancellationToken cancellationToken);
+
+ protected override async Task<CodeAction> GetCodeFix(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostic, CancellationToken cancellationToken)
+ {
+ var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+
+ var newRoot = await this.GetNewRoot(root, node, semanticModel, diagnostic, document, cancellationToken).ConfigureAwait(false);
+ if (newRoot != null)
+ {
+ return new DocumentChangeAction(node.Span, DiagnosticSeverity.Error,
+ this.GetDescription(diagnostic, node, semanticModel, cancellationToken),
+ token => Task.FromResult(document.WithSyntaxRoot(newRoot)));
+ }
+
+ return null;
+ }
+
+ protected bool TryGetTypes(
+ SyntaxNode expression,
+ SemanticModel semanticModel,
+ out INamedTypeSymbol source,
+ out INamedTypeSymbol destination)
+ {
+ source = null;
+ destination = null;
+
+ var info = semanticModel.GetSymbolInfo(expression);
+ var methodSymbol = info.Symbol as IMethodSymbol;
+ if (methodSymbol == null)
+ {
+ return false;
+ }
+
+ var compilation = semanticModel.Compilation;
+ var taskType = compilation.GetTypeByMetadataName("System.Threading.Tasks.Task");
+ if (taskType == null)
+ {
+ return false;
+ }
+
+ var returnType = methodSymbol.ReturnType as INamedTypeSymbol;
+ if (returnType == null)
+ {
+ return false;
+ }
+
+ source = taskType;
+ destination = returnType;
+ return true;
+ }
+
+ }
+
+ [ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.AddAsync), Shared]
+ internal class CSharpAddAsyncCodeFixProvider : AbstractAddAsyncCodeFixProvider
+ {
+ /// <summary>
+ /// The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'.
+ /// </summary>
+ private const string CS4032 = "CS4032";
+
+ /// <summary>
+ /// The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'.
+ /// </summary>
+ private const string CS4033 = "CS4033";
+
+ /// <summary>
+ /// The 'await' operator can only be used within an async lambda expression. Consider marking this method with the 'async' modifier.
+ /// </summary>
+ private const string CS4034 = "CS4034";
+
+ public override ImmutableArray<string> FixableDiagnosticIds
+ {
+ get { return ImmutableArray.Create(CS4032, CS4033, CS4034); }
+ }
+
+ protected override string GetDescription(Diagnostic diagnostic, SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken)
+ {
+ return GettextCatalog.GetString ("Make async");
+ }
+
+ protected override async Task<SyntaxNode> GetNewRoot(SyntaxNode root, SyntaxNode oldNode, SemanticModel semanticModel, Diagnostic diagnostic, Document document, CancellationToken cancellationToken)
+ {
+ var methodNode = GetContainingMember(oldNode);
+ if (methodNode == null)
+ {
+ return null;
+ }
+
+ var newMethodNode = await ConvertToAsync(methodNode, semanticModel, document, cancellationToken).ConfigureAwait(false);
+ if (newMethodNode != null)
+ {
+ return root.ReplaceNode(methodNode, newMethodNode);
+ }
+
+ return null;
+ }
+
+ private static SyntaxNode GetContainingMember(SyntaxNode oldNode)
+ {
+ var parenthesizedLambda = oldNode
+ .Ancestors()
+ .FirstOrDefault(n =>
+ n.IsKind(SyntaxKind.ParenthesizedLambdaExpression));
+
+ if (parenthesizedLambda != null)
+ {
+ return parenthesizedLambda;
+ }
+
+ var simpleLambda = oldNode
+ .Ancestors()
+ .FirstOrDefault(n =>
+ n.IsKind(SyntaxKind.SimpleLambdaExpression));
+
+ if (simpleLambda != null)
+ {
+ return simpleLambda;
+ }
+
+ return oldNode
+ .Ancestors()
+ .FirstOrDefault(n =>
+ n.IsKind(SyntaxKind.MethodDeclaration));
+ }
+
+ private async Task<SyntaxNode> ConvertToAsync(SyntaxNode node, SemanticModel semanticModel, Document document, CancellationToken cancellationToken)
+ {
+ var methodNode = node as MethodDeclarationSyntax;
+ if (methodNode != null)
+ {
+ return await ConvertMethodToAsync(document, semanticModel, methodNode, cancellationToken).ConfigureAwait(false);
+ }
+
+ var parenthesizedLambda = node as ParenthesizedLambdaExpressionSyntax;
+ if (parenthesizedLambda != null)
+ {
+ return ConvertParenthesizedLambdaToAsync(parenthesizedLambda);
+ }
+
+ var simpleLambda = node as SimpleLambdaExpressionSyntax;
+ if (simpleLambda != null)
+ {
+ return ConvertSimpleLambdaToAsync(simpleLambda);
+ }
+
+ return null;
+ }
+
+ private static SyntaxNode ConvertParenthesizedLambdaToAsync(ParenthesizedLambdaExpressionSyntax parenthesizedLambda)
+ {
+ return SyntaxFactory.ParenthesizedLambdaExpression(
+ SyntaxFactory.Token(SyntaxKind.AsyncKeyword),
+ parenthesizedLambda.ParameterList,
+ parenthesizedLambda.ArrowToken,
+ parenthesizedLambda.Body)
+ .WithAdditionalAnnotations(Formatter.Annotation);
+ }
+
+ private static SyntaxNode ConvertSimpleLambdaToAsync(SimpleLambdaExpressionSyntax simpleLambda)
+ {
+ return SyntaxFactory.SimpleLambdaExpression(
+ SyntaxFactory.Token(SyntaxKind.AsyncKeyword),
+ simpleLambda.Parameter,
+ simpleLambda.ArrowToken,
+ simpleLambda.Body)
+ .WithAdditionalAnnotations(Formatter.Annotation);
+ }
+
+ protected override SyntaxNode AddAsyncKeyword(SyntaxNode node)
+ {
+ var methodNode = node as MethodDeclarationSyntax;
+ if (methodNode == null)
+ {
+ return null;
+ }
+
+ return methodNode
+ .AddModifiers(SyntaxFactory.Token(SyntaxKind.AsyncKeyword))
+ .WithAdditionalAnnotations(Formatter.Annotation);
+ }
+
+ protected override SyntaxNode AddAsyncKeywordAndTaskReturnType(SyntaxNode node, ITypeSymbol existingReturnType, INamedTypeSymbol taskTypeSymbol)
+ {
+ var methodNode = node as MethodDeclarationSyntax;
+ if (methodNode == null)
+ {
+ return null;
+ }
+
+ if (taskTypeSymbol == null)
+ {
+ return null;
+ }
+
+ var returnType = taskTypeSymbol.Construct(existingReturnType).GenerateTypeSyntax();
+ return AddAsyncKeyword(methodNode.WithReturnType(returnType));
+ }
+
+ protected override bool DoesConversionExist(Compilation compilation, ITypeSymbol source, ITypeSymbol destination)
+ {
+ return compilation.ClassifyConversion(source, destination).Exists;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/Async/CSharpAddAwaitCodeFixProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/Async/CSharpAddAwaitCodeFixProvider.cs
new file mode 100644
index 0000000000..9bcb3033d1
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/Async/CSharpAddAwaitCodeFixProvider.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Immutable;
+using System.Linq;
+using System.Composition;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Formatting;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.FindSymbols;
+using Microsoft.CodeAnalysis.CodeActions;
+using ICSharpCode.NRefactory6.CSharp;
+using MonoDevelop.CSharp.CodeFixes;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.CSharp.CodeFixes
+{
+ internal abstract partial class AbstractAddAsyncCodeFixProvider : AbstractAddAsyncAwaitCodeFixProvider
+ {
+ protected const string SystemThreadingTasksTask = "System.Threading.Tasks.Task";
+ protected const string SystemThreadingTasksTaskT = "System.Threading.Tasks.Task`1";
+ protected abstract SyntaxNode AddAsyncKeyword(SyntaxNode methodNode);
+ protected abstract SyntaxNode AddAsyncKeywordAndTaskReturnType(SyntaxNode methodNode, ITypeSymbol existingReturnType, INamedTypeSymbol taskTypeSymbol);
+ protected abstract bool DoesConversionExist(Compilation compilation, ITypeSymbol source, ITypeSymbol destination);
+
+ protected async Task<SyntaxNode> ConvertMethodToAsync(Document document, SemanticModel semanticModel, SyntaxNode methodNode, CancellationToken cancellationToken)
+ {
+ var methodSymbol = semanticModel.GetDeclaredSymbol(methodNode, cancellationToken) as IMethodSymbol;
+
+ if (methodSymbol.ReturnsVoid)
+ {
+ return AddAsyncKeyword(methodNode);
+ }
+
+ var returnType = methodSymbol.ReturnType;
+ var compilation = semanticModel.Compilation;
+
+ var taskSymbol = compilation.GetTypeByMetadataName(SystemThreadingTasksTask);
+ var genericTaskSymbol = compilation.GetTypeByMetadataName(SystemThreadingTasksTaskT);
+ if (taskSymbol == null)
+ {
+ return null;
+ }
+
+ if (returnType is IErrorTypeSymbol)
+ {
+ // The return type of the method will not bind. This could happen for a lot of reasons.
+ // The type may not actually exist or the user could just be missing a using/import statement.
+ // We're going to try and see if there are any known types that have the same name as
+ // our return type, and then check if those are convertible to Task. If they are then
+ // we assume the user just has a missing using. If they are not, we wrap the return
+ // type in a generic Task.
+ var typeName = returnType.Name;
+
+ var results = await SymbolFinder.FindDeclarationsAsync(
+ document.Project, typeName, ignoreCase: false, filter: SymbolFilter.Type, cancellationToken: cancellationToken).ConfigureAwait(false);
+
+ if (results.OfType<ITypeSymbol>().Any(s => DoesConversionExist(compilation, s, taskSymbol)))
+ {
+ return AddAsyncKeyword(methodNode);
+ }
+
+ return AddAsyncKeywordAndTaskReturnType(methodNode, returnType, genericTaskSymbol);
+ }
+
+ if (DoesConversionExist(compilation, returnType, taskSymbol))
+ {
+ return AddAsyncKeyword(methodNode);
+ }
+
+ return AddAsyncKeywordAndTaskReturnType(methodNode, returnType, genericTaskSymbol);
+ }
+ }
+
+
+ [ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.AddAwait), Shared]
+ internal class CSharpAddAwaitCodeFixProvider : AbstractAddAsyncAwaitCodeFixProvider
+ {
+ /// <summary>
+ /// Since this is an async method, the return expression must be of type 'blah' rather than 'baz'
+ /// </summary>
+ private const string CS4014 = "CS4014";
+
+ /// <summary>
+ /// Because this call is not awaited, execution of the current method continues before the call is completed.
+ /// </summary>
+ private const string CS4016 = "CS4016";
+
+ public override ImmutableArray<string> FixableDiagnosticIds
+ {
+ get { return ImmutableArray.Create(CS4014, CS4016); }
+ }
+
+ protected override string GetDescription(Diagnostic diagnostic, SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken)
+ {
+ return GettextCatalog.GetString ("Insert 'await'");
+ }
+
+ protected override Task<SyntaxNode> GetNewRoot(SyntaxNode root, SyntaxNode oldNode, SemanticModel semanticModel, Diagnostic diagnostic, Document document, CancellationToken cancellationToken)
+ {
+ var expression = oldNode as ExpressionSyntax;
+
+ switch (diagnostic.Id)
+ {
+ case CS4014:
+ if (expression == null)
+ {
+ return Task.FromResult<SyntaxNode>(null);
+ }
+
+ return Task.FromResult(root.ReplaceNode(oldNode, ConvertToAwaitExpression(expression)));
+ case CS4016:
+ if (expression == null)
+ {
+ return Task.FromResult (default (SyntaxNode));
+ }
+
+ if (!IsCorrectReturnType(expression, semanticModel))
+ {
+ return Task.FromResult (default (SyntaxNode));
+ }
+
+ return Task.FromResult(root.ReplaceNode(oldNode, ConvertToAwaitExpression(expression)));
+ default:
+ return Task.FromResult (default (SyntaxNode));
+ }
+ }
+
+ private bool IsCorrectReturnType(ExpressionSyntax expression, SemanticModel semanticModel)
+ {
+ INamedTypeSymbol taskType = null;
+ INamedTypeSymbol returnType = null;
+ return TryGetTypes(expression, semanticModel, out taskType, out returnType) &&
+ semanticModel.Compilation.ClassifyConversion(taskType, returnType).Exists;
+ }
+
+ private static ExpressionSyntax ConvertToAwaitExpression(ExpressionSyntax expression)
+ {
+ return SyntaxFactory.AwaitExpression(expression)
+ .WithAdditionalAnnotations(Formatter.Annotation);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/Async/CSharpConvertToAsyncMethodCodeFixProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/Async/CSharpConvertToAsyncMethodCodeFixProvider.cs
new file mode 100644
index 0000000000..b1bd4224f6
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/Async/CSharpConvertToAsyncMethodCodeFixProvider.cs
@@ -0,0 +1,124 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Immutable;
+using System.Composition;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CodeActions;
+using RefactoringEssentials;
+using MonoDevelop.CSharp.CodeFixes;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.CSharp.CodeFixes
+{
+ internal abstract partial class AbstractChangeToAsyncCodeFixProvider : AbstractAsyncCodeFix
+ {
+ protected abstract Task<string> GetDescription(Diagnostic diagnostic, SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken);
+ protected abstract Task<Tuple<SyntaxTree, SyntaxNode>> GetRootInOtherSyntaxTree(SyntaxNode node, SemanticModel semanticModel, Diagnostic diagnostic, CancellationToken cancellationToken);
+
+ protected override async Task<CodeAction> GetCodeFix(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostic, CancellationToken cancellationToken)
+ {
+ var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+
+ var result = await GetRootInOtherSyntaxTree(node, semanticModel, diagnostic, cancellationToken).ConfigureAwait(false);
+ if (result != null)
+ {
+ var syntaxTree = result.Item1;
+ var newRoot = result.Item2;
+ var otherDocument = document.Project.Solution.GetDocument(syntaxTree);
+ return new DocumentChangeAction(node.Span, DiagnosticSeverity.Error,
+ await this.GetDescription(diagnostic, node, semanticModel, cancellationToken).ConfigureAwait(false),
+ token => Task.FromResult(otherDocument.WithSyntaxRoot(newRoot)));
+ }
+
+ return null;
+ }
+ }
+
+ [ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.ConvertToAsync), Shared]
+ internal class CSharpConvertToAsyncMethodCodeFixProvider : AbstractChangeToAsyncCodeFixProvider
+ {
+ /// <summary>
+ /// Cannot await void.
+ /// </summary>
+ private const string CS4008 = "CS4008";
+
+ public override ImmutableArray<string> FixableDiagnosticIds
+ {
+ get { return ImmutableArray.Create(CS4008); }
+ }
+
+ protected override async Task<string> GetDescription(
+ Diagnostic diagnostic,
+ SyntaxNode node,
+ SemanticModel semanticModel,
+ CancellationToken cancellationToken)
+ {
+ var methodNode = await GetMethodDeclaration(node, semanticModel, cancellationToken).ConfigureAwait(false);
+ return string.Format(GettextCatalog.GetString ("Make {0} return Task instead of void"), methodNode.WithBody(null));
+ }
+
+ protected override async Task<Tuple<SyntaxTree, SyntaxNode>> GetRootInOtherSyntaxTree(
+ SyntaxNode node,
+ SemanticModel semanticModel,
+ Diagnostic diagnostic,
+ CancellationToken cancellationToken)
+ {
+ var methodDeclaration = await GetMethodDeclaration(node, semanticModel, cancellationToken).ConfigureAwait(false);
+ if (methodDeclaration == null)
+ {
+ return null;
+ }
+
+ var oldRoot = await methodDeclaration.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false);
+ var newRoot = oldRoot.ReplaceNode(methodDeclaration, ConvertToAsyncFunction(methodDeclaration));
+ return Tuple.Create(oldRoot.SyntaxTree, newRoot);
+ }
+
+ private async Task<MethodDeclarationSyntax> GetMethodDeclaration(
+ SyntaxNode node,
+ SemanticModel semanticModel,
+ CancellationToken cancellationToken)
+ {
+ var invocationExpression = node.ChildNodes().FirstOrDefault(n => n.IsKind(SyntaxKind.InvocationExpression));
+ var methodSymbol = semanticModel.GetSymbolInfo(invocationExpression, cancellationToken).Symbol as IMethodSymbol;
+ if (methodSymbol == null)
+ {
+ return null;
+ }
+
+ var methodReference = methodSymbol.DeclaringSyntaxReferences.FirstOrDefault();
+ if (methodReference == null)
+ {
+ return null;
+ }
+
+ var methodDeclaration = (await methodReference.GetSyntaxAsync(cancellationToken).ConfigureAwait(false)) as MethodDeclarationSyntax;
+ if (methodDeclaration == null)
+ {
+ return null;
+ }
+
+ if (!methodDeclaration.Modifiers.Any(m => m.IsKind(SyntaxKind.AsyncKeyword)))
+ {
+ return null;
+ }
+
+ return methodDeclaration;
+ }
+
+ private MethodDeclarationSyntax ConvertToAsyncFunction(MethodDeclarationSyntax methodDeclaration)
+ {
+ return methodDeclaration.WithReturnType(
+ SyntaxFactory.ParseTypeName("Task")
+ .WithLeadingTrivia(methodDeclaration.ReturnType.GetLeadingTrivia())
+ .WithTrailingTrivia(methodDeclaration.ReturnType.GetTrailingTrivia()));
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/EncapsulateField/AbstractEncapsulateFieldRefactoringProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/EncapsulateField/AbstractEncapsulateFieldRefactoringProvider.cs
new file mode 100644
index 0000000000..dcda5767d2
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/EncapsulateField/AbstractEncapsulateFieldRefactoringProvider.cs
@@ -0,0 +1,20 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading.Tasks;
+using ICSharpCode.NRefactory6.CSharp.CodeRefactorings.EncapsulateField;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+
+namespace Microsoft.CodeAnalysis.CodeRefactorings.EncapsulateField
+{
+ internal abstract class AbstractEncapsulateFieldRefactoringProvider : CodeRefactoringProvider
+ {
+ CSharpEncapsulateFieldService service = new CSharpEncapsulateFieldService ();
+
+ public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
+ {
+ var actions = await service.GetEncapsulateFieldCodeActionsAsync(context.Document, context.Span, context.CancellationToken).ConfigureAwait(false);
+ foreach (var action in actions)
+ context.RegisterRefactoring(action);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/EncapsulateField/EncapsulateFieldCodeRefactoringProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/EncapsulateField/EncapsulateFieldCodeRefactoringProvider.cs
new file mode 100644
index 0000000000..b65d232c50
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/EncapsulateField/EncapsulateFieldCodeRefactoringProvider.cs
@@ -0,0 +1,13 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Composition;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeRefactorings;
+
+namespace ICSharpCode.NRefactory6.CSharp.CodeRefactorings.EncapsulateField
+{
+ [ExportCodeRefactoringProvider(LanguageNames.CSharp, Name = "Encapsulate Field"), Shared]
+ internal class EncapsulateFieldRefactoringProvider : AbstractEncapsulateFieldRefactoringProvider
+ {
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/FullyQualify/CSharpFullyQualifyCodeFixProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/FullyQualify/CSharpFullyQualifyCodeFixProvider.cs
new file mode 100644
index 0000000000..83d779f9b3
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/FullyQualify/CSharpFullyQualifyCodeFixProvider.cs
@@ -0,0 +1,331 @@
+//
+// CSharpFullyQualifyCodeFixProvider.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Collections.Immutable;
+using System.Threading;
+using Microsoft.CodeAnalysis.CodeFixes;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Formatting;
+using System.Threading.Tasks;
+using System.Linq;
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis.FindSymbols;
+using System.Runtime.CompilerServices;
+using Microsoft.CodeAnalysis.CodeActions;
+using System;
+using RefactoringEssentials;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.CSharp.Completion;
+
+namespace MonoDevelop.CSharp.CodeFixes.FullyQualify
+{
+ [ExportCodeFixProvider(LanguageNames.CSharp, Name = "Fully Qualify")]
+ [ExtensionOrder(After = PredefinedCodeFixProviderNames.AddUsingOrImport)]
+ class CSharpFullyQualifyCodeFixProvider : CodeFixProvider
+ {
+ /// <summary>
+ /// name does not exist in context
+ /// </summary>
+ private const string CS0103 = "CS0103";
+
+ /// <summary>
+ /// 'reference' is an ambiguous reference between 'identifier' and 'identifier'
+ /// </summary>
+ private const string CS0104 = "CS0104";
+
+ /// <summary>
+ /// type or namespace could not be found
+ /// </summary>
+ private const string CS0246 = "CS0246";
+
+ /// <summary>
+ /// wrong number of type args
+ /// </summary>
+ private const string CS0305 = "CS0305";
+
+ /// <summary>
+ /// The non-generic type 'A' cannot be used with type arguments
+ /// </summary>
+ private const string CS0308 = "CS0308";
+
+ public override ImmutableArray<string> FixableDiagnosticIds
+ {
+ get { return ImmutableArray.Create(CS0103, CS0104, CS0246, CS0305, CS0308); }
+ }
+
+ protected bool IgnoreCase
+ {
+ get { return false; }
+ }
+
+ protected bool CanFullyQualify(Diagnostic diagnostic, ref SyntaxNode node)
+ {
+ var simpleName = node as SimpleNameSyntax;
+ if (simpleName == null)
+ {
+ return false;
+ }
+
+ if (!simpleName.LooksLikeStandaloneTypeName())
+ {
+ return false;
+ }
+
+ if (!simpleName.CanBeReplacedWithAnyName())
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ protected SyntaxNode ReplaceNode(SyntaxNode node, string containerName, CancellationToken cancellationToken)
+ {
+ var simpleName = (SimpleNameSyntax)node;
+
+ var leadingTrivia = simpleName.GetLeadingTrivia();
+ var newName = simpleName.WithLeadingTrivia(SyntaxTriviaList.Empty);
+
+ var qualifiedName = SyntaxFactory.QualifiedName(
+ SyntaxFactory.ParseName(containerName), newName);
+
+ qualifiedName = qualifiedName.WithLeadingTrivia(leadingTrivia);
+ qualifiedName = qualifiedName.WithAdditionalAnnotations(Formatter.Annotation);
+
+ var syntaxTree = simpleName.SyntaxTree;
+ return syntaxTree.GetRoot(cancellationToken).ReplaceNode((NameSyntax)simpleName, qualifiedName);
+ }
+
+ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
+ {
+ var document = context.Document;
+ var span = context.Span;
+ var diagnostics = context.Diagnostics;
+ var cancellationToken = context.CancellationToken;
+
+ var project = document.Project;
+ var diagnostic = diagnostics.First();
+ var model = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait (false);
+ if (model.IsFromGeneratedCode (context.CancellationToken))
+ return;
+
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ var node = root.FindToken(span.Start).GetAncestors<SyntaxNode>().First(n => n.Span.Contains(span));
+
+ // Has to be a simple identifier or generic name.
+ if (node != null && CanFullyQualify(diagnostic, ref node))
+ {
+ var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+
+ var matchingTypes = await this.GetMatchingTypesAsync(project, semanticModel, node, cancellationToken).ConfigureAwait(false);
+ var matchingNamespaces = await this.GetMatchingNamespacesAsync(project, semanticModel, node, cancellationToken).ConfigureAwait(false);
+
+ if (matchingTypes != null || matchingNamespaces != null)
+ {
+ matchingTypes = matchingTypes ?? SpecializedCollections.EmptyEnumerable<ISymbol>();
+ matchingNamespaces = matchingNamespaces ?? SpecializedCollections.EmptyEnumerable<ISymbol>();
+
+ var matchingTypeContainers = FilterAndSort(GetContainers(matchingTypes, semanticModel.Compilation));
+ var matchingNamespaceContainers = FilterAndSort(GetContainers(matchingNamespaces, semanticModel.Compilation));
+
+ var proposedContainers =
+ matchingTypeContainers.Concat(matchingNamespaceContainers)
+ .Distinct()
+ .Take(8);
+
+ foreach (var container in proposedContainers)
+ {
+ var containerName = RoslynCompletionData.SafeMinimalDisplayString (container, semanticModel, node.SpanStart);
+
+ string name;
+ int arity;
+ node.GetNameAndArityOfSimpleName(out name, out arity);
+
+ // Actual member name might differ by case.
+ string memberName;
+ if (this.IgnoreCase)
+ {
+ var member = container.GetMembers(name).FirstOrDefault();
+ memberName = member != null ? member.Name : name;
+ }
+ else
+ {
+ memberName = name;
+ }
+
+ var codeAction = new DocumentChangeAction(
+ node.Span,
+ DiagnosticSeverity.Info,
+ string.Format(GettextCatalog.GetString ("Change '{0}' to '{1}.{2}'"), name, containerName, memberName),
+ (c) =>
+ {
+ var newRoot = this.ReplaceNode(node, containerName, c);
+ return Task.FromResult(document.WithSyntaxRoot(newRoot));
+ });
+
+ context.RegisterCodeFix(codeAction, diagnostic);
+ }
+ }
+ }
+ }
+
+ internal async Task<IEnumerable<ISymbol>> GetMatchingTypesAsync(
+ Microsoft.CodeAnalysis.Project project, SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ // Can't be on the right hand side of binary expression (like 'dot').
+ cancellationToken.ThrowIfCancellationRequested();
+ string name;
+ int arity;
+ node.GetNameAndArityOfSimpleName(out name, out arity);
+
+ var symbols = await SymbolFinder.FindDeclarationsAsync(project, name, this.IgnoreCase, SymbolFilter.Type, cancellationToken).ConfigureAwait(false);
+
+ // also lookup type symbols with the "Attribute" suffix.
+ var inAttributeContext = node.IsAttributeName();
+ if (inAttributeContext)
+ {
+ symbols = symbols.Concat(
+ await SymbolFinder.FindDeclarationsAsync(project, name + "Attribute", this.IgnoreCase, SymbolFilter.Type, cancellationToken).ConfigureAwait(false));
+ }
+
+ var accessibleTypeSymbols = symbols
+ .OfType<INamedTypeSymbol>()
+ .Where(s => (arity == 0 || s.GetArity() == arity)
+ && s.IsAccessibleWithin(semanticModel.Compilation.Assembly)
+ && (!inAttributeContext || s.IsAttribute())
+ && HasValidContainer(s))
+ .ToList();
+
+ return accessibleTypeSymbols;
+ }
+
+ private static bool HasValidContainer(ISymbol symbol)
+ {
+ var container = symbol.ContainingSymbol;
+ return container is INamespaceSymbol ||
+ (container is INamedTypeSymbol && !((INamedTypeSymbol)container).IsGenericType);
+ }
+
+ internal async Task<IEnumerable<ISymbol>> GetMatchingNamespacesAsync(
+ Microsoft.CodeAnalysis.Project project,
+ SemanticModel semanticModel,
+ SyntaxNode simpleName,
+ CancellationToken cancellationToken)
+ {
+ if (simpleName.IsAttributeName())
+ {
+ return null;
+ }
+
+ string name;
+ int arity;
+ simpleName.GetNameAndArityOfSimpleName(out name, out arity);
+ if (cancellationToken.IsCancellationRequested)
+ {
+ return null;
+ }
+
+ var symbols = await SymbolFinder.FindDeclarationsAsync(project, name, this.IgnoreCase, SymbolFilter.Namespace, cancellationToken).ConfigureAwait(false);
+
+ var namespaces = symbols
+ .OfType<INamespaceSymbol>()
+ .Where(n => !n.IsGlobalNamespace &&
+ HasAccessibleTypes(n, semanticModel, cancellationToken));
+
+ return namespaces;
+ }
+
+ private bool HasAccessibleTypes(INamespaceSymbol @namespace, SemanticModel model, CancellationToken cancellationToken)
+ {
+ return Enumerable.Any(@namespace.GetAllTypes(cancellationToken), t => t.IsAccessibleWithin(model.Compilation.Assembly));
+ }
+
+ private static IEnumerable<INamespaceOrTypeSymbol> GetContainers(IEnumerable<ISymbol> symbols, Compilation compilation)
+ {
+ foreach (var symbol in symbols)
+ {
+ var containingSymbol = symbol.ContainingSymbol as INamespaceOrTypeSymbol;
+ if (containingSymbol is INamespaceSymbol)
+ {
+ containingSymbol = compilation.GetCompilationNamespace((INamespaceSymbol)containingSymbol);
+ }
+
+ if (containingSymbol != null)
+ {
+ yield return containingSymbol;
+ }
+ }
+ }
+
+ private IEnumerable<INamespaceOrTypeSymbol> FilterAndSort(IEnumerable<INamespaceOrTypeSymbol> symbols)
+ {
+ symbols = symbols ?? SpecializedCollections.EmptyList<INamespaceOrTypeSymbol>();
+ var list = symbols.Distinct ().Where<INamespaceOrTypeSymbol> (n => n is INamedTypeSymbol || !((INamespaceSymbol)n).IsGlobalNamespace).ToList ();
+ list.Sort (this.Compare);
+ return list;
+ }
+
+ private static readonly ConditionalWeakTable<INamespaceOrTypeSymbol, IList<string>> s_symbolToNameMap =
+ new ConditionalWeakTable<INamespaceOrTypeSymbol, IList<string>>();
+
+ private static IList<string> GetNameParts(INamespaceOrTypeSymbol symbol)
+ {
+ return symbol.ToDisplayString(MonoDevelop.Ide.TypeSystem.Ambience.NameFormat).Split('.');
+ }
+
+ private int Compare(INamespaceOrTypeSymbol n1, INamespaceOrTypeSymbol n2)
+ {
+ if (n1 is INamedTypeSymbol && n2 is INamespaceSymbol)
+ {
+ return -1;
+ }
+ else if (n1 is INamespaceSymbol && n2 is INamedTypeSymbol)
+ {
+ return 1;
+ }
+
+ var names1 = s_symbolToNameMap.GetValue(n1, GetNameParts);
+ var names2 = s_symbolToNameMap.GetValue(n2, GetNameParts);
+
+ for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++)
+ {
+ var comp = names1[i].CompareTo(names2[i]);
+ if (comp != 0)
+ {
+ return comp;
+ }
+ }
+
+ return names1.Count - names2.Count;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateConstructor/AbstractGenerateMemberCodeFixProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateConstructor/AbstractGenerateMemberCodeFixProvider.cs
new file mode 100644
index 0000000000..1c735ea833
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateConstructor/AbstractGenerateMemberCodeFixProvider.cs
@@ -0,0 +1,106 @@
+//
+// AbstractGenerateMemberCodeFixProvider.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Linq;
+using System.Composition;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+using ICSharpCode.NRefactory6.CSharp;
+using RefactoringEssentials;
+
+namespace MonoDevelop.CSharp.CodeFixes.GenerateConstructor
+{
+ internal abstract class AbstractGenerateMemberCodeFixProvider : CodeFixProvider
+ {
+ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
+ {
+ // NOTE(DustinCa): Not supported in REPL for now.
+ if (context.Document.SourceCodeKind == SourceCodeKind.Script)
+ {
+ return;
+ }
+ var model = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait (false);
+ if (model.IsFromGeneratedCode (context.CancellationToken))
+ return;
+
+ var root = await model.SyntaxTree.GetRootAsync (context.CancellationToken).ConfigureAwait (false);
+ var names = GetTargetNodes(root, context.Span);
+ foreach (var name in names)
+ {
+ var codeActions = await GetCodeActionsAsync(context.Document, name, context.CancellationToken).ConfigureAwait(false);
+ if (codeActions == null)
+ {
+ continue;
+ }
+ foreach (var act in codeActions)
+ context.RegisterCodeFix (act, context.Diagnostics);
+ return;
+ }
+ }
+
+ protected abstract Task<IEnumerable<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken);
+
+ protected virtual SyntaxNode GetTargetNode(SyntaxNode node)
+ {
+ return node;
+ }
+
+ protected virtual bool IsCandidate(SyntaxNode node)
+ {
+ return false;
+ }
+
+ protected virtual IEnumerable<SyntaxNode> GetTargetNodes(SyntaxNode root, TextSpan span)
+ {
+ var token = root.FindToken(span.Start);
+ if (!token.Span.IntersectsWith(span))
+ {
+ yield break;
+ }
+
+ var nodes = token.GetAncestors<SyntaxNode>().Where(IsCandidate);
+ foreach (var node in nodes)
+ {
+ var name = GetTargetNode(node);
+
+ if (name != null)
+ {
+ yield return name;
+ }
+ }
+ }
+ }
+
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateConstructor/GenerateConstructorCodeFixProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateConstructor/GenerateConstructorCodeFixProvider.cs
new file mode 100644
index 0000000000..42853f44da
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateConstructor/GenerateConstructorCodeFixProvider.cs
@@ -0,0 +1,63 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Composition;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp;
+using System.Linq;
+using ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateConstructor;
+using System;
+
+namespace MonoDevelop.CSharp.CodeFixes.GenerateConstructor
+{
+ [ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.GenerateConstructor), Shared]
+ [ExtensionOrder(After = PredefinedCodeFixProviderNames.FullyQualify)]
+ internal class GenerateConstructorCodeFixProvider : AbstractGenerateMemberCodeFixProvider
+ {
+ private const string CS0122 = "CS0122"; // CS0122: 'C' is inaccessible due to its protection level
+ private const string CS1729 = "CS1729"; // CS1729: 'C' does not contain a constructor that takes n arguments
+ private const string CS1739 = "CS1739"; // CS1739: The best overload for 'Program' does not have a parameter named 'v'
+ private const string CS1503 = "CS1503"; // CS1503: Argument 1: cannot convert from 'T1' to 'T2'
+ private const string CS7036 = "CS7036"; // CS7036: There is no argument given that corresponds to the required formal parameter 'v' of 'C.C(int)'
+
+ public override ImmutableArray<string> FixableDiagnosticIds
+ {
+ get { return ImmutableArray.Create(CS0122, CS1729, CS1739, CS1503, CS7036); }
+ }
+
+ protected override Task<IEnumerable<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ return new CSharpGenerateConstructorService ().GenerateConstructorAsync (document, node, cancellationToken);
+ }
+
+ protected override bool IsCandidate(SyntaxNode node)
+ {
+ return node is SimpleNameSyntax || node is ObjectCreationExpressionSyntax || node is ConstructorInitializerSyntax || node is AttributeSyntax;
+ }
+
+ protected override SyntaxNode GetTargetNode(SyntaxNode node)
+ {
+ var objectCreationNode = node as ObjectCreationExpressionSyntax;
+ if (objectCreationNode != null)
+ {
+ return objectCreationNode.Type.GetRightmostName();
+ }
+
+ var attributeNode = node as AttributeSyntax;
+ if (attributeNode != null)
+ {
+ return attributeNode.Name;
+ }
+
+ return node;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateEnumMember/GenerateEnumMemberCodeFixProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateEnumMember/GenerateEnumMemberCodeFixProvider.cs
new file mode 100644
index 0000000000..29823cc623
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateEnumMember/GenerateEnumMemberCodeFixProvider.cs
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Composition;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.CSharp.CodeFixes.GenerateConstructor;
+using ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateEnumMember;
+
+namespace MonoDevelop.CSharp.CodeFixes.GenerateEnumMember
+{
+ [ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.GenerateEnumMember), Shared]
+ [ExtensionOrder(After = PredefinedCodeFixProviderNames.GenerateConstructor)]
+ internal class GenerateEnumMemberCodeFixProvider : AbstractGenerateMemberCodeFixProvider
+ {
+ private const string CS0117 = "CS0117"; // error CS0117: 'Color' does not contain a definition for 'Red'
+
+ public override ImmutableArray<string> FixableDiagnosticIds
+ {
+ get { return ImmutableArray.Create(CS0117); }
+ }
+ static CSharpGenerateEnumMemberService service = new CSharpGenerateEnumMemberService();
+
+ protected override Task<IEnumerable<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ return service.GenerateEnumMemberAsync(document, node, cancellationToken);
+ }
+
+ protected override bool IsCandidate(SyntaxNode node)
+ {
+ return node is IdentifierNameSyntax;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateMethod/GenerateConversionCodeFixProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateMethod/GenerateConversionCodeFixProvider.cs
new file mode 100644
index 0000000000..4db9c211a7
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateMethod/GenerateConversionCodeFixProvider.cs
@@ -0,0 +1,65 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Composition;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.CSharp.CodeFixes.GenerateConstructor;
+using Microsoft.CodeAnalysis.CSharp;
+using ICSharpCode.NRefactory6.CSharp;
+using ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateParameterizedMember;
+
+namespace MonoDevelop.CSharp.CodeFixes.GenerateMethod
+{
+ [ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.GenerateConversion), Shared]
+ [ExtensionOrder(After = PredefinedCodeFixProviderNames.GenerateEnumMember)]
+ internal class GenerateConversionCodeFixProvider : AbstractGenerateMemberCodeFixProvider
+ {
+ private const string CS0029 = "CS0029"; // error CS0029: Cannot implicitly convert type 'type' to 'type'
+ private const string CS0030 = "CS0030"; // error CS0030: Cannot convert type 'type' to 'type'
+
+ public override ImmutableArray<string> FixableDiagnosticIds
+ {
+ get { return ImmutableArray.Create(CS0029, CS0030); }
+ }
+
+ protected override bool IsCandidate(SyntaxNode node)
+ {
+ return node.IsKind(SyntaxKind.IdentifierName) ||
+ node.IsKind(SyntaxKind.MethodDeclaration) ||
+ node.IsKind(SyntaxKind.InvocationExpression) ||
+ node.IsKind(SyntaxKind.CastExpression) ||
+ node is LiteralExpressionSyntax ||
+ node is SimpleNameSyntax ||
+ node is ExpressionSyntax;
+ }
+
+ protected override SyntaxNode GetTargetNode(SyntaxNode node)
+ {
+ var invocation = node as InvocationExpressionSyntax;
+ if (invocation != null)
+ {
+ return invocation.Expression.GetRightmostName();
+ }
+
+ var memberBindingExpression = node as MemberBindingExpressionSyntax;
+ if (memberBindingExpression != null)
+ {
+ return memberBindingExpression.Name;
+ }
+
+ return node;
+ }
+ static CSharpGenerateConversionService service = new CSharpGenerateConversionService ();
+
+ protected override Task<IEnumerable<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ return service.GenerateConversionAsync(document, node, cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateMethod/GenerateMethodCodeFixProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateMethod/GenerateMethodCodeFixProvider.cs
new file mode 100644
index 0000000000..c1c8396fa3
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateMethod/GenerateMethodCodeFixProvider.cs
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Composition;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.CSharp.CodeFixes.GenerateConstructor;
+using ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateParameterizedMember;
+using Microsoft.CodeAnalysis.CSharp;
+using ICSharpCode.NRefactory6.CSharp;
+
+namespace MonoDevelop.CSharp.CodeFixes.GenerateMethod
+{
+ [ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.GenerateMethod), Shared]
+ [ExtensionOrder(After = PredefinedCodeFixProviderNames.GenerateEnumMember)]
+ internal class GenerateMethodCodeFixProvider : AbstractGenerateMemberCodeFixProvider
+ {
+ private const string CS0103 = "CS0103"; // error CS0103: Error The name 'Foo' does not exist in the current context
+ private const string CS1061 = "CS1061"; // error CS1061: Error 'Class' does not contain a definition for 'Foo' and no extension method 'Foo'
+ private const string CS0117 = "CS0117"; // error CS0117: 'Class' does not contain a definition for 'Foo'
+ private const string CS0122 = "CS0122"; // error CS0122: 'Class' is inaccessible due to its protection level.
+ private const string CS0539 = "CS0539"; // error CS0539: 'A.Foo<T>()' in explicit interface declaration is not a member of interface
+ private const string CS1501 = "CS1501"; // error CS1501: No overload for method 'M' takes 1 arguments
+ private const string CS1503 = "CS1503"; // error CS1503: Argument 1: cannot convert from 'double' to 'int'
+ private const string CS0305 = "CS0305"; // error CS0305: Using the generic method 'CA.M<V>()' requires 1 type arguments
+ private const string CS0308 = "CS0308"; // error CS0308: The non-generic method 'Program.Foo()' cannot be used with type arguments
+ private const string CS1660 = "CS1660"; // error CS1660: Cannot convert lambda expression to type 'string[]' because it is not a delegate type
+ private const string CS1739 = "CS1739"; // error CS1739: The best overload for 'M' does not have a parameter named 'x'
+ private const string CS7036 = "CS7036"; // error CS7036: There is no argument given that corresponds to the required formal parameter 'x' of 'C.M(int)'
+
+ public override ImmutableArray<string> FixableDiagnosticIds
+ {
+ get { return ImmutableArray.Create(CS0103, CS1061, CS0117, CS0122, CS0539, CS1501, CS1503, CS0305, CS0308, CS1660, CS1739, CS7036); }
+ }
+
+ protected override bool IsCandidate(SyntaxNode node)
+ {
+ return node.IsKind(SyntaxKind.IdentifierName) ||
+ node.IsKind(SyntaxKind.MethodDeclaration) ||
+ node.IsKind(SyntaxKind.InvocationExpression) ||
+ node.IsKind(SyntaxKind.CastExpression) ||
+ node is LiteralExpressionSyntax ||
+ node is SimpleNameSyntax ||
+ node is ExpressionSyntax;
+ }
+
+ protected override SyntaxNode GetTargetNode(SyntaxNode node)
+ {
+ var invocation = node as InvocationExpressionSyntax;
+ if (invocation != null)
+ {
+ return invocation.Expression.GetRightmostName();
+ }
+
+ var memberBindingExpression = node as MemberBindingExpressionSyntax;
+ if (memberBindingExpression != null)
+ {
+ return memberBindingExpression.Name;
+ }
+
+ return node;
+ }
+ static CSharpGenerateMethodService service = new CSharpGenerateMethodService ();
+
+ protected override Task<IEnumerable<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ return service.GenerateMethodAsync(document, node, cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateType/GenerateTypeCodeFixProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateType/GenerateTypeCodeFixProvider.cs
new file mode 100644
index 0000000000..6039a17dc7
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateType/GenerateTypeCodeFixProvider.cs
@@ -0,0 +1,77 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Composition;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.CSharp.CodeFixes.GenerateConstructor;
+using ICSharpCode.NRefactory6.CSharp.GenerateType;
+using Microsoft.CodeAnalysis.CSharp;
+using ICSharpCode.NRefactory6.CSharp;
+
+namespace MonoDevelop.CSharp.CodeFixes.GenerateType
+{
+ [ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.GenerateType), Shared]
+ [ExtensionOrder(After = PredefinedCodeFixProviderNames.GenerateVariable)]
+ internal class GenerateTypeCodeFixProvider : AbstractGenerateMemberCodeFixProvider
+ {
+ private const string CS0103 = "CS0103"; // error CS0103: The name 'Foo' does not exist in the current context
+ private const string CS0117 = "CS0117"; // error CS0117: 'x' does not contain a definition for 'y'
+ private const string CS0234 = "CS0234"; // error CS0234: The type or namespace name 'C' does not exist in the namespace 'N' (are you missing an assembly reference?)
+ private const string CS0246 = "CS0246"; // error CS0246: The type or namespace name 'T' could not be found (are you missing a using directive or an assembly reference?)
+ private const string CS0305 = "CS0305"; // error CS0305: Using the generic type 'C<T1>' requires 1 type arguments
+ private const string CS0308 = "CS0308"; // error CS0308: The non-generic type 'A' cannot be used with type arguments
+ private const string CS0426 = "CS0426"; // error CS0426: The type name 'S' does not exist in the type 'Program'
+ private const string CS0616 = "CS0616"; // error CS0616: 'x' is not an attribute class
+
+ public override ImmutableArray<string> FixableDiagnosticIds
+ {
+ get { return ImmutableArray.Create(CS0103, CS0117, CS0234, CS0246, CS0305, CS0308, CS0426, CS0616); }
+ }
+
+ protected override bool IsCandidate(SyntaxNode node)
+ {
+ var qualified = node as QualifiedNameSyntax;
+ if (qualified != null)
+ {
+ return true;
+ }
+
+ var simple = node as SimpleNameSyntax;
+ if (simple != null)
+ {
+ return !simple.IsParentKind(SyntaxKind.QualifiedName);
+ }
+
+ var memberAccess = node as MemberAccessExpressionSyntax;
+ if (memberAccess != null)
+ {
+ return true;
+ }
+ if (node.IsKind (SyntaxKind.ObjectCreationExpression))
+ return true;
+ return false;
+ }
+
+ protected override SyntaxNode GetTargetNode(SyntaxNode node)
+ {
+ if (node.IsKind (SyntaxKind.ObjectCreationExpression))
+ node = ((ObjectCreationExpressionSyntax)node).Type;
+ return ((ExpressionSyntax)node).GetRightmostName();
+ }
+
+ static readonly CSharpGenerateTypeService service = new CSharpGenerateTypeService ();
+
+ protected override Task<IEnumerable<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ return service.GenerateTypeAsync(document, node, cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateVariable/GenerateVariableCodeFixProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateVariable/GenerateVariableCodeFixProvider.cs
new file mode 100644
index 0000000000..11e589fc05
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/GenerateVariable/GenerateVariableCodeFixProvider.cs
@@ -0,0 +1,59 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Composition;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.GenerateMember.GenerateVariable;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.CSharp.CodeFixes.GenerateConstructor;
+
+namespace MonoDevelop.CSharp.CodeFixes.GenerateVariable
+{
+ [ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.GenerateVariable), Shared]
+ [ExtensionOrder(After = PredefinedCodeFixProviderNames.GenerateMethod)]
+ internal class GenerateVariableCodeFixProvider : AbstractGenerateMemberCodeFixProvider
+ {
+ private const string CS1061 = "CS1061"; // error CS1061: 'C' does not contain a definition for 'Foo' and no extension method 'Foo' accepting a first argument of type 'C' could be found
+ private const string CS0103 = "CS0103"; // error CS0103: The name 'Foo' does not exist in the current context
+ private const string CS0117 = "CS0117"; // error CS0117: 'TestNs.Program' does not contain a definition for 'blah'
+ private const string CS0539 = "CS0539"; // error CS0539: 'Class.SomeProp' in explicit interface declaration is not a member of interface
+ private const string CS0246 = "CS0246"; // error CS0246: The type or namespace name 'Version' could not be found
+
+ public override ImmutableArray<string> FixableDiagnosticIds
+ {
+ get { return ImmutableArray.Create(CS1061, CS0103, CS0117, CS0539, CS0246); }
+ }
+
+ protected override bool IsCandidate(SyntaxNode node)
+ {
+ return node is SimpleNameSyntax || node is PropertyDeclarationSyntax || node is MemberBindingExpressionSyntax;
+ }
+
+ protected override SyntaxNode GetTargetNode(SyntaxNode node)
+ {
+ if (node.IsKind(SyntaxKind.MemberBindingExpression))
+ {
+ var nameNode = node.ChildNodes().FirstOrDefault(n => n.IsKind(SyntaxKind.IdentifierName));
+ if (nameNode != null)
+ {
+ return nameNode;
+ }
+ }
+
+ return base.GetTargetNode(node);
+ }
+ static readonly CSharpGenerateVariableService service = new CSharpGenerateVariableService ();
+
+ protected override Task<IEnumerable<CodeAction>> GetCodeActionsAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ return service.GenerateVariableAsync(document, node, cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/ImplementAbstractClass/ImplementAbstractClassCodeFixProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/ImplementAbstractClass/ImplementAbstractClassCodeFixProvider.cs
new file mode 100644
index 0000000000..25c8b7f949
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/ImplementAbstractClass/ImplementAbstractClassCodeFixProvider.cs
@@ -0,0 +1,95 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Immutable;
+using System.Composition;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp.Features.ImplementAbstractClass;
+using MonoDevelop.Core;
+using RefactoringEssentials;
+using ICSharpCode.NRefactory6.CSharp;
+
+namespace MonoDevelop.CSharp.CodeFixes.ImplementAbstractClass
+{
+ [ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.ImplementAbstractClass), Shared]
+ [ExtensionOrder(After = PredefinedCodeFixProviderNames.GenerateType)]
+ internal class ImplementAbstractClassCodeFixProvider : CodeFixProvider
+ {
+ private const string CS0534 = "CS0534"; // 'Program' does not implement inherited abstract member 'Foo.bar()'
+
+ public sealed override ImmutableArray<string> FixableDiagnosticIds
+ {
+ get { return ImmutableArray.Create(CS0534); }
+ }
+
+ public sealed override FixAllProvider GetFixAllProvider()
+ {
+ return WellKnownFixAllProviders.BatchFixer;
+ }
+
+ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
+ {
+ var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
+
+ var token = root.FindToken(context.Span.Start);
+ if (!token.Span.IntersectsWith(context.Span))
+ {
+ return;
+ }
+
+ var classNode = token.Parent as ClassDeclarationSyntax;
+ if (classNode == null)
+ {
+ return;
+ }
+
+ var model = await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false);
+ if (model.IsFromGeneratedCode (context.CancellationToken))
+ return;
+
+ foreach (var baseTypeSyntax in classNode.BaseList.Types)
+ {
+ var node = baseTypeSyntax.Type;
+
+ if (service.CanImplementAbstractClass(
+ context.Document,
+ model,
+ node,
+ context.CancellationToken))
+ {
+ var title = GettextCatalog.GetString ("Implement Abstract Class");
+ var abstractType = model.GetTypeInfo(node, context.CancellationToken).Type;
+ //var id = GetCodeActionId(abstractType.ContainingAssembly.Name, abstractType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat));
+ context.RegisterCodeFix(
+ new DocumentChangeAction(node.Span, DiagnosticSeverity.Error, title,
+ (c) => ImplementAbstractClassAsync(context.Document, node, c)),
+ context.Diagnostics);
+ return;
+ }
+ }
+ }
+
+ // internal for testing purposes.
+ internal static string GetCodeActionId(string assemblyName, string abstractTypeFullyQualifiedName)
+ {
+ return "ImplementAbstractClass;" +
+ assemblyName + ";" +
+ abstractTypeFullyQualifiedName;
+ }
+ static CSharpImplementAbstractClassService service = new CSharpImplementAbstractClassService ();
+
+ private async Task<Document> ImplementAbstractClassAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ return await service.ImplementAbstractClassAsync(
+ document,
+ await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false),
+ node,
+ cancellationToken).ConfigureAwait(false);
+ }
+
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/ImplementInterface/ImplementInterfaceCodeFixProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/ImplementInterface/ImplementInterfaceCodeFixProvider.cs
new file mode 100644
index 0000000000..89f89add8a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/ImplementInterface/ImplementInterfaceCodeFixProvider.cs
@@ -0,0 +1,70 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Composition;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp.Features.ImplementInterface;
+using ICSharpCode.NRefactory6.CSharp;
+using RefactoringEssentials;
+
+namespace MonoDevelop.CSharp.CodeFixes.ImplementInterface
+{
+ [ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.ImplementInterface), Shared]
+ [ExtensionOrder(After = PredefinedCodeFixProviderNames.ImplementAbstractClass)]
+ internal class ImplementInterfaceCodeFixProvider : CodeFixProvider
+ {
+ private readonly Func<TypeSyntax, bool> _interfaceName = n => n.Parent is BaseTypeSyntax && n.Parent.Parent is BaseListSyntax && ((BaseTypeSyntax)n.Parent).Type == n;
+ private readonly Func<IEnumerable<CodeAction>, bool> _codeActionAvailable = actions => actions != null && actions.Any();
+
+ internal const string CS0535 = "CS0535"; // 'Program' does not implement interface member 'System.Collections.IEnumerable.GetEnumerator()'
+ internal const string CS0737 = "CS0737"; // 'Class' does not implement interface member 'IInterface.M()'. 'Class.M()' cannot implement an interface member because it is not public.
+ internal const string CS0738 = "CS0738"; // 'C' does not implement interface member 'I.Method1()'. 'B.Method1()' cannot implement 'I.Method1()' because it does not have the matching return type of 'void'.
+
+ public sealed override ImmutableArray<string> FixableDiagnosticIds
+ {
+ get { return ImmutableArray.Create(CS0535, CS0737, CS0738); }
+ }
+ static CSharpImplementInterfaceService service = new CSharpImplementInterfaceService();
+
+ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
+ {
+ var document = context.Document;
+ var span = context.Span;
+ var cancellationToken = context.CancellationToken;
+
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+
+ var token = root.FindToken(span.Start);
+ if (!token.Span.IntersectsWith(span))
+ {
+ return;
+ }
+
+ var model = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ if (model.IsFromGeneratedCode (cancellationToken))
+ return;
+
+ var actions = token.Parent.GetAncestorsOrThis<TypeSyntax>()
+ .Where(_interfaceName)
+ .Select(n => service.GetCodeActions(document, model, n, cancellationToken))
+ .FirstOrDefault(_codeActionAvailable);
+
+ if (_codeActionAvailable(actions))
+ {
+ context.RegisterFixes(actions, context.Diagnostics);
+ }
+ }
+
+ public sealed override FixAllProvider GetFixAllProvider()
+ {
+ return WellKnownFixAllProviders.BatchFixer;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/MoveTypeToFile/MoveTypeToFile.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/MoveTypeToFile/MoveTypeToFile.cs
new file mode 100644
index 0000000000..97af87855c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/MoveTypeToFile/MoveTypeToFile.cs
@@ -0,0 +1,215 @@
+//
+// MoveTypeToFile.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using ICSharpCode.NRefactory.CSharp;
+using RefactoringEssentials;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.CodeRefactorings;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide;
+using System.Collections.Generic;
+using MonoDevelop.Ide.StandardHeader;
+using ICSharpCode.NRefactory6.CSharp;
+
+namespace MonoDevelop.CSharp.CodeFixes.MoveTypeToFile
+{
+ [ExportCodeRefactoringProvider(LanguageNames.CSharp, Name = "Move type to file")]
+ class MoveTypeToFile : CodeRefactoringProvider
+ {
+ public async override Task ComputeRefactoringsAsync (CodeRefactoringContext context)
+ {
+ var document = context.Document;
+ var span = context.Span;
+ var cancellationToken = context.CancellationToken;
+
+ var model = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait (false);
+ if (model.IsFromGeneratedCode (cancellationToken))
+ return;
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait (false);
+ var token = root.FindToken(span.Start);
+
+ var type = token.Parent as BaseTypeDeclarationSyntax;
+ if (type == null)
+ return;
+ if (type.Parent is BaseTypeDeclarationSyntax)
+ return;
+
+ if (Path.GetFileNameWithoutExtension (document.FilePath) == type.Identifier.ToString ())
+ return;
+
+ string title;
+ if (IsSingleType (root)) {
+ title = String.Format (GettextCatalog.GetString ("Rename file to '{0}'"), Path.GetFileName (GetCorrectFileName (document, type)));
+ } else {
+ title = String.Format (GettextCatalog.GetString ("Move type to file '{0}'"), Path.GetFileName (GetCorrectFileName (document, type)));
+ }
+ context.RegisterRefactoring (new MyCodeAction (document, title, root, type));
+ }
+
+ class MyCodeAction : CodeAction
+ {
+ readonly Document document;
+ readonly BaseTypeDeclarationSyntax type;
+ readonly SyntaxNode root;
+
+ public MyCodeAction (Document document, string title, SyntaxNode root, BaseTypeDeclarationSyntax type)
+ {
+ this.root = root;
+ this.title = title;
+ this.type = type;
+ this.document = document;
+
+ }
+
+ string title;
+ public override string Title {
+ get {
+ return this.title;
+ }
+ }
+
+ protected override Task<Document> GetChangedDocumentAsync (System.Threading.CancellationToken cancellationToken)
+ {
+ var correctFileName = GetCorrectFileName (document, type);
+ if (IsSingleType (root)) {
+ FileService.RenameFile (document.FilePath, correctFileName);
+ var doc = IdeApp.Workbench.ActiveDocument;
+ if (doc.HasProject) {
+ IdeApp.ProjectOperations.SaveAsync (doc.Project);
+ }
+ return Task.FromResult (document);
+ }
+ return Task.FromResult (CreateNewFile (type, correctFileName));
+ }
+
+ Document CreateNewFile (BaseTypeDeclarationSyntax type, string correctFileName)
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ var content = doc.Editor.Text;
+
+ var types = new List<BaseTypeDeclarationSyntax> (
+ root
+ .DescendantNodesAndSelf (n => !(n is BaseTypeDeclarationSyntax))
+ .OfType<BaseTypeDeclarationSyntax> ()
+ .Where (t => t.SpanStart != type.SpanStart)
+ );
+ types.Sort ((x, y) => y.SpanStart.CompareTo (x.SpanStart));
+
+ foreach (var removeType in types) {
+ var bounds = CalcTypeBounds (removeType);
+ content = content.Remove (bounds.Offset, bounds.Length);
+ }
+
+ if (doc.HasProject) {
+ string header = StandardHeaderService.GetHeader (doc.Project, correctFileName, true);
+ if (!string.IsNullOrEmpty (header))
+ content = header + doc.Editor.GetEolMarker () + StripHeader (content);
+ }
+ content = StripDoubleBlankLines (content);
+
+ File.WriteAllText (correctFileName, content);
+ if (doc.HasProject) {
+ doc.Project.AddFile (correctFileName);
+ IdeApp.ProjectOperations.SaveAsync (doc.Project);
+ }
+
+ doc.Editor.RemoveText (CalcTypeBounds (type));
+
+ return document;
+ }
+
+ ISegment CalcTypeBounds (BaseTypeDeclarationSyntax type)
+ {
+ int start = type.Span.Start;
+ int end = type.Span.End;
+ foreach (var trivia in type.GetLeadingTrivia ()) {
+ if (trivia.Kind () == SyntaxKind.SingleLineDocumentationCommentTrivia) {
+ start = trivia.FullSpan.Start;
+ }
+ }
+
+ return TextSegment.FromBounds (start, end);
+ }
+ }
+
+ static bool IsBlankLine (IReadonlyTextDocument doc, int i)
+ {
+ var line = doc.GetLine (i);
+ return line.Length == line.GetIndentation (doc).Length;
+ }
+
+ static string StripDoubleBlankLines (string content)
+ {
+ var doc = TextEditorFactory.CreateNewDocument (new StringTextSource (content), "a.cs");
+ for (int i = 1; i + 1 <= doc.LineCount; i++) {
+ if (IsBlankLine (doc, i) && IsBlankLine (doc, i + 1)) {
+ doc.RemoveText (doc.GetLine (i).SegmentIncludingDelimiter);
+ i--;
+ continue;
+ }
+ }
+ return doc.Text;
+ }
+
+ static string StripHeader (string content)
+ {
+ var doc = TextEditorFactory.CreateNewDocument (new StringTextSource (content), "");
+ while (true) {
+ string lineText = doc.GetLineText (1);
+ if (lineText == null)
+ break;
+ if (lineText.StartsWith ("//", StringComparison.Ordinal)) {
+ doc.RemoveText (doc.GetLine (1).SegmentIncludingDelimiter);
+ continue;
+ }
+ break;
+ }
+ return doc.Text;
+ }
+
+ static bool IsSingleType (SyntaxNode root)
+ {
+ return root.DescendantNodesAndSelf (c => !(c is BaseTypeDeclarationSyntax)).OfType<BaseTypeDeclarationSyntax> ().Count () == 1;
+ }
+
+ internal static string GetCorrectFileName (Document document, BaseTypeDeclarationSyntax type)
+ {
+ if (type == null)
+ return document.FilePath;
+ return Path.Combine (Path.GetDirectoryName (document.FilePath), type.Identifier + Path.GetExtension (document.FilePath));
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/PredefinedCodeFixProviderNames.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/PredefinedCodeFixProviderNames.cs
new file mode 100644
index 0000000000..71e0e7e62e
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/PredefinedCodeFixProviderNames.cs
@@ -0,0 +1,64 @@
+//
+// PredefinedCodeFixProviderNames.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using MonoDevelop.Core;
+
+namespace MonoDevelop.CSharp.CodeFixes
+{
+ static class PredefinedCodeFixProviderNames
+ {
+ public const string AddAwait = "Add Await For Expression";
+ public const string AddAsync = "Add Async To Member";
+ public const string ChangeReturnType = "Change Return Type";
+ public const string ChangeToYield = "Change To Yield";
+ public const string ConvertToAsync = "Convert To Async";
+ public const string ConvertToIterator = "Convert To Iterator";
+ public const string CorrectNextControlVariable = "Correct Next Control Variable";
+ public const string AddMissingReference = "Add Missing Reference";
+ public const string AddUsingOrImport = "Add Using or Import";
+ public const string FullyQualify = "Fully Qualify";
+ public const string FixIncorrectFunctionReturnType = "Fix Incorrect Function Return Type";
+ public const string FixIncorrectExitContinue = "Fix Incorrect Exit Continue";
+ public const string GenerateConstructor = "Generate Constructor";
+ public const string GenerateEndConstruct = "Generate End Construct";
+ public const string GenerateEnumMember = "Generate Enum Member";
+ public const string GenerateEvent = "Generate Event";
+ public const string GenerateVariable = "Generate Variable";
+ public const string GenerateMethod = "Generate Method";
+ public const string GenerateConversion = "Generate Conversion";
+ public const string GenerateType = "Generate Type";
+ public const string ImplementAbstractClass = "Implement Abstract Class";
+ public const string ImplementInterface = "Implement Interface";
+ public const string InsertMissingCast = "InsertMissingCast";
+ public const string MoveToTopOfFile = "Move To Top Of File";
+ public const string RemoveUnnecessaryCast = "Remove Unnecessary Casts";
+ public const string RemoveUnnecessaryImports = "Remove Unnecessary Usings or Imports";
+ public const string RenameTracking = "Rename Tracking";
+ public const string SimplifyNames = "Simplify Names";
+ public const string SpellCheck = "Spell Check";
+ public const string Suppression = "Suppression";
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/RemoveUnnecessaryCast/RemoveUnnecessaryCastCodeFixProvider.RemoveUnnecessaryCastFixAllProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/RemoveUnnecessaryCast/RemoveUnnecessaryCastCodeFixProvider.RemoveUnnecessaryCastFixAllProvider.cs
new file mode 100644
index 0000000000..ec7d818390
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/RemoveUnnecessaryCast/RemoveUnnecessaryCastCodeFixProvider.RemoveUnnecessaryCastFixAllProvider.cs
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace MonoDevelop.CSharp.CodeFixes.RemoveUnnecessaryCast
+{
+ internal partial class RemoveUnnecessaryCastCodeFixProvider : CodeFixProvider
+ {
+// private class RemoveUnnecessaryCastFixAllProvider : BatchSimplificationFixAllProvider
+// {
+// internal static new readonly RemoveUnnecessaryCastFixAllProvider Instance = new RemoveUnnecessaryCastFixAllProvider();
+//
+// protected override SyntaxNode GetNodeToSimplify(SyntaxNode root, SemanticModel model, Diagnostic diagnostic, Workspace workspace, out string codeActionId, CancellationToken cancellationToken)
+// {
+// codeActionId = null;
+// return GetCastNode(root, model, diagnostic.Location.SourceSpan, cancellationToken);
+// }
+//
+// protected override bool NeedsParentFixup
+// {
+// get
+// {
+// return true;
+// }
+// }
+//
+// protected override async Task<Document> AddSimplifyAnnotationsAsync(Document document, SyntaxNode nodeToSimplify, CancellationToken cancellationToken)
+// {
+// var cast = nodeToSimplify as CastExpressionSyntax;
+// if (cast == null)
+// {
+// return null;
+// }
+//
+// return await RemoveUnnecessaryCastAsync(document, cast, cancellationToken).ConfigureAwait(false);
+// }
+// }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/RemoveUnnecessaryCast/RemoveUnnecessaryCastCodeFixProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/RemoveUnnecessaryCast/RemoveUnnecessaryCastCodeFixProvider.cs
new file mode 100644
index 0000000000..26283ce45d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/RemoveUnnecessaryCast/RemoveUnnecessaryCastCodeFixProvider.cs
@@ -0,0 +1,122 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Immutable;
+using System.Composition;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Diagnostics;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Simplification;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.CSharp.Diagnostics;
+using ICSharpCode.NRefactory6.CSharp;
+using MonoDevelop.Core;
+using RefactoringEssentials;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace MonoDevelop.CSharp.CodeFixes.RemoveUnnecessaryCast
+{
+ [ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.RemoveUnnecessaryCast), Shared]
+ [ExtensionOrder(After = PredefinedCodeFixProviderNames.ImplementInterface)]
+ internal partial class RemoveUnnecessaryCastCodeFixProvider : CodeFixProvider
+ {
+ public sealed override ImmutableArray<string> FixableDiagnosticIds
+ {
+ get { return ImmutableArray.Create(IDEDiagnosticIds.RemoveUnnecessaryCastDiagnosticId); }
+ }
+
+// public sealed override FixAllProvider GetFixAllProvider()
+// {
+// return RemoveUnnecessaryCastFixAllProvider.Instance;
+// }
+//
+ private static CastExpressionSyntax GetCastNode(SyntaxNode root, SemanticModel model, TextSpan span, CancellationToken cancellationToken)
+ {
+ var token = root.FindToken(span.Start);
+ if (!token.Span.IntersectsWith(span))
+ {
+ return null;
+ }
+
+ return token.GetAncestors<CastExpressionSyntax>()
+ .FirstOrDefault(c => c.Span.IntersectsWith(span) && c.IsUnnecessaryCast(model, cancellationToken));
+ }
+
+ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
+ {
+ var document = context.Document;
+ var span = context.Span;
+ var cancellationToken = context.CancellationToken;
+
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ var model = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ var node = GetCastNode(root, model, span, cancellationToken);
+ if (node == null)
+ {
+ return;
+ }
+
+ context.RegisterCodeFix(
+ new DocumentChangeAction(node.Span, DiagnosticSeverity.Warning,
+ GettextCatalog.GetString ("Remove Unnecessary Cast"),
+ (c) => RemoveUnnecessaryCastAsync(document, node, c)),
+ context.Diagnostics);
+ }
+
+ private static async Task<Document> RemoveUnnecessaryCastAsync(Document document, CastExpressionSyntax cast, CancellationToken cancellationToken)
+ {
+ var annotatedCast = cast.WithAdditionalAnnotations(Simplifier.Annotation);
+
+ if (annotatedCast.Expression is ParenthesizedExpressionSyntax)
+ {
+ annotatedCast = annotatedCast.WithExpression(
+ annotatedCast.Expression.WithAdditionalAnnotations(Simplifier.Annotation));
+ }
+ else
+ {
+ annotatedCast = annotatedCast.WithExpression(
+ annotatedCast.Expression.Parenthesize());
+ }
+
+ ExpressionSyntax oldNode = cast;
+ ExpressionSyntax newNode = annotatedCast;
+
+ // Ensure that we simplify any parenting parenthesized expressions not just on the syntax tree level but also on Token based
+ // Case 1:
+ // In the syntax, (((Task<Action>)x).Result)()
+ // oldNode = (Task<Action>)x
+ // newNode = (Task<Action>)(x)
+ // Final newNode will be (((Task<Action>)(x)).Result)
+ while (oldNode.Parent.IsKind(SyntaxKind.ParenthesizedExpression) || oldNode.GetFirstToken().GetPreviousToken().Parent.IsKind(SyntaxKind.ParenthesizedExpression))
+ {
+ var parenthesizedExpression = (ParenthesizedExpressionSyntax)oldNode.GetFirstToken().GetPreviousToken().Parent;
+ newNode = parenthesizedExpression.ReplaceNode(oldNode, newNode)
+ .WithAdditionalAnnotations(Simplifier.Annotation);
+ oldNode = parenthesizedExpression;
+ }
+
+ newNode = newNode.WithAdditionalAnnotations(Formatter.Annotation);
+
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ var newRoot = root.ReplaceNode(oldNode, newNode);
+
+ return document.WithSyntaxRoot(newRoot);
+ }
+//
+// private class MyCodeAction : CodeAction.DocumentChangeAction
+// {
+// public MyCodeAction(string title, Func<CancellationToken, Task<Document>> createChangedDocument) :
+// base(title, createChangedDocument)
+// {
+// }
+// }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/RemoveUnnecessaryUsings/RemoveUnnecessaryUsingsCodeFixProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/RemoveUnnecessaryUsings/RemoveUnnecessaryUsingsCodeFixProvider.cs
new file mode 100644
index 0000000000..e3ed5cea15
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/RemoveUnnecessaryUsings/RemoveUnnecessaryUsingsCodeFixProvider.cs
@@ -0,0 +1,58 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Immutable;
+using System.Composition;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp.Features.RemoveUnnecessaryImports;
+using MonoDevelop.Core;
+using RefactoringEssentials;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.CSharp.Diagnostics;
+
+namespace MonoDevelop.CSharp.CodeFixes.RemoveUnusedUsings
+{
+ [ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.RemoveUnnecessaryImports), Shared]
+ [ExtensionOrder(After = PredefinedCodeFixProviderNames.AddMissingReference)]
+ internal class RemoveUnnecessaryUsingsCodeFixProvider : CodeFixProvider
+ {
+ public sealed override ImmutableArray<string> FixableDiagnosticIds
+ {
+ get { return ImmutableArray.Create(IDEDiagnosticIds.RemoveUnnecessaryImportsDiagnosticId); }
+ }
+
+ public sealed override FixAllProvider GetFixAllProvider()
+ {
+ return WellKnownFixAllProviders.BatchFixer;
+ }
+
+ static readonly CSharpRemoveUnnecessaryImportsService service = new CSharpRemoveUnnecessaryImportsService();
+
+ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
+ {
+ var document = context.Document;
+ var span = context.Span;
+ var cancellationToken = context.CancellationToken;
+
+ var model = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ var newDocument = service.RemoveUnnecessaryImports(document, model, root, cancellationToken);
+ if (newDocument == document || newDocument == null)
+ {
+ return;
+ }
+
+ context.RegisterCodeFix(
+ new DocumentChangeAction(context.Diagnostics[0].Location.SourceSpan, DiagnosticSeverity.Warning,
+ GettextCatalog.GetString ("Remove Unnecessary Usings"),
+ (c) => Task.FromResult(newDocument)),
+ context.Diagnostics);
+ }
+
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.SimplifyTypeNamesFixAllProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.SimplifyTypeNamesFixAllProvider.cs
new file mode 100644
index 0000000000..543c9b3b38
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.SimplifyTypeNamesFixAllProvider.cs
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis;
+
+namespace MonoDevelop.CSharp.CodeFixes.SimplifyTypeNames
+{
+ internal partial class SimplifyTypeNamesCodeFixProvider : CodeFixProvider
+ {
+// private class SimplifyTypeNamesFixAllProvider : BatchSimplificationFixAllProvider
+// {
+// internal static new readonly SimplifyTypeNamesFixAllProvider Instance = new SimplifyTypeNamesFixAllProvider();
+//
+// protected override SyntaxNode GetNodeToSimplify(SyntaxNode root, SemanticModel model, Diagnostic diagnostic, Workspace workspace, out string codeActionId, CancellationToken cancellationToken)
+// {
+// codeActionId = null;
+// string diagnosticId;
+// var node = SimplifyTypeNamesCodeFixProvider.GetNodeToSimplify(root, model, diagnostic.Location.SourceSpan, workspace.Options, out diagnosticId, cancellationToken);
+// if (node != null)
+// {
+// codeActionId = GetCodeActionId(diagnosticId, node.ToString());
+// }
+//
+// return node;
+// }
+// }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.cs
new file mode 100644
index 0000000000..0b2b11df09
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeFixes/SimplifyTypeNames/SimplifyTypeNamesCodeFixProvider.cs
@@ -0,0 +1,143 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Immutable;
+using System.Composition;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Diagnostics;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Simplification;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.CSharp.Diagnostics;
+using ICSharpCode.NRefactory6.CSharp;
+using MonoDevelop.Core;
+using System;
+using Microsoft.CodeAnalysis.CSharp;
+using RefactoringEssentials;
+using MonoDevelop.CSharp.Diagnostics.SimplifyTypeNames;
+
+namespace MonoDevelop.CSharp.CodeFixes.SimplifyTypeNames
+{
+ [ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.SimplifyNames), Shared]
+ [ExtensionOrder(After = PredefinedCodeFixProviderNames.RemoveUnnecessaryCast)]
+ internal partial class SimplifyTypeNamesCodeFixProvider : CodeFixProvider
+ {
+ public sealed override ImmutableArray<string> FixableDiagnosticIds
+ {
+ get
+ {
+ return ImmutableArray.Create(
+ IDEDiagnosticIds.SimplifyNamesDiagnosticId,
+ IDEDiagnosticIds.SimplifyMemberAccessDiagnosticId,
+ IDEDiagnosticIds.SimplifyThisOrMeDiagnosticId);
+ }
+ }
+
+// public sealed override FixAllProvider GetFixAllProvider()
+// {
+// return SimplifyTypeNamesFixAllProvider.Instance;
+// }
+
+ internal static SyntaxNode GetNodeToSimplify(SyntaxNode root, SemanticModel model, TextSpan span, OptionSet optionSet, out string diagnosticId, CancellationToken cancellationToken)
+ {
+ diagnosticId = null;
+ var token = root.FindToken(span.Start, findInsideTrivia: true);
+ if (!token.Span.IntersectsWith(span))
+ {
+ return null;
+ }
+
+ foreach (var n in token.GetAncestors<SyntaxNode>())
+ {
+ if (n.Span.IntersectsWith(span) && CanSimplifyTypeNameExpression(model, n, optionSet, span, out diagnosticId, cancellationToken))
+ {
+ return n;
+ }
+ }
+
+ return null;
+ }
+
+ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
+ {
+ var document = context.Document;
+ var span = context.Span;
+ var cancellationToken = context.CancellationToken;
+
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ var model = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ var optionSet = document.Project.Solution.Workspace.Options;
+ string diagnosticId;
+ var node = GetNodeToSimplify(root, model, span, optionSet, out diagnosticId, cancellationToken);
+ if (node == null)
+ {
+ return;
+ }
+
+ var id = GetCodeActionId(diagnosticId, node.ToString());
+ var title = id;
+ var codeAction = new DocumentChangeAction(node.Span, DiagnosticSeverity.Warning, title,
+ (c) => SimplifyTypeNameAsync(document, node, c));
+
+ context.RegisterCodeFix(codeAction, context.Diagnostics);
+ }
+
+ // internal for testing purpose
+ internal static string GetCodeActionId(string diagnosticId, string nodeText)
+ {
+ switch (diagnosticId)
+ {
+ case IDEDiagnosticIds.SimplifyNamesDiagnosticId:
+ return string.Format(GettextCatalog.GetString ("Simplify name '{0}'"), nodeText);
+
+ case IDEDiagnosticIds.SimplifyMemberAccessDiagnosticId:
+ return string.Format(GettextCatalog.GetString ("Simplify member access '{0}'"), nodeText);
+
+ case IDEDiagnosticIds.SimplifyThisOrMeDiagnosticId:
+ return GettextCatalog.GetString ("Remove 'this' qualification");
+
+ default:
+ throw new InvalidOperationException();
+ }
+ }
+
+ private static bool CanSimplifyTypeNameExpression(SemanticModel model, SyntaxNode node, OptionSet optionSet, TextSpan span, out string diagnosticId, CancellationToken cancellationToken)
+ {
+ diagnosticId = null;
+ TextSpan issueSpan;
+ if (!CSharpSimplifyTypeNamesDiagnosticAnalyzer.IsCandidate(node) ||
+ !CSharpSimplifyTypeNamesDiagnosticAnalyzer.CanSimplifyTypeNameExpression(model, node, optionSet, out issueSpan, out diagnosticId, cancellationToken))
+ {
+ return false;
+ }
+
+ return issueSpan.Equals(span);
+ }
+
+ private async Task<Document> SimplifyTypeNameAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ var expressionSyntax = node;
+ var annotatedexpressionSyntax = expressionSyntax.WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation);
+
+ if (annotatedexpressionSyntax.Kind() == SyntaxKind.IsExpression || annotatedexpressionSyntax.Kind() == SyntaxKind.AsExpression)
+ {
+ var right = ((BinaryExpressionSyntax)annotatedexpressionSyntax).Right;
+ annotatedexpressionSyntax = annotatedexpressionSyntax.ReplaceNode(right, right.WithAdditionalAnnotations(Simplifier.Annotation));
+ }
+
+ SyntaxNode oldNode = expressionSyntax;
+ SyntaxNode newNode = annotatedexpressionSyntax;
+
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ var newRoot = root.ReplaceNode(oldNode, newNode);
+
+ return document.WithSyntaxRoot(newRoot);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/AbstractGenerateAction.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/AbstractGenerateAction.cs
index 12fcc3a87d..13234fff9e 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/AbstractGenerateAction.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/AbstractGenerateAction.cs
@@ -31,18 +31,22 @@ using Gtk;
using System.Collections.Generic;
using MonoDevelop.Refactoring;
using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Components;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
+using MonoDevelop.CSharp.Completion;
+using MonoDevelop.CSharp.Formatting;
namespace MonoDevelop.CodeGeneration
{
- public abstract class AbstractGenerateAction : IGenerateAction
+ abstract class AbstractGenerateAction : IGenerateAction
{
readonly TreeStore store = new TreeStore (typeof(bool), typeof(Xwt.Drawing.Image), typeof(string), typeof(object));
readonly CodeGenerationOptions options;
- public CodeGenerationOptions Options {
+ internal CodeGenerationOptions Options {
get {
return options;
}
@@ -76,23 +80,18 @@ namespace MonoDevelop.CodeGeneration
column.Expand = true;
treeView.AppendColumn (column);
- Ambience ambience = AmbienceService.GetAmbienceForFile (options.Document.FileName);
foreach (object obj in GetValidMembers ()) {
- var member = obj as IEntity;
+ var member = obj as ISymbol;
if (member != null) {
- Store.AppendValues (false, ImageService.GetIcon (member.GetStockIcon (), IconSize.Menu), ambience.GetString (member, OutputFlags.ClassBrowserEntries), member);
+ Store.AppendValues (false, ImageService.GetIcon (member.GetStockIcon (), IconSize.Menu), member.ToDisplayString (Ambience.LabelFormat), member);
continue;
}
- var tuple = obj as Tuple<IMember, bool>;
+ var tuple = obj as Tuple<ISymbol, bool>;
if (tuple != null) {
- Store.AppendValues (false, ImageService.GetIcon (tuple.Item1.GetStockIcon (), IconSize.Menu), ambience.GetString (tuple.Item1, OutputFlags.ClassBrowserEntries), tuple);
+ Store.AppendValues (false, ImageService.GetIcon (tuple.Item1.GetStockIcon (), IconSize.Menu), tuple.Item1.ToDisplayString (Ambience.LabelFormat), tuple);
continue;
}
-
- var variable = obj as IVariable;
- if (variable != null)
- Store.AppendValues (false, ImageService.GetIcon (variable.GetStockIcon (), IconSize.Menu), variable.Name, variable);
}
treeView.Model = store;
@@ -118,10 +117,9 @@ namespace MonoDevelop.CodeGeneration
static string AddIndent (string text, string indent)
{
- var doc = new Mono.TextEditor.TextDocument ();
- doc.Text = text;
+ var doc = TextEditorFactory.CreateNewReadonlyDocument (new StringTextSource (text), "");
var result = new StringBuilder ();
- foreach (var line in doc.Lines) {
+ foreach (var line in doc.GetLines ()) {
result.Append (indent);
result.Append (doc.GetTextAt (line.SegmentIncludingDelimiter));
}
@@ -141,7 +139,7 @@ namespace MonoDevelop.CodeGeneration
} while (store.IterNext (ref iter));
var output = new StringBuilder ();
- string indent = RefactoringOptions.GetIndent (options.Document, (IEntity)options.EnclosingMember ?? options.EnclosingType) + "\t";
+ string indent = options.Editor.GetVirtualIndentationString (options.Editor.CaretLine);
foreach (string nodeText in GenerateCode (includedMembers)) {
if (output.Length > 0) {
output.AppendLine ();
@@ -151,8 +149,14 @@ namespace MonoDevelop.CodeGeneration
}
if (output.Length > 0) {
- var data = options.Document.Editor;
- data.InsertAtCaret (output.ToString ().TrimStart ());
+ var data = options.Editor;
+ data.EnsureCaretIsNotVirtual ();
+ int offset = data.CaretOffset;
+ var text = output.ToString ().TrimStart ();
+ using (var undo = data.OpenUndoGroup ()) {
+ data.InsertAtCaret (text);
+ OnTheFlyFormatter.Format (data, options.DocumentContext, offset, offset + text.Length);
+ }
}
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/CodeGenerationOptions.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/CodeGenerationOptions.cs
index 3ec0f395d3..82fbc7abe2 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/CodeGenerationOptions.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/CodeGenerationOptions.cs
@@ -26,148 +26,157 @@
using System.Linq;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Core;
-using ICSharpCode.NRefactory.CSharp.Resolver;
using System;
using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis.Simplification;
+using MonoDevelop.Ide.Editor;
+using Microsoft.CodeAnalysis.Options;
+using MonoDevelop.Ide.Gui.Content;
+using Microsoft.CodeAnalysis.Formatting;
+using System.Diagnostics;
+using ICSharpCode.NRefactory6.CSharp;
+using MonoDevelop.CSharp.Completion;
namespace MonoDevelop.CodeGeneration
{
- public class CodeGenerationOptions
+ sealed class CodeGenerationOptions
{
- public Document Document {
+ readonly int offset;
+
+ public TextEditor Editor
+ {
get;
private set;
}
-
- public ITypeDefinition EnclosingType {
+
+ public DocumentContext DocumentContext
+ {
get;
private set;
}
-
- public IUnresolvedTypeDefinition EnclosingPart {
+
+ public ITypeSymbol EnclosingType
+ {
get;
private set;
}
-
- public IMember EnclosingMember {
+
+ public SyntaxNode EnclosingMemberSyntax
+ {
get;
private set;
}
-
- public string MimeType {
- get {
- return DesktopService.GetMimeTypeForUri (Document.FileName);
- }
+
+ public TypeDeclarationSyntax EnclosingPart
+ {
+ get;
+ private set;
}
-
- public CSharpFormattingOptions FormattingOptions {
- get {
- var doc = Document;
- var policyParent = doc.Project != null ? doc.Project.Policies : null;
- var types = DesktopService.GetMimeTypeInheritanceChain (doc.Editor.MimeType);
- var codePolicy = policyParent != null ? policyParent.Get<MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy> (types) : MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy> (types);
- return codePolicy.CreateOptions ();
- }
+
+ public ISymbol EnclosingMember
+ {
+ get;
+ private set;
}
-
- static AstNode FirstExpressionChild (AstNode parent)
+
+ public string MimeType
{
- AstNode node = parent.FirstChild;
- if (node == null)
- return null;
- while (node != null && !(node is Expression || node is Statement)) {
- node = node.NextSibling;
+ get
+ {
+ return DesktopService.GetMimeTypeForUri (DocumentContext.Name);
}
- return node;
}
-
- static AstNode NextExpression (AstNode parent)
+
+ public OptionSet FormattingOptions
{
- AstNode node = parent.GetNextNode ();
- if (node == null)
- return null;
- while (node != null && !(node is Expression || node is Statement)) {
- node = node.GetNextNode ();
+ get
+ {
+ var doc = DocumentContext;
+ var policyParent = doc.Project != null ? doc.Project.Policies : null;
+ var types = DesktopService.GetMimeTypeInheritanceChain (Editor.MimeType);
+ var codePolicy = policyParent != null ? policyParent.Get<MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy> (types) : MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy> (types);
+ var textPolicy = policyParent != null ? policyParent.Get<TextStylePolicy> (types) : MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<TextStylePolicy> (types);
+ return codePolicy.CreateOptions (textPolicy);
}
- return node;
}
-
- readonly Lazy<CSharpResolver> currentState;
- public CSharpResolver CurrentState {
- get {
- return currentState.Value;
- }
+
+ public SemanticModel CurrentState
+ {
+ get;
+ private set;
}
-
- public CodeGenerationOptions ()
+
+ internal CodeGenerationOptions (TextEditor editor, DocumentContext ctx)
{
- currentState = new Lazy<CSharpResolver> (() => {
- var parsedDocument = Document.ParsedDocument;
- if (parsedDocument == null)
- return null;
- var unit = parsedDocument.GetAst<SyntaxTree> ().Clone ();
- var file = parsedDocument.ParsedFile as CSharpUnresolvedFile;
-
- var resolvedNode = unit.GetNodeAt<BlockStatement> (Document.Editor.Caret.Location);
- if (resolvedNode == null)
- return null;
-
- var expr = new IdentifierExpression ("foo");
- resolvedNode.Add (expr);
-
- var ctx = file.GetTypeResolveContext (Document.Compilation, Document.Editor.Caret.Location);
-
- var resolver = new CSharpResolver (ctx);
-
- var astResolver = new CSharpAstResolver (resolver, unit, file);
- astResolver.ApplyNavigator (new NodeListResolveVisitorNavigator (expr), CancellationToken.None);
- astResolver.Resolve (expr);
- return astResolver.GetResolverStateBefore (expr);
- });
+ Editor = editor;
+ DocumentContext = ctx;
+ if (ctx.ParsedDocument != null)
+ CurrentState = ctx.ParsedDocument.GetAst<SemanticModel> ();
+ offset = editor.CaretOffset;
+ var tree = CurrentState.SyntaxTree;
+ EnclosingPart = tree.GetContainingTypeDeclaration (offset, default(CancellationToken));
+ if (EnclosingPart != null) {
+ EnclosingType = CurrentState.GetDeclaredSymbol (EnclosingPart) as ITypeSymbol;
+
+ foreach (var member in EnclosingPart.Members) {
+ if (member.Span.Contains (offset)) {
+ EnclosingMemberSyntax = member;
+ break;
+ }
+
+ }
+ if (EnclosingMemberSyntax != null)
+ EnclosingMember = CurrentState.GetDeclaredSymbol (EnclosingMemberSyntax);
+ }
}
-
- public AstType CreateShortType (IType fullType)
+
+ public string CreateShortType (ITypeSymbol fullType)
{
- var parsedFile = Document.ParsedDocument.ParsedFile as CSharpUnresolvedFile;
-
- var compilation = Document.Compilation;
- fullType = compilation.Import (fullType);
- var csResolver = parsedFile.GetResolver (compilation, Document.Editor.Caret.Location);
-
- var builder = new ICSharpCode.NRefactory.CSharp.Refactoring.TypeSystemAstBuilder (csResolver);
- return builder.ConvertType (fullType);
+ return RoslynCompletionData.SafeMinimalDisplayString (fullType, CurrentState, offset);
}
-
- public CodeGenerator CreateCodeGenerator ()
+
+ public static CodeGenerationOptions CreateCodeGenerationOptions (TextEditor document, DocumentContext ctx)
{
- var result = CodeGenerator.CreateGenerator (Document);
- if (result == null)
- LoggingService.LogError ("Generator can't be generated for : " + Document.Editor.MimeType);
- return result;
+ return new CodeGenerationOptions (document, ctx);
}
-
- public static CodeGenerationOptions CreateCodeGenerationOptions (Document document)
+
+ public async Task<string> OutputNode (SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken))
{
- document.UpdateParseDocument ();
- var options = new CodeGenerationOptions {
- Document = document
- };
- if (document.ParsedDocument != null && document.ParsedDocument.ParsedFile != null) {
- options.EnclosingPart = document.ParsedDocument.ParsedFile.GetInnermostTypeDefinition (document.Editor.Caret.Location);
- var project = document.Project;
- if (options.EnclosingPart != null && project != null)
- options.EnclosingType = options.EnclosingPart.Resolve (project).GetDefinition ();
- if (options.EnclosingType != null) {
- options.EnclosingMember = options.EnclosingType.Members.FirstOrDefault (m => !m.IsSynthetic && m.Region.FileName == document.FileName && m.Region.IsInside (document.Editor.Caret.Location));
- }
+ node = Formatter.Format (node, TypeSystemService.Workspace, FormattingOptions, cancellationToken);
+
+ var text = Editor.Text;
+ string nodeText = node.ToString ();
+ text = text.Insert (offset, nodeText);
+
+ var backgroundDocument = DocumentContext.AnalysisDocument.WithText (SourceText.From (text));
+
+ var currentRoot = await backgroundDocument.GetSyntaxRootAsync (cancellationToken).ConfigureAwait (false);
+
+ // add formatter & simplifier annotations
+ var oldNode = currentRoot.FindNode (TextSpan.FromBounds(offset, offset + nodeText.Length));
+ currentRoot = currentRoot.ReplaceNode (oldNode, oldNode.WithAdditionalAnnotations (Formatter.Annotation, Simplifier.Annotation));
+
+ // get updated node
+ node = currentRoot.FindNode (TextSpan.FromBounds(offset, offset + nodeText.Length));
+ currentRoot = currentRoot.TrackNodes (node);
+
+ backgroundDocument = backgroundDocument.WithSyntaxRoot (currentRoot);
+ backgroundDocument = await Formatter.FormatAsync (backgroundDocument, Formatter.Annotation, cancellationToken: cancellationToken).ConfigureAwait(false);
+ backgroundDocument = await Simplifier.ReduceAsync (backgroundDocument, Simplifier.Annotation, cancellationToken: cancellationToken).ConfigureAwait(false);
+ var newRoot = await backgroundDocument.GetSyntaxRootAsync (cancellationToken).ConfigureAwait (false);
+
+ var formattedNode = newRoot.GetCurrentNode (node);
+ if (formattedNode == null) {
+ LoggingService.LogError ("Fatal error: Can't find current formatted node in code generator document.");
+ return nodeText;
}
- return options;
+ return formattedNode.ToString ();
}
-
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/CreateConstructorGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/CreateConstructorGenerator.cs
index d48bafe43d..a14f6603a5 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/CreateConstructorGenerator.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/CreateConstructorGenerator.cs
@@ -1,166 +1,210 @@
-//
-// CreateConstructorGenerator.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using Gtk;
+//
+// CreateConstructorGenerator.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
using System.Collections.Generic;
-using ICSharpCode.NRefactory.CSharp;
+using System.Text;
+using System.Linq;
using MonoDevelop.Core;
-using ICSharpCode.NRefactory.TypeSystem;
-using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Simplification;
+using ICSharpCode.NRefactory6.CSharp;
+using Gtk;
+using MonoDevelop.Ide.TypeSystem;
namespace MonoDevelop.CodeGeneration
{
class CreateConstructorGenerator : ICodeGenerator
{
- public string Icon {
- get {
+ public string Icon
+ {
+ get
+ {
return "md-newmethod";
}
}
-
- public string Text {
- get {
+
+ public string Text
+ {
+ get
+ {
return GettextCatalog.GetString ("Constructor");
}
}
-
- public string GenerateDescription {
- get {
+
+ public string GenerateDescription
+ {
+ get
+ {
return GettextCatalog.GetString ("Select members to be initialized by the constructor.");
}
}
-
+
public bool IsValid (CodeGenerationOptions options)
{
var createConstructor = new CreateConstructor (options);
return createConstructor.IsValid ();
}
-
+
public IGenerateAction InitalizeSelection (CodeGenerationOptions options, TreeView treeView)
{
var createConstructor = new CreateConstructor (options);
createConstructor.Initialize (treeView);
return createConstructor;
}
-
+
+ internal static TypeSyntax ConvertType (ITypeSymbol symbol)
+ {
+ // TODO: There needs to be a better way doing that.
+ return SyntaxFactory.ParseTypeName (symbol.ToDisplayString (SymbolDisplayFormat.CSharpErrorMessageFormat));
+ }
+
class CreateConstructor : AbstractGenerateAction
{
public CreateConstructor (CodeGenerationOptions options) : base (options)
{
}
-
+
protected override IEnumerable<object> GetValidMembers ()
{
if (Options.EnclosingType == null || Options.EnclosingMember != null)
yield break;
- var bt = Options.EnclosingType.DirectBaseTypes.FirstOrDefault (t => t.Kind != TypeKind.Interface);
+ var bt = Options.EnclosingType.BaseType;
if (bt != null) {
- var ctors = bt.GetConstructors (m => !m.IsSynthetic).ToList ();
- foreach (var ctor in ctors) {
- if (ctor.Parameters.Count > 0 || ctors.Count > 1) {
+ var ctors = bt.GetMembers ().OfType<IMethodSymbol> ().Where (m => m.MethodKind == MethodKind.Constructor && !m.IsImplicitlyDeclared).ToList ();
+ foreach (IMethodSymbol ctor in ctors) {
+ if (ctor.Parameters.Length > 0 || ctors.Count > 1) {
yield return ctor;
}
- }
+ }
}
- foreach (IField field in Options.EnclosingType.Fields) {
- if (field.IsSynthetic)
+ foreach (IFieldSymbol field in Options.EnclosingType.GetMembers ().OfType<IFieldSymbol> ()) {
+ if (field.IsImplicitlyDeclared)
continue;
yield return field;
}
- foreach (IProperty property in Options.EnclosingType.Properties) {
- if (property.IsSynthetic)
+ foreach (IPropertySymbol property in Options.EnclosingType.GetMembers ().OfType<IPropertySymbol> ()) {
+ if (property.IsImplicitlyDeclared)
continue;
- if (!property.CanSet)
+ if (property.SetMethod == null)
continue;
yield return property;
}
}
-
- static string CreateParameterName (IMember member)
+
+ static string CreateParameterName (ISymbol member)
{
if (char.IsUpper (member.Name[0]))
return char.ToLower (member.Name[0]) + member.Name.Substring (1);
return member.Name;
}
-
+
protected override IEnumerable<string> GenerateCode (List<object> includedMembers)
- {
+ {
bool gotConstructorOverrides = false;
- foreach (IMethod m in includedMembers.OfType<IMethod> ().Where (m => m.SymbolKind == SymbolKind.Constructor)) {
+ foreach (IMethodSymbol m in includedMembers.OfType<IMethodSymbol> ().Where (m => m.MethodKind == MethodKind.Constructor)) {
gotConstructorOverrides = true;
- var init = new ConstructorInitializer {
- ConstructorInitializerType = ConstructorInitializerType.Base
- };
-
- var overridenConstructor = new ConstructorDeclaration {
- Name = Options.EnclosingType.Name,
- Modifiers = Modifiers.Public,
- Body = new BlockStatement (),
- };
-
- if (m.Parameters.Count > 0)
- overridenConstructor.Initializer = init;
-
+ var parameters = new List<ParameterSyntax> ();
+ var initArgs = new List<ArgumentSyntax> ();
+ var statements = new List<StatementSyntax> ();
foreach (var par in m.Parameters) {
- overridenConstructor.Parameters.Add (new ParameterDeclaration (Options.CreateShortType (par.Type), par.Name));
- init.Arguments.Add (new IdentifierExpression(par.Name));
+ parameters.Add (SyntaxFactory.Parameter (SyntaxFactory.Identifier (par.Name)).WithType (ConvertType (par.Type)));
+ initArgs.Add (SyntaxFactory.Argument (SyntaxFactory.ParseExpression (par.Name)));
}
- foreach (var member in includedMembers.OfType<IMember> ()) {
- if (member.SymbolKind == SymbolKind.Constructor)
+
+ foreach (ISymbol member in includedMembers) {
+ if (member.Kind == SymbolKind.Method)
continue;
- overridenConstructor.Parameters.Add (new ParameterDeclaration (Options.CreateShortType (member.ReturnType), CreateParameterName (member)));
+ var paramName = CreateParameterName (member);
+ parameters.Add (SyntaxFactory.Parameter (SyntaxFactory.Identifier (paramName)).WithType (ConvertType (member.GetReturnType ())));
- var memberReference = new MemberReferenceExpression (new ThisReferenceExpression (), member.Name);
- var assign = new AssignmentExpression (memberReference, AssignmentOperatorType.Assign, new IdentifierExpression (CreateParameterName (member)));
- overridenConstructor.Body.Statements.Add (new ExpressionStatement (assign));
+ statements.Add (
+ SyntaxFactory.ExpressionStatement (
+ SyntaxFactory.AssignmentExpression (
+ SyntaxKind.SimpleAssignmentExpression,
+ SyntaxFactory.MemberAccessExpression (
+ SyntaxKind.SimpleMemberAccessExpression,
+ SyntaxFactory.ThisExpression (),
+ SyntaxFactory.IdentifierName (member.Name)
+ ),
+ SyntaxFactory.IdentifierName (paramName)
+ )
+ )
+ );
}
- yield return overridenConstructor.ToString (Options.FormattingOptions);
+ var node = SyntaxFactory.ConstructorDeclaration (
+ SyntaxFactory.List<AttributeListSyntax> (),
+ SyntaxFactory.TokenList (SyntaxFactory.Token (SyntaxKind.PublicKeyword)),
+ SyntaxFactory.Identifier (Options.EnclosingType.Name),
+ SyntaxFactory.ParameterList (SyntaxFactory.SeparatedList<ParameterSyntax> (parameters)),
+ initArgs.Count > 0 ? SyntaxFactory.ConstructorInitializer (SyntaxKind.BaseConstructorInitializer, SyntaxFactory.ArgumentList (SyntaxFactory.SeparatedList<ArgumentSyntax> (initArgs))) : null,
+ SyntaxFactory.Block (statements.ToArray ())
+ );
+ yield return Options.OutputNode (node).Result;
}
if (gotConstructorOverrides)
- yield break;
- var constructorDeclaration = new ConstructorDeclaration {
- Name = Options.EnclosingType.Name,
- Modifiers = Modifiers.Public,
- Body = new BlockStatement ()
- };
-
- foreach (IMember member in includedMembers) {
- constructorDeclaration.Parameters.Add (new ParameterDeclaration (Options.CreateShortType (member.ReturnType), CreateParameterName (member)));
-
- var memberReference = new MemberReferenceExpression (new ThisReferenceExpression (), member.Name);
- var assign = new AssignmentExpression (memberReference, AssignmentOperatorType.Assign, new IdentifierExpression (CreateParameterName (member)));
- constructorDeclaration.Body.Statements.Add (new ExpressionStatement (assign));
+ yield break;
+
+ var parameters2 = new List<ParameterSyntax> ();
+ var statements2 = new List<StatementSyntax> ();
+ foreach (ISymbol member in includedMembers) {
+ var paramName = CreateParameterName (member);
+ parameters2.Add (SyntaxFactory.Parameter (SyntaxFactory.Identifier (paramName)).WithType (ConvertType (member.GetReturnType ())));
+
+ statements2.Add (
+ SyntaxFactory.ExpressionStatement (
+ SyntaxFactory.AssignmentExpression (
+ SyntaxKind.SimpleAssignmentExpression,
+ SyntaxFactory.MemberAccessExpression (
+ SyntaxKind.SimpleMemberAccessExpression,
+ SyntaxFactory.ThisExpression (),
+ SyntaxFactory.IdentifierName (member.Name)
+ ),
+ SyntaxFactory.IdentifierName (paramName)
+ )
+ )
+ );
}
- yield return constructorDeclaration.ToString (Options.FormattingOptions);
+ var node2 = SyntaxFactory.ConstructorDeclaration (
+ SyntaxFactory.List<AttributeListSyntax> (),
+ SyntaxFactory.TokenList (SyntaxFactory.Token (SyntaxKind.PublicKeyword)),
+ SyntaxFactory.Identifier (Options.EnclosingType.Name),
+ SyntaxFactory.ParameterList (SyntaxFactory.SeparatedList<ParameterSyntax> (parameters2)),
+ null,
+ SyntaxFactory.Block (statements2.ToArray ())
+ );
+ yield return Options.OutputNode (node2).Result;
}
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/EqualityMembersGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/EqualityMembersGenerator.cs
index 49d89a70e6..d5849c638b 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/EqualityMembersGenerator.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/EqualityMembersGenerator.cs
@@ -1,159 +1,160 @@
-//
-// EqualityMembersGenerator.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System.Collections.Generic;
-using ICSharpCode.NRefactory.CSharp;
-using MonoDevelop.Core;
-using ICSharpCode.NRefactory.TypeSystem;
-
-namespace MonoDevelop.CodeGeneration
-{
- class EqualityMembersGenerator : ICodeGenerator
- {
- public string Icon {
- get {
- return "md-newmethod";
- }
- }
-
- public string Text {
- get {
- return GettextCatalog.GetString ("Equality members");
- }
- }
-
- public string GenerateDescription {
- get {
- return GettextCatalog.GetString ("Select members to include in equality.");
- }
- }
-
- public bool IsValid (CodeGenerationOptions options)
- {
- return new CreateEquality (options).IsValid ();
- }
-
- public IGenerateAction InitalizeSelection (CodeGenerationOptions options, Gtk.TreeView treeView)
- {
- var createEventMethod = new CreateEquality (options);
- createEventMethod.Initialize (treeView);
- return createEventMethod;
- }
-
- class CreateEquality : AbstractGenerateAction
- {
- public CreateEquality (CodeGenerationOptions options) : base (options)
- {
- }
-
- protected override IEnumerable<object> GetValidMembers ()
- {
- if (Options.EnclosingType == null || Options.EnclosingMember != null)
- yield break;
- foreach (IField field in Options.EnclosingType.Fields) {
- if (field.IsSynthetic)
- continue;
- yield return field;
- }
-
- foreach (IProperty property in Options.EnclosingType.Properties) {
- if (property.IsSynthetic)
- continue;
- if (property.CanGet)
- yield return property;
- }
- }
-
- protected override IEnumerable<string> GenerateCode (List<object> includedMembers)
- {
- // Genereate Equals
- var methodDeclaration = new MethodDeclaration ();
- methodDeclaration.Name = "Equals";
-
- methodDeclaration.ReturnType = new PrimitiveType ("bool");
- methodDeclaration.Modifiers = Modifiers.Public | Modifiers.Override;
- methodDeclaration.Body = new BlockStatement ();
- methodDeclaration.Parameters.Add (new ParameterDeclaration (new PrimitiveType ("object"), "obj"));
- var paramId = new IdentifierExpression ("obj");
- var ifStatement = new IfElseStatement ();
- ifStatement.Condition = new BinaryOperatorExpression (paramId, BinaryOperatorType.Equality, new PrimitiveExpression (null));
- ifStatement.TrueStatement = new ReturnStatement (new PrimitiveExpression (false));
- methodDeclaration.Body.Statements.Add (ifStatement);
-
- ifStatement = new IfElseStatement ();
- var arguments = new List<Expression> ();
- arguments.Add (new ThisReferenceExpression ());
- arguments.Add (paramId.Clone ());
- ifStatement.Condition = new InvocationExpression (new IdentifierExpression ("ReferenceEquals"), arguments);
- ifStatement.TrueStatement = new ReturnStatement (new PrimitiveExpression (true));
- methodDeclaration.Body.Statements.Add (ifStatement);
-
- ifStatement = new IfElseStatement ();
- ifStatement.Condition = new BinaryOperatorExpression (new InvocationExpression (new MemberReferenceExpression (paramId.Clone (), "GetType")), BinaryOperatorType.InEquality, new TypeOfExpression (new SimpleType (Options.EnclosingType.Name)));
- ifStatement.TrueStatement = new ReturnStatement (new PrimitiveExpression (false));
- methodDeclaration.Body.Statements.Add (ifStatement);
-
- var varType = new SimpleType (Options.EnclosingType.Name);
- var varDecl = new VariableDeclarationStatement (varType, "other", new CastExpression (varType.Clone (), paramId.Clone ()));
- methodDeclaration.Body.Statements.Add (varDecl);
-
- var otherId = new IdentifierExpression ("other");
- Expression binOp = null;
- foreach (IMember member in includedMembers) {
- Expression right = new BinaryOperatorExpression (new IdentifierExpression (member.Name), BinaryOperatorType.Equality, new MemberReferenceExpression (otherId.Clone (), member.Name));
- binOp = binOp == null ? right : new BinaryOperatorExpression (binOp, BinaryOperatorType.ConditionalAnd, right);
- }
-
- methodDeclaration.Body.Statements.Add (new ReturnStatement (binOp));
- yield return methodDeclaration.ToString (Options.FormattingOptions);
-
- methodDeclaration = new MethodDeclaration ();
- methodDeclaration.Name = "GetHashCode";
-
- methodDeclaration.ReturnType = new PrimitiveType ("int");
- methodDeclaration.Modifiers = Modifiers.Public | Modifiers.Override;
- methodDeclaration.Body = new BlockStatement ();
-
- binOp = null;
- foreach (IMember member in includedMembers) {
- Expression right;
- right = new InvocationExpression (new MemberReferenceExpression (new IdentifierExpression (member.Name), "GetHashCode"));
-
- IType type = member.ReturnType;
- if (type != null && type.Kind != TypeKind.Struct && type.Kind != TypeKind.Enum)
- right = new ParenthesizedExpression (new ConditionalExpression (new BinaryOperatorExpression (new IdentifierExpression (member.Name), BinaryOperatorType.InEquality, new PrimitiveExpression (null)), right, new PrimitiveExpression (0)));
-
- binOp = binOp == null ? right : new BinaryOperatorExpression (binOp, BinaryOperatorType.ExclusiveOr, right);
- }
- var uncheckedBlock = new BlockStatement ();
- uncheckedBlock.Statements.Add (new ReturnStatement (binOp));
-
- methodDeclaration.Body.Statements.Add (new UncheckedStatement (uncheckedBlock));
- yield return methodDeclaration.ToString (Options.FormattingOptions);
- }
- }
- }
-}
+////
+//// EqualityMembersGenerator.cs
+////
+//// Author:
+//// Mike Krüger <mkrueger@novell.com>
+////
+//// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+////
+//// Permission is hereby granted, free of charge, to any person obtaining a copy
+//// of this software and associated documentation files (the "Software"), to deal
+//// in the Software without restriction, including without limitation the rights
+//// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+//// copies of the Software, and to permit persons to whom the Software is
+//// furnished to do so, subject to the following conditions:
+////
+//// The above copyright notice and this permission notice shall be included in
+//// all copies or substantial portions of the Software.
+////
+//// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+//// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+//// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+//// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+//// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+//// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+//// THE SOFTWARE.
+//
+//using System.Collections.Generic;
+//using MonoDevelop.Core;
+//using Microsoft.CodeAnalysis;
+//using ICSharpCode.NRefactory.CSharp;
+//using ICSharpCode.NRefactory6.CSharp;
+//
+//namespace MonoDevelop.CodeGeneration
+//{
+// class EqualityMembersGenerator : ICodeGenerator
+// {
+// public string Icon {
+// get {
+// return "md-newmethod";
+// }
+// }
+//
+// public string Text {
+// get {
+// return GettextCatalog.GetString ("Equality members");
+// }
+// }
+//
+// public string GenerateDescription {
+// get {
+// return GettextCatalog.GetString ("Select members to include in equality.");
+// }
+// }
+//
+// public bool IsValid (CodeGenerationOptions options)
+// {
+// return new CreateEquality (options).IsValid ();
+// }
+//
+// public IGenerateAction InitalizeSelection (CodeGenerationOptions options, Gtk.TreeView treeView)
+// {
+// var createEventMethod = new CreateEquality (options);
+// createEventMethod.Initialize (treeView);
+// return createEventMethod;
+// }
+//
+// class CreateEquality : AbstractGenerateAction
+// {
+// public CreateEquality (CodeGenerationOptions options) : base (options)
+// {
+// }
+//
+// protected override IEnumerable<object> GetValidMembers ()
+// {
+// if (Options.EnclosingType == null || Options.EnclosingMember != null)
+// yield break;
+// foreach (IFieldSymbol field in Options.EnclosingType.GetMembers ().OfType<IFieldSymbol> ()) {
+// if (field.IsImplicitlyDeclared)
+// continue;
+// yield return field;
+// }
+//
+// foreach (IPropertySymbol property in Options.EnclosingType.GetMembers ().OfType<IPropertySymbol> ()) {
+// if (property.IsImplicitlyDeclared)
+// continue;
+// if (property.GetMethod != null)
+// yield return property;
+// }
+// }
+//
+// protected override IEnumerable<string> GenerateCode (List<object> includedMembers)
+// {
+// // Genereate Equals
+// var methodDeclaration = new MethodDeclaration ();
+// methodDeclaration.Name = "Equals";
+//
+// methodDeclaration.ReturnType = new PrimitiveType ("bool");
+// methodDeclaration.Modifiers = Modifiers.Public | Modifiers.Override;
+// methodDeclaration.Body = new BlockStatement ();
+// methodDeclaration.Parameters.Add (new ParameterDeclaration (new PrimitiveType ("object"), "obj"));
+// var paramId = new IdentifierExpression ("obj");
+// var ifStatement = new IfElseStatement ();
+// ifStatement.Condition = new BinaryOperatorExpression (paramId, BinaryOperatorType.Equality, new PrimitiveExpression (null));
+// ifStatement.TrueStatement = new ReturnStatement (new PrimitiveExpression (false));
+// methodDeclaration.Body.Statements.Add (ifStatement);
+//
+// ifStatement = new IfElseStatement ();
+// var arguments = new List<Expression> ();
+// arguments.Add (new ThisReferenceExpression ());
+// arguments.Add (paramId.Clone ());
+// ifStatement.Condition = new InvocationExpression (new IdentifierExpression ("ReferenceEquals"), arguments);
+// ifStatement.TrueStatement = new ReturnStatement (new PrimitiveExpression (true));
+// methodDeclaration.Body.Statements.Add (ifStatement);
+//
+// ifStatement = new IfElseStatement ();
+// ifStatement.Condition = new BinaryOperatorExpression (new InvocationExpression (new MemberReferenceExpression (paramId.Clone (), "GetType")), BinaryOperatorType.InEquality, new TypeOfExpression (new SimpleType (Options.EnclosingType.Name)));
+// ifStatement.TrueStatement = new ReturnStatement (new PrimitiveExpression (false));
+// methodDeclaration.Body.Statements.Add (ifStatement);
+//
+// var varType = new SimpleType (Options.EnclosingType.Name);
+// var varDecl = new VariableDeclarationStatement (varType, "other", new CastExpression (varType.Clone (), paramId.Clone ()));
+// methodDeclaration.Body.Statements.Add (varDecl);
+//
+// var otherId = new IdentifierExpression ("other");
+// Expression binOp = null;
+// foreach (ISymbol member in includedMembers) {
+// Expression right = new BinaryOperatorExpression (new IdentifierExpression (member.Name), BinaryOperatorType.Equality, new MemberReferenceExpression (otherId.Clone (), member.Name));
+// binOp = binOp == null ? right : new BinaryOperatorExpression (binOp, BinaryOperatorType.ConditionalAnd, right);
+// }
+//
+// methodDeclaration.Body.Statements.Add (new ReturnStatement (binOp));
+// yield return methodDeclaration.ToString ();
+//
+// methodDeclaration = new MethodDeclaration ();
+// methodDeclaration.Name = "GetHashCode";
+//
+// methodDeclaration.ReturnType = new PrimitiveType ("int");
+// methodDeclaration.Modifiers = Modifiers.Public | Modifiers.Override;
+// methodDeclaration.Body = new BlockStatement ();
+//
+// binOp = null;
+// foreach (ISymbol member in includedMembers) {
+// Expression right;
+// right = new InvocationExpression (new MemberReferenceExpression (new IdentifierExpression (member.Name), "GetHashCode"));
+//
+// var type = member.GetReturnType ();
+// if (type != null && type.TypeKind != TypeKind.Struct && type.TypeKind != TypeKind.Enum)
+// right = new ParenthesizedExpression (new ConditionalExpression (new BinaryOperatorExpression (new IdentifierExpression (member.Name), BinaryOperatorType.InEquality, new PrimitiveExpression (null)), right, new PrimitiveExpression (0)));
+//
+// binOp = binOp == null ? right : new BinaryOperatorExpression (binOp, BinaryOperatorType.ExclusiveOr, right);
+// }
+// var uncheckedBlock = new BlockStatement ();
+// uncheckedBlock.Statements.Add (new ReturnStatement (binOp));
+//
+// methodDeclaration.Body.Statements.Add (new UncheckedStatement (uncheckedBlock));
+// yield return methodDeclaration.ToString ();
+// }
+// }
+// }
+//}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ExportCodeGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ExportCodeGenerator.cs
index 4eb780329e..10f8682db0 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ExportCodeGenerator.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ExportCodeGenerator.cs
@@ -25,20 +25,20 @@
// THE SOFTWARE.
using Gtk;
using System.Collections.Generic;
-using ICSharpCode.NRefactory.CSharp;
using MonoDevelop.Core;
-using ICSharpCode.NRefactory.TypeSystem;
using System.Linq;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-using MonoDevelop.CSharp.Refactoring.CodeActions;
using MonoDevelop.CodeGeneration;
using MonoDevelop.CSharp.Completion;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.CSharp.Refactoring;
+using ICSharpCode.NRefactory6.CSharp;
+using MonoDevelop.Ide.TypeSystem;
namespace MonoDevelop.CodeGeneration
{
abstract class BaseExportCodeGenerator : ICodeGenerator
{
- public abstract bool IsValidMember (IMember member);
+ public abstract bool IsValidMember (ISymbol member);
#region ICodeGenerator implementation
@@ -70,106 +70,90 @@ namespace MonoDevelop.CodeGeneration
#endregion
- public static bool HasProtocolAttribute (IType type, out string name)
- {
- foreach (var attrs in type.GetDefinition ().GetAttributes ()) {
- if (attrs.AttributeType.Name == "ProtocolAttribute" && MonoCSharpCompletionEngine.IsFoundationNamespace (attrs.AttributeType.Namespace)) {
- foreach (var na in attrs.NamedArguments) {
- if (na.Key.Name != "Name")
- continue;
- name = na.Value.ConstantValue as string;
- if (name != null)
- return true;
- }
- }
- }
- name = null;
- return false;
- }
-
- public static Attribute GenerateExportAttribute (RefactoringContext ctx, IMember member)
- {
- if (member == null)
- return null;
-
- bool useMonoTouchNamespace = false;
- var exportAttribute = member.GetAttribute (new FullTypeName (new TopLevelTypeName ("Foundation", "ExportAttribute")));
- if (exportAttribute == null) {
- useMonoTouchNamespace = true;
- exportAttribute = member.GetAttribute (new FullTypeName (new TopLevelTypeName ("MonoTouch.Foundation", "ExportAttribute")));
- }
-
- if (exportAttribute == null || exportAttribute.PositionalArguments.Count == 0)
- return null;
- var astType = useMonoTouchNamespace
- ? CreateMonoTouchExportAttributeAst (ctx)
- : CreateUnifiedExportAttributeAst (ctx);
-
- var attr = new Attribute {
- Type = astType,
- };
-
- attr.Arguments.Add (new PrimitiveExpression (exportAttribute.PositionalArguments [0].ConstantValue));
- return attr;
- }
-
- static AstType CreateUnifiedExportAttributeAst (RefactoringContext ctx)
- {
- var astType = ctx.CreateShortType ("Foundation", "ExportAttribute");
- if (astType is SimpleType) {
- astType = new SimpleType ("Export");
- } else {
- astType = new MemberType (new SimpleType ("Foundation"), "Export");
- }
- return astType;
- }
-
- static AstType CreateMonoTouchExportAttributeAst (RefactoringContext ctx)
- {
- var astType = ctx.CreateShortType ("MonoTouch.Foundation", "ExportAttribute");
- if (astType is SimpleType) {
- astType = new SimpleType ("Export");
- } else {
- astType = new MemberType (new MemberType (new SimpleType ("MonoTouch"), "Foundation"), "Export");
- }
- return astType;
- }
-
- static IMember GetProtocolMember (RefactoringContext ctx, IType protocolType, IMember member)
- {
- foreach (var m in protocolType.GetMembers (m => m.SymbolKind == member.SymbolKind && m.Name == member.Name)) {
- if (!SignatureComparer.Ordinal.Equals (m, member))
- return null;
- var prop = m as IProperty;
- if (prop != null) {
- if (prop.CanGet && GenerateExportAttribute (ctx, prop.Getter) != null ||
- prop.CanSet && GenerateExportAttribute (ctx, prop.Setter) != null)
- return m;
- } else {
- if (GenerateExportAttribute (ctx, m) != null)
- return m;
- }
- }
- return null;
- }
-
- static string GetProtocol (IMember member)
+// public static Attribute GenerateExportAttribute (RefactoringContext ctx, IMember member)
+// {
+// if (member == null)
+// return null;
+//
+// bool useMonoTouchNamespace = false;
+// var exportAttribute = member.GetAttribute (new FullTypeName (new TopLevelTypeName ("Foundation", "ExportAttribute")));
+// if (exportAttribute == null) {
+// useMonoTouchNamespace = true;
+// exportAttribute = member.GetAttribute (new FullTypeName (new TopLevelTypeName ("MonoTouch.Foundation", "ExportAttribute")));
+// }
+//
+// if (exportAttribute == null || exportAttribute.PositionalArguments.Count == 0)
+// return null;
+//
+// var astType = useMonoTouchNamespace
+// ? CreateMonoTouchExportAttributeAst (ctx)
+// : CreateUnifiedExportAttributeAst (ctx);
+//
+// var attr = new Attribute {
+// Type = astType,
+// };
+//
+// attr.Arguments.Add (new PrimitiveExpression (exportAttribute.PositionalArguments [0].ConstantValue));
+// return attr;
+// }
+//
+// static AstType CreateUnifiedExportAttributeAst (RefactoringContext ctx)
+// {
+// var astType = ctx.CreateShortType ("Foundation", "ExportAttribute");
+// if (astType is SimpleType) {
+// astType = new SimpleType ("Export");
+// } else {
+// astType = new MemberType (new SimpleType ("Foundation"), "Export");
+// }
+// return astType;
+// }
+//
+// static AstType CreateMonoTouchExportAttributeAst (RefactoringContext ctx)
+// {
+// var astType = ctx.CreateShortType ("MonoTouch.Foundation", "ExportAttribute");
+// if (astType is SimpleType) {
+// astType = new SimpleType ("Export");
+// } else {
+// astType = new MemberType (new MemberType (new SimpleType ("MonoTouch"), "Foundation"), "Export");
+// }
+// return astType;
+// }
+//
+// static IMember GetProtocolMember (RefactoringContext ctx, IType protocolType, IMember member)
+// {
+// foreach (var m in protocolType.GetMembers (m => m.SymbolKind == member.SymbolKind && m.Name == member.Name)) {
+// if (!SignatureComparer.Ordinal.Equals (m, member))
+// return null;
+// var prop = m as IProperty;
+// if (prop != null) {
+// if (prop.CanGet && GenerateExportAttribute (ctx, prop.Getter) != null ||
+// prop.CanSet && GenerateExportAttribute (ctx, prop.Setter) != null)
+// return m;
+// } else {
+// if (GenerateExportAttribute (ctx, m) != null)
+// return m;
+// }
+// }
+// return null;
+// }
+//
+ static string GetProtocol (ISymbol member)
{
- var attr = member.Attributes.FirstOrDefault (a => a.AttributeType.Name == "ExportAttribute" && MonoCSharpCompletionEngine.IsFoundationNamespace (a.AttributeType.Namespace));
- if (attr == null || attr.PositionalArguments.Count == 0)
+ var attr = member.GetAttributes ().FirstOrDefault (a => a.AttributeClass.Name == "ExportAttribute" && ProtocolMemberContextHandler.IsFoundationNamespace (a.AttributeClass.ContainingNamespace));
+ if (attr == null || attr.ConstructorArguments.Length == 0)
return null;
- return attr.PositionalArguments.First ().ConstantValue.ToString ();
+ return attr.ConstructorArguments.First ().Value.ToString ();
}
- public static bool IsImplemented (IType type, IMember protocolMember)
+ public static bool IsImplemented (ITypeSymbol type, ISymbol protocolMember)
{
- foreach (var m in type.GetMembers (m => m.SymbolKind == protocolMember.SymbolKind && m.Name == protocolMember.Name)) {
- var p = m as IProperty;
+ foreach (var m in type.GetMembers().Where (m => m.Kind == protocolMember.Kind && m.Name == protocolMember.Name)) {
+ var p = m as IPropertySymbol;
if (p != null) {
- if (p.CanGet && ((IProperty)protocolMember).CanGet && GetProtocol (p.Getter) == GetProtocol (((IProperty)protocolMember).Getter))
+ if (p.GetMethod != null && ((IPropertySymbol)protocolMember).GetMethod != null && GetProtocol (p.GetMethod) == GetProtocol (((IPropertySymbol)protocolMember).GetMethod))
return true;
- if (p.CanSet && ((IProperty)protocolMember).CanSet && GetProtocol (p.Setter) == GetProtocol (((IProperty)protocolMember).Setter))
+ if (p.SetMethod != null && ((IPropertySymbol)protocolMember).SetMethod != null && GetProtocol (p.SetMethod) == GetProtocol (((IPropertySymbol)protocolMember).SetMethod))
return true;
continue;
}
@@ -194,32 +178,32 @@ namespace MonoDevelop.CodeGeneration
var type = Options.EnclosingType;
if (type == null || Options.EnclosingMember != null)
yield break;
- foreach (var t in type.DirectBaseTypes) {
+ foreach (var t in type.GetBaseTypes ()) {
string name;
- if (!HasProtocolAttribute (t, out name))
+ if (!ProtocolMemberContextHandler.HasProtocolAttribute (t, out name))
continue;
- var protocolType = Options.Document.Compilation.FindType (new FullTypeName (new TopLevelTypeName (t.Namespace, name)));
+ var protocolType = Options.CurrentState.Compilation.GetTypeByMetadataName (t.ContainingNamespace.GetFullName () + "." + name);
if (protocolType == null)
break;
- foreach (var member in protocolType.GetMethods (null, GetMemberOptions.IgnoreInheritedMembers)) {
- if (member.ImplementedInterfaceMembers.Any ())
+ foreach (var member in protocolType.GetMembers().OfType<IMethodSymbol>()) {
+ if (member.ExplicitInterfaceImplementations.Length > 0)
continue;
if (!cg.IsValidMember (member))
continue;
if (IsImplemented (type, member))
continue;
- if (member.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && MonoCSharpCompletionEngine.IsFoundationNamespace (a.AttributeType.Namespace)))
+ if (member.GetAttributes ().Any (a => a.AttributeClass.Name == "ExportAttribute" && ProtocolMemberContextHandler.IsFoundationNamespace (a.AttributeClass.ContainingNamespace)))
yield return member;
}
- foreach (var member in protocolType.GetProperties (null, GetMemberOptions.IgnoreInheritedMembers)) {
- if (member.ImplementedInterfaceMembers.Any ())
+ foreach (var member in protocolType.GetMembers().OfType<IPropertySymbol>()) {
+ if (member.ExplicitInterfaceImplementations.Length > 0)
continue;
if (!cg.IsValidMember (member))
continue;
if (IsImplemented (type, member))
continue;
- if (member.CanGet && member.Getter.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && MonoCSharpCompletionEngine.IsFoundationNamespace (a.AttributeType.Namespace)) ||
- member.CanSet && member.Setter.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && MonoCSharpCompletionEngine.IsFoundationNamespace (a.AttributeType.Namespace)))
+ if (member.GetMethod != null && member.GetMethod.GetAttributes ().Any (a => a.AttributeClass.Name == "ExportAttribute" && ProtocolMemberContextHandler.IsFoundationNamespace (a.AttributeClass.ContainingNamespace)) ||
+ member.SetMethod != null && member.SetMethod.GetAttributes ().Any (a => a.AttributeClass.Name == "ExportAttribute" && ProtocolMemberContextHandler.IsFoundationNamespace (a.AttributeClass.ContainingNamespace)))
yield return member;
}
}
@@ -227,63 +211,11 @@ namespace MonoDevelop.CodeGeneration
protected override IEnumerable<string> GenerateCode (List<object> includedMembers)
{
- var generator = Options.CreateCodeGenerator ();
- generator.AutoIndent = false;
- var ctx = MDRefactoringContext.Create (Options.Document, Options.Document.Editor.Caret.Location).Result;
- if (ctx == null)
- yield break;
- var builder = ctx.CreateTypeSystemAstBuilder ();
-
- foreach (IMember member in includedMembers) {
- yield return GenerateMemberCode (ctx, builder, member);
+ foreach (ISymbol member in includedMembers) {
+ yield return CSharpCodeGenerator.CreateProtocolMemberImplementation (Options.DocumentContext, Options.Editor, Options.EnclosingType, Options.EnclosingPart.GetLocation (), member, false, null).Code;
}
}
}
-
- internal static string GenerateMemberCode (MDRefactoringContext ctx, TypeSystemAstBuilder builder, IMember member)
- {
- var method = builder.ConvertEntity (member) as MethodDeclaration;
- if (method != null) {
- method.Body = new BlockStatement {
- new ThrowStatement (new ObjectCreateExpression (ctx.CreateShortType ("System", "NotImplementedException")))
- };
- method.Modifiers &= ~Modifiers.Virtual;
- method.Modifiers &= ~Modifiers.Abstract;
- method.Attributes.Add (new AttributeSection {
- Attributes = {
- GenerateExportAttribute (ctx, member)
- }
- });
- return method.ToString (ctx.FormattingOptions);
- }
- var property = builder.ConvertEntity (member) as PropertyDeclaration;
- if (property == null)
- return null;
- var p = (IProperty)member;
- property.Modifiers &= ~Modifiers.Virtual;
- property.Modifiers &= ~Modifiers.Abstract;
- if (p.CanGet) {
- property.Getter.Body = new BlockStatement {
- new ThrowStatement (new ObjectCreateExpression (ctx.CreateShortType ("System", "NotImplementedException")))
- };
- property.Getter.Attributes.Add (new AttributeSection {
- Attributes = {
- GenerateExportAttribute (ctx, p.Getter)
- }
- });
- }
- if (p.CanSet) {
- property.Setter.Body = new BlockStatement {
- new ThrowStatement (new ObjectCreateExpression (ctx.CreateShortType ("System", "NotImplementedException")))
- };
- property.Setter.Attributes.Add (new AttributeSection {
- Attributes = {
- GenerateExportAttribute (ctx, p.Setter)
- }
- });
- }
- return property.ToString (ctx.FormattingOptions);
- }
}
class OptionalProtocolMemberGenerator : BaseExportCodeGenerator
@@ -300,7 +232,7 @@ namespace MonoDevelop.CodeGeneration
}
}
- public override bool IsValidMember (IMember member)
+ public override bool IsValidMember (ISymbol member)
{
return !member.IsAbstract;
}
@@ -320,11 +252,9 @@ namespace MonoDevelop.CodeGeneration
}
}
- public override bool IsValidMember (IMember member)
+ public override bool IsValidMember (ISymbol member)
{
return member.IsAbstract;
}
}
-
-}
-
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/GenerateCodeWindow.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/GenerateCodeWindow.cs
index a96cc7cc11..600d197bab 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/GenerateCodeWindow.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/GenerateCodeWindow.cs
@@ -31,7 +31,7 @@ using MonoDevelop.Ide.Gui;
using MonoDevelop.Refactoring;
using System.Collections.Generic;
using MonoDevelop.Ide;
-using Mono.TextEditor.PopupWindow;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.CodeGeneration
{
@@ -134,10 +134,10 @@ namespace MonoDevelop.CodeGeneration
GetSize (out w, out h);
int myMonitor = Screen.GetMonitorAtPoint (x, y);
- Gdk.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen, myMonitor);
+ Xwt.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen.Number, myMonitor);
if (x + w > geometry.Right)
- x = geometry.Right - w;
+ x = (int)geometry.Right - w;
if (y + h > geometry.Bottom)
y = y - completionContext.TriggerTextHeight - h;
@@ -174,9 +174,9 @@ namespace MonoDevelop.CodeGeneration
}
}
- public static void ShowIfValid (Document document, MonoDevelop.Ide.CodeCompletion.CodeCompletionContext completionContext)
+ public static void ShowIfValid (TextEditor editor, DocumentContext context, MonoDevelop.Ide.CodeCompletion.CodeCompletionContext completionContext)
{
- var options = CodeGenerationOptions.CreateCodeGenerationOptions (document);
+ var options = CodeGenerationOptions.CreateCodeGenerationOptions (editor, context);
var validGenerators = new List<ICodeGenerator> ();
foreach (var generator in CodeGenerationService.CodeGenerators) {
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ICodeGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ICodeGenerator.cs
index b70422665b..f0d64d40ba 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ICodeGenerator.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ICodeGenerator.cs
@@ -31,7 +31,7 @@ using Mono.Addins;
namespace MonoDevelop.CodeGeneration
{
- public interface ICodeGenerator
+ internal interface ICodeGenerator
{
string Icon {
get;
@@ -50,14 +50,14 @@ namespace MonoDevelop.CodeGeneration
IGenerateAction InitalizeSelection (CodeGenerationOptions options, Gtk.TreeView treeView);
}
- public interface IGenerateAction
+ interface IGenerateAction
{
void GenerateCode ();
}
static class CodeGenerationService
{
- static List<ICodeGenerator> codeGenerators = new List<ICodeGenerator>();
+ static readonly List<ICodeGenerator> codeGenerators = new List<ICodeGenerator>();
static CodeGenerationService ()
{
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ImplementInterfaceMembersGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ImplementInterfaceMembersGenerator.cs
index 7646b4002f..caf0bbe4e9 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ImplementInterfaceMembersGenerator.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ImplementInterfaceMembersGenerator.cs
@@ -1,101 +1,100 @@
+////
+//// ImplementInterfaceMembersGenerator.cs
+////
+//// Author:
+//// Mike Krüger <mkrueger@xamarin.com>
+////
+//// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
+////
+//// Permission is hereby granted, free of charge, to any person obtaining a copy
+//// of this software and associated documentation files (the "Software"), to deal
+//// in the Software without restriction, including without limitation the rights
+//// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+//// copies of the Software, and to permit persons to whom the Software is
+//// furnished to do so, subject to the following conditions:
+////
+//// The above copyright notice and this permission notice shall be included in
+//// all copies or substantial portions of the Software.
+////
+//// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+//// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+//// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+//// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+//// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+//// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+//// THE SOFTWARE.
+//using Gtk;
+//using System.Collections.Generic;
+//using MonoDevelop.Core;
+//using MonoDevelop.Refactoring;
+//using ICSharpCode.NRefactory.CSharp;
+//using ICSharpCode.NRefactory.TypeSystem;
+//using MonoDevelop.Ide.TypeSystem;
+//using System;
//
-// ImplementInterfaceMembersGenerator.cs
+//namespace MonoDevelop.CodeGeneration
+//{
+// class ImplementInterfaceMembersGenerator : ICodeGenerator
+// {
+// public string Icon {
+// get {
+// return "md-method";
+// }
+// }
+//
+// public string Text {
+// get {
+// return GettextCatalog.GetString ("Implement interface members");
+// }
+// }
+//
+// public string GenerateDescription {
+// get {
+// return GettextCatalog.GetString ("Select members to be implemented.");
+// }
+// }
+//
+// public bool IsValid (CodeGenerationOptions options)
+// {
+// return new OverrideMethods (options).IsValid ();
+// }
+//
+// public IGenerateAction InitalizeSelection (CodeGenerationOptions options, Gtk.TreeView treeView)
+// {
+// OverrideMethods overrideMethods = new OverrideMethods (options);
+// overrideMethods.Initialize (treeView);
+// return overrideMethods;
+// }
+//
+// class OverrideMethods : AbstractGenerateAction
+// {
+// public OverrideMethods (CodeGenerationOptions options) : base (options)
+// {
+// }
+//
+// protected override IEnumerable<object> GetValidMembers ()
+// {
+// var type = Options.EnclosingType;
+// if (type == null || Options.EnclosingMember != null)
+// yield break;
//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
+// foreach (var baseType in Options.EnclosingType.Interfaces) {
+// bool ifm;
+//// foreach (var t in ICSharpCode.NRefactory.CSharp.Refactoring.ImplementInterfaceAction.CollectMembersToImplement (type, baseType, false, out ifm)) {
+//// yield return t;
+//// }
+// }
+// }
+//
+// protected override IEnumerable<string> GenerateCode (List<object> includedMembers)
+// {
+// var generator = Options.CreateCodeGenerator ();
+// generator.AutoIndent = false;
+// foreach (Tuple<IMember, bool> member in includedMembers)
+// yield return "";
+// // yield return generator.CreateMemberImplementation (Options.EnclosingType, Options.EnclosingPart, member.Item1, member.Item2).Code;
+// }
+// }
+// }
+//}
//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using Gtk;
-using System.Collections.Generic;
-using MonoDevelop.Core;
-using MonoDevelop.Refactoring;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Ide.TypeSystem;
-using System;
-
-namespace MonoDevelop.CodeGeneration
-{
- class ImplementInterfaceMembersGenerator : ICodeGenerator
- {
- public string Icon {
- get {
- return "md-method";
- }
- }
-
- public string Text {
- get {
- return GettextCatalog.GetString ("Implement interface members");
- }
- }
-
- public string GenerateDescription {
- get {
- return GettextCatalog.GetString ("Select members to be implemented.");
- }
- }
-
- public bool IsValid (CodeGenerationOptions options)
- {
- return new OverrideMethods (options).IsValid ();
- }
-
- public IGenerateAction InitalizeSelection (CodeGenerationOptions options, Gtk.TreeView treeView)
- {
- OverrideMethods overrideMethods = new OverrideMethods (options);
- overrideMethods.Initialize (treeView);
- return overrideMethods;
- }
-
- class OverrideMethods : AbstractGenerateAction
- {
- public OverrideMethods (CodeGenerationOptions options) : base (options)
- {
- }
-
- protected override IEnumerable<object> GetValidMembers ()
- {
- var type = Options.EnclosingType;
- if (type == null || Options.EnclosingMember != null)
- yield break;
-
- foreach (var baseType in Options.EnclosingType.DirectBaseTypes) {
- if (baseType.Kind != TypeKind.Interface)
- continue;
- bool ifm;
- foreach (var t in ICSharpCode.NRefactory.CSharp.Refactoring.ImplementInterfaceAction.CollectMembersToImplement (type, baseType, false, out ifm)) {
- yield return t;
- }
- }
- }
-
- protected override IEnumerable<string> GenerateCode (List<object> includedMembers)
- {
- var generator = Options.CreateCodeGenerator ();
- generator.AutoIndent = false;
- foreach (Tuple<IMember, bool> member in includedMembers)
- yield return generator.CreateMemberImplementation (Options.EnclosingType, Options.EnclosingPart, member.Item1, member.Item2).Code;
- }
- }
- }
-}
-
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/OverrideMembersGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/OverrideMembersGenerator.cs
index 57b241976a..8d1b747b4b 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/OverrideMembersGenerator.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/OverrideMembersGenerator.cs
@@ -28,8 +28,11 @@ using Gtk;
using System.Collections.Generic;
using MonoDevelop.Core;
using MonoDevelop.Refactoring;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.TypeSystem;
+using ICSharpCode.NRefactory6.CSharp;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.CSharp.Refactoring;
using MonoDevelop.Ide.TypeSystem;
namespace MonoDevelop.CodeGeneration
@@ -41,62 +44,105 @@ namespace MonoDevelop.CodeGeneration
return "md-method";
}
}
-
+
public string Text {
get {
return GettextCatalog.GetString ("Override members");
}
}
-
+
public string GenerateDescription {
get {
return GettextCatalog.GetString ("Select members to be overridden.");
}
}
-
+
public bool IsValid (CodeGenerationOptions options)
{
return new OverrideMethods (options).IsValid ();
}
-
+
public IGenerateAction InitalizeSelection (CodeGenerationOptions options, Gtk.TreeView treeView)
{
OverrideMethods overrideMethods = new OverrideMethods (options);
overrideMethods.Initialize (treeView);
return overrideMethods;
}
-
+
class OverrideMethods : AbstractGenerateAction
{
public OverrideMethods (CodeGenerationOptions options) : base (options)
{
}
-
+
protected override IEnumerable<object> GetValidMembers ()
{
- var type = Options.EnclosingType;
- if (type == null || Options.EnclosingMember != null)
- yield break;
- HashSet<string> memberName = new HashSet<string> ();
- foreach (var member in Options.EnclosingType.GetMembers ()) {
- if (member.IsSynthetic)
- continue;
- if (member.IsOverridable) {
- string id = AmbienceService.DefaultAmbience.GetString (member, OutputFlags.ClassBrowserEntries);
- if (memberName.Contains (id))
- continue;
- memberName.Add (id);
- yield return member;
+ var encType = Options.EnclosingType as INamedTypeSymbol;
+ if (encType == null || Options.EnclosingMember != null)
+ return Enumerable.Empty<object> ();
+
+
+ var result = new HashSet<ISymbol> ();
+ var cancellationToken = default(CancellationToken);
+ var baseTypes = encType.GetBaseTypes ().Reverse ();
+ foreach (var type in baseTypes) {
+ RemoveOverriddenMembers (result, type, cancellationToken);
+
+ AddOverridableMembers (result, encType, type, cancellationToken);
+ }
+ RemoveOverriddenMembers (result, encType, cancellationToken);
+ return result;
+ }
+
+ static void AddOverridableMembers (HashSet<ISymbol> result, INamedTypeSymbol containingType, INamedTypeSymbol type, CancellationToken cancellationToken)
+ {
+ foreach (var member in type.GetMembers()) {
+ if (IsOverridable (member, containingType)) {
+ result.Add (member);
+ }
+ }
+ }
+
+ protected static void RemoveOverriddenMembers (HashSet<ISymbol> result, INamedTypeSymbol containingType, CancellationToken cancellationToken)
+ {
+ foreach (var member in containingType.GetMembers()) {
+ var overriddenMember = member.OverriddenMember ();
+ if (overriddenMember != null) {
+ result.Remove (overriddenMember);
}
}
}
-
+
+ public static bool IsOverridable (ISymbol member, INamedTypeSymbol containingType)
+ {
+ if (member.IsAbstract || member.IsVirtual || member.IsOverride) {
+ if (member.IsSealed) {
+ return false;
+ }
+
+ if (!member.IsAccessibleWithin (containingType)) {
+ return false;
+ }
+
+ switch (member.Kind) {
+ case SymbolKind.Event:
+ return true;
+ case SymbolKind.Method:
+ return ((IMethodSymbol)member).MethodKind == MethodKind.Ordinary;
+ case SymbolKind.Property:
+ return !((IPropertySymbol)member).IsWithEvents;
+ }
+ }
+ return false;
+ }
+
protected override IEnumerable<string> GenerateCode (List<object> includedMembers)
{
- var generator = Options.CreateCodeGenerator ();
- generator.AutoIndent = false;
- foreach (IMember member in includedMembers)
- yield return generator.CreateMemberImplementation (Options.EnclosingType, Options.EnclosingPart, member, false).Code;
+ var currentType = Options.EnclosingType as INamedTypeSymbol;
+
+ foreach (ISymbol member in includedMembers) {
+ yield return CSharpCodeGenerator.CreateOverridenMemberImplementation (Options.DocumentContext, Options.Editor, currentType, currentType.Locations.First (), member, false, null).Code;
+ }
}
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/PartialGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/PartialGenerator.cs
index fbde16fec2..c2329223d2 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/PartialGenerator.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/PartialGenerator.cs
@@ -23,11 +23,14 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using System;
+
+using System.Linq;
using System.Collections.Generic;
using Gtk;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Core;
+using System.Threading;
+using ICSharpCode.NRefactory6.CSharp;
+using MonoDevelop.CSharp.Refactoring;
using MonoDevelop.Ide.TypeSystem;
namespace MonoDevelop.CodeGeneration
@@ -76,21 +79,37 @@ namespace MonoDevelop.CodeGeneration
if (type == null || Options.EnclosingMember != null)
yield break;
- foreach (var method in Options.EnclosingType.Methods) {
- if (method.IsPartial && method.BodyRegion.IsEmpty) {
+ foreach (var method in Options.EnclosingType.GetMembers ().OfType<Microsoft.CodeAnalysis.IMethodSymbol> ()) {
+ if (method.MethodKind != Microsoft.CodeAnalysis.MethodKind.Ordinary)
+ continue;
+ if (IsEmptyPartialMethod(method)) {
yield return method;
}
}
}
+ static bool IsEmptyPartialMethod(Microsoft.CodeAnalysis.ISymbol member, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var method = member as Microsoft.CodeAnalysis.IMethodSymbol;
+ if (method == null || method.IsDefinedInMetadata ())
+ return false;
+ foreach (var r in method.DeclaringSyntaxReferences) {
+ var node = r.GetSyntax (cancellationToken) as Microsoft.CodeAnalysis.CSharp.Syntax.MethodDeclarationSyntax;
+ if (node == null)
+ continue;
+ if (node.Body != null || !node.Modifiers.Any(m => m.IsKind (Microsoft.CodeAnalysis.CSharp.SyntaxKind.PartialKeyword)))
+ return false;
+ }
+
+ return true;
+ }
+
+
protected override IEnumerable<string> GenerateCode (List<object> includedMembers)
{
- var generator = Options.CreateCodeGenerator ();
- generator.AutoIndent = false;
- foreach (IMethod member in includedMembers)
- yield return generator.CreateMemberImplementation (Options.EnclosingType, Options.EnclosingPart, member, false).Code;
+ foreach (Microsoft.CodeAnalysis.IMethodSymbol member in includedMembers)
+ yield return CSharpCodeGenerator.CreatePartialMemberImplementation (Options.DocumentContext, Options.Editor, Options.EnclosingType, Options.EnclosingPart.GetLocation (), member, false, null).Code;
}
}
}
}
-
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/PropertyGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/PropertyGenerator.cs
index b8829e58e7..c658adc37b 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/PropertyGenerator.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/PropertyGenerator.cs
@@ -25,16 +25,15 @@
// THE SOFTWARE.
using System;
-
-using ICSharpCode.NRefactory.CSharp;
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Gui;
-using Gtk;
+using System.Linq;
using System.Collections.Generic;
-using MonoDevelop.Refactoring;
using System.Text;
-using ICSharpCode.NRefactory.TypeSystem;
-using System.Linq;
+using MonoDevelop.Core;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Simplification;
+using System.Threading.Tasks;
namespace MonoDevelop.CodeGeneration
{
@@ -86,19 +85,19 @@ namespace MonoDevelop.CodeGeneration
{
if (Options.EnclosingType == null || Options.EnclosingMember != null)
yield break;
- foreach (IField field in Options.EnclosingType.Fields) {
- if (field.IsSynthetic)
+ foreach (var field in Options.EnclosingType.GetMembers ().OfType<IFieldSymbol> ()) {
+ if (field.IsImplicitlyDeclared)
continue;
- var list = Options.EnclosingType.Fields.Where (f => f.Name == CreatePropertyName (field));;
+ var list = Options.EnclosingType.GetMembers ().OfType<IFieldSymbol> ().Where (f => f.Name == CreatePropertyName (field));
if (!list.Any ())
yield return field;
}
}
- static string CreatePropertyName (IMember member)
+ static string CreatePropertyName (ISymbol member)
{
int i = 0;
- while (i + 1 < member.Name.Length && member.Name[i] == '_')
+ while (i + 1 < member.Name.Length && member.Name [i] == '_')
i++;
if (i + 1 >= member.Name.Length)
return char.ToUpper (member.Name [i]).ToString ();
@@ -107,10 +106,49 @@ namespace MonoDevelop.CodeGeneration
protected override IEnumerable<string> GenerateCode (List<object> includedMembers)
{
- var generator = Options.CreateCodeGenerator ();
- generator.AutoIndent = false;
- foreach (IField field in includedMembers)
- yield return generator.CreateFieldEncapsulation (Options.EnclosingPart, field, CreatePropertyName (field), Accessibility.Public, ReadOnly);
+ foreach (IFieldSymbol field in includedMembers) {
+ var node = SyntaxFactory.PropertyDeclaration (
+ CreateConstructorGenerator.ConvertType (field.Type),
+ CreatePropertyName (field)
+ );
+
+ node = node.AddAccessorListAccessors (
+ SyntaxFactory.AccessorDeclaration (
+ SyntaxKind.GetAccessorDeclaration,
+ SyntaxFactory.Block (
+ SyntaxFactory.ReturnStatement (
+ SyntaxFactory.MemberAccessExpression (
+ SyntaxKind.SimpleMemberAccessExpression,
+ SyntaxFactory.ThisExpression (),
+ SyntaxFactory.IdentifierName (field.Name)
+ )
+ )
+ )
+ )
+ );
+ if (!ReadOnly) {
+ node = node.AddAccessorListAccessors (
+ SyntaxFactory.AccessorDeclaration (
+ SyntaxKind.SetAccessorDeclaration,
+ SyntaxFactory.Block (
+ SyntaxFactory.ExpressionStatement (
+ SyntaxFactory.AssignmentExpression (
+ SyntaxKind.SimpleAssignmentExpression,
+ SyntaxFactory.MemberAccessExpression (
+ SyntaxKind.SimpleMemberAccessExpression,
+ SyntaxFactory.ThisExpression (),
+ SyntaxFactory.IdentifierName (field.Name)
+ ),
+ SyntaxFactory.IdentifierName ("value")
+ )
+ )
+ )
+ )
+ );
+ }
+ yield return Options.OutputNode (node).Result;
+ }
+
}
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/RaiseEventMethodGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/RaiseEventMethodGenerator.cs
index 76b0f7bd57..ef38ac7adc 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/RaiseEventMethodGenerator.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/RaiseEventMethodGenerator.cs
@@ -25,15 +25,18 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.NRefactory.CSharp;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using Gtk;
using System.Collections.Generic;
using MonoDevelop.Refactoring;
using System.Text;
-using ICSharpCode.NRefactory.TypeSystem;
using System.Linq;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using MonoDevelop.Ide.TypeSystem;
namespace MonoDevelop.CodeGeneration
{
@@ -77,7 +80,7 @@ namespace MonoDevelop.CodeGeneration
{
}
- static string GetEventMethodName (IMember member)
+ static string GetEventMethodName (ISymbol member)
{
return "On" + member.Name;
}
@@ -86,13 +89,13 @@ namespace MonoDevelop.CodeGeneration
{
if (Options.EnclosingType == null || Options.EnclosingMember != null)
yield break;
- foreach (var e in Options.EnclosingType.Events) {
- if (e.IsSynthetic)
+ foreach (IEventSymbol e in Options.EnclosingType.GetMembers ().OfType<IEventSymbol> ()) {
+ if (e.IsImplicitlyDeclared)
continue;
- var invokeMethod = e.ReturnType.GetDelegateInvokeMethod ();
+ var invokeMethod = e.GetReturnType ().GetDelegateInvokeMethod ();
if (invokeMethod == null)
continue;
- if (Options.EnclosingType.GetMethods (m => m.Name == GetEventMethodName (e)).Any ())
+ if (Options.EnclosingType.GetMembers ().OfType<IMethodSymbol> ().Any (m => m.Name == GetEventMethodName (e)))
continue;
yield return e;
}
@@ -100,40 +103,89 @@ namespace MonoDevelop.CodeGeneration
protected override IEnumerable<string> GenerateCode (List<object> includedMembers)
{
- foreach (IMember member in includedMembers) {
- var invokeMethod = member.ReturnType.GetDelegateInvokeMethod ();
+ foreach (IEventSymbol member in includedMembers) {
+ var invokeMethod = member.GetReturnType ().GetDelegateInvokeMethod ();
if (invokeMethod == null)
continue;
- var methodDeclaration = new MethodDeclaration () {
- Name = GetEventMethodName (member),
- ReturnType = new PrimitiveType ("void"),
- Modifiers = Modifiers.Protected | Modifiers.Virtual,
- Parameters = {
- new ParameterDeclaration (Options.CreateShortType (invokeMethod.Parameters [1].Type), invokeMethod.Parameters [1].Name)
- },
- Body = new BlockStatement () {
- new VariableDeclarationStatement (
- new SimpleType ("var"),//Options.CreateShortType (member.ReturnType),
- handlerName,
- new MemberReferenceExpression (new ThisReferenceExpression (), member.Name)
- ),
- new IfElseStatement () {
- Condition = new BinaryOperatorExpression (new IdentifierExpression (handlerName), BinaryOperatorType.InEquality, new PrimitiveExpression (null)),
- TrueStatement = new ExpressionStatement (new InvocationExpression (new IdentifierExpression (handlerName)) {
- Arguments = {
- new ThisReferenceExpression (),
- new IdentifierExpression (invokeMethod.Parameters [1].Name)
- }
- })
- }
- }
- };
+ var node = SyntaxFactory.MethodDeclaration (
+ SyntaxFactory.PredefinedType (SyntaxFactory.Token (SyntaxKind.VoidKeyword)),
+ SyntaxFactory.Identifier (GetEventMethodName (member))
+ );
+
+ node = node.WithModifiers (SyntaxFactory.TokenList (SyntaxFactory.Token (SyntaxKind.ProtectedKeyword), SyntaxFactory.Token (SyntaxKind.VirtualKeyword)));
+ node = node.WithParameterList (SyntaxFactory.ParameterList (SyntaxFactory.SeparatedList<ParameterSyntax> (new [] {
+ SyntaxFactory.Parameter (SyntaxFactory.Identifier (invokeMethod.Parameters [1].Name)).WithType (SyntaxFactory.ParseTypeName (Options.CreateShortType (invokeMethod.Parameters [1].Type)))
+ })));
- yield return methodDeclaration.ToString (Options.FormattingOptions);
+ bool csharp6Style = true;
+ ;
+ if (csharp6Style) {
+ var expressionSyntax = SyntaxFactory.ParseExpression ("foo?.bar") as ConditionalAccessExpressionSyntax;
+ Console.WriteLine (expressionSyntax.OperatorToken.Kind ());
+ Console.WriteLine (expressionSyntax.Expression.GetType ());
+ Console.WriteLine (expressionSyntax.WhenNotNull.GetType ());
+ node = node.WithBody (SyntaxFactory.Block (
+ SyntaxFactory.ExpressionStatement (
+ SyntaxFactory.InvocationExpression (
+ SyntaxFactory.ConditionalAccessExpression (
+ SyntaxFactory.MemberAccessExpression (
+ SyntaxKind.SimpleMemberAccessExpression,
+ SyntaxFactory.ThisExpression (),
+ SyntaxFactory.IdentifierName (member.Name)
+ ),
+ SyntaxFactory.MemberBindingExpression (SyntaxFactory.IdentifierName ("Invoke"))
+ ),
+ SyntaxFactory.ArgumentList (
+ SyntaxFactory.SeparatedList<ArgumentSyntax> (new [] {
+ SyntaxFactory.Argument (SyntaxFactory.ThisExpression ()),
+ SyntaxFactory.Argument (SyntaxFactory.IdentifierName (invokeMethod.Parameters [1].Name))
+ })
+ )
+ )
+ )
+ ));
+ } else {
+ node = node.WithBody (SyntaxFactory.Block (
+ SyntaxFactory.LocalDeclarationStatement (
+ SyntaxFactory.VariableDeclaration (
+ SyntaxFactory.ParseTypeName ("var"),
+ SyntaxFactory.SeparatedList<VariableDeclaratorSyntax> (new [] {
+ SyntaxFactory.VariableDeclarator (SyntaxFactory.Identifier (handlerName)).WithInitializer (
+ SyntaxFactory.EqualsValueClause (
+ SyntaxFactory.MemberAccessExpression (
+ SyntaxKind.SimpleMemberAccessExpression,
+ SyntaxFactory.ThisExpression (),
+ SyntaxFactory.IdentifierName (member.Name)
+ )
+ )
+ )
+ })
+ )
+ ),
+ SyntaxFactory.IfStatement (
+ SyntaxFactory.BinaryExpression (
+ SyntaxKind.NotEqualsExpression,
+ SyntaxFactory.IdentifierName (handlerName),
+ SyntaxFactory.ParseExpression ("null")
+ ),
+ SyntaxFactory.ExpressionStatement (
+ SyntaxFactory.InvocationExpression (
+ SyntaxFactory.IdentifierName (handlerName),
+ SyntaxFactory.ArgumentList (
+ SyntaxFactory.SeparatedList<ArgumentSyntax> (new [] {
+ SyntaxFactory.Argument (SyntaxFactory.ThisExpression ()),
+ SyntaxFactory.Argument (SyntaxFactory.IdentifierName (invokeMethod.Parameters [1].Name))
+ })
+ )
+ )
+ )
+ )
+ ));
+ }
+ yield return Options.OutputNode (node).Result;
}
}
}
}
-}
-
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ReadonlyPropertyGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ReadonlyPropertyGenerator.cs
index 928ddb1fab..d6b71bcc5f 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ReadonlyPropertyGenerator.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ReadonlyPropertyGenerator.cs
@@ -25,14 +25,12 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.NRefactory.CSharp;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using Gtk;
using System.Collections.Generic;
using MonoDevelop.Refactoring;
using System.Text;
-using ICSharpCode.NRefactory.TypeSystem;
using System.Linq;
namespace MonoDevelop.CodeGeneration
@@ -70,4 +68,4 @@ namespace MonoDevelop.CodeGeneration
return createProperty;
}
}
-}
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ToStringGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ToStringGenerator.cs
index 9d7913d8ae..516a34c15c 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ToStringGenerator.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ToStringGenerator.cs
@@ -7,7 +7,7 @@
// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
+// of this software and associated documentation files (the "Software" ), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@@ -25,75 +25,79 @@
// THE SOFTWARE.
using System;
-using MonoDevelop.Components;
-using Gtk;
-using MonoDevelop.Ide.Gui;
using System.Collections.Generic;
-using ICSharpCode.NRefactory.CSharp;
using System.Text;
using MonoDevelop.Core;
-using MonoDevelop.Refactoring;
-using ICSharpCode.NRefactory.TypeSystem;
-using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Simplification;
namespace MonoDevelop.CodeGeneration
{
class ToStringGenerator : ICodeGenerator
{
- public string Icon {
- get {
+ public string Icon
+ {
+ get
+ {
return "md-newmethod";
}
}
-
- public string Text {
- get {
+
+ public string Text
+ {
+ get
+ {
return GettextCatalog.GetString ("ToString() implementation");
}
}
-
- public string GenerateDescription {
- get {
+
+ public string GenerateDescription
+ {
+ get
+ {
return GettextCatalog.GetString ("Select members to be outputted.");
}
}
-
+
public bool IsValid (CodeGenerationOptions options)
{
return new CreateToString (options).IsValid ();
}
-
+
public IGenerateAction InitalizeSelection (CodeGenerationOptions options, Gtk.TreeView treeView)
{
CreateToString createToString = new CreateToString (options);
createToString.Initialize (treeView);
return createToString;
}
-
+
class CreateToString : AbstractGenerateAction
{
public CreateToString (CodeGenerationOptions options) : base (options)
{
}
-
+
protected override IEnumerable<object> GetValidMembers ()
{
if (Options.EnclosingType == null || Options.EnclosingMember != null)
yield break;
- foreach (IField field in Options.EnclosingType.Fields) {
- if (field.IsSynthetic)
+
+ foreach (var field in Options.EnclosingType.GetMembers ().OfType<IFieldSymbol> ()) {
+ if (field.IsImplicitlyDeclared)
continue;
yield return field;
}
- foreach (IProperty property in Options.EnclosingType.Properties) {
- if (property.IsSynthetic)
+ foreach (var property in Options.EnclosingType.GetMembers ().OfType<IPropertySymbol> ()) {
+ if (property.IsImplicitlyDeclared)
continue;
- if (property.CanGet)
+ if (property.GetMethod != null)
yield return property;
}
}
-
+
string GetFormatString (IEnumerable<object> includedMembers)
{
var format = new StringBuilder ();
@@ -101,7 +105,7 @@ namespace MonoDevelop.CodeGeneration
format.Append (Options.EnclosingType.Name);
format.Append (": ");
int i = 0;
- foreach (IEntity member in includedMembers) {
+ foreach (ISymbol member in includedMembers) {
if (i > 0)
format.Append (", ");
format.Append (member.Name);
@@ -112,22 +116,37 @@ namespace MonoDevelop.CodeGeneration
format.Append ("]");
return format.ToString ();
}
-
+
protected override IEnumerable<string> GenerateCode (List<object> includedMembers)
{
- yield return new MethodDeclaration () {
- Name = "ToString",
- ReturnType = new PrimitiveType ("string"),
- Modifiers = Modifiers.Public | Modifiers.Override,
- Body = new BlockStatement () {
- new ReturnStatement (
- new InvocationExpression (
- new MemberReferenceExpression (new TypeReferenceExpression (new PrimitiveType ("string")), "Format"),
- new Expression [] { new PrimitiveExpression (GetFormatString (includedMembers)) }.Concat (includedMembers.Select (member => new IdentifierExpression (((IEntity)member).Name)))
+ List<ArgumentSyntax> arguments = new List<ArgumentSyntax> ();
+ arguments.Add (SyntaxFactory.Argument (SyntaxFactory.LiteralExpression (SyntaxKind.StringLiteralExpression, SyntaxFactory.Literal (GetFormatString (includedMembers)))));
+ foreach (ISymbol member in includedMembers) {
+ arguments.Add (SyntaxFactory.Argument (SyntaxFactory.IdentifierName (member.Name)));
+ }
+ var node = SyntaxFactory.MethodDeclaration (
+ SyntaxFactory.List<AttributeListSyntax>(),
+ SyntaxFactory.TokenList (SyntaxFactory.Token (SyntaxKind.PublicKeyword), SyntaxFactory.Token (SyntaxKind.OverrideKeyword)),
+ SyntaxFactory.ParseTypeName ("string"),
+ null,
+ SyntaxFactory.Identifier ("ToString"),
+ null,
+ SyntaxFactory.ParameterList (),
+ SyntaxFactory.List<TypeParameterConstraintClauseSyntax>(),
+ SyntaxFactory.Block (
+ SyntaxFactory.ReturnStatement (
+ SyntaxFactory.InvocationExpression (
+ SyntaxFactory.MemberAccessExpression (
+ SyntaxKind.SimpleMemberAccessExpression,
+ SyntaxFactory.ParseExpression ("string"),
+ SyntaxFactory.IdentifierName ("Format")
+ ),
+ SyntaxFactory.ArgumentList (SyntaxFactory.SeparatedList<ArgumentSyntax> (arguments))
)
)
- }
- }.ToString (Options.FormattingOptions);
+ ),
+ null);
+ yield return Options.OutputNode (node).Result;
}
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/WriteLineGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/WriteLineGenerator.cs
index 3a47fe1d5e..f150e59a13 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/WriteLineGenerator.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/WriteLineGenerator.cs
@@ -25,15 +25,13 @@
// THE SOFTWARE.
using System;
-using MonoDevelop.Components;
-using Gtk;
-using MonoDevelop.Ide.Gui;
using System.Collections.Generic;
-using ICSharpCode.NRefactory.CSharp;
using System.Text;
using MonoDevelop.Core;
-using MonoDevelop.Refactoring;
-using ICSharpCode.NRefactory.TypeSystem;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Simplification;
namespace MonoDevelop.CodeGeneration
{
@@ -77,52 +75,56 @@ namespace MonoDevelop.CodeGeneration
protected override IEnumerable<object> GetValidMembers ()
{
- if (Options == null || Options.EnclosingType == null || Options.EnclosingMember == null || Options.Document == null)
+ if (Options == null || Options.EnclosingType == null)
yield break;
- var editor = Options.Document.Editor;
+ if (Options.EnclosingMember == null)
+ yield break;
+ if (Options.DocumentContext == null)
+ yield break;
+ var editor = Options.Editor;
if (editor == null)
yield break;
-
// add local variables
var state = Options.CurrentState;
if (state != null) {
- foreach (var v in state.LocalVariables)
+ foreach (var v in state.LookupSymbols (editor.CaretOffset).OfType<ILocalSymbol> ())
yield return v;
}
-
+
// add parameters
- if (Options.EnclosingMember is IParameterizedMember) {
- foreach (IParameter param in ((IParameterizedMember)Options.EnclosingMember).Parameters)
+ if (Options.EnclosingMember is IMethodSymbol) {
+ foreach (var param in ((IMethodSymbol)Options.EnclosingMember).Parameters)
yield return param;
}
-
+ if (Options.EnclosingMember is IPropertySymbol) {
+ foreach (var param in ((IPropertySymbol)Options.EnclosingMember).Parameters)
+ yield return param;
+ }
+
// add type members
- foreach (IField field in Options.EnclosingType.Fields) {
- if (field.IsSynthetic)
+ foreach (IFieldSymbol field in Options.EnclosingType.GetMembers ().OfType<IFieldSymbol> ()) {
+ if (field.IsImplicitlyDeclared)
continue;
yield return field;
}
- foreach (IProperty property in Options.EnclosingType.Properties) {
- if (property.IsSynthetic)
+ foreach (IPropertySymbol property in Options.EnclosingType.GetMembers ().OfType<IPropertySymbol> ()) {
+ if (property.IsImplicitlyDeclared)
continue;
- if (property.CanGet)
+ if (property.GetMethod != null)
yield return property;
}
}
static string GetName (object m)
{
- var e = m as IEntity;
- if (e != null)
- return e.Name;
- return ((IVariable)m).Name;
+ return ((ISymbol)m).Name;
}
protected override IEnumerable<string> GenerateCode (List<object> includedMembers)
{
- StringBuilder format = new StringBuilder ();
+ var format = new StringBuilder ();
int i = 0;
foreach (var member in includedMembers) {
if (i > 0)
@@ -132,14 +134,26 @@ namespace MonoDevelop.CodeGeneration
format.Append (i++);
format.Append ("}");
}
-
- var consoleType = typeof (Console).ToTypeReference ().Resolve (Options.Document.Compilation.TypeResolveContext);
- var invocationExpression = new InvocationExpression (new MemberReferenceExpression (new TypeReferenceExpression (Options.CreateShortType (consoleType)), "WriteLine"));
- invocationExpression.Arguments.Add (new PrimitiveExpression (format.ToString ()));
- foreach (var member in includedMembers) {
- invocationExpression.Arguments.Add (new IdentifierExpression (GetName (member)));
- }
- yield return new ExpressionStatement (invocationExpression).ToString (Options.FormattingOptions);
+
+ var arguments = new List<ArgumentSyntax> ();
+ arguments.Add (SyntaxFactory.Argument (SyntaxFactory.LiteralExpression (SyntaxKind.StringLiteralExpression, SyntaxFactory.Literal (format.ToString ()))));
+ var node =
+ SyntaxFactory.ExpressionStatement (
+ SyntaxFactory.InvocationExpression (
+ SyntaxFactory.MemberAccessExpression (SyntaxKind.SimpleMemberAccessExpression,
+ SyntaxFactory.MemberAccessExpression (SyntaxKind.SimpleMemberAccessExpression,
+ SyntaxFactory.IdentifierName ("System"),
+ SyntaxFactory.IdentifierName ("Console")
+ ),
+ SyntaxFactory.IdentifierName ("WriteLine")
+ ),
+ SyntaxFactory.ArgumentList (
+ SyntaxFactory.SeparatedList<ArgumentSyntax> (arguments)
+ )
+ )
+ );
+
+ yield return Options.OutputNode (node).Result;
}
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/CSharpSyntaxContext.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/CSharpSyntaxContext.cs
new file mode 100644
index 0000000000..95efd8254e
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/CSharpSyntaxContext.cs
@@ -0,0 +1,574 @@
+/*
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Reflection;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+using System.Runtime.ExceptionServices;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ public class ReflectionNamespaces
+ {
+ public const string WorkspacesAsmName = ", Microsoft.CodeAnalysis.Workspaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
+ public const string CSWorkspacesAsmName = ", Microsoft.CodeAnalysis.CSharp.Workspaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
+ public const string CAAsmName = ", Microsoft.CodeAnalysis, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
+ public const string CACSharpAsmName = ", Microsoft.CodeAnalysis.CSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
+ }
+
+ public class CSharpSyntaxContext
+ {
+ readonly static Type typeInfoCSharpSyntaxContext;
+ readonly static Type typeInfoAbstractSyntaxContext;
+ readonly static MethodInfo createContextMethod;
+ readonly static PropertyInfo leftTokenProperty;
+ readonly static PropertyInfo targetTokenProperty;
+ readonly static FieldInfo isIsOrAsTypeContextField;
+ readonly static FieldInfo isInstanceContextField;
+ readonly static FieldInfo isNonAttributeExpressionContextField;
+ readonly static FieldInfo isPreProcessorKeywordContextField;
+ readonly static FieldInfo isPreProcessorExpressionContextField;
+ readonly static FieldInfo containingTypeDeclarationField;
+ readonly static FieldInfo isGlobalStatementContextField;
+ readonly static FieldInfo isParameterTypeContextField;
+ readonly static PropertyInfo syntaxTreeProperty;
+
+
+ object instance;
+
+ public SyntaxToken LeftToken {
+ get {
+ return (SyntaxToken)leftTokenProperty.GetValue (instance);
+ }
+ }
+
+ public SyntaxToken TargetToken {
+ get {
+ return (SyntaxToken)targetTokenProperty.GetValue (instance);
+ }
+ }
+
+ public bool IsIsOrAsTypeContext {
+ get {
+ return (bool)isIsOrAsTypeContextField.GetValue (instance);
+ }
+ }
+
+ public bool IsInstanceContext {
+ get {
+ return (bool)isInstanceContextField.GetValue (instance);
+ }
+ }
+
+ public bool IsNonAttributeExpressionContext {
+ get {
+ return (bool)isNonAttributeExpressionContextField.GetValue (instance);
+ }
+ }
+
+ public bool IsPreProcessorKeywordContext {
+ get {
+ return (bool)isPreProcessorKeywordContextField.GetValue (instance);
+ }
+ }
+
+ public bool IsPreProcessorExpressionContext {
+ get {
+ return (bool)isPreProcessorExpressionContextField.GetValue (instance);
+ }
+ }
+
+ public TypeDeclarationSyntax ContainingTypeDeclaration {
+ get {
+ return (TypeDeclarationSyntax)containingTypeDeclarationField.GetValue (instance);
+ }
+ }
+
+ public bool IsGlobalStatementContext {
+ get {
+ return (bool)isGlobalStatementContextField.GetValue (instance);
+ }
+ }
+
+ public bool IsParameterTypeContext {
+ get {
+ return (bool)isParameterTypeContextField.GetValue (instance);
+ }
+ }
+
+ public SyntaxTree SyntaxTree {
+ get {
+ return (SyntaxTree)syntaxTreeProperty.GetValue (instance);
+ }
+ }
+
+
+ readonly static MethodInfo isMemberDeclarationContextMethod;
+
+ public bool IsMemberDeclarationContext (
+ ISet<SyntaxKind> validModifiers = null,
+ ISet<SyntaxKind> validTypeDeclarations = null,
+ bool canBePartial = false,
+ CancellationToken cancellationToken = default(CancellationToken))
+ {
+ try {
+ return (bool)isMemberDeclarationContextMethod.Invoke (instance, new object[] {
+ validModifiers,
+ validTypeDeclarations,
+ canBePartial,
+ cancellationToken
+ });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+
+ readonly static MethodInfo isTypeDeclarationContextMethod;
+
+ public bool IsTypeDeclarationContext (
+ ISet<SyntaxKind> validModifiers = null,
+ ISet<SyntaxKind> validTypeDeclarations = null,
+ bool canBePartial = false,
+ CancellationToken cancellationToken = default(CancellationToken))
+ {
+ try {
+ return (bool)isTypeDeclarationContextMethod.Invoke (instance, new object[] {
+ validModifiers,
+ validTypeDeclarations,
+ canBePartial,
+ cancellationToken
+ });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+
+ readonly static PropertyInfo isPreProcessorDirectiveContextProperty;
+
+ public bool IsPreProcessorDirectiveContext {
+ get {
+ return (bool)isPreProcessorDirectiveContextProperty.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isInNonUserCodeField;
+
+ public bool IsInNonUserCode {
+ get {
+ return (bool)isInNonUserCodeField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isIsOrAsContextField;
+
+ public bool IsIsOrAsContext {
+ get {
+ return (bool)isIsOrAsContextField.GetValue (instance);
+ }
+ }
+
+ readonly static MethodInfo isTypeAttributeContextMethod;
+
+ public bool IsTypeAttributeContext (CancellationToken cancellationToken)
+ {
+ try {
+ return (bool)isTypeAttributeContextMethod.Invoke (instance, new object[] { cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+
+ readonly static PropertyInfo isAnyExpressionContextProperty;
+
+ public bool IsAnyExpressionContext {
+ get {
+ return (bool)isAnyExpressionContextProperty.GetValue (instance);
+ }
+ }
+
+ readonly static PropertyInfo isStatementContextProperty;
+
+ public bool IsStatementContext {
+ get {
+ return (bool)isStatementContextProperty.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isDefiniteCastTypeContextField;
+
+ public bool IsDefiniteCastTypeContext {
+ get {
+ return (bool)isDefiniteCastTypeContextField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isObjectCreationTypeContextField;
+
+ public bool IsObjectCreationTypeContext {
+ get {
+ return (bool)isObjectCreationTypeContextField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isGenericTypeArgumentContextField;
+
+ public bool IsGenericTypeArgumentContext {
+ get {
+ return (bool)isGenericTypeArgumentContextField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isLocalVariableDeclarationContextField;
+
+ public bool IsLocalVariableDeclarationContext {
+ get {
+ return (bool)isLocalVariableDeclarationContextField.GetValue (instance);
+ }
+ }
+
+
+ readonly static FieldInfo isFixedVariableDeclarationContextField;
+
+ public bool IsFixedVariableDeclarationContext {
+ get {
+ return (bool)isFixedVariableDeclarationContextField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isPossibleLambdaOrAnonymousMethodParameterTypeContextField;
+
+ public bool IsPossibleLambdaOrAnonymousMethodParameterTypeContext {
+ get {
+ return (bool)isPossibleLambdaOrAnonymousMethodParameterTypeContextField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isImplicitOrExplicitOperatorTypeContextField;
+
+ public bool IsImplicitOrExplicitOperatorTypeContext {
+ get {
+ return (bool)isImplicitOrExplicitOperatorTypeContextField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isPrimaryFunctionExpressionContextField;
+
+ public bool IsPrimaryFunctionExpressionContext {
+ get {
+ return (bool)isPrimaryFunctionExpressionContextField.GetValue (instance);
+ }
+ }
+
+
+ readonly static FieldInfo isCrefContextField;
+
+ public bool IsCrefContext {
+ get {
+ return (bool)isCrefContextField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isDelegateReturnTypeContextField;
+
+ public bool IsDelegateReturnTypeContext {
+ get {
+ return (bool)isDelegateReturnTypeContextField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isEnumBaseListContextField;
+
+ public bool IsEnumBaseListContext {
+ get {
+ return (bool)isEnumBaseListContextField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isConstantExpressionContextField;
+
+ public bool IsConstantExpressionContext {
+ get {
+ return (bool)isConstantExpressionContextField.GetValue (instance);
+ }
+ }
+
+ readonly static MethodInfo isMemberAttributeContextMethod;
+ public bool IsMemberAttributeContext(ISet<SyntaxKind> validTypeDeclarations, CancellationToken cancellationToken)
+ {
+ try {
+ return (bool)isMemberAttributeContextMethod.Invoke (instance, new object [] {
+ validTypeDeclarations,
+ cancellationToken
+ });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+
+ }
+
+ readonly static FieldInfo precedingModifiersField;
+
+ public ISet<SyntaxKind> PrecedingModifiers {
+ get {
+ return (ISet<SyntaxKind>)precedingModifiersField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isTypeOfExpressionContextField;
+
+ public bool IsTypeOfExpressionContext {
+ get {
+ return (bool)isTypeOfExpressionContextField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo containingTypeOrEnumDeclarationField;
+
+ public BaseTypeDeclarationSyntax ContainingTypeOrEnumDeclaration {
+ get {
+ return (BaseTypeDeclarationSyntax)containingTypeOrEnumDeclarationField.GetValue (instance);
+ }
+ }
+ static readonly PropertyInfo isAttributeNameContextProperty;
+
+ public bool IsAttributeNameContext {
+ get {
+ return (bool)isAttributeNameContextProperty.GetValue (instance);
+ }
+ }
+
+ static readonly PropertyInfo isInQueryProperty;
+ public bool IsInQuery {
+ get {
+ return (bool)isInQueryProperty.GetValue (instance);
+ }
+ }
+
+
+ static CSharpSyntaxContext ()
+ {
+ typeInfoAbstractSyntaxContext = Type.GetType("Microsoft.CodeAnalysis.Shared.Extensions.ContextQuery.AbstractSyntaxContext" + ReflectionNamespaces.WorkspacesAsmName, true);
+ typeInfoCSharpSyntaxContext = Type.GetType ("Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery.CSharpSyntaxContext" + ReflectionNamespaces.CSWorkspacesAsmName, true);
+
+ createContextMethod = typeInfoCSharpSyntaxContext.GetMethod ("CreateContext", BindingFlags.Static | BindingFlags.Public);
+ leftTokenProperty = typeInfoAbstractSyntaxContext.GetProperty ("LeftToken");
+ targetTokenProperty = typeInfoAbstractSyntaxContext.GetProperty ("TargetToken");
+ isIsOrAsTypeContextField = typeInfoCSharpSyntaxContext.GetField ("IsIsOrAsTypeContext");
+ isInstanceContextField = typeInfoCSharpSyntaxContext.GetField ("IsInstanceContext");
+ isNonAttributeExpressionContextField = typeInfoCSharpSyntaxContext.GetField ("IsNonAttributeExpressionContext");
+ isPreProcessorKeywordContextField = typeInfoCSharpSyntaxContext.GetField ("IsPreProcessorKeywordContext");
+ isPreProcessorExpressionContextField = typeInfoCSharpSyntaxContext.GetField ("IsPreProcessorExpressionContext");
+ containingTypeDeclarationField = typeInfoCSharpSyntaxContext.GetField ("ContainingTypeDeclaration");
+ isGlobalStatementContextField = typeInfoCSharpSyntaxContext.GetField ("IsGlobalStatementContext");
+ isParameterTypeContextField = typeInfoCSharpSyntaxContext.GetField ("IsParameterTypeContext");
+ isMemberDeclarationContextMethod = typeInfoCSharpSyntaxContext.GetMethod ("IsMemberDeclarationContext", BindingFlags.Instance | BindingFlags.Public);
+ isTypeDeclarationContextMethod = typeInfoCSharpSyntaxContext.GetMethod ("IsTypeDeclarationContext", BindingFlags.Instance | BindingFlags.Public);
+ syntaxTreeProperty = typeInfoAbstractSyntaxContext.GetProperty ("SyntaxTree");
+ isPreProcessorDirectiveContextProperty = typeInfoAbstractSyntaxContext.GetProperty ("IsPreProcessorDirectiveContext");
+ isInNonUserCodeField = typeInfoCSharpSyntaxContext.GetField ("IsInNonUserCode");
+ isIsOrAsContextField = typeInfoCSharpSyntaxContext.GetField ("IsIsOrAsContext");
+ isTypeAttributeContextMethod = typeInfoCSharpSyntaxContext.GetMethod ("IsTypeAttributeContext", BindingFlags.Instance | BindingFlags.Public);
+ isAnyExpressionContextProperty = typeInfoAbstractSyntaxContext.GetProperty ("IsAnyExpressionContext");
+ isStatementContextProperty = typeInfoAbstractSyntaxContext.GetProperty ("IsStatementContext");
+ isDefiniteCastTypeContextField = typeInfoCSharpSyntaxContext.GetField ("IsDefiniteCastTypeContext");
+ isObjectCreationTypeContextField = typeInfoCSharpSyntaxContext.GetField ("IsObjectCreationTypeContext");
+ isGenericTypeArgumentContextField = typeInfoCSharpSyntaxContext.GetField ("IsGenericTypeArgumentContext");
+ isLocalVariableDeclarationContextField = typeInfoCSharpSyntaxContext.GetField ("IsLocalVariableDeclarationContext");
+ isFixedVariableDeclarationContextField = typeInfoCSharpSyntaxContext.GetField ("IsFixedVariableDeclarationContext");
+ isPossibleLambdaOrAnonymousMethodParameterTypeContextField = typeInfoCSharpSyntaxContext.GetField ("IsPossibleLambdaOrAnonymousMethodParameterTypeContext");
+ isImplicitOrExplicitOperatorTypeContextField = typeInfoCSharpSyntaxContext.GetField ("IsImplicitOrExplicitOperatorTypeContext");
+ isPrimaryFunctionExpressionContextField = typeInfoCSharpSyntaxContext.GetField ("IsPrimaryFunctionExpressionContext");
+ isCrefContextField = typeInfoCSharpSyntaxContext.GetField ("IsCrefContext");
+ isDelegateReturnTypeContextField = typeInfoCSharpSyntaxContext.GetField ("IsDelegateReturnTypeContext");
+ isEnumBaseListContextField = typeInfoCSharpSyntaxContext.GetField ("IsEnumBaseListContext");
+ isConstantExpressionContextField = typeInfoCSharpSyntaxContext.GetField ("IsConstantExpressionContext");
+ isMemberAttributeContextMethod = typeInfoCSharpSyntaxContext.GetMethod ("IsMemberAttributeContext", BindingFlags.Instance | BindingFlags.Public);
+ precedingModifiersField = typeInfoCSharpSyntaxContext.GetField ("PrecedingModifiers");
+ isTypeOfExpressionContextField = typeInfoCSharpSyntaxContext.GetField ("IsTypeOfExpressionContext");
+ containingTypeOrEnumDeclarationField = typeInfoCSharpSyntaxContext.GetField ("ContainingTypeOrEnumDeclaration");
+
+ isAttributeNameContextProperty = typeInfoAbstractSyntaxContext.GetProperty ("IsAttributeNameContext");
+ isInQueryProperty = typeInfoAbstractSyntaxContext.GetProperty ("IsInQuery");
+ }
+
+ public SemanticModel SemanticModel {
+ get;
+ private set;
+ }
+
+ public int Position {
+ get;
+ private set;
+ }
+
+ CSharpSyntaxContext (object instance)
+ {
+ this.instance = instance;
+ }
+
+ public static CSharpSyntaxContext CreateContext (Workspace workspace, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ try {
+ return new CSharpSyntaxContext (createContextMethod.Invoke (null, new object[] {
+ workspace,
+ semanticModel,
+ position,
+ cancellationToken
+ })) {
+ SemanticModel = semanticModel,
+ Position = position
+ };
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+ }
+
+ class CSharpTypeInferenceService
+ {
+ readonly static Type typeInfo;
+ readonly static MethodInfo inferTypesMethod;
+ readonly static MethodInfo inferTypes2Method;
+ readonly object instance;
+
+ static CSharpTypeInferenceService ()
+ {
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.CSharp.CSharpTypeInferenceService" + ReflectionNamespaces.CSWorkspacesAsmName, true);
+
+ inferTypesMethod = typeInfo.GetMethod ("InferTypes", new[] {
+ typeof(SemanticModel),
+ typeof(int),
+ typeof(CancellationToken)
+ });
+ inferTypes2Method = typeInfo.GetMethod ("InferTypes", new[] {
+ typeof(SemanticModel),
+ typeof(SyntaxNode),
+ typeof(CancellationToken)
+ });
+ }
+
+ public CSharpTypeInferenceService ()
+ {
+ instance = Activator.CreateInstance (typeInfo);
+ }
+
+ public IEnumerable<ITypeSymbol> InferTypes (SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ try {
+ return (IEnumerable<ITypeSymbol>)inferTypesMethod.Invoke (instance, new object[] {
+ semanticModel,
+ position,
+ cancellationToken
+ });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ public IEnumerable<ITypeSymbol> InferTypes (SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken)
+ {
+ try {
+ return (IEnumerable<ITypeSymbol>)inferTypes2Method.Invoke (instance, new object[] {
+ semanticModel,
+ expression,
+ cancellationToken
+ });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+
+ public ITypeSymbol InferType(
+ SemanticModel semanticModel,
+ SyntaxNode expression,
+ bool objectAsDefault,
+ CancellationToken cancellationToken)
+ {
+ var types = InferTypes(semanticModel, expression, cancellationToken)
+ .WhereNotNull();
+
+ if (!types.Any())
+ {
+ return objectAsDefault ? semanticModel.Compilation.ObjectType : null;
+ }
+
+ return types.FirstOrDefault();
+ }
+
+
+ public INamedTypeSymbol InferDelegateType(
+ SemanticModel semanticModel,
+ SyntaxNode expression,
+ CancellationToken cancellationToken)
+ {
+ var type = this.InferType(semanticModel, expression, objectAsDefault: false, cancellationToken: cancellationToken);
+ return type.GetDelegateType(semanticModel.Compilation);
+ }
+
+
+ public ITypeSymbol InferType(
+ SemanticModel semanticModel,
+ int position,
+ bool objectAsDefault,
+ CancellationToken cancellationToken)
+ {
+ var types = this.InferTypes(semanticModel, position, cancellationToken)
+ .WhereNotNull();
+
+ if (!types.Any())
+ {
+ return objectAsDefault ? semanticModel.Compilation.ObjectType : null;
+ }
+
+ return types.FirstOrDefault();
+ }
+
+ }
+
+ public class CaseCorrector
+ {
+ readonly static Type typeInfo;
+ readonly static MethodInfo caseCorrectAsyncMethod;
+
+ static CaseCorrector ()
+ {
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.CaseCorrection.CaseCorrector" + ReflectionNamespaces.WorkspacesAsmName, true);
+
+ Annotation = (SyntaxAnnotation)typeInfo.GetField ("Annotation", BindingFlags.Public | BindingFlags.Static).GetValue (null);
+
+ caseCorrectAsyncMethod = typeInfo.GetMethod ("CaseCorrectAsync", new[] {
+ typeof(Document),
+ typeof(SyntaxAnnotation),
+ typeof(CancellationToken)
+ });
+ }
+
+ public static readonly SyntaxAnnotation Annotation;
+
+ public static Task<Document> CaseCorrectAsync (Document document, SyntaxAnnotation annotation, CancellationToken cancellationToken)
+ {
+ try {
+ return (Task<Document>)caseCorrectAsyncMethod.Invoke (null, new object[] { document, annotation, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+ }
+
+
+}
+*/ \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/CodeRefactoring.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/CodeRefactoring.cs
new file mode 100644
index 0000000000..5efc6b7113
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/CodeRefactoring.cs
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using Microsoft.CodeAnalysis.CodeActions;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CodeRefactorings;
+
+namespace RefactoringEssentials
+{
+ /// <summary>
+ /// Represents a set of transformations that can be applied to a piece of code.
+ /// </summary>
+ class CodeRefactoring //: ICodeRefactoring
+ {
+ private readonly CodeRefactoringProvider _provider;
+ private readonly IReadOnlyList<CodeAction> _actions;
+
+ public CodeRefactoringProvider Provider
+ {
+ get { return _provider; }
+ }
+
+ /// <summary>
+ /// List of possible actions that can be used to transform the code.
+ /// </summary>
+ public IEnumerable<CodeAction> Actions
+ {
+ get
+ {
+ return _actions;
+ }
+ }
+
+ public CodeRefactoring(CodeRefactoringProvider provider, IEnumerable<CodeAction> actions)
+ {
+ _provider = provider;
+ _actions = actions.ToImmutableArray();
+
+ if (_actions.Count == 0)
+ {
+ throw new ArgumentException("Actions can not be empty", "actions");
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/ConvertToEnum/ConvertToEnumCodeRefactoringProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/ConvertToEnum/ConvertToEnumCodeRefactoringProvider.cs
new file mode 100644
index 0000000000..7338da42f4
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/ConvertToEnum/ConvertToEnumCodeRefactoringProvider.cs
@@ -0,0 +1,504 @@
+//
+// Author:
+// Luís Reis <luiscubal@gmail.com>
+//
+// Copyright (c) 2013 Luís Reis
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using ICSharpCode.NRefactory.Semantics;
+using ICSharpCode.NRefactory.TypeSystem;
+using ICSharpCode.NRefactory.TypeSystem.Implementation;
+using ICSharpCode.NRefactory.PatternMatching;
+using MonoDevelop.CodeActions;
+using ICSharpCode.NRefactory;
+using System.Threading;
+using ICSharpCode.NRefactory.CSharp;
+using ICSharpCode.NRefactory.CSharp.Refactoring;
+using ICSharpCode.Decompiler.ILAst;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Editor;
+
+namespace MonoDevelop.CSharp.Refactoring.CodeActions
+{
+ /// <summary>
+ /// Generates an enumeration from const fields
+ /// </summary>
+ class ConvertToEnumAction : MonoDevelop.CodeActions.CodeActionProvider
+ {
+ public override IEnumerable<MonoDevelop.CodeActions.CodeAction> GetActions (TextEditor editor, DocumentContext doc, object refactoringContext, MonoDevelop.Ide.Editor.DocumentLocation loc, CancellationToken cancellationToken)
+ {
+ var mdCtx = refactoringContext as MDRefactoringContext;
+
+ if (mdCtx == null || mdCtx.IsInvalid)
+ yield break;
+
+ VariableInitializer currentVariable = mdCtx.GetNode<VariableInitializer>();
+ if (currentVariable == null) {
+ yield break;
+ }
+
+ FieldDeclaration currentField = currentVariable.Parent as FieldDeclaration;
+ if (currentField == null) {
+ yield break;
+ }
+
+ if (!currentField.Modifiers.HasFlag(Modifiers.Const)) {
+ yield break;
+ }
+
+ PrimitiveType baseType = TypeToIntegerPrimitive(mdCtx, currentField.ReturnType);
+ if (baseType == null) {
+ //Can't make enums of these types
+ yield break;
+ }
+
+ TypeDeclaration containerType = currentVariable.GetParent<TypeDeclaration>();
+
+ //Get all the fields/variables that the enum can possibly cover
+ //Don't check the name just yet. That'll come later.
+
+ var constFields = containerType.Members.OfType<FieldDeclaration>()
+ .Where(field => field.GetParent<TypeDeclaration>() == containerType && field.HasModifier(Modifiers.Const)).ToList();
+
+ var constVariables = constFields.SelectMany(field => field.Variables).ToList();
+
+ //Now, it's time to check the name of the selected variable
+ //We'll use this to search for prefixes later
+
+ var names = constVariables.Select(variable => variable.Name).ToList();
+ string currentName = currentVariable.Name;
+
+ //Now, find the common name prefixes
+ //If the variable is called 'A_B_C_D', then 'A', 'A_B' and 'A_B_C' are
+ //the potentially available prefixes.
+ //Note that the common prefixes are the ones that more than one variable
+ //has.
+ //Each prefix has an associated action.
+
+ foreach (var prefix in GetCommonPrefixes (currentName, names)) {
+ string title = string.Format(GettextCatalog.GetString("Create enum '{0}'"), prefix);
+
+ yield return new DefaultCodeAction(title, (ctx, script) => {
+ PrepareToRunAction (prefix, baseType, containerType, constVariables, cancellationToken, ctx, script);
+ });
+ }
+ }
+
+ void PrepareToRunAction (string prefix, PrimitiveType baseType, TypeDeclaration containerType, List<VariableInitializer> variables, CancellationToken cancellationToken, RefactoringContext context, Script script)
+ {
+ List<string> names = variables.Select(variable => variable.Name).ToList();
+ Dictionary<string, string> newNames = names.ToDictionary(originalName => originalName, originalName => {
+ if (!originalName.StartsWith(prefix)) {
+ return originalName;
+ }
+ int startName = prefix.Length;
+ while (startName < originalName.Length - 1 && originalName[startName] == '_') {
+ ++startName;
+ }
+ return originalName.Substring(startName);
+ });
+
+ string enumName;
+ using (var dialog = new ConvertToEnumDialog (prefix, variables, variables.Where(variable => variable.Name.StartsWith(prefix, StringComparison.InvariantCulture)
+ && VariableHasSpecifiedIntegerType(context, variable, baseType)).ToList(), newNames))
+ {
+ if (dialog.Run (/*MonoDevelop.Ide.IdeApp.Workbench.RootWindow*/) != Xwt.Command.Ok) {
+ return;
+ }
+ enumName = dialog.EnumName;
+ variables = dialog.SelectedVariables;
+ newNames = dialog.NewNames;
+ }
+
+ RunAction (context, baseType, enumName, newNames, containerType, variables, script);
+
+ }
+
+ void RunAction(RefactoringContext context, AstType baseType, string enumName, Dictionary<string, string> newNames, TypeDeclaration containerTypeDeclaration, List<VariableInitializer> variables, Script script)
+ {
+ var names = variables.Select (variable => variable.Name).ToList ();
+ var containerType = (context.Resolve(containerTypeDeclaration) as TypeResolveResult).Type;
+
+ var fields = containerTypeDeclaration.Members.OfType<FieldDeclaration>().Where(field => field.Modifiers.HasFlag(Modifiers.Const)).ToList();
+ List<VariableInitializer> variableUnitsToRemove = new List<VariableInitializer>(variables);
+ List<FieldDeclaration> fieldsToRemove = new List<FieldDeclaration>();
+
+ foreach (var field in fields) {
+ if (field.Variables.All(variableUnitsToRemove.Contains)) {
+ fieldsToRemove.Add(field);
+
+ variableUnitsToRemove.RemoveAll(field.Variables.Contains);
+ }
+ }
+
+ var generatedEnum = CreateEnumDeclaration(baseType, enumName, variables, names, newNames);
+
+ AstNode root = GetRootNodeOf(containerTypeDeclaration);
+ var newRoot = root.Clone();
+
+ FixIdentifiers(context, enumName, variables, containerType, baseType, names, newNames, root, newRoot);
+ foreach (var member in root.Descendants.OfType<MemberReferenceExpression>().Where (member => names.Contains (member.MemberName))) {
+ if (variables.Any(variable => variable.Descendants.Contains(member))) {
+ //Already handled
+ continue;
+ }
+
+ var resolvedIdentifier = context.Resolve(member) as MemberResolveResult;
+ if (resolvedIdentifier == null) {
+ continue;
+ }
+
+ if (resolvedIdentifier.Type.Equals(containerType)) {
+ continue;
+ }
+
+ var equivalentMember = GetEquivalentNodeFor(root, newRoot, member);
+ MemberReferenceExpression memberToReplace = (MemberReferenceExpression)equivalentMember;
+
+ var replacement = CreateReplacementMemberReference(enumName, baseType, newNames, memberToReplace);
+ memberToReplace.ReplaceWith(replacement);
+ }
+
+ //Fix the file
+ InsertAfterEquivalent(root, newRoot, containerTypeDeclaration.LBraceToken, generatedEnum, Roles.TypeMemberRole);
+
+ foreach (var variableToRemove in variableUnitsToRemove) {
+ GetEquivalentNodeFor(root, newRoot, variableToRemove).Remove();
+ }
+ foreach (var fieldToRemove in fieldsToRemove) {
+ GetEquivalentNodeFor(root, newRoot, fieldToRemove).Remove();
+ }
+
+ script.Replace(root, newRoot);
+
+ ReplaceVariableReferences(context, root, baseType, enumName, script, newNames, variables);
+ }
+
+ static void ReplaceVariableReferences(RefactoringContext context, AstNode root, AstType baseType, string enumName, Script script, Dictionary<string, string> newNames, IEnumerable<VariableInitializer> variables)
+ {
+ var resolveResults = variables.Select(variable => (MemberResolveResult)context.Resolve(variable));
+ var resolvedFields = resolveResults.Select(resolveResult => resolveResult.Member);
+ script.DoGlobalOperationOn(resolvedFields, (newCtx, newScript, foundNodes) => {
+ foreach (var foundNode in foundNodes) {
+ TypeDeclaration newContainerType = foundNode.GetParent<TypeDeclaration>();
+ if (root.Descendants.OfType<TypeDeclaration>().Select(type => ((TypeResolveResult)context.Resolve(type)).Type.FullName).ToList().Contains(((TypeResolveResult)newCtx.Resolve(newContainerType)).Type.FullName)) {
+ //This file has already been fixed
+ return;
+ }
+ var identifierExpr = foundNode as IdentifierExpression;
+ if (identifierExpr != null) {
+ newScript.Replace(identifierExpr, CreateIdentifierReplacement(enumName, baseType, newNames, identifierExpr));
+ continue;
+ }
+ var memberRef = foundNode as MemberReferenceExpression;
+ if (memberRef != null) {
+ var replacement = CreateReplacementMemberReference(enumName, baseType, newNames, memberRef);
+ newScript.Replace(memberRef, replacement);
+ }
+ }
+ });
+ }
+
+ TypeDeclaration CreateEnumDeclaration(AstType baseType, string enumName, List<VariableInitializer> variables, List<string> names, Dictionary<string, string> newNames)
+ {
+ TypeDeclaration generatedEnum = new TypeDeclaration();
+ generatedEnum.ClassType = ClassType.Enum;
+ generatedEnum.BaseTypes.Add(baseType.Clone());
+ generatedEnum.Name = enumName;
+ generatedEnum.Modifiers = GetCombinedModifier((Modifiers)variables.Select(variable => ((FieldDeclaration)variable.Parent).Modifiers).Aggregate(0, (prev, newModifier) => prev | (int)newModifier));
+ foreach (var variable in variables) {
+ var generatedMember = new EnumMemberDeclaration();
+ generatedMember.Name = newNames[variable.Name];
+ var value = variable.Initializer.Clone();
+ foreach (var identifier in value.DescendantsAndSelf.OfType<IdentifierExpression>().Where(identifier => names.Contains(identifier.Identifier))) {
+ var newIdentifier = new IdentifierExpression(newNames[identifier.Identifier]);
+ if (identifier == value) {
+ value = newIdentifier;
+ break;
+ }
+ identifier.ReplaceWith(newIdentifier);
+ }
+ generatedMember.Initializer = value;
+ generatedEnum.Members.Add(generatedMember);
+ }
+ return generatedEnum;
+ }
+
+ /// <summary>
+ /// Determines whether the initialized variable has the specified primitive integer type
+ /// </summary>
+ /// <returns><c>true</c> if the initialized variable has the specified type; otherwise, <c>false</c>.</returns>
+ /// <param name="context">The context to use.</param>
+ /// <param name="variable">The variable initializer to check.</param>
+ /// <param name="type">The type to compare with.</param>
+ bool VariableHasSpecifiedIntegerType(RefactoringContext context, VariableInitializer variable, AstType type)
+ {
+ return TypeToIntegerPrimitive(context, variable.GetParent<FieldDeclaration>().ReturnType).Match(type).Success;
+ }
+
+ static Dictionary<string, PrimitiveType> primitiveTypes = new Dictionary<string, PrimitiveType>();
+
+ static ConvertToEnumAction()
+ {
+ primitiveTypes.Add(typeof(byte).FullName, new PrimitiveType("byte"));
+ primitiveTypes.Add(typeof(sbyte).FullName, new PrimitiveType("sbyte"));
+
+ primitiveTypes.Add(typeof(short).FullName, new PrimitiveType("short"));
+ primitiveTypes.Add(typeof(int).FullName, new PrimitiveType("int"));
+ primitiveTypes.Add(typeof(long).FullName, new PrimitiveType("long"));
+
+ primitiveTypes.Add(typeof(ushort).FullName, new PrimitiveType("ushort"));
+ primitiveTypes.Add(typeof(uint).FullName, new PrimitiveType("uint"));
+ primitiveTypes.Add(typeof(ulong).FullName, new PrimitiveType("ulong"));
+ }
+
+ /// <summary>
+ /// Gets a PrimitiveType instance from an AstType.
+ /// Only returns integer types (and never the char type)
+ /// </summary>
+ /// <returns>The integer primitive.</returns>
+ /// <param name="context">The context to use.</param>
+ /// <param name="type">The AstType to get the primitive from.</param>
+ PrimitiveType TypeToIntegerPrimitive(RefactoringContext context, AstType type)
+ {
+ var resolvedType = context.ResolveType(type) as DefaultResolvedTypeDefinition;
+
+ PrimitiveType primitiveType;
+ if (!primitiveTypes.TryGetValue(resolvedType.FullName, out primitiveType)) {
+ return null;
+ }
+
+ return primitiveType;
+ }
+
+ static Expression CreateReplacementMemberReference(string enumName, AstType baseType, Dictionary<string, string> newNames, MemberReferenceExpression memberToReplace)
+ {
+ return new ParenthesizedExpression(new CastExpression(baseType.Clone(), new MemberReferenceExpression(new MemberReferenceExpression(memberToReplace.Target.Clone(), enumName), newNames [memberToReplace.MemberName])));
+ }
+
+ void FixIdentifiers(RefactoringContext context, string enumName, List<VariableInitializer> variables, IType containerType, AstType baseType, List<string> names, Dictionary<string, string> newNames, AstNode root, AstNode newRoot)
+ {
+ foreach (var identifier in root.Descendants.OfType<IdentifierExpression> ().Where (identifier => names.Contains (identifier.Identifier))) {
+ if (variables.Any(variable => variable.Descendants.Contains(identifier))) {
+ //Already handled
+ continue;
+ }
+ var resolvedIdentifier = context.Resolve(identifier) as MemberResolveResult;
+ if (resolvedIdentifier == null) {
+ continue;
+ }
+ if (resolvedIdentifier.Type.Equals(containerType)) {
+ continue;
+ }
+ var replacement = CreateIdentifierReplacement(enumName, baseType, newNames, identifier);
+ GetEquivalentNodeFor(root, newRoot, identifier).ReplaceWith(replacement);
+ }
+ }
+
+ static ParenthesizedExpression CreateIdentifierReplacement(string enumName, AstType baseType, Dictionary<string, string> newNames, IdentifierExpression identifier)
+ {
+ var replacement = new ParenthesizedExpression(new CastExpression(baseType.Clone(), new MemberReferenceExpression(new IdentifierExpression(enumName), newNames [identifier.Identifier])));
+ return replacement;
+ }
+
+ /// <summary>
+ /// Finds the corresponding node in another ("new") AST.
+ /// Assumes entities have not been renamed and no statements have been removed.
+ /// </summary>
+ /// <returns>The equivalent node in the new AST.</returns>
+ /// <param name="root">The root of the first ("old") AST.</param>
+ /// <param name="newRoot">The root of the new AST.</param>
+ /// <param name="nodeToFind">Node (from the old AST) to find in the new one.</param>
+ AstNode GetEquivalentNodeFor(AstNode root, AstNode newRoot, AstNode nodeToFind)
+ {
+ if (nodeToFind == null) {
+ throw new ArgumentNullException("nodeToFind");
+ }
+
+ if (nodeToFind.Parent != root) {
+ AstNode foundRoot = GetEquivalentNodeFor(root, newRoot, nodeToFind.Parent);
+ if (foundRoot == null) {
+ //If the equivalent of the parent does not exist in the new AST,
+ //then neither does this node.
+ return null;
+ }
+ newRoot = foundRoot;
+ root = nodeToFind.Parent;
+ }
+
+ //At this point, the roots are the parents of the nodes to check
+ //root is the parent of the nodeToFind, and newRoot is the parent of the node to return
+
+ var block = root as BlockStatement;
+ if (block != null && nodeToFind.Role == BlockStatement.StatementRole) {
+ //This could be a problem if statements were removed in the new AST,
+ //but fortunately that's not the problem we're trying to solve.
+ return ((BlockStatement)newRoot).Statements.ElementAt(block.TakeWhile(statement => statement != nodeToFind).Count());
+ }
+
+ //First, we'll narrow down the search - the equivalent node *always* has the same type and role as nodeToFind
+ //The Role check will help e.g. in binary expressions (where there is a 'Left' and a 'Right' role)
+ var candidates = newRoot.Children.Where(child => child.GetType() == nodeToFind.GetType() && child.Role == nodeToFind.Role);
+ var entity = nodeToFind as EntityDeclaration;
+ if (entity != null) {
+ var field = nodeToFind as FieldDeclaration;
+ if (field != null) {
+ //Fields have to be treated separately because fields have no names
+ candidates = candidates.Where(candidate => IsEquivalentField((FieldDeclaration) candidate, field));
+ }
+ else {
+ //Some entities can be distinguished by name.
+ candidates = candidates.Where(candidate => ((EntityDeclaration)candidate).Name == entity.Name);
+
+ var method = nodeToFind as MethodDeclaration;
+ if (method != null) {
+ //Methods, however, can be overloaded - so their names aren't enough.
+ candidates = candidates.Where(candidate => CheckIfMethodsHaveSameParameters((MethodDeclaration) candidate, method));
+ }
+ }
+ }
+
+ var ns = nodeToFind as NamespaceDeclaration;
+ if (ns != null) {
+ candidates = candidates.Where(candidate => ((NamespaceDeclaration)candidate).Name == ns.Name).ToList();
+ if (candidates.Count() > 1) {
+ throw new NotImplementedException("Two or more namespace declarations with the same name are siblings. This case is not currently supported by this action.");
+ }
+ }
+
+ var initializer = nodeToFind as VariableInitializer;
+ if (initializer != null) {
+ candidates = candidates.Where(candidate => ((VariableInitializer)candidate).Name == initializer.Name);
+ }
+
+ var equivalentNode = candidates.SingleOrDefault();
+ return equivalentNode;
+ }
+
+ bool IsEquivalentField(FieldDeclaration field1, FieldDeclaration field2) {
+ return field1.Variables.Any(variable1 => {
+ return field2.Variables.Any(variable2 => variable1.Name == variable2.Name);
+ });
+ }
+
+ bool CheckIfMethodsHaveSameParameters(MethodDeclaration methodDeclaration, MethodDeclaration comparedMethod)
+ {
+ if (methodDeclaration.Parameters.Count != comparedMethod.Parameters.Count) {
+ return false;
+ }
+
+ ParameterDeclaration param1 = methodDeclaration.Parameters.FirstOrDefault();
+ ParameterDeclaration param2 = comparedMethod.Parameters.FirstOrDefault();
+
+ while (param1 != null) {
+ //If the names or initializers are different, this will still match.
+ //But if the type or order changes, this will complain
+ if (!param1.Type.Match(param2.Type).Success) {
+ return false;
+ }
+
+ param1 = (ParameterDeclaration) param1.GetNextSibling(node => node is ParameterDeclaration);
+ param2 = (ParameterDeclaration) param2.GetNextSibling(node => node is ParameterDeclaration);
+ }
+
+ return true;
+ }
+
+ void InsertAfterEquivalent<T>(AstNode root, AstNode newRoot, AstNode prevNode, T newNode, Role<T> role)
+ where T : AstNode
+ {
+ AstNode equivalentPrevNode = GetEquivalentNodeFor(root, newRoot, prevNode);
+ equivalentPrevNode.Parent.InsertChildAfter<T>(equivalentPrevNode, newNode, role);
+ }
+
+ /// <summary>
+ /// Gets the least permissive access modifier that still allows access to
+ /// fields or methods with the specified modifiers.
+ /// This will ignore all modifiers unrelated to access - such as const and readonly
+ /// </summary>
+ /// <returns>A modifier that is at least as permissive as all provided modifiers.</returns>
+ /// <param name="modifiers">The modifiers to use.</param>
+ Modifiers GetCombinedModifier(Modifiers modifiers)
+ {
+ if (modifiers.HasFlag(Modifiers.Public))
+ return Modifiers.Public;
+
+ Modifiers combinedModifier = 0;
+ if (modifiers.HasFlag(Modifiers.Protected)) {
+ combinedModifier |= Modifiers.Protected;
+ }
+ if (modifiers.HasFlag(Modifiers.Internal)) {
+ combinedModifier |= Modifiers.Internal;
+ }
+
+ //No modifier if the fields are all private.
+ return combinedModifier;
+ }
+
+ /// <summary>
+ /// Gets all prefixes that more than one name have.
+ /// </summary>
+ /// <returns>The common prefixes.</returns>
+ /// <param name="currentName">The name to use.</param>
+ /// <param name="names">The names to check.</param>
+ IEnumerable<string> GetCommonPrefixes(string currentName, IEnumerable<string> names)
+ {
+ //Find the indexes that 'split' words in the variable name
+ var boundariesForCurrentWord = GetWordsBoundaries(currentName);
+
+ //Get the candidate prefixes
+ List<string> proposedPrefixes = boundariesForCurrentWord.Select(boundary => currentName.Substring(0, boundary)).ToList();
+
+ //Return only the prefixes that more than one variable has.
+ return proposedPrefixes.Where(prefix => names.Count(name => name.StartsWith(prefix, StringComparison.InvariantCulture)) > 1);
+ }
+
+ List<int> GetWordsBoundaries(string name)
+ {
+ List<int> foundBoundaries = new List<int>();
+ for (int i = 1; i < name.Length - 1; ++i) {
+ char chr = name [i];
+ if (chr == '_') {
+ foundBoundaries.Add(i);
+ continue;
+ }
+
+ if (char.IsUpper(chr) && char.IsLower(name [i - 1])) {
+ foundBoundaries.Add(i);
+ continue;
+ }
+ }
+
+ return foundBoundaries;
+ }
+
+ AstNode GetRootNodeOf(AstNode node)
+ {
+ while (node.Parent != null) {
+ node = node.Parent;
+ }
+
+ return node;
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/Actions/ConvertToEnumDialog.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/ConvertToEnum/ConvertToEnumDialog.cs
index 26c3a299a2..26c3a299a2 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/Actions/ConvertToEnumDialog.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/ConvertToEnum/ConvertToEnumDialog.cs
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/ExtractMethod/ExtractMethodCodeRefactoringProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/ExtractMethod/ExtractMethodCodeRefactoringProvider.cs
new file mode 100644
index 0000000000..3ce95e78c7
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/ExtractMethod/ExtractMethodCodeRefactoringProvider.cs
@@ -0,0 +1,105 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Composition;
+using Microsoft.CodeAnalysis.CodeRefactorings;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using System;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.Text;
+using System.Threading;
+using ICSharpCode.NRefactory6.CSharp.ExtractMethod;
+using RefactoringEssentials;
+using MonoDevelop.Core;
+using MonoDevelop.Ide;
+using ICSharpCode.NRefactory6.CSharp;
+
+namespace MonoDevelop.CSharp.CodeRefactorings.ExtractMethod
+{
+ [ExportCodeRefactoringProvider(LanguageNames.CSharp, Name = PredefinedCodeRefactoringProviderNames.ExtractMethod), Shared]
+ internal class ExtractMethodCodeRefactoringProvider : CodeRefactoringProvider
+ {
+ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
+ {
+ // Don't bother if there isn't a selection
+ var textSpan = context.Span;
+ if (textSpan.IsEmpty)
+ {
+ return;
+ }
+ var document = context.Document;
+ var cancellationToken = context.CancellationToken;
+
+ var workspace = document.Project.Solution.Workspace;
+ if (workspace.Kind == WorkspaceKind.MiscellaneousFiles)
+ {
+ return;
+ }
+ if (IdeApp.Workbench.ActiveDocument == null || IdeApp.Workbench.ActiveDocument.Editor == null)
+ return;
+ var activeInlineRenameSession = IdeApp.Workbench.ActiveDocument.Editor.EditMode != MonoDevelop.Ide.Editor.EditMode.Edit;
+ if (activeInlineRenameSession)
+ {
+ return;
+ }
+ var model = await context.Document.GetSemanticModelAsync (context.CancellationToken).ConfigureAwait (false);
+ if (model.IsFromGeneratedCode (context.CancellationToken))
+ return;
+
+ if (cancellationToken.IsCancellationRequested)
+ {
+ return;
+ }
+
+ var action = await GetCodeActionAsync(document, textSpan, cancellationToken: cancellationToken).ConfigureAwait(false);
+ if (action == null)
+ {
+ return;
+ }
+
+ context.RegisterRefactoring(action.Item1);
+ }
+
+ static CSharpExtractMethodService service = new CSharpExtractMethodService ();
+
+ private async Task<Tuple<CodeAction, string>> GetCodeActionAsync(
+ Document document,
+ TextSpan textSpan,
+ CancellationToken cancellationToken)
+ {
+ var options = document.Project.Solution.Workspace.Options;
+ try {
+ var result = await service.ExtractMethodAsync(
+ document,
+ textSpan,
+ options,
+ cancellationToken).ConfigureAwait(false);
+
+ if (result.Succeeded || result.SucceededWithSuggestion)
+ {
+ var description = options.GetOption(ExtractMethodOptions.AllowMovingDeclaration, document.Project.Language) ?
+ GettextCatalog.GetString ("Extract Method + Local") : GettextCatalog.GetString ("Extract Method");
+
+ var codeAction = new DocumentChangeAction(textSpan, DiagnosticSeverity.Info, description, (c) => AddRenameAnnotationAsync(result.Document, result.InvocationNameToken, c));
+ var methodBlock = result.MethodDeclarationNode;
+
+ return Tuple.Create<CodeAction, string>(codeAction, methodBlock.ToString());
+ }
+ } catch (Exception) {
+ // currently the extract method refactoring crashes often. Ignore the roslyn issues for now.
+ }
+ return null;
+ }
+
+ private async Task<Document> AddRenameAnnotationAsync(Document document, SyntaxToken invocationNameToken, CancellationToken cancellationToken)
+ {
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+
+ var finalRoot = root.ReplaceToken(
+ invocationNameToken,
+ invocationNameToken.WithAdditionalAnnotations(RenameAnnotation.Create()));
+
+ return document.WithSyntaxRoot(finalRoot);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/InlineTemporary/InlineTemporaryCodeRefactoringProvider.InitializerRewriter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/InlineTemporary/InlineTemporaryCodeRefactoringProvider.InitializerRewriter.cs
new file mode 100644
index 0000000000..6ab7a54616
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/InlineTemporary/InlineTemporaryCodeRefactoringProvider.InitializerRewriter.cs
@@ -0,0 +1,105 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Simplification;
+using Microsoft.CodeAnalysis.CSharp;
+using ICSharpCode.NRefactory6.CSharp;
+
+namespace MonoDevelop.CSharp.CodeRefactorings.InlineTemporary
+{
+ internal partial class InlineTemporaryCodeRefactoringProvider
+ {
+ /// <summary>
+ /// This class handles rewriting initializer expressions that refer to the variable
+ /// being initialized into a simpler form. For example, in "int x = x = 1", we want to
+ /// get just "1" back as the initializer.
+ /// </summary>
+ private class InitializerRewriter : CSharpSyntaxRewriter
+ {
+ private readonly SemanticModel _semanticModel;
+ private readonly ILocalSymbol _localSymbol;
+
+ private InitializerRewriter(ExpressionSyntax initializer, ILocalSymbol localSymbol, SemanticModel semanticModel)
+ {
+ _semanticModel = semanticModel;
+ _localSymbol = localSymbol;
+ }
+
+ private bool IsReference(SimpleNameSyntax name)
+ {
+ if (name.Identifier.ValueText != _localSymbol.Name)
+ {
+ return false;
+ }
+
+ var symbol = _semanticModel.GetSymbolInfo(name).Symbol;
+ return symbol != null
+ && symbol.Equals(_localSymbol);
+ }
+
+ public override SyntaxNode VisitAssignmentExpression(AssignmentExpressionSyntax node)
+ {
+ // Note - leave this as SyntaxNode for now, we might have already re-written it
+ var newNode = base.VisitAssignmentExpression(node);
+
+ if (newNode.Kind() == SyntaxKind.SimpleAssignmentExpression)
+ {
+ // It's okay to just look at the text, since we're explicitly looking for an
+ // identifier standing alone, and we know we're in a local's initializer.
+ // The text can only bind to the initializer.
+ var assignment = (AssignmentExpressionSyntax)newNode;
+ var name = assignment.Left.Kind() == SyntaxKind.IdentifierName
+ ? (IdentifierNameSyntax)assignment.Left
+ : null;
+
+ if (name != null && IsReference(name))
+ {
+ return assignment.Right;
+ }
+ }
+
+ return newNode;
+ }
+
+ public override SyntaxNode VisitIdentifierName(IdentifierNameSyntax node)
+ {
+ if (IsReference(node))
+ {
+ var assignmentExpression = node.Parent as AssignmentExpressionSyntax;
+ if (assignmentExpression != null)
+ {
+ if (assignmentExpression.IsCompoundAssignExpression() &&
+ assignmentExpression.Left == node)
+ {
+ return node.Update(node.Identifier.WithAdditionalAnnotations(CreateConflictAnnotation()));
+ }
+ }
+ }
+
+ return base.VisitIdentifierName(node);
+ }
+
+ public override SyntaxNode VisitParenthesizedExpression(ParenthesizedExpressionSyntax node)
+ {
+ var newNode = base.VisitParenthesizedExpression(node);
+
+ if (node != newNode && newNode.Kind() == SyntaxKind.ParenthesizedExpression)
+ {
+ return newNode.WithAdditionalAnnotations(Simplifier.Annotation);
+ }
+
+ return newNode;
+ }
+
+ public static ExpressionSyntax Visit(ExpressionSyntax initializer, ILocalSymbol local, SemanticModel semanticModel)
+ {
+ var simplifier = new InitializerRewriter(initializer, local, semanticModel);
+ return (ExpressionSyntax)simplifier.Visit(initializer);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/InlineTemporary/InlineTemporaryCodeRefactoringProvider.ReferenceRewriter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/InlineTemporary/InlineTemporaryCodeRefactoringProvider.ReferenceRewriter.cs
new file mode 100644
index 0000000000..16d712e672
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/InlineTemporary/InlineTemporaryCodeRefactoringProvider.ReferenceRewriter.cs
@@ -0,0 +1,106 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Simplification;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace MonoDevelop.CSharp.CodeRefactorings.InlineTemporary
+{
+ internal partial class InlineTemporaryCodeRefactoringProvider
+ {
+ private class ReferenceRewriter : CSharpSyntaxRewriter
+ {
+ private readonly SemanticModel _semanticModel;
+ private readonly ILocalSymbol _localSymbol;
+ private readonly VariableDeclaratorSyntax _variableDeclarator;
+ private readonly ExpressionSyntax _expressionToInline;
+ private readonly CancellationToken _cancellationToken;
+
+ private ReferenceRewriter(
+ SemanticModel semanticModel,
+ VariableDeclaratorSyntax variableDeclarator,
+ ExpressionSyntax expressionToInline,
+ CancellationToken cancellationToken)
+ {
+ _semanticModel = semanticModel;
+ _localSymbol = (ILocalSymbol)semanticModel.GetDeclaredSymbol(variableDeclarator, cancellationToken);
+ _variableDeclarator = variableDeclarator;
+ _expressionToInline = expressionToInline;
+ _cancellationToken = cancellationToken;
+ }
+
+ private bool IsReference(SimpleNameSyntax name)
+ {
+ if (name.Identifier.ValueText != _variableDeclarator.Identifier.ValueText)
+ {
+ return false;
+ }
+
+ var symbol = _semanticModel.GetSymbolInfo(name).Symbol;
+ return symbol != null
+ && symbol.Equals(_localSymbol);
+ }
+
+ public override SyntaxNode VisitIdentifierName(IdentifierNameSyntax node)
+ {
+ _cancellationToken.ThrowIfCancellationRequested();
+
+ if (IsReference(node))
+ {
+ if (HasConflict(node, _variableDeclarator))
+ {
+ return node.Update(node.Identifier.WithAdditionalAnnotations(CreateConflictAnnotation()));
+ }
+
+ return _expressionToInline
+ .Parenthesize()
+ .WithAdditionalAnnotations(Formatter.Annotation, Simplifier.Annotation);
+ }
+
+ return base.VisitIdentifierName(node);
+ }
+
+ public override SyntaxNode VisitAnonymousObjectMemberDeclarator(AnonymousObjectMemberDeclaratorSyntax node)
+ {
+ var nameEquals = node.NameEquals;
+ var expression = node.Expression;
+ var identifier = expression as IdentifierNameSyntax;
+
+ if (nameEquals != null || identifier == null || !IsReference(identifier) || HasConflict(identifier, _variableDeclarator))
+ {
+ return base.VisitAnonymousObjectMemberDeclarator(node);
+ }
+
+ // Special case inlining into anonymous types to ensure that we keep property names:
+ //
+ // E.g.
+ // int x = 42;
+ // var a = new { x; };
+ //
+ // Should become:
+ // var a = new { x = 42; };
+ nameEquals = SyntaxFactory.NameEquals(identifier);
+ expression = (ExpressionSyntax)this.Visit(expression);
+ return node.Update(nameEquals, expression).WithAdditionalAnnotations(Simplifier.Annotation, Formatter.Annotation);
+ }
+
+ public static SyntaxNode Visit(
+ SemanticModel semanticModel,
+ SyntaxNode scope,
+ VariableDeclaratorSyntax variableDeclarator,
+ ExpressionSyntax expressionToInline,
+ CancellationToken cancellationToken)
+ {
+ var rewriter = new ReferenceRewriter(semanticModel, variableDeclarator, expressionToInline, cancellationToken);
+ return rewriter.Visit(scope);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/InlineTemporary/InlineTemporaryCodeRefactoringProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/InlineTemporary/InlineTemporaryCodeRefactoringProvider.cs
new file mode 100644
index 0000000000..0d1a5c6a68
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/InlineTemporary/InlineTemporaryCodeRefactoringProvider.cs
@@ -0,0 +1,575 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Composition;
+using System.Diagnostics;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CodeRefactorings;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.FindSymbols;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Simplification;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp;
+using RefactoringEssentials;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.CSharp.CodeRefactorings.InlineTemporary
+{
+ [ExportCodeRefactoringProvider(LanguageNames.CSharp, Name = PredefinedCodeRefactoringProviderNames.InlineTemporary), Shared]
+ internal partial class InlineTemporaryCodeRefactoringProvider : CodeRefactoringProvider
+ {
+ internal static readonly SyntaxAnnotation DefinitionAnnotation = new SyntaxAnnotation();
+ internal static readonly SyntaxAnnotation ReferenceAnnotation = new SyntaxAnnotation();
+ internal static readonly SyntaxAnnotation InitializerAnnotation = new SyntaxAnnotation();
+ internal static readonly SyntaxAnnotation ExpressionToInlineAnnotation = new SyntaxAnnotation();
+
+ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
+ {
+ var document = context.Document;
+ var textSpan = context.Span;
+ var cancellationToken = context.CancellationToken;
+
+ if (document.Project.Solution.Workspace.Kind == WorkspaceKind.MiscellaneousFiles)
+ {
+ return;
+ }
+ var model = await document.GetSemanticModelAsync (cancellationToken).ConfigureAwait (false);
+ if (model.IsFromGeneratedCode (cancellationToken))
+ return;
+ var root = await document.GetCSharpSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ if (textSpan.Start >= root.FullSpan.Length)
+ return;
+ var token = root.FindToken(textSpan.Start);
+
+ if (!token.Span.Contains(textSpan))
+ {
+ return;
+ }
+
+ var node = token.Parent;
+
+ if (!node.IsKind(SyntaxKind.VariableDeclarator) ||
+ !node.IsParentKind(SyntaxKind.VariableDeclaration) ||
+ !node.Parent.IsParentKind(SyntaxKind.LocalDeclarationStatement))
+ {
+ return;
+ }
+
+ var variableDeclarator = (VariableDeclaratorSyntax)node;
+ var variableDeclaration = (VariableDeclarationSyntax)variableDeclarator.Parent;
+ var localDeclarationStatement = (LocalDeclarationStatementSyntax)variableDeclaration.Parent;
+
+ if (variableDeclarator.Identifier != token ||
+ variableDeclarator.Initializer == null ||
+ variableDeclarator.Initializer.Value.IsMissing ||
+ variableDeclarator.Initializer.Value.IsKind(SyntaxKind.StackAllocArrayCreationExpression))
+ {
+ return;
+ }
+
+ if (localDeclarationStatement.ContainsDiagnostics)
+ {
+ return;
+ }
+
+ var references = await GetReferencesAsync(document, variableDeclarator, cancellationToken).ConfigureAwait(false);
+ if (!references.Any())
+ {
+ return;
+ }
+
+ context.RegisterRefactoring(
+ new DocumentChangeAction(node.Span, DiagnosticSeverity.Info,
+ GettextCatalog.GetString ("Inline temporary variable"),
+ (c) => this.InlineTemporaryAsync(document, variableDeclarator, c)));
+ }
+
+ private async Task<IEnumerable<ReferenceLocation>> GetReferencesAsync(
+ Document document,
+ VariableDeclaratorSyntax variableDeclarator,
+ CancellationToken cancellationToken)
+ {
+ var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ var local = semanticModel.GetDeclaredSymbol(variableDeclarator, cancellationToken);
+
+ if (local != null)
+ {
+ var findReferencesResult = await SymbolFinder.FindReferencesAsync(local, document.Project.Solution, cancellationToken).ConfigureAwait(false);
+ var locations = findReferencesResult.Single(r => r.Definition == local).Locations;
+ if (!locations.Any(loc => semanticModel.SyntaxTree.OverlapsHiddenPosition(loc.Location.SourceSpan, cancellationToken)))
+ {
+ return locations;
+ }
+ }
+
+ return SpecializedCollections.EmptyEnumerable<ReferenceLocation>();
+ }
+
+ private static bool HasConflict(IdentifierNameSyntax identifier, VariableDeclaratorSyntax variableDeclarator)
+ {
+ // TODO: Check for more conflict types.
+ if (identifier.SpanStart < variableDeclarator.SpanStart)
+ {
+ return true;
+ }
+
+ var identifierNode = identifier
+ .Ancestors()
+ .TakeWhile(n => n.Kind() == SyntaxKind.ParenthesizedExpression || n.Kind() == SyntaxKind.CastExpression)
+ .LastOrDefault();
+
+ if (identifierNode == null)
+ {
+ identifierNode = identifier;
+ }
+
+ if (identifierNode.IsParentKind(SyntaxKind.Argument))
+ {
+ var argument = (ArgumentSyntax)identifierNode.Parent;
+ if (argument.RefOrOutKeyword.Kind() != SyntaxKind.None)
+ {
+ return true;
+ }
+ }
+ else if (identifierNode.Parent.IsKind(
+ SyntaxKind.PreDecrementExpression,
+ SyntaxKind.PreIncrementExpression,
+ SyntaxKind.PostDecrementExpression,
+ SyntaxKind.PostIncrementExpression,
+ SyntaxKind.AddressOfExpression))
+ {
+ return true;
+ }
+ else if (identifierNode.Parent is AssignmentExpressionSyntax)
+ {
+ var binaryExpression = (AssignmentExpressionSyntax)identifierNode.Parent;
+ if (binaryExpression.Left == identifierNode)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private static SyntaxAnnotation CreateConflictAnnotation()
+ {
+ return ConflictAnnotation.Create(GettextCatalog.GetString ("Conflict(s) detected."));
+ }
+
+ private async Task<Document> InlineTemporaryAsync(Document document, VariableDeclaratorSyntax declarator, CancellationToken cancellationToken)
+ {
+ var workspace = document.Project.Solution.Workspace;
+
+ // Annotate the variable declarator so that we can get back to it later.
+ var updatedDocument = await document.ReplaceNodeAsync(declarator, declarator.WithAdditionalAnnotations(DefinitionAnnotation), cancellationToken).ConfigureAwait(false);
+ var semanticModel = await updatedDocument.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+
+ var variableDeclarator = await FindDeclaratorAsync(updatedDocument, cancellationToken).ConfigureAwait(false);
+
+ // Create the expression that we're actually going to inline.
+ var expressionToInline = await CreateExpressionToInlineAsync(variableDeclarator, updatedDocument, cancellationToken).ConfigureAwait(false);
+
+ // Collect the identifier names for each reference.
+ var local = (ILocalSymbol)semanticModel.GetDeclaredSymbol(variableDeclarator, cancellationToken);
+ var symbolRefs = await SymbolFinder.FindReferencesAsync(local, updatedDocument.Project.Solution, cancellationToken).ConfigureAwait(false);
+ var references = symbolRefs.Single(r => r.Definition == local).Locations;
+ var syntaxRoot = await updatedDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+
+ // Collect the topmost parenting expression for each reference.
+ var nonConflictingIdentifierNodes = references
+ .Select(loc => (IdentifierNameSyntax)syntaxRoot.FindToken(loc.Location.SourceSpan.Start).Parent)
+ .Where(ident => !HasConflict(ident, variableDeclarator));
+
+ // Add referenceAnnotions to identifier nodes being replaced.
+ updatedDocument = await updatedDocument.ReplaceNodesAsync(
+ nonConflictingIdentifierNodes,
+ (o, n) => n.WithAdditionalAnnotations(ReferenceAnnotation),
+ cancellationToken).ConfigureAwait(false);
+
+ semanticModel = await updatedDocument.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ variableDeclarator = await FindDeclaratorAsync(updatedDocument, cancellationToken).ConfigureAwait(false);
+
+ // Get the annotated reference nodes.
+ nonConflictingIdentifierNodes = await FindReferenceAnnotatedNodesAsync(updatedDocument, cancellationToken).ConfigureAwait(false);
+
+ var topmostParentingExpressions = nonConflictingIdentifierNodes
+ .Select(ident => GetTopMostParentingExpression(ident))
+ .Distinct();
+
+ var originalInitializerSymbolInfo = semanticModel.GetSymbolInfo(variableDeclarator.Initializer.Value, cancellationToken);
+
+ // Make each topmost parenting statement or Equals Clause Expressions semantically explicit.
+ updatedDocument = await updatedDocument.ReplaceNodesAsync(topmostParentingExpressions, (o, n) => Simplifier.Expand(n, semanticModel, workspace, cancellationToken: cancellationToken), cancellationToken).ConfigureAwait(false);
+ semanticModel = await updatedDocument.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ var semanticModelBeforeInline = semanticModel;
+
+ variableDeclarator = await FindDeclaratorAsync(updatedDocument, cancellationToken).ConfigureAwait(false);
+ var scope = GetScope(variableDeclarator);
+
+ var newScope = ReferenceRewriter.Visit(semanticModel, scope, variableDeclarator, expressionToInline, cancellationToken);
+
+ updatedDocument = await updatedDocument.ReplaceNodeAsync(scope, newScope, cancellationToken).ConfigureAwait(false);
+ semanticModel = await updatedDocument.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+
+ variableDeclarator = await FindDeclaratorAsync(updatedDocument, cancellationToken).ConfigureAwait(false);
+ newScope = GetScope(variableDeclarator);
+ var conflicts = newScope.GetAnnotatedNodesAndTokens(ConflictAnnotation.Kind);
+ var declaratorConflicts = variableDeclarator.GetAnnotatedNodesAndTokens(ConflictAnnotation.Kind);
+
+ // Note that we only remove the local declaration if there weren't any conflicts,
+ // unless those conflicts are inside the local declaration.
+ if (conflicts.Count() == declaratorConflicts.Count())
+ {
+ // Certain semantic conflicts can be detected only after the reference rewriter has inlined the expression
+ var newDocument = await DetectSemanticConflicts(updatedDocument,
+ semanticModel,
+ semanticModelBeforeInline,
+ originalInitializerSymbolInfo,
+ cancellationToken).ConfigureAwait(false);
+
+ if (updatedDocument == newDocument)
+ {
+ // No semantic conflicts, we can remove the definition.
+ updatedDocument = await updatedDocument.ReplaceNodeAsync(newScope, RemoveDeclaratorFromScope(variableDeclarator, newScope), cancellationToken).ConfigureAwait(false);
+ }
+ else
+ {
+ // There were some semantic conflicts, don't remove the definition.
+ updatedDocument = newDocument;
+ }
+ }
+
+ return updatedDocument;
+ }
+
+ private static async Task<VariableDeclaratorSyntax> FindDeclaratorAsync(Document document, CancellationToken cancellationToken)
+ {
+ return await FindNodeWithAnnotationAsync<VariableDeclaratorSyntax>(document, DefinitionAnnotation, cancellationToken).ConfigureAwait(false);
+ }
+
+ private static async Task<ExpressionSyntax> FindInitializerAsync(Document document, CancellationToken cancellationToken)
+ {
+ return await FindNodeWithAnnotationAsync<ExpressionSyntax>(document, InitializerAnnotation, cancellationToken).ConfigureAwait(false);
+ }
+
+ private static async Task<T> FindNodeWithAnnotationAsync<T>(Document document, SyntaxAnnotation annotation, CancellationToken cancellationToken)
+ where T : SyntaxNode
+ {
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ return root
+ .GetAnnotatedNodesAndTokens(annotation)
+ .Single()
+ .AsNode() as T;
+ }
+
+ private static async Task<IEnumerable<IdentifierNameSyntax>> FindReferenceAnnotatedNodesAsync(Document document, CancellationToken cancellationToken)
+ {
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ return FindReferenceAnnotatedNodes(root);
+ }
+
+ private static IEnumerable<IdentifierNameSyntax> FindReferenceAnnotatedNodes(SyntaxNode root)
+ {
+ var annotatedNodesAndTokens = root.GetAnnotatedNodesAndTokens(ReferenceAnnotation);
+ foreach (var nodeOrToken in annotatedNodesAndTokens)
+ {
+ if (nodeOrToken.IsNode && nodeOrToken.AsNode().IsKind(SyntaxKind.IdentifierName))
+ {
+ yield return (IdentifierNameSyntax)nodeOrToken.AsNode();
+ }
+ }
+ }
+
+ private SyntaxNode GetScope(VariableDeclaratorSyntax variableDeclarator)
+ {
+ var variableDeclaration = (VariableDeclarationSyntax)variableDeclarator.Parent;
+ var localDeclaration = (LocalDeclarationStatementSyntax)variableDeclaration.Parent;
+ var scope = localDeclaration.Parent;
+
+ while (scope.IsKind(SyntaxKind.LabeledStatement))
+ {
+ scope = scope.Parent;
+ }
+
+ var parentExpressions = scope.AncestorsAndSelf().OfType<ExpressionSyntax>();
+ if (parentExpressions.Any())
+ {
+ scope = parentExpressions.LastOrDefault().Parent;
+ }
+
+ return scope;
+ }
+
+ private VariableDeclaratorSyntax FindDeclarator(SyntaxNode node)
+ {
+ var annotatedNodesOrTokens = node.GetAnnotatedNodesAndTokens(DefinitionAnnotation).ToList();
+
+ return (VariableDeclaratorSyntax)annotatedNodesOrTokens.First().AsNode();
+ }
+
+ private SyntaxTriviaList GetTriviaToPreserve(SyntaxTriviaList syntaxTriviaList)
+ {
+ return ShouldPreserve(syntaxTriviaList) ? syntaxTriviaList : default(SyntaxTriviaList);
+ }
+
+ private static bool ShouldPreserve(SyntaxTriviaList trivia)
+ {
+ return trivia.Any(
+ t => t.Kind() == SyntaxKind.SingleLineCommentTrivia ||
+ t.Kind() == SyntaxKind.MultiLineCommentTrivia ||
+ t.IsDirective);
+ }
+
+ private SyntaxNode RemoveDeclaratorFromVariableList(VariableDeclaratorSyntax variableDeclarator, VariableDeclarationSyntax variableDeclaration)
+ {
+ Debug.Assert(variableDeclaration.Variables.Count > 1);
+ Debug.Assert(variableDeclaration.Variables.Contains(variableDeclarator));
+
+ var localDeclaration = (LocalDeclarationStatementSyntax)variableDeclaration.Parent;
+ var scope = GetScope(variableDeclarator);
+
+ var newLocalDeclaration = localDeclaration.RemoveNode(variableDeclarator, SyntaxRemoveOptions.KeepNoTrivia)
+ .WithAdditionalAnnotations(Formatter.Annotation);
+
+ return scope.ReplaceNode(localDeclaration, newLocalDeclaration);
+ }
+
+ private SyntaxNode RemoveDeclaratorFromScope(VariableDeclaratorSyntax variableDeclarator, SyntaxNode scope)
+ {
+ var variableDeclaration = (VariableDeclarationSyntax)variableDeclarator.Parent;
+
+ // If there is more than one variable declarator, remove this one from the variable declaration.
+ if (variableDeclaration.Variables.Count > 1)
+ {
+ return RemoveDeclaratorFromVariableList(variableDeclarator, variableDeclaration);
+ }
+
+ var localDeclaration = (LocalDeclarationStatementSyntax)variableDeclaration.Parent;
+
+ // There's only one variable declarator, so we'll remove the local declaration
+ // statement entirely. This means that we'll concatenate the leading and trailing
+ // trivia of this declaration and move it to the next statement.
+ var leadingTrivia = localDeclaration
+ .GetLeadingTrivia()
+ .Reverse()
+ .SkipWhile(t => t.MatchesKind(SyntaxKind.WhitespaceTrivia))
+ .Reverse()
+ .ToSyntaxTriviaList();
+
+ var trailingTrivia = localDeclaration
+ .GetTrailingTrivia()
+ .SkipWhile(t => t.MatchesKind(SyntaxKind.WhitespaceTrivia, SyntaxKind.EndOfLineTrivia))
+ .ToSyntaxTriviaList();
+
+ var newLeadingTrivia = leadingTrivia.Concat(trailingTrivia);
+
+ var nextToken = localDeclaration.GetLastToken().GetNextTokenOrEndOfFile();
+ var newNextToken = nextToken.WithPrependedLeadingTrivia(newLeadingTrivia)
+ .WithAdditionalAnnotations(Formatter.Annotation);
+
+ var newScope = scope.ReplaceToken(nextToken, newNextToken);
+
+ var newLocalDeclaration = (LocalDeclarationStatementSyntax)FindDeclarator(newScope).Parent.Parent;
+
+ // If the local is parented by a label statement, we can't remove this statement. Instead,
+ // we'll replace the local declaration with an empty expression statement.
+ if (newLocalDeclaration.IsParentKind(SyntaxKind.LabeledStatement))
+ {
+ var labeledStatement = (LabeledStatementSyntax)newLocalDeclaration.Parent;
+ var newLabeledStatement = labeledStatement.ReplaceNode(newLocalDeclaration, SyntaxFactory.ParseStatement(""));
+
+ return newScope.ReplaceNode(labeledStatement, newLabeledStatement);
+ }
+
+ return newScope.RemoveNode(newLocalDeclaration, SyntaxRemoveOptions.KeepNoTrivia);
+ }
+
+ private ExpressionSyntax SkipRedundantExteriorParentheses(ExpressionSyntax expression)
+ {
+ while (expression.IsKind(SyntaxKind.ParenthesizedExpression))
+ {
+ var parenthesized = (ParenthesizedExpressionSyntax)expression;
+ if (parenthesized.Expression == null ||
+ parenthesized.Expression.IsMissing)
+ {
+ break;
+ }
+
+ if (parenthesized.Expression.IsKind(SyntaxKind.ParenthesizedExpression) ||
+ parenthesized.Expression.IsKind(SyntaxKind.IdentifierName))
+ {
+ expression = parenthesized.Expression;
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ return expression;
+ }
+
+ public static IEnumerable<SyntaxTrivia> SkipInitialWhitespace(SyntaxTriviaList triviaList)
+ {
+ return triviaList.SkipWhile(t => t.Kind() == SyntaxKind.WhitespaceTrivia);
+ }
+
+ private async Task<ExpressionSyntax> CreateExpressionToInlineAsync(
+ VariableDeclaratorSyntax variableDeclarator,
+ Document document,
+ CancellationToken cancellationToken)
+ {
+ var updatedDocument = document;
+
+ var expression = SkipRedundantExteriorParentheses(variableDeclarator.Initializer.Value);
+ var semanticModel = await updatedDocument.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ var localSymbol = (ILocalSymbol)semanticModel.GetDeclaredSymbol(variableDeclarator, cancellationToken);
+ var newExpression = InitializerRewriter.Visit(expression, localSymbol, semanticModel);
+
+ // If this is an array initializer, we need to transform it into an array creation
+ // expression for inlining.
+ if (newExpression.Kind() == SyntaxKind.ArrayInitializerExpression)
+ {
+ var arrayType = (ArrayTypeSyntax)localSymbol.Type.GenerateTypeSyntax();
+ var arrayInitializer = (InitializerExpressionSyntax)newExpression;
+
+ // Add any non-whitespace trailing trivia from the equals clause to the type.
+ var equalsToken = variableDeclarator.Initializer.EqualsToken;
+ if (equalsToken.HasTrailingTrivia)
+ {
+ var trailingTrivia = SkipInitialWhitespace(equalsToken.TrailingTrivia);
+ if (trailingTrivia.Any())
+ {
+ arrayType = arrayType.WithTrailingTrivia(trailingTrivia);
+ }
+ }
+
+ newExpression = SyntaxFactory.ArrayCreationExpression(arrayType, arrayInitializer);
+ }
+
+ newExpression = newExpression.WithAdditionalAnnotations(InitializerAnnotation);
+
+ updatedDocument = await updatedDocument.ReplaceNodeAsync(variableDeclarator.Initializer.Value, newExpression, cancellationToken).ConfigureAwait(false);
+ semanticModel = await updatedDocument.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ newExpression = await FindInitializerAsync(updatedDocument, cancellationToken).ConfigureAwait(false);
+ var newVariableDeclarator = await FindDeclaratorAsync(updatedDocument, cancellationToken).ConfigureAwait(false);
+ localSymbol = (ILocalSymbol)semanticModel.GetDeclaredSymbol(newVariableDeclarator, cancellationToken);
+
+ var explicitCastExpression = newExpression.CastIfPossible(localSymbol.Type, newVariableDeclarator.SpanStart, semanticModel);
+
+ if (explicitCastExpression != newExpression)
+ {
+ updatedDocument = await updatedDocument.ReplaceNodeAsync(newExpression, explicitCastExpression, cancellationToken).ConfigureAwait(false);
+ semanticModel = await updatedDocument.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ newVariableDeclarator = await FindDeclaratorAsync(updatedDocument, cancellationToken).ConfigureAwait(false);
+ }
+
+ // Now that the variable declarator is normalized, make its initializer
+ // value semantically explicit.
+ newExpression = await Simplifier.ExpandAsync(newVariableDeclarator.Initializer.Value, updatedDocument, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return newExpression.WithAdditionalAnnotations(ExpressionToInlineAnnotation);
+ }
+
+ private static SyntaxNode GetTopMostParentingExpression(ExpressionSyntax expression)
+ {
+ return expression.AncestorsAndSelf().OfType<ExpressionSyntax>().Last();
+ }
+
+ private static async Task<Document> DetectSemanticConflicts(
+ Document inlinedDocument,
+ SemanticModel newSemanticModelForInlinedDocument,
+ SemanticModel semanticModelBeforeInline,
+ SymbolInfo originalInitializerSymbolInfo,
+ CancellationToken cancellationToken)
+ {
+ // In this method we detect if inlining the expression introduced the following semantic change:
+ // The symbol info associated with any of the inlined expressions does not match the symbol info for original initializer expression prior to inline.
+
+ // If any semantic changes were introduced by inlining, we update the document with conflict annotations.
+ // Otherwise we return the given inlined document without any changes.
+
+ var syntaxRootBeforeInline = await semanticModelBeforeInline.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false);
+
+ // Get all the identifier nodes which were replaced with inlined expression.
+ var originalIdentifierNodes = FindReferenceAnnotatedNodes(syntaxRootBeforeInline).ToList ();
+
+ if (!originalIdentifierNodes.Any())
+ {
+ // No conflicts
+ return inlinedDocument;
+ }
+
+ // Get all the inlined expression nodes.
+ var syntaxRootAfterInline = await inlinedDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ var inlinedExprNodes = syntaxRootAfterInline.GetAnnotatedNodesAndTokens(ExpressionToInlineAnnotation).ToList ();
+ Debug.Assert(originalIdentifierNodes.Count() == inlinedExprNodes.Count());
+
+ Dictionary<SyntaxNode, SyntaxNode> replacementNodesWithChangedSemantics = null;
+ using (var originalNodesEnum = originalIdentifierNodes.GetEnumerator())
+ {
+ using (var inlinedNodesOrTokensEnum = inlinedExprNodes.GetEnumerator())
+ {
+ while (originalNodesEnum.MoveNext())
+ {
+ inlinedNodesOrTokensEnum.MoveNext();
+ var originalNode = originalNodesEnum.Current;
+
+ // expressionToInline is Parenthesized prior to replacement, so get the parenting parenthesized expression.
+ var inlinedNode = (ExpressionSyntax)inlinedNodesOrTokensEnum.Current.Parent;
+ Debug.Assert(inlinedNode.IsKind(SyntaxKind.ParenthesizedExpression));
+
+ // inlinedNode is the expanded form of the actual initializer expression in the original document.
+ // We have annotated the inner initializer with a special syntax annotation "InitializerAnnotation".
+ // Get this annotated node and compute the symbol info for this node in the inlined document.
+ var innerInitializerInInlineNodeorToken = inlinedNode.GetAnnotatedNodesAndTokens(InitializerAnnotation).First();
+
+ ExpressionSyntax innerInitializerInInlineNode = (ExpressionSyntax)(innerInitializerInInlineNodeorToken.IsNode ?
+ innerInitializerInInlineNodeorToken.AsNode() :
+ innerInitializerInInlineNodeorToken.AsToken().Parent);
+ var newInializerSymbolInfo = newSemanticModelForInlinedDocument.GetSymbolInfo(innerInitializerInInlineNode, cancellationToken);
+
+ // Verification: The symbol info associated with any of the inlined expressions does not match the symbol info for original initializer expression prior to inline.
+ if (!SpeculationAnalyzer.SymbolInfosAreCompatible(originalInitializerSymbolInfo, newInializerSymbolInfo, performEquivalenceCheck: true))
+ {
+ newInializerSymbolInfo = newSemanticModelForInlinedDocument.GetSymbolInfo(inlinedNode, cancellationToken);
+ if (!SpeculationAnalyzer.SymbolInfosAreCompatible(originalInitializerSymbolInfo, newInializerSymbolInfo, performEquivalenceCheck: true))
+ {
+ if (replacementNodesWithChangedSemantics == null)
+ {
+ replacementNodesWithChangedSemantics = new Dictionary<SyntaxNode, SyntaxNode>();
+ }
+
+ replacementNodesWithChangedSemantics.Add(inlinedNode, originalNode);
+ }
+ }
+ }
+ }
+ }
+
+ if (replacementNodesWithChangedSemantics == null)
+ {
+ // No conflicts.
+ return inlinedDocument;
+ }
+
+ // Replace the conflicting inlined nodes with the original nodes annotated with conflict annotation.
+ Func<SyntaxNode, SyntaxNode, SyntaxNode> conflictAnnotationAdder =
+ (SyntaxNode oldNode, SyntaxNode newNode) =>
+ newNode.WithAdditionalAnnotations(ConflictAnnotation.Create(GettextCatalog.GetString ("Conflict(s) detected.")));
+
+ return await inlinedDocument.ReplaceNodesAsync(replacementNodesWithChangedSemantics.Keys, conflictAnnotationAdder, cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/IntroduceVariable/IntroduceVariableCodeRefactoringProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/IntroduceVariable/IntroduceVariableCodeRefactoringProvider.cs
new file mode 100644
index 0000000000..59f1b83585
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/IntroduceVariable/IntroduceVariableCodeRefactoringProvider.cs
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Composition;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeRefactorings;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp.Features.IntroduceVariable;
+using ICSharpCode.NRefactory6.CSharp;
+using RefactoringEssentials;
+
+namespace MonoDevelop.CSharp.CodeRefactorings.IntroduceVariable
+{
+ [ExportCodeRefactoringProvider(LanguageNames.CSharp, Name = PredefinedCodeRefactoringProviderNames.IntroduceVariable), Shared]
+ class IntroduceVariableCodeRefactoringProvider : CodeRefactoringProvider
+ {
+ static readonly CSharpIntroduceVariableService service = new CSharpIntroduceVariableService ();
+
+ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
+ {
+ var document = context.Document;
+ var textSpan = context.Span;
+ var cancellationToken = context.CancellationToken;
+ if (document.Project.Solution.Workspace.Kind == WorkspaceKind.MiscellaneousFiles)
+ {
+ return;
+ }
+ var model = await document.GetSemanticModelAsync (cancellationToken).ConfigureAwait (false);
+ if (model.IsFromGeneratedCode (cancellationToken))
+ return;
+ var result = await service.IntroduceVariableAsync(document, textSpan, cancellationToken).ConfigureAwait(false);
+
+ if (!result.ContainsChanges)
+ {
+ return;
+ }
+
+ var actions = result.GetCodeRefactoring(cancellationToken).Actions;
+ context.RegisterRefactorings(actions);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/PredefinedCodeRefactoringProviderNames.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/PredefinedCodeRefactoringProviderNames.cs
new file mode 100644
index 0000000000..87228da8cf
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/PredefinedCodeRefactoringProviderNames.cs
@@ -0,0 +1,47 @@
+//
+// PredefinedCodeRefactoringProviderNames.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.CSharp.CodeRefactorings
+{
+ static class PredefinedCodeRefactoringProviderNames
+ {
+ public const string AddConstructorParametersFromMembers = "Add Parameters From Members Code Action Provider";
+ public const string ChangeSignature = "Change Signature Code Action Provider";
+ public const string EncapsulateField = "Encapsulate Field";
+ public const string ExtractInterface = "Extract Interface Code Action Provider";
+ public const string ExtractMethod = "Extract Method Code Action Provider";
+ public const string GenerateConstructorFromMembers = "Generate Constructor From Members Code Action Provider";
+ public const string GenerateDefaultConstructors = "Generate Default Constructors Code Action Provider";
+ public const string GenerateEqualsAndGetHashCode = "Generate Equals and GetHashCode Code Action Provider";
+ public const string InlineTemporary = "Inline Temporary Code Action Provider";
+ public const string IntroduceVariable = "Introduce Variable Code Action Provider";
+ public const string InvertIf = "Invert If Code Action Provider";
+ public const string MoveDeclarationNearReference = "Move Declaration Near Reference Code Action Provider";
+ public const string SimplifyLambda = "Simplify Lambda Code Action Provider";
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/Resources.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/Resources.cs
new file mode 100644
index 0000000000..0f4728caa5
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/Resources.cs
@@ -0,0 +1,98 @@
+//
+// Resources.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class Resources
+ {
+ public static string GenerateConstructor = "Generate constructor '{0}({1})'";
+ public static string GenerateFieldAssigningConstructor = "Generate field assigning constructor '{0}({1})'";
+ public static string GenerateDelegatingConstructor = "Generate delegating constructor '{0}({1})'";
+
+ public static string GenerateEnumMemberIn = "Generate enum member '{0}' in '{1}'";
+ public static string GenerateNewConstructorIn = "Generate constructor in '{0}'";
+
+ public static string GenerateAbstractMethod = "Generate abstract method '{0}' in '{1}'";
+ public static string GenerateAbstractProperty = "Generate abstract property '{0}' in '{1}'";
+ public static string GeneratePropertyIn = "Generate property '{1}.{0}'";
+ public static string GenerateMethodIn = "Generate method '{1}.{0}'";
+
+ public static string GenerateAll = "Generate all";
+
+ public static string GenerateConstantIn = "Generate constant '{0}' in '{1}'";
+ public static string GenerateReadonlyProperty = "Generate read-only property '{1}.{0}'";
+ public static string GenerateReadonlyField = "Generate read-only field '{1}.{0}'";
+ public static string GenerateFieldIn = "Generate field '{0}' in '{1}'";
+ public static string GenerateLocal = "Generate local '{0}'";
+
+ public static string ImplementInterface = "Implement interface";
+ public static string ImplementInterfaceAbstractly = "Implement interface abstractly";
+ public static string ImplementInterfaceExplicitly = "Implement interface explicitly";
+ public static string ImplementInterfaceExplicitlyWithDisposePattern = "Implement interface explicitly with Dispose pattern";
+ public static string ImplementInterfaceThrough = "Implement interface through '{0}'";
+ public static string ImplementInterfaceWithDisposePattern = "Implement interface with Dispose pattern";
+
+ public static string ImplicitConversionDisplayText = "Generate implicit conversion operator in '{0}'";
+ public static string ExplicitConversionDisplayText = "Generate explicit conversion operator in '{0}'";
+
+ public static string GenerateForIn = "Generate {0} for '{1}' in '{2}'";
+ public static string GenerateForInNewFile = "Generate {0} for '{1}' in '{2}' (new file)";
+ public static string GlobalNamespace = "Global Namespace";
+ public static string GenerateNewType = "Generate new type...";
+ public static string ToDetectRedundantCalls = "To detect redundant calls";
+
+ public static string DisposeManagedStateTodo = "TODO: dispose managed state (managed objects).";
+ public static string FreeUnmanagedResourcesTodo = "TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.";
+ public static string SetLargeFieldsToNullTodo = "TODO: set large fields to null.";
+ public static string OverrideAFinalizerTodo = "TODO: override a finalizer only if Dispose(bool disposing) above has code to free unmanaged resources.";
+ public static string DoNotChangeThisCodeUseDispose = "Do not change this code. Put cleanup code in Dispose(bool disposing) above.";
+ public static string ThisCodeAddedToCorrectlyImplementDisposable = "This code added to correctly implement the disposable pattern.";
+ public static string UncommentTheFollowingIfFinalizerOverriddenTodo = "TODO: uncomment the following line if the finalizer is overridden above.";
+
+
+ public static string IntroduceConstantFor = "Introduce constant for '{0}'";
+ public static string IntroduceConstantForAllOccurrences = "Introduce constant for all occurrences of '{0}'";
+ public static string IntroduceFieldFor = "Introduce field for '{0}'";
+ public static string IntroduceFieldForAllOccurrences = "Introduce field for all occurrences of '{0}'";
+ public static string IntroduceLocalConstantFor = "Introduce local constant for '{0}'";
+ public static string IntroduceLocalConstantForAll = "Introduce local constant for all occurrences of '{0}'";
+ public static string IntroduceLocalFor = "Introduce local for '{0}'";
+ public static string IntroduceLocalForAllOccurrences = "Introduce local for all occurrences of '{0}'";
+ public static string IntroduceQueryVariableFor = "Introduce query variable for '{0}'";
+ public static string IntroduceQueryVariableForAll = "Introduce query variable for all occurrences of '{0}'";
+
+ public static string OrganizeUsingsWithAccelerator = "_Organize Usings";
+ public static string RemoveAndSortUsingsWithAccelerator = "Remove _and Sort Usings";
+ public static string SortUsingsWithAccelerator = "_Sort Usings";
+ public static string RemoveUnnecessaryUsingsWithAccelerator = "_Remove Unnecessary Usings";
+ public static string EncapsulateFieldsUsages = "Encapsulate fields (and use property)";
+ public static string EncapsulateFields = "Encapsulate fields (but still use field)";
+ public static string EncapsulateFieldUsages = "Encapsulate field: '{0}' (and use property)";
+ public static string EncapsulateField = "Encapsulate field: '{0}' (but still use field)";
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/TypeGuessing.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/TypeGuessing.cs
new file mode 100644
index 0000000000..bc53ea931c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/TypeGuessing.cs
@@ -0,0 +1,384 @@
+//
+// TypeGuessing.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.CSharp;
+using System.Threading;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class TypeGuessing
+ {
+ static int GetArgumentIndex(IEnumerable<ArgumentSyntax> arguments, SyntaxNode parameter)
+ {
+ //Console.WriteLine("arg:" +parameter);
+ int argumentNumber = 0;
+ foreach (var arg in arguments) {
+ //Console.WriteLine(arg +"/"+parameter);
+ if (arg == parameter) {
+ return argumentNumber;
+ }
+ argumentNumber++;
+ }
+ return -1;
+ }
+
+ static IEnumerable<ITypeSymbol> GetAllValidTypesFromInvocation(SemanticModel resolver, InvocationExpressionSyntax invoke, SyntaxNode parameter)
+ {
+ int index = GetArgumentIndex(invoke.ArgumentList.Arguments, parameter);
+ if (index < 0)
+ yield break;
+ var targetResult = resolver.GetSymbolInfo(invoke.Expression);
+
+// var targetResult = resolver.Resolve(invoke.Target) as MethodGroupResolveResult;
+// if (targetResult != null) {
+ foreach (var method in targetResult.CandidateSymbols) {
+ var parameters = method.GetParameters();
+ if (index < parameters.Length) {
+ if (parameters [index].IsParams) {
+ var arrayType = parameters[index].Type as IArrayTypeSymbol;
+ if (arrayType != null)
+ yield return arrayType.ElementType;
+ }
+ yield return parameters[index].Type;
+ }
+ }
+
+// foreach (var extMethods in targetResult.GetExtensionMethods ()) {
+// foreach (var extMethod in extMethods) {
+// ITypeSymbol[] inferredTypes;
+// var m = extMethod;
+// if (CSharpResolver.IsEligibleExtensionMethod(targetResult.TargetType, extMethod, true, out inferredTypes)) {
+// if (inferredTypes != null)
+// m = extMethod.Specialize(new TypeParameterSubstitution(null, inferredTypes));
+// }
+//
+// int correctedIndex = index + 1;
+// if (correctedIndex < m.Parameters.Count) {
+// if (m.Parameters [correctedIndex].IsParams) {
+// var arrayType = m.Parameters [correctedIndex].Type as ArrayType;
+// if (arrayType != null)
+// yield return arrayType.ElementType;
+// }
+// yield return m.Parameters [correctedIndex].Type;
+// }
+// }
+// }
+// }
+ }
+
+// static IEnumerable<ITypeSymbol> GetAllValidTypesFromObjectCreation(SemanticModel resolver, ObjectCreateExpressionSyntax invoke, SyntaxNode parameter)
+// {
+// int index = GetArgumentIndex(invoke.Arguments, parameter);
+// if (index < 0)
+// yield break;
+//
+// var targetResult = resolver.Resolve(invoke.Type);
+// if (targetResult is TypeResolveResult) {
+// var type = ((TypeResolveResult)targetResult).Type;
+// if (type.Kind == TypeKind.Delegate && index == 0) {
+// yield return type;
+// yield break;
+// }
+// foreach (var constructor in type.GetConstructors ()) {
+// if (index < constructor.Parameters.Count)
+// yield return constructor.Parameters [index].Type;
+// }
+// }
+// }
+//
+// public static ITypeSymbol GetElementType(SemanticModel resolver, ITypeSymbol type)
+// {
+// // TODO: A better get element type method.
+// if (type.Kind == TypeKind.Array || type.Kind == TypeKind.Dynamic) {
+// if (type.Kind == TypeKind.Array)
+// return ((ArrayType)type).ElementType;
+// return resolver.Compilation.FindType(KnownTypeCode.Object);
+// }
+//
+//
+// foreach (var method in type.GetMethods (m => m.Name == "GetEnumerator")) {
+// ITypeSymbol returnType = null;
+// foreach (var prop in method.ReturnType.GetProperties(p => p.Name == "Current")) {
+// if (returnType != null && prop.ReturnType.IsKnownType (KnownTypeCode.Object))
+// continue;
+// returnType = prop.ReturnType;
+// }
+// if (returnType != null)
+// return returnType;
+// }
+//
+// return resolver.Compilation.FindType(KnownTypeCode.Object);
+// }
+//
+// static IEnumerable<ITypeSymbol> GuessFromConstructorInitializer(SemanticModel resolver, SyntaxNode expr)
+// {
+// var init = expr.Parent as ConstructorInitializer;
+// var rr = resolver.Resolve(expr.Parent);
+// int index = GetArgumentIndex(init.Arguments, expr);
+// if (index >= 0) {
+// foreach (var constructor in rr.Type.GetConstructors()) {
+// if (index < constructor.Parameters.Count) {
+// yield return constructor.Parameters[index].Type;
+// }
+// }
+// }
+// }
+
+ public static IEnumerable<ITypeSymbol> GetValidTypes(SemanticModel model, SyntaxNode expr, CancellationToken cancellationToken = default(CancellationToken))
+ {
+// if (expr.Role == Roles.Condition) {
+// return new [] { model.Compilation.FindType (KnownTypeCode.Boolean) };
+// }
+//
+ var mref = expr.Parent as MemberAccessExpressionSyntax;
+ if (mref != null && mref.Name != expr) {
+ mref = null;
+ }
+ if (mref != null) {
+ // case: guess enum when trying to access not existent enum member
+ var rr = model.GetTypeInfo(mref.Expression);
+ if (rr.Type != null && rr.Type.TypeKind == TypeKind.Enum)
+ return new [] { rr.Type };
+ }
+
+// if (expr.Parent is ParenthesizedExpressionSyntax || expr.Parent is NamedArgumentExpressionSyntax) {
+// return GetValidTypes(model, expr.Parent);
+// }
+// if (expr.Parent is DirectionExpressionSyntax) {
+// var parent = expr.Parent.Parent;
+// if (parent is InvocationExpressionSyntax) {
+// var invoke = (InvocationExpressionSyntax)parent;
+// return GetAllValidTypesFromInvocation(model, invoke, expr.Parent);
+// }
+// }
+//
+// if (expr.Parent is ArrayInitializerExpressionSyntax) {
+// if (expr is NamedExpressionSyntax)
+// return new [] { model.Resolve(((NamedExpressionSyntax)expr).ExpressionSyntax).Type };
+//
+// var aex = expr.Parent as ArrayInitializerExpressionSyntax;
+// if (aex.IsSingleElement)
+// aex = aex.Parent as ArrayInitializerExpressionSyntax;
+// var type = GetElementType(model, model.Resolve(aex.Parent).Type);
+// if (type.Kind != TypeKind.Unknown)
+// return new [] { type };
+// }
+//
+// if (expr.Parent is ObjectCreateExpressionSyntax) {
+// var invoke = (ObjectCreateExpressionSyntax)expr.Parent;
+// return GetAllValidTypesFromObjectCreation(model, invoke, expr);
+// }
+//
+// if (expr.Parent is ArrayCreateExpressionSyntax) {
+// var ace = (ArrayCreateExpressionSyntax)expr.Parent;
+// if (!ace.Type.IsNull) {
+// return new [] { model.Resolve(ace.Type).Type };
+// }
+// }
+//
+// if (expr.Parent is VariableInitializer) {
+// var initializer = (VariableInitializer)expr.Parent;
+// var field = initializer.GetParent<FieldDeclaration>();
+// if (field != null) {
+// var rr = model.Resolve(field.ReturnType);
+// if (!rr.IsError)
+// return new [] { rr.Type };
+// }
+// var varStmt = initializer.GetParent<VariableDeclarationStatement>();
+// if (varStmt != null) {
+// var rr = model.Resolve(varStmt.Type);
+// if (!rr.IsError)
+// return new [] { rr.Type };
+// }
+// return new [] { model.Resolve(initializer).Type };
+// }
+//
+// if (expr.Parent is CastExpressionSyntax) {
+// var cast = (CastExpressionSyntax)expr.Parent;
+// return new [] { model.Resolve(cast.Type).Type };
+// }
+//
+// if (expr.Parent is AsExpressionSyntax) {
+// var cast = (AsExpressionSyntax)expr.Parent;
+// return new [] { model.Resolve(cast.Type).Type };
+// }
+
+ if (expr.Parent is AssignmentExpressionSyntax || mref != null && mref.Parent is AssignmentExpressionSyntax ) {
+ var assign = expr.Parent as AssignmentExpressionSyntax ?? mref.Parent as AssignmentExpressionSyntax;
+ var other = assign.Left == expr || assign.Left == mref ? assign.Right : assign.Left;
+ return new [] { model.GetTypeInfo(other).Type };
+ }
+
+// if (expr.Parent is BinaryOperatorExpressionSyntax) {
+// var assign = (BinaryOperatorExpressionSyntax)expr.Parent;
+// var other = assign.Left == expr ? assign.Right : assign.Left;
+// return new [] { model.Resolve(other).Type };
+// }
+//
+// if (expr.Parent is ReturnStatement) {
+// var parent = expr.Ancestors.FirstOrDefault(n => n is EntityDeclaration || n is AnonymousMethodExpressionSyntax|| n is LambdaExpressionSyntax);
+// if (parent != null) {
+// var rr = model.Resolve(parent);
+// if (!rr.IsError)
+// return new [] { rr.Type };
+// }
+// var e = parent as EntityDeclaration;
+// if (e != null) {
+// var rt = model.Resolve(e.ReturnType);
+// if (!rt.IsError)
+// return new [] { rt.Type };
+// }
+// }
+//
+// if (expr.Parent is YieldReturnStatement) {
+// var state = model.GetResolverStateBefore(expr);
+// if (state != null && (state.CurrentMember.ReturnType is ParameterizedType)) {
+// var pt = (ParameterizedType)state.CurrentMember.ReturnType;
+// if (pt.FullName == "System.Collections.Generic.IEnumerable") {
+// return new [] { pt.TypeArguments.First() };
+// }
+// }
+// }
+//
+// if (expr.Parent is UnaryOperatorExpressionSyntax) {
+// var uop = (UnaryOperatorExpressionSyntax)expr.Parent;
+// switch (uop.Operator) {
+// case UnaryOperatorType.Not:
+// return new [] { model.Compilation.FindType(KnownTypeCode.Boolean) };
+// case UnaryOperatorType.Minus:
+// case UnaryOperatorType.Plus:
+// case UnaryOperatorType.Increment:
+// case UnaryOperatorType.Decrement:
+// case UnaryOperatorType.PostIncrement:
+// case UnaryOperatorType.PostDecrement:
+// return new [] { model.Compilation.FindType(KnownTypeCode.Int32) };
+// }
+// }
+//
+// if (expr.Parent is ConstructorInitializer)
+// return GuessFromConstructorInitializer(model, expr);
+//
+// if (expr.Parent is NamedExpressionSyntax) {
+// var rr = model.Resolve(expr.Parent);
+// if (!rr.IsError) {
+// return new [] { rr.Type };
+// }
+// }
+
+ if (expr.IsKind(SyntaxKind.Argument)) {
+ var parent = expr.Parent.Parent;
+ var invocationParent = parent as InvocationExpressionSyntax;
+ if (invocationParent != null) {
+ return GetAllValidTypesFromInvocation(model, invocationParent, expr);
+ }
+ }
+
+ var types = typeInferenceService.InferTypes(model, expr, cancellationToken).ToList();
+
+ return types;
+ }
+
+ public static readonly CSharpTypeInferenceService typeInferenceService = new CSharpTypeInferenceService ();
+
+ public static TypeSyntax GuessAstType(SemanticModel context, SyntaxNode expr, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var types = GetValidTypes(context, expr,cancellationToken).ToList();
+ /*var typeInference = new TypeInference(context.Compilation);
+ typeInference.Algorithm = TypeInferenceAlgorithm.Improved;
+ var inferedType = typeInference.FindTypeInBounds(type, emptyTypes);*/
+
+ if (types.Count == 0)
+ return SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.ObjectKeyword));
+
+ var resultType = types[0];
+
+ foreach (var type in types) {
+ if (type.SpecialType == SpecialType.System_Object) {
+ resultType = type;
+ break;
+ }
+ }
+
+ return resultType.GenerateTypeSyntax ();
+ }
+
+
+ public static ITypeSymbol GuessType(SemanticModel context, SyntaxNode expr, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var types = GetValidTypes(context, expr,cancellationToken).ToList();
+ /*var typeInference = new TypeInference(context.Compilation);
+ typeInference.Algorithm = TypeInferenceAlgorithm.Improved;
+ var inferedType = typeInference.FindTypeInBounds(type, emptyTypes);*/
+
+ if (types.Count == 0)
+ return context.Compilation.GetTypeSymbol ("System", "Object", 0, cancellationToken);
+
+ var resultType = types[0];
+
+ foreach (var type in types) {
+ if (type.SpecialType == SpecialType.System_Object) {
+ resultType = type;
+ break;
+ }
+ }
+
+ return resultType;
+ }
+
+// public static ITypeSymbol GuessType(BaseRefactoringContext context, SyntaxNode expr)
+// {
+// if (expr is SimpleType && expr.Role == Roles.TypeArgument) {
+// if (expr.Parent is MemberReferenceExpressionSyntax || expr.Parent is IdentifierExpressionSyntax) {
+// var rr = context.Resolve (expr.Parent);
+// var argumentNumber = expr.Parent.GetChildrenByRole (Roles.TypeArgument).TakeWhile (c => c != expr).Count ();
+//
+// var mgrr = rr as MethodGroupResolveResult;
+// if (mgrr != null && mgrr.Methods.Any () && mgrr.Methods.First ().TypeArguments.Count > argumentNumber)
+// return mgrr.Methods.First ().TypeParameters[argumentNumber];
+// } else if (expr.Parent is MemberType || expr.Parent is SimpleType) {
+// var rr = context.Resolve (expr.Parent);
+// var argumentNumber = expr.Parent.GetChildrenByRole (Roles.TypeArgument).TakeWhile (c => c != expr).Count ();
+// var mgrr = rr as TypeResolveResult;
+// if (mgrr != null && mgrr.Type.TypeParameterCount > argumentNumber) {
+// return mgrr.Type.GetDefinition ().TypeParameters[argumentNumber];
+// }
+// }
+// }
+//
+// var type = GetValidTypes(context.Resolver, expr).ToArray();
+// var typeInference = new TypeInference(context.Compilation);
+// typeInference.Algorithm = TypeInferenceAlgorithm.Improved;
+// var inferedType = typeInference.FindTypeInBounds(type, emptyTypes);
+// return inferedType;
+// }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/UsingRefactorings/SortImportsCodeRefactoringProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/UsingRefactorings/SortImportsCodeRefactoringProvider.cs
new file mode 100644
index 0000000000..388386c4b4
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeRefactorings/UsingRefactorings/SortImportsCodeRefactoringProvider.cs
@@ -0,0 +1,118 @@
+//
+// SortImportsCodeRefactoringProvider.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System.Composition;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeRefactorings;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp.Features.IntroduceVariable;
+using ICSharpCode.NRefactory6.CSharp;
+using RefactoringEssentials;
+using Microsoft.CodeAnalysis.CSharp;
+using MonoDevelop.Core;
+using System;
+using System.Threading;
+using MonoDevelop.CSharp.Refactoring;
+using System.Linq;
+
+namespace MonoDevelop.CSharp.CodeRefactorings.IntroduceVariable
+{
+ [ExportCodeRefactoringProvider(LanguageNames.CSharp, Name = "Sort Imports Code Action Provider"), Shared]
+ class SortImportsCodeRefactoringProvider : CodeRefactoringProvider
+ {
+ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
+ {
+ var document = context.Document;
+ var textSpan = context.Span;
+ var cancellationToken = context.CancellationToken;
+ if (document.Project.Solution.Workspace.Kind == WorkspaceKind.MiscellaneousFiles)
+ {
+ return;
+ }
+ var model = await document.GetSemanticModelAsync (cancellationToken).ConfigureAwait (false);
+ if (model.IsFromGeneratedCode (cancellationToken))
+ return;
+ var root = await document.GetCSharpSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ if (textSpan.Start >= root.FullSpan.Length)
+ return;
+ var token = root.FindToken(textSpan.Start);
+
+ if (!token.Span.Contains(textSpan))
+ {
+ return;
+ }
+
+ var node = token.Parent.AncestorsAndSelf ().FirstOrDefault (n => n.IsKind(SyntaxKind.UsingDirective) || n.IsParentKind(SyntaxKind.ExternAliasDirective));
+ if (node == null)
+ {
+ return;
+ }
+
+ context.RegisterRefactoring(
+ new DocumentChangeAction(node.Span, DiagnosticSeverity.Info,
+ GettextCatalog.GetString ("Sort usings"),
+ (t) => OrganizeImportsCommandHandler.SortUsingsAsync(document, t)));
+ }
+ }
+
+ [ExportCodeRefactoringProvider(LanguageNames.CSharp, Name = "Sort And Remove Imports Code Action Provider"), Shared]
+ class SortAndRemoveImportsCodeRefactoringProvider : CodeRefactoringProvider
+ {
+ public override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
+ {
+ var document = context.Document;
+ var textSpan = context.Span;
+ var cancellationToken = context.CancellationToken;
+ if (document.Project.Solution.Workspace.Kind == WorkspaceKind.MiscellaneousFiles)
+ {
+ return;
+ }
+ var model = await document.GetSemanticModelAsync (cancellationToken).ConfigureAwait (false);
+ if (model.IsFromGeneratedCode (cancellationToken))
+ return;
+ var root = await document.GetCSharpSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ if (textSpan.Start >= root.FullSpan.Length)
+ return;
+ var token = root.FindToken(textSpan.Start);
+ if (!token.Span.Contains(textSpan))
+ {
+ return;
+ }
+
+ var node = token.Parent.AncestorsAndSelf ().FirstOrDefault (n => n.IsKind(SyntaxKind.UsingDirective) || n.IsParentKind(SyntaxKind.ExternAliasDirective));
+ if (node == null)
+ {
+ return;
+ }
+
+ context.RegisterRefactoring(
+ new DocumentChangeAction(node.Span, DiagnosticSeverity.Info,
+ GettextCatalog.GetString ("Sort and remove usings"),
+ (t) => SortAndRemoveImportsCommandHandler.SortAndRemoveAsync(document, t)));
+ }
+ }
+
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/AbstractParameterDataProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/AbstractParameterDataProvider.cs
index d505a33737..8cde44cca3 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/AbstractParameterDataProvider.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/AbstractParameterDataProvider.cs
@@ -35,7 +35,7 @@ using MonoDevelop.Ide.CodeCompletion;
namespace MonoDevelop.CSharp.Completion
{
- abstract class AbstractParameterDataProvider : ParameterDataProvider
+ abstract class AbstractParameterDataProvider : ParameterHintingData
{
protected CSharpCompletionTextEditorExtension ext;
@@ -49,28 +49,29 @@ namespace MonoDevelop.CSharp.Completion
TypeSystemAstBuilder builder;
protected string GetShortType (IType type)
{
- if (builder == null) {
- var ctx = ext.CSharpUnresolvedFile.GetTypeResolveContext (ext.UnresolvedFileCompilation, ext.Document.Editor.Caret.Location);
- var state = new CSharpResolver (ctx);
- builder = new TypeSystemAstBuilder (state);
- var dt = state.CurrentTypeDefinition;
- var declaring = ctx.CurrentTypeDefinition != null ? ctx.CurrentTypeDefinition.DeclaringTypeDefinition : null;
- if (declaring != null) {
- while (dt != null) {
- if (dt.Equals (declaring)) {
- builder.AlwaysUseShortTypeNames = true;
- break;
- }
- dt = dt.DeclaringTypeDefinition;
- }
- }
- }
- try {
- return GLib.Markup.EscapeText (builder.ConvertType(type).ToString (ext.FormattingPolicy.CreateOptions ()));
- } catch (Exception e) {
- LoggingService.LogError ("Exception while getting short type.", e);
- return "";
- }
+ return type.Name;
+// if (builder == null) {
+// var ctx = ext.CSharpUnresolvedFile.GetTypeResolveContext (ext.UnresolvedFileCompilation, ext.Document.Editor.Caret.Location);
+// var state = new CSharpResolver (ctx);
+// builder = new TypeSystemAstBuilder (state);
+// var dt = state.CurrentTypeDefinition;
+// var declaring = ctx.CurrentTypeDefinition != null ? ctx.CurrentTypeDefinition.DeclaringTypeDefinition : null;
+// if (declaring != null) {
+// while (dt != null) {
+// if (dt.Equals (declaring)) {
+// builder.AlwaysUseShortTypeNames = true;
+// break;
+// }
+// dt = dt.DeclaringTypeDefinition;
+// }
+// }
+// }
+// try {
+// return GLib.Markup.EscapeText (builder.ConvertType(type).ToString (ext.FormattingPolicy.CreateOptions ()));
+// } catch (Exception e) {
+// LoggingService.LogError ("Exception while getting short type.", e);
+// return "";
+// }
}
protected string GetParameterString (IParameter parameter)
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/AnonymousMethodCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/AnonymousMethodCompletionData.cs
new file mode 100644
index 0000000000..a9a0652de2
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/AnonymousMethodCompletionData.cs
@@ -0,0 +1,65 @@
+//
+// AnonymousMethodCompletionData.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.CSharp.Formatting;
+
+namespace MonoDevelop.CSharp.Completion
+{
+ class AnonymousMethodCompletionData : RoslynCompletionData
+ {
+ RoslynCodeCompletionFactory factory;
+ public override int PriorityGroup { get { return 2; } }
+
+ public AnonymousMethodCompletionData (RoslynCodeCompletionFactory factory, ICompletionDataKeyHandler keyHandler) : base (keyHandler)
+ {
+ this.factory = factory;
+ this.Icon = "md-newmethod";
+ }
+
+ public override int CompareTo (object obj)
+ {
+ var anonymousMethodCompletionData = obj as AnonymousMethodCompletionData;
+ if (anonymousMethodCompletionData == null)
+ return -1;
+
+ return DisplayText.CompareTo(anonymousMethodCompletionData.DisplayText);
+ }
+
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Ide.Editor.Extension.KeyDescriptor descriptor)
+ {
+ base.InsertCompletionText (window, ref ka, descriptor);
+ factory.Ext.Editor.GetContent<CSharpTextEditorIndentation> ().DoReSmartIndent ();
+ if (this.CompletionText.Contains ("\n")) {
+
+ factory.Ext.Editor.GetContent<CSharpTextEditorIndentation> ().DoReSmartIndent (factory.Ext.Editor.GetLine (factory.Ext.Editor.CaretLine).NextLine.Offset);
+ }
+ }
+
+
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ArrayTypeParameterDataProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ArrayTypeParameterDataProvider.cs
index f909337cbf..e41ed579e5 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ArrayTypeParameterDataProvider.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ArrayTypeParameterDataProvider.cs
@@ -29,7 +29,6 @@ using ICSharpCode.NRefactory.CSharp.Resolver;
using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.CSharp.Formatting;
using ICSharpCode.NRefactory.CSharp.TypeSystem;
-using Mono.TextEditor;
namespace MonoDevelop.CSharp.Completion
{
@@ -47,9 +46,9 @@ namespace MonoDevelop.CSharp.Completion
var tooltipInfo = new TooltipInformation ();
var file = ext.CSharpUnresolvedFile;
var compilation = ext.UnresolvedFileCompilation;
- var textEditorData = ext.TextEditorData;
+ var textEditorData = ext.Editor;
var formattingPolicy = ext.FormattingPolicy;
- var resolver = file.GetResolver (compilation, textEditorData.Caret.Location);
+ var resolver = file.GetResolver (compilation, textEditorData.CaretLocation);
var sig = new SignatureMarkupCreator (resolver, formattingPolicy.CreateOptions ());
sig.HighlightParameter = currentParameter;
tooltipInfo.SignatureMarkup = sig.GetArrayIndexerMarkup (arrayType);
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs
index daa38a4a2d..82df3930d5 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs
@@ -26,45 +26,46 @@
using System;
using System.Linq;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
+using MonoDevelop.Core;
using System.Collections.Generic;
-using Mono.TextEditor;
-
-using MonoDevelop.Core;
using MonoDevelop.Debugger;
-using MonoDevelop.Projects;
using MonoDevelop.Ide.Gui;
using MonoDevelop.CodeGeneration;
-using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Ide.Gui.Content;
-using MonoDevelop.Ide.CodeTemplates;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Components.Commands;
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.Semantics;
-using ICSharpCode.NRefactory.Completion;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using ICSharpCode.NRefactory.CSharp.Completion;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-
-using MonoDevelop.CSharp.Project;
using MonoDevelop.CSharp.Formatting;
-using MonoDevelop.CSharp.Refactoring.CodeActions;
-using MonoDevelop.Refactoring;
+
+using ICSharpCode.NRefactory6.CSharp.Completion;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+
+using MonoDevelop.Ide.Editor.Extension;
+using MonoDevelop.Ide.Editor;
+using System.Threading.Tasks;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp;
using System.Xml;
+using ICSharpCode.NRefactory6.CSharp;
+using MonoDevelop.Refactoring;
+using System.Diagnostics;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using MonoDevelop.Ide;
+using Mono.Addins;
+using System.Reflection;
+using System.Runtime.ExceptionServices;
+using MonoDevelop.Ide.TypeSystem;
+using RefactoringEssentials;
+using MonoDevelop.CSharp.Diagnostics.InconsistentNaming;
+using RefactoringEssentials.CSharp.Diagnostics;
namespace MonoDevelop.CSharp.Completion
{
- public class CSharpCompletionTextEditorExtension : CompletionTextEditorExtension, IParameterCompletionDataFactory, ITextEditorMemberPositionProvider, IDebuggerExpressionResolver
+ sealed class CSharpCompletionTextEditorExtension : CompletionTextEditorExtension, IDebuggerExpressionResolver
{
- internal protected virtual Mono.TextEditor.TextEditorData TextEditorData {
+/* internal protected virtual Mono.TextEditor.TextEditorData TextEditorData {
get {
var doc = Document;
if (doc == null)
@@ -76,9 +77,12 @@ namespace MonoDevelop.CSharp.Completion
protected virtual IProjectContent ProjectContent {
get { return Document.GetProjectContext (); }
}
-
+*/
SyntaxTree unit;
- static readonly SyntaxTree emptyUnit = new SyntaxTree ();
+ static readonly SyntaxTree emptyUnit = CSharpSyntaxTree.ParseText ("");
+
+ List<CompletionContextHandler> additionalContextHandlers = new List<CompletionContextHandler> ();
+
SyntaxTree Unit {
get {
return unit ?? emptyUnit;
@@ -87,36 +91,16 @@ namespace MonoDevelop.CSharp.Completion
unit = value;
}
}
-
- public new MonoDevelop.Ide.Gui.Document Document {
- get {
- return base.document;
- }
- }
- public ICompilation UnresolvedFileCompilation {
- get;
- set;
- }
-
- public CSharpUnresolvedFile CSharpUnresolvedFile {
- get;
- set;
- }
-
- public ParsedDocument ParsedDocument {
+ public MonoDevelop.Ide.TypeSystem.ParsedDocument ParsedDocument {
get {
- return document.ParsedDocument;
+ return DocumentContext.ParsedDocument;
}
}
-
- public virtual ICompilation Compilation {
- get { return Project != null ? TypeSystemService.GetCompilation (Project) : ProjectContent.CreateCompilation (); }
- }
-
+
public MonoDevelop.Projects.Project Project {
get {
- return document.Project;
+ return DocumentContext.Project;
}
}
@@ -125,11 +109,7 @@ namespace MonoDevelop.CSharp.Completion
get {
if (policy == null) {
IEnumerable<string> types = MonoDevelop.Ide.DesktopService.GetMimeTypeInheritanceChain (MonoDevelop.CSharp.Formatting.CSharpFormatter.MimeType);
- if (Document.Project != null && Document.Project.Policies != null) {
- policy = base.Document.Project.Policies.Get<CSharpFormattingPolicy> (types);
- } else {
- policy = MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<CSharpFormattingPolicy> (types);
- }
+ policy = DocumentContext.GetPolicy<CSharpFormattingPolicy> (types);
}
return policy;
}
@@ -141,14 +121,58 @@ namespace MonoDevelop.CSharp.Completion
}
}
- internal MDRefactoringContext MDRefactoringCtx {
- get;
- private set;
+ internal static Func<Microsoft.CodeAnalysis.Document, CancellationToken, Task<Microsoft.CodeAnalysis.Document>> WithFrozenPartialSemanticsAsync;
+ static List<CompletionData> snippets;
+
+ static CSharpCompletionTextEditorExtension ()
+ {
+ try {
+ var methodInfo = typeof (Microsoft.CodeAnalysis.Document).GetMethod ("WithFrozenPartialSemanticsAsync", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.InvokeMethod);
+ if (methodInfo == null)
+ LoggingService.LogError ("Error in completion set up: Document.WithFrozenPartialSemanticsAsync not found!");
+
+ WithFrozenPartialSemanticsAsync = delegate (Microsoft.CodeAnalysis.Document doc, CancellationToken token) {
+ try {
+ return (Task<Microsoft.CodeAnalysis.Document>)methodInfo.Invoke (doc, new object [] { token });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture (ex.InnerException).Throw ();
+ return null;
+ }
+ };
+
+ CompletionEngine.SnippetCallback = delegate (CancellationToken arg) {
+ if (snippets != null)
+ return Task.FromResult ((IEnumerable<CompletionData>)snippets);
+ var newSnippets = new List<CompletionData> ();
+ foreach (var ct in MonoDevelop.Ide.CodeTemplates.CodeTemplateService.GetCodeTemplates ("text/x-csharp")) {
+ if (string.IsNullOrEmpty (ct.Shortcut) || ct.CodeTemplateContext != MonoDevelop.Ide.CodeTemplates.CodeTemplateContext.Standard)
+ continue;
+ newSnippets.Add (new RoslynCompletionData (null) {
+ CompletionText = ct.Shortcut,
+ DisplayText = ct.Shortcut,
+ Description = ct.Shortcut + Environment.NewLine + GettextCatalog.GetString (ct.Description),
+ Icon = ct.Icon
+ });
+ }
+ snippets = newSnippets;
+ return Task.FromResult ((IEnumerable<CompletionData>)newSnippets);
+ };
+ NameProposalService.Replace (new NameConventionRule.NamePropsalStrategy ());
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while loading c# completion text editor extension.", e);
+ }
}
-
public CSharpCompletionTextEditorExtension ()
{
+ try {
+ foreach (var node in AddinManager.GetExtensionNodes<InstanceExtensionNode> ("/MonoDevelop/CSharp/Completion/ContextHandler")) {
+ var handler = (CompletionContextHandler)node.CreateInstance ();
+ additionalContextHandlers.Add (handler);
+ }
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while creating c# completion text editor extension.", e);
+ }
}
bool addEventHandlersInInitialization = true;
@@ -160,23 +184,23 @@ namespace MonoDevelop.CSharp.Completion
public CSharpCompletionTextEditorExtension (MonoDevelop.Ide.Gui.Document doc, bool addEventHandlersInInitialization = true) : this ()
{
this.addEventHandlersInInitialization = addEventHandlersInInitialization;
- Initialize (doc);
+ Initialize (doc.Editor, doc);
}
- public override void Initialize ()
+ protected override void Initialize ()
{
base.Initialize ();
- var parsedDocument = document.ParsedDocument;
+
+ var parsedDocument = DocumentContext.ParsedDocument;
if (parsedDocument != null) {
- this.Unit = parsedDocument.GetAst<SyntaxTree> ();
- this.UnresolvedFileCompilation = Compilation;
- this.CSharpUnresolvedFile = parsedDocument.ParsedFile as CSharpUnresolvedFile;
- if (addEventHandlersInInitialization)
- document.Editor.Caret.PositionChanged += HandlePositionChanged;
+// this.Unit = parsedDocument.GetAst<SyntaxTree> ();
+// this.UnresolvedFileCompilation = DocumentContext.Compilation;
+// this.CSharpUnresolvedFile = parsedDocument.ParsedFile as CSharpUnresolvedFile;
+// Editor.CaretPositionChanged += HandlePositionChanged;
}
-
+
if (addEventHandlersInInitialization)
- Document.DocumentParsed += HandleDocumentParsed;
+ DocumentContext.DocumentParsed += HandleDocumentParsed;
}
CancellationTokenSource src = new CancellationTokenSource ();
@@ -186,46 +210,27 @@ namespace MonoDevelop.CSharp.Completion
src.Cancel ();
src = new CancellationTokenSource ();
}
-
- void HandlePositionChanged (object sender, DocumentLocationEventArgs e)
- {
- StopPositionChangedTask ();
- var doc = Document;
- if (doc == null || doc.Editor == null)
- return;
- MDRefactoringContext.Create (doc, doc.Editor.Caret.Location, src.Token).ContinueWith (t => {
- MDRefactoringCtx = t.Result;
- }, TaskContinuationOptions.ExecuteSynchronously);
- }
-
+
[CommandUpdateHandler (CodeGenerationCommands.ShowCodeGenerationWindow)]
public void CheckShowCodeGenerationWindow (CommandInfo info)
{
- info.Enabled = TextEditorData != null && Document.GetContent<ICompletionWidget> () != null;
+ info.Enabled = Editor != null && DocumentContext.GetContent<ICompletionWidget> () != null;
}
[CommandHandler (CodeGenerationCommands.ShowCodeGenerationWindow)]
public void ShowCodeGenerationWindow ()
{
- var completionWidget = Document.GetContent<ICompletionWidget> ();
+ var completionWidget = DocumentContext.GetContent<ICompletionWidget> ();
if (completionWidget == null)
return;
- CodeCompletionContext completionContext = completionWidget.CreateCodeCompletionContext (TextEditorData.Caret.Offset);
- GenerateCodeWindow.ShowIfValid (Document, completionContext);
+ CodeCompletionContext completionContext = completionWidget.CreateCodeCompletionContext (Editor.CaretOffset);
+ GenerateCodeWindow.ShowIfValid (Editor, DocumentContext, completionContext);
}
public override void Dispose ()
{
- StopPositionChangedTask ();
- unit = null;
- CSharpUnresolvedFile = null;
- UnresolvedFileCompilation = null;
- Document.DocumentParsed -= HandleDocumentParsed;
- if (unstableTypeSystemSegmentTree != null) {
- unstableTypeSystemSegmentTree.RemoveListener ();
- unstableTypeSystemSegmentTree = null;
- }
-
+ CancelParsedDocumentUpdate ();
+ DocumentContext.DocumentParsed -= HandleDocumentParsed;
if (validTypeSystemSegmentTree != null) {
validTypeSystemSegmentTree.RemoveListener ();
validTypeSystemSegmentTree = null;
@@ -234,32 +239,38 @@ namespace MonoDevelop.CSharp.Completion
base.Dispose ();
}
+ CancellationTokenSource documentParsedTokenSrc = new CancellationTokenSource ();
+
void HandleDocumentParsed (object sender, EventArgs e)
{
- var newDocument = Document.ParsedDocument;
- if (newDocument == null)
+ var parsedDocument = DocumentContext.ParsedDocument;
+ if (parsedDocument == null)
return;
- var newTree = TypeSystemSegmentTree.Create (newDocument, TextEditorData);
-
- if (unstableTypeSystemSegmentTree != null)
- unstableTypeSystemSegmentTree.RemoveListener ();
-
- if (!newDocument.HasErrors) {
- if (validTypeSystemSegmentTree != null)
- validTypeSystemSegmentTree.RemoveListener ();
- validTypeSystemSegmentTree = newTree;
- unstableTypeSystemSegmentTree = null;
- } else {
- unstableTypeSystemSegmentTree = newTree;
- }
- newTree.InstallListener (document.Editor.Document);
+ var semanticModel = parsedDocument.GetAst<SemanticModel> ();
+ if (semanticModel == null)
+ return;
+ CancelParsedDocumentUpdate ();
+ var token = documentParsedTokenSrc.Token;
+ Task.Run(delegate {
+ try {
+ var newTree = TypeSystemSegmentTree.Create (semanticModel, token);
+ if (validTypeSystemSegmentTree != null)
+ validTypeSystemSegmentTree.RemoveListener ();
+ validTypeSystemSegmentTree = newTree;
+ newTree.InstallListener (Editor);
+ if (TypeSegmentTreeUpdated != null)
+ TypeSegmentTreeUpdated (this, EventArgs.Empty);
+ } catch (OperationCanceledException) {
+ }
+ });
+ }
- this.Unit = newDocument.GetAst<SyntaxTree> ();
- this.CSharpUnresolvedFile = newDocument.ParsedFile as CSharpUnresolvedFile;
- this.UnresolvedFileCompilation = Compilation;
- if (TypeSegmentTreeUpdated != null)
- TypeSegmentTreeUpdated (this, EventArgs.Empty);
+ void CancelParsedDocumentUpdate ()
+ {
+ documentParsedTokenSrc.Cancel ();
+ documentParsedTokenSrc = new CancellationTokenSource ();
}
+
public event EventHandler TypeSegmentTreeUpdated;
public void UpdateParsedDocument ()
@@ -267,11 +278,11 @@ namespace MonoDevelop.CSharp.Completion
HandleDocumentParsed (null, null);
}
- public override bool KeyPress (Gdk.Key key, char keyChar, Gdk.ModifierType modifier)
+ public override bool KeyPress (KeyDescriptor descriptor)
{
- bool result = base.KeyPress (key, keyChar, modifier);
+ bool result = base.KeyPress (descriptor);
- if (/*EnableParameterInsight &&*/ (keyChar == ',' || keyChar == ')') && CanRunParameterCompletionCommand ())
+ if (/*EnableParameterInsight &&*/ (descriptor.KeyChar == ',' || descriptor.KeyChar == ')') && CanRunParameterCompletionCommand ())
base.RunParameterCompletionCommand ();
// if (IsInsideComment ())
@@ -279,26 +290,27 @@ namespace MonoDevelop.CSharp.Completion
return result;
}
- public override ICompletionDataList HandleCodeCompletion (CodeCompletionContext completionContext, char completionChar, ref int triggerWordLength)
+ public override Task<ICompletionDataList> HandleCodeCompletionAsync (CodeCompletionContext completionContext, char completionChar, CancellationToken token = default(CancellationToken))
{
// if (!EnableCodeCompletion)
// return null;
- if (!EnableAutoCodeCompletion && char.IsLetter (completionChar))
+ if (!IdeApp.Preferences.EnableAutoCodeCompletion && char.IsLetter (completionChar))
return null;
// var timer = Counters.ResolveTime.BeginTiming ();
try {
+ int triggerWordLength = 0;
if (char.IsLetterOrDigit (completionChar) || completionChar == '_') {
- if (completionContext.TriggerOffset > 1 && char.IsLetterOrDigit (TextEditorData.GetCharAt (completionContext.TriggerOffset - 2)))
+ if (completionContext.TriggerOffset > 1 && char.IsLetterOrDigit (Editor.GetCharAt (completionContext.TriggerOffset - 2)))
return null;
triggerWordLength = 1;
}
- return InternalHandleCodeCompletion (completionContext, completionChar, false, ref triggerWordLength);
+ return InternalHandleCodeCompletion (completionContext, completionChar, false, triggerWordLength, token);
} catch (Exception e) {
LoggingService.LogError ("Unexpected code completion exception." + Environment.NewLine +
- "FileName: " + Document.FileName + Environment.NewLine +
+ "FileName: " + DocumentContext.Name + Environment.NewLine +
"Position: line=" + completionContext.TriggerLine + " col=" + completionContext.TriggerLineOffset + Environment.NewLine +
- "Line text: " + TextEditorData.GetLineText (completionContext.TriggerLine),
+ "Line text: " + Editor.GetLineText (completionContext.TriggerLine),
e);
return null;
} finally {
@@ -307,12 +319,51 @@ namespace MonoDevelop.CSharp.Completion
}
}
- class CSharpCompletionDataList : CompletionDataList
+ static bool IsIdentifierPart (char ch)
{
- public CSharpResolver Resolver {
- get;
- set;
+ return char.IsLetterOrDigit (ch) || ch == '_';
+ }
+
+ public override Task<ICompletionDataList> HandleBackspaceOrDeleteCodeCompletionAsync (CodeCompletionContext completionContext, SpecialKey key, char triggerCharacter, CancellationToken token = default(CancellationToken))
+ {
+ if (!IdeApp.Preferences.EnableAutoCodeCompletion)
+ return null;
+ if (!char.IsLetterOrDigit (triggerCharacter) && triggerCharacter != '_')
+ return null;
+ //char completionChar = Editor.GetCharAt (completionContext.TriggerOffset - 1);
+ //Console.WriteLine ("completion char: " + completionChar);
+ // var timer = Counters.ResolveTime.BeginTiming ();
+
+ if (key == SpecialKey.BackSpace || key == SpecialKey.Delete) {
+ char ch = completionContext.TriggerOffset > 0 ? Editor.GetCharAt (completionContext.TriggerOffset - 1) : '\0';
+ char ch2 = completionContext.TriggerOffset < Editor.Length ? Editor.GetCharAt (completionContext.TriggerOffset) : '\0';
+ if (!IsIdentifierPart (ch) && !IsIdentifierPart (ch2))
+ return null;
}
+ try {
+ int triggerWordLength = 0;
+ return InternalHandleCodeCompletion (completionContext, triggerCharacter, true, triggerWordLength, token).ContinueWith ( t => {
+ var result = (CompletionDataList)t.Result;
+ if (result == null)
+ return null;
+ result.AutoCompleteUniqueMatch = false;
+ result.AutoCompleteEmptyMatch = false;
+ return (ICompletionDataList)result;
+ });
+ } catch (Exception e) {
+ LoggingService.LogError ("Unexpected code completion exception." + Environment.NewLine +
+ "FileName: " + DocumentContext.Name + Environment.NewLine +
+ "Position: line=" + completionContext.TriggerLine + " col=" + completionContext.TriggerLineOffset + Environment.NewLine +
+ "Line text: " + Editor.GetLineText (completionContext.TriggerLine),
+ e);
+ return null;
+ } finally {
+ // if (timer != null)
+ // timer.Dispose ();
+ } }
+
+ class CSharpCompletionDataList : CompletionDataList
+ {
}
interface IListData
@@ -320,120 +371,186 @@ namespace MonoDevelop.CSharp.Completion
CSharpCompletionDataList List { get; set; }
}
- ICompletionContextProvider CreateContextProvider ()
- {
- return new CompletionContextProvider (document.ParsedDocument, TextEditorData, validTypeSystemSegmentTree, unstableTypeSystemSegmentTree);
- }
- CSharpTypeResolveContext CreateTypeResolveContext ()
+ void AddImportCompletionData (CompletionResult completionResult, CSharpCompletionDataList result, RoslynCodeCompletionFactory factory, SemanticModel semanticModel, int position, CancellationToken cancellationToken = default(CancellationToken))
{
- var compilation = UnresolvedFileCompilation;
- if (compilation == null)
- return null;
- var rctx = new CSharpTypeResolveContext (compilation.MainAssembly);
- var loc = TextEditorData.Caret.Location;
- rctx = rctx.WithUsingScope (CSharpUnresolvedFile.GetUsingScope (loc).Resolve (compilation));
- int offset = TextEditorData.Caret.Offset;
- var curDef = GetTypeAt (offset);
- if (curDef != null) {
- var resolvedDef = curDef.Resolve (rctx).GetDefinition ();
- if (resolvedDef == null)
- return rctx;
- rctx = rctx.WithCurrentTypeDefinition (resolvedDef);
- var foundMember = GetMemberAt (offset);
- if (foundMember != null) {
- var curMember = resolvedDef.Members.FirstOrDefault (m => m.Region.FileName == foundMember.Region.FileName && m.Region.Begin == foundMember.Region.Begin);
- if (curMember != null)
- rctx = rctx.WithCurrentMember (curMember);
+ if (result.Count == 0)
+ return;
+ var root = semanticModel.SyntaxTree.GetRoot ();
+ var node = root.FindNode (TextSpan.FromBounds (position, position));
+ var syntaxTree = root.SyntaxTree;
+
+ if (syntaxTree.IsInNonUserCode(position, cancellationToken) ||
+ syntaxTree.GetContainingTypeOrEnumDeclaration(position, cancellationToken) is EnumDeclarationSyntax ||
+ syntaxTree.IsPreProcessorDirectiveContext(position, cancellationToken))
+ return;
+
+ var extensionMethodImport = syntaxTree.IsRightOfDotOrArrowOrColonColon (position, cancellationToken);
+ ITypeSymbol extensionType = null;
+
+ if (extensionMethodImport) {
+ var memberAccess = completionResult.SyntaxContext.TargetToken.Parent as MemberAccessExpressionSyntax;
+ if (memberAccess != null) {
+ extensionType = completionResult.SyntaxContext.SemanticModel.GetTypeInfo (memberAccess.Expression).Type;
+ if (extensionType == null) {
+ return;
+ }
+ } else {
+ return;
}
}
- return rctx;
+ var tokenLeftOfPosition = syntaxTree.FindTokenOnLeftOfPosition (position, cancellationToken);
+
+ if (extensionMethodImport ||
+ syntaxTree.IsGlobalStatementContext (position, cancellationToken) ||
+ syntaxTree.IsExpressionContext (position, tokenLeftOfPosition, true, cancellationToken) ||
+ syntaxTree.IsStatementContext (position, tokenLeftOfPosition, cancellationToken) ||
+ syntaxTree.IsTypeContext (position, cancellationToken) ||
+ syntaxTree.IsTypeDeclarationContext (position, tokenLeftOfPosition, cancellationToken) ||
+ syntaxTree.IsNamespaceContext (position, cancellationToken) ||
+ syntaxTree.IsMemberDeclarationContext (position, tokenLeftOfPosition, cancellationToken) ||
+ syntaxTree.IsLabelContext (position, cancellationToken)) {
+ var usedNamespaces = new HashSet<string> ();
+ foreach (var un in semanticModel.GetUsingNamespacesInScope (node)) {
+ usedNamespaces.Add (un.GetFullName ());
+ }
+ var enclosingNamespaceName = semanticModel.GetEnclosingNamespace (position, cancellationToken).GetFullName ();
+
+ var stack = new Stack<INamespaceOrTypeSymbol>();
+ foreach (var member in semanticModel.Compilation.GlobalNamespace.GetNamespaceMembers ())
+ stack.Push (member);
+ var extMethodDict = extensionMethodImport ? new Dictionary<INamespaceSymbol, List<ImportSymbolCompletionData>> () : null;
+ while (stack.Count > 0) {
+ if (cancellationToken.IsCancellationRequested)
+ break;
+ var current = stack.Pop();
+ var currentNs = current as INamespaceSymbol;
+ if (currentNs != null) {
+ var currentNsName = currentNs.GetFullName ();
+ if (usedNamespaces.Contains (currentNsName) ||
+ enclosingNamespaceName == currentNsName ||
+ (enclosingNamespaceName.StartsWith (currentNsName, StringComparison.Ordinal) &&
+ enclosingNamespaceName [currentNsName.Length] == '.')) {
+ foreach (var member in currentNs.GetNamespaceMembers ())
+ stack.Push (member);
+ } else {
+ foreach (var member in currentNs.GetMembers())
+ stack.Push (member);
+ }
+ } else {
+ var type = (INamedTypeSymbol)current;
+ if (type.IsImplicitClass || type.IsScriptClass)
+ continue;
+ if (type.DeclaredAccessibility != Accessibility.Public) {
+ if (type.DeclaredAccessibility != Accessibility.Internal)
+ continue;
+ if (!type.IsAccessibleWithin (semanticModel.Compilation.Assembly))
+ continue;
+ }
+ if (extensionMethodImport) {
+ if (!type.MightContainExtensionMethods)
+ continue;
+ foreach (var extMethod in type.GetMembers ().OfType<IMethodSymbol> ().Where (method => method.IsExtensionMethod)) {
+ var reducedMethod = extMethod.ReduceExtensionMethod (extensionType);
+ if (reducedMethod != null) {
+ List<ImportSymbolCompletionData> importSymbolList;
+ if (!extMethodDict.TryGetValue (type.ContainingNamespace, out importSymbolList)) {
+ extMethodDict.Add (type.ContainingNamespace, importSymbolList = new List<ImportSymbolCompletionData> ());
+ }
+ var newData = new ImportSymbolCompletionData (this, factory, reducedMethod, false);
+ var existingItem = importSymbolList.FirstOrDefault (data => data.Symbol.Name == extMethod.Name);
+ if (existingItem != null) {
+ existingItem.AddOverload (newData);
+ } else {
+ result.Add (newData);
+ importSymbolList.Add (newData);
+ }
+ }
+ }
+ } else {
+ result.Add (new ImportSymbolCompletionData (this, factory, type, false));
+ }
+ }
+ }
+ }
}
- CompletionEngineCache cache = new CompletionEngineCache ();
- ICompletionDataList InternalHandleCodeCompletion (CodeCompletionContext completionContext, char completionChar, bool ctrlSpace, ref int triggerWordLength)
+
+ Task<ICompletionDataList> InternalHandleCodeCompletion (CodeCompletionContext completionContext, char completionChar, bool ctrlSpace, int triggerWordLength, CancellationToken token, bool forceSymbolCompletion = false)
{
- var data = TextEditorData;
- if (data.CurrentMode is TextLinkEditMode) {
- if (((TextLinkEditMode)data.CurrentMode).TextLinkMode == TextLinkMode.EditIdentifier)
- return null;
- }
- if (Unit == null || CSharpUnresolvedFile == null)
- return null;
- if(unstableTypeSystemSegmentTree == null && validTypeSystemSegmentTree == null)
- return null;
+ if (Editor.EditMode != MonoDevelop.Ide.Editor.EditMode.Edit)
+ return Task.FromResult ((ICompletionDataList)null);
+// var data = Editor;
+// if (data.CurrentMode is TextLinkEditMode) {
+// if (((TextLinkEditMode)data.CurrentMode).TextLinkMode == TextLinkMode.EditIdentifier)
+// return null;
+// }
+ var offset = Editor.CaretOffset;
var list = new CSharpCompletionDataList ();
- list.Resolver = CSharpUnresolvedFile != null ? CSharpUnresolvedFile.GetResolver (UnresolvedFileCompilation, TextEditorData.Caret.Location) : new CSharpResolver (Compilation);
- var ctx = CreateTypeResolveContext ();
- if (ctx == null)
- return null;
- var completionDataFactory = new CompletionDataFactory (this, new CSharpResolver (ctx));
- if (MDRefactoringCtx == null) {
- src.Cancel ();
- MDRefactoringCtx = MDRefactoringContext.Create (Document, TextEditorData.Caret.Location).Result;
- }
+ list.TriggerWordLength = triggerWordLength;
+ var analysisDocument = DocumentContext.AnalysisDocument;
+ if (analysisDocument == null)
+ return Task.FromResult ((ICompletionDataList)null);
+ return Task.Run (async delegate {
+ try {
+
+ var partialDoc = await WithFrozenPartialSemanticsAsync (analysisDocument, token).ConfigureAwait (false);
+ var semanticModel = await partialDoc.GetSemanticModelAsync (token).ConfigureAwait (false);
+
+ var roslynCodeCompletionFactory = new RoslynCodeCompletionFactory (this, semanticModel);
+ foreach (var extHandler in additionalContextHandlers.OfType<IExtensionContextHandler> ())
+ extHandler.Init (roslynCodeCompletionFactory);
+ var engine = new CompletionEngine(MonoDevelop.Ide.TypeSystem.TypeSystemService.Workspace, roslynCodeCompletionFactory);
+ var ctx = new ICSharpCode.NRefactory6.CSharp.CompletionContext (partialDoc, offset, semanticModel);
+ ctx.AdditionalContextHandlers = additionalContextHandlers;
+ var triggerInfo = new CompletionTriggerInfo (ctrlSpace ? CompletionTriggerReason.CompletionCommand : CompletionTriggerReason.CharTyped, completionChar);
+ var completionResult = await engine.GetCompletionDataAsync (ctx, triggerInfo, token).ConfigureAwait (false);
+ if (completionResult == CompletionResult.Empty)
+ return null;
+
+ foreach (var symbol in completionResult) {
+ list.Add ((Ide.CodeCompletion.CompletionData)symbol);
+ }
- var engine = new MonoCSharpCompletionEngine (
- this,
- data.Document,
- CreateContextProvider (),
- completionDataFactory,
- ProjectContent,
- ctx
- );
- completionDataFactory.Engine = engine;
- engine.AutomaticallyAddImports = AddImportedItemsToCompletionList.Value;
- engine.IncludeKeywordsInCompletionList = EnableAutoCodeCompletion || IncludeKeywordsInCompletionList.Value;
- engine.CompletionEngineCache = cache;
- if (FilterCompletionListByEditorBrowsable) {
- engine.EditorBrowsableBehavior = IncludeEditorBrowsableAdvancedMembers ? EditorBrowsableBehavior.IncludeAdvanced : EditorBrowsableBehavior.Normal;
- } else {
- engine.EditorBrowsableBehavior = EditorBrowsableBehavior.Ignore;
- }
- if (Document.HasProject && MonoDevelop.Ide.IdeApp.IsInitialized) {
- var configuration = Document.Project.GetConfiguration (MonoDevelop.Ide.IdeApp.Workspace.ActiveConfiguration) as DotNetProjectConfiguration;
- var par = configuration != null ? configuration.CompilationParameters as CSharpCompilerParameters : null;
- if (par != null)
- engine.LanguageVersion = MonoDevelop.CSharp.Parser.TypeSystemParser.ConvertLanguageVersion (par.LangVersion);
- }
+ if (forceSymbolCompletion || (IdeApp.Preferences.AddImportedItemsToCompletionList.Value && list.OfType<RoslynSymbolCompletionData> ().Any (cd => (cd.GetType () == typeof (RoslynSymbolCompletionData)) && (cd.Symbol is ITypeSymbol || cd.Symbol is IMethodSymbol)))) {
+ AddImportCompletionData (completionResult, list, roslynCodeCompletionFactory, semanticModel, offset, token);
+ }
- engine.FormattingPolicy = FormattingPolicy.CreateOptions ();
- engine.EolMarker = data.EolMarker;
- engine.IndentString = data.Options.IndentationString;
- try {
- foreach (var cd in engine.GetCompletionData (completionContext.TriggerOffset, ctrlSpace)) {
- list.Add (cd);
- if (cd is IListData)
- ((IListData)cd).List = list;
+ list.AutoCompleteEmptyMatch = completionResult.AutoCompleteEmptyMatch;
+ // list.AutoCompleteEmptyMatchOnCurlyBrace = completionResult.AutoCompleteEmptyMatchOnCurlyBracket;
+ list.AutoSelect = completionResult.AutoSelect;
+ list.DefaultCompletionString = completionResult.DefaultCompletionString;
+ // list.CloseOnSquareBrackets = completionResult.CloseOnSquareBrackets;
+ if (ctrlSpace)
+ list.AutoCompleteUniqueMatch = true;
+ } catch (OperationCanceledException) {
+ return null;
+ } catch (AggregateException e) {
+ e.Flatten ().Handle (f => f is OperationCanceledException);
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while getting C# recommendations", e);
}
- } catch (Exception e) {
- LoggingService.LogError ("Error while getting completion data.", e);
- }
- list.AutoCompleteEmptyMatch = engine.AutoCompleteEmptyMatch;
- list.AutoCompleteEmptyMatchOnCurlyBrace = engine.AutoCompleteEmptyMatchOnCurlyBracket;
- list.AutoSelect = engine.AutoSelect;
- list.DefaultCompletionString = engine.DefaultCompletionString;
- list.CloseOnSquareBrackets = engine.CloseOnSquareBrackets;
- if (ctrlSpace)
- list.AutoCompleteUniqueMatch = true;
- return list.Count > 0 ? list : null;
+ return (ICompletionDataList)list;
+ });
}
- public override ICompletionDataList CodeCompletionCommand (CodeCompletionContext completionContext)
+ public override Task<ICompletionDataList> CodeCompletionCommand (CodeCompletionContext completionContext)
{
int triggerWordLength = 0;
- char ch = completionContext.TriggerOffset > 0 ? TextEditorData.GetCharAt (completionContext.TriggerOffset - 1) : '\0';
- return InternalHandleCodeCompletion (completionContext, ch, true, ref triggerWordLength);
+ char ch = completionContext.TriggerOffset > 0 ? Editor.GetCharAt (completionContext.TriggerOffset - 1) : '\0';
+ return InternalHandleCodeCompletion (completionContext, ch, true, triggerWordLength, default(CancellationToken));
}
- static bool HasAllUsedParameters (IParameterDataProvider provider, List<string> list, int n)
+ static bool HasAllUsedParameters (MonoDevelop.Ide.CodeCompletion.ParameterHintingData provider, string[] list)
{
- int pc = provider.GetParameterCount (n);
+ if (provider == null || list == null)
+ return true;
+ int pc = provider.ParameterCount;
foreach (var usedParam in list) {
bool found = false;
for (int m = 0; m < pc; m++) {
- if (usedParam == provider.GetParameterName (n, m)){
+ if (usedParam == provider.GetParameterName (m)){
found = true;
break;
}
@@ -443,29 +560,24 @@ namespace MonoDevelop.CSharp.Completion
}
return true;
}
- public override int GuessBestMethodOverload (IParameterDataProvider provider, int currentOverload)
+
+ public override async Task<int> GuessBestMethodOverload (MonoDevelop.Ide.CodeCompletion.ParameterHintingResult provider, int currentOverload, CancellationToken token)
{
- var ctx = CreateTypeResolveContext ();
- if (ctx == null)
+ var analysisDocument = DocumentContext.AnalysisDocument;
+ if (analysisDocument == null)
return -1;
- var engine = new CSharpParameterCompletionEngine (
- TextEditorData.Document,
- CreateContextProvider (),
- this,
- ProjectContent,
- ctx
- );
- List<string> list;
- int cparam = engine.GetCurrentParameterIndex (provider.StartOffset, TextEditorData.Caret.Offset, out list);
- if (cparam > provider.GetParameterCount (currentOverload) && !provider.AllowParameterList (currentOverload) || !HasAllUsedParameters (provider, list, currentOverload)) {
+ var result = await ICSharpCode.NRefactory6.CSharp.ParameterUtil.GetCurrentParameterIndex (analysisDocument, provider.StartOffset, Editor.CaretOffset);
+ var cparam = result.ParameterIndex;
+ var list = result.UsedNamespaceParameters;
+ if (cparam > provider[currentOverload].ParameterCount && !provider[currentOverload].IsParameterListAllowed || !HasAllUsedParameters (provider[currentOverload], list)) {
// Look for an overload which has more parameters
int bestOverload = -1;
int bestParamCount = int.MaxValue;
for (int n = 0; n < provider.Count; n++) {
- int pc = provider.GetParameterCount (n);
+ int pc = provider[n].ParameterCount;
if (pc < bestParamCount && pc >= cparam) {
- if (HasAllUsedParameters (provider, list, n)) {
+ if (HasAllUsedParameters (provider[n], list)) {
bestOverload = n;
bestParamCount = pc;
}
@@ -475,7 +587,7 @@ namespace MonoDevelop.CSharp.Completion
}
if (bestOverload == -1) {
for (int n=0; n<provider.Count; n++) {
- if (provider.AllowParameterList (n) && HasAllUsedParameters (provider, list, n)) {
+ if (provider[n].IsParameterListAllowed && HasAllUsedParameters (provider[n], list)) {
bestOverload = n;
break;
}
@@ -487,12 +599,12 @@ namespace MonoDevelop.CSharp.Completion
}
- static bool ContainsPublicConstructors (ITypeDefinition t)
- {
- if (t.Methods.Count (m => m.IsConstructor) == 0)
- return true;
- return t.Methods.Any (m => m.IsConstructor && m.IsPublic);
- }
+// static bool ContainsPublicConstructors (ITypeDefinition t)
+// {
+// if (t.Methods.Count (m => m.IsConstructor) == 0)
+// return true;
+// return t.Methods.Any (m => m.IsConstructor && m.IsPublic);
+// }
// CompletionDataList result = new ProjectDomCompletionDataList ();
@@ -599,141 +711,75 @@ namespace MonoDevelop.CSharp.Completion
// }
// }
// }
-
- public override ParameterDataProvider HandleParameterCompletion (CodeCompletionContext completionContext, char completionChar)
+
+ public override Task<Ide.CodeCompletion.ParameterHintingResult> ParameterCompletionCommand (CodeCompletionContext completionContext)
{
-// if (!EnableCodeCompletion)
-// return null;
- if (Unit == null || CSharpUnresolvedFile == null)
- return null;
- var ctx = CreateTypeResolveContext ();
- if (ctx == null)
- return null;
+ char ch = completionContext.TriggerOffset > 0 ? Editor.GetCharAt (completionContext.TriggerOffset - 1) : '\0';
+ return InternalHandleParameterCompletionCommand (completionContext, ch, true, default(CancellationToken));
+ }
- if (completionChar != '(' && completionChar != ',')
- return null;
+ public override Task<MonoDevelop.Ide.CodeCompletion.ParameterHintingResult> HandleParameterCompletionAsync (CodeCompletionContext completionContext, char completionChar, CancellationToken token = default (CancellationToken))
+ {
+ return InternalHandleParameterCompletionCommand (completionContext, completionChar, false, token);
+ }
+ public async Task<MonoDevelop.Ide.CodeCompletion.ParameterHintingResult> InternalHandleParameterCompletionCommand (CodeCompletionContext completionContext, char completionChar, bool force, CancellationToken token = default(CancellationToken))
+ {
+ var data = Editor;
+ if (!force && completionChar != '(' && completionChar != ',')
+ return null;
+ if (Editor.EditMode != EditMode.Edit)
+ return null;
+ var offset = Editor.CaretOffset;
try {
- var engine = new CSharpParameterCompletionEngine (
- TextEditorData.Document,
- CreateContextProvider (),
- this,
- ProjectContent,
- ctx
- );
- return engine.GetParameterDataProvider (completionContext.TriggerOffset, completionChar) as ParameterDataProvider;
+
+ var analysisDocument = DocumentContext.AnalysisDocument;
+ if (analysisDocument == null)
+ return null;
+ var partialDoc = await WithFrozenPartialSemanticsAsync (analysisDocument, token);
+ var semanticModel = await partialDoc.GetSemanticModelAsync ();
+ var engine = new ParameterHintingEngine (MonoDevelop.Ide.TypeSystem.TypeSystemService.Workspace, new RoslynParameterHintingFactory ());
+ var result = await engine.GetParameterDataProviderAsync (analysisDocument, semanticModel, offset, token);
+ return new MonoDevelop.Ide.CodeCompletion.ParameterHintingResult (result.OfType<MonoDevelop.Ide.CodeCompletion.ParameterHintingData>().ToList (), result.StartOffset);
} catch (Exception e) {
LoggingService.LogError ("Unexpected parameter completion exception." + Environment.NewLine +
- "FileName: " + Document.FileName + Environment.NewLine +
+ "FileName: " + DocumentContext.Name + Environment.NewLine +
"Position: line=" + completionContext.TriggerLine + " col=" + completionContext.TriggerLineOffset + Environment.NewLine +
- "Line text: " + TextEditorData.GetLineText (completionContext.TriggerLine),
+ "Line text: " + Editor.GetLineText (completionContext.TriggerLine),
e);
- return null;
- } finally {
- // if (timer != null)
- // timer.Dispose ();
}
+ return null;
}
- List<string> GetUsedNamespaces ()
- {
- var scope = CSharpUnresolvedFile.GetUsingScope (TextEditorData.Caret.Location);
- var result = new List<string> ();
- while (scope != null) {
- result.Add (scope.NamespaceName);
- var ctx = CSharpUnresolvedFile.GetResolver (Compilation, scope.Region.Begin);
- foreach (var u in scope.Usings) {
- var ns = u.ResolveNamespace (ctx);
- if (ns == null)
- continue;
- result.Add (ns.FullName);
- }
- scope = scope.Parent;
- }
- return result;
- }
-
- public override bool GetParameterCompletionCommandOffset (out int cpos)
- {
- var ctx = CreateTypeResolveContext ();
- if (ctx == null) {
- cpos = -1;
- return false;
- }
-
- var engine = new CSharpParameterCompletionEngine (
- TextEditorData.Document,
- CreateContextProvider (),
- this,
- ProjectContent,
- ctx
- );
- engine.SetOffset (TextEditorData.Caret.Offset);
- return engine.GetParameterCompletionCommandOffset (out cpos);
- }
-
- public override int GetCurrentParameterIndex (int startOffset)
+// List<string> GetUsedNamespaces ()
+// {
+// var scope = CSharpUnresolvedFile.GetUsingScope (document.Editor.Caret.Location);
+// var result = new List<string> ();
+// while (scope != null) {
+// result.Add (scope.NamespaceName);
+// var ctx = CSharpUnresolvedFile.GetResolver (Document.Compilation, scope.Region.Begin);
+// foreach (var u in scope.Usings) {
+// var ns = u.ResolveNamespace (ctx);
+// if (ns == null)
+// continue;
+// result.Add (ns.FullName);
+// }
+// scope = scope.Parent;
+// }
+// return result;
+// }
+ public override async Task<int> GetCurrentParameterIndex (int startOffset, CancellationToken token)
{
- var ctx = CreateTypeResolveContext ();
- if (ctx == null)
+ var analysisDocument = DocumentContext.AnalysisDocument;
+ var caretOffset = Editor.CaretOffset;
+ if (analysisDocument == null || startOffset > caretOffset)
return -1;
-
- var engine = new CSharpParameterCompletionEngine (
- TextEditorData.Document,
- CreateContextProvider (),
- this,
- ProjectContent,
- ctx
- );
- List<string> list;
- return engine.GetCurrentParameterIndex (startOffset, TextEditorData.Caret.Offset, out list);
+ var partialDoc = await WithFrozenPartialSemanticsAsync (analysisDocument, default(CancellationToken)).ConfigureAwait (false);
+ var result = ParameterUtil.GetCurrentParameterIndex (partialDoc, startOffset, caretOffset).Result;
+ return result.ParameterIndex;
}
- /*
- internal int GetCurrentParameterIndex (ICompletionWidget widget, int offset, int memberStart)
- {
- int cursor = widget.CurrentCodeCompletionContext.TriggerOffset;
- int i = offset;
- if (i > cursor)
- return -1;
- if (i == cursor)
- return 1; // parameters are 1 based
- var types = MonoDevelop.Ide.DesktopService.GetMimeTypeInheritanceChain (CSharpFormatter.MimeType);
- var engine = new CSharpIndentEngine (MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<CSharpFormattingPolicy> (types));
- int index = memberStart + 1;
- int parentheses = 0;
- int bracket = 0;
- do {
- char c = widget.GetChar (i - 1);
- engine.Push (c);
- switch (c) {
- case '{':
- if (!engine.IsInsideOrdinaryCommentOrString)
- bracket++;
- break;
- case '}':
- if (!engine.IsInsideOrdinaryCommentOrString)
- bracket--;
- break;
- case '(':
- if (!engine.IsInsideOrdinaryCommentOrString)
- parentheses++;
- break;
- case ')':
- if (!engine.IsInsideOrdinaryCommentOrString)
- parentheses--;
- break;
- case ',':
- if (!engine.IsInsideOrdinaryCommentOrString && parentheses == 1 && bracket == 0)
- index++;
- break;
- }
- i++;
- } while (i <= cursor && parentheses >= 0);
-
- return parentheses != 1 || bracket > 0 ? -1 : index;
- }*/
-
+/*
#region ICompletionDataFactory implementation
internal class CompletionDataFactory : ICompletionDataFactory
{
@@ -821,10 +867,10 @@ namespace MonoDevelop.CSharp.Completion
overloads.Add (data);
}
- public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
var currentWord = GetCurrentWord (window);
- if (CompletionText == "new()" && keyChar == '(') {
+ if (CompletionText == "new()" && descriptor.KeyChar == '(') {
window.CompletionWidget.SetCompletionText (window.CodeCompletionContext, currentWord, "new");
} else {
window.CompletionWidget.SetCompletionText (window.CodeCompletionContext, currentWord, CompletionText);
@@ -879,20 +925,20 @@ namespace MonoDevelop.CSharp.Completion
public override TooltipInformation CreateTooltipInformation (bool smartWrap)
{
var def = type.GetDefinition ();
- var result = def != null ? MemberCompletionData.CreateTooltipInformation (compilation, file, List.Resolver, ext.TextEditorData, ext.FormattingPolicy, def, smartWrap) : new TooltipInformation ();
-// if (ConflictingTypes != null) {
-// var conflicts = new StringBuilder ();
-// var sig = new SignatureMarkupCreator (List.Resolver, ext.FormattingPolicy.CreateOptions ());
-// for (int i = 0; i < ConflictingTypes.Count; i++) {
-// var ct = ConflictingTypes[i];
-// if (i > 0)
-// conflicts.AppendLine (",");
-//// if ((i + 1) % 5 == 0)
-//// conflicts.Append (Environment.NewLine + "\t");
-// conflicts.Append (sig.GetTypeReferenceString (((TypeCompletionData)ct).type));
-// }
-// result.AddCategory ("Type Conflicts", conflicts.ToString ());
-// }
+ var result = def != null ? MemberCompletionData.CreateTooltipInformation (compilation, file, List.Resolver, ext.Editor, ext.FormattingPolicy, def, smartWrap) : new TooltipInformation ();
+ if (ConflictingTypes != null) {
+ var conflicts = new StringBuilder ();
+ var sig = new SignatureMarkupCreator (List.Resolver, ext.FormattingPolicy.CreateOptions ());
+ for (int i = 0; i < ConflictingTypes.Count; i++) {
+ var ct = ConflictingTypes[i];
+ if (i > 0)
+ conflicts.AppendLine (",");
+// if ((i + 1) % 5 == 0)
+// conflicts.Append (Environment.NewLine + "\t");
+ conflicts.Append (sig.GetTypeReferenceString (((TypeCompletionData)ct).type));
+ }
+ result.AddCategory ("Type Conflicts", conflicts.ToString ());
+ }
return result;
}
@@ -1024,11 +1070,11 @@ namespace MonoDevelop.CSharp.Completion
- public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
var currentWord = GetCurrentWord (window);
var text = CompletionText;
- if (keyChar != '>')
+ if (descriptor.KeyChar != '>')
text += ">";
window.CompletionWidget.SetCompletionText (window.CodeCompletionContext, currentWord, text);
}
@@ -1065,7 +1111,7 @@ namespace MonoDevelop.CSharp.Completion
}
ICompletionData ICompletionDataFactory.CreateNewPartialCompletionData (int declarationBegin, IUnresolvedTypeDefinition type, IUnresolvedMember m)
{
- var ctx = ext.CSharpUnresolvedFile.GetTypeResolveContext (ext.UnresolvedFileCompilation, ext.TextEditorData.Caret.Location);
+ var ctx = ext.CSharpUnresolvedFile.GetTypeResolveContext (ext.UnresolvedFileCompilation, ext.Editor.CaretLocation);
return new NewOverrideCompletionData (ext, declarationBegin, type, m.CreateResolved (ctx));
}
IEnumerable<ICompletionData> ICompletionDataFactory.CreateCodeTemplateCompletionData ()
@@ -1079,7 +1125,7 @@ namespace MonoDevelop.CSharp.Completion
IEnumerable<ICompletionData> ICompletionDataFactory.CreatePreProcessorDefinesCompletionData ()
{
- var project = ext.document.Project;
+ var project = ext.DocumentContext.Project;
if (project == null)
yield break;
var configuration = project.GetConfiguration (MonoDevelop.Ide.IdeApp.Workspace.ActiveConfiguration) as DotNetProjectConfiguration;
@@ -1148,352 +1194,16 @@ namespace MonoDevelop.CSharp.Completion
}
- class ImportSymbolCompletionData : CompletionData, IEntityCompletionData
- {
- readonly IType type;
- readonly bool useFullName;
- readonly CSharpCompletionTextEditorExtension ext;
- public IType Type {
- get { return this.type; }
- }
-
- public ImportSymbolCompletionData (CSharpCompletionTextEditorExtension ext, bool useFullName, IType type, bool addConstructors)
- {
- this.ext = ext;
- this.useFullName = useFullName;
- this.type = type;
- this.DisplayFlags |= ICSharpCode.NRefactory.Completion.DisplayFlags.IsImportCompletion;
- }
-
- public override TooltipInformation CreateTooltipInformation (bool smartWrap)
- {
- return MemberCompletionData.CreateTooltipInformation (ext, null, type.GetDefinition (), smartWrap);
- }
-
- bool initialized = false;
- bool generateUsing, insertNamespace;
-
- void Initialize ()
- {
- if (initialized)
- return;
- initialized = true;
- if (string.IsNullOrEmpty (type.Namespace))
- return;
- generateUsing = !useFullName;
- insertNamespace = useFullName;
- }
-
- #region IActionCompletionData implementation
- public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
- {
- Initialize ();
- var doc = ext.document;
- using (var undo = doc.Editor.OpenUndoGroup ()) {
- string text = insertNamespace ? type.Namespace + "." + type.Name : type.Name;
- if (text != GetCurrentWord (window)) {
- if (window.WasShiftPressed && generateUsing)
- text = type.Namespace + "." + text;
- window.CompletionWidget.SetCompletionText (window.CodeCompletionContext, GetCurrentWord (window), text);
- }
-
- if (!window.WasShiftPressed && generateUsing) {
- var generator = CodeGenerator.CreateGenerator (doc);
- if (generator != null) {
- generator.AddGlobalNamespaceImport (doc, type.Namespace);
- // reparse
- doc.UpdateParseDocument ();
- }
- }
- }
- ka |= KeyActions.Ignore;
- }
- #endregion
-
- #region ICompletionData implementation
- public override IconId Icon {
- get {
- return type.GetStockIcon ();
- }
- }
-
- public override string DisplayText {
- get {
- return type.Name;
- }
- }
-
- static string GetDefaultDisplaySelection (string description, bool isSelected)
- {
- if (!isSelected)
- return "<span foreground=\"darkgray\">" + description + "</span>";
- return description;
- }
-
- string displayDescription = null;
- public override string GetDisplayDescription (bool isSelected)
- {
- if (displayDescription == null) {
- Initialize ();
- if (generateUsing || insertNamespace) {
- displayDescription = string.Format (GettextCatalog.GetString ("(from '{0}')"), type.Namespace);
- } else {
- displayDescription = "";
- }
- }
- return GetDefaultDisplaySelection (displayDescription, isSelected);
- }
-
- public override string Description {
- get {
- return type.Namespace;
- }
- }
-
- public override string CompletionText {
- get {
- return type.Name;
- }
- }
- #endregion
-
-
- List<CompletionData> overloads;
-
- public override IEnumerable<ICompletionData> OverloadedData {
- get {
- yield return this;
- if (overloads == null)
- yield break;
- foreach (var overload in overloads)
- yield return overload;
- }
- }
-
- public override bool HasOverloads {
- get { return overloads != null && overloads.Count > 0; }
- }
-
- public override void AddOverload (ICSharpCode.NRefactory.Completion.ICompletionData data)
- {
- AddOverload ((ImportSymbolCompletionData)data);
- }
-
- void AddOverload (ImportSymbolCompletionData overload)
- {
- if (overloads == null)
- overloads = new List<CompletionData> ();
- overloads.Add (overload);
- }
-
- IEntity IEntityCompletionData.Entity {
- get {
- return type.GetDefinition ();
- }
- }
- }
-
-
- ICompletionData ICompletionDataFactory.CreateImportCompletionData(IType type, bool useFullName, bool addConstructors)
- {
- return new ImportSymbolCompletionData (ext, useFullName, type, addConstructors);
- }
-
- }
+
#endregion
-
- #region IParameterCompletionDataFactory implementation
- IParameterDataProvider IParameterCompletionDataFactory.CreateConstructorProvider (int startOffset, IType type)
- {
- return new ConstructorParameterDataProvider (startOffset, this, type);
- }
-
- IParameterDataProvider IParameterCompletionDataFactory.CreateConstructorProvider (int startOffset, IType type, AstNode initializer)
- {
- return new ConstructorParameterDataProvider (startOffset, this, type, initializer);
- }
-
- IParameterDataProvider IParameterCompletionDataFactory.CreateMethodDataProvider (int startOffset, IEnumerable<IMethod> methods)
- {
- return new MethodParameterDataProvider (startOffset, this, methods);
- }
-
- IParameterDataProvider IParameterCompletionDataFactory.CreateDelegateDataProvider (int startOffset, IType type)
- {
- return new DelegateDataProvider (startOffset, this, type);
- }
-
- IParameterDataProvider IParameterCompletionDataFactory.CreateIndexerParameterDataProvider (int startOffset, IType type, IEnumerable<IProperty> indexers, AstNode resolvedNode)
- {
- var arrayType = type as ArrayType;
- if (arrayType != null)
- return new ArrayTypeParameterDataProvider (startOffset, this, arrayType);
- return new IndexerParameterDataProvider (startOffset, this, type, indexers, resolvedNode);
- }
+*/
- IParameterDataProvider IParameterCompletionDataFactory.CreateTypeParameterDataProvider (int startOffset, IEnumerable<IType> types)
- {
- return new TypeParameterDataProvider (startOffset, this, types);
- }
-
- IParameterDataProvider IParameterCompletionDataFactory.CreateTypeParameterDataProvider (int startOffset, IEnumerable<IMethod> methods)
- {
- return new TypeParameterDataProvider (startOffset, this, methods);
- }
- #endregion
#region IDebuggerExpressionResolver implementation
- static string GetIdentifierName (TextEditorData editor, Identifier id, out int startOffset)
- {
- startOffset = editor.LocationToOffset (id.StartLocation.Line, id.StartLocation.Column);
-
- return editor.GetTextBetween (id.StartLocation, id.EndLocation);
- }
-
- internal static string ResolveExpression (TextEditorData editor, ResolveResult result, AstNode node, out int startOffset)
- {
- //Console.WriteLine ("result is a {0}", result.GetType ().Name);
- startOffset = -1;
-
- if (result is NamespaceResolveResult ||
- result is ConversionResolveResult ||
- result is ConstantResolveResult ||
- result is ForEachResolveResult ||
- result is TypeIsResolveResult ||
- result is TypeOfResolveResult ||
- result is ErrorResolveResult)
- return null;
-
- if (result.IsCompileTimeConstant)
- return null;
-
- startOffset = editor.LocationToOffset (node.StartLocation.Line, node.StartLocation.Column);
-
- if (result is InvocationResolveResult) {
- var ir = (InvocationResolveResult) result;
- if (ir.Member.Name == ".ctor") {
- // if the user is hovering over something like "new Abc (...)", we want to show them type information for Abc
- return ir.Member.DeclaringType.FullName;
- }
-
- // do not support general method invocation for tooltips because it could cause side-effects
- return null;
- } else if (result is LocalResolveResult) {
- if (node is ParameterDeclaration) {
- // user is hovering over a method parameter, but we don't want to include the parameter type
- var param = (ParameterDeclaration) node;
-
- return GetIdentifierName (editor, param.NameToken, out startOffset);
- }
-
- if (node is VariableInitializer) {
- // user is hovering over something like "int fubar = 5;", but we don't want the expression to include the " = 5"
- var variable = (VariableInitializer) node;
-
- return GetIdentifierName (editor, variable.NameToken, out startOffset);
- }
- } else if (result is MemberResolveResult) {
- var mr = (MemberResolveResult) result;
-
- if (node is PropertyDeclaration) {
- var prop = (PropertyDeclaration) node;
- var name = GetIdentifierName (editor, prop.NameToken, out startOffset);
-
- // if the property is static, then we want to return "Full.TypeName.Property"
- if (prop.Modifiers.HasFlag (Modifiers.Static))
- return mr.Member.DeclaringType.FullName + "." + name;
-
- // otherwise we want to return "this.Property" so that it won't conflict with anything else in the local scope
- return "this." + name;
- }
-
- if (node is FieldDeclaration) {
- var field = (FieldDeclaration) node;
- var name = GetIdentifierName (editor, field.NameToken, out startOffset);
-
- // if the field is static, then we want to return "Full.TypeName.Field"
- if (field.Modifiers.HasFlag (Modifiers.Static))
- return mr.Member.DeclaringType.FullName + "." + name;
-
- // otherwise we want to return "this.Field" so that it won't conflict with anything else in the local scope
- return "this." + name;
- }
-
- if (node is VariableInitializer) {
- // user is hovering over a field declaration that includes initialization
- var variable = (VariableInitializer) node;
- var name = GetIdentifierName (editor, variable.NameToken, out startOffset);
-
- // walk up the AST to find the FieldDeclaration so that we can determine if it is static or not
- var field = variable.GetParent<FieldDeclaration> ();
-
- // if the field is static, then we want to return "Full.TypeName.Field"
- if (field.Modifiers.HasFlag (Modifiers.Static))
- return mr.Member.DeclaringType.FullName + "." + name;
-
- // otherwise we want to return "this.Field" so that it won't conflict with anything else in the local scope
- return "this." + name;
- }
-
- if (node is NamedExpression) {
- // user is hovering over 'Property' in an expression like: var fubar = new Fubar () { Property = baz };
- var variable = node.GetParent<VariableInitializer> ();
- if (variable != null) {
- var variableName = GetIdentifierName (editor, variable.NameToken, out startOffset);
- var name = GetIdentifierName (editor, ((NamedExpression) node).NameToken, out startOffset);
-
- return variableName + "." + name;
- }
- }
- } else if (result is TypeResolveResult) {
- return ((TypeResolveResult) result).Type.FullName;
- }
-
- return editor.GetTextBetween (node.StartLocation, node.EndLocation);
- }
-
- static bool TryResolveAt (Document doc, DocumentLocation loc, out ResolveResult result, out AstNode node)
- {
- if (doc == null)
- throw new ArgumentNullException ("doc");
-
- result = null;
- node = null;
-
- var parsedDocument = doc.ParsedDocument;
- if (parsedDocument == null)
- return false;
-
- var unit = parsedDocument.GetAst<SyntaxTree> ();
- var parsedFile = parsedDocument.ParsedFile as CSharpUnresolvedFile;
-
- if (unit == null || parsedFile == null)
- return false;
-
- try {
- result = ResolveAtLocation.Resolve (new Lazy<ICompilation> (() => doc.Compilation), parsedFile, unit, loc, out node);
- if (result == null || node is Statement)
- return false;
- } catch {
- return false;
- }
-
- return true;
- }
-
- string IDebuggerExpressionResolver.ResolveExpression (TextEditorData editor, Document doc, int offset, out int startOffset)
+ async Task<DebugDataTipInfo> IDebuggerExpressionResolver.ResolveExpressionAsync (IReadonlyTextDocument editor, DocumentContext doc, int offset, CancellationToken cancellationToken)
{
- ResolveResult result;
- AstNode node;
-
- var loc = editor.OffsetToLocation (offset);
- if (!TryResolveAt (doc, loc, out result, out node)) {
- startOffset = -1;
- return null;
- }
-
- return ResolveExpression (editor, result, node, out startOffset);
+ return await Resolver.DebuggerExpressionResolver.ResolveAsync (editor, doc, offset, cancellationToken).ConfigureAwait (false);
}
#endregion
@@ -1501,16 +1211,15 @@ namespace MonoDevelop.CSharp.Completion
#region TypeSystemSegmentTree
TypeSystemSegmentTree validTypeSystemSegmentTree;
- TypeSystemSegmentTree unstableTypeSystemSegmentTree;
internal class TypeSystemTreeSegment : TreeSegment
{
- public IUnresolvedEntity Entity {
+ public SyntaxNode Entity {
get;
private set;
}
- public TypeSystemTreeSegment (int offset, int length, IUnresolvedEntity entity) : base (offset, length)
+ public TypeSystemTreeSegment (int offset, int length, SyntaxNode entity) : base (offset, length)
{
this.Entity = entity;
}
@@ -1519,8 +1228,6 @@ namespace MonoDevelop.CSharp.Completion
internal TypeSystemTreeSegment GetMemberSegmentAt (int offset)
{
TypeSystemTreeSegment result = null;
- if (unstableTypeSystemSegmentTree != null)
- result = unstableTypeSystemSegmentTree.GetMemberSegmentAt (offset);
if (result == null && validTypeSystemSegmentTree != null)
result = validTypeSystemSegmentTree.GetMemberSegmentAt (offset);
return result;
@@ -1528,174 +1235,148 @@ namespace MonoDevelop.CSharp.Completion
internal class TypeSystemSegmentTree : SegmentTree<TypeSystemTreeSegment>
{
- public IUnresolvedTypeDefinition GetTypeAt (int offset)
- {
- IUnresolvedTypeDefinition result = null;
- foreach (var seg in GetSegmentsAt (offset).Where (s => s.Entity is IUnresolvedTypeDefinition)) {
- if (result == null || result.Region.IsInside (seg.Entity.Region.Begin))
- result = (IUnresolvedTypeDefinition)seg.Entity;
- }
- return result;
- }
-
- public IUnresolvedMember GetMemberAt (int offset)
+ public SyntaxNode GetMemberAt (int offset)
{
// Members don't overlap
- var seg = GetSegmentsAt (offset).FirstOrDefault (s => s.Entity is IUnresolvedMember);
+ var seg = GetSegmentsAt (offset).FirstOrDefault ();
if (seg == null)
return null;
- return (IUnresolvedMember)seg.Entity;
+ return seg.Entity;
}
public TypeSystemTreeSegment GetMemberSegmentAt (int offset)
{
- // Members don't overlap
- var seg = GetSegmentsAt (offset).FirstOrDefault (s => s.Entity is IUnresolvedMember);
- if (seg == null)
- return null;
- return seg;
+ return GetSegmentsAt (offset).LastOrDefault ();
}
- internal static TypeSystemSegmentTree Create (ParsedDocument parsedDocument, TextEditorData textEditorData)
+
+ internal static TypeSystemSegmentTree Create (SemanticModel semanticModel, CancellationToken token)
{
- TypeSystemSegmentTree result = new TypeSystemSegmentTree ();
-
- foreach (var type in parsedDocument.TopLevelTypeDefinitions)
- AddType (textEditorData, result, type);
-
- return result;
+ var visitor = new TreeVisitor (token);
+ visitor.Visit (semanticModel.SyntaxTree.GetRoot ());
+ return visitor.Result;
}
-
- static void AddType (TextEditorData textEditorData, TypeSystemSegmentTree result, IUnresolvedTypeDefinition type)
+
+ class TreeVisitor : CSharpSyntaxWalker
{
- int offset = textEditorData.LocationToOffset (type.Region.Begin);
- int endOffset = type.Region.End.IsEmpty ? int.MaxValue : textEditorData.LocationToOffset (type.Region.End);
- if (endOffset < 0)
- endOffset = int.MaxValue;
- result.Add (new TypeSystemTreeSegment (offset, endOffset - offset, type));
- foreach (var entity in type.Members) {
- if (entity.IsSynthetic)
- continue;
- offset = textEditorData.LocationToOffset (entity.Region.Begin);
- endOffset = textEditorData.LocationToOffset (entity.Region.End);
- if (endOffset < 0)
- endOffset = int.MaxValue;
- result.Add (new TypeSystemTreeSegment (offset, endOffset - offset, entity));
+ readonly CancellationToken token;
+ public TypeSystemSegmentTree Result = new TypeSystemSegmentTree ();
+
+ public TreeVisitor (System.Threading.CancellationToken token)
+ {
+ this.token = token;
}
-
- foreach (var nested in type.NestedTypes)
- AddType (textEditorData, result, nested);
- }
- }
-
- public IUnresolvedTypeDefinition GetTypeAt (int offset)
- {
- if (unstableTypeSystemSegmentTree == null && validTypeSystemSegmentTree == null)
- return null;
- IUnresolvedTypeDefinition type = null;
- if (unstableTypeSystemSegmentTree != null)
- type = unstableTypeSystemSegmentTree.GetTypeAt (offset);
- if (type == null && validTypeSystemSegmentTree != null)
- type = validTypeSystemSegmentTree.GetTypeAt (offset);
- return type;
- }
-
- public IUnresolvedMember GetMemberAt (int offset)
- {
- if (unstableTypeSystemSegmentTree == null && validTypeSystemSegmentTree == null)
- return null;
- IUnresolvedMember member = null;
- if (unstableTypeSystemSegmentTree != null)
- member = unstableTypeSystemSegmentTree.GetMemberAt (offset);
- if (member == null && validTypeSystemSegmentTree != null)
- member = validTypeSystemSegmentTree.GetMemberAt (offset);
+ public override void VisitClassDeclaration (Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax node)
+ {
+ Result.Add (new TypeSystemTreeSegment (node.SpanStart, node.Span.Length, node));
+ base.VisitClassDeclaration (node);
+ }
+ public override void VisitStructDeclaration (Microsoft.CodeAnalysis.CSharp.Syntax.StructDeclarationSyntax node)
+ {
+ Result.Add (new TypeSystemTreeSegment (node.SpanStart, node.Span.Length, node));
+ base.VisitStructDeclaration (node);
+ }
- return member;
- }
- #endregion
+ public override void VisitInterfaceDeclaration (Microsoft.CodeAnalysis.CSharp.Syntax.InterfaceDeclarationSyntax node)
+ {
+ Result.Add (new TypeSystemTreeSegment (node.SpanStart, node.Span.Length, node));
+ base.VisitInterfaceDeclaration (node);
+ }
+ public override void VisitEnumDeclaration (Microsoft.CodeAnalysis.CSharp.Syntax.EnumDeclarationSyntax node)
+ {
+ Result.Add (new TypeSystemTreeSegment (node.SpanStart, node.Span.Length, node));
+ }
- class CompletionContextProvider : ICompletionContextProvider
- {
- readonly ParsedDocument parsedDocument;
- readonly TextEditorData textEditorData;
- readonly TypeSystemSegmentTree validTypeSystemSegmentTree;
- readonly TypeSystemSegmentTree unstableTypeSystemSegmentTree;
+ public override void VisitPropertyDeclaration (Microsoft.CodeAnalysis.CSharp.Syntax.PropertyDeclarationSyntax node)
+ {
+ Result.Add (new TypeSystemTreeSegment (node.SpanStart, node.Span.Length, node));
+ }
- public CompletionContextProvider (ParsedDocument parsedDocument, TextEditorData textEditorData,
- TypeSystemSegmentTree validTypeSystemSegmentTree, TypeSystemSegmentTree unstableTypeSystemSegmentTree)
- {
- this.parsedDocument = parsedDocument;
- this.textEditorData = textEditorData;
- this.validTypeSystemSegmentTree = validTypeSystemSegmentTree;
- this.unstableTypeSystemSegmentTree = unstableTypeSystemSegmentTree;
- }
+ public override void VisitMethodDeclaration (Microsoft.CodeAnalysis.CSharp.Syntax.MethodDeclarationSyntax node)
+ {
+ Result.Add (new TypeSystemTreeSegment (node.SpanStart, node.Span.Length, node));
+ }
- IList<string> ICompletionContextProvider.ConditionalSymbols {
- get {
- return parsedDocument.GetAst<SyntaxTree> ().ConditionalSymbols;
+ public override void VisitConstructorDeclaration (Microsoft.CodeAnalysis.CSharp.Syntax.ConstructorDeclarationSyntax node)
+ {
+ Result.Add (new TypeSystemTreeSegment (node.SpanStart, node.Span.Length, node));
}
- }
- void ICompletionContextProvider.GetCurrentMembers (int offset, out IUnresolvedTypeDefinition currentType, out IUnresolvedMember currentMember)
- {
- currentType = GetTypeAt (offset);
- currentMember = GetMemberAt (offset);
- }
+ public override void VisitDestructorDeclaration (Microsoft.CodeAnalysis.CSharp.Syntax.DestructorDeclarationSyntax node)
+ {
+ Result.Add (new TypeSystemTreeSegment (node.SpanStart, node.Span.Length, node));
+ }
- public IUnresolvedTypeDefinition GetTypeAt (int offset)
- {
- if (unstableTypeSystemSegmentTree == null && validTypeSystemSegmentTree == null)
- return null;
- IUnresolvedTypeDefinition type = null;
- if (unstableTypeSystemSegmentTree != null)
- type = unstableTypeSystemSegmentTree.GetTypeAt (offset);
- if (type == null && validTypeSystemSegmentTree != null)
- type = validTypeSystemSegmentTree.GetTypeAt (offset);
- return type;
- }
+ public override void VisitIndexerDeclaration (Microsoft.CodeAnalysis.CSharp.Syntax.IndexerDeclarationSyntax node)
+ {
+ Result.Add (new TypeSystemTreeSegment (node.SpanStart, node.Span.Length, node));
+ }
- public IUnresolvedMember GetMemberAt (int offset)
- {
- if (unstableTypeSystemSegmentTree == null && validTypeSystemSegmentTree == null)
- return null;
+ public override void VisitDelegateDeclaration (Microsoft.CodeAnalysis.CSharp.Syntax.DelegateDeclarationSyntax node)
+ {
+ Result.Add (new TypeSystemTreeSegment (node.SpanStart, node.Span.Length, node));
+ }
- IUnresolvedMember member = null;
- if (unstableTypeSystemSegmentTree != null)
- member = unstableTypeSystemSegmentTree.GetMemberAt (offset);
- if (member == null && validTypeSystemSegmentTree != null)
- member = validTypeSystemSegmentTree.GetMemberAt (offset);
- return member;
- }
+ public override void VisitOperatorDeclaration (Microsoft.CodeAnalysis.CSharp.Syntax.OperatorDeclarationSyntax node)
+ {
+ Result.Add (new TypeSystemTreeSegment (node.SpanStart, node.Span.Length, node));
+ }
- Tuple<string, TextLocation> ICompletionContextProvider.GetMemberTextToCaret (int caretOffset, IUnresolvedTypeDefinition currentType, IUnresolvedMember currentMember)
- {
- int startOffset;
- if (currentMember != null && currentType != null && currentType.Kind != TypeKind.Enum) {
- startOffset = textEditorData.LocationToOffset(currentMember.Region.Begin);
- } else if (currentType != null) {
- startOffset = textEditorData.LocationToOffset(currentType.Region.Begin);
- } else {
- startOffset = 0;
+ public override void VisitEventDeclaration (Microsoft.CodeAnalysis.CSharp.Syntax.EventDeclarationSyntax node)
+ {
+ Result.Add (new TypeSystemTreeSegment (node.SpanStart, node.Span.Length, node));
}
- while (startOffset > 0) {
- char ch = textEditorData.GetCharAt(startOffset - 1);
- if (ch != ' ' && ch != '\t') {
- break;
- }
- --startOffset;
+
+ public override void VisitBlock (Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax node)
+ {
+ token.ThrowIfCancellationRequested ();
}
- return Tuple.Create (caretOffset > startOffset ? textEditorData.GetTextAt (startOffset, caretOffset - startOffset) : "",
- (TextLocation)textEditorData.OffsetToLocation (startOffset));
}
+
+ }
+
+ public SyntaxNode GetMemberAt (int offset)
+ {
+ SyntaxNode member = null;
+ if (member == null && validTypeSystemSegmentTree != null)
+ member = validTypeSystemSegmentTree.GetMemberAt (offset);
+ return member;
+ }
+ #endregion
+
+
- CSharpAstResolver ICompletionContextProvider.GetResolver (CSharpResolver resolver, AstNode rootNode)
- {
- return new CSharpAstResolver (resolver, rootNode, parsedDocument.ParsedFile as CSharpUnresolvedFile);
+ [CommandHandler(RefactoryCommands.ImportSymbol)]
+ async void ImportSymbolCommand ()
+ {
+ if (Editor.SelectionMode == SelectionMode.Block)
+ return;
+ var analysisDocument = DocumentContext.AnalysisDocument;
+ if (analysisDocument == null)
+ return;
+ var offset = Editor.CaretOffset;
+
+ int cpos, wlen;
+ if (!GetCompletionCommandOffset (out cpos, out wlen)) {
+ cpos = Editor.CaretOffset;
+ wlen = 0;
}
+ CurrentCompletionContext = CompletionWidget.CreateCodeCompletionContext (cpos);
+ CurrentCompletionContext.TriggerWordLength = wlen;
+
+ int triggerWordLength = 0;
+ char ch = CurrentCompletionContext.TriggerOffset > 0 ? Editor.GetCharAt (CurrentCompletionContext.TriggerOffset - 1) : '\0';
+
+ var completionList = await InternalHandleCodeCompletion (CurrentCompletionContext, ch, true, triggerWordLength, default(CancellationToken), true);
+ if (completionList != null)
+ CompletionWindowManager.ShowWindow (this, (char)0, completionList, CompletionWidget, CurrentCompletionContext);
+ else
+ CurrentCompletionContext = null;
}
+
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CastCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CastCompletionData.cs
new file mode 100644
index 0000000000..91651bd413
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CastCompletionData.cs
@@ -0,0 +1,76 @@
+//
+// CSharpCompletionTextEditorExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2011 Xamarin <http://xamarin.com>
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.CodeCompletion;
+using System.Collections.Generic;
+using System.Linq;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide.Editor.Extension;
+
+namespace MonoDevelop.CSharp.Completion
+{
+ class CastCompletionData : RoslynSymbolCompletionData
+ {
+ readonly SemanticModel semanticModel;
+ readonly SyntaxNode nodeToCast;
+ readonly ITypeSymbol targetType;
+
+ public CastCompletionData (ICompletionDataKeyHandler keyHandler, RoslynCodeCompletionFactory factory, SemanticModel semanticModel, ISymbol symbol, SyntaxNode nodeToCast, ITypeSymbol targetType) : base(keyHandler, factory, symbol)
+ {
+ this.targetType = targetType;
+ this.nodeToCast = nodeToCast;
+ this.semanticModel = semanticModel;
+ }
+
+ public override string GetDisplayDescription (bool isSelected)
+ {
+ var description = "<small>(cast to " + SafeMinimalDisplayString (targetType, semanticModel, nodeToCast.SpanStart, Ambience.LabelFormat) + ")</small>";
+ if (isSelected)
+ return description;
+ return "<span foreground=\"darkgray\">" + description + "</span>";
+ }
+
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
+ {
+ var editor = factory.Ext.Editor;
+ var offset = window.CodeCompletionContext.TriggerOffset;
+ using (var undo = editor.OpenUndoGroup ()) {
+ base.InsertCompletionText (window, ref ka, descriptor);
+ var span = nodeToCast.Span;
+ var type = SafeMinimalDisplayString (targetType, semanticModel, nodeToCast.SpanStart, Ambience.LabelFormat);
+ editor.ReplaceText (span.Start, span.Length, "((" + type + ")" + nodeToCast + ")");
+ }
+ }
+
+ public override bool IsOverload (CompletionData other)
+ {
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ConstructorParameterDataProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ConstructorParameterDataProvider.cs
index c9d6a2855b..28196b83eb 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ConstructorParameterDataProvider.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ConstructorParameterDataProvider.cs
@@ -43,7 +43,7 @@ namespace MonoDevelop.CSharp.Completion
{
this.type = type;
- var ctx = ext.CSharpUnresolvedFile.GetTypeResolveContext (ext.UnresolvedFileCompilation, ext.Document.Editor.Caret.Location) as CSharpTypeResolveContext;
+ var ctx = ext.CSharpUnresolvedFile.GetTypeResolveContext (ext.UnresolvedFileCompilation, ext.Editor.CaretLocation) as CSharpTypeResolveContext;
var lookup = new MemberLookup (ctx.CurrentTypeDefinition, ext.Compilation.MainAssembly);
bool isProtectedAllowed = false;
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CreateOverrideCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CreateOverrideCompletionData.cs
new file mode 100644
index 0000000000..7b1cdb3456
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CreateOverrideCompletionData.cs
@@ -0,0 +1,153 @@
+// CreateOverrideCompletionData.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using System.Linq;
+using MonoDevelop.Ide.CodeCompletion;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide.Gui.Content;
+using System.Collections.Generic;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide.Editor.Extension;
+using MonoDevelop.CSharp.Refactoring;
+using MonoDevelop.CSharp.Formatting;
+using System;
+
+namespace MonoDevelop.CSharp.Completion
+{
+ class CreateOverrideCompletionData : RoslynSymbolCompletionData
+ {
+ readonly int declarationBegin;
+ readonly ITypeSymbol currentType;
+
+ bool afterKeyword;
+
+ public bool GenerateBody { get; set; }
+
+ string displayText;
+ public override string DisplayText {
+ get {
+ if (displayText == null) {
+ if (factory == null) {
+ displayText = Symbol.Name;
+ } else {
+ var model = ext.ParsedDocument.GetAst<SemanticModel> ();
+ displayText = Ambience.EscapeText (SafeMinimalDisplayString (base.Symbol, model, declarationBegin, Ambience.LabelFormat)) + " {...}";
+ }
+
+ if (!afterKeyword)
+ displayText = "override " + displayText;
+ }
+
+ return displayText;
+ }
+ }
+
+ public override string GetDisplayTextMarkup ()
+ {
+ var model = ext.ParsedDocument.GetAst<SemanticModel> ();
+
+ var result = Ambience.EscapeText (SafeMinimalDisplayString (Symbol, model, declarationBegin, Ambience.LabelFormat)) + " {...}";
+ var idx = result.IndexOf (Symbol.Name, StringComparison.Ordinal);
+ if (idx >= 0) {
+ result =
+ result.Substring(0, idx) +
+ "<b>" + Symbol.Name + "</b>"+
+ result.Substring(idx + Symbol.Name.Length);
+ }
+
+ if (!afterKeyword)
+ result = "override " + result;
+
+ return ApplyDiplayFlagsFormatting (result);
+ }
+
+ public CreateOverrideCompletionData (ICompletionDataKeyHandler keyHandler, RoslynCodeCompletionFactory factory, int declarationBegin, ITypeSymbol currentType, Microsoft.CodeAnalysis.ISymbol member, bool afterKeyword) : base (keyHandler, factory, member, member.ToDisplayString ())
+ {
+ this.afterKeyword = afterKeyword;
+ this.currentType = currentType;
+ this.declarationBegin = declarationBegin;
+ this.GenerateBody = true;
+ }
+
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
+ {
+ var editor = ext.Editor;
+ bool isExplicit = false;
+// if (member.DeclaringTypeDefinition.Kind == TypeKind.Interface) {
+// foreach (var m in type.Members) {
+// if (m.Name == member.Name && !m.ReturnType.Equals (member.ReturnType)) {
+// isExplicit = true;
+// break;
+// }
+// }
+// }
+// var resolvedType = type.Resolve (ext.Project).GetDefinition ();
+// if (ext.Project != null)
+// generator.PolicyParent = ext.Project.Policies;
+
+ var result = CSharpCodeGenerator.CreateOverridenMemberImplementation (ext.DocumentContext, ext.Editor, currentType, currentType.Locations.First (), Symbol, isExplicit, factory.SemanticModel);
+ string sb = result.Code.TrimStart ();
+ int trimStart = result.Code.Length - sb.Length;
+ sb = sb.TrimEnd ();
+
+ var lastRegion = result.BodyRegions.LastOrDefault ();
+ var region = lastRegion == null? null
+ : new CodeGeneratorBodyRegion (lastRegion.StartOffset - trimStart, lastRegion.EndOffset - trimStart);
+
+ int targetCaretPosition;
+ int selectionEndPosition = -1;
+ if (region != null && region.IsValid) {
+ targetCaretPosition = declarationBegin + region.StartOffset;
+ if (region.Length > 0) {
+ if (GenerateBody) {
+ selectionEndPosition = declarationBegin + region.EndOffset;
+ } else {
+ //FIXME: if there are multiple regions, remove all of them
+ sb = sb.Substring (0, region.StartOffset) + sb.Substring (region.EndOffset);
+ }
+ }
+ } else {
+ targetCaretPosition = declarationBegin + sb.Length;
+ }
+
+ editor.ReplaceText (declarationBegin, editor.CaretOffset - declarationBegin, sb);
+ if (selectionEndPosition > 0) {
+ editor.CaretOffset = selectionEndPosition;
+ editor.SetSelection (targetCaretPosition, selectionEndPosition);
+ } else {
+ editor.CaretOffset = targetCaretPosition;
+ }
+
+ OnTheFlyFormatter.Format (editor, ext.DocumentContext, declarationBegin, declarationBegin + sb.Length);
+ }
+
+ public override bool IsOverload (CompletionData other)
+ {
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CreatePartialCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CreatePartialCompletionData.cs
new file mode 100644
index 0000000000..ea516a9ae7
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CreatePartialCompletionData.cs
@@ -0,0 +1,144 @@
+//
+// CreatePartialCompletionData.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Linq;
+using MonoDevelop.Ide.CodeCompletion;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.CSharp.Formatting;
+using MonoDevelop.CSharp.Refactoring;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide.Editor.Extension;
+using System;
+
+namespace MonoDevelop.CSharp.Completion
+{
+ class CreatePartialCompletionData : RoslynSymbolCompletionData
+ {
+ readonly ITypeSymbol currentType;
+ readonly int declarationBegin;
+
+ bool afterKeyword;
+
+ public bool GenerateBody { get; set; }
+
+ string displayText;
+ public override string DisplayText {
+ get {
+ if (displayText == null) {
+ if (factory == null) {
+ displayText = Symbol.Name;
+ } else {
+ var model = ext.ParsedDocument.GetAst<SemanticModel> ();
+ displayText = Ambience.EscapeText (SafeMinimalDisplayString (base.Symbol, model, ext.Editor.CaretOffset, Ambience.LabelFormat)) + " {...}";
+ }
+ if (!afterKeyword)
+ displayText = "partial " + displayText;
+ }
+ return displayText;
+ }
+ }
+
+
+ public override string GetDisplayTextMarkup ()
+ {
+ var model = ext.ParsedDocument.GetAst<SemanticModel> ();
+
+ var result = Ambience.EscapeText (SafeMinimalDisplayString(base.Symbol, model, ext.Editor.CaretOffset, Ambience.LabelFormat)) + " {...}";
+ var idx = result.IndexOf (Symbol.Name, StringComparison.Ordinal);
+ if (idx >= 0) {
+ result =
+ result.Substring(0, idx) +
+ "<b>" + Symbol.Name + "</b>"+
+ result.Substring(idx + Symbol.Name.Length);
+ }
+
+ if (!afterKeyword)
+ result = "partial " + result;
+
+ return ApplyDiplayFlagsFormatting (result);
+ }
+
+ public CreatePartialCompletionData (ICompletionDataKeyHandler keyHandler, RoslynCodeCompletionFactory factory, int declarationBegin, ITypeSymbol currentType, ISymbol member, bool afterKeyword) : base (keyHandler, factory, member)
+ {
+ this.afterKeyword = afterKeyword;
+ this.currentType = currentType;
+ this.declarationBegin = declarationBegin;
+ this.GenerateBody = true;
+ }
+
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
+ {
+ var editor = ext.Editor;
+ bool isExplicit = false;
+ // if (member.DeclaringTypeDefinition.Kind == TypeKind.Interface) {
+ // foreach (var m in type.Members) {
+ // if (m.Name == member.Name && !m.ReturnType.Equals (member.ReturnType)) {
+ // isExplicit = true;
+ // break;
+ // }
+ // }
+ // }
+ // var resolvedType = type.Resolve (ext.Project).GetDefinition ();
+ // if (ext.Project != null)
+ // generator.PolicyParent = ext.Project.Policies;
+
+ var result = CSharpCodeGenerator.CreatePartialMemberImplementation (ext.DocumentContext, ext.Editor, currentType, currentType.Locations.First (), Symbol, isExplicit, factory.SemanticModel);
+ string sb = result.Code.TrimStart ();
+ int trimStart = result.Code.Length - sb.Length;
+ sb = sb.TrimEnd ();
+
+ var lastRegion = result.BodyRegions.LastOrDefault ();
+ var region = lastRegion == null? null
+ : new CodeGeneratorBodyRegion (lastRegion.StartOffset - trimStart, lastRegion.EndOffset - trimStart);
+
+ int targetCaretPosition;
+ int selectionEndPosition = -1;
+ if (region != null && region.IsValid) {
+ targetCaretPosition = declarationBegin + region.EndOffset;
+
+ } else {
+ targetCaretPosition = declarationBegin + sb.Length;
+ }
+
+ editor.ReplaceText (declarationBegin, editor.CaretOffset - declarationBegin, sb);
+ if (selectionEndPosition > 0) {
+ editor.CaretOffset = selectionEndPosition;
+ editor.SetSelection (targetCaretPosition, selectionEndPosition);
+ } else {
+ editor.CaretOffset = targetCaretPosition;
+ }
+
+ OnTheFlyFormatter.Format (editor, ext.DocumentContext, declarationBegin, declarationBegin + sb.Length);
+ editor.CaretLine--;
+ }
+
+ public override bool IsOverload (CompletionData other)
+ {
+ return false;
+ }
+
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/DelegateDataProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/DelegateDataProvider.cs
deleted file mode 100644
index 527a7aa8b8..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/DelegateDataProvider.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// DelegateDataProvider.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Xml;
-
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.CodeCompletion;
-using MonoDevelop.CSharp.Formatting;
-using MonoDevelop.CSharp.Parser;
-using System.Text.RegularExpressions;
-using ICSharpCode.NRefactory.CSharp;
-using MonoDevelop.CSharp.Resolver;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.Completion;
-using System.Linq;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
-
-namespace MonoDevelop.CSharp.Completion
-{
- class DelegateDataProvider : AbstractParameterDataProvider
- {
-// IType delegateType;
- IMethod delegateMethod;
-
- ICompilation compilation;
- CSharpUnresolvedFile file;
-
- public DelegateDataProvider (int startOffset, CSharpCompletionTextEditorExtension ext, IType delegateType) : base (ext, startOffset)
- {
- compilation = ext.UnresolvedFileCompilation;
- file = ext.CSharpUnresolvedFile;
- // this.delegateType = delegateType;
- this.delegateMethod = delegateType.GetDelegateInvokeMethod ();
- }
-
- public override TooltipInformation CreateTooltipInformation (int overload, int currentParameter, bool smartWrap)
- {
- return MethodParameterDataProvider.CreateTooltipInformation (ext, compilation, file, delegateMethod, currentParameter, smartWrap);
- }
-
- #region IParameterDataProvider implementation
- public override int GetParameterCount (int overload)
- {
- if (overload >= Count)
- return -1;
- return delegateMethod.Parameters != null ? delegateMethod.Parameters.Count : 0;
- }
-
- public override bool AllowParameterList (int overload)
- {
- if (overload >= Count)
- return false;
- var lastParam = delegateMethod.Parameters.LastOrDefault ();
- return lastParam != null && lastParam.IsParams;
- }
-
- public override string GetParameterName (int overload, int paramIndex)
- {
- return delegateMethod.Parameters[paramIndex].Name;
- }
-
- public override int Count {
- get {
- return 1;
- }
- }
- #endregion
- }
-}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs
index ed967df971..47384b7952 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/EventCreationCompletionData.cs
@@ -32,109 +32,120 @@ using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.CSharp.Formatting;
using MonoDevelop.CSharp.Parser;
-using Mono.TextEditor;
using System.Collections.Generic;
-using ICSharpCode.NRefactory.TypeSystem;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Editor.Util;
+using MonoDevelop.Ide.Editor.Extension;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide;
+using MonoDevelop.Refactoring;
+using ICSharpCode.NRefactory6.CSharp;
+using System.Threading;
+using System.Threading.Tasks;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.TypeSystem;
namespace MonoDevelop.CSharp.Completion
{
- class EventCreationCompletionData : CompletionData
+ class EventCreationCompletionData : AnonymousMethodCompletionData
{
- string parameterList;
- IUnresolvedMember callingMember;
-// CSharpCompletionTextEditorExtension ext;
- int initialOffset;
- public bool AddSemicolon = true;
- TextEditorData editor;
-
- public override TooltipInformation CreateTooltipInformation (bool smartWrap)
+ readonly RoslynCodeCompletionFactory factory;
+ readonly ITypeSymbol delegateType;
+
+ public override Task<TooltipInformation> CreateTooltipInformation (bool smartWrap, CancellationToken token)
+ {
+ return Task.FromResult (new TooltipInformation ());
+ }
+
+ public override int PriorityGroup { get { return 2; } }
+
+ public EventCreationCompletionData (ICompletionDataKeyHandler keyHandler, RoslynCodeCompletionFactory factory, ITypeSymbol delegateType, string varName, INamedTypeSymbol curType) : base (factory, keyHandler)
{
- var tooltipInfo = new TooltipInformation ();
- return tooltipInfo;
+ this.DisplayText = varName;
+ this.delegateType = delegateType;
+ this.factory = factory;
+ this.Icon = "md-newmethod";
}
- public EventCreationCompletionData (CSharpCompletionTextEditorExtension ext, string methodName, IType delegateType, IEvent evt, string parameterList, IUnresolvedMember callingMember, IUnresolvedTypeDefinition declaringType) : base (null)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
- if (string.IsNullOrEmpty (methodName)) {
- this.DisplayText = (evt != null ? evt.Name : "");
- } else {
- this.DisplayText = Char.ToUpper (methodName[0]) + methodName.Substring (1) + (evt != null ? evt.Name : "");
- }
-
- if (declaringType != null && declaringType.Members.Any (m => m.Name == this.DisplayText)) {
- for (int i = 1; i < 10000; i++) {
- if (!declaringType.Members.Any (m => m.Name == this.DisplayText + i)) {
- this.DisplayText = this.DisplayText + i.ToString ();
- break;
+ // insert add/remove event handler code after +=/-=
+ var editor = factory.Ext.Editor;
+
+
+ bool AddSemicolon = true;
+ var position = window.CodeCompletionContext.TriggerOffset;
+ editor.ReplaceText (position, editor.CaretOffset - position, this.DisplayText + (AddSemicolon ? ";" : ""));
+
+
+ var document = IdeApp.Workbench.ActiveDocument;
+ var parsedDocument = document.UpdateParseDocument ().Result;
+ var semanticModel = parsedDocument.GetAst<SemanticModel> ();
+
+ var declaringType = semanticModel.GetEnclosingSymbol<INamedTypeSymbol> (position, default(CancellationToken));
+ var enclosingSymbol = semanticModel.GetEnclosingSymbol<ISymbol> (position, default(CancellationToken));
+
+ var insertionPoints = InsertionPointService.GetInsertionPoints (
+ document.Editor,
+ parsedDocument,
+ declaringType,
+ editor.CaretOffset
+ );
+ var options = new InsertionModeOptions (
+ GettextCatalog.GetString ("Create new method"),
+ insertionPoints,
+ point => {
+ if (!point.Success)
+ return;
+ var indent = "\t";
+ var sb = new StringBuilder ();
+ if (enclosingSymbol != null && enclosingSymbol.IsStatic)
+ sb.Append ("static ");
+ sb.Append ("void ");
+ int pos2 = sb.Length;
+ sb.Append (this.DisplayText);
+ sb.Append (' ');
+ sb.Append("(");
+
+ var delegateMethod = delegateType.GetDelegateInvokeMethod();
+ for (int k = 0; k < delegateMethod.Parameters.Length; k++) {
+ if (k > 0) {
+ sb.Append(", ");
+ }
+ sb.Append (RoslynCompletionData.SafeMinimalDisplayString (delegateMethod.Parameters [k], semanticModel, position, MonoDevelop.Ide.TypeSystem.Ambience.LabelFormat));
}
+ sb.Append(")");
+
+ sb.Append (editor.EolMarker);
+ sb.Append (indent);
+ sb.Append ("{");
+ sb.Append (editor.EolMarker);
+ sb.Append (indent);
+ sb.Append (editor.Options.GetIndentationString ());
+ //int cursorPos = pos + sb.Length;
+ sb.Append (editor.EolMarker);
+ sb.Append (indent);
+ sb.Append ("}");
+ point.InsertionPoint.Insert (document.Editor, document, sb.ToString ());
+ // // start text link mode after insert
+ // var links = new List<TextLink> ();
+ // var link = new TextLink ("name");
+ //
+ // link.AddLink (new TextSegment (initialOffset, this.DisplayText.Length));
+ // link.AddLink (new TextSegment (initialOffset + pos + pos2, this.DisplayText.Length));
+ // links.Add (link);
+ // editor.StartTextLinkMode (new TextLinkModeOptions (links));
}
- }
- this.editor = ext.TextEditorData;
- this.parameterList = parameterList;
- this.callingMember = callingMember;
- this.Icon = "md-newmethod";
- this.initialOffset = editor.Caret.Offset;
+ );
+
+ editor.StartInsertionMode (options);
+
}
-
- public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
+
+ public override bool IsOverload (CompletionData other)
{
- // insert add/remove event handler code after +=/-=
- editor.Replace (initialOffset, editor.Caret.Offset - initialOffset, this.DisplayText + (AddSemicolon ? ";" : ""));
-
- // Search opening bracket of member
- int pos = callingMember != null && !callingMember.BodyRegion.Begin.IsEmpty ? editor.Document.LocationToOffset (callingMember.BodyRegion.BeginLine, callingMember.BodyRegion.BeginColumn) : initialOffset;
- while (pos < editor.Document.TextLength && editor.Document.GetCharAt (pos) != '{') {
- pos++;
- }
-
- // Search closing bracket of member
- pos = editor.Document.GetMatchingBracketOffset (pos) + 1;
-
- pos = Math.Max (0, Math.Min (pos, editor.Document.TextLength - 1));
-
- // Insert new event handler after closing bracket
- var line = callingMember != null ? editor.Document.GetLine (callingMember.Region.BeginLine) : editor.Document.GetLineByOffset (initialOffset);
- string indent = line.GetIndentation (editor.Document);
-
- StringBuilder sb = new StringBuilder ();
- sb.Append (editor.EolMarker);
- sb.Append (editor.EolMarker);
- sb.Append (indent);
- if (callingMember != null && callingMember.IsStatic)
- sb.Append ("static ");
- sb.Append ("void ");
- int pos2 = sb.Length;
- sb.Append (this.DisplayText);
- sb.Append (' ');
- sb.Append (this.parameterList);
- sb.Append (editor.EolMarker);
- sb.Append (indent);
- sb.Append ("{");
- sb.Append (editor.EolMarker);
- sb.Append (indent);
- sb.Append (editor.Options.IndentationString);
- int cursorPos = pos + sb.Length;
- sb.Append (editor.EolMarker);
- sb.Append (indent);
- sb.Append ("}");
- editor.Insert (pos, sb.ToString ());
- editor.Caret.Offset = cursorPos;
-
- // start text link mode after insert
- List<TextLink> links = new List<TextLink> ();
- TextLink link = new TextLink ("name");
-
- link.AddLink (new TextSegment (0, this.DisplayText.Length));
- link.AddLink (new TextSegment (pos - initialOffset + pos2, this.DisplayText.Length));
- links.Add (link);
-
- var tle = new TextLinkEditMode (editor.Parent, initialOffset, links);
- tle.TextLinkMode = TextLinkMode.EditIdentifier;
- tle.SetCaretPosition = true;
- tle.SelectPrimaryLink = true;
- tle.OldMode = editor.CurrentMode;
- tle.StartMode ();
- editor.CurrentMode = tle;
+ return false;
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ImportSymbolCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ImportSymbolCompletionData.cs
new file mode 100644
index 0000000000..f74e834298
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ImportSymbolCompletionData.cs
@@ -0,0 +1,158 @@
+//
+// ImportSymbolCompletionData.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using MonoDevelop.Ide.CodeCompletion;
+using Microsoft.CodeAnalysis;
+using GLib;
+using System.Collections.Generic;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Components.PropertyGrid.PropertyEditors;
+using MonoDevelop.Ide.Editor;
+using System.Text;
+using ICSharpCode.NRefactory.MonoCSharp;
+
+namespace MonoDevelop.CSharp.Completion
+{
+ class ImportSymbolCompletionData : RoslynSymbolCompletionData
+ {
+ CSharpCompletionTextEditorExtension completionExt;
+ ISymbol type;
+ bool useFullName;
+
+ public override IconId Icon {
+ get {
+ return type.GetStockIcon ();
+ }
+ }
+
+ public override int PriorityGroup { get { return int.MinValue; } }
+
+ public ImportSymbolCompletionData (CSharpCompletionTextEditorExtension ext, RoslynCodeCompletionFactory factory, ISymbol type, bool useFullName) : base (null, factory, type)
+ {
+ this.completionExt = ext;
+ this.useFullName = useFullName;
+ this.type = type;
+ this.DisplayFlags |= DisplayFlags.IsImportCompletion;
+ }
+
+ bool initialized = false;
+ bool generateUsing, insertNamespace;
+
+ void Initialize ()
+ {
+ if (initialized)
+ return;
+ initialized = true;
+ if (type.ContainingNamespace == null)
+ return;
+ generateUsing = !useFullName;
+ insertNamespace = useFullName;
+ }
+
+ static string GetDefaultDisplaySelection (string description, bool isSelected)
+ {
+ if (!isSelected)
+ return "<span foreground=\"darkgray\">" + description + "</span>";
+ return description;
+ }
+
+ string displayDescription = null;
+ public override string GetDisplayDescription (bool isSelected)
+ {
+ if (displayDescription == null) {
+ Initialize ();
+ if (generateUsing || insertNamespace) {
+ displayDescription = string.Format (GettextCatalog.GetString ("(from '{0}')"), type.ContainingNamespace.Name);
+ } else {
+ displayDescription = "";
+ }
+ }
+ return GetDefaultDisplaySelection (displayDescription, isSelected);
+ }
+
+ #region IActionCompletionData implementation
+
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, MonoDevelop.Ide.Editor.Extension.KeyDescriptor descriptor)
+ {
+ Initialize ();
+ var doc = completionExt.DocumentContext;
+
+ base.InsertCompletionText (window, ref ka, descriptor);
+
+ using (var undo = completionExt.Editor.OpenUndoGroup ()) {
+ if (!window.WasShiftPressed && generateUsing) {
+ AddGlobalNamespaceImport (completionExt.Editor, doc, type.ContainingNamespace.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat));
+ }
+ }
+ ka |= KeyActions.Ignore;
+ }
+
+ static void AddGlobalNamespaceImport (MonoDevelop.Ide.Editor.TextEditor editor, DocumentContext context, string nsName)
+ {
+ var parsedDocument = context.ParsedDocument;
+ var unit = parsedDocument.GetAst<SemanticModel> ();
+ if (unit == null)
+ return;
+
+ int offset = SearchUsingInsertionPoint (unit.SyntaxTree.GetRoot ());
+
+ var text = new StringBuilder ();
+ text.Append ("using ");
+ text.Append (nsName);
+ text.Append (";");
+ text.Append (editor.EolMarker);
+
+ editor.InsertText (offset, text.ToString ());
+ }
+
+ static int SearchUsingInsertionPoint (SyntaxNode parent)
+ {
+ var result = 0;
+ foreach (SyntaxNode node in parent.ChildNodes ()) {
+ if (node.IsKind (Microsoft.CodeAnalysis.CSharp.SyntaxKind.UsingDirective)) {
+ result = node.FullSpan.End;
+ continue;
+ }
+ SyntaxTrivia last = new SyntaxTrivia ();
+
+ foreach (var trivia in node.GetLeadingTrivia ()) {
+ if (last.IsKind (Microsoft.CodeAnalysis.CSharp.SyntaxKind.SingleLineCommentTrivia)||
+ last.IsKind (Microsoft.CodeAnalysis.CSharp.SyntaxKind.DefineDirectiveTrivia) ||
+ last.IsKind (Microsoft.CodeAnalysis.CSharp.SyntaxKind.MultiLineCommentTrivia) ||
+ last.IsKind (Microsoft.CodeAnalysis.CSharp.SyntaxKind.SingleLineDocumentationCommentTrivia))
+ result = trivia.Span.End;
+ last = trivia;
+ }
+ break;
+ }
+ return result;
+ }
+ #endregion
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/IndexerParameterDataProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/IndexerParameterDataProvider.cs
deleted file mode 100644
index 38bb78ff5f..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/IndexerParameterDataProvider.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-//
-// NRefactoryIndexerParameterDataProvider.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Linq;
-using System.Collections.Generic;
-using System.Text;
-using System.Xml;
-
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.CodeCompletion;
-using MonoDevelop.CSharp.Formatting;
-using MonoDevelop.CSharp.Parser;
-
-using System.Text.RegularExpressions;
-using ICSharpCode.NRefactory.CSharp;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.Completion;
-using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
-
-namespace MonoDevelop.CSharp.Completion
-{
- class IndexerParameterDataProvider : AbstractParameterDataProvider
- {
-// AstNode resolvedExpression;
- List<IProperty> indexers;
-
- ICompilation compilation;
- CSharpUnresolvedFile file;
-
- public IndexerParameterDataProvider (int startOffset, CSharpCompletionTextEditorExtension ext, IType type, IEnumerable<IProperty> indexers, AstNode resolvedExpression) : base (ext, startOffset)
- {
- compilation = ext.UnresolvedFileCompilation;
- file = ext.CSharpUnresolvedFile;
- // this.resolvedExpression = resolvedExpression;
- this.indexers = new List<IProperty> (indexers);
- }
-
- public override TooltipInformation CreateTooltipInformation (int overload, int currentParameter, bool smartWrap)
- {
- return MethodParameterDataProvider.CreateTooltipInformation (ext, compilation, file, indexers[overload], currentParameter, smartWrap);
- }
-
- #region IParameterDataProvider implementation
- public override int GetParameterCount (int overload)
- {
- if (overload >= Count)
- return -1;
- var indexer = indexers[overload];
- return indexer != null && indexer.Parameters != null ? indexer.Parameters.Count : 0;
- }
-
- public override bool AllowParameterList (int overload)
- {
- if (overload >= Count)
- return false;
- var lastParam = indexers[overload].Parameters.LastOrDefault ();
- return lastParam != null && lastParam.IsParams;
- }
-
- public override string GetParameterName (int overload, int paramIndex)
- {
- var indexer = indexers[overload];
- return indexer.Parameters[paramIndex].Name;
- }
-
- public override int Count {
- get {
- return indexers != null ? indexers.Count : 0;
- }
- }
- #endregion
- }
-}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MemberCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MemberCompletionData.cs
deleted file mode 100644
index b5d11b0e20..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MemberCompletionData.cs
+++ /dev/null
@@ -1,864 +0,0 @@
-// MemberCompletionData.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Xml;
-using MonoDevelop.Ide.CodeCompletion;
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Content;
-using ICSharpCode.NRefactory.CSharp;
-using Mono.TextEditor;
-using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Projects;
-using ICSharpCode.NRefactory.Completion;
-using ICSharpCode.NRefactory.Documentation;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
-using System.IO;
-using MonoDevelop.CSharp.Formatting;
-using Gtk;
-using MonoDevelop.Ide;
-
-namespace MonoDevelop.CSharp.Completion
-{
- class MemberCompletionData : CompletionData, IEntityCompletionData
- {
- CSharpCompletionTextEditorExtension editorCompletion;
- OutputFlags flags;
- bool hideExtensionParameter = true;
- static CSharpAmbience ambience = new CSharpAmbience ();
- string completionString;
- string displayText;
- Dictionary<string, CompletionData> overloads;
-
- Mono.TextEditor.TextEditorData Editor {
- get {
- return editorCompletion.TextEditorData;
- }
- }
-
- MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy Policy {
- get {
- return editorCompletion.FormattingPolicy;
- }
- }
-
- public override string Description {
- get {
- return "";
- }
- }
-
- public override string CompletionText {
- get { return completionString; }
- set { completionString = value; }
- }
-
- public override string DisplayText {
- get {
- if (displayText == null) {
- displayText = ambience.GetString (Entity.SymbolKind == SymbolKind.Constructor ? Entity.DeclaringTypeDefinition : Entity, flags | OutputFlags.HideGenericParameterNames);
- }
- return displayText;
- }
- }
-
- public override IconId Icon {
- get {
- return (Entity.SymbolKind == SymbolKind.Constructor ? Entity.DeclaringTypeDefinition : Entity).GetStockIcon ();
- }
- }
-
- public bool HideExtensionParameter {
- get {
- return hideExtensionParameter;
- }
- set {
- hideExtensionParameter = value;
- }
- }
-
- bool isDelegateExpected;
- public bool IsDelegateExpected {
- get {
- return isDelegateExpected || factory != null && factory.Engine.PossibleDelegates.Count > 0;
- }
- set {
- isDelegateExpected = value;
- }
- }
-
- ICompilation compilation;
- CSharpUnresolvedFile file;
- CSharpCompletionTextEditorExtension.CompletionDataFactory factory;
-
- public MemberCompletionData (CSharpCompletionTextEditorExtension.CompletionDataFactory factory, IEntity entity, OutputFlags flags) : this(factory.ext, entity, flags)
- {
- this.factory = factory;
- }
-
- public MemberCompletionData (CSharpCompletionTextEditorExtension editorCompletion, IEntity entity, OutputFlags flags)
- {
- compilation = editorCompletion.UnresolvedFileCompilation;
- file = editorCompletion.CSharpUnresolvedFile;
-
- this.editorCompletion = editorCompletion;
- this.flags = flags;
- SetMember (entity);
- DisplayFlags = DisplayFlags.DescriptionHasMarkup;
- var m = Entity as IMember;
- if (m != null && m.IsObsolete ())
- DisplayFlags |= DisplayFlags.Obsolete;
- }
-
- public bool SearchBracket (int start, out int pos)
- {
- pos = -1;
-
- for (int i = start; i < Editor.Length; i++) {
- char ch = Editor.GetCharAt (i);
- if (ch == '(') {
- pos = i + 1;
- return true;
- }
- if (!char.IsWhiteSpace (ch))
- return false;
- }
- return false;
- }
-
- static bool HasNonMethodMembersWithSameName (IMember member)
- {
- return member.DeclaringType.GetFields ().Cast<INamedElement> ()
- .Concat (member.DeclaringType.GetProperties ().Cast<INamedElement> ())
- .Concat (member.DeclaringType.GetEvents ().Cast<INamedElement> ())
- .Concat (member.DeclaringType.GetNestedTypes ().Cast<INamedElement> ())
- .Any (e => e.Name == member.Name);
- }
-
- static bool HasAnyOverloadWithParameters (IMethod method)
- {
- if (method.SymbolKind == SymbolKind.Constructor)
- return method.DeclaringType.GetConstructors ().Any (m => m.Parameters.Count > 0);
- return method.DeclaringType.GetMethods ().Any (m => m.Name == method.Name && m.Parameters.Count > 0);
- }
-
- public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
- {
- InsertCompletionText (window, ref ka, closeChar, keyChar, modifier, CompletionTextEditorExtension.AddParenthesesAfterCompletion, CompletionTextEditorExtension.AddOpeningOnly);
- }
-
- bool IsBracketAlreadyInserted (IMethod method)
- {
- int offset = Editor.Caret.Offset;
- while (offset < Editor.Length) {
- char ch = Editor.GetCharAt (offset);
- if (!char.IsLetterOrDigit (ch))
- break;
- offset++;
- }
- while (offset < Editor.Length) {
- char ch = Editor.GetCharAt (offset);
- if (!char.IsWhiteSpace (ch))
- return ch == '(' || ch == '<' && RequireGenerics (method);
- offset++;
- }
- return false;
- }
-
- bool InsertSemicolon (int exprStart)
- {
- int offset = exprStart;
- while (offset > 0) {
- char ch = Editor.GetCharAt (offset);
- if (!char.IsWhiteSpace (ch)) {
- if (ch != '{' && ch != '}' && ch != ';')
- return false;
- break;
- }
- offset--;
- }
-
- offset = Editor.Caret.Offset;
- while (offset < Editor.Length) {
- char ch = Editor.GetCharAt (offset);
- if (!char.IsLetterOrDigit (ch))
- break;
- offset++;
- }
- while (offset < Editor.Length) {
- char ch = Editor.GetCharAt (offset);
- if (!char.IsWhiteSpace (ch))
- return char.IsLetter (ch) || ch == '}';
- offset++;
- }
- return true;
- }
-
- public void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier, bool addParens, bool addOpeningOnly)
- {
- string text = CompletionText;
- string partialWord = GetCurrentWord (window);
- int skipChars = 0;
- bool runParameterCompletionCommand = false;
- bool runCompletionCompletionCommand = false;
- var method = Entity as IMethod;
- if (addParens && !IsDelegateExpected && method != null && !HasNonMethodMembersWithSameName ((IMember)Entity) && !IsBracketAlreadyInserted (method)) {
- var line = Editor.GetLine (Editor.Caret.Line);
- //var start = window.CodeCompletionContext.TriggerOffset + partialWord.Length + 2;
- //var end = line.Offset + line.Length;
- //string textToEnd = start < end ? Editor.GetTextBetween (start, end) : "";
- bool addSpace = Policy.BeforeMethodCallParentheses && CSharpTextEditorIndentation.OnTheFlyFormatting;
-
- int exprStart = window.CodeCompletionContext.TriggerOffset - 1;
- while (exprStart > line.Offset) {
- char ch = Editor.GetCharAt (exprStart);
- if (ch != '.' && ch != '_' && /*ch != '<' && ch != '>' && */!char.IsLetterOrDigit (ch))
- break;
- exprStart--;
- }
- bool insertSemicolon = InsertSemicolon(exprStart);
- if (Entity.SymbolKind == SymbolKind.Constructor)
- insertSemicolon = false;
- //int pos;
-
- Gdk.Key[] keys = new [] { Gdk.Key.Return, Gdk.Key.Tab, Gdk.Key.space, Gdk.Key.KP_Enter, Gdk.Key.ISO_Enter };
- if (keys.Contains (closeChar) || keyChar == '.') {
- if (HasAnyOverloadWithParameters (method)) {
- if (addOpeningOnly) {
- text += RequireGenerics (method) ? "<|" : (addSpace ? " (|" : "(|");
- skipChars = 0;
- } else {
- if (keyChar == '.') {
- if (RequireGenerics (method)) {
- text += addSpace ? "<> ()" : "<>()";
- } else {
- text += addSpace ? " ()" : "()";
- }
- skipChars = 0;
- } else {
- if (insertSemicolon) {
- if (RequireGenerics (method)) {
- text += addSpace ? "<|> ();" : "<|>();";
- skipChars = addSpace ? 5 : 4;
- } else {
- text += addSpace ? " (|);" : "(|);";
- skipChars = 2;
- }
- } else {
- if (RequireGenerics (method)) {
- text += addSpace ? "<|> ()" : "<|>()";
- skipChars = addSpace ? 4 : 3;
- } else {
- text += addSpace ? " (|)" : "(|)";
- skipChars = 1;
- }
- }
- }
- }
- runParameterCompletionCommand = true;
- } else {
- if (addOpeningOnly) {
- text += RequireGenerics (method) ? "<|" : (addSpace ? " (|" : "(|");
- skipChars = 0;
- } else {
- if (keyChar == '.') {
- if (RequireGenerics (method)) {
- text += addSpace ? "<> ().|" : "<>().|";
- } else {
- text += addSpace ? " ().|" : "().|";
- }
- skipChars = 0;
- } else {
- if (insertSemicolon) {
- if (RequireGenerics (method)) {
- text += addSpace ? "<|> ();" : "<|>();";
- } else {
- text += addSpace ? " ();|" : "();|";
- }
-
- } else {
- if (RequireGenerics (method)) {
- text += addSpace ? "<|> ()" : "<|>()";
- } else {
- text += addSpace ? " ()|" : "()|";
- }
-
- }
- }
- }
- }
- if (keyChar == '(') {
- var skipChar = Editor.SkipChars.LastOrDefault ();
- if (skipChar != null && skipChar.Offset == (window.CodeCompletionContext.TriggerOffset + partialWord.Length) && skipChar.Char == ')')
- Editor.Remove (skipChar.Offset, 1);
- }
- }
- ka |= KeyActions.Ignore;
- }
- if ((DisplayFlags & DisplayFlags.NamedArgument) == DisplayFlags.NamedArgument &&
- CompletionTextEditorExtension.AddParenthesesAfterCompletion &&
- (closeChar == Gdk.Key.Tab ||
- closeChar == Gdk.Key.KP_Tab ||
- closeChar == Gdk.Key.ISO_Left_Tab ||
- closeChar == Gdk.Key.Return ||
- closeChar == Gdk.Key.KP_Enter ||
- closeChar == Gdk.Key.ISO_Enter ||
- closeChar == Gdk.Key.space ||
- closeChar == Gdk.Key.KP_Space)) {
- if (Policy.AroundAssignmentParentheses)
- text += " ";
- text += "=";
- if (Policy.AroundAssignmentParentheses && !(closeChar == Gdk.Key.space || closeChar == Gdk.Key.KP_Space))
- text += " ";
- runCompletionCompletionCommand = true;
- }
- window.CompletionWidget.SetCompletionText (window.CodeCompletionContext, partialWord, text);
- int offset = Editor.Caret.Offset;
- for (int i = 0; i < skipChars; i++) {
- Editor.SetSkipChar (offset, Editor.GetCharAt (offset));
- offset++;
- }
-
- if (runParameterCompletionCommand)
- editorCompletion.RunParameterCompletionCommand ();
- if (runCompletionCompletionCommand && IdeApp.Workbench != null) {
- Application.Invoke (delegate {
- editorCompletion.RunCompletionCommand ();
- });
- }
- }
-
- bool ContainsType (IType testType, IType searchType)
- {
- if (testType == searchType)
- return true;
- foreach (var arg in testType.TypeArguments)
- if (ContainsType (arg, searchType))
- return true;
- return false;
- }
-
- bool RequireGenerics (IMethod method)
- {
- if (method.SymbolKind == SymbolKind.Constructor)
- return method.DeclaringType.TypeParameterCount > 0;
- var testMethod = method.ReducedFrom ?? method;
- return testMethod.TypeArguments.Any (t => !testMethod.Parameters.Any (p => ContainsType(p.Type, t)));
- }
-
- void SetMember (IEntity entity)
- {
- this.Entity = entity;
- this.completionString = displayText = (Entity.SymbolKind == SymbolKind.Constructor ? Entity.DeclaringTypeDefinition : Entity).Name;
- }
-
- TypeSystemAstBuilder GetBuilder (ICompilation compilation)
- {
- var ctx = editorCompletion.CSharpUnresolvedFile.GetTypeResolveContext (editorCompletion.UnresolvedFileCompilation, editorCompletion.Document.Editor.Caret.Location) as CSharpTypeResolveContext;
- var state = new CSharpResolver (ctx);
- var builder = new TypeSystemAstBuilder (state);
- builder.AddTypeReferenceAnnotations = true;
- var dt = state.CurrentTypeDefinition;
- var declaring = ctx.CurrentTypeDefinition != null ? ctx.CurrentTypeDefinition.DeclaringTypeDefinition : null;
- if (declaring != null) {
- while (dt != null) {
- if (dt.Equals (declaring)) {
- builder.AlwaysUseShortTypeNames = true;
- break;
- }
- dt = dt.DeclaringTypeDefinition;
- }
- }
- return builder;
- }
-
- internal class MyAmbience : IAmbience
- {
- TypeSystemAstBuilder builder;
-
- public MyAmbience (TypeSystemAstBuilder builder)
- {
- this.builder = builder;
- ConversionFlags = ICSharpCode.NRefactory.TypeSystem.ConversionFlags.StandardConversionFlags;
- }
-
- public ConversionFlags ConversionFlags { get; set; }
- #region ConvertEntity
- public string ConvertSymbol(ISymbol symbol)
- {
- if (symbol is IEntity)
- return ConvertEntity ((IEntity)symbol);
- return symbol.ToString ();
- }
-
- public string ConvertEntity (IEntity entity)
- {
- if (entity == null)
- throw new ArgumentNullException ("entity");
-
- StringWriter writer = new StringWriter ();
- ConvertEntity (entity, new TextWriterTokenWriter (writer), FormattingOptionsFactory.CreateMono ());
- return writer.ToString ();
- }
-
- public void ConvertEntity (IEntity entity, TextWriterTokenWriter formatter, CSharpFormattingOptions formattingPolicy)
- {
- if (entity == null)
- throw new ArgumentNullException ("entity");
- if (formatter == null)
- throw new ArgumentNullException ("formatter");
- if (formattingPolicy == null)
- throw new ArgumentNullException ("options");
-
- TypeSystemAstBuilder astBuilder = CreateAstBuilder ();
- EntityDeclaration node = astBuilder.ConvertEntity (entity);
- PrintModifiers (node.Modifiers, formatter);
-
- if ((ConversionFlags & ConversionFlags.ShowDefinitionKeyword) == ConversionFlags.ShowDefinitionKeyword) {
- if (node is TypeDeclaration) {
- switch (((TypeDeclaration)node).ClassType) {
- case ClassType.Class:
- formatter.WriteKeyword (Roles.ClassKeyword, "class");
- break;
- case ClassType.Struct:
- formatter.WriteKeyword (Roles.StructKeyword, "struct");
- break;
- case ClassType.Interface:
- formatter.WriteKeyword (Roles.InterfaceKeyword, "interface");
- break;
- case ClassType.Enum:
- formatter.WriteKeyword (Roles.EnumKeyword, "enum");
- break;
- default:
- throw new Exception ("Invalid value for ClassType");
- }
- formatter.Space ();
- } else if (node is DelegateDeclaration) {
- formatter.WriteKeyword (Roles.DelegateKeyword, "delegate");
- formatter.Space ();
- } else if (node is EventDeclaration) {
- formatter.WriteKeyword (EventDeclaration.EventKeywordRole, "event");
- formatter.Space ();
- }
- }
-
- if ((ConversionFlags & ConversionFlags.ShowReturnType) == ConversionFlags.ShowReturnType) {
- var rt = node.GetChildByRole (Roles.Type);
- if (!rt.IsNull) {
- rt.AcceptVisitor (new CSharpOutputVisitor (formatter, formattingPolicy));
- formatter.Space ();
- }
- }
-
- if (entity is ITypeDefinition)
- WriteTypeDeclarationName ((ITypeDefinition)entity, formatter, formattingPolicy);
- else
- WriteMemberDeclarationName ((IMember)entity, formatter, formattingPolicy);
-
- if ((ConversionFlags & ConversionFlags.ShowParameterList) == ConversionFlags.ShowParameterList && HasParameters (entity)) {
- if (entity.SymbolKind == SymbolKind.Indexer)
- formatter.WriteToken (Roles.LBracket, "[");
- else
- formatter.WriteToken (Roles.LBrace, "(");
- bool first = true;
- foreach (var param in node.GetChildrenByRole(Roles.Parameter)) {
- if (first) {
- first = false;
- } else {
- formatter.WriteToken (Roles.Comma, ",");
- formatter.Space ();
- }
- param.AcceptVisitor (new CSharpOutputVisitor (formatter, formattingPolicy));
- }
- if (entity.SymbolKind == SymbolKind.Indexer)
- formatter.WriteToken (Roles.RBracket, "]");
- else
- formatter.WriteToken (Roles.RBrace, ")");
- }
-
- if ((ConversionFlags & ConversionFlags.ShowBody) == ConversionFlags.ShowBody && !(node is TypeDeclaration)) {
- IProperty property = entity as IProperty;
- if (property != null) {
- formatter.Space ();
- formatter.WriteToken (Roles.LBrace, "{");
- formatter.Space ();
- if (property.CanGet) {
- formatter.WriteKeyword (PropertyDeclaration.GetKeywordRole, "get");
- formatter.WriteToken (Roles.Semicolon, ";");
- formatter.Space ();
- }
- if (property.CanSet) {
- formatter.WriteKeyword (PropertyDeclaration.SetKeywordRole, "set");
- formatter.WriteToken (Roles.Semicolon, ";");
- formatter.Space ();
- }
- formatter.WriteToken (Roles.RBrace, "}");
- } else {
- formatter.WriteToken (Roles.Semicolon, ";");
- }
- }
- }
-
- bool HasParameters (IEntity e)
- {
- switch (e.SymbolKind) {
- case SymbolKind.TypeDefinition:
- return ((ITypeDefinition)e).Kind == TypeKind.Delegate;
- case SymbolKind.Indexer:
- case SymbolKind.Method:
- case SymbolKind.Operator:
- case SymbolKind.Constructor:
- case SymbolKind.Destructor:
- return true;
- default:
- return false;
- }
- }
- public string ConvertConstantValue (object constantValue)
- {
- if (constantValue == null)
- return "null";
- return constantValue.ToString ();
- }
-
- TypeSystemAstBuilder CreateAstBuilder ()
- {
- return builder;
- }
-
- void WriteTypeDeclarationName (ITypeDefinition typeDef, TextWriterTokenWriter formatter, CSharpFormattingOptions formattingPolicy)
- {
- TypeSystemAstBuilder astBuilder = CreateAstBuilder ();
- if (typeDef.DeclaringTypeDefinition != null) {
- WriteTypeDeclarationName (typeDef.DeclaringTypeDefinition, formatter, formattingPolicy);
- formatter.WriteToken (Roles.Dot, ".");
- } else if ((ConversionFlags & ConversionFlags.UseFullyQualifiedTypeNames) == ConversionFlags.UseFullyQualifiedTypeNames) {
- formatter.WriteIdentifier (Identifier.Create (typeDef.Namespace));
- formatter.WriteToken (Roles.Dot, ".");
- }
- formatter.WriteIdentifier (Identifier.Create (typeDef.Name));
- if ((ConversionFlags & ConversionFlags.ShowTypeParameterList) == ConversionFlags.ShowTypeParameterList) {
- var outputVisitor = new CSharpOutputVisitor (formatter, formattingPolicy);
- outputVisitor.WriteTypeParameters (astBuilder.ConvertEntity (typeDef).GetChildrenByRole (Roles.TypeParameter));
- }
- }
-
- void WriteMemberDeclarationName (IMember member, TextWriterTokenWriter formatter, CSharpFormattingOptions formattingPolicy)
- {
- TypeSystemAstBuilder astBuilder = CreateAstBuilder ();
- if ((ConversionFlags & ConversionFlags.ShowDeclaringType) == ConversionFlags.ShowDeclaringType) {
- ConvertType (member.DeclaringType, formatter, formattingPolicy);
- formatter.WriteToken (Roles.Dot, ".");
- }
- switch (member.SymbolKind) {
- case SymbolKind.Indexer:
- formatter.WriteKeyword (IndexerDeclaration.ThisKeywordRole, "this");
- break;
- case SymbolKind.Constructor:
- formatter.WriteIdentifier (Identifier.Create (member.DeclaringType.Name));
- break;
- case SymbolKind.Destructor:
- formatter.WriteToken (DestructorDeclaration.TildeRole, "~");
- formatter.WriteIdentifier (Identifier.Create (member.DeclaringType.Name));
- break;
- case SymbolKind.Operator:
- switch (member.Name) {
- case "op_Implicit":
- formatter.WriteKeyword (OperatorDeclaration.ImplicitRole, "implicit");
- formatter.Space ();
- formatter.WriteKeyword (OperatorDeclaration.OperatorKeywordRole, "operator");
- formatter.Space ();
- ConvertType (member.ReturnType, formatter, formattingPolicy);
- break;
- case "op_Explicit":
- formatter.WriteKeyword (OperatorDeclaration.ExplicitRole, "explicit");
- formatter.Space ();
- formatter.WriteKeyword (OperatorDeclaration.OperatorKeywordRole, "operator");
- formatter.Space ();
- ConvertType (member.ReturnType, formatter, formattingPolicy);
- break;
- default:
- formatter.WriteKeyword (OperatorDeclaration.OperatorKeywordRole, "operator");
- formatter.Space ();
- var operatorType = OperatorDeclaration.GetOperatorType (member.Name);
- if (operatorType.HasValue) {
- formatter.WriteToken (OperatorDeclaration.GetRole (operatorType.Value), OperatorDeclaration.GetToken (operatorType.Value));
- }
- else
- formatter.WriteIdentifier (Identifier.Create (member.Name));
- break;
- }
- break;
- default:
- formatter.WriteIdentifier (Identifier.Create (member.Name));
- break;
- }
- if ((ConversionFlags & ConversionFlags.ShowTypeParameterList) == ConversionFlags.ShowTypeParameterList && member.SymbolKind == SymbolKind.Method) {
- var outputVisitor = new CSharpOutputVisitor (formatter, formattingPolicy);
- outputVisitor.WriteTypeParameters (astBuilder.ConvertEntity (member).GetChildrenByRole (Roles.TypeParameter));
- }
- }
-
- void PrintModifiers (Modifiers modifiers, TextWriterTokenWriter formatter)
- {
- foreach (var m in CSharpModifierToken.AllModifiers) {
- if ((modifiers & m) == m) {
- formatter.WriteToken (TypeDeclaration.ModifierRole, CSharpModifierToken.GetModifierName (m));
- formatter.Space ();
- }
- }
- }
-
-
-#endregion
-
- public string ConvertVariable (IVariable v)
- {
- TypeSystemAstBuilder astBuilder = CreateAstBuilder ();
- AstNode astNode = astBuilder.ConvertVariable (v);
- return astNode.ToString ().TrimEnd (';', '\r', '\n');
- }
-
- public string ConvertType (IType type)
- {
- if (type == null)
- throw new ArgumentNullException ("type");
-
- TypeSystemAstBuilder astBuilder = CreateAstBuilder ();
- AstType astType = astBuilder.ConvertType (type);
- return astType.ToString ();
- }
-
- public void ConvertType (IType type, TextWriterTokenWriter formatter, CSharpFormattingOptions formattingPolicy)
- {
- TypeSystemAstBuilder astBuilder = CreateAstBuilder ();
- AstType astType = astBuilder.ConvertType (type);
- astType.AcceptVisitor (new CSharpOutputVisitor (formatter, formattingPolicy));
- }
-
- public string WrapComment (string comment)
- {
- return "// " + comment;
- }
- }
-
- public static TooltipInformation CreateTooltipInformation (CSharpCompletionTextEditorExtension editorCompletion, CSharpResolver resolver, IEntity entity, bool smartWrap)
- {
- return CreateTooltipInformation (editorCompletion.UnresolvedFileCompilation, editorCompletion.CSharpUnresolvedFile, resolver, editorCompletion.TextEditorData, editorCompletion.FormattingPolicy, entity, smartWrap);
- }
-
- public static TooltipInformation CreateTooltipInformation (ICompilation compilation, CSharpUnresolvedFile file, TextEditorData textEditorData, MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy formattingPolicy, IEntity entity, bool smartWrap, bool createFooter = false)
- {
- return CreateTooltipInformation (compilation, file, null, textEditorData, formattingPolicy, entity, smartWrap, createFooter);
- }
-
- public static TooltipInformation CreateTooltipInformation (ICompilation compilation, CSharpUnresolvedFile file, CSharpResolver resolver, TextEditorData textEditorData, MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy formattingPolicy, IEntity entity, bool smartWrap, bool createFooter = false)
- {
- var tooltipInfo = new TooltipInformation ();
- if (resolver == null)
- resolver = file != null ? file.GetResolver (compilation, textEditorData.Caret.Location) : new CSharpResolver (compilation);
- var sig = new SignatureMarkupCreator (resolver, formattingPolicy.CreateOptions ());
- sig.BreakLineAfterReturnType = smartWrap;
- try {
- tooltipInfo.SignatureMarkup = sig.GetMarkup (entity);
- } catch (Exception e) {
- LoggingService.LogError ("Got exception while creating markup for :" + entity, e);
- return new TooltipInformation ();
- }
- tooltipInfo.SummaryMarkup = AmbienceService.GetSummaryMarkup (entity) ?? "";
-
- if (entity is IMember) {
- var evt = (IMember)entity;
- if (evt.ReturnType.Kind == TypeKind.Delegate) {
- tooltipInfo.AddCategory (GettextCatalog.GetString ("Delegate Info"), sig.GetDelegateInfo (evt.ReturnType));
- }
- }
- if (entity is IMethod) {
- var method = (IMethod)entity;
- if (method.IsExtensionMethod) {
- tooltipInfo.AddCategory (GettextCatalog.GetString ("Extension Method from"), method.DeclaringTypeDefinition.FullName);
- }
- }
- if (createFooter) {
- tooltipInfo.FooterMarkup = sig.CreateFooter (entity);
- }
- return tooltipInfo;
- }
-
- public static TooltipInformation CreateTooltipInformation (ICompilation compilation, CSharpUnresolvedFile file, TextEditorData textEditorData, MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy formattingPolicy, IType type, bool smartWrap, bool createFooter = false)
- {
- var tooltipInfo = new TooltipInformation ();
- if (type.Kind == TypeKind.Unknown)
- return tooltipInfo;
- var resolver = file != null ? file.GetResolver (compilation, textEditorData.Caret.Location) : new CSharpResolver (compilation);
- var sig = new SignatureMarkupCreator (resolver, formattingPolicy.CreateOptions ());
- sig.BreakLineAfterReturnType = smartWrap;
- try {
- tooltipInfo.SignatureMarkup = sig.GetMarkup (type.IsParameterized ? type.GetDefinition () : type);
- } catch (Exception e) {
- LoggingService.LogError ("Got exception while creating markup for :" + type, e);
- return new TooltipInformation ();
- }
- if (type.IsParameterized) {
- var typeInfo = new StringBuilder ();
- for (int i = 0; i < type.TypeParameterCount; i++) {
- typeInfo.AppendLine (type.GetDefinition ().TypeParameters [i].Name + " is " + sig.GetTypeReferenceString (type.TypeArguments [i]));
- }
- tooltipInfo.AddCategory ("Type Parameters", typeInfo.ToString ());
- }
-
- var def = type.GetDefinition ();
- if (def != null) {
- if (createFooter)
- tooltipInfo.FooterMarkup = sig.CreateFooter (def);
- tooltipInfo.SummaryMarkup = AmbienceService.GetSummaryMarkup (def) ?? "";
- }
- return tooltipInfo;
- }
-
- public override TooltipInformation CreateTooltipInformation (bool smartWrap)
- {
- return CreateTooltipInformation (compilation, file, editorCompletion.TextEditorData, editorCompletion.FormattingPolicy, Entity, smartWrap);
- }
- #region IOverloadedCompletionData implementation
-
- class OverloadSorter : IComparer<ICompletionData>
- {
- public OverloadSorter ()
- {
- }
-
- public int Compare (ICompletionData x, ICompletionData y)
- {
- var mx = ((MemberCompletionData)x).Entity as IMember;
- var my = ((MemberCompletionData)y).Entity as IMember;
- int result;
-
- if (mx is ITypeDefinition && my is ITypeDefinition) {
- result = ((((ITypeDefinition)mx).TypeParameters.Count).CompareTo (((ITypeDefinition)my).TypeParameters.Count));
- if (result != 0)
- return result;
- }
-
- if (mx is IMethod && my is IMethod) {
- return MethodParameterDataProvider.MethodComparer ((IMethod)mx, (IMethod)my);
- }
- string sx = mx.ReflectionName;// ambience.GetString (mx, flags);
- string sy = my.ReflectionName;// ambience.GetString (my, flags);
- result = sx.Length.CompareTo (sy.Length);
- return result == 0 ? string.Compare (sx, sy) : result;
- }
- }
-
- public override IEnumerable<ICompletionData> OverloadedData {
- get {
- if (overloads == null)
- return new CompletionData[] { this };
-
- var sorted = new List<ICompletionData> (overloads.Values);
- sorted.Add (this);
- sorted.Sort (new OverloadSorter ());
- return sorted;
- }
- }
-
- public override bool HasOverloads {
- get { return overloads != null && overloads.Count > 0; }
- }
-
- public override void AddOverload (ICSharpCode.NRefactory.Completion.ICompletionData data)
- {
- AddOverload ((MemberCompletionData)data);
- }
-
- public void AddOverload (MemberCompletionData overload)
- {
- if (overloads == null)
- overloads = new Dictionary<string, CompletionData> ();
-
- if (overload.Entity is IMember && Entity is IMember) {
- // filter overriden members that came from base classes
- // note that the overload tree is traversed top down.
- var member = Entity as IMember;
- if (member.IsOverride)
- return;
-
- string MemberId = (overload.Entity as IMember).GetIdString ();
- if (MemberId != (this.Entity as IMember).GetIdString () && !overloads.ContainsKey (MemberId)) {
- overloads [MemberId] = overload;
-
- //if any of the overloads is obsolete, we should not mark the item obsolete
- if (!(overload.Entity as IMember).IsObsolete ())
- DisplayFlags &= ~DisplayFlags.Obsolete;
- }
- }
- }
- #endregion
-
- #region IEntityCompletionData implementation
- public IEntity Entity {
- get;
- set;
- }
- #endregion
-
- public override int CompareTo (object obj)
- {
- int result = base.CompareTo (obj);
- if (result == 0) {
- var mcd = obj as MemberCompletionData;
- if (mcd != null) {
- var mc = mcd;
- if (this.Entity.SymbolKind == SymbolKind.Method) {
- var method = (IMethod)this.Entity;
- if (method.IsExtensionMethod)
- return 1;
- }
- if (mc.Entity.SymbolKind == SymbolKind.Method) {
- var method = (IMethod)mc.Entity;
- if (method.IsExtensionMethod)
- return -1;
- }
- } else {
- return -1;
- }
- }
- return result;
- }
-
- public override string ToString ()
- {
- return string.Format ("[MemberCompletionData: Entity={0}]", Entity);
- }
- }
-}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MethodParameterDataProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MethodParameterDataProvider.cs
index 01551b3b39..d9114e5050 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MethodParameterDataProvider.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MethodParameterDataProvider.cs
@@ -39,7 +39,7 @@ using ICSharpCode.NRefactory.CSharp.Resolver;
using ICSharpCode.NRefactory.CSharp.Refactoring;
using ICSharpCode.NRefactory.CSharp.Completion;
using MonoDevelop.Ide.CodeCompletion;
-using Mono.TextEditor;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.CSharp.Completion
{
@@ -126,55 +126,55 @@ namespace MonoDevelop.CSharp.Completion
public static TooltipInformation CreateTooltipInformation (CSharpCompletionTextEditorExtension ext, ICompilation compilation, CSharpUnresolvedFile file, IParameterizedMember entity, int currentParameter, bool smartWrap)
{
- return CreateTooltipInformation (compilation, file, ext.TextEditorData, ext.FormattingPolicy, entity, currentParameter, smartWrap);
+ return CreateTooltipInformation (compilation, file, ext.Editor, ext.FormattingPolicy, entity, currentParameter, smartWrap);
}
- public static TooltipInformation CreateTooltipInformation (ICompilation compilation, CSharpUnresolvedFile file, TextEditorData textEditorData, MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy formattingPolicy, IParameterizedMember entity, int currentParameter, bool smartWrap)
+ public static TooltipInformation CreateTooltipInformation (ICompilation compilation, CSharpUnresolvedFile file, TextEditor textEditorData, MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy formattingPolicy, IParameterizedMember entity, int currentParameter, bool smartWrap)
{
var tooltipInfo = new TooltipInformation ();
- var resolver = file.GetResolver (compilation, textEditorData.Caret.Location);
- var sig = new SignatureMarkupCreator (resolver, formattingPolicy.CreateOptions ());
- sig.HighlightParameter = currentParameter;
- sig.BreakLineAfterReturnType = smartWrap;
- try {
- tooltipInfo.SignatureMarkup = sig.GetMarkup (entity);
- } catch (Exception e) {
- LoggingService.LogError ("Got exception while creating markup for :" + entity, e);
- return new TooltipInformation ();
- }
- tooltipInfo.SummaryMarkup = AmbienceService.GetSummaryMarkup (entity) ?? "";
-
- if (entity is IMethod) {
- var method = (IMethod)entity;
- if (method.IsExtensionMethod) {
- tooltipInfo.AddCategory (GettextCatalog.GetString ("Extension Method from"), method.DeclaringTypeDefinition.FullName);
- }
- }
- int paramIndex = currentParameter;
-
- if (entity is IMethod && ((IMethod)entity).IsExtensionMethod)
- paramIndex++;
- paramIndex = Math.Min (entity.Parameters.Count - 1, paramIndex);
-
- var curParameter = paramIndex >= 0 && paramIndex < entity.Parameters.Count ? entity.Parameters [paramIndex] : null;
- if (curParameter != null) {
-
- string docText = AmbienceService.GetDocumentation (entity);
- if (!string.IsNullOrEmpty (docText)) {
- string text = docText;
- Regex paramRegex = new Regex ("(\\<param\\s+name\\s*=\\s*\"" + curParameter.Name + "\"\\s*\\>.*?\\</param\\>)", RegexOptions.Compiled);
- Match match = paramRegex.Match (docText);
-
- if (match.Success) {
- text = AmbienceService.GetDocumentationMarkup (entity, match.Groups [1].Value);
- if (!string.IsNullOrWhiteSpace (text))
- tooltipInfo.AddCategory (GettextCatalog.GetString ("Parameter"), text);
- }
- }
-
- if (curParameter.Type.Kind == TypeKind.Delegate)
- tooltipInfo.AddCategory (GettextCatalog.GetString ("Delegate Info"), sig.GetDelegateInfo (curParameter.Type));
- }
+// var resolver = file.GetResolver (compilation, textEditorData.Caret.Location);
+// var sig = new SignatureMarkupCreator (resolver, formattingPolicy.CreateOptions ());
+// sig.HighlightParameter = currentParameter;
+// sig.BreakLineAfterReturnType = smartWrap;
+// try {
+// tooltipInfo.SignatureMarkup = sig.GetMarkup (entity);
+// } catch (Exception e) {
+// LoggingService.LogError ("Got exception while creating markup for :" + entity, e);
+// return new TooltipInformation ();
+// }
+// tooltipInfo.SummaryMarkup = AmbienceService.GetSummaryMarkup (entity) ?? "";
+//
+// if (entity is IMethod) {
+// var method = (IMethod)entity;
+// if (method.IsExtensionMethod) {
+// tooltipInfo.AddCategory (GettextCatalog.GetString ("Extension Method from"), method.DeclaringTypeDefinition.FullName);
+// }
+// }
+// int paramIndex = currentParameter;
+//
+// if (entity is IMethod && ((IMethod)entity).IsExtensionMethod)
+// paramIndex++;
+// paramIndex = Math.Min (entity.Parameters.Count - 1, paramIndex);
+//
+// var curParameter = paramIndex >= 0 && paramIndex < entity.Parameters.Count ? entity.Parameters [paramIndex] : null;
+// if (curParameter != null) {
+//
+// string docText = AmbienceService.GetDocumentation (entity);
+// if (!string.IsNullOrEmpty (docText)) {
+// string text = docText;
+// Regex paramRegex = new Regex ("(\\<param\\s+name\\s*=\\s*\"" + curParameter.Name + "\"\\s*\\>.*?\\</param\\>)", RegexOptions.Compiled);
+// Match match = paramRegex.Match (docText);
+//
+// if (match.Success) {
+// text = AmbienceService.GetDocumentationMarkup (entity, match.Groups [1].Value);
+// if (!string.IsNullOrWhiteSpace (text))
+// tooltipInfo.AddCategory (GettextCatalog.GetString ("Parameter"), text);
+// }
+// }
+//
+// if (curParameter.Type.Kind == TypeKind.Delegate)
+// tooltipInfo.AddCategory (GettextCatalog.GetString ("Delegate Info"), sig.GetDelegateInfo (curParameter.Type));
+// }
return tooltipInfo;
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MonoCSharpCompletionEngine.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MonoCSharpCompletionEngine.cs
deleted file mode 100644
index 0046a7322d..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MonoCSharpCompletionEngine.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// MonoCSharpCompletionEngine.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using ICSharpCode.NRefactory.CSharp.Completion;
-using System.Collections.Generic;
-using MonoDevelop.CodeGeneration;
-using ICSharpCode.NRefactory.TypeSystem;
-using System.Linq;
-using MonoDevelop.CSharp.Refactoring.CodeActions;
-using ICSharpCode.NRefactory.Editor;
-
-namespace MonoDevelop.CSharp.Completion
-{
- class MonoCSharpCompletionEngine : CSharpCompletionEngine
- {
- readonly CSharpCompletionTextEditorExtension ext;
-
- public CSharpCompletionTextEditorExtension Ext {
- get {
- return ext;
- }
- }
-
- public MDRefactoringContext MDRefactoringCtx {
- get {
- return ext.MDRefactoringCtx;
- }
- }
-
- public MonoCSharpCompletionEngine (CSharpCompletionTextEditorExtension ext, ICSharpCode.NRefactory.Editor.IDocument document, ICompletionContextProvider completionContextProvider, ICompletionDataFactory factory, ICSharpCode.NRefactory.TypeSystem.IProjectContent content, ICSharpCode.NRefactory.CSharp.TypeSystem.CSharpTypeResolveContext ctx) : base (document, completionContextProvider, factory, content, ctx)
- {
- this.ext = ext;
- }
-
- protected override void AddVirtuals (List<IMember> alreadyInserted, CompletionDataWrapper col, string modifiers, IType curType, int declarationBegin)
- {
- base.AddVirtuals (alreadyInserted, col, modifiers, curType, declarationBegin);
- foreach (var member in GetProtocolMembers (curType)) {
- if (alreadyInserted.Contains (member))
- continue;
- if (BaseExportCodeGenerator.IsImplemented (curType, member))
- continue;
- alreadyInserted.Add (member);
- var data = new ProtocolCompletionData (this, declarationBegin, member);
- col.Add (data);
- }
- }
-
- internal static bool IsFoundationNamespace (string ns )
- {
- return (ns == "MonoTouch.Foundation" || ns == "Foundation");
- }
-
- IEnumerable<IMember> GetProtocolMembers (IType curType)
- {
- foreach (var t in curType.DirectBaseTypes) {
- string name;
- if (!BaseExportCodeGenerator.HasProtocolAttribute (t, out name))
- continue;
- var protocolType = Compilation.FindType (new FullTypeName (new TopLevelTypeName (t.Namespace, name)));
- if (protocolType == null)
- break;
- foreach (var member in protocolType.GetMethods (null, GetMemberOptions.IgnoreInheritedMembers)) {
- if (member.ImplementedInterfaceMembers.Any () || member.IsAbstract || !member.IsVirtual)
- continue;
- if (member.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && IsFoundationNamespace (a.AttributeType.Namespace))) {
- yield return member;
- }
- }
- foreach (var member in protocolType.GetProperties (null, GetMemberOptions.IgnoreInheritedMembers)) {
- if (member.ImplementedInterfaceMembers.Any () || member.IsAbstract || !member.IsVirtual)
- continue;
- if (member.CanGet && member.Getter.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && IsFoundationNamespace (a.AttributeType.Namespace)) ||
- member.CanSet && member.Setter.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && IsFoundationNamespace (a.AttributeType.Namespace)))
- yield return member;
- }
- }
- }
- }
-}
-
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/NewOverrideCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/NewOverrideCompletionData.cs
deleted file mode 100644
index 4d779caaca..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/NewOverrideCompletionData.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-// NewOverrideCompletionData.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.Linq;
-using System.Text;
-using MonoDevelop.Ide.CodeCompletion;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Content;
-using System.Collections.Generic;
-using ICSharpCode.NRefactory.CSharp;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Ide.TypeSystem;
-
-namespace MonoDevelop.CSharp.Completion
-{
- class NewOverrideCompletionData : CompletionData
- {
- CSharpCompletionTextEditorExtension ext;
- IMember member;
- static Ambience ambience = new CSharpAmbience ();
- int declarationBegin;
- IUnresolvedTypeDefinition type;
-
- public bool GenerateBody { get; set; }
-
- public override TooltipInformation CreateTooltipInformation (bool smartWrap)
- {
- return MemberCompletionData.CreateTooltipInformation (ext, null, member, smartWrap);
- }
-
- public NewOverrideCompletionData (CSharpCompletionTextEditorExtension ext, int declarationBegin, IUnresolvedTypeDefinition type, IMember member) : base (null)
- {
- this.ext = ext;
- this.type = type;
- this.member = member;
-
- this.declarationBegin = declarationBegin;
- this.GenerateBody = true;
- this.Icon = member.GetStockIcon ();
- this.DisplayText = ambience.GetString (member, OutputFlags.IncludeParameters | OutputFlags.IncludeParameterName | OutputFlags.IncludeGenerics | OutputFlags.HideExtensionsParameter| OutputFlags.IncludeAccessor);
- this.CompletionText = member.SymbolKind == SymbolKind.Indexer ? "this" : member.Name;
- }
-
- public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
- {
- var editor = ext.TextEditorData;
- var generator = CodeGenerator.CreateGenerator (ext.Document);
- bool isExplicit = false;
- if (member.DeclaringTypeDefinition.Kind == TypeKind.Interface) {
- foreach (var m in type.Members) {
- if (m.Name == member.Name && !m.ReturnType.Equals (member.ReturnType)) {
- isExplicit = true;
- break;
- }
- }
- }
- var resolvedType = type.Resolve (ext.Project).GetDefinition ();
- if (ext.Project != null)
- generator.PolicyParent = ext.Project.Policies;
- var result = generator.CreateMemberImplementation (resolvedType, type, member, isExplicit);
- string sb = result.Code.TrimStart ();
- int trimStart = result.Code.Length - sb.Length;
- sb = sb.TrimEnd ();
-
- var lastRegion = result.BodyRegions.LastOrDefault ();
- var region = lastRegion == null? null
- : new CodeGeneratorBodyRegion (lastRegion.StartOffset - trimStart, lastRegion.EndOffset - trimStart);
-
- int targetCaretPosition;
- int selectionEndPosition = -1;
- if (region != null && region.IsValid) {
- targetCaretPosition = declarationBegin + region.StartOffset;
- if (region.Length > 0) {
- if (GenerateBody) {
- selectionEndPosition = declarationBegin + region.EndOffset;
- } else {
- //FIXME: if there are multiple regions, remove all of them
- sb = sb.Substring (0, region.StartOffset) + sb.Substring (region.EndOffset);
- }
- }
- } else {
- targetCaretPosition = declarationBegin + sb.Length;
- }
-
- editor.Replace (declarationBegin, editor.Caret.Offset - declarationBegin, sb);
- if (selectionEndPosition > 0) {
- editor.Caret.Offset = selectionEndPosition;
- editor.SetSelection (targetCaretPosition, selectionEndPosition);
- } else {
- editor.Caret.Offset = targetCaretPosition;
- }
- }
- }
-}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ObjectCreationCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ObjectCreationCompletionData.cs
new file mode 100644
index 0000000000..23b972c75f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ObjectCreationCompletionData.cs
@@ -0,0 +1,155 @@
+//
+// CSharpCompletionTextEditorExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2011 Xamarin <http://xamarin.com>
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.CodeCompletion;
+using System.Text;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide.Editor.Extension;
+using System.Linq;
+using Gtk;
+using MonoDevelop.Ide;
+using System.Collections.Generic;
+
+namespace MonoDevelop.CSharp.Completion
+{
+ class ObjectCreationCompletionData : RoslynSymbolCompletionData
+ {
+ public static readonly SymbolDisplayFormat HideParameters =
+ new SymbolDisplayFormat(
+ globalNamespaceStyle: SymbolDisplayGlobalNamespaceStyle.Omitted,
+ typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameAndContainingTypesAndNamespaces,
+ propertyStyle: SymbolDisplayPropertyStyle.NameOnly,
+ genericsOptions: SymbolDisplayGenericsOptions.IncludeTypeParameters,
+ memberOptions: SymbolDisplayMemberOptions.None,
+ parameterOptions:
+ SymbolDisplayParameterOptions.None,
+ miscellaneousOptions:
+ SymbolDisplayMiscellaneousOptions.EscapeKeywordIdentifiers |
+ SymbolDisplayMiscellaneousOptions.UseSpecialTypes
+ );
+
+ readonly ITypeSymbol type;
+ readonly ISymbol symbol;
+ ISymbol insertSymbol;
+ readonly int declarationBegin;
+ readonly bool afterKeyword;
+ readonly SemanticModel semanticModel;
+
+ string displayText;
+
+
+ public override string DisplayText {
+ get {
+ if (displayText == null) {
+ displayText = CropGlobal(RoslynCompletionData.SafeMinimalDisplayString (symbol, semanticModel, declarationBegin, Ambience.LabelFormat)) + "()";
+ if (!afterKeyword)
+ displayText = "new " + displayText;
+ }
+ return displayText;
+ }
+ }
+
+ public override string GetDisplayTextMarkup ()
+ {
+ var model = ext.ParsedDocument.GetAst<SemanticModel> ();
+
+ var result = "<b>" + Ambience.EscapeText (CropGlobal(RoslynCompletionData.SafeMinimalDisplayString (symbol, model, declarationBegin, HideParameters))) + "</b>()";
+ if (!afterKeyword)
+ result = "new " + result;
+ return ApplyDiplayFlagsFormatting (result);
+ }
+
+ static string CropGlobal (string str)
+ {
+ // shouldn't happen according to the display format - but happens. bug ?
+ if (str.StartsWith ("global::"))
+ return str.Substring ("global::".Length);
+ return str;
+ }
+
+ public override bool HasOverloads {
+ get {
+ return true;
+ }
+ }
+
+ List<CompletionData> overloads;
+ public override IReadOnlyList<CompletionData> OverloadedData {
+ get {
+ if (overloads == null) {
+ overloads = new List<CompletionData> ();
+ foreach (var constructor in type.GetMembers ().OfType<IMethodSymbol> ().Where (m => m.MethodKind == MethodKind.Constructor)) {
+ overloads.Add (new ObjectCreationCompletionData (KeyHandler, factory, semanticModel, type, constructor, declarationBegin, afterKeyword) { insertSymbol = this.insertSymbol });
+ }
+ }
+ return overloads;
+ }
+ }
+
+ public ObjectCreationCompletionData (ICompletionDataKeyHandler keyHandler, RoslynCodeCompletionFactory factory, SemanticModel semanticModel, ITypeSymbol type, ISymbol symbol, int declarationBegin, bool afterKeyword) : base(keyHandler, factory, symbol)
+ {
+ this.type = type;
+ this.semanticModel = semanticModel;
+ this.afterKeyword = afterKeyword;
+ this.declarationBegin = declarationBegin;
+ this.symbol = insertSymbol = symbol;
+ }
+
+ protected override string GetInsertionText ()
+ {
+ var sb = new StringBuilder ();
+ if (!afterKeyword)
+ sb.Append ("new ");
+ sb.Append (CropGlobal (RoslynCompletionData.SafeMinimalDisplayString (insertSymbol, semanticModel, declarationBegin, HideParameters)));
+ return sb.ToString () ;
+ }
+
+ public override int CompareTo (object obj)
+ {
+ var objCrCompData = obj as ObjectCreationCompletionData;
+ if (objCrCompData == null)
+ return -1;
+
+ return DisplayText.CompareTo(objCrCompData.DisplayText);
+ }
+
+ internal static bool HasAnyConstructorWithParameters (ITypeSymbol symbol)
+ {
+ return symbol.GetMembers()
+ .OfType<IMethodSymbol>()
+ .Where(m => m.MethodKind == MethodKind.Constructor)
+ .Any (m => m.Parameters.Length > 0);
+ }
+
+ public override bool IsOverload (CompletionData other)
+ {
+ return false;
+ }
+ }
+
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ProtocolCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ProtocolCompletionData.cs
index edb8a32224..2fa3acb6b4 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ProtocolCompletionData.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ProtocolCompletionData.cs
@@ -28,60 +28,158 @@ using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.CodeGeneration;
+using MonoDevelop.Ide.Editor.Extension;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.CSharp.Refactoring;
+using System.Linq;
+using MonoDevelop.CSharp.Formatting;
namespace MonoDevelop.CSharp.Completion
{
- class ProtocolCompletionData : CompletionData
+ class ProtocolCompletionData : RoslynSymbolCompletionData
{
- readonly MonoCSharpCompletionEngine engine;
- readonly IMember member;
- readonly static Ambience ambience = new CSharpAmbience ();
- readonly int declarationBegin;
+ readonly int declarationBegin;
+ readonly ITypeSymbol currentType;
public bool GenerateBody { get; set; }
- public override TooltipInformation CreateTooltipInformation (bool smartWrap)
+ static readonly SymbolDisplayFormat NameFormat;
+
+ internal static readonly SymbolDisplayFormat overrideNameFormat;
+
+ static ProtocolCompletionData ()
{
- return MemberCompletionData.CreateTooltipInformation (engine.Ext, null, member, smartWrap);
+ NameFormat = new SymbolDisplayFormat (
+ globalNamespaceStyle: SymbolDisplayGlobalNamespaceStyle.Omitted,
+ typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameAndContainingTypesAndNamespaces,
+ propertyStyle: SymbolDisplayPropertyStyle.NameOnly,
+ genericsOptions: SymbolDisplayGenericsOptions.IncludeTypeParameters | SymbolDisplayGenericsOptions.IncludeVariance,
+ memberOptions: SymbolDisplayMemberOptions.IncludeParameters | SymbolDisplayMemberOptions.IncludeExplicitInterface,
+ parameterOptions:
+ SymbolDisplayParameterOptions.IncludeParamsRefOut |
+ SymbolDisplayParameterOptions.IncludeExtensionThis |
+ SymbolDisplayParameterOptions.IncludeType |
+ SymbolDisplayParameterOptions.IncludeName,
+ miscellaneousOptions:
+ SymbolDisplayMiscellaneousOptions.EscapeKeywordIdentifiers |
+ SymbolDisplayMiscellaneousOptions.UseSpecialTypes
+ );
+
+ overrideNameFormat = NameFormat.WithParameterOptions (
+ SymbolDisplayParameterOptions.IncludeDefaultValue |
+ SymbolDisplayParameterOptions.IncludeExtensionThis |
+ SymbolDisplayParameterOptions.IncludeType |
+ SymbolDisplayParameterOptions.IncludeName |
+ SymbolDisplayParameterOptions.IncludeParamsRefOut
+ );
}
- public ProtocolCompletionData (MonoCSharpCompletionEngine engine, int declarationBegin, IMember member) : base (null)
+ string displayText;
+
+ bool afterKeyword;
+
+ public override string DisplayText {
+ get {
+ if (displayText == null) {
+ if (factory == null) {
+ displayText = Symbol.Name;
+ } else {
+ var model = ext.ParsedDocument.GetAst<SemanticModel> ();
+ displayText = RoslynCompletionData.SafeMinimalDisplayString (base.Symbol, model, ext.Editor.CaretOffset, overrideNameFormat);
+ }
+ if (!afterKeyword)
+ displayText = "override " + displayText;
+ }
+
+ return displayText;
+ }
+ }
+
+ public override string CompletionText {
+ get {
+ return Symbol.Name;
+ }
+ }
+
+ public override string GetDisplayTextMarkup ()
{
- this.engine = engine;
- this.member = member;
+ if (factory == null)
+ return Symbol.Name;
+ var model = ext.ParsedDocument.GetAst<SemanticModel> ();
+
+ var result = RoslynCompletionData.SafeMinimalDisplayString (base.Symbol, model, declarationBegin, Ambience.LabelFormat) + " {...}";
+ var idx = result.IndexOf (Symbol.Name);
+ if (idx >= 0) {
+ result =
+ result.Substring (0, idx) +
+ "<b>" + Symbol.Name + "</b>" +
+ result.Substring (idx + Symbol.Name.Length);
+ }
+
+ if (!afterKeyword)
+ result = "override " + result;
+
+ return ApplyDiplayFlagsFormatting (result);
+ }
+ public ProtocolCompletionData (ICompletionDataKeyHandler keyHandler, RoslynCodeCompletionFactory factory, int declarationBegin, ITypeSymbol currentType, Microsoft.CodeAnalysis.ISymbol member, bool afterKeyword) : base (keyHandler, factory, member, member.ToDisplayString ())
+ {
+ this.afterKeyword = afterKeyword;
+ this.currentType = currentType;
this.declarationBegin = declarationBegin;
this.GenerateBody = true;
- this.Icon = member.GetStockIcon ();
- this.DisplayText = ambience.GetString (member, OutputFlags.IncludeParameters | OutputFlags.IncludeParameterName | OutputFlags.IncludeGenerics | OutputFlags.HideExtensionsParameter| OutputFlags.IncludeAccessor);
- this.CompletionText = member.SymbolKind == SymbolKind.Indexer ? "this" : member.Name;
}
- public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
- var ext = engine.Ext;
- var editor = ext.TextEditorData;
- var generator = CodeGenerator.CreateGenerator (ext.Document);
- if (ext.Project != null)
- generator.PolicyParent = ext.Project.Policies;
- var builder = engine.MDRefactoringCtx.CreateTypeSystemAstBuilder ();
-
- string sb = BaseExportCodeGenerator.GenerateMemberCode (engine.MDRefactoringCtx, builder, member);
+ var editor = ext.Editor;
+ bool isExplicit = false;
+ // if (member.DeclaringTypeDefinition.Kind == TypeKind.Interface) {
+ // foreach (var m in type.Members) {
+ // if (m.Name == member.Name && !m.ReturnType.Equals (member.ReturnType)) {
+ // isExplicit = true;
+ // break;
+ // }
+ // }
+ // }
+ // var resolvedType = type.Resolve (ext.Project).GetDefinition ();
+ // if (ext.Project != null)
+ // generator.PolicyParent = ext.Project.Policies;
+
+ var result = CSharpCodeGenerator.CreateProtocolMemberImplementation (ext.DocumentContext, ext.Editor, currentType, currentType.Locations.First (), Symbol, isExplicit, factory.SemanticModel);
+ string sb = result.Code.TrimStart ();
+ int trimStart = result.Code.Length - sb.Length;
sb = sb.TrimEnd ();
- string indent = editor.GetIndentationString (editor.Caret.Location);
- sb = sb.Replace (editor.EolMarker, editor.EolMarker + indent);
+ var lastRegion = result.BodyRegions.LastOrDefault ();
+ var region = lastRegion == null ? null
+ : new CodeGeneratorBodyRegion (lastRegion.StartOffset - trimStart, lastRegion.EndOffset - trimStart);
- int targetCaretPosition = sb.LastIndexOf ("throw", StringComparison.Ordinal);
- int selectionEndPosition = sb.LastIndexOf (";", StringComparison.Ordinal);
+ int targetCaretPosition;
+ int selectionEndPosition = -1;
+ if (region != null && region.IsValid) {
+ targetCaretPosition = declarationBegin + region.StartOffset;
+ if (region.Length > 0) {
+ if (GenerateBody) {
+ selectionEndPosition = declarationBegin + region.EndOffset;
+ } else {
+ //FIXME: if there are multiple regions, remove all of them
+ sb = sb.Substring (0, region.StartOffset) + sb.Substring (region.EndOffset);
+ }
+ }
+ } else {
+ targetCaretPosition = declarationBegin + sb.Length;
+ }
- editor.Replace (declarationBegin, editor.Caret.Offset - declarationBegin, sb);
+ editor.ReplaceText (declarationBegin, editor.CaretOffset - declarationBegin, sb);
if (selectionEndPosition > 0) {
- targetCaretPosition += declarationBegin;
- selectionEndPosition += declarationBegin;
- editor.Caret.Offset = selectionEndPosition;
+ editor.CaretOffset = selectionEndPosition;
editor.SetSelection (targetCaretPosition, selectionEndPosition);
+ } else {
+ editor.CaretOffset = targetCaretPosition;
}
+
+ OnTheFlyFormatter.Format (editor, ext.DocumentContext, declarationBegin, declarationBegin + sb.Length);
}
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ProtocolMemberContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ProtocolMemberContextHandler.cs
new file mode 100644
index 0000000000..af50f28a22
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ProtocolMemberContextHandler.cs
@@ -0,0 +1,173 @@
+//
+// ProtocolMemberContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using ICSharpCode.NRefactory6.CSharp.Completion;
+using System.Collections.Generic;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis;
+using System.Threading;
+using System.Linq;
+using Mono.Addins.Description;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace MonoDevelop.CSharp.Completion
+{
+ interface IExtensionContextHandler
+ {
+ void Init (RoslynCodeCompletionFactory factory);
+ }
+
+ class ProtocolMemberContextHandler : OverrideContextHandler, IExtensionContextHandler
+ {
+ RoslynCodeCompletionFactory factory;
+
+ void IExtensionContextHandler.Init (RoslynCodeCompletionFactory factory)
+ {
+ this.factory = factory;
+ }
+
+ protected override IEnumerable<CompletionData> CreateCompletionData (CompletionEngine engine, SemanticModel semanticModel, int position, ITypeSymbol returnType, Accessibility seenAccessibility, SyntaxToken startToken, SyntaxToken tokenBeforeReturnType, bool afterKeyword, CancellationToken cancellationToken)
+ {
+ var result = new List<CompletionData> ();
+ ISet<ISymbol> overridableMembers;
+ if (!TryDetermineOverridableProtocolMembers (semanticModel, tokenBeforeReturnType, seenAccessibility, out overridableMembers, cancellationToken)) {
+ return result;
+ }
+ if (returnType != null) {
+ overridableMembers = FilterOverrides (overridableMembers, returnType);
+ }
+ var curType = semanticModel.GetEnclosingSymbol<INamedTypeSymbol> (startToken.SpanStart, cancellationToken);
+ var declarationBegin = afterKeyword ? startToken.SpanStart : position - 1;
+ foreach (var m in overridableMembers) {
+ var data = new ProtocolCompletionData (this, factory, declarationBegin, curType, m, afterKeyword);
+ result.Add (data);
+ }
+ return result;
+ }
+
+ static bool TryDetermineOverridableProtocolMembers(SemanticModel semanticModel, SyntaxToken startToken, Accessibility seenAccessibility, out ISet<ISymbol> overridableMembers, CancellationToken cancellationToken)
+ {
+ var result = new HashSet<ISymbol>();
+ var containingType = semanticModel.GetEnclosingSymbol<INamedTypeSymbol>(startToken.SpanStart, cancellationToken);
+ if (containingType != null && !containingType.IsScriptClass && !containingType.IsImplicitClass)
+ {
+ if (containingType.TypeKind == TypeKind.Class || containingType.TypeKind == TypeKind.Struct)
+ {
+ var baseTypes = containingType.GetBaseTypes().Reverse().Concat(containingType.AllInterfaces);
+ foreach (var type in baseTypes)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+
+ // Prefer overrides in derived classes
+ RemoveOverriddenMembers(result, type, cancellationToken);
+
+ // Retain overridable methods
+ AddProtocolMembers(semanticModel, result, containingType, type, cancellationToken);
+ }
+ // Don't suggest already overridden members
+ RemoveOverriddenMembers(result, containingType, cancellationToken);
+ }
+ }
+
+ // Filter based on accessibility
+ if (seenAccessibility != Accessibility.NotApplicable)
+ {
+ result.RemoveWhere(m => m.DeclaredAccessibility != seenAccessibility);
+ }
+
+
+ // Filter members that are already overriden - they're already part of 'override completion'
+ ISet<ISymbol> realOverridableMembers;
+ if (OverrideContextHandler.TryDetermineOverridableMembers (semanticModel, startToken, seenAccessibility, out realOverridableMembers, cancellationToken)) {
+ result.RemoveWhere (m => realOverridableMembers.Any (m2 => IsEqualMember (m, m2)));
+ }
+
+ overridableMembers = result;
+ return overridableMembers.Count > 0;
+ }
+
+ static bool IsEqualMember (ISymbol m, ISymbol m2)
+ {
+ return SignatureComparer.HaveSameSignature (m, m2, true);
+ }
+
+ static void AddProtocolMembers(SemanticModel semanticModel, HashSet<ISymbol> result, INamedTypeSymbol containingType, INamedTypeSymbol type, CancellationToken cancellationToken)
+ {
+ string name;
+ if (!HasProtocolAttribute (type, out name))
+ return;
+ var protocolType = semanticModel.Compilation.GlobalNamespace.GetAllTypes (cancellationToken).FirstOrDefault (t => string.Equals (t.Name, name, StringComparison.OrdinalIgnoreCase));
+ if (protocolType == null)
+ return;
+
+ foreach (var member in protocolType.GetMembers ().OfType<IMethodSymbol> ()) {
+ if (member.ExplicitInterfaceImplementations.Length > 0 || member.IsAbstract || !member.IsVirtual)
+ continue;
+ if (member.GetAttributes ().Any (a => a.AttributeClass.Name == "ExportAttribute" && IsFoundationNamespace (a.AttributeClass.ContainingNamespace.GetFullName ()))) {
+ result.Add (member);
+ }
+
+ }
+ foreach (var member in protocolType.GetMembers ().OfType<IPropertySymbol> ()) {
+ if (member.ExplicitInterfaceImplementations.Length > 0 || member.IsAbstract || !member.IsVirtual)
+ continue;
+ if (member.GetMethod != null && member.GetMethod.GetAttributes ().Any (a => a.AttributeClass.Name == "ExportAttribute" && IsFoundationNamespace (a.AttributeClass.ContainingNamespace.GetFullName ())) ||
+ member.SetMethod != null && member.SetMethod.GetAttributes ().Any (a => a.AttributeClass.Name == "ExportAttribute" && IsFoundationNamespace (a.AttributeClass.ContainingNamespace.GetFullName ())))
+ result.Add (member);
+ }
+ }
+
+ internal static bool IsFoundationNamespace (string ns )
+ {
+ return (ns == "MonoTouch.Foundation" || ns == "Foundation");
+ }
+
+ internal static bool IsFoundationNamespace (INamespaceSymbol ns)
+ {
+ return IsFoundationNamespace (ns.GetFullName ());
+ }
+
+ internal static bool HasProtocolAttribute (INamedTypeSymbol type, out string name)
+ {
+ foreach (var baseType in type.GetAllBaseClassesAndInterfaces (true)) {
+ foreach (var attrs in baseType.GetAttributes ()) {
+ if (attrs.AttributeClass.Name == "ProtocolAttribute" && IsFoundationNamespace (attrs.AttributeClass.ContainingNamespace.GetFullName ())) {
+ foreach (var na in attrs.NamedArguments) {
+ if (na.Key != "Name")
+ continue;
+ name = na.Value.Value as string;
+ if (name != null)
+ return true;
+ }
+ }
+ }
+ }
+ name = null;
+ return false;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCodeCompletionFactory.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCodeCompletionFactory.cs
new file mode 100644
index 0000000000..2a6095366f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCodeCompletionFactory.cs
@@ -0,0 +1,271 @@
+//
+// CSharpCompletionTextEditorExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2011 Xamarin <http://xamarin.com>
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.CodeCompletion;
+using System.Collections.Generic;
+using System.Linq;
+using MonoDevelop.Ide.TypeSystem;
+using ICSharpCode.NRefactory6.CSharp.Completion;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace MonoDevelop.CSharp.Completion
+{
+ class RoslynCodeCompletionFactory : ICompletionDataFactory
+ {
+ readonly CSharpCompletionTextEditorExtension ext;
+ readonly SemanticModel semanticModel;
+
+ public CSharpCompletionTextEditorExtension Ext {
+ get {
+ return this.ext;
+ }
+ }
+
+ public SemanticModel SemanticModel {
+ get {
+ return this.semanticModel;
+ }
+ }
+
+ public RoslynCodeCompletionFactory (CSharpCompletionTextEditorExtension ext, SemanticModel semanticModel)
+ {
+ if (ext == null)
+ throw new ArgumentNullException ("ext");
+ if (semanticModel == null)
+ throw new ArgumentNullException ("semanticModel");
+ this.semanticModel = semanticModel;
+ this.ext = ext;
+ }
+
+ #region ICompletionDataFactory implementation
+
+
+ class KeywordCompletionData : RoslynCompletionData
+ {
+ static SignatureMarkupCreator creator = new SignatureMarkupCreator (null, 0);
+
+ SyntaxKind kind;
+
+ public KeywordCompletionData (ICompletionDataKeyHandler keyHandler, SyntaxKind kind) : base (keyHandler)
+ {
+ this.kind = kind;
+ }
+
+ public override Task<TooltipInformation> CreateTooltipInformation (bool smartWrap, System.Threading.CancellationToken cancelToken)
+ {
+ if (kind == SyntaxKind.IdentifierToken)
+ return Task.FromResult (creator.GetKeywordTooltip (SyntaxFactory.Identifier (this.DisplayText)));
+ return Task.FromResult (creator.GetKeywordTooltip (SyntaxFactory.Token (kind)));
+ }
+ }
+
+ CompletionData ICompletionDataFactory.CreateKeywordCompletion (ICompletionDataKeyHandler keyHandler, string data, SyntaxKind syntaxKind)
+ {
+ return new KeywordCompletionData (keyHandler, syntaxKind) {
+ CompletionText = data,
+ DisplayText = data,
+ Icon = "md-keyword"
+ };
+ }
+
+ CompletionData ICompletionDataFactory.CreateGenericData (ICompletionDataKeyHandler keyHandler, string data, GenericDataType genericDataType)
+ {
+ return new RoslynCompletionData (keyHandler) {
+ CompletionText = data,
+ DisplayText = data,
+ Icon = "md-keyword"
+ };
+ }
+
+ ISymbolCompletionData ICompletionDataFactory.CreateEnumMemberCompletionData (ICompletionDataKeyHandler keyHandler, ISymbol alias, IFieldSymbol field)
+ {
+ return new RoslynSymbolCompletionData (keyHandler, this, field, RoslynCompletionData.SafeMinimalDisplayString (alias ?? field.Type, semanticModel, ext.Editor.CaretOffset, Ambience.NameFormat) + "." + field.Name);
+ }
+
+ class FormatItemCompletionData : RoslynCompletionData
+ {
+ string format;
+ string description;
+ object example;
+
+ public FormatItemCompletionData (ICompletionDataKeyHandler keyHandler, string format, string description, object example) : base (keyHandler)
+ {
+ this.format = format;
+ this.description = description;
+ this.example = example;
+ }
+
+ public override string DisplayText {
+ get {
+ return format;
+ }
+ }
+
+ public override string GetDisplayDescription (bool isSelected)
+ {
+ return "- <span foreground=\"darkgray\" size='small'>" + description + "</span>";
+ }
+
+ string rightSideDescription = null;
+ public override string GetRightSideDescription (bool isSelected)
+ {
+ if (rightSideDescription == null) {
+ try {
+ rightSideDescription = "<span size='small'>" + string.Format ("{0:" +format +"}", example) +"</span>";
+ } catch (Exception e) {
+ rightSideDescription = "";
+ LoggingService.LogError ("Format error.", e);
+ }
+ }
+ return rightSideDescription;
+ }
+
+ public override string CompletionText {
+ get {
+ return format;
+ }
+ }
+
+ public override int CompareTo (object obj)
+ {
+ return 0;
+ }
+ }
+
+ CompletionData ICompletionDataFactory.CreateFormatItemCompletionData (ICompletionDataKeyHandler keyHandler, string format, string description, object example)
+ {
+ return new FormatItemCompletionData (keyHandler, format, description, example);
+ }
+
+ class XmlDocCompletionData : RoslynCompletionData
+ {
+ //readonly CSharpCompletionTextEditorExtension ext;
+ /*
+ #region IListData implementation
+
+ CSharpCompletionDataList list;
+ public CSharpCompletionDataList List {
+ get {
+ return list;
+ }
+ set {
+ list = value;
+ }
+ }
+
+ #endregion*/
+
+ public XmlDocCompletionData (ICompletionDataKeyHandler keyHandler, RoslynCodeCompletionFactory ext, string title, string description, string insertText) : base (keyHandler, title, "md-keyword", description, insertText ?? title)
+ {
+ // this.ext = ext;
+ //this.title = title;
+ }
+// public override TooltipInformation CreateTooltipInformation (bool smartWrap)
+// {
+// var sig = new SignatureMarkupCreator (ext.Editor, ext.DocumentContext, ext.Editor.CaretOffset);
+// sig.BreakLineAfterReturnType = smartWrap;
+// return sig.GetKeywordTooltip (title, null);
+// }
+
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, MonoDevelop.Ide.Editor.Extension.KeyDescriptor descriptor)
+ {
+ var currentWord = GetCurrentWord (window, descriptor);
+ var text = CompletionText;
+ if (descriptor.KeyChar == '>' && text.EndsWith (">", StringComparison.Ordinal))
+ text = text.Substring (0, text.Length - 1);
+ if (text.StartsWith ("<", StringComparison.Ordinal))
+ text = text.Substring (1);
+
+ window.CompletionWidget.SetCompletionText (window.CodeCompletionContext, currentWord, text);
+ }
+ }
+
+ CompletionData ICompletionDataFactory.CreateXmlDocCompletionData (ICompletionDataKeyHandler keyHandler, string title, string description, string insertText)
+ {
+ return new XmlDocCompletionData (keyHandler, this, title, description, insertText);
+ }
+
+ ISymbolCompletionData ICompletionDataFactory.CreateSymbolCompletionData (ICompletionDataKeyHandler keyHandler, ISymbol symbol)
+ {
+ return new RoslynSymbolCompletionData (keyHandler, this, symbol, symbol.Name);
+ }
+
+ ISymbolCompletionData ICompletionDataFactory.CreateSymbolCompletionData (ICompletionDataKeyHandler keyHandler, ISymbol symbol, string text)
+ {
+ return new RoslynSymbolCompletionData (keyHandler, this, symbol, text);
+ }
+
+ ISymbolCompletionData ICompletionDataFactory.CreateExistingMethodDelegate (ICompletionDataKeyHandler keyHandler, IMethodSymbol method)
+ {
+ return new RoslynSymbolCompletionData (keyHandler, this, method, method.Name) { IsDelegateExpected = true };
+ }
+
+ CompletionData ICompletionDataFactory.CreateNewOverrideCompletionData(ICompletionDataKeyHandler keyHandler, int declarationBegin, ITypeSymbol currentType, ISymbol m, bool afterKeyword)
+ {
+ return new CreateOverrideCompletionData (keyHandler, this, declarationBegin, currentType, m, afterKeyword);
+ }
+
+ CompletionData ICompletionDataFactory.CreatePartialCompletionData(ICompletionDataKeyHandler keyHandler, int declarationBegin, ITypeSymbol currentType, IMethodSymbol method, bool afterKeyword)
+ {
+ return new CreatePartialCompletionData (keyHandler, this, declarationBegin, currentType, method, afterKeyword);
+ }
+
+ CompletionData ICompletionDataFactory.CreateAnonymousMethod(ICompletionDataKeyHandler keyHandler, string displayText, string description, string textBeforeCaret, string textAfterCaret)
+ {
+ return new AnonymousMethodCompletionData (this, keyHandler) {
+ CompletionText = textBeforeCaret + "|" + textAfterCaret,
+ DisplayText = displayText,
+ Description = description
+ };
+ }
+
+ CompletionData ICompletionDataFactory.CreateNewMethodDelegate(ICompletionDataKeyHandler keyHandler, ITypeSymbol delegateType, string varName, INamedTypeSymbol curType)
+ {
+ return new EventCreationCompletionData (keyHandler, this, delegateType, varName, curType);
+ }
+
+ CompletionData ICompletionDataFactory.CreateObjectCreation (ICompletionDataKeyHandler keyHandler, ITypeSymbol type, ISymbol symbol, int declarationBegin, bool afterKeyword)
+ {
+ return new ObjectCreationCompletionData (keyHandler, this, semanticModel, type, symbol, declarationBegin, afterKeyword);
+ }
+
+ CompletionData ICompletionDataFactory.CreateCastCompletionData (ICompletionDataKeyHandler keyHandler, ISymbol member, SyntaxNode nodeToCast, ITypeSymbol targetType)
+ {
+ return new CastCompletionData (keyHandler, this, semanticModel, member, nodeToCast, targetType);
+ }
+
+ CompletionCategory ICompletionDataFactory.CreateCompletionDataCategory (ISymbol forSymbol)
+ {
+ return new RoslynCompletionCategory (forSymbol);
+ }
+
+ #endregion
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCompletionCategory.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCompletionCategory.cs
new file mode 100644
index 0000000000..88353106fc
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCompletionCategory.cs
@@ -0,0 +1,63 @@
+//
+// RoslynCompletionCategory.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide.CodeCompletion;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp;
+using System.Linq;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace MonoDevelop.CSharp.Completion
+{
+ class RoslynCompletionCategory : CompletionCategory
+ {
+ readonly ISymbol symbol;
+
+ public RoslynCompletionCategory (ISymbol symbol)
+ {
+ this.symbol = symbol;
+ this.DisplayText = Ambience.EscapeText (symbol.ToDisplayString (MonoDevelop.Ide.TypeSystem.Ambience.NameFormat));
+ this.Icon = MonoDevelop.Ide.TypeSystem.Stock.GetStockIcon (symbol);
+ }
+
+ public override int CompareTo (CompletionCategory other)
+ {
+ if (other == null)
+ return 1;
+ var t1 = symbol as INamedTypeSymbol;
+ var t2 = ((RoslynCompletionCategory)other).symbol as INamedTypeSymbol;
+ if (t1 != null && t2 != null) {
+ if (t1.AllInterfaces.Contains (t2) || t1.GetBaseTypes().Contains (t2))
+ return -1;
+ if (t2.AllInterfaces.Contains (t1) || t2.GetBaseTypes().Contains (t1))
+ return 1;
+ }
+
+ return this.DisplayText.CompareTo (other.DisplayText);
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCompletionData.cs
new file mode 100644
index 0000000000..719c867cf6
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynCompletionData.cs
@@ -0,0 +1,118 @@
+//
+// RoslynCompletionData.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Linq;
+using MonoDevelop.Ide.CodeCompletion;
+using Microsoft.CodeAnalysis;
+using GLib;
+using System.Collections.Generic;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide.Editor.Extension;
+using Xwt;
+using MonoDevelop.Ide;
+
+namespace MonoDevelop.CSharp.Completion
+{
+ class RoslynCompletionData : ISymbolCompletionData
+ {
+
+ public RoslynCompletionData (ICompletionDataKeyHandler keyHandler)
+ {
+ this.KeyHandler = keyHandler;
+ }
+
+ public RoslynCompletionData (ICompletionDataKeyHandler keyHandler, string text) : base (text)
+ {
+ this.KeyHandler = keyHandler;
+ }
+
+ public RoslynCompletionData (ICompletionDataKeyHandler keyHandler, string text, IconId icon) : base (text, icon)
+ {
+ this.KeyHandler = keyHandler;
+ }
+
+ public RoslynCompletionData (ICompletionDataKeyHandler keyHandler, string text, IconId icon, string description) : base (text, icon, description)
+ {
+ this.KeyHandler = keyHandler;
+ }
+
+ public RoslynCompletionData (ICompletionDataKeyHandler keyHandler, string displayText, IconId icon, string description, string completionText) : base (displayText, icon, description, completionText)
+ {
+ this.KeyHandler = keyHandler;
+ }
+
+ internal static string SafeMinimalDisplayString (ISymbol symbol, SemanticModel semanticModel, int position)
+ {
+ return SafeMinimalDisplayString (symbol, semanticModel, position, Ambience.LabelFormat);
+ }
+
+ internal static string SafeMinimalDisplayString (ISymbol symbol, SemanticModel semanticModel, int position, SymbolDisplayFormat format)
+ {
+ try {
+ return symbol.ToMinimalDisplayString (semanticModel, position, format);
+ } catch (ArgumentOutOfRangeException) {
+ try {
+ return symbol.ToMinimalDisplayString (semanticModel, semanticModel.SyntaxTree.Length / 2, format);
+ } catch (ArgumentOutOfRangeException) {
+ return symbol.Name;
+ }
+ }
+ }
+
+
+// class OverloadSorter : IComparer<ICompletionData>
+// {
+// public OverloadSorter ()
+// {
+// }
+//
+// public int Compare (ICompletionData x, ICompletionData y)
+// {
+// var mx = ((RoslynCompletionData)x).Entity as IMember;
+// var my = ((RoslynCompletionData)y).Entity as IMember;
+// int result;
+//
+// if (mx is ITypeDefinition && my is ITypeDefinition) {
+// result = ((((ITypeDefinition)mx).TypeParameters.Count).CompareTo (((ITypeDefinition)my).TypeParameters.Count));
+// if (result != 0)
+// return result;
+// }
+//
+// if (mx is IMethod && my is IMethod) {
+// return MethodParameterDataProvider.MethodComparer ((IMethod)mx, (IMethod)my);
+// }
+// string sx = mx.ReflectionName;// ambience.GetString (mx, flags);
+// string sy = my.ReflectionName;// ambience.GetString (my, flags);
+// result = sx.Length.CompareTo (sy.Length);
+// return result == 0 ? string.Compare (sx, sy) : result;
+// }
+// }
+
+ }
+
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynParameterHintingFactory.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynParameterHintingFactory.cs
new file mode 100644
index 0000000000..49919a4794
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynParameterHintingFactory.cs
@@ -0,0 +1,306 @@
+//
+// RoslynParameterHintingFactory.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using ICSharpCode.NRefactory6.CSharp.Completion;
+using Microsoft.CodeAnalysis;
+using System.Collections.Immutable;
+using ICSharpCode.NRefactory6.CSharp;
+using System.Linq;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.TypeSystem;
+using System.Text.RegularExpressions;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.CSharp.Completion
+{
+ class RoslynParameterHintingFactory : IParameterHintingDataFactory
+ {
+ #region IParameterHintingDataFactory implementation
+
+ IParameterHintingData IParameterHintingDataFactory.CreateConstructorProvider (Microsoft.CodeAnalysis.IMethodSymbol constructor)
+ {
+ return new ParameterHintingData (constructor);
+ }
+
+ IParameterHintingData IParameterHintingDataFactory.CreateMethodDataProvider (Microsoft.CodeAnalysis.IMethodSymbol method)
+ {
+ return new ParameterHintingData (method);
+ }
+
+ IParameterHintingData IParameterHintingDataFactory.CreateDelegateDataProvider (Microsoft.CodeAnalysis.ITypeSymbol delegateType)
+ {
+ return new DelegateParameterHintingData (delegateType);
+ }
+
+ IParameterHintingData IParameterHintingDataFactory.CreateIndexerParameterDataProvider (Microsoft.CodeAnalysis.IPropertySymbol indexer, Microsoft.CodeAnalysis.SyntaxNode resolvedNode)
+ {
+ return new ParameterHintingData (indexer);
+ }
+
+ IParameterHintingData IParameterHintingDataFactory.CreateTypeParameterDataProvider (Microsoft.CodeAnalysis.INamedTypeSymbol type)
+ {
+ return new TypeParameterHintingData (type);
+ }
+
+ IParameterHintingData IParameterHintingDataFactory.CreateTypeParameterDataProvider (Microsoft.CodeAnalysis.IMethodSymbol method)
+ {
+ return new TypeParameterHintingData (method);
+ }
+
+ IParameterHintingData IParameterHintingDataFactory.CreateArrayDataProvider (Microsoft.CodeAnalysis.IArrayTypeSymbol arrayType)
+ {
+ return new ArrayParameterHintingData (arrayType);
+ }
+
+ #endregion
+
+ class ParameterHintingData : MonoDevelop.Ide.CodeCompletion.ParameterHintingData, IParameterHintingData
+ {
+ public ParameterHintingData (IMethodSymbol symbol) : base (symbol)
+ {
+ }
+
+ public ParameterHintingData (IPropertySymbol symbol) : base (symbol)
+ {
+ }
+ public override Task<TooltipInformation> CreateTooltipInformation (MonoDevelop.Ide.Editor.TextEditor editor, MonoDevelop.Ide.Editor.DocumentContext ctx, int currentParameter, bool smartWrap, CancellationToken cancelToken)
+ {
+ return CreateTooltipInformation (editor, ctx, Symbol, currentParameter, smartWrap, cancelToken);
+ }
+
+ internal static Task<TooltipInformation> CreateTooltipInformation (MonoDevelop.Ide.Editor.TextEditor editor, MonoDevelop.Ide.Editor.DocumentContext ctx, ISymbol sym, int currentParameter, bool smartWrap, CancellationToken cancelToken)
+ {
+ var tooltipInfo = new TooltipInformation ();
+ var sig = new SignatureMarkupCreator (ctx, editor != null ? editor.CaretOffset : 0);
+ sig.HighlightParameter = currentParameter;
+ sig.BreakLineAfterReturnType = smartWrap;
+
+ return Task.Run (() => {
+ if (cancelToken.IsCancellationRequested)
+ return null;
+ try {
+ tooltipInfo.SignatureMarkup = sig.GetMarkup (sym);
+ } catch (Exception e) {
+ LoggingService.LogError ("Got exception while creating markup for :" + sym, e);
+ return new TooltipInformation ();
+ }
+ tooltipInfo.SummaryMarkup = Ambience.GetSummaryMarkup (sym) ?? "";
+
+ if (cancelToken.IsCancellationRequested)
+ return null;
+
+ if (sym is IMethodSymbol) {
+ var method = (IMethodSymbol)sym;
+ if (method.IsExtensionMethod && method.ReducedFrom != null && method.ReducedFrom.ContainingType != null) {
+ tooltipInfo.AddCategory (GettextCatalog.GetString ("Extension Method from"), method.ReducedFrom.ContainingType.Name);
+ }
+ }
+ int paramIndex = currentParameter;
+
+ // if (Symbol is IMethodSymbol && ((IMethodSymbol)Symbol).IsExtensionMethod)
+ // paramIndex++;
+ var list = GetParameterList (sym);
+ paramIndex = Math.Min (list.Length - 1, paramIndex);
+
+ var curParameter = paramIndex >= 0 && paramIndex < list.Length ? list [paramIndex] : null;
+ if (curParameter != null) {
+
+ string docText = Ambience.GetDocumentation (sym);
+ if (!string.IsNullOrEmpty (docText)) {
+ string text = docText;
+ Regex paramRegex = new Regex ("(\\<param\\s+name\\s*=\\s*\"" + curParameter.Name + "\"\\s*\\>.*?\\</param\\>)", RegexOptions.Compiled);
+ Match match = paramRegex.Match (docText);
+
+ if (match.Success) {
+ text = Ambience.GetDocumentationMarkup (sym, match.Groups [1].Value);
+ if (!string.IsNullOrWhiteSpace (text))
+ tooltipInfo.AddCategory (GettextCatalog.GetString ("Parameter"), text);
+ }
+ }
+ if (curParameter.Type.TypeKind == TypeKind.Delegate)
+ tooltipInfo.AddCategory (GettextCatalog.GetString ("Delegate Info"), sig.GetDelegateInfo (curParameter.Type));
+ }
+ return tooltipInfo;
+ });
+ }
+
+ static ImmutableArray<IParameterSymbol> GetParameterList (ISymbol data)
+ {
+ var ms = data as IMethodSymbol;
+ if (ms != null)
+ return ms.Parameters;
+
+ var ps = data as IPropertySymbol;
+ if (ps != null)
+ return ps.Parameters;
+
+ return ImmutableArray<IParameterSymbol>.Empty;
+ }
+
+ public override string GetParameterName (int currentParameter)
+ {
+ var list = GetParameterList (Symbol);
+ if (currentParameter < 0 || currentParameter >= list.Length)
+ throw new ArgumentOutOfRangeException ("currentParameter");
+ return list [currentParameter].Name;
+ }
+
+ public override int ParameterCount {
+ get {
+ return GetParameterList (Symbol).Length;
+ }
+ }
+
+ public override bool IsParameterListAllowed {
+ get {
+ var param = GetParameterList (Symbol).LastOrDefault ();
+ return param != null && param.IsParams;
+ }
+ }
+ }
+
+ class DelegateParameterHintingData : MonoDevelop.Ide.CodeCompletion.ParameterHintingData, IParameterHintingData
+ {
+ readonly IMethodSymbol invocationMethod;
+
+ public DelegateParameterHintingData (ITypeSymbol symbol) : base (symbol)
+ {
+ this.invocationMethod = symbol.GetDelegateInvokeMethod ();
+ }
+
+ public override string GetParameterName (int currentParameter)
+ {
+ var list = invocationMethod.Parameters;
+ if (currentParameter < 0 || currentParameter >= list.Length)
+ throw new ArgumentOutOfRangeException ("currentParameter");
+ return list [currentParameter].Name;
+ }
+
+ public override int ParameterCount {
+ get {
+ return invocationMethod.Parameters.Length;
+ }
+ }
+
+ public override bool IsParameterListAllowed {
+ get {
+ var param = invocationMethod.Parameters.LastOrDefault ();
+ return param != null && param.IsParams;
+ }
+ }
+
+ public override Task<TooltipInformation> CreateTooltipInformation (MonoDevelop.Ide.Editor.TextEditor editor, MonoDevelop.Ide.Editor.DocumentContext ctx, int currentParameter, bool smartWrap, CancellationToken cancelToken)
+ {
+ return ParameterHintingData.CreateTooltipInformation (editor, ctx, invocationMethod, currentParameter, smartWrap, cancelToken);
+ }
+ }
+
+ class ArrayParameterHintingData : MonoDevelop.Ide.CodeCompletion.ParameterHintingData, IParameterHintingData
+ {
+ readonly IArrayTypeSymbol arrayType;
+
+ public ArrayParameterHintingData (IArrayTypeSymbol arrayType) : base (arrayType)
+ {
+ this.arrayType = arrayType;
+ }
+
+ public override string GetParameterName (int currentParameter)
+ {
+ return null;
+ }
+
+ public override int ParameterCount {
+ get {
+ return arrayType.Rank;
+ }
+ }
+
+ public override bool IsParameterListAllowed {
+ get {
+ return false;
+ }
+ }
+
+ public override Task<TooltipInformation> CreateTooltipInformation (MonoDevelop.Ide.Editor.TextEditor editor, MonoDevelop.Ide.Editor.DocumentContext ctx, int currentParameter, bool smartWrap, CancellationToken cancelToken)
+ {
+ var sig = new SignatureMarkupCreator (ctx, editor != null ? editor.CaretOffset : 0) {
+ HighlightParameter = currentParameter
+ };
+ return Task.FromResult (new TooltipInformation {
+ SignatureMarkup = sig.GetArrayIndexerMarkup (arrayType)
+ });
+ }
+
+ }
+
+ class TypeParameterHintingData : MonoDevelop.Ide.CodeCompletion.ParameterHintingData, IParameterHintingData
+ {
+ public TypeParameterHintingData (IMethodSymbol symbol) : base (symbol)
+ {
+ }
+
+ public TypeParameterHintingData (INamedTypeSymbol symbol) : base (symbol)
+ {
+ }
+
+ static ImmutableArray<ITypeParameterSymbol> GetTypeParameterList (IParameterHintingData data)
+ {
+ var ms = data.Symbol as IMethodSymbol;
+ if (ms != null)
+ return ms.TypeParameters;
+
+ var ps = data.Symbol as INamedTypeSymbol;
+ if (ps != null)
+ return ps.TypeParameters;
+
+ return ImmutableArray<ITypeParameterSymbol>.Empty;
+ }
+
+ public override string GetParameterName (int currentParameter)
+ {
+ var list = GetTypeParameterList (this);
+ if (currentParameter < 0 || currentParameter >= list.Length)
+ throw new ArgumentOutOfRangeException ("currentParameter");
+ return list [currentParameter].Name;
+ }
+
+ public override int ParameterCount {
+ get {
+ return GetTypeParameterList (this).Length;
+ }
+ }
+
+ public override bool IsParameterListAllowed {
+ get {
+ return false;
+ }
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynSymbolCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynSymbolCompletionData.cs
new file mode 100644
index 0000000000..6b0520948c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/RoslynSymbolCompletionData.cs
@@ -0,0 +1,512 @@
+//
+// CSharpCompletionTextEditorExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2011 Xamarin <http://xamarin.com>
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Linq;
+using MonoDevelop.Ide.CodeCompletion;
+using Microsoft.CodeAnalysis;
+using GLib;
+using System.Collections.Generic;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide.Editor.Extension;
+using Xwt;
+using MonoDevelop.Ide;
+using System.Threading.Tasks;
+using System.Threading;
+using MonoDevelop.Ide.Editor;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace MonoDevelop.CSharp.Completion
+{
+ class RoslynSymbolCompletionData : RoslynCompletionData
+ {
+ public override string DisplayText {
+ get {
+ return text ?? Symbol.Name;
+ }
+ set {
+ text = value;
+ }
+ }
+
+ public override string CompletionText {
+ get {
+ return text ?? Symbol.Name;
+ }
+ set {
+ throw new NotSupportedException ();
+ }
+ }
+
+ public override MonoDevelop.Core.IconId Icon {
+ get {
+ return MonoDevelop.Ide.TypeSystem.Stock.GetStockIcon (Symbol);
+ }
+ set {
+ throw new NotSupportedException ();
+ }
+ }
+
+ public bool IsDelegateExpected { get; set; }
+
+
+ string text;
+ protected readonly RoslynCodeCompletionFactory factory;
+
+ protected CSharpCompletionTextEditorExtension ext { get { return factory?.Ext; } }
+
+ public RoslynSymbolCompletionData (ICompletionDataKeyHandler keyHandler, RoslynCodeCompletionFactory factory, ISymbol symbol, string text = null) : base (keyHandler)
+ {
+ this.factory = factory;
+ this.text = text;
+ Symbol = symbol;
+ if (IsObsolete (Symbol))
+ DisplayFlags |= DisplayFlags.Obsolete;
+ rightSideDescription = new Lazy<string> (delegate {
+ var returnType = symbol.GetReturnType ();
+ if (returnType == null || factory == null)
+ return null;
+ try {
+ return "<span font='Sans 10'>" + GLib.Markup.EscapeText (SafeMinimalDisplayString (returnType, factory.SemanticModel, ext.Editor.CaretOffset)) + "</span>";
+ } catch (Exception e) {
+ LoggingService.LogError ("Format error.", e);
+ }
+ return null;
+ });
+ }
+
+ static readonly SymbolDisplayFormat nameOnlyFormat =
+ new SymbolDisplayFormat(
+ globalNamespaceStyle: SymbolDisplayGlobalNamespaceStyle.Omitted,
+ typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameOnly,
+ propertyStyle: SymbolDisplayPropertyStyle.NameOnly,
+ genericsOptions: SymbolDisplayGenericsOptions.None,
+ memberOptions: SymbolDisplayMemberOptions.None,
+ parameterOptions:
+ SymbolDisplayParameterOptions.None,
+ miscellaneousOptions:
+ SymbolDisplayMiscellaneousOptions.EscapeKeywordIdentifiers |
+ SymbolDisplayMiscellaneousOptions.UseSpecialTypes);
+
+ protected virtual string GetInsertionText ()
+ {
+ if (text != null)
+ return text;
+ return Symbol.ToDisplayString (nameOnlyFormat);
+ }
+
+ Lazy<string> rightSideDescription;
+ public override string GetRightSideDescription (bool isSelected)
+ {
+ return rightSideDescription.Value;
+ }
+
+
+ public override Task<TooltipInformation> CreateTooltipInformation (bool smartWrap, CancellationToken ctoken)
+ {
+ return CreateTooltipInformation (ctoken, ext.Editor, ext.DocumentContext, Symbol, smartWrap, model: factory.SemanticModel);
+ }
+
+ public static Task<TooltipInformation> CreateTooltipInformation (CancellationToken ctoken, MonoDevelop.Ide.Editor.TextEditor editor, MonoDevelop.Ide.Editor.DocumentContext ctx, ISymbol entity, bool smartWrap, bool createFooter = false, SemanticModel model = null)
+ {
+ var tooltipInfo = new TooltipInformation ();
+// if (resolver == null)
+// resolver = file != null ? file.GetResolver (compilation, textEditorData.Caret.Location) : new CSharpResolver (compilation);
+ var sig = new SignatureMarkupCreator (ctx, editor != null ? editor.CaretOffset : 0);
+ sig.SemanticModel = model;
+ sig.BreakLineAfterReturnType = smartWrap;
+
+ return Task.Run (() => {
+ if (ctoken.IsCancellationRequested)
+ return null;
+ try {
+ tooltipInfo.SignatureMarkup = sig.GetMarkup (entity);
+ } catch (Exception e) {
+ LoggingService.LogError ("Got exception while creating markup for :" + entity, e);
+ return new TooltipInformation ();
+ }
+
+ if (ctoken.IsCancellationRequested)
+ return null;
+
+ tooltipInfo.SummaryMarkup = Ambience.GetSummaryMarkup (entity) ?? "";
+
+ // if (entity is IMember) {
+ // var evt = (IMember)entity;
+ // if (evt.ReturnType.Kind == TypeKind.Delegate) {
+ // tooltipInfo.AddCategory (GettextCatalog.GetString ("Delegate Info"), sig.GetDelegateInfo (evt.ReturnType));
+ // }
+ // }
+ if (entity is IMethodSymbol) {
+ var method = (IMethodSymbol)entity;
+ if (method.IsExtensionMethod) {
+ tooltipInfo.AddCategory (GettextCatalog.GetString ("Extension Method from"), method.ContainingType.Name);
+ }
+ }
+ if (createFooter) {
+ tooltipInfo.FooterMarkup = sig.CreateFooter (entity);
+ }
+ return tooltipInfo;
+ });
+ }
+
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, MonoDevelop.Ide.Editor.Extension.KeyDescriptor descriptor)
+ {
+ string partialWord = GetCurrentWord (window, descriptor);
+ int skipChars = 0;
+ bool runParameterCompletionCommand = false;
+ bool runCompletionCompletionCommand = false;
+ var method = Symbol as IMethodSymbol;
+
+ bool addParens = IdeApp.Preferences.AddParenthesesAfterCompletion;
+ bool addOpeningOnly = IdeApp.Preferences.AddOpeningOnly;
+ var Editor = ext.Editor;
+ var Policy = ext.FormattingPolicy;
+ string insertionText = this.GetInsertionText();
+
+ if (addParens && !IsDelegateExpected && method != null && !HasNonMethodMembersWithSameName (window, Symbol) && !IsBracketAlreadyInserted (ext, method)) {
+ var line = Editor.GetLine (Editor.CaretLine);
+ //var start = window.CodeCompletionContext.TriggerOffset + partialWord.Length + 2;
+ //var end = line.Offset + line.Length;
+ //string textToEnd = start < end ? Editor.GetTextBetween (start, end) : "";
+ bool addSpace = Policy.SpaceAfterMethodCallName && MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.OnTheFlyFormatting;
+
+ int exprStart = window.CodeCompletionContext.TriggerOffset - 1;
+ while (exprStart > line.Offset) {
+ char ch = Editor.GetCharAt (exprStart);
+ if (ch != '.' && ch != '_' && !char.IsLetterOrDigit (ch))
+ break;
+ exprStart--;
+ }
+ bool insertSemicolon = InsertSemicolon(ext, exprStart);
+ if (Symbol is IMethodSymbol && ((IMethodSymbol)Symbol).MethodKind == MethodKind.Constructor)
+ insertSemicolon = false;
+ //int pos;
+
+ var keys = new [] { SpecialKey.Return, SpecialKey.Tab, SpecialKey.Space };
+ if (keys.Contains (descriptor.SpecialKey) || descriptor.KeyChar == '.') {
+ if (HasAnyOverloadWithParameters (method)) {
+ if (addOpeningOnly) {
+ insertionText += RequireGenerics (method) ? "<|" : (addSpace ? " (|" : "(|");
+ skipChars = 0;
+ } else {
+ if (descriptor.KeyChar == '.') {
+ if (RequireGenerics (method)) {
+ insertionText += addSpace ? "<> ()" : "<>()";
+ } else {
+ insertionText += addSpace ? " ()" : "()";
+ }
+ skipChars = 0;
+ } else {
+ if (insertSemicolon) {
+ if (RequireGenerics (method)) {
+ insertionText += addSpace ? "<|> ();" : "<|>();";
+ skipChars = addSpace ? 5 : 4;
+ } else {
+ insertionText += addSpace ? " (|);" : "(|);";
+ skipChars = 2;
+ }
+ } else {
+ if (RequireGenerics (method)) {
+ insertionText += addSpace ? "<|> ()" : "<|>()";
+ skipChars = addSpace ? 4 : 3;
+ } else {
+ insertionText += addSpace ? " (|)" : "(|)";
+ skipChars = 1;
+ }
+ }
+ }
+ }
+ runParameterCompletionCommand = true;
+ } else {
+ if (addOpeningOnly) {
+ insertionText += RequireGenerics (method) ? "<|" : (addSpace ? " (|" : "(|");
+ skipChars = 0;
+ } else {
+ if (descriptor.KeyChar == '.') {
+ if (RequireGenerics (method)) {
+ insertionText += addSpace ? "<> ()" : "<>()";
+ } else {
+ insertionText += addSpace ? " ()" : "()";
+ }
+ skipChars = 0;
+ } else {
+ if (insertSemicolon) {
+ if (RequireGenerics (method)) {
+ insertionText += addSpace ? "<|> ();" : "<|>();";
+ } else {
+ insertionText += addSpace ? " ();|" : "();|";
+ }
+
+ } else {
+ if (RequireGenerics (method)) {
+ insertionText += addSpace ? "<|> ()" : "<|>()";
+ } else {
+ insertionText += addSpace ? " ()|" : "()|";
+ }
+
+ }
+ }
+ }
+ }
+ }
+ if (descriptor.KeyChar == ';') {
+ insertionText += addSpace ? " ()" : "()";
+
+ }
+ ka |= KeyActions.Ignore;
+ }
+ if ((DisplayFlags & DisplayFlags.NamedArgument) == DisplayFlags.NamedArgument &&
+ IdeApp.Preferences.AddParenthesesAfterCompletion &&
+ (descriptor.SpecialKey == SpecialKey.Tab ||
+ descriptor.SpecialKey == SpecialKey.Return ||
+ descriptor.SpecialKey == SpecialKey.Space)) {
+ if (true/*Policy.AroundAssignmentParentheses */)
+ insertionText += " ";
+ insertionText += "=";
+ if (/*Policy.AroundAssignmentParentheses && */descriptor.SpecialKey != SpecialKey.Space)
+ insertionText += " ";
+ runCompletionCompletionCommand = true;
+ }
+ window.CompletionWidget.SetCompletionText (window.CodeCompletionContext, partialWord, insertionText);
+ int offset = Editor.CaretOffset;
+ for (int i = skipChars - 1; i --> 0;) {
+ Editor.StartSession (new SkipCharSession (Editor.GetCharAt (offset)));
+ offset++;
+ }
+
+ if (runParameterCompletionCommand && IdeApp.Workbench != null) {
+ Application.Invoke (delegate {
+ ext.RunParameterCompletionCommand ();
+ });
+ }
+
+ if (runCompletionCompletionCommand && IdeApp.Workbench != null) {
+ Application.Invoke (delegate {
+ ext.RunCompletionCommand ();
+ });
+ }
+ }
+
+ static bool IsBracketAlreadyInserted (CSharpCompletionTextEditorExtension ext, IMethodSymbol method)
+ {
+ var Editor = ext.Editor;
+ int offset = Editor.CaretOffset;
+ while (offset < Editor.Length) {
+ char ch = Editor.GetCharAt (offset);
+ if (!char.IsLetterOrDigit (ch))
+ break;
+ offset++;
+ }
+ while (offset < Editor.Length) {
+ char ch = Editor.GetCharAt (offset);
+ if (!char.IsWhiteSpace (ch))
+ return ch == '(' || ch == '<' && RequireGenerics (method);
+ offset++;
+ }
+ return false;
+ }
+
+
+
+ internal static bool InsertSemicolon (CSharpCompletionTextEditorExtension ext, int exprStart)
+ {
+ var Editor = ext.Editor;
+ int offset = exprStart;
+ while (offset > 0) {
+ char ch = Editor.GetCharAt (offset);
+ if (!char.IsWhiteSpace (ch)) {
+ if (ch != '{' && ch != '}' && ch != ';')
+ return false;
+ break;
+ }
+ offset--;
+ }
+
+ offset = Editor.CaretOffset;
+ while (offset < Editor.Length) {
+ char ch = Editor.GetCharAt (offset);
+ if (!char.IsLetterOrDigit (ch))
+ break;
+ offset++;
+ }
+ while (offset < Editor.Length) {
+ char ch = Editor.GetCharAt (offset);
+ if (!char.IsWhiteSpace (ch))
+ return char.IsLetter (ch) || ch == '}';
+ offset++;
+ }
+ return true;
+ }
+
+ internal static bool HasAnyOverloadWithParameters (IMethodSymbol method)
+ {
+ if (method.MethodKind == MethodKind.Constructor)
+ return method.ContainingType.GetMembers()
+ .OfType<IMethodSymbol>()
+ .Where(m => m.MethodKind == MethodKind.Constructor)
+ .Any (m => m.Parameters.Length > 0);
+ return method.ContainingType
+ .GetMembers()
+ .OfType<IMethodSymbol>()
+ .Any (m => m.Name == method.Name && m.Parameters.Length > 0);
+ }
+
+ bool HasNonMethodMembersWithSameName (CompletionListWindow window, ISymbol member)
+ {
+ var method = member as IMethodSymbol;
+ if (method == null)
+ return true;
+ if (method == null || method.MethodKind == MethodKind.Constructor)
+ return false;
+
+ ITypeSymbol type = null;
+ var model = ext.DocumentContext.AnalysisDocument?.GetSemanticModelAsync ().WaitAndGetResult(default(CancellationToken));
+ if (model == null)
+ return false;
+ var token = model.SyntaxTree.FindTokenOnLeftOfPosition (window.StartOffset, default (CancellationToken));
+ var node = token.Parent as MemberAccessExpressionSyntax;
+ if (node != null) {
+ type = model.GetTypeInfo (node.Expression, default (CancellationToken)).Type;
+ }
+
+ if (type == null)
+ type = method.ReceiverType ?? method.ContainingType;
+ foreach (var m in type.GetMembers ().Where (m => m.Kind != SymbolKind.Method)) {
+ if (m.Name == member.Name)
+ return true;
+ }
+ return false;
+ }
+
+ static bool RequireGenerics (IMethodSymbol method)
+ {
+ System.Collections.Immutable.ImmutableArray<ITypeSymbol> typeArgs;
+ if (method.MethodKind == MethodKind.Constructor) {
+ typeArgs = method.ContainingType.TypeArguments;
+ } else {
+ typeArgs = method.TypeArguments;
+ }
+
+ if (!typeArgs.Any (ta => ta.TypeKind == TypeKind.TypeParameter))
+ return false;
+ var testMethod = method.ReducedFrom ?? method;
+ return typeArgs.Any (t => !testMethod.Parameters.Any (p => ContainsType(p.Type, t)));
+ }
+
+ static bool ContainsType (ITypeSymbol testType, ITypeSymbol searchType)
+ {
+ if (testType == null)
+ return false;
+ if (testType == searchType)
+ return true;
+ var namedTypeSymbol = testType as INamedTypeSymbol;
+ if (namedTypeSymbol != null) {
+ foreach (var arg in namedTypeSymbol.TypeParameters)
+ if (ContainsType (arg, searchType))
+ return true;
+ }
+ return false;
+ }
+
+ public override int CompareTo (object obj)
+ {
+ var anonymousMethodCompletionData = obj as AnonymousMethodCompletionData;
+ if (anonymousMethodCompletionData != null)
+ return -1;
+ var objectCreationData = obj as ObjectCreationCompletionData;
+ if (objectCreationData != null)
+ return -1;
+ int ret = base.CompareTo (obj);
+ if (ret == 0) {
+ var sym = Symbol;
+ var other = obj as RoslynSymbolCompletionData;
+ if (other == null)
+ return 0;
+ if (sym.Kind == other.Symbol.Kind) {
+ var m1 = sym as IMethodSymbol;
+ var m2 = other.Symbol as IMethodSymbol;
+ if (m1 != null)
+ return m1.Parameters.Length.CompareTo (m2.Parameters.Length);
+ var p1 = sym as IPropertySymbol;
+ var p2 = other.Symbol as IPropertySymbol;
+ if (p1 != null)
+ return p1.Parameters.Length.CompareTo (p2.Parameters.Length);
+ }
+ }
+ return ret;
+ }
+
+ static bool IsObsolete (ISymbol symbol)
+ {
+ return symbol.GetAttributes ().Any (attr => attr.AttributeClass.Name == "ObsoleteAttribute" && attr.AttributeClass.ContainingNamespace.GetFullName () == "System");
+ }
+
+
+ public override bool IsOverload (CompletionData other)
+ {
+ var os = other as RoslynSymbolCompletionData;
+ if (os != null) {
+ return Symbol.Kind == os.Symbol.Kind &&
+ Symbol.Name == os.Symbol.Name;
+ }
+
+ return false;
+ }
+
+ // public static TooltipInformation CreateTooltipInformation (ICompilation compilation, CSharpUnresolvedFile file, TextEditorData textEditorData, MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy formattingPolicy, IType type, bool smartWrap, bool createFooter = false)
+ // {
+ // var tooltipInfo = new TooltipInformation ();
+ // var resolver = file != null ? file.GetResolver (compilation, textEditorData.Caret.Location) : new CSharpResolver (compilation);
+ // var sig = new SignatureMarkupCreator (resolver, formattingPolicy.CreateOptions ());
+ // sig.BreakLineAfterReturnType = smartWrap;
+ // try {
+ // tooltipInfo.SignatureMarkup = sig.GetMarkup (type.IsParameterized ? type.GetDefinition () : type);
+ // } catch (Exception e) {
+ // LoggingService.LogError ("Got exception while creating markup for :" + type, e);
+ // return new TooltipInformation ();
+ // }
+ // if (type.IsParameterized) {
+ // var typeInfo = new StringBuilder ();
+ // for (int i = 0; i < type.TypeParameterCount; i++) {
+ // typeInfo.AppendLine (type.GetDefinition ().TypeParameters [i].Name + " is " + sig.GetTypeReferenceString (type.TypeArguments [i]));
+ // }
+ // tooltipInfo.AddCategory ("Type Parameters", typeInfo.ToString ());
+ // }
+ //
+ // var def = type.GetDefinition ();
+ // if (def != null) {
+ // if (createFooter)
+ // tooltipInfo.FooterMarkup = sig.CreateFooter (def);
+ // tooltipInfo.SummaryMarkup = AmbienceService.GetSummaryMarkup (def) ?? "";
+ // }
+ // return tooltipInfo;
+ // }
+ }
+
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/TypeParameterDataProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/TypeParameterDataProvider.cs
deleted file mode 100644
index 0e5f2ce907..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/TypeParameterDataProvider.cs
+++ /dev/null
@@ -1,163 +0,0 @@
-//
-// TemplateParameterDataProvider.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Xml;
-
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.CodeCompletion;
-using MonoDevelop.CSharp.Formatting;
-using MonoDevelop.CSharp.Parser;
-using System.Text.RegularExpressions;
-using ICSharpCode.NRefactory.CSharp;
-using MonoDevelop.CSharp.Resolver;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.Completion;
-
-namespace MonoDevelop.CSharp.Completion
-{
- class TypeParameterDataProvider: IParameterDataProvider
- {
- int startOffset;
- //CSharpCompletionTextEditorExtension ext;
-
- List<IType> types;
- List<IMethod> methods;
- CSharpAmbience ambience = new CSharpAmbience ();
-
- public int StartOffset {
- get {
- return startOffset;
- }
- }
-
- public TypeParameterDataProvider (int startOffset, CSharpCompletionTextEditorExtension ext, IEnumerable<IType> types)
- {
- this.startOffset = startOffset;
- // this.ext = ext;
- this.types = new List<IType> (types);
- }
-
- public TypeParameterDataProvider (int startOffset, CSharpCompletionTextEditorExtension ext, IEnumerable<IMethod> methods)
- {
- this.startOffset = startOffset;
- // this.ext = ext;
- this.methods = new List<IMethod> (methods);
- }
-
- static int TypeComparer (IType left, IType right)
- {
- return left.TypeParameterCount - right.TypeParameterCount;
- }
-
- #region IParameterDataProvider implementation
-
- protected virtual string GetPrefix (IMethod method)
- {
- var flags = OutputFlags.ClassBrowserEntries | OutputFlags.IncludeMarkup | OutputFlags.IncludeGenerics;
- return ambience.GetString (method.ReturnType, flags) + " ";
- }
-
- public string GetHeading (int overload, string[] parameterMarkup, int currentParameter)
- {
- var result = new StringBuilder ();
- result.Append ("<b>");
- if (methods != null) {
- result.Append (ambience.GetString (methods [overload], OutputFlags.UseFullName | OutputFlags.IncludeMarkup));
- } else {
- result.Append (ambience.GetString (types [overload], OutputFlags.UseFullName | OutputFlags.IncludeMarkup));
- }
- result.Append ("</b>");
- result.Append ("&lt;");
- int parameterCount = 0;
- foreach (string parameter in parameterMarkup) {
- if (parameterCount > 0)
- result.Append (", ");
- result.Append (parameter);
- parameterCount++;
- }
- result.Append ("&gt;");
-
- return result.ToString ();
- }
-
- public string GetDescription (int overload, int currentParameter)
- {
- return "";
- }
-
- public string GetParameterDescription (int overload, int paramIndex)
- {
- if (methods != null)
- return ambience.GetString (methods[overload].TypeParameters [paramIndex], OutputFlags.AssemblyBrowserDescription | OutputFlags.HideExtensionsParameter | OutputFlags.IncludeGenerics | OutputFlags.IncludeModifiers | OutputFlags.HighlightName);
-
- var type = types[overload];
-
- if (paramIndex < 0 || paramIndex >= type.TypeParameterCount)
- return "";
-
- return ambience.GetString (type.GetDefinition ().TypeParameters [paramIndex], OutputFlags.AssemblyBrowserDescription | OutputFlags.HideExtensionsParameter | OutputFlags.IncludeGenerics | OutputFlags.IncludeModifiers | OutputFlags.HighlightName);
- }
-
- public int GetParameterCount (int overload)
- {
- if (overload >= Count)
- return -1;
-
- if (methods != null)
- return methods[overload].TypeParameters.Count;
- var type = types[overload];
- return type != null ? type.TypeParameterCount : 0;
- }
-
- public string GetParameterName (int overload, int paramIndex)
- {
- // unused
- return "T";
- }
-
-
- public bool AllowParameterList (int overload)
- {
- return false;
- }
-
- public int Count {
- get {
- if (methods != null)
- return methods.Count;
- return types != null ? types.Count : 0;
- }
- }
- #endregion
- }
-}
-
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/VariableCompletionData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/VariableCompletionData.cs
deleted file mode 100644
index 34ae8a585a..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/VariableCompletionData.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// VariableCompletionData.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using MonoDevelop.Ide.CodeCompletion;
-using ICSharpCode.NRefactory.Completion;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Ide.TypeSystem;
-
-namespace MonoDevelop.CSharp.Completion
-{
- class VariableCompletionData : CompletionData, IVariableCompletionData
- {
- readonly CSharpCompletionTextEditorExtension ext;
-
- public IVariable Variable {
- get;
- private set;
- }
-
- public override TooltipInformation CreateTooltipInformation (bool smartWrap)
- {
- var tooltipInfo = new TooltipInformation ();
- var resolver = ext.CSharpUnresolvedFile.GetResolver (ext.Compilation, ext.Document.Editor.Caret.Location);
- var sig = new SignatureMarkupCreator (resolver, ext.FormattingPolicy.CreateOptions ());
- sig.BreakLineAfterReturnType = smartWrap;
- tooltipInfo.SignatureMarkup = sig.GetLocalVariableMarkup (Variable);
- return tooltipInfo;
- }
-
- public VariableCompletionData (CSharpCompletionTextEditorExtension ext, IVariable variable) : base (variable.Name, variable.GetStockIcon ())
- {
- this.ext = ext;
- this.Variable = variable;
- }
- }
-}
-
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/DiagnosticCustomTags.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/DiagnosticCustomTags.cs
new file mode 100644
index 0000000000..d05d91c55f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/DiagnosticCustomTags.cs
@@ -0,0 +1,35 @@
+//
+// DiagnosticCustomTags.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis;
+
+namespace MonoDevelop.CSharp.Diagnostics
+{
+ static class DiagnosticCustomTags
+ {
+ public static readonly string[] Unnecessary = { WellKnownDiagnosticTags.Unnecessary, WellKnownDiagnosticTags.Telemetry };
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/IDEDiagnosticIds.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/IDEDiagnosticIds.cs
new file mode 100644
index 0000000000..7d067e38d2
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/IDEDiagnosticIds.cs
@@ -0,0 +1,43 @@
+//
+// IDEDiagnosticIds.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.CSharp.Diagnostics
+{
+ static class IDEDiagnosticIds
+ {
+ public const string SimplifyNamesDiagnosticId = "IDE0001";
+ public const string SimplifyMemberAccessDiagnosticId = "IDE0002";
+ public const string SimplifyThisOrMeDiagnosticId = "IDE0003";
+ public const string RemoveUnnecessaryCastDiagnosticId = "IDE0004";
+ public const string RemoveUnnecessaryImportsDiagnosticId = "IDE0005";
+
+ public const string MonoTODODiagnosticDiagnosticId = "XS0001";
+
+
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/MonoNameConventionPolicy.xml b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/MonoNameConventionPolicy.xml
index 4643473284..4643473284 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/MonoNameConventionPolicy.xml
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/MonoNameConventionPolicy.xml
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionEditRuleDialog.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionEditRuleDialog.cs
new file mode 100644
index 0000000000..02fcc66359
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionEditRuleDialog.cs
@@ -0,0 +1,211 @@
+//
+// NamingConventionEditRuleDialog.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using Gtk;
+using System.Collections.Generic;
+using MonoDevelop.Core;
+using RefactoringEssentials.CSharp.Diagnostics;
+
+namespace MonoDevelop.CSharp.Diagnostics.InconsistentNaming
+{
+ partial class NameConventionEditRuleDialog : Gtk.Dialog
+ {
+ static readonly Dictionary<AffectedEntity, string> EntityName = new Dictionary<AffectedEntity, string> ();
+ static readonly Dictionary<Modifiers, string> AccessibilityName = new Dictionary<Modifiers, string> ();
+
+ static NameConventionEditRuleDialog ()
+ {
+ EntityName [AffectedEntity.Namespace] = GettextCatalog.GetString ("Namespaces");
+
+ EntityName [AffectedEntity.Class] = GettextCatalog.GetString ("Classes");
+ EntityName [AffectedEntity.Struct] = GettextCatalog.GetString ("Structs");
+ EntityName [AffectedEntity.Enum] = GettextCatalog.GetString ("Enums");
+ EntityName [AffectedEntity.Interface] = GettextCatalog.GetString ("Interfaces");
+ EntityName [AffectedEntity.Delegate] = GettextCatalog.GetString ("Delegates");
+
+ EntityName [AffectedEntity.CustomAttributes] = GettextCatalog.GetString ("Attributes");
+ EntityName [AffectedEntity.CustomEventArgs] = GettextCatalog.GetString ("Event Arguments");
+ EntityName [AffectedEntity.CustomExceptions] = GettextCatalog.GetString ("Exceptions");
+
+ EntityName [AffectedEntity.Property] = GettextCatalog.GetString ("Properties");
+ EntityName [AffectedEntity.AsyncMethod] = GettextCatalog.GetString ("Async methods");
+ EntityName [AffectedEntity.Method] = GettextCatalog.GetString ("Methods");
+ EntityName [AffectedEntity.Field] = GettextCatalog.GetString ("Fields");
+ EntityName [AffectedEntity.ConstantField] = GettextCatalog.GetString ("Constant fields");
+ EntityName [AffectedEntity.ReadonlyField] = GettextCatalog.GetString ("Readonly fields");
+ EntityName [AffectedEntity.Event] = GettextCatalog.GetString ("Events");
+ EntityName [AffectedEntity.EnumMember] = GettextCatalog.GetString ("Enum Members");
+
+ EntityName [AffectedEntity.Parameter] = GettextCatalog.GetString ("Parameters");
+ EntityName [AffectedEntity.TypeParameter] = GettextCatalog.GetString ("Type Parameters");
+
+ // Unit test special case
+ EntityName [AffectedEntity.TestType] = GettextCatalog.GetString ("Test Types");
+ EntityName [AffectedEntity.TestMethod] = GettextCatalog.GetString ("Test Methods");
+
+ // private entities
+ EntityName [AffectedEntity.LambdaParameter] = GettextCatalog.GetString ("Lambda Parameters");
+ EntityName [AffectedEntity.LocalVariable] = GettextCatalog.GetString ("Local Variables");
+ EntityName [AffectedEntity.LocalConstant] = GettextCatalog.GetString ("Local Constants");
+ EntityName [AffectedEntity.Label] = GettextCatalog.GetString ("Labels");
+
+ AccessibilityName [Modifiers.Public] = GettextCatalog.GetString ("Public");
+ AccessibilityName [Modifiers.Private] = GettextCatalog.GetString ("Private");
+ AccessibilityName [Modifiers.Internal] = GettextCatalog.GetString ("Internal");
+ AccessibilityName [Modifiers.Protected] = GettextCatalog.GetString ("Protected");
+ }
+
+ NameConventionRule rule;
+
+ ListStore entityStore = new ListStore (typeof(string), typeof(AffectedEntity), typeof(bool));
+ ListStore accessibiltyStore = new ListStore (typeof(string), typeof(Modifiers), typeof(bool));
+
+ public NameConventionEditRuleDialog (NameConventionRule rule)
+ {
+ if (rule == null)
+ throw new System.ArgumentNullException ("rule");
+ this.rule = rule;
+ this.Build ();
+
+ var ct1 = new CellRendererToggle ();
+ ct1.Toggled += delegate(object o, Gtk.ToggledArgs args) {
+ TreeIter iter;
+ if (!entityStore.GetIterFromString (out iter, args.Path))
+ return;
+ entityStore.SetValue (iter, 2, !(bool)entityStore.GetValue (iter, 2));
+ };
+ treeviewEntities.AppendColumn ("IsChecked", ct1, "active", 2);
+ treeviewEntities.AppendColumn ("Entity", new CellRendererText (), "text", 0);
+ treeviewEntities.Model = entityStore;
+
+ var ct2 = new CellRendererToggle ();
+ ct2.Toggled += delegate(object o, Gtk.ToggledArgs args) {
+ TreeIter iter;
+ if (!accessibiltyStore.GetIterFromString (out iter, args.Path))
+ return;
+ accessibiltyStore.SetValue (iter, 2, !(bool)accessibiltyStore.GetValue (iter, 2));
+ };
+ treeviewAccessibility.AppendColumn ("IsChecked", ct2, "active", 2);
+ treeviewAccessibility.AppendColumn ("Entity", new CellRendererText (), "text", 0);
+ treeviewAccessibility.Model = accessibiltyStore;
+ buttonOk.Clicked += (sender, e) => Apply ();
+
+ FillDialog ();
+ }
+
+ public void FillDialog ()
+ {
+ entryRuleName.Text = rule.Name ?? "";
+ if (rule.RequiredPrefixes != null)
+ entryPrefix.Text = rule.RequiredPrefixes.FirstOrDefault ();
+ if (rule.AllowedPrefixes != null)
+ entryPrefixAllowed.Text = string.Join (", ", rule.AllowedPrefixes);
+ if (rule.RequiredSuffixes != null)
+ entrySuffix.Text = rule.RequiredSuffixes.FirstOrDefault ();
+ styleComboBox.AppendText ("PascalCase");
+ styleComboBox.AppendText ("CamelCase");
+ styleComboBox.AppendText ("ALLUPPER");
+ styleComboBox.AppendText ("alllower");
+ styleComboBox.AppendText ("Firstupper");
+ styleComboBox.AppendText ("PascalCase_underscoreTolerant");
+ styleComboBox.AppendText ("PascalCase_UnderscoreTolerant");
+ styleComboBox.AppendText ("CamelCase_underscoreTolerant");
+ styleComboBox.AppendText ("CamelCase_UnderscoreTolerant");
+
+ styleComboBox.Active = (int)rule.NamingStyle - 1;
+
+ foreach (AffectedEntity ae in Enum.GetValues (typeof (AffectedEntity))) {
+ if (!EntityName.ContainsKey (ae))
+ continue;
+ entityStore.AppendValues (EntityName [ae], ae, rule.AffectedEntity.HasFlag (ae));
+ }
+
+ foreach (Modifiers mod in Enum.GetValues (typeof (Modifiers))) {
+ if (!AccessibilityName.ContainsKey (mod))
+ continue;
+ accessibiltyStore.AppendValues (AccessibilityName [mod], mod, rule.VisibilityMask.HasFlag (mod));
+ }
+
+ checkbuttonStatic.Active = rule.IncludeStaticEntities;
+ checkbuttonInstanceMembers.Active = rule.IncludeInstanceMembers;
+
+ }
+
+ public void Apply ()
+ {
+ rule.Name = entryRuleName.Text;
+ rule.NamingStyle = (NamingStyle)(1 + styleComboBox.Active);
+
+ var prefix = entryPrefix.Text.Trim ();
+ if (string.IsNullOrEmpty (prefix)) {
+ rule.RequiredPrefixes = null;
+ } else {
+ rule.RequiredPrefixes = new [] { prefix };
+ }
+
+ var allowedPrefix = entryPrefixAllowed.Text.Trim ();
+ if (string.IsNullOrEmpty (allowedPrefix)) {
+ rule.AllowedPrefixes = null;
+ } else {
+ rule.AllowedPrefixes = allowedPrefix.Split (',', ';').Select (s => s.Trim ()).ToArray ();
+ }
+
+ var suffix = entrySuffix.Text.Trim ();
+ if (string.IsNullOrEmpty (suffix)) {
+ rule.RequiredSuffixes = null;
+ } else {
+ rule.RequiredSuffixes = new [] { suffix };
+ }
+
+ var ae = AffectedEntity.None;
+ TreeIter iter;
+ if (entityStore.GetIterFirst (out iter)) {
+ do {
+ var entity = (AffectedEntity)entityStore.GetValue (iter, 1);
+ var include = (bool)entityStore.GetValue (iter, 2);
+ if (include)
+ ae |= entity;
+ } while (entityStore.IterNext (ref iter));
+ }
+ rule.AffectedEntity = ae;
+
+ var mod = Modifiers.None;
+ if (accessibiltyStore.GetIterFirst (out iter)) {
+ do {
+ var entity = (Modifiers)accessibiltyStore.GetValue (iter, 1);
+ var include = (bool)accessibiltyStore.GetValue (iter, 2);
+ if (include)
+ mod |= entity;
+ } while (accessibiltyStore.IterNext (ref iter));
+ }
+ rule.VisibilityMask = mod;
+ rule.IncludeStaticEntities = checkbuttonStatic.Active;
+ rule.IncludeInstanceMembers = checkbuttonInstanceMembers.Active;
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPanel.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPanel.cs
new file mode 100644
index 0000000000..b71b916792
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPanel.cs
@@ -0,0 +1,73 @@
+//
+// NamingConventionPanel.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin <http://xamarin.com>
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide.Gui.Dialogs;
+using MonoDevelop.Components;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Editor;
+
+namespace MonoDevelop.CSharp.Diagnostics.InconsistentNaming
+{
+ class NameConventionPanel : PolicyOptionsPanel<NameConventionPolicy>
+ {
+ NameConventionPanelWidget panel;
+
+ static NameConventionPanel ()
+ {
+ // ensure that custom text editor shemes are loaded.
+ TextEditorDisplayBinding.InitSourceEditor ();
+ }
+
+ protected override string PolicyTitleWithMnemonic {
+ get {
+ return GettextCatalog.GetString ("_Naming Style");
+ }
+ }
+
+ public override Control CreatePanelWidget ()
+ {
+ panel = new NameConventionPanelWidget ();
+ panel.PolicyChanged += delegate {
+ UpdateSelectedNamedPolicy ();
+ };
+ return panel;
+ }
+
+ protected override void LoadFrom (NameConventionPolicy policy)
+ {
+ panel.Policy = policy.Clone ();
+ }
+
+ protected override NameConventionPolicy GetPolicy ()
+ {
+ // return cloned policy
+ panel.ApplyChanges ();
+ return panel.Policy;
+ }
+ }
+
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPanelWidget.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPanelWidget.cs
new file mode 100644
index 0000000000..a5e8616ce9
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPanelWidget.cs
@@ -0,0 +1,156 @@
+//
+// NamingConventionPanelWidget.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Gtk;
+using MonoDevelop.Core;
+using MonoDevelop.Ide;
+using System.Collections.Generic;
+
+namespace MonoDevelop.CSharp.Diagnostics.InconsistentNaming
+{
+ [System.ComponentModel.ToolboxItem(true)]
+ partial class NameConventionPanelWidget : Gtk.Bin
+ {
+ TreeStore treeStore = new TreeStore (typeof(NameConventionRule));
+ NameConventionPolicy policy;
+
+ internal NameConventionPolicy Policy {
+ get {
+ return policy;
+ }
+ set {
+ policy = value;
+ FillRules (policy.Rules);
+ }
+ }
+
+ public NameConventionPanelWidget ()
+ {
+ Build ();
+ Show ();
+
+ var ct1 = new CellRendererText ();
+ var col1 = treeviewConventions.AppendColumn (GettextCatalog.GetString ("Rule"), ct1);
+ col1.Expand = true;
+ col1.SetCellDataFunc (ct1, delegate (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) {
+ var rule = (NameConventionRule)model.GetValue (iter, 0);
+ ct1.Text = rule.Name;
+ });
+
+
+ var ct2 = new CellRendererText ();
+ var col2 = treeviewConventions.AppendColumn (GettextCatalog.GetString ("Example"), ct2);
+ col2.Expand = true;
+ col2.SetCellDataFunc (ct2, delegate (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) {
+ var rule = (NameConventionRule)model.GetValue (iter, 0);
+ ct2.Text = rule.GetPreview ();
+ });
+
+ treeviewConventions.Model = treeStore;
+ treeviewConventions.Selection.Changed += HandleSelectionChanged;
+ treeviewConventions.RowActivated += (o, args) => EditSelectedEntry ();
+ buttonEdit.Clicked += (o, s) => EditSelectedEntry ();
+ buttonRemove.Clicked += (o, s) => RemoveSelectedEntry ();
+ buttonAdd.Clicked += (o, s) => AddEntry ();
+
+ HandleSelectionChanged (null, null);
+ }
+
+ void HandleSelectionChanged (object sender, EventArgs e)
+ {
+ TreeIter iter;
+ buttonEdit.Sensitive = treeviewConventions.Selection.GetSelected (out iter);
+ }
+
+ public void ApplyChanges ()
+ {
+ var rules = new List<NameConventionRule> ();
+ TreeIter iter;
+ if (treeStore.GetIterFirst (out iter)) {
+ do {
+ var rule = (NameConventionRule)treeStore.GetValue (iter, 0);
+ rules.Add (rule);
+ } while (treeStore.IterNext (ref iter));
+ }
+ policy.Rules = rules.ToArray ();
+ if (IdeApp.Workbench.ActiveDocument != null)
+ IdeApp.Workbench.ActiveDocument.UpdateParseDocument ();
+ }
+
+ void AddEntry ()
+ {
+ var newRule = new NameConventionRule ();
+ newRule.Name = "New Rule";
+ using (var diag = new NameConventionEditRuleDialog (newRule)) {
+ var result = MessageService.ShowCustomDialog (diag);
+ if (result == (int)ResponseType.Ok)
+ treeStore.AppendValues (newRule);
+ OnPolicyChanged (EventArgs.Empty);
+ }
+ }
+
+ void EditSelectedEntry ()
+ {
+ TreeIter iter;
+ if (!treeviewConventions.Selection.GetSelected (out iter))
+ return;
+ var rule = treeStore.GetValue (iter, 0) as NameConventionRule;
+ using (var diag = new NameConventionEditRuleDialog (rule)) {
+ int result = MessageService.ShowCustomDialog (diag);
+ treeviewConventions.QueueResize ();
+ if (result == (int)Gtk.ResponseType.Ok)
+ OnPolicyChanged (EventArgs.Empty);
+ }
+ }
+
+ void RemoveSelectedEntry ()
+ {
+ TreeIter iter;
+ if (!treeviewConventions.Selection.GetSelected (out iter))
+ return;
+ treeStore.Remove (ref iter);
+ OnPolicyChanged (EventArgs.Empty);
+ }
+
+ void FillRules (IEnumerable<NameConventionRule> rules)
+ {
+ treeStore.Clear ();
+ foreach (var rule in rules) {
+ treeStore.AppendValues (rule);
+ }
+ }
+
+ protected virtual void OnPolicyChanged (EventArgs e)
+ {
+ var handler = PolicyChanged;
+ if (handler != null)
+ handler (this, e);
+ }
+
+ public event EventHandler PolicyChanged;
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPolicy.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPolicy.cs
new file mode 100644
index 0000000000..bf2805536f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionPolicy.cs
@@ -0,0 +1,96 @@
+//
+// NamingConventions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using MonoDevelop.Projects.Policies;
+using MonoDevelop.Core.Serialization;
+using RefactoringEssentials.CSharp.Diagnostics;
+
+namespace MonoDevelop.CSharp.Diagnostics.InconsistentNaming
+{
+ [PolicyType ("Naming Conventions Policy")]
+ class NameConventionPolicy : IEquatable<NameConventionPolicy>
+ {
+ NameConventionRule[] rules = new NameConventionRule[0];
+
+ [ItemProperty]
+ public NameConventionRule[] Rules {
+ get { return rules; }
+ set { rules = value; }
+ }
+
+ public NameConventionPolicy Clone ()
+ {
+ var result = new NameConventionPolicy ();
+ result.rules = new List<NameConventionRule> (rules.Select (r => r.Clone ())).ToArray ();
+ return result;
+ }
+
+ public NameConventionPolicy ()
+ {
+ rules = new List<NameConventionRule> (DefaultRules.GetFdgRules ().Select (r => new NameConventionRule (r))).ToArray ();
+ }
+
+ class NamingConventionService : RefactoringEssentials.CSharp.Diagnostics.NamingConventionService
+ {
+ NameConventionPolicy policy;
+ NamingRule[] rules = null;
+ public override IEnumerable<RefactoringEssentials.CSharp.Diagnostics.NamingRule> Rules {
+ get {
+ if (rules == null) {
+ this.rules = policy.Rules.Select (r => r.GetNRefactoryRule ()).ToArray ();
+ }
+ return rules;
+ }
+ }
+
+ public NamingConventionService (NameConventionPolicy policy)
+ {
+ this.policy = policy;
+ }
+
+ }
+
+ public RefactoringEssentials.CSharp.Diagnostics.NamingConventionService CreateNRefactoryService ()
+ {
+ return new NamingConventionService (this);
+ }
+
+ #region IEquatable implementation
+ public bool Equals (NameConventionPolicy other)
+ {
+ if (Rules.Length != other.Rules.Length)
+ return false;
+ for (int i = 0; i < rules.Length; i++) {
+ if (!rules [i].Equals (other.Rules[i]))
+ return false;
+ }
+ return true;
+ }
+ #endregion
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionRule.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionRule.cs
new file mode 100644
index 0000000000..d9f24284bc
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/InconsistentNaming/NameConventionRule.cs
@@ -0,0 +1,587 @@
+//
+// NamingRule.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Text;
+using MonoDevelop.Projects.Policies;
+using MonoDevelop.Core.Serialization;
+using RefactoringEssentials.CSharp.Diagnostics;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide;
+using System.Globalization;
+using System.Collections.Generic;
+using System.Linq;
+using ICSharpCode.NRefactory6.CSharp;
+
+namespace MonoDevelop.CSharp.Diagnostics.InconsistentNaming
+{
+ [DataItem ("NamingRule")]
+ sealed class NameConventionRule
+ {
+ NamingRule wrappedRule = new NamingRule (AffectedEntity.None);
+
+ [ItemProperty]
+ public string Name {
+ get { return wrappedRule.Name; }
+ set { wrappedRule.Name = value;}
+ }
+
+ [ItemProperty]
+ public string[] RequiredPrefixes {
+ get { return wrappedRule.RequiredPrefixes; }
+ set { wrappedRule.RequiredPrefixes = value;}
+ }
+
+ [ItemProperty]
+ public string[] AllowedPrefixes {
+ get { return wrappedRule.AllowedPrefixes; }
+ set { wrappedRule.AllowedPrefixes = value;}
+ }
+
+ [ItemProperty]
+ public string[] RequiredSuffixes {
+ get { return wrappedRule.RequiredSuffixes; }
+ set { wrappedRule.RequiredSuffixes = value;}
+ }
+
+ [ItemProperty]
+ public string[] ForbiddenPrefixes {
+ get { return wrappedRule.ForbiddenPrefixes; }
+ set { wrappedRule.ForbiddenPrefixes = value;}
+ }
+
+ [ItemProperty]
+ public string[] ForbiddenSuffixes {
+ get { return wrappedRule.ForbiddenSuffixes; }
+ set { wrappedRule.ForbiddenSuffixes = value;}
+ }
+
+ [ItemProperty]
+ public AffectedEntity AffectedEntity {
+ get { return wrappedRule.AffectedEntity; }
+ set { wrappedRule.AffectedEntity = value;}
+ }
+
+ [ItemProperty]
+ public Modifiers VisibilityMask {
+ get { return wrappedRule.VisibilityMask; }
+ set { wrappedRule.VisibilityMask = value;}
+ }
+
+ [ItemProperty]
+ public NamingStyle NamingStyle {
+ get { return wrappedRule.NamingStyle; }
+ set { wrappedRule.NamingStyle = value;}
+ }
+
+ [ItemProperty]
+ public bool IncludeInstanceMembers {
+ get { return wrappedRule.IncludeInstanceMembers; }
+ set { wrappedRule.IncludeInstanceMembers = value;}
+ }
+
+ [ItemProperty]
+ public bool IncludeStaticEntities {
+ get { return wrappedRule.IncludeStaticEntities; }
+ set { wrappedRule.IncludeStaticEntities = value;}
+ }
+
+ internal NameConventionRule (NamingRule wrappedRule)
+ {
+ this.wrappedRule = wrappedRule;
+ }
+
+ public NameConventionRule ()
+ {
+ }
+
+ public NameConventionRule Clone ()
+ {
+ return new NameConventionRule () {
+ wrappedRule = this.wrappedRule.Clone ()
+ };
+ }
+
+ public string GetPreview ()
+ {
+ return wrappedRule.GetPreview ();
+ }
+
+ internal NamingRule GetNRefactoryRule ()
+ {
+ return wrappedRule;
+ }
+
+ public string CorrectName (string name)
+ {
+ string prefix = null, suffix = null;
+ string realName = name;
+ string id = name;
+
+ // check prefix
+ if (AllowedPrefixes != null && AllowedPrefixes.Length > 0) {
+ var allowedPrefix = AllowedPrefixes.FirstOrDefault (p => id.StartsWith (p, StringComparison.Ordinal));
+ if (allowedPrefix != null) {
+ prefix = allowedPrefix;
+ id = id.Substring (allowedPrefix.Length);
+ }
+ }
+
+ if (prefix == null && RequiredPrefixes != null && RequiredPrefixes.Length > 0) {
+ var requiredPrefix = RequiredPrefixes.FirstOrDefault (p => id.StartsWith (p, StringComparison.Ordinal));
+ if (requiredPrefix == null) {
+ prefix = RequiredPrefixes[0];
+ } else {
+ prefix = requiredPrefix;
+ id = id.Substring (requiredPrefix.Length);
+ }
+ }
+
+ if (prefix == null && ForbiddenPrefixes != null && ForbiddenPrefixes.Length > 0) {
+ var forbiddenPrefix = ForbiddenPrefixes.FirstOrDefault (p => id.StartsWith (p, StringComparison.Ordinal));
+ if (forbiddenPrefix != null) {
+ id = id.Substring (forbiddenPrefix.Length);
+ }
+ }
+
+ // check suffix
+ if (RequiredSuffixes != null && RequiredSuffixes.Length > 0) {
+ var requiredSuffix = RequiredSuffixes.FirstOrDefault (s => id.EndsWith (s, StringComparison.Ordinal));
+ if (requiredSuffix == null) {
+ suffix = RequiredSuffixes[0];
+ } else {
+ suffix = requiredSuffix;
+ id = id.Substring (0, id.Length - requiredSuffix.Length);
+ }
+ }
+
+ if (suffix == null && ForbiddenSuffixes != null && ForbiddenSuffixes.Length > 0) {
+ var forbiddenSuffix = ForbiddenSuffixes.FirstOrDefault (p => id.EndsWith (p, StringComparison.Ordinal));
+ if (forbiddenSuffix != null) {
+ id = id.Substring (0, id.Length - forbiddenSuffix.Length);
+ }
+ }
+ Console.WriteLine ("style: " + NamingStyle);
+ switch (NamingStyle) {
+ case NamingStyle.AllLower:
+ if (id.Any (ch => char.IsLetter (ch) && char.IsUpper (ch))) {
+ realName = LowerCaseIdentifier (WordParser.BreakWords (id));
+ } else {
+ realName = id;
+ }
+ break;
+ case NamingStyle.AllUpper:
+ if (id.Any (ch => char.IsLetter (ch) && char.IsLower (ch))) {
+ realName = UpperCaseIdentifier (WordParser.BreakWords (id));
+ } else {
+ realName = id;
+ }
+ break;
+
+ case NamingStyle.CamelCase:
+ if (id.Length > 0 && !char.IsLower (id [0])) {
+ } else if (!CheckUnderscore (id, UnderscoreHandling.Forbid)) {
+ } else {
+ realName = id;
+ break;
+ }
+ realName = CamelCaseIdentifier (id);
+ break;
+ case NamingStyle.CamelCaseWithLowerLetterUnderscore:
+ if (id.Length > 0 && !char.IsLower (id [0])) {
+ } else if (!CheckUnderscore (id, UnderscoreHandling.AllowWithLowerStartingLetter)) {
+ } else {
+ realName = id;
+ break;
+ }
+ realName = CamelCaseWithLowerLetterUnderscore (id);
+ break;
+ case NamingStyle.CamelCaseWithUpperLetterUnderscore:
+ if (id.Length > 0 && !char.IsLower (id [0])) {
+ } else if (!CheckUnderscore (id, UnderscoreHandling.AllowWithUpperStartingLetter)) {
+ } else {
+ realName = id;
+ break;
+ }
+ realName = CamelCaseWithUpperLetterUnderscore (id);
+ break;
+
+ case NamingStyle.PascalCase:
+ if (id.Length > 0 && !char.IsUpper (id [0])) {
+ } else if (!CheckUnderscore (id, UnderscoreHandling.Forbid)) {
+ } else {
+ realName = id;
+ break;
+ }
+ realName = PascalCaseIdentifier (id);
+ break;
+ case NamingStyle.PascalCaseWithLowerLetterUnderscore:
+ if (id.Length > 0 && !char.IsUpper (id [0])) {
+ } else if (!CheckUnderscore (id, UnderscoreHandling.AllowWithLowerStartingLetter)) {
+ } else {
+ realName = id;
+ break;
+ }
+ realName = PascalCaseWithLowerLetterUnderscore (id);
+ break;
+ case NamingStyle.PascalCaseWithUpperLetterUnderscore:
+ if (id.Length > 0 && !char.IsUpper (id [0])) {
+ } else if (!CheckUnderscore (id, UnderscoreHandling.AllowWithUpperStartingLetter)) {
+ } else {
+ realName = id;
+ break;
+ }
+ realName = PascalCaseWithUpperLetterUnderscore (id);
+ break;
+ case NamingStyle.FirstUpper:
+ if (id.Length > 0 && !char.IsUpper (id [0])) {
+ } else if (id.Take (1).Any (ch => char.IsLetter (ch) && char.IsUpper (ch))) {
+ } else {
+ realName = id;
+ break;
+ }
+ realName = FirstUpperIdentifier (WordParser.BreakWords (id));
+ break;
+ }
+
+ return prefix + realName + suffix;
+ }
+
+ static string ConvertToValidName(string id, Func<char, char> firstCharFunc, Func<char, char> followingCharFunc)
+ {
+ var sb = new StringBuilder();
+ bool first = true;
+ for (int i = 0; i < id.Length; i++) {
+ char ch = id[i];
+ if (i == 0 && ch == '_')
+ continue;
+ if (first && char.IsLetter(ch)) {
+ sb.Append(firstCharFunc(ch));
+ firstCharFunc = followingCharFunc;
+ first = false;
+ continue;
+ }
+ if (ch == '_') {
+ if (first)
+ continue;
+ if (i + 1 < id.Length && id[i + 1] == '_')
+ continue;
+
+ if (i + 1 < id.Length) {
+ if (char.IsDigit(id[i + 1])) {
+ sb.Append('_');
+ } else {
+ first = true;
+ }
+ }
+ continue;
+ }
+ sb.Append(ch);
+ }
+ return sb.ToString();
+ }
+
+ static string ConvertToValidNameWithSpecialUnderscoreHandling(string id, Func<char, char> firstCharFunc, Func<char, char> afterUnderscoreLetter)
+ {
+ var sb = new StringBuilder();
+ bool first = true;
+ for (int i = 0; i < id.Length; i++) {
+ char ch = id[i];
+ if (first && char.IsLetter(ch)) {
+ sb.Append(firstCharFunc(ch));
+ first = false;
+ continue;
+ }
+ if (ch == '_') {
+ if (first)
+ continue;
+ if (i + 1 < id.Length && id[i + 1] == '_')
+ continue;
+ sb.Append('_');
+ i++;
+ if (i < id.Length)
+ sb.Append(afterUnderscoreLetter (id[i]));
+ continue;
+ }
+ sb.Append(ch);
+ }
+ return sb.ToString();
+ }
+
+ static string CamelCaseIdentifier(string id)
+ {
+ return ConvertToValidName(id, ch => char.ToLower(ch), ch => char.ToUpper (ch));
+ }
+
+ static string CamelCaseWithLowerLetterUnderscore(string id)
+ {
+ return ConvertToValidNameWithSpecialUnderscoreHandling(id, ch => char.ToLower(ch), ch => char.ToLower(ch));
+ }
+
+ static string CamelCaseWithUpperLetterUnderscore(string id)
+ {
+ return ConvertToValidNameWithSpecialUnderscoreHandling(id, ch => char.ToLower(ch), ch => char.ToUpper(ch));
+ }
+
+ static string PascalCaseIdentifier(string id)
+ {
+ return ConvertToValidName(id, ch => char.ToUpper(ch), ch => char.ToUpper (ch));
+ }
+
+ static string PascalCaseWithLowerLetterUnderscore(string id)
+ {
+ return ConvertToValidNameWithSpecialUnderscoreHandling(id, ch => char.ToUpper(ch), ch => char.ToLower (ch));
+ }
+
+ static string PascalCaseWithUpperLetterUnderscore(string id)
+ {
+ return ConvertToValidNameWithSpecialUnderscoreHandling(id, ch => char.ToUpper(ch), ch => char.ToUpper(ch));
+ }
+
+ static string LowerCaseIdentifier(List<string> words)
+ {
+ var sb = new StringBuilder();
+ sb.Append(words [0].ToLower());
+ for (int i = 1; i < words.Count; i++) {
+ sb.Append('_');
+ sb.Append(words [i].ToLower());
+ }
+ return sb.ToString();
+ }
+
+ static string UpperCaseIdentifier(List<string> words)
+ {
+ var sb = new StringBuilder();
+ sb.Append(words [0].ToUpper());
+ for (int i = 1; i < words.Count; i++) {
+ sb.Append('_');
+ sb.Append(words [i].ToUpper());
+ }
+ return sb.ToString();
+ }
+
+ static string FirstUpperIdentifier(List<string> words)
+ {
+ var sb = new StringBuilder();
+ AppendCapitalized(words [0], sb);
+ for (int i = 1; i < words.Count; i++) {
+ sb.Append('_');
+ sb.Append(words [i].ToLower());
+ }
+ return sb.ToString();
+ }
+
+ static void AppendCapitalized(string word, StringBuilder sb)
+ {
+ sb.Append(word.ToLower());
+ sb [sb.Length - word.Length] = char.ToUpper(sb [sb.Length - word.Length]);
+ }
+
+ static bool CheckUnderscore(string id, UnderscoreHandling handling)
+ {
+ for (int i = 1; i < id.Length; i++) {
+ char ch = id [i];
+ if (ch == '_' && !HandleUnderscore(handling, id, ref i))
+ return false;
+ }
+ return true;
+ }
+
+ enum UnderscoreHandling {
+ Forbid,
+ Allow,
+ AllowWithLowerStartingLetter,
+ AllowWithUpperStartingLetter
+ }
+
+ static bool HandleUnderscore(UnderscoreHandling handling, string id, ref int i)
+ {
+ switch (handling) {
+ case UnderscoreHandling.Forbid:
+ if (i + 1 < id.Length) {
+ char ch = id [i + 1];
+ if (char.IsDigit(ch)) {
+ i++;
+ return true;
+ }
+ }
+ return false;
+ case UnderscoreHandling.Allow:
+ return true;
+ case UnderscoreHandling.AllowWithLowerStartingLetter:
+ if (i + 1 < id.Length) {
+ char ch = id [i + 1];
+ if (char.IsLetter(ch) && !char.IsLower(ch) || ch =='_')
+ return false;
+ i++;
+ }
+ return true;
+ case UnderscoreHandling.AllowWithUpperStartingLetter:
+ if (i + 1 < id.Length) {
+ char ch = id [i + 1];
+ if (char.IsLetter(ch) && !char.IsUpper(ch) || ch =='_')
+ return false;
+ i++;
+ }
+ return true;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ internal class NamePropsalStrategy : RefactoringEssentials.INameProposalStrategy
+ {
+ static readonly char[] s_underscoreCharArray = new[] { '_' };
+ static readonly CultureInfo EnUSCultureInfo = new CultureInfo("en-US");
+
+ string DefaultGetNameProposal(string baseName, SyntaxKind syntaxKindHint, Document document, int position)
+ {
+ switch (syntaxKindHint)
+ {
+ case SyntaxKind.ClassDeclaration:
+ case SyntaxKind.StructDeclaration:
+ case SyntaxKind.InterfaceDeclaration:
+ case SyntaxKind.EnumDeclaration:
+ case SyntaxKind.DelegateDeclaration:
+ case SyntaxKind.MethodDeclaration:
+ case SyntaxKind.PropertyDeclaration:
+ case SyntaxKind.EventDeclaration:
+ case SyntaxKind.EventFieldDeclaration:
+ case SyntaxKind.EnumMemberDeclaration:
+
+ // Trim leading underscores
+ var newBaseName = baseName.TrimStart(s_underscoreCharArray);
+
+ // Trim leading "m_"
+ if (newBaseName.Length >= 2 && newBaseName[0] == 'm' && newBaseName[1] == '_')
+ {
+ newBaseName = newBaseName.Substring(2);
+ }
+
+ // Take original name if no characters left
+ if (newBaseName.Length == 0)
+ {
+ newBaseName = baseName;
+ }
+
+ // Make the first character upper case using the "en-US" culture. See discussion at
+ // https://github.com/dotnet/roslyn/issues/5524.
+ var firstCharacter = EnUSCultureInfo.TextInfo.ToUpper(newBaseName[0]);
+ return firstCharacter.ToString() + newBaseName.Substring(1);
+
+ case SyntaxKind.Parameter:
+ case SyntaxKind.FieldDeclaration:
+ case SyntaxKind.VariableDeclaration:
+ case SyntaxKind.LocalDeclarationStatement:
+ return char.ToLower(baseName[0]).ToString() + baseName.Substring(1);
+ }
+ return baseName;
+ }
+
+ public string GetNameProposal(string baseName, SyntaxKind syntaxKindHint, Accessibility accessibility, bool isStatic, Document document, int position)
+ {
+ var container = PolicyService.DefaultPolicies;
+ var project = TypeSystemService.GetMonoProject (document.Id);
+ if (project == null)
+ project = IdeApp.ProjectOperations.CurrentSelectedProject;
+ if (project != null)
+ container = project.Policies;
+ var policy = container.Get<NameConventionPolicy> ();
+ var entity = GetAffectedEntity (syntaxKindHint);
+
+ var mod = Modifiers.None;
+ switch (accessibility) {
+ case Accessibility.Private:
+ mod = Modifiers.Private;
+ break;
+ case Accessibility.ProtectedAndInternal:
+ mod = Modifiers.Internal | Modifiers.Protected;
+ break;
+ case Accessibility.Protected:
+ mod = Modifiers.Protected;
+ break;
+ case Accessibility.Internal:
+ mod = Modifiers.Internal;
+ break;
+ case Accessibility.ProtectedOrInternal:
+ mod = Modifiers.Internal | Modifiers.Protected;
+ break;
+ case Accessibility.Public:
+ mod = Modifiers.Public;
+ break;
+ }
+
+ foreach (var rule in policy.Rules) {
+ if ((rule.AffectedEntity & entity) != entity)
+ continue;
+ if (isStatic && !rule.IncludeStaticEntities)
+ continue;
+ if ((rule.VisibilityMask & mod) != mod)
+ continue;
+ return rule.CorrectName (baseName);
+ }
+
+ return DefaultGetNameProposal (baseName, syntaxKindHint, document, position);
+ }
+
+ AffectedEntity GetAffectedEntity (SyntaxKind syntaxKindHint)
+ {
+ switch (syntaxKindHint) {
+ case SyntaxKind.ClassDeclaration:
+ return AffectedEntity.Class;
+ case SyntaxKind.StructDeclaration:
+ return AffectedEntity.Struct;
+ case SyntaxKind.InterfaceDeclaration:
+ return AffectedEntity.Interface;
+ case SyntaxKind.EnumDeclaration:
+ return AffectedEntity.Enum;
+ case SyntaxKind.DelegateDeclaration:
+ return AffectedEntity.Delegate;
+ case SyntaxKind.MethodDeclaration:
+ return AffectedEntity.Method;
+ case SyntaxKind.PropertyDeclaration:
+ return AffectedEntity.Property;
+ case SyntaxKind.EventDeclaration:
+ return AffectedEntity.Event;
+ case SyntaxKind.EventFieldDeclaration:
+ return AffectedEntity.Event;
+ case SyntaxKind.EnumMemberDeclaration:
+ return AffectedEntity.EnumMember;
+ case SyntaxKind.Parameter:
+ return AffectedEntity.Parameter;
+ case SyntaxKind.FieldDeclaration:
+ return AffectedEntity.Field;
+ case SyntaxKind.VariableDeclaration:
+ return AffectedEntity.LocalVariable;
+ case SyntaxKind.LocalDeclarationStatement:
+ return AffectedEntity.LocalVariable;
+ }
+ return AffectedEntity.None;
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/MonoTODO/MonoTODODiagnosticAnalyzer.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/MonoTODO/MonoTODODiagnosticAnalyzer.cs
new file mode 100644
index 0000000000..ad7f68ea93
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/MonoTODO/MonoTODODiagnosticAnalyzer.cs
@@ -0,0 +1,105 @@
+//
+// MonoTODODiagnosticAnalyzer.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using Microsoft.CodeAnalysis.Diagnostics;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using ICSharpCode.NRefactory6.CSharp;
+using System.Threading;
+using MonoDevelop.Ide.TypeSystem;
+using RefactoringEssentials;
+
+namespace MonoDevelop.CSharp.Diagnostics.MonoTODODiagnostic
+{
+ [DiagnosticAnalyzer(LanguageNames.CSharp)]
+ sealed class MonoTODODiagnosticAnalyzer : DiagnosticAnalyzer
+ {
+ static readonly ImmutableArray<SyntaxKind> syntaxKindsOfInterest = ImmutableArray.Create(
+ SyntaxKind.IdentifierName, // foo
+ SyntaxKind.SimpleMemberAccessExpression, // foo.bar
+ SyntaxKind.PointerMemberAccessExpression, // foo->bar
+ SyntaxKind.ConditionalAccessExpression // foo?.bar
+ );
+
+ static readonly DiagnosticDescriptor descriptor = new DiagnosticDescriptor(
+ IDEDiagnosticIds.MonoTODODiagnosticDiagnosticId,
+ "Find usages of mono todo items",
+ "{0}",
+ DiagnosticAnalyzerCategories.Notifications,
+ DiagnosticSeverity.Warning,
+ isEnabledByDefault: true);
+
+ public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics {
+ get {
+ return ImmutableArray.Create(descriptor);
+ }
+ }
+
+ public override void Initialize(AnalysisContext context)
+ {
+ context.RegisterSyntaxNodeAction(
+ (nodeContext) => {
+ Diagnostic diagnostic;
+ if (TryFindMonoTODO(nodeContext.SemanticModel, nodeContext.Node, out diagnostic, nodeContext.CancellationToken))
+ nodeContext.ReportDiagnostic (diagnostic);
+ },
+ syntaxKindsOfInterest);
+ }
+
+ static readonly Dictionary<string, string> attributes = new Dictionary<string, string> {
+ { "MonoTODOAttribute", "Mono TODO" },
+ { "MonoNotSupportedAttribute", "Mono NOT SUPPORTED" },
+ { "MonoLimitationAttribute", "Mono LIMITATION" }
+ };
+
+ bool TryFindMonoTODO (SemanticModel semanticModel, SyntaxNode node, out Diagnostic diagnostic, CancellationToken cancellationToken)
+ {
+ var info = semanticModel.GetSymbolInfo (node);
+ diagnostic = default(Diagnostic);
+ if (info.Symbol == null || semanticModel.IsFromGeneratedCode (cancellationToken))
+ return false;
+
+ foreach (var attr in info.Symbol.GetAttributes ()) {
+ if (attr.AttributeClass.ContainingNamespace.GetFullName () != "System")
+ continue;
+ string val;
+ if (attributes.TryGetValue (attr.AttributeClass.Name, out val)) {
+ string msg = null;
+ if (attr.ConstructorArguments.Length > 0) {
+ var arg = attr.ConstructorArguments [0];
+ msg = arg.Value != null ? arg.Value.ToString () : null;
+ }
+ var tree = semanticModel.SyntaxTree;
+ diagnostic = Diagnostic.Create(descriptor, tree.GetLocation(node.Span), string.IsNullOrEmpty (msg) ? val : val + ": " + msg);
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/RemoveUnnecessaryCast/CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/RemoveUnnecessaryCast/CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs
new file mode 100644
index 0000000000..dcb06caf87
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/RemoveUnnecessaryCast/CSharpRemoveUnnecessaryCastDiagnosticAnalyzer.cs
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Diagnostics;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using ICSharpCode.NRefactory6.CSharp;
+
+namespace MonoDevelop.CSharp.Diagnostics.RemoveUnnecessaryCast
+{
+ [DiagnosticAnalyzer(LanguageNames.CSharp)]
+ internal sealed class CSharpRemoveUnnecessaryCastDiagnosticAnalyzer : RemoveUnnecessaryCastDiagnosticAnalyzerBase<SyntaxKind>
+ {
+ private static readonly ImmutableArray<SyntaxKind> s_kindsOfInterest = ImmutableArray.Create(SyntaxKind.CastExpression);
+
+ public override ImmutableArray<SyntaxKind> SyntaxKindsOfInterest
+ {
+ get
+ {
+ return s_kindsOfInterest;
+ }
+ }
+
+ protected override bool IsUnnecessaryCast(SemanticModel model, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ var cast = (CastExpressionSyntax)node;
+ return cast.IsUnnecessaryCast(model, cancellationToken);
+ }
+
+ protected override TextSpan GetDiagnosticSpan(SyntaxNode node)
+ {
+ var cast = (CastExpressionSyntax)node;
+ return TextSpan.FromBounds(cast.OpenParenToken.SpanStart, cast.CloseParenToken.Span.End);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/RemoveUnnecessaryCast/RemoveUnnecessaryCastDiagnosticAnalyzerBase.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/RemoveUnnecessaryCast/RemoveUnnecessaryCastDiagnosticAnalyzerBase.cs
new file mode 100644
index 0000000000..350c09e970
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/RemoveUnnecessaryCast/RemoveUnnecessaryCastDiagnosticAnalyzerBase.cs
@@ -0,0 +1,85 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.Diagnostics;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using MonoDevelop.Core;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp;
+using RefactoringEssentials;
+
+namespace MonoDevelop.CSharp.Diagnostics.RemoveUnnecessaryCast
+{
+ internal abstract class RemoveUnnecessaryCastDiagnosticAnalyzerBase<TLanguageKindEnum> : DiagnosticAnalyzer where TLanguageKindEnum : struct
+ {
+ private static string s_localizableTitle = GettextCatalog.GetString ("Remove Unnecessary Cast");
+ private static string s_localizableMessage = GettextCatalog.GetString ("Cast is redundant.");
+
+ private static readonly DiagnosticDescriptor s_descriptor = new DiagnosticDescriptor(IDEDiagnosticIds.RemoveUnnecessaryCastDiagnosticId,
+ s_localizableTitle,
+ s_localizableMessage,
+ DiagnosticAnalyzerCategories.RedundanciesInCode,
+ DiagnosticSeverity.Warning,
+ isEnabledByDefault: true,
+ customTags: DiagnosticCustomTags.Unnecessary);
+
+ #region Interface methods
+
+ public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
+ {
+ get
+ {
+ return ImmutableArray.Create(s_descriptor);
+ }
+ }
+
+ public override void Initialize(AnalysisContext context)
+ {
+ context.RegisterSyntaxNodeAction(
+ (nodeContext) =>
+ {
+ Diagnostic diagnostic;
+ if (TryRemoveCastExpression(nodeContext.SemanticModel, nodeContext.Node, out diagnostic, nodeContext.CancellationToken))
+ {
+ nodeContext.ReportDiagnostic(diagnostic);
+ }
+ },
+ this.SyntaxKindsOfInterest.ToArray());
+ }
+
+ public abstract ImmutableArray<TLanguageKindEnum> SyntaxKindsOfInterest { get; }
+
+ #endregion
+
+ protected abstract bool IsUnnecessaryCast(SemanticModel model, SyntaxNode node, CancellationToken cancellationToken);
+ protected abstract TextSpan GetDiagnosticSpan(SyntaxNode node);
+
+ private bool TryRemoveCastExpression(
+ SemanticModel model, SyntaxNode node, out Diagnostic diagnostic, CancellationToken cancellationToken)
+ {
+ diagnostic = default(Diagnostic);
+ if (model.IsFromGeneratedCode (cancellationToken))
+ return false;
+ if (!IsUnnecessaryCast(model, node, cancellationToken))
+ {
+ return false;
+ }
+
+ var tree = model.SyntaxTree;
+ var span = GetDiagnosticSpan(node);
+ if (tree.OverlapsHiddenPosition(span, cancellationToken))
+ {
+ return false;
+ }
+
+ diagnostic = Diagnostic.Create(s_descriptor, tree.GetLocation(span));
+ return true;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs
new file mode 100644
index 0000000000..30c1046d09
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer.cs
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Diagnostics;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp.Features.RemoveUnnecessaryImports;
+using ICSharpCode.NRefactory6.CSharp;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.CSharp.Diagnostics.RemoveUnnecessaryImports
+{
+ [DiagnosticAnalyzer(LanguageNames.CSharp)]
+ internal sealed class CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer : RemoveUnnecessaryImportsDiagnosticAnalyzerBase
+ {
+ private static readonly string s_TitleAndMessageFormat = GettextCatalog.GetString ("Using directive is unnecessary.");
+
+ protected override LocalizableString GetTitleAndMessageFormatForClassificationIdDescriptor()
+ {
+ return s_TitleAndMessageFormat;
+ }
+
+ protected override IEnumerable<SyntaxNode> GetUnnecessaryImports(SemanticModel semanticModel, SyntaxNode root, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return CSharpRemoveUnnecessaryImportsService.GetUnnecessaryImports(semanticModel, root, cancellationToken);
+ }
+
+ protected override IEnumerable<TextSpan> GetFixableDiagnosticSpans(IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ //var nodesContainingUnnecessaryUsings = new HashSet<SyntaxNode>();
+ foreach (var node in nodes) {
+ yield return node.Span;
+// var nodeContainingUnnecessaryUsings = node.GetAncestors().First(n => n is NamespaceDeclarationSyntax || n is CompilationUnitSyntax);
+// if (!nodesContainingUnnecessaryUsings.Add(nodeContainingUnnecessaryUsings))
+// {
+// continue;
+// }
+//
+// yield return nodeContainingUnnecessaryUsings is NamespaceDeclarationSyntax ?
+// ((NamespaceDeclarationSyntax)nodeContainingUnnecessaryUsings).Usings.GetContainedSpan() :
+// ((CompilationUnitSyntax)nodeContainingUnnecessaryUsings).Usings.GetContainedSpan();
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/RemoveUnnecessaryImports/RemoveUnnecessaryImportsDiagnosticAnalyzerBase.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/RemoveUnnecessaryImports/RemoveUnnecessaryImportsDiagnosticAnalyzerBase.cs
new file mode 100644
index 0000000000..338c130b6f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/RemoveUnnecessaryImports/RemoveUnnecessaryImportsDiagnosticAnalyzerBase.cs
@@ -0,0 +1,127 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.Diagnostics;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp;
+using RefactoringEssentials;
+
+namespace MonoDevelop.CSharp.Diagnostics.RemoveUnnecessaryImports
+{
+ internal abstract class RemoveUnnecessaryImportsDiagnosticAnalyzerBase : DiagnosticAnalyzer
+ {
+ // NOTE: This is a trigger diagnostic, which doesn't show up in the ruleset editor and hence doesn't need a conventional IDE Diagnostic ID string.
+ internal const string DiagnosticFixableId = "RemoveUnnecessaryImportsFixable";
+
+ // The NotConfigurable custom tag ensures that user can't turn this diagnostic into a warning / error via
+ // ruleset editor or solution explorer. Setting messageFormat to empty string ensures that we won't display
+ // this diagnostic in the preview pane header.
+ //private static readonly DiagnosticDescriptor s_fixableIdDescriptor =
+ // new DiagnosticDescriptor(DiagnosticFixableId,
+ // title: "", messageFormat: "", category: "",
+ // defaultSeverity: DiagnosticSeverity.Hidden,
+ // isEnabledByDefault: true,
+ // customTags: WellKnownDiagnosticTags.NotConfigurable);
+
+ protected abstract LocalizableString GetTitleAndMessageFormatForClassificationIdDescriptor();
+
+ private DiagnosticDescriptor _classificationIdDescriptor;
+ private DiagnosticDescriptor GetClassificationIdDescriptor()
+ {
+ if (_classificationIdDescriptor == null)
+ {
+ var titleAndMessageFormat = GetTitleAndMessageFormatForClassificationIdDescriptor();
+ _classificationIdDescriptor =
+ new DiagnosticDescriptor(IDEDiagnosticIds.RemoveUnnecessaryImportsDiagnosticId,
+ titleAndMessageFormat,
+ titleAndMessageFormat,
+ DiagnosticAnalyzerCategories.RedundanciesInCode,
+ DiagnosticSeverity.Warning,
+ isEnabledByDefault: true,
+ customTags: DiagnosticCustomTags.Unnecessary);
+ }
+
+ return _classificationIdDescriptor;
+ }
+
+ private ImmutableArray<DiagnosticDescriptor> _descriptors;
+ public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
+ {
+ get
+ {
+ if (_descriptors == null)
+ {
+ _descriptors = ImmutableArray.Create(GetClassificationIdDescriptor());
+ }
+
+ return _descriptors;
+ }
+ }
+
+ public override void Initialize(AnalysisContext context)
+ {
+ context.RegisterSemanticModelAction(this.AnalyzeSemanticModel);
+ }
+
+ private void AnalyzeSemanticModel(SemanticModelAnalysisContext context)
+ {
+ if (context.IsFromGeneratedCode ())
+ return;
+ var tree = context.SemanticModel.SyntaxTree;
+ var root = tree.GetRoot();
+ var unncessaryImports = GetUnnecessaryImports(context.SemanticModel, root);
+ if (unncessaryImports != null && unncessaryImports.Any())
+ {
+ Func<SyntaxNode, SyntaxToken> getLastTokenFunc = GetLastTokenDelegateForContiguousSpans();
+ var contiguousSpans = unncessaryImports.GetContiguousSpans(getLastTokenFunc);
+ var diagnostics = CreateClassificationDiagnostics(contiguousSpans, tree).Concat(
+ CreateFixableDiagnostics(unncessaryImports, tree));
+ var spans = new List<TextSpan> ();
+ foreach (var diagnostic in diagnostics)
+ {
+ if (spans.Any (s => s.OverlapsWith (diagnostic.Location.SourceSpan)))
+ continue;
+ spans.Add (diagnostic.Location.SourceSpan);
+ context.ReportDiagnostic(diagnostic);
+ }
+ }
+ }
+
+ protected abstract IEnumerable<SyntaxNode> GetUnnecessaryImports(SemanticModel semanticModel, SyntaxNode root, CancellationToken cancellationToken = default(CancellationToken));
+ protected virtual Func<SyntaxNode, SyntaxToken> GetLastTokenDelegateForContiguousSpans()
+ {
+ return null;
+ }
+
+ // Create one diagnostic for each unnecessary span that will be classified as Unnecessary
+ private IEnumerable<Diagnostic> CreateClassificationDiagnostics(IEnumerable<TextSpan> contiguousSpans, SyntaxTree tree, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ foreach (var span in contiguousSpans)
+ {
+ if (tree.OverlapsHiddenPosition(span, cancellationToken))
+ {
+ continue;
+ }
+
+ yield return Diagnostic.Create(GetClassificationIdDescriptor(), tree.GetLocation(span));
+ }
+ }
+
+ protected abstract IEnumerable<TextSpan> GetFixableDiagnosticSpans(IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken = default(CancellationToken));
+
+ private IEnumerable<Diagnostic> CreateFixableDiagnostics(IEnumerable<SyntaxNode> nodes, SyntaxTree tree, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var spans = GetFixableDiagnosticSpans(nodes, tree, cancellationToken);
+ foreach (var span in spans) {
+ yield return Diagnostic.Create(GetClassificationIdDescriptor(), tree.GetLocation(span));
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/SimplifyTypeNames/CSharpSimplifyTypeNamesDiagnosticAnalyzer.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/SimplifyTypeNames/CSharpSimplifyTypeNamesDiagnosticAnalyzer.cs
new file mode 100644
index 0000000000..a072a3f630
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/SimplifyTypeNames/CSharpSimplifyTypeNamesDiagnosticAnalyzer.cs
@@ -0,0 +1,153 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Immutable;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Diagnostics;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using ICSharpCode.NRefactory6.CSharp;
+using RefactoringEssentials;
+
+namespace MonoDevelop.CSharp.Diagnostics.SimplifyTypeNames
+{
+ [DiagnosticAnalyzer(LanguageNames.CSharp)]
+ internal sealed class CSharpSimplifyTypeNamesDiagnosticAnalyzer : SimplifyTypeNamesDiagnosticAnalyzerBase<SyntaxKind>
+ {
+ private static readonly ImmutableArray<SyntaxKind> s_kindsOfInterest = ImmutableArray.Create(SyntaxKind.QualifiedName,
+ SyntaxKind.AliasQualifiedName,
+ SyntaxKind.GenericName,
+ SyntaxKind.IdentifierName,
+ SyntaxKind.SimpleMemberAccessExpression,
+ SyntaxKind.QualifiedCref);
+
+ public override void Initialize(AnalysisContext analysisContext)
+ {
+ analysisContext.RegisterSyntaxNodeAction(AnalyzeNode, s_kindsOfInterest.ToArray());
+ }
+
+ protected override void AnalyzeNode(SyntaxNodeAnalysisContext context)
+ {
+ if (context.IsFromGeneratedCode ())
+ return;
+ if (context.Node.Ancestors(ascendOutOfTrivia: false).Any(n => s_kindsOfInterest.Contains(n.Kind())))
+ {
+ // Already simplified an ancestor of this node.
+ return;
+ }
+
+ Diagnostic diagnostic;
+ Func<SyntaxNode, bool> descendIntoChildren = n =>
+ {
+ if (!IsRegularCandidate(n) ||
+ !TrySimplifyTypeNameExpression(context.SemanticModel, n, context.Options, out diagnostic, context.CancellationToken))
+ {
+ return true;
+ }
+ context.ReportDiagnostic(diagnostic);
+ return false;
+ };
+
+ // find regular node first - search from top to down. once found one, don't get into its children
+ foreach (var candidate in context.Node.DescendantNodesAndSelf(descendIntoChildren))
+ {
+ context.CancellationToken.ThrowIfCancellationRequested();
+ }
+
+ // now search structure trivia
+ foreach (var candidate in context.Node.DescendantNodesAndSelf(descendIntoChildren: n => !IsCrefCandidate(n), descendIntoTrivia: true))
+ {
+ context.CancellationToken.ThrowIfCancellationRequested();
+
+ if (IsCrefCandidate(candidate) &&
+ TrySimplifyTypeNameExpression(context.SemanticModel, candidate, context.Options, out diagnostic, context.CancellationToken))
+ {
+ context.ReportDiagnostic(diagnostic);
+ }
+ }
+ }
+
+ internal static bool IsCandidate(SyntaxNode node)
+ {
+ return IsRegularCandidate(node) || IsCrefCandidate(node);
+ }
+
+ private static bool IsRegularCandidate(SyntaxNode node)
+ {
+ return node != null && s_kindsOfInterest.Contains(node.Kind());
+ }
+
+ private static bool IsCrefCandidate(SyntaxNode node)
+ {
+ return node is QualifiedCrefSyntax;
+ }
+
+ protected sealed override bool CanSimplifyTypeNameExpressionCore(SemanticModel model, SyntaxNode node, OptionSet optionSet, out TextSpan issueSpan, out string diagnosticId, CancellationToken cancellationToken)
+ {
+ return CanSimplifyTypeNameExpression(model, node, optionSet, out issueSpan, out diagnosticId, cancellationToken);
+ }
+
+ internal static bool CanSimplifyTypeNameExpression(SemanticModel model, SyntaxNode node, OptionSet optionSet, out TextSpan issueSpan, out string diagnosticId, CancellationToken cancellationToken)
+ {
+ issueSpan = default(TextSpan);
+ diagnosticId = IDEDiagnosticIds.SimplifyNamesDiagnosticId;
+
+ // For Crefs, currently only Qualified Crefs needs to be handled separately
+ if (node.Kind() == SyntaxKind.QualifiedCref)
+ {
+ if (node.ContainsDiagnostics)
+ {
+ return false;
+ }
+
+ var crefSyntax = (CrefSyntax)node;
+
+ CrefSyntax replacementNode;
+ if (!crefSyntax.TryReduceOrSimplifyExplicitName (model, out replacementNode, out issueSpan, optionSet, cancellationToken))
+ {
+ return false;
+ }
+ }
+ else
+ {
+ var expression = (ExpressionSyntax)node;
+ if (expression.ContainsDiagnostics)
+ {
+ return false;
+ }
+
+ // in case of an As or Is expression we need to handle the binary expression, because it might be
+ // required to add parenthesis around the expression. Adding the parenthesis is done in the CSharpNameSimplifier.Rewriter
+ var expressionToCheck = expression.Kind() == SyntaxKind.AsExpression || expression.Kind() == SyntaxKind.IsExpression
+ ? ((BinaryExpressionSyntax)expression).Right
+ : expression;
+
+ ExpressionSyntax replacementSyntax;
+ if (!expressionToCheck.TryReduceOrSimplifyExplicitName(model, out replacementSyntax, out issueSpan, optionSet, cancellationToken))
+ {
+ return false;
+ }
+
+ if (expression.Kind() == SyntaxKind.SimpleMemberAccessExpression)
+ {
+ var memberAccess = (MemberAccessExpressionSyntax)expression;
+ diagnosticId = memberAccess.Expression.Kind() == SyntaxKind.ThisExpression ?
+ IDEDiagnosticIds.SimplifyThisOrMeDiagnosticId :
+ IDEDiagnosticIds.SimplifyMemberAccessDiagnosticId;
+ }
+ }
+
+ return true;
+ }
+
+ protected override string GetLanguageName()
+ {
+ return LanguageNames.CSharp;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/SimplifyTypeNames/SimplifyTypeNamesDiagnosticAnalyzerBase.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/SimplifyTypeNames/SimplifyTypeNamesDiagnosticAnalyzerBase.cs
new file mode 100644
index 0000000000..6734509864
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Diagnostics/SimplifyTypeNames/SimplifyTypeNamesDiagnosticAnalyzerBase.cs
@@ -0,0 +1,112 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Immutable;
+using System.Threading;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Diagnostics;
+using ICSharpCode.NRefactory6.CSharp;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.TypeSystem;
+using System;
+using RefactoringEssentials;
+
+namespace MonoDevelop.CSharp.Diagnostics.SimplifyTypeNames
+{
+ internal abstract class SimplifyTypeNamesDiagnosticAnalyzerBase<TLanguageKindEnum> : DiagnosticAnalyzer where TLanguageKindEnum : struct
+ {
+ private static string s_localizableMessage = GettextCatalog.GetString ("Name can be simplified.");
+ private static string s_localizableTitleSimplifyNames = GettextCatalog.GetString ("Simplify Names");
+
+ private static readonly DiagnosticDescriptor s_descriptorSimplifyNames = new DiagnosticDescriptor(IDEDiagnosticIds.SimplifyNamesDiagnosticId,
+ s_localizableTitleSimplifyNames,
+ s_localizableMessage,
+ DiagnosticAnalyzerCategories.RedundanciesInCode,
+ DiagnosticSeverity.Warning,
+ isEnabledByDefault: true,
+ customTags: DiagnosticCustomTags.Unnecessary);
+
+ private static string s_localizableTitleSimplifyMemberAccess = GettextCatalog.GetString ("Simplify member access '{0}'");
+ private static readonly DiagnosticDescriptor s_descriptorSimplifyMemberAccess = new DiagnosticDescriptor(IDEDiagnosticIds.SimplifyMemberAccessDiagnosticId,
+ s_localizableTitleSimplifyMemberAccess,
+ s_localizableMessage,
+ DiagnosticAnalyzerCategories.RedundanciesInCode,
+ DiagnosticSeverity.Warning,
+ isEnabledByDefault: true,
+ customTags: DiagnosticCustomTags.Unnecessary);
+
+ private static string s_localizableTitleSimplifyThisOrMe = GettextCatalog.GetString ("Remove 'this'");
+ private static readonly DiagnosticDescriptor s_descriptorSimplifyThisOrMe = new DiagnosticDescriptor(IDEDiagnosticIds.SimplifyThisOrMeDiagnosticId,
+ s_localizableTitleSimplifyThisOrMe,
+ s_localizableMessage,
+ DiagnosticAnalyzerCategories.RedundanciesInCode,
+ DiagnosticSeverity.Warning,
+ isEnabledByDefault: true,
+ customTags: DiagnosticCustomTags.Unnecessary);
+
+
+ public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
+ {
+ get
+ {
+ return ImmutableArray.Create(s_descriptorSimplifyNames, s_descriptorSimplifyMemberAccess, s_descriptorSimplifyThisOrMe);
+ }
+ }
+
+ protected abstract void AnalyzeNode(SyntaxNodeAnalysisContext context);
+
+ protected abstract bool CanSimplifyTypeNameExpressionCore(SemanticModel model, SyntaxNode node, OptionSet optionSet, out TextSpan issueSpan, out string diagnosticId, CancellationToken cancellationToken);
+
+ private OptionSet GetOptionSet(AnalyzerOptions analyzerOptions)
+ {
+ return TypeSystemService.Workspace.Options;
+ }
+
+ protected abstract string GetLanguageName();
+
+ protected bool TrySimplifyTypeNameExpression(SemanticModel model, SyntaxNode node, AnalyzerOptions analyzerOptions, out Diagnostic diagnostic, CancellationToken cancellationToken)
+ {
+ diagnostic = default(Diagnostic);
+
+ var optionSet = GetOptionSet(analyzerOptions);
+ string diagnosticId;
+
+ TextSpan issueSpan;
+ if (!CanSimplifyTypeNameExpressionCore(model, node, optionSet, out issueSpan, out diagnosticId, cancellationToken))
+ {
+ return false;
+ }
+
+ if (model.SyntaxTree.OverlapsHiddenPosition(issueSpan, cancellationToken))
+ {
+ return false;
+ }
+
+ DiagnosticDescriptor descriptor;
+ switch (diagnosticId)
+ {
+ case IDEDiagnosticIds.SimplifyNamesDiagnosticId:
+ descriptor = s_descriptorSimplifyNames;
+ break;
+
+ case IDEDiagnosticIds.SimplifyMemberAccessDiagnosticId:
+ descriptor = s_descriptorSimplifyMemberAccess;
+ break;
+
+ case IDEDiagnosticIds.SimplifyThisOrMeDiagnosticId:
+ descriptor = s_descriptorSimplifyThisOrMe;
+ break;
+
+ default:
+ throw new InvalidOperationException();
+ }
+
+ var tree = model.SyntaxTree;
+ diagnostic = Diagnostic.Create(descriptor, tree.GetLocation(issueSpan));
+ return true;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/AbstractTokenBraceCompletionSession.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/AbstractTokenBraceCompletionSession.cs
new file mode 100644
index 0000000000..5c49eba0b2
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/AbstractTokenBraceCompletionSession.cs
@@ -0,0 +1,162 @@
+//
+// AbstractTokenBraceCompletionSession.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide.Editor;
+using ICSharpCode.NRefactory6.CSharp;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace MonoDevelop.CSharp.Features.AutoInsertBracket
+{
+ abstract class AbstractTokenBraceCompletionSession : EditSession, ICheckPointEditSession
+ {
+ DocumentContext ctx;
+
+ public Document Document { get { return ctx.AnalysisDocument; } }
+
+ public SyntaxTree CurrentSnapshot {
+ get {
+ return ctx.AnalysisDocument.GetSyntaxTreeAsync ().Result;
+ }
+ }
+
+ protected int OpeningTokenKind { get; }
+ protected int ClosingTokenKind { get; }
+
+ readonly char closingChar;
+
+ protected AbstractTokenBraceCompletionSession (DocumentContext ctx,
+ int openingTokenKind, int closingTokenKind, char ch)
+ {
+ this.closingChar = ch;
+ this.ctx = ctx;
+ this.OpeningTokenKind = openingTokenKind;
+ this.ClosingTokenKind = closingTokenKind;
+ }
+
+ public virtual bool CheckOpeningPoint(TextEditor editor, DocumentContext ctx, CancellationToken cancellationToken)
+ {
+ var snapshot = CurrentSnapshot;
+ var position = StartOffset;
+ var token = FindToken(snapshot, position, cancellationToken);
+
+ if (!IsValidToken(token))
+ {
+ return false;
+ }
+
+ return token.RawKind == OpeningTokenKind && token.SpanStart == position;
+ }
+
+
+ protected override void OnEditorSet ()
+ {
+ this.startOffset = Editor.CaretOffset - 1;
+ this.endOffset = startOffset + 2;
+ }
+
+ public override void BeforeType (char ch, out bool handledCommand)
+ {
+ handledCommand = false;
+ if (!CheckIsValid() || ch != this.closingChar) {
+ return;
+ }
+ if (AllowOverType (default(CancellationToken))) {
+ Editor.CaretOffset++;
+ this.endOffset = this.startOffset = 0;
+ handledCommand = true;
+ Editor.EndSession ();
+ }
+ }
+
+ public override void AfterBackspace ()
+ {
+ if (Editor.CaretOffset == StartOffset) {
+ Editor.EndSession ();
+ }
+ }
+
+ public override void AfterDelete ()
+ {
+ if (Editor.CaretOffset - 1 == StartOffset) {
+ Editor.EndSession ();
+ }
+ }
+
+ protected bool IsValidToken(SyntaxToken token)
+ {
+ return token.Parent != null && !(token.Parent is SkippedTokensTriviaSyntax);
+ }
+
+ public virtual void AfterStart(CancellationToken cancellationToken)
+ {
+ }
+
+ public virtual void AfterReturn(CancellationToken cancellationToken)
+ {
+ }
+
+ public virtual bool AllowOverType(CancellationToken cancellationToken)
+ {
+ return CheckCurrentPosition(cancellationToken) && CheckClosingTokenKind(cancellationToken);
+ }
+
+ protected bool CheckClosingTokenKind(CancellationToken cancellationToken)
+ {
+ var document = Document;
+ if (document != null)
+ {
+ var root = document.GetSyntaxRootAsync(cancellationToken).WaitAndGetResult(cancellationToken);
+ var position = EndOffset;
+
+ return root.FindTokenFromEnd(position, includeZeroWidth: false, findInsideTrivia: true).RawKind == this.ClosingTokenKind;
+ }
+
+ return true;
+ }
+
+ protected bool CheckCurrentPosition(CancellationToken cancellationToken)
+ {
+ var document = Document;
+ if (document != null)
+ {
+ // make sure auto closing is called from a valid position
+ var tree = document.GetSyntaxTreeAsync(cancellationToken).WaitAndGetResult(cancellationToken);
+ return !tree.IsInNonUserCode(Editor.CaretOffset, cancellationToken);
+ }
+
+ return true;
+ }
+
+ internal static SyntaxToken FindToken (SyntaxTree snapshot, int position, CancellationToken cancellationToken)
+ {
+ var root = snapshot.GetRootAsync(cancellationToken).WaitAndGetResult(CancellationToken.None);
+ return root.FindToken(position, findInsideTrivia: true);
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/CSharpAutoInsertBracketHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/CSharpAutoInsertBracketHandler.cs
new file mode 100644
index 0000000000..9545658e62
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/CSharpAutoInsertBracketHandler.cs
@@ -0,0 +1,170 @@
+//
+// CSharpAutoInsertBracketHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Extension;
+using MonoDevelop.CSharp.Formatting;
+using MonoDevelop.Ide.TypeSystem;
+using System.Threading;
+using ICSharpCode.NRefactory6.CSharp;
+
+namespace MonoDevelop.CSharp.Features.AutoInsertBracket
+{
+ class CSharpAutoInsertBracketHandler : AutoInsertBracketHandler
+ {
+ public override bool CanHandle (TextEditor editor)
+ {
+
+ return editor.MimeType == CSharpFormatter.MimeType;
+ }
+
+ public override bool Handle (TextEditor editor, DocumentContext ctx, KeyDescriptor descriptor)
+ {
+ char closingBrace;
+ if (!IsSupportedOpeningBrace (descriptor.KeyChar, out closingBrace) || !CheckCodeContext (editor, ctx, editor.CaretOffset - 1, descriptor.KeyChar, default (CancellationToken)) || ctx.AnalysisDocument == null)
+ return false;
+
+ var session = CreateEditorSession (editor, ctx, editor.CaretOffset, descriptor.KeyChar, default (CancellationToken));
+ session.SetEditor (editor);
+ if (session == null | !((ICheckPointEditSession)session).CheckOpeningPoint (editor, ctx, default (CancellationToken)))
+ return false;
+ using (var undo = editor.OpenUndoGroup ()) {
+ editor.EnsureCaretIsNotVirtual ();
+ editor.InsertAtCaret (closingBrace.ToString ());
+ editor.CaretOffset--;
+ editor.StartSession (session);
+ }
+ return true;
+ }
+
+ protected virtual bool CheckCodeContext(TextEditor editor, DocumentContext ctx, int position, char openingBrace, CancellationToken cancellationToken)
+ {
+ // SPECIAL CASE: Allow in curly braces in string literals to support interpolated strings.
+ if (openingBrace == CurlyBrace.OpenCharacter &&
+ InterpolationCompletionSession.IsContext(editor, ctx, position, cancellationToken))
+ {
+ return true;
+ }
+
+ if (openingBrace == DoubleQuote.OpenCharacter &&
+ InterpolatedStringCompletionSession.IsContext(editor, ctx, position, cancellationToken))
+ {
+ return true;
+ }
+
+ // check that the user is not typing in a string literal or comment
+ var tree = ctx.AnalysisDocument.GetSyntaxTreeAsync(cancellationToken).Result;
+
+ return !tree.IsInNonUserCode(position, cancellationToken);
+ }
+
+ EditSession CreateEditorSession(TextEditor editor, DocumentContext ctx, int openingPosition, char openingBrace, CancellationToken cancellationToken)
+ {
+ switch (openingBrace)
+ {
+ case CurlyBrace.OpenCharacter:
+ return InterpolationCompletionSession.IsContext(editor, ctx, openingPosition, cancellationToken)
+ ? (EditSession)new InterpolationCompletionSession()
+ : new CurlyBraceCompletionSession(ctx);
+
+ case DoubleQuote.OpenCharacter:
+ return InterpolatedStringCompletionSession.IsContext(editor, ctx, openingPosition, cancellationToken)
+ ? (EditSession)new InterpolatedStringCompletionSession()
+ : new StringLiteralCompletionSession(ctx);
+
+ case Bracket.OpenCharacter: return new BracketCompletionSession(ctx);
+ case Parenthesis.OpenCharacter: return new ParenthesisCompletionSession(ctx);
+ case SingleQuote.OpenCharacter: return new CharLiteralCompletionSession(ctx);
+ case LessAndGreaterThan.OpenCharacter: return new LessAndGreaterThanCompletionSession(ctx);
+ }
+
+ return null;
+ }
+
+
+ protected bool IsSupportedOpeningBrace (char openingBrace, out char closingBrace)
+ {
+ switch (openingBrace) {
+ case Bracket.OpenCharacter:
+ closingBrace = Bracket.CloseCharacter;
+ return true;
+ case CurlyBrace.OpenCharacter:
+ closingBrace = CurlyBrace.CloseCharacter;
+ return true;
+ case Parenthesis.OpenCharacter:
+ closingBrace = Parenthesis.CloseCharacter;
+ return true;
+ case SingleQuote.OpenCharacter:
+ closingBrace = SingleQuote.CloseCharacter;
+ return true;
+ case DoubleQuote.OpenCharacter:
+ closingBrace = DoubleQuote.CloseCharacter;
+ return true;
+ case LessAndGreaterThan.OpenCharacter:
+ closingBrace = LessAndGreaterThan.CloseCharacter;
+ return true;
+ }
+ closingBrace = openingBrace;
+ return false;
+ }
+
+ static class CurlyBrace
+ {
+ public const char OpenCharacter = '{';
+ public const char CloseCharacter = '}';
+ }
+
+ static class Parenthesis
+ {
+ public const char OpenCharacter = '(';
+ public const char CloseCharacter = ')';
+ }
+
+ static class Bracket
+ {
+ public const char OpenCharacter = '[';
+ public const char CloseCharacter = ']';
+ }
+
+ static class LessAndGreaterThan
+ {
+ public const char OpenCharacter = '<';
+ public const char CloseCharacter = '>';
+ }
+
+ static class DoubleQuote
+ {
+ public const char OpenCharacter = '"';
+ public const char CloseCharacter = '"';
+ }
+
+ static class SingleQuote
+ {
+ public const char OpenCharacter = '\'';
+ public const char CloseCharacter = '\'';
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/BracketCompletionSession.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/BracketCompletionSession.cs
new file mode 100644
index 0000000000..97d1fe479d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/BracketCompletionSession.cs
@@ -0,0 +1,42 @@
+//
+// BracketCompletionSession.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis.CSharp;
+using MonoDevelop.Ide.Editor;
+
+namespace MonoDevelop.CSharp.Features.AutoInsertBracket
+{
+ class BracketCompletionSession : AbstractTokenBraceCompletionSession
+ {
+
+ public BracketCompletionSession(DocumentContext ctx)
+ : base(ctx, (int)SyntaxKind.OpenBracketToken, (int)SyntaxKind.CloseBracketToken, ']')
+ {
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/CharLiteralCompletionSession.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/CharLiteralCompletionSession.cs
new file mode 100644
index 0000000000..cb92a393d8
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/CharLiteralCompletionSession.cs
@@ -0,0 +1,47 @@
+//
+// CharLiteralCompletionSession.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp;
+using MonoDevelop.Ide.Editor;
+
+namespace MonoDevelop.CSharp.Features.AutoInsertBracket
+{
+ class CharLiteralCompletionSession : AbstractTokenBraceCompletionSession
+ {
+ public CharLiteralCompletionSession(DocumentContext ctx)
+ : base(ctx, (int)SyntaxKind.CharacterLiteralToken, (int)SyntaxKind.CharacterLiteralToken, '\'')
+ {
+ }
+
+ public override bool AllowOverType(CancellationToken cancellationToken)
+ {
+ return true;
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/CurlyBraceCompletionSession.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/CurlyBraceCompletionSession.cs
new file mode 100644
index 0000000000..9eda90679b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/CurlyBraceCompletionSession.cs
@@ -0,0 +1,40 @@
+//
+// CurlyBraceCompletionSession.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using Microsoft.CodeAnalysis.CSharp;
+using MonoDevelop.Ide.Editor;
+
+namespace MonoDevelop.CSharp.Features.AutoInsertBracket
+{
+ internal class CurlyBraceCompletionSession : AbstractTokenBraceCompletionSession
+ {
+ public CurlyBraceCompletionSession(DocumentContext ctx)
+ : base(ctx, (int)SyntaxKind.OpenBraceToken, (int)SyntaxKind.CloseBraceToken, '}')
+ {
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/InterpolatedStringCompletionSession.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/InterpolatedStringCompletionSession.cs
new file mode 100644
index 0000000000..fc9b086324
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/InterpolatedStringCompletionSession.cs
@@ -0,0 +1,86 @@
+//
+// InterpolatedStringCompletionSession.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Roslyn.Utilities;
+using MonoDevelop.Ide.Editor;
+using ICSharpCode.NRefactory6.CSharp;
+
+namespace MonoDevelop.CSharp.Features.AutoInsertBracket
+{
+ internal class InterpolatedStringCompletionSession : SkipCharSession, ICheckPointEditSession
+ {
+ public InterpolatedStringCompletionSession() : base ('"')
+ {
+ }
+
+ public bool CheckOpeningPoint(TextEditor editor, DocumentContext ctx, CancellationToken cancellationToken)
+ {
+ var snapshot = ctx.AnalysisDocument.GetSyntaxTreeAsync (cancellationToken).WaitAndGetResult(cancellationToken);
+ var position = editor.CaretOffset - 1;
+ var token = AbstractTokenBraceCompletionSession.FindToken(snapshot, position, cancellationToken);
+
+ return token.IsKind(SyntaxKind.InterpolatedStringStartToken, SyntaxKind.InterpolatedVerbatimStringStartToken)
+ && token.Span.End - 1 == position;
+ }
+
+ public static bool IsContext(TextEditor editor, DocumentContext ctx, int position, CancellationToken cancellationToken)
+ {
+ // Check to see if we're to the right of an $ or an @$
+ var start = position - 1;
+ if (start < 0)
+ {
+ return false;
+ }
+
+ if (editor[start] == '@')
+ {
+ start--;
+
+ if (start < 0)
+ {
+ return false;
+ }
+ }
+
+ if (editor[start] != '$')
+ {
+ return false;
+ }
+
+ var tree = ctx.AnalysisDocument.GetSyntaxTreeAsync (cancellationToken).WaitAndGetResult(cancellationToken);
+ var token = tree.GetRoot(cancellationToken).FindTokenOnLeftOfPosition(start);
+
+ return tree.IsExpressionContext(start, token, attributes: false, cancellationToken: cancellationToken)
+ || tree.IsStatementContext(start, token, cancellationToken);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/InterpolationCompletionSession.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/InterpolationCompletionSession.cs
new file mode 100644
index 0000000000..b39b9e42cd
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/InterpolationCompletionSession.cs
@@ -0,0 +1,100 @@
+//
+// InterpolationCompletionSession.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using MonoDevelop.Ide.Editor;
+using Roslyn.Utilities;
+
+namespace MonoDevelop.CSharp.Features.AutoInsertBracket
+{
+ interface ICheckPointEditSession
+ {
+ bool CheckOpeningPoint (TextEditor editor, DocumentContext ctx, CancellationToken cancellationToken);
+ }
+
+ internal class InterpolationCompletionSession : SkipCharSession, ICheckPointEditSession
+ {
+ public InterpolationCompletionSession() : base('}')
+ {
+ }
+
+ public bool CheckOpeningPoint(TextEditor editor, DocumentContext ctx, CancellationToken cancellationToken)
+ {
+ var snapshot = ctx.AnalysisDocument.GetSyntaxTreeAsync (cancellationToken).WaitAndGetResult(cancellationToken);
+ var position = editor.CaretOffset - 1;
+ var token = AbstractTokenBraceCompletionSession.FindToken(snapshot, position, cancellationToken);
+
+ return token.IsKind(SyntaxKind.OpenBraceToken)
+ && token.SpanStart == position;
+ }
+
+ public static bool IsContext(TextEditor editor, DocumentContext ctx, int position, CancellationToken cancellationToken)
+ {
+ // First, check to see if the character to the left of the position is an open curly. If it is,
+ // we shouldn't complete because the user may be trying to escape a curly.
+ var index = position - 1;
+ var openCurlyCount = 0;
+ while (index >= 0)
+ {
+ if (editor[index] == '{')
+ {
+ openCurlyCount++;
+ }
+ else
+ {
+ break;
+ }
+
+ index--;
+ }
+
+ if (openCurlyCount > 0 && openCurlyCount % 2 == 1)
+ {
+ return false;
+ }
+
+ // Next, check to see if we're typing in an interpolated string
+ var tree = ctx.AnalysisDocument.GetSyntaxTreeAsync(cancellationToken).WaitAndGetResult(cancellationToken);
+ var token = tree.GetRoot(cancellationToken).FindTokenOnLeftOfPosition(position);
+
+ if (!token.Span.IntersectsWith(position))
+ {
+ return false;
+ }
+
+ return token.IsKind(
+ SyntaxKind.InterpolatedStringStartToken,
+ SyntaxKind.InterpolatedVerbatimStringStartToken,
+ SyntaxKind.InterpolatedStringTextToken,
+ SyntaxKind.InterpolatedStringEndToken);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/LessAndGreaterThanCompletionSession.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/LessAndGreaterThanCompletionSession.cs
new file mode 100644
index 0000000000..370e6d9599
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/LessAndGreaterThanCompletionSession.cs
@@ -0,0 +1,114 @@
+//
+// LessAndGreaterThanCompletionSession.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Linq;
+using System.Threading;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Ide.Editor;
+using Roslyn.Utilities;
+
+namespace MonoDevelop.CSharp.Features.AutoInsertBracket
+{
+ internal class LessAndGreaterThanCompletionSession : AbstractTokenBraceCompletionSession, ICheckPointEditSession
+ {
+ public LessAndGreaterThanCompletionSession(DocumentContext ctx)
+ : base(ctx, (int)SyntaxKind.LessThanToken, (int)SyntaxKind.GreaterThanToken, '>')
+ {
+ }
+
+ public override bool CheckOpeningPoint(TextEditor editor, DocumentContext ctx, CancellationToken cancellationToken)
+ {
+ var snapshot = CurrentSnapshot;
+ var position = StartOffset;
+ var token = FindToken(snapshot, position, cancellationToken);
+
+ // check what parser thinks about the newly typed "<" and only proceed if parser thinks it is "<" of
+ // type argument or parameter list
+ if (!token.CheckParent<TypeParameterListSyntax>(n => n.LessThanToken == token) &&
+ !token.CheckParent<TypeArgumentListSyntax>(n => n.LessThanToken == token) &&
+ !PossibleTypeArgument(token, cancellationToken))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ private bool PossibleTypeArgument(SyntaxToken token, CancellationToken cancellationToken)
+ {
+ var node = token.Parent as BinaryExpressionSyntax;
+
+ // type argument can be easily ambiguous with normal < operations
+ if (node == null || node.Kind() != SyntaxKind.LessThanExpression || node.OperatorToken != token)
+ {
+ return false;
+ }
+
+ // use binding to see whether it is actually generic type or method
+ var document = Document;
+ if (document == null)
+ {
+ return false;
+ }
+
+ var model = document.GetSemanticModelAsync(cancellationToken).WaitAndGetResult(cancellationToken);
+
+ // Analyze node on the left of < operator to verify if it is a generic type or method.
+ var leftNode = node.Left;
+ if (leftNode is ConditionalAccessExpressionSyntax)
+ {
+ // If node on the left is a conditional access expression, get the member binding expression
+ // from the innermost conditional access expression, which is the left of < operator.
+ // e.g: Case a?.b?.c< : we need to get the conditional access expression .b?.c and analyze its
+ // member binding expression (the .c) to see if it is a generic type/method.
+ // Case a?.b?.c.d< : we need to analyze .c.d
+ // Case a?.M(x => x?.P)?.M2< : We need to analyze .M2
+ leftNode = leftNode.GetInnerMostConditionalAccessExpression().WhenNotNull;
+ }
+
+ var info = model.GetSymbolInfo(leftNode, cancellationToken);
+ return info.CandidateSymbols.Any(IsGenericTypeOrMethod);
+ }
+
+ private static bool IsGenericTypeOrMethod(ISymbol symbol)
+ {
+ return symbol.GetArity() > 0;
+ }
+
+ public override bool AllowOverType(CancellationToken cancellationToken)
+ {
+ return CheckCurrentPosition(cancellationToken);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/ParenthesisCompletionSession.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/ParenthesisCompletionSession.cs
new file mode 100644
index 0000000000..67fa048129
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/ParenthesisCompletionSession.cs
@@ -0,0 +1,70 @@
+//
+// ParenthesisCompletionSession.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using MonoDevelop.Ide.Editor;
+
+namespace MonoDevelop.CSharp.Features.AutoInsertBracket
+{
+ internal class ParenthesisCompletionSession : AbstractTokenBraceCompletionSession
+ {
+ public ParenthesisCompletionSession(DocumentContext ctx)
+ : base(ctx, (int)SyntaxKind.OpenParenToken, (int)SyntaxKind.CloseParenToken, ')')
+ {
+ }
+
+ public override bool CheckOpeningPoint(TextEditor editor, DocumentContext ctx, CancellationToken cancellationToken)
+ {
+ var snapshot = CurrentSnapshot;
+ var position = StartOffset;
+ var token = FindToken(snapshot, position, cancellationToken);
+
+ // check token at the opening point first
+ if (!IsValidToken(token) ||
+ token.RawKind != OpeningTokenKind ||
+ token.SpanStart != position || token.Parent == null)
+ {
+ return false;
+ }
+
+ // now check whether parser think whether there is already counterpart closing parenthesis
+ var pair = token.Parent.GetParentheses();
+
+ // if pair is on the same line, then the closing parenthesis must belong to other tracker.
+ // let it through
+ if (Editor.GetLineByOffset (pair.Item1.SpanStart).LineNumber == Editor.GetLineByOffset(pair.Item2.Span.End).LineNumber)
+ {
+ return true;
+ }
+
+ return (int)pair.Item2.Kind() != ClosingTokenKind || pair.Item2.Span.Length == 0;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/StringLiteralCompletionSession.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/StringLiteralCompletionSession.cs
new file mode 100644
index 0000000000..f8a7ab4bd2
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/AutoInsertBracket/Sessions/StringLiteralCompletionSession.cs
@@ -0,0 +1,68 @@
+//
+// StringLiteralCompletionSession.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp;
+using MonoDevelop.Ide.Editor;
+
+namespace MonoDevelop.CSharp.Features.AutoInsertBracket
+{
+ internal class StringLiteralCompletionSession : AbstractTokenBraceCompletionSession
+ {
+ private const char VerbatimStringPrefix = '@';
+
+ public StringLiteralCompletionSession(DocumentContext ctx)
+ : base(ctx, (int)SyntaxKind.StringLiteralToken, (int)SyntaxKind.StringLiteralToken, '\"')
+ {
+ }
+
+ public override bool CheckOpeningPoint(TextEditor editor, DocumentContext ctx, CancellationToken cancellationToken)
+ {
+ var snapshot = CurrentSnapshot;
+ var position = StartOffset;
+ var token = FindToken(snapshot, position, cancellationToken);
+
+ if (!IsValidToken(token) || token.RawKind != OpeningTokenKind)
+ {
+ return false;
+ }
+
+ if (token.SpanStart == position)
+ {
+ return true;
+ }
+
+ return token.SpanStart + 1 == position && Editor.GetCharAt (token.SpanStart) == VerbatimStringPrefix;
+ }
+
+ public override bool AllowOverType(CancellationToken cancellationToken)
+ {
+ return true;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CSharpCodeGenerationService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CSharpCodeGenerationService.cs
new file mode 100644
index 0000000000..e12162dfa5
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CSharpCodeGenerationService.cs
@@ -0,0 +1,330 @@
+//
+// CSharpCodeGenerationService.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis;
+using System.Threading;
+using System.Reflection;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Runtime.ExceptionServices;
+
+namespace ICSharpCode.NRefactory6.CSharp.CodeGeneration
+{
+ class CSharpCodeGenerationService
+ {
+ readonly static Type typeInfo;
+ readonly object instance;
+
+ readonly static MethodInfo createEventDeclarationMethod;
+ readonly static MethodInfo createFieldDeclaration;
+ readonly static MethodInfo createMethodDeclaration;
+ readonly static MethodInfo createPropertyDeclaration;
+ readonly static MethodInfo createNamedTypeDeclaration;
+ readonly static MethodInfo createNamespaceDeclaration;
+ readonly static MethodInfo addMethodAsync;
+ readonly static MethodInfo addMembersAsync;
+
+ readonly static MethodInfo canAddTo1, canAddTo2;
+
+ static CSharpCodeGenerationService ()
+ {
+ var abstractServiceType = Type.GetType ("Microsoft.CodeAnalysis.CodeGeneration.AbstractCodeGenerationService" + ReflectionNamespaces.WorkspacesAsmName, true);
+ var codeGenerationDestinationType = Type.GetType ("Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationDestination" + ReflectionNamespaces.WorkspacesAsmName, true);
+ var codeGenerationOptionsType = Type.GetType ("Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationOptions" + ReflectionNamespaces.WorkspacesAsmName, true);
+
+
+
+
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.CSharp.CodeGeneration.CSharpCodeGenerationService" + ReflectionNamespaces.CSWorkspacesAsmName, true);
+ //TDeclarationNode destination, IMethodSymbol method, CodeGenerationOptions options = null, CancellationToken cancellationToken = default(CancellationToken)
+
+
+ addMethod = typeInfo.GetMethods ().Single (m =>
+ m.Name == "AddMethod" &&
+ m.GetParameters ().Count () == 4);
+ if (addMethod == null)
+ throw new InvalidOperationException ("AddMethod not found.");
+
+ createEventDeclarationMethod = typeInfo.GetMethod ("CreateEventDeclaration", BindingFlags.Instance | BindingFlags.Public, null, new [] { typeof(IEventSymbol), codeGenerationDestinationType, codeGenerationOptionsType }, null);
+ if (createEventDeclarationMethod == null)
+ throw new InvalidOperationException ("CreateEventDeclaration not found.");
+
+ createFieldDeclaration = typeInfo.GetMethod ("CreateFieldDeclaration", BindingFlags.Instance | BindingFlags.Public, null, new [] { typeof(IFieldSymbol), codeGenerationDestinationType, codeGenerationOptionsType }, null);
+ if (createFieldDeclaration == null)
+ throw new InvalidOperationException ("CreateFieldDeclaration not found.");
+
+ createMethodDeclaration = typeInfo.GetMethod ("CreateMethodDeclaration", BindingFlags.Instance | BindingFlags.Public, null, new [] { typeof(IMethodSymbol), codeGenerationDestinationType, codeGenerationOptionsType }, null);
+ if (createMethodDeclaration == null)
+ throw new InvalidOperationException ("CreateMethodDeclaration not found.");
+
+ createPropertyDeclaration = typeInfo.GetMethod ("CreatePropertyDeclaration", BindingFlags.Instance | BindingFlags.Public, null, new [] { typeof(IPropertySymbol), codeGenerationDestinationType, codeGenerationOptionsType }, null);
+ if (createPropertyDeclaration == null)
+ throw new InvalidOperationException ("CreatePropertyDeclaration not found.");
+
+ createNamedTypeDeclaration = typeInfo.GetMethod ("CreateNamedTypeDeclaration", BindingFlags.Instance | BindingFlags.Public, null, new [] { typeof(INamedTypeSymbol), codeGenerationDestinationType, codeGenerationOptionsType, typeof(CancellationToken) }, null);
+ if (createNamedTypeDeclaration == null)
+ throw new InvalidOperationException ("CreateNamedTypeDeclaration not found.");
+
+ createNamespaceDeclaration = typeInfo.GetMethod ("CreateNamespaceDeclaration", BindingFlags.Instance | BindingFlags.Public, null, new [] { typeof(INamespaceSymbol), codeGenerationDestinationType, codeGenerationOptionsType, typeof(CancellationToken) }, null);
+ if (createNamespaceDeclaration == null)
+ throw new InvalidOperationException ("CreateNamespaceDeclaration not found.");
+
+ addMethodAsync = abstractServiceType.GetMethod ("AddMethodAsync", BindingFlags.Instance | BindingFlags.Public);
+ if (addMethodAsync == null)
+ throw new InvalidOperationException ("AddMethodAsync not found.");
+ addPropertyAsync = abstractServiceType.GetMethod ("AddPropertyAsync", BindingFlags.Instance | BindingFlags.Public);
+ if (addPropertyAsync == null)
+ throw new InvalidOperationException ("AddPropertyAsync not found.");
+
+
+
+ addMembersAsync = abstractServiceType.GetMethod ("AddMembersAsync", BindingFlags.Instance | BindingFlags.Public, null, new [] { typeof(Solution), typeof(INamedTypeSymbol), typeof(IEnumerable<ISymbol>), CodeGenerationOptions.typeInfo, typeof(CancellationToken) }, null);
+ if (addMembersAsync == null)
+ throw new InvalidOperationException ("AddMembersAsync not found.");
+
+ canAddTo1 = typeInfo.GetMethod ("CanAddTo", new [] {typeof(ISymbol), typeof(Solution), typeof(CancellationToken) });
+ if (canAddTo1 == null)
+ throw new InvalidOperationException ("CanAddTo1 not found.");
+
+ canAddTo2 = typeInfo.GetMethod ("CanAddTo", new [] {typeof(SyntaxNode), typeof(Solution), typeof(CancellationToken) });
+ if (canAddTo2 == null)
+ throw new InvalidOperationException ("CanAddTo1 not found.");
+
+ addFieldAsync = abstractServiceType.GetMethod ("AddFieldAsync", BindingFlags.Instance | BindingFlags.Public, null, new [] { typeof(Solution), typeof(INamedTypeSymbol), typeof(IFieldSymbol), CodeGenerationOptions.typeInfo, typeof(CancellationToken) }, null);
+ if (addFieldAsync == null)
+ throw new InvalidOperationException ("AddFieldAsync not found.");
+
+ addStatements = typeInfo.GetMethod ("AddStatements", BindingFlags.Instance | BindingFlags.Public);
+ if (addStatements == null)
+ throw new InvalidOperationException ("AddStatements not found.");
+
+ }
+
+ public CSharpCodeGenerationService(HostLanguageServices languageServices)
+ {
+ instance = Activator.CreateInstance (typeInfo, new object[] {
+ languageServices
+ });
+ }
+
+ public CSharpCodeGenerationService (Workspace workspace, string language)
+ {
+ var languageService = workspace.Services.GetLanguageServices (language);
+
+ this.instance = Activator.CreateInstance (typeInfo, new [] { languageService });
+ }
+
+ public CSharpCodeGenerationService (Workspace workspace) : this (workspace, LanguageNames.CSharp)
+ {
+ }
+
+ static MethodInfo addStatements;
+ public TDeclarationNode AddStatements<TDeclarationNode>(
+ TDeclarationNode destinationMember,
+ IEnumerable<SyntaxNode> statements,
+ CodeGenerationOptions options,
+ CancellationToken cancellationToken)
+ {
+ try {
+ return (TDeclarationNode)addStatements.MakeGenericMethod (typeof (TDeclarationNode)).Invoke (instance, new object[] { destinationMember, statements, options != null ? options.Instance : null, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return default(TDeclarationNode);
+ }
+ }
+
+ static MethodInfo addMethod;
+
+ /// <summary>
+ /// Adds a method into destination.
+ /// </summary>
+ public TDeclarationNode AddMethod<TDeclarationNode>(TDeclarationNode destination, IMethodSymbol method, CodeGenerationOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) where TDeclarationNode : SyntaxNode
+ {
+ try {
+ return (TDeclarationNode)addMethod.MakeGenericMethod (typeof (TDeclarationNode)).Invoke (instance, new object[] { destination, method, options != null ? options.Instance : null, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return default (TDeclarationNode);
+ }
+ }
+
+
+ /// <summary>
+ /// Returns a newly created event declaration node from the provided event.
+ /// </summary>
+ public SyntaxNode CreateEventDeclaration(IEventSymbol @event, CodeGenerationDestination destination = CodeGenerationDestination.Unspecified)
+ {
+ try {
+ return (SyntaxNode)createEventDeclarationMethod.Invoke (instance, new object[] { @event, (int)destination, null });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// Returns a newly created field declaration node from the provided field.
+ /// </summary>
+ public SyntaxNode CreateFieldDeclaration(IFieldSymbol field, CodeGenerationDestination destination = CodeGenerationDestination.Unspecified)
+ {
+ try {
+ return (SyntaxNode)createFieldDeclaration.Invoke (instance, new object[] { @field, (int)destination, null });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// Returns a newly created method declaration node from the provided method.
+ /// </summary>
+ public SyntaxNode CreateMethodDeclaration(IMethodSymbol method, CodeGenerationDestination destination = CodeGenerationDestination.Unspecified)
+ {
+ try {
+ return (SyntaxNode)createMethodDeclaration.Invoke (instance, new object[] { @method, (int)destination, null });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// Returns a newly created property declaration node from the provided property.
+ /// </summary>
+ public SyntaxNode CreatePropertyDeclaration(IPropertySymbol property, CodeGenerationDestination destination = CodeGenerationDestination.Unspecified)
+ {
+ try {
+ return (SyntaxNode)createPropertyDeclaration.Invoke (instance, new object[] { @property, (int)destination, null });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// Returns a newly created named type declaration node from the provided named type.
+ /// </summary>
+ public SyntaxNode CreateNamedTypeDeclaration(INamedTypeSymbol namedType, CodeGenerationDestination destination, CodeGenerationOptions options, CancellationToken cancellationToken)
+ {
+ try {
+ return (SyntaxNode)createNamedTypeDeclaration.Invoke (instance, new object[] { @namedType, destination, options != null ? options.Instance : null, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// Returns a newly created namespace declaration node from the provided namespace.
+ /// </summary>
+ public SyntaxNode CreateNamespaceDeclaration(INamespaceSymbol @namespace, CodeGenerationDestination destination, CodeGenerationOptions options, CancellationToken cancellationToken)
+ {
+ try {
+ return (SyntaxNode)createNamespaceDeclaration.Invoke (instance, new object[] { @namespace, (int)destination, options != null ? options.Instance : null, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ public Task<Document> AddMethodAsync(Solution solution, INamedTypeSymbol destination, IMethodSymbol method, CodeGenerationOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ try {
+ return (Task<Document>)addMethodAsync.Invoke (instance, new object[] { solution, destination, method, options != null ? options.Instance : null, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ public Task<Document> AddPropertyAsync(Solution solution, INamedTypeSymbol destination, IPropertySymbol property, CodeGenerationOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ try {
+ return (Task<Document>)addPropertyAsync.Invoke (instance, new object[] { solution, destination, property, options != null ? options.Instance : null, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// Adds all the provided members into destination.
+ /// </summary>
+ public Task<Document> AddMembersAsync(Solution solution, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CodeGenerationOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ try {
+ return (Task<Document>)addMembersAsync.Invoke (instance, new object[] { solution, destination, members, options != null ? options.Instance : null, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ static MethodInfo addFieldAsync;
+ static MethodInfo addPropertyAsync;
+
+ public Task<Document> AddFieldAsync(Solution solution, INamedTypeSymbol destination, IFieldSymbol field, CodeGenerationOptions options, CancellationToken cancellationToken)
+ {
+ try {
+ return (Task<Document>)addFieldAsync.Invoke (instance, new object[] { solution, destination, field, options != null ? options.Instance : null, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+
+ /// <summary>
+ /// <c>true</c> if destination is a location where other symbols can be added to.
+ /// </summary>
+ public bool CanAddTo(ISymbol destination, Solution solution, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ try {
+ return (bool)canAddTo1.Invoke (instance, new object[] { destination, solution, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+
+ /// <summary>
+ /// <c>true</c> if destination is a location where other symbols can be added to.
+ /// </summary>
+ public bool CanAddTo(SyntaxNode destination, Solution solution, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ try {
+ return (bool)canAddTo2.Invoke (instance, new object[] { destination, solution, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CodeGenerationDestination.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CodeGenerationDestination.cs
new file mode 100644
index 0000000000..95d22e070f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CodeGenerationDestination.cs
@@ -0,0 +1,47 @@
+//
+// CodeGenerationDestination.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis;
+using System.Threading;
+using System.Reflection;
+
+namespace ICSharpCode.NRefactory6.CSharp.CodeGeneration
+{
+ enum CodeGenerationDestination
+ {
+ Unspecified = 0,
+ CompilationUnit = 1,
+ Namespace = 2,
+ ClassType = 3,
+ EnumType = 4,
+ InterfaceType = 5,
+ ModuleType = 6,
+ StructType = 7,
+ }
+
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CodeGenerationHelpers.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CodeGenerationHelpers.cs
new file mode 100644
index 0000000000..8e0673457f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CodeGenerationHelpers.cs
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.Editing;
+using Microsoft.CodeAnalysis.Formatting;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.CodeGeneration
+{
+ static class CodeGenerationHelpers
+ {
+ public static SyntaxNode GenerateThrowStatement(
+ SyntaxGenerator factory,
+ SemanticDocument document,
+ string exceptionMetadataName,
+ CancellationToken cancellationToken)
+ {
+ var compilation = document.SemanticModel.Compilation;
+ var exceptionType = compilation.GetTypeByMetadataName(exceptionMetadataName);
+
+ // If we can't find the Exception, we obviously can't generate anything.
+ if (exceptionType == null)
+ {
+ return null;
+ }
+
+ var exceptionCreationExpression = factory.ObjectCreationExpression(
+ exceptionType,
+ SpecializedCollections.EmptyList<SyntaxNode>());
+
+ return factory.ThrowStatement(exceptionCreationExpression);
+ }
+
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CodeGenerationOptions.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CodeGenerationOptions.cs
new file mode 100644
index 0000000000..e534a4e64b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CodeGenerationOptions.cs
@@ -0,0 +1,61 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp.CodeGeneration
+{
+ class CodeGenerationOptions
+ {
+ internal readonly static Type typeInfo;
+ readonly object instance;
+
+ internal object Instance {
+ get {
+ return instance;
+ }
+ }
+
+ static CodeGenerationOptions ()
+ {
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationOptions" + ReflectionNamespaces.WorkspacesAsmName, true);
+ }
+
+ public CodeGenerationOptions(
+ Location contextLocation = null,
+ Location afterThisLocation = null,
+ Location beforeThisLocation = null,
+ bool addImports = true,
+ bool placeSystemNamespaceFirst = true,
+ IEnumerable<INamespaceSymbol> additionalImports = null,
+ bool generateMembers = true,
+ bool mergeNestedNamespaces = true,
+ bool mergeAttributes = true,
+ bool generateDefaultAccessibility = true,
+ bool generateMethodBodies = true,
+ bool generateDocumentationComments = false,
+ bool autoInsertionLocation = true,
+ bool reuseSyntax = false)
+ {
+ instance = Activator.CreateInstance (typeInfo, new object[] {
+ contextLocation,
+ afterThisLocation,
+ beforeThisLocation,
+ addImports,
+ placeSystemNamespaceFirst,
+ additionalImports,
+ generateMembers,
+ mergeNestedNamespaces,
+ mergeAttributes,
+ generateDefaultAccessibility,
+ generateMethodBodies,
+ generateDocumentationComments,
+ autoInsertionLocation,
+ reuseSyntax
+ });
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CodeGenerationTypeParameterSymbol.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CodeGenerationTypeParameterSymbol.cs
new file mode 100644
index 0000000000..bc61fce570
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CodeGenerationTypeParameterSymbol.cs
@@ -0,0 +1,89 @@
+//
+// CodeGenerationTypeParameterSymbol.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ class CodeGenerationTypeParameterSymbol
+ {
+ readonly static Type typeInfo;
+ readonly object instance;
+
+ internal object Instance {
+ get {
+ return instance;
+ }
+ }
+
+ readonly static System.Reflection.PropertyInfo constraintTypesProperty;
+ public ImmutableArray<ITypeSymbol> ConstraintTypes {
+ get {
+ return (ImmutableArray<ITypeSymbol>)constraintTypesProperty.GetValue (instance);
+ }
+ internal set {
+ constraintTypesProperty.SetValue (instance, value);
+ }
+ }
+
+
+ static CodeGenerationTypeParameterSymbol ()
+ {
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationTypeParameterSymbol" + ReflectionNamespaces.WorkspacesAsmName, true);
+ constraintTypesProperty = typeInfo.GetProperty ("ConstraintTypes");
+ }
+
+ public CodeGenerationTypeParameterSymbol(
+ INamedTypeSymbol containingType,
+ IList<AttributeData> attributes,
+ VarianceKind varianceKind,
+ string name,
+ ImmutableArray<ITypeSymbol> constraintTypes,
+ bool hasConstructorConstraint,
+ bool hasReferenceConstraint,
+ bool hasValueConstraint,
+ int ordinal)
+ {
+ instance = Activator.CreateInstance (typeInfo, new object[] {
+ containingType,
+ attributes,
+ varianceKind,
+ name,
+ constraintTypes,
+ hasConstructorConstraint,
+ hasReferenceConstraint,
+ hasValueConstraint,
+ ordinal
+ });
+ }
+
+
+
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CodeGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CodeGenerator.cs
new file mode 100644
index 0000000000..0c31f9024a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/CodeGenerator.cs
@@ -0,0 +1,137 @@
+//
+// CodeGenerator.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp.CodeGeneration;
+using System.Reflection;
+using System.Threading;
+using System.Collections.Generic;
+using System.Runtime.ExceptionServices;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ #if NR6
+ public
+ #endif
+ static class CodeGenerator
+ {
+ readonly static Type typeInfo;
+
+ static CodeGenerator ()
+ {
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.CodeGeneration.CodeGenerator" + ReflectionNamespaces.WorkspacesAsmName, true);
+ addPropertyDeclarationAsyncMethod = typeInfo.GetMethod ("AddPropertyDeclarationAsync", BindingFlags.Static | BindingFlags.Public);
+ addMethodDeclarationAsyncMethod = typeInfo.GetMethod ("AddMethodDeclarationAsync", BindingFlags.Static | BindingFlags.Public);
+ addFieldDeclarationAsyncMethod = typeInfo.GetMethod ("AddFieldDeclarationAsync", BindingFlags.Static | BindingFlags.Public);
+ addNamespaceOrTypeDeclarationAsyncMethod = typeInfo.GetMethod ("AddNamespaceOrTypeDeclarationAsync", BindingFlags.Static | BindingFlags.Public);
+ addNamedTypeDeclarationAsyncMethod1 = typeInfo.GetMethod ("AddNamedTypeDeclarationAsync", new [] { typeof(Solution), typeof(INamedTypeSymbol), typeof(INamedTypeSymbol), CodeGenerationOptions.typeInfo, typeof(CancellationToken) });
+ addNamedTypeDeclarationAsyncMethod2 = typeInfo.GetMethod ("AddNamedTypeDeclarationAsync", new [] { typeof(Solution), typeof(INamespaceSymbol), typeof(INamedTypeSymbol), CodeGenerationOptions.typeInfo, typeof(CancellationToken) });
+ }
+
+ static MethodInfo addNamedTypeDeclarationAsyncMethod1;
+
+ public static Task<Document> AddNamedTypeDeclarationAsync(Solution solution, INamedTypeSymbol destination, INamedTypeSymbol namedType, CodeGenerationOptions options = default(CodeGenerationOptions), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ try {
+ return (Task<Document>)addNamedTypeDeclarationAsyncMethod1.Invoke (null, new object[] { solution, destination, namedType, options != null ? options.Instance : null, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ static MethodInfo addNamedTypeDeclarationAsyncMethod2;
+ public static Task<Document> AddNamedTypeDeclarationAsync(Solution solution, INamespaceSymbol destination, INamedTypeSymbol namedType, CodeGenerationOptions options = default(CodeGenerationOptions), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ try {
+ return (Task<Document>)addNamedTypeDeclarationAsyncMethod2.Invoke (null, new object[] { solution, destination, namedType, options != null ? options.Instance : null, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ static MethodInfo addNamespaceOrTypeDeclarationAsyncMethod;
+
+ public static Task<Document> AddNamespaceOrTypeDeclarationAsync(Solution solution, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CodeGenerationOptions options = default(CodeGenerationOptions), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ try {
+ return (Task<Document>)addNamespaceOrTypeDeclarationAsyncMethod.Invoke (null, new object[] { solution, destination, namespaceOrType, options != null ? options.Instance : null, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+
+ readonly static MethodInfo addFieldDeclarationAsyncMethod;
+
+ public static Task<Document> AddFieldDeclarationAsync(Solution solution, INamedTypeSymbol destination, IFieldSymbol field, CodeGenerationOptions options = default(CodeGenerationOptions), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ try {
+ return (Task<Document>)addFieldDeclarationAsyncMethod.Invoke (null, new object[] { solution, destination, field, options != null ? options.Instance : null, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+
+ readonly static MethodInfo addPropertyDeclarationAsyncMethod;
+ public static Task<Document> AddPropertyDeclarationAsync(Solution solution, INamedTypeSymbol destination, IPropertySymbol property, CodeGenerationOptions options = default(CodeGenerationOptions), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ try {
+ return (Task<Document>)addPropertyDeclarationAsyncMethod.Invoke (null, new object[] { solution, destination, property, options != null ? options.Instance : null, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ readonly static MethodInfo addMethodDeclarationAsyncMethod;
+ public static Task<Document> AddMethodDeclarationAsync(Solution solution, INamedTypeSymbol destination, IMethodSymbol method, CodeGenerationOptions options = default(CodeGenerationOptions), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ try {
+ return (Task<Document>)addMethodDeclarationAsyncMethod.Invoke (null, new object[] { solution, destination, method, options != null ? options.Instance : null, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ public static Task<Document> AddMemberDeclarationsAsync(Solution solution, INamedTypeSymbol destination, IEnumerable<ISymbol> members, CodeGenerationOptions options = default(CodeGenerationOptions), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return new CSharpCodeGenerationService(solution.Workspace, destination.Language).AddMembersAsync(solution, destination, members, options, cancellationToken);
+ }
+
+ public static bool CanAdd(Solution solution, ISymbol destination, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return new CSharpCodeGenerationService(solution.Workspace, destination.Language).CanAddTo(destination, solution, cancellationToken);
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/SyntaxAnnotationExtensions.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/SyntaxAnnotationExtensions.cs
new file mode 100644
index 0000000000..edfd190b22
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/CodeGeneration/SyntaxAnnotationExtensions.cs
@@ -0,0 +1,58 @@
+//
+// SyntaxAnnotationExtensions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis;
+using System.Reflection;
+using System.Runtime.ExceptionServices;
+
+namespace ICSharpCode.NRefactory6.CSharp.CodeGeneration
+{
+ static class SyntaxAnnotationExtensions
+ {
+ readonly static Type typeInfo;
+
+ static SyntaxAnnotationExtensions ()
+ {
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.CodeGeneration.SyntaxAnnotationExtensions" + ReflectionNamespaces.WorkspacesAsmName, true);
+ addAnnotationToSymbolMethod = typeInfo.GetMethod ("AddAnnotationToSymbol", BindingFlags.Public | BindingFlags.Static);
+ }
+
+ readonly static MethodInfo addAnnotationToSymbolMethod;
+
+ public static TSymbol AddAnnotationToSymbol<TSymbol>(
+ this SyntaxAnnotation annotation,
+ TSymbol symbol)
+ where TSymbol : ISymbol
+ {
+ try {
+ return (TSymbol)addAnnotationToSymbolMethod.MakeGenericMethod (typeof(TSymbol)).Invoke (null, new object[] { annotation, symbol });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return default (TSymbol);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/CompletionContext.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/CompletionContext.cs
new file mode 100644
index 0000000000..d58c2524f0
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/CompletionContext.cs
@@ -0,0 +1,105 @@
+//
+// CompletionContext.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using Microsoft.CodeAnalysis;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using ICSharpCode.NRefactory6.CSharp.Completion;
+using System.Linq;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ class CompletionContext
+ {
+ readonly Document document;
+
+ public Document Document {
+ get {
+ return document;
+ }
+ }
+
+ SemanticModel semanticModel;
+
+ internal async Task<SemanticModel> GetSemanticModelAsync (CancellationToken cancellationToken = default (CancellationToken))
+ {
+ if (semanticModel == null)
+ semanticModel = await document.GetSemanticModelAsync (cancellationToken);
+ return semanticModel;
+ }
+
+ readonly int position;
+ public int Position {
+ get {
+ return position;
+ }
+ }
+
+ Task<SyntaxContext> syntaxContext;
+ object syntaxCreationLock = new object ();
+
+ internal Task<SyntaxContext> GetSyntaxContextAsync (Workspace workspace, CancellationToken cancellationToken = default (CancellationToken))
+ {
+ if (syntaxContext == null) {
+ lock (syntaxCreationLock) {
+ syntaxContext = syntaxContext ?? Task.FromResult (SyntaxContext.Create (workspace, document, semanticModel, position, cancellationToken));/*Task.Run (() => {
+ var cw = SyntaxContext.Create (workspace, document, semanticModel, position, cancellationToken);
+ System.Console.WriteLine (cw);
+ return cw;
+ })*/;
+ }
+ }
+ return syntaxContext;
+ }
+
+ IEnumerable<CompletionContextHandler> additionalContextHandlers;
+
+ /// <summary>
+ /// Adds completion context handlers to the given context.
+ /// </summary>
+ public IEnumerable<CompletionContextHandler> AdditionalContextHandlers {
+ get {
+ return additionalContextHandlers ?? Enumerable.Empty<CompletionContextHandler> ();
+ }
+ set {
+ additionalContextHandlers = value;
+ }
+ }
+
+ /// <summary>
+ /// If false no default handlers will be used and only the AdditionalContextHandlers will run.
+ /// </summary>
+ public bool UseDefaultContextHandlers { get; set; } = true;
+
+ public CompletionContext (Document document, int position, SemanticModel semanticModel = null)
+ {
+ this.document = document;
+ this.semanticModel = semanticModel;
+ this.position = position;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/CompletionEngine.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/CompletionEngine.cs
new file mode 100644
index 0000000000..b3395be726
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/CompletionEngine.cs
@@ -0,0 +1,222 @@
+//
+// CSharpCompletionEngine.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp;
+
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.Text;
+using Microsoft.CodeAnalysis.Recommendations;
+using System.Threading.Tasks;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.CSharp.Completion;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ partial class CompletionEngine
+ {
+ static CompletionContextHandler[] handlers = {
+ new RoslynRecommendationsCompletionContextHandler (),
+ new OverrideContextHandler(),
+ new PartialContextHandler(),
+ new EnumMemberContextHandler(),
+ new XmlDocCommentContextHandler(),
+ new ExplicitInterfaceContextHandler(),
+ new AttributeNamedParameterContextHandler(),
+ new NamedParameterContextHandler(),
+ new SpeculativeTContextHandler(),
+ new SnippetContextHandler(),
+ new ObjectInitializerContextHandler(),
+ new FormatItemContextHandler(),
+ new SpeculativeNameContextHandler(),
+ new DelegateCreationContextHandler(),
+ new ObjectCreationContextHandler(),
+ new SenderCompletionContextHandler(),
+ new CastCompletionContextHandler(),
+ new PreProcessorExpressionContextHandler(),
+ new RegexContextHandler(),
+ new KeywordContextHandler(),
+ };
+
+ readonly ICompletionDataFactory factory;
+ readonly Workspace workspace;
+
+ public ICompletionDataFactory Factory {
+ get {
+ return factory;
+ }
+ }
+
+ public Workspace Workspace {
+ get {
+ return workspace;
+ }
+ }
+
+ public CompletionEngine(Workspace workspace, ICompletionDataFactory factory)
+ {
+ if (workspace == null)
+ throw new ArgumentNullException("workspace");
+ if (factory == null)
+ throw new ArgumentNullException("factory");
+ this.workspace = workspace;
+ this.factory = factory;
+ }
+
+ public async Task<CompletionResult> GetCompletionDataAsync(CompletionContext completionContext, CompletionTriggerInfo info, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (completionContext == null)
+ throw new ArgumentNullException ("completionContext");
+
+ var document = completionContext.Document;
+ var semanticModel = await completionContext.GetSemanticModelAsync (cancellationToken).ConfigureAwait(false);
+ var position = completionContext.Position;
+ var text = await document.GetTextAsync (cancellationToken).ConfigureAwait (false);
+ var ctx = await completionContext.GetSyntaxContextAsync (workspace, cancellationToken);
+ ctx.SemanticModel = semanticModel;
+
+ // case lambda parameter (n1, $
+ if (ctx.TargetToken.IsKind (SyntaxKind.CommaToken) &&
+ ctx.TargetToken.Parent != null && ctx.TargetToken.Parent.Parent != null &&
+ ctx.TargetToken.Parent.Parent.IsKind(SyntaxKind.ParenthesizedLambdaExpression))
+ return CompletionResult.Empty;
+
+ var result = new CompletionResult { SyntaxContext = ctx };
+
+ if (position > 0) {
+ var nonExclusiveHandlers = new List<CompletionContextHandler> ();
+ var exclusiveHandlers = new List<CompletionContextHandler> ();
+ var toRetriggerHandlers = new List<CompletionContextHandler> ();
+ IEnumerable<CompletionContextHandler> handlerList;
+ if (completionContext.UseDefaultContextHandlers) {
+ handlerList = handlers.Concat (completionContext.AdditionalContextHandlers);
+ } else {
+ handlerList = completionContext.AdditionalContextHandlers;
+ }
+
+ foreach (var handler in handlerList) {
+ if (info.CompletionTriggerReason == CompletionTriggerReason.CompletionCommand || handler.IsTriggerCharacter (text, position - 1)) {
+ if (await handler.IsExclusiveAsync (completionContext, ctx, info, cancellationToken)) {
+ exclusiveHandlers.Add (handler);
+ } else {
+ nonExclusiveHandlers.Add (handler);
+ }
+ } else {
+ toRetriggerHandlers.Add (handler);
+ }
+ }
+
+ foreach (var handler in exclusiveHandlers) {
+ var handlerResult = handler.GetCompletionDataAsync (result, this, completionContext, info, ctx, cancellationToken).Result;
+ //if (handlerResult != null) {
+ // Console.WriteLine ("-----" + handler);
+ // foreach (var item in handlerResult) {
+ // Console.WriteLine (item.DisplayText);
+ // }
+ //} else {
+ // Console.WriteLine ("-----" + handler + " == NULL");
+ //}
+ if (handlerResult != null)
+ result.AddRange (handlerResult);
+ }
+
+ if (result.Count == 0) {
+ foreach (var handler in nonExclusiveHandlers) {
+ var handlerResult = handler.GetCompletionDataAsync (result, this, completionContext, info, ctx, cancellationToken).Result;
+ //if (handlerResult != null) {
+ // Console.WriteLine ("-----" + handler);
+ // foreach (var item in handlerResult) {
+ // Console.WriteLine (item.DisplayText);
+ // }
+ //} else {
+ // Console.WriteLine ("-----" + handler + " == NULL");
+ //}
+ if (handlerResult != null && handlerResult.Any ()) {
+ result.AddRange (handlerResult);
+ } else {
+ toRetriggerHandlers.Add (handler);
+ }
+ }
+
+ if (result.Count > 0) {
+ info = info.WithCompletionTriggerReason (CompletionTriggerReason.RetriggerCommand);
+ foreach (var handler in toRetriggerHandlers) {
+ var handlerResult = handler.GetCompletionDataAsync (result, this, completionContext, info, ctx, cancellationToken).Result;
+ if (handlerResult != null)
+ result.AddRange (handlerResult);
+ }
+ }
+ }
+ }
+
+ // prevent auto selection for "<number>." case
+ if (ctx.TargetToken.IsKind(SyntaxKind.DotToken)) {
+ var accessExpr = ctx.TargetToken.Parent as MemberAccessExpressionSyntax;
+ if (accessExpr != null &&
+ accessExpr.Expression != null &&
+ accessExpr.Expression.IsKind(SyntaxKind.NumericLiteralExpression)) {
+ result.AutoSelect = false;
+ }
+ }
+
+ if (ctx.LeftToken.Parent != null &&
+ ctx.LeftToken.Parent.Parent != null &&
+ ctx.TargetToken.Parent != null && !ctx.TargetToken.Parent.IsKind(SyntaxKind.NameEquals) &&
+ ctx.LeftToken.Parent.Parent.IsKind(SyntaxKind.AnonymousObjectMemberDeclarator))
+ result.AutoSelect = false;
+
+ if (ctx.TargetToken.IsKind (SyntaxKind.OpenParenToken) && ctx.TargetToken.GetPreviousToken ().IsKind (SyntaxKind.OpenParenToken)) {
+ var validTypes = TypeGuessing.GetValidTypes (semanticModel, ctx.TargetToken.Parent, cancellationToken);
+ result.AutoSelect = !validTypes.Any (t => t.IsDelegateType ());
+ }
+
+ foreach (var type in ctx.InferredTypes) {
+ if (type.TypeKind == TypeKind.Delegate) {
+ result.AutoSelect = false;
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ IEnumerable<ISymbol> GetAllMembers (ITypeSymbol type)
+ {
+ if (type == null)
+ yield break;
+ foreach (var member in type.GetMembers()) {
+ yield return member;
+ }
+ foreach (var baseMember in GetAllMembers(type.BaseType))
+ yield return baseMember;
+ }
+
+ public static Func<CancellationToken, Task<IEnumerable<CompletionData>>> SnippetCallback;
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/CompletionResult.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/CompletionResult.cs
new file mode 100644
index 0000000000..2182d9af75
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/CompletionResult.cs
@@ -0,0 +1,127 @@
+//
+// CompletionResult.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.CodeCompletion;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class CompletionResult : IReadOnlyList<CompletionData>
+ {
+ public static readonly CompletionResult Empty = new CompletionResult ();
+
+ readonly List<CompletionData> data = new List<CompletionData> ();
+
+ public string DefaultCompletionString {
+ get;
+ internal set;
+ }
+
+ bool autoCompleteEmptyMatch = true;
+
+ public bool AutoCompleteEmptyMatch {
+ get { return autoCompleteEmptyMatch; }
+ set { autoCompleteEmptyMatch = value; }
+ }
+
+ public bool AutoCompleteEmptyMatchOnCurlyBracket {
+ get;
+ set;
+ }
+
+ public bool AutoSelect {
+ get;
+ set;
+ }
+
+ public bool CloseOnSquareBrackets {
+ get;
+ set;
+ }
+
+ internal SyntaxContext SyntaxContext;
+
+ public readonly List<IMethodSymbol> PossibleDelegates = new List<IMethodSymbol>();
+
+ #region IReadOnlyList<ICompletionData> implemenation
+ public IEnumerator<CompletionData> GetEnumerator()
+ {
+ return data.GetEnumerator();
+ }
+
+ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+ {
+ return ((System.Collections.IEnumerable)data).GetEnumerator();
+ }
+
+ public CompletionData this[int index] {
+ get {
+ return data [index];
+ }
+ }
+
+ public int Count {
+ get {
+ return data.Count;
+ }
+ }
+ #endregion
+
+ internal CompletionResult()
+ {
+ AutoSelect = true;
+ AutoCompleteEmptyMatchOnCurlyBracket = true;
+ }
+
+ internal void AddData (CompletionData completionData)
+ {
+ var displayText = completionData.DisplayText;
+ foreach (var od in data) {
+ if (od.IsOverload (completionData) && completionData.IsOverload (od)) {
+ od.AddOverload (completionData);
+ return;
+ }
+ }
+ data.Add(completionData);
+ }
+
+ internal void AddRange (IEnumerable<CompletionData> completionData)
+ {
+ foreach (var cd in completionData) {
+ AddData (cd);
+ }
+ }
+
+ public static CompletionResult Create(IEnumerable<CompletionData> data)
+ {
+ var result = new CompletionResult();
+ result.data.AddRange(data);
+ return result;
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/CompletionTriggerInfo.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/CompletionTriggerInfo.cs
new file mode 100644
index 0000000000..a7b0a42ff1
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/CompletionTriggerInfo.cs
@@ -0,0 +1,102 @@
+//
+// CompletionTriggerInfo.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ /// <summary>
+ /// Provides information about what triggered completion.
+ /// </summary>
+ public struct CompletionTriggerInfo
+ {
+ /// <summary>
+ /// Provides the reason that completion was triggered.
+ /// </summary>
+ public CompletionTriggerReason CompletionTriggerReason { get; private set; }
+
+ /// <summary>
+ /// If the <see cref="CompletionTriggerReason"/> was <see
+ /// cref="CompletionTriggerReason.CharTyped"/> then this was the character that was
+ /// typed or deleted by backspace. Otherwise it is null.
+ /// </summary>
+ public char? TriggerCharacter { get; private set; }
+
+ /// <summary>
+ /// Returns true if the reason completion was triggered was to augment an existing list of
+ /// completion items.
+ /// </summary>
+ public bool IsAugment { get; private set; }
+
+ /// <summary>
+ /// Returns true if completion was triggered by the debugger.
+ /// </summary>
+ public bool IsDebugger { get; private set; }
+
+ /// <summary>
+ /// Return true if completion is running in the Immediate Window.
+ /// </summary>
+ public bool IsImmediateWindow { get; private set; }
+
+ public CompletionTriggerInfo (CompletionTriggerReason completionTriggerReason, char? triggerCharacter = null, bool isAugment = false, bool isDebugger = false, bool isImmediateWindow = false) : this()
+ {
+ this.CompletionTriggerReason = completionTriggerReason;
+ this.TriggerCharacter = triggerCharacter;
+ this.IsAugment = isAugment;
+ this.IsDebugger = isDebugger;
+ this.IsImmediateWindow = isImmediateWindow;
+ }
+
+ public CompletionTriggerInfo WithIsAugment(bool isAugment)
+ {
+ return this.IsAugment == isAugment
+ ? this
+ : new CompletionTriggerInfo(this.CompletionTriggerReason, this.TriggerCharacter, isAugment, this.IsDebugger, this.IsImmediateWindow);
+ }
+
+ public CompletionTriggerInfo WithIsDebugger(bool isDebugger)
+ {
+ return this.IsDebugger == isDebugger
+ ? this
+ : new CompletionTriggerInfo(this.CompletionTriggerReason, this.TriggerCharacter, this.IsAugment, isDebugger, this.IsImmediateWindow);
+ }
+
+ public CompletionTriggerInfo WithIsImmediateWindow(bool isImmediateWIndow)
+ {
+ return this.IsImmediateWindow == isImmediateWIndow
+ ? this
+ : new CompletionTriggerInfo(this.CompletionTriggerReason, this.TriggerCharacter, this.IsAugment, this.IsDebugger, isImmediateWIndow);
+ }
+
+ public CompletionTriggerInfo WithCompletionTriggerReason(CompletionTriggerReason reason)
+ {
+ return this.CompletionTriggerReason == reason
+ ? this
+ : new CompletionTriggerInfo(reason, this.TriggerCharacter, this.IsAugment, this.IsDebugger, this.IsImmediateWindow);
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/CompletionTriggerReason.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/CompletionTriggerReason.cs
new file mode 100644
index 0000000000..df9a2edafb
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/CompletionTriggerReason.cs
@@ -0,0 +1,39 @@
+//
+// CompletionTriggerReason.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ public enum CompletionTriggerReason
+ {
+ CharTyped,
+ CompletionCommand,
+ BackspaceOrDeleteCommand,
+ RetriggerCommand
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/AttributeNamedParameterContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/AttributeNamedParameterContextHandler.cs
new file mode 100644
index 0000000000..5cd4140eff
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/AttributeNamedParameterContextHandler.cs
@@ -0,0 +1,233 @@
+//
+// AttributeNamedParameterContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.Linq;
+using System.Collections.Immutable;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class AttributeNamedParameterContextHandler : CompletionContextHandler
+ {
+ protected async override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult completionResult, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ var document = completionContext.Document;
+ var position = completionContext.Position;
+
+ var syntaxTree = ctx.SyntaxTree;
+ if (syntaxTree.IsInNonUserCode(position, cancellationToken))
+ {
+ return null;
+ }
+
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() != SyntaxKind.OpenParenToken && token.Kind() != SyntaxKind.CommaToken)
+ {
+ return null;
+ }
+
+ var attributeArgumentList = token.Parent as AttributeArgumentListSyntax;
+ var attributeSyntax = token.Parent.Parent as AttributeSyntax;
+ if (attributeSyntax == null || attributeArgumentList == null)
+ {
+ return null;
+ }
+
+ // We actually want to collect two sets of named parameters to present the user. The
+ // normal named parameters that come from the attribute constructors. These will be
+ // presented like "foo:". And also the named parameters that come from the writable
+ // fields/properties in the attribute. These will be presented like "bar =".
+
+ var existingNamedParameters = GetExistingNamedParameters(attributeArgumentList, position);
+
+ var workspace = document.Project.Solution.Workspace;
+ var semanticModel = await document.GetCSharpSemanticModelForNodeAsync(attributeSyntax, cancellationToken).ConfigureAwait(false);
+ var nameColonItems = await GetNameColonItemsAsync(engine, workspace, semanticModel, position, token, attributeSyntax, existingNamedParameters, cancellationToken).ConfigureAwait(false);
+ var nameEqualsItems = await GetNameEqualsItemsAsync(engine, workspace, semanticModel, position, token, attributeSyntax, existingNamedParameters, cancellationToken).ConfigureAwait(false);
+
+ // If we're after a name= parameter, then we only want to show name= parameters.
+ if (IsAfterNameEqualsArgument(token))
+ {
+ return nameEqualsItems;
+ }
+
+ return nameColonItems.Concat(nameEqualsItems);
+ }
+ public override async Task<bool> IsExclusiveAsync(CompletionContext completionContext, SyntaxContext syntaxContext, CompletionTriggerInfo triggerInfo, CancellationToken cancellationToken)
+ {
+ var syntaxTree = await completionContext.Document.GetCSharpSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
+ var token = syntaxTree.FindTokenOnLeftOfPosition(completionContext.Position, cancellationToken)
+ .GetPreviousTokenIfTouchingWord(completionContext.Position);
+
+ return IsAfterNameColonArgument(token) || IsAfterNameEqualsArgument(token);
+ }
+
+ private bool IsAfterNameColonArgument(SyntaxToken token)
+ {
+ var argumentList = token.Parent as AttributeArgumentListSyntax;
+ if (token.Kind() == SyntaxKind.CommaToken && argumentList != null)
+ {
+ foreach (var item in argumentList.Arguments.GetWithSeparators())
+ {
+ if (item.IsToken && item.AsToken() == token)
+ {
+ return false;
+ }
+
+ if (item.IsNode)
+ {
+ var node = item.AsNode() as AttributeArgumentSyntax;
+ if (node.NameColon != null)
+ {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
+ private bool IsAfterNameEqualsArgument(SyntaxToken token)
+ {
+ var argumentList = token.Parent as AttributeArgumentListSyntax;
+ if (token.Kind() == SyntaxKind.CommaToken && argumentList != null)
+ {
+ foreach (var item in argumentList.Arguments.GetWithSeparators())
+ {
+ if (item.IsToken && item.AsToken() == token)
+ {
+ return false;
+ }
+
+ if (item.IsNode)
+ {
+ var node = item.AsNode() as AttributeArgumentSyntax;
+ if (node.NameEquals != null)
+ {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
+ private Task<IEnumerable<CompletionData>> GetNameEqualsItemsAsync(CompletionEngine engine, Workspace workspace, SemanticModel semanticModel,
+ int position, SyntaxToken token, AttributeSyntax attributeSyntax, ISet<string> existingNamedParameters,
+ CancellationToken cancellationToken)
+ {
+ var attributeNamedParameters = GetAttributeNamedParameters(semanticModel, position, attributeSyntax, cancellationToken);
+ // var unspecifiedNamedParameters = attributeNamedParameters.Where(p => !existingNamedParameters.Contains(p.Name));
+
+ // var text = await semanticModel.SyntaxTree.GetTextAsync(cancellationToken).ConfigureAwait(false);
+ return Task.FromResult (
+ attributeNamedParameters
+ .Where (p => !existingNamedParameters.Contains (p.Name))
+ .Select (p => {
+ var result = engine.Factory.CreateSymbolCompletionData (this, p);
+ result.DisplayFlags |= DisplayFlags.NamedArgument;
+ return (CompletionData)result;
+ }));
+
+
+ }
+
+ private Task<IEnumerable<CompletionData>> GetNameColonItemsAsync(
+ CompletionEngine engine, Workspace workspace, SemanticModel semanticModel, int position, SyntaxToken token, AttributeSyntax attributeSyntax, ISet<string> existingNamedParameters,
+ CancellationToken cancellationToken)
+ {
+ var parameterLists = GetParameterLists(semanticModel, position, attributeSyntax, cancellationToken);
+ parameterLists = parameterLists.Where(pl => IsValid(pl, existingNamedParameters));
+
+ // var text = await semanticModel.SyntaxTree.GetTextAsync(cancellationToken).ConfigureAwait(false);
+ return Task.FromResult (
+ from pl in parameterLists
+ from p in pl
+ where !existingNamedParameters.Contains (p.Name)
+ select engine.Factory.CreateGenericData(this, p.Name + ":", GenericDataType.NamedParameter));
+ }
+
+ private bool IsValid(ImmutableArray<IParameterSymbol> parameterList, ISet<string> existingNamedParameters)
+ {
+ return existingNamedParameters.Except(parameterList.Select(p => p.Name)).IsEmpty();
+ }
+
+ private ISet<string> GetExistingNamedParameters(AttributeArgumentListSyntax argumentList, int position)
+ {
+ var existingArguments1 =
+ argumentList.Arguments.Where(a => a.Span.End <= position)
+ .Where(a => a.NameColon != null)
+ .Select(a => a.NameColon.Name.Identifier.ValueText);
+ var existingArguments2 =
+ argumentList.Arguments.Where(a => a.Span.End <= position)
+ .Where(a => a.NameEquals != null)
+ .Select(a => a.NameEquals.Name.Identifier.ValueText);
+
+ return existingArguments1.Concat(existingArguments2).ToSet();
+ }
+
+ private IEnumerable<ImmutableArray<IParameterSymbol>> GetParameterLists(
+ SemanticModel semanticModel,
+ int position,
+ AttributeSyntax attribute,
+ CancellationToken cancellationToken)
+ {
+ var within = semanticModel.GetEnclosingNamedTypeOrAssembly(position, cancellationToken);
+ var attributeType = semanticModel.GetTypeInfo(attribute, cancellationToken).Type as INamedTypeSymbol;
+ if (within != null && attributeType != null)
+ {
+ return attributeType.InstanceConstructors.Where(c => c.IsAccessibleWithin(within))
+ .Select(c => c.Parameters);
+ }
+
+ return SpecializedCollections.EmptyEnumerable<ImmutableArray<IParameterSymbol>>();
+ }
+
+ private IEnumerable<ISymbol> GetAttributeNamedParameters(
+ SemanticModel semanticModel,
+ int position,
+ AttributeSyntax attribute,
+ CancellationToken cancellationToken)
+ {
+ var within = semanticModel.GetEnclosingNamedTypeOrAssembly(position, cancellationToken);
+ var attributeType = semanticModel.GetTypeInfo(attribute, cancellationToken).Type as INamedTypeSymbol;
+ return attributeType.GetAttributeNamedParameters(semanticModel.Compilation, within);
+ }
+
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/CastCompletionContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/CastCompletionContextHandler.cs
new file mode 100644
index 0000000000..122f405bf9
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/CastCompletionContextHandler.cs
@@ -0,0 +1,172 @@
+//
+// CastCompletionContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Threading;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class CastCompletionContextHandler : CompletionContextHandler
+ {
+ protected override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult completionResult, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ var position = completionContext.Position;
+ var document = completionContext.Document;
+ var syntaxTree = ctx.SyntaxTree;
+ if (syntaxTree.IsInNonUserCode(position, cancellationToken) ||
+ syntaxTree.IsPreProcessorDirectiveContext(position, cancellationToken))
+ return Task.FromResult (Enumerable.Empty<CompletionData> ());
+ if (!syntaxTree.IsRightOfDotOrArrowOrColonColon(position, cancellationToken))
+ return Task.FromResult (Enumerable.Empty<CompletionData> ());
+ var ma = ctx.LeftToken.Parent as MemberAccessExpressionSyntax;
+ if (ma == null)
+ return Task.FromResult (Enumerable.Empty<CompletionData> ());
+
+ var model = ctx.CSharpSyntaxContext.SemanticModel;
+
+ var symbolInfo = model.GetSymbolInfo (ma.Expression);
+ if (symbolInfo.Symbol == null)
+ return Task.FromResult (Enumerable.Empty<CompletionData> ());
+
+ var list = new List<CompletionData> ();
+ var within = model.GetEnclosingNamedTypeOrAssembly(position, cancellationToken);
+ var addedSymbols = new HashSet<string> ();
+ SyntaxNode ancestor = ma.Expression;
+ while (ancestor != null) {
+ // check parent if for direct type check
+ var ifStmSyntax = ancestor as IfStatementSyntax;
+ if (ifStmSyntax != null) {
+ var condition = ifStmSyntax.Condition.SkipParens ();
+ if (condition != null && condition.IsKind (SyntaxKind.IsExpression)) {
+ var isExpr = ((BinaryExpressionSyntax)condition);
+ var leftSymbol = model.GetSymbolInfo (isExpr.Left);
+
+ if (leftSymbol.Symbol == symbolInfo.Symbol) {
+ var type = model.GetTypeInfo (isExpr.Right).Type;
+ if (type != null) {
+ Analyze (engine, ma.Expression, type, model.GetTypeInfo (isExpr.Left).Type, within, list, addedSymbols, cancellationToken);
+ }
+ }
+ }
+ // skip if else ... if else
+ if (ancestor.Parent is ElseClauseSyntax) {
+ while (ancestor is IfStatementSyntax || ancestor is ElseClauseSyntax)
+ ancestor = ancestor.Parent;
+ continue;
+ }
+ goto loop;
+ }
+
+ // check parent block if an if is there that checks the type
+ var blockSyntax = ancestor as BlockSyntax;
+ if (blockSyntax != null) {
+ foreach (var ifStmt in blockSyntax.Statements.OfType<IfStatementSyntax> ()) {
+ if (ifStmt.Span.End >= ma.Span.Start)
+ break;
+ var condition = ifStmt.Condition.SkipParens ();
+ bool wasNegated = false;
+ if (condition.IsKind (SyntaxKind.LogicalNotExpression)) {
+ condition = ((PrefixUnaryExpressionSyntax)condition).Operand.SkipParens ();
+ wasNegated = true;
+ }
+ if (condition == null || !condition.IsKind (SyntaxKind.IsExpression))
+ goto loop;
+ var stmt = ifStmt.Statement;
+ if (stmt is BlockSyntax) {
+ stmt = ((BlockSyntax)stmt).Statements.LastOrDefault ();
+ }
+ if (!wasNegated ||
+ stmt == null ||
+ !stmt.IsKind (SyntaxKind.ReturnStatement) && !stmt.IsKind (SyntaxKind.ContinueStatement) && !stmt.IsKind (SyntaxKind.BreakStatement) && !stmt.IsKind (SyntaxKind.ThrowStatement))
+ goto loop;
+
+ var isExpr = ((BinaryExpressionSyntax)condition);
+ var leftSymbol = model.GetSymbolInfo (isExpr.Left);
+ if (leftSymbol.Symbol == symbolInfo.Symbol) {
+ var type = model.GetTypeInfo (isExpr.Right).Type;
+ if (type != null) {
+ Analyze (engine, ma.Expression, type, model.GetTypeInfo (isExpr.Left).Type, within, list, addedSymbols, cancellationToken);
+ }
+ }
+ }
+ }
+
+ var binOp = ancestor as BinaryExpressionSyntax;
+ if (binOp != null && binOp.IsKind (SyntaxKind.LogicalAndExpression)) {
+ if (binOp.Left.SkipParens ().IsKind (SyntaxKind.IsExpression)) {
+ var isExpr = ((BinaryExpressionSyntax)binOp.Left.SkipParens ());
+ var leftSymbol = model.GetSymbolInfo (isExpr.Left);
+
+ if (leftSymbol.Symbol == symbolInfo.Symbol) {
+ var type = model.GetTypeInfo (isExpr.Right).Type;
+ if (type != null) {
+ Analyze (engine, ma.Expression, type, model.GetTypeInfo (isExpr.Left).Type, within, list, addedSymbols, cancellationToken);
+ }
+ }
+ }
+ }
+
+ loop: ancestor = ancestor.Parent;
+ }
+
+ return Task.FromResult ((IEnumerable<CompletionData>)list);
+ }
+
+ void Analyze (CompletionEngine engine, SyntaxNode node, ITypeSymbol type, ITypeSymbol stopAt, ISymbol within, List<CompletionData> list, HashSet<string> addedSymbols, CancellationToken cancellationToken)
+ {
+ var startType = type;
+
+ while (type != null && type.SpecialType != SpecialType.System_Object && type != stopAt) {
+ foreach (var member in type.GetMembers ()) {
+ cancellationToken.ThrowIfCancellationRequested ();
+ if (member.IsImplicitlyDeclared || member.IsStatic)
+ continue;
+ if (member.IsOrdinaryMethod () || member.Kind == SymbolKind.Field || member.Kind == SymbolKind.Property) {
+ if (member.IsAccessibleWithin (within)) {
+ var completionData = engine.Factory.CreateCastCompletionData (this, member, node, startType);
+ if (addedSymbols.Contains (completionData.DisplayText))
+ continue;
+ addedSymbols.Add (completionData.DisplayText);
+ list.Add (completionData);
+ }
+ }
+ }
+
+ type = type.BaseType;
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/CompletionContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/CompletionContextHandler.cs
new file mode 100644
index 0000000000..b12afc3665
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/CompletionContextHandler.cs
@@ -0,0 +1,188 @@
+//
+// CompletionContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp;
+
+using Microsoft.CodeAnalysis.Text;
+using System.Threading.Tasks;
+using System.Security.Policy;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.CodeCompletion;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ abstract class CompletionContextHandler : ICompletionDataKeyHandler
+ {
+ public async Task<IEnumerable<CompletionData>> GetCompletionDataAsync (CompletionResult result, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // If we were triggered by typign a character, then do a semantic check to make sure
+ // we're still applicable. If not, then return immediately.
+ if (info.CompletionTriggerReason == CompletionTriggerReason.CharTyped)
+ {
+ var isSemanticTriggerCharacter = await IsSemanticTriggerCharacterAsync(completionContext.Document, completionContext.Position - 1, cancellationToken).ConfigureAwait(false);
+ if (!isSemanticTriggerCharacter)
+ return null;
+ }
+
+ return await GetItemsWorkerAsync(result, engine, completionContext, info, ctx, cancellationToken).ConfigureAwait(false);
+
+ }
+
+ protected virtual Task<bool> IsSemanticTriggerCharacterAsync(Document document, int characterPosition, CancellationToken cancellationToken)
+ {
+ return Task.FromResult (true);
+ }
+
+ protected abstract Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult result, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken);
+
+ static readonly char[] csharpCommitChars = {
+ ' ', '{', '}', '[', ']', '(', ')', '.', ',', ':',
+ ';', '+', '-', '*', '/', '%', '&', '|', '^', '!',
+ '~', '=', '<', '>', '?', '@', '#', '\'', '\"', '\\'
+ };
+
+ public virtual bool IsCommitCharacter (CompletionData completionItem, char ch, string textTypedSoFar)
+ {
+ return csharpCommitChars.Contains (ch);
+ }
+
+ public virtual bool SendEnterThroughToEditor(CompletionData completionItem, string textTypedSoFar)
+ {
+ return string.Compare (completionItem.DisplayText, textTypedSoFar, StringComparison.OrdinalIgnoreCase) == 0;
+ }
+
+ public virtual bool IsFilterCharacter(CompletionData completionItem, char ch, string textTypedSoFar)
+ {
+ return false;
+ }
+
+ public virtual Task<bool> IsExclusiveAsync(CompletionContext completionContext, SyntaxContext syntaxContext, CompletionTriggerInfo triggerInfo, CancellationToken cancellationToken)
+ {
+ return Task.FromResult (false);
+ }
+
+ public virtual bool IsTriggerCharacter (SourceText text, int position)
+ {
+ var ch = text [position];
+ return ch == '.' || // simple member access
+ ch == '#' || // pre processor directives
+ ch == '>' && position >= 1 && text [position - 1] == '-' || // pointer member access
+ ch == ':' && position >= 1 && text [position - 1] == ':' || // alias name
+ IsStartingNewWord (text, position);
+ }
+
+ internal protected static bool IsTriggerAfterSpaceOrStartOfWordCharacter(SourceText text, int characterPosition)
+ {
+ var ch = text[characterPosition];
+ if (ch == ' ') {
+ ch = text[characterPosition - 1];
+ return !char.IsWhiteSpace (ch);
+ }
+ return IsStartingNewWord(text, characterPosition);
+ }
+
+ internal protected static bool IsStartingNewWord (SourceText text, int position)
+ {
+ var ch = text [position];
+ if (!SyntaxFacts.IsIdentifierStartCharacter (ch))
+ return false;
+
+ if (position > 0 && IsWordCharacter (text [position - 1]))
+ return false;
+
+ if (position < text.Length - 1 && IsWordCharacter (text [position + 1]))
+ return false;
+
+ return true;
+ }
+
+ protected static bool IsWordCharacter (char ch)
+ {
+ return SyntaxFacts.IsIdentifierStartCharacter (ch) || SyntaxFacts.IsIdentifierPartCharacter (ch);
+ }
+
+ protected static bool IsOnStartLine(int position, SourceText text, int startLine)
+ {
+ return text.Lines.IndexOf(position) == startLine;
+ }
+
+ protected static TextSpan GetTextChangeSpan(SourceText text, int position)
+ {
+ return GetTextChangeSpan(text, position, IsTextChangeSpanStartCharacter, IsWordCharacter);
+ }
+
+ public static bool IsTextChangeSpanStartCharacter(char ch)
+ {
+ return ch == '@' || IsWordCharacter(ch);
+ }
+
+ public static TextSpan GetTextChangeSpan(SourceText text, int position,
+ Func<char, bool> isWordStartCharacter, Func<char, bool> isWordCharacter)
+ {
+ int start = position;
+ while (start > 0 && isWordStartCharacter(text[start - 1]))
+ {
+ start--;
+ }
+
+ // If we're brought up in the middle of a word, extend to the end of the word as well.
+ // This means that if a user brings up the completion list at the start of the word they
+ // will "insert" the text before what's already there (useful for qualifying existing
+ // text). However, if they bring up completion in the "middle" of a word, then they will
+ // "overwrite" the text. Useful for correcting misspellings or just replacing unwanted
+ // code with new code.
+ int end = position;
+ if (start != position)
+ {
+ while (end < text.Length && isWordCharacter(text[end]))
+ {
+ end++;
+ }
+ }
+
+ return TextSpan.FromBounds(start, end);
+ }
+
+ protected class UnionCompletionItemComparer : IEqualityComparer<CompletionData>
+ {
+ public static UnionCompletionItemComparer Instance = new UnionCompletionItemComparer();
+
+ public bool Equals(CompletionData x, CompletionData y)
+ {
+ return x.DisplayText == y.DisplayText;
+ }
+
+ public int GetHashCode(CompletionData obj)
+ {
+ return obj.DisplayText.GetHashCode();
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/DelegateCreationContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/DelegateCreationContextHandler.cs
new file mode 100644
index 0000000000..51587c77da
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/DelegateCreationContextHandler.cs
@@ -0,0 +1,285 @@
+//
+// DelegateCreationContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Threading;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
+using System.Text;
+using Microsoft.CodeAnalysis.Text;
+using ICSharpCode.NRefactory6.CSharp.ExtractMethod;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.CSharp.Completion;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class DelegateCreationContextHandler : CompletionContextHandler
+ {
+ internal static readonly SymbolDisplayFormat NameFormat =
+ new SymbolDisplayFormat (
+ globalNamespaceStyle: SymbolDisplayGlobalNamespaceStyle.Omitted,
+ typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameAndContainingTypesAndNamespaces,
+ propertyStyle: SymbolDisplayPropertyStyle.NameOnly,
+ genericsOptions: SymbolDisplayGenericsOptions.IncludeTypeParameters | SymbolDisplayGenericsOptions.IncludeVariance,
+ memberOptions: SymbolDisplayMemberOptions.IncludeParameters | SymbolDisplayMemberOptions.IncludeExplicitInterface,
+ parameterOptions:
+ SymbolDisplayParameterOptions.IncludeParamsRefOut |
+ SymbolDisplayParameterOptions.IncludeExtensionThis |
+ SymbolDisplayParameterOptions.IncludeType |
+ SymbolDisplayParameterOptions.IncludeName,
+ miscellaneousOptions:
+ SymbolDisplayMiscellaneousOptions.EscapeKeywordIdentifiers |
+ SymbolDisplayMiscellaneousOptions.UseSpecialTypes);
+
+ internal static readonly SymbolDisplayFormat overrideNameFormat = NameFormat.WithParameterOptions (
+ SymbolDisplayParameterOptions.IncludeDefaultValue |
+ SymbolDisplayParameterOptions.IncludeExtensionThis |
+ SymbolDisplayParameterOptions.IncludeType |
+ SymbolDisplayParameterOptions.IncludeName |
+ SymbolDisplayParameterOptions.IncludeParamsRefOut);
+
+ public override bool IsTriggerCharacter (SourceText text, int position)
+ {
+ var ch = text [position];
+ return ch == '(' || ch == '[' || ch == ',' || IsTriggerAfterSpaceOrStartOfWordCharacter (text, position);
+ }
+
+ protected override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult result, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ var document = completionContext.Document;
+ var position = completionContext.Position;
+
+ var tree = ctx.SyntaxTree;
+ var model = ctx.SemanticModel;
+ if (tree.IsInNonUserCode (position, cancellationToken))
+ return Task.FromResult (Enumerable.Empty<CompletionData> ());
+
+ if (!ctx.CSharpSyntaxContext.IsAnyExpressionContext)
+ return Task.FromResult (Enumerable.Empty<CompletionData> ());
+ var enclosingType = model.GetEnclosingNamedType (position, cancellationToken);
+ if (enclosingType == null)
+ return Task.FromResult (Enumerable.Empty<CompletionData> ());
+ var memberMethods = enclosingType.GetMembers ().OfType<IMethodSymbol> ().Where (m => m.MethodKind == MethodKind.Ordinary).ToArray ();
+
+ var list = new List<CompletionData> ();
+ foreach (var type in ctx.InferredTypes) {
+ if (type.TypeKind != TypeKind.Delegate)
+ continue;
+
+ AddCompatibleMethods (engine, list, type, memberMethods, cancellationToken);
+
+ string delegateName = null;
+
+ if (ctx.TargetToken.IsKind (SyntaxKind.PlusEqualsToken)) {
+ delegateName = GuessEventHandlerBaseName (ctx.LeftToken.Parent, ctx.ContainingTypeDeclaration);
+ }
+
+ AddDelegateHandlers (list, ctx.TargetToken.Parent, model, engine, result, type, position, delegateName, cancellationToken);
+ }
+ if (list.Count > 0) {
+ result.AutoSelect = false;
+ }
+ return Task.FromResult ((IEnumerable<CompletionData>)list);
+ }
+
+ void AddCompatibleMethods (CompletionEngine engine, List<CompletionData> list, ITypeSymbol delegateType, IMethodSymbol [] memberMethods, CancellationToken cancellationToken)
+ {
+ var delegateMethod = delegateType.GetDelegateInvokeMethod ();
+ foreach (var method in memberMethods) {
+ if (method.ReturnType.Equals (delegateMethod.ReturnType) && SignatureComparer.HaveSameSignature (delegateMethod.Parameters, method.Parameters, false, false)) {
+ list.Add (engine.Factory.CreateExistingMethodDelegate (this, method));
+ }
+ }
+ }
+
+ static string GuessEventHandlerBaseName (SyntaxNode node, TypeDeclarationSyntax containingTypeDeclaration)
+ {
+ var addAssign = node as AssignmentExpressionSyntax;
+ if (addAssign == null)
+ return null;
+
+ var ident = addAssign.Left as IdentifierNameSyntax;
+ if (ident != null)
+ return ToPascalCase (containingTypeDeclaration.Identifier + "_" + ident);
+
+ var memberAccess = addAssign.Left as MemberAccessExpressionSyntax;
+ if (memberAccess != null)
+ return ToPascalCase (GetMemberAccessBaseName(memberAccess) + "_" + memberAccess.Name);
+
+ return null;
+ }
+
+ static string GetMemberAccessBaseName (MemberAccessExpressionSyntax memberAccess)
+ {
+ var ident = memberAccess.Expression as IdentifierNameSyntax;
+ if (ident != null)
+ return ident.ToString ();
+
+ var ma = memberAccess.Expression as MemberAccessExpressionSyntax;
+ if (ma != null)
+ return ma.Name.ToString ();
+
+ return "Handle";
+ }
+
+ static string ToPascalCase (string str)
+ {
+ var result = new StringBuilder ();
+ result.Append (char.ToUpper (str[0]));
+ bool nextUpper = false;
+ for (int i = 1; i < str.Length; i++) {
+ var ch = str [i];
+ if (nextUpper && char.IsLetter (ch)) {
+ ch = char.ToUpper (ch);
+ nextUpper = false;
+ }
+ result.Append (ch);
+ if (ch == '_')
+ nextUpper = true;
+ }
+
+ return result.ToString ();
+ }
+
+ void AddDelegateHandlers (List<CompletionData> completionList, SyntaxNode parent, SemanticModel semanticModel, CompletionEngine engine, CompletionResult result, ITypeSymbol delegateType, int position, string optDelegateName, CancellationToken cancellationToken)
+ {
+ var delegateMethod = delegateType.GetDelegateInvokeMethod ();
+ result.PossibleDelegates.Add (delegateMethod);
+
+ var thisLineIndent = "";
+ string EolMarker = "\n";
+ bool addSemicolon = true;
+ bool addDefault = true;
+
+ string delegateEndString = EolMarker + thisLineIndent + "}" + (addSemicolon ? ";" : "");
+ //bool containsDelegateData = completionList.Result.Any(d => d.DisplayText.StartsWith("delegate("));
+ CompletionData item;
+ if (addDefault) {
+ item = engine.Factory.CreateAnonymousMethod (
+ this,
+ "delegate",
+ "Creates anonymous delegate.",
+ "delegate {" + EolMarker + thisLineIndent,
+ delegateEndString
+ );
+ if (!completionList.Any (i => i.DisplayText == item.DisplayText))
+ completionList.Add (item);
+
+ //if (LanguageVersion.Major >= 5)
+
+ item = engine.Factory.CreateAnonymousMethod (
+ this,
+ "async delegate",
+ "Creates anonymous async delegate.",
+ "async delegate {" + EolMarker + thisLineIndent,
+ delegateEndString
+ );
+ if (!completionList.Any (i => i.DisplayText == item.DisplayText))
+ completionList.Add (item);
+ }
+
+ var sb = new StringBuilder ("(");
+ var sbWithoutTypes = new StringBuilder ("(");
+ for (int k = 0; k < delegateMethod.Parameters.Length; k++) {
+ if (k > 0) {
+ sb.Append (", ");
+ sbWithoutTypes.Append (", ");
+ }
+ sb.Append (RoslynCompletionData.SafeMinimalDisplayString (delegateMethod.Parameters [k], semanticModel, position, overrideNameFormat));
+ sbWithoutTypes.Append (delegateMethod.Parameters [k].Name);
+ }
+
+ sb.Append (")");
+ sbWithoutTypes.Append (")");
+ var signature = sb.ToString ()
+ .Replace (", params ", ", ")
+ .Replace ("(params ", "(");
+
+ if (completionList.All (data => data.DisplayText != signature)) {
+ item = engine.Factory.CreateAnonymousMethod (
+ this,
+ signature + " =>",
+ "Creates typed lambda expression.",
+ signature + " => ",
+ (addSemicolon ? ";" : "")
+ );
+ if (!completionList.Any (i => i.DisplayText == item.DisplayText))
+ completionList.Add (item);
+
+ // if (LanguageVersion.Major >= 5) {
+
+ item = engine.Factory.CreateAnonymousMethod (
+ this,
+ "async " + signature + " =>",
+ "Creates typed async lambda expression.",
+ "async " + signature + " => ",
+ (addSemicolon ? ";" : "")
+ );
+ if (!completionList.Any (i => i.DisplayText == item.DisplayText))
+ completionList.Add (item);
+
+ var signatureWithoutTypes = sbWithoutTypes.ToString ();
+ if (!delegateMethod.Parameters.Any (p => p.RefKind != RefKind.None) && completionList.All (data => data.DisplayText != signatureWithoutTypes)) {
+ item = engine.Factory.CreateAnonymousMethod (
+ this,
+ signatureWithoutTypes + " =>",
+ "Creates typed lambda expression.",
+ signatureWithoutTypes + " => ",
+ (addSemicolon ? ";" : "")
+ );
+ if (!completionList.Any (i => i.DisplayText == item.DisplayText))
+ completionList.Add (item);
+
+ //if (LanguageVersion.Major >= 5) {
+ item = engine.Factory.CreateAnonymousMethod (
+ this,
+ "async " + signatureWithoutTypes + " =>",
+ "Creates typed async lambda expression.",
+ "async " + signatureWithoutTypes + " => ",
+ (addSemicolon ? ";" : "")
+ );
+ if (!completionList.Any (i => i.DisplayText == item.DisplayText))
+ completionList.Add (item);
+
+ //}
+ }
+ }
+ string varName = optDelegateName ?? "Handle" + delegateType.Name;
+
+
+ var curType = semanticModel.GetEnclosingSymbol<INamedTypeSymbol> (position, cancellationToken);
+ var uniqueName = new UniqueNameGenerator (semanticModel).CreateUniqueMethodName (parent, varName);
+ item = engine.Factory.CreateNewMethodDelegate (this, delegateType, uniqueName, curType);
+ if (!completionList.Any (i => i.DisplayText == item.DisplayText))
+ completionList.Add (item);
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/EnumMemberContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/EnumMemberContextHandler.cs
new file mode 100644
index 0000000000..01b219567f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/EnumMemberContextHandler.cs
@@ -0,0 +1,137 @@
+//
+// EnumMemberContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis.Recommendations;
+using Microsoft.CodeAnalysis;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp;
+
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis.Options;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.CSharp.Completion;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+
+// class CompletionEngineCache
+// {
+// public List<INamespace> namespaces;
+// public ICompletionData[] importCompletion;
+// }
+
+ class EnumMemberContextHandler : CompletionContextHandler
+ {
+ public override bool IsCommitCharacter (CompletionData completionItem, char ch, string textTypedSoFar)
+ {
+ // Only commit on dot.
+ return ch == '.';
+ }
+
+ public override bool IsTriggerCharacter(SourceText text, int position)
+ {
+ // Bring up on space or at the start of a word, or after a ( or [.
+ //
+ // Note: we don't want to bring this up after traditional enum operators like & or |.
+ // That's because we don't like the experience where the enum appears directly after the
+ // operator. Instead, the user normally types <space> and we will bring up the list
+ // then.
+ var ch = text[position];
+ return
+ ch == ' ' ||
+ ch == '[' ||
+ ch == '(' ||
+ (/*options.GetOption(CompletionOptions.TriggerOnTypingLetters, LanguageNames.CSharp) && CompletionUtilities.*/IsStartingNewWord(text, position));
+ }
+
+ protected async override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult completionResult, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ var model = ctx.SemanticModel;
+ var tree = ctx.SyntaxTree;
+ if (tree.IsInNonUserCode(completionContext.Position, cancellationToken))
+ return Enumerable.Empty<CompletionData> ();
+
+ var token = tree.FindTokenOnLeftOfPosition(completionContext.Position, cancellationToken);
+ if (token.IsMandatoryNamedParameterPosition())
+ return Enumerable.Empty<CompletionData> ();
+ var result = new List<CompletionData> ();
+
+ // check if it's the first parameter and set autoselect == false if a parameterless version exists.
+ if (token.IsKind (SyntaxKind.OpenParenToken)) {
+ var parent = token.Parent?.Parent;
+ if (parent == null)
+ return Enumerable.Empty<CompletionData> ();
+ var symbolInfo = model.GetSymbolInfo (parent);
+ foreach (var symbol in new [] { symbolInfo.Symbol }.Concat (symbolInfo.CandidateSymbols)) {
+ if (symbol != null && symbol.IsKind (SymbolKind.Method)) {
+ if (symbol.GetParameters ().Length == 0) {
+ completionResult.AutoSelect = false;
+ break;
+ }
+ }
+ }
+ }
+
+ foreach (var _type in ctx.InferredTypes) {
+ var type = _type;
+ if (type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T) {
+ type = type.GetTypeArguments().FirstOrDefault();
+ if (type == null)
+ continue;
+ }
+
+ if (type.TypeKind != TypeKind.Enum)
+ continue;
+ if (!type.IsEditorBrowsable ())
+ continue;
+
+ // Does type have any aliases?
+ ISymbol alias = await type.FindApplicableAlias(completionContext.Position, model, cancellationToken).ConfigureAwait(false);
+
+ var displayString = RoslynCompletionData.SafeMinimalDisplayString (type, model, completionContext.Position, SymbolDisplayFormat.CSharpErrorMessageFormat);
+ if (string.IsNullOrEmpty (completionResult.DefaultCompletionString)) {
+ completionResult.DefaultCompletionString = displayString;
+ completionResult.AutoCompleteEmptyMatch = true;
+
+ }
+ result.Add (engine.Factory.CreateSymbolCompletionData(this, type, displayString));
+ foreach (IFieldSymbol field in type.GetMembers().OfType<IFieldSymbol>()) {
+ if (field.DeclaredAccessibility == Accessibility.Public && (field.IsConst || field.IsStatic)) {
+ result.Add (engine.Factory.CreateEnumMemberCompletionData(this, alias, field));
+ }
+ }
+ }
+ return result;
+ }
+ }
+
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/ExplicitInterfaceContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/ExplicitInterfaceContextHandler.cs
new file mode 100644
index 0000000000..ddda1d8dd5
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/ExplicitInterfaceContextHandler.cs
@@ -0,0 +1,154 @@
+//
+// ExplicitInterfaceContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.Text;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.CodeCompletion;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class ExplicitInterfaceContextHandler : CompletionContextHandler
+ {
+ public override bool IsTriggerCharacter(SourceText text, int position)
+ {
+ return text[position] == '.';
+ }
+
+ protected async override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult completionResult, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ var position = completionContext.Position;
+ var document = completionContext.Document;
+ var span = new TextSpan(position, 0);
+ var semanticModel = await document.GetCSharpSemanticModelForSpanAsync(span, cancellationToken).ConfigureAwait(false);
+ var syntaxTree = semanticModel.SyntaxTree;
+ // var ctx = await completionContext.GetSyntaxContextAsync (engine.Workspace, cancellationToken).ConfigureAwait (false);
+
+ if (syntaxTree.IsInNonUserCode(position, cancellationToken) ||
+ syntaxTree.IsPreProcessorDirectiveContext(position, cancellationToken))
+ {
+ return Enumerable.Empty<CompletionData> ();
+ }
+
+ if (!syntaxTree.IsRightOfDotOrArrowOrColonColon(position, cancellationToken))
+ {
+ return Enumerable.Empty<CompletionData> ();
+ }
+
+ var node = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken)
+ .GetPreviousTokenIfTouchingWord(position)
+ .Parent;
+
+ if (node.Kind() == SyntaxKind.ExplicitInterfaceSpecifier)
+ {
+ return await GetCompletionsOffOfExplicitInterfaceAsync(
+ engine, document, semanticModel, position, ((ExplicitInterfaceSpecifierSyntax)node).Name, cancellationToken).ConfigureAwait(false);
+ }
+
+ return Enumerable.Empty<CompletionData> ();
+ }
+
+ private Task<IEnumerable<CompletionData>> GetCompletionsOffOfExplicitInterfaceAsync(
+ CompletionEngine engine, Document document, SemanticModel semanticModel, int position, NameSyntax name, CancellationToken cancellationToken)
+ {
+ // Bind the interface name which is to the left of the dot
+ var syntaxTree = semanticModel.SyntaxTree;
+ var nameBinding = semanticModel.GetSymbolInfo(name, cancellationToken);
+ // var context = CSharpSyntaxContext.CreateContext(document.Project.Solution.Workspace, semanticModel, position, cancellationToken);
+
+ var symbol = nameBinding.Symbol as ITypeSymbol;
+ if (symbol == null || symbol.TypeKind != TypeKind.Interface)
+ {
+ return Task.FromResult (Enumerable.Empty<CompletionData> ());
+ }
+
+ var members = semanticModel.LookupSymbols (
+ position: name.SpanStart,
+ container: symbol)
+ .Where (s => !s.IsStatic);
+ // .FilterToVisibleAndBrowsableSymbols(document.ShouldHideAdvancedMembers(), semanticModel.Compilation);
+
+ // We're going to create a entry for each one, including the signature
+ var completions = new List<CompletionData>();
+
+// var signatureDisplayFormat =
+// new SymbolDisplayFormat(
+// genericsOptions: SymbolDisplayGenericsOptions.IncludeTypeParameters,
+// memberOptions:
+// SymbolDisplayMemberOptions.IncludeParameters,
+// parameterOptions:
+// SymbolDisplayParameterOptions.IncludeName |
+// SymbolDisplayParameterOptions.IncludeType |
+// SymbolDisplayParameterOptions.IncludeParamsRefOut,
+// miscellaneousOptions:
+// SymbolDisplayMiscellaneousOptions.EscapeKeywordIdentifiers |
+// SymbolDisplayMiscellaneousOptions.UseSpecialTypes);
+
+ var namePosition = name.SpanStart;
+
+ // var text = await context.SyntaxTree.GetTextAsync(cancellationToken).ConfigureAwait(false);
+ // var textChangeSpan = GetTextChangeSpan(text, context.Position);
+
+ foreach (var member in members)
+ {
+ // var displayString = member.ToMinimalDisplayString(semanticModel, namePosition, signatureDisplayFormat);
+ // var memberCopied = member;
+ // var insertionText = displayString;
+
+ completions.Add(engine.Factory.CreateSymbolCompletionData (this, member)
+
+ /*new SymbolCompletionItem(
+ this,
+ displayString,
+ insertionText: insertionText,
+ filterSpan: textChangeSpan,
+ position: position,
+ symbols: new List<ISymbol> { member },
+ context: context) */);
+ }
+
+ return Task.FromResult ((IEnumerable<CompletionData>)completions);
+ }
+
+// public override TextChange GetTextChange(CompletionItem selectedItem, char? ch = default(char), string textTypedSoFar = null)
+// {
+// if (ch.HasValue && ch.Value == '(')
+// {
+// return new TextChange(selectedItem.FilterSpan, ((SymbolCompletionItem)selectedItem).Symbols[0].Name);
+// }
+//
+// return new TextChange(selectedItem.FilterSpan, selectedItem.DisplayText);
+// }
+
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/ExternAliasContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/ExternAliasContextHandler.cs
new file mode 100644
index 0000000000..abb5d17e6c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/ExternAliasContextHandler.cs
@@ -0,0 +1,73 @@
+//
+// ExternAliasContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+
+using System;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Threading;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.CodeCompletion;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class ExternAliasContextHandler : CompletionContextHandler
+ {
+ protected async override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult completionResult, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ var document = completionContext.Document;
+ var position = completionContext.Position;
+
+ var tree = ctx.SyntaxTree;
+
+ if (tree.IsInNonUserCode(position, cancellationToken))
+ return Enumerable.Empty<CompletionData> ();
+
+ var targetToken = tree.FindTokenOnLeftOfPosition(position, cancellationToken).GetPreviousTokenIfTouchingWord(position);
+ if (targetToken.IsKind(SyntaxKind.AliasKeyword) && targetToken.Parent.IsKind(SyntaxKind.ExternAliasDirective))
+ {
+ var compilation = await document.GetCSharpCompilationAsync(cancellationToken).ConfigureAwait(false);
+ var aliases = compilation.ExternalReferences.Where(r => r.Properties.Aliases != null).SelectMany(r => r.Properties.Aliases).ToSet();
+
+ if (aliases.Any())
+ {
+ var root = await tree.GetRootAsync(cancellationToken).ConfigureAwait(false);
+ var usedAliases = root.ChildNodes().OfType<ExternAliasDirectiveSyntax>().Where(e => !e.Identifier.IsMissing).Select(e => e.Identifier.ValueText);
+ foreach (var used in usedAliases) {
+ aliases.Remove (used);
+ }
+ aliases.Remove(MetadataReferenceProperties.GlobalAlias);
+ return aliases.Select (e => engine.Factory.CreateGenericData (this, e, GenericDataType.Undefined));
+ }
+ }
+
+ return Enumerable.Empty<CompletionData> ();
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/FormatItemContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/FormatItemContextHandler.cs
new file mode 100644
index 0000000000..e59dfbb359
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/FormatItemContextHandler.cs
@@ -0,0 +1,269 @@
+//
+// FormatItemContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+
+using System;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Ide.TypeSystem;
+using Microsoft.CodeAnalysis.Text;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class FormatItemContextHandler : CompletionContextHandler
+ {
+ public override bool IsTriggerCharacter (Microsoft.CodeAnalysis.Text.SourceText text, int position)
+ {
+ var ch = text [position];
+ return ch == ':' || ch == '"';
+ }
+
+ protected async override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult completionResult, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ var document = completionContext.Document;
+ var position = completionContext.Position;
+ var semanticModel = ctx.SemanticModel;
+
+ if (ctx.TargetToken.Parent != null && ctx.TargetToken.Parent.Parent != null &&
+ ctx.TargetToken.Parent.Parent.IsKind(SyntaxKind.Argument)) {
+ SourceText text;
+ if (!completionContext.Document.TryGetText (out text)) {
+ text = await completionContext.Document.GetTextAsync ();
+ }
+ var currentChar = text [completionContext.Position - 1];
+ if (ctx.TargetToken.Parent == null || !ctx.TargetToken.Parent.IsKind(SyntaxKind.StringLiteralExpression) ||
+ ctx.TargetToken.Parent.Parent == null || !ctx.TargetToken.Parent.Parent.IsKind(SyntaxKind.Argument) ||
+ ctx.TargetToken.Parent.Parent.Parent == null || !ctx.TargetToken.Parent.Parent.Parent.IsKind(SyntaxKind.ArgumentList) ||
+ ctx.TargetToken.Parent.Parent.Parent.Parent == null || !ctx.TargetToken.Parent.Parent.Parent.Parent.IsKind(SyntaxKind.InvocationExpression)) {
+ return Enumerable.Empty<CompletionData> ();
+ }
+ var formatArgument = GetFormatItemNumber(document, position);
+ var invocationExpression = ctx.TargetToken.Parent.Parent.Parent.Parent as InvocationExpressionSyntax;
+ return GetFormatCompletionData(engine, semanticModel, invocationExpression, formatArgument, currentChar);
+ }
+
+ return Enumerable.Empty<CompletionData> ();
+ }
+
+
+ static readonly DateTime curDate = DateTime.Now;
+
+ IEnumerable<CompletionData> GenerateNumberFormatitems(CompletionEngine engine, bool isFloatingPoint)
+ {
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "D", "decimal", 123);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "D5", "decimal", 123);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "C", "currency", 123);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "C0", "currency", 123);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "E", "exponential", 1.23E4);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "E2", "exponential", 1.234);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "e2", "exponential", 1.234);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "F", "fixed-point", 123.45);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "F1", "fixed-point", 123.45);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "G", "general", 1.23E+56);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "g2", "general", 1.23E+56);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "N", "number", 12345.68);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "N1", "number", 12345.68);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "P", "percent", 12.34);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "P1", "percent", 12.34);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "R", "round-trip", 0.1230000001);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "X", "hexadecimal", 1234);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "x8", "hexadecimal", 1234);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "0000", "custom", 123);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "####", "custom", 123);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "##.###", "custom", 1.23);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "##.000", "custom", 1.23);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "## 'items'", "custom", 12);
+ }
+
+ IEnumerable<CompletionData> GenerateDateTimeFormatitems(CompletionEngine engine)
+ {
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "D", "long date", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "d", "short date", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "F", "full date long", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "f", "full date short", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "G", "general long", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "g", "general short", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "M", "month", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "O", "ISO 8601", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "R", "RFC 1123", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "s", "sortable", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "T", "long time", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "t", "short time", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "U", "universal full", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "u", "universal sortable", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "Y", "year month", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "yy-MM-dd", "custom", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "yyyy MMMMM dd", "custom", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "yy-MMM-dd ddd", "custom", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "yyyy-M-d dddd", "custom", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "hh:mm:ss t z", "custom", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "hh:mm:ss tt zz", "custom", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "HH:mm:ss tt zz", "custom", curDate);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "HH:m:s tt zz", "custom", curDate);
+
+ }
+
+ [Flags]
+ enum TestEnum
+ {
+ EnumCaseName = 0,
+ Flag1 = 1,
+ Flag2 = 2,
+ Flags
+ }
+
+ IEnumerable<CompletionData> GenerateEnumFormatitems(CompletionEngine engine)
+ {
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "G", "string value", TestEnum.EnumCaseName);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "F", "flags value", TestEnum.Flags);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "D", "integer value", TestEnum.Flags);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "X", "hexadecimal", TestEnum.Flags);
+ }
+
+ IEnumerable<CompletionData> GenerateTimeSpanFormatitems(CompletionEngine engine)
+ {
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "c", "invariant", new TimeSpan(0, 1, 23, 456));
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "G", "general long", new TimeSpan(0, 1, 23, 456));
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "g", "general short", new TimeSpan(0, 1, 23, 456));
+ }
+
+ static Guid defaultGuid = Guid.NewGuid();
+
+ IEnumerable<CompletionData> GenerateGuidFormatitems(CompletionEngine engine)
+ {
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "N", "digits", defaultGuid);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "D", "hypens", defaultGuid);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "B", "braces", defaultGuid);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, "P", "parentheses", defaultGuid);
+ }
+
+
+ static int GetFormatItemNumber(Document document, int offset)
+ {
+ int number = 0;
+ var o = offset - 2;
+ var text = document.GetTextAsync().Result;
+ while (o > 0) {
+ char ch = text[o];
+ if (ch == '{')
+ return number;
+ if (!char.IsDigit(ch))
+ break;
+ number = number * 10 + ch - '0';
+ o--;
+ }
+ return -1;
+ }
+
+ IEnumerable<CompletionData> GetFormatCompletionForType(CompletionEngine engine, ITypeSymbol type)
+ {
+ if (type == null) {
+ return GenerateNumberFormatitems (engine, false)
+ .Concat (GenerateDateTimeFormatitems (engine))
+ .Concat (GenerateTimeSpanFormatitems (engine))
+ .Concat (GenerateEnumFormatitems (engine))
+ .Concat (GenerateGuidFormatitems (engine));
+ }
+
+ switch (type.ToString()) {
+ case "long":
+ case "System.Int64":
+ case "ulong":
+ case "System.UInt64":
+ case "int":
+ case "System.Int32":
+ case "uint":
+ case "System.UInt32":
+ case "short":
+ case "System.Int16":
+ case "ushort":
+ case "System.UInt16":
+ case "byte":
+ case "System.Byte":
+ case "sbyte":
+ case "System.SByte":
+ return GenerateNumberFormatitems(engine, false);
+ case "float":
+ case "System.Single":
+ case "double":
+ case "System.Double":
+ case "decimal":
+ case "System.Decimal":
+ return GenerateNumberFormatitems(engine, true);
+ case "System.Enum":
+ return GenerateEnumFormatitems(engine);
+ case "System.DateTime":
+ return GenerateDateTimeFormatitems(engine);
+ case "System.TimeSpan":
+ return GenerateTimeSpanFormatitems(engine);
+ case "System.Guid":
+ return GenerateGuidFormatitems(engine);
+ }
+ return CompletionResult.Empty;
+ }
+
+ IEnumerable<CompletionData> GetFormatCompletionData(CompletionEngine engine, SemanticModel semanticModel, InvocationExpressionSyntax invocationExpression, int formatArgument, char currentChar)
+ {
+ var symbolInfo = semanticModel.GetSymbolInfo (invocationExpression);
+ var method = symbolInfo.Symbol as IMethodSymbol ?? symbolInfo.CandidateSymbols.OfType<IMethodSymbol> ().FirstOrDefault ();
+ var ma = invocationExpression.Expression as MemberAccessExpressionSyntax;
+
+ if (ma != null && ma.Name.ToString () == "ToString") {
+ if (method == null || currentChar != '"') {
+ return Enumerable.Empty<CompletionData> ();
+ }
+ if (method != null) {
+ return GetFormatCompletionForType (engine, method.ContainingType);
+ } else {
+ return Enumerable.Empty<CompletionData> ();
+ }
+ } else {
+ if(method == null || currentChar != ':') {
+ return Enumerable.Empty<CompletionData> ();
+ }
+ ExpressionSyntax fmtArgumets;
+ IList<ExpressionSyntax> args;
+ if (FormatStringHelper.TryGetFormattingParameters(semanticModel, invocationExpression, out fmtArgumets, out args, null)) {
+ ITypeSymbol type = null;
+ if (formatArgument + 1< args.Count) {
+ var invokeArgument = semanticModel.GetSymbolInfo(args[formatArgument + 1]);
+ if (invokeArgument.Symbol != null)
+ type = invokeArgument.Symbol.GetReturnType();
+ }
+
+ return GetFormatCompletionForType(engine, type);
+ }
+ }
+ return Enumerable.Empty<CompletionData> ();
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/KeywordContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/KeywordContextHandler.cs
new file mode 100644
index 0000000000..13b0a61863
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/KeywordContextHandler.cs
@@ -0,0 +1,247 @@
+//
+// KeywordContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis.Recommendations;
+using Microsoft.CodeAnalysis;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp;
+
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.Text;
+using System.Threading.Tasks;
+using ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Ide.CodeCompletion;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ internal sealed class RecommendedKeyword
+ {
+ public SyntaxKind Kind { get; private set; }
+ public string Keyword { get; private set; }
+ public bool IsIntrinsic { get; private set; }
+ public bool ShouldFormatOnCommit { get; private set; }
+
+
+ public RecommendedKeyword (string keyword, SyntaxKind kind, bool isIntrinsic = false, bool shouldFormatOnCommit = false)
+ {
+ this.Kind = kind;
+ this.Keyword = keyword;
+ this.IsIntrinsic = isIntrinsic;
+ this.ShouldFormatOnCommit = shouldFormatOnCommit;
+ }
+
+ }
+
+ internal interface IKeywordRecommender<TContext>
+ {
+ IEnumerable<RecommendedKeyword> RecommendKeywords(int position, TContext context, CancellationToken cancellationToken);
+ }
+
+ class KeywordContextHandler : CompletionContextHandler
+ {
+ static readonly IKeywordRecommender<CSharpSyntaxContext>[] recommender = {
+ new AbstractKeywordRecommender(),
+ new AddKeywordRecommender(),
+ new AliasKeywordRecommender(),
+ new AscendingKeywordRecommender(),
+ new AsKeywordRecommender(),
+ new AssemblyKeywordRecommender(),
+ new AsyncKeywordRecommender(),
+ new AwaitKeywordRecommender(),
+ new BaseKeywordRecommender(),
+ new BoolKeywordRecommender(),
+ new BreakKeywordRecommender(),
+ new ByKeywordRecommender(),
+ new ByteKeywordRecommender(),
+ new CaseKeywordRecommender(),
+ new CatchKeywordRecommender(),
+ new CharKeywordRecommender(),
+ new CheckedKeywordRecommender(),
+ new ChecksumKeywordRecommender(),
+ new ClassKeywordRecommender(),
+ new ConstKeywordRecommender(),
+ new ContinueKeywordRecommender(),
+ new DecimalKeywordRecommender(),
+ new DefaultKeywordRecommender(),
+ new DefineKeywordRecommender(),
+ new DelegateKeywordRecommender(),
+ new DescendingKeywordRecommender(),
+ new DisableKeywordRecommender(),
+ new DoKeywordRecommender(),
+ new DoubleKeywordRecommender(),
+ new DynamicKeywordRecommender(),
+ new ElifKeywordRecommender(),
+ new ElseKeywordRecommender(),
+ new EndIfKeywordRecommender(),
+ new EndRegionKeywordRecommender(),
+ new EnumKeywordRecommender(),
+ new EqualsKeywordRecommender(),
+ new ErrorKeywordRecommender(),
+ new EventKeywordRecommender(),
+ new ExplicitKeywordRecommender(),
+ new ExternKeywordRecommender(),
+ new FalseKeywordRecommender(),
+ new FieldKeywordRecommender(),
+ new FinallyKeywordRecommender(),
+ new FixedKeywordRecommender(),
+ new FloatKeywordRecommender(),
+ new ForEachKeywordRecommender(),
+ new ForKeywordRecommender(),
+ new FromKeywordRecommender(),
+ new GetKeywordRecommender(),
+ new GlobalKeywordRecommender(),
+ new GotoKeywordRecommender(),
+ new GroupKeywordRecommender(),
+ new HiddenKeywordRecommender(),
+ new IfKeywordRecommender(),
+ new ImplicitKeywordRecommender(),
+ new InKeywordRecommender(),
+ new InterfaceKeywordRecommender(),
+ new InternalKeywordRecommender(),
+ new IntKeywordRecommender(),
+ new IntoKeywordRecommender(),
+ new IsKeywordRecommender(),
+ new JoinKeywordRecommender(),
+ new LetKeywordRecommender(),
+ new LineKeywordRecommender(),
+ new LockKeywordRecommender(),
+ new LongKeywordRecommender(),
+ new MethodKeywordRecommender(),
+ new ModuleKeywordRecommender(),
+ new NameOfKeywordRecommender(),
+ new NamespaceKeywordRecommender(),
+ new NewKeywordRecommender(),
+ new NullKeywordRecommender(),
+ new ObjectKeywordRecommender(),
+ new OnKeywordRecommender(),
+ new OperatorKeywordRecommender(),
+ new OrderByKeywordRecommender(),
+ new OutKeywordRecommender(),
+ new OverrideKeywordRecommender(),
+ new ParamKeywordRecommender(),
+ new ParamsKeywordRecommender(),
+ new PartialKeywordRecommender(),
+ new PragmaKeywordRecommender(),
+ new PrivateKeywordRecommender(),
+ new PropertyKeywordRecommender(),
+ new ProtectedKeywordRecommender(),
+ new PublicKeywordRecommender(),
+ new ReadOnlyKeywordRecommender(),
+ new ReferenceKeywordRecommender(),
+ new RefKeywordRecommender(),
+ new RegionKeywordRecommender(),
+ new RemoveKeywordRecommender(),
+ new RestoreKeywordRecommender(),
+ new ReturnKeywordRecommender(),
+ new SByteKeywordRecommender(),
+ new SealedKeywordRecommender(),
+ new SelectKeywordRecommender(),
+ new SetKeywordRecommender(),
+ new ShortKeywordRecommender(),
+ new SizeOfKeywordRecommender(),
+ new StackAllocKeywordRecommender(),
+ new StaticKeywordRecommender(),
+ new StringKeywordRecommender(),
+ new StructKeywordRecommender(),
+ new SwitchKeywordRecommender(),
+ new ThisKeywordRecommender(),
+ new ThrowKeywordRecommender(),
+ new TrueKeywordRecommender(),
+ new TryKeywordRecommender(),
+ new TypeKeywordRecommender(),
+ new TypeOfKeywordRecommender(),
+ new TypeVarKeywordRecommender(),
+ new UIntKeywordRecommender(),
+ new ULongKeywordRecommender(),
+ new UncheckedKeywordRecommender(),
+ new UndefKeywordRecommender(),
+ new UnsafeKeywordRecommender(),
+ new UShortKeywordRecommender(),
+ new UsingKeywordRecommender(),
+ new VarKeywordRecommender(),
+ new VirtualKeywordRecommender(),
+ new VoidKeywordRecommender(),
+ new VolatileKeywordRecommender(),
+ new WarningKeywordRecommender(),
+// new WhenKeywordRecommender(),
+ new WhereKeywordRecommender(),
+ new WhileKeywordRecommender(),
+ new YieldKeywordRecommender()
+ };
+
+ public override bool IsTriggerCharacter (Microsoft.CodeAnalysis.Text.SourceText text, int position)
+ {
+ var ch = text [position];
+ return ch == '#' ||
+ ch == ' ' && position >= 1 && !char.IsWhiteSpace (text [position - 1]) ||
+ IsStartingNewWord (text, position);
+ }
+
+ protected override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult completionResult, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ var model = ctx.SemanticModel;
+ if (ctx.CSharpSyntaxContext.IsInNonUserCode) {
+ return Task.FromResult (Enumerable.Empty<CompletionData> ());
+ }
+
+ if (ctx.TargetToken.IsKind (SyntaxKind.OverrideKeyword))
+ return Task.FromResult (Enumerable.Empty<CompletionData> ());
+
+ if (info.CompletionTriggerReason == CompletionTriggerReason.CharTyped && info.TriggerCharacter == ' ') {
+ if (!ctx.CSharpSyntaxContext.IsEnumBaseListContext && !ctx.LeftToken.IsKind (SyntaxKind.EqualsToken) && !ctx.LeftToken.IsKind (SyntaxKind.EqualsEqualsToken))
+ return Task.FromResult (Enumerable.Empty<CompletionData> ());
+// completionResult.AutoCompleteEmptyMatch = false;
+ }
+
+ var result = new List<CompletionData> ();
+
+ foreach (var r in recommender) {
+ var recommended = r.RecommendKeywords (completionContext.Position, ctx.CSharpSyntaxContext, cancellationToken);
+ if (recommended == null)
+ continue;
+ foreach (var kw in recommended) {
+ result.Add (engine.Factory.CreateKeywordCompletion (this, kw.Keyword, kw.Kind));
+ }
+ }
+
+// if (ctx.IsPreProcessorKeywordContext) {
+// foreach (var kw in preprocessorKeywords)
+// result.Add(factory.CreateGenericData (this, kw, GenericDataType.PreprocessorKeyword));
+// }
+//
+
+// if (parent.IsKind(SyntaxKind.TypeParameterConstraintClause)) {
+// result.Add(factory.CreateGenericData (this, "new()", GenericDataType.PreprocessorKeyword));
+// }
+ return Task.FromResult ((IEnumerable<CompletionData>)result);
+ }
+
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/NamedParameterContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/NamedParameterContextHandler.cs
new file mode 100644
index 0000000000..4d607424e5
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/NamedParameterContextHandler.cs
@@ -0,0 +1,220 @@
+//
+// NamedParameterContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using System.Collections.Immutable;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+using System.Linq;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class NamedParameterContextHandler : CompletionContextHandler, IEqualityComparer<IParameterSymbol>
+ {
+
+ protected async override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult completionResult, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ var document = completionContext.Document;
+ var position = completionContext.Position;
+ var syntaxTree = ctx.SyntaxTree;
+ if (syntaxTree.IsInNonUserCode(position, cancellationToken))
+ {
+ return null;
+ }
+
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() != SyntaxKind.OpenParenToken &&
+ token.Kind() != SyntaxKind.OpenBracketToken &&
+ token.Kind() != SyntaxKind.CommaToken)
+ {
+ return null;
+ }
+
+ var argumentList = token.Parent as BaseArgumentListSyntax;
+ if (argumentList == null)
+ {
+ return null;
+ }
+
+ var semanticModel = await document.GetCSharpSemanticModelForNodeAsync(argumentList, cancellationToken).ConfigureAwait(false);
+ var parameterLists = GetParameterLists(semanticModel, position, argumentList.Parent, cancellationToken);
+ if (parameterLists == null)
+ {
+ return null;
+ }
+
+ var existingNamedParameters = GetExistingNamedParameters(argumentList, position);
+ parameterLists = parameterLists.Where(pl => IsValid(pl, existingNamedParameters));
+
+ var unspecifiedParameters = parameterLists.SelectMany(pl => pl)
+ .Where(p => !existingNamedParameters.Contains(p.Name))
+ .Distinct(this);
+
+ // var text = await document.GetTextAsync(cancellationToken).ConfigureAwait(false);
+
+ return unspecifiedParameters
+ .Select(p => engine.Factory.CreateGenericData(this, p.Name + ":", GenericDataType.NamedParameter));
+ }
+
+
+ private bool IsValid(ImmutableArray<IParameterSymbol> parameterList, ISet<string> existingNamedParameters)
+ {
+ // A parameter list is valid if it has parameters that match in name all the existing
+ // named parameters that have been provided.
+ return existingNamedParameters.Except(parameterList.Select(p => p.Name)).IsEmpty();
+ }
+
+ private ISet<string> GetExistingNamedParameters(BaseArgumentListSyntax argumentList, int position)
+ {
+ var existingArguments = argumentList.Arguments.Where(a => a.Span.End <= position && a.NameColon != null)
+ .Select(a => a.NameColon.Name.Identifier.ValueText);
+
+ return existingArguments.ToSet();
+ }
+
+ private IEnumerable<ImmutableArray<IParameterSymbol>> GetParameterLists(
+ SemanticModel semanticModel,
+ int position,
+ SyntaxNode invocableNode,
+ CancellationToken cancellationToken)
+ {
+ return invocableNode.TypeSwitch(
+ (InvocationExpressionSyntax invocationExpression) => GetInvocationExpressionParameterLists(semanticModel, position, invocationExpression, cancellationToken),
+ (ConstructorInitializerSyntax constructorInitializer) => GetConstructorInitializerParameterLists(semanticModel, position, constructorInitializer, cancellationToken),
+ (ElementAccessExpressionSyntax elementAccessExpression) => GetElementAccessExpressionParameterLists(semanticModel, position, elementAccessExpression, cancellationToken),
+ (ObjectCreationExpressionSyntax objectCreationExpression) => GetObjectCreationExpressionParameterLists(semanticModel, position, objectCreationExpression, cancellationToken));
+ }
+
+ private IEnumerable<ImmutableArray<IParameterSymbol>> GetObjectCreationExpressionParameterLists(
+ SemanticModel semanticModel,
+ int position,
+ ObjectCreationExpressionSyntax objectCreationExpression,
+ CancellationToken cancellationToken)
+ {
+ var type = semanticModel.GetTypeInfo(objectCreationExpression, cancellationToken).Type as INamedTypeSymbol;
+ var within = semanticModel.GetEnclosingNamedType(position, cancellationToken);
+ if (type != null && within != null && type.TypeKind != TypeKind.Delegate)
+ {
+ return type.InstanceConstructors.Where(c => c.IsAccessibleWithin(within))
+ .Select(c => c.Parameters);
+ }
+
+ return null;
+ }
+
+ private IEnumerable<ImmutableArray<IParameterSymbol>> GetElementAccessExpressionParameterLists(
+ SemanticModel semanticModel,
+ int position,
+ ElementAccessExpressionSyntax elementAccessExpression,
+ CancellationToken cancellationToken)
+ {
+ var expressionSymbol = semanticModel.GetSymbolInfo(elementAccessExpression.Expression, cancellationToken).GetAnySymbol();
+ var expressionType = semanticModel.GetTypeInfo(elementAccessExpression.Expression, cancellationToken).Type;
+
+ if (expressionSymbol != null && expressionType != null)
+ {
+ var indexers = semanticModel.LookupSymbols(position, expressionType, WellKnownMemberNames.Indexer).OfType<IPropertySymbol>();
+ var within = semanticModel.GetEnclosingNamedTypeOrAssembly(position, cancellationToken);
+ if (within != null)
+ {
+ return indexers.Where(i => i.IsAccessibleWithin(within, throughTypeOpt: expressionType))
+ .Select(i => i.Parameters);
+ }
+ }
+
+ return null;
+ }
+
+ private IEnumerable<ImmutableArray<IParameterSymbol>> GetConstructorInitializerParameterLists(
+ SemanticModel semanticModel,
+ int position,
+ ConstructorInitializerSyntax constructorInitializer,
+ CancellationToken cancellationToken)
+ {
+ var within = semanticModel.GetEnclosingNamedType(position, cancellationToken);
+ if (within != null &&
+ (within.TypeKind == TypeKind.Struct || within.TypeKind == TypeKind.Class))
+ {
+ var type = constructorInitializer.Kind() == SyntaxKind.BaseConstructorInitializer
+ ? within.BaseType
+ : within;
+
+ if (type != null)
+ {
+ return type.InstanceConstructors.Where(c => c.IsAccessibleWithin(within))
+ .Select(c => c.Parameters);
+ }
+ }
+
+ return null;
+ }
+
+ private IEnumerable<ImmutableArray<IParameterSymbol>> GetInvocationExpressionParameterLists(
+ SemanticModel semanticModel,
+ int position,
+ InvocationExpressionSyntax invocationExpression,
+ CancellationToken cancellationToken)
+ {
+ var within = semanticModel.GetEnclosingNamedTypeOrAssembly(position, cancellationToken);
+ if (within != null)
+ {
+ var methodGroup = semanticModel.GetMemberGroup(invocationExpression.Expression, cancellationToken).OfType<IMethodSymbol>();
+ var expressionType = semanticModel.GetTypeInfo(invocationExpression.Expression, cancellationToken).Type as INamedTypeSymbol;
+
+ if (methodGroup.Any())
+ {
+ return methodGroup.Where(m => m.IsAccessibleWithin(within))
+ .Select(m => m.Parameters);
+ }
+ else if (expressionType.IsDelegateType())
+ {
+ var delegateType = (INamedTypeSymbol)expressionType;
+ return SpecializedCollections.SingletonEnumerable(delegateType.DelegateInvokeMethod.Parameters);
+ }
+ }
+
+ return null;
+ }
+
+ bool IEqualityComparer<IParameterSymbol>.Equals(IParameterSymbol x, IParameterSymbol y)
+ {
+ return x.Name.Equals(y.Name);
+ }
+
+ int IEqualityComparer<IParameterSymbol>.GetHashCode(IParameterSymbol obj)
+ {
+ return obj.Name.GetHashCode();
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/ObjectCreationContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/ObjectCreationContextHandler.cs
new file mode 100644
index 0000000000..fabe16b413
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/ObjectCreationContextHandler.cs
@@ -0,0 +1,231 @@
+//
+// ObjectCreationContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+
+using System;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.Linq;
+using MonoDevelop.Ide.CodeCompletion;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class ObjectCreationContextHandler : CompletionContextHandler
+ {
+ // static readonly ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders.NewKeywordRecommender nkr = new ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders.NewKeywordRecommender ();
+
+ public override bool IsTriggerCharacter (Microsoft.CodeAnalysis.Text.SourceText text, int position)
+ {
+ return IsTriggerAfterSpaceOrStartOfWordCharacter (text, position);
+ }
+
+ public override bool IsCommitCharacter (CompletionData completionItem, char ch, string textTypedSoFar)
+ {
+ return ch == ' ' || ch == '(' || ch == '{' || ch == '[';
+ }
+
+ static string[] primitiveTypesKeywords = {
+ // "void",
+ "object",
+ "bool",
+ "byte",
+ "sbyte",
+ "char",
+ "short",
+ "int",
+ "long",
+ "ushort",
+ "uint",
+ "ulong",
+ "float",
+ "double",
+ "decimal",
+ "string"
+ };
+ static SyntaxKind[] primitiveTypesKeywordKinds = {
+ // "void",
+ SyntaxKind.ObjectKeyword,
+ SyntaxKind.BoolKeyword,
+ SyntaxKind.ByteKeyword,
+ SyntaxKind.SByteKeyword,
+ SyntaxKind.CharKeyword,
+ SyntaxKind.ShortKeyword,
+ SyntaxKind.IntKeyword,
+ SyntaxKind.LongKeyword,
+ SyntaxKind.UShortKeyword,
+ SyntaxKind.UIntKeyword,
+ SyntaxKind.ULongKeyword,
+ SyntaxKind.FloatKeyword,
+ SyntaxKind.DoubleKeyword,
+ SyntaxKind.DecimalKeyword,
+ SyntaxKind.StringKeyword
+ };
+
+ protected async override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult result, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ var list = new List<CompletionData> ();
+
+ var newExpression = GetObjectCreationNewExpression (ctx.SyntaxTree, completionContext.Position, cancellationToken);
+ if (newExpression == null) {
+ if (ctx.SyntaxTree.IsInNonUserCode(completionContext.Position, cancellationToken) ||
+ ctx.SyntaxTree.IsPreProcessorDirectiveContext(completionContext.Position, cancellationToken))
+ return Enumerable.Empty<CompletionData> ();
+
+// if (!nkr.IsValid (completionContext.Position, ctx.CSharpSyntaxContext, cancellationToken))
+// return Enumerable.Empty<ICompletionData> ();
+
+ var tokenOnLeftOfPosition = ctx.SyntaxTree.FindTokenOnLeftOfPosition (completionContext.Position, cancellationToken);
+ if (!tokenOnLeftOfPosition.IsKind (SyntaxKind.EqualsToken) && !tokenOnLeftOfPosition.Parent.IsKind (SyntaxKind.EqualsValueClause))
+ return Enumerable.Empty<CompletionData> ();
+
+ foreach (var inferredType in SyntaxContext.InferenceService.InferTypes (ctx.CSharpSyntaxContext.SemanticModel, completionContext.Position, cancellationToken)) {
+ if (inferredType.IsEnumType () || inferredType.IsInterfaceType () || inferredType.IsAbstract)
+ continue;
+ foreach (var symbol in await GetPreselectedSymbolsWorker(ctx.CSharpSyntaxContext, inferredType, completionContext.Position - 1, cancellationToken)) {
+ var symbolCompletionData = engine.Factory.CreateObjectCreation (this, inferredType, symbol, completionContext.Position, false);
+ list.Add (symbolCompletionData);
+ }
+ }
+ return list;
+ }
+
+ var type = SyntaxContext.InferenceService.InferType (ctx.CSharpSyntaxContext.SemanticModel, newExpression, objectAsDefault: false, cancellationToken: cancellationToken);
+
+ foreach (var symbol in await GetPreselectedSymbolsWorker(ctx.CSharpSyntaxContext, type, completionContext.Position, cancellationToken)) {
+ var symbolCompletionData = engine.Factory.CreateObjectCreation (this, type, symbol, newExpression.SpanStart, true);
+ list.Add (symbolCompletionData);
+ if (string.IsNullOrEmpty (result.DefaultCompletionString)) {
+ result.DefaultCompletionString = symbolCompletionData.DisplayText;
+ result.AutoCompleteEmptyMatch = true;
+ }
+ }
+ for (int i = 0; i < primitiveTypesKeywords.Length; i++) {
+ var keyword = primitiveTypesKeywords [i];
+ list.Add (engine.Factory.CreateKeywordCompletion (this, keyword, primitiveTypesKeywordKinds[i]));
+ }
+
+ return list;
+ }
+
+
+ static Task<IEnumerable<ISymbol>> GetPreselectedSymbolsWorker2 (CSharpSyntaxContext context, ITypeSymbol type, CancellationToken cancellationToken)
+ {
+ // Unwrap an array type fully. We only want to offer the underlying element type in the
+ // list of completion items.
+ bool isArray = false;
+ while (type is IArrayTypeSymbol) {
+ isArray = true;
+ type = ((IArrayTypeSymbol)type).ElementType;
+ }
+
+ if (type == null) {
+ return Task.FromResult (Enumerable.Empty<ISymbol> ());
+ }
+
+ // Unwrap nullable
+ if (type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T) {
+ type = type.GetTypeArguments ().FirstOrDefault ();
+ }
+
+ if (type.SpecialType == SpecialType.System_Void) {
+ return Task.FromResult (Enumerable.Empty<ISymbol> ());
+ }
+
+ if (type.ContainsAnonymousType ()) {
+ return Task.FromResult (Enumerable.Empty<ISymbol> ());
+ }
+
+ if (!type.CanBeReferencedByName) {
+ return Task.FromResult (Enumerable.Empty<ISymbol> ());
+ }
+
+ // Normally the user can't say things like "new IList". Except for "IList[] x = new |".
+ // In this case we do want to allow them to preselect certain types in the completion
+ // list even if they can't new them directly.
+ if (!isArray) {
+ if (type.TypeKind == TypeKind.Interface ||
+ type.TypeKind == TypeKind.Pointer ||
+ type.TypeKind == TypeKind.Dynamic ||
+ type.IsAbstract) {
+ return Task.FromResult (Enumerable.Empty<ISymbol> ());
+ }
+
+ if (type.TypeKind == TypeKind.TypeParameter &&
+ !((ITypeParameterSymbol)type).HasConstructorConstraint) {
+ return Task.FromResult (Enumerable.Empty<ISymbol> ());
+ }
+ }
+
+// if (!type.IsEditorBrowsable(options.GetOption(RecommendationOptions.HideAdvancedMembers, context.SemanticModel.Language), context.SemanticModel.Compilation))
+// {
+// return SpecializedTasks.EmptyEnumerable<ISymbol>();
+// }
+//
+ return Task.FromResult (SpecializedCollections.SingletonEnumerable ((ISymbol)type));
+ }
+
+ static async Task<IEnumerable<ISymbol>> GetPreselectedSymbolsWorker (CSharpSyntaxContext context, ITypeSymbol inferredType, int position, CancellationToken cancellationToken)
+ {
+ var result = await GetPreselectedSymbolsWorker2 (context, inferredType, cancellationToken).ConfigureAwait (false);
+ if (result.Any ()) {
+ var type = (ITypeSymbol)result.Single ();
+ var alias = await type.FindApplicableAlias (position, context.SemanticModel, cancellationToken).ConfigureAwait (false);
+ if (alias != null) {
+ return SpecializedCollections.SingletonEnumerable (alias);
+ }
+ }
+
+ return result;
+ }
+
+ internal static SyntaxNode GetObjectCreationNewExpression (SyntaxTree tree, int position, CancellationToken cancellationToken)
+ {
+ if (tree != null) {
+ if (!tree.IsInNonUserCode (position, cancellationToken)) {
+ var tokenOnLeftOfPosition = tree.FindTokenOnLeftOfPosition (position, cancellationToken);
+ var newToken = tokenOnLeftOfPosition.GetPreviousTokenIfTouchingWord (position);
+
+ // Only after 'new'.
+ if (newToken.Kind () == SyntaxKind.NewKeyword) {
+ // Only if the 'new' belongs to an object creation expression (and isn't a 'new'
+ // modifier on a member).
+ if (tree.IsObjectCreationTypeContext (position, tokenOnLeftOfPosition, cancellationToken)) {
+ return newToken.Parent as ExpressionSyntax;
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/ObjectInitializerContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/ObjectInitializerContextHandler.cs
new file mode 100644
index 0000000000..48b71efef0
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/ObjectInitializerContextHandler.cs
@@ -0,0 +1,253 @@
+//
+// ObjectInitializerContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class ObjectInitializerContextHandler : CompletionContextHandler
+ {
+ public override bool SendEnterThroughToEditor (CompletionData completionItem, string textTypedSoFar)
+ {
+ return false;
+ }
+ public override async Task<bool> IsExclusiveAsync (CompletionContext completionContext, SyntaxContext syntaxContext, CompletionTriggerInfo triggerInfo, CancellationToken cancellationToken)
+ {
+ // We're exclusive if this context could only be an object initializer and not also a
+ // collection initializer. If we're initializing something that could be initialized as
+ // an object or as a collection, say we're not exclusive. That way the rest of
+ // intellisense can be used in the collection intitializer.
+ //
+ // Consider this case:
+
+ // class c : IEnumerable<int>
+ // {
+ // public void Add(int addend) { }
+ // public int foo;
+ // }
+
+ // void foo()
+ // {
+ // var b = new c {|
+ // }
+
+ // There we could initialize b using either an object initializer or a collection
+ // initializer. Since we don't know which the user will use, we'll be non-exclusive, so
+ // the other providers can help the user write the collection initializer, if they want
+ // to.
+ var document = completionContext.Document;
+ var position = completionContext.Position;
+ var tree = await document.GetCSharpSyntaxTreeAsync (cancellationToken).ConfigureAwait (false);
+
+ if (tree.IsInNonUserCode (position, cancellationToken)) {
+ return false;
+ }
+
+ var token = tree.FindTokenOnLeftOfPosition (position, cancellationToken);
+ token = token.GetPreviousTokenIfTouchingWord (position);
+
+ if (token.Parent == null) {
+ return false;
+ }
+
+ var expression = token.Parent.Parent as ExpressionSyntax;
+ if (expression == null) {
+ return false;
+ }
+
+ var semanticModel = await document.GetCSharpSemanticModelForNodeAsync (expression, cancellationToken).ConfigureAwait (false);
+ var initializedType = semanticModel.GetTypeInfo (expression, cancellationToken).Type;
+ if (initializedType == null) {
+ return false;
+ }
+
+ // Non-exclusive if initializedType can be initialized as a collection.
+ if (initializedType.CanSupportCollectionInitializer ()) {
+ return false;
+ }
+
+ // By default, only our member names will show up.
+ return true;
+ }
+
+ public override bool IsTriggerCharacter (Microsoft.CodeAnalysis.Text.SourceText text, int characterPosition)
+ {
+ return base.IsTriggerCharacter (text, characterPosition) || text [characterPosition] == ' ';
+ }
+
+ protected async override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult completionResult, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ var document = completionContext.Document;
+ var position = completionContext.Position;
+ var workspace = document.Project.Solution.Workspace;
+ var semanticModel = await document.GetSemanticModelForSpanAsync (new TextSpan (position, 0), cancellationToken).ConfigureAwait (false);
+ var typeAndLocation = GetInitializedType (document, semanticModel, position, cancellationToken);
+ if (typeAndLocation == null)
+ return Enumerable.Empty<CompletionData> ();
+
+ var initializedType = typeAndLocation.Item1 as INamedTypeSymbol;
+ var initializerLocation = typeAndLocation.Item2;
+ if (initializedType == null)
+ return Enumerable.Empty<CompletionData> ();
+
+ // Find the members that can be initialized. If we have a NamedTypeSymbol, also get the overridden members.
+ IEnumerable<ISymbol> members = semanticModel.LookupSymbols (position, initializedType);
+ members = members.Where (m => IsInitializable (m, initializedType) &&
+ m.CanBeReferencedByName &&
+ IsLegalFieldOrProperty (m) &&
+ !m.IsImplicitlyDeclared);
+
+ // Filter out those members that have already been typed
+ var alreadyTypedMembers = GetInitializedMembers (semanticModel.SyntaxTree, position, cancellationToken);
+ var uninitializedMembers = members.Where (m => !alreadyTypedMembers.Contains (m.Name));
+
+ uninitializedMembers = uninitializedMembers.Where (m => m.IsEditorBrowsable ());
+
+ // var text = await semanticModel.SyntaxTree.GetTextAsync(cancellationToken).ConfigureAwait(false);
+ // var changes = GetTextChangeSpan(text, position);
+ var list = new List<CompletionData> ();
+
+ // Return the members
+ foreach (var member in uninitializedMembers) {
+ list.Add (engine.Factory.CreateSymbolCompletionData (this, member));
+ }
+ return list;
+ }
+
+ static bool IsLegalFieldOrProperty (ISymbol symbol)
+ {
+ var type = symbol.GetMemberType ();
+ if (type != null && type.CanSupportCollectionInitializer ()) {
+ return true;
+ }
+
+ return symbol.IsWriteableFieldOrProperty ();
+ }
+
+
+ static bool IsInitializable (ISymbol member, INamedTypeSymbol containingType)
+ {
+ var propertySymbol = member as IPropertySymbol;
+ if (propertySymbol != null) {
+ if (propertySymbol.Parameters.Any (p => !p.IsOptional))
+ return false;
+ }
+
+
+ return
+ !member.IsStatic &&
+ member.MatchesKind (SymbolKind.Field, SymbolKind.Property) &&
+ member.IsAccessibleWithin (containingType);
+ }
+
+
+ static Tuple<ITypeSymbol, Location> GetInitializedType (Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ var tree = semanticModel.SyntaxTree;
+ if (tree.IsInNonUserCode (position, cancellationToken)) {
+ return null;
+ }
+
+ var token = tree.FindTokenOnLeftOfPosition (position, cancellationToken);
+ token = token.GetPreviousTokenIfTouchingWord (position);
+
+ if (token.Kind () != SyntaxKind.CommaToken && token.Kind () != SyntaxKind.OpenBraceToken) {
+ return null;
+ }
+
+ if (token.Parent == null || token.Parent.Parent == null) {
+ return null;
+ }
+
+ // If we got a comma, we can syntactically find out if we're in an ObjectInitializerExpression
+ if (token.Kind () == SyntaxKind.CommaToken &&
+ token.Parent.Kind () != SyntaxKind.ObjectInitializerExpression) {
+ return null;
+ }
+
+ // new Foo { bar = $$
+ if (token.Parent.Parent.IsKind (SyntaxKind.ObjectCreationExpression)) {
+ var objectCreation = token.Parent.Parent as ObjectCreationExpressionSyntax;
+ if (objectCreation == null) {
+ return null;
+ }
+
+ var ctor = semanticModel.GetSymbolInfo (objectCreation, cancellationToken).Symbol;
+ var type = ctor != null ? ctor.ContainingType : null;
+ if (type == null) {
+ type = semanticModel.GetSpeculativeTypeInfo (objectCreation.SpanStart, objectCreation.Type, SpeculativeBindingOption.BindAsTypeOrNamespace).Type as INamedTypeSymbol;
+ }
+
+ return Tuple.Create<ITypeSymbol, Location> (type, token.GetLocation ());
+ }
+
+ // Nested: new Foo { bar = { $$
+ if (token.Parent.Parent.IsKind (SyntaxKind.SimpleAssignmentExpression)) {
+ // Use the type inferrer to get the type being initialzied.
+ var typeInferenceService = TypeGuessing.typeInferenceService;
+ var parentInitializer = token.GetAncestor<InitializerExpressionSyntax> ();
+
+ var expectedType = typeInferenceService.InferType (semanticModel, parentInitializer, objectAsDefault: false, cancellationToken: cancellationToken);
+ return Tuple.Create (expectedType, token.GetLocation ());
+ }
+
+ return null;
+ }
+
+ static HashSet<string> GetInitializedMembers (SyntaxTree tree, int position, CancellationToken cancellationToken)
+ {
+ var token = tree.FindTokenOnLeftOfPosition (position, cancellationToken)
+ .GetPreviousTokenIfTouchingWord (position);
+
+ // We should have gotten back a { or ,
+ if (token.Kind () == SyntaxKind.CommaToken || token.Kind () == SyntaxKind.OpenBraceToken) {
+ if (token.Parent != null) {
+ var initializer = token.Parent as InitializerExpressionSyntax;
+
+ if (initializer != null) {
+ return new HashSet<string> (initializer.Expressions.OfType<AssignmentExpressionSyntax> ()
+ .Where (b => b.OperatorToken.Kind () == SyntaxKind.EqualsToken)
+ .Select (b => b.Left)
+ .OfType<IdentifierNameSyntax> ()
+ .Select (i => i.Identifier.ValueText));
+ }
+ }
+ }
+
+ return new HashSet<string> ();
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/OverrideContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/OverrideContextHandler.cs
new file mode 100644
index 0000000000..aa0699864c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/OverrideContextHandler.cs
@@ -0,0 +1,431 @@
+//
+// OverrideContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+
+using System.Linq;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis.CSharp;
+using System;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class OverrideContextHandler : CompletionContextHandler
+ {
+ public override bool IsTriggerCharacter (SourceText text, int position)
+ {
+ return IsTriggerAfterSpaceOrStartOfWordCharacter (text, position);
+ }
+
+ public override async Task<bool> IsExclusiveAsync (CompletionContext completionContext, SyntaxContext ctx, CompletionTriggerInfo triggerInfo, CancellationToken cancellationToken)
+ {
+ var document = completionContext.Document;
+ var semanticModel = ctx.SemanticModel;
+ var tree = ctx.SyntaxTree;
+ if (tree.IsInNonUserCode(completionContext.Position, cancellationToken))
+ return false;
+
+ var text = await document.GetTextAsync (cancellationToken).ConfigureAwait (false);
+
+ var startLineNumber = text.Lines.IndexOf (completionContext.Position);
+
+ // modifiers* override modifiers* type? |
+ Accessibility seenAccessibility;
+ //DeclarationModifiers modifiers;
+ var token = tree.FindTokenOnLeftOfPosition(completionContext.Position, cancellationToken);
+ if (token.Parent == null)
+ return false;
+
+ var parentMember = token.Parent.AncestorsAndSelf ().OfType<MemberDeclarationSyntax> ().FirstOrDefault (m => !m.IsKind (SyntaxKind.IncompleteMember));
+
+ if (!(parentMember is BaseTypeDeclarationSyntax) &&
+
+ /* May happen in case:
+ *
+ * override $
+ * public override string Foo () {}
+ */
+ !(token.IsKind (SyntaxKind.OverrideKeyword) && token.Span.Start <= parentMember.Span.Start))
+ return false;
+
+ var position = completionContext.Position;
+ var startToken = token.GetPreviousTokenIfTouchingWord(position);
+ ITypeSymbol returnType;
+ SyntaxToken tokenBeforeReturnType;
+ TryDetermineReturnType (startToken, semanticModel, cancellationToken, out returnType, out tokenBeforeReturnType);
+ if (returnType == null) {
+ var enclosingType = semanticModel.GetEnclosingSymbol (position, cancellationToken) as INamedTypeSymbol;
+ if (enclosingType != null && (startToken.IsKind (SyntaxKind.OpenBraceToken) || startToken.IsKind (SyntaxKind.CloseBraceToken) || startToken.IsKind (SyntaxKind.SemicolonToken))) {
+ return false;
+ }
+ }
+
+ if (!TryDetermineModifiers(ref tokenBeforeReturnType, text, startLineNumber, out seenAccessibility/*, out modifiers*/) ||
+ !TryCheckForTrailingTokens (tree, text, startLineNumber, position, cancellationToken)) {
+ return false;
+ }
+ return true;
+ }
+
+ protected async override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult completionResult, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ // var ctx = await completionContext.GetSyntaxContextAsync (engine.Workspace, cancellationToken).ConfigureAwait (false);
+ var document = completionContext.Document;
+ var semanticModel = ctx.SemanticModel;
+ var tree = ctx.SyntaxTree;
+ if (tree.IsInNonUserCode(completionContext.Position, cancellationToken))
+ return Enumerable.Empty<CompletionData> ();
+
+ var text = await document.GetTextAsync (cancellationToken).ConfigureAwait (false);
+
+ var startLineNumber = text.Lines.IndexOf (completionContext.Position);
+
+ // modifiers* override modifiers* type? |
+ Accessibility seenAccessibility;
+ //DeclarationModifiers modifiers;
+ var token = tree.FindTokenOnLeftOfPosition (completionContext.Position, cancellationToken);
+ if (token.Parent == null)
+ return Enumerable.Empty<CompletionData> ();
+
+ // don't show up in that case: int { $$
+ if (token.Parent.IsKind (SyntaxKind.SkippedTokensTrivia))
+ return Enumerable.Empty<CompletionData> ();
+ var im = token.Parent.Ancestors ().OfType<IncompleteMemberSyntax> ().FirstOrDefault ();
+ if (im != null) {
+ var token2 = tree.FindTokenOnLeftOfPosition (im.Span.Start, cancellationToken);
+ if (token2.Parent.IsKind (SyntaxKind.SkippedTokensTrivia))
+ return Enumerable.Empty<CompletionData> ();
+ }
+
+ var parentMember = token.Parent.AncestorsAndSelf ().OfType<MemberDeclarationSyntax> ().FirstOrDefault (m => !m.IsKind (SyntaxKind.IncompleteMember));
+
+ if (!(parentMember is BaseTypeDeclarationSyntax) &&
+
+ /* May happen in case:
+ *
+ * override $
+ * public override string Foo () {}
+ */
+ !(token.IsKind (SyntaxKind.OverrideKeyword) && token.Span.Start <= parentMember.Span.Start))
+ return Enumerable.Empty<CompletionData> ();
+
+ var position = completionContext.Position;
+ var startToken = token.GetPreviousTokenIfTouchingWord(position);
+ ITypeSymbol returnType;
+ SyntaxToken tokenBeforeReturnType;
+ TryDetermineReturnType (startToken, semanticModel, cancellationToken, out returnType, out tokenBeforeReturnType);
+ if (returnType == null) {
+ var enclosingType = semanticModel.GetEnclosingSymbol (position, cancellationToken) as INamedTypeSymbol;
+ if (enclosingType != null && (startToken.IsKind (SyntaxKind.OpenBraceToken) || startToken.IsKind (SyntaxKind.CloseBraceToken) || startToken.IsKind (SyntaxKind.SemicolonToken))) {
+ return CreateCompletionData (engine, semanticModel, position, returnType, Accessibility.NotApplicable, startToken, tokenBeforeReturnType, false, cancellationToken);
+ }
+ }
+
+ if (!TryDetermineModifiers(ref tokenBeforeReturnType, text, startLineNumber, out seenAccessibility/*, out modifiers*/) ||
+ !TryCheckForTrailingTokens (tree, text, startLineNumber, position, cancellationToken)) {
+ return Enumerable.Empty<CompletionData> ();
+ }
+
+ return CreateCompletionData (engine, semanticModel, position, returnType, seenAccessibility, startToken, tokenBeforeReturnType, true, cancellationToken);
+ }
+
+ protected virtual IEnumerable<CompletionData> CreateCompletionData (CompletionEngine engine, SemanticModel semanticModel, int position, ITypeSymbol returnType, Accessibility seenAccessibility, SyntaxToken startToken, SyntaxToken tokenBeforeReturnType, bool afterKeyword, CancellationToken cancellationToken)
+ {
+ var result = new List<CompletionData> ();
+ ISet<ISymbol> overridableMembers;
+ if (!TryDetermineOverridableMembers (semanticModel, tokenBeforeReturnType, seenAccessibility, out overridableMembers, cancellationToken)) {
+ return result;
+ }
+ if (returnType != null) {
+ overridableMembers = FilterOverrides (overridableMembers, returnType);
+ }
+ var curType = semanticModel.GetEnclosingSymbol<INamedTypeSymbol> (position, cancellationToken);
+ var declarationBegin = afterKeyword ? startToken.Parent.SpanStart : position - 1;
+ foreach (var m in overridableMembers) {
+ var data = engine.Factory.CreateNewOverrideCompletionData (this, declarationBegin, curType, m, afterKeyword);
+ result.Add (data);
+ }
+ return result;
+ }
+
+ protected static ISet<ISymbol> FilterOverrides(ISet<ISymbol> members, ITypeSymbol returnType)
+ {
+ var filteredMembers = new HashSet<ISymbol>(
+ from m in members
+ where m.GetReturnType ().ToString () == returnType.ToString ()
+ select m);
+
+ // Don't filter by return type if we would then have nothing to show.
+ // This way, the user gets completion even if they speculatively typed the wrong return type
+ if (filteredMembers.Count > 0)
+ {
+ members = filteredMembers;
+ }
+
+ return members;
+ }
+
+ static bool TryDetermineReturnType(SyntaxToken startToken, SemanticModel semanticModel, CancellationToken cancellationToken, out ITypeSymbol returnType, out SyntaxToken nextToken)
+ {
+ nextToken = startToken;
+ returnType = null;
+ if (startToken.Parent is TypeSyntax)
+ {
+ var typeSyntax = (TypeSyntax)startToken.Parent;
+
+ // 'partial' is actually an identifier. If we see it just bail. This does mean
+ // we won't handle overrides that actually return a type called 'partial'. And
+ // not a single tear was shed.
+ if (typeSyntax is IdentifierNameSyntax &&
+ ((IdentifierNameSyntax)typeSyntax).Identifier.IsKindOrHasMatchingText(SyntaxKind.PartialKeyword))
+ {
+ return false;
+ }
+
+ returnType = semanticModel.GetTypeInfo(typeSyntax, cancellationToken).Type;
+ nextToken = typeSyntax.GetFirstToken().GetPreviousToken();
+ }
+
+ return true;
+ }
+
+
+ static bool HasOverridden (ISymbol original, ISymbol testSymbol)
+ {
+ if (original.Kind != testSymbol.Kind)
+ return false;
+ switch (testSymbol.Kind) {
+ case SymbolKind.Method:
+ return ((IMethodSymbol)testSymbol).OverriddenMethod == original;
+ case SymbolKind.Property:
+ return ((IPropertySymbol)testSymbol).OverriddenProperty == original;
+ case SymbolKind.Event:
+ return ((IEventSymbol)testSymbol).OverriddenEvent == original;
+ }
+ return false;
+ }
+
+ public static bool IsOverridable(ISymbol member, INamedTypeSymbol containingType)
+ {
+ if (member.IsAbstract || member.IsVirtual || member.IsOverride) {
+ if (member.IsSealed) {
+ return false;
+ }
+
+ if (!member.IsAccessibleWithin(containingType)) {
+ return false;
+ }
+
+ switch (member.Kind) {
+ case SymbolKind.Event:
+ return true;
+ case SymbolKind.Method:
+ return ((IMethodSymbol)member).MethodKind == MethodKind.Ordinary;
+ case SymbolKind.Property:
+ return !((IPropertySymbol)member).IsWithEvents;
+ }
+ }
+ return false;
+ }
+
+ internal static bool TryDetermineOverridableMembers(SemanticModel semanticModel, SyntaxToken startToken, Accessibility seenAccessibility, out ISet<ISymbol> overridableMembers, CancellationToken cancellationToken)
+ {
+ var result = new HashSet<ISymbol>();
+ var containingType = semanticModel.GetEnclosingSymbol<INamedTypeSymbol>(startToken.SpanStart, cancellationToken);
+ if (containingType != null && !containingType.IsScriptClass && !containingType.IsImplicitClass)
+ {
+ if (containingType.TypeKind == TypeKind.Class || containingType.TypeKind == TypeKind.Struct)
+ {
+ var baseTypes = containingType.GetBaseTypes().Reverse();
+ foreach (var type in baseTypes)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+
+ // Prefer overrides in derived classes
+ RemoveOverriddenMembers(result, type, cancellationToken);
+
+ // Retain overridable methods
+ AddOverridableMembers(result, containingType, type, cancellationToken);
+ }
+ // Don't suggest already overridden members
+ RemoveOverriddenMembers(result, containingType, cancellationToken);
+ }
+ }
+
+ // Filter based on accessibility
+ if (seenAccessibility != Accessibility.NotApplicable)
+ {
+ result.RemoveWhere(m => m.DeclaredAccessibility != seenAccessibility);
+ }
+
+ overridableMembers = result;
+ return overridableMembers.Count > 0;
+ }
+
+ static void AddOverridableMembers(HashSet<ISymbol> result, INamedTypeSymbol containingType, INamedTypeSymbol type, CancellationToken cancellationToken)
+ {
+ foreach (var member in type.GetMembers())
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+
+ if (IsOverridable(member, containingType))
+ {
+ result.Add(member);
+ }
+ }
+ }
+
+ protected static void RemoveOverriddenMembers(HashSet<ISymbol> result, INamedTypeSymbol containingType, CancellationToken cancellationToken)
+ {
+ foreach (var member in containingType.GetMembers())
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ var overriddenMember = member.OverriddenMember();
+ if (overriddenMember != null)
+ {
+ result.Remove(overriddenMember);
+ }
+ }
+ }
+
+
+ static bool TryCheckForTrailingTokens (SyntaxTree tree, SourceText text, int startLineNumber, int position, CancellationToken cancellationToken)
+ {
+ var root = tree.GetRoot (cancellationToken);
+ var token = root.FindToken (position);
+
+ // Don't want to offer Override completion if there's a token after the current
+ // position.
+ if (token.SpanStart > position) {
+ return false;
+ }
+
+ // If the next token is also on our line then we don't want to offer completion.
+ if (IsOnStartLine (text, startLineNumber, token.GetNextToken ().SpanStart)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ static bool IsOnStartLine (SourceText text, int startLineNumber, int position)
+ {
+ return text.Lines.IndexOf (position) == startLineNumber;
+ }
+
+ static bool TryDetermineModifiers(ref SyntaxToken startToken, SourceText text, int startLine, out Accessibility seenAccessibility/*, out DeclarationModifiers modifiers*/)
+ {
+ var token = startToken;
+ //modifiers = new DeclarationModifiers();
+ seenAccessibility = Accessibility.NotApplicable;
+ var overrideToken = default(SyntaxToken);
+
+ while (IsOnStartLine(token.SpanStart, text, startLine) && !token.IsKind(SyntaxKind.None))
+ {
+ switch (token.Kind())
+ {
+ //case SyntaxKind.UnsafeKeyword:
+ // isUnsafe = true;
+ //break;
+ case SyntaxKind.OverrideKeyword:
+ overrideToken = token;
+ break;
+ //case SyntaxKind.SealedKeyword:
+ // isSealed = true;
+ //break;
+ //case SyntaxKind.AbstractKeyword:
+ // isAbstract = true;
+ //break;
+ case SyntaxKind.ExternKeyword:
+ break;
+
+ // Filter on the most recently typed accessibility; keep the first one we see
+ case SyntaxKind.PublicKeyword:
+ if (seenAccessibility == Accessibility.NotApplicable)
+ {
+ seenAccessibility = Accessibility.Public;
+ }
+
+ break;
+ case SyntaxKind.InternalKeyword:
+ if (seenAccessibility == Accessibility.NotApplicable)
+ {
+ seenAccessibility = Accessibility.Internal;
+ }
+
+ // If we see internal AND protected, filter for protected internal
+ if (seenAccessibility == Accessibility.Protected)
+ {
+ seenAccessibility = Accessibility.ProtectedOrInternal;
+ }
+
+ break;
+ case SyntaxKind.ProtectedKeyword:
+ if (seenAccessibility == Accessibility.NotApplicable)
+ {
+ seenAccessibility = Accessibility.Protected;
+ }
+
+ // If we see protected AND internal, filter for protected internal
+ if (seenAccessibility == Accessibility.Internal)
+ {
+ seenAccessibility = Accessibility.ProtectedOrInternal;
+ }
+
+ break;
+ default:
+ // Anything else and we bail.
+ return false;
+ }
+
+ var previousToken = token.GetPreviousToken();
+
+ // We want only want to consume modifiers
+ if (previousToken.IsKind(SyntaxKind.None) || !IsOnStartLine(previousToken.SpanStart, text, startLine))
+ {
+ break;
+ }
+
+ token = previousToken;
+ }
+
+ startToken = token;
+ /* modifiers = new DeclarationModifiers ()
+ .WithIsUnsafe (isUnsafe)
+ .WithIsAbstract (isAbstract)
+ .WithIsOverride (true)
+ .WithIsSealed (isSealed);*/
+ return overrideToken.IsKind(SyntaxKind.OverrideKeyword) && IsOnStartLine(overrideToken.Parent.SpanStart, text, startLine);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/PartialContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/PartialContextHandler.cs
new file mode 100644
index 0000000000..8f656edf60
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/PartialContextHandler.cs
@@ -0,0 +1,203 @@
+//
+// PartialContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Linq;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis.CSharp;
+using System;
+using MonoDevelop.Ide.CodeCompletion;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class PartialContextHandler : CompletionContextHandler
+ {
+ public override bool IsTriggerCharacter (SourceText text, int position)
+ {
+ return IsTriggerAfterSpaceOrStartOfWordCharacter (text, position);
+ }
+
+ public override Task<bool> IsExclusiveAsync (CompletionContext completionContext, SyntaxContext ctx, CompletionTriggerInfo triggerInfo, CancellationToken cancellationToken)
+ {
+ var document = completionContext.Document;
+ var position = completionContext.Position;
+ var tree = ctx.SyntaxTree;
+
+ //DeclarationModifiers modifiers;
+ SyntaxToken token;
+
+ var semanticModel = ctx.SemanticModel;
+ var enclosingSymbol = semanticModel.GetEnclosingSymbol (position, cancellationToken) as INamedTypeSymbol;
+
+ // Only inside classes and structs
+ if (enclosingSymbol == null || !(enclosingSymbol.TypeKind == TypeKind.Struct || enclosingSymbol.TypeKind == TypeKind.Class)) {
+ return Task.FromResult (false);
+ }
+
+ if (!IsPartialCompletionContext (tree, position, cancellationToken/*, out modifiers*/, out token)) {
+ return Task.FromResult (false);
+ }
+
+ return Task.FromResult (true);
+
+ }
+
+ protected override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult completionResult, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ var document = completionContext.Document;
+ var position = completionContext.Position;
+ var tree = ctx.SyntaxTree;
+
+ //DeclarationModifiers modifiers;
+ SyntaxToken token;
+
+ var semanticModel = ctx.SemanticModel;
+ var enclosingSymbol = semanticModel.GetEnclosingSymbol (position, cancellationToken) as INamedTypeSymbol;
+
+ // Only inside classes and structs
+ if (enclosingSymbol == null || !(enclosingSymbol.TypeKind == TypeKind.Struct || enclosingSymbol.TypeKind == TypeKind.Class)) {
+ return Task.FromResult (Enumerable.Empty<CompletionData> ());
+ }
+
+ if (!IsPartialCompletionContext (tree, position, cancellationToken/*, out modifiers*/, out token)) {
+ if (enclosingSymbol != null && (token.IsKind (SyntaxKind.OpenBraceToken) || token.IsKind (SyntaxKind.CloseBraceToken) || token.IsKind (SyntaxKind.SemicolonToken))) {
+ return Task.FromResult (CreateCompletionData (engine, semanticModel, position, enclosingSymbol, token, false, cancellationToken));
+ }
+ return Task.FromResult (Enumerable.Empty<CompletionData> ());
+ }
+
+ return Task.FromResult (CreateCompletionData (engine, semanticModel, position, enclosingSymbol, token, true, cancellationToken));
+ }
+
+ protected virtual IEnumerable<CompletionData> CreateCompletionData (CompletionEngine engine, SemanticModel semanticModel, int position, INamedTypeSymbol enclosingType, SyntaxToken token, bool afterPartialKeyword, CancellationToken cancellationToken)
+ {
+ var symbols = semanticModel.LookupSymbols(position, container: enclosingType)
+ .OfType<IMethodSymbol>()
+ .Where(m => IsPartial(m) && m.PartialImplementationPart == null);
+
+ var list = new List<CompletionData> ();
+
+ var declarationBegin = afterPartialKeyword ? token.Parent.SpanStart : position - 1;
+ foreach (var m in symbols) {
+ var data = engine.Factory.CreatePartialCompletionData (
+ this,
+ declarationBegin,
+ enclosingType,
+ m,
+ afterPartialKeyword
+ );
+ list.Add (data);
+ }
+ return list;
+ }
+
+ static bool IsPartial(IMethodSymbol m)
+ {
+ if (m.DeclaredAccessibility != Accessibility.NotApplicable &&
+ m.DeclaredAccessibility != Accessibility.Private)
+ {
+ return false;
+ }
+
+ if (!m.ReturnsVoid)
+ {
+ return false;
+ }
+
+ if (m.IsVirtual)
+ {
+ return false;
+ }
+
+ var declarations = m.DeclaringSyntaxReferences.Select(r => r.GetSyntax()).OfType<MethodDeclarationSyntax>();
+ return declarations.Any(d => d.Body == null && d.Modifiers.Any(SyntaxKind.PartialKeyword));
+ }
+
+ static bool IsPartialCompletionContext(SyntaxTree tree, int position, CancellationToken cancellationToken, /*out DeclarationModifiers modifiers, */out SyntaxToken token)
+ {
+ var touchingToken = tree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ var targetToken = touchingToken.GetPreviousTokenIfTouchingWord(position);
+ var text = tree.GetText(cancellationToken);
+
+ token = targetToken;
+
+ //modifiers = default(DeclarationModifiers);
+
+ if (targetToken.IsKind(SyntaxKind.VoidKeyword, SyntaxKind.PartialKeyword) ||
+ (targetToken.Kind() == SyntaxKind.IdentifierToken && targetToken.HasMatchingText(SyntaxKind.PartialKeyword)))
+ {
+ return !IsOnSameLine (touchingToken.GetNextToken (), touchingToken, text) &&
+ VerifyModifiers (tree, position, cancellationToken/*, out modifiers*/);
+ }
+
+ return false;
+ }
+
+ static bool VerifyModifiers(SyntaxTree tree, int position, CancellationToken cancellationToken/*, out DeclarationModifiers modifiers*/)
+ {
+ var touchingToken = tree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ var token = touchingToken.GetPreviousToken();
+
+ bool foundPartial = touchingToken.IsKindOrHasMatchingText(SyntaxKind.PartialKeyword);
+ //bool foundAsync = false;
+
+ while (IsOnSameLine(token, touchingToken, tree.GetText(cancellationToken)))
+ {
+ if (token.IsKind(SyntaxKind.ExternKeyword, SyntaxKind.PublicKeyword, SyntaxKind.ProtectedKeyword, SyntaxKind.InternalKeyword))
+ {
+ //modifiers = default(DeclarationModifiers);
+ return false;
+ }
+
+ //if (token.IsKindOrHasMatchingText(SyntaxKind.AsyncKeyword))
+ //{
+ // foundAsync = true;
+ //}
+
+ foundPartial = foundPartial || token.IsKindOrHasMatchingText(SyntaxKind.PartialKeyword);
+
+ token = token.GetPreviousToken();
+ }
+
+ /*modifiers = new DeclarationModifiers()
+ .WithPartial(true)
+ .WithAsync (foundAsync);*/
+ return foundPartial;
+ }
+
+ static bool IsOnSameLine(SyntaxToken syntaxToken, SyntaxToken touchingToken, SourceText text)
+ {
+ return !syntaxToken.IsKind(SyntaxKind.None)
+ && !touchingToken.IsKind(SyntaxKind.None)
+ && text.Lines.IndexOf(syntaxToken.SpanStart) == text.Lines.IndexOf(touchingToken.SpanStart);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/PreProcessorExpressionContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/PreProcessorExpressionContextHandler.cs
new file mode 100644
index 0000000000..0a9051cec3
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/PreProcessorExpressionContextHandler.cs
@@ -0,0 +1,59 @@
+//
+// PreProcessorExpressionContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Threading;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.CodeCompletion;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class PreProcessorExpressionContextHandler : CompletionContextHandler
+ {
+ public override bool IsTriggerCharacter (Microsoft.CodeAnalysis.Text.SourceText text, int position)
+ {
+ return IsTriggerAfterSpaceOrStartOfWordCharacter (text, position);
+ }
+
+ protected override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult completionResult, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ var model = ctx.SemanticModel;
+
+ var result = new List<CompletionData> ();
+ if (ctx.IsPreProcessorExpressionContext) {
+ var parseOptions = model.SyntaxTree.Options as CSharpParseOptions;
+ foreach (var define in parseOptions.PreprocessorSymbolNames) {
+ result.Add(engine.Factory.CreateGenericData (this, define, GenericDataType.PreprocessorSymbol));
+ }
+ }
+ return Task.FromResult ((IEnumerable<CompletionData>)result);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/RegexContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/RegexContextHandler.cs
new file mode 100644
index 0000000000..c53f466fd2
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/RegexContextHandler.cs
@@ -0,0 +1,170 @@
+//
+// RegexContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Ide.TypeSystem;
+using Microsoft.CodeAnalysis.Text;
+using ICSharpCode.NRefactory6.CSharp.Analysis;
+using MonoDevelop.Ide;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class RegexContextHandler : CompletionContextHandler
+ {
+ public override bool IsTriggerCharacter (Microsoft.CodeAnalysis.Text.SourceText text, int position)
+ {
+ var ch = text [position];
+ return ch == '\\' || base.IsTriggerCharacter (text, position);
+ }
+
+ protected override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult completionResult, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ var document = completionContext.Document;
+ var position = completionContext.Position;
+ var semanticModel = ctx.SemanticModel;
+ if (info.TriggerCharacter == '\\') {
+ if (ctx.TargetToken.Parent != null && ctx.TargetToken.Parent.Parent != null &&
+ ctx.TargetToken.Parent.Parent.IsKind (SyntaxKind.Argument)) {
+ var argument = ctx.TargetToken.Parent.Parent as ArgumentSyntax;
+
+ var symbolInfo = semanticModel.GetSymbolInfo (ctx.TargetToken.Parent.Parent.Parent.Parent);
+ if (symbolInfo.Symbol == null)
+ return TaskUtil.EmptyEnumerable<CompletionData> ();
+
+ if (SemanticHighlightingVisitor<int>.IsRegexMatchMethod (symbolInfo)) {
+ if (((ArgumentListSyntax)argument.Parent).Arguments [1] != argument)
+ return TaskUtil.EmptyEnumerable<CompletionData> ();
+ completionResult.AutoSelect = false;
+ return Task.FromResult (GetFormatCompletionData (engine, argument.Expression.ToString () [0] == '@'));
+ }
+ if (SemanticHighlightingVisitor<int>.IsRegexConstructor (symbolInfo)) {
+ if (((ArgumentListSyntax)argument.Parent).Arguments [0] != argument)
+ return TaskUtil.EmptyEnumerable<CompletionData> ();
+ completionResult.AutoSelect = false;
+ return Task.FromResult (GetFormatCompletionData (engine, argument.Expression.ToString () [0] == '@'));
+ }
+ }
+ } else {
+ var ma = ctx.TargetToken.Parent as MemberAccessExpressionSyntax;
+ if (ma != null) {
+ var symbolInfo = semanticModel.GetSymbolInfo (ma.Expression);
+ var typeInfo = semanticModel.GetTypeInfo (ma.Expression);
+ var type = typeInfo.Type;
+ if (type != null && type.Name == "Match" && type.ContainingNamespace.GetFullName () == "System.Text.RegularExpressions" ) {
+ var items = new List<CompletionData>();
+ foreach (var grp in GetGroups (ctx, symbolInfo.Symbol)) {
+ items.Add (engine.Factory.CreateGenericData (this, "Groups[\"" + grp + "\"]", GenericDataType.Undefined));
+ }
+
+ return Task.FromResult ((IEnumerable<CompletionData>)items);
+ }
+ }
+ }
+ return TaskUtil.EmptyEnumerable<CompletionData> ();
+ }
+
+ IEnumerable<string> GetGroups (SyntaxContext ctx, ISymbol symbol)
+ {
+ var root = ctx.SyntaxTree.GetRoot ();
+ foreach (var decl in symbol.DeclaringSyntaxReferences) {
+ Optional<object> val = null;
+
+ var node = root.FindNode (decl.Span) as VariableDeclaratorSyntax;
+ if (node == null)
+ continue;
+ var invocation = node.Initializer.Value as InvocationExpressionSyntax;
+ var invocationSymbol = ctx.SemanticModel.GetSymbolInfo (invocation).Symbol;
+ if (invocationSymbol.Name == "Match" && SemanticHighlightingVisitor<int>.IsRegexType (invocationSymbol.ContainingType)) {
+ if (invocation.ArgumentList.Arguments.Count == 1) {
+ var memberAccess = invocation.Expression as MemberAccessExpressionSyntax;
+ if (memberAccess == null)
+ continue;
+ var target = ctx.SemanticModel.GetSymbolInfo (memberAccess.Expression).Symbol;
+ if (target.DeclaringSyntaxReferences.Length == 0)
+ continue;
+ var targetNode = root.FindNode (target.DeclaringSyntaxReferences.First ().Span) as VariableDeclaratorSyntax;
+ if (targetNode == null)
+ continue;
+ var objectCreation = targetNode.Initializer.Value as ObjectCreationExpressionSyntax;
+ if (objectCreation == null)
+ continue;
+ var targetNodeSymbol = ctx.SemanticModel.GetSymbolInfo (objectCreation).Symbol;
+ if (SemanticHighlightingVisitor<int>.IsRegexType (targetNodeSymbol.ContainingType)) {
+ if (objectCreation.ArgumentList.Arguments.Count < 1)
+ continue;
+ val = ctx.SemanticModel.GetConstantValue (objectCreation.ArgumentList.Arguments [0].Expression);
+ }
+ } else {
+ if (invocation.ArgumentList.Arguments.Count < 2)
+ continue;
+ val = ctx.SemanticModel.GetConstantValue (invocation.ArgumentList.Arguments [1].Expression);
+ }
+
+ if (!val.HasValue)
+ continue;
+ var str = val.Value.ToString ();
+ int idx = -1;
+ while ((idx = str.IndexOf ("(?<", idx + 1, StringComparison.Ordinal)) >= 0) {
+ var closingIndex = str.IndexOf (">", idx, StringComparison.Ordinal);
+ if (closingIndex >= idx) {
+ yield return str.Substring (idx + 3, closingIndex - idx - 3);
+ idx = closingIndex - 1;
+ }
+ }
+ }
+ }
+ }
+
+ IEnumerable<CompletionData> GetFormatCompletionData (CompletionEngine engine, bool isVerbatimString)
+ {
+ yield return engine.Factory.CreateFormatItemCompletionData(this, (isVerbatimString ? "" : "\\") +"d", "Digit character", null);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, (isVerbatimString ? "" : "\\") +"D", "Non-digit character", null);
+
+ yield return engine.Factory.CreateFormatItemCompletionData(this, (isVerbatimString ? "" : "\\") +"b", "Word boundary", null);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, (isVerbatimString ? "" : "\\") +"B", "Non-word boundary", null);
+
+ yield return engine.Factory.CreateFormatItemCompletionData(this, (isVerbatimString ? "" : "\\") +"w", "Word character", null);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, (isVerbatimString ? "" : "\\") +"W", "Non-word character", null);
+
+ yield return engine.Factory.CreateFormatItemCompletionData(this, (isVerbatimString ? "" : "\\") +"s", "White-space character", null);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, (isVerbatimString ? "" : "\\") +"S", "Non-white-space character", null);
+
+ yield return engine.Factory.CreateFormatItemCompletionData(this, (isVerbatimString ? "" : "\\") +"A", "Start boundary", null);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, (isVerbatimString ? "" : "\\") +"Z", "End boundary", null);
+
+ yield return engine.Factory.CreateFormatItemCompletionData(this, (isVerbatimString ? "" : "\\") +"k<name>", "Named backreference", null);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, (isVerbatimString ? "" : "\\") +"P{name}", "Negative unicode category or unicode block", null);
+ yield return engine.Factory.CreateFormatItemCompletionData(this, (isVerbatimString ? "" : "\\") +"p{name}", "Unicode category or unicode block", null);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/RoslynRecommendationsCompletionContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/RoslynRecommendationsCompletionContextHandler.cs
new file mode 100644
index 0000000000..ba0e749494
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/RoslynRecommendationsCompletionContextHandler.cs
@@ -0,0 +1,188 @@
+//
+// RoslynRecommendationsCompletionContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis.Recommendations;
+using Microsoft.CodeAnalysis;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp;
+
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Ide.CodeCompletion;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+
+ // class CompletionEngineCache
+ // {
+ // public List<INamespace> namespaces;
+ // public ICompletionData[] importCompletion;
+ // }
+
+ class RoslynRecommendationsCompletionContextHandler : CompletionContextHandler
+ {
+ public override bool IsTriggerCharacter (SourceText text, int position)
+ {
+ var ch = text [position];
+ return ch == '.' ||
+ ch == ' ' && position >= 1 && !char.IsWhiteSpace (text [position - 1]) ||
+ ch == '#' || // pre processor directives
+ ch == '>' && position >= 1 && text [position - 1] == '-' || // pointer member access
+ ch == ':' && position >= 1 && text [position - 1] == ':' || // alias name
+ IsStartingNewWord (text, position);
+ }
+
+ bool IsException (ITypeSymbol type)
+ {
+ if (type == null)
+ return false;
+ if (type.Name == "Exception" && type.ContainingNamespace.Name == "System")
+ return true;
+ return IsException (type.BaseType);
+ }
+
+ protected override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult completionResult, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ var semanticModel = ctx.SemanticModel;
+ var result = new List<CompletionData> ();
+ if (info.TriggerCharacter == ' ') {
+ var newExpression = ObjectCreationContextHandler.GetObjectCreationNewExpression (ctx.SyntaxTree, completionContext.Position, cancellationToken);
+ if (newExpression == null && info.CompletionTriggerReason == CompletionTriggerReason.CharTyped && !ctx.LeftToken.IsKind (SyntaxKind.EqualsToken) && !ctx.LeftToken.IsKind (SyntaxKind.EqualsEqualsToken))
+ return Task.FromResult (Enumerable.Empty<CompletionData> ());
+
+ completionResult.AutoCompleteEmptyMatch = false;
+ }
+
+ var parent = ctx.TargetToken.Parent;
+ bool isInAttribute = ctx.CSharpSyntaxContext.IsAttributeNameContext;
+ bool isInBaseList = parent != null && parent.IsKind (SyntaxKind.BaseList);
+ bool isInUsingDirective = parent != null && parent.Parent != null && parent.Parent.IsKind (SyntaxKind.UsingDirective) && !parent.IsKind (SyntaxKind.QualifiedName);
+ var isInQuery = ctx.CSharpSyntaxContext.IsInQuery;
+ var completionDataLookup = new Dictionary<Tuple<string, SymbolKind>, ISymbolCompletionData> ();
+ bool isInCatchTypeExpression = parent != null && parent.IsKind (SyntaxKind.CatchDeclaration) ||
+ parent.IsKind (SyntaxKind.QualifiedName) && parent.Parent != null && parent.Parent.IsKind (SyntaxKind.CatchDeclaration);
+ Action<ISymbolCompletionData> addData = d => {
+ var key = Tuple.Create (d.DisplayText, d.Symbol.Kind);
+ ISymbolCompletionData data;
+ if (completionDataLookup.TryGetValue (key, out data)) {
+ data.AddOverload (d);
+ return;
+ }
+ completionDataLookup.Add (key, d);
+ result.Add (d);
+ };
+
+ var completionCategoryLookup = new Dictionary<string, CompletionCategory> ();
+ foreach (var symbol in Recommender.GetRecommendedSymbolsAtPosition (semanticModel, completionContext.Position, engine.Workspace, null, cancellationToken)) {
+ if (symbol.Kind == SymbolKind.NamedType) {
+ if (isInAttribute) {
+ var type = (ITypeSymbol)symbol;
+ if (type.IsAttribute ()) {
+ var v = type.Name.Substring (0, type.Name.Length - "Attribute".Length);
+ var needsEscaping = SyntaxFacts.GetKeywordKind(v) != SyntaxKind.None;
+ needsEscaping = needsEscaping || (isInQuery && SyntaxFacts.IsQueryContextualKeyword(SyntaxFacts.GetContextualKeywordKind(v)));
+ if (!needsEscaping) {
+ addData (engine.Factory.CreateSymbolCompletionData (this, symbol, v));
+ continue;
+ }
+ }
+ }
+ if (isInBaseList) {
+ var type = (ITypeSymbol)symbol;
+ if (type.IsSealed || type.IsStatic)
+ continue;
+ }
+ if (isInCatchTypeExpression) {
+ var type = (ITypeSymbol)symbol;
+ if (!IsException (type))
+ continue;
+ }
+ }
+
+ if (isInUsingDirective && symbol.Kind != SymbolKind.Namespace)
+ continue;
+
+ var newData = engine.Factory.CreateSymbolCompletionData (this, symbol, symbol.Name.EscapeIdentifier (isInQuery));
+ ISymbol categorySymbol;
+ var method = symbol as IMethodSymbol;
+ if (method != null) {
+ if (method.IsReducedExtension ()) {
+ categorySymbol = method.ReceiverType;
+ } else {
+ categorySymbol = (ISymbol)symbol.ContainingType;
+ }
+ } else {
+ categorySymbol = (ISymbol)symbol.ContainingType ?? symbol.ContainingNamespace;
+ }
+ if (categorySymbol != null) {
+ CompletionCategory category;
+ var key = categorySymbol.ToDisplayString ();
+ if (!completionCategoryLookup.TryGetValue (key, out category)) {
+ completionCategoryLookup [key] = category = engine.Factory.CreateCompletionDataCategory (categorySymbol);
+ }
+ newData.CompletionCategory = category;
+ }
+ addData (newData);
+ }
+ return Task.FromResult ((IEnumerable<CompletionData>)result);
+ }
+
+ protected override async Task<bool> IsSemanticTriggerCharacterAsync(Document document, int characterPosition, CancellationToken cancellationToken)
+ {
+ bool? result = await IsTriggerOnDotAsync(document, characterPosition, cancellationToken).ConfigureAwait(false);
+ if (result.HasValue)
+ {
+ return result.Value;
+ }
+
+ return true;
+ }
+
+ private async Task<bool?> IsTriggerOnDotAsync(Document document, int characterPosition, CancellationToken cancellationToken)
+ {
+ var text = await document.GetTextAsync(cancellationToken).ConfigureAwait(false);
+ if (text[characterPosition] != '.')
+ {
+ return null;
+ }
+
+ // don't want to trigger after a number. All other cases after dot are ok.
+ var tree = await document.GetCSharpSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ var token = tree.FindToken(characterPosition);
+ if (token.Kind() == SyntaxKind.DotToken)
+ {
+ token = token.GetPreviousToken();
+ }
+
+ return token.Kind() != SyntaxKind.NumericLiteralToken;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/SenderCompletionContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/SenderCompletionContextHandler.cs
new file mode 100644
index 0000000000..8d1ff8733a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/SenderCompletionContextHandler.cs
@@ -0,0 +1,123 @@
+//
+// SenderCompletionContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Threading;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class SenderCompletionContextHandler : CompletionContextHandler
+ {
+ protected override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult completionResult, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ var position = completionContext.Position;
+ var document = completionContext.Document;
+ var syntaxTree = ctx.SyntaxTree;
+ if (syntaxTree.IsInNonUserCode(position, cancellationToken) ||
+ syntaxTree.IsPreProcessorDirectiveContext(position, cancellationToken))
+ return Task.FromResult (Enumerable.Empty<CompletionData> ());
+ if (!syntaxTree.IsRightOfDotOrArrowOrColonColon(position, cancellationToken))
+ return Task.FromResult (Enumerable.Empty<CompletionData> ());
+ var ma = ctx.LeftToken.Parent as MemberAccessExpressionSyntax;
+ if (ma == null)
+ return Task.FromResult (Enumerable.Empty<CompletionData> ());
+
+ var model = ctx.CSharpSyntaxContext.SemanticModel;
+
+ var symbolInfo = model.GetSymbolInfo (ma.Expression);
+ if (symbolInfo.Symbol == null || symbolInfo.Symbol.Kind != SymbolKind.Parameter)
+ return Task.FromResult (Enumerable.Empty<CompletionData> ());
+ var list = new List<CompletionData> ();
+ var within = model.GetEnclosingNamedTypeOrAssembly(position, cancellationToken);
+ var addedSymbols = new HashSet<string> ();
+
+ foreach (var ano in ma.AncestorsAndSelf ().OfType<AnonymousMethodExpressionSyntax> ()) {
+ Analyze (engine, model, ma.Expression, within, list, ano.ParameterList, symbolInfo.Symbol, addedSymbols, cancellationToken);
+ }
+
+ foreach (var ano in ma.AncestorsAndSelf ().OfType<ParenthesizedLambdaExpressionSyntax> ()) {
+ Analyze (engine, model, ma.Expression, within, list, ano.ParameterList, symbolInfo.Symbol, addedSymbols, cancellationToken);
+ }
+
+ return Task.FromResult ((IEnumerable<CompletionData>)list);
+ }
+
+ void Analyze (CompletionEngine engine,SemanticModel model, SyntaxNode node, ISymbol within, List<CompletionData> list, ParameterListSyntax parameterList, ISymbol symbol, HashSet<string> addedSymbols, CancellationToken cancellationToken)
+ {
+ var type = CheckParameterList (model, parameterList, symbol, cancellationToken);
+ if (type == null)
+ return;
+ var startType = type;
+
+ while (type.SpecialType != SpecialType.System_Object) {
+ foreach (var member in type.GetMembers ()) {
+ if (member.IsImplicitlyDeclared || member.IsStatic)
+ continue;
+ if (member.IsOrdinaryMethod () || member.Kind == SymbolKind.Field || member.Kind == SymbolKind.Property) {
+ if (member.IsAccessibleWithin (within)) {
+ var completionData = engine.Factory.CreateCastCompletionData(this, member, node, startType);
+ if (addedSymbols.Contains (completionData.DisplayText))
+ continue;
+ addedSymbols.Add (completionData.DisplayText);
+ list.Add (completionData);
+ }
+ }
+ }
+
+ type = type.BaseType;
+ }
+ }
+
+ static ITypeSymbol CheckParameterList (SemanticModel model, ParameterListSyntax listSyntax, ISymbol parameter, CancellationToken cancellationToken)
+ {
+ var param = listSyntax?.Parameters.FirstOrDefault ();
+ if (param == null)
+ return null;
+ var declared = model.GetDeclaredSymbol (param, cancellationToken);
+ if (declared != parameter)
+ return null;
+ var assignmentExpr = listSyntax.Parent.Parent as AssignmentExpressionSyntax;
+ if (assignmentExpr == null || !assignmentExpr.IsKind (SyntaxKind.AddAssignmentExpression))
+ return null;
+ var left = assignmentExpr.Left as MemberAccessExpressionSyntax;
+ if (left == null)
+ return null;
+ var symbolInfo = model.GetSymbolInfo (left.Expression);
+ if (symbolInfo.Symbol == null || symbolInfo.Symbol is ITypeSymbol)
+ return null;
+ return model.GetTypeInfo (left.Expression).Type;
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/SnippetContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/SnippetContextHandler.cs
new file mode 100644
index 0000000000..a37fef24e8
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/SnippetContextHandler.cs
@@ -0,0 +1,105 @@
+//
+// SnippetContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+
+using System;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.Linq;
+using MonoDevelop.Ide.CodeCompletion;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class SnippetContextHandler : CompletionContextHandler
+ {
+ protected async override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult completionResult, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ var document = completionContext.Document;
+ var position = completionContext.Position;
+
+ var syntaxTree = await document.GetCSharpSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
+
+ if (syntaxTree.IsInNonUserCode(position, cancellationToken) ||
+ syntaxTree.IsRightOfDotOrArrowOrColonColon(position, cancellationToken) ||
+ syntaxTree.GetContainingTypeOrEnumDeclaration(position, cancellationToken) is EnumDeclarationSyntax)
+ {
+ return Enumerable.Empty<CompletionData>();
+ }
+
+ // var span = new TextSpan(position, 0);
+// var semanticModel = await document.GetCSharpSemanticModelForSpanAsync(span, cancellationToken).ConfigureAwait(false);
+ if (syntaxTree.IsPreProcessorDirectiveContext(position, cancellationToken))
+ {
+ var directive = syntaxTree.GetRoot(cancellationToken).FindTokenOnLeftOfPosition(position, includeDirectives: true).GetAncestor<DirectiveTriviaSyntax>();
+ if (directive.DirectiveNameToken.IsKind(
+ SyntaxKind.IfKeyword,
+ SyntaxKind.RegionKeyword,
+ SyntaxKind.ElseKeyword,
+ SyntaxKind.ElifKeyword,
+ SyntaxKind.ErrorKeyword,
+ SyntaxKind.LineKeyword,
+ SyntaxKind.PragmaKeyword,
+ SyntaxKind.EndIfKeyword,
+ SyntaxKind.UndefKeyword,
+ SyntaxKind.EndRegionKeyword,
+ SyntaxKind.WarningKeyword))
+ {
+ return Enumerable.Empty<CompletionData>();
+ }
+
+ return await GetSnippetCompletionItemsAsync(cancellationToken).ConfigureAwait(false);
+ }
+ var tokenLeftOfPosition = syntaxTree.FindTokenOnLeftOfPosition (position, cancellationToken);
+
+ if (syntaxTree.IsGlobalStatementContext(position, cancellationToken) ||
+ syntaxTree.IsExpressionContext(position, tokenLeftOfPosition, true, cancellationToken) ||
+ syntaxTree.IsStatementContext(position, tokenLeftOfPosition, cancellationToken) ||
+ syntaxTree.IsTypeContext(position, cancellationToken) ||
+ syntaxTree.IsTypeDeclarationContext(position, tokenLeftOfPosition, cancellationToken) ||
+ syntaxTree.IsNamespaceContext(position, cancellationToken) ||
+ syntaxTree.IsMemberDeclarationContext(position, tokenLeftOfPosition, cancellationToken) ||
+ syntaxTree.IsLabelContext(position, cancellationToken))
+ {
+ return await GetSnippetCompletionItemsAsync(cancellationToken).ConfigureAwait(false);
+ }
+
+ return Enumerable.Empty<CompletionData>();
+ }
+
+ Task<IEnumerable<CompletionData>> GetSnippetCompletionItemsAsync(CancellationToken cancellationToken)
+ {
+ if (CompletionEngine.SnippetCallback == null)
+ return Task.FromResult (Enumerable.Empty<CompletionData>());
+ return CompletionEngine.SnippetCallback (cancellationToken);
+ }
+
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/SpeculativeNameContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/SpeculativeNameContextHandler.cs
new file mode 100644
index 0000000000..a7692ddde8
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/SpeculativeNameContextHandler.cs
@@ -0,0 +1,130 @@
+//
+// SpeculativeNameContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using System.Text;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using MonoDevelop.Ide.CodeCompletion;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class SpeculativeNameContextHandler : CompletionContextHandler
+ {
+ protected async override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult completionResult, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ var tree = await completionContext.Document.GetCSharpSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
+ if (tree.IsInNonUserCode(completionContext.Position, cancellationToken) ||
+ tree.IsPreProcessorDirectiveContext(completionContext.Position, cancellationToken) ||
+ info.CompletionTriggerReason != CompletionTriggerReason.CompletionCommand)
+ return Enumerable.Empty<CompletionData>();
+
+ var token = tree.FindTokenOnLeftOfPosition(completionContext.Position, cancellationToken);
+ if (token.Span.End == completionContext.Position)
+ return Enumerable.Empty<CompletionData>();
+ var parent = token.Parent.AncestorsAndSelf ().OfType<GenericNameSyntax> ().FirstOrDefault () ?? token.Parent;
+
+ if (!parent.Parent.IsKind (SyntaxKind.IncompleteMember) &&
+ !IsLocal(parent) &&
+ !parent.Parent.IsKind (SyntaxKind.Parameter) &&
+ !parent.Parent.IsKind (SyntaxKind.ForEachStatement)) {
+ return Enumerable.Empty<CompletionData>();
+ }
+
+ if (info.TriggerCharacter != ' ' &&
+ parent.Parent.IsKind (SyntaxKind.ExpressionStatement)) {
+ return Enumerable.Empty<CompletionData>();
+ }
+ var list = new List<CompletionData> ();
+
+ if (parent.IsKind(SyntaxKind.PredefinedType)) {
+ switch (token.Kind()) {
+ case SyntaxKind.ObjectKeyword:
+ list.Add (engine.Factory.CreateGenericData(this, "o", GenericDataType.NameProposal));
+ list.Add (engine.Factory.CreateGenericData(this, "obj", GenericDataType.NameProposal));
+ return list;
+ case SyntaxKind.BoolKeyword:
+ list.Add (engine.Factory.CreateGenericData(this, "b", GenericDataType.NameProposal));
+ list.Add (engine.Factory.CreateGenericData(this, "pred", GenericDataType.NameProposal));
+ return list;
+ case SyntaxKind.CharKeyword:
+ list.Add (engine.Factory.CreateGenericData(this, "c", GenericDataType.NameProposal));
+ list.Add (engine.Factory.CreateGenericData(this, "ch", GenericDataType.NameProposal));
+ return list;
+ case SyntaxKind.StringKeyword:
+ list.Add (engine.Factory.CreateGenericData(this, "str", GenericDataType.NameProposal));
+ return list;
+ case SyntaxKind.DoubleKeyword:
+ case SyntaxKind.FloatKeyword:
+ case SyntaxKind.DecimalKeyword:
+ list.Add (engine.Factory.CreateGenericData(this, "d", GenericDataType.NameProposal));
+ list.Add (engine.Factory.CreateGenericData(this, "f", GenericDataType.NameProposal));
+ list.Add (engine.Factory.CreateGenericData(this, "m", GenericDataType.NameProposal));
+ return list;
+ default:
+ list.Add (engine.Factory.CreateGenericData(this, "i", GenericDataType.NameProposal));
+ list.Add (engine.Factory.CreateGenericData(this, "j", GenericDataType.NameProposal));
+ list.Add (engine.Factory.CreateGenericData(this, "k", GenericDataType.NameProposal));
+ return list;
+ }
+ } else {
+ var incompleteMember = parent.Parent as IncompleteMemberSyntax;
+ if (incompleteMember != null)
+ return list;
+ var gns = parent as GenericNameSyntax;
+ var names = WordParser.BreakWords (gns != null ? gns.Identifier.ToString () : token.ToString ().Trim ());
+ var possibleName = new StringBuilder ();
+ for (int i = 0; i < names.Count; i++) {
+ possibleName.Length = 0;
+ for (int j = i; j < names.Count; j++) {
+ if (string.IsNullOrEmpty (names [j])) {
+ continue;
+ }
+ if (j == i) {
+ names [j] = Char.ToLower (names [j] [0]) + names [j].Substring (1);
+ }
+ possibleName.Append (names [j]);
+ }
+ list.Add (engine.Factory.CreateGenericData (this, possibleName.ToString (), GenericDataType.NameProposal));
+ }
+ }
+ return list;
+ }
+
+ bool IsLocal (SyntaxNode tokenParent)
+ {
+ if ((tokenParent.IsKind (SyntaxKind.GenericName) || tokenParent.IsKind (SyntaxKind.IdentifierName) || tokenParent.IsKind (SyntaxKind.PredefinedType)) &&
+ (tokenParent.Parent.IsKind (SyntaxKind.ExpressionStatement) || tokenParent.Parent.IsKind (SyntaxKind.VariableDeclaration)))
+ return true;
+ return false;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/SpeculativeTContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/SpeculativeTContextHandler.cs
new file mode 100644
index 0000000000..9c972e7a5f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/SpeculativeTContextHandler.cs
@@ -0,0 +1,104 @@
+//
+// SpeculativeTContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+
+using System;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+using MonoDevelop.Ide.CodeCompletion;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class SpeculativeTContextHandler : CompletionContextHandler
+ {
+ protected async override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult completionResult, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ var document = completionContext.Document;
+ var position = completionContext.Position;
+
+ return await document.GetUnionResultsFromDocumentAndLinks(
+ UnionCompletionItemComparer.Instance,
+ async (doc, ct) => await GetSpeculativeTCompletions(engine, doc, position, ct).ConfigureAwait(false),
+ cancellationToken).ConfigureAwait(false);
+ }
+
+ private async Task<IEnumerable<CompletionData>> GetSpeculativeTCompletions(CompletionEngine engine, Document document, int position, CancellationToken cancellationToken)
+ {
+ var syntaxTree = await document.GetCSharpSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
+ if (syntaxTree.IsInNonUserCode(position, cancellationToken) ||
+ syntaxTree.IsPreProcessorDirectiveContext(position, cancellationToken))
+ {
+ return Enumerable.Empty<CompletionData>();
+ }
+
+ // If we're in a generic type argument context, use the start of the generic type name
+ // as the position for the rest of the context checks.
+ int testPosition = position;
+ var leftToken = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+
+ var semanticModel = await document.GetCSharpSemanticModelForNodeAsync(leftToken.Parent, cancellationToken).ConfigureAwait(false);
+ if (syntaxTree.IsGenericTypeArgumentContext(position, leftToken, cancellationToken, semanticModel))
+ {
+ // Walk out until we find the start of the partial written generic
+ SyntaxToken nameToken;
+ while (syntaxTree.IsInPartiallyWrittenGeneric(testPosition, cancellationToken, out nameToken))
+ {
+ testPosition = nameToken.SpanStart;
+ }
+
+ // If the user types Foo<T, automatic brace completion will insert the close brace
+ // and the generic won't be "partially written".
+ if (testPosition == position)
+ {
+ var typeArgumentList = leftToken.GetAncestor<TypeArgumentListSyntax>();
+ if (typeArgumentList != null)
+ {
+ if (typeArgumentList.LessThanToken != default(SyntaxToken) && typeArgumentList.GreaterThanToken != default(SyntaxToken))
+ {
+ testPosition = typeArgumentList.LessThanToken.SpanStart;
+ }
+ }
+ }
+ }
+
+ if ((!leftToken.GetPreviousTokenIfTouchingWord(position).IsKindOrHasMatchingText(SyntaxKind.AsyncKeyword) &&
+ syntaxTree.IsMemberDeclarationContext(testPosition, contextOpt: null, validModifiers: SyntaxKindSet.AllMemberModifiers, validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations, canBePartial: false, cancellationToken: cancellationToken)) ||
+ syntaxTree.IsGlobalMemberDeclarationContext(testPosition, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ syntaxTree.IsGlobalStatementContext(testPosition, cancellationToken) ||
+ syntaxTree.IsDelegateReturnTypeContext(testPosition, syntaxTree.FindTokenOnLeftOfPosition(testPosition, cancellationToken), cancellationToken))
+ {
+ const string T = "T";
+ return new [] { engine.Factory.CreateGenericData (this, T, GenericDataType.Undefined) };
+ }
+ return Enumerable.Empty<CompletionData>();
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/XmlDocCommentContextHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/XmlDocCommentContextHandler.cs
new file mode 100644
index 0000000000..f60ac12781
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ContextHandler/XmlDocCommentContextHandler.cs
@@ -0,0 +1,400 @@
+//
+// XmlDocCommentContextHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+
+using System;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.Text;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using MonoDevelop.Ide.CodeCompletion;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class XmlDocCommentContextHandler : CompletionContextHandler
+ {
+ protected async override Task<IEnumerable<CompletionData>> GetItemsWorkerAsync (CompletionResult completionResult, CompletionEngine engine, CompletionContext completionContext, CompletionTriggerInfo info, SyntaxContext ctx, CancellationToken cancellationToken)
+ {
+ if (info.IsDebugger)
+ {
+ return null;
+ }
+ var document = completionContext.Document;
+ var position = completionContext.Position;
+
+ var tree = await document.GetCSharpSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
+ var token = tree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ var parentTrivia = token.GetAncestor<DocumentationCommentTriviaSyntax>();
+
+ if (parentTrivia == null)
+ {
+ return null;
+ }
+
+ var items = new List<CompletionData>();
+ var text = await document.GetTextAsync(cancellationToken).ConfigureAwait(false);
+ var span = GetTextChangeSpan(text, position);
+
+ var attachedToken = parentTrivia.ParentTrivia.Token;
+ if (attachedToken.Kind() == SyntaxKind.None)
+ {
+ return null;
+ }
+
+ var semanticModel = await document.GetCSharpSemanticModelForNodeAsync(attachedToken.Parent, cancellationToken).ConfigureAwait(false);
+
+ ISymbol declaredSymbol = null;
+ var memberDeclaration = attachedToken.GetAncestor<MemberDeclarationSyntax>();
+ if (memberDeclaration != null)
+ {
+ declaredSymbol = semanticModel.GetDeclaredSymbol(memberDeclaration, cancellationToken);
+ }
+ else
+ {
+ var typeDeclaration = attachedToken.GetAncestor<TypeDeclarationSyntax>();
+ if (typeDeclaration != null)
+ {
+ declaredSymbol = semanticModel.GetDeclaredSymbol(typeDeclaration, cancellationToken);
+ }
+ }
+
+ if (declaredSymbol != null)
+ {
+ items.AddRange(GetTagsForSymbol(engine, declaredSymbol, span, parentTrivia, token));
+ }
+
+ if (token.Parent.Kind() == SyntaxKind.XmlEmptyElement || token.Parent.Kind() == SyntaxKind.XmlText ||
+ (token.Parent.IsKind(SyntaxKind.XmlElementEndTag) && token.IsKind(SyntaxKind.GreaterThanToken)) ||
+ (token.Parent.IsKind(SyntaxKind.XmlName) && token.Parent.IsParentKind(SyntaxKind.XmlEmptyElement)))
+ {
+ if (token.Parent.Parent.Kind() == SyntaxKind.XmlElement)
+ {
+ items.AddRange(GetNestedTags(engine, span));
+ }
+
+ if (token.Parent.Parent.Kind() == SyntaxKind.XmlElement && ((XmlElementSyntax)token.Parent.Parent).StartTag.Name.LocalName.ValueText == "list")
+ {
+ items.AddRange(GetListItems(engine, span));
+ }
+
+ if (token.Parent.IsParentKind(SyntaxKind.XmlEmptyElement) & token.Parent.Parent.IsParentKind(SyntaxKind.XmlElement))
+ {
+ var element = (XmlElementSyntax)token.Parent.Parent.Parent;
+ if (element.StartTag.Name.LocalName.ValueText == "list")
+ {
+ items.AddRange(GetListItems(engine, span));
+ }
+ }
+
+ if (token.Parent.Parent.Kind() == SyntaxKind.XmlElement && ((XmlElementSyntax)token.Parent.Parent).StartTag.Name.LocalName.ValueText == "listheader")
+ {
+ items.AddRange(GetListHeaderItems(engine, span));
+ }
+
+ if (token.Parent.Parent is DocumentationCommentTriviaSyntax)
+ {
+ items.AddRange(GetTopLevelSingleUseNames(engine, parentTrivia, span));
+ items.AddRange(GetTopLevelRepeatableItems(engine, span));
+ }
+ }
+
+ if (token.Parent.Kind() == SyntaxKind.XmlElementStartTag)
+ {
+ var startTag = (XmlElementStartTagSyntax)token.Parent;
+
+ if (token == startTag.GreaterThanToken && startTag.Name.LocalName.ValueText == "list")
+ {
+ items.AddRange(GetListItems(engine, span));
+ }
+
+ if (token == startTag.GreaterThanToken && startTag.Name.LocalName.ValueText == "listheader")
+ {
+ items.AddRange(GetListHeaderItems(engine, span));
+ }
+ }
+
+ items.AddRange(GetAlwaysVisibleItems(engine, span));
+ return items;
+ }
+
+ public override bool IsCommitCharacter (CompletionData ICompletionData, char ch, string textTypedSoFar)
+ {
+ if ((ch == '"' || ch == ' ')
+ && ICompletionData.DisplayText.Contains(ch))
+ {
+ return false;
+ }
+
+ return base.IsCommitCharacter(ICompletionData, ch, textTypedSoFar) || ch == '>' || ch == '\t';
+ }
+
+ public override bool IsTriggerCharacter (SourceText text, int position)
+ {
+ return text[position] == '<';
+ }
+//
+// public override bool SendEnterThroughToEditor(ICompletionData ICompletionData, string textTypedSoFar)
+// {
+// return false;
+// }
+
+ private IEnumerable<CompletionData> GetTopLevelSingleUseNames(CompletionEngine engine, DocumentationCommentTriviaSyntax parentTrivia, TextSpan span)
+ {
+ var names = new HashSet<string>(new[] { "summary", "remarks", "example", "completionlist" });
+
+ RemoveExistingTags(parentTrivia, names, (x) => x.StartTag.Name.LocalName.ValueText);
+
+ return names.Select(n => GetItem(engine, n, span));
+ }
+
+ private void RemoveExistingTags(DocumentationCommentTriviaSyntax parentTrivia, ISet<string> names, Func<XmlElementSyntax, string> selector)
+ {
+ if (parentTrivia != null)
+ {
+ foreach (var node in parentTrivia.Content)
+ {
+ var element = node as XmlElementSyntax;
+ if (element != null)
+ {
+ names.Remove(selector(element));
+ }
+ }
+ }
+ }
+
+ private IEnumerable<CompletionData> GetTagsForSymbol(CompletionEngine engine, ISymbol symbol, TextSpan filterSpan, DocumentationCommentTriviaSyntax trivia, SyntaxToken token)
+ {
+ if (symbol is IMethodSymbol)
+ {
+ return GetTagsForMethod(engine, (IMethodSymbol)symbol, filterSpan, trivia, token);
+ }
+
+ if (symbol is IPropertySymbol)
+ {
+ return GetTagsForProperty(engine, (IPropertySymbol)symbol, filterSpan, trivia);
+ }
+
+ if (symbol is INamedTypeSymbol)
+ {
+ return GetTagsForType(engine, (INamedTypeSymbol)symbol, filterSpan, trivia);
+ }
+
+ return SpecializedCollections.EmptyEnumerable<CompletionData>();
+ }
+
+ private IEnumerable<CompletionData> GetTagsForType(CompletionEngine engine, INamedTypeSymbol symbol, TextSpan filterSpan, DocumentationCommentTriviaSyntax trivia)
+ {
+ var items = new List<CompletionData>();
+
+ var typeParameters = symbol.TypeParameters.Select(p => p.Name).ToSet();
+
+ RemoveExistingTags(trivia, typeParameters, x => AttributeSelector(x, "typeparam"));
+
+ items.AddRange(typeParameters.Select(t => engine.Factory.CreateXmlDocCompletionData (
+ this,
+ FormatParameter("typeparam", t))));
+ return items;
+ }
+
+ private string AttributeSelector(XmlElementSyntax element, string attribute)
+ {
+ if (!element.StartTag.IsMissing && !element.EndTag.IsMissing)
+ {
+ var startTag = element.StartTag;
+ var nameAttribute = startTag.Attributes.OfType<XmlNameAttributeSyntax>().FirstOrDefault(a => a.Name.LocalName.ValueText == "name");
+ if (nameAttribute != null)
+ {
+ if (startTag.Name.LocalName.ValueText == attribute)
+ {
+ return nameAttribute.Identifier.Identifier.ValueText;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private IEnumerable<CompletionData> GetTagsForProperty(CompletionEngine engine, IPropertySymbol symbol, TextSpan filterSpan, DocumentationCommentTriviaSyntax trivia)
+ {
+ var items = new List<CompletionData>();
+
+ var typeParameters = symbol.GetTypeArguments().Select(p => p.Name).ToSet();
+
+ RemoveExistingTags(trivia, typeParameters, x => AttributeSelector(x, "typeparam"));
+
+ items.AddRange(typeParameters.Select(t => engine.Factory.CreateXmlDocCompletionData(this, "typeparam", null, "name$" + t)));
+ items.Add(engine.Factory.CreateXmlDocCompletionData(this, "value"));
+ return items;
+ }
+
+ private IEnumerable<CompletionData> GetTagsForMethod(CompletionEngine engine, IMethodSymbol symbol, TextSpan filterSpan, DocumentationCommentTriviaSyntax trivia, SyntaxToken token)
+ {
+ var items = new List<CompletionData>();
+
+ var parameters = symbol.GetParameters().Select(p => p.Name).ToSet();
+ var typeParameters = symbol.TypeParameters.Select(t => t.Name).ToSet();
+
+ // User is trying to write a name, try to suggest only names.
+ if (token.Parent.IsKind(SyntaxKind.XmlNameAttribute) ||
+ (token.Parent.IsKind(SyntaxKind.IdentifierName) && token.Parent.IsParentKind(SyntaxKind.XmlNameAttribute)))
+ {
+ string parentElementName = null;
+
+ var emptyElement = token.GetAncestor<XmlEmptyElementSyntax>();
+ if (emptyElement != null)
+ {
+ parentElementName = emptyElement.Name.LocalName.Text;
+ }
+
+ // We're writing the name of a paramref or typeparamref
+ if (parentElementName == "paramref")
+ {
+ items.AddRange(parameters.Select(p => engine.Factory.CreateXmlDocCompletionData (this, p)));
+ }
+ else if (parentElementName == "typeparamref")
+ {
+ items.AddRange(typeParameters.Select(t => engine.Factory.CreateXmlDocCompletionData (this, t)));
+ }
+
+ return items;
+ }
+
+ var returns = true;
+
+ RemoveExistingTags(trivia, parameters, x => AttributeSelector(x, "param"));
+ RemoveExistingTags(trivia, typeParameters, x => AttributeSelector(x, "typeparam"));
+
+ foreach (var node in trivia.Content)
+ {
+ var element = node as XmlElementSyntax;
+ if (element != null && !element.StartTag.IsMissing && !element.EndTag.IsMissing)
+ {
+ var startTag = element.StartTag;
+
+ if (startTag.Name.LocalName.ValueText == "returns")
+ {
+ returns = false;
+ break;
+ }
+ }
+ }
+
+ items.AddRange(parameters.Select(p => engine.Factory.CreateXmlDocCompletionData (this, FormatParameter("param", p))));
+ items.AddRange(typeParameters.Select(t => engine.Factory.CreateXmlDocCompletionData (this, FormatParameter("typeparam", t))));
+
+ if (returns && !symbol.ReturnsVoid)
+ {
+ items.Add(engine.Factory.CreateXmlDocCompletionData (this, "returns"));
+ }
+
+ return items;
+ }
+
+
+ readonly Dictionary<string, string[]> _tagMap = new Dictionary<string, string[]> {
+ { "exception", new[] { "<exception cref=\"", "\">" } },
+ { "!--", new[] { "<!--", "-->" } },
+ { "![CDATA[", new[] { "<![CDATA[", "]]>" } },
+ { "include", new[] { "<include file=\'", "\' path=\'[@name=\"\"]\'/>" } },
+ { "permission", new[] { "<permission cref=\"", "\"" } },
+ { "see", new[] { "<see cref=\"", "\"/>" } },
+ { "seealso", new[] { "<seealso cref=\"", "\"/>" } },
+ { "list", new[] { "<list type=\"", "\">" } },
+ { "paramref", new[] { "<paramref name=\"", "\"/>" } },
+ { "typeparamref", new[] { "<typeparamref name=\"", "\"/>" } },
+ { "completionlist", new[] { "<completionlist cref=\"", "\"/>" } },
+ };
+
+ readonly string[][] _attributeMap = {
+ new [] { "exception", "cref", "cref=\"", "\"" },
+ new [] { "permission", "cref", "cref=\"", "\"" },
+ new [] { "see", "cref", "cref=\"", "\"" },
+ new [] { "seealso", "cref", "cref=\"", "\"" },
+ new [] { "list", "type", "type=\"", "\"" },
+ new [] { "param", "name", "name=\"", "\"" },
+ new [] { "include", "file", "file=\"", "\"" },
+ new [] { "include", "path", "path=\"", "\"" }
+ };
+
+ protected CompletionData GetItem(CompletionEngine engine, string n, TextSpan span)
+ {
+ if (_tagMap.ContainsKey(n))
+ {
+ var value = _tagMap[n];
+ return engine.Factory.CreateXmlDocCompletionData (this, n, null, value [0] + "|" + value [1]);
+ }
+ return engine.Factory.CreateXmlDocCompletionData (this, n);
+ }
+
+ protected IEnumerable<CompletionData> GetAttributeItem(CompletionEngine engine, string n, TextSpan span)
+ {
+ var items = _attributeMap.Where(x => x[0] == n).Select(x => engine.Factory.CreateXmlDocCompletionData(this, x[1],null, x[2] + "|" + x[3]));
+ if (items.Any ())
+ return items;
+
+ return new [] { engine.Factory.CreateXmlDocCompletionData (this, n) };
+ }
+
+ protected IEnumerable<CompletionData> GetAlwaysVisibleItems(CompletionEngine engine, TextSpan filterSpan)
+ {
+ return new[] { "see", "seealso", "![CDATA[", "!--" }
+ .Select(t => GetItem(engine, t, filterSpan));
+ }
+
+ protected IEnumerable<CompletionData> GetNestedTags(CompletionEngine engine, TextSpan filterSpan)
+ {
+ return new[] { "c", "code", "para", "list", "paramref", "typeparamref" }
+ .Select(t => GetItem(engine, t, filterSpan));
+ }
+
+ protected IEnumerable<CompletionData> GetTopLevelRepeatableItems(CompletionEngine engine, TextSpan filterSpan)
+ {
+ return new[] { "exception", "include", "permission" }
+ .Select(t => GetItem(engine, t, filterSpan));
+ }
+
+ protected IEnumerable<CompletionData> GetListItems(CompletionEngine engine, TextSpan span)
+ {
+ return new[] { "listheader", "term", "item", "description" }
+ .Select(t => GetItem(engine, t, span));
+ }
+
+ protected IEnumerable<CompletionData> GetListHeaderItems(CompletionEngine engine, TextSpan span)
+ {
+ return new[] { "term", "description" }
+ .Select(t => GetItem(engine, t, span));
+ }
+
+ protected string FormatParameter(string kind, string name)
+ {
+ return string.Format("{0} name=\"{1}\"", kind, name);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/EditorBrowsableBehavior.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/EditorBrowsableBehavior.cs
new file mode 100644
index 0000000000..07e261a383
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/EditorBrowsableBehavior.cs
@@ -0,0 +1,35 @@
+//
+// EditorBrowsableBehavior.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ public enum EditorBrowsableBehavior
+ {
+ Ignore,
+ Normal,
+ IncludeAdvanced
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ICompletionDataFactory.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ICompletionDataFactory.cs
new file mode 100644
index 0000000000..f1f5516f2a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/ICompletionDataFactory.cs
@@ -0,0 +1,81 @@
+//
+// ICompletionDataFactory.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.CodeCompletion;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ public enum GenericDataType
+ {
+ AttributeTarget,
+ Undefined,
+ PreprocessorKeyword,
+ PreprocessorSymbol,
+ NameProposal,
+ NamedParameter
+ }
+
+ public interface ICompletionDataFactory
+ {
+ CompletionData CreateKeywordCompletion (ICompletionDataKeyHandler keyHandler, string data, SyntaxKind syntaxKind);
+
+ CompletionData CreateGenericData (ICompletionDataKeyHandler keyHandler, string data, GenericDataType genericDataType = GenericDataType.Undefined);
+
+ CompletionData CreateFormatItemCompletionData (ICompletionDataKeyHandler keyHandler, string format, string description, object example);
+
+ CompletionData CreateXmlDocCompletionData (ICompletionDataKeyHandler keyHandler, string tag, string description = null, string tagInsertionText = null);
+
+ ISymbolCompletionData CreateSymbolCompletionData (ICompletionDataKeyHandler keyHandler, ISymbol symbol);
+ ISymbolCompletionData CreateSymbolCompletionData (ICompletionDataKeyHandler keyHandler, ISymbol symbol, string text);
+
+ /// <summary>
+ /// Creates enum member completion data.
+ /// Form: Type.Member
+ /// Used for generating enum members Foo.A, Foo.B where the enum 'Foo' is valid.
+ /// </summary>
+ ISymbolCompletionData CreateEnumMemberCompletionData (ICompletionDataKeyHandler keyHandler, ISymbol typeAlias, IFieldSymbol field);
+
+ CompletionData CreateNewOverrideCompletionData (ICompletionDataKeyHandler keyHandler, int declarationBegin, ITypeSymbol currentType, ISymbol m, bool afterKeyword);
+
+ CompletionData CreatePartialCompletionData (ICompletionDataKeyHandler keyHandler, int declarationBegin, ITypeSymbol currentType, IMethodSymbol method, bool afterKeyword);
+
+ /// <summary>
+ /// Creates the event creation completion data.
+ /// </summary>
+ CompletionData CreateNewMethodDelegate (ICompletionDataKeyHandler keyHandler, ITypeSymbol delegateType, string varName, INamedTypeSymbol curType);
+ ISymbolCompletionData CreateExistingMethodDelegate (ICompletionDataKeyHandler keyHandler, IMethodSymbol method);
+
+ CompletionData CreateAnonymousMethod (ICompletionDataKeyHandler keyHandler, string displayText, string description, string textBeforeCaret, string textAfterCaret);
+
+ CompletionData CreateObjectCreation (ICompletionDataKeyHandler keyHandler, ITypeSymbol typeToCreate, ISymbol symbol, int declarationBegin, bool afterKeyword);
+
+ CompletionData CreateCastCompletionData (ICompletionDataKeyHandler keyHandler, ISymbol member, SyntaxNode nodeToCast, ITypeSymbol targetType);
+
+ CompletionCategory CreateCompletionDataCategory (ISymbol forSymbol);
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AbstractKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AbstractKeywordRecommender.cs
new file mode 100644
index 0000000000..1cf1e8e40a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AbstractKeywordRecommender.cs
@@ -0,0 +1,55 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class AbstractKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.ExternKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.NewKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.UnsafeKeyword,
+ SyntaxKind.OverrideKeyword,
+ };
+
+ private static readonly ISet<SyntaxKind> s_validTypeModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.NewKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.UnsafeKeyword
+ };
+
+ public AbstractKeywordRecommender()
+ : base(SyntaxKind.AbstractKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsGlobalStatementContext ||
+ context.IsMemberDeclarationContext(
+ validModifiers: s_validMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassOnlyTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken) ||
+ context.IsTypeDeclarationContext(
+ validModifiers: s_validTypeModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AbstractSyntacticSingleKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AbstractSyntacticSingleKeywordRecommender.cs
new file mode 100644
index 0000000000..bdb9c6f847
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AbstractSyntacticSingleKeywordRecommender.cs
@@ -0,0 +1,79 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal abstract partial class AbstractSyntacticSingleKeywordRecommender : IKeywordRecommender<CSharpSyntaxContext>
+ {
+ private readonly bool _isValidInPreprocessorContext;
+
+ protected internal SyntaxKind KeywordKind { get; private set; }
+
+ internal bool ShouldFormatOnCommit { get; private set; }
+
+ protected AbstractSyntacticSingleKeywordRecommender(
+ SyntaxKind keywordKind,
+ bool isValidInPreprocessorContext = false,
+ bool shouldFormatOnCommit = false)
+ {
+ this.KeywordKind = keywordKind;
+ _isValidInPreprocessorContext = isValidInPreprocessorContext;
+ this.ShouldFormatOnCommit = shouldFormatOnCommit;
+ }
+
+ protected abstract bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken);
+
+ public IEnumerable<RecommendedKeyword> RecommendKeywords(
+ int position,
+ CSharpSyntaxContext context,
+ CancellationToken cancellationToken)
+ {
+ var syntaxKind = this.RecommendKeyword(position, context, cancellationToken);
+ if (syntaxKind.HasValue)
+ {
+ return new [] {
+ new RecommendedKeyword(SyntaxFacts.GetText(syntaxKind.Value), syntaxKind.Value, shouldFormatOnCommit: this.ShouldFormatOnCommit)
+ };
+ }
+
+ return null;
+ }
+
+ internal IEnumerable<RecommendedKeyword> RecommendKeywords_Test(int position, CSharpSyntaxContext context)
+ {
+ var syntaxKind = this.RecommendKeyword(position, context, CancellationToken.None);
+ if (syntaxKind.HasValue)
+ {
+ return new [] {
+ new RecommendedKeyword(SyntaxFacts.GetText(syntaxKind.Value), syntaxKind.Value)
+ };
+ }
+
+ return null;
+ }
+
+ private SyntaxKind? RecommendKeyword(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ // NOTE: The collector ensures that we're not in "NonUserCode" like comments, strings, inactive code
+ // for perf reasons.
+ var syntaxTree = context.SemanticModel.SyntaxTree;
+ if (!_isValidInPreprocessorContext &&
+ context.IsPreProcessorDirectiveContext)
+ {
+ return null;
+ }
+
+ if (!IsValidContext(position, context, cancellationToken))
+ {
+ return null;
+ }
+
+ return this.KeywordKind;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AddKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AddKeywordRecommender.cs
new file mode 100644
index 0000000000..672e0502a2
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AddKeywordRecommender.cs
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class AddKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public AddKeywordRecommender()
+ : base(SyntaxKind.AddKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.TargetToken.IsAccessorDeclarationContext<EventDeclarationSyntax>(position, SyntaxKind.AddKeyword);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AliasKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AliasKeywordRecommender.cs
new file mode 100644
index 0000000000..3d6b87302a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AliasKeywordRecommender.cs
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class AliasKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public AliasKeywordRecommender()
+ : base(SyntaxKind.AliasKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ // cases:
+ // extern |
+ // extern a|
+ var token = context.TargetToken;
+
+ if (token.Kind() == SyntaxKind.ExternKeyword)
+ {
+ // members can be 'extern' but we don't want
+ // 'alias' to show up in a 'type'.
+ return token.GetAncestor<TypeDeclarationSyntax>() == null;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AsKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AsKeywordRecommender.cs
new file mode 100644
index 0000000000..3d667239aa
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AsKeywordRecommender.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class AsKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public AsKeywordRecommender()
+ : base(SyntaxKind.AsKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return !context.IsInNonUserCode && context.IsIsOrAsContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AscendingKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AscendingKeywordRecommender.cs
new file mode 100644
index 0000000000..ec3e54f007
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AscendingKeywordRecommender.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class AscendingKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public AscendingKeywordRecommender()
+ : base(SyntaxKind.AscendingKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.TargetToken.IsOrderByDirectionContext();
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AssemblyKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AssemblyKeywordRecommender.cs
new file mode 100644
index 0000000000..31cb8b3a47
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AssemblyKeywordRecommender.cs
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class AssemblyKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public AssemblyKeywordRecommender()
+ : base(SyntaxKind.AssemblyKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (context.IsTypeAttributeContext(cancellationToken))
+ {
+ var token = context.LeftToken;
+ var type = token.GetAncestor<MemberDeclarationSyntax>();
+
+ return type == null || type.IsParentKind(SyntaxKind.CompilationUnit);
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AsyncKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AsyncKeywordRecommender.cs
new file mode 100644
index 0000000000..49abcb325d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AsyncKeywordRecommender.cs
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class AsyncKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public AsyncKeywordRecommender() :
+ base(SyntaxKind.AsyncKeyword, isValidInPreprocessorContext: false)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (context.IsAnyExpressionContext)
+ {
+ return true;
+ }
+
+ return !context.TargetToken.IsKindOrHasMatchingText(SyntaxKind.PartialKeyword)
+ && InMemberDeclarationContext(position, context, cancellationToken);
+ }
+
+ private static bool InMemberDeclarationContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.SyntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken)
+ || context.IsMemberDeclarationContext(
+ validModifiers: SyntaxKindSet.AllMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations,
+ canBePartial: true,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AwaitKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AwaitKeywordRecommender.cs
new file mode 100644
index 0000000000..c2604eaad6
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/AwaitKeywordRecommender.cs
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class AwaitKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public AwaitKeywordRecommender()
+ : base(SyntaxKind.AwaitKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (context.IsAnyExpressionContext || context.IsStatementContext)
+ {
+ foreach (var node in context.LeftToken.GetAncestors<SyntaxNode>())
+ {
+ if (node.IsAnyLambdaOrAnonymousMethod())
+ {
+ return true;
+ }
+
+ if (node.IsKind(SyntaxKind.QueryExpression))
+ {
+ return false;
+ }
+
+ if (node.IsKind(SyntaxKind.LockStatement))
+ {
+ var lockStatement = (LockStatementSyntax)node;
+ if (lockStatement.Statement != null &&
+ !lockStatement.Statement.IsMissing &&
+ lockStatement.Statement.Span.Contains(position))
+ {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/BaseKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/BaseKeywordRecommender.cs
new file mode 100644
index 0000000000..68206249d8
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/BaseKeywordRecommender.cs
@@ -0,0 +1,69 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class BaseKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public BaseKeywordRecommender()
+ : base(SyntaxKind.BaseKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ // We need to at least be in a type declaration context. This prevents us from showing
+ // calls to 'base' in things like top level repl statements and whatnot.
+ if (context.ContainingTypeDeclaration != null)
+ {
+ return
+ IsConstructorInitializerContext(position, context, cancellationToken) ||
+ IsInstanceExpressionOrStatement(context);
+ }
+
+ return false;
+ }
+
+ private static bool IsInstanceExpressionOrStatement(CSharpSyntaxContext context)
+ {
+ if (context.IsInstanceContext)
+ {
+ return context.IsNonAttributeExpressionContext || context.IsStatementContext;
+ }
+
+ return false;
+ }
+
+ private bool IsConstructorInitializerContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ // cases:
+ // Foo() : |
+
+ var token = context.TargetToken;
+
+ if (token.Kind() == SyntaxKind.ColonToken &&
+ token.Parent is ConstructorInitializerSyntax &&
+ token.Parent.IsParentKind(SyntaxKind.ConstructorDeclaration) &&
+ token.Parent.GetParent().IsParentKind(SyntaxKind.ClassDeclaration))
+ {
+ var constructor = token.GetAncestor<ConstructorDeclarationSyntax>();
+ if (constructor.Modifiers.Any(t => t.Kind () == SyntaxKind.StaticKeyword))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/BoolKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/BoolKeywordRecommender.cs
new file mode 100644
index 0000000000..44c5b2322f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/BoolKeywordRecommender.cs
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class BoolKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public BoolKeywordRecommender()
+ : base(SyntaxKind.BoolKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ context.IsAnyExpressionContext ||
+ context.IsDefiniteCastTypeContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsObjectCreationTypeContext ||
+ context.IsGenericTypeArgumentContext ||
+ context.IsIsOrAsTypeContext ||
+ context.IsLocalVariableDeclarationContext ||
+ context.IsFixedVariableDeclarationContext ||
+ context.IsParameterTypeContext ||
+ context.IsPossibleLambdaOrAnonymousMethodParameterTypeContext ||
+ context.IsImplicitOrExplicitOperatorTypeContext ||
+ context.IsPrimaryFunctionExpressionContext ||
+ context.IsCrefContext ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.StackAllocKeyword, cancellationToken) ||
+ context.IsDelegateReturnTypeContext ||
+ syntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: SyntaxKindSet.AllMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/BreakKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/BreakKeywordRecommender.cs
new file mode 100644
index 0000000000..8275ac1434
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/BreakKeywordRecommender.cs
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class BreakKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public BreakKeywordRecommender()
+ : base(SyntaxKind.BreakKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ IsInBreakableConstructContext(context) ||
+ context.TargetToken.IsAfterYieldKeyword();
+ }
+
+ private static bool IsInBreakableConstructContext(CSharpSyntaxContext context)
+ {
+ if (!context.IsStatementContext)
+ {
+ return false;
+ }
+
+ // allowed if we're inside a loop/switch construct.
+
+ var token = context.LeftToken;
+ foreach (var v in token.GetAncestors<SyntaxNode>())
+ {
+ if (v.IsAnyLambdaOrAnonymousMethod())
+ {
+ // if we hit a lambda while walking up, then we can't
+ // 'continue' any outer loops.
+ return false;
+ }
+
+ if (v.IsBreakableConstruct())
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ByKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ByKeywordRecommender.cs
new file mode 100644
index 0000000000..07d5db338e
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ByKeywordRecommender.cs
@@ -0,0 +1,53 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ByKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public ByKeywordRecommender()
+ : base(SyntaxKind.ByKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ // cases:
+ // group e |
+ // group e b|
+
+ var token = context.LeftToken;
+ var group = token.GetAncestor<GroupClauseSyntax>();
+
+ if (group == null)
+ {
+ return false;
+ }
+
+ var lastToken = group.GroupExpression.GetLastToken(includeSkipped: true);
+
+ // group e |
+ if (!token.IntersectsWith(position) &&
+ token == lastToken)
+ {
+ return true;
+ }
+
+ // group e b|
+ if (token.IntersectsWith(position) &&
+ token.Kind() == SyntaxKind.IdentifierToken &&
+ token.GetPreviousToken(includeSkipped: true) == lastToken)
+ {
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ByteKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ByteKeywordRecommender.cs
new file mode 100644
index 0000000000..c40eb00cd7
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ByteKeywordRecommender.cs
@@ -0,0 +1,49 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ByteKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public ByteKeywordRecommender()
+ : base(SyntaxKind.ByteKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+
+ return
+ context.IsAnyExpressionContext ||
+ context.IsDefiniteCastTypeContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsObjectCreationTypeContext ||
+ context.IsGenericTypeArgumentContext ||
+ context.IsEnumBaseListContext ||
+ context.IsIsOrAsTypeContext ||
+ context.IsLocalVariableDeclarationContext ||
+ context.IsFixedVariableDeclarationContext ||
+ context.IsParameterTypeContext ||
+ context.IsPossibleLambdaOrAnonymousMethodParameterTypeContext ||
+ context.IsImplicitOrExplicitOperatorTypeContext ||
+ context.IsPrimaryFunctionExpressionContext ||
+ context.IsCrefContext ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.StackAllocKeyword, cancellationToken) ||
+ context.IsDelegateReturnTypeContext ||
+ syntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: SyntaxKindSet.AllMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/CaseKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/CaseKeywordRecommender.cs
new file mode 100644
index 0000000000..c8e9c0f1db
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/CaseKeywordRecommender.cs
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class CaseKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public CaseKeywordRecommender()
+ : base(SyntaxKind.CaseKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.TargetToken.IsSwitchLabelContext() ||
+ IsAfterGotoInSwitchContext(context);
+ }
+
+ internal static bool IsAfterGotoInSwitchContext(CSharpSyntaxContext context)
+ {
+ var token = context.TargetToken;
+
+ if (token.Kind() == SyntaxKind.GotoKeyword &&
+ token.GetAncestor<SwitchStatementSyntax>() != null)
+ {
+ // todo: what if we're in a lambda... or a try/finally or
+ // something? Might want to filter this out.
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/CatchKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/CatchKeywordRecommender.cs
new file mode 100644
index 0000000000..26433adf28
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/CatchKeywordRecommender.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class CatchKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public CatchKeywordRecommender()
+ : base(SyntaxKind.CatchKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.SyntaxTree.IsCatchOrFinallyContext(position, context.LeftToken, cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/CharKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/CharKeywordRecommender.cs
new file mode 100644
index 0000000000..a0d530742c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/CharKeywordRecommender.cs
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class CharKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public CharKeywordRecommender()
+ : base(SyntaxKind.CharKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ context.IsAnyExpressionContext ||
+ context.IsDefiniteCastTypeContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsObjectCreationTypeContext ||
+ context.IsGenericTypeArgumentContext ||
+ context.IsIsOrAsTypeContext ||
+ context.IsLocalVariableDeclarationContext ||
+ context.IsFixedVariableDeclarationContext ||
+ context.IsParameterTypeContext ||
+ context.IsPossibleLambdaOrAnonymousMethodParameterTypeContext ||
+ context.IsImplicitOrExplicitOperatorTypeContext ||
+ context.IsPrimaryFunctionExpressionContext ||
+ context.IsCrefContext ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.StackAllocKeyword, cancellationToken) ||
+ context.IsDelegateReturnTypeContext ||
+ syntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: SyntaxKindSet.AllMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/CheckedKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/CheckedKeywordRecommender.cs
new file mode 100644
index 0000000000..bdcb72853d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/CheckedKeywordRecommender.cs
@@ -0,0 +1,24 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class CheckedKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public CheckedKeywordRecommender()
+ : base(SyntaxKind.CheckedKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsNonAttributeExpressionContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ChecksumKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ChecksumKeywordRecommender.cs
new file mode 100644
index 0000000000..14aceee892
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ChecksumKeywordRecommender.cs
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ChecksumKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public ChecksumKeywordRecommender()
+ : base(SyntaxKind.ChecksumKeyword, isValidInPreprocessorContext: true)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ // # pragma |
+ // # pragma w|
+ var previousToken1 = context.TargetToken;
+ var previousToken2 = previousToken1.GetPreviousToken(includeSkipped: true);
+
+ return
+ previousToken1.Kind() == SyntaxKind.PragmaKeyword &&
+ previousToken2.Kind() == SyntaxKind.HashToken;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ClassKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ClassKeywordRecommender.cs
new file mode 100644
index 0000000000..47a255c363
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ClassKeywordRecommender.cs
@@ -0,0 +1,44 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ClassKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.NewKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.AbstractKeyword,
+ SyntaxKind.SealedKeyword,
+ SyntaxKind.StaticKeyword,
+ SyntaxKind.UnsafeKeyword
+ };
+
+ public ClassKeywordRecommender()
+ : base(SyntaxKind.ClassKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ context.IsGlobalStatementContext ||
+ context.IsTypeDeclarationContext(
+ validModifiers: s_validModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations,
+ canBePartial: true,
+ cancellationToken: cancellationToken) ||
+ syntaxTree.IsTypeParameterConstraintStartContext(position, context.LeftToken, cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ConstKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ConstKeywordRecommender.cs
new file mode 100644
index 0000000000..49710fe6ed
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ConstKeywordRecommender.cs
@@ -0,0 +1,65 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ConstKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.NewKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.PrivateKeyword,
+ };
+
+ private static readonly ISet<SyntaxKind> s_validGlobalModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.NewKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.PrivateKeyword,
+ };
+
+ public ConstKeywordRecommender()
+ : base(SyntaxKind.ConstKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ IsMemberDeclarationContext(context, cancellationToken) ||
+ IsLocalVariableDeclaration(context);
+ }
+
+ private bool IsMemberDeclarationContext(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.SyntaxTree.IsGlobalMemberDeclarationContext(context.Position, s_validGlobalModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: s_validModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+
+ private bool IsLocalVariableDeclaration(CSharpSyntaxContext context)
+ {
+ // cases:
+ // void Foo() {
+ // |
+ //
+ // |
+ return
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ContinueKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ContinueKeywordRecommender.cs
new file mode 100644
index 0000000000..e2f1aeb73b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ContinueKeywordRecommender.cs
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ContinueKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public ContinueKeywordRecommender()
+ : base(SyntaxKind.ContinueKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (!context.IsStatementContext)
+ {
+ return false;
+ }
+
+ // allowed if we're inside a loop construct.
+
+ var leaf = context.LeftToken;
+ foreach (var v in leaf.GetAncestors<SyntaxNode>())
+ {
+ if (v.IsAnyLambdaOrAnonymousMethod())
+ {
+ // if we hit a lambda while walking up, then we can't
+ // 'continue' any outer loops.
+ return false;
+ }
+
+ if (v.IsContinuableConstruct())
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DecimalKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DecimalKeywordRecommender.cs
new file mode 100644
index 0000000000..e0280702fb
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DecimalKeywordRecommender.cs
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class DecimalKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public DecimalKeywordRecommender()
+ : base(SyntaxKind.DecimalKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ context.IsAnyExpressionContext ||
+ context.IsDefiniteCastTypeContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsObjectCreationTypeContext ||
+ context.IsGenericTypeArgumentContext ||
+ context.IsIsOrAsTypeContext ||
+ context.IsLocalVariableDeclarationContext ||
+ context.IsFixedVariableDeclarationContext ||
+ context.IsParameterTypeContext ||
+ context.IsPossibleLambdaOrAnonymousMethodParameterTypeContext ||
+ context.IsImplicitOrExplicitOperatorTypeContext ||
+ context.IsPrimaryFunctionExpressionContext ||
+ context.IsCrefContext ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.StackAllocKeyword, cancellationToken) ||
+ context.IsDelegateReturnTypeContext ||
+ syntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: SyntaxKindSet.AllMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DefaultKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DefaultKeywordRecommender.cs
new file mode 100644
index 0000000000..935b5b62eb
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DefaultKeywordRecommender.cs
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class DefaultKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public DefaultKeywordRecommender()
+ : base(SyntaxKind.DefaultKeyword, isValidInPreprocessorContext: true)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ IsValidPreProcessorContext(context) ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsAnyExpressionContext ||
+ context.TargetToken.IsSwitchLabelContext();
+ }
+
+ private static bool IsValidPreProcessorContext(CSharpSyntaxContext context)
+ {
+ // cases:
+ // #line |
+ // #line d|
+ // # line |
+ // # line d|
+
+ var previousToken1 = context.TargetToken;
+ var previousToken2 = previousToken1.GetPreviousToken(includeSkipped: true);
+
+ return
+ previousToken1.Kind() == SyntaxKind.LineKeyword &&
+ previousToken2.Kind() == SyntaxKind.HashToken;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DefineKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DefineKeywordRecommender.cs
new file mode 100644
index 0000000000..5ff0f4412a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DefineKeywordRecommender.cs
@@ -0,0 +1,25 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class DefineKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public DefineKeywordRecommender()
+ : base(SyntaxKind.DefineKeyword, isValidInPreprocessorContext: true)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ syntaxTree.IsBeforeFirstToken(position, cancellationToken) &&
+ context.IsPreProcessorKeywordContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DelegateKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DelegateKeywordRecommender.cs
new file mode 100644
index 0000000000..42049a0b93
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DelegateKeywordRecommender.cs
@@ -0,0 +1,53 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class DelegateKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.UnsafeKeyword
+ };
+
+ public DelegateKeywordRecommender()
+ : base(SyntaxKind.DelegateKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsGlobalStatementContext ||
+ (context.IsNonAttributeExpressionContext && !context.IsConstantExpressionContext) ||
+ IsAfterAsyncKeywordInExpressionContext(context, cancellationToken) ||
+ context.IsTypeDeclarationContext(
+ validModifiers: s_validModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+
+ private static bool IsAfterAsyncKeywordInExpressionContext(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.TargetToken.IsKindOrHasMatchingText(SyntaxKind.AsyncKeyword) &&
+ context.SyntaxTree.IsExpressionContext(
+ context.TargetToken.SpanStart,
+ context.TargetToken,
+ attributes: false,
+ cancellationToken: cancellationToken,
+ semanticModelOpt: context.SemanticModel);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DescendingKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DescendingKeywordRecommender.cs
new file mode 100644
index 0000000000..0c62897af0
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DescendingKeywordRecommender.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class DescendingKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public DescendingKeywordRecommender()
+ : base(SyntaxKind.DescendingKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.TargetToken.IsOrderByDirectionContext();
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DisableKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DisableKeywordRecommender.cs
new file mode 100644
index 0000000000..87e5166b5d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DisableKeywordRecommender.cs
@@ -0,0 +1,30 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class DisableKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public DisableKeywordRecommender()
+ : base(SyntaxKind.DisableKeyword, isValidInPreprocessorContext: true)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ // # pragma warning |
+ // # pragma warning d|
+ var previousToken1 = context.TargetToken;
+ var previousToken2 = previousToken1.GetPreviousToken(includeSkipped: true);
+ var previousToken3 = previousToken2.GetPreviousToken(includeSkipped: true);
+
+ return
+ previousToken1.Kind() == SyntaxKind.WarningKeyword &&
+ previousToken2.Kind() == SyntaxKind.PragmaKeyword &&
+ previousToken3.Kind() == SyntaxKind.HashToken;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DoKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DoKeywordRecommender.cs
new file mode 100644
index 0000000000..ca525b4868
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DoKeywordRecommender.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class DoKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public DoKeywordRecommender()
+ : base(SyntaxKind.DoKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DoubleKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DoubleKeywordRecommender.cs
new file mode 100644
index 0000000000..51330c929c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DoubleKeywordRecommender.cs
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class DoubleKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public DoubleKeywordRecommender()
+ : base(SyntaxKind.DoubleKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ context.IsAnyExpressionContext ||
+ context.IsDefiniteCastTypeContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsObjectCreationTypeContext ||
+ context.IsGenericTypeArgumentContext ||
+ context.IsIsOrAsTypeContext ||
+ context.IsLocalVariableDeclarationContext ||
+ context.IsFixedVariableDeclarationContext ||
+ context.IsParameterTypeContext ||
+ context.IsPossibleLambdaOrAnonymousMethodParameterTypeContext ||
+ context.IsImplicitOrExplicitOperatorTypeContext ||
+ context.IsPrimaryFunctionExpressionContext ||
+ context.IsCrefContext ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.StackAllocKeyword, cancellationToken) ||
+ context.IsDelegateReturnTypeContext ||
+ syntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: SyntaxKindSet.AllMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DynamicKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DynamicKeywordRecommender.cs
new file mode 100644
index 0000000000..6f45d48507
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/DynamicKeywordRecommender.cs
@@ -0,0 +1,65 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class DynamicKeywordRecommender : IKeywordRecommender<CSharpSyntaxContext>
+ {
+ private bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ if (context.IsPreProcessorDirectiveContext)
+ {
+ return false;
+ }
+
+ return IsDynamicTypeContext(position, context, cancellationToken);
+ }
+
+ public IEnumerable<RecommendedKeyword> RecommendKeywords(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (IsValidContext(position, context, cancellationToken))
+ {
+ yield return new RecommendedKeyword("dynamic", SyntaxKind.IdentifierToken);
+ }
+ }
+
+ protected static bool IsDynamicTypeContext(
+ int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+
+ // first do quick exit check
+ if (syntaxTree.IsDefinitelyNotTypeContext(position, cancellationToken))
+ {
+ return false;
+ }
+
+ return
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsDefiniteCastTypeContext ||
+ syntaxTree.IsPossibleCastTypeContext(position, context.LeftToken, cancellationToken) ||
+ context.IsObjectCreationTypeContext ||
+ context.IsGenericTypeArgumentContext ||
+ context.IsIsOrAsTypeContext ||
+ syntaxTree.IsDefaultExpressionContext(position, context.LeftToken, cancellationToken) ||
+ context.IsLocalVariableDeclarationContext ||
+ context.IsParameterTypeContext ||
+ context.IsPossibleLambdaOrAnonymousMethodParameterTypeContext ||
+ context.IsDelegateReturnTypeContext ||
+ syntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: SyntaxKindSet.AllMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ElifKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ElifKeywordRecommender.cs
new file mode 100644
index 0000000000..0d2b5d21b9
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ElifKeywordRecommender.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ElifKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public ElifKeywordRecommender()
+ : base(SyntaxKind.ElifKeyword, isValidInPreprocessorContext: true)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.IsPreProcessorKeywordContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ElseKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ElseKeywordRecommender.cs
new file mode 100644
index 0000000000..9c6acbd43d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ElseKeywordRecommender.cs
@@ -0,0 +1,63 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ElseKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public ElseKeywordRecommender()
+ : base(SyntaxKind.ElseKeyword, isValidInPreprocessorContext: true)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (context.IsPreProcessorKeywordContext)
+ {
+ return true;
+ }
+
+ var token = context.TargetToken;
+
+ var statement = token.GetAncestor<StatementSyntax>();
+ var ifStatement = statement.GetAncestorOrThis<IfStatementSyntax>();
+
+ if (statement == null || ifStatement == null)
+ {
+ return false;
+ }
+
+ // cases:
+ // if (foo)
+ // Console.WriteLine();
+ // |
+ // if (foo)
+ // Console.WriteLine();
+ // e|
+ if (token.IsKind(SyntaxKind.SemicolonToken) && ifStatement.Statement.GetLastToken(includeSkipped: true) == token)
+ {
+ return true;
+ }
+
+ // if (foo) {
+ // Console.WriteLine();
+ // } |
+ // if (foo) {
+ // Console.WriteLine();
+ // } e|
+ if (token.IsKind(SyntaxKind.CloseBraceToken) && ifStatement.Statement is BlockSyntax && token == ((BlockSyntax)ifStatement.Statement).CloseBraceToken)
+ {
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/EndIfKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/EndIfKeywordRecommender.cs
new file mode 100644
index 0000000000..0042a43660
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/EndIfKeywordRecommender.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class EndIfKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public EndIfKeywordRecommender()
+ : base(SyntaxKind.EndIfKeyword, isValidInPreprocessorContext: true)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.IsPreProcessorKeywordContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/EndRegionKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/EndRegionKeywordRecommender.cs
new file mode 100644
index 0000000000..741c814181
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/EndRegionKeywordRecommender.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class EndRegionKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public EndRegionKeywordRecommender()
+ : base(SyntaxKind.EndRegionKeyword, isValidInPreprocessorContext: true, shouldFormatOnCommit: true)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.IsPreProcessorKeywordContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/EnumKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/EnumKeywordRecommender.cs
new file mode 100644
index 0000000000..69d31fad97
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/EnumKeywordRecommender.cs
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class EnumKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.ProtectedKeyword,
+ };
+
+ public EnumKeywordRecommender()
+ : base(SyntaxKind.EnumKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsGlobalStatementContext ||
+ context.IsTypeDeclarationContext(
+ validModifiers: s_validModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/EqualsKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/EqualsKeywordRecommender.cs
new file mode 100644
index 0000000000..e2f4bd912a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/EqualsKeywordRecommender.cs
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class EqualsKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public EqualsKeywordRecommender()
+ : base(SyntaxKind.EqualsKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ // cases:
+ // join a in expr o1 |
+ // join a in expr o1 e|
+
+ var token = context.TargetToken;
+
+ var join = token.GetAncestor<JoinClauseSyntax>();
+ if (join == null)
+ {
+ return false;
+ }
+
+ var lastToken = join.LeftExpression.GetLastToken(includeSkipped: true);
+
+ // join a in expr |
+ if (join.LeftExpression.Width() > 0 &&
+ token == lastToken)
+ {
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ErrorKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ErrorKeywordRecommender.cs
new file mode 100644
index 0000000000..5e21f268ae
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ErrorKeywordRecommender.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ErrorKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public ErrorKeywordRecommender()
+ : base(SyntaxKind.ErrorKeyword, isValidInPreprocessorContext: true)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.IsPreProcessorKeywordContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/EventKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/EventKeywordRecommender.cs
new file mode 100644
index 0000000000..04c955265e
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/EventKeywordRecommender.cs
@@ -0,0 +1,44 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class EventKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.NewKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.StaticKeyword,
+ SyntaxKind.VirtualKeyword,
+ SyntaxKind.SealedKeyword,
+ SyntaxKind.OverrideKeyword,
+ SyntaxKind.AbstractKeyword,
+ SyntaxKind.ExternKeyword,
+ SyntaxKind.UnsafeKeyword
+ };
+
+ public EventKeywordRecommender()
+ : base(SyntaxKind.EventKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ context.IsGlobalStatementContext ||
+ syntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(validModifiers: s_validModifiers, validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations, canBePartial: false, cancellationToken: cancellationToken) ||
+ context.IsMemberAttributeContext(SyntaxKindSet.ClassInterfaceStructTypeDeclarations, cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ExplicitKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ExplicitKeywordRecommender.cs
new file mode 100644
index 0000000000..7931912b56
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ExplicitKeywordRecommender.cs
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ExplicitKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.StaticKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.ExternKeyword,
+ SyntaxKind.UnsafeKeyword,
+ };
+
+ public ExplicitKeywordRecommender()
+ : base(SyntaxKind.ExplicitKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (context.IsMemberDeclarationContext(validModifiers: s_validMemberModifiers, validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations, canBePartial: false, cancellationToken: cancellationToken))
+ {
+ // operators must be both public and static
+ var modifiers = context.PrecedingModifiers;
+
+ return
+ modifiers.Contains(SyntaxKind.PublicKeyword) &&
+ modifiers.Contains(SyntaxKind.StaticKeyword);
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ExternKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ExternKeywordRecommender.cs
new file mode 100644
index 0000000000..7c6f740ab9
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ExternKeywordRecommender.cs
@@ -0,0 +1,100 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ExternKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.NewKeyword,
+ SyntaxKind.OverrideKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.SealedKeyword,
+ SyntaxKind.StaticKeyword,
+ SyntaxKind.UnsafeKeyword,
+ SyntaxKind.VirtualKeyword,
+ };
+
+ private static readonly ISet<SyntaxKind> s_validGlobalModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.NewKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.StaticKeyword,
+ SyntaxKind.UnsafeKeyword,
+ };
+
+ public ExternKeywordRecommender()
+ : base(SyntaxKind.ExternKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ IsExternAliasContext(context) ||
+ context.IsGlobalStatementContext ||
+ syntaxTree.IsGlobalMemberDeclarationContext(position, s_validGlobalModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: s_validModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+
+ private static bool IsExternAliasContext(CSharpSyntaxContext context)
+ {
+ // cases:
+ // root: |
+
+ // root: e|
+
+ // extern alias a;
+ // |
+
+ // extern alias a;
+ // e|
+
+ // all the above, but inside a namespace.
+ // usings and other constructs *cannot* precede.
+
+ var token = context.TargetToken;
+
+ // root: |
+ if (token.Kind() == SyntaxKind.None)
+ {
+ // root namespace
+ return true;
+ }
+
+ if (token.Kind() == SyntaxKind.OpenBraceToken &&
+ token.Parent.IsKind(SyntaxKind.NamespaceDeclaration))
+ {
+ return true;
+ }
+
+ // extern alias a;
+ // |
+ if (token.Kind() == SyntaxKind.SemicolonToken &&
+ token.Parent.IsKind(SyntaxKind.ExternAliasDirective))
+ {
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FalseKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FalseKeywordRecommender.cs
new file mode 100644
index 0000000000..1fa404a42b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FalseKeywordRecommender.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class FalseKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public FalseKeywordRecommender()
+ : base(SyntaxKind.FalseKeyword, isValidInPreprocessorContext: true)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsAnyExpressionContext ||
+ context.IsPreProcessorExpressionContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.TargetToken.IsUnaryOperatorContext();
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FieldKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FieldKeywordRecommender.cs
new file mode 100644
index 0000000000..cb50cf176b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FieldKeywordRecommender.cs
@@ -0,0 +1,30 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class FieldKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ // interfaces don't have members that you can put a [field:] attribute on
+ private static readonly ISet<SyntaxKind> s_validTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.StructDeclaration,
+ SyntaxKind.ClassDeclaration,
+ SyntaxKind.EnumDeclaration,
+ };
+
+ public FieldKeywordRecommender()
+ : base(SyntaxKind.FieldKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.IsMemberAttributeContext(s_validTypeDeclarations, cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FinallyKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FinallyKeywordRecommender.cs
new file mode 100644
index 0000000000..0ac6a78e75
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FinallyKeywordRecommender.cs
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class FinallyKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public FinallyKeywordRecommender()
+ : base(SyntaxKind.FinallyKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return syntaxTree.IsCatchOrFinallyContext(position, context.LeftToken, cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FixedKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FixedKeywordRecommender.cs
new file mode 100644
index 0000000000..371916e0a6
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FixedKeywordRecommender.cs
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class FixedKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.NewKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.UnsafeKeyword,
+ };
+
+ public FixedKeywordRecommender()
+ : base(SyntaxKind.FixedKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ IsUnsafeStatementContext(context) ||
+ IsMemberDeclarationContext(context, cancellationToken);
+ }
+
+ private static bool IsMemberDeclarationContext(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.TargetToken.IsUnsafeContext() &&
+ (context.SyntaxTree.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(validModifiers: s_validModifiers, validTypeDeclarations: SyntaxKindSet.StructOnlyTypeDeclarations, canBePartial: false, cancellationToken: cancellationToken));
+ }
+
+ private static bool IsUnsafeStatementContext(CSharpSyntaxContext context)
+ {
+ return
+ context.TargetToken.IsUnsafeContext() &&
+ context.IsStatementContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FloatKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FloatKeywordRecommender.cs
new file mode 100644
index 0000000000..e5759bfcd8
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FloatKeywordRecommender.cs
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class FloatKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public FloatKeywordRecommender()
+ : base(SyntaxKind.FloatKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ context.IsAnyExpressionContext ||
+ context.IsDefiniteCastTypeContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsObjectCreationTypeContext ||
+ context.IsGenericTypeArgumentContext ||
+ context.IsIsOrAsTypeContext ||
+ context.IsLocalVariableDeclarationContext ||
+ context.IsFixedVariableDeclarationContext ||
+ context.IsParameterTypeContext ||
+ context.IsPossibleLambdaOrAnonymousMethodParameterTypeContext ||
+ context.IsImplicitOrExplicitOperatorTypeContext ||
+ context.IsPrimaryFunctionExpressionContext ||
+ context.IsCrefContext ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.StackAllocKeyword, cancellationToken) ||
+ context.IsDelegateReturnTypeContext ||
+ syntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: SyntaxKindSet.AllMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ForEachKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ForEachKeywordRecommender.cs
new file mode 100644
index 0000000000..f39dc09669
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ForEachKeywordRecommender.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ForEachKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public ForEachKeywordRecommender()
+ : base(SyntaxKind.ForEachKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ForKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ForKeywordRecommender.cs
new file mode 100644
index 0000000000..6013d73f54
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ForKeywordRecommender.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ForKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public ForKeywordRecommender()
+ : base(SyntaxKind.ForKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FromKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FromKeywordRecommender.cs
new file mode 100644
index 0000000000..c9db4eda7f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/FromKeywordRecommender.cs
@@ -0,0 +1,24 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class FromKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public FromKeywordRecommender()
+ : base(SyntaxKind.FromKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ context.IsGlobalStatementContext ||
+ syntaxTree.IsValidContextForFromClause(position, context.LeftToken, cancellationToken, semanticModelOpt: context.SemanticModel);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/GetKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/GetKeywordRecommender.cs
new file mode 100644
index 0000000000..22fe43af57
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/GetKeywordRecommender.cs
@@ -0,0 +1,24 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class GetKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public GetKeywordRecommender()
+ : base(SyntaxKind.GetKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.TargetToken.IsAccessorDeclarationContext<PropertyDeclarationSyntax>(position, SyntaxKind.GetKeyword) ||
+ context.TargetToken.IsAccessorDeclarationContext<IndexerDeclarationSyntax>(position, SyntaxKind.GetKeyword);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/GlobalKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/GlobalKeywordRecommender.cs
new file mode 100644
index 0000000000..7cb8df670e
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/GlobalKeywordRecommender.cs
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class GlobalKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public GlobalKeywordRecommender()
+ : base(SyntaxKind.GlobalKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+
+ if (syntaxTree.IsMemberDeclarationContext(position, context.LeftToken, cancellationToken))
+ {
+ var token = context.TargetToken;
+
+ if (token.GetAncestor<EnumDeclarationSyntax>() == null)
+ {
+ return true;
+ }
+ }
+
+ return
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsAnyExpressionContext ||
+ context.IsObjectCreationTypeContext ||
+ context.IsIsOrAsTypeContext ||
+ syntaxTree.IsUsingAliasContext(position, cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/GotoKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/GotoKeywordRecommender.cs
new file mode 100644
index 0000000000..e252d97856
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/GotoKeywordRecommender.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class GotoKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public GotoKeywordRecommender()
+ : base(SyntaxKind.GotoKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/GroupKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/GroupKeywordRecommender.cs
new file mode 100644
index 0000000000..401c5825d6
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/GroupKeywordRecommender.cs
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class GroupKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public GroupKeywordRecommender()
+ : base(SyntaxKind.GroupKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var token = context.TargetToken;
+
+ // var q = from x in y
+ // |
+ if (!token.IntersectsWith(position) &&
+ token.IsLastTokenOfQueryClause())
+ {
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/HiddenKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/HiddenKeywordRecommender.cs
new file mode 100644
index 0000000000..f7047a9dcf
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/HiddenKeywordRecommender.cs
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class HiddenKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public HiddenKeywordRecommender()
+ : base(SyntaxKind.HiddenKeyword, isValidInPreprocessorContext: true)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ // cases:
+ // #line |
+ // #line h|
+ // # line |
+ // # line h|
+
+ var previousToken1 = context.TargetToken;
+ var previousToken2 = previousToken1.GetPreviousToken(includeSkipped: true);
+
+ return
+ previousToken1.Kind() == SyntaxKind.LineKeyword &&
+ previousToken2.Kind() == SyntaxKind.HashToken;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/IfKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/IfKeywordRecommender.cs
new file mode 100644
index 0000000000..dd5839e814
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/IfKeywordRecommender.cs
@@ -0,0 +1,24 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class IfKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public IfKeywordRecommender()
+ : base(SyntaxKind.IfKeyword, isValidInPreprocessorContext: true)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsPreProcessorKeywordContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ImplicitKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ImplicitKeywordRecommender.cs
new file mode 100644
index 0000000000..ba32b643c0
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ImplicitKeywordRecommender.cs
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ImplicitKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.StaticKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.ExternKeyword,
+ SyntaxKind.UnsafeKeyword,
+ };
+
+ public ImplicitKeywordRecommender()
+ : base(SyntaxKind.ImplicitKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (context.IsMemberDeclarationContext(validModifiers: s_validMemberModifiers, validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations, canBePartial: false, cancellationToken: cancellationToken))
+ {
+ // operators must be both public and static
+ var modifiers = context.PrecedingModifiers;
+
+ return
+ modifiers.Contains(SyntaxKind.PublicKeyword) &&
+ modifiers.Contains(SyntaxKind.StaticKeyword);
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/InKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/InKeywordRecommender.cs
new file mode 100644
index 0000000000..f8c14fef53
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/InKeywordRecommender.cs
@@ -0,0 +1,112 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class InKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public InKeywordRecommender()
+ : base(SyntaxKind.InKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ IsValidContextInForEachClause(context) ||
+ IsValidContextInFromClause(context, cancellationToken) ||
+ IsValidContextInJoinClause(context, cancellationToken) ||
+ context.TargetToken.IsTypeParameterVarianceContext();
+ }
+
+ private bool IsValidContextInForEachClause(CSharpSyntaxContext context)
+ {
+ // cases:
+ // foreach (var v |
+ // foreach (var v i|
+
+ var token = context.TargetToken;
+
+ if (token.Kind() == SyntaxKind.IdentifierToken)
+ {
+ var statement = token.GetAncestor<ForEachStatementSyntax>();
+ if (statement != null && token == statement.Identifier)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private bool IsValidContextInFromClause(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var token = context.TargetToken;
+
+ if (token.Kind() == SyntaxKind.IdentifierToken)
+ {
+ // case:
+ // from x |
+ if (token.GetPreviousToken(includeSkipped: true).IsKindOrHasMatchingText(SyntaxKind.FromKeyword))
+ {
+ var typeSyntax = token.Parent as TypeSyntax;
+ if (!typeSyntax.IsPotentialTypeName(context.SemanticModel, cancellationToken))
+ {
+ return true;
+ }
+ }
+
+ var fromClause = token.Parent as FromClauseSyntax;
+ if (fromClause != null)
+ {
+ // case:
+ // from int x |
+ if (token == fromClause.Identifier && fromClause.Type != null)
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ private bool IsValidContextInJoinClause(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var token = context.TargetToken;
+
+ if (token.Kind() == SyntaxKind.IdentifierToken)
+ {
+ var joinClause = token.Parent.FirstAncestorOrSelf<JoinClauseSyntax>();
+ if (joinClause != null)
+ {
+ // case:
+ // join int x |
+ if (token == joinClause.Identifier && joinClause.Type != null)
+ {
+ return true;
+ }
+
+ // case:
+ // join x |
+ if (joinClause.Type != null &&
+ joinClause.Type.IsKind(SyntaxKind.IdentifierName) &&
+ token == ((IdentifierNameSyntax)joinClause.Type).Identifier &&
+ !joinClause.Type.IsPotentialTypeName(context.SemanticModel, cancellationToken))
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/IntKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/IntKeywordRecommender.cs
new file mode 100644
index 0000000000..91dc5e0fe8
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/IntKeywordRecommender.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class IntKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public IntKeywordRecommender()
+ : base(SyntaxKind.IntKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ context.IsAnyExpressionContext ||
+ context.IsDefiniteCastTypeContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsObjectCreationTypeContext ||
+ context.IsGenericTypeArgumentContext ||
+ context.IsEnumBaseListContext ||
+ context.IsIsOrAsTypeContext ||
+ context.IsLocalVariableDeclarationContext ||
+ context.IsFixedVariableDeclarationContext ||
+ context.IsParameterTypeContext ||
+ context.IsPossibleLambdaOrAnonymousMethodParameterTypeContext ||
+ context.IsImplicitOrExplicitOperatorTypeContext ||
+ context.IsPrimaryFunctionExpressionContext ||
+ context.IsCrefContext ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.StackAllocKeyword, cancellationToken) ||
+ context.IsDelegateReturnTypeContext ||
+ syntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: SyntaxKindSet.AllMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/InterfaceKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/InterfaceKeywordRecommender.cs
new file mode 100644
index 0000000000..56107f6ff0
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/InterfaceKeywordRecommender.cs
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class InterfaceKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.UnsafeKeyword
+ };
+
+ public InterfaceKeywordRecommender()
+ : base(SyntaxKind.InterfaceKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsGlobalStatementContext ||
+ context.IsTypeDeclarationContext(
+ validModifiers: s_validModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations,
+ canBePartial: true,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/InternalKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/InternalKeywordRecommender.cs
new file mode 100644
index 0000000000..9e975f2735
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/InternalKeywordRecommender.cs
@@ -0,0 +1,69 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class InternalKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public InternalKeywordRecommender()
+ : base(SyntaxKind.InternalKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsGlobalStatementContext ||
+ IsValidContextForAccessor(context) ||
+ IsValidContextForType(context, cancellationToken) ||
+ IsValidContextForMember(context, cancellationToken);
+ }
+
+ private static bool IsValidContextForAccessor(CSharpSyntaxContext context)
+ {
+ if (context.TargetToken.IsAccessorDeclarationContext<PropertyDeclarationSyntax>(context.Position) ||
+ context.TargetToken.IsAccessorDeclarationContext<IndexerDeclarationSyntax>(context.Position))
+ {
+ return CheckPreviousAccessibilityModifiers(context);
+ }
+
+ return false;
+ }
+
+ private static bool IsValidContextForMember(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (context.SyntaxTree.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(validModifiers: SyntaxKindSet.AllMemberModifiers, validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations, canBePartial: false, cancellationToken: cancellationToken))
+ {
+ return CheckPreviousAccessibilityModifiers(context);
+ }
+
+ return false;
+ }
+
+ private static bool IsValidContextForType(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (context.IsTypeDeclarationContext(validModifiers: SyntaxKindSet.AllTypeModifiers, validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations, canBePartial: false, cancellationToken: cancellationToken))
+ {
+ return CheckPreviousAccessibilityModifiers(context);
+ }
+
+ return false;
+ }
+
+ private static bool CheckPreviousAccessibilityModifiers(CSharpSyntaxContext context)
+ {
+ // internal things can be protected.
+ var precedingModifiers = context.PrecedingModifiers;
+ return
+ !precedingModifiers.Contains(SyntaxKind.PublicKeyword) &&
+ !precedingModifiers.Contains(SyntaxKind.InternalKeyword) &&
+ !precedingModifiers.Contains(SyntaxKind.PrivateKeyword);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/IntoKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/IntoKeywordRecommender.cs
new file mode 100644
index 0000000000..d19d8dcf64
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/IntoKeywordRecommender.cs
@@ -0,0 +1,117 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class IntoKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public IntoKeywordRecommender()
+ : base(SyntaxKind.IntoKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ IsValidContextForJoin(context) ||
+ IsValidContextForSelect(context) ||
+ IsValidContextForGroup(context);
+ }
+
+ private bool IsValidContextForSelect(CSharpSyntaxContext context)
+ {
+ var token = context.TargetToken;
+
+ var select = token.GetAncestor<SelectClauseSyntax>();
+ if (select == null)
+ {
+ return false;
+ }
+
+ if (select.Expression.Width() == 0)
+ {
+ return false;
+ }
+
+ var lastToken = select.Expression.GetLastToken(includeSkipped: true);
+
+ if (lastToken == token)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ private bool IsValidContextForGroup(CSharpSyntaxContext context)
+ {
+ var token = context.TargetToken;
+
+ var group = token.GetAncestor<GroupClauseSyntax>();
+ if (group == null)
+ {
+ return false;
+ }
+
+ if (group.ByExpression.Width() == 0 ||
+ group.GroupExpression.Width() == 0)
+ {
+ return false;
+ }
+
+ var lastToken = group.ByExpression.GetLastToken(includeSkipped: true);
+
+ if (lastToken == token)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ private static bool IsValidContextForJoin(CSharpSyntaxContext context)
+ {
+ // cases:
+ // join a in expr o1 equals o2 |
+ // join a in expr o1 equals o2 i|
+
+ var token = context.TargetToken;
+ var join = token.GetAncestor<JoinClauseSyntax>();
+
+ if (join == null)
+ {
+ // happens for:
+ // join a in expr on o1 equals o2 e|
+ if (!token.IntersectsWith(context.Position))
+ {
+ return false;
+ }
+
+ token = token.GetPreviousToken(includeSkipped: true);
+ join = token.GetAncestor<JoinClauseSyntax>();
+
+ if (join == null)
+ {
+ return false;
+ }
+ }
+
+ var lastToken = join.RightExpression.GetLastToken(includeSkipped: true);
+
+ // join a in expr on o1 equals o2 |
+ if (token == lastToken &&
+ !lastToken.IntersectsWith(context.Position))
+ {
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/IsKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/IsKeywordRecommender.cs
new file mode 100644
index 0000000000..e9359aae81
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/IsKeywordRecommender.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class IsKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public IsKeywordRecommender()
+ : base(SyntaxKind.IsKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ // cases:
+ // expr |
+ return !context.IsInNonUserCode && context.IsIsOrAsContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/JoinKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/JoinKeywordRecommender.cs
new file mode 100644
index 0000000000..d61b937922
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/JoinKeywordRecommender.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class JoinKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public JoinKeywordRecommender()
+ : base(SyntaxKind.JoinKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.SyntaxTree.IsValidContextForJoinClause(position, context.LeftToken, cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/LetKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/LetKeywordRecommender.cs
new file mode 100644
index 0000000000..f76d9b97ca
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/LetKeywordRecommender.cs
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class LetKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public LetKeywordRecommender()
+ : base(SyntaxKind.LetKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var token = context.TargetToken;
+
+ // var q = from x in y
+ // |
+ if (!token.IntersectsWith(position) &&
+ token.IsLastTokenOfQueryClause())
+ {
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/LineKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/LineKeywordRecommender.cs
new file mode 100644
index 0000000000..f481ef3436
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/LineKeywordRecommender.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class LineKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public LineKeywordRecommender()
+ : base(SyntaxKind.LineKeyword, isValidInPreprocessorContext: true)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.IsPreProcessorKeywordContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/LockKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/LockKeywordRecommender.cs
new file mode 100644
index 0000000000..0ce70f2edb
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/LockKeywordRecommender.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class LockKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public LockKeywordRecommender()
+ : base(SyntaxKind.LockKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/LongKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/LongKeywordRecommender.cs
new file mode 100644
index 0000000000..c2e8ce8963
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/LongKeywordRecommender.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class LongKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public LongKeywordRecommender()
+ : base(SyntaxKind.LongKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ context.IsAnyExpressionContext ||
+ context.IsDefiniteCastTypeContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsObjectCreationTypeContext ||
+ context.IsGenericTypeArgumentContext ||
+ context.IsEnumBaseListContext ||
+ context.IsIsOrAsTypeContext ||
+ context.IsLocalVariableDeclarationContext ||
+ context.IsFixedVariableDeclarationContext ||
+ context.IsParameterTypeContext ||
+ context.IsPossibleLambdaOrAnonymousMethodParameterTypeContext ||
+ context.IsImplicitOrExplicitOperatorTypeContext ||
+ context.IsPrimaryFunctionExpressionContext ||
+ context.IsCrefContext ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.StackAllocKeyword, cancellationToken) ||
+ context.IsDelegateReturnTypeContext ||
+ syntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: SyntaxKindSet.AllMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/MethodKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/MethodKeywordRecommender.cs
new file mode 100644
index 0000000000..e9e61a1240
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/MethodKeywordRecommender.cs
@@ -0,0 +1,43 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class MethodKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public MethodKeywordRecommender()
+ : base(SyntaxKind.MethodKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (context.IsMemberAttributeContext(SyntaxKindSet.ClassInterfaceStructTypeDeclarations, cancellationToken))
+ {
+ return true;
+ }
+
+ var token = context.TargetToken;
+
+ if (token.Kind() == SyntaxKind.OpenBracketToken &&
+ token.Parent.IsKind(SyntaxKind.AttributeList))
+ {
+ if (token.GetAncestor<PropertyDeclarationSyntax>() != null ||
+ token.GetAncestor<EventDeclarationSyntax>() != null)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ModuleKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ModuleKeywordRecommender.cs
new file mode 100644
index 0000000000..f86d6d6a11
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ModuleKeywordRecommender.cs
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ModuleKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public ModuleKeywordRecommender()
+ : base(SyntaxKind.ModuleKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (context.IsTypeAttributeContext(cancellationToken))
+ {
+ var token = context.LeftToken;
+ var type = token.GetAncestor<MemberDeclarationSyntax>();
+
+ return type == null || type.IsParentKind(SyntaxKind.CompilationUnit);
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/NameOfKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/NameOfKeywordRecommender.cs
new file mode 100644
index 0000000000..dc6589997f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/NameOfKeywordRecommender.cs
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class NameOfKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public NameOfKeywordRecommender()
+ : base(SyntaxKind.NameOfKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsAnyExpressionContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ IsAttributeArgumentContext(context);
+ }
+
+ private bool IsAttributeArgumentContext(CSharpSyntaxContext context)
+ {
+ return
+ context.IsAnyExpressionContext &&
+ context.LeftToken.GetAncestor<AttributeSyntax>() != null;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/NamespaceKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/NamespaceKeywordRecommender.cs
new file mode 100644
index 0000000000..f2cd4ef2fc
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/NamespaceKeywordRecommender.cs
@@ -0,0 +1,160 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class NamespaceKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public NamespaceKeywordRecommender()
+ : base(SyntaxKind.NamespaceKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+
+ // namespaces are illegal in interactive code:
+ if (syntaxTree.IsInteractiveOrScript())
+ {
+ return false;
+ }
+
+ // cases:
+ // root: |
+
+ // root: n|
+
+ // extern alias a;
+ // |
+
+ // extern alias a;
+ // n|
+
+ // using Foo;
+ // |
+
+ // using Foo;
+ // n|
+
+ // using Foo = Bar;
+ // |
+
+ // using Foo = Bar;
+ // n|
+
+ // namespace N {}
+ // |
+
+ // namespace N {}
+ // n|
+
+ // class C {}
+ // |
+
+ // class C {}
+ // n|
+
+ var leftToken = context.LeftToken;
+ var token = context.TargetToken;
+
+ // root: n|
+
+ // ns Foo { n|
+
+ // extern alias a;
+ // n|
+
+ // using Foo;
+ // n|
+
+ // using Foo = Bar;
+ // n|
+
+ // a namespace can't come before usings/externs
+ // a child namespace can't come before usings/externs
+ if (leftToken.GetNextToken(includeSkipped: true).IsUsingOrExternKeyword())
+ {
+ return false;
+ }
+
+ // root: |
+ if (token.Kind() == SyntaxKind.None)
+ {
+ // root namespace
+ var root = syntaxTree.GetRoot(cancellationToken) as CompilationUnitSyntax;
+ if (root.Externs.Count > 0 ||
+ root.Usings.Count > 0)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ if (token.Kind() == SyntaxKind.OpenBraceToken &&
+ token.Parent.IsKind(SyntaxKind.NamespaceDeclaration))
+ {
+ return true;
+ }
+
+ // extern alias a;
+ // |
+
+ // using Foo;
+ // |
+ if (token.Kind() == SyntaxKind.SemicolonToken)
+ {
+ if (token.Parent.IsKind(SyntaxKind.ExternAliasDirective, SyntaxKind.UsingDirective))
+ {
+ return true;
+ }
+ }
+
+ // class C {}
+ // |
+ if (token.Kind() == SyntaxKind.CloseBraceToken)
+ {
+ if (token.Parent is TypeDeclarationSyntax &&
+ !(token.Parent.GetParent() is TypeDeclarationSyntax))
+ {
+ return true;
+ }
+ else if (token.Parent.IsKind(SyntaxKind.NamespaceDeclaration))
+ {
+ return true;
+ }
+ }
+
+ // delegate void D();
+ // |
+
+ if (token.Kind() == SyntaxKind.SemicolonToken)
+ {
+ if (token.Parent.IsKind(SyntaxKind.DelegateDeclaration) &&
+ !(token.Parent.GetParent() is TypeDeclarationSyntax))
+ {
+ return true;
+ }
+ }
+
+ // [assembly: foo]
+ // |
+
+ if (token.Kind() == SyntaxKind.CloseBracketToken &&
+ token.Parent.IsKind(SyntaxKind.AttributeList) &&
+ token.Parent.IsParentKind(SyntaxKind.CompilationUnit))
+ {
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/NewKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/NewKeywordRecommender.cs
new file mode 100644
index 0000000000..f5c8c5742f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/NewKeywordRecommender.cs
@@ -0,0 +1,123 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class NewKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.AbstractKeyword,
+ SyntaxKind.ExternKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.ReadOnlyKeyword,
+ SyntaxKind.SealedKeyword,
+ SyntaxKind.StaticKeyword,
+ SyntaxKind.UnsafeKeyword,
+ SyntaxKind.VirtualKeyword,
+ SyntaxKind.VolatileKeyword,
+ };
+
+ protected static readonly ISet<SyntaxKind> ValidTypeModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.AbstractKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.SealedKeyword,
+ SyntaxKind.StaticKeyword,
+ SyntaxKind.UnsafeKeyword
+ };
+
+ public NewKeywordRecommender()
+ : base(SyntaxKind.NewKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return IsValid (position, context, cancellationToken);
+ }
+
+ public bool IsValid(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ IsNewConstraintContext(context, cancellationToken) ||
+ context.IsAnyExpressionContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ IsMemberDeclarationContext(context, cancellationToken) ||
+ IsTypeDeclarationContext(context, cancellationToken);
+ }
+
+ private bool IsTypeDeclarationContext(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (context.IsTypeDeclarationContext(validModifiers: ValidTypeModifiers, validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations, canBePartial: false, cancellationToken: cancellationToken))
+ {
+ // we must be on a nested type.
+ var token = context.LeftToken;
+ return token.GetAncestors<TypeDeclarationSyntax>()
+ .Any(t => token.SpanStart > t.OpenBraceToken.Span.End &&
+ token.Span.End < t.CloseBraceToken.SpanStart);
+ }
+
+ return false;
+ }
+
+ private bool IsMemberDeclarationContext(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.SyntaxTree.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: s_validMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+
+ private static bool IsNewConstraintContext(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ // cases:
+ // where T : |
+ // where T : class, |
+ // where T : Foo, |
+ // note: 'new()' can't come after a 'struct' constraint.
+
+ if (context.SyntaxTree.IsTypeParameterConstraintStartContext(context.Position, context.LeftToken, cancellationToken))
+ {
+ return true;
+ }
+
+ var token = context.TargetToken;
+
+ if (token.Kind() == SyntaxKind.CommaToken &&
+ token.Parent.IsKind(SyntaxKind.TypeParameterConstraintClause))
+ {
+ var constraintClause = token.Parent as TypeParameterConstraintClauseSyntax;
+ if (!constraintClause.Constraints
+ .OfType<ClassOrStructConstraintSyntax>()
+ .Any(c => c.ClassOrStructKeyword.Kind() == SyntaxKind.StructKeyword))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/NullKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/NullKeywordRecommender.cs
new file mode 100644
index 0000000000..3200470fb2
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/NullKeywordRecommender.cs
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class NullKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public NullKeywordRecommender()
+ : base(SyntaxKind.NullKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+
+ return
+ context.IsAnyExpressionContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ IsInSelectCaseContext(context, cancellationToken);
+ }
+
+ private bool IsInSelectCaseContext(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var token = context.TargetToken;
+ if (token.Kind() != SyntaxKind.CaseKeyword)
+ {
+ return false;
+ }
+
+ var switchStatement = token.GetAncestor<SwitchStatementSyntax>();
+ if (switchStatement != null)
+ {
+ var info = context.SemanticModel.GetTypeInfo(switchStatement.Expression, cancellationToken);
+ if (info.Type != null &&
+ info.Type.IsValueType)
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ObjectKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ObjectKeywordRecommender.cs
new file mode 100644
index 0000000000..15293d61e3
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ObjectKeywordRecommender.cs
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ObjectKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public ObjectKeywordRecommender()
+ : base(SyntaxKind.ObjectKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ context.IsNonAttributeExpressionContext ||
+ context.IsDefiniteCastTypeContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsObjectCreationTypeContext ||
+ context.IsGenericTypeArgumentContext ||
+ context.IsIsOrAsTypeContext ||
+ context.IsLocalVariableDeclarationContext ||
+ context.IsParameterTypeContext ||
+ context.IsPossibleLambdaOrAnonymousMethodParameterTypeContext ||
+ context.IsImplicitOrExplicitOperatorTypeContext ||
+ context.IsTypeOfExpressionContext ||
+ context.IsCrefContext ||
+ syntaxTree.IsDefaultExpressionContext(position, context.LeftToken, cancellationToken) ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
+ context.IsDelegateReturnTypeContext ||
+ syntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: SyntaxKindSet.AllMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/OnKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/OnKeywordRecommender.cs
new file mode 100644
index 0000000000..0665f64786
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/OnKeywordRecommender.cs
@@ -0,0 +1,49 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class OnKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public OnKeywordRecommender()
+ : base(SyntaxKind.OnKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ // cases:
+ // join a in expr |
+ // join a in expr o|
+ // join a.b c in expr |
+ // join a.b c in expr o|
+
+ var token = context.TargetToken;
+
+ var join = token.GetAncestor<JoinClauseSyntax>();
+ if (join == null)
+ {
+ return false;
+ }
+
+ // join a in expr |
+ // join a.b c in expr |
+
+ var lastToken = join.InExpression.GetLastToken(includeSkipped: true);
+
+ if (join.InExpression.Width() > 0 &&
+ token == lastToken)
+ {
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/OperatorKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/OperatorKeywordRecommender.cs
new file mode 100644
index 0000000000..2cc67a5057
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/OperatorKeywordRecommender.cs
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class OperatorKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+// private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+// {
+// SyntaxKind.StaticKeyword,
+// SyntaxKind.PublicKeyword,
+// SyntaxKind.ExternKeyword,
+// };
+
+ public OperatorKeywordRecommender()
+ : base(SyntaxKind.OperatorKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ // cases:
+ // public static implicit |
+ // public static explicit |
+ var token = context.TargetToken;
+
+ return
+ token.Kind() == SyntaxKind.ImplicitKeyword ||
+ token.Kind() == SyntaxKind.ExplicitKeyword;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/OrderByKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/OrderByKeywordRecommender.cs
new file mode 100644
index 0000000000..7bc71ac08c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/OrderByKeywordRecommender.cs
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class OrderByKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public OrderByKeywordRecommender()
+ : base(SyntaxKind.OrderByKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var token = context.TargetToken;
+
+ // var q = from x in y
+ // |
+ if (!token.IntersectsWith(position) &&
+ token.IsLastTokenOfQueryClause())
+ {
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/OutKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/OutKeywordRecommender.cs
new file mode 100644
index 0000000000..8b81204b29
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/OutKeywordRecommender.cs
@@ -0,0 +1,30 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class OutKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public OutKeywordRecommender()
+ : base(SyntaxKind.OutKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+
+ // TODO(cyrusn): lambda/anon methods can have out/ref parameters
+ return
+ context.TargetToken.IsTypeParameterVarianceContext() ||
+ syntaxTree.IsParameterModifierContext(position, context.LeftToken, cancellationToken) ||
+ syntaxTree.IsAnonymousMethodParameterModifierContext(position, context.LeftToken, cancellationToken) ||
+ syntaxTree.IsPossibleLambdaParameterModifierContext(position, context.LeftToken, cancellationToken) ||
+ context.TargetToken.IsConstructorOrMethodParameterArgumentContext() ||
+ context.TargetToken.IsXmlCrefParameterModifierContext();
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/OverrideKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/OverrideKeywordRecommender.cs
new file mode 100644
index 0000000000..d01a356317
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/OverrideKeywordRecommender.cs
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class OverrideKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.ExternKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.UnsafeKeyword,
+ SyntaxKind.SealedKeyword,
+ SyntaxKind.AbstractKeyword,
+ };
+
+ public OverrideKeywordRecommender()
+ : base(SyntaxKind.OverrideKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.IsMemberDeclarationContext(
+ validModifiers: s_validMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ParamKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ParamKeywordRecommender.cs
new file mode 100644
index 0000000000..6d4cd307f1
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ParamKeywordRecommender.cs
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ParamKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public ParamKeywordRecommender()
+ : base(SyntaxKind.ParamKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var token = context.TargetToken;
+
+ if (token.Kind() == SyntaxKind.OpenBracketToken &&
+ token.Parent.IsKind(SyntaxKind.AttributeList))
+ {
+ if (token.GetAncestor<PropertyDeclarationSyntax>() != null ||
+ token.GetAncestor<EventDeclarationSyntax>() != null)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ParamsKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ParamsKeywordRecommender.cs
new file mode 100644
index 0000000000..dbb7434508
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ParamsKeywordRecommender.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ParamsKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public ParamsKeywordRecommender()
+ : base(SyntaxKind.ParamsKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.SyntaxTree.IsParameterModifierContext(context.Position, context.LeftToken, cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/PartialKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/PartialKeywordRecommender.cs
new file mode 100644
index 0000000000..e9105b4619
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/PartialKeywordRecommender.cs
@@ -0,0 +1,64 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class PartialKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.AsyncKeyword,
+ SyntaxKind.StaticKeyword
+ };
+
+ public PartialKeywordRecommender()
+ : base(SyntaxKind.PartialKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsGlobalStatementContext ||
+ IsMemberDeclarationContext(context, cancellationToken) ||
+ IsTypeDeclarationContext(context, cancellationToken);
+ }
+
+ private bool IsMemberDeclarationContext(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (context.IsMemberDeclarationContext(validModifiers: s_validMemberModifiers, validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations, canBePartial: false, cancellationToken: cancellationToken))
+ {
+ var token = context.LeftToken;
+ var decl = token.GetAncestor<TypeDeclarationSyntax>();
+
+ // partial methods must be in partial types
+ if (!decl.Modifiers.Any(t => t.IsKindOrHasMatchingText(SyntaxKind.PartialKeyword)))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ private bool IsTypeDeclarationContext(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.IsTypeDeclarationContext(
+ validModifiers: SyntaxKindSet.AllTypeModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/PragmaKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/PragmaKeywordRecommender.cs
new file mode 100644
index 0000000000..556d2ee144
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/PragmaKeywordRecommender.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class PragmaKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public PragmaKeywordRecommender()
+ : base(SyntaxKind.PragmaKeyword, isValidInPreprocessorContext: true)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.IsPreProcessorKeywordContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/PrivateKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/PrivateKeywordRecommender.cs
new file mode 100644
index 0000000000..26a1f1d8f2
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/PrivateKeywordRecommender.cs
@@ -0,0 +1,87 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class PrivateKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public PrivateKeywordRecommender()
+ : base(SyntaxKind.PrivateKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsGlobalStatementContext ||
+ IsValidContextForAccessor(context) ||
+ IsValidContextForType(context, cancellationToken) ||
+ IsValidContextForMember(context, cancellationToken);
+ }
+
+ private static bool IsValidContextForAccessor(CSharpSyntaxContext context)
+ {
+ if (context.TargetToken.IsAccessorDeclarationContext<PropertyDeclarationSyntax>(context.Position) ||
+ context.TargetToken.IsAccessorDeclarationContext<IndexerDeclarationSyntax>(context.Position))
+ {
+ return CheckPreviousAccessibilityModifiers(context);
+ }
+
+ return false;
+ }
+
+ private static bool IsValidContextForMember(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (context.SyntaxTree.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(validModifiers: SyntaxKindSet.AllMemberModifiers, validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations, canBePartial: false, cancellationToken: cancellationToken))
+ {
+ var modifiers = context.PrecedingModifiers;
+
+ // can't have private + abstract/virtual/override/sealed
+ if (modifiers.Contains(SyntaxKind.AbstractKeyword) ||
+ modifiers.Contains(SyntaxKind.VirtualKeyword) ||
+ modifiers.Contains(SyntaxKind.OverrideKeyword) ||
+ modifiers.Contains(SyntaxKind.SealedKeyword))
+ {
+ return false;
+ }
+
+ return CheckPreviousAccessibilityModifiers(context);
+ }
+
+ return false;
+ }
+
+ private static bool IsValidContextForType(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (context.IsTypeDeclarationContext(validModifiers: SyntaxKindSet.AllTypeModifiers, validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations, canBePartial: false, cancellationToken: cancellationToken))
+ {
+ // private things can't be in namespaces.
+ var typeDecl = context.ContainingTypeDeclaration;
+ if (typeDecl == null)
+ {
+ return false;
+ }
+
+ return CheckPreviousAccessibilityModifiers(context);
+ }
+
+ return false;
+ }
+
+ private static bool CheckPreviousAccessibilityModifiers(CSharpSyntaxContext context)
+ {
+ var precedingModifiers = context.PrecedingModifiers;
+ return
+ !precedingModifiers.Contains(SyntaxKind.PublicKeyword) &&
+ !precedingModifiers.Contains(SyntaxKind.InternalKeyword) &&
+ !precedingModifiers.Contains(SyntaxKind.ProtectedKeyword) &&
+ !precedingModifiers.Contains(SyntaxKind.PrivateKeyword);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/PropertyKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/PropertyKeywordRecommender.cs
new file mode 100644
index 0000000000..6be63e7031
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/PropertyKeywordRecommender.cs
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class PropertyKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public PropertyKeywordRecommender()
+ : base(SyntaxKind.PropertyKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.IsMemberAttributeContext(SyntaxKindSet.ClassInterfaceStructTypeDeclarations, cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ProtectedKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ProtectedKeywordRecommender.cs
new file mode 100644
index 0000000000..3c7d897e22
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ProtectedKeywordRecommender.cs
@@ -0,0 +1,74 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ProtectedKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public ProtectedKeywordRecommender()
+ : base(SyntaxKind.ProtectedKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ IsValidContextForAccessor(context) ||
+ IsValidContextForType(context, cancellationToken) ||
+ IsValidContextForMember(context, cancellationToken);
+ }
+
+ private static bool IsValidContextForAccessor(CSharpSyntaxContext context)
+ {
+ if (context.TargetToken.IsAccessorDeclarationContext<PropertyDeclarationSyntax>(context.Position) ||
+ context.TargetToken.IsAccessorDeclarationContext<IndexerDeclarationSyntax>(context.Position))
+ {
+ return CheckPreviousAccessibilityModifiers(context);
+ }
+
+ return false;
+ }
+
+ private static bool IsValidContextForMember(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (context.IsMemberDeclarationContext(validModifiers: SyntaxKindSet.AllMemberModifiers, validTypeDeclarations: SyntaxKindSet.ClassOnlyTypeDeclarations, canBePartial: false, cancellationToken: cancellationToken))
+ {
+ return CheckPreviousAccessibilityModifiers(context);
+ }
+
+ return false;
+ }
+
+ private static bool IsValidContextForType(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (context.IsTypeDeclarationContext(validModifiers: SyntaxKindSet.AllTypeModifiers, validTypeDeclarations: SyntaxKindSet.ClassOnlyTypeDeclarations, canBePartial: false, cancellationToken: cancellationToken))
+ {
+ // protected things can't be in namespaces.
+ var typeDecl = context.ContainingTypeDeclaration;
+ if (typeDecl == null)
+ {
+ return false;
+ }
+
+ return CheckPreviousAccessibilityModifiers(context);
+ }
+
+ return false;
+ }
+
+ private static bool CheckPreviousAccessibilityModifiers(CSharpSyntaxContext context)
+ {
+ // We can show up after 'internal'.
+ var precedingModifiers = context.PrecedingModifiers;
+ return
+ !precedingModifiers.Contains(SyntaxKind.PublicKeyword) &&
+ !precedingModifiers.Contains(SyntaxKind.ProtectedKeyword) &&
+ !precedingModifiers.Contains(SyntaxKind.PrivateKeyword);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/PublicKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/PublicKeywordRecommender.cs
new file mode 100644
index 0000000000..21debc6f36
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/PublicKeywordRecommender.cs
@@ -0,0 +1,60 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class PublicKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public PublicKeywordRecommender()
+ : base(SyntaxKind.PublicKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsGlobalStatementContext ||
+ IsValidContextForType(context, cancellationToken) ||
+ IsValidContextForMember(context, cancellationToken);
+ }
+
+ private static bool IsValidContextForMember(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (context.SyntaxTree.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: SyntaxKindSet.AllMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken))
+ {
+ return CheckPreviousAccessibilityModifiers(context);
+ }
+
+ return false;
+ }
+
+ private static bool IsValidContextForType(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (context.IsTypeDeclarationContext(validModifiers: SyntaxKindSet.AllTypeModifiers, validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations, canBePartial: false, cancellationToken: cancellationToken))
+ {
+ return CheckPreviousAccessibilityModifiers(context);
+ }
+
+ return false;
+ }
+
+ private static bool CheckPreviousAccessibilityModifiers(CSharpSyntaxContext context)
+ {
+ var precedingModifiers = context.PrecedingModifiers;
+ return
+ !precedingModifiers.Contains(SyntaxKind.PublicKeyword) &&
+ !precedingModifiers.Contains(SyntaxKind.InternalKeyword) &&
+ !precedingModifiers.Contains(SyntaxKind.ProtectedKeyword) &&
+ !precedingModifiers.Contains(SyntaxKind.PrivateKeyword);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ReadOnlyKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ReadOnlyKeywordRecommender.cs
new file mode 100644
index 0000000000..0e845ed6e9
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ReadOnlyKeywordRecommender.cs
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ReadOnlyKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.NewKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.StaticKeyword,
+ };
+
+ public ReadOnlyKeywordRecommender()
+ : base(SyntaxKind.ReadOnlyKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsGlobalStatementContext ||
+ context.SyntaxTree.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: s_validMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/RefKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/RefKeywordRecommender.cs
new file mode 100644
index 0000000000..83081f1ebd
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/RefKeywordRecommender.cs
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class RefKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public RefKeywordRecommender()
+ : base(SyntaxKind.RefKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ syntaxTree.IsParameterModifierContext(position, context.LeftToken, cancellationToken) ||
+ syntaxTree.IsAnonymousMethodParameterModifierContext(position, context.LeftToken, cancellationToken) ||
+ syntaxTree.IsPossibleLambdaParameterModifierContext(position, context.LeftToken, cancellationToken) ||
+ context.TargetToken.IsConstructorOrMethodParameterArgumentContext() ||
+ context.TargetToken.IsXmlCrefParameterModifierContext();
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ReferenceKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ReferenceKeywordRecommender.cs
new file mode 100644
index 0000000000..5fb24646fe
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ReferenceKeywordRecommender.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ReferenceKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public ReferenceKeywordRecommender()
+ : base(SyntaxKind.ReferenceKeyword, isValidInPreprocessorContext: true)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ syntaxTree.IsInteractiveOrScript() &&
+ syntaxTree.IsBeforeFirstToken(position, cancellationToken) &&
+ context.IsPreProcessorKeywordContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/RegionKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/RegionKeywordRecommender.cs
new file mode 100644
index 0000000000..67fffd3948
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/RegionKeywordRecommender.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class RegionKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public RegionKeywordRecommender()
+ : base(SyntaxKind.RegionKeyword, isValidInPreprocessorContext: true, shouldFormatOnCommit: true)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.IsPreProcessorKeywordContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/RemoveKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/RemoveKeywordRecommender.cs
new file mode 100644
index 0000000000..e9abae057c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/RemoveKeywordRecommender.cs
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class RemoveKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public RemoveKeywordRecommender()
+ : base(SyntaxKind.RemoveKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.TargetToken.IsAccessorDeclarationContext<EventDeclarationSyntax>(position, SyntaxKind.RemoveKeyword);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/RestoreKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/RestoreKeywordRecommender.cs
new file mode 100644
index 0000000000..715edd7c22
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/RestoreKeywordRecommender.cs
@@ -0,0 +1,30 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class RestoreKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public RestoreKeywordRecommender()
+ : base(SyntaxKind.RestoreKeyword, isValidInPreprocessorContext: true)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ // # pragma warning |
+ // # pragma warning r|
+ var previousToken1 = context.TargetToken;
+ var previousToken2 = previousToken1.GetPreviousToken(includeSkipped: true);
+ var previousToken3 = previousToken2.GetPreviousToken(includeSkipped: true);
+
+ return
+ previousToken1.Kind() == SyntaxKind.WarningKeyword &&
+ previousToken2.Kind() == SyntaxKind.PragmaKeyword &&
+ previousToken3.Kind() == SyntaxKind.HashToken;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ReturnKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ReturnKeywordRecommender.cs
new file mode 100644
index 0000000000..da927d71be
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ReturnKeywordRecommender.cs
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ReturnKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public ReturnKeywordRecommender()
+ : base(SyntaxKind.ReturnKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsStatementContext ||
+ context.TargetToken.IsAfterYieldKeyword() ||
+ IsAttributeContext(context, cancellationToken);
+ }
+
+ private static bool IsAttributeContext(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsMemberAttributeContext(SyntaxKindSet.ClassInterfaceStructTypeDeclarations, cancellationToken) ||
+ (context.SyntaxTree.IsInteractiveOrScript() && context.IsTypeAttributeContext(cancellationToken));
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SByteKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SByteKeywordRecommender.cs
new file mode 100644
index 0000000000..c8edd8e150
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SByteKeywordRecommender.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class SByteKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public SByteKeywordRecommender()
+ : base(SyntaxKind.SByteKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ context.IsNonAttributeExpressionContext ||
+ context.IsDefiniteCastTypeContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsObjectCreationTypeContext ||
+ context.IsGenericTypeArgumentContext ||
+ context.IsEnumBaseListContext ||
+ context.IsIsOrAsTypeContext ||
+ context.IsLocalVariableDeclarationContext ||
+ context.IsFixedVariableDeclarationContext ||
+ context.IsParameterTypeContext ||
+ context.IsPossibleLambdaOrAnonymousMethodParameterTypeContext ||
+ context.IsImplicitOrExplicitOperatorTypeContext ||
+ context.IsPrimaryFunctionExpressionContext ||
+ context.IsCrefContext ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.StackAllocKeyword, cancellationToken) ||
+ context.IsDelegateReturnTypeContext ||
+ syntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: SyntaxKindSet.AllMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SealedKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SealedKeywordRecommender.cs
new file mode 100644
index 0000000000..ac89445eee
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SealedKeywordRecommender.cs
@@ -0,0 +1,55 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class SealedKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.ExternKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.NewKeyword,
+ SyntaxKind.OverrideKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.UnsafeKeyword,
+ };
+
+ private static readonly ISet<SyntaxKind> s_validTypeModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.NewKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.UnsafeKeyword
+ };
+
+ public SealedKeywordRecommender()
+ : base(SyntaxKind.SealedKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsGlobalStatementContext ||
+ context.IsMemberDeclarationContext(
+ validModifiers: s_validMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassOnlyTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken) ||
+ context.IsTypeDeclarationContext(
+ validModifiers: s_validTypeModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SelectKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SelectKeywordRecommender.cs
new file mode 100644
index 0000000000..76afd5cc48
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SelectKeywordRecommender.cs
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class SelectKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public SelectKeywordRecommender()
+ : base(SyntaxKind.SelectKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var token = context.TargetToken;
+
+ // for orderby, ascending is the default so select should be available in the orderby direction context
+ if (token.IsOrderByDirectionContext())
+ {
+ return true;
+ }
+
+ // var q = from x in y
+ // |
+ if (!token.IntersectsWith(position) &&
+ token.IsLastTokenOfQueryClause())
+ {
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SetKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SetKeywordRecommender.cs
new file mode 100644
index 0000000000..bd37ed26a0
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SetKeywordRecommender.cs
@@ -0,0 +1,24 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class SetKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public SetKeywordRecommender()
+ : base(SyntaxKind.SetKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.TargetToken.IsAccessorDeclarationContext<PropertyDeclarationSyntax>(position, SyntaxKind.SetKeyword) ||
+ context.TargetToken.IsAccessorDeclarationContext<IndexerDeclarationSyntax>(position, SyntaxKind.SetKeyword);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ShortKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ShortKeywordRecommender.cs
new file mode 100644
index 0000000000..e017ee200c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ShortKeywordRecommender.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ShortKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public ShortKeywordRecommender()
+ : base(SyntaxKind.ShortKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ context.IsAnyExpressionContext ||
+ context.IsDefiniteCastTypeContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsObjectCreationTypeContext ||
+ context.IsGenericTypeArgumentContext ||
+ context.IsEnumBaseListContext ||
+ context.IsIsOrAsTypeContext ||
+ context.IsLocalVariableDeclarationContext ||
+ context.IsFixedVariableDeclarationContext ||
+ context.IsParameterTypeContext ||
+ context.IsPossibleLambdaOrAnonymousMethodParameterTypeContext ||
+ context.IsImplicitOrExplicitOperatorTypeContext ||
+ context.IsPrimaryFunctionExpressionContext ||
+ context.IsCrefContext ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.StackAllocKeyword, cancellationToken) ||
+ context.IsDelegateReturnTypeContext ||
+ syntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: SyntaxKindSet.AllMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SizeOfKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SizeOfKeywordRecommender.cs
new file mode 100644
index 0000000000..b789d84171
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SizeOfKeywordRecommender.cs
@@ -0,0 +1,24 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class SizeOfKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public SizeOfKeywordRecommender()
+ : base(SyntaxKind.SizeOfKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsNonAttributeExpressionContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/StackAllocKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/StackAllocKeywordRecommender.cs
new file mode 100644
index 0000000000..eb66b49210
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/StackAllocKeywordRecommender.cs
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class StackAllocKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public StackAllocKeywordRecommender()
+ : base(SyntaxKind.StackAllocKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ // type t = |
+ var token = context.TargetToken;
+ if (token.IsUnsafeContext())
+ {
+ if (token.Kind() == SyntaxKind.EqualsToken &&
+ token.Parent.IsKind(SyntaxKind.EqualsValueClause) &&
+ token.Parent.IsParentKind(SyntaxKind.VariableDeclarator) &&
+ token.Parent.Parent.IsParentKind(SyntaxKind.VariableDeclaration))
+ {
+ var variableDeclaration = (VariableDeclarationSyntax)token.Parent.Parent.Parent;
+ if (variableDeclaration.IsParentKind(SyntaxKind.LocalDeclarationStatement) ||
+ variableDeclaration.IsParentKind(SyntaxKind.ForStatement))
+ {
+ return variableDeclaration.Type.IsVar || variableDeclaration.Type.IsKind(SyntaxKind.PointerType);
+ }
+ }
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/StaticKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/StaticKeywordRecommender.cs
new file mode 100644
index 0000000000..8daf3e29b5
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/StaticKeywordRecommender.cs
@@ -0,0 +1,83 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class StaticKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validTypeModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.NewKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.UnsafeKeyword,
+ };
+
+ private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.AsyncKeyword,
+ SyntaxKind.ExternKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.NewKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.ReadOnlyKeyword,
+ SyntaxKind.UnsafeKeyword,
+ SyntaxKind.VolatileKeyword,
+ };
+
+ private static readonly ISet<SyntaxKind> s_validGlobalMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.ExternKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.NewKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.ReadOnlyKeyword,
+ SyntaxKind.UnsafeKeyword,
+ SyntaxKind.VolatileKeyword,
+ };
+
+ public StaticKeywordRecommender()
+ : base(SyntaxKind.StaticKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsGlobalStatementContext ||
+ context.TargetToken.IsUsingKeywordInUsingDirective() ||
+ IsValidContextForType(context, cancellationToken) ||
+ IsValidContextForMember(context, cancellationToken);
+ }
+
+ private static bool IsValidContextForMember(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.SyntaxTree.IsGlobalMemberDeclarationContext(context.Position, s_validGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: s_validMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+
+ private static bool IsValidContextForType(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.IsTypeDeclarationContext(
+ validModifiers: s_validTypeModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/StringKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/StringKeywordRecommender.cs
new file mode 100644
index 0000000000..a064a15360
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/StringKeywordRecommender.cs
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class StringKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public StringKeywordRecommender()
+ : base(SyntaxKind.StringKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ context.IsAnyExpressionContext ||
+ context.IsDefiniteCastTypeContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsObjectCreationTypeContext ||
+ context.IsGenericTypeArgumentContext ||
+ context.IsIsOrAsTypeContext ||
+ context.IsLocalVariableDeclarationContext ||
+ context.IsParameterTypeContext ||
+ context.IsPossibleLambdaOrAnonymousMethodParameterTypeContext ||
+ context.IsImplicitOrExplicitOperatorTypeContext ||
+ context.IsTypeOfExpressionContext ||
+ context.IsCrefContext ||
+ syntaxTree.IsDefaultExpressionContext(position, context.LeftToken, cancellationToken) ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
+ context.IsDelegateReturnTypeContext ||
+ syntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: SyntaxKindSet.AllMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/StructKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/StructKeywordRecommender.cs
new file mode 100644
index 0000000000..ad11333782
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/StructKeywordRecommender.cs
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class StructKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.UnsafeKeyword
+ };
+
+ public StructKeywordRecommender()
+ : base(SyntaxKind.StructKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ context.IsGlobalStatementContext ||
+ context.IsTypeDeclarationContext(
+ validModifiers: s_validModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations,
+ canBePartial: true,
+ cancellationToken: cancellationToken) ||
+ syntaxTree.IsTypeParameterConstraintStartContext(position, context.LeftToken, cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SwitchKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SwitchKeywordRecommender.cs
new file mode 100644
index 0000000000..628463284a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/SwitchKeywordRecommender.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class SwitchKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public SwitchKeywordRecommender()
+ : base(SyntaxKind.SwitchKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ThisKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ThisKeywordRecommender.cs
new file mode 100644
index 0000000000..ded002dfd5
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ThisKeywordRecommender.cs
@@ -0,0 +1,97 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ThisKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public ThisKeywordRecommender()
+ : base(SyntaxKind.ThisKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ IsInstanceExpressionOrStatement(context) ||
+ IsExtensionMethodParameterContext(context, cancellationToken) ||
+ IsConstructorInitializerContext(context);
+ }
+
+ private static bool IsInstanceExpressionOrStatement(CSharpSyntaxContext context)
+ {
+ if (context.IsInstanceContext)
+ {
+ return context.IsNonAttributeExpressionContext || context.IsStatementContext;
+ }
+
+ return false;
+ }
+
+ private bool IsConstructorInitializerContext(CSharpSyntaxContext context)
+ {
+ // cases:
+ // Foo() : |
+
+ var token = context.TargetToken;
+
+ if (token.Kind() == SyntaxKind.ColonToken &&
+ token.Parent is ConstructorInitializerSyntax &&
+ token.Parent.IsParentKind(SyntaxKind.ConstructorDeclaration))
+ {
+ var constructor = token.GetAncestor<ConstructorDeclarationSyntax>();
+ if (constructor.Modifiers.Any(m => m.IsKind (SyntaxKind.StaticKeyword)))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ private static bool IsExtensionMethodParameterContext(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ // TODO(cyrusn): lambda/anon methods can have out/ref parameters
+ if (!context.SyntaxTree.IsParameterModifierContext(context.Position, context.LeftToken, cancellationToken, allowableIndex: 0))
+ {
+ return false;
+ }
+
+ var token = context.LeftToken;
+ var method = token.GetAncestor<MethodDeclarationSyntax>();
+ var typeDecl = method.GetAncestorOrThis<TypeDeclarationSyntax>();
+
+ if (method == null || typeDecl == null)
+ {
+ return false;
+ }
+
+ if (typeDecl.Kind() != SyntaxKind.ClassDeclaration)
+ {
+ return false;
+ }
+
+ if (!method.Modifiers.Any(t => t.Kind() == SyntaxKind.StaticKeyword))
+ {
+ return false;
+ }
+
+ if (!typeDecl.Modifiers.Any(t => t.Kind() == SyntaxKind.StaticKeyword))
+ {
+ return false;
+ }
+
+ return true;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ThrowKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ThrowKeywordRecommender.cs
new file mode 100644
index 0000000000..9572ebe9ab
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ThrowKeywordRecommender.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ThrowKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public ThrowKeywordRecommender()
+ : base(SyntaxKind.ThrowKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/TrueKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/TrueKeywordRecommender.cs
new file mode 100644
index 0000000000..a190aae0b8
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/TrueKeywordRecommender.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class TrueKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public TrueKeywordRecommender()
+ : base(SyntaxKind.TrueKeyword, isValidInPreprocessorContext: true)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsAnyExpressionContext ||
+ context.IsPreProcessorExpressionContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.TargetToken.IsUnaryOperatorContext();
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/TryKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/TryKeywordRecommender.cs
new file mode 100644
index 0000000000..27945aa024
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/TryKeywordRecommender.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class TryKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public TryKeywordRecommender()
+ : base(SyntaxKind.TryKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/TypeKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/TypeKeywordRecommender.cs
new file mode 100644
index 0000000000..4d9bf61e9d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/TypeKeywordRecommender.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class TypeKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public TypeKeywordRecommender()
+ : base(SyntaxKind.TypeKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.IsTypeAttributeContext(cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/TypeOfKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/TypeOfKeywordRecommender.cs
new file mode 100644
index 0000000000..c68e66d8e5
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/TypeOfKeywordRecommender.cs
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class TypeOfKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public TypeOfKeywordRecommender()
+ : base(SyntaxKind.TypeOfKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ (context.IsAnyExpressionContext && !context.IsConstantExpressionContext) ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ IsAttributeArgumentContext(context);
+ }
+
+ private bool IsAttributeArgumentContext(CSharpSyntaxContext context)
+ {
+ return
+ context.IsAnyExpressionContext &&
+ context.LeftToken.GetAncestor<AttributeSyntax>() != null;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/TypeVarKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/TypeVarKeywordRecommender.cs
new file mode 100644
index 0000000000..cac63dd97a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/TypeVarKeywordRecommender.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class TypeVarKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public TypeVarKeywordRecommender()
+ : base(SyntaxKind.TypeVarKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var token = context.TargetToken;
+
+ if (token.Kind() == SyntaxKind.OpenBracketToken &&
+ token.Parent.IsKind(SyntaxKind.AttributeList))
+ {
+ var typeParameters = token.GetAncestor<TypeParameterListSyntax>();
+ var type = typeParameters.GetAncestorOrThis<TypeDeclarationSyntax>();
+
+ if (type != null && type.TypeParameterList == typeParameters)
+ {
+ return true;
+ }
+
+ var @delegate = typeParameters.GetAncestorOrThis<DelegateDeclarationSyntax>();
+ if (@delegate != null && @delegate.TypeParameterList == typeParameters)
+ {
+ return true;
+ }
+
+ var method = typeParameters.GetAncestorOrThis<MethodDeclarationSyntax>();
+ if (method != null && method.TypeParameterList == typeParameters)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UIntKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UIntKeywordRecommender.cs
new file mode 100644
index 0000000000..282af54e04
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UIntKeywordRecommender.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class UIntKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public UIntKeywordRecommender()
+ : base(SyntaxKind.UIntKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ context.IsAnyExpressionContext ||
+ context.IsDefiniteCastTypeContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsObjectCreationTypeContext ||
+ context.IsGenericTypeArgumentContext ||
+ context.IsEnumBaseListContext ||
+ context.IsIsOrAsTypeContext ||
+ context.IsLocalVariableDeclarationContext ||
+ context.IsFixedVariableDeclarationContext ||
+ context.IsParameterTypeContext ||
+ context.IsPossibleLambdaOrAnonymousMethodParameterTypeContext ||
+ context.IsImplicitOrExplicitOperatorTypeContext ||
+ context.IsPrimaryFunctionExpressionContext ||
+ context.IsCrefContext ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.StackAllocKeyword, cancellationToken) ||
+ context.IsDelegateReturnTypeContext ||
+ syntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: SyntaxKindSet.AllMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ULongKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ULongKeywordRecommender.cs
new file mode 100644
index 0000000000..08c52123d8
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/ULongKeywordRecommender.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class ULongKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public ULongKeywordRecommender()
+ : base(SyntaxKind.ULongKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ context.IsAnyExpressionContext ||
+ context.IsDefiniteCastTypeContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsObjectCreationTypeContext ||
+ context.IsGenericTypeArgumentContext ||
+ context.IsEnumBaseListContext ||
+ context.IsIsOrAsTypeContext ||
+ context.IsLocalVariableDeclarationContext ||
+ context.IsFixedVariableDeclarationContext ||
+ context.IsParameterTypeContext ||
+ context.IsPossibleLambdaOrAnonymousMethodParameterTypeContext ||
+ context.IsImplicitOrExplicitOperatorTypeContext ||
+ context.IsPrimaryFunctionExpressionContext ||
+ context.IsCrefContext ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.StackAllocKeyword, cancellationToken) ||
+ context.IsDelegateReturnTypeContext ||
+ syntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: SyntaxKindSet.AllMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UShortKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UShortKeywordRecommender.cs
new file mode 100644
index 0000000000..42406d6d2a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UShortKeywordRecommender.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class UShortKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public UShortKeywordRecommender()
+ : base(SyntaxKind.UShortKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ context.IsAnyExpressionContext ||
+ context.IsDefiniteCastTypeContext ||
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsObjectCreationTypeContext ||
+ context.IsGenericTypeArgumentContext ||
+ context.IsEnumBaseListContext ||
+ context.IsIsOrAsTypeContext ||
+ context.IsLocalVariableDeclarationContext ||
+ context.IsFixedVariableDeclarationContext ||
+ context.IsParameterTypeContext ||
+ context.IsPossibleLambdaOrAnonymousMethodParameterTypeContext ||
+ context.IsImplicitOrExplicitOperatorTypeContext ||
+ context.IsPrimaryFunctionExpressionContext ||
+ context.IsCrefContext ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.StackAllocKeyword, cancellationToken) ||
+ context.IsDelegateReturnTypeContext ||
+ syntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: SyntaxKindSet.AllMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UncheckedKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UncheckedKeywordRecommender.cs
new file mode 100644
index 0000000000..118703f82e
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UncheckedKeywordRecommender.cs
@@ -0,0 +1,24 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class UncheckedKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public UncheckedKeywordRecommender()
+ : base(SyntaxKind.UncheckedKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsNonAttributeExpressionContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UndefKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UndefKeywordRecommender.cs
new file mode 100644
index 0000000000..e887b40db7
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UndefKeywordRecommender.cs
@@ -0,0 +1,25 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class UndefKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public UndefKeywordRecommender()
+ : base(SyntaxKind.UndefKeyword, isValidInPreprocessorContext: true)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ syntaxTree.IsBeforeFirstToken(position, cancellationToken) &&
+ context.IsPreProcessorKeywordContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UnsafeKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UnsafeKeywordRecommender.cs
new file mode 100644
index 0000000000..1a1accb611
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UnsafeKeywordRecommender.cs
@@ -0,0 +1,74 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class UnsafeKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validTypeModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.AbstractKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.NewKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.SealedKeyword,
+ SyntaxKind.StaticKeyword,
+ };
+
+ private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.AbstractKeyword,
+ SyntaxKind.ExternKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.NewKeyword,
+ SyntaxKind.OverrideKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.ReadOnlyKeyword,
+ SyntaxKind.SealedKeyword,
+ SyntaxKind.StaticKeyword,
+ SyntaxKind.VirtualKeyword,
+ SyntaxKind.VolatileKeyword,
+ };
+
+ private static readonly ISet<SyntaxKind> s_validGlobalMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.ExternKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.NewKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.ReadOnlyKeyword,
+ SyntaxKind.StaticKeyword,
+ SyntaxKind.VolatileKeyword,
+ };
+
+ public UnsafeKeywordRecommender()
+ : base(SyntaxKind.UnsafeKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ context.IsTypeDeclarationContext(validModifiers: s_validTypeModifiers, validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations, canBePartial: false, cancellationToken: cancellationToken) ||
+ syntaxTree.IsGlobalMemberDeclarationContext(position, s_validGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: s_validMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UsingKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UsingKeywordRecommender.cs
new file mode 100644
index 0000000000..f1dc791e6f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/UsingKeywordRecommender.cs
@@ -0,0 +1,139 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class UsingKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public UsingKeywordRecommender()
+ : base(SyntaxKind.UsingKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ // cases:
+ // using (foo) { }
+ // using Foo;
+ // using Foo = Bar;
+ return
+ context.IsStatementContext ||
+ context.IsGlobalStatementContext ||
+ IsUsingDirectiveContext(context, cancellationToken);
+ }
+
+ private static bool IsUsingDirectiveContext(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ // cases:
+ // root: |
+
+ // root: u|
+
+ // extern alias a;
+ // |
+
+ // extern alias a;
+ // u|
+
+ // using Foo;
+ // |
+
+ // using Foo;
+ // u|
+
+ // using Foo = Bar;
+ // |
+
+ // using Foo = Bar;
+ // u|
+
+ // t valid:
+ // namespace N {}
+ // |
+
+ // namespace N {}
+ // u|
+
+ // class C {}
+ // |
+
+ // class C {}
+ // u|
+
+ // |
+ // extern alias a;
+
+ // u|
+ // extern alias a;
+
+ var originalToken = context.LeftToken;
+ var token = context.TargetToken;
+
+ // root: u|
+
+ // ns Foo { u|
+
+ // extern alias a;
+ // u|
+
+ // using Foo;
+ // u|
+
+ // using Foo = Bar;
+ // u|
+
+ // root: |
+ if (token.Kind() == SyntaxKind.None)
+ {
+ // root namespace
+
+ // a using can't come before externs
+ var nextToken = originalToken.GetNextToken(includeSkipped: true);
+ if (nextToken.Kind() == SyntaxKind.ExternKeyword ||
+ ((CompilationUnitSyntax)context.SyntaxTree.GetRoot(cancellationToken)).Externs.Count > 0)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ if (token.Kind() == SyntaxKind.OpenBraceToken &&
+ token.Parent.IsKind(SyntaxKind.NamespaceDeclaration))
+ {
+ var ns = (NamespaceDeclarationSyntax)token.Parent;
+
+ // a child using can't come before externs
+ var nextToken = originalToken.GetNextToken(includeSkipped: true);
+ if (nextToken.Kind() == SyntaxKind.ExternKeyword)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ // extern alias a;
+ // |
+
+ // using Foo;
+ // |
+ if (token.Kind() == SyntaxKind.SemicolonToken)
+ {
+ if (token.Parent.IsKind(SyntaxKind.ExternAliasDirective) ||
+ token.Parent.IsKind(SyntaxKind.UsingDirective))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/VarKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/VarKeywordRecommender.cs
new file mode 100644
index 0000000000..6627a049e9
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/VarKeywordRecommender.cs
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class VarKeywordRecommender : IKeywordRecommender<CSharpSyntaxContext>
+ {
+ public VarKeywordRecommender()
+ {
+ }
+
+ private bool IsValidContext(CSharpSyntaxContext context)
+ {
+ if (context.IsStatementContext ||
+ context.IsGlobalStatementContext)
+ {
+ return true;
+ }
+
+ return context.IsLocalVariableDeclarationContext;
+ }
+
+ public IEnumerable<RecommendedKeyword> RecommendKeywords(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (IsValidContext(context))
+ {
+ yield return new RecommendedKeyword("var", SyntaxKind.TypeVarKeyword);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/VirtualKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/VirtualKeywordRecommender.cs
new file mode 100644
index 0000000000..d98e7b1616
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/VirtualKeywordRecommender.cs
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class VirtualKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.ExternKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.NewKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.UnsafeKeyword,
+ };
+
+ public VirtualKeywordRecommender()
+ : base(SyntaxKind.VirtualKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.IsMemberDeclarationContext(
+ validModifiers: s_validMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassOnlyTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/VoidKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/VoidKeywordRecommender.cs
new file mode 100644
index 0000000000..4228baa2ea
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/VoidKeywordRecommender.cs
@@ -0,0 +1,112 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class VoidKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.NewKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.StaticKeyword,
+ SyntaxKind.VirtualKeyword,
+ SyntaxKind.SealedKeyword,
+ SyntaxKind.OverrideKeyword,
+ SyntaxKind.AbstractKeyword,
+ SyntaxKind.ExternKeyword,
+ SyntaxKind.UnsafeKeyword,
+ SyntaxKind.AsyncKeyword
+ };
+
+ public VoidKeywordRecommender()
+ : base(SyntaxKind.VoidKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ IsMemberReturnTypeContext(position, context, cancellationToken) ||
+ context.IsGlobalStatementContext ||
+ context.IsTypeOfExpressionContext ||
+ syntaxTree.IsSizeOfExpressionContext(position, context.LeftToken, cancellationToken) ||
+ context.IsDelegateReturnTypeContext ||
+ IsUnsafeLocalVariableDeclarationContext(context) ||
+ IsUnsafeParameterTypeContext(context) ||
+ IsUnsafeCastTypeContext(context) ||
+ IsUnsafeDefaultExpressionContext(context, cancellationToken) ||
+ context.IsFixedVariableDeclarationContext;
+ }
+
+ private bool IsUnsafeDefaultExpressionContext(CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.TargetToken.IsUnsafeContext() &&
+ context.SyntaxTree.IsDefaultExpressionContext(context.Position, context.LeftToken, cancellationToken);
+ }
+
+ private bool IsUnsafeCastTypeContext(CSharpSyntaxContext context)
+ {
+ if (context.TargetToken.IsUnsafeContext())
+ {
+ if (context.IsDefiniteCastTypeContext)
+ {
+ return true;
+ }
+
+ var token = context.TargetToken;
+
+ if (token.Kind() == SyntaxKind.OpenParenToken &&
+ token.Parent.IsKind(SyntaxKind.ParenthesizedExpression))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private bool IsUnsafeParameterTypeContext(CSharpSyntaxContext context)
+ {
+ return
+ context.TargetToken.IsUnsafeContext() &&
+ context.IsParameterTypeContext;
+ }
+
+ private bool IsUnsafeLocalVariableDeclarationContext(CSharpSyntaxContext context)
+ {
+ if (context.TargetToken.IsUnsafeContext())
+ {
+ return
+ context.IsLocalVariableDeclarationContext ||
+ context.IsStatementContext;
+ }
+
+ return false;
+ }
+
+ private bool IsMemberReturnTypeContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ var syntaxTree = context.SyntaxTree;
+ return
+ syntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: s_validModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: true,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/VolatileKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/VolatileKeywordRecommender.cs
new file mode 100644
index 0000000000..c23381f2a2
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/VolatileKeywordRecommender.cs
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class VolatileKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ private static readonly ISet<SyntaxKind> s_validMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.NewKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.StaticKeyword,
+ };
+
+ public VolatileKeywordRecommender()
+ : base(SyntaxKind.VolatileKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ context.IsGlobalStatementContext ||
+ context.SyntaxTree.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ context.IsMemberDeclarationContext(
+ validModifiers: s_validMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/WarningKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/WarningKeywordRecommender.cs
new file mode 100644
index 0000000000..60cfc7c5c2
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/WarningKeywordRecommender.cs
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class WarningKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public WarningKeywordRecommender()
+ : base(SyntaxKind.WarningKeyword, isValidInPreprocessorContext: true)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ // # warning
+ if (context.IsPreProcessorKeywordContext)
+ {
+ return true;
+ }
+
+ // # pragma |
+ // # pragma w|
+ var previousToken1 = context.TargetToken;
+ var previousToken2 = previousToken1.GetPreviousToken(includeSkipped: true);
+
+ return
+ previousToken1.Kind() == SyntaxKind.PragmaKeyword &&
+ previousToken2.Kind() == SyntaxKind.HashToken;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/WhenKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/WhenKeywordRecommender.cs
new file mode 100644
index 0000000000..bccfe04c80
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/WhenKeywordRecommender.cs
@@ -0,0 +1,21 @@
+//// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+//
+//using System.Threading;
+//using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+//using Microsoft.CodeAnalysis.CSharp;
+//
+//namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+//{
+// internal class WhenKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+// {
+// public WhenKeywordRecommender()
+// : base(SyntaxKind.WhenKeyword, isValidInPreprocessorContext: true)
+// {
+// }
+//
+// protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+// {
+// return context.IsCatchFilterContext;
+// }
+// }
+//}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/WhereKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/WhereKeywordRecommender.cs
new file mode 100644
index 0000000000..e0ba199c16
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/WhereKeywordRecommender.cs
@@ -0,0 +1,142 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class WhereKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public WhereKeywordRecommender()
+ : base(SyntaxKind.WhereKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return
+ IsQueryContext(context) ||
+ IsTypeParameterConstraintContext(context);
+ }
+
+ private bool IsTypeParameterConstraintContext(CSharpSyntaxContext context)
+ {
+ // cases:
+ // class C<T> |
+ // class C<T> : IFoo |
+ // class C<T> where T : IFoo |
+ // delegate void D<T> |
+ // delegate void D<T> where T : IFoo |
+ // void Foo<T>() |
+ // void Foo<T>() where T : IFoo |
+
+ var token = context.TargetToken;
+
+ // class C<T> |
+
+ if (token.Kind() == SyntaxKind.GreaterThanToken)
+ {
+ var typeParameters = token.GetAncestor<TypeParameterListSyntax>();
+ if (typeParameters != null && token == typeParameters.GetLastToken(includeSkipped: true))
+ {
+ var decl = typeParameters.GetAncestorOrThis<TypeDeclarationSyntax>();
+ if (decl != null && decl.TypeParameterList == typeParameters)
+ {
+ return true;
+ }
+ }
+ }
+
+ // delegate void D<T>() |
+ if (token.Kind() == SyntaxKind.CloseParenToken &&
+ token.Parent.IsKind(SyntaxKind.ParameterList) &&
+ token.Parent.IsParentKind(SyntaxKind.DelegateDeclaration))
+ {
+ var decl = token.GetAncestor<DelegateDeclarationSyntax>();
+ if (decl != null && decl.TypeParameterList != null)
+ {
+ return true;
+ }
+ }
+
+ // void Foo<T>() |
+
+ if (token.Kind() == SyntaxKind.CloseParenToken &&
+ token.Parent.IsKind(SyntaxKind.ParameterList) &&
+ token.Parent.IsParentKind(SyntaxKind.MethodDeclaration))
+ {
+ var decl = token.GetAncestor<MethodDeclarationSyntax>();
+ if (decl != null && decl.Arity > 0)
+ {
+ return true;
+ }
+ }
+
+ // class C<T> : IFoo |
+ var baseList = token.GetAncestor<BaseListSyntax>();
+ if (baseList.GetParent() is TypeDeclarationSyntax)
+ {
+ var typeDecl = baseList.GetParent() as TypeDeclarationSyntax;
+ if (typeDecl.TypeParameterList != null &&
+ typeDecl.BaseList.Types.Any(t => token == t.GetLastToken(includeSkipped: true)))
+ {
+ // token is IdentifierName "where"
+ // only suggest "where" if token's previous token is also "where"
+ if (token.Parent is IdentifierNameSyntax && token.HasMatchingText(SyntaxKind.WhereKeyword))
+ {
+ // Check for zero-width tokens in case there is a missing comma in the base list.
+ // For example: class C<T> : Foo where where |
+ return token
+ .GetPreviousToken(includeZeroWidth: true)
+ .IsKindOrHasMatchingText(SyntaxKind.WhereKeyword);
+ }
+
+ // System.|
+ // Not done typing the qualified name
+ if (token.IsKind(SyntaxKind.DotToken))
+ {
+ return false;
+ }
+
+ return true;
+ }
+ }
+
+ // class C<T> where T : IFoo |
+ // delegate void D<T> where T : IFoo |
+ var constraintClause = token.GetAncestor<TypeParameterConstraintClauseSyntax>();
+
+ if (constraintClause != null)
+ {
+ if (constraintClause.Constraints.Any(c => token == c.GetLastToken(includeSkipped: true)))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private static bool IsQueryContext(CSharpSyntaxContext context)
+ {
+ var token = context.TargetToken;
+
+ // var q = from x in y
+ // |
+ if (!token.IntersectsWith(context.Position) &&
+ token.IsLastTokenOfQueryClause())
+ {
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/WhileKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/WhileKeywordRecommender.cs
new file mode 100644
index 0000000000..8185dc4a93
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/WhileKeywordRecommender.cs
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class WhileKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public WhileKeywordRecommender()
+ : base(SyntaxKind.WhileKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ if (context.IsStatementContext ||
+ context.IsGlobalStatementContext)
+ {
+ return true;
+ }
+
+ // do {
+ // } |
+
+ // do {
+ // } w|
+
+ // Note: the case of
+ // do
+ // Foo();
+ // |
+ // is taken care of in the IsStatementContext case.
+
+ var token = context.TargetToken;
+
+ if (token.Kind() == SyntaxKind.CloseBraceToken &&
+ token.Parent.IsKind(SyntaxKind.Block) &&
+ token.Parent.IsParentKind(SyntaxKind.DoStatement))
+ {
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/YieldKeywordRecommender.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/YieldKeywordRecommender.cs
new file mode 100644
index 0000000000..cf875303bd
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Completion/KeywordRecommender/YieldKeywordRecommender.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion.KeywordRecommenders
+{
+ internal class YieldKeywordRecommender : AbstractSyntacticSingleKeywordRecommender
+ {
+ public YieldKeywordRecommender()
+ : base(SyntaxKind.YieldKeyword)
+ {
+ }
+
+ protected override bool IsValidContext(int position, CSharpSyntaxContext context, CancellationToken cancellationToken)
+ {
+ return context.IsStatementContext;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/EncapsulateField/AbstractEncapsulateFieldRefactoringProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/EncapsulateField/AbstractEncapsulateFieldRefactoringProvider.cs
new file mode 100644
index 0000000000..2d25415e66
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/EncapsulateField/AbstractEncapsulateFieldRefactoringProvider.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.CodeRefactorings;
+using ICSharpCode.NRefactory.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.CodeRefactorings.EncapsulateField
+{
+ abstract class AbstractEncapsulateFieldRefactoringProvider : CodeRefactoringProvider
+ {
+ CSharpEncapsulateFieldService service = new CSharpEncapsulateFieldService ();
+
+ public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
+ {
+ var actions = await service.GetEncapsulateFieldCodeActionsAsync(context.Document, context.Span, context.CancellationToken).ConfigureAwait(false);
+
+ context.RegisterRefactorings(actions);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/EncapsulateField/AbstractEncapsulateFieldService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/EncapsulateField/AbstractEncapsulateFieldService.cs
new file mode 100644
index 0000000000..48dd1db1d3
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/EncapsulateField/AbstractEncapsulateFieldService.cs
@@ -0,0 +1,426 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.Editing;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis.Rename;
+using Microsoft.CodeAnalysis.Rename.ConflictEngine;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Simplification;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp.CodeGeneration;
+using System.Globalization;
+using System.Reflection;
+using Microsoft.CodeAnalysis.Options;
+
+namespace ICSharpCode.NRefactory6.CSharp.CodeRefactorings.EncapsulateField
+{
+ internal abstract class AbstractEncapsulateFieldService : ILanguageService
+ {
+ static AbstractEncapsulateFieldService()
+ {
+ renameSymbolMethod = typeof (Renamer).GetMethod ("RenameSymbolAsync", BindingFlags.Static | BindingFlags.NonPublic, null, new Type [] { typeof(Solution), typeof(ISymbol), typeof(string), typeof(OptionSet), typeof(Func<Location, bool>), typeof(Func<IEnumerable<ISymbol>, bool?>), typeof(CancellationToken) }, null);
+ if (renameSymbolMethod == null)
+ throw new Exception ("Can't find RenameSymbolAsync method.");
+ }
+
+ public async Task<EncapsulateFieldResult> EncapsulateFieldAsync(Document document, TextSpan span, bool useDefaultBehavior, CancellationToken cancellationToken)
+ {
+ var fields = await GetFieldsAsync(document, span, cancellationToken).ConfigureAwait(false);
+ if (fields == null || !fields.Any())
+ {
+ return null;
+ }
+
+ return new EncapsulateFieldResult(c => EncapsulateFieldResultAsync(document, span, useDefaultBehavior, c));
+ }
+
+ public async Task<IEnumerable<EncapsulateFieldCodeAction>> GetEncapsulateFieldCodeActionsAsync(Document document, TextSpan span, CancellationToken cancellationToken)
+ {
+ var fields = (await GetFieldsAsync(document, span, cancellationToken).ConfigureAwait(false)).ToImmutableArrayOrEmpty();
+ if (fields.Length == 0)
+ {
+ return SpecializedCollections.EmptyEnumerable<EncapsulateFieldCodeAction>();
+ }
+
+ if (fields.Length == 1)
+ {
+ // there is only one field
+ return EncapsulateOneField(document, span, fields[0], index: 0);
+ }
+ else
+ {
+ // there are multiple fields.
+ var current = SpecializedCollections.EmptyEnumerable<EncapsulateFieldCodeAction>();
+
+ if (span.IsEmpty)
+ {
+ // if there is no selection, get action for each field + all of them.
+ for (var i = 0; i < fields.Length; i++)
+ {
+ current = current.Concat(EncapsulateOneField(document, span, fields[i], i));
+ }
+ }
+
+ return current.Concat(EncapsulateAllFields(document, span));
+ }
+ }
+
+ private IEnumerable<EncapsulateFieldCodeAction> EncapsulateAllFields(Document document, TextSpan span)
+ {
+ var action1Text = Resources.EncapsulateFieldsUsages;
+ var action2Text = Resources.EncapsulateFields;
+
+ return new[]
+ {
+ new EncapsulateFieldCodeAction(new EncapsulateFieldResult(c => EncapsulateFieldResultAsync(document, span, true, c)), action1Text),
+ new EncapsulateFieldCodeAction(new EncapsulateFieldResult(c => EncapsulateFieldResultAsync(document, span, false, c)), action2Text)
+ };
+ }
+
+ private IEnumerable<EncapsulateFieldCodeAction> EncapsulateOneField(Document document, TextSpan span, IFieldSymbol field, int index)
+ {
+ var action1Text = string.Format(Resources.EncapsulateFieldUsages, field.Name);
+ var action2Text = string.Format(Resources.EncapsulateField, field.Name);
+
+ return new[]
+ {
+ new EncapsulateFieldCodeAction(new EncapsulateFieldResult(c => SingleEncapsulateFieldResultAsync(document, span, index, true, c)), action1Text),
+ new EncapsulateFieldCodeAction(new EncapsulateFieldResult(c => SingleEncapsulateFieldResultAsync(document, span, index, false, c)), action2Text)
+ };
+ }
+
+ private async Task<Result> SingleEncapsulateFieldResultAsync(Document document, TextSpan span, int index, bool updateReferences, CancellationToken cancellationToken)
+ {
+ var fields = (await GetFieldsAsync(document, span, cancellationToken).ConfigureAwait(false)).ToImmutableArrayOrEmpty();
+ //Contract.Requires(fields.Length > index);
+
+ var field = fields[index];
+ var result = await EncapsulateFieldAsync(field, document, updateReferences, cancellationToken).ConfigureAwait(false);
+ if (result == null)
+ {
+ return new Result(document.Project.Solution, field);
+ }
+
+ return result;
+ }
+
+ private async Task<Result> EncapsulateFieldResultAsync(Document document, TextSpan span, bool updateReferences, CancellationToken cancellationToken)
+ {
+ // probably later we want to add field and reason why it failed.
+ var failedFieldSymbols = new List<IFieldSymbol>();
+
+ var fields = await GetFieldsAsync(document, span, cancellationToken).ConfigureAwait(false);
+ //Contract.Requires(fields.Any());
+
+ // For now, build up the multiple field case by encapsulating one at a time.
+ Result result = null;
+ foreach (var field in fields)
+ {
+ var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ var compilation = semanticModel.Compilation;
+ var currentField = field.GetSymbolKey().Resolve(compilation, cancellationToken: cancellationToken).Symbol as IFieldSymbol;
+
+ // We couldn't resolve this field. skip it
+ if (currentField == null)
+ {
+ failedFieldSymbols.Add(field);
+ continue;
+ }
+
+ result = await EncapsulateFieldAsync(currentField, document, updateReferences, cancellationToken).ConfigureAwait(false);
+ if (result == null)
+ {
+ failedFieldSymbols.Add(field);
+ continue;
+ }
+
+ document = result.Solution.GetDocument(document.Id);
+ }
+
+ if (result == null)
+ {
+ return new Result(document.Project.Solution, fields.ToArray());
+ }
+
+ // add failed field symbol info
+ return result.WithFailedFields(failedFieldSymbols);
+ }
+
+ private async Task<Result> EncapsulateFieldAsync(IFieldSymbol field, Document document, bool updateReferences, CancellationToken cancellationToken)
+ {
+ var originalField = field;
+ var finalNames = GeneratePropertyAndFieldNames(field);
+ var finalFieldName = finalNames.Item1;
+ var generatedPropertyName = finalNames.Item2;
+
+ // Annotate the field declarations so we can find it after rename.
+ var fieldDeclaration = field.DeclaringSyntaxReferences.First();
+ var declarationAnnotation = new SyntaxAnnotation();
+ document = document.WithSyntaxRoot(fieldDeclaration.SyntaxTree.GetRoot(cancellationToken).ReplaceNode(fieldDeclaration.GetSyntax(cancellationToken),
+ fieldDeclaration.GetSyntax(cancellationToken).WithAdditionalAnnotations(declarationAnnotation)));
+
+ var solution = document.Project.Solution;
+
+ foreach (var linkedDocumentId in document.GetLinkedDocumentIds())
+ {
+ var linkedDocument = solution.GetDocument(linkedDocumentId);
+ var linkedRoot = await linkedDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ var linkedFieldNode = linkedRoot.FindNode(fieldDeclaration.Span);
+ if (linkedFieldNode.Span != fieldDeclaration.Span)
+ {
+ continue;
+ }
+
+ var updatedRoot = linkedRoot.ReplaceNode(linkedFieldNode, linkedFieldNode.WithAdditionalAnnotations(declarationAnnotation));
+ solution = solution.WithDocumentSyntaxRoot(linkedDocumentId, updatedRoot);
+ }
+
+ document = solution.GetDocument(document.Id);
+
+ // Resolve the annotated symbol and prepare for rename.
+
+ var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ var compilation = semanticModel.Compilation;
+ field = field.GetSymbolKey().Resolve(compilation, cancellationToken: cancellationToken).Symbol as IFieldSymbol;
+
+ var solutionNeedingProperty = solution;
+
+ // We couldn't resolve field after annotating its declaration. Bail
+ if (field == null)
+ {
+ return null;
+ }
+
+ solutionNeedingProperty = await UpdateReferencesAsync(
+ updateReferences, solution, document, field, finalFieldName, generatedPropertyName, cancellationToken).ConfigureAwait(false);
+ document = solutionNeedingProperty.GetDocument(document.Id);
+
+ var markFieldPrivate = field.DeclaredAccessibility != Accessibility.Private;
+ var rewrittenFieldDeclaration = await RewriteFieldNameAndAccessibility(finalFieldName, markFieldPrivate, document, declarationAnnotation, cancellationToken).ConfigureAwait(false);
+
+ document = await Formatter.FormatAsync(document.WithSyntaxRoot(rewrittenFieldDeclaration), Formatter.Annotation, cancellationToken: cancellationToken).ConfigureAwait(false);
+
+ solution = document.Project.Solution;
+ foreach (var linkedDocumentId in document.GetLinkedDocumentIds())
+ {
+ var linkedDocument = solution.GetDocument(linkedDocumentId);
+ var updatedLinkedRoot = await RewriteFieldNameAndAccessibility(finalFieldName, markFieldPrivate, linkedDocument, declarationAnnotation, cancellationToken).ConfigureAwait(false);
+ var updatedLinkedDocument = await Formatter.FormatAsync(linkedDocument.WithSyntaxRoot(updatedLinkedRoot), Formatter.Annotation, cancellationToken: cancellationToken).ConfigureAwait(false);
+ solution = updatedLinkedDocument.Project.Solution;
+ }
+
+ document = solution.GetDocument(document.Id);
+
+ semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ compilation = semanticModel.Compilation;
+
+ var newRoot = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ var newDeclaration = newRoot.GetAnnotatedNodes<SyntaxNode>(declarationAnnotation).First();
+ field = semanticModel.GetDeclaredSymbol(newDeclaration, cancellationToken) as IFieldSymbol;
+
+ var generatedProperty = GenerateProperty(generatedPropertyName, finalFieldName, originalField.DeclaredAccessibility, originalField, field.ContainingType, new SyntaxAnnotation(), document, cancellationToken);
+
+ var solutionWithProperty = await AddPropertyAsync(document, document.Project.Solution, field, generatedProperty, cancellationToken).ConfigureAwait(false);
+
+ return new Result(solutionWithProperty, originalField.ToDisplayString(), Glyph.FieldPublic);
+ }
+
+ static Task<Solution> RenameSymbolAsync (Solution solution, ISymbol symbol, string newName, OptionSet options, Func<Location, bool> filter, Func<IEnumerable<ISymbol>, bool?> hasConflict = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return (Task<Solution>)renameSymbolMethod.Invoke (null, new object [] { solution, symbol, newName, options, filter, hasConflict, cancellationToken });
+ }
+
+ private async Task<Solution> UpdateReferencesAsync(
+ bool updateReferences, Solution solution, Document document, IFieldSymbol field, string finalFieldName, string generatedPropertyName, CancellationToken cancellationToken)
+ {
+ if (!updateReferences)
+ {
+ return solution;
+ }
+
+ if (field.IsReadOnly)
+ {
+ // Inside the constructor we want to rename references the field to the final field name.
+ var constructorSyntaxes = GetConstructorNodes(field.ContainingType).ToSet();
+ if (finalFieldName != field.Name && constructorSyntaxes.Count > 0)
+ {
+ solution = await RenameSymbolAsync(solution, field, finalFieldName, solution.Workspace.Options,
+ location => constructorSyntaxes.Any(c => c.Span.IntersectsWith(location.SourceSpan)), cancellationToken: cancellationToken).ConfigureAwait(false);
+ document = solution.GetDocument(document.Id);
+
+ var compilation = await document.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
+
+ field = field.GetSymbolKey().Resolve(compilation, cancellationToken: cancellationToken).Symbol as IFieldSymbol;
+ }
+
+ // Outside the constructor we want to rename references to the field to final property name.
+ return await RenameSymbolAsync(solution, field, generatedPropertyName, solution.Workspace.Options,
+ location => !constructorSyntaxes.Any(c => c.Span.IntersectsWith(location.SourceSpan)), cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+ else
+ {
+ // Just rename everything.
+ return await Renamer.RenameSymbolAsync(solution, field, generatedPropertyName, solution.Workspace.Options, cancellationToken).ConfigureAwait(false);
+ }
+ }
+
+ internal abstract IEnumerable<SyntaxNode> GetConstructorNodes(INamedTypeSymbol containingType);
+
+ protected async Task<Solution> AddPropertyAsync(Document document, Solution destinationSolution, IFieldSymbol field, IPropertySymbol property, CancellationToken cancellationToken)
+ {
+ var codeGenerationService = new CSharpCodeGenerationService (document.Project.Solution.Workspace);
+
+ var fieldDeclaration = field.DeclaringSyntaxReferences.First();
+ var options = new CodeGenerationOptions(contextLocation: fieldDeclaration.SyntaxTree.GetLocation(fieldDeclaration.Span));
+
+ var destination = field.ContainingType;
+ var updatedDocument = await codeGenerationService.AddPropertyAsync(destinationSolution, destination, property, options, cancellationToken)
+ .ConfigureAwait(false);
+
+ updatedDocument = await Formatter.FormatAsync(updatedDocument, Formatter.Annotation, cancellationToken: cancellationToken).ConfigureAwait(false);
+ updatedDocument = await Simplifier.ReduceAsync(updatedDocument, cancellationToken: cancellationToken).ConfigureAwait(false);
+
+ return updatedDocument.Project.Solution;
+ }
+
+ protected IPropertySymbol GenerateProperty(string propertyName, string fieldName, Accessibility accessibility, IFieldSymbol field, INamedTypeSymbol containingSymbol, SyntaxAnnotation annotation, Document document, CancellationToken cancellationToken)
+ {
+ var factory = document.GetLanguageService<SyntaxGenerator>();
+
+ var propertySymbol = annotation.AddAnnotationToSymbol(CodeGenerationSymbolFactory.CreatePropertySymbol(containingType: containingSymbol,
+ attributes: SpecializedCollections.EmptyList<AttributeData>(),
+ accessibility: ComputeAccessibility(accessibility, field.Type),
+ modifiers: new DeclarationModifiers().WithIsStatic (field.IsStatic).WithIsReadOnly (field.IsReadOnly).WithIsUnsafe (field.IsUnsafe()),
+ type: field.Type,
+ explicitInterfaceSymbol: null,
+ name: propertyName,
+ parameters: SpecializedCollections.EmptyList<IParameterSymbol>(),
+ getMethod: CreateGet(fieldName, field, factory),
+ setMethod: field.IsReadOnly || field.IsConst ? null : CreateSet(fieldName, field, factory)));
+
+ return Simplifier.Annotation.AddAnnotationToSymbol(
+ Formatter.Annotation.AddAnnotationToSymbol(propertySymbol));
+ }
+
+ protected abstract Tuple<string, string> GeneratePropertyAndFieldNames(IFieldSymbol field);
+
+ protected Accessibility ComputeAccessibility(Accessibility accessibility, ITypeSymbol type)
+ {
+ var computedAccessibility = accessibility;
+ if (accessibility == Accessibility.NotApplicable || accessibility == Accessibility.Private)
+ {
+ computedAccessibility = Accessibility.Public;
+ }
+
+ var returnTypeAccessibility = type.DetermineMinimalAccessibility();
+
+ return AccessibilityUtilities.Minimum(computedAccessibility, returnTypeAccessibility);
+ }
+
+ protected IMethodSymbol CreateSet(string originalFieldName, IFieldSymbol field, SyntaxGenerator factory)
+ {
+ var assigned = !field.IsStatic
+ ? factory.MemberAccessExpression(
+ factory.ThisExpression(),
+ factory.IdentifierName(originalFieldName))
+ : factory.IdentifierName(originalFieldName);
+
+ var body = factory.ExpressionStatement(
+ factory.AssignmentStatement(
+ assigned.WithAdditionalAnnotations(Simplifier.Annotation),
+ factory.IdentifierName("value")));
+
+ return CodeGenerationSymbolFactory.CreateAccessorSymbol(SpecializedCollections.EmptyList<AttributeData>(),
+ Accessibility.NotApplicable,
+ new[] { body }.ToList());
+ }
+
+ protected IMethodSymbol CreateGet(string originalFieldName, IFieldSymbol field, SyntaxGenerator factory)
+ {
+ var body = factory.ReturnStatement(
+ factory.IdentifierName(originalFieldName));
+
+ return CodeGenerationSymbolFactory.CreateAccessorSymbol(SpecializedCollections.EmptyList<AttributeData>(),
+ Accessibility.NotApplicable,
+ new[] { body }.ToList());
+ }
+
+ private static readonly char[] s_underscoreCharArray = new[] { '_' };
+
+ protected string GeneratePropertyName(string fieldName)
+ {
+ // Trim leading underscores
+ var baseName = fieldName.TrimStart(s_underscoreCharArray);
+
+ // Trim leading "m_"
+ if (baseName.Length >= 2 && baseName[0] == 'm' && baseName[1] == '_')
+ {
+ baseName = baseName.Substring(2);
+ }
+
+ // Take original name if no characters left
+ if (baseName.Length == 0)
+ {
+ baseName = fieldName;
+ }
+
+ // Make the first character upper case using the "en-US" culture. See discussion at
+ // https://github.com/dotnet/roslyn/issues/5524.
+ var firstCharacter = EnUSCultureInfo.TextInfo.ToUpper(baseName[0]);
+ return firstCharacter.ToString() + baseName.Substring(1);
+ }
+
+ internal static readonly CultureInfo EnUSCultureInfo = new CultureInfo("en-US");
+ static MethodInfo renameSymbolMethod;
+
+ protected abstract Task<SyntaxNode> RewriteFieldNameAndAccessibility(string originalFieldName, bool makePrivate, Document document, SyntaxAnnotation declarationAnnotation, CancellationToken cancellationToken);
+ protected abstract Task<IEnumerable<IFieldSymbol>> GetFieldsAsync(Document document, TextSpan span, CancellationToken cancellationToken);
+
+ internal class Result
+ {
+ public Result(Solution solutionWithProperty, string name, Glyph glyph)
+ {
+ this.Solution = solutionWithProperty;
+ this.Name = name;
+ this.Glyph = glyph;
+ }
+
+ public Result(Solution solutionWithProperty, string name, Glyph glyph, List<IFieldSymbol> failedFieldSymbols) :
+ this(solutionWithProperty, name, glyph)
+ {
+ this.FailedFields = failedFieldSymbols.ToImmutableArrayOrEmpty();
+ }
+
+ public Result(Solution originalSolution, params IFieldSymbol[] fields) :
+ this(originalSolution, string.Empty, Glyph.Error)
+ {
+ this.FailedFields = fields.ToImmutableArrayOrEmpty();
+ }
+
+ public Solution Solution { get; }
+ public string Name { get; }
+ public Glyph Glyph { get; }
+ public ImmutableArray<IFieldSymbol> FailedFields { get; }
+
+ public Result WithFailedFields(List<IFieldSymbol> failedFieldSymbols)
+ {
+ if (failedFieldSymbols.Count == 0)
+ {
+ return this;
+ }
+
+ return new Result(Solution, Name, Glyph, failedFieldSymbols);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/EncapsulateField/CSharpEncapsulateFieldService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/EncapsulateField/CSharpEncapsulateFieldService.cs
new file mode 100644
index 0000000000..7d11fd3d2c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/EncapsulateField/CSharpEncapsulateFieldService.cs
@@ -0,0 +1,193 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Composition;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Editing;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using System.Collections.Immutable;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp.CodeGeneration;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.CodeRefactorings.EncapsulateField
+{
+ internal class CSharpEncapsulateFieldService : AbstractEncapsulateFieldService
+ {
+ protected async override Task<SyntaxNode> RewriteFieldNameAndAccessibility(string originalFieldName, bool makePrivate, Document document, SyntaxAnnotation declarationAnnotation, CancellationToken cancellationToken)
+ {
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+
+ var declarator = root.GetAnnotatedNodes<VariableDeclaratorSyntax>(declarationAnnotation).FirstOrDefault();
+
+ // There may be no field to rewrite if this document is part of a set of linked files
+ // and the declaration is not conditionally compiled in this document's project.
+ if (declarator == null)
+ {
+ return root;
+ }
+
+ var tempAnnotation = new SyntaxAnnotation();
+ var newIdentifier = SyntaxFactory.Identifier(originalFieldName)
+ .WithTrailingTrivia(declarator.Identifier.TrailingTrivia)
+ .WithLeadingTrivia(declarator.Identifier.LeadingTrivia);
+
+ var updatedDeclarator = declarator.WithIdentifier(newIdentifier).WithAdditionalAnnotations(tempAnnotation);
+
+ root = root.ReplaceNode(declarator, updatedDeclarator);
+ document = document.WithSyntaxRoot(root);
+
+ var declaration = root.GetAnnotatedNodes<SyntaxNode>(tempAnnotation).First().Parent as VariableDeclarationSyntax;
+
+ if (declaration.Variables.Count == 1)
+ {
+ var fieldSyntax = declaration.Parent as FieldDeclarationSyntax;
+
+ var modifierKinds = new[] { SyntaxKind.PrivateKeyword, SyntaxKind.ProtectedKeyword, SyntaxKind.InternalKeyword, SyntaxKind.PublicKeyword };
+
+ if (makePrivate)
+ {
+ var modifiers = SpecializedCollections.SingletonEnumerable(SyntaxFactory.Token(SyntaxKind.PrivateKeyword))
+ .Concat(fieldSyntax.Modifiers.Where(m => !modifierKinds.Contains(m.Kind())));
+
+ root = root.ReplaceNode(fieldSyntax, fieldSyntax.WithModifiers(
+ SyntaxFactory.TokenList(modifiers))
+ .WithAdditionalAnnotations(Formatter.Annotation)
+ .WithLeadingTrivia(fieldSyntax.GetLeadingTrivia())
+ .WithTrailingTrivia(fieldSyntax.GetTrailingTrivia()));
+ }
+ }
+ else if (declaration.Variables.Count > 1 && makePrivate)
+ {
+ document = document.WithSyntaxRoot(root);
+ var codeGenService = new CSharpCodeGenerationService (document.Project.Solution.Workspace.Services.GetLanguageServices (LanguageNames.CSharp));
+ var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+
+ root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+
+ declarator = root.GetAnnotatedNodes<VariableDeclaratorSyntax>(tempAnnotation).First();
+ declaration = declarator.Parent as VariableDeclarationSyntax;
+
+ var field = semanticModel.GetDeclaredSymbol(declarator, cancellationToken) as IFieldSymbol;
+
+ var fieldToAdd = declarationAnnotation.AddAnnotationToSymbol(CodeGenerationSymbolFactory.CreateFieldSymbol(
+ field.GetAttributes(),
+ Accessibility.Private,
+ new DeclarationModifiers().WithIsStatic (field.IsStatic).WithIsReadOnly(field.IsReadOnly).WithIsConst(field.IsConst),
+ field.Type,
+ field.Name,
+ field.HasConstantValue,
+ field.ConstantValue,
+ declarator.Initializer));
+
+ var withField = await codeGenService.AddFieldAsync(document.Project.Solution, field.ContainingType, fieldToAdd, new CodeGenerationOptions(), cancellationToken).ConfigureAwait(false);
+ root = await withField.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+
+ declarator = root.GetAnnotatedNodes<VariableDeclaratorSyntax>(tempAnnotation).First();
+ declaration = declarator.Parent as VariableDeclarationSyntax;
+
+ return root.RemoveNode(declarator, SyntaxRemoveOptions.KeepNoTrivia);
+ }
+
+ return root;
+ }
+
+ protected override async Task<IEnumerable<IFieldSymbol>> GetFieldsAsync(Document document, TextSpan span, CancellationToken cancellationToken)
+ {
+ var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+
+ var fields = root.DescendantNodes(d => d.Span.IntersectsWith(span))
+ .OfType<FieldDeclarationSyntax>()
+ .Where(n => n.Span.IntersectsWith(span));
+
+ var declarations = fields.Where(CanEncapsulate).Select(f => f.Declaration);
+
+ IEnumerable<VariableDeclaratorSyntax> declarators;
+ if (span.IsEmpty)
+ {
+ // no selection, get all variables
+ declarators = declarations.SelectMany(d => d.Variables);
+ }
+ else
+ {
+ // has selection, get only the ones that are included in the selection
+ declarators = declarations.SelectMany(d => d.Variables.Where(v => v.Span.IntersectsWith(span)));
+ }
+
+ return declarators.Select(d => semanticModel.GetDeclaredSymbol(d, cancellationToken) as IFieldSymbol)
+ .WhereNotNull()
+ .Where(f => f.Name.Length != 0);
+ }
+
+ private bool CanEncapsulate(FieldDeclarationSyntax field)
+ {
+ return field.Parent is TypeDeclarationSyntax;
+ }
+
+ protected override Tuple<string, string> GeneratePropertyAndFieldNames(IFieldSymbol field)
+ {
+ // Special case: if the field is "new", we will preserve its original name and the new keyword.
+ if (field.DeclaredAccessibility == Accessibility.Private || IsNew(field))
+ {
+ // Create some capitalized version of the field name for the property
+ return Tuple.Create(field.Name, MakeUnique(GeneratePropertyName(field.Name), field.ContainingType));
+ }
+ else
+ {
+ // Generate the new property name using the rules from 695042
+ var newPropertyName = GeneratePropertyName(field.Name);
+
+ if (newPropertyName == field.Name)
+ {
+ // If we wind up with the field's old name, give the field the unique version of its current name.
+ return Tuple.Create(MakeUnique(GenerateFieldName(field, field.Name), field.ContainingType), newPropertyName);
+ }
+
+ // Otherwise, ensure the property's name is unique.
+ newPropertyName = MakeUnique(newPropertyName, field.ContainingType);
+ var newFieldName = GenerateFieldName(field, newPropertyName);
+
+ // If converting the new property's name into a field name results in the old field name, we're done.
+ if (newFieldName == field.Name)
+ {
+ return Tuple.Create(newFieldName, newPropertyName);
+ }
+
+ // Otherwise, ensure the new field name is unique.
+ return Tuple.Create(MakeUnique(newFieldName, field.ContainingType), newPropertyName);
+ }
+ }
+
+ private bool IsNew(IFieldSymbol field)
+ {
+ return field.DeclaringSyntaxReferences.Any(d => d.GetSyntax().GetAncestor<FieldDeclarationSyntax>().Modifiers.Any(SyntaxKind.NewKeyword));
+ }
+
+ private string GenerateFieldName(IFieldSymbol field, string correspondingPropertyName)
+ {
+ return char.ToLower(correspondingPropertyName[0]).ToString() + correspondingPropertyName.Substring(1);
+ }
+
+ protected string MakeUnique(string baseName, INamedTypeSymbol containingType, bool considerBaseMembers = true)
+ {
+ var containingTypeMemberNames = containingType.GetAccessibleMembersInThisAndBaseTypes<ISymbol>(containingType).Select(m => m.Name);
+ return NameGenerator.GenerateUniqueName(baseName, containingTypeMemberNames.ToSet(), StringComparer.Ordinal);
+ }
+
+ internal override IEnumerable<SyntaxNode> GetConstructorNodes(INamedTypeSymbol containingType)
+ {
+ return containingType.Constructors.SelectMany(c => c.DeclaringSyntaxReferences.Select(d => d.GetSyntax()));
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/EncapsulateField/EncapsulateFieldCodeAction.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/EncapsulateField/EncapsulateFieldCodeAction.cs
new file mode 100644
index 0000000000..84c0c5123e
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/EncapsulateField/EncapsulateFieldCodeAction.cs
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.CodeRefactorings.EncapsulateField
+{
+ class EncapsulateFieldCodeAction : CodeAction
+ {
+ private EncapsulateFieldResult _result;
+ private string _title;
+
+ public EncapsulateFieldCodeAction(EncapsulateFieldResult result, string title)
+ {
+ _result = result;
+ _title = title;
+ }
+
+ public override string Title
+ {
+ get { return _title; }
+ }
+
+ protected override Task<Solution> GetChangedSolutionAsync(CancellationToken cancellationToken)
+ {
+ return _result.GetSolutionAsync(cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/EncapsulateField/EncapsulateFieldResult.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/EncapsulateField/EncapsulateFieldResult.cs
new file mode 100644
index 0000000000..dac9827496
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/EncapsulateField/EncapsulateFieldResult.cs
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.CodeRefactorings.EncapsulateField
+{
+ class EncapsulateFieldResult
+ {
+ private readonly Func<CancellationToken, Task<AbstractEncapsulateFieldService.Result>> _resultGetter;
+
+ public EncapsulateFieldResult(Func<CancellationToken, Task<AbstractEncapsulateFieldService.Result>> resultGetter)
+ {
+ _resultGetter = resultGetter;
+ }
+
+ public async Task<string> GetNameAsync(CancellationToken cancellationToken)
+ {
+ var result = await _resultGetter(cancellationToken).ConfigureAwait(false);
+ return result.Name;
+ }
+
+ public async Task<Glyph> GetGlyphAsync(CancellationToken cancellationToken)
+ {
+ var result = await _resultGetter(cancellationToken).ConfigureAwait(false);
+ return result.Glyph;
+ }
+
+ public async Task<Solution> GetSolutionAsync(CancellationToken cancellationToken)
+ {
+ var result = await _resultGetter(cancellationToken).ConfigureAwait(false);
+ return result.Solution;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/AbstractExtractMethodService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/AbstractExtractMethodService.cs
new file mode 100644
index 0000000000..dafbe228da
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/AbstractExtractMethodService.cs
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ abstract class AbstractExtractMethodService<TValidator, TExtractor, TResult> : IExtractMethodService
+ where TValidator : SelectionValidator
+ where TExtractor : MethodExtractor
+ where TResult : SelectionResult
+ {
+ protected abstract TValidator CreateSelectionValidator(SemanticDocument document, TextSpan textSpan, OptionSet options);
+ protected abstract TExtractor CreateMethodExtractor(TResult selectionResult);
+
+ public async Task<ExtractMethodResult> ExtractMethodAsync(
+ Document document,
+ TextSpan textSpan,
+ OptionSet options,
+ CancellationToken cancellationToken)
+ {
+ options = options ?? document.Project.Solution.Workspace.Options;
+
+ var semanticDocument = await SemanticDocument.CreateAsync(document, cancellationToken).ConfigureAwait(false);
+
+ var validator = this.CreateSelectionValidator(semanticDocument, textSpan, options);
+
+ var selectionResult = await validator.GetValidSelectionAsync(cancellationToken).ConfigureAwait(false);
+ if (!selectionResult.ContainsValidContext)
+ {
+ return new FailedExtractMethodResult(selectionResult.Status);
+ }
+
+ cancellationToken.ThrowIfCancellationRequested();
+
+ // extract method
+ var extractor = this.CreateMethodExtractor((TResult)selectionResult);
+
+ return await extractor.ExtractMethodAsync(cancellationToken).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/AbstractSyntaxTriviaService.Result.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/AbstractSyntaxTriviaService.Result.cs
new file mode 100644
index 0000000000..e15e7edff1
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/AbstractSyntaxTriviaService.Result.cs
@@ -0,0 +1,296 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Roslyn.Utilities;
+using ICSharpCode.NRefactory6.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ abstract partial class AbstractSyntaxTriviaService
+ {
+ private class Result : ITriviaSavedResult
+ {
+ private static readonly AnnotationResolver s_defaultAnnotationResolver = ResolveAnnotation;
+ private static readonly TriviaResolver s_defaultTriviaResolver = ResolveTrivia;
+
+ private readonly SyntaxNode _root;
+ private readonly int _endOfLineKind;
+
+ private readonly Dictionary<TriviaLocation, SyntaxAnnotation> _annotations;
+ private readonly Dictionary<TriviaLocation, IEnumerable<SyntaxTrivia>> _triviaList;
+
+ public Result(
+ SyntaxNode root,
+ int endOfLineKind,
+ Dictionary<TriviaLocation, SyntaxAnnotation> annotations,
+ Dictionary<TriviaLocation, IEnumerable<SyntaxTrivia>> triviaList)
+ {
+ //Contract.ThrowIfNull(root);
+ //Contract.ThrowIfNull(annotations);
+ //Contract.ThrowIfNull(triviaList);
+
+ _root = root;
+ _endOfLineKind = endOfLineKind;
+
+ _annotations = annotations;
+ _triviaList = triviaList;
+ }
+
+ public SyntaxNode Root
+ {
+ get { return _root; }
+ }
+
+ public SyntaxNode RestoreTrivia(
+ SyntaxNode root,
+ AnnotationResolver annotationResolver = null,
+ TriviaResolver triviaResolver = null)
+ {
+ var tokens = RecoverTokensAtEdges(root, annotationResolver);
+ var map = CreateOldToNewTokensMap(tokens, triviaResolver);
+
+ return root.ReplaceTokens(map.Keys, (o, n) => map[o]);
+ }
+
+ private Dictionary<SyntaxToken, SyntaxToken> CreateOldToNewTokensMap(
+ Dictionary<TriviaLocation, PreviousNextTokenPair> tokenPairs,
+ Dictionary<TriviaLocation, LeadingTrailingTriviaPair> triviaPairs)
+ {
+ var map = new Dictionary<SyntaxToken, SyntaxToken>();
+ foreach (var pair in CreateUniqueTokenTriviaPairs(tokenPairs, triviaPairs))
+ {
+ var localCopy = pair;
+ var previousToken = map.GetOrAdd(localCopy.Item1.PreviousToken, _ => localCopy.Item1.PreviousToken);
+ map[localCopy.Item1.PreviousToken] = previousToken.WithTrailingTrivia(localCopy.Item2.TrailingTrivia);
+
+ var nextToken = map.GetOrAdd(localCopy.Item1.NextToken, _ => localCopy.Item1.NextToken);
+ map[localCopy.Item1.NextToken] = nextToken.WithLeadingTrivia(localCopy.Item2.LeadingTrivia);
+ }
+
+ return map;
+ }
+
+ private LeadingTrailingTriviaPair GetTrailingAndLeadingTrivia(TriviaLocation locationKind, PreviousNextTokenPair tokenPair, IEnumerable<SyntaxTrivia> trivia)
+ {
+ var list = trivia.ToList();
+
+ // there are some noisy trivia
+ var index = GetFirstEndOfLineIndex(list);
+
+ return new LeadingTrailingTriviaPair
+ {
+ TrailingTrivia = CreateTriviaListFromTo(list, 0, index),
+ LeadingTrivia = CreateTriviaListFromTo(list, index + 1, list.Count - 1)
+ };
+ }
+
+ private int GetFirstEndOfLineIndex(List<SyntaxTrivia> list)
+ {
+ for (int i = 0; i < list.Count; i++)
+ {
+ if (list[i].RawKind == _endOfLineKind)
+ {
+ return i;
+ }
+ }
+
+ return list.Count - 1;
+ }
+
+ private Dictionary<TriviaLocation, SyntaxToken> RecoverTokensAtEdges(
+ SyntaxNode root,
+ AnnotationResolver annotationResolver)
+ {
+ var resolver = annotationResolver ?? s_defaultAnnotationResolver;
+
+ var tokens = Enumerable.Range((int)TriviaLocation.BeforeBeginningOfSpan, TriviaLocationsCount)
+ .Cast<TriviaLocation>()
+ .ToDictionary(
+ location => location,
+ location => resolver(root, location, _annotations[location]));
+
+ // check variable assumption. ordering of two pairs can't be changed
+ //Contract.ThrowIfFalse(
+ // (tokens[TriviaLocation.BeforeBeginningOfSpan].RawKind == 0 && tokens[TriviaLocation.AfterEndOfSpan].RawKind == 0) ||
+ // (tokens[TriviaLocation.BeforeBeginningOfSpan].RawKind == 0 /* && don't care */) ||
+ // (/* don't care && */ tokens[TriviaLocation.AfterEndOfSpan].RawKind == 0) ||
+ // (tokens[TriviaLocation.BeforeBeginningOfSpan].Span.End <= tokens[TriviaLocation.AfterEndOfSpan].SpanStart));
+
+ //Contract.ThrowIfFalse(
+ // (tokens[TriviaLocation.AfterBeginningOfSpan].RawKind == 0 && tokens[TriviaLocation.BeforeEndOfSpan].RawKind == 0) ||
+ // (tokens[TriviaLocation.AfterBeginningOfSpan].RawKind == 0 /* && don't care */) ||
+ // (/* don't care && */ tokens[TriviaLocation.BeforeEndOfSpan].RawKind == 0) ||
+ // (tokens[TriviaLocation.AfterBeginningOfSpan] == tokens[TriviaLocation.BeforeEndOfSpan]) ||
+ // (tokens[TriviaLocation.AfterBeginningOfSpan].GetPreviousToken(includeZeroWidth: true) == tokens[TriviaLocation.BeforeEndOfSpan]) ||
+ // (tokens[TriviaLocation.AfterBeginningOfSpan].Span.End <= tokens[TriviaLocation.BeforeEndOfSpan].SpanStart));
+
+ return tokens;
+ }
+
+ private Dictionary<SyntaxToken, SyntaxToken> CreateOldToNewTokensMap(
+ Dictionary<TriviaLocation, SyntaxToken> tokens,
+ TriviaResolver triviaResolver)
+ {
+ var tokenPairs = CreatePreviousNextTokenPairs(tokens);
+ var tokenToLeadingTrailingTriviaMap = CreateTokenLeadingTrailingTriviaMap(tokens);
+
+ var resolver = triviaResolver ?? s_defaultTriviaResolver;
+
+ var triviaPairs = Enumerable.Range((int)TriviaLocation.BeforeBeginningOfSpan, TriviaLocationsCount)
+ .Cast<TriviaLocation>()
+ .ToDictionary(
+ location => location,
+ location => CreateTriviaPairs(
+ location,
+ tokenPairs[location],
+ resolver(location, tokenPairs[location], tokenToLeadingTrailingTriviaMap)));
+
+ return CreateOldToNewTokensMap(tokenPairs, triviaPairs);
+ }
+
+ private LeadingTrailingTriviaPair CreateTriviaPairs(
+ TriviaLocation locationKind,
+ PreviousNextTokenPair tokenPair,
+ IEnumerable<SyntaxTrivia> trivia)
+ {
+ // beginning of the tree
+ if (tokenPair.PreviousToken.RawKind == 0)
+ {
+ return new LeadingTrailingTriviaPair { TrailingTrivia = SpecializedCollections.EmptyEnumerable<SyntaxTrivia>(), LeadingTrivia = trivia };
+ }
+
+ return GetTrailingAndLeadingTrivia(locationKind, tokenPair, trivia);
+ }
+
+ private IEnumerable<Tuple<PreviousNextTokenPair, LeadingTrailingTriviaPair>> CreateUniqueTokenTriviaPairs(
+ Dictionary<TriviaLocation, PreviousNextTokenPair> tokenPairs,
+ Dictionary<TriviaLocation, LeadingTrailingTriviaPair> triviaPairs)
+ {
+ // if there are dup, duplicated one will be ignored.
+ var set = new HashSet<PreviousNextTokenPair>();
+ for (int i = (int)TriviaLocation.BeforeBeginningOfSpan; i <= (int)TriviaLocation.AfterEndOfSpan; i++)
+ {
+ var location = (TriviaLocation)i;
+ var key = tokenPairs[location];
+ if (set.Contains(key))
+ {
+ continue;
+ }
+
+ yield return Tuple.Create(key, triviaPairs[location]);
+ set.Add(key);
+ }
+ }
+
+ private Dictionary<SyntaxToken, LeadingTrailingTriviaPair> CreateTokenLeadingTrailingTriviaMap(
+ Dictionary<TriviaLocation, SyntaxToken> tokens)
+ {
+ var tuple = default(LeadingTrailingTriviaPair);
+ var map = new Dictionary<SyntaxToken, LeadingTrailingTriviaPair>();
+
+ tuple = map.GetOrAdd(tokens[TriviaLocation.BeforeBeginningOfSpan], _ => default(LeadingTrailingTriviaPair));
+ map[tokens[TriviaLocation.BeforeBeginningOfSpan]] = new LeadingTrailingTriviaPair
+ {
+ LeadingTrivia = tuple.LeadingTrivia,
+ TrailingTrivia = _triviaList[TriviaLocation.BeforeBeginningOfSpan]
+ };
+
+ tuple = map.GetOrAdd(tokens[TriviaLocation.AfterBeginningOfSpan], _ => default(LeadingTrailingTriviaPair));
+ map[tokens[TriviaLocation.AfterBeginningOfSpan]] = new LeadingTrailingTriviaPair
+ {
+ LeadingTrivia = _triviaList[TriviaLocation.AfterBeginningOfSpan],
+ TrailingTrivia = tuple.TrailingTrivia
+ };
+
+ tuple = map.GetOrAdd(tokens[TriviaLocation.BeforeEndOfSpan], _ => default(LeadingTrailingTriviaPair));
+ map[tokens[TriviaLocation.BeforeEndOfSpan]] = new LeadingTrailingTriviaPair
+ {
+ LeadingTrivia = tuple.LeadingTrivia,
+ TrailingTrivia = _triviaList[TriviaLocation.BeforeEndOfSpan]
+ };
+
+ tuple = map.GetOrAdd(tokens[TriviaLocation.AfterEndOfSpan], _ => default(LeadingTrailingTriviaPair));
+ map[tokens[TriviaLocation.AfterEndOfSpan]] = new LeadingTrailingTriviaPair
+ {
+ LeadingTrivia = _triviaList[TriviaLocation.AfterEndOfSpan],
+ TrailingTrivia = tuple.TrailingTrivia
+ };
+
+ return map;
+ }
+
+ private Dictionary<TriviaLocation, PreviousNextTokenPair> CreatePreviousNextTokenPairs(
+ Dictionary<TriviaLocation, SyntaxToken> tokens)
+ {
+ var tokenPairs = new Dictionary<TriviaLocation, PreviousNextTokenPair>();
+
+ tokenPairs[TriviaLocation.BeforeBeginningOfSpan] = new PreviousNextTokenPair
+ {
+ PreviousToken = tokens[TriviaLocation.BeforeBeginningOfSpan],
+ NextToken = tokens[TriviaLocation.BeforeBeginningOfSpan].GetNextToken(includeZeroWidth: true)
+ };
+
+ tokenPairs[TriviaLocation.AfterBeginningOfSpan] = new PreviousNextTokenPair
+ {
+ PreviousToken = tokens[TriviaLocation.AfterBeginningOfSpan].GetPreviousToken(includeZeroWidth: true),
+ NextToken = tokens[TriviaLocation.AfterBeginningOfSpan]
+ };
+
+ tokenPairs[TriviaLocation.BeforeEndOfSpan] = new PreviousNextTokenPair
+ {
+ PreviousToken = tokens[TriviaLocation.BeforeEndOfSpan],
+ NextToken = tokens[TriviaLocation.BeforeEndOfSpan].GetNextToken(includeZeroWidth: true)
+ };
+
+ tokenPairs[TriviaLocation.AfterEndOfSpan] = new PreviousNextTokenPair
+ {
+ PreviousToken = tokens[TriviaLocation.AfterEndOfSpan].GetPreviousToken(includeZeroWidth: true),
+ NextToken = tokens[TriviaLocation.AfterEndOfSpan]
+ };
+
+ return tokenPairs;
+ }
+
+ private IEnumerable<SyntaxTrivia> CreateTriviaListFromTo(
+ List<SyntaxTrivia> list,
+ int startIndex,
+ int endIndex)
+ {
+ if (startIndex > endIndex)
+ {
+ yield break;
+ }
+
+ for (int i = startIndex; i <= endIndex; i++)
+ {
+ yield return list[i];
+ }
+ }
+
+ private static SyntaxToken ResolveAnnotation(
+ SyntaxNode root,
+ TriviaLocation location,
+ SyntaxAnnotation annotation)
+ {
+ return root.GetAnnotatedNodesAndTokens(annotation).FirstOrDefault().AsToken();
+ }
+
+ private static IEnumerable<SyntaxTrivia> ResolveTrivia(
+ TriviaLocation location,
+ PreviousNextTokenPair tokenPair,
+ Dictionary<SyntaxToken, LeadingTrailingTriviaPair> triviaMap)
+ {
+ var previousTriviaPair = triviaMap.ContainsKey(tokenPair.PreviousToken) ? triviaMap[tokenPair.PreviousToken] : default(LeadingTrailingTriviaPair);
+ var nextTriviaPair = triviaMap.ContainsKey(tokenPair.NextToken) ? triviaMap[tokenPair.NextToken] : default(LeadingTrailingTriviaPair);
+
+ var trailingTrivia = previousTriviaPair.TrailingTrivia ?? SpecializedCollections.EmptyEnumerable<SyntaxTrivia>();
+ var leadingTrivia = nextTriviaPair.LeadingTrivia ?? SpecializedCollections.EmptyEnumerable<SyntaxTrivia>();
+
+ return tokenPair.PreviousToken.TrailingTrivia.Concat(trailingTrivia).Concat(leadingTrivia).Concat(tokenPair.NextToken.LeadingTrivia);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/AbstractSyntaxTriviaService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/AbstractSyntaxTriviaService.cs
new file mode 100644
index 0000000000..451ed6c336
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/AbstractSyntaxTriviaService.cs
@@ -0,0 +1,131 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using ICSharpCode.NRefactory6.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ abstract partial class AbstractSyntaxTriviaService : ISyntaxTriviaService
+ {
+ private const int TriviaLocationsCount = 4;
+
+ //private readonly ISyntaxFactsService _syntaxFactsService;
+ private readonly int _endOfLineKind;
+
+ protected AbstractSyntaxTriviaService(/*ISyntaxFactsService syntaxFactsService, */int endOfLineKind)
+ {
+// _syntaxFactsService = syntaxFactsService;
+ _endOfLineKind = endOfLineKind;
+ }
+
+ public ITriviaSavedResult SaveTriviaAroundSelection(SyntaxNode root, TextSpan textSpan)
+ {
+ var tokens = GetTokensAtEdges(root, textSpan);
+
+ // span must contain after and before spans at the both edges
+
+ var triviaList = GetTriviaAtEdges(tokens, textSpan);
+
+ var annotations = Enumerable.Range((int)TriviaLocation.BeforeBeginningOfSpan, TriviaLocationsCount)
+ .Cast<TriviaLocation>()
+ .ToDictionary(location => location, _ => new SyntaxAnnotation());
+
+ var map = CreateOldToNewTokensMap(tokens, annotations);
+ var rootWithAnnotation = ReplaceTokens(root, map.Keys, (o, n) => map[o]);
+
+ return CreateResult(rootWithAnnotation, annotations, triviaList);
+ }
+
+ private SyntaxNode ReplaceTokens(
+ SyntaxNode root,
+ IEnumerable<SyntaxToken> oldTokens,
+ Func<SyntaxToken, SyntaxToken, SyntaxToken> computeReplacementToken)
+ {
+ return root.ReplaceTokens(oldTokens, (o, n) => computeReplacementToken(o, n));
+ }
+
+ private ITriviaSavedResult CreateResult(
+ SyntaxNode root,
+ Dictionary<TriviaLocation, SyntaxAnnotation> annotations,
+ Dictionary<TriviaLocation, IEnumerable<SyntaxTrivia>> triviaList)
+ {
+ return new Result(root, _endOfLineKind, annotations, triviaList);
+ }
+
+ private Dictionary<SyntaxToken, SyntaxToken> CreateOldToNewTokensMap(
+ Dictionary<TriviaLocation, SyntaxToken> tokens,
+ Dictionary<TriviaLocation, SyntaxAnnotation> annotations)
+ {
+ var token = default(SyntaxToken);
+ var map = new Dictionary<SyntaxToken, SyntaxToken>();
+ var emptyList = SpecializedCollections.EmptyEnumerable<SyntaxTrivia>();
+
+ token = map.GetOrAdd(tokens[TriviaLocation.BeforeBeginningOfSpan], _ => tokens[TriviaLocation.BeforeBeginningOfSpan]);
+ map[tokens[TriviaLocation.BeforeBeginningOfSpan]] = token.WithTrailingTrivia(emptyList).WithAdditionalAnnotations(annotations[TriviaLocation.BeforeBeginningOfSpan]);
+
+ token = map.GetOrAdd(tokens[TriviaLocation.AfterBeginningOfSpan], _ => tokens[TriviaLocation.AfterBeginningOfSpan]);
+ map[tokens[TriviaLocation.AfterBeginningOfSpan]] = token.WithLeadingTrivia(emptyList).WithAdditionalAnnotations(annotations[TriviaLocation.AfterBeginningOfSpan]);
+
+ token = map.GetOrAdd(tokens[TriviaLocation.BeforeEndOfSpan], _ => tokens[TriviaLocation.BeforeEndOfSpan]);
+ map[tokens[TriviaLocation.BeforeEndOfSpan]] = token.WithTrailingTrivia(emptyList).WithAdditionalAnnotations(annotations[TriviaLocation.BeforeEndOfSpan]);
+
+ token = map.GetOrAdd(tokens[TriviaLocation.AfterEndOfSpan], _ => tokens[TriviaLocation.AfterEndOfSpan]);
+ map[tokens[TriviaLocation.AfterEndOfSpan]] = token.WithLeadingTrivia(emptyList).WithAdditionalAnnotations(annotations[TriviaLocation.AfterEndOfSpan]);
+
+ return map;
+ }
+
+ private Dictionary<TriviaLocation, IEnumerable<SyntaxTrivia>> GetTriviaAtEdges(Dictionary<TriviaLocation, SyntaxToken> tokens, TextSpan textSpan)
+ {
+ var triviaAtBeginning = SplitTrivia(tokens[TriviaLocation.BeforeBeginningOfSpan], tokens[TriviaLocation.AfterBeginningOfSpan], t => t.FullSpan.End <= textSpan.Start);
+ var triviaAtEnd = SplitTrivia(tokens[TriviaLocation.BeforeEndOfSpan], tokens[TriviaLocation.AfterEndOfSpan], t => t.FullSpan.Start < textSpan.End);
+
+ var triviaList = new Dictionary<TriviaLocation, IEnumerable<SyntaxTrivia>>();
+ triviaList[TriviaLocation.BeforeBeginningOfSpan] = triviaAtBeginning.Item1;
+ triviaList[TriviaLocation.AfterBeginningOfSpan] = triviaAtBeginning.Item2;
+
+ triviaList[TriviaLocation.BeforeEndOfSpan] = triviaAtEnd.Item1;
+ triviaList[TriviaLocation.AfterEndOfSpan] = triviaAtEnd.Item2;
+ return triviaList;
+ }
+
+ private Dictionary<TriviaLocation, SyntaxToken> GetTokensAtEdges(SyntaxNode root, TextSpan textSpan)
+ {
+ var tokens = new Dictionary<TriviaLocation, SyntaxToken>();
+ tokens[TriviaLocation.AfterBeginningOfSpan] = root.FindTokenOnRightOfPosition(textSpan.Start, includeSkipped: false);
+ tokens[TriviaLocation.BeforeBeginningOfSpan] = tokens[TriviaLocation.AfterBeginningOfSpan].GetPreviousToken(includeZeroWidth: true);
+ tokens[TriviaLocation.BeforeEndOfSpan] = root.FindTokenOnLeftOfPosition(textSpan.End, includeSkipped: false);
+ tokens[TriviaLocation.AfterEndOfSpan] = tokens[TriviaLocation.BeforeEndOfSpan].GetNextToken(includeZeroWidth: true);
+ return tokens;
+ }
+
+ private static Tuple<List<SyntaxTrivia>, List<SyntaxTrivia>> SplitTrivia(
+ SyntaxToken token1,
+ SyntaxToken token2,
+ Func<SyntaxTrivia, bool> conditionToLeftAtCallSite)
+ {
+ var triviaLeftAtCallSite = new List<SyntaxTrivia>();
+ var triviaMovedToDefinition = new List<SyntaxTrivia>();
+
+ foreach (var trivia in token1.TrailingTrivia.Concat(token2.LeadingTrivia))
+ {
+ if (conditionToLeftAtCallSite(trivia))
+ {
+ triviaLeftAtCallSite.Add(trivia);
+ }
+ else
+ {
+ triviaMovedToDefinition.Add(trivia);
+ }
+ }
+
+ return Tuple.Create(triviaLeftAtCallSite, triviaMovedToDefinition);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpExtractMethodService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpExtractMethodService.cs
new file mode 100644
index 0000000000..128de150a4
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpExtractMethodService.cs
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Composition;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Text;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ class CSharpExtractMethodService : AbstractExtractMethodService<CSharpSelectionValidator, CSharpMethodExtractor, CSharpSelectionResult>
+ {
+ [ImportingConstructor]
+ public CSharpExtractMethodService()
+ {
+ }
+
+ protected override CSharpSelectionValidator CreateSelectionValidator(SemanticDocument document, TextSpan textSpan, OptionSet options)
+ {
+ return new CSharpSelectionValidator(document, textSpan, options);
+ }
+
+ protected override CSharpMethodExtractor CreateMethodExtractor(CSharpSelectionResult selectionResult)
+ {
+ return new CSharpMethodExtractor(selectionResult);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.Analyzer.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.Analyzer.cs
new file mode 100644
index 0000000000..bb6774a2f2
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.Analyzer.cs
@@ -0,0 +1,136 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ partial class CSharpMethodExtractor : MethodExtractor
+ {
+ private class CSharpAnalyzer : Analyzer
+ {
+ private static readonly HashSet<int> s_nonNoisySyntaxKindSet = new HashSet<int>(new int[] { (int)SyntaxKind.WhitespaceTrivia, (int)SyntaxKind.EndOfLineTrivia });
+
+ public static Task<AnalyzerResult> AnalyzeAsync(SelectionResult selectionResult, CancellationToken cancellationToken)
+ {
+ var analyzer = new CSharpAnalyzer(selectionResult, cancellationToken);
+ return analyzer.AnalyzeAsync();
+ }
+
+ public CSharpAnalyzer(SelectionResult selectionResult, CancellationToken cancellationToken) :
+ base(selectionResult, cancellationToken)
+ {
+ }
+
+ protected override VariableInfo CreateFromSymbol(
+ Compilation compilation,
+ ISymbol symbol,
+ ITypeSymbol type,
+ VariableStyle style,
+ bool variableDeclared)
+ {
+ return CreateFromSymbolCommon<LocalDeclarationStatementSyntax>(compilation, symbol, type, style, s_nonNoisySyntaxKindSet);
+ }
+
+ protected override int GetIndexOfVariableInfoToUseAsReturnValue(IList<VariableInfo> variableInfo)
+ {
+ var numberOfOutParameters = 0;
+ var numberOfRefParameters = 0;
+
+ int outSymbolIndex = -1;
+ int refSymbolIndex = -1;
+
+ for (int i = 0; i < variableInfo.Count; i++)
+ {
+ var variable = variableInfo[i];
+
+ // there should be no one set as return value yet
+ //Contract.ThrowIfTrue(variable.UseAsReturnValue);
+
+ if (!variable.CanBeUsedAsReturnValue)
+ {
+ continue;
+ }
+
+ // check modifier
+ if (variable.ParameterModifier == ParameterBehavior.Ref)
+ {
+ numberOfRefParameters++;
+ refSymbolIndex = i;
+ }
+ else if (variable.ParameterModifier == ParameterBehavior.Out)
+ {
+ numberOfOutParameters++;
+ outSymbolIndex = i;
+ }
+ }
+
+ // if there is only one "out" or "ref", that will be converted to return statement.
+ if (numberOfOutParameters == 1)
+ {
+ return outSymbolIndex;
+ }
+
+ if (numberOfRefParameters == 1)
+ {
+ return refSymbolIndex;
+ }
+
+ return -1;
+ }
+
+ protected override ITypeSymbol GetRangeVariableType(SemanticModel model, IRangeVariableSymbol symbol)
+ {
+ var info = model.GetSpeculativeTypeInfo(this.SelectionResult.FinalSpan.Start, SyntaxFactory.ParseName(symbol.Name), SpeculativeBindingOption.BindAsExpression);
+ if (info.Type.IsErrorType())
+ {
+ return null;
+ }
+
+ return info.Type == null || info.Type.SpecialType == Microsoft.CodeAnalysis.SpecialType.System_Object
+ ? info.Type
+ : info.ConvertedType;
+ }
+
+ protected override Tuple<SyntaxNode, SyntaxNode> GetFlowAnalysisNodeRange()
+ {
+ var csharpSelectionResult = this.SelectionResult as CSharpSelectionResult;
+
+ var first = csharpSelectionResult.GetFirstStatement();
+ var last = csharpSelectionResult.GetLastStatement();
+
+ // single statement case
+ if (first == last ||
+ first.Span.Contains(last.Span))
+ {
+ return new Tuple<SyntaxNode, SyntaxNode>(first, first);
+ }
+
+ // multiple statement case
+ var firstUnderContainer = csharpSelectionResult.GetFirstStatementUnderContainer();
+ var lastUnderContainer = csharpSelectionResult.GetLastStatementUnderContainer();
+ return new Tuple<SyntaxNode, SyntaxNode>(firstUnderContainer, lastUnderContainer);
+ }
+
+ protected override bool ContainsReturnStatementInSelectedCode(IEnumerable<SyntaxNode> jumpOutOfRegionStatements)
+ {
+ return jumpOutOfRegionStatements.Where(n => n is ReturnStatementSyntax).Any();
+ }
+
+ protected override bool ReadOnlyFieldAllowed()
+ {
+ var scope = this.SelectionResult.GetContainingScopeOf<ConstructorDeclarationSyntax>();
+ return scope == null;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs
new file mode 100644
index 0000000000..8231f1d2ad
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs
@@ -0,0 +1,392 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ partial class CSharpMethodExtractor
+ {
+ private abstract partial class CSharpCodeGenerator
+ {
+ private class CallSiteContainerRewriter : CSharpSyntaxRewriter
+ {
+ private readonly SyntaxNode _outmostCallSiteContainer;
+ private readonly IEnumerable<SyntaxNode> _statementsOrFieldToInsert;
+ private readonly HashSet<SyntaxAnnotation> _variableToRemoveMap;
+ private readonly SyntaxNode _firstStatementOrFieldToReplace;
+ private readonly SyntaxNode _lastStatementOrFieldToReplace;
+
+ public CallSiteContainerRewriter(
+ SyntaxNode outmostCallSiteContainer,
+ HashSet<SyntaxAnnotation> variableToRemoveMap,
+ SyntaxNode firstStatementOrFieldToReplace,
+ SyntaxNode lastStatementOrFieldToReplace,
+ IEnumerable<SyntaxNode> statementsOrFieldToInsert)
+ {
+// Contract.ThrowIfNull(outmostCallSiteContainer);
+// Contract.ThrowIfNull(variableToRemoveMap);
+// Contract.ThrowIfNull(firstStatementOrFieldToReplace);
+// Contract.ThrowIfNull(lastStatementOrFieldToReplace);
+// Contract.ThrowIfNull(statementsOrFieldToInsert);
+// Contract.ThrowIfTrue(statementsOrFieldToInsert.IsEmpty());
+
+ _outmostCallSiteContainer = outmostCallSiteContainer;
+
+ _variableToRemoveMap = variableToRemoveMap;
+ _statementsOrFieldToInsert = statementsOrFieldToInsert;
+
+ _firstStatementOrFieldToReplace = firstStatementOrFieldToReplace;
+ _lastStatementOrFieldToReplace = lastStatementOrFieldToReplace;
+
+ //Contract.ThrowIfFalse(_firstStatementOrFieldToReplace.Parent == _lastStatementOrFieldToReplace.Parent);
+ }
+
+ public SyntaxNode Generate()
+ {
+ return Visit(_outmostCallSiteContainer);
+ }
+
+ private SyntaxNode ContainerOfStatementsOrFieldToReplace
+ {
+ get { return _firstStatementOrFieldToReplace.Parent; }
+ }
+
+ public override SyntaxNode VisitLocalDeclarationStatement(LocalDeclarationStatementSyntax node)
+ {
+ node = (LocalDeclarationStatementSyntax)base.VisitLocalDeclarationStatement(node);
+
+ var list = new List<VariableDeclaratorSyntax>();
+ var triviaList = new List<SyntaxTrivia>();
+
+ // go through each var decls in decl statement
+ foreach (var variable in node.Declaration.Variables)
+ {
+ if (_variableToRemoveMap.HasSyntaxAnnotation(variable))
+ {
+ // if it had initialization, it shouldn't reach here.
+ //Contract.ThrowIfFalse(variable.Initializer == null);
+
+ // we don't remove trivia around tokens we remove
+ triviaList.AddRange(variable.GetLeadingTrivia());
+ triviaList.AddRange(variable.GetTrailingTrivia());
+ continue;
+ }
+
+ if (triviaList.Count > 0)
+ {
+ list.Add(variable.WithPrependedLeadingTrivia(triviaList));
+ triviaList.Clear();
+ continue;
+ }
+
+ list.Add(variable);
+ }
+
+ if (list.Count == 0)
+ {
+ // nothing has survived. remove this from the list
+ if (triviaList.Count == 0)
+ {
+ return null;
+ }
+
+ // well, there are trivia associated with the node.
+ // we can't just delete the node since then, we will lose
+ // the trivia. unfortunately, it is not easy to attach the trivia
+ // to next token. for now, create an empty statement and associate the
+ // trivia to the statement
+
+ // TODO : think about a way to move the trivia to next token.
+ return SyntaxFactory.EmptyStatement(SyntaxFactory.Token(SyntaxFactory.TriviaList(triviaList), SyntaxKind.SemicolonToken, SyntaxTriviaList.Create(SyntaxFactory.ElasticMarker)));
+ }
+
+ if (list.Count == node.Declaration.Variables.Count)
+ {
+ // nothing has changed, return as it is
+ return node;
+ }
+
+ // TODO : fix how it manipulate trivia later
+
+ // if there is left over syntax trivia, it will be attached to leading trivia
+ // of semicolon
+ return
+ SyntaxFactory.LocalDeclarationStatement(
+ node.Modifiers,
+ SyntaxFactory.VariableDeclaration(
+ node.Declaration.Type,
+ SyntaxFactory.SeparatedList(list)),
+ node.SemicolonToken.WithPrependedLeadingTrivia(triviaList));
+ }
+
+ // for every kind of extract methods
+ public override SyntaxNode VisitBlock(BlockSyntax node)
+ {
+ if (node != this.ContainerOfStatementsOrFieldToReplace)
+ {
+ // make sure we visit nodes under the block
+ return base.VisitBlock(node);
+ }
+
+ return node.WithStatements(VisitList(ReplaceStatements(node.Statements)).ToSyntaxList());
+ }
+
+ public override SyntaxNode VisitSwitchSection(SwitchSectionSyntax node)
+ {
+ if (node != this.ContainerOfStatementsOrFieldToReplace)
+ {
+ // make sure we visit nodes under the switch section
+ return base.VisitSwitchSection(node);
+ }
+
+ return node.WithStatements(VisitList(ReplaceStatements(node.Statements)).ToSyntaxList());
+ }
+
+ // only for single statement or expression
+ public override SyntaxNode VisitLabeledStatement(LabeledStatementSyntax node)
+ {
+ if (node != this.ContainerOfStatementsOrFieldToReplace)
+ {
+ return base.VisitLabeledStatement(node);
+ }
+
+ return node.WithStatement(ReplaceStatementIfNeeded(node.Statement));
+ }
+
+ public override SyntaxNode VisitElseClause(ElseClauseSyntax node)
+ {
+ if (node != this.ContainerOfStatementsOrFieldToReplace)
+ {
+ return base.VisitElseClause(node);
+ }
+
+ return node.WithStatement(ReplaceStatementIfNeeded(node.Statement));
+ }
+
+ public override SyntaxNode VisitIfStatement(IfStatementSyntax node)
+ {
+ if (node != this.ContainerOfStatementsOrFieldToReplace)
+ {
+ return base.VisitIfStatement(node);
+ }
+
+ return node.WithCondition(VisitNode(node.Condition))
+ .WithStatement(ReplaceStatementIfNeeded(node.Statement))
+ .WithElse(VisitNode(node.Else));
+ }
+
+ public override SyntaxNode VisitLockStatement(LockStatementSyntax node)
+ {
+ if (node != this.ContainerOfStatementsOrFieldToReplace)
+ {
+ return base.VisitLockStatement(node);
+ }
+
+ return node.WithExpression(VisitNode(node.Expression))
+ .WithStatement(ReplaceStatementIfNeeded(node.Statement));
+ }
+
+ public override SyntaxNode VisitFixedStatement(FixedStatementSyntax node)
+ {
+ if (node != this.ContainerOfStatementsOrFieldToReplace)
+ {
+ return base.VisitFixedStatement(node);
+ }
+
+ return node.WithDeclaration(VisitNode(node.Declaration))
+ .WithStatement(ReplaceStatementIfNeeded(node.Statement));
+ }
+
+ public override SyntaxNode VisitUsingStatement(UsingStatementSyntax node)
+ {
+ if (node != this.ContainerOfStatementsOrFieldToReplace)
+ {
+ return base.VisitUsingStatement(node);
+ }
+
+ return node.WithDeclaration(VisitNode(node.Declaration))
+ .WithExpression(VisitNode(node.Expression))
+ .WithStatement(ReplaceStatementIfNeeded(node.Statement));
+ }
+
+ public override SyntaxNode VisitForEachStatement(ForEachStatementSyntax node)
+ {
+ if (node != this.ContainerOfStatementsOrFieldToReplace)
+ {
+ return base.VisitForEachStatement(node);
+ }
+
+ return node.WithExpression(VisitNode(node.Expression))
+ .WithStatement(ReplaceStatementIfNeeded(node.Statement));
+ }
+
+ public override SyntaxNode VisitForStatement(ForStatementSyntax node)
+ {
+ if (node != this.ContainerOfStatementsOrFieldToReplace)
+ {
+ return base.VisitForStatement(node);
+ }
+
+ return node.WithDeclaration(VisitNode(node.Declaration))
+ .WithInitializers(VisitList(node.Initializers))
+ .WithCondition(VisitNode(node.Condition))
+ .WithIncrementors(VisitList(node.Incrementors))
+ .WithStatement(ReplaceStatementIfNeeded(node.Statement));
+ }
+
+ public override SyntaxNode VisitDoStatement(DoStatementSyntax node)
+ {
+ if (node != this.ContainerOfStatementsOrFieldToReplace)
+ {
+ return base.VisitDoStatement(node);
+ }
+
+ return node.WithStatement(ReplaceStatementIfNeeded(node.Statement))
+ .WithCondition(VisitNode(node.Condition));
+ }
+
+ public override SyntaxNode VisitWhileStatement(WhileStatementSyntax node)
+ {
+ if (node != this.ContainerOfStatementsOrFieldToReplace)
+ {
+ return base.VisitWhileStatement(node);
+ }
+
+ return node.WithCondition(VisitNode(node.Condition))
+ .WithStatement(ReplaceStatementIfNeeded(node.Statement));
+ }
+
+ private TNode VisitNode<TNode>(TNode node) where TNode : SyntaxNode
+ {
+ return (TNode)Visit(node);
+ }
+
+ private StatementSyntax ReplaceStatementIfNeeded(StatementSyntax statement)
+ {
+ //Contract.ThrowIfNull(statement);
+
+ // if all three same
+ if ((statement != _firstStatementOrFieldToReplace) || (_firstStatementOrFieldToReplace != _lastStatementOrFieldToReplace))
+ {
+ return statement;
+ }
+
+ // replace one statement with another
+ if (_statementsOrFieldToInsert.Count() == 1)
+ {
+ return _statementsOrFieldToInsert.Cast<StatementSyntax>().Single();
+ }
+
+ // replace one statement with multiple statements (see bug # 6310)
+ return SyntaxFactory.Block(SyntaxFactory.List(_statementsOrFieldToInsert.Cast<StatementSyntax>()));
+ }
+
+ private SyntaxList<StatementSyntax> ReplaceStatements(SyntaxList<StatementSyntax> statements)
+ {
+ // okay, this visit contains the statement
+ var newStatements = new List<StatementSyntax>(statements);
+
+ var firstStatementIndex = newStatements.FindIndex(s => s == _firstStatementOrFieldToReplace);
+ //Contract.ThrowIfFalse(firstStatementIndex >= 0);
+
+ var lastStatementIndex = newStatements.FindIndex(s => s == _lastStatementOrFieldToReplace);
+ //Contract.ThrowIfFalse(lastStatementIndex >= 0);
+
+ //Contract.ThrowIfFalse(firstStatementIndex <= lastStatementIndex);
+
+ // remove statement that must be removed
+ newStatements.RemoveRange(firstStatementIndex, lastStatementIndex - firstStatementIndex + 1);
+
+ // add new statements to replace
+ newStatements.InsertRange(firstStatementIndex, _statementsOrFieldToInsert.Cast<StatementSyntax>());
+
+ return newStatements.ToSyntaxList();
+ }
+
+ private SyntaxList<MemberDeclarationSyntax> ReplaceMembers(SyntaxList<MemberDeclarationSyntax> members, bool global)
+ {
+ // okay, this visit contains the statement
+ var newMembers = new List<MemberDeclarationSyntax>(members);
+
+ var firstMemberIndex = newMembers.FindIndex(s => s == (global ? _firstStatementOrFieldToReplace.Parent : _firstStatementOrFieldToReplace));
+ //Contract.ThrowIfFalse(firstMemberIndex >= 0);
+
+ var lastMemberIndex = newMembers.FindIndex(s => s == (global ? _lastStatementOrFieldToReplace.Parent : _lastStatementOrFieldToReplace));
+ //Contract.ThrowIfFalse(lastMemberIndex >= 0);
+
+ //Contract.ThrowIfFalse(firstMemberIndex <= lastMemberIndex);
+
+ // remove statement that must be removed
+ newMembers.RemoveRange(firstMemberIndex, lastMemberIndex - firstMemberIndex + 1);
+
+ // add new statements to replace
+ newMembers.InsertRange(firstMemberIndex,
+ _statementsOrFieldToInsert.Select(s => global ? SyntaxFactory.GlobalStatement((StatementSyntax)s) : (MemberDeclarationSyntax)s));
+
+ return newMembers.ToSyntaxList();
+ }
+
+ public override SyntaxNode VisitGlobalStatement(GlobalStatementSyntax node)
+ {
+ if (node != this.ContainerOfStatementsOrFieldToReplace)
+ {
+ return base.VisitGlobalStatement(node);
+ }
+
+ return node.WithStatement(ReplaceStatementIfNeeded(node.Statement));
+ }
+
+ public override SyntaxNode VisitConstructorDeclaration(ConstructorDeclarationSyntax node)
+ {
+ if (node != this.ContainerOfStatementsOrFieldToReplace)
+ {
+ return base.VisitConstructorDeclaration(node);
+ }
+
+ //Contract.ThrowIfFalse(_firstStatementOrFieldToReplace == _lastStatementOrFieldToReplace);
+ return node.WithInitializer((ConstructorInitializerSyntax)_statementsOrFieldToInsert.Single());
+ }
+
+ public override SyntaxNode VisitClassDeclaration(ClassDeclarationSyntax node)
+ {
+ if (node != this.ContainerOfStatementsOrFieldToReplace)
+ {
+ return base.VisitClassDeclaration(node);
+ }
+
+ var newMembers = VisitList(ReplaceMembers(node.Members, global: false));
+ return node.WithMembers(newMembers);
+ }
+
+ public override SyntaxNode VisitStructDeclaration(StructDeclarationSyntax node)
+ {
+ if (node != this.ContainerOfStatementsOrFieldToReplace)
+ {
+ return base.VisitStructDeclaration(node);
+ }
+
+ var newMembers = VisitList(ReplaceMembers(node.Members, global: false));
+ return node.WithMembers(newMembers);
+ }
+
+ public override SyntaxNode VisitCompilationUnit(CompilationUnitSyntax node)
+ {
+ if (node != this.ContainerOfStatementsOrFieldToReplace.Parent)
+ {
+ // make sure we visit nodes under the block
+ return base.VisitCompilationUnit(node);
+ }
+
+ var newMembers = VisitList(ReplaceMembers(node.Members, global: true));
+ return node.WithMembers(newMembers);
+ }
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs
new file mode 100644
index 0000000000..f9cb3772dc
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs
@@ -0,0 +1,242 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ partial class CSharpMethodExtractor
+ {
+ private partial class CSharpCodeGenerator
+ {
+ private class ExpressionCodeGenerator : CSharpCodeGenerator
+ {
+ public ExpressionCodeGenerator(
+ InsertionPoint insertionPoint,
+ SelectionResult selectionResult,
+ AnalyzerResult analyzerResult) :
+ base(insertionPoint, selectionResult, analyzerResult)
+ {
+ }
+
+ public static bool IsExtractMethodOnExpression(SelectionResult code)
+ {
+ return code.SelectionInExpression;
+ }
+
+ protected override SyntaxToken CreateMethodName()
+ {
+ var methodName = "NewMethod";
+ var containingScope = this.CSharpSelectionResult.GetContainingScope();
+
+ methodName = GetMethodNameBasedOnExpression(methodName, containingScope);
+
+ var semanticModel = this.SemanticDocument.SemanticModel;
+ var nameGenerator = new UniqueNameGenerator(semanticModel);
+ return SyntaxFactory.Identifier(nameGenerator.CreateUniqueMethodName(containingScope, methodName));
+ }
+
+ private static string GetMethodNameBasedOnExpression(string methodName, SyntaxNode expression)
+ {
+ if (expression.Parent != null &&
+ expression.Parent.Kind() == SyntaxKind.EqualsValueClause &&
+ expression.Parent.Parent != null &&
+ expression.Parent.Parent.Kind() == SyntaxKind.VariableDeclarator)
+ {
+ var name = ((VariableDeclaratorSyntax)expression.Parent.Parent).Identifier.ValueText;
+ return (name != null && name.Length > 0) ? MakeMethodName("Get", name) : methodName;
+ }
+
+ if (expression is MemberAccessExpressionSyntax)
+ {
+ expression = ((MemberAccessExpressionSyntax)expression).Name;
+ }
+
+ if (expression is NameSyntax)
+ {
+ SimpleNameSyntax unqualifiedName;
+
+ switch (expression.Kind())
+ {
+ case SyntaxKind.IdentifierName:
+ case SyntaxKind.GenericName:
+ unqualifiedName = (SimpleNameSyntax)expression;
+ break;
+ case SyntaxKind.QualifiedName:
+ unqualifiedName = ((QualifiedNameSyntax)expression).Right;
+ break;
+ case SyntaxKind.AliasQualifiedName:
+ unqualifiedName = ((AliasQualifiedNameSyntax)expression).Name;
+ break;
+ default:
+ throw new System.NotSupportedException("Unexpected name kind: " + expression.Kind().ToString());
+ }
+
+ var unqualifiedNameIdentifierValueText = unqualifiedName.Identifier.ValueText;
+ return (unqualifiedNameIdentifierValueText != null && unqualifiedNameIdentifierValueText.Length > 0) ? MakeMethodName("Get", unqualifiedNameIdentifierValueText) : methodName;
+ }
+
+ return methodName;
+ }
+
+ protected override IEnumerable<StatementSyntax> GetInitialStatementsForMethodDefinitions()
+ {
+ //Contract.ThrowIfFalse(IsExtractMethodOnExpression(this.CSharpSelectionResult));
+
+ ExpressionSyntax expression = null;
+
+ // special case for array initializer
+ var returnType = (ITypeSymbol)this.AnalyzerResult.ReturnType;
+ var containingScope = this.CSharpSelectionResult.GetContainingScope();
+
+ if (returnType.TypeKind == TypeKind.Array && containingScope is InitializerExpressionSyntax)
+ {
+ var typeSyntax = returnType.GenerateTypeSyntax();
+
+ expression = SyntaxFactory.ArrayCreationExpression(typeSyntax as ArrayTypeSyntax, containingScope as InitializerExpressionSyntax);
+ }
+ else
+ {
+ expression = containingScope as ExpressionSyntax;
+ }
+
+ if (this.AnalyzerResult.HasReturnType)
+ {
+ return SpecializedCollections.SingletonEnumerable<StatementSyntax>(
+ SyntaxFactory.ReturnStatement(
+ WrapInCheckedExpressionIfNeeded(expression)));
+ }
+ else
+ {
+ return SpecializedCollections.SingletonEnumerable<StatementSyntax>(
+ SyntaxFactory.ExpressionStatement(
+ WrapInCheckedExpressionIfNeeded(expression)));
+ }
+ }
+
+ private ExpressionSyntax WrapInCheckedExpressionIfNeeded(ExpressionSyntax expression)
+ {
+ var kind = this.CSharpSelectionResult.UnderCheckedExpressionContext();
+ if (kind == SyntaxKind.None)
+ {
+ return expression;
+ }
+
+ return SyntaxFactory.CheckedExpression(kind, expression);
+ }
+
+ protected override SyntaxNode GetOutermostCallSiteContainerToProcess(CancellationToken cancellationToken)
+ {
+ var callSiteContainer = GetCallSiteContainerFromOutermostMoveInVariable(cancellationToken);
+ if (callSiteContainer != null)
+ {
+ return callSiteContainer;
+ }
+ else
+ {
+ return GetCallSiteContainerFromExpression();
+ }
+ }
+
+ private SyntaxNode GetCallSiteContainerFromExpression()
+ {
+ var container = this.CSharpSelectionResult.GetInnermostStatementContainer();
+
+// Contract.ThrowIfNull(container);
+// Contract.ThrowIfFalse(container.IsStatementContainerNode() ||
+// container is TypeDeclarationSyntax ||
+// container is ConstructorDeclarationSyntax ||
+// container is CompilationUnitSyntax);
+
+ return container;
+ }
+
+ protected override SyntaxNode GetFirstStatementOrInitializerSelectedAtCallSite()
+ {
+ var scope = (SyntaxNode)this.CSharpSelectionResult.GetContainingScopeOf<StatementSyntax>();
+ if (scope == null)
+ {
+ scope = this.CSharpSelectionResult.GetContainingScopeOf<FieldDeclarationSyntax>();
+ }
+
+ if (scope == null)
+ {
+ scope = this.CSharpSelectionResult.GetContainingScopeOf<ConstructorInitializerSyntax>();
+ }
+
+ return scope;
+ }
+
+ protected override SyntaxNode GetLastStatementOrInitializerSelectedAtCallSite()
+ {
+ return GetFirstStatementOrInitializerSelectedAtCallSite();
+ }
+
+ protected override async Task<SyntaxNode> GetStatementOrInitializerContainingInvocationToExtractedMethodAsync(
+ SyntaxAnnotation callSiteAnnotation, CancellationToken cancellationToken)
+ {
+ var enclosingStatement = GetFirstStatementOrInitializerSelectedAtCallSite();
+ var callSignature = CreateCallSignature().WithAdditionalAnnotations(callSiteAnnotation);
+ var invocation = callSignature.IsKind(SyntaxKind.AwaitExpression) ? ((AwaitExpressionSyntax)callSignature).Expression : callSignature;
+
+ var sourceNode = this.CSharpSelectionResult.GetContainingScope();
+// Contract.ThrowIfTrue(
+// sourceNode.Parent is MemberAccessExpressionSyntax && ((MemberAccessExpressionSyntax)sourceNode.Parent).Name == sourceNode,
+// "invalid scope. given scope is not an expression");
+
+ // To lower the chances that replacing sourceNode with callSignature will break the user's
+ // code, we make the enclosing statement semantically explicit. This ends up being a little
+ // bit more work because we need to annotate the sourceNode so that we can get back to it
+ // after rewriting the enclosing statement.
+ var updatedDocument = this.SemanticDocument.Document;
+ var sourceNodeAnnotation = new SyntaxAnnotation();
+ var enclosingStatementAnnotation = new SyntaxAnnotation();
+ var newEnclosingStatement = enclosingStatement
+ .ReplaceNode(sourceNode, sourceNode.WithAdditionalAnnotations(sourceNodeAnnotation))
+ .WithAdditionalAnnotations(enclosingStatementAnnotation);
+
+ updatedDocument = await updatedDocument.ReplaceNodeAsync(enclosingStatement, newEnclosingStatement, cancellationToken).ConfigureAwait(false);
+
+ var updatedRoot = await updatedDocument.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ newEnclosingStatement = updatedRoot.GetAnnotatedNodesAndTokens(enclosingStatementAnnotation).Single().AsNode();
+
+ // because of the complexifiction we cannot guarantee that there is only one annotation.
+ // however complexification of names is prepended, so the last annotation should be the original one.
+ sourceNode = updatedRoot.GetAnnotatedNodesAndTokens(sourceNodeAnnotation).Last().AsNode();
+
+ // we want to replace the old identifier with a invocation expression, but because of MakeExplicit we might have
+ // a member access now instead of the identifer. So more syntax fiddling is needed.
+ if (sourceNode.Parent.Kind() == SyntaxKind.SimpleMemberAccessExpression &&
+ ((ExpressionSyntax)sourceNode).IsRightSideOfDot())
+ {
+ var explicitMemberAccess = (MemberAccessExpressionSyntax)sourceNode.Parent;
+ var replacementMemberAccess = explicitMemberAccess.CopyAnnotationsTo(
+ SyntaxFactory.MemberAccessExpression(
+ sourceNode.Parent.Kind(),
+ explicitMemberAccess.Expression,
+ (SimpleNameSyntax)((InvocationExpressionSyntax)invocation).Expression));
+ var newInvocation = SyntaxFactory.InvocationExpression(
+ replacementMemberAccess,
+ ((InvocationExpressionSyntax)invocation).ArgumentList);
+
+ var newCallSignature = callSignature != invocation ?
+ callSignature.ReplaceNode(invocation, newInvocation) : invocation.CopyAnnotationsTo(newInvocation);
+
+ sourceNode = sourceNode.Parent;
+ callSignature = newCallSignature;
+ }
+
+ return newEnclosingStatement.ReplaceNode(sourceNode, callSignature);
+ }
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.CSharpCodeGenerator.MultipleStatementsCodeGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.CSharpCodeGenerator.MultipleStatementsCodeGenerator.cs
new file mode 100644
index 0000000000..4da57f7be2
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.CSharpCodeGenerator.MultipleStatementsCodeGenerator.cs
@@ -0,0 +1,139 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ partial class CSharpMethodExtractor
+ {
+ private partial class CSharpCodeGenerator
+ {
+ class MultipleStatementsCodeGenerator : CSharpCodeGenerator
+ {
+ public MultipleStatementsCodeGenerator(
+ InsertionPoint insertionPoint,
+ SelectionResult selectionResult,
+ AnalyzerResult analyzerResult) :
+ base(insertionPoint, selectionResult, analyzerResult)
+ {
+ }
+
+ public static bool IsExtractMethodOnMultipleStatements(SelectionResult code)
+ {
+ var result = (CSharpSelectionResult)code;
+ var first = result.GetFirstStatement();
+ var last = result.GetLastStatement();
+
+ if (first != last)
+ {
+ //var firstUnderContainer = result.GetFirstStatementUnderContainer();
+ //var lastUnderContainer = result.GetLastStatementUnderContainer();
+ //Contract.ThrowIfFalse(firstUnderContainer.Parent == lastUnderContainer.Parent);
+ return true;
+ }
+
+ return false;
+ }
+
+ protected override SyntaxToken CreateMethodName()
+ {
+ // change this to more smarter one.
+ var semanticModel = this.SemanticDocument.SemanticModel;
+ var nameGenerator = new UniqueNameGenerator(semanticModel);
+ var scope = this.CSharpSelectionResult.GetContainingScope();
+ return SyntaxFactory.Identifier(nameGenerator.CreateUniqueMethodName(scope, "NewMethod"));
+ }
+
+ protected override IEnumerable<StatementSyntax> GetInitialStatementsForMethodDefinitions()
+ {
+ var firstSeen = false;
+ var firstStatementUnderContainer = this.CSharpSelectionResult.GetFirstStatementUnderContainer();
+ var lastStatementUnderContainer = this.CSharpSelectionResult.GetLastStatementUnderContainer();
+
+ var list = new List<StatementSyntax>();
+ foreach (var statement in GetStatementsFromContainer(firstStatementUnderContainer.Parent))
+ {
+ // reset first seen
+ if (!firstSeen)
+ {
+ firstSeen = statement == firstStatementUnderContainer;
+ }
+
+ // continue until we see the first statement
+ if (!firstSeen)
+ {
+ continue;
+ }
+
+ list.Add(statement);
+
+ // exit if we see last statement
+ if (statement == lastStatementUnderContainer)
+ {
+ break;
+ }
+ }
+
+ return list;
+ }
+
+ protected override SyntaxNode GetOutermostCallSiteContainerToProcess(CancellationToken cancellationToken)
+ {
+ var callSiteContainer = GetCallSiteContainerFromOutermostMoveInVariable(cancellationToken);
+ if (callSiteContainer != null)
+ {
+ return callSiteContainer;
+ }
+ else
+ {
+ var firstStatement = this.CSharpSelectionResult.GetFirstStatementUnderContainer();
+ return firstStatement.Parent;
+ }
+ }
+
+ private SyntaxList<StatementSyntax> GetStatementsFromContainer(SyntaxNode node)
+ {
+// Contract.ThrowIfNull(node);
+// Contract.ThrowIfFalse(node.IsStatementContainerNode());
+
+ var blockNode = node as BlockSyntax;
+ if (blockNode != null)
+ {
+ return blockNode.Statements;
+ }
+
+ var switchSecionNode = node as SwitchSectionSyntax;
+ if (switchSecionNode != null)
+ {
+ return switchSecionNode.Statements;
+ }
+
+ return new SyntaxList<StatementSyntax> ();//Contract.FailWithReturn<SyntaxList<StatementSyntax>>("unknown statements container!");
+ }
+
+ protected override SyntaxNode GetFirstStatementOrInitializerSelectedAtCallSite()
+ {
+ return this.CSharpSelectionResult.GetFirstStatementUnderContainer();
+ }
+
+ protected override SyntaxNode GetLastStatementOrInitializerSelectedAtCallSite()
+ {
+ return this.CSharpSelectionResult.GetLastStatementUnderContainer();
+ }
+
+ protected override Task<SyntaxNode> GetStatementOrInitializerContainingInvocationToExtractedMethodAsync(
+ SyntaxAnnotation callSiteAnnotation, CancellationToken cancellationToken)
+ {
+ var statement = GetStatementContainingInvocationToExtractedMethodWorker();
+ return Task.FromResult<SyntaxNode>(statement.WithAdditionalAnnotations(callSiteAnnotation));
+ }
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.CSharpCodeGenerator.SingleStatementCodeGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.CSharpCodeGenerator.SingleStatementCodeGenerator.cs
new file mode 100644
index 0000000000..1d42d4b3db
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.CSharpCodeGenerator.SingleStatementCodeGenerator.cs
@@ -0,0 +1,87 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ partial class CSharpMethodExtractor
+ {
+ private partial class CSharpCodeGenerator
+ {
+ class SingleStatementCodeGenerator : CSharpCodeGenerator
+ {
+ public SingleStatementCodeGenerator(
+ InsertionPoint insertionPoint,
+ SelectionResult selectionResult,
+ AnalyzerResult analyzerResult) :
+ base(insertionPoint, selectionResult, analyzerResult)
+ {
+ }
+
+ public static bool IsExtractMethodOnSingleStatement(SelectionResult code)
+ {
+ var result = (CSharpSelectionResult)code;
+ var firstStatement = result.GetFirstStatement();
+ var lastStatement = result.GetLastStatement();
+
+ return firstStatement == lastStatement || firstStatement.Span.Contains(lastStatement.Span);
+ }
+
+ protected override SyntaxToken CreateMethodName()
+ {
+ // change this to more smarter one.
+ var semanticModel = this.SemanticDocument.SemanticModel;
+ var nameGenerator = new UniqueNameGenerator(semanticModel);
+ var scope = this.CSharpSelectionResult.GetContainingScope();
+ return SyntaxFactory.Identifier(nameGenerator.CreateUniqueMethodName(scope, "NewMethod"));
+ }
+
+ protected override IEnumerable<StatementSyntax> GetInitialStatementsForMethodDefinitions()
+ {
+ // Contract.ThrowIfFalse(IsExtractMethodOnSingleStatement(this.CSharpSelectionResult));
+
+ return SpecializedCollections.SingletonEnumerable<StatementSyntax>(this.CSharpSelectionResult.GetFirstStatement());
+ }
+
+ protected override SyntaxNode GetOutermostCallSiteContainerToProcess(CancellationToken cancellationToken)
+ {
+ var callSiteContainer = GetCallSiteContainerFromOutermostMoveInVariable(cancellationToken);
+ if (callSiteContainer != null)
+ {
+ return callSiteContainer;
+ }
+ else
+ {
+ var firstStatement = this.CSharpSelectionResult.GetFirstStatement();
+ return firstStatement.Parent;
+ }
+ }
+
+ protected override SyntaxNode GetFirstStatementOrInitializerSelectedAtCallSite()
+ {
+ return this.CSharpSelectionResult.GetFirstStatement();
+ }
+
+ protected override SyntaxNode GetLastStatementOrInitializerSelectedAtCallSite()
+ {
+ // it is a single statement case. either first statement is same as last statement or
+ // last statement belongs (embedded statement) to the first statement.
+ return this.CSharpSelectionResult.GetFirstStatement();
+ }
+
+ protected override Task<SyntaxNode> GetStatementOrInitializerContainingInvocationToExtractedMethodAsync(
+ SyntaxAnnotation callSiteAnnotation, CancellationToken cancellationToken)
+ {
+ var statement = GetStatementContainingInvocationToExtractedMethodWorker();
+ return Task.FromResult<SyntaxNode>(statement.WithAdditionalAnnotations(callSiteAnnotation));
+ }
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.CSharpCodeGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.CSharpCodeGenerator.cs
new file mode 100644
index 0000000000..6fbdfa5f52
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.CSharpCodeGenerator.cs
@@ -0,0 +1,583 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Editing;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Simplification;
+using Roslyn.Utilities;
+using ICSharpCode.NRefactory6.CSharp.CodeGeneration;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ partial class CSharpMethodExtractor
+ {
+ private abstract partial class CSharpCodeGenerator : CodeGenerator<StatementSyntax, ExpressionSyntax, SyntaxNode>
+ {
+ private SyntaxToken _methodName;
+
+ public static async Task<GeneratedCode> GenerateAsync(
+ InsertionPoint insertionPoint,
+ SelectionResult selectionResult,
+ AnalyzerResult analyzerResult,
+ CancellationToken cancellationToken)
+ {
+ var codeGenerator = Create(insertionPoint, selectionResult, analyzerResult);
+ return await codeGenerator.GenerateAsync(cancellationToken).ConfigureAwait(false);
+ }
+
+ private static CSharpCodeGenerator Create(
+ InsertionPoint insertionPoint,
+ SelectionResult selectionResult,
+ AnalyzerResult analyzerResult)
+ {
+ if (ExpressionCodeGenerator.IsExtractMethodOnExpression(selectionResult))
+ {
+ return new ExpressionCodeGenerator(insertionPoint, selectionResult, analyzerResult);
+ }
+
+ if (SingleStatementCodeGenerator.IsExtractMethodOnSingleStatement(selectionResult))
+ {
+ return new SingleStatementCodeGenerator(insertionPoint, selectionResult, analyzerResult);
+ }
+
+ if (MultipleStatementsCodeGenerator.IsExtractMethodOnMultipleStatements(selectionResult))
+ {
+ return new MultipleStatementsCodeGenerator(insertionPoint, selectionResult, analyzerResult);
+ }
+
+ return null;//Contract.FailWithReturn<CSharpCodeGenerator>("Unknown selection");
+ }
+
+ protected CSharpCodeGenerator(
+ InsertionPoint insertionPoint,
+ SelectionResult selectionResult,
+ AnalyzerResult analyzerResult) :
+ base(insertionPoint, selectionResult, analyzerResult)
+ {
+ //Contract.ThrowIfFalse(this.SemanticDocument == selectionResult.SemanticDocument);
+
+ var nameToken = (SyntaxToken)CreateMethodName();
+ _methodName = nameToken.WithAdditionalAnnotations(this.MethodNameAnnotation);
+ }
+
+ private CSharpSelectionResult CSharpSelectionResult
+ {
+ get { return (CSharpSelectionResult)this.SelectionResult; }
+ }
+
+ protected override SyntaxNode GetPreviousMember(SemanticDocument document)
+ {
+ var node = this.InsertionPoint.With(document).GetContext();
+ return (node.Parent is GlobalStatementSyntax) ? node.Parent : node;
+ }
+
+ protected override OperationStatus<IMethodSymbol> GenerateMethodDefinition(CancellationToken cancellationToken)
+ {
+ var result = CreateMethodBody(cancellationToken);
+
+ var methodSymbol = CodeGenerationSymbolFactory.CreateMethodSymbol(
+ attributes: SpecializedCollections.EmptyList<AttributeData>(),
+ accessibility: Accessibility.Private,
+ modifiers: CreateMethodModifiers(),
+ returnType: this.AnalyzerResult.ReturnType,
+ explicitInterfaceSymbol: null,
+ name: _methodName.ToString(),
+ typeParameters: CreateMethodTypeParameters(cancellationToken),
+ parameters: CreateMethodParameters(),
+ statements: result.Data);
+
+ return result.With(
+ this.MethodDefinitionAnnotation.AddAnnotationToSymbol(
+ Formatter.Annotation.AddAnnotationToSymbol(methodSymbol)));
+ }
+
+ protected override async Task<SyntaxNode> GenerateBodyForCallSiteContainerAsync(CancellationToken cancellationToken)
+ {
+ var container = this.GetOutermostCallSiteContainerToProcess(cancellationToken);
+ var variableMapToRemove = CreateVariableDeclarationToRemoveMap(
+ this.AnalyzerResult.GetVariablesToMoveIntoMethodDefinition(cancellationToken), cancellationToken);
+ var firstStatementToRemove = GetFirstStatementOrInitializerSelectedAtCallSite();
+ var lastStatementToRemove = GetLastStatementOrInitializerSelectedAtCallSite();
+
+ //Contract.ThrowIfFalse(firstStatementToRemove.Parent == lastStatementToRemove.Parent);
+
+ var statementsToInsert = await CreateStatementsOrInitializerToInsertAtCallSiteAsync(cancellationToken).ConfigureAwait(false);
+
+ var callSiteGenerator =
+ new CallSiteContainerRewriter(
+ container,
+ variableMapToRemove,
+ firstStatementToRemove,
+ lastStatementToRemove,
+ statementsToInsert);
+
+ return container.CopyAnnotationsTo(callSiteGenerator.Generate()).WithAdditionalAnnotations(Formatter.Annotation);
+ }
+
+ private async Task<IEnumerable<SyntaxNode>> CreateStatementsOrInitializerToInsertAtCallSiteAsync(CancellationToken cancellationToken)
+ {
+ var selectedNode = this.GetFirstStatementOrInitializerSelectedAtCallSite();
+
+ // field initializer and constructor initializer case
+ if (selectedNode is ConstructorInitializerSyntax ||
+ selectedNode is FieldDeclarationSyntax)
+ {
+ var statement = await GetStatementOrInitializerContainingInvocationToExtractedMethodAsync(this.CallSiteAnnotation, cancellationToken).ConfigureAwait(false);
+ return SpecializedCollections.SingletonEnumerable(statement);
+ }
+
+ // regular case
+ var semanticModel = this.SemanticDocument.SemanticModel;
+ var context = this.InsertionPoint.GetContext();
+ var postProcessor = new PostProcessor(semanticModel, context.SpanStart);
+ var statements = SpecializedCollections.EmptyEnumerable<StatementSyntax>();
+
+ statements = AddSplitOrMoveDeclarationOutStatementsToCallSite(statements, cancellationToken);
+ statements = postProcessor.MergeDeclarationStatements(statements);
+ statements = AddAssignmentStatementToCallSite(statements, cancellationToken);
+ statements = await AddInvocationAtCallSiteAsync(statements, cancellationToken).ConfigureAwait(false);
+ statements = AddReturnIfUnreachable(statements, cancellationToken);
+
+ return statements;
+ }
+
+ private SimpleNameSyntax CreateMethodNameForInvocation()
+ {
+ return this.AnalyzerResult.MethodTypeParametersInDeclaration.Count == 0
+ ? (SimpleNameSyntax)SyntaxFactory.IdentifierName(_methodName)
+ : SyntaxFactory.GenericName(_methodName, SyntaxFactory.TypeArgumentList(CreateMethodCallTypeVariables()));
+ }
+
+ private SeparatedSyntaxList<TypeSyntax> CreateMethodCallTypeVariables()
+ {
+ //Contract.ThrowIfTrue(this.AnalyzerResult.MethodTypeParametersInDeclaration.Count == 0);
+
+ // propagate any type variable used in extracted code
+ var typeVariables = new List<TypeSyntax>();
+ foreach (var methodTypeParameter in this.AnalyzerResult.MethodTypeParametersInDeclaration)
+ {
+ typeVariables.Add(SyntaxFactory.ParseTypeName(methodTypeParameter.Name));
+ }
+
+ return SyntaxFactory.SeparatedList(typeVariables);
+ }
+
+ protected SyntaxNode GetCallSiteContainerFromOutermostMoveInVariable(CancellationToken cancellationToken)
+ {
+ var outmostVariable = GetOutermostVariableToMoveIntoMethodDefinition(cancellationToken);
+ if (outmostVariable == null)
+ {
+ return null;
+ }
+
+ var idToken = outmostVariable.GetIdentifierTokenAtDeclaration(this.SemanticDocument);
+ var declStatement = idToken.GetAncestor<LocalDeclarationStatementSyntax>();
+// Contract.ThrowIfNull(declStatement);
+// Contract.ThrowIfFalse(declStatement.Parent.IsStatementContainerNode());
+
+ return declStatement.Parent;
+ }
+
+ private DeclarationModifiers CreateMethodModifiers()
+ {
+ var isUnsafe = this.CSharpSelectionResult.ShouldPutUnsafeModifier();
+ var isAsync = this.CSharpSelectionResult.ShouldPutAsyncModifier();
+ var result = DeclarationModifiers.None;
+ if (isUnsafe)
+ result = result.WithIsUnsafe (true);
+ if (isAsync)
+ result = result.WithAsync (true);
+ if (!this.AnalyzerResult.UseInstanceMember)
+ result = result.WithIsStatic (true);
+ return result;
+ }
+
+ private static SyntaxKind GetParameterRefSyntaxKind(ParameterBehavior parameterBehavior)
+ {
+ return parameterBehavior == ParameterBehavior.Ref ?
+ SyntaxKind.RefKeyword :
+ parameterBehavior == ParameterBehavior.Out ?
+ SyntaxKind.OutKeyword : SyntaxKind.None;
+ }
+
+ private OperationStatus<List<SyntaxNode>> CreateMethodBody(CancellationToken cancellationToken)
+ {
+ var statements = GetInitialStatementsForMethodDefinitions();
+
+ statements = SplitOrMoveDeclarationIntoMethodDefinition(statements, cancellationToken);
+ statements = MoveDeclarationOutFromMethodDefinition(statements, cancellationToken);
+ statements = AppendReturnStatementIfNeeded(statements);
+ statements = CleanupCode(statements);
+
+ // set output so that we can use it in negative preview
+ var wrapped = WrapInCheckStatementIfNeeded(statements);
+ return CheckActiveStatements(statements).With(wrapped.ToList<SyntaxNode>());
+ }
+
+ private IEnumerable<StatementSyntax> WrapInCheckStatementIfNeeded(IEnumerable<StatementSyntax> statements)
+ {
+ var kind = this.CSharpSelectionResult.UnderCheckedStatementContext();
+ if (kind == SyntaxKind.None)
+ {
+ return statements;
+ }
+
+ if (statements.Skip(1).Any())
+ {
+ return SpecializedCollections.SingletonEnumerable<StatementSyntax>(SyntaxFactory.CheckedStatement(kind, SyntaxFactory.Block(statements)));
+ }
+
+ var block = statements.Single() as BlockSyntax;
+ if (block != null)
+ {
+ return SpecializedCollections.SingletonEnumerable<StatementSyntax>(SyntaxFactory.CheckedStatement(kind, block));
+ }
+
+ return SpecializedCollections.SingletonEnumerable<StatementSyntax>(SyntaxFactory.CheckedStatement(kind, SyntaxFactory.Block(statements)));
+ }
+
+ private IEnumerable<StatementSyntax> CleanupCode(IEnumerable<StatementSyntax> statements)
+ {
+ var semanticModel = this.SemanticDocument.SemanticModel;
+ var context = this.InsertionPoint.GetContext();
+ var postProcessor = new PostProcessor(semanticModel, context.SpanStart);
+
+ statements = postProcessor.RemoveRedundantBlock(statements);
+ statements = postProcessor.RemoveDeclarationAssignmentPattern(statements);
+ statements = postProcessor.RemoveInitializedDeclarationAndReturnPattern(statements);
+
+ return statements;
+ }
+
+ private OperationStatus CheckActiveStatements(IEnumerable<StatementSyntax> statements)
+ {
+ var count = statements.Count();
+ if (count == 0)
+ {
+ return OperationStatus.NoActiveStatement;
+ }
+
+ if (count == 1)
+ {
+ var returnStatement = statements.Single() as ReturnStatementSyntax;
+ if (returnStatement != null && returnStatement.Expression == null)
+ {
+ return OperationStatus.NoActiveStatement;
+ }
+ }
+
+ foreach (var statement in statements)
+ {
+ var declStatement = statement as LocalDeclarationStatementSyntax;
+ if (declStatement == null)
+ {
+ // found one
+ return OperationStatus.Succeeded;
+ }
+
+ foreach (var variable in declStatement.Declaration.Variables)
+ {
+ if (variable.Initializer != null)
+ {
+ // found one
+ return OperationStatus.Succeeded;
+ }
+ }
+ }
+
+ return OperationStatus.NoActiveStatement;
+ }
+
+ private IEnumerable<StatementSyntax> MoveDeclarationOutFromMethodDefinition(
+ IEnumerable<StatementSyntax> statements, CancellationToken cancellationToken)
+ {
+ var variableToRemoveMap = CreateVariableDeclarationToRemoveMap(
+ this.AnalyzerResult.GetVariablesToMoveOutToCallSiteOrDelete(cancellationToken), cancellationToken);
+
+ foreach (var statement in statements)
+ {
+ var declarationStatement = statement as LocalDeclarationStatementSyntax;
+ if (declarationStatement == null)
+ {
+ // if given statement is not decl statement, do nothing.
+ yield return statement;
+ continue;
+ }
+
+ var expressionStatements = new List<StatementSyntax>();
+ var list = new List<VariableDeclaratorSyntax>();
+ var triviaList = new List<SyntaxTrivia>();
+
+ // When we modify the declaration to an initialization we have to preserve the leading trivia
+ var firstVariableToAttachTrivia = true;
+
+ // go through each var decls in decl statement, and create new assignment if
+ // variable is initialized at decl.
+ foreach (var variableDeclaration in declarationStatement.Declaration.Variables)
+ {
+ if (variableToRemoveMap.HasSyntaxAnnotation(variableDeclaration))
+ {
+ if (variableDeclaration.Initializer != null)
+ {
+ SyntaxToken identifier = ApplyTriviaFromDeclarationToAssignmentIdentifier(declarationStatement, firstVariableToAttachTrivia, variableDeclaration);
+
+ // move comments with the variable here
+ expressionStatements.Add(CreateAssignmentExpressionStatement(identifier, variableDeclaration.Initializer.Value));
+ }
+ else
+ {
+ // we don't remove trivia around tokens we remove
+ triviaList.AddRange(variableDeclaration.GetLeadingTrivia());
+ triviaList.AddRange(variableDeclaration.GetTrailingTrivia());
+ }
+
+ firstVariableToAttachTrivia = false;
+ continue;
+ }
+
+ // Prepend the trivia from the declarations without initialization to the next persisting variable declaration
+ if (triviaList.Count > 0)
+ {
+ list.Add(variableDeclaration.WithPrependedLeadingTrivia(triviaList));
+ triviaList.Clear();
+ firstVariableToAttachTrivia = false;
+ continue;
+ }
+
+ firstVariableToAttachTrivia = false;
+ list.Add(variableDeclaration);
+ }
+
+ if (list.Count == 0 && triviaList.Count > 0)
+ {
+ // well, there are trivia associated with the node.
+ // we can't just delete the node since then, we will lose
+ // the trivia. unfortunately, it is not easy to attach the trivia
+ // to next token. for now, create an empty statement and associate the
+ // trivia to the statement
+
+ // TODO : think about a way to trivia attached to next token
+ yield return SyntaxFactory.EmptyStatement(SyntaxFactory.Token(SyntaxFactory.TriviaList(triviaList), SyntaxKind.SemicolonToken, SyntaxTriviaList.Create(SyntaxFactory.ElasticMarker)));
+ triviaList.Clear();
+ }
+
+ // return survived var decls
+ if (list.Count > 0)
+ {
+ yield return
+ SyntaxFactory.LocalDeclarationStatement(
+ declarationStatement.Modifiers,
+ SyntaxFactory.VariableDeclaration(
+ declarationStatement.Declaration.Type,
+ SyntaxFactory.SeparatedList(list)),
+ declarationStatement.SemicolonToken.WithPrependedLeadingTrivia(triviaList));
+ triviaList.Clear();
+ }
+
+ // return any expression statement if there was any
+ foreach (var expressionStatement in expressionStatements)
+ {
+ yield return expressionStatement;
+ }
+ }
+ }
+
+ private static SyntaxToken ApplyTriviaFromDeclarationToAssignmentIdentifier(LocalDeclarationStatementSyntax declarationStatement, bool firstVariableToAttachTrivia, VariableDeclaratorSyntax variable)
+ {
+ var identifier = variable.Identifier;
+ var typeSyntax = declarationStatement.Declaration.Type;
+ if (firstVariableToAttachTrivia && typeSyntax != null)
+ {
+ var identifierLeadingTrivia = new SyntaxTriviaList();
+
+ if (typeSyntax.HasLeadingTrivia)
+ {
+ identifierLeadingTrivia = identifierLeadingTrivia.AddRange(typeSyntax.GetLeadingTrivia());
+ }
+
+ identifierLeadingTrivia = identifierLeadingTrivia.AddRange(identifier.LeadingTrivia);
+ identifier = identifier.WithLeadingTrivia(identifierLeadingTrivia);
+ }
+
+ return identifier;
+ }
+
+ private static SyntaxToken GetIdentifierTokenAndTrivia(SyntaxToken identifier, TypeSyntax typeSyntax)
+ {
+ if (typeSyntax != null)
+ {
+ var identifierLeadingTrivia = new SyntaxTriviaList();
+ var identifierTrailingTrivia = new SyntaxTriviaList();
+ if (typeSyntax.HasLeadingTrivia)
+ {
+ identifierLeadingTrivia = identifierLeadingTrivia.AddRange(typeSyntax.GetLeadingTrivia());
+ }
+
+ if (typeSyntax.HasTrailingTrivia)
+ {
+ identifierLeadingTrivia = identifierLeadingTrivia.AddRange(typeSyntax.GetTrailingTrivia());
+ }
+
+ identifierLeadingTrivia = identifierLeadingTrivia.AddRange(identifier.LeadingTrivia);
+ identifierTrailingTrivia = identifierTrailingTrivia.AddRange(identifier.TrailingTrivia);
+ identifier = identifier.WithLeadingTrivia(identifierLeadingTrivia)
+ .WithTrailingTrivia(identifierTrailingTrivia);
+ }
+
+ return identifier;
+ }
+
+ private IEnumerable<StatementSyntax> SplitOrMoveDeclarationIntoMethodDefinition(
+ IEnumerable<StatementSyntax> statements,
+ CancellationToken cancellationToken)
+ {
+ var semanticModel = this.SemanticDocument.SemanticModel;
+ var context = this.InsertionPoint.GetContext();
+ var postProcessor = new PostProcessor(semanticModel, context.SpanStart);
+
+ var declStatements = CreateDeclarationStatements(AnalyzerResult.GetVariablesToSplitOrMoveIntoMethodDefinition(cancellationToken), cancellationToken);
+ declStatements = postProcessor.MergeDeclarationStatements(declStatements);
+
+ return declStatements.Concat(statements);
+ }
+
+ private ExpressionSyntax CreateAssignmentExpression(SyntaxToken identifier, ExpressionSyntax rvalue)
+ {
+ return SyntaxFactory.AssignmentExpression(
+ SyntaxKind.SimpleAssignmentExpression,
+ SyntaxFactory.IdentifierName(identifier),
+ rvalue);
+ }
+
+ protected override bool LastStatementOrHasReturnStatementInReturnableConstruct()
+ {
+ var lastStatement = this.GetLastStatementOrInitializerSelectedAtCallSite();
+ var container = lastStatement.GetAncestorsOrThis<SyntaxNode>().FirstOrDefault(n => n.IsReturnableConstruct());
+ if (container == null)
+ {
+ // case such as field initializer
+ return false;
+ }
+
+ var blockBody = container.GetBlockBody();
+ if (blockBody == null)
+ {
+ // such as expression lambda. there is no statement
+ return false;
+ }
+
+ // check whether it is last statement except return statement
+ var statements = blockBody.Statements;
+ if (statements.Last() == lastStatement)
+ {
+ return true;
+ }
+
+ var index = statements.IndexOf((StatementSyntax)lastStatement);
+ return statements[index + 1].Kind() == SyntaxKind.ReturnStatement;
+ }
+
+ protected override SyntaxToken CreateIdentifier(string name)
+ {
+ return SyntaxFactory.Identifier(name);
+ }
+
+ protected override StatementSyntax CreateReturnStatement(string identifierName = null)
+ {
+ return string.IsNullOrEmpty(identifierName)
+ ? SyntaxFactory.ReturnStatement()
+ : SyntaxFactory.ReturnStatement(SyntaxFactory.IdentifierName(identifierName));
+ }
+
+ protected override ExpressionSyntax CreateCallSignature()
+ {
+ var methodName = CreateMethodNameForInvocation().WithAdditionalAnnotations(Simplifier.Annotation);
+
+ var arguments = new List<ArgumentSyntax>();
+ foreach (var argument in this.AnalyzerResult.MethodParameters)
+ {
+ var modifier = GetParameterRefSyntaxKind(argument.ParameterModifier);
+ var refOrOut = modifier == SyntaxKind.None ? default(SyntaxToken) : SyntaxFactory.Token(modifier);
+
+ arguments.Add(SyntaxFactory.Argument(SyntaxFactory.IdentifierName(argument.Name)).WithRefOrOutKeyword(refOrOut));
+ }
+
+ var invocation = SyntaxFactory.InvocationExpression(methodName,
+ SyntaxFactory.ArgumentList(SyntaxFactory.SeparatedList(arguments)));
+
+ var shouldPutAsyncModifier = this.CSharpSelectionResult.ShouldPutAsyncModifier();
+ if (!shouldPutAsyncModifier)
+ {
+ return invocation;
+ }
+
+ return SyntaxFactory.AwaitExpression(invocation);
+ }
+
+ protected override StatementSyntax CreateAssignmentExpressionStatement(SyntaxToken identifier, ExpressionSyntax rvalue)
+ {
+ return SyntaxFactory.ExpressionStatement(CreateAssignmentExpression((SyntaxToken)identifier, rvalue));
+ }
+
+ protected override StatementSyntax CreateDeclarationStatement(
+ VariableInfo variable,
+ CancellationToken cancellationToken,
+ ExpressionSyntax initialValue = null)
+ {
+ var type = variable.GetVariableType(this.SemanticDocument);
+ var typeNode = type.GenerateTypeSyntax();
+
+ var equalsValueClause = initialValue == null ? null : SyntaxFactory.EqualsValueClause(value: initialValue);
+
+ return SyntaxFactory.LocalDeclarationStatement(
+ SyntaxFactory.VariableDeclaration(typeNode)
+ .AddVariables(SyntaxFactory.VariableDeclarator(SyntaxFactory.Identifier(variable.Name)).WithInitializer(equalsValueClause)));
+ }
+
+ protected override async Task<GeneratedCode> CreateGeneratedCodeAsync(OperationStatus status, SemanticDocument newDocument, CancellationToken cancellationToken)
+ {
+ if (status.Succeeded())
+ {
+ // in hybrid code cases such as extract method, formatter will have some difficulties on where it breaks lines in two.
+ // here, we explicitly insert newline at the end of "{" of auto generated method decl so that anchor knows how to find out
+ // indentation of inserted statements (from users code) with user code style preserved
+ var root = newDocument.Root;
+ var methodDefinition = root.GetAnnotatedNodes<MethodDeclarationSyntax>(this.MethodDefinitionAnnotation).First();
+
+ var newMethodDefinition =
+ methodDefinition.ReplaceToken(
+ methodDefinition.Body.OpenBraceToken,
+ methodDefinition.Body.OpenBraceToken.WithAppendedTrailingTrivia(
+ SpecializedCollections.SingletonEnumerable(SyntaxFactory.CarriageReturnLineFeed)));
+
+ newDocument = await newDocument.WithSyntaxRootAsync(root.ReplaceNode(methodDefinition, newMethodDefinition), cancellationToken).ConfigureAwait(false);
+ }
+
+ return await base.CreateGeneratedCodeAsync(status, newDocument, cancellationToken).ConfigureAwait(false);
+ }
+
+ protected StatementSyntax GetStatementContainingInvocationToExtractedMethodWorker()
+ {
+ var callSignature = CreateCallSignature();
+
+ if (this.AnalyzerResult.HasReturnType)
+ {
+ //Contract.ThrowIfTrue(this.AnalyzerResult.HasVariableToUseAsReturnValue);
+ return SyntaxFactory.ReturnStatement(callSignature);
+ }
+
+ return SyntaxFactory.ExpressionStatement(callSignature);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.FormattingProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.FormattingProvider.cs
new file mode 100644
index 0000000000..34cc3caa41
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.FormattingProvider.cs
@@ -0,0 +1,66 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis.Formatting.Rules;
+using Microsoft.CodeAnalysis.Options;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ partial class CSharpMethodExtractor : MethodExtractor
+ {
+// private class FormattingRule : AbstractFormattingRule
+// {
+// public FormattingRule()
+// {
+// }
+//
+// public override AdjustNewLinesOperation GetAdjustNewLinesOperation(SyntaxToken previousToken, SyntaxToken currentToken, OptionSet optionSet, NextOperation<AdjustNewLinesOperation> nextOperation)
+// {
+// // for extract method case, for a hybrid case, don't force rule, but preserve user style
+// var operation = base.GetAdjustNewLinesOperation(previousToken, currentToken, optionSet, nextOperation);
+// if (operation == null)
+// {
+// return null;
+// }
+//
+// if (operation.Option == AdjustNewLinesOption.ForceLinesIfOnSingleLine)
+// {
+// return FormattingOperations.CreateAdjustNewLinesOperation(operation.Line, AdjustNewLinesOption.PreserveLines);
+// }
+//
+// if (operation.Option != AdjustNewLinesOption.ForceLines)
+// {
+// return operation;
+// }
+//
+// if (previousToken.RawKind == (int)SyntaxKind.OpenBraceToken)
+// {
+// return operation;
+// }
+//
+// if (previousToken.BetweenFieldAndNonFieldMember(currentToken))
+// {
+// // make sure to have at least 2 line breaks between field and other members except field
+// return FormattingOperations.CreateAdjustNewLinesOperation(2, AdjustNewLinesOption.PreserveLines);
+// }
+//
+// if (previousToken.HasHybridTriviaBetween(currentToken))
+// {
+// return FormattingOperations.CreateAdjustNewLinesOperation(operation.Line, AdjustNewLinesOption.PreserveLines);
+// }
+//
+// return operation;
+// }
+//
+// public override void AddAnchorIndentationOperations(List<AnchorIndentationOperation> list, SyntaxNode node, OptionSet optionSet, NextAction<AnchorIndentationOperation> nextOperation)
+// {
+// if (node.IsKind(SyntaxKind.SimpleLambdaExpression) || node.IsKind(SyntaxKind.ParenthesizedLambdaExpression) || node.IsKind(SyntaxKind.AnonymousMethodExpression))
+// {
+// return;
+// }
+//
+// nextOperation.Invoke(list);
+// }
+// }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.PostProcessor.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.PostProcessor.cs
new file mode 100644
index 0000000000..4c4a49d088
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.PostProcessor.cs
@@ -0,0 +1,314 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ partial class CSharpMethodExtractor
+ {
+ private class PostProcessor
+ {
+ private readonly SemanticModel _semanticModel;
+ private readonly int _contextPosition;
+
+ public PostProcessor(SemanticModel semanticModel, int contextPosition)
+ {
+ //Contract.ThrowIfNull(semanticModel);
+
+ _semanticModel = semanticModel;
+ _contextPosition = contextPosition;
+ }
+
+ public IEnumerable<StatementSyntax> RemoveRedundantBlock(IEnumerable<StatementSyntax> statements)
+ {
+ // it must have only one statement
+ if (statements.Count() != 1)
+ {
+ return statements;
+ }
+
+ // that statement must be a block
+ var block = statements.Single() as BlockSyntax;
+ if (block == null)
+ {
+ return statements;
+ }
+
+ // we have a block, remove them
+ return RemoveRedundantBlock(block);
+ }
+
+ private IEnumerable<StatementSyntax> RemoveRedundantBlock(BlockSyntax block)
+ {
+ // if block doesn't have any statement
+ if (block.Statements.Count == 0)
+ {
+ // either remove the block if it doesn't have any trivia, or return as it is if
+ // there are trivia attached to block
+ return (block.OpenBraceToken.GetAllTrivia().IsEmpty() && block.CloseBraceToken.GetAllTrivia().IsEmpty()) ?
+ SpecializedCollections.EmptyEnumerable<StatementSyntax>() : SpecializedCollections.SingletonEnumerable<StatementSyntax>(block);
+ }
+
+ // okay transfer asset attached to block to statements
+ var firstStatement = block.Statements.First();
+ var firstToken = firstStatement.GetFirstToken(includeZeroWidth: true);
+ var firstTokenWithAsset = block.OpenBraceToken.CopyAnnotationsTo(firstToken).WithPrependedLeadingTrivia(block.OpenBraceToken.GetAllTrivia());
+
+ var lastStatement = block.Statements.Last();
+ var lastToken = lastStatement.GetLastToken(includeZeroWidth: true);
+ var lastTokenWithAsset = block.CloseBraceToken.CopyAnnotationsTo(lastToken).WithAppendedTrailingTrivia(block.CloseBraceToken.GetAllTrivia());
+
+ // create new block with new tokens
+ block = block.ReplaceTokens(new[] { firstToken, lastToken }, (o, c) => (o == firstToken) ? firstTokenWithAsset : lastTokenWithAsset);
+
+ // return only statements without the wrapping block
+ return block.Statements;
+ }
+
+ public IEnumerable<StatementSyntax> MergeDeclarationStatements(IEnumerable<StatementSyntax> statements)
+ {
+ if (statements.FirstOrDefault() == null)
+ {
+ return statements;
+ }
+
+ return MergeDeclarationStatementsWorker(statements);
+ }
+
+ private IEnumerable<StatementSyntax> MergeDeclarationStatementsWorker(IEnumerable<StatementSyntax> statements)
+ {
+ var map = new Dictionary<ITypeSymbol, List<LocalDeclarationStatementSyntax>>();
+ foreach (var statement in statements)
+ {
+ if (!IsDeclarationMergable(statement))
+ {
+ foreach (var declStatement in GetMergedDeclarationStatements(map))
+ {
+ yield return declStatement;
+ }
+
+ yield return statement;
+ continue;
+ }
+
+ AppendDeclarationStatementToMap(statement as LocalDeclarationStatementSyntax, map);
+ }
+
+ // merge leftover
+ if (map.Count <= 0)
+ {
+ yield break;
+ }
+
+ foreach (var declStatement in GetMergedDeclarationStatements(map))
+ {
+ yield return declStatement;
+ }
+ }
+
+ private void AppendDeclarationStatementToMap(
+ LocalDeclarationStatementSyntax statement,
+ Dictionary<ITypeSymbol, List<LocalDeclarationStatementSyntax>> map)
+ {
+ // Contract.ThrowIfNull(statement);
+
+ var type = _semanticModel.GetSpeculativeTypeInfo(_contextPosition, statement.Declaration.Type, SpeculativeBindingOption.BindAsTypeOrNamespace).Type;
+ //Contract.ThrowIfNull(type);
+
+ map.GetOrAdd(type, _ => new List<LocalDeclarationStatementSyntax>()).Add(statement);
+ }
+
+ private IEnumerable<LocalDeclarationStatementSyntax> GetMergedDeclarationStatements(
+ Dictionary<ITypeSymbol, List<LocalDeclarationStatementSyntax>> map)
+ {
+ foreach (var keyValuePair in map)
+ {
+ //Contract.ThrowIfFalse(keyValuePair.Value.Count > 0);
+
+ // merge all variable decl for current type
+ var variables = new List<VariableDeclaratorSyntax>();
+ foreach (var statement in keyValuePair.Value)
+ {
+ foreach (var variable in statement.Declaration.Variables)
+ {
+ variables.Add(variable);
+ }
+ }
+
+ // and create one decl statement
+ // use type name from the first decl statement
+ yield return
+ SyntaxFactory.LocalDeclarationStatement(
+ SyntaxFactory.VariableDeclaration(keyValuePair.Value.First().Declaration.Type, SyntaxFactory.SeparatedList(variables)));
+ }
+
+ map.Clear();
+ }
+
+ private bool IsDeclarationMergable(StatementSyntax statement)
+ {
+ //Contract.ThrowIfNull(statement);
+
+ // to be mergable, statement must be
+ // 1. decl statement without any extra info
+ // 2. no initialization on any of its decls
+ // 3. no trivia except whitespace
+ // 4. type must be known
+
+ var declarationStatement = statement as LocalDeclarationStatementSyntax;
+ if (declarationStatement == null)
+ {
+ return false;
+ }
+
+ if (declarationStatement.Modifiers.Count > 0 ||
+ declarationStatement.IsConst ||
+ declarationStatement.IsMissing)
+ {
+ return false;
+ }
+
+ if (ContainsAnyInitialization(declarationStatement))
+ {
+ return false;
+ }
+
+ if (!ContainsOnlyWhitespaceTrivia(declarationStatement))
+ {
+ return false;
+ }
+
+ var semanticInfo = _semanticModel.GetSpeculativeTypeInfo(_contextPosition, declarationStatement.Declaration.Type, SpeculativeBindingOption.BindAsTypeOrNamespace).Type;
+ if (semanticInfo == null ||
+ semanticInfo.TypeKind == TypeKind.Error ||
+ semanticInfo.TypeKind == TypeKind.Unknown)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ private bool ContainsAnyInitialization(LocalDeclarationStatementSyntax statement)
+ {
+ foreach (var variable in statement.Declaration.Variables)
+ {
+ if (variable.Initializer != null)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private static bool ContainsOnlyWhitespaceTrivia(StatementSyntax statement)
+ {
+ foreach (var token in statement.DescendantTokens())
+ {
+ foreach (var trivia in token.LeadingTrivia.Concat(token.TrailingTrivia))
+ {
+ if (trivia.Kind() != SyntaxKind.WhitespaceTrivia &&
+ trivia.Kind() != SyntaxKind.EndOfLineTrivia)
+ {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ public IEnumerable<StatementSyntax> RemoveInitializedDeclarationAndReturnPattern(IEnumerable<StatementSyntax> statements)
+ {
+ // if we have inline temp variable as service, we could just use that service here.
+ // since it is not a service right now, do very simple clean up
+ if (statements.ElementAtOrDefault(2) != null)
+ {
+ return statements;
+ }
+
+ var declaration = statements.ElementAtOrDefault(0) as LocalDeclarationStatementSyntax;
+ var returnStatement = statements.ElementAtOrDefault(1) as ReturnStatementSyntax;
+ if (declaration == null || returnStatement == null)
+ {
+ return statements;
+ }
+
+ if (declaration.Declaration == null ||
+ declaration.Declaration.Variables.Count != 1 ||
+ declaration.Declaration.Variables[0].Initializer == null ||
+ declaration.Declaration.Variables[0].Initializer.Value == null ||
+ declaration.Declaration.Variables[0].Initializer.Value is StackAllocArrayCreationExpressionSyntax ||
+ returnStatement.Expression == null)
+ {
+ return statements;
+ }
+
+ if (!ContainsOnlyWhitespaceTrivia(declaration) ||
+ !ContainsOnlyWhitespaceTrivia(returnStatement))
+ {
+ return statements;
+ }
+
+ var variableName = declaration.Declaration.Variables[0].Identifier.ToString();
+ if (returnStatement.Expression.ToString() != variableName)
+ {
+ return statements;
+ }
+
+ return SpecializedCollections.SingletonEnumerable<StatementSyntax>(SyntaxFactory.ReturnStatement(declaration.Declaration.Variables[0].Initializer.Value));
+ }
+
+ public IEnumerable<StatementSyntax> RemoveDeclarationAssignmentPattern(IEnumerable<StatementSyntax> statements)
+ {
+ // if we have inline temp variable as service, we could just use that service here.
+ // since it is not a service right now, do very simple clean up
+ var declaration = statements.ElementAtOrDefault(0) as LocalDeclarationStatementSyntax;
+ var assignment = statements.ElementAtOrDefault(1) as ExpressionStatementSyntax;
+ if (declaration == null || assignment == null)
+ {
+ return statements;
+ }
+
+ if (ContainsAnyInitialization(declaration) ||
+ declaration.Declaration == null ||
+ declaration.Declaration.Variables.Count != 1 ||
+ assignment.Expression == null ||
+ assignment.Expression.Kind() != SyntaxKind.SimpleAssignmentExpression)
+ {
+ return statements;
+ }
+
+ if (!ContainsOnlyWhitespaceTrivia(declaration) ||
+ !ContainsOnlyWhitespaceTrivia(assignment))
+ {
+ return statements;
+ }
+
+ var variableName = declaration.Declaration.Variables[0].Identifier.ToString();
+
+ var assignmentExpression = assignment.Expression as AssignmentExpressionSyntax;
+ if (assignmentExpression.Left == null ||
+ assignmentExpression.Right == null ||
+ assignmentExpression.Left.ToString() != variableName)
+ {
+ return statements;
+ }
+
+ var variable = declaration.Declaration.Variables[0].WithInitializer(SyntaxFactory.EqualsValueClause(assignmentExpression.Right));
+ return SpecializedCollections.SingletonEnumerable<StatementSyntax>(
+ declaration.WithDeclaration(
+ declaration.Declaration.WithVariables(
+ SyntaxFactory.SingletonSeparatedList(variable)))).Concat(statements.Skip(2));
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.TriviaResult.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.TriviaResult.cs
new file mode 100644
index 0000000000..524acb5fb2
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.TriviaResult.cs
@@ -0,0 +1,161 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ partial class CSharpMethodExtractor
+ {
+ private class CSharpTriviaResult : TriviaResult
+ {
+ public static async Task<CSharpTriviaResult> ProcessAsync(SelectionResult selectionResult, CancellationToken cancellationToken)
+ {
+ var preservationService = new CSharpSyntaxTriviaService ();
+ var root = selectionResult.SemanticDocument.Root;
+ var result = preservationService.SaveTriviaAroundSelection(root, selectionResult.FinalSpan);
+ return new CSharpTriviaResult(
+ await selectionResult.SemanticDocument.WithSyntaxRootAsync(result.Root, cancellationToken).ConfigureAwait(false),
+ result);
+ }
+
+ private CSharpTriviaResult(SemanticDocument document, ITriviaSavedResult result) :
+ base(document, result, (int)SyntaxKind.EndOfLineTrivia, (int)SyntaxKind.WhitespaceTrivia)
+ {
+ }
+
+ protected override AnnotationResolver GetAnnotationResolver(SyntaxNode callsite, SyntaxNode method)
+ {
+ var methodDefinition = method as MethodDeclarationSyntax;
+ if (callsite == null || methodDefinition == null)
+ {
+ return null;
+ }
+
+ return (node, location, annotation) => AnnotationResolver(node, location, annotation, callsite, methodDefinition);
+ }
+
+ protected override TriviaResolver GetTriviaResolver(SyntaxNode method)
+ {
+ var methodDefinition = method as MethodDeclarationSyntax;
+ if (methodDefinition == null)
+ {
+ return null;
+ }
+
+ return (location, tokenPair, triviaMap) => TriviaResolver(location, tokenPair, triviaMap, methodDefinition);
+ }
+
+ private SyntaxToken AnnotationResolver(
+ SyntaxNode node,
+ TriviaLocation location,
+ SyntaxAnnotation annotation,
+ SyntaxNode callsite,
+ MethodDeclarationSyntax method)
+ {
+ var token = node.GetAnnotatedNodesAndTokens(annotation).FirstOrDefault().AsToken();
+ if (token.RawKind != 0)
+ {
+ return token;
+ }
+
+ switch (location)
+ {
+ case TriviaLocation.BeforeBeginningOfSpan:
+ return callsite.GetFirstToken(includeZeroWidth: true).GetPreviousToken(includeZeroWidth: true);
+ case TriviaLocation.AfterEndOfSpan:
+ return callsite.GetLastToken(includeZeroWidth: true).GetNextToken(includeZeroWidth: true);
+ case TriviaLocation.AfterBeginningOfSpan:
+ return method.Body.OpenBraceToken.GetNextToken(includeZeroWidth: true);
+ case TriviaLocation.BeforeEndOfSpan:
+ return method.Body.CloseBraceToken.GetPreviousToken(includeZeroWidth: true);
+ }
+
+ return token; //Contract.FailWithReturn<SyntaxToken>("can't happen");
+ }
+
+ private IEnumerable<SyntaxTrivia> TriviaResolver(
+ TriviaLocation location,
+ PreviousNextTokenPair tokenPair,
+ Dictionary<SyntaxToken, LeadingTrailingTriviaPair> triviaMap,
+ MethodDeclarationSyntax method)
+ {
+ // Resolve trivia at the edge of the selection. simple case is easy to deal with, but complex cases where
+ // elastic trivia and user trivia are mixed (hybrid case) and we want to preserve some part of user coding style
+ // but not others can be dealt with here.
+
+ // method has no statement in them. so basically two trivia list now pointing to same thing. "{" and "}"
+ if (tokenPair.PreviousToken == method.Body.OpenBraceToken &&
+ tokenPair.NextToken == method.Body.CloseBraceToken)
+ {
+ return (location == TriviaLocation.AfterBeginningOfSpan) ?
+ SpecializedCollections.SingletonEnumerable<SyntaxTrivia>(SyntaxFactory.ElasticMarker) :
+ SpecializedCollections.EmptyEnumerable<SyntaxTrivia>();
+ }
+
+ var previousTriviaPair = triviaMap.ContainsKey(tokenPair.PreviousToken) ? triviaMap[tokenPair.PreviousToken] : default(LeadingTrailingTriviaPair);
+ var nextTriviaPair = triviaMap.ContainsKey(tokenPair.NextToken) ? triviaMap[tokenPair.NextToken] : default(LeadingTrailingTriviaPair);
+
+ var trailingTrivia = previousTriviaPair.TrailingTrivia ?? SpecializedCollections.EmptyEnumerable<SyntaxTrivia>();
+ var leadingTrivia = nextTriviaPair.LeadingTrivia ?? SpecializedCollections.EmptyEnumerable<SyntaxTrivia>();
+
+ var list = trailingTrivia.Concat(leadingTrivia);
+
+ switch (location)
+ {
+ case TriviaLocation.BeforeBeginningOfSpan:
+ return FilterBeforeBeginningOfSpan(tokenPair, list);
+ case TriviaLocation.AfterEndOfSpan:
+ return FilterTriviaList(list.Concat(tokenPair.NextToken.LeadingTrivia));
+ case TriviaLocation.AfterBeginningOfSpan:
+ return FilterTriviaList(AppendTrailingTrivia(tokenPair).Concat(list).Concat(tokenPair.NextToken.LeadingTrivia));
+ case TriviaLocation.BeforeEndOfSpan:
+ return FilterTriviaList(tokenPair.PreviousToken.TrailingTrivia.Concat(list).Concat(tokenPair.NextToken.LeadingTrivia));
+ }
+
+ return null;//Contract.FailWithReturn<IEnumerable<SyntaxTrivia>>("Shouldn't reach here");
+ }
+
+ private IEnumerable<SyntaxTrivia> FilterBeforeBeginningOfSpan(PreviousNextTokenPair tokenPair, IEnumerable<SyntaxTrivia> list)
+ {
+ var allList = FilterTriviaList(tokenPair.PreviousToken.TrailingTrivia.Concat(list).Concat(AppendLeadingTrivia(tokenPair)));
+
+ if (tokenPair.PreviousToken.RawKind == (int)SyntaxKind.OpenBraceToken)
+ {
+ return RemoveBlankLines(allList);
+ }
+
+ return allList;
+ }
+
+ private IEnumerable<SyntaxTrivia> AppendLeadingTrivia(PreviousNextTokenPair tokenPair)
+ {
+ if (tokenPair.PreviousToken.RawKind == (int)SyntaxKind.OpenBraceToken ||
+ tokenPair.PreviousToken.RawKind == (int)SyntaxKind.SemicolonToken)
+ {
+ return tokenPair.NextToken.LeadingTrivia;
+ }
+
+ return SpecializedCollections.EmptyEnumerable<SyntaxTrivia>();
+ }
+
+ private IEnumerable<SyntaxTrivia> AppendTrailingTrivia(PreviousNextTokenPair tokenPair)
+ {
+ if (tokenPair.PreviousToken.RawKind == (int)SyntaxKind.OpenBraceToken ||
+ tokenPair.PreviousToken.RawKind == (int)SyntaxKind.SemicolonToken)
+ {
+ return tokenPair.PreviousToken.TrailingTrivia;
+ }
+
+ return SpecializedCollections.EmptyEnumerable<SyntaxTrivia>();
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.cs
new file mode 100644
index 0000000000..216915c21d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpMethodExtractor.cs
@@ -0,0 +1,128 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Formatting.Rules;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Simplification;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ partial class CSharpMethodExtractor : MethodExtractor
+ {
+ public CSharpMethodExtractor(CSharpSelectionResult result) :
+ base(result)
+ {
+ }
+
+ protected override Task<AnalyzerResult> AnalyzeAsync(SelectionResult selectionResult, CancellationToken cancellationToken)
+ {
+ return CSharpAnalyzer.AnalyzeAsync(selectionResult, cancellationToken);
+ }
+
+ protected override async Task<InsertionPoint> GetInsertionPointAsync(SemanticDocument document, int position, CancellationToken cancellationToken)
+ {
+ //Contract.ThrowIfFalse(position >= 0);
+
+ var root = await document.Document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ var basePosition = root.FindToken(position);
+
+ var memberNode = basePosition.GetAncestor<MemberDeclarationSyntax>();
+// Contract.ThrowIfNull(memberNode);
+// Contract.ThrowIfTrue(memberNode.Kind() == SyntaxKind.NamespaceDeclaration);
+
+ var globalStatement = memberNode as GlobalStatementSyntax;
+ if (globalStatement != null)
+ {
+ // check whether we are extracting whole global statement out
+ if (this.OriginalSelectionResult.FinalSpan.Contains(memberNode.Span))
+ {
+ return await InsertionPoint.CreateAsync(document, globalStatement.Parent, cancellationToken).ConfigureAwait(false);
+ }
+
+ return await InsertionPoint.CreateAsync(document, globalStatement.Statement, cancellationToken).ConfigureAwait(false);
+ }
+
+ return await InsertionPoint.CreateAsync(document, memberNode, cancellationToken).ConfigureAwait(false);
+ }
+
+ protected override async Task<TriviaResult> PreserveTriviaAsync(SelectionResult selectionResult, CancellationToken cancellationToken)
+ {
+ return await CSharpTriviaResult.ProcessAsync(selectionResult, cancellationToken).ConfigureAwait(false);
+ }
+
+ protected override async Task<SemanticDocument> ExpandAsync(SelectionResult selection, CancellationToken cancellationToken)
+ {
+ var lastExpression = selection.GetFirstTokenInSelection().GetCommonRoot(selection.GetLastTokenInSelection()).GetAncestors<ExpressionSyntax>().LastOrDefault();
+ if (lastExpression == null)
+ {
+ return selection.SemanticDocument;
+ }
+
+ var newExpression = await Simplifier.ExpandAsync(lastExpression, selection.SemanticDocument.Document, n => n != selection.GetContainingScope(), expandParameter: false, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return await selection.SemanticDocument.WithSyntaxRootAsync(selection.SemanticDocument.Root.ReplaceNode(lastExpression, newExpression), cancellationToken).ConfigureAwait(false);
+ }
+
+ protected override Task<MethodExtractor.GeneratedCode> GenerateCodeAsync(InsertionPoint insertionPoint, SelectionResult selectionResult, AnalyzerResult analyzeResult, CancellationToken cancellationToken)
+ {
+ return CSharpCodeGenerator.GenerateAsync(insertionPoint, selectionResult, analyzeResult, cancellationToken);
+ }
+
+// protected override IEnumerable<IFormattingRule> GetFormattingRules(Document document)
+// {
+// return SpecializedCollections.SingletonEnumerable(new FormattingRule()).Concat(Formatter.GetDefaultFormattingRules(document));
+// }
+
+ protected override SyntaxToken GetMethodNameAtInvocation(IEnumerable<SyntaxNodeOrToken> methodNames)
+ {
+ return (SyntaxToken)methodNames.FirstOrDefault(t => !t.Parent.IsKind(SyntaxKind.MethodDeclaration));
+ }
+
+ protected override async Task<OperationStatus> CheckTypeAsync(
+ Document document,
+ SyntaxNode contextNode,
+ Location location,
+ ITypeSymbol type,
+ CancellationToken cancellationToken)
+ {
+ //Contract.ThrowIfNull(type);
+
+ // this happens when there is no return type
+ if (type.SpecialType == SpecialType.System_Void)
+ {
+ return OperationStatus.Succeeded;
+ }
+
+ if (type.TypeKind == TypeKind.Error ||
+ type.TypeKind == TypeKind.Unknown)
+ {
+ return OperationStatus.ErrorOrUnknownType;
+ }
+
+ // if it is type parameter, make sure we are getting same type parameter
+ var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+
+ foreach (var typeParameter in TypeParameterCollector.Collect(type))
+ {
+ var typeName = SyntaxFactory.ParseTypeName(typeParameter.Name);
+ var currentType = semanticModel.GetSpeculativeTypeInfo(contextNode.SpanStart, typeName, SpeculativeBindingOption.BindAsTypeOrNamespace).Type;
+ if (currentType == null || !currentType.Equals(typeParameter))
+ {
+ return new OperationStatus(OperationStatusFlag.BestEffort,
+ string.Format("FeaturesResources.TypeParameterIsHiddenByAnother",
+ typeParameter.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat),
+ currentType == null ? string.Empty : currentType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)));
+ }
+ }
+
+ return OperationStatus.Succeeded;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSelectionResult.ExpressionResult.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSelectionResult.ExpressionResult.cs
new file mode 100644
index 0000000000..20c6abc55c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSelectionResult.ExpressionResult.cs
@@ -0,0 +1,140 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ partial class CSharpSelectionResult
+ {
+ private class ExpressionResult : CSharpSelectionResult
+ {
+ public ExpressionResult(
+ OperationStatus status,
+ TextSpan originalSpan,
+ TextSpan finalSpan,
+ OptionSet options,
+ bool selectionInExpression,
+ SemanticDocument document,
+ SyntaxAnnotation firstTokenAnnotation,
+ SyntaxAnnotation lastTokenAnnotation) :
+ base(status, originalSpan, finalSpan, options, selectionInExpression, document, firstTokenAnnotation, lastTokenAnnotation)
+ {
+ }
+
+ public override bool ContainingScopeHasAsyncKeyword()
+ {
+ return false;
+ }
+
+ public override SyntaxNode GetContainingScope()
+ {
+// Contract.ThrowIfNull(this.SemanticDocument);
+// Contract.ThrowIfFalse(this.SelectionInExpression);
+
+ var firstToken = this.GetFirstTokenInSelection();
+ var lastToken = this.GetLastTokenInSelection();
+ return firstToken.GetCommonRoot(lastToken).GetAncestorOrThis<ExpressionSyntax>();
+ }
+
+ public override ITypeSymbol GetContainingScopeType()
+ {
+ var node = this.GetContainingScope();
+ var model = this.SemanticDocument.SemanticModel;
+
+ if (!node.IsExpression())
+ {
+ // Contract.Fail("this shouldn't happen");
+ return null;
+ }
+
+ // special case for array initializer and explict cast
+ if (node.IsArrayInitializer())
+ {
+ var variableDeclExpression = node.GetAncestorOrThis<VariableDeclarationSyntax>();
+ if (variableDeclExpression != null)
+ {
+ return model.GetTypeInfo(variableDeclExpression.Type).Type;
+ }
+ }
+
+ if (node.IsExpressionInCast())
+ {
+ // bug # 12774 and # 4780
+ // if the expression is under cast, we use the heuristic below
+ // 1. if regular binding returns a meaningful type, we use it as it is
+ // 2. if it doesn't, even if the cast itself wasn't included in the selection, we will treat it
+ // as it was in the selection
+ var regularType = GetRegularExpressionType(model, node);
+ if (regularType != null && !regularType.IsObjectType())
+ {
+ return regularType;
+ }
+
+ var castExpression = node.Parent as CastExpressionSyntax;
+ if (castExpression != null)
+ {
+ return model.GetTypeInfo(castExpression.Type).Type;
+ }
+ }
+
+ return GetRegularExpressionType(model, node);
+ }
+
+ private static ITypeSymbol GetRegularExpressionType(SemanticModel semanticModel, SyntaxNode node)
+ {
+ // regular case. always use ConvertedType to get implicit conversion right.
+ var expression = node.GetUnparenthesizedExpression();
+
+ var info = semanticModel.GetTypeInfo(expression);
+ var conv = semanticModel.GetConversion(expression);
+
+ if (info.ConvertedType == null || info.ConvertedType.IsErrorType())
+ {
+ // there is no implicit conversion involved. no need to go further
+ return info.Type;
+ }
+
+ // always use converted type if method group
+ if ((!node.IsKind(SyntaxKind.ObjectCreationExpression) && semanticModel.GetMemberGroup(expression).Length > 0) ||
+ IsCoClassImplicitConversion(info, conv, semanticModel.Compilation.CoClassType()))
+ {
+ return info.ConvertedType;
+ }
+
+ // check implicit conversion
+ if (conv.IsImplicit && (conv.IsConstantExpression || conv.IsEnumeration))
+ {
+ return info.ConvertedType;
+ }
+
+ // always try to use type that is more specific than object type if possible.
+ return !info.Type.IsObjectType() ? info.Type : info.ConvertedType;
+ }
+ }
+
+ private static bool IsCoClassImplicitConversion(TypeInfo info, Conversion conversion, ISymbol coclassSymbol)
+ {
+ if (!conversion.IsImplicit ||
+ info.ConvertedType == null ||
+ info.ConvertedType.TypeKind != TypeKind.Interface)
+ {
+ return false;
+ }
+
+ // let's see whether this interface has coclass attribute
+ return info.ConvertedType.GetAttributes().Any(c => c.AttributeClass.Equals(coclassSymbol));
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSelectionResult.StatementResult.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSelectionResult.StatementResult.cs
new file mode 100644
index 0000000000..3f22c7c35d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSelectionResult.StatementResult.cs
@@ -0,0 +1,88 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ partial class CSharpSelectionResult
+ {
+ private class StatementResult : CSharpSelectionResult
+ {
+ public StatementResult(
+ OperationStatus status,
+ TextSpan originalSpan,
+ TextSpan finalSpan,
+ OptionSet options,
+ bool selectionInExpression,
+ SemanticDocument document,
+ SyntaxAnnotation firstTokenAnnotation,
+ SyntaxAnnotation lastTokenAnnotation) :
+ base(status, originalSpan, finalSpan, options, selectionInExpression, document, firstTokenAnnotation, lastTokenAnnotation)
+ {
+ }
+
+ public override bool ContainingScopeHasAsyncKeyword()
+ {
+ var node = this.GetContainingScope();
+ //var semanticModel = this.SemanticDocument.SemanticModel;
+
+ return node.TypeSwitch(
+ (AccessorDeclarationSyntax access) => false,
+ (MethodDeclarationSyntax method) => method.Modifiers.Any(SyntaxKind.AsyncKeyword),
+ (ParenthesizedLambdaExpressionSyntax lambda) => lambda.AsyncKeyword.Kind() == SyntaxKind.AsyncKeyword,
+ (SimpleLambdaExpressionSyntax lambda) => lambda.AsyncKeyword.Kind() == SyntaxKind.AsyncKeyword,
+ (AnonymousMethodExpressionSyntax anonymous) => anonymous.AsyncKeyword.Kind() == SyntaxKind.AsyncKeyword);
+ }
+
+ public override SyntaxNode GetContainingScope()
+ {
+// Contract.ThrowIfNull(this.SemanticDocument);
+// Contract.ThrowIfTrue(this.SelectionInExpression);
+
+ // it contains statements
+ var firstToken = this.GetFirstTokenInSelection();
+ return firstToken.GetAncestors<SyntaxNode>().FirstOrDefault(n =>
+ {
+ return n is BaseMethodDeclarationSyntax ||
+ n is AccessorDeclarationSyntax ||
+ n is ParenthesizedLambdaExpressionSyntax ||
+ n is SimpleLambdaExpressionSyntax ||
+ n is AnonymousMethodExpressionSyntax ||
+ n is CompilationUnitSyntax;
+ });
+ }
+
+ public override ITypeSymbol GetContainingScopeType()
+ {
+ //Contract.ThrowIfTrue(this.SelectionInExpression);
+
+ var node = this.GetContainingScope();
+ var semanticModel = this.SemanticDocument.SemanticModel;
+
+ return node.TypeSwitch(
+ (AccessorDeclarationSyntax access) =>
+ {
+ // property case
+ if (access.Parent == null || access.Parent.Parent == null)
+ {
+ return null;
+ }
+
+ return ((IPropertySymbol)semanticModel.GetDeclaredSymbol(access.Parent.Parent)).Type;
+ },
+ (MethodDeclarationSyntax method) => ((IMethodSymbol)semanticModel.GetDeclaredSymbol(method)).ReturnType,
+ (ParenthesizedLambdaExpressionSyntax lambda) => semanticModel.GetLambdaOrAnonymousMethodReturnType(lambda),
+ (SimpleLambdaExpressionSyntax lambda) => semanticModel.GetLambdaOrAnonymousMethodReturnType(lambda),
+ (AnonymousMethodExpressionSyntax anonymous) => semanticModel.GetLambdaOrAnonymousMethodReturnType(anonymous));
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSelectionResult.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSelectionResult.cs
new file mode 100644
index 0000000000..5709e1b139
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSelectionResult.cs
@@ -0,0 +1,207 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ abstract partial class CSharpSelectionResult : SelectionResult
+ {
+ public static async Task<CSharpSelectionResult> CreateAsync(
+ OperationStatus status,
+ TextSpan originalSpan,
+ TextSpan finalSpan,
+ OptionSet options,
+ bool selectionInExpression,
+ SemanticDocument document,
+ SyntaxToken firstToken,
+ SyntaxToken lastToken,
+ CancellationToken cancellationToken)
+ {
+// Contract.ThrowIfNull(status);
+// Contract.ThrowIfNull(document);
+
+ var firstTokenAnnotation = new SyntaxAnnotation();
+ var lastTokenAnnotation = new SyntaxAnnotation();
+
+ var root = await document.Document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ var newDocument = await SemanticDocument.CreateAsync(document.Document.WithSyntaxRoot(root.AddAnnotations(
+ new[]
+ {
+ Tuple.Create<SyntaxToken, SyntaxAnnotation>(firstToken, firstTokenAnnotation),
+ Tuple.Create<SyntaxToken, SyntaxAnnotation>(lastToken, lastTokenAnnotation)
+ })), cancellationToken).ConfigureAwait(false);
+
+ if (selectionInExpression)
+ {
+ return new ExpressionResult(
+ status, originalSpan, finalSpan, options, selectionInExpression,
+ newDocument, firstTokenAnnotation, lastTokenAnnotation);
+ }
+ else
+ {
+ return new StatementResult(
+ status, originalSpan, finalSpan, options, selectionInExpression,
+ newDocument, firstTokenAnnotation, lastTokenAnnotation);
+ }
+ }
+
+ protected CSharpSelectionResult(
+ OperationStatus status,
+ TextSpan originalSpan,
+ TextSpan finalSpan,
+ OptionSet options,
+ bool selectionInExpression,
+ SemanticDocument document,
+ SyntaxAnnotation firstTokenAnnotation,
+ SyntaxAnnotation lastTokenAnnotation) :
+ base(status, originalSpan, finalSpan, options, selectionInExpression,
+ document, firstTokenAnnotation, lastTokenAnnotation)
+ {
+ }
+
+ protected override bool UnderAsyncAnonymousMethod(SyntaxToken token, SyntaxToken firstToken, SyntaxToken lastToken)
+ {
+ var current = token.Parent;
+ for (; current != null; current = current.Parent)
+ {
+ if (current is MemberDeclarationSyntax ||
+ current is SimpleLambdaExpressionSyntax ||
+ current is ParenthesizedLambdaExpressionSyntax ||
+ current is AnonymousMethodExpressionSyntax)
+ {
+ break;
+ }
+ }
+
+ if (current == null || current is MemberDeclarationSyntax)
+ {
+ return false;
+ }
+
+ // make sure the selection contains the lambda
+ return firstToken.SpanStart <= current.GetFirstToken().SpanStart &&
+ current.GetLastToken().Span.End <= lastToken.Span.End;
+ }
+
+ public StatementSyntax GetFirstStatement()
+ {
+ return GetFirstStatement<StatementSyntax>();
+ }
+
+ public StatementSyntax GetLastStatement()
+ {
+ return GetLastStatement<StatementSyntax>();
+ }
+
+ public StatementSyntax GetFirstStatementUnderContainer()
+ {
+ //Contract.ThrowIfTrue(this.SelectionInExpression);
+
+ var firstToken = this.GetFirstTokenInSelection();
+ var statement = firstToken.Parent.GetStatementUnderContainer();
+ //Contract.ThrowIfNull(statement);
+
+ return statement;
+ }
+
+ public StatementSyntax GetLastStatementUnderContainer()
+ {
+ //Contract.ThrowIfTrue(this.SelectionInExpression);
+
+ var lastToken = this.GetLastTokenInSelection();
+ var statement = lastToken.Parent.GetStatementUnderContainer();
+
+ //Contract.ThrowIfNull(statement);
+ //var firstStatementUnderContainer = this.GetFirstStatementUnderContainer();
+ //Contract.ThrowIfFalse(statement.Parent == firstStatementUnderContainer.Parent);
+
+ return statement;
+ }
+
+ public SyntaxNode GetInnermostStatementContainer()
+ {
+ //Contract.ThrowIfFalse(this.SelectionInExpression);
+ var containingScope = this.GetContainingScope();
+ var statements = containingScope.GetAncestorsOrThis<StatementSyntax>();
+ StatementSyntax last = null;
+
+ foreach (var statement in statements)
+ {
+ if (statement.IsStatementContainerNode())
+ {
+ return statement;
+ }
+
+ last = statement;
+ }
+
+ // constructor initializer case
+ var constructorInitializer = this.GetContainingScopeOf<ConstructorInitializerSyntax>();
+ if (constructorInitializer != null)
+ {
+ return constructorInitializer.Parent;
+ }
+
+ // field initializer case
+ var field = this.GetContainingScopeOf<FieldDeclarationSyntax>();
+ if (field != null)
+ {
+ return field.Parent;
+ }
+
+// Contract.ThrowIfFalse(last.IsParentKind(SyntaxKind.GlobalStatement));
+// Contract.ThrowIfFalse(last.Parent.IsParentKind(SyntaxKind.CompilationUnit));
+ return last.Parent.Parent;
+ }
+
+ public bool ShouldPutUnsafeModifier()
+ {
+ var token = this.GetFirstTokenInSelection();
+ var ancestors = token.GetAncestors<SyntaxNode>();
+
+ // if enclosing type contains unsafe keyword, we don't need to put it again
+ if (ancestors.Where(a => SyntaxFacts.IsTypeDeclaration(a.Kind()))
+ .Cast<MemberDeclarationSyntax>()
+ .Any(m => m.GetModifiers().Any(SyntaxKind.UnsafeKeyword)))
+ {
+ return false;
+ }
+
+ return token.Parent.IsUnsafeContext();
+ }
+
+ public SyntaxKind UnderCheckedExpressionContext()
+ {
+ return UnderCheckedContext<CheckedExpressionSyntax>();
+ }
+
+ public SyntaxKind UnderCheckedStatementContext()
+ {
+ return UnderCheckedContext<CheckedStatementSyntax>();
+ }
+
+ private SyntaxKind UnderCheckedContext<T>() where T : SyntaxNode
+ {
+ var token = this.GetFirstTokenInSelection();
+ var contextNode = token.Parent.GetAncestor<T>();
+ if (contextNode == null)
+ {
+ return SyntaxKind.None;
+ }
+
+ return contextNode.Kind();
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSelectionValidator.Validator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSelectionValidator.Validator.cs
new file mode 100644
index 0000000000..ab18e973c8
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSelectionValidator.Validator.cs
@@ -0,0 +1,86 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ partial class CSharpSelectionValidator
+ {
+ public bool Check(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ return node.TypeSwitch(
+ (ExpressionSyntax expression) => CheckExpression(semanticModel, expression, cancellationToken),
+ (BlockSyntax block) => CheckBlock(semanticModel, block, cancellationToken),
+ (StatementSyntax statement) => CheckStatement(semanticModel, statement, cancellationToken),
+ (GlobalStatementSyntax globalStatement) => CheckGlobalStatement(semanticModel, globalStatement, cancellationToken));
+ }
+
+ private bool CheckGlobalStatement(SemanticModel semanticModel, GlobalStatementSyntax globalStatement, CancellationToken cancellationToken)
+ {
+ return true;
+ }
+
+ private bool CheckBlock(SemanticModel semanticModel, BlockSyntax block, CancellationToken cancellationToken)
+ {
+ // TODO(cyrusn): Is it intentional that fixed statement is not in this list?
+ if (block.Parent is BlockSyntax ||
+ block.Parent is DoStatementSyntax ||
+ block.Parent is ElseClauseSyntax ||
+ block.Parent is ForEachStatementSyntax ||
+ block.Parent is ForStatementSyntax ||
+ block.Parent is IfStatementSyntax ||
+ block.Parent is LockStatementSyntax ||
+ block.Parent is UsingStatementSyntax ||
+ block.Parent is WhileStatementSyntax)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ private bool CheckExpression(SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+
+ // TODO(cyrusn): This is probably unnecessary. What we should be doing is binding
+ // the type of the expression and seeing if it contains an anonymous type.
+ if (expression is AnonymousObjectCreationExpressionSyntax)
+ {
+ return false;
+ }
+
+ return expression.CanReplaceWithRValue(semanticModel, cancellationToken);
+ }
+
+ private bool CheckStatement(SemanticModel semanticModel, StatementSyntax statement, CancellationToken cancellationToken)
+ {
+ if (statement is CheckedStatementSyntax ||
+ statement is DoStatementSyntax ||
+ statement is EmptyStatementSyntax ||
+ statement is ExpressionStatementSyntax ||
+ statement is FixedStatementSyntax ||
+ statement is ForEachStatementSyntax ||
+ statement is ForStatementSyntax ||
+ statement is IfStatementSyntax ||
+ statement is LocalDeclarationStatementSyntax ||
+ statement is LockStatementSyntax ||
+ statement is ReturnStatementSyntax ||
+ statement is SwitchStatementSyntax ||
+ statement is ThrowStatementSyntax ||
+ statement is TryStatementSyntax ||
+ statement is UnsafeStatementSyntax ||
+ statement is UsingStatementSyntax ||
+ statement is WhileStatementSyntax)
+ {
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSelectionValidator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSelectionValidator.cs
new file mode 100644
index 0000000000..a2eb2e77dc
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSelectionValidator.cs
@@ -0,0 +1,486 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ partial class CSharpSelectionValidator : SelectionValidator
+ {
+ public CSharpSelectionValidator(
+ SemanticDocument document,
+ TextSpan textSpan,
+ OptionSet options) :
+ base(document, textSpan, options)
+ {
+ }
+
+ public override async Task<SelectionResult> GetValidSelectionAsync(CancellationToken cancellationToken)
+ {
+ if (!this.ContainsValidSelection)
+ {
+ return NullSelection;
+ }
+
+ var text = this.SemanticDocument.Text;
+ var root = this.SemanticDocument.Root;
+ var model = this.SemanticDocument.SemanticModel;
+
+ // go through pipe line and calculate information about the user selection
+ var selectionInfo = GetInitialSelectionInfo(root, text, cancellationToken);
+ selectionInfo = AssignInitialFinalTokens(selectionInfo, root, cancellationToken);
+ selectionInfo = AdjustFinalTokensBasedOnContext(selectionInfo, model, cancellationToken);
+ selectionInfo = AssignFinalSpan(selectionInfo, text, cancellationToken);
+ selectionInfo = ApplySpecialCases(selectionInfo, text, cancellationToken);
+ selectionInfo = CheckErrorCasesAndAppendDescriptions(selectionInfo, root, cancellationToken);
+
+ // there was a fatal error that we couldn't even do negative preview, return error result
+ if (selectionInfo.Status.FailedWithNoBestEffortSuggestion())
+ {
+ return new ErrorSelectionResult(selectionInfo.Status);
+ }
+
+ var controlFlowSpan = GetControlFlowSpan(selectionInfo);
+ if (!selectionInfo.SelectionInExpression)
+ {
+ var statementRange = GetStatementRangeContainedInSpan<StatementSyntax>(root, controlFlowSpan, cancellationToken);
+ if (statementRange == null)
+ {
+ selectionInfo = selectionInfo.WithStatus(s => s.With(OperationStatusFlag.None, "CSharpFeaturesResources.CantDetermineValidRangeOfStatements"));
+ return new ErrorSelectionResult(selectionInfo.Status);
+ }
+
+ var isFinalSpanSemanticallyValid = IsFinalSpanSemanticallyValidSpan(model, controlFlowSpan, statementRange, cancellationToken);
+ if (!isFinalSpanSemanticallyValid)
+ {
+ // check control flow only if we are extracting statement level, not expression
+ // level. you can not have goto that moves control out of scope in expression level
+ // (even in lambda)
+ selectionInfo = selectionInfo.WithStatus(s => s.With(OperationStatusFlag.BestEffort, "CSharpFeaturesResources.NotAllCodePathReturns"));
+ }
+ }
+
+ return await CSharpSelectionResult.CreateAsync(
+ selectionInfo.Status,
+ selectionInfo.OriginalSpan,
+ selectionInfo.FinalSpan,
+ this.Options,
+ selectionInfo.SelectionInExpression,
+ this.SemanticDocument,
+ selectionInfo.FirstTokenInFinalSpan,
+ selectionInfo.LastTokenInFinalSpan,
+ cancellationToken).ConfigureAwait(false);
+ }
+
+ private SelectionInfo ApplySpecialCases(SelectionInfo selectionInfo, SourceText text, CancellationToken cancellationToken)
+ {
+ if (selectionInfo.Status.FailedWithNoBestEffortSuggestion() || !selectionInfo.SelectionInExpression)
+ {
+ return selectionInfo;
+ }
+
+ var expressionNode = selectionInfo.FirstTokenInFinalSpan.GetCommonRoot(selectionInfo.LastTokenInFinalSpan);
+ if (!expressionNode.IsAnyAssignExpression())
+ {
+ return selectionInfo;
+ }
+
+ var assign = (AssignmentExpressionSyntax)expressionNode;
+
+ // make sure there is a visible token at right side expression
+ if (assign.Right.GetLastToken().Kind() == SyntaxKind.None)
+ {
+ return selectionInfo;
+ }
+
+ return AssignFinalSpan(selectionInfo.With(s => s.FirstTokenInFinalSpan = assign.Right.GetFirstToken(includeZeroWidth: true))
+ .With(s => s.LastTokenInFinalSpan = assign.Right.GetLastToken(includeZeroWidth: true)),
+ text, cancellationToken);
+ }
+
+ private TextSpan GetControlFlowSpan(SelectionInfo selectionInfo)
+ {
+ return TextSpan.FromBounds(selectionInfo.FirstTokenInFinalSpan.SpanStart, selectionInfo.LastTokenInFinalSpan.Span.End);
+ }
+
+ private SelectionInfo AdjustFinalTokensBasedOnContext(
+ SelectionInfo selectionInfo,
+ SemanticModel semanticModel,
+ CancellationToken cancellationToken)
+ {
+ if (selectionInfo.Status.FailedWithNoBestEffortSuggestion())
+ {
+ return selectionInfo;
+ }
+
+ // don't need to adjust anything if it is multi-statements case
+ if (!selectionInfo.SelectionInExpression && !selectionInfo.SelectionInSingleStatement)
+ {
+ return selectionInfo;
+ }
+
+ // get the node that covers the selection
+ var node = selectionInfo.FirstTokenInFinalSpan.GetCommonRoot(selectionInfo.LastTokenInFinalSpan);
+
+ var validNode = Check(semanticModel, node, cancellationToken);
+ if (validNode)
+ {
+ return selectionInfo;
+ }
+
+ var firstValidNode = node.GetAncestors<SyntaxNode>().FirstOrDefault(n => Check(semanticModel, n, cancellationToken));
+ if (firstValidNode == null)
+ {
+ // couldn't find any valid node
+ return selectionInfo.WithStatus(s => new OperationStatus(OperationStatusFlag.None, "CSharpFeaturesResources.SelectionDoesNotContainAValidNode"))
+ .With(s => s.FirstTokenInFinalSpan = default(SyntaxToken))
+ .With(s => s.LastTokenInFinalSpan = default(SyntaxToken));
+ }
+
+ firstValidNode = (firstValidNode.Parent is ExpressionStatementSyntax) ? firstValidNode.Parent : firstValidNode;
+
+ return selectionInfo.With(s => s.SelectionInExpression = firstValidNode is ExpressionSyntax)
+ .With(s => s.SelectionInSingleStatement = firstValidNode is StatementSyntax)
+ .With(s => s.FirstTokenInFinalSpan = firstValidNode.GetFirstToken(includeZeroWidth: true))
+ .With(s => s.LastTokenInFinalSpan = firstValidNode.GetLastToken(includeZeroWidth: true));
+ }
+
+ private SelectionInfo GetInitialSelectionInfo(SyntaxNode root, SourceText text, CancellationToken cancellationToken)
+ {
+ var adjustedSpan = GetAdjustedSpan(text, this.OriginalSpan);
+
+ var firstTokenInSelection = root.FindTokenOnRightOfPosition(adjustedSpan.Start, includeSkipped: false);
+ var lastTokenInSelection = root.FindTokenOnLeftOfPosition(adjustedSpan.End, includeSkipped: false);
+
+ if (firstTokenInSelection.Kind() == SyntaxKind.None || lastTokenInSelection.Kind() == SyntaxKind.None)
+ {
+ return new SelectionInfo { Status = new OperationStatus(OperationStatusFlag.None, "CSharpFeaturesResources.InvalidSelection"), OriginalSpan = adjustedSpan };
+ }
+
+ if (!adjustedSpan.Contains(firstTokenInSelection.Span) && !adjustedSpan.Contains(lastTokenInSelection.Span))
+ {
+ return new SelectionInfo
+ {
+ Status = new OperationStatus(OperationStatusFlag.None, "CSharpFeaturesResources.SelectionDoesNotContainAValidToken"),
+ OriginalSpan = adjustedSpan,
+ FirstTokenInOriginalSpan = firstTokenInSelection,
+ LastTokenInOriginalSpan = lastTokenInSelection
+ };
+ }
+
+ if (!firstTokenInSelection.UnderValidContext() || !lastTokenInSelection.UnderValidContext())
+ {
+ return new SelectionInfo
+ {
+ Status = new OperationStatus(OperationStatusFlag.None, "CSharpFeaturesResources.InvalidContext"),
+ OriginalSpan = adjustedSpan,
+ FirstTokenInOriginalSpan = firstTokenInSelection,
+ LastTokenInOriginalSpan = lastTokenInSelection
+ };
+ }
+
+ var commonRoot = firstTokenInSelection.GetCommonRoot(lastTokenInSelection);
+ if (commonRoot == null)
+ {
+ return new SelectionInfo
+ {
+ Status = new OperationStatus(OperationStatusFlag.None, "CSharpFeaturesResources.NoCommonRootNodeForExtraction"),
+ OriginalSpan = adjustedSpan,
+ FirstTokenInOriginalSpan = firstTokenInSelection,
+ LastTokenInOriginalSpan = lastTokenInSelection
+ };
+ }
+
+ var selectionInExpression = commonRoot is ExpressionSyntax;
+ if (!selectionInExpression && !commonRoot.UnderValidContext())
+ {
+ return new SelectionInfo
+ {
+ Status = new OperationStatus(OperationStatusFlag.None, "CSharpFeaturesResources.NoValidSelectionToPerformExtraction"),
+ OriginalSpan = adjustedSpan,
+ FirstTokenInOriginalSpan = firstTokenInSelection,
+ LastTokenInOriginalSpan = lastTokenInSelection
+ };
+ }
+
+ return new SelectionInfo
+ {
+ Status = OperationStatus.Succeeded,
+ OriginalSpan = adjustedSpan,
+ CommonRootFromOriginalSpan = commonRoot,
+ SelectionInExpression = selectionInExpression,
+ FirstTokenInOriginalSpan = firstTokenInSelection,
+ LastTokenInOriginalSpan = lastTokenInSelection
+ };
+ }
+
+ private SelectionInfo CheckErrorCasesAndAppendDescriptions(SelectionInfo selectionInfo, SyntaxNode root, CancellationToken cancellationToken)
+ {
+ if (selectionInfo.Status.FailedWithNoBestEffortSuggestion())
+ {
+ return selectionInfo;
+ }
+
+ if (selectionInfo.FirstTokenInFinalSpan.IsMissing || selectionInfo.LastTokenInFinalSpan.IsMissing)
+ {
+ selectionInfo = selectionInfo.WithStatus(s => s.With(OperationStatusFlag.None, "CSharpFeaturesResources.ContainsInvalidSelection"));
+ }
+
+ // get the node that covers the selection
+ var commonNode = selectionInfo.FirstTokenInFinalSpan.GetCommonRoot(selectionInfo.LastTokenInFinalSpan);
+
+ if ((selectionInfo.SelectionInExpression || selectionInfo.SelectionInSingleStatement) && commonNode.HasDiagnostics())
+ {
+ selectionInfo = selectionInfo.WithStatus(s => s.With(OperationStatusFlag.None, "CSharpFeaturesResources.TheSelectionContainsSyntacticErrors"));
+ }
+
+ var tokens = root.DescendantTokens(selectionInfo.FinalSpan);
+ if (tokens.ContainPreprocessorCrossOver(selectionInfo.FinalSpan))
+ {
+ selectionInfo = selectionInfo.WithStatus(s => s.With(OperationStatusFlag.BestEffort, "CSharpFeaturesResources.SelectionCanNotCrossOverPreprocessorDirectives"));
+ }
+
+ // TODO : check whether this can be handled by control flow analysis engine
+ if (tokens.Any(t => t.Kind() == SyntaxKind.YieldKeyword))
+ {
+ selectionInfo = selectionInfo.WithStatus(s => s.With(OperationStatusFlag.BestEffort, "CSharpFeaturesResources.SelectionCanNotContainAYieldStatement"));
+ }
+
+ // TODO : check behavior of control flow analysis engine around exception and exception handling.
+ if (tokens.ContainArgumentlessThrowWithoutEnclosingCatch(selectionInfo.FinalSpan))
+ {
+ selectionInfo = selectionInfo.WithStatus(s => s.With(OperationStatusFlag.BestEffort, "CSharpFeaturesResources.SelectionCanNotContainThrowStatement"));
+ }
+
+ if (selectionInfo.SelectionInExpression && commonNode.PartOfConstantInitializerExpression())
+ {
+ selectionInfo = selectionInfo.WithStatus(s => s.With(OperationStatusFlag.None, "CSharpFeaturesResources.SelectionCanNotBePartOfConstInitializerExpr"));
+ }
+
+ if (commonNode.IsUnsafeContext())
+ {
+ selectionInfo = selectionInfo.WithStatus(s => s.With(s.Flag, "CSharpFeaturesResources.TheSelectedCodeIsInsideAnUnsafeContext"));
+ }
+
+ var selectionChanged = selectionInfo.FirstTokenInOriginalSpan != selectionInfo.FirstTokenInFinalSpan || selectionInfo.LastTokenInOriginalSpan != selectionInfo.LastTokenInFinalSpan;
+ if (selectionChanged)
+ {
+ selectionInfo = selectionInfo.WithStatus(s => s.MarkSuggestion());
+ }
+
+ return selectionInfo;
+ }
+
+ private SelectionInfo AssignInitialFinalTokens(SelectionInfo selectionInfo, SyntaxNode root, CancellationToken cancellationToken)
+ {
+ if (selectionInfo.Status.FailedWithNoBestEffortSuggestion())
+ {
+ return selectionInfo;
+ }
+
+ if (selectionInfo.SelectionInExpression)
+ {
+ // simple expression case
+ return selectionInfo.With(s => s.FirstTokenInFinalSpan = s.CommonRootFromOriginalSpan.GetFirstToken(includeZeroWidth: true))
+ .With(s => s.LastTokenInFinalSpan = s.CommonRootFromOriginalSpan.GetLastToken(includeZeroWidth: true));
+ }
+
+ var range = GetStatementRangeContainingSpan<StatementSyntax>(
+ root, TextSpan.FromBounds(selectionInfo.FirstTokenInOriginalSpan.SpanStart, selectionInfo.LastTokenInOriginalSpan.Span.End),
+ cancellationToken);
+
+ if (range == null)
+ {
+ return selectionInfo.WithStatus(s => s.With(OperationStatusFlag.None, "CSharpFeaturesResources.NoValidStatementRangeToExtractOut"));
+ }
+
+ var statement1 = (StatementSyntax)range.Item1;
+ var statement2 = (StatementSyntax)range.Item2;
+
+ if (statement1 == statement2)
+ {
+ // check one more time to see whether it is an expression case
+ var expression = selectionInfo.CommonRootFromOriginalSpan.GetAncestor<ExpressionSyntax>();
+ if (expression != null && statement1.Span.Contains(expression.Span))
+ {
+ return selectionInfo.With(s => s.SelectionInExpression = true)
+ .With(s => s.FirstTokenInFinalSpan = expression.GetFirstToken(includeZeroWidth: true))
+ .With(s => s.LastTokenInFinalSpan = expression.GetLastToken(includeZeroWidth: true));
+ }
+
+ // single statement case
+ return selectionInfo.With(s => s.SelectionInSingleStatement = true)
+ .With(s => s.FirstTokenInFinalSpan = statement1.GetFirstToken(includeZeroWidth: true))
+ .With(s => s.LastTokenInFinalSpan = statement1.GetLastToken(includeZeroWidth: true));
+ }
+
+ // move only statements inside of the block
+ return selectionInfo.With(s => s.FirstTokenInFinalSpan = statement1.GetFirstToken(includeZeroWidth: true))
+ .With(s => s.LastTokenInFinalSpan = statement2.GetLastToken(includeZeroWidth: true));
+ }
+
+ private SelectionInfo AssignFinalSpan(SelectionInfo selectionInfo, SourceText text, CancellationToken cancellationToken)
+ {
+ if (selectionInfo.Status.FailedWithNoBestEffortSuggestion())
+ {
+ return selectionInfo;
+ }
+
+ // set final span
+ var start = (selectionInfo.FirstTokenInOriginalSpan == selectionInfo.FirstTokenInFinalSpan) ?
+ Math.Min(selectionInfo.FirstTokenInOriginalSpan.SpanStart, selectionInfo.OriginalSpan.Start) :
+ selectionInfo.FirstTokenInFinalSpan.FullSpan.Start;
+
+ var end = (selectionInfo.LastTokenInOriginalSpan == selectionInfo.LastTokenInFinalSpan) ?
+ Math.Max(selectionInfo.LastTokenInOriginalSpan.Span.End, selectionInfo.OriginalSpan.End) :
+ selectionInfo.LastTokenInFinalSpan.FullSpan.End;
+
+ return selectionInfo.With(s => s.FinalSpan = GetAdjustedSpan(text, TextSpan.FromBounds(start, end)));
+ }
+
+ public override bool ContainsNonReturnExitPointsStatements(IEnumerable<SyntaxNode> jumpsOutOfRegion)
+ {
+ return jumpsOutOfRegion.Where(n => !(n is ReturnStatementSyntax)).Any();
+ }
+
+ public override IEnumerable<SyntaxNode> GetOuterReturnStatements(SyntaxNode commonRoot, IEnumerable<SyntaxNode> jumpsOutOfRegion)
+ {
+ var returnStatements = jumpsOutOfRegion.Where(s => s is ReturnStatementSyntax);
+
+ var container = commonRoot.GetAncestorsOrThis<SyntaxNode>().Where(a => a.IsReturnableConstruct()).FirstOrDefault();
+ if (container == null)
+ {
+ return SpecializedCollections.EmptyEnumerable<SyntaxNode>();
+ }
+
+ var returnableConstructPairs = returnStatements.Select(r => Tuple.Create(r, r.GetAncestors<SyntaxNode>().Where(a => a.IsReturnableConstruct()).FirstOrDefault()))
+ .Where(p => p.Item2 != null);
+
+ // now filter return statements to only include the one under outmost container
+ return returnableConstructPairs.Where(p => p.Item2 == container).Select(p => p.Item1);
+ }
+
+ public override bool IsFinalSpanSemanticallyValidSpan(
+ SyntaxNode root, TextSpan textSpan,
+ IEnumerable<SyntaxNode> returnStatements, CancellationToken cancellationToken)
+ {
+ // return statement shouldn't contain any return value
+ if (returnStatements.Cast<ReturnStatementSyntax>().Any(r => r.Expression != null))
+ {
+ return false;
+ }
+
+ var lastToken = (SyntaxToken)root.FindToken(textSpan.End);
+ if (lastToken.Kind() == SyntaxKind.None)
+ {
+ return false;
+ }
+
+ var container = lastToken.GetAncestors<SyntaxNode>().FirstOrDefault(n => n.IsReturnableConstruct());
+ if (container == null)
+ {
+ return false;
+ }
+
+ var body = container.GetBlockBody();
+ if (body == null)
+ {
+ return false;
+ }
+
+ // make sure that next token of the last token in the selection is the close braces of containing block
+ if (body.CloseBraceToken != lastToken.GetNextToken(includeZeroWidth: true))
+ {
+ return false;
+ }
+
+ // alright, for these construcuts, it must be okay to be extracted
+ switch (container.Kind())
+ {
+ case SyntaxKind.AnonymousMethodExpression:
+ case SyntaxKind.SimpleLambdaExpression:
+ case SyntaxKind.ParenthesizedLambdaExpression:
+ return true;
+ }
+
+ // now, only method is okay to be extracted out
+ var method = body.Parent as MethodDeclarationSyntax;
+ if (method == null)
+ {
+ return false;
+ }
+
+ // make sure this method doesn't have return type.
+ return method.ReturnType.TypeSwitch((PredefinedTypeSyntax p) => p.Keyword.Kind() == SyntaxKind.VoidKeyword);
+ }
+
+ private static TextSpan GetAdjustedSpan(SourceText text, TextSpan textSpan)
+ {
+ // beginning of a file
+ if (textSpan.IsEmpty || textSpan.End == 0)
+ {
+ return textSpan;
+ }
+
+ // if it is a start of new line, make it belong to previous line
+ var line = text.Lines.GetLineFromPosition(textSpan.End);
+ if (line.Start != textSpan.End)
+ {
+ return textSpan;
+ }
+
+ // get previous line
+ //Contract.ThrowIfFalse(line.LineNumber > 0);
+ var previousLine = text.Lines[line.LineNumber - 1];
+ return TextSpan.FromBounds(textSpan.Start, previousLine.End);
+ }
+
+ private class SelectionInfo
+ {
+ public OperationStatus Status { get; set; }
+
+ public TextSpan OriginalSpan { get; set; }
+ public TextSpan FinalSpan { get; set; }
+
+ public SyntaxNode CommonRootFromOriginalSpan { get; set; }
+
+ public SyntaxToken FirstTokenInOriginalSpan { get; set; }
+ public SyntaxToken LastTokenInOriginalSpan { get; set; }
+
+ public SyntaxToken FirstTokenInFinalSpan { get; set; }
+ public SyntaxToken LastTokenInFinalSpan { get; set; }
+
+ public bool SelectionInExpression { get; set; }
+ public bool SelectionInSingleStatement { get; set; }
+
+ public SelectionInfo WithStatus(Func<OperationStatus, OperationStatus> statusGetter)
+ {
+ return With(s => s.Status = statusGetter(s.Status));
+ }
+
+ public SelectionInfo With(Action<SelectionInfo> valueSetter)
+ {
+ var newInfo = this.Clone();
+ valueSetter(newInfo);
+ return newInfo;
+ }
+
+ public SelectionInfo Clone()
+ {
+ return (SelectionInfo)this.MemberwiseClone();
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSyntaxTriviaService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSyntaxTriviaService.cs
new file mode 100644
index 0000000000..a8107c2c14
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSyntaxTriviaService.cs
@@ -0,0 +1,16 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ class CSharpSyntaxTriviaService : AbstractSyntaxTriviaService
+ {
+ public CSharpSyntaxTriviaService()
+ : base((int)SyntaxKind.EndOfLineTrivia)
+ {
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSyntaxTriviaServiceFactory.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSyntaxTriviaServiceFactory.cs
new file mode 100644
index 0000000000..3fcd67d257
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/CSharpSyntaxTriviaServiceFactory.cs
@@ -0,0 +1,20 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Composition;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis.Host.Mef;
+
+using Microsoft.CodeAnalysis;
+
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+// [ExportLanguageServiceFactory(typeof(ISyntaxTriviaService), LanguageNames.CSharp), Shared]
+// class CSharpSyntaxTriviaServiceFactory : ILanguageServiceFactory
+// {
+// public ILanguageService CreateLanguageService(HostLanguageServices provider)
+// {
+// return new CSharpSyntaxTriviaService(provider);
+// }
+// }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/Extensions.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/Extensions.cs
new file mode 100644
index 0000000000..61825c5c53
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/CSharp/Extensions.cs
@@ -0,0 +1,285 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ static partial class Extensions
+ {
+ public static ExpressionSyntax GetUnparenthesizedExpression(this SyntaxNode node)
+ {
+ var parenthesizedExpression = node as ParenthesizedExpressionSyntax;
+ if (parenthesizedExpression == null)
+ {
+ return node as ExpressionSyntax;
+ }
+
+ return GetUnparenthesizedExpression(parenthesizedExpression.Expression);
+ }
+
+ public static StatementSyntax GetStatementUnderContainer(this SyntaxNode node)
+ {
+ //Contract.ThrowIfNull(node);
+
+ while (node != null)
+ {
+ if (node.Parent != null &&
+ node.Parent.IsStatementContainerNode())
+ {
+ return node as StatementSyntax;
+ }
+
+ node = node.Parent;
+ }
+
+ return null;
+ }
+
+ public static StatementSyntax GetParentLabeledStatementIfPossible(this SyntaxNode node)
+ {
+ return (StatementSyntax)((node.Parent is LabeledStatementSyntax) ? node.Parent : node);
+ }
+
+ public static bool IsStatementContainerNode(this SyntaxNode node)
+ {
+ return node is BlockSyntax || node is SwitchSectionSyntax;
+ }
+
+ public static BlockSyntax GetBlockBody(this SyntaxNode node)
+ {
+ return node.TypeSwitch(
+ (BaseMethodDeclarationSyntax m) => m.Body,
+ (AccessorDeclarationSyntax a) => a.Body,
+ (SimpleLambdaExpressionSyntax s) => s.Body as BlockSyntax,
+ (ParenthesizedLambdaExpressionSyntax p) => p.Body as BlockSyntax,
+ (AnonymousMethodExpressionSyntax a) => a.Block);
+ }
+
+ public static bool UnderValidContext(this SyntaxNode node)
+ {
+ //Contract.ThrowIfNull(node);
+
+ Func<SyntaxNode, bool> predicate = n =>
+ {
+ if (n is BaseMethodDeclarationSyntax ||
+ n is AccessorDeclarationSyntax ||
+ n is BlockSyntax ||
+ n is GlobalStatementSyntax)
+ {
+ return true;
+ }
+
+ var constructorInitializer = n as ConstructorInitializerSyntax;
+ if (constructorInitializer != null)
+ {
+ return constructorInitializer.ContainsInArgument(node.Span);
+ }
+
+ return false;
+ };
+
+ if (!node.GetAncestorsOrThis<SyntaxNode>().Any(predicate))
+ {
+ return false;
+ }
+
+ if (node.FromScript() || node.GetAncestor<TypeDeclarationSyntax>() != null)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool UnderValidContext(this SyntaxToken token)
+ {
+ return token.GetAncestors<SyntaxNode>().Any(n => n.CheckTopLevel(token.Span));
+ }
+
+ public static bool PartOfConstantInitializerExpression(this SyntaxNode node)
+ {
+ return node.PartOfConstantInitializerExpression<FieldDeclarationSyntax>(n => n.Modifiers) ||
+ node.PartOfConstantInitializerExpression<LocalDeclarationStatementSyntax>(n => n.Modifiers);
+ }
+
+ private static bool PartOfConstantInitializerExpression<T>(this SyntaxNode node, Func<T, SyntaxTokenList> modifiersGetter) where T : SyntaxNode
+ {
+ var decl = node.GetAncestor<T>();
+ if (decl == null)
+ {
+ return false;
+ }
+
+ if (!modifiersGetter(decl).Any(t => t.Kind() == SyntaxKind.ConstKeyword))
+ {
+ return false;
+ }
+
+ // we are under decl with const modifier, check we are part of initializer expression
+ var equal = node.GetAncestor<EqualsValueClauseSyntax>();
+ if (equal == null)
+ {
+ return false;
+ }
+
+ return equal.Value != null && equal.Value.Span.Contains(node.Span);
+ }
+
+ public static bool ContainArgumentlessThrowWithoutEnclosingCatch(this IEnumerable<SyntaxToken> tokens, TextSpan textSpan)
+ {
+ foreach (var token in tokens)
+ {
+ if (token.Kind() != SyntaxKind.ThrowKeyword)
+ {
+ continue;
+ }
+
+ var throwStatement = token.Parent as ThrowStatementSyntax;
+ if (throwStatement == null || throwStatement.Expression != null)
+ {
+ continue;
+ }
+
+ var catchClause = token.GetAncestor<CatchClauseSyntax>();
+ if (catchClause == null || !textSpan.Contains(catchClause.Span))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool ContainPreprocessorCrossOver(this IEnumerable<SyntaxToken> tokens, TextSpan textSpan)
+ {
+ int activeRegions = 0;
+ int activeIfs = 0;
+
+ foreach (var trivia in tokens.GetAllTrivia())
+ {
+ if (!textSpan.Contains(trivia.Span))
+ {
+ continue;
+ }
+
+ switch (trivia.Kind())
+ {
+ case SyntaxKind.RegionDirectiveTrivia:
+ activeRegions++;
+ break;
+ case SyntaxKind.EndRegionDirectiveTrivia:
+ if (activeRegions <= 0)
+ {
+ return true;
+ }
+
+ activeRegions--;
+ break;
+ case SyntaxKind.IfDirectiveTrivia:
+ activeIfs++;
+ break;
+ case SyntaxKind.EndIfDirectiveTrivia:
+ if (activeIfs <= 0)
+ {
+ return true;
+ }
+
+ activeIfs--;
+ break;
+ case SyntaxKind.ElseDirectiveTrivia:
+ case SyntaxKind.ElifDirectiveTrivia:
+ if (activeIfs <= 0)
+ {
+ return true;
+ }
+
+ break;
+ }
+ }
+
+ return activeIfs != 0 || activeRegions != 0;
+ }
+
+ public static IEnumerable<SyntaxTrivia> GetAllTrivia(this IEnumerable<SyntaxToken> tokens)
+ {
+ foreach (var token in tokens)
+ {
+ foreach (var trivia in token.LeadingTrivia)
+ {
+ yield return trivia;
+ }
+
+ foreach (var trivia in token.TrailingTrivia)
+ {
+ yield return trivia;
+ }
+ }
+ }
+
+ public static bool HasSyntaxAnnotation(this HashSet<SyntaxAnnotation> set, SyntaxNode node)
+ {
+ return set.Any(a => node.GetAnnotatedNodesAndTokens(a).Any());
+ }
+
+ public static bool HasHybridTriviaBetween(this SyntaxToken token1, SyntaxToken token2)
+ {
+ if (token1.TrailingTrivia.Any(t => !t.IsElastic()))
+ {
+ return true;
+ }
+
+ if (token2.LeadingTrivia.Any(t => !t.IsElastic()))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsArrayInitializer(this SyntaxNode node)
+ {
+ return node is InitializerExpressionSyntax && node.Parent is EqualsValueClauseSyntax;
+ }
+
+ public static bool IsExpressionInCast(this SyntaxNode node)
+ {
+ return node is ExpressionSyntax && node.Parent is CastExpressionSyntax;
+ }
+
+ public static bool IsExpression(this SyntaxNode node)
+ {
+ return node is ExpressionSyntax;
+ }
+
+ public static bool IsErrorType(this ITypeSymbol type)
+ {
+ return type == null || type.Kind == SymbolKind.ErrorType;
+ }
+
+ public static bool IsObjectType(this ITypeSymbol type)
+ {
+ return type == null || type.SpecialType == SpecialType.System_Object;
+ }
+
+ public static bool BetweenFieldAndNonFieldMember(this SyntaxToken token1, SyntaxToken token2)
+ {
+ if (token1.RawKind != (int)SyntaxKind.SemicolonToken || !(token1.Parent is FieldDeclarationSyntax))
+ {
+ return false;
+ }
+
+ var field = token2.GetAncestor<FieldDeclarationSyntax>();
+ return field == null;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/Enums.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/Enums.cs
new file mode 100644
index 0000000000..36b85e5578
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/Enums.cs
@@ -0,0 +1,55 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ public enum DeclarationBehavior
+ {
+ None,
+ Delete,
+ MoveIn,
+ MoveOut,
+ SplitIn,
+ SplitOut
+ }
+
+ public enum ReturnBehavior
+ {
+ None,
+ Initialization,
+ Assignment
+ }
+
+ public enum ParameterBehavior
+ {
+ None,
+ Input,
+ Out,
+ Ref
+ }
+
+ /// <summary>
+ /// status code for extract method operations
+ /// </summary>
+ [Flags]
+ public enum OperationStatusFlag
+ {
+ None = 0x0,
+
+ /// <summary>
+ /// operation has succeeded
+ /// </summary>
+ Succeeded = 0x1,
+
+ /// <summary>
+ /// operation has succeeded with a span that is different than original span
+ /// </summary>
+ Suggestion = 0x2,
+
+ /// <summary>
+ /// operation has failed but can provide some best effort result
+ /// </summary>
+ BestEffort = 0x4,
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/Extensions.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/Extensions.cs
new file mode 100644
index 0000000000..5a4f85d696
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/Extensions.cs
@@ -0,0 +1,121 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ static partial class Extensions
+ {
+ public static bool Succeeded(this OperationStatus status)
+ {
+ return status.Flag.Succeeded();
+ }
+
+ public static bool FailedWithNoBestEffortSuggestion(this OperationStatus status)
+ {
+ return status.Flag.Failed() && !status.Flag.HasBestEffort();
+ }
+
+ public static bool Failed(this OperationStatus status)
+ {
+ return status.Flag.Failed();
+ }
+
+ public static bool Succeeded(this OperationStatusFlag flag)
+ {
+ return (flag & OperationStatusFlag.Succeeded) != 0;
+ }
+
+ public static bool Failed(this OperationStatusFlag flag)
+ {
+ return !flag.Succeeded();
+ }
+
+ public static bool HasBestEffort(this OperationStatusFlag flag)
+ {
+ return (flag & OperationStatusFlag.BestEffort) != 0;
+ }
+
+ public static bool HasSuggestion(this OperationStatusFlag flag)
+ {
+ return (flag & OperationStatusFlag.Suggestion) != 0;
+ }
+
+ public static bool HasMask(this OperationStatusFlag flag, OperationStatusFlag mask)
+ {
+ return (flag & mask) != 0x0;
+ }
+
+ public static OperationStatusFlag RemoveFlag(this OperationStatusFlag baseFlag, OperationStatusFlag flagToRemove)
+ {
+ return baseFlag & ~flagToRemove;
+ }
+
+ public static ITypeSymbol GetLambdaOrAnonymousMethodReturnType(this SemanticModel binding, SyntaxNode node)
+ {
+ var info = binding.GetSymbolInfo(node);
+ if (info.Symbol == null)
+ {
+ return null;
+ }
+
+ var methodSymbol = info.Symbol as IMethodSymbol;
+ if (methodSymbol.MethodKind != MethodKind.AnonymousFunction)
+ {
+ return null;
+ }
+
+ return methodSymbol.ReturnType;
+ }
+
+ public static Task<SemanticDocument> WithSyntaxRootAsync(this SemanticDocument semanticDocument, SyntaxNode root, CancellationToken cancellationToken)
+ {
+ return SemanticDocument.CreateAsync(semanticDocument.Document.WithSyntaxRoot(root), cancellationToken);
+ }
+
+ /// <summary>
+ /// get tokens with given annotation in current document
+ /// </summary>
+ public static SyntaxToken GetTokenWithAnnotaton(this SemanticDocument document, SyntaxAnnotation annotation)
+ {
+ return document.Root.GetAnnotatedNodesAndTokens(annotation).Single().AsToken();
+ }
+
+ /// <summary>
+ /// resolve the given symbol against compilation this snapshot has
+ /// </summary>
+ public static T ResolveType<T>(this SemanticModel semanticModel, T symbol) where T : class, ITypeSymbol
+ {
+ return (T)symbol.GetSymbolKey().Resolve(semanticModel.Compilation).GetAnySymbol();
+ }
+
+ /// <summary>
+ /// check whether node contains error for itself but not from its child node
+ /// </summary>
+ public static bool HasDiagnostics(this SyntaxNode node)
+ {
+ var set = new HashSet<Diagnostic>(node.GetDiagnostics());
+
+ foreach (var child in node.ChildNodes())
+ {
+ set.ExceptWith(child.GetDiagnostics());
+ }
+
+ return set.Count > 0;
+ }
+
+ public static bool FromScript(this SyntaxNode node)
+ {
+ if (node.SyntaxTree == null)
+ {
+ return false;
+ }
+
+ return node.SyntaxTree.Options.Kind != SourceCodeKind.Regular;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ExtractMethodMatrix.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ExtractMethodMatrix.cs
new file mode 100644
index 0000000000..972a936f74
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ExtractMethodMatrix.cs
@@ -0,0 +1,229 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ class ExtractMethodMatrix
+ {
+ private static readonly Dictionary<Key, VariableStyle> s_matrix;
+
+ static ExtractMethodMatrix()
+ {
+ s_matrix = new Dictionary<Key, VariableStyle>();
+ BuildMatrix();
+ }
+
+ public static VariableStyle GetVariableStyle(
+ bool captured,
+ bool dataFlowIn,
+ bool dataFlowOut,
+ bool alwaysAssigned,
+ bool variableDeclared,
+ bool readInside,
+ bool writtenInside,
+ bool readOutside,
+ bool writtenOutside,
+ bool unsafeAddressTaken)
+ {
+#if false
+ // decide not to treat capture variable special
+ if (captured)
+ {
+ // if a variable is captured, it can only be passed as ref parameter.
+ return VariableStyle.OnlyAsRefParam;
+ }
+#endif
+ // bug # 12258, 12114
+ // use "out" if "&" is taken for the variable
+ if (unsafeAddressTaken)
+ {
+ return VariableStyle.Out;
+ }
+
+ var key = new Key(
+ dataFlowIn,
+ dataFlowOut,
+ alwaysAssigned,
+ variableDeclared,
+ readInside,
+ writtenInside,
+ readOutside,
+ writtenOutside);
+
+ // special cases
+ if (!s_matrix.ContainsKey(key))
+ {
+ // Interesting case. Due to things like constant analysis there can be regions that
+ // the compiler considers data not to flow in (because analysis proves that that
+ // path will never be taken). However, the variable can still be read/written inside
+ // the region. For purposes of extract method, we check for this case, and we
+ // pretend it's as if data flowed into the region.
+ if (!dataFlowIn && (readInside || writtenInside))
+ {
+ key = new Key(true, dataFlowOut, alwaysAssigned, variableDeclared, readInside, writtenInside, readOutside, writtenOutside);
+ }
+
+ // another interesting case (bug # 10875)
+ // basically, it can happen in malformed code where a variable is not properly assigned but used outside of the selection + unreachable code region
+ // for such cases, treat it like "MoveOut"
+ if (!dataFlowOut && !alwaysAssigned && variableDeclared && !writtenInside && readOutside)
+ {
+ key = new Key(dataFlowIn, /*dataFlowOut*/ true, alwaysAssigned, variableDeclared, readInside, writtenInside, readOutside, writtenOutside);
+ }
+ }
+
+ // Contract.ThrowIfFalse(s_matrix.ContainsKey(key));
+
+ return s_matrix[key];
+ }
+
+ private static void BuildMatrix()
+ {
+ // meaning of each boolean values (total of 69 different cases)
+ // data flowin/data flow out/always assigned/variable declared/ read inside/written inside/read outside/written outside
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: false, variableDeclared: false, readInside: false, writtenInside: true, readOutside: false, writtenOutside: false), VariableStyle.InputOnly);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: false, variableDeclared: false, readInside: false, writtenInside: true, readOutside: false, writtenOutside: true), VariableStyle.InputOnly);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: false, variableDeclared: false, readInside: false, writtenInside: true, readOutside: true, writtenOutside: false), VariableStyle.InputOnly);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: false, variableDeclared: false, readInside: false, writtenInside: true, readOutside: true, writtenOutside: true), VariableStyle.InputOnly);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: false, variableDeclared: false, readInside: true, writtenInside: true, readOutside: false, writtenOutside: false), VariableStyle.MoveIn);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: false, variableDeclared: false, readInside: true, writtenInside: true, readOutside: false, writtenOutside: true), VariableStyle.InputOnly);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: false, variableDeclared: false, readInside: true, writtenInside: true, readOutside: true, writtenOutside: false), VariableStyle.SplitIn);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: false, variableDeclared: false, readInside: true, writtenInside: true, readOutside: true, writtenOutside: true), VariableStyle.InputOnly);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: false, variableDeclared: true, readInside: false, writtenInside: false, readOutside: false, writtenOutside: true), VariableStyle.MoveOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: false, variableDeclared: true, readInside: false, writtenInside: false, readOutside: true, writtenOutside: true), VariableStyle.MoveOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: false, variableDeclared: true, readInside: false, writtenInside: true, readOutside: false, writtenOutside: false), VariableStyle.None);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: false, variableDeclared: true, readInside: false, writtenInside: true, readOutside: false, writtenOutside: true), VariableStyle.SplitOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: false, variableDeclared: true, readInside: false, writtenInside: true, readOutside: true, writtenOutside: true), VariableStyle.SplitOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: false, variableDeclared: true, readInside: true, writtenInside: false, readOutside: false, writtenOutside: false), VariableStyle.None);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: false, variableDeclared: true, readInside: true, writtenInside: false, readOutside: false, writtenOutside: true), VariableStyle.SplitOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: false, variableDeclared: true, readInside: true, writtenInside: false, readOutside: true, writtenOutside: true), VariableStyle.SplitOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: false, variableDeclared: true, readInside: true, writtenInside: true, readOutside: false, writtenOutside: false), VariableStyle.None);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: false, variableDeclared: true, readInside: true, writtenInside: true, readOutside: false, writtenOutside: true), VariableStyle.SplitOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: false, variableDeclared: true, readInside: true, writtenInside: true, readOutside: true, writtenOutside: true), VariableStyle.SplitOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: true, variableDeclared: false, readInside: false, writtenInside: true, readOutside: false, writtenOutside: false), VariableStyle.MoveIn);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: true, variableDeclared: false, readInside: false, writtenInside: true, readOutside: false, writtenOutside: true), VariableStyle.SplitIn);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: true, variableDeclared: false, readInside: false, writtenInside: true, readOutside: true, writtenOutside: false), VariableStyle.SplitIn);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: true, variableDeclared: false, readInside: false, writtenInside: true, readOutside: true, writtenOutside: true), VariableStyle.SplitIn);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: true, variableDeclared: false, readInside: true, writtenInside: true, readOutside: false, writtenOutside: false), VariableStyle.MoveIn);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: true, variableDeclared: false, readInside: true, writtenInside: true, readOutside: false, writtenOutside: true), VariableStyle.SplitIn);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: true, variableDeclared: false, readInside: true, writtenInside: true, readOutside: true, writtenOutside: false), VariableStyle.SplitIn);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: true, variableDeclared: false, readInside: true, writtenInside: true, readOutside: true, writtenOutside: true), VariableStyle.SplitIn);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: true, variableDeclared: true, readInside: false, writtenInside: true, readOutside: false, writtenOutside: false), VariableStyle.None);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: true, variableDeclared: true, readInside: false, writtenInside: true, readOutside: false, writtenOutside: true), VariableStyle.SplitOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: true, variableDeclared: true, readInside: false, writtenInside: true, readOutside: true, writtenOutside: true), VariableStyle.SplitOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: true, variableDeclared: true, readInside: true, writtenInside: true, readOutside: false, writtenOutside: false), VariableStyle.None);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: true, variableDeclared: true, readInside: true, writtenInside: true, readOutside: false, writtenOutside: true), VariableStyle.SplitOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: false, alwaysAssigned: true, variableDeclared: true, readInside: true, writtenInside: true, readOutside: true, writtenOutside: true), VariableStyle.SplitOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: true, alwaysAssigned: false, variableDeclared: false, readInside: false, writtenInside: true, readOutside: true, writtenOutside: false), VariableStyle.Ref);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: true, alwaysAssigned: false, variableDeclared: false, readInside: false, writtenInside: true, readOutside: true, writtenOutside: true), VariableStyle.Ref);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: true, alwaysAssigned: false, variableDeclared: false, readInside: true, writtenInside: true, readOutside: true, writtenOutside: false), VariableStyle.Ref);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: true, alwaysAssigned: false, variableDeclared: false, readInside: true, writtenInside: true, readOutside: true, writtenOutside: true), VariableStyle.Ref);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: true, alwaysAssigned: false, variableDeclared: true, readInside: false, writtenInside: false, readOutside: true, writtenOutside: false), VariableStyle.NotUsed);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: true, alwaysAssigned: false, variableDeclared: true, readInside: false, writtenInside: false, readOutside: true, writtenOutside: true), VariableStyle.NotUsed);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: true, alwaysAssigned: false, variableDeclared: true, readInside: false, writtenInside: true, readOutside: true, writtenOutside: false), VariableStyle.OutWithMoveOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: true, alwaysAssigned: false, variableDeclared: true, readInside: false, writtenInside: true, readOutside: true, writtenOutside: true), VariableStyle.OutWithMoveOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: true, alwaysAssigned: false, variableDeclared: true, readInside: true, writtenInside: false, readOutside: true, writtenOutside: false), VariableStyle.OutWithMoveOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: true, alwaysAssigned: false, variableDeclared: true, readInside: true, writtenInside: false, readOutside: true, writtenOutside: true), VariableStyle.OutWithMoveOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: true, alwaysAssigned: false, variableDeclared: true, readInside: true, writtenInside: true, readOutside: true, writtenOutside: false), VariableStyle.OutWithMoveOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: true, alwaysAssigned: false, variableDeclared: true, readInside: true, writtenInside: true, readOutside: true, writtenOutside: true), VariableStyle.OutWithMoveOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: true, alwaysAssigned: true, variableDeclared: false, readInside: false, writtenInside: true, readOutside: true, writtenOutside: false), VariableStyle.Out);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: true, alwaysAssigned: true, variableDeclared: false, readInside: false, writtenInside: true, readOutside: true, writtenOutside: true), VariableStyle.Out);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: true, alwaysAssigned: true, variableDeclared: false, readInside: true, writtenInside: true, readOutside: true, writtenOutside: false), VariableStyle.Out);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: true, alwaysAssigned: true, variableDeclared: false, readInside: true, writtenInside: true, readOutside: true, writtenOutside: true), VariableStyle.Out);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: true, alwaysAssigned: true, variableDeclared: true, readInside: false, writtenInside: true, readOutside: true, writtenOutside: false), VariableStyle.OutWithMoveOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: true, alwaysAssigned: true, variableDeclared: true, readInside: false, writtenInside: true, readOutside: true, writtenOutside: true), VariableStyle.OutWithMoveOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: true, alwaysAssigned: true, variableDeclared: true, readInside: true, writtenInside: true, readOutside: true, writtenOutside: false), VariableStyle.OutWithMoveOut);
+ s_matrix.Add(new Key(dataFlowIn: false, dataFlowOut: true, alwaysAssigned: true, variableDeclared: true, readInside: true, writtenInside: true, readOutside: true, writtenOutside: true), VariableStyle.OutWithMoveOut);
+ s_matrix.Add(new Key(dataFlowIn: true, dataFlowOut: false, alwaysAssigned: false, variableDeclared: false, readInside: true, writtenInside: false, readOutside: false, writtenOutside: false), VariableStyle.InputOnly);
+ s_matrix.Add(new Key(dataFlowIn: true, dataFlowOut: false, alwaysAssigned: false, variableDeclared: false, readInside: true, writtenInside: false, readOutside: false, writtenOutside: true), VariableStyle.InputOnly);
+ s_matrix.Add(new Key(dataFlowIn: true, dataFlowOut: false, alwaysAssigned: false, variableDeclared: false, readInside: true, writtenInside: false, readOutside: true, writtenOutside: false), VariableStyle.InputOnly);
+ s_matrix.Add(new Key(dataFlowIn: true, dataFlowOut: false, alwaysAssigned: false, variableDeclared: false, readInside: true, writtenInside: false, readOutside: true, writtenOutside: true), VariableStyle.InputOnly);
+ s_matrix.Add(new Key(dataFlowIn: true, dataFlowOut: false, alwaysAssigned: false, variableDeclared: false, readInside: true, writtenInside: true, readOutside: false, writtenOutside: false), VariableStyle.InputOnly);
+ s_matrix.Add(new Key(dataFlowIn: true, dataFlowOut: false, alwaysAssigned: false, variableDeclared: false, readInside: true, writtenInside: true, readOutside: false, writtenOutside: true), VariableStyle.InputOnly);
+ s_matrix.Add(new Key(dataFlowIn: true, dataFlowOut: false, alwaysAssigned: false, variableDeclared: false, readInside: true, writtenInside: true, readOutside: true, writtenOutside: false), VariableStyle.InputOnly);
+ s_matrix.Add(new Key(dataFlowIn: true, dataFlowOut: false, alwaysAssigned: false, variableDeclared: false, readInside: true, writtenInside: true, readOutside: true, writtenOutside: true), VariableStyle.InputOnly);
+ s_matrix.Add(new Key(dataFlowIn: true, dataFlowOut: false, alwaysAssigned: true, variableDeclared: false, readInside: true, writtenInside: true, readOutside: false, writtenOutside: false), VariableStyle.InputOnly);
+ s_matrix.Add(new Key(dataFlowIn: true, dataFlowOut: false, alwaysAssigned: true, variableDeclared: false, readInside: true, writtenInside: true, readOutside: false, writtenOutside: true), VariableStyle.InputOnly);
+ s_matrix.Add(new Key(dataFlowIn: true, dataFlowOut: false, alwaysAssigned: true, variableDeclared: false, readInside: true, writtenInside: true, readOutside: true, writtenOutside: false), VariableStyle.InputOnly);
+ s_matrix.Add(new Key(dataFlowIn: true, dataFlowOut: false, alwaysAssigned: true, variableDeclared: false, readInside: true, writtenInside: true, readOutside: true, writtenOutside: true), VariableStyle.InputOnly);
+ s_matrix.Add(new Key(dataFlowIn: true, dataFlowOut: true, alwaysAssigned: false, variableDeclared: false, readInside: true, writtenInside: true, readOutside: true, writtenOutside: false), VariableStyle.OutWithErrorInput);
+ s_matrix.Add(new Key(dataFlowIn: true, dataFlowOut: true, alwaysAssigned: false, variableDeclared: false, readInside: true, writtenInside: true, readOutside: true, writtenOutside: true), VariableStyle.Ref);
+ s_matrix.Add(new Key(dataFlowIn: true, dataFlowOut: true, alwaysAssigned: true, variableDeclared: false, readInside: true, writtenInside: true, readOutside: true, writtenOutside: false), VariableStyle.OutWithErrorInput);
+ s_matrix.Add(new Key(dataFlowIn: true, dataFlowOut: true, alwaysAssigned: true, variableDeclared: false, readInside: true, writtenInside: true, readOutside: true, writtenOutside: true), VariableStyle.Ref);
+ }
+
+ private struct Key : IEquatable<Key>
+ {
+ public bool DataFlowIn { get; }
+ public bool DataFlowOut { get; }
+ public bool AlwaysAssigned { get; }
+ public bool VariableDeclared { get; }
+ public bool ReadInside { get; }
+ public bool WrittenInside { get; }
+ public bool ReadOutside { get; }
+ public bool WrittenOutside { get; }
+
+ public Key(
+ bool dataFlowIn,
+ bool dataFlowOut,
+ bool alwaysAssigned,
+ bool variableDeclared,
+ bool readInside,
+ bool writtenInside,
+ bool readOutside,
+ bool writtenOutside) :
+ this()
+ {
+ this.DataFlowIn = dataFlowIn;
+ this.DataFlowOut = dataFlowOut;
+ this.AlwaysAssigned = alwaysAssigned;
+ this.VariableDeclared = variableDeclared;
+ this.ReadInside = readInside;
+ this.WrittenInside = writtenInside;
+ this.ReadOutside = readOutside;
+ this.WrittenOutside = writtenOutside;
+ }
+
+ public bool Equals(Key key)
+ {
+ return this.DataFlowIn == key.DataFlowIn &&
+ this.DataFlowOut == key.DataFlowOut &&
+ this.AlwaysAssigned == key.AlwaysAssigned &&
+ this.VariableDeclared == key.VariableDeclared &&
+ this.ReadInside == key.ReadInside &&
+ this.WrittenInside == key.WrittenInside &&
+ this.ReadOutside == key.ReadOutside &&
+ this.WrittenOutside == key.WrittenOutside;
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (obj is Key)
+ {
+ return Equals((Key)obj);
+ }
+
+ return false;
+ }
+
+ public override int GetHashCode()
+ {
+ var hashCode = 0;
+
+ hashCode = this.DataFlowIn ? 1 << 7 | hashCode : hashCode;
+ hashCode = this.DataFlowOut ? 1 << 6 | hashCode : hashCode;
+ hashCode = this.AlwaysAssigned ? 1 << 5 | hashCode : hashCode;
+ hashCode = this.VariableDeclared ? 1 << 4 | hashCode : hashCode;
+ hashCode = this.ReadInside ? 1 << 3 | hashCode : hashCode;
+ hashCode = this.WrittenInside ? 1 << 2 | hashCode : hashCode;
+ hashCode = this.ReadOutside ? 1 << 1 | hashCode : hashCode;
+ hashCode = this.WrittenOutside ? 1 << 0 | hashCode : hashCode;
+
+ return hashCode;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ExtractMethodOptions.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ExtractMethodOptions.cs
new file mode 100644
index 0000000000..9bb3dec0af
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ExtractMethodOptions.cs
@@ -0,0 +1,17 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using Microsoft.CodeAnalysis.Options;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ static class ExtractMethodOptions
+ {
+ public const string FeatureName = "ExtractMethod";
+
+ public static readonly PerLanguageOption<bool> AllowBestEffort = new PerLanguageOption<bool>(FeatureName, "Allow Best Effort", defaultValue: false);
+
+ public static readonly PerLanguageOption<bool> DontPutOutOrRefOnStruct = new PerLanguageOption<bool>(FeatureName, "Don't Put Out Or Ref On Strcut", defaultValue: true);
+
+ public static readonly PerLanguageOption<bool> AllowMovingDeclaration = new PerLanguageOption<bool>(FeatureName, "Allow Moving Declaration", defaultValue: false);
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ExtractMethodResult.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ExtractMethodResult.cs
new file mode 100644
index 0000000000..16a49ae80d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ExtractMethodResult.cs
@@ -0,0 +1,66 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using Roslyn.Utilities;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ class ExtractMethodResult
+ {
+ /// <summary>
+ /// True if the extract method operation succeeded.
+ /// </summary>
+ public bool Succeeded { get; }
+
+ /// <summary>
+ /// True if the extract method operation is possible if the original span is adjusted.
+ /// </summary>
+ public bool SucceededWithSuggestion { get; }
+
+ /// <summary>
+ /// The transformed document that was produced as a result of the extract method operation.
+ /// </summary>
+ public Document Document { get; }
+
+ /// <summary>
+ /// The reasons why the extract method operation did not succeed.
+ /// </summary>
+ public IEnumerable<string> Reasons { get; }
+
+ /// <summary>
+ /// the generated method node that contains the extracted code.
+ /// </summary>
+ public SyntaxNode MethodDeclarationNode { get; }
+
+ /// <summary>
+ /// The name token for the invocation node that replaces the extracted code.
+ /// </summary>
+ public SyntaxToken InvocationNameToken { get; }
+
+ public ExtractMethodResult(
+ OperationStatusFlag status,
+ IEnumerable<string> reasons,
+ Document document,
+ SyntaxToken invocationNameToken,
+ SyntaxNode methodDeclarationNode)
+ {
+ this.Status = status;
+
+ this.Succeeded = status.Succeeded() && !status.HasSuggestion();
+ this.SucceededWithSuggestion = status.Succeeded() && status.HasSuggestion();
+
+ this.Reasons = (reasons ?? SpecializedCollections.EmptyEnumerable<string>()).ToReadOnlyCollection();
+
+ this.Document = document;
+ this.InvocationNameToken = invocationNameToken;
+ this.MethodDeclarationNode = methodDeclarationNode;
+ }
+
+ /// <summary>
+ /// public status of result. more fine grained reason why it is failed.
+ /// </summary>
+ public OperationStatusFlag Status { get; }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ExtractMethodService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ExtractMethodService.cs
new file mode 100644
index 0000000000..db42f1dc3a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ExtractMethodService.cs
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ static class ExtractMethodService
+ {
+ readonly static CSharpExtractMethodService service = new CSharpExtractMethodService ();
+
+ public static Task<ExtractMethodResult> ExtractMethodAsync(Document document, TextSpan textSpan, OptionSet options = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return service.ExtractMethodAsync(document, textSpan, options, cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/FailedExtractMethodResult.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/FailedExtractMethodResult.cs
new file mode 100644
index 0000000000..eeeea1b54e
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/FailedExtractMethodResult.cs
@@ -0,0 +1,13 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ class FailedExtractMethodResult : ExtractMethodResult
+ {
+ public FailedExtractMethodResult(OperationStatus status)
+ : base(status.Flag, status.Reasons, null, default(SyntaxToken), default(SyntaxNode))
+ {
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/IExtractMethodService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/IExtractMethodService.cs
new file mode 100644
index 0000000000..4422c18b45
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/IExtractMethodService.cs
@@ -0,0 +1,16 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ interface IExtractMethodService : ILanguageService
+ {
+ Task<ExtractMethodResult> ExtractMethodAsync(Document document, TextSpan textSpan, OptionSet options = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ISyntaxTriviaService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ISyntaxTriviaService.cs
new file mode 100644
index 0000000000..f75f66ce20
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ISyntaxTriviaService.cs
@@ -0,0 +1,66 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ public enum TriviaLocation
+ {
+ BeforeBeginningOfSpan = 0,
+ AfterBeginningOfSpan,
+ BeforeEndOfSpan,
+ AfterEndOfSpan
+ }
+
+ public struct PreviousNextTokenPair
+ {
+ public SyntaxToken PreviousToken { get; set; }
+ public SyntaxToken NextToken { get; set; }
+ }
+
+ public struct LeadingTrailingTriviaPair
+ {
+ public IEnumerable<SyntaxTrivia> LeadingTrivia { get; set; }
+ public IEnumerable<SyntaxTrivia> TrailingTrivia { get; set; }
+ }
+
+ public delegate SyntaxToken AnnotationResolver(SyntaxNode root, TriviaLocation location, SyntaxAnnotation annotation);
+ public delegate IEnumerable<SyntaxTrivia> TriviaResolver(TriviaLocation location, PreviousNextTokenPair tokenPair, Dictionary<SyntaxToken, LeadingTrailingTriviaPair> triviaMap);
+
+ /// <summary>
+ /// contains information to restore trivia later on to the annotated tree
+ /// </summary>
+ public interface ITriviaSavedResult
+ {
+ /// <summary>
+ /// root node of the annotated tree.
+ /// </summary>
+ SyntaxNode Root { get; }
+
+ /// <summary>
+ /// restore saved trivia to given tree
+ /// </summary>
+ /// <param name="root">root node to the annotated tree</param>
+ /// <param name="annotationResolver">it provides a custom way of resolving annotations to retrieve right tokens to attach trivia</param>
+ /// <param name="triviaResolver">it provides a custom way of creating trivia list between two tokens</param>
+ /// <returns>root node to a trivia restored tree</returns>
+ SyntaxNode RestoreTrivia(SyntaxNode root, AnnotationResolver annotationResolver = null, TriviaResolver triviaResolver = null);
+ }
+
+ /// <summary>
+ /// syntax trivia related services
+ /// </summary>
+ public interface ISyntaxTriviaService : ILanguageService
+ {
+ /// <summary>
+ /// save trivia around span and let user restore trivia later
+ /// </summary>
+ /// <param name="root">root node of a tree</param>
+ /// <param name="textSpan">selection whose trivia around its edges will be saved</param>
+ /// <returns>object that holds onto enough information to restore trivia later</returns>
+ ITriviaSavedResult SaveTriviaAroundSelection(SyntaxNode root, TextSpan textSpan);
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/InsertionPoint.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/InsertionPoint.cs
new file mode 100644
index 0000000000..51bbb415e0
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/InsertionPoint.cs
@@ -0,0 +1,64 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ class InsertionPoint
+ {
+ private readonly SyntaxAnnotation _annotation;
+ private readonly Lazy<SyntaxNode> _context;
+
+ public static async Task<InsertionPoint> CreateAsync(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ var root = document.Root;
+ var annotation = new SyntaxAnnotation();
+ var newRoot = root.AddAnnotations(SpecializedCollections.SingletonEnumerable(Tuple.Create(node, annotation)));
+ return new InsertionPoint(await document.WithSyntaxRootAsync(newRoot, cancellationToken).ConfigureAwait(false), annotation);
+ }
+
+ private InsertionPoint(SemanticDocument document, SyntaxAnnotation annotation)
+ {
+ //Contract.ThrowIfNull(document);
+ //Contract.ThrowIfNull(annotation);
+
+ this.SemanticDocument = document;
+ _annotation = annotation;
+ _context = CreateLazyContextNode();
+ }
+
+ public SemanticDocument SemanticDocument { get; }
+
+ public SyntaxNode GetRoot()
+ {
+ return this.SemanticDocument.Root;
+ }
+
+ public SyntaxNode GetContext()
+ {
+ return _context.Value;
+ }
+
+ public InsertionPoint With(SemanticDocument document)
+ {
+ return new InsertionPoint(document, _annotation);
+ }
+
+ private Lazy<SyntaxNode> CreateLazyContextNode()
+ {
+ return new Lazy<SyntaxNode>(ComputeContextNode, isThreadSafe: true);
+ }
+
+ private SyntaxNode ComputeContextNode()
+ {
+ var root = this.SemanticDocument.Root;
+ return root.GetAnnotatedNodesAndTokens(_annotation).Single().AsNode();
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.Analyzer.SymbolMapBuilder.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.Analyzer.SymbolMapBuilder.cs
new file mode 100644
index 0000000000..f0d01b4629
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.Analyzer.SymbolMapBuilder.cs
@@ -0,0 +1,79 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ abstract partial class MethodExtractor
+ {
+ protected abstract partial class Analyzer
+ {
+ private class SymbolMapBuilder : SyntaxWalker
+ {
+ private readonly SemanticModel _semanticModel;
+ //private readonly ISyntaxFactsService _service;
+ private readonly TextSpan _span;
+ private readonly Dictionary<ISymbol, List<SyntaxToken>> _symbolMap;
+ private readonly CancellationToken _cancellationToken;
+
+ public static Dictionary<ISymbol, List<SyntaxToken>> Build(
+ // ISyntaxFactsService service,
+ SemanticModel semanticModel,
+ SyntaxNode root,
+ TextSpan span,
+ CancellationToken cancellationToken)
+ {
+ //Contract.ThrowIfNull(semanticModel);
+// Contract.ThrowIfNull(service);
+ //Contract.ThrowIfNull(root);
+
+ var builder = new SymbolMapBuilder(/*service, */semanticModel, span, cancellationToken);
+ builder.Visit(root);
+
+ return builder._symbolMap;
+ }
+
+ private SymbolMapBuilder(
+ // ISyntaxFactsService service,
+ SemanticModel semanticModel,
+ TextSpan span,
+ CancellationToken cancellationToken)
+ : base(SyntaxWalkerDepth.Token)
+ {
+ _semanticModel = semanticModel;
+ // _service = service;
+ _span = span;
+ _symbolMap = new Dictionary<ISymbol, List<SyntaxToken>>();
+ _cancellationToken = cancellationToken;
+ }
+
+ protected override void VisitToken(SyntaxToken token)
+ {
+ if (token.IsMissing ||
+ token.Width() <= 0 ||
+ !token.IsIdentifier() ||
+ !_span.Contains(token.Span) ||
+ token.Parent.IsNamedParameter())
+ {
+ return;
+ }
+
+ var symbolInfo = _semanticModel.GetSymbolInfo(token, _cancellationToken);
+ foreach (var sym in symbolInfo.GetAllSymbols())
+ {
+ // add binding result to map
+ var list = _symbolMap.GetOrAdd(sym, _ => new List<SyntaxToken>());
+ list.Add(token);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.Analyzer.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.Analyzer.cs
new file mode 100644
index 0000000000..c2826dae1d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.Analyzer.cs
@@ -0,0 +1,957 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ abstract partial class MethodExtractor
+ {
+ protected abstract partial class Analyzer
+ {
+ private readonly SemanticDocument _semanticDocument;
+
+ protected readonly CancellationToken CancellationToken;
+ protected readonly SelectionResult SelectionResult;
+
+ protected Analyzer(SelectionResult selectionResult, CancellationToken cancellationToken)
+ {
+ //Contract.ThrowIfNull(selectionResult);
+
+ this.SelectionResult = selectionResult;
+ _semanticDocument = selectionResult.SemanticDocument;
+ this.CancellationToken = cancellationToken;
+ }
+
+ /// <summary>
+ /// convert text span to node range for the flow analysis API
+ /// </summary>
+ protected abstract Tuple<SyntaxNode, SyntaxNode> GetFlowAnalysisNodeRange();
+
+ /// <summary>
+ /// check whether selection contains return statement or not
+ /// </summary>
+ protected abstract bool ContainsReturnStatementInSelectedCode(IEnumerable<SyntaxNode> jumpOutOfRegionStatements);
+
+ /// <summary>
+ /// create VariableInfo type
+ /// </summary>
+ protected abstract VariableInfo CreateFromSymbol(Compilation compilation, ISymbol symbol, ITypeSymbol type, VariableStyle variableStyle, bool variableDeclared);
+
+ /// <summary>
+ /// among variables that will be used as parameters at the extracted method, check whether one of the parameter can be used as return
+ /// </summary>
+ protected abstract int GetIndexOfVariableInfoToUseAsReturnValue(IList<VariableInfo> variableInfo);
+
+ /// <summary>
+ /// get type of the range variable symbol
+ /// </summary>
+ protected abstract ITypeSymbol GetRangeVariableType(SemanticModel model, IRangeVariableSymbol symbol);
+
+ /// <summary>
+ /// check whether the selection is at the placed where read-only field is allowed to be extracted out
+ /// </summary>
+ /// <returns></returns>
+ protected abstract bool ReadOnlyFieldAllowed();
+
+ public async Task<AnalyzerResult> AnalyzeAsync()
+ {
+ // do data flow analysis
+ var model = _semanticDocument.SemanticModel;
+ var dataFlowAnalysisData = GetDataFlowAnalysisData(model);
+
+ // build symbol map for the identifiers used inside of the selection
+ var symbolMap = GetSymbolMap(model);
+
+ // gather initial local or parameter variable info
+ var variableInfoMap = GenerateVariableInfoMap(model, dataFlowAnalysisData, symbolMap);
+
+ // check whether instance member is used inside of the selection
+ var instanceMemberIsUsed = IsInstanceMemberUsedInSelectedCode(dataFlowAnalysisData);
+
+ // check whether end of selection is reachable
+ var endOfSelectionReachable = IsEndOfSelectionReachable(model);
+
+ // collects various variable informations
+ // extracted code contains return value
+ var isInExpressionOrHasReturnStatement = IsInExpressionOrHasReturnStatement(model);
+ var signatureTuple = GetSignatureInformation(model, dataFlowAnalysisData, variableInfoMap, isInExpressionOrHasReturnStatement);
+
+ var parameters = signatureTuple.Item1;
+ var returnType = signatureTuple.Item2;
+ var variableToUseAsReturnValue = signatureTuple.Item3;
+ var unsafeAddressTakenUsed = signatureTuple.Item4;
+
+ var returnTypeTuple = AdjustReturnType(model, returnType);
+
+ returnType = returnTypeTuple.Item1;
+ bool returnTypeHasAnonymousType = returnTypeTuple.Item2;
+ bool awaitTaskReturn = returnTypeTuple.Item3;
+
+ // create new document
+ var newDocument = await CreateDocumentWithAnnotationsAsync(_semanticDocument, parameters, CancellationToken).ConfigureAwait(false);
+
+ // collect method type variable used in selected code
+ var sortedMap = new SortedDictionary<int, ITypeParameterSymbol>();
+ var typeParametersInConstraintList = GetMethodTypeParametersInConstraintList(model, variableInfoMap, symbolMap, sortedMap);
+ var typeParametersInDeclaration = GetMethodTypeParametersInDeclaration(returnType, sortedMap);
+
+ // check various error cases
+ var operationStatus = GetOperationStatus(model, symbolMap, parameters, unsafeAddressTakenUsed, returnTypeHasAnonymousType);
+
+ return new AnalyzerResult(
+ newDocument,
+ typeParametersInDeclaration, typeParametersInConstraintList,
+ parameters, variableToUseAsReturnValue, returnType, awaitTaskReturn,
+ instanceMemberIsUsed, endOfSelectionReachable, operationStatus);
+ }
+
+ private Tuple<ITypeSymbol, bool, bool> AdjustReturnType(SemanticModel model, ITypeSymbol returnType)
+ {
+ // check whether return type contains anonymous type and if it does, fix it up by making it object
+ var returnTypeHasAnonymousType = returnType.ContainsAnonymousType();
+ returnType = returnTypeHasAnonymousType ? returnType.RemoveAnonymousTypes(model.Compilation) : returnType;
+
+ // if selection contains await which is not under async lambda or anonymous delegate,
+ // change return type to be wrapped in Task
+ var shouldPutAsyncModifier = this.SelectionResult.ShouldPutAsyncModifier();
+ if (shouldPutAsyncModifier)
+ {
+ bool awaitTaskReturn;
+ WrapReturnTypeInTask(model, ref returnType, out awaitTaskReturn);
+
+ return Tuple.Create(returnType, returnTypeHasAnonymousType, awaitTaskReturn);
+ }
+
+ // unwrap task if needed
+ UnwrapTaskIfNeeded(model, ref returnType);
+ return Tuple.Create(returnType, returnTypeHasAnonymousType, false);
+ }
+
+ private void UnwrapTaskIfNeeded(SemanticModel model, ref ITypeSymbol returnType)
+ {
+ // nothing to unwrap
+ if (!this.SelectionResult.ContainingScopeHasAsyncKeyword() ||
+ !this.ContainsReturnStatementInSelectedCode(model))
+ {
+ return;
+ }
+
+ var originalDefinition = returnType.OriginalDefinition;
+
+ // see whether it needs to be unwrapped
+ var taskType = model.Compilation.TaskType();
+ if (originalDefinition.Equals(taskType))
+ {
+ returnType = model.Compilation.GetSpecialType(SpecialType.System_Void);
+ return;
+ }
+
+ var genericTaskType = model.Compilation.TaskOfTType();
+ if (originalDefinition.Equals(genericTaskType))
+ {
+ returnType = ((INamedTypeSymbol)returnType).TypeArguments[0];
+ return;
+ }
+
+ // nothing to unwrap
+ return;
+ }
+
+ private void WrapReturnTypeInTask(SemanticModel model, ref ITypeSymbol returnType, out bool awaitTaskReturn)
+ {
+ awaitTaskReturn = false;
+
+ var genericTaskType = model.Compilation.TaskOfTType();
+ var taskType = model.Compilation.TaskType();
+
+ if (returnType.Equals(model.Compilation.GetSpecialType(SpecialType.System_Void)))
+ {
+ // convert void to Task type
+ awaitTaskReturn = true;
+ returnType = taskType;
+ return;
+ }
+
+ if (this.SelectionResult.SelectionInExpression)
+ {
+ returnType = genericTaskType.Construct(returnType);
+ return;
+ }
+
+ if (ContainsReturnStatementInSelectedCode(model))
+ {
+ // check whether we will use return type as it is or not.
+ awaitTaskReturn = returnType.Equals(taskType);
+ return;
+ }
+
+ // okay, wrap the return type in Task<T>
+ returnType = genericTaskType.Construct(returnType);
+ }
+
+ private Tuple<IList<VariableInfo>, ITypeSymbol, VariableInfo, bool> GetSignatureInformation(
+ SemanticModel model,
+ DataFlowAnalysis dataFlowAnalysisData,
+ IDictionary<ISymbol, VariableInfo> variableInfoMap,
+ bool isInExpressionOrHasReturnStatement)
+ {
+ if (isInExpressionOrHasReturnStatement)
+ {
+ // check whether current selection contains return statement
+ var parameters = GetMethodParameters(variableInfoMap.Values);
+ var returnType = this.SelectionResult.GetContainingScopeType();
+ if (returnType == null)
+ {
+ returnType = model.Compilation.GetSpecialType(SpecialType.System_Object);
+ }
+
+ var unsafeAddressTakenUsed = ContainsVariableUnsafeAddressTaken(dataFlowAnalysisData, variableInfoMap.Keys);
+ return Tuple.Create(parameters, returnType, default(VariableInfo), unsafeAddressTakenUsed);
+ }
+ else
+ {
+ // no return statement
+ var parameters = MarkVariableInfoToUseAsReturnValueIfPossible(GetMethodParameters(variableInfoMap.Values));
+ var variableToUseAsReturnValue = parameters.FirstOrDefault(v => v.UseAsReturnValue);
+ var returnType = default(ITypeSymbol);
+ if (variableToUseAsReturnValue != null)
+ {
+ returnType = variableToUseAsReturnValue.GetVariableType(_semanticDocument);
+ }
+ else
+ {
+ returnType = model.Compilation.GetSpecialType(SpecialType.System_Void);
+ }
+
+ var unsafeAddressTakenUsed = ContainsVariableUnsafeAddressTaken(dataFlowAnalysisData, variableInfoMap.Keys);
+ return Tuple.Create(parameters, returnType, variableToUseAsReturnValue, unsafeAddressTakenUsed);
+ }
+ }
+
+ private bool IsInExpressionOrHasReturnStatement(SemanticModel model)
+ {
+ var isInExpressionOrHasReturnStatement = this.SelectionResult.SelectionInExpression;
+ if (!isInExpressionOrHasReturnStatement)
+ {
+ var containsReturnStatement = ContainsReturnStatementInSelectedCode(model);
+ isInExpressionOrHasReturnStatement |= containsReturnStatement;
+ }
+
+ return isInExpressionOrHasReturnStatement;
+ }
+
+ private OperationStatus GetOperationStatus(
+ SemanticModel model, Dictionary<ISymbol, List<SyntaxToken>> symbolMap, IList<VariableInfo> parameters,
+ bool unsafeAddressTakenUsed, bool returnTypeHasAnonymousType)
+ {
+ var readonlyFieldStatus = CheckReadOnlyFields(model, symbolMap);
+
+ var namesWithAnonymousTypes = parameters.Where(v => v.OriginalTypeHadAnonymousTypeOrDelegate).Select(v => v.Name ?? string.Empty);
+ if (returnTypeHasAnonymousType)
+ {
+ namesWithAnonymousTypes = namesWithAnonymousTypes.Concat("return type");
+ }
+
+ var anonymousTypeStatus = namesWithAnonymousTypes.Any() ?
+ new OperationStatus(OperationStatusFlag.BestEffort, string.Format("FeaturesResources.ContainsAnonymousType", string.Join(", ", namesWithAnonymousTypes))) :
+ OperationStatus.Succeeded;
+
+ var unsafeAddressStatus = unsafeAddressTakenUsed ? OperationStatus.UnsafeAddressTaken : OperationStatus.Succeeded;
+
+ var asyncRefOutParameterStatue = CheckAsyncMethodRefOutParameters(parameters);
+
+ return readonlyFieldStatus.With(anonymousTypeStatus).With(unsafeAddressStatus).With(asyncRefOutParameterStatue);
+ }
+
+ private OperationStatus CheckAsyncMethodRefOutParameters(IList<VariableInfo> parameters)
+ {
+ if (this.SelectionResult.ShouldPutAsyncModifier())
+ {
+ var names = parameters.Where(v => !v.UseAsReturnValue && (v.ParameterModifier == ParameterBehavior.Out || v.ParameterModifier == ParameterBehavior.Ref))
+ .Select(p => p.Name ?? string.Empty);
+
+ if (names.Any())
+ {
+ return new OperationStatus(OperationStatusFlag.BestEffort, string.Format("FeaturesResources.AsyncMethodWithRefOutParameters", string.Join(", ", names)));
+ }
+ }
+
+ return OperationStatus.Succeeded;
+ }
+
+ private Task<SemanticDocument> CreateDocumentWithAnnotationsAsync(SemanticDocument document, IList<VariableInfo> variables, CancellationToken cancellationToken)
+ {
+ var annotations = new List<Tuple<SyntaxToken, SyntaxAnnotation>>(variables.Count);
+ variables.Do(v => v.AddIdentifierTokenAnnotationPair(annotations, cancellationToken));
+
+ if (annotations.Count == 0)
+ {
+ return Task.FromResult(document);
+ }
+
+ return document.WithSyntaxRootAsync(document.Root.AddAnnotations(annotations), cancellationToken);
+ }
+
+ private Dictionary<ISymbol, List<SyntaxToken>> GetSymbolMap(SemanticModel model)
+ {
+ var context = this.SelectionResult.GetContainingScope();
+ var symbolMap = SymbolMapBuilder.Build(model, context, this.SelectionResult.FinalSpan, CancellationToken);
+
+ return symbolMap;
+ }
+
+ private bool ContainsVariableUnsafeAddressTaken(DataFlowAnalysis dataFlowAnalysisData, IEnumerable<ISymbol> symbols)
+ {
+ // check whether the selection contains "&" over a symbol exist
+ var map = new HashSet<ISymbol>(dataFlowAnalysisData.UnsafeAddressTaken);
+ return symbols.Any(s => map.Contains(s));
+ }
+
+ private DataFlowAnalysis GetDataFlowAnalysisData(SemanticModel model)
+ {
+ if (this.SelectionResult.SelectionInExpression)
+ {
+ return model.AnalyzeDataFlow(this.SelectionResult.GetContainingScope());
+ }
+
+ var pair = GetFlowAnalysisNodeRange();
+ return model.AnalyzeDataFlow(pair.Item1, pair.Item2);
+ }
+
+ private bool IsEndOfSelectionReachable(SemanticModel model)
+ {
+ if (this.SelectionResult.SelectionInExpression)
+ {
+ return true;
+ }
+
+ var pair = GetFlowAnalysisNodeRange();
+ var analysis = model.AnalyzeControlFlow(pair.Item1, pair.Item2);
+ return analysis.EndPointIsReachable;
+ }
+
+ private IList<VariableInfo> MarkVariableInfoToUseAsReturnValueIfPossible(IList<VariableInfo> variableInfo)
+ {
+ var variableToUseAsReturnValueIndex = GetIndexOfVariableInfoToUseAsReturnValue(variableInfo);
+ if (variableToUseAsReturnValueIndex >= 0)
+ {
+ variableInfo[variableToUseAsReturnValueIndex] = VariableInfo.CreateReturnValue(variableInfo[variableToUseAsReturnValueIndex]);
+ }
+
+ return variableInfo;
+ }
+
+ private IList<VariableInfo> GetMethodParameters(ICollection<VariableInfo> variableInfo)
+ {
+ var list = new List<VariableInfo>(variableInfo);
+
+ list.Sort(VariableInfo.Compare);
+
+ return list;
+ }
+
+ private IDictionary<ISymbol, VariableInfo> GenerateVariableInfoMap(
+ SemanticModel model, DataFlowAnalysis dataFlowAnalysisData, Dictionary<ISymbol, List<SyntaxToken>> symbolMap)
+ {
+// Contract.ThrowIfNull(model);
+// Contract.ThrowIfNull(dataFlowAnalysisData);
+
+ var variableInfoMap = new Dictionary<ISymbol, VariableInfo>();
+
+ // create map of each data
+ var capturedMap = new HashSet<ISymbol>(dataFlowAnalysisData.Captured);
+ var dataFlowInMap = new HashSet<ISymbol>(dataFlowAnalysisData.DataFlowsIn);
+ var dataFlowOutMap = new HashSet<ISymbol>(dataFlowAnalysisData.DataFlowsOut);
+ var alwaysAssignedMap = new HashSet<ISymbol>(dataFlowAnalysisData.AlwaysAssigned);
+ var variableDeclaredMap = new HashSet<ISymbol>(dataFlowAnalysisData.VariablesDeclared);
+ var readInsideMap = new HashSet<ISymbol>(dataFlowAnalysisData.ReadInside);
+ var writtenInsideMap = new HashSet<ISymbol>(dataFlowAnalysisData.WrittenInside);
+ var readOutsideMap = new HashSet<ISymbol>(dataFlowAnalysisData.ReadOutside);
+ var writtenOutsideMap = new HashSet<ISymbol>(dataFlowAnalysisData.WrittenOutside);
+ var unsafeAddressTakenMap = new HashSet<ISymbol>(dataFlowAnalysisData.UnsafeAddressTaken);
+
+ // gather all meaningful symbols for the span.
+ var candidates = new HashSet<ISymbol>(readInsideMap);
+ candidates.UnionWith(writtenInsideMap);
+ candidates.UnionWith(variableDeclaredMap);
+
+ foreach (var symbol in candidates)
+ {
+ if (IsThisParameter(symbol) ||
+ IsInteractiveSynthesizedParameter(symbol))
+ {
+ continue;
+ }
+
+ var captured = capturedMap.Contains(symbol);
+ var dataFlowIn = dataFlowInMap.Contains(symbol);
+ var dataFlowOut = dataFlowOutMap.Contains(symbol);
+ var alwaysAssigned = alwaysAssignedMap.Contains(symbol);
+ var variableDeclared = variableDeclaredMap.Contains(symbol);
+ var readInside = readInsideMap.Contains(symbol);
+ var writtenInside = writtenInsideMap.Contains(symbol);
+ var readOutside = readOutsideMap.Contains(symbol);
+ var writtenOutside = writtenOutsideMap.Contains(symbol);
+ var unsafeAddressTaken = unsafeAddressTakenMap.Contains(symbol);
+
+ // if it is static local, make sure it is not defined inside
+ if (symbol.IsStatic)
+ {
+ dataFlowIn = dataFlowIn && !variableDeclared;
+ }
+
+ // make sure readoutside is true when dataflowout is true (bug #3790)
+ // when a variable is only used inside of loop, a situation where dataflowout == true and readOutside == false
+ // can happen. but for extract method's point of view, this is not an information that would affect output.
+ // so, here we adjust flags to follow predefined assumption.
+ readOutside = readOutside || dataFlowOut;
+
+ // make sure data flow out is true when declared inside/written inside/read outside/not written outside are true (bug #6277)
+ dataFlowOut = dataFlowOut || (variableDeclared && writtenInside && readOutside && !writtenOutside);
+
+ // variable that is declared inside but never referenced outside. just ignore it and move to next one.
+ if (variableDeclared && !dataFlowOut && !readOutside && !writtenOutside)
+ {
+ continue;
+ }
+
+ // parameter defined inside of the selection (such as lambda parameter) will be ignored (bug # 10964)
+ if (symbol is IParameterSymbol && variableDeclared)
+ {
+ continue;
+ }
+
+ var type = GetSymbolType(model, symbol);
+ if (type == null)
+ {
+ continue;
+ }
+
+ var variableStyle = GetVariableStyle(symbolMap, symbol, model, type,
+ captured, dataFlowIn, dataFlowOut, alwaysAssigned, variableDeclared,
+ readInside, writtenInside, readOutside, writtenOutside, unsafeAddressTaken);
+
+ AddVariableToMap(variableInfoMap, symbol, CreateFromSymbol(model.Compilation, symbol, type, variableStyle, variableDeclared));
+ }
+
+ return variableInfoMap;
+ }
+
+ private void AddVariableToMap(IDictionary<ISymbol, VariableInfo> variableInfoMap, ISymbol localOrParameter, VariableInfo variableInfo)
+ {
+ variableInfoMap.Add(localOrParameter, variableInfo);
+ }
+
+ private VariableStyle GetVariableStyle(
+ Dictionary<ISymbol, List<SyntaxToken>> symbolMap,
+ ISymbol symbol,
+ SemanticModel model,
+ ITypeSymbol type,
+ bool captured,
+ bool dataFlowIn,
+ bool dataFlowOut,
+ bool alwaysAssigned,
+ bool variableDeclared,
+ bool readInside,
+ bool writtenInside,
+ bool readOutside,
+ bool writtenOutside,
+ bool unsafeAddressTaken)
+ {
+// Contract.ThrowIfNull(model);
+// Contract.ThrowIfNull(type);
+
+ var style = ExtractMethodMatrix.GetVariableStyle(captured, dataFlowIn, dataFlowOut, alwaysAssigned, variableDeclared,
+ readInside, writtenInside, readOutside, writtenOutside, unsafeAddressTaken);
+
+ if (SelectionContainsOnlyIdentifierWithSameType(type))
+ {
+ return style;
+ }
+
+ if (UserDefinedValueType(model.Compilation, type) && !this.SelectionResult.DontPutOutOrRefOnStruct)
+ {
+ return AlwaysReturn(style);
+ }
+
+ // for captured variable, never try to move the decl into extracted method
+ if (captured && (style == VariableStyle.MoveIn))
+ {
+ return VariableStyle.Out;
+ }
+
+ // check special value type cases
+ if (type.IsValueType && !IsWrittenInsideForFrameworkValueType(symbolMap, model, symbol, writtenInside))
+ {
+ return style;
+ }
+
+ // don't blindly always return. make sure there is a write inside of the selection
+ if (this.SelectionResult.AllowMovingDeclaration || !writtenInside)
+ {
+ return style;
+ }
+
+ return AlwaysReturn(style);
+ }
+
+ private bool IsWrittenInsideForFrameworkValueType(
+ Dictionary<ISymbol, List<SyntaxToken>> symbolMap, SemanticModel model, ISymbol symbol, bool writtenInside)
+ {
+ List<SyntaxToken> tokens;
+ if (!symbolMap.TryGetValue(symbol, out tokens))
+ {
+ return writtenInside;
+ }
+
+ // this relies on the fact that our IsWrittenTo only cares about syntax to figure out whether
+ // something is written to or not. but not semantic.
+ // we probably need to move the API to syntaxFact service not semanticFact.
+ //
+ // if one wants to get result that also considers semantic, he should use data control flow analysis API.
+ return tokens.Any(t => t.Parent is ExpressionSyntax && ((ExpressionSyntax)t.Parent).IsWrittenTo());
+ }
+
+ private bool SelectionContainsOnlyIdentifierWithSameType(ITypeSymbol type)
+ {
+ if (!this.SelectionResult.SelectionInExpression)
+ {
+ return false;
+ }
+
+ var firstToken = this.SelectionResult.GetFirstTokenInSelection();
+ var lastToken = this.SelectionResult.GetLastTokenInSelection();
+
+ if (!firstToken.Equals(lastToken))
+ {
+ return false;
+ }
+
+ return type.Equals(this.SelectionResult.GetContainingScopeType());
+ }
+
+ private bool UserDefinedValueType(Compilation compilation, ITypeSymbol type)
+ {
+ if (!type.IsValueType || type.IsPointerType() || type.IsEnumType())
+ {
+ return false;
+ }
+
+ return type.OriginalDefinition.SpecialType == SpecialType.None && !WellKnownFrameworkValueType(compilation, type);
+ }
+
+ private bool WellKnownFrameworkValueType(Compilation compilation, ITypeSymbol type)
+ {
+ if (!type.IsValueType)
+ {
+ return false;
+ }
+
+ var cancellationTokenType = compilation.GetTypeByMetadataName("System.Threading.CancellationToken");
+ if (cancellationTokenType != null && cancellationTokenType.Equals(type))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ private ITypeSymbol GetSymbolType(SemanticModel model, ISymbol symbol)
+ {
+ var local = symbol as ILocalSymbol;
+ if (local != null)
+ {
+ return local.Type;
+ }
+
+ var parameter = symbol as IParameterSymbol;
+ if (parameter != null)
+ {
+ return parameter.Type;
+ }
+
+ var rangeVariable = symbol as IRangeVariableSymbol;
+ if (rangeVariable != null)
+ {
+ return GetRangeVariableType(model, rangeVariable);
+ }
+
+ return null;
+ }
+
+ protected VariableStyle AlwaysReturn(VariableStyle style)
+ {
+ if (style == VariableStyle.InputOnly)
+ {
+ return VariableStyle.Ref;
+ }
+
+ if (style == VariableStyle.MoveIn)
+ {
+ return VariableStyle.Out;
+ }
+
+ if (style == VariableStyle.SplitIn)
+ {
+ return VariableStyle.Out;
+ }
+
+ if (style == VariableStyle.SplitOut)
+ {
+ return VariableStyle.OutWithMoveOut;
+ }
+
+ return style;
+ }
+
+ private bool IsParameterUsedOutside(ISymbol localOrParameter)
+ {
+ var parameter = localOrParameter as IParameterSymbol;
+ if (parameter == null)
+ {
+ return false;
+ }
+
+ return parameter.RefKind != RefKind.None;
+ }
+
+ private bool IsParameterAssigned(ISymbol localOrParameter)
+ {
+ // hack for now.
+ var parameter = localOrParameter as IParameterSymbol;
+ if (parameter == null)
+ {
+ return false;
+ }
+
+ return parameter.RefKind != RefKind.Out;
+ }
+
+ private bool IsThisParameter(ISymbol localOrParameter)
+ {
+ var parameter = localOrParameter as IParameterSymbol;
+ if (parameter == null)
+ {
+ return false;
+ }
+
+ return parameter.IsThis;
+ }
+
+ private bool IsInteractiveSynthesizedParameter(ISymbol localOrParameter)
+ {
+ var parameter = localOrParameter as IParameterSymbol;
+ if (parameter == null)
+ {
+ return false;
+ }
+
+ return parameter.IsImplicitlyDeclared &&
+ parameter.ContainingAssembly.IsInteractive &&
+ parameter.ContainingSymbol != null &&
+ parameter.ContainingSymbol.ContainingType != null &&
+ parameter.ContainingSymbol.ContainingType.IsScriptClass;
+ }
+
+ private bool ContainsReturnStatementInSelectedCode(SemanticModel model)
+ {
+ //Contract.ThrowIfTrue(this.SelectionResult.SelectionInExpression);
+
+ var pair = GetFlowAnalysisNodeRange();
+ var controlFlowAnalysisData = model.AnalyzeControlFlow(pair.Item1, pair.Item2);
+
+ return ContainsReturnStatementInSelectedCode(controlFlowAnalysisData.ExitPoints);
+ }
+
+ private void AddTypeParametersToMap(IEnumerable<ITypeParameterSymbol> typeParameters, IDictionary<int, ITypeParameterSymbol> sortedMap)
+ {
+ foreach (var typeParameter in typeParameters)
+ {
+ AddTypeParameterToMap(typeParameter, sortedMap);
+ }
+ }
+
+ private void AddTypeParameterToMap(ITypeParameterSymbol typeParameter, IDictionary<int, ITypeParameterSymbol> sortedMap)
+ {
+ if (typeParameter == null ||
+ typeParameter.DeclaringMethod == null ||
+ sortedMap.ContainsKey(typeParameter.Ordinal))
+ {
+ return;
+ }
+
+ sortedMap[typeParameter.Ordinal] = typeParameter;
+ }
+
+ private void AppendMethodTypeVariableFromDataFlowAnalysis(
+ SemanticModel model,
+ IDictionary<ISymbol, VariableInfo> variableInfoMap,
+ IDictionary<int, ITypeParameterSymbol> sortedMap)
+ {
+ foreach (var symbol in variableInfoMap.Keys)
+ {
+ var parameter = symbol as IParameterSymbol;
+ if (parameter != null)
+ {
+ AddTypeParametersToMap(TypeParameterCollector.Collect(parameter.Type), sortedMap);
+ continue;
+ }
+
+ var local = symbol as ILocalSymbol;
+ if (local != null)
+ {
+ AddTypeParametersToMap(TypeParameterCollector.Collect(local.Type), sortedMap);
+ continue;
+ }
+
+ var rangeVariable = symbol as IRangeVariableSymbol;
+ if (rangeVariable != null)
+ {
+ var type = GetRangeVariableType(model, rangeVariable);
+ AddTypeParametersToMap(TypeParameterCollector.Collect(type), sortedMap);
+ continue;
+ }
+
+ //Contract.Fail(FeaturesResources.UnknownSymbolKind);
+ }
+ }
+
+ private void AppendMethodTypeParameterFromConstraint(SortedDictionary<int, ITypeParameterSymbol> sortedMap)
+ {
+ var typeParametersInConstraint = new List<ITypeParameterSymbol>();
+
+ // collect all type parameter appears in constraint
+ foreach (var typeParameter in sortedMap.Values)
+ {
+ var constraintTypes = typeParameter.ConstraintTypes;
+ if (constraintTypes.IsDefaultOrEmpty)
+ {
+ continue;
+ }
+
+ foreach (var type in constraintTypes)
+ {
+ // constraint itself is type parameter
+ typeParametersInConstraint.AddRange(TypeParameterCollector.Collect(type));
+ }
+ }
+
+ // pick up only valid type parameter and add them to the map
+ foreach (var typeParameter in typeParametersInConstraint)
+ {
+ AddTypeParameterToMap(typeParameter, sortedMap);
+ }
+ }
+
+ private void AppendMethodTypeParameterUsedDirectly(IDictionary<ISymbol, List<SyntaxToken>> symbolMap, IDictionary<int, ITypeParameterSymbol> sortedMap)
+ {
+ foreach (var pair in symbolMap.Where(p => p.Key.Kind == SymbolKind.TypeParameter))
+ {
+ var typeParameter = pair.Key as ITypeParameterSymbol;
+ if (typeParameter.DeclaringMethod == null ||
+ sortedMap.ContainsKey(typeParameter.Ordinal))
+ {
+ continue;
+ }
+
+ sortedMap[typeParameter.Ordinal] = typeParameter;
+ }
+ }
+
+ private IEnumerable<ITypeParameterSymbol> GetMethodTypeParametersInConstraintList(
+ SemanticModel model,
+ IDictionary<ISymbol, VariableInfo> variableInfoMap,
+ IDictionary<ISymbol, List<SyntaxToken>> symbolMap,
+ SortedDictionary<int, ITypeParameterSymbol> sortedMap)
+ {
+ // find starting points
+ AppendMethodTypeVariableFromDataFlowAnalysis(model, variableInfoMap, sortedMap);
+ AppendMethodTypeParameterUsedDirectly(symbolMap, sortedMap);
+
+ // recursively dive into constraints to find all constraints needed
+ AppendTypeParametersInConstraintsUsedByConstructedTypeWithItsOwnConstraints(sortedMap);
+
+ return sortedMap.Values.ToList();
+ }
+
+ private void AppendTypeParametersInConstraintsUsedByConstructedTypeWithItsOwnConstraints(SortedDictionary<int, ITypeParameterSymbol> sortedMap)
+ {
+ var visited = new HashSet<ITypeSymbol>();
+ var candidates = SpecializedCollections.EmptyEnumerable<ITypeParameterSymbol>();
+
+ // collect all type parameter appears in constraint
+ foreach (var typeParameter in sortedMap.Values)
+ {
+ var constraintTypes = typeParameter.ConstraintTypes;
+ if (constraintTypes.IsDefaultOrEmpty)
+ {
+ continue;
+ }
+
+ foreach (var type in constraintTypes)
+ {
+ candidates = candidates.Concat(AppendTypeParametersInConstraintsUsedByConstructedTypeWithItsOwnConstraints(type, visited));
+ }
+ }
+
+ // pick up only valid type parameter and add them to the map
+ foreach (var typeParameter in candidates)
+ {
+ AddTypeParameterToMap(typeParameter, sortedMap);
+ }
+ }
+
+ private IEnumerable<ITypeParameterSymbol> AppendTypeParametersInConstraintsUsedByConstructedTypeWithItsOwnConstraints(
+ ITypeSymbol type, HashSet<ITypeSymbol> visited)
+ {
+ if (visited.Contains(type))
+ {
+ return SpecializedCollections.EmptyEnumerable<ITypeParameterSymbol>();
+ }
+
+ visited.Add(type);
+
+ if (type.OriginalDefinition.Equals(type))
+ {
+ return SpecializedCollections.EmptyEnumerable<ITypeParameterSymbol>();
+ }
+
+ var constructedType = type as INamedTypeSymbol;
+ if (constructedType == null)
+ {
+ return SpecializedCollections.EmptyEnumerable<ITypeParameterSymbol>();
+ }
+
+ var parameters = constructedType.GetAllTypeParameters().ToList();
+ var arguments = constructedType.GetAllTypeArguments().ToList();
+
+ //Contract.ThrowIfFalse(parameters.Count == arguments.Count);
+
+ var typeParameters = new List<ITypeParameterSymbol>();
+ for (int i = 0; i < parameters.Count; i++)
+ {
+ var parameter = parameters[i];
+
+ var argument = arguments[i] as ITypeParameterSymbol;
+ if (argument != null)
+ {
+ // no constraint, nothing to do
+ if (!parameter.HasConstructorConstraint &&
+ !parameter.HasReferenceTypeConstraint &&
+ !parameter.HasValueTypeConstraint &&
+ parameter.ConstraintTypes.IsDefaultOrEmpty)
+ {
+ continue;
+ }
+
+ typeParameters.Add(argument);
+ continue;
+ }
+
+ var candidate = arguments[i] as INamedTypeSymbol;
+ if (candidate == null)
+ {
+ continue;
+ }
+
+ typeParameters.AddRange(AppendTypeParametersInConstraintsUsedByConstructedTypeWithItsOwnConstraints(candidate, visited));
+ }
+
+ return typeParameters;
+ }
+
+ private IEnumerable<ITypeParameterSymbol> GetMethodTypeParametersInDeclaration(ITypeSymbol returnType, SortedDictionary<int, ITypeParameterSymbol> sortedMap)
+ {
+ // add return type to the map
+ AddTypeParametersToMap(TypeParameterCollector.Collect(returnType), sortedMap);
+
+ AppendMethodTypeParameterFromConstraint(sortedMap);
+
+ return sortedMap.Values.ToList();
+ }
+
+ private OperationStatus CheckReadOnlyFields(SemanticModel semanticModel, Dictionary<ISymbol, List<SyntaxToken>> symbolMap)
+ {
+ if (ReadOnlyFieldAllowed())
+ {
+ return OperationStatus.Succeeded;
+ }
+
+ List<string> names = null;
+
+ foreach (var pair in symbolMap.Where(p => p.Key.Kind == SymbolKind.Field))
+ {
+ var field = (IFieldSymbol)pair.Key;
+ if (!field.IsReadOnly)
+ {
+ continue;
+ }
+
+ var tokens = pair.Value;
+ if (tokens.All(t => !((ExpressionSyntax)t.Parent).IsWrittenTo()))
+ {
+ continue;
+ }
+
+ names = names ?? new List<string>();
+ names.Add(field.Name ?? string.Empty);
+ }
+
+ if (names != null)
+ {
+ return new OperationStatus(OperationStatusFlag.BestEffort, string.Format("FeaturesResources.AssingingToReadonlyFields", string.Join(", ", names)));
+ }
+
+ return OperationStatus.Succeeded;
+ }
+
+ private bool IsInstanceMemberUsedInSelectedCode(DataFlowAnalysis dataFlowAnalysisData)
+ {
+ //Contract.ThrowIfNull(dataFlowAnalysisData);
+
+ // "this" can be used as a lvalue in a struct, check WrittenInside as well
+ return dataFlowAnalysisData.ReadInside.Any(s => IsThisParameter(s)) ||
+ dataFlowAnalysisData.WrittenInside.Any(s => IsThisParameter(s));
+ }
+
+ protected VariableInfo CreateFromSymbolCommon<T>(
+ Compilation compilation,
+ ISymbol symbol,
+ ITypeSymbol type,
+ VariableStyle style,
+ HashSet<int> nonNoisySyntaxKindSet) where T : SyntaxNode
+ {
+ var local = symbol as ILocalSymbol;
+ if (local != null)
+ {
+ return new VariableInfo(
+ new LocalVariableSymbol<T>(compilation, local, type, nonNoisySyntaxKindSet),
+ style);
+ }
+
+ var parameter = symbol as IParameterSymbol;
+ if (parameter != null)
+ {
+ return new VariableInfo(new ParameterVariableSymbol(compilation, parameter, type), style);
+ }
+
+ var rangeVariable = symbol as IRangeVariableSymbol;
+ if (rangeVariable != null)
+ {
+ return new VariableInfo(new QueryVariableSymbol(compilation, rangeVariable, type), style);
+ }
+
+ return null;//Contract.FailWithReturn<VariableInfo>(FeaturesResources.Unknown);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.AnalyzerResult.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.AnalyzerResult.cs
new file mode 100644
index 0000000000..ea3e5af836
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.AnalyzerResult.cs
@@ -0,0 +1,176 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Threading;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ abstract partial class MethodExtractor
+ {
+ protected class AnalyzerResult
+ {
+ private readonly IList<ITypeParameterSymbol> _typeParametersInDeclaration;
+ private readonly IList<ITypeParameterSymbol> _typeParametersInConstraintList;
+ private readonly IList<VariableInfo> _variables;
+ private readonly VariableInfo _variableToUseAsReturnValue;
+
+ public AnalyzerResult(
+ SemanticDocument document,
+ IEnumerable<ITypeParameterSymbol> typeParametersInDeclaration,
+ IEnumerable<ITypeParameterSymbol> typeParametersInConstraintList,
+ IList<VariableInfo> variables,
+ VariableInfo variableToUseAsReturnValue,
+ ITypeSymbol returnType,
+ bool awaitTaskReturn,
+ bool instanceMemberIsUsed,
+ bool endOfSelectionReachable,
+ OperationStatus status)
+ {
+ var semanticModel = document.SemanticModel;
+
+ this.UseInstanceMember = instanceMemberIsUsed;
+ this.EndOfSelectionReachable = endOfSelectionReachable;
+ this.AwaitTaskReturn = awaitTaskReturn;
+ this.SemanticDocument = document;
+ _typeParametersInDeclaration = typeParametersInDeclaration.Select(s => semanticModel.ResolveType(s)).ToList();
+ _typeParametersInConstraintList = typeParametersInConstraintList.Select(s => semanticModel.ResolveType(s)).ToList();
+ _variables = variables;
+ this.ReturnType = semanticModel.ResolveType(returnType);
+ _variableToUseAsReturnValue = variableToUseAsReturnValue;
+ this.Status = status;
+ }
+
+ public AnalyzerResult With(SemanticDocument document)
+ {
+ if (this.SemanticDocument == document)
+ {
+ return this;
+ }
+
+ return new AnalyzerResult(
+ document,
+ _typeParametersInDeclaration,
+ _typeParametersInConstraintList,
+ _variables,
+ _variableToUseAsReturnValue,
+ this.ReturnType,
+ this.AwaitTaskReturn,
+ this.UseInstanceMember,
+ this.EndOfSelectionReachable,
+ this.Status);
+ }
+
+ /// <summary>
+ /// used to determine whether static can be used
+ /// </summary>
+ public bool UseInstanceMember { get; }
+
+ /// <summary>
+ /// used to determine whether "return" statement needs to be inserted
+ /// </summary>
+ public bool EndOfSelectionReachable { get; }
+
+ /// <summary>
+ /// document this result is based on
+ /// </summary>
+ public SemanticDocument SemanticDocument { get; }
+
+ /// <summary>
+ /// flag to show whether task return type is due to await
+ /// </summary>
+ public bool AwaitTaskReturn { get; }
+
+ /// <summary>
+ /// return type
+ /// </summary>
+ public ITypeSymbol ReturnType { get; }
+
+ /// <summary>
+ /// analyzer result operation status
+ /// </summary>
+ public OperationStatus Status { get; }
+
+ public ReadOnlyCollection<ITypeParameterSymbol> MethodTypeParametersInDeclaration
+ {
+ get
+ {
+ return new ReadOnlyCollection<ITypeParameterSymbol>(_typeParametersInDeclaration);
+ }
+ }
+
+ public ReadOnlyCollection<ITypeParameterSymbol> MethodTypeParametersInConstraintList
+ {
+ get
+ {
+ return new ReadOnlyCollection<ITypeParameterSymbol>(_typeParametersInConstraintList);
+ }
+ }
+
+ public bool HasVariableToUseAsReturnValue
+ {
+ get
+ {
+ return _variableToUseAsReturnValue != null;
+ }
+ }
+
+ public VariableInfo VariableToUseAsReturnValue
+ {
+ get
+ {
+ //Contract.ThrowIfNull(_variableToUseAsReturnValue);
+ return _variableToUseAsReturnValue;
+ }
+ }
+
+ public bool HasReturnType
+ {
+ get
+ {
+ return this.ReturnType.SpecialType != SpecialType.System_Void && !this.AwaitTaskReturn;
+ }
+ }
+
+ public IEnumerable<VariableInfo> MethodParameters
+ {
+ get
+ {
+ return _variables.Where(v => v.UseAsParameter);
+ }
+ }
+
+ public IEnumerable<VariableInfo> GetVariablesToSplitOrMoveIntoMethodDefinition(CancellationToken cancellationToken)
+ {
+ return _variables
+ .Where(v => v.GetDeclarationBehavior(cancellationToken) == DeclarationBehavior.SplitIn ||
+ v.GetDeclarationBehavior(cancellationToken) == DeclarationBehavior.MoveIn);
+ }
+
+ public IEnumerable<VariableInfo> GetVariablesToMoveIntoMethodDefinition(CancellationToken cancellationToken)
+ {
+ return _variables.Where(v => v.GetDeclarationBehavior(cancellationToken) == DeclarationBehavior.MoveIn);
+ }
+
+ public IEnumerable<VariableInfo> GetVariablesToMoveOutToCallSite(CancellationToken cancellationToken)
+ {
+ return _variables.Where(v => v.GetDeclarationBehavior(cancellationToken) == DeclarationBehavior.MoveOut);
+ }
+
+ public IEnumerable<VariableInfo> GetVariablesToMoveOutToCallSiteOrDelete(CancellationToken cancellationToken)
+ {
+ return _variables.Where(v => v.GetDeclarationBehavior(cancellationToken) == DeclarationBehavior.MoveOut ||
+ v.GetDeclarationBehavior(cancellationToken) == DeclarationBehavior.Delete);
+ }
+
+ public IEnumerable<VariableInfo> GetVariablesToSplitOrMoveOutToCallSite(CancellationToken cancellationToken)
+ {
+ return _variables.Where(v => v.GetDeclarationBehavior(cancellationToken) == DeclarationBehavior.SplitOut ||
+ v.GetDeclarationBehavior(cancellationToken) == DeclarationBehavior.MoveOut);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.CodeGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.CodeGenerator.cs
new file mode 100644
index 0000000000..06a9faec87
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.CodeGenerator.cs
@@ -0,0 +1,316 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Simplification;
+using Roslyn.Utilities;
+using ICSharpCode.NRefactory6.CSharp.CodeGeneration;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ abstract partial class MethodExtractor
+ {
+ protected abstract partial class CodeGenerator<TStatement, TExpression, TNodeUnderContainer>
+ where TStatement : SyntaxNode
+ where TExpression : SyntaxNode
+ where TNodeUnderContainer : SyntaxNode
+ {
+ protected readonly SyntaxAnnotation MethodNameAnnotation;
+ protected readonly SyntaxAnnotation MethodDefinitionAnnotation;
+ protected readonly SyntaxAnnotation CallSiteAnnotation;
+
+ protected readonly InsertionPoint InsertionPoint;
+ protected readonly SemanticDocument SemanticDocument;
+ protected readonly SelectionResult SelectionResult;
+ protected readonly AnalyzerResult AnalyzerResult;
+
+ protected CodeGenerator(InsertionPoint insertionPoint, SelectionResult selectionResult, AnalyzerResult analyzerResult)
+ {
+ //Contract.ThrowIfFalse(insertionPoint.SemanticDocument == analyzerResult.SemanticDocument);
+
+ this.InsertionPoint = insertionPoint;
+ this.SemanticDocument = insertionPoint.SemanticDocument;
+
+ this.SelectionResult = selectionResult;
+ this.AnalyzerResult = analyzerResult;
+
+ this.MethodNameAnnotation = new SyntaxAnnotation();
+ this.CallSiteAnnotation = new SyntaxAnnotation();
+ this.MethodDefinitionAnnotation = MonoDevelop.Ide.TypeSystem.TypeSystemService.InsertionModeAnnotation;
+ }
+
+ #region method to be implemented in sub classes
+
+ protected abstract SyntaxNode GetOutermostCallSiteContainerToProcess(CancellationToken cancellationToken);
+ protected abstract Task<SyntaxNode> GenerateBodyForCallSiteContainerAsync(CancellationToken cancellationToken);
+ protected abstract SyntaxNode GetPreviousMember(SemanticDocument document);
+ protected abstract OperationStatus<IMethodSymbol> GenerateMethodDefinition(CancellationToken cancellationToken);
+
+ protected abstract SyntaxToken CreateIdentifier(string name);
+ protected abstract SyntaxToken CreateMethodName();
+ protected abstract bool LastStatementOrHasReturnStatementInReturnableConstruct();
+
+ protected abstract TNodeUnderContainer GetFirstStatementOrInitializerSelectedAtCallSite();
+ protected abstract TNodeUnderContainer GetLastStatementOrInitializerSelectedAtCallSite();
+ protected abstract Task<TNodeUnderContainer> GetStatementOrInitializerContainingInvocationToExtractedMethodAsync(SyntaxAnnotation callsiteAnnotation, CancellationToken cancellationToken);
+
+ protected abstract TExpression CreateCallSignature();
+ protected abstract TStatement CreateDeclarationStatement(VariableInfo variable, CancellationToken cancellationToken, TExpression initialValue = null);
+ protected abstract TStatement CreateAssignmentExpressionStatement(SyntaxToken identifier, TExpression rvalue);
+ protected abstract TStatement CreateReturnStatement(string identifierName = null);
+
+ protected abstract IEnumerable<TStatement> GetInitialStatementsForMethodDefinitions();
+ #endregion
+
+ public async Task<GeneratedCode> GenerateAsync(CancellationToken cancellationToken)
+ {
+ var root = this.SemanticDocument.Root;
+
+ // should I check venus hidden position check here as well?
+ root = root.ReplaceNode(this.GetOutermostCallSiteContainerToProcess(cancellationToken), await this.GenerateBodyForCallSiteContainerAsync(cancellationToken).ConfigureAwait(false));
+ var callSiteDocument = await this.SemanticDocument.WithSyntaxRootAsync(root, cancellationToken).ConfigureAwait(false);
+
+ var newCallSiteRoot = callSiteDocument.Root;
+ var previousMemberNode = GetPreviousMember(callSiteDocument);
+
+ // it is possible in a script file case where there is no previous member. in that case, insert new text into top level script
+ var destination = (previousMemberNode.Parent == null) ? previousMemberNode : previousMemberNode.Parent;
+
+ var codeGenerationService = new CSharpCodeGenerationService (this.SemanticDocument.Document.Project.Solution.Workspace.Services.GetLanguageServices (LanguageNames.CSharp));
+ var result = this.GenerateMethodDefinition(cancellationToken);
+ var newContainer = codeGenerationService.AddMethod(
+ destination, result.Data,
+ new CodeGenerationOptions(afterThisLocation: previousMemberNode.GetLocation(), generateDefaultAccessibility: false, generateMethodBodies: true),
+ cancellationToken);
+
+ var newDocument = callSiteDocument.Document.WithSyntaxRoot(newCallSiteRoot.ReplaceNode(destination, newContainer));
+ newDocument = await Simplifier.ReduceAsync(newDocument, Simplifier.Annotation, null, cancellationToken).ConfigureAwait(false);
+
+ var finalDocument = await SemanticDocument.CreateAsync(newDocument, cancellationToken).ConfigureAwait(false);
+ var finalRoot = finalDocument.Root;
+
+ var methodDefinition = finalRoot.GetAnnotatedNodesAndTokens(this.MethodDefinitionAnnotation).FirstOrDefault();
+ if (!methodDefinition.IsNode || methodDefinition.AsNode() == null)
+ {
+ return await CreateGeneratedCodeAsync(
+ result.Status.With(OperationStatus.FailedWithUnknownReason), finalDocument, cancellationToken).ConfigureAwait(false);
+ }
+
+ if (methodDefinition.SyntaxTree.IsHiddenPosition(methodDefinition.AsNode().SpanStart, cancellationToken) ||
+ methodDefinition.SyntaxTree.IsHiddenPosition(methodDefinition.AsNode().Span.End, cancellationToken))
+ {
+ return await CreateGeneratedCodeAsync(
+ result.Status.With(OperationStatus.OverlapsHiddenPosition), finalDocument, cancellationToken).ConfigureAwait(false);
+ }
+
+ return await CreateGeneratedCodeAsync(result.Status, finalDocument, cancellationToken).ConfigureAwait(false);
+ }
+
+ protected virtual Task<GeneratedCode> CreateGeneratedCodeAsync(OperationStatus status, SemanticDocument newDocument, CancellationToken cancellationToken)
+ {
+ return Task.FromResult(new GeneratedCode(
+ status,
+ newDocument,
+ this.MethodNameAnnotation,
+ this.CallSiteAnnotation,
+ this.MethodDefinitionAnnotation));
+ }
+
+ protected VariableInfo GetOutermostVariableToMoveIntoMethodDefinition(CancellationToken cancellationToken)
+ {
+ var variables = new List<VariableInfo>(this.AnalyzerResult.GetVariablesToMoveIntoMethodDefinition(cancellationToken));
+ if (variables.Count <= 0)
+ {
+ return null;
+ }
+
+ variables.Sort(VariableInfo.Compare);
+ return variables[0];
+ }
+
+ protected IEnumerable<TStatement> AddReturnIfUnreachable(
+ IEnumerable<TStatement> statements, CancellationToken cancellationToken)
+ {
+ if (this.AnalyzerResult.EndOfSelectionReachable)
+ {
+ return statements;
+ }
+
+ var type = this.SelectionResult.GetContainingScopeType();
+ if (type != null && type.SpecialType != SpecialType.System_Void)
+ {
+ return statements;
+ }
+
+ // no return type + end of selection not reachable
+ if (LastStatementOrHasReturnStatementInReturnableConstruct())
+ {
+ return statements;
+ }
+
+ return statements.Concat(CreateReturnStatement());
+ }
+
+ protected async Task<IEnumerable<TStatement>> AddInvocationAtCallSiteAsync(
+ IEnumerable<TStatement> statements, CancellationToken cancellationToken)
+ {
+ if (this.AnalyzerResult.HasVariableToUseAsReturnValue)
+ {
+ return statements;
+ }
+
+ //Contract.ThrowIfTrue(this.AnalyzerResult.GetVariablesToSplitOrMoveOutToCallSite(cancellationToken).Any(v => v.UseAsReturnValue));
+
+ // add invocation expression
+ return statements.Concat(
+ (TStatement)(SyntaxNode)await GetStatementOrInitializerContainingInvocationToExtractedMethodAsync(this.CallSiteAnnotation, cancellationToken).ConfigureAwait(false));
+ }
+
+ protected IEnumerable<TStatement> AddAssignmentStatementToCallSite(
+ IEnumerable<TStatement> statements,
+ CancellationToken cancellationToken)
+ {
+ if (!this.AnalyzerResult.HasVariableToUseAsReturnValue)
+ {
+ return statements;
+ }
+
+ var variable = this.AnalyzerResult.VariableToUseAsReturnValue;
+ if (variable.ReturnBehavior == ReturnBehavior.Initialization)
+ {
+ // there must be one decl behavior when there is "return value and initialize" variable
+ //Contract.ThrowIfFalse(this.AnalyzerResult.GetVariablesToSplitOrMoveOutToCallSite(cancellationToken).Single(v => v.ReturnBehavior == ReturnBehavior.Initialization) != null);
+
+ return statements.Concat(
+ CreateDeclarationStatement(variable, cancellationToken, CreateCallSignature()).WithAdditionalAnnotations(this.CallSiteAnnotation));
+ }
+
+ //Contract.ThrowIfFalse(variable.ReturnBehavior == ReturnBehavior.Assignment);
+ return statements.Concat(
+ CreateAssignmentExpressionStatement(CreateIdentifier(variable.Name), CreateCallSignature()).WithAdditionalAnnotations(this.CallSiteAnnotation));
+ }
+
+ protected IEnumerable<TStatement> CreateDeclarationStatements(IEnumerable<VariableInfo> variables, CancellationToken cancellationToken)
+ {
+ var list = new List<TStatement>();
+
+ foreach (var variable in variables)
+ {
+ list.Add(CreateDeclarationStatement(variable, cancellationToken));
+ }
+
+ return list;
+ }
+
+ protected IEnumerable<TStatement> AddSplitOrMoveDeclarationOutStatementsToCallSite(IEnumerable<TStatement> statements, CancellationToken cancellationToken)
+ {
+ var list = new List<TStatement>();
+
+ foreach (var variable in this.AnalyzerResult.GetVariablesToSplitOrMoveOutToCallSite(cancellationToken))
+ {
+ if (variable.UseAsReturnValue)
+ {
+ continue;
+ }
+
+ list.Add(CreateDeclarationStatement(variable, cancellationToken));
+ }
+
+ return list;
+ }
+
+ protected IEnumerable<TStatement> AppendReturnStatementIfNeeded(IEnumerable<TStatement> statements)
+ {
+ if (!this.AnalyzerResult.HasVariableToUseAsReturnValue)
+ {
+ return statements;
+ }
+
+ var variableToUseAsReturnValue = this.AnalyzerResult.VariableToUseAsReturnValue;
+
+ //Contract.ThrowIfFalse(variableToUseAsReturnValue.ReturnBehavior == ReturnBehavior.Assignment ||
+ // variableToUseAsReturnValue.ReturnBehavior == ReturnBehavior.Initialization);
+
+ return statements.Concat(CreateReturnStatement(this.AnalyzerResult.VariableToUseAsReturnValue.Name));
+ }
+
+ protected HashSet<SyntaxAnnotation> CreateVariableDeclarationToRemoveMap(
+ IEnumerable<VariableInfo> variables, CancellationToken cancellationToken)
+ {
+ var annotations = new List<Tuple<SyntaxToken, SyntaxAnnotation>>();
+
+ foreach (var variable in variables)
+ {
+// Contract.ThrowIfFalse(variable.GetDeclarationBehavior(cancellationToken) == DeclarationBehavior.MoveOut ||
+// variable.GetDeclarationBehavior(cancellationToken) == DeclarationBehavior.MoveIn ||
+// variable.GetDeclarationBehavior(cancellationToken) == DeclarationBehavior.Delete);
+
+ variable.AddIdentifierTokenAnnotationPair(annotations, cancellationToken);
+ }
+
+ return new HashSet<SyntaxAnnotation>(annotations.Select(t => t.Item2));
+ }
+
+ protected IList<ITypeParameterSymbol> CreateMethodTypeParameters(CancellationToken cancellationToken)
+ {
+ if (this.AnalyzerResult.MethodTypeParametersInDeclaration.Count == 0)
+ {
+ return SpecializedCollections.EmptyList<ITypeParameterSymbol>();
+ }
+
+ var set = new HashSet<ITypeParameterSymbol>(this.AnalyzerResult.MethodTypeParametersInConstraintList);
+
+ var typeParameters = new List<ITypeParameterSymbol>();
+ foreach (var parameter in this.AnalyzerResult.MethodTypeParametersInDeclaration)
+ {
+ if (parameter != null && set.Contains(parameter))
+ {
+ typeParameters.Add(parameter);
+ continue;
+ }
+
+ typeParameters.Add(CodeGenerationSymbolFactory.CreateTypeParameter(
+ parameter.GetAttributes(), parameter.Variance, parameter.Name, ImmutableArray.Create<ITypeSymbol>(),
+ parameter.HasConstructorConstraint, parameter.HasReferenceTypeConstraint, parameter.HasValueTypeConstraint, parameter.Ordinal));
+ }
+
+ return typeParameters;
+ }
+
+ protected IList<IParameterSymbol> CreateMethodParameters()
+ {
+ var parameters = new List<IParameterSymbol>();
+
+ foreach (var parameter in this.AnalyzerResult.MethodParameters)
+ {
+ var refKind = GetRefKind(parameter.ParameterModifier);
+ var type = parameter.GetVariableType(this.SemanticDocument);
+
+ parameters.Add(
+ CodeGenerationSymbolFactory.CreateParameterSymbol(
+ attributes: SpecializedCollections.EmptyList<AttributeData>(),
+ refKind: refKind,
+ isParams: false,
+ type: type,
+ name: parameter.Name));
+ }
+
+ return parameters;
+ }
+
+ private static RefKind GetRefKind(ParameterBehavior parameterBehavior)
+ {
+ return parameterBehavior == ParameterBehavior.Ref ? RefKind.Ref :
+ parameterBehavior == ParameterBehavior.Out ? RefKind.Out : RefKind.None;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.GeneratedCode.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.GeneratedCode.cs
new file mode 100644
index 0000000000..5590199a6a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.GeneratedCode.cs
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ abstract partial class MethodExtractor
+ {
+ internal class GeneratedCode
+ {
+ public GeneratedCode(
+ OperationStatus status,
+ SemanticDocument document,
+ SyntaxAnnotation methodNameAnnotation,
+ SyntaxAnnotation callsiteAnnotation,
+ SyntaxAnnotation methodDefinitionAnnotation)
+ {
+ //Contract.ThrowIfNull(document);
+ //Contract.ThrowIfNull(methodNameAnnotation);
+ //Contract.ThrowIfNull(callsiteAnnotation);
+ //Contract.ThrowIfNull(methodDefinitionAnnotation);
+
+ this.Status = status;
+ this.SemanticDocument = document;
+ this.MethodNameAnnotation = methodNameAnnotation;
+ this.CallSiteAnnotation = callsiteAnnotation;
+ this.MethodDefinitionAnnotation = methodDefinitionAnnotation;
+ }
+
+ public OperationStatus Status { get; }
+ public SemanticDocument SemanticDocument { get; }
+
+ public SyntaxAnnotation MethodNameAnnotation { get; }
+ public SyntaxAnnotation CallSiteAnnotation { get; }
+ public SyntaxAnnotation MethodDefinitionAnnotation { get; }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.TriviaResult.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.TriviaResult.cs
new file mode 100644
index 0000000000..9bbd32c02b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.TriviaResult.cs
@@ -0,0 +1,181 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ abstract partial class MethodExtractor
+ {
+ protected abstract class TriviaResult
+ {
+ private readonly int _endOfLineKind;
+ private readonly int _whitespaceKind;
+
+ private readonly ITriviaSavedResult _result;
+
+ public TriviaResult(SemanticDocument document, ITriviaSavedResult result, int endOfLineKind, int whitespaceKind)
+ {
+ this.SemanticDocument = document;
+
+ _result = result;
+ _endOfLineKind = endOfLineKind;
+ _whitespaceKind = whitespaceKind;
+ }
+
+ protected abstract AnnotationResolver GetAnnotationResolver(SyntaxNode callsite, SyntaxNode methodDefinition);
+ protected abstract TriviaResolver GetTriviaResolver(SyntaxNode methodDefinition);
+
+ public SemanticDocument SemanticDocument { get; }
+
+ public async Task<OperationStatus<SemanticDocument>> ApplyAsync(GeneratedCode generatedCode, CancellationToken cancellationToken)
+ {
+ var document = generatedCode.SemanticDocument;
+ var root = document.Root;
+
+ var callsiteAnnotation = generatedCode.CallSiteAnnotation;
+ var methodDefinitionAnnotation = generatedCode.MethodDefinitionAnnotation;
+
+ var callsite = root.GetAnnotatedNodesAndTokens(callsiteAnnotation).SingleOrDefault().AsNode();
+ var method = root.GetAnnotatedNodesAndTokens(methodDefinitionAnnotation).SingleOrDefault().AsNode();
+
+ var annotationResolver = GetAnnotationResolver(callsite, method);
+ var triviaResolver = GetTriviaResolver(method);
+ if (annotationResolver == null || triviaResolver == null)
+ {
+ // bug # 6644
+ // this could happen in malformed code. return as it was.
+ var status = new OperationStatus(OperationStatusFlag.None, "FeaturesResources.CantNotConstructFinalTree");
+ return status.With(document);
+ }
+
+ return OperationStatus.Succeeded.With(
+ await document.WithSyntaxRootAsync(_result.RestoreTrivia(root, annotationResolver, triviaResolver), cancellationToken).ConfigureAwait(false));
+ }
+
+ protected IEnumerable<SyntaxTrivia> FilterTriviaList(IEnumerable<SyntaxTrivia> list)
+ {
+ // has noisy token
+ if (list.Any(t => t.RawKind != _endOfLineKind && t.RawKind != _whitespaceKind))
+ {
+ return RemoveLeadingElasticBeforeEndOfLine(list);
+ }
+
+ // whitespace only
+ return MergeLineBreaks(list);
+ }
+
+ protected IEnumerable<SyntaxTrivia> RemoveBlankLines(IEnumerable<SyntaxTrivia> list)
+ {
+ // remove any blank line at the beginging
+ var currentLine = new List<SyntaxTrivia>();
+ var result = new List<SyntaxTrivia>();
+
+ var seenFirstEndOfLine = false;
+ int i = 0;
+
+ foreach (var trivia in list)
+ {
+ i++;
+
+ if (trivia.RawKind == _endOfLineKind)
+ {
+ if (seenFirstEndOfLine)
+ {
+ // empty line. remove it
+ if (currentLine.All(t => t.RawKind == _endOfLineKind || t.RawKind == _whitespaceKind))
+ {
+ continue;
+ }
+
+ // non empty line after the first end of line.
+ // return now
+ return result.Concat(currentLine).Concat(list.Skip(i - 1));
+ }
+ else
+ {
+ seenFirstEndOfLine = true;
+
+ result.AddRange(currentLine);
+ result.Add(trivia);
+ currentLine.Clear();
+
+ continue;
+ }
+ }
+
+ currentLine.Add(trivia);
+ }
+
+ return result.Concat(currentLine);
+ }
+
+ protected IEnumerable<SyntaxTrivia> RemoveLeadingElasticBeforeEndOfLine(IEnumerable<SyntaxTrivia> list)
+ {
+ var trivia = list.FirstOrDefault();
+ if (!trivia.IsElastic())
+ {
+ return list;
+ }
+
+ var listWithoutHead = list.Skip(1);
+ trivia = listWithoutHead.FirstOrDefault();
+ if (trivia.RawKind == _endOfLineKind)
+ {
+ return listWithoutHead;
+ }
+
+ if (trivia.IsElastic())
+ {
+ return RemoveLeadingElasticBeforeEndOfLine(listWithoutHead);
+ }
+
+ return list;
+ }
+
+ protected IEnumerable<SyntaxTrivia> MergeLineBreaks(IEnumerable<SyntaxTrivia> list)
+ {
+ // this will make sure that it doesn't have more than two subsequent end of line
+ // trivia without any noisy trivia
+ var stack = new Stack<SyntaxTrivia>();
+ int numberOfEndOfLinesWithoutAnyNoisyTrivia = 0;
+
+ foreach (var trivia in list)
+ {
+ if (trivia.IsElastic())
+ {
+ stack.Push(trivia);
+ continue;
+ }
+
+ if (trivia.RawKind == _endOfLineKind)
+ {
+ numberOfEndOfLinesWithoutAnyNoisyTrivia++;
+
+ if (numberOfEndOfLinesWithoutAnyNoisyTrivia > 2)
+ {
+ // get rid of any whitespace trivia from stack
+ var top = stack.Peek();
+ while (!top.IsElastic() && top.RawKind == _whitespaceKind)
+ {
+ stack.Pop();
+ top = stack.Peek();
+ }
+
+ continue;
+ }
+ }
+
+ stack.Push(trivia);
+ }
+
+ return stack.Reverse();
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.TypeParameterCollector.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.TypeParameterCollector.cs
new file mode 100644
index 0000000000..3c2c401c60
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.TypeParameterCollector.cs
@@ -0,0 +1,57 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ abstract partial class MethodExtractor
+ {
+ protected class TypeParameterCollector : SymbolVisitor
+ {
+ private readonly List<ITypeParameterSymbol> _typeParameters = new List<ITypeParameterSymbol>();
+
+ public static IEnumerable<ITypeParameterSymbol> Collect(ITypeSymbol typeSymbol)
+ {
+ var collector = new TypeParameterCollector();
+ typeSymbol.Accept(collector);
+
+ return collector._typeParameters;
+ }
+
+ public override void DefaultVisit(ISymbol node)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void VisitDynamicType(IDynamicTypeSymbol dynamicTypeSymbol)
+ {
+ }
+
+ public override void VisitArrayType(IArrayTypeSymbol arrayTypeSymbol)
+ {
+ arrayTypeSymbol.ElementType.Accept(this);
+ }
+
+ public override void VisitPointerType(IPointerTypeSymbol pointerTypeSymbol)
+ {
+ pointerTypeSymbol.PointedAtType.Accept(this);
+ }
+
+ public override void VisitNamedType(INamedTypeSymbol namedTypeSymbol)
+ {
+ foreach (var argument in namedTypeSymbol.GetAllTypeArguments())
+ {
+ argument.Accept(this);
+ }
+ }
+
+ public override void VisitTypeParameter(ITypeParameterSymbol typeParameterTypeSymbol)
+ {
+ _typeParameters.Add(typeParameterTypeSymbol);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.VariableInfo.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.VariableInfo.cs
new file mode 100644
index 0000000000..d624ffec4b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.VariableInfo.cs
@@ -0,0 +1,138 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ abstract partial class MethodExtractor
+ {
+ protected class VariableInfo
+ {
+ private readonly VariableSymbol _variableSymbol;
+ private readonly VariableStyle _variableStyle;
+ private readonly bool _useAsReturnValue;
+
+ public VariableInfo(
+ VariableSymbol variableSymbol,
+ VariableStyle variableStyle,
+ bool useAsReturnValue = false)
+ {
+ _variableSymbol = variableSymbol;
+ _variableStyle = variableStyle;
+ _useAsReturnValue = useAsReturnValue;
+ }
+
+ public bool UseAsReturnValue
+ {
+ get
+ {
+ //Contract.ThrowIfFalse(!_useAsReturnValue || _variableStyle.ReturnStyle.ReturnBehavior != ReturnBehavior.None);
+ return _useAsReturnValue;
+ }
+ }
+
+ public bool CanBeUsedAsReturnValue
+ {
+ get
+ {
+ return _variableStyle.ReturnStyle.ReturnBehavior != ReturnBehavior.None;
+ }
+ }
+
+ public bool UseAsParameter
+ {
+ get
+ {
+ return (!_useAsReturnValue && _variableStyle.ParameterStyle.ParameterBehavior != ParameterBehavior.None) ||
+ (_useAsReturnValue && _variableStyle.ReturnStyle.ParameterBehavior != ParameterBehavior.None);
+ }
+ }
+
+ public ParameterBehavior ParameterModifier
+ {
+ get
+ {
+ return _useAsReturnValue ? _variableStyle.ReturnStyle.ParameterBehavior : _variableStyle.ParameterStyle.ParameterBehavior;
+ }
+ }
+
+ public DeclarationBehavior GetDeclarationBehavior(CancellationToken cancellationToken)
+ {
+ if (_useAsReturnValue)
+ {
+ return _variableStyle.ReturnStyle.DeclarationBehavior;
+ }
+
+ if (_variableSymbol.GetUseSaferDeclarationBehavior(cancellationToken))
+ {
+ return _variableStyle.ParameterStyle.SaferDeclarationBehavior;
+ }
+
+ return _variableStyle.ParameterStyle.DeclarationBehavior;
+ }
+
+ public ReturnBehavior ReturnBehavior
+ {
+ get
+ {
+ if (_useAsReturnValue)
+ {
+ return _variableStyle.ReturnStyle.ReturnBehavior;
+ }
+
+ return ReturnBehavior.None;
+ }
+ }
+
+ public static VariableInfo CreateReturnValue(VariableInfo variable)
+ {
+ //Contract.ThrowIfNull(variable);
+ //Contract.ThrowIfFalse(variable.CanBeUsedAsReturnValue);
+ //Contract.ThrowIfFalse(variable.ParameterModifier == ParameterBehavior.Out || variable.ParameterModifier == ParameterBehavior.Ref);
+
+ return new VariableInfo(variable._variableSymbol, variable._variableStyle, useAsReturnValue: true);
+ }
+
+ public void AddIdentifierTokenAnnotationPair(
+ List<Tuple<SyntaxToken, SyntaxAnnotation>> annotations, CancellationToken cancellationToken)
+ {
+ _variableSymbol.AddIdentifierTokenAnnotationPair(annotations, cancellationToken);
+ }
+
+ public string Name
+ {
+ get { return _variableSymbol.Name; }
+ }
+
+ public bool OriginalTypeHadAnonymousTypeOrDelegate
+ {
+ get { return _variableSymbol.OriginalTypeHadAnonymousTypeOrDelegate; }
+ }
+
+ public ITypeSymbol GetVariableType(SemanticDocument document)
+ {
+ return document.SemanticModel.ResolveType(_variableSymbol.OriginalType);
+ }
+
+ public SyntaxToken GetIdentifierTokenAtDeclaration(SemanticDocument document)
+ {
+ return document.GetTokenWithAnnotaton(_variableSymbol.IdentifierTokenAnnotation);
+ }
+
+ public SyntaxToken GetIdentifierTokenAtDeclaration(SyntaxNode node)
+ {
+ return node.GetAnnotatedTokens(_variableSymbol.IdentifierTokenAnnotation).SingleOrDefault();
+ }
+
+ public static int Compare(VariableInfo left, VariableInfo right)
+ {
+ return VariableSymbol.Compare(left._variableSymbol, right._variableSymbol);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.VariableSymbol.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.VariableSymbol.cs
new file mode 100644
index 0000000000..8783713ead
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.VariableSymbol.cs
@@ -0,0 +1,357 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ abstract partial class MethodExtractor
+ {
+ /// <summary>
+ /// temporary symbol until we have a symbol that can hold onto both local and parameter symbol
+ /// </summary>
+ protected abstract class VariableSymbol
+ {
+ protected VariableSymbol(Compilation compilation, ITypeSymbol type)
+ {
+ this.OriginalTypeHadAnonymousTypeOrDelegate = type.ContainsAnonymousType();
+ this.OriginalType = this.OriginalTypeHadAnonymousTypeOrDelegate ? type.RemoveAnonymousTypes(compilation) : type;
+ }
+
+ public abstract int DisplayOrder { get; }
+ public abstract string Name { get; }
+
+ public abstract bool GetUseSaferDeclarationBehavior(CancellationToken cancellationToken);
+ public abstract SyntaxAnnotation IdentifierTokenAnnotation { get; }
+ public abstract SyntaxToken GetOriginalIdentifierToken(CancellationToken cancellationToken);
+
+ public abstract void AddIdentifierTokenAnnotationPair(
+ List<Tuple<SyntaxToken, SyntaxAnnotation>> annotations, CancellationToken cancellationToken);
+
+ protected abstract int CompareTo(VariableSymbol right);
+
+ /// <summary>
+ /// return true if original type had anonymous type or delegate somewhere in the type
+ /// </summary>
+ public bool OriginalTypeHadAnonymousTypeOrDelegate { get; }
+
+ /// <summary>
+ /// get the original type with anonymous type removed
+ /// </summary>
+ public ITypeSymbol OriginalType { get; }
+
+ public static int Compare(VariableSymbol left, VariableSymbol right)
+ {
+ if (left.DisplayOrder == right.DisplayOrder)
+ {
+ return left.CompareTo(right);
+ }
+
+ return left.DisplayOrder - right.DisplayOrder;
+ }
+ }
+
+ protected abstract class NotMovableVariableSymbol : VariableSymbol
+ {
+ public NotMovableVariableSymbol(Compilation compilation, ITypeSymbol type) :
+ base(compilation, type)
+ {
+ }
+
+ public override bool GetUseSaferDeclarationBehavior(CancellationToken cancellationToken)
+ {
+ // decl never get moved
+ return false;
+ }
+
+ [ExcludeFromCodeCoverage]
+ public override SyntaxToken GetOriginalIdentifierToken(CancellationToken cancellationToken)
+ {
+ throw new InvalidOperationException();
+ }
+
+ [ExcludeFromCodeCoverage]
+ public override SyntaxAnnotation IdentifierTokenAnnotation
+ {
+ get { throw new InvalidOperationException(); }
+ }
+
+ public override void AddIdentifierTokenAnnotationPair(
+ List<Tuple<SyntaxToken, SyntaxAnnotation>> annotations, CancellationToken cancellationToken)
+ {
+ // do nothing for parameter
+ }
+ }
+
+ protected class ParameterVariableSymbol : NotMovableVariableSymbol, IComparable<ParameterVariableSymbol>
+ {
+ private readonly IParameterSymbol _parameterSymbol;
+
+ public ParameterVariableSymbol(Compilation compilation, IParameterSymbol parameterSymbol, ITypeSymbol type) :
+ base(compilation, type)
+ {
+ //Contract.ThrowIfNull(parameterSymbol);
+ _parameterSymbol = parameterSymbol;
+ }
+
+ public override int DisplayOrder
+ {
+ get { return 0; }
+ }
+
+ protected override int CompareTo(VariableSymbol right)
+ {
+ return this.CompareTo((ParameterVariableSymbol)right);
+ }
+
+ public int CompareTo(ParameterVariableSymbol other)
+ {
+ //Contract.ThrowIfNull(other);
+
+ if (this == other)
+ {
+ return 0;
+ }
+
+ var compare = CompareTo((IMethodSymbol)_parameterSymbol.ContainingSymbol, (IMethodSymbol)other._parameterSymbol.ContainingSymbol);
+ if (compare != 0)
+ {
+ return compare;
+ }
+
+ // Contract.ThrowIfFalse(_parameterSymbol.Ordinal != other._parameterSymbol.Ordinal);
+ return (_parameterSymbol.Ordinal > other._parameterSymbol.Ordinal) ? 1 : -1;
+ }
+
+ private int CompareTo(IMethodSymbol left, IMethodSymbol right)
+ {
+ if (left == null && right == null)
+ {
+ return 0;
+ }
+
+ if (left.Equals(right))
+ {
+ return 0;
+ }
+
+ if (left.MethodKind == MethodKind.AnonymousFunction &&
+ right.MethodKind != MethodKind.AnonymousFunction)
+ {
+ return 1;
+ }
+
+ if (left.MethodKind != MethodKind.AnonymousFunction &&
+ right.MethodKind == MethodKind.AnonymousFunction)
+ {
+ return -1;
+ }
+
+ if (left.MethodKind == MethodKind.AnonymousFunction &&
+ right.MethodKind == MethodKind.AnonymousFunction)
+ {
+ //Contract.ThrowIfFalse(left.Locations.Length == 1);
+ //Contract.ThrowIfFalse(right.Locations.Length == 1);
+
+ return left.Locations[0].SourceSpan.Start - right.Locations[0].SourceSpan.Start;
+ }
+
+ return 0;//Contract.FailWithReturn<int>("Shouldn't reach here");
+ }
+
+ public override string Name
+ {
+ get
+ {
+ return _parameterSymbol.ToDisplayString(
+ new SymbolDisplayFormat(
+ parameterOptions: SymbolDisplayParameterOptions.IncludeName,
+ miscellaneousOptions: SymbolDisplayMiscellaneousOptions.EscapeKeywordIdentifiers));
+ }
+ }
+ }
+
+ protected class LocalVariableSymbol<T> : VariableSymbol, IComparable<LocalVariableSymbol<T>> where T : SyntaxNode
+ {
+ private readonly SyntaxAnnotation _annotation;
+ private readonly ILocalSymbol _localSymbol;
+ private readonly HashSet<int> _nonNoisySet;
+
+ public LocalVariableSymbol(Compilation compilation, ILocalSymbol localSymbol, ITypeSymbol type, HashSet<int> nonNoisySet) :
+ base(compilation, type)
+ {
+// Contract.ThrowIfNull(localSymbol);
+// Contract.ThrowIfNull(nonNoisySet);
+
+ _annotation = new SyntaxAnnotation();
+ _localSymbol = localSymbol;
+ _nonNoisySet = nonNoisySet;
+ }
+
+ public override int DisplayOrder
+ {
+ get { return 1; }
+ }
+
+ protected override int CompareTo(VariableSymbol right)
+ {
+ return this.CompareTo((LocalVariableSymbol<T>)right);
+ }
+
+ public int CompareTo(LocalVariableSymbol<T> other)
+ {
+ //Contract.ThrowIfNull(other);
+
+ if (this == other)
+ {
+ return 0;
+ }
+
+ //Contract.ThrowIfFalse(_localSymbol.Locations.Length == 1);
+ //Contract.ThrowIfFalse(other._localSymbol.Locations.Length == 1);
+ //Contract.ThrowIfFalse(_localSymbol.Locations[0].IsInSource);
+ //Contract.ThrowIfFalse(other._localSymbol.Locations[0].IsInSource);
+ //Contract.ThrowIfFalse(_localSymbol.Locations[0].SourceTree == other._localSymbol.Locations[0].SourceTree);
+ //Contract.ThrowIfFalse(_localSymbol.Locations[0].SourceSpan.Start != other._localSymbol.Locations[0].SourceSpan.Start);
+
+ return _localSymbol.Locations[0].SourceSpan.Start - other._localSymbol.Locations[0].SourceSpan.Start;
+ }
+
+ public override string Name
+ {
+ get
+ {
+ return _localSymbol.ToDisplayString(
+ new SymbolDisplayFormat(
+ miscellaneousOptions: SymbolDisplayMiscellaneousOptions.EscapeKeywordIdentifiers));
+ }
+ }
+
+ public override SyntaxToken GetOriginalIdentifierToken(CancellationToken cancellationToken)
+ {
+// Contract.ThrowIfFalse(_localSymbol.Locations.Length == 1);
+// Contract.ThrowIfFalse(_localSymbol.Locations[0].IsInSource);
+// Contract.ThrowIfNull(_localSymbol.Locations[0].SourceTree);
+
+ var tree = _localSymbol.Locations[0].SourceTree;
+ var span = _localSymbol.Locations[0].SourceSpan;
+
+ var token = tree.GetRoot(cancellationToken).FindToken(span.Start);
+ //Contract.ThrowIfFalse(token.Span.Equals(span));
+
+ return token;
+ }
+
+ public override SyntaxAnnotation IdentifierTokenAnnotation
+ {
+ get { return _annotation; }
+ }
+
+ public override void AddIdentifierTokenAnnotationPair(
+ List<Tuple<SyntaxToken, SyntaxAnnotation>> annotations, CancellationToken cancellationToken)
+ {
+ annotations.Add(Tuple.Create(this.GetOriginalIdentifierToken(cancellationToken), _annotation));
+ }
+
+ public override bool GetUseSaferDeclarationBehavior(CancellationToken cancellationToken)
+ {
+ var identifier = this.GetOriginalIdentifierToken(cancellationToken);
+
+ // check whether there is a noisy trivia around the token.
+ if (ContainsNoisyTrivia(identifier.LeadingTrivia))
+ {
+ return true;
+ }
+
+ if (ContainsNoisyTrivia(identifier.TrailingTrivia))
+ {
+ return true;
+ }
+
+ var declStatement = identifier.Parent.FirstAncestorOrSelf<T>((n) => true);
+ if (declStatement == null)
+ {
+ return true;
+ }
+
+ foreach (var token in declStatement.DescendantTokens())
+ {
+ if (ContainsNoisyTrivia(token.LeadingTrivia))
+ {
+ return true;
+ }
+
+ if (ContainsNoisyTrivia(token.TrailingTrivia))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private bool ContainsNoisyTrivia(SyntaxTriviaList list)
+ {
+ return list.Any(t => !_nonNoisySet.Contains(t.RawKind));
+ }
+ }
+
+ protected class QueryVariableSymbol : NotMovableVariableSymbol, IComparable<QueryVariableSymbol>
+ {
+ private readonly IRangeVariableSymbol _symbol;
+
+ public QueryVariableSymbol(Compilation compilation, IRangeVariableSymbol symbol, ITypeSymbol type) :
+ base(compilation, type)
+ {
+ //Contract.ThrowIfNull(symbol);
+ _symbol = symbol;
+ }
+
+ public override int DisplayOrder
+ {
+ get { return 2; }
+ }
+
+ protected override int CompareTo(VariableSymbol right)
+ {
+ return this.CompareTo((QueryVariableSymbol)right);
+ }
+
+ public int CompareTo(QueryVariableSymbol other)
+ {
+ //Contract.ThrowIfNull(other);
+
+ if (this == other)
+ {
+ return 0;
+ }
+
+ var locationLeft = _symbol.Locations.First();
+ var locationRight = other._symbol.Locations.First();
+
+// Contract.ThrowIfFalse(locationLeft.IsInSource);
+// Contract.ThrowIfFalse(locationRight.IsInSource);
+// Contract.ThrowIfFalse(locationLeft.SourceTree == locationRight.SourceTree);
+// Contract.ThrowIfFalse(locationLeft.SourceSpan.Start != locationRight.SourceSpan.Start);
+
+ return locationLeft.SourceSpan.Start - locationRight.SourceSpan.Start;
+ }
+
+ public override string Name
+ {
+ get
+ {
+ return _symbol.ToDisplayString(
+ new SymbolDisplayFormat(
+ miscellaneousOptions: SymbolDisplayMiscellaneousOptions.EscapeKeywordIdentifiers));
+ }
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.cs
new file mode 100644
index 0000000000..98cba2afd5
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/MethodExtractor.cs
@@ -0,0 +1,171 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Formatting.Rules;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ abstract partial class MethodExtractor
+ {
+ protected readonly SelectionResult OriginalSelectionResult;
+
+ public MethodExtractor(SelectionResult selectionResult)
+ {
+ //Contract.ThrowIfNull(selectionResult);
+ this.OriginalSelectionResult = selectionResult;
+ }
+
+ protected abstract Task<AnalyzerResult> AnalyzeAsync(SelectionResult selectionResult, CancellationToken cancellationToken);
+ protected abstract Task<InsertionPoint> GetInsertionPointAsync(SemanticDocument document, int position, CancellationToken cancellationToken);
+ protected abstract Task<TriviaResult> PreserveTriviaAsync(SelectionResult selectionResult, CancellationToken cancellationToken);
+ protected abstract Task<SemanticDocument> ExpandAsync(SelectionResult selection, CancellationToken cancellationToken);
+
+ protected abstract Task<GeneratedCode> GenerateCodeAsync(InsertionPoint insertionPoint, SelectionResult selectionResult, AnalyzerResult analyzeResult, CancellationToken cancellationToken);
+
+ protected abstract SyntaxToken GetMethodNameAtInvocation(IEnumerable<SyntaxNodeOrToken> methodNames);
+ // protected abstract IEnumerable<IFormattingRule> GetFormattingRules(Document document);
+
+ protected abstract Task<OperationStatus> CheckTypeAsync(Document document, SyntaxNode contextNode, Location location, ITypeSymbol type, CancellationToken cancellationToken);
+
+ public async Task<ExtractMethodResult> ExtractMethodAsync(CancellationToken cancellationToken)
+ {
+ var operationStatus = this.OriginalSelectionResult.Status;
+
+ var analyzeResult = await AnalyzeAsync(this.OriginalSelectionResult, cancellationToken).ConfigureAwait(false);
+ cancellationToken.ThrowIfCancellationRequested();
+
+ operationStatus = await CheckVariableTypesAsync(analyzeResult.Status.With(operationStatus), analyzeResult, cancellationToken).ConfigureAwait(false);
+ if (operationStatus.FailedWithNoBestEffortSuggestion())
+ {
+ return new FailedExtractMethodResult(operationStatus);
+ }
+
+ var insertionPoint = await GetInsertionPointAsync(analyzeResult.SemanticDocument, this.OriginalSelectionResult.OriginalSpan.Start, cancellationToken).ConfigureAwait(false);
+ cancellationToken.ThrowIfCancellationRequested();
+
+ var triviaResult = await PreserveTriviaAsync(this.OriginalSelectionResult.With(insertionPoint.SemanticDocument), cancellationToken).ConfigureAwait(false);
+ cancellationToken.ThrowIfCancellationRequested();
+
+ var expandedDocument = await ExpandAsync(this.OriginalSelectionResult.With(triviaResult.SemanticDocument), cancellationToken).ConfigureAwait(false);
+
+ var generatedCode = await GenerateCodeAsync(
+ insertionPoint.With(expandedDocument),
+ this.OriginalSelectionResult.With(expandedDocument),
+ analyzeResult.With(expandedDocument),
+ cancellationToken).ConfigureAwait(false);
+
+ var applied = await triviaResult.ApplyAsync(generatedCode, cancellationToken).ConfigureAwait(false);
+ var afterTriviaRestored = applied.With(operationStatus);
+ cancellationToken.ThrowIfCancellationRequested();
+
+ if (afterTriviaRestored.Status.FailedWithNoBestEffortSuggestion())
+ {
+ return CreateExtractMethodResult(
+ operationStatus, generatedCode.SemanticDocument, generatedCode.MethodNameAnnotation, generatedCode.MethodDefinitionAnnotation);
+ }
+
+ var finalDocument = afterTriviaRestored.Data.Document;
+ finalDocument = await Formatter.FormatAsync(finalDocument, Formatter.Annotation, options: null,/* rules: GetFormattingRules(finalDocument), */cancellationToken: cancellationToken).ConfigureAwait(false);
+
+ cancellationToken.ThrowIfCancellationRequested();
+ return CreateExtractMethodResult(
+ operationStatus.With(generatedCode.Status),
+ await SemanticDocument.CreateAsync(finalDocument, cancellationToken).ConfigureAwait(false),
+ generatedCode.MethodNameAnnotation,
+ generatedCode.MethodDefinitionAnnotation);
+ }
+
+ private ExtractMethodResult CreateExtractMethodResult(
+ OperationStatus status, SemanticDocument semanticDocument,
+ SyntaxAnnotation invocationAnnotation, SyntaxAnnotation methodAnnotation)
+ {
+ var newRoot = semanticDocument.Root;
+ var annotatedTokens = newRoot.GetAnnotatedNodesAndTokens(invocationAnnotation);
+ var methodDefinition = newRoot.GetAnnotatedNodesAndTokens(methodAnnotation).FirstOrDefault().AsNode();
+
+ return new SimpleExtractMethodResult(status, semanticDocument.Document, GetMethodNameAtInvocation(annotatedTokens), methodDefinition);
+ }
+
+ private async Task<OperationStatus> CheckVariableTypesAsync(
+ OperationStatus status,
+ AnalyzerResult analyzeResult,
+ CancellationToken cancellationToken)
+ {
+ var document = analyzeResult.SemanticDocument;
+
+ // sync selection result to same semantic data as analyzeResult
+ var firstToken = this.OriginalSelectionResult.With(document).GetFirstTokenInSelection();
+ var context = firstToken.Parent;
+
+ var result = await TryCheckVariableTypeAsync(document, context, analyzeResult.GetVariablesToMoveIntoMethodDefinition(cancellationToken), status, cancellationToken).ConfigureAwait(false);
+ if (!result.Item1)
+ {
+ result = await TryCheckVariableTypeAsync(document, context, analyzeResult.GetVariablesToSplitOrMoveIntoMethodDefinition(cancellationToken), result.Item2, cancellationToken).ConfigureAwait(false);
+ if (!result.Item1)
+ {
+ result = await TryCheckVariableTypeAsync(document, context, analyzeResult.MethodParameters, result.Item2, cancellationToken).ConfigureAwait(false);
+ if (!result.Item1)
+ {
+ result = await TryCheckVariableTypeAsync(document, context, analyzeResult.GetVariablesToMoveOutToCallSite(cancellationToken), result.Item2, cancellationToken).ConfigureAwait(false);
+ if (!result.Item1)
+ {
+ result = await TryCheckVariableTypeAsync(document, context, analyzeResult.GetVariablesToSplitOrMoveOutToCallSite(cancellationToken), result.Item2, cancellationToken).ConfigureAwait(false);
+ if (!result.Item1)
+ {
+ return result.Item2;
+ }
+ }
+ }
+ }
+ }
+
+ status = result.Item2;
+
+ var checkedStatus = await CheckTypeAsync(document.Document, context, context.GetLocation(), analyzeResult.ReturnType, cancellationToken).ConfigureAwait(false);
+ return checkedStatus.With(status);
+ }
+
+ private async Task<Tuple<bool, OperationStatus>> TryCheckVariableTypeAsync(
+ SemanticDocument document, SyntaxNode contextNode, IEnumerable<VariableInfo> variables,
+ OperationStatus status, CancellationToken cancellationToken)
+ {
+ if (status.FailedWithNoBestEffortSuggestion())
+ {
+ return Tuple.Create(false, status);
+ }
+
+ var location = contextNode.GetLocation();
+
+ foreach (var variable in variables)
+ {
+ var originalType = variable.GetVariableType(document);
+ var result = await CheckTypeAsync(document.Document, contextNode, location, originalType, cancellationToken).ConfigureAwait(false);
+ if (result.FailedWithNoBestEffortSuggestion())
+ {
+ status = status.With(result);
+ return Tuple.Create(false, status);
+ }
+ }
+
+ return Tuple.Create(true, status);
+ }
+
+ public static string MakeMethodName(string prefix, string originalName)
+ {
+ var startingWithLetter = originalName.SkipWhile(c => !char.IsLetter(c)).ToArray();
+ var name = startingWithLetter.Length == 0 ? originalName : new string(startingWithLetter);
+
+ return char.IsUpper(name[0]) ?
+ prefix + name :
+ prefix + char.ToUpper(name[0]).ToString() + name.Substring(1);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/OperationStatus.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/OperationStatus.cs
new file mode 100644
index 0000000000..8c762ed461
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/OperationStatus.cs
@@ -0,0 +1,68 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ partial class OperationStatus
+ {
+ public OperationStatus(OperationStatusFlag flag, string reason)
+ {
+ //Contract.ThrowIfTrue(flag.Succeeded() && flag.HasBestEffort());
+
+ this.Flag = flag;
+ this.Reasons = reason == null ? SpecializedCollections.EmptyEnumerable<string>() : SpecializedCollections.SingletonEnumerable(reason);
+ }
+
+ private OperationStatus(OperationStatusFlag flag, IEnumerable<string> reasons)
+ {
+ //Contract.ThrowIfNull(reasons);
+ //Contract.ThrowIfTrue(flag.Succeeded() && flag.HasBestEffort());
+
+ this.Flag = flag;
+ this.Reasons = reasons;
+ }
+
+ public OperationStatus With(OperationStatusFlag flag, string reason)
+ {
+ var newFlag = this.Flag | flag;
+
+ newFlag = (this.Failed() || flag.Failed()) ? newFlag.RemoveFlag(OperationStatusFlag.Succeeded) : newFlag;
+ newFlag = newFlag.Succeeded() ? newFlag.RemoveFlag(OperationStatusFlag.BestEffort) : newFlag;
+
+ var reasons = reason == null ? this.Reasons : this.Reasons.Concat(reason);
+ return new OperationStatus(newFlag, reasons);
+ }
+
+ public OperationStatus With(OperationStatus operationStatus)
+ {
+ var newFlag = this.Flag | operationStatus.Flag;
+
+ newFlag = (this.Failed() || operationStatus.Failed()) ? newFlag.RemoveFlag(OperationStatusFlag.Succeeded) : newFlag;
+ newFlag = newFlag.Succeeded() ? newFlag.RemoveFlag(OperationStatusFlag.BestEffort) : newFlag;
+
+ var reasons = this.Reasons.Concat(operationStatus.Reasons);
+ return new OperationStatus(newFlag, reasons);
+ }
+
+ public OperationStatus MakeFail()
+ {
+ return new OperationStatus(OperationStatusFlag.None, this.Reasons);
+ }
+
+ public OperationStatus MarkSuggestion()
+ {
+ return new OperationStatus(this.Flag | OperationStatusFlag.Suggestion, this.Reasons);
+ }
+
+ public OperationStatus<T> With<T>(T data)
+ {
+ return Create(this, data);
+ }
+
+ public OperationStatusFlag Flag { get; }
+ public IEnumerable<string> Reasons { get; }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/OperationStatus_Statics.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/OperationStatus_Statics.cs
new file mode 100644
index 0000000000..3768600158
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/OperationStatus_Statics.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ partial class OperationStatus
+ {
+ public static readonly OperationStatus Succeeded = new OperationStatus(OperationStatusFlag.Succeeded, reason: null);
+ public static readonly OperationStatus FailedWithUnknownReason = new OperationStatus(OperationStatusFlag.None, reason: "FeaturesResources.ExtractMethodFailedWithUnknownReasons");
+ public static readonly OperationStatus OverlapsHiddenPosition = new OperationStatus(OperationStatusFlag.None, "FeaturesResources.GeneratedCodeIsOverlapping");
+
+ public static readonly OperationStatus NoActiveStatement = new OperationStatus(OperationStatusFlag.BestEffort, "FeaturesResources.NoActiveStatement");
+ public static readonly OperationStatus ErrorOrUnknownType = new OperationStatus(OperationStatusFlag.BestEffort, "FeaturesResources.ErrorOrUnknownType");
+ public static readonly OperationStatus UnsafeAddressTaken = new OperationStatus(OperationStatusFlag.BestEffort, "FeaturesResources.TheAddressOfAVariableIsUsed");
+
+ /// <summary>
+ /// create operation status with the given data
+ /// </summary>
+ public static OperationStatus<T> Create<T>(OperationStatus status, T data)
+ {
+ return new OperationStatus<T>(status, data);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/OperationStatus`1.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/OperationStatus`1.cs
new file mode 100644
index 0000000000..48301d7ed5
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/OperationStatus`1.cs
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ /// <summary>
+ /// operation status paired with data
+ /// </summary>
+ class OperationStatus<T>
+ {
+ public OperationStatus(OperationStatus status, T data)
+ {
+ this.Status = status;
+ this.Data = data;
+ }
+
+ public OperationStatus Status { get; }
+ public T Data { get; }
+
+ public OperationStatus<T> With(OperationStatus status)
+ {
+ return new OperationStatus<T>(status, this.Data);
+ }
+
+ public OperationStatus<TNew> With<TNew>(TNew data)
+ {
+ return new OperationStatus<TNew>(this.Status, data);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ParameterStyle.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ParameterStyle.cs
new file mode 100644
index 0000000000..ad012fdc4a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ParameterStyle.cs
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ class ParameterStyle
+ {
+ public ParameterBehavior ParameterBehavior { get; private set; }
+ public DeclarationBehavior DeclarationBehavior { get; private set; }
+ public DeclarationBehavior SaferDeclarationBehavior { get; private set; }
+
+ public static readonly ParameterStyle None =
+ new ParameterStyle() { ParameterBehavior = ParameterBehavior.None, DeclarationBehavior = DeclarationBehavior.None, SaferDeclarationBehavior = DeclarationBehavior.None };
+
+ public static readonly ParameterStyle InputOnly =
+ new ParameterStyle() { ParameterBehavior = ParameterBehavior.Input, DeclarationBehavior = DeclarationBehavior.None, SaferDeclarationBehavior = DeclarationBehavior.None };
+
+ public static readonly ParameterStyle Delete =
+ new ParameterStyle() { ParameterBehavior = ParameterBehavior.None, DeclarationBehavior = DeclarationBehavior.Delete, SaferDeclarationBehavior = DeclarationBehavior.None };
+
+ public static readonly ParameterStyle MoveOut =
+ new ParameterStyle() { ParameterBehavior = ParameterBehavior.None, DeclarationBehavior = DeclarationBehavior.MoveOut, SaferDeclarationBehavior = DeclarationBehavior.SplitOut };
+
+ public static readonly ParameterStyle SplitOut =
+ new ParameterStyle() { ParameterBehavior = ParameterBehavior.None, DeclarationBehavior = DeclarationBehavior.SplitOut, SaferDeclarationBehavior = DeclarationBehavior.SplitOut };
+
+ public static readonly ParameterStyle MoveIn =
+ new ParameterStyle() { ParameterBehavior = ParameterBehavior.None, DeclarationBehavior = DeclarationBehavior.MoveIn, SaferDeclarationBehavior = DeclarationBehavior.SplitIn };
+
+ public static readonly ParameterStyle SplitIn =
+ new ParameterStyle() { ParameterBehavior = ParameterBehavior.None, DeclarationBehavior = DeclarationBehavior.SplitIn, SaferDeclarationBehavior = DeclarationBehavior.SplitIn };
+
+ public static readonly ParameterStyle Out =
+ new ParameterStyle() { ParameterBehavior = ParameterBehavior.Out, DeclarationBehavior = DeclarationBehavior.None, SaferDeclarationBehavior = DeclarationBehavior.None };
+
+ public static readonly ParameterStyle Ref =
+ new ParameterStyle() { ParameterBehavior = ParameterBehavior.Ref, DeclarationBehavior = DeclarationBehavior.None, SaferDeclarationBehavior = DeclarationBehavior.None };
+
+ public static readonly ParameterStyle OutWithMoveOut =
+ new ParameterStyle() { ParameterBehavior = ParameterBehavior.Out, DeclarationBehavior = DeclarationBehavior.MoveOut, SaferDeclarationBehavior = DeclarationBehavior.MoveOut };
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ReturnStyle.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ReturnStyle.cs
new file mode 100644
index 0000000000..9f7d8625c4
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/ReturnStyle.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ class ReturnStyle
+ {
+ public ParameterBehavior ParameterBehavior { get; private set; }
+ public ReturnBehavior ReturnBehavior { get; private set; }
+ public DeclarationBehavior DeclarationBehavior { get; private set; }
+
+ public static readonly ReturnStyle None =
+ new ReturnStyle() { ParameterBehavior = ParameterBehavior.None, ReturnBehavior = ReturnBehavior.None, DeclarationBehavior = DeclarationBehavior.None };
+
+ public static readonly ReturnStyle AssignmentWithInput =
+ new ReturnStyle() { ParameterBehavior = ParameterBehavior.Input, ReturnBehavior = ReturnBehavior.Assignment, DeclarationBehavior = DeclarationBehavior.None };
+
+ public static readonly ReturnStyle AssignmentWithNoInput =
+ new ReturnStyle() { ParameterBehavior = ParameterBehavior.None, ReturnBehavior = ReturnBehavior.Assignment, DeclarationBehavior = DeclarationBehavior.SplitIn };
+
+ public static readonly ReturnStyle Initialization =
+ new ReturnStyle() { ParameterBehavior = ParameterBehavior.None, ReturnBehavior = ReturnBehavior.Initialization, DeclarationBehavior = DeclarationBehavior.SplitOut };
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/SelectionResult.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/SelectionResult.cs
new file mode 100644
index 0000000000..df2ff4ec47
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/SelectionResult.cs
@@ -0,0 +1,158 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ /// <summary>
+ /// clean up this code when we do selection validator work.
+ /// </summary>
+ abstract class SelectionResult
+ {
+ protected SelectionResult(OperationStatus status)
+ {
+ // Contract.ThrowIfNull(status);
+
+ this.Status = status;
+ }
+
+ protected SelectionResult(
+ OperationStatus status,
+ TextSpan originalSpan,
+ TextSpan finalSpan,
+ OptionSet options,
+ bool selectionInExpression,
+ SemanticDocument document,
+ SyntaxAnnotation firstTokenAnnotation,
+ SyntaxAnnotation lastTokenAnnotation)
+ {
+ this.Status = status;
+
+ this.OriginalSpan = originalSpan;
+ this.FinalSpan = finalSpan;
+
+ this.SelectionInExpression = selectionInExpression;
+ this.Options = options;
+
+ this.FirstTokenAnnotation = firstTokenAnnotation;
+ this.LastTokenAnnotation = lastTokenAnnotation;
+
+ this.SemanticDocument = document;
+ }
+
+ protected abstract bool UnderAsyncAnonymousMethod(SyntaxToken token, SyntaxToken firstToken, SyntaxToken lastToken);
+
+ public abstract bool ContainingScopeHasAsyncKeyword();
+
+ public abstract SyntaxNode GetContainingScope();
+ public abstract ITypeSymbol GetContainingScopeType();
+
+ public OperationStatus Status { get; }
+ public TextSpan OriginalSpan { get; }
+ public TextSpan FinalSpan { get; }
+ public OptionSet Options { get; }
+ public bool SelectionInExpression { get; }
+ public SemanticDocument SemanticDocument { get; private set; }
+ public SyntaxAnnotation FirstTokenAnnotation { get; }
+ public SyntaxAnnotation LastTokenAnnotation { get; }
+
+ public SelectionResult With(SemanticDocument document)
+ {
+ if (this.SemanticDocument == document)
+ {
+ return this;
+ }
+
+ var clone = (SelectionResult)this.MemberwiseClone();
+ clone.SemanticDocument = document;
+
+ return clone;
+ }
+
+ public bool ContainsValidContext
+ {
+ get
+ {
+ return this.SemanticDocument != null;
+ }
+ }
+
+ public SyntaxToken GetFirstTokenInSelection()
+ {
+ return this.SemanticDocument.GetTokenWithAnnotaton(this.FirstTokenAnnotation);
+ }
+
+ public SyntaxToken GetLastTokenInSelection()
+ {
+ return this.SemanticDocument.GetTokenWithAnnotaton(this.LastTokenAnnotation);
+ }
+
+ public TNode GetContainingScopeOf<TNode>() where TNode : SyntaxNode
+ {
+ var containingScope = this.GetContainingScope();
+ return containingScope.GetAncestorOrThis<TNode>();
+ }
+
+ protected T GetFirstStatement<T>() where T : SyntaxNode
+ {
+ //Contract.ThrowIfTrue(this.SelectionInExpression);
+
+ var token = this.GetFirstTokenInSelection();
+ return token.GetAncestor<T>();
+ }
+
+ protected T GetLastStatement<T>() where T : SyntaxNode
+ {
+ //Contract.ThrowIfTrue(this.SelectionInExpression);
+
+ var token = this.GetLastTokenInSelection();
+ return token.GetAncestor<T>();
+ }
+
+ public bool ShouldPutAsyncModifier()
+ {
+ var firstToken = this.GetFirstTokenInSelection();
+ var lastToken = this.GetLastTokenInSelection();
+
+ for (var currentToken = firstToken;
+ currentToken.Span.End < lastToken.SpanStart;
+ currentToken = currentToken.GetNextToken())
+ {
+ // [|
+ // async () => await ....
+ // |]
+ //
+ // for the case above, even if the selection contains "await", it doesn't belong to the enclosing block
+ // which extract method is applied to
+ if (currentToken.IsAwaitKeyword()
+ && !UnderAsyncAnonymousMethod(currentToken, firstToken, lastToken))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public bool AllowMovingDeclaration
+ {
+ get
+ {
+ return this.Options.GetOption(ExtractMethodOptions.AllowMovingDeclaration, this.SemanticDocument.Project.Language);
+ }
+ }
+
+ public bool DontPutOutOrRefOnStruct
+ {
+ get
+ {
+ return this.Options.GetOption(ExtractMethodOptions.DontPutOutOrRefOnStruct, this.SemanticDocument.Project.Language);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/SelectionValidator.NullSelectionResult.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/SelectionValidator.NullSelectionResult.cs
new file mode 100644
index 0000000000..3a957d7222
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/SelectionValidator.NullSelectionResult.cs
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ partial class SelectionValidator
+ {
+ // null object
+ protected class NullSelectionResult : SelectionResult
+ {
+ public NullSelectionResult() :
+ this(OperationStatus.FailedWithUnknownReason)
+ {
+ }
+
+ protected NullSelectionResult(OperationStatus status) :
+ base(status)
+ {
+ }
+
+ protected override bool UnderAsyncAnonymousMethod(SyntaxToken token, SyntaxToken firstToken, SyntaxToken lastToken)
+ {
+ throw new InvalidOperationException();
+ }
+
+ public override bool ContainingScopeHasAsyncKeyword()
+ {
+ throw new InvalidOperationException();
+ }
+
+ public override SyntaxNode GetContainingScope()
+ {
+ throw new InvalidOperationException();
+ }
+
+ public override ITypeSymbol GetContainingScopeType()
+ {
+ throw new InvalidOperationException();
+ }
+ }
+
+ protected class ErrorSelectionResult : NullSelectionResult
+ {
+ public ErrorSelectionResult(OperationStatus status) :
+ base(status.MakeFail())
+ {
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/SelectionValidator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/SelectionValidator.cs
new file mode 100644
index 0000000000..4067dfe48d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/SelectionValidator.cs
@@ -0,0 +1,185 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ abstract partial class SelectionValidator
+ {
+ protected static readonly SelectionResult NullSelection = new NullSelectionResult();
+
+ protected readonly SemanticDocument SemanticDocument;
+ protected readonly TextSpan OriginalSpan;
+ protected readonly OptionSet Options;
+
+ protected SelectionValidator(
+ SemanticDocument document,
+ TextSpan textSpan,
+ OptionSet options)
+ {
+ //Contract.ThrowIfNull(document);
+
+ this.SemanticDocument = document;
+ this.OriginalSpan = textSpan;
+ this.Options = options;
+ }
+
+ public bool ContainsValidSelection
+ {
+ get
+ {
+ return !this.OriginalSpan.IsEmpty;
+ }
+ }
+
+ public abstract Task<SelectionResult> GetValidSelectionAsync(CancellationToken cancellationToken);
+ public abstract IEnumerable<SyntaxNode> GetOuterReturnStatements(SyntaxNode commonRoot, IEnumerable<SyntaxNode> jumpsOutOfRegion);
+ public abstract bool IsFinalSpanSemanticallyValidSpan(SyntaxNode node, TextSpan textSpan, IEnumerable<SyntaxNode> returnStatements, CancellationToken cancellationToken);
+ public abstract bool ContainsNonReturnExitPointsStatements(IEnumerable<SyntaxNode> jumpsOutOfRegion);
+
+ protected bool IsFinalSpanSemanticallyValidSpan(
+ SemanticModel semanticModel, TextSpan textSpan, Tuple<SyntaxNode, SyntaxNode> range, CancellationToken cancellationToken)
+ {
+ //Contract.ThrowIfNull(range);
+
+ var controlFlowAnalysisData = semanticModel.AnalyzeControlFlow(range.Item1, range.Item2);
+
+ // there must be no control in and out of given span
+ if (controlFlowAnalysisData.EntryPoints.Any())
+ {
+ return false;
+ }
+
+ // check something like continue, break, yield break, yield return, and etc
+ if (ContainsNonReturnExitPointsStatements(controlFlowAnalysisData.ExitPoints))
+ {
+ return false;
+ }
+
+ // okay, there is no branch out, check whether next statement can be executed normally
+ var returnStatements = GetOuterReturnStatements(range.Item1.GetCommonRoot(range.Item2), controlFlowAnalysisData.ExitPoints);
+ if (!returnStatements.Any())
+ {
+ if (!controlFlowAnalysisData.EndPointIsReachable)
+ {
+ // REVIEW: should we just do extract method regardless or show some warning to user?
+ // in dev10, looks like we went ahead and did the extract method even if selection contains
+ // unreachable code.
+ }
+
+ return true;
+ }
+
+ // okay, only branch was return. make sure we have all return in the selection. (?)
+ if (!controlFlowAnalysisData.EndPointIsReachable)
+ {
+ return true;
+ }
+
+ // there is a return statement, and current position is reachable. let's check whether this is a case where that is okay
+ return IsFinalSpanSemanticallyValidSpan(semanticModel.SyntaxTree.GetRoot(cancellationToken), textSpan, returnStatements, cancellationToken);
+ }
+
+ protected Tuple<SyntaxNode, SyntaxNode> GetStatementRangeContainingSpan<T>(
+ SyntaxNode root, TextSpan textSpan, CancellationToken cancellationToken) where T : SyntaxNode
+ {
+ // use top-down approach to find smallest statement range that contains given span.
+ // this approach is more expansive than bottom-up approach I used before but way simpler and easy to understand
+ var token1 = root.FindToken(textSpan.Start);
+ var token2 = root.FindTokenFromEnd(textSpan.End);
+
+ var commonRoot = token1.GetCommonRoot(token2).GetAncestorOrThis<T>() ?? root;
+
+ var firstStatement = default(T);
+ var lastStatement = default(T);
+
+ var spine = new List<T>();
+
+ foreach (var stmt in commonRoot.DescendantNodesAndSelf().OfType<T>())
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+
+ // quick skip check.
+ // - not containing at all
+ if (stmt.Span.End < textSpan.Start)
+ {
+ continue;
+ }
+
+ // quick exit check
+ // - passed candidate statements
+ if (textSpan.End < stmt.SpanStart)
+ {
+ break;
+ }
+
+ if (stmt.SpanStart <= textSpan.Start)
+ {
+ // keep track spine
+ spine.Add(stmt);
+ }
+
+ if (textSpan.End <= stmt.Span.End && spine.Any(s => s.Parent == stmt.Parent))
+ {
+ // malformed code or selection can make spine to have more than an elements
+ firstStatement = spine.First(s => s.Parent == stmt.Parent);
+ lastStatement = stmt;
+
+ spine.Clear();
+ }
+ }
+
+ if (firstStatement == null || lastStatement == null)
+ {
+ return null;
+ }
+
+ return new Tuple<SyntaxNode, SyntaxNode>(firstStatement, lastStatement);
+ }
+
+ protected Tuple<SyntaxNode, SyntaxNode> GetStatementRangeContainedInSpan<T>(
+ SyntaxNode root, TextSpan textSpan, CancellationToken cancellationToken) where T : SyntaxNode
+ {
+ // use top-down approach to find largest statement range contained in the given span
+ // this method is a bit more expensive than bottom-up approach, but way more simpler than the other approach.
+ var token1 = root.FindToken(textSpan.Start);
+ var token2 = root.FindTokenFromEnd(textSpan.End);
+
+ var commonRoot = token1.GetCommonRoot(token2).GetAncestorOrThis<T>() ?? root;
+
+ T firstStatement = null;
+ T lastStatement = null;
+
+ foreach (var stmt in commonRoot.DescendantNodesAndSelf().OfType<T>())
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+
+ if (firstStatement == null && stmt.SpanStart >= textSpan.Start)
+ {
+ firstStatement = stmt;
+ }
+
+ if (firstStatement != null && stmt.Span.End <= textSpan.End && stmt.Parent == firstStatement.Parent)
+ {
+ lastStatement = stmt;
+ }
+ }
+
+ if (firstStatement == null || lastStatement == null)
+ {
+ return null;
+ }
+
+ return new Tuple<SyntaxNode, SyntaxNode>(firstStatement, lastStatement);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/SimpleExtractMethodResult.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/SimpleExtractMethodResult.cs
new file mode 100644
index 0000000000..ccdc5aaac6
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/SimpleExtractMethodResult.cs
@@ -0,0 +1,17 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ class SimpleExtractMethodResult : ExtractMethodResult
+ {
+ public SimpleExtractMethodResult(
+ OperationStatus status,
+ Document document,
+ SyntaxToken invocationNameToken,
+ SyntaxNode methodDefinition)
+ : base(status.Flag, status.Reasons, document, invocationNameToken, methodDefinition)
+ {
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/UniqueNameGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/UniqueNameGenerator.cs
new file mode 100644
index 0000000000..ed5ac2b4f0
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/UniqueNameGenerator.cs
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using Microsoft.CodeAnalysis.Shared.Utilities;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ class UniqueNameGenerator
+ {
+ private readonly SemanticModel _semanticModel;
+
+ public UniqueNameGenerator(SemanticModel semanticModel)
+ {
+ //Contract.ThrowIfNull(semanticModel);
+ _semanticModel = semanticModel;
+ }
+
+ public string CreateUniqueMethodName(SyntaxNode contextNode, string baseName)
+ {
+ //Contract.ThrowIfNull(contextNode);
+ //Contract.ThrowIfNull(baseName);
+
+ return NameGenerator.GenerateUniqueName(baseName, string.Empty,
+ n => _semanticModel.LookupSymbols(contextNode.SpanStart, /*container*/null, n).Length == 0);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/VariableStyle.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/VariableStyle.cs
new file mode 100644
index 0000000000..3eb25eebf0
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ExtractMethod/VariableStyle.cs
@@ -0,0 +1,49 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+namespace ICSharpCode.NRefactory6.CSharp.ExtractMethod
+{
+ class VariableStyle
+ {
+ public ParameterStyle ParameterStyle { get; private set; }
+ public ReturnStyle ReturnStyle { get; private set; }
+
+ public static readonly VariableStyle None =
+ new VariableStyle() { ParameterStyle = ParameterStyle.None, ReturnStyle = ReturnStyle.None };
+
+ public static readonly VariableStyle InputOnly =
+ new VariableStyle() { ParameterStyle = ParameterStyle.InputOnly, ReturnStyle = ReturnStyle.None };
+
+ public static readonly VariableStyle Delete =
+ new VariableStyle() { ParameterStyle = ParameterStyle.Delete, ReturnStyle = ReturnStyle.None };
+
+ public static readonly VariableStyle MoveOut =
+ new VariableStyle() { ParameterStyle = ParameterStyle.MoveOut, ReturnStyle = ReturnStyle.None };
+
+ public static readonly VariableStyle SplitOut =
+ new VariableStyle() { ParameterStyle = ParameterStyle.SplitOut, ReturnStyle = ReturnStyle.None };
+
+ public static readonly VariableStyle MoveIn =
+ new VariableStyle() { ParameterStyle = ParameterStyle.MoveIn, ReturnStyle = ReturnStyle.None };
+
+ public static readonly VariableStyle SplitIn =
+ new VariableStyle() { ParameterStyle = ParameterStyle.SplitIn, ReturnStyle = ReturnStyle.None };
+
+ public static readonly VariableStyle NotUsed =
+ new VariableStyle() { ParameterStyle = ParameterStyle.MoveOut, ReturnStyle = ReturnStyle.Initialization };
+
+ public static readonly VariableStyle Ref =
+ new VariableStyle() { ParameterStyle = ParameterStyle.Ref, ReturnStyle = ReturnStyle.AssignmentWithInput };
+
+ public static readonly VariableStyle OnlyAsRefParam =
+ new VariableStyle() { ParameterStyle = ParameterStyle.Ref, ReturnStyle = ReturnStyle.None };
+
+ public static readonly VariableStyle Out =
+ new VariableStyle() { ParameterStyle = ParameterStyle.Out, ReturnStyle = ReturnStyle.AssignmentWithNoInput };
+
+ public static readonly VariableStyle OutWithErrorInput =
+ new VariableStyle() { ParameterStyle = ParameterStyle.Out, ReturnStyle = ReturnStyle.AssignmentWithInput };
+
+ public static readonly VariableStyle OutWithMoveOut =
+ new VariableStyle() { ParameterStyle = ParameterStyle.OutWithMoveOut, ReturnStyle = ReturnStyle.Initialization };
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/CSharpEditorFormattingService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/CSharpEditorFormattingService.cs
new file mode 100644
index 0000000000..04508ba1d7
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/CSharpEditorFormattingService.cs
@@ -0,0 +1,292 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Composition;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Formatting.Rules;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using System.Text;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ partial class CSharpEditorFormattingService
+ {
+ private readonly ImmutableHashSet<char> _supportedChars;
+ private readonly ImmutableHashSet<char> _autoFormattingTriggerChars;
+ private readonly ImmutableDictionary<char, ImmutableHashSet<SyntaxKind>> _multiWordsMap;
+
+ public CSharpEditorFormattingService()
+ {
+ _autoFormattingTriggerChars = ImmutableHashSet.CreateRange<char>(";}");
+
+ // add all auto formatting trigger to supported char
+ _supportedChars = _autoFormattingTriggerChars.Union("{}#nte:)");
+
+ // set up multi words map
+ _multiWordsMap = ImmutableDictionary.CreateRange(new[]
+ {
+ new KeyValuePair<char, ImmutableHashSet<SyntaxKind>> ('n', ImmutableHashSet.Create(SyntaxKind.RegionKeyword, SyntaxKind.EndRegionKeyword)),
+ new KeyValuePair<char, ImmutableHashSet<SyntaxKind>> ('t', ImmutableHashSet.Create(SyntaxKind.SelectKeyword)),
+ new KeyValuePair<char, ImmutableHashSet<SyntaxKind>> ('e', ImmutableHashSet.Create(SyntaxKind.WhereKeyword)),
+ });
+ }
+
+ public bool SupportsFormatDocument { get { return true; } }
+
+ public bool SupportsFormatOnPaste { get { return true; } }
+
+ public bool SupportsFormatSelection { get { return true; } }
+
+ public bool SupportsFormatOnReturn { get { return true; } }
+
+ public bool SupportsFormattingOnTypedCharacter(Document document, char ch)
+ {
+ var optionsService = document.Project.Solution.Workspace.Options;
+ // if ((ch == '}' && !optionsService.GetOption(FeatureOnOffOptions.AutoFormattingOnCloseBrace, document.Project.Language)) ||
+ // (ch == ';' && !optionsService.GetOption(FeatureOnOffOptions.AutoFormattingOnSemicolon, document.Project.Language)))
+ // {
+ // return false;
+ // }
+
+ return _supportedChars.Contains(ch);
+ }
+
+ // public async Task<IList<TextChange>> GetFormattingChangesAsync(Document document, TextSpan? textSpan, CancellationToken cancellationToken)
+ // {
+ // var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ //
+ // var span = textSpan.HasValue ? textSpan.Value : new TextSpan(0, root.FullSpan.Length);
+ // var formattingSpan = CommonFormattingHelpers.GetFormattingSpan(root, span);
+ // return Formatter.GetFormattedTextChanges(root, new TextSpan[] { formattingSpan }, document.Project.Solution.Workspace, cancellationToken: cancellationToken);
+ // }
+ //
+ // public async Task<IList<TextChange>> GetFormattingChangesOnPasteAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken)
+ // {
+ // var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ // var formattingSpan = CommonFormattingHelpers.GetFormattingSpan(root, textSpan);
+ // var service = document.GetLanguageService<ISyntaxFormattingService>();
+ // if (service == null)
+ // {
+ // return SpecializedCollections.EmptyList<TextChange>();
+ // }
+ //
+ // var rules = new List<IFormattingRule>() { new PasteFormattingRule() };
+ // rules.AddRange(service.GetDefaultFormattingRules());
+ //
+ // return Formatter.GetFormattedTextChanges(root, new[] { formattingSpan }, document.Project.Solution.Workspace, rules: rules, cancellationToken: cancellationToken);
+ // }
+ //
+ // private IEnumerable<IFormattingRule> GetFormattingRules(Document document, int position)
+ // {
+ // var workspace = document.Project.Solution.Workspace;
+ // var formattingRuleFactory = workspace.Services.GetService<IHostDependentFormattingRuleFactoryService>();
+ // return formattingRuleFactory.CreateRule(document, position).Concat(Formatter.GetDefaultFormattingRules(document));
+ // }
+ //
+ // public async Task<IList<TextChange>> GetFormattingChangesOnReturnAsync(Document document, int caretPosition, CancellationToken cancellationToken)
+ // {
+ // var formattingRules = this.GetFormattingRules(document, caretPosition);
+ //
+ // // first, find the token user just typed.
+ // SyntaxToken token = await GetTokenBeforeTheCaretAsync(document, caretPosition, cancellationToken).ConfigureAwait(false);
+ //
+ // if (token.IsMissing)
+ // {
+ // return null;
+ // }
+ //
+ // string text = null;
+ // if (IsInvalidToken(token, ref text))
+ // {
+ // return null;
+ // }
+ //
+ // // Check to see if the token is ')' and also the parent is a using statement. If not, bail
+ // if (TokenShouldNotFormatOnReturn(token))
+ // {
+ // return null;
+ // }
+ //
+ // // if formatting range fails, do format token one at least
+ // var changes = await FormatRangeAsync(document, token, formattingRules, cancellationToken).ConfigureAwait(false);
+ // if (changes.Count > 0)
+ // {
+ // return changes;
+ // }
+ //
+ // // if we can't, do normal smart indentation
+ // return await FormatTokenAsync(document, token, formattingRules, cancellationToken).ConfigureAwait(false);
+ // }
+ //
+ public static bool TokenShouldNotFormatOnReturn(SyntaxToken token)
+ {
+ return !token.IsKind(SyntaxKind.CloseParenToken) || !token.Parent.IsKind(SyntaxKind.UsingStatement);
+ }
+
+ public static bool TokenShouldNotFormatOnTypeChar(SyntaxToken token)
+ {
+ return (token.IsKind(SyntaxKind.CloseParenToken) && !token.Parent.IsKind(SyntaxKind.UsingStatement)) ||
+ (token.IsKind(SyntaxKind.ColonToken) && !(token.Parent.IsKind(SyntaxKind.LabeledStatement) || token.Parent.IsKind(SyntaxKind.CaseSwitchLabel) || token.Parent.IsKind(SyntaxKind.DefaultSwitchLabel)));
+ }
+
+ // public async Task<IList<TextChange>> GetFormattingChangesAsync(Document document, char typedChar, int caretPosition, CancellationToken cancellationToken)
+ // {
+ // var formattingRules = this.GetFormattingRules(document, caretPosition);
+ //
+ // // first, find the token user just typed.
+ // SyntaxToken token = await GetTokenBeforeTheCaretAsync(document, caretPosition, cancellationToken).ConfigureAwait(false);
+ //
+ // if (token.IsMissing ||
+ // !ValidSingleOrMultiCharactersTokenKind(typedChar, token.Kind()) ||
+ // token.IsKind(SyntaxKind.EndOfFileToken, SyntaxKind.None))
+ // {
+ // return null;
+ // }
+ //
+ // var service = document.GetLanguageService<ISyntaxFactsService>();
+ // if (service != null && service.IsInNonUserCode(token.SyntaxTree, caretPosition, cancellationToken))
+ // {
+ // return null;
+ // }
+ //
+ // // Check to see if any of the below. If not, bail.
+ // // case 1: The token is ')' and the parent is an using statement.
+ // // case 2: The token is ':' and the parent is either labelled statement or case switch or default switch
+ // if (TokenShouldNotFormatOnTypeChar(token))
+ // {
+ // return null;
+ // }
+ //
+ // // if formatting range fails, do format token one at least
+ // var changes = await FormatRangeAsync(document, token, formattingRules, cancellationToken).ConfigureAwait(false);
+ // if (changes.Count > 0)
+ // {
+ // return changes;
+ // }
+ //
+ // // if we can't, do normal smart indentation
+ // return await FormatTokenAsync(document, token, formattingRules, cancellationToken).ConfigureAwait(false);
+ // }
+
+ public static async Task<SyntaxToken> GetTokenBeforeTheCaretAsync(Document document, int caretPosition, CancellationToken cancellationToken)
+ {
+ var tree = await document.GetCSharpSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
+
+ var position = Math.Max(0, caretPosition - 1);
+ var root = await tree.GetRootAsync(cancellationToken).ConfigureAwait(false);
+ var token = root.FindToken(position, findInsideTrivia: true);
+ return token;
+ }
+
+ // private async Task<IList<TextChange>> FormatTokenAsync(Document document, SyntaxToken token, IEnumerable<IFormattingRule> formattingRules, CancellationToken cancellationToken)
+ // {
+ // var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ // var formatter = CreateSmartTokenFormatter(document.Project.Solution.Workspace.Options, formattingRules, root);
+ // var changes = formatter.FormatToken(document.Project.Solution.Workspace, token, cancellationToken);
+ // return changes;
+ // }
+ //
+ // private ISmartTokenFormatter CreateSmartTokenFormatter(OptionSet optionSet, IEnumerable<IFormattingRule> formattingRules, SyntaxNode root)
+ // {
+ // return new SmartTokenFormatter(optionSet, formattingRules, (CompilationUnitSyntax)root);
+ // }
+ //
+ // private async Task<IList<TextChange>> FormatRangeAsync(
+ // Document document, SyntaxToken endToken, IEnumerable<IFormattingRule> formattingRules,
+ // CancellationToken cancellationToken)
+ // {
+ // if (!IsEndToken(endToken))
+ // {
+ // return SpecializedCollections.EmptyList<TextChange>();
+ // }
+ //
+ // var tokenRange = FormattingRangeHelper.FindAppropriateRange(endToken);
+ // if (tokenRange == null || tokenRange.Value.Item1.Equals(tokenRange.Value.Item2))
+ // {
+ // return SpecializedCollections.EmptyList<TextChange>();
+ // }
+ //
+ // if (IsInvalidTokenKind(tokenRange.Value.Item1) || IsInvalidTokenKind(tokenRange.Value.Item2))
+ // {
+ // return SpecializedCollections.EmptyList<TextChange>();
+ // }
+ //
+ // var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ // var formatter = new SmartTokenFormatter(document.Project.Solution.Workspace.Options, formattingRules, (CompilationUnitSyntax)root);
+ //
+ // var changes = formatter.FormatRange(document.Project.Solution.Workspace, tokenRange.Value.Item1, tokenRange.Value.Item2, cancellationToken);
+ // return changes;
+ // }
+ //
+ // private bool IsEndToken(SyntaxToken endToken)
+ // {
+ // if (endToken.IsKind(SyntaxKind.OpenBraceToken))
+ // {
+ // return false;
+ // }
+ //
+ // return true;
+ // }
+ //
+ public bool ValidSingleOrMultiCharactersTokenKind(char typedChar, SyntaxKind kind)
+ {
+ ImmutableHashSet<SyntaxKind> set;
+ if (!_multiWordsMap.TryGetValue(typedChar, out set))
+ {
+ // all single char token is valid
+ return true;
+ }
+
+ return set.Contains(kind);
+ }
+
+ public bool IsInvalidToken(char typedChar, SyntaxToken token)
+ {
+ string text = null;
+ if (IsInvalidToken(token, ref text))
+ {
+ return true;
+ }
+
+ return text[0] != typedChar;
+ }
+
+ public bool IsInvalidToken(SyntaxToken token, ref string text)
+ {
+ if (IsInvalidTokenKind(token))
+ {
+ return true;
+ }
+
+ text = token.ToString();
+ if (text.Length != 1)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ private bool IsInvalidTokenKind(SyntaxToken token)
+ {
+ // invalid token to be formatted
+ return token.IsKind(SyntaxKind.None) ||
+ token.IsKind(SyntaxKind.EndOfDirectiveToken) ||
+ token.IsKind(SyntaxKind.EndOfFileToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/CommonFormattingHelpers.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/CommonFormattingHelpers.cs
new file mode 100644
index 0000000000..673f64030b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/CommonFormattingHelpers.cs
@@ -0,0 +1,372 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Formatting.Rules;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class CommonFormattingHelpers
+ {
+// public static readonly Comparison<SuppressOperation> SuppressOperationComparer = (o1, o2) =>
+// {
+// return o1.TextSpan.Start - o2.TextSpan.Start;
+// };
+//
+// public static readonly Comparison<IndentBlockOperation> IndentBlockOperationComparer = (o1, o2) =>
+// {
+// // smaller one goes left
+// var s = o1.TextSpan.Start - o2.TextSpan.Start;
+// if (s != 0)
+// {
+// return s;
+// }
+//
+// // bigger one goes left
+// var e = o2.TextSpan.End - o1.TextSpan.End;
+// if (e != 0)
+// {
+// return e;
+// }
+//
+// return 0;
+// };
+//
+// public static IEnumerable<ValueTuple<SyntaxToken, SyntaxToken>> ConvertToTokenPairs(this SyntaxNode root, IList<TextSpan> spans)
+// {
+// Contract.ThrowIfNull(root);
+// Contract.ThrowIfFalse(spans.Count > 0);
+//
+// if (spans.Count == 1)
+// {
+// // special case, if there is only one span, return right away
+// yield return root.ConvertToTokenPair(spans[0]);
+// yield break;
+// }
+//
+// var pairs = new List<ValueTuple<SyntaxToken, SyntaxToken>>();
+// var previousOne = root.ConvertToTokenPair(spans[0]);
+//
+// // iterate through each spans and make sure each one doesn't overlap each other
+// for (int i = 1; i < spans.Count; i++)
+// {
+// var currentOne = root.ConvertToTokenPair(spans[i]);
+// if (currentOne.Item1.SpanStart <= previousOne.Item2.Span.End)
+// {
+// // oops, looks like two spans are overlapping each other. merge them
+// previousOne = ValueTuple.Create(previousOne.Item1, previousOne.Item2.Span.End < currentOne.Item2.Span.End ? currentOne.Item2 : previousOne.Item2);
+// continue;
+// }
+//
+// // okay, looks like things are in good shape
+// yield return previousOne;
+//
+// // move to next one
+// previousOne = currentOne;
+// }
+//
+// // give out the last one
+// yield return previousOne;
+// }
+//
+// public static ValueTuple<SyntaxToken, SyntaxToken> ConvertToTokenPair(this SyntaxNode root, TextSpan textSpan)
+// {
+// Contract.ThrowIfNull(root);
+// Contract.ThrowIfTrue(textSpan.IsEmpty);
+//
+// var startToken = root.FindToken(textSpan.Start);
+//
+// // empty token, get previous non-zero length token
+// if (startToken.IsMissing)
+// {
+// // if there is no previous token, startToken will be set to SyntaxKind.None
+// startToken = startToken.GetPreviousToken();
+// }
+//
+// // span is on leading trivia
+// if (textSpan.Start < startToken.SpanStart)
+// {
+// // if there is no previous token, startToken will be set to SyntaxKind.None
+// startToken = startToken.GetPreviousToken();
+// }
+//
+// // adjust position where we try to search end token
+// var endToken = (root.FullSpan.End <= textSpan.End) ?
+// root.GetLastToken(includeZeroWidth: true) : root.FindToken(textSpan.End);
+//
+// // empty token, get next token
+// if (endToken.IsMissing)
+// {
+// endToken = endToken.GetNextToken();
+// }
+//
+// // span is on trailing trivia
+// if (endToken.Span.End < textSpan.End)
+// {
+// endToken = endToken.GetNextToken();
+// }
+//
+// // make sure tokens are not SyntaxKind.None
+// startToken = (startToken.RawKind != 0) ? startToken : root.GetFirstToken(includeZeroWidth: true);
+// endToken = (endToken.RawKind != 0) ? endToken : root.GetLastToken(includeZeroWidth: true);
+//
+// // token is in right order
+// Contract.ThrowIfFalse(startToken.Equals(endToken) || startToken.Span.End <= endToken.SpanStart);
+// return ValueTuple.Create(startToken, endToken);
+// }
+//
+// public static bool IsInvalidTokenRange(this SyntaxNode root, SyntaxToken startToken, SyntaxToken endToken)
+// {
+// // given token must be token exist excluding EndOfFile token.
+// if (startToken.RawKind == 0 || endToken.RawKind == 0)
+// {
+// return true;
+// }
+//
+// if (startToken.Equals(endToken))
+// {
+// return false;
+// }
+//
+// // regular case.
+// // start token can't be end of file token and start token must be before end token if it's not the same token.
+// return root.FullSpan.End == startToken.SpanStart || startToken.FullSpan.End > endToken.FullSpan.Start;
+// }
+//
+// public static int GetTokenColumn(this SyntaxTree tree, SyntaxToken token, int tabSize)
+// {
+// Contract.ThrowIfNull(tree);
+// Contract.ThrowIfTrue(token.RawKind == 0);
+//
+// var startPosition = token.SpanStart;
+// var line = tree.GetText().Lines.GetLineFromPosition(startPosition);
+//
+// return line.GetColumnFromLineOffset(startPosition - line.Start, tabSize);
+// }
+//
+// public static string GetText(this SourceText text, SyntaxToken token1, SyntaxToken token2)
+// {
+// return (token1.RawKind == 0) ? text.ToString(TextSpan.FromBounds(0, token2.SpanStart)) : text.ToString(TextSpan.FromBounds(token1.Span.End, token2.SpanStart));
+// }
+//
+ public static string GetTextBetween(SyntaxToken token1, SyntaxToken token2)
+ {
+ var builder = new StringBuilder();
+ AppendTextBetween(token1, token2, builder);
+
+ return builder.ToString();
+ }
+
+ public static void AppendTextBetween(SyntaxToken token1, SyntaxToken token2, StringBuilder builder)
+ {
+// Contract.ThrowIfTrue(token1.RawKind == 0 && token2.RawKind == 0);
+// Contract.ThrowIfTrue(token1.Equals(token2));
+//
+ if (token1.RawKind == 0)
+ {
+ AppendLeadingTriviaText(token2, builder);
+ return;
+ }
+
+ if (token2.RawKind == 0)
+ {
+ AppendTrailingTriviaText(token1, builder);
+ return;
+ }
+
+ //var token1PartOftoken2LeadingTrivia = token1.FullSpan.Start > token2.FullSpan.Start;
+
+ if (token1.FullSpan.End == token2.FullSpan.Start)
+ {
+ AppendTextBetweenTwoAdjacentTokens(token1, token2, builder);
+ return;
+ }
+
+ AppendTrailingTriviaText(token1, builder);
+
+ for (var token = token1.GetNextToken(includeZeroWidth: true); token.FullSpan.End <= token2.FullSpan.Start; token = token.GetNextToken(includeZeroWidth: true))
+ {
+ builder.Append(token.ToFullString());
+ }
+
+ AppendPartialLeadingTriviaText(token2, builder, token1.TrailingTrivia.FullSpan.End);
+ }
+
+ private static void AppendTextBetweenTwoAdjacentTokens(SyntaxToken token1, SyntaxToken token2, StringBuilder builder)
+ {
+ AppendTrailingTriviaText(token1, builder);
+ AppendLeadingTriviaText(token2, builder);
+ }
+
+ private static void AppendLeadingTriviaText(SyntaxToken token, StringBuilder builder)
+ {
+ if (!token.HasLeadingTrivia)
+ {
+ return;
+ }
+
+ foreach (var trivia in token.LeadingTrivia)
+ {
+ builder.Append(trivia.ToFullString());
+ }
+ }
+
+ /// <summary>
+ /// If the token1 is expected to be part of the leading trivia of the token2 then the trivia
+ /// before the token1FullSpanEnd, which the fullspan end of the token1 should be ignored
+ /// </summary>
+ private static void AppendPartialLeadingTriviaText(SyntaxToken token, StringBuilder builder, int token1FullSpanEnd)
+ {
+ if (!token.HasLeadingTrivia)
+ {
+ return;
+ }
+
+ foreach (var trivia in token.LeadingTrivia)
+ {
+ if (trivia.FullSpan.End <= token1FullSpanEnd)
+ {
+ continue;
+ }
+
+ builder.Append(trivia.ToFullString());
+ }
+ }
+
+ private static void AppendTrailingTriviaText(SyntaxToken token, StringBuilder builder)
+ {
+ if (!token.HasTrailingTrivia)
+ {
+ return;
+ }
+
+ foreach (var trivia in token.TrailingTrivia)
+ {
+ builder.Append(trivia.ToFullString());
+ }
+ }
+
+// /// <summary>
+// /// this will create a span that includes its trailing trivia of its previous token and leading trivia of its next token
+// /// for example, for code such as "class A { int ...", if given tokens are "A" and "{", this will return span [] of "class[ A { ]int ..."
+// /// which included trailing trivia of "class" which is previous token of "A", and leading trivia of "int" which is next token of "{"
+// /// </summary>
+// public static TextSpan GetSpanIncludingTrailingAndLeadingTriviaOfAdjacentTokens(SyntaxToken startToken, SyntaxToken endToken)
+// {
+// // most of cases we can just ask previous and next token to create the span, but in some corner cases such as omitted token case,
+// // those navigation function doesn't work, so we have to explore the tree ourselves to create rigth span
+// var startPosition = GetStartPositionOfSpan(startToken);
+// var endPosition = GetEndPositionOfSpan(endToken);
+//
+// return TextSpan.FromBounds(startPosition, endPosition);
+// }
+//
+// private static int GetEndPositionOfSpan(SyntaxToken token)
+// {
+// var nextToken = token.GetNextToken();
+// if (nextToken.RawKind != 0)
+// {
+// return nextToken.SpanStart;
+// }
+//
+// var backwardPosition = token.FullSpan.End;
+// var parentNode = GetParentThatContainsGivenSpan(token.Parent, backwardPosition, forward: false);
+// if (parentNode == null)
+// {
+// // reached the end of tree
+// return token.FullSpan.End;
+// }
+//
+// Contract.ThrowIfFalse(backwardPosition < parentNode.FullSpan.End);
+//
+// nextToken = parentNode.FindToken(backwardPosition + 1);
+//
+// Contract.ThrowIfTrue(nextToken.RawKind == 0);
+//
+// return nextToken.SpanStart;
+// }
+//
+// public static int GetStartPositionOfSpan(SyntaxToken token)
+// {
+// var previousToken = token.GetPreviousToken();
+// if (previousToken.RawKind != 0)
+// {
+// return previousToken.Span.End;
+// }
+//
+// // first token in the tree
+// var forwardPosition = token.FullSpan.Start;
+// if (forwardPosition <= 0)
+// {
+// return 0;
+// }
+//
+// var parentNode = GetParentThatContainsGivenSpan(token.Parent, forwardPosition, forward: true);
+// if (parentNode == null)
+// {
+// return Contract.FailWithReturn<int>("This can't happen");
+// }
+//
+// Contract.ThrowIfFalse(parentNode.FullSpan.Start < forwardPosition);
+//
+// previousToken = parentNode.FindToken(forwardPosition + 1);
+//
+// Contract.ThrowIfTrue(previousToken.RawKind == 0);
+//
+// return previousToken.Span.End;
+// }
+//
+// private static SyntaxNode GetParentThatContainsGivenSpan(SyntaxNode node, int position, bool forward)
+// {
+// while (node != null)
+// {
+// var fullSpan = node.FullSpan;
+// if (forward)
+// {
+// if (fullSpan.Start < position)
+// {
+// return node;
+// }
+// }
+// else
+// {
+// if (position > fullSpan.End)
+// {
+// return node;
+// }
+// }
+//
+// node = node.Parent;
+// }
+//
+// return null;
+// }
+//
+// public static bool HasAnyWhitespaceElasticTrivia(SyntaxToken previousToken, SyntaxToken currentToken)
+// {
+// if ((!previousToken.ContainsAnnotations && !currentToken.ContainsAnnotations) ||
+// (!previousToken.HasTrailingTrivia && !currentToken.HasLeadingTrivia))
+// {
+// return false;
+// }
+//
+// return previousToken.TrailingTrivia.HasAnyWhitespaceElasticTrivia() || currentToken.LeadingTrivia.HasAnyWhitespaceElasticTrivia();
+// }
+//
+// public static bool IsNull<T>(T t) where T : class
+// {
+// return t == null;
+// }
+//
+// public static bool IsNotNull<T>(T t) where T : class
+// {
+// return !IsNull(t);
+// }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/FormattingHelpers.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/FormattingHelpers.cs
new file mode 100644
index 0000000000..210aec33e9
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/FormattingHelpers.cs
@@ -0,0 +1,552 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class FormattingHelpers
+ {
+ // TODO: Need to determine correct way to handle newlines
+ public const string NewLine = "\r\n";
+
+ public static string GetIndent(this SyntaxToken token)
+ {
+ var precedingTrivia = token.GetAllPrecedingTriviaToPreviousToken();
+
+ // indent is the spaces/tabs between last new line (if there is one) and end of trivia
+ var indent = precedingTrivia.AsString();
+ int lastNewLinePos = indent.LastIndexOf(NewLine);
+ if (lastNewLinePos != -1)
+ {
+ int start = lastNewLinePos + NewLine.Length;
+ indent = indent.Substring(start, indent.Length - start);
+ }
+
+ return indent;
+ }
+
+ public static string ContentBeforeLastNewLine(this IEnumerable<SyntaxTrivia> trivia)
+ {
+ var leading = trivia.AsString();
+ int lastNewLinePos = leading.LastIndexOf(NewLine);
+ if (lastNewLinePos == -1)
+ {
+ return string.Empty;
+ }
+ else
+ {
+ return leading.Substring(0, lastNewLinePos);
+ }
+ }
+
+ public static ValueTuple<SyntaxToken, SyntaxToken> GetBracePair(this SyntaxNode node)
+ {
+ return node.GetBraces();
+ }
+
+ public static bool IsValidBracePair(this ValueTuple<SyntaxToken, SyntaxToken> bracePair)
+ {
+ if (bracePair.Item1.IsKind(SyntaxKind.None) ||
+ bracePair.Item1.IsMissing ||
+ bracePair.Item2.IsKind(SyntaxKind.None))
+ {
+ return false;
+ }
+
+ // don't check whether token is actually braces as long as it is not none.
+ return true;
+ }
+
+ public static bool IsOpenParenInParameterList(this SyntaxToken token)
+ {
+ return token.Kind() == SyntaxKind.OpenParenToken && token.Parent.Kind() == SyntaxKind.ParameterList;
+ }
+
+ public static bool IsCloseParenInParameterList(this SyntaxToken token)
+ {
+ return token.Kind() == SyntaxKind.CloseParenToken && token.Parent.Kind() == SyntaxKind.ParameterList;
+ }
+
+ public static bool IsOpenParenInArgumentList(this SyntaxToken token)
+ {
+ return token.Kind() == SyntaxKind.OpenParenToken && token.Parent.Kind() == SyntaxKind.ArgumentList;
+ }
+
+ public static bool IsCloseParenInArgumentList(this SyntaxToken token)
+ {
+ return token.Kind() == SyntaxKind.CloseParenToken && token.Parent.Kind() == SyntaxKind.ArgumentList;
+ }
+
+ public static bool IsColonInTypeBaseList(this SyntaxToken token)
+ {
+ return token.Kind() == SyntaxKind.ColonToken && token.Parent.Kind() == SyntaxKind.BaseList;
+ }
+
+ public static bool IsCommaInArgumentOrParameterList(this SyntaxToken token)
+ {
+ return token.Kind() == SyntaxKind.CommaToken && (token.Parent.IsAnyArgumentList() || token.Parent.Kind() == SyntaxKind.ParameterList);
+ }
+
+ public static bool IsLambdaBodyBlock(this SyntaxNode node)
+ {
+ if (node.Kind() != SyntaxKind.Block)
+ {
+ return false;
+ }
+
+ return node.Parent.Kind() == SyntaxKind.SimpleLambdaExpression ||
+ node.Parent.Kind() == SyntaxKind.ParenthesizedLambdaExpression;
+ }
+
+ public static bool IsAnonymousMethodBlock(this SyntaxNode node)
+ {
+ if (node.Kind() != SyntaxKind.Block)
+ {
+ return false;
+ }
+
+ return node.Parent.Kind() == SyntaxKind.AnonymousMethodExpression;
+ }
+
+ public static bool IsSemicolonInForStatement(this SyntaxToken token)
+ {
+ var forStatement = token.Parent as ForStatementSyntax;
+ return
+ token.Kind() == SyntaxKind.SemicolonToken &&
+ forStatement != null &&
+ (forStatement.FirstSemicolonToken == token || forStatement.SecondSemicolonToken == token);
+ }
+
+ public static bool IsSemicolonOfEmbeddedStatement(this SyntaxToken token)
+ {
+ if (token.Kind() != SyntaxKind.SemicolonToken)
+ {
+ return false;
+ }
+
+ var statement = token.Parent as StatementSyntax;
+ if (statement == null ||
+ statement.GetLastToken() != token)
+ {
+ return false;
+ }
+
+ return IsEmbeddedStatement(statement);
+ }
+
+ public static bool IsCloseBraceOfExpression(this SyntaxToken token)
+ {
+ if (token.Kind() != SyntaxKind.CloseBraceToken)
+ {
+ return false;
+ }
+
+ return token.Parent is ExpressionSyntax;
+ }
+
+ public static bool IsCloseBraceOfEmbeddedBlock(this SyntaxToken token)
+ {
+ if (token.Kind() != SyntaxKind.CloseBraceToken)
+ {
+ return false;
+ }
+
+ var block = token.Parent as BlockSyntax;
+ if (block == null ||
+ block.CloseBraceToken != token)
+ {
+ return false;
+ }
+
+ return IsEmbeddedStatement(block);
+ }
+
+ public static bool IsEmbeddedStatement(this SyntaxNode node)
+ {
+ SyntaxNode statementOrElse = node as StatementSyntax;
+ if (statementOrElse == null)
+ {
+ statementOrElse = node as ElseClauseSyntax;
+ }
+
+ return statementOrElse != null
+ && statementOrElse.Parent != null
+ && statementOrElse.Parent.IsEmbeddedStatementOwner();
+ }
+
+ public static bool IsCommaInEnumDeclaration(this SyntaxToken token)
+ {
+ return token.Kind() == SyntaxKind.CommaToken &&
+ token.Parent.IsKind(SyntaxKind.EnumDeclaration);
+ }
+
+ public static bool IsCommaInAnyArgumentsList(this SyntaxToken token)
+ {
+ return token.Kind() == SyntaxKind.CommaToken &&
+ token.Parent.IsAnyArgumentList();
+ }
+
+ public static bool IsParenInParenthesizedExpression(this SyntaxToken token)
+ {
+ var parenthesizedExpression = token.Parent as ParenthesizedExpressionSyntax;
+ if (parenthesizedExpression == null)
+ {
+ return false;
+ }
+
+ return parenthesizedExpression.OpenParenToken.Equals(token) || parenthesizedExpression.CloseParenToken.Equals(token);
+ }
+
+ public static bool IsParenInArgumentList(this SyntaxToken token)
+ {
+ var parent = token.Parent;
+ switch (parent.Kind())
+ {
+ case SyntaxKind.SizeOfExpression:
+ var sizeOfExpression = (SizeOfExpressionSyntax)parent;
+ return sizeOfExpression.OpenParenToken == token || sizeOfExpression.CloseParenToken == token;
+
+ case SyntaxKind.TypeOfExpression:
+ var typeOfExpression = (TypeOfExpressionSyntax)parent;
+ return typeOfExpression.OpenParenToken == token || typeOfExpression.CloseParenToken == token;
+
+ case SyntaxKind.CheckedExpression:
+ case SyntaxKind.UncheckedExpression:
+ var checkedOfExpression = (CheckedExpressionSyntax)parent;
+ return checkedOfExpression.OpenParenToken == token || checkedOfExpression.CloseParenToken == token;
+
+ case SyntaxKind.DefaultExpression:
+ var defaultExpression = (DefaultExpressionSyntax)parent;
+ return defaultExpression.OpenParenToken == token || defaultExpression.CloseParenToken == token;
+
+ case SyntaxKind.MakeRefExpression:
+ var makeRefExpression = (MakeRefExpressionSyntax)parent;
+ return makeRefExpression.OpenParenToken == token || makeRefExpression.CloseParenToken == token;
+
+ case SyntaxKind.RefTypeExpression:
+ var refTypeOfExpression = (RefTypeExpressionSyntax)parent;
+ return refTypeOfExpression.OpenParenToken == token || refTypeOfExpression.CloseParenToken == token;
+
+ case SyntaxKind.RefValueExpression:
+ var refValueExpression = (RefValueExpressionSyntax)parent;
+ return refValueExpression.OpenParenToken == token || refValueExpression.CloseParenToken == token;
+
+ case SyntaxKind.ArgumentList:
+ var argumentList = (ArgumentListSyntax)parent;
+ return argumentList.OpenParenToken == token || argumentList.CloseParenToken == token;
+
+ case SyntaxKind.AttributeArgumentList:
+ var attributeArgumentList = (AttributeArgumentListSyntax)parent;
+ return attributeArgumentList.OpenParenToken == token || attributeArgumentList.CloseParenToken == token;
+ }
+
+ return false;
+ }
+
+ public static bool IsCloseParenInStatement(this SyntaxToken token)
+ {
+ var statement = token.Parent as StatementSyntax;
+ if (statement == null)
+ {
+ return false;
+ }
+
+ var ifStatement = statement as IfStatementSyntax;
+ if (ifStatement != null)
+ {
+ return ifStatement.CloseParenToken.Equals(token);
+ }
+
+ var switchStatement = statement as SwitchStatementSyntax;
+ if (switchStatement != null)
+ {
+ return switchStatement.CloseParenToken.Equals(token);
+ }
+
+ var whileStatement = statement as WhileStatementSyntax;
+ if (whileStatement != null)
+ {
+ return whileStatement.CloseParenToken.Equals(token);
+ }
+
+ var doStatement = statement as DoStatementSyntax;
+ if (doStatement != null)
+ {
+ return doStatement.CloseParenToken.Equals(token);
+ }
+
+ var forStatement = statement as ForStatementSyntax;
+ if (forStatement != null)
+ {
+ return forStatement.CloseParenToken.Equals(token);
+ }
+
+ var foreachStatement = statement as ForEachStatementSyntax;
+ if (foreachStatement != null)
+ {
+ return foreachStatement.CloseParenToken.Equals(token);
+ }
+
+ var lockStatement = statement as LockStatementSyntax;
+ if (lockStatement != null)
+ {
+ return lockStatement.CloseParenToken.Equals(token);
+ }
+
+ var usingStatement = statement as UsingStatementSyntax;
+ if (usingStatement != null)
+ {
+ return usingStatement.CloseParenToken.Equals(token);
+ }
+
+ return false;
+ }
+
+ public static bool IsDotInMemberAccessOrQualifiedName(this SyntaxToken token)
+ {
+ return token.IsDotInMemberAccess() || (token.Kind() == SyntaxKind.DotToken && token.Parent.Kind() == SyntaxKind.QualifiedName);
+ }
+
+ public static bool IsDotInMemberAccess(this SyntaxToken token)
+ {
+ var memberAccess = token.Parent as MemberAccessExpressionSyntax;
+ if (memberAccess == null)
+ {
+ return false;
+ }
+
+ return token.Kind() == SyntaxKind.DotToken
+ && memberAccess.OperatorToken.Equals(token);
+ }
+
+ public static bool IsGenericGreaterThanToken(this SyntaxToken token)
+ {
+ if (token.Kind() == SyntaxKind.GreaterThanToken)
+ {
+ return token.Parent.IsKind(SyntaxKind.TypeParameterList, SyntaxKind.TypeArgumentList);
+ }
+
+ return false;
+ }
+
+ public static bool IsCommaInInitializerExpression(this SyntaxToken token)
+ {
+ return token.Kind() == SyntaxKind.CommaToken &&
+ ((token.Parent is InitializerExpressionSyntax) ||
+ (token.Parent is AnonymousObjectCreationExpressionSyntax));
+ }
+
+ public static bool IsIdentiferInLabeledStatement(this SyntaxToken token)
+ {
+ var labeledStatement = token.Parent as LabeledStatementSyntax;
+ return token.Kind() == SyntaxKind.IdentifierToken &&
+ labeledStatement != null &&
+ labeledStatement.Identifier == token;
+ }
+
+ public static bool IsColonInSwitchLabel(this SyntaxToken token)
+ {
+ return FormattingRangeHelper.IsColonInSwitchLabel(token);
+ }
+
+ public static bool IsColonInLabeledStatement(this SyntaxToken token)
+ {
+ var labeledStatement = token.Parent as LabeledStatementSyntax;
+ return token.Kind() == SyntaxKind.ColonToken &&
+ labeledStatement != null &&
+ labeledStatement.ColonToken == token;
+ }
+
+ public static bool IsEmbeddedStatementOwnerWithCloseParen(this SyntaxNode node)
+ {
+ return node is IfStatementSyntax ||
+ node is WhileStatementSyntax ||
+ node is ForStatementSyntax ||
+ node is ForEachStatementSyntax ||
+ node is UsingStatementSyntax;
+ }
+
+ public static bool IsNestedQueryExpression(this SyntaxToken token)
+ {
+ var fromClause = token.Parent as FromClauseSyntax;
+ return token.Kind() == SyntaxKind.InKeyword &&
+ fromClause != null &&
+ fromClause.Expression is QueryExpressionSyntax;
+ }
+
+ public static bool IsFirstFromKeywordInExpression(this SyntaxToken token)
+ {
+ var queryExpression = token.Parent.Parent as QueryExpressionSyntax;
+ return token.Kind() == SyntaxKind.FromKeyword &&
+ queryExpression != null &&
+ queryExpression.GetFirstToken().Equals(token);
+ }
+
+ public static bool IsInitializerForObjectOrAnonymousObjectCreationExpression(this SyntaxNode node)
+ {
+ var initializer = node as InitializerExpressionSyntax;
+ AnonymousObjectMemberDeclaratorSyntax anonymousObjectInitializer = null;
+ if (initializer == null)
+ {
+ anonymousObjectInitializer = node as AnonymousObjectMemberDeclaratorSyntax;
+ if (anonymousObjectInitializer == null)
+ {
+ return false;
+ }
+ }
+
+ var parent = initializer != null ? initializer.Parent : anonymousObjectInitializer.Parent;
+ if (parent is AnonymousObjectCreationExpressionSyntax)
+ {
+ return true;
+ }
+
+ if (parent is ObjectCreationExpressionSyntax)
+ {
+ if (initializer.Expressions.Count <= 0)
+ {
+ return true;
+ }
+
+ var expression = initializer.Expressions[0];
+ if (expression.Kind() == SyntaxKind.SimpleAssignmentExpression)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsInitializerForArrayOrCollectionCreationExpression(this SyntaxNode node)
+ {
+ var initializer = node as InitializerExpressionSyntax;
+ AnonymousObjectMemberDeclaratorSyntax anonymousObjectInitializer = null;
+ if (initializer == null)
+ {
+ anonymousObjectInitializer = node as AnonymousObjectMemberDeclaratorSyntax;
+ if (anonymousObjectInitializer == null)
+ {
+ return false;
+ }
+ }
+
+ var parent = initializer != null ? initializer.Parent : anonymousObjectInitializer.Parent;
+ if (parent is ArrayCreationExpressionSyntax ||
+ parent is ImplicitArrayCreationExpressionSyntax ||
+ parent is EqualsValueClauseSyntax ||
+ parent.Kind() == SyntaxKind.SimpleAssignmentExpression)
+ {
+ return true;
+ }
+
+ if (parent is ObjectCreationExpressionSyntax)
+ {
+ return !IsInitializerForObjectOrAnonymousObjectCreationExpression(initializer);
+ }
+
+ return false;
+ }
+
+ public static bool ParenOrBracketContainsNothing(this SyntaxToken token1, SyntaxToken token2)
+ {
+ return (token1.Kind() == SyntaxKind.OpenParenToken && token2.Kind() == SyntaxKind.CloseParenToken) ||
+ (token1.Kind() == SyntaxKind.OpenBracketToken && token2.Kind() == SyntaxKind.CloseBracketToken);
+ }
+
+ public static bool IsLastTokenInLabelStatement(this SyntaxToken token)
+ {
+ if (token.Kind() != SyntaxKind.SemicolonToken && token.Kind() != SyntaxKind.CloseBraceToken)
+ {
+ return false;
+ }
+
+ if (token.Parent == null)
+ {
+ return false;
+ }
+
+ return token.Parent.Parent is LabeledStatementSyntax;
+ }
+
+ public static ValueTuple<SyntaxToken, SyntaxToken> GetFirstAndLastMemberDeclarationTokensAfterAttributes(this MemberDeclarationSyntax node)
+ {
+ // Contract.ThrowIfNull(node);
+
+ // there are no attributes associated with the node. return back first and last token of the node.
+ var attributes = node.GetAttributes();
+ if (attributes.Count == 0)
+ {
+ return ValueTuple.Create(node.GetFirstToken(includeZeroWidth: true), node.GetLastToken(includeZeroWidth: true));
+ }
+
+ var lastToken = node.GetLastToken(includeZeroWidth: true);
+ var lastAttributeToken = attributes.Last().GetLastToken(includeZeroWidth: true);
+ if (lastAttributeToken.Equals(lastToken))
+ {
+ return ValueTuple.Create(default(SyntaxToken), default(SyntaxToken));
+ }
+
+ var firstTokenAfterAttribute = lastAttributeToken.GetNextToken(includeZeroWidth: true);
+
+ // there are attributes, get first token after the tokens belong to attributes
+ return ValueTuple.Create(firstTokenAfterAttribute, lastToken);
+ }
+
+ public static bool IsBlockBody(this SyntaxNode node)
+ {
+ // Contract.ThrowIfNull(node);
+
+ var blockNode = node as BlockSyntax;
+ if (blockNode == null)
+ {
+ return false;
+ }
+
+ switch (blockNode.Parent.Kind())
+ {
+ case SyntaxKind.AnonymousMethodExpression:
+ case SyntaxKind.CheckedStatement:
+ case SyntaxKind.UncheckedStatement:
+ case SyntaxKind.UnsafeStatement:
+ case SyntaxKind.TryStatement:
+ case SyntaxKind.CatchClause:
+ case SyntaxKind.FinallyClause:
+ case SyntaxKind.MethodDeclaration:
+ case SyntaxKind.OperatorDeclaration:
+ case SyntaxKind.ConversionOperatorDeclaration:
+ case SyntaxKind.ConstructorDeclaration:
+ case SyntaxKind.DestructorDeclaration:
+ case SyntaxKind.AddAccessorDeclaration:
+ case SyntaxKind.GetAccessorDeclaration:
+ case SyntaxKind.SetAccessorDeclaration:
+ case SyntaxKind.RemoveAccessorDeclaration:
+ case SyntaxKind.UnknownAccessorDeclaration:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ public static bool IsPlusOrMinusExpression(this SyntaxToken token)
+ {
+ if (token.Kind() != SyntaxKind.PlusToken && token.Kind() != SyntaxKind.MinusToken)
+ {
+ return false;
+ }
+
+ return token.Parent is PrefixUnaryExpressionSyntax;
+ }
+
+ public static bool IsInterpolation(this SyntaxToken currentToken)
+ {
+ return currentToken.Parent.IsKind(SyntaxKind.Interpolation);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/FormattingOptionsFactory.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/FormattingOptionsFactory.cs
new file mode 100644
index 0000000000..aa33936784
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/FormattingOptionsFactory.cs
@@ -0,0 +1,170 @@
+//
+// FormattingOptionsFactory.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis.CSharp.Formatting;
+using Microsoft.CodeAnalysis.Formatting;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ /// <summary>
+ /// The formatting options factory creates pre defined formatting option styles.
+ /// </summary>
+ static class FormattingOptionsFactory
+ {
+ readonly static Workspace defaultWs = new TestWorkspace ();
+
+ internal class TestWorkspace : Workspace
+ {
+ readonly static HostServices services = Microsoft.CodeAnalysis.Host.Mef.MefHostServices.DefaultHost;
+ public TestWorkspace(string workspaceKind = "Test") : base(services , workspaceKind)
+ {
+ }
+
+ }
+// /// <summary>
+// /// Creates empty CSharpFormatting options.
+// /// </summary>
+// public static CSharpFormattingOptions CreateEmpty()
+// {
+// return new CSharpFormattingOptions();
+// }
+
+ /// <summary>
+ /// Creates mono indent style CSharpFormatting options.
+ /// </summary>
+ public static OptionSet CreateMono()
+ {
+ var options = defaultWs.Options;
+ options = options.WithChangedOption(CSharpFormattingOptions.SpaceAfterMethodCallName, true);
+ options = options.WithChangedOption(CSharpFormattingOptions.SpaceAfterSemicolonsInForStatement, true);
+
+ options = options.WithChangedOption(CSharpFormattingOptions.NewLineForCatch, false);
+ options = options.WithChangedOption(CSharpFormattingOptions.NewLineForFinally, false);
+ options = options.WithChangedOption(CSharpFormattingOptions.NewLinesForBracesInAnonymousMethods, false);
+ options = options.WithChangedOption(CSharpFormattingOptions.NewLinesForBracesInControlBlocks, false);
+ options = options.WithChangedOption(CSharpFormattingOptions.NewLinesForBracesInLambdaExpressionBody, false);
+
+ options = options.WithChangedOption(CSharpFormattingOptions.IndentSwitchSection, false);
+
+ options = options.WithChangedOption(FormattingOptions.UseTabs, LanguageNames.CSharp, true);
+ options = options.WithChangedOption(FormattingOptions.TabSize, LanguageNames.CSharp, 4);
+ options = options.WithChangedOption(FormattingOptions.NewLine, LanguageNames.CSharp, "\n");
+
+ return options;
+ }
+
+ /// <summary>
+ /// Creates sharp develop indent style CSharpFormatting options.
+ /// </summary>
+ public static OptionSet CreateSharpDevelop()
+ {
+ var baseOptions = CreateKRStyle();
+ return baseOptions;
+ }
+
+ /// <summary>
+ /// The K&amp;R style, so named because it was used in Kernighan and Ritchie's book The C Programming Language,
+ /// is commonly used in C. It is less common for C++, C#, and others.
+ /// </summary>
+ public static OptionSet CreateKRStyle()
+ {
+ var options = defaultWs.Options;
+ options = options.WithChangedOption(CSharpFormattingOptions.NewLineForCatch, false);
+ options = options.WithChangedOption(CSharpFormattingOptions.NewLineForFinally, false);
+ options = options.WithChangedOption(CSharpFormattingOptions.NewLinesForBracesInAnonymousMethods, false);
+ options = options.WithChangedOption(CSharpFormattingOptions.NewLinesForBracesInControlBlocks, false);
+ options = options.WithChangedOption(CSharpFormattingOptions.NewLinesForBracesInLambdaExpressionBody, false);
+
+ options = options.WithChangedOption(FormattingOptions.UseTabs, LanguageNames.CSharp, true);
+ options = options.WithChangedOption(FormattingOptions.TabSize, LanguageNames.CSharp, 4);
+ options = options.WithChangedOption(FormattingOptions.NewLine, LanguageNames.CSharp, "\n");
+
+ return options;
+ }
+
+ /// <summary>
+ /// Creates allman indent style CSharpFormatting options used in Visual Studio.
+ /// </summary>
+ public static OptionSet CreateAllman()
+ {
+ var options = defaultWs.Options;
+ options = options.WithChangedOption(FormattingOptions.UseTabs, LanguageNames.CSharp, true);
+ options = options.WithChangedOption(FormattingOptions.TabSize, LanguageNames.CSharp, 4);
+ options = options.WithChangedOption(FormattingOptions.NewLine, LanguageNames.CSharp, "\n");
+ return options;
+ }
+
+// /// <summary>
+// /// The Whitesmiths style, also called Wishart style to a lesser extent, is less common today than the previous three. It was originally used in the documentation for the first commercial C compiler, the Whitesmiths Compiler.
+// /// </summary>
+// public static CSharpFormattingOptions CreateWhitesmiths()
+// {
+// var baseOptions = CreateKRStyle();
+//
+// baseOptions.NamespaceBraceStyle = BraceStyle.NextLineShifted;
+// baseOptions.ClassBraceStyle = BraceStyle.NextLineShifted;
+// baseOptions.InterfaceBraceStyle = BraceStyle.NextLineShifted;
+// baseOptions.StructBraceStyle = BraceStyle.NextLineShifted;
+// baseOptions.EnumBraceStyle = BraceStyle.NextLineShifted;
+// baseOptions.MethodBraceStyle = BraceStyle.NextLineShifted;
+// baseOptions.ConstructorBraceStyle = BraceStyle.NextLineShifted;
+// baseOptions.DestructorBraceStyle = BraceStyle.NextLineShifted;
+// baseOptions.AnonymousMethodBraceStyle = BraceStyle.NextLineShifted;
+// baseOptions.PropertyBraceStyle = BraceStyle.NextLineShifted;
+// baseOptions.PropertyGetBraceStyle = BraceStyle.NextLineShifted;
+// baseOptions.PropertySetBraceStyle = BraceStyle.NextLineShifted;
+//
+// baseOptions.EventBraceStyle = BraceStyle.NextLineShifted;
+// baseOptions.EventAddBraceStyle = BraceStyle.NextLineShifted;
+// baseOptions.EventRemoveBraceStyle = BraceStyle.NextLineShifted;
+// baseOptions.StatementBraceStyle = BraceStyle.NextLineShifted;
+// baseOptions.IndentBlocksInsideExpressions = true;
+// return baseOptions;
+// }
+//
+// /// <summary>
+// /// Like the Allman and Whitesmiths styles, GNU style puts braces on a line by themselves, indented by 2 spaces,
+// /// except when opening a function definition, where they are not indented.
+// /// In either case, the contained code is indented by 2 spaces from the braces.
+// /// Popularised by Richard Stallman, the layout may be influenced by his background of writing Lisp code.
+// /// In Lisp the equivalent to a block (a progn)
+// /// is a first class data entity and giving it its own indent level helps to emphasize that,
+// /// whereas in C a block is just syntax.
+// /// Although not directly related to indentation, GNU coding style also includes a space before the bracketed
+// /// list of arguments to a function.
+// /// </summary>
+// public static CSharpFormattingOptions CreateGNU()
+// {
+// var baseOptions = CreateAllman();
+// baseOptions.StatementBraceStyle = BraceStyle.NextLineShifted2;
+// return baseOptions;
+// }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/FormattingRangeHelper.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/FormattingRangeHelper.cs
new file mode 100644
index 0000000000..492868b050
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/FormattingRangeHelper.cs
@@ -0,0 +1,434 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Formatting;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Shared.Utilities;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ /// <summary>
+ /// this help finding a range of tokens to format based on given ending token
+ /// </summary>
+ static class FormattingRangeHelper
+ {
+ public static ValueTuple<SyntaxToken, SyntaxToken>? FindAppropriateRange(SyntaxToken endToken, bool useDefaultRange = true)
+ {
+ // Contract.ThrowIfTrue(endToken.Kind() == SyntaxKind.None);
+
+ return FixupOpenBrace(FindAppropriateRangeWorker(endToken, useDefaultRange));
+ }
+
+ private static ValueTuple<SyntaxToken, SyntaxToken>? FixupOpenBrace(ValueTuple<SyntaxToken, SyntaxToken>? tokenRange)
+ {
+ if (!tokenRange.HasValue)
+ {
+ return tokenRange;
+ }
+
+ // with a auto brace completion which will do auto formatting when a user types "{", it is quite common that we will automatically put a space
+ // between "{" and "}". but user might blindly type without knowing that " " has automatically inserted for him. and ends up have two spaces.
+ // for those cases, whenever we see previous token of the range is "{", we expand the range to include preceeding "{"
+ var currentToken = tokenRange.Value.Item1;
+ var previousToken = currentToken.GetPreviousToken();
+
+ while (currentToken.Kind() != SyntaxKind.CloseBraceToken && previousToken.Kind() == SyntaxKind.OpenBraceToken)
+ {
+ var pair = previousToken.Parent.GetBracePair();
+ if (pair.Item2.Kind() == SyntaxKind.None || !AreTwoTokensOnSameLine(previousToken, pair.Item2))
+ {
+ return ValueTuple.Create(currentToken, tokenRange.Value.Item2);
+ }
+
+ currentToken = previousToken;
+ previousToken = currentToken.GetPreviousToken();
+ }
+
+ return ValueTuple.Create(currentToken, tokenRange.Value.Item2);
+ }
+
+ private static ValueTuple<SyntaxToken, SyntaxToken>? FindAppropriateRangeWorker(SyntaxToken endToken, bool useDefaultRange)
+ {
+ // special token that we know how to find proper starting token
+ switch (endToken.Kind())
+ {
+ case SyntaxKind.CloseBraceToken:
+ {
+ return FindAppropriateRangeForCloseBrace(endToken);
+ }
+
+ case SyntaxKind.SemicolonToken:
+ {
+ return FindAppropriateRangeForSemicolon(endToken);
+ }
+
+ case SyntaxKind.ColonToken:
+ {
+ return FindAppropriateRangeForColon(endToken);
+ }
+
+ default:
+ {
+ // default case
+ if (!useDefaultRange)
+ {
+ return null;
+ }
+
+ // if given token is skipped token, don't bother to find appropriate
+ // starting point
+ if (endToken.Kind() == SyntaxKind.SkippedTokensTrivia)
+ {
+ return null;
+ }
+
+ var parent = endToken.Parent;
+ if (parent == null)
+ {
+ // if there is no parent setup yet, nothing we can do here.
+ return null;
+ }
+
+ // if we are called due to things in trivia or literals, don't bother
+ // finding a starting token
+ if (parent.Kind() == SyntaxKind.StringLiteralExpression ||
+ parent.Kind() == SyntaxKind.CharacterLiteralExpression)
+ {
+ return null;
+ }
+
+ // format whole node that containing the end token + its previous one
+ // to do indentation
+ return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken()), parent.GetLastToken());
+ }
+ }
+ }
+
+ private static ValueTuple<SyntaxToken, SyntaxToken>? FindAppropriateRangeForSemicolon(SyntaxToken endToken)
+ {
+ var parent = endToken.Parent;
+ if (parent == null || parent.Kind() == SyntaxKind.SkippedTokensTrivia)
+ {
+ return null;
+ }
+
+ if ((parent is UsingDirectiveSyntax) ||
+ (parent is DelegateDeclarationSyntax) ||
+ (parent is FieldDeclarationSyntax) ||
+ (parent is EventFieldDeclarationSyntax) ||
+ (parent is MethodDeclarationSyntax))
+ {
+ return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken(), canTokenBeFirstInABlock: true), parent.GetLastToken());
+ }
+
+ if (parent is AccessorDeclarationSyntax)
+ {
+ // if both accessors are on the same line, format the accessor list
+ // { get; set; }
+ var propertyDeclaration = GetEnclosingMember(endToken) as PropertyDeclarationSyntax;
+ if (propertyDeclaration != null &&
+ AreTwoTokensOnSameLine(propertyDeclaration.AccessorList.OpenBraceToken, propertyDeclaration.AccessorList.CloseBraceToken))
+ {
+ return ValueTuple.Create(propertyDeclaration.AccessorList.OpenBraceToken, propertyDeclaration.AccessorList.CloseBraceToken);
+ }
+
+ // otherwise, just format the accessor
+ return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken(), canTokenBeFirstInABlock: true), parent.GetLastToken());
+ }
+
+ if (parent is StatementSyntax && !endToken.IsSemicolonInForStatement())
+ {
+ var container = GetTopContainingNode(parent);
+ if (container == null)
+ {
+ return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken()), parent.GetLastToken());
+ }
+
+ if (IsSpecialContainingNode(container))
+ {
+ return ValueTuple.Create(GetAppropriatePreviousToken(container.GetFirstToken()), container.GetLastToken());
+ }
+
+ return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken(), canTokenBeFirstInABlock: true), parent.GetLastToken());
+ }
+
+ // don't do anything
+ return null;
+ }
+
+ private static ValueTuple<SyntaxToken, SyntaxToken>? FindAppropriateRangeForCloseBrace(SyntaxToken endToken)
+ {
+ // don't do anything if there is no proper parent
+ var parent = endToken.Parent;
+ if (parent == null || parent.Kind() == SyntaxKind.SkippedTokensTrivia)
+ {
+ return null;
+ }
+
+ // cases such as namespace, type, enum, method almost any top level elements
+ if (parent is MemberDeclarationSyntax ||
+ parent is SwitchStatementSyntax)
+ {
+ return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken()), parent.GetLastToken());
+ }
+
+ // property decl body or initializer
+ if (parent is AccessorListSyntax)
+ {
+ // include property decl
+ var containerOfList = parent.Parent;
+ if (containerOfList == null)
+ {
+ return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken()), parent.GetLastToken());
+ }
+
+ return ValueTuple.Create(containerOfList.GetFirstToken(), containerOfList.GetLastToken());
+ }
+
+ if (parent is AnonymousObjectCreationExpressionSyntax)
+ {
+ return ValueTuple.Create(parent.GetFirstToken(), parent.GetLastToken());
+ }
+
+ if (parent is InitializerExpressionSyntax)
+ {
+ var parentOfParent = parent.Parent;
+ if (parentOfParent == null)
+ {
+ return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken()), parent.GetLastToken());
+ }
+
+ // double initializer case such as
+ // { { }
+ var doubleInitializer = parentOfParent as InitializerExpressionSyntax;
+ if (doubleInitializer != null)
+ {
+ // if parent block has a missing brace, and current block is on same line, then
+ // don't try to indent inner block.
+ var firstTokenOfInnerBlock = parent.GetFirstToken();
+ var lastTokenOfInnerBlock = parent.GetLastToken();
+
+ var twoTokensOnSameLine = AreTwoTokensOnSameLine(firstTokenOfInnerBlock, lastTokenOfInnerBlock);
+ if (twoTokensOnSameLine)
+ {
+ return ValueTuple.Create(firstTokenOfInnerBlock, lastTokenOfInnerBlock);
+ }
+ }
+
+ // include owner of the initializer node such as creation node
+ return ValueTuple.Create(parentOfParent.GetFirstToken(), parentOfParent.GetLastToken());
+ }
+
+ if (parent is BlockSyntax)
+ {
+ var containerOfBlock = GetTopContainingNode(parent);
+ if (containerOfBlock == null)
+ {
+ return ValueTuple.Create(GetAppropriatePreviousToken(parent.GetFirstToken()), parent.GetLastToken());
+ }
+
+ // things like method, constructor, etc and special cases
+ if (containerOfBlock is MemberDeclarationSyntax ||
+ IsSpecialContainingNode(containerOfBlock))
+ {
+ return ValueTuple.Create(GetAppropriatePreviousToken(containerOfBlock.GetFirstToken()), containerOfBlock.GetLastToken());
+ }
+
+ // double block case on single line case
+ // { { }
+ if (containerOfBlock is BlockSyntax)
+ {
+ // if parent block has a missing brace, and current block is on same line, then
+ // don't try to indent inner block.
+ var firstTokenOfInnerBlock = parent.GetFirstToken();
+ var lastTokenOfInnerBlock = parent.GetLastToken();
+
+ var twoTokensOnSameLine = AreTwoTokensOnSameLine(firstTokenOfInnerBlock, lastTokenOfInnerBlock);
+ if (twoTokensOnSameLine)
+ {
+ return ValueTuple.Create(firstTokenOfInnerBlock, lastTokenOfInnerBlock);
+ }
+ }
+
+ // okay, for block, indent regardless whether it is first one on the line
+ return ValueTuple.Create(GetPreviousTokenIfNotFirstTokenInTree(parent.GetFirstToken()), parent.GetLastToken());
+ }
+
+ // don't do anything
+ return null;
+ }
+
+ private static ValueTuple<SyntaxToken, SyntaxToken>? FindAppropriateRangeForColon(SyntaxToken endToken)
+ {
+ // don't do anything if there is no proper parent
+ var parent = endToken.Parent;
+ if (parent == null || parent.Kind() == SyntaxKind.SkippedTokensTrivia)
+ {
+ return null;
+ }
+
+ // cases such as namespace, type, enum, method almost any top level elements
+ if (IsColonInSwitchLabel(endToken))
+ {
+ return ValueTuple.Create(GetPreviousTokenIfNotFirstTokenInTree(parent.GetFirstToken()), parent.GetLastToken());
+ }
+
+ return null;
+ }
+
+ private static SyntaxToken GetPreviousTokenIfNotFirstTokenInTree(SyntaxToken token)
+ {
+ var previousToken = token.GetPreviousToken();
+ return previousToken.Kind() == SyntaxKind.None ? token : previousToken;
+ }
+
+ private static bool AreTwoTokensOnSameLine(SyntaxToken token1, SyntaxToken token2)
+ {
+ var tree = token1.SyntaxTree;
+ var text = default(SourceText);
+ if (tree != null && tree.TryGetText(out text))
+ {
+ var line1 = text.Lines.IndexOf(token1.Span.End);
+ var line2 = text.Lines.IndexOf(token2.SpanStart);
+
+ return line1 == line2;
+ }
+
+ return CommonFormattingHelpers.GetTextBetween(token1, token2).ContainsLineBreak();
+ }
+
+ private static SyntaxToken GetAppropriatePreviousToken(SyntaxToken startToken, bool canTokenBeFirstInABlock = false)
+ {
+ var previousToken = startToken.GetPreviousToken();
+ if (previousToken.Kind() == SyntaxKind.None)
+ {
+ // no previous token, return as it is
+ return startToken;
+ }
+
+ if (AreTwoTokensOnSameLine(previousToken, startToken))
+ {
+ // The previous token can be '{' of a block and type declaration
+ // { int s = 0;
+ if (canTokenBeFirstInABlock)
+ {
+ if (IsOpenBraceTokenOfABlockOrTypeOrNamespace(previousToken))
+ {
+ return previousToken;
+ }
+ }
+
+ // there is another token on same line.
+ return startToken;
+ }
+
+ // start token is the first token on line
+
+ // now check a special case where previous token belongs to a label.
+ if (previousToken.IsLastTokenInLabelStatement())
+ {
+ var labelNode = previousToken.Parent.Parent;
+ return GetAppropriatePreviousToken(labelNode.GetFirstToken());
+ }
+
+ return previousToken;
+ }
+
+ private static bool IsOpenBraceTokenOfABlockOrTypeOrNamespace(SyntaxToken previousToken)
+ {
+ return previousToken.IsKind(SyntaxKind.OpenBraceToken) &&
+ (previousToken.Parent.IsKind(SyntaxKind.Block) ||
+ previousToken.Parent is TypeDeclarationSyntax ||
+ previousToken.Parent is NamespaceDeclarationSyntax);
+ }
+
+ private static bool IsSpecialContainingNode(SyntaxNode node)
+ {
+ return
+ node.Kind() == SyntaxKind.IfStatement ||
+ node.Kind() == SyntaxKind.ElseClause ||
+ node.Kind() == SyntaxKind.WhileStatement ||
+ node.Kind() == SyntaxKind.ForStatement ||
+ node.Kind() == SyntaxKind.ForEachStatement ||
+ node.Kind() == SyntaxKind.UsingStatement ||
+ node.Kind() == SyntaxKind.DoStatement ||
+ node.Kind() == SyntaxKind.TryStatement ||
+ node.Kind() == SyntaxKind.CatchClause ||
+ node.Kind() == SyntaxKind.FinallyClause ||
+ node.Kind() == SyntaxKind.LabeledStatement;
+ }
+
+ private static SyntaxNode GetTopContainingNode(SyntaxNode node)
+ {
+ node = node.Parent;
+ if (!IsSpecialContainingNode(node))
+ {
+ return node;
+ }
+
+ var lastSpecialContainingNode = node;
+ node = node.Parent;
+
+ while (node != null)
+ {
+ if (!IsSpecialContainingNode(node))
+ {
+ return lastSpecialContainingNode;
+ }
+
+ lastSpecialContainingNode = node;
+ node = node.Parent;
+ }
+
+ return null;
+ }
+
+ public static bool IsColonInSwitchLabel(SyntaxToken token)
+ {
+ var switchLabel = token.Parent as SwitchLabelSyntax;
+ return token.Kind() == SyntaxKind.ColonToken &&
+ switchLabel != null &&
+ switchLabel.ColonToken == token;
+ }
+
+ public static bool InBetweenTwoMembers(SyntaxToken previousToken, SyntaxToken currentToken)
+ {
+ if (previousToken.Kind() != SyntaxKind.SemicolonToken && previousToken.Kind() != SyntaxKind.CloseBraceToken)
+ {
+ return false;
+ }
+
+ if (currentToken.Kind() == SyntaxKind.CloseBraceToken)
+ {
+ return false;
+ }
+
+ var previousMember = GetEnclosingMember(previousToken);
+ var nextMember = GetEnclosingMember(currentToken);
+
+ return previousMember != null
+ && nextMember != null
+ && previousMember != nextMember;
+ }
+
+ public static MemberDeclarationSyntax GetEnclosingMember(SyntaxToken token)
+ {
+ if (token.Kind() == SyntaxKind.CloseBraceToken)
+ {
+ if (token.Parent.Kind() == SyntaxKind.Block ||
+ token.Parent.Kind() == SyntaxKind.AccessorList)
+ {
+ return token.Parent.Parent as MemberDeclarationSyntax;
+ }
+ }
+
+ return token.Parent.FirstAncestorOrSelf<MemberDeclarationSyntax>();
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/Indent.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/Indent.cs
new file mode 100644
index 0000000000..9da04bb2ea
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/Formatter/Indent.cs
@@ -0,0 +1,249 @@
+//
+// Indent.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ public enum IndentType
+ {
+ Block,
+ DoubleBlock,
+ Continuation,
+ Alignment,
+ Label,
+ Empty
+ }
+
+ class Indent
+ {
+ readonly CloneableStack<IndentType> indentStack = new CloneableStack<IndentType>();
+ readonly OptionSet options;
+ int curIndent;
+ int extraSpaces;
+ string indentString;
+
+ public int CurIndent {
+ get {
+ return curIndent;
+ }
+ }
+
+ public Indent(OptionSet options)
+ {
+ this.options = options;
+ Reset();
+ }
+
+ Indent(Indent engine)
+ {
+ this.indentStack = engine.indentStack.Clone();
+ this.options = engine.options;
+ this.curIndent = engine.curIndent;
+ this.extraSpaces = engine.extraSpaces;
+ this.indentString = engine.indentString;
+ }
+
+ public Indent Clone()
+ {
+ return new Indent(this);
+ }
+
+ public void Reset()
+ {
+ curIndent = 0;
+ indentString = "";
+ indentStack.Clear();
+ }
+
+ public void Push(IndentType type)
+ {
+ indentStack.Push(type);
+ curIndent += GetIndent(type);
+ Update();
+ }
+
+ public void Push(Indent indent)
+ {
+ foreach (var i in indent.indentStack)
+ Push(i);
+ }
+
+ public void Pop()
+ {
+ curIndent -= GetIndent(indentStack.Pop());
+ Update();
+ }
+
+ public bool PopIf(IndentType type)
+ {
+ if (Count > 0 && Peek() == type)
+ {
+ Pop();
+ return true;
+ }
+
+ return false;
+ }
+
+ public void PopWhile(IndentType type)
+ {
+ while (Count > 0 && Peek() == type)
+ {
+ Pop();
+ }
+ }
+
+ public bool PopTry()
+ {
+ if (Count > 0)
+ {
+ Pop();
+ return true;
+ }
+
+ return false;
+ }
+
+ public int Count {
+ get {
+ return indentStack.Count;
+ }
+ }
+
+ public IndentType Peek()
+ {
+ return indentStack.Peek();
+ }
+
+ int GetIndent(IndentType indentType)
+ {
+ switch (indentType) {
+ case IndentType.Block:
+ return options.GetOption(FormattingOptions.IndentationSize, LanguageNames.CSharp);
+ case IndentType.DoubleBlock:
+ return options.GetOption(FormattingOptions.IndentationSize, LanguageNames.CSharp) * 2;
+ case IndentType.Alignment:
+ case IndentType.Continuation:
+ return options.GetOption(FormattingOptions.IndentationSize, LanguageNames.CSharp);
+ case IndentType.Label:
+ return options.GetOption(FormattingOptions.IndentationSize, LanguageNames.CSharp);
+ case IndentType.Empty:
+ return 0;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ void Update()
+ {
+ if (!options.GetOption(FormattingOptions.UseTabs, LanguageNames.CSharp)) {
+ indentString = new string(' ', curIndent + ExtraSpaces);
+ return;
+ }
+ var tabSize = options.GetOption(FormattingOptions.TabSize, LanguageNames.CSharp);
+ indentString = new string('\t', curIndent / tabSize) + new string(' ', curIndent % tabSize) + new string(' ', ExtraSpaces);
+ }
+
+ public int ExtraSpaces {
+ get {
+ return extraSpaces;
+ }
+ set {
+ if (value < 0)
+ throw new ArgumentOutOfRangeException("ExtraSpaces >= 0 but was " + value);
+ extraSpaces = value;
+ Update();
+ }
+ }
+
+
+ public string IndentString {
+ get {
+ return indentString;
+ }
+ }
+
+ public override string ToString()
+ {
+ return string.Format("[Indent: curIndent={0}]", curIndent);
+ }
+
+ public Indent GetIndentWithoutSpace ()
+ {
+ var result = new Indent(options);
+ foreach (var i in indentStack)
+ result.Push(i);
+ return result;
+ }
+
+ public static Indent ConvertFrom(string indentString, Indent correctIndent, OptionSet options = null)
+ {
+ options = options ?? correctIndent.options;
+ var result = new Indent(options);
+
+ var indent = string.Concat(indentString.Where(c => c == ' ' || c == '\t'));
+ var indentTypes = new Stack<IndentType>(correctIndent.indentStack);
+
+ foreach (var _ in indent.TakeWhile(c => c == '\t'))
+ {
+ if (indentTypes.Count > 0)
+ result.Push(indentTypes.Pop());
+ else
+ result.Push(IndentType.Continuation);
+ }
+
+ result.ExtraSpaces = indent
+ .SkipWhile(c => c == '\t')
+ .TakeWhile(c => c == ' ')
+ .Count();
+
+ return result;
+ }
+
+ public void RemoveAlignment()
+ {
+ ExtraSpaces = 0;
+ if (Count > 0 && Peek() == IndentType.Alignment)
+ Pop();
+ }
+
+ public void SetAlignment(int i, bool forceSpaces = false)
+ {
+ var alignChars = Math.Max(0, i);
+ if (forceSpaces) {
+ ExtraSpaces = alignChars;
+ return;
+ }
+ RemoveAlignment();
+ Push(IndentType.Alignment);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/AbstractCodeRefactoringResult.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/AbstractCodeRefactoringResult.cs
new file mode 100644
index 0000000000..3e6736f98b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/AbstractCodeRefactoringResult.cs
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CodeRefactorings;
+using RefactoringEssentials;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateFromMembers
+{
+ abstract class AbstractCodeRefactoringResult
+ {
+ private readonly CodeRefactoring _codeRefactoring;
+
+ protected AbstractCodeRefactoringResult(CodeRefactoring codeRefactoring)
+ {
+ _codeRefactoring = codeRefactoring;
+ }
+
+ public bool ContainsChanges
+ {
+ get
+ {
+ return _codeRefactoring != null;
+ }
+ }
+
+ public CodeRefactoring GetCodeRefactoring(CancellationToken cancellationToken)
+ {
+ return _codeRefactoring;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/AbstractGenerateFromMembersService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/AbstractGenerateFromMembersService.cs
new file mode 100644
index 0000000000..05087c3b7a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/AbstractGenerateFromMembersService.cs
@@ -0,0 +1,160 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.CodeRefactorings;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using RefactoringEssentials;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateFromMembers
+{
+ abstract class AbstractGenerateFromMembersService<TMemberDeclarationSyntax>
+ where TMemberDeclarationSyntax : SyntaxNode
+ {
+ protected AbstractGenerateFromMembersService()
+ {
+ }
+
+ protected abstract Task<IList<TMemberDeclarationSyntax>> GetSelectedMembersAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken);
+ protected abstract IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, TMemberDeclarationSyntax memberDeclaration, CancellationToken cancellationToken);
+
+ protected class SelectedMemberInfo
+ {
+ public INamedTypeSymbol ContainingType;
+ public IList<TMemberDeclarationSyntax> SelectedDeclarations;
+ public IList<ISymbol> SelectedMembers;
+ }
+
+ protected async Task<SelectedMemberInfo> GetSelectedMemberInfoAsync(
+ Document document, TextSpan textSpan, CancellationToken cancellationToken)
+ {
+ var selectedDeclarations = await this.GetSelectedMembersAsync(document, textSpan, cancellationToken).ConfigureAwait(false);
+
+ if (selectedDeclarations.Count > 0)
+ {
+ var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ var selectedMembers = selectedDeclarations.SelectMany(
+ d => this.GetDeclaredSymbols(semanticModel, d, cancellationToken)).WhereNotNull().ToList();
+ if (selectedMembers.Count > 0)
+ {
+ var containingType = selectedMembers.First().ContainingType;
+ if (containingType != null)
+ {
+ return new SelectedMemberInfo { ContainingType = containingType, SelectedDeclarations = selectedDeclarations, SelectedMembers = selectedMembers };
+ }
+ }
+ }
+
+ return null;
+ }
+
+ protected static bool IsWritableInstanceFieldOrProperty(ISymbol symbol)
+ {
+ // Can use non const fields and properties with setters in them.
+ return
+ IsInstanceFieldOrProperty(symbol) &&
+ IsWritableFieldOrProperty(symbol);
+ }
+
+ private static bool IsWritableFieldOrProperty(ISymbol symbol)
+ {
+ return symbol.TypeSwitch(
+ (IFieldSymbol field) => !field.IsConst,
+ (IPropertySymbol property) => property.SetMethod != null);
+ }
+
+ protected static bool IsInstanceFieldOrProperty(ISymbol symbol)
+ {
+ return !symbol.IsStatic && (IsField(symbol) || IsProperty(symbol));
+ }
+
+ private static bool IsProperty(ISymbol symbol)
+ {
+ return symbol.Kind == SymbolKind.Property;
+ }
+
+ private static bool IsField(ISymbol symbol)
+ {
+ return symbol.Kind == SymbolKind.Field;
+ }
+
+ protected CodeRefactoring CreateCodeRefactoring(
+ IList<TMemberDeclarationSyntax> selectedDeclarations,
+ IEnumerable<CodeAction> actions)
+ {
+ #if false
+ var lastDeclaration = selectedDeclarations.Last();
+ var endSpan = new TextSpan(lastDeclaration.Span.End - 1, 1);
+ return new CodeRefactoring(actions, endSpan);
+ #endif
+ return new CodeRefactoring(null, actions);
+ }
+
+ protected List<IParameterSymbol> DetermineParameters(
+ IList<ISymbol> selectedMembers)
+ {
+ var parameters = new List<IParameterSymbol>();
+
+ foreach (var symbol in selectedMembers)
+ {
+ var type = symbol is IFieldSymbol
+ ? ((IFieldSymbol)symbol).Type
+ : ((IPropertySymbol)symbol).Type;
+
+ parameters.Add(CodeGenerationSymbolFactory.CreateParameterSymbol(
+ attributes: null,
+ refKind: RefKind.None,
+ isParams: false,
+ type: type,
+ name: symbol.Name.ToCamelCase()));
+ }
+
+ return parameters;
+ }
+
+ protected IMethodSymbol GetDelegatedConstructor(
+ INamedTypeSymbol containingType,
+ List<IParameterSymbol> parameters)
+ {
+ var q =
+ from c in containingType.InstanceConstructors
+ orderby c.Parameters.Length descending
+ where c.Parameters.Length > 0 && c.Parameters.Length < parameters.Count
+ where c.Parameters.All(p => p.RefKind == RefKind.None) && !c.Parameters.Any(p => p.IsParams)
+ let constructorTypes = c.Parameters.Select(p => p.Type)
+ let symbolTypes = parameters.Take(c.Parameters.Length).Select(p => p.Type)
+ where constructorTypes.SequenceEqual(symbolTypes)
+ select c;
+
+ return q.FirstOrDefault();
+ }
+
+ protected bool HasMatchingConstructor(
+ INamedTypeSymbol containingType,
+ List<IParameterSymbol> parameters)
+ {
+ return containingType.InstanceConstructors.Any(c => MatchesConstructor(c, parameters));
+ }
+
+ private bool MatchesConstructor(
+ IMethodSymbol constructor,
+ List<IParameterSymbol> parameters)
+ {
+ return parameters.Select(p => p.Type).SequenceEqual(constructor.Parameters.Select(p => p.Type));
+ }
+
+ protected static readonly SymbolDisplayFormat SimpleFormat =
+ new SymbolDisplayFormat(
+ typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameOnly,
+ genericsOptions: SymbolDisplayGenericsOptions.IncludeTypeParameters,
+ parameterOptions: SymbolDisplayParameterOptions.IncludeParamsRefOut | SymbolDisplayParameterOptions.IncludeType,
+ miscellaneousOptions: SymbolDisplayMiscellaneousOptions.UseSpecialTypes);
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/GenerateConstructor/AbstractGenerateConstructorService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/GenerateConstructor/AbstractGenerateConstructorService.cs
new file mode 100644
index 0000000000..a40512e2bd
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/GenerateConstructor/AbstractGenerateConstructorService.cs
@@ -0,0 +1,263 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.Internal.Log;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Editing;
+using ICSharpCode.NRefactory6.CSharp.CodeGeneration;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateFromMembers.GenerateConstructor
+{
+ abstract partial class AbstractGenerateConstructorService<TService, TMemberDeclarationSyntax> :
+ AbstractGenerateFromMembersService<TMemberDeclarationSyntax>
+ where TService : AbstractGenerateConstructorService<TService, TMemberDeclarationSyntax>
+ where TMemberDeclarationSyntax : SyntaxNode
+ {
+ protected AbstractGenerateConstructorService()
+ {
+ }
+
+ public async Task<GenerateConstructorResult> GenerateConstructorAsync(
+ Document document, TextSpan textSpan, CancellationToken cancellationToken)
+ {
+// using (Logger.LogBlock(FunctionId.Refactoring_GenerateFromMembers_GenerateConstructor, cancellationToken))
+// {
+ var info = await GetSelectedMemberInfoAsync(document, textSpan, cancellationToken).ConfigureAwait(false);
+ if (info != null)
+ {
+ var state = State.Generate((TService)this, document, textSpan, info.ContainingType, info.SelectedMembers, cancellationToken);
+ if (state != null)
+ {
+ return new GenerateConstructorResult(
+ CreateCodeRefactoring(info.SelectedDeclarations, GetCodeActions(document, state)));
+ }
+ }
+
+ return GenerateConstructorResult.Failure;
+// }
+ }
+
+ private IEnumerable<CodeAction> GetCodeActions(Document document, State state)
+ {
+ yield return new FieldDelegatingCodeAction((TService)this, document, state);
+ if (state.DelegatedConstructor != null)
+ {
+ yield return new ConstructorDelegatingCodeAction((TService)this, document, state);
+ }
+ }
+
+ private class ConstructorDelegatingCodeAction : CodeAction
+ {
+ private readonly Document _document;
+ private readonly State _state;
+
+ public ConstructorDelegatingCodeAction(
+ TService service,
+ Document document,
+ State state)
+ {
+ _document = document;
+ _state = state;
+ }
+
+ protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
+ {
+ // First, see if there are any constructors that would take the first 'n' arguments
+ // we've provided. If so, delegate to those, and then create a field for any
+ // remaining arguments. Try to match from largest to smallest.
+ //
+ // Otherwise, just generate a normal constructor that assigns any provided
+ // parameters into fields.
+ var provider = _document.Project.Solution.Workspace.Services.GetLanguageServices(_state.ContainingType.Language);
+ var factory = provider.GetService<SyntaxGenerator>();
+
+ var thisConstructorArguments = _state.DelegatedConstructor.Parameters.Select (par => factory.Argument (par.RefKind, SyntaxFactory.IdentifierName (par.Name))).ToList ();
+ var statements = new List<SyntaxNode>();
+
+ for (var i = _state.DelegatedConstructor.Parameters.Length; i < _state.Parameters.Count; i++)
+ {
+ var symbolName = _state.SelectedMembers[i].Name;
+ var parameterName = _state.Parameters[i].Name;
+ var assignExpression = factory.AssignmentStatement(
+ factory.MemberAccessExpression(
+ factory.ThisExpression(),
+ factory.IdentifierName(symbolName)),
+ factory.IdentifierName(parameterName));
+
+ var expressionStatement = factory.ExpressionStatement(assignExpression);
+ statements.Add(expressionStatement);
+ }
+
+ var syntaxTree = await _document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
+ var codeGenerationService = new CSharpCodeGenerationService (_document.Project.Solution.Workspace.Services.GetLanguageServices (LanguageNames.CSharp));
+ var result = await codeGenerationService.AddMethodAsync(
+ _document.Project.Solution,
+ _state.ContainingType,
+ CodeGenerationSymbolFactory.CreateConstructorSymbol(
+ attributes: null,
+ accessibility: Accessibility.Public,
+ modifiers: new DeclarationModifiers(),
+ typeName: _state.ContainingType.Name,
+ parameters: _state.Parameters,
+ statements: statements,
+ thisConstructorArguments: thisConstructorArguments),
+ new CodeGenerationOptions(contextLocation: syntaxTree.GetLocation(_state.TextSpan), generateDefaultAccessibility: false),
+ cancellationToken: cancellationToken)
+ .ConfigureAwait(false);
+
+ return result;
+ }
+
+ public override string Title
+ {
+ get
+ {
+ // var symbolDisplayService = _document.GetLanguageService<ISymbolDisplayService>();
+ var parameters = _state.Parameters.Select(p => p.ToDisplayString(SimpleFormat));
+ var parameterString = string.Join(", ", parameters);
+
+ return string.Format(Resources.GenerateDelegatingConstructor,
+ _state.ContainingType.Name, parameterString);
+ }
+ }
+ }
+
+ private class FieldDelegatingCodeAction : CodeAction
+ {
+ private readonly Document _document;
+ private readonly State _state;
+
+ public FieldDelegatingCodeAction(
+ TService service,
+ Document document,
+ State state)
+ {
+ _document = document;
+ _state = state;
+ }
+
+ protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
+ {
+ // First, see if there are any constructors that would take the first 'n' arguments
+ // we've provided. If so, delegate to those, and then create a field for any
+ // remaining arguments. Try to match from largest to smallest.
+ //
+ // Otherwise, just generate a normal constructor that assigns any provided
+ // parameters into fields.
+ var parameterToExistingFieldMap = new Dictionary<string, ISymbol>();
+ for (int i = 0; i < _state.Parameters.Count; i++)
+ {
+ parameterToExistingFieldMap[_state.Parameters[i].Name] = _state.SelectedMembers[i];
+ }
+
+ var factory = _document.GetLanguageService<SyntaxGenerator>();
+
+ var syntaxTree = await _document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
+ var members = factory.CreateFieldDelegatingConstructor(
+ _state.ContainingType.Name,
+ _state.ContainingType,
+ _state.Parameters,
+ parameterToExistingFieldMap,
+ parameterToNewFieldMap: null,
+ cancellationToken: cancellationToken);
+ var codeGenerationService = new CSharpCodeGenerationService (_document.Project.Solution.Workspace.Services.GetLanguageServices (LanguageNames.CSharp));
+
+ var result = await codeGenerationService.AddMembersAsync(
+ _document.Project.Solution,
+ _state.ContainingType,
+ members,
+ new CodeGenerationOptions(contextLocation: syntaxTree.GetLocation(_state.TextSpan), generateDefaultAccessibility: false),
+ cancellationToken)
+ .ConfigureAwait(false);
+
+ return result;
+ }
+
+
+ public override string Title
+ {
+ get
+ {
+ var parameters = _state.Parameters.Select(p => p.ToDisplayString(SimpleFormat));
+ var parameterString = string.Join(", ", parameters);
+
+ if (_state.DelegatedConstructor == null)
+ {
+ return string.Format(Resources.GenerateConstructor,
+ _state.ContainingType.Name, parameterString);
+ }
+ else
+ {
+ return string.Format(Resources.GenerateFieldAssigningConstructor,
+ _state.ContainingType.Name, parameterString);
+ }
+ }
+ }
+ }
+
+
+ private class State
+ {
+ public TextSpan TextSpan { get; private set; }
+ public IMethodSymbol DelegatedConstructor { get; private set; }
+ public INamedTypeSymbol ContainingType { get; private set; }
+ public IList<ISymbol> SelectedMembers { get; private set; }
+ public List<IParameterSymbol> Parameters { get; private set; }
+
+ public static State Generate(
+ TService service,
+ Document document,
+ TextSpan textSpan,
+ INamedTypeSymbol containingType,
+ IList<ISymbol> selectedMembers,
+ CancellationToken cancellationToken)
+ {
+ var state = new State();
+ if (!state.TryInitialize(service, document, textSpan, containingType, selectedMembers, cancellationToken))
+ {
+ return null;
+ }
+
+ return state;
+ }
+
+ private bool TryInitialize(
+ TService service,
+ Document document,
+ TextSpan textSpan,
+ INamedTypeSymbol containingType,
+ IList<ISymbol> selectedMembers,
+ CancellationToken cancellationToken)
+ {
+ if (!selectedMembers.All(IsWritableInstanceFieldOrProperty))
+ {
+ return false;
+ }
+
+ this.SelectedMembers = selectedMembers;
+ this.ContainingType = containingType;
+ this.TextSpan = textSpan;
+ if (this.ContainingType == null || this.ContainingType.TypeKind == TypeKind.Interface)
+ {
+ return false;
+ }
+
+ this.Parameters = service.DetermineParameters(selectedMembers);
+
+ if (service.HasMatchingConstructor(this.ContainingType, this.Parameters))
+ {
+ return false;
+ }
+
+ this.DelegatedConstructor = service.GetDelegatedConstructor(this.ContainingType, this.Parameters);
+ return true;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/GenerateConstructor/CSharpGenerateConstructorService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/GenerateConstructor/CSharpGenerateConstructorService.cs
new file mode 100644
index 0000000000..28815e3687
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/GenerateConstructor/CSharpGenerateConstructorService.cs
@@ -0,0 +1,53 @@
+//
+// CSharpGenerateConstructorService.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+using System.Threading;
+using System.Collections.Generic;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateFromMembers.GenerateConstructor
+{
+ class CSharpGenerateConstructorService :
+ AbstractGenerateConstructorService<CSharpGenerateConstructorService, MemberDeclarationSyntax>
+ {
+ protected override Task<IList<MemberDeclarationSyntax>> GetSelectedMembersAsync(
+ Document document, TextSpan textSpan, CancellationToken cancellationToken)
+ {
+ return GenerateFromMembersHelpers.GetSelectedMembersAsync(document, textSpan, cancellationToken);
+ }
+
+ protected override IEnumerable<ISymbol> GetDeclaredSymbols(
+ SemanticModel semanticModel, MemberDeclarationSyntax memberDeclaration, CancellationToken cancellationToken)
+ {
+ return GenerateFromMembersHelpers.GetDeclaredSymbols(semanticModel, memberDeclaration, cancellationToken);
+ }
+ }
+
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/GenerateConstructor/GenerateConstructorResult.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/GenerateConstructor/GenerateConstructorResult.cs
new file mode 100644
index 0000000000..04be848d30
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/GenerateConstructor/GenerateConstructorResult.cs
@@ -0,0 +1,17 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using Microsoft.CodeAnalysis.CodeRefactorings;
+using RefactoringEssentials;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateFromMembers.GenerateConstructor
+{
+ class GenerateConstructorResult : AbstractCodeRefactoringResult
+ {
+ public static readonly GenerateConstructorResult Failure = new GenerateConstructorResult(null);
+
+ public GenerateConstructorResult(CodeRefactoring codeRefactoring)
+ : base(codeRefactoring)
+ {
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/GenerateFromMembersHelpers.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/GenerateFromMembersHelpers.cs
new file mode 100644
index 0000000000..233b242c45
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateFromMembers/GenerateFromMembersHelpers.cs
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateFromMembers
+{
+ internal static class GenerateFromMembersHelpers
+ {
+ internal static async Task<IList<MemberDeclarationSyntax>> GetSelectedMembersAsync(
+ Document document, TextSpan textSpan, CancellationToken cancellationToken)
+ {
+ var tree = await document.GetCSharpSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
+ return tree.GetMembersInSpan(textSpan, cancellationToken);
+ }
+
+ internal static IEnumerable<ISymbol> GetDeclaredSymbols(SemanticModel semanticModel, MemberDeclarationSyntax memberDeclaration, CancellationToken cancellationToken)
+ {
+ if (memberDeclaration is FieldDeclarationSyntax)
+ {
+ return ((FieldDeclarationSyntax)memberDeclaration).Declaration.Variables.Select(
+ v => semanticModel.GetDeclaredSymbol(v, cancellationToken));
+ }
+
+ return SpecializedCollections.SingletonEnumerable(
+ semanticModel.GetDeclaredSymbol(memberDeclaration, cancellationToken));
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/AbstractCodeRefactoringResult.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/AbstractCodeRefactoringResult.cs
new file mode 100644
index 0000000000..243b58e7ca
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/AbstractCodeRefactoringResult.cs
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CodeRefactorings;
+using RefactoringEssentials;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateMember
+{
+ abstract class AbstractCodeRefactoringResult
+ {
+ private readonly CodeRefactoring _codeRefactoring;
+
+ protected AbstractCodeRefactoringResult(CodeRefactoring codeRefactoring)
+ {
+ _codeRefactoring = codeRefactoring;
+ }
+
+ public bool ContainsChanges
+ {
+ get
+ {
+ return _codeRefactoring != null;
+ }
+ }
+
+ public CodeRefactoring GetCodeRefactoring(CancellationToken cancellationToken)
+ {
+ return _codeRefactoring;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/AbstractGenerateMemberService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/AbstractGenerateMemberService.cs
new file mode 100644
index 0000000000..bd6f9685c0
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/AbstractGenerateMemberService.cs
@@ -0,0 +1,138 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateMember
+{
+ abstract partial class AbstractGenerateMemberService<TSimpleNameSyntax, TExpressionSyntax>
+ where TSimpleNameSyntax : TExpressionSyntax
+ where TExpressionSyntax : SyntaxNode
+ {
+ protected AbstractGenerateMemberService()
+ {
+ }
+
+ protected static readonly ISet<TypeKind> EnumType = new HashSet<TypeKind> { TypeKind.Enum };
+ protected static readonly ISet<TypeKind> ClassInterfaceModuleStructTypes = new HashSet<TypeKind>
+ {
+ TypeKind.Class,
+ TypeKind.Module,
+ TypeKind.Struct,
+ TypeKind.Interface
+ };
+
+ protected bool ValidateTypeToGenerateIn(
+ Solution solution,
+ INamedTypeSymbol typeToGenerateIn,
+ bool isStatic,
+ ISet<TypeKind> typeKinds,
+ CancellationToken cancellationToken)
+ {
+ if (typeToGenerateIn == null)
+ {
+ return false;
+ }
+
+ if (typeToGenerateIn.IsAnonymousType)
+ {
+ return false;
+ }
+
+ if (!typeKinds.Contains(typeToGenerateIn.TypeKind))
+ {
+ return false;
+ }
+
+ if (typeToGenerateIn.TypeKind == TypeKind.Interface && isStatic)
+ {
+ return false;
+ }
+
+ // TODO(cyrusn): Make sure that there is a totally visible part somewhere (i.e.
+ // venus) that we can generate into.
+ var locations = typeToGenerateIn.Locations;
+ return locations.Any(loc => loc.IsInSource);
+ }
+
+ protected bool TryDetermineTypeToGenerateIn(
+ SemanticDocument document,
+ INamedTypeSymbol containingType,
+ TExpressionSyntax simpleNameOrMemberAccessExpression,
+ CancellationToken cancellationToken,
+ out INamedTypeSymbol typeToGenerateIn,
+ out bool isStatic)
+ {
+ typeToGenerateIn = null;
+ isStatic = false;
+
+ var semanticModel = document.SemanticModel;
+ var isMemberAccessExpression = simpleNameOrMemberAccessExpression.IsMemberAccessExpression();
+ if (isMemberAccessExpression ||
+ simpleNameOrMemberAccessExpression.IsConditionalMemberAccessExpression())
+ {
+ var beforeDotExpression = isMemberAccessExpression ?
+ simpleNameOrMemberAccessExpression.GetExpressionOfMemberAccessExpression() :
+ simpleNameOrMemberAccessExpression.GetExpressionOfConditionalMemberAccessExpression();
+ if (beforeDotExpression != null)
+ {
+ var typeInfo = semanticModel.GetTypeInfo(beforeDotExpression, cancellationToken);
+ var semanticInfo = semanticModel.GetSymbolInfo(beforeDotExpression, cancellationToken);
+
+ typeToGenerateIn = typeInfo.Type is ITypeParameterSymbol
+ ? ((ITypeParameterSymbol)typeInfo.Type).GetNamedTypeSymbolConstraint()
+ : typeInfo.Type as INamedTypeSymbol;
+
+ isStatic = semanticInfo.Symbol is INamedTypeSymbol;
+ }
+ }
+ else if (simpleNameOrMemberAccessExpression.IsPointerMemberAccessExpression())
+ {
+ var beforeArrowExpression = simpleNameOrMemberAccessExpression.GetExpressionOfMemberAccessExpression();
+ if (beforeArrowExpression != null)
+ {
+ var typeInfo = semanticModel.GetTypeInfo(beforeArrowExpression, cancellationToken);
+
+ if (typeInfo.Type.IsPointerType())
+ {
+ typeToGenerateIn = ((IPointerTypeSymbol)typeInfo.Type).PointedAtType as INamedTypeSymbol;
+ isStatic = false;
+ }
+ }
+ }
+ else if (simpleNameOrMemberAccessExpression.IsAttributeNamedArgumentIdentifier())
+ {
+ var attributeNode = simpleNameOrMemberAccessExpression.GetAncestors().FirstOrDefault(CSharpSyntaxFactsService.IsAttribute);
+ var attributeName = attributeNode.GetNameOfAttribute();
+ var attributeType = semanticModel.GetTypeInfo(attributeName, cancellationToken);
+
+ typeToGenerateIn = attributeType.Type as INamedTypeSymbol;
+ isStatic = false;
+ }
+ else if (simpleNameOrMemberAccessExpression.IsObjectInitializerNamedAssignmentIdentifier())
+ {
+ var objectCreationNode = simpleNameOrMemberAccessExpression.GetAncestors().FirstOrDefault(CSharpSyntaxFactsService.IsObjectCreationExpression);
+ typeToGenerateIn = semanticModel.GetTypeInfo(objectCreationNode, cancellationToken).Type as INamedTypeSymbol;
+ isStatic = false;
+ }
+ else
+ {
+ // Generating into the containing type.
+ typeToGenerateIn = containingType;
+ isStatic = simpleNameOrMemberAccessExpression.IsInStaticContext();
+ }
+
+ if (typeToGenerateIn != null)
+ {
+ typeToGenerateIn = typeToGenerateIn.OriginalDefinition;
+ }
+
+ return typeToGenerateIn != null;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateConstructor/AbstractGenerateConstructorService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateConstructor/AbstractGenerateConstructorService.cs
new file mode 100644
index 0000000000..e35be8230c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateConstructor/AbstractGenerateConstructorService.cs
@@ -0,0 +1,701 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.Internal.Log;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using System.Linq;
+using Microsoft.CodeAnalysis.Editing;
+using ICSharpCode.NRefactory6.CSharp.CodeGeneration;
+using System;
+using Microsoft.CodeAnalysis.FindSymbols;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateConstructor
+{
+ abstract partial class AbstractGenerateConstructorService<TService, TArgumentSyntax, TAttributeArgumentSyntax>
+ where TService : AbstractGenerateConstructorService<TService, TArgumentSyntax, TAttributeArgumentSyntax>
+ where TArgumentSyntax : SyntaxNode
+ where TAttributeArgumentSyntax : SyntaxNode
+ {
+
+ protected AbstractGenerateConstructorService()
+ {
+ }
+
+ protected abstract bool IsSimpleNameGeneration(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken);
+ protected abstract bool IsConstructorInitializerGeneration(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken);
+
+ protected abstract bool TryInitializeConstructorInitializerGeneration(SemanticDocument document, SyntaxNode constructorInitializer, CancellationToken cancellationToken, out SyntaxToken token, out IList<TArgumentSyntax> arguments, out INamedTypeSymbol typeToGenerateIn);
+ protected abstract bool TryInitializeSimpleNameGenerationState(SemanticDocument document, SyntaxNode simpleName, CancellationToken cancellationToken, out SyntaxToken token, out IList<TArgumentSyntax> arguments, out INamedTypeSymbol typeToGenerateIn);
+ protected abstract bool TryInitializeSimpleAttributeNameGenerationState(SemanticDocument document, SyntaxNode simpleName, CancellationToken cancellationToken, out SyntaxToken token, out IList<TArgumentSyntax> arguments, out IList<TAttributeArgumentSyntax> attributeArguments, out INamedTypeSymbol typeToGenerateIn);
+
+ protected abstract IList<string> GenerateParameterNames(SemanticModel semanticModel, IEnumerable<TArgumentSyntax> arguments, IList<string> reservedNames = null);
+ protected virtual IList<string> GenerateParameterNames(SemanticModel semanticModel, IEnumerable<TAttributeArgumentSyntax> arguments, IList<string> reservedNames = null) { return null; }
+ protected abstract string GenerateNameForArgument(SemanticModel semanticModel, TArgumentSyntax argument);
+ protected virtual string GenerateNameForArgument(SemanticModel semanticModel, TAttributeArgumentSyntax argument) { return null; }
+ protected abstract RefKind GetRefKind(TArgumentSyntax argument);
+ protected abstract bool IsNamedArgument(TArgumentSyntax argument);
+ protected abstract ITypeSymbol GetArgumentType(SemanticModel semanticModel, TArgumentSyntax argument, CancellationToken cancellationToken);
+ protected virtual ITypeSymbol GetAttributeArgumentType(SemanticModel semanticModel, TAttributeArgumentSyntax argument, CancellationToken cancellationToken) { return null; }
+
+ public async Task<IEnumerable<CodeAction>> GenerateConstructorAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ var semanticDocument = await SemanticDocument.CreateAsync(document, cancellationToken).ConfigureAwait(false);
+
+ var state = await State.GenerateAsync((TService)this, semanticDocument, node, cancellationToken).ConfigureAwait(false);
+ if (state == null)
+ {
+ return SpecializedCollections.EmptyEnumerable<CodeAction>();
+ }
+
+ return GetActions(document, state);
+ }
+
+ private IEnumerable<CodeAction> GetActions(Document document, State state)
+ {
+ yield return new GenerateConstructorCodeAction((TService)this, document, state);
+ }
+
+ private class GenerateConstructorCodeAction : CodeAction
+ {
+ private readonly State _state;
+ private readonly Document _document;
+ private readonly TService _service;
+
+ public GenerateConstructorCodeAction(
+ TService service,
+ Document document,
+ State state)
+ {
+ _service = service;
+ _document = document;
+ _state = state;
+ }
+
+ protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
+ {
+ var semanticDocument = await SemanticDocument.CreateAsync(_document, cancellationToken).ConfigureAwait(false);
+ var editor = new Editor(_service, semanticDocument, _state, cancellationToken);
+ return await editor.GetEditAsync().ConfigureAwait(false);
+ }
+
+ public override string Title
+ {
+ get
+ {
+ return string.Format(Resources.GenerateNewConstructorIn,
+ _state.TypeToGenerateIn.Name);
+ }
+ }
+ }
+
+ protected abstract bool IsConversionImplicit(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType);
+
+ internal abstract IMethodSymbol GetDelegatingConstructor(State state, SemanticDocument document, int argumentCount, INamedTypeSymbol namedType, ISet<IMethodSymbol> candidates, CancellationToken cancellationToken);
+
+ private partial class Editor
+ {
+ private readonly TService _service;
+ private readonly SemanticDocument _document;
+ private readonly State _state;
+ private readonly CancellationToken _cancellationToken;
+
+ public Editor(
+ TService service,
+ SemanticDocument document,
+ State state,
+ CancellationToken cancellationToken)
+ {
+ _service = service;
+ _document = document;
+ _state = state;
+ _cancellationToken = cancellationToken;
+ }
+
+ internal async Task<Document> GetEditAsync()
+ {
+ // First, see if there's an accessible base constructor that would accept these
+ // types, then just call into that instead of generating fields.
+ //
+ // then, see if there are any constructors that would take the first 'n' arguments
+ // we've provided. If so, delegate to those, and then create a field for any
+ // remaining arguments. Try to match from largest to smallest.
+ //
+ // Otherwise, just generate a normal constructor that assigns any provided
+ // parameters into fields.
+
+ var edit = await GenerateThisOrBaseDelegatingConstructorAsync().ConfigureAwait(false);
+ if (edit != null)
+ {
+ return edit;
+ }
+
+ return await GenerateFieldDelegatingConstructorAsync().ConfigureAwait(false);
+ }
+
+ private async Task<Document> GenerateThisOrBaseDelegatingConstructorAsync()
+ {
+ // We don't have to deal with the zero length case, since there's nothing to
+ // delegate. It will fall out of the GenerateFieldDelegatingConstructor above.
+ for (int i = _state.Arguments.Count; i >= 1; i--)
+ {
+ var edit = await GenerateThisOrBaseDelegatingConstructorAsync(i).ConfigureAwait(false);
+ if (edit != null)
+ {
+ return edit;
+ }
+ }
+
+ return null;
+ }
+
+ private async Task<Document> GenerateThisOrBaseDelegatingConstructorAsync(int argumentCount)
+ {
+ Document edit;
+ if ((edit = await GenerateDelegatingConstructorAsync(argumentCount, _state.TypeToGenerateIn).ConfigureAwait(false)) != null ||
+ (edit = await GenerateDelegatingConstructorAsync(argumentCount, _state.TypeToGenerateIn.BaseType).ConfigureAwait(false)) != null)
+ {
+ return edit;
+ }
+
+ return null;
+ }
+
+ private async Task<Document> GenerateDelegatingConstructorAsync(
+ int argumentCount,
+ INamedTypeSymbol namedType)
+ {
+ if (namedType == null)
+ {
+ return null;
+ }
+
+ // We can't resolve overloads across language.
+ if (_document.Project.Language != namedType.Language)
+ {
+ return null;
+ }
+
+ // var arguments = _state.Arguments.Take(argumentCount).ToList();
+ var remainingArguments = _state.Arguments.Skip(argumentCount).ToList();
+ var remainingAttributeArguments = _state.AttributeArguments != null ? _state.AttributeArguments.Skip(argumentCount).ToList() : null;
+ var remainingParameterTypes = _state.ParameterTypes.Skip(argumentCount).ToList();
+
+ var instanceConstructors = namedType.InstanceConstructors.Where(IsSymbolAccessible).ToSet();
+ if (instanceConstructors.IsEmpty())
+ {
+ return null;
+ }
+
+ var delegatedConstructor = _service.GetDelegatingConstructor(_state, _document, argumentCount, namedType, instanceConstructors, _cancellationToken);
+ if (delegatedConstructor == null)
+ {
+ return null;
+ }
+
+ // There was a best match. Call it directly.
+ var provider = _document.Project.Solution.Workspace.Services.GetLanguageServices(_state.TypeToGenerateIn.Language);
+ var syntaxFactory = provider.GetService<SyntaxGenerator>();
+ var codeGenerationService = new CSharpCodeGenerationService (_document.Project.Solution.Workspace);
+
+ // Map the first N parameters to the other constructor in this type. Then
+ // try to map any further parameters to existing fields. Finally, generate
+ // new fields if no such parameters exist.
+
+ // Find the names of the parameters that will follow the parameters we're
+ // delegating.
+ var remainingParameterNames = _service.GenerateParameterNames(
+ _document.SemanticModel, remainingArguments, delegatedConstructor.Parameters.Select(p => p.Name).ToList());
+
+ // Can't generate the constructor if the parameter names we're copying over forcibly
+ // conflict with any names we generated.
+ if (delegatedConstructor.Parameters.Select(p => p.Name).Intersect(remainingParameterNames).Any())
+ {
+ return null;
+ }
+
+ // Try to map those parameters to fields.
+ Dictionary<string, ISymbol> parameterToExistingFieldMap;
+ Dictionary<string, string> parameterToNewFieldMap;
+ List<IParameterSymbol> remainingParameters;
+ this.GetParameters(remainingArguments, remainingAttributeArguments, remainingParameterTypes, remainingParameterNames, out parameterToExistingFieldMap, out parameterToNewFieldMap, out remainingParameters);
+
+ var fields = syntaxFactory.CreateFieldsForParameters(remainingParameters, parameterToNewFieldMap);
+ var assignStatements = syntaxFactory.CreateAssignmentStatements(remainingParameters, parameterToExistingFieldMap, parameterToNewFieldMap);
+
+ var allParameters = delegatedConstructor.Parameters.Concat(remainingParameters).ToList();
+
+ var isThis = namedType.Equals(_state.TypeToGenerateIn);
+ var delegatingArguments = syntaxFactory.CreateArguments(delegatedConstructor.Parameters);
+ var baseConstructorArguments = isThis ? null : delegatingArguments;
+ var thisConstructorArguments = isThis ? delegatingArguments : null;
+
+ var constructor = CodeGenerationSymbolFactory.CreateConstructorSymbol(
+ attributes: null,
+ accessibility: Accessibility.Public,
+ modifiers: default(DeclarationModifiers),
+ typeName: _state.TypeToGenerateIn.Name,
+ parameters: allParameters,
+ statements: assignStatements.ToList(),
+ baseConstructorArguments: baseConstructorArguments,
+ thisConstructorArguments: thisConstructorArguments);
+
+ var members = new List<ISymbol>(fields) { constructor };
+ var result = await codeGenerationService.AddMembersAsync(
+ _document.Project.Solution,
+ _state.TypeToGenerateIn,
+ members,
+ new CodeGenerationOptions(_state.Token.GetLocation(), generateDefaultAccessibility: false),
+ _cancellationToken)
+ .ConfigureAwait(false);
+
+ return result;
+ }
+
+ private async Task<Document> GenerateFieldDelegatingConstructorAsync()
+ {
+ var arguments = _state.Arguments.ToList();
+ var parameterTypes = _state.ParameterTypes;
+
+ var typeParametersNames = _state.TypeToGenerateIn.GetAllTypeParameters().Select(t => t.Name).ToList();
+ var parameterNames = _state.AttributeArguments != null
+ ? _service.GenerateParameterNames(_document.SemanticModel, _state.AttributeArguments, typeParametersNames)
+ : _service.GenerateParameterNames(_document.SemanticModel, arguments, typeParametersNames);
+
+ Dictionary<string, ISymbol> parameterToExistingFieldMap;
+ Dictionary<string, string> parameterToNewFieldMap;
+ List<IParameterSymbol> parameters;
+ GetParameters(arguments, _state.AttributeArguments, parameterTypes, parameterNames, out parameterToExistingFieldMap, out parameterToNewFieldMap, out parameters);
+
+ var provider = _document.Project.Solution.Workspace.Services.GetLanguageServices(_state.TypeToGenerateIn.Language);
+ var syntaxFactory = provider.GetService<SyntaxGenerator>();
+ var codeGenerationService = new CSharpCodeGenerationService (_document.Project.Solution.Workspace);
+
+ var members = syntaxFactory.CreateFieldDelegatingConstructor(
+ _state.TypeToGenerateIn.Name, _state.TypeToGenerateIn, parameters,
+ parameterToExistingFieldMap, parameterToNewFieldMap, _cancellationToken);
+
+ var result = await codeGenerationService.AddMembersAsync(
+ _document.Project.Solution,
+ _state.TypeToGenerateIn,
+ members,
+ new CodeGenerationOptions(_state.Token.GetLocation(), generateDefaultAccessibility: false),
+ _cancellationToken)
+ .ConfigureAwait(false);
+
+ return result;
+ }
+
+ private void GetParameters(
+ IList<TArgumentSyntax> arguments,
+ IList<TAttributeArgumentSyntax> attributeArguments,
+ IList<ITypeSymbol> parameterTypes,
+ IList<string> parameterNames,
+ out Dictionary<string, ISymbol> parameterToExistingFieldMap,
+ out Dictionary<string, string> parameterToNewFieldMap,
+ out List<IParameterSymbol> parameters)
+ {
+ parameterToExistingFieldMap = new Dictionary<string, ISymbol>();
+ parameterToNewFieldMap = new Dictionary<string, string>();
+ parameters = new List<IParameterSymbol>();
+
+ for (var i = 0; i < parameterNames.Count; i++)
+ {
+ // See if there's a matching field we can use. First test in a case sensitive
+ // manner, then case insensitively.
+ if (!TryFindMatchingField(arguments, attributeArguments, parameterNames, parameterTypes, i, parameterToExistingFieldMap, parameterToNewFieldMap, caseSentitive: true))
+ {
+ if (!TryFindMatchingField(arguments, attributeArguments, parameterNames, parameterTypes, i, parameterToExistingFieldMap, parameterToNewFieldMap, caseSentitive: false))
+ {
+ parameterToNewFieldMap[parameterNames[i]] = parameterNames[i];
+ }
+ }
+
+ parameters.Add(CodeGenerationSymbolFactory.CreateParameterSymbol(
+ attributes: null,
+ refKind: _service.GetRefKind(arguments[i]),
+ isParams: false,
+ type: parameterTypes[i],
+ name: parameterNames[i]));
+ }
+ }
+
+ private bool TryFindMatchingField(
+ IList<TArgumentSyntax> arguments,
+ IList<TAttributeArgumentSyntax> attributeArguments,
+ IList<string> parameterNames,
+ IList<ITypeSymbol> parameterTypes,
+ int index,
+ Dictionary<string, ISymbol> parameterToExistingFieldMap,
+ Dictionary<string, string> parameterToNewFieldMap,
+ bool caseSentitive)
+ {
+ var parameterName = parameterNames[index];
+ var parameterType = parameterTypes[index];
+ var isFixed = _service.IsNamedArgument(arguments[index]);
+
+ // For non-out parameters, see if there's already a field there with the same name.
+ // If so, and it has a compatible type, then we can just assign to that field.
+ // Otherwise, we'll need to choose a different name for this member so that it
+ // doesn't conflict with something already in the type. First check the current type
+ // for a matching field. If so, defer to it.
+ var comparison = caseSentitive ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase;
+
+ foreach (var type in _state.TypeToGenerateIn.GetBaseTypesAndThis())
+ {
+ var ignoreAccessibility = type.Equals(_state.TypeToGenerateIn);
+ var symbol = type.GetMembers()
+ .FirstOrDefault(s => s.Name.Equals(parameterName, comparison));
+
+ if (symbol != null)
+ {
+ if (ignoreAccessibility || IsSymbolAccessible(symbol))
+ {
+ if (IsViableFieldOrProperty(parameterType, symbol))
+ {
+ // Ok! We can just the existing field.
+ parameterToExistingFieldMap[parameterName] = symbol;
+ }
+ else
+ {
+ // Uh-oh. Now we have a problem. We can't assign this parameter to
+ // this field. So we need to create a new field. Find a name not in
+ // use so we can assign to that.
+ var newFieldName = NameGenerator.EnsureUniqueness(
+ attributeArguments != null ?
+ _service.GenerateNameForArgument(_document.SemanticModel, attributeArguments[index]) :
+ _service.GenerateNameForArgument(_document.SemanticModel, arguments[index]),
+ GetUnavailableMemberNames().Concat(parameterToNewFieldMap.Values));
+
+ if (isFixed)
+ {
+ // Can't change the parameter name, so map the existing parameter
+ // name to the new field name.
+ parameterToNewFieldMap[parameterName] = newFieldName;
+ }
+ else
+ {
+ // Can change the parameter name, so do so.
+ parameterNames[index] = newFieldName;
+ parameterToNewFieldMap[newFieldName] = newFieldName;
+ }
+ }
+
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ private IEnumerable<string> GetUnavailableMemberNames()
+ {
+ return _state.TypeToGenerateIn.MemberNames.Concat(
+ from type in _state.TypeToGenerateIn.GetBaseTypes()
+ from member in type.GetMembers()
+ select member.Name);
+ }
+
+ private bool IsViableFieldOrProperty(
+ ITypeSymbol parameterType,
+ ISymbol symbol)
+ {
+ if (parameterType.Language != symbol.Language)
+ {
+ return false;
+ }
+
+ if (symbol != null && !symbol.IsStatic)
+ {
+ if (symbol is IFieldSymbol)
+ {
+ var field = (IFieldSymbol)symbol;
+ return
+ !field.IsConst &&
+ _service.IsConversionImplicit(_document.SemanticModel.Compilation, parameterType, field.Type);
+ }
+ else if (symbol is IPropertySymbol)
+ {
+ var property = (IPropertySymbol)symbol;
+ return
+ property.Parameters.Length == 0 &&
+ property.SetMethod != null &&
+ _service.IsConversionImplicit(_document.SemanticModel.Compilation, parameterType, property.Type);
+ }
+ }
+
+ return false;
+ }
+
+ private bool IsSymbolAccessible(
+ ISymbol symbol)
+ {
+ if (symbol == null)
+ {
+ return false;
+ }
+
+ if (symbol.Kind == SymbolKind.Property)
+ {
+ if (!IsSymbolAccessible(((IPropertySymbol)symbol).SetMethod))
+ {
+ return false;
+ }
+ }
+
+ // Public and protected constructors are accessible. Internal constructors are
+ // accessible if we have friend access. We can't call the normal accessibility
+ // checkers since they will think that a protected constructor isn't accessible
+ // (since we don't have the destination type that would have access to them yet).
+ switch (symbol.DeclaredAccessibility)
+ {
+ case Accessibility.ProtectedOrInternal:
+ case Accessibility.Protected:
+ case Accessibility.Public:
+ return true;
+ case Accessibility.ProtectedAndInternal:
+ case Accessibility.Internal:
+ return _document.SemanticModel.Compilation.Assembly.IsSameAssemblyOrHasFriendAccessTo(
+ symbol.ContainingAssembly);
+
+ default:
+ return false;
+ }
+ }
+ }
+
+ protected internal class State
+ {
+ public IList<TArgumentSyntax> Arguments { get; private set; }
+
+ public IList<TAttributeArgumentSyntax> AttributeArguments { get; private set; }
+
+ // The type we're creating a constructor for. Will be a class or struct type.
+ public INamedTypeSymbol TypeToGenerateIn { get; private set; }
+
+ public IList<ITypeSymbol> ParameterTypes { get; private set; }
+ public IList<RefKind> ParameterRefKinds { get; private set; }
+
+ public SyntaxToken Token { get; private set; }
+ public bool IsConstructorInitializerGeneration { get; private set; }
+
+ private State()
+ {
+ this.IsConstructorInitializerGeneration = false;
+ }
+
+ public static async Task<State> GenerateAsync(
+ TService service,
+ SemanticDocument document,
+ SyntaxNode node,
+ CancellationToken cancellationToken)
+ {
+ var state = new State();
+ if (!await state.TryInitializeAsync(service, document, node, cancellationToken).ConfigureAwait(false))
+ {
+ return null;
+ }
+
+ return state;
+ }
+
+ private async Task<bool> TryInitializeAsync(
+ TService service,
+ SemanticDocument document,
+ SyntaxNode node,
+ CancellationToken cancellationToken)
+ {
+ if (service.IsConstructorInitializerGeneration(document, node, cancellationToken))
+ {
+ if (!await TryInitializeConstructorInitializerGenerationAsync(service, document, node, cancellationToken).ConfigureAwait(false))
+ {
+ return false;
+ }
+ }
+ else if (service.IsSimpleNameGeneration(document, node, cancellationToken))
+ {
+ if (!await TryInitializeSimpleNameGenerationAsync(service, document, node, cancellationToken).ConfigureAwait(false))
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+
+ if (!new CSharpCodeGenerationService (document.Project.Solution.Workspace).CanAddTo(this.TypeToGenerateIn, document.Project.Solution, cancellationToken))
+ {
+ return false;
+ }
+
+ this.ParameterTypes = this.ParameterTypes ?? GetParameterTypes(service, document, cancellationToken);
+ this.ParameterRefKinds = this.Arguments.Select(service.GetRefKind).ToList();
+
+ return !ClashesWithExistingConstructor(service, document, cancellationToken);
+ }
+
+ private bool ClashesWithExistingConstructor(TService service, SemanticDocument document, CancellationToken cancellationToken)
+ {
+ var parameters = this.ParameterTypes.Zip(this.ParameterRefKinds, (t, r) => CodeGenerationSymbolFactory.CreateParameterSymbol(
+ attributes: null,
+ refKind: r,
+ isParams: false,
+ type: t,
+ name: string.Empty)).ToList();
+
+ return this.TypeToGenerateIn.InstanceConstructors.Any(c => SignatureComparer.HaveSameSignature(parameters, c.Parameters, compareParameterName: true, isCaseSensitive: true));
+ }
+
+ internal List<ITypeSymbol> GetParameterTypes(
+ TService service,
+ SemanticDocument document,
+ CancellationToken cancellationToken)
+ {
+ var allTypeParameters = this.TypeToGenerateIn.GetAllTypeParameters();
+ var semanticModel = document.SemanticModel;
+ var allTypes = this.AttributeArguments != null
+ ? this.AttributeArguments.Select(a => service.GetAttributeArgumentType(semanticModel, a, cancellationToken))
+ : this.Arguments.Select(a => service.GetArgumentType(semanticModel, a, cancellationToken));
+
+ return allTypes.Select(t => FixType(t, semanticModel, allTypeParameters)).ToList();
+ }
+
+ private ITypeSymbol FixType(ITypeSymbol typeSymbol, SemanticModel semanticModel, IEnumerable<ITypeParameterSymbol> allTypeParameters)
+ {
+ var compilation = semanticModel.Compilation;
+ return typeSymbol.RemoveAnonymousTypes(compilation)
+ .RemoveUnavailableTypeParameters(compilation, allTypeParameters)
+ .RemoveUnnamedErrorTypes(compilation);
+ }
+
+ private async Task<bool> TryInitializeConstructorInitializerGenerationAsync(
+ TService service,
+ SemanticDocument document,
+ SyntaxNode constructorInitializer,
+ CancellationToken cancellationToken)
+ {
+ SyntaxToken token;
+ IList<TArgumentSyntax> arguments;
+ INamedTypeSymbol typeToGenerateIn;
+ if (!service.TryInitializeConstructorInitializerGeneration(document, constructorInitializer, cancellationToken,
+ out token, out arguments, out typeToGenerateIn))
+ {
+ return false;
+ }
+
+ this.Token = token;
+ this.Arguments = arguments;
+ this.IsConstructorInitializerGeneration = true;
+
+ var semanticModel = document.SemanticModel;
+ var semanticInfo = semanticModel.GetSymbolInfo(constructorInitializer, cancellationToken);
+
+ cancellationToken.ThrowIfCancellationRequested();
+ if (semanticInfo.Symbol != null)
+ {
+ return false;
+ }
+
+ return await TryDetermineTypeToGenerateInAsync(document, typeToGenerateIn, cancellationToken).ConfigureAwait(false);
+ }
+
+ private async Task<bool> TryInitializeSimpleNameGenerationAsync(
+ TService service,
+ SemanticDocument document,
+ SyntaxNode simpleName,
+ CancellationToken cancellationToken)
+ {
+ SyntaxToken token;
+ IList<TArgumentSyntax> arguments;
+ IList<TAttributeArgumentSyntax> attributeArguments;
+ INamedTypeSymbol typeToGenerateIn;
+ if (service.TryInitializeSimpleNameGenerationState(document, simpleName, cancellationToken,
+ out token, out arguments, out typeToGenerateIn))
+ {
+ this.Token = token;
+ this.Arguments = arguments;
+ }
+ else if (service.TryInitializeSimpleAttributeNameGenerationState(document, simpleName, cancellationToken,
+ out token, out arguments, out attributeArguments, out typeToGenerateIn))
+ {
+ this.Token = token;
+ this.AttributeArguments = attributeArguments;
+ this.Arguments = arguments;
+
+ //// Attribute parameters are restricted to be constant values (simple types or string, etc).
+ if (this.AttributeArguments != null && GetParameterTypes(service, document, cancellationToken).Any(t => !IsValidAttributeParameterType(t)))
+ {
+ return false;
+ }
+ else if (GetParameterTypes(service, document, cancellationToken).Any(t => !IsValidAttributeParameterType(t)))
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+
+ cancellationToken.ThrowIfCancellationRequested();
+
+ return await TryDetermineTypeToGenerateInAsync(document, typeToGenerateIn, cancellationToken).ConfigureAwait(false);
+ }
+
+ private bool IsValidAttributeParameterType(ITypeSymbol type)
+ {
+ if (type.Kind == SymbolKind.ArrayType)
+ {
+ var arrayType = (IArrayTypeSymbol)type;
+ if (arrayType.Rank != 1)
+ {
+ return false;
+ }
+
+ type = arrayType.ElementType;
+ }
+
+ if (type.IsEnumType())
+ {
+ return true;
+ }
+
+ switch (type.SpecialType)
+ {
+ case SpecialType.System_Boolean:
+ case SpecialType.System_Byte:
+ case SpecialType.System_Char:
+ case SpecialType.System_Int16:
+ case SpecialType.System_Int32:
+ case SpecialType.System_Int64:
+ case SpecialType.System_Double:
+ case SpecialType.System_Single:
+ case SpecialType.System_String:
+ return true;
+
+ default:
+ return false;
+ }
+ }
+
+ private async Task<bool> TryDetermineTypeToGenerateInAsync(
+ SemanticDocument document,
+ INamedTypeSymbol original,
+ CancellationToken cancellationToken)
+ {
+ var definition = await SymbolFinder.FindSourceDefinitionAsync(original, document.Project.Solution, cancellationToken).ConfigureAwait(false);
+ this.TypeToGenerateIn = definition as INamedTypeSymbol;
+
+ return this.TypeToGenerateIn != null &&
+ (this.TypeToGenerateIn.TypeKind == TypeKind.Class ||
+ this.TypeToGenerateIn.TypeKind == TypeKind.Struct);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateConstructor/CSharpGenerateConstructorService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateConstructor/CSharpGenerateConstructorService.cs
new file mode 100644
index 0000000000..f737ff1a3a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateConstructor/CSharpGenerateConstructorService.cs
@@ -0,0 +1,279 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Composition;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateConstructor
+{
+ class CSharpGenerateConstructorService : AbstractGenerateConstructorService<CSharpGenerateConstructorService, ArgumentSyntax, AttributeArgumentSyntax>
+ {
+ private static readonly SyntaxAnnotation s_annotation = new SyntaxAnnotation();
+
+ protected override bool IsSimpleNameGeneration(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ return node is SimpleNameSyntax;
+ }
+
+ protected override bool IsConstructorInitializerGeneration(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ return node is ConstructorInitializerSyntax;
+ }
+
+ protected override bool TryInitializeConstructorInitializerGeneration(
+ SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken,
+ out SyntaxToken token, out IList<ArgumentSyntax> arguments, out INamedTypeSymbol typeToGenerateIn)
+ {
+ var constructorInitializer = (ConstructorInitializerSyntax)node;
+
+ if (!constructorInitializer.ArgumentList.CloseParenToken.IsMissing)
+ {
+ token = constructorInitializer.ThisOrBaseKeyword;
+ arguments = constructorInitializer.ArgumentList.Arguments.ToList();
+
+ var semanticModel = document.SemanticModel;
+ var currentType = semanticModel.GetEnclosingNamedType(constructorInitializer.SpanStart, cancellationToken);
+ typeToGenerateIn = constructorInitializer.IsKind(SyntaxKind.ThisConstructorInitializer)
+ ? currentType
+ : currentType.BaseType.OriginalDefinition;
+ return typeToGenerateIn != null;
+ }
+
+ token = default(SyntaxToken);
+ arguments = null;
+ typeToGenerateIn = null;
+ return false;
+ }
+
+ protected override bool TryInitializeSimpleNameGenerationState(
+ SemanticDocument document,
+ SyntaxNode node,
+ CancellationToken cancellationToken,
+ out SyntaxToken token,
+ out IList<ArgumentSyntax> arguments,
+ out INamedTypeSymbol typeToGenerateIn)
+ {
+ var simpleName = (SimpleNameSyntax)node;
+ var fullName = simpleName.IsRightSideOfQualifiedName()
+ ? (NameSyntax)simpleName.Parent
+ : simpleName;
+
+ if (fullName.Parent is ObjectCreationExpressionSyntax)
+ {
+ var objectCreationExpression = (ObjectCreationExpressionSyntax)fullName.Parent;
+ if (objectCreationExpression.ArgumentList != null &&
+ !objectCreationExpression.ArgumentList.CloseParenToken.IsMissing)
+ {
+ var symbolInfo = document.SemanticModel.GetSymbolInfo(objectCreationExpression.Type, cancellationToken);
+ token = simpleName.Identifier;
+ arguments = objectCreationExpression.ArgumentList.Arguments.ToList();
+ typeToGenerateIn = symbolInfo.GetAnySymbol() as INamedTypeSymbol;
+ return typeToGenerateIn != null;
+ }
+ }
+
+ token = default(SyntaxToken);
+ arguments = null;
+ typeToGenerateIn = null;
+ return false;
+ }
+
+ protected override bool TryInitializeSimpleAttributeNameGenerationState(
+ SemanticDocument document,
+ SyntaxNode node,
+ CancellationToken cancellationToken,
+ out SyntaxToken token,
+ out IList<ArgumentSyntax> arguments,
+ out IList<AttributeArgumentSyntax> attributeArguments,
+ out INamedTypeSymbol typeToGenerateIn)
+ {
+ var simpleName = (SimpleNameSyntax)node;
+ var fullName = simpleName.IsRightSideOfQualifiedName()
+ ? (NameSyntax)simpleName.Parent
+ : simpleName;
+
+ if (fullName.Parent is AttributeSyntax)
+ {
+ var attribute = (AttributeSyntax)fullName.Parent;
+ if (attribute.ArgumentList != null &&
+ !attribute.ArgumentList.CloseParenToken.IsMissing)
+ {
+ var symbolInfo = document.SemanticModel.GetSymbolInfo(attribute, cancellationToken);
+ if (symbolInfo.CandidateReason == CandidateReason.OverloadResolutionFailure && !symbolInfo.CandidateSymbols.IsEmpty)
+ {
+ token = simpleName.Identifier;
+ attributeArguments = attribute.ArgumentList.Arguments.ToList();
+ arguments = attributeArguments.Select(x => SyntaxFactory.Argument(x.NameColon ?? ((x.NameEquals != null) ? SyntaxFactory.NameColon(x.NameEquals.Name) : null), default(SyntaxToken), x.Expression)).ToList();
+
+ typeToGenerateIn = symbolInfo.CandidateSymbols.FirstOrDefault().ContainingSymbol as INamedTypeSymbol;
+ return typeToGenerateIn != null;
+ }
+ }
+ }
+
+ token = default(SyntaxToken);
+ arguments = null;
+ attributeArguments = null;
+ typeToGenerateIn = null;
+ return false;
+ }
+
+ protected override IList<string> GenerateParameterNames(
+ SemanticModel semanticModel, IEnumerable<ArgumentSyntax> arguments, IList<string> reservedNames)
+ {
+ return semanticModel.GenerateParameterNames(arguments, reservedNames);
+ }
+
+ protected override IList<string> GenerateParameterNames(
+ SemanticModel semanticModel, IEnumerable<AttributeArgumentSyntax> arguments, IList<string> reservedNames)
+ {
+ return semanticModel.GenerateParameterNames(arguments, reservedNames);
+ }
+
+ protected override string GenerateNameForArgument(
+ SemanticModel semanticModel, ArgumentSyntax argument)
+ {
+ return semanticModel.GenerateNameForArgument(argument);
+ }
+
+ protected override string GenerateNameForArgument(
+ SemanticModel semanticModel, AttributeArgumentSyntax argument)
+ {
+ return semanticModel.GenerateNameForArgument(argument);
+ }
+
+ protected override RefKind GetRefKind(ArgumentSyntax argument)
+ {
+ return argument.RefOrOutKeyword.Kind() == SyntaxKind.RefKeyword ? RefKind.Ref :
+ argument.RefOrOutKeyword.Kind() == SyntaxKind.OutKeyword ? RefKind.Out : RefKind.None;
+ }
+
+ protected override bool IsNamedArgument(ArgumentSyntax argument)
+ {
+ return argument.NameColon != null;
+ }
+
+ protected override ITypeSymbol GetArgumentType(
+ SemanticModel semanticModel, ArgumentSyntax argument, CancellationToken cancellationToken)
+ {
+ return semanticModel.GetType(argument.Expression, cancellationToken);
+ }
+
+ protected override ITypeSymbol GetAttributeArgumentType(
+ SemanticModel semanticModel, AttributeArgumentSyntax argument, CancellationToken cancellationToken)
+ {
+ return semanticModel.GetType(argument.Expression, cancellationToken);
+ }
+
+ protected override bool IsConversionImplicit(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType)
+ {
+ return compilation.ClassifyConversion(sourceType, targetType).IsImplicit;
+ }
+
+ internal override IMethodSymbol GetDelegatingConstructor(State state, SemanticDocument document, int argumentCount, INamedTypeSymbol namedType, ISet<IMethodSymbol> candidates, CancellationToken cancellationToken)
+ {
+ var oldToken = state.Token;
+ var tokenKind = oldToken.Kind();
+
+ if (state.IsConstructorInitializerGeneration)
+ {
+ SyntaxToken thisOrBaseKeyword;
+ SyntaxKind newCtorInitializerKind;
+ if (tokenKind != SyntaxKind.BaseKeyword && state.TypeToGenerateIn == namedType)
+ {
+ thisOrBaseKeyword = SyntaxFactory.Token(SyntaxKind.ThisKeyword);
+ newCtorInitializerKind = SyntaxKind.ThisConstructorInitializer;
+ }
+ else
+ {
+ thisOrBaseKeyword = SyntaxFactory.Token(SyntaxKind.BaseKeyword);
+ newCtorInitializerKind = SyntaxKind.BaseConstructorInitializer;
+ }
+
+ var ctorInitializer = (ConstructorInitializerSyntax)oldToken.Parent;
+ var oldArgumentList = ctorInitializer.ArgumentList;
+ var newArgumentList = GetNewArgumentList(oldArgumentList, argumentCount);
+
+ var newCtorInitializer = SyntaxFactory.ConstructorInitializer(newCtorInitializerKind, ctorInitializer.ColonToken, thisOrBaseKeyword, newArgumentList);
+ SemanticModel speculativeModel;
+ if (document.SemanticModel.TryGetSpeculativeSemanticModel(ctorInitializer.Span.Start, newCtorInitializer, out speculativeModel))
+ {
+ var symbolInfo = speculativeModel.GetSymbolInfo(newCtorInitializer, cancellationToken);
+ return GenerateConstructorHelpers.GetDelegatingConstructor(symbolInfo, candidates, namedType);
+ }
+ }
+ else
+ {
+ var oldNode = oldToken.Parent
+ .AncestorsAndSelf(ascendOutOfTrivia: false)
+ .Where(node => SpeculationAnalyzer.CanSpeculateOnNode(node))
+ .LastOrDefault();
+
+ var typeNameToReplace = (TypeSyntax)oldToken.Parent;
+ TypeSyntax newTypeName;
+ if (namedType != state.TypeToGenerateIn)
+ {
+ while (true)
+ {
+ var parentType = typeNameToReplace.Parent as TypeSyntax;
+ if (parentType == null)
+ {
+ break;
+ }
+
+ typeNameToReplace = parentType;
+ }
+
+ newTypeName = namedType.GenerateTypeSyntax().WithAdditionalAnnotations(s_annotation);
+ }
+ else
+ {
+ newTypeName = typeNameToReplace.WithAdditionalAnnotations(s_annotation);
+ }
+
+ var newNode = oldNode.ReplaceNode(typeNameToReplace, newTypeName);
+ newTypeName = (TypeSyntax)newNode.GetAnnotatedNodes(s_annotation).Single();
+
+ var oldArgumentList = (ArgumentListSyntax)newTypeName.Parent.ChildNodes().FirstOrDefault(n => n is ArgumentListSyntax);
+ if (oldArgumentList != null)
+ {
+ var newArgumentList = GetNewArgumentList(oldArgumentList, argumentCount);
+ if (newArgumentList != oldArgumentList)
+ {
+ newNode = newNode.ReplaceNode(oldArgumentList, newArgumentList);
+ newTypeName = (TypeSyntax)newNode.GetAnnotatedNodes(s_annotation).Single();
+ }
+ }
+
+ var speculativeModel = SpeculationAnalyzer.CreateSpeculativeSemanticModelForNode(oldNode, newNode, document.SemanticModel);
+ if (speculativeModel != null)
+ {
+ var symbolInfo = speculativeModel.GetSymbolInfo(newTypeName.Parent, cancellationToken);
+ return GenerateConstructorHelpers.GetDelegatingConstructor(symbolInfo, candidates, namedType);
+ }
+ }
+
+ return null;
+ }
+
+ private static ArgumentListSyntax GetNewArgumentList(ArgumentListSyntax oldArgumentList, int argumentCount)
+ {
+ if (oldArgumentList.IsMissing || oldArgumentList.Arguments.Count == argumentCount)
+ {
+ return oldArgumentList;
+ }
+
+ var newArguments = oldArgumentList.Arguments.Take(argumentCount);
+ return SyntaxFactory.ArgumentList(new SeparatedSyntaxList<ArgumentSyntax>().AddRange(newArguments));
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateConstructor/GenerateConstructorHelpers.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateConstructor/GenerateConstructorHelpers.cs
new file mode 100644
index 0000000000..ce7fdf3c5d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateConstructor/GenerateConstructorHelpers.cs
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateConstructor
+{
+ internal static class GenerateConstructorHelpers
+ {
+ public static IMethodSymbol GetDelegatingConstructor(SymbolInfo symbolInfo, ISet<IMethodSymbol> candidateInstanceConstructors, INamedTypeSymbol containingType)
+ {
+ var symbol = symbolInfo.Symbol as IMethodSymbol;
+ if (symbol == null && symbolInfo.CandidateSymbols.Count() == 1)
+ {
+ // Even though the symbol info has a non-viable candidate symbol, we are trying to speculate a base constructor
+ // invocation from a different position then where the invocation to it would be generated.
+ // Passed in candidateInstanceConstructors actually represent all accessible and invocable constructor symbols.
+ // So, we allow candidate symbol for inaccessible OR not creatable candidate reason if it is in the given candidateInstanceConstructors.
+ if (symbolInfo.CandidateReason == CandidateReason.Inaccessible ||
+ (symbolInfo.CandidateReason == CandidateReason.NotCreatable && containingType.IsAbstract))
+ {
+ symbol = symbolInfo.CandidateSymbols.Single() as IMethodSymbol;
+ }
+ }
+
+ if (symbol != null && candidateInstanceConstructors.Contains(symbol))
+ {
+ return symbol;
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateDefaultConstructors/AbstractGenerateDefaultConstructorsService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateDefaultConstructors/AbstractGenerateDefaultConstructorsService.cs
new file mode 100644
index 0000000000..e29c216a19
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateDefaultConstructors/AbstractGenerateDefaultConstructorsService.cs
@@ -0,0 +1,239 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CodeRefactorings;
+using Microsoft.CodeAnalysis.Internal.Log;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
+using RefactoringEssentials;
+using Microsoft.CodeAnalysis.Editing;
+using System.Linq;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateDefaultConstructors
+{
+ abstract partial class AbstractGenerateDefaultConstructorsService<TService>
+ where TService : AbstractGenerateDefaultConstructorsService<TService>
+ {
+ protected AbstractGenerateDefaultConstructorsService()
+ {
+ }
+
+ protected abstract bool TryInitializeState(SemanticDocument document, TextSpan textSpan, CancellationToken cancellationToken, out SyntaxNode baseTypeNode, out INamedTypeSymbol classType);
+
+ public async Task<GenerateDefaultConstructorsResult> GenerateDefaultConstructorsAsync(
+ Document document,
+ TextSpan textSpan,
+ CancellationToken cancellationToken)
+ {
+ var semanticDocument = await SemanticDocument.CreateAsync(document, cancellationToken).ConfigureAwait(false);
+
+ if (textSpan.IsEmpty)
+ {
+ var state = State.Generate((TService)this, semanticDocument, textSpan, cancellationToken);
+ if (state != null)
+ {
+ return new GenerateDefaultConstructorsResult(new CodeRefactoring(null, GetActions(document, state)));
+ }
+ }
+
+ return GenerateDefaultConstructorsResult.Failure;
+ }
+
+ private IEnumerable<CodeAction> GetActions(Document document, State state)
+ {
+ foreach (var constructor in state.UnimplementedConstructors)
+ {
+ yield return new GenerateDefaultConstructorCodeAction((TService)this, document, state, constructor);
+ }
+
+ if (state.UnimplementedConstructors.Count > 1)
+ {
+ yield return new CodeActionAll((TService)this, document, state, state.UnimplementedConstructors);
+ }
+ }
+
+ private abstract class AbstractCodeAction : CodeAction
+ {
+ private readonly IList<IMethodSymbol> _constructors;
+ private readonly Document _document;
+ private readonly State _state;
+ private readonly string _title;
+
+ protected AbstractCodeAction(
+ TService service,
+ Document document,
+ State state,
+ IList<IMethodSymbol> constructors,
+ string title)
+ {
+ _document = document;
+ _state = state;
+ _constructors = constructors;
+ _title = title;
+ }
+
+ public override string Title
+ {
+ get { return _title; }
+ }
+
+ protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
+ {
+ var result = await CodeGenerator.AddMemberDeclarationsAsync(
+ _document.Project.Solution,
+ _state.ClassType,
+ _constructors.Select(CreateConstructorDefinition),
+ cancellationToken: cancellationToken).ConfigureAwait(false);
+
+ return result;
+ }
+
+ private IMethodSymbol CreateConstructorDefinition(
+ IMethodSymbol constructor)
+ {
+ var syntaxFactory = _document.GetLanguageService<SyntaxGenerator>();
+ var baseConstructorArguments = constructor.Parameters.Length != 0
+ ? syntaxFactory.CreateArguments(constructor.Parameters)
+ : null;
+
+ return CodeGenerationSymbolFactory.CreateConstructorSymbol(
+ attributes: null,
+ accessibility: constructor.DeclaredAccessibility,
+ modifiers: new DeclarationModifiers(),
+ typeName: _state.ClassType.Name,
+ parameters: constructor.Parameters,
+ statements: null,
+ baseConstructorArguments: baseConstructorArguments);
+ }
+ }
+
+
+ private class GenerateDefaultConstructorCodeAction : AbstractCodeAction
+ {
+ public GenerateDefaultConstructorCodeAction(
+ TService service,
+ Document document,
+ State state,
+ IMethodSymbol constructor)
+ : base(service, document, state, new[] { constructor }, GetDisplayText(state, constructor))
+ {
+ }
+
+ private static string GetDisplayText(State state, IMethodSymbol constructor)
+ {
+ var parameters = constructor.Parameters.Select(p => p.Name);
+ var parameterString = string.Join(", ", parameters);
+
+ return string.Format(Resources.GenerateConstructor + ".",
+ state.ClassType.Name, parameterString);
+ }
+ }
+
+ private class CodeActionAll : AbstractCodeAction
+ {
+ public CodeActionAll(
+ TService service,
+ Document document,
+ State state,
+ IList<IMethodSymbol> constructors)
+ : base(service, document, state, GetConstructors(state, constructors), Resources.GenerateAll)
+ {
+ }
+
+ private static IList<IMethodSymbol> GetConstructors(State state, IList<IMethodSymbol> constructors)
+ {
+ return state.UnimplementedDefaultConstructor != null
+ ? new[] { state.UnimplementedDefaultConstructor }.Concat(constructors).ToList()
+ : constructors;
+ }
+ }
+ private class State
+ {
+ public INamedTypeSymbol ClassType { get; private set; }
+
+ public IList<IMethodSymbol> UnimplementedConstructors { get; private set; }
+ public IMethodSymbol UnimplementedDefaultConstructor { get; private set; }
+
+ public SyntaxNode BaseTypeNode { get; private set; }
+
+ private State()
+ {
+ }
+
+ public static State Generate(
+ TService service,
+ SemanticDocument document,
+ TextSpan textSpan,
+ CancellationToken cancellationToken)
+ {
+ var state = new State();
+ if (!state.TryInitialize(service, document, textSpan, cancellationToken))
+ {
+ return null;
+ }
+
+ return state;
+ }
+
+ private bool TryInitialize(
+ TService service,
+ SemanticDocument document,
+ TextSpan textSpan,
+ CancellationToken cancellationToken)
+ {
+ SyntaxNode baseTypeNode;
+ INamedTypeSymbol classType;
+ if (!service.TryInitializeState(document, textSpan, cancellationToken, out baseTypeNode, out classType))
+ {
+ return false;
+ }
+
+ if (!baseTypeNode.Span.IntersectsWith(textSpan.Start))
+ {
+ return false;
+ }
+
+ this.BaseTypeNode = baseTypeNode;
+ this.ClassType = classType;
+
+ var baseType = this.ClassType.BaseType;
+
+ if (this.ClassType.TypeKind != TypeKind.Class ||
+ this.ClassType.IsStatic ||
+ baseType == null ||
+ baseType.SpecialType == SpecialType.System_Object ||
+ baseType.TypeKind == TypeKind.Error)
+ {
+ return false;
+ }
+
+ var classConstructors = this.ClassType.InstanceConstructors;
+ var baseTypeConstructors =
+ baseType.InstanceConstructors
+ .Where(c => c.IsAccessibleWithin(this.ClassType));
+
+ var missingConstructors =
+ baseTypeConstructors.Where(c1 => !classConstructors.Any(
+ c2 => SignatureComparer.HaveSameSignature(c1.Parameters, c2.Parameters, compareParameterName: true, isCaseSensitive: true))).ToList();
+
+ this.UnimplementedConstructors = missingConstructors;
+
+ this.UnimplementedDefaultConstructor = baseTypeConstructors.FirstOrDefault(c => c.Parameters.Length == 0);
+ if (this.UnimplementedDefaultConstructor != null)
+ {
+ if (classConstructors.Any(c => c.Parameters.Length == 0 && !c.IsImplicitlyDeclared))
+ {
+ this.UnimplementedDefaultConstructor = null;
+ }
+ }
+
+ return this.UnimplementedConstructors.Count > 0;
+ }
+ }
+
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateDefaultConstructors/CSharpGenerateDefaultConstructorsService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateDefaultConstructors/CSharpGenerateDefaultConstructorsService.cs
new file mode 100644
index 0000000000..39e6775830
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateDefaultConstructors/CSharpGenerateDefaultConstructorsService.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Composition;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateDefaultConstructors
+{
+ class CSharpGenerateDefaultConstructorsService : AbstractGenerateDefaultConstructorsService<CSharpGenerateDefaultConstructorsService>
+ {
+ protected override bool TryInitializeState(
+ SemanticDocument document, TextSpan textSpan, CancellationToken cancellationToken,
+ out SyntaxNode baseTypeNode, out INamedTypeSymbol classType)
+ {
+ if (!cancellationToken.IsCancellationRequested)
+ {
+ var node = document.Root.FindToken(textSpan.Start).GetAncestor<TypeSyntax>();
+ if (node != null)
+ {
+ if (node.Parent is BaseTypeSyntax && node.Parent.IsParentKind(SyntaxKind.BaseList))
+ {
+ var baseList = (BaseListSyntax)node.Parent.Parent;
+ if (baseList.Types.Count > 0 &&
+ baseList.Types[0].Type == node &&
+ baseList.IsParentKind(SyntaxKind.ClassDeclaration))
+ {
+ var semanticModel = document.SemanticModel;
+ classType = semanticModel.GetDeclaredSymbol(baseList.Parent, cancellationToken) as INamedTypeSymbol;
+ baseTypeNode = node;
+ return classType != null;
+ }
+ }
+ }
+ }
+
+ baseTypeNode = null;
+ classType = null;
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateDefaultConstructors/GenerateDefaultConstructorsResult.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateDefaultConstructors/GenerateDefaultConstructorsResult.cs
new file mode 100644
index 0000000000..7d4e474df1
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateDefaultConstructors/GenerateDefaultConstructorsResult.cs
@@ -0,0 +1,17 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using Microsoft.CodeAnalysis.CodeRefactorings;
+using RefactoringEssentials;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateDefaultConstructors
+{
+ class GenerateDefaultConstructorsResult : AbstractCodeRefactoringResult
+ {
+ public static readonly GenerateDefaultConstructorsResult Failure = new GenerateDefaultConstructorsResult(null);
+
+ internal GenerateDefaultConstructorsResult(CodeRefactoring codeRefactoring)
+ : base(codeRefactoring)
+ {
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateEnumMember/AbstractGenerateEnumMemberService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateEnumMember/AbstractGenerateEnumMemberService.cs
new file mode 100644
index 0000000000..de1dbd97c7
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateEnumMember/AbstractGenerateEnumMemberService.cs
@@ -0,0 +1,238 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.Internal.Log;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp.CodeGeneration;
+using Microsoft.CodeAnalysis.Editing;
+using Microsoft.CodeAnalysis.FindSymbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateEnumMember
+{
+ abstract class AbstractGenerateEnumMemberService<TService, TSimpleNameSyntax, TExpressionSyntax> :
+ AbstractGenerateMemberService<TSimpleNameSyntax, TExpressionSyntax>
+ where TService : AbstractGenerateEnumMemberService<TService, TSimpleNameSyntax, TExpressionSyntax>
+ where TSimpleNameSyntax : TExpressionSyntax
+ where TExpressionSyntax : SyntaxNode
+ {
+ protected AbstractGenerateEnumMemberService()
+ {
+ }
+
+ protected abstract bool IsIdentifierNameGeneration(SyntaxNode node);
+ protected abstract bool TryInitializeIdentifierNameState(SemanticDocument document, TSimpleNameSyntax identifierName, CancellationToken cancellationToken, out SyntaxToken identifierToken, out TExpressionSyntax simpleNameOrMemberAccessExpression);
+
+ public async Task<IEnumerable<CodeAction>> GenerateEnumMemberAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ var semanticDocument = await SemanticDocument.CreateAsync(document, cancellationToken).ConfigureAwait(false);
+ var state = await State.GenerateAsync((TService)this, semanticDocument, node, cancellationToken).ConfigureAwait(false);
+ if (state == null)
+ {
+ return SpecializedCollections.EmptyEnumerable<CodeAction>();
+ }
+
+ return GetActions(document, state);
+ }
+
+ private IEnumerable<CodeAction> GetActions(Document document, State state)
+ {
+ yield return new GenerateEnumMemberCodeAction((TService)this, document, state);
+ }
+
+ private partial class GenerateEnumMemberCodeAction : CodeAction
+ {
+ private readonly Document _document;
+ private readonly State _state;
+
+ public GenerateEnumMemberCodeAction(
+ TService service,
+ Document document,
+ State state)
+ {
+ _document = document;
+ _state = state;
+ }
+
+ protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
+ {
+
+ var value = _state.TypeToGenerateIn.LastEnumValueHasInitializer()
+ ? EnumValueUtilities.GetNextEnumValue(_state.TypeToGenerateIn, cancellationToken)
+ : null;
+
+ var result = await new CSharpCodeGenerationService (_document.Project.Solution.Workspace).AddFieldAsync(
+ _document.Project.Solution,
+ _state.TypeToGenerateIn,
+ CodeGenerationSymbolFactory.CreateFieldSymbol(
+ attributes: null,
+ accessibility: Accessibility.Public,
+ modifiers: default(DeclarationModifiers),
+ type: _state.TypeToGenerateIn,
+ name: _state.IdentifierToken.ValueText,
+ hasConstantValue: value != null,
+ constantValue: value),
+ new CodeGenerationOptions(contextLocation: _state.IdentifierToken.GetLocation(), generateDefaultAccessibility: false),
+ cancellationToken)
+ .ConfigureAwait(false);
+
+ return result;
+ }
+
+ public override string Title
+ {
+ get
+ {
+ var text = Resources.GenerateEnumMemberIn;
+
+ return string.Format(
+ text,
+ _state.IdentifierToken.ValueText,
+ _state.TypeToGenerateIn.Name);
+ }
+ }
+ }
+
+
+ private partial class State
+ {
+ // public TypeDeclarationSyntax ContainingTypeDeclaration { get; private set; }
+ public INamedTypeSymbol TypeToGenerateIn { get; private set; }
+
+ // Just the name of the method. i.e. "Foo" in "Foo" or "X.Foo"
+ public SyntaxToken IdentifierToken { get; private set; }
+ public TSimpleNameSyntax SimpleName { get; private set; }
+ public TExpressionSyntax SimpleNameOrMemberAccessExpression { get; private set; }
+
+ public static async Task<State> GenerateAsync(
+ TService service,
+ SemanticDocument document,
+ SyntaxNode node,
+ CancellationToken cancellationToken)
+ {
+ var state = new State();
+ if (!await state.TryInitializeAsync(service, document, node, cancellationToken).ConfigureAwait(false))
+ {
+ return null;
+ }
+
+ return state;
+ }
+
+ private async Task<bool> TryInitializeAsync(
+ TService service,
+ SemanticDocument document,
+ SyntaxNode node,
+ CancellationToken cancellationToken)
+ {
+ if (service.IsIdentifierNameGeneration(node))
+ {
+ if (!TryInitializeIdentifierName(service, document, (TSimpleNameSyntax)node, cancellationToken))
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+
+ // Ok. It either didn't bind to any symbols, or it bound to a symbol but with
+ // errors. In the former case we definitely want to offer to generate a field. In
+ // the latter case, we want to generate a field *unless* there's an existing member
+ // with the same name. Note: it's ok if there's an existing field with the same
+ // name.
+ var existingMembers = this.TypeToGenerateIn.GetMembers(this.IdentifierToken.ValueText);
+ if (existingMembers.Any())
+ {
+ // TODO: Code coverage There was an existing member that the new member would
+ // clash with.
+ return false;
+ }
+
+ cancellationToken.ThrowIfCancellationRequested();
+ this.TypeToGenerateIn = await SymbolFinder.FindSourceDefinitionAsync(this.TypeToGenerateIn, document.Project.Solution, cancellationToken).ConfigureAwait(false) as INamedTypeSymbol;
+ if (!service.ValidateTypeToGenerateIn(
+ document.Project.Solution, this.TypeToGenerateIn, true, EnumType, cancellationToken))
+ {
+ return false;
+ }
+
+ return CodeGenerator.CanAdd(document.Project.Solution, this.TypeToGenerateIn, cancellationToken);
+ }
+
+ private bool TryInitializeIdentifierName(
+ TService service,
+ SemanticDocument document,
+ TSimpleNameSyntax identifierName,
+ CancellationToken cancellationToken)
+ {
+ this.SimpleName = identifierName;
+
+ SyntaxToken identifierToken;
+ TExpressionSyntax simpleNameOrMemberAccessExpression;
+ if (!service.TryInitializeIdentifierNameState(document, identifierName, cancellationToken,
+ out identifierToken, out simpleNameOrMemberAccessExpression))
+ {
+ return false;
+ }
+
+ this.IdentifierToken = identifierToken;
+ this.SimpleNameOrMemberAccessExpression = simpleNameOrMemberAccessExpression;
+
+ var semanticModel = document.SemanticModel;
+ if ((simpleNameOrMemberAccessExpression as ExpressionSyntax).IsWrittenTo() ||
+ simpleNameOrMemberAccessExpression.IsInNamespaceOrTypeContext())
+ {
+ return false;
+ }
+
+ // Now, try to bind the invocation and see if it succeeds or not. if it succeeds and
+ // binds uniquely, then we don't need to offer this quick fix.
+ cancellationToken.ThrowIfCancellationRequested();
+ var containingType = semanticModel.GetEnclosingNamedType(identifierToken.SpanStart, cancellationToken);
+ if (containingType == null)
+ {
+ return false;
+ }
+
+ var semanticInfo = semanticModel.GetSymbolInfo(this.SimpleNameOrMemberAccessExpression, cancellationToken);
+ if (cancellationToken.IsCancellationRequested)
+ {
+ return false;
+ }
+
+ if (semanticInfo.Symbol != null)
+ {
+ return false;
+ }
+
+ // Either we found no matches, or this was ambiguous. Either way, we might be able
+ // to generate a method here. Determine where the user wants to generate the method
+ // into, and if it's valid then proceed.
+ INamedTypeSymbol typeToGenerateIn;
+ bool isStatic;
+ if (!service.TryDetermineTypeToGenerateIn(
+ document, containingType, simpleNameOrMemberAccessExpression, cancellationToken,
+ out typeToGenerateIn, out isStatic))
+ {
+ return false;
+ }
+
+ if (!isStatic)
+ {
+ return false;
+ }
+
+ this.TypeToGenerateIn = typeToGenerateIn;
+ return true;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateEnumMember/CSharpGenerateEnumMemberService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateEnumMember/CSharpGenerateEnumMemberService.cs
new file mode 100644
index 0000000000..61b2b19cf3
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateEnumMember/CSharpGenerateEnumMemberService.cs
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Composition;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateEnumMember
+{
+ partial class CSharpGenerateEnumMemberService :
+ AbstractGenerateEnumMemberService<CSharpGenerateEnumMemberService, SimpleNameSyntax, ExpressionSyntax>
+ {
+ protected override bool IsIdentifierNameGeneration(SyntaxNode node)
+ {
+ return node is IdentifierNameSyntax;
+ }
+
+ protected override bool TryInitializeIdentifierNameState(
+ SemanticDocument document, SimpleNameSyntax identifierName, CancellationToken cancellationToken,
+ out SyntaxToken identifierToken, out ExpressionSyntax simpleNameOrMemberAccessExpression)
+ {
+ identifierToken = identifierName.Identifier;
+ if (identifierToken.ValueText != string.Empty &&
+ !identifierName.IsVar)
+ {
+ var memberAccess = identifierName.Parent as MemberAccessExpressionSyntax;
+ simpleNameOrMemberAccessExpression = memberAccess != null && memberAccess.Name == identifierName
+ ? (ExpressionSyntax)memberAccess
+ : identifierName;
+
+ // If we're being invoked, then don't offer this, offer generate method instead.
+ // Note: we could offer to generate a field with a delegate type. However, that's
+ // very esoteric and probably not what most users want.
+ if (simpleNameOrMemberAccessExpression.IsParentKind(SyntaxKind.InvocationExpression) ||
+ simpleNameOrMemberAccessExpression.IsParentKind(SyntaxKind.ObjectCreationExpression) ||
+ simpleNameOrMemberAccessExpression.IsParentKind(SyntaxKind.GotoStatement) ||
+ simpleNameOrMemberAccessExpression.IsParentKind(SyntaxKind.AliasQualifiedName))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ identifierToken = default(SyntaxToken);
+ simpleNameOrMemberAccessExpression = null;
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/AbstractGenerateConversionService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/AbstractGenerateConversionService.cs
new file mode 100644
index 0000000000..85bb3d5ddb
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/AbstractGenerateConversionService.cs
@@ -0,0 +1,136 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.Internal.Log;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateParameterizedMember
+{
+ abstract partial class AbstractGenerateConversionService<TService, TSimpleNameSyntax, TExpressionSyntax, TInvocationExpressionSyntax> :
+ AbstractGenerateParameterizedMemberService<TService, TSimpleNameSyntax, TExpressionSyntax, TInvocationExpressionSyntax>
+ where TService : AbstractGenerateConversionService<TService, TSimpleNameSyntax, TExpressionSyntax, TInvocationExpressionSyntax>
+ where TSimpleNameSyntax : TExpressionSyntax
+ where TExpressionSyntax : SyntaxNode
+ where TInvocationExpressionSyntax : TExpressionSyntax
+ {
+ protected abstract bool IsImplicitConversionGeneration(SyntaxNode node);
+ protected abstract bool IsExplicitConversionGeneration(SyntaxNode node);
+ protected abstract bool TryInitializeImplicitConversionState(SemanticDocument document, SyntaxNode expression, ISet<TypeKind> classInterfaceModuleStructTypes, CancellationToken cancellationToken, out SyntaxToken identifierToken, out IMethodSymbol methodSymbol, out INamedTypeSymbol typeToGenerateIn);
+ protected abstract bool TryInitializeExplicitConversionState(SemanticDocument document, SyntaxNode expression, ISet<TypeKind> classInterfaceModuleStructTypes, CancellationToken cancellationToken, out SyntaxToken identifierToken, out IMethodSymbol methodSymbol, out INamedTypeSymbol typeToGenerateIn);
+
+ public async Task<IEnumerable<CodeAction>> GenerateConversionAsync(
+ Document document,
+ SyntaxNode node,
+ CancellationToken cancellationToken)
+ {
+ var semanticDocument = await SemanticDocument.CreateAsync(document, cancellationToken).ConfigureAwait(false);
+ var state = await State.GenerateConversionStateAsync((TService)this, semanticDocument, node, cancellationToken).ConfigureAwait(false);
+ if (state == null)
+ {
+ return SpecializedCollections.EmptyEnumerable<CodeAction>();
+ }
+
+ return GetActions(document, state, cancellationToken);
+ }
+
+ protected new class State : AbstractGenerateParameterizedMemberService<TService, TSimpleNameSyntax, TExpressionSyntax, TInvocationExpressionSyntax>.State
+ {
+ public static async Task<State> GenerateConversionStateAsync(
+ TService service,
+ SemanticDocument document,
+ SyntaxNode interfaceNode,
+ CancellationToken cancellationToken)
+ {
+ var state = new State();
+ if (!await state.TryInitializeConversionAsync(service, document, interfaceNode, cancellationToken).ConfigureAwait(false))
+ {
+ return null;
+ }
+
+ return state;
+ }
+
+ private Task<bool> TryInitializeConversionAsync(
+ TService service,
+ SemanticDocument document,
+ SyntaxNode node,
+ CancellationToken cancellationToken)
+ {
+ if (service.IsImplicitConversionGeneration(node))
+ {
+ if (!TryInitializeImplicitConversion(service, document, node, cancellationToken))
+ {
+ return Task.FromResult (false);
+ }
+ }
+ else if (service.IsExplicitConversionGeneration(node))
+ {
+ if (!TryInitializeExplicitConversion(service, document, node, cancellationToken))
+ {
+ return Task.FromResult (false);
+ }
+ }
+
+ return TryFinishInitializingState(service, document, cancellationToken);
+ }
+
+ private bool TryInitializeExplicitConversion(TService service, SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ MethodKind = MethodKind.Conversion;
+ SyntaxToken identifierToken;
+ IMethodSymbol methodSymbol;
+ INamedTypeSymbol typeToGenerateIn;
+ if (!service.TryInitializeExplicitConversionState(
+ document, node, ClassInterfaceModuleStructTypes, cancellationToken,
+ out identifierToken, out methodSymbol, out typeToGenerateIn))
+ {
+ return false;
+ }
+
+ this.ContainingType = document.SemanticModel.GetEnclosingNamedType(node.SpanStart, cancellationToken);
+ if (ContainingType == null)
+ {
+ return false;
+ }
+
+ this.IdentifierToken = identifierToken;
+ this.TypeToGenerateIn = typeToGenerateIn;
+ this.SignatureInfo = new MethodSignatureInfo(document, this, methodSymbol);
+ this.location = node.GetLocation();
+ this.MethodGenerationKind = MethodGenerationKind.ExplicitConversion;
+ return true;
+ }
+
+ private bool TryInitializeImplicitConversion(TService service, SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ MethodKind = MethodKind.Conversion;
+ SyntaxToken identifierToken;
+ IMethodSymbol methodSymbol;
+ INamedTypeSymbol typeToGenerateIn;
+ if (!service.TryInitializeImplicitConversionState(
+ document, node, ClassInterfaceModuleStructTypes, cancellationToken,
+ out identifierToken, out methodSymbol, out typeToGenerateIn))
+ {
+ return false;
+ }
+
+ this.ContainingType = document.SemanticModel.GetEnclosingNamedType(node.SpanStart, cancellationToken);
+ if (ContainingType == null)
+ {
+ return false;
+ }
+
+ this.IdentifierToken = identifierToken;
+ this.TypeToGenerateIn = typeToGenerateIn;
+ this.SignatureInfo = new MethodSignatureInfo(document, this, methodSymbol);
+ this.MethodGenerationKind = MethodGenerationKind.ImplicitConversion;
+ return true;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/AbstractGenerateMethodService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/AbstractGenerateMethodService.cs
new file mode 100644
index 0000000000..b3d945e969
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/AbstractGenerateMethodService.cs
@@ -0,0 +1,267 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Linq;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.Internal.Log;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Editing;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateParameterizedMember
+{
+ abstract partial class AbstractGenerateMethodService<TService, TSimpleNameSyntax, TExpressionSyntax, TInvocationExpressionSyntax> :
+ AbstractGenerateParameterizedMemberService<TService, TSimpleNameSyntax, TExpressionSyntax, TInvocationExpressionSyntax>
+ where TService : AbstractGenerateMethodService<TService, TSimpleNameSyntax, TExpressionSyntax, TInvocationExpressionSyntax>
+ where TSimpleNameSyntax : TExpressionSyntax
+ where TExpressionSyntax : SyntaxNode
+ where TInvocationExpressionSyntax : TExpressionSyntax
+ {
+ protected abstract bool IsSimpleNameGeneration(SyntaxNode node);
+ protected abstract bool IsExplicitInterfaceGeneration(SyntaxNode node);
+ protected abstract bool TryInitializeExplicitInterfaceState(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken, out SyntaxToken identifierToken, out IMethodSymbol methodSymbol, out INamedTypeSymbol typeToGenerateIn);
+ protected abstract bool TryInitializeSimpleNameState(SemanticDocument document, TSimpleNameSyntax simpleName, CancellationToken cancellationToken, out SyntaxToken identifierToken, out TExpressionSyntax simpleNameOrMemberAccessExpression, out TInvocationExpressionSyntax invocationExpressionOpt, out bool isInConditionalExpression);
+ protected abstract ITypeSymbol CanGenerateMethodForSimpleNameOrMemberAccessExpression(SemanticModel semanticModel, TExpressionSyntax expresion, CancellationToken cancellationToken);
+
+ public async Task<IEnumerable<CodeAction>> GenerateMethodAsync(
+ Document document,
+ SyntaxNode node,
+ CancellationToken cancellationToken)
+ {
+ var semanticDocument = await SemanticDocument.CreateAsync(document, cancellationToken).ConfigureAwait(false);
+ var state = await State.GenerateMethodStateAsync((TService)this, semanticDocument, node, cancellationToken).ConfigureAwait(false);
+ if (state == null)
+ {
+ return SpecializedCollections.EmptyEnumerable<CodeAction>();
+ }
+
+ return GetActions(document, state, cancellationToken);
+ }
+
+ internal protected new class State : AbstractGenerateParameterizedMemberService<TService, TSimpleNameSyntax, TExpressionSyntax, TInvocationExpressionSyntax>.State
+ {
+ public static async Task<State> GenerateMethodStateAsync(
+ TService service,
+ SemanticDocument document,
+ SyntaxNode interfaceNode,
+ CancellationToken cancellationToken)
+ {
+ var state = new State();
+ if (!await state.TryInitializeMethodAsync(service, document, interfaceNode, cancellationToken).ConfigureAwait(false))
+ {
+ return null;
+ }
+
+ return state;
+ }
+
+ private Task<bool> TryInitializeMethodAsync(
+ TService service,
+ SemanticDocument document,
+ SyntaxNode node,
+ CancellationToken cancellationToken)
+ {
+ // Cases that we deal with currently:
+ //
+ // 1) expr.Foo
+ // 2) expr->Foo
+ // 3) Foo
+ // 4) expr.Foo()
+ // 5) expr->Foo()
+ // 6) Foo()
+ // 7) ReturnType Explicit.Interface.Foo()
+ //
+ // In the first 3 invocationExpressionOpt will be null and we'll have to infer a
+ // delegate type in order to figure out the right method signature to generate. In
+ // the next 3 invocationExpressionOpt will be non null and will be used to figure
+ // out the types/name of the parameters to generate. In the last one, we're going to
+ // generate into an interface.
+ if (service.IsExplicitInterfaceGeneration(node))
+ {
+ if (!TryInitializeExplicitInterface(service, document, node, cancellationToken))
+ {
+ return Task.FromResult (false);
+ }
+ }
+ else if (service.IsSimpleNameGeneration(node))
+ {
+ if (!TryInitializeSimpleName(service, document, (TSimpleNameSyntax)node, cancellationToken))
+ {
+ return Task.FromResult (false);
+ }
+ }
+
+ return TryFinishInitializingState(service, document, cancellationToken);
+ }
+
+ private bool TryInitializeExplicitInterface(
+ TService service,
+ SemanticDocument document,
+ SyntaxNode methodDeclaration,
+ CancellationToken cancellationToken)
+ {
+ MethodKind = MethodKind.Ordinary;
+ SyntaxToken identifierToken;
+ IMethodSymbol methodSymbol;
+ INamedTypeSymbol typeToGenerateIn;
+ if (!service.TryInitializeExplicitInterfaceState(
+ document, methodDeclaration, cancellationToken,
+ out identifierToken, out methodSymbol, out typeToGenerateIn))
+ {
+ return false;
+ }
+
+ if (methodSymbol.ExplicitInterfaceImplementations.Any())
+ {
+ return false;
+ }
+
+ this.IdentifierToken = identifierToken;
+ this.TypeToGenerateIn = typeToGenerateIn;
+
+ cancellationToken.ThrowIfCancellationRequested();
+ var semanticModel = document.SemanticModel;
+ this.ContainingType = semanticModel.GetEnclosingNamedType(methodDeclaration.SpanStart, cancellationToken);
+ if (this.ContainingType == null)
+ {
+ return false;
+ }
+
+ if (!this.ContainingType.Interfaces.Contains(this.TypeToGenerateIn))
+ {
+ return false;
+ }
+
+ this.SignatureInfo = new MethodSignatureInfo(document, this, methodSymbol);
+ return true;
+ }
+
+ private bool TryInitializeSimpleName(
+ TService service,
+ SemanticDocument document,
+ TSimpleNameSyntax simpleName,
+ CancellationToken cancellationToken)
+ {
+ MethodKind = MethodKind.Ordinary;
+ this.SimpleNameOpt = simpleName;
+
+ SyntaxToken identifierToken;
+ TExpressionSyntax simpleNameOrMemberAccessExpression;
+ TInvocationExpressionSyntax invocationExpressionOpt;
+ bool isInConditionalExpression;
+ if (!service.TryInitializeSimpleNameState(
+ document, simpleName, cancellationToken,
+ out identifierToken, out simpleNameOrMemberAccessExpression, out invocationExpressionOpt, out isInConditionalExpression))
+ {
+ return false;
+ }
+
+ this.IdentifierToken = identifierToken;
+ this.SimpleNameOrMemberAccessExpression = simpleNameOrMemberAccessExpression;
+ this.InvocationExpressionOpt = invocationExpressionOpt;
+ this.IsInConditionalAccessExpression = isInConditionalExpression;
+
+ if (string.IsNullOrWhiteSpace(this.IdentifierToken.ValueText))
+ {
+ return false;
+ }
+
+ // If we're not in a type, don't even bother. NOTE(cyrusn): We'll have to rethink this
+ // for C# Script.
+ cancellationToken.ThrowIfCancellationRequested();
+ var semanticModel = document.SemanticModel;
+ this.ContainingType = semanticModel.GetEnclosingNamedType(this.SimpleNameOpt.SpanStart, cancellationToken);
+ if (this.ContainingType == null)
+ {
+ return false;
+ }
+
+ if (this.InvocationExpressionOpt != null)
+ {
+ this.SignatureInfo = service.CreateInvocationMethodInfo(document, this);
+ }
+ else
+ {
+ var delegateType = TypeGuessing.typeInferenceService.InferDelegateType(semanticModel, this.SimpleNameOrMemberAccessExpression, cancellationToken);
+ if (delegateType != null && delegateType.DelegateInvokeMethod != null)
+ {
+ this.SignatureInfo = new MethodSignatureInfo(document, this, delegateType.DelegateInvokeMethod);
+ }
+ else
+ {
+ // We don't have and invocation expression or a delegate, but we may have a special expression without parenthesis. Lets see
+ // if the type inference service can directly infer the type for our expression.
+ var expressionType = service.CanGenerateMethodForSimpleNameOrMemberAccessExpression(semanticModel, this.SimpleNameOrMemberAccessExpression, cancellationToken);
+ if (expressionType == null)
+ {
+ return false;
+ }
+
+ this.SignatureInfo = new MethodSignatureInfo(document, this, CreateMethodSymbolWithReturnType(expressionType));
+ }
+ }
+
+ // Now, try to bind the invocation and see if it succeeds or not. if it succeeds and
+ // binds uniquely, then we don't need to offer this quick fix.
+ cancellationToken.ThrowIfCancellationRequested();
+
+ // If the name bound with errors, then this is a candidate for generate method.
+ var semanticInfo = semanticModel.GetSymbolInfo(this.SimpleNameOrMemberAccessExpression, cancellationToken);
+ if (semanticInfo.GetAllSymbols().Any(s => s.Kind == SymbolKind.Local || s.Kind == SymbolKind.Parameter) &&
+ !service.AreSpecialOptionsActive(semanticModel))
+ {
+ // if the name bound to something in scope then we don't want to generate the
+ // method because it will be shadowed by what's in scope. Unless we are in a
+ // special state such as Option Strict On where we want to generate fixes even
+ // if we shadow types.
+ return false;
+ }
+
+ // Check if the symbol is on the list of valid symbols for this language.
+ cancellationToken.ThrowIfCancellationRequested();
+ if (semanticInfo.Symbol != null && !service.IsValidSymbol(semanticInfo.Symbol, semanticModel))
+ {
+ return false;
+ }
+
+ // Either we found no matches, or this was ambiguous. Either way, we might be able
+ // to generate a method here. Determine where the user wants to generate the method
+ // into, and if it's valid then proceed.
+ cancellationToken.ThrowIfCancellationRequested();
+ INamedTypeSymbol typeToGenerateIn;
+ bool isStatic;
+ if (!service.TryDetermineTypeToGenerateIn(
+ document, this.ContainingType, this.SimpleNameOrMemberAccessExpression, cancellationToken,
+ out typeToGenerateIn, out isStatic))
+ {
+ return false;
+ }
+
+ var expressionSyntax = (this.InvocationExpressionOpt ?? this.SimpleNameOrMemberAccessExpression) as ExpressionSyntax;
+ this.IsWrittenTo = expressionSyntax.IsWrittenTo();
+ this.TypeToGenerateIn = typeToGenerateIn;
+ this.IsStatic = isStatic;
+ this.MethodGenerationKind = MethodGenerationKind.Member;
+ return true;
+ }
+
+ private static IMethodSymbol CreateMethodSymbolWithReturnType(ITypeSymbol expressionType)
+ {
+ return CodeGenerationSymbolFactory.CreateMethodSymbol(
+ attributes: SpecializedCollections.EmptyList<AttributeData>(),
+ accessibility: default(Accessibility),
+ modifiers: default(DeclarationModifiers),
+ returnType: expressionType,
+ explicitInterfaceSymbol: null,
+ name: null,
+ typeParameters: SpecializedCollections.EmptyList<ITypeParameterSymbol>(),
+ parameters: SpecializedCollections.EmptyList<IParameterSymbol>());
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/AbstractGenerateParameterizedMemberService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/AbstractGenerateParameterizedMemberService.cs
new file mode 100644
index 0000000000..02b8984131
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/AbstractGenerateParameterizedMemberService.cs
@@ -0,0 +1,595 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis;
+using System.Linq;
+using System;
+using System.Threading.Tasks;
+using ICSharpCode.NRefactory6.CSharp.CodeGeneration;
+using Microsoft.CodeAnalysis.Editing;
+using System.Collections.Immutable;
+using Microsoft.CodeAnalysis.FindSymbols;
+using MonoDevelop.Ide.TypeSystem;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateParameterizedMember
+{
+ abstract partial class AbstractGenerateParameterizedMemberService<TService, TSimpleNameSyntax, TExpressionSyntax, TInvocationExpressionSyntax> :
+ AbstractGenerateMemberService<TSimpleNameSyntax, TExpressionSyntax>
+ where TService : AbstractGenerateParameterizedMemberService<TService, TSimpleNameSyntax, TExpressionSyntax, TInvocationExpressionSyntax>
+ where TSimpleNameSyntax : TExpressionSyntax
+ where TExpressionSyntax : SyntaxNode
+ where TInvocationExpressionSyntax : TExpressionSyntax
+ {
+ protected AbstractGenerateParameterizedMemberService()
+ {
+ }
+
+ protected abstract AbstractInvocationInfo CreateInvocationMethodInfo(SemanticDocument document, State abstractState);
+
+ protected abstract bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel);
+ protected abstract bool AreSpecialOptionsActive(SemanticModel semanticModel);
+
+ protected virtual bool ContainingTypesOrSelfHasUnsafeKeyword(INamedTypeSymbol containingType)
+ {
+ return false;
+ }
+
+ protected virtual string GetImplicitConversionDisplayText(State state)
+ {
+ return string.Empty;
+ }
+
+ protected virtual string GetExplicitConversionDisplayText(State state)
+ {
+ return string.Empty;
+ }
+
+ protected IEnumerable<CodeAction> GetActions(Document document, State state, CancellationToken cancellationToken)
+ {
+ yield return new GenerateParameterizedMemberCodeAction((TService)this, document, state, isAbstract: false, generateProperty: false);
+
+ // If we're trying to generate an instance method into an abstract class (but not a
+ // static class or an interface), then offer to generate it abstractly.
+ var canGenerateAbstractly = state.TypeToGenerateIn.IsAbstract &&
+ !state.TypeToGenerateIn.IsStatic &&
+ state.TypeToGenerateIn.TypeKind != TypeKind.Interface &&
+ !state.IsStatic;
+
+ if (canGenerateAbstractly)
+ {
+ yield return new GenerateParameterizedMemberCodeAction((TService)this, document, state, isAbstract: true, generateProperty: false);
+ }
+
+ if (true/*semanticFacts.SupportsParameterizedProperties*/ &&
+ state.InvocationExpressionOpt != null)
+ {
+ var typeParameters = state.SignatureInfo.DetermineTypeParameters(cancellationToken);
+ var returnType = state.SignatureInfo.DetermineReturnType(cancellationToken);
+
+ if (typeParameters.Count == 0 && returnType.SpecialType != SpecialType.System_Void)
+ {
+ yield return new GenerateParameterizedMemberCodeAction((TService)this, document, state, isAbstract: false, generateProperty: true);
+
+ if (canGenerateAbstractly)
+ {
+ yield return new GenerateParameterizedMemberCodeAction((TService)this, document, state, isAbstract: true, generateProperty: true);
+ }
+ }
+ }
+ }
+ internal protected abstract class AbstractInvocationInfo : SignatureInfo
+ {
+ protected abstract bool IsIdentifierName();
+
+ protected abstract IList<ITypeParameterSymbol> GetCapturedTypeParameters(CancellationToken cancellationToken);
+ protected abstract IList<ITypeParameterSymbol> GenerateTypeParameters(CancellationToken cancellationToken);
+
+ protected AbstractInvocationInfo(SemanticDocument document, State state)
+ : base(document, state)
+ {
+ }
+
+ public override IList<ITypeParameterSymbol> DetermineTypeParameters(CancellationToken cancellationToken)
+ {
+ var typeParameters = DetermineTypeParametersWorker(cancellationToken);
+ return typeParameters.Select(tp => MassageTypeParameter(tp, cancellationToken)).ToList();
+ }
+
+ private IList<ITypeParameterSymbol> DetermineTypeParametersWorker(
+ CancellationToken cancellationToken)
+ {
+ if (IsIdentifierName())
+ {
+ // If the user wrote something like Foo(x) then we still might want to generate
+ // a generic method if the expression 'x' captured any method type variables.
+ var capturedTypeParameters = GetCapturedTypeParameters(cancellationToken);
+ var availableTypeParameters = this.State.TypeToGenerateIn.GetAllTypeParameters();
+ var result = capturedTypeParameters.Except(availableTypeParameters).ToList();
+ return result;
+ }
+ else
+ {
+ return GenerateTypeParameters(cancellationToken);
+ }
+ }
+
+ private ITypeParameterSymbol MassageTypeParameter(
+ ITypeParameterSymbol typeParameter,
+ CancellationToken cancellationToken)
+ {
+ var constraints = typeParameter.ConstraintTypes.Where(ts => !ts.IsUnexpressableTypeParameterConstraint()).ToList();
+ var classTypes = constraints.Where(ts => ts.TypeKind == TypeKind.Class).ToList();
+ var nonClassTypes = constraints.Where(ts => ts.TypeKind != TypeKind.Class).ToList();
+
+ classTypes = MergeClassTypes(classTypes, cancellationToken);
+ constraints = classTypes.Concat(nonClassTypes).ToList();
+ if (constraints.SequenceEqual(typeParameter.ConstraintTypes))
+ {
+ return typeParameter;
+ }
+
+ return CodeGenerationSymbolFactory.CreateTypeParameter(
+ attributes: null,
+ varianceKind: typeParameter.Variance,
+ name: typeParameter.Name,
+ constraintTypes: ImmutableArray.CreateRange<ITypeSymbol>(constraints),
+ hasConstructorConstraint: typeParameter.HasConstructorConstraint,
+ hasReferenceConstraint: typeParameter.HasReferenceTypeConstraint,
+ hasValueConstraint: typeParameter.HasValueTypeConstraint);
+ }
+
+ private List<ITypeSymbol> MergeClassTypes(List<ITypeSymbol> classTypes, CancellationToken cancellationToken)
+ {
+ var compilation = this.Document.SemanticModel.Compilation;
+ for (int i = classTypes.Count - 1; i >= 0; i--)
+ {
+ // For example, 'Attribute'.
+ var type1 = classTypes[i];
+
+ for (int j = 0; j < classTypes.Count; j++)
+ {
+ if (j != i)
+ {
+ // For example 'FooAttribute'.
+ var type2 = classTypes[j];
+
+ if (IsImplicitReferenceConversion(compilation, type2, type1))
+ {
+ // If there's an implicit reference conversion (i.e. from
+ // FooAttribute to Attribute), then we don't need Attribute as it's
+ // implied by the second attribute;
+ classTypes.RemoveAt(i);
+ break;
+ }
+ }
+ }
+ }
+
+ return classTypes;
+ }
+
+ protected abstract bool IsImplicitReferenceConversion(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType);
+ }
+ private partial class GenerateParameterizedMemberCodeAction : CodeAction
+ {
+ private readonly TService _service;
+ private readonly Document _document;
+ private readonly State _state;
+ private readonly bool _isAbstract;
+ private readonly bool _generateProperty;
+
+ public GenerateParameterizedMemberCodeAction(
+ TService service,
+ Document document,
+ State state,
+ bool isAbstract,
+ bool generateProperty)
+ {
+ _service = service;
+ _document = document;
+ _state = state;
+ _isAbstract = isAbstract;
+ _generateProperty = generateProperty;
+ }
+
+ private string GetDisplayText(
+ State state,
+ bool isAbstract,
+ bool generateProperty)
+ {
+ switch (state.MethodGenerationKind)
+ {
+ case MethodGenerationKind.Member:
+ var text = generateProperty ?
+ isAbstract ? Resources.GenerateAbstractProperty : Resources.GeneratePropertyIn :
+ isAbstract ? Resources.GenerateAbstractMethod : Resources.GenerateMethodIn;
+
+ var name = state.IdentifierToken.ValueText;
+ var destination = state.TypeToGenerateIn.Name;
+ return string.Format(text, name, destination);
+ case MethodGenerationKind.ImplicitConversion:
+ return _service.GetImplicitConversionDisplayText(_state);
+ case MethodGenerationKind.ExplicitConversion:
+ return _service.GetExplicitConversionDisplayText(_state);
+ default:
+ throw new InvalidOperationException();
+ }
+ }
+
+ protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
+ {
+ //var syntaxTree = await _document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
+ var syntaxFactory = _document.Project.Solution.Workspace.Services.GetLanguageServices(_state.TypeToGenerateIn.Language).GetService<SyntaxGenerator>();
+
+ if (_generateProperty)
+ {
+ var property = _state.SignatureInfo.GenerateProperty(syntaxFactory, _isAbstract, _state.IsWrittenTo, cancellationToken);
+
+ var result = await CodeGenerator.AddPropertyDeclarationAsync(
+ _document.Project.Solution,
+ _state.TypeToGenerateIn,
+ property,
+ new CodeGenerationOptions(afterThisLocation: _state.IdentifierToken.GetLocation(), generateDefaultAccessibility: false),
+ cancellationToken)
+ .ConfigureAwait(false);
+
+ return await AnnotateInsertionMode(_document.Project.Solution.GetDocument(result.Id), result);
+ }
+ else
+ {
+ var method = _state.SignatureInfo.GenerateMethod(syntaxFactory, _isAbstract, cancellationToken);
+
+ var result = await CodeGenerator.AddMethodDeclarationAsync(
+ _document.Project.Solution,
+ _state.TypeToGenerateIn,
+ method,
+ new CodeGenerationOptions(afterThisLocation: _state.Location, generateDefaultAccessibility: false),
+ cancellationToken)
+ .ConfigureAwait(false);
+
+ return await AnnotateInsertionMode(_document.Project.Solution.GetDocument(result.Id), result);
+ }
+ }
+
+ async Task<Document> AnnotateInsertionMode (Document oldDocument, Document result)
+ {
+ var newRoot = await result.GetSyntaxRootAsync ();
+ var changes = await oldDocument.GetTextChangesAsync (result);
+ foreach (var change in changes) {
+
+ var parent = newRoot.FindNode (change.Span);
+ if (parent == null || !(parent is MethodDeclarationSyntax || parent is PropertyDeclarationSyntax))
+ continue;
+ return result.WithSyntaxRoot (newRoot.ReplaceNode (parent, parent.WithAdditionalAnnotations (TypeSystemService.InsertionModeAnnotation)));
+ }
+ return result;
+ }
+
+ public override string Title
+ {
+ get
+ {
+ return GetDisplayText(_state, _isAbstract, _generateProperty);
+ }
+ }
+ }
+
+ protected class MethodSignatureInfo : SignatureInfo
+ {
+ private readonly IMethodSymbol _methodSymbol;
+
+ public MethodSignatureInfo(
+ SemanticDocument document,
+ State state,
+ IMethodSymbol methodSymbol)
+ : base(document, state)
+ {
+ _methodSymbol = methodSymbol;
+ }
+
+ protected override ITypeSymbol DetermineReturnTypeWorker(CancellationToken cancellationToken)
+ {
+ if (State.IsInConditionalAccessExpression)
+ {
+ return _methodSymbol.ReturnType.RemoveNullableIfPresent();
+ }
+
+ return _methodSymbol.ReturnType;
+ }
+
+ public override IList<ITypeParameterSymbol> DetermineTypeParameters(CancellationToken cancellationToken)
+ {
+ return _methodSymbol.TypeParameters;
+ }
+
+ protected override IList<RefKind> DetermineParameterModifiers(CancellationToken cancellationToken)
+ {
+ return _methodSymbol.Parameters.Select(p => p.RefKind).ToList();
+ }
+
+ protected override IList<bool> DetermineParameterOptionality(CancellationToken cancellationToken)
+ {
+ return _methodSymbol.Parameters.Select(p => p.IsOptional).ToList();
+ }
+
+ protected override IList<ITypeSymbol> DetermineParameterTypes(CancellationToken cancellationToken)
+ {
+ return _methodSymbol.Parameters.Select(p => p.Type).ToList();
+ }
+
+ protected override IList<string> DetermineParameterNames(CancellationToken cancellationToken)
+ {
+ return _methodSymbol.Parameters.Select(p => p.Name).ToList();
+ }
+ }
+
+ internal protected abstract class SignatureInfo
+ {
+ protected readonly SemanticDocument Document;
+ protected readonly State State;
+
+ public SignatureInfo(
+ SemanticDocument document,
+ State state)
+ {
+ this.Document = document;
+ this.State = state;
+ }
+
+ public abstract IList<ITypeParameterSymbol> DetermineTypeParameters(CancellationToken cancellationToken);
+ public ITypeSymbol DetermineReturnType(CancellationToken cancellationToken)
+ {
+ return FixType(DetermineReturnTypeWorker(cancellationToken), cancellationToken);
+ }
+
+ protected abstract ITypeSymbol DetermineReturnTypeWorker(CancellationToken cancellationToken);
+ protected abstract IList<RefKind> DetermineParameterModifiers(CancellationToken cancellationToken);
+ protected abstract IList<ITypeSymbol> DetermineParameterTypes(CancellationToken cancellationToken);
+ protected abstract IList<bool> DetermineParameterOptionality(CancellationToken cancellationToken);
+ protected abstract IList<string> DetermineParameterNames(CancellationToken cancellationToken);
+
+ internal IPropertySymbol GenerateProperty(
+ SyntaxGenerator factory,
+ bool isAbstract, bool includeSetter,
+ CancellationToken cancellationToken)
+ {
+ var accessibility = DetermineAccessibility(isAbstract);
+ var getMethod = CodeGenerationSymbolFactory.CreateAccessorSymbol(
+ attributes: null,
+ accessibility: accessibility,
+ statements: GenerateStatements(factory, isAbstract, cancellationToken));
+
+ var setMethod = includeSetter ? getMethod : null;
+
+ return CodeGenerationSymbolFactory.CreatePropertySymbol(
+ attributes: null,
+ accessibility: accessibility,
+ modifiers: DeclarationModifiers.None.WithIsStatic(State.IsStatic).WithIsAbstract (isAbstract),
+ type: DetermineReturnType(cancellationToken),
+ explicitInterfaceSymbol: null,
+ name: this.State.IdentifierToken.ValueText,
+ parameters: DetermineParameters(cancellationToken),
+ getMethod: getMethod,
+ setMethod: setMethod);
+ }
+
+ public IMethodSymbol GenerateMethod(
+ SyntaxGenerator factory,
+ bool isAbstract,
+ CancellationToken cancellationToken)
+ {
+ var parameters = DetermineParameters(cancellationToken);
+ var returnType = DetermineReturnType(cancellationToken);
+ var isUnsafe = (parameters
+ .Any(p => p.Type.IsUnsafe()) || returnType.IsUnsafe()) &&
+ !State.IsContainedInUnsafeType;
+ var method = CodeGenerationSymbolFactory.CreateMethodSymbol(
+ attributes: null,
+ accessibility: DetermineAccessibility(isAbstract),
+ modifiers: DeclarationModifiers.None.WithIsStatic(State.IsStatic).WithIsAbstract (isAbstract).WithIsUnsafe (isUnsafe),
+ returnType: returnType,
+ explicitInterfaceSymbol: null,
+ name: this.State.IdentifierToken.ValueText,
+ typeParameters: DetermineTypeParameters(cancellationToken),
+ parameters: parameters,
+ statements: GenerateStatements(factory, isAbstract, cancellationToken),
+ handlesExpressions: null,
+ returnTypeAttributes: null,
+ methodKind: State.MethodKind);
+
+ // Ensure no conflicts between type parameter names and parameter names.
+ //var languageServiceProvider = this.Document.Project.Solution.Workspace.Services.GetLanguageServices(this.State.TypeToGenerateIn.Language);
+
+ var equalityComparer = StringComparer.Ordinal;
+ var reservedParameterNames = this.DetermineParameterNames(cancellationToken).ToSet(equalityComparer);
+ var newTypeParameterNames = NameGenerator.EnsureUniqueness(
+ method.TypeParameters.Select(t => t.Name).ToList(), n => !reservedParameterNames.Contains(n));
+
+ return method.RenameTypeParameters(newTypeParameterNames);
+ }
+
+ private ITypeSymbol FixType(
+ ITypeSymbol typeSymbol,
+ CancellationToken cancellationToken)
+ {
+ // A type can't refer to a type parameter that isn't available in the type we're
+ // eventually generating into.
+ var availableMethodTypeParameters = this.DetermineTypeParameters(cancellationToken);
+ var availableTypeParameters = this.State.TypeToGenerateIn.GetAllTypeParameters();
+
+ var compilation = this.Document.SemanticModel.Compilation;
+ var allTypeParameters = availableMethodTypeParameters.Concat(availableTypeParameters);
+
+ return typeSymbol.RemoveAnonymousTypes(compilation)
+ .ReplaceTypeParametersBasedOnTypeConstraints(compilation, allTypeParameters, this.Document.Document.Project.Solution, cancellationToken)
+ .RemoveUnavailableTypeParameters(compilation, allTypeParameters)
+ .RemoveUnnamedErrorTypes(compilation);
+ }
+
+ private IList<SyntaxNode> GenerateStatements(
+ SyntaxGenerator factory,
+ bool isAbstract,
+ CancellationToken cancellationToken)
+ {
+ var throwStatement = CodeGenerationHelpers.GenerateThrowStatement(factory, this.Document, "System.NotImplementedException", cancellationToken);
+
+ return isAbstract || State.TypeToGenerateIn.TypeKind == TypeKind.Interface || throwStatement == null
+ ? null
+ : new[] { throwStatement };
+ }
+
+ private IList<IParameterSymbol> DetermineParameters(CancellationToken cancellationToken)
+ {
+ var modifiers = DetermineParameterModifiers(cancellationToken);
+ var types = DetermineParameterTypes(cancellationToken).Select(t => FixType(t, cancellationToken)).ToList();
+ var optionality = DetermineParameterOptionality(cancellationToken);
+ var names = DetermineParameterNames(cancellationToken);
+
+ var result = new List<IParameterSymbol>();
+ for (var i = 0; i < modifiers.Count; i++)
+ {
+ result.Add(CodeGenerationSymbolFactory.CreateParameterSymbol(
+ attributes: null,
+ refKind: modifiers[i],
+ isParams: false,
+ isOptional: optionality[i],
+ type: types[i],
+ name: names[i]));
+ }
+
+ return result;
+ }
+
+ private Accessibility DetermineAccessibility(bool isAbstract)
+ {
+ var containingType = this.State.ContainingType;
+
+ // If we're generating into an interface, then we don't use any modifiers.
+ if (State.TypeToGenerateIn.TypeKind != TypeKind.Interface)
+ {
+ // Otherwise, figure out what accessibility modifier to use and optionally
+ // mark it as static.
+ if (containingType.IsContainedWithin(State.TypeToGenerateIn) && !isAbstract)
+ {
+ return Accessibility.Private;
+ }
+ else if (DerivesFrom(containingType) && State.IsStatic)
+ {
+ // NOTE(cyrusn): We only generate protected in the case of statics. Consider
+ // the case where we're generating into one of our base types. i.e.:
+ //
+ // class B : A { void Foo() { A a; a.Foo(); }
+ //
+ // In this case we can *not* mark the method as protected. 'B' can only
+ // access protected members of 'A' through an instance of 'B' (or a subclass
+ // of B). It can not access protected members through an instance of the
+ // superclass. In this case we need to make the method public or internal.
+ //
+ // However, this does not apply if the method will be static. i.e.
+ //
+ // class B : A { void Foo() { A.Foo(); }
+ //
+ // B can access the protected statics of A, and so we generate 'Foo' as
+ // protected.
+
+ // TODO: Code coverage
+ return Accessibility.Protected;
+ }
+ else if (containingType.ContainingAssembly.IsSameAssemblyOrHasFriendAccessTo(State.TypeToGenerateIn.ContainingAssembly))
+ {
+ return Accessibility.Internal;
+ }
+ else
+ {
+ // TODO: Code coverage
+ return Accessibility.Public;
+ }
+ }
+
+ return Accessibility.NotApplicable;
+ }
+
+ private bool DerivesFrom(INamedTypeSymbol containingType)
+ {
+ return containingType.GetBaseTypes().Select(t => t.OriginalDefinition)
+ .OfType<INamedTypeSymbol>()
+ .Contains(State.TypeToGenerateIn);
+ }
+ }
+
+ internal protected abstract class State
+ {
+ public INamedTypeSymbol ContainingType { get; protected set; }
+ public INamedTypeSymbol TypeToGenerateIn { get; protected set; }
+ public bool IsStatic { get; protected set; }
+ public bool IsContainedInUnsafeType { get; protected set; }
+
+ // Just the name of the method. i.e. "Foo" in "X.Foo" or "X.Foo()"
+ public SyntaxToken IdentifierToken { get; protected set; }
+ public TSimpleNameSyntax SimpleNameOpt { get; protected set; }
+
+ // The entire expression containing the name, not including the invocation. i.e. "X.Foo"
+ // in "X.Foo()".
+ public TExpressionSyntax SimpleNameOrMemberAccessExpression { get; protected set; }
+ public TInvocationExpressionSyntax InvocationExpressionOpt { get; protected set; }
+ public bool IsInConditionalAccessExpression { get; protected set; }
+
+ public bool IsWrittenTo { get; protected set; }
+
+ public SignatureInfo SignatureInfo { get; protected set; }
+ public MethodKind MethodKind { get; internal set; }
+ public MethodGenerationKind MethodGenerationKind { get; protected set; }
+ protected Location location = null;
+ public Location Location
+ {
+ get
+ {
+ if (IdentifierToken.SyntaxTree != null)
+ {
+ return IdentifierToken.GetLocation();
+ }
+
+ return location;
+ }
+ }
+
+ protected async Task<bool> TryFinishInitializingState(TService service, SemanticDocument document, CancellationToken cancellationToken)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ this.TypeToGenerateIn = await SymbolFinder.FindSourceDefinitionAsync(this.TypeToGenerateIn, document.Project.Solution, cancellationToken).ConfigureAwait(false) as INamedTypeSymbol;
+ if (this.TypeToGenerateIn.IsErrorType())
+ {
+ return false;
+ }
+
+ if (!service.ValidateTypeToGenerateIn(document.Project.Solution, this.TypeToGenerateIn,
+ this.IsStatic, ClassInterfaceModuleStructTypes, cancellationToken))
+ {
+ return false;
+ }
+
+ if (!new CSharpCodeGenerationService(document.Project.Solution.Workspace).CanAddTo(this.TypeToGenerateIn, document.Project.Solution, cancellationToken))
+ {
+ return false;
+ }
+
+ // Ok. It either didn't bind to any symbols, or it bound to a symbol but with
+ // errors. In the former case we definitely want to offer to generate a method. In
+ // the latter case, we want to generate a method *unless* there's an existing method
+ // with the same signature.
+ var existingMethods = this.TypeToGenerateIn.GetMembers(this.IdentifierToken.ValueText)
+ .OfType<IMethodSymbol>();
+
+ var destinationProvider = document.Project.Solution.Workspace.Services.GetLanguageServices(this.TypeToGenerateIn.Language);
+ var syntaxFactory = destinationProvider.GetService<SyntaxGenerator>();
+ this.IsContainedInUnsafeType = service.ContainingTypesOrSelfHasUnsafeKeyword(this.TypeToGenerateIn);
+ var generatedMethod = this.SignatureInfo.GenerateMethod(syntaxFactory, false, cancellationToken);
+ return !existingMethods.Any(m => SignatureComparer.HaveSameSignature(m, generatedMethod, caseSensitive: true, compareParameterName: true, isParameterCaseSensitive: true));
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/CSharpCommonGenerationServiceMethods.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/CSharpCommonGenerationServiceMethods.cs
new file mode 100644
index 0000000000..1f9a4ae970
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/CSharpCommonGenerationServiceMethods.cs
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Composition;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.FindSymbols;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Shared.Utilities;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateParameterizedMember
+{
+ internal static class CSharpCommonGenerationServiceMethods
+ {
+ public static bool AreSpecialOptionsActive(SemanticModel semanticModel)
+ {
+ return false;
+ }
+
+ public static bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel)
+ {
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/CSharpGenerateConversionService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/CSharpGenerateConversionService.cs
new file mode 100644
index 0000000000..ecf4076cea
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/CSharpGenerateConversionService.cs
@@ -0,0 +1,233 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Composition;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Editing;
+using Microsoft.CodeAnalysis.FindSymbols;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateParameterizedMember
+{
+ partial class CSharpGenerateConversionService :
+ AbstractGenerateConversionService<CSharpGenerateConversionService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>
+ {
+ protected override bool IsImplicitConversionGeneration(SyntaxNode node)
+ {
+ return node is ExpressionSyntax &&
+ (node.Parent is AssignmentExpressionSyntax || node.Parent is EqualsValueClauseSyntax) &&
+ !(node is CastExpressionSyntax) &&
+ !(node is MemberAccessExpressionSyntax);
+ }
+
+ protected override bool IsExplicitConversionGeneration(SyntaxNode node)
+ {
+ return node is CastExpressionSyntax;
+ }
+
+ protected override bool ContainingTypesOrSelfHasUnsafeKeyword(INamedTypeSymbol containingType)
+ {
+ return containingType.ContainingTypesOrSelfHasUnsafeKeyword();
+ }
+
+ protected override AbstractInvocationInfo CreateInvocationMethodInfo(SemanticDocument document, AbstractGenerateParameterizedMemberService<CSharpGenerateConversionService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>.State state)
+ {
+ return new CSharpGenerateParameterizedMemberService<CSharpGenerateConversionService>.InvocationExpressionInfo(document, state);
+ }
+
+ protected override bool AreSpecialOptionsActive(SemanticModel semanticModel)
+ {
+ return CSharpCommonGenerationServiceMethods.AreSpecialOptionsActive(semanticModel);
+ }
+
+ protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel)
+ {
+ return CSharpCommonGenerationServiceMethods.IsValidSymbol(symbol, semanticModel);
+ }
+
+ protected override bool TryInitializeImplicitConversionState(
+ SemanticDocument document,
+ SyntaxNode expression,
+ ISet<TypeKind> classInterfaceModuleStructTypes,
+ CancellationToken cancellationToken,
+ out SyntaxToken identifierToken,
+ out IMethodSymbol methodSymbol,
+ out INamedTypeSymbol typeToGenerateIn)
+ {
+ if (TryGetConversionMethodAndTypeToGenerateIn(document, expression, classInterfaceModuleStructTypes, cancellationToken, out methodSymbol, out typeToGenerateIn))
+ {
+ identifierToken = SyntaxFactory.Token(
+ default(SyntaxTriviaList),
+ SyntaxKind.ImplicitKeyword,
+ WellKnownMemberNames.ImplicitConversionName,
+ WellKnownMemberNames.ImplicitConversionName,
+ default(SyntaxTriviaList));
+ return true;
+ }
+
+ identifierToken = default(SyntaxToken);
+ methodSymbol = null;
+ typeToGenerateIn = null;
+ return false;
+ }
+
+ protected override bool TryInitializeExplicitConversionState(
+ SemanticDocument document,
+ SyntaxNode expression,
+ ISet<TypeKind> classInterfaceModuleStructTypes,
+ CancellationToken cancellationToken,
+ out SyntaxToken identifierToken,
+ out IMethodSymbol methodSymbol,
+ out INamedTypeSymbol typeToGenerateIn)
+ {
+ if (TryGetConversionMethodAndTypeToGenerateIn(document, expression, classInterfaceModuleStructTypes, cancellationToken, out methodSymbol, out typeToGenerateIn))
+ {
+ identifierToken = SyntaxFactory.Token(
+ default(SyntaxTriviaList),
+ SyntaxKind.ImplicitKeyword,
+ WellKnownMemberNames.ExplicitConversionName,
+ WellKnownMemberNames.ExplicitConversionName,
+ default(SyntaxTriviaList));
+ return true;
+ }
+
+ identifierToken = default(SyntaxToken);
+ methodSymbol = null;
+ typeToGenerateIn = null;
+ return false;
+ }
+
+ private bool TryGetConversionMethodAndTypeToGenerateIn(
+ SemanticDocument document,
+ SyntaxNode expression,
+ ISet<TypeKind> classInterfaceModuleStructTypes,
+ CancellationToken cancellationToken,
+ out IMethodSymbol methodSymbol,
+ out INamedTypeSymbol typeToGenerateIn)
+ {
+ var castExpression = expression as CastExpressionSyntax;
+ if (castExpression != null)
+ {
+ return TryGetExplicitConversionMethodAndTypeToGenerateIn(
+ document,
+ castExpression,
+ classInterfaceModuleStructTypes,
+ cancellationToken,
+ out methodSymbol,
+ out typeToGenerateIn);
+ }
+
+ return TryGetImplicitConversionMethodAndTypeToGenerateIn(
+ document,
+ expression,
+ classInterfaceModuleStructTypes,
+ cancellationToken,
+ out methodSymbol,
+ out typeToGenerateIn);
+ }
+
+ private bool TryGetExplicitConversionMethodAndTypeToGenerateIn(
+ SemanticDocument document,
+ CastExpressionSyntax castExpression,
+ ISet<TypeKind> classInterfaceModuleStructTypes,
+ CancellationToken cancellationToken,
+ out IMethodSymbol methodSymbol,
+ out INamedTypeSymbol typeToGenerateIn)
+ {
+ methodSymbol = null;
+ typeToGenerateIn = document.SemanticModel.GetTypeInfo(castExpression.Type, cancellationToken).Type as INamedTypeSymbol;
+ var parameterSymbol = document.SemanticModel.GetTypeInfo(castExpression.Expression, cancellationToken).Type as INamedTypeSymbol;
+ if (typeToGenerateIn == null || parameterSymbol == null || typeToGenerateIn.IsErrorType() || parameterSymbol.IsErrorType())
+ {
+ return false;
+ }
+
+ methodSymbol = GenerateMethodSymbol(typeToGenerateIn, parameterSymbol);
+
+ if (!ValidateTypeToGenerateIn(
+ document.Project.Solution,
+ typeToGenerateIn,
+ true,
+ classInterfaceModuleStructTypes,
+ cancellationToken))
+ {
+ typeToGenerateIn = parameterSymbol;
+ }
+
+ return true;
+ }
+
+ private bool TryGetImplicitConversionMethodAndTypeToGenerateIn(
+ SemanticDocument document,
+ SyntaxNode expression,
+ ISet<TypeKind> classInterfaceModuleStructTypes,
+ CancellationToken cancellationToken,
+ out IMethodSymbol methodSymbol,
+ out INamedTypeSymbol typeToGenerateIn)
+ {
+ methodSymbol = null;
+ typeToGenerateIn = document.SemanticModel.GetTypeInfo(expression, cancellationToken).ConvertedType as INamedTypeSymbol;
+ var parameterSymbol = document.SemanticModel.GetTypeInfo(expression, cancellationToken).Type as INamedTypeSymbol;
+ if (typeToGenerateIn == null || parameterSymbol == null || typeToGenerateIn.IsErrorType() || parameterSymbol.IsErrorType())
+ {
+ return false;
+ }
+
+ methodSymbol = GenerateMethodSymbol(typeToGenerateIn, parameterSymbol);
+
+ if (!ValidateTypeToGenerateIn(
+ document.Project.Solution,
+ typeToGenerateIn,
+ true,
+ classInterfaceModuleStructTypes,
+ cancellationToken))
+ {
+ typeToGenerateIn = parameterSymbol;
+ }
+
+ return true;
+ }
+
+ private static IMethodSymbol GenerateMethodSymbol(INamedTypeSymbol typeToGenerateIn, INamedTypeSymbol parameterSymbol)
+ {
+ // Remove any generic parameters
+ if (typeToGenerateIn.IsGenericType)
+ {
+ typeToGenerateIn = typeToGenerateIn.ConstructUnboundGenericType().ConstructedFrom;
+ }
+
+ return CodeGenerationSymbolFactory.CreateMethodSymbol(
+ attributes: SpecializedCollections.EmptyList<AttributeData>(),
+ accessibility: default(Accessibility),
+ modifiers: default(DeclarationModifiers),
+ returnType: typeToGenerateIn,
+ explicitInterfaceSymbol: null,
+ name: null,
+ typeParameters: SpecializedCollections.EmptyList<ITypeParameterSymbol>(),
+ parameters: new[] { CodeGenerationSymbolFactory.CreateParameterSymbol(parameterSymbol, "v") },
+ methodKind: MethodKind.Conversion);
+ }
+
+ protected override string GetImplicitConversionDisplayText(AbstractGenerateParameterizedMemberService<CSharpGenerateConversionService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>.State state)
+ {
+ return string.Format(Resources.ImplicitConversionDisplayText, state.TypeToGenerateIn.Name);
+ }
+
+ protected override string GetExplicitConversionDisplayText(AbstractGenerateParameterizedMemberService<CSharpGenerateConversionService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>.State state)
+ {
+ return string.Format(Resources.ExplicitConversionDisplayText, state.TypeToGenerateIn.Name);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/CSharpGenerateMethodService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/CSharpGenerateMethodService.cs
new file mode 100644
index 0000000000..be978c0823
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/CSharpGenerateMethodService.cs
@@ -0,0 +1,173 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Composition;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.FindSymbols;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateParameterizedMember
+{
+ partial class CSharpGenerateMethodService :
+ AbstractGenerateMethodService<CSharpGenerateMethodService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>
+ {
+ protected override bool IsExplicitInterfaceGeneration(SyntaxNode node)
+ {
+ return node is MethodDeclarationSyntax;
+ }
+
+ protected override bool IsSimpleNameGeneration(SyntaxNode node)
+ {
+ return node is SimpleNameSyntax;
+ }
+
+ protected override bool ContainingTypesOrSelfHasUnsafeKeyword(INamedTypeSymbol containingType)
+ {
+ return containingType.ContainingTypesOrSelfHasUnsafeKeyword();
+ }
+
+ protected override AbstractInvocationInfo CreateInvocationMethodInfo(SemanticDocument document, AbstractGenerateParameterizedMemberService<CSharpGenerateMethodService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>.State state)
+ {
+ return new CSharpGenerateParameterizedMemberService<CSharpGenerateMethodService>.InvocationExpressionInfo(document, state);
+ }
+
+ protected override bool AreSpecialOptionsActive(SemanticModel semanticModel)
+ {
+ return CSharpCommonGenerationServiceMethods.AreSpecialOptionsActive(semanticModel);
+ }
+
+ protected override bool IsValidSymbol(ISymbol symbol, SemanticModel semanticModel)
+ {
+ return CSharpCommonGenerationServiceMethods.IsValidSymbol(symbol, semanticModel);
+ }
+
+ protected override bool TryInitializeExplicitInterfaceState(
+ SemanticDocument document,
+ SyntaxNode node,
+ CancellationToken cancellationToken,
+ out SyntaxToken identifierToken,
+ out IMethodSymbol methodSymbol,
+ out INamedTypeSymbol typeToGenerateIn)
+ {
+ var methodDeclaration = (MethodDeclarationSyntax)node;
+ identifierToken = methodDeclaration.Identifier;
+
+ if (methodDeclaration.ExplicitInterfaceSpecifier != null &&
+ !methodDeclaration.ParameterList.OpenParenToken.IsMissing &&
+ !methodDeclaration.ParameterList.CloseParenToken.IsMissing)
+ {
+ var semanticModel = document.SemanticModel;
+ methodSymbol = semanticModel.GetDeclaredSymbol(methodDeclaration, cancellationToken) as IMethodSymbol;
+ if (methodSymbol != null && !methodSymbol.ExplicitInterfaceImplementations.Any())
+ {
+ var semanticInfo = semanticModel.GetTypeInfo(methodDeclaration.ExplicitInterfaceSpecifier.Name, cancellationToken);
+ typeToGenerateIn = semanticInfo.Type as INamedTypeSymbol;
+ return typeToGenerateIn != null;
+ }
+ }
+
+ identifierToken = default(SyntaxToken);
+ methodSymbol = null;
+ typeToGenerateIn = null;
+ return false;
+ }
+
+ protected override bool TryInitializeSimpleNameState(
+ SemanticDocument document,
+ SimpleNameSyntax simpleName,
+ CancellationToken cancellationToken,
+ out SyntaxToken identifierToken,
+ out ExpressionSyntax simpleNameOrMemberAccessExpression,
+ out InvocationExpressionSyntax invocationExpressionOpt,
+ out bool isInConditionalAccessExpression)
+ {
+ identifierToken = simpleName.Identifier;
+
+ var memberAccess = simpleName?.Parent as MemberAccessExpressionSyntax;
+ var conditionalMemberAccess = simpleName?.Parent?.Parent?.Parent as ConditionalAccessExpressionSyntax;
+ var inConditionalMemberAccess = conditionalMemberAccess != null;
+ if (memberAccess != null)
+ {
+ simpleNameOrMemberAccessExpression = (ExpressionSyntax)memberAccess;
+ }
+ else if (inConditionalMemberAccess)
+ {
+ simpleNameOrMemberAccessExpression = (ExpressionSyntax)conditionalMemberAccess;
+ }
+ else
+ {
+ simpleNameOrMemberAccessExpression = simpleName;
+ }
+
+ if (memberAccess == null || memberAccess.Name == simpleName)
+ {
+ if (simpleNameOrMemberAccessExpression.IsParentKind(SyntaxKind.InvocationExpression))
+ {
+ invocationExpressionOpt = (InvocationExpressionSyntax)simpleNameOrMemberAccessExpression.Parent;
+ isInConditionalAccessExpression = inConditionalMemberAccess;
+ return !invocationExpressionOpt.ArgumentList.CloseParenToken.IsMissing;
+ }
+ // We need to check that the tree is structured like so:
+ // ConditionalAccessExpressionSyntax
+ // -> InvocationExpressionSyntax
+ // -> MemberBindingExpressionSyntax
+ // and that the name at the end of this expression matches the simple name we were given
+ else if ((((simpleNameOrMemberAccessExpression as ConditionalAccessExpressionSyntax)
+ ?.WhenNotNull as InvocationExpressionSyntax)
+ ?.Expression as MemberBindingExpressionSyntax)
+ ?.Name == simpleName)
+ {
+ invocationExpressionOpt = (InvocationExpressionSyntax)((ConditionalAccessExpressionSyntax)simpleNameOrMemberAccessExpression).WhenNotNull;
+ isInConditionalAccessExpression = inConditionalMemberAccess;
+ return !invocationExpressionOpt.ArgumentList.CloseParenToken.IsMissing;
+ }
+ else if (simpleName.IsKind(SyntaxKind.IdentifierName))
+ {
+ // If we don't have an invocation node, then see if we can infer a delegate in
+ // this location. Check if this is a place where a delegate can go. Only do this
+ // for identifier names. for now. It gets really funky if you have to deal with
+ // a generic name here.
+
+ // Can't assign into a method.
+ if (!simpleNameOrMemberAccessExpression.IsLeftSideOfAnyAssignExpression())
+ {
+ invocationExpressionOpt = null;
+ isInConditionalAccessExpression = inConditionalMemberAccess;
+ return true;
+ }
+ }
+ }
+
+ identifierToken = default(SyntaxToken);
+ simpleNameOrMemberAccessExpression = null;
+ invocationExpressionOpt = null;
+ isInConditionalAccessExpression = false;
+ return false;
+ }
+
+ protected override ITypeSymbol CanGenerateMethodForSimpleNameOrMemberAccessExpression(
+ SemanticModel semanticModel,
+ ExpressionSyntax expresion,
+ CancellationToken cancellationToken)
+ {
+ if (semanticModel.SyntaxTree.IsNameOfContext(expresion.SpanStart, semanticModel, cancellationToken))
+ {
+ return TypeGuessing.typeInferenceService.InferType(semanticModel, expresion, true, cancellationToken);
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/CSharpGenerateParameterizedMemberService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/CSharpGenerateParameterizedMemberService.cs
new file mode 100644
index 0000000000..ad3462c2ce
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/CSharpGenerateParameterizedMemberService.cs
@@ -0,0 +1,172 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Shared.Utilities;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateParameterizedMember
+{
+ internal abstract class CSharpGenerateParameterizedMemberService<TService> : AbstractGenerateParameterizedMemberService<TService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>
+ where TService : AbstractGenerateParameterizedMemberService<TService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>
+ {
+ internal protected partial class InvocationExpressionInfo : AbstractInvocationInfo
+ {
+ private readonly InvocationExpressionSyntax _invocationExpression;
+
+ public InvocationExpressionInfo(
+ SemanticDocument document,
+ AbstractGenerateParameterizedMemberService<TService, SimpleNameSyntax, ExpressionSyntax, InvocationExpressionSyntax>.State state)
+ : base(document, state)
+ {
+ _invocationExpression = state.InvocationExpressionOpt;
+ }
+
+ protected override IList<string> DetermineParameterNames(CancellationToken cancellationToken)
+ {
+ return this.Document.SemanticModel.GenerateParameterNames(
+ _invocationExpression.ArgumentList);
+ }
+
+ protected override ITypeSymbol DetermineReturnTypeWorker(CancellationToken cancellationToken)
+ {
+ // Defer to the type inferrer to figure out what the return type of this new method
+ // should be.
+ var inferredType = TypeGuessing.typeInferenceService.InferType(this.Document.SemanticModel,
+ _invocationExpression, objectAsDefault: true, cancellationToken: cancellationToken);
+ if (State.IsInConditionalAccessExpression)
+ {
+ return inferredType.RemoveNullableIfPresent();
+ }
+
+ return inferredType;
+ }
+
+ protected override IList<ITypeParameterSymbol> GetCapturedTypeParameters(CancellationToken cancellationToken)
+ {
+ var result = new List<ITypeParameterSymbol>();
+ var semanticModel = this.Document.SemanticModel;
+ foreach (var argument in _invocationExpression.ArgumentList.Arguments)
+ {
+ var type = semanticModel.GetType(argument.Expression, cancellationToken);
+ type.GetReferencedTypeParameters(result);
+ }
+
+ return result;
+ }
+
+ protected override IList<ITypeParameterSymbol> GenerateTypeParameters(CancellationToken cancellationToken)
+ {
+ // Generate dummy type parameter names for a generic method. If the user is inside a
+ // generic method, and calls a generic method with type arguments from the outer
+ // method, then use those same names for the generated type parameters.
+ //
+ // TODO(cyrusn): If we do capture method type variables, then we should probably
+ // capture their constraints as well.
+ var genericName = (GenericNameSyntax)this.State.SimpleNameOpt;
+ //var semanticModel = this.Document.SemanticModel;
+
+ if (genericName.TypeArgumentList.Arguments.Count == 1)
+ {
+ var typeParameter = GetUniqueTypeParameter(
+ genericName.TypeArgumentList.Arguments.First(),
+ s => !State.TypeToGenerateIn.GetAllTypeParameters().Any(t => t.Name == s),
+ cancellationToken);
+
+ return new List<ITypeParameterSymbol> { typeParameter };
+ }
+ else
+ {
+ var list = new List<ITypeParameterSymbol>();
+
+ var usedIdentifiers = new HashSet<string> { "T" };
+ foreach (var type in genericName.TypeArgumentList.Arguments)
+ {
+ var typeParameter = GetUniqueTypeParameter(
+ type,
+ s => !usedIdentifiers.Contains(s) && !State.TypeToGenerateIn.GetAllTypeParameters().Any(t => t.Name == s),
+ cancellationToken);
+
+ usedIdentifiers.Add(typeParameter.Name);
+
+ list.Add(typeParameter);
+ }
+
+ return list;
+ }
+ }
+
+ private ITypeParameterSymbol GetUniqueTypeParameter(
+ TypeSyntax type,
+ Func<string, bool> isUnique,
+ CancellationToken cancellationToken)
+ {
+ var methodTypeParameter = GetMethodTypeParameter(type, cancellationToken);
+ return methodTypeParameter != null
+ ? methodTypeParameter
+ : CodeGenerationSymbolFactory.CreateTypeParameterSymbol(NameGenerator.GenerateUniqueName("T", isUnique));
+ }
+
+ private ITypeParameterSymbol GetMethodTypeParameter(TypeSyntax type, CancellationToken cancellationToken)
+ {
+ if (type is IdentifierNameSyntax)
+ {
+ var info = this.Document.SemanticModel.GetTypeInfo(type, cancellationToken);
+ if (info.Type is ITypeParameterSymbol &&
+ ((ITypeParameterSymbol)info.Type).TypeParameterKind == TypeParameterKind.Method)
+ {
+ return (ITypeParameterSymbol)info.Type;
+ }
+ }
+
+ return null;
+ }
+
+ protected override IList<RefKind> DetermineParameterModifiers(CancellationToken cancellationToken)
+ {
+ return
+ _invocationExpression.ArgumentList.Arguments.Select(
+ a => a.RefOrOutKeyword.Kind() == SyntaxKind.RefKeyword ? RefKind.Ref :
+ a.RefOrOutKeyword.Kind() == SyntaxKind.OutKeyword ? RefKind.Out : RefKind.None).ToList();
+ }
+
+ protected override IList<ITypeSymbol> DetermineParameterTypes(CancellationToken cancellationToken)
+ {
+ return _invocationExpression.ArgumentList.Arguments.Select(a => DetermineParameterType(a, cancellationToken)).ToList();
+ }
+
+ private ITypeSymbol DetermineParameterType(
+ ArgumentSyntax argument,
+ CancellationToken cancellationToken)
+ {
+ return argument.DetermineParameterType(this.Document.SemanticModel, cancellationToken);
+ }
+
+ protected override IList<bool> DetermineParameterOptionality(CancellationToken cancellationToken)
+ {
+ return _invocationExpression.ArgumentList.Arguments.Select(a => false).ToList();
+ }
+
+ protected override bool IsIdentifierName()
+ {
+ return this.State.SimpleNameOpt.Kind() == SyntaxKind.IdentifierName;
+ }
+
+ protected override bool IsImplicitReferenceConversion(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType)
+ {
+ var conversion = compilation.ClassifyConversion(sourceType, targetType);
+ return conversion.IsImplicit && conversion.IsReference;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/MethodGenerationKind.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/MethodGenerationKind.cs
new file mode 100644
index 0000000000..cbafecdebb
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateParameterizedMember/MethodGenerationKind.cs
@@ -0,0 +1,11 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateParameterizedMember
+{
+ public enum MethodGenerationKind
+ {
+ Member,
+ ImplicitConversion,
+ ExplicitConversion
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateVariable/AbstractGenerateVariableService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateVariable/AbstractGenerateVariableService.cs
new file mode 100644
index 0000000000..6bf6e3bd68
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateVariable/AbstractGenerateVariableService.cs
@@ -0,0 +1,710 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.Internal.Log;
+using Microsoft.CodeAnalysis.Options;
+using Roslyn.Utilities;
+using ICSharpCode.NRefactory6.CSharp.GenerateMember;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.Editing;
+using ICSharpCode.NRefactory6.CSharp.CodeGeneration;
+using Microsoft.CodeAnalysis.FindSymbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace Microsoft.CodeAnalysis.GenerateMember.GenerateVariable
+{
+ abstract partial class AbstractGenerateVariableService<TService, TSimpleNameSyntax, TExpressionSyntax> :
+ AbstractGenerateMemberService<TSimpleNameSyntax, TExpressionSyntax>
+ where TService : AbstractGenerateVariableService<TService, TSimpleNameSyntax, TExpressionSyntax>
+ where TSimpleNameSyntax : TExpressionSyntax
+ where TExpressionSyntax : SyntaxNode
+ {
+ protected AbstractGenerateVariableService()
+ {
+ }
+
+ protected abstract bool IsExplicitInterfaceGeneration(SyntaxNode node);
+ protected abstract bool IsIdentifierNameGeneration(SyntaxNode node);
+
+ protected abstract bool TryInitializeExplicitInterfaceState(SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken, out SyntaxToken identifierToken, out IPropertySymbol propertySymbol, out INamedTypeSymbol typeToGenerateIn);
+ protected abstract bool TryInitializeIdentifierNameState(SemanticDocument document, TSimpleNameSyntax identifierName, CancellationToken cancellationToken, out SyntaxToken identifierToken, out TExpressionSyntax simpleNameOrMemberAccessExpression, out bool isInExecutableBlock, out bool isinConditionalAccessExpression);
+
+ protected abstract bool TryConvertToLocalDeclaration(ITypeSymbol type, SyntaxToken identifierToken, OptionSet options, out SyntaxNode newRoot);
+
+ public async Task<IEnumerable<CodeAction>> GenerateVariableAsync(
+ Document document,
+ SyntaxNode node,
+ CancellationToken cancellationToken)
+ {
+ var semanticDocument = await SemanticDocument.CreateAsync(document, cancellationToken).ConfigureAwait(false);
+
+ var state = await State.GenerateAsync((TService)this, semanticDocument, node, cancellationToken).ConfigureAwait(false);
+ if (state == null)
+ {
+ return SpecializedCollections.EmptyEnumerable<CodeAction>();
+ }
+
+ var result = new List<CodeAction>();
+
+ var canGenerateMember = ICSharpCode.NRefactory6.CSharp.CodeGenerator.CanAdd(document.Project.Solution, state.TypeToGenerateIn, cancellationToken);
+
+ // prefer fields over properties (and vice versa) depending on the casing of the member.
+ // lowercase -> fields. title case -> properties.
+ var name = state.IdentifierToken.ValueText;
+ if (char.IsUpper(name.FirstOrDefault()))
+ {
+ if (canGenerateMember)
+ {
+ AddPropertyCodeActions(result, document, state);
+ AddFieldCodeActions(result, document, state);
+ }
+
+ AddLocalCodeActions(result, document, state);
+ }
+ else
+ {
+ if (canGenerateMember)
+ {
+ AddFieldCodeActions(result, document, state);
+ AddPropertyCodeActions(result, document, state);
+ }
+
+ AddLocalCodeActions(result, document, state);
+ }
+
+ return result;
+ }
+
+ protected virtual bool ContainingTypesOrSelfHasUnsafeKeyword(INamedTypeSymbol containingType)
+ {
+ return false;
+ }
+
+ private void AddPropertyCodeActions(List<CodeAction> result, Document document, State state)
+ {
+ if (state.IsInRefContext || state.IsInOutContext)
+ {
+ return;
+ }
+
+ if (state.IsConstant)
+ {
+ return;
+ }
+
+ if (state.TypeToGenerateIn.TypeKind == TypeKind.Interface && state.IsStatic)
+ {
+ return;
+ }
+
+ result.Add(new GenerateVariableCodeAction((TService)this, document, state, generateProperty: true, isReadonly: false, isConstant: false));
+
+ if (state.TypeToGenerateIn.TypeKind == TypeKind.Interface && !state.IsWrittenTo)
+ {
+ result.Add(new GenerateVariableCodeAction((TService)this, document, state, generateProperty: true, isReadonly: true, isConstant: false));
+ }
+ }
+
+ private void AddFieldCodeActions(List<CodeAction> result, Document document, State state)
+ {
+ if (state.TypeToGenerateIn.TypeKind != TypeKind.Interface)
+ {
+ if (state.IsConstant)
+ {
+ result.Add(new GenerateVariableCodeAction((TService)this, document, state, generateProperty: false, isReadonly: false, isConstant: true));
+ }
+ else
+ {
+ result.Add(new GenerateVariableCodeAction((TService)this, document, state, generateProperty: false, isReadonly: false, isConstant: false));
+
+ // If we haven't written to the field, or we're in the constructor for the type
+ // we're writing into, then we can generate this field read-only.
+ if (!state.IsWrittenTo || state.IsInConstructor)
+ {
+ result.Add(new GenerateVariableCodeAction((TService)this, document, state, generateProperty: false, isReadonly: true, isConstant: false));
+ }
+ }
+ }
+ }
+
+ private void AddLocalCodeActions(List<CodeAction> result, Document document, State state)
+ {
+ if (state.CanGenerateLocal())
+ {
+ result.Add(new GenerateLocalCodeAction((TService)this, document, state));
+ }
+ }
+
+ private partial class GenerateVariableCodeAction : CodeAction
+ {
+ //private readonly TService _service;
+ private readonly State _state;
+ private readonly bool _generateProperty;
+ private readonly bool _isReadonly;
+ private readonly bool _isConstant;
+ private readonly Document _document;
+ private readonly string _equivalenceKey;
+
+ public GenerateVariableCodeAction(
+ TService service,
+ Document document,
+ State state,
+ bool generateProperty,
+ bool isReadonly,
+ bool isConstant)
+ {
+ //_service = service;
+ _document = document;
+ _state = state;
+ _generateProperty = generateProperty;
+ _isReadonly = isReadonly;
+ _isConstant = isConstant;
+ _equivalenceKey = Title;
+ }
+
+ protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
+ {
+ var generateUnsafe = _state.TypeMemberType.IsUnsafe() &&
+ !_state.IsContainedInUnsafeType;
+
+ if (_generateProperty)
+ {
+ var getAccessor = CodeGenerationSymbolFactory.CreateAccessorSymbol(
+ attributes: null,
+ accessibility: DetermineMaximalAccessibility(_state),
+ statements: null);
+ var setAccessor = _isReadonly ? null : CodeGenerationSymbolFactory.CreateAccessorSymbol(
+ attributes: null,
+ accessibility: DetermineMinimalAccessibility(_state),
+ statements: null);
+
+ var result = await ICSharpCode.NRefactory6.CSharp.CodeGenerator.AddPropertyDeclarationAsync(
+ _document.Project.Solution,
+ _state.TypeToGenerateIn,
+ CodeGenerationSymbolFactory.CreatePropertySymbol(
+ attributes: null,
+ accessibility: DetermineMaximalAccessibility(_state),
+ modifiers: DeclarationModifiers.None.WithIsStatic(_state.IsStatic).WithIsUnsafe (generateUnsafe),
+ type: _state.TypeMemberType,
+ explicitInterfaceSymbol: null,
+ name: _state.IdentifierToken.ValueText,
+ isIndexer: _state.IsIndexer,
+ parameters: _state.Parameters,
+ getMethod: getAccessor,
+ setMethod: setAccessor),
+ new CodeGenerationOptions(contextLocation: _state.IdentifierToken.GetLocation(), generateDefaultAccessibility: false),
+ cancellationToken: cancellationToken)
+ .ConfigureAwait(false);
+
+ return await AnnotateInsertionMode (_document.Project.Solution.GetDocument(result.Id), result);
+ }
+ else
+ {
+ var result = await ICSharpCode.NRefactory6.CSharp.CodeGenerator.AddFieldDeclarationAsync(
+ _document.Project.Solution,
+ _state.TypeToGenerateIn,
+ CodeGenerationSymbolFactory.CreateFieldSymbol(
+ attributes: null,
+ accessibility: DetermineMinimalAccessibility(_state),
+ modifiers: _isConstant ?
+ DeclarationModifiers.None.WithIsConst(true).WithIsUnsafe(generateUnsafe) :
+ DeclarationModifiers.None.WithIsStatic(_state.IsStatic).WithIsReadOnly (_isReadonly).WithIsUnsafe(generateUnsafe),
+ type: _state.TypeMemberType,
+ name: _state.IdentifierToken.ValueText),
+ new CodeGenerationOptions(contextLocation: _state.IdentifierToken.GetLocation(), generateDefaultAccessibility: false),
+ cancellationToken: cancellationToken)
+ .ConfigureAwait(false);
+
+ return await AnnotateInsertionMode (_document.Project.Solution.GetDocument (result.Id), result);
+ }
+ }
+
+ async Task<Document> AnnotateInsertionMode (Document oldDocument, Document result)
+ {
+ var newRoot = await result.GetSyntaxRootAsync ();
+ var changes = await oldDocument.GetTextChangesAsync (result);
+ foreach (var change in changes) {
+
+ var parent = newRoot.FindNode (change.Span);
+ if (parent == null || !(parent is FieldDeclarationSyntax || parent is PropertyDeclarationSyntax))
+ continue;
+ return result.WithSyntaxRoot (newRoot.ReplaceNode (parent, parent.WithAdditionalAnnotations (TypeSystemService.InsertionModeAnnotation)));
+ }
+ return result;
+ }
+
+ private Accessibility DetermineMaximalAccessibility(State state)
+ {
+ if (state.TypeToGenerateIn.TypeKind == TypeKind.Interface)
+ {
+ return Accessibility.NotApplicable;
+ }
+
+ var accessibility = Accessibility.Public;
+
+ // Ensure that we're not overly exposing a type.
+ var containingTypeAccessibility = state.TypeToGenerateIn.DetermineMinimalAccessibility();
+ var effectiveAccessibility = CommonAccessibilityUtilities.Minimum(
+ containingTypeAccessibility, accessibility);
+
+ var returnTypeAccessibility = state.TypeMemberType.DetermineMinimalAccessibility();
+
+ if (CommonAccessibilityUtilities.Minimum(effectiveAccessibility, returnTypeAccessibility) !=
+ effectiveAccessibility)
+ {
+ return returnTypeAccessibility;
+ }
+
+ return accessibility;
+ }
+
+ private Accessibility DetermineMinimalAccessibility(State state)
+ {
+ if (state.TypeToGenerateIn.TypeKind == TypeKind.Interface)
+ {
+ return Accessibility.NotApplicable;
+ }
+
+ // Otherwise, figure out what accessibility modifier to use and optionally mark
+ // it as static.
+ if (state.SimpleNameOrMemberAccessExpressionOpt.IsAttributeNamedArgumentIdentifier())
+ {
+ return Accessibility.Public;
+ }
+ else if (state.ContainingType.IsContainedWithin(state.TypeToGenerateIn))
+ {
+ return Accessibility.Private;
+ }
+ else if (DerivesFrom(state, state.ContainingType) && state.IsStatic)
+ {
+ // NOTE(cyrusn): We only generate protected in the case of statics. Consider
+ // the case where we're generating into one of our base types. i.e.:
+ //
+ // class B : A { void Foo() { A a; a.Foo(); }
+ //
+ // In this case we can *not* mark the method as protected. 'B' can only
+ // access protected members of 'A' through an instance of 'B' (or a subclass
+ // of B). It can not access protected members through an instance of the
+ // superclass. In this case we need to make the method public or internal.
+ //
+ // However, this does not apply if the method will be static. i.e.
+ //
+ // class B : A { void Foo() { A.Foo(); }
+ //
+ // B can access the protected statics of A, and so we generate 'Foo' as
+ // protected.
+ return Accessibility.Protected;
+ }
+ else if (state.ContainingType.ContainingAssembly.IsSameAssemblyOrHasFriendAccessTo(state.TypeToGenerateIn.ContainingAssembly))
+ {
+ return Accessibility.Internal;
+ }
+ else
+ {
+ // TODO: Code coverage - we need a unit-test that generates across projects
+ return Accessibility.Public;
+ }
+ }
+
+ private bool DerivesFrom(State state, INamedTypeSymbol containingType)
+ {
+ return containingType.GetBaseTypes().Select(t => t.OriginalDefinition)
+ .Contains(state.TypeToGenerateIn);
+ }
+
+ public override string Title
+ {
+ get
+ {
+ var text = _isConstant
+ ? Resources.GenerateConstantIn
+ : _generateProperty
+ ? _isReadonly ? Resources.GenerateReadonlyProperty : Resources.GeneratePropertyIn
+ : _isReadonly ? Resources.GenerateReadonlyField : Resources.GenerateFieldIn;
+
+ return string.Format(
+ text,
+ _state.IdentifierToken.ValueText,
+ _state.TypeToGenerateIn.Name);
+ }
+ }
+
+ public override string EquivalenceKey
+ {
+ get
+ {
+ return _equivalenceKey;
+ }
+ }
+ }
+
+ private class GenerateLocalCodeAction : CodeAction
+ {
+ private readonly TService _service;
+ private readonly Document _document;
+ private readonly State _state;
+
+ public GenerateLocalCodeAction(TService service, Document document, State state)
+ {
+ _service = service;
+ _document = document;
+ _state = state;
+ }
+
+ public override string Title
+ {
+ get
+ {
+ var text = Resources.GenerateLocal;
+
+ return string.Format(
+ text,
+ _state.IdentifierToken.ValueText);
+ }
+ }
+
+ protected override Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
+ {
+ var newRoot = GetNewRoot(cancellationToken);
+ var newDocument = _document.WithSyntaxRoot(newRoot);
+
+ return Task.FromResult(newDocument);
+ }
+
+ private SyntaxNode GetNewRoot(CancellationToken cancellationToken)
+ {
+ SyntaxNode newRoot;
+ if (_service.TryConvertToLocalDeclaration(_state.LocalType, _state.IdentifierToken, _document.Project.Solution.Workspace.Options, out newRoot))
+ {
+ return newRoot;
+ }
+
+ var syntaxFactory = _document.GetLanguageService<SyntaxGenerator>();
+ var initializer = _state.IsOnlyWrittenTo
+ ? null
+ : syntaxFactory.DefaultExpression(_state.LocalType);
+
+ var type = _state.LocalType;
+ var localStatement = syntaxFactory.LocalDeclarationStatement(type, _state.IdentifierToken.ValueText, initializer);
+ localStatement = localStatement.WithAdditionalAnnotations(Microsoft.CodeAnalysis.Formatting.Formatter.Annotation);
+
+ var codeGenService = new CSharpCodeGenerationService (_document.Project.Solution.Workspace);
+ var root = _state.IdentifierToken.GetAncestors<SyntaxNode>().Last();
+
+ return codeGenService.AddStatements(
+ root,
+ SpecializedCollections.SingletonEnumerable(localStatement),
+ options: new CodeGenerationOptions(beforeThisLocation: _state.IdentifierToken.GetLocation()),
+ cancellationToken: cancellationToken);
+ }
+ }
+
+ private partial class State
+ {
+ public INamedTypeSymbol ContainingType { get; private set; }
+ public INamedTypeSymbol TypeToGenerateIn { get; private set; }
+ public bool IsStatic { get; private set; }
+ public bool IsConstant { get; private set; }
+ public bool IsIndexer { get; private set; }
+ public bool IsContainedInUnsafeType { get; private set; }
+ public IList<IParameterSymbol> Parameters { get; private set; }
+
+ // Just the name of the method. i.e. "Foo" in "Foo" or "X.Foo"
+ public SyntaxToken IdentifierToken { get; private set; }
+ public TSimpleNameSyntax SimpleNameOpt { get; private set; }
+
+ // The entire expression containing the name. i.e. "X.Foo"
+ public TExpressionSyntax SimpleNameOrMemberAccessExpressionOpt { get; private set; }
+
+ public ITypeSymbol TypeMemberType { get; private set; }
+ public ITypeSymbol LocalType { get; private set; }
+
+ public bool IsWrittenTo { get; private set; }
+ public bool IsOnlyWrittenTo { get; private set; }
+
+ public bool IsInConstructor { get; private set; }
+ public bool IsInRefContext { get; private set; }
+ public bool IsInOutContext { get; private set; }
+ public bool IsInMemberContext { get; private set; }
+
+ public bool IsInExecutableBlock { get; private set; }
+ public bool IsInConditionalAccessExpression { get; private set; }
+
+ public static async Task<State> GenerateAsync(
+ TService service,
+ SemanticDocument document,
+ SyntaxNode interfaceNode,
+ CancellationToken cancellationToken)
+ {
+ var state = new State();
+ if (!await state.TryInitializeAsync(service, document, interfaceNode, cancellationToken).ConfigureAwait(false))
+ {
+ return null;
+ }
+
+ return state;
+ }
+
+ private async Task<bool> TryInitializeAsync(
+ TService service,
+ SemanticDocument document,
+ SyntaxNode node,
+ CancellationToken cancellationToken)
+ {
+ if (service.IsIdentifierNameGeneration(node))
+ {
+ // Cases that we deal with currently:
+ //
+ // 1) expr.Foo
+ // 2) expr->Foo
+ // 3) Foo
+ if (!TryInitializeSimpleName(service, document, (TSimpleNameSyntax)node, cancellationToken))
+ {
+ return false;
+ }
+ }
+ else if (service.IsExplicitInterfaceGeneration(node))
+ {
+ // 4) bool IFoo.NewProp
+ if (!TryInitializeExplicitInterface(service, document, node, cancellationToken))
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+
+ // Ok. It either didn't bind to any symbols, or it bound to a symbol but with
+ // errors. In the former case we definitely want to offer to generate a field. In
+ // the latter case, we want to generate a field *unless* there's an existing member
+ // with the same name. Note: it's ok if there's a method with the same name.
+ var existingMembers = this.TypeToGenerateIn.GetMembers(this.IdentifierToken.ValueText)
+ .Where(m => m.Kind != SymbolKind.Method);
+ if (existingMembers.Any())
+ {
+ // TODO: Code coverage
+ // There was an existing method that the new method would clash with.
+ return false;
+ }
+
+ if (cancellationToken.IsCancellationRequested)
+ {
+ return false;
+ }
+
+ this.TypeToGenerateIn = await SymbolFinder.FindSourceDefinitionAsync(this.TypeToGenerateIn, document.Project.Solution, cancellationToken).ConfigureAwait(false) as INamedTypeSymbol;
+
+ if (!service.ValidateTypeToGenerateIn(
+ document.Project.Solution, this.TypeToGenerateIn, this.IsStatic, ClassInterfaceModuleStructTypes, cancellationToken))
+ {
+ return false;
+ }
+
+ this.IsContainedInUnsafeType = service.ContainingTypesOrSelfHasUnsafeKeyword(this.TypeToGenerateIn);
+
+ return CanGenerateLocal() || ICSharpCode.NRefactory6.CSharp.CodeGenerator.CanAdd(document.Project.Solution, this.TypeToGenerateIn, cancellationToken);
+ }
+
+ internal bool CanGenerateLocal()
+ {
+ return !this.IsInMemberContext && this.IsInExecutableBlock;
+ }
+
+ private bool TryInitializeExplicitInterface(
+ TService service,
+ SemanticDocument document,
+ SyntaxNode propertyDeclaration,
+ CancellationToken cancellationToken)
+ {
+ SyntaxToken identifierToken;
+ IPropertySymbol propertySymbol;
+ INamedTypeSymbol typeToGenerateIn;
+ if (!service.TryInitializeExplicitInterfaceState(
+ document, propertyDeclaration, cancellationToken,
+ out identifierToken, out propertySymbol, out typeToGenerateIn))
+ {
+ return false;
+ }
+
+ this.IdentifierToken = identifierToken;
+ this.TypeToGenerateIn = typeToGenerateIn;
+
+ if (propertySymbol.ExplicitInterfaceImplementations.Any())
+ {
+ return false;
+ }
+
+ cancellationToken.ThrowIfCancellationRequested();
+
+ var semanticModel = document.SemanticModel;
+ this.ContainingType = semanticModel.GetEnclosingNamedType(this.IdentifierToken.SpanStart, cancellationToken);
+ if (this.ContainingType == null)
+ {
+ return false;
+ }
+
+ if (!this.ContainingType.Interfaces.OfType<INamedTypeSymbol>().Contains(this.TypeToGenerateIn))
+ {
+ return false;
+ }
+
+ this.IsIndexer = propertySymbol.IsIndexer;
+ this.Parameters = propertySymbol.Parameters;
+ this.TypeMemberType = propertySymbol.Type;
+
+ // By default, make it readonly, unless there's already an setter defined.
+ this.IsWrittenTo = propertySymbol.SetMethod != null;
+
+ return true;
+ }
+
+ private bool TryInitializeSimpleName(
+ TService service,
+ SemanticDocument document,
+ TSimpleNameSyntax simpleName,
+ CancellationToken cancellationToken)
+ {
+ SyntaxToken identifierToken;
+ TExpressionSyntax simpleNameOrMemberAccessExpression;
+ bool isInExecutableBlock;
+ bool isInConditionalAccessExpression;
+ if (!service.TryInitializeIdentifierNameState(
+ document, simpleName, cancellationToken,
+ out identifierToken, out simpleNameOrMemberAccessExpression, out isInExecutableBlock, out isInConditionalAccessExpression))
+ {
+ return false;
+ }
+
+ if (string.IsNullOrWhiteSpace(identifierToken.ValueText))
+ {
+ return false;
+ }
+
+ this.SimpleNameOpt = simpleName;
+ this.IdentifierToken = identifierToken;
+ this.SimpleNameOrMemberAccessExpressionOpt = simpleNameOrMemberAccessExpression;
+ this.IsInExecutableBlock = isInExecutableBlock;
+ this.IsInConditionalAccessExpression = isInConditionalAccessExpression;
+
+ // If we're in a type context then we shouldn't offer to generate a field or
+ // property.
+ if (SimpleNameOrMemberAccessExpressionOpt.IsInNamespaceOrTypeContext())
+ {
+ return false;
+ }
+
+ var expr = SimpleNameOrMemberAccessExpressionOpt as ExpressionSyntax;
+ this.IsConstant = expr.IsInConstantContext();
+
+ // If we're not in a type, don't even bother. NOTE(cyrusn): We'll have to rethink this
+ // for C# Script.
+ cancellationToken.ThrowIfCancellationRequested();
+ var semanticModel = document.SemanticModel;
+ this.ContainingType = semanticModel.GetEnclosingNamedType(this.IdentifierToken.SpanStart, cancellationToken);
+ if (this.ContainingType == null)
+ {
+ return false;
+ }
+
+ // Now, try to bind the invocation and see if it succeeds or not. if it succeeds and
+ // binds uniquely, then we don't need to offer this quick fix.
+ cancellationToken.ThrowIfCancellationRequested();
+ var semanticInfo = semanticModel.GetSymbolInfo(this.SimpleNameOrMemberAccessExpressionOpt, cancellationToken);
+
+ cancellationToken.ThrowIfCancellationRequested();
+ if (semanticInfo.Symbol != null)
+ {
+ return false;
+ }
+
+ // Either we found no matches, or this was ambiguous. Either way, we might be able
+ // to generate a method here. Determine where the user wants to generate the method
+ // into, and if it's valid then proceed.
+ cancellationToken.ThrowIfCancellationRequested();
+ INamedTypeSymbol typeToGenerateIn;
+ bool isStatic;
+ if (!service.TryDetermineTypeToGenerateIn(document, this.ContainingType, this.SimpleNameOrMemberAccessExpressionOpt, cancellationToken,
+ out typeToGenerateIn, out isStatic))
+ {
+ return false;
+ }
+
+ this.TypeToGenerateIn = typeToGenerateIn;
+ this.IsStatic = isStatic;
+
+ DetermineFieldType(document, cancellationToken);
+
+ this.IsInRefContext = expr.IsInRefContext();
+ this.IsInOutContext = expr.IsInOutContext();
+ this.IsWrittenTo = expr.IsWrittenTo();
+ this.IsOnlyWrittenTo = expr.IsOnlyWrittenTo();
+ this.IsInConstructor = DetermineIsInConstructor(document);
+ this.IsInMemberContext = this.SimpleNameOpt != this.SimpleNameOrMemberAccessExpressionOpt ||
+ expr.IsObjectInitializerNamedAssignmentIdentifier();
+ return true;
+ }
+
+ private void DetermineFieldType(
+ SemanticDocument document,
+ CancellationToken cancellationToken)
+ {
+ var inferredType = TypeGuessing.typeInferenceService.InferType(
+ document.SemanticModel, this.SimpleNameOrMemberAccessExpressionOpt,
+ objectAsDefault: true,
+ cancellationToken: cancellationToken);
+ inferredType = inferredType.SpecialType == SpecialType.System_Void
+ ? document.SemanticModel.Compilation.ObjectType
+ : inferredType;
+
+ if (this.IsInConditionalAccessExpression)
+ {
+ inferredType = inferredType.RemoveNullableIfPresent();
+ }
+
+ // Substitute 'object' for all captured method type parameters. Note: we may need to
+ // do this for things like anonymous types, as well as captured type parameters that
+ // aren't in scope in the destination type.
+ var capturedMethodTypeParameters = inferredType.GetReferencedMethodTypeParameters();
+ var mapping = capturedMethodTypeParameters.ToDictionary(tp => tp,
+ tp => document.SemanticModel.Compilation.ObjectType);
+
+ this.TypeMemberType = inferredType.SubstituteTypes(mapping, document.SemanticModel.Compilation);
+ var availableTypeParameters = this.TypeToGenerateIn.GetAllTypeParameters();
+ this.TypeMemberType = TypeMemberType.RemoveUnavailableTypeParameters(
+ document.SemanticModel.Compilation, availableTypeParameters);
+
+ var enclosingMethodSymbol = document.SemanticModel.GetEnclosingSymbol<IMethodSymbol>(this.SimpleNameOrMemberAccessExpressionOpt.SpanStart, cancellationToken);
+ if (enclosingMethodSymbol != null && enclosingMethodSymbol.TypeParameters != null && enclosingMethodSymbol.TypeParameters.Count() != 0)
+ {
+ var combinedTypeParameters = new List<ITypeParameterSymbol>();
+ combinedTypeParameters.AddRange(availableTypeParameters);
+ combinedTypeParameters.AddRange(enclosingMethodSymbol.TypeParameters);
+ this.LocalType = inferredType.RemoveUnavailableTypeParameters(
+ document.SemanticModel.Compilation, combinedTypeParameters);
+ }
+ else
+ {
+ this.LocalType = this.TypeMemberType;
+ }
+ }
+
+ private bool DetermineIsInConstructor(SemanticDocument document)
+ {
+ if (!this.ContainingType.OriginalDefinition.Equals(this.TypeToGenerateIn.OriginalDefinition))
+ {
+ return false;
+ }
+
+ return SimpleNameOpt.IsInConstructor();
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateVariable/CSharpGenerateVariableService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateVariable/CSharpGenerateVariableService.cs
new file mode 100644
index 0000000000..826b40dfe7
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateMember/GenerateVariable/CSharpGenerateVariableService.cs
@@ -0,0 +1,167 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Composition;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.GenerateMember.GenerateVariable;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace Microsoft.CodeAnalysis.GenerateMember.GenerateVariable
+{
+ partial class CSharpGenerateVariableService :
+ AbstractGenerateVariableService<CSharpGenerateVariableService, SimpleNameSyntax, ExpressionSyntax>
+ {
+ protected override bool IsExplicitInterfaceGeneration(SyntaxNode node)
+ {
+ return node is PropertyDeclarationSyntax;
+ }
+
+ protected override bool IsIdentifierNameGeneration(SyntaxNode node)
+ {
+ return node is IdentifierNameSyntax;
+ }
+
+ protected override bool ContainingTypesOrSelfHasUnsafeKeyword(INamedTypeSymbol containingType)
+ {
+ return containingType.ContainingTypesOrSelfHasUnsafeKeyword();
+ }
+
+ protected override bool TryInitializeExplicitInterfaceState(
+ SemanticDocument document, SyntaxNode node, CancellationToken cancellationToken,
+ out SyntaxToken identifierToken, out IPropertySymbol propertySymbol, out INamedTypeSymbol typeToGenerateIn)
+ {
+ var propertyDeclaration = (PropertyDeclarationSyntax)node;
+ identifierToken = propertyDeclaration.Identifier;
+
+ if (propertyDeclaration.ExplicitInterfaceSpecifier != null)
+ {
+ var semanticModel = document.SemanticModel;
+ propertySymbol = semanticModel.GetDeclaredSymbol(propertyDeclaration, cancellationToken) as IPropertySymbol;
+ if (propertySymbol != null && !propertySymbol.ExplicitInterfaceImplementations.Any())
+ {
+ var info = semanticModel.GetTypeInfo(propertyDeclaration.ExplicitInterfaceSpecifier.Name, cancellationToken);
+ typeToGenerateIn = info.Type as INamedTypeSymbol;
+ return typeToGenerateIn != null;
+ }
+ }
+
+ identifierToken = default(SyntaxToken);
+ propertySymbol = null;
+ typeToGenerateIn = null;
+ return false;
+ }
+
+ protected override bool TryInitializeIdentifierNameState(
+ SemanticDocument document, SimpleNameSyntax identifierName, CancellationToken cancellationToken,
+ out SyntaxToken identifierToken, out ExpressionSyntax simpleNameOrMemberAccessExpression, out bool isInExecutableBlock, out bool isConditionalAccessExpression)
+ {
+ identifierToken = identifierName.Identifier;
+ if (identifierToken.ValueText != string.Empty &&
+ !identifierName.IsVar)
+ {
+ var memberAccess = identifierName.Parent as MemberAccessExpressionSyntax;
+ var conditionalMemberAccess = identifierName.Parent.Parent as ConditionalAccessExpressionSyntax;
+ if (memberAccess?.Name == identifierName)
+ {
+ simpleNameOrMemberAccessExpression = (ExpressionSyntax)memberAccess;
+ }
+ else if ((conditionalMemberAccess?.WhenNotNull as MemberBindingExpressionSyntax)?.Name == identifierName)
+ {
+ simpleNameOrMemberAccessExpression = conditionalMemberAccess;
+ }
+ else
+ {
+ simpleNameOrMemberAccessExpression = identifierName;
+ }
+
+ // If we're being invoked, then don't offer this, offer generate method instead.
+ // Note: we could offer to generate a field with a delegate type. However, that's
+ // very esoteric and probably not what most users want.
+ if (!IsLegal(document, simpleNameOrMemberAccessExpression, cancellationToken))
+ {
+ isInExecutableBlock = false;
+ isConditionalAccessExpression = false;
+ return false;
+ }
+
+ var block = identifierName.GetAncestor<BlockSyntax>();
+ isInExecutableBlock = block != null && !block.OverlapsHiddenPosition(cancellationToken);
+ isConditionalAccessExpression = conditionalMemberAccess != null;
+ return true;
+ }
+
+ identifierToken = default(SyntaxToken);
+ simpleNameOrMemberAccessExpression = null;
+ isInExecutableBlock = false;
+ isConditionalAccessExpression = false;
+ return false;
+ }
+
+ private bool IsLegal(
+ SemanticDocument document,
+ ExpressionSyntax expression,
+ CancellationToken cancellationToken)
+ {
+ // TODO(cyrusn): Consider supporting this at some point. It is difficult because we'd
+ // need to replace the identifier typed with the fully qualified name of the field we
+ // were generating.
+ if (expression.IsParentKind(SyntaxKind.AttributeArgument))
+ {
+ return false;
+ }
+
+ if (expression.IsParentKind(SyntaxKind.ConditionalAccessExpression))
+ {
+ return true;
+ }
+
+ return expression.CanReplaceWithLValue(document.SemanticModel, cancellationToken);
+ }
+
+ protected override bool TryConvertToLocalDeclaration(ITypeSymbol type, SyntaxToken identifierToken, OptionSet options, out SyntaxNode newRoot)
+ {
+ var token = (SyntaxToken)identifierToken;
+ var node = identifierToken.Parent as IdentifierNameSyntax;
+ if (node.IsLeftSideOfAssignExpression() && node.Parent.IsParentKind(SyntaxKind.ExpressionStatement))
+ {
+ var assignExpression = (AssignmentExpressionSyntax)node.Parent;
+ var expressionStatement = (StatementSyntax)assignExpression.Parent;
+
+ var declarationStatement = SyntaxFactory.LocalDeclarationStatement(
+ SyntaxFactory.VariableDeclaration(
+ GenerateTypeSyntax(type, options),
+ SyntaxFactory.SingletonSeparatedList(
+ SyntaxFactory.VariableDeclarator(token, null, SyntaxFactory.EqualsValueClause(
+ assignExpression.OperatorToken, assignExpression.Right)))));
+ declarationStatement = declarationStatement.WithAdditionalAnnotations(Formatter.Annotation);
+
+ var root = token.GetAncestor<CompilationUnitSyntax>();
+ newRoot = root.ReplaceNode(expressionStatement, declarationStatement);
+
+ return true;
+ }
+
+ newRoot = null;
+ return false;
+ }
+
+ private static TypeSyntax GenerateTypeSyntax(ITypeSymbol type, OptionSet options)
+ {
+ return type.ContainsAnonymousType() ||
+ (true/*options.GetOption(CSharpCodeStyleOptions.UseVarWhenDeclaringLocals)*/ && type.TypeKind != TypeKind.Delegate)
+ ? SyntaxFactory.IdentifierName("var")
+ : type.GenerateTypeSyntax();
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateType/AbstractGenerateTypeService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateType/AbstractGenerateTypeService.cs
new file mode 100644
index 0000000000..ed9782dcf3
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateType/AbstractGenerateTypeService.cs
@@ -0,0 +1,1813 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis.Internal.Log;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Shared.Utilities;
+using Roslyn.Utilities;
+using ICSharpCode.NRefactory6.CSharp.CodeGeneration;
+using Microsoft.CodeAnalysis.Editing;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis.FindSymbols;
+using System.IO;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateType
+{
+ abstract partial class AbstractGenerateTypeService<TService, TSimpleNameSyntax, TObjectCreationExpressionSyntax, TExpressionSyntax, TTypeDeclarationSyntax, TArgumentSyntax>
+ where TService : AbstractGenerateTypeService<TService, TSimpleNameSyntax, TObjectCreationExpressionSyntax, TExpressionSyntax, TTypeDeclarationSyntax, TArgumentSyntax>
+ where TSimpleNameSyntax : TExpressionSyntax
+ where TObjectCreationExpressionSyntax : TExpressionSyntax
+ where TExpressionSyntax : SyntaxNode
+ where TTypeDeclarationSyntax : SyntaxNode
+ where TArgumentSyntax : SyntaxNode
+ {
+ protected AbstractGenerateTypeService ()
+ {
+ }
+
+ protected abstract bool TryInitializeState (SemanticDocument document, TSimpleNameSyntax simpleName, CancellationToken cancellationToken, out GenerateTypeServiceStateOptions generateTypeServiceStateOptions);
+
+ protected abstract TExpressionSyntax GetLeftSideOfDot (TSimpleNameSyntax simpleName);
+
+ protected abstract bool TryGetArgumentList (TObjectCreationExpressionSyntax objectCreationExpression, out IList<TArgumentSyntax> argumentList);
+
+ protected abstract string DefaultFileExtension { get; }
+
+ protected abstract IList<ITypeParameterSymbol> GetTypeParameters (State state, SemanticModel semanticModel, CancellationToken cancellationToken);
+
+ protected abstract Accessibility GetAccessibility (State state, SemanticModel semanticModel, bool intoNamespace, CancellationToken cancellationToken);
+
+ protected abstract IList<string> GenerateParameterNames (SemanticModel semanticModel, IList<TArgumentSyntax> arguments);
+
+ protected abstract INamedTypeSymbol DetermineTypeToGenerateIn (SemanticModel semanticModel, TSimpleNameSyntax simpleName, CancellationToken cancellationToken);
+
+ protected abstract ITypeSymbol DetermineArgumentType (SemanticModel semanticModel, TArgumentSyntax argument, CancellationToken cancellationToken);
+
+ protected abstract bool IsInCatchDeclaration (TExpressionSyntax expression);
+
+ protected abstract bool IsArrayElementType (TExpressionSyntax expression);
+
+ protected abstract bool IsInVariableTypeContext (TExpressionSyntax expression);
+
+ protected abstract bool IsInValueTypeConstraintContext (SemanticModel semanticModel, TExpressionSyntax expression, CancellationToken cancellationToken);
+
+ protected abstract bool IsInInterfaceList (TExpressionSyntax expression);
+
+ internal abstract bool TryGetBaseList (TExpressionSyntax expression, out TypeKindOptions returnValue);
+
+ internal abstract bool IsPublicOnlyAccessibility (TExpressionSyntax expression, Project project);
+
+ internal abstract bool IsGenericName (TSimpleNameSyntax simpleName);
+
+ internal abstract bool IsSimpleName (TExpressionSyntax expression);
+
+ internal abstract Solution TryAddUsingsOrImportToDocument (Solution updatedSolution, SyntaxNode modifiedRoot, Document document, TSimpleNameSyntax simpleName, string includeUsingsOrImports, CancellationToken cancellationToken);
+
+ protected abstract bool TryGetNameParts (TExpressionSyntax expression, out IList<string> nameParts);
+
+ public abstract string GetRootNamespace (CompilationOptions options);
+
+ public abstract Task<Tuple<INamespaceSymbol, INamespaceOrTypeSymbol, Location>> GetOrGenerateEnclosingNamespaceSymbol (INamedTypeSymbol namedTypeSymbol, string[] containers, Document selectedDocument, SyntaxNode selectedDocumentRoot, CancellationToken cancellationToken);
+
+ public async Task<IEnumerable<CodeAction>> GenerateTypeAsync (
+ Document document,
+ SyntaxNode node,
+ CancellationToken cancellationToken)
+ {
+ //using (Logger.LogBlock (FunctionId.Refactoring_GenerateType, cancellationToken)) {
+ var semanticDocument = await SemanticDocument.CreateAsync (document, cancellationToken).ConfigureAwait (false);
+
+ var state = State.Generate ((TService)this, semanticDocument, node, cancellationToken);
+ if (state != null) {
+ return GetActions (semanticDocument, node, state, cancellationToken);
+ }
+
+ return SpecializedCollections.EmptyEnumerable<CodeAction> ();
+ //}
+ }
+
+ private IEnumerable<CodeAction> GetActions (
+ SemanticDocument document,
+ SyntaxNode node,
+ State state,
+ CancellationToken cancellationToken)
+ {
+ //var generateNewTypeInDialog = false;
+ if (state.NamespaceToGenerateInOpt != null) {
+ var workspace = document.Project.Solution.Workspace;
+ if (workspace == null || workspace.CanApplyChange (ApplyChangesKind.AddDocument)) {
+ //generateNewTypeInDialog = true;
+ yield return new GenerateTypeCodeAction ((TService)this, document.Document, state, intoNamespace: true, inNewFile: true);
+ }
+
+ // If they just are generating "Foo" then we want to offer to generate it into the
+ // namespace in the same file. However, if they are generating "SomeNS.Foo", then we
+ // only want to allow them to generate if "SomeNS" is the namespace they are
+ // currently in.
+ var isSimpleName = state.SimpleName == state.NameOrMemberAccessExpression;
+ var generateIntoContaining = IsGeneratingIntoContainingNamespace (document, node, state, cancellationToken);
+
+ if ((isSimpleName || generateIntoContaining) &&
+ CanGenerateIntoContainingNamespace (document, node, state, cancellationToken)) {
+ yield return new GenerateTypeCodeAction ((TService)this, document.Document, state, intoNamespace: true, inNewFile: false);
+ }
+ }
+
+ if (state.TypeToGenerateInOpt != null) {
+ yield return new GenerateTypeCodeAction ((TService)this, document.Document, state, intoNamespace: false, inNewFile: false);
+ }
+
+ //if (generateNewTypeInDialog) {
+ // yield return new GenerateTypeCodeActionWithOption ((TService)this, document.Document, state);
+ //}
+ }
+
+ private bool CanGenerateIntoContainingNamespace (SemanticDocument document, SyntaxNode node, State state, CancellationToken cancellationToken)
+ {
+ var containingNamespace = document.SemanticModel.GetEnclosingNamespace (node.SpanStart, cancellationToken);
+
+ // Only allow if the containing namespace is one that can be generated
+ // into.
+ var decl = containingNamespace.GetDeclarations ()
+ .Where (r => r.SyntaxTree == node.SyntaxTree)
+ .Select (r => r.GetSyntax (cancellationToken))
+ .FirstOrDefault (node.GetAncestorsOrThis<SyntaxNode> ().Contains);
+
+ return
+ decl != null &&
+ new CSharpCodeGenerationService (document.Project.Solution.Workspace).CanAddTo (decl, document.Project.Solution, cancellationToken);
+ }
+
+ private bool IsGeneratingIntoContainingNamespace (
+ SemanticDocument document,
+ SyntaxNode node,
+ State state,
+ CancellationToken cancellationToken)
+ {
+ var containingNamespace = document.SemanticModel.GetEnclosingNamespace (node.SpanStart, cancellationToken);
+ if (containingNamespace != null) {
+ var containingNamespaceName = containingNamespace.ToDisplayString ();
+ return containingNamespaceName.Equals (state.NamespaceToGenerateInOpt);
+ }
+
+ return false;
+ }
+
+ protected static string GetTypeName (State state)
+ {
+ const string AttributeSuffix = "Attribute";
+
+ return state.IsAttribute && !state.NameIsVerbatim && !state.Name.EndsWith (AttributeSuffix, StringComparison.Ordinal)
+ ? state.Name + AttributeSuffix
+ : state.Name;
+ }
+
+ protected IList<ITypeParameterSymbol> GetTypeParameters (
+ State state,
+ SemanticModel semanticModel,
+ IEnumerable<SyntaxNode> typeArguments,
+ CancellationToken cancellationToken)
+ {
+ var arguments = typeArguments.ToList ();
+ var arity = arguments.Count;
+ var typeParameters = new List<ITypeParameterSymbol> ();
+
+ // For anything that was a type parameter, just use the name (if we haven't already
+ // used it). Otherwise, synthesize new names for the parameters.
+ var names = new string[arity];
+ var isFixed = new bool[arity];
+ for (var i = 0; i < arity; i++) {
+ var argument = i < arguments.Count ? arguments [i] : null;
+ var type = argument == null ? null : semanticModel.GetTypeInfo (argument, cancellationToken).Type;
+ if (type is ITypeParameterSymbol) {
+ var name = type.Name;
+
+ // If we haven't seen this type parameter already, then we can use this name
+ // and 'fix' it so that it doesn't change. Otherwise, use it, but allow it
+ // to be changed if it collides with anything else.
+ isFixed [i] = !names.Contains (name);
+ names [i] = name;
+ typeParameters.Add ((ITypeParameterSymbol)type);
+ } else {
+ names [i] = "T";
+ typeParameters.Add (null);
+ }
+ }
+
+ // We can use a type parameter as long as it hasn't been used in an outer type.
+ var canUse = state.TypeToGenerateInOpt == null
+ ? default(Func<string, bool>)
+ : s => state.TypeToGenerateInOpt.GetAllTypeParameters ().All (t => t.Name != s);
+
+ var uniqueNames = NameGenerator.EnsureUniqueness (names, isFixed, canUse: canUse);
+ for (int i = 0; i < uniqueNames.Count; i++) {
+ if (typeParameters [i] == null || typeParameters [i].Name != uniqueNames [i]) {
+ typeParameters [i] = CodeGenerationSymbolFactory.CreateTypeParameterSymbol (uniqueNames [i]);
+ }
+ }
+
+ return typeParameters;
+ }
+
+ protected Accessibility DetermineDefaultAccessibility (
+ State state,
+ SemanticModel semanticModel,
+ bool intoNamespace,
+ CancellationToken cancellationToken)
+ {
+ if (state.IsPublicAccessibilityForTypeGeneration) {
+ return Accessibility.Public;
+ }
+
+ // If we're a nested type of the type being generated into, then the new type can be
+ // private. otherwise, it needs to be internal.
+ if (!intoNamespace && state.TypeToGenerateInOpt != null) {
+ var outerTypeSymbol = semanticModel.GetEnclosingNamedType (state.SimpleName.SpanStart, cancellationToken);
+
+ if (outerTypeSymbol != null && outerTypeSymbol.IsContainedWithin (state.TypeToGenerateInOpt)) {
+ return Accessibility.Private;
+ }
+ }
+
+ return Accessibility.Internal;
+ }
+
+ protected IList<ITypeParameterSymbol> GetAvailableTypeParameters (
+ State state,
+ SemanticModel semanticModel,
+ bool intoNamespace,
+ CancellationToken cancellationToken)
+ {
+ var availableInnerTypeParameters = GetTypeParameters (state, semanticModel, cancellationToken);
+ var availableOuterTypeParameters = !intoNamespace && state.TypeToGenerateInOpt != null
+ ? state.TypeToGenerateInOpt.GetAllTypeParameters ()
+ : SpecializedCollections.EmptyEnumerable<ITypeParameterSymbol> ();
+
+ return availableOuterTypeParameters.Concat (availableInnerTypeParameters).ToList ();
+ }
+
+ protected bool IsWithinTheImportingNamespace (Document document, int triggeringPosition, string includeUsingsOrImports, CancellationToken cancellationToken)
+ {
+ var semanticModel = document.GetSemanticModelAsync (cancellationToken).WaitAndGetResult (cancellationToken);
+ if (semanticModel != null) {
+ var namespaceSymbol = semanticModel.GetEnclosingNamespace (triggeringPosition, cancellationToken);
+ if (namespaceSymbol != null && namespaceSymbol.ToDisplayString ().StartsWith (includeUsingsOrImports, StringComparison.Ordinal)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ protected bool GeneratedTypesMustBePublic (Project project)
+ {
+// var projectInfoService = project.Solution.Workspace.Services.GetService<IProjectInfoService> ();
+// if (projectInfoService != null) {
+// return projectInfoService.GeneratedTypesMustBePublic (project);
+// }
+
+ return false;
+ }
+
+ private class GenerateTypeCodeAction : CodeAction
+ {
+ private readonly bool _intoNamespace;
+ private readonly bool _inNewFile;
+ private readonly TService _service;
+ private readonly Document _document;
+ private readonly State _state;
+ private readonly string _equivalenceKey;
+
+ public GenerateTypeCodeAction (
+ TService service,
+ Document document,
+ State state,
+ bool intoNamespace,
+ bool inNewFile)
+ {
+ _service = service;
+ _document = document;
+ _state = state;
+ _intoNamespace = intoNamespace;
+ _inNewFile = inNewFile;
+ _equivalenceKey = Title;
+ }
+
+ private static string FormatDisplayText (
+ State state,
+ bool inNewFile,
+ string destination)
+ {
+ //var finalName = GetTypeName (state);
+
+ if (inNewFile) {
+ return string.Format (Resources.GenerateForInNewFile,
+ state.IsStruct ? "struct" : state.IsInterface ? "interface" : "class",
+ state.Name, destination);
+ } else {
+ return string.Format (Resources.GenerateForIn,
+ state.IsStruct ? "struct" : state.IsInterface ? "interface" : "class",
+ state.Name, destination);
+ }
+ }
+
+ protected override async Task<IEnumerable<CodeActionOperation>> ComputeOperationsAsync (CancellationToken cancellationToken)
+ {
+ var semanticDocument = await SemanticDocument.CreateAsync (_document, cancellationToken).ConfigureAwait (false);
+
+ var editor = new Editor ( _service, semanticDocument, _state, _intoNamespace, _inNewFile, cancellationToken: cancellationToken);
+
+ return await editor.GetOperationsAsync ().ConfigureAwait (false);
+ }
+
+ public override string Title {
+ get {
+ if (_intoNamespace) {
+ var namespaceToGenerateIn = string.IsNullOrEmpty (_state.NamespaceToGenerateInOpt) ? Resources.GlobalNamespace : _state.NamespaceToGenerateInOpt;
+ return FormatDisplayText (_state, _inNewFile, namespaceToGenerateIn);
+ } else {
+ return FormatDisplayText (_state, inNewFile: false, destination: _state.TypeToGenerateInOpt.Name);
+ }
+ }
+ }
+
+ public override string EquivalenceKey {
+ get {
+ return _equivalenceKey;
+ }
+ }
+ }
+
+ private class GenerateTypeCodeActionWithOption : CodeActionWithOptions
+ {
+ private readonly TService _service;
+ private readonly Document _document;
+ private readonly State _state;
+
+ internal GenerateTypeCodeActionWithOption (TService service, Document document, State state)
+ {
+ _service = service;
+ _document = document;
+ _state = state;
+ }
+
+ public override string Title {
+ get {
+ return Resources.GenerateNewType;
+ }
+ }
+
+ public override string EquivalenceKey {
+ get {
+ return _state.Name;
+ }
+ }
+
+ public override object GetOptions (CancellationToken cancellationToken)
+ {
+ //var typeKindValue = GetTypeKindOption (_state);
+ var isPublicOnlyAccessibility = IsPublicOnlyAccessibility (_state, _document.Project);
+
+ // TODO : Callback
+ return new GenerateTypeOptionsResult (
+ isPublicOnlyAccessibility ? Accessibility.Public : Accessibility.Internal,
+ TypeKind.Class,
+ _state.Name,
+ _document.Project,
+ true,
+ _state.Name + ".cs",
+ null,
+ null,
+ _document,
+ false
+ );
+ /*
+ // return generateTypeOptionsService.GetGenerateTypeOptions (
+// _state.Name,
+ // new GenerateTypeDialogOptions (isPublicOnlyAccessibility, typeKindValue, _state.IsAttribute),
+// _document,
+// notificationService,
+// projectManagementService,
+// syntaxFactsService);
+ private class VisualStudioGenerateTypeOptionsService : IGenerateTypeOptionsService
+ {
+ private bool _isNewFile = false;
+ private string _accessSelectString = "";
+ private string _typeKindSelectString = "";
+
+ private IGeneratedCodeRecognitionService _generatedCodeService;
+
+ public VisualStudioGenerateTypeOptionsService(IGeneratedCodeRecognitionService generatedCodeService)
+ {
+ _generatedCodeService = generatedCodeService;
+ }
+
+ public GenerateTypeOptionsResult GetGenerateTypeOptions(
+ string typeName,
+ GenerateTypeDialogOptions generateTypeDialogOptions,
+ Document document,
+ INotificationService notificationService,
+ IProjectManagementService projectManagementService,
+ ISyntaxFactsService syntaxFactsService)
+ {
+ var viewModel = new GenerateTypeDialogViewModel(
+ document,
+ notificationService,
+ projectManagementService,
+ syntaxFactsService,
+ _generatedCodeService,
+ generateTypeDialogOptions,
+ typeName,
+ document.Project.Language == LanguageNames.CSharp ? ".cs" : ".vb",
+ _isNewFile,
+ _accessSelectString,
+ _typeKindSelectString);
+
+ var dialog = new GenerateTypeDialog(viewModel);
+ var result = dialog.ShowModal();
+
+ if (result.HasValue && result.Value)
+ {
+ // Retain choice
+ _isNewFile = viewModel.IsNewFile;
+ _accessSelectString = viewModel.SelectedAccessibilityString;
+ _typeKindSelectString = viewModel.SelectedTypeKindString;
+
+ return new GenerateTypeOptionsResult(
+ accessibility: viewModel.SelectedAccessibility,
+ typeKind: viewModel.SelectedTypeKind,
+ typeName: viewModel.TypeName,
+ project: viewModel.SelectedProject,
+ isNewFile: viewModel.IsNewFile,
+ newFileName: viewModel.FileName.Trim(),
+ folders: viewModel.Folders,
+ fullFilePath: viewModel.FullFilePath,
+ existingDocument: viewModel.SelectedDocument,
+ areFoldersValidIdentifiers: viewModel.AreFoldersValidIdentifiers);
+ }
+ else
+ {
+ return GenerateTypeOptionsResult.Cancelled;
+ }
+ }
+ }
+
+ */
+ }
+
+ private bool IsPublicOnlyAccessibility (State state, Project project)
+ {
+ return _service.IsPublicOnlyAccessibility (state.NameOrMemberAccessExpression, project) || _service.IsPublicOnlyAccessibility (state.SimpleName, project);
+ }
+
+ private TypeKindOptions GetTypeKindOption (State state)
+ {
+ TypeKindOptions typeKindValue;
+
+ var gotPreassignedTypeOptions = GetPredefinedTypeKindOption (state, out typeKindValue);
+ if (!gotPreassignedTypeOptions) {
+ typeKindValue = state.IsSimpleNameGeneric ? TypeKindOptionsHelper.RemoveOptions (typeKindValue, TypeKindOptions.GenericInCompatibleTypes) : typeKindValue;
+ typeKindValue = state.IsMembersWithModule ? TypeKindOptionsHelper.AddOption (typeKindValue, TypeKindOptions.Module) : typeKindValue;
+ typeKindValue = state.IsInterfaceOrEnumNotAllowedInTypeContext ? TypeKindOptionsHelper.RemoveOptions (typeKindValue, TypeKindOptions.Interface, TypeKindOptions.Enum) : typeKindValue;
+ typeKindValue = state.IsDelegateAllowed ? typeKindValue : TypeKindOptionsHelper.RemoveOptions (typeKindValue, TypeKindOptions.Delegate);
+ typeKindValue = state.IsEnumNotAllowed ? TypeKindOptionsHelper.RemoveOptions (typeKindValue, TypeKindOptions.Enum) : typeKindValue;
+ }
+
+ return typeKindValue;
+ }
+
+ private bool GetPredefinedTypeKindOption (State state, out TypeKindOptions typeKindValueFinal)
+ {
+ if (state.IsAttribute) {
+ typeKindValueFinal = TypeKindOptions.Attribute;
+ return true;
+ }
+
+ TypeKindOptions typeKindValue = TypeKindOptions.None;
+ if (_service.TryGetBaseList (state.NameOrMemberAccessExpression, out typeKindValue) || _service.TryGetBaseList (state.SimpleName, out typeKindValue)) {
+ typeKindValueFinal = typeKindValue;
+ return true;
+ }
+
+ if (state.IsClassInterfaceTypes) {
+ typeKindValueFinal = TypeKindOptions.BaseList;
+ return true;
+ }
+
+ if (state.IsDelegateOnly) {
+ typeKindValueFinal = TypeKindOptions.Delegate;
+ return true;
+ }
+
+ if (state.IsTypeGeneratedIntoNamespaceFromMemberAccess) {
+ typeKindValueFinal = state.IsSimpleNameGeneric ? TypeKindOptionsHelper.RemoveOptions (TypeKindOptions.MemberAccessWithNamespace, TypeKindOptions.GenericInCompatibleTypes) : TypeKindOptions.MemberAccessWithNamespace;
+ typeKindValueFinal = state.IsEnumNotAllowed ? TypeKindOptionsHelper.RemoveOptions (typeKindValueFinal, TypeKindOptions.Enum) : typeKindValueFinal;
+ return true;
+ }
+
+ typeKindValueFinal = TypeKindOptions.AllOptions;
+ return false;
+ }
+
+ protected override async Task<IEnumerable<CodeActionOperation>> ComputeOperationsAsync (object options, CancellationToken cancellationToken)
+ {
+ IEnumerable<CodeActionOperation> operations = null;
+
+ var generateTypeOptions = options as GenerateTypeOptionsResult;
+ if (generateTypeOptions != null && !generateTypeOptions.IsCancelled) {
+ var semanticDocument = SemanticDocument.CreateAsync (_document, cancellationToken).WaitAndGetResult (cancellationToken);
+ var editor = new Editor (_service, semanticDocument, _state, true, generateTypeOptions, cancellationToken);
+ operations = await editor.GetOperationsAsync ().ConfigureAwait (false);
+ }
+
+ return operations;
+ }
+ }
+
+ protected abstract bool IsConversionImplicit (Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType);
+
+ private partial class Editor
+ {
+ private TService _service;
+ private TargetProjectChangeInLanguage _targetProjectChangeInLanguage = TargetProjectChangeInLanguage.NoChange;
+ AbstractGenerateTypeService<TService, TSimpleNameSyntax, TObjectCreationExpressionSyntax, TExpressionSyntax, TTypeDeclarationSyntax, TArgumentSyntax> _targetLanguageService;
+
+ private readonly SemanticDocument _document;
+ private readonly State _state;
+ private readonly bool _intoNamespace;
+ private readonly bool _inNewFile;
+ private readonly bool _fromDialog;
+ private readonly GenerateTypeOptionsResult _generateTypeOptionsResult;
+ private readonly CancellationToken _cancellationToken;
+
+
+ public Editor (
+ TService service,
+ SemanticDocument document,
+ State state,
+ bool intoNamespace,
+ bool inNewFile,
+ CancellationToken cancellationToken)
+ {
+ _service = service;
+ _document = document;
+ _state = state;
+ _intoNamespace = intoNamespace;
+ _inNewFile = inNewFile;
+ _cancellationToken = cancellationToken;
+ }
+
+ public Editor (
+ TService service,
+ SemanticDocument document,
+ State state,
+ bool fromDialog,
+ GenerateTypeOptionsResult generateTypeOptionsResult,
+ CancellationToken cancellationToken)
+ {
+ _service = service;
+ _document = document;
+ _state = state;
+ _fromDialog = fromDialog;
+ _generateTypeOptionsResult = generateTypeOptionsResult;
+ _cancellationToken = cancellationToken;
+ }
+
+ private enum TargetProjectChangeInLanguage
+ {
+ NoChange,
+ CSharpToVisualBasic,
+ VisualBasicToCSharp
+ }
+
+ internal async Task<IEnumerable<CodeActionOperation>> GetOperationsAsync ()
+ {
+ // Check to see if it is from GFU Dialog
+ if (!_fromDialog) {
+ // Generate the actual type declaration.
+ var namedType = GenerateNamedType ();
+
+ if (_intoNamespace) {
+ if (_inNewFile) {
+ // Generating into a new file is somewhat complicated.
+ var documentName = GetTypeName (_state) + _service.DefaultFileExtension;
+
+ return await GetGenerateInNewFileOperationsAsync (
+ namedType,
+ documentName,
+ null,
+ true,
+ null,
+ _document.Project,
+ _document.Project,
+ isDialog: false).ConfigureAwait (false);
+ } else {
+ return await GetGenerateIntoContainingNamespaceOperationsAsync (namedType).ConfigureAwait (false);
+ }
+ } else {
+ return await GetGenerateIntoTypeOperationsAsync (namedType).ConfigureAwait (false);
+ }
+ } else {
+ var namedType = GenerateNamedType (_generateTypeOptionsResult);
+
+// // Honor the options from the dialog
+// // Check to see if the type is requested to be generated in cross language Project
+// // e.g.: C# -> VB or VB -> C#
+// if (_document.Project.Language != _generateTypeOptionsResult.Project.Language) {
+// _targetProjectChangeInLanguage =
+// _generateTypeOptionsResult.Project.Language == LanguageNames.CSharp
+// ? TargetProjectChangeInLanguage.VisualBasicToCSharp
+// : TargetProjectChangeInLanguage.CSharpToVisualBasic;
+//
+// // Get the cross language service
+// _targetLanguageService = _generateTypeOptionsResult.Project.LanguageServices.GetService<IGenerateTypeService> ();
+// }
+
+ if (_generateTypeOptionsResult.IsNewFile) {
+ return await GetGenerateInNewFileOperationsAsync (
+ namedType,
+ _generateTypeOptionsResult.NewFileName,
+ _generateTypeOptionsResult.Folders,
+ _generateTypeOptionsResult.AreFoldersValidIdentifiers,
+ _generateTypeOptionsResult.FullFilePath,
+ _generateTypeOptionsResult.Project,
+ _document.Project,
+ isDialog: true).ConfigureAwait (false);
+ } else {
+ return await GetGenerateIntoExistingDocumentAsync (
+ namedType,
+ _document.Project,
+ _generateTypeOptionsResult,
+ isDialog: true).ConfigureAwait (false);
+ }
+ }
+ }
+
+ private string GetNamespaceToGenerateInto ()
+ {
+ var namespaceToGenerateInto = _state.NamespaceToGenerateInOpt.Trim ();
+ var rootNamespace = _service.GetRootNamespace (_document.SemanticModel.Compilation.Options).Trim ();
+ if (!string.IsNullOrWhiteSpace (rootNamespace)) {
+ if (namespaceToGenerateInto == rootNamespace ||
+ namespaceToGenerateInto.StartsWith (rootNamespace + ".", StringComparison.Ordinal)) {
+ namespaceToGenerateInto = namespaceToGenerateInto.Substring (rootNamespace.Length);
+ }
+ }
+
+ return namespaceToGenerateInto;
+ }
+
+ private string GetNamespaceToGenerateIntoForUsageWithNamespace (Project targetProject, Project triggeringProject)
+ {
+ var namespaceToGenerateInto = _state.NamespaceToGenerateInOpt.Trim ();
+
+ if (targetProject.Language == LanguageNames.CSharp ||
+ targetProject == triggeringProject) {
+ // If the target project is C# project then we don't have to make any modification to the namespace
+ // or
+ // This is a VB project generation into itself which requires no change as well
+ return namespaceToGenerateInto;
+ }
+
+ // If the target Project is VB then we have to check if the RootNamespace of the VB project is the parent most namespace of the type being generated
+ // True, Remove the RootNamespace
+ // False, Add Global to the Namespace
+ //Contract.Assert (targetProject.Language == LanguageNames.VisualBasic);
+ var targetLanguageService = _targetLanguageService;
+// if (_document.Project.Language == LanguageNames.VisualBasic) {
+// targetLanguageService = _service;
+// } else {
+// targetLanguageService = _targetLanguageService;
+// }
+
+ var rootNamespace = targetLanguageService.GetRootNamespace (targetProject.CompilationOptions).Trim ();
+ if (!string.IsNullOrWhiteSpace (rootNamespace)) {
+ var rootNamespaceLength = CheckIfRootNamespacePresentInNamespace (namespaceToGenerateInto, rootNamespace);
+ if (rootNamespaceLength > -1) {
+ // True, Remove the RootNamespace
+ namespaceToGenerateInto = namespaceToGenerateInto.Substring (rootNamespaceLength);
+ } else {
+ // False, Add Global to the Namespace
+ namespaceToGenerateInto = AddGlobalDotToTheNamespace (namespaceToGenerateInto);
+ }
+ } else {
+ // False, Add Global to the Namespace
+ namespaceToGenerateInto = AddGlobalDotToTheNamespace (namespaceToGenerateInto);
+ }
+
+ return namespaceToGenerateInto;
+ }
+
+ private string AddGlobalDotToTheNamespace (string namespaceToBeGenerated)
+ {
+ return "Global." + namespaceToBeGenerated;
+ }
+
+ // Returns the length of the meaningful rootNamespace substring part of namespaceToGenerateInto
+ private int CheckIfRootNamespacePresentInNamespace (string namespaceToGenerateInto, string rootNamespace)
+ {
+ if (namespaceToGenerateInto == rootNamespace) {
+ return rootNamespace.Length;
+ }
+
+ if (namespaceToGenerateInto.StartsWith (rootNamespace + ".", StringComparison.Ordinal)) {
+ return rootNamespace.Length + 1;
+ }
+
+ return -1;
+ }
+
+ private void AddFoldersToNamespaceContainers (List<string> container, IList<string> folders)
+ {
+ // Add the folder as part of the namespace if there are not empty
+ if (folders != null && folders.Count != 0) {
+ // Remove the empty entries and replace the spaces in the folder name to '_'
+ var refinedFolders = folders.Where (n => n != null && !n.IsEmpty ()).Select (n => n.Replace (' ', '_')).ToArray ();
+ container.AddRange (refinedFolders);
+ }
+ }
+
+ private async Task<IEnumerable<CodeActionOperation>> GetGenerateInNewFileOperationsAsync (
+ INamedTypeSymbol namedType,
+ string documentName,
+ IList<string> folders,
+ bool areFoldersValidIdentifiers,
+ string fullFilePath,
+ Project projectToBeUpdated,
+ Project triggeringProject,
+ bool isDialog)
+ {
+ // First, we fork the solution with a new, empty, file in it.
+ var newDocumentId = DocumentId.CreateNewId (projectToBeUpdated.Id, debugName: documentName);
+ var newSolution = projectToBeUpdated.Solution.AddDocument (newDocumentId, documentName, string.Empty, folders, fullFilePath);
+
+ // Now we get the semantic model for that file we just added. We do that to get the
+ // root namespace in that new document, along with location for that new namespace.
+ // That way, when we use the code gen service we can say "add this symbol to the
+ // root namespace" and it will pick the one in the new file.
+ var newDocument = newSolution.GetDocument (newDocumentId);
+ var newSemanticModel = await newDocument.GetSemanticModelAsync (_cancellationToken).ConfigureAwait (false);
+ var enclosingNamespace = newSemanticModel.GetEnclosingNamespace (0, _cancellationToken);
+
+ var namespaceContainersAndUsings = GetNamespaceContainersAndAddUsingsOrImport (isDialog, folders, areFoldersValidIdentifiers, projectToBeUpdated, triggeringProject);
+
+ var containers = namespaceContainersAndUsings.Item1;
+ var includeUsingsOrImports = namespaceContainersAndUsings.Item2;
+
+ var rootNamespaceOrType = namedType.GenerateRootNamespaceOrType (containers);
+
+ // Now, actually ask the code gen service to add this namespace or type to the root
+ // namespace in the new file. This will properly generate the code, and add any
+ // additional niceties like imports/usings.
+ var codeGenResult = await CodeGenerator.AddNamespaceOrTypeDeclarationAsync (
+ newSolution,
+ enclosingNamespace,
+ rootNamespaceOrType,
+ new CodeGenerationOptions (newSemanticModel.SyntaxTree.GetLocation (new TextSpan ()), generateDefaultAccessibility: false),
+ _cancellationToken).ConfigureAwait (false);
+
+ // containers is determined to be
+ // 1: folders -> if triggered from Dialog
+ // 2: containers -> if triggered not from a Dialog but from QualifiedName
+ // 3: triggering document folder structure -> if triggered not from a Dialog and a SimpleName
+ var adjustedContainer = isDialog ? folders :
+ _state.SimpleName != _state.NameOrMemberAccessExpression ? containers.ToList () : _document.Document.Folders.ToList ();
+
+ // Now, take the code that would be generated and actually create an edit that would
+ // produce a document with that code in it.
+
+ return CreateAddDocumentAndUpdateUsingsOrImportsOperations (
+ projectToBeUpdated,
+ triggeringProject,
+ documentName,
+ await codeGenResult.GetSyntaxRootAsync (_cancellationToken).ConfigureAwait (false),
+ _document.Document,
+ includeUsingsOrImports,
+ adjustedContainer,
+ SourceCodeKind.Regular,
+ _cancellationToken);
+ }
+
+ private IEnumerable<CodeActionOperation> CreateAddDocumentAndUpdateUsingsOrImportsOperations (
+ Project projectToBeUpdated,
+ Project triggeringProject,
+ string documentName,
+ SyntaxNode root,
+ Document generatingDocument,
+ string includeUsingsOrImports,
+ IList<string> containers,
+ SourceCodeKind sourceCodeKind,
+ CancellationToken cancellationToken)
+ {
+ // TODO(cyrusn): make sure documentId is unique.
+ var documentId = DocumentId.CreateNewId (projectToBeUpdated.Id, documentName);
+
+ var updatedSolution = projectToBeUpdated.Solution.AddDocument (DocumentInfo.Create (
+ documentId,
+ documentName,
+ containers,
+ sourceCodeKind,
+ filePath: Path.Combine (Path.GetDirectoryName (generatingDocument.FilePath), documentName)
+ ));
+
+ updatedSolution = updatedSolution.WithDocumentSyntaxRoot (documentId, root, PreservationMode.PreserveIdentity);
+
+ // Update the Generating Document with a using if required
+ if (includeUsingsOrImports != null) {
+ updatedSolution = _service.TryAddUsingsOrImportToDocument (updatedSolution, null, _document.Document, _state.SimpleName, includeUsingsOrImports, cancellationToken);
+ }
+
+ // Add reference of the updated project to the triggering Project if they are 2 different projects
+ updatedSolution = AddProjectReference (projectToBeUpdated, triggeringProject, updatedSolution);
+
+ return new CodeActionOperation[] {
+ new ApplyChangesOperation (updatedSolution),
+ new OpenDocumentOperation (documentId)
+ };
+ }
+
+ private static Solution AddProjectReference (Project projectToBeUpdated, Project triggeringProject, Solution updatedSolution)
+ {
+ if (projectToBeUpdated != triggeringProject) {
+ if (!triggeringProject.ProjectReferences.Any (pr => pr.ProjectId == projectToBeUpdated.Id)) {
+ updatedSolution = updatedSolution.AddProjectReference (triggeringProject.Id, new ProjectReference (projectToBeUpdated.Id));
+ }
+ }
+
+ return updatedSolution;
+ }
+
+ private async Task<IEnumerable<CodeActionOperation>> GetGenerateIntoContainingNamespaceOperationsAsync (INamedTypeSymbol namedType)
+ {
+ var enclosingNamespace = _document.SemanticModel.GetEnclosingNamespace (
+ _state.SimpleName.SpanStart, _cancellationToken);
+
+ var solution = _document.Project.Solution;
+ var codeGenResult = await CodeGenerator.AddNamedTypeDeclarationAsync (
+ solution,
+ enclosingNamespace,
+ namedType,
+ new CodeGenerationOptions (afterThisLocation: _document.SyntaxTree.GetLocation (_state.SimpleName.Span), generateDefaultAccessibility: false),
+ _cancellationToken)
+ .ConfigureAwait (false);
+
+ return new CodeActionOperation[] { new ApplyChangesOperation (codeGenResult.Project.Solution) };
+ }
+
+ private async Task<IEnumerable<CodeActionOperation>> GetGenerateIntoExistingDocumentAsync (
+ INamedTypeSymbol namedType,
+ Project triggeringProject,
+ GenerateTypeOptionsResult generateTypeOptionsResult,
+ bool isDialog)
+ {
+ var root = await generateTypeOptionsResult.ExistingDocument.GetSyntaxRootAsync (_cancellationToken).ConfigureAwait (false);
+ var folders = generateTypeOptionsResult.ExistingDocument.Folders;
+
+ var namespaceContainersAndUsings = GetNamespaceContainersAndAddUsingsOrImport (isDialog, new List<string> (folders), generateTypeOptionsResult.AreFoldersValidIdentifiers, generateTypeOptionsResult.Project, triggeringProject);
+
+ var containers = namespaceContainersAndUsings.Item1;
+ var includeUsingsOrImports = namespaceContainersAndUsings.Item2;
+
+ Tuple<INamespaceSymbol, INamespaceOrTypeSymbol, Location> enclosingNamespaceGeneratedTypeToAddAndLocation = null;
+ if (_targetProjectChangeInLanguage == TargetProjectChangeInLanguage.NoChange) {
+ enclosingNamespaceGeneratedTypeToAddAndLocation = _service.GetOrGenerateEnclosingNamespaceSymbol (
+ namedType,
+ containers,
+ generateTypeOptionsResult.ExistingDocument,
+ root,
+ _cancellationToken).WaitAndGetResult (_cancellationToken);
+ } else {
+ enclosingNamespaceGeneratedTypeToAddAndLocation = _targetLanguageService.GetOrGenerateEnclosingNamespaceSymbol (
+ namedType,
+ containers,
+ generateTypeOptionsResult.ExistingDocument,
+ root,
+ _cancellationToken).WaitAndGetResult (_cancellationToken);
+ }
+
+ var solution = _document.Project.Solution;
+ var codeGenResult = await CodeGenerator.AddNamespaceOrTypeDeclarationAsync (
+ solution,
+ enclosingNamespaceGeneratedTypeToAddAndLocation.Item1,
+ enclosingNamespaceGeneratedTypeToAddAndLocation.Item2,
+ new CodeGenerationOptions (afterThisLocation: enclosingNamespaceGeneratedTypeToAddAndLocation.Item3, generateDefaultAccessibility: false),
+ _cancellationToken)
+ .ConfigureAwait (false);
+ var newRoot = await codeGenResult.GetSyntaxRootAsync (_cancellationToken).ConfigureAwait (false);
+ var updatedSolution = solution.WithDocumentSyntaxRoot (generateTypeOptionsResult.ExistingDocument.Id, newRoot, PreservationMode.PreserveIdentity);
+
+ // Update the Generating Document with a using if required
+ if (includeUsingsOrImports != null) {
+ updatedSolution = _service.TryAddUsingsOrImportToDocument (
+ updatedSolution,
+ generateTypeOptionsResult.ExistingDocument.Id == _document.Document.Id ? newRoot : null,
+ _document.Document,
+ _state.SimpleName,
+ includeUsingsOrImports,
+ _cancellationToken);
+ }
+
+ updatedSolution = AddProjectReference (generateTypeOptionsResult.Project, triggeringProject, updatedSolution);
+
+ return new CodeActionOperation[] { new ApplyChangesOperation (updatedSolution) };
+ }
+
+ private Tuple<string[], string> GetNamespaceContainersAndAddUsingsOrImport (
+ bool isDialog,
+ IList<string> folders,
+ bool areFoldersValidIdentifiers,
+ Project targetProject,
+ Project triggeringProject)
+ {
+ string includeUsingsOrImports = null;
+ if (!areFoldersValidIdentifiers) {
+ folders = SpecializedCollections.EmptyList<string> ();
+ }
+
+ // Now actually create the symbol that we want to add to the root namespace. The
+ // symbol may either be a named type (if we're not generating into a namespace) or
+ // it may be a namespace symbol.
+ string[] containers = null;
+ if (!isDialog) {
+ // Not generated from the Dialog
+ containers = GetNamespaceToGenerateInto ().Split (new[] { '.' }, StringSplitOptions.RemoveEmptyEntries);
+ } else if (!_service.IsSimpleName (_state.NameOrMemberAccessExpression)) {
+ // If the usage was with a namespace
+ containers = GetNamespaceToGenerateIntoForUsageWithNamespace (targetProject, triggeringProject).Split (new[] { '.' }, StringSplitOptions.RemoveEmptyEntries);
+ } else {
+ // Generated from the Dialog
+ List<string> containerList = new List<string> ();
+
+ string rootNamespaceOfTheProjectGeneratedInto;
+
+ if (_targetProjectChangeInLanguage == TargetProjectChangeInLanguage.NoChange) {
+ rootNamespaceOfTheProjectGeneratedInto = _service.GetRootNamespace (_generateTypeOptionsResult.Project.CompilationOptions).Trim ();
+ } else {
+ rootNamespaceOfTheProjectGeneratedInto = _targetLanguageService.GetRootNamespace (_generateTypeOptionsResult.Project.CompilationOptions).Trim ();
+ }
+
+ // TODO : Default namespace support
+ //var projectManagementService = _document.Project.Solution.Workspace.Services.GetService<IProjectManagementService> ();
+ var defaultNamespace = "";// projectManagementService.GetDefaultNamespace (targetProject, targetProject.Solution.Workspace);
+
+ // Case 1 : If the type is generated into the same C# project or
+ // Case 2 : If the type is generated from a C# project to a C# Project
+ // Case 3 : If the Type is generated from a VB Project to a C# Project
+ // Using and Namespace will be the DefaultNamespace + Folder Structure
+ if ((_document.Project == _generateTypeOptionsResult.Project && _document.Project.Language == LanguageNames.CSharp) ||
+ (_targetProjectChangeInLanguage == TargetProjectChangeInLanguage.NoChange && _generateTypeOptionsResult.Project.Language == LanguageNames.CSharp) ||
+ _targetProjectChangeInLanguage == TargetProjectChangeInLanguage.VisualBasicToCSharp) {
+ if (!string.IsNullOrWhiteSpace (defaultNamespace)) {
+ containerList.Add (defaultNamespace);
+ }
+
+ // Populate the ContainerList
+ AddFoldersToNamespaceContainers (containerList, folders);
+
+ containers = containerList.ToArray ();
+ includeUsingsOrImports = string.Join (".", containerList.ToArray ());
+ }
+
+ // Case 4 : If the type is generated into the same VB project or
+ // Case 5 : If Type is generated from a VB Project to VB Project
+ // Case 6 : If Type is generated from a C# Project to VB Project
+ // Namespace will be Folder Structure and Import will have the RootNamespace of the project generated into as part of the Imports
+ if ((_document.Project == _generateTypeOptionsResult.Project && _document.Project.Language == LanguageNames.VisualBasic) ||
+ (_document.Project != _generateTypeOptionsResult.Project && _targetProjectChangeInLanguage == TargetProjectChangeInLanguage.NoChange && _generateTypeOptionsResult.Project.Language == LanguageNames.VisualBasic) ||
+ _targetProjectChangeInLanguage == TargetProjectChangeInLanguage.CSharpToVisualBasic) {
+ // Populate the ContainerList
+ AddFoldersToNamespaceContainers (containerList, folders);
+ containers = containerList.ToArray ();
+ includeUsingsOrImports = string.Join (".", containerList.ToArray ());
+ if (!string.IsNullOrWhiteSpace (rootNamespaceOfTheProjectGeneratedInto)) {
+ includeUsingsOrImports = string.IsNullOrEmpty (includeUsingsOrImports) ?
+ rootNamespaceOfTheProjectGeneratedInto :
+ rootNamespaceOfTheProjectGeneratedInto + "." + includeUsingsOrImports;
+ }
+ }
+ }
+
+ return Tuple.Create (containers, includeUsingsOrImports);
+ }
+
+ private async Task<IEnumerable<CodeActionOperation>> GetGenerateIntoTypeOperationsAsync (INamedTypeSymbol namedType)
+ {
+ //var codeGenService = GetCodeGenerationService ();
+ var solution = _document.Project.Solution;
+ var codeGenResult = await CodeGenerator.AddNamedTypeDeclarationAsync (
+ solution,
+ _state.TypeToGenerateInOpt,
+ namedType,
+ new CodeGenerationOptions (contextLocation: _state.SimpleName.GetLocation (), generateDefaultAccessibility: false),
+ _cancellationToken)
+ .ConfigureAwait (false);
+
+ return new CodeActionOperation[] { new ApplyChangesOperation (codeGenResult.Project.Solution) };
+ }
+
+ private IList<ITypeSymbol> GetArgumentTypes (IList<TArgumentSyntax> argumentList)
+ {
+ var types = argumentList.Select (a => _service.DetermineArgumentType (_document.SemanticModel, a, _cancellationToken));
+ return types.Select (FixType).ToList ();
+ }
+
+ private ITypeSymbol FixType (
+ ITypeSymbol typeSymbol)
+ {
+ var compilation = _document.SemanticModel.Compilation;
+ return typeSymbol.RemoveUnnamedErrorTypes (compilation);
+ }
+
+ private CSharpCodeGenerationService GetCodeGenerationService ()
+ {
+ var language = _state.TypeToGenerateInOpt == null
+ ? _state.SimpleName.Language
+ : _state.TypeToGenerateInOpt.Language;
+ return new CSharpCodeGenerationService(_document.Project.Solution.Workspace, language);
+ }
+
+ private bool TryFindMatchingField (
+ string parameterName,
+ ITypeSymbol parameterType,
+ Dictionary<string, ISymbol> parameterToFieldMap,
+ bool caseSensitive)
+ {
+ // If the base types have an accessible field or property with the same name and
+ // an acceptable type, then we should just defer to that.
+ if (_state.BaseTypeOrInterfaceOpt != null) {
+ var comparison = caseSensitive ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase;
+ var query =
+ _state.BaseTypeOrInterfaceOpt
+ .GetBaseTypesAndThis ()
+ .SelectMany (t => t.GetMembers ())
+ .Where (s => s.Name.Equals (parameterName, comparison));
+ var symbol = query.FirstOrDefault (IsSymbolAccessible);
+
+ if (IsViableFieldOrProperty (parameterType, symbol)) {
+ parameterToFieldMap [parameterName] = symbol;
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private bool IsViableFieldOrProperty (
+ ITypeSymbol parameterType,
+ ISymbol symbol)
+ {
+ if (symbol != null && !symbol.IsStatic && parameterType.Language == symbol.Language) {
+ if (symbol is IFieldSymbol) {
+ var field = (IFieldSymbol)symbol;
+ return
+ !field.IsReadOnly &&
+ _service.IsConversionImplicit (_document.SemanticModel.Compilation, parameterType, field.Type);
+ } else if (symbol is IPropertySymbol) {
+ var property = (IPropertySymbol)symbol;
+ return
+ property.Parameters.Length == 0 &&
+ property.SetMethod != null &&
+ IsSymbolAccessible (property.SetMethod) &&
+ _service.IsConversionImplicit (_document.SemanticModel.Compilation, parameterType, property.Type);
+ }
+ }
+
+ return false;
+ }
+
+ private bool IsSymbolAccessible (ISymbol symbol)
+ {
+ // Public and protected constructors are accessible. Internal constructors are
+ // accessible if we have friend access. We can't call the normal accessibility
+ // checkers since they will think that a protected constructor isn't accessible
+ // (since we don't have the destination type that would have access to them yet).
+ switch (symbol.DeclaredAccessibility) {
+ case Accessibility.ProtectedOrInternal:
+ case Accessibility.Protected:
+ case Accessibility.Public:
+ return true;
+ case Accessibility.ProtectedAndInternal:
+ case Accessibility.Internal:
+ // TODO: Code coverage
+ return _document.SemanticModel.Compilation.Assembly.IsSameAssemblyOrHasFriendAccessTo (
+ symbol.ContainingAssembly);
+
+ default:
+ return false;
+ }
+ }
+ }
+
+ internal abstract IMethodSymbol GetDelegatingConstructor (TObjectCreationExpressionSyntax objectCreation, INamedTypeSymbol namedType, SemanticModel model, ISet<IMethodSymbol> candidates, CancellationToken cancellationToken);
+
+ private partial class Editor
+ {
+ private INamedTypeSymbol GenerateNamedType ()
+ {
+ return CodeGenerationSymbolFactory.CreateNamedTypeSymbol (
+ DetermineAttributes (),
+ DetermineAccessibility (),
+ DetermineModifiers (),
+ DetermineTypeKind (),
+ DetermineName (),
+ DetermineTypeParameters (),
+ DetermineBaseType (),
+ DetermineInterfaces (),
+ members: DetermineMembers ());
+ }
+
+ private INamedTypeSymbol GenerateNamedType (GenerateTypeOptionsResult options)
+ {
+ if (options.TypeKind == TypeKind.Delegate) {
+ return CodeGenerationSymbolFactory.CreateDelegateTypeSymbol (
+ DetermineAttributes (),
+ options.Accessibility,
+ DetermineModifiers (),
+ DetermineReturnType (options),
+ options.TypeName,
+ DetermineTypeParameters (options),
+ DetermineParameters (options));
+ }
+
+ return CodeGenerationSymbolFactory.CreateNamedTypeSymbol (
+ DetermineAttributes (),
+ options.Accessibility,
+ DetermineModifiers (),
+ options.TypeKind,
+ options.TypeName,
+ DetermineTypeParameters (),
+ DetermineBaseType (),
+ DetermineInterfaces (),
+ members: DetermineMembers (options));
+ }
+
+ private ITypeSymbol DetermineReturnType (GenerateTypeOptionsResult options)
+ {
+ if (_state.DelegateMethodSymbol == null ||
+ _state.DelegateMethodSymbol.ReturnType == null ||
+ _state.DelegateMethodSymbol.ReturnType is IErrorTypeSymbol) {
+ // Since we cannot determine the return type, we are returning void
+ return _state.Compilation.GetSpecialType (SpecialType.System_Void);
+ } else {
+ return _state.DelegateMethodSymbol.ReturnType;
+ }
+ }
+
+ private IList<ITypeParameterSymbol> DetermineTypeParameters (GenerateTypeOptionsResult options)
+ {
+ if (_state.DelegateMethodSymbol != null) {
+ return _state.DelegateMethodSymbol.TypeParameters;
+ }
+
+ // If the delegate symbol cannot be determined then
+ return DetermineTypeParameters ();
+ }
+
+ private IList<IParameterSymbol> DetermineParameters (GenerateTypeOptionsResult options)
+ {
+ if (_state.DelegateMethodSymbol != null) {
+ return _state.DelegateMethodSymbol.Parameters;
+ }
+
+ return null;
+ }
+
+ private IList<ISymbol> DetermineMembers (GenerateTypeOptionsResult options = null)
+ {
+ var members = new List<ISymbol> ();
+ AddMembers (members, options);
+
+ if (_state.IsException) {
+ AddExceptionConstructors (members);
+ }
+
+ return members;
+ }
+
+ private void AddMembers (IList<ISymbol> members, GenerateTypeOptionsResult options = null)
+ {
+ AddProperties (members);
+
+ IList<TArgumentSyntax> argumentList;
+ if (!_service.TryGetArgumentList (_state.ObjectCreationExpressionOpt, out argumentList)) {
+ return;
+ }
+
+ var parameterTypes = GetArgumentTypes (argumentList);
+
+ // Don't generate this constructor if it would conflict with a default exception
+ // constructor. Default exception constructors will be added automatically by our
+ // caller.
+ if (_state.IsException &&
+ _state.BaseTypeOrInterfaceOpt.InstanceConstructors.Any (
+ c => c.Parameters.Select (p => p.Type).SequenceEqual (parameterTypes))) {
+ return;
+ }
+
+ // If there's an accessible base constructor that would accept these types, then
+ // just call into that instead of generating fields.
+ if (_state.BaseTypeOrInterfaceOpt != null) {
+ if (_state.BaseTypeOrInterfaceOpt.TypeKind == TypeKind.Interface && argumentList.Count == 0) {
+ // No need to add the default constructor if our base type is going to be
+ // 'object'. We get that constructor for free.
+ return;
+ }
+
+ var accessibleInstanceConstructors = _state.BaseTypeOrInterfaceOpt.InstanceConstructors.Where (
+ IsSymbolAccessible).ToSet ();
+
+ if (accessibleInstanceConstructors.Any ()) {
+ var delegatedConstructor = _service.GetDelegatingConstructor (_state.ObjectCreationExpressionOpt, _state.BaseTypeOrInterfaceOpt, _document.SemanticModel, accessibleInstanceConstructors, _cancellationToken);
+ if (delegatedConstructor != null) {
+ // There was a best match. Call it directly.
+ AddBaseDelegatingConstructor (delegatedConstructor, members);
+ return;
+ }
+ }
+ }
+
+ // Otherwise, just generate a normal constructor that assigns any provided
+ // parameters into fields.
+ AddFieldDelegatingConstructor (argumentList, members, options);
+ }
+
+ private void AddProperties (IList<ISymbol> members)
+ {
+ foreach (var property in _state.PropertiesToGenerate) {
+ IPropertySymbol generatedProperty;
+ if (_service.TryGenerateProperty (property, _document.SemanticModel, _cancellationToken, out generatedProperty)) {
+ members.Add (generatedProperty);
+ }
+ }
+ }
+
+ private void AddBaseDelegatingConstructor (
+ IMethodSymbol methodSymbol,
+ IList<ISymbol> members)
+ {
+ // If we're generating a constructor to delegate into the no-param base constructor
+ // then we can just elide the constructor entirely.
+ if (methodSymbol.Parameters.Length == 0) {
+ return;
+ }
+
+ var factory = _document.Project.LanguageServices.GetService<SyntaxGenerator> ();
+ members.Add (factory.CreateBaseDelegatingConstructor (
+ methodSymbol, DetermineName ()));
+ }
+
+ private void AddFieldDelegatingConstructor (
+ IList<TArgumentSyntax> argumentList, IList<ISymbol> members, GenerateTypeOptionsResult options = null)
+ {
+ var factory = _document.Project.LanguageServices.GetService<SyntaxGenerator> ();
+
+ var availableTypeParameters = _service.GetAvailableTypeParameters (_state, _document.SemanticModel, _intoNamespace, _cancellationToken);
+ var parameterTypes = GetArgumentTypes (argumentList);
+ var parameterNames = _service.GenerateParameterNames (_document.SemanticModel, argumentList);
+ var parameters = new List<IParameterSymbol> ();
+
+ var parameterToExistingFieldMap = new Dictionary<string, ISymbol> ();
+ var parameterToNewFieldMap = new Dictionary<string, string> ();
+
+ for (var i = 0; i < parameterNames.Count; i++) {
+ var refKind = argumentList [i].GetRefKindOfArgument ();
+
+ var parameterName = parameterNames [i];
+ var parameterType = (ITypeSymbol)parameterTypes [i];
+ parameterType = parameterType.RemoveUnavailableTypeParameters (
+ _document.SemanticModel.Compilation, availableTypeParameters);
+
+ if (!TryFindMatchingField (parameterName, parameterType, parameterToExistingFieldMap, caseSensitive: true)) {
+ if (!TryFindMatchingField (parameterName, parameterType, parameterToExistingFieldMap, caseSensitive: false)) {
+ parameterToNewFieldMap [parameterName] = parameterName;
+ }
+ }
+
+ parameters.Add (CodeGenerationSymbolFactory.CreateParameterSymbol (
+ attributes: null,
+ refKind: refKind,
+ isParams: false,
+ type: parameterType,
+ name: parameterName));
+ }
+
+ // Empty Constructor for Struct is not allowed
+ if (!(parameters.Count == 0 && options != null && (options.TypeKind == TypeKind.Struct || options.TypeKind == TypeKind.Structure))) {
+ var symbols = factory.CreateFieldDelegatingConstructor (DetermineName (), null, parameters, parameterToExistingFieldMap, parameterToNewFieldMap, _cancellationToken);
+ foreach (var c in symbols)
+ members.Add (c);
+ }
+ }
+
+ private void AddExceptionConstructors (IList<ISymbol> members)
+ {
+ var factory = _document.Project.LanguageServices.GetService<SyntaxGenerator> ();
+ var exceptionType = _document.SemanticModel.Compilation.ExceptionType ();
+ var constructors =
+ exceptionType.InstanceConstructors
+ .Where (c => c.DeclaredAccessibility == Accessibility.Public || c.DeclaredAccessibility == Accessibility.Protected)
+ .Select (c => CodeGenerationSymbolFactory.CreateConstructorSymbol (
+ attributes: null,
+ accessibility: c.DeclaredAccessibility,
+ modifiers: default(DeclarationModifiers),
+ typeName: DetermineName (),
+ parameters: c.Parameters,
+ statements: null,
+ baseConstructorArguments: c.Parameters.Length == 0 ? null : factory.CreateArguments (c.Parameters)));
+ foreach (var c in constructors)
+ members.Add (c);
+ }
+
+ private IList<AttributeData> DetermineAttributes ()
+ {
+ if (_state.IsException) {
+ var serializableType = _document.SemanticModel.Compilation.SerializableAttributeType ();
+ if (serializableType != null) {
+ var attribute = CodeGenerationSymbolFactory.CreateAttributeData (serializableType);
+ return new[] { attribute };
+ }
+ }
+
+ return null;
+ }
+
+ private Accessibility DetermineAccessibility ()
+ {
+ return _service.GetAccessibility (_state, _document.SemanticModel, _intoNamespace, _cancellationToken);
+ }
+
+ private DeclarationModifiers DetermineModifiers ()
+ {
+ return default(DeclarationModifiers);
+ }
+
+ private INamedTypeSymbol DetermineBaseType ()
+ {
+ if (_state.BaseTypeOrInterfaceOpt == null || _state.BaseTypeOrInterfaceOpt.TypeKind == TypeKind.Interface) {
+ return null;
+ }
+
+ return RemoveUnavailableTypeParameters (_state.BaseTypeOrInterfaceOpt);
+ }
+
+ private IList<INamedTypeSymbol> DetermineInterfaces ()
+ {
+ if (_state.BaseTypeOrInterfaceOpt != null && _state.BaseTypeOrInterfaceOpt.TypeKind == TypeKind.Interface) {
+ var type = RemoveUnavailableTypeParameters (_state.BaseTypeOrInterfaceOpt);
+ if (type != null) {
+ return new[] { type };
+ }
+ }
+
+ return SpecializedCollections.EmptyList<INamedTypeSymbol> ();
+ }
+
+ private INamedTypeSymbol RemoveUnavailableTypeParameters (INamedTypeSymbol type)
+ {
+ return type.RemoveUnavailableTypeParameters (
+ _document.SemanticModel.Compilation, GetAvailableTypeParameters ()) as INamedTypeSymbol;
+ }
+
+ private string DetermineName ()
+ {
+ return GetTypeName (_state);
+ }
+
+ private IList<ITypeParameterSymbol> DetermineTypeParameters ()
+ {
+ return _service.GetTypeParameters (_state, _document.SemanticModel, _cancellationToken);
+ }
+
+ private TypeKind DetermineTypeKind ()
+ {
+ return _state.IsStruct
+ ? TypeKind.Struct
+ : _state.IsInterface
+ ? TypeKind.Interface
+ : TypeKind.Class;
+ }
+
+ protected IList<ITypeParameterSymbol> GetAvailableTypeParameters ()
+ {
+ var availableInnerTypeParameters = _service.GetTypeParameters (_state, _document.SemanticModel, _cancellationToken);
+ var availableOuterTypeParameters = !_intoNamespace && _state.TypeToGenerateInOpt != null
+ ? _state.TypeToGenerateInOpt.GetAllTypeParameters ()
+ : SpecializedCollections.EmptyEnumerable<ITypeParameterSymbol> ();
+
+ return availableOuterTypeParameters.Concat (availableInnerTypeParameters).ToList ();
+ }
+ }
+
+ internal abstract bool TryGenerateProperty (TSimpleNameSyntax propertyName, SemanticModel semanticModel, CancellationToken cancellationToken, out IPropertySymbol property);
+
+ protected class State
+ {
+ public string Name { get; private set; }
+
+ public bool NameIsVerbatim { get; private set; }
+
+ // The name node that we're on. Will be used to the name the type if it's
+ // generated.
+ public TSimpleNameSyntax SimpleName { get; private set; }
+
+ // The entire expression containing the name, not including the creation. i.e. "X.Foo"
+ // in "new X.Foo()".
+ public TExpressionSyntax NameOrMemberAccessExpression { get; private set; }
+
+ // The object creation node if we have one. i.e. if we're on the 'Foo' in "new X.Foo()".
+ public TObjectCreationExpressionSyntax ObjectCreationExpressionOpt { get; private set; }
+
+ // One of these will be non null. It's also possible for both to be non null. For
+ // example, if you have "class C { Foo f; }", then "Foo" can be generated inside C or
+ // inside the global namespace. The namespace can be null or the type can be null if the
+ // user has something like "ExistingType.NewType" or "ExistingNamespace.NewType". In
+ // that case they're being explicit about what they want to generate into.
+ public INamedTypeSymbol TypeToGenerateInOpt { get; private set; }
+
+ public string NamespaceToGenerateInOpt { get; private set; }
+
+ // If we can infer a base type or interface for this type.
+ //
+ // i.e.: "IList<int> foo = new MyList();"
+ public INamedTypeSymbol BaseTypeOrInterfaceOpt { get; private set; }
+
+ public bool IsInterface { get; private set; }
+
+ public bool IsStruct { get; private set; }
+
+ public bool IsAttribute { get; private set; }
+
+ public bool IsException { get; private set; }
+
+ public bool IsMembersWithModule { get; private set; }
+
+ public bool IsTypeGeneratedIntoNamespaceFromMemberAccess { get; private set; }
+
+ public bool IsSimpleNameGeneric { get; private set; }
+
+ public bool IsPublicAccessibilityForTypeGeneration { get; private set; }
+
+ public bool IsInterfaceOrEnumNotAllowedInTypeContext { get; private set; }
+
+ public IMethodSymbol DelegateMethodSymbol { get; private set; }
+
+ public bool IsDelegateAllowed { get; private set; }
+
+ public bool IsEnumNotAllowed { get; private set; }
+
+ public Compilation Compilation { get; }
+
+ public bool IsDelegateOnly { get; private set; }
+
+ public bool IsClassInterfaceTypes { get; private set; }
+
+ public List<TSimpleNameSyntax> PropertiesToGenerate { get; private set; }
+
+ private State (Compilation compilation)
+ {
+ this.Compilation = compilation;
+ }
+
+ public static State Generate (
+ TService service,
+ SemanticDocument document,
+ SyntaxNode node,
+ CancellationToken cancellationToken)
+ {
+ var state = new State (document.SemanticModel.Compilation);
+ if (!state.TryInitialize (service, document, node, cancellationToken)) {
+ return null;
+ }
+
+ return state;
+ }
+
+ private bool TryInitialize (
+ TService service,
+ SemanticDocument document,
+ SyntaxNode node,
+ CancellationToken cancellationToken)
+ {
+ if (!(node is TSimpleNameSyntax)) {
+ return false;
+ }
+
+ this.SimpleName = (TSimpleNameSyntax)node;
+ string name;
+ int arity;
+ this.SimpleName.GetNameAndArityOfSimpleName (out name, out arity);
+
+ this.Name = name;
+ this.NameIsVerbatim = this.SimpleName.GetFirstToken ().IsVerbatimIdentifier ();
+ if (string.IsNullOrWhiteSpace (this.Name)) {
+ return false;
+ }
+
+ // We only support simple names or dotted names. i.e. "(some + expr).Foo" is not a
+ // valid place to generate a type for Foo.
+ GenerateTypeServiceStateOptions generateTypeServiceStateOptions;
+ if (!service.TryInitializeState (document, this.SimpleName, cancellationToken, out generateTypeServiceStateOptions)) {
+ return false;
+ }
+
+ this.NameOrMemberAccessExpression = generateTypeServiceStateOptions.NameOrMemberAccessExpression;
+ this.ObjectCreationExpressionOpt = generateTypeServiceStateOptions.ObjectCreationExpressionOpt;
+
+ var semanticModel = document.SemanticModel;
+ var info = semanticModel.GetSymbolInfo (this.SimpleName, cancellationToken);
+ if (info.Symbol != null) {
+ // This bound, so no need to generate anything.
+ return false;
+ }
+
+ if (!semanticModel.IsTypeContext (this.NameOrMemberAccessExpression.SpanStart, cancellationToken) &&
+ !semanticModel.IsExpressionContext (this.NameOrMemberAccessExpression.SpanStart, cancellationToken) &&
+ !semanticModel.IsStatementContext (this.NameOrMemberAccessExpression.SpanStart, cancellationToken) &&
+ !semanticModel.IsNameOfContext (this.NameOrMemberAccessExpression.SpanStart, cancellationToken) &&
+ !semanticModel.IsNamespaceContext (this.NameOrMemberAccessExpression.SpanStart, cancellationToken)) {
+ return false;
+ }
+
+ // If this isn't something that can be created, then don't bother offering to create
+ // it.
+ if (info.CandidateReason == CandidateReason.NotCreatable) {
+ return false;
+ }
+
+ if (info.CandidateReason == CandidateReason.Inaccessible ||
+ info.CandidateReason == CandidateReason.NotReferencable ||
+ info.CandidateReason == CandidateReason.OverloadResolutionFailure) {
+ // We bound to something inaccessible, or overload resolution on a
+ // constructor call failed. Don't want to offer GenerateType here.
+ return false;
+ }
+
+ if (this.ObjectCreationExpressionOpt != null) {
+ // If we're new'ing up something illegal, then don't offer generate type.
+ var typeInfo = semanticModel.GetTypeInfo (this.ObjectCreationExpressionOpt, cancellationToken);
+ if (typeInfo.Type.IsModuleType ()) {
+ return false;
+ }
+ }
+
+ DetermineNamespaceOrTypeToGenerateIn (service, document, cancellationToken);
+
+ // Now, try to infer a possible base type for this new class/interface.
+ this.InferBaseType (service, document, cancellationToken);
+ this.IsInterface = GenerateInterface (service, cancellationToken);
+ this.IsStruct = GenerateStruct (service, semanticModel, cancellationToken);
+ this.IsAttribute = this.BaseTypeOrInterfaceOpt != null && this.BaseTypeOrInterfaceOpt.Equals (semanticModel.Compilation.AttributeType ());
+ this.IsException = this.BaseTypeOrInterfaceOpt != null && this.BaseTypeOrInterfaceOpt.Equals (semanticModel.Compilation.ExceptionType ());
+ this.IsMembersWithModule = generateTypeServiceStateOptions.IsMembersWithModule;
+ this.IsTypeGeneratedIntoNamespaceFromMemberAccess = generateTypeServiceStateOptions.IsTypeGeneratedIntoNamespaceFromMemberAccess;
+ this.IsInterfaceOrEnumNotAllowedInTypeContext = generateTypeServiceStateOptions.IsInterfaceOrEnumNotAllowedInTypeContext;
+ this.IsDelegateAllowed = generateTypeServiceStateOptions.IsDelegateAllowed;
+ this.IsDelegateOnly = generateTypeServiceStateOptions.IsDelegateOnly;
+ this.IsEnumNotAllowed = generateTypeServiceStateOptions.IsEnumNotAllowed;
+ this.DelegateMethodSymbol = generateTypeServiceStateOptions.DelegateCreationMethodSymbol;
+ this.IsClassInterfaceTypes = generateTypeServiceStateOptions.IsClassInterfaceTypes;
+ this.IsSimpleNameGeneric = service.IsGenericName (this.SimpleName);
+ this.PropertiesToGenerate = generateTypeServiceStateOptions.PropertiesToGenerate;
+
+ if (this.IsAttribute && this.TypeToGenerateInOpt.GetAllTypeParameters ().Any ()) {
+ this.TypeToGenerateInOpt = null;
+ }
+
+ return this.TypeToGenerateInOpt != null || this.NamespaceToGenerateInOpt != null;
+ }
+
+ private void InferBaseType (
+ TService service,
+ SemanticDocument document,
+ CancellationToken cancellationToken)
+ {
+ // See if we can find a possible base type for the type being generated.
+ // NOTE(cyrusn): I currently limit this to when we have an object creation node.
+ // That's because that's when we would have an expression that could be conerted to
+ // somethign else. i.e. if the user writes "IList<int> list = new Foo()" then we can
+ // infer a base interface for 'Foo'. However, if they write "IList<int> list = Foo"
+ // then we don't really want to infer a base type for 'Foo'.
+
+ // However, there are a few other cases were we can infer a base type.
+ if (service.IsInCatchDeclaration (this.NameOrMemberAccessExpression)) {
+ this.BaseTypeOrInterfaceOpt = document.SemanticModel.Compilation.ExceptionType ();
+ } else if (NameOrMemberAccessExpression.IsAttributeName ()) {
+ this.BaseTypeOrInterfaceOpt = document.SemanticModel.Compilation.AttributeType ();
+ } else if (
+ service.IsArrayElementType (this.NameOrMemberAccessExpression) ||
+ service.IsInVariableTypeContext (this.NameOrMemberAccessExpression) ||
+ this.ObjectCreationExpressionOpt != null) {
+ var expr = this.ObjectCreationExpressionOpt ?? this.NameOrMemberAccessExpression;
+ var baseType = TypeGuessing.typeInferenceService.InferType (document.SemanticModel, expr, objectAsDefault: true, cancellationToken: cancellationToken) as INamedTypeSymbol;
+ SetBaseType (baseType);
+ }
+ }
+
+ private void SetBaseType (INamedTypeSymbol baseType)
+ {
+ if (baseType == null) {
+ return;
+ }
+
+ // A base type need to be non class or interface type. Also, being 'object' is
+ // redundant as the base type.
+ if (baseType.IsSealed || baseType.IsStatic || baseType.SpecialType == SpecialType.System_Object) {
+ return;
+ }
+
+ if (baseType.TypeKind != TypeKind.Class && baseType.TypeKind != TypeKind.Interface) {
+ return;
+ }
+
+ this.BaseTypeOrInterfaceOpt = baseType;
+ }
+
+ private bool GenerateStruct (TService service, SemanticModel semanticModel, CancellationToken cancellationToken)
+ {
+ return service.IsInValueTypeConstraintContext (semanticModel, this.NameOrMemberAccessExpression, cancellationToken);
+ }
+
+ private bool GenerateInterface (
+ TService service,
+ CancellationToken cancellationToken)
+ {
+ if (!this.IsAttribute &&
+ !this.IsException &&
+ this.Name.LooksLikeInterfaceName () &&
+ this.ObjectCreationExpressionOpt == null &&
+ (this.BaseTypeOrInterfaceOpt == null || this.BaseTypeOrInterfaceOpt.TypeKind == TypeKind.Interface)) {
+ return true;
+ }
+
+ return service.IsInInterfaceList (this.NameOrMemberAccessExpression);
+ }
+
+ private void DetermineNamespaceOrTypeToGenerateIn (
+ TService service,
+ SemanticDocument document,
+ CancellationToken cancellationToken)
+ {
+ DetermineNamespaceOrTypeToGenerateInWorker (service, document.SemanticModel, cancellationToken);
+
+ // Can only generate into a type if it's a class and it's from source.
+ if (this.TypeToGenerateInOpt != null) {
+ if (this.TypeToGenerateInOpt.TypeKind != TypeKind.Class &&
+ this.TypeToGenerateInOpt.TypeKind != TypeKind.Module) {
+ this.TypeToGenerateInOpt = null;
+ } else {
+ var symbol = SymbolFinder.FindSourceDefinitionAsync (this.TypeToGenerateInOpt, document.Project.Solution, cancellationToken).WaitAndGetResult (cancellationToken);
+ if (symbol == null ||
+ !symbol.IsKind (SymbolKind.NamedType) ||
+ !symbol.Locations.Any (loc => loc.IsInSource)) {
+ this.TypeToGenerateInOpt = null;
+ return;
+ }
+
+ var sourceTreeToBeGeneratedIn = symbol.Locations.First (loc => loc.IsInSource).SourceTree;
+ var documentToBeGeneratedIn = document.Project.Solution.GetDocument (sourceTreeToBeGeneratedIn);
+
+ if (documentToBeGeneratedIn == null) {
+ this.TypeToGenerateInOpt = null;
+ return;
+ }
+
+ // If the 2 documents are in different project then we must have Public Accessibility.
+ // If we are generating in a website project, we also want to type to be public so the
+ // designer files can access the type.
+ if (documentToBeGeneratedIn.Project != document.Project ||
+ service.GeneratedTypesMustBePublic (documentToBeGeneratedIn.Project)) {
+ this.IsPublicAccessibilityForTypeGeneration = true;
+ }
+
+ this.TypeToGenerateInOpt = (INamedTypeSymbol)symbol;
+ }
+ }
+
+ if (this.TypeToGenerateInOpt != null) {
+ if (!CodeGenerator.CanAdd (document.Project.Solution, this.TypeToGenerateInOpt, cancellationToken)) {
+ this.TypeToGenerateInOpt = null;
+ }
+ }
+ }
+
+ private bool DetermineNamespaceOrTypeToGenerateInWorker (
+ TService service,
+ SemanticModel semanticModel,
+ CancellationToken cancellationToken)
+ {
+ // If we're on the right of a dot, see if we can figure out what's on the left. If
+ // it doesn't bind to a type or a namespace, then we can't proceed.
+ if (this.SimpleName != this.NameOrMemberAccessExpression) {
+ return DetermineNamespaceOrTypeToGenerateIn (
+ service, semanticModel,
+ service.GetLeftSideOfDot (this.SimpleName), cancellationToken);
+ } else {
+ // The name is standing alone. We can either generate the type into our
+ // containing type, or into our containing namespace.
+ //
+ // TODO(cyrusn): We need to make this logic work if the type is in the
+ // base/interface list of a type.
+ var format = SymbolDisplayFormat.FullyQualifiedFormat.WithGlobalNamespaceStyle (SymbolDisplayGlobalNamespaceStyle.Omitted);
+ this.TypeToGenerateInOpt = service.DetermineTypeToGenerateIn (semanticModel, this.SimpleName, cancellationToken);
+ if (this.TypeToGenerateInOpt != null) {
+ this.NamespaceToGenerateInOpt = this.TypeToGenerateInOpt.ContainingNamespace.ToDisplayString (format);
+ } else {
+ var namespaceSymbol = semanticModel.GetEnclosingNamespace (this.SimpleName.SpanStart, cancellationToken);
+ if (namespaceSymbol != null) {
+ this.NamespaceToGenerateInOpt = namespaceSymbol.ToDisplayString (format);
+ }
+ }
+ }
+
+ return true;
+ }
+
+ private bool DetermineNamespaceOrTypeToGenerateIn (
+ TService service,
+ SemanticModel semanticModel,
+ TExpressionSyntax leftSide,
+ CancellationToken cancellationToken)
+ {
+ var leftSideInfo = semanticModel.GetSymbolInfo (leftSide, cancellationToken);
+
+ if (leftSideInfo.Symbol != null) {
+ var symbol = leftSideInfo.Symbol;
+
+ if (symbol is INamespaceSymbol) {
+ this.NamespaceToGenerateInOpt = symbol.ToDisplayString (Ambience.NameFormat);
+ return true;
+ } else if (symbol is INamedTypeSymbol) {
+ // TODO: Code coverage
+ this.TypeToGenerateInOpt = (INamedTypeSymbol)symbol.OriginalDefinition;
+ return true;
+ }
+
+ // We bound to something other than a namespace or named type. Can't generate a
+ // type inside this.
+ return false;
+ } else {
+ // If it's a dotted name, then perhaps it's a namespace. i.e. the user wrote
+ // "new Foo.Bar.Baz()". In this case we want to generate a namespace for
+ // "Foo.Bar".
+ IList<string> nameParts;
+ if (service.TryGetNameParts (leftSide, out nameParts)) {
+ this.NamespaceToGenerateInOpt = string.Join (".", nameParts);
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+
+ protected class GenerateTypeServiceStateOptions
+ {
+ public TExpressionSyntax NameOrMemberAccessExpression { get; set; }
+
+ public TObjectCreationExpressionSyntax ObjectCreationExpressionOpt { get; set; }
+
+ public IMethodSymbol DelegateCreationMethodSymbol { get; set; }
+
+ public List<TSimpleNameSyntax> PropertiesToGenerate { get; }
+
+ public bool IsMembersWithModule { get; set; }
+
+ public bool IsTypeGeneratedIntoNamespaceFromMemberAccess { get; set; }
+
+ public bool IsInterfaceOrEnumNotAllowedInTypeContext { get; set; }
+
+ public bool IsDelegateAllowed { get; set; }
+
+ public bool IsEnumNotAllowed { get; set; }
+
+ public bool IsDelegateOnly { get; internal set; }
+
+ public bool IsClassInterfaceTypes { get; internal set; }
+
+ public GenerateTypeServiceStateOptions ()
+ {
+ NameOrMemberAccessExpression = null;
+ ObjectCreationExpressionOpt = null;
+ DelegateCreationMethodSymbol = null;
+ IsMembersWithModule = false;
+ PropertiesToGenerate = new List<TSimpleNameSyntax> ();
+ IsTypeGeneratedIntoNamespaceFromMemberAccess = false;
+ IsInterfaceOrEnumNotAllowedInTypeContext = false;
+ IsDelegateAllowed = true;
+ IsEnumNotAllowed = false;
+ IsDelegateOnly = false;
+ }
+ }
+
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateType/CSharpGenerateTypeService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateType/CSharpGenerateTypeService.cs
new file mode 100644
index 0000000000..7e03af8a31
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateType/CSharpGenerateTypeService.cs
@@ -0,0 +1,941 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Composition;
+using System.Diagnostics;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.Editing;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using ICSharpCode.NRefactory6.CSharp.GenerateMember.GenerateConstructor;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateType
+{
+ class CSharpGenerateTypeService :
+ AbstractGenerateTypeService<CSharpGenerateTypeService, SimpleNameSyntax, ObjectCreationExpressionSyntax, ExpressionSyntax, TypeDeclarationSyntax, ArgumentSyntax>
+ {
+ private static readonly SyntaxAnnotation s_annotation = new SyntaxAnnotation();
+
+ protected override string DefaultFileExtension
+ {
+ get
+ {
+ return ".cs";
+ }
+ }
+
+ protected override ExpressionSyntax GetLeftSideOfDot(SimpleNameSyntax simpleName)
+ {
+ return simpleName.GetLeftSideOfDot();
+ }
+
+ protected override bool IsInCatchDeclaration(ExpressionSyntax expression)
+ {
+ return expression.IsParentKind(SyntaxKind.CatchDeclaration);
+ }
+
+ protected override bool IsArrayElementType(ExpressionSyntax expression)
+ {
+ return expression.IsParentKind(SyntaxKind.ArrayType) &&
+ expression.Parent.IsParentKind(SyntaxKind.ArrayCreationExpression);
+ }
+
+ protected override bool IsInValueTypeConstraintContext(
+ SemanticModel semanticModel,
+ ExpressionSyntax expression,
+ CancellationToken cancellationToken)
+ {
+ if (expression is TypeSyntax && expression.IsParentKind(SyntaxKind.TypeArgumentList))
+ {
+ var typeArgumentList = (TypeArgumentListSyntax)expression.Parent;
+ var symbolInfo = semanticModel.GetSymbolInfo(typeArgumentList.Parent, cancellationToken);
+ var symbol = symbolInfo.GetAnySymbol();
+ if (symbol.IsConstructor())
+ {
+ symbol = symbol.ContainingType;
+ }
+
+ var parameterIndex = typeArgumentList.Arguments.IndexOf((TypeSyntax)expression);
+ var type = symbol as INamedTypeSymbol;
+ if (type != null)
+ {
+ type = type.OriginalDefinition;
+ var typeParameter = parameterIndex < type.TypeParameters.Length ? type.TypeParameters[parameterIndex] : null;
+ return typeParameter != null && typeParameter.HasValueTypeConstraint;
+ }
+
+ var method = symbol as IMethodSymbol;
+ if (method != null)
+ {
+ method = method.OriginalDefinition;
+ var typeParameter = parameterIndex < method.TypeParameters.Length ? method.TypeParameters[parameterIndex] : null;
+ return typeParameter != null && typeParameter.HasValueTypeConstraint;
+ }
+ }
+
+ return false;
+ }
+
+ protected override bool IsInInterfaceList(ExpressionSyntax expression)
+ {
+ if (expression is TypeSyntax &&
+ expression.Parent is BaseTypeSyntax &&
+ expression.Parent.IsParentKind(SyntaxKind.BaseList) &&
+ ((BaseTypeSyntax)expression.Parent).Type == expression)
+ {
+ var baseList = (BaseListSyntax)expression.Parent.Parent;
+
+ // If it's after the first item, then it's definitely an interface.
+ if (baseList.Types[0] != expression.Parent)
+ {
+ return true;
+ }
+
+ // If it's in the base list of an interface or struct, then it's definitely an
+ // interface.
+ return
+ baseList.IsParentKind(SyntaxKind.InterfaceDeclaration) ||
+ baseList.IsParentKind(SyntaxKind.StructDeclaration);
+ }
+
+ if (expression is TypeSyntax &&
+ expression.IsParentKind(SyntaxKind.TypeConstraint) &&
+ expression.Parent.IsParentKind(SyntaxKind.TypeParameterConstraintClause))
+ {
+ var typeConstraint = (TypeConstraintSyntax)expression.Parent;
+ var constraintClause = (TypeParameterConstraintClauseSyntax)typeConstraint.Parent;
+ var index = constraintClause.Constraints.IndexOf(typeConstraint);
+
+ // If it's after the first item, then it's definitely an interface.
+ return index > 0;
+ }
+
+ return false;
+ }
+
+ protected override bool TryGetNameParts(ExpressionSyntax expression, out IList<string> nameParts)
+ {
+ nameParts = new List<string>();
+ return expression.TryGetNameParts(out nameParts);
+ }
+
+ protected override bool TryInitializeState(
+ SemanticDocument document,
+ SimpleNameSyntax simpleName,
+ CancellationToken cancellationToken,
+ out GenerateTypeServiceStateOptions generateTypeServiceStateOptions)
+ {
+ generateTypeServiceStateOptions = new GenerateTypeServiceStateOptions();
+
+ if (simpleName.IsVar)
+ {
+ return false;
+ }
+
+ if (SyntaxFacts.IsAliasQualifier(simpleName))
+ {
+ return false;
+ }
+
+ // Never offer if we're in a using directive, unless its a static using. The feeling here is that it's highly
+ // unlikely that this would be a location where a user would be wanting to generate
+ // something. They're really just trying to reference something that exists but
+ // isn't available for some reason (i.e. a missing reference).
+ var usingDirectiveSyntax = simpleName.GetAncestorOrThis<UsingDirectiveSyntax>();
+ if (usingDirectiveSyntax != null && usingDirectiveSyntax.StaticKeyword.Kind() != SyntaxKind.StaticKeyword)
+ {
+ return false;
+ }
+
+ ExpressionSyntax nameOrMemberAccessExpression = null;
+ if (simpleName.IsRightSideOfDot())
+ {
+ // This simplename comes from the cref
+ if (simpleName.IsParentKind(SyntaxKind.NameMemberCref))
+ {
+ return false;
+ }
+
+ nameOrMemberAccessExpression = generateTypeServiceStateOptions.NameOrMemberAccessExpression = (ExpressionSyntax)simpleName.Parent;
+
+ // If we're on the right side of a dot, then the left side better be a name (and
+ // not an arbitrary expression).
+ var leftSideExpression = simpleName.GetLeftSideOfDot();
+ if (!leftSideExpression.IsKind(
+ SyntaxKind.QualifiedName,
+ SyntaxKind.IdentifierName,
+ SyntaxKind.AliasQualifiedName,
+ SyntaxKind.GenericName,
+ SyntaxKind.SimpleMemberAccessExpression))
+ {
+ return false;
+ }
+ }
+ else
+ {
+ nameOrMemberAccessExpression = generateTypeServiceStateOptions.NameOrMemberAccessExpression = simpleName;
+ }
+
+ // BUG(5712): Don't offer generate type in an enum's base list.
+ if (nameOrMemberAccessExpression.Parent is BaseTypeSyntax &&
+ nameOrMemberAccessExpression.Parent.IsParentKind(SyntaxKind.BaseList) &&
+ ((BaseTypeSyntax)nameOrMemberAccessExpression.Parent).Type == nameOrMemberAccessExpression &&
+ nameOrMemberAccessExpression.Parent.Parent.IsParentKind(SyntaxKind.EnumDeclaration))
+ {
+ return false;
+ }
+
+ // If we can guarantee it's a type only context, great. Otherwise, we may not want to
+ // provide this here.
+ var semanticModel = document.SemanticModel;
+ if (!SyntaxFacts.IsInNamespaceOrTypeContext(nameOrMemberAccessExpression))
+ {
+ // Don't offer Generate Type in an expression context *unless* we're on the left
+ // side of a dot. In that case the user might be making a type that they're
+ // accessing a static off of.
+ var syntaxTree = semanticModel.SyntaxTree;
+ var start = nameOrMemberAccessExpression.SpanStart;
+ var tokenOnLeftOfStart = syntaxTree.FindTokenOnLeftOfPosition(start, cancellationToken);
+ var isExpressionContext = syntaxTree.IsExpressionContext(start, tokenOnLeftOfStart, attributes: true, cancellationToken: cancellationToken, semanticModelOpt: semanticModel);
+ var isStatementContext = syntaxTree.IsStatementContext(start, tokenOnLeftOfStart, cancellationToken);
+ var isExpressionOrStatementContext = isExpressionContext || isStatementContext;
+
+ // Delegate Type Creation is not allowed in Non Type Namespace Context
+ generateTypeServiceStateOptions.IsDelegateAllowed = false;
+
+ if (!isExpressionOrStatementContext)
+ {
+ return false;
+ }
+
+ if (!simpleName.IsLeftSideOfDot() && !simpleName.IsInsideNameOf())
+ {
+ if (nameOrMemberAccessExpression == null || !nameOrMemberAccessExpression.IsKind(SyntaxKind.SimpleMemberAccessExpression) || !simpleName.IsRightSideOfDot())
+ {
+ return false;
+ }
+
+ var leftSymbol = semanticModel.GetSymbolInfo(((MemberAccessExpressionSyntax)nameOrMemberAccessExpression).Expression, cancellationToken).Symbol;
+ var token = simpleName.GetLastToken().GetNextToken();
+
+ // We let only the Namespace to be left of the Dot
+ if (leftSymbol == null ||
+ !leftSymbol.IsKind(SymbolKind.Namespace) ||
+ !token.IsKind(SyntaxKind.DotToken))
+ {
+ return false;
+ }
+ else
+ {
+ generateTypeServiceStateOptions.IsMembersWithModule = true;
+ generateTypeServiceStateOptions.IsTypeGeneratedIntoNamespaceFromMemberAccess = true;
+ }
+ }
+
+ // Global Namespace
+ if (!generateTypeServiceStateOptions.IsTypeGeneratedIntoNamespaceFromMemberAccess &&
+ !SyntaxFacts.IsInNamespaceOrTypeContext(simpleName))
+ {
+ var token = simpleName.GetLastToken().GetNextToken();
+ if (token.IsKind(SyntaxKind.DotToken) &&
+ simpleName.Parent == token.Parent)
+ {
+ generateTypeServiceStateOptions.IsMembersWithModule = true;
+ generateTypeServiceStateOptions.IsTypeGeneratedIntoNamespaceFromMemberAccess = true;
+ }
+ }
+ }
+
+ var fieldDeclaration = simpleName.GetAncestor<FieldDeclarationSyntax>();
+ if (fieldDeclaration != null &&
+ fieldDeclaration.Parent is CompilationUnitSyntax &&
+ document.Document.SourceCodeKind == SourceCodeKind.Regular)
+ {
+ return false;
+ }
+
+ // Check to see if Module could be an option in the Type Generation in Cross Language Generation
+ var nextToken = simpleName.GetLastToken().GetNextToken();
+ if (simpleName.IsLeftSideOfDot() ||
+ nextToken.IsKind(SyntaxKind.DotToken))
+ {
+ if (simpleName.IsRightSideOfDot())
+ {
+ var parent = simpleName.Parent as QualifiedNameSyntax;
+ if (parent != null)
+ {
+ var leftSymbol = semanticModel.GetSymbolInfo(parent.Left, cancellationToken).Symbol;
+
+ if (leftSymbol != null && leftSymbol.IsKind(SymbolKind.Namespace))
+ {
+ generateTypeServiceStateOptions.IsMembersWithModule = true;
+ }
+ }
+ }
+ }
+
+ if (SyntaxFacts.IsInNamespaceOrTypeContext(nameOrMemberAccessExpression))
+ {
+ if (nextToken.IsKind(SyntaxKind.DotToken))
+ {
+ // In Namespace or Type Context we cannot have Interface, Enum, Delegate as part of the Left Expression of a QualifiedName
+ generateTypeServiceStateOptions.IsDelegateAllowed = false;
+ generateTypeServiceStateOptions.IsInterfaceOrEnumNotAllowedInTypeContext = true;
+ generateTypeServiceStateOptions.IsMembersWithModule = true;
+ }
+
+ // case: class Foo<T> where T: MyType
+ if (nameOrMemberAccessExpression.GetAncestors<TypeConstraintSyntax>().Any())
+ {
+ generateTypeServiceStateOptions.IsClassInterfaceTypes = true;
+ return true;
+ }
+
+ // Events
+ if (nameOrMemberAccessExpression.GetAncestors<EventFieldDeclarationSyntax>().Any() ||
+ nameOrMemberAccessExpression.GetAncestors<EventDeclarationSyntax>().Any())
+ {
+ // Case : event foo name11
+ // Only Delegate
+ if (simpleName.Parent != null && !(simpleName.Parent is QualifiedNameSyntax))
+ {
+ generateTypeServiceStateOptions.IsDelegateOnly = true;
+ return true;
+ }
+
+ // Case : event SomeSymbol.foo name11
+ if (nameOrMemberAccessExpression is QualifiedNameSyntax)
+ {
+ // Only Namespace, Class, Struct and Module are allowed to contain Delegate
+ // Case : event Something.Mytype.<Delegate> Identifier
+ if (nextToken.IsKind(SyntaxKind.DotToken))
+ {
+ if (nameOrMemberAccessExpression.Parent != null && nameOrMemberAccessExpression.Parent is QualifiedNameSyntax)
+ {
+ return true;
+ }
+ else
+ {
+ //Contract.Fail("Cannot reach this point");
+ }
+ }
+ else
+ {
+ // Case : event Something.<Delegate> Identifier
+ generateTypeServiceStateOptions.IsDelegateOnly = true;
+ return true;
+ }
+ }
+ }
+ }
+ else
+ {
+ // MemberAccessExpression
+ if ((nameOrMemberAccessExpression.IsKind(SyntaxKind.SimpleMemberAccessExpression) || (nameOrMemberAccessExpression.Parent != null && nameOrMemberAccessExpression.IsParentKind(SyntaxKind.SimpleMemberAccessExpression)))
+ && nameOrMemberAccessExpression.IsLeftSideOfDot())
+ {
+ // Check to see if the expression is part of Invocation Expression
+ ExpressionSyntax outerMostMemberAccessExpression = null;
+ if (nameOrMemberAccessExpression.IsKind(SyntaxKind.SimpleMemberAccessExpression))
+ {
+ outerMostMemberAccessExpression = nameOrMemberAccessExpression;
+ }
+ else
+ {
+ Debug.Assert(nameOrMemberAccessExpression.IsParentKind(SyntaxKind.SimpleMemberAccessExpression));
+ outerMostMemberAccessExpression = (ExpressionSyntax)nameOrMemberAccessExpression.Parent;
+ }
+
+ outerMostMemberAccessExpression = outerMostMemberAccessExpression.GetAncestorsOrThis<ExpressionSyntax>().SkipWhile((n) => n != null && n.IsKind(SyntaxKind.SimpleMemberAccessExpression)).FirstOrDefault();
+ if (outerMostMemberAccessExpression != null && outerMostMemberAccessExpression is InvocationExpressionSyntax)
+ {
+ generateTypeServiceStateOptions.IsEnumNotAllowed = true;
+ }
+ }
+ }
+
+ // Cases:
+ // // 1 - Function Address
+ // var s2 = new MyD2(foo);
+
+ // // 2 - Delegate
+ // MyD1 d = null;
+ // var s1 = new MyD2(d);
+
+ // // 3 - Action
+ // Action action1 = null;
+ // var s3 = new MyD2(action1);
+
+ // // 4 - Func
+ // Func<int> lambda = () => { return 0; };
+ // var s4 = new MyD3(lambda);
+
+ if (nameOrMemberAccessExpression.Parent is ObjectCreationExpressionSyntax)
+ {
+ var objectCreationExpressionOpt = generateTypeServiceStateOptions.ObjectCreationExpressionOpt = (ObjectCreationExpressionSyntax)nameOrMemberAccessExpression.Parent;
+
+ // Enum and Interface not Allowed in Object Creation Expression
+ generateTypeServiceStateOptions.IsInterfaceOrEnumNotAllowedInTypeContext = true;
+
+ if (objectCreationExpressionOpt.ArgumentList != null)
+ {
+ if (objectCreationExpressionOpt.ArgumentList.CloseParenToken.IsMissing)
+ {
+ return false;
+ }
+
+ // Get the Method symbol for the Delegate to be created
+ if (generateTypeServiceStateOptions.IsDelegateAllowed &&
+ objectCreationExpressionOpt.ArgumentList.Arguments.Count == 1)
+ {
+ generateTypeServiceStateOptions.DelegateCreationMethodSymbol = GetMethodSymbolIfPresent(semanticModel, objectCreationExpressionOpt.ArgumentList.Arguments[0].Expression, cancellationToken);
+ }
+ else
+ {
+ generateTypeServiceStateOptions.IsDelegateAllowed = false;
+ }
+ }
+
+ if (objectCreationExpressionOpt.Initializer != null)
+ {
+ foreach (var expression in objectCreationExpressionOpt.Initializer.Expressions)
+ {
+ var simpleAssignmentExpression = expression as AssignmentExpressionSyntax;
+ if (simpleAssignmentExpression == null)
+ {
+ continue;
+ }
+
+ var name = simpleAssignmentExpression.Left as SimpleNameSyntax;
+ if (name == null)
+ {
+ continue;
+ }
+
+ generateTypeServiceStateOptions.PropertiesToGenerate.Add(name);
+ }
+ }
+ }
+
+ if (generateTypeServiceStateOptions.IsDelegateAllowed)
+ {
+ // MyD1 z1 = foo;
+ if (nameOrMemberAccessExpression.Parent.IsKind(SyntaxKind.VariableDeclaration))
+ {
+ var variableDeclaration = (VariableDeclarationSyntax)nameOrMemberAccessExpression.Parent;
+ if (variableDeclaration.Variables.Count != 0)
+ {
+ var firstVarDeclWithInitializer = variableDeclaration.Variables.FirstOrDefault(var => var.Initializer != null && var.Initializer.Value != null);
+ if (firstVarDeclWithInitializer != null && firstVarDeclWithInitializer.Initializer != null && firstVarDeclWithInitializer.Initializer.Value != null)
+ {
+ generateTypeServiceStateOptions.DelegateCreationMethodSymbol = GetMethodSymbolIfPresent(semanticModel, firstVarDeclWithInitializer.Initializer.Value, cancellationToken);
+ }
+ }
+ }
+
+ // var w1 = (MyD1)foo;
+ if (nameOrMemberAccessExpression.Parent.IsKind(SyntaxKind.CastExpression))
+ {
+ var castExpression = (CastExpressionSyntax)nameOrMemberAccessExpression.Parent;
+ if (castExpression.Expression != null)
+ {
+ generateTypeServiceStateOptions.DelegateCreationMethodSymbol = GetMethodSymbolIfPresent(semanticModel, castExpression.Expression, cancellationToken);
+ }
+ }
+ }
+
+ return true;
+ }
+
+ private IMethodSymbol GetMethodSymbolIfPresent(SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken)
+ {
+ if (expression == null)
+ {
+ return null;
+ }
+
+ var memberGroup = semanticModel.GetMemberGroup(expression, cancellationToken);
+ if (memberGroup.Count() != 0)
+ {
+ return memberGroup.ElementAt(0).IsKind(SymbolKind.Method) ? (IMethodSymbol)memberGroup.ElementAt(0) : null;
+ }
+
+ var expressionType = semanticModel.GetTypeInfo(expression, cancellationToken).Type;
+ if (expressionType.IsDelegateType())
+ {
+ return ((INamedTypeSymbol)expressionType).DelegateInvokeMethod;
+ }
+
+ var expressionSymbol = semanticModel.GetSymbolInfo(expression, cancellationToken).Symbol;
+ if (expressionSymbol.IsKind(SymbolKind.Method))
+ {
+ return (IMethodSymbol)expressionSymbol;
+ }
+
+ return null;
+ }
+
+ private Accessibility DetermineAccessibilityConstraint(
+ State state,
+ SemanticModel semanticModel,
+ CancellationToken cancellationToken)
+ {
+ return semanticModel.DetermineAccessibilityConstraint(
+ state.NameOrMemberAccessExpression as TypeSyntax, cancellationToken);
+ }
+
+ protected override IList<ITypeParameterSymbol> GetTypeParameters(
+ State state,
+ SemanticModel semanticModel,
+ CancellationToken cancellationToken)
+ {
+ if (state.SimpleName is GenericNameSyntax)
+ {
+ var genericName = (GenericNameSyntax)state.SimpleName;
+ var typeArguments = state.SimpleName.Arity == genericName.TypeArgumentList.Arguments.Count
+ ? genericName.TypeArgumentList.Arguments.OfType<SyntaxNode>().ToList()
+ : Enumerable.Repeat<SyntaxNode>(null, state.SimpleName.Arity);
+ return this.GetTypeParameters(state, semanticModel, typeArguments, cancellationToken);
+ }
+
+ return SpecializedCollections.EmptyList<ITypeParameterSymbol>();
+ }
+
+ protected override bool TryGetArgumentList(ObjectCreationExpressionSyntax objectCreationExpression, out IList<ArgumentSyntax> argumentList)
+ {
+ if (objectCreationExpression != null && objectCreationExpression.ArgumentList != null)
+ {
+ argumentList = objectCreationExpression.ArgumentList.Arguments.ToList();
+ return true;
+ }
+
+ argumentList = null;
+ return false;
+ }
+
+ protected override IList<string> GenerateParameterNames(
+ SemanticModel semanticModel, IList<ArgumentSyntax> arguments)
+ {
+ return semanticModel.GenerateParameterNames(arguments);
+ }
+
+ public override string GetRootNamespace(CompilationOptions options)
+ {
+ return string.Empty;
+ }
+
+ protected override bool IsInVariableTypeContext(ExpressionSyntax expression)
+ {
+ return false;
+ }
+
+ protected override INamedTypeSymbol DetermineTypeToGenerateIn(SemanticModel semanticModel, SimpleNameSyntax simpleName, CancellationToken cancellationToken)
+ {
+ return semanticModel.GetEnclosingNamedType(simpleName.SpanStart, cancellationToken);
+ }
+
+ protected override Accessibility GetAccessibility(State state, SemanticModel semanticModel, bool intoNamespace, CancellationToken cancellationToken)
+ {
+ var accessibility = DetermineDefaultAccessibility(state, semanticModel, intoNamespace, cancellationToken);
+ if (!state.IsTypeGeneratedIntoNamespaceFromMemberAccess)
+ {
+ var accessibilityConstraint = DetermineAccessibilityConstraint(state, semanticModel, cancellationToken);
+
+ if (accessibilityConstraint == Accessibility.Public ||
+ accessibilityConstraint == Accessibility.Internal)
+ {
+ accessibility = accessibilityConstraint;
+ }
+ }
+
+ return accessibility;
+ }
+
+ protected override ITypeSymbol DetermineArgumentType(SemanticModel semanticModel, ArgumentSyntax argument, CancellationToken cancellationToken)
+ {
+ return argument.DetermineParameterType(semanticModel, cancellationToken);
+ }
+
+ protected override bool IsConversionImplicit(Compilation compilation, ITypeSymbol sourceType, ITypeSymbol targetType)
+ {
+ return compilation.ClassifyConversion(sourceType, targetType).IsImplicit;
+ }
+
+ public override async Task<Tuple<INamespaceSymbol, INamespaceOrTypeSymbol, Location>> GetOrGenerateEnclosingNamespaceSymbol(INamedTypeSymbol namedTypeSymbol, string[] containers, Document selectedDocument, SyntaxNode selectedDocumentRoot, CancellationToken cancellationToken)
+ {
+ var compilationUnit = (CompilationUnitSyntax)selectedDocumentRoot;
+ var semanticModel = await selectedDocument.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ if (containers.Length != 0)
+ {
+ // Search the NS declaration in the root
+ var containerList = new List<string>(containers);
+ var enclosingNamespace = GetDeclaringNamespace(containerList, 0, compilationUnit);
+ if (enclosingNamespace != null)
+ {
+ var enclosingNamespaceSymbol = semanticModel.GetSymbolInfo(enclosingNamespace.Name, cancellationToken);
+ if (enclosingNamespaceSymbol.Symbol != null)
+ {
+ return Tuple.Create((INamespaceSymbol)enclosingNamespaceSymbol.Symbol,
+ (INamespaceOrTypeSymbol)namedTypeSymbol,
+ enclosingNamespace.CloseBraceToken.GetLocation());
+ }
+ }
+ }
+
+ var globalNamespace = semanticModel.GetEnclosingNamespace(0, cancellationToken);
+ var rootNamespaceOrType = namedTypeSymbol.GenerateRootNamespaceOrType(containers);
+ var lastMember = compilationUnit.Members.LastOrDefault();
+ Location afterThisLocation = null;
+ if (lastMember != null)
+ {
+ afterThisLocation = semanticModel.SyntaxTree.GetLocation(new TextSpan(lastMember.Span.End, 0));
+ }
+ else
+ {
+ afterThisLocation = semanticModel.SyntaxTree.GetLocation(new TextSpan());
+ }
+
+ return Tuple.Create(globalNamespace,
+ rootNamespaceOrType,
+ afterThisLocation);
+ }
+
+ private NamespaceDeclarationSyntax GetDeclaringNamespace(List<string> containers, int indexDone, CompilationUnitSyntax compilationUnit)
+ {
+ foreach (var member in compilationUnit.Members)
+ {
+ var namespaceDeclaration = GetDeclaringNamespace(containers, 0, member);
+ if (namespaceDeclaration != null)
+ {
+ return namespaceDeclaration;
+ }
+ }
+
+ return null;
+ }
+
+ private NamespaceDeclarationSyntax GetDeclaringNamespace(List<string> containers, int indexDone, SyntaxNode localRoot)
+ {
+ var namespaceDecl = localRoot as NamespaceDeclarationSyntax;
+ if (namespaceDecl == null || namespaceDecl.Name is AliasQualifiedNameSyntax)
+ {
+ return null;
+ }
+
+ List<string> namespaceContainers = new List<string>();
+ GetNamespaceContainers(namespaceDecl.Name, namespaceContainers);
+
+ if (namespaceContainers.Count + indexDone > containers.Count ||
+ !IdentifierMatches(indexDone, namespaceContainers, containers))
+ {
+ return null;
+ }
+
+ indexDone = indexDone + namespaceContainers.Count;
+ if (indexDone == containers.Count)
+ {
+ return namespaceDecl;
+ }
+
+ foreach (var member in namespaceDecl.Members)
+ {
+ var resultant = GetDeclaringNamespace(containers, indexDone, member);
+ if (resultant != null)
+ {
+ return resultant;
+ }
+ }
+
+ return null;
+ }
+
+ private bool IdentifierMatches(int indexDone, List<string> namespaceContainers, List<string> containers)
+ {
+ for (int i = 0; i < namespaceContainers.Count; ++i)
+ {
+ if (namespaceContainers[i] != containers[indexDone + i])
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private void GetNamespaceContainers(NameSyntax name, List<string> namespaceContainers)
+ {
+ if (name is QualifiedNameSyntax)
+ {
+ GetNamespaceContainers(((QualifiedNameSyntax)name).Left, namespaceContainers);
+ namespaceContainers.Add(((QualifiedNameSyntax)name).Right.Identifier.ValueText);
+ }
+ else
+ {
+ Debug.Assert(name is SimpleNameSyntax);
+ namespaceContainers.Add(((SimpleNameSyntax)name).Identifier.ValueText);
+ }
+ }
+
+ internal override bool TryGetBaseList(ExpressionSyntax expression, out TypeKindOptions typeKindValue)
+ {
+ typeKindValue = TypeKindOptions.AllOptions;
+
+ if (expression == null)
+ {
+ return false;
+ }
+
+ var node = expression as SyntaxNode;
+
+ while (node != null)
+ {
+ if (node is BaseListSyntax)
+ {
+ if (node.Parent != null && (node.Parent is InterfaceDeclarationSyntax || node.Parent is StructDeclarationSyntax))
+ {
+ typeKindValue = TypeKindOptions.Interface;
+ return true;
+ }
+
+ typeKindValue = TypeKindOptions.BaseList;
+ return true;
+ }
+
+ node = node.Parent;
+ }
+
+ return false;
+ }
+
+ internal override bool IsPublicOnlyAccessibility(ExpressionSyntax expression, Project project)
+ {
+ if (expression == null)
+ {
+ return false;
+ }
+
+ if (GeneratedTypesMustBePublic(project))
+ {
+ return true;
+ }
+
+ var node = expression as SyntaxNode;
+ SyntaxNode previousNode = null;
+
+ while (node != null)
+ {
+ // Types in BaseList, Type Constraint or Member Types cannot be of restricter accessibility than the declaring type
+ if ((node is BaseListSyntax || node is TypeParameterConstraintClauseSyntax) &&
+ node.Parent != null &&
+ node.Parent is TypeDeclarationSyntax)
+ {
+ var typeDecl = node.Parent as TypeDeclarationSyntax;
+ if (typeDecl != null)
+ {
+ if (typeDecl.GetModifiers().Any(m => m.Kind() == SyntaxKind.PublicKeyword))
+ {
+ return IsAllContainingTypeDeclsPublic(typeDecl);
+ }
+ else
+ {
+ // The Type Decl which contains the BaseList does not contain Public
+ return false;
+ }
+ }
+
+ //Contract.Fail("Cannot reach this point");
+ }
+
+ if ((node is EventDeclarationSyntax || node is EventFieldDeclarationSyntax) &&
+ node.Parent != null &&
+ node.Parent is TypeDeclarationSyntax)
+ {
+ // Make sure the GFU is not inside the Accessors
+ if (previousNode != null && previousNode is AccessorListSyntax)
+ {
+ return false;
+ }
+
+ // Make sure that Event Declaration themselves are Public in the first place
+ if (!node.GetModifiers().Any(m => m.Kind() == SyntaxKind.PublicKeyword))
+ {
+ return false;
+ }
+
+ return IsAllContainingTypeDeclsPublic(node);
+ }
+
+ previousNode = node;
+ node = node.Parent;
+ }
+
+ return false;
+ }
+
+ private bool IsAllContainingTypeDeclsPublic(SyntaxNode node)
+ {
+ // Make sure that all the containing Type Declarations are also Public
+ var containingTypeDeclarations = node.GetAncestors<TypeDeclarationSyntax>();
+ if (containingTypeDeclarations.Count() == 0)
+ {
+ return true;
+ }
+ else
+ {
+ return containingTypeDeclarations.All(typedecl => typedecl.GetModifiers().Any(m => m.Kind() == SyntaxKind.PublicKeyword));
+ }
+ }
+
+ internal override bool IsGenericName(SimpleNameSyntax simpleName)
+ {
+ if (simpleName == null)
+ {
+ return false;
+ }
+
+ var genericName = simpleName as GenericNameSyntax;
+ return genericName != null;
+ }
+
+ internal override bool IsSimpleName(ExpressionSyntax expression)
+ {
+ return expression is SimpleNameSyntax;
+ }
+
+ internal override Solution TryAddUsingsOrImportToDocument(Solution updatedSolution, SyntaxNode modifiedRoot, Document document, SimpleNameSyntax simpleName, string includeUsingsOrImports, CancellationToken cancellationToken)
+ {
+ // Nothing to include
+ if (string.IsNullOrWhiteSpace(includeUsingsOrImports))
+ {
+ return updatedSolution;
+ }
+
+ var placeSystemNamespaceFirst = true;//document.Project.Solution.Workspace.Options.GetOption(OrganizerOptions.PlaceSystemNamespaceFirst, document.Project.Language);
+
+ SyntaxNode root = null;
+ if (modifiedRoot == null)
+ {
+ root = document.GetSyntaxRootAsync(cancellationToken).WaitAndGetResult(cancellationToken);
+ }
+ else
+ {
+ root = modifiedRoot;
+ }
+
+ if (root is CompilationUnitSyntax)
+ {
+ var compilationRoot = (CompilationUnitSyntax)root;
+ var usingDirective = SyntaxFactory.UsingDirective(SyntaxFactory.ParseName(includeUsingsOrImports));
+
+ // Check if the usings is already present
+ if (compilationRoot.Usings.Where(n => n != null && n.Alias == null)
+ .Select(n => n.Name.ToString())
+ .Any(n => n.Equals(includeUsingsOrImports)))
+ {
+ return updatedSolution;
+ }
+
+ // Check if the GFU is triggered from the namespace same as the usings namespace
+ if (IsWithinTheImportingNamespace(document, simpleName.SpanStart, includeUsingsOrImports, cancellationToken))
+ {
+ return updatedSolution;
+ }
+
+ var addedCompilationRoot = compilationRoot.AddUsingDirectives(new[] { usingDirective }, placeSystemNamespaceFirst, Formatter.Annotation);
+ updatedSolution = updatedSolution.WithDocumentSyntaxRoot(document.Id, addedCompilationRoot, PreservationMode.PreserveIdentity);
+ }
+
+ return updatedSolution;
+ }
+
+ private ITypeSymbol GetPropertyType(
+ SimpleNameSyntax property,
+ SemanticModel semanticModel,
+ CancellationToken cancellationToken)
+ {
+ var parent = property.Parent as AssignmentExpressionSyntax;
+ if (parent != null)
+ {
+ return TypeGuessing.typeInferenceService.InferType(semanticModel, parent.Left, true, cancellationToken);
+ }
+
+ return null;
+ }
+
+ private IPropertySymbol CreatePropertySymbol(SimpleNameSyntax propertyName, ITypeSymbol propertyType)
+ {
+ return CodeGenerationSymbolFactory.CreatePropertySymbol(
+ attributes: SpecializedCollections.EmptyList<AttributeData>(),
+ accessibility: Accessibility.Public,
+ modifiers: new DeclarationModifiers(),
+ explicitInterfaceSymbol: null,
+ name: propertyName.ToString(),
+ type: propertyType,
+ parameters: null,
+ getMethod: s_accessor,
+ setMethod: s_accessor,
+ isIndexer: false);
+ }
+
+ private static readonly IMethodSymbol s_accessor = CodeGenerationSymbolFactory.CreateAccessorSymbol(
+ attributes: null,
+ accessibility: Accessibility.Public,
+ statements: null);
+
+ internal override bool TryGenerateProperty(
+ SimpleNameSyntax propertyName,
+ SemanticModel semanticModel,
+ CancellationToken cancellationToken,
+ out IPropertySymbol property)
+ {
+ property = null;
+ var propertyType = GetPropertyType(propertyName, semanticModel, cancellationToken);
+ if (propertyType == null || propertyType is IErrorTypeSymbol)
+ {
+ property = CreatePropertySymbol(propertyName, semanticModel.Compilation.ObjectType);
+ return true;
+ }
+
+ property = CreatePropertySymbol(propertyName, propertyType);
+ return true;
+ }
+
+ internal override IMethodSymbol GetDelegatingConstructor(ObjectCreationExpressionSyntax objectCreation, INamedTypeSymbol namedType, SemanticModel model, ISet<IMethodSymbol> candidates, CancellationToken cancellationToken)
+ {
+ var oldNode = objectCreation
+ .AncestorsAndSelf(ascendOutOfTrivia: false)
+ .Where(node => SpeculationAnalyzer.CanSpeculateOnNode(node))
+ .LastOrDefault();
+
+ var typeNameToReplace = objectCreation.Type;
+ var newTypeName = namedType.GenerateTypeSyntax();
+ var newObjectCreation = objectCreation.WithType(newTypeName).WithAdditionalAnnotations(s_annotation);
+ var newNode = oldNode.ReplaceNode(objectCreation, newObjectCreation);
+
+ var speculativeModel = SpeculationAnalyzer.CreateSpeculativeSemanticModelForNode(oldNode, newNode, model);
+ if (speculativeModel != null)
+ {
+ newObjectCreation = (ObjectCreationExpressionSyntax)newNode.GetAnnotatedNodes(s_annotation).Single();
+ var symbolInfo = speculativeModel.GetSymbolInfo(newObjectCreation, cancellationToken);
+ return GenerateConstructorHelpers.GetDelegatingConstructor(symbolInfo, candidates, namedType);
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateType/GenerateTypeDialogOptions.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateType/GenerateTypeDialogOptions.cs
new file mode 100644
index 0000000000..d91da3dcb5
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateType/GenerateTypeDialogOptions.cs
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateType
+{
+ class GenerateTypeDialogOptions
+ {
+ public bool IsPublicOnlyAccessibility { get; }
+ public TypeKindOptions TypeKindOptions { get; }
+ public bool IsAttribute { get; }
+
+ public GenerateTypeDialogOptions(
+ bool isPublicOnlyAccessibility = false,
+ TypeKindOptions typeKindOptions = TypeKindOptions.AllOptions,
+ bool isAttribute = false)
+ {
+ IsPublicOnlyAccessibility = isPublicOnlyAccessibility;
+ this.TypeKindOptions = typeKindOptions;
+ IsAttribute = isAttribute;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateType/GenerateTypeOptionsResult.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateType/GenerateTypeOptionsResult.cs
new file mode 100644
index 0000000000..cd9c90856e
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateType/GenerateTypeOptionsResult.cs
@@ -0,0 +1,55 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateType
+{
+ class GenerateTypeOptionsResult
+ {
+ public static readonly GenerateTypeOptionsResult Cancelled = new GenerateTypeOptionsResult(isCancelled: true);
+
+ public Accessibility Accessibility { get; }
+ public Document ExistingDocument { get; }
+ public bool IsCancelled { get; }
+ public bool IsNewFile { get; }
+ public IList<string> Folders { get; }
+ public string NewFileName { get; }
+ public Project Project { get; }
+ public TypeKind TypeKind { get; }
+ public string FullFilePath { get; }
+ public string TypeName { get; }
+ public bool AreFoldersValidIdentifiers { get; }
+
+ public GenerateTypeOptionsResult(
+ Accessibility accessibility,
+ TypeKind typeKind,
+ string typeName,
+ Project project,
+ bool isNewFile,
+ string newFileName,
+ IList<string> folders,
+ string fullFilePath,
+ Document existingDocument,
+ bool areFoldersValidIdentifiers,
+ bool isCancelled = false)
+ {
+ this.Accessibility = accessibility;
+ this.TypeKind = typeKind;
+ this.TypeName = typeName;
+ this.Project = project;
+ this.IsNewFile = isNewFile;
+ this.NewFileName = newFileName;
+ this.Folders = folders;
+ this.FullFilePath = fullFilePath;
+ this.ExistingDocument = existingDocument;
+ this.AreFoldersValidIdentifiers = areFoldersValidIdentifiers;
+ this.IsCancelled = isCancelled;
+ }
+
+ private GenerateTypeOptionsResult(bool isCancelled)
+ {
+ this.IsCancelled = isCancelled;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateType/TypeKindOptions.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateType/TypeKindOptions.cs
new file mode 100644
index 0000000000..3bfdc96dfb
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GenerateType/TypeKindOptions.cs
@@ -0,0 +1,89 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ICSharpCode.NRefactory6.CSharp.GenerateType
+{
+ [Flags]
+ public enum TypeKindOptions
+ {
+ None = 0x0,
+
+ Class = 0x1,
+ Structure = 0x2,
+ Interface = 0x4,
+ Enum = 0x8,
+ Delegate = 0x10,
+ Module = 0x20,
+
+ // Enables class, struct, interface, enum and delegate
+ AllOptions = Class | Structure | Interface | Enum | Delegate,
+
+ // Only class is valid with Attribute
+ Attribute = Class,
+
+ // Only class, struct and interface are allowed. No Enums
+ BaseList = Class | Interface,
+
+ AllOptionsWithModule = AllOptions | Module,
+
+ // Only Interface and Delegate cannot be part of the member access with Namespace as Left expression
+ MemberAccessWithNamespace = Class | Structure | Enum | Module,
+
+ // Enum and Modules are incompatible with Generics
+ GenericInCompatibleTypes = Enum | Module
+ }
+
+ internal class TypeKindOptionsHelper
+ {
+ public static bool IsClass(TypeKindOptions option)
+ {
+ return (option & TypeKindOptions.Class) != 0 ? true : false;
+ }
+
+ public static bool IsStructure(TypeKindOptions option)
+ {
+ return (option & TypeKindOptions.Structure) != 0 ? true : false;
+ }
+
+ public static bool IsInterface(TypeKindOptions option)
+ {
+ return (option & TypeKindOptions.Interface) != 0 ? true : false;
+ }
+
+ public static bool IsEnum(TypeKindOptions option)
+ {
+ return (option & TypeKindOptions.Enum) != 0 ? true : false;
+ }
+
+ public static bool IsDelegate(TypeKindOptions option)
+ {
+ return (option & TypeKindOptions.Delegate) != 0 ? true : false;
+ }
+
+ public static bool IsModule(TypeKindOptions option)
+ {
+ return (option & TypeKindOptions.Module) != 0 ? true : false;
+ }
+
+ public static TypeKindOptions RemoveOptions(TypeKindOptions fromValue, params TypeKindOptions[] removeValues)
+ {
+ var tempReturnValue = fromValue;
+ foreach (var removeValue in removeValues)
+ {
+ tempReturnValue = tempReturnValue & ~removeValue;
+ }
+
+ return tempReturnValue;
+ }
+
+ internal static TypeKindOptions AddOption(TypeKindOptions toValue, TypeKindOptions addValue)
+ {
+ return toValue | addValue;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GotoDefinition/GotoDefinitionHelpers.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GotoDefinition/GotoDefinitionHelpers.cs
new file mode 100644
index 0000000000..301c4cfe7d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GotoDefinition/GotoDefinitionHelpers.cs
@@ -0,0 +1,126 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Threading;
+using Microsoft.CodeAnalysis.FindSymbols;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.GotoDefinition
+{
+ static class GoToDefinitionHelpers
+ {
+
+ public static bool TryGoToDefinition(
+ ISymbol symbol,
+ Project project,
+ ITypeSymbol containingTypeSymbol,
+ bool throwOnHiddenDefinition,
+ CancellationToken cancellationToken)
+ {
+ var alias = symbol as IAliasSymbol;
+ if (alias != null)
+ {
+ var ns = alias.Target as INamespaceSymbol;
+ if (ns != null && ns.IsGlobalNamespace)
+ {
+ return false;
+ }
+ }
+
+ // VB global import aliases have a synthesized SyntaxTree.
+ // We can't go to the definition of the alias, so use the target type.
+
+ var solution = project.Solution;
+ if (symbol is IAliasSymbol &&
+ GeneratedCodeRecognitionService.GetPreferredSourceLocations(solution, symbol).All(l => project.Solution.GetDocument(l.SourceTree) == null))
+ {
+ symbol = ((IAliasSymbol)symbol).Target;
+ }
+
+ var definition = SymbolFinder.FindSourceDefinitionAsync(symbol, solution, cancellationToken).Result;
+ cancellationToken.ThrowIfCancellationRequested();
+
+ symbol = definition ?? symbol;
+
+ if (TryThirdPartyNavigation(symbol, solution, containingTypeSymbol))
+ {
+ return true;
+ }
+
+ // If it is a partial method declaration with no body, choose to go to the implementation
+ // that has a method body.
+ if (symbol is IMethodSymbol)
+ {
+ symbol = ((IMethodSymbol)symbol).PartialImplementationPart ?? symbol;
+ }
+
+ var preferredSourceLocations = GeneratedCodeRecognitionService.GetPreferredSourceLocations(solution, symbol).ToArray();
+ if (GoToDefinitionService.TryNavigateToSymbol (symbol, project, true))
+ return true;
+ else if (!preferredSourceLocations.Any ())
+ return false;
+
+ // If we have a single location, then just navigate to it.
+ if (preferredSourceLocations.Length == 1)
+ {
+ var firstItem = preferredSourceLocations[0];
+ var workspace = project.Solution.Workspace;
+ if (GoToDefinitionService.CanNavigateToSpan(workspace, solution.GetDocument(firstItem.SourceTree).Id, firstItem.SourceSpan))
+ {
+ return GoToDefinitionService.TryNavigateToSpan(workspace, solution.GetDocument(firstItem.SourceTree).Id, firstItem.SourceSpan, true);
+ }
+ else
+ {
+ if (throwOnHiddenDefinition)
+ {
+ const int E_FAIL = -2147467259;
+ throw new COMException("The definition of the object is hidden.", E_FAIL);
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+ else
+ {
+ // We have multiple viable source locations, so ask the host what to do. Most hosts
+ // will simply display the results to the user and allow them to choose where to
+ // go.
+ GoToDefinitionService.DisplayMultiple (preferredSourceLocations.Select (location => Tuple.Create (solution, symbol, location)).ToList ());
+
+ return false;
+ }
+ }
+
+ private static bool TryThirdPartyNavigation(ISymbol symbol, Solution solution, ITypeSymbol containingTypeSymbol)
+ {
+ // Allow third parties to navigate to all symbols except types/constructors
+ // if we are navigating from the corresponding type.
+
+ if (containingTypeSymbol != null &&
+ (symbol is ITypeSymbol || symbol.IsConstructor()))
+ {
+ var candidateTypeSymbol = symbol is ITypeSymbol
+ ? symbol
+ : symbol.ContainingType;
+
+ if (containingTypeSymbol == candidateTypeSymbol)
+ {
+ // We are navigating from the same type, so don't allow third parties to perform the navigation.
+ // This ensures that if we navigate to a class from within that class, we'll stay in the same file
+ // rather than navigate to, say, XAML.
+ return false;
+ }
+ }
+
+ // Notify of navigation so third parties can intercept the navigation
+ return GoToDefinitionService.TrySymbolNavigationNotify(symbol, solution);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GotoDefinition/GotoDefinitionService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GotoDefinition/GotoDefinitionService.cs
new file mode 100644
index 0000000000..f0cd820b45
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/GotoDefinition/GotoDefinitionService.cs
@@ -0,0 +1,114 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.FindSymbols;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.GotoDefinition
+{
+ static class GoToDefinitionService
+ {
+ /// <summary>
+ /// Navigate to the first source location of a given symbol.
+ /// bool TryNavigateToSymbol(ISymbol symbol, Project project, bool usePreviewTab = false);
+ /// </summary>
+ public static Func<ISymbol, Project, bool, bool> TryNavigateToSymbol = delegate {
+ return true;
+ };
+
+ /// <summary>
+ /// Navigates to the given position in the specified document, opening it if necessary.
+ /// bool TryNavigateToSpan(Workspace workspace, DocumentId documentId, TextSpan textSpan, bool usePreviewTab = false);
+ /// </summary>
+ public static Func<Workspace, DocumentId, TextSpan, bool, bool> TryNavigateToSpan = delegate {
+ return true;
+ };
+
+ /// <summary>
+ /// Determines whether it is possible to navigate to the given position in the specified document.
+ /// bool CanNavigateToSpan(Workspace workspace, DocumentId documentId, TextSpan textSpan);
+ /// </summary>
+ public static Func<Workspace, DocumentId, TextSpan, bool> CanNavigateToSpan = delegate {
+ return true;
+ };
+
+ public static Action<IEnumerable<Tuple<Solution, ISymbol, Location>>> DisplayMultiple = delegate {
+ };
+
+ /// <summary>
+ /// bool TrySymbolNavigationNotify(ISymbol symbol, Solution solution);
+ /// </summary>
+ /// <returns>True if the navigation was handled, indicating that the caller should not
+ /// perform the navigation.
+ ///
+ /// </returns>
+ public static Func<ISymbol, Solution, bool> TrySymbolNavigationNotify = delegate {
+ return false;
+ };
+
+ static ISymbol FindRelatedExplicitlyDeclaredSymbol(ISymbol symbol, Compilation compilation)
+ {
+ return symbol;
+ }
+
+ public static async Task<ISymbol> FindSymbolAsync(Document document, int position, CancellationToken cancellationToken)
+ {
+ var workspace = document.Project.Solution.Workspace;
+
+ var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ //var symbol = SymbolFinder.FindSymbolAtPosition(semanticModel, position, workspace, bindLiteralsToUnderlyingType: true, cancellationToken: cancellationToken);
+ var symbol = SymbolFinder.FindSymbolAtPosition(semanticModel, position, workspace, cancellationToken: cancellationToken);
+
+ return FindRelatedExplicitlyDeclaredSymbol(symbol, semanticModel.Compilation);
+ }
+
+// public async Task<IEnumerable<INavigableItem>> FindDefinitionsAsync(Document document, int position, CancellationToken cancellationToken)
+// {
+// var symbol = await FindSymbolAsync(document, position, cancellationToken).ConfigureAwait(false);
+//
+// // realize the list here so that the consumer await'ing the result doesn't lazily cause
+// // them to be created on an inappropriate thread.
+// return NavigableItemFactory.GetItemsfromPreferredSourceLocations(document.Project.Solution, symbol).ToList();
+// }
+
+ public static bool TryGoToDefinition(Document document, int position, CancellationToken cancellationToken)
+ {
+ var symbol = FindSymbolAsync(document, position, cancellationToken).Result;
+
+ if (symbol != null)
+ {
+ var containingTypeSymbol = GetContainingTypeSymbol(position, document, cancellationToken);
+
+ if (GoToDefinitionHelpers.TryGoToDefinition(symbol, document.Project, containingTypeSymbol, throwOnHiddenDefinition: true, cancellationToken: cancellationToken))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private static ITypeSymbol GetContainingTypeSymbol(int caretPosition, Document document, CancellationToken cancellationToken)
+ {
+ var syntaxRoot = document.GetSyntaxRootAsync(cancellationToken).Result;
+ var containingTypeDeclaration = syntaxRoot.GetContainingTypeDeclaration(caretPosition);
+
+ if (containingTypeDeclaration != null)
+ {
+ var semanticModel = document.GetSemanticModelAsync(cancellationToken).Result;
+ return semanticModel.GetDeclaredSymbol(containingTypeDeclaration, cancellationToken) as ITypeSymbol;
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementAbstractClass/AbstractImplementAbstractClassService.Editor.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementAbstractClass/AbstractImplementAbstractClassService.Editor.cs
new file mode 100644
index 0000000000..6fa2da1dba
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementAbstractClass/AbstractImplementAbstractClassService.Editor.cs
@@ -0,0 +1,167 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.Editing;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp.CodeGeneration;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.ImplementAbstractClass
+{
+ partial class AbstractImplementAbstractClassService
+ {
+ private partial class Editor
+ {
+ private readonly Document _document;
+ private readonly SemanticModel _model;
+ private readonly State _state;
+
+ public Editor(
+ Document document,
+ SemanticModel model,
+ State state)
+ {
+ _document = document;
+ _model = model;
+ _state = state;
+ }
+
+ public async Task<Document> GetEditAsync(CancellationToken cancellationToken)
+ {
+ var unimplementedMembers = _state.UnimplementedMembers;
+
+ var memberDefinitions = GenerateMembers(
+ unimplementedMembers,
+ cancellationToken);
+
+ var result = await CodeGenerator.AddMemberDeclarationsAsync(
+ _document.Project.Solution,
+ _state.ClassType,
+ memberDefinitions,
+ new CodeGenerationOptions(_state.Location.GetLocation(), generateDefaultAccessibility: false),
+ cancellationToken)
+ .ConfigureAwait(false);
+
+ return result;
+ }
+
+ private IList<ISymbol> GenerateMembers(
+ IList<Tuple<INamedTypeSymbol, IList<ISymbol>>> unimplementedMembers,
+ CancellationToken cancellationToken)
+ {
+ return
+ unimplementedMembers.SelectMany(t => t.Item2)
+ .Select(m => GenerateMember(m, cancellationToken))
+ .WhereNotNull()
+ .ToList();
+ }
+
+ private ISymbol GenerateMember(
+ ISymbol member,
+ CancellationToken cancellationToken)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+
+ // Check if we need to add 'unsafe' to the signature we're generating.
+ var addUnsafe = member.IsUnsafe() && !_state.Location.IsUnsafeContext();
+
+ return GenerateMember(member, addUnsafe, cancellationToken);
+ }
+
+ private ISymbol GenerateMember(
+ ISymbol member,
+ bool addUnsafe,
+ CancellationToken cancellationToken)
+ {
+ var modifiers = DeclarationModifiers.None.WithIsOverride(true).WithIsUnsafe (addUnsafe);
+ var accessibility = member.ComputeResultantAccessibility(_state.ClassType);
+
+ if (member.Kind == SymbolKind.Method)
+ {
+ return GenerateMethod((IMethodSymbol)member, modifiers, accessibility, cancellationToken);
+ }
+ else if (member.Kind == SymbolKind.Property)
+ {
+ return GenerateProperty((IPropertySymbol)member, modifiers, accessibility, cancellationToken);
+ }
+ else if (member.Kind == SymbolKind.Event)
+ {
+ var @event = (IEventSymbol)member;
+ return CodeGenerationSymbolFactory.CreateEventSymbol(
+ @event,
+ accessibility: accessibility,
+ modifiers: modifiers);
+ }
+
+ return null;
+ }
+
+ private ISymbol GenerateMethod(
+ IMethodSymbol method, DeclarationModifiers modifiers, Accessibility accessibility, CancellationToken cancellationToken)
+ {
+ var syntaxFactory = _document.Project.LanguageServices.GetService<SyntaxGenerator>();
+
+ var throwingBody = syntaxFactory.CreateThrowNotImplementStatement (_model.Compilation);
+
+ method = method.EnsureNonConflictingNames(_state.ClassType, cancellationToken);
+
+ return CodeGenerationSymbolFactory.CreateMethodSymbol(
+ method,
+ accessibility: accessibility,
+ modifiers: modifiers,
+ statements: new [] { throwingBody });
+ }
+
+ private IPropertySymbol GenerateProperty(
+ IPropertySymbol property,
+ DeclarationModifiers modifiers,
+ Accessibility accessibility,
+ CancellationToken cancellationToken)
+ {
+ var syntaxFactory = _document.Project.LanguageServices.GetService<SyntaxGenerator>();
+
+ var throwingBody = syntaxFactory.CreateThrowNotImplementedStatementBlock(
+ _model.Compilation);
+
+ var getMethod = ShouldGenerateAccessor(property.GetMethod)
+ ? CodeGenerationSymbolFactory.CreateAccessorSymbol(
+ property.GetMethod,
+ attributes: null,
+ accessibility: property.GetMethod.ComputeResultantAccessibility(_state.ClassType),
+ statements: throwingBody)
+ : null;
+
+ var setMethod = ShouldGenerateAccessor(property.SetMethod)
+ ? CodeGenerationSymbolFactory.CreateAccessorSymbol(
+ property.SetMethod,
+ attributes: null,
+ accessibility: property.SetMethod.ComputeResultantAccessibility(_state.ClassType),
+ statements: throwingBody)
+ : null;
+
+ return CodeGenerationSymbolFactory.CreatePropertySymbol(
+ property,
+ accessibility: accessibility,
+ modifiers: modifiers,
+ getMethod: getMethod,
+ setMethod: setMethod);
+ }
+
+ private bool ShouldGenerateAccessor(IMethodSymbol method)
+ {
+ return
+ method != null &&
+ method.IsAccessibleWithin(_state.ClassType) &&
+ _state.ClassType.FindImplementationForAbstractMember(method) == null;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementAbstractClass/AbstractImplementAbstractClassService.State.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementAbstractClass/AbstractImplementAbstractClassService.State.cs
new file mode 100644
index 0000000000..0d924b2c79
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementAbstractClass/AbstractImplementAbstractClassService.State.cs
@@ -0,0 +1,70 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.ImplementAbstractClass
+{
+ partial class AbstractImplementAbstractClassService
+ {
+ private class State
+ {
+ public SyntaxNode Location { get; }
+ public INamedTypeSymbol ClassType { get; }
+ public INamedTypeSymbol AbstractClassType { get; }
+
+ // The members that are not implemented at all.
+ public IList<Tuple<INamedTypeSymbol, IList<ISymbol>>> UnimplementedMembers { get; }
+
+ private State(SyntaxNode node, INamedTypeSymbol classType, INamedTypeSymbol abstractClassType, IList<Tuple<INamedTypeSymbol, IList<ISymbol>>> unimplementedMembers)
+ {
+ this.Location = node;
+ this.ClassType = classType;
+ this.AbstractClassType = abstractClassType;
+ this.UnimplementedMembers = unimplementedMembers;
+ }
+
+ public static State Generate(
+ AbstractImplementAbstractClassService service,
+ Document document,
+ SemanticModel model,
+ SyntaxNode node,
+ CancellationToken cancellationToken)
+ {
+ INamedTypeSymbol classType, abstractClassType;
+ if (!service.TryInitializeState(document, model, node, cancellationToken,
+ out classType, out abstractClassType))
+ {
+ return null;
+ }
+
+ if (!CodeGenerator.CanAdd(document.Project.Solution, classType, cancellationToken))
+ {
+ return null;
+ }
+
+ if (classType.IsAbstract)
+ {
+ return null;
+ }
+
+ var unimplementedMembers = classType.GetAllUnimplementedMembers(
+ SpecializedCollections.SingletonEnumerable(abstractClassType), cancellationToken);
+
+ if (unimplementedMembers != null && unimplementedMembers.Count >= 1)
+ {
+ return new State(node, classType, abstractClassType, unimplementedMembers);
+ }
+ else
+ {
+ return null;
+ }
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementAbstractClass/AbstractImplementAbstractClassService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementAbstractClass/AbstractImplementAbstractClassService.cs
new file mode 100644
index 0000000000..b625b46e7d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementAbstractClass/AbstractImplementAbstractClassService.cs
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.Internal.Log;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.ImplementAbstractClass
+{
+ abstract partial class AbstractImplementAbstractClassService
+ {
+ protected AbstractImplementAbstractClassService()
+ {
+ }
+
+ protected abstract bool TryInitializeState(Document document, SemanticModel model, SyntaxNode classNode, CancellationToken cancellationToken, out INamedTypeSymbol classType, out INamedTypeSymbol abstractClassType);
+
+ public Task<Document> ImplementAbstractClassAsync(Document document, SemanticModel model, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ var state = State.Generate(this, document, model, node, cancellationToken);
+ if (state == null)
+ {
+ return Task.FromResult (default(Document));
+ }
+
+ return new Editor(document, model, state).GetEditAsync(cancellationToken);
+ }
+
+ public bool CanImplementAbstractClass(Document document, SemanticModel model, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ return State.Generate(this, document, model, node, cancellationToken) != null;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementAbstractClass/CSharpImplementAbstractClassService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementAbstractClass/CSharpImplementAbstractClassService.cs
new file mode 100644
index 0000000000..939d65e432
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementAbstractClass/CSharpImplementAbstractClassService.cs
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Composition;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.ImplementAbstractClass
+{
+ class CSharpImplementAbstractClassService : AbstractImplementAbstractClassService
+ {
+ protected override bool TryInitializeState(
+ Document document, SemanticModel model, SyntaxNode node, CancellationToken cancellationToken,
+ out INamedTypeSymbol classType, out INamedTypeSymbol abstractClassType)
+ {
+ var baseClassNode = node as TypeSyntax;
+ if (baseClassNode != null && baseClassNode.Parent is BaseTypeSyntax &&
+ baseClassNode.Parent.IsParentKind(SyntaxKind.BaseList) &&
+ ((BaseTypeSyntax)baseClassNode.Parent).Type == baseClassNode)
+ {
+ if (baseClassNode.Parent.Parent.IsParentKind(SyntaxKind.ClassDeclaration))
+ {
+ abstractClassType = model.GetTypeInfo(baseClassNode, cancellationToken).Type as INamedTypeSymbol;
+ cancellationToken.ThrowIfCancellationRequested();
+
+ if (abstractClassType.IsAbstractClass())
+ {
+ var classDecl = baseClassNode.Parent.Parent.Parent as ClassDeclarationSyntax;
+ classType = model.GetDeclaredSymbol(classDecl, cancellationToken) as INamedTypeSymbol;
+
+ return classType != null && abstractClassType != null;
+ }
+ }
+ }
+
+ classType = null;
+ abstractClassType = null;
+ return false;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.CodeAction.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.CodeAction.cs
new file mode 100644
index 0000000000..6f66185d4b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.CodeAction.cs
@@ -0,0 +1,560 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.Editing;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Shared.Utilities;
+using Microsoft.CodeAnalysis.Simplification;
+using Roslyn.Utilities;
+using ICSharpCode.NRefactory6.CSharp.CodeGeneration;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.ImplementInterface
+{
+ abstract partial class AbstractImplementInterfaceService
+ {
+ internal partial class ImplementInterfaceCodeAction : CodeAction
+ {
+ protected readonly bool Explicitly;
+ protected readonly bool Abstractly;
+ protected readonly ISymbol ThroughMember;
+ protected readonly Document Document;
+ protected readonly State State;
+ protected readonly AbstractImplementInterfaceService Service;
+ private readonly string _equivalenceKey;
+
+ internal ImplementInterfaceCodeAction(
+ AbstractImplementInterfaceService service,
+ Document document,
+ State state,
+ bool explicitly,
+ bool abstractly,
+ ISymbol throughMember)
+ {
+ this.Service = service;
+ this.Document = document;
+ this.State = state;
+ this.Abstractly = abstractly;
+ this.Explicitly = explicitly;
+ this.ThroughMember = throughMember;
+ _equivalenceKey = ComputeEquivalenceKey(state, explicitly, abstractly, throughMember, this.GetType().FullName);
+ }
+
+ public static ImplementInterfaceCodeAction CreateImplementAbstractlyCodeAction(
+ AbstractImplementInterfaceService service,
+ Document document,
+ State state)
+ {
+ return new ImplementInterfaceCodeAction(service, document, state, explicitly: false, abstractly: true, throughMember: null);
+ }
+
+ public static ImplementInterfaceCodeAction CreateImplementCodeAction(
+ AbstractImplementInterfaceService service,
+ Document document,
+ State state)
+ {
+ return new ImplementInterfaceCodeAction(service, document, state, explicitly: false, abstractly: false, throughMember: null);
+ }
+
+ public static ImplementInterfaceCodeAction CreateImplementExplicitlyCodeAction(
+ AbstractImplementInterfaceService service,
+ Document document,
+ State state)
+ {
+ return new ImplementInterfaceCodeAction(service, document, state, explicitly: true, abstractly: false, throughMember: null);
+ }
+
+ public static ImplementInterfaceCodeAction CreateImplementThroughMemberCodeAction(
+ AbstractImplementInterfaceService service,
+ Document document,
+ State state,
+ ISymbol throughMember)
+ {
+ return new ImplementInterfaceCodeAction(service, document, state, explicitly: false, abstractly: false, throughMember: throughMember);
+ }
+
+ public override string Title
+ {
+ get
+ {
+ if (Explicitly)
+ {
+ return Resources.ImplementInterfaceExplicitly;
+ }
+ else if (Abstractly)
+ {
+ return Resources.ImplementInterfaceAbstractly;
+ }
+ else if (ThroughMember != null)
+ {
+ return string.Format(Resources.ImplementInterfaceThrough, GetDescription(ThroughMember));
+ }
+ else
+ {
+ return Resources.ImplementInterface;
+ }
+ }
+ }
+
+ private static string ComputeEquivalenceKey(
+ State state,
+ bool explicitly,
+ bool abstractly,
+ ISymbol throughMember,
+ string codeActionTypeName)
+ {
+ var interfaceType = state.InterfaceTypes.First();
+ var typeName = interfaceType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat);
+ var assemblyName = interfaceType.ContainingAssembly.Name;
+
+ return GetCodeActionEquivalenceKey(assemblyName, typeName, explicitly, abstractly, throughMember, codeActionTypeName);
+ }
+
+ // internal for testing purposes.
+ internal static string GetCodeActionEquivalenceKey(
+ string interfaceTypeAssemblyName,
+ string interfaceTypeFullyQualifiedName,
+ bool explicitly,
+ bool abstractly,
+ ISymbol throughMember,
+ string codeActionTypeName)
+ {
+ if (throughMember != null)
+ {
+ return null;
+ }
+
+ return explicitly.ToString() + ";" +
+ abstractly.ToString() + ";" +
+ interfaceTypeAssemblyName + ";" +
+ interfaceTypeFullyQualifiedName + ";" +
+ codeActionTypeName;
+ }
+
+ public override string EquivalenceKey
+ {
+ get
+ {
+ return _equivalenceKey;
+ }
+ }
+
+ private static string GetDescription(ISymbol throughMember)
+ {
+ return throughMember.TypeSwitch(
+ (IFieldSymbol field) => field.Name,
+ (IPropertySymbol property) => property.Name);
+ }
+
+ protected override Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
+ {
+ return GetUpdatedDocumentAsync(cancellationToken);
+ }
+
+ public Task<Document> GetUpdatedDocumentAsync(CancellationToken cancellationToken)
+ {
+ var unimplementedMembers = Explicitly ? State.UnimplementedExplicitMembers : State.UnimplementedMembers;
+ return GetUpdatedDocumentAsync(Document, unimplementedMembers, State.ClassOrStructType, State.ClassOrStructDecl, cancellationToken);
+ }
+
+ public virtual async Task<Document> GetUpdatedDocumentAsync(
+ Document document,
+ IList<Tuple<INamedTypeSymbol, IList<ISymbol>>> unimplementedMembers,
+ INamedTypeSymbol classOrStructType,
+ SyntaxNode classOrStructDecl,
+ CancellationToken cancellationToken)
+ {
+ var result = document;
+ var compilation = await result.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
+
+ var memberDefinitions = GenerateMembers(
+ compilation,
+ unimplementedMembers,
+ cancellationToken);
+
+ result = await CodeGenerator.AddMemberDeclarationsAsync(
+ result.Project.Solution, classOrStructType, memberDefinitions,
+ new CodeGenerationOptions(contextLocation: classOrStructDecl.GetLocation(), generateDefaultAccessibility: false),
+ cancellationToken).ConfigureAwait(false);
+
+ return result;
+ }
+
+ private IList<ISymbol> GenerateMembers(
+ Compilation compilation,
+ IList<Tuple<INamedTypeSymbol, IList<ISymbol>>> unimplementedMembers,
+ CancellationToken cancellationToken)
+ {
+ // As we go along generating members we may end up with conflicts. For example, say
+ // you have "interface IFoo { string Bar { get; } }" and "interface IQuux { int Bar
+ // { get; } }" and we need to implement both 'Bar' methods. The second will have to
+ // be explicitly implemented as it will conflict with the first. So we need to keep
+ // track of what we've actually implemented so that we can check further interface
+ // members against both the actual type and that list.
+ //
+ // Similarly, if you have two interfaces with the same member, then we don't want to
+ // implement that member twice.
+ //
+ // Note: if we implement a method explicitly then we do *not* add it to this list.
+ // That's because later members won't conflict with it even if they have the same
+ // signature otherwise. i.e. if we chose to implement IFoo.Bar explicitly, then we
+ // could implement IQuux.Bar implicitly (and vice versa).
+ var implementedVisibleMembers = new List<ISymbol>();
+ var implementedMembers = new List<ISymbol>();
+
+ foreach (var tuple in unimplementedMembers)
+ {
+ var interfaceType = tuple.Item1;
+ var unimplementedInterfaceMembers = tuple.Item2;
+
+ foreach (var unimplementedInterfaceMember in unimplementedInterfaceMembers)
+ {
+ var member = GenerateMember(compilation, unimplementedInterfaceMember, implementedVisibleMembers, cancellationToken);
+ if (member != null)
+ {
+ implementedMembers.Add(member);
+
+ if (!(member.ExplicitInterfaceImplementations().Any() && Service.HasHiddenExplicitImplementation))
+ {
+ implementedVisibleMembers.Add(member);
+ }
+ }
+ }
+ }
+
+ return implementedMembers;
+ }
+
+ private bool IsReservedName(string name)
+ {
+ return
+ IdentifiersMatch(State.ClassOrStructType.Name, name) ||
+ State.ClassOrStructType.TypeParameters.Any(t => IdentifiersMatch(t.Name, name));
+ }
+
+ private string DetermineMemberName(ISymbol member, List<ISymbol> implementedVisibleMembers)
+ {
+ if (HasConflictingMember(member, implementedVisibleMembers))
+ {
+ var memberNames = State.ClassOrStructType.GetAccessibleMembersInThisAndBaseTypes<ISymbol>(State.ClassOrStructType).Select(m => m.Name);
+
+ return NameGenerator.GenerateUniqueName(
+ string.Format("{0}_{1}", member.ContainingType.Name, member.Name),
+ n => !memberNames.Contains(n) &&
+ !implementedVisibleMembers.Any(m => IdentifiersMatch(m.Name, n)) &&
+ !IsReservedName(n));
+ }
+
+ return member.Name;
+ }
+
+ private ISymbol GenerateMember(
+ Compilation compilation,
+ ISymbol member,
+ List<ISymbol> implementedVisibleMembers,
+ CancellationToken cancellationToken)
+ {
+ // First check if we already generate a member that matches the member we want to
+ // generate. This can happen in C# when you have interfaces that have the same
+ // method, and you are implementing implicitly. For example:
+ //
+ // interface IFoo { void Foo(); }
+ //
+ // interface IBar : IFoo { new void Foo(); }
+ //
+ // class C : IBar
+ //
+ // In this case we only want to generate 'Foo' once.
+ if (HasMatchingMember(implementedVisibleMembers, member))
+ {
+ return null;
+ }
+
+ var memberName = DetermineMemberName(member, implementedVisibleMembers);
+
+ // See if we need to generate an invisible member. If we do, then reset the name
+ // back to what then member wants it to be.
+ var generateInvisibleMember = GenerateInvisibleMember(member, memberName);
+ memberName = generateInvisibleMember ? member.Name : memberName;
+
+ var generateAbstractly = !generateInvisibleMember && Abstractly;
+
+ // Check if we need to add 'new' to the signature we're adding. We only need to do this
+ // if we're not generating something explicit and we have a naming conflict with
+ // something in our base class hierarchy.
+ var addNew = !generateInvisibleMember && HasNameConflict(member, memberName, State.ClassOrStructType.GetBaseTypes());
+
+ // Check if we need to add 'unsafe' to the signature we're generating.
+ var addUnsafe = member.IsUnsafe() && !State.Location.IsUnsafeContext();
+
+ return GenerateMember(compilation, member, memberName, generateInvisibleMember, generateAbstractly, addNew, addUnsafe, cancellationToken);
+ }
+
+ private bool GenerateInvisibleMember(ISymbol member, string memberName)
+ {
+ if (Service.HasHiddenExplicitImplementation)
+ {
+ // User asked for an explicit (i.e. invisible) member.
+ if (Explicitly)
+ {
+ return true;
+ }
+
+ // Have to create an invisible member if we have constraints we can't express
+ // with a visible member.
+ if (HasUnexpressableConstraint(member))
+ {
+ return true;
+ }
+
+ // If we had a conflict with a member of the same name, then we have to generate
+ // as an invisible member.
+ if (member.Name != memberName)
+ {
+ return true;
+ }
+ }
+
+ // Can't generate an invisible member if the lanugage doesn't support it.
+ return false;
+ }
+
+ private bool HasUnexpressableConstraint(ISymbol member)
+ {
+ // interface IFoo<T> { void Bar<U>() where U : T; }
+ //
+ // class A : IFoo<int> { }
+ //
+ // In this case we cannot generate an implement method for Bar. That's because we'd
+ // need to say "where U : int" and that's disallowed by the language. So we must
+ // generate something explicit here.
+ if (member.Kind != SymbolKind.Method)
+ {
+ return false;
+ }
+
+ var method = member as IMethodSymbol;
+
+ return method.TypeParameters.Any(IsUnexpressableTypeParameter);
+ }
+
+ private static bool IsUnexpressableTypeParameter(ITypeParameterSymbol typeParameter)
+ {
+ var condition1 = typeParameter.ConstraintTypes.Count(t => t.TypeKind == TypeKind.Class) >= 2;
+ var condition2 = typeParameter.ConstraintTypes.Any(ts => ts.IsUnexpressableTypeParameterConstraint());
+ var condition3 = typeParameter.HasReferenceTypeConstraint && typeParameter.ConstraintTypes.Any(ts => ts.IsReferenceType && ts.SpecialType != SpecialType.System_Object);
+
+ return condition1 || condition2 || condition3;
+ }
+
+ private ISymbol GenerateMember(
+ Compilation compilation,
+ ISymbol member,
+ string memberName,
+ bool generateInvisibly,
+ bool generateAbstractly,
+ bool addNew,
+ bool addUnsafe,
+ CancellationToken cancellationToken)
+ {
+ var factory = this.Document.GetLanguageService<SyntaxGenerator>();
+ var modifiers = DeclarationModifiers.None.WithIsAbstract(generateAbstractly).WithIsNew (addNew).WithIsUnsafe (addUnsafe);
+
+ var useExplicitInterfaceSymbol = generateInvisibly || !Service.CanImplementImplicitly;
+ var accessibility = member.Name == memberName ? Accessibility.Public : Accessibility.Private;
+
+ if (member.Kind == SymbolKind.Method)
+ {
+ var method = (IMethodSymbol)member;
+
+ return GenerateMethod(compilation, method, accessibility, modifiers, generateAbstractly, useExplicitInterfaceSymbol, memberName, cancellationToken);
+ }
+ else if (member.Kind == SymbolKind.Property)
+ {
+ var property = (IPropertySymbol)member;
+
+ return GenerateProperty(compilation, property, accessibility, modifiers, generateAbstractly, useExplicitInterfaceSymbol, memberName, cancellationToken);
+ }
+ else if (member.Kind == SymbolKind.Event)
+ {
+ var @event = (IEventSymbol)member;
+
+ var accessor = CodeGenerationSymbolFactory.CreateAccessorSymbol(
+ attributes: null,
+ accessibility: Accessibility.NotApplicable,
+ statements: factory.CreateThrowNotImplementedStatementBlock(compilation));
+
+ return CodeGenerationSymbolFactory.CreateEventSymbol(
+ @event,
+ accessibility: accessibility,
+ modifiers: modifiers,
+ explicitInterfaceSymbol: useExplicitInterfaceSymbol ? @event : null,
+ name: memberName,
+ addMethod: generateInvisibly ? accessor : null,
+ removeMethod: generateInvisibly ? accessor : null);
+ }
+
+ return null;
+ }
+
+ private SyntaxNode CreateThroughExpression(SyntaxGenerator factory)
+ {
+ var through = ThroughMember.IsStatic
+ ? factory.IdentifierName(State.ClassOrStructType.Name)
+ : factory.ThisExpression();
+
+ through = factory.MemberAccessExpression(
+ through, factory.IdentifierName(ThroughMember.Name));
+
+ var throughMemberType = ThroughMember.GetMemberType();
+ if ((State.InterfaceTypes != null) && (throughMemberType != null))
+ {
+ // In the case of 'implement interface through field / property' , we need to know what
+ // interface we are implementing so that we can insert casts to this interface on every
+ // usage of the field in the generated code. Without these casts we would end up generating
+ // code that fails compilation in certain situations.
+ //
+ // For example consider the following code.
+ // class C : IReadOnlyList<int> { int[] field; }
+ // When applying the 'implement interface through field' code fix in the above example,
+ // we need to generate the following code to implement the Count property on IReadOnlyList<int>
+ // class C : IReadOnlyList<int> { int[] field; int Count { get { ((IReadOnlyList<int>)field).Count; } ...}
+ // as opposed to the following code which will fail to compile (because the array field
+ // doesn't have a property named .Count) -
+ // class C : IReadOnlyList<int> { int[] field; int Count { get { field.Count; } ...}
+ //
+ // The 'InterfaceTypes' property on the state object always contains only one item
+ // in the case of C# i.e. it will contain exactly the interface we are trying to implement.
+ // This is also the case most of the time in the case of VB, except in certain error conditions
+ // (recursive / circular cases) where the span of the squiggle for the corresponding
+ // diagnostic (BC30149) changes and 'InterfaceTypes' ends up including all interfaces
+ // in the Implements clause. For the purposes of inserting the above cast, we ignore the
+ // uncommon case and optimize for the common one - in other words, we only apply the cast
+ // in cases where we can unambiguously figure out which interface we are trying to implement.
+ var interfaceBeingImplemented = State.InterfaceTypes.SingleOrDefault();
+ if ((interfaceBeingImplemented != null) && (!throughMemberType.Equals(interfaceBeingImplemented)))
+ {
+ through = factory.CastExpression(interfaceBeingImplemented,
+ through.WithAdditionalAnnotations (Simplifier.Annotation));
+
+ through = through.Parenthesize();
+ }
+ }
+
+ return through.WithAdditionalAnnotations(Simplifier.Annotation);
+ }
+
+ private bool HasNameConflict(
+ ISymbol member,
+ string memberName,
+ IEnumerable<INamedTypeSymbol> baseTypes)
+ {
+ // There's a naming conflict if any member in the base types chain is accessible to
+ // us, has our name. Note: a simple name won't conflict with a generic name (and
+ // vice versa). A method only conflicts with another method if they have the same
+ // parameter signature (return type is irrelevant).
+ return
+ baseTypes.Any(ts => ts.GetMembers(memberName)
+ .Where(m => m.IsAccessibleWithin(State.ClassOrStructType))
+ .Any(m => HasNameConflict(member, memberName, m)));
+ }
+
+ private static bool HasNameConflict(
+ ISymbol member,
+ string memberName,
+ ISymbol baseMember)
+ {
+ //Contract.Requires(memberName == baseMember.Name);
+
+ if (member.Kind == SymbolKind.Method && baseMember.Kind == SymbolKind.Method)
+ {
+ // A method only conflicts with another method if htey have the same parameter
+ // signature (return type is irrelevant).
+ var method1 = (IMethodSymbol)member;
+ var method2 = (IMethodSymbol)baseMember;
+
+ if (method1.MethodKind == MethodKind.Ordinary &&
+ method2.MethodKind == MethodKind.Ordinary &&
+ method1.TypeParameters.Length == method2.TypeParameters.Length)
+ {
+ return method1.Parameters.Select(p => p.Type)
+ .SequenceEqual(method2.Parameters.Select(p => p.Type));
+ }
+ }
+
+ // Any non method members with the same name simple name conflict.
+ return true;
+ }
+
+ private bool IdentifiersMatch(string identifier1, string identifier2)
+ {
+ return this.IsCaseSensitive
+ ? identifier1 == identifier2
+ : StringComparer.OrdinalIgnoreCase.Equals(identifier1, identifier2);
+ }
+
+ private bool IsCaseSensitive
+ {
+ get
+ {
+ return true;//this.Document.GetLanguageService<ISyntaxFactsService>().IsCaseSensitive;
+ }
+ }
+
+ private bool HasMatchingMember(List<ISymbol> implementedVisibleMembers, ISymbol member)
+ {
+ // If this is a language that doesn't support implicit implementation then no
+ // implemented members will ever match. For example, if you have:
+ //
+ // Interface IFoo : sub Foo() : End Interface
+ //
+ // Interface IBar : Inherits IFoo : Shadows Sub Foo() : End Interface
+ //
+ // Class C : Implements IBar
+ //
+ // We'll first end up generating:
+ //
+ // Public Sub Foo() Implements IFoo.Foo
+ //
+ // However, that same method won't be viable for IBar.Foo (unlike C#) because it
+ // explicitly specifies its interface).
+ if (!Service.CanImplementImplicitly)
+ {
+ return false;
+ }
+
+ return implementedVisibleMembers.Any(m => MembersMatch(m, member));
+ }
+
+ private bool MembersMatch(ISymbol member1, ISymbol member2)
+ {
+ if (member1.Kind != member2.Kind)
+ {
+ return false;
+ }
+
+ if (member1.DeclaredAccessibility != member2.DeclaredAccessibility ||
+ member1.IsStatic != member2.IsStatic)
+ {
+ return false;
+ }
+
+ if (member1.ExplicitInterfaceImplementations().Any() || member2.ExplicitInterfaceImplementations().Any())
+ {
+ return false;
+ }
+
+ return SignatureComparer.HaveSameSignatureAndConstraintsAndReturnTypeAndAccessors(
+ member1, member2, this.IsCaseSensitive);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.CodeAction_Conflicts.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.CodeAction_Conflicts.cs
new file mode 100644
index 0000000000..0e92c1a073
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.CodeAction_Conflicts.cs
@@ -0,0 +1,89 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Shared.Utilities;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.ImplementInterface
+{
+ abstract partial class AbstractImplementInterfaceService
+ {
+ internal partial class ImplementInterfaceCodeAction
+ {
+ private bool HasConflictingMember(ISymbol member, List<ISymbol> implementedVisibleMembers)
+ {
+ // Checks if this member conflicts with an existing member in classOrStructType or with
+ // a method we've already implemented. If so, we'll need to implement this one
+ // explicitly.
+
+ var allMembers = State.ClassOrStructType.GetAccessibleMembersInThisAndBaseTypes<ISymbol>(State.ClassOrStructType).Concat(implementedVisibleMembers);
+
+ var conflict1 = allMembers.Any(m => HasConflict(m, member));
+ var conflict2 = IsReservedName(member.Name);
+
+ return conflict1 || conflict2;
+ }
+
+ private bool HasConflict(ISymbol member1, ISymbol member2)
+ {
+ // If either of these members are invisible explicit, then there is no conflict.
+ if (Service.HasHiddenExplicitImplementation)
+ {
+ if (member1.ExplicitInterfaceImplementations().Any() || member2.ExplicitInterfaceImplementations().Any())
+ {
+ // explicit methods don't conflict with anything.
+ return false;
+ }
+ }
+
+ // Members normally conflict if they have the same name. The exceptions are methods
+ // and parameterized properties (which conflict if htey have the same signature).
+ if (!IdentifiersMatch(member1.Name, member2.Name))
+ {
+ return false;
+ }
+
+ // If they differ in type, then it's almost always a conflict. There may be
+ // exceptions to this, but i don't know of any.
+ if (member1.Kind != member2.Kind)
+ {
+ return true;
+ }
+
+ // At this point, we have two members of the same type with the same name. If they
+ // have a different signature (for example, methods, or parameterized properties),
+ // then they do not conflict.
+ if (!SignatureComparer.HaveSameSignature(member1, member2, this.IsCaseSensitive))
+ {
+ return false;
+ }
+
+ // Now we have to members with the same name, type and signature. If the language
+ // doesn't support implicit implementation, then these members are definitely in
+ // conflict.
+ if (!Service.CanImplementImplicitly)
+ {
+ return true;
+ }
+
+ // two members conflict if they have the same signature and have
+ //
+ // a) different return types
+ // b) different accessibility
+ // c) different constraints
+ if (member1.DeclaredAccessibility != member2.DeclaredAccessibility ||
+ !SignatureComparer.HaveSameSignatureAndConstraintsAndReturnTypeAndAccessors(member1, member2, this.IsCaseSensitive))
+ {
+ return true;
+ }
+
+ // Same name, type, accessibility, return type, *and* the services can implement
+ // implicitly. These are not in conflict.
+ return false;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.CodeAction_Method.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.CodeAction_Method.cs
new file mode 100644
index 0000000000..228a0df7f8
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.CodeAction_Method.cs
@@ -0,0 +1,80 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.Editing;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.ImplementInterface
+{
+ abstract partial class AbstractImplementInterfaceService
+ {
+ internal partial class ImplementInterfaceCodeAction
+ {
+ private ISymbol GenerateMethod(
+ Compilation compilation,
+ IMethodSymbol method,
+ Accessibility accessibility,
+ DeclarationModifiers modifiers,
+ bool generateAbstractly,
+ bool useExplicitInterfaceSymbol,
+ string memberName,
+ CancellationToken cancellationToken)
+ {
+
+ var updatedMethod = method.EnsureNonConflictingNames(
+ this.State.ClassOrStructType, cancellationToken);
+
+ updatedMethod = updatedMethod.RemoveAttributeFromParametersAndReturnType(compilation.ComAliasNameAttributeType());
+
+ return CodeGenerationSymbolFactory.CreateMethodSymbol(
+ updatedMethod,
+ accessibility: accessibility,
+ modifiers: modifiers,
+ explicitInterfaceSymbol: useExplicitInterfaceSymbol ? updatedMethod : null,
+ name: memberName,
+ statements: generateAbstractly ? null : new[] { CreateStatement(compilation, updatedMethod, cancellationToken) });
+ }
+
+ private SyntaxNode CreateStatement(
+ Compilation compilation,
+ IMethodSymbol method,
+ CancellationToken cancellationToken)
+ {
+ if (ThroughMember == null)
+ {
+ var factory = this.Document.GetLanguageService<SyntaxGenerator>();
+ return factory.CreateThrowNotImplementStatement(compilation);
+ }
+ else
+ {
+ return CreateDelegationStatement(method);
+ }
+ }
+
+ private SyntaxNode CreateDelegationStatement(
+ IMethodSymbol method)
+ {
+ var factory = this.Document.GetLanguageService<SyntaxGenerator>();
+ var through = CreateThroughExpression(factory);
+
+ var memberName = method.IsGenericMethod
+ ? factory.GenericName(method.Name, method.TypeArguments.OfType<ITypeSymbol>().ToList())
+ : factory.IdentifierName(method.Name);
+
+ through = factory.MemberAccessExpression(
+ through, memberName);
+
+ var arguments = factory.CreateArguments(method.Parameters.As<IParameterSymbol>());
+ var invocationExpression = factory.InvocationExpression(through, arguments);
+
+ return method.ReturnsVoid
+ ? factory.ExpressionStatement(invocationExpression)
+ : factory.ReturnStatement(invocationExpression);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.CodeAction_Property.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.CodeAction_Property.cs
new file mode 100644
index 0000000000..3141688e3a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.CodeAction_Property.cs
@@ -0,0 +1,150 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.Editing;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Shared.Utilities;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.ImplementInterface
+{
+ abstract partial class AbstractImplementInterfaceService
+ {
+ internal partial class ImplementInterfaceCodeAction
+ {
+ private ISymbol GenerateProperty(
+ Compilation compilation,
+ IPropertySymbol property,
+ Accessibility accessibility,
+ DeclarationModifiers modifiers,
+ bool generateAbstractly,
+ bool useExplicitInterfaceSymbol,
+ string memberName,
+ CancellationToken cancellationToken)
+ {
+ //var factory = this.Document.GetLanguageService<SyntaxGenerator>();
+ var comAliasNameAttribute = compilation.ComAliasNameAttributeType();
+
+ var getAccessor = property.GetMethod == null
+ ? null
+ : CodeGenerationSymbolFactory.CreateAccessorSymbol(
+ property.GetMethod.RemoveAttributeFromParametersAndReturnType(comAliasNameAttribute),
+ attributes: null,
+ accessibility: accessibility,
+ explicitInterfaceSymbol: useExplicitInterfaceSymbol ? property.GetMethod : null,
+ statements: GetGetAccessorStatements(compilation, property, generateAbstractly, cancellationToken));
+
+ var setAccessor = property.SetMethod == null
+ ? null
+ : CodeGenerationSymbolFactory.CreateAccessorSymbol(
+ property.SetMethod.RemoveAttributeFromParametersAndReturnType(comAliasNameAttribute),
+ attributes: null,
+ accessibility: accessibility,
+ explicitInterfaceSymbol: useExplicitInterfaceSymbol ? property.SetMethod : null,
+ statements: GetSetAccessorStatements(compilation, property, generateAbstractly, cancellationToken));
+
+ var parameterNames = NameGenerator.EnsureUniqueness(
+ property.Parameters.Select(p => p.Name).ToList(), isCaseSensitive: true);
+
+ var updatedProperty = property.RenameParameters(parameterNames);
+
+ updatedProperty = updatedProperty.RemoveAttributeFromParameters(comAliasNameAttribute);
+
+ // TODO(cyrusn): Delegate through throughMember if it's non-null.
+ return CodeGenerationSymbolFactory.CreatePropertySymbol(
+ updatedProperty,
+ accessibility: accessibility,
+ modifiers: modifiers,
+ explicitInterfaceSymbol: useExplicitInterfaceSymbol ? property : null,
+ name: memberName,
+ getMethod: getAccessor,
+ setMethod: setAccessor);
+ }
+
+ private IList<SyntaxNode> GetSetAccessorStatements(
+ Compilation compilation,
+ IPropertySymbol property,
+ bool generateAbstractly,
+ CancellationToken cancellationToken)
+ {
+ if (generateAbstractly)
+ {
+ return null;
+ }
+
+ var factory = this.Document.GetLanguageService<SyntaxGenerator>();
+ if (ThroughMember != null)
+ {
+ var throughExpression = CreateThroughExpression(factory);
+ SyntaxNode expression;
+
+ if (property.IsIndexer)
+ {
+ expression = throughExpression;
+ }
+ else
+ {
+ expression = factory.MemberAccessExpression(
+ throughExpression, factory.IdentifierName(property.Name));
+ }
+
+ if (property.Parameters.Length > 0)
+ {
+ var arguments = factory.CreateArguments(property.Parameters.As<IParameterSymbol>());
+ expression = factory.ElementAccessExpression(expression, arguments);
+ }
+
+ expression = factory.AssignmentStatement(expression, factory.IdentifierName("value"));
+
+ return new[] { factory.ExpressionStatement(expression) };
+ }
+
+ return factory.CreateThrowNotImplementedStatementBlock(compilation);
+ }
+
+ private IList<SyntaxNode> GetGetAccessorStatements(
+ Compilation compilation,
+ IPropertySymbol property,
+ bool generateAbstractly,
+ CancellationToken cancellationToken)
+ {
+ if (generateAbstractly)
+ {
+ return null;
+ }
+
+ var factory = this.Document.GetLanguageService<SyntaxGenerator>();
+ if (ThroughMember != null)
+ {
+ var throughExpression = CreateThroughExpression(factory);
+ SyntaxNode expression;
+
+ if (property.IsIndexer)
+ {
+ expression = throughExpression;
+ }
+ else
+ {
+ expression = factory.MemberAccessExpression(
+ throughExpression, factory.IdentifierName(property.Name));
+ }
+
+ if (property.Parameters.Length > 0)
+ {
+ var arguments = factory.CreateArguments(property.Parameters.As<IParameterSymbol>());
+ expression = factory.ElementAccessExpression(expression, arguments);
+ }
+
+ return new[] { factory.ReturnStatement(expression) };
+ }
+
+ return factory.CreateThrowNotImplementedStatementBlock(compilation);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.DisposePatternCodeAction.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.DisposePatternCodeAction.cs
new file mode 100644
index 0000000000..f88296279e
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.DisposePatternCodeAction.cs
@@ -0,0 +1,150 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.ImplementInterface
+{
+ abstract partial class AbstractImplementInterfaceService
+ {
+ private static INamedTypeSymbol TryGetSymbolForIDisposable(Compilation compilation)
+ {
+ // Get symbol for 'System.IDisposable'.
+ var idisposable = compilation.GetSpecialType(SpecialType.System_IDisposable);
+ if ((idisposable != null) && (idisposable.TypeKind == TypeKind.Interface))
+ {
+ var idisposableMembers = idisposable.GetMembers().ToArray();
+
+ // Get symbol for 'System.IDisposable.Dispose()'.
+ IMethodSymbol disposeMethod = null;
+ if ((idisposableMembers.Length == 1) && (idisposableMembers[0].Kind == SymbolKind.Method) &&
+ (idisposableMembers[0].Name == "Dispose"))
+ {
+ disposeMethod = idisposableMembers[0] as IMethodSymbol;
+ if ((disposeMethod != null) && (!disposeMethod.IsStatic) && disposeMethod.ReturnsVoid &&
+ (disposeMethod.Arity == 0) && (disposeMethod.Parameters.Length == 0))
+ {
+ return idisposable;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private bool ShouldImplementDisposePattern(Document document, State state, bool explicitly)
+ {
+ // Dispose pattern should be implemented only if -
+ // 1. An interface named 'System.IDisposable' is unimplemented.
+ // 2. This interface has one and only one member - a non-generic method named 'Dispose' that takes no arguments and returns 'void'.
+ // 3. The implementing type is a class that does not already declare any conflicting members named 'disposedValue' or 'Dispose'
+ // (because we will be generating a 'disposedValue' field and a couple of methods named 'Dispose' as part of implementing
+ // the dispose pattern).
+ var unimplementedMembers = explicitly ? state.UnimplementedExplicitMembers : state.UnimplementedMembers;
+ var idisposable = TryGetSymbolForIDisposable(state.Model.Compilation);
+ return (idisposable != null) &&
+ unimplementedMembers.Any(m => m.Item1.Equals(idisposable)) &&
+ this.CanImplementDisposePattern(state.ClassOrStructType, state.ClassOrStructDecl);
+ }
+
+ internal class ImplementInterfaceWithDisposePatternCodeAction : ImplementInterfaceCodeAction
+ {
+ internal ImplementInterfaceWithDisposePatternCodeAction(
+ AbstractImplementInterfaceService service,
+ Document document,
+ State state,
+ bool explicitly,
+ bool abstractly,
+ ISymbol throughMember) : base(service, document, state, explicitly, abstractly, throughMember)
+ {
+ }
+
+ public static ImplementInterfaceWithDisposePatternCodeAction CreateImplementWithDisposePatternCodeAction(
+ AbstractImplementInterfaceService service,
+ Document document,
+ State state)
+ {
+ return new ImplementInterfaceWithDisposePatternCodeAction(service, document, state, explicitly: false, abstractly: false, throughMember: null);
+ }
+
+ public static ImplementInterfaceWithDisposePatternCodeAction CreateImplementExplicitlyWithDisposePatternCodeAction(
+ AbstractImplementInterfaceService service,
+ Document document,
+ State state)
+ {
+ return new ImplementInterfaceWithDisposePatternCodeAction(service, document, state, explicitly: true, abstractly: false, throughMember: null);
+ }
+
+ public override string Title
+ {
+ get
+ {
+ if (Explicitly)
+ {
+ return Resources.ImplementInterfaceExplicitlyWithDisposePattern;
+ }
+ else
+ {
+ return Resources.ImplementInterfaceWithDisposePattern;
+ }
+ }
+ }
+
+ private static readonly SyntaxAnnotation s_implementingTypeAnnotation = new SyntaxAnnotation("ImplementingType");
+ public override async Task<Document> GetUpdatedDocumentAsync(
+ Document document,
+ IList<Tuple<INamedTypeSymbol, IList<ISymbol>>> unimplementedMembers,
+ INamedTypeSymbol classOrStructType,
+ SyntaxNode classOrStructDecl,
+ CancellationToken cancellationToken)
+ {
+ var result = document;
+ var compilation = await result.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
+
+ // Add an annotation to the type declaration node so that we can find it again to append the dispose pattern implementation below.
+ result = await result.ReplaceNodeAsync(
+ classOrStructDecl,
+ classOrStructDecl.WithAdditionalAnnotations(s_implementingTypeAnnotation),
+ cancellationToken).ConfigureAwait(false);
+ var root = await result.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ classOrStructDecl = root.GetAnnotatedNodes(s_implementingTypeAnnotation).Single();
+ compilation = await result.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
+ classOrStructType = classOrStructType.GetSymbolKey().Resolve(compilation, cancellationToken: cancellationToken).Symbol as INamedTypeSymbol;
+
+ // Use the code generation service to generate all unimplemented members except those that are
+ // part of the dispose pattern. We can't use the code generation service to implement the dispose
+ // pattern since the code generation service doesn't support injection of the custom boiler
+ // plate code required for implementing the dispose pattern.
+ var idisposable = TryGetSymbolForIDisposable(compilation);
+ result = await base.GetUpdatedDocumentAsync(
+ result,
+ unimplementedMembers.Where(m => !m.Item1.Equals(idisposable)).ToList(),
+ classOrStructType,
+ classOrStructDecl,
+ cancellationToken).ConfigureAwait(false);
+
+ // Now append the dispose pattern implementation.
+ root = await result.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ classOrStructDecl = root.GetAnnotatedNodes(s_implementingTypeAnnotation).Single();
+ compilation = await result.Project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
+ classOrStructType = classOrStructType.GetSymbolKey().Resolve(compilation, cancellationToken: cancellationToken).Symbol as INamedTypeSymbol;
+ result = Service.ImplementDisposePattern(result, root, classOrStructType, classOrStructDecl.SpanStart, Explicitly);
+
+ // Remove the annotation since we don't need it anymore.
+ root = await result.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ classOrStructDecl = root.GetAnnotatedNodes(s_implementingTypeAnnotation).Single();
+ result = await result.ReplaceNodeAsync(
+ classOrStructDecl,
+ classOrStructDecl.WithoutAnnotations(s_implementingTypeAnnotation),
+ cancellationToken).ConfigureAwait(false);
+
+ return result;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.State.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.State.cs
new file mode 100644
index 0000000000..b1048b7efa
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.State.cs
@@ -0,0 +1,84 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.ImplementInterface
+{
+ abstract partial class AbstractImplementInterfaceService
+ {
+ internal protected class State
+ {
+ public SyntaxNode Location { get; }
+ public SyntaxNode ClassOrStructDecl { get; }
+ public INamedTypeSymbol ClassOrStructType { get; }
+ public IEnumerable<INamedTypeSymbol> InterfaceTypes { get; }
+ public SemanticModel Model { get; }
+
+ // The members that are not implemented at all.
+ public IList<Tuple<INamedTypeSymbol, IList<ISymbol>>> UnimplementedMembers { get; private set; }
+
+ // The members that have no explicit implementation.
+ public IList<Tuple<INamedTypeSymbol, IList<ISymbol>>> UnimplementedExplicitMembers { get; private set; }
+
+ public State(SyntaxNode interfaceNode, SyntaxNode classOrStructDecl, INamedTypeSymbol classOrStructType, IEnumerable<INamedTypeSymbol> interfaceTypes, SemanticModel model)
+ {
+ this.Location = interfaceNode;
+ this.ClassOrStructDecl = classOrStructDecl;
+ this.ClassOrStructType = classOrStructType;
+ this.InterfaceTypes = interfaceTypes;
+ this.Model = model;
+ }
+
+ public static State Generate(
+ AbstractImplementInterfaceService service,
+ Document document,
+ SemanticModel model,
+ SyntaxNode interfaceNode,
+ CancellationToken cancellationToken)
+ {
+ SyntaxNode classOrStructDecl;
+ INamedTypeSymbol classOrStructType;
+ IEnumerable<INamedTypeSymbol> interfaceTypes;
+ if (!service.TryInitializeState(document, model, interfaceNode, cancellationToken,
+ out classOrStructDecl, out classOrStructType, out interfaceTypes))
+ {
+ return null;
+ }
+
+ if (!CodeGenerator.CanAdd(document.Project.Solution, classOrStructType, cancellationToken))
+ {
+ return null;
+ }
+
+ var state = new State(interfaceNode, classOrStructDecl, classOrStructType, interfaceTypes, model);
+
+ if (service.CanImplementImplicitly)
+ {
+ state.UnimplementedMembers = state.ClassOrStructType.GetAllUnimplementedMembers(
+ interfaceTypes, cancellationToken);
+
+ state.UnimplementedExplicitMembers = state.ClassOrStructType.GetAllUnimplementedExplicitMembers(
+ interfaceTypes, cancellationToken);
+
+ var allMembersImplemented = state.UnimplementedMembers == null || state.UnimplementedMembers.Count == 0;
+ var allMembersImplementedExplicitly = state.UnimplementedExplicitMembers == null || state.UnimplementedExplicitMembers.Count == 0;
+
+ return !allMembersImplementedExplicitly && !allMembersImplemented ? state : null;
+ }
+ else
+ {
+ state.UnimplementedMembers = state.ClassOrStructType.GetAllUnimplementedExplicitMembers(
+ interfaceTypes, cancellationToken);
+
+ var allMembersImplemented = state.UnimplementedMembers == null || state.UnimplementedMembers.Count == 0;
+ return !allMembersImplemented ? state : null;
+ }
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.cs
new file mode 100644
index 0000000000..f4ba3bcf6f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/AbstractImplementInterfaceService.cs
@@ -0,0 +1,109 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.Internal.Log;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.ImplementInterface
+{
+ abstract partial class AbstractImplementInterfaceService
+ {
+ protected AbstractImplementInterfaceService()
+ {
+ }
+
+ protected abstract bool CanImplementImplicitly { get; }
+ protected abstract bool HasHiddenExplicitImplementation { get; }
+ protected abstract bool TryInitializeState(Document document, SemanticModel model, SyntaxNode interfaceNode, CancellationToken cancellationToken, out SyntaxNode classOrStructDecl, out INamedTypeSymbol classOrStructType, out IEnumerable<INamedTypeSymbol> interfaceTypes);
+ protected abstract bool CanImplementDisposePattern(INamedTypeSymbol symbol, SyntaxNode classDecl);
+ protected abstract Document ImplementDisposePattern(Document document, SyntaxNode root, INamedTypeSymbol symbol, int position, bool explicitly);
+
+ public async Task<Document> ImplementInterfaceAsync(Document document, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ var model = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ var state = State.Generate(this, document, model, node, cancellationToken);
+ if (state == null)
+ {
+ return document;
+ }
+
+ // While implementing just one default action, like in the case of pressing enter after interface name in VB,
+ // choose to implement with the dispose pattern as that's the Dev12 behavior.
+ var action = ShouldImplementDisposePattern(document, state, explicitly: false) ?
+ ImplementInterfaceWithDisposePatternCodeAction.CreateImplementWithDisposePatternCodeAction(this, document, state) :
+ ImplementInterfaceCodeAction.CreateImplementCodeAction(this, document, state);
+
+ return await action.GetUpdatedDocumentAsync(cancellationToken).ConfigureAwait(false);
+ }
+
+ public IEnumerable<CodeAction> GetCodeActions(Document document, SemanticModel model, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ var state = State.Generate(this, document, model, node, cancellationToken);
+ return GetActions(document, state);
+ }
+
+ private IEnumerable<CodeAction> GetActions(Document document, State state)
+ {
+ if (state == null)
+ {
+ yield break;
+ }
+
+ if (state.UnimplementedMembers != null && state.UnimplementedMembers.Count > 0)
+ {
+ yield return ImplementInterfaceCodeAction.CreateImplementCodeAction(this, document, state);
+
+ if (ShouldImplementDisposePattern(document, state, explicitly: false))
+ {
+ yield return ImplementInterfaceWithDisposePatternCodeAction.CreateImplementWithDisposePatternCodeAction(this, document, state);
+ }
+
+ var delegatableMembers = GetDelegatableMembers(state);
+ foreach (var member in delegatableMembers)
+ {
+ yield return ImplementInterfaceCodeAction.CreateImplementThroughMemberCodeAction(this, document, state, member);
+ }
+
+ if (state.ClassOrStructType.IsAbstract)
+ {
+ yield return ImplementInterfaceCodeAction.CreateImplementAbstractlyCodeAction(this, document, state);
+ }
+ }
+
+ if (state.UnimplementedExplicitMembers != null && state.UnimplementedExplicitMembers.Count > 0)
+ {
+ yield return ImplementInterfaceCodeAction.CreateImplementExplicitlyCodeAction(this, document, state);
+
+ if (ShouldImplementDisposePattern(document, state, explicitly: true))
+ {
+ yield return ImplementInterfaceWithDisposePatternCodeAction.CreateImplementExplicitlyWithDisposePatternCodeAction(this, document, state);
+ }
+ }
+ }
+
+ private IList<ISymbol> GetDelegatableMembers(State state)
+ {
+ var fields =
+ state.ClassOrStructType.GetMembers()
+ .OfType<IFieldSymbol>()
+ .Where(f => !f.IsImplicitlyDeclared)
+ .Where(f => f.Type.GetAllInterfacesIncludingThis().Contains(state.InterfaceTypes.First()))
+ .OfType<ISymbol>();
+
+ // Select all properties with zero parameters that also have a getter
+ var properties =
+ state.ClassOrStructType.GetMembers()
+ .OfType<IPropertySymbol>()
+ .Where(p => (!p.IsImplicitlyDeclared) && (p.Parameters.Length == 0) && (p.GetMethod != null))
+ .Where(p => p.Type.GetAllInterfacesIncludingThis().Contains(state.InterfaceTypes.First()))
+ .OfType<ISymbol>();
+
+ return fields.Concat(properties).ToList();
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/CSharpImplementInterfaceService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/CSharpImplementInterfaceService.cs
new file mode 100644
index 0000000000..33834a9f6e
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ImplementInterface/CSharpImplementInterfaceService.cs
@@ -0,0 +1,170 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Composition;
+using System.Diagnostics;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Simplification;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.ImplementInterface
+{
+ class CSharpImplementInterfaceService : AbstractImplementInterfaceService
+ {
+ protected override bool TryInitializeState(
+ Document document, SemanticModel model, SyntaxNode node, CancellationToken cancellationToken,
+ out SyntaxNode classOrStructDecl, out INamedTypeSymbol classOrStructType, out IEnumerable<INamedTypeSymbol> interfaceTypes)
+ {
+ if (!cancellationToken.IsCancellationRequested)
+ {
+ var interfaceNode = node as TypeSyntax;
+ if (interfaceNode != null && interfaceNode.Parent is BaseTypeSyntax &&
+ interfaceNode.Parent.IsParentKind(SyntaxKind.BaseList) &&
+ ((BaseTypeSyntax)interfaceNode.Parent).Type == interfaceNode)
+ {
+ if (interfaceNode.Parent.Parent.IsParentKind(SyntaxKind.ClassDeclaration) ||
+ interfaceNode.Parent.Parent.IsParentKind(SyntaxKind.StructDeclaration))
+ {
+ var interfaceSymbolInfo = model.GetSymbolInfo(interfaceNode, cancellationToken);
+ if (interfaceSymbolInfo.CandidateReason != CandidateReason.WrongArity)
+ {
+ var interfaceType = interfaceSymbolInfo.GetAnySymbol() as INamedTypeSymbol;
+ cancellationToken.ThrowIfCancellationRequested();
+
+ if (interfaceType != null && interfaceType.TypeKind == TypeKind.Interface)
+ {
+ classOrStructDecl = interfaceNode.Parent.Parent.Parent as TypeDeclarationSyntax;
+ classOrStructType = model.GetDeclaredSymbol(classOrStructDecl, cancellationToken) as INamedTypeSymbol;
+ interfaceTypes = SpecializedCollections.SingletonEnumerable(interfaceType);
+
+ return interfaceTypes != null && classOrStructType != null;
+ }
+ }
+ }
+ }
+ }
+
+ classOrStructDecl = null;
+ classOrStructType = null;
+ interfaceTypes = null;
+ return false;
+ }
+
+ protected override bool CanImplementImplicitly
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ protected override bool HasHiddenExplicitImplementation
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ private static ClassDeclarationSyntax GetClassDeclarationAt(SyntaxNode root, int position)
+ {
+ var node = root.FindToken(position).Parent.FirstAncestorOrSelf((SyntaxNode n) => n.IsKind(SyntaxKind.ClassDeclaration));
+ return node as ClassDeclarationSyntax;
+ }
+
+ protected override bool CanImplementDisposePattern(INamedTypeSymbol symbol, SyntaxNode classDecl)
+ {
+ // The dispose pattern is only applicable if the implementing type is a class that does not already declare any conflicting
+ // members named 'disposedValue' or 'Dispose' (because we will be generating a 'disposedValue' field and a couple of methods
+ // named 'Dispose' as part of implementing the dispose pattern).
+ return (classDecl != null) &&
+ classDecl.IsKind(SyntaxKind.ClassDeclaration) &&
+ (symbol != null) &&
+ !symbol.GetMembers().Any(m => (m.MetadataName == "Dispose") || (m.MetadataName == "disposedValue"));
+ }
+
+ protected override Document ImplementDisposePattern(Document document, SyntaxNode root, INamedTypeSymbol symbol, int position, bool explicitly)
+ {
+ var classDecl = GetClassDeclarationAt(root, position);
+ Debug.Assert(CanImplementDisposePattern(symbol, classDecl), "ImplementDisposePattern called with bad inputs");
+
+ // Generate the IDisposable boilerplate code. The generated code cannot be one giant resource string
+ // because of the need to parse, format, and simplify the result; during pseudo-localized builds, resource
+ // strings are given a special prefix and suffix that will break the parser, hence the requirement to
+ // localize the comments individually.
+ var code = string.Format (@"
+ #region IDisposable Support
+ private bool disposedValue = false; // {0}
+
+ {1}void Dispose(bool disposing)
+ {{
+ if (!disposedValue)
+ {{
+ if (disposing)
+ {{
+ // {2}
+ }}
+
+ // {3}
+ // {4}
+
+ disposedValue = true;
+ }}
+ }}
+
+ // {5}
+ // ~{6}() {{
+ // // {7}
+ // Dispose(false);
+ // }}
+
+ // {8}
+ {9}Dispose()
+ {{
+ // {10}
+ Dispose(true);
+ // {11}
+ // GC.SuppressFinalize(this);
+ }}
+ #endregion
+ ",
+ Resources.ToDetectRedundantCalls,
+ (symbol.IsSealed ? "" : "protected virtual "),
+ Resources.DisposeManagedStateTodo,
+ Resources.FreeUnmanagedResourcesTodo,
+ Resources.SetLargeFieldsToNullTodo,
+ Resources.OverrideAFinalizerTodo,
+ classDecl.Identifier.Value,
+ Resources.DoNotChangeThisCodeUseDispose,
+ Resources.ThisCodeAddedToCorrectlyImplementDisposable,
+ (explicitly ? "void System.IDisposable." : "public void "),
+ Resources.DoNotChangeThisCodeUseDispose,
+ Resources.UncommentTheFollowingIfFinalizerOverriddenTodo
+ );
+
+ var decls = SyntaxFactory.ParseSyntaxTree(code)
+ .GetRoot().DescendantNodes().OfType<MemberDeclarationSyntax>()
+ .Select(decl => decl.WithAdditionalAnnotations(Formatter.Annotation, Simplifier.Annotation))
+ .ToArray();
+
+ // Append #endregion to the trailing trivia of the last declaration being generated.
+ decls[decls.Length - 1] = decls[decls.Length - 1].WithAppendedTrailingTrivia(
+ SyntaxFactory.TriviaList(
+ SyntaxFactory.Trivia(SyntaxFactory.EndRegionDirectiveTrivia(true)),
+ SyntaxFactory.CarriageReturnLineFeed));
+
+ // Ensure that open and close brace tokens are generated in case they are missing.
+ var newNode = classDecl.EnsureOpenAndCloseBraceTokens().AddMembers(decls);
+
+ return document.WithSyntaxRoot(root.ReplaceNode(classDecl, newNode));
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/CSharpIndentEngine.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/CSharpIndentEngine.cs
new file mode 100644
index 0000000000..f7f4206ab1
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/CSharpIndentEngine.cs
@@ -0,0 +1,535 @@
+//
+// CSharpIndentEngine.cs
+//
+// Author:
+// Matej Miklečić <matej.miklecic@gmail.com>
+//
+// Copyright (c) 2013 Matej Miklečić (matej.miklecic@gmail.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Core.Text;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ /// <summary>
+ /// Indentation engine based on a state machine.
+ /// Supports only pushing new chars to the end.
+ /// </summary>
+ /// <remarks>
+ /// Represents the context for transitions between <see cref="IndentState"/>.
+ /// Delegates the responsibility for pushing a new char to the current
+ /// state and changes between states depending on the pushed chars.
+ /// </remarks>
+ class CSharpIndentEngine : IStateMachineIndentEngine
+ {
+ #region Properties
+
+ /// <summary>
+ /// Formatting options.
+ /// </summary>
+ internal readonly OptionSet options;
+
+ /// <summary>
+ /// Represents the new line character.
+ /// </summary>
+ internal readonly char newLineChar;
+
+ /// <summary>
+ /// The current indentation state.
+ /// </summary>
+ internal IndentState currentState;
+
+ /// <summary>
+ /// Stores conditional symbols of #define directives.
+ /// </summary>
+ internal HashSet<string> conditionalSymbols;
+
+ /// <summary>
+ /// Stores custom conditional symbols.
+ /// </summary>
+ internal HashSet<string> customConditionalSymbols;
+
+ /// <summary>
+ /// Stores the results of evaluations of the preprocessor if/elif directives
+ /// in the current block (between #if and #endif).
+ /// </summary>
+ internal CloneableStack<bool> ifDirectiveEvalResults = new CloneableStack<bool> ();
+
+ /// <summary>
+ /// Stores the indentation levels of the if directives in the current block.
+ /// </summary>
+ internal CloneableStack<Indent> ifDirectiveIndents = new CloneableStack<Indent>();
+
+ /// <summary>
+ /// Stores the last sequence of characters that can form a
+ /// valid keyword or variable name.
+ /// </summary>
+ internal StringBuilder wordToken;
+
+ /// <summary>
+ /// Stores the previous sequence of chars that formed a
+ /// valid keyword or variable name.
+ /// </summary>
+ internal string previousKeyword;
+
+ #endregion
+
+ #region IDocumentIndentEngine
+
+ /// <inheritdoc />
+ public string ThisLineIndent
+ {
+ get
+ {
+ // OPTION: IndentBlankLines
+ // remove the indentation of this line if isLineStart is true
+// if (!textEditorOptions.IndentBlankLines && isLineStart)
+// {
+// return string.Empty;
+// }
+
+ return currentState.ThisLineIndent.IndentString;
+ }
+ }
+
+ /// <inheritdoc />
+ public string NextLineIndent
+ {
+ get
+ {
+ return currentState.NextLineIndent.IndentString;
+ }
+ }
+
+ /// <inheritdoc />
+ public string CurrentIndent
+ {
+ get
+ {
+ return currentIndent.ToString();
+ }
+ }
+
+ /// <inheritdoc />
+ /// <remarks>
+ /// This is set depending on the current <see cref="Location"/> and
+ /// can change its value until the <see cref="newLineChar"/> char is
+ /// pushed. If this is true, that doesn't necessarily mean that the
+ /// current line has an incorrect indent (this can be determined
+ /// only at the end of the current line).
+ /// </remarks>
+ public bool NeedsReindent
+ {
+ get
+ {
+ // return true if it's the first column of the line and it has an indent
+ if (previousChar == newLineChar)
+ {
+ return ThisLineIndent.Length > 0;
+ }
+
+ // ignore incorrect indentations when there's only ws on this line
+ if (isLineStart)
+ {
+ return false;
+ }
+
+ return ThisLineIndent != CurrentIndent.ToString();
+ }
+ }
+
+ /// <inheritdoc />
+ public int Offset
+ {
+ get
+ {
+ return offset;
+ }
+ }
+
+// /// <inheritdoc />
+// public TextLocation Location
+// {
+// get
+// {
+// return new TextLocation(line, column);
+// }
+// }
+
+ /// <inheritdoc />
+ public bool EnableCustomIndentLevels
+ {
+ get;
+ set;
+ }
+
+ #endregion
+
+ #region Fields
+
+ /// <summary>
+ /// Represents the number of pushed chars.
+ /// </summary>
+ internal int offset = 0;
+
+ /// <summary>
+ /// The current line number.
+ /// </summary>
+ internal int line = 1;
+
+ /// <summary>
+ /// The current column number.
+ /// </summary>
+ /// <remarks>
+ /// One char can take up multiple columns (e.g. \t).
+ /// </remarks>
+ internal int column = 1;
+
+ /// <summary>
+ /// True if <see cref="char.IsWhiteSpace(char)"/> is true for all
+ /// chars at the current line.
+ /// </summary>
+ internal bool isLineStart = true;
+
+ /// <summary>
+ /// True if <see cref="isLineStart"/> was true before the current
+ /// <see cref="wordToken"/>.
+ /// </summary>
+ internal bool isLineStartBeforeWordToken = true;
+
+ /// <summary>
+ /// Current char that's being pushed.
+ /// </summary>
+ internal char currentChar = '\0';
+
+ /// <summary>
+ /// Last non-whitespace char that has been pushed.
+ /// </summary>
+ internal char previousChar = '\0';
+
+ /// <summary>
+ /// Previous new line char
+ /// </summary>
+ internal char previousNewline = '\0';
+
+ /// <summary>
+ /// Current indent level on this line.
+ /// </summary>
+ internal StringBuilder currentIndent = new StringBuilder();
+
+ /// <summary>
+ /// True if this line began in <see cref="VerbatimStringState"/>.
+ /// </summary>
+ internal bool lineBeganInsideVerbatimString = false;
+
+ /// <summary>
+ /// True if this line began in <see cref="MultiLineCommentState"/>.
+ /// </summary>
+ internal bool lineBeganInsideMultiLineComment = false;
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Creates a new CSharpIndentEngine instance.
+ /// </summary>
+ /// <param name="formattingOptions">
+ /// C# formatting options.
+ /// </param>
+ public CSharpIndentEngine(OptionSet formattingOptions)
+ {
+ this.options = formattingOptions;
+
+ this.currentState = new GlobalBodyState(this);
+
+ this.conditionalSymbols = new HashSet<string>();
+ this.customConditionalSymbols = new HashSet<string>();
+ this.wordToken = new StringBuilder();
+ this.previousKeyword = string.Empty;
+ this.newLineChar = formattingOptions.GetOption(FormattingOptions.NewLine, LanguageNames.CSharp)[0];
+ }
+
+ /// <summary>
+ /// Creates a new CSharpIndentEngine instance from the given prototype.
+ /// </summary>
+ /// <param name="prototype">
+ /// An CSharpIndentEngine instance.
+ /// </param>
+ public CSharpIndentEngine(CSharpIndentEngine prototype)
+ {
+ this.options = prototype.options;
+
+ this.newLineChar = prototype.newLineChar;
+ this.currentState = prototype.currentState.Clone(this);
+ this.conditionalSymbols = new HashSet<string>(prototype.conditionalSymbols);
+ this.customConditionalSymbols = new HashSet<string>(prototype.customConditionalSymbols);
+
+ this.wordToken = new StringBuilder(prototype.wordToken.ToString());
+ this.previousKeyword = string.Copy(prototype.previousKeyword);
+
+ this.offset = prototype.offset;
+ this.line = prototype.line;
+ this.column = prototype.column;
+ this.isLineStart = prototype.isLineStart;
+ this.isLineStartBeforeWordToken = prototype.isLineStartBeforeWordToken;
+ this.currentChar = prototype.currentChar;
+ this.previousChar = prototype.previousChar;
+ this.previousNewline = prototype.previousNewline;
+ this.currentIndent = new StringBuilder(prototype.CurrentIndent.ToString());
+ this.lineBeganInsideMultiLineComment = prototype.lineBeganInsideMultiLineComment;
+ this.lineBeganInsideVerbatimString = prototype.lineBeganInsideVerbatimString;
+ this.ifDirectiveEvalResults = prototype.ifDirectiveEvalResults.Clone();
+ this.ifDirectiveIndents = prototype.ifDirectiveIndents.Clone();
+
+ this.EnableCustomIndentLevels = prototype.EnableCustomIndentLevels;
+ }
+
+ #endregion
+
+ #region IClonable
+
+ object ICloneable.Clone()
+ {
+ return Clone();
+ }
+
+ /// <inheritdoc />
+ IDocumentIndentEngine IDocumentIndentEngine.Clone()
+ {
+ return Clone();
+ }
+
+ public IStateMachineIndentEngine Clone()
+ {
+ return new CSharpIndentEngine(this);
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <inheritdoc />
+ public void Push(char ch)
+ {
+ // append this char to the wordbuf if it can form a valid keyword, otherwise check
+ // if the last sequence of chars form a valid keyword and reset the wordbuf.
+ if ((wordToken.Length == 0 ? char.IsLetter(ch) : char.IsLetterOrDigit(ch)) || ch == '_')
+ {
+ wordToken.Append(ch);
+ }
+ else if (wordToken.Length > 0)
+ {
+ currentState.CheckKeyword(wordToken.ToString());
+ previousKeyword = wordToken.ToString();
+ wordToken.Length = 0;
+ isLineStartBeforeWordToken = false;
+ }
+
+ var isNewLine = NewLine.IsNewLine(ch);
+ if (!isNewLine) {
+ currentState.Push(currentChar = ch);
+ offset++;
+ previousNewline = '\0';
+ // ignore whitespace and newline chars
+ var isWhitespace = currentChar == ' ' || currentChar == '\t';
+ if (!isWhitespace)
+ {
+ previousChar = currentChar;
+ isLineStart = false;
+ }
+
+ if (isLineStart)
+ {
+ currentIndent.Append(ch);
+ }
+
+ if (ch == '\t')
+ {
+ var indentSize = options.GetOption(FormattingOptions.IndentationSize, LanguageNames.CSharp);
+ var nextTabStop = (column - 1 + indentSize) / indentSize;
+ column = 1 + nextTabStop * indentSize;
+ }
+ else
+ {
+ column++;
+ }
+ } else {
+ if (ch == NewLine.LF && previousNewline == NewLine.CR) {
+ offset++;
+ return;
+ }
+ currentState.Push(currentChar = newLineChar);
+ offset++;
+
+ previousNewline = ch;
+ // there can be more than one chars that determine the EOL,
+ // the engine uses only one of them defined with newLineChar
+ if (currentChar != newLineChar)
+ {
+ return;
+ }
+ currentIndent.Length = 0;
+ isLineStart = true;
+ isLineStartBeforeWordToken = true;
+ column = 1;
+ line++;
+
+ lineBeganInsideMultiLineComment = IsInsideMultiLineComment;
+ lineBeganInsideVerbatimString = IsInsideVerbatimString;
+ }
+ }
+
+ /// <inheritdoc />
+ public void Reset()
+ {
+ currentState = new GlobalBodyState(this);
+ conditionalSymbols.Clear();
+ ifDirectiveEvalResults.Clear();
+ ifDirectiveIndents.Clear();
+
+ offset = 0;
+ line = 1;
+ column = 1;
+ isLineStart = true;
+ currentChar = '\0';
+ previousChar = '\0';
+ currentIndent.Length = 0;
+ lineBeganInsideMultiLineComment = false;
+ lineBeganInsideVerbatimString = false;
+ }
+
+ /// <inheritdoc />
+ public void Update(SourceText sourceText, int offset)
+ {
+ if (Offset > offset)
+ {
+ Reset();
+ }
+
+ while (Offset < offset)
+ {
+ Push(sourceText[Offset]);
+ }
+ }
+
+ /// <summary>
+ /// Defines the conditional symbol.
+ /// </summary>
+ /// <param name="defineSymbol">The symbol to define.</param>
+ public void DefineSymbol(string defineSymbol)
+ {
+ if (!customConditionalSymbols.Contains(defineSymbol))
+ customConditionalSymbols.Add(defineSymbol);
+ }
+
+ /// <summary>
+ /// Removes the symbol.
+ /// </summary>
+ /// <param name="undefineSymbol">The symbol to undefine.</param>
+ public void RemoveSymbol(string undefineSymbol)
+ {
+ if (customConditionalSymbols.Contains(undefineSymbol))
+ customConditionalSymbols.Remove(undefineSymbol);
+ }
+ #endregion
+
+ #region IStateMachineIndentEngine
+
+ public bool IsInsidePreprocessorDirective
+ {
+ get { return currentState is PreProcessorState; }
+ }
+
+ public bool IsInsidePreprocessorComment
+ {
+ get { return currentState is PreProcessorCommentState; }
+ }
+
+ public bool IsInsideStringLiteral
+ {
+ get { return currentState is StringLiteralState; }
+ }
+
+ public bool IsInsideVerbatimString
+ {
+ get { return currentState is VerbatimStringState; }
+ }
+
+ public bool IsInsideCharacter
+ {
+ get { return currentState is CharacterState; }
+ }
+
+ public bool IsInsideString
+ {
+ get { return IsInsideStringLiteral || IsInsideVerbatimString || IsInsideCharacter; }
+ }
+
+ public bool IsInsideLineComment
+ {
+ get { return currentState is LineCommentState; }
+ }
+
+ public bool IsInsideMultiLineComment
+ {
+ get { return currentState is MultiLineCommentState; }
+ }
+
+ public bool IsInsideDocLineComment
+ {
+ get { return currentState is DocCommentState; }
+ }
+
+ public bool IsInsideComment
+ {
+ get { return IsInsideLineComment || IsInsideMultiLineComment || IsInsideDocLineComment; }
+ }
+
+ public bool IsInsideOrdinaryComment
+ {
+ get { return IsInsideLineComment || IsInsideMultiLineComment; }
+ }
+
+ public bool IsInsideOrdinaryCommentOrString
+ {
+ get { return IsInsideOrdinaryComment || IsInsideString; }
+ }
+
+ public bool LineBeganInsideVerbatimString
+ {
+ get { return lineBeganInsideVerbatimString; }
+ }
+
+ public bool LineBeganInsideMultiLineComment
+ {
+ get { return lineBeganInsideMultiLineComment; }
+ }
+
+ #endregion
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/CacheIndentEngine.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/CacheIndentEngine.cs
new file mode 100644
index 0000000000..4db7d35987
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/CacheIndentEngine.cs
@@ -0,0 +1,623 @@
+//
+// CacheIndentEngine.cs
+//
+// Author:
+// Matej Miklečić <matej.miklecic@gmail.com>
+//
+// Copyright (c) 2013 Matej Miklečić (matej.miklecic@gmail.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ /// <summary>
+ /// Represents a decorator of an IStateMachineIndentEngine instance that provides
+ /// logic for reseting and updating the engine on text changed events.
+ /// </summary>
+ /// <remarks>
+ /// The decorator is based on periodical caching of the engine's state and
+ /// delegating all logic behind indentation to the currently active engine.
+ /// </remarks>
+ class CacheIndentEngine : IStateMachineIndentEngine
+ {
+
+ #region Properties
+
+ IStateMachineIndentEngine currentEngine;
+ Stack<IStateMachineIndentEngine> cachedEngines = new Stack<IStateMachineIndentEngine>();
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Creates a new CacheIndentEngine instance.
+ /// </summary>
+ /// <param name="decoratedEngine">
+ /// An instance of <see cref="IStateMachineIndentEngine"/> to which the
+ /// logic for indentation will be delegated.
+ /// </param>
+ /// <param name="cacheRate">
+ /// The number of chars between caching.
+ /// </param>
+ public CacheIndentEngine(IStateMachineIndentEngine decoratedEngine, int cacheRate = 2000)
+ {
+ this.currentEngine = decoratedEngine;
+ }
+
+ /// <summary>
+ /// Creates a new CacheIndentEngine instance from the given prototype.
+ /// </summary>
+ /// <param name="prototype">
+ /// A CacheIndentEngine instance.
+ /// </param>
+ public CacheIndentEngine(CacheIndentEngine prototype)
+ {
+ this.currentEngine = prototype.currentEngine.Clone();
+ }
+
+ #endregion
+
+ #region IDocumentIndentEngine
+
+ /// <inheritdoc />
+ public string ThisLineIndent {
+ get { return currentEngine.ThisLineIndent; }
+ }
+
+ /// <inheritdoc />
+ public string NextLineIndent {
+ get { return currentEngine.NextLineIndent; }
+ }
+
+ /// <inheritdoc />
+ public string CurrentIndent {
+ get { return currentEngine.CurrentIndent; }
+ }
+
+ /// <inheritdoc />
+ public bool NeedsReindent {
+ get { return currentEngine.NeedsReindent; }
+ }
+
+ /// <inheritdoc />
+ public int Offset {
+ get { return currentEngine.Offset; }
+ }
+
+// /// <inheritdoc />
+// public TextLocation Location {
+// get { return currentEngine.Location; }
+// }
+
+ /// <inheritdoc />
+ public bool EnableCustomIndentLevels
+ {
+ get { return currentEngine.EnableCustomIndentLevels; }
+ set { currentEngine.EnableCustomIndentLevels = value; }
+ }
+
+ /// <inheritdoc />
+ public void Push(char ch)
+ {
+ currentEngine.Push(ch);
+ }
+
+ /// <inheritdoc />
+ public void Reset()
+ {
+ currentEngine.Reset();
+ cachedEngines.Clear();
+ }
+
+ /// <summary>
+ /// Resets the engine to offset. Clears all cached engines after the given offset.
+ /// </summary>
+ public void ResetEngineToPosition(SourceText sourceText, int offset)
+ {
+ // We are already there
+ if (currentEngine.Offset <= offset)
+ return;
+
+ bool gotCachedEngine = false;
+ while (cachedEngines.Count > 0) {
+ var topEngine = cachedEngines.Peek();
+ if (topEngine.Offset <= offset) {
+ currentEngine = topEngine.Clone();
+ gotCachedEngine = true;
+ break;
+ } else {
+ cachedEngines.Pop();
+ }
+ }
+ if (!gotCachedEngine)
+ currentEngine.Reset();
+ }
+
+ /// <inheritdoc />
+ /// <remarks>
+ /// If the <paramref name="position"/> is negative, the engine will
+ /// update to: document.TextLength + (offset % document.TextLength+1)
+ /// Otherwise it will update to: offset % document.TextLength+1
+ /// </remarks>
+ public void Update(SourceText sourceText, int position)
+ {
+ const int BUFFER_SIZE = 2000;
+
+ if (currentEngine.Offset == position) {
+ //positions match, nothing to be done
+ return;
+ } else if (currentEngine.Offset > position) {
+ //moving backwards, so reset from previous saved location
+ ResetEngineToPosition(sourceText, position);
+ }
+
+ // get the engine caught up
+ int nextSave = (cachedEngines.Count == 0) ? BUFFER_SIZE : cachedEngines.Peek().Offset + BUFFER_SIZE;
+ if (currentEngine.Offset + 1 == position) {
+ char ch = sourceText[currentEngine.Offset];
+ currentEngine.Push(ch);
+ if (currentEngine.Offset == nextSave)
+ cachedEngines.Push(currentEngine.Clone());
+ } else {
+ //bulk copy characters in case buffer is unmanaged
+ //(faster if we reduce managed/unmanaged transitions)
+ while (currentEngine.Offset < position) {
+ int endCut = currentEngine.Offset + BUFFER_SIZE;
+ if (endCut > position)
+ endCut = position;
+ string buffer = sourceText.GetSubText(TextSpan.FromBounds(currentEngine.Offset, endCut)).ToString();
+ foreach (char ch in buffer) {
+ currentEngine.Push(ch);
+ //ConsoleWrite ("pushing character '{0}'", ch);
+ if (currentEngine.Offset == nextSave) {
+ cachedEngines.Push(currentEngine.Clone());
+ nextSave += BUFFER_SIZE;
+ }
+ }
+ }
+ }
+ }
+
+ //public IStateMachineIndentEngine GetEngine(int offset)
+ //{
+ // ResetEngineToPosition(offset);
+ // return currentEngine;
+ //}
+
+ #endregion
+
+ #region IClonable
+
+ /// <inheritdoc />
+ public IStateMachineIndentEngine Clone()
+ {
+ return new CacheIndentEngine(this);
+ }
+
+ /// <inheritdoc />
+ IDocumentIndentEngine IDocumentIndentEngine.Clone()
+ {
+ return Clone();
+ }
+
+ object ICloneable.Clone()
+ {
+ return Clone();
+ }
+
+ #endregion
+
+ #region IStateMachineIndentEngine
+
+ public bool IsInsidePreprocessorDirective {
+ get { return currentEngine.IsInsidePreprocessorDirective; }
+ }
+
+ public bool IsInsidePreprocessorComment {
+ get { return currentEngine.IsInsidePreprocessorComment; }
+ }
+
+ public bool IsInsideStringLiteral {
+ get { return currentEngine.IsInsideStringLiteral; }
+ }
+
+ public bool IsInsideVerbatimString {
+ get { return currentEngine.IsInsideVerbatimString; }
+ }
+
+ public bool IsInsideCharacter {
+ get { return currentEngine.IsInsideCharacter; }
+ }
+
+ public bool IsInsideString {
+ get { return currentEngine.IsInsideString; }
+ }
+
+ public bool IsInsideLineComment {
+ get { return currentEngine.IsInsideLineComment; }
+ }
+
+ public bool IsInsideMultiLineComment {
+ get { return currentEngine.IsInsideMultiLineComment; }
+ }
+
+ public bool IsInsideDocLineComment {
+ get { return currentEngine.IsInsideDocLineComment; }
+ }
+
+ public bool IsInsideComment {
+ get { return currentEngine.IsInsideComment; }
+ }
+
+ public bool IsInsideOrdinaryComment {
+ get { return currentEngine.IsInsideOrdinaryComment; }
+ }
+
+ public bool IsInsideOrdinaryCommentOrString {
+ get { return currentEngine.IsInsideOrdinaryCommentOrString; }
+ }
+
+ public bool LineBeganInsideVerbatimString {
+ get { return currentEngine.LineBeganInsideVerbatimString; }
+ }
+
+ public bool LineBeganInsideMultiLineComment {
+ get { return currentEngine.LineBeganInsideMultiLineComment; }
+ }
+
+ #endregion
+
+ }
+ /*
+/ // <summary>
+ /// Represents a decorator of an IStateMachineIndentEngine instance that provides
+ /// logic for reseting and updating the engine on text changed events.
+ /// </summary>
+ /// <remarks>
+ /// The decorator is based on periodical caching of the engine's state and
+ /// delegating all logic behind indentation to the currently active engine.
+ /// </remarks>
+ class CacheIndentEngine : IStateMachineIndentEngine
+ {
+ #region Properties
+
+ /// <summary>
+ /// Represents the cache interval in number of chars pushed to the engine.
+ /// </summary>
+ /// <remarks>
+ /// When this many new chars are pushed to the engine, the currently active
+ /// engine gets cloned and added to the end of <see cref="cachedEngines"/>.
+ /// </remarks>
+ readonly int cacheRate;
+
+ /// <summary>
+ /// Determines how much memory to reserve on initialization for the
+ /// cached engines.
+ /// </summary>
+ const int cacheCapacity = 25;
+
+ /// <summary>
+ /// Currently active engine.
+ /// </summary>
+ /// <remarks>
+ /// Should be equal to the last engine in <see cref="cachedEngines"/>.
+ /// </remarks>
+ IStateMachineIndentEngine currentEngine;
+
+ /// <summary>
+ /// List of cached engines sorted ascending by
+ /// <see cref="IDocumentIndentEngine.Offset"/>.
+ /// </summary>
+ IStateMachineIndentEngine[] cachedEngines;
+
+ /// <summary>
+ /// The index of the last cached engine in cachedEngines.
+ /// </summary>
+ /// <remarks>
+ /// Should be equal to: currentEngine.Offset / CacheRate
+ /// </remarks>
+ int lastCachedEngine;
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Creates a new CacheIndentEngine instance.
+ /// </summary>
+ /// <param name="decoratedEngine">
+ /// An instance of <see cref="IStateMachineIndentEngine"/> to which the
+ /// logic for indentation will be delegated.
+ /// </param>
+ /// <param name="cacheRate">
+ /// The number of chars between caching.
+ /// </param>
+ public CacheIndentEngine(IStateMachineIndentEngine decoratedEngine, int cacheRate = 2000)
+ {
+ this.cachedEngines = new IStateMachineIndentEngine[cacheCapacity];
+
+ this.cachedEngines[0] = decoratedEngine.Clone();
+ this.currentEngine = this.cachedEngines[0].Clone();
+ this.cacheRate = cacheRate;
+ }
+
+ /// <summary>
+ /// Creates a new CacheIndentEngine instance from the given prototype.
+ /// </summary>
+ /// <param name="prototype">
+ /// A CacheIndentEngine instance.
+ /// </param>
+ public CacheIndentEngine(CacheIndentEngine prototype)
+ {
+ this.cachedEngines = new IStateMachineIndentEngine[prototype.cachedEngines.Length];
+ Array.Copy(prototype.cachedEngines, this.cachedEngines, prototype.cachedEngines.Length);
+
+ this.lastCachedEngine = prototype.lastCachedEngine;
+ this.currentEngine = prototype.currentEngine.Clone();
+ this.cacheRate = prototype.cacheRate;
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Performs caching of the <see cref="CacheIndentEngine.currentEngine"/>.
+ /// </summary>
+ void cache()
+ {
+ if (currentEngine.Offset % cacheRate != 0)
+ {
+ throw new Exception("The current engine's offset is not divisable with the cacheRate.");
+ }
+
+ // determine the new current engine from cachedEngines
+ lastCachedEngine = currentEngine.Offset / cacheRate;
+
+ if (cachedEngines.Length < lastCachedEngine + 1)
+ {
+ Array.Resize(ref cachedEngines, lastCachedEngine * 2);
+ }
+
+ cachedEngines[lastCachedEngine] = currentEngine.Clone();
+ }
+
+ #endregion
+
+ #region IDocumentIndentEngine
+
+ /// <inheritdoc />
+ public IDocument Document
+ {
+ get { return currentEngine.Document; }
+ }
+
+ /// <inheritdoc />
+ public string ThisLineIndent
+ {
+ get { return currentEngine.ThisLineIndent; }
+ }
+
+ /// <inheritdoc />
+ public string NextLineIndent
+ {
+ get { return currentEngine.NextLineIndent; }
+ }
+
+ /// <inheritdoc />
+ public string CurrentIndent
+ {
+ get { return currentEngine.CurrentIndent; }
+ }
+
+ /// <inheritdoc />
+ public bool NeedsReindent
+ {
+ get { return currentEngine.NeedsReindent; }
+ }
+
+ /// <inheritdoc />
+ public int Offset
+ {
+ get { return currentEngine.Offset; }
+ }
+
+ /// <inheritdoc />
+ public TextLocation Location
+ {
+ get { return currentEngine.Location; }
+ }
+
+ /// <inheritdoc />
+ public void Push(char ch)
+ {
+ currentEngine.Push(ch);
+
+ if (currentEngine.Offset % cacheRate == 0)
+ {
+ cache();
+ }
+ }
+
+ /// <inheritdoc />
+ public void Reset()
+ {
+ currentEngine = cachedEngines[lastCachedEngine = 0];
+ }
+
+ /// <inheritdoc />
+ /// <remarks>
+ /// If the <paramref name="offset"/> is negative, the engine will
+ /// update to: document.TextLength + (offset % document.TextLength+1)
+ /// Otherwise it will update to: offset % document.TextLength+1
+ /// </remarks>
+ public void Update(int offset)
+ {
+ // map the given offset to the [0, document.TextLength] interval
+ // using modulo arithmetics
+ offset %= Document.TextLength + 1;
+ if (offset < 0)
+ {
+ offset += Document.TextLength + 1;
+ }
+
+ // check if the engine has to be updated to some previous offset
+ if (currentEngine.Offset > offset)
+ {
+ // replace the currentEngine with the first one whose offset
+ // is less then the given <paramref name="offset"/>
+ lastCachedEngine = offset / cacheRate;
+ currentEngine = cachedEngines[lastCachedEngine].Clone();
+ }
+
+ // update the engine to the given offset
+ while (Offset < offset)
+ {
+ Push(Document.GetCharAt(Offset));
+ }
+ }
+
+ public IStateMachineIndentEngine GetEngine(int offset)
+ {
+ // map the given offset to the [0, document.TextLength] interval
+ // using modulo arithmetics
+ offset %= Document.TextLength + 1;
+ if (offset < 0)
+ {
+ offset += Document.TextLength + 1;
+ }
+
+ // check if the engine has to be updated to some previous offset
+ if (currentEngine.Offset > offset)
+ {
+ // replace the currentEngine with the first one whose offset
+ // is less then the given <paramref name="offset"/>
+ lastCachedEngine = offset / cacheRate;
+ return cachedEngines[lastCachedEngine].Clone();
+ }
+
+ return currentEngine;
+ }
+
+ #endregion
+
+ #region IClonable
+
+ /// <inheritdoc />
+ public IStateMachineIndentEngine Clone()
+ {
+ return new CacheIndentEngine(this);
+ }
+
+ /// <inheritdoc />
+ IDocumentIndentEngine IDocumentIndentEngine.Clone()
+ {
+ return Clone();
+ }
+
+ object ICloneable.Clone()
+ {
+ return Clone();
+ }
+
+ #endregion
+
+ #region IStateMachineIndentEngine
+
+ public bool IsInsidePreprocessorDirective
+ {
+ get { return currentEngine.IsInsidePreprocessorDirective; }
+ }
+
+ public bool IsInsidePreprocessorComment
+ {
+ get { return currentEngine.IsInsidePreprocessorComment; }
+ }
+
+ public bool IsInsideStringLiteral
+ {
+ get { return currentEngine.IsInsideStringLiteral; }
+ }
+
+ public bool IsInsideVerbatimString
+ {
+ get { return currentEngine.IsInsideVerbatimString; }
+ }
+
+ public bool IsInsideCharacter
+ {
+ get { return currentEngine.IsInsideCharacter; }
+ }
+
+ public bool IsInsideString
+ {
+ get { return currentEngine.IsInsideString; }
+ }
+
+ public bool IsInsideLineComment
+ {
+ get { return currentEngine.IsInsideLineComment; }
+ }
+
+ public bool IsInsideMultiLineComment
+ {
+ get { return currentEngine.IsInsideMultiLineComment; }
+ }
+
+ public bool IsInsideDocLineComment
+ {
+ get { return currentEngine.IsInsideDocLineComment; }
+ }
+
+ public bool IsInsideComment
+ {
+ get { return currentEngine.IsInsideComment; }
+ }
+
+ public bool IsInsideOrdinaryComment
+ {
+ get { return currentEngine.IsInsideOrdinaryComment; }
+ }
+
+ public bool IsInsideOrdinaryCommentOrString
+ {
+ get { return currentEngine.IsInsideOrdinaryCommentOrString; }
+ }
+
+ public bool LineBeganInsideVerbatimString
+ {
+ get { return currentEngine.LineBeganInsideVerbatimString; }
+ }
+
+ public bool LineBeganInsideMultiLineComment
+ {
+ get { return currentEngine.LineBeganInsideMultiLineComment; }
+ }
+
+ #endregion
+ }
+
+ */
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/IDocumentIndentEngine.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/IDocumentIndentEngine.cs
new file mode 100644
index 0000000000..793ff67397
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/IDocumentIndentEngine.cs
@@ -0,0 +1,99 @@
+//
+// IDocumentIndentEngine.cs
+//
+// Author:
+// Matej Miklečić <matej.miklecic@gmail.com>
+//
+// Copyright (c) 2013 Matej Miklečić (matej.miklecic@gmail.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ /// <summary>
+ /// The base interface for all indent engines.
+ /// </summary>
+ public interface IDocumentIndentEngine : ICloneable
+ {
+ /// <summary>
+ /// The indentation string of the current line.
+ /// </summary>
+ string ThisLineIndent { get; }
+
+ /// <summary>
+ /// The indentation string of the next line.
+ /// </summary>
+ string NextLineIndent { get; }
+
+ /// <summary>
+ /// The indent string on the beginning of the current line.
+ /// </summary>
+ string CurrentIndent { get; }
+
+ /// <summary>
+ /// True if the current line needs to be reindented.
+ /// </summary>
+ bool NeedsReindent { get; }
+
+ /// <summary>
+ /// The current offset of the engine.
+ /// </summary>
+ int Offset { get; }
+
+ /// <summary>
+ /// If this is true, the engine should try to adjust its indent
+ /// levels to manual user's corrections, even if they are wrong.
+ /// </summary>
+ bool EnableCustomIndentLevels { get; set; }
+
+ /// <summary>
+ /// Pushes a new char into the engine which calculates the new
+ /// indentation levels.
+ /// </summary>
+ /// <param name="ch">
+ /// A new character.
+ /// </param>
+ void Push(char ch);
+
+ /// <summary>
+ /// Resets the engine.
+ /// </summary>
+ void Reset();
+
+ /// <summary>
+ /// Updates the engine to the given offset.
+ /// </summary>
+ /// <param name="offset">
+ /// Valid offset in <see cref="Document"/>.
+ /// </param>
+ void Update(SourceText sourceText, int offset);
+
+ /// <summary>
+ /// Clones the engine and preserves the current state.
+ /// </summary>
+ /// <returns>
+ /// An indentical clone which can operate without interference
+ /// with this engine.
+ /// </returns>
+ new IDocumentIndentEngine Clone();
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/IStateMachineIndentEngine.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/IStateMachineIndentEngine.cs
new file mode 100644
index 0000000000..fa6a456f41
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/IStateMachineIndentEngine.cs
@@ -0,0 +1,60 @@
+//
+// IStateMachineIndentEngine.cs
+//
+// Author:
+// Matej Miklečić <matej.miklecic@gmail.com>
+//
+// Copyright (c) 2013 Matej Miklečić (matej.miklecic@gmail.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ public interface IStateMachineIndentEngine : IDocumentIndentEngine
+ {
+ bool IsInsidePreprocessorDirective { get; }
+
+ bool IsInsidePreprocessorComment { get; }
+
+ bool IsInsideStringLiteral { get; }
+
+ bool IsInsideVerbatimString { get; }
+
+ bool IsInsideCharacter { get; }
+
+ bool IsInsideString { get; }
+
+ bool IsInsideLineComment { get; }
+
+ bool IsInsideMultiLineComment { get; }
+
+ bool IsInsideDocLineComment { get; }
+
+ bool IsInsideComment { get; }
+
+ bool IsInsideOrdinaryComment { get; }
+
+ bool IsInsideOrdinaryCommentOrString { get; }
+
+ bool LineBeganInsideVerbatimString { get; }
+
+ bool LineBeganInsideMultiLineComment { get; }
+
+ new IStateMachineIndentEngine Clone();
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/ITextPasteHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/ITextPasteHandler.cs
new file mode 100644
index 0000000000..c93541e68c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/ITextPasteHandler.cs
@@ -0,0 +1,52 @@
+// ITextPasteHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using Microsoft.CodeAnalysis.Text;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ /// <summary>
+ /// The text paste handler can do formattings to a text that is about to be pasted
+ /// into the text document.
+ /// </summary>
+ public interface ITextPasteHandler
+ {
+ /// <summary>
+ /// Formats plain text that is inserted at a specified offset.
+ /// </summary>
+ /// <returns>
+ /// The text that will get inserted at that position.
+ /// </returns>
+ /// <param name="offset">The offset where the text will be inserted.</param>
+ /// <param name="text">The text to be inserted.</param>
+ /// <param name="copyData">Additional data in case the text was copied from a Mono.TextEditor.</param>
+ string FormatPlainText(SourceText sourceText, int offset, string text, byte[] copyData);
+
+ /// <summary>
+ /// Gets the copy data for a specific segment inside the document. This can contain additional information.
+ /// </summary>
+ /// <param name="segment">The text segment that is about to be copied.</param>
+ byte[] GetCopyData(SourceText sourceText, TextSpan segment);
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/IndentState.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/IndentState.cs
new file mode 100644
index 0000000000..40d31ca9f6
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/IndentState.cs
@@ -0,0 +1,2026 @@
+//
+// IndentState.cs
+//
+// Author:
+// Matej Miklečić <matej.miklecic@gmail.com>
+//
+// Copyright (c) 2013 Matej Miklečić (matej.miklecic@gmail.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using Microsoft.CodeAnalysis.CSharp.Formatting;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis;
+using System.Collections;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ #region IndentState
+
+ /// <summary>
+ /// The base class for all indentation states.
+ /// Each state defines the logic for indentation based on chars that
+ /// are pushed to it.
+ /// </summary>
+ abstract class IndentState : ICloneable
+ {
+ #region Properties
+
+ /// <summary>
+ /// The indentation engine using this state.
+ /// </summary>
+ public CSharpIndentEngine Engine;
+
+ /// <summary>
+ /// The parent state.
+ /// This state can use the indentation levels of its parent.
+ /// When this state exits, the engine returns to the parent.
+ /// </summary>
+ public IndentState Parent;
+
+ /// <summary>
+ /// The indentation of the current line.
+ /// This is set when the state is created and will be changed to
+ /// <see cref="NextLineIndent"/> when the <see cref="CSharpIndentEngine.newLineChar"/>
+ /// is pushed.
+ /// </summary>
+ public Indent ThisLineIndent;
+
+ /// <summary>
+ /// The indentation of the next line.
+ /// This is set when the state is created and can change depending
+ /// on the pushed chars.
+ /// </summary>
+ public Indent NextLineIndent;
+
+ #endregion
+
+ #region Constructors
+
+ protected IndentState()
+ {
+ }
+
+ /// <summary>
+ /// Creates a new indentation state that is a copy of the given
+ /// prototype.
+ /// </summary>
+ /// <param name="prototype">
+ /// The prototype state.
+ /// </param>
+ /// <param name="engine">
+ /// The engine of the new state.
+ /// </param>
+ protected IndentState(IndentState prototype, CSharpIndentEngine engine)
+ {
+ Engine = engine;
+ Parent = prototype.Parent != null ? prototype.Parent.Clone(engine) : null;
+
+ ThisLineIndent = prototype.ThisLineIndent.Clone();
+ NextLineIndent = prototype.NextLineIndent.Clone();
+ }
+
+ #endregion
+
+ #region IClonable
+
+ object ICloneable.Clone()
+ {
+ return Clone(Engine);
+ }
+
+ public abstract IndentState Clone(CSharpIndentEngine engine);
+
+ #endregion
+
+ #region Methods
+
+ internal void Initialize (CSharpIndentEngine engine, IndentState parent = null)
+ {
+ Parent = parent;
+ Engine = engine;
+
+ InitializeState();
+ }
+
+ /// <summary>
+ /// Initializes the state:
+ /// - sets the default indentation levels.
+ /// </summary>
+ /// <remarks>
+ /// Each state can override this method if it needs a different
+ /// logic for setting up the default indentations.
+ /// </remarks>
+ public virtual void InitializeState()
+ {
+ ThisLineIndent = new Indent(Engine.options);
+ NextLineIndent = ThisLineIndent.Clone();
+ }
+
+ /// <summary>
+ /// Actions performed when this state exits.
+ /// </summary>
+ public virtual void OnExit()
+ {
+ if (Parent != null)
+ {
+ // if a state exits on the newline character, it has to push
+ // it back to its parent (and so on recursively if the parent
+ // state also exits). Otherwise, the parent state wouldn't
+ // know that the engine isn't on the same line anymore.
+ if (Engine.currentChar == Engine.newLineChar)
+ {
+ Parent.Push(Engine.newLineChar);
+ }
+
+ // when a state exits the engine stays on the same line and this
+ // state has to override the Parent.ThisLineIndent.
+ Parent.ThisLineIndent = ThisLineIndent.Clone();
+ }
+ }
+
+ /// <summary>
+ /// Changes the current state of the <see cref="CSharpIndentEngine"/> using the current
+ /// state as the parent for the new one.
+ /// </summary>
+ /// <typeparam name="T">
+ /// The type of the new state. Must be assignable from <see cref="IndentState"/>.
+ /// </typeparam>
+ public void ChangeState<T>()
+ where T : IndentState, new ()
+ {
+ var t = new T();
+ t.Initialize(Engine, Engine.currentState);
+ Engine.currentState = t;
+ }
+
+ /// <summary>
+ /// Exits this state by setting the current state of the
+ /// <see cref="CSharpIndentEngine"/> to this state's parent.
+ /// </summary>
+ public void ExitState()
+ {
+ OnExit();
+ Engine.currentState = Engine.currentState.Parent ?? new GlobalBodyState(Engine);
+ }
+
+ /// <summary>
+ /// Common logic behind the push method.
+ /// Each state can override this method and implement its own logic.
+ /// </summary>
+ /// <param name="ch">
+ /// The current character that's being pushed.
+ /// </param>
+ public virtual void Push(char ch)
+ {
+ // replace ThisLineIndent with NextLineIndent if the newLineChar is pushed
+ if (ch == Engine.newLineChar)
+ {
+ var delta = Engine.options.GetOption(FormattingOptions.IndentationSize, LanguageNames.CSharp);
+ while (NextLineIndent.CurIndent - ThisLineIndent.CurIndent > delta &&
+ NextLineIndent.PopIf(IndentType.Continuation));
+ ThisLineIndent = NextLineIndent.Clone();
+
+ }
+ }
+
+ /// <summary>
+ /// When derived, checks if the given sequence of chars form
+ /// a valid keyword or variable name, depending on the state.
+ /// </summary>
+ /// <param name="keyword">
+ /// A possible keyword.
+ /// </param>
+ public virtual void CheckKeyword(string keyword)
+ { }
+
+ /// <summary>
+ /// When derived, checks if the given sequence of chars form
+ /// a valid keyword or variable name, depending on the state.
+ /// </summary>
+ /// <param name="keyword">
+ /// A possible keyword.
+ /// </param>
+ /// <remarks>
+ /// This method should be called from <see cref="Push(char)"/>.
+ /// It is left to derived classes to call this method because of
+ /// performance issues.
+ /// </remarks>
+ public virtual void CheckKeywordOnPush(string keyword)
+ { }
+
+ #endregion
+ }
+
+ #endregion
+
+ #region Null state
+
+ /// <summary>
+ /// Null state.
+ /// </summary>
+ /// <remarks>
+ /// Doesn't define any transitions to new states.
+ /// </remarks>
+ class NullState : IndentState
+ {
+ public NullState()
+ { }
+
+ public NullState(NullState prototype, CSharpIndentEngine engine)
+ : base(prototype, engine)
+ { }
+
+ public override void Push(char ch)
+ { }
+
+ public override IndentState Clone(CSharpIndentEngine engine)
+ {
+ return new NullState(this, engine);
+ }
+ }
+
+ #endregion
+
+ #region Brackets body states
+
+ #region Brackets body base
+
+ /// <summary>
+ /// The base for all brackets body states.
+ /// </summary>
+ /// <remarks>
+ /// Represents a block of code between a pair of brackets.
+ /// </remarks>
+ abstract class BracketsBodyBaseState : IndentState
+ {
+
+ /// <summary>
+ /// When derived in a concrete bracket body state, represents
+ /// the closed bracket character pair.
+ /// </summary>
+ public abstract char ClosedBracket { get; }
+
+ protected BracketsBodyBaseState()
+ { }
+
+ protected BracketsBodyBaseState(BracketsBodyBaseState prototype, CSharpIndentEngine engine)
+ : base(prototype, engine)
+ { }
+
+ public override void Push(char ch)
+ {
+ base.Push(ch);
+ switch (ch) {
+ case '#':
+ if (Engine.isLineStart)
+ ChangeState<PreProcessorState>();
+ break;
+ case '/':
+ if (Engine.previousChar == '/')
+ ChangeState<LineCommentState>();
+ break;
+ case '*':
+ if (Engine.previousChar == '/')
+ ChangeState<MultiLineCommentState>();
+ break;
+ case '"':
+ if (Engine.previousChar == '@')
+ {
+ ChangeState<VerbatimStringState>();
+ }
+ else
+ {
+ ChangeState<StringLiteralState>();
+ }
+ break;
+ case '\'':
+ ChangeState<CharacterState>();
+ break;
+ case '{':
+ ChangeState<BracesBodyState>();
+ break;
+ case '(':
+ ChangeState<ParenthesesBodyState>();
+ break;
+ case '[':
+ ChangeState<SquareBracketsBodyState>();
+ break;
+ default:
+ if (ch == ClosedBracket)
+ ExitState();
+ break;
+ }
+ }
+ }
+
+ #endregion
+
+ #region Braces body state
+
+ /// <summary>
+ /// Braces body state.
+ /// </summary>
+ /// <remarks>
+ /// Represents a block of code between { and }.
+ /// </remarks>
+ class BracesBodyState : BracketsBodyBaseState
+ {
+ /// <summary>
+ /// Type of the current block body.
+ /// </summary>
+ public Body CurrentBody;
+
+ /// <summary>
+ /// Type of the next block body.
+ /// Same as <see cref="CurrentBody"/> if none of the
+ /// <see cref="Body"/> keywords have been read.
+ /// </summary>
+ public Body NextBody;
+
+ /// <summary>
+ /// Type of the current statement.
+ /// </summary>
+ public Statement CurrentStatement
+ {
+ get
+ {
+ return currentStatement;
+ }
+ set
+ {
+ // clear NestedIfStatementLevels if this statement breaks the sequence
+ if (currentStatement == Statement.None && value != Statement.Else)
+ {
+ NestedIfStatementLevels.Clear();
+ }
+
+ currentStatement = value;
+ }
+ }
+ Statement currentStatement;
+
+ /// <summary>
+ /// Contains indent levels of nested if statements.
+ /// </summary>
+ internal CloneableStack<Indent> NestedIfStatementLevels = new CloneableStack<Indent>();
+
+ /// <summary>
+ /// Contains the indent level of the last statement or body keyword.
+ /// </summary>
+ public Indent LastBlockIndent;
+
+ /// <summary>
+ /// True if the engine is on the right side of the equal operator '='.
+ /// </summary>
+ public bool IsRightHandExpression;
+
+ /// <summary>
+ /// True if the '=' char has been pushed and it's not
+ /// a part of a relational operator (&gt;=, &lt;=, !=, ==).
+ /// </summary>
+ public bool IsEqualCharPushed;
+
+ /// <summary>
+ /// The indentation of the previous line.
+ /// </summary>
+ public int PreviousLineIndent;
+
+ /// <summary>
+ /// True if the dot member (e.g. method invocation) indentation has
+ /// been handled in the current statement.
+ /// </summary>
+ public bool IsMemberReferenceDotHandled;
+
+ public override char ClosedBracket
+ {
+ get { return '}'; }
+ }
+
+ public BracesBodyState()
+ {
+ }
+
+ public BracesBodyState(BracesBodyState prototype, CSharpIndentEngine engine)
+ : base(prototype, engine)
+ {
+ CurrentBody = prototype.CurrentBody;
+ NextBody = prototype.NextBody;
+ CurrentStatement = prototype.CurrentStatement;
+ NestedIfStatementLevels = prototype.NestedIfStatementLevels.Clone();
+ IsRightHandExpression = prototype.IsRightHandExpression;
+ IsEqualCharPushed = prototype.IsEqualCharPushed;
+ IsMemberReferenceDotHandled = prototype.IsMemberReferenceDotHandled;
+ LastBlockIndent = prototype.LastBlockIndent;
+ PreviousLineIndent = prototype.PreviousLineIndent;
+ }
+
+ public override void Push(char ch)
+ {
+ // handle IsRightHandExpression property
+ if (IsEqualCharPushed)
+ {
+ if (IsRightHandExpression)
+ {
+ if (ch == Engine.newLineChar)
+ {
+ NextLineIndent.RemoveAlignment();
+ NextLineIndent.Push(IndentType.Continuation);
+ }
+ }
+ // ignore "==" and "=>" operators
+ else if (ch != '=' && ch != '>')
+ {
+ IsRightHandExpression = true;
+
+ if (ch == Engine.newLineChar)
+ {
+ NextLineIndent.Push(IndentType.Continuation);
+ }
+ else
+ {
+ NextLineIndent.SetAlignment(Engine.column - NextLineIndent.CurIndent);
+ }
+ }
+
+ IsEqualCharPushed = ch == ' ' || ch == '\t';
+ }
+
+ if (ch == ';' || (ch == ',' && IsRightHandExpression))
+ {
+ OnStatementExit();
+ }
+ else if (ch == '=' && !(Engine.previousChar == '=' || Engine.previousChar == '<' || Engine.previousChar == '>' || Engine.previousChar == '!'))
+ {
+ IsEqualCharPushed = true;
+ }
+ else if (ch == '.' && !IsMemberReferenceDotHandled)
+ {
+ // OPTION: CSharpFormattingOptions.AlignToMemberReferenceDot
+ if (true /*Engine.options.AlignToMemberReferenceDot*/ && !Engine.isLineStart)
+ {
+ IsMemberReferenceDotHandled = true;
+ NextLineIndent.RemoveAlignment();
+ NextLineIndent.SetAlignment(Engine.column - NextLineIndent.CurIndent - 1, true);
+ }
+ else if (Engine.isLineStart)
+ {
+ IsMemberReferenceDotHandled = true;
+
+ ThisLineIndent.RemoveAlignment();
+ while (ThisLineIndent.CurIndent > PreviousLineIndent &&
+ ThisLineIndent.PopIf(IndentType.Continuation)) ;
+ ThisLineIndent.Push(IndentType.Continuation);
+ NextLineIndent = ThisLineIndent.Clone();
+ }
+ }
+ else if (ch == ':' && Engine.isLineStart && !IsRightHandExpression)
+ {
+ // try to capture ': base(...)', ': this(...)' and inherit statements when they are on a new line
+ ThisLineIndent.Push(IndentType.Continuation);
+ }
+ else if (ch == Engine.newLineChar)
+ {
+ PreviousLineIndent = ThisLineIndent.CurIndent;
+ }
+
+ if (Engine.wordToken.ToString() == "else")
+ {
+ CheckKeywordOnPush("else");
+ }
+
+ base.Push(ch);
+ }
+
+ public override void InitializeState()
+ {
+ ThisLineIndent = Parent.ThisLineIndent.Clone();
+ NextLineIndent = Parent.NextLineIndent.Clone();
+
+ // OPTION: IDocumentIndentEngine.EnableCustomIndentLevels
+ var parent = Parent as BracesBodyState;
+ if (parent == null || parent.LastBlockIndent == null || !Engine.EnableCustomIndentLevels)
+ {
+ NextLineIndent.RemoveAlignment();
+ NextLineIndent.PopIf(IndentType.Continuation);
+ }
+ else
+ {
+ NextLineIndent = parent.LastBlockIndent.Clone();
+ }
+
+ if (Engine.isLineStart)
+ {
+ NextLineIndent.RemoveAlignment();
+ NextLineIndent.PopIf(IndentType.Continuation);
+
+ ThisLineIndent = NextLineIndent.Clone();
+ }
+
+ CurrentBody = extractBody(Parent);
+ NextBody = Body.None;
+ CurrentStatement = Statement.None;
+
+ AddIndentation(CurrentBody);
+ }
+
+ public override IndentState Clone(CSharpIndentEngine engine)
+ {
+ return new BracesBodyState(this, engine);
+ }
+
+ public override void OnExit()
+ {
+ if (Parent is BracesBodyState)
+ {
+ ((BracesBodyState)Parent).OnStatementExit();
+ }
+
+ if (Engine.isLineStart)
+ {
+ ThisLineIndent.RemoveAlignment();
+ ThisLineIndent.PopTry();
+ /*BraceStyle style;
+ if (TryGetBraceStyle(this.CurrentBody, out style)) {
+ if (style == BraceStyle.NextLineShifted ||
+ style == BraceStyle.NextLineShifted2||
+ style == BraceStyle.BannerStyle) {
+ ThisLineIndent.Push(IndentType.Block);
+ }
+ }*/
+ }
+
+ base.OnExit();
+ }
+
+ /// <summary>
+ /// Actions performed when the current statement exits.
+ /// </summary>
+ public virtual void OnStatementExit()
+ {
+ IsRightHandExpression = false;
+ IsMemberReferenceDotHandled = false;
+
+ NextLineIndent.RemoveAlignment();
+ NextLineIndent.PopWhile(IndentType.Continuation);
+
+ CurrentStatement = Statement.None;
+ NextBody = Body.None;
+ LastBlockIndent = null;
+ }
+
+ #region Helpers
+
+ /// <summary>
+ /// Types of braces bodies.
+ /// </summary>
+ public enum Body
+ {
+ None,
+ Namespace,
+ Class,
+ Struct,
+ Interface,
+ Enum,
+ Switch,
+ Case,
+ Try,
+ Catch,
+ Finally
+ }
+
+ /// <summary>
+ /// Types of statements.
+ /// </summary>
+ public enum Statement
+ {
+ None,
+ If,
+ Else,
+ Do,
+ While,
+ For,
+ Foreach,
+ Lock,
+ Using,
+ Return
+ }
+
+ static readonly Dictionary<string, Body> bodies = new Dictionary<string, Body>
+ {
+ { "namespace", Body.Namespace },
+ { "class", Body.Class },
+ { "struct", Body.Struct },
+ { "interface", Body.Interface },
+ { "enum", Body.Enum },
+ { "switch", Body.Switch },
+ { "try", Body.Try },
+ { "catch", Body.Catch },
+ { "finally", Body.Finally },
+ };
+
+ static readonly Dictionary<string, Statement> statements = new Dictionary<string, Statement>
+ {
+ { "if", Statement.If },
+ // { "else", Statement.Else }, // should be handled in CheckKeywordAtPush
+ { "do", Statement.Do },
+ { "while", Statement.While },
+ { "for", Statement.For },
+ { "foreach", Statement.Foreach },
+ { "lock", Statement.Lock },
+ { "using", Statement.Using },
+ { "return", Statement.Return },
+ };
+
+ static readonly HashSet<string> blocks = new HashSet<string>
+ {
+ "namespace",
+ "class",
+ "struct",
+ "interface",
+ "enum",
+ "switch",
+ "try",
+ "catch",
+ "finally",
+ "if",
+ "else",
+ "do",
+ "while",
+ "for",
+ "foreach",
+ "lock",
+ "using",
+ };
+
+ readonly string[] caseDefaultKeywords = {
+ "case",
+ "default"
+ };
+
+ readonly string[] classStructKeywords = {
+ "class",
+ "struct"
+ };
+
+ /// <summary>
+ /// Checks if the given string is a keyword and sets the
+ /// <see cref="NextBody"/> and the <see cref="CurrentStatement"/>
+ /// variables appropriately.
+ /// </summary>
+ /// <param name="keyword">
+ /// A possible keyword.
+ /// </param>
+ /// <remarks>
+ /// This method is called from <see cref="Push(char)"/>
+ /// </remarks>
+ public override void CheckKeywordOnPush(string keyword)
+ {
+ if (keyword == "else")
+ {
+ CurrentStatement = Statement.Else;
+
+ // OPTION: CSharpFormattingOptions.AlignElseInIfStatements
+ if (true && NestedIfStatementLevels.Count > 0)
+ {
+ ThisLineIndent = NestedIfStatementLevels.Pop().Clone();
+ NextLineIndent = ThisLineIndent.Clone();
+ }
+
+ NextLineIndent.Push(IndentType.Continuation);
+ }
+
+ if (blocks.Contains(keyword) && Engine.NeedsReindent)
+ {
+ LastBlockIndent = Indent.ConvertFrom(Engine.CurrentIndent, ThisLineIndent, Engine.options);
+ }
+ }
+
+ /// <summary>
+ /// Checks if the given string is a keyword and sets the
+ /// <see cref="NextBody"/> and the <see cref="CurrentStatement"/>
+ /// variables appropriately.
+ /// </summary>
+ /// <param name="keyword">
+ /// A possible keyword.
+ /// </param>
+ public override void CheckKeyword(string keyword)
+ {
+ if (bodies.ContainsKey(keyword))
+ {
+ var isKeywordTemplateConstraint =
+ classStructKeywords.Contains(keyword) &&
+ (NextBody == Body.Class || NextBody == Body.Struct || NextBody == Body.Interface);
+
+ if (!isKeywordTemplateConstraint)
+ {
+ NextBody = bodies[keyword];
+ }
+ }
+ else if (caseDefaultKeywords.Contains(keyword) && CurrentBody == Body.Switch && Engine.isLineStartBeforeWordToken)
+ {
+ ChangeState<SwitchCaseState>();
+ }
+ else if (keyword == "where" && Engine.isLineStartBeforeWordToken)
+ {
+ // try to capture where (generic type constraint)
+ ThisLineIndent.Push(IndentType.Continuation);
+ }
+ else if (statements.ContainsKey(keyword))
+ {
+ Statement previousStatement = CurrentStatement;
+ CurrentStatement = statements[keyword];
+
+ // return if this is a using declaration or alias
+ if (CurrentStatement == Statement.Using &&
+ (this is GlobalBodyState || CurrentBody == Body.Namespace))
+ {
+ return;
+ }
+ // OPTION: CSharpFormattingOptions.AlignEmbeddedIfStatements
+ if (true /*Engine.options.AlignEmbeddedStatements*/ &&
+ previousStatement == Statement.If &&
+ CurrentStatement == Statement.If)
+ {
+ ThisLineIndent.PopIf(IndentType.Continuation);
+ NextLineIndent.PopIf(IndentType.Continuation);
+ }
+
+ // OPTION: CSharpFormattingOptions.AlignEmbeddedStatements
+ if (true /*Engine.options.AlignEmbeddedStatements*/ &&
+ previousStatement == Statement.Lock &&
+ CurrentStatement == Statement.Lock)
+ {
+ ThisLineIndent.PopIf(IndentType.Continuation);
+ NextLineIndent.PopIf(IndentType.Continuation);
+ }
+
+ // OPTION: CSharpFormattingOptions.AlignEmbeddedUsingStatements
+ if (true /*Engine.options.AlignEmbeddedStatements*/ &&
+ previousStatement == Statement.Using &&
+ CurrentStatement == Statement.Using)
+ {
+ ThisLineIndent.PopIf(IndentType.Continuation);
+ NextLineIndent.PopIf(IndentType.Continuation);
+ }
+
+ // only add continuation for 'else' in 'else if' statement.
+ if (!(CurrentStatement == Statement.If && previousStatement == Statement.Else && !Engine.isLineStartBeforeWordToken))
+ {
+ NextLineIndent.Push(IndentType.Continuation);
+ }
+
+ if (CurrentStatement == Statement.If)
+ {
+ NestedIfStatementLevels.Push(ThisLineIndent);
+ }
+ }
+
+ if (blocks.Contains(keyword) && Engine.NeedsReindent)
+ {
+ LastBlockIndent = Indent.ConvertFrom(Engine.CurrentIndent, ThisLineIndent, Engine.options);
+ }
+ }
+
+// /// <summary>
+// /// Pushes a new level of indentation depending on the given
+// /// <paramref name="braceStyle"/>.
+// /// </summary>
+// void AddIndentation(BraceStyle braceStyle)
+// {
+// switch (braceStyle)
+// {
+// case BraceStyle.NextLineShifted:
+// ThisLineIndent.Push(IndentType.Block);
+// NextLineIndent.Push(IndentType.Block);
+// break;
+// case BraceStyle.DoNotChange:
+// case BraceStyle.EndOfLine:
+// case BraceStyle.EndOfLineWithoutSpace:
+// case BraceStyle.NextLine:
+// case BraceStyle.BannerStyle:
+// NextLineIndent.Push(IndentType.Block);
+// break;
+// case BraceStyle.NextLineShifted2:
+// ThisLineIndent.Push(IndentType.Block);
+// NextLineIndent.Push(IndentType.DoubleBlock);
+// break;
+// }
+// }
+
+// bool TryGetBraceStyle (Body body, out BraceStyle style)
+// {
+// style = BraceStyle.DoNotChange;
+// switch (body)
+// {
+// case Body.None:
+// if (!Engine.options.IndentBlocks)
+// return false;
+// style = Engine.options.StatementBraceStyle;
+// return true;
+// case Body.Namespace:
+// if (!Engine.options.IndentNamespaceBody)
+// return false;
+// style = Engine.options.NamespaceBraceStyle;
+// return true;
+// case Body.Class:
+// if (!Engine.options.IndentClassBody)
+// return false;
+// style = Engine.options.ClassBraceStyle;
+// return true;
+// case Body.Struct:
+// if (!Engine.options.IndentStructBody)
+// return false;
+// style = Engine.options.StructBraceStyle;
+// return true;
+// case Body.Interface:
+// if (!Engine.options.IndentInterfaceBody)
+// return false;
+// style = Engine.options.InterfaceBraceStyle;
+// return true;
+// case Body.Enum:
+// if (!Engine.options.IndentEnumBody)
+// return false;
+// style = Engine.options.EnumBraceStyle;
+// return true;
+// case Body.Switch:
+// if (!Engine.options.IndentSwitchBody)
+// return false;
+// style = Engine.options.StatementBraceStyle;
+// return true;
+// case Body.Try:
+// case Body.Catch:
+// case Body.Finally:
+// style = Engine.options.StatementBraceStyle;
+// return true;
+// }
+// return false;
+// }
+
+ /// <summary>
+ /// Pushes a new level of indentation depending on the given
+ /// <paramref name="body"/>.
+ /// </summary>
+ void AddIndentation(Body body)
+ {
+ NextLineIndent.Push(IndentType.Block);
+
+// BraceStyle style;
+// if (TryGetBraceStyle (body, out style)) {
+// AddIndentation(style);
+// } else {
+// NextLineIndent.Push(IndentType.Empty);
+// }
+ }
+
+ /// <summary>
+ /// Extracts the <see cref="CurrentBody"/> from the given state.
+ /// </summary>
+ /// <returns>
+ /// The correct <see cref="Body"/> type for this state.
+ /// </returns>
+ static Body extractBody(IndentState state)
+ {
+ if (state != null && state is BracesBodyState)
+ {
+ return ((BracesBodyState)state).NextBody;
+ }
+
+ return Body.None;
+ }
+
+ #endregion
+ }
+
+ #endregion
+
+ #region Global body state
+
+ /// <summary>
+ /// Global body state.
+ /// </summary>
+ /// <remarks>
+ /// Represents the global space of the program.
+ /// </remarks>
+ class GlobalBodyState : BracesBodyState
+ {
+ public override char ClosedBracket
+ {
+ get { return '\0'; }
+ }
+
+ public GlobalBodyState()
+ { }
+
+
+ public GlobalBodyState(CSharpIndentEngine engine)
+ {
+ Initialize (engine, null);
+ }
+
+ public GlobalBodyState(GlobalBodyState prototype, CSharpIndentEngine engine)
+ : base(prototype, engine)
+ { }
+
+ public override IndentState Clone(CSharpIndentEngine engine)
+ {
+ return new GlobalBodyState(this, engine);
+ }
+
+ public override void InitializeState()
+ {
+ ThisLineIndent = new Indent(Engine.options);
+ NextLineIndent = ThisLineIndent.Clone();
+ }
+ }
+
+ #endregion
+
+ #region Switch-case body state
+
+ /// <summary>
+ /// Switch-case statement state.
+ /// </summary>
+ /// <remarks>
+ /// Represents the block of code in one switch case (including default).
+ /// </remarks>
+ class SwitchCaseState : BracesBodyState
+ {
+ public SwitchCaseState()
+ { }
+
+ public SwitchCaseState(SwitchCaseState prototype, CSharpIndentEngine engine)
+ : base(prototype, engine)
+ { }
+
+ public override void Push(char ch)
+ {
+ // on ClosedBracket both this state (a case or a default statement)
+ // and also the whole switch block (handled in the base class) must exit.
+ if (ch == ClosedBracket)
+ {
+ ExitState();
+ if (Parent is BracesBodyState)
+ Parent.OnExit();
+ }
+ else if (ch == ':')
+ {
+ NextLineIndent.ExtraSpaces = 0;
+ }
+
+ base.Push(ch);
+ }
+
+ public override void InitializeState()
+ {
+ ThisLineIndent = Parent.ThisLineIndent.Clone();
+ NextLineIndent = ThisLineIndent.Clone();
+
+ // remove all continuations and extra spaces
+ ThisLineIndent.RemoveAlignment();
+ ThisLineIndent.PopWhile(IndentType.Continuation);
+
+ NextLineIndent.RemoveAlignment();
+ NextLineIndent.PopWhile(IndentType.Continuation);
+
+
+ if (Engine.options.GetOption(CSharpFormattingOptions.IndentSwitchSection))
+ {
+ NextLineIndent.Push(IndentType.Block);
+ }
+ else
+ {
+ NextLineIndent.Push(IndentType.Empty);
+ }
+ }
+
+ static readonly string[] caseDefaultKeywords = {
+ "case",
+ "default"
+ };
+
+ static readonly string[] breakContinueReturnGotoKeywords = {
+ "break",
+ "continue",
+ "return",
+ "goto"
+ };
+
+ public override void CheckKeyword(string keyword)
+ {
+ if (caseDefaultKeywords.Contains(keyword) && Engine.isLineStartBeforeWordToken)
+ {
+ ExitState();
+ ChangeState<SwitchCaseState>();
+ }
+ else if (breakContinueReturnGotoKeywords.Contains(keyword) && Engine.isLineStartBeforeWordToken)
+ {
+ // OPTION: Engine.formattingOptions.IndentBreakStatements
+ if (true/*!Engine.options.IndentBreakStatements*/)
+ {
+ ThisLineIndent = Parent.ThisLineIndent.Clone();
+ }
+ }
+
+ base.CheckKeyword(keyword);
+ }
+
+
+ public override void OnExit()
+ {
+ //Parent.OnExit();
+ }
+
+ public override IndentState Clone(CSharpIndentEngine engine)
+ {
+ return new SwitchCaseState(this, engine);
+ }
+ }
+
+ #endregion
+
+ #region Parentheses body state
+
+ /// <summary>
+ /// Parentheses body state.
+ /// </summary>
+ /// <remarks>
+ /// Represents a block of code between ( and ).
+ /// </remarks>
+ class ParenthesesBodyState : BracketsBodyBaseState
+ {
+ /// <summary>
+ /// True if any char has been pushed.
+ /// </summary>
+ public bool IsSomethingPushed;
+
+ public override char ClosedBracket
+ {
+ get { return ')'; }
+ }
+
+ public ParenthesesBodyState()
+ { }
+
+ public ParenthesesBodyState(ParenthesesBodyState prototype, CSharpIndentEngine engine)
+ : base(prototype, engine)
+ {
+ IsSomethingPushed = prototype.IsSomethingPushed;
+ }
+
+ public override void Push(char ch)
+ {
+ if (ch == Engine.newLineChar)
+ {
+ if (!Engine.options.GetOption(CSharpFormattingOptions.NewLinesForBracesInAnonymousMethods)) {
+ if (NextLineIndent.PopIf(IndentType.Continuation)) {
+ NextLineIndent.Push(IndentType.Block);
+ }
+ }
+ }
+ else if (!IsSomethingPushed)
+ {
+ // OPTION: CSharpFormattingOptions.AlignToFirstMethodCallArgument
+ if (true /* Engine.options.AlignToFirstMethodCallArgument*/)
+ {
+ NextLineIndent.PopTry();
+ // align the next line at the beginning of the open bracket
+ NextLineIndent.ExtraSpaces = Math.Max(0, Engine.column - NextLineIndent.CurIndent - 1);
+ }
+ }
+
+ base.Push(ch);
+ IsSomethingPushed = true;
+ }
+
+ public override void InitializeState()
+ {
+ ThisLineIndent = Parent.ThisLineIndent.Clone();
+ NextLineIndent = ThisLineIndent.Clone();
+ NextLineIndent.Push(IndentType.Continuation);
+ }
+
+ public override IndentState Clone(CSharpIndentEngine engine)
+ {
+ return new ParenthesesBodyState(this, engine);
+ }
+
+ public override void OnExit()
+ {
+ if (Engine.isLineStart)
+ {
+ if (ThisLineIndent.ExtraSpaces > 0)
+ {
+ ThisLineIndent.ExtraSpaces--;
+ }
+ else
+ {
+ ThisLineIndent.PopTry();
+ }
+ }
+ base.OnExit();
+ }
+ }
+
+ #endregion
+
+ #region Square brackets body state
+
+ /// <summary>
+ /// Square brackets body state.
+ /// </summary>
+ /// <remarks>
+ /// Represents a block of code between [ and ].
+ /// </remarks>
+ class SquareBracketsBodyState : BracketsBodyBaseState
+ {
+ /// <summary>
+ /// True if any char has been pushed.
+ /// </summary>
+ public bool IsSomethingPushed;
+
+ public override char ClosedBracket
+ {
+ get { return ']'; }
+ }
+
+ public SquareBracketsBodyState()
+ { }
+
+ public SquareBracketsBodyState(SquareBracketsBodyState prototype, CSharpIndentEngine engine)
+ : base(prototype, engine)
+ {
+ IsSomethingPushed = prototype.IsSomethingPushed;
+ }
+
+ public override void Push(char ch)
+ {
+ if (ch == Engine.newLineChar)
+ {
+ if (NextLineIndent.PopIf(IndentType.Continuation))
+ {
+ NextLineIndent.Push(IndentType.Block);
+ }
+ }
+ else if (!IsSomethingPushed)
+ {
+ // OPTION: CSharpFormattingOptions.AlignToFirstIndexerArgument
+ if (true /*Engine.options.AlignToFirstIndexerArgument*/)
+ {
+ NextLineIndent.PopTry();
+ // align the next line at the beginning of the open bracket
+ NextLineIndent.ExtraSpaces = Math.Max(0, Engine.column - NextLineIndent.CurIndent - 1);
+ }
+ }
+
+ base.Push(ch);
+ IsSomethingPushed = true;
+ }
+
+ public override void InitializeState()
+ {
+ ThisLineIndent = Parent.ThisLineIndent.Clone();
+ NextLineIndent = ThisLineIndent.Clone();
+ NextLineIndent.Push(IndentType.Continuation);
+ }
+
+ public override IndentState Clone(CSharpIndentEngine engine)
+ {
+ return new SquareBracketsBodyState(this, engine);
+ }
+
+ public override void OnExit()
+ {
+ if (Engine.isLineStart)
+ {
+ if (ThisLineIndent.ExtraSpaces > 0)
+ {
+ ThisLineIndent.ExtraSpaces--;
+ }
+ else
+ {
+ ThisLineIndent.PopTry();
+ }
+ }
+
+ base.OnExit();
+ }
+ }
+
+ #endregion
+
+ #endregion
+
+ #region PreProcessor state
+
+ /// <summary>
+ /// PreProcessor directive state.
+ /// </summary>
+ /// <remarks>
+ /// Activated when the '#' char is pushed and the
+ /// <see cref="CSharpIndentEngine.isLineStart"/> is true.
+ /// </remarks>
+ class PreProcessorState : IndentState
+ {
+ /// <summary>
+ /// The type of the preprocessor directive.
+ /// </summary>
+ public PreProcessorDirective DirectiveType;
+
+ /// <summary>
+ /// If <see cref="DirectiveType"/> is set (not equal to 'None'), this
+ /// stores the expression of the directive.
+ /// </summary>
+ public StringBuilder DirectiveStatement;
+
+ public PreProcessorState()
+ {
+ DirectiveType = PreProcessorDirective.None;
+ DirectiveStatement = new StringBuilder();
+ }
+
+ public PreProcessorState(PreProcessorState prototype, CSharpIndentEngine engine)
+ : base(prototype, engine)
+ {
+ DirectiveType = prototype.DirectiveType;
+ DirectiveStatement = new StringBuilder(prototype.DirectiveStatement.ToString());
+ }
+
+ public override void Push(char ch)
+ {
+ // HACK: if this change would be left for the CheckKeyword method, we will lose
+ // it if the next pushed char is newLineChar since ThisLineIndent will be
+ // immediately replaced with NextLineIndent. As this most likely will
+ // happen, we check for "endregion" on every push.
+ if (Engine.wordToken.ToString() == "endregion")
+ {
+ CheckKeywordOnPush("endregion");
+ }
+
+ base.Push(ch);
+
+ if (DirectiveType != PreProcessorDirective.None)
+ {
+ DirectiveStatement.Append(ch);
+ }
+
+ if (ch == Engine.newLineChar)
+ {
+ ExitState();
+ switch (DirectiveType)
+ {
+ case PreProcessorDirective.If:
+ Engine.ifDirectiveEvalResults.Push(eval(DirectiveStatement.ToString()));
+ if (Engine.ifDirectiveEvalResults.Peek())
+ {
+ // the if/elif directive is true -> continue with the previous state
+ }
+ else
+ {
+ // the if/elif directive is false -> change to a state that will
+ // ignore any chars until #endif or #elif
+ ChangeState<PreProcessorCommentState>();
+ }
+ break;
+ case PreProcessorDirective.Elif:
+ if (Engine.ifDirectiveEvalResults.Count > 0)
+ {
+ if (!Engine.ifDirectiveEvalResults.Peek())
+ {
+ if (Engine.currentState is PreProcessorCommentState)
+ ExitState();
+ Engine.ifDirectiveEvalResults.Pop();
+ goto case PreProcessorDirective.If;
+ }
+ // previous if was true -> comment
+ ChangeState<PreProcessorCommentState>();
+ }
+ break;
+ case PreProcessorDirective.Else:
+ if (Engine.ifDirectiveEvalResults.Count > 0 && Engine.ifDirectiveEvalResults.Peek())
+ {
+ // some if/elif directive was true -> change to a state that will
+ // ignore any chars until #endif
+ if (!(Engine.currentState is PreProcessorCommentState))
+ ChangeState<PreProcessorCommentState>();
+ }
+ else
+ {
+ // none if/elif directives were true -> exit comment state.
+ if (Engine.currentState is PreProcessorCommentState)
+ ExitState();
+ }
+ break;
+ case PreProcessorDirective.Define:
+ var defineSymbol = DirectiveStatement.ToString().Trim();
+ if (!Engine.conditionalSymbols.Contains(defineSymbol))
+ {
+ Engine.conditionalSymbols.Add(defineSymbol);
+ }
+ break;
+ case PreProcessorDirective.Undef:
+ var undefineSymbol = DirectiveStatement.ToString().Trim();
+ if (Engine.conditionalSymbols.Contains(undefineSymbol))
+ {
+ Engine.conditionalSymbols.Remove(undefineSymbol);
+ }
+ break;
+ case PreProcessorDirective.Endif:
+ // marks the end of this block
+ if (Engine.currentState is PreProcessorCommentState)
+ ExitState();
+ if (Engine.ifDirectiveEvalResults.Count > 0)
+ Engine.ifDirectiveEvalResults.Pop();
+ if (Engine.ifDirectiveIndents.Count > 0)
+ Engine.ifDirectiveIndents.Pop();
+ break;
+ case PreProcessorDirective.Region:
+ case PreProcessorDirective.Pragma:
+ case PreProcessorDirective.Warning:
+ case PreProcessorDirective.Error:
+ case PreProcessorDirective.Line:
+ // continue with the previous state
+ break;
+ }
+ }
+ }
+
+ public override void InitializeState()
+ {
+ // OPTION: IndentPreprocessorDirectives
+ if (true /*Engine.options.IndentPreprocessorDirectives*/)
+ {
+ if (Engine.ifDirectiveIndents.Count > 0)
+ {
+ ThisLineIndent = Engine.ifDirectiveIndents.Peek().Clone();
+ }
+ else
+ {
+ ThisLineIndent = Parent.ThisLineIndent.Clone();
+ }
+ }
+// else
+// {
+// ThisLineIndent = new Indent(Engine.options);
+// }
+
+ NextLineIndent = Parent.NextLineIndent.Clone();
+ }
+
+ static readonly Dictionary<string, PreProcessorDirective> preProcessorDirectives = new Dictionary<string, PreProcessorDirective>
+ {
+ { "if", PreProcessorDirective.If },
+ { "elif", PreProcessorDirective.Elif },
+ { "else", PreProcessorDirective.Else },
+ { "endif", PreProcessorDirective.Endif },
+ { "region", PreProcessorDirective.Region },
+ { "endregion", PreProcessorDirective.Endregion },
+ { "pragma", PreProcessorDirective.Pragma },
+ { "warning", PreProcessorDirective.Warning },
+ { "error", PreProcessorDirective.Error },
+ { "line", PreProcessorDirective.Line },
+ { "define", PreProcessorDirective.Define },
+ { "undef", PreProcessorDirective.Undef }
+ };
+
+ public override void CheckKeywordOnPush(string keyword)
+ {
+ if (keyword == "endregion")
+ {
+ DirectiveType = PreProcessorDirective.Endregion;
+ ThisLineIndent = Parent.NextLineIndent.Clone();
+ }
+ }
+
+ public override void CheckKeyword(string keyword)
+ {
+ // check if the directive type has already been set
+ if (DirectiveType != PreProcessorDirective.None)
+ {
+ return;
+ }
+
+ if (preProcessorDirectives.ContainsKey(keyword))
+ {
+ DirectiveType = preProcessorDirectives[keyword];
+
+ // adjust the indentation for the region directive
+ if (DirectiveType == PreProcessorDirective.Region)
+ {
+ ThisLineIndent = Parent.NextLineIndent.Clone();
+ }
+ else if (DirectiveType == PreProcessorDirective.If)
+ {
+ Engine.ifDirectiveIndents.Push(ThisLineIndent.Clone());
+ }
+ }
+ }
+
+ public override IndentState Clone(CSharpIndentEngine engine)
+ {
+ return new PreProcessorState(this, engine);
+ }
+
+ /// <summary>
+ /// Types of preprocessor directives.
+ /// </summary>
+ public enum PreProcessorDirective
+ {
+ None,
+ If,
+ Elif,
+ Else,
+ Endif,
+ Region,
+ Endregion,
+ Pragma,
+ Warning,
+ Error,
+ Line,
+ Define,
+ Undef
+ }
+
+ #region Pre processor evaluation (from cs-tokenizer.cs)
+
+ static bool is_identifier_start_character(int c)
+ {
+ return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' || Char.IsLetter((char)c);
+ }
+
+ static bool is_identifier_part_character(char c)
+ {
+ if (c >= 'a' && c <= 'z')
+ return true;
+
+ if (c >= 'A' && c <= 'Z')
+ return true;
+
+ if (c == '_' || (c >= '0' && c <= '9'))
+ return true;
+
+ if (c < 0x80)
+ return false;
+
+ return Char.IsLetter(c) || Char.GetUnicodeCategory(c) == UnicodeCategory.ConnectorPunctuation;
+ }
+
+ bool eval_val(string s)
+ {
+ if (s == "true")
+ return true;
+ if (s == "false")
+ return false;
+
+ return Engine.conditionalSymbols != null && Engine.conditionalSymbols.Contains(s) ||
+ Engine.customConditionalSymbols != null && Engine.customConditionalSymbols.Contains(s);
+ }
+
+ bool pp_primary(ref string s)
+ {
+ s = s.Trim();
+ int len = s.Length;
+
+ if (len > 0)
+ {
+ char c = s[0];
+
+ if (c == '(')
+ {
+ s = s.Substring(1);
+ bool val = pp_expr(ref s, false);
+ if (s.Length > 0 && s[0] == ')')
+ {
+ s = s.Substring(1);
+ return val;
+ }
+ return false;
+ }
+
+ if (is_identifier_start_character(c))
+ {
+ int j = 1;
+
+ while (j < len)
+ {
+ c = s[j];
+
+ if (is_identifier_part_character(c))
+ {
+ j++;
+ continue;
+ }
+ bool v = eval_val(s.Substring(0, j));
+ s = s.Substring(j);
+ return v;
+ }
+ bool vv = eval_val(s);
+ s = "";
+ return vv;
+ }
+ }
+ return false;
+ }
+
+ bool pp_unary(ref string s)
+ {
+ s = s.Trim();
+ int len = s.Length;
+
+ if (len > 0)
+ {
+ if (s[0] == '!')
+ {
+ if (len > 1 && s[1] == '=')
+ {
+ return false;
+ }
+ s = s.Substring(1);
+ return !pp_primary(ref s);
+ }
+ else
+ return pp_primary(ref s);
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ bool pp_eq(ref string s)
+ {
+ bool va = pp_unary(ref s);
+
+ s = s.Trim();
+ int len = s.Length;
+ if (len > 0)
+ {
+ if (s[0] == '=')
+ {
+ if (len > 2 && s[1] == '=')
+ {
+ s = s.Substring(2);
+ return va == pp_unary(ref s);
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else if (s[0] == '!' && len > 1 && s[1] == '=')
+ {
+ s = s.Substring(2);
+
+ return va != pp_unary(ref s);
+
+ }
+ }
+
+ return va;
+
+ }
+
+ bool pp_and(ref string s)
+ {
+ bool va = pp_eq(ref s);
+
+ s = s.Trim();
+ int len = s.Length;
+ if (len > 0)
+ {
+ if (s[0] == '&')
+ {
+ if (len > 2 && s[1] == '&')
+ {
+ s = s.Substring(2);
+ return (va & pp_and(ref s));
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+ return va;
+ }
+
+ //
+ // Evaluates an expression for `#if' or `#elif'
+ //
+ bool pp_expr(ref string s, bool isTerm)
+ {
+ bool va = pp_and(ref s);
+ s = s.Trim();
+ int len = s.Length;
+ if (len > 0)
+ {
+ char c = s[0];
+
+ if (c == '|')
+ {
+ if (len > 2 && s[1] == '|')
+ {
+ s = s.Substring(2);
+ return va | pp_expr(ref s, isTerm);
+ }
+ else
+ {
+
+ return false;
+ }
+ }
+ if (isTerm)
+ {
+ return false;
+ }
+ }
+
+ return va;
+ }
+
+ bool eval(string s)
+ {
+ bool v = pp_expr(ref s, true);
+ s = s.Trim();
+ if (s.Length != 0)
+ {
+ return false;
+ }
+
+ return v;
+ }
+
+ #endregion
+ }
+
+ #endregion
+
+ #region PreProcessorComment state
+
+ /// <summary>
+ /// PreProcessor comment state.
+ /// </summary>
+ /// <remarks>
+ /// Activates when the #if or #elif directive is false and ignores
+ /// all pushed chars until the next '#'.
+ /// </remarks>
+ class PreProcessorCommentState : IndentState
+ {
+ public PreProcessorCommentState()
+ { }
+
+ public PreProcessorCommentState(PreProcessorCommentState prototype, CSharpIndentEngine engine)
+ : base(prototype, engine)
+ { }
+
+ public override void Push(char ch)
+ {
+ base.Push(ch);
+
+ if (ch == '#' && Engine.isLineStart)
+ {
+ ChangeState<PreProcessorState>();
+ }
+ }
+
+ public override void InitializeState()
+ {
+ // OPTION: IndentPreprocessorDirectives
+ if (true/*Engine.options.IndentPreprocessorDirectives*/ &&
+ Engine.ifDirectiveIndents.Count > 0)
+ {
+ ThisLineIndent = Engine.ifDirectiveIndents.Peek().Clone();
+ NextLineIndent = ThisLineIndent.Clone();
+ }
+ else
+ {
+ ThisLineIndent = Parent.NextLineIndent.Clone();
+ NextLineIndent = ThisLineIndent.Clone();
+ }
+ }
+
+ public override IndentState Clone(CSharpIndentEngine engine)
+ {
+ return new PreProcessorCommentState(this, engine);
+ }
+ }
+
+ #endregion
+
+ #region LineComment state
+
+ /// <summary>
+ /// Single-line comment state.
+ /// </summary>
+ class LineCommentState : IndentState
+ {
+ /// <summary>
+ /// It's possible that this should be the DocComment state:
+ /// check if the first next pushed char is equal to '/'.
+ /// </summary>
+ public bool CheckForDocComment = true;
+
+ public LineCommentState()
+ {
+ /* if (engine.formattingOptions.KeepCommentsAtFirstColumn && engine.column == 2)
+ ThisLineIndent.Reset();*/
+ }
+
+ public LineCommentState(LineCommentState prototype, CSharpIndentEngine engine)
+ : base(prototype, engine)
+ {
+ CheckForDocComment = prototype.CheckForDocComment;
+ }
+
+ public override void Push(char ch)
+ {
+ base.Push(ch);
+
+ if (ch == Engine.newLineChar)
+ {
+ // to handle cases like //\n/*
+ // Otherwise line 2 would be treated as line comment.
+ Engine.previousChar = '\0';
+ ExitState();
+ }
+ else if (ch == '/' && CheckForDocComment)
+ {
+ // wrong state, should be DocComment.
+ ExitState();
+ ChangeState<DocCommentState>();
+ }
+
+ CheckForDocComment = false;
+ }
+
+ public override void InitializeState()
+ {
+ ThisLineIndent = Parent.ThisLineIndent.Clone();
+ NextLineIndent = Parent.NextLineIndent.Clone();
+ }
+
+ public override IndentState Clone(CSharpIndentEngine engine)
+ {
+ return new LineCommentState(this, engine);
+ }
+ }
+
+ #endregion
+
+ #region DocComment state
+
+ /// <summary>
+ /// XML documentation comment state.
+ /// </summary>
+ class DocCommentState : IndentState
+ {
+ public DocCommentState()
+ { }
+
+ public DocCommentState(DocCommentState prototype, CSharpIndentEngine engine)
+ : base(prototype, engine)
+ { }
+
+ public override void Push(char ch)
+ {
+ base.Push(ch);
+
+ if (ch == Engine.newLineChar)
+ {
+ ExitState();
+ }
+ }
+
+ public override void InitializeState()
+ {
+ ThisLineIndent = Parent.ThisLineIndent.Clone();
+ NextLineIndent = Parent.NextLineIndent.Clone();
+ }
+
+ public override IndentState Clone(CSharpIndentEngine engine)
+ {
+ return new DocCommentState(this, engine);
+ }
+ }
+
+ #endregion
+
+ #region MultiLineComment state
+
+ /// <summary>
+ /// Multi-line comment state.
+ /// </summary>
+ class MultiLineCommentState : IndentState
+ {
+ /// <summary>
+ /// True if any char has been pushed to this state.
+ /// </summary>
+ /// <remarks>
+ /// Needed to resolve an issue when the first pushed char is '/'.
+ /// The state would falsely exit on this sequence of chars '/*/',
+ /// since it only checks if the last two chars are '/' and '*'.
+ /// </remarks>
+ public bool IsAnyCharPushed;
+
+ public MultiLineCommentState()
+ { }
+
+ public MultiLineCommentState(MultiLineCommentState prototype, CSharpIndentEngine engine)
+ : base(prototype, engine)
+ {
+ IsAnyCharPushed = prototype.IsAnyCharPushed;
+ }
+
+ public override void Push(char ch)
+ {
+ base.Push(ch);
+
+ if (ch == '/' && Engine.previousChar == '*' && IsAnyCharPushed)
+ {
+ ExitState();
+ }
+
+ IsAnyCharPushed = true;
+ }
+
+ public override void InitializeState()
+ {
+ ThisLineIndent = Parent.ThisLineIndent.Clone();
+ NextLineIndent = ThisLineIndent.Clone();
+ }
+
+ public override IndentState Clone(CSharpIndentEngine engine)
+ {
+ return new MultiLineCommentState(this, engine);
+ }
+ }
+
+ #endregion
+
+ #region StringLiteral state
+
+ /// <summary>
+ /// StringLiteral state.
+ /// </summary>
+ class StringLiteralState : IndentState
+ {
+ /// <summary>
+ /// True if the next char is escaped with '\'.
+ /// </summary>
+ public bool IsEscaped;
+
+ public StringLiteralState()
+ { }
+
+ public StringLiteralState(StringLiteralState prototype, CSharpIndentEngine engine)
+ : base(prototype, engine)
+ {
+ IsEscaped = prototype.IsEscaped;
+ }
+
+ public override void Push(char ch)
+ {
+ base.Push(ch);
+
+ if (ch == Engine.newLineChar || (!IsEscaped && ch == '"')) {
+ ExitState();
+ } else {
+ IsEscaped = ch == '\\' && !IsEscaped;
+ }
+ }
+
+ public override void InitializeState()
+ {
+ ThisLineIndent = Parent.ThisLineIndent.Clone();
+ NextLineIndent = Parent.NextLineIndent.Clone();
+ }
+
+ public override IndentState Clone(CSharpIndentEngine engine)
+ {
+ return new StringLiteralState(this, engine);
+ }
+ }
+
+ #endregion
+
+ #region Verbatim string state
+
+ /// <summary>
+ /// Verbatim string state.
+ /// </summary>
+ class VerbatimStringState : IndentState
+ {
+ /// <summary>
+ /// True if there is an odd number of '"' in a row.
+ /// </summary>
+ public bool IsEscaped;
+
+ public VerbatimStringState()
+ { }
+
+ public VerbatimStringState(VerbatimStringState prototype, CSharpIndentEngine engine)
+ : base(prototype, engine)
+ {
+ IsEscaped = prototype.IsEscaped;
+ }
+
+ public override void Push(char ch)
+ {
+ base.Push(ch);
+
+ if (IsEscaped && ch != '"')
+ {
+ ExitState();
+ // the char has been pushed to the wrong state, push it back
+ Engine.currentState.Push(ch);
+ }
+
+ IsEscaped = ch == '"' && !IsEscaped;
+ }
+
+ public override void InitializeState()
+ {
+ ThisLineIndent = Parent.ThisLineIndent.Clone();
+ NextLineIndent = new Indent(Engine.options);
+ }
+
+ public override IndentState Clone(CSharpIndentEngine engine)
+ {
+ return new VerbatimStringState(this, engine);
+ }
+ }
+
+ #endregion
+
+ #region Character state
+
+ /// <summary>
+ /// Character state.
+ /// </summary>
+ class CharacterState : IndentState
+ {
+ /// <summary>
+ /// True if the next char is escaped with '\'.
+ /// </summary>
+ public bool IsEscaped;
+
+ public CharacterState()
+ { }
+
+ public CharacterState(CharacterState prototype, CSharpIndentEngine engine)
+ : base(prototype, engine)
+ {
+ IsEscaped = prototype.IsEscaped;
+ }
+
+ public override void Push(char ch)
+ {
+ base.Push(ch);
+
+ if (ch == Engine.newLineChar)
+ {
+ ExitState();
+ }
+ else if (!IsEscaped && ch == '\'')
+ {
+ ExitState();
+ }
+
+ IsEscaped = ch == '\\' && !IsEscaped;
+ }
+
+ public override void InitializeState()
+ {
+ ThisLineIndent = Parent.ThisLineIndent.Clone();
+ NextLineIndent = Parent.NextLineIndent.Clone();
+ }
+
+ public override IndentState Clone(CSharpIndentEngine engine)
+ {
+ return new CharacterState(this, engine);
+ }
+ }
+
+ #endregion
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/NullIStateMachineIndentEngine.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/NullIStateMachineIndentEngine.cs
new file mode 100644
index 0000000000..d4f32a1f80
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/NullIStateMachineIndentEngine.cs
@@ -0,0 +1,207 @@
+//
+// NullIStateMachineIndentEngine.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ /// <summary>
+ /// An empty IStateMachineIndentEngine implementation that does nothing.
+ /// </summary>
+ public sealed class NullIStateMachineIndentEngine : IStateMachineIndentEngine
+ {
+ int offset;
+
+ public NullIStateMachineIndentEngine()
+ {
+ }
+
+ #region IStateMachineIndentEngine implementation
+ public IStateMachineIndentEngine Clone()
+ {
+ return new NullIStateMachineIndentEngine() { offset = this.offset };
+ }
+
+ bool IStateMachineIndentEngine.IsInsidePreprocessorDirective {
+ get {
+ return false;
+ }
+ }
+
+ bool IStateMachineIndentEngine.IsInsidePreprocessorComment {
+ get {
+ return false;
+ }
+ }
+
+ bool IStateMachineIndentEngine.IsInsideStringLiteral {
+ get {
+ return false;
+ }
+ }
+
+ bool IStateMachineIndentEngine.IsInsideVerbatimString {
+ get {
+ return false;
+ }
+ }
+
+ bool IStateMachineIndentEngine.IsInsideCharacter {
+ get {
+ return false;
+ }
+ }
+
+ bool IStateMachineIndentEngine.IsInsideString {
+ get {
+ return false;
+ }
+ }
+
+ bool IStateMachineIndentEngine.IsInsideLineComment {
+ get {
+ return false;
+ }
+ }
+
+ bool IStateMachineIndentEngine.IsInsideMultiLineComment {
+ get {
+ return false;
+ }
+ }
+
+ bool IStateMachineIndentEngine.IsInsideDocLineComment {
+ get {
+ return false;
+ }
+ }
+
+ bool IStateMachineIndentEngine.IsInsideComment {
+ get {
+ return false;
+ }
+ }
+
+ bool IStateMachineIndentEngine.IsInsideOrdinaryComment {
+ get {
+ return false;
+ }
+ }
+
+ bool IStateMachineIndentEngine.IsInsideOrdinaryCommentOrString {
+ get {
+ return false;
+ }
+ }
+
+ bool IStateMachineIndentEngine.LineBeganInsideVerbatimString {
+ get {
+ return false;
+ }
+ }
+
+ bool IStateMachineIndentEngine.LineBeganInsideMultiLineComment {
+ get {
+ return false;
+ }
+ }
+ #endregion
+
+ #region IDocumentIndentEngine implementation
+ void IDocumentIndentEngine.Push(char ch)
+ {
+ offset++;
+ }
+
+ void IDocumentIndentEngine.Reset()
+ {
+ this.offset = 0;
+ }
+
+ void IDocumentIndentEngine.Update(SourceText sourceText, int offset)
+ {
+ this.offset = offset;
+ }
+
+ IDocumentIndentEngine IDocumentIndentEngine.Clone()
+ {
+ return Clone();
+ }
+
+ string IDocumentIndentEngine.ThisLineIndent {
+ get {
+ return "";
+ }
+ }
+
+ string IDocumentIndentEngine.NextLineIndent {
+ get {
+ return "";
+ }
+ }
+
+ string IDocumentIndentEngine.CurrentIndent {
+ get {
+ return "";
+ }
+ }
+
+ bool IDocumentIndentEngine.NeedsReindent {
+ get {
+ return false;
+ }
+ }
+
+ int IDocumentIndentEngine.Offset {
+ get {
+ return offset;
+ }
+ }
+// TextLocation IDocumentIndentEngine.Location {
+// get {
+// return TextLocation.Empty;
+// }
+// }
+
+ /// <inheritdoc />
+ public bool EnableCustomIndentLevels
+ {
+ get { return false; }
+ set { }
+ }
+
+ #endregion
+
+ #region ICloneable implementation
+ object ICloneable.Clone()
+ {
+ return Clone();
+ }
+ #endregion
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/TextPasteIndentEngine.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/TextPasteIndentEngine.cs
new file mode 100644
index 0000000000..d2e44e4412
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IndentEngine/TextPasteIndentEngine.cs
@@ -0,0 +1,685 @@
+//
+// TextPasteIndentEngine.cs
+//
+// Author:
+// Matej Miklečić <matej.miklecic@gmail.com>
+//
+// Copyright (c) 2013 Matej Miklečić (matej.miklecic@gmail.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.CSharp.Formatting;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Editor;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ /// <summary>
+ /// Represents a decorator of an IStateMachineIndentEngine instance
+ /// that provides logic for text paste events.
+ /// </summary>
+ class TextPasteIndentEngine : IDocumentIndentEngine, ITextPasteHandler
+ {
+
+ #region Properties
+
+ /// <summary>
+ /// An instance of IStateMachineIndentEngine which handles
+ /// the indentation logic.
+ /// </summary>
+ IStateMachineIndentEngine engine;
+ /// <summary>
+ /// Text editor options.
+ /// </summary>
+ internal readonly OptionSet options;
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Creates a new TextPasteIndentEngine instance.
+ /// </summary>
+ /// <param name="decoratedEngine">
+ /// An instance of <see cref="IStateMachineIndentEngine"/> to which the
+ /// logic for indentation will be delegated.
+ /// </param>
+ /// <param name = "options"></param>
+ public TextPasteIndentEngine (IStateMachineIndentEngine decoratedEngine, OptionSet options)
+ {
+ this.engine = decoratedEngine;
+ this.options = options;
+ this.engine.EnableCustomIndentLevels = false;
+ }
+
+ #endregion
+
+ #region ITextPasteHandler
+ /// <inheritdoc />
+ string ITextPasteHandler.FormatPlainText (SourceText sourceText, int offset, string text, byte [] copyData)
+ {
+ if (copyData != null && copyData.Length == 1) {
+ var strategy = TextPasteUtils.Strategies [(PasteStrategy)copyData [0]];
+ text = strategy.Decode (text);
+ }
+ engine.Update (sourceText, offset);
+
+ if (engine.IsInsideStringLiteral) {
+ int idx = text.IndexOf ('"');
+ if (idx > 0) {
+ var o = offset;
+ while (o < sourceText.Length) {
+ char ch = sourceText [o];
+ engine.Push (ch);
+ if (NewLine.IsNewLine (ch))
+ break;
+ o++;
+ if (!engine.IsInsideStringLiteral)
+ return TextPasteUtils.StringLiteralStrategy.Encode (text);
+ }
+ return TextPasteUtils.StringLiteralStrategy.Encode (text.Substring (0, idx)) + text.Substring (idx);
+ }
+ return TextPasteUtils.StringLiteralStrategy.Encode (text);
+
+ } else if (engine.IsInsideVerbatimString) {
+ int idx = text.IndexOf ('"');
+ if (idx > 0) {
+ var o = offset;
+ while (o < sourceText.Length) {
+ char ch = sourceText [o];
+ engine.Push (ch);
+ o++;
+ if (!engine.IsInsideVerbatimString)
+ return TextPasteUtils.VerbatimStringStrategy.Encode (text);
+ }
+ return TextPasteUtils.VerbatimStringStrategy.Encode (text.Substring (0, idx)) + text.Substring (idx);
+ }
+
+ return TextPasteUtils.VerbatimStringStrategy.Encode (text);
+ }
+
+
+ // on the fly formatting is done in post formatting, if turned off just correct indenting.
+ try {
+ if (DefaultSourceEditorOptions.Instance.OnTheFlyFormatting) {
+ return text;
+ }
+ } catch {
+ // may happen in unit tests -> ignore
+ }
+
+ var line = sourceText.Lines.GetLineFromPosition (offset);
+ var pasteAtLineStart = line.Start == offset;
+ var indentedText = new StringBuilder ();
+ var curLine = new StringBuilder ();
+ var clonedEngine = engine.Clone ();
+ bool isNewLine = false, gotNewLine = false;
+ for (int i = 0; i < text.Length; i++) {
+ var ch = text [i];
+ if (clonedEngine.IsInsideVerbatimString || clonedEngine.IsInsideMultiLineComment || clonedEngine.IsInsidePreprocessorComment) {
+ clonedEngine.Push (ch);
+ curLine.Append (ch);
+ continue;
+ }
+
+ var delimiterLength = NewLine.GetDelimiterLength (ch, i + 1 < text.Length ? text [i + 1] : ' ');
+ if (delimiterLength > 0) {
+ isNewLine = true;
+ if (gotNewLine || pasteAtLineStart) {
+ if (curLine.Length > 0 /*|| formattingOptions.EmptyLineFormatting == EmptyLineFormatting.Indent*/)
+ indentedText.Append (clonedEngine.ThisLineIndent);
+ }
+ indentedText.Append (curLine);
+ var newLine = options.GetOption (FormattingOptions.NewLine, LanguageNames.CSharp);
+ indentedText.Append (newLine);
+ curLine.Length = 0;
+ gotNewLine = true;
+ i += delimiterLength - 1;
+ // textEditorOptions.EolMarker[0] is the newLineChar used by the indentation engine.
+ clonedEngine.Push (newLine [0]);
+ } else {
+ if (isNewLine) {
+ if (ch == '\t' || ch == ' ') {
+ clonedEngine.Push (ch);
+ continue;
+ }
+ isNewLine = false;
+ }
+ curLine.Append (ch);
+ clonedEngine.Push (ch);
+ }
+ if (clonedEngine.IsInsideVerbatimString || clonedEngine.IsInsideMultiLineComment &&
+ !(clonedEngine.LineBeganInsideVerbatimString || clonedEngine.LineBeganInsideMultiLineComment)) {
+ if (gotNewLine) {
+ if (curLine.Length > 0 /*|| formattingOptions.EmptyLineFormatting == EmptyLineFormatting.Indent*/)
+ indentedText.Append (clonedEngine.ThisLineIndent);
+ }
+ pasteAtLineStart = false;
+ indentedText.Append (curLine);
+ curLine.Length = 0;
+ gotNewLine = false;
+ continue;
+ }
+ }
+ if (gotNewLine && (!pasteAtLineStart || curLine.Length > 0)) {
+ indentedText.Append (clonedEngine.ThisLineIndent);
+ }
+ if (curLine.Length > 0) {
+ indentedText.Append (curLine);
+ }
+ return indentedText.ToString ();
+ }
+
+ /// <inheritdoc />
+ byte [] ITextPasteHandler.GetCopyData (SourceText sourceText, TextSpan segment)
+ {
+ engine.Update (sourceText, segment.Start);
+ if (engine.IsInsideStringLiteral) {
+ return new [] { (byte)PasteStrategy.StringLiteral };
+ } else if (engine.IsInsideVerbatimString) {
+ return new [] { (byte)PasteStrategy.VerbatimString };
+ }
+
+ return null;
+ }
+
+ #endregion
+
+ #region IDocumentIndentEngine
+
+ /// <inheritdoc />
+ public string ThisLineIndent {
+ get { return engine.ThisLineIndent; }
+ }
+
+ /// <inheritdoc />
+ public string NextLineIndent {
+ get { return engine.NextLineIndent; }
+ }
+
+ /// <inheritdoc />
+ public string CurrentIndent {
+ get { return engine.CurrentIndent; }
+ }
+
+ /// <inheritdoc />
+ public bool NeedsReindent {
+ get { return engine.NeedsReindent; }
+ }
+
+ /// <inheritdoc />
+ public int Offset {
+ get { return engine.Offset; }
+ }
+
+ // /// <inheritdoc />
+ // public TextLocation Location {
+ // get { return engine.Location; }
+ // }
+
+ /// <inheritdoc />
+ public bool EnableCustomIndentLevels {
+ get { return engine.EnableCustomIndentLevels; }
+ set { engine.EnableCustomIndentLevels = value; }
+ }
+
+ /// <inheritdoc />
+ public void Push (char ch)
+ {
+ engine.Push (ch);
+ }
+
+ /// <inheritdoc />
+ public void Reset ()
+ {
+ engine.Reset ();
+ }
+
+ /// <inheritdoc />
+ public void Update (SourceText sourceText, int offset)
+ {
+ engine.Update (sourceText, offset);
+ }
+
+ #endregion
+
+ #region IClonable
+
+ public IDocumentIndentEngine Clone ()
+ {
+ return new TextPasteIndentEngine (engine, options);
+ }
+
+ object ICloneable.Clone ()
+ {
+ return Clone ();
+ }
+
+ #endregion
+
+ }
+
+ /// <summary>
+ /// Types of text-paste strategies.
+ /// </summary>
+ public enum PasteStrategy : byte
+ {
+ PlainText = 0,
+ StringLiteral = 1,
+ VerbatimString = 2
+ }
+
+ /// <summary>
+ /// Defines some helper methods for dealing with text-paste events.
+ /// </summary>
+ static class TextPasteUtils
+ {
+ /// <summary>
+ /// Collection of text-paste strategies.
+ /// </summary>
+ public static TextPasteStrategies Strategies = new TextPasteStrategies ();
+
+ /// <summary>
+ /// The interface for a text-paste strategy.
+ /// </summary>
+ public interface IPasteStrategy
+ {
+ /// <summary>
+ /// Formats the given text according with this strategy rules.
+ /// </summary>
+ /// <param name="text">
+ /// The text to format.
+ /// </param>
+ /// <returns>
+ /// Formatted text.
+ /// </returns>
+ string Encode (string text);
+
+ /// <summary>
+ /// Converts text formatted according with this strategy rules
+ /// to its original form.
+ /// </summary>
+ /// <param name="text">
+ /// Formatted text to convert.
+ /// </param>
+ /// <returns>
+ /// Original form of the given formatted text.
+ /// </returns>
+ string Decode (string text);
+
+ /// <summary>
+ /// Type of this strategy.
+ /// </summary>
+ PasteStrategy Type { get; }
+ }
+
+ /// <summary>
+ /// Wrapper that discovers all defined text-paste strategies and defines a way
+ /// to easily access them through their <see cref="PasteStrategy"/> type.
+ /// </summary>
+ public sealed class TextPasteStrategies
+ {
+ /// <summary>
+ /// Collection of discovered text-paste strategies.
+ /// </summary>
+ IDictionary<PasteStrategy, IPasteStrategy> strategies;
+
+ /// <summary>
+ /// Uses reflection to find all types derived from <see cref="IPasteStrategy"/>
+ /// and adds an instance of each strategy to <see cref="strategies"/>.
+ /// </summary>
+ public TextPasteStrategies ()
+ {
+ strategies = new Dictionary<PasteStrategy, IPasteStrategy> ();
+ strategies [PasteStrategy.PlainText] = PlainTextPasteStrategy.Instance;
+ strategies [PasteStrategy.StringLiteral] = StringLiteralPasteStrategy.Instance;
+ strategies [PasteStrategy.VerbatimString] = VerbatimStringPasteStrategy.Instance;
+ }
+
+ /// <summary>
+ /// Checks if there is a strategy of the given type and returns it.
+ /// </summary>
+ /// <param name="strategy">
+ /// Type of the strategy instance.
+ /// </param>
+ /// <returns>
+ /// A strategy instance of the requested type,
+ /// or <see cref="DefaultStrategy"/> if it wasn't found.
+ /// </returns>
+ public IPasteStrategy this [PasteStrategy strategy] {
+ get {
+ if (strategies.ContainsKey (strategy)) {
+ return strategies [strategy];
+ }
+
+ return DefaultStrategy;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Doesn't do any formatting. Serves as the default strategy.
+ /// </summary>
+ class PlainTextPasteStrategy : IPasteStrategy
+ {
+
+ #region Singleton
+
+ public static IPasteStrategy Instance {
+ get {
+ return instance ?? (instance = new PlainTextPasteStrategy ());
+ }
+ }
+
+ static PlainTextPasteStrategy instance;
+
+ protected PlainTextPasteStrategy ()
+ {
+ }
+
+ #endregion
+
+ /// <inheritdoc />
+ public string Encode (string text)
+ {
+ return text;
+ }
+
+ /// <inheritdoc />
+ public string Decode (string text)
+ {
+ return text;
+ }
+
+ /// <inheritdoc />
+ public PasteStrategy Type {
+ get { return PasteStrategy.PlainText; }
+ }
+ }
+
+ /// <summary>
+ /// Escapes chars in the given text so that they don't
+ /// break a valid string literal.
+ /// </summary>
+ internal class StringLiteralPasteStrategy : IPasteStrategy
+ {
+
+ #region Singleton
+
+ public static IPasteStrategy Instance {
+ get {
+ return instance ?? (instance = new StringLiteralPasteStrategy ());
+ }
+ }
+
+ static StringLiteralPasteStrategy instance;
+
+ protected StringLiteralPasteStrategy ()
+ {
+ }
+
+ #endregion
+
+ /// <inheritdoc />
+ public string Encode (string text)
+ {
+ return ConvertString (text);
+ }
+
+ /// <summary>
+ /// Gets the escape sequence for the specified character.
+ /// </summary>
+ /// <remarks>This method does not convert ' or ".</remarks>
+ public static string ConvertChar (char ch)
+ {
+ switch (ch) {
+ case '\\':
+ return "\\\\";
+ case '\0':
+ return "\\0";
+ case '\a':
+ return "\\a";
+ case '\b':
+ return "\\b";
+ case '\f':
+ return "\\f";
+ case '\n':
+ return "\\n";
+ case '\r':
+ return "\\r";
+ case '\t':
+ return "\\t";
+ case '\v':
+ return "\\v";
+ default:
+ if (char.IsControl (ch) || char.IsSurrogate (ch) ||
+ // print all uncommon white spaces as numbers
+ (char.IsWhiteSpace (ch) && ch != ' ')) {
+ return "\\u" + ((int)ch).ToString ("x4");
+ } else {
+ return ch.ToString ();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Converts special characters to escape sequences within the given string.
+ /// </summary>
+ public static string ConvertString (string str)
+ {
+ StringBuilder sb = new StringBuilder ();
+ foreach (char ch in str) {
+ if (ch == '"') {
+ sb.Append ("\\\"");
+ } else {
+ sb.Append (ConvertChar (ch));
+ }
+ }
+ return sb.ToString ();
+ }
+
+ /// <inheritdoc />
+ public string Decode (string text)
+ {
+ var result = new StringBuilder ();
+ bool isEscaped = false;
+
+ for (int i = 0; i < text.Length; i++) {
+ var ch = text [i];
+ if (isEscaped) {
+ switch (ch) {
+ case 'a':
+ result.Append ('\a');
+ break;
+ case 'b':
+ result.Append ('\b');
+ break;
+ case 'n':
+ result.Append ('\n');
+ break;
+ case 't':
+ result.Append ('\t');
+ break;
+ case 'v':
+ result.Append ('\v');
+ break;
+ case 'r':
+ result.Append ('\r');
+ break;
+ case '\\':
+ result.Append ('\\');
+ break;
+ case 'f':
+ result.Append ('\f');
+ break;
+ case '0':
+ result.Append (0);
+ break;
+ case '"':
+ result.Append ('"');
+ break;
+ case '\'':
+ result.Append ('\'');
+ break;
+ case 'x':
+ char r;
+ if (TryGetHex (text, -1, ref i, out r)) {
+ result.Append (r);
+ break;
+ }
+ goto default;
+ case 'u':
+ if (TryGetHex (text, 4, ref i, out r)) {
+ result.Append (r);
+ break;
+ }
+ goto default;
+ case 'U':
+ if (TryGetHex (text, 8, ref i, out r)) {
+ result.Append (r);
+ break;
+ }
+ goto default;
+ default:
+ result.Append ('\\');
+ result.Append (ch);
+ break;
+ }
+ isEscaped = false;
+ continue;
+ }
+ if (ch != '\\') {
+ result.Append (ch);
+ } else {
+ isEscaped = true;
+ }
+ }
+
+ return result.ToString ();
+ }
+
+ static bool TryGetHex (string text, int count, ref int idx, out char r)
+ {
+ int i;
+ int total = 0;
+ int top = count != -1 ? count : 4;
+
+ for (i = 0; i < top; i++) {
+ int c = text [idx + 1 + i];
+
+ if (c >= '0' && c <= '9')
+ c = (int)c - (int)'0';
+ else if (c >= 'A' && c <= 'F')
+ c = (int)c - (int)'A' + 10;
+ else if (c >= 'a' && c <= 'f')
+ c = (int)c - (int)'a' + 10;
+ else {
+ r = '\0';
+ return false;
+ }
+ total = (total * 16) + c;
+ }
+
+ if (top == 8) {
+ if (total > 0x0010FFFF) {
+ r = '\0';
+ return false;
+ }
+
+ if (total >= 0x00010000)
+ total = ((total - 0x00010000) / 0x0400 + 0xD800);
+ }
+ r = (char)total;
+ idx += top;
+ return true;
+ }
+
+ /// <inheritdoc />
+ public PasteStrategy Type {
+ get { return PasteStrategy.StringLiteral; }
+ }
+ }
+
+ /// <summary>
+ /// Escapes chars in the given text so that they don't
+ /// break a valid verbatim string.
+ /// </summary>
+ class VerbatimStringPasteStrategy : IPasteStrategy
+ {
+
+ #region Singleton
+
+ public static IPasteStrategy Instance {
+ get {
+ return instance ?? (instance = new VerbatimStringPasteStrategy ());
+ }
+ }
+
+ static VerbatimStringPasteStrategy instance;
+
+ protected VerbatimStringPasteStrategy ()
+ {
+ }
+
+ #endregion
+
+ static readonly Dictionary<char, IEnumerable<char>> encodeReplace = new Dictionary<char, IEnumerable<char>> {
+ { '\"', "\"\"" },
+ };
+
+ /// <inheritdoc />
+ public string Encode (string text)
+ {
+ return string.Concat (text.SelectMany (c => encodeReplace.ContainsKey (c) ? encodeReplace [c] : new [] { c }));
+ }
+
+ /// <inheritdoc />
+ public string Decode (string text)
+ {
+ bool isEscaped = false;
+ return string.Concat (text.Where (c => !(isEscaped = !isEscaped && c == '"')));
+ }
+
+ /// <inheritdoc />
+ public PasteStrategy Type {
+ get { return PasteStrategy.VerbatimString; }
+ }
+ }
+
+ /// <summary>
+ /// The default text-paste strategy.
+ /// </summary>
+ public static IPasteStrategy DefaultStrategy = PlainTextPasteStrategy.Instance;
+ /// <summary>
+ /// String literal text-paste strategy.
+ /// </summary>
+ public static IPasteStrategy StringLiteralStrategy = StringLiteralPasteStrategy.Instance;
+ /// <summary>
+ /// Verbatim string text-paste strategy.
+ /// </summary>
+ public static IPasteStrategy VerbatimStringStrategy = VerbatimStringPasteStrategy.Instance;
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.AbstractIntroduceVariableCodeAction.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.AbstractIntroduceVariableCodeAction.cs
new file mode 100644
index 0000000000..d233632cbb
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.AbstractIntroduceVariableCodeAction.cs
@@ -0,0 +1,134 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Simplification;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.IntroduceVariable
+{
+ partial class AbstractIntroduceVariableService<TService, TExpressionSyntax, TTypeSyntax, TTypeDeclarationSyntax, TQueryExpressionSyntax>
+ {
+ internal abstract class AbstractIntroduceVariableCodeAction : CodeAction
+ {
+ private readonly bool _allOccurrences;
+ private readonly bool _isConstant;
+ private readonly bool _isLocal;
+ private readonly bool _isQueryLocal;
+ private readonly TExpressionSyntax _expression;
+ private readonly SemanticDocument _document;
+ private readonly TService _service;
+ private readonly string _title;
+
+ private static Regex s_newlinePattern = new Regex(@"[\r\n]+", RegexOptions.Compiled);
+
+ internal AbstractIntroduceVariableCodeAction(
+ TService service,
+ SemanticDocument document,
+ TExpressionSyntax expression,
+ bool allOccurrences,
+ bool isConstant,
+ bool isLocal,
+ bool isQueryLocal)
+ {
+ _service = service;
+ _document = document;
+ _expression = expression;
+ _allOccurrences = allOccurrences;
+ _isConstant = isConstant;
+ _isLocal = isLocal;
+ _isQueryLocal = isQueryLocal;
+ _title = CreateDisplayText(expression);
+ }
+
+ public override string Title
+ {
+ get { return _title; }
+ }
+
+ protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
+ {
+ var changedDocument = await GetChangedDocumentCoreAsync(cancellationToken).ConfigureAwait(false);
+ return await Simplifier.ReduceAsync(changedDocument, cancellationToken: cancellationToken).ConfigureAwait(false);
+ }
+
+ private async Task<Document> GetChangedDocumentCoreAsync(CancellationToken cancellationToken)
+ {
+ if (_isQueryLocal)
+ {
+ return await _service.IntroduceQueryLocalAsync(_document, _expression, _allOccurrences, cancellationToken).ConfigureAwait(false);
+ }
+ else if (_isLocal)
+ {
+ return await _service.IntroduceLocalAsync(_document, _expression, _allOccurrences, _isConstant, cancellationToken).ConfigureAwait(false);
+ }
+ else
+ {
+ return await IntroduceFieldAsync(cancellationToken).ConfigureAwait(false);
+ }
+ }
+
+ private async Task<Document> IntroduceFieldAsync(CancellationToken cancellationToken)
+ {
+ var result = await _service.IntroduceFieldAsync(_document, _expression, _allOccurrences, _isConstant, cancellationToken).ConfigureAwait(false);
+ return result.Item1;
+ }
+
+ private string CreateDisplayText(TExpressionSyntax expression)
+ {
+ var singleLineExpression = expression.ConvertToSingleLine();
+ var nodeString = singleLineExpression.ToFullString().Trim();
+
+ // prevent the display string from spanning multiple lines
+ nodeString = s_newlinePattern.Replace(nodeString, " ");
+
+ // prevent the display string from being too long
+ const int MaxLength = 40;
+ if (nodeString.Length > MaxLength)
+ {
+ nodeString = nodeString.Substring(0, MaxLength) + "...";
+ }
+
+ return CreateDisplayText(nodeString);
+ }
+
+ private string CreateDisplayText(string nodeString)
+ {
+ // Indexed by: allOccurrences, isConstant, isLocal
+ var formatStrings = new string[2, 2, 2]
+ {
+ {
+ { Resources.IntroduceFieldFor, Resources.IntroduceLocalFor },
+ { Resources.IntroduceConstantFor, Resources.IntroduceLocalConstantFor }
+ },
+ {
+ { Resources.IntroduceFieldForAllOccurrences, Resources.IntroduceLocalForAllOccurrences },
+ { Resources.IntroduceConstantForAllOccurrences, Resources.IntroduceLocalConstantForAll }
+ }
+ };
+
+ var formatString = _isQueryLocal
+ ? _allOccurrences
+ ? Resources.IntroduceQueryVariableForAll
+ : Resources.IntroduceQueryVariableFor
+ : formatStrings[_allOccurrences ? 1 : 0, _isConstant ? 1 : 0, _isLocal ? 1 : 0];
+ return string.Format(formatString, nodeString);
+ }
+
+ protected ITypeSymbol GetExpressionType(
+ CancellationToken cancellationToken)
+ {
+ var semanticModel = _document.SemanticModel;
+ var typeInfo = semanticModel.GetTypeInfo(_expression, cancellationToken);
+
+ return typeInfo.Type ?? typeInfo.ConvertedType ?? semanticModel.Compilation.GetSpecialType(SpecialType.System_Object);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.CodeAction.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.CodeAction.cs
new file mode 100644
index 0000000000..f4084abecb
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.CodeAction.cs
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Simplification;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.IntroduceVariable
+{
+ partial class AbstractIntroduceVariableService<TService, TExpressionSyntax, TTypeSyntax, TTypeDeclarationSyntax, TQueryExpressionSyntax>
+ {
+ private class IntroduceVariableCodeAction : AbstractIntroduceVariableCodeAction
+ {
+ internal IntroduceVariableCodeAction(
+ TService service,
+ SemanticDocument document,
+ TExpressionSyntax expression,
+ bool allOccurrences,
+ bool isConstant,
+ bool isLocal,
+ bool isQueryLocal)
+ : base(service, document, expression, allOccurrences, isConstant, isLocal, isQueryLocal)
+ {
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.IntroduceVariableAllOccurrenceCodeAction.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.IntroduceVariableAllOccurrenceCodeAction.cs
new file mode 100644
index 0000000000..aebb852346
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.IntroduceVariableAllOccurrenceCodeAction.cs
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CaseCorrection;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Simplification;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.IntroduceVariable
+{
+ partial class AbstractIntroduceVariableService<TService, TExpressionSyntax, TTypeSyntax, TTypeDeclarationSyntax, TQueryExpressionSyntax>
+ {
+ private class IntroduceVariableAllOccurrenceCodeAction : AbstractIntroduceVariableCodeAction
+ {
+ internal IntroduceVariableAllOccurrenceCodeAction(
+ TService service,
+ SemanticDocument document,
+ TExpressionSyntax expression,
+ bool allOccurrences,
+ bool isConstant,
+ bool isLocal,
+ bool isQueryLocal)
+ : base(service, document, expression, allOccurrences, isConstant, isLocal, isQueryLocal)
+ {
+ }
+
+ protected override async Task<Document> PostProcessChangesAsync(Document document, CancellationToken cancellationToken)
+ {
+ // TODO: Formatting conversation ? AllowDisjointSpanMerging not supported in nuget roslyn right now.
+ var optionSet = document.Project.Solution.Workspace.Options;//.WithChangedOption(FormattingOptions.AllowDisjointSpanMerging, true);
+ document = await Simplifier.ReduceAsync(document, Simplifier.Annotation, cancellationToken: cancellationToken).ConfigureAwait(false);
+ document = await Formatter.FormatAsync(document, Formatter.Annotation, cancellationToken: cancellationToken).ConfigureAwait(false);
+ document = await CaseCorrector.CaseCorrectAsync(document, CaseCorrector.Annotation, cancellationToken).ConfigureAwait(false);
+ return document;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State.cs
new file mode 100644
index 0000000000..49d2c8aa67
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State.cs
@@ -0,0 +1,271 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Shared.Utilities;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.IntroduceVariable
+{
+ partial class AbstractIntroduceVariableService<TService, TExpressionSyntax, TTypeSyntax, TTypeDeclarationSyntax, TQueryExpressionSyntax>
+ {
+ private partial class State
+ {
+ public SemanticDocument Document { get; private set; }
+ public TExpressionSyntax Expression { get; private set; }
+
+ public bool InAttributeContext { get; private set; }
+ public bool InBlockContext { get; private set; }
+ public bool InConstructorInitializerContext { get; private set; }
+ public bool InFieldContext { get; private set; }
+ public bool InParameterContext { get; private set; }
+ public bool InQueryContext { get; private set; }
+ public bool InExpressionBodiedMemberContext { get; private set; }
+
+ public bool IsConstant { get; private set; }
+
+ private SemanticMap _semanticMap;
+ private readonly TService _service;
+
+ public State(TService service, SemanticDocument document)
+ {
+ _service = service;
+ this.Document = document;
+ }
+
+ public static State Generate(
+ TService service,
+ SemanticDocument document,
+ TextSpan textSpan,
+ CancellationToken cancellationToken)
+ {
+ var state = new State(service, document);
+ if (!state.TryInitialize(textSpan, cancellationToken))
+ {
+ return null;
+ }
+
+ return state;
+ }
+
+ private bool TryInitialize(
+ TextSpan textSpan,
+ CancellationToken cancellationToken)
+ {
+ if (cancellationToken.IsCancellationRequested)
+ {
+ return false;
+ }
+
+ var tree = this.Document.SyntaxTree;
+
+ this.Expression = this.GetExpressionUnderSpan(tree, textSpan, cancellationToken);
+ if (this.Expression == null)
+ {
+ return false;
+ }
+
+ var containingType = this.Expression.AncestorsAndSelf()
+ .Select(n => this.Document.SemanticModel.GetDeclaredSymbol(n, cancellationToken))
+ .OfType<INamedTypeSymbol>()
+ .FirstOrDefault();
+
+ containingType = containingType ?? this.Document.SemanticModel.Compilation.ScriptClass;
+
+ if (containingType == null || containingType.TypeKind == TypeKind.Interface)
+ {
+ return false;
+ }
+
+ if (!CanIntroduceVariable(cancellationToken))
+ {
+ return false;
+ }
+
+ this.IsConstant = this.Document.SemanticModel.GetConstantValue(this.Expression, cancellationToken).HasValue;
+
+ // Note: the ordering of these clauses are important. They go, generally, from
+ // innermost to outermost order.
+ if (IsInQueryContext(cancellationToken))
+ {
+ if (CanGenerateInto<TQueryExpressionSyntax>(cancellationToken))
+ {
+ this.InQueryContext = true;
+ return true;
+ }
+
+ return false;
+ }
+
+ if (IsInConstructorInitializerContext(cancellationToken))
+ {
+ if (CanGenerateInto<TTypeDeclarationSyntax>(cancellationToken))
+ {
+ this.InConstructorInitializerContext = true;
+ return true;
+ }
+
+ return false;
+ }
+
+ var enclosingBlocks = _service.GetContainingExecutableBlocks(this.Expression);
+ if (enclosingBlocks.Any())
+ {
+ // If we're inside a block, then don't even try the other options (like field,
+ // constructor initializer, etc.). This is desirable behavior. If we're in a
+ // block in a field, then we're in a lambda, and we want to offer to generate
+ // a local, and not a field.
+ if (IsInBlockContext(cancellationToken))
+ {
+ this.InBlockContext = true;
+ return true;
+ }
+
+ return false;
+ }
+
+ // The ordering of checks is important here. If we are inside a block within an Expression
+ // bodied member, we should treat it as if we are in block context.
+ // For example, in such a scenario we should generate inside the block, instead of rewriting
+ // a concise expression bodied member to its equivalent that has a body with a block.
+ // For this reason, block should precede expression bodied member check.
+ if (_service.IsInExpressionBodiedMember(this.Expression))
+ {
+ if (CanGenerateInto<TTypeDeclarationSyntax>(cancellationToken))
+ {
+ this.InExpressionBodiedMemberContext = true;
+ return true;
+ }
+
+ return false;
+ }
+
+ if (CanGenerateInto<TTypeDeclarationSyntax>(cancellationToken))
+ {
+ if (IsInParameterContext(cancellationToken))
+ {
+ this.InParameterContext = true;
+ return true;
+ }
+ else if (IsInFieldContext(cancellationToken))
+ {
+ this.InFieldContext = true;
+ return true;
+ }
+ else if (IsInAttributeContext(cancellationToken))
+ {
+ this.InAttributeContext = true;
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public SemanticMap GetSemanticMap(CancellationToken cancellationToken)
+ {
+ _semanticMap = _semanticMap ?? this.Document.SemanticModel.GetSemanticMap(this.Expression, cancellationToken);
+ return _semanticMap;
+ }
+
+ private TExpressionSyntax GetExpressionUnderSpan(SyntaxTree tree, TextSpan textSpan, CancellationToken cancellationToken)
+ {
+ var root = tree.GetRoot(cancellationToken);
+ var startToken = root.FindToken(textSpan.Start);
+ var stopToken = root.FindToken(textSpan.End);
+
+ if (textSpan.End <= stopToken.SpanStart)
+ {
+ stopToken = stopToken.GetPreviousToken(includeSkipped: true);
+ }
+
+ if (startToken.RawKind == 0 || stopToken.RawKind == 0)
+ {
+ return null;
+ }
+
+ var containingExpressions1 = startToken.GetAncestors<TExpressionSyntax>().ToList();
+ var containingExpressions2 = stopToken.GetAncestors<TExpressionSyntax>().ToList();
+
+ var commonExpression = containingExpressions1.FirstOrDefault(containingExpressions2.Contains);
+ if (commonExpression == null)
+ {
+ return null;
+ }
+
+ if (!(textSpan.Start >= commonExpression.FullSpan.Start &&
+ textSpan.Start <= commonExpression.SpanStart))
+ {
+ return null;
+ }
+
+ if (!(textSpan.End >= commonExpression.Span.End &&
+ textSpan.End <= commonExpression.FullSpan.End))
+ {
+ return null;
+ }
+
+ return commonExpression;
+ }
+
+ private bool CanIntroduceVariable(
+ CancellationToken cancellationToken)
+ {
+ // Don't generate a variable for an expression that's the only expression in a
+ // statement. Otherwise we'll end up with something like "v;" which is not
+ // legal in C#.
+ if (!_service.CanIntroduceVariableFor(this.Expression))
+ {
+ return false;
+ }
+
+ if (this.Expression is TTypeSyntax)
+ {
+ return false;
+ }
+
+ // Even though we're creating a variable, we still ask if we can be replaced with an
+ // RValue and not an LValue. This is because introduction of a local adds a *new* LValue
+ // location, and we want to ensure that any writes will still happen to the *original*
+ // LValue location. i.e. if you have: "a[1] = b" then you don't want to change that to
+ // "var c = a[1]; c = b", as that write is no longer happening into the right LValue.
+ //
+ // In essense, this says "i can be replaced with an expression as long as i'm not being
+ // written to".
+ return this.Document.SemanticModel.CanReplaceWithRValue(this.Expression, cancellationToken);
+ }
+
+ private bool CanGenerateInto<TSyntax>(CancellationToken cancellationToken)
+ where TSyntax : SyntaxNode
+ {
+ if (this.Document.SemanticModel.Compilation.ScriptClass != null)
+ {
+ return true;
+ }
+
+ var syntax = this.Expression.GetAncestor<TSyntax>();
+ return syntax != null && !syntax.OverlapsHiddenPosition(cancellationToken);
+ }
+
+ private bool IsInTypeDeclarationOrValidCompilationUnit()
+ {
+ if (this.Expression.GetAncestorOrThis<TTypeDeclarationSyntax>() != null)
+ {
+ return true;
+ }
+
+ // If we're interactive/script, we can generate into the compilation unit.
+ if (this.Document.Document.SourceCodeKind != SourceCodeKind.Regular)
+ {
+ return true;
+ }
+
+ return false;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_Attribute.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_Attribute.cs
new file mode 100644
index 0000000000..16057e7b78
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_Attribute.cs
@@ -0,0 +1,25 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.IntroduceVariable
+{
+ partial class AbstractIntroduceVariableService<TService, TExpressionSyntax, TTypeSyntax, TTypeDeclarationSyntax, TQueryExpressionSyntax>
+ {
+ private partial class State
+ {
+ private bool IsInAttributeContext(
+ CancellationToken cancellationToken)
+ {
+ if (!_service.IsInAttributeArgumentInitializer(this.Expression))
+ {
+ return false;
+ }
+
+ // Have to make sure we're on or inside a type decl so that we have some place to
+ // put the result.
+ return IsInTypeDeclarationOrValidCompilationUnit();
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_Block.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_Block.cs
new file mode 100644
index 0000000000..6c557e43ee
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_Block.cs
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.IntroduceVariable
+{
+ partial class AbstractIntroduceVariableService<TService, TExpressionSyntax, TTypeSyntax, TTypeDeclarationSyntax, TQueryExpressionSyntax>
+ {
+ private partial class State
+ {
+ private bool IsInBlockContext(
+ CancellationToken cancellationToken)
+ {
+ if (!this.IsInTypeDeclarationOrValidCompilationUnit())
+ {
+ return false;
+ }
+
+ // If refer to a query property, then we use the query context instead.
+ var bindingMap = GetSemanticMap(cancellationToken);
+ if (bindingMap.AllReferencedSymbols.Any(s => s is IRangeVariableSymbol))
+ {
+ return false;
+ }
+
+ var type = GetTypeSymbol(this.Document, this.Expression, cancellationToken, objectAsDefault: false);
+ if (type == null || type.SpecialType == SpecialType.System_Void)
+ {
+ return false;
+ }
+
+ return true;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_ConstructorInitializer.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_ConstructorInitializer.cs
new file mode 100644
index 0000000000..d83304cfe1
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_ConstructorInitializer.cs
@@ -0,0 +1,43 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.IntroduceVariable
+{
+ partial class AbstractIntroduceVariableService<TService, TExpressionSyntax, TTypeSyntax, TTypeDeclarationSyntax, TQueryExpressionSyntax>
+ {
+ private partial class State
+ {
+ private bool IsInConstructorInitializerContext(
+ CancellationToken cancellationToken)
+ {
+ // Note: if we're in a lambda that has a block body, then we don't ever get here
+ // because of the early check for IsInBlockContext.
+ if (!_service.IsInConstructorInitializer(this.Expression))
+ {
+ return false;
+ }
+
+ var bindingMap = GetSemanticMap(cancellationToken);
+
+ // Can't extract out if a parameter is referenced.
+ if (bindingMap.AllReferencedSymbols.OfType<IParameterSymbol>().Any())
+ {
+ return false;
+ }
+
+ // Can't extract out an anonymous type used in a constructor initializer.
+ var info = this.Document.SemanticModel.GetTypeInfo(this.Expression, cancellationToken);
+ if (info.Type.ContainsAnonymousType())
+ {
+ return false;
+ }
+
+ return true;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_Field.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_Field.cs
new file mode 100644
index 0000000000..5ca19e5b3b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_Field.cs
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.IntroduceVariable
+{
+ partial class AbstractIntroduceVariableService<TService, TExpressionSyntax, TTypeSyntax, TTypeDeclarationSyntax, TQueryExpressionSyntax>
+ {
+ private partial class State
+ {
+ private bool IsInFieldContext(
+ CancellationToken cancellationToken)
+ {
+ // Note: if we're in a lambda that has a block body, then we don't ever get here
+ // because of the early check for IsInBlockContext.
+ if (!_service.IsInFieldInitializer(this.Expression))
+ {
+ return false;
+ }
+
+ if (!IsInTypeDeclarationOrValidCompilationUnit())
+ {
+ return false;
+ }
+
+ // if the expression in the field references any parameters then that means it was
+ // either an expression inside a lambda in the field, or it was an expression in a
+ // query inside the field. Either of which cannot be extracted out further by this
+ // fix.
+ var bindingMap = GetSemanticMap(cancellationToken);
+ if (bindingMap.AllReferencedSymbols.OfType<IParameterSymbol>().Any())
+ {
+ return false;
+ }
+
+ // Can't extract out an anonymous type used in a field initializer.
+ var info = this.Document.SemanticModel.GetTypeInfo(this.Expression, cancellationToken);
+ if (info.Type.ContainsAnonymousType())
+ {
+ return false;
+ }
+
+ return true;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_Parameter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_Parameter.cs
new file mode 100644
index 0000000000..a71b546629
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_Parameter.cs
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.IntroduceVariable
+{
+ partial class AbstractIntroduceVariableService<TService, TExpressionSyntax, TTypeSyntax, TTypeDeclarationSyntax, TQueryExpressionSyntax>
+ {
+ private partial class State
+ {
+ private bool IsInParameterContext(
+ CancellationToken cancellationToken)
+ {
+ if (!_service.IsInParameterInitializer(this.Expression))
+ {
+ return false;
+ }
+
+ // The default value for a parameter is a constant. So we always allow it unless it
+ // happens to capture one of the method's type parameters.
+ var bindingMap = this.GetSemanticMap(cancellationToken);
+ if (bindingMap.AllReferencedSymbols.OfType<ITypeParameterSymbol>()
+ .Where(tp => tp.TypeParameterKind == TypeParameterKind.Method)
+ .Any())
+ {
+ return false;
+ }
+
+ return true;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_Query.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_Query.cs
new file mode 100644
index 0000000000..4612e91aa3
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.State_Query.cs
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.IntroduceVariable
+{
+ partial class AbstractIntroduceVariableService<TService, TExpressionSyntax, TTypeSyntax, TTypeDeclarationSyntax, TQueryExpressionSyntax>
+ {
+ private partial class State
+ {
+ private bool IsInQueryContext(
+ CancellationToken cancellationToken)
+ {
+ if (!_service.IsInNonFirstQueryClause(this.Expression))
+ {
+ return false;
+ }
+
+ var semanticMap = GetSemanticMap(cancellationToken);
+ if (!semanticMap.AllReferencedSymbols.Any(s => s is IRangeVariableSymbol))
+ {
+ return false;
+ }
+
+ var info = this.Document.SemanticModel.GetTypeInfo(this.Expression, cancellationToken);
+ if (info.Type == null || info.Type.SpecialType == SpecialType.System_Void)
+ {
+ return false;
+ }
+
+ return true;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.cs
new file mode 100644
index 0000000000..105a11dd3c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/AbstractIntroduceVariableService.cs
@@ -0,0 +1,330 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using RefactoringEssentials;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CodeRefactorings;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Internal.Log;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Shared.Utilities;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Ide.TypeSystem;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.IntroduceVariable
+{
+ abstract partial class AbstractIntroduceVariableService<TService, TExpressionSyntax, TTypeSyntax, TTypeDeclarationSyntax, TQueryExpressionSyntax>
+ where TService : AbstractIntroduceVariableService<TService, TExpressionSyntax, TTypeSyntax, TTypeDeclarationSyntax, TQueryExpressionSyntax>
+ where TExpressionSyntax : SyntaxNode
+ where TTypeSyntax : TExpressionSyntax
+ where TTypeDeclarationSyntax : SyntaxNode
+ where TQueryExpressionSyntax : TExpressionSyntax
+ {
+ protected abstract bool IsInNonFirstQueryClause(TExpressionSyntax expression);
+ protected abstract bool IsInFieldInitializer(TExpressionSyntax expression);
+ protected abstract bool IsInParameterInitializer(TExpressionSyntax expression);
+ protected abstract bool IsInConstructorInitializer(TExpressionSyntax expression);
+ protected abstract bool IsInAttributeArgumentInitializer(TExpressionSyntax expression);
+ protected abstract bool IsInExpressionBodiedMember(TExpressionSyntax expression);
+
+ protected abstract IEnumerable<SyntaxNode> GetContainingExecutableBlocks(TExpressionSyntax expression);
+ protected abstract IList<bool> GetInsertionIndices(TTypeDeclarationSyntax destination, CancellationToken cancellationToken);
+
+ protected abstract bool CanIntroduceVariableFor(TExpressionSyntax expression);
+ protected abstract bool CanReplace(TExpressionSyntax expression);
+
+ protected abstract Task<Document> IntroduceQueryLocalAsync(SemanticDocument document, TExpressionSyntax expression, bool allOccurrences, CancellationToken cancellationToken);
+ protected abstract Task<Document> IntroduceLocalAsync(SemanticDocument document, TExpressionSyntax expression, bool allOccurrences, bool isConstant, CancellationToken cancellationToken);
+ protected abstract Task<Tuple<Document, SyntaxNode, int>> IntroduceFieldAsync(SemanticDocument document, TExpressionSyntax expression, bool allOccurrences, bool isConstant, CancellationToken cancellationToken);
+
+ protected virtual bool BlockOverlapsHiddenPosition(SyntaxNode block, CancellationToken cancellationToken)
+ {
+ return block.OverlapsHiddenPosition(cancellationToken);
+ }
+
+ public async Task<IntroduceVariableResult> IntroduceVariableAsync(
+ Document document,
+ TextSpan textSpan,
+ CancellationToken cancellationToken)
+ {
+ var semanticDocument = await SemanticDocument.CreateAsync(document, cancellationToken).ConfigureAwait(false);
+
+ var state = State.Generate((TService)this, semanticDocument, textSpan, cancellationToken);
+ if (state == null)
+ {
+ return IntroduceVariableResult.Failure;
+ }
+
+ var actions = await CreateActionsAsync(state, cancellationToken).ConfigureAwait(false);
+ if (actions.Count == 0)
+ {
+ return IntroduceVariableResult.Failure;
+ }
+
+ return new IntroduceVariableResult(new CodeRefactoring(null, actions));
+ }
+
+ private async Task<List<CodeAction>> CreateActionsAsync(State state, CancellationToken cancellationToken)
+ {
+ var actions = new List<CodeAction>();
+
+ if (state.InQueryContext)
+ {
+ actions.Add(CreateAction(state, allOccurrences: false, isConstant: false, isLocal: false, isQueryLocal: true));
+ actions.Add(CreateAction(state, allOccurrences: true, isConstant: false, isLocal: false, isQueryLocal: true));
+ }
+ else if (state.InParameterContext)
+ {
+ actions.Add(CreateAction(state, allOccurrences: false, isConstant: true, isLocal: false, isQueryLocal: false));
+ actions.Add(CreateAction(state, allOccurrences: true, isConstant: true, isLocal: false, isQueryLocal: false));
+ }
+ else if (state.InFieldContext)
+ {
+ actions.Add(CreateAction(state, allOccurrences: false, isConstant: state.IsConstant, isLocal: false, isQueryLocal: false));
+ actions.Add(CreateAction(state, allOccurrences: true, isConstant: state.IsConstant, isLocal: false, isQueryLocal: false));
+ }
+ else if (state.InConstructorInitializerContext)
+ {
+ actions.Add(CreateAction(state, allOccurrences: false, isConstant: state.IsConstant, isLocal: false, isQueryLocal: false));
+ actions.Add(CreateAction(state, allOccurrences: true, isConstant: state.IsConstant, isLocal: false, isQueryLocal: false));
+ }
+ else if (state.InAttributeContext)
+ {
+ actions.Add(CreateAction(state, allOccurrences: false, isConstant: true, isLocal: false, isQueryLocal: false));
+ actions.Add(CreateAction(state, allOccurrences: true, isConstant: true, isLocal: false, isQueryLocal: false));
+ }
+ else if (state.InBlockContext)
+ {
+ await CreateConstantFieldActionsAsync(state, actions, cancellationToken).ConfigureAwait(false);
+
+ var blocks = this.GetContainingExecutableBlocks(state.Expression);
+ var block = blocks.FirstOrDefault();
+
+ if (!BlockOverlapsHiddenPosition(block, cancellationToken))
+ {
+ actions.Add(CreateAction(state, allOccurrences: false, isConstant: state.IsConstant, isLocal: true, isQueryLocal: false));
+
+ if (blocks.All(b => !BlockOverlapsHiddenPosition(b, cancellationToken)))
+ {
+ actions.Add(CreateAction(state, allOccurrences: true, isConstant: state.IsConstant, isLocal: true, isQueryLocal: false));
+ }
+ }
+ }
+ else if (state.InExpressionBodiedMemberContext)
+ {
+ await CreateConstantFieldActionsAsync(state, actions, cancellationToken).ConfigureAwait(false);
+ actions.Add(CreateAction(state, allOccurrences: false, isConstant: state.IsConstant, isLocal: true, isQueryLocal: false));
+ actions.Add(CreateAction(state, allOccurrences: true, isConstant: state.IsConstant, isLocal: true, isQueryLocal: false));
+ }
+
+ return actions;
+ }
+
+ private async Task CreateConstantFieldActionsAsync(State state, List<CodeAction> actions, CancellationToken cancellationToken)
+ {
+ if (state.IsConstant &&
+ !state.GetSemanticMap(cancellationToken).AllReferencedSymbols.OfType<ILocalSymbol>().Any() &&
+ !state.GetSemanticMap(cancellationToken).AllReferencedSymbols.OfType<IParameterSymbol>().Any())
+ {
+ // If something is a constant, and it doesn't access any other locals constants,
+ // then we prefer to offer to generate a constant field instead of a constant
+ // local.
+ var action1 = CreateAction(state, allOccurrences: false, isConstant: true, isLocal: false, isQueryLocal: false);
+ if (await CanGenerateIntoContainerAsync(state, action1, cancellationToken).ConfigureAwait(false))
+ {
+ actions.Add(action1);
+ }
+
+ var action2 = CreateAction(state, allOccurrences: true, isConstant: true, isLocal: false, isQueryLocal: false);
+ if (await CanGenerateIntoContainerAsync(state, action2, cancellationToken).ConfigureAwait(false))
+ {
+ actions.Add(action2);
+ }
+ }
+ }
+
+ private async Task<bool> CanGenerateIntoContainerAsync(State state, CodeAction action, CancellationToken cancellationToken)
+ {
+ var result = await this.IntroduceFieldAsync(
+ state.Document, state.Expression,
+ allOccurrences: false, isConstant: state.IsConstant, cancellationToken: cancellationToken).ConfigureAwait(false);
+
+ SyntaxNode destination = result.Item2;
+ int insertionIndex = result.Item3;
+
+ if (!destination.OverlapsHiddenPosition(cancellationToken))
+ {
+ return true;
+ }
+
+ if (destination is TTypeDeclarationSyntax)
+ {
+ var insertionIndices = this.GetInsertionIndices((TTypeDeclarationSyntax)destination, cancellationToken);
+ if (insertionIndices != null &&
+ insertionIndices.Count > insertionIndex &&
+ insertionIndices[insertionIndex])
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private CodeAction CreateAction(State state, bool allOccurrences, bool isConstant, bool isLocal, bool isQueryLocal)
+ {
+ if (allOccurrences)
+ {
+ return new IntroduceVariableAllOccurrenceCodeAction((TService)this, state.Document, state.Expression, allOccurrences, isConstant, isLocal, isQueryLocal);
+ }
+
+ return new IntroduceVariableCodeAction((TService)this, state.Document, state.Expression, allOccurrences, isConstant, isLocal, isQueryLocal);
+ }
+
+ protected static SyntaxToken GenerateUniqueFieldName(
+ SemanticDocument document,
+ TExpressionSyntax expression,
+ bool isConstant,
+ CancellationToken cancellationToken)
+ {
+ var semanticModel = document.SemanticModel;
+ var baseName = semanticModel.GenerateNameForExpression(expression, isConstant);
+
+ // A field can't conflict with any existing member names.
+ var declaringType = semanticModel.GetEnclosingNamedType(expression.SpanStart, cancellationToken);
+ var reservedNames = declaringType.GetMembers().Select(m => m.Name);
+
+ return NameGenerator.EnsureUniqueness(baseName, reservedNames, true).ToIdentifierToken();
+ }
+
+ protected static SyntaxToken GenerateUniqueLocalName(
+ SemanticDocument document,
+ TExpressionSyntax expression,
+ bool isConstant,
+ CancellationToken cancellationToken)
+ {
+
+ var semanticModel = document.SemanticModel;
+ var baseName = semanticModel.GenerateNameForExpression(expression, capitalize: isConstant);
+ var reservedNames = semanticModel.LookupSymbols(expression.SpanStart).Select(s => s.Name);
+
+ return NameGenerator.EnsureUniqueness(baseName, reservedNames, true).ToIdentifierToken();
+ }
+
+ protected ISet<TExpressionSyntax> FindMatches(
+ SemanticDocument originalDocument,
+ TExpressionSyntax expressionInOriginal,
+ SemanticDocument currentDocument,
+ SyntaxNode withinNodeInCurrent,
+ bool allOccurrences,
+ CancellationToken cancellationToken)
+ {
+ var originalSemanticModel = originalDocument.SemanticModel;
+ var currentSemanticModel = currentDocument.SemanticModel;
+
+ var matches = from nodeInCurrent in withinNodeInCurrent.DescendantNodesAndSelf().OfType<TExpressionSyntax>()
+ where NodeMatchesExpression(originalSemanticModel, currentSemanticModel, expressionInOriginal, nodeInCurrent, allOccurrences, cancellationToken)
+ select nodeInCurrent;
+ return new HashSet<TExpressionSyntax>(matches.OfType<TExpressionSyntax>());
+ }
+
+ private bool NodeMatchesExpression(
+ SemanticModel originalSemanticModel,
+ SemanticModel currentSemanticModel,
+ TExpressionSyntax expressionInOriginal,
+ TExpressionSyntax nodeInCurrent,
+ bool allOccurrences,
+ CancellationToken cancellationToken)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ if (nodeInCurrent == expressionInOriginal)
+ {
+ return true;
+ }
+ else
+ {
+ if (allOccurrences &&
+ this.CanReplace(nodeInCurrent))
+ {
+ return SemanticEquivalence.AreSemanticallyEquivalent(
+ originalSemanticModel, currentSemanticModel, expressionInOriginal, nodeInCurrent);
+ }
+ }
+
+ return false;
+ }
+
+ protected TNode Rewrite<TNode>(
+ SemanticDocument originalDocument,
+ TExpressionSyntax expressionInOriginal,
+ TExpressionSyntax variableName,
+ SemanticDocument currentDocument,
+ TNode withinNodeInCurrent,
+ bool allOccurrences,
+ CancellationToken cancellationToken)
+ where TNode : SyntaxNode
+ {
+ var matches = FindMatches(originalDocument, expressionInOriginal, currentDocument, withinNodeInCurrent, allOccurrences, cancellationToken);
+
+ // Parenthesize the variable, and go and replace anything we find with it.
+ // NOTE: we do not want elastic trivia as we want to just replace the existing code
+ // as is, while preserving the trivia there. We do not want to update it.
+ var replacement = variableName.Parenthesize(includeElasticTrivia: false)
+ .WithAdditionalAnnotations(Formatter.Annotation);
+
+ return RewriteCore(withinNodeInCurrent, replacement, matches);
+ }
+
+ protected abstract TNode RewriteCore<TNode>(
+ TNode node,
+ SyntaxNode replacementNode,
+ ISet<TExpressionSyntax> matches)
+ where TNode : SyntaxNode;
+
+ protected static ITypeSymbol GetTypeSymbol(
+ SemanticDocument document,
+ TExpressionSyntax expression,
+ CancellationToken cancellationToken,
+ bool objectAsDefault = true)
+ {
+ var semanticModel = document.SemanticModel;
+ var typeInfo = semanticModel.GetTypeInfo(expression, cancellationToken);
+
+ if (typeInfo.Type != null)
+ {
+ return typeInfo.Type;
+ }
+
+ if (typeInfo.ConvertedType != null)
+ {
+ return typeInfo.ConvertedType;
+ }
+
+ if (objectAsDefault)
+ {
+ return semanticModel.Compilation.GetSpecialType(SpecialType.System_Object);
+ }
+
+ return null;
+ }
+
+ protected static IEnumerable<IParameterSymbol> GetAnonymousMethodParameters(
+ SemanticDocument document, TExpressionSyntax expression, CancellationToken cancellationToken)
+ {
+ var semanticModel = document.SemanticModel;
+ var semanticMap = semanticModel.GetSemanticMap(expression, cancellationToken);
+
+ var anonymousMethodParameters = semanticMap.AllReferencedSymbols
+ .OfType<IParameterSymbol>()
+ .Where(p => p.ContainingSymbol.IsAnonymousFunction());
+ return anonymousMethodParameters;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/CSharpIntroduceVariableService.Rewriter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/CSharpIntroduceVariableService.Rewriter.cs
new file mode 100644
index 0000000000..f72aaf5a12
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/CSharpIntroduceVariableService.Rewriter.cs
@@ -0,0 +1,61 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Simplification;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.IntroduceVariable
+{
+ partial class CSharpIntroduceVariableService
+ {
+ private class Rewriter : CSharpSyntaxRewriter
+ {
+ private readonly SyntaxAnnotation _replacementAnnotation = new SyntaxAnnotation ();
+ private readonly SyntaxNode _replacementNode;
+ private readonly ISet<ExpressionSyntax> _matches;
+
+ private Rewriter (SyntaxNode replacementNode, ISet<ExpressionSyntax> matches)
+ {
+ _replacementNode = replacementNode;
+ _matches = matches;
+ }
+
+ public override SyntaxNode Visit (SyntaxNode node)
+ {
+ var expression = node as ExpressionSyntax;
+ if (expression != null &&
+ _matches.Contains (expression)) {
+ return _replacementNode
+ .WithLeadingTrivia (expression.GetLeadingTrivia ())
+ .WithTrailingTrivia (expression.GetTrailingTrivia ())
+ .WithAdditionalAnnotations (_replacementAnnotation);
+ }
+
+ return base.Visit (node);
+ }
+
+ public override SyntaxNode VisitParenthesizedExpression (ParenthesizedExpressionSyntax node)
+ {
+ var newNode = base.VisitParenthesizedExpression (node);
+ if (node != newNode &&
+ newNode.IsKind (SyntaxKind.ParenthesizedExpression)) {
+ var parenthesizedExpression = (ParenthesizedExpressionSyntax)newNode;
+ var innerExpression = parenthesizedExpression.OpenParenToken.GetNextToken ().Parent;
+ if (innerExpression.HasAnnotation (_replacementAnnotation)) {
+ return newNode.WithAdditionalAnnotations (Simplifier.Annotation);
+ }
+ }
+
+ return newNode;
+ }
+
+ public static SyntaxNode Visit (SyntaxNode node, SyntaxNode replacementNode, ISet<ExpressionSyntax> matches)
+ {
+ return new Rewriter (replacementNode, matches).Visit ((SyntaxNode)node);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/CSharpIntroduceVariableService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/CSharpIntroduceVariableService.cs
new file mode 100644
index 0000000000..f049393d89
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/CSharpIntroduceVariableService.cs
@@ -0,0 +1,131 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Composition;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.IntroduceVariable
+ {
+ partial class CSharpIntroduceVariableService :
+ AbstractIntroduceVariableService<CSharpIntroduceVariableService, ExpressionSyntax, TypeSyntax, TypeDeclarationSyntax, QueryExpressionSyntax>
+ {
+ protected override bool IsInNonFirstQueryClause(ExpressionSyntax expression)
+ {
+ var query = expression.GetAncestor<QueryExpressionSyntax>();
+ if (query != null)
+ {
+ // Can't introduce for the first clause in a query.
+ var fromClause = expression.GetAncestor<FromClauseSyntax>();
+ if (fromClause == null || query.FromClause != fromClause)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ protected override bool IsInFieldInitializer(ExpressionSyntax expression)
+ {
+ return expression.GetAncestorOrThis<VariableDeclaratorSyntax>()
+ .GetAncestorOrThis<FieldDeclarationSyntax>() != null;
+ }
+
+ protected override bool IsInParameterInitializer(ExpressionSyntax expression)
+ {
+ return expression.GetAncestorOrThis<EqualsValueClauseSyntax>().IsParentKind(SyntaxKind.Parameter);
+ }
+
+ protected override bool IsInConstructorInitializer(ExpressionSyntax expression)
+ {
+ return expression.GetAncestorOrThis<ConstructorInitializerSyntax>() != null;
+ }
+
+ protected override bool IsInExpressionBodiedMember(ExpressionSyntax expression)
+ {
+ // walk up until we find a nearest enclosing block or arrow expression.
+ for (SyntaxNode node = expression; node != null; node = node.GetParent())
+ {
+ // If we are in an expression bodied member and if the expression has a block body, then,
+ // act as if we're in a block context and not in an expression body context at all.
+ if (node.IsKind(SyntaxKind.Block))
+ {
+ return false;
+ }
+ else if (node.IsKind(SyntaxKind.ArrowExpressionClause))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ protected override bool IsInAttributeArgumentInitializer(ExpressionSyntax expression)
+ {
+ // Don't call the base here. We want to let the user extract a constant if they've
+ // said "Foo(a = 10)"
+ var attributeArgument = expression.GetAncestorOrThis<AttributeArgumentSyntax>();
+ if (attributeArgument != null)
+ {
+ // Can't extract an attribute initializer if it contains an array initializer of any
+ // sort. Also, we can't extract if there's any typeof expression within it.
+ if (!expression.DepthFirstTraversal().Any(n => n.RawKind == (int)SyntaxKind.ArrayCreationExpression) &&
+ !expression.DepthFirstTraversal().Any(n => n.RawKind == (int)SyntaxKind.TypeOfExpression))
+ {
+ var attributeDecl = attributeArgument.GetAncestorOrThis<AttributeListSyntax>();
+
+ // Also can't extract an attribute initializer if the attribute is a global one.
+ if (!attributeDecl.IsParentKind(SyntaxKind.CompilationUnit))
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ protected override bool CanIntroduceVariableFor(ExpressionSyntax expression)
+ {
+ if (expression.WalkUpParentheses().IsParentKind(SyntaxKind.ExpressionStatement))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ protected override IEnumerable<SyntaxNode> GetContainingExecutableBlocks(ExpressionSyntax expression)
+ {
+ return expression.GetAncestorsOrThis<BlockSyntax>();
+ }
+
+ protected override IList<bool> GetInsertionIndices(TypeDeclarationSyntax destination, CancellationToken cancellationToken)
+ {
+ return destination.GetInsertionIndices(cancellationToken);
+ }
+
+ protected override bool CanReplace(ExpressionSyntax expression)
+ {
+ return true;
+ }
+
+ protected override TNode RewriteCore<TNode>(
+ TNode node,
+ SyntaxNode replacementNode,
+ ISet<ExpressionSyntax> matches)
+ {
+ return (TNode)Rewriter.Visit(node, replacementNode, matches);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/CSharpIntroduceVariableService_IntroduceField.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/CSharpIntroduceVariableService_IntroduceField.cs
new file mode 100644
index 0000000000..6e4c8a22a5
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/CSharpIntroduceVariableService_IntroduceField.cs
@@ -0,0 +1,199 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Simplification;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.IntroduceVariable
+{
+ partial class CSharpIntroduceVariableService
+ {
+ protected override Task<Tuple<Document, SyntaxNode, int>> IntroduceFieldAsync(
+ SemanticDocument document,
+ ExpressionSyntax expression,
+ bool allOccurrences,
+ bool isConstant,
+ CancellationToken cancellationToken)
+ {
+ var oldTypeDeclaration = expression.GetAncestorOrThis<TypeDeclarationSyntax>();
+
+ var oldType = oldTypeDeclaration != null
+ ? document.SemanticModel.GetDeclaredSymbol(oldTypeDeclaration, cancellationToken) as INamedTypeSymbol
+ : document.SemanticModel.Compilation.ScriptClass;
+ var newNameToken = (SyntaxToken)GenerateUniqueFieldName(document, expression, isConstant, cancellationToken);
+
+ var newQualifiedName = oldTypeDeclaration != null
+ ? SyntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, SyntaxFactory.ParseName(oldType.ToDisplayString (Ambience.NameFormat)), SyntaxFactory.IdentifierName(newNameToken))
+ : (ExpressionSyntax)SyntaxFactory.IdentifierName(newNameToken);
+
+ newQualifiedName = newQualifiedName.WithAdditionalAnnotations(Simplifier.Annotation);
+
+ var newFieldDeclaration = SyntaxFactory.FieldDeclaration(
+ default(SyntaxList<AttributeListSyntax>),
+ MakeFieldModifiers(isConstant, inScript: oldType.IsScriptClass),
+ SyntaxFactory.VariableDeclaration(
+ GetTypeSymbol(document, expression, cancellationToken).GenerateTypeSyntax(),
+ SyntaxFactory.SingletonSeparatedList(
+ SyntaxFactory.VariableDeclarator(
+ newNameToken.WithAdditionalAnnotations(RenameAnnotation.Create()),
+ null,
+ SyntaxFactory.EqualsValueClause(expression))))).WithAdditionalAnnotations(Formatter.Annotation);
+
+ if (oldTypeDeclaration != null)
+ {
+ var newTypeDeclaration = Rewrite(
+ document, expression, newQualifiedName, document, oldTypeDeclaration, allOccurrences, cancellationToken);
+
+ var insertionIndex = isConstant ?
+ DetermineConstantInsertPosition(oldTypeDeclaration.Members, newTypeDeclaration.Members) :
+ DetermineFieldInsertPosition(oldTypeDeclaration.Members, newTypeDeclaration.Members);
+
+ var finalTypeDeclaration = InsertMember(newTypeDeclaration, newFieldDeclaration, insertionIndex);
+
+ SyntaxNode destination = oldTypeDeclaration;
+ var newRoot = document.Root.ReplaceNode(oldTypeDeclaration, finalTypeDeclaration);
+ return Task.FromResult(Tuple.Create(document.Document.WithSyntaxRoot(newRoot), destination, insertionIndex));
+ }
+ else
+ {
+ var oldCompilationUnit = (CompilationUnitSyntax)document.Root;
+ var newCompilationUnit = Rewrite(
+ document, expression, newQualifiedName, document, oldCompilationUnit, allOccurrences, cancellationToken);
+
+ var insertionIndex = isConstant ?
+ DetermineConstantInsertPosition(oldCompilationUnit.Members, newCompilationUnit.Members) :
+ DetermineFieldInsertPosition(oldCompilationUnit.Members, newCompilationUnit.Members);
+
+ SyntaxNode destination = oldCompilationUnit;
+ var newRoot = newCompilationUnit.WithMembers(newCompilationUnit.Members.Insert(insertionIndex, newFieldDeclaration));
+ return Task.FromResult(Tuple.Create(document.Document.WithSyntaxRoot(newRoot), destination, insertionIndex));
+ }
+ }
+
+ protected static int DetermineConstantInsertPosition(
+ SyntaxList<MemberDeclarationSyntax> oldMembers,
+ SyntaxList<MemberDeclarationSyntax> newMembers)
+ {
+ // 1) Place the constant after the last constant.
+ //
+ // 2) If there is no constant, place it before the first field
+ //
+ // 3) If the first change is before either of those, then place before the first
+ // change
+ //
+ // 4) Otherwise, place it at the start.
+ var index = 0;
+ var lastConstantIndex = oldMembers.LastIndexOf(IsConstantField);
+
+ if (lastConstantIndex >= 0)
+ {
+ index = lastConstantIndex + 1;
+ }
+ else
+ {
+ var firstFieldIndex = oldMembers.IndexOf(member => member is FieldDeclarationSyntax);
+ if (firstFieldIndex >= 0)
+ {
+ index = firstFieldIndex;
+ }
+ }
+
+ var firstChangeIndex = DetermineFirstChange(oldMembers, newMembers);
+ if (firstChangeIndex >= 0)
+ {
+ index = Math.Min(index, firstChangeIndex);
+ }
+
+ return index;
+ }
+
+ protected static int DetermineFieldInsertPosition(
+ SyntaxList<MemberDeclarationSyntax> oldMembers,
+ SyntaxList<MemberDeclarationSyntax> newMembers)
+ {
+ // 1) Place the constant after the last field.
+ //
+ // 2) If there is no field, place it after the last constant
+ //
+ // 3) If the first change is before either of those, then place before the first
+ // change
+ //
+ // 4) Otherwise, place it at the start.
+ var index = 0;
+ var lastFieldIndex = oldMembers.LastIndexOf(member => member is FieldDeclarationSyntax);
+ if (lastFieldIndex >= 0)
+ {
+ index = lastFieldIndex + 1;
+ }
+ else
+ {
+ var lastConstantIndex = oldMembers.LastIndexOf(IsConstantField);
+ if (lastConstantIndex >= 0)
+ {
+ index = lastConstantIndex + 1;
+ }
+ }
+
+ var firstChangeIndex = DetermineFirstChange(oldMembers, newMembers);
+ if (firstChangeIndex >= 0)
+ {
+ index = Math.Min(index, firstChangeIndex);
+ }
+
+ return index;
+ }
+
+ private static bool IsConstantField(MemberDeclarationSyntax member)
+ {
+ var field = member as FieldDeclarationSyntax;
+ return field != null && field.Modifiers.Any(SyntaxKind.ConstKeyword);
+ }
+
+ protected static int DetermineFirstChange(SyntaxList<MemberDeclarationSyntax> oldMembers, SyntaxList<MemberDeclarationSyntax> newMembers)
+ {
+ for (int i = 0; i < oldMembers.Count; i++)
+ {
+ if (!SyntaxFactory.AreEquivalent(oldMembers[i], newMembers[i], topLevel: false))
+ {
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ protected static TypeDeclarationSyntax InsertMember(
+ TypeDeclarationSyntax typeDeclaration,
+ MemberDeclarationSyntax memberDeclaration,
+ int index)
+ {
+ return typeDeclaration.WithMembers(
+ typeDeclaration.Members.Insert(index, memberDeclaration));
+ }
+
+ private SyntaxTokenList MakeFieldModifiers(bool isConstant, bool inScript)
+ {
+ if (isConstant)
+ {
+ return SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PrivateKeyword), SyntaxFactory.Token(SyntaxKind.ConstKeyword));
+ }
+ else if (inScript)
+ {
+ return SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PrivateKeyword), SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword));
+ }
+ else
+ {
+ return SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PrivateKeyword), SyntaxFactory.Token(SyntaxKind.StaticKeyword), SyntaxFactory.Token(SyntaxKind.ReadOnlyKeyword));
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/CSharpIntroduceVariableService_IntroduceLocal.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/CSharpIntroduceVariableService_IntroduceLocal.cs
new file mode 100644
index 0000000000..5bcb949f9e
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/CSharpIntroduceVariableService_IntroduceLocal.cs
@@ -0,0 +1,378 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Simplification;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.IntroduceVariable
+{
+ partial class CSharpIntroduceVariableService
+ {
+ protected override Task<Document> IntroduceLocalAsync(
+ SemanticDocument document,
+ ExpressionSyntax expression,
+ bool allOccurrences,
+ bool isConstant,
+ CancellationToken cancellationToken)
+ {
+ var options = document.Project.Solution.Workspace.Options;
+
+ var newLocalNameToken = (SyntaxToken)GenerateUniqueLocalName(document, expression, isConstant, cancellationToken);
+ var newLocalName = SyntaxFactory.IdentifierName(newLocalNameToken);
+
+ var modifiers = isConstant
+ ? SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.ConstKeyword))
+ : default(SyntaxTokenList);
+
+ var declarationStatement = SyntaxFactory.LocalDeclarationStatement(
+ modifiers,
+ SyntaxFactory.VariableDeclaration(
+ this.GetTypeSyntax(document, expression, isConstant, options, cancellationToken),
+ SyntaxFactory.SingletonSeparatedList(SyntaxFactory.VariableDeclarator(
+ newLocalNameToken.WithAdditionalAnnotations(RenameAnnotation.Create()),
+ null,
+ SyntaxFactory.EqualsValueClause(expression.WithoutTrailingTrivia().WithoutLeadingTrivia())))));
+
+ var anonymousMethodParameters = GetAnonymousMethodParameters(document, expression, cancellationToken);
+ var lambdas = anonymousMethodParameters.SelectMany(p => p.ContainingSymbol.DeclaringSyntaxReferences.Select(r => r.GetSyntax(cancellationToken)).AsEnumerable())
+ .Where(n => n is ParenthesizedLambdaExpressionSyntax || n is SimpleLambdaExpressionSyntax)
+ .ToSet();
+
+ var parentLambda = GetParentLambda(expression, lambdas);
+
+ if (parentLambda != null)
+ {
+ return Task.FromResult(IntroduceLocalDeclarationIntoLambda(
+ document, expression, newLocalName, declarationStatement, parentLambda, allOccurrences, cancellationToken));
+ }
+ else if (IsInExpressionBodiedMember(expression))
+ {
+ return Task.FromResult(RewriteExpressionBodiedMemberAndIntroduceLocalDeclaration(
+ document, expression, newLocalName, declarationStatement, allOccurrences, cancellationToken));
+ }
+ else
+ {
+ return IntroduceLocalDeclarationIntoBlockAsync(
+ document, expression, newLocalName, declarationStatement, allOccurrences, cancellationToken);
+ }
+ }
+
+ private Document IntroduceLocalDeclarationIntoLambda(
+ SemanticDocument document,
+ ExpressionSyntax expression,
+ IdentifierNameSyntax newLocalName,
+ LocalDeclarationStatementSyntax declarationStatement,
+ SyntaxNode oldLambda,
+ bool allOccurrences,
+ CancellationToken cancellationToken)
+ {
+ var oldBody = oldLambda is ParenthesizedLambdaExpressionSyntax
+ ? (ExpressionSyntax)((ParenthesizedLambdaExpressionSyntax)oldLambda).Body
+ : (ExpressionSyntax)((SimpleLambdaExpressionSyntax)oldLambda).Body;
+
+ var rewrittenBody = Rewrite(
+ document, expression, newLocalName, document, oldBody, allOccurrences, cancellationToken);
+
+ var delegateType = document.SemanticModel.GetTypeInfo(oldLambda, cancellationToken).ConvertedType as INamedTypeSymbol;
+
+ var newBody = delegateType != null && delegateType.DelegateInvokeMethod != null && delegateType.DelegateInvokeMethod.ReturnsVoid
+ ? SyntaxFactory.Block(declarationStatement)
+ : SyntaxFactory.Block(declarationStatement, SyntaxFactory.ReturnStatement(rewrittenBody));
+
+ newBody = newBody.WithAdditionalAnnotations(Formatter.Annotation);
+
+ var newLambda = oldLambda is ParenthesizedLambdaExpressionSyntax
+ ? ((ParenthesizedLambdaExpressionSyntax)oldLambda).WithBody(newBody)
+ : (SyntaxNode)((SimpleLambdaExpressionSyntax)oldLambda).WithBody(newBody);
+
+ var newRoot = document.Root.ReplaceNode(oldLambda, newLambda);
+ return document.Document.WithSyntaxRoot(newRoot);
+ }
+
+ private SyntaxNode GetParentLambda(ExpressionSyntax expression, ISet<SyntaxNode> lambdas)
+ {
+ var current = expression;
+ while (current != null)
+ {
+ if (lambdas.Contains(current.Parent))
+ {
+ return current.Parent;
+ }
+
+ current = current.Parent as ExpressionSyntax;
+ }
+
+ return null;
+ }
+
+ private TypeSyntax GetTypeSyntax(SemanticDocument document, ExpressionSyntax expression, bool isConstant, OptionSet options, CancellationToken cancellationToken)
+ {
+ var typeSymbol = GetTypeSymbol(document, expression, cancellationToken);
+ if (typeSymbol.ContainsAnonymousType())
+ {
+ return SyntaxFactory.IdentifierName("var");
+ }
+
+ if (!isConstant && true /*options.GetOption(CSharpCodeStyleOptions.UseVarWhenDeclaringLocals) */&& CanUseVar(typeSymbol))
+ {
+ return SyntaxFactory.IdentifierName("var");
+ }
+
+ return typeSymbol.GenerateTypeSyntax();
+ }
+
+ private bool CanUseVar(ITypeSymbol typeSymbol)
+ {
+ return typeSymbol.TypeKind != TypeKind.Delegate && !typeSymbol.IsErrorType();
+ }
+
+ private static async Task<Tuple<SemanticDocument, ISet<ExpressionSyntax>>> ComplexifyParentingStatements(
+ SemanticDocument semanticDocument,
+ ISet<ExpressionSyntax> matches,
+ CancellationToken cancellationToken)
+ {
+ // First, track the matches so that we can get back to them later.
+ var newRoot = semanticDocument.Root.TrackNodes(matches);
+ var newDocument = semanticDocument.Document.WithSyntaxRoot(newRoot);
+ var newSemanticDocument = await SemanticDocument.CreateAsync(newDocument, cancellationToken).ConfigureAwait(false);
+ var newMatches = newSemanticDocument.Root.GetCurrentNodes(matches.AsEnumerable()).ToSet();
+
+ // Next, expand the topmost parenting expression of each match, being careful
+ // not to expand the matches themselves.
+ var topMostExpressions = newMatches
+ .Select(m => m.AncestorsAndSelf().OfType<ExpressionSyntax>().Last())
+ .Distinct();
+
+ newRoot = await newSemanticDocument.Root
+ .ReplaceNodesAsync(
+ topMostExpressions,
+ computeReplacementAsync: async (oldNode, newNode, ct) =>
+ {
+ return await Simplifier
+ .ExpandAsync(
+ oldNode,
+ newSemanticDocument.Document,
+ expandInsideNode: node =>
+ {
+ var expression = node as ExpressionSyntax;
+ return expression == null
+ || !newMatches.Contains(expression);
+ },
+ cancellationToken: ct)
+ .ConfigureAwait(false);
+ },
+ cancellationToken: cancellationToken)
+ .ConfigureAwait(false);
+
+ newDocument = newSemanticDocument.Document.WithSyntaxRoot(newRoot);
+ newSemanticDocument = await SemanticDocument.CreateAsync(newDocument, cancellationToken).ConfigureAwait(false);
+ newMatches = newSemanticDocument.Root.GetCurrentNodes(matches.AsEnumerable()).ToSet();
+
+ return Tuple.Create(newSemanticDocument, newMatches);
+ }
+
+ private Document RewriteExpressionBodiedMemberAndIntroduceLocalDeclaration(
+ SemanticDocument document,
+ ExpressionSyntax expression,
+ NameSyntax newLocalName,
+ LocalDeclarationStatementSyntax declarationStatement,
+ bool allOccurrences,
+ CancellationToken cancellationToken)
+ {
+ var oldBody = expression.GetAncestorOrThis<ArrowExpressionClauseSyntax>();
+ var oldParentingNode = oldBody.Parent;
+ var leadingTrivia = oldBody.GetLeadingTrivia()
+ .AddRange(oldBody.ArrowToken.TrailingTrivia);
+
+ var newStatement = Rewrite(document, expression, newLocalName, document, oldBody.Expression, allOccurrences, cancellationToken);
+ var newBody = SyntaxFactory.Block(declarationStatement, SyntaxFactory.ReturnStatement(newStatement))
+ .WithLeadingTrivia(leadingTrivia)
+ .WithTrailingTrivia(oldBody.GetTrailingTrivia())
+ .WithAdditionalAnnotations(Formatter.Annotation);
+
+ SyntaxNode newParentingNode = null;
+ if (oldParentingNode is BasePropertyDeclarationSyntax)
+ {
+ var getAccessor = SyntaxFactory.AccessorDeclaration(SyntaxKind.GetAccessorDeclaration, newBody);
+ var accessorList = SyntaxFactory.AccessorList(SyntaxFactory.List(new[] { getAccessor }));
+
+ newParentingNode = ((BasePropertyDeclarationSyntax)oldParentingNode).RemoveNode(oldBody, SyntaxRemoveOptions.KeepNoTrivia);
+
+ if (newParentingNode.IsKind(SyntaxKind.PropertyDeclaration))
+ {
+ var propertyDeclaration = ((PropertyDeclarationSyntax)newParentingNode);
+ newParentingNode = propertyDeclaration
+ .WithAccessorList(accessorList)
+ .WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.None))
+ .WithTrailingTrivia(propertyDeclaration.SemicolonToken.TrailingTrivia);
+ }
+ else if (newParentingNode.IsKind(SyntaxKind.IndexerDeclaration))
+ {
+ var indexerDeclaration = ((IndexerDeclarationSyntax)newParentingNode);
+ newParentingNode = indexerDeclaration
+ .WithAccessorList(accessorList)
+ .WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.None))
+ .WithTrailingTrivia(indexerDeclaration.SemicolonToken.TrailingTrivia);
+ }
+ }
+ else if (oldParentingNode is BaseMethodDeclarationSyntax)
+ {
+ newParentingNode = ((BaseMethodDeclarationSyntax)oldParentingNode)
+ .RemoveNode(oldBody, SyntaxRemoveOptions.KeepNoTrivia)
+ .WithBody(newBody);
+
+ if (newParentingNode.IsKind(SyntaxKind.MethodDeclaration))
+ {
+ var methodDeclaration = ((MethodDeclarationSyntax)newParentingNode);
+ newParentingNode = methodDeclaration
+ .WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.None))
+ .WithTrailingTrivia(methodDeclaration.SemicolonToken.TrailingTrivia);
+ }
+ else if (newParentingNode.IsKind(SyntaxKind.OperatorDeclaration))
+ {
+ var operatorDeclaration = ((OperatorDeclarationSyntax)newParentingNode);
+ newParentingNode = operatorDeclaration
+ .WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.None))
+ .WithTrailingTrivia(operatorDeclaration.SemicolonToken.TrailingTrivia);
+ }
+ else if (newParentingNode.IsKind(SyntaxKind.ConversionOperatorDeclaration))
+ {
+ var conversionOperatorDeclaration = ((ConversionOperatorDeclarationSyntax)newParentingNode);
+ newParentingNode = conversionOperatorDeclaration
+ .WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.None))
+ .WithTrailingTrivia(conversionOperatorDeclaration.SemicolonToken.TrailingTrivia);
+ }
+ }
+
+ var newRoot = document.Root.ReplaceNode(oldParentingNode, newParentingNode);
+ return document.Document.WithSyntaxRoot(newRoot);
+ }
+
+ private async Task<Document> IntroduceLocalDeclarationIntoBlockAsync(
+ SemanticDocument document,
+ ExpressionSyntax expression,
+ NameSyntax newLocalName,
+ LocalDeclarationStatementSyntax declarationStatement,
+ bool allOccurrences,
+ CancellationToken cancellationToken)
+ {
+ declarationStatement = declarationStatement.WithAdditionalAnnotations(Formatter.Annotation);
+
+ var oldOutermostBlock = expression.GetAncestorsOrThis<BlockSyntax>().LastOrDefault();
+ var matches = FindMatches(document, expression, document, oldOutermostBlock, allOccurrences, cancellationToken);
+ Debug.Assert(matches.Contains(expression));
+
+ var complexified = await ComplexifyParentingStatements(document, matches, cancellationToken).ConfigureAwait(false);
+ document = complexified.Item1;
+ matches = complexified.Item2;
+
+ // Our original expression should have been one of the matches, which were tracked as part
+ // of complexification, so we can retrieve the latest version of the expression here.
+ expression = document.Root.GetCurrentNodes(expression).First();
+
+ var innermostStatements = new HashSet<StatementSyntax>(
+ matches.Select(expr => expr.GetAncestorOrThis<StatementSyntax>()));
+
+ if (innermostStatements.Count == 1)
+ {
+ // If there was only one match, or all the matches came from the same
+ // statement, then we want to place the declaration right above that
+ // statement. Note: we special case this because the statement we are going
+ // to go above might not be in a block and we may have to generate it
+ return IntroduceLocalForSingleOccurrenceIntoBlock(
+ document, expression, newLocalName, declarationStatement, allOccurrences, cancellationToken);
+ }
+
+ var oldInnerMostCommonBlock = matches.FindInnermostCommonBlock();
+ var allAffectedStatements = new HashSet<StatementSyntax>(matches.SelectMany(expr => expr.GetAncestorsOrThis<StatementSyntax>()));
+ var firstStatementAffectedInBlock = oldInnerMostCommonBlock.Statements.First(allAffectedStatements.Contains);
+
+ var firstStatementAffectedIndex = oldInnerMostCommonBlock.Statements.IndexOf(firstStatementAffectedInBlock);
+
+ var newInnerMostBlock = Rewrite(
+ document, expression, newLocalName, document, oldInnerMostCommonBlock, allOccurrences, cancellationToken);
+
+ var statements = new List<StatementSyntax>();
+ statements.AddRange(newInnerMostBlock.Statements.Take(firstStatementAffectedIndex));
+ statements.Add(declarationStatement);
+ statements.AddRange(newInnerMostBlock.Statements.Skip(firstStatementAffectedIndex));
+
+ var finalInnerMostBlock = newInnerMostBlock.WithStatements(
+ SyntaxFactory.List<StatementSyntax>(statements));
+
+ var newRoot = document.Root.ReplaceNode(oldInnerMostCommonBlock, finalInnerMostBlock);
+ return document.Document.WithSyntaxRoot(newRoot);
+ }
+
+ private Document IntroduceLocalForSingleOccurrenceIntoBlock(
+ SemanticDocument document,
+ ExpressionSyntax expression,
+ NameSyntax localName,
+ LocalDeclarationStatementSyntax localDeclaration,
+ bool allOccurrences,
+ CancellationToken cancellationToken)
+ {
+ var oldStatement = expression.GetAncestorOrThis<StatementSyntax>();
+ var newStatement = Rewrite(
+ document, expression, localName, document, oldStatement, allOccurrences, cancellationToken);
+
+ if (oldStatement.IsParentKind(SyntaxKind.Block))
+ {
+ var oldBlock = oldStatement.Parent as BlockSyntax;
+ var statementIndex = oldBlock.Statements.IndexOf(oldStatement);
+
+ var newBlock = oldBlock.WithStatements(CreateNewStatementList(
+ oldBlock.Statements, localDeclaration, newStatement, statementIndex));
+
+ var newRoot = document.Root.ReplaceNode(oldBlock, newBlock);
+ return document.Document.WithSyntaxRoot(newRoot);
+ }
+ else if (oldStatement.IsParentKind(SyntaxKind.SwitchSection))
+ {
+ var oldSwitchSection = oldStatement.Parent as SwitchSectionSyntax;
+ var statementIndex = oldSwitchSection.Statements.IndexOf(oldStatement);
+
+ var newSwitchSection = oldSwitchSection.WithStatements(CreateNewStatementList(
+ oldSwitchSection.Statements, localDeclaration, newStatement, statementIndex));
+
+ var newRoot = document.Root.ReplaceNode(oldSwitchSection, newSwitchSection);
+ return document.Document.WithSyntaxRoot(newRoot);
+ }
+ else
+ {
+ // we need to introduce a block to put the original statement, along with
+ // the statement we're generating
+ var newBlock = SyntaxFactory.Block(localDeclaration, newStatement).WithAdditionalAnnotations(Formatter.Annotation);
+
+ var newRoot = document.Root.ReplaceNode(oldStatement, newBlock);
+ return document.Document.WithSyntaxRoot(newRoot);
+ }
+ }
+
+ private static SyntaxList<StatementSyntax> CreateNewStatementList(
+ SyntaxList<StatementSyntax> oldStatements,
+ LocalDeclarationStatementSyntax localDeclaration,
+ StatementSyntax newStatement,
+ int statementIndex)
+ {
+ return oldStatements.Take(statementIndex)
+ .Concat(localDeclaration.WithLeadingTrivia(oldStatements.Skip(statementIndex).First().GetLeadingTrivia()))
+ .Concat(newStatement.WithoutLeadingTrivia())
+ .Concat(oldStatements.Skip(statementIndex + 1))
+ .ToSyntaxList();
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/CSharpIntroduceVariableService_IntroduceQueryLocal.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/CSharpIntroduceVariableService_IntroduceQueryLocal.cs
new file mode 100644
index 0000000000..79ff57296e
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/CSharpIntroduceVariableService_IntroduceQueryLocal.cs
@@ -0,0 +1,107 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.IntroduceVariable
+{
+ partial class CSharpIntroduceVariableService
+ {
+ private static bool IsAnyQueryClause(SyntaxNode node)
+ {
+ return node is QueryClauseSyntax || node is SelectOrGroupClauseSyntax;
+ }
+
+ protected override Task<Document> IntroduceQueryLocalAsync(
+ SemanticDocument document, ExpressionSyntax expression, bool allOccurrences, CancellationToken cancellationToken)
+ {
+ var newLocalNameToken = (SyntaxToken)GenerateUniqueLocalName(document, expression, isConstant: false, cancellationToken: cancellationToken);
+ var newLocalName = SyntaxFactory.IdentifierName(newLocalNameToken);
+
+ var letClause = SyntaxFactory.LetClause(
+ newLocalNameToken.WithAdditionalAnnotations(RenameAnnotation.Create()),
+ expression).WithAdditionalAnnotations(Formatter.Annotation);
+
+ var oldOutermostQuery = expression.GetAncestorsOrThis<QueryExpressionSyntax>().LastOrDefault();
+ var matches = FindMatches(document, expression, document, oldOutermostQuery, allOccurrences, cancellationToken);
+ var innermostClauses = new HashSet<SyntaxNode>(
+ matches.Select(expr => expr.GetAncestorsOrThis<SyntaxNode>().First(IsAnyQueryClause)));
+
+ if (innermostClauses.Count == 1)
+ {
+ // If there was only one match, or all the matches came from the same
+ // statement, hten we want to place the declaration right above that
+ // statement. Note: we special case this because the statement we are going
+ // to go above might not be in a block and we may have to generate it
+ return Task.FromResult(IntroduceQueryLocalForSingleOccurrence(
+ document, expression, newLocalName, letClause, allOccurrences, cancellationToken));
+ }
+
+ var oldInnerMostCommonQuery = matches.FindInnermostCommonNode<QueryExpressionSyntax>();
+ var newInnerMostQuery = Rewrite(
+ document, expression, newLocalName, document, oldInnerMostCommonQuery, allOccurrences, cancellationToken);
+
+ var allAffectedClauses = new HashSet<SyntaxNode>(matches.SelectMany(expr => expr.GetAncestorsOrThis<SyntaxNode>().Where(IsAnyQueryClause)));
+
+ var oldClauses = oldInnerMostCommonQuery.GetAllClauses();
+ var newClauses = newInnerMostQuery.GetAllClauses();
+
+ var firstClauseAffectedInQuery = oldClauses.First(allAffectedClauses.Contains);
+ var firstClauseAffectedIndex = oldClauses.IndexOf(firstClauseAffectedInQuery);
+
+ var finalClauses = newClauses.Take(firstClauseAffectedIndex)
+ .Concat(letClause)
+ .Concat(newClauses.Skip(firstClauseAffectedIndex)).ToList();
+
+ var finalQuery = newInnerMostQuery.WithAllClauses(finalClauses);
+ var newRoot = document.Root.ReplaceNode(oldInnerMostCommonQuery, finalQuery);
+
+ return Task.FromResult(document.Document.WithSyntaxRoot(newRoot));
+ }
+
+ private Document IntroduceQueryLocalForSingleOccurrence(
+ SemanticDocument document,
+ ExpressionSyntax expression,
+ NameSyntax newLocalName,
+ LetClauseSyntax letClause,
+ bool allOccurrences,
+ CancellationToken cancellationToken)
+ {
+ var oldClause = expression.GetAncestors<SyntaxNode>().First(IsAnyQueryClause);
+ var newClause = Rewrite(
+ document, expression, newLocalName, document, oldClause, allOccurrences, cancellationToken);
+
+ var oldQuery = (QueryBodySyntax)oldClause.Parent;
+ var newQuery = GetNewQuery(oldQuery, oldClause, newClause, letClause);
+
+ var newRoot = document.Root.ReplaceNode(oldQuery, newQuery);
+ return document.Document.WithSyntaxRoot(newRoot);
+ }
+
+ private static QueryBodySyntax GetNewQuery(
+ QueryBodySyntax oldQuery,
+ SyntaxNode oldClause,
+ SyntaxNode newClause,
+ LetClauseSyntax letClause)
+ {
+ var oldClauses = oldQuery.GetAllClauses();
+ var oldClauseIndex = oldClauses.IndexOf(oldClause);
+
+ var newClauses = oldClauses.Take(oldClauseIndex)
+ .Concat(letClause)
+ .Concat(newClause)
+ .Concat(oldClauses.Skip(oldClauseIndex + 1)).ToList();
+ return oldQuery.WithAllClauses(newClauses);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/IntroduceVariableResult.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/IntroduceVariableResult.cs
new file mode 100644
index 0000000000..3277daf9fe
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/IntroduceVariable/IntroduceVariableResult.cs
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using RefactoringEssentials;
+using Microsoft.CodeAnalysis.CodeRefactorings;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.IntroduceVariable
+{
+ class IntroduceVariableResult
+ {
+ public static readonly IntroduceVariableResult Failure = new IntroduceVariableResult(null);
+
+ private readonly CodeRefactoring _codeRefactoring;
+
+ public IntroduceVariableResult(CodeRefactoring codeRefactoring)
+ {
+ _codeRefactoring = codeRefactoring;
+ }
+
+ public bool ContainsChanges
+ {
+ get
+ {
+ return _codeRefactoring != null;
+ }
+ }
+
+ public CodeRefactoring GetCodeRefactoring(CancellationToken cancellationToken)
+ {
+ return _codeRefactoring;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/OrganizeImports/CSharpOrganizeImportsService.Rewriter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/OrganizeImports/CSharpOrganizeImportsService.Rewriter.cs
new file mode 100644
index 0000000000..003760e4bb
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/OrganizeImports/CSharpOrganizeImportsService.Rewriter.cs
@@ -0,0 +1,87 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.OrganizeImports
+{
+ partial class CSharpOrganizeImportsService
+ {
+ private class Rewriter : CSharpSyntaxRewriter
+ {
+ private readonly bool _placeSystemNamespaceFirst;
+ public readonly IList<TextChange> TextChanges = new List<TextChange>();
+
+ public Rewriter(bool placeSystemNamespaceFirst)
+ {
+ _placeSystemNamespaceFirst = placeSystemNamespaceFirst;
+ }
+
+ public override SyntaxNode VisitCompilationUnit(CompilationUnitSyntax node)
+ {
+ node = (CompilationUnitSyntax)base.VisitCompilationUnit(node);
+
+ SyntaxList<ExternAliasDirectiveSyntax> organizedExternAliasList;
+ SyntaxList<UsingDirectiveSyntax> organizedUsingList;
+ UsingsAndExternAliasesOrganizer.Organize(
+ node.Externs, node.Usings, _placeSystemNamespaceFirst,
+ out organizedExternAliasList, out organizedUsingList);
+
+ var result = node.WithExterns(organizedExternAliasList).WithUsings(organizedUsingList);
+ if (node != result)
+ {
+ AddTextChange(node.Externs, organizedExternAliasList);
+ AddTextChange(node.Usings, organizedUsingList);
+ }
+
+ return result;
+ }
+
+ public override SyntaxNode VisitNamespaceDeclaration(NamespaceDeclarationSyntax node)
+ {
+ node = (NamespaceDeclarationSyntax)base.VisitNamespaceDeclaration(node);
+
+ SyntaxList<ExternAliasDirectiveSyntax> organizedExternAliasList;
+ SyntaxList<UsingDirectiveSyntax> organizedUsingList;
+ UsingsAndExternAliasesOrganizer.Organize(
+ node.Externs, node.Usings, _placeSystemNamespaceFirst,
+ out organizedExternAliasList, out organizedUsingList);
+
+ var result = node.WithExterns(organizedExternAliasList).WithUsings(organizedUsingList);
+ if (node != result)
+ {
+ AddTextChange(node.Externs, organizedExternAliasList);
+ AddTextChange(node.Usings, organizedUsingList);
+ }
+
+ return result;
+ }
+
+ private void AddTextChange<TSyntax>(SyntaxList<TSyntax> list, SyntaxList<TSyntax> organizedList)
+ where TSyntax : SyntaxNode
+ {
+ if (list.Count > 0)
+ {
+ this.TextChanges.Add(new TextChange(GetTextSpan(list), GetNewText(organizedList)));
+ }
+ }
+
+ private string GetNewText<TSyntax>(SyntaxList<TSyntax> organizedList)
+ where TSyntax : SyntaxNode
+ {
+ return string.Join(string.Empty, organizedList.Select(t => t.ToFullString()));
+ }
+
+ private TextSpan GetTextSpan<TSyntax>(SyntaxList<TSyntax> list)
+ where TSyntax : SyntaxNode
+ {
+ return TextSpan.FromBounds(list.First().FullSpan.Start, list.Last().FullSpan.End);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/OrganizeImports/CSharpOrganizeImportsService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/OrganizeImports/CSharpOrganizeImportsService.cs
new file mode 100644
index 0000000000..67542be953
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/OrganizeImports/CSharpOrganizeImportsService.cs
@@ -0,0 +1,56 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Composition;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.OrganizeImports
+{
+ partial class CSharpOrganizeImportsService
+ {
+ public async Task<Document> OrganizeImportsAsync(Document document, bool placeSystemNamespaceFirst, CancellationToken cancellationToken)
+ {
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ var rewriter = new Rewriter(placeSystemNamespaceFirst);
+ var newRoot = rewriter.Visit(root);
+
+ return document.WithSyntaxRoot(newRoot);
+ }
+
+ public string OrganizeImportsDisplayStringWithAccelerator
+ {
+ get
+ {
+ return Resources.OrganizeUsingsWithAccelerator;
+ }
+ }
+
+ public string SortImportsDisplayStringWithAccelerator
+ {
+ get
+ {
+ return Resources.SortUsingsWithAccelerator;
+ }
+ }
+
+ public string RemoveUnusedImportsDisplayStringWithAccelerator
+ {
+ get
+ {
+ return Resources.RemoveUnnecessaryUsingsWithAccelerator;
+ }
+ }
+
+ public string SortAndRemoveUnusedImportsDisplayStringWithAccelerator
+ {
+ get
+ {
+ return Resources.RemoveAndSortUsingsWithAccelerator;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/IParameterHintingData.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/IParameterHintingData.cs
new file mode 100644
index 0000000000..30323490f1
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/IParameterHintingData.cs
@@ -0,0 +1,229 @@
+//
+// IParameterDataProvider.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis;
+using System.Collections.Immutable;
+using System.Linq;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ /// <summary>
+ /// Provides intellisense information for a collection of parametrized members.
+ /// </summary>
+ public interface IParameterHintingData
+ {
+ /// <summary>
+ /// Gets the symbol for which the parameter should be created.
+ /// </summary>
+ ISymbol Symbol {
+ get;
+ }
+
+ int ParameterCount {
+ get;
+ }
+
+ bool IsParameterListAllowed {
+ get;
+ }
+
+ string GetParameterName (int currentParameter);
+ }
+
+ class ParameterHintingData : IParameterHintingData
+ {
+ public ISymbol Symbol {
+ get;
+ private set;
+ }
+
+ public ParameterHintingData(IMethodSymbol symbol)
+ {
+ this.Symbol = symbol;
+ }
+
+ public ParameterHintingData(IPropertySymbol symbol)
+ {
+ this.Symbol = symbol;
+ }
+
+ static ImmutableArray<IParameterSymbol> GetParameterList (IParameterHintingData data)
+ {
+ var ms = data.Symbol as IMethodSymbol;
+ if (ms != null)
+ return ms.Parameters;
+
+ var ps = data.Symbol as IPropertySymbol;
+ if (ps != null)
+ return ps.Parameters;
+
+ return ImmutableArray<IParameterSymbol>.Empty;
+ }
+
+ public string GetParameterName (int currentParameter)
+ {
+ var list = GetParameterList (this);
+ if (currentParameter < 0 || currentParameter >= list.Length)
+ throw new ArgumentOutOfRangeException ("currentParameter");
+ return list [currentParameter].Name;
+ }
+
+ public int ParameterCount {
+ get {
+ return GetParameterList(this).Length;
+ }
+ }
+
+ public bool IsParameterListAllowed {
+ get {
+ var param = GetParameterList(this).LastOrDefault();
+ return param != null && param.IsParams;
+ }
+ }
+ }
+
+ class DelegateParameterHintingData : IParameterHintingData
+ {
+ readonly IMethodSymbol invocationMethod;
+
+ public ISymbol Symbol {
+ get;
+ private set;
+ }
+
+ public DelegateParameterHintingData(ITypeSymbol symbol)
+ {
+ this.Symbol = symbol;
+ this.invocationMethod = symbol.GetDelegateInvokeMethod();
+ }
+
+ public string GetParameterName (int currentParameter)
+ {
+ var list = invocationMethod.Parameters;
+ if (currentParameter < 0 || currentParameter >= list.Length)
+ throw new ArgumentOutOfRangeException ("currentParameter");
+ return list [currentParameter].Name;
+ }
+
+ public int ParameterCount {
+ get {
+ return invocationMethod.Parameters.Length;
+ }
+ }
+
+ public bool IsParameterListAllowed {
+ get {
+ var param = invocationMethod.Parameters.LastOrDefault();
+ return param != null && param.IsParams;
+ }
+ }
+ }
+
+ class ArrayParameterHintingData : IParameterHintingData
+ {
+ readonly IArrayTypeSymbol arrayType;
+
+ public ISymbol Symbol {
+ get {
+ return arrayType;
+ }
+ }
+
+ public ArrayParameterHintingData(IArrayTypeSymbol arrayType)
+ {
+ this.arrayType = arrayType;
+ }
+
+ public string GetParameterName (int currentParameter)
+ {
+ return null;
+ }
+
+ public int ParameterCount {
+ get {
+ return arrayType.Rank;
+ }
+ }
+
+ public bool IsParameterListAllowed {
+ get {
+ return false;
+ }
+ }
+ }
+
+ class TypeParameterHintingData : IParameterHintingData
+ {
+ public ISymbol Symbol {
+ get;
+ private set;
+ }
+
+ public TypeParameterHintingData(IMethodSymbol symbol)
+ {
+ this.Symbol = symbol;
+ }
+
+ public TypeParameterHintingData(INamedTypeSymbol symbol)
+ {
+ this.Symbol = symbol;
+ }
+
+ static ImmutableArray<ITypeParameterSymbol> GetTypeParameterList (IParameterHintingData data)
+ {
+ var ms = data.Symbol as IMethodSymbol;
+ if (ms != null)
+ return ms.TypeParameters;
+
+ var ps = data.Symbol as INamedTypeSymbol;
+ if (ps != null)
+ return ps.TypeParameters;
+
+ return ImmutableArray<ITypeParameterSymbol>.Empty;
+ }
+
+
+ public string GetParameterName (int currentParameter)
+ {
+ var list = GetTypeParameterList (this);
+ if (currentParameter < 0 || currentParameter >= list.Length)
+ throw new ArgumentOutOfRangeException ("currentParameter");
+ return list [currentParameter].Name;
+ }
+
+ public int ParameterCount {
+ get {
+ return GetTypeParameterList(this).Length;
+ }
+ }
+
+ public bool IsParameterListAllowed {
+ get {
+ return false;
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/IParameterHintingDataFactory.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/IParameterHintingDataFactory.cs
new file mode 100644
index 0000000000..4995e19c3c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/IParameterHintingDataFactory.cs
@@ -0,0 +1,47 @@
+//
+// IParameterCopmletionFactory.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ public interface IParameterHintingDataFactory
+ {
+ IParameterHintingData CreateConstructorProvider (IMethodSymbol constructor);
+
+ IParameterHintingData CreateMethodDataProvider (IMethodSymbol method);
+
+ IParameterHintingData CreateDelegateDataProvider (ITypeSymbol delegateType);
+
+ IParameterHintingData CreateIndexerParameterDataProvider (IPropertySymbol indexer, SyntaxNode resolvedNode);
+
+ IParameterHintingData CreateArrayDataProvider (IArrayTypeSymbol arrayType);
+
+ IParameterHintingData CreateTypeParameterDataProvider (INamedTypeSymbol type);
+
+ IParameterHintingData CreateTypeParameterDataProvider (IMethodSymbol method);
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/ParameterHintingEngine.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/ParameterHintingEngine.cs
new file mode 100644
index 0000000000..0dff09ee36
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/ParameterHintingEngine.cs
@@ -0,0 +1,332 @@
+//
+// CSharpParameterCompletionEngine.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using System.Threading;
+using System.CodeDom;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+using System.Threading.Tasks;
+using MonoDevelop.Ide.TypeSystem;
+using System.Security.Cryptography;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class ParameterHintingEngine
+ {
+ readonly IParameterHintingDataFactory factory;
+ readonly Workspace workspace;
+
+ public ParameterHintingEngine(Workspace workspace, IParameterHintingDataFactory factory)
+ {
+ if (workspace == null)
+ throw new ArgumentNullException("workspace");
+ if (factory == null)
+ throw new ArgumentNullException("factory");
+ this.workspace = workspace;
+ this.factory = factory;
+ }
+
+ public Task<ParameterHintingResult> GetParameterDataProviderAsync (Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken = default (CancellationToken))
+ {
+ return InternalGetParameterDataProviderAsync (document, semanticModel, position, cancellationToken, 0);
+ }
+
+ public async Task<ParameterHintingResult> InternalGetParameterDataProviderAsync (Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken, int recCount)
+ {
+ if (position == 0 || recCount > 1)
+ return ParameterHintingResult.Empty;
+ var tree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
+ var tokenLeftOfPosition = tree.FindTokenOnLeftOfPosition (position, cancellationToken);
+ if (tokenLeftOfPosition.IsKind (SyntaxKind.LessThanToken)) {
+ var startToken = tokenLeftOfPosition.GetPreviousToken();
+ return HandleTypeParameterCase(semanticModel, startToken.Parent, cancellationToken);
+ }
+
+ var context = SyntaxContext.Create(workspace, document, semanticModel, position, cancellationToken);
+ var targetParent = context.TargetToken.Parent;
+ if (targetParent == null)
+ return ParameterHintingResult.Empty;
+
+ if (context.TargetToken.IsKind (SyntaxKind.IdentifierName)) {
+ targetParent = targetParent.Parent;
+ }
+
+ if (context.TargetToken.IsKind (SyntaxKind.CloseParenToken) || context.TargetToken.IsKind (SyntaxKind.CloseBracketToken) || context.TargetToken.IsKind (SyntaxKind.GreaterThanToken))
+ targetParent = targetParent.Parent;
+ if (targetParent == null)
+ return ParameterHintingResult.Empty;
+ var node = targetParent.Parent;
+
+ // case: identifier<arg1,|
+ if (node == null) {
+ if (context.LeftToken.Kind() == SyntaxKind.CommaToken) {
+ targetParent = context.LeftToken.GetPreviousToken().Parent;
+ node = targetParent.Parent;
+ if (node.Kind() == SyntaxKind.LessThanExpression) {
+ return HandleTypeParameterCase(semanticModel, ((BinaryExpressionSyntax)node).Left, cancellationToken);
+
+ }
+ }
+ return ParameterHintingResult.Empty;
+ }
+ if (node.IsKind (SyntaxKind.Argument)) {
+ node = node.Parent.Parent;
+ } else {
+ if (!(targetParent is BaseArgumentListSyntax) && !(targetParent is AttributeArgumentListSyntax) && !(targetParent is InitializerExpressionSyntax)) {
+ if (position == targetParent.Span.Start)
+ return ParameterHintingResult.Empty;
+ return await InternalGetParameterDataProviderAsync (document, semanticModel, targetParent.Span.Start, cancellationToken, recCount + 1).ConfigureAwait (false);
+ }
+ }
+ switch (node.Kind()) {
+ case SyntaxKind.Attribute:
+ return HandleAttribute(semanticModel, node, cancellationToken);
+ case SyntaxKind.ThisConstructorInitializer:
+ case SyntaxKind.BaseConstructorInitializer:
+ return HandleConstructorInitializer(semanticModel, node, cancellationToken);
+ case SyntaxKind.ObjectCreationExpression:
+ return HandleObjectCreationExpression(semanticModel, node, cancellationToken);
+ case SyntaxKind.InvocationExpression:
+ return HandleInvocationExpression(semanticModel, (InvocationExpressionSyntax)node, cancellationToken);
+ case SyntaxKind.ElementAccessExpression:
+ return HandleElementAccessExpression(semanticModel, (ElementAccessExpressionSyntax)node, cancellationToken);
+ }
+ return ParameterHintingResult.Empty;
+ }
+
+ ParameterHintingResult HandleInvocationExpression(SemanticModel semanticModel, InvocationExpressionSyntax node, CancellationToken cancellationToken)
+ {
+ var info = semanticModel.GetSymbolInfo(node, cancellationToken);
+ var result = new ParameterHintingResult(node.SpanStart);
+
+ var targetTypeInfo = semanticModel.GetTypeInfo (node.Expression);
+ if (targetTypeInfo.Type != null && targetTypeInfo.Type.TypeKind == TypeKind.Delegate) {
+ result.AddData (factory.CreateMethodDataProvider (targetTypeInfo.Type.GetDelegateInvokeMethod ()));
+ return result;
+ }
+
+ var within = semanticModel.GetEnclosingNamedTypeOrAssembly(node.SpanStart, cancellationToken);
+ ITypeSymbol type;
+ var ma = node.Expression as MemberAccessExpressionSyntax;
+ string name = null;
+ bool staticLookup = false;
+ if (ma != null) {
+ staticLookup = semanticModel.GetSymbolInfo (ma.Expression).Symbol is ITypeSymbol;
+ type = semanticModel.GetTypeInfo (ma.Expression).Type;
+ name = info.Symbol?.Name ?? ma.Name.Identifier.ValueText;
+ } else {
+ type = within as ITypeSymbol;
+ name = info.Symbol?.Name ?? node.Expression.ToString ();
+ var sym = semanticModel.GetEnclosingSymbol (node.SpanStart, cancellationToken);
+ staticLookup = sym.IsStatic;
+ }
+ var addedMethods = new List<IMethodSymbol> ();
+ var filterMethod = new HashSet<IMethodSymbol> ();
+ for (;type != null; type = type.BaseType) {
+ foreach (var method in type.GetMembers ().OfType<IMethodSymbol> ().Concat (GetExtensionMethods(semanticModel, type, node, cancellationToken)).Where (m => m.Name == name)) {
+ if (staticLookup && !method.IsStatic)
+ continue;
+ if (method.OverriddenMethod != null)
+ filterMethod.Add (method.OverriddenMethod);
+ if (filterMethod.Contains (method))
+ continue;
+ if (addedMethods.Any (added => SignatureComparer.HaveSameSignature (method, added, true)))
+ continue;
+ if (method.IsAccessibleWithin (within)) {
+ if (info.Symbol != null) {
+ var smethod = (IMethodSymbol)info.Symbol;
+ if (smethod != null && smethod.OriginalDefinition == method) {
+ continue;
+ }
+ }
+ addedMethods.Add (method);
+ result.AddData (factory.CreateMethodDataProvider (method));
+ }
+ }
+ }
+ if (info.Symbol != null && !addedMethods.Contains (info.Symbol)) {
+ if (!staticLookup || info.Symbol.IsStatic)
+ result.AddData (factory.CreateMethodDataProvider ((IMethodSymbol)info.Symbol));
+ }
+ return result;
+ }
+
+ IEnumerable<IMethodSymbol> GetExtensionMethods (SemanticModel semanticModel, ITypeSymbol typeToExtend, InvocationExpressionSyntax node, CancellationToken cancellationToken)
+ {
+ var usedNamespaces = new HashSet<string> ();
+ foreach (var un in semanticModel.GetUsingNamespacesInScope (node)) {
+ usedNamespaces.Add (un.GetFullName ());
+ }
+ var enclosingNamespaceName = semanticModel.GetEnclosingNamespace (node.SpanStart, cancellationToken).GetFullName ();
+
+ var stack = new Stack<INamespaceOrTypeSymbol> ();
+ stack.Push (semanticModel.Compilation.GlobalNamespace);
+
+ while (stack.Count > 0) {
+ if (cancellationToken.IsCancellationRequested)
+ break;
+ var current = stack.Pop ();
+ var currentNs = current as INamespaceSymbol;
+ if (currentNs != null) {
+
+ foreach (var member in currentNs.GetNamespaceMembers ()) {
+ var currentNsName = member.GetFullName ();
+ if (usedNamespaces.Contains (currentNsName) ||
+ enclosingNamespaceName == currentNsName ||
+ (enclosingNamespaceName.StartsWith (currentNsName, StringComparison.Ordinal) &&
+ enclosingNamespaceName [currentNsName.Length] == '.')) {
+ stack.Push (member);
+ }
+ }
+
+ foreach (var member in currentNs.GetTypeMembers ())
+ stack.Push (member);
+
+ } else {
+ var type = (INamedTypeSymbol)current;
+ if (type.IsImplicitClass || type.IsScriptClass)
+ continue;
+ if (type.DeclaredAccessibility != Accessibility.Public) {
+ if (type.DeclaredAccessibility != Accessibility.Internal)
+ continue;
+ if (!type.IsAccessibleWithin (semanticModel.Compilation.Assembly))
+ continue;
+ }
+ if (!type.MightContainExtensionMethods)
+ continue;
+ foreach (var extMethod in type.GetMembers ().OfType<IMethodSymbol> ().Where (method => method.IsExtensionMethod)) {
+ var reducedMethod = extMethod.ReduceExtensionMethod (typeToExtend);
+ if (reducedMethod != null) {
+ yield return reducedMethod;
+ }
+ }
+ }
+ }
+ }
+
+ ParameterHintingResult HandleTypeParameterCase(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ var result = new ParameterHintingResult(node.SpanStart);
+ string typeName;
+ var gns = node as GenericNameSyntax;
+ if (gns != null) {
+ typeName = gns.Identifier.ToString ();
+ } else {
+ typeName = node.ToString ();
+ }
+
+ foreach (var cand in semanticModel.LookupSymbols (node.SpanStart).OfType<INamedTypeSymbol> ()) {
+ if (cand.TypeParameters.Length == 0)
+ continue;
+ if (cand.Name == typeName || cand.GetFullName () == typeName)
+ result.AddData(factory.CreateTypeParameterDataProvider(cand));
+ }
+
+ if (result.Count == 0) {
+ foreach (var cand in semanticModel.LookupSymbols (node.SpanStart).OfType<IMethodSymbol> ()) {
+ if (cand.TypeParameters.Length == 0)
+ continue;
+ if (cand.Name == typeName)
+ result.AddData (factory.CreateTypeParameterDataProvider (cand));
+ }
+ }
+ return result;
+ }
+
+ ParameterHintingResult HandleAttribute(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ var info = semanticModel.GetSymbolInfo(node, cancellationToken);
+ var result = new ParameterHintingResult(node.SpanStart);
+ var resolvedMethod = info.Symbol as IMethodSymbol;
+ if (resolvedMethod != null)
+ result.AddData(factory.CreateConstructorProvider(resolvedMethod));
+ result.AddRange(info.CandidateSymbols.OfType<IMethodSymbol>().Select (m => factory.CreateConstructorProvider(m)));
+ return result;
+ }
+
+ ParameterHintingResult HandleConstructorInitializer(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ var info = semanticModel.GetSymbolInfo(node, cancellationToken);
+ var result = new ParameterHintingResult(node.SpanStart);
+
+ var resolvedMethod = info.Symbol as IMethodSymbol;
+ if (resolvedMethod != null)
+ result.AddData(factory.CreateConstructorProvider(resolvedMethod));
+ result.AddRange(info.CandidateSymbols.OfType<IMethodSymbol>().Select (m => factory.CreateConstructorProvider(m)));
+ return result;
+ }
+
+ ParameterHintingResult HandleElementAccessExpression(SemanticModel semanticModel, ElementAccessExpressionSyntax node, CancellationToken cancellationToken)
+ {
+ var within = semanticModel.GetEnclosingNamedTypeOrAssembly(node.SpanStart, cancellationToken);
+
+ var targetTypeInfo = semanticModel.GetTypeInfo (node.Expression);
+ ITypeSymbol type = targetTypeInfo.Type;
+ if (type == null)
+ return ParameterHintingResult.Empty;
+
+ var result = new ParameterHintingResult(node.SpanStart);
+ if (type.TypeKind == TypeKind.Array) {
+ result.AddData (factory.CreateArrayDataProvider ((IArrayTypeSymbol)type));
+ return result;
+ }
+
+ var addedProperties = new List<IPropertySymbol> ();
+ for (;type != null; type = type.BaseType) {
+ foreach (var indexer in type.GetMembers ().OfType<IPropertySymbol> ().Where (p => p.IsIndexer)) {
+ if (addedProperties.Any (added => SignatureComparer.HaveSameSignature (indexer, added, true)))
+ continue;
+
+ if (indexer.IsAccessibleWithin (within)) {
+ addedProperties.Add (indexer);
+ result.AddData (factory.CreateIndexerParameterDataProvider (indexer, node));
+ }
+ }
+ }
+ return result;
+ }
+
+ ParameterHintingResult HandleObjectCreationExpression (SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ // var info = semanticModel.GetSymbolInfo(node, cancellationToken);
+ var result = new ParameterHintingResult(node.SpanStart);
+ var within = semanticModel.GetEnclosingNamedTypeOrAssembly(node.SpanStart, cancellationToken);
+
+ var targetTypeInfo = semanticModel.GetTypeInfo (node);
+ if (targetTypeInfo.Type != null) {
+ foreach (IMethodSymbol c in targetTypeInfo.Type.GetMembers().OfType<IMethodSymbol>().Where(m => m.MethodKind == MethodKind.Constructor)) {
+ if (c.IsAccessibleWithin (within)) {
+ result.AddData(factory.CreateConstructorProvider(c));
+ }
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/ParameterHintingResult.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/ParameterHintingResult.cs
new file mode 100644
index 0000000000..ebd7cf1eec
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/ParameterHintingResult.cs
@@ -0,0 +1,87 @@
+//
+// ParameterHintingResult.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+
+namespace ICSharpCode.NRefactory6.CSharp.Completion
+{
+ class ParameterHintingResult : IReadOnlyList<IParameterHintingData>
+ {
+ public static readonly ParameterHintingResult Empty = new ParameterHintingResult (-1);
+
+ readonly List<IParameterHintingData> data = new List<IParameterHintingData> ();
+
+ /// <summary>
+ /// Gets the start offset of the parameter expression node.
+ /// </summary>
+ public int StartOffset {
+ get;
+ private set;
+ }
+
+ #region IReadOnlyList<IParameterHintingData> implementation
+
+ public IEnumerator<IParameterHintingData> GetEnumerator()
+ {
+ return data.GetEnumerator();
+ }
+
+ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+ {
+ return ((System.Collections.IEnumerable)data).GetEnumerator();
+ }
+
+ public IParameterHintingData this[int index] {
+ get {
+ return data [index];
+ }
+ }
+
+ public int Count {
+ get {
+ return data.Count;
+ }
+ }
+
+ #endregion
+
+ internal protected ParameterHintingResult(int startOffset)
+ {
+ this.StartOffset = startOffset;
+ }
+
+ internal protected void AddData (IParameterHintingData parameterHintingData)
+ {
+ data.Add(parameterHintingData);
+ }
+
+ internal protected void AddRange (IEnumerable<IParameterHintingData> parameterHintingDataCollection)
+ {
+ data.AddRange(parameterHintingDataCollection);
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/ParameterUtil.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/ParameterUtil.cs
new file mode 100644
index 0000000000..415d37e1ab
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/ParameterUtil.cs
@@ -0,0 +1,123 @@
+//
+// ParameterUtil.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using MonoDevelop.Core.Text;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ class ParameterIndexResult
+ {
+ public readonly static ParameterIndexResult Invalid = new ParameterIndexResult (null, -1);
+ public readonly static ParameterIndexResult First = new ParameterIndexResult (null, 0);
+
+ public readonly string[] UsedNamespaceParameters;
+ public readonly int ParameterIndex;
+
+
+ internal ParameterIndexResult(string[] usedNamespaceParameters, int parameterIndex)
+ {
+ UsedNamespaceParameters = usedNamespaceParameters;
+ ParameterIndex = parameterIndex;
+ }
+ }
+
+ static class ParameterUtil
+ {
+ public static async Task<ParameterIndexResult> GetCurrentParameterIndex (Document document, int startOffset, int caretOffset, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ List<string> usedNamedParameters = null;
+ if (startOffset < 0)
+ return ParameterIndexResult.Invalid;
+
+ var tree = await document.GetSyntaxTreeAsync (cancellationToken).ConfigureAwait (false);
+ var root = await tree.GetRootAsync (cancellationToken).ConfigureAwait (false);
+ if (startOffset >= root.FullSpan.Length)
+ return ParameterIndexResult.Invalid;
+ var token = root.FindToken (startOffset);
+ if (token.Parent == null)
+ return ParameterIndexResult.Invalid;
+
+ SyntaxNode argList = null;
+
+ var invocation = token.Parent.AncestorsAndSelf ().FirstOrDefault (n =>
+ n is InvocationExpressionSyntax ||
+ n is ObjectCreationExpressionSyntax ||
+ n is ElementAccessExpressionSyntax ||
+ n is ConstructorInitializerSyntax ||
+ n is AttributeSyntax);
+ if (invocation is InvocationExpressionSyntax) {
+ argList = ((InvocationExpressionSyntax)invocation).ArgumentList;
+ } else if (invocation is ObjectCreationExpressionSyntax) {
+ argList = ((ObjectCreationExpressionSyntax)invocation).ArgumentList;
+ } else if (invocation is ElementAccessExpressionSyntax) {
+ argList = ((ElementAccessExpressionSyntax)invocation).ArgumentList;
+ } else if (invocation is ConstructorInitializerSyntax) {
+ argList = ((ConstructorInitializerSyntax)invocation).ArgumentList;
+ } else if (invocation is AttributeSyntax) {
+ argList = ((AttributeSyntax)invocation).ArgumentList;
+ }
+ if (argList == null)
+ return ParameterIndexResult.Invalid;
+ int i = 0;
+ int j = 0;
+ if (caretOffset <= argList.SpanStart || caretOffset >= argList.Span.End) {
+ return ParameterIndexResult.Invalid;
+ }
+
+ foreach (var child in argList.ChildNodesAndTokens ()) {
+ if (child.Span.End > caretOffset) {
+ if (i == 0 && j <= 1)
+ return ParameterIndexResult.First;
+ return new ParameterIndexResult (usedNamedParameters != null ? usedNamedParameters.ToArray () : null, i + 1);
+ }
+
+ if (child.IsToken) {
+ if (child.IsKind (Microsoft.CodeAnalysis.CSharp.SyntaxKind.CommaToken))
+ i++;
+ } else {
+ var node = child.AsNode () as ArgumentSyntax;
+ if (node != null && node.NameColon != null) {
+ if (usedNamedParameters == null)
+ usedNamedParameters = new List<string> ();
+ usedNamedParameters.Add (node.NameColon.Name.Identifier.Text);
+ }
+ }
+ j++;
+ }
+ if (j > 0) {
+ return new ParameterIndexResult (usedNamedParameters != null ? usedNamedParameters.ToArray () : null, i + 1);
+ }
+ return ParameterIndexResult.Invalid;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsService.Rewriter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsService.Rewriter.cs
new file mode 100644
index 0000000000..d46886d49f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsService.Rewriter.cs
@@ -0,0 +1,168 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.RemoveUnnecessaryImports
+{
+ partial class CSharpRemoveUnnecessaryImportsService
+ {
+ private class Rewriter : CSharpSyntaxRewriter
+ {
+ private readonly ISet<UsingDirectiveSyntax> _unnecessaryUsingsDoNotAccessDirectly;
+ private readonly CancellationToken _cancellationToken;
+
+ public Rewriter(ISet<UsingDirectiveSyntax> unnecessaryUsings, CancellationToken cancellationToken)
+ : base(visitIntoStructuredTrivia: true)
+ {
+ _unnecessaryUsingsDoNotAccessDirectly = unnecessaryUsings;
+ _cancellationToken = cancellationToken;
+ }
+
+ public override SyntaxNode DefaultVisit(SyntaxNode node)
+ {
+ _cancellationToken.ThrowIfCancellationRequested();
+ return base.DefaultVisit(node);
+ }
+
+ private void ProcessUsings(
+ SyntaxList<UsingDirectiveSyntax> usings,
+ ISet<UsingDirectiveSyntax> usingsToRemove,
+ out SyntaxList<UsingDirectiveSyntax> finalUsings,
+ out SyntaxTriviaList finalTrivia)
+ {
+ var currentUsings = new List<UsingDirectiveSyntax>(usings);
+
+ finalTrivia = default(SyntaxTriviaList);
+ for (int i = 0; i < usings.Count; i++)
+ {
+ if (usingsToRemove.Contains(usings[i]))
+ {
+ var currentUsing = currentUsings[i];
+ currentUsings[i] = null;
+
+ var leadingTrivia = currentUsing.GetLeadingTrivia();
+ if (leadingTrivia.Any(t => t.Kind() != SyntaxKind.EndOfLineTrivia && t.Kind() != SyntaxKind.WhitespaceTrivia))
+ {
+ // This using had trivia we want to preserve. If we're the last
+ // directive, then copy this trivia out so that our caller can place
+ // it on the next token. If there is any directive following us,
+ // then place it on that.
+ if (i < usings.Count - 1)
+ {
+ currentUsings[i + 1] = currentUsings[i + 1].WithPrependedLeadingTrivia(leadingTrivia);
+ }
+ else
+ {
+ finalTrivia = leadingTrivia;
+ }
+ }
+ }
+ }
+
+ finalUsings = currentUsings.WhereNotNull().ToSyntaxList();
+ }
+
+ private ISet<UsingDirectiveSyntax> GetUsingsToRemove(
+ SyntaxList<UsingDirectiveSyntax> oldUsings,
+ SyntaxList<UsingDirectiveSyntax> newUsings)
+ {
+ var result = new HashSet<UsingDirectiveSyntax>();
+ for (int i = 0; i < oldUsings.Count; i++)
+ {
+ if (_unnecessaryUsingsDoNotAccessDirectly.Contains(oldUsings[i]))
+ {
+ result.Add(newUsings[i]);
+ }
+ }
+
+ return result;
+ }
+
+ public override SyntaxNode VisitCompilationUnit(CompilationUnitSyntax node)
+ {
+ var compilationUnit = (CompilationUnitSyntax)base.VisitCompilationUnit(node);
+
+ var usingsToRemove = GetUsingsToRemove(node.Usings, compilationUnit.Usings);
+ if (usingsToRemove.Count == 0)
+ {
+ return compilationUnit;
+ }
+
+ SyntaxList<UsingDirectiveSyntax> finalUsings;
+ SyntaxTriviaList finalTrivia;
+ ProcessUsings(compilationUnit.Usings, usingsToRemove, out finalUsings, out finalTrivia);
+
+ // If there was any left over trivia, then attach it to the next token that
+ // follows the usings.
+ if (finalTrivia.Count > 0)
+ {
+ var nextToken = compilationUnit.Usings.Last().GetLastToken().GetNextToken();
+ compilationUnit = compilationUnit.ReplaceToken(nextToken, nextToken.WithPrependedLeadingTrivia(finalTrivia));
+ }
+
+ var resultCompilationUnit = compilationUnit.WithUsings(finalUsings);
+ if (finalUsings.Count == 0 &&
+ resultCompilationUnit.Externs.Count == 0 &&
+ resultCompilationUnit.Members.Count >= 1)
+ {
+ // We've removed all the usings and now the first thing in the namespace is a
+ // type. In this case, remove any newlines preceding the type.
+ var firstToken = resultCompilationUnit.GetFirstToken();
+ var newFirstToken = StripNewLines(firstToken);
+ resultCompilationUnit = resultCompilationUnit.ReplaceToken(firstToken, newFirstToken);
+ }
+
+ return resultCompilationUnit;
+ }
+
+ public override SyntaxNode VisitNamespaceDeclaration(NamespaceDeclarationSyntax node)
+ {
+ var namespaceDeclaration = (NamespaceDeclarationSyntax)base.VisitNamespaceDeclaration(node);
+ var usingsToRemove = GetUsingsToRemove(node.Usings, namespaceDeclaration.Usings);
+ if (usingsToRemove.Count == 0)
+ {
+ return namespaceDeclaration;
+ }
+
+ SyntaxList<UsingDirectiveSyntax> finalUsings;
+ SyntaxTriviaList finalTrivia;
+ ProcessUsings(namespaceDeclaration.Usings, usingsToRemove, out finalUsings, out finalTrivia);
+
+ // If there was any left over trivia, then attach it to the next token that
+ // follows the usings.
+ if (finalTrivia.Count > 0)
+ {
+ var nextToken = namespaceDeclaration.Usings.Last().GetLastToken().GetNextToken();
+ namespaceDeclaration = namespaceDeclaration.ReplaceToken(nextToken, nextToken.WithPrependedLeadingTrivia(finalTrivia));
+ }
+
+ var resultNamespace = namespaceDeclaration.WithUsings(finalUsings);
+ if (finalUsings.Count == 0 &&
+ resultNamespace.Externs.Count == 0 &&
+ resultNamespace.Members.Count >= 1)
+ {
+ // We've removed all the usings and now the first thing in the namespace is a
+ // type. In this case, remove any newlines preceding the type.
+ var firstToken = resultNamespace.Members.First().GetFirstToken();
+ var newFirstToken = StripNewLines(firstToken);
+ resultNamespace = resultNamespace.ReplaceToken(firstToken, newFirstToken);
+ }
+
+ return resultNamespace;
+ }
+
+ private static SyntaxToken StripNewLines(SyntaxToken firstToken)
+ {
+ return firstToken.WithLeadingTrivia(firstToken.LeadingTrivia.SkipWhile(t => t.Kind() == SyntaxKind.EndOfLineTrivia));
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsService.cs
new file mode 100644
index 0000000000..fd5496194c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/RemoveUnnecessaryImports/CSharpRemoveUnnecessaryImportsService.cs
@@ -0,0 +1,115 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Composition;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis.Internal.Log;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp.Features.RemoveUnnecessaryImports
+{
+ partial class CSharpRemoveUnnecessaryImportsService
+ {
+ public static IEnumerable<SyntaxNode> GetUnnecessaryImports(SemanticModel semanticModel, SyntaxNode root, CancellationToken cancellationToken)
+ {
+ var diagnostics = semanticModel.GetDiagnostics(cancellationToken: cancellationToken);
+ if (!diagnostics.Any())
+ {
+ return null;
+ }
+
+ var unnecessaryImports = new HashSet<UsingDirectiveSyntax>();
+
+ foreach (var diagnostic in diagnostics)
+ {
+ if (diagnostic.Id == "CS8019")
+ {
+ var node = root.FindNode(diagnostic.Location.SourceSpan) as UsingDirectiveSyntax;
+
+ if (node != null)
+ {
+ unnecessaryImports.Add(node);
+ }
+ }
+ }
+
+ if (cancellationToken.IsCancellationRequested || !unnecessaryImports.Any())
+ {
+ return null;
+ }
+
+ return unnecessaryImports;
+ }
+
+ public Document RemoveUnnecessaryImports(Document document, SemanticModel model, SyntaxNode root, CancellationToken cancellationToken)
+ {
+ var unnecessaryImports = GetUnnecessaryImports(model, root, cancellationToken) as ISet<UsingDirectiveSyntax>;
+ if (unnecessaryImports == null)
+ {
+ return document;
+ }
+
+ var oldRoot = (CompilationUnitSyntax)root;
+ if (unnecessaryImports.Any(import => oldRoot.OverlapsHiddenPosition(cancellationToken)))
+ {
+ return document;
+ }
+
+ var newRoot = (CompilationUnitSyntax)new Rewriter(unnecessaryImports, cancellationToken).Visit(oldRoot);
+ if (cancellationToken.IsCancellationRequested)
+ {
+ return null;
+ }
+
+ return document.WithSyntaxRoot(FormatResult(document, newRoot, cancellationToken));
+ }
+
+ private SyntaxNode FormatResult(Document document, CompilationUnitSyntax newRoot, CancellationToken cancellationToken)
+ {
+ var spans = new List<TextSpan>();
+ AddFormattingSpans(newRoot, spans, cancellationToken);
+ return Formatter.Format(newRoot, spans, document.Project.Solution.Workspace, document.Project.Solution.Workspace.Options, cancellationToken: cancellationToken);
+ }
+
+ private void AddFormattingSpans(
+ CompilationUnitSyntax compilationUnit,
+ List<TextSpan> spans,
+ CancellationToken cancellationToken)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ spans.Add(TextSpan.FromBounds(0, GetEndPosition(compilationUnit, compilationUnit.Members)));
+
+ foreach (var @namespace in compilationUnit.Members.OfType<NamespaceDeclarationSyntax>())
+ {
+ AddFormattingSpans(@namespace, spans, cancellationToken);
+ }
+ }
+
+ private void AddFormattingSpans(
+ NamespaceDeclarationSyntax namespaceMember,
+ List<TextSpan> spans,
+ CancellationToken cancellationToken)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ spans.Add(TextSpan.FromBounds(namespaceMember.SpanStart, GetEndPosition(namespaceMember, namespaceMember.Members)));
+
+ foreach (var @namespace in namespaceMember.Members.OfType<NamespaceDeclarationSyntax>())
+ {
+ AddFormattingSpans(@namespace, spans, cancellationToken);
+ }
+ }
+
+ private int GetEndPosition(SyntaxNode container, SyntaxList<MemberDeclarationSyntax> list)
+ {
+ return list.Count > 0 ? list[0].SpanStart : container.Span.End;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/SemanticHighlighting/SemanticHighlightingVisitor.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/SemanticHighlighting/SemanticHighlightingVisitor.cs
new file mode 100644
index 0000000000..ddef6ea1e8
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/SemanticHighlighting/SemanticHighlightingVisitor.cs
@@ -0,0 +1,716 @@
+// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy of this
+// software and associated documentation files (the "Software"), to deal in the Software
+// without restriction, including without limitation the rights to use, copy, modify, merge,
+// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+// to whom the Software is furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all copies or
+// substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Core.Text;
+using System.Text.RegularExpressions;
+
+namespace ICSharpCode.NRefactory6.CSharp.Analysis
+{
+ /// <summary>
+ /// C# Semantic highlighter.
+ /// </summary>
+ abstract class SemanticHighlightingVisitor<TColor> : CSharpSyntaxWalker
+ {
+ protected CancellationToken cancellationToken = default(CancellationToken);
+
+ protected TColor defaultTextColor;
+ protected TColor referenceTypeColor;
+ protected TColor valueTypeColor;
+ protected TColor interfaceTypeColor;
+ protected TColor enumerationTypeColor;
+ protected TColor typeParameterTypeColor;
+ protected TColor delegateTypeColor;
+
+ protected TColor methodCallColor;
+ protected TColor methodDeclarationColor;
+
+ protected TColor eventDeclarationColor;
+ protected TColor eventAccessColor;
+
+ protected TColor propertyDeclarationColor;
+ protected TColor propertyAccessColor;
+
+ protected TColor fieldDeclarationColor;
+ protected TColor fieldAccessColor;
+
+ protected TColor variableDeclarationColor;
+ protected TColor variableAccessColor;
+
+ protected TColor parameterDeclarationColor;
+ protected TColor parameterAccessColor;
+
+ protected TColor valueKeywordColor;
+ protected TColor externAliasKeywordColor;
+ protected TColor varKeywordTypeColor;
+ protected TColor nameofKeywordColor;
+ protected TColor whenKeywordColor;
+
+ /// <summary>
+ /// Used for 'in' modifiers on type parameters.
+ /// </summary>
+ /// <remarks>
+ /// 'in' may have a different color when used with 'foreach'.
+ /// 'out' is not colored by semantic highlighting, as syntax highlighting can already detect it as a parameter modifier.
+ /// </remarks>
+ protected TColor parameterModifierColor;
+
+ /// <summary>
+ /// Used for inactive code (excluded by preprocessor or ConditionalAttribute)
+ /// </summary>
+ protected TColor inactiveCodeColor;
+
+ protected TColor stringFormatItemColor;
+
+ protected TColor stringRegexCharacterClass;
+ protected TColor stringRegexGroupingConstructs;
+ protected TColor stringRegexSetConstructs;
+ protected TColor stringRegexComments;
+ protected TColor stringRegexEscapeCharacter;
+ protected TColor stringRegexAltEscapeCharacter;
+
+ protected TColor stringRegexErrors;
+
+ protected TextSpan region;
+
+ protected SemanticModel semanticModel;
+ // bool isInAccessorContainingValueParameter;
+
+ protected abstract void Colorize (TextSpan span, TColor color);
+
+ protected SemanticHighlightingVisitor (SemanticModel semanticModel) : base (SyntaxWalkerDepth.Trivia)
+ {
+ this.semanticModel = semanticModel;
+ }
+
+ #region Colorize helper methods
+ protected void Colorize (SyntaxNode node, TColor color)
+ {
+ if (node == null)
+ return;
+ Colorize (node.Span, color);
+ }
+
+ protected void Colorize (SyntaxToken node, TColor color)
+ {
+ Colorize (node.Span, color);
+ }
+
+ #endregion
+ public override void VisitRefTypeExpression (Microsoft.CodeAnalysis.CSharp.Syntax.RefTypeExpressionSyntax node)
+ {
+ base.VisitRefTypeExpression (node);
+ Colorize (node.Expression, referenceTypeColor);
+ }
+
+ public override void VisitCompilationUnit (CompilationUnitSyntax node)
+ {
+ var startNode = node.DescendantNodesAndSelf (n => region.Start <= n.SpanStart).FirstOrDefault ();
+ if (startNode == node || startNode == null) {
+ base.VisitCompilationUnit (node);
+ } else {
+ this.Visit (startNode);
+ }
+ }
+
+ public override void Visit (SyntaxNode node)
+ {
+ if (node.Span.End < region.Start)
+ return;
+ if (node.Span.Start > region.End)
+ return;
+ base.Visit(node);
+ }
+
+ void HighlightStringFormatItems(LiteralExpressionSyntax expr)
+ {
+ if (!expr.Token.IsKind(SyntaxKind.StringLiteralToken))
+ return;
+ var text = expr.Token.Text;
+ int start = -1;
+ for (int i = 0; i < text.Length; i++) {
+ char ch = text [i];
+
+ if (NewLine.GetDelimiterType(ch, i + 1 < text.Length ? text [i + 1] : '\0') != UnicodeNewline.Unknown) {
+ continue;
+ }
+
+ if (ch == '{' && start < 0) {
+ char next = i + 1 < text.Length ? text [i + 1] : '\0';
+ if (next == '{') {
+ i++;
+ continue;
+ }
+ start = i;
+ }
+
+ if (ch == '}' && start >= 0) {
+ Colorize(new TextSpan (expr.SpanStart + start, i - start + 1), stringFormatItemColor);
+ start = -1;
+ }
+ }
+ }
+
+ public override void VisitInvocationExpression(InvocationExpressionSyntax node)
+ {
+ var symbolInfo = semanticModel.GetSymbolInfo (node.Expression, cancellationToken);
+
+ if (IsInactiveConditional (symbolInfo.Symbol) || IsEmptyPartialMethod (symbolInfo.Symbol, cancellationToken)) {
+ // mark the whole invocation statement as inactive code
+ Colorize (node.Span, inactiveCodeColor);
+ return;
+ }
+ if (node.Expression.IsKind (SyntaxKind.IdentifierName) && symbolInfo.Symbol == null) {
+ var id = (IdentifierNameSyntax)node.Expression;
+ if (id.Identifier.ValueText == "nameof") {
+ Colorize (id.Span, nameofKeywordColor);
+ }
+ }
+
+ ExpressionSyntax fmtArgumets;
+ IList<ExpressionSyntax> args;
+ if (node.ArgumentList.Arguments.Count > 1 && FormatStringHelper.TryGetFormattingParameters (semanticModel, node, out fmtArgumets, out args, null, cancellationToken)) {
+ var expr = node.ArgumentList.Arguments.First ();
+ if (expr != null) {
+ var literalExpressionSyntax = expr.Expression as LiteralExpressionSyntax;
+ if (literalExpressionSyntax != null)
+ HighlightStringFormatItems (literalExpressionSyntax);
+ }
+ }
+
+ var containingType = symbolInfo.Symbol?.ContainingType;
+ if (IsRegexMatchMethod (symbolInfo)) {
+ if (node.ArgumentList.Arguments.Count > 1) {
+ var pattern = node.ArgumentList.Arguments [1].Expression as LiteralExpressionSyntax;
+ if (pattern != null && pattern.IsKind (SyntaxKind.StringLiteralExpression)) {
+ ColorizeRegex (pattern);
+ }
+
+ }
+ }
+
+ base.VisitInvocationExpression (node);
+ }
+
+ internal static bool IsRegexMatchMethod (SymbolInfo symbolInfo)
+ {
+ var symbol = symbolInfo.Symbol;
+ if (symbol == null)
+ return false;
+ return IsRegexType (symbol.ContainingType) && symbol.IsStatic && (symbol.Name == "IsMatch" || symbol.Name == "Match" || symbol.Name == "Matches");
+ }
+
+ public override void VisitObjectCreationExpression (ObjectCreationExpressionSyntax node)
+ {
+ base.VisitObjectCreationExpression (node);
+ var symbolInfo = semanticModel.GetSymbolInfo (node, cancellationToken);
+ if (IsRegexConstructor (symbolInfo)) {
+ if (node.ArgumentList.Arguments.Count > 0) {
+ var pattern = node.ArgumentList.Arguments [0].Expression as LiteralExpressionSyntax;
+ if (pattern != null && pattern.IsKind (SyntaxKind.StringLiteralExpression)) {
+ ColorizeRegex (pattern);
+ }
+ }
+ }
+ }
+
+ internal static bool IsRegexConstructor (SymbolInfo symbolInfo)
+ {
+ return symbolInfo.Symbol?.ContainingType is INamedTypeSymbol && IsRegexType (symbolInfo.Symbol.ContainingType);
+ }
+
+ internal static bool IsRegexType (INamedTypeSymbol containingType)
+ {
+ return containingType != null && containingType.Name == "Regex" && containingType.ContainingNamespace.GetFullName () == "System.Text.RegularExpressions";
+ }
+
+ void ColorizeRegex (LiteralExpressionSyntax literal)
+ {
+ string pattern = literal.Token.ToString ();
+ if (pattern.Length == 0)
+ return;
+ bool isVerbatim = pattern [0] == '@';
+ bool inSet = false, inGroup = false;
+ int lastEscape = -1;
+ for (int i = 1; i < pattern.Length - 1; i++) {
+ char ch = pattern [i];
+ switch (ch) {
+ case '\\':
+ var start = i;
+ i++;
+ if (!isVerbatim) {
+ if (pattern [i] == '\\') {
+ i++;
+ } else {
+ break;
+ }
+ }
+
+ switch (pattern[i]) {
+ case 'w':
+ case 'W':
+ case 's':
+ case 'S':
+ case 'd':
+ case 'D':
+ Colorize (new TextSpan (literal.SpanStart + start, i - start + 1), stringRegexCharacterClass);
+ break;
+ case 'A':
+ case 'Z':
+ case 'z':
+ case 'G':
+ case 'b':
+ case 'B':
+ // Anchor
+ Colorize (new TextSpan (literal.SpanStart + start, i - start + 1), stringRegexCharacterClass);
+ break;
+ default:
+ if (lastEscape == literal.SpanStart + start) {
+ Colorize (new TextSpan (literal.SpanStart + start, i - start + 1), stringRegexAltEscapeCharacter);
+ lastEscape = -1;
+ } else {
+ Colorize (new TextSpan (literal.SpanStart + start, i - start + 1), stringRegexEscapeCharacter);
+ lastEscape = literal.SpanStart + i + 1;
+ }
+ break;
+ }
+ break;
+ case '^':
+ if (inSet) {
+ Colorize (new TextSpan (literal.SpanStart + i, 1), stringRegexSetConstructs);
+ } else {
+ Colorize (new TextSpan (literal.SpanStart + i, 1), stringRegexCharacterClass);
+ }
+ break;
+ case '$':
+ // Anchor
+ Colorize (new TextSpan (literal.SpanStart + i, 1), stringRegexCharacterClass);
+ break;
+ case '.':
+ Colorize (new TextSpan (literal.SpanStart + i, 1), stringRegexCharacterClass);
+ break;
+ case '|':
+ // Alternate
+ Colorize (new TextSpan (literal.SpanStart + i, 1), stringRegexCharacterClass);
+ break;
+ case '*':
+ case '+':
+ case '?':
+ // Quantifier
+ Colorize (new TextSpan (literal.SpanStart + i, 1), stringRegexCharacterClass);
+ break;
+ case '{': {
+ var closingIndex = pattern.IndexOf ('}', i + 1);
+ if (closingIndex >= 0) {
+ // Quantifier
+ Colorize (new TextSpan (literal.SpanStart + i, closingIndex - i + 1), stringRegexCharacterClass);
+ i = closingIndex;
+ } else {
+ Colorize (new TextSpan (literal.SpanStart + i, pattern.Length - i), stringRegexErrors);
+ i = pattern.Length;
+ }
+ break;
+ }
+ case '[': {
+ var closingIndex = pattern.IndexOf (']', i + 1);
+ if (closingIndex < 0) {
+ Colorize (new TextSpan (literal.SpanStart + i, pattern.Length - i), stringRegexErrors);
+ i = pattern.Length;
+ break;
+ }
+ inSet = true;
+ Colorize (new TextSpan (literal.SpanStart + i, 1), stringRegexSetConstructs);
+ }
+ break;
+ case ']':
+ inSet = false;
+ Colorize (new TextSpan (literal.SpanStart + i, 1), stringRegexSetConstructs);
+ break;
+ case '-':
+ if (inSet)
+ Colorize (new TextSpan (literal.SpanStart + i, 1), stringRegexSetConstructs);
+ break;
+ case '(':
+ if (i + 1 < pattern.Length && pattern[i + 1 ] == '?') {
+ if (i + 2 < pattern.Length && pattern[i + 2] == '#') {
+ var closingIndex = pattern.IndexOf (')', i + 2);
+ if (closingIndex < 0) {
+ Colorize (new TextSpan (literal.SpanStart + i, pattern.Length - i), stringRegexErrors);
+ i = pattern.Length;
+ break;
+ }
+ Colorize (new TextSpan (literal.SpanStart + i, closingIndex - i + 1), stringRegexComments);
+ i = closingIndex;
+ break;
+ }
+ Colorize (new TextSpan (literal.SpanStart + i, 2), stringRegexGroupingConstructs);
+ inGroup = true;
+ i++;
+ break;
+ }
+ Colorize (new TextSpan (literal.SpanStart + i, 1), stringRegexGroupingConstructs);
+ break;
+ case '<':
+ case '>':
+ if (inGroup) {
+ Colorize (new TextSpan (literal.SpanStart + i, 1), stringRegexGroupingConstructs);
+ }
+ break;
+ case ')':
+ inGroup = false;
+ Colorize (new TextSpan (literal.SpanStart + i, 1), stringRegexGroupingConstructs);
+ break;
+ }
+
+ }
+ }
+
+ bool IsInactiveConditional(ISymbol member)
+ {
+ if (member == null || member.Kind != SymbolKind.Method)
+ return false;
+ var method = member as IMethodSymbol;
+ if (method.ReturnType.SpecialType != SpecialType.System_Void)
+ return false;
+
+ var om = method.OverriddenMethod;
+ while (om != null) {
+ if (IsInactiveConditional (om.GetAttributes()))
+ return true;
+ om = om.OverriddenMethod;
+ }
+
+ return IsInactiveConditional(member.GetAttributes());
+ }
+
+ bool IsInactiveConditional(System.Collections.Immutable.ImmutableArray<AttributeData> attributes)
+ {
+ foreach (var attr in attributes) {
+ if (attr.AttributeClass.Name == "ConditionalAttribute" && attr.AttributeClass.ContainingNamespace.ToString() == "System.Diagnostics" && attr.ConstructorArguments.Length == 1) {
+ string symbol = attr.ConstructorArguments[0].Value as string;
+ if (symbol != null) {
+ var options = (CSharpParseOptions)semanticModel.SyntaxTree.Options;
+ if (!options.PreprocessorSymbolNames.Contains(symbol))
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ static bool IsEmptyPartialMethod(ISymbol member, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var method = member as IMethodSymbol;
+ if (method == null || method.IsDefinedInMetadata ())
+ return false;
+ foreach (var r in method.DeclaringSyntaxReferences) {
+ var node = r.GetSyntax (cancellationToken) as MethodDeclarationSyntax;
+ if (node == null)
+ continue;
+ if (node.Body != null || !node.Modifiers.Any(m => m.IsKind (SyntaxKind.PartialKeyword)))
+ return false;
+ }
+
+ return true;
+ }
+
+ public override void VisitExternAliasDirective(ExternAliasDirectiveSyntax node)
+ {
+ base.VisitExternAliasDirective(node);
+ Colorize (node.AliasKeyword.Span, externAliasKeywordColor);
+ }
+
+ public override void VisitGenericName(GenericNameSyntax node)
+ {
+ base.VisitGenericName(node);
+ var info = semanticModel.GetSymbolInfo(node, cancellationToken);
+ TColor color;
+ if (TryGetSymbolColor(info, out color)) {
+ Colorize(node.Identifier.Span, color);
+ }
+ }
+
+ public override void VisitStructDeclaration(Microsoft.CodeAnalysis.CSharp.Syntax.StructDeclarationSyntax node)
+ {
+ base.VisitStructDeclaration(node);
+ Colorize(node.Identifier, valueTypeColor);
+ }
+
+ public override void VisitInterfaceDeclaration(Microsoft.CodeAnalysis.CSharp.Syntax.InterfaceDeclarationSyntax node)
+ {
+ base.VisitInterfaceDeclaration(node);
+ Colorize(node.Identifier, interfaceTypeColor);
+ }
+
+ public override void VisitClassDeclaration(Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax node)
+ {
+ var symbol = semanticModel.GetDeclaredSymbol(node);
+ if (symbol != null && IsInactiveConditional (symbol)) {
+ Colorize (node, inactiveCodeColor);
+ } else {
+ base.VisitClassDeclaration (node);
+ Colorize (node.Identifier, referenceTypeColor);
+ }
+ }
+
+ public override void VisitEnumDeclaration(Microsoft.CodeAnalysis.CSharp.Syntax.EnumDeclarationSyntax node)
+ {
+ base.VisitEnumDeclaration(node);
+ Colorize(node.Identifier, enumerationTypeColor);
+ }
+
+ public override void VisitDelegateDeclaration(Microsoft.CodeAnalysis.CSharp.Syntax.DelegateDeclarationSyntax node)
+ {
+ base.VisitDelegateDeclaration(node);
+ Colorize(node.Identifier, delegateTypeColor);
+ }
+
+ public override void VisitTypeParameter(Microsoft.CodeAnalysis.CSharp.Syntax.TypeParameterSyntax node)
+ {
+ base.VisitTypeParameter(node);
+ Colorize(node.Identifier, typeParameterTypeColor);
+ }
+
+ public override void VisitEventDeclaration(Microsoft.CodeAnalysis.CSharp.Syntax.EventDeclarationSyntax node)
+ {
+ base.VisitEventDeclaration(node);
+ Colorize(node.Identifier, eventDeclarationColor);
+ }
+
+ public override void VisitMethodDeclaration(Microsoft.CodeAnalysis.CSharp.Syntax.MethodDeclarationSyntax node)
+ {
+ var symbol = semanticModel.GetDeclaredSymbol(node);
+ if (symbol != null && IsInactiveConditional (symbol)) {
+ Colorize (node, inactiveCodeColor);
+ } else {
+ base.VisitMethodDeclaration (node);
+ Colorize (node.Identifier, methodDeclarationColor);
+ }
+ }
+
+ public override void VisitPropertyDeclaration(Microsoft.CodeAnalysis.CSharp.Syntax.PropertyDeclarationSyntax node)
+ {
+ base.VisitPropertyDeclaration(node);
+ Colorize(node.Identifier, propertyDeclarationColor);
+ }
+
+ public override void VisitParameter(Microsoft.CodeAnalysis.CSharp.Syntax.ParameterSyntax node)
+ {
+ base.VisitParameter(node);
+ Colorize(node.Identifier, parameterDeclarationColor);
+ }
+
+ public override void VisitIdentifierName(Microsoft.CodeAnalysis.CSharp.Syntax.IdentifierNameSyntax node)
+ {
+ base.VisitIdentifierName(node);
+ if (node.IsVar) {
+ var symbolInfo = semanticModel.GetSymbolInfo(node, cancellationToken);
+ if (node.Parent is ForEachStatementSyntax) {
+ var sym = semanticModel.GetDeclaredSymbol(node.Parent, cancellationToken);
+ if (sym != null) {
+ Colorize(node.Span, varKeywordTypeColor);
+ return;
+ }
+ }
+ var vds = node.Parent as VariableDeclarationSyntax;
+ if (vds != null && vds.Variables.Count == 1) {
+ // var sym = vds.Variables[0].Initializer != null ? vds.Variables[0].Initializer.Value as LiteralExpressionSyntax : null;
+ if (symbolInfo.Symbol == null || symbolInfo.Symbol.Name != "var") {
+ Colorize(node.Span, varKeywordTypeColor);
+ return;
+ }
+ }
+ }
+
+ switch (node.Identifier.Text) {
+ case "add":
+ case "async":
+ case "await":
+ case "get":
+ case "partial":
+ case "remove":
+ case "set":
+ case "where":
+ case "yield":
+ case "from":
+ case "select":
+ case "group":
+ case "into":
+ case "orderby":
+ case "join":
+ case "let":
+ case "on":
+ case "equals":
+ case "by":
+ case "ascending":
+ case "descending":
+ case "dynamic":
+ // Reset color of contextual keyword to default if it's used as an identifier.
+ // Note that this method does not get called when 'var' or 'dynamic' is used as a type,
+ // because types get highlighted with valueTypeColor/referenceTypeColor instead.
+ Colorize(node.Span, defaultTextColor);
+ break;
+ case "global":
+// // Reset color of 'global' keyword to default unless its used as part of 'global::'.
+// MemberType parentMemberType = identifier.Parent as MemberType;
+// if (parentMemberType == null || !parentMemberType.IsDoubleColon)
+ Colorize(node.Span, defaultTextColor);
+ break;
+ }
+ // "value" is handled in VisitIdentifierExpression()
+ // "alias" is handled in VisitExternAliasDeclaration()
+
+ TColor color;
+ if (TryGetSymbolColor (semanticModel.GetSymbolInfo (node, cancellationToken), out color)) {
+ if (node.Parent is AttributeSyntax || node.Parent is QualifiedNameSyntax && node.Parent.Parent is AttributeSyntax)
+ color = referenceTypeColor;
+ Colorize (node.Span, color);
+ }
+ }
+
+ bool TryGetSymbolColor(SymbolInfo info, out TColor color)
+ {
+ var symbol = info.Symbol;
+
+ if (symbol == null) {
+ color = default(TColor);
+ return false;
+ }
+
+ switch (symbol.Kind) {
+ case SymbolKind.Field:
+ color = fieldAccessColor;
+ return true;
+ case SymbolKind.Event:
+ color = eventAccessColor;
+ return true;
+ case SymbolKind.Parameter:
+ var param = (IParameterSymbol)symbol;
+ var method = param.ContainingSymbol as IMethodSymbol;
+ if (param.Name == "value" && method != null && (
+ method.MethodKind == MethodKind.EventAdd ||
+ method.MethodKind == MethodKind.EventRaise ||
+ method.MethodKind == MethodKind.EventRemove ||
+ method.MethodKind == MethodKind.PropertySet)) {
+ color = valueKeywordColor;
+ } else {
+ color = parameterAccessColor;
+ }
+ return true;
+ case SymbolKind.RangeVariable:
+ color = variableAccessColor;
+ return true;
+ case SymbolKind.Method:
+ color = methodCallColor;
+ return true;
+ case SymbolKind.Property:
+ color = propertyAccessColor;
+ return true;
+ case SymbolKind.TypeParameter:
+ color = typeParameterTypeColor;
+ return true;
+ case SymbolKind.Local:
+ color = variableAccessColor;
+ return true;
+ case SymbolKind.NamedType:
+ var type = (INamedTypeSymbol)symbol;
+ switch (type.TypeKind) {
+ case TypeKind.Class:
+ color = referenceTypeColor;
+ break;
+ case TypeKind.Delegate:
+ color = delegateTypeColor;
+ break;
+ case TypeKind.Enum:
+ color = enumerationTypeColor;
+ break;
+ case TypeKind.Error:
+ color = default(TColor);
+ return false;
+ case TypeKind.Interface:
+ color = interfaceTypeColor;
+ break;
+ case TypeKind.Struct:
+ color = valueTypeColor;
+ break;
+ case TypeKind.TypeParameter:
+ color = typeParameterTypeColor;
+ break;
+ default:
+ color = referenceTypeColor;
+ break;
+ }
+ return true;
+ }
+ color = default(TColor);
+ return false;
+ }
+
+ public override void VisitVariableDeclaration(Microsoft.CodeAnalysis.CSharp.Syntax.VariableDeclarationSyntax node)
+ {
+ base.VisitVariableDeclaration(node);
+ TColor color;
+ if (node.Parent.IsKind(SyntaxKind.EventFieldDeclaration))
+ color = eventDeclarationColor;
+ else if (node.Parent.IsKind(SyntaxKind.FieldDeclaration))
+ color = fieldDeclarationColor;
+ else
+ color = variableDeclarationColor;
+
+ foreach (var declarations in node.Variables) {
+ // var info = semanticModel.GetTypeInfo(declarations, cancellationToken);
+ Colorize(declarations.Identifier, color);
+ }
+ }
+
+ public override void VisitTrivia (SyntaxTrivia trivia)
+ {
+ base.VisitTrivia (trivia);
+ if (trivia.IsKind (SyntaxKind.DisabledTextTrivia)) {
+ Colorize(trivia.Span, inactiveCodeColor);
+ }
+ }
+
+ int blockDepth;
+
+ public override void VisitBlock(Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax node)
+ {
+ blockDepth++;
+ cancellationToken.ThrowIfCancellationRequested ();
+ base.VisitBlock(node);
+ blockDepth--;
+ }
+
+ public override void VisitCatchFilterClause (CatchFilterClauseSyntax node)
+ {
+ if (!node.WhenKeyword.IsMissing) {
+ Colorize(node.WhenKeyword, whenKeywordColor);
+ }
+ base.VisitCatchFilterClause (node);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormatter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormatter.cs
index fd3d5506ed..106ee1e933 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormatter.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormatter.cs
@@ -27,19 +27,25 @@ using System;
using System.Collections.Generic;
-using Mono.TextEditor;
using MonoDevelop.CSharp.Formatting;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Projects.Policies;
using System.Linq;
using MonoDevelop.Ide.CodeFormatting;
-using ICSharpCode.NRefactory.CSharp;
using MonoDevelop.Core;
using MonoDevelop.CSharp.Refactoring;
+using MonoDevelop.Ide.Editor;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis.Formatting;
+using MonoDevelop.Ide.TypeSystem;
+using ICSharpCode.NRefactory6.CSharp;
+using MonoDevelop.Ide;
+using MonoDevelop.Core.Text;
namespace MonoDevelop.CSharp.Formatting
{
- class CSharpFormatter : AbstractAdvancedFormatter
+ class CSharpFormatter : AbstractCodeFormatter
{
static internal readonly string MimeType = "text/x-csharp";
@@ -47,110 +53,59 @@ namespace MonoDevelop.CSharp.Formatting
public override bool SupportsCorrectingIndent { get { return true; } }
- public override void CorrectIndenting (PolicyContainer policyParent, IEnumerable<string> mimeTypeChain,
- TextEditorData data, int line)
+ public override bool SupportsPartialDocumentFormatting { get { return true; } }
+
+ protected override void CorrectIndentingImplementation (PolicyContainer policyParent, TextEditor editor, int line)
{
- DocumentLine lineSegment = data.Document.GetLine (line);
+ var lineSegment = editor.GetLine (line);
if (lineSegment == null)
return;
try {
- var policy = policyParent.Get<CSharpFormattingPolicy> (mimeTypeChain);
- var tracker = new CSharpIndentEngine (data.Document, data.CreateNRefactoryTextEditorOptions (), policy.CreateOptions ());
+ var policy = policyParent.Get<CSharpFormattingPolicy> (MimeType);
+ var textpolicy = policyParent.Get<TextStylePolicy> (MimeType);
+ var tracker = new CSharpIndentEngine (policy.CreateOptions (textpolicy));
- tracker.Update (lineSegment.Offset);
+ tracker.Update (IdeApp.Workbench.ActiveDocument.Editor, lineSegment.Offset);
for (int i = lineSegment.Offset; i < lineSegment.Offset + lineSegment.Length; i++) {
- tracker.Push (data.Document.GetCharAt (i));
+ tracker.Push (editor.GetCharAt (i));
}
- string curIndent = lineSegment.GetIndentation (data.Document);
+ string curIndent = lineSegment.GetIndentation (editor);
int nlwsp = curIndent.Length;
- if (!tracker.LineBeganInsideMultiLineComment || (nlwsp < lineSegment.LengthIncludingDelimiter && data.Document.GetCharAt (lineSegment.Offset + nlwsp) == '*')) {
+ if (!tracker.LineBeganInsideMultiLineComment || (nlwsp < lineSegment.LengthIncludingDelimiter && editor.GetCharAt (lineSegment.Offset + nlwsp) == '*')) {
// Possibly replace the indent
string newIndent = tracker.ThisLineIndent;
if (newIndent != curIndent)
- data.Replace (lineSegment.Offset, nlwsp, newIndent);
+ editor.ReplaceText (lineSegment.Offset, nlwsp, newIndent);
}
} catch (Exception e) {
LoggingService.LogError ("Error while indenting", e);
}
}
- public override void OnTheFlyFormat (MonoDevelop.Ide.Gui.Document doc, int startOffset, int endOffset)
+ protected override void OnTheFlyFormatImplementation (TextEditor editor, DocumentContext context, int startOffset, int length)
{
- OnTheFlyFormatter.Format (doc, startOffset, endOffset);
+ OnTheFlyFormatter.Format (editor, context, startOffset, startOffset + length);
}
-
- public static string FormatText (CSharpFormattingPolicy policy, TextStylePolicy textPolicy, string mimeType, string input, int startOffset, int endOffset)
+ public static string FormatText (CSharpFormattingPolicy policy, TextStylePolicy textPolicy, string input, int startOffset, int endOffset)
{
- var data = new TextEditorData ();
- data.Document.SuppressHighlightUpdate = true;
- data.Document.MimeType = mimeType;
- data.Document.FileName = "toformat.cs";
- if (textPolicy != null) {
- data.Options.TabsToSpaces = textPolicy.TabsToSpaces;
- data.Options.TabSize = textPolicy.TabWidth;
- data.Options.IndentationSize = textPolicy.IndentWidth;
- data.Options.IndentStyle = textPolicy.RemoveTrailingWhitespace ? IndentStyle.Virtual : IndentStyle.Smart;
- }
- data.Text = input;
-
- // System.Console.WriteLine ("-----");
- // System.Console.WriteLine (data.Text.Replace (" ", ".").Replace ("\t", "->"));
- // System.Console.WriteLine ("-----");
-
- var parser = new CSharpParser ();
- var compilationUnit = parser.Parse (data);
- bool hadErrors = parser.HasErrors;
-
- if (hadErrors) {
- // foreach (var e in parser.ErrorReportPrinter.Errors)
- // Console.WriteLine (e.Message);
- return input.Substring (startOffset, Math.Max (0, Math.Min (endOffset, input.Length) - startOffset));
- }
-
- var originalVersion = data.Document.Version;
-
- var textEditorOptions = data.CreateNRefactoryTextEditorOptions ();
- var formattingVisitor = new ICSharpCode.NRefactory.CSharp.CSharpFormatter (
- policy.CreateOptions (),
- textEditorOptions
- ) {
- FormattingMode = FormattingMode.Intrusive
- };
-
- var changes = formattingVisitor.AnalyzeFormatting (data.Document, compilationUnit);
- try {
- changes.ApplyChanges (startOffset, endOffset - startOffset);
- } catch (Exception e) {
- LoggingService.LogError ("Error in code formatter", e);
- return input.Substring (startOffset, Math.Max (0, Math.Min (endOffset, input.Length) - startOffset));
- }
+ var inputTree = CSharpSyntaxTree.ParseText (input);
- // check if the formatter has produced errors
- parser = new CSharpParser ();
- parser.Parse (data);
- if (parser.HasErrors) {
- LoggingService.LogError ("C# formatter produced source code errors. See console for output.");
- return input.Substring (startOffset, Math.Max (0, Math.Min (endOffset, input.Length) - startOffset));
- }
-
- var currentVersion = data.Document.Version;
-
- string result = data.GetTextBetween (startOffset, originalVersion.MoveOffsetTo (currentVersion, endOffset));
- data.Dispose ();
- return result;
+ var root = inputTree.GetRoot ();
+ var doc = Formatter.Format (root, new TextSpan (startOffset, endOffset - startOffset), TypeSystemService.Workspace, policy.CreateOptions (textPolicy));
+ var result = doc.ToFullString ();
+ return result.Substring (startOffset, endOffset + result.Length - input.Length - startOffset);
}
- public override string FormatText (PolicyContainer policyParent, IEnumerable<string> mimeTypeChain, string input, int startOffset, int endOffset)
+ protected override ITextSource FormatImplementation (PolicyContainer policyParent, string mimeType, ITextSource input, int startOffset, int length)
{
- var policy = policyParent.Get<CSharpFormattingPolicy> (mimeTypeChain);
- var textPolicy = policyParent.Get<TextStylePolicy> (mimeTypeChain);
-
- return FormatText (policy, textPolicy, mimeTypeChain.First (), input, startOffset, endOffset);
+ var policy = policyParent.Get<CSharpFormattingPolicy> (mimeType);
+ var textPolicy = policyParent.Get<TextStylePolicy> (mimeType);
+ return new StringTextSource (FormatText (policy, textPolicy, input.Text, startOffset, startOffset + length));
}
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.cs
index e6d7a466f3..5d2f151199 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingPolicy.cs
@@ -32,14 +32,19 @@ using System.Xml;
using System.Text;
using System.Linq;
using MonoDevelop.Projects.Policies;
-using ICSharpCode.NRefactory.CSharp;
+using Microsoft.CodeAnalysis.Options;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide.Gui.Content;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.CSharp.Formatting
{
- [PolicyType ("C# formatting")]
- public class CSharpFormattingPolicy : IEquatable<CSharpFormattingPolicy>
+ [PolicyType ("C# formatting (roslyn)")]
+ public sealed class CSharpFormattingPolicy : IEquatable<CSharpFormattingPolicy>
{
- readonly CSharpFormattingOptions options = FormattingOptionsFactory.CreateMono ();
+ OptionSet options;
public string Name {
get;
@@ -53,1602 +58,542 @@ namespace MonoDevelop.CSharp.Formatting
public CSharpFormattingPolicy Clone ()
{
- return new CSharpFormattingPolicy (options.Clone ());
+ return new CSharpFormattingPolicy (options);
}
- public CSharpFormattingOptions CreateOptions ()
+ public static OptionSet Apply (OptionSet options, TextStylePolicy policy)
{
- return options;
- }
-
- static CSharpFormattingPolicy ()
- {
- if (!PolicyService.InvariantPolicies.ReadOnly)
- PolicyService.InvariantPolicies.Set<CSharpFormattingPolicy> (new CSharpFormattingPolicy (), "text/x-csharp");
- }
-
- protected CSharpFormattingPolicy (CSharpFormattingOptions options)
- {
- this.options = options;
- }
-
-
- #region Indentation
- [ItemProperty]
- public bool IndentNamespaceBody {
- get {
- return options.IndentNamespaceBody;
- }
- set {
- options.IndentNamespaceBody = value;
- }
- }
-
- [ItemProperty]
- public bool IndentClassBody {
- get {
- return options.IndentClassBody;
- }
- set {
- options.IndentClassBody = value;
- }
- }
-
- [ItemProperty]
- public bool IndentInterfaceBody {
- get {
- return options.IndentInterfaceBody;
- }
- set {
- options.IndentInterfaceBody = value;
- }
- }
-
- [ItemProperty]
- public bool IndentStructBody {
- get {
- return options.IndentStructBody;
- }
- set {
- options.IndentStructBody = value;
- }
- }
-
- [ItemProperty]
- public bool IndentEnumBody {
- get {
- return options.IndentEnumBody;
- }
- set {
- options.IndentEnumBody = value;
- }
- }
-
- [ItemProperty]
- public bool IndentMethodBody {
- get {
- return options.IndentMethodBody;
- }
- set {
- options.IndentMethodBody = value;
- }
- }
-
- [ItemProperty]
- public bool IndentPropertyBody {
- get {
- return options.IndentPropertyBody;
- }
- set {
- options.IndentPropertyBody = value;
- }
- }
-
- [ItemProperty]
- public bool IndentEventBody {
- get {
- return options.IndentEventBody;
- }
- set {
- options.IndentEventBody = value;
- }
- }
-
- [ItemProperty]
- public bool IndentBlocks {
- get {
- return options.IndentBlocks;
- }
- set {
- options.IndentBlocks = value;
- }
- }
-
- [ItemProperty]
- public bool IndentSwitchBody {
- get {
- return options.IndentSwitchBody;
- }
- set {
- options.IndentSwitchBody = value;
- }
- }
-
- [ItemProperty]
- public bool IndentCaseBody {
- get {
- return options.IndentCaseBody;
- }
- set {
- options.IndentCaseBody = value;
- }
- }
-
- [ItemProperty]
- public bool IndentBreakStatements {
- get {
- return options.IndentBreakStatements;
- }
- set {
- options.IndentBreakStatements = value;
+ var result = options;
+ if (policy != null) {
+ result = result.WithChangedOption (Microsoft.CodeAnalysis.Formatting.FormattingOptions.IndentationSize, LanguageNames.CSharp, policy.IndentWidth);
+ result = result.WithChangedOption (Microsoft.CodeAnalysis.Formatting.FormattingOptions.NewLine, LanguageNames.CSharp, policy.GetEolMarker ());
+ result = result.WithChangedOption (Microsoft.CodeAnalysis.Formatting.FormattingOptions.SmartIndent, LanguageNames.CSharp, FormattingOptions.IndentStyle.Smart);
+ result = result.WithChangedOption (Microsoft.CodeAnalysis.Formatting.FormattingOptions.TabSize, LanguageNames.CSharp, policy.TabWidth);
+ result = result.WithChangedOption (Microsoft.CodeAnalysis.Formatting.FormattingOptions.UseTabs, LanguageNames.CSharp, !policy.TabsToSpaces);
}
+ return result;
}
- [ItemProperty]
- public bool IndentBlocksInsideExpressions {
- get {
- return options.IndentBlocksInsideExpressions;
- }
- set {
- options.IndentBlocksInsideExpressions = value;
- }
- }
-
- [ItemProperty]
- public bool AlignEmbeddedStatements {
- get {
- return options.AlignEmbeddedStatements;
- }
- set {
- options.AlignEmbeddedStatements = value;
+ public static OptionSet Apply (OptionSet options, ITextEditorOptions policy)
+ {
+ var result = options;
+ if (policy != null) {
+ result = result.WithChangedOption (Microsoft.CodeAnalysis.Formatting.FormattingOptions.IndentationSize, LanguageNames.CSharp, policy.IndentationSize);
+ result = result.WithChangedOption (Microsoft.CodeAnalysis.Formatting.FormattingOptions.NewLine, LanguageNames.CSharp, policy.DefaultEolMarker);
+ result = result.WithChangedOption (Microsoft.CodeAnalysis.Formatting.FormattingOptions.SmartIndent, LanguageNames.CSharp, FormattingOptions.IndentStyle.Smart);
+ result = result.WithChangedOption (Microsoft.CodeAnalysis.Formatting.FormattingOptions.TabSize, LanguageNames.CSharp, policy.TabSize);
+ result = result.WithChangedOption (Microsoft.CodeAnalysis.Formatting.FormattingOptions.UseTabs, LanguageNames.CSharp, !policy.TabsToSpaces);
}
+ return result;
}
- [ItemProperty]
- public PropertyFormatting SimplePropertyFormatting {
- get {
- return options.SimplePropertyFormatting;
- }
- set {
- options.SimplePropertyFormatting = value;
- }
+ public OptionSet CreateOptions (TextStylePolicy policy)
+ {
+ return Apply (options, policy);
}
- [ItemProperty]
- public PropertyFormatting AutoPropertyFormatting {
- get {
- return options.AutoPropertyFormatting;
- }
- set {
- options.AutoPropertyFormatting = value;
- }
+ public OptionSet CreateOptions (ITextEditorOptions policy)
+ {
+ return Apply (options, policy);
}
- [ItemProperty]
- public bool IndentPreprocessorDirectives {
- get {
- return options.IndentPreprocessorDirectives;
- }
- set {
- options.IndentPreprocessorDirectives = value;
- }
- }
- #endregion
-
- #region Braces
- [ItemProperty]
- public BraceStyle NamespaceBraceStyle {
- get {
- return options.NamespaceBraceStyle;
- }
- set {
- options.NamespaceBraceStyle = value;
- }
- }
-
- [ItemProperty]
- public BraceStyle ClassBraceStyle {
- get {
- return options.ClassBraceStyle;
- }
- set {
- options.ClassBraceStyle = value;
- }
- }
-
- [ItemProperty]
- public BraceStyle InterfaceBraceStyle {
- get {
- return options.InterfaceBraceStyle;
- }
- set {
- options.InterfaceBraceStyle = value;
- }
- }
-
- [ItemProperty]
- public BraceStyle StructBraceStyle {
- get {
- return options.StructBraceStyle;
- }
- set {
- options.StructBraceStyle = value;
- }
- }
-
- [ItemProperty]
- public BraceStyle EnumBraceStyle {
- get {
- return options.EnumBraceStyle;
- }
- set {
- options.EnumBraceStyle = value;
- }
- }
-
- [ItemProperty]
- public BraceStyle MethodBraceStyle {
- get {
- return options.MethodBraceStyle;
- }
- set {
- options.MethodBraceStyle = value;
- }
- }
-
- [ItemProperty]
- public BraceStyle AnonymousMethodBraceStyle {
- get {
- return options.AnonymousMethodBraceStyle;
- }
- set {
- options.AnonymousMethodBraceStyle = value;
- }
- }
-
- [ItemProperty]
- public BraceStyle ConstructorBraceStyle {
- get {
- return options.ConstructorBraceStyle;
- }
- set {
- options.ConstructorBraceStyle = value;
- }
- }
-
- [ItemProperty]
- public BraceStyle DestructorBraceStyle {
- get {
- return options.DestructorBraceStyle;
- }
- set {
- options.DestructorBraceStyle = value;
- }
- }
-
- [ItemProperty]
- public BraceStyle PropertyBraceStyle {
- get {
- return options.PropertyBraceStyle;
- }
- set {
- options.PropertyBraceStyle = value;
- }
- }
-
- [ItemProperty]
- public BraceStyle PropertyGetBraceStyle {
- get {
- return options.PropertyGetBraceStyle;
- }
- set {
- options.PropertyGetBraceStyle = value;
- }
+ static CSharpFormattingPolicy ()
+ {
+ if (!PolicyService.InvariantPolicies.ReadOnly)
+ PolicyService.InvariantPolicies.Set<CSharpFormattingPolicy> (new CSharpFormattingPolicy (), "text/x-csharp");
}
- [ItemProperty]
- public BraceStyle PropertySetBraceStyle {
- get {
- return options.PropertySetBraceStyle;
- }
- set {
- options.PropertySetBraceStyle = value;
- }
+ public CSharpFormattingPolicy (OptionSet options)
+ {
+ if (options == null)
+ throw new ArgumentNullException ("options");
+ this.options = options;
}
+ #region Indent options
[ItemProperty]
- public PropertyFormatting SimpleGetBlockFormatting {
+ public bool IndentBlock {
get {
- return options.SimpleGetBlockFormatting;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.IndentBlock);
}
set {
- options.SimpleGetBlockFormatting = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.IndentBlock, value);
}
}
[ItemProperty]
- public PropertyFormatting SimpleSetBlockFormatting {
- get {
-
- return options.SimpleSetBlockFormatting;
- }
- set {
- options.SimpleSetBlockFormatting = value;
- }
- }
-
- [ItemProperty]
- public BraceStyle EventBraceStyle {
+ public bool IndentBraces {
get {
- return options.EventBraceStyle;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.IndentBraces);
}
set {
- options.EventBraceStyle = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.IndentBraces, value);
}
}
-
- [ItemProperty]
- public BraceStyle EventAddBraceStyle {
- get {
- return options.EventAddBraceStyle;
- }
- set {
- options.EventAddBraceStyle = value;
- }
- }
-
- [ItemProperty]
- public BraceStyle EventRemoveBraceStyle {
- get {
- return options.EventRemoveBraceStyle;
- }
- set {
- options.EventRemoveBraceStyle = value;
- }
- }
-
- [ItemProperty]
- public bool AllowEventAddBlockInline {
- get {
- return options.AllowEventAddBlockInline;
- }
- set {
- options.AllowEventAddBlockInline = value;
- }
- }
-
+
[ItemProperty]
- public bool AllowEventRemoveBlockInline {
+ public bool IndentSwitchSection {
get {
- return options.AllowEventRemoveBlockInline;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.IndentSwitchSection);
}
set {
- options.AllowEventRemoveBlockInline = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.IndentSwitchSection, value);
}
}
-
+
[ItemProperty]
- public BraceStyle StatementBraceStyle {
+ public bool IndentSwitchCaseSection {
get {
- return options.StatementBraceStyle;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.IndentSwitchCaseSection);
}
set {
- options.StatementBraceStyle = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.IndentSwitchCaseSection, value);
}
}
-
+
[ItemProperty]
- public bool AllowIfBlockInline {
+ public Microsoft.CodeAnalysis.CSharp.Formatting.LabelPositionOptions LabelPositioning {
get {
- return options.AllowIfBlockInline;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.LabelPositioning);
}
set {
- options.AllowIfBlockInline = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.LabelPositioning, value);
}
}
-
#endregion
- #region NewLines
- [ItemProperty]
- public NewLinePlacement ElseNewLinePlacement {
- get {
- return options.ElseNewLinePlacement;
- }
- set {
- options.ElseNewLinePlacement = value;
- }
- }
-
- [ItemProperty]
- public NewLinePlacement ElseIfNewLinePlacement {
- get {
- return options.ElseIfNewLinePlacement;
- }
- set {
- options.ElseIfNewLinePlacement = value;
- }
- }
-
- [ItemProperty]
- public NewLinePlacement CatchNewLinePlacement {
- get {
- return options.CatchNewLinePlacement;
- }
- set {
- options.CatchNewLinePlacement = value;
- }
- }
-
- [ItemProperty]
- public NewLinePlacement FinallyNewLinePlacement {
- get {
- return options.FinallyNewLinePlacement;
- }
- set {
- options.FinallyNewLinePlacement = value;
- }
- }
-
+ #region New line options
+
[ItemProperty]
- public NewLinePlacement WhileNewLinePlacement {
+ public bool NewLinesForBracesInTypes {
get {
- return options.WhileNewLinePlacement;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLinesForBracesInTypes);
}
set {
- options.WhileNewLinePlacement = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLinesForBracesInTypes, value);
}
}
[ItemProperty]
- public NewLinePlacement EmbeddedStatementPlacement {
+ public bool NewLinesForBracesInMethods {
get {
- return options.EmbeddedStatementPlacement;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLinesForBracesInMethods);
}
set {
- options.EmbeddedStatementPlacement = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLinesForBracesInMethods, value);
}
}
-
[ItemProperty]
- public Wrapping ArrayInitializerWrapping {
+ public bool NewLinesForBracesInProperties {
get {
- return options.ArrayInitializerWrapping;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLinesForBracesInProperties);
}
set {
- options.ArrayInitializerWrapping = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLinesForBracesInProperties, value);
}
}
- [ItemProperty]
- public BraceStyle ArrayInitializerBraceStyle {
- get {
- return options.ArrayInitializerBraceStyle;
- }
- set {
- options.ArrayInitializerBraceStyle = value;
- }
- }
[ItemProperty]
- public bool KeepCommentsAtFirstColumn {
+ public bool NewLinesForBracesInAccessors {
get {
- return options.KeepCommentsAtFirstColumn;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLinesForBracesInAccessors);
}
set {
- options.KeepCommentsAtFirstColumn = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLinesForBracesInAccessors, value);
}
}
- #endregion
-
- #region Spaces
- // Methods
[ItemProperty]
- public bool BeforeMethodDeclarationParentheses {
+ public bool NewLinesForBracesInAnonymousMethods {
get {
- return options.SpaceBeforeMethodDeclarationParentheses;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLinesForBracesInAnonymousMethods);
}
set {
- options.SpaceBeforeMethodDeclarationParentheses = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLinesForBracesInAnonymousMethods, value);
}
}
-
+
[ItemProperty]
- public bool BetweenEmptyMethodDeclarationParentheses {
+ public bool NewLinesForBracesInControlBlocks {
get {
- return options.SpaceBetweenEmptyMethodDeclarationParentheses;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLinesForBracesInControlBlocks);
}
set {
- options.SpaceBetweenEmptyMethodDeclarationParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool BeforeMethodDeclarationParameterComma {
- get {
- return options.SpaceBeforeMethodDeclarationParameterComma;
- }
- set {
- options.SpaceBeforeMethodDeclarationParameterComma = value;
- }
- }
-
- [ItemProperty]
- public bool AfterMethodDeclarationParameterComma {
- get {
- return options.SpaceAfterMethodDeclarationParameterComma;
- }
- set {
- options.SpaceAfterMethodDeclarationParameterComma = value;
- }
- }
-
- [ItemProperty]
- public bool WithinMethodDeclarationParentheses {
- get {
- return options.SpaceWithinMethodDeclarationParentheses;
- }
- set {
- options.SpaceWithinMethodDeclarationParentheses = value;
- }
- }
-
- // Method calls
- [ItemProperty]
- public bool BeforeMethodCallParentheses {
- get {
- return options.SpaceBeforeMethodCallParentheses;
- }
- set {
- options.SpaceBeforeMethodCallParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool BetweenEmptyMethodCallParentheses {
- get {
- return options.SpaceBetweenEmptyMethodCallParentheses;
- }
- set {
- options.SpaceBetweenEmptyMethodCallParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool BeforeMethodCallParameterComma {
- get {
- return options.SpaceBeforeMethodCallParameterComma;
- }
- set {
- options.SpaceBeforeMethodCallParameterComma = value;
- }
- }
-
- [ItemProperty]
- public bool AfterMethodCallParameterComma {
- get {
- return options.SpaceAfterMethodCallParameterComma;
- }
- set {
- options.SpaceAfterMethodCallParameterComma = value;
- }
- }
-
- [ItemProperty]
- public bool WithinMethodCallParentheses {
- get {
- return options.SpaceWithinMethodCallParentheses;
- }
- set {
- options.SpaceWithinMethodCallParentheses = value;
- }
- }
-
- // fields
-
- [ItemProperty]
- public bool BeforeFieldDeclarationComma {
- get {
- return options.SpaceBeforeFieldDeclarationComma;
- }
- set {
- options.SpaceBeforeFieldDeclarationComma = value;
- }
- }
-
- [ItemProperty]
- public bool AfterFieldDeclarationComma {
- get {
- return options.SpaceAfterFieldDeclarationComma;
- }
- set {
- options.SpaceAfterFieldDeclarationComma = value;
- }
- }
-
- // local variables
-
- [ItemProperty]
- public bool BeforeLocalVariableDeclarationComma {
- get {
- return options.SpaceBeforeLocalVariableDeclarationComma;
- }
- set {
- options.SpaceBeforeLocalVariableDeclarationComma = value;
- }
- }
-
- [ItemProperty]
- public bool AfterLocalVariableDeclarationComma {
- get {
- return options.SpaceAfterLocalVariableDeclarationComma;
- }
- set {
- options.SpaceAfterLocalVariableDeclarationComma = value;
- }
- }
-
- // constructors
-
- [ItemProperty]
- public bool BeforeConstructorDeclarationParentheses {
- get {
- return options.SpaceBeforeConstructorDeclarationParentheses;
- }
- set {
- options.SpaceBeforeConstructorDeclarationParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool BetweenEmptyConstructorDeclarationParentheses {
- get {
- return options.SpaceBetweenEmptyConstructorDeclarationParentheses;
- }
- set {
- options.SpaceBetweenEmptyConstructorDeclarationParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool BeforeConstructorDeclarationParameterComma {
- get {
- return options.SpaceBeforeConstructorDeclarationParameterComma;
- }
- set {
- options.SpaceBeforeConstructorDeclarationParameterComma = value;
- }
- }
-
- [ItemProperty]
- public bool AfterConstructorDeclarationParameterComma {
- get {
- return options.SpaceAfterConstructorDeclarationParameterComma;
- }
- set {
- options.SpaceAfterConstructorDeclarationParameterComma = value;
- }
- }
-
- [ItemProperty]
- public bool WithinConstructorDeclarationParentheses {
- get {
- return options.SpaceWithinConstructorDeclarationParentheses;
- }
- set {
- options.SpaceWithinConstructorDeclarationParentheses = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLinesForBracesInControlBlocks, value);
}
}
[ItemProperty]
- public NewLinePlacement NewLineBeforeConstructorInitializerColon {
+ public bool NewLinesForBracesInAnonymousTypes {
get {
- return options.NewLineBeforeConstructorInitializerColon;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLinesForBracesInAnonymousTypes);
}
set {
- options.NewLineBeforeConstructorInitializerColon = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLinesForBracesInAnonymousTypes, value);
}
}
[ItemProperty]
- public NewLinePlacement NewLineAfterConstructorInitializerColon {
+ public bool NewLinesForBracesInObjectCollectionArrayInitializers {
get {
- return options.NewLineAfterConstructorInitializerColon;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLinesForBracesInObjectCollectionArrayInitializers);
}
set {
- options.NewLineAfterConstructorInitializerColon = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLinesForBracesInObjectCollectionArrayInitializers, value);
}
}
- // indexer
- [ItemProperty]
- public bool BeforeIndexerDeclarationBracket {
- get {
- return options.SpaceBeforeIndexerDeclarationBracket;
- }
- set {
- options.SpaceBeforeIndexerDeclarationBracket = value;
- }
- }
-
- [ItemProperty]
- public bool WithinIndexerDeclarationBracket {
- get {
- return options.SpaceWithinIndexerDeclarationBracket;
- }
- set {
- options.SpaceWithinIndexerDeclarationBracket = value;
- }
- }
-
- [ItemProperty]
- public bool BeforeIndexerDeclarationParameterComma {
- get {
- return options.SpaceBeforeIndexerDeclarationParameterComma;
- }
- set {
- options.SpaceBeforeIndexerDeclarationParameterComma = value;
- }
- }
-
- [ItemProperty]
- public bool AfterIndexerDeclarationParameterComma {
- get {
- return options.SpaceAfterIndexerDeclarationParameterComma;
- }
- set {
- options.SpaceAfterIndexerDeclarationParameterComma = value;
- }
- }
-
- // delegates
-
- [ItemProperty]
- public bool BeforeDelegateDeclarationParentheses {
- get {
- return options.SpaceBeforeDelegateDeclarationParentheses;
- }
- set {
- options.SpaceBeforeDelegateDeclarationParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool BetweenEmptyDelegateDeclarationParentheses {
- get {
- return options.SpaceBetweenEmptyDelegateDeclarationParentheses;
- }
- set {
- options.SpaceBetweenEmptyDelegateDeclarationParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool BeforeDelegateDeclarationParameterComma {
- get {
- return options.SpaceBeforeDelegateDeclarationParameterComma;
- }
- set {
- options.SpaceBeforeDelegateDeclarationParameterComma = value;
- }
- }
-
- [ItemProperty]
- public bool AfterDelegateDeclarationParameterComma {
- get {
- return options.SpaceAfterDelegateDeclarationParameterComma;
- }
- set {
- options.SpaceAfterDelegateDeclarationParameterComma = value;
- }
- }
-
- [ItemProperty]
- public bool WithinDelegateDeclarationParentheses {
- get {
- return options.SpaceWithinDelegateDeclarationParentheses;
- }
- set {
- options.SpaceWithinDelegateDeclarationParentheses = value;
- }
- }
-
-
[ItemProperty]
- public bool NewParentheses {
+ public bool NewLinesForBracesInLambdaExpressionBody {
get {
- return options.SpaceBeforeNewParentheses;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLinesForBracesInLambdaExpressionBody);
}
set {
- options.SpaceBeforeNewParentheses = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLinesForBracesInLambdaExpressionBody, value);
}
}
-
- [ItemProperty]
- public bool IfParentheses {
- get {
- return options.SpaceBeforeIfParentheses;
- }
- set {
- options.SpaceBeforeIfParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool WhileParentheses {
- get {
- return options.SpaceBeforeWhileParentheses;
- }
- set {
- options.SpaceBeforeWhileParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool ForParentheses {
- get {
- return options.SpaceBeforeForParentheses;
- }
- set {
- options.SpaceBeforeForParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool ForeachParentheses {
- get {
- return options.SpaceBeforeForeachParentheses;
- }
- set {
- options.SpaceBeforeForeachParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool CatchParentheses {
- get {
- return options.SpaceBeforeCatchParentheses;
- }
- set {
- options.SpaceBeforeCatchParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool SwitchParentheses {
- get {
- return options.SpaceBeforeSwitchParentheses;
- }
- set {
- options.SpaceBeforeSwitchParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool LockParentheses {
- get {
- return options.SpaceBeforeLockParentheses;
- }
- set {
- options.SpaceBeforeLockParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool UsingParentheses {
- get {
- return options.SpaceBeforeUsingParentheses;
- }
- set {
- options.SpaceBeforeUsingParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool AroundAssignmentParentheses {
- get {
- return options.SpaceAroundAssignment;
- }
- set {
- options.SpaceAroundAssignment = value;
- }
- }
-
- [ItemProperty]
- public bool AroundLogicalOperatorParentheses {
- get {
- return options.SpaceAroundLogicalOperator;
- }
- set {
- options.SpaceAroundLogicalOperator = value;
- }
- }
-
- [ItemProperty]
- public bool AroundEqualityOperatorParentheses {
- get {
- return options.SpaceAroundEqualityOperator;
- }
- set {
- options.SpaceAroundEqualityOperator = value;
- }
- }
-
- [ItemProperty]
- public bool AroundRelationalOperatorParentheses {
- get {
- return options.SpaceAroundRelationalOperator;
- }
- set {
- options.SpaceAroundRelationalOperator = value;
- }
- }
-
+
[ItemProperty]
- public bool AroundBitwiseOperatorParentheses {
+ public bool NewLineForElse {
get {
- return options.SpaceAroundBitwiseOperator;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLineForElse);
}
set {
- options.SpaceAroundBitwiseOperator = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLineForElse, value);
}
}
-
+
[ItemProperty]
- public bool AroundAdditiveOperatorParentheses {
+ public bool NewLineForCatch {
get {
- return options.SpaceAroundAdditiveOperator;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLineForCatch);
}
set {
- options.SpaceAroundAdditiveOperator = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLineForCatch, value);
}
}
-
+
[ItemProperty]
- public bool AroundMultiplicativeOperatorParentheses {
+ public bool NewLineForFinally {
get {
- return options.SpaceAroundMultiplicativeOperator;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLineForFinally);
}
set {
- options.SpaceAroundMultiplicativeOperator = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLineForFinally, value);
}
}
-
+
[ItemProperty]
- public bool AroundShiftOperatorParentheses {
+ public bool NewLineForMembersInObjectInit {
get {
- return options.SpaceAroundShiftOperator;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLineForMembersInObjectInit);
}
set {
- options.SpaceAroundShiftOperator = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLineForMembersInObjectInit, value);
}
}
-
+
[ItemProperty]
- public bool AroundNullCoalescingOperator {
+ public bool NewLineForMembersInAnonymousTypes {
get {
- return options.SpaceAroundNullCoalescingOperator;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLineForMembersInAnonymousTypes);
}
set {
- options.SpaceAroundNullCoalescingOperator = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLineForMembersInAnonymousTypes, value);
}
}
[ItemProperty]
- public bool SpaceAfterUnsafeAddressOfOperator {
+ public bool NewLineForClausesInQuery {
get {
- return options.SpaceAfterUnsafeAddressOfOperator;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLineForClausesInQuery);
}
set {
- options.SpaceAfterUnsafeAddressOfOperator = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.NewLineForClausesInQuery, value);
}
}
+ #endregion
+ #region Spacing options
[ItemProperty]
- public bool SpaceAfterUnsafeAsteriskOfOperator {
+ public bool SpacingAfterMethodDeclarationName {
get {
- return options.SpaceAfterUnsafeAsteriskOfOperator;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpacingAfterMethodDeclarationName);
}
set {
- options.SpaceAfterUnsafeAsteriskOfOperator = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpacingAfterMethodDeclarationName, value);
}
}
[ItemProperty]
- public bool SpaceAroundUnsafeArrowOperator {
+ public bool SpaceWithinMethodDeclarationParenthesis {
get {
- return options.SpaceAroundUnsafeArrowOperator;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceWithinMethodDeclarationParenthesis);
}
set {
- options.SpaceAroundUnsafeArrowOperator = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceWithinMethodDeclarationParenthesis, value);
}
}
[ItemProperty]
- public bool WithinParentheses {
- get {
- return options.SpacesWithinParentheses;
- }
- set {
- options.SpacesWithinParentheses = value;
- }
- }
-
-
- [ItemProperty]
- public bool WithinIfParentheses {
- get {
- return options.SpacesWithinIfParentheses;
- }
- set {
- options.SpacesWithinIfParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool WithinWhileParentheses {
- get {
- return options.SpacesWithinWhileParentheses;
- }
- set {
- options.SpacesWithinWhileParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool WithinForParentheses {
- get {
- return options.SpacesWithinForParentheses;
- }
- set {
- options.SpacesWithinForParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool WithinForEachParentheses {
- get {
- return options.SpacesWithinForeachParentheses;
- }
- set {
- options.SpacesWithinForeachParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool WithinCatchParentheses {
- get {
- return options.SpacesWithinCatchParentheses;
- }
- set {
- options.SpacesWithinCatchParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool WithinSwitchParentheses {
- get {
- return options.SpacesWithinSwitchParentheses;
- }
- set {
- options.SpacesWithinSwitchParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool WithinLockParentheses {
- get {
- return options.SpacesWithinLockParentheses;
- }
- set {
- options.SpacesWithinLockParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool WithinUsingParentheses {
- get {
- return options.SpacesWithinUsingParentheses;
- }
- set {
- options.SpacesWithinUsingParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool WithinCastParentheses {
- get {
- return options.SpacesWithinCastParentheses;
- }
- set {
- options.SpacesWithinCastParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool WithinSizeOfParentheses {
- get {
- return options.SpacesWithinSizeOfParentheses;
- }
- set {
- options.SpacesWithinSizeOfParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool BeforeSizeOfParentheses {
- get {
- return options.SpaceBeforeSizeOfParentheses;
- }
- set {
- options.SpaceBeforeSizeOfParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool WithinTypeOfParentheses {
- get {
- return options.SpacesWithinTypeOfParentheses;
- }
- set {
- options.SpacesWithinTypeOfParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool WithinNewParentheses {
+ public bool SpaceBetweenEmptyMethodDeclarationParentheses {
get {
- return options.SpacesWithinNewParentheses;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceBetweenEmptyMethodDeclarationParentheses);
}
set {
- options.SpacesWithinNewParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool BetweenEmptyNewParentheses {
- get {
- return options.SpacesBetweenEmptyNewParentheses;
- }
- set {
- options.SpacesBetweenEmptyNewParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool BeforeNewParameterComma {
- get {
- return options.SpaceBeforeNewParameterComma;
- }
- set {
- options.SpaceBeforeNewParameterComma = value;
- }
- }
-
- [ItemProperty]
- public bool AfterNewParameterComma {
- get {
- return options.SpaceAfterNewParameterComma;
- }
- set {
- options.SpaceAfterNewParameterComma = value;
- }
- }
-
- [ItemProperty]
- public bool BeforeTypeOfParentheses {
- get {
- return options.SpaceBeforeTypeOfParentheses;
- }
- set {
- options.SpaceBeforeTypeOfParentheses = value;
- }
- }
-
- [ItemProperty]
- public bool WithinCheckedExpressionParantheses {
- get {
- return options.SpacesWithinCheckedExpressionParantheses;
- }
- set {
- options.SpacesWithinCheckedExpressionParantheses = value;
- }
- }
-
- [ItemProperty]
- public bool ConditionalOperatorBeforeConditionSpace {
- get {
- return options.SpaceBeforeConditionalOperatorCondition;
- }
- set {
- options.SpaceBeforeConditionalOperatorCondition = value;
- }
- }
-
- [ItemProperty]
- public bool ConditionalOperatorAfterConditionSpace {
- get {
- return options.SpaceAfterConditionalOperatorCondition;
- }
- set {
- options.SpaceAfterConditionalOperatorCondition = value;
- }
- }
-
- [ItemProperty]
- public bool ConditionalOperatorBeforeSeparatorSpace {
- get {
- return options.SpaceBeforeConditionalOperatorSeparator;
- }
- set {
- options.SpaceBeforeConditionalOperatorSeparator = value;
- }
- }
-
- [ItemProperty]
- public bool ConditionalOperatorAfterSeparatorSpace {
- get {
- return options.SpaceAfterConditionalOperatorSeparator;
- }
- set {
- options.SpaceAfterConditionalOperatorSeparator = value;
- }
- }
-
- // brackets
- [ItemProperty]
- public bool SpacesWithinBrackets {
- get {
- return options.SpacesWithinBrackets;
- }
- set {
- options.SpacesWithinBrackets = value;
- }
- }
- [ItemProperty]
- public bool SpacesBeforeBrackets {
- get {
- return options.SpacesBeforeBrackets;
- }
- set {
- options.SpacesBeforeBrackets = value;
- }
- }
- [ItemProperty]
- public bool BeforeBracketComma {
- get {
- return options.SpaceBeforeBracketComma;
- }
- set {
- options.SpaceBeforeBracketComma = value;
- }
- }
- [ItemProperty]
- public bool AfterBracketComma {
- get {
- return options.SpaceAfterBracketComma;
- }
- set {
- options.SpaceAfterBracketComma = value;
- }
- }
-
-
- [ItemProperty]
- public bool SpacesBeforeForSemicolon {
- get {
- return options.SpaceBeforeForSemicolon;
- }
- set {
- options.SpaceBeforeForSemicolon = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceBetweenEmptyMethodDeclarationParentheses, value);
}
}
[ItemProperty]
- public bool SpaceBeforeSemicolon {
+ public bool SpaceAfterMethodCallName {
get {
- return options.SpaceBeforeSemicolon;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceAfterMethodCallName);
}
set {
- options.SpaceBeforeSemicolon = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceAfterMethodCallName, value);
}
}
-
- [ItemProperty]
- public bool SpacesAfterForSemicolon {
- get {
- return options.SpaceAfterForSemicolon;
- }
- set {
- options.SpaceAfterForSemicolon = value;
- }
- }
-
- [ItemProperty]
- public bool SpacesAfterTypecast {
- get {
- return options.SpaceAfterTypecast;
- }
- set {
- options.SpaceAfterTypecast = value;
- }
- }
-
- [ItemProperty]
- public bool SpacesBeforeArrayDeclarationBrackets {
- get {
- return options.SpaceBeforeArrayDeclarationBrackets;
- }
- set {
- options.SpaceBeforeArrayDeclarationBrackets = value;
- }
- }
- #endregion
-
- #region Blank Lines
- [ItemProperty]
- public int BlankLinesBeforeUsings {
- get {
- return options.MinimumBlankLinesBeforeUsings;
- }
- set {
- options.MinimumBlankLinesBeforeUsings = value;
- }
- }
-
- [ItemProperty]
- public int BlankLinesAfterUsings {
- get {
- return options.MinimumBlankLinesAfterUsings;
- }
- set {
- options.MinimumBlankLinesAfterUsings = value;
- }
- }
-
+
[ItemProperty]
- public int BlankLinesBeforeFirstDeclaration {
+ public bool SpaceWithinMethodCallParentheses {
get {
- return options.MinimumBlankLinesBeforeFirstDeclaration;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceWithinMethodCallParentheses);
}
set {
- options.MinimumBlankLinesBeforeFirstDeclaration = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceWithinMethodCallParentheses, value);
}
}
-
+
[ItemProperty]
- public int BlankLinesBetweenTypes {
+ public bool SpaceBetweenEmptyMethodCallParentheses {
get {
- return options.MinimumBlankLinesBetweenTypes;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceBetweenEmptyMethodCallParentheses);
}
set {
- options.MinimumBlankLinesBetweenTypes = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceBetweenEmptyMethodCallParentheses, value);
}
}
-
+
[ItemProperty]
- public int BlankLinesBetweenFields {
+ public bool SpaceAfterControlFlowStatementKeyword {
get {
- return options.MinimumBlankLinesBetweenFields;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceAfterControlFlowStatementKeyword);
}
set {
- options.MinimumBlankLinesBetweenFields = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceAfterControlFlowStatementKeyword, value);
}
}
-
+
[ItemProperty]
- public int BlankLinesBetweenEventFields {
+ public bool SpaceWithinExpressionParentheses {
get {
- return options.MinimumBlankLinesBetweenEventFields;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceWithinExpressionParentheses);
}
set {
- options.MinimumBlankLinesBetweenEventFields = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceWithinExpressionParentheses, value);
}
}
-
+
[ItemProperty]
- public int BlankLinesBetweenMembers {
+ public bool SpaceWithinCastParentheses {
get {
- return options.MinimumBlankLinesBetweenMembers;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceWithinCastParentheses);
}
set {
- options.MinimumBlankLinesBetweenMembers = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceWithinCastParentheses, value);
}
}
[ItemProperty]
- public int BlankLinesAroundRegion {
+ public bool SpaceWithinOtherParentheses {
get {
- return options.MinimumBlankLinesAroundRegion;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceWithinOtherParentheses);
}
set {
- options.MinimumBlankLinesAroundRegion = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceWithinOtherParentheses, value);
}
}
[ItemProperty]
- public int BlankLinesInsideRegion {
+ public bool SpaceAfterCast {
get {
- return options.MinimumBlankLinesInsideRegion;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceAfterCast);
}
set {
- options.MinimumBlankLinesInsideRegion = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceAfterCast, value);
}
}
- #endregion
- #region Wrapping
[ItemProperty]
- public Wrapping MethodCallArgumentWrapping {
+ public bool SpacesIgnoreAroundVariableDeclaration {
get {
- return options.MethodCallArgumentWrapping;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpacesIgnoreAroundVariableDeclaration);
}
set {
- options.MethodCallArgumentWrapping = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpacesIgnoreAroundVariableDeclaration, value);
}
}
[ItemProperty]
- public NewLinePlacement NewLineAferMethodCallOpenParentheses {
+ public bool SpaceBeforeOpenSquareBracket {
get {
- return options.NewLineAferMethodCallOpenParentheses;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceBeforeOpenSquareBracket);
}
set {
- options.NewLineAferMethodCallOpenParentheses = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceBeforeOpenSquareBracket, value);
}
}
[ItemProperty]
- public NewLinePlacement MethodCallClosingParenthesesOnNewLine {
+ public bool SpaceBetweenEmptySquareBrackets {
get {
- return options.MethodCallClosingParenthesesOnNewLine;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceBetweenEmptySquareBrackets);
}
set {
- options.MethodCallClosingParenthesesOnNewLine = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceBetweenEmptySquareBrackets, value);
}
}
[ItemProperty]
- public bool AlignToFirstMethodCallArgument {
+ public bool SpaceWithinSquareBrackets {
get {
- return options.AlignToFirstMethodCallArgument;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceWithinSquareBrackets);
}
set {
- options.AlignToFirstMethodCallArgument = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceWithinSquareBrackets, value);
}
}
[ItemProperty]
- public Wrapping MethodDeclarationParameterWrapping {
+ public bool SpaceAfterColonInBaseTypeDeclaration {
get {
- return options.MethodDeclarationParameterWrapping;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceAfterColonInBaseTypeDeclaration);
}
set {
- options.MethodDeclarationParameterWrapping = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceAfterColonInBaseTypeDeclaration, value);
}
}
[ItemProperty]
- public NewLinePlacement NewLineAferMethodDeclarationOpenParentheses {
+ public bool SpaceAfterComma {
get {
- return options.NewLineAferMethodDeclarationOpenParentheses;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceAfterComma);
}
set {
- options.NewLineAferMethodDeclarationOpenParentheses = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceAfterComma, value);
}
}
[ItemProperty]
- public NewLinePlacement MethodDeclarationClosingParenthesesOnNewLine {
+ public bool SpaceAfterDot {
get {
- return options.MethodDeclarationClosingParenthesesOnNewLine;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceAfterDot);
}
set {
- options.MethodDeclarationClosingParenthesesOnNewLine = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceAfterDot, value);
}
}
[ItemProperty]
- public bool AlignToFirstMethodDeclarationParameter {
+ public bool SpaceAfterSemicolonsInForStatement {
get {
- return options.AlignToFirstMethodDeclarationParameter;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceAfterSemicolonsInForStatement);
}
set {
- options.AlignToFirstMethodDeclarationParameter = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceAfterSemicolonsInForStatement, value);
}
}
-
+
[ItemProperty]
- public Wrapping IndexerDeclarationParameterWrapping {
+ public bool SpaceBeforeColonInBaseTypeDeclaration {
get {
- return options.IndexerDeclarationParameterWrapping;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceBeforeColonInBaseTypeDeclaration);
}
set {
- options.IndexerDeclarationParameterWrapping = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceBeforeColonInBaseTypeDeclaration, value);
}
}
[ItemProperty]
- public NewLinePlacement NewLineAferIndexerDeclarationOpenBracket {
+ public bool SpaceBeforeComma {
get {
- return options.NewLineAferIndexerDeclarationOpenBracket;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceBeforeComma);
}
set {
- options.NewLineAferIndexerDeclarationOpenBracket = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceBeforeComma, value);
}
}
[ItemProperty]
- public NewLinePlacement IndexerDeclarationClosingBracketOnNewLine {
+ public bool SpaceBeforeDot {
get {
- return options.IndexerDeclarationClosingBracketOnNewLine;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceBeforeDot);
}
set {
- options.IndexerDeclarationClosingBracketOnNewLine = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceBeforeDot, value);
}
}
[ItemProperty]
- public bool AlignToFirstIndexerDeclarationParameter {
+ public bool SpaceBeforeSemicolonsInForStatement {
get {
- return options.AlignToFirstIndexerDeclarationParameter;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceBeforeSemicolonsInForStatement);
}
set {
- options.AlignToFirstIndexerDeclarationParameter = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpaceBeforeSemicolonsInForStatement, value);
}
}
[ItemProperty]
- public Wrapping IndexerArgumentWrapping {
+ public Microsoft.CodeAnalysis.CSharp.Formatting.BinaryOperatorSpacingOptions SpacingAroundBinaryOperator {
get {
- return options.IndexerArgumentWrapping;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpacingAroundBinaryOperator);
}
set {
- options.IndexerArgumentWrapping = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.SpacingAroundBinaryOperator, value);
}
}
+ #endregion
+
+ #region Wrapping options
[ItemProperty]
- public NewLinePlacement NewLineAferIndexerOpenBracket {
+ public bool WrappingPreserveSingleLine {
get {
- return options.NewLineAferIndexerOpenBracket;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.WrappingPreserveSingleLine);
}
set {
- options.NewLineAferIndexerOpenBracket = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.WrappingPreserveSingleLine, value);
}
}
[ItemProperty]
- public NewLinePlacement IndexerClosingBracketOnNewLine {
+ public bool WrappingKeepStatementsOnSingleLine {
get {
- return options.IndexerClosingBracketOnNewLine;
+ return options.GetOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.WrappingKeepStatementsOnSingleLine);
}
set {
- options.IndexerClosingBracketOnNewLine = value;
+ options = options.WithChangedOption (Microsoft.CodeAnalysis.CSharp.Formatting.CSharpFormattingOptions.WrappingKeepStatementsOnSingleLine, value);
}
}
+ #endregion
+
+ #region Code Style options
+ bool placeSystemDirectiveFirst = true;
[ItemProperty]
- public bool AlignToFirstIndexerArgument {
+ public bool PlaceSystemDirectiveFirst {
get {
- return options.AlignToFirstIndexerArgument;
+ return placeSystemDirectiveFirst;
}
+
set {
- options.AlignToFirstIndexerArgument = value;
+ placeSystemDirectiveFirst = value;
}
}
@@ -1656,7 +601,7 @@ namespace MonoDevelop.CSharp.Formatting
public CSharpFormattingPolicy ()
{
- this.options = FormattingOptionsFactory.CreateMono ();
+ this.options = TypeSystemService.Workspace.Options;
}
public static CSharpFormattingPolicy Load (FilePath selectedFile)
@@ -1707,10 +652,14 @@ namespace MonoDevelop.CSharp.Formatting
writer.WriteAttributeString ("name", Name);
foreach (PropertyInfo info in typeof (CSharpFormattingPolicy).GetProperties ()) {
if (info.GetCustomAttributes (false).Any (o => o.GetType () == typeof(ItemPropertyAttribute))) {
- writer.WriteStartElement ("Property");
+ writer.WriteStartElement (info.Name);
+ writer.WriteValue (info.GetValue (this, null).ToString ());
+ writer.WriteEndElement ();
+
+ /* writer.WriteStartElement ("Property");
writer.WriteAttributeString ("name", info.Name);
writer.WriteAttributeString ("value", info.GetValue (this, null).ToString ());
- writer.WriteEndElement ();
+ writer.WriteEndElement ();*/
}
}
writer.WriteEndElement ();
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingPolicyPanel.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingPolicyPanel.cs
index e4475c07f3..8cff36c94c 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingPolicyPanel.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingPolicyPanel.cs
@@ -24,9 +24,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.CSharp.Formatting
{
@@ -37,10 +38,10 @@ namespace MonoDevelop.CSharp.Formatting
static CSharpFormattingPolicyPanel ()
{
// ensure that custom text editor shemes are loaded.
- MonoDevelop.SourceEditor.SourceEditorDisplayBinding.InitSourceEditor ();
+ TextEditorDisplayBinding.InitSourceEditor ();
}
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return panel = new CSharpFormattingPolicyPanelWidget ();
}
@@ -60,5 +61,11 @@ namespace MonoDevelop.CSharp.Formatting
// return cloned policy
return panel.Policy;
}
+
+ protected override void OnPolicyStored ()
+ {
+ base.OnPolicyStored ();
+ DefaultSourceEditorOptions.Instance.FireChange ();
+ }
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingPolicyPanelWidget.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingPolicyPanelWidget.cs
index ab4093f96c..3094571e03 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingPolicyPanelWidget.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingPolicyPanelWidget.cs
@@ -26,6 +26,7 @@
using System;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.CSharp.Formatting
@@ -33,7 +34,8 @@ namespace MonoDevelop.CSharp.Formatting
[System.ComponentModel.ToolboxItem(true)]
partial class CSharpFormattingPolicyPanelWidget : Gtk.Bin
{
- readonly Mono.TextEditor.TextEditor texteditor = new Mono.TextEditor.TextEditor ();
+ readonly TextEditor texteditor = TextEditorFactory.CreateNewEditor ();
+
// Gtk.ListStore model = new Gtk.ListStore (typeof(string));
// List<CSharpFormattingPolicy> policies = new List<CSharpFormattingPolicy> ();
const string example = @"using System;
@@ -50,14 +52,14 @@ namespace Example {
}";
TextStylePolicy textStylePolicy;
CSharpFormattingPolicy policy;
- public CSharpFormattingPolicy Policy {
+ internal CSharpFormattingPolicy Policy {
get {
return policy;
}
}
- public void SetPolicy (CSharpFormattingPolicy formattingPolicy, TextStylePolicy textStylePolicy)
+ internal void SetPolicy (CSharpFormattingPolicy formattingPolicy, TextStylePolicy textStylePolicy)
{
policy = formattingPolicy;
this.textStylePolicy = textStylePolicy;
@@ -77,26 +79,18 @@ namespace Example {
policy = new CSharpFormattingPolicy ();
buttonEdit.Clicked += HandleButtonEditClicked;
- var options = MonoDevelop.SourceEditor.DefaultSourceEditorOptions.Instance;
- texteditor.Options.FontName = options.FontName;
- texteditor.Options.ColorScheme = options.ColorScheme;
- texteditor.Options.ShowFoldMargin = false;
- texteditor.Options.ShowIconMargin = false;
- texteditor.Options.ShowLineNumberMargin = false;
- texteditor.Document.ReadOnly = true;
- texteditor.Document.MimeType = CSharpFormatter.MimeType;
+ texteditor.Options = DefaultSourceEditorOptions.PlainEditor;
+ texteditor.IsReadOnly = true;
+ texteditor.MimeType = CSharpFormatter.MimeType;
scrolledwindow1.Child = texteditor;
ShowAll ();
}
public void FormatSample ()
{
- if (textStylePolicy != null) {
- texteditor.Options.IndentationSize = textStylePolicy.IndentWidth;
- texteditor.Options.TabSize = textStylePolicy.TabWidth;
- texteditor.Options.TabsToSpaces = textStylePolicy.TabsToSpaces;
- }
- texteditor.Document.Text = CSharpFormatter.FormatText (policy, textStylePolicy, CSharpFormatter.MimeType, example, 0, example.Length);
+ texteditor.Options = DefaultSourceEditorOptions.Instance.WithTextStyle (textStylePolicy);
+
+ texteditor.Text = CSharpFormatter.FormatText (policy, textStylePolicy, example, 0, example.Length);
}
void HandleButtonEditClicked (object sender, EventArgs e)
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs
index 346dad4f94..df1c115eae 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormattingProfileDialog.cs
@@ -30,391 +30,51 @@ using MonoDevelop.Ide;
using System.Reflection;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.NRefactory.CSharp;
using MonoDevelop.Components;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Gui.Content;
namespace MonoDevelop.CSharp.Formatting
{
- partial class CSharpFormattingProfileDialog : Dialog
+ partial class CSharpFormattingProfileDialog : Gtk.Dialog
{
- readonly Mono.TextEditor.TextEditor texteditor = new Mono.TextEditor.TextEditor ();
+ readonly TextEditor texteditor = TextEditorFactory.CreateNewEditor ();
readonly CSharpFormattingPolicy profile;
- TreeStore indentOptions, bacePositionOptions, newLineOptions, whiteSpaceOptions, wrappingOptions;
-
- static readonly Dictionary<Wrapping, string> arrayInitializerTranslationDictionary = new Dictionary<Wrapping, string> ();
- static readonly Dictionary<BraceStyle, string> braceStyleTranslationDictionary = new Dictionary<BraceStyle, string> ();
- //static Dictionary<BraceForcement, string> braceForcementTranslationDictionary = new Dictionary<BraceForcement, string> ();
- static readonly Dictionary<PropertyFormatting, string> propertyFormattingTranslationDictionary = new Dictionary<PropertyFormatting, string> ();
- static readonly Dictionary<NewLinePlacement, string> newLinePlacementTranslationDictionary = new Dictionary<NewLinePlacement, string> ();
-
+ TreeStore indentationOptions, newLineOptions, spacingOptions, styleOptions, wrappingOptions;
+ static readonly Dictionary<Microsoft.CodeAnalysis.CSharp.Formatting.LabelPositionOptions, string> labelPositionOptionsTranslationDictionary = new Dictionary<Microsoft.CodeAnalysis.CSharp.Formatting.LabelPositionOptions, string> ();
+ static readonly Dictionary<Microsoft.CodeAnalysis.CSharp.Formatting.BinaryOperatorSpacingOptions, string> binaryOperatorSpacingOptionsDictionary = new Dictionary<Microsoft.CodeAnalysis.CSharp.Formatting.BinaryOperatorSpacingOptions, string> ();
+
+
static CSharpFormattingProfileDialog ()
{
- braceStyleTranslationDictionary [BraceStyle.DoNotChange] = GettextCatalog.GetString ("Do not change");
- braceStyleTranslationDictionary [BraceStyle.EndOfLine] = GettextCatalog.GetString ("End of line");
- braceStyleTranslationDictionary [BraceStyle.EndOfLineWithoutSpace] = GettextCatalog.GetString ("End of line without space");
- braceStyleTranslationDictionary [BraceStyle.NextLine] = GettextCatalog.GetString ("Next line");
- braceStyleTranslationDictionary [BraceStyle.NextLineShifted] = GettextCatalog.GetString ("Next line shifted");
- braceStyleTranslationDictionary [BraceStyle.NextLineShifted2] = GettextCatalog.GetString ("Next line shifted2");
- braceStyleTranslationDictionary [BraceStyle.BannerStyle] = GettextCatalog.GetString ("Banner style");
-
- propertyFormattingTranslationDictionary [PropertyFormatting.AllowOneLine] = GettextCatalog.GetString ("Allow one line");
- propertyFormattingTranslationDictionary [PropertyFormatting.ForceOneLine] = GettextCatalog.GetString ("Force one line");
- propertyFormattingTranslationDictionary [PropertyFormatting.ForceNewLine] = GettextCatalog.GetString ("Force new line");
-
- arrayInitializerTranslationDictionary [Wrapping.DoNotChange] = GettextCatalog.GetString ("Do not change");
- arrayInitializerTranslationDictionary [Wrapping.DoNotWrap] = GettextCatalog.GetString ("Do not Wrap");
- arrayInitializerTranslationDictionary [Wrapping.WrapAlways] = GettextCatalog.GetString ("Wrap always");
- arrayInitializerTranslationDictionary [Wrapping.WrapIfTooLong] = GettextCatalog.GetString ("Wrap if too long");
+ labelPositionOptionsTranslationDictionary [Microsoft.CodeAnalysis.CSharp.Formatting.LabelPositionOptions.LeftMost] = GettextCatalog.GetString ("leftmost column");
+ labelPositionOptionsTranslationDictionary [Microsoft.CodeAnalysis.CSharp.Formatting.LabelPositionOptions.NoIndent] = GettextCatalog.GetString ("normal placement");
+ labelPositionOptionsTranslationDictionary [Microsoft.CodeAnalysis.CSharp.Formatting.LabelPositionOptions.OneLess] = GettextCatalog.GetString ("one indent less");
- newLinePlacementTranslationDictionary [NewLinePlacement.DoNotCare] = GettextCatalog.GetString ("Allow both");
- newLinePlacementTranslationDictionary [NewLinePlacement.NewLine] = GettextCatalog.GetString ("Always new line");
- newLinePlacementTranslationDictionary [NewLinePlacement.SameLine] = GettextCatalog.GetString ("Always same line");
+ binaryOperatorSpacingOptionsDictionary [Microsoft.CodeAnalysis.CSharp.Formatting.BinaryOperatorSpacingOptions.Ignore] = GettextCatalog.GetString ("ignore");
+ binaryOperatorSpacingOptionsDictionary [Microsoft.CodeAnalysis.CSharp.Formatting.BinaryOperatorSpacingOptions.Remove] = GettextCatalog.GetString ("remove");
+ binaryOperatorSpacingOptionsDictionary [Microsoft.CodeAnalysis.CSharp.Formatting.BinaryOperatorSpacingOptions.Single] = GettextCatalog.GetString ("single");
}
public static string TranslateValue (object value)
{
- if (value is BraceStyle)
- return braceStyleTranslationDictionary [(BraceStyle)value];
-// if (value is BraceForcement)
-// return braceForcementTranslationDictionary [(BraceForcement)value];
- if (value is PropertyFormatting)
- return propertyFormattingTranslationDictionary [(PropertyFormatting)value];
- if (value is Wrapping)
- return arrayInitializerTranslationDictionary [(Wrapping)value];
- if (value is NewLinePlacement)
- return newLinePlacementTranslationDictionary [(NewLinePlacement)value];
+ if (value is Microsoft.CodeAnalysis.CSharp.Formatting.LabelPositionOptions)
+ return labelPositionOptionsTranslationDictionary [(Microsoft.CodeAnalysis.CSharp.Formatting.LabelPositionOptions)value];
+ if (value is Microsoft.CodeAnalysis.CSharp.Formatting.BinaryOperatorSpacingOptions)
+ return binaryOperatorSpacingOptionsDictionary [(Microsoft.CodeAnalysis.CSharp.Formatting.BinaryOperatorSpacingOptions)value];
throw new Exception ("unknown property type: " + value);
}
-
+
public static object ConvertProperty (Type propertyType, string newText)
{
- if (propertyType == typeof(BraceStyle))
- return braceStyleTranslationDictionary.First (p => p.Value == newText).Key;
-// if (propertyType == typeof(BraceForcement))
-// return braceForcementTranslationDictionary.First (p => p.Value == newText).Key;
- if (propertyType == typeof(PropertyFormatting))
- return propertyFormattingTranslationDictionary.First (p => p.Value == newText).Key;
- if (propertyType == typeof(Wrapping))
- return arrayInitializerTranslationDictionary.First (p => p.Value == newText).Key;
- if (propertyType == typeof(NewLinePlacement))
- return newLinePlacementTranslationDictionary.First (p => p.Value == newText).Key;
+ if (propertyType == typeof(Microsoft.CodeAnalysis.CSharp.Formatting.LabelPositionOptions))
+ return labelPositionOptionsTranslationDictionary.First (p => p.Value == newText).Key;
+ if (propertyType == typeof(Microsoft.CodeAnalysis.CSharp.Formatting.BinaryOperatorSpacingOptions))
+ return binaryOperatorSpacingOptionsDictionary.First (p => p.Value == newText).Key;
throw new Exception ("unknown property type: " + propertyType);
}
-
- #region Examples
- const string methodSpaceExample = @"class ClassDeclaration {
- public static void Main (string[] args)
- {
- Console.WriteLine (""Hello World!"");
- }
- }";
-
- const string propertyExample = @"class ClassDeclaration {
- int myProperty;
- int MyProperty {
- get { return myProperty;}
- set { myProperty = value;}
- }
- string Simple { get { ; } set { ; } }
-
- int myOtherProperty;
- int MyOtherProperty {
- get {
- Console.WriteLine (""get myOtherProperty"");
- return myOtherProperty;
- }
- set {
- if (myOtherProperty != value)
- myOtherProperty = value;
- }
- }
-
- int MyAutoProperty {
- get;
- set;
- }
-
- int MyOtherAutoProperty { get; set; }
- }";
-
- const string spaceExample = @"class ClassDeclaration {
- public void TestMethod ()
- {
- try {
- TestMethod ("""");
- } catch (Exception e) {
- // Do something
- } finally {
- // Do something
- }
- }
-
- public void TestMethod (string test)
- {
- lock (this) {
- switch (test) {
- case ""A"":
- Console.WriteLine (""was A"");
- break;
- case ""B"":
- Console.WriteLine (""was B"");
- break;
- }
- }
- }
-
- public void Calculate (int a, int b)
- {
- if (a < b) {
- for (int i = a; i < b; i++) {
- Console.WriteLine (i);
- }
- } else {
- using (object o = new object ()) {
- while (b < a) {
- ConentryNamesole.WriteLine (b++);
- }
- }
- }
- }
- }";
- const string eventExample = @"class ClassDeclaration {
- EventHandler<EventArgs> onAction;
- public event EventHandler<EventArgs> Action {
- add { onAction = (EventHandler<EventArgs>)Delegate.Combine(onAction, value); }
- remove { onAction = (EventHandler<EventArgs>)Delegate.Remove(onAction, value);}
- }
- EventHandler<EventArgs> onAnotherAction;
- public event EventHandler<EventArgs> AnotherAction {
- add { if (value != null)
- onAnotherAction = (EventHandler<EventArgs>)Delegate.Combine(onAnotherAction, value); }
- remove { if (value != null)
- onAnotherAction = (EventHandler<EventArgs>)Delegate.Remove(onAnotherAction, value);}
- }
- }";
-
- const string simpleUsingStatement = @"class ClassDeclaration {
- public void Test ()
- {
- using (object o = new object ()) {
- Console.WriteLine (""Hello World!"");
- }
- }
- }";
-
- const string simpleFixedStatement = @"class ClassDeclaration {
- public void Test (Point pt)
- {
- fixed (int* p = &pt.x) {
- *p = 10;
- }
- }
- }";
-
- const string simpleIf = @"class ClassDeclaration {
- public void Test (int i)
- {
- if (i == 5) {
- Console.WriteLine (""== 5"");
- } else if (i > 0) {
- Console.WriteLine ("">0"");
- } else if (i < 0) {
- Console.WriteLine (""<0"");
- } else {
- Console.WriteLine (""== 0"");
- }
- }
- }";
- const string longMethodCall = @"class ClassDeclaration {
- public void Test (int test)
- {
- LongMethodCallInSameLine (""Hello"", 1, test);
- LongMethodCallInMultiple (
-""Hello"",
- 1,
- test);
-
- LongMethodCallInMultipleCase2 (""Hello"",
- 1,
- test);
- }
-}";
- const string longMethodDeclaration = @"class ClassDeclaration {
- public void LongMethodCallInSameLine (int test, string foo, double bar)
- {
- }
- public void LongMethodCallInMultiple (
-int test,
-string foo,
-double bar)
- {
- }
- public void LongMethodCallInMultipleCase2 (int test,
-string foo,
-double bar)
- {
- }
-}";
- const string longIndexerDeclaration = @"class ClassDeclaration {
- public int this [int test, string foo, double bar]
- {
- get {}
- }
- public int this [
-int test,
-string foo,
-double bar]
- {
- get {}
- }
- public int this [int test,
-string foo,
-double bar]
- {
- get {}
- }
-}";
- const string longIndexer = @"class ClassDeclaration {
- public void Test (int test)
- {
- this [""Hello"", 1, test] = 0;
- this [
-""Hello"",
- 1,
- test] = 0;
-
- this [""Hello"",
- 1,
- test] = 0;
- }
-}";
- const string simpleWhile = @"class ClassDeclaration {
- public void Test ()
- {
- while (true) {
- Console.WriteLine (""Hello World!"");
- }
- }
- }";
- const string simpleCatch = @"class ClassDeclaration {
- public void Test ()
- {
- try {
- Console.WriteLine (""Hello World!"");
- } catch (Exception) {
- Console.WriteLine (""Got exception!!"");
- } finally {
- Console.WriteLine (""finally done."");
- }
- }
- }";
-
- const string simpleDoWhile = @"class ClassDeclaration {
- public void Test ()
- {
- int i = 0;
- do {
- Console.WriteLine (""Hello World!"");
- } while (i++ < 10);
- }
- }";
-
- const string simpleArrayInitializer = @"class ClassDeclaration {
- public void Test (object o)
- {
- int[] i = new int[] { 1, 3, 3, 7 };
- }
- }";
- const string condOpExample = @"class ClassDeclaration {
- public string GetSign (int i)
- {
- return i < 0 ? ""-"" : ""+"";
- }
- }";
- const string switchExample = @"class ClassDeclaration {
- public void Test (int i)
- {
- switch (i) {
- case 0:
- Console.WriteLine (""was zero"");
- break;
- case 1:
- Console.WriteLine (""was one"");
- break;
- default:
- Console.WriteLine (""was "" + i);
- break;
- }
- }
- }";
- const string simpleFor = @"class ClassDeclaration {
- public void Test ()
- {
- for (int i = 0; i < 10; i++) {
- Console.WriteLine (""Hello World!"");
- }
- }
- }";
- const string simpleForeach = @"class ClassDeclaration : ArrayList {
- public void Test ()
- {
- foreach (object o in this) {
- Console.WriteLine (""Hello World!"");
- }
- }
- }";
- const string simpleLock = @"class ClassDeclaration {
- public void Test ()
- {
- lock (this) {
- Console.WriteLine (""Hello World!"");
- }
- }
- }";
- const string operatorExample = @"class ClassDeclaration {
- public void TestMethod ()
- {
- int a = 5 << 5;
- int b = (a + 5 - 3) * 6 / 2;
- a += b;
- a = a & ~255;
- if (a == b || b < a >> 1) {
- b -= a;
- }
- }
- object Test (object a, object b)
- {
- return a ?? b;
- }
- }";
- const string blankLineExample = @"// Example
-using System;
-using System.Collections;
-namespace TestSpace {
- using MyNamespace;
- class Test
- {
- int a;
- string b;
- public Test (int a, string b)
- {
- this.a = a;
- this.b = b;
- }
- void Print ()
- {
- Console.WriteLine (""a: {0} b : {1}"", a, b);
- }
- }
- class MyTest
- {
- }
-}
-";
- #endregion
-
const int propertyColumn = 0;
const int displayTextColumn = 1;
const int exampleTextColumn = 2;
@@ -437,15 +97,16 @@ namespace TestSpace {
treeView = treeviewIndentOptions;
break;
case 1:
- treeView = treeviewBracePositions;
+ treeView = treeviewNewLines;
break;
case 2: // Blank lines
- UpdateExample (blankLineExample);
- return;
- case 3: // white spaces
- return;
+ treeView = treeviewSpacing;
+ break;
+ case 3:
+ treeView = treeviewWrapping;
+ break;
case 4:
- treeView = treeviewNewLines;
+ treeView = treeviewStyle;
break;
default:
return;
@@ -458,30 +119,25 @@ namespace TestSpace {
};
notebookCategories.ShowTabs = false;
comboboxCategories.AppendText (GettextCatalog.GetString ("Indentation"));
- comboboxCategories.AppendText (GettextCatalog.GetString ("Braces"));
- comboboxCategories.AppendText (GettextCatalog.GetString ("Blank lines"));
- comboboxCategories.AppendText (GettextCatalog.GetString ("Wrapping"));
- comboboxCategories.AppendText (GettextCatalog.GetString ("White Space"));
comboboxCategories.AppendText (GettextCatalog.GetString ("New Lines"));
+ comboboxCategories.AppendText (GettextCatalog.GetString ("Spacing"));
+ comboboxCategories.AppendText (GettextCatalog.GetString ("Wrapping"));
+ comboboxCategories.AppendText (GettextCatalog.GetString ("Style"));
comboboxCategories.Changed += delegate {
texteditor.Text = "";
notebookCategories.Page = comboboxCategories.Active;
};
comboboxCategories.Active = 0;
- var options = MonoDevelop.SourceEditor.DefaultSourceEditorOptions.Instance;
- texteditor.Options.FontName = options.FontName;
- texteditor.Options.ColorScheme = options.ColorScheme;
- texteditor.Options.ShowFoldMargin = false;
- texteditor.Options.ShowIconMargin = false;
- texteditor.Options.ShowLineNumberMargin = false;
- texteditor.Document.ReadOnly = true;
- texteditor.Document.MimeType = CSharpFormatter.MimeType;
+ var options = DefaultSourceEditorOptions.Instance;
+ texteditor.Options = DefaultSourceEditorOptions.PlainEditor;
+ texteditor.IsReadOnly = true;
+ texteditor.MimeType = CSharpFormatter.MimeType;
scrolledwindow.Child = texteditor;
ShowAll ();
#region Indent options
- indentOptions = new TreeStore (typeof(string), typeof(string), typeof(string), typeof(bool), typeof(bool));
+ indentationOptions = new TreeStore (typeof(string), typeof(string), typeof(string), typeof(bool), typeof(bool));
var column = new TreeViewColumn ();
// pixbuf column
@@ -495,7 +151,7 @@ namespace TestSpace {
column.PackStart (cellRendererText, true);
column.SetAttributes (cellRendererText, "text", 1);
- treeviewIndentOptions.Model = indentOptions;
+ treeviewIndentOptions.Model = indentationOptions;
treeviewIndentOptions.HeadersVisible = false;
treeviewIndentOptions.Selection.Changed += TreeSelectionChanged;
treeviewIndentOptions.AppendColumn (column);
@@ -509,7 +165,7 @@ namespace TestSpace {
cellRendererCombo.HasEntry = false;
cellRendererCombo.Editable = !profile.IsBuiltIn;
- cellRendererCombo.Edited += new ComboboxEditedHandler (this, indentOptions).ComboboxEdited;
+ cellRendererCombo.Edited += new ComboboxEditedHandler (this, indentationOptions).ComboboxEdited;
column.PackStart (cellRendererCombo, false);
column.SetAttributes (cellRendererCombo, "visible", comboVisibleColumn);
@@ -518,58 +174,23 @@ namespace TestSpace {
var cellRendererToggle = new CellRendererToggle ();
cellRendererToggle.Ypad = 1;
cellRendererToggle.Activatable = !profile.IsBuiltIn;
- cellRendererToggle.Toggled += new CellRendererToggledHandler (this, treeviewIndentOptions, indentOptions).Toggled;
+ cellRendererToggle.Toggled += new CellRendererToggledHandler (this, treeviewIndentOptions, indentationOptions).Toggled;
column.PackStart (cellRendererToggle, false);
column.SetAttributes (cellRendererToggle, "visible", toggleVisibleColumn);
column.SetCellDataFunc (cellRendererToggle, ToggleDataFunc);
-
treeviewIndentOptions.AppendColumn (column);
- var category = AddOption (indentOptions, null, GettextCatalog.GetString ("Declarations"), null);
- AddOption (indentOptions, category, "IndentNamespaceBody", GettextCatalog.GetString ("within namespaces"), "namespace Test { class AClass {} }");
-
- AddOption (indentOptions, category, "IndentClassBody", GettextCatalog.GetString ("within classes"), "class AClass { int aField; void AMethod () {}}");
- AddOption (indentOptions, category, "IndentInterfaceBody", GettextCatalog.GetString ("within interfaces"), "interface IAInterfaces { int AProperty {get;set;} void AMethod ();}");
- AddOption (indentOptions, category, "IndentStructBody", GettextCatalog.GetString ("within structs"), "struct AStruct { int aField; void AMethod () {}}");
- AddOption (indentOptions, category, "IndentEnumBody", GettextCatalog.GetString ("within enums"), "enum AEnum { A, B, C }");
-
- AddOption (indentOptions, category, "IndentMethodBody", GettextCatalog.GetString ("within methods"), methodSpaceExample);
- AddOption (indentOptions, category, "IndentPropertyBody", GettextCatalog.GetString ("within properties"), propertyExample);
- AddOption (indentOptions, category, "IndentEventBody", GettextCatalog.GetString ("within events"), eventExample);
-
- category = AddOption (indentOptions, null, GettextCatalog.GetString ("Statements"), null);
- AddOption (indentOptions, category, "IndentBlocks", GettextCatalog.GetString ("within blocks"), spaceExample);
- AddOption (indentOptions, category, "IndentSwitchBody", GettextCatalog.GetString ("Indent 'switch' body"), spaceExample);
- AddOption (indentOptions, category, "IndentCaseBody", GettextCatalog.GetString ("Indent 'case' body"), spaceExample);
- AddOption (indentOptions, category, "IndentBreakStatements", GettextCatalog.GetString ("Indent 'break' statements"), spaceExample);
- AddOption (indentOptions, category, "IndentPreprocessorDirectives", GettextCatalog.GetString ("Indent pre processor directives"),
- @"#define DEBUG
-class Test {
- #if DEBUG
- void Example ()
- {
- }
- #endif
-}
-");
- AddOption (indentOptions, category, "IndentBlocksInsideExpressions", GettextCatalog.GetString ("Indent blocks inside expressions"),
- @"
-class Test
-{
- void Example ()
- {
- Test(delegate {
- Call ();
- });
- }
-}
-");
- AddOption (indentOptions, category, "AlignEmbeddedStatements", GettextCatalog.GetString ("Align embedded statements"), "class AClass { void AMethod () { if (a) if (b) { int c; } } } ");
+
+ AddOption (indentationOptions, "IndentBlock", GettextCatalog.GetString ("Indent block contents"), "namespace Test { class AClass { void Method () { int x; int y; } } }");
+ AddOption (indentationOptions, "IndentBraces", GettextCatalog.GetString ("Indent open and close braces"), "class AClass { int aField; void AMethod () {}}");
+ AddOption (indentationOptions, "IndentSwitchSection", GettextCatalog.GetString ("Indent switch sections"), "class AClass { void Method (int x) { switch (x) { case 1: break; } } }");
+ AddOption (indentationOptions, "IndentSwitchCaseSection", GettextCatalog.GetString ("Indent case sections"), "class AClass { void Method (int x) { switch (x) { case 1: break; } } }");
+ AddOption (indentationOptions, "LabelPositioning", GettextCatalog.GetString ("Label indentation"), "enum AEnum { A, B, C }");
treeviewIndentOptions.ExpandAll ();
#endregion
- #region Brace options
- bacePositionOptions = new TreeStore (typeof(string), typeof(string), typeof(string), typeof(bool), typeof(bool));
+ #region New line options
+ newLineOptions = new TreeStore (typeof(string), typeof(string), typeof(string), typeof(bool), typeof(bool));
column = new TreeViewColumn ();
// pixbuf column
@@ -582,10 +203,10 @@ class Test
column.PackStart (cellRendererText, true);
column.SetAttributes (cellRendererText, "text", 1);
- treeviewBracePositions.Model = bacePositionOptions;
- treeviewBracePositions.HeadersVisible = false;
- treeviewBracePositions.Selection.Changed += TreeSelectionChanged;
- treeviewBracePositions.AppendColumn (column);
+ treeviewNewLines.Model = newLineOptions;
+ treeviewNewLines.HeadersVisible = false;
+ treeviewNewLines.Selection.Changed += TreeSelectionChanged;
+ treeviewNewLines.AppendColumn (column);
column = new TreeViewColumn ();
cellRendererCombo = new CellRendererCombo ();
@@ -595,7 +216,7 @@ class Test
cellRendererCombo.Model = ComboBoxStore;
cellRendererCombo.HasEntry = false;
cellRendererCombo.Editable = !profile.IsBuiltIn;
- cellRendererCombo.Edited += new ComboboxEditedHandler (this, bacePositionOptions).ComboboxEdited;
+ cellRendererCombo.Edited += new ComboboxEditedHandler (this, newLineOptions).ComboboxEdited;
column.PackStart (cellRendererCombo, false);
column.SetAttributes (cellRendererCombo, "visible", comboVisibleColumn);
@@ -604,49 +225,126 @@ class Test
cellRendererToggle = new CellRendererToggle ();
cellRendererToggle.Activatable = !profile.IsBuiltIn;
cellRendererToggle.Ypad = 1;
- cellRendererToggle.Toggled += new CellRendererToggledHandler (this, treeviewBracePositions, bacePositionOptions).Toggled;
+ cellRendererToggle.Toggled += new CellRendererToggledHandler (this, treeviewNewLines, newLineOptions).Toggled;
column.PackStart (cellRendererToggle, false);
column.SetAttributes (cellRendererToggle, "visible", toggleVisibleColumn);
column.SetCellDataFunc (cellRendererToggle, ToggleDataFunc);
- treeviewBracePositions.AppendColumn (column);
-
- AddOption (bacePositionOptions, "NamespaceBraceStyle", GettextCatalog.GetString ("Namespace declaration"), "namespace TestNameSpace {}");
-
- AddOption (bacePositionOptions, "ClassBraceStyle", GettextCatalog.GetString ("Class declaration"), "class ClassDeclaration {}");
- AddOption (bacePositionOptions, "InterfaceBraceStyle", GettextCatalog.GetString ("Interface declaration"), "interface InterfaceDeclaraction {}");
- AddOption (bacePositionOptions, "StructBraceStyle", GettextCatalog.GetString ("Struct declaration"), "struct StructDeclaration {}");
- AddOption (bacePositionOptions, "EnumBraceStyle", GettextCatalog.GetString ("Enum declaration"), "enum EnumDeclaration { A, B, C}");
-
- AddOption (bacePositionOptions, "MethodBraceStyle", GettextCatalog.GetString ("Method declaration"), "class ClassDeclaration { void MyMethod () {} }");
- AddOption (bacePositionOptions, "AnonymousMethodBraceStyle", GettextCatalog.GetString ("Anonymous methods"), "class ClassDeclaration { void MyMethod () { MyEvent += delegate (object sender, EventArgs e) { if (true) Console.WriteLine (\"Hello World\"); }; } }");
- AddOption (bacePositionOptions, "ConstructorBraceStyle", GettextCatalog.GetString ("Constructor declaration"), "class ClassDeclaration { public ClassDeclaration () {} }");
- AddOption (bacePositionOptions, "DestructorBraceStyle", GettextCatalog.GetString ("Destructor declaration"), "class ClassDeclaration { ~ClassDeclaration () {} }");
-
- AddOption (bacePositionOptions, "StatementBraceStyle", GettextCatalog.GetString ("Statements"), spaceExample);
-
- category = AddOption (bacePositionOptions, "PropertyBraceStyle", GettextCatalog.GetString ("Property declaration"), propertyExample);
- AddOption (bacePositionOptions, category, "AutoPropertyFormatting", GettextCatalog.GetString ("Allow automatic property in one line"), propertyExample);
- AddOption (bacePositionOptions, category, "SimplePropertyFormatting", GettextCatalog.GetString ("Allow simple property in one line"), propertyExample);
+ treeviewNewLines.AppendColumn (column);
+
+ var category = AddOption (newLineOptions, null, GettextCatalog.GetString ("New line options for braces"), null);
+ AddOption (newLineOptions, category, "NewLinesForBracesInTypes", GettextCatalog.GetString ("Place open brace on new line for types"), @"class Example
+{
+}");
+ AddOption (newLineOptions, category, "NewLinesForBracesInMethods", GettextCatalog.GetString ("Place open brace on new line for methods"), @"void Example()
+{
+}");
+ AddOption (newLineOptions, category, "NewLinesForBracesInProperties", GettextCatalog.GetString ("Place open brace on new line for properties"), @"int Example {
+ get {
+ return 1;
+ }
+ set {
+ // nothing
+ }
+}
+"
+);
+ AddOption (newLineOptions, category, "NewLinesForBracesInAccessors", GettextCatalog.GetString ("Place open brace on new line for property accessors"), @"int Example {
+ get {
+ return 1;
+ }
+ set {
+ // nothing
+ }
+}
+"
+);
- AddOption (bacePositionOptions, category, "PropertyGetBraceStyle", GettextCatalog.GetString ("Get declaration"), propertyExample);
- AddOption (bacePositionOptions, category, "SimpleGetBlockFormatting", GettextCatalog.GetString ("Allow one line get"), propertyExample);
- AddOption (bacePositionOptions, category, "PropertySetBraceStyle", GettextCatalog.GetString ("Set declaration"), propertyExample);
- AddOption (bacePositionOptions, category, "SimpleSetBlockFormatting", GettextCatalog.GetString ("Allow one line set"), propertyExample);
-
-
- category = AddOption (bacePositionOptions, "EventBraceStyle", GettextCatalog.GetString ("Event declaration"), eventExample);
- AddOption (bacePositionOptions, category, "EventAddBraceStyle", GettextCatalog.GetString ("Add declaration"), eventExample);
- AddOption (bacePositionOptions, category, "AllowEventAddBlockInline", GettextCatalog.GetString ("Allow one line add"), eventExample);
- AddOption (bacePositionOptions, category, "EventRemoveBraceStyle", GettextCatalog.GetString ("Remove declaration"), eventExample);
- AddOption (bacePositionOptions, category, "AllowEventRemoveBlockInline", GettextCatalog.GetString ("Allow one line remove"), eventExample);
-
- treeviewBracePositions.ExpandAll ();
+
+ AddOption (newLineOptions, category, "NewLinesForBracesInAnonymousMethods", GettextCatalog.GetString ("Place open brace on new line for anonymous methods"), @"void Example()
+{
+ var del = new delegate (int i, int j) {
+ };
+}");
+ AddOption (newLineOptions, category, "NewLinesForBracesInControlBlocks", GettextCatalog.GetString ("Place open brace on new line for control blocks"), @"void Example()
+{
+ if (true)
+ {
+ }
+}");
+ AddOption (newLineOptions, category, "NewLinesForBracesInAnonymousTypes", GettextCatalog.GetString ("Place open brace on new line for anonymous types"), @"void Example()
+{
+ var c = new
+ {
+ A = 1,
+ B = 2
+ };
+}");
+ AddOption (newLineOptions, category, "NewLinesForBracesInObjectCollectionArrayInitializers", GettextCatalog.GetString ("Place open brace on new line for object initializers"), @"void Example()
+{
+ new MyObject
+ {
+ A = 1,
+ B = 2
+ };
+}");
+ AddOption (newLineOptions, category, "NewLinesForBracesInLambdaExpressionBody", GettextCatalog.GetString ("Place open brace on new line for lambda expression"), @"void Example()
+{
+ Action act = () =>
+ {
+ };
+}");
+
+ category = AddOption (newLineOptions, null, GettextCatalog.GetString ("New line options for keywords"), null);
+ AddOption (newLineOptions, category, "NewLineForElse", GettextCatalog.GetString ("Place \"else\" on new line"), @"void Example()
+{
+ if (true) {
+ // ...
+ } else {
+ // ...
+ }
+}");
+ AddOption (newLineOptions, category, "NewLineForCatch", GettextCatalog.GetString ("Place \"catch\" on new line"), @"void Example()
+{
+ try {
+ } catch {
+ } finally {
+ }
+}");
+ AddOption (newLineOptions, category, "NewLineForFinally", GettextCatalog.GetString ("Place \"finally\" on new line"), @"void Example()
+{
+ try {
+ } catch {
+ } finally {
+ }
+}");
+
+ category = AddOption (newLineOptions, null, GettextCatalog.GetString ("New line options for expressions"), null);
+ AddOption (newLineOptions, category, "NewLineForMembersInObjectInit", GettextCatalog.GetString ("Place members in object initializers on new line"), @"void Example()
+{
+ new MyObject {
+ A = 1,
+ B = 2
+ };
+}");
+ AddOption (newLineOptions, category, "NewLineForMembersInAnonymousTypes", GettextCatalog.GetString ("Place members in anonymous types on new line"), @"void Example()
+{
+ var c = new
+ {
+ A = 1,
+ B = 2
+ };
+}");
+ AddOption (newLineOptions, category, "NewLineForClausesInQuery", GettextCatalog.GetString ("Place query expression clauses on new line"), @"void Example()
+{
+ from o in col select o.Foo;
+}");
+ treeviewNewLines.ExpandAll ();
#endregion
- #region New line options
- newLineOptions = new TreeStore (typeof(string), typeof(string), typeof(string), typeof(bool), typeof(bool));
+ #region Spacing options
+ spacingOptions = new TreeStore (typeof(string), typeof(string), typeof(string), typeof(bool), typeof(bool));
column = new TreeViewColumn ();
// pixbuf column
@@ -658,10 +356,10 @@ class Test
column.PackStart (cellRendererText, true);
column.SetAttributes (cellRendererText, "text", 1);
- treeviewNewLines.Model = newLineOptions;
- treeviewNewLines.HeadersVisible = false;
- treeviewNewLines.Selection.Changed += TreeSelectionChanged;
- treeviewNewLines.AppendColumn (column);
+ treeviewSpacing.Model = spacingOptions;
+ treeviewSpacing.HeadersVisible = false;
+ treeviewSpacing.Selection.Changed += TreeSelectionChanged;
+ treeviewSpacing.AppendColumn (column);
column = new TreeViewColumn ();
cellRendererCombo = new CellRendererCombo ();
@@ -671,7 +369,7 @@ class Test
cellRendererCombo.Model = ComboBoxStore;
cellRendererCombo.HasEntry = false;
cellRendererCombo.Editable = !profile.IsBuiltIn;
- cellRendererCombo.Edited += new ComboboxEditedHandler (this, newLineOptions).ComboboxEdited;
+ cellRendererCombo.Edited += new ComboboxEditedHandler (this, spacingOptions).ComboboxEdited;
column.PackStart (cellRendererCombo, false);
column.SetAttributes (cellRendererCombo, "visible", comboVisibleColumn);
@@ -680,63 +378,137 @@ class Test
cellRendererToggle = new CellRendererToggle ();
cellRendererToggle.Activatable = !profile.IsBuiltIn;
cellRendererToggle.Ypad = 1;
- cellRendererToggle.Toggled += new CellRendererToggledHandler (this, treeviewNewLines, newLineOptions).Toggled;
+ cellRendererToggle.Toggled += new CellRendererToggledHandler (this, treeviewSpacing, spacingOptions).Toggled;
column.PackStart (cellRendererToggle, false);
column.SetAttributes (cellRendererToggle, "visible", toggleVisibleColumn);
column.SetCellDataFunc (cellRendererToggle, ToggleDataFunc);
- treeviewNewLines.AppendColumn (column);
+ treeviewSpacing.AppendColumn (column);
- AddOption (newLineOptions, "ElseNewLinePlacement", GettextCatalog.GetString ("Place 'else' on new line"), simpleIf);
- AddOption (newLineOptions, "ElseIfNewLinePlacement", GettextCatalog.GetString ("Place 'else if' on new line"), simpleIf);
- AddOption (newLineOptions, "CatchNewLinePlacement", GettextCatalog.GetString ("Place 'catch' on new line"), simpleCatch);
- AddOption (newLineOptions, "FinallyNewLinePlacement", GettextCatalog.GetString ("Place 'finally' on new line"), simpleCatch);
- AddOption (newLineOptions, "WhileNewLinePlacement", GettextCatalog.GetString ("Place 'while' on new line"), simpleDoWhile);
- AddOption (newLineOptions, "ArrayInitializerWrapping", GettextCatalog.GetString ("Place array initializers on new line"), simpleArrayInitializer);
- AddOption (newLineOptions, "EmbeddedStatementPlacement", GettextCatalog.GetString ("Place embedded statements on new line"), @"class Test
+ category = AddOption (spacingOptions, null, GettextCatalog.GetString ("Set spacing for method declarations"), null);
+ AddOption (spacingOptions, category, "SpacingAfterMethodDeclarationName", GettextCatalog.GetString ("Insert space between method name and its opening parenthesis"),
+ @"void Example()
+{
+}");
+
+ AddOption (spacingOptions, category, "SpaceWithinMethodDeclarationParenthesis", GettextCatalog.GetString ("Insert space within argument list parentheses"),
+ @"void Example(int i, int j)
{
- public void Example ()
- {
- if (true)
- Call ();
-
- foreach (var o in col) DoSomething (o);
- }
}");
- string constructorInitializer=@"class Test
+ AddOption (spacingOptions, category, "SpaceBetweenEmptyMethodDeclarationParentheses", GettextCatalog.GetString ("Insert space within empty argument list parentheses"), @"void Example()
{
+}");
- public Test () : base ()
- {
+ category = AddOption (spacingOptions, null, GettextCatalog.GetString ("Set spacing for method calls"), null);
+ AddOption (spacingOptions, category, "SpaceAfterMethodCallName", GettextCatalog.GetString ("Insert space between method name and its opening parenthesis"), @"void Example()
+{
+ Test();
+}");
+ AddOption (spacingOptions, category, "SpaceWithinMethodCallParentheses", GettextCatalog.GetString ("Insert space within argument list parentheses"), @"void Example()
+{
+ Test(1, 2);
+}");
+ AddOption (spacingOptions, category, "SpaceBetweenEmptyMethodCallParentheses", GettextCatalog.GetString ("Insert space within empty argument list parentheses"), @"void Example()
+{
+ Test();
+}");
+ category = AddOption (spacingOptions, null, GettextCatalog.GetString ("Set other spacing options"), null);
+ AddOption (spacingOptions, category, "SpaceAfterControlFlowStatementKeyword", GettextCatalog.GetString ("Insert space after keywords in control flow statements"), @"void Example()
+{
+ if (condition)
+ {
}
+}");
- public Test ()
- : base ()
+ AddOption (spacingOptions, category, "SpaceWithinExpressionParentheses", GettextCatalog.GetString ("Insert space within parentheses of expressions"), @"void Example()
+{
+ i = (5 + 3) * 2;
+}");
+ AddOption (spacingOptions, category, "SpaceWithinCastParentheses", GettextCatalog.GetString ("Insert space within parentheses of type casts"), @"void Example()
+{
+ test = (ITest)o;
+}");
+ AddOption (spacingOptions, category, "SpaceWithinOtherParentheses", GettextCatalog.GetString ("Insert space within parentheses of control flow statements"), @"void Example()
+{
+ if (condition)
{
-
}
+}");
- public Test () :
- base ()
- {
+ AddOption (spacingOptions, category, "SpaceAfterCast", GettextCatalog.GetString ("Insert space after casts"), @"void Example()
+{
+ test = (ITest)o;
+}");
+ AddOption (spacingOptions, category, "SpacesIgnoreAroundVariableDeclaration", GettextCatalog.GetString ("Ignore spaces in declaration statements"), @"void Example()
+{
+ int x=5;
+}");
- }
+ category = AddOption (spacingOptions, null, GettextCatalog.GetString ("Set spacing for brackets"), null);
+ AddOption (spacingOptions, category, "SpaceBeforeOpenSquareBracket", GettextCatalog.GetString ("Insert space before open square bracket"), @"void Example()
+{
+ i[5] = 3;
+}");
+ AddOption (spacingOptions, category, "SpaceBetweenEmptySquareBrackets", GettextCatalog.GetString ("Insert space within empty square brackets"), @"void Example()
+{
+ new int[] {1, 2};
+}");
+ AddOption (spacingOptions, category, "SpaceWithinSquareBrackets", GettextCatalog.GetString ("Insert space within square brackets"), @"void Example()
+{
+ i[5] = 3;
+}");
- public Test ()
- :
- base ()
+ category = AddOption (spacingOptions, null, GettextCatalog.GetString ("Set spacing for brackets"), null);
+ AddOption (spacingOptions, category, "SpaceAfterColonInBaseTypeDeclaration", GettextCatalog.GetString ("Insert space after colon for base or interface in type declaration"), @"class Foo : Bar
+{
+}");
+ AddOption (spacingOptions, category, "SpaceAfterComma", GettextCatalog.GetString ("Insert space after comma"), @"void Example()
+{
+ for (int i =0; i < 10, i >5;i++)
{
-
}
-}";
- AddOption (newLineOptions, "NewLineBeforeConstructorInitializerColon", GettextCatalog.GetString("Place constructor initializer ':' on new line"), constructorInitializer);
- AddOption (newLineOptions, "NewLineAfterConstructorInitializerColon", GettextCatalog.GetString("Place constructor initializer 'base/this' on new line"), constructorInitializer);
- treeviewNewLines.ExpandAll ();
+}");
+ AddOption (spacingOptions, category, "SpaceAfterDot", GettextCatalog.GetString ("Insert space after dot"), @"void Example()
+{
+ Foo.Bar.Test();
+}");
+ AddOption (spacingOptions, category, "SpaceAfterSemicolonsInForStatement", GettextCatalog.GetString ("Insert space after semicolon in \"for\" statement"), @"void Example()
+{
+ for (int i = 0; i< 10; i++)
+ {
+ }
+}");
+ AddOption (spacingOptions, category, "SpaceBeforeColonInBaseTypeDeclaration", GettextCatalog.GetString ("Insert space before colon for base or interface in type declaration"), @"class Foo : Bar
+{
+}");
+ AddOption (spacingOptions, category, "SpaceBeforeComma", GettextCatalog.GetString ("Insert space before comma"), @"void Example()
+{
+ for (int i =0; i < 10, i >5;i++)
+ {
+ }
+}");
+ AddOption (spacingOptions, category, "SpaceBeforeDot", GettextCatalog.GetString ("Insert space before dot"), @"void Example()
+{
+ Foo.Bar.Test();
+}");
+ AddOption (spacingOptions, category, "SpaceBeforeSemicolonsInForStatement", GettextCatalog.GetString ("Insert space before semicolon in \"for\" statement"), @"void Example()
+{
+ for (int i = 0; i< 10; i++)
+ {
+ }
+}");
+
+ AddOption (spacingOptions, category, "SpacingAroundBinaryOperator", GettextCatalog.GetString ("Set spacing for operators"), @"void Example()
+{
+ i = (5 + 3) * 2;
+}");
+
+ treeviewSpacing.ExpandAll ();
#endregion
-
- #region Wrapping options
- wrappingOptions = new TreeStore (typeof(string), typeof(string), typeof(string), typeof(bool), typeof(bool));
+
+ #region Style options
+ styleOptions = new TreeStore (typeof(string), typeof(string), typeof(string), typeof(bool), typeof(bool));
column = new TreeViewColumn ();
// pixbuf column
@@ -749,10 +521,10 @@ class Test
column.SetAttributes (cellRendererText, "text", 1);
- treeviewWrappingCategory.Model = wrappingOptions;
- treeviewWrappingCategory.HeadersVisible = false;
- treeviewWrappingCategory.Selection.Changed += TreeSelectionChanged;
- treeviewWrappingCategory.AppendColumn (column);
+ treeviewStyle.Model = styleOptions;
+ treeviewStyle.HeadersVisible = false;
+ treeviewStyle.Selection.Changed += TreeSelectionChanged;
+ treeviewStyle.AppendColumn (column);
column = new TreeViewColumn ();
cellRendererCombo = new CellRendererCombo ();
@@ -762,7 +534,7 @@ class Test
cellRendererCombo.Model = ComboBoxStore;
cellRendererCombo.HasEntry = false;
cellRendererCombo.Editable = !profile.IsBuiltIn;
- cellRendererCombo.Edited += new ComboboxEditedHandler (this, wrappingOptions).ComboboxEdited;
+ cellRendererCombo.Edited += new ComboboxEditedHandler (this, styleOptions).ComboboxEdited;
column.PackStart (cellRendererCombo, false);
column.SetAttributes (cellRendererCombo, "visible", comboVisibleColumn);
@@ -771,59 +543,39 @@ class Test
cellRendererToggle = new CellRendererToggle ();
cellRendererToggle.Activatable = !profile.IsBuiltIn;
cellRendererToggle.Ypad = 1;
- cellRendererToggle.Toggled += new CellRendererToggledHandler (this, treeviewNewLines, wrappingOptions).Toggled;
+ cellRendererToggle.Toggled += new CellRendererToggledHandler (this, treeviewSpacing, styleOptions).Toggled;
column.PackStart (cellRendererToggle, false);
column.SetAttributes (cellRendererToggle, "visible", toggleVisibleColumn);
column.SetCellDataFunc (cellRendererToggle, ToggleDataFunc);
- treeviewWrappingCategory.AppendColumn (column);
-
- category = AddOption (wrappingOptions, null, GettextCatalog.GetString ("Method declarations"), null);
- AddOption (wrappingOptions, category, "MethodDeclarationParameterWrapping", GettextCatalog.GetString ("Parameters"), longMethodDeclaration);
- AddOption (wrappingOptions, category, "NewLineAferMethodDeclarationOpenParentheses", GettextCatalog.GetString ("New line after open parentheses"), longMethodDeclaration);
- AddOption (wrappingOptions, category, "MethodDeclarationClosingParenthesesOnNewLine", GettextCatalog.GetString ("New line before closing parentheses"), longMethodDeclaration);
- AddOption (wrappingOptions, category, "AlignToFirstMethodDeclarationParameter", GettextCatalog.GetString ("Align to first parameter"), longMethodDeclaration);
+ treeviewStyle.AppendColumn (column);
- category = AddOption (wrappingOptions, null, GettextCatalog.GetString ("Method calls"), null);
- AddOption (wrappingOptions, category, "MethodCallArgumentWrapping", GettextCatalog.GetString ("Arguments"), longMethodCall);
- AddOption (wrappingOptions, category, "NewLineAferMethodCallOpenParentheses", GettextCatalog.GetString ("New line after open parentheses"), longMethodCall);
- AddOption (wrappingOptions, category, "MethodCallClosingParenthesesOnNewLine", GettextCatalog.GetString ("New line before closing parentheses"), longMethodCall);
- AddOption (wrappingOptions, category, "AlignToFirstMethodCallArgument", GettextCatalog.GetString ("Align to first argument"), longMethodCall);
+ AddOption (styleOptions, "PlaceSystemDirectiveFirst", GettextCatalog.GetString ("Place System directives first when sorting usings"), "");
- category = AddOption (wrappingOptions, null, GettextCatalog.GetString ("Indexer declarations"), null);
- AddOption (wrappingOptions, category, "IndexerDeclarationParameterWrapping", GettextCatalog.GetString ("Parameters"), longIndexerDeclaration);
- AddOption (wrappingOptions, category, "NewLineAferIndexerDeclarationOpenBracket", GettextCatalog.GetString ("New line after open parentheses"), longIndexerDeclaration);
- AddOption (wrappingOptions, category, "IndexerDeclarationClosingBracketOnNewLine", GettextCatalog.GetString ("New line before closing parentheses"), longIndexerDeclaration);
- AddOption (wrappingOptions, category, "AlignToFirstIndexerDeclarationParameter", GettextCatalog.GetString ("Align to first parameter"), longIndexerDeclaration);
+ // AddOption (styleOptions, category, null, GettextCatalog.GetString ("Qualify member access with 'this'"), null);
+ // AddOption (styleOptions, category, null, GettextCatalog.GetString ("Use 'var' when generating locals"), null);
- category = AddOption (wrappingOptions, null, GettextCatalog.GetString ("Indexer usage"), null);
- AddOption (wrappingOptions, category, "IndexerArgumentWrapping", GettextCatalog.GetString ("Arguments"), longIndexer);
- AddOption (wrappingOptions, category, "NewLineAferIndexerOpenBracket", GettextCatalog.GetString ("New line after open bracket"), longIndexer);
- AddOption (wrappingOptions, category, "IndexerClosingBracketOnNewLine", GettextCatalog.GetString ("New line before closing bracket"), longIndexer);
- AddOption (wrappingOptions, category, "AlignToFirstIndexerArgument", GettextCatalog.GetString ("Align to first parameter"), longIndexer);
-
- treeviewWrappingCategory.ExpandAll ();
+ treeviewStyle.ExpandAll ();
#endregion
- #region White space options
- whiteSpaceOptions = new TreeStore (typeof (string), typeof (string), typeof (string), typeof(bool), typeof(bool));
-
-
+ #region Wrapping options
+ wrappingOptions = new TreeStore (typeof(string), typeof(string), typeof(string), typeof(bool), typeof(bool));
+
column = new TreeViewColumn ();
// pixbuf column
column.PackStart (pixbufCellRenderer, false);
column.SetCellDataFunc (pixbufCellRenderer, RenderIcon);
-
+
// text column
cellRendererText.Ypad = 1;
column.PackStart (cellRendererText, true);
column.SetAttributes (cellRendererText, "text", 1);
-
- treeviewInsertWhiteSpaceCategory.Model = whiteSpaceOptions;
- treeviewInsertWhiteSpaceCategory.HeadersVisible = false;
- treeviewInsertWhiteSpaceCategory.Selection.Changed += TreeSelectionChanged;
- treeviewInsertWhiteSpaceCategory.AppendColumn (column);
-
+
+ treeviewWrapping.Model = wrappingOptions;
+ treeviewWrapping.HeadersVisible = false;
+ treeviewWrapping.Selection.Changed += TreeSelectionChanged;
+ treeviewWrapping.AppendColumn (column);
+
column = new TreeViewColumn ();
cellRendererCombo = new CellRendererCombo ();
cellRendererCombo.Ypad = 1;
@@ -832,334 +584,26 @@ class Test
cellRendererCombo.Model = ComboBoxStore;
cellRendererCombo.HasEntry = false;
cellRendererCombo.Editable = !profile.IsBuiltIn;
- cellRendererCombo.Edited += new ComboboxEditedHandler (this, whiteSpaceOptions).ComboboxEdited;
+ cellRendererCombo.Edited += new ComboboxEditedHandler (this, wrappingOptions).ComboboxEdited;
column.PackStart (cellRendererCombo, false);
column.SetAttributes (cellRendererCombo, "visible", comboVisibleColumn);
column.SetCellDataFunc (cellRendererCombo, ComboboxDataFunc);
-
+
cellRendererToggle = new CellRendererToggle ();
cellRendererToggle.Activatable = !profile.IsBuiltIn;
cellRendererToggle.Ypad = 1;
- cellRendererToggle.Toggled += new CellRendererToggledHandler (this, treeviewInsertWhiteSpaceCategory, whiteSpaceOptions).Toggled;
+ cellRendererToggle.Toggled += new CellRendererToggledHandler (this, treeviewSpacing, wrappingOptions).Toggled;
column.PackStart (cellRendererToggle, false);
column.SetAttributes (cellRendererToggle, "visible", toggleVisibleColumn);
column.SetCellDataFunc (cellRendererToggle, ToggleDataFunc);
-
- treeviewInsertWhiteSpaceCategory.AppendColumn (column);
-
- string example = @"class Example {
- void Test ()
- {
- }
-
- void Test (int a, int b, int c)
- {
- }
-}";
- category = AddOption (whiteSpaceOptions, null, GettextCatalog.GetString ("Declarations"), example);
- AddOption (whiteSpaceOptions, category, "BeforeMethodDeclarationParentheses", GettextCatalog.GetString ("before opening parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "WithinMethodDeclarationParentheses", GettextCatalog.GetString ("within parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "BetweenEmptyMethodDeclarationParentheses", GettextCatalog.GetString ("between empty parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "BeforeMethodDeclarationParameterComma", GettextCatalog.GetString ("before comma in parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "AfterMethodDeclarationParameterComma", GettextCatalog.GetString ("after comma in parenthesis"), example);
-
- example = @"class Example {
- int a, b, c;
-}";
- category = AddOption (whiteSpaceOptions, null, GettextCatalog.GetString ("Fields"), example);
- AddOption (whiteSpaceOptions, category, "BeforeFieldDeclarationComma", GettextCatalog.GetString ("before comma in multiple field declarations"), example);
- AddOption (whiteSpaceOptions, category, "AfterFieldDeclarationComma", GettextCatalog.GetString ("after comma in multiple field declarations"), example);
-
- example = @"class Example {
- Example ()
- {
- }
-
- Example (int a, int b, int c)
- {
- }
-}";
- category = AddOption (whiteSpaceOptions, null, GettextCatalog.GetString ("Constructors"), example);
- AddOption (whiteSpaceOptions, category, "BeforeConstructorDeclarationParentheses", GettextCatalog.GetString ("before opening parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "WithinConstructorDeclarationParentheses", GettextCatalog.GetString ("within parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "BetweenEmptyConstructorDeclarationParentheses", GettextCatalog.GetString ("between empty parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "BeforeConstructorDeclarationParameterComma", GettextCatalog.GetString ("before comma in parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "AfterConstructorDeclarationParameterComma", GettextCatalog.GetString ("after comma in parenthesis"), example);
-
- example = @"class Example {
- public int this[int a, int b] {
- get {
- return a + b;
- }
- }
-}";
- category = AddOption (whiteSpaceOptions, null, GettextCatalog.GetString ("Indexer"), example);
- AddOption (whiteSpaceOptions, category, "BeforeIndexerDeclarationBracket", GettextCatalog.GetString ("before opening bracket"), example);
- AddOption (whiteSpaceOptions, category, "WithinIndexerDeclarationBracket", GettextCatalog.GetString ("within brackets"), example);
- AddOption (whiteSpaceOptions, category, "BeforeIndexerDeclarationParameterComma", GettextCatalog.GetString ("before comma in brackets"), example);
- AddOption (whiteSpaceOptions, category, "AfterIndexerDeclarationParameterComma", GettextCatalog.GetString ("after comma in brackets"), example);
-
- example = @"delegate void FooBar (int a, int b, int c);
-delegate void BarFoo ();
-";
-
- category = AddOption (whiteSpaceOptions, null, GettextCatalog.GetString ("Delegates"), example);
- AddOption (whiteSpaceOptions, category, "BeforeDelegateDeclarationParentheses", GettextCatalog.GetString ("before opening parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "WithinDelegateDeclarationParentheses", GettextCatalog.GetString ("within parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "BetweenEmptyDelegateDeclarationParentheses", GettextCatalog.GetString ("between empty parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "BeforeDelegateDeclarationParameterComma", GettextCatalog.GetString ("before comma in parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "AfterDelegateDeclarationParameterComma", GettextCatalog.GetString ("after comma in parenthesis"), example);
-
- var upperCategory = AddOption (whiteSpaceOptions, null, GettextCatalog.GetString ("Statements"), null);
-
- category = AddOption (whiteSpaceOptions, upperCategory, null, GettextCatalog.GetString ("'if'"), simpleIf);
- AddOption (whiteSpaceOptions, category, "IfParentheses", GettextCatalog.GetString ("before opening parenthesis"), simpleIf);
- AddOption (whiteSpaceOptions, category, "WithinIfParentheses", GettextCatalog.GetString ("within parenthesis"), simpleIf);
-
- category = AddOption (whiteSpaceOptions, upperCategory, null, GettextCatalog.GetString ("'while'"), simpleWhile);
- AddOption (whiteSpaceOptions, category, "WhileParentheses", GettextCatalog.GetString ("before opening parenthesis"), simpleWhile);
- AddOption (whiteSpaceOptions, category, "WithinWhileParentheses", GettextCatalog.GetString ("within parenthesis"), simpleWhile);
-
- category = AddOption (whiteSpaceOptions, upperCategory, null, GettextCatalog.GetString ("'for'"), simpleFor);
- AddOption (whiteSpaceOptions, category, "ForParentheses", GettextCatalog.GetString ("before opening parenthesis"), simpleFor);
- AddOption (whiteSpaceOptions, category, "WithinForParentheses", GettextCatalog.GetString ("within parenthesis"), simpleFor);
- AddOption (whiteSpaceOptions, category, "SpacesBeforeForSemicolon", GettextCatalog.GetString ("before semicolon"), simpleFor);
- AddOption (whiteSpaceOptions, category, "SpacesAfterForSemicolon", GettextCatalog.GetString ("after semicolon"), simpleFor);
-
- category = AddOption (whiteSpaceOptions, upperCategory, null, GettextCatalog.GetString ("'foreach'"), simpleForeach);
- AddOption (whiteSpaceOptions, category, "ForeachParentheses", GettextCatalog.GetString ("before opening parenthesis"), simpleForeach);
- AddOption (whiteSpaceOptions, category, "WithinForEachParentheses", GettextCatalog.GetString ("within parenthesis"), simpleForeach);
-
- category = AddOption (whiteSpaceOptions, upperCategory, null, GettextCatalog.GetString ("'catch'"), simpleCatch);
- AddOption (whiteSpaceOptions, category, "CatchParentheses", GettextCatalog.GetString ("before opening parenthesis"), simpleCatch);
- AddOption (whiteSpaceOptions, category, "WithinCatchParentheses", GettextCatalog.GetString ("within parenthesis"), simpleCatch);
-
- category = AddOption (whiteSpaceOptions, upperCategory, null, GettextCatalog.GetString ("'switch'"), switchExample);
- AddOption (whiteSpaceOptions, category, "SwitchParentheses", GettextCatalog.GetString ("before opening parenthesis"), switchExample);
- AddOption (whiteSpaceOptions, category, "WithinSwitchParentheses", GettextCatalog.GetString ("within parenthesis"), switchExample);
-
- category = AddOption (whiteSpaceOptions, upperCategory, null, GettextCatalog.GetString ("'lock'"), simpleLock);
- AddOption (whiteSpaceOptions, category, "LockParentheses", GettextCatalog.GetString ("before opening parenthesis"), simpleLock);
- AddOption (whiteSpaceOptions, category, "WithinLockParentheses", GettextCatalog.GetString ("within parenthesis"), simpleLock);
-
- category = AddOption (whiteSpaceOptions, upperCategory, null, GettextCatalog.GetString ("'using'"), simpleUsingStatement);
- AddOption (whiteSpaceOptions, category, "UsingParentheses", GettextCatalog.GetString ("before opening parenthesis"), simpleUsingStatement);
- AddOption (whiteSpaceOptions, category, "WithinUsingParentheses", GettextCatalog.GetString ("within parenthesis"), simpleUsingStatement);
-
-
- upperCategory = AddOption (whiteSpaceOptions, null, GettextCatalog.GetString ("Expressions"), null);
-
- example = @"class Example {
- void Test ()
- {
- Console.WriteLine();
- Console.WriteLine(""{0} {1}!"", ""Hello"", ""World"");
- }
-}";
-
- category = AddOption (whiteSpaceOptions, upperCategory, null, GettextCatalog.GetString ("Method invocations"), example);
- AddOption (whiteSpaceOptions, category, "BeforeMethodCallParentheses", GettextCatalog.GetString ("before opening parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "WithinMethodCallParentheses", GettextCatalog.GetString ("within parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "BetweenEmptyMethodCallParentheses", GettextCatalog.GetString ("between empty parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "BeforeMethodCallParameterComma", GettextCatalog.GetString ("before comma in parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "AfterMethodCallParameterComma", GettextCatalog.GetString ("after comma in parenthesis"), example);
-
- category = AddOption (whiteSpaceOptions, upperCategory, null, GettextCatalog.GetString ("Object creation"), example);
- example = @"partial class Example {
- void Test ()
- {
- var anExample = new Example (1, 2, 3);
- var emptyExample = new Example ();
- }
-}";
- AddOption (whiteSpaceOptions, category, "NewParentheses", GettextCatalog.GetString ("before opening parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "WithinNewParentheses", GettextCatalog.GetString ("within parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "BetweenEmptyNewParentheses", GettextCatalog.GetString ("between empty parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "BeforeNewParameterComma", GettextCatalog.GetString ("before comma in parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "AfterNewParameterComma", GettextCatalog.GetString ("after comma in parenthesis"), example);
-
-
- example = @"class Example {
- void Test ()
- {
- a[1,2] = b[3];
- }
-}";
- category = AddOption (whiteSpaceOptions, upperCategory, null, GettextCatalog.GetString ("Element access"), example);
- AddOption (whiteSpaceOptions, category, "SpacesBeforeBrackets", GettextCatalog.GetString ("before opening bracket"), example);
- AddOption (whiteSpaceOptions, category, "SpacesWithinBrackets", GettextCatalog.GetString ("within brackets"), example);
- AddOption (whiteSpaceOptions, category, "BeforeBracketComma", GettextCatalog.GetString ("before comma in brackets"), example);
- AddOption (whiteSpaceOptions, category, "AfterBracketComma", GettextCatalog.GetString ("after comma in brackets"), example);
-
- category = AddOption (whiteSpaceOptions, upperCategory, null, GettextCatalog.GetString ("Parentheses"), operatorExample);
- AddOption (whiteSpaceOptions, category, "WithinParentheses", GettextCatalog.GetString ("within parenthesis"), operatorExample);
-
- example = @"class ClassDeclaration {
- public void Test (object o)
- {
- int i = (int)o;
- }
- }";
- category = AddOption (whiteSpaceOptions, upperCategory, null, GettextCatalog.GetString ("Type cast"), example);
- AddOption (whiteSpaceOptions, category, "WithinCastParentheses", GettextCatalog.GetString ("within parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "SpacesAfterTypecast", GettextCatalog.GetString ("after type cast"), example);
-
- example = @"class ClassDeclaration {
- public void Test ()
- {
- int i = sizeof (ClassDeclaration);
- }
- }";
- category = AddOption (whiteSpaceOptions, upperCategory, null, GettextCatalog.GetString ("'sizeof'"), example);
- AddOption (whiteSpaceOptions, category, "BeforeSizeOfParentheses", GettextCatalog.GetString ("before opening parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "WithinSizeOfParentheses", GettextCatalog.GetString ("within parenthesis"), example);
-
- example = @"class ClassDeclaration {
- public void Test ()
- {
- Type t = typeof (ClassDeclaration);
- }
- }";
- category = AddOption (whiteSpaceOptions, upperCategory, null, GettextCatalog.GetString ("'typeof'"), example);
- AddOption (whiteSpaceOptions, category, "BeforeTypeOfParentheses", GettextCatalog.GetString ("before opening parenthesis"), example);
- AddOption (whiteSpaceOptions, category, "WithinTypeOfParentheses", GettextCatalog.GetString ("within parenthesis"), example);
-
- category = AddOption (whiteSpaceOptions, upperCategory, null, GettextCatalog.GetString ("Around Operators"), operatorExample);
- AddOption (whiteSpaceOptions, category, "AroundAssignmentParentheses", GettextCatalog.GetString ("Assignment (=, +=, -=, ...)"), operatorExample);
- AddOption (whiteSpaceOptions, category, "AroundLogicalOperatorParentheses", GettextCatalog.GetString ("Logical (&&, ||) operators"), operatorExample);
- AddOption (whiteSpaceOptions, category, "AroundEqualityOperatorParentheses", GettextCatalog.GetString ("Equality (==, !=) operators"), operatorExample);
- AddOption (whiteSpaceOptions, category, "AroundRelationalOperatorParentheses", GettextCatalog.GetString ("Relational (<, >, <=, >=) operators"), operatorExample);
- AddOption (whiteSpaceOptions, category, "AroundBitwiseOperatorParentheses", GettextCatalog.GetString ("Bitwise &, |, ^, ~() operators"), operatorExample);
- AddOption (whiteSpaceOptions, category, "AroundAdditiveOperatorParentheses", GettextCatalog.GetString ("Additive (+, -) operators"), operatorExample);
- AddOption (whiteSpaceOptions, category, "AroundMultiplicativeOperatorParentheses", GettextCatalog.GetString ("Multiplicative (*, /, %) operators"), operatorExample);
- AddOption (whiteSpaceOptions, category, "AroundShiftOperatorParentheses", GettextCatalog.GetString ("Shift (<<, >>) operators"), operatorExample);
- AddOption (whiteSpaceOptions, category, "AroundNullCoalescingOperator", GettextCatalog.GetString ("Null coalescing (??) operator"), operatorExample);
- AddOption (whiteSpaceOptions, category, "SpaceAfterUnsafeAddressOfOperator", GettextCatalog.GetString ("Unsafe addressof operator (&)"), @"unsafe class ClassDeclaration {
- public void TestMethod ()
- {
- int* a = &x;
- }
-}");
- AddOption (whiteSpaceOptions, category, "SpaceAfterUnsafeAsteriskOfOperator", GettextCatalog.GetString ("Unsafe asterisk operator (*)"), @"unsafe class ClassDeclaration {
- public void TestMethod ()
- {
- int a = *x;
- }
-}");
- AddOption (whiteSpaceOptions, category, "SpaceAroundUnsafeArrowOperator", GettextCatalog.GetString ("Unsafe arrow operator (->)"), @"unsafe class ClassDeclaration {
- public void TestMethod ()
- {
- x->Foo();
- }
-}");
- category = AddOption (whiteSpaceOptions, upperCategory, null, GettextCatalog.GetString ("Conditional Operator (?:)"), condOpExample);
- AddOption (whiteSpaceOptions, category, "ConditionalOperatorBeforeConditionSpace", GettextCatalog.GetString ("before '?'"), condOpExample);
- AddOption (whiteSpaceOptions, category, "ConditionalOperatorAfterConditionSpace", GettextCatalog.GetString ("after '?'"), condOpExample);
- AddOption (whiteSpaceOptions, category, "ConditionalOperatorBeforeSeparatorSpace", GettextCatalog.GetString ("before ':'"), condOpExample);
- AddOption (whiteSpaceOptions, category, "ConditionalOperatorAfterSeparatorSpace", GettextCatalog.GetString ("after ':'"), condOpExample);
-
- example = @"class ClassDeclaration {
- string[][] field;
- int[] test;
- }";
- category = AddOption (whiteSpaceOptions, upperCategory, null, GettextCatalog.GetString ("Array Declarations"), example);
- AddOption (whiteSpaceOptions, category, "SpacesBeforeArrayDeclarationBrackets", GettextCatalog.GetString ("before opening bracket"), example);
+ treeviewWrapping.AppendColumn (column);
- category = AddOption (whiteSpaceOptions, upperCategory, null, GettextCatalog.GetString ("Other"), example);
- AddOption (whiteSpaceOptions, category, "SpaceBeforeSemicolon", GettextCatalog.GetString ("before semicolon"), example);
-
- /*
- whiteSpaceOptions= new ListStore (typeof (Option), typeof (bool), typeof (bool));
- column = new TreeViewColumn ();
- // text column
- column.PackStart (cellRendererText, true);
- column.SetCellDataFunc (cellRendererText, delegate (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter) {
- ((CellRendererText)cell).Text = ((Option)model.GetValue (iter, 0)).DisplayName;
- });
- treeviewInsertWhiteSpaceOptions.AppendColumn (column);
-
- column = new TreeViewColumn ();
- cellRendererCombo = new CellRendererCombo ();
- cellRendererCombo.Ypad = 1;
- cellRendererCombo.Mode = CellRendererMode.Editable;
- cellRendererCombo.TextColumn = 1;
- cellRendererCombo.Model = comboBoxStore;
- cellRendererCombo.HasEntry = false;
- cellRendererCombo.Editable = !profile.IsBuiltIn;
-
- cellRendererCombo.Edited += delegate(object o, EditedArgs args) {
- TreeIter iter;
- var model = whiteSpaceOptions;
- if (model.GetIterFromString (out iter, args.Path)) {
- var option = (Option)model.GetValue (iter, 0);
- PropertyInfo info = GetPropertyByName (option.PropertyName);
- if (info == null)
- return;
- var value = Enum.Parse (info.PropertyType, args.NewText);
- info.SetValue (profile, value, null);
- UpdateExample (texteditor.Document.Text);
- }
- };
-
- column.PackStart (cellRendererCombo, false);
- column.SetAttributes (cellRendererCombo, "visible", 2);
- column.SetCellDataFunc (cellRendererCombo, delegate (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter) {
- ((CellRendererCombo)cell).Text = GetValue (((Option)model.GetValue (iter, 0)).PropertyName).ToString ();
- });
-
- cellRendererToggle = new CellRendererToggle ();
- cellRendererToggle.Activatable = !profile.IsBuiltIn;
- cellRendererToggle.Ypad = 1;
- cellRendererToggle.Toggled += delegate(object o, ToggledArgs args) {
- TreeIter iter;
- var model = whiteSpaceOptions;
- if (model.GetIterFromString (out iter, args.Path)) {
- var option = (Option)model.GetValue (iter, 0);
- PropertyInfo info = GetPropertyByName (option.PropertyName);
- if (info == null || info.PropertyType != typeof(bool))
- return;
- bool value = (bool)info.GetValue (this.profile, null);
- info.SetValue (profile, !value, null);
- UpdateExample (texteditor.Document.Text);
- }
- };
-
- column.PackStart (cellRendererToggle, false);
- column.SetAttributes (cellRendererToggle, "visible", 1);
- column.SetCellDataFunc (cellRendererToggle, delegate (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter) {
- ((CellRendererToggle)cell).Active = (bool)GetValue (((Option)model.GetValue (iter, 0)).PropertyName);
- });
-
- treeviewInsertWhiteSpaceOptions.AppendColumn (column);
-
- treeviewInsertWhiteSpaceOptions.Model = whiteSpaceOptions;*/
- treeviewInsertWhiteSpaceCategory.ExpandAll ();
- #endregion
-
- #region Blank line options
- entryBeforUsings.Text = profile.BlankLinesBeforeUsings.ToString ();
- entryAfterUsings.Text = profile.BlankLinesAfterUsings.ToString ();
-
- entryBeforeFirstDeclaration.Text = profile.BlankLinesBeforeFirstDeclaration.ToString ();
- entryBetweenTypes.Text = profile.BlankLinesBetweenTypes.ToString ();
-
- entryBetweenFields.Text = profile.BlankLinesBetweenFields.ToString ();
- entryBetweenEvents.Text = profile.BlankLinesBetweenEventFields.ToString ();
- entryBetweenMembers.Text = profile.BlankLinesBetweenMembers.ToString ();
- entryInsideRegion.Text = profile.BlankLinesInsideRegion.ToString ();
- entryAroundRegion.Text = profile.BlankLinesAroundRegion.ToString ();
+ AddOption (wrappingOptions, "WrappingPreserveSingleLine", GettextCatalog.GetString ("Leave block on single line"), "");
+ AddOption (wrappingOptions, "WrappingKeepStatementsOnSingleLine", GettextCatalog.GetString ("Leave statements and member declarations on the same line"), "");
- entryBeforUsings.Changed += HandleEntryBeforUsingsChanged;
- entryAfterUsings.Changed += HandleEntryBeforUsingsChanged;
- entryBeforeFirstDeclaration.Changed += HandleEntryBeforUsingsChanged;
- entryBetweenTypes.Changed += HandleEntryBeforUsingsChanged;
- entryBetweenFields.Changed += HandleEntryBeforUsingsChanged;
- entryBetweenEvents.Changed += HandleEntryBeforUsingsChanged;
- entryBetweenMembers.Changed += HandleEntryBeforUsingsChanged;
- entryAroundRegion.Changed += HandleEntryBeforUsingsChanged;
- entryInsideRegion.Changed += HandleEntryBeforUsingsChanged;
+ treeviewWrapping.ExpandAll ();
#endregion
}
@@ -1169,20 +613,6 @@ delegate void BarFoo ();
return int.TryParse (entry.Text, out newValue) ? newValue : oldValue;
}
- void HandleEntryBeforUsingsChanged (object sender, EventArgs e)
- {
- profile.BlankLinesBeforeUsings = SetFlag (entryBeforUsings, profile.BlankLinesBeforeUsings);
- profile.BlankLinesAfterUsings = SetFlag (entryAfterUsings, profile.BlankLinesAfterUsings);
- profile.BlankLinesBeforeFirstDeclaration = SetFlag (entryBeforeFirstDeclaration, profile.BlankLinesBeforeFirstDeclaration);
- profile.BlankLinesBetweenTypes = SetFlag (entryBetweenTypes, profile.BlankLinesBetweenTypes);
- profile.BlankLinesBetweenFields = SetFlag (entryBetweenFields, profile.BlankLinesBetweenFields);
- profile.BlankLinesBetweenMembers = SetFlag (entryBetweenMembers, profile.BlankLinesBetweenMembers);
- profile.BlankLinesBetweenEventFields = SetFlag (entryBetweenEvents, profile.BlankLinesBetweenMembers);
- profile.BlankLinesAroundRegion = SetFlag (entryAroundRegion, profile.BlankLinesAroundRegion);
- profile.BlankLinesInsideRegion = SetFlag (entryInsideRegion, profile.BlankLinesInsideRegion);
- UpdateExample (blankLineExample);
- }
-
static PropertyInfo GetPropertyByName (string name)
{
PropertyInfo info = typeof(CSharpFormattingPolicy).GetProperty (name);
@@ -1190,8 +620,7 @@ delegate void BarFoo ();
throw new Exception (name + " property not found");
return info;
}
-
-
+
static TreeIter AddOption (TreeStore model, string propertyName, string displayName, string example)
{
bool isBool = false;
@@ -1247,7 +676,10 @@ delegate void BarFoo ();
} else {
text = "";
}
- texteditor.Document.Text = CSharpFormatter.FormatText (profile, null, CSharpFormatter.MimeType, text, 0, text.Length);
+
+ var types = DesktopService.GetMimeTypeInheritanceChain (MonoDevelop.CSharp.Formatting.CSharpFormatter.MimeType);
+ var textPolicy = MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<TextStylePolicy> (types);
+ texteditor.Text = CSharpFormatter.FormatText (profile, textPolicy, text, 0, text.Length);
}
static PropertyInfo GetProperty (TreeModel model, TreeIter iter)
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpIndentVirtualSpaceManager.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpIndentVirtualSpaceManager.cs
index 0782defa74..2970e88724 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpIndentVirtualSpaceManager.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpIndentVirtualSpaceManager.cs
@@ -24,62 +24,44 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.CSharp;
using System;
using MonoDevelop.Core;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Extension;
+using ICSharpCode.NRefactory6.CSharp;
namespace MonoDevelop.CSharp.Formatting
{
- class IndentVirtualSpaceManager : IIndentationTracker
+ class IndentVirtualSpaceManager : IndentationTracker
{
- readonly TextEditorData data;
- readonly CacheIndentEngine stateTracker;
-
- public IndentVirtualSpaceManager(TextEditorData data, CacheIndentEngine stateTracker)
+ readonly TextEditor data;
+ readonly CacheIndentEngine stateTracker;
+
+ public IndentVirtualSpaceManager(TextEditor data, CacheIndentEngine stateTracker)
{
this.data = data;
this.stateTracker = stateTracker;
}
- string GetIndentationString (DocumentLocation loc)
+ #region IndentationTracker implementation
+ public override string GetIndentationString (int lineNumber)
{
- var line = data.Document.GetLine (loc.Line);
+ var line = data.GetLine (lineNumber);
if (line == null)
return "";
// Get context to the end of the line w/o changing the main engine's state
var offset = line.Offset;
- string curIndent = line.GetIndentation (data.Document);
+ string curIndent = line.GetIndentation (data);
try {
- stateTracker.Update (Math.Min (data.Length, offset + Math.Min (line.Length, loc.Column - 1)));
+ stateTracker.Update (data, Math.Min (data.Length, offset + line.Length));
int nlwsp = curIndent.Length;
- if (!stateTracker.LineBeganInsideMultiLineComment || (nlwsp < line.LengthIncludingDelimiter && data.Document.GetCharAt (offset + nlwsp) == '*'))
+ if (!stateTracker.LineBeganInsideMultiLineComment || (nlwsp < line.LengthIncludingDelimiter && data.GetCharAt (offset + nlwsp) == '*'))
return stateTracker.ThisLineIndent;
} catch (Exception e) {
- LoggingService.LogError ("Error while indenting at "+ loc, e);
+ LoggingService.LogError ("Error while indenting at line " + lineNumber, e);
}
return curIndent;
}
-
- public string GetIndentationString (int lineNumber, int column)
- {
- return GetIndentationString (new DocumentLocation (lineNumber, column));
- }
-
- public string GetIndentationString (int offset)
- {
- return GetIndentationString (data.OffsetToLocation (offset));
- }
-
- public int GetVirtualIndentationColumn (int offset)
- {
- return 1 + GetIndentationString (offset).Length;
- }
-
- public int GetVirtualIndentationColumn (int lineNumber, int column)
- {
- return 1 + GetIndentationString (lineNumber, column).Length;
- }
+ #endregion
}
-}
-
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs
index fce4666569..83290e9f36 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs
@@ -31,48 +31,39 @@ using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.CSharp.Formatting;
-using MonoDevelop.CSharp.Refactoring;
-using Mono.TextEditor;
using MonoDevelop.Ide.CodeTemplates;
-using MonoDevelop.SourceEditor;
-using ICSharpCode.NRefactory.CSharp.Completion;
-using ICSharpCode.NRefactory.Editor;
using System.Linq;
using System.Text;
-using ICSharpCode.NRefactory.CSharp;
using MonoDevelop.Ide;
-using ICSharpCode.NRefactory;
-
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Extension;
+using MonoDevelop.Projects;
+using MonoDevelop.Core.Text;
+using ICSharpCode.NRefactory6.CSharp;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Options;
+using MonoDevelop.Refactoring;
+
namespace MonoDevelop.CSharp.Formatting
{
class CSharpTextEditorIndentation : TextEditorExtension
{
- CacheIndentEngine stateTracker;
+ internal ICSharpCode.NRefactory6.CSharp.CacheIndentEngine stateTracker;
int cursorPositionBeforeKeyPress;
- TextEditorData textEditorData {
- get {
- return document.Editor;
- }
- }
-
- readonly IEnumerable<string> types = DesktopService.GetMimeTypeInheritanceChain (CSharpFormatter.MimeType);
+ readonly static IEnumerable<string> types = DesktopService.GetMimeTypeInheritanceChain (CSharpFormatter.MimeType);
CSharpFormattingPolicy Policy {
get {
- if (Document != null && Document.Project != null && Document.Project.Policies != null) {
- return Document.Project.Policies.Get<CSharpFormattingPolicy> (types);
- }
- return MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<CSharpFormattingPolicy> (types);
+ return DocumentContext.GetPolicy<CSharpFormattingPolicy> (types);
}
}
TextStylePolicy TextStylePolicy {
get {
- if (Document != null && Document.Project != null && Document.Project.Policies != null) {
- return Document.Project.Policies.Get<TextStylePolicy> (types);
- }
- return MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<TextStylePolicy> (types);
+ return DocumentContext.GetPolicy<TextStylePolicy> (types);
}
}
@@ -80,64 +71,33 @@ namespace MonoDevelop.CSharp.Formatting
static CSharpTextEditorIndentation ()
{
- CompletionWindowManager.WordCompleted += delegate(object sender, CodeCompletionContextEventArgs e) {
- var editor = e.Widget as IExtensibleTextEditor;
+ CompletionWindowManager.WordCompleted += delegate (object sender, CodeCompletionContextEventArgs e) {
+ var editor = e.Widget as IServiceProvider;
if (editor == null)
return;
- var textEditorExtension = editor.Extension;
- while (textEditorExtension != null && !(textEditorExtension is CSharpTextEditorIndentation)) {
- textEditorExtension = textEditorExtension.Next;
- }
- var extension = textEditorExtension as CSharpTextEditorIndentation;
+ var extension = editor.GetService (typeof (CSharpTextEditorIndentation)) as CSharpTextEditorIndentation;
if (extension == null)
return;
- extension.SafeUpdateIndentEngine (extension.textEditorData.Caret.Offset);
+ extension.SafeUpdateIndentEngine (extension.Editor.CaretOffset);
if (extension.stateTracker.NeedsReindent)
extension.DoReSmartIndent ();
};
+
+ RefactoringService.OptionSetCreation = (editor, ctx) => {
+ var policy = ctx.Project.Policies.Get<CSharpFormattingPolicy> (types);
+ return policy.CreateOptions (editor.Options);
+ };
}
internal void SafeUpdateIndentEngine (int offset)
{
try {
- stateTracker.Update (offset);
+ stateTracker.Update (Editor, offset);
} catch (Exception e) {
LoggingService.LogError ("Error while updating the indentation engine", e);
}
}
- void HandleTextPaste (int insertionOffset, string text, int insertedChars)
- {
- if (document.Editor.Options.IndentStyle == IndentStyle.None ||
- document.Editor.Options.IndentStyle == IndentStyle.Auto)
- return;
-
- // Just correct the start line of the paste operation - the text is already indented.
- var curLine = Editor.GetLineByOffset (insertionOffset);
- var curLineOffset = curLine.Offset;
- SafeUpdateIndentEngine (curLineOffset);
- if (!stateTracker.IsInsideOrdinaryCommentOrString) {
- int pos = curLineOffset;
- string curIndent = curLine.GetIndentation (textEditorData.Document);
- int nlwsp = curIndent.Length;
-
- if (!stateTracker.LineBeganInsideMultiLineComment || (nlwsp < curLine.LengthIncludingDelimiter && textEditorData.Document.GetCharAt (curLineOffset + nlwsp) == '*')) {
- // Possibly replace the indent
- SafeUpdateIndentEngine (curLineOffset + curLine.Length);
- string newIndent = stateTracker.ThisLineIndent;
- if (newIndent != curIndent) {
- if (CompletionWindowManager.IsVisible) {
- if (pos < CompletionWindowManager.CodeCompletionContext.TriggerOffset)
- CompletionWindowManager.CodeCompletionContext.TriggerOffset -= nlwsp;
- }
- textEditorData.Replace (pos, nlwsp, newIndent);
- textEditorData.Document.CommitLineUpdate (textEditorData.Caret.Line);
- }
- }
- }
- textEditorData.FixVirtualIndentation ();
- }
-
public static bool OnTheFlyFormatting {
get {
return PropertyService.Get ("OnTheFlyFormatting", true);
@@ -147,24 +107,23 @@ namespace MonoDevelop.CSharp.Formatting
}
}
- void RunFormatter (DocumentLocation location)
+ void RunFormatter (MonoDevelop.Ide.Editor.DocumentLocation location)
{
- if (OnTheFlyFormatting && textEditorData != null && !(textEditorData.CurrentMode is TextLinkEditMode) && !(textEditorData.CurrentMode is InsertionCursorEditMode)) {
- OnTheFlyFormatter.Format (Document, location);
- }
+ if (!OnTheFlyFormatting || Editor == null || Editor.EditMode != EditMode.Edit)
+ return;
+ var offset = Editor.LocationToOffset (location);
+ OnTheFlyFormatter.Format (Editor, DocumentContext, offset, offset, optionSet: optionSet);
}
- public override void Initialize ()
+ protected override void Initialize ()
{
base.Initialize ();
-
- if (textEditorData != null) {
- textEditorData.Options.Changed += HandleTextOptionsChanged;
+ if (Editor != null) {
+ Editor.OptionsChanged += HandleTextOptionsChanged;
HandleTextOptionsChanged (this, EventArgs.Empty);
- textEditorData.Document.TextReplacing += HandleTextReplacing;
- textEditorData.Document.TextReplaced += HandleTextReplaced;
- textEditorData.Paste += HandleTextPaste;
+ Editor.TextChanging += HandleTextReplacing;
+ Editor.TextChanged += HandleTextReplaced;
}
if (IdeApp.Workspace != null)
IdeApp.Workspace.ActiveConfigurationChanged += HandleTextOptionsChanged;
@@ -172,47 +131,61 @@ namespace MonoDevelop.CSharp.Formatting
bool indentationDisabled;
+ public static IEnumerable<string> GetDefinedSymbols (MonoDevelop.Projects.Project project)
+ {
+ var workspace = IdeApp.Workspace;
+ if (workspace == null || project == null)
+ yield break;
+ var configuration = project.GetConfiguration (workspace.ActiveConfiguration) as DotNetProjectConfiguration;
+ if (configuration != null) {
+ foreach (string s in configuration.GetDefineSymbols ())
+ yield return s;
+ // Workaround for mcs defined symbol
+ if (configuration.TargetRuntime.RuntimeId == "Mono")
+ yield return "__MonoCS__";
+ }
+ }
+
void HandleTextOptionsChanged (object sender, EventArgs e)
{
- var policy = Policy.CreateOptions ();
- var options = Editor.CreateNRefactoryTextEditorOptions ();
- options.IndentBlankLines = true;
- IStateMachineIndentEngine indentEngine;
+ //var options = Editor.CreateNRefactoryTextEditorOptions ();
+ optionSet = Policy.CreateOptions (Editor.Options);
+ //options.IndentBlankLines = true;
+ ICSharpCode.NRefactory6.CSharp.IStateMachineIndentEngine indentEngine;
try {
- var csharpIndentEngine = new CSharpIndentEngine (textEditorData.Document, options, policy);
+ var csharpIndentEngine = new ICSharpCode.NRefactory6.CSharp.CSharpIndentEngine (optionSet);
//csharpIndentEngine.EnableCustomIndentLevels = true;
- foreach (var symbol in MonoDevelop.CSharp.Highlighting.CSharpSyntaxMode.GetDefinedSymbols (document.Project)) {
+ foreach (var symbol in GetDefinedSymbols (DocumentContext.Project)) {
csharpIndentEngine.DefineSymbol (symbol);
}
indentEngine = csharpIndentEngine;
} catch (Exception ex) {
LoggingService.LogError ("Error while creating the c# indentation engine", ex);
- indentEngine = new NullIStateMachineIndentEngine (textEditorData.Document);
+ indentEngine = new ICSharpCode.NRefactory6.CSharp.NullIStateMachineIndentEngine ();
}
- stateTracker = new CacheIndentEngine (indentEngine);
+ stateTracker = new ICSharpCode.NRefactory6.CSharp.CacheIndentEngine (indentEngine);
if (DefaultSourceEditorOptions.Instance.IndentStyle == IndentStyle.Auto) {
- textEditorData.IndentationTracker = new DefaultIndentationTracker (textEditorData.Document);
+ Editor.SetIndentationTracker (null);
} else {
- textEditorData.IndentationTracker = new IndentVirtualSpaceManager (textEditorData, stateTracker);
+ Editor.SetIndentationTracker (new IndentVirtualSpaceManager (Editor, stateTracker));
}
indentationDisabled = DefaultSourceEditorOptions.Instance.IndentStyle == IndentStyle.Auto || DefaultSourceEditorOptions.Instance.IndentStyle == IndentStyle.None;
if (indentationDisabled) {
- textEditorData.TextPasteHandler = null;
+ Editor.SetTextPasteHandler (null);
} else {
- textEditorData.TextPasteHandler = new TextPasteIndentEngine (stateTracker, options, policy);
+ Editor.SetTextPasteHandler (new CSharpTextPasteHandler (this, stateTracker, optionSet));
}
}
public override void Dispose ()
{
- if (textEditorData != null) {
- textEditorData.TextPasteHandler = null;
- textEditorData.Paste -= HandleTextPaste;
- textEditorData.Options.Changed -= HandleTextOptionsChanged;
- textEditorData.IndentationTracker = null;
- textEditorData.Document.TextReplacing -= HandleTextReplacing;
- textEditorData.Document.TextReplaced -= HandleTextReplaced;
+ if (Editor != null) {
+ Editor.SetTextPasteHandler (null);
+ Editor.OptionsChanged -= HandleTextOptionsChanged;
+ Editor.SetIndentationTracker (null);
+ Editor.TextChanging -= HandleTextReplacing;
+ Editor.TextChanged -= HandleTextReplaced;
}
IdeApp.Workspace.ActiveConfigurationChanged -= HandleTextOptionsChanged;
stateTracker = null;
@@ -221,31 +194,31 @@ namespace MonoDevelop.CSharp.Formatting
bool? wasInVerbatimString;
- void HandleTextReplaced (object sender, DocumentChangeEventArgs e)
+ void HandleTextReplaced (object sender, MonoDevelop.Core.Text.TextChangeEventArgs e)
{
- stateTracker.ResetEngineToPosition (e.Offset);
+ stateTracker.ResetEngineToPosition (Editor, e.Offset);
if (wasInVerbatimString == null)
return;
- if (e.RemovalLength != 1 || textEditorData.Document.CurrentAtomicUndoOperationType == OperationType.Format)
+ if (e.RemovalLength != 1 /*|| textEditorData.Document.CurrentAtomicUndoOperationType == OperationType.Format*/)
return;
- SafeUpdateIndentEngine (Math.Min (textEditorData.Document.TextLength, e.Offset + e.InsertionLength + 1));
+ SafeUpdateIndentEngine (Math.Min (Editor.Length, e.Offset + e.InsertionLength + 1));
if (wasInVerbatimString == true && !stateTracker.IsInsideVerbatimString) {
- textEditorData.Document.TextReplacing -= HandleTextReplacing;
- textEditorData.Document.TextReplaced -= HandleTextReplaced;
- ConvertVerbatimStringToNormal (textEditorData, e.Offset + e.InsertionLength + 1);
- textEditorData.Document.TextReplacing += HandleTextReplacing;
- textEditorData.Document.TextReplaced += HandleTextReplaced;
+ Editor.TextChanging -= HandleTextReplacing;
+ Editor.TextChanged -= HandleTextReplaced;
+ ConvertVerbatimStringToNormal (Editor, e.Offset + e.InsertionLength + 1);
+ Editor.TextChanging += HandleTextReplacing;
+ Editor.TextChanged += HandleTextReplaced;
}
}
- void HandleTextReplacing (object sender, DocumentChangeEventArgs e)
+ void HandleTextReplacing (object sender, MonoDevelop.Core.Text.TextChangeEventArgs e)
{
wasInVerbatimString = null;
var o = e.Offset + e.RemovalLength;
- if (o < 0 || o + 1 > textEditorData.Length || e.RemovalLength != 1 || textEditorData.Document.IsInUndo) {
+ if (o < 0 || o + 1 > Editor.Length || e.RemovalLength != 1/* || textEditorData.Document.IsInUndo*/) {
return;
}
- if (textEditorData.GetCharAt (o) != '"')
+ if (Editor.GetCharAt (o) != '"')
return;
SafeUpdateIndentEngine (o + 1);
wasInVerbatimString = stateTracker.IsInsideVerbatimString;
@@ -279,7 +252,7 @@ namespace MonoDevelop.CSharp.Formatting
return result.ToString ();
}
- static void ConvertNormalToVerbatimString (TextEditorData textEditorData, int offset)
+ static void ConvertNormalToVerbatimString (ITextDocument textEditorData, int offset)
{
var endOffset = offset;
while (endOffset < textEditorData.Length) {
@@ -301,10 +274,10 @@ namespace MonoDevelop.CSharp.Formatting
return;
var plainText = TextPasteUtils.StringLiteralPasteStrategy.Instance.Decode (textEditorData.GetTextAt (offset, endOffset - offset));
var newText = TextPasteUtils.VerbatimStringStrategy.Encode (plainText);
- textEditorData.Replace (offset, endOffset - offset, newText);
+ textEditorData.ReplaceText (offset, endOffset - offset, newText);
}
- static void ConvertVerbatimStringToNormal (TextEditorData textEditorData, int offset)
+ static void ConvertVerbatimStringToNormal (ITextDocument textEditorData, int offset)
{
var endOffset = offset;
while (endOffset < textEditorData.Length) {
@@ -320,14 +293,12 @@ namespace MonoDevelop.CSharp.Formatting
}
var plainText = TextPasteUtils.VerbatimStringStrategy.Decode (textEditorData.GetTextAt (offset, endOffset - offset));
var newText = TextPasteUtils.StringLiteralPasteStrategy.Instance.Encode (plainText);
- textEditorData.Replace (offset, endOffset - offset, newText);
+ textEditorData.ReplaceText (offset, endOffset - offset, newText);
}
- internal IStateMachineIndentEngine StateTracker { get { return stateTracker; } }
-
public bool DoInsertTemplate ()
{
- string word = CodeTemplate.GetWordBeforeCaret (textEditorData);
+ string word = CodeTemplate.GetTemplateShortcutBeforeCaret (Editor);
foreach (CodeTemplate template in CodeTemplateService.GetCodeTemplates (CSharpFormatter.MimeType)) {
if (template.Shortcut == word)
return true;
@@ -340,8 +311,8 @@ namespace MonoDevelop.CSharp.Formatting
void CheckXmlCommentCloseTag (char keyChar)
{
if (keyChar == '>' && stateTracker.IsInsideDocLineComment) {
- var location = Editor.Caret.Location;
- string lineText = Editor.GetLineText (Editor.Caret.Line);
+ var location = Editor.CaretLocation;
+ string lineText = Editor.GetLineText (Editor.CaretLine);
int startIndex = Math.Min (location.Column - 2, lineText.Length - 1);
while (startIndex >= 0 && lineText [startIndex] != '<') {
--startIndex;
@@ -357,8 +328,10 @@ namespace MonoDevelop.CSharp.Formatting
endIndex++;
}
string tag = endIndex - startIndex > 0 ? lineText.Substring (startIndex + 1, endIndex - startIndex - 1) : null;
- if (!string.IsNullOrEmpty (tag) && CSharpCompletionEngine.CommentTags.Any (t => t == tag)) {
- Editor.Document.Insert (Editor.Caret.Offset, "</" + tag + ">", AnchorMovementType.BeforeInsertion);
+ if (!string.IsNullOrEmpty (tag) && ICSharpCode.NRefactory.CSharp.Completion.CSharpCompletionEngine.CommentTags.Any (t => t == tag)) {
+ var caretOffset = Editor.CaretOffset;
+ Editor.InsertText (caretOffset, "</" + tag + ">");
+ Editor.CaretOffset = caretOffset;
}
}
}
@@ -366,99 +339,98 @@ namespace MonoDevelop.CSharp.Formatting
internal void ReindentOnTab ()
{
- int cursor = textEditorData.Caret.Offset;
- if (stateTracker.IsInsideVerbatimString && cursor > 0 && cursor < textEditorData.Document.TextLength && textEditorData.GetCharAt (cursor - 1) == '"')
+ int cursor = Editor.CaretOffset;
+ if (stateTracker.IsInsideVerbatimString && cursor > 0 && cursor < Editor.Length && Editor.GetCharAt (cursor - 1) == '"')
SafeUpdateIndentEngine (cursor + 1);
if (stateTracker.IsInsideVerbatimString) {
// insert normal tab inside @" ... "
- if (textEditorData.IsSomethingSelected) {
- textEditorData.SelectedText = "\t";
+ if (Editor.IsSomethingSelected) {
+ Editor.SelectedText = "\t";
}
else {
- textEditorData.Insert (cursor, "\t");
+ Editor.InsertText (cursor, "\t");
}
- textEditorData.Document.CommitLineUpdate (textEditorData.Caret.Line);
+ // textEditorData.Document.CommitLineUpdate (textEditorData.CaretLine);
}
else if (cursor >= 1) {
- if (textEditorData.Caret.Column > 1) {
+ if (Editor.CaretColumn > 1) {
int delta = cursor - cursorPositionBeforeKeyPress;
if (delta < 2 && delta > 0) {
- textEditorData.Remove (cursor - delta, delta);
- textEditorData.Caret.Offset = cursor - delta;
- textEditorData.Document.CommitLineUpdate (textEditorData.Caret.Line);
+ Editor.RemoveText (cursor - delta, delta);
+ Editor.CaretOffset = cursor - delta;
+ // textEditorData.Document.CommitLineUpdate (textEditorData.CaretLine);
}
}
- SafeUpdateIndentEngine (textEditorData.Caret.Offset);
+ SafeUpdateIndentEngine (Editor.CaretOffset);
DoReSmartIndent ();
}
}
- public override bool KeyPress (Gdk.Key key, char keyChar, Gdk.ModifierType modifier)
+ public override bool KeyPress (KeyDescriptor descriptor)
{
- bool skipFormatting = StateTracker.IsInsideOrdinaryCommentOrString ||
- StateTracker.IsInsidePreprocessorDirective;
-
- cursorPositionBeforeKeyPress = textEditorData.Caret.Offset;
- bool isSomethingSelected = textEditorData.IsSomethingSelected;
- if (key == Gdk.Key.BackSpace && textEditorData.Caret.Offset == lastInsertedSemicolon) {
- textEditorData.Document.Undo ();
+ completionWindowWasVisible = CompletionWindowManager.IsVisible;
+ cursorPositionBeforeKeyPress = Editor.CaretOffset;
+ bool isSomethingSelected = Editor.IsSomethingSelected;
+ if (descriptor.SpecialKey == SpecialKey.BackSpace && Editor.CaretOffset == lastInsertedSemicolon) {
+ EditActions.Undo (Editor);
lastInsertedSemicolon = -1;
return false;
}
+
lastInsertedSemicolon = -1;
- if (keyChar == ';' && !(textEditorData.CurrentMode is TextLinkEditMode) && !DoInsertTemplate () && !isSomethingSelected && PropertyService.Get (
+ if (descriptor.KeyChar == ';' && Editor.EditMode == EditMode.Edit && !DoInsertTemplate () && !isSomethingSelected && PropertyService.Get (
"SmartSemicolonPlacement",
false
) && !(stateTracker.IsInsideComment || stateTracker.IsInsideString)) {
- bool retval = base.KeyPress (key, keyChar, modifier);
- DocumentLine curLine = textEditorData.Document.GetLine (textEditorData.Caret.Line);
- string text = textEditorData.Document.GetTextAt (curLine);
+ bool retval = base.KeyPress (descriptor);
+ var curLine = Editor.GetLine (Editor.CaretLine);
+ string text = Editor.GetTextAt (curLine);
if (!(text.EndsWith (";", StringComparison.Ordinal) || text.Trim ().StartsWith ("for", StringComparison.Ordinal))) {
int guessedOffset;
- if (GuessSemicolonInsertionOffset (textEditorData, curLine, textEditorData.Caret.Offset, out guessedOffset)) {
- using (var undo = textEditorData.OpenUndoGroup ()) {
- textEditorData.Remove (textEditorData.Caret.Offset - 1, 1);
- textEditorData.Caret.Offset = guessedOffset;
- lastInsertedSemicolon = textEditorData.Caret.Offset + 1;
- retval = base.KeyPress (key, keyChar, modifier);
+ if (GuessSemicolonInsertionOffset (Editor, curLine, Editor.CaretOffset, out guessedOffset)) {
+ using (var undo = Editor.OpenUndoGroup ()) {
+ Editor.RemoveText (Editor.CaretOffset - 1, 1);
+ Editor.CaretOffset = guessedOffset;
+ lastInsertedSemicolon = Editor.CaretOffset + 1;
+ retval = base.KeyPress (descriptor);
}
}
}
- using (var undo = textEditorData.OpenUndoGroup ()) {
- if (OnTheFlyFormatting && textEditorData != null && !(textEditorData.CurrentMode is TextLinkEditMode) && !(textEditorData.CurrentMode is InsertionCursorEditMode)) {
- OnTheFlyFormatter.FormatStatmentAt (Document, textEditorData.Caret.Location);
+ using (var undo = Editor.OpenUndoGroup ()) {
+ if (OnTheFlyFormatting && Editor != null && Editor.EditMode == EditMode.Edit) {
+ OnTheFlyFormatter.FormatStatmentAt (Editor, DocumentContext, Editor.CaretLocation, optionSet: optionSet);
}
}
return retval;
}
- if (key == Gdk.Key.Tab) {
- SafeUpdateIndentEngine (textEditorData.Caret.Offset);
- if (stateTracker.IsInsideStringLiteral && !textEditorData.IsSomethingSelected) {
- var lexer = new CSharpCompletionEngineBase.MiniLexer (textEditorData.Document.GetTextAt (0, textEditorData.Caret.Offset));
+ if (descriptor.SpecialKey == SpecialKey.Tab && descriptor.ModifierKeys == ModifierKeys.None && !CompletionWindowManager.IsVisible) {
+ SafeUpdateIndentEngine (Editor.CaretOffset);
+ if (stateTracker.IsInsideStringLiteral && !Editor.IsSomethingSelected) {
+ var lexer = new ICSharpCode.NRefactory.CSharp.Completion.CSharpCompletionEngineBase.MiniLexer (Editor.GetTextAt (0, Editor.CaretOffset));
lexer.Parse ();
if (lexer.IsInString) {
- textEditorData.InsertAtCaret ("\\t");
+ Editor.InsertAtCaret ("\\t");
return false;
}
}
}
- if (key == Gdk.Key.Tab && DefaultSourceEditorOptions.Instance.TabIsReindent && !CompletionWindowManager.IsVisible && !(textEditorData.CurrentMode is TextLinkEditMode) && !DoInsertTemplate () && !isSomethingSelected) {
+ if (descriptor.SpecialKey == SpecialKey.Tab && DefaultSourceEditorOptions.Instance.TabIsReindent && !CompletionWindowManager.IsVisible && Editor.EditMode == EditMode.Edit && !DoInsertTemplate () && !isSomethingSelected) {
ReindentOnTab ();
return false;
}
- SafeUpdateIndentEngine (textEditorData.Caret.Offset);
+ SafeUpdateIndentEngine (Editor.CaretOffset);
if (!stateTracker.IsInsideOrdinaryCommentOrString) {
- if (keyChar == '@') {
- var retval = base.KeyPress (key, keyChar, modifier);
- int cursor = textEditorData.Caret.Offset;
- if (cursor < textEditorData.Length && textEditorData.GetCharAt (cursor) == '"')
- ConvertNormalToVerbatimString (textEditorData, cursor + 1);
+ if (descriptor.KeyChar == '@') {
+ var retval = base.KeyPress (descriptor);
+ int cursor = Editor.CaretOffset;
+ if (cursor < Editor.Length && Editor.GetCharAt (cursor) == '"')
+ ConvertNormalToVerbatimString (Editor, cursor + 1);
return retval;
}
}
@@ -468,34 +440,52 @@ namespace MonoDevelop.CSharp.Formatting
if (!indentationDisabled) {
bool retval;
//capture some of the current state
- int oldBufLen = textEditorData.Length;
- int oldLine = textEditorData.Caret.Line + 1;
+ int oldBufLen = Editor.Length;
+ int oldLine = Editor.CaretLine + 1;
bool reIndent = false;
//pass through to the base class, which actually inserts the character
//and calls HandleCodeCompletion etc to handles completion
- using (var undo = textEditorData.OpenUndoGroup ()) {
- DoPreInsertionSmartIndent (key);
+ using (var undo = Editor.OpenUndoGroup ()) {
+ DoPreInsertionSmartIndent (descriptor.SpecialKey);
}
wasInStringLiteral = stateTracker.IsInsideStringLiteral;
+
+
+ bool returnBetweenBraces =
+ descriptor.SpecialKey == SpecialKey.Return &&
+ descriptor.ModifierKeys == ModifierKeys.None &&
+ Editor.CaretOffset > 0 && Editor.CaretOffset < Editor.Length &&
+ Editor.GetCharAt (Editor.CaretOffset - 1) == '{' && Editor.GetCharAt (Editor.CaretOffset) == '}' && !stateTracker.IsInsideOrdinaryCommentOrString;
+
bool automaticReindent;
// need to be outside of an undo group - otherwise it interferes with other text editor extension
// esp. the documentation insertion undo steps.
- retval = base.KeyPress (key, keyChar, modifier);
+ retval = base.KeyPress (descriptor);
+
+
//handle inserted characters
- if (textEditorData.Caret.Offset <= 0 || textEditorData.IsSomethingSelected)
+ if (Editor.CaretOffset <= 0 || Editor.IsSomethingSelected)
return retval;
- lastCharInserted = TranslateKeyCharForIndenter (key, keyChar, textEditorData.GetCharAt (textEditorData.Caret.Offset - 1));
+ lastCharInserted = TranslateKeyCharForIndenter (descriptor.SpecialKey, descriptor.KeyChar, Editor.GetCharAt (Editor.CaretOffset - 1));
if (lastCharInserted == '\0')
return retval;
- using (var undo = textEditorData.OpenUndoGroup ()) {
- SafeUpdateIndentEngine (textEditorData.Caret.Offset);
+ using (var undo = Editor.OpenUndoGroup ()) {
+
+ if (returnBetweenBraces) {
+ var oldOffset = Editor.CaretOffset;
+ Editor.InsertAtCaret (Editor.EolMarker);
+ DoReSmartIndent ();
+ Editor.CaretOffset = oldOffset;
+ }
+
+ SafeUpdateIndentEngine (Editor.CaretOffset);
- if (key == Gdk.Key.Return && modifier == Gdk.ModifierType.ControlMask) {
- FixLineStart (textEditorData, stateTracker, textEditorData.Caret.Line + 1);
+ if (descriptor.SpecialKey == SpecialKey.Return && descriptor.ModifierKeys == ModifierKeys.Control) {
+ FixLineStart (Editor, stateTracker, Editor.CaretLine + 1);
} else {
- if (!(oldLine == textEditorData.Caret.Line + 1 && lastCharInserted == '\n') && (oldBufLen != textEditorData.Length || lastCharInserted != '\0')) {
+ if (!(oldLine == Editor.CaretLine + 1 && lastCharInserted == '\n') && (oldBufLen != Editor.Length || lastCharInserted != '\0')) {
DoPostInsertionSmartIndent (lastCharInserted, out reIndent);
} else {
reIndent = lastCharInserted == '\n';
@@ -505,67 +495,121 @@ namespace MonoDevelop.CSharp.Formatting
//N.B. if the engine says we need to reindent, make sure that it's because a char was
//inserted rather than just updating the stack due to moving around
- SafeUpdateIndentEngine (textEditorData.Caret.Offset);
+ SafeUpdateIndentEngine (Editor.CaretOffset);
// Automatically reindent in text link mode will cause the mode exiting, therefore we need to prevent that.
- automaticReindent = (stateTracker.NeedsReindent && lastCharInserted != '\0') && !(textEditorData.CurrentMode is TextLinkEditMode);
- if (key == Gdk.Key.Return && (reIndent || automaticReindent)) {
- if (textEditorData.Options.IndentStyle == IndentStyle.Virtual) {
- if (textEditorData.GetLine (textEditorData.Caret.Line).Length == 0)
- textEditorData.Caret.Column = textEditorData.IndentationTracker.GetVirtualIndentationColumn (textEditorData.Caret.Location);
+ automaticReindent = (stateTracker.NeedsReindent && lastCharInserted != '\0') && Editor.EditMode == EditMode.Edit;
+ if (descriptor.SpecialKey == SpecialKey.Return && (reIndent || automaticReindent)) {
+ if (Editor.Options.IndentStyle == IndentStyle.Virtual) {
+ if (Editor.GetLine (Editor.CaretLine).Length == 0)
+ Editor.CaretColumn = Editor.GetVirtualIndentationColumn (Editor.CaretLine);
} else {
DoReSmartIndent ();
}
}
}
+
const string reindentChars = ";){}";
- if (reIndent || key != Gdk.Key.Return && key != Gdk.Key.Tab && automaticReindent && reindentChars.Contains (keyChar)) {
- using (var undo = textEditorData.OpenUndoGroup ()) {
+ if (reIndent || descriptor.SpecialKey != SpecialKey.Return && descriptor.SpecialKey != SpecialKey.Tab && automaticReindent && reindentChars.Contains (descriptor.KeyChar)) {
+ using (var undo = Editor.OpenUndoGroup ()) {
DoReSmartIndent ();
}
}
- if (!skipFormatting && !(stateTracker.IsInsideComment || stateTracker.IsInsideString)) {
- if (keyChar == ';' || keyChar == '}') {
- using (var undo = textEditorData.OpenUndoGroup ()) {
- if (OnTheFlyFormatting && textEditorData != null && !(textEditorData.CurrentMode is TextLinkEditMode) && !(textEditorData.CurrentMode is InsertionCursorEditMode)) {
- OnTheFlyFormatter.FormatStatmentAt (Document, textEditorData.Caret.Location);
- }
- }
- }
- }
-
- SafeUpdateIndentEngine (textEditorData.Caret.Offset);
+ HandleOnTheFlyFormatting (descriptor);
+ SafeUpdateIndentEngine (Editor.CaretOffset);
lastCharInserted = '\0';
- CheckXmlCommentCloseTag (keyChar);
+ CheckXmlCommentCloseTag (descriptor.KeyChar);
return retval;
}
- if (textEditorData.Options.IndentStyle == IndentStyle.Auto && DefaultSourceEditorOptions.Instance.TabIsReindent && key == Gdk.Key.Tab) {
- bool retval = base.KeyPress (key, keyChar, modifier);
+ if (Editor.Options.IndentStyle == IndentStyle.Auto && DefaultSourceEditorOptions.Instance.TabIsReindent && descriptor.SpecialKey == SpecialKey.Tab) {
+ bool retval = base.KeyPress (descriptor);
DoReSmartIndent ();
- CheckXmlCommentCloseTag (keyChar);
+ CheckXmlCommentCloseTag (descriptor.KeyChar);
return retval;
}
//pass through to the base class, which actually inserts the character
//and calls HandleCodeCompletion etc to handles completion
- var result = base.KeyPress (key, keyChar, modifier);
+ var result = base.KeyPress (descriptor);
- if (!indentationDisabled && (key == Gdk.Key.Return || key == Gdk.Key.KP_Enter)) {
+ if (!indentationDisabled && (descriptor.SpecialKey == SpecialKey.Return)) {
DoReSmartIndent ();
}
- CheckXmlCommentCloseTag (keyChar);
+ CheckXmlCommentCloseTag (descriptor.KeyChar);
- if (!skipFormatting && keyChar == '}')
- RunFormatter (new DocumentLocation (textEditorData.Caret.Location.Line, textEditorData.Caret.Location.Column));
+ HandleOnTheFlyFormatting (descriptor);
+
return result;
}
- static bool IsSemicolonalreadyPlaced (TextEditorData data, int caretOffset)
+ void HandleOnTheFlyFormatting (KeyDescriptor descriptor)
+ {
+ if (descriptor.KeyChar == '{')
+ return;
+ SafeUpdateIndentEngine (Editor.CaretOffset);
+ bool skipFormatting = stateTracker.IsInsideOrdinaryCommentOrString || stateTracker.IsInsidePreprocessorDirective;
+ if (!skipFormatting && !(stateTracker.IsInsideComment || stateTracker.IsInsideString)) {
+ if (DocumentContext.ParsedDocument == null || DocumentContext.ParsedDocument.GetAst<SemanticModel> () == null)
+ return;
+ var document = DocumentContext.AnalysisDocument;
+ if (document == null)
+ return;
+ if (!skipFormatting && service.SupportsFormattingOnTypedCharacter (document, descriptor.KeyChar)) {
+ var caretPosition = Editor.CaretOffset;
+ var token = CSharpEditorFormattingService.GetTokenBeforeTheCaretAsync (document, caretPosition, default(CancellationToken)).Result;
+ if (token.IsMissing || !service.ValidSingleOrMultiCharactersTokenKind (descriptor.KeyChar, token.Kind ()) || token.IsKind (SyntaxKind.EndOfFileToken, SyntaxKind.None))
+ return;
+ if (CSharpEditorFormattingService.TokenShouldNotFormatOnTypeChar (token))
+ return;
+ using (var undo = Editor.OpenUndoGroup ()) {
+ if (OnTheFlyFormatting && Editor != null && Editor.EditMode == EditMode.Edit) {
+ OnTheFlyFormatter.FormatStatmentAt (Editor, DocumentContext, Editor.CaretLocation, optionSet: optionSet);
+ }
+ }
+ }
+ }
+ if (OnTheFlyFormatting && descriptor.SpecialKey == SpecialKey.Return) {
+ try {
+ FormatOnReturn ();
+ } catch (Exception e) {
+ LoggingService.LogError ("Exception while formatting", e);
+ }
+ }
+ }
+
+ async void FormatOnReturn (CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var document = DocumentContext.AnalysisDocument;
+ if (document == null)
+ return;
+ var caretPosition = Editor.CaretOffset;
+ var token = await CSharpEditorFormattingService.GetTokenBeforeTheCaretAsync(document, caretPosition, cancellationToken).ConfigureAwait(false);
+ if (token.IsMissing)
+ return;
+
+ string text = null;
+ if (service.IsInvalidToken(token, ref text))
+ return;
+ // Check to see if the token is ')' and also the parent is a using statement. If not, bail
+ if (CSharpEditorFormattingService.TokenShouldNotFormatOnReturn(token))
+ return;
+ var tokenRange = FormattingRangeHelper.FindAppropriateRange(token);
+ if (tokenRange == null || !tokenRange.HasValue || tokenRange.Value.Item1.Equals(tokenRange.Value.Item2))
+ return;
+ var value = tokenRange.Value;
+ using (var undo = Editor.OpenUndoGroup ()) {
+ OnTheFlyFormatter.Format (Editor, DocumentContext, value.Item1.SpanStart, value.Item2.Span.End, optionSet: optionSet);
+ }
+ }
+
+ CSharpEditorFormattingService service = new CSharpEditorFormattingService ();
+
+ static bool IsSemicolonalreadyPlaced (IReadonlyTextDocument data, int caretOffset)
{
for (int pos2 = caretOffset - 1; pos2-- > 0;) {
- var ch2 = data.Document.GetCharAt (pos2);
+ var ch2 = data.GetCharAt (pos2);
if (ch2 == ';') {
return true;
}
@@ -575,7 +619,7 @@ namespace MonoDevelop.CSharp.Formatting
return false;
}
- public static bool GuessSemicolonInsertionOffset (TextEditorData data, ISegment curLine, int caretOffset, out int outOffset)
+ public static bool GuessSemicolonInsertionOffset (IReadonlyTextDocument data, MonoDevelop.Core.Text.ISegment curLine, int caretOffset, out int outOffset)
{
int lastNonWsOffset = caretOffset;
char lastNonWsChar = '\0';
@@ -598,7 +642,7 @@ namespace MonoDevelop.CSharp.Formatting
var offset = curLine.Offset;
string lineText = data.GetTextAt (caretOffset, max - caretOffset);
- var lexer = new CSharpCompletionEngineBase.MiniLexer (lineText);
+ var lexer = new ICSharpCode.NRefactory.CSharp.Completion.CSharpCompletionEngineBase.MiniLexer (lineText);
lexer.Parse ((ch, i) => {
if (lexer.IsInSingleComment || lexer.IsInMultiLineComment)
return true;
@@ -619,13 +663,12 @@ namespace MonoDevelop.CSharp.Formatting
return true;
}
- static char TranslateKeyCharForIndenter (Gdk.Key key, char keyChar, char docChar)
+ static char TranslateKeyCharForIndenter (SpecialKey key, char keyChar, char docChar)
{
switch (key) {
- case Gdk.Key.Return:
- case Gdk.Key.KP_Enter:
+ case SpecialKey.Return:
return '\n';
- case Gdk.Key.Tab:
+ case SpecialKey.Tab:
return '\t';
default:
if (docChar == keyChar)
@@ -637,14 +680,14 @@ namespace MonoDevelop.CSharp.Formatting
// removes "\s*\+\s*" patterns (used for special behaviour inside strings)
void HandleStringConcatinationDeletion (int start, int end)
{
- if (start < 0 || end >= textEditorData.Length || textEditorData.IsSomethingSelected)
+ if (start < 0 || end >= Editor.Length || Editor.IsSomethingSelected)
return;
- char ch = textEditorData.GetCharAt (start);
+ char ch = Editor.GetCharAt (start);
if (ch == '"') {
int sgn = Math.Sign (end - start);
bool foundPlus = false;
- for (int max = start + sgn; max != end && max >= 0 && max < textEditorData.Length; max += sgn) {
- ch = textEditorData.GetCharAt (max);
+ for (int max = start + sgn; max != end && max >= 0 && max < Editor.Length; max += sgn) {
+ ch = Editor.GetCharAt (max);
if (Char.IsWhiteSpace (ch))
continue;
if (ch == '+') {
@@ -655,11 +698,11 @@ namespace MonoDevelop.CSharp.Formatting
if (!foundPlus)
break;
if (sgn < 0) {
- textEditorData.Remove (max, start - max);
- textEditorData.Caret.Offset = max + 1;
+ Editor.RemoveText (max, start - max);
+ Editor.CaretOffset = max + 1;
} else {
- textEditorData.Remove (start + sgn, max - start);
- textEditorData.Caret.Offset = start;
+ Editor.RemoveText (start + sgn, max - start);
+ Editor.CaretOffset = start;
}
break;
} else {
@@ -669,23 +712,23 @@ namespace MonoDevelop.CSharp.Formatting
}
}
- void DoPreInsertionSmartIndent (Gdk.Key key)
+ void DoPreInsertionSmartIndent (SpecialKey key)
{
switch (key) {
- case Gdk.Key.BackSpace:
- SafeUpdateIndentEngine (textEditorData.Caret.Offset);
- HandleStringConcatinationDeletion (textEditorData.Caret.Offset - 1, 0);
+ case SpecialKey.BackSpace:
+ SafeUpdateIndentEngine (Editor.CaretOffset);
+ HandleStringConcatinationDeletion (Editor.CaretOffset - 1, 0);
break;
- case Gdk.Key.Delete:
- SafeUpdateIndentEngine (textEditorData.Caret.Offset);
- HandleStringConcatinationDeletion (textEditorData.Caret.Offset, textEditorData.Length);
+ case SpecialKey.Delete:
+ SafeUpdateIndentEngine (Editor.CaretOffset);
+ HandleStringConcatinationDeletion (Editor.CaretOffset, Editor.Length);
break;
}
}
//special handling for certain characters just inserted , for comments etc
void DoPostInsertionSmartIndent (char charInserted, out bool reIndent)
{
- SafeUpdateIndentEngine (textEditorData.Caret.Offset);
+ SafeUpdateIndentEngine (Editor.CaretOffset);
reIndent = false;
switch (charInserted) {
case '}':
@@ -693,7 +736,9 @@ namespace MonoDevelop.CSharp.Formatting
reIndent = true;
break;
case '\n':
- if (FixLineStart (textEditorData, stateTracker, stateTracker.Location.Line))
+ if (completionWindowWasVisible) // \n is handled by an open completion window
+ return;
+ if (FixLineStart (Editor, stateTracker, Editor.OffsetToLineNumber (stateTracker.Offset)))
return;
//newline always reindents unless it's had special handling
reIndent = true;
@@ -702,18 +747,20 @@ namespace MonoDevelop.CSharp.Formatting
}
internal bool wasInStringLiteral;
+ OptionSet optionSet;
+ bool completionWindowWasVisible;
- public bool FixLineStart (TextEditorData textEditorData, IStateMachineIndentEngine stateTracker, int lineNumber)
+ public bool FixLineStart (TextEditor textEditorData, ICSharpCode.NRefactory6.CSharp.IStateMachineIndentEngine stateTracker, int lineNumber)
{
- if (lineNumber > DocumentLocation.MinLine) {
- DocumentLine line = textEditorData.Document.GetLine (lineNumber);
+ if (lineNumber > 1) {
+ var line = textEditorData.GetLine (lineNumber);
if (line == null)
return false;
- DocumentLine prevLine = textEditorData.Document.GetLine (lineNumber - 1);
+ var prevLine = textEditorData.GetLine (lineNumber - 1);
if (prevLine == null)
return false;
- string trimmedPreviousLine = textEditorData.Document.GetTextAt (prevLine).TrimStart ();
+ string trimmedPreviousLine = textEditorData.GetTextAt (prevLine).TrimStart ();
//xml doc comments
//check previous line was a doc comment
@@ -723,13 +770,13 @@ namespace MonoDevelop.CSharp.Formatting
return false;
//check that the newline command actually inserted a newline
textEditorData.EnsureCaretIsNotVirtual ();
- var nextLineSegment = textEditorData.Document.GetLine (lineNumber + 1);
- string nextLine = nextLineSegment != null ? textEditorData.Document.GetTextAt (nextLineSegment).TrimStart () : "";
+ var nextLineSegment = textEditorData.GetLine (lineNumber + 1);
+ string nextLine = nextLineSegment != null ? textEditorData.GetTextAt (nextLineSegment).TrimStart () : "";
if (trimmedPreviousLine.Length > "///".Length || nextLine.StartsWith ("///", StringComparison.Ordinal)) {
- var insertionPoint = textEditorData.Caret.Offset;
- int inserted = textEditorData.Insert (insertionPoint, "/// ");
- textEditorData.Caret.Offset = insertionPoint + inserted;
+ var insertionPoint = textEditorData.CaretOffset;
+ textEditorData.InsertText (insertionPoint, "/// ");
+ textEditorData.CaretOffset = insertionPoint + "/// ".Length;
return true;
}
//multi-line comments
@@ -746,59 +793,59 @@ namespace MonoDevelop.CSharp.Formatting
commentPrefix = "*";
}
- int indentSize = line.GetIndentation (textEditorData.Document).Length;
- var insertedText = prevLine.GetIndentation (textEditorData.Document) + commentPrefix;
- textEditorData.Replace (line.Offset, indentSize, insertedText);
- textEditorData.Caret.Offset = line.Offset + insertedText.Length;
+ int indentSize = line.GetIndentation (textEditorData).Length;
+ var insertedText = prevLine.GetIndentation (textEditorData) + commentPrefix;
+ textEditorData.ReplaceText (line.Offset, indentSize, insertedText);
+ textEditorData.CaretOffset = line.Offset + insertedText.Length;
return true;
} else if (wasInStringLiteral) {
- var lexer = new CSharpCompletionEngineBase.MiniLexer (textEditorData.Document.GetTextAt (0, prevLine.EndOffset).TrimEnd ());
+ var lexer = new ICSharpCode.NRefactory.CSharp.Completion.CSharpCompletionEngineBase.MiniLexer (textEditorData.GetTextAt (0, prevLine.EndOffset).TrimEnd ());
lexer.Parse ();
if (!lexer.IsInString)
return false;
textEditorData.EnsureCaretIsNotVirtual ();
- textEditorData.Insert (prevLine.Offset + prevLine.Length, "\" +");
+ textEditorData.InsertText (prevLine.Offset + prevLine.Length, "\" +");
- int indentSize = textEditorData.Caret.Offset - line.Offset;
- var insertedText = prevLine.GetIndentation (textEditorData.Document) + (trimmedPreviousLine.StartsWith ("\"", StringComparison.Ordinal) ? "" : "\t") + "\"";
- textEditorData.Replace (line.Offset, indentSize, insertedText);
+ int indentSize = textEditorData.CaretOffset - line.Offset;
+ var insertedText = prevLine.GetIndentation (textEditorData) + (trimmedPreviousLine.StartsWith ("\"", StringComparison.Ordinal) ? "" : "\t") + "\"";
+ textEditorData.ReplaceText (line.Offset, indentSize, insertedText);
return true;
}
}
return false;
}
//does re-indenting and cursor positioning
- void DoReSmartIndent ()
+ internal void DoReSmartIndent ()
{
- DoReSmartIndent (textEditorData.Caret.Offset);
+ DoReSmartIndent (Editor.CaretOffset);
}
- void DoReSmartIndent (int cursor)
+ internal void DoReSmartIndent (int cursor)
{
SafeUpdateIndentEngine (cursor);
if (stateTracker.LineBeganInsideVerbatimString || stateTracker.LineBeganInsideMultiLineComment)
return;
if (DefaultSourceEditorOptions.Instance.IndentStyle == IndentStyle.Auto) {
- textEditorData.FixVirtualIndentation ();
+ Editor.FixVirtualIndentation ();
return;
}
- var line = textEditorData.Document.GetLineByOffset (cursor);
+ var line = Editor.GetLineByOffset (cursor);
// Get context to the end of the line w/o changing the main engine's state
var curTracker = stateTracker.Clone ();
try {
for (int max = cursor; max < line.EndOffset; max++) {
- curTracker.Push (textEditorData.Document.GetCharAt (max));
+ curTracker.Push (Editor.GetCharAt (max));
}
} catch (Exception e) {
LoggingService.LogError ("Exception during indentation", e);
}
int pos = line.Offset;
- string curIndent = line.GetIndentation (textEditorData.Document);
+ string curIndent = line.GetIndentation (Editor);
int nlwsp = curIndent.Length;
int offset = cursor > pos + nlwsp ? cursor - (pos + nlwsp) : 0;
- if (!stateTracker.LineBeganInsideMultiLineComment || (nlwsp < line.LengthIncludingDelimiter && textEditorData.Document.GetCharAt (line.Offset + nlwsp) == '*')) {
+ if (!stateTracker.LineBeganInsideMultiLineComment || (nlwsp < line.LengthIncludingDelimiter && Editor.GetCharAt (line.Offset + nlwsp) == '*')) {
// Possibly replace the indent
string newIndent = curTracker.ThisLineIndent;
int newIndentLength = newIndent.Length;
@@ -807,9 +854,9 @@ namespace MonoDevelop.CSharp.Formatting
if (pos < CompletionWindowManager.CodeCompletionContext.TriggerOffset)
CompletionWindowManager.CodeCompletionContext.TriggerOffset -= nlwsp;
}
-
- newIndentLength = textEditorData.Replace (pos, nlwsp, newIndent);
- textEditorData.Document.CommitLineUpdate (textEditorData.Caret.Line);
+ newIndentLength = newIndent.Length;
+ Editor.ReplaceText (pos, nlwsp, newIndent);
+ //textEditorData.CommitLineUpdate (textEditorData.CaretLine);
CompletionWindowManager.HideWindow ();
}
pos += newIndentLength;
@@ -819,7 +866,7 @@ namespace MonoDevelop.CSharp.Formatting
pos += offset;
- textEditorData.FixVirtualIndentation ();
+ Editor.FixVirtualIndentation ();
}
/*
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextPasteHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextPasteHandler.cs
new file mode 100644
index 0000000000..96b8635c4f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextPasteHandler.cs
@@ -0,0 +1,94 @@
+//
+// TextPasteIndentEngine.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide.Editor.Extension;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.CodeCompletion;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Text;
+
+namespace MonoDevelop.CSharp.Formatting
+{
+ class CSharpTextPasteHandler : TextPasteHandler
+ {
+ readonly ICSharpCode.NRefactory6.CSharp.ITextPasteHandler engine;
+ readonly CSharpTextEditorIndentation indent;
+
+ public CSharpTextPasteHandler (CSharpTextEditorIndentation indent, ICSharpCode.NRefactory6.CSharp.IStateMachineIndentEngine decoratedEngine, OptionSet formattingOptions)
+ {
+ this.engine = new ICSharpCode.NRefactory6.CSharp.TextPasteIndentEngine (decoratedEngine, formattingOptions);
+ this.indent = indent;
+ }
+
+ public override string FormatPlainText (int offset, string text, byte[] copyData)
+ {
+ return engine.FormatPlainText (indent.Editor, offset, text, copyData);
+ }
+
+ public override byte[] GetCopyData (int offset, int length)
+ {
+ return engine.GetCopyData (indent.Editor, new TextSpan (offset, length));
+ }
+
+ public override void PostFomatPastedText (int insertionOffset, int insertedChars)
+ {
+ if (indent.Editor.Options.IndentStyle == IndentStyle.None ||
+ indent.Editor.Options.IndentStyle == IndentStyle.Auto)
+ return;
+ if (DefaultSourceEditorOptions.Instance.OnTheFlyFormatting) {
+ OnTheFlyFormatter.Format (indent.Editor, indent.DocumentContext, insertionOffset, insertionOffset + insertedChars);
+ return;
+ }
+ // Just correct the start line of the paste operation - the text is already indented.
+ var curLine = indent.Editor.GetLineByOffset (insertionOffset);
+ var curLineOffset = curLine.Offset;
+ indent.SafeUpdateIndentEngine (curLineOffset);
+ if (!indent.stateTracker.IsInsideOrdinaryCommentOrString) {
+ int pos = curLineOffset;
+ string curIndent = curLine.GetIndentation (indent.Editor);
+ int nlwsp = curIndent.Length;
+
+ if (!indent.stateTracker.LineBeganInsideMultiLineComment || (nlwsp < curLine.LengthIncludingDelimiter && indent.Editor.GetCharAt (curLineOffset + nlwsp) == '*')) {
+ // Possibly replace the indent
+ indent.SafeUpdateIndentEngine (curLineOffset + curLine.Length);
+ string newIndent = indent.stateTracker.ThisLineIndent;
+ if (newIndent != curIndent) {
+ if (CompletionWindowManager.IsVisible) {
+ if (pos < CompletionWindowManager.CodeCompletionContext.TriggerOffset)
+ CompletionWindowManager.CodeCompletionContext.TriggerOffset -= nlwsp;
+ }
+ indent.Editor.ReplaceText (pos, nlwsp, newIndent);
+ // textEditorData.Document.CommitLineUpdate (textEditorData.CaretLine);
+ }
+ }
+ }
+ indent.Editor.FixVirtualIndentation ();
+
+ }
+
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/NewFormattingProfileDialog.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/NewFormattingProfileDialog.cs
index c9d37eaa91..5794cf9fad 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/NewFormattingProfileDialog.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/NewFormattingProfileDialog.cs
@@ -36,14 +36,14 @@ namespace MonoDevelop.CSharp.Formatting
}
- public CSharpFormattingPolicy InitializeFrom {
+ internal CSharpFormattingPolicy InitializeFrom {
get {
return policies[comboboxInitFrom.Active];
}
}
readonly List<CSharpFormattingPolicy> policies;
- public NewFormattingProfileDialog (List<CSharpFormattingPolicy> policies)
+ internal NewFormattingProfileDialog (List<CSharpFormattingPolicy> policies)
{
// ReSharper disable once DoNotCallOverridableMethodsInConstructor
this.Build ();
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormatter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormatter.cs
index e8bb9b6b7d..049c9906fd 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormatter.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormatter.cs
@@ -23,244 +23,108 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using Mono.TextEditor;
+
using MonoDevelop.Ide;
using System;
using System.Collections.Generic;
using MonoDevelop.Projects.Policies;
-using ICSharpCode.NRefactory.CSharp;
-using System.Text;
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
+using System.Linq;
using MonoDevelop.CSharp.Completion;
using MonoDevelop.CSharp.Refactoring;
using MonoDevelop.CSharp.Parser;
using MonoDevelop.Core;
-using ICSharpCode.NRefactory.CSharp.Completion;
+using MonoDevelop.Ide.Editor;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Ide.Gui.Content;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.Options;
namespace MonoDevelop.CSharp.Formatting
{
static class OnTheFlyFormatter
{
- public static void Format (MonoDevelop.Ide.Gui.Document data)
+ public static void Format (TextEditor editor, DocumentContext context)
{
- Format (data, 0, data.Editor.Length);
+ Format (editor, context, 0, editor.Length);
}
- public static void Format (MonoDevelop.Ide.Gui.Document data, TextLocation location)
- {
- Format (data, location, location, false);
- }
-
- public static void Format (MonoDevelop.Ide.Gui.Document data, TextLocation startLocation, TextLocation endLocation, bool exact = true)
+ public static void Format (TextEditor editor, DocumentContext context, int startOffset, int endOffset, bool exact = true, OptionSet optionSet = null)
{
- Format (data, data.Editor.LocationToOffset (startLocation), data.Editor.LocationToOffset (endLocation), exact);
- }
-
- public static void Format (MonoDevelop.Ide.Gui.Document data, int startOffset, int endOffset, bool exact = true)
- {
- var policyParent = data.Project != null ? data.Project.Policies : PolicyService.DefaultPolicies;
+ var policyParent = context.Project != null ? context.Project.Policies : PolicyService.DefaultPolicies;
var mimeTypeChain = DesktopService.GetMimeTypeInheritanceChain (CSharpFormatter.MimeType);
- Format (policyParent, mimeTypeChain, data, startOffset, endOffset, exact);
+ Format (policyParent, mimeTypeChain, editor, context, startOffset, endOffset, exact, optionSet: optionSet);
}
- public static void FormatStatmentAt (MonoDevelop.Ide.Gui.Document data, DocumentLocation location)
+ public static void FormatStatmentAt (TextEditor editor, DocumentContext context, MonoDevelop.Ide.Editor.DocumentLocation location, OptionSet optionSet = null)
{
- var offset = data.Editor.LocationToOffset (location);
- var policyParent = data.Project != null ? data.Project.Policies : PolicyService.DefaultPolicies;
+ var offset = editor.LocationToOffset (location);
+ var policyParent = context.Project != null ? context.Project.Policies : PolicyService.DefaultPolicies;
var mimeTypeChain = DesktopService.GetMimeTypeInheritanceChain (CSharpFormatter.MimeType);
- Format (policyParent, mimeTypeChain, data, offset, offset, false, true);
- }
-
-
- static string BuildStub (MonoDevelop.Ide.Gui.Document data, CSharpCompletionTextEditorExtension.TypeSystemTreeSegment seg, int endOffset, out int memberStartOffset)
- {
- var pf = data.ParsedDocument.ParsedFile as CSharpUnresolvedFile;
- if (pf == null) {
- memberStartOffset = 0;
- return null;
- }
-
- var sb = new StringBuilder ();
-
- int closingBrackets = 0;
- // use the member start location to determine the using scope, because this information is in sync, the position in
- // the file may have changed since last parse run (we have up 2 date locations from the type segment tree).
- var scope = pf.GetUsingScope (seg.Entity.Region.Begin);
-
- while (scope != null && !string.IsNullOrEmpty (scope.NamespaceName)) {
- // Hack: some syntax errors lead to invalid namespace names.
- if (scope.NamespaceName.EndsWith ("<invalid>", StringComparison.Ordinal)) {
- scope = scope.Parent;
- continue;
- }
- sb.Append ("namespace Stub {");
- sb.Append (data.Editor.EolMarker);
- closingBrackets++;
- while (scope.Parent != null && scope.Parent.Region == scope.Region)
- scope = scope.Parent;
- scope = scope.Parent;
- }
-
- var parent = seg.Entity.DeclaringTypeDefinition;
- while (parent != null) {
- sb.Append ("class " + parent.Name + " {");
- sb.Append (data.Editor.EolMarker);
- closingBrackets++;
- parent = parent.DeclaringTypeDefinition;
- }
-
- var segmentLine = data.Editor.GetLineByOffset (seg.Offset);
- memberStartOffset = sb.Length + seg.Offset - segmentLine.Offset;
- var text = data.Editor.GetTextBetween (Math.Max (0, segmentLine.Offset), endOffset);
- sb.Append (text);
- var lex = new CSharpCompletionEngineBase.MiniLexer (text);
- lex.Parse ((ch,i) => {
- if (lex.IsInString || lex.IsInChar || lex.IsInVerbatimString || lex.IsInSingleComment || lex.IsInMultiLineComment || lex.IsInPreprocessorDirective)
- return false;
- if (ch =='{') {
- closingBrackets++;
- } else if (ch =='}') {
- closingBrackets--;
- }
- return false;
- });
-
-
- // Insert at least caret column eol markers otherwise the reindent of the generated closing bracket
- // could interfere with the current indentation.
- var endLocation = data.Editor.OffsetToLocation (endOffset);
- for (int i = 0; i <= endLocation.Column; i++) {
- sb.Append (data.Editor.EolMarker);
- }
- sb.Append (data.Editor.EolMarker);
- sb.Append (new string ('}', closingBrackets));
- return sb.ToString ();
+ Format (policyParent, mimeTypeChain, editor, context, offset, offset, false, true, optionSet: optionSet);
}
-
- static FormattingChanges GetFormattingChanges (PolicyContainer policyParent, IEnumerable<string> mimeTypeChain, MonoDevelop.Ide.Gui.Document document, string input, DomRegion formattingRegion, ref int formatStartOffset, ref int formatLength, bool formatLastStatementOnly)
- {
- using (var stubData = TextEditorData.CreateImmutable (input)) {
- stubData.Document.FileName = document.FileName;
- var parser = document.HasProject ? new CSharpParser (TypeSystemParser.GetCompilerArguments (document.Project)) : new CSharpParser ();
- var compilationUnit = parser.Parse (stubData);
- bool hadErrors = parser.HasErrors;
- if (hadErrors) {
- using (var stubData2 = TextEditorData.CreateImmutable (input + "}")) {
- compilationUnit = parser.Parse (stubData2);
- hadErrors = parser.HasErrors;
- }
- }
- // try it out, if the behavior is better when working only with correct code.
- if (hadErrors) {
- return null;
- }
-
- var policy = policyParent.Get<CSharpFormattingPolicy> (mimeTypeChain);
-
- var formattingVisitor = new ICSharpCode.NRefactory.CSharp.CSharpFormatter (policy.CreateOptions (), document.Editor.CreateNRefactoryTextEditorOptions ());
- formattingVisitor.FormattingMode = FormattingMode.Intrusive;
- formattingVisitor.AddFormattingRegion (formattingRegion);
-
- var changes = formattingVisitor.AnalyzeFormatting (stubData.Document, compilationUnit);
-
- if (formatLastStatementOnly) {
- AstNode node = compilationUnit.GetAdjacentNodeAt<Statement> (stubData.OffsetToLocation (formatStartOffset + formatLength - 1));
- if (node != null) {
- while (node.Role == Roles.EmbeddedStatement || node.Role == IfElseStatement.TrueRole || node.Role == IfElseStatement.FalseRole)
- node = node.Parent;
- // include indentation if node starts in new line
- var formatNode = node.GetPrevNode ();
- if (formatNode.Role != Roles.NewLine)
- formatNode = node;
- var start = stubData.LocationToOffset (formatNode.StartLocation);
- if (start > formatStartOffset) {
- var end = stubData.LocationToOffset (node.EndLocation);
- formatStartOffset = start;
- formatLength = end - start;
- }
- }
- }
- return changes;
- }
- }
-
- public static void Format (PolicyContainer policyParent, IEnumerable<string> mimeTypeChain, MonoDevelop.Ide.Gui.Document data, int startOffset, int endOffset, bool exact, bool formatLastStatementOnly = false)
+ static void Format (PolicyContainer policyParent, IEnumerable<string> mimeTypeChain, TextEditor editor, DocumentContext context, int startOffset, int endOffset, bool exact, bool formatLastStatementOnly = false, OptionSet optionSet = null)
{
- if (data.ParsedDocument == null)
- return;
- var ext = data.GetContent<CSharpCompletionTextEditorExtension> ();
- if (ext == null)
- return;
- string text;
- int formatStartOffset, formatLength, realTextDelta;
- DomRegion formattingRegion;
- int startDelta = 1;
+ TextSpan span;
if (exact) {
- text = data.Editor.Text;
- var seg = ext.GetMemberSegmentAt (startOffset);
- var seg2 = ext.GetMemberSegmentAt (endOffset);
- if (seg != null && seg == seg2) {
- var member = seg.Entity;
- if (member == null || member.Region.IsEmpty || member.BodyRegion.End.IsEmpty)
- return;
-
- text = BuildStub (data, seg, endOffset, out formatStartOffset);
- startDelta = startOffset - seg.Offset;
- formatLength = endOffset - startOffset + startDelta;
- realTextDelta = seg.Offset - formatStartOffset;
- formattingRegion = new DomRegion (data.Editor.OffsetToLocation (formatStartOffset), data.Editor.OffsetToLocation (endOffset));
- } else {
- formatStartOffset = startOffset;
- formatLength = endOffset - startOffset;
- realTextDelta = 0;
- formattingRegion = new DomRegion (data.Editor.OffsetToLocation (startOffset), data.Editor.OffsetToLocation (endOffset));
- }
+ span = new TextSpan (startOffset, endOffset - startOffset);
} else {
- var seg = ext.GetMemberSegmentAt (startOffset - 1);
- if (seg == null) {
- return;
- }
- var member = seg.Entity;
- if (member == null)
- return;
-
- // Build stub
- text = BuildStub (data, seg, startOffset, out formatStartOffset);
- formattingRegion = new DomRegion (data.Editor.OffsetToLocation (formatStartOffset), data.Editor.OffsetToLocation (endOffset));
-
- formatLength = endOffset - seg.Offset;
- realTextDelta = seg.Offset - formatStartOffset;
+ span = new TextSpan (0, endOffset);
}
- // Get changes from formatting visitor
- var changes = GetFormattingChanges (policyParent, mimeTypeChain, data, text, formattingRegion, ref formatStartOffset, ref formatLength, formatLastStatementOnly);
- if (changes == null)
+
+ var analysisDocument = context.AnalysisDocument;
+ if (analysisDocument == null)
return;
+ using (var undo = editor.OpenUndoGroup (/*OperationType.Format*/)) {
+ try {
+ var syntaxTree = analysisDocument.GetSyntaxTreeAsync ().Result;
+
+ if (formatLastStatementOnly) {
+ var root = syntaxTree.GetRoot ();
+ var token = root.FindToken (endOffset);
+ var tokens = ICSharpCode.NRefactory6.CSharp.FormattingRangeHelper.FindAppropriateRange (token);
+ if (tokens.HasValue) {
+ span = new TextSpan (tokens.Value.Item1.SpanStart, tokens.Value.Item2.Span.End - tokens.Value.Item1.SpanStart);
+ } else {
+ var parent = token.Parent;
+ if (parent != null)
+ span = parent.FullSpan;
+ }
+ }
- // Do the actual formatting
-// var originalVersion = data.Editor.Document.Version;
+ if (optionSet == null) {
+ var policy = policyParent.Get<CSharpFormattingPolicy> (mimeTypeChain);
+ var textPolicy = policyParent.Get<TextStylePolicy> (mimeTypeChain);
+ optionSet = policy.CreateOptions (textPolicy);
+ }
- using (var undo = data.Editor.OpenUndoGroup (OperationType.Format)) {
- try {
- changes.ApplyChanges (formatStartOffset + startDelta, Math.Max (0, formatLength - startDelta - 1), delegate (int replaceOffset, int replaceLength, string insertText) {
- int translatedOffset = realTextDelta + replaceOffset;
- data.Editor.Document.CommitLineUpdate (data.Editor.OffsetToLineNumber (translatedOffset));
- data.Editor.Replace (translatedOffset, replaceLength, insertText);
- }, (replaceOffset, replaceLength, insertText) => {
- int translatedOffset = realTextDelta + replaceOffset;
- if (translatedOffset < 0 || translatedOffset + replaceLength > data.Editor.Length || replaceLength < 0)
- return true;
- return data.Editor.GetTextAt (translatedOffset, replaceLength) == insertText;
- });
+ var doc = Formatter.FormatAsync (analysisDocument, span, optionSet).Result;
+ var newTree = doc.GetSyntaxTreeAsync ().Result;
+ var caretOffset = editor.CaretOffset;
+
+ int delta = 0;
+ foreach (var change in newTree.GetChanges (syntaxTree)) {
+ if (!exact && change.Span.Start + delta >= caretOffset)
+ continue;
+ var newText = change.NewText;
+ editor.ReplaceText (delta + change.Span.Start, change.Span.Length, newText);
+ delta = delta - change.Span.Length + newText.Length;
+ }
+ if (startOffset < caretOffset) {
+ var caretEndOffset = caretOffset + delta;
+ if (0 <= caretEndOffset && caretEndOffset < editor.Length)
+ editor.CaretOffset = caretEndOffset;
+ if (editor.CaretColumn == 1) {
+ if (editor.CaretLine > 1 && editor.GetLine (editor.CaretLine - 1).Length == 0)
+ editor.CaretLine--;
+ editor.CaretColumn = editor.GetVirtualIndentationColumn (editor.CaretLine);
+ }
+ }
} catch (Exception e) {
LoggingService.LogError ("Error in on the fly formatter", e);
}
-
-// var currentVersion = data.Editor.Document.Version;
-// data.Editor.Caret.Offset = originalVersion.MoveOffsetTo (currentVersion, caretOffset, ICSharpCode.NRefactory.Editor.AnchorMovementType.Default);
}
}
}
-} \ No newline at end of file
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/AllmanCSharpPolicy.xml b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/AllmanCSharpPolicy.xml
index be1a18f6b7..076944f828 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/AllmanCSharpPolicy.xml
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/AllmanCSharpPolicy.xml
@@ -27,138 +27,50 @@ THE SOFTWARE.
-->
<CSharpFormattingPolicy scope="text/x-csharp" allowDiffSerialize="False">
- <IndentNamespaceBody>True</IndentNamespaceBody>
- <IndentClassBody>True</IndentClassBody>
- <IndentInterfaceBody>True</IndentInterfaceBody>
- <IndentStructBody>True</IndentStructBody>
- <IndentEnumBody>True</IndentEnumBody>
- <IndentMethodBody>True</IndentMethodBody>
- <IndentPropertyBody>True</IndentPropertyBody>
- <IndentEventBody>True</IndentEventBody>
- <IndentBlocks>True</IndentBlocks>
- <IndentSwitchBody>True</IndentSwitchBody>
- <IndentCaseBody>True</IndentCaseBody>
- <IndentBreakStatements>True</IndentBreakStatements>
- <AlignEmbeddedStatements>True</AlignEmbeddedStatements>
- <SimplePropertyFormatting>AllowOneLine</SimplePropertyFormatting>
- <AutoPropertyFormatting>AllowOneLine</AutoPropertyFormatting>
- <NamespaceBraceStyle>NextLine</NamespaceBraceStyle>
- <ClassBraceStyle>NextLine</ClassBraceStyle>
- <InterfaceBraceStyle>NextLine</InterfaceBraceStyle>
- <StructBraceStyle>NextLine</StructBraceStyle>
- <EnumBraceStyle>NextLine</EnumBraceStyle>
- <MethodBraceStyle>NextLine</MethodBraceStyle>
- <AnonymousMethodBraceStyle>NextLine</AnonymousMethodBraceStyle>
- <ConstructorBraceStyle>NextLine</ConstructorBraceStyle>
- <DestructorBraceStyle>NextLine</DestructorBraceStyle>
- <PropertyBraceStyle>NextLine</PropertyBraceStyle>
- <PropertyGetBraceStyle>NextLine</PropertyGetBraceStyle>
- <PropertySetBraceStyle>NextLine</PropertySetBraceStyle>
- <SimpleGetBlockFormatting>AllowOneLine</SimpleGetBlockFormatting>
- <SimpleSetBlockFormatting>AllowOneLine</SimpleSetBlockFormatting>
- <EventBraceStyle>NextLine</EventBraceStyle>
- <EventAddBraceStyle>NextLine</EventAddBraceStyle>
- <EventRemoveBraceStyle>NextLine</EventRemoveBraceStyle>
- <AllowEventAddBlockInline>True</AllowEventAddBlockInline>
- <AllowEventRemoveBlockInline>True</AllowEventRemoveBlockInline>
- <StatementBraceStyle>NextLine</StatementBraceStyle>
- <AllowIfBlockInline>False</AllowIfBlockInline>
- <ElseNewLinePlacement>NewLine</ElseNewLinePlacement>
- <ElseIfNewLinePlacement>SameLine</ElseIfNewLinePlacement>
- <CatchNewLinePlacement>NewLine</CatchNewLinePlacement>
- <FinallyNewLinePlacement>NewLine</FinallyNewLinePlacement>
- <WhileNewLinePlacement>DoNotCare</WhileNewLinePlacement>
- <ArrayInitializerWrapping>DoNotChange</ArrayInitializerWrapping>
- <ArrayInitializerBraceStyle>NextLine</ArrayInitializerBraceStyle>
- <KeepCommentsAtFirstColumn>True</KeepCommentsAtFirstColumn>
- <BeforeMethodDeclarationParentheses>False</BeforeMethodDeclarationParentheses>
- <BetweenEmptyMethodDeclarationParentheses>False</BetweenEmptyMethodDeclarationParentheses>
- <BeforeMethodDeclarationParameterComma>False</BeforeMethodDeclarationParameterComma>
- <AfterMethodDeclarationParameterComma>True</AfterMethodDeclarationParameterComma>
- <WithinMethodDeclarationParentheses>False</WithinMethodDeclarationParentheses>
- <BeforeMethodCallParentheses>False</BeforeMethodCallParentheses>
- <BetweenEmptyMethodCallParentheses>False</BetweenEmptyMethodCallParentheses>
- <BeforeMethodCallParameterComma>False</BeforeMethodCallParameterComma>
- <AfterMethodCallParameterComma>True</AfterMethodCallParameterComma>
- <WithinMethodCallParentheses>False</WithinMethodCallParentheses>
- <BeforeFieldDeclarationComma>False</BeforeFieldDeclarationComma>
- <AfterFieldDeclarationComma>True</AfterFieldDeclarationComma>
- <BeforeLocalVariableDeclarationComma>False</BeforeLocalVariableDeclarationComma>
- <AfterLocalVariableDeclarationComma>True</AfterLocalVariableDeclarationComma>
- <BeforeConstructorDeclarationParentheses>False</BeforeConstructorDeclarationParentheses>
- <BetweenEmptyConstructorDeclarationParentheses>False</BetweenEmptyConstructorDeclarationParentheses>
- <BeforeConstructorDeclarationParameterComma>False</BeforeConstructorDeclarationParameterComma>
- <AfterConstructorDeclarationParameterComma>True</AfterConstructorDeclarationParameterComma>
- <WithinConstructorDeclarationParentheses>False</WithinConstructorDeclarationParentheses>
- <NewLineBeforeConstructorInitializerColon>NewLine</NewLineBeforeConstructorInitializerColon>
- <NewLineAfterConstructorInitializerColon>SameLine</NewLineAfterConstructorInitializerColon>
- <BeforeIndexerDeclarationBracket>True</BeforeIndexerDeclarationBracket>
- <WithinIndexerDeclarationBracket>False</WithinIndexerDeclarationBracket>
- <BeforeIndexerDeclarationParameterComma>False</BeforeIndexerDeclarationParameterComma>
- <AfterIndexerDeclarationParameterComma>True</AfterIndexerDeclarationParameterComma>
- <BeforeDelegateDeclarationParentheses>False</BeforeDelegateDeclarationParentheses>
- <BetweenEmptyDelegateDeclarationParentheses>False</BetweenEmptyDelegateDeclarationParentheses>
- <BeforeDelegateDeclarationParameterComma>False</BeforeDelegateDeclarationParameterComma>
- <AfterDelegateDeclarationParameterComma>False</AfterDelegateDeclarationParameterComma>
- <WithinDelegateDeclarationParentheses>False</WithinDelegateDeclarationParentheses>
- <NewParentheses>False</NewParentheses>
- <IfParentheses>True</IfParentheses>
- <WhileParentheses>True</WhileParentheses>
- <ForParentheses>True</ForParentheses>
- <ForeachParentheses>True</ForeachParentheses>
- <CatchParentheses>True</CatchParentheses>
- <SwitchParentheses>True</SwitchParentheses>
- <LockParentheses>True</LockParentheses>
- <UsingParentheses>True</UsingParentheses>
- <AroundAssignmentParentheses>True</AroundAssignmentParentheses>
- <AroundLogicalOperatorParentheses>True</AroundLogicalOperatorParentheses>
- <AroundEqualityOperatorParentheses>True</AroundEqualityOperatorParentheses>
- <AroundRelationalOperatorParentheses>True</AroundRelationalOperatorParentheses>
- <AroundBitwiseOperatorParentheses>True</AroundBitwiseOperatorParentheses>
- <AroundAdditiveOperatorParentheses>True</AroundAdditiveOperatorParentheses>
- <AroundMultiplicativeOperatorParentheses>True</AroundMultiplicativeOperatorParentheses>
- <AroundShiftOperatorParentheses>True</AroundShiftOperatorParentheses>
- <AroundNullCoalescingOperator>True</AroundNullCoalescingOperator>
- <WithinParentheses>False</WithinParentheses>
- <WithinIfParentheses>False</WithinIfParentheses>
- <WithinWhileParentheses>False</WithinWhileParentheses>
- <WithinForParentheses>False</WithinForParentheses>
- <WithinForEachParentheses>False</WithinForEachParentheses>
- <WithinCatchParentheses>False</WithinCatchParentheses>
- <WithinSwitchParentheses>False</WithinSwitchParentheses>
- <WithinLockParentheses>False</WithinLockParentheses>
- <WithinUsingParentheses>False</WithinUsingParentheses>
- <WithinCastParentheses>False</WithinCastParentheses>
- <WithinSizeOfParentheses>False</WithinSizeOfParentheses>
- <BeforeSizeOfParentheses>False</BeforeSizeOfParentheses>
- <WithinTypeOfParentheses>False</WithinTypeOfParentheses>
- <WithinNewParentheses>False</WithinNewParentheses>
- <BetweenEmptyNewParentheses>False</BetweenEmptyNewParentheses>
- <BeforeNewParameterComma>False</BeforeNewParameterComma>
- <AfterNewParameterComma>True</AfterNewParameterComma>
- <BeforeTypeOfParentheses>False</BeforeTypeOfParentheses>
- <WithinCheckedExpressionParantheses>False</WithinCheckedExpressionParantheses>
- <ConditionalOperatorBeforeConditionSpace>True</ConditionalOperatorBeforeConditionSpace>
- <ConditionalOperatorAfterConditionSpace>True</ConditionalOperatorAfterConditionSpace>
- <ConditionalOperatorBeforeSeparatorSpace>True</ConditionalOperatorBeforeSeparatorSpace>
- <ConditionalOperatorAfterSeparatorSpace>True</ConditionalOperatorAfterSeparatorSpace>
- <SpacesWithinBrackets>False</SpacesWithinBrackets>
- <SpacesBeforeBrackets>False</SpacesBeforeBrackets>
- <BeforeBracketComma>False</BeforeBracketComma>
- <AfterBracketComma>True</AfterBracketComma>
- <SpacesBeforeForSemicolon>False</SpacesBeforeForSemicolon>
- <SpacesAfterForSemicolon>True</SpacesAfterForSemicolon>
- <SpacesAfterTypecast>False</SpacesAfterTypecast>
- <SpacesBeforeArrayDeclarationBrackets>False</SpacesBeforeArrayDeclarationBrackets>
- <BlankLinesBeforeUsings>0</BlankLinesBeforeUsings>
- <BlankLinesAfterUsings>1</BlankLinesAfterUsings>
- <BlankLinesBeforeFirstDeclaration>0</BlankLinesBeforeFirstDeclaration>
- <BlankLinesBetweenTypes>1</BlankLinesBetweenTypes>
- <BlankLinesBetweenFields>0</BlankLinesBetweenFields>
- <BlankLinesBetweenEventFields>0</BlankLinesBetweenEventFields>
- <BlankLinesBetweenMembers>1</BlankLinesBetweenMembers>
- <BlankLinesInsideRegion>1</BlankLinesInsideRegion>
- <BlankLinesAroundRegion>1</BlankLinesAroundRegion>
- <IndentPreprocessorDirectives>True</IndentPreprocessorDirectives>
- <IndentBlocksInsideExpressions>True</IndentBlocksInsideExpressions>
+ <IndentBlock>True</IndentBlock>
+ <IndentBraces>False</IndentBraces>
+ <IndentSwitchSection>True</IndentSwitchSection>
+ <IndentSwitchCaseSection>True</IndentSwitchCaseSection>
+ <LabelPositioning>OneLess</LabelPositioning>
+ <NewLinesForBracesInTypes>True</NewLinesForBracesInTypes>
+ <NewLinesForBracesInMethods>True</NewLinesForBracesInMethods>
+ <NewLinesForBracesInProperties>True</NewLinesForBracesInProperties>
+ <NewLinesForBracesInAccessors>True</NewLinesForBracesInAccessors>
+ <NewLinesForBracesInAnonymousMethods>True</NewLinesForBracesInAnonymousMethods>
+ <NewLinesForBracesInControlBlocks>True</NewLinesForBracesInControlBlocks>
+ <NewLinesForBracesInAnonymousTypes>True</NewLinesForBracesInAnonymousTypes>
+ <NewLinesForBracesInObjectCollectionArrayInitializers>True</NewLinesForBracesInObjectCollectionArrayInitializers>
+ <NewLinesForBracesInLambdaExpressionBody>True</NewLinesForBracesInLambdaExpressionBody>
+ <NewLineForElse>True</NewLineForElse>
+ <NewLineForCatch>True</NewLineForCatch>
+ <NewLineForFinally>True</NewLineForFinally>
+ <NewLineForMembersInObjectInit>True</NewLineForMembersInObjectInit>
+ <NewLineForMembersInAnonymousTypes>True</NewLineForMembersInAnonymousTypes>
+ <NewLineForClausesInQuery>True</NewLineForClausesInQuery>
+ <SpacingAfterMethodDeclarationName>False</SpacingAfterMethodDeclarationName>
+ <SpaceWithinMethodDeclarationParenthesis>False</SpaceWithinMethodDeclarationParenthesis>
+ <SpaceBetweenEmptyMethodDeclarationParentheses>False</SpaceBetweenEmptyMethodDeclarationParentheses>
+ <SpaceAfterMethodCallName>False</SpaceAfterMethodCallName>
+ <SpaceWithinMethodCallParentheses>False</SpaceWithinMethodCallParentheses>
+ <SpaceBetweenEmptyMethodCallParentheses>False</SpaceBetweenEmptyMethodCallParentheses>
+ <SpaceAfterControlFlowStatementKeyword>True</SpaceAfterControlFlowStatementKeyword>
+ <SpaceWithinExpressionParentheses>False</SpaceWithinExpressionParentheses>
+ <SpaceWithinCastParentheses>False</SpaceWithinCastParentheses>
+ <SpaceWithinOtherParentheses>False</SpaceWithinOtherParentheses>
+ <SpaceAfterCast>False</SpaceAfterCast>
+ <SpacesIgnoreAroundVariableDeclaration>False</SpacesIgnoreAroundVariableDeclaration>
+ <SpaceBeforeOpenSquareBracket>False</SpaceBeforeOpenSquareBracket>
+ <SpaceBetweenEmptySquareBrackets>False</SpaceBetweenEmptySquareBrackets>
+ <SpaceWithinSquareBrackets>False</SpaceWithinSquareBrackets>
+ <SpaceAfterColonInBaseTypeDeclaration>True</SpaceAfterColonInBaseTypeDeclaration>
+ <SpaceAfterComma>True</SpaceAfterComma>
+ <SpaceAfterDot>False</SpaceAfterDot>
+ <SpaceAfterSemicolonsInForStatement>True</SpaceAfterSemicolonsInForStatement>
+ <SpaceBeforeColonInBaseTypeDeclaration>True</SpaceBeforeColonInBaseTypeDeclaration>
+ <SpaceBeforeComma>False</SpaceBeforeComma>
+ <SpaceBeforeDot>False</SpaceBeforeDot>
+ <SpaceBeforeSemicolonsInForStatement>False</SpaceBeforeSemicolonsInForStatement>
+ <SpacingAroundBinaryOperator>Single</SpacingAroundBinaryOperator>
+ <WrappingPreserveSingleLine>True</WrappingPreserveSingleLine>
+ <WrappingKeepStatementsOnSingleLine>True</WrappingKeepStatementsOnSingleLine>
</CSharpFormattingPolicy> \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/GNUCSharpPolicy.xml b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/GNUCSharpPolicy.xml
deleted file mode 100644
index a40b19ac24..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/GNUCSharpPolicy.xml
+++ /dev/null
@@ -1,163 +0,0 @@
-<!--
-
-GNUCSharpPolicy.xml
-
-Author:
- Mike Krüger <mkrueger@xamarin.com>
-
-Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
--->
-
-
-<CSharpFormattingPolicy scope="text/x-csharp" allowDiffSerialize="False">
- <IndentNamespaceBody>True</IndentNamespaceBody>
- <IndentClassBody>True</IndentClassBody>
- <IndentInterfaceBody>True</IndentInterfaceBody>
- <IndentStructBody>True</IndentStructBody>
- <IndentEnumBody>True</IndentEnumBody>
- <IndentMethodBody>True</IndentMethodBody>
- <IndentPropertyBody>True</IndentPropertyBody>
- <IndentEventBody>True</IndentEventBody>
- <IndentBlocks>True</IndentBlocks>
- <IndentSwitchBody>True</IndentSwitchBody>
- <IndentCaseBody>True</IndentCaseBody>
- <IndentBreakStatements>True</IndentBreakStatements>
- <AlignEmbeddedStatements>True</AlignEmbeddedStatements>
- <PropertyFormatting>AllowOneLine</PropertyFormatting>
- <NamespaceBraceStyle>NextLine</NamespaceBraceStyle>
- <ClassBraceStyle>NextLine</ClassBraceStyle>
- <InterfaceBraceStyle>NextLine</InterfaceBraceStyle>
- <StructBraceStyle>NextLine</StructBraceStyle>
- <EnumBraceStyle>NextLine</EnumBraceStyle>
- <MethodBraceStyle>NextLine</MethodBraceStyle>
- <AnonymousMethodBraceStyle>EndOfLine</AnonymousMethodBraceStyle>
- <ConstructorBraceStyle>NextLine</ConstructorBraceStyle>
- <DestructorBraceStyle>NextLine</DestructorBraceStyle>
- <PropertyBraceStyle>EndOfLine</PropertyBraceStyle>
- <PropertyGetBraceStyle>EndOfLine</PropertyGetBraceStyle>
- <PropertySetBraceStyle>EndOfLine</PropertySetBraceStyle>
- <SimpleGetBlockFormatting>AllowOneLine</SimpleGetBlockFormatting>
- <SimpleSetBlockFormatting>AllowOneLine</SimpleSetBlockFormatting>
- <EventBraceStyle>EndOfLine</EventBraceStyle>
- <EventAddBraceStyle>EndOfLine</EventAddBraceStyle>
- <EventRemoveBraceStyle>EndOfLine</EventRemoveBraceStyle>
- <AllowEventAddBlockInline>True</AllowEventAddBlockInline>
- <AllowEventRemoveBlockInline>True</AllowEventRemoveBlockInline>
- <StatementBraceStyle>NextLineShifted2</StatementBraceStyle>
- <AllowIfBlockInline>False</AllowIfBlockInline>
- <ElseNewLinePlacement>SameLine</ElseNewLinePlacement>
- <ElseIfNewLinePlacement>SameLine</ElseIfNewLinePlacement>
- <CatchNewLinePlacement>SameLine</CatchNewLinePlacement>
- <FinallyNewLinePlacement>SameLine</FinallyNewLinePlacement>
- <WhileNewLinePlacement>SameLine</WhileNewLinePlacement>
- <ArrayInitializerWrapping>WrapIfTooLong</ArrayInitializerWrapping>
- <ArrayInitializerBraceStyle>EndOfLine</ArrayInitializerBraceStyle>
- <KeepCommentsAtFirstColumn>True</KeepCommentsAtFirstColumn>
- <BeforeMethodDeclarationParentheses>False</BeforeMethodDeclarationParentheses>
- <BetweenEmptyMethodDeclarationParentheses>False</BetweenEmptyMethodDeclarationParentheses>
- <BeforeMethodDeclarationParameterComma>False</BeforeMethodDeclarationParameterComma>
- <AfterMethodDeclarationParameterComma>True</AfterMethodDeclarationParameterComma>
- <WithinMethodDeclarationParentheses>False</WithinMethodDeclarationParentheses>
- <BeforeMethodCallParentheses>False</BeforeMethodCallParentheses>
- <BetweenEmptyMethodCallParentheses>False</BetweenEmptyMethodCallParentheses>
- <BeforeMethodCallParameterComma>False</BeforeMethodCallParameterComma>
- <AfterMethodCallParameterComma>True</AfterMethodCallParameterComma>
- <WithinMethodCallParentheses>False</WithinMethodCallParentheses>
- <BeforeFieldDeclarationComma>False</BeforeFieldDeclarationComma>
- <AfterFieldDeclarationComma>True</AfterFieldDeclarationComma>
- <BeforeLocalVariableDeclarationComma>False</BeforeLocalVariableDeclarationComma>
- <AfterLocalVariableDeclarationComma>True</AfterLocalVariableDeclarationComma>
- <BeforeConstructorDeclarationParentheses>False</BeforeConstructorDeclarationParentheses>
- <BetweenEmptyConstructorDeclarationParentheses>False</BetweenEmptyConstructorDeclarationParentheses>
- <BeforeConstructorDeclarationParameterComma>False</BeforeConstructorDeclarationParameterComma>
- <AfterConstructorDeclarationParameterComma>True</AfterConstructorDeclarationParameterComma>
- <WithinConstructorDeclarationParentheses>False</WithinConstructorDeclarationParentheses>
- <NewLineBeforeConstructorInitializerColon>NewLine</NewLineBeforeConstructorInitializerColon>
- <NewLineAfterConstructorInitializerColon>SameLine</NewLineAfterConstructorInitializerColon>
- <BeforeIndexerDeclarationBracket>True</BeforeIndexerDeclarationBracket>
- <WithinIndexerDeclarationBracket>False</WithinIndexerDeclarationBracket>
- <BeforeIndexerDeclarationParameterComma>False</BeforeIndexerDeclarationParameterComma>
- <AfterIndexerDeclarationParameterComma>True</AfterIndexerDeclarationParameterComma>
- <BeforeDelegateDeclarationParentheses>False</BeforeDelegateDeclarationParentheses>
- <BetweenEmptyDelegateDeclarationParentheses>False</BetweenEmptyDelegateDeclarationParentheses>
- <BeforeDelegateDeclarationParameterComma>False</BeforeDelegateDeclarationParameterComma>
- <AfterDelegateDeclarationParameterComma>False</AfterDelegateDeclarationParameterComma>
- <WithinDelegateDeclarationParentheses>False</WithinDelegateDeclarationParentheses>
- <NewParentheses>False</NewParentheses>
- <IfParentheses>True</IfParentheses>
- <WhileParentheses>True</WhileParentheses>
- <ForParentheses>True</ForParentheses>
- <ForeachParentheses>True</ForeachParentheses>
- <CatchParentheses>True</CatchParentheses>
- <SwitchParentheses>True</SwitchParentheses>
- <LockParentheses>True</LockParentheses>
- <UsingParentheses>True</UsingParentheses>
- <AroundAssignmentParentheses>True</AroundAssignmentParentheses>
- <AroundLogicalOperatorParentheses>True</AroundLogicalOperatorParentheses>
- <AroundEqualityOperatorParentheses>True</AroundEqualityOperatorParentheses>
- <AroundRelationalOperatorParentheses>True</AroundRelationalOperatorParentheses>
- <AroundBitwiseOperatorParentheses>True</AroundBitwiseOperatorParentheses>
- <AroundAdditiveOperatorParentheses>True</AroundAdditiveOperatorParentheses>
- <AroundMultiplicativeOperatorParentheses>True</AroundMultiplicativeOperatorParentheses>
- <AroundShiftOperatorParentheses>True</AroundShiftOperatorParentheses>
- <AroundNullCoalescingOperator>True</AroundNullCoalescingOperator>
- <WithinParentheses>False</WithinParentheses>
- <WithinIfParentheses>False</WithinIfParentheses>
- <WithinWhileParentheses>False</WithinWhileParentheses>
- <WithinForParentheses>False</WithinForParentheses>
- <WithinForEachParentheses>False</WithinForEachParentheses>
- <WithinCatchParentheses>False</WithinCatchParentheses>
- <WithinSwitchParentheses>False</WithinSwitchParentheses>
- <WithinLockParentheses>False</WithinLockParentheses>
- <WithinUsingParentheses>False</WithinUsingParentheses>
- <WithinCastParentheses>False</WithinCastParentheses>
- <WithinSizeOfParentheses>False</WithinSizeOfParentheses>
- <BeforeSizeOfParentheses>False</BeforeSizeOfParentheses>
- <WithinTypeOfParentheses>False</WithinTypeOfParentheses>
- <WithinNewParentheses>False</WithinNewParentheses>
- <BetweenEmptyNewParentheses>False</BetweenEmptyNewParentheses>
- <BeforeNewParameterComma>False</BeforeNewParameterComma>
- <AfterNewParameterComma>True</AfterNewParameterComma>
- <BeforeTypeOfParentheses>False</BeforeTypeOfParentheses>
- <WithinCheckedExpressionParantheses>False</WithinCheckedExpressionParantheses>
- <ConditionalOperatorBeforeConditionSpace>True</ConditionalOperatorBeforeConditionSpace>
- <ConditionalOperatorAfterConditionSpace>True</ConditionalOperatorAfterConditionSpace>
- <ConditionalOperatorBeforeSeparatorSpace>True</ConditionalOperatorBeforeSeparatorSpace>
- <ConditionalOperatorAfterSeparatorSpace>True</ConditionalOperatorAfterSeparatorSpace>
- <SpacesWithinBrackets>False</SpacesWithinBrackets>
- <SpacesBeforeBrackets>False</SpacesBeforeBrackets>
- <BeforeBracketComma>False</BeforeBracketComma>
- <AfterBracketComma>True</AfterBracketComma>
- <SpacesBeforeForSemicolon>False</SpacesBeforeForSemicolon>
- <SpacesAfterForSemicolon>True</SpacesAfterForSemicolon>
- <SpacesAfterTypecast>False</SpacesAfterTypecast>
- <SpacesBeforeArrayDeclarationBrackets>False</SpacesBeforeArrayDeclarationBrackets>
- <BlankLinesBeforeUsings>0</BlankLinesBeforeUsings>
- <BlankLinesAfterUsings>1</BlankLinesAfterUsings>
- <BlankLinesBeforeFirstDeclaration>0</BlankLinesBeforeFirstDeclaration>
- <BlankLinesBetweenTypes>1</BlankLinesBetweenTypes>
- <BlankLinesBetweenFields>0</BlankLinesBetweenFields>
- <BlankLinesBetweenEventFields>0</BlankLinesBetweenEventFields>
- <BlankLinesBetweenMembers>1</BlankLinesBetweenMembers>
- <BlankLinesInsideRegion>1</BlankLinesInsideRegion>
- <BlankLinesAroundRegion>1</BlankLinesAroundRegion>
- <IndentBlocksInsideExpressions>False</IndentBlocksInsideExpressions>
-</CSharpFormattingPolicy> \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/GNUTextStylePolicy.xml b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/GNUTextStylePolicy.xml
deleted file mode 100644
index e04fa3260f..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/GNUTextStylePolicy.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<!--
-
-GNUTextStylePolicy.xml
-
-Author:
- Mike Krüger <mkrueger@xamarin.com>
-
-Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
--->
-
-<TextStylePolicy scope="text/x-csharp">
- <FileWidth>120</FileWidth>
- <TabWidth>4</TabWidth>
- <IndentWidth>2</IndentWidth>
- <TabsToSpaces>True</TabsToSpaces>
- <NoTabsAfterNonTabs>False</NoTabsAfterNonTabs>
- <RemoveTrailingWhitespace>True</RemoveTrailingWhitespace>
- <EolMarker>Unix</EolMarker>
-</TextStylePolicy> \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/KRCSharpPolicy.xml b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/KRCSharpPolicy.xml
index b9f7b6b8a6..b717463f6c 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/KRCSharpPolicy.xml
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/KRCSharpPolicy.xml
@@ -27,138 +27,50 @@ THE SOFTWARE.
-->
<CSharpFormattingPolicy scope="text/x-csharp" allowDiffSerialize="False">
- <IndentNamespaceBody>True</IndentNamespaceBody>
- <IndentClassBody>True</IndentClassBody>
- <IndentInterfaceBody>True</IndentInterfaceBody>
- <IndentStructBody>True</IndentStructBody>
- <IndentEnumBody>True</IndentEnumBody>
- <IndentMethodBody>True</IndentMethodBody>
- <IndentPropertyBody>True</IndentPropertyBody>
- <IndentEventBody>True</IndentEventBody>
- <IndentBlocks>True</IndentBlocks>
- <IndentSwitchBody>True</IndentSwitchBody>
- <IndentCaseBody>True</IndentCaseBody>
- <IndentBreakStatements>True</IndentBreakStatements>
- <AlignEmbeddedStatements>True</AlignEmbeddedStatements>
- <SimplePropertyFormatting>AllowOneLine</SimplePropertyFormatting>
- <AutoPropertyFormatting>AllowOneLine</AutoPropertyFormatting>
- <NamespaceBraceStyle>NextLine</NamespaceBraceStyle>
- <ClassBraceStyle>NextLine</ClassBraceStyle>
- <InterfaceBraceStyle>NextLine</InterfaceBraceStyle>
- <StructBraceStyle>NextLine</StructBraceStyle>
- <EnumBraceStyle>NextLine</EnumBraceStyle>
- <MethodBraceStyle>NextLine</MethodBraceStyle>
- <AnonymousMethodBraceStyle>EndOfLine</AnonymousMethodBraceStyle>
- <ConstructorBraceStyle>NextLine</ConstructorBraceStyle>
- <DestructorBraceStyle>NextLine</DestructorBraceStyle>
- <PropertyBraceStyle>EndOfLine</PropertyBraceStyle>
- <PropertyGetBraceStyle>EndOfLine</PropertyGetBraceStyle>
- <PropertySetBraceStyle>EndOfLine</PropertySetBraceStyle>
- <SimpleGetBlockFormatting>AllowOneLine</SimpleGetBlockFormatting>
- <SimpleSetBlockFormatting>AllowOneLine</SimpleSetBlockFormatting>
- <EventBraceStyle>EndOfLine</EventBraceStyle>
- <EventAddBraceStyle>EndOfLine</EventAddBraceStyle>
- <EventRemoveBraceStyle>EndOfLine</EventRemoveBraceStyle>
- <AllowEventAddBlockInline>True</AllowEventAddBlockInline>
- <AllowEventRemoveBlockInline>True</AllowEventRemoveBlockInline>
- <StatementBraceStyle>EndOfLine</StatementBraceStyle>
- <AllowIfBlockInline>False</AllowIfBlockInline>
- <ElseNewLinePlacement>SameLine</ElseNewLinePlacement>
- <ElseIfNewLinePlacement>SameLine</ElseIfNewLinePlacement>
- <CatchNewLinePlacement>SameLine</CatchNewLinePlacement>
- <FinallyNewLinePlacement>SameLine</FinallyNewLinePlacement>
- <WhileNewLinePlacement>SameLine</WhileNewLinePlacement>
- <ArrayInitializerWrapping>WrapIfTooLong</ArrayInitializerWrapping>
- <ArrayInitializerBraceStyle>EndOfLine</ArrayInitializerBraceStyle>
- <KeepCommentsAtFirstColumn>True</KeepCommentsAtFirstColumn>
- <BeforeMethodDeclarationParentheses>False</BeforeMethodDeclarationParentheses>
- <BetweenEmptyMethodDeclarationParentheses>False</BetweenEmptyMethodDeclarationParentheses>
- <BeforeMethodDeclarationParameterComma>False</BeforeMethodDeclarationParameterComma>
- <AfterMethodDeclarationParameterComma>True</AfterMethodDeclarationParameterComma>
- <WithinMethodDeclarationParentheses>False</WithinMethodDeclarationParentheses>
- <BeforeMethodCallParentheses>False</BeforeMethodCallParentheses>
- <BetweenEmptyMethodCallParentheses>False</BetweenEmptyMethodCallParentheses>
- <BeforeMethodCallParameterComma>False</BeforeMethodCallParameterComma>
- <AfterMethodCallParameterComma>True</AfterMethodCallParameterComma>
- <WithinMethodCallParentheses>False</WithinMethodCallParentheses>
- <BeforeFieldDeclarationComma>False</BeforeFieldDeclarationComma>
- <AfterFieldDeclarationComma>True</AfterFieldDeclarationComma>
- <BeforeLocalVariableDeclarationComma>False</BeforeLocalVariableDeclarationComma>
- <AfterLocalVariableDeclarationComma>True</AfterLocalVariableDeclarationComma>
- <BeforeConstructorDeclarationParentheses>False</BeforeConstructorDeclarationParentheses>
- <BetweenEmptyConstructorDeclarationParentheses>False</BetweenEmptyConstructorDeclarationParentheses>
- <BeforeConstructorDeclarationParameterComma>False</BeforeConstructorDeclarationParameterComma>
- <AfterConstructorDeclarationParameterComma>True</AfterConstructorDeclarationParameterComma>
- <WithinConstructorDeclarationParentheses>False</WithinConstructorDeclarationParentheses>
- <NewLineBeforeConstructorInitializerColon>NewLine</NewLineBeforeConstructorInitializerColon>
- <NewLineAfterConstructorInitializerColon>SameLine</NewLineAfterConstructorInitializerColon>
- <BeforeIndexerDeclarationBracket>True</BeforeIndexerDeclarationBracket>
- <WithinIndexerDeclarationBracket>False</WithinIndexerDeclarationBracket>
- <BeforeIndexerDeclarationParameterComma>False</BeforeIndexerDeclarationParameterComma>
- <AfterIndexerDeclarationParameterComma>True</AfterIndexerDeclarationParameterComma>
- <BeforeDelegateDeclarationParentheses>False</BeforeDelegateDeclarationParentheses>
- <BetweenEmptyDelegateDeclarationParentheses>False</BetweenEmptyDelegateDeclarationParentheses>
- <BeforeDelegateDeclarationParameterComma>False</BeforeDelegateDeclarationParameterComma>
- <AfterDelegateDeclarationParameterComma>False</AfterDelegateDeclarationParameterComma>
- <WithinDelegateDeclarationParentheses>False</WithinDelegateDeclarationParentheses>
- <NewParentheses>False</NewParentheses>
- <IfParentheses>True</IfParentheses>
- <WhileParentheses>True</WhileParentheses>
- <ForParentheses>True</ForParentheses>
- <ForeachParentheses>True</ForeachParentheses>
- <CatchParentheses>True</CatchParentheses>
- <SwitchParentheses>True</SwitchParentheses>
- <LockParentheses>True</LockParentheses>
- <UsingParentheses>True</UsingParentheses>
- <AroundAssignmentParentheses>True</AroundAssignmentParentheses>
- <AroundLogicalOperatorParentheses>True</AroundLogicalOperatorParentheses>
- <AroundEqualityOperatorParentheses>True</AroundEqualityOperatorParentheses>
- <AroundRelationalOperatorParentheses>True</AroundRelationalOperatorParentheses>
- <AroundBitwiseOperatorParentheses>True</AroundBitwiseOperatorParentheses>
- <AroundAdditiveOperatorParentheses>True</AroundAdditiveOperatorParentheses>
- <AroundMultiplicativeOperatorParentheses>True</AroundMultiplicativeOperatorParentheses>
- <AroundShiftOperatorParentheses>True</AroundShiftOperatorParentheses>
- <AroundNullCoalescingOperator>True</AroundNullCoalescingOperator>
- <WithinParentheses>False</WithinParentheses>
- <WithinIfParentheses>False</WithinIfParentheses>
- <WithinWhileParentheses>False</WithinWhileParentheses>
- <WithinForParentheses>False</WithinForParentheses>
- <WithinForEachParentheses>False</WithinForEachParentheses>
- <WithinCatchParentheses>False</WithinCatchParentheses>
- <WithinSwitchParentheses>False</WithinSwitchParentheses>
- <WithinLockParentheses>False</WithinLockParentheses>
- <WithinUsingParentheses>False</WithinUsingParentheses>
- <WithinCastParentheses>False</WithinCastParentheses>
- <WithinSizeOfParentheses>False</WithinSizeOfParentheses>
- <BeforeSizeOfParentheses>False</BeforeSizeOfParentheses>
- <WithinTypeOfParentheses>False</WithinTypeOfParentheses>
- <WithinNewParentheses>False</WithinNewParentheses>
- <BetweenEmptyNewParentheses>False</BetweenEmptyNewParentheses>
- <BeforeNewParameterComma>False</BeforeNewParameterComma>
- <AfterNewParameterComma>True</AfterNewParameterComma>
- <BeforeTypeOfParentheses>False</BeforeTypeOfParentheses>
- <WithinCheckedExpressionParantheses>False</WithinCheckedExpressionParantheses>
- <ConditionalOperatorBeforeConditionSpace>True</ConditionalOperatorBeforeConditionSpace>
- <ConditionalOperatorAfterConditionSpace>True</ConditionalOperatorAfterConditionSpace>
- <ConditionalOperatorBeforeSeparatorSpace>True</ConditionalOperatorBeforeSeparatorSpace>
- <ConditionalOperatorAfterSeparatorSpace>True</ConditionalOperatorAfterSeparatorSpace>
- <SpacesWithinBrackets>False</SpacesWithinBrackets>
- <SpacesBeforeBrackets>False</SpacesBeforeBrackets>
- <BeforeBracketComma>False</BeforeBracketComma>
- <AfterBracketComma>True</AfterBracketComma>
- <SpacesBeforeForSemicolon>False</SpacesBeforeForSemicolon>
- <SpacesAfterForSemicolon>True</SpacesAfterForSemicolon>
- <SpacesAfterTypecast>False</SpacesAfterTypecast>
- <SpacesBeforeArrayDeclarationBrackets>False</SpacesBeforeArrayDeclarationBrackets>
- <BlankLinesBeforeUsings>0</BlankLinesBeforeUsings>
- <BlankLinesAfterUsings>1</BlankLinesAfterUsings>
- <BlankLinesBeforeFirstDeclaration>0</BlankLinesBeforeFirstDeclaration>
- <BlankLinesBetweenTypes>1</BlankLinesBetweenTypes>
- <BlankLinesBetweenFields>0</BlankLinesBetweenFields>
- <BlankLinesBetweenEventFields>0</BlankLinesBetweenEventFields>
- <BlankLinesBetweenMembers>1</BlankLinesBetweenMembers>
- <BlankLinesInsideRegion>1</BlankLinesInsideRegion>
- <BlankLinesAroundRegion>1</BlankLinesAroundRegion>
- <IndentPreprocessorDirectives>True</IndentPreprocessorDirectives>
- <IndentBlocksInsideExpressions>False</IndentBlocksInsideExpressions>
+ <IndentBlock>True</IndentBlock>
+ <IndentBraces>False</IndentBraces>
+ <IndentSwitchSection>True</IndentSwitchSection>
+ <IndentSwitchCaseSection>True</IndentSwitchCaseSection>
+ <LabelPositioning>OneLess</LabelPositioning>
+ <NewLinesForBracesInTypes>True</NewLinesForBracesInTypes>
+ <NewLinesForBracesInMethods>True</NewLinesForBracesInMethods>
+ <NewLinesForBracesInProperties>False</NewLinesForBracesInProperties>
+ <NewLinesForBracesInAccessors>False</NewLinesForBracesInAccessors>
+ <NewLinesForBracesInAnonymousMethods>False</NewLinesForBracesInAnonymousMethods>
+ <NewLinesForBracesInControlBlocks>False</NewLinesForBracesInControlBlocks>
+ <NewLinesForBracesInAnonymousTypes>False</NewLinesForBracesInAnonymousTypes>
+ <NewLinesForBracesInObjectCollectionArrayInitializers>False</NewLinesForBracesInObjectCollectionArrayInitializers>
+ <NewLinesForBracesInLambdaExpressionBody>False</NewLinesForBracesInLambdaExpressionBody>
+ <NewLineForElse>False</NewLineForElse>
+ <NewLineForCatch>False</NewLineForCatch>
+ <NewLineForFinally>False</NewLineForFinally>
+ <NewLineForMembersInObjectInit>False</NewLineForMembersInObjectInit>
+ <NewLineForMembersInAnonymousTypes>False</NewLineForMembersInAnonymousTypes>
+ <NewLineForClausesInQuery>False</NewLineForClausesInQuery>
+ <SpacingAfterMethodDeclarationName>False</SpacingAfterMethodDeclarationName>
+ <SpaceWithinMethodDeclarationParenthesis>False</SpaceWithinMethodDeclarationParenthesis>
+ <SpaceBetweenEmptyMethodDeclarationParentheses>False</SpaceBetweenEmptyMethodDeclarationParentheses>
+ <SpaceAfterMethodCallName>False</SpaceAfterMethodCallName>
+ <SpaceWithinMethodCallParentheses>False</SpaceWithinMethodCallParentheses>
+ <SpaceBetweenEmptyMethodCallParentheses>False</SpaceBetweenEmptyMethodCallParentheses>
+ <SpaceAfterControlFlowStatementKeyword>True</SpaceAfterControlFlowStatementKeyword>
+ <SpaceWithinExpressionParentheses>False</SpaceWithinExpressionParentheses>
+ <SpaceWithinCastParentheses>False</SpaceWithinCastParentheses>
+ <SpaceWithinOtherParentheses>False</SpaceWithinOtherParentheses>
+ <SpaceAfterCast>False</SpaceAfterCast>
+ <SpacesIgnoreAroundVariableDeclaration>False</SpacesIgnoreAroundVariableDeclaration>
+ <SpaceBeforeOpenSquareBracket>False</SpaceBeforeOpenSquareBracket>
+ <SpaceBetweenEmptySquareBrackets>False</SpaceBetweenEmptySquareBrackets>
+ <SpaceWithinSquareBrackets>False</SpaceWithinSquareBrackets>
+ <SpaceAfterColonInBaseTypeDeclaration>True</SpaceAfterColonInBaseTypeDeclaration>
+ <SpaceAfterComma>True</SpaceAfterComma>
+ <SpaceAfterDot>False</SpaceAfterDot>
+ <SpaceAfterSemicolonsInForStatement>True</SpaceAfterSemicolonsInForStatement>
+ <SpaceBeforeColonInBaseTypeDeclaration>True</SpaceBeforeColonInBaseTypeDeclaration>
+ <SpaceBeforeComma>False</SpaceBeforeComma>
+ <SpaceBeforeDot>False</SpaceBeforeDot>
+ <SpaceBeforeSemicolonsInForStatement>False</SpaceBeforeSemicolonsInForStatement>
+ <SpacingAroundBinaryOperator>Single</SpacingAroundBinaryOperator>
+ <WrappingPreserveSingleLine>True</WrappingPreserveSingleLine>
+ <WrappingKeepStatementsOnSingleLine>True</WrappingKeepStatementsOnSingleLine>
</CSharpFormattingPolicy> \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/MonoCSharpPolicy.xml b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/MonoCSharpPolicy.xml
index 9924d6f2c3..de17e13698 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/MonoCSharpPolicy.xml
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/MonoCSharpPolicy.xml
@@ -27,140 +27,50 @@ THE SOFTWARE.
-->
<CSharpFormattingPolicy scope="text/x-csharp" allowDiffSerialize="True">
- <IndentNamespaceBody>True</IndentNamespaceBody>
- <IndentClassBody>True</IndentClassBody>
- <IndentInterfaceBody>True</IndentInterfaceBody>
- <IndentStructBody>True</IndentStructBody>
- <IndentEnumBody>True</IndentEnumBody>
- <IndentMethodBody>True</IndentMethodBody>
- <IndentPropertyBody>True</IndentPropertyBody>
- <IndentEventBody>True</IndentEventBody>
- <IndentBlocks>True</IndentBlocks>
- <IndentSwitchBody>False</IndentSwitchBody>
- <IndentCaseBody>True</IndentCaseBody>
- <IndentBreakStatements>True</IndentBreakStatements>
- <AlignEmbeddedStatements>True</AlignEmbeddedStatements>
- <SimplePropertyFormatting>AllowOneLine</SimplePropertyFormatting>
- <AutoPropertyFormatting>AllowOneLine</AutoPropertyFormatting>
- <NamespaceBraceStyle>NextLine</NamespaceBraceStyle>
- <ClassBraceStyle>NextLine</ClassBraceStyle>
- <InterfaceBraceStyle>NextLine</InterfaceBraceStyle>
- <StructBraceStyle>NextLine</StructBraceStyle>
- <EnumBraceStyle>NextLine</EnumBraceStyle>
- <MethodBraceStyle>NextLine</MethodBraceStyle>
- <AnonymousMethodBraceStyle>EndOfLine</AnonymousMethodBraceStyle>
- <ConstructorBraceStyle>NextLine</ConstructorBraceStyle>
- <DestructorBraceStyle>NextLine</DestructorBraceStyle>
- <PropertyBraceStyle>EndOfLine</PropertyBraceStyle>
- <PropertyGetBraceStyle>EndOfLine</PropertyGetBraceStyle>
- <PropertySetBraceStyle>EndOfLine</PropertySetBraceStyle>
- <SimpleGetBlockFormatting>AllowOneLine</SimpleGetBlockFormatting>
- <SimpleSetBlockFormatting>AllowOneLine</SimpleSetBlockFormatting>
- <EventBraceStyle>EndOfLine</EventBraceStyle>
- <EventAddBraceStyle>EndOfLine</EventAddBraceStyle>
- <EventRemoveBraceStyle>EndOfLine</EventRemoveBraceStyle>
- <AllowEventAddBlockInline>True</AllowEventAddBlockInline>
- <AllowEventRemoveBlockInline>True</AllowEventRemoveBlockInline>
- <StatementBraceStyle>EndOfLine</StatementBraceStyle>
- <AllowIfBlockInline>False</AllowIfBlockInline>
- <ElseNewLinePlacement>SameLine</ElseNewLinePlacement>
- <ElseIfNewLinePlacement>SameLine</ElseIfNewLinePlacement>
- <CatchNewLinePlacement>SameLine</CatchNewLinePlacement>
- <FinallyNewLinePlacement>SameLine</FinallyNewLinePlacement>
- <WhileNewLinePlacement>SameLine</WhileNewLinePlacement>
- <ArrayInitializerWrapping>WrapIfTooLong</ArrayInitializerWrapping>
- <ArrayInitializerBraceStyle>EndOfLine</ArrayInitializerBraceStyle>
- <KeepCommentsAtFirstColumn>True</KeepCommentsAtFirstColumn>
- <BeforeMethodDeclarationParentheses>True</BeforeMethodDeclarationParentheses>
- <BetweenEmptyMethodDeclarationParentheses>False</BetweenEmptyMethodDeclarationParentheses>
- <BeforeMethodDeclarationParameterComma>False</BeforeMethodDeclarationParameterComma>
- <AfterMethodDeclarationParameterComma>True</AfterMethodDeclarationParameterComma>
- <WithinMethodDeclarationParentheses>False</WithinMethodDeclarationParentheses>
- <BeforeMethodCallParentheses>True</BeforeMethodCallParentheses>
- <BetweenEmptyMethodCallParentheses>False</BetweenEmptyMethodCallParentheses>
- <BeforeMethodCallParameterComma>False</BeforeMethodCallParameterComma>
- <AfterMethodCallParameterComma>True</AfterMethodCallParameterComma>
- <WithinMethodCallParentheses>False</WithinMethodCallParentheses>
- <BeforeFieldDeclarationComma>False</BeforeFieldDeclarationComma>
- <AfterFieldDeclarationComma>True</AfterFieldDeclarationComma>
- <BeforeLocalVariableDeclarationComma>False</BeforeLocalVariableDeclarationComma>
- <AfterLocalVariableDeclarationComma>True</AfterLocalVariableDeclarationComma>
- <BeforeConstructorDeclarationParentheses>True</BeforeConstructorDeclarationParentheses>
- <BetweenEmptyConstructorDeclarationParentheses>False</BetweenEmptyConstructorDeclarationParentheses>
- <BeforeConstructorDeclarationParameterComma>False</BeforeConstructorDeclarationParameterComma>
- <AfterConstructorDeclarationParameterComma>True</AfterConstructorDeclarationParameterComma>
- <WithinConstructorDeclarationParentheses>False</WithinConstructorDeclarationParentheses>
- <NewLineBeforeConstructorInitializerColon>DoNotCare</NewLineBeforeConstructorInitializerColon>
- <NewLineAfterConstructorInitializerColon>DoNotCare</NewLineAfterConstructorInitializerColon>
- <BeforeIndexerDeclarationBracket>True</BeforeIndexerDeclarationBracket>
- <WithinIndexerDeclarationBracket>False</WithinIndexerDeclarationBracket>
- <BeforeIndexerDeclarationParameterComma>False</BeforeIndexerDeclarationParameterComma>
- <AfterIndexerDeclarationParameterComma>True</AfterIndexerDeclarationParameterComma>
- <BeforeDelegateDeclarationParentheses>True</BeforeDelegateDeclarationParentheses>
- <BetweenEmptyDelegateDeclarationParentheses>False</BetweenEmptyDelegateDeclarationParentheses>
- <BeforeDelegateDeclarationParameterComma>False</BeforeDelegateDeclarationParameterComma>
- <AfterDelegateDeclarationParameterComma>False</AfterDelegateDeclarationParameterComma>
- <WithinDelegateDeclarationParentheses>False</WithinDelegateDeclarationParentheses>
- <NewParentheses>True</NewParentheses>
- <IfParentheses>True</IfParentheses>
- <WhileParentheses>True</WhileParentheses>
- <ForParentheses>True</ForParentheses>
- <ForeachParentheses>True</ForeachParentheses>
- <CatchParentheses>True</CatchParentheses>
- <SwitchParentheses>True</SwitchParentheses>
- <LockParentheses>True</LockParentheses>
- <UsingParentheses>True</UsingParentheses>
- <AroundAssignmentParentheses>True</AroundAssignmentParentheses>
- <AroundLogicalOperatorParentheses>True</AroundLogicalOperatorParentheses>
- <AroundEqualityOperatorParentheses>True</AroundEqualityOperatorParentheses>
- <AroundRelationalOperatorParentheses>True</AroundRelationalOperatorParentheses>
- <AroundBitwiseOperatorParentheses>True</AroundBitwiseOperatorParentheses>
- <AroundAdditiveOperatorParentheses>True</AroundAdditiveOperatorParentheses>
- <AroundMultiplicativeOperatorParentheses>True</AroundMultiplicativeOperatorParentheses>
- <AroundShiftOperatorParentheses>True</AroundShiftOperatorParentheses>
- <AroundNullCoalescingOperator>True</AroundNullCoalescingOperator>
- <WithinParentheses>False</WithinParentheses>
- <WithinIfParentheses>False</WithinIfParentheses>
- <WithinWhileParentheses>False</WithinWhileParentheses>
- <WithinForParentheses>False</WithinForParentheses>
- <WithinForEachParentheses>False</WithinForEachParentheses>
- <WithinCatchParentheses>False</WithinCatchParentheses>
- <WithinSwitchParentheses>False</WithinSwitchParentheses>
- <WithinLockParentheses>False</WithinLockParentheses>
- <WithinUsingParentheses>False</WithinUsingParentheses>
- <WithinCastParentheses>False</WithinCastParentheses>
- <WithinSizeOfParentheses>False</WithinSizeOfParentheses>
- <BeforeSizeOfParentheses>False</BeforeSizeOfParentheses>
- <WithinTypeOfParentheses>False</WithinTypeOfParentheses>
- <WithinNewParentheses>False</WithinNewParentheses>
- <BetweenEmptyNewParentheses>False</BetweenEmptyNewParentheses>
- <BeforeNewParameterComma>False</BeforeNewParameterComma>
- <AfterNewParameterComma>True</AfterNewParameterComma>
- <BeforeTypeOfParentheses>False</BeforeTypeOfParentheses>
- <WithinCheckedExpressionParantheses>False</WithinCheckedExpressionParantheses>
- <ConditionalOperatorBeforeConditionSpace>True</ConditionalOperatorBeforeConditionSpace>
- <ConditionalOperatorAfterConditionSpace>True</ConditionalOperatorAfterConditionSpace>
- <ConditionalOperatorBeforeSeparatorSpace>True</ConditionalOperatorBeforeSeparatorSpace>
- <ConditionalOperatorAfterSeparatorSpace>True</ConditionalOperatorAfterSeparatorSpace>
- <SpacesWithinBrackets>False</SpacesWithinBrackets>
- <SpacesBeforeBrackets>True</SpacesBeforeBrackets>
- <BeforeBracketComma>False</BeforeBracketComma>
- <AfterBracketComma>True</AfterBracketComma>
- <SpacesBeforeForSemicolon>False</SpacesBeforeForSemicolon>
- <SpacesAfterForSemicolon>True</SpacesAfterForSemicolon>
- <SpacesAfterTypecast>False</SpacesAfterTypecast>
- <SpacesBeforeArrayDeclarationBrackets>False</SpacesBeforeArrayDeclarationBrackets>
- <BlankLinesBeforeUsings>0</BlankLinesBeforeUsings>
- <BlankLinesAfterUsings>1</BlankLinesAfterUsings>
- <BlankLinesBeforeFirstDeclaration>0</BlankLinesBeforeFirstDeclaration>
- <BlankLinesBetweenTypes>1</BlankLinesBetweenTypes>
- <BlankLinesBetweenFields>0</BlankLinesBetweenFields>
- <BlankLinesBetweenEventFields>0</BlankLinesBetweenEventFields>
- <BlankLinesBetweenMembers>1</BlankLinesBetweenMembers>
- <BlankLinesInsideRegion>1</BlankLinesInsideRegion>
- <BlankLinesAroundRegion>1</BlankLinesAroundRegion>
- <IndentPreprocessorDirectives>True</IndentPreprocessorDirectives>
- <AlignToFirstIndexerArgument>False</AlignToFirstIndexerArgument>
- <AlignToFirstMethodCallArgument>False</AlignToFirstMethodCallArgument>
- <IndentBlocksInsideExpressions>False</IndentBlocksInsideExpressions>
+ <IndentBlock>True</IndentBlock>
+ <IndentBraces>False</IndentBraces>
+ <IndentSwitchSection>False</IndentSwitchSection>
+ <IndentSwitchCaseSection>True</IndentSwitchCaseSection>
+ <LabelPositioning>OneLess</LabelPositioning>
+ <NewLinesForBracesInTypes>True</NewLinesForBracesInTypes>
+ <NewLinesForBracesInMethods>True</NewLinesForBracesInMethods>
+ <NewLinesForBracesInProperties>False</NewLinesForBracesInProperties>
+ <NewLinesForBracesInAccessors>False</NewLinesForBracesInAccessors>
+ <NewLinesForBracesInAnonymousMethods>False</NewLinesForBracesInAnonymousMethods>
+ <NewLinesForBracesInControlBlocks>False</NewLinesForBracesInControlBlocks>
+ <NewLinesForBracesInAnonymousTypes>False</NewLinesForBracesInAnonymousTypes>
+ <NewLinesForBracesInObjectCollectionArrayInitializers>False</NewLinesForBracesInObjectCollectionArrayInitializers>
+ <NewLinesForBracesInLambdaExpressionBody>False</NewLinesForBracesInLambdaExpressionBody>
+ <NewLineForElse>False</NewLineForElse>
+ <NewLineForCatch>False</NewLineForCatch>
+ <NewLineForFinally>False</NewLineForFinally>
+ <NewLineForMembersInObjectInit>False</NewLineForMembersInObjectInit>
+ <NewLineForMembersInAnonymousTypes>False</NewLineForMembersInAnonymousTypes>
+ <NewLineForClausesInQuery>False</NewLineForClausesInQuery>
+ <SpacingAfterMethodDeclarationName>True</SpacingAfterMethodDeclarationName>
+ <SpaceWithinMethodDeclarationParenthesis>False</SpaceWithinMethodDeclarationParenthesis>
+ <SpaceBetweenEmptyMethodDeclarationParentheses>False</SpaceBetweenEmptyMethodDeclarationParentheses>
+ <SpaceAfterMethodCallName>True</SpaceAfterMethodCallName>
+ <SpaceWithinMethodCallParentheses>False</SpaceWithinMethodCallParentheses>
+ <SpaceBetweenEmptyMethodCallParentheses>False</SpaceBetweenEmptyMethodCallParentheses>
+ <SpaceAfterControlFlowStatementKeyword>True</SpaceAfterControlFlowStatementKeyword>
+ <SpaceWithinExpressionParentheses>False</SpaceWithinExpressionParentheses>
+ <SpaceWithinCastParentheses>False</SpaceWithinCastParentheses>
+ <SpaceWithinOtherParentheses>False</SpaceWithinOtherParentheses>
+ <SpaceAfterCast>False</SpaceAfterCast>
+ <SpacesIgnoreAroundVariableDeclaration>False</SpacesIgnoreAroundVariableDeclaration>
+ <SpaceBeforeOpenSquareBracket>True</SpaceBeforeOpenSquareBracket>
+ <SpaceBetweenEmptySquareBrackets>False</SpaceBetweenEmptySquareBrackets>
+ <SpaceWithinSquareBrackets>False</SpaceWithinSquareBrackets>
+ <SpaceAfterColonInBaseTypeDeclaration>True</SpaceAfterColonInBaseTypeDeclaration>
+ <SpaceAfterComma>True</SpaceAfterComma>
+ <SpaceAfterDot>False</SpaceAfterDot>
+ <SpaceAfterSemicolonsInForStatement>True</SpaceAfterSemicolonsInForStatement>
+ <SpaceBeforeColonInBaseTypeDeclaration>True</SpaceBeforeColonInBaseTypeDeclaration>
+ <SpaceBeforeComma>False</SpaceBeforeComma>
+ <SpaceBeforeDot>False</SpaceBeforeDot>
+ <SpaceBeforeSemicolonsInForStatement>False</SpaceBeforeSemicolonsInForStatement>
+ <SpacingAroundBinaryOperator>Single</SpacingAroundBinaryOperator>
+ <WrappingPreserveSingleLine>True</WrappingPreserveSingleLine>
+ <WrappingKeepStatementsOnSingleLine>True</WrappingKeepStatementsOnSingleLine>
</CSharpFormattingPolicy> \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/SharpDevelopCSharpPolicy.xml b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/SharpDevelopCSharpPolicy.xml
deleted file mode 100644
index 396628950f..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/SharpDevelopCSharpPolicy.xml
+++ /dev/null
@@ -1,164 +0,0 @@
-<!--
-
-SharpDevelopCSharpPolicy.xml
-
-Author:
- Mike Krüger <mkrueger@xamarin.com>
-
-Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
--->
-
-<CSharpFormattingPolicy scope="text/x-csharp" allowDiffSerialize="False">
- <IndentNamespaceBody>True</IndentNamespaceBody>
- <IndentClassBody>True</IndentClassBody>
- <IndentInterfaceBody>True</IndentInterfaceBody>
- <IndentStructBody>True</IndentStructBody>
- <IndentEnumBody>True</IndentEnumBody>
- <IndentMethodBody>True</IndentMethodBody>
- <IndentPropertyBody>True</IndentPropertyBody>
- <IndentEventBody>True</IndentEventBody>
- <IndentBlocks>True</IndentBlocks>
- <IndentSwitchBody>True</IndentSwitchBody>
- <IndentCaseBody>True</IndentCaseBody>
- <IndentBreakStatements>True</IndentBreakStatements>
- <AlignEmbeddedStatements>True</AlignEmbeddedStatements>
- <SimplePropertyFormatting>AllowOneLine</SimplePropertyFormatting>
- <AutoPropertyFormatting>AllowOneLine</AutoPropertyFormatting>
- <NamespaceBraceStyle>NextLine</NamespaceBraceStyle>
- <ClassBraceStyle>NextLine</ClassBraceStyle>
- <InterfaceBraceStyle>NextLine</InterfaceBraceStyle>
- <StructBraceStyle>NextLine</StructBraceStyle>
- <EnumBraceStyle>NextLine</EnumBraceStyle>
- <MethodBraceStyle>NextLine</MethodBraceStyle>
- <AnonymousMethodBraceStyle>EndOfLine</AnonymousMethodBraceStyle>
- <ConstructorBraceStyle>NextLine</ConstructorBraceStyle>
- <DestructorBraceStyle>NextLine</DestructorBraceStyle>
- <PropertyBraceStyle>EndOfLine</PropertyBraceStyle>
- <PropertyGetBraceStyle>EndOfLine</PropertyGetBraceStyle>
- <PropertySetBraceStyle>EndOfLine</PropertySetBraceStyle>
- <SimpleGetBlockFormatting>AllowOneLine</SimpleGetBlockFormatting>
- <SimpleSetBlockFormatting>AllowOneLine</SimpleSetBlockFormatting>
- <EventBraceStyle>EndOfLine</EventBraceStyle>
- <EventAddBraceStyle>EndOfLine</EventAddBraceStyle>
- <EventRemoveBraceStyle>EndOfLine</EventRemoveBraceStyle>
- <AllowEventAddBlockInline>True</AllowEventAddBlockInline>
- <AllowEventRemoveBlockInline>True</AllowEventRemoveBlockInline>
- <StatementBraceStyle>EndOfLine</StatementBraceStyle>
- <AllowIfBlockInline>False</AllowIfBlockInline>
- <ElseNewLinePlacement>SameLine</ElseNewLinePlacement>
- <ElseIfNewLinePlacement>SameLine</ElseIfNewLinePlacement>
- <CatchNewLinePlacement>SameLine</CatchNewLinePlacement>
- <FinallyNewLinePlacement>SameLine</FinallyNewLinePlacement>
- <WhileNewLinePlacement>SameLine</WhileNewLinePlacement>
- <ArrayInitializerWrapping>WrapIfTooLong</ArrayInitializerWrapping>
- <ArrayInitializerBraceStyle>EndOfLine</ArrayInitializerBraceStyle>
- <KeepCommentsAtFirstColumn>True</KeepCommentsAtFirstColumn>
- <BeforeMethodDeclarationParentheses>False</BeforeMethodDeclarationParentheses>
- <BetweenEmptyMethodDeclarationParentheses>False</BetweenEmptyMethodDeclarationParentheses>
- <BeforeMethodDeclarationParameterComma>False</BeforeMethodDeclarationParameterComma>
- <AfterMethodDeclarationParameterComma>True</AfterMethodDeclarationParameterComma>
- <WithinMethodDeclarationParentheses>False</WithinMethodDeclarationParentheses>
- <BeforeMethodCallParentheses>False</BeforeMethodCallParentheses>
- <BetweenEmptyMethodCallParentheses>False</BetweenEmptyMethodCallParentheses>
- <BeforeMethodCallParameterComma>False</BeforeMethodCallParameterComma>
- <AfterMethodCallParameterComma>True</AfterMethodCallParameterComma>
- <WithinMethodCallParentheses>False</WithinMethodCallParentheses>
- <BeforeFieldDeclarationComma>False</BeforeFieldDeclarationComma>
- <AfterFieldDeclarationComma>True</AfterFieldDeclarationComma>
- <BeforeLocalVariableDeclarationComma>False</BeforeLocalVariableDeclarationComma>
- <AfterLocalVariableDeclarationComma>True</AfterLocalVariableDeclarationComma>
- <BeforeConstructorDeclarationParentheses>False</BeforeConstructorDeclarationParentheses>
- <BetweenEmptyConstructorDeclarationParentheses>False</BetweenEmptyConstructorDeclarationParentheses>
- <BeforeConstructorDeclarationParameterComma>False</BeforeConstructorDeclarationParameterComma>
- <AfterConstructorDeclarationParameterComma>True</AfterConstructorDeclarationParameterComma>
- <WithinConstructorDeclarationParentheses>False</WithinConstructorDeclarationParentheses>
- <NewLineBeforeConstructorInitializerColon>NewLine</NewLineBeforeConstructorInitializerColon>
- <NewLineAfterConstructorInitializerColon>SameLine</NewLineAfterConstructorInitializerColon>
- <BeforeIndexerDeclarationBracket>True</BeforeIndexerDeclarationBracket>
- <WithinIndexerDeclarationBracket>False</WithinIndexerDeclarationBracket>
- <BeforeIndexerDeclarationParameterComma>False</BeforeIndexerDeclarationParameterComma>
- <AfterIndexerDeclarationParameterComma>True</AfterIndexerDeclarationParameterComma>
- <BeforeDelegateDeclarationParentheses>False</BeforeDelegateDeclarationParentheses>
- <BetweenEmptyDelegateDeclarationParentheses>False</BetweenEmptyDelegateDeclarationParentheses>
- <BeforeDelegateDeclarationParameterComma>False</BeforeDelegateDeclarationParameterComma>
- <AfterDelegateDeclarationParameterComma>False</AfterDelegateDeclarationParameterComma>
- <WithinDelegateDeclarationParentheses>False</WithinDelegateDeclarationParentheses>
- <NewParentheses>False</NewParentheses>
- <IfParentheses>True</IfParentheses>
- <WhileParentheses>True</WhileParentheses>
- <ForParentheses>True</ForParentheses>
- <ForeachParentheses>True</ForeachParentheses>
- <CatchParentheses>True</CatchParentheses>
- <SwitchParentheses>True</SwitchParentheses>
- <LockParentheses>True</LockParentheses>
- <UsingParentheses>True</UsingParentheses>
- <AroundAssignmentParentheses>True</AroundAssignmentParentheses>
- <AroundLogicalOperatorParentheses>True</AroundLogicalOperatorParentheses>
- <AroundEqualityOperatorParentheses>True</AroundEqualityOperatorParentheses>
- <AroundRelationalOperatorParentheses>True</AroundRelationalOperatorParentheses>
- <AroundBitwiseOperatorParentheses>True</AroundBitwiseOperatorParentheses>
- <AroundAdditiveOperatorParentheses>True</AroundAdditiveOperatorParentheses>
- <AroundMultiplicativeOperatorParentheses>True</AroundMultiplicativeOperatorParentheses>
- <AroundShiftOperatorParentheses>True</AroundShiftOperatorParentheses>
- <AroundNullCoalescingOperator>True</AroundNullCoalescingOperator>
- <WithinParentheses>False</WithinParentheses>
- <WithinIfParentheses>False</WithinIfParentheses>
- <WithinWhileParentheses>False</WithinWhileParentheses>
- <WithinForParentheses>False</WithinForParentheses>
- <WithinForEachParentheses>False</WithinForEachParentheses>
- <WithinCatchParentheses>False</WithinCatchParentheses>
- <WithinSwitchParentheses>False</WithinSwitchParentheses>
- <WithinLockParentheses>False</WithinLockParentheses>
- <WithinUsingParentheses>False</WithinUsingParentheses>
- <WithinCastParentheses>False</WithinCastParentheses>
- <WithinSizeOfParentheses>False</WithinSizeOfParentheses>
- <BeforeSizeOfParentheses>False</BeforeSizeOfParentheses>
- <WithinTypeOfParentheses>False</WithinTypeOfParentheses>
- <WithinNewParentheses>False</WithinNewParentheses>
- <BetweenEmptyNewParentheses>False</BetweenEmptyNewParentheses>
- <BeforeNewParameterComma>False</BeforeNewParameterComma>
- <AfterNewParameterComma>True</AfterNewParameterComma>
- <BeforeTypeOfParentheses>False</BeforeTypeOfParentheses>
- <WithinCheckedExpressionParantheses>False</WithinCheckedExpressionParantheses>
- <ConditionalOperatorBeforeConditionSpace>True</ConditionalOperatorBeforeConditionSpace>
- <ConditionalOperatorAfterConditionSpace>True</ConditionalOperatorAfterConditionSpace>
- <ConditionalOperatorBeforeSeparatorSpace>True</ConditionalOperatorBeforeSeparatorSpace>
- <ConditionalOperatorAfterSeparatorSpace>True</ConditionalOperatorAfterSeparatorSpace>
- <SpacesWithinBrackets>False</SpacesWithinBrackets>
- <SpacesBeforeBrackets>False</SpacesBeforeBrackets>
- <BeforeBracketComma>False</BeforeBracketComma>
- <AfterBracketComma>True</AfterBracketComma>
- <SpacesBeforeForSemicolon>False</SpacesBeforeForSemicolon>
- <SpacesAfterForSemicolon>True</SpacesAfterForSemicolon>
- <SpacesAfterTypecast>False</SpacesAfterTypecast>
- <SpacesBeforeArrayDeclarationBrackets>False</SpacesBeforeArrayDeclarationBrackets>
- <BlankLinesBeforeUsings>0</BlankLinesBeforeUsings>
- <BlankLinesAfterUsings>1</BlankLinesAfterUsings>
- <BlankLinesBeforeFirstDeclaration>0</BlankLinesBeforeFirstDeclaration>
- <BlankLinesBetweenTypes>1</BlankLinesBetweenTypes>
- <BlankLinesBetweenFields>0</BlankLinesBetweenFields>
- <BlankLinesBetweenEventFields>0</BlankLinesBetweenEventFields>
- <BlankLinesBetweenMembers>1</BlankLinesBetweenMembers>
- <BlankLinesInsideRegion>1</BlankLinesInsideRegion>
- <BlankLinesAroundRegion>1</BlankLinesAroundRegion>
- <IndentPreprocessorDirectives>True</IndentPreprocessorDirectives>
- <IndentBlocksInsideExpressions>False</IndentBlocksInsideExpressions>
-</CSharpFormattingPolicy> \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/WhitesmithsCSharpPolicy.xml b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/WhitesmithsCSharpPolicy.xml
deleted file mode 100644
index f4ed3e864e..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/policies/WhitesmithsCSharpPolicy.xml
+++ /dev/null
@@ -1,164 +0,0 @@
-<!--
-
-WhitesmithsCSharpPolicy.xml
-
-Author:
- Mike Krüger <mkrueger@xamarin.com>
-
-Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
--->
-
-<CSharpFormattingPolicy scope="text/x-csharp" allowDiffSerialize="False">
- <IndentNamespaceBody>True</IndentNamespaceBody>
- <IndentClassBody>True</IndentClassBody>
- <IndentInterfaceBody>True</IndentInterfaceBody>
- <IndentStructBody>True</IndentStructBody>
- <IndentEnumBody>True</IndentEnumBody>
- <IndentMethodBody>True</IndentMethodBody>
- <IndentPropertyBody>True</IndentPropertyBody>
- <IndentEventBody>True</IndentEventBody>
- <IndentBlocks>True</IndentBlocks>
- <IndentSwitchBody>True</IndentSwitchBody>
- <IndentCaseBody>True</IndentCaseBody>
- <IndentBreakStatements>True</IndentBreakStatements>
- <AlignEmbeddedStatements>True</AlignEmbeddedStatements>
- <SimplePropertyFormatting>AllowOneLine</SimplePropertyFormatting>
- <AutoPropertyFormatting>AllowOneLine</AutoPropertyFormatting>
- <NamespaceBraceStyle>NextLineShifted</NamespaceBraceStyle>
- <ClassBraceStyle>NextLineShifted</ClassBraceStyle>
- <InterfaceBraceStyle>NextLineShifted</InterfaceBraceStyle>
- <StructBraceStyle>NextLineShifted</StructBraceStyle>
- <EnumBraceStyle>NextLineShifted</EnumBraceStyle>
- <MethodBraceStyle>NextLineShifted</MethodBraceStyle>
- <AnonymousMethodBraceStyle>NextLineShifted</AnonymousMethodBraceStyle>
- <ConstructorBraceStyle>NextLineShifted</ConstructorBraceStyle>
- <DestructorBraceStyle>NextLineShifted</DestructorBraceStyle>
- <PropertyBraceStyle>NextLineShifted</PropertyBraceStyle>
- <PropertyGetBraceStyle>NextLineShifted</PropertyGetBraceStyle>
- <PropertySetBraceStyle>NextLineShifted</PropertySetBraceStyle>
- <SimpleGetBlockFormatting>AllowOneLine</SimpleGetBlockFormatting>
- <SimpleSetBlockFormatting>AllowOneLine</SimpleSetBlockFormatting>
- <EventBraceStyle>NextLineShifted</EventBraceStyle>
- <EventAddBraceStyle>NextLineShifted</EventAddBraceStyle>
- <EventRemoveBraceStyle>NextLineShifted</EventRemoveBraceStyle>
- <AllowEventAddBlockInline>True</AllowEventAddBlockInline>
- <AllowEventRemoveBlockInline>True</AllowEventRemoveBlockInline>
- <StatementBraceStyle>NextLineShifted</StatementBraceStyle>
- <AllowIfBlockInline>False</AllowIfBlockInline>
- <ElseNewLinePlacement>SameLine</ElseNewLinePlacement>
- <ElseIfNewLinePlacement>SameLine</ElseIfNewLinePlacement>
- <CatchNewLinePlacement>SameLine</CatchNewLinePlacement>
- <FinallyNewLinePlacement>SameLine</FinallyNewLinePlacement>
- <WhileNewLinePlacement>SameLine</WhileNewLinePlacement>
- <ArrayInitializerWrapping>WrapIfTooLong</ArrayInitializerWrapping>
- <ArrayInitializerBraceStyle>EndOfLine</ArrayInitializerBraceStyle>
- <KeepCommentsAtFirstColumn>True</KeepCommentsAtFirstColumn>
- <BeforeMethodDeclarationParentheses>False</BeforeMethodDeclarationParentheses>
- <BetweenEmptyMethodDeclarationParentheses>False</BetweenEmptyMethodDeclarationParentheses>
- <BeforeMethodDeclarationParameterComma>False</BeforeMethodDeclarationParameterComma>
- <AfterMethodDeclarationParameterComma>True</AfterMethodDeclarationParameterComma>
- <WithinMethodDeclarationParentheses>False</WithinMethodDeclarationParentheses>
- <BeforeMethodCallParentheses>False</BeforeMethodCallParentheses>
- <BetweenEmptyMethodCallParentheses>False</BetweenEmptyMethodCallParentheses>
- <BeforeMethodCallParameterComma>False</BeforeMethodCallParameterComma>
- <AfterMethodCallParameterComma>True</AfterMethodCallParameterComma>
- <WithinMethodCallParentheses>False</WithinMethodCallParentheses>
- <BeforeFieldDeclarationComma>False</BeforeFieldDeclarationComma>
- <AfterFieldDeclarationComma>True</AfterFieldDeclarationComma>
- <BeforeLocalVariableDeclarationComma>False</BeforeLocalVariableDeclarationComma>
- <AfterLocalVariableDeclarationComma>True</AfterLocalVariableDeclarationComma>
- <BeforeConstructorDeclarationParentheses>False</BeforeConstructorDeclarationParentheses>
- <BetweenEmptyConstructorDeclarationParentheses>False</BetweenEmptyConstructorDeclarationParentheses>
- <BeforeConstructorDeclarationParameterComma>False</BeforeConstructorDeclarationParameterComma>
- <AfterConstructorDeclarationParameterComma>True</AfterConstructorDeclarationParameterComma>
- <WithinConstructorDeclarationParentheses>False</WithinConstructorDeclarationParentheses>
- <NewLineBeforeConstructorInitializerColon>NewLine</NewLineBeforeConstructorInitializerColon>
- <NewLineAfterConstructorInitializerColon>SameLine</NewLineAfterConstructorInitializerColon>
- <BeforeIndexerDeclarationBracket>True</BeforeIndexerDeclarationBracket>
- <WithinIndexerDeclarationBracket>False</WithinIndexerDeclarationBracket>
- <BeforeIndexerDeclarationParameterComma>False</BeforeIndexerDeclarationParameterComma>
- <AfterIndexerDeclarationParameterComma>True</AfterIndexerDeclarationParameterComma>
- <BeforeDelegateDeclarationParentheses>False</BeforeDelegateDeclarationParentheses>
- <BetweenEmptyDelegateDeclarationParentheses>False</BetweenEmptyDelegateDeclarationParentheses>
- <BeforeDelegateDeclarationParameterComma>False</BeforeDelegateDeclarationParameterComma>
- <AfterDelegateDeclarationParameterComma>False</AfterDelegateDeclarationParameterComma>
- <WithinDelegateDeclarationParentheses>False</WithinDelegateDeclarationParentheses>
- <NewParentheses>False</NewParentheses>
- <IfParentheses>True</IfParentheses>
- <WhileParentheses>True</WhileParentheses>
- <ForParentheses>True</ForParentheses>
- <ForeachParentheses>True</ForeachParentheses>
- <CatchParentheses>True</CatchParentheses>
- <SwitchParentheses>True</SwitchParentheses>
- <LockParentheses>True</LockParentheses>
- <UsingParentheses>True</UsingParentheses>
- <AroundAssignmentParentheses>True</AroundAssignmentParentheses>
- <AroundLogicalOperatorParentheses>True</AroundLogicalOperatorParentheses>
- <AroundEqualityOperatorParentheses>True</AroundEqualityOperatorParentheses>
- <AroundRelationalOperatorParentheses>True</AroundRelationalOperatorParentheses>
- <AroundBitwiseOperatorParentheses>True</AroundBitwiseOperatorParentheses>
- <AroundAdditiveOperatorParentheses>True</AroundAdditiveOperatorParentheses>
- <AroundMultiplicativeOperatorParentheses>True</AroundMultiplicativeOperatorParentheses>
- <AroundShiftOperatorParentheses>True</AroundShiftOperatorParentheses>
- <AroundNullCoalescingOperator>True</AroundNullCoalescingOperator>
- <WithinParentheses>False</WithinParentheses>
- <WithinIfParentheses>False</WithinIfParentheses>
- <WithinWhileParentheses>False</WithinWhileParentheses>
- <WithinForParentheses>False</WithinForParentheses>
- <WithinForEachParentheses>False</WithinForEachParentheses>
- <WithinCatchParentheses>False</WithinCatchParentheses>
- <WithinSwitchParentheses>False</WithinSwitchParentheses>
- <WithinLockParentheses>False</WithinLockParentheses>
- <WithinUsingParentheses>False</WithinUsingParentheses>
- <WithinCastParentheses>False</WithinCastParentheses>
- <WithinSizeOfParentheses>False</WithinSizeOfParentheses>
- <BeforeSizeOfParentheses>False</BeforeSizeOfParentheses>
- <WithinTypeOfParentheses>False</WithinTypeOfParentheses>
- <WithinNewParentheses>False</WithinNewParentheses>
- <BetweenEmptyNewParentheses>False</BetweenEmptyNewParentheses>
- <BeforeNewParameterComma>False</BeforeNewParameterComma>
- <AfterNewParameterComma>True</AfterNewParameterComma>
- <BeforeTypeOfParentheses>False</BeforeTypeOfParentheses>
- <WithinCheckedExpressionParantheses>False</WithinCheckedExpressionParantheses>
- <ConditionalOperatorBeforeConditionSpace>True</ConditionalOperatorBeforeConditionSpace>
- <ConditionalOperatorAfterConditionSpace>True</ConditionalOperatorAfterConditionSpace>
- <ConditionalOperatorBeforeSeparatorSpace>True</ConditionalOperatorBeforeSeparatorSpace>
- <ConditionalOperatorAfterSeparatorSpace>True</ConditionalOperatorAfterSeparatorSpace>
- <SpacesWithinBrackets>False</SpacesWithinBrackets>
- <SpacesBeforeBrackets>False</SpacesBeforeBrackets>
- <BeforeBracketComma>False</BeforeBracketComma>
- <AfterBracketComma>True</AfterBracketComma>
- <SpacesBeforeForSemicolon>False</SpacesBeforeForSemicolon>
- <SpacesAfterForSemicolon>True</SpacesAfterForSemicolon>
- <SpacesAfterTypecast>False</SpacesAfterTypecast>
- <SpacesBeforeArrayDeclarationBrackets>False</SpacesBeforeArrayDeclarationBrackets>
- <BlankLinesBeforeUsings>0</BlankLinesBeforeUsings>
- <BlankLinesAfterUsings>1</BlankLinesAfterUsings>
- <BlankLinesBeforeFirstDeclaration>0</BlankLinesBeforeFirstDeclaration>
- <BlankLinesBetweenTypes>1</BlankLinesBetweenTypes>
- <BlankLinesBetweenFields>0</BlankLinesBetweenFields>
- <BlankLinesBetweenEventFields>0</BlankLinesBetweenEventFields>
- <BlankLinesBetweenMembers>1</BlankLinesBetweenMembers>
- <BlankLinesInsideRegion>1</BlankLinesInsideRegion>
- <BlankLinesAroundRegion>1</BlankLinesAroundRegion>
- <IndentPreprocessorDirectives>True</IndentPreprocessorDirectives>
- <IndentBlocksInsideExpressions>True</IndentBlocksInsideExpressions>
-</CSharpFormattingPolicy> \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/AbstractKeywordHighlighter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/AbstractKeywordHighlighter.cs
new file mode 100644
index 0000000000..72ff5203dc
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/AbstractKeywordHighlighter.cs
@@ -0,0 +1,74 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+namespace Microsoft.CodeAnalysis.Editor.Implementation.Highlighting
+{
+ interface IHighlighter
+ {
+ IEnumerable<TextSpan> GetHighlights (
+ SyntaxNode root, int position, CancellationToken cancellationToken);
+
+ }
+ internal abstract class AbstractKeywordHighlighter<TNode> : IHighlighter
+ where TNode : SyntaxNode
+ {
+ public IEnumerable<TextSpan> GetHighlights(
+ SyntaxNode root, int position, CancellationToken cancellationToken)
+ {
+ foreach (var token in GetTokens(root, position))
+ {
+ for (var parent = token.Parent; parent != null; parent = parent.Parent)
+ {
+ if (parent is TNode)
+ {
+ var highlights = GetHighlights((TNode)parent, cancellationToken);
+
+ // Only return them if any of them matched
+ if (highlights.Any(span => span.IntersectsWith(position)))
+ {
+ // Return the non-empty spans
+ return highlights.Where(s => !s.IsEmpty).Distinct();
+ }
+ }
+ }
+ }
+
+ return SpecializedCollections.EmptyEnumerable<TextSpan>();
+ }
+
+ protected abstract IEnumerable<TextSpan> GetHighlights(TNode node, CancellationToken cancellationToken);
+
+ protected TextSpan EmptySpan(int position)
+ {
+ return new TextSpan(position, 0);
+ }
+
+ internal static IEnumerable<SyntaxToken> GetTokens(
+ SyntaxNode root,
+ int position)
+ {
+ var tokens1 = GetTokens(root, position, findInsideTrivia: true);
+ var tokens2 = GetTokens(root, position, findInsideTrivia: false);
+ return tokens1.Concat(tokens2);
+ }
+
+ private static IEnumerable<SyntaxToken> GetTokens(
+ SyntaxNode root,
+ int position,
+ bool findInsideTrivia)
+ {
+ yield return root.FindToken(position - 0, findInsideTrivia);
+
+ if (position > 0)
+ {
+ yield return root.FindToken(position - 1, findInsideTrivia);
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/CSharpSelectionSurroundingProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/CSharpSelectionSurroundingProvider.cs
index 9b252d0c6e..36e297bd6b 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/CSharpSelectionSurroundingProvider.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/CSharpSelectionSurroundingProvider.cs
@@ -24,78 +24,119 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using Mono.TextEditor;
using MonoDevelop.CSharp.Formatting;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Extension;
namespace MonoDevelop.CSharp.Highlighting
{
- class CSharpSelectionSurroundingProvider : DefaultSelectionSurroundingProvider
+ class CSharpSelectionSurroundingProvider : SelectionSurroundingProvider
{
- MonoDevelop.Ide.Gui.Document document;
+ readonly DocumentContext context;
+ readonly TextEditor editor;
- public CSharpSelectionSurroundingProvider (MonoDevelop.Ide.Gui.Document document)
+ public CSharpSelectionSurroundingProvider (MonoDevelop.Ide.Editor.TextEditor editor, DocumentContext context)
{
- this.document = document;
+ this.editor = editor;
+ this.context = context;
}
- public override bool GetSelectionSurroundings (TextEditorData textEditorData, uint unicodeKey, out string start, out string end)
+ #region SelectionSurroundingProvider implementation
+
+ public override bool GetSelectionSurroundings (uint unicodeKey, out string start, out string end)
{
- if (unicodeKey == '/') {
+ switch ((char)unicodeKey) {
+ case '"':
+ start = editor.SelectionRegion.BeginLine != editor.SelectionRegion.EndLine ? "@\"" : "\"";
+ end = "\"";
+ return true;
+ case '\'':
+ start = end = "'";
+ return true;
+ case '(':
+ start = "(";
+ end = ")";
+ return true;
+ case '<':
+ start = "<";
+ end = ">";
+ return true;
+ case '[':
+ start = "[";
+ end = "]";
+ return true;
+ case '{':
+ start = "{";
+ end = "}";
+ return true;
+ case '/':
start = "/*";
end = "*/";
return true;
+ default:
+ start = end = "";
+ return false;
}
-
- if (unicodeKey == '"') {
- start = textEditorData.MainSelection.Anchor.Line != textEditorData.MainSelection.Lead.Line ? "@\"" : "\"";
- end = "\"";
- return true;
- }
- return base.GetSelectionSurroundings (textEditorData, unicodeKey, out start, out end);
}
- public override void HandleSpecialSelectionKey (TextEditorData textEditorData,uint unicodeKey)
+ public override void HandleSpecialSelectionKey (uint unicodeKey)
{
string start, end;
- GetSelectionSurroundings (textEditorData, unicodeKey, out start, out end);
- var selection = textEditorData.MainSelection;
+ ((SelectionSurroundingProvider)this).GetSelectionSurroundings (unicodeKey, out start, out end);
+
+ if (editor.SelectionMode == SelectionMode.Block) {
+ var selection = editor.SelectionRegion;
+ int startCol = System.Math.Min (selection.Begin.Column, selection.End.Column) - 1;
+ int endCol = System.Math.Max (selection.Begin.Column, selection.End.Column);
+
+ int minLine = System.Math.Min (selection.Begin.Line, selection.End.Line);
+ int maxLine = System.Math.Max (selection.BeginLine, selection.End.Line);
- if (textEditorData.MainSelection.SelectionMode == SelectionMode.Block) {
- int startCol = System.Math.Min (selection.Anchor.Column, selection.Lead.Column) - 1;
- int endCol = System.Math.Max (selection.Anchor.Column, selection.Lead.Column);
- for (int lineNumber = selection.MinLine; lineNumber <= selection.MaxLine; lineNumber++) {
- DocumentLine lineSegment = textEditorData.GetLine (lineNumber);
+
+ for (int lineNumber = minLine; lineNumber <= maxLine; lineNumber++) {
+ var lineSegment = editor.GetLine (lineNumber);
if (lineSegment.Offset + startCol < lineSegment.EndOffset)
- textEditorData.Insert (lineSegment.Offset + startCol, start);
+ editor.InsertText (lineSegment.Offset + startCol, start);
if (lineSegment.Offset + endCol < lineSegment.EndOffset)
- textEditorData.Insert (lineSegment.Offset + endCol, end);
+ editor.InsertText (lineSegment.Offset + endCol, end);
}
- textEditorData.MainSelection = new Selection (
- new DocumentLocation (selection.Anchor.Line, endCol == selection.Anchor.Column ? endCol + start.Length : startCol + 1 + start.Length),
- new DocumentLocation (selection.Lead.Line, endCol == selection.Anchor.Column ? startCol + 1 + start.Length : endCol + start.Length),
- Mono.TextEditor.SelectionMode.Block);
- textEditorData.Document.CommitMultipleLineUpdate (textEditorData.MainSelection.MinLine, textEditorData.MainSelection.MaxLine);
+// textEditorData.MainSelection = new Selection (
+// new DocumentLocation (selection.Anchor.Line, endCol == selection.Anchor.Column ? endCol + start.Length : startCol + 1 + start.Length),
+// new DocumentLocation (selection.Lead.Line, endCol == selection.Anchor.Column ? startCol + 1 + start.Length : endCol + start.Length),
+// Mono.TextEditor.SelectionMode.Block);
} else {
- int anchorOffset = selection.GetAnchorOffset (textEditorData);
- int leadOffset = selection.GetLeadOffset (textEditorData);
- if (leadOffset < anchorOffset) {
- int tmp = anchorOffset;
- anchorOffset = leadOffset;
- leadOffset = tmp;
- }
- textEditorData.Insert (anchorOffset, start);
- textEditorData.Insert (leadOffset >= anchorOffset ? leadOffset + start.Length : leadOffset, end);
- // textEditorData.SetSelection (anchorOffset + start.Length, leadOffset + start.Length);
- if (CSharpTextEditorIndentation.OnTheFlyFormatting) {
- var l1 = textEditorData.GetLineByOffset (anchorOffset);
- var l2 = textEditorData.GetLineByOffset (leadOffset);
- OnTheFlyFormatter.Format (document, l1.Offset, l2.EndOffsetIncludingDelimiter);
+ var selectionRange = editor.SelectionRange;
+ int anchorOffset = selectionRange.Offset;
+ int leadOffset = selectionRange.EndOffset;
+ var text = editor.GetTextAt (selectionRange);
+ if (editor.Options.GenerateFormattingUndoStep) {
+ using (var undo = editor.OpenUndoGroup ()) {
+ editor.ReplaceText (selectionRange, start);
+ }
+ using (var undo = editor.OpenUndoGroup ()) {
+ editor.ReplaceText (anchorOffset, 1, start + text + end);
+ editor.SetSelection (anchorOffset + start.Length, leadOffset + start.Length + end.Length);
+ }
+ if (unicodeKey == '{') {
+ using (var undo = editor.OpenUndoGroup ()) {
+ OnTheFlyFormatter.Format (editor, context, anchorOffset + start.Length - 1, leadOffset + start.Length + end.Length);
+ }
+ }
+ } else {
+ using (var undo = editor.OpenUndoGroup ()) {
+ editor.InsertText (anchorOffset, start);
+ editor.InsertText (leadOffset >= anchorOffset ? leadOffset + start.Length : leadOffset, end);
+ if (unicodeKey == '{') {
+ OnTheFlyFormatter.Format (editor, context, anchorOffset + start.Length, leadOffset + start.Length + end.Length);
+ } else {
+ editor.SetSelection (anchorOffset + start.Length, leadOffset + start.Length + end.Length);
+ }
+ }
}
}
}
-
+ #endregion
}
-}
-
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs
index 968f5db7f7..d1633673de 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/CSharpSyntaxMode.cs
@@ -28,30 +28,17 @@
using System;
using System.Linq;
-using System.Collections.Generic;
-using Mono.TextEditor.Highlighting;
-using Mono.TextEditor;
-using System.Xml;
-using MonoDevelop.Projects;
-using MonoDevelop.CSharp.Project;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide;
-using MonoDevelop.Ide.Tasks;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.TypeSystem;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp.Analysis;
+using Microsoft.CodeAnalysis.Text;
using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using ICSharpCode.NRefactory.Semantics;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
-using MonoDevelop.SourceEditor.QuickTasks;
using System.Threading;
-using System.Diagnostics;
-using MonoDevelop.Core;
-using ICSharpCode.NRefactory.CSharp.Analysis;
-using ICSharpCode.NRefactory;
-using MonoDevelop.Refactoring;
-using ICSharpCode.NRefactory.Refactoring;
-
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Highlighting;
+using MonoDevelop.Core.Text;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CSharp;
namespace MonoDevelop.CSharp.Highlighting
{
@@ -68,611 +55,184 @@ namespace MonoDevelop.CSharp.Highlighting
return true;
}
}
-
- class CSharpSyntaxMode : SyntaxMode, IQuickTaskProvider, IDisposable
- {
- readonly Document guiDocument;
-
- CSharpAstResolver resolver;
- CancellationTokenSource src;
- public bool SemanticHighlightingEnabled {
- get {
- return true;
- }
- }
+ class CSharpSyntaxMode : SemanticHighlighting
+ {
+ HighlightingSegmentTree highlightTree;
+ CancellationTokenSource src = new CancellationTokenSource ();
- internal class StyledTreeSegment : TreeSegment
+ public CSharpSyntaxMode (TextEditor editor, DocumentContext documentContext) : base (editor, documentContext)
{
- public string Style {
- get;
- private set;
- }
-
- public StyledTreeSegment (int offset, int length, string style) : base (offset, length)
- {
- Style = style;
- }
+ DocumentParsed ();
}
-
- class HighlightingSegmentTree : SegmentTree<StyledTreeSegment>
- {
- public bool GetStyle (Chunk chunk, ref int endOffset, out string style)
- {
- var segment = GetSegmentsAt (chunk.Offset).FirstOrDefault ();
- if (segment == null) {
- style = null;
- return false;
- }
- endOffset = segment.EndOffset;
- style = segment.Style;
- return true;
- }
-
- public void AddStyle (int startOffset, int endOffset, string style)
- {
- if (IsDirty)
- return;
- Add (new StyledTreeSegment (startOffset, endOffset - startOffset, style));
- }
- }
-
- Dictionary<DocumentLine, HighlightingVisitior> lineSegments = new Dictionary<DocumentLine, HighlightingVisitior> ();
- public bool DisableConditionalHighlighting {
- get;
- set;
- }
+ #region implemented abstract members of SemanticHighlighting
- public static IEnumerable<string> GetDefinedSymbols (MonoDevelop.Projects.Project project)
+ protected override void DocumentParsed ()
{
- var workspace = IdeApp.Workspace;
- if (workspace == null || project == null)
- yield break;
- var configuration = project.GetConfiguration (workspace.ActiveConfiguration) as DotNetProjectConfiguration;
- if (configuration != null) {
- foreach (string s in configuration.GetDefineSymbols ())
- yield return s;
- // Workaround for mcs defined symbol
- if (configuration.TargetRuntime.RuntimeId == "Mono")
- yield return "__MonoCS__";
- }
- }
-
- void HandleDocumentParsed (object sender, EventArgs e)
- {
- if (src != null)
- src.Cancel ();
- resolver = null;
- if (guiDocument.IsProjectContextInUpdate) {
+ var parsedDocument = documentContext.ParsedDocument;
+ if (parsedDocument == null)
return;
- }
- if (guiDocument != null && SemanticHighlightingEnabled) {
- var parsedDocument = guiDocument.ParsedDocument;
- if (parsedDocument != null) {
- if (guiDocument.Project != null && guiDocument.IsCompileableInProject) {
- src = new CancellationTokenSource ();
- var newResolverTask = guiDocument.GetSharedResolver ();
- var cancellationToken = src.Token;
- System.Threading.Tasks.Task.Factory.StartNew (delegate {
- if (newResolverTask == null)
- return;
- var newResolver = newResolverTask.Result;
- if (newResolver == null)
- return;
- var visitor = new QuickTaskVisitor (newResolver, cancellationToken);
- try {
- newResolver.RootNode.AcceptVisitor (visitor);
- } catch (Exception ex) {
- LoggingService.LogError ("Error while analyzing the file for the semantic highlighting.", ex);
- return;
- }
- if (!cancellationToken.IsCancellationRequested) {
- Gtk.Application.Invoke (delegate {
- if (cancellationToken.IsCancellationRequested)
- return;
- var editorData = guiDocument.Editor;
- if (editorData == null)
- return;
-// compilation = newResolver.Compilation;
- resolver = newResolver;
- quickTasks = visitor.QuickTasks;
- OnTasksUpdated (EventArgs.Empty);
- foreach (var kv in lineSegments) {
- try {
- kv.Value.tree.RemoveListener ();
- } catch (Exception) {
- }
- }
- lineSegments.Clear ();
- var textEditor = editorData.Parent;
- if (textEditor != null) {
- if (!parsedDocument.HasErrors) {
- var margin = textEditor.TextViewMargin;
- margin.PurgeLayoutCache ();
- textEditor.QueueDraw ();
- }
- }
- });
- }
- }, cancellationToken);
- }
- }
- }
- }
-
- class HighlightingVisitior : SemanticHighlightingVisitor<string>
- {
- readonly int lineNumber;
- readonly int lineOffset;
- readonly int lineLength;
- internal HighlightingSegmentTree tree = new HighlightingSegmentTree ();
-
- public HighlightingVisitior (CSharpAstResolver resolver, CancellationToken cancellationToken, int lineNumber, int lineOffset, int lineLength)
- {
- if (resolver == null)
- throw new ArgumentNullException ("resolver");
- this.resolver = resolver;
- this.cancellationToken = cancellationToken;
- this.lineNumber = lineNumber;
- this.lineOffset = lineOffset;
- this.lineLength = lineLength;
- regionStart = new TextLocation (lineNumber, 1);
- regionEnd = new TextLocation (lineNumber, lineLength);
-
- Setup ();
- }
-
- void Setup ()
- {
- defaultTextColor = "Plain Text";
- referenceTypeColor = "User Types";
- valueTypeColor = "User Types(Value types)";
- interfaceTypeColor = "User Types(Interfaces)";
- enumerationTypeColor = "User Types(Enums)";
- typeParameterTypeColor = "User Types(Type parameters)";
- delegateTypeColor = "User Types(Delegates)";
-
- methodCallColor = "User Method Usage";
- methodDeclarationColor = "User Method Declaration";
-
- eventDeclarationColor = "User Event Declaration";
- eventAccessColor = "User Event Usage";
-
- fieldDeclarationColor ="User Field Declaration";
- fieldAccessColor = "User Field Usage";
-
- propertyDeclarationColor = "User Property Declaration";
- propertyAccessColor = "User Property Usage";
-
- variableDeclarationColor = "User Variable Declaration";
- variableAccessColor = "User Variable Usage";
-
- parameterDeclarationColor = "User Parameter Declaration";
- parameterAccessColor = "User Parameter Usage";
-
- valueKeywordColor = "Keyword(Context)";
- externAliasKeywordColor = "Keyword(Namespace)";
- varKeywordTypeColor = "Keyword(Type)";
+ var resolver = parsedDocument.GetAst<SemanticModel> ();
+ if (resolver == null)
+ return;
+ CancelHighlightingTask ();
+ var token = src.Token;
- parameterModifierColor = "Keyword(Parameter)";
- inactiveCodeColor = "Excluded Code";
- syntaxErrorColor = "Syntax Error";
+ Task.Run (async delegate {
+ try {
+ var root = await resolver.SyntaxTree.GetRootAsync (token);
+ var newTree = new HighlightingSegmentTree ();
- stringFormatItemColor = "String Format Items";
- }
-
- protected override void Colorize(TextLocation start, TextLocation end, string color)
- {
- int startOffset;
- if (start.Line == lineNumber) {
- startOffset = lineOffset + start.Column - 1;
- } else {
- if (start.Line > lineNumber)
- return;
- startOffset = lineOffset;
- }
- int endOffset;
- if (end.Line == lineNumber) {
- endOffset = lineOffset +end.Column - 1;
- } else {
- if (end.Line < lineNumber)
- return;
- endOffset = lineOffset + lineLength;
- }
- tree.AddStyle (startOffset, endOffset, color);
- }
+ var visitor = new HighlightingVisitior (resolver, newTree.Add, token, TextSegment.FromBounds(0, root.FullSpan.Length));
+ visitor.Visit (root);
- public override void VisitSimpleType (SimpleType simpleType)
- {
- var identifierToken = simpleType.IdentifierToken;
- VisitChildrenUntil(simpleType, identifierToken);
- var resolveResult = resolver.Resolve (simpleType, cancellationToken);
- if (resolveResult.Type.Namespace == "System") {
- switch (resolveResult.Type.Name) {
- case "nfloat":
- case "nint":
- case "nuint":
- Colorize(identifierToken, "Keyword(Type)");
- break;
- default:
- Colorize (identifierToken, resolveResult);
- break;
+ if (!token.IsCancellationRequested) {
+ Gtk.Application.Invoke (delegate {
+ if (token.IsCancellationRequested)
+ return;
+ if (highlightTree != null) {
+ highlightTree.RemoveListener ();
+ }
+ highlightTree = newTree;
+ highlightTree.InstallListener (editor);
+ NotifySemanticHighlightingUpdate ();
+ });
}
- } else {
- Colorize (identifierToken, resolveResult);
- }
- VisitChildrenAfter(simpleType, identifierToken);
- }
-
- public override void VisitIdentifierExpression (IdentifierExpression identifierExpression)
- {
- var identifier = identifierExpression.IdentifierToken;
- VisitChildrenUntil(identifierExpression, identifier);
- if (isInAccessorContainingValueParameter && identifierExpression.Identifier == "value") {
- Colorize(identifier, valueKeywordColor);
- } else {
- var resolveResult = resolver.Resolve (identifierExpression, cancellationToken);
- Colorize (identifier, resolveResult);
+ } catch (OperationCanceledException) {
+ } catch (AggregateException ae) {
+ ae.Flatten ().Handle (x => x is OperationCanceledException);
}
- VisitChildrenAfter(identifierExpression, identifier);
- }
+ }, token);
}
- class QuickTaskVisitor : DepthFirstAstVisitor
+ void CancelHighlightingTask ()
{
- internal List<QuickTask> QuickTasks = new List<QuickTask> ();
- readonly CSharpAstResolver resolver;
- readonly CancellationToken cancellationToken;
-
- public QuickTaskVisitor (CSharpAstResolver resolver, CancellationToken cancellationToken)
- {
- this.resolver = resolver;
- this.cancellationToken = cancellationToken;
- }
-
- protected override void VisitChildren (AstNode node)
- {
- if (cancellationToken.IsCancellationRequested)
- return;
- base.VisitChildren (node);
- }
-
- public override void VisitIdentifierExpression (IdentifierExpression identifierExpression)
- {
- base.VisitIdentifierExpression (identifierExpression);
- var result = resolver.Resolve (identifierExpression, cancellationToken);
- if (result.IsError) {
- QuickTasks.Add (new QuickTask (() => string.Format ("error CS0103: The name `{0}' does not exist in the current context", identifierExpression.Identifier), identifierExpression.StartLocation, Severity.Error));
- }
- }
-
- public override void VisitMemberReferenceExpression (MemberReferenceExpression memberReferenceExpression)
- {
- base.VisitMemberReferenceExpression (memberReferenceExpression);
- var result = resolver.Resolve (memberReferenceExpression, cancellationToken) as UnknownMemberResolveResult;
- if (result != null && result.TargetType.Kind != TypeKind.Unknown) {
- QuickTasks.Add (new QuickTask (string.Format ("error CS0117: `{0}' does not contain a definition for `{1}'", result.TargetType.FullName, memberReferenceExpression.MemberName), memberReferenceExpression.MemberNameToken.StartLocation, Severity.Error));
- }
- }
-
- public override void VisitSimpleType (SimpleType simpleType)
- {
- base.VisitSimpleType (simpleType);
- var result = resolver.Resolve (simpleType, cancellationToken);
- if (result.IsError) {
- QuickTasks.Add (new QuickTask (string.Format ("error CS0246: The type or namespace name `{0}' could not be found. Are you missing an assembly reference?", simpleType.Identifier), simpleType.StartLocation, Severity.Error));
- }
- }
-
- public override void VisitMemberType (MemberType memberType)
- {
- base.VisitMemberType (memberType);
- var result = resolver.Resolve (memberType, cancellationToken);
- if (result.IsError) {
- QuickTasks.Add (new QuickTask (string.Format ("error CS0246: The type or namespace name `{0}' could not be found. Are you missing an assembly reference?", memberType.MemberName), memberType.StartLocation, Severity.Error));
- }
- }
-
- public override void VisitComment (ICSharpCode.NRefactory.CSharp.Comment comment)
- {
- }
+ src.Cancel ();
+ src = new CancellationTokenSource ();
}
-
- static CSharpSyntaxMode ()
+
+ public override IEnumerable<ColoredSegment> GetColoredSegments (ISegment segment)
{
- MonoDevelop.Debugger.DebuggingService.DisableConditionalCompilation += DispatchService.GuiDispatch (new EventHandler<DocumentEventArgs> (OnDisableConditionalCompilation));
- if (IdeApp.Workspace != null) {
- IdeApp.Workspace.ActiveConfigurationChanged += delegate {
- foreach (var doc in IdeApp.Workbench.Documents) {
- TextEditorData data = doc.Editor;
- if (data == null)
- continue;
- // Force syntax mode reparse (required for #if directives)
- var editor = doc.Editor;
- if (editor != null) {
- if (data.Document.SyntaxMode is SyntaxMode) {
- ((SyntaxMode)data.Document.SyntaxMode).UpdateDocumentHighlighting ();
- SyntaxModeService.WaitUpdate (data.Document);
- }
- editor.Parent.TextViewMargin.PurgeLayoutCache ();
- doc.ReparseDocument ();
- editor.Parent.QueueDraw ();
- }
- }
- };
- }
- CommentTag.SpecialCommentTagsChanged += (sender, e) => {
- UpdateCommentRule ();
- var actDoc = IdeApp.Workbench.ActiveDocument;
- if (actDoc != null && actDoc.Editor != null) {
- actDoc.UpdateParseDocument ();
- actDoc.Editor.Parent.TextViewMargin.PurgeLayoutCache ();
- actDoc.Editor.Parent.QueueDraw ();
- }
- };
+ var result = new List<ColoredSegment> ();
+ if (highlightTree == null)
+ return result;
+ return highlightTree.GetSegmentsOverlapping (segment).Select (seg => seg.GetColoredSegment () );
}
-
- static void OnDisableConditionalCompilation (object s, DocumentEventArgs e)
+
+ public override void Dispose ()
{
- var mode = e.Document.Editor.Document.SyntaxMode as CSharpSyntaxMode;
- if (mode == null)
- return;
- mode.DisableConditionalHighlighting = true;
- e.Document.Editor.Document.CommitUpdateAll ();
+ CancelHighlightingTask ();
+ if (highlightTree != null)
+ highlightTree.RemoveListener ();
+ highlightTree = null;
+ base.Dispose ();
}
-
- static Dictionary<string, string> contextualHighlightKeywords;
- static readonly string[] ContextualKeywords = new string[] {
- "value"
-/* "async",
- "await",
- , //*
- "get", "set", "add", "remove", //*
- "var", //*
- "global",
- "partial", //*
- "where", //*
- "select",
- "group",
- "by",
- "into",
- "from",
- "ascending",
- "descending",
- "orderby",
- "let",
- "join",
- "on",
- "equals"*/
- };
-
- #region Syntax mode rule cache
- static List<Rule> _rules;
- static List<Mono.TextEditor.Highlighting.Keywords> _keywords;
- static Span[] _spans;
- static Match[] _matches;
- static Marker[] _prevMarker;
- static List<SemanticRule> _SemanticRules;
- static Rule _commentRule;
- static Dictionary<string, Mono.TextEditor.Highlighting.Keywords> _keywordTable;
- static Dictionary<string, Mono.TextEditor.Highlighting.Keywords> _keywordTableIgnoreCase;
- static Dictionary<string, List<string>> _properties;
+
#endregion
+ }
+
+ class StyledTreeSegment : TreeSegment
+ {
+ string style;
- static void UpdateCommentRule ()
+ public StyledTreeSegment (int offset, int length, string colorStyleKey) : base (offset, length)
{
- if (_commentRule == null)
- return;
- var joinedTasks = string.Join ("", CommentTag.SpecialCommentTags.Select (t => t.Tag));
- _commentRule.SetDelimiter (new string ("&()<>{}[]~!%^*-+=|\\#/:;\"' ,\t.?".Where (c => joinedTasks.IndexOf (c) < 0).ToArray ()));
- _commentRule.Keywords = new[] {
- new Keywords {
- Color = "Comment Tag",
- Words = CommentTag.SpecialCommentTags.Select (t => t.Tag)
- }
- };
+ this.style = colorStyleKey;
}
- public CSharpSyntaxMode (Document document)
+ public ColoredSegment GetColoredSegment ()
{
- this.guiDocument = document;
- guiDocument.DocumentParsed += HandleDocumentParsed;
- if (guiDocument.ParsedDocument != null)
- HandleDocumentParsed (this, EventArgs.Empty);
-
- bool loadRules = _rules == null;
-
- if (loadRules) {
- var provider = new ResourceStreamProvider (typeof(ResourceStreamProvider).Assembly, typeof(ResourceStreamProvider).Assembly.GetManifestResourceNames ().First (s => s.Contains ("CSharpSyntaxMode")));
- using (var reader = provider.Open ()) {
- SyntaxMode baseMode = SyntaxMode.Read (reader);
- _rules = new List<Rule> (baseMode.Rules.Where (r => r.Name != "Comment"));
- _rules.Add (new Rule {
- Name = "PreProcessorComment"
- });
-
- _commentRule = new Rule {
- Name = "Comment",
- IgnoreCase = true
- };
- UpdateCommentRule ();
-
- _rules.Add (_commentRule);
- _keywords = new List<Keywords> (baseMode.Keywords);
- _spans = new List<Span> (baseMode.Spans.Where (span => span.Begin.Pattern != "#")).ToArray ();
- _matches = baseMode.Matches;
- _prevMarker = baseMode.PrevMarker;
- _SemanticRules = new List<SemanticRule> (baseMode.SemanticRules);
- _keywordTable = baseMode.keywordTable;
- _keywordTableIgnoreCase = baseMode.keywordTableIgnoreCase;
- _properties = baseMode.Properties;
- }
-
- contextualHighlightKeywords = new Dictionary<string, string> ();
- foreach (var word in ContextualKeywords) {
- if (_keywordTable.ContainsKey (word)) {
- contextualHighlightKeywords[word] = _keywordTable[word].Color;
- } else {
- Console.WriteLine ("missing keyword:"+word);
- }
- }
-
- foreach (var word in ContextualKeywords) {
- _keywordTable.Remove (word);
- }
- }
-
- rules = _rules;
- keywords = _keywords;
- spans = _spans;
- matches = _matches;
- prevMarker = _prevMarker;
- SemanticRules = _SemanticRules;
- keywordTable = _keywordTable;
- keywordTableIgnoreCase = _keywordTableIgnoreCase;
- properties = _properties;
-
- if (loadRules) {
- AddSemanticRule ("Comment", new HighlightUrlSemanticRule ("Comment(Line)"));
- AddSemanticRule ("XmlDocumentation", new HighlightUrlSemanticRule ("Comment(Doc)"));
- AddSemanticRule ("String", new HighlightUrlSemanticRule ("String"));
- }
+ return new ColoredSegment (Offset, Length, style);
}
+ }
+
+ class HighlightingSegmentTree : SegmentTree<StyledTreeSegment>
+ {
+ }
- #region IDisposable implementation
+ class HighlightingVisitior : SemanticHighlightingVisitor<string>
+ {
+ readonly Action<StyledTreeSegment> colorizeCallback;
- public void Dispose ()
+ public HighlightingVisitior (SemanticModel resolver, Action<StyledTreeSegment> colorizeCallback, CancellationToken cancellationToken, ISegment textSpan) : base (resolver)
{
- if (src != null)
- src.Cancel ();
- guiDocument.DocumentParsed -= HandleDocumentParsed;
+ if (resolver == null)
+ throw new ArgumentNullException (nameof (resolver));
+ this.cancellationToken = cancellationToken;
+ this.colorizeCallback = colorizeCallback;
+ this.region = new TextSpan (textSpan.Offset, textSpan.Length);
+ Setup ();
}
+
+ void Setup ()
+ {
+
+ defaultTextColor = ColorScheme.PlainTextKey;
+ referenceTypeColor = ColorScheme.UserTypesKey;
+ valueTypeColor = ColorScheme.UserTypesValueTypesKey;
+ interfaceTypeColor = ColorScheme.UserTypesInterfacesKey;
+ enumerationTypeColor = ColorScheme.UserTypesEnumsKey;
+ typeParameterTypeColor = ColorScheme.UserTypesTypeParametersKey;
+ delegateTypeColor = ColorScheme.UserTypesDelegatesKey;
- #endregion
+ methodCallColor = ColorScheme.UserMethodUsageKey;
+ methodDeclarationColor = ColorScheme.UserMethodDeclarationKey;
+ eventDeclarationColor = ColorScheme.UserEventDeclarationKey;
+ eventAccessColor = ColorScheme.UserEventUsageKey;
-// public override SpanParser CreateSpanParser (DocumentLine line, CloneableStack<Span> spanStack)
-// {
-// return new CSharpSpanParser (this, spanStack ?? line.StartSpan.Clone ());
-// }
-
- public override ChunkParser CreateChunkParser (SpanParser spanParser, ColorScheme style, DocumentLine line)
- {
- return new CSharpChunkParser (this, spanParser, style, line);
- }
+ fieldDeclarationColor = ColorScheme.UserFieldDeclarationKey;
+ fieldAccessColor = ColorScheme.UserFieldUsageKey;
- protected class CSharpChunkParser : ChunkParser, IResolveVisitorNavigator
- {
+ propertyDeclarationColor = ColorScheme.UserPropertyDeclarationKey;
+ propertyAccessColor = ColorScheme.UserPropertyUsageKey;
- HashSet<string> tags = new HashSet<string> ();
-
- CSharpSyntaxMode csharpSyntaxMode;
- int lineNumber;
- public CSharpChunkParser (CSharpSyntaxMode csharpSyntaxMode, SpanParser spanParser, ColorScheme style, DocumentLine line) : base (csharpSyntaxMode, spanParser, style, line)
- {
- lineNumber = line.LineNumber;
- this.csharpSyntaxMode = csharpSyntaxMode;
- foreach (var tag in CommentTag.SpecialCommentTags) {
- tags.Add (tag.Tag);
- }
+ variableDeclarationColor = ColorScheme.UserVariableDeclarationKey;
+ variableAccessColor = ColorScheme.UserVariableUsageKey;
- }
+ parameterDeclarationColor = ColorScheme.UserParameterDeclarationKey;
+ parameterAccessColor = ColorScheme.UserParameterUsageKey;
- #region IResolveVisitorNavigator implementation
- ResolveVisitorNavigationMode IResolveVisitorNavigator.Scan(AstNode node)
- {
- if (node is SimpleType || node is MemberType
- || node is IdentifierExpression || node is MemberReferenceExpression
- || node is InvocationExpression) {
- return ResolveVisitorNavigationMode.Resolve;
- }
- return ResolveVisitorNavigationMode.Scan;
- }
-
- void IResolveVisitorNavigator.Resolved(AstNode node, ResolveResult result)
- {
- }
-
- void IResolveVisitorNavigator.ProcessConversion(Expression expression, ResolveResult result, Conversion conversion, IType targetType)
- {
- }
- #endregion
- static int TokenLength (AstNode node)
- {
- Debug.Assert (node.StartLocation.Line == node.EndLocation.Line);
- return node.EndLocation.Column - node.StartLocation.Column;
- }
+ valueKeywordColor = ColorScheme.KeywordContextKey;
+ externAliasKeywordColor = ColorScheme.KeywordNamespaceKey;
+ varKeywordTypeColor = ColorScheme.KeywordTypesKey;
- protected override void AddRealChunk (Chunk chunk)
- {
- var document = csharpSyntaxMode.guiDocument;
- var parsedDocument = document != null ? document.ParsedDocument : null;
- if (parsedDocument != null && csharpSyntaxMode.SemanticHighlightingEnabled && csharpSyntaxMode.resolver != null) {
- int endLoc = -1;
- string semanticStyle = null;
- if (spanParser.CurSpan != null && (spanParser.CurSpan.Rule == "Comment" || spanParser.CurSpan.Rule == "PreProcessorComment")) {
- base.AddRealChunk (chunk);
- return;
- }
+ parameterModifierColor = ColorScheme.KeywordParameterKey;
+ inactiveCodeColor = ColorScheme.ExcludedCodeKey;
- try {
- HighlightingVisitior visitor;
- if (!csharpSyntaxMode.lineSegments.TryGetValue (line, out visitor)) {
- var resolver = csharpSyntaxMode.resolver;
- visitor = new HighlightingVisitior (resolver, default (CancellationToken), lineNumber, base.line.Offset, line.Length);
- visitor.tree.InstallListener (doc);
- resolver.RootNode.AcceptVisitor (visitor);
- csharpSyntaxMode.lineSegments[line] = visitor;
- }
- string style;
- if (visitor.tree.GetStyle (chunk, ref endLoc, out style)) {
- semanticStyle = style;
- }
- } catch (Exception e) {
- Console.WriteLine ("Error in semantic highlighting: " + e);
- }
- if (semanticStyle != null) {
- if (endLoc < chunk.EndOffset) {
- base.AddRealChunk (new Chunk (chunk.Offset, endLoc - chunk.Offset, semanticStyle));
- base.AddRealChunk (new Chunk (endLoc, chunk.EndOffset - endLoc, chunk.Style));
- return;
- }
- chunk.Style = semanticStyle;
- }
- }
-
- base.AddRealChunk (chunk);
- }
-
- protected override string GetStyle (Chunk chunk)
- {
- if (spanParser.CurRule.Name == "Comment") {
- if (tags.Contains (doc.GetTextAt (chunk)))
- return "Comment Tag";
- }
- return base.GetStyle (chunk);
- }
- }
-
+ stringFormatItemColor = ColorScheme.StringFormatItemsKey;
+ nameofKeywordColor = ColorScheme.KeywordOtherKey;
+ whenKeywordColor = ColorScheme.KeywordOtherKey;
- #region IQuickTaskProvider implementation
- public event EventHandler TasksUpdated;
+ stringRegexCharacterClass = ColorScheme.RegexCharacterClassKey;
+ stringRegexGroupingConstructs = ColorScheme.RegexGroupingConstructsKey;
+ stringRegexSetConstructs = ColorScheme.RegexSetConstructsKey;
+ stringRegexErrors = ColorScheme.SyntaxErrorKey;
+ stringRegexComments = ColorScheme.CommentsSingleLineKey;
+ stringRegexEscapeCharacter = ColorScheme.RegexEscapeCharacterKey;
+ stringRegexAltEscapeCharacter = ColorScheme.RegexAltEscapeCharacterKey;
+ }
- protected virtual void OnTasksUpdated (EventArgs e)
+ protected override void Colorize (TextSpan span, string color)
{
- var handler = TasksUpdated;
- if (handler != null)
- handler (this, e);
+ colorizeCallback (new StyledTreeSegment (span.Start, span.Length, color));
}
- List<QuickTask> quickTasks;
- public IEnumerable<QuickTask> QuickTasks {
- get {
- return quickTasks;
+ public override void VisitIdentifierName (Microsoft.CodeAnalysis.CSharp.Syntax.IdentifierNameSyntax node)
+ {
+ switch (node.Identifier.Text) {
+ case "nfloat":
+ case "nint":
+ case "nuint":
+ var symbol = base.semanticModel.GetSymbolInfo (node).Symbol as INamedTypeSymbol;
+ if (symbol != null && symbol.ContainingNamespace.ToDisplayString () == "System") {
+ Colorize (node.Span, "Keyword(Type)");
+ return;
+ }
+ break;
}
+ base.VisitIdentifierName (node);
}
- #endregion
}
}
-
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs
index 7c4df6c26c..ab1331bd1f 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/HighlightUsagesExtension.cs
@@ -26,78 +26,218 @@
using System;
using System.Collections.Generic;
using MonoDevelop.Core;
-using ICSharpCode.NRefactory.CSharp.Resolver;
using MonoDevelop.Ide.FindInFiles;
-using ICSharpCode.NRefactory.Semantics;
-using ICSharpCode.NRefactory.CSharp;
using System.Threading;
using MonoDevelop.SourceEditor;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide;
+using MonoDevelop.Refactoring;
+using Microsoft.CodeAnalysis.FindSymbols;
+using MonoDevelop.Ide.TypeSystem;
+using System.Threading.Tasks;
+using System.Collections.Immutable;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Extension;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.Linq;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters;
+using Microsoft.CodeAnalysis.Editor.Implementation.Highlighting;
namespace MonoDevelop.CSharp.Highlighting
{
- public class HighlightUsagesExtension : AbstractUsagesExtension<ResolveResult>
+ class UsageData
+ {
+ public RefactoringSymbolInfo SymbolInfo;
+ public Document Document;
+ public int Offset;
+
+ public ISymbol Symbol {
+ get { return SymbolInfo != null ? SymbolInfo.Symbol ?? SymbolInfo.DeclaredSymbol : null; }
+ }
+ }
+
+ class HighlightUsagesExtension : AbstractUsagesExtension<UsageData>
{
CSharpSyntaxMode syntaxMode;
+ static IHighlighter [] highlighters;
- public override void Initialize ()
+ static HighlightUsagesExtension ()
+ {
+ highlighters = typeof (HighlightUsagesExtension).Assembly
+ .GetTypes ()
+ .Where (t => !t.IsAbstract && typeof (IHighlighter).IsAssignableFrom (t))
+ .Select (t => (IHighlighter)Activator.CreateInstance (t)).ToArray ();
+ }
+ protected override void Initialize ()
{
base.Initialize ();
-
- TextEditorData.SelectionSurroundingProvider = new CSharpSelectionSurroundingProvider (Document);
- syntaxMode = new CSharpSyntaxMode (Document);
- TextEditorData.Document.SyntaxMode = syntaxMode;
+ Editor.SetSelectionSurroundingProvider (new CSharpSelectionSurroundingProvider (Editor, DocumentContext));
+ syntaxMode = new CSharpSyntaxMode (Editor, DocumentContext);
+ Editor.SemanticHighlighting = syntaxMode;
}
public override void Dispose ()
{
if (syntaxMode != null) {
- TextEditorData.Document.SyntaxMode = null;
+ Editor.SemanticHighlighting = null;
syntaxMode.Dispose ();
syntaxMode = null;
}
base.Dispose ();
}
+
+ protected async override Task<UsageData> ResolveAsync (CancellationToken token)
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ if (doc == null || doc.FileName == FilePath.Null)
+ return new UsageData ();
+ var analysisDocument = doc.AnalysisDocument;
+ if (analysisDocument == null)
+ return new UsageData ();
+
+ var symbolInfo = await RefactoringSymbolInfo.GetSymbolInfoAsync (doc, doc.Editor, token);
+ if (symbolInfo.Symbol == null && symbolInfo.DeclaredSymbol == null)
+ return new UsageData {
+ Document = analysisDocument,
+ Offset = doc.Editor.CaretOffset
+ };
+
+ if (symbolInfo.Symbol != null && !symbolInfo.Node.IsKind (SyntaxKind.IdentifierName) && !symbolInfo.Node.IsKind (SyntaxKind.GenericName))
+ return new UsageData ();
+
+ return new UsageData {
+ Document = analysisDocument,
+ SymbolInfo = symbolInfo,
+ Offset = doc.Editor.CaretOffset
+ };
+ }
- protected override bool TryResolve (out ResolveResult resolveResult)
+ protected override async Task<IEnumerable<MemberReference>> GetReferencesAsync (UsageData resolveResult, CancellationToken token)
{
- AstNode node;
- resolveResult = null;
- if (!Document.TryResolveAt (Document.Editor.Caret.Location, out resolveResult, out node)) {
- return false;
+ var result = new List<MemberReference> ();
+ if (resolveResult.Symbol == null) {
+ if (resolveResult.Document == null)
+ return result;
+ var root = await resolveResult.Document.GetSyntaxRootAsync (token).ConfigureAwait (false);
+ var doc2 = resolveResult.Document;
+
+ foreach (var highlighter in highlighters) {
+ try {
+ foreach (var span in highlighter.GetHighlights (root, resolveResult.Offset, token)) {
+ result.Add (new MemberReference (span, doc2.FilePath, span.Start, span.Length) {
+ ReferenceUsageType = ReferenceUsageType.Keyword
+ });
+ }
+ } catch (Exception e) {
+ LoggingService.LogError ("Highlighter " + highlighter + " threw exception.", e);
+ }
+ }
+ return result;
}
- if (node is PrimitiveType) {
- return false;
+
+ var doc = resolveResult.Document;
+ var documents = ImmutableHashSet.Create (doc);
+ var symbol = resolveResult.Symbol;
+ foreach (var loc in symbol.Locations) {
+ if (loc.IsInSource && loc.SourceTree.FilePath == doc.FilePath)
+ result.Add (new MemberReference (symbol, doc.FilePath, loc.SourceSpan.Start, loc.SourceSpan.Length) {
+ ReferenceUsageType = ReferenceUsageType.Declariton
+ });
}
- return true;
- }
+ foreach (var mref in await SymbolFinder.FindReferencesAsync (symbol, TypeSystemService.Workspace.CurrentSolution, documents, token)) {
+ foreach (var loc in mref.Locations) {
+ Microsoft.CodeAnalysis.Text.TextSpan span = loc.Location.SourceSpan;
+ var root = loc.Location.SourceTree.GetRoot ();
+ var node = root.FindNode (loc.Location.SourceSpan);
+ var trivia = root.FindTrivia (loc.Location.SourceSpan.Start);
+ if (!trivia.IsKind (SyntaxKind.SingleLineDocumentationCommentTrivia)) {
+ span = node.Span;
+ }
- protected override IEnumerable<MemberReference> GetReferences (ResolveResult resolveResult, CancellationToken token)
- {
- var finder = new MonoDevelop.CSharp.Refactoring.CSharpReferenceFinder ();
- if (resolveResult is MemberResolveResult) {
- finder.SetSearchedMembers (new [] { ((MemberResolveResult)resolveResult).Member });
- } else if (resolveResult is TypeResolveResult) {
- finder.SetSearchedMembers (new [] { resolveResult.Type });
- } else if (resolveResult is MethodGroupResolveResult) {
- finder.SetSearchedMembers (((MethodGroupResolveResult)resolveResult).Methods);
- } else if (resolveResult is NamespaceResolveResult) {
- finder.SetSearchedMembers (new [] { ((NamespaceResolveResult)resolveResult).Namespace });
- } else if (resolveResult is LocalResolveResult) {
- finder.SetSearchedMembers (new [] { ((LocalResolveResult)resolveResult).Variable });
- } else if (resolveResult is NamedArgumentResolveResult) {
- finder.SetSearchedMembers (new [] { ((NamedArgumentResolveResult)resolveResult).Parameter });
- } else {
- return EmptyList;
+
+
+
+
+ if (span.Start != loc.Location.SourceSpan.Start) {
+ span = loc.Location.SourceSpan;
+ }
+ result.Add (new MemberReference (symbol, doc.FilePath, span.Start, span.Length) {
+ ReferenceUsageType = GetUsage (node)
+ });
+ }
+ }
+
+ foreach (var loc in await GetAdditionalReferencesAsync (doc, symbol, token)) {
+ result.Add (new MemberReference (symbol, doc.FilePath, loc.SourceSpan.Start, loc.SourceSpan.Length) {
+ ReferenceUsageType = ReferenceUsageType.Write
+ });
}
- try {
- return new List<MemberReference> (finder.FindInDocument (Document, token));
- } catch (Exception e) {
- LoggingService.LogError ("Error in highlight usages extension.", e);
+ return result;
+ }
+
+ async Task<IEnumerable<Location>> GetAdditionalReferencesAsync (Document document, ISymbol symbol, CancellationToken cancellationToken)
+ {
+ // The FindRefs engine won't find references through 'var' for performance reasons.
+ // Also, they are not needed for things like rename/sig change, and the normal find refs
+ // feature. However, we would lke the results to be highlighted to get a good experience
+ // while editing (especially since highlighting may have been invoked off of 'var' in
+ // the first place).
+ //
+ // So we look for the references through 'var' directly in this file and add them to the
+ // results found by the engine.
+ List<Location> results = null;
+
+ if (symbol is INamedTypeSymbol && symbol.Name != "var") {
+ var originalSymbol = symbol.OriginalDefinition;
+ var root = await document.GetSyntaxRootAsync (cancellationToken).ConfigureAwait (false);
+
+ var descendents = root.DescendantNodes ();
+ var semanticModel = default (SemanticModel);
+
+ foreach (var type in descendents.OfType<IdentifierNameSyntax> ()) {
+ cancellationToken.ThrowIfCancellationRequested ();
+
+ if (type.IsVar) {
+ if (semanticModel == null) {
+ semanticModel = await document.GetSemanticModelAsync (cancellationToken).ConfigureAwait (false);
+ }
+
+ var boundSymbol = semanticModel.GetSymbolInfo (type, cancellationToken).Symbol;
+ boundSymbol = boundSymbol == null ? null : boundSymbol.OriginalDefinition;
+
+ if (originalSymbol.Equals (boundSymbol)) {
+ if (results == null) {
+ results = new List<Location> ();
+ }
+
+ results.Add (type.GetLocation ());
+ }
+ }
+ }
}
- return EmptyList;
+
+ return results ?? SpecializedCollections.EmptyEnumerable<Location> ();
}
+
+ static ReferenceUsageType GetUsage (SyntaxNode node)
+ {
+ if (node == null)
+ return ReferenceUsageType.Read;
+
+ var parent = node.AncestorsAndSelf ().OfType<ExpressionSyntax> ().FirstOrDefault();
+ if (parent == null)
+ return ReferenceUsageType.Read;
+ if (parent.IsOnlyWrittenTo ())
+ return ReferenceUsageType.Write;
+ if (parent.IsWrittenTo ())
+ return ReferenceUsageType.ReadWrite;
+ return ReferenceUsageType.Read;
+ }
+
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AbstractAsyncHighlighter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AbstractAsyncHighlighter.cs
new file mode 100644
index 0000000000..83b9f20e7c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AbstractAsyncHighlighter.cs
@@ -0,0 +1,88 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using ICSharpCode.NRefactory6;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Editor.Implementation.Highlighting;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+
+namespace Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters
+{
+ internal abstract class AbstractAsyncHighlighter<TNode> : AbstractKeywordHighlighter<TNode> where TNode : SyntaxNode
+ {
+ protected void HighlightRelatedKeywords(SyntaxNode node, List<TextSpan> spans)
+ {
+ // Highlight async keyword
+ node.TypeSwitch(
+ (MethodDeclarationSyntax methodDeclaration) =>
+ {
+ var asyncModifier = methodDeclaration.Modifiers.FirstOrDefault(m => m.Kind() == SyntaxKind.AsyncKeyword);
+ if (asyncModifier.Kind() != SyntaxKind.None)
+ {
+ spans.Add(asyncModifier.Span);
+ }
+ },
+ (SimpleLambdaExpressionSyntax simpleLambda) =>
+ {
+ if (simpleLambda.AsyncKeyword.Kind() == SyntaxKind.AsyncKeyword)
+ {
+ spans.Add(simpleLambda.AsyncKeyword.Span);
+ }
+ },
+ (ParenthesizedLambdaExpressionSyntax parenthesizedLambda) =>
+ {
+ if (parenthesizedLambda.AsyncKeyword.Kind() == SyntaxKind.AsyncKeyword)
+ {
+ spans.Add(parenthesizedLambda.AsyncKeyword.Span);
+ }
+ },
+ (AnonymousMethodExpressionSyntax anonymousMethod) =>
+ {
+ if (anonymousMethod.AsyncKeyword.Kind() == SyntaxKind.AsyncKeyword)
+ {
+ spans.Add(anonymousMethod.AsyncKeyword.Span);
+ }
+ });
+
+ // Highlight await keywords
+ node.TypeSwitch(
+ (AwaitExpressionSyntax awaitExpression) =>
+ {
+ // Note if there is already a highlight for the previous token, merge it
+ // with this span. That way, we highlight nested awaits with a single span.
+ var handled = false;
+ var awaitToken = awaitExpression.AwaitKeyword;
+ var previousToken = awaitToken.GetPreviousToken();
+ if (!previousToken.Span.IsEmpty)
+ {
+ var index = spans.FindIndex(s => s.Contains(previousToken.Span));
+ if (index >= 0)
+ {
+ var span = spans[index];
+ spans[index] = TextSpan.FromBounds(span.Start, awaitToken.Span.End);
+ handled = true;
+ }
+ }
+
+ if (!handled)
+ {
+ spans.Add(awaitToken.Span);
+ }
+ });
+
+ foreach (var child in node.ChildNodes())
+ {
+ // Only recurse if we have anything to do
+ if (!child.IsReturnableConstruct())
+ {
+ HighlightRelatedKeywords(child, spans);
+ }
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AsyncAnonymousMethodHighlighter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AsyncAnonymousMethodHighlighter.cs
new file mode 100644
index 0000000000..7861625b17
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AsyncAnonymousMethodHighlighter.cs
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+namespace Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters
+{
+ internal class AsyncAnonymousMethodHighlighter : AbstractAsyncHighlighter<AnonymousMethodExpressionSyntax>
+ {
+ protected override IEnumerable<TextSpan> GetHighlights(AnonymousMethodExpressionSyntax node, CancellationToken cancellationToken)
+ {
+ if (node.AsyncKeyword.Kind() != SyntaxKind.AsyncKeyword)
+ {
+ return SpecializedCollections.EmptyEnumerable<TextSpan>();
+ }
+
+ var spans = new List<TextSpan>();
+
+ HighlightRelatedKeywords(node, spans);
+
+ return spans;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AsyncMethodHighlighter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AsyncMethodHighlighter.cs
new file mode 100644
index 0000000000..eaa20b27e3
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AsyncMethodHighlighter.cs
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+namespace Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters
+{
+ internal class AsyncMethodHighlighter : AbstractAsyncHighlighter<MethodDeclarationSyntax>
+ {
+ protected override IEnumerable<TextSpan> GetHighlights(MethodDeclarationSyntax node, CancellationToken cancellationToken)
+ {
+ if (!node.Modifiers.Any(SyntaxKind.AsyncKeyword))
+ {
+ return SpecializedCollections.EmptyEnumerable<TextSpan>();
+ }
+
+ var spans = new List<TextSpan>();
+
+ HighlightRelatedKeywords(node, spans);
+
+ return spans;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AsyncParenthesizedLambdaHighlighter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AsyncParenthesizedLambdaHighlighter.cs
new file mode 100644
index 0000000000..81e1d4a990
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AsyncParenthesizedLambdaHighlighter.cs
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+namespace Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters
+{
+ internal class AsyncParenthesizedLambdaHighlighter : AbstractAsyncHighlighter<ParenthesizedLambdaExpressionSyntax>
+ {
+ protected override IEnumerable<TextSpan> GetHighlights(ParenthesizedLambdaExpressionSyntax node, CancellationToken cancellationToken)
+ {
+ if (node.AsyncKeyword.Kind() != SyntaxKind.AsyncKeyword)
+ {
+ return SpecializedCollections.EmptyEnumerable<TextSpan>();
+ }
+
+ var spans = new List<TextSpan>();
+
+ HighlightRelatedKeywords(node, spans);
+
+ return spans;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AsyncSimpleLambdaHighlighter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AsyncSimpleLambdaHighlighter.cs
new file mode 100644
index 0000000000..d6ecbea7d7
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AsyncSimpleLambdaHighlighter.cs
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+namespace Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters
+{
+ internal class AsyncSimpleLambdaHighlighter : AbstractAsyncHighlighter<SimpleLambdaExpressionSyntax>
+ {
+ protected override IEnumerable<TextSpan> GetHighlights(SimpleLambdaExpressionSyntax node, CancellationToken cancellationToken)
+ {
+ if (node.AsyncKeyword.Kind() != SyntaxKind.AsyncKeyword)
+ {
+ return SpecializedCollections.EmptyEnumerable<TextSpan>();
+ }
+
+ var spans = new List<TextSpan>();
+
+ HighlightRelatedKeywords(node, spans);
+
+ return spans;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AwaitHighlighter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AwaitHighlighter.cs
new file mode 100644
index 0000000000..8dfb69f7dc
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/AwaitHighlighter.cs
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+namespace Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters
+{
+ internal class AwaitHighlighter : AbstractAsyncHighlighter<AwaitExpressionSyntax>
+ {
+ protected override IEnumerable<TextSpan> GetHighlights(AwaitExpressionSyntax awaitExpression, CancellationToken cancellationToken)
+ {
+ var parent = awaitExpression
+ .AncestorsAndSelf()
+ .FirstOrDefault(n => n.IsReturnableConstruct());
+
+ if (parent == null)
+ {
+ return SpecializedCollections.EmptyEnumerable<TextSpan>();
+ }
+
+ var spans = new List<TextSpan>();
+
+ HighlightRelatedKeywords(parent, spans);
+
+ return spans;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/CheckedExpressionHighlighter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/CheckedExpressionHighlighter.cs
new file mode 100644
index 0000000000..0a5e8991da
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/CheckedExpressionHighlighter.cs
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Editor.Implementation.Highlighting;
+using Microsoft.CodeAnalysis.Text;
+
+namespace Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters
+{
+ internal class CheckedExpressionHighlighter : AbstractKeywordHighlighter<CheckedExpressionSyntax>
+ {
+ protected override IEnumerable<TextSpan> GetHighlights(
+ CheckedExpressionSyntax checkedExpressionSyntax, CancellationToken cancellationToken)
+ {
+ switch (checkedExpressionSyntax.Kind())
+ {
+ case SyntaxKind.CheckedExpression:
+ case SyntaxKind.UncheckedExpression:
+ yield return checkedExpressionSyntax.Keyword.Span;
+ break;
+ default:
+ yield break;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/CheckedStatementHighlighter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/CheckedStatementHighlighter.cs
new file mode 100644
index 0000000000..12f5349a12
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/CheckedStatementHighlighter.cs
@@ -0,0 +1,19 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Editor.Implementation.Highlighting;
+using Microsoft.CodeAnalysis.Text;
+
+namespace Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters
+{
+ internal class CheckedStatementHighlighter : AbstractKeywordHighlighter<CheckedStatementSyntax>
+ {
+ protected override IEnumerable<TextSpan> GetHighlights(
+ CheckedStatementSyntax checkedStatement, CancellationToken cancellationToken)
+ {
+ yield return checkedStatement.Keyword.Span;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/ConditionalPreprocessorHighlighter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/ConditionalPreprocessorHighlighter.cs
new file mode 100644
index 0000000000..48cb19a19d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/ConditionalPreprocessorHighlighter.cs
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Editor.Implementation.Highlighting;
+using Microsoft.CodeAnalysis.Text;
+
+namespace Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters
+{
+ internal class ConditionalPreprocessorHighlighter : AbstractKeywordHighlighter<DirectiveTriviaSyntax>
+ {
+ protected override IEnumerable<TextSpan> GetHighlights(
+ DirectiveTriviaSyntax directive, CancellationToken cancellationToken)
+ {
+ var conditionals = directive.GetMatchingConditionalDirectives(cancellationToken);
+ if (conditionals == null)
+ {
+ yield break;
+ }
+
+ foreach (var conditional in conditionals)
+ {
+ yield return TextSpan.FromBounds(
+ conditional.HashToken.SpanStart,
+ conditional.DirectiveNameToken.Span.End);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/IfStatementHighlighter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/IfStatementHighlighter.cs
new file mode 100644
index 0000000000..0063878bbc
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/IfStatementHighlighter.cs
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Editor.Implementation.Highlighting;
+using Microsoft.CodeAnalysis.Text;
+
+namespace Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting
+{
+ internal class IfStatementHighlighter : AbstractKeywordHighlighter<IfStatementSyntax>
+ {
+ protected override IEnumerable<TextSpan> GetHighlights(
+ IfStatementSyntax ifStatement, CancellationToken cancellationToken)
+ {
+ if (ifStatement.Parent.Kind() != SyntaxKind.ElseClause)
+ {
+ return ComputeSpans(ifStatement);
+ }
+
+ return Enumerable.Empty<TextSpan>();
+ }
+
+ private IEnumerable<TextSpan> ComputeSpans(
+ IfStatementSyntax ifStatement)
+ {
+ yield return ifStatement.IfKeyword.Span;
+
+ // Loop to get all the else if parts
+ while (ifStatement != null && ifStatement.Else != null)
+ {
+ // Check for 'else if' scenario' (the statement in the else clause is an if statement)
+ var elseKeyword = ifStatement.Else.ElseKeyword;
+ var elseIfStatement = ifStatement.Else.Statement as IfStatementSyntax;
+
+ if (elseIfStatement != null)
+ {
+ if (OnlySpacesBetween(elseKeyword, elseIfStatement.IfKeyword))
+ {
+ // Highlight both else and if tokens if they are on the same line
+ yield return TextSpan.FromBounds(
+ elseKeyword.SpanStart,
+ elseIfStatement.IfKeyword.Span.End);
+ }
+ else
+ {
+ // Highlight the else and if tokens separately
+ yield return elseKeyword.Span;
+ yield return elseIfStatement.IfKeyword.Span;
+ }
+
+ // Continue the enumeration looking for more else blocks
+ ifStatement = elseIfStatement;
+ }
+ else
+ {
+ // Highlight just the else and we're done
+ yield return elseKeyword.Span;
+ break;
+ }
+ }
+ }
+
+ public static bool OnlySpacesBetween(SyntaxToken first, SyntaxToken second)
+ {
+ return first.TrailingTrivia.AsString().All(c => c == ' ') &&
+ second.LeadingTrivia.AsString().All(c => c == ' ');
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/LockStatementHighlighter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/LockStatementHighlighter.cs
new file mode 100644
index 0000000000..217da2a1a2
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/LockStatementHighlighter.cs
@@ -0,0 +1,19 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Editor.Implementation.Highlighting;
+using Microsoft.CodeAnalysis.Text;
+
+namespace Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters
+{
+ internal class LockStatementHighlighter : AbstractKeywordHighlighter<LockStatementSyntax>
+ {
+ protected override IEnumerable<TextSpan> GetHighlights(
+ LockStatementSyntax lockStatement, CancellationToken cancellationToken)
+ {
+ yield return lockStatement.LockKeyword.Span;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/LoopHighlighter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/LoopHighlighter.cs
new file mode 100644
index 0000000000..24e56c8c5c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/LoopHighlighter.cs
@@ -0,0 +1,118 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Threading;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Editor.Implementation.Highlighting;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+namespace Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters
+{
+ internal class LoopHighlighter : AbstractKeywordHighlighter<SyntaxNode>
+ {
+ protected override IEnumerable<TextSpan> GetHighlights(
+ SyntaxNode node, CancellationToken cancellationToken)
+ {
+ var loop = node.GetAncestorsOrThis<SyntaxNode>()
+ .FirstOrDefault(ancestor => ancestor.IsContinuableConstruct());
+
+ if (loop != null)
+ {
+ return KeywordHighlightsForLoop(loop);
+ }
+
+ return SpecializedCollections.EmptyEnumerable<TextSpan>();
+ }
+
+ private IEnumerable<TextSpan> KeywordHighlightsForLoop(SyntaxNode loopNode)
+ {
+ var spans = new List<TextSpan>();
+
+ switch (loopNode.Kind())
+ {
+ case SyntaxKind.DoStatement:
+ HighlightDoStatement((DoStatementSyntax)loopNode, spans);
+ break;
+ case SyntaxKind.ForStatement:
+ HighlightForStatement((ForStatementSyntax)loopNode, spans);
+ break;
+
+ case SyntaxKind.ForEachStatement:
+ HighlightForEachStatement((ForEachStatementSyntax)loopNode, spans);
+ break;
+
+ case SyntaxKind.WhileStatement:
+ HighlightWhileStatement((WhileStatementSyntax)loopNode, spans);
+ break;
+ }
+
+ HighlightRelatedKeywords(loopNode, spans, true, true);
+
+ return spans;
+ }
+
+ private void HighlightDoStatement(DoStatementSyntax statement, List<TextSpan> spans)
+ {
+ spans.Add(statement.DoKeyword.Span);
+ spans.Add(statement.WhileKeyword.Span);
+ spans.Add(EmptySpan(statement.SemicolonToken.Span.End));
+ }
+
+ private void HighlightForStatement(ForStatementSyntax statement, List<TextSpan> spans)
+ {
+ spans.Add(statement.ForKeyword.Span);
+ }
+
+ private void HighlightForEachStatement(ForEachStatementSyntax statement, List<TextSpan> spans)
+ {
+ spans.Add(statement.ForEachKeyword.Span);
+ }
+
+ private void HighlightWhileStatement(WhileStatementSyntax statement, List<TextSpan> spans)
+ {
+ spans.Add(statement.WhileKeyword.Span);
+ }
+
+ /// <summary>
+ /// Finds all breaks and continues that are a child of this node, and adds the appropriate spans to the spans list.
+ /// </summary>
+ private void HighlightRelatedKeywords(SyntaxNode node, List<TextSpan> spans, bool highlightBreaks, bool highlightContinues)
+ {
+ Debug.Assert(highlightBreaks || highlightContinues);
+
+ if (highlightBreaks && node is BreakStatementSyntax)
+ {
+ var statement = (BreakStatementSyntax)node;
+ spans.Add(statement.BreakKeyword.Span);
+ spans.Add(EmptySpan(statement.SemicolonToken.Span.End));
+ }
+ else if (highlightContinues && node is ContinueStatementSyntax)
+ {
+ var statement = (ContinueStatementSyntax)node;
+ spans.Add(statement.ContinueKeyword.Span);
+ spans.Add(EmptySpan(statement.SemicolonToken.Span.End));
+ }
+ else
+ {
+ foreach (var child in node.ChildNodes())
+ {
+ var highlightBreaksForChild = highlightBreaks && !child.IsBreakableConstruct();
+ var highlightContinuesForChild = highlightContinues && !child.IsContinuableConstruct();
+
+ // Only recurse if we have anything to do
+ if (highlightBreaksForChild || highlightContinuesForChild)
+ {
+ HighlightRelatedKeywords(child, spans, highlightBreaksForChild, highlightContinuesForChild);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/RegionHighlighter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/RegionHighlighter.cs
new file mode 100644
index 0000000000..07d918d95d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/RegionHighlighter.cs
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Editor.Implementation.Highlighting;
+using Microsoft.CodeAnalysis.Text;
+
+namespace Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters
+{
+ internal class RegionHighlighter : AbstractKeywordHighlighter<DirectiveTriviaSyntax>
+ {
+ protected override IEnumerable<TextSpan> GetHighlights(
+ DirectiveTriviaSyntax directive, CancellationToken cancellationToken)
+ {
+ var matchingDirective = directive.GetMatchingDirective(cancellationToken);
+ if (matchingDirective == null)
+ {
+ yield break;
+ }
+
+ yield return TextSpan.FromBounds(
+ directive.HashToken.SpanStart,
+ directive.DirectiveNameToken.Span.End);
+
+ yield return TextSpan.FromBounds(
+ matchingDirective.HashToken.SpanStart,
+ matchingDirective.DirectiveNameToken.Span.End);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/ReturnStatementHighlighter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/ReturnStatementHighlighter.cs
new file mode 100644
index 0000000000..d18660ebe5
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/ReturnStatementHighlighter.cs
@@ -0,0 +1,63 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using ICSharpCode.NRefactory6;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Editor.Implementation.Highlighting;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+namespace Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters
+{
+ internal class ReturnStatementHighlighter : AbstractKeywordHighlighter<ReturnStatementSyntax>
+ {
+ protected override IEnumerable<TextSpan> GetHighlights(
+ ReturnStatementSyntax returnStatement, CancellationToken cancellationToken)
+ {
+ var parent = returnStatement
+ .GetAncestorsOrThis<SyntaxNode>()
+ .FirstOrDefault(n => n.IsReturnableConstruct());
+
+ if (parent == null)
+ {
+ return SpecializedCollections.EmptyEnumerable<TextSpan>();
+ }
+
+ var spans = new List<TextSpan>();
+
+ HighlightRelatedKeywords(parent, spans);
+
+ return spans;
+ }
+
+ /// <summary>
+ /// Finds all returns that are children of this node, and adds the appropriate spans to the spans list.
+ /// </summary>
+ private void HighlightRelatedKeywords(SyntaxNode node, List<TextSpan> spans)
+ {
+ node.TypeSwitch(
+ (ReturnStatementSyntax statement) =>
+ {
+ spans.Add(statement.ReturnKeyword.Span);
+ spans.Add(EmptySpan(statement.SemicolonToken.Span.End));
+ },
+ _ =>
+ {
+ foreach (var child in node.ChildNodes())
+ {
+ // Only recurse if we have anything to do
+ if (!child.IsReturnableConstruct())
+ {
+ HighlightRelatedKeywords(child, spans);
+ }
+ }
+ });
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/SwitchStatementHighlighter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/SwitchStatementHighlighter.cs
new file mode 100644
index 0000000000..a5258f7548
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/SwitchStatementHighlighter.cs
@@ -0,0 +1,77 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using ICSharpCode.NRefactory6;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Editor.Implementation.Highlighting;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+
+namespace Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters
+{
+ internal class SwitchStatementHighlighter : AbstractKeywordHighlighter<SwitchStatementSyntax>
+ {
+ protected override IEnumerable<TextSpan> GetHighlights(
+ SwitchStatementSyntax switchStatement, CancellationToken cancellationToken)
+ {
+ var spans = new List<TextSpan>();
+
+ spans.Add(switchStatement.SwitchKeyword.Span);
+
+ foreach (var switchSection in switchStatement.Sections)
+ {
+ foreach (var label in switchSection.Labels)
+ {
+ spans.Add(label.Keyword.Span);
+ spans.Add(EmptySpan(label.ColonToken.Span.End));
+ }
+
+ foreach (var statement in switchSection.Statements)
+ {
+ HighlightRelatedKeywords(statement, spans);
+ }
+ }
+
+ return spans;
+ }
+
+ /// <summary>
+ /// Finds all breaks and continues that are a child of this node, and adds the appropriate spans to the spans
+ /// list.
+ /// </summary>
+ private void HighlightRelatedKeywords(SyntaxNode node, List<TextSpan> spans)
+ {
+ node.TypeSwitch(
+ (BreakStatementSyntax breakStatement) =>
+ {
+ spans.Add(breakStatement.BreakKeyword.Span);
+ spans.Add(EmptySpan(breakStatement.SemicolonToken.Span.End));
+ },
+ (GotoStatementSyntax gotoStatement) =>
+ {
+ var start = gotoStatement.GotoKeyword.SpanStart;
+ var end = !gotoStatement.CaseOrDefaultKeyword.IsKind(SyntaxKind.None)
+ ? gotoStatement.CaseOrDefaultKeyword.Span.End
+ : gotoStatement.GotoKeyword.Span.End;
+
+ spans.Add(TextSpan.FromBounds(start, end));
+ spans.Add(EmptySpan(gotoStatement.SemicolonToken.Span.End));
+ },
+ _ =>
+ {
+ foreach (var child in node.ChildNodes())
+ {
+ // Only recurse if we have anything to do
+ if (child.IsBreakableConstruct())
+ {
+ HighlightRelatedKeywords(child, spans);
+ }
+ }
+ });
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/TryStatementHighlighter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/TryStatementHighlighter.cs
new file mode 100644
index 0000000000..f84041102c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/TryStatementHighlighter.cs
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Editor.Implementation.Highlighting;
+using Microsoft.CodeAnalysis.Text;
+
+namespace Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters
+{
+ internal class TryStatementHighlighter : AbstractKeywordHighlighter<TryStatementSyntax>
+ {
+ protected override IEnumerable<TextSpan> GetHighlights(
+ TryStatementSyntax tryStatement, CancellationToken cancellationToken)
+ {
+ yield return tryStatement.TryKeyword.Span;
+
+ foreach (var catchDeclaration in tryStatement.Catches)
+ {
+ yield return catchDeclaration.CatchKeyword.Span;
+
+ if (catchDeclaration.Filter != null)
+ {
+ yield return catchDeclaration.Filter.WhenKeyword.Span;
+ }
+ }
+
+ if (tryStatement.Finally != null)
+ {
+ yield return tryStatement.Finally.FinallyKeyword.Span;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/UnsafeStatementHighlighter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/UnsafeStatementHighlighter.cs
new file mode 100644
index 0000000000..04834ab3cc
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/UnsafeStatementHighlighter.cs
@@ -0,0 +1,19 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Editor.Implementation.Highlighting;
+using Microsoft.CodeAnalysis.Text;
+
+namespace Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters
+{
+ internal class UnsafeStatementHighlighter : AbstractKeywordHighlighter<UnsafeStatementSyntax>
+ {
+ protected override IEnumerable<TextSpan> GetHighlights(
+ UnsafeStatementSyntax unsafeStatement, CancellationToken cancellationToken)
+ {
+ yield return unsafeStatement.UnsafeKeyword.Span;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/UsingStatementHighlighter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/UsingStatementHighlighter.cs
new file mode 100644
index 0000000000..c6ad88d613
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/UsingStatementHighlighter.cs
@@ -0,0 +1,19 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Editor.Implementation.Highlighting;
+using Microsoft.CodeAnalysis.Text;
+
+namespace Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters
+{
+ internal class UsingStatementHighlighter : AbstractKeywordHighlighter<UsingStatementSyntax>
+ {
+ protected override IEnumerable<TextSpan> GetHighlights(
+ UsingStatementSyntax usingStatement, CancellationToken cancellationToken)
+ {
+ yield return usingStatement.UsingKeyword.Span;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/YieldStatementHighlighter.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/YieldStatementHighlighter.cs
new file mode 100644
index 0000000000..5ccdce54e9
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/KeywordHighlighters/YieldStatementHighlighter.cs
@@ -0,0 +1,67 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using ICSharpCode.NRefactory6;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Editor.Implementation.Highlighting;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+namespace Microsoft.CodeAnalysis.Editor.CSharp.KeywordHighlighting.KeywordHighlighters
+{
+ internal class YieldStatementHighlighter : AbstractKeywordHighlighter<YieldStatementSyntax>
+ {
+ protected override IEnumerable<TextSpan> GetHighlights(
+ YieldStatementSyntax yieldStatement, CancellationToken cancellationToken)
+ {
+ var parent = yieldStatement
+ .GetAncestorsOrThis<SyntaxNode>()
+ .FirstOrDefault(n => n.IsReturnableConstruct());
+
+ if (parent == null)
+ {
+ return SpecializedCollections.EmptyEnumerable<TextSpan>();
+ }
+
+ var spans = new List<TextSpan>();
+
+ HighlightRelatedKeywords(parent, spans);
+
+ return spans;
+ }
+
+ /// <summary>
+ /// Finds all returns that are children of this node, and adds the appropriate spans to the spans list.
+ /// </summary>
+ private void HighlightRelatedKeywords(SyntaxNode node, List<TextSpan> spans)
+ {
+ node.TypeSwitch(
+ (YieldStatementSyntax statement) =>
+ {
+ spans.Add(
+ TextSpan.FromBounds(
+ statement.YieldKeyword.SpanStart,
+ statement.ReturnOrBreakKeyword.Span.End));
+
+ spans.Add(EmptySpan(statement.SemicolonToken.Span.End));
+ },
+ _ =>
+ {
+ foreach (var child in node.ChildNodes())
+ {
+ // Only recurse if we have anything to do
+ if (!child.IsReturnableConstruct())
+ {
+ HighlightRelatedKeywords(child, spans);
+ }
+ }
+ });
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/MoveToUsagesHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/MoveToUsagesHandler.cs
index adf3c8ecb1..5c4f859919 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/MoveToUsagesHandler.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Highlighting/MoveToUsagesHandler.cs
@@ -28,7 +28,7 @@ using MonoDevelop.Components.Commands;
using System.Linq;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui.Content;
-using Mono.TextEditor;
+using MonoDevelop.Core.Text;
namespace MonoDevelop.CSharp.Highlighting
{
@@ -63,10 +63,10 @@ namespace MonoDevelop.CSharp.Highlighting
if (ext.IsTimerOnQueue)
ext.ForceUpdate ();
- var caretOffset = doc.Editor.Caret.Offset;
- for (int i = 0; i < ext.UsagesSegments.Count; i++) {
- if (ext.UsagesSegments [i].TextSegment.Contains (caretOffset))
- MoveToNextUsageHandler.MoveToSegment (doc, ext.UsagesSegments [(i + ext.UsagesSegments.Count - 1) % ext.UsagesSegments.Count]);
+ var caretOffset = doc.Editor.CaretOffset;
+ for (int i = 0; i < ext.Markers.Count; i++) {
+ if (ext.Markers [i].Contains (caretOffset))
+ MoveToNextUsageHandler.MoveToSegment (doc, ext.Markers [(i + ext.Markers.Count - 1) % ext.Markers.Count]);
}
}
}
@@ -95,24 +95,23 @@ namespace MonoDevelop.CSharp.Highlighting
if (ext == null || ext.Markers.Count == 0)
return;
- var caretOffset = doc.Editor.Caret.Offset;
- for (int i = 0; i < ext.UsagesSegments.Count; i++) {
- if (ext.UsagesSegments [i].TextSegment.Contains (caretOffset))
- MoveToNextUsageHandler.MoveToSegment (doc, ext.UsagesSegments [(i + 1) % ext.UsagesSegments.Count]);
+ var caretOffset = doc.Editor.CaretOffset;
+ for (int i = 0; i < ext.Markers.Count; i++) {
+ if (ext.Markers [i].Contains (caretOffset))
+ MoveToNextUsageHandler.MoveToSegment (doc, ext.Markers [(i + 1) % ext.Markers.Count]);
}
}
- public static void MoveToSegment (MonoDevelop.Ide.Gui.Document doc, TextSegment segment)
+ public static void MoveToSegment (MonoDevelop.Ide.Gui.Document doc, ISegment segment)
{
- if (segment.IsInvalid || segment.IsEmpty)
+ if (segment == null || segment.Offset < 0 || segment.Length == 0)
return;
- TextEditorData data = doc.Editor;
- data.Caret.Offset = segment.Offset;
- data.Parent.ScrollTo (segment.EndOffset);
-
- var loc = data.Document.OffsetToLocation (segment.EndOffset);
- if (data.Parent.TextViewMargin.ColumnToX (data.Document.GetLine (loc.Line), loc.Column) < data.HAdjustment.PageSize)
- data.HAdjustment.Value = 0;
+ var data = doc.Editor;
+ data.CaretOffset = segment.Offset;
+
+// var loc = data.OffsetToLocation (segment.EndOffset);
+// if (data.ColumnToX (data.GetLine (loc.Line), loc.Column) < data.HAdjustment.PageSize)
+// data.HAdjustment.Value = 0;
}
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindBaseSymbolsHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindBaseSymbolsHandler.cs
new file mode 100644
index 0000000000..8024897ab8
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindBaseSymbolsHandler.cs
@@ -0,0 +1,83 @@
+//
+// FindBaseSymbolsHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using MonoDevelop.Ide;
+using MonoDevelop.Ide.FindInFiles;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Core;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Refactoring;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using ICSharpCode.NRefactory6.CSharp;
+
+namespace MonoDevelop.CSharp.Navigation
+{
+ class FindBaseSymbolsHandler : CommandHandler
+ {
+ void FindSymbols (ISymbol sym)
+ {
+ if (sym == null)
+ return;
+ Task.Run (delegate {
+ using (var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true)) {
+ var foundSymbol = sym.OverriddenMember ();
+ while (foundSymbol != null) {
+ foreach (var loc in foundSymbol.Locations)
+ monitor.ReportResult (new MemberReference (foundSymbol, loc.SourceTree.FilePath, loc.SourceSpan.Start, loc.SourceSpan.Length));
+ foundSymbol = foundSymbol.OverriddenMember ();
+ }
+ }
+ });
+ }
+
+ internal static async Task<ISymbol> GetSymbolAtCaret (Ide.Gui.Document doc)
+ {
+ if (doc == null)
+ return null;
+ var info = await RefactoringSymbolInfo.GetSymbolInfoAsync (doc, doc.Editor);
+ return info.Symbol ?? info.DeclaredSymbol;
+ }
+
+ protected override async void Update (CommandInfo info)
+ {
+ var sym = await GetSymbolAtCaret (IdeApp.Workbench.ActiveDocument);
+ info.Enabled = sym != null;
+ info.Bypass = !info.Enabled;
+ }
+
+ protected override async void Run ()
+ {
+ var sym = await GetSymbolAtCaret (IdeApp.Workbench.ActiveDocument);
+ if (sym != null)
+ FindSymbols (sym);
+ }
+
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindDerivedSymbolsHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindDerivedSymbolsHandler.cs
new file mode 100644
index 0000000000..44e0cded3a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindDerivedSymbolsHandler.cs
@@ -0,0 +1,125 @@
+//
+// FindDerivedSymbolsHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide;
+using MonoDevelop.Ide.FindInFiles;
+using MonoDevelop.Ide.TypeSystem;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using MonoDevelop.Projects;
+using System.Threading;
+using MonoDevelop.Core;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.FindSymbols;
+using ICSharpCode.NRefactory6.CSharp;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Refactoring;
+using System.Runtime.CompilerServices;
+using System.Collections.Concurrent;
+using System.Collections.Immutable;
+using MonoDevelop.CSharp.Navigation;
+
+namespace MonoDevelop.CSharp.Refactoring
+{
+ class FindDerivedSymbolsHandler : CommandHandler
+ {
+ public static bool CanFindDerivedSymbols (ISymbol symbol, out string description)
+ {
+ if (symbol.Kind == SymbolKind.NamedType) {
+ var type = (ITypeSymbol)symbol;
+ description = type.TypeKind == TypeKind.Interface ? GettextCatalog.GetString ("Find Implementing Types") : GettextCatalog.GetString ("Find Derived Types");
+ return !type.IsStatic && !type.IsSealed;
+ }
+ if (symbol.ContainingType != null && symbol.ContainingType.TypeKind == TypeKind.Interface) {
+ description = GettextCatalog.GetString ("Find Implementing Symbols");
+ } else {
+ description = GettextCatalog.GetString ("Find Derived Symbols");
+ }
+ return symbol.IsVirtual || symbol.IsAbstract || symbol.IsOverride;
+ }
+
+ public static void FindDerivedSymbols (ISymbol symbol)
+ {
+ if (symbol == null)
+ return;
+ Task.Run (async delegate {
+ using (var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true)) {
+ IEnumerable<ISymbol> result;
+ if (symbol.ContainingType != null && symbol.ContainingType.TypeKind == TypeKind.Interface) {
+ result = await SymbolFinder.FindImplementationsAsync (symbol, TypeSystemService.Workspace.CurrentSolution).ConfigureAwait (false);
+ } else if (symbol.Kind == SymbolKind.NamedType) {
+ var type = (INamedTypeSymbol)symbol;
+ if (type.TypeKind == TypeKind.Interface) {
+
+ result = (await SymbolFinder.FindImplementationsAsync (type, TypeSystemService.Workspace.CurrentSolution).ConfigureAwait (false)).Cast<ISymbol> ().Concat (
+ await FindInterfaceImplementaitonsAsync (type, TypeSystemService.Workspace.CurrentSolution).ConfigureAwait (false)
+ );
+ } else {
+ result = (await SymbolFinder.FindDerivedClassesAsync (type, TypeSystemService.Workspace.CurrentSolution).ConfigureAwait (false)).Cast<ISymbol> ();
+ }
+ } else {
+ result = await SymbolFinder.FindOverridesAsync (symbol, TypeSystemService.Workspace.CurrentSolution).ConfigureAwait (false);
+ }
+ foreach (var foundSymbol in result) {
+ foreach (var loc in foundSymbol.Locations)
+ monitor.ReportResult (new MemberReference (foundSymbol, loc.SourceTree.FilePath, loc.SourceSpan.Start, loc.SourceSpan.Length));
+ }
+ }
+ });
+ }
+
+ static async Task<IEnumerable<ISymbol>> FindInterfaceImplementaitonsAsync (INamedTypeSymbol type, Microsoft.CodeAnalysis.Solution currentSolution, CancellationToken token = default(CancellationToken))
+ {
+ var result = new List<ISymbol> ();
+
+ foreach (var project in currentSolution.Projects) {
+ var comp = await project.GetCompilationAsync (token).ConfigureAwait (false);
+ foreach (var i in comp.GetAllTypesInMainAssembly (token).Where (t => t.TypeKind == TypeKind.Interface)) {
+ if (i.AllInterfaces.Any (t => t.InheritsFromOrEqualsIgnoringConstruction (type)))
+ result.Add (i);
+ }
+ }
+
+ return result;
+ }
+
+ protected override async void Update (CommandInfo info)
+ {
+ var sym = await FindBaseSymbolsHandler.GetSymbolAtCaret (IdeApp.Workbench.ActiveDocument);
+ info.Enabled = sym != null;
+ info.Bypass = !info.Enabled;
+ }
+
+ protected override async void Run (object dataItem)
+ {
+ var sym = await FindBaseSymbolsHandler.GetSymbolAtCaret (IdeApp.Workbench.ActiveDocument);
+ if (sym != null)
+ FindDerivedSymbols (sym);
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindExtensionMethodsHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindExtensionMethodsHandler.cs
new file mode 100644
index 0000000000..e759081e67
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindExtensionMethodsHandler.cs
@@ -0,0 +1,90 @@
+//
+// FindExtensionMethodHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using MonoDevelop.Ide;
+using MonoDevelop.Ide.FindInFiles;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Core;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Refactoring;
+using System.Collections;
+using System.Reflection;
+using System.Collections.Generic;
+using System.Linq;
+using ICSharpCode.NRefactory6.CSharp;
+
+namespace MonoDevelop.CSharp.Navigation
+{
+ class FindExtensionMethodsHandler : CommandHandler
+ {
+ protected override async void Update (CommandInfo info)
+ {
+ var sym = await GetNamedTypeAtCaret (IdeApp.Workbench.ActiveDocument);
+ info.Enabled = sym != null && sym.IsKind (SymbolKind.NamedType);
+ info.Bypass = !info.Enabled;
+ }
+
+ protected async override void Run ()
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ var sym = await GetNamedTypeAtCaret (doc);
+ if (sym != null)
+ FindExtensionMethods (await doc.GetCompilationAsync (), sym);
+ }
+
+ internal static async System.Threading.Tasks.Task<INamedTypeSymbol> GetNamedTypeAtCaret (Ide.Gui.Document doc)
+ {
+ if (doc == null)
+ return null;
+ var info = await RefactoringSymbolInfo.GetSymbolInfoAsync (doc, doc.Editor);
+ var sym = info.Symbol ?? info.DeclaredSymbol;
+ return sym as INamedTypeSymbol;
+ }
+
+ void FindExtensionMethods (Compilation compilation, ISymbol sym)
+ {
+ var symType = sym as ITypeSymbol;
+ if (symType == null)
+ return;
+ using (var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true)) {
+ foreach (var type in compilation.Assembly.GlobalNamespace.GetAllTypes ()) {
+ if (!type.MightContainExtensionMethods)
+ continue;
+
+ foreach (var extMethod in type.GetMembers ().OfType<IMethodSymbol> ().Where (method => method.IsExtensionMethod)) {
+ var reducedMethod = extMethod.ReduceExtensionMethod (symType);
+ if (reducedMethod != null) {
+ var loc = extMethod.Locations.First ();
+ monitor.ReportResult (new MemberReference (extMethod, loc.SourceTree.FilePath, loc.SourceSpan.Start, loc.SourceSpan.Length));
+ }
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindImplementingMembersHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindImplementingMembersHandler.cs
new file mode 100644
index 0000000000..d8830eed5f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindImplementingMembersHandler.cs
@@ -0,0 +1,104 @@
+//
+// FindImplementingMembersHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using MonoDevelop.Ide;
+using MonoDevelop.Ide.FindInFiles;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Refactoring;
+using System.Linq;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.CSharp.Navigation
+{
+ class FindImplementingMembersHandler : CommandHandler
+ {
+ protected override async void Update (CommandInfo info)
+ {
+ var sym = await GetNamedTypeAtCaret (IdeApp.Workbench.ActiveDocument);
+ info.Enabled = sym != null;
+ info.Bypass = !info.Enabled;
+ }
+
+ protected async override void Run ()
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ var sym = await GetNamedTypeAtCaret (doc);
+ if (sym != null)
+ FindImplementingSymbols (await doc.GetCompilationAsync (), sym);
+ }
+
+ static async Task<RefactoringSymbolInfo> GetNamedTypeAtCaret (Ide.Gui.Document doc)
+ {
+ if (doc == null)
+ return null;
+ var info = await RefactoringSymbolInfo.GetSymbolInfoAsync (doc, doc.Editor);
+
+ if (info.Node?.Parent.IsKind (SyntaxKind.SimpleBaseType) != true)
+ return null;
+
+ return info;
+ }
+
+ void FindImplementingSymbols (Compilation compilation, RefactoringSymbolInfo info)
+ {
+ var interfaceType = info.Symbol as ITypeSymbol;
+ if (interfaceType == null)
+ return;
+
+ Task.Run (delegate {
+ using (var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true)) {
+ var parentTypeNode = info.Node?.Parent?.Parent?.Parent;
+ if (parentTypeNode == null)
+ return;
+ var implementingType = info.Model.GetDeclaredSymbol (parentTypeNode) as INamedTypeSymbol;
+ if (implementingType == null)
+ return;
+ foreach (var interfaceMember in interfaceType.GetMembers ()) {
+ var impl = implementingType.FindImplementationForInterfaceMember (interfaceMember);
+ if (impl == null)
+ continue;
+ var loc = impl.Locations.First ();
+ monitor.ReportResult (new MemberReference (impl, loc.SourceTree.FilePath, loc.SourceSpan.Start, loc.SourceSpan.Length));
+ }
+ foreach (var iFace in interfaceType.AllInterfaces) {
+
+ foreach (var interfaceMember in iFace.GetMembers ()) {
+ var impl = implementingType.FindImplementationForInterfaceMember (interfaceMember);
+ if (impl == null)
+ continue;
+ var loc = impl.Locations.First ();
+ monitor.ReportResult (new MemberReference (impl, loc.SourceTree.FilePath, loc.SourceSpan.Start, loc.SourceSpan.Length));
+ }
+ }
+
+ }
+ });
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindMemberOverloadsHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindMemberOverloadsHandler.cs
new file mode 100644
index 0000000000..3b4dd9fbae
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Navigation/FindMemberOverloadsHandler.cs
@@ -0,0 +1,100 @@
+//
+// FindMemberOverloadsHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using MonoDevelop.Ide;
+using MonoDevelop.Ide.FindInFiles;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Core;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Refactoring;
+using ICSharpCode.NRefactory6.CSharp;
+
+namespace MonoDevelop.CSharp.Navigation
+{
+ class FindMemberOverloadsHandler : CommandHandler
+ {
+ public static bool CanFindMemberOverloads (ISymbol symbol, out string description)
+ {
+ switch (symbol.Kind) {
+ case SymbolKind.Method:
+ description = GettextCatalog.GetString ("Find Method Overloads");
+ return symbol.ContainingType.GetMembers (symbol.Name).OfType<IMethodSymbol> ().Count () > 1;
+ case SymbolKind.Property:
+ description = GettextCatalog.GetString ("Find Indexer Overloads");
+ return symbol.ContainingType.GetMembers ().OfType<IPropertySymbol> () .Where (p => p.IsIndexer).Count () > 1;
+ default:
+ description = null;
+ return false;
+ }
+ }
+
+ public static void FindOverloads (ISymbol symbol)
+ {
+ using (var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true)) {
+ switch (symbol.Kind) {
+ case SymbolKind.Method:
+ foreach (var method in symbol.ContainingType.GetMembers (symbol.Name).OfType<IMethodSymbol> ()) {
+ foreach (var loc in method.Locations)
+ monitor.ReportResult (new MemberReference (method, loc.SourceTree.FilePath, loc.SourceSpan.Start, loc.SourceSpan.Length));
+ }
+ break;
+ case SymbolKind.Property:
+ foreach (var property in symbol.ContainingType.GetMembers ().OfType<IPropertySymbol> () .Where (p => p.IsIndexer)) {
+ foreach (var loc in property.Locations)
+ monitor.ReportResult (new MemberReference (property, loc.SourceTree.FilePath, loc.SourceSpan.Start, loc.SourceSpan.Length));
+ }
+ break;
+
+ }
+ }
+ }
+
+ protected override async void Update (CommandInfo info)
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ if (doc == null) {
+ info.Enabled = false;
+ return;
+ }
+ var symInfo = await RefactoringSymbolInfo.GetSymbolInfoAsync (doc, doc.Editor);
+ var sym = symInfo.Symbol ?? symInfo.DeclaredSymbol;
+ info.Enabled = sym != null && (sym.IsKind (SymbolKind.Method) || sym.IsKind (SymbolKind.Property) && ((IPropertySymbol)sym).IsIndexer);
+ info.Bypass = !info.Enabled;
+ }
+
+ protected async override void Run ()
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ if (doc == null || doc.FileName == FilePath.Null)
+ return;
+ var info = await RefactoringSymbolInfo.GetSymbolInfoAsync (doc, doc.Editor);
+ var sym = info.Symbol ?? info.DeclaredSymbol;
+ if (sym != null)
+ FindOverloads (sym);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/CSharpFoldingParser.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/CSharpFoldingParser.cs
index f87390b709..776abe4a87 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/CSharpFoldingParser.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/CSharpFoldingParser.cs
@@ -26,9 +26,7 @@
using System;
using System.Collections.Generic;
using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.CSharp;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.CSharp.Parser
{
@@ -94,14 +92,14 @@ namespace MonoDevelop.CSharp.Parser
public unsafe ParsedDocument Parse (string fileName, string content)
{
- var regionStack = new Stack<Tuple<string, TextLocation>> ();
+ var regionStack = new Stack<Tuple<string, DocumentLocation>> ();
var result = new DefaultParsedDocument (fileName);
bool inSingleComment = false, inMultiLineComment = false;
bool inString = false, inVerbatimString = false;
bool inChar = false;
bool inLineStart = true, hasStartedAtLine = false;
int line = 1, column = 1;
- var startLoc = TextLocation.Empty;
+ var startLoc = DocumentLocation.Empty;
fixed (char* startPtr = content) {
char* endPtr = startPtr + content.Length;
@@ -116,7 +114,7 @@ namespace MonoDevelop.CSharp.Parser
ptr++;
if (StartsIdentifier (ptr, endPtr, "region")) {
- var regionLocation = new TextLocation (line, column);
+ var regionLocation = new DocumentLocation (line, column);
column++;
ptr += "region".Length;
column += "region".Length;
@@ -131,7 +129,7 @@ namespace MonoDevelop.CSharp.Parser
var beginRegion = regionStack.Pop ();
result.Add (new FoldingRegion (
beginRegion.Item1,
- new DomRegion (beginRegion.Item2.Line, beginRegion.Item2.Column, line, column),
+ new DocumentRegion (beginRegion.Item2.Line, beginRegion.Item2.Column, line, column),
FoldType.UserRegion,
true));
}
@@ -150,14 +148,14 @@ namespace MonoDevelop.CSharp.Parser
if (nextCh == '/') {
hasStartedAtLine = inLineStart;
beginPtr = ptr + 2;
- startLoc = new TextLocation (line, column);
+ startLoc = new DocumentLocation (line, column);
ptr++;
column++;
inSingleComment = true;
} else if (nextCh == '*') {
hasStartedAtLine = inLineStart;
beginPtr = ptr + 2;
- startLoc = new TextLocation (line, column);
+ startLoc = new DocumentLocation (line, column);
ptr++;
column++;
inMultiLineComment = true;
@@ -175,7 +173,7 @@ namespace MonoDevelop.CSharp.Parser
column += 2;
inMultiLineComment = false;
result.Add (new MonoDevelop.Ide.TypeSystem.Comment () {
- Region = new DomRegion (startLoc, new TextLocation (line, column)),
+ Region = new DocumentRegion (startLoc, new DocumentLocation (line, column)),
OpenTag = "/*",
CommentType = MonoDevelop.Ide.TypeSystem.CommentType.Block,
Text = content.Substring ((int)(beginPtr - startPtr), (int)(ptr - beginPtr)),
@@ -202,7 +200,7 @@ namespace MonoDevelop.CSharp.Parser
beginPtr++;
result.Add (new MonoDevelop.Ide.TypeSystem.Comment () {
- Region = new DomRegion (startLoc, new TextLocation (line, column)),
+ Region = new DocumentRegion (startLoc, new DocumentLocation (line, column)),
CommentType = MonoDevelop.Ide.TypeSystem.CommentType.SingleLine,
OpenTag = "//",
Text = content.Substring ((int)(beginPtr - startPtr), (int)(ptr - beginPtr)),
@@ -254,7 +252,7 @@ namespace MonoDevelop.CSharp.Parser
ptr++;
}
}
- foreach (var fold in result.Comments.ToFolds ()) {
+ foreach (var fold in result.GetCommentsAsync().Result.ToFolds ()) {
result.Add (fold);
}
return result;
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/CSharpParsedDocument.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/CSharpParsedDocument.cs
new file mode 100644
index 0000000000..6a0a9fda1b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/CSharpParsedDocument.cs
@@ -0,0 +1,484 @@
+//
+// CSharpParsedDocument.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide.TypeSystem;
+using Microsoft.CodeAnalysis;
+using System.Collections.Generic;
+using System.Linq;
+using MonoDevelop.Ide.Editor;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Text;
+
+namespace MonoDevelop.CSharp.Parser
+{
+ class CSharpParsedDocument : ParsedDocument
+ {
+ static string[] tagComments;
+
+ internal SyntaxTree Unit {
+ get;
+ set;
+ }
+
+ static CSharpParsedDocument ()
+ {
+ UpdateTags ();
+ MonoDevelop.Ide.Tasks.CommentTag.SpecialCommentTagsChanged += delegate {
+ UpdateTags ();
+ };
+ }
+
+ static void UpdateTags ()
+ {
+ tagComments = MonoDevelop.Ide.Tasks.CommentTag.SpecialCommentTags.Select (t => t.Tag).ToArray ();
+ }
+
+ public CSharpParsedDocument (string fileName) : base (fileName)
+ {
+ }
+
+
+ #region implemented abstract members of ParsedDocument
+
+ IReadOnlyList<Comment> comments;
+ object commentLock = new object ();
+
+ public override Task<IReadOnlyList<Comment>> GetCommentsAsync (CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (comments == null) {
+ return Task.Run (delegate {
+ lock (commentLock) {
+ if (comments == null) {
+ var visitor = new CommentVisitor (cancellationToken);
+ if (Unit != null)
+ visitor.Visit (Unit.GetRoot (cancellationToken));
+ comments = visitor.Comments;
+ }
+ }
+ return comments;
+ });
+ }
+ return Task.FromResult (comments);
+ }
+
+
+ class CommentVisitor : CSharpSyntaxWalker
+ {
+ public readonly List<Comment> Comments = new List<Comment> ();
+
+ CancellationToken cancellationToken;
+
+ public CommentVisitor (CancellationToken cancellationToken) : base(SyntaxWalkerDepth.Trivia)
+ {
+ this.cancellationToken = cancellationToken;
+ }
+
+ static DocumentRegion GetRegion (SyntaxTrivia trivia)
+ {
+ var fullSpan = trivia.FullSpan;
+ var text = trivia.ToString ();
+ if (text.Length > 2) {
+ if (text [text.Length - 2] == '\r' && text [text.Length - 1] == '\n')
+ fullSpan = new Microsoft.CodeAnalysis.Text.TextSpan (fullSpan.Start, fullSpan.Length - 2);
+ else if (NewLine.IsNewLine (text [text.Length - 1]))
+ fullSpan = new Microsoft.CodeAnalysis.Text.TextSpan (fullSpan.Start, fullSpan.Length - 1);
+ }
+ try {
+ var lineSpan = trivia.SyntaxTree.GetLineSpan (fullSpan);
+ return (DocumentRegion)lineSpan;
+ } catch (Exception) {
+ return DocumentRegion.Empty;
+ }
+ }
+
+ public override void VisitBlock (BlockSyntax node)
+ {
+ cancellationToken.ThrowIfCancellationRequested ();
+ base.VisitBlock (node);
+ }
+
+ bool StartsLine (SyntaxTrivia trivia)
+ {
+ var sourceText = trivia.SyntaxTree.GetText (cancellationToken);
+ Microsoft.CodeAnalysis.Text.TextLine textLine;
+ try {
+ textLine = sourceText.Lines.GetLineFromPosition (trivia.SpanStart);
+ } catch (ArgumentOutOfRangeException) {
+ return false;
+ }
+ //We need start of trivia.FullSpan and not trivia.SpanStart
+ //because in case of documentation /// <summary...
+ //trivia.SpanStart is space after /// and not 1st /
+ //so with trivia.FullSpan.Start we get index of 1st /
+ var startSpan = trivia.FullSpan.Start;
+ for (int i = textLine.Start; i < startSpan; i++) {
+ char ch = sourceText [i];
+ if (!char.IsWhiteSpace (ch))
+ return false;
+ }
+ return true;
+ }
+
+ static string CropStart (string text, string crop)
+ {
+ text = text.Trim ();
+ if (text.StartsWith (crop))
+ return text.Substring (crop.Length).TrimStart ();
+ return text;
+ }
+
+ public override void VisitTrivia (SyntaxTrivia trivia)
+ {
+ base.VisitTrivia (trivia);
+ switch (trivia.Kind ()) {
+ case SyntaxKind.MultiLineCommentTrivia:
+ case SyntaxKind.MultiLineDocumentationCommentTrivia:
+ {
+ var cmt = new Comment (CropStart (trivia.ToString (), "/*"));
+ cmt.CommentStartsLine = StartsLine(trivia);
+ cmt.CommentType = CommentType.Block;
+ cmt.OpenTag = "/*";
+ cmt.ClosingTag = "*/";
+ cmt.Region = GetRegion (trivia);
+ Comments.Add (cmt);
+ break;
+ }
+ case SyntaxKind.SingleLineCommentTrivia:
+ {
+ var cmt = new Comment (CropStart (trivia.ToString (), "//"));
+ cmt.CommentStartsLine = StartsLine(trivia);
+ cmt.CommentType = CommentType.SingleLine;
+ cmt.OpenTag = "//";
+ cmt.Region = GetRegion (trivia);
+ Comments.Add (cmt);
+ break;
+ }
+ case SyntaxKind.SingleLineDocumentationCommentTrivia:
+ {
+ var cmt = new Comment (CropStart (trivia.ToString (), "///"));
+ cmt.CommentStartsLine = StartsLine(trivia);
+ cmt.IsDocumentation = true;
+ cmt.CommentType = CommentType.Documentation;
+ cmt.OpenTag = "///";
+ cmt.ClosingTag = "*/";
+ cmt.Region = GetRegion (trivia);
+ Comments.Add (cmt);
+ break;
+ }
+
+ }
+
+ }
+ }
+
+ IReadOnlyList<Tag> tags;
+ object tagLock = new object ();
+ public override Task<IReadOnlyList<Tag>> GetTagCommentsAsync (CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (tags == null) {
+ return Task.Run (delegate {
+ lock (tagLock) {
+ if (tags == null) {
+ var visitor = new SemanticTagVisitor (cancellationToken);
+ if (Unit != null) {
+ try {
+ visitor.Visit (Unit.GetRoot (cancellationToken));
+ } catch {
+ }
+ }
+ tags = visitor.Tags;
+ }
+ return tags;
+ }
+ });
+ }
+ return Task.FromResult (tags);
+ }
+
+ sealed class SemanticTagVisitor : CSharpSyntaxWalker
+ {
+ public List<Tag> Tags = new List<Tag> ();
+ CancellationToken cancellationToken;
+
+ public SemanticTagVisitor () : base (SyntaxWalkerDepth.Trivia)
+ {
+ }
+
+ public SemanticTagVisitor (CancellationToken cancellationToken) : base (SyntaxWalkerDepth.Trivia)
+ {
+ this.cancellationToken = cancellationToken;
+ }
+
+ public override void VisitBlock (BlockSyntax node)
+ {
+ cancellationToken.ThrowIfCancellationRequested ();
+ base.VisitBlock (node);
+ }
+
+ public override void VisitTrivia (SyntaxTrivia trivia)
+ {
+ cancellationToken.ThrowIfCancellationRequested ();
+ if (trivia.IsKind (SyntaxKind.SingleLineCommentTrivia) ||
+ trivia.IsKind (SyntaxKind.MultiLineCommentTrivia) ||
+ trivia.IsKind (SyntaxKind.SingleLineDocumentationCommentTrivia)) {
+ var trimmedContent = trivia.ToString ().TrimStart ('/', ' ', '*');
+ foreach (string tag in tagComments) {
+ if (!trimmedContent.StartsWith (tag, StringComparison.Ordinal))
+ continue;
+ var loc = trivia.GetLocation ().GetLineSpan ();
+ Tags.Add (new Tag (tag, trimmedContent, new DocumentRegion (loc.StartLinePosition, loc.EndLinePosition)));
+ break;
+ }
+ }
+ }
+
+ public override void VisitThrowStatement (Microsoft.CodeAnalysis.CSharp.Syntax.ThrowStatementSyntax node)
+ {
+ cancellationToken.ThrowIfCancellationRequested ();
+ base.VisitThrowStatement (node);
+ var createExpression = node.Expression as ObjectCreationExpressionSyntax;
+ if (createExpression == null)
+ return;
+ var st = createExpression.Type.ToString ();
+ if (st == "NotImplementedException" || st == "System.NotImplementedException") {
+ var loc = node.GetLocation ().GetLineSpan ();
+ if (createExpression.ArgumentList.Arguments.Count > 0) {
+ Tags.Add (new Tag ("High", GettextCatalog.GetString ("NotImplementedException({0}) thrown.", createExpression.ArgumentList.Arguments.First ().ToString ()), new DocumentRegion (loc.StartLinePosition, loc.EndLinePosition)));
+ } else {
+ Tags.Add (new Tag ("High", GettextCatalog.GetString ("NotImplementedException thrown."), new DocumentRegion (loc.StartLinePosition, loc.EndLinePosition)));
+ }
+ }
+ }
+ }
+
+ IReadOnlyList<FoldingRegion> foldings;
+ object foldingLock = new object ();
+
+ public override Task<IReadOnlyList<FoldingRegion>> GetFoldingsAsync (CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (foldings == null) {
+ return Task.Run (delegate {
+ lock (foldingLock) {
+ if (foldings == null)
+ foldings = GenerateFoldings (cancellationToken).ToList ();
+ }
+ return foldings;
+ });
+ }
+
+ return Task.FromResult (foldings);
+ }
+
+ IEnumerable<FoldingRegion> GenerateFoldings (CancellationToken cancellationToken)
+ {
+ foreach (var fold in GetCommentsAsync().Result.ToFolds ())
+ yield return fold;
+
+ var visitor = new FoldingVisitor (cancellationToken);
+ if (Unit != null) {
+ try {
+ visitor.Visit (Unit.GetRoot (cancellationToken));
+ } catch (Exception) { }
+ }
+ foreach (var fold in visitor.Foldings)
+ yield return fold;
+ }
+
+ class FoldingVisitor : CSharpSyntaxWalker
+ {
+ public readonly List<FoldingRegion> Foldings = new List<FoldingRegion> ();
+ CancellationToken cancellationToken;
+
+ public FoldingVisitor (CancellationToken cancellationToken) : base(SyntaxWalkerDepth.Trivia)
+ {
+ this.cancellationToken = cancellationToken;
+ }
+
+ void AddUsings (SyntaxNode parent)
+ {
+ SyntaxNode firstChild = null, lastChild = null;
+ foreach (var child in parent.ChildNodes ()) {
+ if (child is UsingDirectiveSyntax) {
+ if (firstChild == null) {
+ firstChild = child;
+ }
+ lastChild = child;
+ continue;
+ }
+ if (firstChild != null)
+ break;
+ }
+
+ if (firstChild != null && firstChild != lastChild) {
+ var first = firstChild.GetLocation ().GetLineSpan ();
+ var last = lastChild.GetLocation ().GetLineSpan ();
+
+ Foldings.Add (new FoldingRegion (new DocumentRegion (first.StartLinePosition, last.EndLinePosition), FoldType.Undefined));
+ }
+ }
+
+ public override void VisitCompilationUnit (Microsoft.CodeAnalysis.CSharp.Syntax.CompilationUnitSyntax node)
+ {
+ AddUsings (node);
+ base.VisitCompilationUnit (node);
+ }
+
+ void AddFolding (SyntaxToken openBrace, SyntaxToken closeBrace, FoldType type)
+ {
+ openBrace = openBrace.GetPreviousToken (false, false, true, true);
+
+ try {
+ var first = openBrace.GetLocation ().GetLineSpan ();
+ var last = closeBrace.GetLocation ().GetLineSpan ();
+
+ if (first.EndLinePosition.Line != last.EndLinePosition.Line)
+ Foldings.Add (new FoldingRegion (new DocumentRegion (first.EndLinePosition, last.EndLinePosition), type));
+ } catch (ArgumentOutOfRangeException) {}
+ }
+
+ Stack<SyntaxTrivia> regionStack = new Stack<SyntaxTrivia> ();
+ public override void VisitTrivia (SyntaxTrivia trivia)
+ {
+ base.VisitTrivia (trivia);
+ if (trivia.IsKind (SyntaxKind.RegionDirectiveTrivia)) {
+ regionStack.Push (trivia);
+ } else if (trivia.IsKind (SyntaxKind.EndRegionDirectiveTrivia)) {
+ if (regionStack.Count == 0)
+ return;
+ var regionStart = regionStack.Pop ();
+ try {
+ var first = regionStart.GetLocation ().GetLineSpan ();
+ var last = trivia.GetLocation ().GetLineSpan ();
+ var v = regionStart.ToString ();
+ v = v.Substring ("#region".Length).Trim ();
+ if (v.Length == 0)
+ v = "...";
+ Foldings.Add (new FoldingRegion(v, new DocumentRegion(first.StartLinePosition, last.EndLinePosition), FoldType.UserRegion, true));
+ } catch (ArgumentOutOfRangeException) { }
+ }
+ }
+
+ public override void VisitNamespaceDeclaration (Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax node)
+ {
+ AddUsings (node);
+ AddFolding (node.OpenBraceToken, node.CloseBraceToken, FoldType.Undefined);
+ base.VisitNamespaceDeclaration (node);
+ }
+
+ public override void VisitClassDeclaration (Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax node)
+ {
+ AddFolding (node.OpenBraceToken, node.CloseBraceToken, FoldType.Type);
+ base.VisitClassDeclaration (node);
+ }
+
+ public override void VisitStructDeclaration (Microsoft.CodeAnalysis.CSharp.Syntax.StructDeclarationSyntax node)
+ {
+ AddFolding (node.OpenBraceToken, node.CloseBraceToken, FoldType.Type);
+ base.VisitStructDeclaration (node);
+ }
+
+ public override void VisitInterfaceDeclaration (Microsoft.CodeAnalysis.CSharp.Syntax.InterfaceDeclarationSyntax node)
+ {
+ AddFolding (node.OpenBraceToken, node.CloseBraceToken, FoldType.Type);
+ base.VisitInterfaceDeclaration (node);
+ }
+
+ public override void VisitEnumDeclaration (Microsoft.CodeAnalysis.CSharp.Syntax.EnumDeclarationSyntax node)
+ {
+ AddFolding (node.OpenBraceToken, node.CloseBraceToken, FoldType.Type);
+ base.VisitEnumDeclaration (node);
+ }
+
+ public override void VisitBlock (Microsoft.CodeAnalysis.CSharp.Syntax.BlockSyntax node)
+ {
+ cancellationToken.ThrowIfCancellationRequested ();
+ AddFolding (node.OpenBraceToken, node.CloseBraceToken, node.Parent is MemberDeclarationSyntax ? FoldType.Member : FoldType.Undefined);
+ base.VisitBlock (node);
+ }
+ }
+
+ static readonly IReadOnlyList<Error> emptyErrors = new Error[0];
+ IReadOnlyList<Error> errors;
+ object errorLock = new object ();
+
+ public override Task<IReadOnlyList<Error>> GetErrorsAsync (CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var model = GetAst<SemanticModel> ();
+ if (model == null)
+ return Task.FromResult (emptyErrors);
+
+ if (errors == null) {
+ return Task.Run (delegate {
+ lock (errorLock) {
+ if (errors == null) {
+ try {
+ errors = model
+ .GetDiagnostics (null, cancellationToken)
+ .Where (diag => diag.Severity == DiagnosticSeverity.Error || diag.Severity == DiagnosticSeverity.Warning)
+ .Select ((Diagnostic diag) => new Error (GetErrorType (diag.Severity), diag.Id, diag.GetMessage (), GetRegion (diag)) { Tag = diag })
+ .ToList ();
+ } catch (OperationCanceledException) {
+ errors = emptyErrors;
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while getting diagnostics.", e);
+ errors = emptyErrors;
+ }
+ }
+ }
+ return errors;
+ });
+ }
+ return Task.FromResult (errors);
+ }
+
+ static DocumentRegion GetRegion (Diagnostic diagnostic)
+ {
+ try {
+ var lineSpan = diagnostic.Location.GetLineSpan ();
+ return new DocumentRegion (lineSpan.StartLinePosition, lineSpan.EndLinePosition);
+ } catch (Exception) {
+ return DocumentRegion.Empty;
+ }
+ }
+
+ static ErrorType GetErrorType (DiagnosticSeverity severity)
+ {
+ switch (severity) {
+ case DiagnosticSeverity.Error:
+ return ErrorType.Error;
+ case DiagnosticSeverity.Warning:
+ return ErrorType.Warning;
+ }
+ return ErrorType.Unknown;
+ }
+
+ #endregion
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/McsParser.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/McsParser.cs
index 210c70a1df..7543432221 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/McsParser.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/McsParser.cs
@@ -39,7 +39,7 @@ using System.Linq;
namespace MonoDevelop.CSharp.Parser
{
- public class McsParser : AbstractParser
+ class McsParser : AbstractParser
{
public override IExpressionFinder CreateExpressionFinder (ProjectDom dom)
{
@@ -55,7 +55,7 @@ namespace MonoDevelop.CSharp.Parser
return new NRefactoryResolver (dom, doc.CompilationUnit, ICSharpCode.OldNRefactory.SupportedLanguage.CSharp, doc.Editor, fileName);
}
- public class ErrorReportPrinter : ReportPrinter
+ class ErrorReportPrinter : ReportPrinter
{
public readonly List<Error> Errors = new List<Error> ();
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/TypeSystemProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/TypeSystemProvider.cs
index 97df6557c4..af3b7e7e4d 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/TypeSystemProvider.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/TypeSystemProvider.cs
@@ -25,375 +25,84 @@
// THE SOFTWARE.
using System;
using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.TypeSystem;
using System.Collections.Generic;
using MonoDevelop.Projects;
using MonoDevelop.CSharp.Project;
-using MonoDevelop.Ide.Tasks;
-using System.Linq;
-using ICSharpCode.NRefactory;
-using MonoDevelop.CSharp.Refactoring.CodeActions;
using MonoDevelop.Core;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using ICSharpCode.NRefactory.MonoCSharp;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
+using System.Threading.Tasks;
namespace MonoDevelop.CSharp.Parser
{
- public class TypeSystemParser : MonoDevelop.Ide.TypeSystem.TypeSystemParser
+ sealed class TypeSystemParser : MonoDevelop.Ide.TypeSystem.TypeSystemParser
{
- public override ParsedDocument Parse (bool storeAst, string fileName, System.IO.TextReader content, MonoDevelop.Projects.Project project = null)
+ public override async System.Threading.Tasks.Task<ParsedDocument> Parse (MonoDevelop.Ide.TypeSystem.ParseOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
- var parser = new ICSharpCode.NRefactory.CSharp.CSharpParser (GetCompilerArguments (project));
- parser.GenerateTypeSystemMode = !storeAst;
- var result = new ParsedDocumentDecorator ();
+ var fileName = options.FileName;
+ var project = options.Project;
+ var result = new CSharpParsedDocument (fileName);
if (project != null) {
+
var projectFile = project.Files.GetFile (fileName);
if (projectFile != null && !TypeSystemParserNode.IsCompileBuildAction (projectFile.BuildAction))
result.Flags |= ParsedDocumentFlags.NonSerializable;
}
- var tagComments = CommentTag.SpecialCommentTags.Select (t => t.Tag).ToArray ();
-
- parser.CompilationUnitCallback = delegate (CompilerCompilationUnit top) {
- foreach (var special in top.SpecialsBag.Specials) {
- var comment = special as SpecialsBag.Comment;
- if (comment != null) {
- VisitComment (result, comment, tagComments);
- } else {
- if (storeAst) {
- var ppd = special as SpecialsBag.PreProcessorDirective;
- if (ppd != null)
- VisitPreprocessorDirective (result, ppd);
- }
- }
- }
- };
-
- var unit = parser.Parse (content, fileName);
- unit.Freeze ();
- var pf = unit.ToTypeSystem ();
- try {
- pf.LastWriteTime = System.IO.File.GetLastWriteTimeUtc (fileName);
- } catch (Exception) {
- pf.LastWriteTime = DateTime.UtcNow;
- }
-
- result.LastWriteTimeUtc = pf.LastWriteTime.Value;
- result.ParsedFile = pf;
- result.Add (GetSemanticTags (unit));
-
- result.CreateRefactoringContext = delegate (MonoDevelop.Ide.Gui.Document doc, System.Threading.CancellationToken token) {
- var task = MDRefactoringContext.Create (doc, doc.Editor.Caret.Location, token);
- try {
- task.Wait (5000, token);
- } catch (AggregateException ae) {
- ae.Flatten ().Handle (aex => aex is OperationCanceledException);
- return null;
- } catch (OperationCanceledException) {
- return null;
- }
- if (!task.IsCompleted)
- return null;
- return task.Result;
- };
- result.CreateRefactoringContextWithEditor = (data, resolver, token) => new MDRefactoringContext ((DotNetProject)project, data, result, (CSharpAstResolver)resolver, TextLocation.Empty, token);
-
- if (storeAst) {
- result.Ast = unit;
- result.Add (GenerateFoldings (unit, result));
- }
- return result;
- }
-
- IEnumerable<FoldingRegion> GenerateFoldings (SyntaxTree unit, ParsedDocument doc)
- {
- foreach (var fold in doc.ConditionalRegions.ToFolds ())
- yield return fold;
-
- foreach (var fold in doc.Comments.ToFolds ())
- yield return fold;
-
- var visitor = new FoldingVisitor ();
- unit.AcceptVisitor (visitor, null);
- foreach (var fold in visitor.Foldings)
- yield return fold;
- }
-
- class FoldingVisitor : DepthFirstAstVisitor<object, object>
- {
- public readonly List<FoldingRegion> Foldings = new List<FoldingRegion> ();
+ SyntaxTree unit = null;
- void AddUsings (AstNode parent)
- {
- var firstChild = parent.Children.FirstOrDefault (child => child is UsingDeclaration || child is UsingAliasDeclaration);
- var node = firstChild;
- while (node != null) {
- var next = node.GetNextNode ();
- if (next is UsingDeclaration || next is UsingAliasDeclaration) {
- node = next;
- } else {
- break;
+ if (project != null) {
+ var curDoc = options.RoslynDocument;
+ if (curDoc == null) {
+ var curProject = TypeSystemService.GetCodeAnalysisProject (project);
+ if (curProject != null) {
+ var documentId = TypeSystemService.GetDocumentId (project, fileName);
+ if (documentId != null)
+ curDoc = curProject.GetDocument (documentId);
}
}
- if (firstChild != node) {
- Foldings.Add (new FoldingRegion (new DomRegion (firstChild.StartLocation, node.EndLocation), FoldType.Undefined));
- }
- }
- public override object VisitSyntaxTree (SyntaxTree unit, object data)
- {
- AddUsings (unit);
- return base.VisitSyntaxTree (unit, data);
- }
-
- static TextLocation CorrectEnd (AstNode token)
- {
- return new TextLocation (token.EndLocation.Line, token.EndLocation.Column + 1);
- }
-
- static bool LastToken(AstNode arg)
- {
- return !(arg.Role == Roles.NewLine || arg.Role == Roles.Whitespace || arg.Role == Roles.Comment);
- }
-
- public override object VisitNamespaceDeclaration (NamespaceDeclaration namespaceDeclaration, object data)
- {
- AddUsings (namespaceDeclaration);
- if (!namespaceDeclaration.RBraceToken.IsNull && namespaceDeclaration.LBraceToken.StartLocation.Line != namespaceDeclaration.RBraceToken.StartLocation.Line)
- Foldings.Add (new FoldingRegion (new DomRegion (namespaceDeclaration.LBraceToken.GetPrevNode (LastToken).EndLocation, CorrectEnd (namespaceDeclaration.RBraceToken)), FoldType.Undefined));
- return base.VisitNamespaceDeclaration (namespaceDeclaration, data);
- }
-
- public override object VisitTypeDeclaration (TypeDeclaration typeDeclaration, object data)
- {
- if (!typeDeclaration.RBraceToken.IsNull && typeDeclaration.LBraceToken.StartLocation.Line != typeDeclaration.RBraceToken.StartLocation.Line)
- Foldings.Add (new FoldingRegion (new DomRegion (typeDeclaration.LBraceToken.GetPrevNode (LastToken).EndLocation, CorrectEnd (typeDeclaration.RBraceToken)), FoldType.Type));
- return base.VisitTypeDeclaration (typeDeclaration, data);
- }
-
- public override object VisitMethodDeclaration (MethodDeclaration methodDeclaration, object data)
- {
- if (!methodDeclaration.Body.IsNull && methodDeclaration.Body.LBraceToken.StartLocation.Line != methodDeclaration.Body.RBraceToken.StartLocation.Line)
- Foldings.Add (new FoldingRegion (new DomRegion (methodDeclaration.Body.LBraceToken.GetPrevNode (LastToken).EndLocation, CorrectEnd (methodDeclaration.Body.RBraceToken)), FoldType.Member));
- return base.VisitMethodDeclaration (methodDeclaration, data);
- }
-
- public override object VisitConstructorDeclaration (ConstructorDeclaration constructorDeclaration, object data)
- {
- if (!constructorDeclaration.Body.IsNull && constructorDeclaration.Body.LBraceToken.StartLocation.Line != constructorDeclaration.Body.RBraceToken.StartLocation.Line)
- Foldings.Add (new FoldingRegion (new DomRegion (constructorDeclaration.Body.LBraceToken.GetPrevNode (LastToken).EndLocation, CorrectEnd (constructorDeclaration.Body.RBraceToken)), FoldType.Member));
- return base.VisitConstructorDeclaration (constructorDeclaration, data);
- }
-
- public override object VisitDestructorDeclaration (DestructorDeclaration destructorDeclaration, object data)
- {
- if (!destructorDeclaration.Body.IsNull && destructorDeclaration.Body.LBraceToken.StartLocation.Line != destructorDeclaration.Body.RBraceToken.StartLocation.Line)
- Foldings.Add (new FoldingRegion (new DomRegion (destructorDeclaration.Body.LBraceToken.GetPrevNode (LastToken).EndLocation, CorrectEnd (destructorDeclaration.Body.RBraceToken)), FoldType.Member));
- return base.VisitDestructorDeclaration (destructorDeclaration, data);
- }
-
- public override object VisitOperatorDeclaration (OperatorDeclaration operatorDeclaration, object data)
- {
- if (!operatorDeclaration.Body.IsNull && operatorDeclaration.Body.LBraceToken.StartLocation.Line != operatorDeclaration.Body.RBraceToken.StartLocation.Line)
- Foldings.Add (new FoldingRegion (new DomRegion (operatorDeclaration.Body.LBraceToken.GetPrevNode (LastToken).EndLocation, CorrectEnd (operatorDeclaration.Body.RBraceToken)), FoldType.Member));
- return base.VisitOperatorDeclaration (operatorDeclaration, data);
- }
-
- public override object VisitPropertyDeclaration (PropertyDeclaration propertyDeclaration, object data)
- {
- if (!propertyDeclaration.LBraceToken.IsNull && propertyDeclaration.LBraceToken.StartLocation.Line != propertyDeclaration.RBraceToken.StartLocation.Line)
- Foldings.Add (new FoldingRegion (new DomRegion (propertyDeclaration.LBraceToken.GetPrevNode (LastToken).EndLocation, CorrectEnd (propertyDeclaration.RBraceToken)), FoldType.Member));
- return base.VisitPropertyDeclaration (propertyDeclaration, data);
- }
-
- public override object VisitIndexerDeclaration (IndexerDeclaration indexerDeclaration, object data)
- {
- if (!indexerDeclaration.LBraceToken.IsNull && indexerDeclaration.LBraceToken.StartLocation.Line != indexerDeclaration.RBraceToken.StartLocation.Line)
- Foldings.Add (new FoldingRegion (new DomRegion (indexerDeclaration.LBraceToken.GetPrevNode (LastToken).EndLocation, CorrectEnd (indexerDeclaration.RBraceToken)), FoldType.Member));
- return base.VisitIndexerDeclaration (indexerDeclaration, data);
- }
-
- public override object VisitCustomEventDeclaration (CustomEventDeclaration eventDeclaration, object data)
- {
- if (!eventDeclaration.LBraceToken.IsNull && eventDeclaration.LBraceToken.StartLocation.Line != eventDeclaration.RBraceToken.StartLocation.Line)
- Foldings.Add (new FoldingRegion (new DomRegion (eventDeclaration.LBraceToken.GetPrevNode (LastToken).EndLocation, CorrectEnd (eventDeclaration.RBraceToken)), FoldType.Member));
- return base.VisitCustomEventDeclaration (eventDeclaration, data);
- }
-
- public override object VisitSwitchStatement (SwitchStatement switchStatement, object data)
- {
- if (!switchStatement.RBraceToken.IsNull && switchStatement.LBraceToken.StartLocation.Line != switchStatement.RBraceToken.StartLocation.Line)
- Foldings.Add (new FoldingRegion (new DomRegion (switchStatement.LBraceToken.GetPrevNode (LastToken).EndLocation, CorrectEnd (switchStatement.RBraceToken)), FoldType.Member));
- return base.VisitSwitchStatement (switchStatement, data);
- }
-
- public override object VisitBlockStatement (BlockStatement blockStatement, object data)
- {
- if (!(blockStatement.Parent is EntityDeclaration) && blockStatement.EndLocation.Line - blockStatement.StartLocation.Line > 2) {
- Foldings.Add (new FoldingRegion (new DomRegion (blockStatement.GetPrevNode (LastToken).EndLocation, CorrectEnd (blockStatement.RBraceToken)), FoldType.Undefined));
- }
-
- return base.VisitBlockStatement (blockStatement, data);
- }
- }
-
- static IEnumerable<Tag> GetSemanticTags (SyntaxTree unit)
- {
- var visitor = new SemanticTagVisitor ();
- unit.AcceptVisitor (visitor);
- foreach (var fold in visitor.Tags)
- yield return fold;
- }
-
- public class SemanticTagVisitor : DepthFirstAstVisitor
- {
- public List<Tag> Tags = new List<Tag> ();
-
- public override void VisitThrowStatement (ThrowStatement throwStatement)
- {
- var createExpression = throwStatement.Expression as ObjectCreateExpression;
- if (createExpression == null)
- return;
- var st = createExpression.Type as SimpleType;
- var mt = createExpression.Type as MemberType;
- if (st != null && st.Identifier == "NotImplementedException" ||
- mt != null && mt.MemberName == "NotImplementedException" && mt.Target.ToString () == "System") {
-
- if (createExpression.Arguments.Any ()) {
- Tags.Add (new Tag ("High", GettextCatalog.GetString ("NotImplementedException({0}) thrown.", createExpression.Arguments.First ().ToString ()), new DomRegion (throwStatement.StartLocation, throwStatement.EndLocation)));
- } else {
- Tags.Add (new Tag ("High", GettextCatalog.GetString ("NotImplementedException thrown."), new DomRegion (throwStatement.StartLocation, throwStatement.EndLocation)));
+ if (curDoc != null) {
+ try {
+ var model = await curDoc.GetSemanticModelAsync (cancellationToken).ConfigureAwait (false);
+ unit = model.SyntaxTree;
+ result.Ast = model;
+ } catch (AggregateException ae) {
+ ae.Flatten ().Handle (x => x is OperationCanceledException);
+ return result;
+ } catch (OperationCanceledException) {
+ return result;
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while getting the semantic model for " + fileName, e);
}
}
}
- }
- void VisitMcsUnit ()
- {
- }
-
- void VisitComment (ParsedDocument result, SpecialsBag.Comment comment, string[] tagComments)
- {
- var cmt = new MonoDevelop.Ide.TypeSystem.Comment (comment.Content);
- cmt.CommentStartsLine = comment.StartsLine;
- switch (comment.CommentType) {
- case SpecialsBag.CommentType.Multi:
- cmt.CommentType = MonoDevelop.Ide.TypeSystem.CommentType.Block;
- cmt.OpenTag = "/*";
- cmt.ClosingTag = "*/";
- break;
- case SpecialsBag.CommentType.Single:
- cmt.CommentType = MonoDevelop.Ide.TypeSystem.CommentType.SingleLine;
- cmt.OpenTag = "//";
- break;
- case SpecialsBag.CommentType.Documentation:
- cmt.CommentType = MonoDevelop.Ide.TypeSystem.CommentType.Documentation;
- cmt.IsDocumentation = true;
- cmt.OpenTag = "///";
- break;
- }
- cmt.Region = new DomRegion (comment.Line, comment.Col, comment.EndLine, comment.EndCol);
- result.Comments.Add (cmt);
- var trimmedContent = comment.Content.TrimStart ();
- foreach (string tag in tagComments) {
- if (!trimmedContent.StartsWith (tag))
- continue;
- result.Add (new Tag (tag, comment.Content, cmt.Region));
- }
- }
-
- Stack<SpecialsBag.PreProcessorDirective> regions = new Stack<SpecialsBag.PreProcessorDirective> ();
- Stack<SpecialsBag.PreProcessorDirective> ifBlocks = new Stack<SpecialsBag.PreProcessorDirective> ();
- List<SpecialsBag.PreProcessorDirective> elifBlocks = new List<SpecialsBag.PreProcessorDirective> ();
- SpecialsBag.PreProcessorDirective elseBlock = null;
-
- Stack<ConditionalRegion> conditionalRegions = new Stack<ConditionalRegion> ();
- ConditionalRegion ConditionalRegion {
- get {
- return conditionalRegions.Count > 0 ? conditionalRegions.Peek () : null;
- }
- }
+ if (unit == null) {
+ var compilerArguments = GetCompilerArguments (project);
+ unit = CSharpSyntaxTree.ParseText (SourceText.From (options.Content.Text), compilerArguments, fileName);
+ }
- void CloseConditionBlock (TextLocation loc)
- {
- if (ConditionalRegion == null || ConditionalRegion.ConditionBlocks.Count == 0 || !ConditionalRegion.ConditionBlocks[ConditionalRegion.ConditionBlocks.Count - 1].End.IsEmpty)
- return;
- ConditionalRegion.ConditionBlocks[ConditionalRegion.ConditionBlocks.Count - 1].End = loc;
- }
+ result.Unit = unit;
- void AddCurRegion (ParsedDocument result, int line, int col)
- {
- if (ConditionalRegion == null)
- return;
- ConditionalRegion.End = new TextLocation (line, col);
- result.Add (ConditionalRegion);
- conditionalRegions.Pop ();
- }
-
- void VisitPreprocessorDirective (ParsedDocument result, SpecialsBag.PreProcessorDirective directive)
- {
- TextLocation loc = new TextLocation (directive.Line, directive.Col);
- switch (directive.Cmd) {
- case Tokenizer.PreprocessorDirective.If:
- conditionalRegions.Push (new ConditionalRegion (directive.Arg));
- ifBlocks.Push (directive);
- ConditionalRegion.Start = loc;
- break;
- case Tokenizer.PreprocessorDirective.Elif:
- CloseConditionBlock (new TextLocation (directive.EndLine, directive.EndCol));
- if (ConditionalRegion != null)
- ConditionalRegion.ConditionBlocks.Add (new ConditionBlock (directive.Arg, loc));
- break;
- case Tokenizer.PreprocessorDirective.Else:
- CloseConditionBlock (new TextLocation (directive.EndLine, directive.EndCol));
- if (ConditionalRegion != null)
- ConditionalRegion.ElseBlock = new DomRegion (loc, TextLocation.Empty);
- break;
- case Tokenizer.PreprocessorDirective.Endif:
- TextLocation endLoc = new TextLocation (directive.EndLine, directive.EndCol);
- CloseConditionBlock (endLoc);
- if (ConditionalRegion != null && !ConditionalRegion.ElseBlock.Begin.IsEmpty)
- ConditionalRegion.ElseBlock = new DomRegion (ConditionalRegion.ElseBlock.Begin, endLoc);
- AddCurRegion (result, directive.EndLine, directive.EndCol);
- if (ifBlocks.Count > 0) {
- var ifBlock = ifBlocks.Pop ();
- var ifRegion = new DomRegion (ifBlock.Line, ifBlock.Col, directive.EndLine, directive.EndCol);
- result.Add (new FoldingRegion ("#if " + ifBlock.Arg.Trim (), ifRegion, FoldType.UserRegion, false));
- foreach (var d in elifBlocks) {
- var elIlfRegion = new DomRegion (d.Line, d.Col, directive.EndLine, directive.EndCol);
- result.Add (new FoldingRegion ("#elif " + ifBlock.Arg.Trim (), elIlfRegion, FoldType.UserRegion, false));
- }
- if (elseBlock != null) {
- var elseBlockRegion = new DomRegion (elseBlock.Line, elseBlock.Col, elseBlock.Line, elseBlock.Col);
- result.Add (new FoldingRegion ("#else", elseBlockRegion, FoldType.UserRegion, false));
- }
- }
- elseBlock = null;
- break;
- case Tokenizer.PreprocessorDirective.Define:
- result.Add (new PreProcessorDefine (directive.Arg, loc));
- break;
- case Tokenizer.PreprocessorDirective.Region:
- regions.Push (directive);
- break;
- case Tokenizer.PreprocessorDirective.Endregion:
- if (regions.Count > 0) {
- var start = regions.Pop ();
- DomRegion dr = new DomRegion (start.Line, start.Col, directive.EndLine, directive.EndCol);
- result.Add (new FoldingRegion (start.Arg, dr, FoldType.UserRegion, true));
- }
- break;
+ DateTime time;
+ try {
+ time = System.IO.File.GetLastWriteTimeUtc (fileName);
+ } catch (Exception) {
+ time = DateTime.UtcNow;
}
+ result.LastWriteTimeUtc = time;
+ return result;
}
- public static ICSharpCode.NRefactory.CSharp.CompilerSettings GetCompilerArguments (MonoDevelop.Projects.Project project)
+ public static CSharpParseOptions GetCompilerArguments (MonoDevelop.Projects.Project project)
{
- var compilerArguments = new ICSharpCode.NRefactory.CSharp.CompilerSettings ();
+ var compilerArguments = new CSharpParseOptions ();
// compilerArguments.TabSize = 1;
if (project == null || MonoDevelop.Ide.IdeApp.Workspace == null) {
- compilerArguments.AllowUnsafeBlocks = true;
+ // compilerArguments.AllowUnsafeBlocks = true;
return compilerArguments;
}
@@ -401,69 +110,54 @@ namespace MonoDevelop.CSharp.Parser
if (configuration == null)
return compilerArguments;
- foreach (var sym in configuration.GetDefineSymbols ())
- compilerArguments.ConditionalSymbols.Add (sym);
+ compilerArguments = compilerArguments.WithPreprocessorSymbols (configuration.GetDefineSymbols ());
var par = configuration.CompilationParameters as CSharpCompilerParameters;
if (par == null)
return compilerArguments;
-
- compilerArguments.AllowUnsafeBlocks = par.UnsafeCode;
- compilerArguments.LanguageVersion = ConvertLanguageVersion (par.LangVersion);
- compilerArguments.CheckForOverflow = par.GenerateOverflowChecks;
- compilerArguments.WarningLevel = par.WarningLevel;
- compilerArguments.TreatWarningsAsErrors = par.TreatWarningsAsErrors;
- if (!string.IsNullOrEmpty (par.NoWarnings)) {
- foreach (var warning in par.NoWarnings.Split (';', ',', ' ', '\t')) {
- int w;
- try {
- w = int.Parse (warning);
- } catch (Exception) {
- continue;
- }
- compilerArguments.DisabledWarnings.Add (w);
- }
- }
+
+
+ // compilerArguments.AllowUnsafeBlocks = par.UnsafeCode;
+ compilerArguments = compilerArguments.WithLanguageVersion (ConvertLanguageVersion (par.LangVersion));
+// compilerArguments.CheckForOverflow = par.GenerateOverflowChecks;
+
+// compilerArguments.WarningLevel = par.WarningLevel;
+// compilerArguments.TreatWarningsAsErrors = par.TreatWarningsAsErrors;
+// if (!string.IsNullOrEmpty (par.NoWarnings)) {
+// foreach (var warning in par.NoWarnings.Split (';', ',', ' ', '\t')) {
+// int w;
+// try {
+// w = int.Parse (warning);
+// } catch (Exception) {
+// continue;
+// }
+// compilerArguments.DisabledWarnings.Add (w);
+// }
+// }
return compilerArguments;
}
- internal static Version ConvertLanguageVersion (LangVersion ver)
+ internal static Microsoft.CodeAnalysis.CSharp.LanguageVersion ConvertLanguageVersion (LangVersion ver)
{
switch (ver) {
case LangVersion.ISO_1:
- return new Version (1, 0, 0, 0);
+ return Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp1;
case LangVersion.ISO_2:
- return new Version (2, 0, 0, 0);
+ return Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp2;
case LangVersion.Version3:
- return new Version (3, 0, 0, 0);
+ return Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp3;
case LangVersion.Version4:
- return new Version (4, 0, 0, 0);
+ return Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp4;
case LangVersion.Version5:
- return new Version (5, 0, 0, 0);
+ return Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp5;
case LangVersion.Version6:
- return new Version (6, 0, 0, 0);
+ return Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp6;
case LangVersion.Default:
break;
}
- return new Version (6, 0, 0, 0);;
+ return Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp6;
}
}
-
- static class FoldingUtils
- {
- public static IEnumerable<FoldingRegion> ToFolds (this IEnumerable<ConditionalRegion> conditionalRegions)
- {
- foreach (ConditionalRegion region in conditionalRegions) {
- yield return new FoldingRegion ("#if " + region.Flag, region.Region, FoldType.ConditionalDefine);
- foreach (ConditionBlock block in region.ConditionBlocks) {
- yield return new FoldingRegion ("#elif " + block.Flag, block.Region,
- FoldType.ConditionalDefine);
- }
- if (!region.ElseBlock.IsEmpty)
- yield return new FoldingRegion ("#else", region.ElseBlock, FoldType.ConditionalDefine);
- }
- }
- }
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CSharpCompilerParameters.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CSharpCompilerParameters.cs
index 88dcd74b8a..084ae9be42 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CSharpCompilerParameters.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CSharpCompilerParameters.cs
@@ -33,6 +33,10 @@ using MonoDevelop.Core.Serialization;
using MonoDevelop.Core;
using Mono.Collections.Generic;
using System.Linq;
+using MonoDevelop.Projects.MSBuild;
+using System.Collections.Immutable;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
namespace MonoDevelop.CSharp.Project
{
@@ -49,18 +53,16 @@ namespace MonoDevelop.CSharp.Project
/// <summary>
/// This class handles project specific compiler parameters
/// </summary>
- public class CSharpCompilerParameters: DotNetConfigurationParameters
+ public class CSharpCompilerParameters: DotNetCompilerParameters
{
// Configuration parameters
-
- [ItemProperty ("WarningLevel")]
- int warninglevel = 4;
+
+ int? warninglevel = 4;
[ItemProperty ("NoWarn", DefaultValue = "")]
string noWarnings = String.Empty;
- [ItemProperty ("Optimize")]
- bool optimize;
+ bool? optimize = false;
[ItemProperty ("AllowUnsafeBlocks", DefaultValue = false)]
bool unsafecode = false;
@@ -89,63 +91,74 @@ namespace MonoDevelop.CSharp.Project
[ItemProperty("WarningsNotAsErrors", DefaultValue="")]
string warningsNotAsErrors = "";
- [ItemProperty("DebugType", DefaultValue="")]
- string debugType = "";
-
- #region Members required for backwards compatibility. Not used for anything else.
-
- [ItemProperty ("StartupObject", DefaultValue = null)]
- internal string mainclass;
-
- [ProjectPathItemProperty ("ApplicationIcon", DefaultValue = null)]
- internal string win32Icon;
+ protected override void Write (IPropertySet pset)
+ {
+ pset.SetPropertyOrder ("DebugSymbols", "DebugType", "Optimize", "OutputPath", "DefineConstants", "ErrorReport", "WarningLevel", "TreatWarningsAsErrors", "DocumentationFile");
- [ProjectPathItemProperty ("Win32Resource", DefaultValue = null)]
- internal string win32Resource;
-
- [ItemProperty ("CodePage", DefaultValue = null)]
- internal string codePage;
+ base.Write (pset);
- [ItemProperty ("GenerateDocumentation", DefaultValue = null)]
- bool? generateXmlDocumentation = null;
-
- #endregion
-
-
- protected override void OnEndLoad ()
+ if (optimize.HasValue)
+ pset.SetValue ("Optimize", optimize.Value);
+ if (warninglevel.HasValue)
+ pset.SetValue ("WarningLevel", warninglevel.Value);
+ }
+
+ protected override void Read (IPropertySet pset)
{
- base.OnEndLoad ();
-
- // Backwards compatibility. Move parameters to the project parameters object
- if (ParentConfiguration != null && ParentConfiguration.ProjectParameters != null) {
- CSharpProjectParameters cparams = (CSharpProjectParameters) ParentConfiguration.ProjectParameters;
- if (win32Icon != null) {
- cparams.Win32Icon = win32Icon;
- win32Icon = null;
- }
- if (win32Resource != null) {
- cparams.Win32Resource = win32Resource;
- win32Resource = null;
- }
- if (mainclass != null) {
- cparams.MainClass = mainclass;
- mainclass = null;
- }
- if (!string.IsNullOrEmpty (codePage)) {
- cparams.CodePage = int.Parse (codePage);
- codePage = null;
- }
- }
+ base.Read (pset);
- if (generateXmlDocumentation.HasValue && ParentConfiguration != null) {
- if (generateXmlDocumentation.Value)
+ var prop = pset.GetProperty ("GenerateDocumentation");
+ if (prop != null && documentationFile != null) {
+ if (prop.GetValue<bool> ())
documentationFile = ParentConfiguration.CompiledOutputName.ChangeExtension (".xml");
else
documentationFile = null;
- generateXmlDocumentation = null;
}
+
+ optimize = pset.GetValue ("Optimize", (bool?)null);
+ warninglevel = pset.GetValue<int?> ("WarningLevel", null);
}
-
+
+ public override CompilationOptions CreateCompilationOptions ()
+ {
+ var project = (CSharpProject) ParentProject;
+ return new CSharpCompilationOptions (
+ OutputKind.ConsoleApplication,
+ false,
+ null,
+ project.MainClass,
+ "Script",
+ null,
+ OptimizationLevel.Debug,
+ GenerateOverflowChecks,
+ UnsafeCode,
+ null,
+ ParentConfiguration.SignAssembly ? ParentConfiguration.AssemblyKeyFile : null,
+ ImmutableArray<byte>.Empty,
+ null,
+ Microsoft.CodeAnalysis.Platform.AnyCpu,
+ ReportDiagnostic.Default,
+ WarningLevel,
+ null,
+ false,
+ assemblyIdentityComparer: DesktopAssemblyIdentityComparer.Default,
+ strongNameProvider: new DesktopStrongNameProvider ()
+ );
+ }
+
+ public override Microsoft.CodeAnalysis.ParseOptions CreateParseOptions (DotNetProjectConfiguration configuration)
+ {
+ var symbols = GetDefineSymbols ();
+ if (configuration != null)
+ symbols = symbols.Concat (configuration.GetDefineSymbols ()).Distinct ();
+ return new Microsoft.CodeAnalysis.CSharp.CSharpParseOptions (
+ GetRoslynLanguageVersion (langVersion),
+ Microsoft.CodeAnalysis.DocumentationMode.Parse,
+ Microsoft.CodeAnalysis.SourceCodeKind.Regular,
+ ImmutableArray<string>.Empty.AddRange (symbols)
+ );
+ }
+
public LangVersion LangVersion {
get {
@@ -166,7 +179,6 @@ namespace MonoDevelop.CSharp.Project
#region Code Generation
- [Obsolete]
public override void AddDefineSymbol (string symbol)
{
var symbols = new List<string> (GetDefineSymbols ());
@@ -176,10 +188,9 @@ namespace MonoDevelop.CSharp.Project
public override IEnumerable<string> GetDefineSymbols ()
{
- return definesymbols.Split (';', ',', ' ', '\t').Where (s => !string.IsNullOrWhiteSpace (s));
+ return definesymbols.Split (';', ',', ' ', '\t').Where (s => SyntaxFacts.IsValidIdentifier (s) && !string.IsNullOrWhiteSpace (s));
}
- [Obsolete]
public override void RemoveDefineSymbol (string symbol)
{
var symbols = new List<string> (GetDefineSymbols ());
@@ -202,10 +213,11 @@ namespace MonoDevelop.CSharp.Project
public bool Optimize {
get {
- return optimize;
+ return optimize ?? false;
}
set {
- optimize = value;
+ if (value != Optimize)
+ optimize = value;
}
}
@@ -245,24 +257,20 @@ namespace MonoDevelop.CSharp.Project
}
}
- public override string DebugType {
- get {
- return debugType;
- }
- set {
- debugType = value;
- }
- }
-
#endregion
#region Errors and Warnings
public int WarningLevel {
get {
- return warninglevel;
+ return warninglevel ?? 4;
}
set {
- warninglevel = value;
+ if (warninglevel.HasValue) {
+ warninglevel = value;
+ } else {
+ if (value != 4)
+ warninglevel = value;
+ }
}
}
@@ -317,6 +325,19 @@ namespace MonoDevelop.CSharp.Project
}
}
+ Microsoft.CodeAnalysis.CSharp.LanguageVersion GetRoslynLanguageVersion (string value)
+ {
+ switch (value) {
+ case "ISO-1": return Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp1;
+ case "ISO-2": return Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp2;
+ case "3": return Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp3;
+ case "4": return Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp4;
+ case "5": return Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp5;
+ case "6": return Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp6;
+ default: return Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp6;
+ }
+ }
+
internal static string TryLangVersionToString (LangVersion value)
{
switch (value) {
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CSharpProjectExtension.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CSharpProjectExtension.cs
new file mode 100644
index 0000000000..8f87cc1e5a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CSharpProjectExtension.cs
@@ -0,0 +1,187 @@
+//
+// CSharpProjectExtension.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Projects;
+using MonoDevelop.Projects.MSBuild;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Serialization;
+using MonoDevelop.Projects.Extensions;
+using System.Collections.Generic;
+using MonoDevelop.Core.Instrumentation;
+
+namespace MonoDevelop.CSharp.Project
+{
+ class CSharpProject: DotNetProject, ICSharpProject
+ {
+ [ItemProperty ("StartupObject", DefaultValue = "")]
+ string mainclass = string.Empty;
+
+ [ProjectPathItemProperty ("ApplicationIcon", DefaultValue = "")]
+ string win32Icon = String.Empty;
+
+ [ProjectPathItemProperty ("Win32Resource", DefaultValue = "")]
+ string win32Resource = String.Empty;
+
+ [ItemProperty ("CodePage", DefaultValue = 0)]
+ int codePage;
+
+ // Keep the platforms combo of CodeGenerationPanelWidget in sync with this list
+ public static IList<string> SupportedPlatforms = new string[] { "anycpu", "x86", "x64", "itanium" };
+
+ static CSharpProject ()
+ {
+ ProjectSearchCategory.Init ();
+ }
+
+ public CSharpProject ()
+ {
+ Initialize (this);
+ }
+
+ protected override void OnInitialize ()
+ {
+ base.OnInitialize ();
+ SupportsRoslyn = true;
+ StockIcon = "md-csharp-project";
+ }
+
+ protected override void OnGetDefaultImports (List<string> imports)
+ {
+ base.OnGetDefaultImports (imports);
+ imports.Add ("$(MSBuildBinPath)\\Microsoft.CSharp.targets");
+ }
+
+ public string MainClass {
+ get {
+ return mainclass;
+ }
+ set {
+ mainclass = value ?? string.Empty;
+ }
+ }
+
+ public int CodePage {
+ get {
+ return codePage;
+ }
+ set {
+ codePage = value;
+ }
+ }
+
+ public string Win32Icon {
+ get {
+ return win32Icon;
+ }
+ set {
+ win32Icon = value ?? string.Empty;
+ }
+ }
+
+ public string Win32Resource {
+ get {
+ return win32Resource;
+ }
+ set {
+ win32Resource = value ?? string.Empty;
+ }
+ }
+
+ protected override void OnReadConfiguration (ProgressMonitor monitor, ProjectConfiguration config, IPropertySet pset)
+ {
+ base.OnReadConfiguration (monitor, config, pset);
+
+ // Backwards compatibility. Move parameters to the project parameters object
+
+ var prop = pset.GetProperty ("ApplicationIcon");
+ if (prop != null)
+ win32Icon = prop.GetPathValue ();
+
+ prop = pset.GetProperty ("Win32Resource");
+ if (prop != null)
+ win32Resource = prop.GetPathValue ();
+
+ prop = pset.GetProperty ("StartupObject");
+ if (prop != null)
+ mainclass = prop.Value;
+
+ prop = pset.GetProperty ("CodePage");
+ if (prop != null)
+ codePage = int.Parse (prop.Value);
+ }
+
+ protected override BuildResult OnCompileSources (ProjectItemCollection items, DotNetProjectConfiguration configuration, ConfigurationSelector configSelector, ProgressMonitor monitor)
+ {
+ return CSharpBindingCompilerManager.Compile (items, configuration, configSelector, monitor);
+ }
+
+ protected override DotNetCompilerParameters OnCreateCompilationParameters (DotNetProjectConfiguration config, ConfigurationKind kind)
+ {
+ var pars = new CSharpCompilerParameters ();
+ if (SupportedPlatforms.Contains (config.Platform))
+ pars.PlatformTarget = config.Platform;
+
+ if (kind == ConfigurationKind.Debug)
+ pars.AddDefineSymbol ("DEBUG");
+ else if (kind == ConfigurationKind.Release)
+ pars.Optimize = true;
+ return pars;
+ }
+
+ protected override ClrVersion[] OnGetSupportedClrVersions ()
+ {
+ return new ClrVersion[] {
+ ClrVersion.Net_1_1,
+ ClrVersion.Net_2_0,
+ ClrVersion.Clr_2_1,
+ ClrVersion.Net_4_0,
+ ClrVersion.Net_4_5
+ };
+ }
+
+ protected override string OnGetDefaultResourceId (ProjectFile projectFile)
+ {
+ return CSharpResourceIdBuilder.GetDefaultResourceId (projectFile) ?? base.OnGetDefaultResourceId (projectFile);
+ }
+ }
+
+ public interface ICSharpProject
+ {
+ string MainClass { get; set; }
+
+ int CodePage { get; set; }
+
+ string Win32Icon { get; set; }
+
+ string Win32Resource { get; set; }
+ }
+
+ internal static class Counters
+ {
+ public static Counter ResolveTime = InstrumentationService.CreateCounter ("Resolve Time", "Timing");
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CSharpProjectParameters.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CSharpProjectParameters.cs
deleted file mode 100644
index 7e010c0de6..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CSharpProjectParameters.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// ProjectParameters.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using MonoDevelop.Core.Serialization;
-using MonoDevelop.Projects;
-
-namespace MonoDevelop.CSharp.Project
-{
- public class CSharpProjectParameters: ProjectParameters
- {
- [ItemProperty ("StartupObject", DefaultValue = "")]
- string mainclass = string.Empty;
-
- [ProjectPathItemProperty ("ApplicationIcon", DefaultValue = "")]
- string win32Icon = String.Empty;
-
- [ProjectPathItemProperty ("Win32Resource", DefaultValue = "")]
- string win32Resource = String.Empty;
-
- [ItemProperty ("CodePage", DefaultValue = 0)]
- int codePage;
-
- public string MainClass {
- get {
- return mainclass;
- }
- set {
- mainclass = value ?? string.Empty;
- }
- }
-
- public int CodePage {
- get {
- return codePage;
- }
- set {
- codePage = value;
- }
- }
-
- public string Win32Icon {
- get {
- return win32Icon;
- }
- set {
- win32Icon = value ?? string.Empty;
- }
- }
-
- public string Win32Resource {
- get {
- return win32Resource;
- }
- set {
- win32Resource = value ?? string.Empty;
- }
- }
-
- }
-}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CSharpResourceIdBuilder.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CSharpResourceIdBuilder.cs
index bd673dcfb9..83ecac0135 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CSharpResourceIdBuilder.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CSharpResourceIdBuilder.cs
@@ -34,16 +34,16 @@ using System.Globalization;
using System.IO;
using System.Text;
using MonoDevelop.Projects.Extensions;
-using MonoDevelop.Projects.Formats.MSBuild;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.CSharp.Project
{
- class CSharpResourceIdBuilder : MSBuildResourceHandler
+ class CSharpResourceIdBuilder
{
- public override string GetDefaultResourceId (ProjectFile pf)
+ public static string GetDefaultResourceId (ProjectFile pf)
{
if (String.IsNullOrEmpty (pf.DependsOn) || !File.Exists (pf.DependsOn) || Path.GetExtension (pf.DependsOn).ToLower () != ".cs")
- return base.GetDefaultResourceId (pf);
+ return null;
string ns = null;
string classname = null;
@@ -80,7 +80,7 @@ namespace MonoDevelop.CSharp.Project
}
if (classname == null)
- return base.GetDefaultResourceId (pf);
+ return null;
string culture, extn, only_filename;
if (MSBuildProjectService.TrySplitResourceName (pf.ProjectVirtualPath, out only_filename, out culture, out extn))
@@ -101,7 +101,7 @@ namespace MonoDevelop.CSharp.Project
* skips strings "foo",
* skips anything after a # , eg. #region, #if
* Won't handle #if false etc kinda blocks*/
- string GetNextToken (StreamReader sr)
+ static string GetNextToken (StreamReader sr)
{
StringBuilder sb = new StringBuilder ();
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CodeGenerationPanel.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CodeGenerationPanel.cs
index d107103c88..46f4287f6d 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CodeGenerationPanel.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CodeGenerationPanel.cs
@@ -27,8 +27,8 @@
//
using System;
+using MonoDevelop.Components;
using MonoDevelop.Projects;
-using Gtk;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.CSharp.Project
@@ -61,12 +61,12 @@ namespace MonoDevelop.CSharp.Project
warningLevelSpinButton.Value = compilerParameters.WarningLevel;
ignoreWarningsEntry.Text = compilerParameters.NoWarnings;
- int i = CSharpLanguageBinding.SupportedPlatforms.IndexOf (compilerParameters.PlatformTarget);
+ int i = CSharpProject.SupportedPlatforms.IndexOf (compilerParameters.PlatformTarget);
comboPlatforms.Active = i != -1 ? i : 0;
- if (!configuration.DebugMode || string.Equals ("none", compilerParameters.DebugType, StringComparison.OrdinalIgnoreCase)) {
+ if (!configuration.DebugSymbols || string.Equals ("none", configuration.DebugType, StringComparison.OrdinalIgnoreCase)) {
comboDebug.Active = DEBUG_NONE;
- } else if (string.Equals ("pdbonly", compilerParameters.DebugType, StringComparison.OrdinalIgnoreCase)) {
+ } else if (string.Equals ("pdbonly", configuration.DebugType, StringComparison.OrdinalIgnoreCase)) {
comboDebug.Active = DEBUG_PDB_ONLY;
} else {
comboDebug.Active = DEBUG_FULL;
@@ -91,23 +91,23 @@ namespace MonoDevelop.CSharp.Project
compilerParameters.TreatWarningsAsErrors = warningsAsErrorsCheckButton.Active;
compilerParameters.WarningLevel = warningLevelSpinButton.ValueAsInt;
compilerParameters.NoWarnings = ignoreWarningsEntry.Text;
- compilerParameters.PlatformTarget = CSharpLanguageBinding.SupportedPlatforms [comboPlatforms.Active];
+ compilerParameters.PlatformTarget = CSharpProject.SupportedPlatforms [comboPlatforms.Active];
switch (comboDebug.Active) {
case DEBUG_FULL:
- configuration.DebugMode = true;
- if (!string.Equals (compilerParameters.DebugType, "full", StringComparison.OrdinalIgnoreCase)) {
- compilerParameters.DebugType = "";
+ configuration.DebugSymbols = true;
+ if (!string.Equals (configuration.DebugType, "full", StringComparison.OrdinalIgnoreCase)) {
+ configuration.DebugType = "";
}
break;
case DEBUG_PDB_ONLY:
- configuration.DebugMode = true;
- compilerParameters.DebugType = "pdbonly";
+ configuration.DebugSymbols = true;
+ configuration.DebugType = "pdbonly";
break;
case DEBUG_NONE:
- configuration.DebugMode = false;
- if (!string.Equals (compilerParameters.DebugType, "none", StringComparison.OrdinalIgnoreCase)) {
- compilerParameters.DebugType = "";
+ configuration.DebugSymbols = false;
+ if (!string.Equals (configuration.DebugType, "none", StringComparison.OrdinalIgnoreCase)) {
+ configuration.DebugType = "";
}
break;
}
@@ -118,7 +118,7 @@ namespace MonoDevelop.CSharp.Project
{
CodeGenerationPanelWidget widget;
- public override Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
return widget = new CodeGenerationPanelWidget ();
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs
index 213c7025e0..26ebd30cca 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/CompilerOptionsPanelWidget.cs
@@ -30,13 +30,14 @@
using System;
using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Projects;
using MonoDevelop.Projects.Text;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.CSharp.Project
{
@@ -53,7 +54,7 @@ namespace MonoDevelop.CSharp.Project
this.project = project;
DotNetProjectConfiguration configuration = (DotNetProjectConfiguration) project.GetConfiguration (IdeApp.Workspace.ActiveConfiguration);
CSharpCompilerParameters compilerParameters = (CSharpCompilerParameters) configuration.CompilationParameters;
- CSharpProjectParameters projectParameters = (CSharpProjectParameters) configuration.ProjectParameters;
+ var csproject = (CSharpProject)project;
ListStore store = new ListStore (typeof (string));
store.AppendValues (GettextCatalog.GetString ("Executable"));
@@ -75,7 +76,7 @@ namespace MonoDevelop.CSharp.Project
classListStore = new ListStore (typeof(string));
mainClassEntry.Model = classListStore;
mainClassEntry.TextColumn = 0;
- ((Entry)mainClassEntry.Child).Text = projectParameters.MainClass ?? string.Empty;
+ ((Entry)mainClassEntry.Child).Text = csproject.MainClass ?? string.Empty;
UpdateTarget ();
}
@@ -85,16 +86,16 @@ namespace MonoDevelop.CSharp.Project
foreach (TextEncoding e in TextEncoding.SupportedEncodings) {
if (e.CodePage == -1)
continue;
- if (e.CodePage == projectParameters.CodePage)
+ if (e.CodePage == csproject.CodePage)
foundEncoding = e.Id;
codepageEntry.AppendText (e.Id);
}
if (foundEncoding != null)
codepageEntry.Entry.Text = foundEncoding;
- else if (projectParameters.CodePage != 0)
- codepageEntry.Entry.Text = projectParameters.CodePage.ToString ();
+ else if (csproject.CodePage != 0)
+ codepageEntry.Entry.Text = csproject.CodePage.ToString ();
- iconEntry.Path = projectParameters.Win32Icon;
+ iconEntry.Path = csproject.Win32Icon;
iconEntry.DefaultPath = project.BaseDirectory;
allowUnsafeCodeCheckButton.Active = compilerParameters.UnsafeCode;
noStdLibCheckButton.Active = compilerParameters.NoStdLib;
@@ -172,15 +173,15 @@ namespace MonoDevelop.CSharp.Project
project.CompileTarget = compileTarget;
- CSharpProjectParameters projectParameters = (CSharpProjectParameters) project.LanguageParameters;
+ var csproject = (CSharpProject)project;
- projectParameters.CodePage = codePage;
+ csproject.CodePage = codePage;
if (iconEntry.Sensitive)
- projectParameters.Win32Icon = iconEntry.Path;
+ csproject.Win32Icon = iconEntry.Path;
if (mainClassEntry.Sensitive)
- projectParameters.MainClass = mainClassEntry.Entry.Text;
+ csproject.MainClass = mainClassEntry.Entry.Text;
foreach (DotNetProjectConfiguration configuration in configs) {
CSharpCompilerParameters compilerParameters = (CSharpCompilerParameters) configuration.CompilationParameters;
@@ -209,16 +210,14 @@ namespace MonoDevelop.CSharp.Project
void FillClasses ()
{
try {
- var ctx = TypeSystemService.GetCompilation (project);
+ var ctx = TypeSystemService.GetCompilationAsync (project).Result;
if (ctx == null)
// Project not found in parser database
return;
- foreach (var c in ctx.GetAllTypeDefinitions ()) {
- if (c.Methods != null) {
- foreach (var m in c.Methods) {
- if (m.IsStatic && m.Name == "Main")
- classListStore.AppendValues (c.FullName);
- }
+ foreach (var c in ctx.Assembly.GlobalNamespace.GetTypeMembers ()) {
+ foreach (var m in c.GetMembers().OfType<IMethodSymbol> ()) {
+ if (m.IsStatic && m.Name == "Main")
+ classListStore.AppendValues (c.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat));
}
}
classListFilled = true;
@@ -232,7 +231,7 @@ namespace MonoDevelop.CSharp.Project
{
CompilerOptionsPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return (widget = new CompilerOptionsPanelWidget ((DotNetProject) ConfiguredProject));
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/PortableCSharpProjectFlavor.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/PortableCSharpProjectFlavor.cs
new file mode 100644
index 0000000000..51f262cd4b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Project/PortableCSharpProjectFlavor.cs
@@ -0,0 +1,47 @@
+//
+// PortableCSharpProjectFlavor.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Projects;
+using MonoDevelop.Core;
+using MonoDevelop.Projects.MSBuild;
+
+namespace MonoDevelop.CSharp.Project
+{
+ class PortableCSharpProjectFlavor: PortableDotNetProjectFlavor
+ {
+ protected override void Initialize ()
+ {
+ base.Initialize ();
+ Project.UseMSBuildEngine = true;
+ }
+
+ protected override void OnGetDefaultImports (System.Collections.Generic.List<string> imports)
+ {
+ imports.Add ("$(MSBuildExtensionsPath32)\\Microsoft\\Portable\\$(TargetFrameworkVersion)\\Microsoft.Portable.CSharp.targets");
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/Actions/ConvertToEnumAction.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/Actions/ConvertToEnumAction.cs
deleted file mode 100644
index 30a5296645..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/Actions/ConvertToEnumAction.cs
+++ /dev/null
@@ -1,503 +0,0 @@
-//
-// Author:
-// Luís Reis <luiscubal@gmail.com>
-//
-// Copyright (c) 2013 Luís Reis
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using ICSharpCode.NRefactory.Semantics;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem.Implementation;
-using ICSharpCode.NRefactory.PatternMatching;
-using MonoDevelop.CodeActions;
-using ICSharpCode.NRefactory;
-using System.Threading;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-using ICSharpCode.Decompiler.ILAst;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.CSharp.Refactoring.CodeActions
-{
- /// <summary>
- /// Generates an enumeration from const fields
- /// </summary>
- class ConvertToEnumAction : MonoDevelop.CodeActions.CodeActionProvider
- {
- public override IEnumerable<MonoDevelop.CodeActions.CodeAction> GetActions(MonoDevelop.Ide.Gui.Document document, object refactoringContext, TextLocation loc, CancellationToken cancellationToken)
- {
- var context = refactoringContext as MDRefactoringContext;
-
- if (context == null || context.IsInvalid)
- yield break;
-
- VariableInitializer currentVariable = context.GetNode<VariableInitializer>();
- if (currentVariable == null) {
- yield break;
- }
-
- FieldDeclaration currentField = currentVariable.Parent as FieldDeclaration;
- if (currentField == null) {
- yield break;
- }
-
- if (!currentField.Modifiers.HasFlag(Modifiers.Const)) {
- yield break;
- }
-
- PrimitiveType baseType = TypeToIntegerPrimitive(context, currentField.ReturnType);
- if (baseType == null) {
- //Can't make enums of these types
- yield break;
- }
-
- TypeDeclaration containerType = currentVariable.GetParent<TypeDeclaration>();
-
- //Get all the fields/variables that the enum can possibly cover
- //Don't check the name just yet. That'll come later.
-
- var constFields = containerType.Members.OfType<FieldDeclaration>()
- .Where(field => field.GetParent<TypeDeclaration>() == containerType && field.HasModifier(Modifiers.Const)).ToList();
-
- var constVariables = constFields.SelectMany(field => field.Variables).ToList();
-
- //Now, it's time to check the name of the selected variable
- //We'll use this to search for prefixes later
-
- var names = constVariables.Select(variable => variable.Name).ToList();
- string currentName = currentVariable.Name;
-
- //Now, find the common name prefixes
- //If the variable is called 'A_B_C_D', then 'A', 'A_B' and 'A_B_C' are
- //the potentially available prefixes.
- //Note that the common prefixes are the ones that more than one variable
- //has.
- //Each prefix has an associated action.
-
- foreach (var prefix in GetCommonPrefixes (currentName, names)) {
- string title = string.Format(GettextCatalog.GetString("Create enum '{0}'"), prefix);
-
- yield return new DefaultCodeAction(title, (ctx, script) => {
- PrepareToRunAction (prefix, baseType, containerType, constVariables, cancellationToken, ctx, script);
- });
- }
- }
-
- void PrepareToRunAction (string prefix, PrimitiveType baseType, TypeDeclaration containerType, List<VariableInitializer> variables, CancellationToken cancellationToken, RefactoringContext context, Script script)
- {
- List<string> names = variables.Select(variable => variable.Name).ToList();
- Dictionary<string, string> newNames = names.ToDictionary(originalName => originalName, originalName => {
- if (!originalName.StartsWith(prefix)) {
- return originalName;
- }
- int startName = prefix.Length;
- while (startName < originalName.Length - 1 && originalName[startName] == '_') {
- ++startName;
- }
- return originalName.Substring(startName);
- });
-
- string enumName;
- using (var dialog = new ConvertToEnumDialog (prefix, variables, variables.Where(variable => variable.Name.StartsWith(prefix, StringComparison.InvariantCulture)
- && VariableHasSpecifiedIntegerType(context, variable, baseType)).ToList(), newNames))
- {
- if (dialog.Run (/*MonoDevelop.Ide.IdeApp.Workbench.RootWindow*/) != Xwt.Command.Ok) {
- return;
- }
- enumName = dialog.EnumName;
- variables = dialog.SelectedVariables;
- newNames = dialog.NewNames;
- }
-
- RunAction (context, baseType, enumName, newNames, containerType, variables, script);
-
- }
-
- void RunAction(RefactoringContext context, AstType baseType, string enumName, Dictionary<string, string> newNames, TypeDeclaration containerTypeDeclaration, List<VariableInitializer> variables, Script script)
- {
- var names = variables.Select (variable => variable.Name).ToList ();
- var containerType = (context.Resolve(containerTypeDeclaration) as TypeResolveResult).Type;
-
- var fields = containerTypeDeclaration.Members.OfType<FieldDeclaration>().Where(field => field.Modifiers.HasFlag(Modifiers.Const)).ToList();
- List<VariableInitializer> variableUnitsToRemove = new List<VariableInitializer>(variables);
- List<FieldDeclaration> fieldsToRemove = new List<FieldDeclaration>();
-
- foreach (var field in fields) {
- if (field.Variables.All(variableUnitsToRemove.Contains)) {
- fieldsToRemove.Add(field);
-
- variableUnitsToRemove.RemoveAll(field.Variables.Contains);
- }
- }
-
- var generatedEnum = CreateEnumDeclaration(baseType, enumName, variables, names, newNames);
-
- AstNode root = GetRootNodeOf(containerTypeDeclaration);
- var newRoot = root.Clone();
-
- FixIdentifiers(context, enumName, variables, containerType, baseType, names, newNames, root, newRoot);
- foreach (var member in root.Descendants.OfType<MemberReferenceExpression>().Where (member => names.Contains (member.MemberName))) {
- if (variables.Any(variable => variable.Descendants.Contains(member))) {
- //Already handled
- continue;
- }
-
- var resolvedIdentifier = context.Resolve(member) as MemberResolveResult;
- if (resolvedIdentifier == null) {
- continue;
- }
-
- if (resolvedIdentifier.Type.Equals(containerType)) {
- continue;
- }
-
- var equivalentMember = GetEquivalentNodeFor(root, newRoot, member);
- MemberReferenceExpression memberToReplace = (MemberReferenceExpression)equivalentMember;
-
- var replacement = CreateReplacementMemberReference(enumName, baseType, newNames, memberToReplace);
- memberToReplace.ReplaceWith(replacement);
- }
-
- //Fix the file
- InsertAfterEquivalent(root, newRoot, containerTypeDeclaration.LBraceToken, generatedEnum, Roles.TypeMemberRole);
-
- foreach (var variableToRemove in variableUnitsToRemove) {
- GetEquivalentNodeFor(root, newRoot, variableToRemove).Remove();
- }
- foreach (var fieldToRemove in fieldsToRemove) {
- GetEquivalentNodeFor(root, newRoot, fieldToRemove).Remove();
- }
-
- script.Replace(root, newRoot);
-
- ReplaceVariableReferences(context, root, baseType, enumName, script, newNames, variables);
- }
-
- static void ReplaceVariableReferences(RefactoringContext context, AstNode root, AstType baseType, string enumName, Script script, Dictionary<string, string> newNames, IEnumerable<VariableInitializer> variables)
- {
- var resolveResults = variables.Select(variable => (MemberResolveResult)context.Resolve(variable));
- var resolvedFields = resolveResults.Select(resolveResult => resolveResult.Member);
- script.DoGlobalOperationOn(resolvedFields, (newCtx, newScript, foundNodes) => {
- foreach (var foundNode in foundNodes) {
- TypeDeclaration newContainerType = foundNode.GetParent<TypeDeclaration>();
- if (root.Descendants.OfType<TypeDeclaration>().Select(type => ((TypeResolveResult)context.Resolve(type)).Type.FullName).ToList().Contains(((TypeResolveResult)newCtx.Resolve(newContainerType)).Type.FullName)) {
- //This file has already been fixed
- return;
- }
- var identifierExpr = foundNode as IdentifierExpression;
- if (identifierExpr != null) {
- newScript.Replace(identifierExpr, CreateIdentifierReplacement(enumName, baseType, newNames, identifierExpr));
- continue;
- }
- var memberRef = foundNode as MemberReferenceExpression;
- if (memberRef != null) {
- var replacement = CreateReplacementMemberReference(enumName, baseType, newNames, memberRef);
- newScript.Replace(memberRef, replacement);
- }
- }
- });
- }
-
- TypeDeclaration CreateEnumDeclaration(AstType baseType, string enumName, List<VariableInitializer> variables, List<string> names, Dictionary<string, string> newNames)
- {
- TypeDeclaration generatedEnum = new TypeDeclaration();
- generatedEnum.ClassType = ClassType.Enum;
- generatedEnum.BaseTypes.Add(baseType.Clone());
- generatedEnum.Name = enumName;
- generatedEnum.Modifiers = GetCombinedModifier((Modifiers)variables.Select(variable => ((FieldDeclaration)variable.Parent).Modifiers).Aggregate(0, (prev, newModifier) => prev | (int)newModifier));
- foreach (var variable in variables) {
- var generatedMember = new EnumMemberDeclaration();
- generatedMember.Name = newNames[variable.Name];
- var value = variable.Initializer.Clone();
- foreach (var identifier in value.DescendantsAndSelf.OfType<IdentifierExpression>().Where(identifier => names.Contains(identifier.Identifier))) {
- var newIdentifier = new IdentifierExpression(newNames[identifier.Identifier]);
- if (identifier == value) {
- value = newIdentifier;
- break;
- }
- identifier.ReplaceWith(newIdentifier);
- }
- generatedMember.Initializer = value;
- generatedEnum.Members.Add(generatedMember);
- }
- return generatedEnum;
- }
-
- /// <summary>
- /// Determines whether the initialized variable has the specified primitive integer type
- /// </summary>
- /// <returns><c>true</c> if the initialized variable has the specified type; otherwise, <c>false</c>.</returns>
- /// <param name="context">The context to use.</param>
- /// <param name="variable">The variable initializer to check.</param>
- /// <param name="type">The type to compare with.</param>
- bool VariableHasSpecifiedIntegerType(RefactoringContext context, VariableInitializer variable, AstType type)
- {
- return TypeToIntegerPrimitive(context, variable.GetParent<FieldDeclaration>().ReturnType).Match(type).Success;
- }
-
- static Dictionary<string, PrimitiveType> primitiveTypes = new Dictionary<string, PrimitiveType>();
-
- static ConvertToEnumAction()
- {
- primitiveTypes.Add(typeof(byte).FullName, new PrimitiveType("byte"));
- primitiveTypes.Add(typeof(sbyte).FullName, new PrimitiveType("sbyte"));
-
- primitiveTypes.Add(typeof(short).FullName, new PrimitiveType("short"));
- primitiveTypes.Add(typeof(int).FullName, new PrimitiveType("int"));
- primitiveTypes.Add(typeof(long).FullName, new PrimitiveType("long"));
-
- primitiveTypes.Add(typeof(ushort).FullName, new PrimitiveType("ushort"));
- primitiveTypes.Add(typeof(uint).FullName, new PrimitiveType("uint"));
- primitiveTypes.Add(typeof(ulong).FullName, new PrimitiveType("ulong"));
- }
-
- /// <summary>
- /// Gets a PrimitiveType instance from an AstType.
- /// Only returns integer types (and never the char type)
- /// </summary>
- /// <returns>The integer primitive.</returns>
- /// <param name="context">The context to use.</param>
- /// <param name="type">The AstType to get the primitive from.</param>
- PrimitiveType TypeToIntegerPrimitive(RefactoringContext context, AstType type)
- {
- var resolvedType = context.ResolveType(type) as DefaultResolvedTypeDefinition;
-
- PrimitiveType primitiveType;
- if (!primitiveTypes.TryGetValue(resolvedType.FullName, out primitiveType)) {
- return null;
- }
-
- return primitiveType;
- }
-
- static Expression CreateReplacementMemberReference(string enumName, AstType baseType, Dictionary<string, string> newNames, MemberReferenceExpression memberToReplace)
- {
- return new ParenthesizedExpression(new CastExpression(baseType.Clone(), new MemberReferenceExpression(new MemberReferenceExpression(memberToReplace.Target.Clone(), enumName), newNames [memberToReplace.MemberName])));
- }
-
- void FixIdentifiers(RefactoringContext context, string enumName, List<VariableInitializer> variables, IType containerType, AstType baseType, List<string> names, Dictionary<string, string> newNames, AstNode root, AstNode newRoot)
- {
- foreach (var identifier in root.Descendants.OfType<IdentifierExpression> ().Where (identifier => names.Contains (identifier.Identifier))) {
- if (variables.Any(variable => variable.Descendants.Contains(identifier))) {
- //Already handled
- continue;
- }
- var resolvedIdentifier = context.Resolve(identifier) as MemberResolveResult;
- if (resolvedIdentifier == null) {
- continue;
- }
- if (resolvedIdentifier.Type.Equals(containerType)) {
- continue;
- }
- var replacement = CreateIdentifierReplacement(enumName, baseType, newNames, identifier);
- GetEquivalentNodeFor(root, newRoot, identifier).ReplaceWith(replacement);
- }
- }
-
- static ParenthesizedExpression CreateIdentifierReplacement(string enumName, AstType baseType, Dictionary<string, string> newNames, IdentifierExpression identifier)
- {
- var replacement = new ParenthesizedExpression(new CastExpression(baseType.Clone(), new MemberReferenceExpression(new IdentifierExpression(enumName), newNames [identifier.Identifier])));
- return replacement;
- }
-
- /// <summary>
- /// Finds the corresponding node in another ("new") AST.
- /// Assumes entities have not been renamed and no statements have been removed.
- /// </summary>
- /// <returns>The equivalent node in the new AST.</returns>
- /// <param name="root">The root of the first ("old") AST.</param>
- /// <param name="newRoot">The root of the new AST.</param>
- /// <param name="nodeToFind">Node (from the old AST) to find in the new one.</param>
- AstNode GetEquivalentNodeFor(AstNode root, AstNode newRoot, AstNode nodeToFind)
- {
- if (nodeToFind == null) {
- throw new ArgumentNullException("nodeToFind");
- }
-
- if (nodeToFind.Parent != root) {
- AstNode foundRoot = GetEquivalentNodeFor(root, newRoot, nodeToFind.Parent);
- if (foundRoot == null) {
- //If the equivalent of the parent does not exist in the new AST,
- //then neither does this node.
- return null;
- }
- newRoot = foundRoot;
- root = nodeToFind.Parent;
- }
-
- //At this point, the roots are the parents of the nodes to check
- //root is the parent of the nodeToFind, and newRoot is the parent of the node to return
-
- var block = root as BlockStatement;
- if (block != null && nodeToFind.Role == BlockStatement.StatementRole) {
- //This could be a problem if statements were removed in the new AST,
- //but fortunately that's not the problem we're trying to solve.
- return ((BlockStatement)newRoot).Statements.ElementAt(block.TakeWhile(statement => statement != nodeToFind).Count());
- }
-
- //First, we'll narrow down the search - the equivalent node *always* has the same type and role as nodeToFind
- //The Role check will help e.g. in binary expressions (where there is a 'Left' and a 'Right' role)
- var candidates = newRoot.Children.Where(child => child.GetType() == nodeToFind.GetType() && child.Role == nodeToFind.Role);
- var entity = nodeToFind as EntityDeclaration;
- if (entity != null) {
- var field = nodeToFind as FieldDeclaration;
- if (field != null) {
- //Fields have to be treated separately because fields have no names
- candidates = candidates.Where(candidate => IsEquivalentField((FieldDeclaration) candidate, field));
- }
- else {
- //Some entities can be distinguished by name.
- candidates = candidates.Where(candidate => ((EntityDeclaration)candidate).Name == entity.Name);
-
- var method = nodeToFind as MethodDeclaration;
- if (method != null) {
- //Methods, however, can be overloaded - so their names aren't enough.
- candidates = candidates.Where(candidate => CheckIfMethodsHaveSameParameters((MethodDeclaration) candidate, method));
- }
- }
- }
-
- var ns = nodeToFind as NamespaceDeclaration;
- if (ns != null) {
- candidates = candidates.Where(candidate => ((NamespaceDeclaration)candidate).Name == ns.Name).ToList();
- if (candidates.Count() > 1) {
- throw new NotImplementedException("Two or more namespace declarations with the same name are siblings. This case is not currently supported by this action.");
- }
- }
-
- var initializer = nodeToFind as VariableInitializer;
- if (initializer != null) {
- candidates = candidates.Where(candidate => ((VariableInitializer)candidate).Name == initializer.Name);
- }
-
- var equivalentNode = candidates.SingleOrDefault();
- return equivalentNode;
- }
-
- bool IsEquivalentField(FieldDeclaration field1, FieldDeclaration field2) {
- return field1.Variables.Any(variable1 => {
- return field2.Variables.Any(variable2 => variable1.Name == variable2.Name);
- });
- }
-
- bool CheckIfMethodsHaveSameParameters(MethodDeclaration methodDeclaration, MethodDeclaration comparedMethod)
- {
- if (methodDeclaration.Parameters.Count != comparedMethod.Parameters.Count) {
- return false;
- }
-
- ParameterDeclaration param1 = methodDeclaration.Parameters.FirstOrDefault();
- ParameterDeclaration param2 = comparedMethod.Parameters.FirstOrDefault();
-
- while (param1 != null) {
- //If the names or initializers are different, this will still match.
- //But if the type or order changes, this will complain
- if (!param1.Type.Match(param2.Type).Success) {
- return false;
- }
-
- param1 = (ParameterDeclaration) param1.GetNextSibling(node => node is ParameterDeclaration);
- param2 = (ParameterDeclaration) param2.GetNextSibling(node => node is ParameterDeclaration);
- }
-
- return true;
- }
-
- void InsertAfterEquivalent<T>(AstNode root, AstNode newRoot, AstNode prevNode, T newNode, Role<T> role)
- where T : AstNode
- {
- AstNode equivalentPrevNode = GetEquivalentNodeFor(root, newRoot, prevNode);
- equivalentPrevNode.Parent.InsertChildAfter<T>(equivalentPrevNode, newNode, role);
- }
-
- /// <summary>
- /// Gets the least permissive access modifier that still allows access to
- /// fields or methods with the specified modifiers.
- /// This will ignore all modifiers unrelated to access - such as const and readonly
- /// </summary>
- /// <returns>A modifier that is at least as permissive as all provided modifiers.</returns>
- /// <param name="modifiers">The modifiers to use.</param>
- Modifiers GetCombinedModifier(Modifiers modifiers)
- {
- if (modifiers.HasFlag(Modifiers.Public))
- return Modifiers.Public;
-
- Modifiers combinedModifier = 0;
- if (modifiers.HasFlag(Modifiers.Protected)) {
- combinedModifier |= Modifiers.Protected;
- }
- if (modifiers.HasFlag(Modifiers.Internal)) {
- combinedModifier |= Modifiers.Internal;
- }
-
- //No modifier if the fields are all private.
- return combinedModifier;
- }
-
- /// <summary>
- /// Gets all prefixes that more than one name have.
- /// </summary>
- /// <returns>The common prefixes.</returns>
- /// <param name="currentName">The name to use.</param>
- /// <param name="names">The names to check.</param>
- IEnumerable<string> GetCommonPrefixes(string currentName, IEnumerable<string> names)
- {
- //Find the indexes that 'split' words in the variable name
- var boundariesForCurrentWord = GetWordsBoundaries(currentName);
-
- //Get the candidate prefixes
- List<string> proposedPrefixes = boundariesForCurrentWord.Select(boundary => currentName.Substring(0, boundary)).ToList();
-
- //Return only the prefixes that more than one variable has.
- return proposedPrefixes.Where(prefix => names.Count(name => name.StartsWith(prefix, StringComparison.InvariantCulture)) > 1);
- }
-
- List<int> GetWordsBoundaries(string name)
- {
- List<int> foundBoundaries = new List<int>();
- for (int i = 1; i < name.Length - 1; ++i) {
- char chr = name [i];
- if (chr == '_') {
- foundBoundaries.Add(i);
- continue;
- }
-
- if (char.IsUpper(chr) && char.IsLower(name [i - 1])) {
- foundBoundaries.Add(i);
- continue;
- }
- }
-
- return foundBoundaries;
- }
-
- AstNode GetRootNodeOf(AstNode node)
- {
- while (node.Parent != null) {
- node = node.Parent;
- }
-
- return node;
- }
- }
-}
-
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/Actions/MoveTypeToFile.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/Actions/MoveTypeToFile.cs
deleted file mode 100644
index bf1523421d..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/Actions/MoveTypeToFile.cs
+++ /dev/null
@@ -1,167 +0,0 @@
-//
-// MoveTypeToFile.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.PatternMatching;
-using MonoDevelop.Core;
-using System.Collections.Generic;
-using Mono.TextEditor;
-using System.Linq;
-using MonoDevelop.Refactoring;
-using System.IO;
-using System.Text;
-using MonoDevelop.Ide.StandardHeader;
-using MonoDevelop.Core.ProgressMonitoring;
-using ICSharpCode.NRefactory;
-using System.Threading;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-
-namespace MonoDevelop.CSharp.Refactoring.CodeActions
-{
- class MoveTypeToFile : MonoDevelop.CodeActions.CodeActionProvider
- {
- public override IEnumerable<MonoDevelop.CodeActions.CodeAction> GetActions (MonoDevelop.Ide.Gui.Document document, object refactoringContext, TextLocation loc, CancellationToken cancellationToken)
- {
- var context = refactoringContext as MDRefactoringContext;
- if (context == null)
- return Enumerable.Empty<MonoDevelop.CodeActions.CodeAction> ();
- return GetActions (context);
- }
- protected IEnumerable<MonoDevelop.CodeActions.CodeAction> GetActions (MDRefactoringContext context)
- {
- if (context.IsInvalid)
- yield break;
- var type = GetTypeDeclaration (context);
- if (type == null)
- yield break;
- if (Path.GetFileNameWithoutExtension (context.TextEditor.FileName) == type.Name)
- yield break;
- string title;
- if (IsSingleType (context)) {
- title = String.Format (GettextCatalog.GetString ("Rename file to '{0}'"), Path.GetFileName (GetCorrectFileName (context, type)));
- } else {
- title = String.Format (GettextCatalog.GetString ("Move type to file '{0}'"), Path.GetFileName (GetCorrectFileName (context, type)));
- }
- yield return new MonoDevelop.CodeActions.DefaultCodeAction (title, (c, s) => {
- var ctx = (MDRefactoringContext) c;
- var script = (Script) s;
- string correctFileName = GetCorrectFileName (ctx, type);
- if (IsSingleType (ctx)) {
- FileService.RenameFile (ctx.TextEditor.FileName, correctFileName);
- if (ctx.FileContainerProject != null)
- ctx.FileContainerProject.Save (new NullProgressMonitor ());
- return;
- }
-
- CreateNewFile (ctx, type, correctFileName);
- script.Remove (type);
- });
- }
-
- static void CreateNewFile (MDRefactoringContext context, TypeDeclaration type, string correctFileName)
- {
- var content = context.TextEditor.Text;
-
- var types = new List<EntityDeclaration> (context.Unit.GetTypes ().Where (t => t.StartLocation != type.StartLocation));
- types.Sort ((x, y) => y.StartLocation.CompareTo (x.StartLocation));
-
- foreach (var removeType in types) {
- var start = context.GetOffset (removeType.StartLocation);
- var end = context.GetOffset (removeType.EndLocation);
- content = content.Remove (start, end - start);
- }
-
- if (context.FileContainerProject != null) {
- string header = StandardHeaderService.GetHeader (context.FileContainerProject, correctFileName, true);
- if (!string.IsNullOrEmpty (header))
- content = header + context.TextEditor.EolMarker + StripHeader (content);
- }
- content = StripDoubleBlankLines (content);
-
- File.WriteAllText (correctFileName, content);
- context.FileContainerProject.AddFile (correctFileName);
- MonoDevelop.Ide.IdeApp.ProjectOperations.Save (context.FileContainerProject);
- }
-
- static bool IsBlankLine (TextDocument doc, int i)
- {
- var line = doc.GetLine (i);
- return line.Length == line.GetIndentation (doc).Length;
- }
-
- static string StripDoubleBlankLines (string content)
- {
- var doc = new Mono.TextEditor.TextDocument (content);
- for (int i = 1; i + 1 <= doc.LineCount; i++) {
- if (IsBlankLine (doc, i) && IsBlankLine (doc, i + 1)) {
- doc.Remove (doc.GetLine (i).SegmentIncludingDelimiter);
- i--;
- continue;
- }
- }
- return doc.Text;
- }
-
- static string StripHeader (string content)
- {
- var doc = new Mono.TextEditor.TextDocument (content);
- while (true) {
- string lineText = doc.GetLineText (1);
- if (lineText == null)
- break;
- if (lineText.StartsWith ("//")) {
- doc.Remove (doc.GetLine (1).SegmentIncludingDelimiter);
- continue;
- }
- break;
- }
- return doc.Text;
- }
-
- bool IsSingleType (MDRefactoringContext context)
- {
- return context.Unit.GetTypes ().Count () == 1;
- }
-
- TypeDeclaration GetTypeDeclaration (MDRefactoringContext context)
- {
- var result = context.GetNode<TypeDeclaration> ();
- if (result == null || result.Parent is TypeDeclaration)
- return null;
- if (result != null && result.NameToken.Contains (context.Location))
- return result;
- return null;
- }
-
- internal static string GetCorrectFileName (MDRefactoringContext context, EntityDeclaration type)
- {
- if (type == null)
- return context.TextEditor.FileName;
- return Path.Combine (Path.GetDirectoryName (context.TextEditor.FileName), type.Name + Path.GetExtension (context.TextEditor.FileName));
- }
- }
-}
-
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/ContextActionExtensions.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/ContextActionExtensions.cs
deleted file mode 100644
index a08ea332e3..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/ContextActionExtensions.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// ContextActionExtensions.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.CSharp;
-using MonoDevelop.CSharp.Resolver;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-
-namespace MonoDevelop.CSharp.Refactoring.CodeActions
-{
- static class ContextActionExtensions
- {
- public static int CalcIndentLevel (this MonoDevelop.Ide.Gui.Document doc, string indent)
- {
- int col = GetColumn (indent, 0, doc.Editor.Options.TabSize);
- return System.Math.Max (0, col / doc.Editor.Options.TabSize);
- }
-
- public static int GetColumn (string wrapper, int i, int tabSize)
- {
- int j = i;
- int col = 0;
- for (; j < wrapper.Length && (wrapper[j] == ' ' || wrapper[j] == '\t'); j++) {
- if (wrapper[j] == ' ') {
- col++;
- } else {
- col = GetNextTabstop (col, tabSize);
- }
- }
- return col;
- }
-
- static int GetNextTabstop (int currentColumn, int tabSize)
- {
- int result = currentColumn + tabSize;
- return (result / tabSize) * tabSize;
- }
-
- public static void FormatText (this AstNode node, MonoDevelop.Ide.Gui.Document doc)
- {
- doc.UpdateParseDocument ();
- MonoDevelop.CSharp.Formatting.OnTheFlyFormatter.Format (doc, node.StartLocation);
- }
- }
-}
-
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringContext.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringContext.cs
deleted file mode 100644
index c8c7d60632..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringContext.cs
+++ /dev/null
@@ -1,271 +0,0 @@
-//
-// MDRefactoringContext.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Linq;
-using ICSharpCode.NRefactory.CSharp;
-using MonoDevelop.Projects;
-using MonoDevelop.Core;
-using MonoDevelop.Refactoring;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory;
-using System.Threading;
-using MonoDevelop.Ide.Gui;
-using System.Diagnostics;
-using MonoDevelop.CSharp.Refactoring.CodeIssues;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using MonoDevelop.CSharp.Formatting;
-using System.Threading.Tasks;
-
-namespace MonoDevelop.CSharp.Refactoring.CodeActions
-{
- public class MDRefactoringContext : RefactoringContext, IRefactoringContext
- {
- MonoDevelop.Projects.Project fileContainerProject;
-
- public TextEditorData TextEditor {
- get;
- private set;
- }
-
- public DotNetProject Project {
- get;
- private set;
- }
-
- public MonoDevelop.Projects.Project FileContainerProject {
- get {
- if (fileContainerProject == null)
- fileContainerProject = FindProjectContainingFile () ?? Project;
- return fileContainerProject;
- }
- }
-
- MonoDevelop.Projects.Project FindProjectContainingFile ()
- {
- var file = TextEditor.FileName;
- if (string.IsNullOrEmpty (file) || Project == null)
- return null;
-
- var pf = Project.GetProjectFile (file);
- if (pf != null && (pf.Flags & ProjectItemFlags.Hidden) != 0) {
- // The file is hidden in this project, so it may also be part of another project.
- // Try to find a project in which this file is not hidden
- foreach (var p in Project.ParentSolution.GetAllProjects ()) {
- pf = p.GetProjectFile (file);
- if (pf != null && (pf.Flags & ProjectItemFlags.Hidden) == 0)
- return p;
- }
- }
- return null;
- }
-
- public bool IsInvalid {
- get {
- if (Resolver == null || TextEditor == null)
- return true;
- return ParsedDocument == null;
- }
- }
-
- public ParsedDocument ParsedDocument {
- get;
- private set;
- }
-
- public SyntaxTree Unit {
- get {
- Debug.Assert (!IsInvalid);
- return Resolver.RootNode as SyntaxTree;
- }
- }
-
- public override string DefaultNamespace {
- get {
- var p = FileContainerProject as IDotNetFileContainer;
- if (p == null || TextEditor == null || string.IsNullOrEmpty (TextEditor.FileName))
- return null;
- return p.GetDefaultNamespace (TextEditor.FileName);
- }
- }
-
- public override bool Supports (Version version)
- {
- var project = Project;
- if (project == null)
- return true;
- switch (project.TargetFramework.ClrVersion) {
- case ClrVersion.Net_1_1:
- return version.Major > 1 || version.Major == 1 && version.Minor >= 1;
- case ClrVersion.Net_2_0:
- return version.Major >= 2;
- case ClrVersion.Clr_2_1:
- return version.Major > 2 || version.Major == 2 && version.Minor >= 1;
- default:
- return true;
- }
- }
-
- public override ICSharpCode.NRefactory.CSharp.TextEditorOptions TextEditorOptions {
- get {
- return TextEditor.CreateNRefactoryTextEditorOptions ();
- }
- }
-
- public override bool IsSomethingSelected {
- get {
- return TextEditor.IsSomethingSelected;
- }
- }
-
- public override string SelectedText {
- get {
- return TextEditor.SelectedText;
- }
- }
-
- public override TextLocation SelectionStart {
- get {
- return TextEditor.MainSelection.Start;
- }
- }
-
- public override TextLocation SelectionEnd {
- get {
- return TextEditor.MainSelection.End;
- }
- }
-
- public override int GetOffset (TextLocation location)
- {
- return TextEditor.LocationToOffset (location);
- }
-
- public override TextLocation GetLocation (int offset)
- {
- return TextEditor.OffsetToLocation (offset);
- }
-
- public override string GetText (int offset, int length)
- {
- return TextEditor.GetTextAt (offset, length);
- }
-
- public override string GetText (ICSharpCode.NRefactory.Editor.ISegment segment)
- {
- return TextEditor.GetTextAt (segment.Offset, segment.Length);
- }
-
- public override ICSharpCode.NRefactory.Editor.IDocumentLine GetLineByOffset (int offset)
- {
- return TextEditor.GetLineByOffset (offset);
- }
-
- readonly Document document;
- TextLocation location;
-
- public override TextLocation Location {
- get {
- return location;
- }
- }
-
- internal void SetLocation (TextLocation loc)
- {
- if (document != null)
- location = RefactoringService.GetCorrectResolveLocation (document, loc);
- else
- location = loc;
- }
-
- readonly CSharpFormattingOptions formattingOptions;
-
- public CSharpFormattingOptions FormattingOptions {
- get {
- return formattingOptions;
- }
- }
-
- public Script StartScript ()
- {
- return new MDRefactoringScript (this, formattingOptions);
- }
-
- public IDisposable CreateScript ()
- {
- return StartScript ();
- }
-
- internal static Task<MDRefactoringContext> Create (Document document, TextLocation loc, CancellationToken cancellationToken = default (CancellationToken))
- {
- var shared = document.GetSharedResolver ();
- if (shared == null) {
- var tcs = new TaskCompletionSource<MDRefactoringContext> ();
- tcs.SetResult (null);
- return tcs.Task;
- }
-
- return shared.ContinueWith (t => {
- var sharedResolver = t.Result;
- if (sharedResolver == null)
- return null;
- return new MDRefactoringContext (document, sharedResolver, loc, cancellationToken);
- // Do not add TaskContinuationOptions.ExecuteSynchronously
- // https://bugzilla.xamarin.com/show_bug.cgi?id=25065
- // adding ExecuteSynchronously appears to create a deadlock situtation in TypeSystemParser.Parse()
- });
- }
-
- internal MDRefactoringContext (Document document, CSharpAstResolver resolver, TextLocation loc, CancellationToken cancellationToken = default (CancellationToken)) : base (resolver, cancellationToken)
- {
- if (document == null)
- throw new ArgumentNullException ("document");
- this.document = document;
- this.TextEditor = document.Editor;
- this.ParsedDocument = document.ParsedDocument;
- this.Project = document.Project as DotNetProject;
- this.formattingOptions = document.GetFormattingOptions ();
- this.location = loc;
- var policy = document.HasProject ? document.Project.Policies.Get<NameConventionPolicy> () : MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<NameConventionPolicy> ();
- Services.AddService (typeof(NamingConventionService), policy.CreateNRefactoryService ());
- Services.AddService (typeof(ICSharpCode.NRefactory.CSharp.CodeGenerationService), new CSharpCodeGenerationService());
- }
-
- public MDRefactoringContext (DotNetProject project, TextEditorData data, ParsedDocument parsedDocument, CSharpAstResolver resolver, TextLocation loc, CancellationToken cancellationToken = default (CancellationToken)) : base (resolver, cancellationToken)
- {
- this.TextEditor = data;
- this.ParsedDocument = parsedDocument;
- this.Project = project;
- var policy = Project.Policies.Get<CSharpFormattingPolicy> ();
- this.formattingOptions = policy.CreateOptions ();
- this.location = loc;
- var namingPolicy = Project.Policies.Get<NameConventionPolicy> ();
- Services.AddService (typeof(NamingConventionService), namingPolicy.CreateNRefactoryService ());
- }
- }
-}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringScript.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringScript.cs
deleted file mode 100644
index 008f06c026..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringScript.cs
+++ /dev/null
@@ -1,377 +0,0 @@
-//
-// MDRefactoringScript.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Linq;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-using MonoDevelop.Ide.Gui;
-using ICSharpCode.NRefactory.CSharp;
-using Mono.TextEditor;
-using MonoDevelop.Ide.TypeSystem;
-using MonoDevelop.Core;
-using System.Collections.Generic;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Refactoring.Rename;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using System.IO;
-using MonoDevelop.CSharp.Formatting;
-using MonoDevelop.Ide;
-using System.Threading.Tasks;
-using MonoDevelop.Ide.FindInFiles;
-using MonoDevelop.Projects;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
-using MonoDevelop.Ide.Gui.Content;
-
-namespace MonoDevelop.CSharp.Refactoring.CodeActions
-{
- class MDRefactoringScript : DocumentScript
- {
- readonly MDRefactoringContext context;
- readonly IDisposable undoGroup;
- readonly ICSharpCode.NRefactory.Editor.ITextSourceVersion startVersion;
- int operationsRunning;
-
- public MDRefactoringScript (MDRefactoringContext context, CSharpFormattingOptions formattingOptions) : base(context.TextEditor.Document, formattingOptions, context.TextEditor.CreateNRefactoryTextEditorOptions ())
- {
- this.context = context;
- undoGroup = this.context.TextEditor.OpenUndoGroup ();
- this.startVersion = this.context.TextEditor.Version;
-
- }
-
- void Rollback ()
- {
- DisposeOnClose (true);
- foreach (var ver in context.TextEditor.Version.GetChangesTo (startVersion)) {
- context.TextEditor.Document.Replace (ver.Offset, ver.RemovalLength, ver.InsertedText.Text);
- }
- }
-
- public override void Select (AstNode node)
- {
- var seg = GetSegment (node);
- var startOffset = seg.Offset;
- var endOffset = seg.EndOffset;
- while (startOffset < endOffset) {
- char ch = context.TextEditor.GetCharAt (startOffset);
- if (!char.IsWhiteSpace (ch))
- break;
- startOffset++;
- }
- while (startOffset < endOffset && endOffset > 0) {
- char ch = context.TextEditor.GetCharAt (endOffset - 1);
- if (!char.IsWhiteSpace (ch))
- break;
- endOffset--;
- }
-
- context.TextEditor.Caret.Offset = endOffset;
- context.TextEditor.SelectionRange = new TextSegment (startOffset, endOffset - startOffset);
- }
-
- public override Task<Script> InsertWithCursor (string operation, InsertPosition defaultPosition, IList<AstNode> nodes)
- {
- var tcs = new TaskCompletionSource<Script> ();
- var editor = context.TextEditor;
- DocumentLocation loc = context.TextEditor.Caret.Location;
- var declaringType = context.ParsedDocument.GetInnermostTypeDefinition (loc);
- var mode = new InsertionCursorEditMode (
- editor.Parent,
- MonoDevelop.Ide.TypeSystem.CodeGenerationService.GetInsertionPoints (context.TextEditor, context.ParsedDocument, declaringType));
- if (mode.InsertionPoints.Count == 0) {
- MessageService.ShowError (
- GettextCatalog.GetString ("No valid insertion point can be found in type '{0}'.", declaringType.Name)
- );
- return tcs.Task;
- }
- var helpWindow = new Mono.TextEditor.PopupWindow.InsertionCursorLayoutModeHelpWindow ();
- helpWindow.TitleText = operation;
- mode.HelpWindow = helpWindow;
-
- switch (defaultPosition) {
- case InsertPosition.Start:
- mode.CurIndex = 0;
- break;
- case InsertPosition.End:
- mode.CurIndex = mode.InsertionPoints.Count - 1;
- break;
- case InsertPosition.Before:
- for (int i = 0; i < mode.InsertionPoints.Count; i++) {
- if (mode.InsertionPoints [i].Location < loc)
- mode.CurIndex = i;
- }
- break;
- case InsertPosition.After:
- for (int i = 0; i < mode.InsertionPoints.Count; i++) {
- if (mode.InsertionPoints [i].Location > loc) {
- mode.CurIndex = i;
- break;
- }
- }
- break;
- }
- operationsRunning++;
- mode.StartMode ();
- mode.Exited += delegate(object s, InsertionCursorEventArgs iCArgs) {
- if (iCArgs.Success) {
- if (iCArgs.InsertionPoint.LineAfter == NewLineInsertion.None &&
- iCArgs.InsertionPoint.LineBefore == NewLineInsertion.None && nodes.Count () > 1) {
- iCArgs.InsertionPoint.LineAfter = NewLineInsertion.BlankLine;
- }
- foreach (var node in nodes.Reverse ()) {
- var output = OutputNode (MonoDevelop.Ide.TypeSystem.CodeGenerationService.CalculateBodyIndentLevel (declaringType), node);
- var offset = context.TextEditor.LocationToOffset (iCArgs.InsertionPoint.Location);
- var delta = iCArgs.InsertionPoint.Insert (editor, output.Text);
- output.RegisterTrackedSegments (this, delta + offset);
- }
- tcs.SetResult (this);
- } else {
- Rollback ();
- }
- DisposeOnClose ();
- };
- return tcs.Task;
- }
-
- readonly List<Script> startedScripts = new List<Script> ();
-
- public override Task<Script> InsertWithCursor (string operation, ITypeDefinition parentType, Func<Script, RefactoringContext, IList<AstNode>> nodeCallback)
- {
- var tcs = new TaskCompletionSource<Script>();
- if (parentType == null)
- return tcs.Task;
- var part = MonoDevelop.Ide.TypeSystem.CodeGenerationService.FindCurrentPart(parentType);
- if (part == null)
- return tcs.Task;
-
- var loadedDocument = IdeApp.Workbench.OpenDocument (new FileOpenInformation (part.Region.FileName, null));
- loadedDocument.RunWhenLoaded (delegate {
- var editor = loadedDocument.Editor;
- var loc = part.Region.Begin;
- var parsedDocument = loadedDocument.UpdateParseDocument ();
- var declaringType = parsedDocument.GetInnermostTypeDefinition (loc);
- MDRefactoringScript script;
-
- if (loadedDocument.Editor != context.TextEditor) {
- script = new MDRefactoringScript (MDRefactoringContext.Create (loadedDocument, loc, context.CancellationToken).Result, FormattingOptions);
- startedScripts.Add (script);
- } else {
- script = this;
- }
- var nodes = nodeCallback (script, script.context);
- var mode = new InsertionCursorEditMode (
- editor.Parent,
- MonoDevelop.Ide.TypeSystem.CodeGenerationService.GetInsertionPoints (loadedDocument, declaringType));
- if (mode.InsertionPoints.Count == 0) {
- MessageService.ShowError (
- GettextCatalog.GetString ("No valid insertion point can be found in type '{0}'.", declaringType.Name)
- );
- return;
- }
- if (declaringType.Kind == TypeKind.Enum) {
- foreach (var node in nodes.Reverse ()) {
- var output = OutputNode (MonoDevelop.Ide.TypeSystem.CodeGenerationService.CalculateBodyIndentLevel (declaringType), node);
- var point = mode.InsertionPoints.First ();
- var offset = loadedDocument.Editor.LocationToOffset (point.Location);
- var text = output.Text + ",";
- var delta = point.Insert (editor, text);
- output.RegisterTrackedSegments (script, delta + offset);
- }
- tcs.SetResult (script);
- return;
- }
-
- var helpWindow = new Mono.TextEditor.PopupWindow.InsertionCursorLayoutModeHelpWindow ();
- helpWindow.TitleText = operation;
- mode.HelpWindow = helpWindow;
-
- mode.CurIndex = 0;
- operationsRunning++;
- mode.StartMode ();
- mode.Exited += delegate(object s, InsertionCursorEventArgs iCArgs) {
- if (iCArgs.Success) {
- if (iCArgs.InsertionPoint.LineAfter == NewLineInsertion.None &&
- iCArgs.InsertionPoint.LineBefore == NewLineInsertion.None && nodes.Count > 1) {
- iCArgs.InsertionPoint.LineAfter = NewLineInsertion.BlankLine;
- }
- foreach (var node in nodes.Reverse ()) {
- var output = OutputNode (MonoDevelop.Ide.TypeSystem.CodeGenerationService.CalculateBodyIndentLevel (declaringType), node);
- var offset = loadedDocument.Editor.LocationToOffset (iCArgs.InsertionPoint.Location);
- var text = output.Text;
- var delta = iCArgs.InsertionPoint.Insert (editor, text);
- output.RegisterTrackedSegments (script, delta + offset);
- }
- tcs.SetResult (script);
- } else {
- Rollback ();
- }
- DisposeOnClose ();
- };
- });
-
- return tcs.Task;
- }
-
- public override Task Link (params AstNode[] nodes)
- {
- var tcs = new TaskCompletionSource<object> ();
- var segments = new List<TextSegment> (nodes.Select (node => new TextSegment (GetSegment (node))).OrderBy (s => s.Offset));
-
- var link = new TextLink ("name");
- segments.ForEach (link.AddLink);
- var links = new List<TextLink> ();
- links.Add (link);
- var tle = new TextLinkEditMode (context.TextEditor.Parent, 0, links);
- tle.SetCaretPosition = false;
- if (tle.ShouldStartTextLinkMode) {
- operationsRunning++;
- context.TextEditor.Caret.Offset = segments [0].EndOffset;
- tle.OldMode = context.TextEditor.CurrentMode;
- tle.Cancel += (sender, e) => Rollback ();
- tle.Exited += (sender, e) => DisposeOnClose ();
- tle.StartMode ();
- context.TextEditor.CurrentMode = tle;
- if (IdeApp.Workbench.ActiveDocument != null)
- IdeApp.Workbench.ActiveDocument.ReparseDocument ();
- }
- return tcs.Task;
- }
-
- bool isDisposed;
- void DisposeOnClose (bool force = false)
- {
- if (isDisposed)
- return;
- if (force)
- operationsRunning = 0;
- if (operationsRunning-- == 0) {
- isDisposed = true;
- undoGroup.Dispose ();
- try {
- base.Dispose ();
- } catch (Exception e) {
- LoggingService.LogError ("Error while disposing refactoring script", e);
- }
- }
- foreach (var script in startedScripts)
- script.Dispose ();
- }
-
- public override void Dispose ()
- {
- DisposeOnClose ();
- }
-
- public override void Rename (ISymbol symbol, string name = null)
- {
- if (symbol is IEntity) {
- RenameRefactoring.Rename ((IEntity)symbol, name);
- } else if (symbol is IVariable) {
- RenameRefactoring.RenameVariable ((IVariable)symbol, name);
- } else if (symbol is INamespace) {
- RenameRefactoring.RenameNamespace ((INamespace)symbol, name);
- } else if (symbol is ITypeParameter) {
- RenameRefactoring.RenameTypeParameter ((ITypeParameter)symbol, name);
- }
- }
-
- public override void DoGlobalOperationOn (IEnumerable<IEntity> entities, Action<RefactoringContext, Script, IEnumerable<AstNode>> callback, string operationName = null)
- {
- using (var monitor = IdeApp.Workbench.ProgressMonitors.GetBackgroundProgressMonitor (operationName ?? GettextCatalog.GetString ("Performing refactoring task..."), null)) {
- var col = entities.SelectMany (entity => ReferenceFinder.FindReferences (entity, true, monitor)).OfType<CSharpReferenceFinder.CSharpMemberReference> ().GroupBy(reference => reference.FileName);
-
- foreach (var r in col) {
- string filename = r.Key;
-
- bool isOpen;
- System.Text.Encoding encoding;
- bool hadBom;
-
- var data = TextFileProvider.Instance.GetTextEditorData (filename, out hadBom, out encoding, out isOpen);
-
- var firstReference = r.First ();
-
- var project = firstReference.Project;
-
- ParsedDocument parsedDocument;
- using (var reader = new StreamReader (data.OpenStream ()))
- parsedDocument = new MonoDevelop.CSharp.Parser.TypeSystemParser ().Parse (true, filename, reader, project);
-
- var resolver = new CSharpAstResolver (TypeSystemService.GetCompilation (project), firstReference.SyntaxTree, parsedDocument.ParsedFile as CSharpUnresolvedFile);
-
- var ctx = new MDRefactoringContext (project as DotNetProject, data, parsedDocument, resolver, firstReference.AstNode.StartLocation, context.CancellationToken);
- var script = new MDRefactoringScript (ctx, FormattingOptions);
-
- callback (ctx, script, r.Select (reference => reference.AstNode));
-
- if (!isOpen) {
- script.Dispose ();
- Mono.TextEditor.Utils.TextFileUtility.WriteText (filename, data.Text, encoding, hadBom);
- }
- }
- }
- }
-
- public override void CreateNewType (AstNode newType, NewTypeContext ntctx = NewTypeContext.CurrentNamespace)
- {
- if (newType == null)
- throw new ArgumentNullException ("newType");
- var correctFileName = MoveTypeToFile.GetCorrectFileName (context, (EntityDeclaration)newType);
-
- var content = context.TextEditor.Text;
-
- var types = new List<EntityDeclaration> (context.Unit.GetTypes ());
- types.Sort ((x, y) => y.StartLocation.CompareTo (x.StartLocation));
-
- foreach (var removeType in types) {
- var start = context.GetOffset (removeType.StartLocation);
- var end = context.GetOffset (removeType.EndLocation);
- content = content.Remove (start, end - start);
- }
-
- var insertLocation = types.Count > 0 ? context.GetOffset (types.Last ().StartLocation) : -1;
- if (insertLocation < 0 || insertLocation > content.Length)
- insertLocation = content.Length;
- content = content.Substring (0, insertLocation) + newType.ToString (FormattingOptions) + content.Substring (insertLocation);
-
- var project = context.FileContainerProject;
- if (project != null) {
- var policy = project.Policies.Get<CSharpFormattingPolicy> ();
- var textPolicy = project.Policies.Get<TextStylePolicy> ();
- content = MonoDevelop.CSharp.Formatting.CSharpFormatter.FormatText (policy, textPolicy, MonoDevelop.CSharp.Formatting.CSharpFormatter.MimeType, content, 0, content.Length);
- }
-
- File.WriteAllText (correctFileName, content);
-
- if (project != null) {
- project.AddFile (correctFileName);
- IdeApp.ProjectOperations.Save (project);
- }
- IdeApp.Workbench.OpenDocument (correctFileName, project);
- }
-
- }
-}
-
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/NRefactoryCodeAction.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/NRefactoryCodeAction.cs
deleted file mode 100644
index adec92c9d5..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/NRefactoryCodeAction.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// NRefactoryCodeAction.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System.Collections.Generic;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-using MonoDevelop.Ide.Gui;
-using ICSharpCode.NRefactory;
-using MonoDevelop.Ide.TypeSystem;
-
-namespace MonoDevelop.CSharp.Refactoring.CodeActions
-{
- class NRefactoryCodeAction : MonoDevelop.CodeActions.CodeAction
- {
- readonly CodeAction act;
-
- public NRefactoryCodeAction (string id, string title, CodeAction act, object siblingKey = null)
- {
- this.IdString = id;
- this.Title = title;
- this.act = act;
- this.SiblingKey = siblingKey;
- this.Severity = act.Severity;
- this.DocumentRegion = new Mono.TextEditor.DocumentRegion (act.Start, act.End);
- }
-
- public override void Run (IRefactoringContext context, object script)
- {
- act.Run ((Script) script);
- }
-
- /// <summary>
- /// All the sibling actions of this action, ie those actions which represent the same kind
- /// of fix. This list includes the current action.
- /// </summary>
- /// <value>The sibling actions.</value>
- public IList<MonoDevelop.CodeActions.CodeAction> SiblingActions { get; set; }
-
- public override bool SupportsBatchRunning {
- get{
- return SiblingActions != null;// && SiblingActions.Count > 1;
- }
- }
-
- public override void BatchRun (Document document, TextLocation loc)
- {
- base.BatchRun (document, loc);
- var context = MDRefactoringContext.Create (document, loc).Result;
- if (context == null)
- return;
- using (var script = context.StartScript ()) {
- foreach (var action in SiblingActions) {
- context.SetLocation (action.DocumentRegion.Begin);
- action.Run (context, script);
- }
- }
- }
- }
-
-}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/NRefactoryCodeActionProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/NRefactoryCodeActionProvider.cs
deleted file mode 100644
index ec7ec5754e..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/NRefactoryCodeActionProvider.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// NRefactoryContextActionWrapper.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-using MonoDevelop.Ide.Gui;
-using ICSharpCode.NRefactory;
-using System.Threading;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.CSharp.Refactoring.CodeActions
-{
- class NRefactoryCodeActionProvider : MonoDevelop.CodeActions.CodeActionProvider
- {
- readonly List<string> actionId = new List<string> ();
- readonly CodeActionProvider provider;
-
- public NRefactoryCodeActionProvider (CodeActionProvider provider, ContextActionAttribute attr)
- {
- if (provider == null)
- throw new ArgumentNullException ("provider");
- if (attr == null)
- throw new ArgumentNullException ("attr");
- this.provider = provider;
- Title = GettextCatalog.GetString (attr.Title ?? "");
- Description = GettextCatalog.GetString (attr.Description ?? "");
- Category = GettextCatalog.GetString (attr.Category ?? "");
- MimeType = "text/x-csharp";
- }
-
- public override IEnumerable<MonoDevelop.CodeActions.CodeAction> GetActions (Document document, object _context, TextLocation loc, CancellationToken cancellationToken)
- {
- if (cancellationToken.IsCancellationRequested)
- yield break;
- var context = _context as MDRefactoringContext;
- if (context == null || context.IsInvalid || context.RootNode == null)
- yield break;
- var actions = provider.GetActions (context);
- if (actions == null) {
- LoggingService.LogWarning (provider + " returned null actions.");
- yield break;
- }
- int num = 0;
- foreach (var action_ in actions) {
- var action = action_;
- if (actionId.Count <= num) {
- actionId.Add (provider.GetType ().FullName + "'" + num);
- }
- yield return new NRefactoryCodeAction (actionId[num], GettextCatalog.GetString (action.Description ?? ""), action);
- num++;
- }
- }
-
- public override string IdString {
- get {
- return provider.GetType ().FullName;
- }
- }
-
- }
-}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/NRefactoryCodeActionSource.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/NRefactoryCodeActionSource.cs
deleted file mode 100644
index ba431c6e0f..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/NRefactoryCodeActionSource.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// NRefactoryCodeActionSource.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using MonoDevelop.CodeActions;
-using System.Collections.Generic;
-
-namespace MonoDevelop.CSharp.Refactoring.CodeActions
-{
- class NRefactoryCodeActionSource : ICodeActionProviderSource
- {
- #region ICodeActionProviderSource implementation
- public IEnumerable<CodeActionProvider> GetProviders ()
- {
- foreach (var t in typeof (ICSharpCode.NRefactory.CSharp.Refactoring.AbstractAndVirtualConversionAction).Assembly.GetTypes ()) {
- var attr = t.GetCustomAttributes (typeof(ICSharpCode.NRefactory.CSharp.ContextActionAttribute), false);
- if (attr == null || attr.Length != 1)
- continue;
- if (t.Name == "AddUsingAction")
- continue;
- yield return new NRefactoryCodeActionProvider (
- (ICSharpCode.NRefactory.CSharp.Refactoring.CodeActionProvider)Activator.CreateInstance (t),
- (ICSharpCode.NRefactory.CSharp.ContextActionAttribute)attr [0]);
- }
- }
- #endregion
- }
-}
-
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/BaseNRefactoryIssueProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/BaseNRefactoryIssueProvider.cs
deleted file mode 100644
index 89b24c2087..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/BaseNRefactoryIssueProvider.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// NRefactoryIssueWrapper.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Linq;
-using System.Collections.Generic;
-using ICSharpCode.NRefactory.CSharp;
-using MonoDevelop.Ide.Gui;
-using System.Threading;
-using MonoDevelop.CodeIssues;
-using MonoDevelop.CSharp.Refactoring.CodeActions;
-using MonoDevelop.Core;
-using Mono.TextEditor;
-using MonoDevelop.Core.Instrumentation;
-
-namespace MonoDevelop.CSharp.Refactoring.CodeIssues
-{
- class BaseNRefactoryIssueProvider : BaseCodeIssueProvider
- {
- NRefactoryIssueProvider parentIssue;
- SubIssueAttribute subIssue;
- TimerCounter counter;
-
- public override CodeIssueProvider Parent {
- get {
- return parentIssue;
- }
- }
-
- public override string MimeType {
- get {
- return parentIssue.MimeType;
- }
- }
-
-
- /// <summary>
- /// Gets the identifier string used as property ID tag.
- /// </summary>
- public override string IdString {
- get {
- return parentIssue.IdString + "." + subIssue.Title;
- }
- }
-
- public BaseNRefactoryIssueProvider (NRefactoryIssueProvider parentIssue, SubIssueAttribute subIssue)
- {
- this.parentIssue = parentIssue;
- this.subIssue = subIssue;
- this.Title = subIssue.Title;
- this.Description = subIssue.Description;
-
- DefaultSeverity = subIssue.Severity.HasValue ? subIssue.Severity.Value : parentIssue.DefaultSeverity;
- IsEnabledByDefault = subIssue.IsEnabledByDefault.HasValue ? subIssue.IsEnabledByDefault.Value : parentIssue.IsEnabledByDefault;
- UpdateSeverity ();
-
- counter = InstrumentationService.CreateTimerCounter (IdString, "CodeIssueProvider run times");
- }
-
- /// <summary>
- /// Gets all the code issues inside a document.
- /// </summary>
- public override IEnumerable<CodeIssue> GetIssues (object ctx, CancellationToken cancellationToken)
- {
- var context = ctx as MDRefactoringContext;
- if (context == null || context.IsInvalid || context.RootNode == null || context.ParsedDocument.HasErrors)
- return new CodeIssue[0];
- // Holds all the actions in a particular sibling group.
- IList<ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssue> issues;
- using (var timer = counter.BeginTiming ()) {
- // We need to enumerate here in order to time it.
- // This shouldn't be a problem since there are current very few (if any) lazy providers.
- var _issues = parentIssue.IssueProvider.GetIssues (context, subIssue.Title);
- issues = _issues as IList<ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssue> ?? _issues.ToList ();
- }
- return parentIssue.ToMonoDevelopRepresentation (cancellationToken, context, issues);
- }
-
-
- }
-} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/Issues/MonoTODOIssue.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/Issues/MonoTODOIssue.cs
deleted file mode 100644
index 20a593d9a1..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/Issues/MonoTODOIssue.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-//
-// MonoTODOIssue.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using MonoDevelop.CSharp.Refactoring.CodeActions;
-using MonoDevelop.CodeIssues;
-using ICSharpCode.NRefactory.CSharp;
-using System.Collections.Generic;
-using ICSharpCode.NRefactory.Semantics;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using ICSharpCode.NRefactory.TypeSystem;
-using System.Linq;
-
-
-namespace MonoDevelop.CSharp.Refactoring.CodeIssues
-{
- public class MonoTODOIssue : MonoDevelop.CodeIssues.CodeIssueProvider
- {
- public override bool HasSubIssues {
- get {
- return false;
- }
- }
-
- public MonoTODOIssue ()
- {
- this.Title = "Mono TODO";
- this.Description = "Find usages of mono todo items";
- this.Category = IssueCategories.Notifications;
- this.SetMimeType ("text/x-csharp");
- this.IsEnabledByDefault = true;
- this.SetSeverity (ICSharpCode.NRefactory.Refactoring.Severity.Warning);
- this.SetIsEnabled (true);
- }
-
- public override IEnumerable<CodeIssue> GetIssues (object refactoringContext, System.Threading.CancellationToken cancellationToken)
- {
- var context = refactoringContext as MDRefactoringContext;
- if (context == null || context.IsInvalid || context.RootNode == null || context.ParsedDocument.HasErrors)
- return new CodeIssue[0];
- var visitor = new MonoTODOVisitor (this, context);
- context.RootNode.AcceptVisitor (visitor);
- return visitor.Issues;
- }
-
- class MonoTODOVisitor : DepthFirstAstVisitor
- {
- readonly MonoTODOIssue issue;
- readonly MDRefactoringContext ctx;
- public readonly List<CodeIssue> Issues = new List<CodeIssue> ();
-
- public MonoTODOVisitor (MonoTODOIssue issue, MDRefactoringContext ctx)
- {
- this.issue = issue;
- this.ctx = ctx;
- }
- static readonly Dictionary<string, string> attributes = new Dictionary<string, string> {
- { "MonoTODOAttribute", "Mono TODO" },
- { "MonoNotSupportedAttribute", "Mono NOT SUPPORTED" },
- { "MonoLimitationAttribute", "Mono LIMITATION" }
- };
- void Check (AstNode node, IMember member)
- {
- foreach (var attr in member.Attributes) {
- if (attr.AttributeType.Namespace != "System")
- continue;
-
- string val;
- if (attributes.TryGetValue (attr.AttributeType.Name, out val)) {
- string msg = null;
- var arg = attr.PositionalArguments.FirstOrDefault ();
- if (arg != null)
- msg = arg.ConstantValue != null ? arg.ConstantValue.ToString () : null;
- Issues.Add (new CodeIssue (ICSharpCode.NRefactory.Refactoring.IssueMarker.WavedLine,
- string.IsNullOrEmpty (msg) ? val : val + ": " + msg,
- new DomRegion (node.StartLocation, node.EndLocation),
- issue.IdString
- ));
- }
- }
-
- }
-
- public override void VisitMemberReferenceExpression (MemberReferenceExpression memberReferenceExpression)
- {
- base.VisitMemberReferenceExpression (memberReferenceExpression);
- var rr = ctx.Resolve (memberReferenceExpression) as MemberResolveResult;
- if (rr == null || rr.IsError)
- return;
- Check (memberReferenceExpression, rr.Member);
- }
-
- public override void VisitIdentifierExpression (IdentifierExpression identifierExpression)
- {
- base.VisitIdentifierExpression (identifierExpression);
- var rr = ctx.Resolve (identifierExpression) as MemberResolveResult;
- if (rr == null || rr.IsError)
- return;
- Check (identifierExpression, rr.Member);
- }
-
- public override void VisitInvocationExpression (InvocationExpression invocationExpression)
- {
- base.VisitInvocationExpression (invocationExpression);
- var rr = ctx.Resolve (invocationExpression) as CSharpInvocationResolveResult;
- if (rr == null || rr.IsError)
- return;
- Check (invocationExpression, rr.Member);
- }
-
- public override void VisitBlockStatement (BlockStatement blockStatement)
- {
- ctx.CancellationToken.ThrowIfCancellationRequested ();
- base.VisitBlockStatement (blockStatement);
- }
- }
- }
-}
-
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NRefactoryCodeIssueSource.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NRefactoryCodeIssueSource.cs
deleted file mode 100644
index 678b3d4a66..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NRefactoryCodeIssueSource.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// NRefactoryCodeIssueSource.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using MonoDevelop.CodeIssues;
-using System.Collections.Generic;
-using MonoDevelop.CSharp.Refactoring.CodeActions;
-using ICSharpCode.NRefactory;
-using MonoDevelop.Ide.TypeSystem;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using MonoDevelop.Ide;
-using MonoDevelop.Projects;
-
-namespace MonoDevelop.CSharp.Refactoring.CodeIssues
-{
- class NRefactoryCodeIssueSource : ICodeIssueProviderSource
- {
- #region ICodeIssueProviderSource implementation
- public IEnumerable<CodeIssueProvider> GetProviders ()
- {
- foreach (var t in typeof (ICSharpCode.NRefactory.CSharp.Refactoring.AbstractAndVirtualConversionAction).Assembly.GetTypes ()) {
- var attr = t.GetCustomAttributes (typeof(ICSharpCode.NRefactory.CSharp.IssueDescriptionAttribute), false);
- if (attr == null || attr.Length != 1)
- continue;
- yield return new NRefactoryIssueProvider (
- (ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssueProvider)Activator.CreateInstance (t),
- (ICSharpCode.NRefactory.CSharp.IssueDescriptionAttribute)attr [0]);
- }
- }
- #endregion
- }
-}
-
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NRefactoryIssueProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NRefactoryIssueProvider.cs
deleted file mode 100644
index 61592e7e9b..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NRefactoryIssueProvider.cs
+++ /dev/null
@@ -1,219 +0,0 @@
-//
-// NRefactoryIssueWrapper.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Linq;
-using System.Collections.Generic;
-using ICSharpCode.NRefactory.CSharp;
-using MonoDevelop.Ide.Gui;
-using System.Threading;
-using MonoDevelop.CodeIssues;
-using MonoDevelop.CSharp.Refactoring.CodeActions;
-using MonoDevelop.Core;
-using Mono.TextEditor;
-using MonoDevelop.Core.Instrumentation;
-
-namespace MonoDevelop.CSharp.Refactoring.CodeIssues
-{
- class NRefactoryIssueProvider : CodeIssueProvider
- {
- readonly ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssueProvider issueProvider;
- readonly IssueDescriptionAttribute attr;
- readonly string providerIdString;
- readonly TimerCounter counter;
-
- public override string IdString {
- get {
- return "refactoring.codeissues." + MimeType + "." + issueProvider.GetType ().FullName;
- }
- }
-
- public override bool HasSubIssues {
- get {
- return issueProvider.HasSubIssues;
- }
- }
-
- readonly List<BaseCodeIssueProvider> subIssues;
- public override IEnumerable<BaseCodeIssueProvider> SubIssues {
- get {
- return subIssues;
- }
- }
-
- public ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssueProvider IssueProvider {
- get {
- return issueProvider;
- }
- }
-
- public string ProviderIdString {
- get {
- return providerIdString;
- }
- }
-
- public NRefactoryIssueProvider (ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssueProvider issue, IssueDescriptionAttribute attr)
- {
- issueProvider = issue;
- this.attr = attr;
- providerIdString = issueProvider.GetType ().FullName;
- Category = GettextCatalog.GetString (attr.Category ?? "");
- Title = GettextCatalog.GetString (attr.Title ?? "");
- Description = GettextCatalog.GetString (attr.Description ?? "");
- DefaultSeverity = attr.Severity;
- IsEnabledByDefault = attr.IsEnabledByDefault;
- SetMimeType ("text/x-csharp");
- subIssues = issueProvider.SubIssues.Select (subIssue => (BaseCodeIssueProvider)new BaseNRefactoryIssueProvider (this, subIssue)).ToList ();
-
- counter = InstrumentationService.CreateTimerCounter (IdString, "CodeIssueProvider run times");
- }
-
- public override IEnumerable<CodeIssue> GetIssues (object ctx, CancellationToken cancellationToken)
- {
- var context = ctx as MDRefactoringContext;
- if (context == null || context.IsInvalid || context.RootNode == null || context.ParsedDocument.HasErrors)
- return new CodeIssue[0];
-
- // Holds all the actions in a particular sibling group.
- IList<ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssue> issues;
- using (var timer = counter.BeginTiming ()) {
- // We need to enumerate here in order to time it.
- // This shouldn't be a problem since there are current very few (if any) lazy providers.
- var _issues = issueProvider.GetIssues (context);
- issues = _issues as IList<ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssue> ?? _issues.ToList ();
- }
- return ToMonoDevelopRepresentation (cancellationToken, context, issues);
- }
-
- IEnumerable<NRefactoryCodeAction> GetActions (ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssue issue, MDRefactoringContext context)
- {
- foreach (var action in issue.Actions)
- yield return new NRefactoryCodeAction (IdString, action.Description, action, action.SiblingKey);
-
- if (issue.ActionProvider != null) {
- foreach (var provider in issue.ActionProvider) {
- var boundActionProvider = (ICSharpCode.NRefactory.CSharp.Refactoring.CodeActionProvider)Activator.CreateInstance (provider);
- context.SetLocation (issue.Start);
- foreach (var action in boundActionProvider.GetActions (context)) {
- yield return new NRefactoryCodeAction (provider.FullName, action.Description, action, action.SiblingKey);
- }
- }
- }
- }
-
- internal IEnumerable<CodeIssue> ToMonoDevelopRepresentation (CancellationToken cancellationToken, MDRefactoringContext context, IEnumerable<ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssue> issues)
- {
- var actionGroups = new Dictionary<object, IList<MonoDevelop.CodeActions.CodeAction>> ();
- foreach (var issue in issues) {
- if (cancellationToken.IsCancellationRequested)
- yield break;
- if (issue.Actions == null) {
- LoggingService.LogError ("NRefactory actions == null in :" + Title);
- continue;
- }
- var actions = new List<NRefactoryCodeAction> ();
- foreach (var nrefactoryCodeAction in GetActions(issue, context)) {
- if (cancellationToken.IsCancellationRequested)
- yield break;
- if (nrefactoryCodeAction == null) {
- LoggingService.LogError ("NRefactory issue action was null in :" + Title);
- continue;
- }
- if (nrefactoryCodeAction.SiblingKey != null) {
- // make sure the action has a list of its siblings
- IList<MonoDevelop.CodeActions.CodeAction> siblingGroup;
- if (!actionGroups.TryGetValue (nrefactoryCodeAction.SiblingKey, out siblingGroup)) {
- siblingGroup = new List<MonoDevelop.CodeActions.CodeAction> ();
- actionGroups.Add (nrefactoryCodeAction.SiblingKey, siblingGroup);
- }
- siblingGroup.Add (nrefactoryCodeAction);
- nrefactoryCodeAction.SiblingActions = siblingGroup;
- }
- actions.Add (nrefactoryCodeAction);
- }
- yield return new CodeIssue (issue.IssueMarker, GettextCatalog.GetString (issue.Description ?? ""), context.TextEditor.FileName, issue.Start, issue.End, IdString, actions) {
- ActionProvider = issue.ActionProvider
- };
- }
- }
-
- public override bool CanDisableOnce { get { return !string.IsNullOrEmpty (attr.AnalysisDisableKeyword); } }
-
- public override bool CanDisableAndRestore { get { return !string.IsNullOrEmpty (attr.AnalysisDisableKeyword); } }
-
- public override bool CanDisableWithPragma { get { return attr.PragmaWarning > 0; } }
-
- public override bool CanSuppressWithAttribute { get { return !string.IsNullOrEmpty (attr.SuppressMessageCheckId); } }
-
- const string analysisDisableTag = "Analysis ";
-
- public override void DisableOnce (MonoDevelop.Ide.Gui.Document document, DocumentRegion loc)
- {
- document.Editor.Insert (
- document.Editor.LocationToOffset (loc.BeginLine, 1),
- document.Editor.IndentationTracker.GetIndentationString (loc.Begin) + "// " + analysisDisableTag + "disable once " + attr.AnalysisDisableKeyword + document.Editor.EolMarker
- );
- }
-
- public override void DisableAndRestore (MonoDevelop.Ide.Gui.Document document, DocumentRegion loc)
- {
- using (document.Editor.OpenUndoGroup ()) {
- document.Editor.Insert (
- document.Editor.LocationToOffset (loc.EndLine + 1, 1),
- document.Editor.IndentationTracker.GetIndentationString (loc.End) + "// " + analysisDisableTag + "restore " + attr.AnalysisDisableKeyword + document.Editor.EolMarker
- );
- document.Editor.Insert (
- document.Editor.LocationToOffset (loc.BeginLine, 1),
- document.Editor.IndentationTracker.GetIndentationString (loc.Begin) + "// " + analysisDisableTag + "disable " + attr.AnalysisDisableKeyword + document.Editor.EolMarker
- );
- }
- }
-
- public override void DisableWithPragma (MonoDevelop.Ide.Gui.Document document, DocumentRegion loc)
- {
- using (document.Editor.OpenUndoGroup ()) {
- document.Editor.Insert (
- document.Editor.LocationToOffset (loc.EndLine + 1, 1),
- document.Editor.IndentationTracker.GetIndentationString (loc.End) + "#pragma warning restore " + attr.PragmaWarning + document.Editor.EolMarker
- );
- document.Editor.Insert (
- document.Editor.LocationToOffset (loc.BeginLine, 1),
- document.Editor.IndentationTracker.GetIndentationString (loc.Begin) + "#pragma warning disable " + attr.PragmaWarning + document.Editor.EolMarker
- );
- }
- }
-
- public override void SuppressWithAttribute (MonoDevelop.Ide.Gui.Document document, DocumentRegion loc)
- {
- var member = document.ParsedDocument.GetMember (loc.End);
- document.Editor.Insert (
- document.Editor.LocationToOffset (member.Region.BeginLine, 1),
- document.Editor.IndentationTracker.GetIndentationString (loc.Begin) + string.Format ("[SuppressMessage(\"{0}\", \"{1}\")]" + document.Editor.EolMarker, attr.SuppressMessageCategory, attr.SuppressMessageCheckId)
- );
- }
- }
-}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/NameConventionEditRuleDialog.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/NameConventionEditRuleDialog.cs
deleted file mode 100644
index 574f10de7b..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/NameConventionEditRuleDialog.cs
+++ /dev/null
@@ -1,212 +0,0 @@
-//
-// NamingConventionEditRuleDialog.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-using System.Linq;
-using Gtk;
-using System.Collections.Generic;
-using MonoDevelop.Core;
-using ICSharpCode.NRefactory.CSharp;
-
-namespace MonoDevelop.CSharp.Refactoring.CodeIssues
-{
- partial class NameConventionEditRuleDialog : Gtk.Dialog
- {
- static readonly Dictionary<AffectedEntity, string> EntityName = new Dictionary<AffectedEntity, string> ();
- static readonly Dictionary<Modifiers, string> AccessibilityName = new Dictionary<Modifiers, string> ();
-
- static NameConventionEditRuleDialog ()
- {
- EntityName [AffectedEntity.Namespace] = GettextCatalog.GetString ("Namespaces");
-
- EntityName [AffectedEntity.Class] = GettextCatalog.GetString ("Classes");
- EntityName [AffectedEntity.Struct] = GettextCatalog.GetString ("Structs");
- EntityName [AffectedEntity.Enum] = GettextCatalog.GetString ("Enums");
- EntityName [AffectedEntity.Interface] = GettextCatalog.GetString ("Interfaces");
- EntityName [AffectedEntity.Delegate] = GettextCatalog.GetString ("Delegates");
-
- EntityName [AffectedEntity.CustomAttributes] = GettextCatalog.GetString ("Attributes");
- EntityName [AffectedEntity.CustomEventArgs] = GettextCatalog.GetString ("Event Arguments");
- EntityName [AffectedEntity.CustomExceptions] = GettextCatalog.GetString ("Exceptions");
-
- EntityName [AffectedEntity.Property] = GettextCatalog.GetString ("Properties");
- EntityName [AffectedEntity.AsyncMethod] = GettextCatalog.GetString ("Async methods");
- EntityName [AffectedEntity.Method] = GettextCatalog.GetString ("Methods");
- EntityName [AffectedEntity.Field] = GettextCatalog.GetString ("Fields");
- EntityName [AffectedEntity.ConstantField] = GettextCatalog.GetString ("Constant fields");
- EntityName [AffectedEntity.ReadonlyField] = GettextCatalog.GetString ("Readonly fields");
- EntityName [AffectedEntity.Event] = GettextCatalog.GetString ("Events");
- EntityName [AffectedEntity.EnumMember] = GettextCatalog.GetString ("Enum Members");
-
- EntityName [AffectedEntity.Parameter] = GettextCatalog.GetString ("Parameters");
- EntityName [AffectedEntity.TypeParameter] = GettextCatalog.GetString ("Type Parameters");
-
- // Unit test special case
- EntityName [AffectedEntity.TestType] = GettextCatalog.GetString ("Test Types");
- EntityName [AffectedEntity.TestMethod] = GettextCatalog.GetString ("Test Methods");
-
- // private entities
- EntityName [AffectedEntity.LambdaParameter] = GettextCatalog.GetString ("Lambda Parameters");
- EntityName [AffectedEntity.LocalVariable] = GettextCatalog.GetString ("Local Variables");
- EntityName [AffectedEntity.LocalConstant] = GettextCatalog.GetString ("Local Constants");
- EntityName [AffectedEntity.Label] = GettextCatalog.GetString ("Labels");
-
- AccessibilityName [Modifiers.Public] = GettextCatalog.GetString ("Public");
- AccessibilityName [Modifiers.Private] = GettextCatalog.GetString ("Private");
- AccessibilityName [Modifiers.Internal] = GettextCatalog.GetString ("Internal");
- AccessibilityName [Modifiers.Protected] = GettextCatalog.GetString ("Protected");
- }
-
- NameConventionRule rule;
-
- ListStore entityStore = new ListStore (typeof(string), typeof(AffectedEntity), typeof(bool));
- ListStore accessibiltyStore = new ListStore (typeof(string), typeof(Modifiers), typeof(bool));
-
- public NameConventionEditRuleDialog (NameConventionRule rule)
- {
- if (rule == null)
- throw new System.ArgumentNullException ("rule");
- this.rule = rule;
- this.Build ();
-
- var ct1 = new CellRendererToggle ();
- ct1.Toggled += delegate(object o, Gtk.ToggledArgs args) {
- TreeIter iter;
- if (!entityStore.GetIterFromString (out iter, args.Path))
- return;
- entityStore.SetValue (iter, 2, !(bool)entityStore.GetValue (iter, 2));
- };
- treeviewEntities.AppendColumn ("IsChecked", ct1, "active", 2);
- treeviewEntities.AppendColumn ("Entity", new CellRendererText (), "text", 0);
- treeviewEntities.Model = entityStore;
-
- var ct2 = new CellRendererToggle ();
- ct2.Toggled += delegate(object o, Gtk.ToggledArgs args) {
- TreeIter iter;
- if (!accessibiltyStore.GetIterFromString (out iter, args.Path))
- return;
- accessibiltyStore.SetValue (iter, 2, !(bool)accessibiltyStore.GetValue (iter, 2));
- };
- treeviewAccessibility.AppendColumn ("IsChecked", ct2, "active", 2);
- treeviewAccessibility.AppendColumn ("Entity", new CellRendererText (), "text", 0);
- treeviewAccessibility.Model = accessibiltyStore;
- buttonOk.Clicked += (sender, e) => Apply ();
-
- FillDialog ();
- }
-
- public void FillDialog ()
- {
- entryRuleName.Text = rule.Name ?? "";
- if (rule.RequiredPrefixes != null)
- entryPrefix.Text = rule.RequiredPrefixes.FirstOrDefault ();
- if (rule.AllowedPrefixes != null)
- entryPrefixAllowed.Text = string.Join (", ", rule.AllowedPrefixes);
- if (rule.RequiredSuffixes != null)
- entrySuffix.Text = rule.RequiredSuffixes.FirstOrDefault ();
- styleComboBox.AppendText ("PascalCase");
- styleComboBox.AppendText ("CamelCase");
- styleComboBox.AppendText ("ALLUPPER");
- styleComboBox.AppendText ("alllower");
- styleComboBox.AppendText ("Firstupper");
- styleComboBox.AppendText ("PascalCase_underscoreTolerant");
- styleComboBox.AppendText ("PascalCase_UnderscoreTolerant");
- styleComboBox.AppendText ("CamelCase_underscoreTolerant");
- styleComboBox.AppendText ("CamelCase_UnderscoreTolerant");
-
- styleComboBox.Active = (int)rule.NamingStyle - 1;
-
- foreach (AffectedEntity ae in Enum.GetValues (typeof (AffectedEntity))) {
- if (!EntityName.ContainsKey (ae))
- continue;
- entityStore.AppendValues (EntityName [ae], ae, rule.AffectedEntity.HasFlag (ae));
- }
-
- foreach (Modifiers mod in Enum.GetValues (typeof (Modifiers))) {
- if (!AccessibilityName.ContainsKey (mod))
- continue;
- accessibiltyStore.AppendValues (AccessibilityName [mod], mod, rule.VisibilityMask.HasFlag (mod));
- }
-
- checkbuttonStatic.Active = rule.IncludeStaticEntities;
- checkbuttonInstanceMembers.Active = rule.IncludeInstanceMembers;
-
- }
-
- public void Apply ()
- {
- rule.Name = entryRuleName.Text;
- rule.NamingStyle = (NamingStyle)(1 + styleComboBox.Active);
-
- var prefix = entryPrefix.Text.Trim ();
- if (string.IsNullOrEmpty (prefix)) {
- rule.RequiredPrefixes = null;
- } else {
- rule.RequiredPrefixes = new [] { prefix };
- }
-
- var allowedPrefix = entryPrefixAllowed.Text.Trim ();
- if (string.IsNullOrEmpty (allowedPrefix)) {
- rule.AllowedPrefixes = null;
- } else {
- rule.AllowedPrefixes = allowedPrefix.Split (',', ';').Select (s => s.Trim ()).ToArray ();
- }
-
- var suffix = entrySuffix.Text.Trim ();
- if (string.IsNullOrEmpty (suffix)) {
- rule.RequiredSuffixes = null;
- } else {
- rule.RequiredSuffixes = new [] { suffix };
- }
-
- var ae = AffectedEntity.None;
- TreeIter iter;
- if (entityStore.GetIterFirst (out iter)) {
- do {
- var entity = (AffectedEntity)entityStore.GetValue (iter, 1);
- var include = (bool)entityStore.GetValue (iter, 2);
- if (include)
- ae |= entity;
- } while (entityStore.IterNext (ref iter));
- }
- rule.AffectedEntity = ae;
-
- var mod = Modifiers.None;
- if (accessibiltyStore.GetIterFirst (out iter)) {
- do {
- var entity = (Modifiers)accessibiltyStore.GetValue (iter, 1);
- var include = (bool)accessibiltyStore.GetValue (iter, 2);
- if (include)
- mod |= entity;
- } while (accessibiltyStore.IterNext (ref iter));
- }
- rule.VisibilityMask = mod;
- rule.IncludeStaticEntities = checkbuttonStatic.Active;
- rule.IncludeInstanceMembers = checkbuttonInstanceMembers.Active;
- }
- }
-}
-
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/NameConventionPanel.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/NameConventionPanel.cs
deleted file mode 100644
index a8c3f7c0b3..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/NameConventionPanel.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// NamingConventionPanel.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin <http://xamarin.com>
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using MonoDevelop.Ide.Gui.Dialogs;
-using Gtk;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.CSharp.Refactoring.CodeIssues
-{
- class NameConventionPanel : PolicyOptionsPanel<NameConventionPolicy>
- {
- NameConventionPanelWidget panel;
-
- static NameConventionPanel ()
- {
- // ensure that custom text editor shemes are loaded.
- MonoDevelop.SourceEditor.SourceEditorDisplayBinding.InitSourceEditor ();
- }
-
- protected override string PolicyTitleWithMnemonic {
- get {
- return GettextCatalog.GetString ("_Naming Style");
- }
- }
-
- public override Widget CreatePanelWidget ()
- {
- panel = new NameConventionPanelWidget ();
- panel.PolicyChanged += delegate {
- UpdateSelectedNamedPolicy ();
- };
- return panel;
- }
-
- protected override void LoadFrom (NameConventionPolicy policy)
- {
- panel.Policy = policy.Clone ();
- }
-
- protected override NameConventionPolicy GetPolicy ()
- {
- // return cloned policy
- panel.ApplyChanges ();
- return panel.Policy;
- }
- }
-
-}
-
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/NameConventionPanelWidget.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/NameConventionPanelWidget.cs
deleted file mode 100644
index af5597e718..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/NameConventionPanelWidget.cs
+++ /dev/null
@@ -1,157 +0,0 @@
-//
-// NamingConventionPanelWidget.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using Gtk;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-using MonoDevelop.Core;
-using MonoDevelop.Ide;
-using System.Collections.Generic;
-
-namespace MonoDevelop.CSharp.Refactoring.CodeIssues
-{
- [System.ComponentModel.ToolboxItem(true)]
- partial class NameConventionPanelWidget : Gtk.Bin
- {
- TreeStore treeStore = new TreeStore (typeof(NameConventionRule));
- NameConventionPolicy policy;
-
- internal NameConventionPolicy Policy {
- get {
- return policy;
- }
- set {
- policy = value;
- FillRules (policy.Rules);
- }
- }
-
- public NameConventionPanelWidget ()
- {
- Build ();
- Show ();
-
- var ct1 = new CellRendererText ();
- var col1 = treeviewConventions.AppendColumn (GettextCatalog.GetString ("Rule"), ct1);
- col1.Expand = true;
- col1.SetCellDataFunc (ct1, delegate (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) {
- var rule = (NameConventionRule)model.GetValue (iter, 0);
- ct1.Text = rule.Name;
- });
-
-
- var ct2 = new CellRendererText ();
- var col2 = treeviewConventions.AppendColumn (GettextCatalog.GetString ("Example"), ct2);
- col2.Expand = true;
- col2.SetCellDataFunc (ct2, delegate (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter) {
- var rule = (NameConventionRule)model.GetValue (iter, 0);
- ct2.Text = rule.GetPreview ();
- });
-
- treeviewConventions.Model = treeStore;
- treeviewConventions.Selection.Changed += HandleSelectionChanged;
- treeviewConventions.RowActivated += (o, args) => EditSelectedEntry ();
- buttonEdit.Clicked += (o, s) => EditSelectedEntry ();
- buttonRemove.Clicked += (o, s) => RemoveSelectedEntry ();
- buttonAdd.Clicked += (o, s) => AddEntry ();
-
- HandleSelectionChanged (null, null);
- }
-
- void HandleSelectionChanged (object sender, EventArgs e)
- {
- TreeIter iter;
- buttonEdit.Sensitive = treeviewConventions.Selection.GetSelected (out iter);
- }
-
- public void ApplyChanges ()
- {
- var rules = new List<NameConventionRule> ();
- TreeIter iter;
- if (treeStore.GetIterFirst (out iter)) {
- do {
- var rule = (NameConventionRule)treeStore.GetValue (iter, 0);
- rules.Add (rule);
- } while (treeStore.IterNext (ref iter));
- }
- policy.Rules = rules.ToArray ();
- if (IdeApp.Workbench.ActiveDocument != null)
- IdeApp.Workbench.ActiveDocument.UpdateParseDocument ();
- }
-
- void AddEntry ()
- {
- var newRule = new NameConventionRule ();
- newRule.Name = "New Rule";
- using (var diag = new NameConventionEditRuleDialog (newRule)) {
- var result = MessageService.ShowCustomDialog (diag);
- if (result == (int)ResponseType.Ok)
- treeStore.AppendValues (newRule);
- OnPolicyChanged (EventArgs.Empty);
- }
- }
-
- void EditSelectedEntry ()
- {
- TreeIter iter;
- if (!treeviewConventions.Selection.GetSelected (out iter))
- return;
- var rule = treeStore.GetValue (iter, 0) as NameConventionRule;
- using (var diag = new NameConventionEditRuleDialog (rule)) {
- int result = MessageService.ShowCustomDialog (diag);
- treeviewConventions.QueueResize ();
- if (result == (int)Gtk.ResponseType.Ok)
- OnPolicyChanged (EventArgs.Empty);
- }
- }
-
- void RemoveSelectedEntry ()
- {
- TreeIter iter;
- if (!treeviewConventions.Selection.GetSelected (out iter))
- return;
- treeStore.Remove (ref iter);
- OnPolicyChanged (EventArgs.Empty);
- }
-
- void FillRules (IEnumerable<NameConventionRule> rules)
- {
- treeStore.Clear ();
- foreach (var rule in rules) {
- treeStore.AppendValues (rule);
- }
- }
-
- protected virtual void OnPolicyChanged (EventArgs e)
- {
- var handler = PolicyChanged;
- if (handler != null)
- handler (this, e);
- }
-
- public event EventHandler PolicyChanged;
- }
-}
-
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/NameConventionPolicy.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/NameConventionPolicy.cs
deleted file mode 100644
index ac1fb31bde..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/NameConventionPolicy.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-//
-// NamingConventions.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Linq;
-using System.Collections.Generic;
-using MonoDevelop.Projects.Policies;
-using MonoDevelop.Core.Serialization;
-using ICS = ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-
-namespace MonoDevelop.CSharp.Refactoring.CodeIssues
-{
- [PolicyType ("Naming Conventions Policy")]
- class NameConventionPolicy : IEquatable<NameConventionPolicy>
- {
- NameConventionRule[] rules = new NameConventionRule[0];
-
- [ItemProperty]
- public NameConventionRule[] Rules {
- get { return rules; }
- set { rules = value; }
- }
-
- public NameConventionPolicy Clone ()
- {
- var result = new NameConventionPolicy ();
- result.rules = new List<NameConventionRule> (rules.Select (r => r.Clone ())).ToArray ();
- return result;
- }
-
- public NameConventionPolicy ()
- {
- rules = new List<NameConventionRule> (DefaultRules.GetFdgRules ().Select (r => new NameConventionRule (r))).ToArray ();
- }
-
- class NamingConventionService : ICSharpCode.NRefactory.CSharp.Refactoring.NamingConventionService
- {
- NameConventionPolicy policy;
- ICSharpCode.NRefactory.CSharp.Refactoring.NamingRule[] rules = null;
- public override IEnumerable<ICSharpCode.NRefactory.CSharp.Refactoring.NamingRule> Rules {
- get {
- if (rules == null) {
- this.rules = policy.Rules.Select (r => r.GetNRefactoryRule ()).ToArray ();
- }
- return rules;
- }
- }
-
- public NamingConventionService (MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionPolicy policy)
- {
- this.policy = policy;
- }
-
- }
-
- public ICSharpCode.NRefactory.CSharp.Refactoring.NamingConventionService CreateNRefactoryService ()
- {
- return new NamingConventionService (this);
- }
-
- #region IEquatable implementation
- public bool Equals (NameConventionPolicy other)
- {
- if (Rules.Length != other.Rules.Length)
- return false;
- for (int i = 0; i < rules.Length; i++) {
- if (!rules [i].Equals (other.Rules[i]))
- return false;
- }
- return true;
- }
- #endregion
- }
-} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/NameConventionRule.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/NameConventionRule.cs
deleted file mode 100644
index 358b505fcd..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/NamingInspection/NameConventionRule.cs
+++ /dev/null
@@ -1,131 +0,0 @@
-//
-// NamingRule.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Text;
-using MonoDevelop.Projects.Policies;
-using MonoDevelop.Core.Serialization;
-
-namespace MonoDevelop.CSharp.Refactoring.CodeIssues
-{
- [DataItem ("NamingRule")]
- public class NameConventionRule
- {
- ICSharpCode.NRefactory.CSharp.Refactoring.NamingRule wrappedRule = new ICSharpCode.NRefactory.CSharp.Refactoring.NamingRule (ICSharpCode.NRefactory.CSharp.Refactoring.AffectedEntity.None);
-
- [ItemProperty]
- public string Name {
- get { return wrappedRule.Name; }
- set { wrappedRule.Name = value;}
- }
-
- [ItemProperty]
- public string[] RequiredPrefixes {
- get { return wrappedRule.RequiredPrefixes; }
- set { wrappedRule.RequiredPrefixes = value;}
- }
-
- [ItemProperty]
- public string[] AllowedPrefixes {
- get { return wrappedRule.AllowedPrefixes; }
- set { wrappedRule.AllowedPrefixes = value;}
- }
-
- [ItemProperty]
- public string[] RequiredSuffixes {
- get { return wrappedRule.RequiredSuffixes; }
- set { wrappedRule.RequiredSuffixes = value;}
- }
-
- [ItemProperty]
- public string[] ForbiddenPrefixes {
- get { return wrappedRule.ForbiddenPrefixes; }
- set { wrappedRule.ForbiddenPrefixes = value;}
- }
-
- [ItemProperty]
- public string[] ForbiddenSuffixes {
- get { return wrappedRule.ForbiddenSuffixes; }
- set { wrappedRule.ForbiddenSuffixes = value;}
- }
-
- [ItemProperty]
- public ICSharpCode.NRefactory.CSharp.Refactoring.AffectedEntity AffectedEntity {
- get { return wrappedRule.AffectedEntity; }
- set { wrappedRule.AffectedEntity = value;}
- }
-
- [ItemProperty]
- public ICSharpCode.NRefactory.CSharp.Modifiers VisibilityMask {
- get { return wrappedRule.VisibilityMask; }
- set { wrappedRule.VisibilityMask = value;}
- }
-
- [ItemProperty]
- public ICSharpCode.NRefactory.CSharp.Refactoring.NamingStyle NamingStyle {
- get { return wrappedRule.NamingStyle; }
- set { wrappedRule.NamingStyle = value;}
- }
-
- [ItemProperty]
- public bool IncludeInstanceMembers {
- get { return wrappedRule.IncludeInstanceMembers; }
- set { wrappedRule.IncludeInstanceMembers = value;}
- }
-
- [ItemProperty]
- public bool IncludeStaticEntities {
- get { return wrappedRule.IncludeStaticEntities; }
- set { wrappedRule.IncludeStaticEntities = value;}
- }
-
- internal NameConventionRule (ICSharpCode.NRefactory.CSharp.Refactoring.NamingRule wrappedRule)
- {
- this.wrappedRule = wrappedRule;
- }
-
- public NameConventionRule ()
- {
- }
-
- public NameConventionRule Clone ()
- {
- return new NameConventionRule () {
- wrappedRule = this.wrappedRule.Clone ()
- };
- }
-
- public string GetPreview ()
- {
- return wrappedRule.GetPreview ();
- }
-
- internal ICSharpCode.NRefactory.CSharp.Refactoring.NamingRule GetNRefactoryRule ()
- {
- return wrappedRule;
- }
- }
-}
-
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerationService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerationService.cs
index 18cb6df5f9..a28f8a3750 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerationService.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerationService.cs
@@ -1,62 +1,62 @@
+////
+//// CSharpCodeGenerationService.cs
+////
+//// Author:
+//// Mike Krüger <mkrueger@xamarin.com>
+////
+//// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
+////
+//// Permission is hereby granted, free of charge, to any person obtaining a copy
+//// of this software and associated documentation files (the "Software"), to deal
+//// in the Software without restriction, including without limitation the rights
+//// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+//// copies of the Software, and to permit persons to whom the Software is
+//// furnished to do so, subject to the following conditions:
+////
+//// The above copyright notice and this permission notice shall be included in
+//// all copies or substantial portions of the Software.
+////
+//// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+//// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+//// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+//// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+//// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+//// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+//// THE SOFTWARE.
+//using System;
+//using ICSharpCode.NRefactory.CSharp;
+//using ICSharpCode.NRefactory.TypeSystem;
+//using ICSharpCode.NRefactory.CSharp.Refactoring;
+//using System.Linq;
+//using Atk;
+//using Gdk;
//
-// CSharpCodeGenerationService.cs
+//namespace MonoDevelop.CSharp.Refactoring
+//{
+// public class CSharpCodeGenerationService : DefaultCodeGenerationService
+// {
+// public override EntityDeclaration GenerateMemberImplementation (RefactoringContext context, IMember member, bool explicitImplementation)
+// {
+// var result = base.GenerateMemberImplementation (context, member, explicitImplementation);
+// if (CSharpCodeGenerator.IsMonoTouchModelMember (member)) {
+// var m = result as MethodDeclaration;
+// if (m != null) {
+// for (int i = CSharpCodeGenerator.MonoTouchComments.Length - 1; i >= 0; i--) {
+// m.Body.InsertChildBefore (m.Body.Statements.First (), new Comment (CSharpCodeGenerator.MonoTouchComments [i]), Roles.Comment);
+// }
+// }
//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-using System.Linq;
-using Atk;
-using Gdk;
-
-namespace MonoDevelop.CSharp.Refactoring
-{
- public class CSharpCodeGenerationService : DefaultCodeGenerationService
- {
- public override EntityDeclaration GenerateMemberImplementation (RefactoringContext context, IMember member, bool explicitImplementation)
- {
- var result = base.GenerateMemberImplementation (context, member, explicitImplementation);
- if (CSharpCodeGenerator.IsMonoTouchModelMember (member)) {
- var m = result as MethodDeclaration;
- if (m != null) {
- for (int i = CSharpCodeGenerator.MonoTouchComments.Length - 1; i >= 0; i--) {
- m.Body.InsertChildBefore (m.Body.Statements.First (), new Comment (CSharpCodeGenerator.MonoTouchComments [i]), Roles.Comment);
- }
- }
-
- var p = result as PropertyDeclaration;
- if (p != null) {
- for (int i = CSharpCodeGenerator.MonoTouchComments.Length - 1; i >= 0; i--) {
- if (!p.Getter.IsNull)
- p.Getter.Body.InsertChildBefore (p.Getter.Body.Statements.First (), new Comment (CSharpCodeGenerator.MonoTouchComments [i]), Roles.Comment);
- if (!p.Setter.IsNull)
- p.Setter.Body.InsertChildBefore (p.Setter.Body.Statements.First (), new Comment (CSharpCodeGenerator.MonoTouchComments [i]), Roles.Comment);
- }
- }
- }
- return result;
- }
- }
-}
+// var p = result as PropertyDeclaration;
+// if (p != null) {
+// for (int i = CSharpCodeGenerator.MonoTouchComments.Length - 1; i >= 0; i--) {
+// if (!p.Getter.IsNull)
+// p.Getter.Body.InsertChildBefore (p.Getter.Body.Statements.First (), new Comment (CSharpCodeGenerator.MonoTouchComments [i]), Roles.Comment);
+// if (!p.Setter.IsNull)
+// p.Setter.Body.InsertChildBefore (p.Setter.Body.Statements.First (), new Comment (CSharpCodeGenerator.MonoTouchComments [i]), Roles.Comment);
+// }
+// }
+// }
+// return result;
+// }
+// }
+//}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs
index 5f6cd6b4f5..c1bff90270 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerator.cs
@@ -1,5 +1,5 @@
//
-// CSharpCodecs
+// CSharpCodeGenerator.cs
//
// Author:
// Mike Krüger <mkrueger@novell.com>
@@ -23,85 +23,106 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+
using System;
-using ICSharpCode.NRefactory.CSharp;
-using System.Text;
-using MonoDevelop.CSharp.Formatting;
-using System.Collections.Generic;
using System.Linq;
-using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.CSharp.Resolver;
+using Microsoft.CodeAnalysis;
+using System.Text;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide;
+using System.Collections.Generic;
+using MonoDevelop.CSharp.Formatting;
+using Microsoft.CodeAnalysis.Options;
+using MonoDevelop.CSharp.Completion;
+using System.Threading;
using ICSharpCode.NRefactory;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
-using MonoDevelop.Projects.Policies;
-using Mono.Cecil;
-using Mono.Cecil.Cil;
-using ICSharpCode.Decompiler;
-using ICSharpCode.Decompiler.Ast;
-using ICSharpCode.NRefactory.PatternMatching;
-using ICSharpCode.NRefactory.TypeSystem.Implementation;
-
namespace MonoDevelop.CSharp.Refactoring
{
class CSharpCodeGenerator : CodeGenerator
{
- static CSharpAmbience ambience = new CSharpAmbience ();
-
- CSharpFormattingPolicy policy;
-
- public MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy Policy {
- get {
- if (policy == null) {
- var types = MonoDevelop.Ide.DesktopService.GetMimeTypeInheritanceChain (MonoDevelop.CSharp.Formatting.CSharpFormatter.MimeType);
- if (PolicyParent != null)
- policy = PolicyParent.Get<CSharpFormattingPolicy> (types);
- if (policy == null) {
-
- policy = MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<CSharpFormattingPolicy> (types);
- }
- }
- return this.policy;
- }
- }
-
- public override PolicyContainer PolicyParent {
- get {
- return base.PolicyParent;
- }
- set {
- base.PolicyParent = value;
- var types = MonoDevelop.Ide.DesktopService.GetMimeTypeInheritanceChain (MonoDevelop.CSharp.Formatting.CSharpFormatter.MimeType);
- policy = value.Get<CSharpFormattingPolicy> (types);
- }
- }
-
-
+ // static CSharpAmbience ambience = new CSharpAmbience ();
+ //
+ // CSharpFormattingPolicy policy;
+ //
+ // public MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy Policy {
+ // get {
+ // if (policy == null) {
+ // var types = MonoDevelop.Ide.DesktopService.GetMimeTypeInheritanceChain (MonoDevelop.CSharp.Formatting.CSharpFormatter.MimeType);
+ // if (PolicyParent != null)
+ // policy = PolicyParent.Get<CSharpFormattingPolicy> (types);
+ // if (policy == null) {
+ //
+ // policy = MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<CSharpFormattingPolicy> (types);
+ // }
+ // }
+ // return this.policy;
+ // }
+ // }
+ //
+ // public override PolicyContainer PolicyParent {
+ // get {
+ // return base.PolicyParent;
+ // }
+ // set {
+ // base.PolicyParent = value;
+ // var types = MonoDevelop.Ide.DesktopService.GetMimeTypeInheritanceChain (MonoDevelop.CSharp.Formatting.CSharpFormatter.MimeType);
+ // policy = value.Get<CSharpFormattingPolicy> (types);
+ // }
+ // }
+ //
+ //
class CodeGenerationOptions
{
public bool ExplicitDeclaration { get; set; }
- public ITypeDefinition ImplementingType { get; set; }
- public IUnresolvedTypeDefinition Part { get; set; }
+ public ITypeSymbol ImplementingType { get; set; }
+ public Location Part { get; set; }
+
+ public TextEditor Editor { get; set; }
+ public DocumentContext DocumentContext { get; set; }
+
+ public bool CreateProtocolMember { get; set; }
+
+ SemanticModel semanticModel;
+ public SemanticModel SemanticModel {
+ get {
+ if (semanticModel == null) {
+ var model = DocumentContext.ParsedDocument.GetAst<SemanticModel> ();
+ return model;
+ }
+ return semanticModel;
+ }
- public MonoDevelop.Ide.Gui.Document Document { get; set; }
+ set {
+ semanticModel = value;
+ }
+ }
- public string GetShortType (string ns, string name, int typeArguments = 0)
+ public string GetShortType(string ns, string name, int typeArguments = 0)
{
- if (Document == null || Document.ParsedDocument == null)
+ if (DocumentContext == null || Editor == null || SemanticModel == null || DocumentContext.ParsedDocument == null)
return ns + "." + name;
- var typeDef = new GetClassTypeReference (ns, name, typeArguments).Resolve (Document.Compilation.TypeResolveContext);
- if (typeDef == null)
+
+ var model = DocumentContext.ParsedDocument.GetAst<SemanticModel>();
+
+ if (model == null)
+ return ns + "." + name;
+
+ var type = model.Compilation.GetTypeByMetadataName(ns + "." + name);
+ if (type == null)
return ns + "." + name;
- var file = Document.ParsedDocument.ParsedFile as CSharpUnresolvedFile;
- var csResolver = file.GetResolver (Document.Compilation, Document.Editor.Caret.Location);
- var builder = new ICSharpCode.NRefactory.CSharp.Refactoring.TypeSystemAstBuilder (csResolver);
- return OutputNode (Document, builder.ConvertType (typeDef));
+
+
+ return RoslynCompletionData.SafeMinimalDisplayString (type, model, Editor.CaretOffset, Ambience.LabelFormat);
}
}
-
+
+ static void AppendLine(StringBuilder sb)
+ {
+ sb.AppendLine();
+ }
+
public override string WrapInRegions (string regionName, string text)
{
StringBuilder result = new StringBuilder ();
@@ -116,265 +137,305 @@ namespace MonoDevelop.CSharp.Refactoring
return result.ToString ();
}
- void AppendObsoleteAttribute (StringBuilder result, CodeGenerationOptions options, IEntity entity)
+ static void AppendObsoleteAttribute(StringBuilder result, CodeGenerationOptions options, ISymbol entity)
{
- string reason;
- if (!entity.IsObsolete (out reason))
- return;
-
- var implementingType = options.Part;
- var loc = implementingType.Region.End;
-
- var pf = implementingType.UnresolvedFile;
- var file = pf as CSharpUnresolvedFile;
-
- result.Append ("[");
- var obsoleteRef = ReflectionHelper.ParseReflectionName ("System.ObsoleteAttribute");
- var resolvedType = obsoleteRef.Resolve (options.ImplementingType.Compilation);
- var shortType = resolvedType.Kind != TypeKind.Unknown ? CreateShortType (options.ImplementingType.Compilation, file, loc, resolvedType) : null;
- var text = shortType != null ? shortType.ToString () : "System.Obsolete";
- if (text.EndsWith ("Attribute", StringComparison.Ordinal))
- text = text.Substring (0, text.Length - "Attribute".Length);
- result.Append (text);
- if (!string.IsNullOrEmpty (reason)) {
- result.Append (" (\"");
- result.Append (reason);
- result.Append ("\")");
- }
- result.Append ("]");
- result.AppendLine ();
+ // TODO: Roslyn port
+ // string reason;
+ // if (!entity.IsObsolete (out reason))
+ // return;
+ //
+ // var implementingType = options.Part;
+ // var loc = implementingType.Region.End;
+ //
+ // var pf = implementingType.UnresolvedFile;
+ // var file = pf as CSharpUnresolvedFile;
+ //
+ // result.Append ("[");
+ // var obsoleteRef = ReflectionHelper.ParseReflectionName ("System.ObsoleteAttribute");
+ // var resolvedType = obsoleteRef.Resolve (options.ImplementingType.Compilation);
+ // var shortType = resolvedType.Kind != TypeKind.Unknown ? CreateShortType (options.ImplementingType.Compilation, file, loc, resolvedType) : null;
+ // var text = shortType != null ? shortType.ToString () : "System.Obsolete";
+ // if (text.EndsWith ("Attribute", StringComparison.Ordinal))
+ // text = text.Substring (0, text.Length - "Attribute".Length);
+ // result.Append (text);
+ // if (!string.IsNullOrEmpty (reason)) {
+ // result.Append (" (\"");
+ // result.Append (reason);
+ // result.Append ("\")");
+ // }
+ // result.Append ("]");
+ // result.AppendLine ();
}
-
- public override CodeGeneratorMemberResult CreateMemberImplementation (ITypeDefinition implementingType,
- IUnresolvedTypeDefinition part,
- IUnresolvedMember member,
- bool explicitDeclaration)
+ //
+ // public override CodeGeneratorMemberResult CreateMemberImplementation (ITypeDefinition implementingType,
+ // IUnresolvedTypeDefinition part,
+ // IUnresolvedMember member,
+ // bool explicitDeclaration)
+ // {
+ // SetIndentTo (part);
+ // var options = new CodeGenerationOptions () {
+ // ExplicitDeclaration = explicitDeclaration,
+ // ImplementingType = implementingType,
+ // Part = part
+ // };
+ // ITypeResolveContext ctx;
+ //
+ // var doc = IdeApp.Workbench.GetDocument (part.Region.FileName);
+ // ctx = new CSharpTypeResolveContext (implementingType.Compilation.MainAssembly, null, implementingType, null);
+ // options.Document = doc;
+ //
+ // if (member is IUnresolvedMethod)
+ // return GenerateCode ((IMethod) ((IUnresolvedMethod)member).CreateResolved (ctx), options);
+ // if (member is IUnresolvedProperty)
+ // return GenerateCode ((IProperty) ((IUnresolvedProperty)member).CreateResolved (ctx), options);
+ // if (member is IUnresolvedField)
+ // return GenerateCode ((IField) ((IUnresolvedField)member).CreateResolved (ctx), options);
+ // if (member is IUnresolvedEvent)
+ // return GenerateCode ((IEvent) ((IUnresolvedEvent)member).CreateResolved (ctx), options);
+ // throw new NotSupportedException ("member " + member + " is not supported.");
+ // }
+
+ public static CodeGeneratorMemberResult CreateOverridenMemberImplementation(DocumentContext document, TextEditor editor, ITypeSymbol implementingType, Location part, ISymbol member, bool explicitDeclaration, SemanticModel model)
{
- SetIndentTo (part);
- var options = new CodeGenerationOptions () {
+ var options = new CodeGenerationOptions {
ExplicitDeclaration = explicitDeclaration,
ImplementingType = implementingType,
- Part = part
+ Part = part,
+ DocumentContext = document,
+ Editor = editor,
+ SemanticModel = model
};
- ITypeResolveContext ctx;
-
- var doc = IdeApp.Workbench.GetDocument (part.Region.FileName);
- ctx = new CSharpTypeResolveContext (implementingType.Compilation.MainAssembly, null, implementingType, null);
- options.Document = doc;
-
- if (member is IUnresolvedMethod)
- return GenerateCode ((IMethod) ((IUnresolvedMethod)member).CreateResolved (ctx), options);
- if (member is IUnresolvedProperty)
- return GenerateCode ((IProperty) ((IUnresolvedProperty)member).CreateResolved (ctx), options);
- if (member is IUnresolvedField)
- return GenerateCode ((IField) ((IUnresolvedField)member).CreateResolved (ctx), options);
- if (member is IUnresolvedEvent)
- return GenerateCode ((IEvent) ((IUnresolvedEvent)member).CreateResolved (ctx), options);
- throw new NotSupportedException ("member " + member + " is not supported.");
+
+ if (member is IMethodSymbol)
+ return GenerateCode ((IMethodSymbol)member, options);
+ if (member is IPropertySymbol)
+ return GenerateCode ((IPropertySymbol)member, options);
+ if (member is IFieldSymbol)
+ return GenerateCode ((IFieldSymbol)member, options);
+ if (member is IEventSymbol)
+ return GenerateCode ((IEventSymbol)member, options);
+ throw new NotSupportedException("member " + member + " is not supported.");
}
-
- public override CodeGeneratorMemberResult CreateMemberImplementation (ITypeDefinition implementingType,
- IUnresolvedTypeDefinition part,
- IMember member,
- bool explicitDeclaration)
+
+ public static CodeGeneratorMemberResult CreateProtocolMemberImplementation(DocumentContext document, TextEditor editor, ITypeSymbol implementingType, Location part, ISymbol member, bool explicitDeclaration, SemanticModel model)
{
- SetIndentTo (part);
- var options = new CodeGenerationOptions () {
+ // SetIndentTo (part);
+ var options = new CodeGenerationOptions {
ExplicitDeclaration = explicitDeclaration,
ImplementingType = implementingType,
Part = part,
- Document = IdeApp.Workbench.GetDocument (part.Region.FileName)
+ DocumentContext = document,
+ Editor = editor,
+ CreateProtocolMember = true,
+ SemanticModel = model
};
- if (member is IMethod)
- return GenerateCode ((IMethod)member, options);
- if (member is IProperty)
- return GenerateCode ((IProperty)member, options);
- if (member is IField)
- return GenerateCode ((IField)member, options);
- if (member is IEvent)
- return GenerateCode ((IEvent)member, options);
- throw new NotSupportedException ("member " + member + " is not supported.");
- }
-
- void AppendBraceStart (StringBuilder result, BraceStyle braceStyle)
- {
- switch (braceStyle) {
- case BraceStyle.BannerStyle:
- case BraceStyle.EndOfLine:
- result.Append (" {");
- AppendLine (result);
- break;
- case BraceStyle.EndOfLineWithoutSpace:
- result.Append ("{");
- AppendLine (result);
- break;
- case BraceStyle.NextLine:
- AppendLine (result);
- AppendIndent (result);
- result.Append ("{");
- AppendLine (result);
- break;
- case BraceStyle.NextLineShifted:
- AppendLine (result);
- result.Append (GetIndent (IndentLevel + 1));
- result.Append ("{");
- AppendLine (result);
- break;
- case BraceStyle.NextLineShifted2:
- AppendLine (result);
- result.Append (GetIndent (IndentLevel + 1));
- result.Append ("{");
- AppendLine (result);
- IndentLevel++;
- break;
- default:
- goto case BraceStyle.NextLine;
- }
- IndentLevel++;
- }
-
- void AppendBraceEnd (StringBuilder result, BraceStyle braceStyle)
- {
- switch (braceStyle) {
- case BraceStyle.EndOfLineWithoutSpace:
- case BraceStyle.NextLine:
- case BraceStyle.EndOfLine:
- IndentLevel --;
- AppendIndent (result);
- result.Append ("}");
- break;
- case BraceStyle.BannerStyle:
- case BraceStyle.NextLineShifted:
- AppendIndent (result);
- result.Append ("}");
- IndentLevel--;
- break;
- case BraceStyle.NextLineShifted2:
- IndentLevel--;
- AppendIndent (result);
- result.Append ("}");
- IndentLevel--;
- break;
- default:
- goto case BraceStyle.NextLine;
- }
+
+ if (member is IMethodSymbol)
+ return GenerateProtocolCode ((IMethodSymbol)member, options);
+ if (member is IPropertySymbol)
+ return GenerateCode ((IPropertySymbol)member, options);
+ if (member is IFieldSymbol)
+ return GenerateCode ((IFieldSymbol)member, options);
+ if (member is IEventSymbol)
+ return GenerateCode ((IEventSymbol)member, options);
+ throw new NotSupportedException("member " + member + " is not supported.");
}
-
- void AppendIndent (StringBuilder result)
+
+ public static CodeGeneratorMemberResult CreatePartialMemberImplementation(DocumentContext document, TextEditor editor, ITypeSymbol implementingType, Location part, ISymbol member, bool explicitDeclaration, SemanticModel model)
{
- result.Append (GetIndent (IndentLevel));
+ var options = new CodeGenerationOptions {
+ ExplicitDeclaration = explicitDeclaration,
+ ImplementingType = implementingType,
+ Part = part,
+ DocumentContext = document,
+ Editor = editor,
+ SemanticModel = model
+ };
+
+ if (member is IMethodSymbol)
+ return GeneratePartialCode ((IMethodSymbol)member, options);
+ throw new NotSupportedException("member " + member + " is not supported.");
}
-
- void AppendReturnType (StringBuilder result, CodeGenerationOptions options, IType type)
+ //
+ // void AppendBraceStart (StringBuilder result, BraceStyle braceStyle)
+ // {
+ // switch (braceStyle) {
+ // case BraceStyle.BannerStyle:
+ // case BraceStyle.EndOfLine:
+ // result.Append (" {");
+ // AppendLine (result);
+ // break;
+ // case BraceStyle.EndOfLineWithoutSpace:
+ // result.Append ("{");
+ // AppendLine (result);
+ // break;
+ // case BraceStyle.NextLine:
+ // AppendLine (result);
+ // AppendIndent (result);
+ // result.Append ("{");
+ // AppendLine (result);
+ // break;
+ // case BraceStyle.NextLineShifted:
+ // AppendLine (result);
+ // result.Append (GetIndent (IndentLevel + 1));
+ // result.Append ("{");
+ // AppendLine (result);
+ // break;
+ // case BraceStyle.NextLineShifted2:
+ // AppendLine (result);
+ // result.Append (GetIndent (IndentLevel + 1));
+ // result.Append ("{");
+ // AppendLine (result);
+ // IndentLevel++;
+ // break;
+ // default:
+ // goto case BraceStyle.NextLine;
+ // }
+ // IndentLevel++;
+ // }
+ //
+ // void AppendBraceEnd (StringBuilder result, BraceStyle braceStyle)
+ // {
+ // switch (braceStyle) {
+ // case BraceStyle.EndOfLineWithoutSpace:
+ // case BraceStyle.NextLine:
+ // case BraceStyle.EndOfLine:
+ // IndentLevel --;
+ // AppendIndent (result);
+ // result.Append ("}");
+ // break;
+ // case BraceStyle.BannerStyle:
+ // case BraceStyle.NextLineShifted:
+ // AppendIndent (result);
+ // result.Append ("}");
+ // IndentLevel--;
+ // break;
+ // case BraceStyle.NextLineShifted2:
+ // IndentLevel--;
+ // AppendIndent (result);
+ // result.Append ("}");
+ // IndentLevel--;
+ // break;
+ // default:
+ // goto case BraceStyle.NextLine;
+ // }
+ // }
+ //
+ // void AppendIndent (StringBuilder result)
+ // {
+ // result.Append (GetIndent (IndentLevel));
+ // }
+ //
+ static void AppendReturnType(StringBuilder result, CodeGenerationOptions options, ITypeSymbol type)
{
if (type == null)
- throw new ArgumentNullException ("type");
- var implementingType = options.Part;
- var loc = implementingType.Region.End;
-
- var pf = implementingType.UnresolvedFile;
- var file = pf as CSharpUnresolvedFile;
- var resolved = type;
- if (resolved.Kind == TypeKind.Unknown) {
- result.Append (type.FullName);
- return;
- }
- var def = type.GetDefinition ();
- if (def != null) {
- using (var stringWriter = new System.IO.StringWriter ()) {
- var formatter = new TextWriterTokenWriter (stringWriter);
- stringWriter.NewLine = EolMarker;
- var visitor = new CSharpOutputVisitor (formatter, FormattingOptionsFactory.CreateMono ());
- var shortType = CreateShortType (def.Compilation, file, loc, resolved);
- shortType.AcceptVisitor (visitor);
-
- var typeString = stringWriter.ToString ();
- if (typeString.StartsWith ("global::"))
- typeString = typeString.Substring ("global::".Length);
- result.Append (typeString);
- }
- } else {
- result.Append (new ICSharpCode.NRefactory.CSharp.CSharpAmbience ().ConvertType (type));
- }
- }
-
- /*
- void ResolveReturnTypes ()
- {
- returnType = member.ReturnType;
- foreach (IUsing u in unit.Usings) {
- foreach (KeyValuePair<string, IReturnType> alias in u.Aliases) {
- if (alias.Key == member.ReturnType.FullName) {
- returnType = alias.Value;
- return;
- }
- }
- }
- }*/
+ throw new ArgumentNullException("type");
+ result.Append(RoslynCompletionData.SafeMinimalDisplayString (type, options.SemanticModel, options.Part.SourceSpan.Start, Ambience.LabelFormat));
-
- CodeGeneratorMemberResult GenerateCode (IField field, CodeGenerationOptions options)
+ // var implementingType = options.Part;
+ // var loc = implementingType.Region.End;
+ //
+ // var pf = implementingType.UnresolvedFile;
+ // var file = pf as CSharpUnresolvedFile;
+ // var resolved = type;
+ // if (resolved.Kind == TypeKind.Unknown) {
+ // result.Append (type.FullName);
+ // return;
+ // }
+ // var def = type.GetDefinition ();
+ // if (def != null) {
+ // using (var stringWriter = new System.IO.StringWriter ()) {
+ // var formatter = new TextWriterTokenWriter (stringWriter);
+ // stringWriter.NewLine = EolMarker;
+ // var visitor = new CSharpOutputVisitor (formatter, FormattingOptionsFactory.CreateMono ());
+ // var shortType = CreateShortType (def.Compilation, file, loc, resolved);
+ // shortType.AcceptVisitor (visitor);
+ //
+ // var typeString = stringWriter.ToString ();
+ // if (typeString.StartsWith ("global::"))
+ // typeString = typeString.Substring ("global::".Length);
+ // result.Append (typeString);
+ // }
+ // } else {
+ // result.Append (new ICSharpCode.NRefactory.CSharp.CSharpAmbience ().ConvertType (type));
+ // }
+ }
+ //
+ // /*
+ // void ResolveReturnTypes ()
+ // {
+ // returnType = member.ReturnType;
+ // foreach (IUsing u in unit.Usings) {
+ // foreach (KeyValuePair<string, IReturnType> alias in u.Aliases) {
+ // if (alias.Key == member.ReturnType.FullName) {
+ // returnType = alias.Value;
+ // return;
+ // }
+ // }
+ // }
+ // }*/
+ //
+ //
+ static CodeGeneratorMemberResult GenerateCode (IFieldSymbol field, CodeGenerationOptions options)
{
StringBuilder result = new StringBuilder ();
AppendIndent (result);
AppendModifiers (result, options, field);
result.Append (" ");
- AppendReturnType (result, options, field.ReturnType);
+ AppendReturnType (result, options, field.Type);
result.Append (" ");
result.Append (CSharpAmbience.FilterName (field.Name));
result.Append (";");
return new CodeGeneratorMemberResult (result.ToString (), -1, -1);
}
-
- CodeGeneratorMemberResult GenerateCode (IEvent evt, CodeGenerationOptions options)
+
+ static void AppendIndent (StringBuilder result)
+ {
+
+ }
+
+ static CodeGeneratorMemberResult GenerateCode (IEventSymbol evt, CodeGenerationOptions options)
{
StringBuilder result = new StringBuilder ();
AppendObsoleteAttribute (result, options, evt);
AppendModifiers (result, options, evt);
-
+
result.Append ("event ");
- AppendReturnType (result, options, evt.ReturnType);
+ AppendReturnType (result, options, evt.Type);
result.Append (" ");
if (options.ExplicitDeclaration) {
- result.Append (ambience.GetString (evt.DeclaringTypeDefinition, OutputFlags.IncludeGenerics));
+ AppendReturnType (result, options, evt.ContainingType);
result.Append (".");
}
+
result.Append (CSharpAmbience.FilterName (evt.Name));
if (options.ExplicitDeclaration) {
- AppendBraceStart (result, Policy.EventBraceStyle);
+ result.Append ("{");
AppendIndent (result);
- result.Append ("add");
- AppendBraceStart (result, Policy.EventAddBraceStyle);
+ result.Append ("add {");
AppendIndent (result);
result.Append ("// TODO");
AppendLine (result);
- AppendBraceEnd (result, Policy.EventAddBraceStyle);
-
+ result.Append ("}");
+
AppendIndent (result);
- result.Append ("remove");
- AppendBraceStart (result, Policy.EventRemoveBraceStyle);
+ result.Append ("remove {");
AppendIndent (result);
result.Append ("// TODO");
AppendLine (result);
-
- AppendBraceEnd (result, Policy.EventRemoveBraceStyle);
- AppendBraceEnd (result, Policy.EventBraceStyle);
+ result.Append ("}}");
} else {
result.Append (";");
}
return new CodeGeneratorMemberResult (result.ToString ());
}
-
- void AppendNotImplementedException (StringBuilder result, CodeGenerationOptions options,
- out int bodyStartOffset, out int bodyEndOffset)
+
+ static void AppendNotImplementedException (StringBuilder result, CodeGenerationOptions options, out int bodyStartOffset, out int bodyEndOffset)
{
AppendIndent (result);
bodyStartOffset = result.Length;
result.Append ("throw new ");
result.Append (options.GetShortType ("System", "NotImplementedException"));
- // AppendReturnType (result, options.ImplementingType, options.Ctx.GetTypeDefinition (typeof (System.NotImplementedException)));
- if (Policy.BeforeMethodCallParentheses)
- result.Append (" ");
result.Append ("();");
bodyEndOffset = result.Length;
AppendLine (result);
@@ -385,131 +446,124 @@ namespace MonoDevelop.CSharp.Refactoring
" see http://docs.xamarin.com/guides/ios/application_fundamentals/delegates,_protocols,_and_events"
};
- void AppendMonoTouchTodo (StringBuilder result, CodeGenerationOptions options, out int bodyStartOffset, out int bodyEndOffset)
+ static void AppendMonoTouchTodo(StringBuilder result, CodeGenerationOptions options, out int bodyStartOffset, out int bodyEndOffset)
{
AppendIndent (result);
bodyStartOffset = result.Length;
foreach (var cmt in MonoTouchComments) {
- result.AppendLine ("//" + cmt);
+ result.AppendLine("//" + cmt);
AppendIndent (result);
}
- result.Append ("throw new ");
- result.Append (options.GetShortType ("System", "NotImplementedException"));
-
- if (Policy.BeforeMethodCallParentheses)
- result.Append (" ");
- result.Append ("();");
+ result.Append("throw new ");
+ result.Append(options.GetShortType("System", "NotImplementedException"));
+ result.Append("();");
bodyEndOffset = result.Length;
AppendLine (result);
}
-
- CodeGeneratorMemberResult GenerateCode (IMethod method, CodeGenerationOptions options)
+
+ static CodeGeneratorMemberResult GenerateCode(IMethodSymbol method, CodeGenerationOptions options)
{
int bodyStartOffset = -1, bodyEndOffset = -1;
- StringBuilder result = new StringBuilder ();
+ var result = new StringBuilder();
AppendObsoleteAttribute (result, options, method);
AppendModifiers (result, options, method);
- if (method.IsPartial)
- result.Append ("partial ");
+ // if (method.IsPartial)
+ // result.Append ("partial ");
AppendReturnType (result, options, method.ReturnType);
result.Append (" ");
if (options.ExplicitDeclaration) {
- AppendReturnType (result, options, method.DeclaringType);
- result.Append (".");
+ AppendReturnType (result, options, method.ContainingType);
+ result.Append(".");
}
- result.Append (CSharpAmbience.FilterName (method.Name));
- if (method.TypeParameters.Count > 0) {
- result.Append ("<");
- for (int i = 0; i < method.TypeParameters.Count; i++) {
+ result.Append(CSharpAmbience.FilterName(method.Name));
+ if (method.TypeParameters.Length > 0) {
+ result.Append("<");
+ for (int i = 0; i < method.TypeParameters.Length; i++) {
if (i > 0)
- result.Append (", ");
- var p = method.TypeParameters [i];
- result.Append (CSharpAmbience.FilterName (p.Name));
+ result.Append(", ");
+ var p = method.TypeParameters[i];
+ result.Append(CSharpAmbience.FilterName(p.Name));
}
- result.Append (">");
+ result.Append(">");
}
- if (Policy.BeforeMethodDeclarationParentheses)
- result.Append (" ");
- result.Append ("(");
- AppendParameterList (result, options, method.Parameters);
- result.Append (")");
-
+ result.Append("(");
+ AppendParameterList (result, options, method.Parameters, true);
+ result.Append(")");
+
var typeParameters = method.TypeParameters;
-
- // This should also check the types are in the correct mscorlib
- Func<IType, bool> validBaseType = t => t.FullName != "System.Object" && t.FullName != "System.ValueType";
- bool isFromInterface = method.DeclaringType != null && method.DeclaringTypeDefinition.Kind == TypeKind.Interface;
+ // // This should also check the types are in the correct mscorlib
+ // Func<IType, bool> validBaseType = t => t.FullName != "System.Object" && t.FullName != "System.ValueType";
+ //
+ // bool isFromInterface = method.DeclaringType != null && method.DeclaringTypeDefinition.Kind == TypeKind.Interface;
+ //
+ // if (!options.ExplicitDeclaration && isFromInterface && typeParameters.Any (p => p.HasDefaultConstructorConstraint || p.HasReferenceTypeConstraint || p.HasValueTypeConstraint || p.DirectBaseTypes.Any (validBaseType))) {
+ // result.Append (" where ");
+ // int typeParameterCount = 0;
+ // foreach (var p in typeParameters) {
+ // if (typeParameterCount != 0)
+ // result.Append (", ");
+ //
+ // typeParameterCount++;
+ // result.Append (CSharpAmbience.FilterName (p.Name));
+ // result.Append (" : ");
+ // int constraintCount = 0;
+ //
+ // if (p.HasDefaultConstructorConstraint) {
+ // result.Append ("new ()");
+ // constraintCount++;
+ // }
+ //
+ // if (p.HasValueTypeConstraint) {
+ // if (constraintCount != 0)
+ // result.Append (", ");
+ // result.Append ("struct");
+ // constraintCount++;
+ // }
+ //
+ // if (p.HasReferenceTypeConstraint) {
+ // if (constraintCount != 0)
+ // result.Append (", ");
+ // result.Append ("class");
+ // constraintCount++;
+ // }
+ // // bool hadInterfaces = false;
+ // foreach (var c in p.DirectBaseTypes.Where (validBaseType)) {
+ // if (constraintCount != 0)
+ // result.Append (", ");
+ // constraintCount++;
+ // AppendReturnType (result, options, c);
+ // // if (c.Kind == TypeKind.Interface)
+ // // hadInterfaces = true;
+ // }
+ // }
+ // }
- if (!options.ExplicitDeclaration && isFromInterface && typeParameters.Any (p => p.HasDefaultConstructorConstraint || p.HasReferenceTypeConstraint || p.HasValueTypeConstraint || p.DirectBaseTypes.Any (validBaseType))) {
- result.Append (" where ");
- int typeParameterCount = 0;
- foreach (var p in typeParameters) {
- if (typeParameterCount != 0)
- result.Append (", ");
-
- typeParameterCount++;
- result.Append (CSharpAmbience.FilterName (p.Name));
- result.Append (" : ");
- int constraintCount = 0;
-
- if (p.HasDefaultConstructorConstraint) {
- result.Append ("new ()");
- constraintCount++;
- }
-
- if (p.HasValueTypeConstraint) {
- if (constraintCount != 0)
- result.Append (", ");
- result.Append ("struct");
- constraintCount++;
- }
-
- if (p.HasReferenceTypeConstraint) {
- if (constraintCount != 0)
- result.Append (", ");
- result.Append ("class");
- constraintCount++;
- }
- // bool hadInterfaces = false;
- foreach (var c in p.DirectBaseTypes.Where (validBaseType)) {
- if (constraintCount != 0)
- result.Append (", ");
- constraintCount++;
- AppendReturnType (result, options, c);
- // if (c.Kind == TypeKind.Interface)
- // hadInterfaces = true;
- }
- }
- }
-
- if (options.ImplementingType.Kind == TypeKind.Interface) {
+ if (options.ImplementingType.TypeKind == TypeKind.Interface) {
result.Append (";");
} else {
- AppendBraceStart (result, Policy.MethodBraceStyle);
- if (method.Name == "ToString" && (method.Parameters == null || method.Parameters.Count == 0) && method.ReturnType != null/* && method.ReturnType.FullName == "System.String"*/) {
+ result.Append ("{");
+ if (method.Name == "ToString" && method.Parameters.Length == 0 && method.ReturnType != null/* && method.ReturnType.FullName == "System.String"*/) {
AppendIndent (result);
bodyStartOffset = result.Length;
result.Append ("return string.Format");
- if (Policy.BeforeMethodDeclarationParentheses)
- result.Append (" ");
result.Append ("(\"[");
result.Append (options.ImplementingType.Name);
- if (options.ImplementingType.Properties.Any ())
+ if (options.ImplementingType.GetMembers ().OfType<IPropertySymbol> ().Any ())
result.Append (": ");
int i = 0;
- var properties = new List<IProperty> ();
+ var properties = new List<IPropertySymbol> ();
- foreach (IProperty property in options.ImplementingType.Properties) {
+ foreach (var property in options.ImplementingType.GetMembers ().OfType<IPropertySymbol> ()) {
if (properties.Any (p => p.Name == property.Name))
continue;
- properties.Add (property);
+ properties.Add (property);
}
- foreach (IProperty property in properties) {
- if (property.IsStatic || !property.IsPublic)
+ foreach (var property in properties) {
+ if (property.IsStatic || property.DeclaredAccessibility != Accessibility.Public)
continue;
if (i > 0)
result.Append (", ");
@@ -519,8 +573,8 @@ namespace MonoDevelop.CSharp.Refactoring
result.Append ("}");
}
result.Append ("]\"");
- foreach (IProperty property in properties) {
- if (property.IsStatic || !property.IsPublic)
+ foreach (var property in properties) {
+ if (property.IsStatic || property.DeclaredAccessibility != Accessibility.Public)
continue;
result.Append (", ");
result.Append (property.Name);
@@ -530,72 +584,60 @@ namespace MonoDevelop.CSharp.Refactoring
AppendLine (result);
} else if (IsMonoTouchModelMember (method)) {
AppendMonoTouchTodo (result, options, out bodyStartOffset, out bodyEndOffset);
- } else if (method.IsAbstract || !(method.IsVirtual || method.IsOverride) || method.DeclaringTypeDefinition.Kind == TypeKind.Interface) {
+ } else if (method.IsAbstract || !(method.IsVirtual || method.IsOverride) || method.ContainingType.TypeKind == TypeKind.Interface) {
AppendNotImplementedException (result, options, out bodyStartOffset, out bodyEndOffset);
} else {
bool skipBody = false;
// Analyze if the body consists just of a single throw instruction
// See: Bug 1373 - overriding [Model] class methods shouldn't insert base.Methods
// TODO: Extend this to user defined code.
- try {
- if (method.Region.FileName == null) {
- var asm = AssemblyDefinition.ReadAssembly (method.ParentAssembly.UnresolvedAssembly.Location);
- foreach (var type in asm.MainModule.Types) {
- if (type.FullName != method.DeclaringType.FullName)
- continue;
- foreach (var m in type.Resolve ().Methods) {
- if (m.HasBody && m.Name == method.Name) {
- var context = new DecompilerContext (asm.MainModule);
-
- context.CurrentType = type;
-
- context.Settings = new DecompilerSettings () {
- AnonymousMethods = true,
- AutomaticEvents = true,
- AutomaticProperties = true,
- ForEachStatement = true,
- LockStatement = true
- };
-
- var astBuilder = new AstBuilder (context);
- astBuilder.AddMethod (m);
-
- astBuilder.RunTransformations (o => false);
-
- var visitor = new ThrowsExceptionVisitor ();
- astBuilder.SyntaxTree.AcceptVisitor (visitor);
- skipBody = visitor.Throws;
- if (skipBody)
- break;
- }
- }
- if (skipBody)
- break;
- }
- }
- } catch (Exception) {
- }
+ // try {
+ // if (method.Region.FileName == null) {
+ // var asm = AssemblyDefinition.ReadAssembly (method.ParentAssembly.UnresolvedAssembly.Location);
+ // foreach (var type in asm.MainModule.Types) {
+ // if (type.FullName != method.DeclaringType.FullName)
+ // continue;
+ // foreach (var m in type.Resolve ().Methods) {
+ // if (m.HasBody && m.Name == method.Name) {
+ // var context = new DecompilerContext (asm.MainModule);
+ //
+ // context.CurrentType = type;
+ //
+ // context.Settings = new DecompilerSettings () {
+ // AnonymousMethods = true,
+ // AutomaticEvents = true,
+ // AutomaticProperties = true,
+ // ForEachStatement = true,
+ // LockStatement = true
+ // };
+ //
+ // var astBuilder = new AstBuilder (context);
+ // astBuilder.AddMethod (m);
+ //
+ // astBuilder.RunTransformations (o => false);
+ //
+ // var visitor = new ThrowsExceptionVisitor ();
+ // astBuilder.SyntaxTree.AcceptVisitor (visitor);
+ // skipBody = visitor.Throws;
+ // if (skipBody)
+ // break;
+ // }
+ // }
+ // if (skipBody)
+ // break;
+ // }
+ // }
+ // } catch (Exception) {
+ // }
AppendIndent (result);
bodyStartOffset = result.Length;
if (!skipBody) {
- if (method.ReturnType.ReflectionName != typeof(void).FullName)
+ if (method.ReturnType.SpecialType != SpecialType.System_Void)
result.Append ("return ");
result.Append ("base.");
result.Append (CSharpAmbience.FilterName (method.Name));
- if (Policy.BeforeMethodCallParentheses)
- result.Append (" ");
result.Append ("(");
- for (int i = 0; i < method.Parameters.Count; i++) {
- if (i > 0)
- result.Append (", ");
-
- var p = method.Parameters [i];
- if (p.IsOut)
- result.Append ("out ");
- if (p.IsRef)
- result.Append ("ref ");
- result.Append (CSharpAmbience.FilterName (p.Name));
- }
+ AppendParameterList (result, options, method.Parameters, false);
result.Append (");");
} else {
result.Append ("throw new System.NotImplementedException ();");
@@ -603,172 +645,208 @@ namespace MonoDevelop.CSharp.Refactoring
bodyEndOffset = result.Length;
AppendLine (result);
}
- AppendBraceEnd (result, Policy.MethodBraceStyle);
+ result.Append ("}");
}
- return new CodeGeneratorMemberResult (result.ToString (), bodyStartOffset, bodyEndOffset);
+ return new CodeGeneratorMemberResult(result.ToString (), bodyStartOffset, bodyEndOffset);
}
-
- class ThrowsExceptionVisitor : DepthFirstAstVisitor
+
+
+ static CodeGeneratorMemberResult GeneratePartialCode(IMethodSymbol method, CodeGenerationOptions options)
{
- public bool Throws = false;
-
- public override void VisitBlockStatement (BlockStatement blockStatement)
- {
- if (blockStatement.Statements.Count == 1 && blockStatement.Statements.First () is ThrowStatement)
- Throws = true;
+ int bodyStartOffset = -1, bodyEndOffset = -1;
+ var result = new StringBuilder();
+ AppendObsoleteAttribute (result, options, method);
+ result.Append("partial ");
+ AppendReturnType (result, options, method.ReturnType);
+ result.Append(" ");
+ if (options.ExplicitDeclaration) {
+ AppendReturnType (result, options, method.ContainingType);
+ result.Append(".");
}
+
+ result.Append(CSharpAmbience.FilterName(method.Name));
+ if (method.TypeParameters.Length > 0) {
+ result.Append("<");
+ for (int i = 0; i < method.TypeParameters.Length; i++) {
+ if (i > 0)
+ result.Append(", ");
+ var p = method.TypeParameters[i];
+ result.Append(CSharpAmbience.FilterName(p.Name));
+ }
+ result.Append(">");
+ }
+ result.Append("(");
+ AppendParameterList (result, options, method.Parameters, true);
+ result.Append(")");
+
+ var typeParameters = method.TypeParameters;
+ result.AppendLine("{");
+ bodyStartOffset = result.Length;
+ AppendLine (result);
+ bodyEndOffset = result.Length;
+ result.AppendLine("}");
+ return new CodeGeneratorMemberResult(result.ToString(), bodyStartOffset, bodyEndOffset);
}
-
- void AppendParameterList (StringBuilder result, CodeGenerationOptions options, IList<IParameter> parameters)
+
+ // class ThrowsExceptionVisitor : DepthFirstAstVisitor
+ // {
+ // public bool Throws = false;
+ //
+ // public override void VisitBlockStatement (BlockStatement blockStatement)
+ // {
+ // if (blockStatement.Statements.Count == 1 && blockStatement.Statements.First () is ThrowStatement)
+ // Throws = true;
+ // }
+ // }
+
+ static void AppendParameterList (StringBuilder result, CodeGenerationOptions options, IList<IParameterSymbol> parameters, bool asParameterList)
{
for (int i = 0; i < parameters.Count; i++) {
if (i > 0)
result.Append (", ");
-
- var p = parameters[i];
- if (p.IsOut)
+
+ var p = parameters [i];
+ if (p.RefKind == RefKind.Out)
result.Append ("out ");
- if (p.IsRef)
+ if (p.RefKind == RefKind.Ref)
result.Append ("ref ");
- if (p.IsParams)
- result.Append ("params ");
- AppendReturnType (result, options, p.Type);
- result.Append (" ");
+ if (asParameterList) {
+ if (p.IsParams)
+ result.Append ("params ");
+ AppendReturnType (result, options, p.Type);
+ result.Append (" ");
+ }
result.Append (CSharpAmbience.FilterName (p.Name));
- if (p.ConstantValue != null) {
+ if (asParameterList && p.HasExplicitDefaultValue) {
result.Append (" = ");
- if (p.Type.Kind == TypeKind.Enum) {
- bool found = false;
- foreach (var literal in GetEnumLiterals(p.Type)) {
- if (literal.ConstantValue.Equals (p.ConstantValue)) {
- AppendReturnType (result, options, p.Type);
- result.Append ("."+ literal.Name);
- found = true;
- break;
- }
- }
- if (!found) {
+ if (p.ExplicitDefaultValue is Enum) {
+ var name = Enum.GetName (p.ExplicitDefaultValue.GetType (), p.ExplicitDefaultValue);
+ if (name != null) {
+ AppendReturnType (result, options, p.Type);
+ result.Append ("." + name);
+ } else {
result.Append ("(");
AppendReturnType (result, options, p.Type);
- result.Append (")" + p.ConstantValue);
+ result.Append (")" + p.ExplicitDefaultValue);
+ }
+ } else if (p.ExplicitDefaultValue is char) {
+ result.Append ("'" + p.ExplicitDefaultValue + "'");
+ } else if (p.ExplicitDefaultValue is string) {
+ result.Append ("\"" + CSharpTextEditorIndentation.ConvertToStringLiteral ((string)p.ExplicitDefaultValue) + "\"");
+ } else if (p.ExplicitDefaultValue is bool) {
+ result.Append ((bool)p.ExplicitDefaultValue ? "true" : "false");
+ } else if (p.ExplicitDefaultValue == null) {
+ if (p.Type.IsValueType && p.Type.SpecialType != SpecialType.System_String) {
+ result.Append ("default(" + p.Type.ToMinimalDisplayString (options.SemanticModel, options.Part.SourceSpan.Start) + ")");
+ } else {
+ result.Append ("null");
}
- } else if (p.ConstantValue is char) {
- result.Append ("'" + p.ConstantValue + "'");
- } else if (p.ConstantValue is string) {
- result.Append ("\"" + CSharpTextEditorIndentation.ConvertToStringLiteral ((string)p.ConstantValue) + "\"");
- } else if (p.ConstantValue is bool) {
- result.Append ((bool)p.ConstantValue ? "true" : "false");
} else {
- result.Append (p.ConstantValue);
+ result.Append (p.ExplicitDefaultValue);
}
- }
+ }
}
}
- public IEnumerable<IField> GetEnumLiterals(IType type)
+ public static IEnumerable<string> GetEnumLiterals (Type type)
{
- if (type.Kind != TypeKind.Enum)
- throw new ArgumentException ("Type is no enum.");
- foreach (var field in type.GetFields (f => f.IsConst && f.IsPublic))
- yield return field;
+ return Enum.GetNames (type);
}
-
- static string GetModifiers (ITypeDefinition implementingType, IUnresolvedTypeDefinition implementingPart, IMember member)
+
+ static string GetModifiers (ITypeSymbol implementingType, Location implementingPart, ISymbol member)
{
StringBuilder result = new StringBuilder ();
- if (member.IsPublic || (member.DeclaringType != null && member.DeclaringTypeDefinition.Kind == TypeKind.Interface)) {
+ if (member.DeclaredAccessibility == Accessibility.Public || (member.ContainingType != null && member.ContainingType.TypeKind == TypeKind.Interface)) {
result.Append ("public ");
- } else if (member.IsProtectedOrInternal) {
- if (IdeApp.Workbench.ActiveDocument != null && member.DeclaringTypeDefinition.ParentAssembly != implementingType.ParentAssembly) {
+ } else if (member.DeclaredAccessibility == Accessibility.ProtectedOrInternal) {
+ if (IdeApp.Workbench.ActiveDocument != null && member.ContainingAssembly != implementingType.ContainingAssembly) {
result.Append ("protected ");
} else {
result.Append ("internal protected ");
}
- } else if (member.IsProtectedAndInternal) {
- if (IdeApp.Workbench.ActiveDocument != null && member.DeclaringTypeDefinition.ParentAssembly != implementingType.ParentAssembly) {
- result.Append ("protected ");
- } else {
- result.Append ("protected internal ");
- }
- } else if (member.IsProtected) {
+ } else if (member.DeclaredAccessibility == Accessibility.Protected) {
result.Append ("protected ");
- } else if (member.IsInternal) {
+ } else if (member.DeclaredAccessibility == Accessibility.Internal) {
result.Append ("internal ");
}
-
- if (member.IsStatic)
+
+ if (member.IsStatic)
result.Append ("static ");
-
+
return result.ToString ();
}
-
- void AppendModifiers (StringBuilder result, CodeGenerationOptions options, IMember member)
+
+ static void AppendModifiers (StringBuilder result, CodeGenerationOptions options, ISymbol member)
{
- AppendIndent (result);
- if (options.ExplicitDeclaration || options.ImplementingType.Kind == TypeKind.Interface)
- return;
+ //AppendIndent (result);
+ //if (options.ExplicitDeclaration || options.ImplementingType.Kind == TypeKind.Interface)
+ // return;
result.Append (GetModifiers (options.ImplementingType, options.Part, member));
- bool isFromInterface = false;
- if (member.DeclaringType != null && member.DeclaringTypeDefinition.Kind == TypeKind.Interface) {
- isFromInterface = true;
-// TODO: Type system conversion.
-// if (options.ImplementingType != null) {
-// foreach (var type in options.ImplementingType.BaseTypes) {
-// if (type.Kind == TypeKind.Interface)
-// continue;
-// if (type.Members.Any (m => m.Name == member.Name && member.SymbolKind == m.SymbolKind /* && DomMethod.ParameterListEquals (member.Parameters, m.Parameters)*/ )) {
-// isFromInterface = false;
-// break;
-// }
-// }
-// }
+ //bool isFromInterface = false;
+ if (member.ContainingType != null && member.ContainingType.TypeKind == TypeKind.Interface) {
+ //isFromInterface = true;
+ // TODO: Type system conversion.
+ // if (options.ImplementingType != null) {
+ // foreach (var type in options.ImplementingType.BaseTypes) {
+ // if (type.Kind == TypeKind.Interface)
+ // continue;
+ // if (type.Members.Any (m => m.Name == member.Name && member.SymbolKind == m.SymbolKind /* && DomMethod.ParameterListEquals (member.Parameters, m.Parameters)*/ )) {
+ // isFromInterface = false;
+ // break;
+ // }
+ // }
+ // }
+ }
+ if (member is IMethodSymbol) {
+ if (!options.CreateProtocolMember)
+ result.Append ("override ");
}
- if (!isFromInterface && member.IsOverridable)
- result.Append ("override ");
- if (member is IMethod && ((IMethod)member).IsAsync)
- result.Append ("async ");
+ if (member is IPropertySymbol) {
+ if (!options.CreateProtocolMember)
+ result.Append ("override ");
+ }
}
-
- CodeGeneratorMemberResult GenerateCode (IProperty property, CodeGenerationOptions options)
+
+ static CodeGeneratorMemberResult GenerateCode (IPropertySymbol property, CodeGenerationOptions options)
{
var regions = new List<CodeGeneratorBodyRegion> ();
var result = new StringBuilder ();
AppendObsoleteAttribute (result, options, property);
AppendModifiers (result, options, property);
- AppendReturnType (result, options, property.ReturnType);
+ AppendReturnType (result, options, property.Type);
result.Append (" ");
if (property.IsIndexer) {
result.Append ("this[");
- AppendParameterList (result, options, property.Parameters);
+ AppendParameterList (result, options, property.Parameters, true);
result.Append ("]");
} else {
- if (options.ExplicitDeclaration) {
- result.Append (ambience.GetString (property.DeclaringType, OutputFlags.IncludeGenerics));
- result.Append (".");
- }
+ // if (options.ExplicitDeclaration) {
+ // result.Append (ambience.GetString (property.DeclaringType, OutputFlags.IncludeGenerics));
+ // result.Append (".");
+ // }
result.Append (CSharpAmbience.FilterName (property.Name));
}
- AppendBraceStart (result, Policy.PropertyBraceStyle);
- if (property.CanGet) {
+ result.AppendLine (" {");
+ if (property.GetMethod != null) {
int bodyStartOffset, bodyEndOffset;
AppendIndent (result);
result.Append ("get");
- if (options.ImplementingType.Kind == TypeKind.Interface) {
+ if (options.ImplementingType.TypeKind == TypeKind.Interface) {
result.AppendLine (";");
} else {
- AppendBraceStart (result, Policy.PropertyGetBraceStyle);
+ result.AppendLine (" {");
if (IsMonoTouchModelMember (property)) {
AppendMonoTouchTodo (result, options, out bodyStartOffset, out bodyEndOffset);
- } else if (property.IsAbstract || property.DeclaringTypeDefinition.Kind == TypeKind.Interface) {
+ } else if (property.IsAbstract || property.ContainingType.TypeKind == TypeKind.Interface) {
AppendNotImplementedException (result, options, out bodyStartOffset, out bodyEndOffset);
} else {
AppendIndent (result);
bodyStartOffset = result.Length;
- if (property.SymbolKind == SymbolKind.Indexer) {
+ if (property.IsIndexer) {
result.Append ("return base[");
- if (property.Parameters.Count > 0)
+ if (property.Parameters.Length > 0)
result.Append (CSharpAmbience.FilterName (property.Parameters.First ().Name));
result.Append ("];");
} else {
@@ -779,33 +857,33 @@ namespace MonoDevelop.CSharp.Refactoring
bodyEndOffset = result.Length;
AppendLine (result);
}
- AppendBraceEnd (result, Policy.PropertyGetBraceStyle);
+ result.Append ("}");
AppendLine (result);
regions.Add (new CodeGeneratorBodyRegion (bodyStartOffset, bodyEndOffset));
}
}
-
- if (property.CanSet) {
+
+ if (property.SetMethod != null) {
int bodyStartOffset, bodyEndOffset;
AppendIndent (result);
result.Append ("set");
- if (options.ImplementingType.Kind == TypeKind.Interface) {
+ if (options.ImplementingType.TypeKind == TypeKind.Interface) {
result.AppendLine (";");
} else {
- AppendBraceStart (result, Policy.PropertyGetBraceStyle);
+ result.AppendLine (" {");
if (IsMonoTouchModelMember (property)) {
AppendMonoTouchTodo (result, options, out bodyStartOffset, out bodyEndOffset);
- } else if (property.IsAbstract || property.DeclaringTypeDefinition.Kind == TypeKind.Interface) {
+ } else if (property.IsAbstract || property.ContainingType.TypeKind == TypeKind.Interface) {
AppendNotImplementedException (result, options, out bodyStartOffset, out bodyEndOffset);
} else {
AppendIndent (result);
bodyStartOffset = result.Length;
- if (property.SymbolKind == SymbolKind.Indexer) {
+ if (property.IsIndexer) {
result.Append ("base[");
- if (property.Parameters.Count > 0)
+ if (property.Parameters.Length > 0)
result.Append (CSharpAmbience.FilterName (property.Parameters.First ().Name));
result.Append ("] = value;");
- } else {
+ } else {
result.Append ("base.");
result.Append (CSharpAmbience.FilterName (property.Name));
result.Append (" = value;");
@@ -813,241 +891,183 @@ namespace MonoDevelop.CSharp.Refactoring
bodyEndOffset = result.Length;
AppendLine (result);
}
- AppendBraceEnd (result, Policy.PropertyGetBraceStyle);
+ result.Append ("}");
AppendLine (result);
regions.Add (new CodeGeneratorBodyRegion (bodyStartOffset, bodyEndOffset));
}
}
- AppendBraceEnd (result, Policy.PropertyBraceStyle);
+ result.Append ("}");
return new CodeGeneratorMemberResult (result.ToString (), regions);
}
-
- internal static bool IsMonoTouchModelMember (IMember member)
+
+ internal static bool IsMonoTouchModelMember (ISymbol member)
{
- if (member == null || member.DeclaringType == null)
+ if (member == null || member.ContainingType == null)
return false;
- return member.DeclaringTypeDefinition.Attributes.Any (attr => attr.AttributeType != null && attr.AttributeType.ReflectionName == "MonoTouch.Foundation.ModelAttribute");
+ return member.ContainingType.GetAttributes ().Any (attr => attr.AttributeClass.MetadataName == "MonoTouch.Foundation.ModelAttribute");
}
-
- public override string CreateFieldEncapsulation (IUnresolvedTypeDefinition implementingType, IField field, string propertyName, Accessibility modifiers, bool readOnly)
- {
- SetIndentTo (implementingType);
- StringBuilder result = new StringBuilder ();
- AppendIndent (result);
-
-// if (modifiers != MonoDevelop.Projects.Dom.Modifiers.None) {
-// switch (modifiers) {
-// }
-// result.Append (ambience.GetString (modifiers));
-// result.Append (" ");
-// }
- var options = new CodeGenerationOptions () {
- ImplementingType = field.DeclaringTypeDefinition,
- Part = implementingType
- };
- result.Append ("public ");
- AppendReturnType (result, options, field.ReturnType);
- result.Append (" ");
- result.Append (propertyName);
- AppendBraceStart (result, Policy.PropertyBraceStyle);
- AppendIndent (result);
-
- result.Append ("get");
- AppendBraceStart (result, Policy.PropertyGetBraceStyle);
- AppendIndent (result);
- result.Append ("return this.");
- result.Append (CSharpAmbience.FilterName (field.Name));
- result.Append (";");
- AppendLine (result);
- AppendBraceEnd (result, Policy.PropertyGetBraceStyle);
- AppendLine (result);
- if (!readOnly) {
- AppendIndent (result);
- result.Append ("set");
- AppendBraceStart (result, Policy.PropertyGetBraceStyle);
- AppendIndent (result);
- result.Append (CSharpAmbience.FilterName (field.Name));
- result.Append (" = value;");
- AppendLine (result);
- AppendBraceEnd (result, Policy.PropertyGetBraceStyle);
- AppendLine (result);
- }
-
- AppendBraceEnd (result, Policy.PropertyBraceStyle);
- return result.ToString ();
- }
-
- int CountBlankLines (MonoDevelop.Ide.Gui.Document doc, int startLine)
- {
- int result = 0;
- DocumentLine line;
- while ((line = doc.Editor.GetLine (startLine + result)) != null && doc.Editor.GetLineIndent (line).Length == line.Length) {
- result++;
- }
-
- return result;
- }
-
- static bool InsertUsingAfter (AstNode node)
- {
- return node is NewLineNode && IsCommentOrUsing (node.GetNextSibling (s => !(s is NewLineNode))) ||
- IsCommentOrUsing (node) || (node is PreProcessorDirective);
- }
+ //// public override string CreateFieldEncapsulation (IUnresolvedTypeDefinition implementingType, IField field, string propertyName, Accessibility modifiers, bool readOnly)
+ //// {
+ //// SetIndentTo (implementingType);
+ //// StringBuilder result = new StringBuilder ();
+ //// AppendIndent (result);
+ ////
+ ////// if (modifiers != MonoDevelop.Projects.Dom.Modifiers.None) {
+ ////// switch (modifiers) {
+ ////// }
+ ////// result.Append (ambience.GetString (modifiers));
+ ////// result.Append (" ");
+ ////// }
+ //// var options = new CodeGenerationOptions () {
+ //// ImplementingType = field.DeclaringTypeDefinition,
+ //// Part = implementingType
+ //// };
+ //// result.Append ("public ");
+ //// AppendReturnType (result, options, field.ReturnType);
+ //// result.Append (" ");
+ //// result.Append (propertyName);
+ //// AppendBraceStart (result, Policy.PropertyBraceStyle);
+ //// AppendIndent (result);
+ ////
+ //// result.Append ("get");
+ //// AppendBraceStart (result, Policy.PropertyGetBraceStyle);
+ //// AppendIndent (result);
+ //// result.Append ("return this.");
+ //// result.Append (CSharpAmbience.FilterName (field.Name));
+ //// result.Append (";");
+ //// AppendLine (result);
+ //// AppendBraceEnd (result, Policy.PropertyGetBraceStyle);
+ //// AppendLine (result);
+ ////
+ //// if (!readOnly) {
+ //// AppendIndent (result);
+ //// result.Append ("set");
+ //// AppendBraceStart (result, Policy.PropertyGetBraceStyle);
+ //// AppendIndent (result);
+ //// result.Append (CSharpAmbience.FilterName (field.Name));
+ //// result.Append (" = value;");
+ //// AppendLine (result);
+ //// AppendBraceEnd (result, Policy.PropertyGetBraceStyle);
+ //// AppendLine (result);
+ //// }
+ ////
+ //// AppendBraceEnd (result, Policy.PropertyBraceStyle);
+ //// return result.ToString ();
+ //// }
+ //
+ // int CountBlankLines (IReadonlyTextDocument doc, int startLine)
+ // {
+ // int result = 0;
+ // IDocumentLine line;
+ // while ((line = doc.GetLine (startLine + result)) != null && doc.GetLineIndent (line).Length == line.Length) {
+ // result++;
+ // }
+ //
+ // return result;
+ // }
+ //
+ // static bool InsertUsingAfter (AstNode node)
+ // {
+ // return node is NewLineNode && IsCommentOrUsing (node.GetNextSibling (s => !(s is NewLineNode))) ||
+ // IsCommentOrUsing (node) || (node is PreProcessorDirective);
+ // }
+ //
+ // static bool IsCommentOrUsing (AstNode node)
+ // {
+ // return node is ICSharpCode.NRefactory.CSharp.Comment ||
+ // node is UsingDeclaration ||
+ // node is UsingAliasDeclaration;
+ // }
+ //
- static bool IsCommentOrUsing (AstNode node)
- {
- return node is ICSharpCode.NRefactory.CSharp.Comment ||
- node is UsingDeclaration ||
- node is UsingAliasDeclaration;
- }
-
- static AstNode SearchUsingInsertionPoint (AstNode parent)
+ //
+ // static string OutputNode (TextEditor editor, DocumentContext context, AstNode node)
+ // {
+ // using (var stringWriter = new System.IO.StringWriter ()) {
+ //// formatter.Indentation = indentLevel;
+ // var formatter = new TextWriterTokenWriter (stringWriter);
+ // stringWriter.NewLine = editor.EolMarker;
+ //
+ // var visitor = new CSharpOutputVisitor (formatter, null /* TODO: BROKEN DUE ROSLYN PORT (note: that code should be unused) */ );
+ // node.AcceptVisitor (visitor);
+ // return stringWriter.ToString ();
+ // }
+ // }
+ //
+ //
+ // public AstType CreateShortType (ICompilation compilation, CSharpUnresolvedFile parsedFile, TextLocation loc, IType fullType)
+ // {
+ // var csResolver = parsedFile.GetResolver (compilation, loc);
+ // var builder = new ICSharpCode.NRefactory.CSharp.Refactoring.TypeSystemAstBuilder (csResolver);
+ // return builder.ConvertType (fullType);
+ // }
+ //
+
+ public override async void CompleteStatement (MonoDevelop.Ide.Gui.Document doc)
{
- var node = parent.FirstChild;
- while (true) {
- var next = node.NextSibling;
- if (!InsertUsingAfter (next))
- break;
- node = next;
+ var fixer = new ConstructFixer (doc.GetFormattingOptions ());
+ int newOffset = await fixer.TryFix (doc, doc.Editor.CaretOffset, default(CancellationToken));
+ if (newOffset != -1) {
+ doc.Editor.CaretOffset = newOffset;
}
- return node;
}
-
- public override void AddGlobalNamespaceImport (MonoDevelop.Ide.Gui.Document doc, string nsName)
+
+ static CodeGeneratorMemberResult GenerateProtocolCode(IMethodSymbol method, CodeGenerationOptions options)
{
- var parsedDocument = doc.ParsedDocument;
- var unit = parsedDocument.GetAst<SyntaxTree> ();
- if (unit == null)
- return;
-
- var policy = doc.Project != null ? doc.Project.Policies.Get <CSharpFormattingPolicy> () : null;
- if (policy == null)
- policy = Policy;
-
- var node = SearchUsingInsertionPoint (unit);
-
- var text = new StringBuilder ();
- int lines = 0;
-
- if (InsertUsingAfter (node)) {
- lines = policy.BlankLinesBeforeUsings + 1;
- while (lines-- > 0) {
- text.Append (doc.Editor.EolMarker);
- }
- }
-
- text.Append ("using ");
- text.Append (nsName);
- text.Append (";");
-
- int offset = 0;
- if (node != null) {
- var loc = InsertUsingAfter (node) ? node.EndLocation : node.StartLocation;
- offset = Math.Max (0, doc.Editor.LocationToOffset (loc));
- }
-
- lines = policy.BlankLinesAfterUsings;
- lines -= CountBlankLines (doc, doc.Editor.OffsetToLineNumber (offset) + 1);
- if (lines > 0)
- text.Append (doc.Editor.EolMarker);
- while (lines-- > 0) {
- text.Append (doc.Editor.EolMarker);
+ int bodyStartOffset = -1, bodyEndOffset = -1;
+ var result = new StringBuilder();
+ var exportAttribute = method.GetAttributes ().FirstOrDefault (attr => attr.AttributeClass.Name == "ExportAttribute");
+ if (exportAttribute != null) {
+ result.Append ("[Export(\"");
+ result.Append (exportAttribute.ConstructorArguments.First ().Value.ToString ());
+ result.Append ("\")]");
+ result.AppendLine ();
}
- doc.Editor.Insert (offset, text.ToString ());
- doc.Editor.Document.CommitUpdateAll ();
- }
-
- public override void AddLocalNamespaceImport (MonoDevelop.Ide.Gui.Document doc, string nsName, TextLocation caretLocation)
- {
- var parsedDocument = doc.ParsedDocument;
- var unit = parsedDocument.GetAst<SyntaxTree> ();
- if (unit == null)
- return;
-
- var nsDecl = unit.GetNodeAt<NamespaceDeclaration> (caretLocation);
- if (nsDecl == null) {
- AddGlobalNamespaceImport (doc, nsName);
- return;
+ AppendModifiers (result, options, method);
+
+ AppendReturnType (result, options, method.ReturnType);
+ result.Append (" ");
+ if (options.ExplicitDeclaration) {
+ AppendReturnType (result, options, method.ContainingType);
+ result.Append(".");
}
-
- var policy = doc.Project != null ? doc.Project.Policies.Get <CSharpFormattingPolicy> () : null;
- if (policy == null)
- policy = Policy;
-
-
- var node = SearchUsingInsertionPoint (nsDecl);
-
- var text = new StringBuilder ();
- int lines = 0;
-
- if (InsertUsingAfter (node)) {
- lines = policy.BlankLinesBeforeUsings + 1;
- while (lines-- > 0) {
- text.Append (doc.Editor.EolMarker);
+
+ result.Append(CSharpAmbience.FilterName(method.Name));
+ if (method.TypeParameters.Length > 0) {
+ result.Append("<");
+ for (int i = 0; i < method.TypeParameters.Length; i++) {
+ if (i > 0)
+ result.Append(", ");
+ var p = method.TypeParameters[i];
+ result.Append(CSharpAmbience.FilterName(p.Name));
}
+ result.Append(">");
}
-
- string indent = doc.Editor.GetLineIndent (nsDecl.StartLocation.Line) + "\t";
- text.Append (indent);
- text.Append ("using ");
- text.Append (nsName);
- text.Append (";");
-
- int offset;
- TextLocation loc;
- if (node != null) {
- loc = InsertUsingAfter (node) ? node.EndLocation : node.StartLocation;
- } else {
- loc = nsDecl.LBraceToken.EndLocation;
- }
- offset = doc.Editor.LocationToOffset (loc);
-
- lines = policy.BlankLinesAfterUsings;
- lines -= CountBlankLines (doc, doc.Editor.OffsetToLineNumber (offset) + 1);
- if (lines > 0)
- text.Append (doc.Editor.EolMarker);
- while (lines-- > 0) {
- text.Append (doc.Editor.EolMarker);
- }
-
- doc.Editor.Insert (offset, text.ToString ());
- }
-
- public override string GetShortTypeString (MonoDevelop.Ide.Gui.Document doc, IType type)
- {
- var shortType = CreateShortType (doc.Compilation, doc.ParsedDocument.ParsedFile as CSharpUnresolvedFile, doc.Editor.Caret.Location, type);
- return OutputNode (doc, shortType);
- }
-
- static string OutputNode (MonoDevelop.Ide.Gui.Document doc, AstNode node)
- {
- using (var stringWriter = new System.IO.StringWriter ()) {
-// formatter.Indentation = indentLevel;
- var formatter = new TextWriterTokenWriter (stringWriter);
- stringWriter.NewLine = doc.Editor.EolMarker;
-
- var visitor = new CSharpOutputVisitor (formatter, doc.GetFormattingOptions ());
- node.AcceptVisitor (visitor);
- return stringWriter.ToString ();
- }
+ result.Append("(");
+ AppendParameterList (result, options, method.Parameters, true);
+ result.Append(")");
+
+ var typeParameters = method.TypeParameters;
+
+ result.Append ("{");
+ AppendIndent (result);
+ bodyStartOffset = result.Length;
+ result.Append ("throw new System.NotImplementedException ();");
+ bodyEndOffset = result.Length;
+ AppendLine (result);
+ result.Append ("}");
+ return new CodeGeneratorMemberResult(result.ToString (), bodyStartOffset, bodyEndOffset);
}
-
-
- public AstType CreateShortType (ICompilation compilation, CSharpUnresolvedFile parsedFile, TextLocation loc, IType fullType)
+
+ public override void AddGlobalNamespaceImport (TextEditor editor, DocumentContext context, string nsName)
{
- var csResolver = parsedFile.GetResolver (compilation, loc);
- var builder = new ICSharpCode.NRefactory.CSharp.Refactoring.TypeSystemAstBuilder (csResolver);
- return builder.ConvertType (fullType);
+ // not used anymore
}
-
- public override void CompleteStatement (MonoDevelop.Ide.Gui.Document doc)
+
+ public override void AddLocalNamespaceImport (TextEditor editor, DocumentContext context, string nsName, TextLocation caretLocation)
{
- var fixer = new ConstructFixer (doc.GetFormattingOptions (), doc.Editor.CreateNRefactoryTextEditorOptions ());
- int newOffset;
- if (fixer.TryFix (doc.Editor.Document, doc.Editor.Caret.Offset, out newOffset)) {
- doc.Editor.Caret.Offset = newOffset;
- }
+ // not used anymore
}
}
} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpFeaturesTextEditorExtension.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpFeaturesTextEditorExtension.cs
new file mode 100644
index 0000000000..59df3df062
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpFeaturesTextEditorExtension.cs
@@ -0,0 +1,144 @@
+//
+// RenameTextEditorExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide.Commands;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Ide;
+using MonoDevelop.Ide.Editor.Extension;
+using MonoDevelop.Core;
+using MonoDevelop.Refactoring.Rename;
+using ICSharpCode.NRefactory6.CSharp.Features.GotoDefinition;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Refactoring;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide.Gui;
+using System.Collections.Generic;
+
+namespace MonoDevelop.CSharp.Refactoring
+{
+ sealed class CSharpFeaturesTextEditorExtension : TextEditorExtension
+ {
+ static CSharpFeaturesTextEditorExtension ()
+ {
+ GoToDefinitionService.TryNavigateToSymbol = delegate (ISymbol symbol, Microsoft.CodeAnalysis.Project project, bool usePreviewTab) {
+ RefactoringService.RoslynJumpToDeclaration (symbol, TypeSystemService.GetMonoProject (project));
+ return true;
+ };
+
+ GoToDefinitionService.TryNavigateToSpan = delegate (Workspace workspace, DocumentId documentId, Microsoft.CodeAnalysis.Text.TextSpan textSpan, bool usePreviewTab) {
+ var project = workspace.CurrentSolution.GetProject (documentId.ProjectId);
+ if (project == null)
+ return false;
+ var fileName = project.GetDocument (documentId).FilePath;
+ var offset = textSpan.Start;
+ string projectedName;
+ int projectedOffset;
+ if (TypeSystemService.GetWorkspace (TypeSystemService.GetMonoProject(project).ParentSolution).TryGetOriginalFileFromProjection (fileName, offset, out projectedName, out projectedOffset)) {
+ fileName = projectedName;
+ offset = projectedOffset;
+ }
+ IdeApp.Workbench.OpenDocument (new FileOpenInformation (fileName, TypeSystemService.GetMonoProject (project)) {
+ Offset = offset
+ });
+ return true;
+ };
+
+ GoToDefinitionService.DisplayMultiple = delegate (IEnumerable<Tuple<Solution, ISymbol, Location>> list) {
+ using (var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true)) {
+ foreach (var part in list)
+ monitor.ReportResult (GotoDeclarationHandler.GetJumpTypePartSearchResult (part.Item2, part.Item3));
+ }
+ };
+ }
+
+
+ public override bool IsValidInContext (MonoDevelop.Ide.Editor.DocumentContext context)
+ {
+ return context.Name != null && context.Name.EndsWith (".cs", FilePath.PathComparison);
+ }
+
+ [CommandUpdateHandler (EditCommands.Rename)]
+ public void RenameCommand_Update (CommandInfo ci)
+ {
+ new RenameHandler ().UpdateCommandInfo (ci);
+ }
+
+ [CommandHandler (EditCommands.Rename)]
+ public async void RenameCommand ()
+ {
+ await new RenameHandler ().Run (Editor, DocumentContext);
+ }
+
+ [CommandUpdateHandler (RefactoryCommands.GotoDeclaration)]
+ public async void GotoDeclaration_Update (CommandInfo ci)
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ if (doc == null || doc.FileName == FilePath.Null)
+ return;
+ if (doc.ParsedDocument == null || doc.ParsedDocument.GetAst<SemanticModel> () == null) {
+ ci.Enabled = false;
+ return;
+ }
+ var symbol = await GoToDefinitionService.FindSymbolAsync (base.DocumentContext.AnalysisDocument, Editor.CaretOffset, default(CancellationToken));
+ ci.Enabled = symbol != null;
+ }
+
+ [CommandHandler (RefactoryCommands.GotoDeclaration)]
+ public void GotoDeclaration ()
+ {
+ GoToDefinitionService.TryGoToDefinition (base.DocumentContext.AnalysisDocument, Editor.CaretOffset, default(CancellationToken));
+ }
+
+ static readonly FindReferencesHandler findReferencesHandler = new FindReferencesHandler ();
+ [CommandUpdateHandler (RefactoryCommands.FindReferences)]
+ public void FindReferences_Update (CommandInfo ci)
+ {
+ findReferencesHandler.Update (ci);
+ }
+
+ [CommandHandler (RefactoryCommands.FindReferences)]
+ public void FindReferences ()
+ {
+ findReferencesHandler.Run (null);
+ }
+
+ static readonly FindAllReferencesHandler findAllReferencesHandler = new FindAllReferencesHandler ();
+ [CommandUpdateHandler (RefactoryCommands.FindAllReferences)]
+ public void FindAllReferencesHandler_Update (CommandInfo ci)
+ {
+ findAllReferencesHandler.Update (ci);
+ }
+
+ [CommandHandler (RefactoryCommands.FindAllReferences)]
+ public void FindAllReferences ()
+ {
+ findAllReferencesHandler.Run (null);
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpFindReferencesProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpFindReferencesProvider.cs
new file mode 100644
index 0000000000..9ccbbe49af
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpFindReferencesProvider.cs
@@ -0,0 +1,290 @@
+//
+// CSharpFindReferencesProvider.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Linq;
+using System.Threading;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Core;
+using MonoDevelop.Ide;
+using MonoDevelop.Refactoring;
+using Microsoft.CodeAnalysis.FindSymbols;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide.FindInFiles;
+using MonoDevelop.Ide.Tasks;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+
+namespace MonoDevelop.CSharp.Refactoring
+{
+ class CSharpFindReferencesProvider : FindReferencesProvider
+ {
+ internal class LookupResult
+ {
+ public static LookupResult Failure = new LookupResult ();
+
+ public bool Success { get; private set; }
+ public ISymbol Symbol { get; private set; }
+ public Solution Solution { get; private set; }
+ public MonoDevelop.Projects.Project MonoDevelopProject { get; internal set; }
+ public Compilation Compilation { get; private set; }
+
+ public LookupResult ()
+ {
+ }
+
+ public LookupResult (ISymbol symbol, Solution solution, Compilation compilation)
+ {
+ this.Success = true;
+ this.Symbol = symbol;
+ this.Solution = solution;
+ this.Compilation = compilation;
+ }
+ }
+
+ static async Task<LookupResult> TryLookupSymbolInProject (Microsoft.CodeAnalysis.Project prj, string documentationCommentId, CancellationToken token)
+ {
+ if (string.IsNullOrEmpty (documentationCommentId))
+ return LookupResult.Failure;
+ bool searchNs = documentationCommentId[0] == 'N';
+ bool searchType = documentationCommentId[0] == 'T';
+ int reminderIndex = 2;
+ var comp = await prj.GetCompilationAsync (token).ConfigureAwait (false);
+ var current = LookupNamespace (documentationCommentId, ref reminderIndex, comp.GlobalNamespace);
+ if (current == null)
+ return LookupResult.Failure;
+ if (searchNs) {
+ if (current.GetDocumentationCommentId () == documentationCommentId)
+ return new LookupResult (current, prj.Solution, comp);
+ return LookupResult.Failure;
+ }
+
+ INamedTypeSymbol type = null;
+ foreach (var t in current.GetAllTypes ()) {
+ type = LookupType (documentationCommentId, reminderIndex, t);
+ if (type != null) {
+ if (searchType) {
+ return new LookupResult(type, prj.Solution, comp);
+ }
+ break;
+ }
+ }
+ if (type == null)
+ return LookupResult.Failure;
+ foreach (var member in type.GetMembers ()) {
+ if (member.GetDocumentationCommentId () == documentationCommentId) {
+ return new LookupResult(member, prj.Solution, comp);
+ }
+ }
+ return LookupResult.Failure;
+ }
+
+ internal static async Task<LookupResult> TryLookupSymbol (string documentationCommentId, MonoDevelop.Projects.Project hintProject, CancellationToken token)
+ {
+ Microsoft.CodeAnalysis.Project codeAnalysisHintProject = null;
+ LookupResult result = LookupResult.Failure;
+
+ if (hintProject != null) {
+ codeAnalysisHintProject = TypeSystemService.GetCodeAnalysisProject (hintProject);
+ if (codeAnalysisHintProject != null) {
+ var curResult = await TryLookupSymbolInProject (codeAnalysisHintProject, documentationCommentId, token);
+ if (curResult.Success) {
+ curResult.MonoDevelopProject = hintProject;
+ result = curResult;
+ }
+ }
+ }
+ if (result.Success && result.Symbol.IsDefinedInSource ())
+ return result;
+ foreach (var ws in TypeSystemService.AllWorkspaces) {
+ foreach (var prj in ws.CurrentSolution.Projects) {
+ if (prj == codeAnalysisHintProject)
+ continue;
+ var curResult = await TryLookupSymbolInProject (prj, documentationCommentId, token);
+ if (curResult.Success) {
+ curResult.MonoDevelopProject = TypeSystemService.GetMonoProject (prj);
+ if (curResult.Symbol.IsDefinedInSource ())
+ return curResult;
+ result = curResult;
+ }
+ }
+ }
+
+ return result;
+ }
+
+ static INamedTypeSymbol LookupType (string documentationCommentId, int reminder, INamedTypeSymbol current)
+ {
+ var idx = documentationCommentId.IndexOf ('.', reminder);
+ var exact = idx < 0;
+ var typeId = current.GetDocumentationCommentId ();
+ if (exact) {
+ if (typeId == documentationCommentId)
+ return current;
+ return null;
+ }
+
+ if (typeId.Length < reminder)
+ return null;
+ if (string.CompareOrdinal (documentationCommentId, reminder, typeId, reminder, idx - reminder - 1) == 0) {
+ if (typeId.Length > idx)
+ return null;
+ foreach (var subType in current.GetTypeMembers ()) {
+ var child = LookupType (documentationCommentId, idx + 1, subType);
+ if (child != null) {
+ return child;
+ }
+ }
+ return current;
+
+ }
+ return null;
+ }
+
+ static INamespaceSymbol LookupNamespace (string documentationCommentId, ref int reminder, INamespaceSymbol current)
+ {
+ var exact = documentationCommentId.IndexOf ('.', reminder) < 0;
+
+ foreach (var subNamespace in current.GetNamespaceMembers ()) {
+ if (exact) {
+ if (subNamespace.Name.Length == documentationCommentId.Length - reminder &&
+ string.CompareOrdinal (documentationCommentId, reminder, subNamespace.Name, 0, subNamespace.Name.Length) == 0)
+ return subNamespace;
+ } else {
+ if (subNamespace.Name.Length < documentationCommentId.Length - reminder - 1 &&
+ string.CompareOrdinal (documentationCommentId, reminder, subNamespace.Name, 0, subNamespace.Name.Length) == 0 &&
+ documentationCommentId [reminder + subNamespace.Name.Length] == '.') {
+ reminder += subNamespace.Name.Length + 1;
+ return LookupNamespace (documentationCommentId, ref reminder, subNamespace);
+ }
+ }
+ }
+
+ return current;
+ }
+
+ public override Task<IEnumerable<SearchResult>> FindReferences (string documentationCommentId, MonoDevelop.Projects.Project hintProject, CancellationToken token)
+ {
+ return Task.Run (async delegate {
+ var result = new List<SearchResult> ();
+ var antiDuplicatesSet = new HashSet<SearchResult> (new SearchResultComparer ());
+ foreach (var workspace in TypeSystemService.AllWorkspaces.OfType<MonoDevelopWorkspace> ()) {
+ LookupResult lookup = null;
+
+ foreach (var project in workspace.CurrentSolution.Projects) {
+ lookup = await TryLookupSymbolInProject (project, documentationCommentId, token);
+ if (lookup.Success)
+ break;
+ }
+
+ if (lookup == null || !lookup.Success) {
+ continue;
+ }
+
+ foreach (var loc in lookup.Symbol.Locations) {
+ if (!loc.IsInSource)
+ continue;
+ var fileName = loc.SourceTree.FilePath;
+ var offset = loc.SourceSpan.Start;
+ string projectedName;
+ int projectedOffset;
+ if (workspace.TryGetOriginalFileFromProjection (fileName, offset, out projectedName, out projectedOffset)) {
+ fileName = projectedName;
+ offset = projectedOffset;
+ }
+ var sr = new SearchResult (new FileProvider (fileName), offset, loc.SourceSpan.Length);
+ antiDuplicatesSet.Add (sr);
+ result.Add (sr);
+ }
+
+ foreach (var mref in await SymbolFinder.FindReferencesAsync (lookup.Symbol, lookup.Solution).ConfigureAwait (false)) {
+ foreach (var loc in mref.Locations) {
+ var fileName = loc.Document.FilePath;
+ var offset = loc.Location.SourceSpan.Start;
+ string projectedName;
+ int projectedOffset;
+ if (workspace.TryGetOriginalFileFromProjection (fileName, offset, out projectedName, out projectedOffset)) {
+ fileName = projectedName;
+ offset = projectedOffset;
+ }
+ var sr = new SearchResult (new FileProvider (fileName), offset, loc.Location.SourceSpan.Length);
+ if (antiDuplicatesSet.Add (sr)) {
+ result.Add (sr);
+ }
+ }
+ }
+ }
+ return (IEnumerable<SearchResult>)result;
+ });
+ }
+
+ public override Task<IEnumerable<SearchResult>> FindAllReferences (string documentationCommentId, MonoDevelop.Projects.Project hintProject, CancellationToken token)
+ {
+ var workspace = TypeSystemService.Workspace as MonoDevelopWorkspace;
+ if (workspace == null)
+ return Task.FromResult (Enumerable.Empty<SearchResult> ());
+ return Task.Run (async delegate {
+ var antiDuplicatesSet = new HashSet<SearchResult> (new SearchResultComparer ());
+ var result = new List<SearchResult> ();
+ var lookup = await TryLookupSymbol (documentationCommentId, hintProject, token);
+ if (!lookup.Success)
+ return result;
+
+ foreach (var simSym in SymbolFinder.FindSimilarSymbols (lookup.Symbol, lookup.Compilation)) {
+ foreach (var loc in simSym.Locations) {
+ if (!loc.IsInSource)
+ continue;
+ var sr = new SearchResult (new FileProvider (loc.SourceTree.FilePath), loc.SourceSpan.Start, loc.SourceSpan.Length);
+ if (antiDuplicatesSet.Add (sr)) {
+ result.Add (sr);
+ }
+ }
+
+ foreach (var mref in await SymbolFinder.FindReferencesAsync (simSym, lookup.Solution).ConfigureAwait (false)) {
+ foreach (var loc in mref.Locations) {
+ var fileName = loc.Document.FilePath;
+ var offset = loc.Location.SourceSpan.Start;
+ string projectedName;
+ int projectedOffset;
+ if (workspace.TryGetOriginalFileFromProjection (fileName, offset, out projectedName, out projectedOffset)) {
+ fileName = projectedName;
+ offset = projectedOffset;
+ }
+
+ var sr = new SearchResult (new FileProvider (fileName), offset, loc.Location.SourceSpan.Length);
+ if (antiDuplicatesSet.Add (sr)) {
+ result.Add (sr);
+ }
+ }
+ }
+ }
+ return (IEnumerable<SearchResult>)result;
+ });
+ }
+ }
+
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpJumpToDeclarationHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpJumpToDeclarationHandler.cs
new file mode 100644
index 0000000000..8ce24f29b8
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpJumpToDeclarationHandler.cs
@@ -0,0 +1,45 @@
+//
+// CSharpJumpToDeclarationHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System.Threading.Tasks;
+using MonoDevelop.Refactoring;
+using MonoDevelop.Ide;
+using System.Linq;
+
+namespace MonoDevelop.CSharp.Refactoring
+{
+ class CSharpJumpToDeclarationHandler : JumpToDeclarationHandler
+ {
+ public override async Task<bool> TryJumpToDeclarationAsync (string documentIdString, MonoDevelop.Projects.Project hintProject, System.Threading.CancellationToken token)
+ {
+ var lookup = await CSharpFindReferencesProvider.TryLookupSymbol (documentIdString, hintProject, token);
+ if (!lookup.Success || lookup.Symbol.Locations.First().IsInMetadata)
+ return false;
+ IdeApp.ProjectOperations.JumpToDeclaration (lookup.Symbol, lookup.MonoDevelopProject);
+ return true;
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpReferenceFinder.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpReferenceFinder.cs
deleted file mode 100644
index 950209fcbf..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpReferenceFinder.cs
+++ /dev/null
@@ -1,359 +0,0 @@
-//
-// CSharpReferenceFinder.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)
-// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Collections.Generic;
-
-using MonoDevelop.Core;
-using MonoDevelop.Ide;
-using MonoDevelop.CSharp.Resolver;
-using MonoDevelop.Ide.FindInFiles;
-using System.Linq;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using System.IO;
-using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.Semantics;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
-using System.Threading;
-
-namespace MonoDevelop.CSharp.Refactoring
-{
- using MonoDevelop.Projects;
- class CSharpReferenceFinder : ReferenceFinder
- {
- ICSharpCode.NRefactory.CSharp.Resolver.FindReferences refFinder = new ICSharpCode.NRefactory.CSharp.Resolver.FindReferences ();
- List<object> searchedMembers;
- List<FilePath> files = new List<FilePath> ();
- List<Tuple<FilePath, MonoDevelop.Ide.Gui.Document>> openDocuments = new List<Tuple<FilePath, MonoDevelop.Ide.Gui.Document>> ();
-
- string memberName;
- string keywordName;
-
- public CSharpReferenceFinder ()
- {
- IncludeDocumentation = true;
- }
-
- public void SetSearchedMembers (IEnumerable<object> members)
- {
- searchedMembers = new List<object> (members);
- var firstMember = searchedMembers.FirstOrDefault ();
- if (firstMember is INamedElement) {
- var namedElement = (INamedElement)firstMember;
- var name = namedElement.Name;
- if (namedElement is IMethod && (((IMethod)namedElement).IsConstructor | ((IMethod)namedElement).IsDestructor))
- name = ((IMethod)namedElement).DeclaringType.Name;
- memberName = name;
-
- keywordName = CSharpAmbience.NetToCSharpTypeName (namedElement.FullName);
- if (keywordName == namedElement.FullName)
- keywordName = null;
- }
- if (firstMember is string)
- memberName = firstMember.ToString ();
- if (firstMember is IVariable)
- memberName = ((IVariable)firstMember).Name;
- if (firstMember is ITypeParameter)
- memberName = ((ITypeParameter)firstMember).Name;
- if (firstMember is INamespace)
- memberName = ((INamespace)firstMember).Name;
- }
-
- void SetPossibleFiles (IEnumerable<FilePath> files)
- {
- foreach (var file in files) {
- var openDocument = IdeApp.Workbench.GetDocument (file);
- if (openDocument == null) {
- this.files.Add (file);
- } else {
- this.openDocuments.Add (Tuple.Create (file, openDocument));
- }
- }
- }
-
- MemberReference GetReference (Project project, ResolveResult result, AstNode node, SyntaxTree syntaxTree, string fileName, Mono.TextEditor.TextEditorData editor)
- {
- AstNode originalNode = node;
- if (result == null)
- return null;
-
- object valid = null;
- if (result is MethodGroupResolveResult) {
- valid = ((MethodGroupResolveResult)result).Methods.FirstOrDefault (
- m => searchedMembers.Any (member => member is IMethod && ((IMethod)member).Region == m.Region));
- } else if (result is MemberResolveResult) {
- var foundMember = ((MemberResolveResult)result).Member;
- valid = searchedMembers.FirstOrDefault (
- member => member is IMember && ((IMember)member).Region == foundMember.Region);
- } else if (result is NamespaceResolveResult) {
- var ns = ((NamespaceResolveResult)result).Namespace;
- valid = searchedMembers.FirstOrDefault (n => n is INamespace && ns.FullName.StartsWith (((INamespace)n).FullName, StringComparison.Ordinal));
- if (!(node is NamespaceDeclaration))
- goto skip;
- } else if (result is LocalResolveResult) {
- var ns = ((LocalResolveResult)result).Variable;
- valid = searchedMembers.FirstOrDefault (n => n is IVariable && ((IVariable)n).Region == ns.Region);
- } else if (result is TypeResolveResult) {
- valid = searchedMembers.FirstOrDefault (n => n is IType);
- }
- if (node is ConstructorInitializer)
- return null;
- if (node is ObjectCreateExpression)
- node = ((ObjectCreateExpression)node).Type;
- if (node is IndexerDeclaration)
- node = ((IndexerDeclaration)node).ThisToken;
-
- if (node is InvocationExpression)
- node = ((InvocationExpression)node).Target;
-
- if (node is MemberReferenceExpression)
- node = ((MemberReferenceExpression)node).MemberNameToken;
-
- if (node is SimpleType)
- node = ((SimpleType)node).IdentifierToken;
-
- if (node is MemberType)
- node = ((MemberType)node).MemberNameToken;
-
- if (node is NamespaceDeclaration) {
- var nsd = ((NamespaceDeclaration)node);
- node = nsd.NamespaceName;
- if (node == null)
- return null;
- }
-
- if (node is TypeDeclaration && (searchedMembers.First () is IType))
- node = ((TypeDeclaration)node).NameToken;
- if (node is DelegateDeclaration)
- node = ((DelegateDeclaration)node).NameToken;
-
- if (node is EntityDeclaration && (searchedMembers.First () is IMember))
- node = ((EntityDeclaration)node).NameToken;
-
- if (node is ParameterDeclaration && (searchedMembers.First () is IParameter))
- node = ((ParameterDeclaration)node).NameToken;
- if (node is ConstructorDeclaration)
- node = ((ConstructorDeclaration)node).NameToken;
- if (node is DestructorDeclaration)
- node = ((DestructorDeclaration)node).NameToken;
- if (node is NamedArgumentExpression)
- node = ((NamedArgumentExpression)node).NameToken;
- if (node is NamedExpression)
- node = ((NamedExpression)node).NameToken;
- if (node is VariableInitializer)
- node = ((VariableInitializer)node).NameToken;
-
- if (node is IdentifierExpression) {
- node = ((IdentifierExpression)node).IdentifierToken;
- }
-
- skip:
-
- var region = new DomRegion (fileName, node.StartLocation, node.EndLocation);
-
- var length = node is PrimitiveType ? keywordName.Length : node.EndLocation.Column - node.StartLocation.Column;
- if (valid == null)
- valid = searchedMembers.FirstOrDefault ();
- var reference = new CSharpMemberReference (project, originalNode, syntaxTree, valid, region, editor.LocationToOffset (region.Begin), length);
-
- reference.ReferenceUsageType = GetUsage (originalNode);
- return reference;
- }
-
- // same logic than the extract method analyzation, unfortunately it's not reusable in this context
- // we need to do it bottom up here.
- ReferenceUsageType GetUsage (AstNode node)
- {
- if (node.Parent is UnaryOperatorExpression) {
- var unaryOperatorExpression = (UnaryOperatorExpression)node.Parent;
- if (unaryOperatorExpression.Operator == UnaryOperatorType.Increment ||
- unaryOperatorExpression.Operator == UnaryOperatorType.Decrement ||
- unaryOperatorExpression.Operator == UnaryOperatorType.PostIncrement ||
- unaryOperatorExpression.Operator == UnaryOperatorType.PostDecrement) {
- return ReferenceUsageType.ReadWrite;
- }
- } else if (node.Parent is DirectionExpression) {
- var de = (DirectionExpression)node.Parent;
- if (de.FieldDirection == FieldDirection.Ref)
- return ReferenceUsageType.ReadWrite;
- if (de.FieldDirection == FieldDirection.Out)
- return ReferenceUsageType.Write;
- } else if (node.Parent is AssignmentExpression) {
- var ae = (AssignmentExpression)node.Parent;
- if (ae.Left == node)
- return ReferenceUsageType.Write;
- } else if (node is VariableInitializer) {
- return ReferenceUsageType.Write;
- } else if (node is ParameterDeclaration) {
- return ReferenceUsageType.Write;
- } else if (node.Parent is ForeachStatement) {
- if (node.Role == Roles.Identifier)
- return ReferenceUsageType.Write;
- }
- return ReferenceUsageType.Read;
- }
-
- public class CSharpMemberReference : MemberReference
- {
- public SyntaxTree SyntaxTree {
- get;
- private set;
- }
-
- public AstNode AstNode {
- get;
- private set;
- }
-
- public Project Project {
- get;
- private set;
- }
-
- public CSharpMemberReference (Project project, AstNode astNode, SyntaxTree syntaxTree, object entity, DomRegion region, int offset, int length) : base (entity, region, offset, length)
- {
- this.Project = project;
- this.AstNode = astNode;
- this.SyntaxTree = syntaxTree;
- }
- }
-
- bool IsNodeValid (object searchedMember, AstNode node)
- {
- if (searchedMember is IField && node is FieldDeclaration)
- return false;
- return true;
- }
-
- public IEnumerable<MemberReference> FindInDocument (MonoDevelop.Ide.Gui.Document doc, CancellationToken token = default (CancellationToken))
- {
- if (string.IsNullOrEmpty (memberName))
- return Enumerable.Empty<MemberReference> ();
- var editor = doc.Editor;
- var parsedDocument = doc.ParsedDocument;
- if (parsedDocument == null)
- return Enumerable.Empty<MemberReference> ();
- var unit = parsedDocument.GetAst<SyntaxTree> ();
- var file = parsedDocument.ParsedFile as CSharpUnresolvedFile;
- var result = new List<MemberReference> ();
-
- foreach (var obj in searchedMembers) {
- if (obj is IVariable && !(obj is IParameter) && !(obj is IField)) {
- refFinder.FindLocalReferences ((IVariable)obj, file, unit, doc.Compilation, (astNode, r) => {
- if (IsNodeValid (obj, astNode))
- result.Add (GetReference (doc.Project, r, astNode, unit, editor.FileName, editor));
- }, token);
- } else if (obj is ISymbol) {
- var sym = (ISymbol)obj;
-
- // May happen for anonymous types since empty constructors are always generated.
- // But there is no declaring type definition for them - we filter out this case.
- if (sym.SymbolKind == SymbolKind.Constructor && ((IEntity)sym).DeclaringTypeDefinition == null)
- continue;
- refFinder.FindReferencesInFile (refFinder.GetSearchScopes (sym), file, unit, doc.Compilation, (astNode, r) => {
- if (IsNodeValid (obj, astNode))
- result.Add (GetReference (doc.Project, r, astNode, unit, editor.FileName, editor));
- }, token);
- }
- }
- return result;
- }
-
- public override IEnumerable<MemberReference> FindReferences (Project project, IProjectContent content, IEnumerable<FilePath> possibleFiles, IProgressMonitor monitor, IEnumerable<object> members)
- {
- if (content == null)
- throw new ArgumentNullException ("content", "Project content not set.");
- SetPossibleFiles (possibleFiles);
- SetSearchedMembers (members);
- var scopes = searchedMembers.Select (e => e is INamespace ? refFinder.GetSearchScopes ((INamespace)e) : refFinder.GetSearchScopes ((ISymbol)e));
- var compilation = project != null ? TypeSystemService.GetCompilation (project) : content.CreateCompilation ();
- List<MemberReference> refs = new List<MemberReference> ();
- foreach (var opendoc in openDocuments) {
- foreach (var newRef in FindInDocument (opendoc.Item2)) {
- if (newRef == null || refs.Any (r => r.FileName == newRef.FileName && r.Region == newRef.Region))
- continue;
- refs.Add (newRef);
- }
- }
- foreach (var file in files) {
- if (monitor != null)
- monitor.Step (1);
- string text;
- try {
- if (!File.Exists (file))
- continue;
- text = Mono.TextEditor.Utils.TextFileUtility.ReadAllText (file);
- } catch (Exception e) {
- LoggingService.LogError ("Exception while file reading.", e);
- continue;
- }
- if (memberName != null && text.IndexOf (memberName, StringComparison.Ordinal) < 0 &&
- (keywordName == null || text.IndexOf (keywordName, StringComparison.Ordinal) < 0))
- continue;
- using (var editor = TextEditorData.CreateImmutable (text)) {
- editor.Document.FileName = file;
- var unit = new CSharpParser ().Parse (editor);
- if (unit == null)
- continue;
-
- var storedFile = content.GetFile (file);
- var parsedFile = storedFile as CSharpUnresolvedFile;
-
- if (parsedFile == null && storedFile is ParsedDocumentDecorator) {
- parsedFile = ((ParsedDocumentDecorator)storedFile).ParsedFile as CSharpUnresolvedFile;
- }
-
- if (parsedFile == null) {
- // for fallback purposes - should never happen.
- parsedFile = unit.ToTypeSystem ();
- content = content.AddOrUpdateFiles (parsedFile);
- compilation = content.CreateCompilation ();
- }
- foreach (var scope in scopes) {
- refFinder.FindReferencesInFile (
- scope,
- parsedFile,
- unit,
- compilation,
- (astNode, result) => {
- var newRef = GetReference (project, result, astNode, unit, file, editor);
- if (newRef == null || refs.Any (r => r.FileName == newRef.FileName && r.Region == newRef.Region))
- return;
- refs.Add (newRef);
- },
- CancellationToken.None
- );
- }
- }
- }
- return refs;
- }
- }
-}
-
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CodeGenerationService.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CodeGenerationService.cs
new file mode 100644
index 0000000000..e441992bd1
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CodeGenerationService.cs
@@ -0,0 +1,302 @@
+//
+// CodeGenerationService.cs
+//
+// Author:
+// mkrueger <mkrueger@novell.com>
+//
+// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using MonoDevelop.Core;
+using System.CodeDom;
+using MonoDevelop.Projects;
+using System.CodeDom.Compiler;
+using MonoDevelop.Ide;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+using ICSharpCode.NRefactory6.CSharp;
+using MonoDevelop.Ide.Editor;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Simplification;
+using System.Threading;
+using Gtk;
+using MonoDevelop.Ide.CodeFormatting;
+using Microsoft.CodeAnalysis.CSharp.Formatting;
+using MonoDevelop.CSharp.Formatting;
+using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace MonoDevelop.Refactoring
+{
+ static class CodeGenerationService
+ {
+ // public static IUnresolvedMember AddCodeDomMember (MonoDevelop.Projects.Project project, IUnresolvedTypeDefinition type, CodeTypeMember newMember)
+ // {
+ // bool isOpen;
+ // var data = TextFileProvider.Instance.GetTextEditorData (type.Region.FileName, out isOpen);
+ // var parsedDocument = TypeSystemService.ParseFile (data.FileName, data.MimeType, data.Text);
+ //
+ // var insertionPoints = GetInsertionPoints (data, parsedDocument, type);
+ //
+ // var suitableInsertionPoint = GetSuitableInsertionPoint (insertionPoints, type, newMember);
+ //
+ // var dotNetProject = project as DotNetProject;
+ // if (dotNetProject == null) {
+ // LoggingService.LogError ("Only .NET projects are supported.");
+ // return null;
+ // }
+ //
+ // var generator = dotNetProject.LanguageBinding.GetCodeDomProvider ();
+ // StringWriter sw = new StringWriter ();
+ // var options = new CodeGeneratorOptions ();
+ // options.IndentString = data.GetLineIndent (type.Region.BeginLine) + "\t";
+ // if (newMember is CodeMemberMethod)
+ // options.BracingStyle = "C";
+ // generator.GenerateCodeFromMember (newMember, sw, options);
+ //
+ // var code = sw.ToString ();
+ // if (!string.IsNullOrEmpty (code))
+ // suitableInsertionPoint.Insert (data, code);
+ // if (!isOpen) {
+ // try {
+ // File.WriteAllText (type.Region.FileName, data.Text);
+ // } catch (Exception e) {
+ // LoggingService.LogError (string.Format ("Failed to write file '{0}'.", type.Region.FileName), e);
+ // MessageService.ShowError (GettextCatalog.GetString ("Failed to write file '{0}'.", type.Region.FileName));
+ // }
+ // }
+ // var newDocument = TypeSystemService.ParseFile (data.FileName, data.MimeType, data.Text);
+ // return newDocument.ParsedFile.GetMember (suitableInsertionPoint.Location.Line, int.MaxValue);
+ // }
+
+ public static async Task AddNewMember (Projects.Project project, ITypeSymbol type, Location part, SyntaxNode newMember, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (project == null)
+ throw new ArgumentNullException (nameof (project));
+ if (type == null)
+ throw new ArgumentNullException (nameof (type));
+ if (newMember == null)
+ throw new ArgumentNullException (nameof (newMember));
+ if (!type.IsDefinedInSource ())
+ throw new ArgumentException ("The given type needs to be defined in source code.", nameof (type));
+
+
+ var ws = MonoDevelop.Ide.TypeSystem.TypeSystemService.GetWorkspace (project.ParentSolution);
+ var projectId = ws.GetProjectId (project);
+ var docId = ws.GetDocumentId (projectId, part.SourceTree.FilePath);
+
+ var document = ws.GetDocument (docId, cancellationToken);
+
+ var root = await document.GetSyntaxRootAsync (cancellationToken).ConfigureAwait (false);
+ var typeDecl = (ClassDeclarationSyntax)root.FindNode (part.SourceSpan);
+
+ // for some reason the reducer doesn't reduce this
+ var systemVoid = newMember.DescendantNodesAndSelf ().OfType<QualifiedNameSyntax> ().FirstOrDefault (ma => ma.ToString () == "System.Void");
+
+ if (systemVoid != null) newMember = newMember.ReplaceNode (systemVoid, SyntaxFactory.ParseTypeName ("void"));
+
+ var newRoot = root.ReplaceNode (typeDecl, typeDecl.AddMembers ((MemberDeclarationSyntax)newMember.WithAdditionalAnnotations (Simplifier.Annotation, Formatter.Annotation)));
+ document = document.WithSyntaxRoot (newRoot);
+ var policy = project.Policies.Get<CSharpFormattingPolicy> ("text/x-csharp");
+ var textPolicy = project.Policies.Get<TextStylePolicy> ("text/x-csharp");
+ var projectOptions = policy.CreateOptions (textPolicy);
+
+ document = await Formatter.FormatAsync (document, Formatter.Annotation, projectOptions, cancellationToken).ConfigureAwait (false);
+ document = await Simplifier.ReduceAsync (document, Simplifier.Annotation, projectOptions, cancellationToken).ConfigureAwait (false);
+ var text = await document.GetTextAsync (cancellationToken).ConfigureAwait (false);
+ var newSolution = ws.CurrentSolution.WithDocumentText (docId, text);
+ ws.TryApplyChanges (newSolution);
+ }
+
+ readonly static SyntaxAnnotation insertedMemberAnnotation = new SyntaxAnnotation ("INSERTION_ANNOTATAION");
+ public static async Task InsertMemberWithCursor (string operation, Projects.Project project, ITypeSymbol type, Location part, SyntaxNode newMember, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (operation == null)
+ throw new ArgumentNullException (nameof (operation));
+ if (project == null)
+ throw new ArgumentNullException (nameof (project));
+ if (type == null)
+ throw new ArgumentNullException (nameof (type));
+ if (newMember == null)
+ throw new ArgumentNullException (nameof (newMember));
+ var ws = MonoDevelop.Ide.TypeSystem.TypeSystemService.GetWorkspace (project.ParentSolution);
+ var projectId = ws.GetProjectId (project);
+ var docId = ws.GetDocumentId (projectId, part.SourceTree.FilePath);
+
+ var document = ws.GetDocument (docId, cancellationToken);
+
+ var root = await document.GetSyntaxRootAsync (cancellationToken).ConfigureAwait (false);
+ var typeDecl = (ClassDeclarationSyntax)root.FindNode (part.SourceSpan);
+
+ // for some reason the reducer doesn't reduce this
+ var systemVoid = newMember.DescendantNodesAndSelf ().OfType<QualifiedNameSyntax> ().FirstOrDefault (ma => ma.ToString () == "System.Void");
+
+ if (systemVoid != null) newMember = newMember.ReplaceNode (systemVoid, SyntaxFactory.ParseTypeName ("void"));
+
+ var newRoot = root.ReplaceNode (typeDecl, typeDecl.AddMembers ((MemberDeclarationSyntax)newMember.WithAdditionalAnnotations (Simplifier.Annotation, Formatter.Annotation, insertedMemberAnnotation)));
+ var doc = await IdeApp.Workbench.OpenDocument (part.SourceTree.FilePath, project, true);
+
+ var policy = project.Policies.Get<CSharpFormattingPolicy> ("text/x-csharp");
+ var textPolicy = project.Policies.Get<TextStylePolicy> ("text/x-csharp");
+ var projectOptions = policy.CreateOptions (textPolicy);
+
+ document = document.WithSyntaxRoot (newRoot);
+ document = await Formatter.FormatAsync (document, Formatter.Annotation, projectOptions, cancellationToken).ConfigureAwait (false);
+ document = await Simplifier.ReduceAsync (document, Simplifier.Annotation, projectOptions, cancellationToken).ConfigureAwait (false);
+
+ root = await document.GetSyntaxRootAsync (cancellationToken).ConfigureAwait (false);
+
+ var node = root.GetAnnotatedNodes (insertedMemberAnnotation).Single ();
+
+ Application.Invoke (async delegate {
+ var insertionPoints = InsertionPointService.GetInsertionPoints (
+ doc.Editor,
+ await doc.UpdateParseDocument (),
+ type,
+ part.SourceSpan.Start
+ );
+ var options = new InsertionModeOptions (
+ operation,
+ insertionPoints,
+ point => {
+ if (!point.Success)
+ return;
+ var text = node.ToString ();
+ point.InsertionPoint.Insert (doc.Editor, doc, text);
+ }
+ );
+
+ doc.Editor.StartInsertionMode (options);
+ });
+ }
+
+ //public static Task<bool> InsertMemberWithCursor (string operation, ITypeSymbol type, Location part, SyntaxNode newMember, bool implementExplicit = false)
+ //{
+ // //TODO: Add dialog for inserting position
+ // AddNewMember (type, part, newMember, implementExplicit);
+ // return Task.FromResult (true);
+ //}
+ //
+ // public static int CalculateBodyIndentLevel (IUnresolvedTypeDefinition declaringType)
+ // {
+ // if (declaringType == null)
+ // return 0;
+ // int indentLevel = 1;
+ // while (declaringType.DeclaringTypeDefinition != null) {
+ // indentLevel++;
+ // declaringType = declaringType.DeclaringTypeDefinition;
+ // }
+ // var file = declaringType.UnresolvedFile as CSharpUnresolvedFile;
+ // if (file == null)
+ // return indentLevel;
+ // var scope = file.GetUsingScope (declaringType.Region.Begin);
+ // while (scope != null && !string.IsNullOrEmpty (scope.NamespaceName)) {
+ // indentLevel++;
+ // // skip virtual scopes.
+ // while (scope.Parent != null && scope.Parent.Region == scope.Region)
+ // scope = scope.Parent;
+ // scope = scope.Parent;
+ // }
+ // return indentLevel;
+ // }
+ public static MonoDevelop.Ide.TypeSystem.CodeGenerator CreateCodeGenerator (this Ide.Gui.Document doc)
+ {
+ return MonoDevelop.Ide.TypeSystem.CodeGenerator.CreateGenerator (doc);
+ }
+
+
+ // public static MonoDevelop.Ide.TypeSystem.CodeGenerator CreateCodeGenerator (this ITextDocument data, ICompilation compilation)
+ // {
+ // return MonoDevelop.Ide.TypeSystem.CodeGenerator.CreateGenerator (data, compilation);
+ // }
+ //
+ // static IUnresolvedTypeDefinition GetMainPart (IType t)
+ // {
+ // return t.GetDefinition ().Parts.First ();
+ // }
+
+
+ public static void AddAttribute (INamedTypeSymbol cls, string name, params object [] parameters)
+ {
+ if (cls == null)
+ throw new ArgumentNullException ("cls");
+ bool isOpen;
+ string fileName = cls.Locations.First ().SourceTree.FilePath;
+ var buffer = TextFileProvider.Instance.GetTextEditorData (fileName, out isOpen);
+
+
+ var code = new StringBuilder ();
+ int pos = cls.Locations.First ().SourceSpan.Start;
+ var line = buffer.GetLineByOffset (pos);
+ code.Append (buffer.GetLineIndent (line));
+ code.Append ("[");
+ code.Append (name);
+ if (parameters != null && parameters.Length > 0) {
+ code.Append ("(");
+ for (int i = 0; i < parameters.Length; i++) {
+ if (i > 0)
+ code.Append (", ");
+ code.Append (parameters [i]);
+ }
+ code.Append (")");
+ }
+ code.Append ("]");
+ code.AppendLine ();
+
+ buffer.InsertText (line.Offset, code.ToString ());
+
+ if (!isOpen) {
+ File.WriteAllText (fileName, buffer.Text);
+ }
+ }
+
+ public static ITypeSymbol AddType (DotNetProject project, string folder, string namspace, ClassDeclarationSyntax type)
+ {
+ if (project == null)
+ throw new ArgumentNullException (nameof (project));
+ if (folder == null)
+ throw new ArgumentNullException (nameof (folder));
+ if (namspace == null)
+ throw new ArgumentNullException (nameof (namspace));
+ if (type == null)
+ throw new ArgumentNullException (nameof (type));
+ var ns = SyntaxFactory.NamespaceDeclaration (SyntaxFactory.ParseName (namspace)).WithMembers (new SyntaxList<MemberDeclarationSyntax> () { type });
+
+ string fileName = project.LanguageBinding.GetFileName (Path.Combine (folder, type.Identifier.ToString ()));
+ using (var sw = new StreamWriter (fileName)) {
+ sw.WriteLine (ns.ToString ());
+ }
+ FileService.NotifyFileChanged (fileName);
+ var roslynProject = MonoDevelop.Ide.TypeSystem.TypeSystemService.GetCodeAnalysisProject (project);
+ var id = MonoDevelop.Ide.TypeSystem.TypeSystemService.GetDocumentId (roslynProject.Id, fileName);
+ if (id == null)
+ return null;
+ var model = roslynProject.GetDocument (id).GetSemanticModelAsync ().Result;
+ var typeSyntax = model.SyntaxTree.GetCompilationUnitRoot ().ChildNodes ().First ().ChildNodes ().First () as ClassDeclarationSyntax;
+ return model.GetDeclaredSymbol (typeSyntax);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/ConstructFixer.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/ConstructFixer.cs
new file mode 100644
index 0000000000..334031cb2b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/ConstructFixer.cs
@@ -0,0 +1,208 @@
+//
+// ConstructFixer.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using ICSharpCode.NRefactory.Editor;
+using System.Text;
+using System.Reflection;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Formatting;
+using Microsoft.CodeAnalysis.Options;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace MonoDevelop.CSharp.Refactoring
+{
+ abstract class ConstructCompleter
+ {
+ public abstract bool TryFix (ConstructFixer fixer, SyntaxNode syntaxTree, MonoDevelop.Ide.Gui.Document document, int location, ref int newOffset);
+
+ }
+
+ class InvocationCompleter : ConstructCompleter
+ {
+ public override bool TryFix (ConstructFixer fixer, SyntaxNode syntaxTree, Ide.Gui.Document document, int location, ref int newOffset)
+ {
+ foreach (var invocationExpression in syntaxTree.FindToken (location).Parent.AncestorsAndSelf ().OfType<InvocationExpressionSyntax> ()) {
+ if (invocationExpression != null) {
+ if (!invocationExpression.ArgumentList.OpenParenToken.IsMissing && invocationExpression.ArgumentList.CloseParenToken.IsMissing) {
+
+ var insertionOffset = invocationExpression.Span.End - 1;
+
+ newOffset = insertionOffset;
+
+ var text = ")";
+ newOffset++;
+ var expressionStatement = invocationExpression.Parent as ExpressionStatementSyntax;
+ if (expressionStatement != null) {
+ if (expressionStatement.SemicolonToken.IsMissing)
+ text = ");";
+ newOffset++;
+ }
+ document.Editor.InsertText (insertionOffset, text);
+ return true;
+ }
+
+ }
+ }
+ return false;
+ }
+ }
+
+
+ class BreakStatementCompleter : ConstructCompleter
+ {
+ public override bool TryFix (ConstructFixer fixer, SyntaxNode syntaxTree, Ide.Gui.Document document, int location, ref int newOffset)
+ {
+ foreach (var breakStatementSyntax in syntaxTree.FindToken (location).Parent.AncestorsAndSelf ().OfType<BreakStatementSyntax> ()) {
+ if (breakStatementSyntax.SemicolonToken.IsMissing) {
+ var insertionOffset = breakStatementSyntax.Span.End - 1;
+ newOffset = insertionOffset;
+ newOffset++;
+ document.Editor.InsertText (insertionOffset, ";");
+ return true;
+ }
+ }
+ foreach (var breakStatementSyntax in syntaxTree.FindToken (location).Parent.AncestorsAndSelf ().OfType<ContinueStatementSyntax> ()) {
+ if (breakStatementSyntax.SemicolonToken.IsMissing) {
+ var insertionOffset = breakStatementSyntax.Span.End - 1;
+ newOffset = insertionOffset;
+ newOffset++;
+ document.Editor.InsertText (insertionOffset, ";");
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+ class ExpressionStatementCompleter : ConstructCompleter
+ {
+ public override bool TryFix (ConstructFixer fixer, SyntaxNode syntaxTree, Ide.Gui.Document document, int location, ref int newOffset)
+ {
+ foreach (var expressionStatement in syntaxTree.FindToken (location).Parent.AncestorsAndSelf ().OfType<ExpressionStatementSyntax> ()) {
+ if (expressionStatement.SemicolonToken.IsMissing) {
+ var insertionOffset = expressionStatement.Span.End - 1;
+ newOffset = insertionOffset;
+ newOffset++;
+ document.Editor.InsertText (insertionOffset, ";");
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+ class ReturnStatementCompleter : ConstructCompleter
+ {
+ public override bool TryFix (ConstructFixer fixer, SyntaxNode syntaxTree, Ide.Gui.Document document, int location, ref int newOffset)
+ {
+ foreach (var throwStatement in syntaxTree.FindToken (location).Parent.AncestorsAndSelf ().OfType<ReturnStatementSyntax> ()) {
+ if (throwStatement.SemicolonToken.IsMissing) {
+ var insertionOffset = throwStatement.Span.End - 1;
+ newOffset = insertionOffset;
+ newOffset++;
+ document.Editor.InsertText (insertionOffset, ";");
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+ class YieldReturnStatementCompleter : ConstructCompleter
+ {
+ public override bool TryFix (ConstructFixer fixer, SyntaxNode syntaxTree, Ide.Gui.Document document, int location, ref int newOffset)
+ {
+ foreach (var yieldStatement in syntaxTree.FindToken (location).Parent.AncestorsAndSelf ().OfType<YieldStatementSyntax> ()) {
+ if (yieldStatement.SemicolonToken.IsMissing) {
+ var insertionOffset = yieldStatement.Span.End - 1;
+ newOffset = insertionOffset;
+ newOffset++;
+ document.Editor.InsertText (insertionOffset, ";");
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+ class ThrowStatementCompleter : ConstructCompleter
+ {
+ public override bool TryFix (ConstructFixer fixer, SyntaxNode syntaxTree, Ide.Gui.Document document, int location, ref int newOffset)
+ {
+ foreach (var throwStatement in syntaxTree.FindToken (location).Parent.AncestorsAndSelf ().OfType<ThrowStatementSyntax> ()) {
+ if (throwStatement.SemicolonToken.IsMissing) {
+ var insertionOffset = throwStatement.Span.End - 1;
+ newOffset = insertionOffset;
+ newOffset++;
+ document.Editor.InsertText (insertionOffset, ";");
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+
+ public class ConstructFixer
+ {
+ static readonly ConstructCompleter [] completer = {
+ new BreakStatementCompleter (),
+ new ThrowStatementCompleter (),
+ new ReturnStatementCompleter (),
+ new YieldReturnStatementCompleter (),
+
+ new InvocationCompleter (),
+ new ExpressionStatementCompleter ()
+ };
+
+ // readonly OptionSet options;
+
+ public ConstructFixer (OptionSet options)
+ {
+ // this.options = options;
+ }
+
+ public async Task<int> TryFix (MonoDevelop.Ide.Gui.Document document, int offset, CancellationToken token)
+ {
+ int newOffset = offset;
+
+ var syntaxTree = await document.AnalysisDocument.GetSyntaxRootAsync (token);
+
+ foreach (var c in completer) {
+ if (c.TryFix (this, syntaxTree, document, offset, ref newOffset)) {
+ return newOffset;
+ }
+ }
+ return -1;
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/ExtractMethodCommandHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/ExtractMethodCommandHandler.cs
new file mode 100644
index 0000000000..37e0ab49fc
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/ExtractMethodCommandHandler.cs
@@ -0,0 +1,114 @@
+//
+// ExtractMethodCommandHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Components.Commands;
+using ICSharpCode.NRefactory6.CSharp.ExtractMethod;
+using MonoDevelop.Ide;
+using ICSharpCode.NRefactory6.CSharp;
+using System.Threading;
+using Microsoft.CodeAnalysis.Text;
+using System.Linq;
+using MonoDevelop.Refactoring;
+using MonoDevelop.Core;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+
+namespace MonoDevelop.CSharp.Refactoring
+{
+ class ExtractMethodCommandHandler : CommandHandler
+ {
+ public static async Task<bool> IsValid (MonoDevelop.Ide.Gui.Document doc, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (doc == null)
+ return false;
+ if (doc.Editor == null || !doc.Editor.IsSomethingSelected)
+ return false;
+ var ad = doc.AnalysisDocument;
+ if (ad == null)
+ return false;
+ var selectionRange = doc.Editor.SelectionRange;
+ try {
+ var selection = new CSharpSelectionValidator (await SemanticDocument.CreateAsync (ad, cancellationToken).ConfigureAwait (false), new TextSpan (selectionRange.Offset, selectionRange.Length), doc.GetOptionSet ());
+ var result = await selection.GetValidSelectionAsync (cancellationToken).ConfigureAwait (false);
+ return result.ContainsValidContext;
+ } catch (Exception) {
+ return false;
+ }
+ }
+
+ protected override void Update (CommandInfo info)
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ info.Enabled = doc != null && doc.ParsedDocument != null && doc.ParsedDocument.GetAst<SemanticModel> () != null;
+ }
+
+ public async static Task Run (MonoDevelop.Ide.Gui.Document doc)
+ {
+ if (!doc.Editor.IsSomethingSelected)
+ return;
+ var ad = doc.AnalysisDocument;
+ if (ad == null || ! await IsValid (doc))
+ return;
+ try {
+ var selectionRange = doc.Editor.SelectionRange;
+ var token = default(CancellationToken);
+ var selection = new CSharpSelectionValidator (await SemanticDocument.CreateAsync (ad, token).ConfigureAwait (false), new TextSpan (selectionRange.Offset, selectionRange.Length), doc.GetOptionSet ());
+ var result = await selection.GetValidSelectionAsync (token).ConfigureAwait (false);
+ if (!result.ContainsValidContext)
+ return;
+ var extractor = new CSharpMethodExtractor ((CSharpSelectionResult)result);
+ var extractionResult = await extractor.ExtractMethodAsync (token).ConfigureAwait (false);
+ var changes = await extractionResult.Document.GetTextChangesAsync (ad, token);
+ using (var undo = doc.Editor.OpenUndoGroup ()) {
+ foreach (var change in changes.OrderByDescending (ts => ts.Span.Start)) {
+ doc.Editor.ReplaceText (change.Span.Start, change.Span.Length, change.NewText);
+ }
+ // hack to remove the redundant private modifier.
+ if (doc.Editor.GetTextAt (extractionResult.MethodDeclarationNode.SpanStart, "private ".Length) == "private ") {
+ doc.Editor.RemoveText (extractionResult.MethodDeclarationNode.SpanStart, "private ".Length);
+ }
+ }
+ await doc.UpdateParseDocument ();
+ var info = RefactoringSymbolInfo.GetSymbolInfoAsync (doc, extractionResult.InvocationNameToken.Span.Start).Result;
+ var sym = info.DeclaredSymbol ?? info.Symbol;
+ if (sym != null)
+ await new MonoDevelop.Refactoring.Rename.RenameRefactoring ().Rename (sym);
+ }
+ catch (Exception e) {
+ LoggingService.LogError ("Error while extracting method", e);
+ }
+ }
+
+ protected async override void Run ()
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ if (doc == null)
+ return;
+ await Run (doc);
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/FindProjectReferenceUsagesHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/FindProjectReferenceUsagesHandler.cs
new file mode 100644
index 0000000000..1c3bcf9f18
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/FindProjectReferenceUsagesHandler.cs
@@ -0,0 +1,112 @@
+//
+// FindProjectReferenceUsagesHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Ide;
+using MonoDevelop.Ide.Gui.Pads.ProjectPad;
+using MonoDevelop.Projects;
+using MonoDevelop.Ide.TypeSystem;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+using MonoDevelop.Ide.FindInFiles;
+using MonoDevelop.Core;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.CSharp.Refactoring
+{
+ sealed class FindProjectReferenceUsagesHandler : CommandHandler
+ {
+ protected override void Update (CommandInfo info)
+ {
+ var currentProject = IdeApp.ProjectOperations.CurrentSelectedProject;
+ if (currentProject == null) {
+ info.Enabled = false;
+ return;
+ }
+ var analysisProject = TypeSystemService.GetCodeAnalysisProject (currentProject);
+ if (analysisProject == null) {
+ info.Enabled = false;
+ return;
+ }
+ var pad = IdeApp.Workbench.GetPad<ProjectSolutionPad> ().Content as ProjectSolutionPad;
+ var selectedNodes = pad.TreeView.GetSelectedNodes ();
+ if (selectedNodes == null || selectedNodes.Length != 1) {
+ info.Enabled = false;
+ return;
+ }
+ info.Enabled = true;
+ }
+
+ protected async override void Run ()
+ {
+ var currentProject = IdeApp.ProjectOperations.CurrentSelectedProject;
+ if (currentProject == null)
+ return;
+ var analysisProject = TypeSystemService.GetCodeAnalysisProject (currentProject);
+ if (analysisProject == null)
+ return;
+ var pad = IdeApp.Workbench.GetPad<ProjectSolutionPad> ().Content as ProjectSolutionPad;
+ var selectedNodes = pad.TreeView.GetSelectedNodes ();
+ if (selectedNodes == null || selectedNodes.Length != 1)
+ return;
+ var dataItem = selectedNodes[0].DataItem;
+
+ var projectRef = dataItem as ProjectReference;
+ if (projectRef != null) {
+ await Task.Run (delegate {
+ using (var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true)) {
+ monitor.BeginTask (GettextCatalog.GetString ("Analyzing project"), analysisProject.Documents.Count ());
+ Parallel.ForEach (analysisProject.Documents, async document => {
+ var model = await document.GetSemanticModelAsync ().ConfigureAwait (false);
+ var root = await model.SyntaxTree.GetRootAsync ().ConfigureAwait (false);
+ root.DescendantNodes (node => {
+ var expr = node as ExpressionSyntax;
+ if (expr != null) {
+ var info = model.GetSymbolInfo (expr);
+ if (info.Symbol == null || info.Symbol.ContainingAssembly == null)
+ return true;
+ if (projectRef.Reference.IndexOf (',') >= 0) {
+ if (!string.Equals (info.Symbol.ContainingAssembly.ToString (), projectRef.Reference, StringComparison.OrdinalIgnoreCase))
+ return true;
+ } else {
+ if (!info.Symbol.ContainingAssembly.ToString ().StartsWith (projectRef.Reference, StringComparison.OrdinalIgnoreCase))
+ return true;
+ }
+ monitor.ReportResult (new MemberReference (info.Symbol, document.FilePath, node.Span.Start, node.Span.Length));
+ return false;
+ }
+ return true;
+ }).Count ();
+ monitor.Step ();
+ });
+ monitor.EndTask ();
+ }
+ }).ConfigureAwait (false);
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/FindReferencesHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/FindReferencesHandler.cs
new file mode 100644
index 0000000000..bbd792a985
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/FindReferencesHandler.cs
@@ -0,0 +1,191 @@
+//
+// FindReferencesHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Linq;
+using System.Threading;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Core;
+using MonoDevelop.Ide;
+using MonoDevelop.Refactoring;
+using Microsoft.CodeAnalysis.FindSymbols;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide.FindInFiles;
+using MonoDevelop.Ide.Tasks;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using ICSharpCode.NRefactory6.CSharp;
+
+namespace MonoDevelop.CSharp.Refactoring
+{
+ class FindReferencesHandler
+ {
+ internal static void FindRefs (ISymbol symbol)
+ {
+ var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true);
+ var workspace = TypeSystemService.Workspace as MonoDevelopWorkspace;
+ if (workspace == null)
+ return;
+ var solution = workspace.CurrentSolution;
+ Task.Run (async delegate {
+ try {
+ var antiDuplicatesSet = new HashSet<SearchResult> (new SearchResultComparer ());
+ foreach (var loc in symbol.Locations) {
+ if (!loc.IsInSource)
+ continue;
+ var fileName = loc.SourceTree.FilePath;
+ var offset = loc.SourceSpan.Start;
+ string projectedName;
+ int projectedOffset;
+ if (workspace.TryGetOriginalFileFromProjection (fileName, offset, out projectedName, out projectedOffset)) {
+ fileName = projectedName;
+ offset = projectedOffset;
+ }
+ var sr = new SearchResult (new FileProvider (fileName), offset, loc.SourceSpan.Length);
+ antiDuplicatesSet.Add (sr);
+ monitor.ReportResult (sr);
+ }
+
+ foreach (var mref in await SymbolFinder.FindReferencesAsync (symbol, solution).ConfigureAwait (false)) {
+ foreach (var loc in mref.Locations) {
+ var fileName = loc.Document.FilePath;
+ var offset = loc.Location.SourceSpan.Start;
+ string projectedName;
+ int projectedOffset;
+ if (workspace.TryGetOriginalFileFromProjection (fileName, offset, out projectedName, out projectedOffset)) {
+ fileName = projectedName;
+ offset = projectedOffset;
+ }
+ var sr = new SearchResult (new FileProvider (fileName), offset, loc.Location.SourceSpan.Length);
+ if (antiDuplicatesSet.Add (sr)) {
+ monitor.ReportResult (sr);
+ }
+ }
+ }
+ } catch (Exception ex) {
+ if (monitor != null)
+ monitor.ReportError ("Error finding references", ex);
+ else
+ LoggingService.LogError ("Error finding references", ex);
+ } finally {
+ if (monitor != null)
+ monitor.Dispose ();
+ }
+ });
+ }
+
+ public void Update (CommandInfo info)
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ if (doc == null || doc.FileName == FilePath.Null || doc.ParsedDocument == null) {
+ info.Enabled = false;
+ return;
+ }
+ var pd = doc.ParsedDocument.GetAst<SemanticModel> ();
+ info.Enabled = pd != null;
+ }
+
+ public void Run (object data)
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ if (doc == null || doc.FileName == FilePath.Null)
+ return;
+
+ var info = RefactoringSymbolInfo.GetSymbolInfoAsync (doc, doc.Editor).Result;
+ var sym = info.Symbol ?? info.DeclaredSymbol;
+ if (sym != null) {
+ if (sym.Kind == SymbolKind.Local || sym.Kind == SymbolKind.Parameter || sym.Kind == SymbolKind.TypeParameter) {
+ FindRefs (sym);
+ } else {
+ RefactoringService.FindReferencesAsync (FilterSymbolForFindReferences (sym).GetDocumentationCommentId ());
+ }
+ }
+ }
+
+ internal static ISymbol FilterSymbolForFindReferences (ISymbol sym)
+ {
+ var meth = sym as IMethodSymbol;
+ if (meth != null && meth.IsReducedExtension ()) {
+ return meth.ReducedFrom;
+ }
+ return sym;
+ }
+ }
+
+
+
+ class FindAllReferencesHandler
+ {
+
+ public void Update (CommandInfo info)
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ if (doc == null || doc.FileName == FilePath.Null || doc.ParsedDocument == null) {
+ info.Enabled = false;
+ return;
+ }
+ var pd = doc.ParsedDocument.GetAst<SemanticModel> ();
+ info.Enabled = pd != null;
+ }
+
+ public void Run (object data)
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ if (doc == null || doc.FileName == FilePath.Null)
+ return;
+
+ var info = RefactoringSymbolInfo.GetSymbolInfoAsync (doc, doc.Editor).Result;
+ var sym = info.Symbol ?? info.DeclaredSymbol;
+ if (sym != null) {
+ if (sym.Kind == SymbolKind.Local || sym.Kind == SymbolKind.Parameter || sym.Kind == SymbolKind.TypeParameter) {
+ FindReferencesHandler.FindRefs (sym);
+ } else {
+ RefactoringService.FindAllReferencesAsync (FindReferencesHandler.FilterSymbolForFindReferences (sym).GetDocumentationCommentId ());
+ }
+ }
+ }
+ }
+
+ class SearchResultComparer : IEqualityComparer<SearchResult>
+ {
+ public bool Equals (SearchResult x, SearchResult y)
+ {
+ return x.FileName == y.FileName &&
+ x.Offset == y.Offset &&
+ x.Length == y.Length;
+ }
+
+ public int GetHashCode (SearchResult obj)
+ {
+ int hash = 17;
+ hash = hash * 23 + obj.Offset.GetHashCode ();
+ hash = hash * 23 + obj.Length.GetHashCode ();
+ hash = hash * 23 + (obj.FileName ?? "").GetHashCode ();
+ return hash;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/GotoBaseDeclarationHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/GotoBaseDeclarationHandler.cs
new file mode 100644
index 0000000000..fef916d350
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/GotoBaseDeclarationHandler.cs
@@ -0,0 +1,112 @@
+//
+// GotoBaseDeclarationHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide;
+using System.Linq;
+using MonoDevelop.Core;
+using MonoDevelop.Refactoring;
+
+namespace MonoDevelop.CSharp.Refactoring
+{
+ static class GotoBaseDeclarationHandler
+ {
+ public static string GetDescription (ISymbol symbol)
+ {
+ if (symbol == null)
+ throw new ArgumentNullException ("symbol");
+ switch (symbol.Kind) {
+ case SymbolKind.NamedType:
+ return GettextCatalog.GetString ("Go to _Base Type");
+ case SymbolKind.Property:
+ var property = (IPropertySymbol)symbol;
+ return property.OverriddenProperty != null ? GettextCatalog.GetString ("Go to _Base Property") : GettextCatalog.GetString ("Go to _Interface Property");
+ case SymbolKind.Event:
+ var evt = (IEventSymbol)symbol;
+ return evt.OverriddenEvent != null ? GettextCatalog.GetString ("Go to _Base Event") : GettextCatalog.GetString ("Go to _Interface Event");
+ case SymbolKind.Method:
+ var method = (IMethodSymbol)symbol;
+ return method.OverriddenMethod != null ? GettextCatalog.GetString ("Go to _Base Method") : GettextCatalog.GetString ("Go to _Interface Method");
+ }
+ return GettextCatalog.GetString ("Go to _Base Symbol");
+ }
+
+ public static bool CanGotoBase (ISymbol symbol)
+ {
+ if (symbol == null)
+ return false;
+ switch (symbol.Kind) {
+ case SymbolKind.NamedType:
+ return true;
+ case SymbolKind.Property:
+ var property = (IPropertySymbol)symbol;
+ return property.OverriddenProperty != null || property.ExplicitInterfaceImplementations.Length > 0;
+ case SymbolKind.Event:
+ var evt = (IEventSymbol)symbol;
+ return evt.OverriddenEvent != null || evt.ExplicitInterfaceImplementations.Length > 0;
+ case SymbolKind.Method:
+ var method = (IMethodSymbol)symbol;
+ return method.OverriddenMethod != null || method.ExplicitInterfaceImplementations.Length > 0;
+ }
+ return false;
+ }
+
+ public static void GotoBase (MonoDevelop.Ide.Gui.Document doc, ISymbol symbol)
+ {
+ if (doc == null)
+ throw new ArgumentNullException ("doc");
+ if (symbol == null)
+ throw new ArgumentNullException ("symbol");
+ switch (symbol.Kind) {
+ case SymbolKind.NamedType:
+ RefactoringService.RoslynJumpToDeclaration (((ITypeSymbol)symbol).BaseType, doc.Project);
+ break;
+ case SymbolKind.Property:
+ var property = (IPropertySymbol)symbol;
+ if (property.OverriddenProperty != null)
+ RefactoringService.RoslynJumpToDeclaration (property.OverriddenProperty, doc.Project);
+ else
+ RefactoringService.RoslynJumpToDeclaration (property.ExplicitInterfaceImplementations.First (), doc.Project);
+ break;
+ case SymbolKind.Event:
+ var evt = (IEventSymbol)symbol;
+ if (evt.OverriddenEvent != null)
+ RefactoringService.RoslynJumpToDeclaration (evt.OverriddenEvent, doc.Project);
+ else
+ RefactoringService.RoslynJumpToDeclaration (evt.ExplicitInterfaceImplementations.First (), doc.Project);
+ break;
+ case SymbolKind.Method:
+ var method = (IMethodSymbol)symbol;
+ if (method.OverriddenMethod != null)
+ RefactoringService.RoslynJumpToDeclaration (method.OverriddenMethod, doc.Project);
+ else
+ RefactoringService.RoslynJumpToDeclaration (method.ExplicitInterfaceImplementations.First (), doc.Project);
+ break;
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/GotoDeclarationHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/GotoDeclarationHandler.cs
new file mode 100644
index 0000000000..7ca54c08f6
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/GotoDeclarationHandler.cs
@@ -0,0 +1,83 @@
+//
+// GotoDeclarationHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Refactoring;
+using MonoDevelop.Ide;
+using Microsoft.CodeAnalysis;
+using System.Collections.Immutable;
+using System.Threading.Tasks;
+using MonoDevelop.Ide.Editor;
+using System.Threading;
+using System;
+using Microsoft.CodeAnalysis.CSharp;
+using ICSharpCode.NRefactory6.CSharp.Features.GotoDefinition;
+using Mono.Posix;
+using MonoDevelop.Ide.TypeSystem;
+using System.Collections.Generic;
+
+namespace MonoDevelop.CSharp.Refactoring
+{
+ class GotoDeclarationHandler : CommandHandler
+ {
+ internal static MonoDevelop.Ide.FindInFiles.SearchResult GetJumpTypePartSearchResult (Microsoft.CodeAnalysis.ISymbol part, Microsoft.CodeAnalysis.Location location)
+ {
+ var provider = new MonoDevelop.Ide.FindInFiles.FileProvider (location.SourceTree.FilePath);
+ var doc = TextEditorFactory.CreateNewDocument ();
+ doc.Text = provider.ReadString ();
+ int position = location.SourceSpan.Start;
+ while (position + part.Name.Length < doc.Length) {
+ if (doc.GetTextAt (position, part.Name.Length) == part.Name)
+ break;
+ position++;
+ }
+ return new MonoDevelop.Ide.FindInFiles.SearchResult (provider, position, part.Name.Length);
+ }
+
+ protected override void Run (object data)
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ if (doc == null || doc.FileName == FilePath.Null)
+ return;
+ Run (doc);
+ }
+
+ public static void Run (MonoDevelop.Ide.Gui.Document doc)
+ {
+ GoToDefinitionService.TryGoToDefinition (doc.AnalysisDocument, doc.Editor.CaretOffset, default(CancellationToken));
+ }
+
+ public static void JumpToDeclaration (MonoDevelop.Ide.Gui.Document doc, RefactoringSymbolInfo info)
+ {
+ if (info.Symbol != null)
+ RefactoringService.RoslynJumpToDeclaration (info.Symbol, doc.Project);
+ if (info.CandidateSymbols.Length > 0)
+ RefactoringService.RoslynJumpToDeclaration (info.CandidateSymbols[0], doc.Project);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/HelperMethods.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/HelperMethods.cs
index 17de3d3aaa..20374b3452 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/HelperMethods.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/HelperMethods.cs
@@ -1,76 +1,91 @@
-//
-// HelperMethods.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2011 Xamarin Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.CSharp;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Refactoring;
-
-namespace MonoDevelop.CSharp.Refactoring
-{
- static class HelperMethods
- {
- public static TextReplaceChange GetRemoveNodeChange (this TextEditorData editor, AstNode n)
- {
- var change = new TextReplaceChange ();
- change.FileName = editor.FileName;
- change.Offset = editor.LocationToOffset (n.StartLocation);
- change.RemovedChars = editor.LocationToOffset (n.EndLocation) - change.Offset;
-
- // remove EOL, when line is empty
- var line = editor.GetLineByOffset (change.Offset);
- if (line != null && line.Length == change.RemovedChars)
- change.RemovedChars += line.DelimiterLength;
- return change;
- }
-
- public static ICSharpCode.NRefactory.CSharp.TextEditorOptions CreateNRefactoryTextEditorOptions (this TextEditorData doc)
- {
- return new ICSharpCode.NRefactory.CSharp.TextEditorOptions () {
- TabsToSpaces = doc.TabsToSpaces,
- TabSize = doc.Options.TabSize,
- IndentSize = doc.Options.IndentationSize,
- ContinuationIndent = doc.Options.IndentationSize,
- LabelIndent = -doc.Options.IndentationSize,
- EolMarker = doc.EolMarker,
- IndentBlankLines = doc.Options.IndentStyle != IndentStyle.Virtual,
- WrapLineLength = doc.Options.RulerColumn
- };
- }
-
- public static void RemoveNode (this TextEditorData editor, AstNode n)
- {
- var change = editor.GetRemoveNodeChange (n);
- editor.Remove (change.Offset, change.RemovedChars);
- }
- public static void Replace (this TextEditorData editor, AstNode n, AstNode replaceWith)
- {
- var change = editor.GetRemoveNodeChange (n);
- editor.Replace (change.Offset, change.RemovedChars, replaceWith.ToString ());
- }
- }
-}
-
+////
+//// HelperMethods.cs
+////
+//// Author:
+//// Mike Krüger <mkrueger@xamarin.com>
+////
+//// Copyright (c) 2011 Xamarin Inc.
+////
+//// Permission is hereby granted, free of charge, to any person obtaining a copy
+//// of this software and associated documentation files (the "Software"), to deal
+//// in the Software without restriction, including without limitation the rights
+//// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+//// copies of the Software, and to permit persons to whom the Software is
+//// furnished to do so, subject to the following conditions:
+////
+//// The above copyright notice and this permission notice shall be included in
+//// all copies or substantial portions of the Software.
+////
+//// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+//// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+//// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+//// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+//// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+//// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+//// THE SOFTWARE.
+//using System;
+//using ICSharpCode.NRefactory.CSharp;
+//using MonoDevelop.Ide.Gui;
+//using MonoDevelop.Refactoring;
+//using MonoDevelop.Ide.Editor;
+//
+//namespace MonoDevelop.CSharp.Refactoring
+//{
+// static class HelperMethods
+// {
+// public static TextReplaceChange GetRemoveNodeChange (this IReadonlyTextDocument editor, AstNode n)
+// {
+// var change = new TextReplaceChange ();
+// change.FileName = editor.FileName;
+// change.Offset = editor.LocationToOffset (n.StartLocation);
+// change.RemovedChars = editor.LocationToOffset (n.EndLocation) - change.Offset;
+//
+// // remove EOL, when line is empty
+// var line = editor.GetLineByOffset (change.Offset);
+// if (line != null && line.Length == change.RemovedChars)
+// change.RemovedChars += line.DelimiterLength;
+// return change;
+// }
+//
+// public static ICSharpCode.NRefactory.CSharp.TextEditorOptions CreateNRefactoryTextEditorOptions (this IReadonlyTextDocument doc, MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy policy, MonoDevelop.Ide.Gui.Content.TextStylePolicy textPolicy)
+// {
+// return new ICSharpCode.NRefactory.CSharp.TextEditorOptions () {
+// TabsToSpaces = textPolicy.TabsToSpaces,
+// TabSize = textPolicy.TabWidth,
+// IndentSize = textPolicy.IndentWidth,
+// ContinuationIndent = textPolicy.IndentWidth,
+// LabelIndent = -textPolicy.IndentWidth,
+// EolMarker = doc.GetEolMarker (),
+// IndentBlankLines = DefaultSourceEditorOptions.Instance.IndentStyle != IndentStyle.Virtual,
+// WrapLineLength = DefaultSourceEditorOptions.Instance.RulerColumn
+// };
+// }
+//
+// public static ICSharpCode.NRefactory.CSharp.TextEditorOptions CreateNRefactoryTextEditorOptions (this TextEditor doc)
+// {
+// return new ICSharpCode.NRefactory.CSharp.TextEditorOptions () {
+// TabsToSpaces = doc.Options.TabsToSpaces,
+// TabSize = doc.Options.TabSize,
+// IndentSize = doc.Options.IndentationSize,
+// ContinuationIndent = doc.Options.IndentationSize,
+// LabelIndent = -doc.Options.IndentationSize,
+// EolMarker = doc.EolMarker,
+// IndentBlankLines = doc.Options.IndentStyle != IndentStyle.Virtual,
+// WrapLineLength = doc.Options.RulerColumn
+// };
+// }
+//
+// public static void RemoveNode (this ITextDocument editor, AstNode n)
+// {
+// var change = editor.GetRemoveNodeChange (n);
+// editor.RemoveText (change.Offset, change.RemovedChars);
+// }
+//
+// public static void Replace (this ITextDocument editor, AstNode n, AstNode replaceWith)
+// {
+// var change = editor.GetRemoveNodeChange (n);
+// editor.ReplaceText (change.Offset, change.RemovedChars, replaceWith.ToString ());
+// }
+// }
+//}
+//
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/OrganizeImportsCommandHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/OrganizeImportsCommandHandler.cs
new file mode 100644
index 0000000000..7f40207999
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/OrganizeImportsCommandHandler.cs
@@ -0,0 +1,166 @@
+//
+// OrganizeImportsCommandHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Components.Commands;
+using ICSharpCode.NRefactory6.CSharp.ExtractMethod;
+using MonoDevelop.Ide;
+using ICSharpCode.NRefactory6.CSharp;
+using System.Threading;
+using Microsoft.CodeAnalysis.Text;
+using System.Linq;
+using MonoDevelop.Refactoring;
+using MonoDevelop.Core;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp.Features.OrganizeImports;
+using System.Collections.Generic;
+using ICSharpCode.NRefactory6.CSharp.Features.RemoveUnnecessaryImports;
+
+namespace MonoDevelop.CSharp.Refactoring
+{
+ internal static partial class IWorkspaceExtensions
+ {
+ /// <summary>
+ /// Update the workspace so that the document with the Id of <paramref name="newDocument"/>
+ /// has the text of newDocument. If the document is open, then this method will determine a
+ /// minimal set of changes to apply to the document.
+ /// </summary>
+ internal static void ApplyDocumentChanges (this Workspace workspace, Document newDocument, CancellationToken cancellationToken)
+ {
+ var oldSolution = workspace.CurrentSolution;
+ var oldDocument = oldSolution.GetDocument (newDocument.Id);
+ var changes = newDocument.GetTextChangesAsync (oldDocument, cancellationToken).WaitAndGetResult (cancellationToken);
+ var newSolution = oldSolution.UpdateDocument (newDocument.Id, changes, cancellationToken);
+ workspace.TryApplyChanges (newSolution);
+ }
+
+
+ internal static Solution UpdateDocument(this Solution solution, DocumentId id, IEnumerable<TextChange> textChanges, CancellationToken cancellationToken)
+ {
+ var oldDocument = solution.GetDocument(id);
+ var oldText = oldDocument.GetTextAsync(cancellationToken).WaitAndGetResult(cancellationToken);
+ var newText = oldText.WithChanges(textChanges);
+ return solution.WithDocumentText(id, newText, PreservationMode.PreserveIdentity);
+ }
+ }
+
+ class RemoveUnusedImportsCommandHandler : CommandHandler
+ {
+ internal static readonly CSharpRemoveUnnecessaryImportsService service = new CSharpRemoveUnnecessaryImportsService();
+
+ public async static Task Run (MonoDevelop.Ide.Gui.Document doc)
+ {
+ var ad = doc.AnalysisDocument;
+ if (ad == null)
+ return;
+ try {
+
+ var model = await ad.GetSemanticModelAsync (default (CancellationToken));
+ var root = model.SyntaxTree.GetRoot (default (CancellationToken));
+ var newDocument = service.RemoveUnnecessaryImports(ad, model, root, default (CancellationToken));
+ ad.Project.Solution.Workspace.ApplyDocumentChanges(newDocument, CancellationToken.None);
+
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while removing unused usings", e);
+ }
+ }
+
+ protected async override void Run ()
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ if (doc == null)
+ return;
+ await Run (doc);
+ }
+ }
+
+ class OrganizeImportsCommandHandler : CommandHandler
+ {
+ internal static readonly CSharpOrganizeImportsService service = new CSharpOrganizeImportsService ();
+
+ public async static Task Run (MonoDevelop.Ide.Gui.Document doc)
+ {
+ var ad = doc.AnalysisDocument;
+ if (ad == null)
+ return;
+ try {
+ Document newDocument = await SortUsingsAsync (ad, default (CancellationToken));
+ ad.Project.Solution.Workspace.ApplyDocumentChanges (newDocument, CancellationToken.None);
+
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while sotring usings", e);
+ }
+ }
+
+ internal static async Task<Document> SortUsingsAsync (Document ad, CancellationToken token)
+ {
+ var policy = IdeApp.Workbench.ActiveDocument.GetFormattingPolicy ();
+ Console.WriteLine (policy.PlaceSystemDirectiveFirst);
+ return await service.OrganizeImportsAsync (ad, policy != null ? policy.PlaceSystemDirectiveFirst : true, token);
+ }
+
+ protected async override void Run ()
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ if (doc == null)
+ return;
+ await Run (doc);
+ }
+ }
+
+ class SortAndRemoveImportsCommandHandler : CommandHandler
+ {
+ public async static Task Run (MonoDevelop.Ide.Gui.Document doc)
+ {
+ var ad = doc.AnalysisDocument;
+ if (ad == null)
+ return;
+ try {
+ Document newDocument = await SortAndRemoveAsync (ad, default (CancellationToken));
+ ad.Project.Solution.Workspace.ApplyDocumentChanges (newDocument, CancellationToken.None);
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while removing unused usings", e);
+ }
+ }
+
+ internal static async Task<Document> SortAndRemoveAsync (Document ad, CancellationToken token)
+ {
+ var model = await ad.GetSemanticModelAsync (token);
+ var root = model.SyntaxTree.GetRoot (token);
+ var newDocument = RemoveUnusedImportsCommandHandler.service.RemoveUnnecessaryImports (ad, model, root, token);
+ return await OrganizeImportsCommandHandler.SortUsingsAsync (newDocument, token);
+ }
+
+ protected async override void Run ()
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ if (doc == null)
+ return;
+ await Run (doc);
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/RefactoryCommands.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/RefactoryCommands.cs
new file mode 100644
index 0000000000..f212a37b76
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/RefactoryCommands.cs
@@ -0,0 +1,304 @@
+//
+// RefactoryCommands.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Ide;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.CodeActions;
+using MonoDevelop.CodeIssues;
+using MonoDevelop.CSharp.Refactoring;
+using MonoDevelop.Refactoring;
+using Microsoft.CodeAnalysis.CodeFixes;
+using System.Collections.Immutable;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.Diagnostics;
+using System.Collections.Generic;
+using ICSharpCode.NRefactory.CSharp.Refactoring;
+using MonoDevelop.CSharp.Navigation;
+using Microsoft.CodeAnalysis.Text;
+
+namespace MonoDevelop.CSharp.Refactoring
+{
+ sealed class CurrentRefactoryOperationsHandler : CommandHandler
+ {
+ protected override void Run (object dataItem)
+ {
+ var del = (Action) dataItem;
+ if (del != null)
+ del ();
+ }
+
+ static CommandInfoSet CreateFixMenu (TextEditor editor, DocumentContext ctx, SemanticModel semanticModel, CodeActionContainer container)
+ {
+ if (editor == null)
+ throw new ArgumentNullException (nameof (editor));
+ if (ctx == null)
+ throw new ArgumentNullException (nameof (ctx));
+ if (container == null)
+ throw new ArgumentNullException (nameof (container));
+ var result = new CommandInfoSet ();
+ result.Text = GettextCatalog.GetString ("Fix");
+ foreach (var diagnostic in container.CodeFixActions) {
+ var info = new CommandInfo (diagnostic.CodeAction.Title);
+ result.CommandInfos.Add (info, new Action (async () => await new CodeActionEditorExtension.ContextActionRunner (diagnostic.CodeAction, editor, ctx).Run ()));
+ }
+ bool firstDiagnosticOption = result.CommandInfos.Count != 0;
+
+ var warningsAtCaret = semanticModel
+ .GetDiagnostics (new TextSpan (editor.CaretOffset, 0))
+ .Where (diag => diag.Severity == DiagnosticSeverity.Warning).ToList ();
+ foreach (var warning in warningsAtCaret) {
+
+ if (firstDiagnosticOption) {
+ result.CommandInfos.AddSeparator ();
+ firstDiagnosticOption = false;
+ }
+
+ var label = GettextCatalog.GetString ("_Options for \"{0}\"", warning.Descriptor.Title);
+ var subMenu = new CommandInfoSet ();
+ subMenu.Text = label;
+
+ var info = new CommandInfo (GettextCatalog.GetString ("_Suppress with #pragma"));
+ subMenu.CommandInfos.Add (info, new Action (async delegate {
+
+ var fixes = await CSharpSuppressionFixProvider.Instance.GetSuppressionsAsync (ctx.AnalysisDocument, new TextSpan (editor.CaretOffset, 0), new [] { warning }, default (CancellationToken)).ConfigureAwait (false);
+ foreach (var f in fixes) {
+ CodeDiagnosticDescriptor.RunAction (ctx, f.Action, default (CancellationToken));
+ }
+ }));
+
+ result.CommandInfos.Add (subMenu);
+ }
+
+ foreach (var fix in container.DiagnosticsAtCaret) {
+ var inspector = BuiltInCodeDiagnosticProvider.GetCodeDiagnosticDescriptor (fix.Id);
+ if (inspector == null)
+ continue;
+
+ if (firstDiagnosticOption) {
+ result.CommandInfos.AddSeparator ();
+ firstDiagnosticOption = false;
+ }
+
+ var label = GettextCatalog.GetString ("_Options for \"{0}\"", fix.GetMessage ());
+ var subMenu = new CommandInfoSet ();
+ subMenu.Text = label;
+
+ // if (inspector.CanSuppressWithAttribute) {
+ // var menuItem = new FixMenuEntry (GettextCatalog.GetString ("_Suppress with attribute"),
+ // delegate {
+ //
+ // inspector.SuppressWithAttribute (Editor, DocumentContext, GetTextSpan (fix.Item2));
+ // });
+ // subMenu.Add (menuItem);
+ // }
+
+ if (inspector.CanDisableWithPragma) {
+ var info = new CommandInfo (GettextCatalog.GetString ("_Suppress with #pragma"));
+ subMenu.CommandInfos.Add (info, new Action (() => inspector.DisableWithPragma (editor, ctx, fix)));
+
+ info = new CommandInfo (GettextCatalog.GetString ("_Suppress with file"));
+ subMenu.CommandInfos.Add (info, new Action (() => inspector.DisableWithFile (editor, ctx, fix)));
+ }
+
+ var configInfo = new CommandInfo (GettextCatalog.GetString ("_Configure Rule"));
+ subMenu.CommandInfos.Add (configInfo, new Action (() => {
+ IdeApp.Workbench.ShowGlobalPreferencesDialog (null, "C#", dialog => {
+ var panel = dialog.GetPanel<CodeIssuePanel> ("C#");
+ if (panel == null)
+ return;
+ panel.Widget.SelectCodeIssue (inspector.IdString);
+ });
+ }));
+
+ foreach (var fix2 in container.CodeFixActions) {
+
+ var provider = fix2.Diagnostic.GetCodeFixProvider ().GetFixAllProvider ();
+ if (provider == null)
+ continue;
+ if (!provider.GetSupportedFixAllScopes ().Contains (FixAllScope.Document))
+ continue;
+ var subMenu2 = new CommandInfoSet ();
+ subMenu2.Text = GettextCatalog.GetString ("Fix all");
+ var diagnosticAnalyzer = fix2.Diagnostic.GetCodeDiagnosticDescriptor (LanguageNames.CSharp).GetProvider ();
+ if (!diagnosticAnalyzer.SupportedDiagnostics.Contains (fix.Descriptor))
+ continue;
+
+ var info = new CommandInfo (GettextCatalog.GetString ("In _Document"));
+ subMenu2.CommandInfos.Add (info, new Action (async delegate {
+
+ var fixAllDiagnosticProvider = new CodeActionEditorExtension.FixAllDiagnosticProvider (diagnosticAnalyzer.SupportedDiagnostics.Select (d => d.Id).ToImmutableHashSet (), async (Microsoft.CodeAnalysis.Document doc, ImmutableHashSet<string> diagnostics, CancellationToken token) => {
+
+ var model = await doc.GetSemanticModelAsync (token);
+ var compilationWithAnalyzer = model.Compilation.WithAnalyzers (new [] { diagnosticAnalyzer }.ToImmutableArray (), null, token);
+
+ return await compilationWithAnalyzer.GetAnalyzerSemanticDiagnosticsAsync (model, null, token);
+ }, (arg1, arg2, arg3, arg4) => {
+ return Task.FromResult ((IEnumerable<Diagnostic>)new Diagnostic [] { });
+ });
+ var ctx2 = new FixAllContext (
+ ctx.AnalysisDocument,
+ fix2.Diagnostic.GetCodeFixProvider (),
+ FixAllScope.Document,
+ fix2.CodeAction.EquivalenceKey,
+ diagnosticAnalyzer.SupportedDiagnostics.Select (d => d.Id),
+ fixAllDiagnosticProvider,
+ default (CancellationToken)
+ );
+ var fixAll = await provider.GetFixAsync (ctx2);
+ using (var undo = editor.OpenUndoGroup ()) {
+ CodeDiagnosticDescriptor.RunAction (ctx, fixAll, default (CancellationToken));
+ }
+ }));
+ subMenu.CommandInfos.Add (subMenu2);
+ }
+ result.CommandInfos.Add (subMenu);
+ }
+
+ return result;
+ }
+
+ protected override void Update (CommandArrayInfo ainfo)
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ if (doc == null || doc.FileName == FilePath.Null || doc.ParsedDocument == null)
+ return;
+ var semanticModel = doc.ParsedDocument.GetAst<SemanticModel> ();
+ if (semanticModel == null)
+ return;
+ var task = RefactoringSymbolInfo.GetSymbolInfoAsync (doc, doc.Editor);
+ if (!task.Wait (2000))
+ return;
+ var info = task.Result;
+ bool added = false;
+
+ var ext = doc.GetContent<CodeActionEditorExtension> ();
+
+ if (ext != null) {
+ var fixMenu = CreateFixMenu (doc.Editor, doc, semanticModel, ext.GetCurrentFixes ());
+ if (fixMenu.CommandInfos.Count > 0) {
+ ainfo.Add (fixMenu, null);
+ added = true;
+ }
+ }
+ var ciset = new CommandInfoSet ();
+ ciset.Text = GettextCatalog.GetString ("Refactor");
+
+ bool canRename = RenameHandler.CanRename (info.Symbol ?? info.DeclaredSymbol);
+ if (canRename) {
+ ciset.CommandInfos.Add (IdeApp.CommandService.GetCommandInfo (MonoDevelop.Ide.Commands.EditCommands.Rename), new Action (async delegate {
+ await new MonoDevelop.Refactoring.Rename.RenameRefactoring ().Rename (info.Symbol ?? info.DeclaredSymbol);
+ }));
+ added = true;
+ }
+ bool first = true;
+ if (ext != null) {
+ foreach (var fix in ext.GetCurrentFixes ().CodeRefactoringActions) {
+ if (added & first && ciset.CommandInfos.Count > 0)
+ ciset.CommandInfos.AddSeparator ();
+ var info2 = new CommandInfo (fix.CodeAction.Title);
+ ciset.CommandInfos.Add (info2, new Action (async () => await new CodeActionEditorExtension.ContextActionRunner (fix.CodeAction, doc.Editor, doc).Run ()));
+ added = true;
+ first = false;
+ }
+ }
+
+ if (ciset.CommandInfos.Count > 0) {
+ ainfo.Add (ciset, null);
+ added = true;
+ }
+
+ var gotoDeclarationSymbol = info.Symbol;
+ if (gotoDeclarationSymbol == null && info.DeclaredSymbol != null && info.DeclaredSymbol.Locations.Length > 1)
+ gotoDeclarationSymbol = info.DeclaredSymbol;
+ if (IdeApp.ProjectOperations.CanJumpToDeclaration (gotoDeclarationSymbol) || gotoDeclarationSymbol == null && IdeApp.ProjectOperations.CanJumpToDeclaration (info.CandidateSymbols.FirstOrDefault ())) {
+
+ var type = (gotoDeclarationSymbol ?? info.CandidateSymbols.FirstOrDefault ()) as INamedTypeSymbol;
+ if (type != null && type.Locations.Length > 1) {
+ var declSet = new CommandInfoSet ();
+ declSet.Text = GettextCatalog.GetString ("_Go to Declaration");
+ foreach (var part in type.Locations) {
+ var loc = part.GetLineSpan ();
+ declSet.CommandInfos.Add (string.Format (GettextCatalog.GetString ("{0}, Line {1}"), FormatFileName (part.SourceTree.FilePath), loc.StartLinePosition.Line + 1), new Action (() => IdeApp.ProjectOperations.JumpTo (type, part, doc.Project)));
+ }
+ ainfo.Add (declSet);
+ } else {
+ ainfo.Add (IdeApp.CommandService.GetCommandInfo (RefactoryCommands.GotoDeclaration), new Action (() => GotoDeclarationHandler.Run (doc)));
+ }
+ added = true;
+ }
+
+
+ if (info.DeclaredSymbol != null && GotoBaseDeclarationHandler.CanGotoBase (info.DeclaredSymbol)) {
+ ainfo.Add (GotoBaseDeclarationHandler.GetDescription (info.DeclaredSymbol), new Action (() => GotoBaseDeclarationHandler.GotoBase (doc, info.DeclaredSymbol)));
+ added = true;
+ }
+
+ var sym = info.Symbol ?? info.DeclaredSymbol;
+ if (doc.HasProject && sym != null) {
+ ainfo.Add (IdeApp.CommandService.GetCommandInfo (RefactoryCommands.FindReferences), new System.Action (() => {
+
+ if (sym.Kind == SymbolKind.Local || sym.Kind == SymbolKind.Parameter || sym.Kind == SymbolKind.TypeParameter) {
+ FindReferencesHandler.FindRefs (sym);
+ } else {
+ RefactoringService.FindReferencesAsync (FindReferencesHandler.FilterSymbolForFindReferences (sym).GetDocumentationCommentId ());
+ }
+
+ }));
+ try {
+ if (Microsoft.CodeAnalysis.FindSymbols.SymbolFinder.FindSimilarSymbols (sym, semanticModel.Compilation).Count () > 1)
+ ainfo.Add (IdeApp.CommandService.GetCommandInfo (RefactoryCommands.FindAllReferences), new System.Action (() => RefactoringService.FindAllReferencesAsync (FindReferencesHandler.FilterSymbolForFindReferences (sym).GetDocumentationCommentId ())));
+ } catch (Exception) {
+ // silently ignore roslyn bug.
+ }
+ }
+ added = true;
+
+ }
+
+ static string FormatFileName (string fileName)
+ {
+ if (fileName == null)
+ return null;
+ char[] seperators = { System.IO.Path.DirectorySeparatorChar, System.IO.Path.AltDirectorySeparatorChar };
+ int idx = fileName.LastIndexOfAny (seperators);
+ if (idx > 0)
+ idx = fileName.LastIndexOfAny (seperators, idx - 1);
+ if (idx > 0)
+ return "..." + fileName.Substring (idx);
+ return fileName;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/RenameHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/RenameHandler.cs
new file mode 100644
index 0000000000..a59854a2e1
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/RenameHandler.cs
@@ -0,0 +1,96 @@
+//
+// RenameHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Ide;
+using MonoDevelop.Core;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.Editor;
+using System.Linq;
+using ICSharpCode.NRefactory6.CSharp;
+using MonoDevelop.Refactoring;
+using MonoDevelop.Refactoring.Rename;
+using MonoDevelop.Ide.TypeSystem;
+using System.Threading.Tasks;
+using System.Threading;
+
+namespace MonoDevelop.CSharp.Refactoring
+{
+ class RenameHandler : CommandHandler
+ {
+ public void UpdateCommandInfo (CommandInfo ci)
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ if (doc == null || doc.FileName == FilePath.Null)
+ return;
+ ci.Enabled = doc.ParsedDocument != null && doc.ParsedDocument.GetAst<SemanticModel> () != null;
+ }
+
+ internal static bool CanRename (ISymbol symbol)
+ {
+ if (symbol == null || symbol.IsDefinedInMetadata ())
+ return false;
+ switch (symbol.Kind) {
+ case SymbolKind.Local:
+ case SymbolKind.Parameter:
+ case SymbolKind.NamedType:
+ case SymbolKind.Namespace:
+ case SymbolKind.Method:
+ case SymbolKind.Field:
+ case SymbolKind.Property:
+ case SymbolKind.Event:
+ case SymbolKind.Label:
+ case SymbolKind.TypeParameter:
+ case SymbolKind.RangeVariable:
+ return true;
+ }
+ return false;
+ }
+
+ protected override async void Run (object data)
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ if (doc == null || doc.FileName == FilePath.Null)
+ return;
+ await Run (doc.Editor, doc);
+ }
+
+ internal async Task Run (TextEditor editor, DocumentContext ctx)
+ {
+ var cts = new CancellationTokenSource ();
+ var getSymbolTask = RefactoringSymbolInfo.GetSymbolInfoAsync (ctx, editor, cts.Token);
+ var message = GettextCatalog.GetString ("Resolving symbol…");
+ var info = await MessageService.ExecuteTaskAndShowWaitDialog (getSymbolTask, message, cts);
+ var sym = info.DeclaredSymbol ?? info.Symbol;
+ if (!CanRename (sym))
+ return;
+ await new RenameRefactoring ().Rename (sym);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Resolver/DebuggerExpressionResolver.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Resolver/DebuggerExpressionResolver.cs
new file mode 100644
index 0000000000..9ec0edec0f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Resolver/DebuggerExpressionResolver.cs
@@ -0,0 +1,171 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+//
+// DebuggerExpressionResolver.cs
+//
+// Author:
+// David Karlaš <david.karlas@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis.CSharp;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Debugger;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace MonoDevelop.CSharp.Resolver
+{
+ static class DebuggerExpressionResolver
+ {
+ public static async Task<DebugDataTipInfo> ResolveAsync (IReadonlyTextDocument editor, DocumentContext document, int offset, CancellationToken cancellationToken)
+ {
+ var analysisDocument = document.AnalysisDocument;
+ DebugDataTipInfo result;
+ CompilationUnitSyntax compilationUnit = null;
+ if (analysisDocument == null) {
+ compilationUnit = SyntaxFactory.ParseCompilationUnit (editor.Text);
+ result = GetInfo (compilationUnit, null, offset, default(CancellationToken));
+ } else {
+ compilationUnit = await analysisDocument.GetCSharpSyntaxRootAsync (cancellationToken).ConfigureAwait (false);
+ var semantic = document.ParsedDocument?.GetAst<SemanticModel> ();
+ if (semantic == null) {
+ semantic = await analysisDocument.GetSemanticModelAsync (cancellationToken).ConfigureAwait (false);
+ }
+ result = GetInfo (compilationUnit, semantic, offset, default(CancellationToken));
+ }
+ if (result.IsDefault || !result.Span.Contains(offset)) {
+ return new DebugDataTipInfo (result.Span, null);
+ } else if (result.Text == null) {
+ return new DebugDataTipInfo (result.Span, compilationUnit.GetText ().ToString (result.Span));
+ } else {
+ return result;
+ }
+ }
+
+ static DebugDataTipInfo GetInfo (CompilationUnitSyntax root, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ var token = root.FindToken (position);
+ string textOpt = null;
+
+ var expression = token.Parent as ExpressionSyntax;
+ if (expression == null) {
+ if (Microsoft.CodeAnalysis.CSharpExtensions.IsKind (token, SyntaxKind.IdentifierToken)) {
+ if (token.Parent is MethodDeclarationSyntax) {
+ return default(DebugDataTipInfo);
+ }
+ if (semanticModel != null) {
+ if (token.Parent is PropertyDeclarationSyntax) {
+ var propertySymbol = semanticModel.GetDeclaredSymbol ((PropertyDeclarationSyntax)token.Parent);
+ if (propertySymbol.IsStatic) {
+ textOpt = propertySymbol.ContainingType.GetFullName () + "." + propertySymbol.Name;
+ }
+ } else if (token.GetAncestor<FieldDeclarationSyntax> () != null) {
+ var fieldSymbol = semanticModel.GetDeclaredSymbol (token.GetAncestor<VariableDeclaratorSyntax> ());
+ if (fieldSymbol.IsStatic) {
+ textOpt = fieldSymbol.ContainingType.GetFullName () + "." + fieldSymbol.Name;
+ }
+ }
+ }
+
+ return new DebugDataTipInfo (token.Span, text: textOpt);
+ } else {
+ return default(DebugDataTipInfo);
+ }
+ }
+
+ if (expression.IsAnyLiteralExpression ()) {
+ // If the user hovers over a literal, give them a DataTip for the type of the
+ // literal they're hovering over.
+ // Partial semantics should always be sufficient because the (unconverted) type
+ // of a literal can always easily be determined.
+ var type = semanticModel?.GetTypeInfo (expression, cancellationToken).Type;
+ return type == null
+ ? default(DebugDataTipInfo)
+ : new DebugDataTipInfo (expression.Span, type.GetFullName ());
+ }
+
+ // Check if we are invoking method and if we do return null so we don't invoke it
+ if (expression.Parent is InvocationExpressionSyntax ||
+ (semanticModel != null &&
+ expression.Parent is MemberAccessExpressionSyntax &&
+ expression.Parent.Parent is InvocationExpressionSyntax &&
+ semanticModel.GetSymbolInfo (token).Symbol is IMethodSymbol))
+ {
+ return default(DebugDataTipInfo);
+ }
+
+ if (expression.IsRightSideOfDotOrArrow ()) {
+ var curr = expression;
+ while (true) {
+ var conditionalAccess = curr.GetParentConditionalAccessExpression ();
+ if (conditionalAccess == null) {
+ break;
+ }
+
+ curr = conditionalAccess;
+ }
+
+ if (curr == expression) {
+ // NB: Parent.Span, not Span as below.
+ return new DebugDataTipInfo (expression.Parent.Span, text: null);
+ }
+
+ // NOTE: There may not be an ExpressionSyntax corresponding to the range we want.
+ // For example, for input a?.$$B?.C, we want span [|a?.B|]?.C.
+ return new DebugDataTipInfo (TextSpan.FromBounds (curr.SpanStart, expression.Span.End), text: null);
+ }
+
+ var typeSyntax = expression as TypeSyntax;
+ if (typeSyntax != null && typeSyntax.IsVar) {
+ // If the user is hovering over 'var', then pass back the full type name that 'var'
+ // binds to.
+ var type = semanticModel?.GetTypeInfo (typeSyntax, cancellationToken).Type;
+ if (type != null) {
+ textOpt = type.GetFullName ();
+ }
+ }
+
+ if (semanticModel != null) {
+ if (expression is IdentifierNameSyntax) {
+ if (expression.Parent is ObjectCreationExpressionSyntax) {
+ textOpt = ((INamedTypeSymbol)semanticModel.GetSymbolInfo (expression).Symbol).GetFullName ();
+ } else if (expression.Parent is AssignmentExpressionSyntax && expression.Parent.Parent is InitializerExpressionSyntax) {
+ var variable = expression.GetAncestor<VariableDeclaratorSyntax> ();
+ if (variable != null) {
+ textOpt = variable.Identifier.Text + "." + ((IdentifierNameSyntax)expression).Identifier.Text;
+ }
+ }
+
+ }
+ }
+ return new DebugDataTipInfo (expression.Span, textOpt);
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Resolver/HelperMethods.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Resolver/HelperMethods.cs
index e10e928eb4..9e74e510a1 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Resolver/HelperMethods.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Resolver/HelperMethods.cs
@@ -41,35 +41,30 @@ using MonoDevelop.Ide.CodeTemplates;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Refactoring;
using MonoDevelop.CSharp.Parser;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.Completion;
-using ICSharpCode.NRefactory.Semantics;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
-using ICSharpCode.NRefactory.CSharp.Resolver;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Components.PropertyGrid.PropertyEditors;
+using MonoDevelop.Ide.Editor;
+using Microsoft.CodeAnalysis.Options;
namespace MonoDevelop.CSharp
{
static class HelperMethods
{
- public static void SetText (this CompletionData data, string text)
- {
- if (data is CompletionData) {
- ((CompletionData)data).CompletionText = text;
- } else if (data is IEntityCompletionData) {
- ((IEntityCompletionData)data).CompletionText = text;
- } else {
- System.Console.WriteLine("Unknown completion data:" + data);
- }
- }
+// public static void SetText (this CompletionData data, string text)
+// {
+// if (data is CompletionData) {
+// ((CompletionData)data).CompletionText = text;
+// } else if (data is IEntityCompletionData) {
+// ((IEntityCompletionData)data).CompletionText = text;
+// } else {
+// System.Console.WriteLine("Unknown completion data:" + data);
+// }
+// }
- public static ICSharpCode.NRefactory.CSharp.SyntaxTree Parse (this ICSharpCode.NRefactory.CSharp.CSharpParser parser, TextEditorData data)
- {
- using (var stream = data.OpenStream ()) {
- return parser.Parse (stream, data.Document.FileName);
- }
- }
+// public static ICSharpCode.NRefactory.CSharp.SyntaxTree Parse (this ICSharpCode.NRefactory.CSharp.CSharpParser parser, IReadonlyTextDocument data)
+// {
+// return parser.Parse (new ICSharpCode.NRefactory.Editor.StringTextSource (data.Text), data.FileName);
+// }
// public static AstNode ParseSnippet (this ICSharpCode.NRefactory.CSharp.CSharpParser parser, TextEditorData data)
// {
@@ -90,51 +85,53 @@ namespace MonoDevelop.CSharp
// }
// }
- internal static MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy GetFormattingPolicy (this MonoDevelop.Ide.Gui.Document doc)
+ internal static MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy GetFormattingPolicy (this DocumentContext doc)
{
- var policyParent = doc.Project != null ? doc.Project.Policies : null;
+ var policyParent = doc?.Project?.Policies;
var types = MonoDevelop.Ide.DesktopService.GetMimeTypeInheritanceChain (MonoDevelop.CSharp.Formatting.CSharpFormatter.MimeType);
var codePolicy = policyParent != null ? policyParent.Get<MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy> (types) : MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy> (types);
return codePolicy;
}
- public static CSharpFormattingOptions GetFormattingOptions (this MonoDevelop.Ide.Gui.Document doc)
+ public static OptionSet GetFormattingOptions (this DocumentContext doc)
{
- return GetFormattingPolicy (doc).CreateOptions ();
+ return GetFormattingOptions (doc.Project);
}
- public static CSharpFormattingOptions GetFormattingOptions (this MonoDevelop.Projects.Project project)
+ public static OptionSet GetFormattingOptions (this MonoDevelop.Projects.Project project)
{
var types = MonoDevelop.Ide.DesktopService.GetMimeTypeInheritanceChain (MonoDevelop.CSharp.Formatting.CSharpFormatter.MimeType);
var codePolicy = project != null ? project.Policies.Get<MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy> (types) :
MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy> (types);
- return codePolicy.CreateOptions ();
+ var textPolicy = project != null ? project.Policies.Get<TextStylePolicy> (types) :
+ MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<TextStylePolicy> (types);
+ return codePolicy.CreateOptions (textPolicy);
}
- public static bool TryResolveAt (this Document doc, DocumentLocation loc, out ResolveResult result, out AstNode node)
- {
- if (doc == null)
- throw new ArgumentNullException ("doc");
- result = null;
- node = null;
- var parsedDocument = doc.ParsedDocument;
- if (parsedDocument == null)
- return false;
-
- var unit = parsedDocument.GetAst<SyntaxTree> ();
- var parsedFile = parsedDocument.ParsedFile as CSharpUnresolvedFile;
-
- if (unit == null || parsedFile == null)
- return false;
- try {
- result = ResolveAtLocation.Resolve (new Lazy<ICompilation>(() => doc.Compilation), parsedFile, unit, loc, out node);
- if (result == null || node is Statement)
- return false;
- } catch (Exception e) {
- Console.WriteLine ("Got resolver exception:" + e);
- return false;
- }
- return true;
- }
+// public static bool TryResolveAt (this DocumentContext documentContext, DocumentLocation loc, out ResolveResult result, out AstNode node)
+// {
+// if (documentContext == null)
+// throw new ArgumentNullException ("documentContext");
+// result = null;
+// node = null;
+// var parsedDocument = documentContext.ParsedDocument;
+// if (parsedDocument == null)
+// return false;
+//
+// var unit = parsedDocument.GetAst<SyntaxTree> ();
+// var parsedFile = parsedDocument.ParsedFile as CSharpUnresolvedFile;
+//
+// if (unit == null || parsedFile == null)
+// return false;
+// try {
+// result = ResolveAtLocation.Resolve (new Lazy<ICompilation>(() => documentContext.Compilation), parsedFile, unit, loc, out node);
+// if (result == null || node is Statement)
+// return false;
+// } catch (Exception e) {
+// Console.WriteLine ("Got resolver exception:" + e);
+// return false;
+// }
+// return true;
+// }
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Resolver/TextEditorResolverProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Resolver/TextEditorResolverProvider.cs
index 1f73971a9f..b982b84224 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Resolver/TextEditorResolverProvider.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Resolver/TextEditorResolverProvider.cs
@@ -1,21 +1,21 @@
-//
+//
// TextEditorResolverProvider.cs
-//
+//
// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
-//
+// David Karlaš <david.karlas@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
-//
+//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
-//
+//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -23,290 +23,66 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using System;
using MonoDevelop.Ide.Gui.Content;
-using MonoDevelop.Core;
-using Mono.TextEditor;
-using System.Text;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.CSharp;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.Editor;
using System.Linq;
-using System.Collections.Generic;
-using ICSharpCode.NRefactory.Semantics;
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
-using System.Threading;
-using MonoDevelop.Refactoring;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
namespace MonoDevelop.CSharp.Resolver
{
class TextEditorResolverProvider : ITextEditorResolverProvider
{
#region ITextEditorResolverProvider implementation
-
- public string GetExpression (Mono.TextEditor.TextEditorData data, int offset)
- {
- if (offset < 0)
- return "";
- var doc = IdeApp.Workbench.ActiveDocument;
- if (doc == null)
- return "";
- var loc = RefactoringService.GetCorrectResolveLocation (doc, data.OffsetToLocation (offset));
- var unit = doc.ParsedDocument.GetAst<SyntaxTree> ();
- var parsedFile = doc.ParsedDocument.ParsedFile as CSharpUnresolvedFile;
- var node = unit.GetNodeAt<Expression> (loc.Line, loc.Column);
- if (unit == null || parsedFile == null || node == null)
- return "";
-
- return data.GetTextBetween (node.StartLocation, node.EndLocation);
- }
-
-
- public ResolveResult GetLanguageItem (MonoDevelop.Ide.Gui.Document doc, int offset, out DomRegion expressionRegion)
- {
- if (offset < 0) {
- expressionRegion = DomRegion.Empty;
- return null;
- }
- var loc = RefactoringService.GetCorrectResolveLocation (doc, doc.Editor.OffsetToLocation (offset));
- ResolveResult result;
- AstNode node;
- if (!doc.TryResolveAt (loc, out result, out node)) {
- expressionRegion = DomRegion.Empty;
- return null;
- }
- expressionRegion = new DomRegion (node.StartLocation, node.EndLocation);
- return result;
- }
-
- public ResolveResult GetLanguageItem (MonoDevelop.Ide.Gui.Document doc, int offset, string expression)
+ public ISymbol GetLanguageItem (MonoDevelop.Ide.Gui.Document document, int offset, out DocumentRegion expressionRegion)
{
- if (offset < 0) {
- return null;
- }
-
- var parsedDocument = doc.ParsedDocument;
+ expressionRegion = DocumentRegion.Empty;
+ var parsedDocument = document.ParsedDocument;
if (parsedDocument == null)
return null;
- var data = doc.Editor;
- var loc = data.OffsetToLocation (offset);
-
- var unit = parsedDocument.GetAst<SyntaxTree> ();
- var parsedFile = parsedDocument.ParsedFile as CSharpUnresolvedFile;
-
- if (unit == null || parsedFile == null) {
+ var model = parsedDocument.GetAst<SemanticModel> ();
+ if (model == null)
return null;
+ foreach (var symbol in model.LookupSymbols (offset)) {
+ var firstDeclaration = symbol.DeclaringSyntaxReferences.FirstOrDefault ();
+ if (firstDeclaration != null) {
+ expressionRegion = new DocumentRegion (
+ document.Editor.OffsetToLocation (firstDeclaration.Span.Start),
+ document.Editor.OffsetToLocation (firstDeclaration.Span.End));
+ }
+ return symbol;
}
- var node = unit.GetNodeAt (loc);
- if (node == null) {
- return null;
- }
-
- var resolver = new CSharpAstResolver (doc.Compilation, unit, parsedFile);
- resolver.ApplyNavigator (new NodeListResolveVisitorNavigator (node), CancellationToken.None);
- var state = resolver.GetResolverStateBefore (node, CancellationToken.None);
-
- var list = new List<IType> ();
- int indexOf = expression.IndexOf ('`');
- if (indexOf != -1) {
- var intType = new PrimitiveType ("int").ToTypeReference ().Resolve (doc.Compilation);
- var num = expression.Substring (indexOf + 1);
- int number = int.Parse (num);
- for (int i = 0; i < number; i++)
- list.Add (intType);
- expression = expression.Remove (indexOf);
- }
- return state.LookupSimpleNameOrTypeName (expression, list, NameLookupMode.Expression);
- }
-
-
- static string paramStr = GettextCatalog.GetString ("Parameter");
- static string localStr = GettextCatalog.GetString ("Local variable");
- static string methodStr = GettextCatalog.GetString ("Method");
-
- static string namespaceStr = GettextCatalog.GetString ("Namespace");
- static string GetString (IType type)
- {
- switch (type.Kind) {
- case TypeKind.Class:
- return GettextCatalog.GetString ("Class");
- case TypeKind.Interface:
- return GettextCatalog.GetString ("Interface");
- case TypeKind.Struct:
- return GettextCatalog.GetString ("Struct");
- case TypeKind.Delegate:
- return GettextCatalog.GetString ("Delegate");
- case TypeKind.Enum:
- return GettextCatalog.GetString ("Enum");
-
- case TypeKind.Dynamic:
- return GettextCatalog.GetString ("Dynamic");
- case TypeKind.TypeParameter:
- return GettextCatalog.GetString ("Type parameter");
-
- case TypeKind.Array:
- return GettextCatalog.GetString ("Array");
- case TypeKind.Pointer:
- return GettextCatalog.GetString ("Pointer");
- }
-
return null;
}
-
- static string GetString (IMember member)
- {
- switch (member.SymbolKind) {
- case SymbolKind.Field:
- var field = member as IField;
- if (field.IsConst)
- return GettextCatalog.GetString ("Constant");
- return GettextCatalog.GetString ("Field");
- case SymbolKind.Property:
- return GettextCatalog.GetString ("Property");
- case SymbolKind.Indexer:
- return GettextCatalog.GetString ("Indexer");
-
- case SymbolKind.Event:
- return GettextCatalog.GetString ("Event");
- }
- return GettextCatalog.GetString ("Member");
- }
-
- string GetConst (object obj)
- {
- if (obj is string)
- return '"' + obj.ToString () + '"';
- if (obj is char)
- return "'" + obj + "'";
- return obj.ToString ();
- }
- static CSharpAmbience ambience = new CSharpAmbience ();
- static TypeSystemAstBuilder CreateBuilder (MonoDevelop.Ide.Gui.Document doc, int offset, ICompilation compilation)
+ public ISymbol GetLanguageItem (MonoDevelop.Ide.Gui.Document document, int offset, string identifier)
{
- var ctx = doc.ParsedDocument.ParsedFile as CSharpUnresolvedFile;
- var state = ctx.GetResolver (doc.Compilation, doc.Editor.OffsetToLocation (offset));
- var builder = new TypeSystemAstBuilder (state);
- builder.AddTypeReferenceAnnotations = true;
- var dt = state.CurrentTypeDefinition;
- var declaring = dt != null ? dt.DeclaringTypeDefinition : null;
- if (declaring != null) {
- while (dt != null) {
- if (dt.Equals (declaring)) {
- builder.AlwaysUseShortTypeNames = true;
- break;
- }
- dt = dt.DeclaringTypeDefinition;
- }
- }
- return builder;
- }
+ if (document.ParsedDocument == null)
+ return null;
+ var model = document.ParsedDocument.GetAst<SemanticModel> ();
+ if (model == null)
+ return null;
- internal static MonoDevelop.CSharp.Completion.MemberCompletionData.MyAmbience CreateAmbience (Document doc, int offset, ICompilation compilation)
- {
- return new MonoDevelop.CSharp.Completion.MemberCompletionData.MyAmbience (CreateBuilder (doc, offset, compilation));
- }
+ int index = identifier.IndexOf ("`", System.StringComparison.Ordinal);
+ int arity = 0;
+ if (index != -1) {
+ arity = int.Parse (identifier.Substring (index + 1));
+ identifier = identifier.Remove (index);
+ }
- public string CreateTooltip (MonoDevelop.Ide.Gui.Document doc, int offset, ResolveResult result, string errorInformations, Gdk.ModifierType modifierState)
- {
- try {
- OutputSettings settings = new OutputSettings (OutputFlags.ClassBrowserEntries | OutputFlags.IncludeParameterName | OutputFlags.IncludeKeywords | OutputFlags.IncludeMarkup | OutputFlags.UseFullName);
- // Approximate value for usual case
- StringBuilder s = new StringBuilder (150);
- string documentation = null;
- if (result != null) {
- if (result is UnknownIdentifierResolveResult) {
- s.Append (String.Format (GettextCatalog.GetString ("Unresolved identifier '{0}'"), ((UnknownIdentifierResolveResult)result).Identifier));
- } else if (result.IsError) {
- s.Append (GettextCatalog.GetString ("Resolve error."));
- } else if (result is LocalResolveResult) {
- var lr = (LocalResolveResult)result;
- s.Append ("<small><i>");
- s.Append (lr.IsParameter ? paramStr : localStr);
- s.Append ("</i></small>\n");
- s.Append (ambience.GetString (lr.Variable.Type, settings));
- s.Append (" ");
- s.Append (lr.Variable.Name);
- } else if (result is MethodGroupResolveResult) {
- var mrr = (MethodGroupResolveResult)result;
- s.Append ("<small><i>");
- s.Append (methodStr);
- s.Append ("</i></small>\n");
- var allMethods = new List<IMethod> (mrr.Methods);
- foreach (var l in mrr.GetExtensionMethods ()) {
- allMethods.AddRange (l);
- }
- var method = allMethods.FirstOrDefault ();
- if (method != null) {
- s.Append (GLib.Markup.EscapeText (CreateAmbience (doc, offset, method.Compilation).ConvertEntity (method)));
- if (allMethods.Count > 1) {
- int overloadCount = allMethods.Count - 1;
- s.Append (string.Format (GettextCatalog.GetPluralString (" (+{0} overload)", " (+{0} overloads)", overloadCount), overloadCount));
- }
- documentation = AmbienceService.GetSummaryMarkup (method);
- }
- } else if (result is MemberResolveResult) {
- var member = ((MemberResolveResult)result).Member;
- s.Append ("<small><i>");
- s.Append (GetString (member));
- s.Append ("</i></small>\n");
- var field = member as IField;
- if (field != null && field.IsConst) {
- s.Append (GLib.Markup.EscapeText (CreateAmbience (doc, offset, field.Compilation).ConvertType (field.Type)));
- s.Append (" ");
- s.Append (field.Name);
- s.Append (" = ");
- s.Append (GetConst (field.ConstantValue));
- s.Append (";");
- } else {
- s.Append (GLib.Markup.EscapeText (CreateAmbience (doc, offset, member.Compilation).ConvertEntity (member)));
- }
- documentation = AmbienceService.GetSummaryMarkup (member);
- } else if (result is NamespaceResolveResult) {
- s.Append ("<small><i>");
- s.Append (namespaceStr);
- s.Append ("</i></small>\n");
- s.Append (ambience.GetString (((NamespaceResolveResult)result).NamespaceName, settings));
- } else {
- var tr = result;
- var typeString = GetString (tr.Type);
- if (!string.IsNullOrEmpty (typeString)) {
- s.Append ("<small><i>");
- s.Append (typeString);
- s.Append ("</i></small>\n");
- }
- settings.OutputFlags |= OutputFlags.UseFullName;
- s.Append (ambience.GetString (tr.Type, settings));
- documentation = AmbienceService.GetSummaryMarkup (tr.Type.GetDefinition ());
- }
-
- if (!string.IsNullOrEmpty (documentation)) {
- s.Append ("\n<small>");
- s.Append (documentation);
- s.Append ("</small>");
- }
+ foreach (var symbol in model.LookupSymbols (offset, name: identifier)) {
+ var typeSymbol = symbol as INamedTypeSymbol;
+ if (typeSymbol != null && (arity == 0 || arity == typeSymbol.Arity)) {
+ return symbol;
}
-
- if (!string.IsNullOrEmpty (errorInformations)) {
- if (s.Length != 0)
- s.Append ("\n\n");
- s.Append ("<small>");
- s.Append (errorInformations);
- s.Append ("</small>");
+ var namespaceSymbol = symbol as INamespaceSymbol;
+ if (namespaceSymbol != null) {
+ return namespaceSymbol;
}
- return s.ToString ();
- } catch (Exception e){
- return e.ToString ();
}
+ return null;
}
-
+
#endregion
}
}
-
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Tooltips/LanguageItemTooltipProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Tooltips/LanguageItemTooltipProvider.cs
index 619cb802d0..3a8919db6e 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Tooltips/LanguageItemTooltipProvider.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Tooltips/LanguageItemTooltipProvider.cs
@@ -25,94 +25,58 @@
//
//
using System;
-using Mono.TextEditor;
using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.Semantics;
using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.CSharp;
using MonoDevelop.CSharp;
-using ICSharpCode.NRefactory.TypeSystem;
-using Gtk;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
-using System.Threading;
-using System.Text;
using MonoDevelop.Core;
-using System.Collections.Generic;
-using System.Linq;
-using MonoDevelop.CSharp.Resolver;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.CSharp.Completion;
using MonoDevelop.Components;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
using MonoDevelop.Projects;
using Mono.Cecil.Cil;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
+using Gtk;
+using System.Threading;
+using System.Threading.Tasks;
namespace MonoDevelop.SourceEditor
{
class LanguageItemTooltipProvider: TooltipProvider, IDisposable
{
- public LanguageItemTooltipProvider ()
- {
- }
-
- class ToolTipData
- {
- public SyntaxTree Unit;
- public ResolveResult Result;
- public AstNode Node;
- public CSharpAstResolver Resolver;
-
- public ToolTipData (ICSharpCode.NRefactory.CSharp.SyntaxTree unit, ICSharpCode.NRefactory.Semantics.ResolveResult result, ICSharpCode.NRefactory.CSharp.AstNode node, CSharpAstResolver file)
- {
- this.Unit = unit;
- this.Result = result;
- this.Node = node;
- this.Resolver = file;
- }
- }
-
#region ITooltipProvider implementation
-
- public override TooltipItem GetItem (Mono.TextEditor.TextEditor editor, int offset)
+ public override async Task<TooltipItem> GetItem (TextEditor editor, DocumentContext ctx, int offset, CancellationToken token = default(CancellationToken))
{
- var doc = IdeApp.Workbench.ActiveDocument;
- if (doc == null || doc.ParsedDocument == null)
+ if (ctx == null)
return null;
- var unit = doc.ParsedDocument.GetAst<SyntaxTree> ();
- if (unit == null)
+ var analysisDocument = ctx.ParsedDocument;
+ if (analysisDocument == null)
return null;
-
- var file = doc.ParsedDocument.ParsedFile as CSharpUnresolvedFile;
- if (file == null)
+ var unit = analysisDocument.GetAst<SemanticModel> ();
+ if (unit == null)
return null;
- ResolveResult result;
- AstNode node;
- var loc = editor.OffsetToLocation (offset);
- if (!doc.TryResolveAt (loc, out result, out node)) {
- if (node is CSharpTokenNode) {
- int startOffset2 = editor.LocationToOffset (node.StartLocation);
- int endOffset2 = editor.LocationToOffset (node.EndLocation);
-
- return new TooltipItem (new ToolTipData (unit, result, node, null), startOffset2, endOffset2 - startOffset2);
- }
+ var root = unit.SyntaxTree.GetRoot (token);
+ SyntaxToken syntaxToken;
+ try {
+ syntaxToken = root.FindToken (offset);
+ } catch (ArgumentOutOfRangeException) {
return null;
}
- if (node == lastNode)
- return lastResult;
- var resolver = new CSharpAstResolver (doc.Compilation, unit, file);
- resolver.ApplyNavigator (new NodeListResolveVisitorNavigator (node), CancellationToken.None);
-
- var hoverNode = node.GetNodeAt (loc) ?? node;
-
- int startOffset = editor.LocationToOffset (hoverNode.StartLocation);
- int endOffset = editor.LocationToOffset (hoverNode.EndLocation);
- return lastResult = new TooltipItem (new ToolTipData (unit, result, node, resolver), startOffset, endOffset - startOffset);
+ if (!syntaxToken.Span.IntersectsWith (offset))
+ return null;
+ var symbolInfo = unit.GetSymbolInfo (syntaxToken.Parent, token);
+ var symbol = symbolInfo.Symbol ?? unit.GetDeclaredSymbol (syntaxToken.Parent, token);
+ var tooltipInformation = await CreateTooltip (symbol, syntaxToken, editor, ctx, offset);
+ if (tooltipInformation == null || string.IsNullOrEmpty (tooltipInformation.SignatureMarkup))
+ return null;
+ return new TooltipItem (tooltipInformation, syntaxToken.Span.Start, syntaxToken.Span.Length);
}
- AstNode lastNode = null;
static TooltipInformationWindow lastWindow = null;
- TooltipItem lastResult;
static void DestroyLastTooltipWindow ()
{
@@ -124,287 +88,57 @@ namespace MonoDevelop.SourceEditor
#region IDisposable implementation
- public void Dispose ()
+ public override void Dispose ()
{
+ if (IsDisposed)
+ return;
DestroyLastTooltipWindow ();
- lastNode = null;
- lastResult = null;
+ base.Dispose ();
}
#endregion
- protected override Gtk.Window CreateTooltipWindow (Mono.TextEditor.TextEditor editor, int offset, Gdk.ModifierType modifierState, TooltipItem item)
+
+ public override Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Xwt.ModifierKeys modifierState)
{
- var doc = IdeApp.Workbench.ActiveDocument;
+ var doc = ctx;
if (doc == null)
return null;
- var titem = (ToolTipData)item.Item;
-
- var tooltipInformation = CreateTooltip (titem, offset, null, modifierState);
- if (tooltipInformation == null || string.IsNullOrEmpty (tooltipInformation.SignatureMarkup))
- return null;
-
var result = new TooltipInformationWindow ();
result.ShowArrow = true;
- result.AddOverload (tooltipInformation);
+ result.AddOverload ((TooltipInformation)item.Item);
result.RepositionWindow ();
return result;
}
- public override Gtk.Window ShowTooltipWindow (TextEditor editor, int offset, Gdk.ModifierType modifierState, int mouseX, int mouseY, TooltipItem item)
+ async Task<TooltipInformation> CreateTooltip (ISymbol symbol, SyntaxToken token, TextEditor editor, DocumentContext doc, int offset)
{
- var titem = (ToolTipData)item.Item;
- if (lastNode != null && lastWindow != null && lastWindow.IsRealized && titem.Node != null && lastNode == titem.Node)
- return lastWindow;
-
- DestroyLastTooltipWindow ();
-
- var tipWindow = CreateTooltipWindow (editor, offset, modifierState, item) as TooltipInformationWindow;
- if (tipWindow == null)
- return null;
-
- var hoverNode = titem.Node.GetNodeAt (editor.OffsetToLocation (offset)) ?? titem.Node;
- var p1 = editor.LocationToPoint (hoverNode.StartLocation);
- var p2 = editor.LocationToPoint (hoverNode.EndLocation);
- var positionWidget = editor.TextArea;
- var caret = new Gdk.Rectangle ((int)p1.X - positionWidget.Allocation.X, (int)p2.Y - positionWidget.Allocation.Y, (int)(p2.X - p1.X), (int)editor.LineHeight);
-
- tipWindow.ShowPopup (positionWidget, caret, PopupPosition.Top);
- tipWindow.EnterNotifyEvent += delegate {
- editor.HideTooltip (false);
- };
- lastWindow = tipWindow;
- lastNode = titem.Node;
- return tipWindow;
- }
-
- TooltipInformation CreateTooltip (ToolTipData data, int offset, Ambience ambience, Gdk.ModifierType modifierState)
- {
- ResolveResult result = data.Result;
- var doc = IdeApp.Workbench.ActiveDocument;
- if (doc == null)
- return null;
- bool createFooter = (modifierState & Gdk.ModifierType.Mod1Mask) != 0;
- var file = doc.ParsedDocument.ParsedFile as CSharpUnresolvedFile;
- if (file == null)
- return null;
try {
-
- if (result is AliasNamespaceResolveResult) {
- var resolver = file.GetResolver (doc.Compilation, doc.Editor.Caret.Location);
- var sig = new SignatureMarkupCreator (resolver, doc.GetFormattingPolicy ().CreateOptions ());
- sig.BreakLineAfterReturnType = false;
- return sig.GetAliasedNamespaceTooltip ((AliasNamespaceResolveResult)result);
- }
-
- if (result is AliasTypeResolveResult) {
- var resolver = file.GetResolver (doc.Compilation, doc.Editor.Caret.Location);
- var sig = new SignatureMarkupCreator (resolver, doc.GetFormattingPolicy ().CreateOptions ());
- sig.BreakLineAfterReturnType = false;
- return sig.GetAliasedTypeTooltip ((AliasTypeResolveResult)result);
- }
+ TooltipInformation result;
+ var sig = new SignatureMarkupCreator (doc, offset);
+ sig.BreakLineAfterReturnType = false;
- if (data.Node is ThisReferenceExpression && result is ThisResolveResult) {
- var resolver = file.GetResolver (doc.Compilation, doc.Editor.Caret.Location);
- var sig = new SignatureMarkupCreator (resolver, doc.GetFormattingPolicy ().CreateOptions ());
- sig.BreakLineAfterReturnType = false;
-
- return sig.GetKeywordTooltip ("this", data.Node);
- }
-
- if (data.Node is TypeOfExpression) {
- var resolver = file.GetResolver (doc.Compilation, doc.Editor.Caret.Location);
- var sig = new SignatureMarkupCreator (resolver, doc.GetFormattingPolicy ().CreateOptions ());
- sig.BreakLineAfterReturnType = false;
- return sig.GetTypeOfTooltip ((TypeOfExpression)data.Node, result as TypeOfResolveResult);
- }
- if (data.Node is PrimitiveType && data.Node.Parent is Constraint) {
- var t = (PrimitiveType)data.Node;
- if (t.Keyword == "class" || t.Keyword == "new" || t.Keyword == "struct") {
- var resolver = file.GetResolver (doc.Compilation, doc.Editor.Caret.Location);
- var sig = new SignatureMarkupCreator (resolver, doc.GetFormattingPolicy ().CreateOptions ());
- sig.BreakLineAfterReturnType = false;
- return sig.GetConstraintTooltip (t.Keyword);
- }
- return null;
- }
- if (data.Node is ExternAliasDeclaration) {
- var resolver = file.GetResolver (doc.Compilation, doc.Editor.Caret.Location);
- var sig = new SignatureMarkupCreator (resolver, doc.GetFormattingPolicy ().CreateOptions ());
- sig.BreakLineAfterReturnType = false;
- return sig.GetExternAliasTooltip ((ExternAliasDeclaration)data.Node, doc.Project as DotNetProject);
- }
- if (result == null && data.Node is CSharpTokenNode) {
- var resolver = file.GetResolver (doc.Compilation, doc.Editor.Caret.Location);
- var sig = new SignatureMarkupCreator (resolver, doc.GetFormattingPolicy ().CreateOptions ());
- sig.BreakLineAfterReturnType = false;
- return sig.GetKeywordTooltip (data.Node);
- }
- if (data.Node is PrimitiveType && ((PrimitiveType)data.Node).KnownTypeCode == KnownTypeCode.Void) {
- var resolver = file.GetResolver (doc.Compilation, doc.Editor.Caret.Location);
- var sig = new SignatureMarkupCreator (resolver, doc.GetFormattingPolicy ().CreateOptions ());
- sig.BreakLineAfterReturnType = false;
- return sig.GetKeywordTooltip ("void", null);
- }
- if (data.Node is NullReferenceExpression) {
- var resolver = file.GetResolver (doc.Compilation, doc.Editor.Caret.Location);
- var sig = new SignatureMarkupCreator (resolver, doc.GetFormattingPolicy ().CreateOptions ());
- sig.BreakLineAfterReturnType = false;
- return sig.GetKeywordTooltip ("null", null);
- }
+ var typeOfExpression = token.Parent as TypeOfExpressionSyntax;
+ if (typeOfExpression != null && symbol is ITypeSymbol)
+ return sig.GetTypeOfTooltip (typeOfExpression, (ITypeSymbol)symbol);
- if (result is UnknownIdentifierResolveResult) {
- return new TooltipInformation () {
- SignatureMarkup = string.Format ("error CS0103: The name `{0}' does not exist in the current context", ((UnknownIdentifierResolveResult)result).Identifier)
- };
- } else if (result is UnknownMemberResolveResult) {
- var ur = (UnknownMemberResolveResult)result;
- if (ur.TargetType.Kind != TypeKind.Unknown) {
- return new TooltipInformation () {
- SignatureMarkup = string.Format ("error CS0117: `{0}' does not contain a definition for `{1}'", ur.TargetType.FullName, ur.MemberName)
- };
- }
- } else if (result.IsError) {
- return new TooltipInformation () {
- SignatureMarkup = "Unknown resolve error."
- };
- }
- if (result is LocalResolveResult) {
- var lr = (LocalResolveResult)result;
- var tooltipInfo = new TooltipInformation ();
- var resolver = file.GetResolver (doc.Compilation, doc.Editor.Caret.Location);
- var sig = new SignatureMarkupCreator (resolver, doc.GetFormattingPolicy ().CreateOptions ());
- sig.BreakLineAfterReturnType = false;
- tooltipInfo.SignatureMarkup = sig.GetLocalVariableMarkup (lr.Variable);
- return tooltipInfo;
- } else if (result is MethodGroupResolveResult) {
- var mrr = (MethodGroupResolveResult)result;
- var allMethods = new List<IMethod> (mrr.Methods);
- foreach (var l in mrr.GetExtensionMethods ()) {
- allMethods.AddRange (l);
- }
+ result = sig.GetKeywordTooltip (token);
+ if (result != null)
+ return result;
- var method = allMethods.FirstOrDefault ();
- if (method != null) {
- return MemberCompletionData.CreateTooltipInformation (
- doc.Compilation,
- file,
- doc.Editor,
- doc.GetFormattingPolicy (),
- method,
- false,
- createFooter);
- }
- } else if (result is CSharpInvocationResolveResult) {
- var invocationResult = (CSharpInvocationResolveResult)result;
- var member = (IMember)invocationResult.ReducedMethod ?? invocationResult.Member;
- return MemberCompletionData.CreateTooltipInformation (
- doc.Compilation,
- file,
- doc.Editor,
- doc.GetFormattingPolicy (),
- member,
- false,
- createFooter);
- } else if (result is MemberResolveResult) {
- var member = ((MemberResolveResult)result).Member;
- return MemberCompletionData.CreateTooltipInformation (
- doc.Compilation,
- file,
- doc.Editor,
- doc.GetFormattingPolicy (),
- member,
- false,
- createFooter);
- } else if (result is NamespaceResolveResult) {
- var tooltipInfo = new TooltipInformation ();
- var resolver = file.GetResolver (doc.Compilation, doc.Editor.Caret.Location);
- var sig = new SignatureMarkupCreator (resolver, doc.GetFormattingPolicy ().CreateOptions ());
- sig.BreakLineAfterReturnType = false;
- try {
- tooltipInfo.SignatureMarkup = sig.GetMarkup (((NamespaceResolveResult)result).Namespace);
- } catch (Exception e) {
- LoggingService.LogError ("Got exception while creating markup for :" + ((NamespaceResolveResult)result).Namespace, e);
- return new TooltipInformation ();
- }
- return tooltipInfo;
- } else if (result is OperatorResolveResult) {
- var or = result as OperatorResolveResult;
- var tooltipInfo = new TooltipInformation ();
- var resolver = file.GetResolver (doc.Compilation, doc.Editor.Caret.Location);
- var sig = new SignatureMarkupCreator (resolver, doc.GetFormattingPolicy ().CreateOptions ());
- sig.BreakLineAfterReturnType = false;
- try {
- var method = or.UserDefinedOperatorMethod;
- if (method == null)
- return null;
- tooltipInfo.SignatureMarkup = sig.GetMarkup (method);
- } catch (Exception e) {
- LoggingService.LogError ("Got exception while creating markup for :" + result, e);
- return new TooltipInformation ();
- }
- return tooltipInfo;
- } else {
- return MemberCompletionData.CreateTooltipInformation (
- doc.Compilation,
- file,
- doc.Editor,
- doc.GetFormattingPolicy (),
- result.Type,
- false,
- createFooter);
+ if (symbol != null) {
+ result = await RoslynSymbolCompletionData.CreateTooltipInformation (CancellationToken.None, editor, doc, symbol, false, true);
}
+
+ return result;
} catch (Exception e) {
LoggingService.LogError ("Error while creating tooltip.", e);
return null;
}
-
- return null;
}
- class ErrorVisitor : DepthFirstAstVisitor
- {
- readonly CSharpAstResolver resolver;
- readonly CancellationToken cancellationToken;
- ResolveResult errorResolveResult;
- public ResolveResult ErrorResolveResult {
- get {
- return errorResolveResult;
- }
- }
-
- AstNode errorNode;
-
- public AstNode ErrorNode {
- get {
- return errorNode;
- }
- }
-
- public ErrorVisitor (CSharpAstResolver resolver, CancellationToken cancellationToken = default(CancellationToken))
- {
- this.resolver = resolver;
- this.cancellationToken = cancellationToken;
- }
-
- protected override void VisitChildren (AstNode node)
- {
- if (ErrorResolveResult != null || cancellationToken.IsCancellationRequested)
- return;
- if (node is Expression) {
- var rr = resolver.Resolve (node, cancellationToken);
- if (rr.IsError) {
- errorResolveResult = rr;
- errorNode = node;
- }
- }
- base.VisitChildren (node);
- }
- }
-
-
- protected override void GetRequiredPosition (Mono.TextEditor.TextEditor editor, Gtk.Window tipWindow, out int requiredWidth, out double xalign)
+ public override void GetRequiredPosition (TextEditor editor, Control tipWindow, out int requiredWidth, out double xalign)
{
var win = (TooltipInformationWindow)tipWindow;
requiredWidth = win.Allocation.Width;
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.UnitTests/CSharpNUnitSourceCodeLocationFinder.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.UnitTests/CSharpNUnitSourceCodeLocationFinder.cs
new file mode 100644
index 0000000000..3b7e88390d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.UnitTests/CSharpNUnitSourceCodeLocationFinder.cs
@@ -0,0 +1,76 @@
+//
+// CSharpNUnitSourceCodeLocationFinder.cs
+//
+// Author:
+// mkrueger <>
+//
+// Copyright (c) 2016 mkrueger
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.UnitTesting;
+using MonoDevelop.Ide.TypeSystem;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using System.Linq;
+using MonoDevelop.Projects;
+
+namespace MonoDevelop.CSharp.UnitTests
+{
+ class CSharpNUnitSourceCodeLocationFinder : NUnitSourceCodeLocationFinder
+ {
+ public override async System.Threading.Tasks.Task<SourceCodeLocation> GetSourceCodeLocationAsync (MonoDevelop.Projects.Project project, string fixtureTypeNamespace, string fixtureTypeName, string testName, System.Threading.CancellationToken cancellationToken)
+ {
+ var ctx = await TypeSystemService.GetCompilationAsync (project, cancellationToken).ConfigureAwait (false);
+ var cls = ctx?.Assembly?.GetTypeByMetadataName (string.IsNullOrEmpty (fixtureTypeNamespace) ? fixtureTypeName : fixtureTypeNamespace + "." + fixtureTypeName);
+ if (cls == null)
+ return null;
+ if (cls.Name != testName) {
+ foreach (var met in cls.GetMembers ().OfType<IMethodSymbol> ()) {
+ if (met.Name == testName) {
+ var loc = met.Locations.FirstOrDefault (l => l.IsInSource);
+ return ConvertToSourceCodeLocation (loc);
+ }
+ }
+
+ int idx = testName != null ? testName.IndexOf ('(') : -1;
+ if (idx > 0) {
+ testName = testName.Substring (0, idx);
+ foreach (var met in cls.GetMembers ().OfType<IMethodSymbol> ()) {
+ if (met.Name == testName){
+ var loc = met.Locations.FirstOrDefault (l => l.IsInSource);
+ return ConvertToSourceCodeLocation (loc);
+ }
+ }
+ }
+ }
+ var classLoc = cls.Locations.FirstOrDefault (l => l.IsInSource);
+ return ConvertToSourceCodeLocation (classLoc);
+ }
+
+
+ SourceCodeLocation ConvertToSourceCodeLocation (Location loc)
+ {
+ var lineSpan = loc.GetLineSpan ();
+ return new SourceCodeLocation (loc.SourceTree.FilePath, lineSpan.StartLinePosition.Line, lineSpan.StartLinePosition.Character);
+ }
+
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.UnitTests/UnitTestTextEditorExtension.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.UnitTests/UnitTestTextEditorExtension.cs
index 759d23c430..ff091978dd 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.UnitTests/UnitTestTextEditorExtension.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.UnitTests/UnitTestTextEditorExtension.cs
@@ -24,74 +24,85 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using ICSharpCode.NRefactory.CSharp;
+using System.Linq;
using MonoDevelop.Refactoring;
-using ICSharpCode.NRefactory.CSharp.Resolver;
using System.Collections.Generic;
-using MonoDevelop.NUnit;
+using MonoDevelop.UnitTesting;
using MonoDevelop.Core;
-using ICSharpCode.NRefactory.Semantics;
-using ICSharpCode.NRefactory.TypeSystem;
using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using ICSharpCode.NRefactory6.CSharp;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.TypeSystem;
+using ICSharpCode.NRefactory.CSharp.Refactoring;
namespace MonoDevelop.CSharp
{
class UnitTestTextEditorExtension : AbstractUnitTestTextEditorExtension
{
- public override IList<UnitTestLocation> GatherUnitTests ()
+ static readonly IList<UnitTestLocation> emptyList = new UnitTestLocation[0];
+ public override Task<IList<UnitTestLocation>> GatherUnitTests (IUnitTestMarkers[] unitTestMarkers, CancellationToken token)
{
- var resolver = document.GetSharedResolver ();
- if (resolver == null || resolver.Result == null)
- return null;
- var parsedDocument = document.ParsedDocument;
+ var parsedDocument = DocumentContext.ParsedDocument;
if (parsedDocument == null)
- return null;
- var syntaxTree = parsedDocument.GetAst<SyntaxTree> ();
- if (syntaxTree == null)
- return null;
+ return Task.FromResult (emptyList);
+
+ var semanticModel = parsedDocument.GetAst<SemanticModel> ();
+ if (semanticModel == null)
+ return Task.FromResult (emptyList);
- var visitor = new NUnitVisitor (resolver.Result);
+ var visitor = new NUnitVisitor (semanticModel, unitTestMarkers, token);
try {
- visitor.VisitSyntaxTree (syntaxTree);
- } catch (Exception ex) {
+ visitor.Visit (semanticModel.SyntaxTree.GetRoot (token));
+ } catch (OperationCanceledException) {
+ throw;
+ }catch (Exception ex) {
LoggingService.LogError ("Exception while analyzing ast for unit tests.", ex);
- return null;
+ return Task.FromResult (emptyList);
}
- return visitor.FoundTests;
+ return Task.FromResult (visitor.FoundTests);
}
- class NUnitVisitor : DepthFirstAstVisitor
+ class NUnitVisitor : CSharpSyntaxWalker
{
- readonly CSharpAstResolver resolver;
+ readonly SemanticModel semanticModel;
+ readonly CancellationToken token;
+ readonly IUnitTestMarkers [] unitTestMarkers;
List<UnitTestLocation> foundTests = new List<UnitTestLocation> ();
-
+ HashSet<ClassDeclarationSyntax> unitTestClasses = new HashSet<ClassDeclarationSyntax> ();
public IList<UnitTestLocation> FoundTests {
get {
return foundTests;
}
}
- public NUnitVisitor (CSharpAstResolver resolver)
+ public NUnitVisitor (SemanticModel semanticModel, IUnitTestMarkers[] unitTestMarkers, CancellationToken token)
{
- this.resolver = resolver;
+ this.semanticModel = semanticModel;
+ this.token = token;
+ this.unitTestMarkers = unitTestMarkers;
}
- static string GetFullName (TypeDeclaration typeDeclaration)
+ static string GetFullName (ClassDeclarationSyntax typeDeclaration)
{
var parts = new List<string> ();
while (true) {
- parts.Add (typeDeclaration.Name);
- if (typeDeclaration.Parent is TypeDeclaration) {
- typeDeclaration = (TypeDeclaration)typeDeclaration.Parent;
+ parts.Add (typeDeclaration.Identifier.ToString ());
+ if (typeDeclaration.Parent is ClassDeclarationSyntax) {
+ typeDeclaration = (ClassDeclarationSyntax)typeDeclaration.Parent;
}
else {
break;
}
}
;
- var ns = typeDeclaration.Parent as NamespaceDeclaration;
+ var ns = typeDeclaration.Parent as NamespaceDeclarationSyntax;
if (ns != null)
- parts.Add (ns.FullName);
+ parts.Add (ns.Name.ToString ());
parts.Reverse ();
return string.Join (".", parts);
}
@@ -109,77 +120,77 @@ namespace MonoDevelop.CSharp
sb.Append ('\"');
}
- static string BuildArguments (IAttribute attr)
+ static string BuildArguments (AttributeData attr)
{
var sb = new StringBuilder ();
- foreach (var arg in attr.PositionalArguments) {
+ foreach (var arg in attr.ConstructorArguments) {
if (sb.Length > 0)
sb.Append (", ");
- var cr = arg as ConversionResolveResult;
- if (cr != null) {
- AppendConstant (sb, cr.Input.ConstantValue);
- continue;
- }
- AppendConstant (sb, arg.ConstantValue);
+// var cr = arg as ConversionResolveResult;
+// if (cr != arg.Value) {
+// AppendConstant (sb, cr.Input.ConstantValue);
+// continue;
+// }
+ AppendConstant (sb, arg.Value);
}
return sb.ToString ();
}
- public override void VisitMethodDeclaration (MethodDeclaration methodDeclaration)
+ public override void VisitMethodDeclaration (MethodDeclarationSyntax node)
{
- var result = resolver.Resolve (methodDeclaration) as MemberResolveResult;
- if (result == null)
- return;
- var method = result.Member as IMethod;
+ var method = semanticModel.GetDeclaredSymbol (node);
if (method == null)
return;
-
+ var parentClass = node.Parent as ClassDeclarationSyntax;
+ if (parentClass == null)
+ return;
UnitTestLocation test = null;
- foreach (var attr in method.Attributes) {
- if (attr.AttributeType.ReflectionName == "NUnit.Framework.TestAttribute") {
+ IUnitTestMarkers markers = null;
+ foreach (var attr in method.GetAttributes ()) {
+ var cname = attr.AttributeClass.GetFullName ();
+ markers = unitTestMarkers.FirstOrDefault (m => m.TestMethodAttributeMarker == cname);
+ if (markers != null) {
if (test == null) {
- test = new UnitTestLocation (methodDeclaration.NameToken.StartLocation.Line);
- test.UnitTestIdentifier = GetFullName ((TypeDeclaration)methodDeclaration.Parent) + "." + methodDeclaration.Name;
+ TagClass (parentClass, markers);
+ test = new UnitTestLocation (node.Identifier.SpanStart);
+ test.UnitTestIdentifier = GetFullName (parentClass) + "." + method.Name;
foundTests.Add (test);
}
+ break;
}
}
if (test != null) {
- foreach (var attr in method.Attributes) {
- if (attr.AttributeType.ReflectionName == "NUnit.Framework.TestCaseAttribute") {
+ foreach (var attr in method.GetAttributes ()) {
+ if (attr.AttributeClass.GetFullName () == markers.TestCaseMethodAttributeMarker) {
test.TestCases.Add ("(" + BuildArguments (attr) + ")");
} else
- test.IsIgnored |= attr.AttributeType.ReflectionName == "NUnit.Framework.IgnoreAttribute";
+ test.IsIgnored |= attr.AttributeClass.GetFullName () == markers.IgnoreTestMethodAttributeMarker;
}
}
}
- public override void VisitTypeDeclaration (TypeDeclaration typeDeclaration)
+ void TagClass (ClassDeclarationSyntax c, IUnitTestMarkers markers)
{
- if (typeDeclaration.HasModifier (Modifiers.Abstract))
+ if (unitTestClasses.Contains (c))
return;
- var result = resolver.Resolve (typeDeclaration);
- if (result == null || result.Type.GetDefinition () == null)
- return;
- UnitTestLocation unitTest = null;
- bool isIgnored = false;
- foreach (var attr in result.Type.GetDefinition ().GetAttributes ()) {
- if (attr.AttributeType.ReflectionName == "NUnit.Framework.TestFixtureAttribute") {
- unitTest = new UnitTestLocation (typeDeclaration.NameToken.StartLocation.Line);
- unitTest.IsFixture = true;
- unitTest.UnitTestIdentifier = GetFullName (typeDeclaration);
- foundTests.Add (unitTest);
- } else
- isIgnored |= attr.AttributeType.ReflectionName == "NUnit.Framework.IgnoreAttribute";
- }
- if (unitTest != null) {
- unitTest.IsIgnored = isIgnored;
- base.VisitTypeDeclaration (typeDeclaration);
+ unitTestClasses.Add (c);
+
+ var type = semanticModel.GetDeclaredSymbol (c);
+ var test = new UnitTestLocation (c.Identifier.SpanStart);
+ test.IsFixture = true;
+ test.UnitTestIdentifier = GetFullName (c);
+ foundTests.Add (test);
+
+ if (test != null) {
+ foreach (var attr in type.GetAttributes ()) {
+ test.IsIgnored |= attr.AttributeClass.GetFullName () == markers.IgnoreTestClassAttributeMarker;
+ }
}
}
- public override void VisitBlockStatement (BlockStatement blockStatement)
+ public override void VisitBlock (BlockSyntax node)
{
+ token.ThrowIfCancellationRequested ();
}
}
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/AstAmbience.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/AstAmbience.cs
index b03f260a13..fe36dd3134 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/AstAmbience.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/AstAmbience.cs
@@ -24,82 +24,90 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using ICSharpCode.NRefactory.CSharp;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using MonoDevelop.Core;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Formatting;
namespace MonoDevelop.CSharp
{
class AstAmbience
{
- CSharpFormattingOptions options;
+// OptionSet options;
- public AstAmbience (ICSharpCode.NRefactory.CSharp.CSharpFormattingOptions options)
+ public AstAmbience (OptionSet options)
{
- this.options = options;
+// this.options = options;
}
- static bool IsObsolete (EntityDeclaration entity)
+ static bool IsObsolete (MemberDeclarationSyntax entity)
{
if (entity == null)
return false;
- foreach (var section in entity.Attributes) {
- foreach (var attr in section.Attributes) {
- var attrText = attr.Type.ToString ();
- if (attrText == "Obsolete" || attrText == "ObsoleteAttribute" || attrText == "System.Obsolete" || attrText == "System.ObsoleteAttribute" )
- return true;
- }
- }
+ // TODO!
+// foreach (var section in entity.Attributes) {
+// foreach (var attr in section.Attributes) {
+// var attrText = attr.Type.ToString ();
+// if (attrText == "Obsolete" || attrText == "ObsoleteAttribute" || attrText == "System.Obsolete" || attrText == "System.ObsoleteAttribute" )
+// return true;
+// }
+// }
return false;
}
- void AppendTypeParameter (StringBuilder sb, IEnumerable<TypeParameterDeclaration> parameters)
+ void AppendTypeParameter (StringBuilder sb, TypeParameterListSyntax parameters)
{
- if (!parameters.Any ())
+ if (parameters == null || parameters.Parameters.Count == 0)
return;
sb.Append ("&lt;");
bool first = true;
- foreach (var param in parameters) {
+ foreach (var param in parameters.Parameters) {
if (!first) {
sb.Append (", ");
} else {
first = false;
}
- AppendEscaped (sb, param.ToString (options));
+ AppendEscaped (sb, param.ToString ());
}
sb.Append ("&gt;");
}
- void AppendParameter (StringBuilder sb, IEnumerable<ParameterDeclaration> parameters)
+ void AppendParameter (StringBuilder sb, ParameterListSyntax parameters)
{
- if (options.SpaceBeforeMethodDeclarationParentheses)
- sb.Append (" ");
+ // Missing roslyn formatting option ?
+ // if (options.GetOption (CSharpFormattingOptions.Spacing ???))
+ // sb.Append (" ");
sb.Append ("(");
- var hasParameters = parameters.Any ();
- if (!hasParameters && options.SpaceBetweenEmptyMethodDeclarationParentheses) {
- sb.Append (" )");
- return;
- }
- if (hasParameters && options.SpaceWithinMethodDeclarationParentheses)
- sb.Append (" ");
-
+ var hasParameters = parameters != null && parameters.Parameters.Count > 0;
+
+ // Missing roslyn formatting option ?
+ //if (hasParameters && options.GetOption (SpaceWithinMethodDeclarationParentheses))
+ // sb.Append (" ");
+
bool first = true;
- foreach (var param in parameters) {
- if (!first) {
- if (options.SpaceBeforeMethodDeclarationParameterComma)
- sb.Append (" ");
- sb.Append (",");
- if (options.SpaceAfterMethodDeclarationParameterComma)
+ if (hasParameters) {
+ foreach (var param in parameters.Parameters) {
+ if (!first) {
+ //if (options.SpaceBeforeMethodDeclarationParameterComma)
+ // sb.Append (" ");
+ sb.Append (",");
+ //if (options.SpaceAfterMethodDeclarationParameterComma)
sb.Append (" ");
- } else {
- first = false;
+ } else {
+ first = false;
+ }
+ AppendEscaped (sb, param.ToString ());
}
- AppendEscaped (sb, param.ToString (options));
}
- if (hasParameters && options.SpaceWithinMethodDeclarationParentheses)
- sb.Append (" ");
+
+ // Missing roslyn formatting option ?
+ //if (hasParameters && options.SpaceWithinMethodDeclarationParentheses)
+ // sb.Append (" ");
sb.Append (")");
}
@@ -131,128 +139,133 @@ namespace MonoDevelop.CSharp
}
}
- public string GetEntityMarkup (AstNode e)
+ public string GetEntityMarkup (SyntaxNode e)
{
var sb = new StringBuilder ();
- if (e is TypeDeclaration) {
- var type = e as TypeDeclaration;
- sb.Append (type.Name);
- AppendTypeParameter (sb, type.TypeParameters);
- } else if (e is DelegateDeclaration) {
- var del = e as DelegateDeclaration;
- sb.Append (del.Name);
- AppendTypeParameter (sb, del.TypeParameters);
- AppendParameter (sb, del.Parameters);
- } else if (e is Accessor) {
- if (e.Role == PropertyDeclaration.GetterRole) {
+ if (e is NamespaceDeclarationSyntax) {
+ return ((NamespaceDeclarationSyntax)e).Name.ToString ();
+ }
+ if (e is TypeDeclarationSyntax) {
+ var type = e as TypeDeclarationSyntax;
+ sb.Append (type.Identifier);
+ AppendTypeParameter (sb, type.TypeParameterList);
+ } else if (e is DelegateDeclarationSyntax) {
+ var del = e as DelegateDeclarationSyntax;
+ sb.Append (del.Identifier);
+ AppendTypeParameter (sb, del.TypeParameterList);
+ AppendParameter (sb, del.ParameterList);
+ } else if (e is AccessorDeclarationSyntax) {
+ if (e.Kind () == SyntaxKind.GetAccessorDeclaration) {
sb.Append ("get");
- } else if (e.Role == PropertyDeclaration.SetterRole) {
+ } else if (e.Kind () == SyntaxKind.SetAccessorDeclaration) {
sb.Append ("set");
- } else if (e.Role == CustomEventDeclaration.AddAccessorRole) {
+ } else if (e.Kind () == SyntaxKind.AddAccessorDeclaration) {
sb.Append ("add");
- } else if (e.Role == CustomEventDeclaration.RemoveAccessorRole) {
+ } else if (e.Kind () == SyntaxKind.RemoveAccessorDeclaration) {
sb.Append ("remove");
}
- } else if (e is OperatorDeclaration) {
- var op = e as OperatorDeclaration;
+ } else if (e is OperatorDeclarationSyntax) {
+ var op = (OperatorDeclarationSyntax)e;
+ sb.Append ("operator ");
+ AppendEscaped (sb, op.OperatorToken.ToString ());
+ AppendParameter (sb, op.ParameterList);
+ } else if (e is ConversionOperatorDeclarationSyntax) {
+ var op = (ConversionOperatorDeclarationSyntax)e;
+ sb.Append (op.ImplicitOrExplicitKeyword.IsKind (SyntaxKind.ImplicitKeyword) ? "implicit " : "explicit ");
sb.Append ("operator ");
- if (!op.OperatorTypeToken.IsNull)
- AppendEscaped (sb, op.OperatorTypeToken.ToString ());
- AppendParameter (sb, op.Parameters);
- } else if (e is MethodDeclaration) {
- var method = e as MethodDeclaration;
- if (!method.PrivateImplementationType.IsNull)
- AppendEscaped (sb, method.PrivateImplementationType.ToString () + ".");
- sb.Append (method.Name);
- AppendTypeParameter (sb, method.TypeParameters);
- AppendParameter (sb, method.Parameters);
- if (method.Body.IsNull) {
+ AppendEscaped (sb, op.Type.ToString ());
+ AppendParameter (sb, op.ParameterList);
+ } else if (e is MethodDeclarationSyntax) {
+ var method = (MethodDeclarationSyntax)e;
+ if (method.ExplicitInterfaceSpecifier != null)
+ AppendEscaped (sb, method.ExplicitInterfaceSpecifier + ".");
+ sb.Append (method.Identifier);
+ AppendTypeParameter (sb, method.TypeParameterList);
+ AppendParameter (sb, method.ParameterList);
+ if (method.Body != null && !method.Body.IsMissing) {
string tag = null;
- if (method.HasModifier (Modifiers.Abstract))
+ if (method.Modifiers.Any (m => m.Kind () == SyntaxKind.AbstractKeyword))
tag = GettextCatalog.GetString ("(abstract)");
- if (method.HasModifier (Modifiers.Partial))
+ if (method.Modifiers.Any (m => m.Kind () == SyntaxKind.PartialKeyword))
tag = GettextCatalog.GetString ("(partial)");
if (tag != null)
sb.Append (" <small>" + tag + "</small>");
}
- } else if (e is ConstructorDeclaration) {
- var constructor = e as ConstructorDeclaration;
- sb.Append (constructor.Name);
- AppendParameter (sb, constructor.Parameters);
- } else if (e is DestructorDeclaration) {
- var destructror = e as DestructorDeclaration;
+ } else if (e is ConstructorDeclarationSyntax) {
+ var constructor = e as ConstructorDeclarationSyntax;
+ sb.Append (constructor.Identifier);
+ AppendParameter (sb, constructor.ParameterList);
+ } else if (e is DestructorDeclarationSyntax) {
+ var destructror = e as DestructorDeclarationSyntax;
sb.Append ("~");
- sb.Append (destructror.Name);
- if (options.SpaceBeforeMethodDeclarationParentheses)
- sb.Append (" ");
+ sb.Append (destructror.Identifier);
+ // if (options.SpaceBeforeMethodDeclarationParentheses)
+ // sb.Append (" ");
sb.Append ("()");
- } else if (e is IndexerDeclaration) {
- var indexer = e as IndexerDeclaration;
+ } else if (e is IndexerDeclarationSyntax) {
+ var indexer = e as IndexerDeclarationSyntax;
sb.Append ("this");
- if (options.SpaceBeforeIndexerDeclarationBracket)
- sb.Append (" ");
+ //if (options.SpaceBeforeIndexerDeclarationBracket)
+ // sb.Append (" ");
sb.Append ("[");
- if (options.SpaceWithinIndexerDeclarationBracket)
- sb.Append (" ");
+ //if (options.SpaceWithinIndexerDeclarationBracket)
+ // sb.Append (" ");
bool first = true;
- foreach (var param in indexer.Parameters) {
+ foreach (var param in indexer.ParameterList.Parameters) {
if (!first) {
- if (options.SpaceBeforeIndexerDeclarationParameterComma)
- sb.Append (" ");
+ //if (options.SpaceBeforeIndexerDeclarationParameterComma)
+ // sb.Append (" ");
sb.Append (",");
- if (options.SpaceAfterIndexerDeclarationParameterComma)
- sb.Append (" ");
+ //if (options.SpaceAfterIndexerDeclarationParameterComma)
+ // sb.Append (" ");
} else {
first = false;
}
- sb.Append (param.ToString (options));
+ sb.Append (param.ToString ());
}
- if (options.SpaceWithinIndexerDeclarationBracket)
- sb.Append (" ");
+ //if (options.SpaceWithinIndexerDeclarationBracket)
+ // sb.Append (" ");
sb.Append ("]");
- } else if (e is VariableInitializer) {
- var initializer = (VariableInitializer)e;
- sb.Append (initializer.Name);
- if (IsObsolete (initializer.Parent as EntityDeclaration))
- return "<s>" + sb.ToString () + "</s>";
- } else if (e is FixedVariableInitializer) {
- var initializer = (FixedVariableInitializer)e;
- sb.Append (initializer.Name);
- if (IsObsolete (initializer.Parent as EntityDeclaration))
+ } else if (e is VariableDeclaratorSyntax) {
+ var initializer = (VariableDeclaratorSyntax)e;
+ sb.Append (initializer.Identifier);
+ if (IsObsolete (initializer.Parent as MemberDeclarationSyntax))
return "<s>" + sb.ToString () + "</s>";
- } else if (e is FieldDeclaration) {
- var field = (FieldDeclaration)e;
- if (!field.Variables.Any ())
+ } else if (e is FieldDeclarationSyntax) {
+ var field = (FieldDeclarationSyntax)e;
+ if (!field.Declaration.Variables.Any ())
return "";
- sb.Append (field.Variables.First ().Name);
- } else if (e is FixedFieldDeclaration) {
- var field = (FixedFieldDeclaration)e;
- if (!field.Variables.Any ())
+ sb.Append (field.Declaration.Variables.First ().Identifier);
+ } else if (e is EventFieldDeclarationSyntax) {
+ var evt = (EventFieldDeclarationSyntax)e;
+ if (!evt.Declaration.Variables.Any ())
return "";
- sb.Append (field.Variables.First ().Name);
- } else if (e is EventDeclaration) {
- var evt = (EventDeclaration)e;
- if (!evt.Variables.Any ())
- return "";
- sb.Append (evt.Variables.First ().Name);
- } else if (e is PropertyDeclaration) {
- var property = (PropertyDeclaration)e;
- if (!property.PrivateImplementationType.IsNull)
- AppendEscaped (sb, property.PrivateImplementationType.ToString () + ".");
- sb.Append (property.Name);
- } else if (e is CustomEventDeclaration) {
- var customEvent = (CustomEventDeclaration)e;
- if (!customEvent.PrivateImplementationType.IsNull)
- AppendEscaped (sb, customEvent.PrivateImplementationType.ToString () + ".");
- sb.Append (customEvent.Name);
- } else if (e is EntityDeclaration) {
- var entity = (EntityDeclaration)e;
- sb.Append (entity.Name);
- }
+ sb.Append (evt.Declaration.Variables.First ().Identifier);
+ } else if (e is PropertyDeclarationSyntax) {
+ var property = (PropertyDeclarationSyntax)e;
+ if (property.ExplicitInterfaceSpecifier != null)
+ AppendEscaped (sb, property.ExplicitInterfaceSpecifier + ".");
+ sb.Append (property.Identifier);
+ } else if (e is EventDeclarationSyntax) {
+ var customEvent = (EventDeclarationSyntax)e;
+ if (customEvent.ExplicitInterfaceSpecifier != null)
+ AppendEscaped (sb, customEvent.ExplicitInterfaceSpecifier + ".");
+ sb.Append (customEvent.Identifier);
+ } else if (e is EnumDeclarationSyntax) {
+ var enumDecl = (EnumDeclarationSyntax)e;
+ sb.Append (enumDecl.Identifier);
+ } else if (e is EnumMemberDeclarationSyntax) {
+ var enumMemberDecl = (EnumMemberDeclarationSyntax)e;
+ sb.Append (enumMemberDecl.Identifier);
+ } /*else if (e is MemberDeclarationSyntax) {
+ LoggingService.LogWarning ("can't display : " + e);
+ // var entity = (MemberDeclarationSyntax)e;
+ // sb.Append (entity.Name);
+ }*/
string markup = sb.ToString ();
- if (IsObsolete (e as EntityDeclaration))
+ if (IsObsolete (e as MemberDeclarationSyntax))
return "<s>" + markup + "</s>";
return markup;
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/AstStockIcons.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/AstStockIcons.cs
index aec03f9f17..15216145e5 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/AstStockIcons.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/AstStockIcons.cs
@@ -25,10 +25,13 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.NRefactory.TypeSystem;
+using System.Linq;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Core;
-using ICSharpCode.NRefactory.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using MonoDevelop.Components.MainToolbar;
namespace MonoDevelop.CSharp
{
@@ -41,173 +44,205 @@ namespace MonoDevelop.CSharp
static readonly IconId Field = "md-field";
static readonly IconId Interface = "md-interface";
static readonly IconId Method = "md-method";
- static readonly IconId ExtensionMethod = "md-extensionmethod";
static readonly IconId Property = "md-property";
static readonly IconId Struct = "md-struct";
static readonly IconId Delegate = "md-delegate";
+ // static readonly IconId Constant = "md-literal";
public static readonly IconId Namespace = "md-name-space";
- static readonly IconId InternalClass = "md-internal-class";
- static readonly IconId InternalDelegate = "md-internal-delegate";
- static readonly IconId InternalEnum = "md-internal-enum";
- static readonly IconId InternalEvent = "md-internal-event";
- static readonly IconId InternalField = "md-internal-field";
- static readonly IconId InternalInterface = "md-internal-interface";
- static readonly IconId InternalMethod = "md-internal-method";
- static readonly IconId InternalExtensionMethod = "md-internal-extensionmethod";
- static readonly IconId InternalProperty = "md-internal-property";
- static readonly IconId InternalStruct = "md-internal-struct";
-
- static readonly IconId InternalAndProtectedClass = "md-InternalAndProtected-class";
- static readonly IconId InternalAndProtectedDelegate = "md-InternalAndProtected-delegate";
- static readonly IconId InternalAndProtectedEnum = "md-InternalAndProtected-enum";
- static readonly IconId InternalAndProtectedEvent = "md-InternalAndProtected-event";
- static readonly IconId InternalAndProtectedField = "md-InternalAndProtected-field";
- static readonly IconId InternalAndProtectedInterface = "md-InternalAndProtected-interface";
- static readonly IconId InternalAndProtectedMethod = "md-InternalAndProtected-method";
- static readonly IconId InternalAndProtectedExtensionMethod = "md-InternalAndProtected-extensionmethod";
- static readonly IconId InternalAndProtectedProperty = "md-InternalAndProtected-property";
- static readonly IconId InternalAndProtectedStruct = "md-InternalAndProtected-struct";
-
- static readonly IconId PrivateClass = "md-private-class";
- static readonly IconId PrivateDelegate = "md-private-delegate";
- static readonly IconId PrivateEnum = "md-private-enum";
- static readonly IconId PrivateEvent = "md-private-event";
- static readonly IconId PrivateField = "md-private-field";
- static readonly IconId PrivateInterface = "md-private-interface";
- static readonly IconId PrivateMethod = "md-private-method";
- static readonly IconId PrivateExtensionMethod = "md-private-extensionmethod";
- static readonly IconId PrivateProperty = "md-private-property";
- static readonly IconId PrivateStruct = "md-private-struct";
-
- static readonly IconId ProtectedClass = "md-protected-class";
- static readonly IconId ProtectedDelegate = "md-protected-delegate";
- static readonly IconId ProtectedEnum = "md-protected-enum";
- static readonly IconId ProtectedEvent = "md-protected-event";
- static readonly IconId ProtectedField = "md-protected-field";
- static readonly IconId ProtectedInterface = "md-protected-interface";
- static readonly IconId ProtectedMethod = "md-protected-method";
- static readonly IconId ProtectedExtensionMethod = "md-protected-extensionmethod";
- static readonly IconId ProtectedProperty = "md-protected-property";
- static readonly IconId ProtectedStruct = "md-protected-struct";
-
- static readonly IconId ProtectedOrInternalClass = "md-ProtectedOrInternal-class";
- static readonly IconId ProtectedOrInternalDelegate = "md-ProtectedOrInternal-delegate";
- static readonly IconId ProtectedOrInternalEnum = "md-ProtectedOrInternal-enum";
- static readonly IconId ProtectedOrInternalEvent = "md-ProtectedOrInternal-event";
- static readonly IconId ProtectedOrInternalField = "md-ProtectedOrInternal-field";
- static readonly IconId ProtectedOrInternalInterface = "md-ProtectedOrInternal-interface";
- static readonly IconId ProtectedOrInternalMethod = "md-ProtectedOrInternal-method";
- static readonly IconId ProtectedOrInternalExtensionMethod = "md-ProtectedOrInternal-extensionmethod";
- static readonly IconId ProtectedOrInternalProperty = "md-ProtectedOrInternal-property";
- static readonly IconId ProtectedOrInternalStruct = "md-ProtectedOrInternal-struct";
-
- static IconId[,] typeIconTable = new IconId[,] {
- {Class, PrivateClass, Class, ProtectedClass, InternalClass, ProtectedOrInternalClass, InternalAndProtectedClass}, // class
- {Enum, PrivateEnum, Enum, ProtectedEnum, InternalEnum, ProtectedOrInternalEnum, InternalAndProtectedEnum}, // enum
- {Interface, PrivateInterface, Interface, ProtectedInterface, InternalInterface, ProtectedOrInternalInterface, InternalAndProtectedInterface}, // interface
- {Struct, PrivateStruct, Struct, ProtectedStruct, InternalStruct, ProtectedOrInternalStruct, InternalAndProtectedStruct}, // struct
- {Delegate, PrivateDelegate, Delegate, ProtectedDelegate, InternalDelegate, ProtectedOrInternalDelegate, InternalAndProtectedDelegate} // delegate
- };
- static readonly IconId[] fieldIconTable = {
- AstStockIcons.Field, AstStockIcons.PrivateField, AstStockIcons.Field, AstStockIcons.ProtectedField, AstStockIcons.InternalField, AstStockIcons.ProtectedOrInternalField, AstStockIcons.InternalAndProtectedField
- };
- static readonly IconId[] methodIconTable = {
- AstStockIcons.Method, AstStockIcons.PrivateMethod, AstStockIcons.Method, AstStockIcons.ProtectedMethod, AstStockIcons.InternalMethod, AstStockIcons.ProtectedOrInternalMethod, AstStockIcons.InternalAndProtectedMethod
- };
- static readonly IconId[] extensionMethodIconTable = {
- AstStockIcons.ExtensionMethod, AstStockIcons.PrivateExtensionMethod, AstStockIcons.ExtensionMethod, AstStockIcons.ProtectedExtensionMethod, AstStockIcons.InternalExtensionMethod, AstStockIcons.ProtectedOrInternalExtensionMethod, AstStockIcons.InternalAndProtectedExtensionMethod
- };
- static readonly IconId[] propertyIconTable = {
- AstStockIcons.Property, AstStockIcons.PrivateProperty, AstStockIcons.Property, AstStockIcons.ProtectedProperty, AstStockIcons.InternalProperty, AstStockIcons.ProtectedOrInternalProperty, AstStockIcons.InternalAndProtectedProperty
- };
- static readonly IconId[] eventIconTable = {
- AstStockIcons.Event, AstStockIcons.PrivateEvent, AstStockIcons.Event, AstStockIcons.ProtectedEvent, AstStockIcons.InternalEvent, AstStockIcons.ProtectedOrInternalEvent, AstStockIcons.InternalAndProtectedEvent
- };
-
- static bool GetAccessibility (EntityDeclaration element, out Accessibility acc)
+
+ static void AdjustAccessibility (SyntaxTokenList modifiers, ref Accessibility acc, ref bool isStatic, ref bool result)
+ {
+ isStatic = modifiers.Any (mod => mod.Kind () == Microsoft.CodeAnalysis.CSharp.SyntaxKind.StaticKeyword);
+ if (modifiers.Any (mod => mod.Kind () == Microsoft.CodeAnalysis.CSharp.SyntaxKind.ProtectedKeyword) &&
+ modifiers.Any (mod => mod.Kind () == Microsoft.CodeAnalysis.CSharp.SyntaxKind.InternalKeyword)) {
+ acc = Accessibility.ProtectedOrInternal;
+ result = true;
+ return;
+ }
+
+ foreach (var mod in modifiers) {
+ if (mod.Kind () == Microsoft.CodeAnalysis.CSharp.SyntaxKind.PublicKeyword) {
+ acc = Accessibility.Public;
+ result = true;
+ return;
+ }
+ if (mod.Kind () == Microsoft.CodeAnalysis.CSharp.SyntaxKind.PrivateKeyword) {
+ acc = Accessibility.Private;
+ result = true;
+ return;
+ }
+ if (mod.Kind () == Microsoft.CodeAnalysis.CSharp.SyntaxKind.ProtectedKeyword) {
+ acc = Accessibility.Protected;
+ result = true;
+ return;
+ }
+ if (mod.Kind () == Microsoft.CodeAnalysis.CSharp.SyntaxKind.InternalKeyword) {
+ acc = Accessibility.Internal;
+ result = true;
+ return;
+ }
+ }
+ }
+
+ static bool GetAccessibility (SyntaxNode element, out Accessibility acc, out bool isStatic)
{
- if (element.Parent is TypeDeclaration && ((TypeDeclaration)element.Parent).ClassType == ClassType.Interface) {
+ isStatic = false;
+ if (element.Parent is TypeDeclarationSyntax && element.Parent is InterfaceDeclarationSyntax) {
acc = Accessibility.Public;
return true;
}
bool result = false;
acc = Accessibility.Private;
- if (element is TypeDeclaration && !(element.Parent is TypeDeclaration))
+ if (element is TypeDeclarationSyntax && !(element.Parent is TypeDeclarationSyntax))
acc = Accessibility.Internal;
- if (element.HasModifier (Modifiers.Public)) {
- acc = Accessibility.Public;
- result = true;
- } else if (element.HasModifier (Modifiers.Private)) {
- acc = Accessibility.Private;
- result = true;
- } else if (element.HasModifier (Modifiers.Protected | Modifiers.Internal)) {
- acc = Accessibility.ProtectedOrInternal;
- result = true;
- } else if (element.HasModifier (Modifiers.Protected)) {
- acc = Accessibility.Protected;
- result = true;
- } else if (element.HasModifier (Modifiers.Internal)) {
- acc = Accessibility.Internal;
- result = true;
- }
+
+ if (element is VariableDeclaratorSyntax)
+ element = element.Parent.Parent;
+
+ if (element is TypeDeclarationSyntax)
+ AdjustAccessibility (((TypeDeclarationSyntax)element).Modifiers, ref acc, ref isStatic, ref result);
+ if (element is BaseFieldDeclarationSyntax)
+ AdjustAccessibility (((BaseFieldDeclarationSyntax)element).Modifiers, ref acc, ref isStatic, ref result);
+ if (element is BasePropertyDeclarationSyntax)
+ AdjustAccessibility (((BasePropertyDeclarationSyntax)element).Modifiers, ref acc, ref isStatic, ref result);
+ if (element is BaseMethodDeclarationSyntax)
+ AdjustAccessibility (((BaseMethodDeclarationSyntax)element).Modifiers, ref acc, ref isStatic, ref result);
+ if (element is EnumDeclarationSyntax)
+ AdjustAccessibility (((EnumDeclarationSyntax)element).Modifiers, ref acc, ref isStatic, ref result);
+ if (element is DelegateDeclarationSyntax)
+ AdjustAccessibility (((DelegateDeclarationSyntax)element).Modifiers, ref acc, ref isStatic, ref result);
+
return result;
}
-
-
- public static string GetStockIcon (this EntityDeclaration element)
+
+ static bool IsConst (SyntaxTokenList modifiers)
+ {
+ return modifiers.Any (mod => mod.Kind () == Microsoft.CodeAnalysis.CSharp.SyntaxKind.ConstKeyword);
+ }
+
+ static bool IsConst (SyntaxNode element)
+ {
+ if (element is BaseFieldDeclarationSyntax)
+ return IsConst (((BaseFieldDeclarationSyntax)element).Modifiers);
+ if (element is LocalDeclarationStatementSyntax)
+ return IsConst (((LocalDeclarationStatementSyntax)element).Modifiers);
+ return false;
+ }
+ public static string GetStockIcon (this SyntaxNode element)
{
Accessibility acc = Accessibility.Public;
+ bool isStatic = false;
+ if (element is NamespaceDeclarationSyntax)
+ return Namespace;
+
+ if (element is AccessorDeclarationSyntax) {
+ if (!GetAccessibility ((MemberDeclarationSyntax)element, out acc, out isStatic))
+ GetAccessibility (element.Parent as MemberDeclarationSyntax, out acc, out isStatic);
+ return "md-" + GetAccess (acc) + "method";
+ }
- if (element is Accessor) {
- if (!GetAccessibility (element, out acc))
- GetAccessibility (element.Parent as EntityDeclaration, out acc);
+ GetAccessibility (element, out acc, out isStatic);
- return methodIconTable [(int) (acc)];
+ if (element is EnumDeclarationSyntax) {
+ return "md-" + GetAccess (acc) + "enum";
}
- GetAccessibility (element, out acc);
-
- if (element is TypeDeclaration) {
- var type = element as TypeDeclaration;
-
- switch (type.ClassType) {
- case ClassType.Class:
- return typeIconTable [0, (int) (acc)];
- case ClassType.Struct:
- return typeIconTable [3, (int) (acc)];
- case ClassType.Interface:
- return typeIconTable [2, (int) (acc)];
- case ClassType.Enum:
- return typeIconTable [1, (int) (acc)];
+ if (element is TypeDeclarationSyntax) {
+ var type = element as TypeDeclarationSyntax;
+ switch (type.Keyword.Kind ()) {
+ case SyntaxKind.ClassKeyword:
+ return "md-" + GetAccess (acc) + "class";
+ case SyntaxKind.StructKeyword:
+ return "md-" + GetAccess (acc) + "struct";
+ case SyntaxKind.InterfaceKeyword:
+ return "md-" + GetAccess (acc) + "interface";
+ case SyntaxKind.EnumKeyword:
+ return "md-" + GetAccess (acc) + "enum";
default:
throw new ArgumentOutOfRangeException ();
}
}
- if (element is DelegateDeclaration)
- return typeIconTable [4, (int) (acc)];
+ if (element is DelegateDeclarationSyntax)
+ return "md-" + GetAccess (acc) + "delegate";
// member accessibility
- GetAccessibility (element, out acc);
+ GetAccessibility (element, out acc, out isStatic);
+
+ if (element is BaseMethodDeclarationSyntax) {
+ // TODO!
+ // var method = element as MethodDeclarationSyntax;
+ // if (method.ParameterList.Parameters.First ())
+ // return extensionMethodIconTable [(int) (acc)];
- if (element is MethodDeclaration) {
- var method = element as MethodDeclaration;
- if (method.IsExtensionMethod)
- return extensionMethodIconTable [(int) (acc)];
- return methodIconTable [(int) (acc)];
+
+ return "md-" + GetAccess (acc) + GetGlobal (isStatic) + "method";
}
- if (element is OperatorDeclaration || element is ConstructorDeclaration || element is DestructorDeclaration || element is Accessor)
- return methodIconTable [(int) (acc)];
-
- if (element is PropertyDeclaration || element is IndexerDeclaration)
- return propertyIconTable [(int) (acc)];
- if (element is EventDeclaration || element is CustomEventDeclaration)
- return eventIconTable [(int) (acc)];
- if (element.Parent is TypeDeclaration && ((TypeDeclaration)element.Parent).ClassType == ClassType.Enum)
- acc = Accessibility.Public;
- return fieldIconTable [(int) (acc)];
+
+ if (element is PropertyDeclarationSyntax || element is IndexerDeclarationSyntax)
+ return "md-" + GetAccess (acc) + GetGlobal (isStatic) + "property";
+ if (element is EventDeclarationSyntax || element is EventFieldDeclarationSyntax)
+ return "md-" + GetAccess (acc) + GetGlobal (isStatic) + "event";
+ if (element is EnumMemberDeclarationSyntax)
+ return "md-literal";
+ if (element?.Parent?.Parent is FieldDeclarationSyntax || element?.Parent?.Parent is LocalDeclarationStatementSyntax) {
+ if (IsConst (element.Parent.Parent))
+ return "md-" + GetAccess (acc) + "literal";
+ }
+
+ if (element is FieldDeclarationSyntax || element is LocalDeclarationStatementSyntax) {
+ if (IsConst (element))
+ return "md-" + GetAccess (acc) + "literal";
+ }
+
+ return "md-" + GetAccess (acc) + GetGlobal (isStatic) + "field";
+ }
+
+ static string GetGlobal (bool isStatic)
+ {
+ return isStatic ? "static-" : "";
+ }
+
+ static string GetAccess (Accessibility acc)
+ {
+ return MonoDevelop.Ide.TypeSystem.Stock.GetAccess (acc);
}
- }
+ internal static IconId GetStockIconForSymbolInfo (this DeclaredSymbolInfo symbol)
+ {
+ switch (symbol.Kind) {
+ case DeclaredSymbolInfoKind.Class:
+ return AstStockIcons.Class;
+ case DeclaredSymbolInfoKind.Constant:
+ return AstStockIcons.Field;
+ case DeclaredSymbolInfoKind.Constructor:
+ return AstStockIcons.Method;
+ case DeclaredSymbolInfoKind.Delegate:
+ return AstStockIcons.Delegate;
+ case DeclaredSymbolInfoKind.Enum:
+ return AstStockIcons.Enum;
+ case DeclaredSymbolInfoKind.EnumMember:
+ return AstStockIcons.Field;
+ case DeclaredSymbolInfoKind.Event:
+ return AstStockIcons.Event;
+ case DeclaredSymbolInfoKind.Field:
+ return AstStockIcons.Field;
+ case DeclaredSymbolInfoKind.Indexer:
+ return AstStockIcons.Method;
+ case DeclaredSymbolInfoKind.Interface:
+ return AstStockIcons.Interface;
+ case DeclaredSymbolInfoKind.Method:
+ return AstStockIcons.Method;
+ case DeclaredSymbolInfoKind.Module:
+ return AstStockIcons.Method;
+ case DeclaredSymbolInfoKind.Property:
+ return AstStockIcons.Property;
+ case DeclaredSymbolInfoKind.Struct:
+ return AstStockIcons.Struct;
+ default:
+ throw new ArgumentOutOfRangeException ();
+ }
+ }
+ }
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpAmbience.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpAmbience.cs
index 3536c9a86c..a4092e8883 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpAmbience.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpAmbience.cs
@@ -32,16 +32,13 @@ using MonoDevelop.CSharp.Formatting;
using MonoDevelop.Ide;
using System.Collections.ObjectModel;
using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
using System.IO;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.TypeSystem.Implementation;
+using System.Threading.Tasks;
+using System.Threading;
namespace MonoDevelop.CSharp
{
- class CSharpAmbience : Ambience
+ class CSharpAmbience : AmbienceTooltipProvider
{
static Dictionary<string, string> netToCSharpTypes = new Dictionary<string, string> ();
static HashSet<string> keywords = new HashSet<string> (new [] {
@@ -186,40 +183,33 @@ namespace MonoDevelop.CSharp
netToCSharpTypes ["System.Decimal"] = "decimal";
netToCSharpTypes ["System.String"] = "string";
- classTypes [TypeKind.Class] = "class";
- classTypes [TypeKind.Enum] = "enum";
- classTypes [TypeKind.Interface] = "interface";
- classTypes [TypeKind.Struct] = "struct";
- classTypes [TypeKind.Delegate] = "delegate";
+// classTypes [TypeKind.Class] = "class";
+// classTypes [TypeKind.Enum] = "enum";
+// classTypes [TypeKind.Interface] = "interface";
+// classTypes [TypeKind.Struct] = "struct";
+// classTypes [TypeKind.Delegate] = "delegate";
}
-
- public CSharpAmbience () : base ("C#")
- {
- }
-
- static Dictionary<TypeKind, string> classTypes = new Dictionary<TypeKind, string> ();
-
- public override MonoDevelop.Ide.CodeCompletion.TooltipInformation GetTooltip (IEntity entity)
+//
+// public CSharpAmbience () : base ("C#")
+// {
+// }
+//
+// static Dictionary<TypeKind, string> classTypes = new Dictionary<TypeKind, string> ();
+//
+ public override Task<MonoDevelop.Ide.CodeCompletion.TooltipInformation> GetTooltip (CancellationToken token, Microsoft.CodeAnalysis.ISymbol entity)
{
if (entity == null)
throw new ArgumentNullException ("entity");
- return MonoDevelop.CSharp.Completion.MemberCompletionData.CreateTooltipInformation (
- entity.Compilation,
- null,
- null,
- new CSharpFormattingPolicy (),
- entity,
- false,
- true);
+ return MonoDevelop.CSharp.Completion.RoslynSymbolCompletionData.CreateTooltipInformation (token, null, null, entity, false, true);
}
- static string GetString (TypeKind classType)
- {
- string res;
- if (classTypes.TryGetValue (classType, out res))
- return res;
- return string.Empty;
- }
+// static string GetString (TypeKind classType)
+// {
+// string res;
+// if (classTypes.TryGetValue (classType, out res))
+// return res;
+// return string.Empty;
+// }
internal static string FilterName (string name)
{
@@ -235,334 +225,334 @@ namespace MonoDevelop.CSharp
return netTypeName;
}
- #region implemented abstract members of MonoDevelop.Ide.TypeSystem.Ambience
- public override string GetIntrinsicTypeName (string reflectionName)
- {
- return NetToCSharpTypeName (reflectionName);
- }
-
- public override string SingleLineComment (string text)
- {
- return "// " + text;
- }
-
- public override string GetString (string nameSpace, OutputSettings settings)
- {
- var result = new StringBuilder ();
- if (settings.IncludeKeywords)
- result.Append (settings.EmitKeyword ("namespace"));
- result.Append (Format (nameSpace));
- return result.ToString ();
- }
-
- public void AppendType (StringBuilder sb, IType type, OutputSettings settings)
- {
- if (type.Kind == TypeKind.Unknown) {
- sb.Append (settings.IncludeMarkup ? settings.Markup (type.Name) : type.Name);
- return;
- }
- if (type.Kind == TypeKind.TypeParameter) {
- sb.Append (settings.IncludeMarkup ? settings.Markup (type.Name) : type.Name);
- return;
- }
- if (type.DeclaringType != null) {
- AppendType (sb, type.DeclaringType, settings);
- sb.Append (settings.Markup ("."));
- }
- if (type.Namespace == "System" && type.TypeParameterCount == 0) {
- switch (type.Name) {
- case "Object":
- sb.Append ("object");
- return;
- case "Boolean":
- sb.Append ("bool");
- return;
- case "Char":
- sb.Append ("char");
- return;
- case "SByte":
- sb.Append ("sbyte");
- return;
- case "Byte":
- sb.Append ("byte");
- return;
- case "Int16":
- sb.Append ("short");
- return;
- case "UInt16":
- sb.Append ("ushort");
- return;
- case "Int32":
- sb.Append ("int");
- return;
- case "UInt32":
- sb.Append ("uint");
- return;
- case "Int64":
- sb.Append ("long");
- return;
- case "UInt64":
- sb.Append ("ulong");
- return;
- case "Single":
- sb.Append ("float");
- return;
- case "Double":
- sb.Append ("double");
- return;
- case "Decimal":
- sb.Append ("decimal");
- return;
- case "String":
- sb.Append ("string");
- return;
- case "Void":
- sb.Append ("void");
- return;
- }
- }
-
- var typeWithElementType = type as TypeWithElementType;
- if (typeWithElementType != null) {
- AppendType (sb, typeWithElementType.ElementType, settings);
-
- if (typeWithElementType is PointerType) {
- sb.Append (settings.Markup ("*"));
- }
-
- if (typeWithElementType is ArrayType) {
- sb.Append (settings.Markup ("["));
- sb.Append (settings.Markup (new string (',', ((ArrayType)type).Dimensions - 1)));
- sb.Append (settings.Markup ("]"));
- }
- return;
- }
-
- if (type.TypeArguments.Count > 0) {
- if (type.Name == "Nullable" && type.Namespace == "System" && type.TypeParameterCount == 1) {
- AppendType (sb, type.TypeArguments [0], settings);
- sb.Append (settings.Markup ("?"));
- return;
- }
- sb.Append (type.Name);
- if (type.TypeParameterCount > 0) {
- sb.Append (settings.Markup ("<"));
- for (int i = 0; i < type.TypeParameterCount; i++) {
- if (i > 0)
- sb.Append (settings.Markup (", "));
- AppendType (sb, type.TypeArguments [i], settings);
- }
- sb.Append (settings.Markup (">"));
- }
- return;
- }
-
- var typeDef = type as ITypeDefinition ?? type.GetDefinition ();
- if (typeDef != null) {
- if (settings.UseFullName) {
- sb.Append (settings.IncludeMarkup ? settings.Markup (typeDef.FullName) : typeDef.FullName);
- } else {
- sb.Append (settings.IncludeMarkup ? settings.Markup (typeDef.Name) : typeDef.Name);
- }
-
- if (typeDef.TypeParameterCount > 0) {
- sb.Append (settings.Markup ("<"));
- for (int i = 0; i < typeDef.TypeParameterCount; i++) {
- if (i > 0)
- sb.Append (settings.Markup (", "));
- AppendVariance (sb, typeDef.TypeParameters [i].Variance);
- AppendType (sb, typeDef.TypeParameters [i], settings);
- }
- sb.Append (settings.Markup (">"));
- }
- }
- }
-
- static void AppendVariance (StringBuilder sb, VarianceModifier variance)
- {
- if (variance == VarianceModifier.Contravariant) {
- sb.Append ("in ");
- } else if (variance == VarianceModifier.Covariant) {
- sb.Append ("out ");
- }
- }
-
- protected override string GetTypeReferenceString (IType reference, OutputSettings settings)
- {
- if (reference == null)
- return "null";
- var type = reference;
- if (type.Kind == TypeKind.Unknown) {
- return settings.IncludeMarkup ? settings.Markup (reference.Name) : reference.Name;
- }
-
- if (reference.Kind == TypeKind.TypeParameter)
- return settings.IncludeMarkup ? settings.Markup (reference.Name) : reference.FullName;
-
- var sb = new StringBuilder ();
- if (type is ITypeDefinition && ((ITypeDefinition)type).IsSynthetic && ((ITypeDefinition)type).Name == "$Anonymous$") {
- sb.Append ("new {");
- foreach (var property in ((ITypeDefinition)type).Properties) {
- sb.AppendLine ();
- sb.Append ("\t");
- sb.Append (GetTypeReferenceString (property.ReturnType, settings) ?? "?");
- sb.Append (" ");
- sb.Append (settings.IncludeMarkup ? settings.Markup (property.Name) : property.Name);
- sb.Append (";");
- }
- sb.AppendLine ();
- sb.Append ("}");
- return sb.ToString ();
- }
-
- AppendType (sb, type, settings);
- return sb.ToString ();
- }
-
- protected override string GetTypeString (IType t, OutputSettings settings)
- {
- if (t.Kind == TypeKind.Unknown) {
- return settings.IncludeMarkup ? settings.Markup (t.Name) : t.Name;
- }
-
- if (t.Kind == TypeKind.TypeParameter)
- return settings.IncludeMarkup ? settings.Markup (t.FullName) : t.FullName;
-
- var typeWithElementType = t as TypeWithElementType;
- if (typeWithElementType != null) {
- var sb = new StringBuilder ();
-
- if (typeWithElementType is PointerType) {
- sb.Append (settings.Markup ("*"));
- }
- AppendType (sb, typeWithElementType.ElementType, settings);
-
- if (typeWithElementType is ArrayType) {
- sb.Append (settings.Markup ("["));
- sb.Append (settings.Markup (new string (',', ((ArrayType)t).Dimensions - 1)));
- sb.Append (settings.Markup ("]"));
- }
- return sb.ToString ();
- }
-
- ITypeDefinition type = t.GetDefinition ();
- if (type == null)
- return "";
-
- if (!settings.UseNETTypeNames && type.Namespace == "System" && type.TypeParameterCount == 0) {
- switch (type.Name) {
- case "Object":
- return "object";
- case "Boolean":
- return "bool";
- case "Char":
- return "char";
- case "SByte":
- return "sbyte";
- case "Byte":
- return "byte";
- case "Int16":
- return "short";
- case "UInt16":
- return "ushort";
- case "Int32":
- return "int";
- case "UInt32":
- return "uint";
- case "Int64":
- return "long";
- case "UInt64":
- return "ulong";
- case "Single":
- return "float";
- case "Double":
- return "double";
- case "Decimal":
- return "decimal";
- case "String":
- return "string";
- case "Void":
- return "void";
- }
- }
-
- // output anonymous type
- if (type.IsSynthetic && type.Name == "$Anonymous$")
- return GetTypeReferenceString (type, settings);
-
- var result = new StringBuilder ();
-
-
- var def = type;
- AppendModifiers (result, settings, def);
- if (settings.IncludeKeywords)
- result.Append (GetString (def.Kind));
- if (result.Length > 0 && !result.ToString ().EndsWith (" "))
- result.Append (settings.Markup (" "));
-
-
- if (type.Kind == TypeKind.Delegate && settings.ReformatDelegates && settings.IncludeReturnType) {
- var invoke = type.GetDelegateInvokeMethod ();
- result.Append (GetTypeReferenceString (invoke.ReturnType, settings));
- result.Append (settings.Markup (" "));
- }
-
- if (settings.UseFullName && !string.IsNullOrEmpty (type.Namespace))
- result.Append ((settings.IncludeMarkup ? settings.Markup (t.Namespace) : type.Namespace) + ".");
-
- if (settings.UseFullInnerTypeName && type.DeclaringTypeDefinition != null) {
- bool includeGenerics = settings.IncludeGenerics;
- settings.OutputFlags |= OutputFlags.IncludeGenerics;
- string typeString = GetTypeReferenceString (type.DeclaringTypeDefinition, settings);
- if (!includeGenerics)
- settings.OutputFlags &= ~OutputFlags.IncludeGenerics;
- result.Append (typeString);
- result.Append (settings.Markup ("."));
- }
- result.Append (settings.EmitName (type, settings.IncludeMarkup ? settings.Markup (t.Name) : type.Name));
- if (settings.IncludeGenerics && type.TypeParameterCount > 0) {
- result.Append (settings.Markup ("<"));
- for (int i = 0; i < type.TypeParameterCount; i++) {
- if (i > 0)
- result.Append (settings.Markup (settings.HideGenericParameterNames ? "," : ", "));
- if (!settings.HideGenericParameterNames) {
- if (t.TypeArguments.Count > 0) {
- result.Append (GetTypeReferenceString (t.TypeArguments [i], settings));
- } else {
- AppendVariance (result, type.TypeParameters [i].Variance);
- result.Append (NetToCSharpTypeName (type.TypeParameters [i].FullName));
- }
- }
- }
- result.Append (settings.Markup (">"));
- }
-
- if (t.Kind == TypeKind.Delegate && settings.ReformatDelegates) {
-// var policy = GetPolicy (settings);
-// if (policy.BeforeMethodCallParentheses)
-// result.Append (settings.Markup (" "));
- result.Append (settings.Markup ("("));
- var invoke = type.GetDelegateInvokeMethod ();
- if (invoke != null)
- AppendParameterList (result, settings, invoke.Parameters);
- result.Append (settings.Markup (")"));
- return result.ToString ();
- }
-
- if (settings.IncludeBaseTypes && type.DirectBaseTypes.Any ()) {
- bool first = true;
- foreach (var baseType in type.DirectBaseTypes) {
-// if (baseType.FullName == "System.Object" || baseType.FullName == "System.Enum")
-// continue;
- result.Append (settings.Markup (first ? " : " : ", "));
- first = false;
- result.Append (GetTypeReferenceString (baseType, settings));
- }
-
- }
-// OutputConstraints (result, settings, type.TypeParameters);
- return result.ToString ();
- }
+// #region implemented abstract members of MonoDevelop.Ide.TypeSystem.Ambience
+// public override string GetIntrinsicTypeName (string reflectionName)
+// {
+// return NetToCSharpTypeName (reflectionName);
+// }
+//
+// public override string SingleLineComment (string text)
+// {
+// return "// " + text;
+// }
+//
+// public override string GetString (string nameSpace, OutputSettings settings)
+// {
+// var result = new StringBuilder ();
+// if (settings.IncludeKeywords)
+// result.Append (settings.EmitKeyword ("namespace"));
+// result.Append (Format (nameSpace));
+// return result.ToString ();
+// }
+//
+// public void AppendType (StringBuilder sb, IType type, OutputSettings settings)
+// {
+// if (type.Kind == TypeKind.Unknown) {
+// sb.Append (settings.IncludeMarkup ? settings.Markup (type.Name) : type.Name);
+// return;
+// }
+// if (type.Kind == TypeKind.TypeParameter) {
+// sb.Append (settings.IncludeMarkup ? settings.Markup (type.Name) : type.Name);
+// return;
+// }
+// if (type.DeclaringType != null) {
+// AppendType (sb, type.DeclaringType, settings);
+// sb.Append (settings.Markup ("."));
+// }
+// if (type.Namespace == "System" && type.TypeParameterCount == 0) {
+// switch (type.Name) {
+// case "Object":
+// sb.Append ("object");
+// return;
+// case "Boolean":
+// sb.Append ("bool");
+// return;
+// case "Char":
+// sb.Append ("char");
+// return;
+// case "SByte":
+// sb.Append ("sbyte");
+// return;
+// case "Byte":
+// sb.Append ("byte");
+// return;
+// case "Int16":
+// sb.Append ("short");
+// return;
+// case "UInt16":
+// sb.Append ("ushort");
+// return;
+// case "Int32":
+// sb.Append ("int");
+// return;
+// case "UInt32":
+// sb.Append ("uint");
+// return;
+// case "Int64":
+// sb.Append ("long");
+// return;
+// case "UInt64":
+// sb.Append ("ulong");
+// return;
+// case "Single":
+// sb.Append ("float");
+// return;
+// case "Double":
+// sb.Append ("double");
+// return;
+// case "Decimal":
+// sb.Append ("decimal");
+// return;
+// case "String":
+// sb.Append ("string");
+// return;
+// case "Void":
+// sb.Append ("void");
+// return;
+// }
+// }
+//
+// var typeWithElementType = type as TypeWithElementType;
+// if (typeWithElementType != null) {
+// AppendType (sb, typeWithElementType.ElementType, settings);
+//
+// if (typeWithElementType is PointerType) {
+// sb.Append (settings.Markup ("*"));
+// }
+//
+// if (typeWithElementType is ArrayType) {
+// sb.Append (settings.Markup ("["));
+// sb.Append (settings.Markup (new string (',', ((ArrayType)type).Dimensions - 1)));
+// sb.Append (settings.Markup ("]"));
+// }
+// return;
+// }
+//
+// if (type.TypeArguments.Count > 0) {
+// if (type.Name == "Nullable" && type.Namespace == "System" && type.TypeParameterCount == 1) {
+// AppendType (sb, type.TypeArguments [0], settings);
+// sb.Append (settings.Markup ("?"));
+// return;
+// }
+// sb.Append (type.Name);
+// if (type.TypeParameterCount > 0) {
+// sb.Append (settings.Markup ("<"));
+// for (int i = 0; i < type.TypeParameterCount; i++) {
+// if (i > 0)
+// sb.Append (settings.Markup (", "));
+// AppendType (sb, type.TypeArguments [i], settings);
+// }
+// sb.Append (settings.Markup (">"));
+// }
+// return;
+// }
+//
+// var typeDef = type as ITypeDefinition ?? type.GetDefinition ();
+// if (typeDef != null) {
+// if (settings.UseFullName) {
+// sb.Append (settings.IncludeMarkup ? settings.Markup (typeDef.FullName) : typeDef.FullName);
+// } else {
+// sb.Append (settings.IncludeMarkup ? settings.Markup (typeDef.Name) : typeDef.Name);
+// }
+//
+// if (typeDef.TypeParameterCount > 0) {
+// sb.Append (settings.Markup ("<"));
+// for (int i = 0; i < typeDef.TypeParameterCount; i++) {
+// if (i > 0)
+// sb.Append (settings.Markup (", "));
+// AppendVariance (sb, typeDef.TypeParameters [i].Variance);
+// AppendType (sb, typeDef.TypeParameters [i], settings);
+// }
+// sb.Append (settings.Markup (">"));
+// }
+// }
+// }
+//
+// static void AppendVariance (StringBuilder sb, VarianceModifier variance)
+// {
+// if (variance == VarianceModifier.Contravariant) {
+// sb.Append ("in ");
+// } else if (variance == VarianceModifier.Covariant) {
+// sb.Append ("out ");
+// }
+// }
+//
+// protected override string GetTypeReferenceString (IType reference, OutputSettings settings)
+// {
+// if (reference == null)
+// return "null";
+// var type = reference;
+// if (type.Kind == TypeKind.Unknown) {
+// return settings.IncludeMarkup ? settings.Markup (reference.Name) : reference.Name;
+// }
+//
+// if (reference.Kind == TypeKind.TypeParameter)
+// return settings.IncludeMarkup ? settings.Markup (reference.Name) : reference.FullName;
+//
+// var sb = new StringBuilder ();
+// if (type is ITypeDefinition && ((ITypeDefinition)type).IsSynthetic && ((ITypeDefinition)type).Name == "$Anonymous$") {
+// sb.Append ("new {");
+// foreach (var property in ((ITypeDefinition)type).Properties) {
+// sb.AppendLine ();
+// sb.Append ("\t");
+// sb.Append (GetTypeReferenceString (property.ReturnType, settings) ?? "?");
+// sb.Append (" ");
+// sb.Append (settings.IncludeMarkup ? settings.Markup (property.Name) : property.Name);
+// sb.Append (";");
+// }
+// sb.AppendLine ();
+// sb.Append ("}");
+// return sb.ToString ();
+// }
+//
+// AppendType (sb, type, settings);
+// return sb.ToString ();
+// }
+//
+// protected override string GetTypeString (IType t, OutputSettings settings)
+// {
+// if (t.Kind == TypeKind.Unknown) {
+// return settings.IncludeMarkup ? settings.Markup (t.Name) : t.Name;
+// }
+//
+// if (t.Kind == TypeKind.TypeParameter)
+// return settings.IncludeMarkup ? settings.Markup (t.FullName) : t.FullName;
+//
+// var typeWithElementType = t as TypeWithElementType;
+// if (typeWithElementType != null) {
+// var sb = new StringBuilder ();
+//
+// if (typeWithElementType is PointerType) {
+// sb.Append (settings.Markup ("*"));
+// }
+// AppendType (sb, typeWithElementType.ElementType, settings);
+//
+// if (typeWithElementType is ArrayType) {
+// sb.Append (settings.Markup ("["));
+// sb.Append (settings.Markup (new string (',', ((ArrayType)t).Dimensions - 1)));
+// sb.Append (settings.Markup ("]"));
+// }
+// return sb.ToString ();
+// }
+//
+// ITypeDefinition type = t.GetDefinition ();
+// if (type == null)
+// return "";
+//
+// if (!settings.UseNETTypeNames && type.Namespace == "System" && type.TypeParameterCount == 0) {
+// switch (type.Name) {
+// case "Object":
+// return "object";
+// case "Boolean":
+// return "bool";
+// case "Char":
+// return "char";
+// case "SByte":
+// return "sbyte";
+// case "Byte":
+// return "byte";
+// case "Int16":
+// return "short";
+// case "UInt16":
+// return "ushort";
+// case "Int32":
+// return "int";
+// case "UInt32":
+// return "uint";
+// case "Int64":
+// return "long";
+// case "UInt64":
+// return "ulong";
+// case "Single":
+// return "float";
+// case "Double":
+// return "double";
+// case "Decimal":
+// return "decimal";
+// case "String":
+// return "string";
+// case "Void":
+// return "void";
+// }
+// }
+//
+// // output anonymous type
+// if (type.IsSynthetic && type.Name == "$Anonymous$")
+// return GetTypeReferenceString (type, settings);
+//
+// var result = new StringBuilder ();
+//
+//
+// var def = type;
+// AppendModifiers (result, settings, def);
+// if (settings.IncludeKeywords)
+// result.Append (GetString (def.Kind));
+// if (result.Length > 0 && !result.ToString ().EndsWith (" "))
+// result.Append (settings.Markup (" "));
+//
+//
+// if (type.Kind == TypeKind.Delegate && settings.ReformatDelegates && settings.IncludeReturnType) {
+// var invoke = type.GetDelegateInvokeMethod ();
+// result.Append (GetTypeReferenceString (invoke.ReturnType, settings));
+// result.Append (settings.Markup (" "));
+// }
+//
+// if (settings.UseFullName && !string.IsNullOrEmpty (type.Namespace))
+// result.Append ((settings.IncludeMarkup ? settings.Markup (t.Namespace) : type.Namespace) + ".");
+//
+// if (settings.UseFullInnerTypeName && type.DeclaringTypeDefinition != null) {
+// bool includeGenerics = settings.IncludeGenerics;
+// settings.OutputFlags |= OutputFlags.IncludeGenerics;
+// string typeString = GetTypeReferenceString (type.DeclaringTypeDefinition, settings);
+// if (!includeGenerics)
+// settings.OutputFlags &= ~OutputFlags.IncludeGenerics;
+// result.Append (typeString);
+// result.Append (settings.Markup ("."));
+// }
+// result.Append (settings.EmitName (type, settings.IncludeMarkup ? settings.Markup (t.Name) : type.Name));
+// if (settings.IncludeGenerics && type.TypeParameterCount > 0) {
+// result.Append (settings.Markup ("<"));
+// for (int i = 0; i < type.TypeParameterCount; i++) {
+// if (i > 0)
+// result.Append (settings.Markup (settings.HideGenericParameterNames ? "," : ", "));
+// if (!settings.HideGenericParameterNames) {
+// if (t.TypeArguments.Count > 0) {
+// result.Append (GetTypeReferenceString (t.TypeArguments [i], settings));
+// } else {
+// AppendVariance (result, type.TypeParameters [i].Variance);
+// result.Append (NetToCSharpTypeName (type.TypeParameters [i].FullName));
+// }
+// }
+// }
+// result.Append (settings.Markup (">"));
+// }
+//
+// if (t.Kind == TypeKind.Delegate && settings.ReformatDelegates) {
+//// var policy = GetPolicy (settings);
+//// if (policy.BeforeMethodCallParentheses)
+//// result.Append (settings.Markup (" "));
+// result.Append (settings.Markup ("("));
+// var invoke = type.GetDelegateInvokeMethod ();
+// if (invoke != null)
+// AppendParameterList (result, settings, invoke.Parameters);
+// result.Append (settings.Markup (")"));
+// return result.ToString ();
+// }
+//
+// if (settings.IncludeBaseTypes && type.DirectBaseTypes.Any ()) {
+// bool first = true;
+// foreach (var baseType in type.DirectBaseTypes) {
+//// if (baseType.FullName == "System.Object" || baseType.FullName == "System.Enum")
+//// continue;
+// result.Append (settings.Markup (first ? " : " : ", "));
+// first = false;
+// result.Append (GetTypeReferenceString (baseType, settings));
+// }
+//
+// }
+//// OutputConstraints (result, settings, type.TypeParameters);
+// return result.ToString ();
+// }
internal static string GetOperator (string methodName)
{
@@ -623,336 +613,336 @@ namespace MonoDevelop.CSharp
}
return methodName;
}
-
- string InternalGetMethodString (IMethod method, OutputSettings settings, string methodName, bool getReturnType)
- {
- if (method == null)
- return "";
- var result = new StringBuilder ();
- AppendModifiers (result, settings, method);
- if (!settings.CompletionListFomat && settings.IncludeReturnType && getReturnType) {
- result.Append (GetTypeReferenceString (method.ReturnType, settings));
- result.Append (settings.Markup (" "));
- }
-
- if (!settings.IncludeReturnType && settings.UseFullName) {
- result.Append (GetTypeReferenceString (method.DeclaringTypeDefinition, new OutputSettings (OutputFlags.UseFullName)));
- result.Append (settings.Markup ("."));
- }
- AppendExplicitInterfaces (result, method, settings);
- if (method.SymbolKind == SymbolKind.Operator) {
- result.Append ("operator ");
- result.Append (settings.Markup (GetOperator (methodName)));
- } else {
- result.Append (methodName);
- }
-
- if (settings.IncludeGenerics) {
- if (method.TypeParameters.Count > 0) {
- result.Append (settings.Markup ("<"));
- for (int i = 0; i < method.TypeParameters.Count; i++) {
- if (i > 0)
- result.Append (settings.Markup (settings.HideGenericParameterNames ? "," : ", "));
- if (!settings.HideGenericParameterNames) {
- AppendVariance (result, method.TypeParameters [i].Variance);
- result.Append (NetToCSharpTypeName (method.TypeParameters [i].Name));
- }
- }
- result.Append (settings.Markup (">"));
- }
- }
-
- if (settings.IncludeParameters) {
-// CSharpFormattingPolicy policy = GetPolicy (settings);
-// if (policy.BeforeMethodCallParentheses)
+//
+// string InternalGetMethodString (IMethod method, OutputSettings settings, string methodName, bool getReturnType)
+// {
+// if (method == null)
+// return "";
+// var result = new StringBuilder ();
+// AppendModifiers (result, settings, method);
+// if (!settings.CompletionListFomat && settings.IncludeReturnType && getReturnType) {
+// result.Append (GetTypeReferenceString (method.ReturnType, settings));
// result.Append (settings.Markup (" "));
- result.Append (settings.Markup ("("));
- AppendParameterList (result, settings, method.Parameters);
- result.Append (settings.Markup (")"));
- }
-
- if (settings.CompletionListFomat && settings.IncludeReturnType && getReturnType) {
- result.Append (settings.Markup (" : "));
- result.Append (GetTypeReferenceString (method.ReturnType, settings));
- }
-
-// OutputConstraints (result, settings, method.TypeParameters);
-
- return result.ToString ();
- }
-
- protected override string GetMethodString (IMethod method, OutputSettings settings)
- {
- return InternalGetMethodString (method, settings, settings.EmitName (method, Format (FilterName (method.SymbolKind == SymbolKind.Constructor || method.SymbolKind == SymbolKind.Destructor ? method.DeclaringTypeDefinition.Name : method.Name))), true);
- }
-
- protected override string GetConstructorString (IMethod method, OutputSettings settings)
- {
- return InternalGetMethodString (method, settings, settings.EmitName (method, Format (FilterName (method.DeclaringTypeDefinition != null ? method.DeclaringTypeDefinition.Name : method.Name))), false);
- }
-
- protected override string GetDestructorString (IMethod method, OutputSettings settings)
- {
- return InternalGetMethodString (method, settings, settings.EmitName (method, settings.Markup ("~") + Format (FilterName (method.DeclaringTypeDefinition != null ? method.DeclaringTypeDefinition.Name : method.Name))), false);
- }
-
- protected override string GetOperatorString (IMethod method, OutputSettings settings)
- {
- return InternalGetMethodString (method, settings, settings.EmitName (method, Format (FilterName (method.Name))), true);
- }
-
- protected override string GetFieldString (IField field, OutputSettings settings)
- {
- if (field == null)
- return "";
- var result = new StringBuilder ();
- bool isEnum = field.DeclaringTypeDefinition != null && field.DeclaringTypeDefinition.Kind == TypeKind.Enum;
- AppendModifiers (result, settings, field);
-
- if (!settings.CompletionListFomat && settings.IncludeReturnType && !isEnum) {
- result.Append (GetTypeReferenceString (field.ReturnType, settings));
- result.Append (settings.Markup (" "));
- }
-
- if (!settings.IncludeReturnType && settings.UseFullName) {
- result.Append (GetTypeReferenceString (field.DeclaringTypeDefinition, settings));
- result.Append (settings.Markup ("."));
- }
- result.Append (settings.EmitName (field, FilterName (Format (field.Name))));
-
- if (settings.CompletionListFomat && settings.IncludeReturnType && !isEnum) {
- result.Append (settings.Markup (" : "));
- result.Append (GetTypeReferenceString (field.ReturnType, settings));
- }
- return result.ToString ();
- }
-
- protected override string GetEventString (IEvent evt, OutputSettings settings)
- {
- if (evt == null)
- return "";
- var result = new StringBuilder ();
- AppendModifiers (result, settings, evt);
- if (settings.IncludeKeywords)
- result.Append (settings.EmitKeyword ("event"));
- if (!settings.CompletionListFomat && settings.IncludeReturnType) {
- result.Append (GetTypeReferenceString (evt.ReturnType, settings));
- result.Append (settings.Markup (" "));
- }
-
- if (!settings.IncludeReturnType && settings.UseFullName) {
- result.Append (GetTypeReferenceString (evt.DeclaringTypeDefinition, new OutputSettings (OutputFlags.UseFullName)));
- result.Append (settings.Markup ("."));
- }
-
- AppendExplicitInterfaces (result, evt, settings);
- result.Append (settings.EmitName (evt, Format (FilterName (evt.Name))));
-
- if (settings.CompletionListFomat && settings.IncludeReturnType) {
- result.Append (settings.Markup (" : "));
- result.Append (GetTypeReferenceString (evt.ReturnType, settings));
- }
- return result.ToString ();
- }
-
- protected override string GetPropertyString (IProperty property, OutputSettings settings)
- {
- if (property == null)
- return "";
- var result = new StringBuilder ();
- AppendModifiers (result, settings, property);
- if (!settings.CompletionListFomat && settings.IncludeReturnType) {
- result.Append (GetTypeReferenceString (property.ReturnType, settings));
- result.Append (settings.Markup (" "));
- }
-
- if (!settings.IncludeReturnType && settings.UseFullName) {
- result.Append (GetTypeReferenceString (property.DeclaringTypeDefinition, new OutputSettings (OutputFlags.UseFullName)));
- result.Append (settings.Markup ("."));
- }
-
- AppendExplicitInterfaces (result, property, settings);
-
- if (property.SymbolKind == SymbolKind.Indexer) {
- result.Append (settings.EmitName (property, "this"));
- } else {
- result.Append (settings.EmitName (property, Format (FilterName (property.Name))));
- }
-
- if (settings.IncludeParameters && property.Parameters.Count > 0) {
- result.Append (settings.Markup ("["));
- AppendParameterList (result, settings, property.Parameters);
- result.Append (settings.Markup ("]"));
- }
-
- if (settings.CompletionListFomat && settings.IncludeReturnType) {
- result.Append (settings.Markup (" : "));
- result.Append (GetTypeReferenceString (property.ReturnType, settings));
- }
-
- if (settings.IncludeAccessor) {
- result.Append (settings.Markup (" {"));
- if (property.CanGet)
- result.Append (settings.Markup (" get;"));
- if (property.CanSet)
- result.Append (settings.Markup (" set;"));
- result.Append (settings.Markup (" }"));
- }
-
- return result.ToString ();
- }
-
- protected override string GetIndexerString (IProperty property, OutputSettings settings)
- {
- if (property == null)
- return "";
- var result = new StringBuilder ();
-
- AppendModifiers (result, settings, property);
-
- if (settings.IncludeReturnType) {
- result.Append (GetTypeReferenceString (property.ReturnType, settings));
- result.Append (settings.Markup (" "));
- }
-
- if (!settings.IncludeReturnType && settings.UseFullName) {
- result.Append (GetTypeReferenceString (property.DeclaringTypeDefinition, new OutputSettings (OutputFlags.UseFullName)));
- result.Append (settings.Markup ("."));
- }
-
- AppendExplicitInterfaces (result, property, settings);
-
- result.Append (settings.EmitName (property, Format ("this")));
-
- if (settings.IncludeParameters && property.Getter.Parameters.Count > 0) {
- result.Append (settings.Markup ("["));
- AppendParameterList (result, settings, property.Getter.Parameters);
- result.Append (settings.Markup ("]"));
- }
- if (settings.IncludeAccessor) {
- result.Append (settings.Markup (" {"));
- if (property.CanGet)
- result.Append (settings.Markup (" get;"));
- if (property.CanSet)
- result.Append (settings.Markup (" set;"));
- result.Append (settings.Markup (" }"));
- }
- return result.ToString ();
- }
-
- protected override string GetParameterString (IParameterizedMember member, IParameter parameter, OutputSettings settings)
- {
- if (parameter == null)
- return "";
- var result = new StringBuilder ();
- if (settings.IncludeParameterName) {
- if (settings.IncludeModifiers) {
- if (parameter.IsOut) {
- result.Append (settings.EmitKeyword ("out"));
- }
- if (parameter.IsRef) {
- result.Append (settings.EmitKeyword ("ref"));
- }
- if (parameter.IsParams) {
- result.Append (settings.EmitKeyword ("params"));
- }
- }
-
- result.Append (GetTypeReferenceString (parameter.Type, settings));
- result.Append (" ");
-
- if (settings.HighlightName) {
- result.Append (settings.EmitName (parameter, settings.Highlight (Format (FilterName (parameter.Name)))));
- } else {
- result.Append (settings.EmitName (parameter, Format (FilterName (parameter.Name))));
- }
- } else {
- result.Append (GetTypeReferenceString (parameter.Type, settings));
- }
- return result.ToString ();
- }
-
- #endregion
-
- void AppendExplicitInterfaces (StringBuilder sb, IMember member, OutputSettings settings)
- {
- if (member == null || !member.IsExplicitInterfaceImplementation)
- return;
- foreach (var implementedInterfaceMember in member.ImplementedInterfaceMembers) {
- if (settings.UseFullName) {
- sb.Append (Format (implementedInterfaceMember.DeclaringTypeDefinition.FullName));
- } else {
- sb.Append (Format (implementedInterfaceMember.DeclaringTypeDefinition.Name));
- }
- sb.Append (settings.Markup ("."));
- }
- }
-
- void AppendParameterList (StringBuilder result, OutputSettings settings, IEnumerable<IParameter> parameterList)
- {
- if (parameterList == null)
- return;
-
- bool first = true;
- foreach (var parameter in parameterList) {
- if (!first)
- result.Append (settings.Markup (", "));
- AppendParameter (settings, result, parameter);
- first = false;
- }
- }
-
- void AppendParameter (OutputSettings settings, StringBuilder result, IParameter parameter)
- {
- if (parameter == null)
- return;
- if (parameter.IsOut) {
- result.Append (settings.Markup ("out"));
- result.Append (settings.Markup (" "));
- } else if (parameter.IsRef) {
- result.Append (settings.Markup ("ref"));
- result.Append (settings.Markup (" "));
- } else if (parameter.IsParams) {
- result.Append (settings.Markup ("params"));
- result.Append (settings.Markup (" "));
- }
- result.Append (GetParameterString (null, parameter, settings));
- }
-
- void AppendModifiers (StringBuilder result, OutputSettings settings, IEntity entity)
- {
- if (!settings.IncludeModifiers)
- return;
- if (entity.IsStatic)
- result.Append (settings.EmitModifiers ("static"));
- if (entity.IsSealed)
- result.Append (settings.EmitModifiers ("sealed"));
- if (entity.IsAbstract)
- result.Append (settings.EmitModifiers ("abstract"));
- if (entity.IsShadowing)
- result.Append (settings.EmitModifiers ("new"));
-
- switch (entity.Accessibility) {
- case Accessibility.Internal:
- result.Append (settings.EmitModifiers ("internal"));
- break;
- case Accessibility.ProtectedAndInternal:
- result.Append (settings.EmitModifiers ("protected internal"));
- break;
- case Accessibility.ProtectedOrInternal:
- result.Append (settings.EmitModifiers ("internal protected"));
- break;
- case Accessibility.Protected:
- result.Append (settings.EmitModifiers ("protected"));
- break;
- case Accessibility.Private:
- result.Append (settings.EmitModifiers ("private"));
- break;
- case Accessibility.Public:
- result.Append (settings.EmitModifiers ("public"));
- break;
- }
- }
+// }
+//
+// if (!settings.IncludeReturnType && settings.UseFullName) {
+// result.Append (GetTypeReferenceString (method.DeclaringTypeDefinition, new OutputSettings (OutputFlags.UseFullName)));
+// result.Append (settings.Markup ("."));
+// }
+// AppendExplicitInterfaces (result, method, settings);
+// if (method.SymbolKind == SymbolKind.Operator) {
+// result.Append ("operator ");
+// result.Append (settings.Markup (GetOperator (methodName)));
+// } else {
+// result.Append (methodName);
+// }
+//
+// if (settings.IncludeGenerics) {
+// if (method.TypeParameters.Count > 0) {
+// result.Append (settings.Markup ("<"));
+// for (int i = 0; i < method.TypeParameters.Count; i++) {
+// if (i > 0)
+// result.Append (settings.Markup (settings.HideGenericParameterNames ? "," : ", "));
+// if (!settings.HideGenericParameterNames) {
+// AppendVariance (result, method.TypeParameters [i].Variance);
+// result.Append (NetToCSharpTypeName (method.TypeParameters [i].Name));
+// }
+// }
+// result.Append (settings.Markup (">"));
+// }
+// }
+//
+// if (settings.IncludeParameters) {
+//// CSharpFormattingPolicy policy = GetPolicy (settings);
+//// if (policy.BeforeMethodCallParentheses)
+//// result.Append (settings.Markup (" "));
+// result.Append (settings.Markup ("("));
+// AppendParameterList (result, settings, method.Parameters);
+// result.Append (settings.Markup (")"));
+// }
+//
+// if (settings.CompletionListFomat && settings.IncludeReturnType && getReturnType) {
+// result.Append (settings.Markup (" : "));
+// result.Append (GetTypeReferenceString (method.ReturnType, settings));
+// }
+//
+//// OutputConstraints (result, settings, method.TypeParameters);
+//
+// return result.ToString ();
+// }
+//
+// protected override string GetMethodString (IMethod method, OutputSettings settings)
+// {
+// return InternalGetMethodString (method, settings, settings.EmitName (method, Format (FilterName (method.SymbolKind == SymbolKind.Constructor || method.SymbolKind == SymbolKind.Destructor ? method.DeclaringTypeDefinition.Name : method.Name))), true);
+// }
+//
+// protected override string GetConstructorString (IMethod method, OutputSettings settings)
+// {
+// return InternalGetMethodString (method, settings, settings.EmitName (method, Format (FilterName (method.DeclaringTypeDefinition != null ? method.DeclaringTypeDefinition.Name : method.Name))), false);
+// }
+//
+// protected override string GetDestructorString (IMethod method, OutputSettings settings)
+// {
+// return InternalGetMethodString (method, settings, settings.EmitName (method, settings.Markup ("~") + Format (FilterName (method.DeclaringTypeDefinition != null ? method.DeclaringTypeDefinition.Name : method.Name))), false);
+// }
+//
+// protected override string GetOperatorString (IMethod method, OutputSettings settings)
+// {
+// return InternalGetMethodString (method, settings, settings.EmitName (method, Format (FilterName (method.Name))), true);
+// }
+//
+// protected override string GetFieldString (IField field, OutputSettings settings)
+// {
+// if (field == null)
+// return "";
+// var result = new StringBuilder ();
+// bool isEnum = field.DeclaringTypeDefinition != null && field.DeclaringTypeDefinition.Kind == TypeKind.Enum;
+// AppendModifiers (result, settings, field);
+//
+// if (!settings.CompletionListFomat && settings.IncludeReturnType && !isEnum) {
+// result.Append (GetTypeReferenceString (field.ReturnType, settings));
+// result.Append (settings.Markup (" "));
+// }
+//
+// if (!settings.IncludeReturnType && settings.UseFullName) {
+// result.Append (GetTypeReferenceString (field.DeclaringTypeDefinition, settings));
+// result.Append (settings.Markup ("."));
+// }
+// result.Append (settings.EmitName (field, FilterName (Format (field.Name))));
+//
+// if (settings.CompletionListFomat && settings.IncludeReturnType && !isEnum) {
+// result.Append (settings.Markup (" : "));
+// result.Append (GetTypeReferenceString (field.ReturnType, settings));
+// }
+// return result.ToString ();
+// }
+//
+// protected override string GetEventString (IEvent evt, OutputSettings settings)
+// {
+// if (evt == null)
+// return "";
+// var result = new StringBuilder ();
+// AppendModifiers (result, settings, evt);
+// if (settings.IncludeKeywords)
+// result.Append (settings.EmitKeyword ("event"));
+// if (!settings.CompletionListFomat && settings.IncludeReturnType) {
+// result.Append (GetTypeReferenceString (evt.ReturnType, settings));
+// result.Append (settings.Markup (" "));
+// }
+//
+// if (!settings.IncludeReturnType && settings.UseFullName) {
+// result.Append (GetTypeReferenceString (evt.DeclaringTypeDefinition, new OutputSettings (OutputFlags.UseFullName)));
+// result.Append (settings.Markup ("."));
+// }
+//
+// AppendExplicitInterfaces (result, evt, settings);
+// result.Append (settings.EmitName (evt, Format (FilterName (evt.Name))));
+//
+// if (settings.CompletionListFomat && settings.IncludeReturnType) {
+// result.Append (settings.Markup (" : "));
+// result.Append (GetTypeReferenceString (evt.ReturnType, settings));
+// }
+// return result.ToString ();
+// }
+//
+// protected override string GetPropertyString (IProperty property, OutputSettings settings)
+// {
+// if (property == null)
+// return "";
+// var result = new StringBuilder ();
+// AppendModifiers (result, settings, property);
+// if (!settings.CompletionListFomat && settings.IncludeReturnType) {
+// result.Append (GetTypeReferenceString (property.ReturnType, settings));
+// result.Append (settings.Markup (" "));
+// }
+//
+// if (!settings.IncludeReturnType && settings.UseFullName) {
+// result.Append (GetTypeReferenceString (property.DeclaringTypeDefinition, new OutputSettings (OutputFlags.UseFullName)));
+// result.Append (settings.Markup ("."));
+// }
+//
+// AppendExplicitInterfaces (result, property, settings);
+//
+// if (property.SymbolKind == SymbolKind.Indexer) {
+// result.Append (settings.EmitName (property, "this"));
+// } else {
+// result.Append (settings.EmitName (property, Format (FilterName (property.Name))));
+// }
+//
+// if (settings.IncludeParameters && property.Parameters.Count > 0) {
+// result.Append (settings.Markup ("["));
+// AppendParameterList (result, settings, property.Parameters);
+// result.Append (settings.Markup ("]"));
+// }
+//
+// if (settings.CompletionListFomat && settings.IncludeReturnType) {
+// result.Append (settings.Markup (" : "));
+// result.Append (GetTypeReferenceString (property.ReturnType, settings));
+// }
+//
+// if (settings.IncludeAccessor) {
+// result.Append (settings.Markup (" {"));
+// if (property.CanGet)
+// result.Append (settings.Markup (" get;"));
+// if (property.CanSet)
+// result.Append (settings.Markup (" set;"));
+// result.Append (settings.Markup (" }"));
+// }
+//
+// return result.ToString ();
+// }
+//
+// protected override string GetIndexerString (IProperty property, OutputSettings settings)
+// {
+// if (property == null)
+// return "";
+// var result = new StringBuilder ();
+//
+// AppendModifiers (result, settings, property);
+//
+// if (settings.IncludeReturnType) {
+// result.Append (GetTypeReferenceString (property.ReturnType, settings));
+// result.Append (settings.Markup (" "));
+// }
+//
+// if (!settings.IncludeReturnType && settings.UseFullName) {
+// result.Append (GetTypeReferenceString (property.DeclaringTypeDefinition, new OutputSettings (OutputFlags.UseFullName)));
+// result.Append (settings.Markup ("."));
+// }
+//
+// AppendExplicitInterfaces (result, property, settings);
+//
+// result.Append (settings.EmitName (property, Format ("this")));
+//
+// if (settings.IncludeParameters && property.Getter.Parameters.Count > 0) {
+// result.Append (settings.Markup ("["));
+// AppendParameterList (result, settings, property.Getter.Parameters);
+// result.Append (settings.Markup ("]"));
+// }
+// if (settings.IncludeAccessor) {
+// result.Append (settings.Markup (" {"));
+// if (property.CanGet)
+// result.Append (settings.Markup (" get;"));
+// if (property.CanSet)
+// result.Append (settings.Markup (" set;"));
+// result.Append (settings.Markup (" }"));
+// }
+// return result.ToString ();
+// }
+//
+// protected override string GetParameterString (IParameterizedMember member, IParameter parameter, OutputSettings settings)
+// {
+// if (parameter == null)
+// return "";
+// var result = new StringBuilder ();
+// if (settings.IncludeParameterName) {
+// if (settings.IncludeModifiers) {
+// if (parameter.IsOut) {
+// result.Append (settings.EmitKeyword ("out"));
+// }
+// if (parameter.IsRef) {
+// result.Append (settings.EmitKeyword ("ref"));
+// }
+// if (parameter.IsParams) {
+// result.Append (settings.EmitKeyword ("params"));
+// }
+// }
+//
+// result.Append (GetTypeReferenceString (parameter.Type, settings));
+// result.Append (" ");
+//
+// if (settings.HighlightName) {
+// result.Append (settings.EmitName (parameter, settings.Highlight (Format (FilterName (parameter.Name)))));
+// } else {
+// result.Append (settings.EmitName (parameter, Format (FilterName (parameter.Name))));
+// }
+// } else {
+// result.Append (GetTypeReferenceString (parameter.Type, settings));
+// }
+// return result.ToString ();
+// }
+//
+// #endregion
+//
+// void AppendExplicitInterfaces (StringBuilder sb, IMember member, OutputSettings settings)
+// {
+// if (member == null || !member.IsExplicitInterfaceImplementation)
+// return;
+// foreach (var implementedInterfaceMember in member.ImplementedInterfaceMembers) {
+// if (settings.UseFullName) {
+// sb.Append (Format (implementedInterfaceMember.DeclaringTypeDefinition.FullName));
+// } else {
+// sb.Append (Format (implementedInterfaceMember.DeclaringTypeDefinition.Name));
+// }
+// sb.Append (settings.Markup ("."));
+// }
+// }
+//
+// void AppendParameterList (StringBuilder result, OutputSettings settings, IEnumerable<IParameter> parameterList)
+// {
+// if (parameterList == null)
+// return;
+//
+// bool first = true;
+// foreach (var parameter in parameterList) {
+// if (!first)
+// result.Append (settings.Markup (", "));
+// AppendParameter (settings, result, parameter);
+// first = false;
+// }
+// }
+//
+// void AppendParameter (OutputSettings settings, StringBuilder result, IParameter parameter)
+// {
+// if (parameter == null)
+// return;
+// if (parameter.IsOut) {
+// result.Append (settings.Markup ("out"));
+// result.Append (settings.Markup (" "));
+// } else if (parameter.IsRef) {
+// result.Append (settings.Markup ("ref"));
+// result.Append (settings.Markup (" "));
+// } else if (parameter.IsParams) {
+// result.Append (settings.Markup ("params"));
+// result.Append (settings.Markup (" "));
+// }
+// result.Append (GetParameterString (null, parameter, settings));
+// }
+//
+// void AppendModifiers (StringBuilder result, OutputSettings settings, IEntity entity)
+// {
+// if (!settings.IncludeModifiers)
+// return;
+// if (entity.IsStatic)
+// result.Append (settings.EmitModifiers ("static"));
+// if (entity.IsSealed)
+// result.Append (settings.EmitModifiers ("sealed"));
+// if (entity.IsAbstract)
+// result.Append (settings.EmitModifiers ("abstract"));
+// if (entity.IsShadowing)
+// result.Append (settings.EmitModifiers ("new"));
+//
+// switch (entity.Accessibility) {
+// case Accessibility.Internal:
+// result.Append (settings.EmitModifiers ("internal"));
+// break;
+// case Accessibility.ProtectedAndInternal:
+// result.Append (settings.EmitModifiers ("protected internal"));
+// break;
+// case Accessibility.ProtectedOrInternal:
+// result.Append (settings.EmitModifiers ("internal protected"));
+// break;
+// case Accessibility.Protected:
+// result.Append (settings.EmitModifiers ("protected"));
+// break;
+// case Accessibility.Private:
+// result.Append (settings.EmitModifiers ("private"));
+// break;
+// case Accessibility.Public:
+// result.Append (settings.EmitModifiers ("public"));
+// break;
+// }
+// }
}
-
+
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpBindingCompilerManager.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpBindingCompilerManager.cs
index bccfa8df4d..e26077f81e 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpBindingCompilerManager.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpBindingCompilerManager.cs
@@ -55,10 +55,10 @@ namespace MonoDevelop.CSharp
sb.AppendLine ();
}
- public static BuildResult Compile (ProjectItemCollection projectItems, DotNetProjectConfiguration configuration, ConfigurationSelector configSelector, IProgressMonitor monitor)
+ public static BuildResult Compile (ProjectItemCollection projectItems, DotNetProjectConfiguration configuration, ConfigurationSelector configSelector, ProgressMonitor monitor)
{
var compilerParameters = (CSharpCompilerParameters)configuration.CompilationParameters ?? new CSharpCompilerParameters ();
- var projectParameters = (CSharpProjectParameters)configuration.ProjectParameters ?? new CSharpProjectParameters ();
+ var projectParameters = (CSharpProject) configuration.ParentItem;
FilePath outputName = configuration.CompiledOutputName;
string responseFileName = Path.GetTempFileName ();
@@ -127,7 +127,7 @@ namespace MonoDevelop.CSharp
var ownerProject = lib.OwnerProject;
if (ownerProject != null) {
var parentSolution = ownerProject.ParentSolution;
- if (parentSolution != null && !(parentSolution.FindProjectByName (lib.Reference) is DotNetProject))
+ if (parentSolution != null && !(lib.ResolveProject (parentSolution) is DotNetProject))
continue;
}
}
@@ -192,9 +192,9 @@ namespace MonoDevelop.CSharp
sb.AppendLine ("/delaySign");
}
- var debugType = compilerParameters.DebugType;
+ var debugType = configuration.DebugType;
if (string.IsNullOrEmpty (debugType)) {
- debugType = configuration.DebugMode ? "full" : "none";
+ debugType = configuration.DebugSymbols ? "full" : "none";
} else if (string.Equals (debugType, "pdbonly", StringComparison.OrdinalIgnoreCase)) {
//old Mono compilers don't support pdbonly
if (monoRuntime != null && !monoRuntime.HasMultitargetingMcs)
@@ -418,7 +418,7 @@ namespace MonoDevelop.CSharp
return result;
}
- static int DoCompilation (IProgressMonitor monitor, string compilerName, string compilerArgs, string working_dir, ExecutionEnvironment envVars, List<string> gacRoots, ref string output, ref string error)
+ static int DoCompilation (ProgressMonitor monitor, string compilerName, string compilerArgs, string working_dir, ExecutionEnvironment envVars, List<string> gacRoots, ref string output, ref string error)
{
output = Path.GetTempFileName ();
error = Path.GetTempFileName ();
@@ -448,9 +448,9 @@ namespace MonoDevelop.CSharp
pinfo.RedirectStandardOutput = true;
pinfo.RedirectStandardError = true;
- MonoDevelop.Core.Execution.ProcessWrapper pw = Runtime.ProcessService.StartProcess (pinfo, outwr, errwr, null);
- using (var mon = new AggregatedOperationMonitor (monitor, pw)) {
- pw.WaitForOutput ();
+ ProcessWrapper pw = Runtime.ProcessService.StartProcess (pinfo, outwr, errwr, null);
+ using (monitor.CancellationToken.Register (pw.Cancel)) {
+ pw.Task.Wait ();
}
int exitCode = pw.ExitCode;
bool cancelRequested = pw.CancelRequested;
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpBraceMatcher.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpBraceMatcher.cs
new file mode 100644
index 0000000000..8c40777e35
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpBraceMatcher.cs
@@ -0,0 +1,134 @@
+//
+// CSharpBraceMatcher.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.CSharp.Formatting;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using MonoDevelop.Core.Text;
+using MonoDevelop.CSharp.Completion;
+
+namespace MonoDevelop.CSharp
+{
+ sealed class CSharpBraceMatcher : AbstractBraceMatcher
+ {
+ readonly static AbstractBraceMatcher fallback = new DefaultBraceMatcher ();
+ readonly static SyntaxKind [] tokenPairs = {
+ SyntaxKind.OpenBraceToken, SyntaxKind.CloseBraceToken,
+ SyntaxKind.OpenBracketToken, SyntaxKind.CloseBracketToken,
+ SyntaxKind.LessThanToken, SyntaxKind.GreaterThanToken,
+ SyntaxKind.OpenParenToken, SyntaxKind.CloseParenToken
+ };
+
+ public override bool CanHandle (TextEditor editor)
+ {
+ return editor.MimeType == CSharpFormatter.MimeType;
+ }
+
+ public override async Task<BraceMatchingResult?> GetMatchingBracesAsync (IReadonlyTextDocument editor, DocumentContext context, int offset, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (context.ParsedDocument == null)
+ return await fallback.GetMatchingBracesAsync (editor, context, offset, cancellationToken);
+
+ var analysisDocument = context.AnalysisDocument;
+ if (analysisDocument == null)
+ return null;
+ var partialDoc = await CSharpCompletionTextEditorExtension.WithFrozenPartialSemanticsAsync (analysisDocument, cancellationToken).ConfigureAwait (false);
+ var root = await partialDoc.GetSyntaxRootAsync (cancellationToken).ConfigureAwait (false);
+ if (offset < 0 || root.Span.End <= offset)
+ return null;
+ var token = root.FindToken (offset);
+ var tokenSpan = token.Span;
+ if (offset < tokenSpan.Start || offset >= tokenSpan.End)
+ return null;
+ for (int i = 0; i < tokenPairs.Length / 2; i++) {
+ var open = tokenPairs [i * 2];
+ var close = tokenPairs [i * 2 + 1];
+ SyntaxToken match;
+ if (token.IsKind (open)) {
+ if (TryFindMatchingToken (token, out match, open, close)) {
+ return new BraceMatchingResult (new TextSegment (tokenSpan.Start, tokenSpan.Length), new TextSegment (match.Span.Start, match.Span.Length), true);
+ }
+ } else if (token.IsKind (close)) {
+ if (TryFindMatchingToken (token, out match, open, close)) {
+ return new BraceMatchingResult (new TextSegment (match.Span.Start, match.Span.Length), new TextSegment (tokenSpan.Start, tokenSpan.Length), false);
+ }
+ }
+ }
+
+ if (token.IsKind (SyntaxKind.StringLiteralToken) && token.ToString().EndsWith ("\"", StringComparison.Ordinal)) {
+ if (token.IsVerbatimStringLiteral ()) {
+ if (offset <= tokenSpan.Start)
+ return new BraceMatchingResult (new TextSegment (tokenSpan.Start, 2), new TextSegment (tokenSpan.End - 1, 1), true);
+ if (offset >= tokenSpan.End - 1)
+ return new BraceMatchingResult (new TextSegment (tokenSpan.Start, 2), new TextSegment (tokenSpan.End - 1, 1), false);
+ } else {
+ if (offset <= tokenSpan.Start)
+ return new BraceMatchingResult (new TextSegment (tokenSpan.Start, 1), new TextSegment (tokenSpan.End - 1, 1), true);
+ if (offset >= tokenSpan.End - 1)
+ return new BraceMatchingResult (new TextSegment (tokenSpan.Start, 1), new TextSegment (tokenSpan.End - 1, 1), false);
+ }
+ }
+
+ if (token.IsKind (SyntaxKind.CharacterLiteralToken) && token.ToString().EndsWith ("\'", StringComparison.Ordinal)) {
+ if (offset <= tokenSpan.Start)
+ return new BraceMatchingResult (new TextSegment (tokenSpan.Start, 1), new TextSegment (tokenSpan.End - 1, 1), true);
+ if (offset >= tokenSpan.End - 1)
+ return new BraceMatchingResult (new TextSegment (tokenSpan.Start, 1), new TextSegment (tokenSpan.End - 1, 1), false);
+ }
+
+ return null;
+ }
+
+ bool TryFindMatchingToken (SyntaxToken token, out SyntaxToken match, SyntaxKind openKind, SyntaxKind closeKind)
+ {
+ var parent = token.Parent;
+
+ var braceTokens = parent
+ .ChildTokens ()
+ .Where (t => t.Span.Length > 0 && (t.IsKind (openKind) || t.IsKind (closeKind)))
+ .ToList ();
+
+ if (braceTokens.Count == 2 &&
+ braceTokens [0].IsKind (openKind) &&
+ braceTokens [1].IsKind (closeKind)) {
+ if (braceTokens [0] == token) {
+ match = braceTokens [1];
+ return true;
+ } else if (braceTokens [1] == token) {
+ match = braceTokens [0];
+ return true;
+ }
+ }
+
+ match = default(SyntaxToken);
+ return false;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpLanguageBinding.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpLanguageBinding.cs
deleted file mode 100644
index 968bb4af36..0000000000
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpLanguageBinding.cs
+++ /dev/null
@@ -1,149 +0,0 @@
-//
-// CSharpBindingCompilerManager.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.IO;
-using System.Diagnostics;
-using System.Collections;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Resources;
-using System.Xml;
-using System.CodeDom.Compiler;
-using System.Threading;
-using Microsoft.CSharp;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Core;
-using MonoDevelop.Core.Instrumentation;
-
-using MonoDevelop.CSharp.Parser;
-using ICSharpCode.NRefactory.CSharp;
-using MonoDevelop.CSharp.Formatting;
-using MonoDevelop.CSharp.Project;
-
-namespace MonoDevelop.CSharp
-{
- class CSharpLanguageBinding : IDotNetLanguageBinding
- {
- CSharpCodeProvider provider;
-
- // Keep the platforms combo of CodeGenerationPanelWidget in sync with this list
- public static IList<string> SupportedPlatforms = new string[] { "anycpu", "x86", "x64", "itanium" };
-
- public string Language {
- get {
- return "C#";
- }
- }
-
- public string ProjectStockIcon {
- get {
- return "md-csharp-project";
- }
- }
-
-
- public bool IsSourceCodeFile (FilePath fileName)
- {
- return StringComparer.OrdinalIgnoreCase.Equals (Path.GetExtension (fileName), ".cs");
- }
-
- public BuildResult Compile (ProjectItemCollection projectItems, DotNetProjectConfiguration configuration, ConfigurationSelector configSelector, IProgressMonitor monitor)
- {
- return CSharpBindingCompilerManager.Compile (projectItems, configuration, configSelector, monitor);
- }
-
- public ConfigurationParameters CreateCompilationParameters (XmlElement projectOptions)
- {
- CSharpCompilerParameters pars = new CSharpCompilerParameters ();
- if (projectOptions != null) {
- string platform = projectOptions.GetAttribute ("Platform");
- if (SupportedPlatforms.Contains (platform))
- pars.PlatformTarget = platform;
- string debugAtt = projectOptions.GetAttribute ("DefineDebug");
- if (string.Compare ("True", debugAtt, StringComparison.OrdinalIgnoreCase) == 0) {
- pars.AddDefineSymbol ("DEBUG");
- pars.DebugType = "full";
- }
- string releaseAtt = projectOptions.GetAttribute ("Release");
- if (string.Compare ("True", releaseAtt, StringComparison.OrdinalIgnoreCase) == 0)
- pars.Optimize = true;
- }
- return pars;
- }
-
- public ProjectParameters CreateProjectParameters (XmlElement projectOptions)
- {
- return new CSharpProjectParameters ();
- }
-
- public string SingleLineCommentTag { get { return "//"; } }
- public string BlockCommentStartTag { get { return "/*"; } }
- public string BlockCommentEndTag { get { return "*/"; } }
-
- public CodeDomProvider GetCodeDomProvider ()
- {
- if (provider == null)
- provider = new CSharpEnhancedCodeProvider ();
- return provider;
- }
-
- public FilePath GetFileName (FilePath baseName)
- {
- return baseName + ".cs";
- }
-
-// public IParser Parser {
-// get {
-// return null;
-// }
-// }
-//
-// CSharpRefactorer refactorer = new CSharpRefactorer ();
-// public IRefactorer Refactorer {
-// get {
-// return refactorer;
-// }
-// }
-
- public ClrVersion[] GetSupportedClrVersions ()
- {
- return new ClrVersion[] {
- ClrVersion.Net_1_1,
- ClrVersion.Net_2_0,
- ClrVersion.Clr_2_1,
- ClrVersion.Net_4_0,
- ClrVersion.Net_4_5
- };
- }
- }
-
- internal static class Counters
- {
- public static Counter ResolveTime = InstrumentationService.CreateCounter ("Resolve Time", "Timing");
- }
-}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpNavigationTextEditorExtension.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpNavigationTextEditorExtension.cs
new file mode 100644
index 0000000000..901ac3677b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/CSharpNavigationTextEditorExtension.cs
@@ -0,0 +1,142 @@
+//
+// CSharpNavigationTextEditorExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Ide.Editor.Extension;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using MonoDevelop.Ide;
+using MonoDevelop.Ide.Editor;
+using System.Linq;
+using MonoDevelop.Refactoring;
+
+namespace MonoDevelop.CSharp
+{
+ class CSharpNavigationTextEditorExtension : AbstractNavigationExtension
+ {
+ static List<NavigationSegment> emptyList = new List<NavigationSegment> ();
+
+ protected override async Task<IEnumerable<NavigationSegment>> RequestLinksAsync (int offset, int length, CancellationToken token)
+ {
+ var parsedDocument = DocumentContext.ParsedDocument;
+ if (parsedDocument == null)
+ return Enumerable.Empty<NavigationSegment> ();
+ var model = parsedDocument.GetAst<SemanticModel> ();
+ if (model == null)
+ return Enumerable.Empty<NavigationSegment> ();
+ return await Task.Run (async delegate {
+ try {
+ var visitor = new NavigationVisitor (DocumentContext, model, new TextSpan (offset, length), token);
+ visitor.Visit (await model.SyntaxTree.GetRootAsync (token).ConfigureAwait (false));
+ return (IEnumerable<NavigationSegment>)visitor.result;
+ } catch (OperationCanceledException) {
+ return (IEnumerable<NavigationSegment>)emptyList;
+ }
+ });
+ }
+
+ class NavigationVisitor : CSharpSyntaxWalker
+ {
+ SemanticModel model;
+ internal List<NavigationSegment> result = new List<NavigationSegment> ();
+
+ TextSpan region;
+ DocumentContext documentContext;
+ CancellationToken token;
+
+ public NavigationVisitor (DocumentContext documentContext, SemanticModel model, TextSpan region, CancellationToken token)
+ {
+ this.documentContext = documentContext;
+ this.model = model;
+ this.region = region;
+ this.token = token;
+ }
+
+ public override void VisitCompilationUnit (CompilationUnitSyntax node)
+ {
+ var startNode = node.DescendantNodesAndSelf (n => region.Start <= n.SpanStart).FirstOrDefault ();
+ if (startNode == node || startNode == null) {
+ base.VisitCompilationUnit (node);
+ } else {
+ this.Visit (startNode);
+ }
+ }
+
+ public override void Visit (SyntaxNode node)
+ {
+ if (node.Span.End < region.Start)
+ return;
+ if (node.Span.Start > region.End)
+ return;
+ base.Visit(node);
+ }
+
+ public override void VisitIdentifierName (IdentifierNameSyntax node)
+ {
+ var info = model.GetSymbolInfo (node);
+ if (IsNavigatable (info)) {
+ result.Add (new NavigationSegment (node.Span.Start, node.Span.Length, delegate {
+ GLib.Timeout.Add (50, delegate {
+ RefactoringService.RoslynJumpToDeclaration (info.Symbol, documentContext.Project);
+ return false;
+ });
+ }));
+ }
+ }
+
+ static bool IsNavigatable (SymbolInfo info)
+ {
+ return info.Symbol != null && info.Symbol.Kind != SymbolKind.Namespace;
+ }
+
+ public override void VisitMemberAccessExpression (MemberAccessExpressionSyntax node)
+ {
+ var info = model.GetSymbolInfo (node);
+ if (IsNavigatable(info)) {
+ result.Add (new NavigationSegment (node.Name.Span.Start, node.Name.Span.Length, delegate {
+ GLib.Timeout.Add (50, delegate {
+ RefactoringService.RoslynJumpToDeclaration (info.Symbol, documentContext.Project);
+ return false;
+ });
+ }));
+ }
+
+ base.VisitMemberAccessExpression (node);
+ }
+
+ public override void VisitBlock (BlockSyntax node)
+ {
+ token.ThrowIfCancellationRequested ();
+ base.VisitBlock (node);
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/DeclaredSymbolInfo.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/DeclaredSymbolInfo.cs
new file mode 100644
index 0000000000..49037adae3
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/DeclaredSymbolInfo.cs
@@ -0,0 +1,560 @@
+//
+// DeclaredSymbolInfo.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using System;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.Diagnostics;
+using System.Text;
+using System.Collections.Generic;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Core;
+using Gtk;
+using MonoDevelop.Ide;
+using MonoDevelop.CSharp;
+using MonoDevelop.Components.MainToolbar;
+using MonoDevelop.Refactoring;
+
+namespace MonoDevelop.CSharp
+{
+ static class DeclaredSymbolInfoHelpers
+ {
+ public static bool TryGetDeclaredSymbolInfo(this SyntaxNode node, out DeclaredSymbolInfo declaredSymbolInfo)
+ {
+ switch (node.Kind())
+ {
+ case SyntaxKind.ClassDeclaration:
+ var classDecl = (ClassDeclarationSyntax)node;
+ declaredSymbolInfo = new DeclaredSymbolInfo(node,
+ classDecl.Identifier.ValueText,
+ // GetContainerDisplayName(node.Parent),
+ GetFullyQualifiedContainerName(node.Parent),
+ DeclaredSymbolInfoKind.Class, classDecl.Identifier.Span);
+ return true;
+ case SyntaxKind.ConstructorDeclaration:
+ var ctorDecl = (ConstructorDeclarationSyntax)node;
+ declaredSymbolInfo = new DeclaredSymbolInfo(
+ node,
+ ctorDecl.Identifier.ValueText,
+ // GetContainerDisplayName(node.Parent),
+ GetFullyQualifiedContainerName(node.Parent),
+ DeclaredSymbolInfoKind.Constructor,
+ ctorDecl.Identifier.Span,
+ parameterCount: (ushort)(ctorDecl.ParameterList?.Parameters.Count ?? 0));
+ return true;
+ case SyntaxKind.DelegateDeclaration:
+ var delegateDecl = (DelegateDeclarationSyntax)node;
+ declaredSymbolInfo = new DeclaredSymbolInfo(node,
+ delegateDecl.Identifier.ValueText,
+ // GetContainerDisplayName(node.Parent),
+ GetFullyQualifiedContainerName(node.Parent),
+ DeclaredSymbolInfoKind.Delegate, delegateDecl.Identifier.Span);
+ return true;
+ case SyntaxKind.EnumDeclaration:
+ var enumDecl = (EnumDeclarationSyntax)node;
+ declaredSymbolInfo = new DeclaredSymbolInfo(node,
+ enumDecl.Identifier.ValueText,
+ // GetContainerDisplayName(node.Parent),
+ GetFullyQualifiedContainerName(node.Parent),
+ DeclaredSymbolInfoKind.Enum, enumDecl.Identifier.Span);
+ return true;
+ case SyntaxKind.EnumMemberDeclaration:
+ var enumMember = (EnumMemberDeclarationSyntax)node;
+ declaredSymbolInfo = new DeclaredSymbolInfo(node,
+ enumMember.Identifier.ValueText,
+ // GetContainerDisplayName(node.Parent),
+ GetFullyQualifiedContainerName(node.Parent),
+ DeclaredSymbolInfoKind.EnumMember, enumMember.Identifier.Span);
+ return true;
+ case SyntaxKind.EventDeclaration:
+ var eventDecl = (EventDeclarationSyntax)node;
+ declaredSymbolInfo = new DeclaredSymbolInfo(node,
+ ExpandExplicitInterfaceName(eventDecl.Identifier.ValueText, eventDecl.ExplicitInterfaceSpecifier),
+ // GetContainerDisplayName(node.Parent),
+ GetFullyQualifiedContainerName(node.Parent),
+ DeclaredSymbolInfoKind.Event, eventDecl.Identifier.Span);
+ return true;
+ case SyntaxKind.IndexerDeclaration:
+ var indexerDecl = (IndexerDeclarationSyntax)node;
+ declaredSymbolInfo = new DeclaredSymbolInfo(node,
+ WellKnownMemberNames.Indexer,
+ // GetContainerDisplayName(node.Parent),
+ GetFullyQualifiedContainerName(node.Parent),
+ DeclaredSymbolInfoKind.Indexer, indexerDecl.ThisKeyword.Span);
+ return true;
+ case SyntaxKind.InterfaceDeclaration:
+ var interfaceDecl = (InterfaceDeclarationSyntax)node;
+ declaredSymbolInfo = new DeclaredSymbolInfo(node,
+ interfaceDecl.Identifier.ValueText,
+ // GetContainerDisplayName(node.Parent),
+ GetFullyQualifiedContainerName(node.Parent),
+ DeclaredSymbolInfoKind.Interface, interfaceDecl.Identifier.Span);
+ return true;
+ case SyntaxKind.MethodDeclaration:
+ var method = (MethodDeclarationSyntax)node;
+ declaredSymbolInfo = new DeclaredSymbolInfo(node,
+ ExpandExplicitInterfaceName(method.Identifier.ValueText, method.ExplicitInterfaceSpecifier),
+ // GetContainerDisplayName(node.Parent),
+ GetFullyQualifiedContainerName(node.Parent),
+ DeclaredSymbolInfoKind.Method,
+ method.Identifier.Span,
+ parameterCount: (ushort)(method.ParameterList?.Parameters.Count ?? 0),
+ typeParameterCount: (ushort)(method.TypeParameterList?.Parameters.Count ?? 0));
+ return true;
+ case SyntaxKind.PropertyDeclaration:
+ var property = (PropertyDeclarationSyntax)node;
+ declaredSymbolInfo = new DeclaredSymbolInfo(node,
+ ExpandExplicitInterfaceName(property.Identifier.ValueText, property.ExplicitInterfaceSpecifier),
+ // GetContainerDisplayName(node.Parent),
+ GetFullyQualifiedContainerName(node.Parent),
+ DeclaredSymbolInfoKind.Property, property.Identifier.Span);
+ return true;
+ case SyntaxKind.StructDeclaration:
+ var structDecl = (StructDeclarationSyntax)node;
+ declaredSymbolInfo = new DeclaredSymbolInfo(node,
+ structDecl.Identifier.ValueText,
+ // GetContainerDisplayName(node.Parent),
+ GetFullyQualifiedContainerName(node.Parent),
+ DeclaredSymbolInfoKind.Struct, structDecl.Identifier.Span);
+ return true;
+ case SyntaxKind.VariableDeclarator:
+ // could either be part of a field declaration or an event field declaration
+ var variableDeclarator = (VariableDeclaratorSyntax)node;
+ var variableDeclaration = variableDeclarator.Parent as VariableDeclarationSyntax;
+ var fieldDeclaration = variableDeclaration?.Parent as BaseFieldDeclarationSyntax;
+ if (fieldDeclaration != null)
+ {
+ var kind = fieldDeclaration is EventFieldDeclarationSyntax
+ ? DeclaredSymbolInfoKind.Event
+ : fieldDeclaration.Modifiers.Any(m => m.Kind() == SyntaxKind.ConstKeyword)
+ ? DeclaredSymbolInfoKind.Constant
+ : DeclaredSymbolInfoKind.Field;
+
+ declaredSymbolInfo = new DeclaredSymbolInfo(node,
+ variableDeclarator.Identifier.ValueText,
+ // GetContainerDisplayName(fieldDeclaration.Parent),
+ GetFullyQualifiedContainerName(fieldDeclaration.Parent),
+ kind, variableDeclarator.Identifier.Span);
+ return true;
+ }
+
+ break;
+ }
+
+ declaredSymbolInfo = default(DeclaredSymbolInfo);
+ return false;
+ }
+
+ private static string GetContainerDisplayName(SyntaxNode node)
+ {
+ return GetContainer(node, immediate: true);
+ }
+
+ private static string GetFullyQualifiedContainerName(SyntaxNode node)
+ {
+ return GetContainer(node, immediate: false);
+ }
+
+ private static string GetContainer(SyntaxNode node, bool immediate)
+ {
+ var name = GetNodeName(node, includeTypeParameters: immediate);
+ var names = new List<string> { name };
+
+ // check for nested classes and always add that to the container name.
+ var parent = node.Parent;
+ while (parent is TypeDeclarationSyntax)
+ {
+ var currentParent = (TypeDeclarationSyntax)parent;
+ names.Add(currentParent.Identifier.ValueText + (immediate ? ExpandTypeParameterList(currentParent.TypeParameterList) : ""));
+ parent = currentParent.Parent;
+ }
+
+ // If they're just asking for the immediate parent, then we're done. Otherwise keep
+ // walking all the way to the root, adding the names.
+ if (!immediate)
+ {
+ while (parent != null && parent.Kind() != SyntaxKind.CompilationUnit)
+ {
+ names.Add(GetNodeName(parent, includeTypeParameters: false));
+ parent = parent.Parent;
+ }
+ }
+
+ names.Reverse();
+ return string.Join(".", names);
+ }
+
+ private static string GetNodeName(SyntaxNode node, bool includeTypeParameters)
+ {
+ string name;
+ TypeParameterListSyntax typeParameterList;
+ switch (node.Kind())
+ {
+ case SyntaxKind.ClassDeclaration:
+ var classDecl = (ClassDeclarationSyntax)node;
+ name = classDecl.Identifier.ValueText;
+ typeParameterList = classDecl.TypeParameterList;
+ break;
+ case SyntaxKind.CompilationUnit:
+ return string.Empty;
+ case SyntaxKind.DelegateDeclaration:
+ var delegateDecl = (DelegateDeclarationSyntax)node;
+ name = delegateDecl.Identifier.ValueText;
+ typeParameterList = delegateDecl.TypeParameterList;
+ break;
+ case SyntaxKind.EnumDeclaration:
+ return ((EnumDeclarationSyntax)node).Identifier.ValueText;
+ case SyntaxKind.IdentifierName:
+ return ((IdentifierNameSyntax)node).Identifier.ValueText;
+ case SyntaxKind.InterfaceDeclaration:
+ var interfaceDecl = (InterfaceDeclarationSyntax)node;
+ name = interfaceDecl.Identifier.ValueText;
+ typeParameterList = interfaceDecl.TypeParameterList;
+ break;
+ case SyntaxKind.MethodDeclaration:
+ var methodDecl = (MethodDeclarationSyntax)node;
+ name = methodDecl.Identifier.ValueText;
+ typeParameterList = methodDecl.TypeParameterList;
+ break;
+ case SyntaxKind.NamespaceDeclaration:
+ return GetNodeName(((NamespaceDeclarationSyntax)node).Name, includeTypeParameters: false);
+ case SyntaxKind.QualifiedName:
+ var qualified = (QualifiedNameSyntax)node;
+ return GetNodeName(qualified.Left, includeTypeParameters: false) + "." + GetNodeName(qualified.Right, includeTypeParameters: false);
+ case SyntaxKind.StructDeclaration:
+ var structDecl = (StructDeclarationSyntax)node;
+ name = structDecl.Identifier.ValueText;
+ typeParameterList = structDecl.TypeParameterList;
+ break;
+ default:
+ Debug.Assert(false, "Unexpected node type " + node.Kind());
+ return null;
+ }
+
+ return name + (includeTypeParameters ? ExpandTypeParameterList(typeParameterList) : "");
+ }
+
+ private static string ExpandTypeParameterList(TypeParameterListSyntax typeParameterList)
+ {
+ if (typeParameterList != null && typeParameterList.Parameters.Count > 0)
+ {
+ var builder = new StringBuilder();
+ builder.Append('<');
+ builder.Append(typeParameterList.Parameters[0].Identifier.ValueText);
+ for (int i = 1; i < typeParameterList.Parameters.Count; i++)
+ {
+ builder.Append(',');
+ builder.Append(typeParameterList.Parameters[i].Identifier.ValueText);
+ }
+
+ builder.Append('>');
+ return builder.ToString();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ private static string ExpandExplicitInterfaceName(string identifier, ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifier)
+ {
+ if (explicitInterfaceSpecifier == null)
+ {
+ return identifier;
+ }
+ else
+ {
+ var builder = new StringBuilder();
+ ExpandTypeName(explicitInterfaceSpecifier.Name, builder);
+ builder.Append('.');
+ builder.Append(identifier);
+ return builder.ToString();
+ }
+ }
+
+ private static void ExpandTypeName(TypeSyntax type, StringBuilder builder)
+ {
+ switch (type.Kind())
+ {
+ case SyntaxKind.AliasQualifiedName:
+ var alias = (AliasQualifiedNameSyntax)type;
+ builder.Append(alias.Alias.Identifier.ValueText);
+ break;
+ case SyntaxKind.ArrayType:
+ var array = (ArrayTypeSyntax)type;
+ ExpandTypeName(array.ElementType, builder);
+ for (int i = 0; i < array.RankSpecifiers.Count; i++)
+ {
+ var rankSpecifier = array.RankSpecifiers[i];
+ builder.Append(rankSpecifier.OpenBracketToken.Text);
+ for (int j = 1; j < rankSpecifier.Sizes.Count; j++)
+ {
+ builder.Append(',');
+ }
+
+ builder.Append(rankSpecifier.CloseBracketToken.Text);
+ }
+
+ break;
+ case SyntaxKind.GenericName:
+ var generic = (GenericNameSyntax)type;
+ builder.Append(generic.Identifier.ValueText);
+ if (generic.TypeArgumentList != null)
+ {
+ var arguments = generic.TypeArgumentList.Arguments;
+ builder.Append(generic.TypeArgumentList.LessThanToken.Text);
+ for (int i = 0; i < arguments.Count; i++)
+ {
+ if (i != 0)
+ {
+ builder.Append(',');
+ }
+
+ ExpandTypeName(arguments[i], builder);
+ }
+
+ builder.Append(generic.TypeArgumentList.GreaterThanToken.Text);
+ }
+
+ break;
+ case SyntaxKind.IdentifierName:
+ var identifierName = (IdentifierNameSyntax)type;
+ builder.Append(identifierName.Identifier.ValueText);
+ break;
+ case SyntaxKind.NullableType:
+ var nullable = (NullableTypeSyntax)type;
+ ExpandTypeName(nullable.ElementType, builder);
+ builder.Append(nullable.QuestionToken.Text);
+ break;
+ case SyntaxKind.OmittedTypeArgument:
+ // do nothing since it was omitted, but don't reach the default block
+ break;
+ case SyntaxKind.PointerType:
+ var pointer = (PointerTypeSyntax)type;
+ ExpandTypeName(pointer.ElementType, builder);
+ builder.Append(pointer.AsteriskToken.Text);
+ break;
+ case SyntaxKind.PredefinedType:
+ var predefined = (PredefinedTypeSyntax)type;
+ builder.Append(predefined.Keyword.Text);
+ break;
+ case SyntaxKind.QualifiedName:
+ var qualified = (QualifiedNameSyntax)type;
+ ExpandTypeName(qualified.Left, builder);
+ builder.Append(qualified.DotToken.Text);
+ ExpandTypeName(qualified.Right, builder);
+ break;
+ default:
+ Debug.Assert(false, "Unexpected type syntax " + type.Kind());
+ break;
+ }
+ }
+ }
+
+ enum DeclaredSymbolInfoKind : byte
+ {
+ Class,
+ Constant,
+ Constructor,
+ Delegate,
+ Enum,
+ EnumMember,
+ Event,
+ Field,
+ Indexer,
+ Interface,
+ Method,
+ Module,
+ Property,
+ Struct
+ }
+
+ struct DeclaredSymbolInfo
+ {
+ internal DocumentId DocumentId;
+
+ public string FilePath { get; }
+ public string Name { get; }
+// public string ContainerDisplayName { get; }
+ public string FullyQualifiedContainerName { get; }
+ public DeclaredSymbolInfoKind Kind { get; }
+ public TextSpan Span { get; }
+ public ushort ParameterCount { get; }
+ public ushort TypeParameterCount { get; }
+
+
+ public DeclaredSymbolInfo(SyntaxNode node, string name, string fullyQualifiedContainerName, DeclaredSymbolInfoKind kind, TextSpan span, ushort parameterCount = 0, ushort typeParameterCount = 0)
+ : this()
+ {
+ this.FilePath = node.SyntaxTree.FilePath;
+ Name = string.Intern (name);
+// ContainerDisplayName = string.Intern (containerDisplayName);
+ FullyQualifiedContainerName = fullyQualifiedContainerName;
+ Kind = kind;
+ Span = span;
+ ParameterCount = parameterCount;
+ TypeParameterCount = typeParameterCount;
+ }
+
+ public async Task<ISymbol> GetSymbolAsync(Document document, CancellationToken cancellationToken)
+ {
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ var node = root.FindNode(Span);
+ var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ var symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken);
+ return symbol;
+ }
+ }
+
+ class DeclaredSymbolInfoResult : SearchResult
+ {
+ bool useFullName;
+
+ DeclaredSymbolInfo type;
+
+ public override SearchResultType SearchResultType { get { return SearchResultType.Type; } }
+
+ public override string File {
+ get { return type.FilePath; }
+ }
+
+ public override Xwt.Drawing.Image Icon {
+ get {
+ return ImageService.GetIcon (type.GetStockIconForSymbolInfo(), IconSize.Menu);
+ }
+ }
+
+ public override int Offset {
+ get { return type.Span.Start; }
+ }
+
+ public override int Length {
+ get { return type.Span.Length; }
+ }
+
+ public override string PlainText {
+ get {
+ return type.Name;
+ }
+ }
+ Document GetDocument (CancellationToken token)
+ {
+ var doc = type.DocumentId;
+ if (doc == null) {
+ var docId = TypeSystemService.GetDocuments (type.FilePath).FirstOrDefault ();
+ if (docId == null)
+ return null;
+ return TypeSystemService.GetCodeAnalysisDocument (docId, token);
+ }
+ return TypeSystemService.GetCodeAnalysisDocument (type.DocumentId, token);
+ }
+
+ public override Task<TooltipInformation> GetTooltipInformation (CancellationToken token)
+ {
+ return Task.Run (async delegate {
+ var doc = GetDocument (token);
+ if (doc == null) {
+ return null;
+ }
+ var symbol = await type.GetSymbolAsync (doc, token);
+ return await Ambience.GetTooltip (token, symbol);
+ });
+ }
+
+ public override string Description {
+ get {
+ string loc;
+ // if (type.TryGetSourceProject (out project)) {
+ // loc = GettextCatalog.GetString ("project {0}", project.Name);
+ // } else {
+ loc = GettextCatalog.GetString ("file {0}", File);
+ // }
+
+ switch (type.Kind) {
+ case DeclaredSymbolInfoKind.Interface:
+ return GettextCatalog.GetString ("interface ({0})", loc);
+ case DeclaredSymbolInfoKind.Struct:
+ return GettextCatalog.GetString ("struct ({0})", loc);
+ case DeclaredSymbolInfoKind.Delegate:
+ return GettextCatalog.GetString ("delegate ({0})", loc);
+ case DeclaredSymbolInfoKind.Enum:
+ return GettextCatalog.GetString ("enumeration ({0})", loc);
+ case DeclaredSymbolInfoKind.Class:
+ return GettextCatalog.GetString ("class ({0})", loc);
+
+ case DeclaredSymbolInfoKind.Field:
+ return GettextCatalog.GetString ("field ({0})", loc);
+ case DeclaredSymbolInfoKind.Property:
+ return GettextCatalog.GetString ("property ({0})", loc);
+ case DeclaredSymbolInfoKind.Indexer:
+ return GettextCatalog.GetString ("indexer ({0})", loc);
+ case DeclaredSymbolInfoKind.Event:
+ return GettextCatalog.GetString ("event ({0})", loc);
+ case DeclaredSymbolInfoKind.Method:
+ return GettextCatalog.GetString ("method ({0})", loc);
+ }
+ return GettextCatalog.GetString ("symbol ({0})", loc);
+ }
+ }
+
+ public override string GetMarkupText (bool selected)
+ {
+ return HighlightMatch (useFullName ? type.FullyQualifiedContainerName : type.Name, match, selected);
+ }
+
+ public DeclaredSymbolInfoResult (string match, string matchedString, int rank, DeclaredSymbolInfo type, bool useFullName) : base (match, matchedString, rank)
+ {
+ this.useFullName = useFullName;
+ this.type = type;
+ }
+
+ public override bool CanActivate {
+ get {
+ var doc = GetDocument (default (CancellationToken));
+ return doc != null;
+ }
+ }
+
+ public override async void Activate ()
+ {
+ var token = default (CancellationToken);
+ var doc = GetDocument (token);
+ if (doc != null) {
+ var symbol = await type.GetSymbolAsync (doc, token);
+ var project = TypeSystemService.GetMonoProject (doc.Id);
+ await RefactoringService.RoslynJumpToDeclaration (symbol, project);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/ExpandSelectionHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/ExpandSelectionHandler.cs
index a09c5ecf26..95595339d0 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/ExpandSelectionHandler.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/ExpandSelectionHandler.cs
@@ -24,10 +24,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using ICSharpCode.NRefactory.CSharp;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide;
using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.CSharp
{
@@ -39,68 +39,99 @@ namespace MonoDevelop.CSharp
class ExpandSelectionHandler : CommandHandler
{
+ internal class ExpandSelectionAnnotation
+ {
+ readonly MonoDevelop.Ide.Editor.TextEditor editor;
+
+ public Stack<SyntaxNode> Stack = new Stack<SyntaxNode> ();
+
+ public ExpandSelectionAnnotation (MonoDevelop.Ide.Editor.TextEditor editor)
+ {
+ this.editor = editor;
+ editor.CaretPositionChanged += Editor_CaretPositionChanged;
+ }
+
+ void Editor_CaretPositionChanged (object sender, EventArgs e)
+ {
+ editor.CaretPositionChanged -= Editor_CaretPositionChanged;
+ Stack = null;
+ editor.RemoveAnnotations<ExpandSelectionAnnotation> ();
+ }
+ }
+
+ internal static ExpandSelectionAnnotation GetSelectionAnnotation (MonoDevelop.Ide.Editor.TextEditor editor)
+ {
+ var result = editor.Annotation<ExpandSelectionAnnotation> ();
+ if (result == null) {
+ result = new ExpandSelectionAnnotation (editor);
+ editor.AddAnnotation (result);
+ }
+ return result;
+ }
+
protected override void Run ()
{
var doc = IdeApp.Workbench.ActiveDocument;
if (doc == null)
return;
+ var selectionRange = doc.Editor.SelectionRange;
var parsedDocument = doc.ParsedDocument;
if (parsedDocument == null)
return;
- var unit = parsedDocument.GetAst<SyntaxTree> ();
- if (unit == null)
+ var model = parsedDocument.GetAst<SemanticModel> ();
+ if (model == null)
return;
- var node = unit.GetNodeAt (doc.Editor.Caret.Location);
+ var unit = model.SyntaxTree.GetRoot ();
+ var node = unit.FindNode (Microsoft.CodeAnalysis.Text.TextSpan.FromBounds (selectionRange.Offset, selectionRange.EndOffset));
if (node == null)
return;
if (doc.Editor.IsSomethingSelected) {
- while (node != null && doc.Editor.MainSelection.IsSelected (node.StartLocation, node.EndLocation)) {
+ while (node != null && ShrinkSelectionHandler.IsSelected (doc.Editor, node.Span)) {
node = node.Parent;
}
}
-
- if (node != null)
- doc.Editor.SetSelection (node.StartLocation, node.EndLocation);
+
+ if (node != null) {
+ var selectionAnnotation = GetSelectionAnnotation (doc.Editor);
+ selectionAnnotation.Stack.Push (node);
+ doc.Editor.SetSelection (node.SpanStart, node.Span.End);
+ }
}
}
class ShrinkSelectionHandler : CommandHandler
{
- protected override void Run ()
+ internal static bool IsSelected (MonoDevelop.Ide.Editor.TextEditor editor, Microsoft.CodeAnalysis.Text.TextSpan span)
+ {
+ var selection = editor.SelectionRange;
+ return selection.Offset == span.Start && selection.Length == span.Length;
+ }
+
+ protected async override void Run ()
{
var doc = IdeApp.Workbench.ActiveDocument;
- var parsedDocument = doc.ParsedDocument;
+ if (doc == null)
+ return;
+ var selectionRange = doc.Editor.CaretOffset;
+ var analysisDocument = doc.AnalysisDocument;
+ if (analysisDocument == null)
+ return;
+ var parsedDocument = await analysisDocument.GetSyntaxTreeAsync ();
if (parsedDocument == null)
return;
- var unit = parsedDocument.GetAst<SyntaxTree> ();
+ var unit = parsedDocument.GetRoot ();
if (unit == null)
return;
- var node = unit.GetNodeAt (doc.Editor.Caret.Line, doc.Editor.Caret.Column);
- if (node == null)
- return;
- var nodeStack = new Stack<AstNode> ();
- nodeStack.Push (node);
- if (doc.Editor.IsSomethingSelected) {
- while (node != null && doc.Editor.MainSelection.IsSelected (node.StartLocation, node.EndLocation)) {
- node = node.Parent;
- if (node != null) {
- if (nodeStack.Count > 0 && nodeStack.Peek ().StartLocation == node.StartLocation && nodeStack.Peek ().EndLocation == node.EndLocation)
- nodeStack.Pop ();
- nodeStack.Push (node);
- }
- }
- }
-
- if (nodeStack.Count > 2) {
- nodeStack.Pop (); // parent
- nodeStack.Pop (); // current node
- node = nodeStack.Pop (); // next children in which the caret is
- doc.Editor.SetSelection (node.StartLocation, node.EndLocation);
+
+ var selectionAnnotation = ExpandSelectionHandler.GetSelectionAnnotation (doc.Editor);
+ selectionAnnotation.Stack.Pop ();
+ if (selectionAnnotation.Stack.Count > 0) {
+ var node = selectionAnnotation.Stack.Peek ();
+ doc.Editor.SetSelection (node.SpanStart, node.Span.End);
} else {
doc.Editor.ClearSelection ();
}
}
}
-}
-
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/PathedDocumentTextEditorExtension.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/PathedDocumentTextEditorExtension.cs
index 02065b26d9..054888ca87 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/PathedDocumentTextEditorExtension.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/PathedDocumentTextEditorExtension.cs
@@ -27,39 +27,87 @@ using System;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Components;
using System.Collections.Generic;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
-using MonoDevelop.Ide.Gui;
using MonoDevelop.Core;
using MonoDevelop.CSharp.Completion;
using System.Linq;
using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.CSharp;
using System.Text;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Extension;
using MonoDevelop.Projects;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+using System.Threading.Tasks;
+using System.Threading;
+using ICSharpCode.NRefactory6.CSharp;
namespace MonoDevelop.CSharp
{
class PathedDocumentTextEditorExtension : TextEditorExtension, IPathedDocument
{
+ static PathedDocumentTextEditorExtension ()
+ {
+ MonoDevelopWorkspace.GetInsertionPoints = async delegate (TextEditor editor, int offset) {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ if (doc == null || doc.AnalysisDocument == null)
+ return new List<InsertionPoint> ();
+ var semanticModel = await doc.AnalysisDocument.GetSemanticModelAsync ();
+ var declaringType = semanticModel.GetEnclosingSymbol<INamedTypeSymbol> (offset, default(CancellationToken));
+ if (declaringType == null)
+ return new List<InsertionPoint> ();
+ return MonoDevelop.Refactoring.InsertionPointService.GetInsertionPoints (
+ editor,
+ semanticModel,
+ declaringType,
+ offset
+ );
+ };
+ MonoDevelopWorkspace.StartRenameSession = async (TextEditor editor, DocumentContext ctx, Core.Text.ITextSourceVersion version, SyntaxToken? token) => {
+ var latestDocument = ctx.AnalysisDocument;
+ var cancellationToken = default (CancellationToken);
+ var latestModel = await latestDocument.GetSemanticModelAsync (cancellationToken).ConfigureAwait (false);
+ var latestRoot = await latestDocument.GetSyntaxRootAsync (cancellationToken).ConfigureAwait (false);
+ await Runtime.RunInMainThread (async delegate {
+ try {
+ var node = latestRoot.FindNode (token.Value.Parent.Span, false, false);
+ if (node == null)
+ return;
+ var info = latestModel.GetSymbolInfo (node);
+ var sym = info.Symbol ?? latestModel.GetDeclaredSymbol (node);
+ if (sym != null)
+ await new MonoDevelop.Refactoring.Rename.RenameRefactoring ().Rename (sym);
+ } catch (Exception ex) {
+ LoggingService.LogError ("Error while renaming " + token.Value.Parent, ex);
+ }
+ });
+ };
+ }
+
public override void Dispose ()
{
+ CancelDocumentParsedUpdate ();
+ CancelUpdatePathTimeout ();
+ CancelUpdatePath ();
+ Editor.TextChanging -= Editor_TextChanging;
+ DocumentContext.DocumentParsed -= DocumentContext_DocumentParsed;
+ Editor.CaretPositionChanged -= Editor_CaretPositionChanged;
UntrackStartupProjectChanges ();
IdeApp.Workspace.FileAddedToProject -= HandleProjectChanged;
IdeApp.Workspace.FileRemovedFromProject -= HandleProjectChanged;
IdeApp.Workspace.WorkspaceItemUnloaded -= HandleWorkspaceItemUnloaded;
IdeApp.Workspace.WorkspaceItemLoaded -= HandleWorkspaceItemLoaded;
+ IdeApp.Workspace.ItemAddedToSolution -= HandleProjectChanged;
IdeApp.Workspace.ActiveConfigurationChanged -= HandleActiveConfigurationChanged;
- if (caret != null) {
- caret.PositionChanged -= UpdatePath;
- caret = null;
- }
if (ext != null) {
ext.TypeSegmentTreeUpdated -= HandleTypeSegmentTreeUpdated;
ext = null;
}
+
currentPath = null;
lastType = null;
lastMember = null;
@@ -67,39 +115,98 @@ namespace MonoDevelop.CSharp
}
bool isPathSet;
- Mono.TextEditor.Caret caret;
CSharpCompletionTextEditorExtension ext;
List<DotNetProject> ownerProjects = new List<DotNetProject> ();
- public override void Initialize ()
+ public override bool IsValidInContext (DocumentContext context)
+ {
+ return context.GetContent<CSharpCompletionTextEditorExtension> () != null;
+ }
+
+ protected override void Initialize ()
{
CurrentPath = new PathEntry[] { new PathEntry (GettextCatalog.GetString ("No selection")) { Tag = null } };
isPathSet = false;
- // Delay the execution of UpdateOwnerProjects since it may end calling Document.AttachToProject,
+ // Delay the execution of UpdateOwnerProjects since it may end calling DocumentContext.AttachToProject,
// which shouldn't be called while the extension chain is being initialized.
Gtk.Application.Invoke (delegate {
UpdateOwnerProjects ();
- UpdatePath (null, null);
+ Editor_CaretPositionChanged (null, null);
});
- caret = Document.Editor.Caret;
- caret.PositionChanged += UpdatePath;
- ext = Document.GetContent<CSharpCompletionTextEditorExtension> ();
+
+ Editor.TextChanging += Editor_TextChanging;
+ DocumentContext.DocumentParsed += DocumentContext_DocumentParsed;
+ ext = DocumentContext.GetContent<CSharpCompletionTextEditorExtension> ();
ext.TypeSegmentTreeUpdated += HandleTypeSegmentTreeUpdated;
+
IdeApp.Workspace.FileAddedToProject += HandleProjectChanged;
IdeApp.Workspace.FileRemovedFromProject += HandleProjectChanged;
IdeApp.Workspace.WorkspaceItemUnloaded += HandleWorkspaceItemUnloaded;
IdeApp.Workspace.WorkspaceItemLoaded += HandleWorkspaceItemLoaded;
+ IdeApp.Workspace.ItemAddedToSolution += HandleProjectChanged;
IdeApp.Workspace.ActiveConfigurationChanged += HandleActiveConfigurationChanged;
+ SubscribeCaretPositionChange ();
+ }
+
+ void CancelUpdatePathTimeout ()
+ {
+ if (updatePathTimeoutId == 0)
+ return;
+ GLib.Source.Remove (updatePathTimeoutId);
+ updatePathTimeoutId = 0;
+ }
+
+ CancellationTokenSource documentParsedCancellationTokenSource = new CancellationTokenSource ();
+
+ void DocumentContext_DocumentParsed (object sender, EventArgs e)
+ {
+ SubscribeCaretPositionChange ();
+
+ // Fixes a potential memory leak see: https://bugzilla.xamarin.com/show_bug.cgi?id=38041
+ if (ownerProjects.Count > 1) {
+ var currentOwners = ownerProjects.Where (p => p != DocumentContext.Project).Select (p => TypeSystemService.GetCodeAnalysisProject (p)).ToList ();
+ CancelDocumentParsedUpdate ();
+ var token = documentParsedCancellationTokenSource.Token;
+ Task.Run (async delegate {
+ foreach (var otherProject in currentOwners) {
+ if (otherProject == null)
+ continue;
+ await otherProject.GetCompilationAsync (token).ConfigureAwait (false);
+ }
+ });
+ }
+ }
+
+ void CancelDocumentParsedUpdate ()
+ {
+ documentParsedCancellationTokenSource.Cancel ();
+ documentParsedCancellationTokenSource = new CancellationTokenSource ();
+ }
+
+ void SubscribeCaretPositionChange ()
+ {
+ if (caretPositionChangedSubscribed)
+ return;
+ caretPositionChangedSubscribed = true;
+ Editor.CaretPositionChanged += Editor_CaretPositionChanged;
+ }
+
+ void Editor_TextChanging (object sender, EventArgs e)
+ {
+ if (!caretPositionChangedSubscribed)
+ return;
+ caretPositionChangedSubscribed = false;
+ Editor.CaretPositionChanged -= Editor_CaretPositionChanged;
}
void HandleActiveConfigurationChanged (object sender, EventArgs e)
{
// If the current configuration changes and the project to which this document is bound is disabled in the
// new configuration, try to find another project
- if (Document.Project != null && Document.Project.ParentSolution == IdeApp.ProjectOperations.CurrentSelectedSolution) {
- var conf = Document.Project.ParentSolution.GetConfiguration (IdeApp.Workspace.ActiveConfiguration);
- if (conf != null && !conf.BuildEnabledForItem (Document.Project))
+ if (DocumentContext.Project != null && DocumentContext.Project.ParentSolution == IdeApp.ProjectOperations.CurrentSelectedSolution) {
+ var conf = DocumentContext.Project.ParentSolution.GetConfiguration (IdeApp.Workspace.ActiveConfiguration);
+ if (conf != null && !conf.BuildEnabledForItem (DocumentContext.Project))
ResetOwnerProject ();
}
}
@@ -108,63 +215,73 @@ namespace MonoDevelop.CSharp
{
if (ownerProjects != null)
return;
- UpdateOwnerProjects (e.Item.GetAllProjects ().OfType<DotNetProject> ());
+ UpdateOwnerProjects (e.Item.GetAllItems<DotNetProject> ());
}
void HandleWorkspaceItemUnloaded (object sender, WorkspaceItemEventArgs e)
{
if (ownerProjects == null)
return;
- foreach (var p in e.Item.GetAllProjects ().OfType<DotNetProject> ()) {
+ foreach (var p in e.Item.GetAllItems<DotNetProject> ()) {
RemoveOwnerProject (p);
}
if (ownerProjects.Count == 0) {
ownerProjects = null;
- Document.AttachToProject (null);
+ DocumentContext.AttachToProject (null);
}
}
- void HandleProjectChanged (object sender, ProjectFileEventArgs e)
+ void HandleProjectChanged (object sender, EventArgs e)
{
UpdateOwnerProjects ();
- UpdatePath (null, null);
+ Editor_CaretPositionChanged (null, null);
}
void HandleTypeSegmentTreeUpdated (object sender, EventArgs e)
{
- UpdatePath (null, null);
+ Runtime.RunInMainThread (() => {
+ CancelUpdatePathTimeout ();
+ updatePathTimeoutId = GLib.Timeout.Add (updatePathTimeout, delegate {
+ Update ();
+ updatePathTimeoutId = 0;
+ return false;
+ });
+ });
}
void UpdateOwnerProjects (IEnumerable<DotNetProject> allProjects)
{
- var projects = new HashSet<DotNetProject> (allProjects.Where (p => p.IsFileInProject (Document.FileName)));
+ if (DocumentContext == null) {
+ return;//This can happen if this object is disposed
+ }
+ var projects = new HashSet<DotNetProject> (allProjects.Where (p => p.IsFileInProject (DocumentContext.Name)));
if (ownerProjects == null || !projects.SetEquals (ownerProjects)) {
SetOwnerProjects (projects.OrderBy (p => p.Name).ToList ());
- var dnp = Document.Project as DotNetProject;
+ var dnp = DocumentContext.Project as DotNetProject;
if (ownerProjects.Count > 0 && (dnp == null || !ownerProjects.Contains (dnp))) {
// If the project for the document is not a DotNetProject but there is a project containing this file
// in the current solution, then use that project
- var pp = Document.Project != null ? FindBestDefaultProject (Document.Project.ParentSolution) : null;
+ var pp = DocumentContext.Project != null ? FindBestDefaultProject (DocumentContext.Project.ParentSolution) : null;
if (pp != null)
- Document.AttachToProject (pp);
+ DocumentContext.AttachToProject (pp);
}
}
}
void UpdateOwnerProjects ()
{
- UpdateOwnerProjects (IdeApp.Workspace.GetAllSolutionItems<DotNetProject> ());
- if (Document.Project == null)
+ UpdateOwnerProjects (IdeApp.Workspace.GetAllItems<DotNetProject> ());
+ if (DocumentContext != null && DocumentContext.Project == null)
ResetOwnerProject ();
}
void ResetOwnerProject ()
{
if (ownerProjects.Count > 0)
- Document.AttachToProject (FindBestDefaultProject ());
+ DocumentContext.AttachToProject (FindBestDefaultProject ());
}
- DotNetProject FindBestDefaultProject (Solution solution = null)
+ DotNetProject FindBestDefaultProject (Projects.Solution solution = null)
{
// The best candidate to be selected as default project for this document is the startup project.
// If the startup project is not an owner, pick any project that is not disabled in the current configuration.
@@ -210,8 +327,10 @@ namespace MonoDevelop.CSharp
void UntrackStartupProjectChanges ()
{
if (ownerProjects != null) {
- foreach (var sol in ownerProjects.Select (p => p.ParentSolution).Distinct ())
- sol.StartupItemChanged -= HandleStartupProjectChanged;
+ foreach (var sol in ownerProjects.Select (p => p.ParentSolution).Distinct ()) {
+ if (sol != null)
+ sol.StartupItemChanged -= HandleStartupProjectChanged;
+ }
}
}
@@ -220,16 +339,15 @@ namespace MonoDevelop.CSharp
// If the startup project changes, and the new startup project is an owner of this document,
// then attach the document to that project
- var sol = (Solution) sender;
+ var sol = (Projects.Solution) sender;
var p = sol.StartupItem as DotNetProject;
if (p != null && ownerProjects.Contains (p))
- Document.AttachToProject (p);
+ DocumentContext.AttachToProject (p);
}
#region IPathedDocument implementation
public event EventHandler<DocumentPathChangedEventArgs> PathChanged;
-
protected virtual void OnPathChanged (DocumentPathChangedEventArgs e)
{
EventHandler<DocumentPathChangedEventArgs> handler = this.PathChanged;
@@ -241,7 +359,7 @@ namespace MonoDevelop.CSharp
{
readonly PathedDocumentTextEditorExtension ext;
object tag;
- List<AstNode> memberList = new List<AstNode> ();
+ List<SyntaxNode> memberList = new List<SyntaxNode> ();
public DataProvider (PathedDocumentTextEditorExtension ext, object tag)
{
@@ -254,17 +372,22 @@ namespace MonoDevelop.CSharp
#region IListDataProvider implementation
- void AddTypeToMemberList (TypeDeclaration type)
+ void AddTypeToMemberList (BaseTypeDeclarationSyntax btype)
{
+ var e = btype as EnumDeclarationSyntax;
+ if (e !=null){
+ foreach (var member in e.Members) {
+ memberList.Add (member);
+ }
+ return;
+ }
+ var type = btype as TypeDeclarationSyntax;
foreach (var member in type.Members) {
- if (member is FieldDeclaration) {
- foreach (var variable in ((FieldDeclaration)member).Variables)
- memberList.Add (variable);
- } else if (member is FixedFieldDeclaration) {
- foreach (var variable in ((FixedFieldDeclaration)member).Variables)
+ if (member is FieldDeclarationSyntax) {
+ foreach (var variable in ((FieldDeclarationSyntax)member).Declaration.Variables)
memberList.Add (variable);
- } else if (member is EventDeclaration) {
- foreach (var variable in ((EventDeclaration)member).Variables)
+ } else if (member is EventFieldDeclarationSyntax) {
+ foreach (var variable in ((EventFieldDeclarationSyntax)member).Declaration.Variables)
memberList.Add (variable);
} else {
memberList.Add (member);
@@ -277,21 +400,20 @@ namespace MonoDevelop.CSharp
memberList.Clear ();
if (tag is SyntaxTree) {
var unit = tag as SyntaxTree;
- memberList.AddRange (unit.GetTypes (true));
- } else if (tag is TypeDeclaration) {
- AddTypeToMemberList ((TypeDeclaration)tag);
- } else if (tag is Accessor) {
- var acc = (Accessor)tag;
- var parent = (EntityDeclaration)acc.Parent;
- memberList.AddRange (parent.Children.OfType<Accessor> ());
- } else if (tag is EntityDeclaration) {
- var entity = (EntityDeclaration)tag;
- var type = entity.Parent as TypeDeclaration;
+ memberList.AddRange (unit.GetRoot ().DescendantNodes ().Where (IsType));
+ } else if (tag is BaseTypeDeclarationSyntax) {
+ AddTypeToMemberList ((BaseTypeDeclarationSyntax)tag);
+ } else if (tag is AccessorDeclarationSyntax) {
+ var acc = (AccessorDeclarationSyntax)tag;
+ var parent = (MemberDeclarationSyntax)acc.Parent;
+ memberList.AddRange (parent.ChildNodes ().OfType<AccessorDeclarationSyntax> ());
+ } else if (tag is MemberDeclarationSyntax) {
+ var entity = (MemberDeclarationSyntax)tag;
+ var type = entity.Parent as BaseTypeDeclarationSyntax;
if (type != null) {
AddTypeToMemberList (type);
}
}
-
memberList.Sort ((x, y) => {
var result = String.Compare (GetName (x), GetName (y), StringComparison.OrdinalIgnoreCase);
if (result == 0)
@@ -300,74 +422,84 @@ namespace MonoDevelop.CSharp
result = GetParameters (x).CompareTo (GetParameters (y));
// partial methods without body should come last
- if (result == 0 && x is MethodDeclaration && y is MethodDeclaration) {
- var mx = x as MethodDeclaration;
- var my = y as MethodDeclaration;
- if (mx.Body.IsNull && !my.Body.IsNull)
+ if (result == 0 && x is MethodDeclarationSyntax && y is MethodDeclarationSyntax) {
+ var mx = x as MethodDeclarationSyntax;
+ var my = y as MethodDeclarationSyntax;
+ if (mx.Body == null && my.Body != null)
return 1;
- if (!mx.Body.IsNull && my.Body.IsNull)
+ if (mx.Body != null && my.Body == null)
return -1;
}
return result;
});
}
- static int GetTypeParameters (AstNode x)
+ static int GetTypeParameters (SyntaxNode x)
{
- return x.GetChildrenByRole (Roles.TypeParameter).Count ();
+ return 0; //x.GetChildrenByRole (Roles.TypeParameter).Count ();
}
- static int GetParameters (AstNode x)
+ static int GetParameters (SyntaxNode x)
{
- return x.GetChildrenByRole (Roles.Parameter).Count ();
+ return 0; // x.GetChildrenByRole (Roles.Parameter).Count ();
}
- string GetName (AstNode node)
+ string GetName (SyntaxNode node)
{
if (tag is SyntaxTree) {
- var type = node as TypeDeclaration;
+ var type = node as TypeDeclarationSyntax;
if (type != null) {
var sb = new StringBuilder ();
- sb.Append (type.Name);
- while (type.Parent is TypeDeclaration) {
- type = type.Parent as TypeDeclaration;
- sb.Insert (0, type.Name + ".");
+ sb.Append (type.Identifier.ToString ());
+ while (type.Parent is TypeDeclarationSyntax) {
+ type = type.Parent as TypeDeclarationSyntax;
+ sb.Insert (0, type.Identifier + ".");
}
return sb.ToString ();
}
- var delegateDecl = node as DelegateDeclaration;
+ var delegateDecl = node as DelegateDeclarationSyntax;
if (delegateDecl != null) {
var sb = new StringBuilder ();
- sb.Append (delegateDecl.Name);
- var parentType = delegateDecl.Parent as TypeDeclaration;
+ sb.Append (delegateDecl.Identifier.ToString ());
+ var parentType = delegateDecl.Parent as TypeDeclarationSyntax;
while (parentType != null) {
- sb.Insert (0, parentType.Name + ".");
- parentType = parentType.Parent as TypeDeclaration;
+ sb.Insert (0, parentType.Identifier + ".");
+ parentType = parentType.Parent as TypeDeclarationSyntax;
}
return sb.ToString ();
}
}
-
- if (node is Accessor) {
- if (node.Role == PropertyDeclaration.GetterRole)
+ var accessor = node as AccessorDeclarationSyntax;
+ if (accessor != null) {
+ if (accessor.Kind () == SyntaxKind.GetAccessorDeclaration)
return "get";
- if (node.Role == PropertyDeclaration.SetterRole)
+ if (accessor.Kind () == SyntaxKind.SetAccessorDeclaration)
return "set";
- if (node.Role == CustomEventDeclaration.AddAccessorRole)
+ if (accessor.Kind () == SyntaxKind.AddAccessorDeclaration)
return "add";
- if (node.Role == CustomEventDeclaration.RemoveAccessorRole)
+ if (accessor.Kind () == SyntaxKind.RemoveAccessorDeclaration)
return "remove";
return node.ToString ();
}
- if (node is OperatorDeclaration)
+ if (node is OperatorDeclarationSyntax)
return "operator";
-
- if (node is EntityDeclaration)
- return ((EntityDeclaration)node).Name;
- if (node is FixedVariableInitializer) {
- return ((FixedVariableInitializer)node).Name;
- }
- return ((VariableInitializer)node).Name;
+ if (node is PropertyDeclarationSyntax)
+ return ((PropertyDeclarationSyntax)node).Identifier.ToString ();
+ if (node is MethodDeclarationSyntax)
+ return ((MethodDeclarationSyntax)node).Identifier.ToString ();
+ if (node is ConstructorDeclarationSyntax)
+ return ((ConstructorDeclarationSyntax)node).Identifier.ToString ();
+ if (node is DestructorDeclarationSyntax)
+ return ((DestructorDeclarationSyntax)node).Identifier.ToString ();
+ if (node is BaseTypeDeclarationSyntax)
+ return ((BaseTypeDeclarationSyntax)node).Identifier.ToString ();
+
+// if (node is fixeds) {
+// return ((FixedVariableInitializer)node).Name;
+// }
+ if (node is VariableDeclaratorSyntax)
+ return ((VariableDeclaratorSyntax)node).Identifier.ToString ();
+ return node.ToString ();
}
public string GetMarkup (int n)
@@ -382,7 +514,7 @@ namespace MonoDevelop.CSharp
if (type != null) {
var sb = new StringBuilder ();
sb.Append (ext.GetEntityMarkup (type));
- while (type.Parent is TypeDeclaration) {
+ while (type.Parent is BaseTypeDeclarationSyntax) {
sb.Insert (0, ext.GetEntityMarkup (type.Parent) + ".");
type = type.Parent;
}
@@ -399,10 +531,12 @@ namespace MonoDevelop.CSharp
icon = ext.ownerProjects [n].StockIcon;
} else {
var node = memberList [n];
- if (node is EntityDeclaration) {
- icon = ((EntityDeclaration)node).GetStockIcon ();
+ if (node is MemberDeclarationSyntax) {
+ icon = ((MemberDeclarationSyntax)node).GetStockIcon ();
+ } else if (node is VariableDeclaratorSyntax) {
+ icon = node.Parent.Parent.GetStockIcon ();
} else {
- icon = ((EntityDeclaration)node.Parent).GetStockIcon ();
+ icon = node.Parent.GetStockIcon ();
}
}
return ImageService.GetIcon (icon, Gtk.IconSize.Menu);
@@ -419,26 +553,20 @@ namespace MonoDevelop.CSharp
public void ActivateItem (int n)
{
if (tag is DotNetProject) {
- ext.Document.AttachToProject (ext.ownerProjects [n]);
+ ext.DocumentContext.AttachToProject (ext.ownerProjects [n]);
} else {
var node = memberList [n];
- var extEditor = ext.Document.GetContent<IExtensibleTextEditor> ();
+ var extEditor = ext.DocumentContext.GetContent<TextEditor> ();
if (extEditor != null) {
- int line, col;
- if (node is OperatorDeclaration) {
- line = Math.Max (1, ((OperatorDeclaration)node).OperatorToken.StartLocation.Line);
- col = Math.Max (1, ((OperatorDeclaration)node).OperatorToken.StartLocation.Column);
- } else if (node is IndexerDeclaration) {
- line = Math.Max (1, ((IndexerDeclaration)node).ThisToken.StartLocation.Line);
- col = Math.Max (1, ((IndexerDeclaration)node).ThisToken.StartLocation.Column);
- } else if (node is EntityDeclaration && !(node is Accessor)) {
- line = Math.Max (1, ((EntityDeclaration)node).NameToken.StartLocation.Line);
- col = Math.Max (1, ((EntityDeclaration)node).NameToken.StartLocation.Column);
+ int offset;
+ if (node is OperatorDeclarationSyntax) {
+ offset = Math.Max (1, ((OperatorDeclarationSyntax)node).OperatorToken.SpanStart);
+ } else if (node is MemberDeclarationSyntax && !(node is AccessorDeclarationSyntax)) {
+ offset = Math.Max (1, ((MemberDeclarationSyntax)node).SpanStart);
} else {
- line = node.StartLocation.Line;
- col = node.StartLocation.Column;
+ offset = node.SpanStart;
}
- extEditor.SetCaretTo (line, col);
+ extEditor.SetCaretLocation (extEditor.OffsetToLocation (offset), true);
}
}
}
@@ -458,14 +586,17 @@ namespace MonoDevelop.CSharp
class CompilationUnitDataProvider : DropDownBoxListWindow.IListDataProvider
{
- Document Document {
+ TextEditor editor;
+
+ DocumentContext DocumentContext {
get;
set;
}
- public CompilationUnitDataProvider (Document document)
+ public CompilationUnitDataProvider (TextEditor editor, DocumentContext documentContext)
{
- this.Document = document;
+ this.editor = editor;
+ this.DocumentContext = documentContext;
}
#region IListDataProvider implementation
@@ -476,12 +607,12 @@ namespace MonoDevelop.CSharp
public string GetMarkup (int n)
{
- return GLib.Markup.EscapeText (Document.ParsedDocument.UserRegions.ElementAt (n).Name);
+ return GLib.Markup.EscapeText (DocumentContext.ParsedDocument.GetUserRegionsAsync().Result.ElementAt (n).Name);
}
internal static Xwt.Drawing.Image Pixbuf {
get {
- return ImageService.GetIcon (Gtk.Stock.Add, Gtk.IconSize.Menu);
+ return ImageService.GetIcon (Ide.Gui.Stock.Region, Gtk.IconSize.Menu);
}
}
@@ -492,22 +623,23 @@ namespace MonoDevelop.CSharp
public object GetTag (int n)
{
- return Document.ParsedDocument.UserRegions.ElementAt (n);
+ return DocumentContext.ParsedDocument.GetUserRegionsAsync().Result.ElementAt (n);
}
public void ActivateItem (int n)
{
- var reg = Document.ParsedDocument.UserRegions.ElementAt (n);
- var extEditor = Document.GetContent<MonoDevelop.Ide.Gui.Content.IExtensibleTextEditor> ();
- if (extEditor != null)
- extEditor.SetCaretTo (Math.Max (1, reg.Region.BeginLine), reg.Region.BeginColumn);
+ var reg = DocumentContext.ParsedDocument.GetUserRegionsAsync().Result.ElementAt (n);
+ var extEditor = editor;
+ if (extEditor != null) {
+ extEditor.SetCaretLocation(Math.Max (1, reg.Region.BeginLine), reg.Region.BeginColumn, true);
+ }
}
public int IconCount {
get {
- if (Document.ParsedDocument == null)
+ if (DocumentContext.ParsedDocument == null)
return 0;
- return Document.ParsedDocument.UserRegions.Count ();
+ return DocumentContext.ParsedDocument.GetUserRegionsAsync().Result.Count ();
}
}
@@ -515,13 +647,13 @@ namespace MonoDevelop.CSharp
}
- public Gtk.Widget CreatePathWidget (int index)
+ public Control CreatePathWidget (int index)
{
PathEntry[] path = CurrentPath;
if (path == null || index < 0 || index >= path.Length)
return null;
var tag = path [index].Tag;
- var window = new DropDownBoxListWindow (tag == null ? (DropDownBoxListWindow.IListDataProvider)new CompilationUnitDataProvider (Document) : new DataProvider (this, tag));
+ var window = new DropDownBoxListWindow (tag == null ? (DropDownBoxListWindow.IListDataProvider)new CompilationUnitDataProvider (Editor, DocumentContext) : new DataProvider (this, tag));
window.FixedRowHeight = 22;
window.MaxVisibleRows = 14;
window.SelectItem (path [index].Tag);
@@ -540,17 +672,24 @@ namespace MonoDevelop.CSharp
}
}
- static PathEntry GetRegionEntry (ParsedDocument unit, Mono.TextEditor.DocumentLocation loc)
+ async static Task<PathEntry> GetRegionEntry (ParsedDocument unit, DocumentLocation loc)
{
PathEntry entry;
- if (!unit.UserRegions.Any ())
+ FoldingRegion reg;
+ try {
+ var regions = await unit.GetUserRegionsAsync ().ConfigureAwait (false);
+ if (unit == null || !regions.Any ())
+ return null;
+ reg = regions.LastOrDefault (r => r.Region.Contains (loc));
+ } catch (AggregateException) {
+ return null;
+ } catch (OperationCanceledException) {
return null;
- var reg = unit.UserRegions.LastOrDefault (r => r.Region.IsInside (loc));
+ }
if (reg == null) {
entry = new PathEntry (GettextCatalog.GetString ("No region"));
} else {
- entry = new PathEntry (CompilationUnitDataProvider.Pixbuf,
- GLib.Markup.EscapeText (reg.Name));
+ entry = new PathEntry (CompilationUnitDataProvider.Pixbuf, GLib.Markup.EscapeText (reg.Name));
}
entry.Position = EntryPosition.Right;
return entry;
@@ -563,140 +702,187 @@ namespace MonoDevelop.CSharp
OnPathChanged (new DocumentPathChangedEventArgs (prev));
}
- EntityDeclaration lastType;
+ SyntaxNode lastType;
string lastTypeMarkup;
- EntityDeclaration lastMember;
+ SyntaxNode lastMember;
string lastMemberMarkup;
MonoDevelop.Projects.Project lastProject;
AstAmbience amb;
+ CancellationTokenSource src = new CancellationTokenSource ();
+ bool caretPositionChangedSubscribed;
+ uint updatePathTimeoutId;
+ uint updatePathTimeout = 147;
- string GetEntityMarkup (AstNode node)
+ string GetEntityMarkup (SyntaxNode node)
{
- if (amb == null)
+ if (amb == null || node == null)
return "";
return amb.GetEntityMarkup (node);
}
- void UpdatePath (object sender, Mono.TextEditor.DocumentLocationEventArgs e)
+
+ void Editor_CaretPositionChanged (object sender, EventArgs e)
+ {
+ CancelUpdatePathTimeout ();
+ Update ();
+ }
+
+ void Update()
{
- var parsedDocument = Document.ParsedDocument;
- if (parsedDocument == null || parsedDocument.ParsedFile == null)
+ if (DocumentContext == null)
return;
- amb = new AstAmbience (document.GetFormattingOptions ());
-
- var unit = parsedDocument.GetAst<SyntaxTree> ();
- if (unit == null)
+ var parsedDocument = DocumentContext.ParsedDocument;
+ if (parsedDocument == null)
return;
+ var caretOffset = Editor.CaretOffset;
+ var model = parsedDocument.GetAst<SemanticModel>();
+ if (model == null)
+ return;
+ CancelUpdatePath ();
+ var cancellationToken = src.Token;
+ amb = new AstAmbience(TypeSystemService.Workspace.Options);
+ var loc = Editor.CaretLocation;
+ Task.Run(async delegate {
+ var unit = model.SyntaxTree;
+ SyntaxNode root;
+ SyntaxNode node;
+ try {
+ root = await unit.GetRootAsync(cancellationToken).ConfigureAwait(false);
+ if (root.FullSpan.Length <= caretOffset) {
+ return;
+ }
+ node = root.FindNode(TextSpan.FromBounds(caretOffset, caretOffset));
+ if (node.SpanStart != caretOffset)
+ node = root.SyntaxTree.FindTokenOnLeftOfPosition(caretOffset, cancellationToken).Parent;
+ } catch (Exception ex ) {
+ Console.WriteLine (ex);
+ return;
+ }
- var loc = Document.Editor.Caret.Location;
- var compExt = Document.GetContent<CSharpCompletionTextEditorExtension> ();
- var caretOffset = Document.Editor.Caret.Offset;
- var segType = compExt.GetTypeAt (caretOffset);
- if (segType != null)
- loc = segType.Region.Begin;
-
- var curType = (EntityDeclaration)unit.GetNodeAt (loc, n => n is TypeDeclaration || n is DelegateDeclaration);
+ var curMember = node != null ? node.AncestorsAndSelf ().FirstOrDefault (m => m is VariableDeclaratorSyntax && m.Parent != null && !(m.Parent.Parent is LocalDeclarationStatementSyntax) || (m is MemberDeclarationSyntax && !(m is NamespaceDeclarationSyntax))) : null;
+ var curType = node != null ? node.AncestorsAndSelf ().FirstOrDefault (IsType) : null;
- var curProject = ownerProjects != null && ownerProjects.Count > 1 ? Document.Project : null;
+ var curProject = ownerProjects != null && ownerProjects.Count > 1 ? DocumentContext.Project : null;
- var segMember = compExt.GetMemberAt (caretOffset);
- if (segMember != null) {
- loc = segMember.Region.Begin;
- } else {
- loc = Document.Editor.Caret.Location;
- }
+ if (curType == curMember || curType is DelegateDeclarationSyntax)
+ curMember = null;
+ if (isPathSet && curType == lastType && curMember == lastMember && curProject == lastProject) {
+ return;
+ }
+ var curTypeMakeup = GetEntityMarkup(curType);
+ var curMemberMarkup = GetEntityMarkup(curMember);
+ if (isPathSet && curType != null && lastType != null && curTypeMakeup == lastTypeMarkup &&
+ curMember != null && lastMember != null && curMemberMarkup == lastMemberMarkup && curProject == lastProject) {
+ return;
+ }
- var curMember = unit.GetNodeAt<EntityDeclaration> (loc);
- if (curType == curMember || curType is DelegateDeclaration)
- curMember = null;
- if (isPathSet && curType == lastType && curMember == lastMember && curProject == lastProject)
- return;
- var curTypeMakeup = GetEntityMarkup (curType);
- var curMemberMarkup = GetEntityMarkup (curMember);
- if (isPathSet && curType != null && lastType != null && curType.StartLocation == lastType.StartLocation && curTypeMakeup == lastTypeMarkup &&
- curMember != null && lastMember != null && curMember.StartLocation == lastMember.StartLocation && curMemberMarkup == lastMemberMarkup && curProject == lastProject)
- return;
+ var result = new List<PathEntry>();
- lastType = curType;
- lastTypeMarkup = curTypeMakeup;
+ if (curProject != null) {
+ // Current project if there is more than one
+ result.Add (new PathEntry (ImageService.GetIcon (curProject.StockIcon, Gtk.IconSize.Menu), GLib.Markup.EscapeText (curProject.Name)) { Tag = curProject });
+ }
- lastMember = curMember;
- lastMemberMarkup = curMemberMarkup;
+ if (curType == null) {
+ if (CurrentPath != null && CurrentPath.Length == 1 && CurrentPath [0]?.Tag is CSharpSyntaxTree)
+ return;
+ if (CurrentPath != null && CurrentPath.Length == 2 && CurrentPath [1]?.Tag is CSharpSyntaxTree)
+ return;
+ var prevPath = CurrentPath;
+ result.Add (new PathEntry (GettextCatalog.GetString ("No selection")) { Tag = unit });
+ Gtk.Application.Invoke (delegate {
+ if (cancellationToken.IsCancellationRequested)
+ return;
+
+ CurrentPath = result.ToArray ();
+ lastType = curType;
+ lastTypeMarkup = curTypeMakeup;
+
+ lastMember = curMember;
+ lastMemberMarkup = curMemberMarkup;
+
+ lastProject = curProject;
+ OnPathChanged (new DocumentPathChangedEventArgs (prevPath));
+ });
+ return;
+ }
+ var regionEntry = await GetRegionEntry (DocumentContext.ParsedDocument, loc).ConfigureAwait (false);
+
+ Gtk.Application.Invoke(delegate {
+ if (curType != null) {
+ var type = curType;
+ var pos = result.Count;
+ while (type != null) {
+ if (!(type is BaseTypeDeclarationSyntax))
+ break;
+ var tag = (object)type.Ancestors ().FirstOrDefault (IsType) ?? unit;
+ result.Insert (pos, new PathEntry (ImageService.GetIcon (type.GetStockIcon (), Gtk.IconSize.Menu), GetEntityMarkup (type)) { Tag = tag });
+ type = type.Parent;
+ }
+ }
+ if (curMember != null) {
+ result.Add (new PathEntry (ImageService.GetIcon (curMember.GetStockIcon (), Gtk.IconSize.Menu), curMemberMarkup) { Tag = curMember });
+ if (curMember.Kind () == SyntaxKind.GetAccessorDeclaration ||
+ curMember.Kind () == SyntaxKind.SetAccessorDeclaration ||
+ curMember.Kind () == SyntaxKind.AddAccessorDeclaration ||
+ curMember.Kind () == SyntaxKind.RemoveAccessorDeclaration) {
+ var parent = curMember.Parent;
+ if (parent != null)
+ result.Insert (result.Count - 1, new PathEntry (ImageService.GetIcon (parent.GetStockIcon (), Gtk.IconSize.Menu), GetEntityMarkup (parent)) { Tag = parent });
+ }
+ }
- lastProject = curProject;
+ if (regionEntry != null)
+ result.Add(regionEntry);
- var result = new List<PathEntry> ();
+ PathEntry noSelection = null;
+ if (curType == null) {
+ noSelection = new PathEntry (GettextCatalog.GetString ("No selection")) { Tag = unit };
+ } else if (curMember == null && !(curType is DelegateDeclarationSyntax)) {
+ noSelection = new PathEntry (GettextCatalog.GetString ("No selection")) { Tag = curType };
+ }
- if (ownerProjects != null && ownerProjects.Count > 1) {
- // Current project if there is more than one
- result.Add (new PathEntry (ImageService.GetIcon (Document.Project.StockIcon, Gtk.IconSize.Menu), GLib.Markup.EscapeText (Document.Project.Name)) { Tag = Document.Project });
- }
+ if (noSelection != null)
+ result.Add(noSelection);
+ var prev = CurrentPath;
+ if (prev != null && prev.Length == result.Count) {
+ bool equals = true;
+ for (int i = 0; i < prev.Length; i++) {
+ if (prev [i].Markup != result [i].Markup) {
+ equals = false;
+ break;
+ }
+ }
+ if (equals)
+ return;
+ }
+ if (cancellationToken.IsCancellationRequested)
+ return;
+ CurrentPath = result.ToArray();
+ lastType = curType;
+ lastTypeMarkup = curTypeMakeup;
- if (curType == null) {
- if (CurrentPath != null && CurrentPath.Length == 1 && CurrentPath [0].Tag is IUnresolvedFile)
- return;
- if (CurrentPath != null && CurrentPath.Length == 2 && CurrentPath [1].Tag is IUnresolvedFile)
- return;
- var prevPath = CurrentPath;
- result.Add (new PathEntry (GettextCatalog.GetString ("No selection")) { Tag = unit });
- CurrentPath = result.ToArray ();
- OnPathChanged (new DocumentPathChangedEventArgs (prevPath));
- return;
- }
+ lastMember = curMember;
+ lastMemberMarkup = curMemberMarkup;
- if (curType != null) {
- var type = curType;
- var pos = result.Count;
- while (type != null) {
- var declaringType = type.Parent as TypeDeclaration;
- result.Insert (pos, new PathEntry (ImageService.GetIcon (type.GetStockIcon (), Gtk.IconSize.Menu), GetEntityMarkup (type)) { Tag = (AstNode)declaringType ?? unit });
- type = declaringType;
- }
- }
-
- if (curMember != null) {
- result.Add (new PathEntry (ImageService.GetIcon (curMember.GetStockIcon (), Gtk.IconSize.Menu), curMemberMarkup) { Tag = curMember });
- if (curMember is Accessor) {
- var parent = curMember.Parent as EntityDeclaration;
- if (parent != null)
- result.Insert (result.Count - 1, new PathEntry (ImageService.GetIcon (parent.GetStockIcon (), Gtk.IconSize.Menu), GetEntityMarkup (parent)) { Tag = parent });
- }
- }
-
- var entry = GetRegionEntry (parsedDocument, loc);
- if (entry != null)
- result.Add (entry);
-
- PathEntry noSelection = null;
- if (curType == null) {
- noSelection = new PathEntry (GettextCatalog.GetString ("No selection")) { Tag = unit };
- } else if (curMember == null && !(curType is DelegateDeclaration)) {
- noSelection = new PathEntry (GettextCatalog.GetString ("No selection")) { Tag = curType };
- }
+ lastProject = curProject;
- if (noSelection != null)
- result.Add (noSelection);
+ OnPathChanged (new DocumentPathChangedEventArgs(prev));
+ });
+ });
+ }
- var prev = CurrentPath;
- if (prev != null && prev.Length == result.Count) {
- bool equals = true;
- for (int i = 0; i < prev.Length; i++) {
- if (prev [i].Markup != result [i].Markup) {
- equals = false;
- break;
- }
- }
- if (equals)
- return;
- }
- // Gtk.Application.Invoke (delegate {
- CurrentPath = result.ToArray ();
- OnPathChanged (new DocumentPathChangedEventArgs (prev));
- // });
- // });
+ static bool IsType (SyntaxNode m)
+ {
+ return m is BaseTypeDeclarationSyntax || m is DelegateDeclarationSyntax;
}
+ void CancelUpdatePath ()
+ {
+ src.Cancel ();
+ src = new CancellationTokenSource ();
+ }
#endregion
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/ProjectSearchCategory.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/ProjectSearchCategory.cs
new file mode 100644
index 0000000000..b304f7d898
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/ProjectSearchCategory.cs
@@ -0,0 +1,442 @@
+//
+// ProjectSearchCategory.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using MonoDevelop.Core;
+using System.Collections.Generic;
+using MonoDevelop.Core.Instrumentation;
+using MonoDevelop.Projects;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Core.Text;
+using Gtk;
+using System.Linq;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis;
+using System.Collections.Immutable;
+using System.Diagnostics;
+using System.Collections.Concurrent;
+using MonoDevelop.Components.MainToolbar;
+
+namespace MonoDevelop.CSharp
+{
+ class ProjectSearchCategory : SearchCategory
+ {
+ internal static void Init ()
+ {
+ MonoDevelopWorkspace.LoadingFinished += async delegate {
+ await UpdateSymbolInfos ();
+ };
+ if (IdeApp.IsInitialized) {
+ IdeApp.Workspace.LastWorkspaceItemClosed += async delegate {
+ await DisposeSymbolInfoTask ();
+ };
+ }
+ }
+
+ public ProjectSearchCategory () : base (GettextCatalog.GetString ("Solution"))
+ {
+ sortOrder = FirstCategory;
+ }
+
+ public override void Initialize (Components.PopoverWindow popupWindow)
+ {
+ lastResult = new WorkerResult ();
+ }
+
+ internal static Task<SymbolCache> SymbolInfoTask;
+
+ static TimerCounter getTypesTimer = InstrumentationService.CreateTimerCounter ("Time to get all types", "NavigateToDialog");
+
+ static CancellationTokenSource symbolInfoTokenSrc = new CancellationTokenSource();
+ public static async Task UpdateSymbolInfos ()
+ {
+ await DisposeSymbolInfoTask ();
+ CancellationToken token = symbolInfoTokenSrc.Token;
+ SymbolInfoTask = Task.Run (delegate {
+ return GetSymbolInfos (token);
+ }, token);
+ }
+
+ static async Task DisposeSymbolInfoTask ()
+ {
+ symbolInfoTokenSrc.Cancel ();
+ if (SymbolInfoTask != null) {
+ try {
+ var old = await SymbolInfoTask;
+ if (old != null)
+ old.Dispose ();
+ } catch (OperationCanceledException) {
+ // Ignore
+ } catch (Exception ex) {
+ LoggingService.LogError ("UpdateSymbolInfos failed", ex);
+ }
+ }
+ symbolInfoTokenSrc = new CancellationTokenSource();
+ lastResult = new WorkerResult ();
+ SymbolInfoTask = null;
+ }
+
+ internal class SymbolCache : IDisposable
+ {
+ public static readonly SymbolCache Empty = new SymbolCache ();
+
+ List<Microsoft.CodeAnalysis.Workspace> workspaces = new List<Microsoft.CodeAnalysis.Workspace> ();
+ ConcurrentDictionary<Microsoft.CodeAnalysis.DocumentId, List<DeclaredSymbolInfo>> documentInfos = new ConcurrentDictionary<Microsoft.CodeAnalysis.DocumentId, List<DeclaredSymbolInfo>> ();
+
+ public void AddWorkspace (Microsoft.CodeAnalysis.Workspace ws, CancellationToken token)
+ {
+ workspaces.Add (ws);
+ ws.WorkspaceChanged += Ws_WorkspaceChanged;
+
+ foreach (var p in ws.CurrentSolution.Projects) {
+ if (p.FilePath.EndsWith ("csproj", StringComparison.Ordinal))
+ SearchAsync (documentInfos, p, token);
+ }
+ }
+
+ public List<DeclaredSymbolInfo> AllTypes {
+ get {
+ var result = new List<DeclaredSymbolInfo> ();
+ foreach (var infos in documentInfos.Values)
+ result.AddRange (infos);
+ return result;
+ }
+ }
+
+ static async void SearchAsync (ConcurrentDictionary<Microsoft.CodeAnalysis.DocumentId, List<DeclaredSymbolInfo>> result, Microsoft.CodeAnalysis.Project project, CancellationToken cancellationToken)
+ {
+ if (project == null)
+ throw new ArgumentNullException (nameof (project));
+ try {
+ foreach (var document in project.Documents) {
+ cancellationToken.ThrowIfCancellationRequested ();
+ await UpdateDocument (result, document, cancellationToken);
+ }
+ } catch (AggregateException ae) {
+ ae.Flatten ().Handle (ex => ex is OperationCanceledException);
+ } catch (OperationCanceledException) {
+ }
+ }
+
+ static async Task UpdateDocument (ConcurrentDictionary<DocumentId, List<DeclaredSymbolInfo>> result, Microsoft.CodeAnalysis.Document document, CancellationToken cancellationToken)
+ {
+ var root = await document.GetSyntaxRootAsync (cancellationToken).ConfigureAwait (false);
+ var infos = new List<DeclaredSymbolInfo> ();
+ foreach (var current in root.DescendantNodesAndSelf (CSharpSyntaxFactsService.DescentIntoSymbolForDeclarationSearch)) {
+ cancellationToken.ThrowIfCancellationRequested ();
+ DeclaredSymbolInfo declaredSymbolInfo;
+ if (current.TryGetDeclaredSymbolInfo (out declaredSymbolInfo)) {
+ declaredSymbolInfo.DocumentId = document.Id;
+ infos.Add (declaredSymbolInfo);
+ }
+ }
+ RemoveDocument (result, document.Id);
+ result.TryAdd (document.Id, infos);
+ }
+
+ static void RemoveDocument (ConcurrentDictionary<DocumentId, List<DeclaredSymbolInfo>> result, Microsoft.CodeAnalysis.DocumentId documentId)
+ {
+ if (result.ContainsKey (documentId)) {
+ List<DeclaredSymbolInfo> val;
+ result.TryRemove (documentId, out val);
+ }
+ }
+
+ public void Dispose ()
+ {
+ if (workspaces == null)
+ return;
+ foreach (var ws in workspaces)
+ ws.WorkspaceChanged -= Ws_WorkspaceChanged;
+ workspaces = null;
+ documentInfos = null;
+ }
+
+ async void Ws_WorkspaceChanged (object sender, WorkspaceChangeEventArgs e)
+ {
+ var ws = (Microsoft.CodeAnalysis.Workspace)sender;
+ var currentSolution = ws.CurrentSolution;
+ if (currentSolution == null)
+ return;
+ try {
+ switch (e.Kind) {
+ case WorkspaceChangeKind.ProjectAdded:
+ var project1 = currentSolution.GetProject (e.ProjectId);
+ if (project1 != null)
+ SearchAsync (documentInfos, project1, default (CancellationToken));
+ break;
+ case WorkspaceChangeKind.ProjectRemoved:
+ var project = currentSolution.GetProject (e.ProjectId);
+ if (project != null) {
+ foreach (var docId in project.DocumentIds)
+ RemoveDocument (documentInfos, docId);
+ }
+ break;
+ case WorkspaceChangeKind.DocumentAdded:
+ var document = currentSolution.GetDocument (e.DocumentId);
+ if (document != null)
+ await UpdateDocument (documentInfos, document, default (CancellationToken));
+ break;
+ case WorkspaceChangeKind.DocumentRemoved:
+ RemoveDocument (documentInfos, e.DocumentId);
+ break;
+ case WorkspaceChangeKind.DocumentChanged:
+ var doc = currentSolution.GetDocument (e.DocumentId);
+ if (doc != null) {
+ await Task.Run (async delegate {
+ await UpdateDocument (documentInfos, doc, default (CancellationToken));
+ }).ConfigureAwait (false);
+ }
+ break;
+ }
+ } catch (AggregateException ae) {
+ ae.Flatten ().Handle (ex => ex is OperationCanceledException);
+ } catch (OperationCanceledException) {
+ } catch (Exception ex) {
+ LoggingService.LogError ("Error while updating navigation symbol cache.", ex);
+ }
+ }
+ }
+
+ static SymbolCache GetSymbolInfos (CancellationToken token)
+ {
+ getTypesTimer.BeginTiming ();
+ try {
+ var result = new SymbolCache ();
+ foreach (var workspace in TypeSystemService.AllWorkspaces) {
+ result.AddWorkspace (workspace, token);
+ }
+ return result;
+ } catch (AggregateException ae) {
+ ae.Flatten ().Handle (ex => ex is OperationCanceledException);
+ return SymbolCache.Empty;
+ } catch (OperationCanceledException) {
+ return SymbolCache.Empty;
+ } finally {
+ getTypesTimer.EndTiming ();
+ }
+ }
+
+
+ static WorkerResult lastResult;
+ static readonly string[] typeTags = new [] { "type", "t", "class", "struct", "interface", "enum", "delegate" };
+ static readonly string[] memberTags = new [] { "member", "m", "method", "property", "field", "event" };
+ static readonly string[] tags = typeTags.Concat(memberTags).ToArray();
+
+ public override string[] Tags {
+ get {
+ return tags;
+ }
+ }
+
+ public override bool IsValidTag (string tag)
+ {
+ return typeTags.Any (t => t == tag) || memberTags.Any (t => t == tag);
+ }
+
+ public override Task GetResults (ISearchResultCallback searchResultCallback, SearchPopupSearchPattern searchPattern, CancellationToken token)
+ {
+ return Task.Run (async delegate {
+ if (searchPattern.Tag != null && !(typeTags.Contains (searchPattern.Tag) || memberTags.Contains (searchPattern.Tag)) || searchPattern.HasLineNumber)
+ return null;
+ try {
+ var newResult = new WorkerResult ();
+ newResult.pattern = searchPattern.Pattern;
+ newResult.Tag = searchPattern.Tag;
+ List<DeclaredSymbolInfo> allTypes;
+ if (SymbolInfoTask == null)
+ SymbolInfoTask = Task.FromResult (GetSymbolInfos (token));
+ var cache = await SymbolInfoTask.ConfigureAwait (false);
+ allTypes = cache.AllTypes;
+ string toMatch = searchPattern.Pattern;
+ newResult.matcher = StringMatcher.GetMatcher (toMatch, false);
+ newResult.FullSearch = toMatch.IndexOf ('.') > 0;
+ var oldLastResult = lastResult;
+ if (newResult.FullSearch && oldLastResult != null && !oldLastResult.FullSearch)
+ oldLastResult = new WorkerResult ();
+// var now = DateTime.Now;
+
+ AllResults (searchResultCallback, oldLastResult, newResult, allTypes, token);
+ //newResult.results.SortUpToN (new DataItemComparer (token), resultsCount);
+ lastResult = newResult;
+// Console.WriteLine ((now - DateTime.Now).TotalMilliseconds);
+ return (ISearchDataSource)newResult.results;
+ } catch {
+ token.ThrowIfCancellationRequested ();
+ throw;
+ }
+ }, token);
+ }
+
+ void AllResults (ISearchResultCallback searchResultCallback, WorkerResult lastResult, WorkerResult newResult, IReadOnlyList<DeclaredSymbolInfo> completeTypeList, CancellationToken token)
+ {
+ // Search Types
+ newResult.filteredSymbols = new List<DeclaredSymbolInfo> ();
+ bool startsWithLastFilter = lastResult.pattern != null && newResult.pattern.StartsWith (lastResult.pattern, StringComparison.Ordinal) && lastResult.filteredSymbols != null;
+ var allTypes = startsWithLastFilter ? lastResult.filteredSymbols : completeTypeList;
+ foreach (var type in allTypes) {
+ if (token.IsCancellationRequested) {
+ newResult.filteredSymbols = null;
+ return;
+ }
+
+ if (type.Kind == DeclaredSymbolInfoKind.Constructor ||
+ type.Kind == DeclaredSymbolInfoKind.Module ||
+ type.Kind == DeclaredSymbolInfoKind.Indexer)
+ continue;
+
+ if (newResult.Tag != null) {
+ if ((newResult.Tag == "type" || newResult.Tag == "t") && type.Kind != DeclaredSymbolInfoKind.Class && type.Kind != DeclaredSymbolInfoKind.Struct && type.Kind != DeclaredSymbolInfoKind.Interface && type.Kind != DeclaredSymbolInfoKind.Enum && type.Kind != DeclaredSymbolInfoKind.Delegate)
+ continue;
+
+ if (newResult.Tag == "class" && type.Kind != DeclaredSymbolInfoKind.Class)
+ continue;
+ if (newResult.Tag == "struct" && type.Kind != DeclaredSymbolInfoKind.Struct)
+ continue;
+ if (newResult.Tag == "interface" && type.Kind != DeclaredSymbolInfoKind.Interface)
+ continue;
+ if (newResult.Tag == "enum" && type.Kind != DeclaredSymbolInfoKind.Enum)
+ continue;
+ if (newResult.Tag == "delegate" && type.Kind != DeclaredSymbolInfoKind.Delegate)
+ continue;
+
+ if ((newResult.Tag == "member" || newResult.Tag == "m") && type.Kind != DeclaredSymbolInfoKind.Method && type.Kind != DeclaredSymbolInfoKind.Property && type.Kind != DeclaredSymbolInfoKind.Field && type.Kind != DeclaredSymbolInfoKind.Event)
+ continue;
+ if (newResult.Tag == "method" && type.Kind != DeclaredSymbolInfoKind.Method)
+ continue;
+ if (newResult.Tag == "property" && type.Kind != DeclaredSymbolInfoKind.Property)
+ continue;
+ if (newResult.Tag == "field" && type.Kind != DeclaredSymbolInfoKind.Field)
+ continue;
+ if (newResult.Tag == "event" && type.Kind != DeclaredSymbolInfoKind.Event)
+ continue;
+
+ }
+ SearchResult curResult = newResult.CheckType (type);
+ if (curResult != null) {
+ newResult.filteredSymbols.Add (type);
+ newResult.results.AddResult (curResult);
+ searchResultCallback.ReportResult (curResult);
+ }
+ }
+ }
+
+ class WorkerResult
+ {
+ public string Tag {
+ get;
+ set;
+ }
+
+ public List<DeclaredSymbolInfo> filteredSymbols;
+
+ string pattern2;
+ char firstChar;
+ char[] firstChars;
+
+ public string pattern {
+ get {
+ return pattern2;
+ }
+ set {
+ pattern2 = value;
+ if (pattern2.Length == 1) {
+ firstChar = pattern2 [0];
+ firstChars = new [] { char.ToUpper (firstChar), char.ToLower (firstChar) };
+ } else {
+ firstChars = null;
+ }
+ }
+ }
+
+ public ResultsDataSource results;
+ public bool FullSearch;
+ public StringMatcher matcher;
+
+ public WorkerResult ()
+ {
+ results = new ResultsDataSource ();
+ }
+
+ internal SearchResult CheckType (DeclaredSymbolInfo symbol)
+ {
+ int rank;
+ var name = symbol.Name;
+ if (MatchName(name, out rank)) {
+// if (type.ContainerDisplayName != null)
+// rank--;
+ return new DeclaredSymbolInfoResult (pattern, symbol.Name, rank, symbol, false);
+ }
+ if (!FullSearch)
+ return null;
+ name = symbol.FullyQualifiedContainerName;
+ if (MatchName(name, out rank)) {
+// if (type.ContainingType != null)
+// rank--;
+ return new DeclaredSymbolInfoResult (pattern, name, rank, symbol, true);
+ }
+ return null;
+ }
+
+ Dictionary<string, MatchResult> savedMatches = new Dictionary<string, MatchResult> (StringComparer.Ordinal);
+
+ bool MatchName (string name, out int matchRank)
+ {
+ if (name == null) {
+ matchRank = -1;
+ return false;
+ }
+
+ MatchResult savedMatch;
+ if (!savedMatches.TryGetValue (name, out savedMatch)) {
+ bool doesMatch;
+ if (firstChars != null) {
+ int idx = name.IndexOfAny (firstChars);
+ doesMatch = idx >= 0;
+ if (doesMatch) {
+ matchRank = int.MaxValue - (name.Length - 1) * 10 - idx;
+ if (name [idx] != firstChar)
+ matchRank /= 2;
+ savedMatches [name] = savedMatch = new MatchResult (true, matchRank);
+ return true;
+ }
+ matchRank = -1;
+ savedMatches [name] = savedMatch = new MatchResult (false, -1);
+ return false;
+ }
+ doesMatch = matcher.CalcMatchRank (name, out matchRank);
+ savedMatches [name] = savedMatch = new MatchResult (doesMatch, matchRank);
+ }
+
+ matchRank = savedMatch.Rank;
+ return savedMatch.Match;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/SignatureMarkupCreator.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/SignatureMarkupCreator.cs
index 4938335f00..89cd40ade2 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp/SignatureMarkupCreator.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp/SignatureMarkupCreator.cs
@@ -24,35 +24,41 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using MonoDevelop.Ide.TypeSystem;
using System.Text;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
using System.IO;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.TypeSystem.Implementation;
using System.Collections.Generic;
-using Mono.TextEditor.Highlighting;
-using Mono.TextEditor;
using System.Linq;
using MonoDevelop.Core;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Projects;
-using ICSharpCode.NRefactory.Semantics;
using System.ComponentModel;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Simplification;
+using Microsoft.CodeAnalysis.CSharp.Formatting;
+using System.Collections.Immutable;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Components;
+using MonoDevelop.Ide.Editor.Highlighting;
+using ICSharpCode.NRefactory6.CSharp;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.CSharp.Completion;
+using System.Threading;
namespace MonoDevelop.CSharp
{
class SignatureMarkupCreator
{
const double optionalAlpha = 0.7;
- readonly CSharpResolver resolver;
- readonly TypeSystemAstBuilder astBuilder;
- readonly CSharpFormattingOptions formattingOptions;
+ readonly DocumentContext ctx;
+ readonly OptionSet options;
readonly ColorScheme colorStyle;
+ readonly int offset;
- public bool BreakLineAfterReturnType {
+ public bool BreakLineAfterReturnType
+ {
get;
set;
}
@@ -68,129 +74,167 @@ namespace MonoDevelop.CSharp
}
}
- public SignatureMarkupCreator (CSharpResolver resolver, CSharpFormattingOptions formattingOptions)
+ public SignatureMarkupCreator (DocumentContext ctx, int offset)
{
- this.colorStyle = SyntaxModeService.GetColorStyle (MonoDevelop.Ide.IdeApp.Preferences.ColorScheme);
-
- this.resolver = resolver;
- this.astBuilder = new TypeSystemAstBuilder (resolver) {
- ConvertUnboundTypeArguments = true,
- UseAliases = false
- };
- this.formattingOptions = formattingOptions;
+ this.offset = offset;
+ this.colorStyle = SyntaxModeService.GetColorStyle (Ide.IdeApp.Preferences.ColorScheme);
+ if (!this.colorStyle.FitsIdeSkin (Ide.IdeApp.Preferences.UserInterfaceSkin))
+ this.colorStyle = SyntaxModeService.GetDefaultColorStyle (Ide.IdeApp.Preferences.UserInterfaceSkin);
+ this.ctx = ctx;
+ if (ctx != null) {
+ this.options = ctx.GetOptionSet ();
+ } else {
+ this.options = MonoDevelop.Ide.TypeSystem.TypeSystemService.Workspace.Options;
+ }
}
- public string GetTypeReferenceString (IType type, bool highlight = true)
+ public string GetTypeReferenceString (ITypeSymbol type, bool highlight = true)
{
if (type == null)
- throw new ArgumentNullException ("type");
- if (type.Kind == TypeKind.Null)
- return "?";
- if (type.Kind == TypeKind.Array) {
- var arrayType = (ArrayType)type;
- return GetTypeReferenceString (arrayType.ElementType, highlight) + "[" + new string (',', arrayType.Dimensions - 1) + "]";
- }
- if (type.Kind == TypeKind.Pointer)
- return GetTypeReferenceString (((PointerType)type).ElementType, highlight) + "*";
- AstType astType;
- try {
- astType = astBuilder.ConvertType (type);
- } catch (Exception e) {
- var compilation = GetCompilation (type);
- if (compilation == null) {
- LoggingService.LogWarning ("type:" + type.GetType (), e);
- return "?";
+ throw new ArgumentNullException (nameof (type));
+ if (type.TypeKind == TypeKind.Error) {
+ SemanticModel model = SemanticModel;
+ if (model == null) {
+ var parsedDocument = ctx.ParsedDocument;
+ if (parsedDocument != null) {
+ model = parsedDocument.GetAst<SemanticModel> () ?? ctx.AnalysisDocument?.GetSemanticModelAsync ().Result;
+ }
}
- astType = new TypeSystemAstBuilder (new CSharpResolver (compilation)).ConvertType (type);
+ var typeSyntax = type.GenerateTypeSyntax ();
+ string generatedTypeSyntaxString;
+ try {
+ var oldDoc = ctx.AnalysisDocument;
+ var newDoc = oldDoc.WithSyntaxRoot (SyntaxFactory.ParseCompilationUnit (typeSyntax.ToString ()).WithAdditionalAnnotations (Simplifier.Annotation));
+ var reducedDoc = Simplifier.ReduceAsync (newDoc, options);
+ generatedTypeSyntaxString = Ambience.EscapeText (reducedDoc.Result.GetSyntaxRootAsync ().Result.ToString ());
+ } catch {
+ generatedTypeSyntaxString = typeSyntax != null ? Ambience.EscapeText (typeSyntax.ToString ()) : "?";
+ }
+ return highlight ? HighlightSemantically (generatedTypeSyntaxString, colorStyle.UserTypes) : generatedTypeSyntaxString;
}
-
- if (astType is PrimitiveType) {
- return Highlight (astType.ToString (formattingOptions), colorStyle.KeywordTypes);
+ if (type.TypeKind == TypeKind.Array) {
+ var arrayType = (IArrayTypeSymbol)type;
+ return GetTypeReferenceString (arrayType.ElementType, highlight) + "[" + new string (',', arrayType.Rank - 1) + "]";
}
- var text = AmbienceService.EscapeText (astType.ToString (formattingOptions));
- return highlight ? HighlightSemantically (text, colorStyle.UserTypes) : text;
- }
-
- static ICompilation GetCompilation (IType type)
- {
- var def = type.GetDefinition ();
- if (def == null) {
- var t = type;
- while (t is TypeWithElementType) {
- t = ((TypeWithElementType)t).ElementType;
+ if (type.TypeKind == TypeKind.Pointer)
+ return GetTypeReferenceString (((IPointerTypeSymbol)type).PointedAtType, highlight) + "*";
+ string displayString;
+ if (ctx != null) {
+ SemanticModel model = SemanticModel;
+ if (model == null) {
+ var parsedDocument = ctx.ParsedDocument;
+ if (parsedDocument != null) {
+ model = parsedDocument.GetAst<SemanticModel> () ?? ctx.AnalysisDocument?.GetSemanticModelAsync ().Result;
+ }
}
- if (t != null)
- def = t.GetDefinition ();
+ //Math.Min (model.SyntaxTree.Length, offset)) is needed in case parsedDocument.GetAst<SemanticModel> () is outdated
+ //this is tradeoff between performance and consistency between editor text(offset) and model, since
+ //ToMinimalDisplayString can use little outdated model this is fine
+ //but in case of Sketches where user usually is at end of document when typing text this can throw exception
+ //because offset can be >= Length
+ displayString = model != null ? RoslynCompletionData.SafeMinimalDisplayString (type, model, Math.Min (model.SyntaxTree.Length - 1, offset), MonoDevelop.Ide.TypeSystem.Ambience.LabelFormat) : type.Name;
+ } else {
+ displayString = type.ToDisplayString (MonoDevelop.Ide.TypeSystem.Ambience.LabelFormat);
}
- if (def != null)
- return def.Compilation;
- return null;
+ var text = MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (displayString);
+ return highlight ? HighlightSemantically (text, colorStyle.UserTypes) : text;
}
- public string GetMarkup (IType type)
+ // static ICompilation GetCompilation (IType type)
+ // {
+ // var def = type.GetDefinition ();
+ // if (def == null) {
+ // var t = type;
+ // while (t is TypeWithElementType) {
+ // t = ((TypeWithElementType)t).ElementType;
+ // }
+ // if (t != null)
+ // def = t.GetDefinition ();
+ // }
+ // if (def != null)
+ // return def.Compilation;
+ // return null;
+ // }
+
+ public string GetMarkup (ITypeSymbol type)
{
if (type == null)
throw new ArgumentNullException ("entity");
return GetTypeMarkup (type);
}
- public string GetMarkup (IEntity entity)
+
+ public string GetMarkup (Microsoft.CodeAnalysis.ISymbol entity)
{
if (entity == null)
throw new ArgumentNullException ("entity");
string result;
- switch (entity.SymbolKind) {
- case SymbolKind.TypeDefinition:
- result = GetTypeMarkup ((ITypeDefinition)entity);
- break;
- case SymbolKind.Field:
- result = GetFieldMarkup ((IField)entity);
- break;
- case SymbolKind.Property:
- case SymbolKind.Indexer:
- result = GetPropertyMarkup ((IProperty)entity);
- break;
- case SymbolKind.Event:
- result = GetEventMarkup ((IEvent)entity);
+ switch (entity.Kind) {
+ case Microsoft.CodeAnalysis.SymbolKind.ArrayType:
+ case Microsoft.CodeAnalysis.SymbolKind.PointerType:
+ case Microsoft.CodeAnalysis.SymbolKind.NamedType:
+ result = GetTypeMarkup ((ITypeSymbol)entity);
+ break;
+ case Microsoft.CodeAnalysis.SymbolKind.Field:
+ result = GetFieldMarkup ((IFieldSymbol)entity);
+ break;
+ case Microsoft.CodeAnalysis.SymbolKind.Property:
+ result = GetPropertyMarkup ((IPropertySymbol)entity);
+ break;
+ case Microsoft.CodeAnalysis.SymbolKind.Event:
+ result = GetEventMarkup ((IEventSymbol)entity);
+ break;
+ case Microsoft.CodeAnalysis.SymbolKind.Method:
+ var method = (IMethodSymbol)entity;
+ switch (method.MethodKind) {
+ case MethodKind.Constructor:
+ result = GetConstructorMarkup (method);
+ break;
+ case MethodKind.Destructor:
+ result = GetDestructorMarkup (method);
+ break;
+ default:
+ result = GetMethodMarkup (method);
+ break;
+ }
break;
- case SymbolKind.Method:
- case SymbolKind.Operator:
- result = GetMethodMarkup ((IMethod)entity);
+ case Microsoft.CodeAnalysis.SymbolKind.Namespace:
+ result = GetNamespaceMarkup ((INamespaceSymbol)entity);
break;
- case SymbolKind.Constructor:
- result = GetConstructorMarkup ((IMethod)entity);
+ case Microsoft.CodeAnalysis.SymbolKind.Local:
+ result = GetLocalVariableMarkup ((ILocalSymbol)entity);
break;
- case SymbolKind.Destructor:
- result = GetDestructorMarkup ((IMethod)entity);
+ case Microsoft.CodeAnalysis.SymbolKind.Parameter:
+ result = GetParameterVariableMarkup ((IParameterSymbol)entity);
break;
default:
- throw new ArgumentOutOfRangeException ();
- }
- string reason;
- if (entity.IsObsolete (out reason)) {
- var attr = reason == null ? "[Obsolete]" : "[Obsolete(\"" + reason + "\")]";
- result = "<span size=\"smaller\">" + attr + "</span>" + Environment.NewLine + result;
+ Console.WriteLine (entity.Kind);
+ return null;
}
+ // TODO
+ // if (entity.IsObsolete (out reason)) {
+ // var attr = reason == null ? "[Obsolete]" : "[Obsolete(\"" + reason + "\")]";
+ // result = "<span size=\"smaller\">" + attr + "</span>" + Environment.NewLine + result;
+ // }
return result;
}
- public string GetMarkup (INamespace ns)
+ string GetNamespaceMarkup (INamespaceSymbol ns)
{
var result = new StringBuilder ();
result.Append (Highlight ("namespace ", colorStyle.KeywordNamespace));
- result.Append (ns.FullName);
+ result.Append (ns.Name);
return result.ToString ();
}
-
- void AppendModifiers (StringBuilder result, IEntity entity)
+ void AppendModifiers (StringBuilder result, ISymbol entity)
{
- if (entity.DeclaringType != null && entity.DeclaringType.Kind == TypeKind.Interface)
+ if (entity.ContainingType != null && entity.ContainingType.TypeKind == TypeKind.Interface)
return;
- switch (entity.Accessibility) {
+ switch (entity.DeclaredAccessibility) {
case Accessibility.Internal:
- if (entity.SymbolKind != SymbolKind.TypeDefinition)
+ if (entity.Kind != SymbolKind.NamedType)
result.Append (Highlight ("internal ", colorStyle.KeywordModifiers));
break;
case Accessibility.ProtectedAndInternal:
@@ -203,42 +247,48 @@ namespace MonoDevelop.CSharp
result.Append (Highlight ("protected ", colorStyle.KeywordModifiers));
break;
case Accessibility.Private:
-// private is the default modifier - no need to show that
-// result.Append (Highlight (" private", colorStyle.KeywordModifiers));
+ // private is the default modifier - no need to show that
+ // result.Append (Highlight (" private", colorStyle.KeywordModifiers));
break;
case Accessibility.Public:
result.Append (Highlight ("public ", colorStyle.KeywordModifiers));
break;
}
- var field = entity as IField;
+ var field = entity as IFieldSymbol;
if (field != null) {
- if (field.IsFixed) {
+ // TODO!!!!
+ /*if (field.IsFixed) {
result.Append (Highlight ("fixed ", colorStyle.KeywordModifiers));
- } else if (field.IsConst) {
+ } else*/
+ if (field.IsConst) {
result.Append (Highlight ("const ", colorStyle.KeywordModifiers));
}
} else if (entity.IsStatic) {
result.Append (Highlight ("static ", colorStyle.KeywordModifiers));
} else if (entity.IsSealed) {
- if (!(entity is IType && ((IType)entity).Kind == TypeKind.Delegate))
+ if (!(entity is ITypeSymbol && ((ITypeSymbol)entity).TypeKind == TypeKind.Delegate))
result.Append (Highlight ("sealed ", colorStyle.KeywordModifiers));
} else if (entity.IsAbstract) {
- if (!(entity is IType && ((IType)entity).Kind == TypeKind.Interface))
+ if (!(entity is ITypeSymbol && ((ITypeSymbol)entity).TypeKind == TypeKind.Interface))
result.Append (Highlight ("abstract ", colorStyle.KeywordModifiers));
}
+ // TODO!!!!
+ // if (entity.IsShadowing)
+ // result.Append (Highlight ("new ", colorStyle.KeywordModifiers));
- if (entity.IsShadowing)
- result.Append (Highlight ("new ", colorStyle.KeywordModifiers));
-
- var member = entity as IMember;
- if (member != null) {
- if (member.IsOverride) {
+ var method = entity as IMethodSymbol;
+ if (method != null) {
+ if (method.IsOverride) {
result.Append (Highlight ("override ", colorStyle.KeywordModifiers));
- } else if (member.IsVirtual) {
+ } else if (method.IsVirtual) {
result.Append (Highlight ("virtual ", colorStyle.KeywordModifiers));
}
+ if (method.IsAsync)
+ result.Append (Highlight ("async ", colorStyle.KeywordModifiers));
+ if (method.PartialDefinitionPart != null || method.PartialImplementationPart != null)
+ result.Append (Highlight ("partial ", colorStyle.KeywordModifiers));
}
if (field != null) {
if (field.IsVolatile)
@@ -247,18 +297,11 @@ namespace MonoDevelop.CSharp
result.Append (Highlight ("readonly ", colorStyle.KeywordModifiers));
}
- var method = entity as IMethod;
- if (method != null) {
- if (method.IsAsync)
- result.Append (Highlight ("async ", colorStyle.KeywordModifiers));
- if (method.IsPartial)
- result.Append (Highlight ("partial ", colorStyle.KeywordModifiers));
- }
}
- void AppendAccessibility (StringBuilder result, IMethod entity)
+ void AppendAccessibility (StringBuilder result, IMethodSymbol entity)
{
- switch (entity.Accessibility) {
+ switch (entity.DeclaredAccessibility) {
case Accessibility.Internal:
result.Append (Highlight ("internal", colorStyle.KeywordModifiers));
break;
@@ -309,13 +352,12 @@ namespace MonoDevelop.CSharp
return result;
}
- static bool IsObjectOrValueType (IType type)
+ static bool IsObjectOrValueType (ITypeSymbol type)
{
- var d = type.GetDefinition ();
- return d != null && (d.KnownTypeCode == KnownTypeCode.Object || d.KnownTypeCode == KnownTypeCode.ValueType);
+ return type != null && (type.SpecialType == SpecialType.System_Object || type.IsValueType);
}
- string GetTypeParameterMarkup (IType t)
+ string GetTypeParameterMarkup (ITypeSymbol t)
{
if (t == null)
throw new ArgumentNullException ("t");
@@ -324,12 +366,12 @@ namespace MonoDevelop.CSharp
result.Append (highlightedTypeName);
var color = AlphaBlend (colorStyle.PlainText.Foreground, colorStyle.PlainText.Background, optionalAlpha);
- var colorString = Mono.TextEditor.HelperMethods.GetColorString (color);
+ var colorString = MonoDevelop.Components.HelperMethods.GetColorString (color);
result.Append ("<span foreground=\"" + colorString + "\">" + " (type parameter)</span>");
- var tp = t as ITypeParameter;
+ var tp = t as ITypeParameterSymbol;
if (tp != null) {
- if (!tp.HasDefaultConstructorConstraint && !tp.HasReferenceTypeConstraint && !tp.HasValueTypeConstraint && tp.DirectBaseTypes.All (IsObjectOrValueType))
+ if (!tp.HasConstructorConstraint && !tp.HasReferenceTypeConstraint && !tp.HasValueTypeConstraint && tp.ConstraintTypes.All (IsObjectOrValueType))
return result.ToString ();
result.AppendLine ();
result.Append (Highlight (" where ", colorStyle.KeywordContext));
@@ -344,7 +386,7 @@ namespace MonoDevelop.CSharp
constraints++;
result.Append (Highlight ("struct", colorStyle.KeywordDeclaration));
}
- foreach (var bt in tp.DirectBaseTypes) {
+ foreach (var bt in tp.ConstraintTypes) {
if (!IsObjectOrValueType (bt)) {
if (constraints > 0) {
result.Append (",");
@@ -357,7 +399,7 @@ namespace MonoDevelop.CSharp
result.Append (GetTypeReferenceString (bt));
}
}
- if (tp.HasDefaultConstructorConstraint) {
+ if (tp.HasConstructorConstraint) {
if (constraints > 0)
result.Append (",");
result.Append (Highlight ("new", colorStyle.KeywordOperators));
@@ -367,62 +409,70 @@ namespace MonoDevelop.CSharp
return result.ToString ();
}
- string GetNullableMarkup (IType t)
+ string GetNullableMarkup (ITypeSymbol t)
{
var result = new StringBuilder ();
result.Append (GetTypeReferenceString (t));
return result.ToString ();
}
- void AppendTypeParameterList (StringBuilder result, ITypeDefinition def)
+ void AppendTypeParameterList (StringBuilder result, INamedTypeSymbol def)
{
- IEnumerable<ITypeParameter> parameters = def.TypeParameters;
- if (def.DeclaringTypeDefinition != null)
- parameters = parameters.Skip (def.DeclaringTypeDefinition.TypeParameterCount);
+ var parameters = def.TypeParameters;
+ // if (def.ContainingType != null)
+ // parameters = parameters.Skip (def.DeclaringTypeDefinition.TypeParameterCount);
AppendTypeParameters (result, parameters);
}
- void AppendTypeArgumentList (StringBuilder result, IType def)
+ void AppendTypeArgumentList (StringBuilder result, INamedTypeSymbol def)
{
- IEnumerable<IType> parameters = def.TypeArguments;
- if (def.DeclaringType != null)
- parameters = parameters.Skip (def.DeclaringType.TypeParameterCount);
+ var parameters = def.TypeArguments;
+ // if (def.DeclaringType != null)
+ // parameters = parameters.Skip (def.DeclaringType.TypeParameterCount);
AppendTypeParameters (result, parameters);
}
- string GetTypeNameWithParameters (IType t)
+ string GetTypeNameWithParameters (ITypeSymbol t)
{
StringBuilder result = new StringBuilder ();
result.Append (Highlight (FilterEntityName (t.Name), colorStyle.UserTypesTypeParameters));
- if (t.TypeParameterCount > 0) {
- if (t.TypeArguments.Count > 0) {
- AppendTypeArgumentList (result, t);
- } else {
- AppendTypeParameterList (result, t.GetDefinition ());
+ var namedTypeSymbol = t as INamedTypeSymbol;
+ if (namedTypeSymbol != null) {
+ if (namedTypeSymbol.IsGenericType) {
+ AppendTypeParameterList (result, namedTypeSymbol);
+ } else if (namedTypeSymbol.IsUnboundGenericType) {
+ AppendTypeArgumentList (result, namedTypeSymbol);
}
}
return result.ToString ();
}
- string GetTypeMarkup (IType t, bool includeDeclaringTypes = false)
+ public static bool IsNullableType (ITypeSymbol type)
+ {
+ var original = type.OriginalDefinition;
+ return original.SpecialType == SpecialType.System_Nullable_T;
+ }
+
+
+ string GetTypeMarkup (ITypeSymbol t, bool includeDeclaringTypes = false)
{
if (t == null)
throw new ArgumentNullException ("t");
- if (t.Kind == TypeKind.Null)
+ if (t.TypeKind == TypeKind.Error)
return "Type can not be resolved.";
- if (t.Kind == TypeKind.Delegate)
- return GetDelegateMarkup (t);
- if (t.Kind == TypeKind.TypeParameter)
+ if (t.TypeKind == TypeKind.Delegate)
+ return GetDelegateMarkup ((INamedTypeSymbol)t);
+ if (t.TypeKind == TypeKind.TypeParameter)
return GetTypeParameterMarkup (t);
- if (t.Kind == TypeKind.Array || t.Kind == TypeKind.Pointer)
+ if (t.TypeKind == TypeKind.Array || t.TypeKind == TypeKind.Pointer)
return GetTypeReferenceString (t);
- if (NullableType.IsNullable (t))
+ if (t.IsNullable ())
return GetNullableMarkup (t);
var result = new StringBuilder ();
- if (t.GetDefinition () != null)
- AppendModifiers (result, t.GetDefinition ());
+ if (IsNullableType (t))
+ AppendModifiers (result, t);
- switch (t.Kind) {
+ switch (t.TypeKind) {
case TypeKind.Class:
result.Append (Highlight ("class ", colorStyle.KeywordDeclaration));
break;
@@ -442,7 +492,7 @@ namespace MonoDevelop.CSharp
var curType = t;
while (curType != null) {
typeNames.Add (GetTypeNameWithParameters (curType));
- curType = curType.DeclaringType;
+ curType = curType.ContainingType;
}
typeNames.Reverse ();
result.Append (string.Join (".", typeNames));
@@ -450,21 +500,26 @@ namespace MonoDevelop.CSharp
result.Append (GetTypeNameWithParameters (t));
}
- if (t.Kind == TypeKind.Array)
+ if (t.TypeKind == TypeKind.Array)
return result.ToString ();
bool first = true;
int maxLength = GetMarkupLength (result.ToString ());
int length = maxLength;
- var sortedTypes = new List<IType> (t.DirectBaseTypes.Where (x => x.FullName != "System.Object"));
+ var sortedTypes = new List<INamedTypeSymbol> (t.Interfaces);
+
sortedTypes.Sort ((x, y) => GetTypeReferenceString (y).Length.CompareTo (GetTypeReferenceString (x).Length));
- if (t.Kind != TypeKind.Enum) {
+
+ if (t.BaseType != null && t.BaseType.SpecialType != SpecialType.System_Object)
+ sortedTypes.Insert (0, t.BaseType);
+
+ if (t.TypeKind != TypeKind.Enum) {
foreach (var directBaseType in sortedTypes) {
if (first) {
result.AppendLine (" :");
result.Append (" ");
length = 2;
- } else {
+ } else { // 5.5. um 10:45
result.Append (", ");
length += 2;
}
@@ -480,9 +535,9 @@ namespace MonoDevelop.CSharp
length += GetMarkupLength (typeRef);
first = false;
}
- } else {
- var enumBase = t.GetDefinition ().EnumUnderlyingType;
- if (enumBase.Name != "Int32") {
+ } else {
+ var enumBase = t.BaseType;
+ if (enumBase.SpecialType != SpecialType.System_Int32) {
result.AppendLine (" :");
result.Append (" ");
result.Append (GetTypeReferenceString (enumBase, false));
@@ -492,7 +547,7 @@ namespace MonoDevelop.CSharp
return result.ToString ();
}
- void AppendTypeParameters (StringBuilder result, IEnumerable<ITypeParameter> typeParameters)
+ void AppendTypeParameters (StringBuilder result, ImmutableArray<ITypeParameterSymbol> typeParameters)
{
if (!typeParameters.Any ())
return;
@@ -514,7 +569,7 @@ namespace MonoDevelop.CSharp
result.Append ("&gt;");
}
- void AppendTypeParameters (StringBuilder result, IEnumerable<IType> typeParameters)
+ void AppendTypeParameters (StringBuilder result, ImmutableArray<ITypeSymbol> typeParameters)
{
if (!typeParameters.Any ())
return;
@@ -529,8 +584,8 @@ namespace MonoDevelop.CSharp
result.Append (", ");
}
}
- if (typeParameter is ITypeParameter)
- AppendVariance (result, ((ITypeParameter)typeParameter).Variance);
+ if (typeParameter is ITypeParameterSymbol)
+ AppendVariance (result, ((ITypeParameterSymbol)typeParameter).Variance);
result.Append (GetTypeReferenceString (typeParameter, false));
i++;
}
@@ -539,17 +594,17 @@ namespace MonoDevelop.CSharp
static string FilterEntityName (string name)
{
- return AmbienceService.EscapeText (CSharpAmbience.FilterName (name));
+ return MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (CSharpAmbience.FilterName (name));
}
- public string GetDelegateInfo (IType type)
+ public string GetDelegateInfo (ITypeSymbol type)
{
if (type == null)
- throw new ArgumentNullException ("returnType");
- var t = type.GetDefinition ();
+ throw new ArgumentNullException ("type");
+ var t = type;
var result = new StringBuilder ();
-
+
var method = t.GetDelegateInvokeMethod ();
result.Append (GetTypeReferenceString (method.ReturnType));
if (BreakLineAfterReturnType) {
@@ -557,99 +612,130 @@ namespace MonoDevelop.CSharp
} else {
result.Append (" ");
}
-
-
+
+
result.Append (FilterEntityName (t.Name));
-
+
AppendTypeParameters (result, method.TypeParameters);
- if (formattingOptions.SpaceBeforeDelegateDeclarationParentheses)
- result.Append (" ");
-
+ // TODO:
+ // if (document.GetOptionSet ().GetOption (CSharpFormattingOptions.SpaceBeforeDelegateDeclarationParentheses))
+ // result.Append (" ");
+
result.Append ('(');
- AppendParameterList (result, method.Parameters, formattingOptions.SpaceBeforeDelegateDeclarationParameterComma, formattingOptions.SpaceAfterDelegateDeclarationParameterComma, false);
+ AppendParameterList (
+ result,
+ method.Parameters,
+ false /* formattingOptions.SpaceBeforeDelegateDeclarationParameterComma */,
+ true /* formattingOptions.SpaceAfterDelegateDeclarationParameterComma*/,
+ false
+ );
result.Append (')');
return result.ToString ();
}
- string GetDelegateMarkup (IType delegateType)
+ string GetDelegateMarkup (INamedTypeSymbol delegateType)
{
var result = new StringBuilder ();
-
- var method = delegateType.GetDelegateInvokeMethod ();
+ var type = delegateType.IsUnboundGenericType ? delegateType.OriginalDefinition : delegateType;
+ var method = type.GetDelegateInvokeMethod ();
- if (delegateType.GetDefinition () != null)
- AppendModifiers (result, delegateType.GetDefinition ());
+ AppendModifiers (result, type);
result.Append (Highlight ("delegate ", colorStyle.KeywordDeclaration));
- result.Append (GetTypeReferenceString (method.ReturnType));
+ if (method != null)
+ result.Append (GetTypeReferenceString (method.ReturnType));
if (BreakLineAfterReturnType) {
result.AppendLine ();
} else {
result.Append (" ");
}
-
-
- result.Append (FilterEntityName (delegateType.Name));
- if (delegateType.TypeArguments.Count > 0) {
- AppendTypeArgumentList (result, delegateType);
+
+ result.Append (FilterEntityName (type.Name));
+
+ if (type.TypeArguments.Length > 0) {
+ AppendTypeArgumentList (result, type);
} else {
- AppendTypeParameterList (result, delegateType.GetDefinition ());
+ AppendTypeParameterList (result, type);
}
+ // TODO
+ // if (formattingOptions.SpaceBeforeMethodDeclarationParameterComma)
+ // result.Append (" ");
- if (formattingOptions.SpaceBeforeMethodDeclarationParameterComma)
- result.Append (" ");
-
result.Append ('(');
- AppendParameterList (result, method.Parameters, formattingOptions.SpaceBeforeDelegateDeclarationParameterComma, formattingOptions.SpaceAfterDelegateDeclarationParameterComma);
+ AppendParameterList (
+ result,
+ method.Parameters,
+ false /* formattingOptions.SpaceBeforeDelegateDeclarationParameterComma */,
+ false /* formattingOptions.SpaceAfterDelegateDeclarationParameterComma */);
result.Append (')');
return result.ToString ();
}
- public string GetLocalVariableMarkup (IVariable variable)
+ string GetLocalVariableMarkup (ILocalSymbol local)
{
- if (variable == null)
- throw new ArgumentNullException ("field");
-
+ if (local == null)
+ throw new ArgumentNullException ("local");
+
var result = new StringBuilder ();
- if (variable.IsConst)
+ if (local.IsConst)
result.Append (Highlight ("const ", colorStyle.KeywordModifiers));
- result.Append (GetTypeReferenceString (variable.Type));
+ result.Append (GetTypeReferenceString (local.Type));
if (BreakLineAfterReturnType) {
result.AppendLine ();
} else {
result.Append (" ");
}
-
- result.Append (FilterEntityName (variable.Name));
-
- if (variable.IsConst) {
- if (formattingOptions.SpaceAroundAssignment) {
+
+ result.Append (FilterEntityName (local.Name));
+
+ if (local.IsConst) {
+ if (options.GetOption (CSharpFormattingOptions.SpacingAroundBinaryOperator) == BinaryOperatorSpacingOptions.Single) {
result.Append (" = ");
} else {
result.Append ("=");
}
- AppendConstant (result, variable.Type, variable.ConstantValue);
+ AppendConstant (result, local.Type, local.ConstantValue);
}
-
+
return result.ToString ();
}
+ string GetParameterVariableMarkup (IParameterSymbol parameter)
+ {
+ if (parameter == null)
+ throw new ArgumentNullException ("parameter");
- string GetFieldMarkup (IField field)
+ var result = new StringBuilder ();
+ AppendParameter (result, parameter);
+
+ if (parameter.HasExplicitDefaultValue) {
+ if (options.GetOption (CSharpFormattingOptions.SpacingAroundBinaryOperator) == BinaryOperatorSpacingOptions.Single) {
+ result.Append (" = ");
+ } else {
+ result.Append ("=");
+ }
+ AppendConstant (result, parameter.Type, parameter.ExplicitDefaultValue);
+ }
+
+ return result.ToString ();
+ }
+
+
+ string GetFieldMarkup (IFieldSymbol field)
{
if (field == null)
throw new ArgumentNullException ("field");
var result = new StringBuilder ();
- bool isEnum = field.DeclaringTypeDefinition != null && field.DeclaringTypeDefinition.Kind == TypeKind.Enum;
+ bool isEnum = field.ContainingType.TypeKind == TypeKind.Enum;
if (!isEnum) {
AppendModifiers (result, field);
- result.Append (GetTypeReferenceString (field.ReturnType));
+ result.Append (GetTypeReferenceString (field.Type));
} else {
- result.Append (GetTypeReferenceString (field.DeclaringType));
+ result.Append (GetTypeReferenceString (field.ContainingType));
}
if (BreakLineAfterReturnType) {
result.AppendLine ();
@@ -659,34 +745,36 @@ namespace MonoDevelop.CSharp
result.Append (HighlightSemantically (FilterEntityName (field.Name), colorStyle.UserFieldDeclaration));
- if (field.IsFixed) {
- if (formattingOptions.SpaceBeforeArrayDeclarationBrackets) {
- result.Append (" [");
- } else {
- result.Append ("[");
- }
- if (formattingOptions.SpacesWithinBrackets)
- result.Append (" ");
- AppendConstant (result, field.Type, field.ConstantValue);
- if (formattingOptions.SpacesWithinBrackets)
- result.Append (" ");
- result.Append ("]");
- } else if (field.IsConst) {
- if (isEnum && !(field.DeclaringTypeDefinition.Attributes.Any (attr => attr.AttributeType.FullName == "System.FlagsAttribute"))) {
+ // if (field.IsFixed) {
+ // if (formattingOptions.SpaceBeforeArrayDeclarationBrackets) {
+ // result.Append (" [");
+ // } else {
+ // result.Append ("[");
+ // }
+ // if (formattingOptions.SpacesWithinBrackets)
+ // result.Append (" ");
+ // AppendConstant (result, field.Type, field.ConstantValue);
+ // if (formattingOptions.SpacesWithinBrackets)
+ // result.Append (" ");
+ // result.Append ("]");
+ // } else
+
+ if (field.IsConst) {
+ if (isEnum && !(field.ContainingType.GetAttributes ().Any ((AttributeData attr) => attr.AttributeClass.Name == "FlagsAttribute" && attr.AttributeClass.ContainingNamespace.Name == "System"))) {
return result.ToString ();
}
- if (formattingOptions.SpaceAroundAssignment) {
+ if (options.GetOption (CSharpFormattingOptions.SpacingAroundBinaryOperator) == BinaryOperatorSpacingOptions.Single) {
result.Append (" = ");
} else {
result.Append ("=");
}
- AppendConstant (result, field.Type, field.ConstantValue, field.DeclaringType.Kind == TypeKind.Enum);
+ AppendConstant (result, field.Type, field.ConstantValue, isEnum);
}
return result.ToString ();
}
- string GetMethodMarkup (IMethod method)
+ string GetMethodMarkup (IMethodSymbol method)
{
if (method == null)
throw new ArgumentNullException ("method");
@@ -700,17 +788,17 @@ namespace MonoDevelop.CSharp
result.Append (" ");
}
- AppendExplicitInterfaces (result, method);
+ AppendExplicitInterfaces (result, method.ExplicitInterfaceImplementations.Cast<ISymbol> ());
- if (method.SymbolKind == SymbolKind.Operator) {
+ if (method.MethodKind == MethodKind.BuiltinOperator || method.MethodKind == MethodKind.UserDefinedOperator) {
result.Append ("operator ");
result.Append (CSharpAmbience.GetOperator (method.Name));
} else {
result.Append (HighlightSemantically (FilterEntityName (method.Name), colorStyle.UserMethodDeclaration));
}
- if (method.TypeArguments.Count > 0) {
+ if (method.TypeArguments.Length > 0) {
result.Append ("&lt;");
- for (int i = 0; i < method.TypeArguments.Count; i++) {
+ for (int i = 0; i < method.TypeArguments.Length; i++) {
if (i > 0)
result.Append (", ");
result.Append (HighlightSemantically (GetTypeReferenceString (method.TypeArguments [i], false), colorStyle.UserTypes));
@@ -719,18 +807,20 @@ namespace MonoDevelop.CSharp
} else {
AppendTypeParameters (result, method.TypeParameters);
}
-
- if (formattingOptions.SpaceBeforeMethodDeclarationParentheses)
- result.Append (" ");
+ // TODO!
+ // if (formattingOptions.SpaceBeforeMethodDeclarationParentheses)
+ // result.Append (" ");
result.Append ('(');
- IList<IParameter> parameters = method.Parameters;
- AppendParameterList (result, parameters, formattingOptions.SpaceBeforeMethodDeclarationParameterComma, formattingOptions.SpaceAfterMethodDeclarationParameterComma);
+ var parameters = method.Parameters;
+ AppendParameterList (result, parameters,
+ false /* formattingOptions.SpaceBeforeMethodDeclarationParameterComma*/,
+ false /* formattingOptions.SpaceAfterMethodDeclarationParameterComma*/);
result.Append (')');
return result.ToString ();
}
- string GetConstructorMarkup (IMethod method)
+ string GetConstructorMarkup (IMethodSymbol method)
{
if (method == null)
throw new ArgumentNullException ("method");
@@ -739,28 +829,32 @@ namespace MonoDevelop.CSharp
var result = new StringBuilder ();
AppendModifiers (result, method);
- result.Append (FilterEntityName (method.DeclaringType.Name));
-
- if (formattingOptions.SpaceBeforeConstructorDeclarationParentheses)
- result.Append (" ");
+ result.Append (FilterEntityName (method.ContainingType.Name));
+ //
+ // if (formattingOptions.SpaceBeforeConstructorDeclarationParentheses)
+ // result.Append (" ");
result.Append ('(');
- if (method.DeclaringType.Kind == TypeKind.Delegate) {
+ if (method.ContainingType.TypeKind == TypeKind.Delegate) {
result.Append (Highlight ("delegate", colorStyle.KeywordDeclaration) + " (");
- AppendParameterList (result, method.DeclaringType.GetDelegateInvokeMethod ().Parameters, formattingOptions.SpaceBeforeConstructorDeclarationParameterComma, formattingOptions.SpaceAfterConstructorDeclarationParameterComma);
+ AppendParameterList (result, method.ContainingType.GetDelegateInvokeMethod ().Parameters,
+ false /* formattingOptions.SpaceBeforeConstructorDeclarationParameterComma */,
+ false /* formattingOptions.SpaceAfterConstructorDeclarationParameterComma */);
result.Append (")");
} else {
- AppendParameterList (result, method.Parameters, formattingOptions.SpaceBeforeConstructorDeclarationParameterComma, formattingOptions.SpaceAfterConstructorDeclarationParameterComma);
+ AppendParameterList (result, method.Parameters,
+ false /* formattingOptions.SpaceBeforeConstructorDeclarationParameterComma */,
+ false /* formattingOptions.SpaceAfterConstructorDeclarationParameterComma */);
}
result.Append (')');
return result.ToString ();
}
- string GetDestructorMarkup (IMethod method)
+ string GetDestructorMarkup (IMethodSymbol method)
{
if (method == null)
throw new ArgumentNullException ("method");
-
+
var result = new StringBuilder ();
AppendModifiers (result, method);
if (BreakLineAfterReturnType) {
@@ -768,70 +862,77 @@ namespace MonoDevelop.CSharp
} else {
result.Append (" ");
}
-
+
result.Append ("~");
- result.Append (FilterEntityName (method.DeclaringType.Name));
-
- if (formattingOptions.SpaceBeforeConstructorDeclarationParentheses)
- result.Append (" ");
-
+ result.Append (FilterEntityName (method.ContainingType.Name));
+
+ // if (formattingOptions.SpaceBeforeConstructorDeclarationParentheses)
+ // result.Append (" ");
+
result.Append ('(');
- AppendParameterList (result, method.Parameters, formattingOptions.SpaceBeforeConstructorDeclarationParameterComma, formattingOptions.SpaceAfterConstructorDeclarationParameterComma);
+ AppendParameterList (result, method.Parameters,
+ false /* formattingOptions.SpaceBeforeConstructorDeclarationParameterComma */,
+ false /* formattingOptions.SpaceAfterConstructorDeclarationParameterComma */);
result.Append (')');
return result.ToString ();
}
- bool IsAccessibleOrHasSourceCode (IEntity entity)
+ bool IsAccessibleOrHasSourceCode (ISymbol entity)
{
- if (!entity.Region.Begin.IsEmpty)
+ if (entity.DeclaredAccessibility == Accessibility.Public)
return true;
- var lookup = new MemberLookup (resolver.CurrentTypeDefinition, resolver.Compilation.MainAssembly);
- return lookup.IsAccessible (entity, false);
+ return entity.IsDefinedInSource ();
+ // if (!entity.Region.Begin.IsEmpty)
+ // return true;
+ // var lookup = new MemberLookup (resolver.CurrentTypeDefinition, resolver.Compilation.MainAssembly);
+ // return lookup.IsAccessible (entity, false);
}
- string GetPropertyMarkup (IProperty property)
+ string GetPropertyMarkup (IPropertySymbol property)
{
if (property == null)
throw new ArgumentNullException ("property");
var result = new StringBuilder ();
AppendModifiers (result, property);
- result.Append (GetTypeReferenceString (property.ReturnType));
+ result.Append (GetTypeReferenceString (property.Type));
if (BreakLineAfterReturnType) {
result.AppendLine ();
} else {
result.Append (" ");
}
- AppendExplicitInterfaces (result, property);
-
- if (property.SymbolKind == SymbolKind.Indexer) {
+ AppendExplicitInterfaces (result, property.ExplicitInterfaceImplementations.Cast<ISymbol> ());
+
+ if (property.IsIndexer) {
result.Append (Highlight ("this", colorStyle.KeywordAccessors));
} else {
result.Append (HighlightSemantically (FilterEntityName (property.Name), colorStyle.UserPropertyDeclaration));
}
-
- if (property.Parameters.Count > 0) {
- if (formattingOptions.SpaceBeforeIndexerDeclarationBracket)
- result.Append (" ");
+
+ if (property.Parameters.Length > 0) {
+ // if (formattingOptions.SpaceBeforeIndexerDeclarationBracket)
+ // result.Append (" ");
result.Append ("[");
- AppendParameterList (result, property.Parameters, formattingOptions.SpaceBeforeIndexerDeclarationParameterComma, formattingOptions.SpaceAfterIndexerDeclarationParameterComma);
+ AppendParameterList (result, property.Parameters,
+ false /*formattingOptions.SpaceBeforeIndexerDeclarationParameterComma*/,
+ false /*formattingOptions.SpaceAfterIndexerDeclarationParameterComma*/);
result.Append ("]");
}
-
+
result.Append (" {");
- if (property.CanGet && IsAccessibleOrHasSourceCode (property.Getter)) {
- if (property.Getter.Accessibility != property.Accessibility) {
+ if (property.GetMethod != null && IsAccessibleOrHasSourceCode (property.GetMethod)) {
+ if (property.GetMethod.DeclaredAccessibility != property.DeclaredAccessibility) {
result.Append (" ");
- AppendAccessibility (result, property.Getter);
+ AppendAccessibility (result, property.GetMethod);
}
result.Append (Highlight (" get", colorStyle.KeywordProperty) + ";");
}
- if (property.CanSet && IsAccessibleOrHasSourceCode (property.Setter)) {
- if (property.Setter.Accessibility != property.Accessibility) {
+ if (property.SetMethod != null && IsAccessibleOrHasSourceCode (property.SetMethod)) {
+ if (property.SetMethod.DeclaredAccessibility != property.DeclaredAccessibility) {
result.Append (" ");
- AppendAccessibility (result, property.Setter);
+ AppendAccessibility (result, property.SetMethod);
}
result.Append (Highlight (" set", colorStyle.KeywordProperty) + ";");
}
@@ -840,18 +941,18 @@ namespace MonoDevelop.CSharp
return result.ToString ();
}
-
- public TooltipInformation GetExternAliasTooltip (ExternAliasDeclaration externAliasDeclaration, DotNetProject project)
+
+ public TooltipInformation GetExternAliasTooltip (ExternAliasDirectiveSyntax externAliasDeclaration, DotNetProject project)
{
var result = new TooltipInformation ();
- result.SignatureMarkup = Highlight ("extern ", colorStyle.KeywordModifiers) + Highlight ("alias ", colorStyle.KeywordNamespace) + externAliasDeclaration.Name;
+ result.SignatureMarkup = Highlight ("extern ", colorStyle.KeywordModifiers) + Highlight ("alias ", colorStyle.KeywordNamespace) + externAliasDeclaration.Identifier;
if (project == null)
return result;
foreach (var r in project.References) {
if (string.IsNullOrEmpty (r.Aliases))
continue;
foreach (var alias in r.Aliases.Split (',', ';')) {
- if (alias == externAliasDeclaration.Name)
+ if (alias == externAliasDeclaration.Identifier.ToFullString ())
result.AddCategory (GettextCatalog.GetString ("Reference"), r.StoredReference);
}
}
@@ -859,66 +960,61 @@ namespace MonoDevelop.CSharp
return result;
}
- public TooltipInformation GetKeywordTooltip (AstNode node)
- {
- return GetKeywordTooltip (node.ToString (), node);
- }
-
- public TooltipInformation GetKeywordTooltip (string keyword, AstNode hintNode)
+ public TooltipInformation GetKeywordTooltip (SyntaxToken node)
{
var result = new TooltipInformation ();
var color = AlphaBlend (colorStyle.PlainText.Foreground, colorStyle.PlainText.Background, optionalAlpha);
- var colorString = Mono.TextEditor.HelperMethods.GetColorString (color);
-
+ var colorString = MonoDevelop.Components.HelperMethods.GetColorString (color);
+
var keywordSign = "<span foreground=\"" + colorString + "\">" + " (keyword)</span>";
- switch (keyword) {
- case "abstract":
+ switch (node.Kind ()) {
+ case SyntaxKind.AbstractKeyword:
result.SignatureMarkup = Highlight ("abstract", colorStyle.KeywordModifiers) + keywordSign;
result.SummaryMarkup = "The " + Highlight ("abstract", colorStyle.KeywordModifiers) + " modifier can be used with classes, methods, properties, indexers, and events.";
break;
- case "add":
+ case SyntaxKind.AddKeyword:
result.SignatureMarkup = Highlight ("add", colorStyle.KeywordContext) + keywordSign;
result.AddCategory ("Form", "[modifiers] " + Highlight ("add", colorStyle.KeywordContext) + " { accessor-body }");
result.SummaryMarkup = "The " + Highlight ("add", colorStyle.KeywordContext) + " keyword is used to define a custom accessor for when an event is subscribed to. If supplied, a remove accessor must also be supplied.";
break;
- case "ascending":
+ case SyntaxKind.AscendingKeyword:
result.SignatureMarkup = Highlight ("ascending", colorStyle.KeywordContext) + keywordSign;
result.AddCategory ("Query Form", Highlight ("orderby", colorStyle.KeywordContext) + " ordering-statement " + Highlight ("ascending", colorStyle.KeywordContext));
result.SummaryMarkup = "The " + Highlight ("ascending", colorStyle.KeywordContext) + " keyword is used to set the sorting order from smallest to largest in a query expression. This is the default behaviour.";
break;
- case "async":
+ case SyntaxKind.AsyncKeyword:
result.SignatureMarkup = Highlight ("async", colorStyle.KeywordContext) + keywordSign;
result.SummaryMarkup = "The " + Highlight ("async", colorStyle.KeywordContext) + " modifier is used to specify that a class method, anonymous method, or lambda expression is asynchronous.";
break;
- case "as":
+ case SyntaxKind.AsKeyword:
result.SignatureMarkup = Highlight ("as", colorStyle.KeywordOperators) + keywordSign;
result.AddCategory ("Form", "expression " + Highlight ("as", colorStyle.KeywordOperators) + " type");
result.SummaryMarkup = "The " + Highlight ("as", colorStyle.KeywordOperators) + " operator is used to perform conversions between compatible types. ";
break;
- case "await":
+ case SyntaxKind.AwaitKeyword:
result.SignatureMarkup = Highlight ("await", colorStyle.KeywordContext) + keywordSign;
result.SummaryMarkup = "The " + Highlight ("await", colorStyle.KeywordContext) + " operator is used to specify that an " + Highlight ("async", colorStyle.KeywordContext) + " method is to have its execution suspended until the " + Highlight ("await", colorStyle.KeywordContext) +
" task has completed.";
break;
- case "base":
+ case SyntaxKind.BaseKeyword:
result.SignatureMarkup = Highlight ("base", colorStyle.KeywordAccessors) + keywordSign;
result.SummaryMarkup = "The " + Highlight ("base", colorStyle.KeywordAccessors) + " keyword is used to access members of the base class from within a derived class.";
break;
- case "break":
+ case SyntaxKind.BreakKeyword:
result.SignatureMarkup = Highlight ("break", colorStyle.KeywordJump) + keywordSign;
result.AddCategory ("Form", Highlight ("break", colorStyle.KeywordJump) + ";");
result.SummaryMarkup = "The " + Highlight ("break", colorStyle.KeywordJump) + " statement terminates the closest enclosing loop or switch statement in which it appears.";
break;
- case "case":
+ case SyntaxKind.CaseKeyword:
result.SignatureMarkup = Highlight ("case", colorStyle.KeywordSelection) + keywordSign;
result.AddCategory ("Form", Highlight ("case", colorStyle.KeywordSelection) + " constant-expression:" + Environment.NewLine +
" statement" + Environment.NewLine +
" jump-statement");
result.SummaryMarkup = "";
break;
- case "catch":
+ case SyntaxKind.CatchKeyword:
result.SignatureMarkup = Highlight ("catch", colorStyle.KeywordException) + keywordSign;
result.AddCategory ("Form", Highlight ("try", colorStyle.KeywordException) + " try-block" + Environment.NewLine +
" " + Highlight ("catch", colorStyle.KeywordException) + " (exception-declaration-1) catch-block-1" + Environment.NewLine +
@@ -927,37 +1023,41 @@ namespace MonoDevelop.CSharp
Highlight ("try", colorStyle.KeywordException) + " try-block " + Highlight ("catch", colorStyle.KeywordException) + " catch-block");
result.SummaryMarkup = "";
break;
- case "checked":
+ case SyntaxKind.CheckedKeyword:
result.SignatureMarkup = Highlight ("checked", colorStyle.KeywordOther) + keywordSign;
result.AddCategory ("Form", Highlight ("checked", colorStyle.KeywordOther) + " block" + Environment.NewLine +
"or" + Environment.NewLine +
Highlight ("checked", colorStyle.KeywordOther) + " (expression)");
result.SummaryMarkup = "The " + Highlight ("checked", colorStyle.KeywordOther) + " keyword is used to control the overflow-checking context for integral-type arithmetic operations and conversions. It can be used as an operator or a statement.";
break;
- case "class":
+ case SyntaxKind.ClassKeyword:
result.SignatureMarkup = Highlight ("class", colorStyle.KeywordDeclaration) + keywordSign;
- result.AddCategory ("Form", "[attributes] [modifiers] " + Highlight ("class", colorStyle.KeywordDeclaration) + " identifier [:base-list] { class-body }[;]");
- result.SummaryMarkup = "Classes are declared using the keyword " + Highlight ("class", colorStyle.KeywordDeclaration) + ".";
+ if (node.Parent != null && node.Parent.IsKind (SyntaxKind.ConstructorConstraint)) {
+ result.SummaryMarkup = "The " + Highlight ("class", colorStyle.KeywordDeclaration) + " constraint specifies that the type argument must be a reference type; this applies also to any class, interface, delegate, or array type.";
+ } else {
+ result.AddCategory ("Form", "[attributes] [modifiers] " + Highlight ("class", colorStyle.KeywordDeclaration) + " identifier [:base-list] { class-body }[;]");
+ result.SummaryMarkup = "Classes are declared using the keyword " + Highlight ("class", colorStyle.KeywordDeclaration) + ".";
+ }
break;
- case "const":
+ case SyntaxKind.ConstKeyword:
result.SignatureMarkup = Highlight ("const", colorStyle.KeywordModifiers) + keywordSign;
result.AddCategory ("Form", "[attributes] [modifiers] " + Highlight ("const", colorStyle.KeywordModifiers) + " type declarators;");
result.SummaryMarkup = "The " + Highlight ("const", colorStyle.KeywordModifiers) + " keyword is used to modify a declaration of a field or local variable. It specifies that the value of the field or the local variable cannot be modified. ";
break;
- case "continue":
+ case SyntaxKind.ContinueKeyword:
result.SignatureMarkup = Highlight ("continue", colorStyle.KeywordJump) + keywordSign;
result.AddCategory ("Form", Highlight ("continue", colorStyle.KeywordJump) + ";");
result.SummaryMarkup = "The " + Highlight ("continue", colorStyle.KeywordJump) + " statement passes control to the next iteration of the enclosing iteration statement in which it appears.";
break;
- case "default":
+ case SyntaxKind.DefaultKeyword:
result.SignatureMarkup = Highlight ("default", colorStyle.KeywordSelection) + keywordSign;
result.SummaryMarkup = "";
- if (hintNode != null) {
- if (hintNode.Parent is DefaultValueExpression) {
+ if (node.Parent != null) {
+ if (node.Parent is DefaultExpressionSyntax) {
result.AddCategory ("Form",
Highlight ("default", colorStyle.KeywordSelection) + " (Type)");
break;
- } else if (hintNode.Parent is CaseLabel) {
+ } else if (node.Parent is SwitchStatementSyntax) {
result.AddCategory ("Form",
Highlight ("switch", colorStyle.KeywordSelection) + " (expression) { " + Environment.NewLine +
" " + Highlight ("case", colorStyle.KeywordSelection) + " constant-expression:" + Environment.NewLine +
@@ -972,36 +1072,43 @@ namespace MonoDevelop.CSharp
}
result.AddCategory ("Form",
Highlight ("default", colorStyle.KeywordSelection) + " (Type)" + Environment.NewLine + Environment.NewLine +
- "or" + Environment.NewLine + Environment.NewLine +
+ "or" + Environment.NewLine + Environment.NewLine +
Highlight ("switch", colorStyle.KeywordSelection) + " (expression) { " + Environment.NewLine +
- " " + Highlight ("case", colorStyle.KeywordSelection) + " constant-expression:" + Environment.NewLine +
- " statement" + Environment.NewLine +
- " jump-statement" + Environment.NewLine +
- " [" + Highlight ("default", colorStyle.KeywordSelection) + ":" + Environment.NewLine +
- " statement" + Environment.NewLine +
- " jump-statement]" + Environment.NewLine +
- "}");
- break;
- case "delegate":
+ " " + Highlight ("case", colorStyle.KeywordSelection) + " constant-expression:" + Environment.NewLine +
+ " statement" + Environment.NewLine +
+ " jump-statement" + Environment.NewLine +
+ " [" + Highlight ("default", colorStyle.KeywordSelection) + ":" + Environment.NewLine +
+ " statement" + Environment.NewLine +
+ " jump-statement]" + Environment.NewLine +
+ "}");
+ break;
+ case SyntaxKind.DelegateKeyword:
result.SignatureMarkup = Highlight ("delegate", colorStyle.KeywordDeclaration) + keywordSign;
result.AddCategory ("Form", "[attributes] [modifiers] " + Highlight ("delegate", colorStyle.KeywordDeclaration) + " result-type identifier ([formal-parameters]);");
result.SummaryMarkup = "A " + Highlight ("delegate", colorStyle.KeywordDeclaration) + " declaration defines a reference type that can be used to encapsulate a method with a specific signature.";
break;
- case "dynamic":
- result.SignatureMarkup = Highlight ("dynamic", colorStyle.KeywordContext) + keywordSign;
- result.SummaryMarkup = "The " + Highlight ("dynamic", colorStyle.KeywordContext) + " type allows for an object to bypass compile-time type checking and resolve type checking during run-time.";
+ case SyntaxKind.IdentifierToken:
+ if (node.ToFullString () == "nameof" && node.Parent?.Parent?.Kind () == SyntaxKind.InvocationExpression)
+ goto case SyntaxKind.NameOfKeyword;
+
+ if (node.ToFullString () == "dynamic") {
+ result.SignatureMarkup = Highlight ("dynamic", colorStyle.KeywordContext) + keywordSign;
+ result.SummaryMarkup = "The " + Highlight ("dynamic", colorStyle.KeywordContext) + " type allows for an object to bypass compile-time type checking and resolve type checking during run-time.";
+ } else {
+ return null;
+ }
break;
- case "descending":
+ case SyntaxKind.DescendingKeyword:
result.SignatureMarkup = Highlight ("descending", colorStyle.KeywordContext) + keywordSign;
result.AddCategory ("Query Form", Highlight ("orderby", colorStyle.KeywordContext) + " ordering-statement " + Highlight ("descending", colorStyle.KeywordContext));
result.SummaryMarkup = "The " + Highlight ("descending", colorStyle.KeywordContext) + " keyword is used to set the sorting order from largest to smallest in a query expression.";
break;
- case "do":
+ case SyntaxKind.DoKeyword:
result.SignatureMarkup = Highlight ("do", colorStyle.KeywordIteration) + keywordSign;
result.AddCategory ("Form", Highlight ("do", colorStyle.KeywordIteration) + " statement " + Highlight ("while", colorStyle.KeywordIteration) + " (expression);");
result.SummaryMarkup = "The " + Highlight ("do", colorStyle.KeywordIteration) + " statement executes a statement or a block of statements repeatedly until a specified expression evaluates to false.";
break;
- case "else":
+ case SyntaxKind.ElseKeyword:
result.SignatureMarkup = Highlight ("else", colorStyle.KeywordSelection) + keywordSign;
result.AddCategory ("Form", Highlight ("if", colorStyle.KeywordSelection) + " (expression)" + Environment.NewLine +
" statement1" + Environment.NewLine +
@@ -1009,69 +1116,69 @@ namespace MonoDevelop.CSharp
" statement2]");
result.SummaryMarkup = "";
break;
- case "enum":
+ case SyntaxKind.EnumKeyword:
result.SignatureMarkup = Highlight ("enum", colorStyle.KeywordDeclaration) + keywordSign;
result.AddCategory ("Form", "[attributes] [modifiers] " + Highlight ("enum", colorStyle.KeywordDeclaration) + " identifier [:base-type] {enumerator-list} [;]");
result.SummaryMarkup = "The " + Highlight ("enum", colorStyle.KeywordDeclaration) + " keyword is used to declare an enumeration, a distinct type consisting of a set of named constants called the enumerator list.";
break;
- case "event":
+ case SyntaxKind.EventKeyword:
result.SignatureMarkup = Highlight ("event", colorStyle.KeywordModifiers) + keywordSign;
result.AddCategory ("Form", "[attributes] [modifiers] " + Highlight ("event", colorStyle.KeywordModifiers) + " type declarator;" + Environment.NewLine +
"[attributes] [modifiers] " + Highlight ("event", colorStyle.KeywordModifiers) + " type member-name {accessor-declarations};");
result.SummaryMarkup = "Specifies an event.";
break;
- case "explicit":
+ case SyntaxKind.ExplicitKeyword:
result.SignatureMarkup = Highlight ("explicit", colorStyle.KeywordOperatorDeclaration) + keywordSign;
result.SummaryMarkup = "The " + Highlight ("explicit", colorStyle.KeywordOperatorDeclaration) + " keyword is used to declare an explicit user-defined type conversion operator.";
break;
- case "extern":
+ case SyntaxKind.ExternKeyword:
result.SignatureMarkup = Highlight ("extern", colorStyle.KeywordModifiers) + keywordSign;
result.SummaryMarkup = "Use the " + Highlight ("extern", colorStyle.KeywordModifiers) + " modifier in a method declaration to indicate that the method is implemented externally. A common use of the extern modifier is with the DllImport attribute.";
break;
- case "finally":
+ case SyntaxKind.FinallyKeyword:
result.SignatureMarkup = Highlight ("finally", colorStyle.KeywordException) + keywordSign;
result.AddCategory ("Form", Highlight ("try", colorStyle.KeywordException) + " try-block " + Highlight ("finally", colorStyle.KeywordException) + " finally-block");
result.SummaryMarkup = "The " + Highlight ("finally", colorStyle.KeywordException) + " block is useful for cleaning up any resources allocated in the try block. Control is always passed to the finally block regardless of how the try block exits.";
break;
- case "fixed":
+ case SyntaxKind.FixedKeyword:
result.SignatureMarkup = Highlight ("fixed", colorStyle.KeywordOther) + keywordSign;
result.AddCategory ("Form", Highlight ("fixed", colorStyle.KeywordOther) + " ( type* ptr = expr ) statement");
result.SummaryMarkup = "Prevents relocation of a variable by the garbage collector.";
break;
- case "for":
+ case SyntaxKind.ForKeyword:
result.SignatureMarkup = Highlight ("for", colorStyle.KeywordIteration) + keywordSign;
result.AddCategory ("Form", Highlight ("for", colorStyle.KeywordIteration) + " ([initializers]; [expression]; [iterators]) statement");
result.SummaryMarkup = "The " + Highlight ("for", colorStyle.KeywordIteration) + " loop executes a statement or a block of statements repeatedly until a specified expression evaluates to false.";
break;
- case "foreach":
+ case SyntaxKind.ForEachKeyword:
result.SignatureMarkup = Highlight ("foreach", colorStyle.KeywordIteration) + keywordSign;
result.AddCategory ("Form", Highlight ("foreach", colorStyle.KeywordIteration) + " (type identifier " + Highlight ("in", colorStyle.KeywordIteration) + " expression) statement");
result.SummaryMarkup = "The " + Highlight ("foreach", colorStyle.KeywordIteration) + " statement repeats a group of embedded statements for each element in an array or an object collection. ";
break;
- case "from":
+ case SyntaxKind.FromKeyword:
result.SignatureMarkup = Highlight ("from", colorStyle.KeywordContext) + keywordSign;
result.AddCategory ("Form", Highlight ("from", colorStyle.KeywordContext) + " range-variable " + Highlight ("in", colorStyle.KeywordIteration)
+ " data-source [query clauses] " + Highlight ("select", colorStyle.KeywordContext) + " product-expression");
result.SummaryMarkup = "The " + Highlight ("from", colorStyle.KeywordContext) + " keyword marks the beginning of a query expression and defines the data source and local variable to represent the elements in the sequence.";
break;
- case "get":
+ case SyntaxKind.GetKeyword:
result.SignatureMarkup = Highlight ("get", colorStyle.KeywordContext) + keywordSign;
result.AddCategory ("Form", "[modifiers] " + Highlight ("get", colorStyle.KeywordContext) + " [ { accessor-body } ]");
result.SummaryMarkup = "The " + Highlight ("get", colorStyle.KeywordContext) + " keyword is used to define an accessor method to retrieve the value of the property or indexer element.";
break;
- case "global":
+ case SyntaxKind.GlobalKeyword:
result.SignatureMarkup = Highlight ("global", colorStyle.KeywordContext) + keywordSign;
result.AddCategory ("Form", Highlight ("global", colorStyle.KeywordContext) + " :: type");
result.SummaryMarkup = "The " + Highlight ("global", colorStyle.KeywordContext) + " keyword is used to specify a type is within the global namespace.";
break;
- case "goto":
+ case SyntaxKind.GotoKeyword:
result.SignatureMarkup = Highlight ("goto", colorStyle.KeywordJump) + keywordSign;
result.AddCategory ("Form", Highlight ("goto", colorStyle.KeywordJump) + " identifier;" + Environment.NewLine +
Highlight ("goto", colorStyle.KeywordJump) + " " + Highlight ("case", colorStyle.KeywordSelection) + " constant-expression;" + Environment.NewLine +
Highlight ("goto", colorStyle.KeywordJump) + " " + Highlight ("default", colorStyle.KeywordSelection) + ";");
result.SummaryMarkup = "The " + Highlight ("goto", colorStyle.KeywordJump) + " statement transfers the program control directly to a labeled statement. ";
break;
- case "group":
+ case SyntaxKind.GroupKeyword:
result.SignatureMarkup = Highlight ("group", colorStyle.KeywordContext) + keywordSign;
result.AddCategory ("Query Form", Highlight ("group", colorStyle.KeywordContext) + " range-variable " + Highlight ("by", colorStyle.KeywordContext) + "key-value"
+ Environment.NewLine + Environment.NewLine + "or" + Environment.NewLine + Environment.NewLine +
@@ -1079,7 +1186,7 @@ namespace MonoDevelop.CSharp
result.SummaryMarkup = "The " + Highlight ("group", colorStyle.KeywordContext) + " keyword groups elements together from a query which match the key value and stores the result in an "
+ Highlight ("IGrouping&lt;TKey, TElement&gt;", colorStyle.KeywordTypes) + ". It can also be stored in a group for further use in the query with 'into'.";
break;
- case "if":
+ case SyntaxKind.IfKeyword:
result.SignatureMarkup = Highlight ("if", colorStyle.KeywordSelection) + keywordSign;
result.AddCategory ("Form", Highlight ("if", colorStyle.KeywordSelection) + " (expression)" + Environment.NewLine +
" statement1" + Environment.NewLine +
@@ -1087,29 +1194,29 @@ namespace MonoDevelop.CSharp
" statement2]");
result.SummaryMarkup = "The " + Highlight ("if", colorStyle.KeywordSelection) + " statement selects a statement for execution based on the value of a Boolean expression. ";
break;
- case "into":
+ case SyntaxKind.IntoKeyword:
result.SignatureMarkup = Highlight ("into", colorStyle.KeywordContext) + keywordSign;
result.AddCategory ("Query Form", Highlight ("group", colorStyle.KeywordContext) + " range-variable " + Highlight ("by", colorStyle.KeywordContext) + " key-value " + Highlight ("into", colorStyle.KeywordContext) + " group-name ");
result.SummaryMarkup = "The " + Highlight ("into", colorStyle.KeywordContext) + " keyword stores the result of a group statement for further use in the query.";
break;
- case "implicit":
+ case SyntaxKind.ImplicitKeyword:
result.SignatureMarkup = Highlight ("implicit", colorStyle.KeywordOperatorDeclaration) + keywordSign;
result.SummaryMarkup = "The " + Highlight ("implicit", colorStyle.KeywordOperatorDeclaration) + " keyword is used to declare an implicit user-defined type conversion operator.";
break;
- case "in":
+ case SyntaxKind.InKeyword:
result.SignatureMarkup = Highlight ("in", colorStyle.KeywordIteration) + keywordSign;
- if (hintNode != null) {
- if (hintNode.Parent is ForeachStatement) {
+ if (node.Parent != null) {
+ if (node.Parent is ForEachStatementSyntax) {
result.AddCategory ("Form",
Highlight ("foreach", colorStyle.KeywordIteration) + " (type identifier " + Highlight ("in", colorStyle.KeywordIteration) + " expression) statement");
break;
}
- if (hintNode.Parent is QueryFromClause) {
+ if (node.Parent is FromClauseSyntax) {
result.AddCategory ("Form",
Highlight ("from", colorStyle.KeywordContext) + " range-variable " + Highlight ("in", colorStyle.KeywordIteration) + " data-source [query clauses] " + Highlight ("select", colorStyle.KeywordContext) + " product-expression");
break;
}
- if (hintNode.Parent is TypeParameterDeclaration) {
+ if (node.Parent is TypeParameterConstraintClauseSyntax) {
result.AddCategory ("Form",
Highlight ("interface", colorStyle.KeywordDeclaration) + " IMyInterface&lt;" + Highlight ("in", colorStyle.KeywordIteration) + " T&gt; {}");
break;
@@ -1122,52 +1229,56 @@ namespace MonoDevelop.CSharp
Highlight ("interface", colorStyle.KeywordDeclaration) + " IMyInterface&lt;" + Highlight ("in", colorStyle.KeywordIteration) + " T&gt; {}"
);
break;
- case "interface":
+ case SyntaxKind.InterfaceKeyword:
result.SignatureMarkup = Highlight ("interface", colorStyle.KeywordDeclaration) + keywordSign;
result.AddCategory ("Form", "[attributes] [modifiers] " + Highlight ("interface", colorStyle.KeywordDeclaration) + " identifier [:base-list] {interface-body}[;]");
result.SummaryMarkup = "An interface defines a contract. A class or struct that implements an interface must adhere to its contract.";
break;
- case "internal":
+ case SyntaxKind.InternalKeyword:
result.SignatureMarkup = Highlight ("internal", colorStyle.KeywordModifiers) + keywordSign;
result.SummaryMarkup = "The " + Highlight ("internal", colorStyle.KeywordModifiers) + " keyword is an access modifier for types and type members. Internal members are accessible only within files in the same assembly.";
break;
- case "is":
+ case SyntaxKind.IsKeyword:
result.SignatureMarkup = Highlight ("is", colorStyle.KeywordOperators) + keywordSign;
result.AddCategory ("Form", "expression " + Highlight ("is", colorStyle.KeywordOperators) + " type");
result.SummaryMarkup = "The " + Highlight ("is", colorStyle.KeywordOperators) + " operator is used to check whether the run-time type of an object is compatible with a given type.";
break;
- case "join":
+ case SyntaxKind.JoinKeyword:
result.SignatureMarkup = Highlight ("join", colorStyle.KeywordContext) + keywordSign;
result.AddCategory ("Query Form", Highlight ("join", colorStyle.KeywordContext) + " range-variable2 " + Highlight ("in", colorStyle.KeywordContext) + " range2 " + Highlight ("on", colorStyle.KeywordContext)
+ " statement1 " + Highlight ("equals", colorStyle.KeywordContext) + " statement2 [ " + Highlight ("into", colorStyle.KeywordContext) + " group-name ]");
result.SummaryMarkup = "The " + Highlight ("join", colorStyle.KeywordContext) + " clause produces a new sequence of elements from two source sequences on a given equality condition.";
break;
- case "let":
+ case SyntaxKind.LetKeyword:
result.SignatureMarkup = Highlight ("let", colorStyle.KeywordContext) + keywordSign;
result.AddCategory ("Query Form", Highlight ("let", colorStyle.KeywordContext) + " range-variable = expression");
result.SummaryMarkup = "The " + Highlight ("let", colorStyle.KeywordContext) + " clause allows for a sub-expression to have its value stored in a new range variable for use later in the query.";
break;
- case "lock":
+ case SyntaxKind.LockKeyword:
result.SignatureMarkup = Highlight ("lock", colorStyle.KeywordOther) + keywordSign;
result.AddCategory ("Form", Highlight ("lock", colorStyle.KeywordOther) + " (expression) statement_block");
result.SummaryMarkup = "The " + Highlight ("lock", colorStyle.KeywordOther) + " keyword marks a statement block as a critical section by obtaining the mutual-exclusion lock for a given object, executing a statement, and then releasing the lock. ";
break;
- case "namespace":
+ case SyntaxKind.NamespaceKeyword:
result.SignatureMarkup = Highlight ("namespace", colorStyle.KeywordNamespace) + keywordSign;
result.AddCategory ("Form", Highlight ("namespace", colorStyle.KeywordNamespace) + " name[.name1] ...] {" + Environment.NewLine +
"type-declarations" + Environment.NewLine +
" }");
result.SummaryMarkup = "The " + Highlight ("namespace", colorStyle.KeywordNamespace) + " keyword is used to declare a scope. ";
break;
- case "new":
+ case SyntaxKind.NewKeyword:
result.SignatureMarkup = Highlight ("new", colorStyle.KeywordOperators) + keywordSign;
- result.SummaryMarkup = "The " + Highlight ("new", colorStyle.KeywordOperators) + " keyword can be used as an operator or as a modifier. The operator is used to create objects on the heap and invoke constructors. The modifier is used to hide an inherited member from a base class member.";
+ if (node.Parent != null && node.Parent.IsKind (SyntaxKind.ConstructorConstraint)) {
+ result.SummaryMarkup = "The " + Highlight ("new", colorStyle.KeywordOperators) + " constraint specifies that any type argument in a generic class declaration must have a public parameterless constructor. To use the new constraint, the type cannot be abstract.";
+ } else {
+ result.SummaryMarkup = "The " + Highlight ("new", colorStyle.KeywordOperators) + " keyword can be used as an operator or as a modifier. The operator is used to create objects on the heap and invoke constructors. The modifier is used to hide an inherited member from a base class member.";
+ }
break;
- case "null":
+ case SyntaxKind.NullKeyword:
result.SignatureMarkup = Highlight ("null", colorStyle.KeywordConstants) + keywordSign;
result.SummaryMarkup = "The " + Highlight ("null", colorStyle.KeywordConstants) + " keyword is a literal that represents a null reference, one that does not refer to any object. " + Highlight ("null", colorStyle.KeywordConstants) + " is the default value of reference-type variables.";
break;
- case "operator":
+ case SyntaxKind.OperatorKeyword:
result.SignatureMarkup = Highlight ("operator", colorStyle.KeywordOperatorDeclaration) + keywordSign;
result.AddCategory ("Form", Highlight ("public static ", colorStyle.KeywordModifiers) + "result-type " + Highlight ("operator", colorStyle.KeywordOperatorDeclaration) + " unary-operator ( op-type operand )" + Environment.NewLine +
Highlight ("public static ", colorStyle.KeywordModifiers) + "result-type " + Highlight ("operator", colorStyle.KeywordOperatorDeclaration) + " binary-operator (" + Environment.NewLine +
@@ -1179,20 +1290,20 @@ namespace MonoDevelop.CSharp
);
result.SummaryMarkup = "The " + Highlight ("operator", colorStyle.KeywordOperatorDeclaration) + " keyword is used to declare an operator in a class or struct declaration.";
break;
- case "orderby":
+ case SyntaxKind.OrderByKeyword:
result.SignatureMarkup = Highlight ("orderby", colorStyle.KeywordContext) + keywordSign;
result.AddCategory ("Query Form", Highlight ("orderby", colorStyle.KeywordContext) + " order-key1 [ " + Highlight ("ascending", colorStyle.KeywordContext) + "|" + Highlight ("descending", colorStyle.KeywordContext) + " , [order-key2, ...]");
result.SummaryMarkup = "The " + Highlight ("orderby", colorStyle.KeywordContext) + " clause specifies for the returned sequence to be sorted on a given element in either ascending or descending order.";
break;
- case "out":
+ case SyntaxKind.OutKeyword:
result.SignatureMarkup = Highlight ("out", colorStyle.KeywordParameter) + keywordSign;
- if (hintNode != null) {
- if (hintNode.Parent is TypeParameterDeclaration) {
+ if (node.Parent != null) {
+ if (node.Parent is TypeParameterSyntax) {
result.AddCategory ("Form",
Highlight ("interface", colorStyle.KeywordDeclaration) + " IMyInterface&lt;" + Highlight ("out", colorStyle.KeywordParameter) + " T&gt; {}");
break;
}
- if (hintNode.Parent is ParameterDeclaration) {
+ if (node.Parent is ParameterSyntax) {
result.AddCategory ("Form",
Highlight ("out", colorStyle.KeywordParameter) + " parameter-name");
result.SummaryMarkup = "The " + Highlight ("out", colorStyle.KeywordParameter) + " method parameter keyword on a method parameter causes a method to refer to the same variable that was passed into the method.";
@@ -1200,28 +1311,28 @@ namespace MonoDevelop.CSharp
}
}
- result.AddCategory ("Form",
+ result.AddCategory ("Form",
Highlight ("out", colorStyle.KeywordParameter) + " parameter-name" + Environment.NewLine + Environment.NewLine +
"or" + Environment.NewLine + Environment.NewLine +
Highlight ("interface", colorStyle.KeywordDeclaration) + " IMyInterface&lt;" + Highlight ("out", colorStyle.KeywordParameter) + " T&gt; {}"
);
break;
- case "override":
+ case SyntaxKind.OverrideKeyword:
result.SignatureMarkup = Highlight ("override", colorStyle.KeywordModifiers) + keywordSign;
result.SummaryMarkup = "The " + Highlight ("override", colorStyle.KeywordModifiers) + " modifier is used to override a method, a property, an indexer, or an event.";
break;
- case "params":
+ case SyntaxKind.ParamKeyword:
result.SignatureMarkup = Highlight ("params", colorStyle.KeywordParameter) + keywordSign;
result.SummaryMarkup = "The " + Highlight ("params", colorStyle.KeywordParameter) + " keyword lets you specify a method parameter that takes an argument where the number of arguments is variable.";
break;
- case "partial":
+ case SyntaxKind.PartialKeyword:
result.SignatureMarkup = Highlight ("partial", colorStyle.KeywordContext) + keywordSign;
- if (hintNode != null) {
- if (hintNode.Parent is TypeDeclaration) {
+ if (node.Parent != null) {
+ if (node.Parent is TypeDeclarationSyntax) {
result.AddCategory ("Form", "[modifiers] " + Highlight ("partial", colorStyle.KeywordContext) + " type-declaration");
result.SummaryMarkup = "The " + Highlight ("partial", colorStyle.KeywordContext) + " keyword on a type declaration allows for the definition to be split into multiple files.";
break;
- } else if (hintNode.Parent is MethodDeclaration) {
+ } else if (node.Parent is MethodDeclarationSyntax) {
result.AddCategory ("Form", Highlight ("partial", colorStyle.KeywordContext) + " method-declaration");
result.SummaryMarkup = "The " + Highlight ("partial", colorStyle.KeywordContext) + " keyword on a method declaration allows for the implementation of a method to be defined in another part of the partial class.";
}
@@ -1229,70 +1340,74 @@ namespace MonoDevelop.CSharp
result.AddCategory ("Form", "[modifiers] " + Highlight ("partial", colorStyle.KeywordContext) + " type-declaration" + Environment.NewLine + Environment.NewLine + "or" + Environment.NewLine + Environment.NewLine +
Highlight ("partial", colorStyle.KeywordContext) + " method-declaration");
break;
- case "private":
+ case SyntaxKind.PrivateKeyword:
result.SignatureMarkup = Highlight ("private", colorStyle.KeywordModifiers) + keywordSign;
result.SummaryMarkup = "The " + Highlight ("private", colorStyle.KeywordModifiers) + " keyword is a member access modifier. Private access is the least permissive access level. Private members are accessible only within the body of the class or the struct in which they are declared.";
break;
- case "protected":
+ case SyntaxKind.ProtectedKeyword:
result.SignatureMarkup = Highlight ("protected", colorStyle.KeywordModifiers) + keywordSign;
result.SummaryMarkup = "The " + Highlight ("protected", colorStyle.KeywordModifiers) + " keyword is a member access modifier. A protected member is accessible from within the class in which it is declared, and from within any class derived from the class that declared this member.";
break;
- case "public":
+ case SyntaxKind.PublicKeyword:
result.SignatureMarkup = Highlight ("public", colorStyle.KeywordModifiers) + keywordSign;
result.SummaryMarkup = "The " + Highlight ("public", colorStyle.KeywordModifiers) + " keyword is an access modifier for types and type members. Public access is the most permissive access level. There are no restrictions on accessing public members.";
break;
- case "readonly":
+ case SyntaxKind.ReadOnlyKeyword:
result.SignatureMarkup = Highlight ("readonly", colorStyle.KeywordModifiers) + keywordSign;
result.SummaryMarkup = "The " + Highlight ("readonly", colorStyle.KeywordModifiers) + " keyword is a modifier that you can use on fields. When a field declaration includes a " + Highlight ("readonly", colorStyle.KeywordModifiers) + " modifier, assignments to the fields introduced by the declaration can only occur as part of the declaration or in a constructor in the same class.";
break;
- case "ref":
+ case SyntaxKind.RefKeyword:
result.SignatureMarkup = Highlight ("ref", colorStyle.KeywordParameter) + keywordSign;
result.SummaryMarkup = "The " + Highlight ("ref", colorStyle.KeywordParameter) + " method parameter keyword on a method parameter causes a method to refer to the same variable that was passed into the method.";
break;
- case "remove":
+ case SyntaxKind.RemoveKeyword:
result.SignatureMarkup = Highlight ("remove", colorStyle.KeywordContext) + keywordSign;
result.AddCategory ("Form", "[modifiers] " + Highlight ("remove", colorStyle.KeywordContext) + " { accessor-body }");
result.SummaryMarkup = "The " + Highlight ("remove", colorStyle.KeywordContext) + " keyword is used to define a custom accessor for when an event is unsubscribed from. If supplied, an add accessor must also be supplied.";
break;
- case "return":
+ case SyntaxKind.ReturnKeyword:
result.SignatureMarkup = Highlight ("return", colorStyle.KeywordJump) + keywordSign;
result.AddCategory ("Form", Highlight ("return", colorStyle.KeywordJump) + " [expression];");
result.SummaryMarkup = "The " + Highlight ("return", colorStyle.KeywordJump) + " statement terminates execution of the method in which it appears and returns control to the calling method.";
break;
- case "select":
+ case SyntaxKind.SelectKeyword:
result.SignatureMarkup = Highlight ("select", colorStyle.KeywordContext) + keywordSign;
result.AddCategory ("Query Form", Highlight ("select", colorStyle.KeywordContext) + " return-type");
result.SummaryMarkup = "The " + Highlight ("select", colorStyle.KeywordContext) + " clause specifies the type of value to return from the query.";
break;
- case "sealed":
+ case SyntaxKind.SealedKeyword:
result.SignatureMarkup = Highlight ("sealed", colorStyle.KeywordModifiers) + keywordSign;
result.SummaryMarkup = "A sealed class cannot be inherited.";
break;
- case "set":
+ case SyntaxKind.SetKeyword:
result.SignatureMarkup = Highlight ("set", colorStyle.KeywordContext) + keywordSign;
result.AddCategory ("Form", "[modifiers] " + Highlight ("set", colorStyle.KeywordContext) + " [ { accessor-body } ]");
result.SummaryMarkup = "The " + Highlight ("set", colorStyle.KeywordContext) + " keyword is used to define an accessor method to assign to the value of the property or indexer element.";
break;
- case "sizeof":
+ case SyntaxKind.SizeOfKeyword:
result.SignatureMarkup = Highlight ("sizeof", colorStyle.KeywordOperators) + keywordSign;
result.AddCategory ("Form", Highlight ("sizeof", colorStyle.KeywordOperators) + " (type)");
result.SummaryMarkup = "The " + Highlight ("sizeof", colorStyle.KeywordOperators) + " operator is used to obtain the size in bytes for a value type.";
break;
- case "stackalloc":
+ case SyntaxKind.StackAllocKeyword:
result.SignatureMarkup = Highlight ("stackalloc", colorStyle.KeywordOperators) + keywordSign;
result.AddCategory ("Form", "type * ptr = " + Highlight ("stackalloc", colorStyle.KeywordOperators) + " type [ expr ];");
result.SummaryMarkup = "Allocates a block of memory on the stack.";
break;
- case "static":
+ case SyntaxKind.StaticKeyword:
result.SignatureMarkup = Highlight ("static", colorStyle.KeywordModifiers) + keywordSign;
result.SummaryMarkup = "Use the " + Highlight ("static", colorStyle.KeywordModifiers) + " modifier to declare a static member, which belongs to the type itself rather than to a specific object.";
break;
- case "struct":
+ case SyntaxKind.StructKeyword:
result.SignatureMarkup = Highlight ("struct", colorStyle.KeywordDeclaration) + keywordSign;
- result.AddCategory ("Form", "[attributes] [modifiers] " + Highlight ("struct", colorStyle.KeywordDeclaration) + " identifier [:interfaces] body [;]");
- result.SummaryMarkup = "A " + Highlight ("struct", colorStyle.KeywordDeclaration) + " type is a value type that can contain constructors, constants, fields, methods, properties, indexers, operators, events, and nested types. ";
+ if (node.Parent != null && node.Parent.IsKind (SyntaxKind.ConstructorConstraint)) {
+ result.SummaryMarkup = "The " + Highlight ("struct", colorStyle.KeywordDeclaration) + " constraint specifies that the type argument must be a value type. Any value type except Nullable can be specified.";
+ } else {
+ result.AddCategory ("Form", "[attributes] [modifiers] " + Highlight ("struct", colorStyle.KeywordDeclaration) + " identifier [:interfaces] body [;]");
+ result.SummaryMarkup = "A " + Highlight ("struct", colorStyle.KeywordDeclaration) + " type is a value type that can contain constructors, constants, fields, methods, properties, indexers, operators, events, and nested types. ";
+ }
break;
- case "switch":
+ case SyntaxKind.SwitchKeyword:
result.SignatureMarkup = Highlight ("switch", colorStyle.KeywordSelection) + keywordSign;
result.AddCategory ("Form", Highlight ("switch", colorStyle.KeywordSelection) + " (expression)" + Environment.NewLine +
" {" + Environment.NewLine +
@@ -1305,16 +1420,16 @@ namespace MonoDevelop.CSharp
" }");
result.SummaryMarkup = "The " + Highlight ("switch", colorStyle.KeywordSelection) + " statement is a control statement that handles multiple selections by passing control to one of the " + Highlight ("case", colorStyle.KeywordSelection) + " statements within its body.";
break;
- case "this":
+ case SyntaxKind.ThisKeyword:
result.SignatureMarkup = Highlight ("this", colorStyle.KeywordAccessors) + keywordSign;
result.SummaryMarkup = "The " + Highlight ("this", colorStyle.KeywordAccessors) + " keyword refers to the current instance of the class.";
break;
- case "throw":
+ case SyntaxKind.ThrowKeyword:
result.SignatureMarkup = Highlight ("throw", colorStyle.KeywordException) + keywordSign;
result.AddCategory ("Form", Highlight ("throw", colorStyle.KeywordException) + " [expression];");
result.SummaryMarkup = "The " + Highlight ("throw", colorStyle.KeywordException) + " statement is used to signal the occurrence of an anomalous situation (exception) during the program execution.";
break;
- case "try":
+ case SyntaxKind.TryKeyword:
result.SignatureMarkup = Highlight ("try", colorStyle.KeywordException) + keywordSign;
result.AddCategory ("Form", Highlight ("try", colorStyle.KeywordException) + " try-block" + Environment.NewLine +
" " + Highlight ("catch", colorStyle.KeywordException) + " (exception-declaration-1) catch-block-1 " + Environment.NewLine +
@@ -1323,48 +1438,48 @@ namespace MonoDevelop.CSharp
Highlight ("try", colorStyle.KeywordException) + " try-block " + Highlight ("catch", colorStyle.KeywordException) + " catch-block");
result.SummaryMarkup = "The try-catch statement consists of a " + Highlight ("try", colorStyle.KeywordException) + " block followed by one or more " + Highlight ("catch", colorStyle.KeywordException) + " clauses, which specify handlers for different exceptions.";
break;
- case "typeof":
+ case SyntaxKind.TypeOfKeyword:
result.SignatureMarkup = Highlight ("typeof", colorStyle.KeywordOperators) + keywordSign;
result.AddCategory ("Form", Highlight ("typeof", colorStyle.KeywordOperators) + "(type)");
result.SummaryMarkup = "The " + Highlight ("typeof", colorStyle.KeywordOperators) + " operator is used to obtain the System.Type object for a type.";
break;
- case "unchecked":
+ case SyntaxKind.UncheckedKeyword:
result.SignatureMarkup = Highlight ("unchecked", colorStyle.KeywordOther) + keywordSign;
result.AddCategory ("Form", Highlight ("unchecked", colorStyle.KeywordOther) + " block" + Environment.NewLine +
Highlight ("unchecked", colorStyle.KeywordOther) + " (expression)");
result.SummaryMarkup = "The " + Highlight ("unchecked", colorStyle.KeywordOther) + " keyword is used to control the overflow-checking context for integral-type arithmetic operations and conversions.";
break;
- case "unsafe":
+ case SyntaxKind.UnsafeKeyword:
result.SignatureMarkup = Highlight ("unsafe", colorStyle.KeywordOther) + keywordSign;
result.SummaryMarkup = "The " + Highlight ("unsafe", colorStyle.KeywordOther) + " keyword denotes an unsafe context, which is required for any operation involving pointers.";
break;
- case "using":
+ case SyntaxKind.UsingKeyword:
result.SignatureMarkup = Highlight ("using", colorStyle.KeywordNamespace) + keywordSign;
result.AddCategory ("Form", Highlight ("using", colorStyle.KeywordNamespace) + " (expression | type identifier = initializer) statement" + Environment.NewLine +
Highlight ("using", colorStyle.KeywordNamespace) + " [alias = ]class_or_namespace;");
result.SummaryMarkup = "The " + Highlight ("using", colorStyle.KeywordNamespace) + " directive creates an alias for a namespace or imports types defined in other namespaces. The " + Highlight ("using", colorStyle.KeywordNamespace) + " statement defines a scope at the end of which an object will be disposed.";
break;
- case "virtual":
+ case SyntaxKind.VirtualKeyword:
result.SignatureMarkup = Highlight ("virtual", colorStyle.KeywordModifiers) + keywordSign;
result.SummaryMarkup = "The " + Highlight ("virtual", colorStyle.KeywordModifiers) + " keyword is used to modify a method, property, indexer, or event declaration and allow for it to be overridden in a derived class.";
break;
- case "volatile":
+ case SyntaxKind.VolatileKeyword:
result.SignatureMarkup = Highlight ("volatile", colorStyle.KeywordModifiers) + keywordSign;
result.AddCategory ("Form", Highlight ("volatile", colorStyle.KeywordModifiers) + " declaration");
result.SummaryMarkup = "The " + Highlight ("volatile", colorStyle.KeywordModifiers) + " keyword indicates that a field can be modified in the program by something such as the operating system, the hardware, or a concurrently executing thread.";
break;
- case "void":
+ case SyntaxKind.VoidKeyword:
result.SignatureMarkup = Highlight ("void", colorStyle.KeywordTypes) + keywordSign;
break;
- case "where":
+ case SyntaxKind.WhereKeyword:
result.SignatureMarkup = Highlight ("where", colorStyle.KeywordContext) + keywordSign;
- if (hintNode != null) {
- if (hintNode.Parent is QueryWhereClause) {
+ if (node.Parent != null) {
+ if (node.Parent is WhereClauseSyntax) {
result.AddCategory ("Query Form", Highlight ("where", colorStyle.KeywordContext) + " condition");
result.SummaryMarkup = "The " + Highlight ("where", colorStyle.KeywordContext) + " clause specifies which elements from the data source to be returned according to a given condition.";
break;
}
- if (hintNode.Parent is Constraint) {
+ if (node.Parent is TypeConstraintSyntax) {
result.AddCategory ("Form", "generic-class-declaration " + Highlight ("where", colorStyle.KeywordContext) + " type-parameter : type-constraint");
result.SummaryMarkup = "The " + Highlight ("where", colorStyle.KeywordContext) + " clause constrains which types can be used as the type parameter in a generic declaration.";
break;
@@ -1375,41 +1490,48 @@ namespace MonoDevelop.CSharp
" condition" + " [query-clauses]");
}
break;
- case "yield":
+ case SyntaxKind.YieldKeyword:
result.SignatureMarkup = Highlight ("yield", colorStyle.KeywordContext) + keywordSign;
result.AddCategory ("Form", Highlight ("yield", colorStyle.KeywordContext) + Highlight ("break", colorStyle.KeywordJump) + Environment.NewLine
+ Environment.NewLine + "or" + Environment.NewLine + Environment.NewLine
+ Highlight ("yield", colorStyle.KeywordContext) + Highlight ("return", colorStyle.KeywordJump) + " expression");
result.SummaryMarkup = "The " + Highlight ("yield", colorStyle.KeywordContext) + " keyword is used to indicate that a method, get accessor, or operator is an iterator.";
break;
- case "while":
+ case SyntaxKind.WhileKeyword:
result.SignatureMarkup = Highlight ("while", colorStyle.KeywordIteration) + keywordSign;
result.AddCategory ("Form", Highlight ("while", colorStyle.KeywordIteration) + " (expression) statement");
result.SummaryMarkup = "The " + Highlight ("while", colorStyle.KeywordIteration) + " statement executes a statement or a block of statements until a specified expression evaluates to false. ";
break;
+ case SyntaxKind.NameOfKeyword:
+ result.SignatureMarkup = Highlight ("nameof", colorStyle.KeywordDeclaration) + keywordSign;
+ result.AddCategory ("Form", Highlight ("nameof", colorStyle.KeywordDeclaration) + "(identifier)");
+ result.SummaryMarkup = "Used to obtain the simple (unqualified) string name of a variable, type, or member.";
+ break;
+ default:
+ return null;
}
return result;
}
- public TooltipInformation GetConstraintTooltip (string keyword)
+ public TooltipInformation GetConstraintTooltip (SyntaxToken keyword)
{
var result = new TooltipInformation ();
var color = AlphaBlend (colorStyle.PlainText.Foreground, colorStyle.PlainText.Background, optionalAlpha);
- var colorString = Mono.TextEditor.HelperMethods.GetColorString (color);
-
+ var colorString = MonoDevelop.Components.HelperMethods.GetColorString (color);
+
var keywordSign = "<span foreground=\"" + colorString + "\">" + " (keyword)</span>";
- result.SignatureMarkup = Highlight (keyword, colorStyle.KeywordTypes) + keywordSign;
+ result.SignatureMarkup = Highlight (keyword.ToFullString (), colorStyle.KeywordTypes) + keywordSign;
- switch (keyword) {
- case "class":
+ switch (keyword.Parent.Kind ()) {
+ case SyntaxKind.ClassConstraint:
result.AddCategory ("Constraint", "The type argument must be a reference type; this applies also to any class, interface, delegate, or array type.");
break;
- case "new":
+ case SyntaxKind.ConstructorConstraint:
result.AddCategory ("Constraint", "The type argument must have a public parameterless constructor. When used together with other constraints, the new() constraint must be specified last.");
break;
- case "struct":
+ case SyntaxKind.StructConstraint:
result.AddCategory ("Constraint", "The type argument must be a value type. Any value type except Nullable can be specified. See Using Nullable Types (C# Programming Guide) for more information.");
break;
}
@@ -1417,74 +1539,79 @@ namespace MonoDevelop.CSharp
return result;
}
- public TooltipInformation GetTypeOfTooltip (TypeOfExpression typeOfExpression, TypeOfResolveResult resolveResult)
+ public TooltipInformation GetTypeOfTooltip (TypeOfExpressionSyntax typeOfExpression, ITypeSymbol resolveResult)
{
var result = new TooltipInformation ();
if (resolveResult == null) {
- result.SignatureMarkup = AmbienceService.EscapeText (typeOfExpression.Type.ToString ());
+ result.SignatureMarkup = MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (typeOfExpression.Type.ToString ());
} else {
- result.SignatureMarkup = GetTypeMarkup (resolveResult.ReferencedType, true);
+ result.SignatureMarkup = GetTypeMarkup (resolveResult, true);
}
return result;
}
- public TooltipInformation GetAliasedNamespaceTooltip (AliasNamespaceResolveResult resolveResult)
- {
- var result = new TooltipInformation ();
- result.SignatureMarkup = GetMarkup (resolveResult.Namespace);
- result.AddCategory (GettextCatalog.GetString ("Alias information"), GettextCatalog.GetString ("Resolved using alias '{0}'", resolveResult.Alias));
- return result;
- }
-
- public TooltipInformation GetAliasedTypeTooltip (AliasTypeResolveResult resolveResult)
- {
- var result = new TooltipInformation ();
- result.SignatureMarkup = GetTypeMarkup (resolveResult.Type, true);
- result.AddCategory (GettextCatalog.GetString ("Alias information"), GettextCatalog.GetString ("Resolved using alias '{0}'", resolveResult.Alias));
- return result;
- }
-
- string GetEventMarkup (IEvent evt)
+ // public TooltipInformation GetAliasedNamespaceTooltip (AliasNamespaceResolveResult resolveResult)
+ // {
+ // var result = new TooltipInformation ();
+ // result.SignatureMarkup = GetMarkup (resolveResult.Namespace);
+ // result.AddCategory (GettextCatalog.GetString ("Alias information"), GettextCatalog.GetString ("Resolved using alias '{0}'", resolveResult.Alias));
+ // return result;
+ // }
+ //
+ // public TooltipInformation GetAliasedTypeTooltip (AliasTypeResolveResult resolveResult)
+ // {
+ // var result = new TooltipInformation ();
+ // result.SignatureMarkup = GetTypeMarkup (resolveResult.Type, true);
+ // result.AddCategory (GettextCatalog.GetString ("Alias information"), GettextCatalog.GetString ("Resolved using alias '{0}'", resolveResult.Alias));
+ // return result;
+ // }
+
+ string GetEventMarkup (IEventSymbol evt)
{
if (evt == null)
throw new ArgumentNullException ("evt");
var result = new StringBuilder ();
AppendModifiers (result, evt);
result.Append (Highlight ("event ", colorStyle.KeywordModifiers));
- result.Append (GetTypeReferenceString (evt.ReturnType));
+ result.Append (GetTypeReferenceString (evt.Type));
if (BreakLineAfterReturnType) {
result.AppendLine ();
} else {
result.Append (" ");
}
- AppendExplicitInterfaces (result, evt);
+ AppendExplicitInterfaces (result, evt.ExplicitInterfaceImplementations.Cast<ISymbol> ());
result.Append (HighlightSemantically (FilterEntityName (evt.Name), colorStyle.UserEventDeclaration));
return result.ToString ();
}
bool grayOut;
- bool GrayOut {
- get {
+ bool GrayOut
+ {
+ get
+ {
return grayOut;
}
- set {
+ set
+ {
grayOut = value;
}
}
- void AppendParameterList (StringBuilder result, IList<IParameter> parameterList, bool spaceBefore, bool spaceAfter, bool newLine = true)
+ public SemanticModel SemanticModel { get; internal set; }
+
+ void AppendParameterList (StringBuilder result, ImmutableArray<IParameterSymbol> parameterList, bool spaceBefore, bool spaceAfter, bool newLine = true)
{
- if (parameterList == null || parameterList.Count == 0)
+ if (parameterList == null || parameterList.Length == 0)
return;
if (newLine)
result.AppendLine ();
- for (int i = 0; i < parameterList.Count; i++) {
+ for (int i = 0; i < parameterList.Length; i++) {
var parameter = parameterList [i];
if (newLine)
result.Append (new string (' ', 2));
- var doHighightParameter = i == HighlightParameter || HighlightParameter >= i && i == parameterList.Count - 1 && parameter.IsParams;
+ var doHighightParameter = i == HighlightParameter || HighlightParameter >= i && i == parameterList.Length - 1 && parameter.IsParams;
if (doHighightParameter)
result.Append ("<u>");
/* if (parameter.IsOptional) {
@@ -1495,18 +1622,18 @@ namespace MonoDevelop.CSharp
}*/
AppendParameter (result, parameter);
if (parameter.IsOptional) {
- if (formattingOptions.SpaceAroundAssignment) {
+ if (options.GetOption (CSharpFormattingOptions.SpacingAroundBinaryOperator) == BinaryOperatorSpacingOptions.Single) {
result.Append (" = ");
} else {
result.Append ("=");
}
- AppendConstant (result, parameter.Type, parameter.ConstantValue);
-// GrayOut = false;
-// result.Append ("</span>");
+ AppendConstant (result, parameter.Type, parameter.ExplicitDefaultValue);
+ // GrayOut = false;
+ // result.Append ("</span>");
}
if (doHighightParameter)
result.Append ("</u>");
- if (i + 1 < parameterList.Count) {
+ if (i + 1 < parameterList.Length) {
if (spaceBefore)
result.Append (' ');
result.Append (',');
@@ -1522,13 +1649,13 @@ namespace MonoDevelop.CSharp
result.AppendLine ();
}
- void AppendParameter (StringBuilder result, IParameter parameter)
+ void AppendParameter (StringBuilder result, IParameterSymbol parameter)
{
if (parameter == null)
return;
- if (parameter.IsOut) {
+ if (parameter.RefKind == RefKind.Out) {
result.Append (Highlight ("out ", colorStyle.KeywordParameter));
- } else if (parameter.IsRef) {
+ } else if (parameter.RefKind == RefKind.Ref) {
result.Append (Highlight ("ref ", colorStyle.KeywordParameter));
} else if (parameter.IsParams) {
result.Append (Highlight ("params ", colorStyle.KeywordParameter));
@@ -1538,32 +1665,30 @@ namespace MonoDevelop.CSharp
result.Append (FilterEntityName (parameter.Name));
}
- void AppendExplicitInterfaces (StringBuilder sb, IMember member)
+ void AppendExplicitInterfaces (StringBuilder sb, IEnumerable<Microsoft.CodeAnalysis.ISymbol> member)
{
- if (member == null || !member.IsExplicitInterfaceImplementation)
- return;
- foreach (var implementedInterfaceMember in member.ImplementedInterfaceMembers) {
- sb.Append (GetTypeReferenceString (implementedInterfaceMember.DeclaringTypeDefinition));
+ foreach (var implementedInterfaceMember in member) {
+ sb.Append (GetTypeReferenceString (implementedInterfaceMember.ContainingType));
sb.Append (".");
}
}
static ulong GetUlong (string str)
{
- try {
+ try {
if (str [0] == '-')
return (ulong)long.Parse (str);
return ulong.Parse (str);
} catch (Exception e) {
- LoggingService.LogError ("Error while converting " + str + " to a number.", e);
+ LoggingService.LogError ("Error while converting " + str + " to a number.", e);
return 0;
}
}
- void AppendConstant (StringBuilder sb, IType constantType, object constantValue, bool useNumericalEnumValue = false)
+ void AppendConstant (StringBuilder sb, ITypeSymbol constantType, object constantValue, bool useNumericalEnumValue = false)
{
if (constantValue is string) {
- sb.Append (Highlight ("\"" + constantValue + "\"", colorStyle.String));
+ sb.Append (Highlight ("\"" + MonoDevelop.Ide.TypeSystem.Ambience.EscapeText ((string)constantValue) + "\"", colorStyle.String));
return;
}
if (constantValue is char) {
@@ -1576,7 +1701,7 @@ namespace MonoDevelop.CSharp
}
if (constantValue == null) {
- if (constantType.Kind == TypeKind.Struct) {
+ if (constantType.IsValueType) {
// structs can never be == null, therefore it's the default value.
sb.Append (Highlight ("default", colorStyle.KeywordSelection) + "(" + GetTypeReferenceString (constantType) + ")");
} else {
@@ -1584,11 +1709,11 @@ namespace MonoDevelop.CSharp
}
return;
}
-
- while (NullableType.IsNullable (constantType))
- constantType = NullableType.GetUnderlyingType (constantType);
- if (constantType.Kind == TypeKind.Enum) {
- foreach (var field in constantType.GetFields ()) {
+ // TODOδ
+ // while (IsNullableType (constantType))
+ // constantType = NullableType.GetUnderlyingType (constantType);
+ if (constantType.TypeKind == TypeKind.Enum) {
+ foreach (var field in constantType.GetMembers ().OfType<IFieldSymbol> ()) {
if (field.ConstantValue == constantValue) {
if (useNumericalEnumValue) {
sb.Append (Highlight (string.Format ("0x{0:X}", field.ConstantValue), colorStyle.Number));
@@ -1599,11 +1724,11 @@ namespace MonoDevelop.CSharp
}
}
// try to decompose flags
- if (constantType.GetDefinition ().Attributes.Any (attr => attr.AttributeType.Name == "FlagsAttribute" && attr.AttributeType.Namespace == "System")) {
+ if (constantType.GetAttributes ().Any (attr => attr.AttributeClass.Name == "FlagsAttribute" && attr.AttributeClass.ContainingNamespace.Name == "System")) {
var val = GetUlong (constantValue.ToString ());
var outVal = 0UL;
- var fields = new List<IField> ();
- foreach (var field in constantType.GetFields ()) {
+ var fields = new List<IFieldSymbol> ();
+ foreach (var field in constantType.GetMembers ().OfType<IFieldSymbol> ()) {
if (field.ConstantValue == null)
continue;
var val2 = GetUlong (field.ConstantValue.ToString ());
@@ -1627,15 +1752,14 @@ namespace MonoDevelop.CSharp
sb.Append ("(" + GetTypeReferenceString (constantType) + ")" + Highlight (constantValue.ToString (), colorStyle.Number));
return;
}
-
- sb.Append (Highlight (constantValue.ToString (), colorStyle.Number));
+ sb.Append (Highlight (MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (constantValue.ToString ()), colorStyle.Number));
}
- void AppendVariance (StringBuilder sb, VarianceModifier variance)
+ void AppendVariance (StringBuilder sb, VarianceKind variance)
{
- if (variance == VarianceModifier.Contravariant) {
+ if (variance == VarianceKind.In) {
sb.Append (Highlight ("in ", colorStyle.KeywordParameter));
- } else if (variance == VarianceModifier.Covariant) {
+ } else if (variance == VarianceKind.Out) {
sb.Append (Highlight ("out ", colorStyle.KeywordParameter));
}
}
@@ -1643,8 +1767,8 @@ namespace MonoDevelop.CSharp
Gdk.Color AlphaBlend (Gdk.Color color, Gdk.Color color2, double alpha)
{
return new Gdk.Color (
- (byte)((alpha * color.Red + (1 - alpha) * color2.Red) / 256),
- (byte)((alpha * color.Green + (1 - alpha) * color2.Green) / 256),
+ (byte)((alpha * color.Red + (1 - alpha) * color2.Red) / 256),
+ (byte)((alpha * color.Green + (1 - alpha) * color2.Green) / 256),
(byte)((alpha * color.Blue + (1 - alpha) * color2.Blue) / 256)
);
}
@@ -1654,7 +1778,12 @@ namespace MonoDevelop.CSharp
return AlphaBlend ((Gdk.Color)((HslColor)color), (Gdk.Color)((HslColor)color2), alpha);
}
- public string GetArrayIndexerMarkup (ArrayType arrayType)
+ HslColor AlphaBlend (HslColor color, HslColor color2, double alpha)
+ {
+ return (HslColor)AlphaBlend ((Gdk.Color)color, (Gdk.Color)color2, alpha);
+ }
+
+ public string GetArrayIndexerMarkup (IArrayTypeSymbol arrayType)
{
if (arrayType == null)
throw new ArgumentNullException ("arrayType");
@@ -1667,7 +1796,7 @@ namespace MonoDevelop.CSharp
}
result.Append (Highlight ("this", colorStyle.KeywordAccessors));
result.Append ("[");
- for (int i = 0; i < arrayType.Dimensions; i++) {
+ for (int i = 0; i < arrayType.Rank; i++) {
if (i > 0)
result.Append (", ");
var doHighightParameter = i == HighlightParameter;
@@ -1675,7 +1804,7 @@ namespace MonoDevelop.CSharp
result.Append ("<u>");
result.Append (Highlight ("int ", colorStyle.KeywordTypes));
- result.Append (arrayType.Dimensions == 1 ? "index" : "i" + (i + 1));
+ result.Append (arrayType.Rank == 1 ? "index" : "i" + (i + 1));
if (doHighightParameter)
result.Append ("</u>");
}
@@ -1685,7 +1814,7 @@ namespace MonoDevelop.CSharp
result.Append (Highlight (" get", colorStyle.KeywordProperty) + ";");
result.Append (Highlight (" set", colorStyle.KeywordProperty) + ";");
result.Append (" }");
-
+
return result.ToString ();
}
@@ -1698,51 +1827,60 @@ namespace MonoDevelop.CSharp
color = AlphaBlend (color, (Gdk.Color)((HslColor)colorStyle.PlainText.Background), optionalAlpha);
}
- var colorString = Mono.TextEditor.HelperMethods.GetColorString (color);
+ var colorString = MonoDevelop.Components.HelperMethods.GetColorString (color);
return "<span foreground=\"" + colorString + "\">" + str + "</span>";
}
string HighlightSemantically (string str, ChunkStyle style)
{
- if (!MonoDevelop.SourceEditor.DefaultSourceEditorOptions.Instance.EnableSemanticHighlighting)
+ if (!DefaultSourceEditorOptions.Instance.EnableSemanticHighlighting)
return str;
return Highlight (str, style);
}
- public string CreateFooter (IEntity entity)
+ public string CreateFooter (ISymbol entity)
{
- var type = entity as IType;
- if (type != null) {
- var def = type.GetDefinition ();
- if (def != null) {
- if (!def.Region.IsEmpty) {
- MonoDevelop.Projects.Project project;
-
- if (def.TryGetSourceProject (out project)) {
- var relPath = FileService.AbsoluteToRelativePath (project.BaseDirectory, def.Region.FileName);
- return (string.IsNullOrEmpty (def.Namespace) ? "" : "<small>" + GettextCatalog.GetString ("Namespace:\t{0}", AmbienceService.EscapeText (def.Namespace)) + "</small>" + Environment.NewLine) +
- "<small>" + GettextCatalog.GetString ("Project:\t{0}", AmbienceService.EscapeText (def.ParentAssembly.AssemblyName)) + "</small>" + Environment.NewLine +
- "<small>" + GettextCatalog.GetString ("File:\t\t{0} (line {1})", AmbienceService.EscapeText (relPath), def.Region.Begin.Line) + "</small>";
- }
- }
- return (string.IsNullOrEmpty (def.Namespace) ? "" : "<small>" + GettextCatalog.GetString ("Namespace:\t{0}", AmbienceService.EscapeText (def.Namespace)) + "</small>" + Environment.NewLine) +
- "<small>" + GettextCatalog.GetString ("Assembly:\t{0}", AmbienceService.EscapeText (def.ParentAssembly.AssemblyName)) + "</small>";
+ var type = entity as ITypeSymbol;
+ if (type != null && type.Locations.Any ()) {
+ var loc = type.Locations.First ();
+ if (loc.IsInSource) {// TODO:
+ // MonoDevelop.Projects.Project project;
+ //
+ // if (type.TryGetSourceProject (out project)) {
+ // var relPath = FileService.AbsoluteToRelativePath (project.BaseDirectory, loc.SourceTree.FilePath);
+ // var line = loc.SourceTree.GetLineSpan (loc.SourceSpan, true).StartLinePosition.Line;
+ //
+ // return (type.ContainingNamespace.IsGlobalNamespace ? "" : "<small>" + GettextCatalog.GetString ("Namespace:\t{0}", AmbienceService.EscapeText (type.ContainingNamespace.Name)) + "</small>" + Environment.NewLine) +
+ // "<small>" + GettextCatalog.GetString ("Project:\t{0}", AmbienceService.EscapeText (type.ContainingAssembly.Name)) + "</small>" + Environment.NewLine +
+ // "<small>" + GettextCatalog.GetString ("File:\t\t{0} (line {1})", AmbienceService.EscapeText (relPath), line) + "</small>";
+ // }
}
- return null;
- }
-
- if (entity.DeclaringTypeDefinition != null) {
- if (!entity.Region.IsEmpty) {
- MonoDevelop.Projects.Project project;
- if (entity.DeclaringTypeDefinition.TryGetSourceProject (out project)) {
- var relPath = FileService.AbsoluteToRelativePath (project.BaseDirectory, entity.Region.FileName);
- return "<small>" + GettextCatalog.GetString ("Project:\t{0}", AmbienceService.EscapeText (project.Name)) + "</small>" + Environment.NewLine +
- "<small>" + GettextCatalog.GetString ("From type:\t{0}", AmbienceService.EscapeText (entity.DeclaringTypeDefinition.FullName)) + "</small>" + Environment.NewLine +
- "<small>" + GettextCatalog.GetString ("File:\t\t{0} (line {1})", AmbienceService.EscapeText (relPath), entity.Region.Begin.Line) + "</small>";
- }
+ return (type.ContainingNamespace.IsGlobalNamespace ? "" : "<small>" + GettextCatalog.GetString ("Namespace:\t{0}", MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (type.ContainingNamespace.GetFullName ())) + "</small>" + Environment.NewLine) +
+ "<small>" + GettextCatalog.GetString ("Assembly:\t{0}", MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (type.ContainingAssembly.Name)) + "</small>";
+ }
+
+ var method = entity as IMethodSymbol;
+ if (method != null && (method.MethodKind == MethodKind.Constructor || method.MethodKind == MethodKind.StaticConstructor || method.MethodKind == MethodKind.Destructor)) {
+ return (method.ContainingNamespace.IsGlobalNamespace ? "" : "<small>" + GettextCatalog.GetString ("Namespace:\t{0}", MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (method.ContainingNamespace.GetFullName ())) + "</small>" + Environment.NewLine) +
+ "<small>" + GettextCatalog.GetString ("Assembly:\t{0}", MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (method.ContainingAssembly.Name)) + "</small>";
+ }
+
+
+ if (entity.ContainingType != null && entity.Locations.Any ()) {
+ var loc = entity.Locations.First ();
+ if (!loc.IsInSource) {
+ // TODO:
+ // MonoDevelop.Projects.Project project;
+ // if (entity.ContainingType.TryGetSourceProject (out project)) {
+ // var relPath = FileService.AbsoluteToRelativePath (project.BaseDirectory, loc.SourceTree.FilePath);
+ // var line = loc.SourceTree.GetLineSpan (loc.SourceSpan, true).StartLinePosition.Line;
+ // return "<small>" + GettextCatalog.GetString ("Project:\t{0}", AmbienceService.EscapeText (project.Name)) + "</small>" + Environment.NewLine +
+ // "<small>" + GettextCatalog.GetString ("From type:\t{0}", AmbienceService.EscapeText (entity.ContainingType.Name)) + "</small>" + Environment.NewLine +
+ // "<small>" + GettextCatalog.GetString ("File:\t\t{0} (line {1})", AmbienceService.EscapeText (relPath), line) + "</small>";
+ // }
}
- return "<small>" + GettextCatalog.GetString ("From type:\t{0}", AmbienceService.EscapeText (entity.DeclaringTypeDefinition.FullName)) + "</small>" + Environment.NewLine +
- "<small>" + GettextCatalog.GetString ("Assembly:\t{0}", AmbienceService.EscapeText (entity.DeclaringTypeDefinition.ParentAssembly.AssemblyName)) + "</small>";
+ return "<small>" + GettextCatalog.GetString ("From type:\t{0}", MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (entity.ContainingType.Name)) + "</small>" + Environment.NewLine +
+ "<small>" + GettextCatalog.GetString ("Assembly:\t{0}", MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (entity.ContainingAssembly.Name)) + "</small>";
}
return null;
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonIndentEngine.cs b/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonIndentEngine.cs
new file mode 100644
index 0000000000..baedfa03c4
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonIndentEngine.cs
@@ -0,0 +1,307 @@
+//
+// JSonTextEditorExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Text;
+using ICSharpCode.NRefactory6.CSharp;
+using ICSharpCode.NRefactory6;
+using MonoDevelop.Ide.Editor;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Core.Text;
+
+namespace MonoDevelop.JSon
+{
+ class JSonIndentEngine : IStateMachineIndentEngine
+ {
+ TextEditor editor;
+ DocumentContext ctx;
+ int offset, line, column;
+ internal Indent thisLineIndent, nextLineIndent;
+ StringBuilder currentIndent;
+ // char previousNewline = '\0';
+ char previousChar = '\0';
+ bool isLineStart;
+ bool isInString;
+
+ public JSonIndentEngine (TextEditor editor, DocumentContext ctx)
+ {
+ if (editor == null)
+ throw new ArgumentNullException ("editor");
+ if (ctx == null)
+ throw new ArgumentNullException ("ctx");
+ this.editor = editor;
+ this.ctx = ctx;
+ Reset ();
+ }
+
+ JSonIndentEngine (JSonIndentEngine jSonIndentEngine)
+ {
+ this.editor = jSonIndentEngine.editor;
+ this.ctx = jSonIndentEngine.ctx;
+ this.offset = jSonIndentEngine.offset;
+ this.line = jSonIndentEngine.line;
+ this.column = jSonIndentEngine.column;
+ this.thisLineIndent = jSonIndentEngine.thisLineIndent.Clone ();
+ this.nextLineIndent = jSonIndentEngine.nextLineIndent.Clone ();
+ this.currentIndent = jSonIndentEngine.currentIndent != null ? new StringBuilder (jSonIndentEngine.currentIndent.ToString ()) : null;
+ this.previousChar = jSonIndentEngine.previousChar;
+ this.isLineStart = jSonIndentEngine.isLineStart;
+ this.isInString = jSonIndentEngine.isInString;
+ }
+
+ #region IStateMachineIndentEngine implementation
+
+ public IStateMachineIndentEngine Clone ()
+ {
+ return new JSonIndentEngine (this);
+ }
+
+ public bool IsInsidePreprocessorDirective {
+ get {
+ return false;
+ }
+ }
+
+ public bool IsInsidePreprocessorComment {
+ get {
+ return false;
+ }
+ }
+
+ public bool IsInsideStringLiteral {
+ get {
+ return false;
+ }
+ }
+
+ public bool IsInsideVerbatimString {
+ get {
+ return false;
+ }
+ }
+
+ public bool IsInsideCharacter {
+ get {
+ return false;
+ }
+ }
+
+ public bool IsInsideString {
+ get {
+ return isInString;
+ }
+ }
+
+ public bool IsInsideLineComment {
+ get {
+ return false;
+ }
+ }
+
+ public bool IsInsideMultiLineComment {
+ get {
+ return false;
+ }
+ }
+
+ public bool IsInsideDocLineComment {
+ get {
+ return false;
+ }
+ }
+
+ public bool IsInsideComment {
+ get {
+ return false;
+ }
+ }
+
+ public bool IsInsideOrdinaryComment {
+ get {
+ return false;
+ }
+ }
+
+ public bool IsInsideOrdinaryCommentOrString {
+ get {
+ return false;
+ }
+ }
+
+ public bool LineBeganInsideVerbatimString {
+ get {
+ return false;
+ }
+ }
+
+ public bool LineBeganInsideMultiLineComment {
+ get {
+ return false;
+ }
+ }
+
+ #endregion
+
+ #region IDocumentIndentEngine implementation
+
+ public void Push (char ch)
+ {
+ var isNewLine = NewLine.IsNewLine (ch);
+ if (!isNewLine) {
+ if (ch == '"')
+ isInString = !IsInsideString;
+ if (ch == '{' || ch == '[') {
+ nextLineIndent.Push (IndentType.Block);
+ } else if (ch == '}' || ch == ']') {
+ if (thisLineIndent.Count > 0)
+ thisLineIndent.Pop ();
+ if (nextLineIndent.Count > 0)
+ nextLineIndent.Pop ();
+ }
+ } else {
+ if (ch == NewLine.LF && previousChar == NewLine.CR) {
+ offset++;
+ previousChar = ch;
+ return;
+ }
+ }
+
+ offset++;
+ if (!isNewLine) {
+ // previousNewline = '\0';
+
+ isLineStart &= char.IsWhiteSpace (ch);
+
+ if (isLineStart)
+ currentIndent.Append (ch);
+
+ if (ch == '\t') {
+ var nextTabStop = (column - 1 + editor.Options.IndentationSize) / editor.Options.IndentationSize;
+ column = 1 + nextTabStop * editor.Options.IndentationSize;
+ } else {
+ column++;
+ }
+ } else {
+ // previousNewline = ch;
+ currentIndent.Length = 0;
+ isLineStart = true;
+ column = 1;
+ line++;
+ thisLineIndent = nextLineIndent.Clone ();
+ }
+ previousChar = ch;
+ }
+
+ public void Reset ()
+ {
+ offset = 0;
+ line = column = 1;
+ thisLineIndent = new Indent (ctx.GetOptionSet ());
+ nextLineIndent = new Indent (ctx.GetOptionSet ());
+ currentIndent = new StringBuilder ();
+ // previousNewline = '\0';
+ previousChar = '\0';
+ isLineStart = true;
+ isInString = false;
+ }
+
+ public void Update (SourceText sourceText, int offset)
+ {
+ if (Offset > offset)
+ Reset ();
+
+ while (Offset < offset) {
+ Push (sourceText [Offset]);
+ }
+ }
+
+ IDocumentIndentEngine IDocumentIndentEngine.Clone ()
+ {
+ return Clone ();
+ }
+
+ SourceText sourceText;
+
+ public SourceText Document {
+ get {
+ return sourceText ?? (sourceText = new MonoDevelopSourceText (editor));
+ }
+ }
+
+ public string ThisLineIndent {
+ get {
+ return thisLineIndent.IndentString;
+ }
+ }
+
+ public string NextLineIndent {
+ get {
+ return nextLineIndent.IndentString;
+ }
+ }
+
+ public string CurrentIndent {
+ get {
+ return currentIndent.ToString ();
+ }
+ }
+
+ public bool NeedsReindent {
+ get {
+ return ThisLineIndent != CurrentIndent;
+ }
+ }
+
+ public int Offset {
+ get {
+ return offset;
+ }
+ }
+//
+// public TextLocation Location {
+// get {
+// return new TextLocation (line, column);
+// }
+// }
+
+ public bool EnableCustomIndentLevels {
+ get;
+ set;
+ }
+
+ #endregion
+
+ #region ICloneable implementation
+
+ object ICloneable.Clone ()
+ {
+ return Clone ();
+ }
+
+ #endregion
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonIndentationTracker.cs b/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonIndentationTracker.cs
new file mode 100644
index 0000000000..a5a2d3402b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonIndentationTracker.cs
@@ -0,0 +1,70 @@
+//
+// JSonTextEditorExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Editor.Extension;
+using MonoDevelop.Ide.Editor;
+using ICSharpCode.NRefactory6.CSharp;
+
+namespace MonoDevelop.JSon
+{
+ class JSonIndentationTracker : IndentationTracker
+ {
+ readonly TextEditor data;
+ readonly CacheIndentEngine stateTracker;
+
+ public JSonIndentationTracker(TextEditor data, CacheIndentEngine stateTracker)
+ {
+ this.data = data;
+ this.stateTracker = stateTracker;
+ }
+
+ string GetIndentationString (DocumentLocation loc)
+ {
+ var line = data.GetLine (loc.Line);
+ if (line == null)
+ return "";
+ // Get context to the end of the line w/o changing the main engine's state
+ var offset = line.Offset;
+ string curIndent = line.GetIndentation (data);
+ try {
+ stateTracker.Update (data, Math.Min (data.Length, offset + Math.Min (line.Length, loc.Column - 1)));
+ int nlwsp = curIndent.Length;
+ if (!stateTracker.LineBeganInsideMultiLineComment || (nlwsp < line.LengthIncludingDelimiter && data.GetCharAt (offset + nlwsp) == '*'))
+ return stateTracker.ThisLineIndent;
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while indenting at "+ loc, e);
+ }
+ return curIndent;
+ }
+
+ public override string GetIndentationString (int lineNumber)
+ {
+ return GetIndentationString (new DocumentLocation (lineNumber, 1));
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonTextEditorExtension.cs b/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonTextEditorExtension.cs
new file mode 100644
index 0000000000..1121e293ad
--- /dev/null
+++ b/main/src/addins/CSharpBinding/MonoDevelop.JSon/JSonTextEditorExtension.cs
@@ -0,0 +1,125 @@
+//
+// JSonTextEditorExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Ide.Editor.Extension;
+using ICSharpCode.NRefactory6.CSharp;
+using MonoDevelop.Ide.Editor;
+
+namespace MonoDevelop.JSon
+{
+ class JSonTextEditorExtension : TextEditorExtension
+ {
+ CacheIndentEngine stateTracker;
+
+
+ protected override void Initialize ()
+ {
+ base.Initialize ();
+ IStateMachineIndentEngine indentEngine;
+ indentEngine = new JSonIndentEngine (Editor, DocumentContext);
+ stateTracker = new CacheIndentEngine (indentEngine);
+ Editor.SetIndentationTracker (new JSonIndentationTracker (Editor, stateTracker));
+ }
+ public override bool KeyPress (KeyDescriptor descriptor)
+ {
+ var result = base.KeyPress (descriptor);
+
+ if (descriptor.SpecialKey == SpecialKey.Return) {
+ if (Editor.Options.IndentStyle == MonoDevelop.Ide.Editor.IndentStyle.Virtual) {
+ if (Editor.GetLine (Editor.CaretLine).Length == 0)
+ Editor.CaretColumn = Editor.GetVirtualIndentationColumn (Editor.CaretLine);
+ } else {
+ DoReSmartIndent ();
+ }
+ }
+
+ return result;
+ }
+
+ void DoReSmartIndent ()
+ {
+ DoReSmartIndent (Editor.CaretOffset);
+ }
+
+ void DoReSmartIndent (int cursor)
+ {
+ SafeUpdateIndentEngine (cursor);
+ if (stateTracker.LineBeganInsideVerbatimString || stateTracker.LineBeganInsideMultiLineComment)
+ return;
+ var line = Editor.GetLineByOffset (cursor);
+
+ // Get context to the end of the line w/o changing the main engine's state
+ var curTracker = stateTracker.Clone ();
+ try {
+ for (int max = cursor; max < line.EndOffset; max++) {
+ curTracker.Push (Editor.GetCharAt (max));
+ }
+ } catch (Exception e) {
+ LoggingService.LogError ("Exception during indentation", e);
+ }
+
+ int pos = line.Offset;
+ string curIndent = line.GetIndentation (Editor);
+ int nlwsp = curIndent.Length;
+ int offset = cursor > pos + nlwsp ? cursor - (pos + nlwsp) : 0;
+ if (!stateTracker.LineBeganInsideMultiLineComment || (nlwsp < line.LengthIncludingDelimiter && Editor.GetCharAt (line.Offset + nlwsp) == '*')) {
+ // Possibly replace the indent
+ string newIndent = curTracker.ThisLineIndent;
+ int newIndentLength = newIndent.Length;
+ if (newIndent != curIndent) {
+ if (CompletionWindowManager.IsVisible) {
+ if (pos < CompletionWindowManager.CodeCompletionContext.TriggerOffset)
+ CompletionWindowManager.CodeCompletionContext.TriggerOffset -= nlwsp;
+ }
+
+ Editor.ReplaceText (pos, nlwsp, newIndent);
+ newIndentLength = newIndent.Length;
+ CompletionWindowManager.HideWindow ();
+ }
+ pos += newIndentLength;
+ } else {
+ pos += curIndent.Length;
+ }
+
+ pos += offset;
+
+ Editor.FixVirtualIndentation ();
+ }
+
+ internal void SafeUpdateIndentEngine (int offset)
+ {
+ try {
+ stateTracker.Update (Editor, offset);
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while updating the indentation engine", e);
+ }
+ }
+
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/Util/7BitEncodedInts.cs b/main/src/addins/CSharpBinding/Util/7BitEncodedInts.cs
new file mode 100644
index 0000000000..86750c74b7
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/7BitEncodedInts.cs
@@ -0,0 +1,123 @@
+// Copyright (c) 2011 Daniel Grunwald
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy of this
+// software and associated documentation files (the "Software"), to deal in the Software
+// without restriction, including without limitation the rights to use, copy, modify, merge,
+// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+// to whom the Software is furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all copies or
+// substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.IO;
+
+namespace ICSharpCode.NRefactory6.Utils
+{
+ /// <summary>
+ /// A binary reader that can read the output of BinaryWriterWith7BitEncodedInts.
+ /// </summary>
+ sealed class BinaryReaderWith7BitEncodedInts : BinaryReader
+ {
+ public BinaryReaderWith7BitEncodedInts(Stream stream) : base(stream)
+ {
+ }
+
+ public override short ReadInt16()
+ {
+ return unchecked((short)(ushort)base.Read7BitEncodedInt());
+ }
+
+ // [CLSCompliant(false)]
+ public override ushort ReadUInt16()
+ {
+ return unchecked((ushort)base.Read7BitEncodedInt());
+ }
+
+ public override int ReadInt32()
+ {
+ return base.Read7BitEncodedInt();
+ }
+
+ // [CLSCompliant(false)]
+ public override uint ReadUInt32()
+ {
+ return unchecked((uint)base.Read7BitEncodedInt());
+ }
+
+ public override long ReadInt64()
+ {
+ return unchecked((long)this.ReadUInt64());
+ }
+
+ // [CLSCompliant(false)]
+ public override ulong ReadUInt64()
+ {
+ ulong num = 0;
+ int shift = 0;
+ while (shift < 64) {
+ byte b = this.ReadByte();
+ num |= (ulong)(b & 127) << shift;
+ shift += 7;
+ if ((b & 128) == 0) {
+ return num;
+ }
+ }
+ throw new FormatException("Invalid 7-bit int64");
+ }
+ }
+
+ /// <summary>
+ /// A binary writer that encodes all integers as 7-bit-encoded-ints.
+ /// </summary>
+ public sealed class BinaryWriterWith7BitEncodedInts : BinaryWriter
+ {
+ public BinaryWriterWith7BitEncodedInts(Stream stream) : base(stream)
+ {
+ }
+
+ public override void Write(short value)
+ {
+ base.Write7BitEncodedInt(unchecked((ushort)value));
+ }
+
+ // [CLSCompliant(false)]
+ public override void Write(ushort value)
+ {
+ base.Write7BitEncodedInt(value);
+ }
+
+ public override void Write(int value)
+ {
+ base.Write7BitEncodedInt(value);
+ }
+
+ // [CLSCompliant(false)]
+ public override void Write(uint value)
+ {
+ base.Write7BitEncodedInt(unchecked((int)value));
+ }
+
+ public override void Write(long value)
+ {
+ this.Write(unchecked((ulong)value));
+ }
+
+ // [CLSCompliant(false)]
+ public override void Write(ulong value)
+ {
+ while (value >= 128) {
+ this.Write(unchecked((byte)(value | 128u)));
+ value >>= 7;
+ }
+ this.Write(unchecked((byte)value));
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/AccessibilityUtilities.cs b/main/src/addins/CSharpBinding/Util/AccessibilityUtilities.cs
new file mode 100644
index 0000000000..f0c0560f3d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/AccessibilityUtilities.cs
@@ -0,0 +1,67 @@
+//
+// AccessibilityUtilities.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ internal static class AccessibilityUtilities
+ {
+ public static Accessibility Minimum(Accessibility accessibility1, Accessibility accessibility2)
+ {
+ if (accessibility1 == Accessibility.Private || accessibility2 == Accessibility.Private)
+ {
+ return Accessibility.Private;
+ }
+
+ if (accessibility1 == Accessibility.ProtectedAndInternal || accessibility2 == Accessibility.ProtectedAndInternal)
+ {
+ return Accessibility.ProtectedAndInternal;
+ }
+
+ if (accessibility1 == Accessibility.Protected || accessibility2 == Accessibility.Protected)
+ {
+ return Accessibility.Protected;
+ }
+
+ if (accessibility1 == Accessibility.Internal || accessibility2 == Accessibility.Internal)
+ {
+ return Accessibility.Internal;
+ }
+
+ if (accessibility1 == Accessibility.ProtectedOrInternal || accessibility2 == Accessibility.ProtectedOrInternal)
+ {
+ return Accessibility.ProtectedOrInternal;
+ }
+
+ return Accessibility.Public;
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/AnnotationTable.cs b/main/src/addins/CSharpBinding/Util/AnnotationTable.cs
new file mode 100644
index 0000000000..e18bcb5529
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/AnnotationTable.cs
@@ -0,0 +1,275 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ /// <summary>
+ /// An AnnotationTable helps you attach your own annotation types/instances to syntax.
+ ///
+ /// It maintains a map between your instances and actual SyntaxAnnotation's used to annotate the nodes
+ /// and offers an API that matches the true annotation API on SyntaxNode.
+ ///
+ /// The table controls the lifetime of when you can find and retrieve your annotations. You won't be able to
+ /// find your annotations via HasAnnotations/GetAnnotations unless you use the same annotation table for these operations
+ /// that you used for the WithAdditionalAnnotations operation.
+ ///
+ /// Your custom annotations are not serialized with the syntax tree, so they won't move across boundaries unless the
+ /// same AnnotationTable is available on both ends.
+ ///
+ /// also, note that this table is not thread safe.
+ /// </summary>
+ class AnnotationTable<TAnnotation> where TAnnotation : class
+ {
+ private int _globalId = 0;
+
+ private readonly Dictionary<TAnnotation, SyntaxAnnotation> _realAnnotationMap = new Dictionary<TAnnotation, SyntaxAnnotation>();
+ private readonly Dictionary<string, TAnnotation> _annotationMap = new Dictionary<string, TAnnotation>();
+
+ private readonly string _annotationKind;
+
+ public AnnotationTable(string annotationKind)
+ {
+ _annotationKind = annotationKind;
+ }
+
+ private IEnumerable<SyntaxAnnotation> GetOrCreateRealAnnotations(TAnnotation[] annotations)
+ {
+ foreach (var annotation in annotations)
+ {
+ yield return this.GetOrCreateRealAnnotation(annotation);
+ }
+ }
+
+ private SyntaxAnnotation GetOrCreateRealAnnotation(TAnnotation annotation)
+ {
+ SyntaxAnnotation realAnnotation;
+ if (!_realAnnotationMap.TryGetValue(annotation, out realAnnotation))
+ {
+ var id = Interlocked.Increment(ref _globalId);
+ var idString = id.ToString();
+
+ realAnnotation = new SyntaxAnnotation(_annotationKind, idString);
+ _annotationMap.Add(idString, annotation);
+ _realAnnotationMap.Add(annotation, realAnnotation);
+ }
+
+ return realAnnotation;
+ }
+
+ private IEnumerable<SyntaxAnnotation> GetRealAnnotations(TAnnotation[] annotations)
+ {
+ foreach (var annotation in annotations)
+ {
+ var realAnnotation = this.GetRealAnnotation(annotation);
+ if (realAnnotation != null)
+ {
+ yield return realAnnotation;
+ }
+ }
+ }
+
+ private SyntaxAnnotation GetRealAnnotation(TAnnotation annotation)
+ {
+ SyntaxAnnotation realAnnotation;
+ _realAnnotationMap.TryGetValue(annotation, out realAnnotation);
+ return realAnnotation;
+ }
+
+ public TSyntaxNode WithAdditionalAnnotations<TSyntaxNode>(TSyntaxNode node, params TAnnotation[] annotations) where TSyntaxNode : SyntaxNode
+ {
+ return node.WithAdditionalAnnotations(this.GetOrCreateRealAnnotations(annotations).ToArray());
+ }
+
+ public SyntaxToken WithAdditionalAnnotations(SyntaxToken token, params TAnnotation[] annotations)
+ {
+ return token.WithAdditionalAnnotations(this.GetOrCreateRealAnnotations(annotations).ToArray());
+ }
+
+ public SyntaxTrivia WithAdditionalAnnotations(SyntaxTrivia trivia, params TAnnotation[] annotations)
+ {
+ return trivia.WithAdditionalAnnotations(this.GetOrCreateRealAnnotations(annotations).ToArray());
+ }
+
+ public SyntaxNodeOrToken WithAdditionalAnnotations(SyntaxNodeOrToken nodeOrToken, params TAnnotation[] annotations)
+ {
+ return nodeOrToken.WithAdditionalAnnotations(this.GetOrCreateRealAnnotations(annotations).ToArray());
+ }
+
+ public TSyntaxNode WithoutAnnotations<TSyntaxNode>(TSyntaxNode node, params TAnnotation[] annotations) where TSyntaxNode : SyntaxNode
+ {
+ return node.WithoutAnnotations(GetRealAnnotations(annotations).ToArray());
+ }
+
+ public SyntaxToken WithoutAnnotations(SyntaxToken token, params TAnnotation[] annotations)
+ {
+ return token.WithoutAnnotations(GetRealAnnotations(annotations).ToArray());
+ }
+
+ public SyntaxTrivia WithoutAnnotations(SyntaxTrivia trivia, params TAnnotation[] annotations)
+ {
+ return trivia.WithoutAnnotations(GetRealAnnotations(annotations).ToArray());
+ }
+
+ public SyntaxNodeOrToken WithoutAnnotations(SyntaxNodeOrToken nodeOrToken, params TAnnotation[] annotations)
+ {
+ return nodeOrToken.WithoutAnnotations(GetRealAnnotations(annotations).ToArray());
+ }
+
+ private IEnumerable<TAnnotation> GetAnnotations(IEnumerable<SyntaxAnnotation> realAnnotations)
+ {
+ foreach (var ra in realAnnotations)
+ {
+ TAnnotation annotation;
+ if (_annotationMap.TryGetValue(ra.Data, out annotation))
+ {
+ yield return annotation;
+ }
+ }
+ }
+
+ public IEnumerable<TAnnotation> GetAnnotations(SyntaxNode node)
+ {
+ return GetAnnotations(node.GetAnnotations(_annotationKind));
+ }
+
+ public IEnumerable<TAnnotation> GetAnnotations(SyntaxToken token)
+ {
+ return GetAnnotations(token.GetAnnotations(_annotationKind));
+ }
+
+ public IEnumerable<TAnnotation> GetAnnotations(SyntaxTrivia trivia)
+ {
+ return GetAnnotations(trivia.GetAnnotations(_annotationKind));
+ }
+
+ public IEnumerable<TAnnotation> GetAnnotations(SyntaxNodeOrToken nodeOrToken)
+ {
+ return GetAnnotations(nodeOrToken.GetAnnotations(_annotationKind));
+ }
+
+ public IEnumerable<TSpecificAnnotation> GetAnnotations<TSpecificAnnotation>(SyntaxNode node) where TSpecificAnnotation : TAnnotation
+ {
+ return this.GetAnnotations(node).OfType<TSpecificAnnotation>();
+ }
+
+ public IEnumerable<TSpecificAnnotation> GetAnnotations<TSpecificAnnotation>(SyntaxToken token) where TSpecificAnnotation : TAnnotation
+ {
+ return this.GetAnnotations(token).OfType<TSpecificAnnotation>();
+ }
+
+ public IEnumerable<TSpecificAnnotation> GetAnnotations<TSpecificAnnotation>(SyntaxTrivia trivia) where TSpecificAnnotation : TAnnotation
+ {
+ return this.GetAnnotations(trivia).OfType<TSpecificAnnotation>();
+ }
+
+ public IEnumerable<TSpecificAnnotation> GetAnnotations<TSpecificAnnotation>(SyntaxNodeOrToken nodeOrToken) where TSpecificAnnotation : TAnnotation
+ {
+ return this.GetAnnotations(nodeOrToken).OfType<TSpecificAnnotation>();
+ }
+
+ public bool HasAnnotations(SyntaxNode node)
+ {
+ return node.HasAnnotations(_annotationKind);
+ }
+
+ public bool HasAnnotations(SyntaxToken token)
+ {
+ return token.HasAnnotations(_annotationKind);
+ }
+
+ public bool HasAnnotations(SyntaxTrivia trivia)
+ {
+ return trivia.HasAnnotations(_annotationKind);
+ }
+
+ public bool HasAnnotations(SyntaxNodeOrToken nodeOrToken)
+ {
+ return nodeOrToken.HasAnnotations(_annotationKind);
+ }
+
+ public bool HasAnnotations<TSpecificAnnotation>(SyntaxNode node) where TSpecificAnnotation : TAnnotation
+ {
+ return this.GetAnnotations(node).OfType<TSpecificAnnotation>().Any();
+ }
+
+ public bool HasAnnotations<TSpecificAnnotation>(SyntaxToken token) where TSpecificAnnotation : TAnnotation
+ {
+ return this.GetAnnotations(token).OfType<TSpecificAnnotation>().Any();
+ }
+
+ public bool HasAnnotations<TSpecificAnnotation>(SyntaxTrivia trivia) where TSpecificAnnotation : TAnnotation
+ {
+ return this.GetAnnotations(trivia).OfType<TSpecificAnnotation>().Any();
+ }
+
+ public bool HasAnnotations<TSpecificAnnotation>(SyntaxNodeOrToken nodeOrToken) where TSpecificAnnotation : TAnnotation
+ {
+ return this.GetAnnotations(nodeOrToken).OfType<TSpecificAnnotation>().Any();
+ }
+
+ public bool HasAnnotation(SyntaxNode node, TAnnotation annotation)
+ {
+ return node.HasAnnotation(this.GetRealAnnotation(annotation));
+ }
+
+ public bool HasAnnotation(SyntaxToken token, TAnnotation annotation)
+ {
+ return token.HasAnnotation(this.GetRealAnnotation(annotation));
+ }
+
+ public bool HasAnnotation(SyntaxTrivia trivia, TAnnotation annotation)
+ {
+ return trivia.HasAnnotation(this.GetRealAnnotation(annotation));
+ }
+
+ public bool HasAnnotation(SyntaxNodeOrToken nodeOrToken, TAnnotation annotation)
+ {
+ return nodeOrToken.HasAnnotation(this.GetRealAnnotation(annotation));
+ }
+
+ public IEnumerable<SyntaxNodeOrToken> GetAnnotatedNodesAndTokens(SyntaxNode node)
+ {
+ return node.GetAnnotatedNodesAndTokens(_annotationKind);
+ }
+
+ public IEnumerable<SyntaxNode> GetAnnotatedNodes(SyntaxNode node)
+ {
+ return node.GetAnnotatedNodesAndTokens(_annotationKind).Where(nt => nt.IsNode).Select(nt => nt.AsNode());
+ }
+
+ public IEnumerable<SyntaxToken> GetAnnotatedTokens(SyntaxNode node)
+ {
+ return node.GetAnnotatedNodesAndTokens(_annotationKind).Where(nt => nt.IsToken).Select(nt => nt.AsToken());
+ }
+
+ public IEnumerable<SyntaxTrivia> GetAnnotatedTrivia(SyntaxNode node)
+ {
+ return node.GetAnnotatedTrivia(_annotationKind);
+ }
+
+ public IEnumerable<SyntaxNodeOrToken> GetAnnotatedNodesAndTokens<TSpecificAnnotation>(SyntaxNode node) where TSpecificAnnotation : TAnnotation
+ {
+ return node.GetAnnotatedNodesAndTokens(_annotationKind).Where(nt => this.HasAnnotations<TSpecificAnnotation>(nt));
+ }
+
+ public IEnumerable<SyntaxNode> GetAnnotatedNodes<TSpecificAnnotation>(SyntaxNode node) where TSpecificAnnotation : TAnnotation
+ {
+ return node.GetAnnotatedNodesAndTokens(_annotationKind).Where(nt => nt.IsNode && this.HasAnnotations<TSpecificAnnotation>(nt)).Select(nt => nt.AsNode());
+ }
+
+ public IEnumerable<SyntaxToken> GetAnnotatedTokens<TSpecificAnnotation>(SyntaxNode node) where TSpecificAnnotation : TAnnotation
+ {
+ return node.GetAnnotatedNodesAndTokens(_annotationKind).Where(nt => nt.IsToken && this.HasAnnotations<TSpecificAnnotation>(nt)).Select(nt => nt.AsToken());
+ }
+
+ public IEnumerable<SyntaxTrivia> GetAnnotatedTrivia<TSpecificAnnotation>(SyntaxNode node) where TSpecificAnnotation : TAnnotation
+ {
+ return node.GetAnnotatedTrivia(_annotationKind).Where(tr => this.HasAnnotations<TSpecificAnnotation>(tr));
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/ArgumentSyntaxExtensions.cs b/main/src/addins/CSharpBinding/Util/ArgumentSyntaxExtensions.cs
new file mode 100644
index 0000000000..9dd82a8ee3
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/ArgumentSyntaxExtensions.cs
@@ -0,0 +1,119 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class ArgumentSyntaxExtensions
+ {
+ public static SyntaxTokenList GenerateParameterModifiers(this ArgumentSyntax argument)
+ {
+ // If the argument was marked with ref or out, then do the same for the parameter.
+ if (argument.RefOrOutKeyword.Kind() == SyntaxKind.RefKeyword ||
+ argument.RefOrOutKeyword.Kind() == SyntaxKind.OutKeyword)
+ {
+ return SyntaxFactory.TokenList(SyntaxFactory.Token(argument.RefOrOutKeyword.Kind()));
+ }
+
+ return default(SyntaxTokenList);
+ }
+
+ public static RefKind GetRefKind(this ArgumentSyntax argument)
+ {
+ var refSyntaxKind = argument.RefOrOutKeyword.Kind();
+ return
+ refSyntaxKind == SyntaxKind.RefKeyword ? RefKind.Ref :
+ refSyntaxKind == SyntaxKind.OutKeyword ? RefKind.Out : RefKind.None;
+ }
+
+ /// <summary>
+ /// Returns the parameter to which this argument is passed. If <paramref name="allowParams"/>
+ /// is true, the last parameter will be returned if it is params parameter and the index of
+ /// the specified argument is greater than the number of parameters.
+ /// </summary>
+ public static IParameterSymbol DetermineParameter(
+ this ArgumentSyntax argument,
+ SemanticModel semanticModel,
+ bool allowParams = false,
+ CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var argumentList = argument.Parent as BaseArgumentListSyntax;
+ if (argumentList == null)
+ {
+ return null;
+ }
+
+ var invocableExpression = argumentList.Parent as ExpressionSyntax;
+ if (invocableExpression == null)
+ {
+ return null;
+ }
+
+ var symbol = semanticModel.GetSymbolInfo(invocableExpression, cancellationToken).Symbol;
+ if (symbol == null)
+ {
+ return null;
+ }
+
+ var parameters = symbol.GetParameters();
+
+ // Handle named argument
+ if (argument.NameColon != null && !argument.NameColon.IsMissing)
+ {
+ var name = argument.NameColon.Name.Identifier.ValueText;
+ return parameters.FirstOrDefault(p => p.Name == name);
+ }
+
+ // Handle positional argument
+ var index = argumentList.Arguments.IndexOf(argument);
+ if (index < 0)
+ {
+ return null;
+ }
+
+ if (index < parameters.Length)
+ {
+ return parameters[index];
+ }
+
+ if (allowParams)
+ {
+ var lastParameter = parameters.LastOrDefault();
+ if (lastParameter == null)
+ {
+ return null;
+ }
+
+ if (lastParameter.IsParams)
+ {
+ return lastParameter;
+ }
+ }
+
+ return null;
+ }
+
+ public static ITypeSymbol DetermineParameterType(
+ this ArgumentSyntax argument,
+ SemanticModel semanticModel,
+ CancellationToken cancellationToken)
+ {
+ // If a parameter appears to have a void return type, then just use 'object'
+ // instead.
+ var typeInfo = semanticModel.GetTypeInfo(argument.Expression, cancellationToken);
+ if (typeInfo.Type != null && typeInfo.Type.SpecialType == SpecialType.System_Void)
+ {
+ return semanticModel.Compilation.ObjectType;
+ }
+
+ return semanticModel.GetType(argument.Expression, cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/CSharpSemanticFactsService.cs b/main/src/addins/CSharpBinding/Util/CSharpSemanticFactsService.cs
new file mode 100644
index 0000000000..fdb3b22f72
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/CSharpSemanticFactsService.cs
@@ -0,0 +1,270 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Composition;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class CSharpSemanticFactsService
+ {
+ public static bool SupportsImplicitInterfaceImplementation
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ public static bool ExposesAnonymousFunctionParameterNames
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ public static bool IsExpressionContext(this SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ var csharpModel = (SemanticModel)semanticModel;
+ return csharpModel.SyntaxTree.IsExpressionContext(
+ position,
+ csharpModel.SyntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken),
+ attributes: true, cancellationToken: cancellationToken, semanticModelOpt: csharpModel);
+ }
+
+ public static bool IsStatementContext(this SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ var csharpModel = (SemanticModel)semanticModel;
+ return csharpModel.SyntaxTree.IsStatementContext(
+ position, csharpModel.SyntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken), cancellationToken);
+ }
+
+ public static bool IsTypeContext(this SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ var csharpModel = (SemanticModel)semanticModel;
+ return csharpModel.SyntaxTree.IsTypeContext(position, cancellationToken, csharpModel);
+ }
+
+ public static bool IsNamespaceContext(this SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ var csharpModel = (SemanticModel)semanticModel;
+ return csharpModel.SyntaxTree.IsNamespaceContext(position, cancellationToken, csharpModel);
+ }
+
+ public static bool IsTypeDeclarationContext(this SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ var csharpModel = (SemanticModel)semanticModel;
+ return csharpModel.SyntaxTree.IsTypeDeclarationContext(
+ position, csharpModel.SyntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken), cancellationToken);
+ }
+
+ public static bool IsMemberDeclarationContext(this SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ var csharpModel = (SemanticModel)semanticModel;
+ return csharpModel.SyntaxTree.IsMemberDeclarationContext(
+ position, csharpModel.SyntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken), cancellationToken);
+ }
+
+ public static bool IsPreProcessorDirectiveContext(this SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ var csharpModel = (SemanticModel)semanticModel;
+ return csharpModel.SyntaxTree.IsPreProcessorDirectiveContext(
+ position, csharpModel.SyntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken, includeDirectives: true), cancellationToken);
+ }
+
+ public static bool IsGlobalStatementContext(this SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ var csharpModel = (SemanticModel)semanticModel;
+ return csharpModel.SyntaxTree.IsGlobalStatementContext(position, cancellationToken);
+ }
+
+ public static bool IsLabelContext(this SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ var csharpModel = (SemanticModel)semanticModel;
+ return csharpModel.SyntaxTree.IsLabelContext(position, cancellationToken);
+ }
+
+ public static bool IsAttributeNameContext(this SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ var csharpModel = (SemanticModel)semanticModel;
+ return csharpModel.SyntaxTree.IsAttributeNameContext(position, cancellationToken);
+ }
+
+ public static bool IsWrittenTo(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ return (node as ExpressionSyntax).IsWrittenTo();
+ }
+
+ public static bool IsOnlyWrittenTo(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ return (node as ExpressionSyntax).IsOnlyWrittenTo();
+ }
+
+ public static bool IsInOutContext(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ return (node as ExpressionSyntax).IsInOutContext();
+ }
+
+ public static bool IsInRefContext(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ return (node as ExpressionSyntax).IsInRefContext();
+ }
+
+ public static bool CanReplaceWithRValue(this SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken)
+ {
+ return (expression as ExpressionSyntax).CanReplaceWithRValue(semanticModel, cancellationToken);
+ }
+
+ public static string GenerateNameForExpression(this SemanticModel semanticModel, SyntaxNode expression, bool capitalize = false)
+ {
+ return semanticModel.GenerateNameForExpression((ExpressionSyntax)expression, capitalize);
+ }
+
+ public static ISymbol GetDeclaredSymbol(this SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken)
+ {
+ var location = token.GetLocation();
+ var q = from node in token.GetAncestors<SyntaxNode>()
+ let symbol = semanticModel.GetDeclaredSymbol(node, cancellationToken)
+ where symbol != null && symbol.Locations.Contains(location)
+ select symbol;
+
+ return q.FirstOrDefault();
+ }
+
+ public static bool LastEnumValueHasInitializer(INamedTypeSymbol namedTypeSymbol)
+ {
+ var enumDecl = namedTypeSymbol.DeclaringSyntaxReferences.Select(r => r.GetSyntax()).OfType<EnumDeclarationSyntax>().FirstOrDefault();
+ if (enumDecl != null)
+ {
+ var lastMember = enumDecl.Members.LastOrDefault();
+ if (lastMember != null)
+ {
+ return lastMember.EqualsValue != null;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool SupportsParameterizedProperties
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ public static bool SupportsParameterizedEvents
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ public static bool TryGetSpeculativeSemanticModel(this SemanticModel oldSemanticModel, SyntaxNode oldNode, SyntaxNode newNode, out SemanticModel speculativeModel)
+ {
+ var model = oldSemanticModel;
+
+ // currently we only support method. field support will be added later.
+ var oldMethod = oldNode as BaseMethodDeclarationSyntax;
+ var newMethod = newNode as BaseMethodDeclarationSyntax;
+ if (oldMethod == null || newMethod == null || oldMethod.Body == null)
+ {
+ speculativeModel = null;
+ return false;
+ }
+
+ SemanticModel csharpModel;
+ bool success = model.TryGetSpeculativeSemanticModelForMethodBody(oldMethod.Body.OpenBraceToken.Span.End, newMethod, out csharpModel);
+ speculativeModel = csharpModel;
+ return success;
+ }
+
+// public static ImmutableHashSet<string> GetAliasNameSet(this SemanticModel model, CancellationToken cancellationToken)
+// {
+// var original = (SemanticModel)model.GetOriginalSemanticModel();
+// if (!original.SyntaxTree.HasCompilationUnitRoot)
+// {
+// return ImmutableHashSet.Create<string>();
+// }
+//
+// var root = original.SyntaxTree.GetCompilationUnitRoot(cancellationToken);
+// var builder = ImmutableHashSet.CreateBuilder<string>(StringComparer.Ordinal);
+//
+// AppendAliasNames(root.Usings, builder);
+// AppendAliasNames(root.Members.OfType<NamespaceDeclarationSyntax>(), builder, cancellationToken);
+//
+// return builder.ToImmutable();
+// }
+//
+// private static void AppendAliasNames(SyntaxList<UsingDirectiveSyntax> usings, ImmutableHashSet<string>.Builder builder)
+// {
+// foreach (var @using in usings)
+// {
+// if (@using.Alias == null || @using.Alias.Name == null)
+// {
+// continue;
+// }
+//
+// @using.Alias.Name.Identifier.ValueText.AppendToAliasNameSet(builder);
+// }
+// }
+//
+// private void AppendAliasNames(IEnumerable<NamespaceDeclarationSyntax> namespaces, ImmutableHashSet<string>.Builder builder, CancellationToken cancellationToken)
+// {
+// foreach (var @namespace in namespaces)
+// {
+// cancellationToken.ThrowIfCancellationRequested();
+//
+// AppendAliasNames(@namespace.Usings, builder);
+// AppendAliasNames(@namespace.Members.OfType<NamespaceDeclarationSyntax>(), builder, cancellationToken);
+// }
+// }
+
+// public static ForEachSymbols GetForEachSymbols(this SemanticModel semanticModel, SyntaxNode forEachStatement)
+// {
+// var csforEachStatement = forEachStatement as ForEachStatementSyntax;
+// if (csforEachStatement != null)
+// {
+// var info = semanticModel.GetForEachStatementInfo(csforEachStatement);
+// return new ForEachSymbols(
+// info.GetEnumeratorMethod,
+// info.MoveNextMethod,
+// info.CurrentProperty,
+// info.DisposeMethod,
+// info.ElementType);
+// }
+// else
+// {
+// return default(ForEachSymbols);
+// }
+// }
+
+ public static bool IsAssignableTo(ITypeSymbol fromSymbol, ITypeSymbol toSymbol, Compilation compilation)
+ {
+ return fromSymbol != null &&
+ toSymbol != null &&
+ ((CSharpCompilation)compilation).ClassifyConversion(fromSymbol, toSymbol).IsImplicit;
+ }
+
+ public static bool IsNameOfContext(this SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ return semanticModel.SyntaxTree.IsNameOfContext(position, semanticModel, cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/CSharpSyntaxContext.cs b/main/src/addins/CSharpBinding/Util/CSharpSyntaxContext.cs
new file mode 100644
index 0000000000..5e9780f70d
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/CSharpSyntaxContext.cs
@@ -0,0 +1,572 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Reflection;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+using System.Runtime.ExceptionServices;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ class ReflectionNamespaces
+ {
+ public const string WorkspacesAsmName = ", Microsoft.CodeAnalysis.Workspaces";
+ public const string CSWorkspacesAsmName = ", Microsoft.CodeAnalysis.CSharp.Workspaces";
+ public const string CAAsmName = ", Microsoft.CodeAnalysis";
+ public const string CACSharpAsmName = ", Microsoft.CodeAnalysis.CSharp";
+ }
+
+ class CSharpSyntaxContext
+ {
+ readonly static Type typeInfoCSharpSyntaxContext;
+ readonly static Type typeInfoAbstractSyntaxContext;
+ readonly static MethodInfo createContextMethod;
+ readonly static PropertyInfo leftTokenProperty;
+ readonly static PropertyInfo targetTokenProperty;
+ readonly static FieldInfo isIsOrAsTypeContextField;
+ readonly static FieldInfo isInstanceContextField;
+ readonly static FieldInfo isNonAttributeExpressionContextField;
+ readonly static FieldInfo isPreProcessorKeywordContextField;
+ readonly static FieldInfo isPreProcessorExpressionContextField;
+ readonly static FieldInfo containingTypeDeclarationField;
+ readonly static FieldInfo isGlobalStatementContextField;
+ readonly static FieldInfo isParameterTypeContextField;
+ readonly static PropertyInfo syntaxTreeProperty;
+
+
+ object instance;
+
+ public SyntaxToken LeftToken {
+ get {
+ return (SyntaxToken)leftTokenProperty.GetValue (instance);
+ }
+ }
+
+ public SyntaxToken TargetToken {
+ get {
+ return (SyntaxToken)targetTokenProperty.GetValue (instance);
+ }
+ }
+
+ public bool IsIsOrAsTypeContext {
+ get {
+ return (bool)isIsOrAsTypeContextField.GetValue (instance);
+ }
+ }
+
+ public bool IsInstanceContext {
+ get {
+ return (bool)isInstanceContextField.GetValue (instance);
+ }
+ }
+
+ public bool IsNonAttributeExpressionContext {
+ get {
+ return (bool)isNonAttributeExpressionContextField.GetValue (instance);
+ }
+ }
+
+ public bool IsPreProcessorKeywordContext {
+ get {
+ return (bool)isPreProcessorKeywordContextField.GetValue (instance);
+ }
+ }
+
+ public bool IsPreProcessorExpressionContext {
+ get {
+ return (bool)isPreProcessorExpressionContextField.GetValue (instance);
+ }
+ }
+
+ public TypeDeclarationSyntax ContainingTypeDeclaration {
+ get {
+ return (TypeDeclarationSyntax)containingTypeDeclarationField.GetValue (instance);
+ }
+ }
+
+ public bool IsGlobalStatementContext {
+ get {
+ return (bool)isGlobalStatementContextField.GetValue (instance);
+ }
+ }
+
+ public bool IsParameterTypeContext {
+ get {
+ return (bool)isParameterTypeContextField.GetValue (instance);
+ }
+ }
+
+ public SyntaxTree SyntaxTree {
+ get {
+ return (SyntaxTree)syntaxTreeProperty.GetValue (instance);
+ }
+ }
+
+
+ readonly static MethodInfo isMemberDeclarationContextMethod;
+
+ public bool IsMemberDeclarationContext (
+ ISet<SyntaxKind> validModifiers = null,
+ ISet<SyntaxKind> validTypeDeclarations = null,
+ bool canBePartial = false,
+ CancellationToken cancellationToken = default(CancellationToken))
+ {
+ try {
+ return (bool)isMemberDeclarationContextMethod.Invoke (instance, new object[] {
+ validModifiers,
+ validTypeDeclarations,
+ canBePartial,
+ cancellationToken
+ });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+
+ readonly static MethodInfo isTypeDeclarationContextMethod;
+
+ public bool IsTypeDeclarationContext (
+ ISet<SyntaxKind> validModifiers = null,
+ ISet<SyntaxKind> validTypeDeclarations = null,
+ bool canBePartial = false,
+ CancellationToken cancellationToken = default(CancellationToken))
+ {
+ try {
+ return (bool)isTypeDeclarationContextMethod.Invoke (instance, new object[] {
+ validModifiers,
+ validTypeDeclarations,
+ canBePartial,
+ cancellationToken
+ });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+
+ readonly static PropertyInfo isPreProcessorDirectiveContextProperty;
+
+ public bool IsPreProcessorDirectiveContext {
+ get {
+ return (bool)isPreProcessorDirectiveContextProperty.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isInNonUserCodeField;
+
+ public bool IsInNonUserCode {
+ get {
+ return (bool)isInNonUserCodeField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isIsOrAsContextField;
+
+ public bool IsIsOrAsContext {
+ get {
+ return (bool)isIsOrAsContextField.GetValue (instance);
+ }
+ }
+
+ readonly static MethodInfo isTypeAttributeContextMethod;
+
+ public bool IsTypeAttributeContext (CancellationToken cancellationToken)
+ {
+ try {
+ return (bool)isTypeAttributeContextMethod.Invoke (instance, new object[] { cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+
+ readonly static PropertyInfo isAnyExpressionContextProperty;
+
+ public bool IsAnyExpressionContext {
+ get {
+ return (bool)isAnyExpressionContextProperty.GetValue (instance);
+ }
+ }
+
+ readonly static PropertyInfo isStatementContextProperty;
+
+ public bool IsStatementContext {
+ get {
+ return (bool)isStatementContextProperty.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isDefiniteCastTypeContextField;
+
+ public bool IsDefiniteCastTypeContext {
+ get {
+ return (bool)isDefiniteCastTypeContextField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isObjectCreationTypeContextField;
+
+ public bool IsObjectCreationTypeContext {
+ get {
+ return (bool)isObjectCreationTypeContextField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isGenericTypeArgumentContextField;
+
+ public bool IsGenericTypeArgumentContext {
+ get {
+ return (bool)isGenericTypeArgumentContextField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isLocalVariableDeclarationContextField;
+
+ public bool IsLocalVariableDeclarationContext {
+ get {
+ return (bool)isLocalVariableDeclarationContextField.GetValue (instance);
+ }
+ }
+
+
+ readonly static FieldInfo isFixedVariableDeclarationContextField;
+
+ public bool IsFixedVariableDeclarationContext {
+ get {
+ return (bool)isFixedVariableDeclarationContextField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isPossibleLambdaOrAnonymousMethodParameterTypeContextField;
+
+ public bool IsPossibleLambdaOrAnonymousMethodParameterTypeContext {
+ get {
+ return (bool)isPossibleLambdaOrAnonymousMethodParameterTypeContextField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isImplicitOrExplicitOperatorTypeContextField;
+
+ public bool IsImplicitOrExplicitOperatorTypeContext {
+ get {
+ return (bool)isImplicitOrExplicitOperatorTypeContextField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isPrimaryFunctionExpressionContextField;
+
+ public bool IsPrimaryFunctionExpressionContext {
+ get {
+ return (bool)isPrimaryFunctionExpressionContextField.GetValue (instance);
+ }
+ }
+
+
+ readonly static FieldInfo isCrefContextField;
+
+ public bool IsCrefContext {
+ get {
+ return (bool)isCrefContextField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isDelegateReturnTypeContextField;
+
+ public bool IsDelegateReturnTypeContext {
+ get {
+ return (bool)isDelegateReturnTypeContextField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isEnumBaseListContextField;
+
+ public bool IsEnumBaseListContext {
+ get {
+ return (bool)isEnumBaseListContextField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isConstantExpressionContextField;
+
+ public bool IsConstantExpressionContext {
+ get {
+ return (bool)isConstantExpressionContextField.GetValue (instance);
+ }
+ }
+
+ readonly static MethodInfo isMemberAttributeContextMethod;
+ public bool IsMemberAttributeContext(ISet<SyntaxKind> validTypeDeclarations, CancellationToken cancellationToken)
+ {
+ try {
+ return (bool)isMemberAttributeContextMethod.Invoke (instance, new object [] {
+ validTypeDeclarations,
+ cancellationToken
+ });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+
+ }
+
+ readonly static FieldInfo precedingModifiersField;
+
+ public ISet<SyntaxKind> PrecedingModifiers {
+ get {
+ return (ISet<SyntaxKind>)precedingModifiersField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo isTypeOfExpressionContextField;
+
+ public bool IsTypeOfExpressionContext {
+ get {
+ return (bool)isTypeOfExpressionContextField.GetValue (instance);
+ }
+ }
+
+ readonly static FieldInfo containingTypeOrEnumDeclarationField;
+
+ public BaseTypeDeclarationSyntax ContainingTypeOrEnumDeclaration {
+ get {
+ return (BaseTypeDeclarationSyntax)containingTypeOrEnumDeclarationField.GetValue (instance);
+ }
+ }
+ static readonly PropertyInfo isAttributeNameContextProperty;
+
+ public bool IsAttributeNameContext {
+ get {
+ return (bool)isAttributeNameContextProperty.GetValue (instance);
+ }
+ }
+
+ static readonly PropertyInfo isInQueryProperty;
+ public bool IsInQuery {
+ get {
+ return (bool)isInQueryProperty.GetValue (instance);
+ }
+ }
+
+
+ static CSharpSyntaxContext ()
+ {
+ typeInfoAbstractSyntaxContext = Type.GetType("Microsoft.CodeAnalysis.Shared.Extensions.ContextQuery.AbstractSyntaxContext" + ReflectionNamespaces.WorkspacesAsmName, true);
+ typeInfoCSharpSyntaxContext = Type.GetType ("Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery.CSharpSyntaxContext" + ReflectionNamespaces.CSWorkspacesAsmName, true);
+
+ createContextMethod = typeInfoCSharpSyntaxContext.GetMethod ("CreateContext", BindingFlags.Static | BindingFlags.Public);
+ leftTokenProperty = typeInfoAbstractSyntaxContext.GetProperty ("LeftToken");
+ targetTokenProperty = typeInfoAbstractSyntaxContext.GetProperty ("TargetToken");
+ isIsOrAsTypeContextField = typeInfoCSharpSyntaxContext.GetField ("IsIsOrAsTypeContext");
+ isInstanceContextField = typeInfoCSharpSyntaxContext.GetField ("IsInstanceContext");
+ isNonAttributeExpressionContextField = typeInfoCSharpSyntaxContext.GetField ("IsNonAttributeExpressionContext");
+ isPreProcessorKeywordContextField = typeInfoCSharpSyntaxContext.GetField ("IsPreProcessorKeywordContext");
+ isPreProcessorExpressionContextField = typeInfoCSharpSyntaxContext.GetField ("IsPreProcessorExpressionContext");
+ containingTypeDeclarationField = typeInfoCSharpSyntaxContext.GetField ("ContainingTypeDeclaration");
+ isGlobalStatementContextField = typeInfoCSharpSyntaxContext.GetField ("IsGlobalStatementContext");
+ isParameterTypeContextField = typeInfoCSharpSyntaxContext.GetField ("IsParameterTypeContext");
+ isMemberDeclarationContextMethod = typeInfoCSharpSyntaxContext.GetMethod ("IsMemberDeclarationContext", BindingFlags.Instance | BindingFlags.Public);
+ isTypeDeclarationContextMethod = typeInfoCSharpSyntaxContext.GetMethod ("IsTypeDeclarationContext", BindingFlags.Instance | BindingFlags.Public);
+ syntaxTreeProperty = typeInfoAbstractSyntaxContext.GetProperty ("SyntaxTree");
+ isPreProcessorDirectiveContextProperty = typeInfoAbstractSyntaxContext.GetProperty ("IsPreProcessorDirectiveContext");
+ isInNonUserCodeField = typeInfoCSharpSyntaxContext.GetField ("IsInNonUserCode");
+ isIsOrAsContextField = typeInfoCSharpSyntaxContext.GetField ("IsIsOrAsContext");
+ isTypeAttributeContextMethod = typeInfoCSharpSyntaxContext.GetMethod ("IsTypeAttributeContext", BindingFlags.Instance | BindingFlags.Public);
+ isAnyExpressionContextProperty = typeInfoAbstractSyntaxContext.GetProperty ("IsAnyExpressionContext");
+ isStatementContextProperty = typeInfoAbstractSyntaxContext.GetProperty ("IsStatementContext");
+ isDefiniteCastTypeContextField = typeInfoCSharpSyntaxContext.GetField ("IsDefiniteCastTypeContext");
+ isObjectCreationTypeContextField = typeInfoCSharpSyntaxContext.GetField ("IsObjectCreationTypeContext");
+ isGenericTypeArgumentContextField = typeInfoCSharpSyntaxContext.GetField ("IsGenericTypeArgumentContext");
+ isLocalVariableDeclarationContextField = typeInfoCSharpSyntaxContext.GetField ("IsLocalVariableDeclarationContext");
+ isFixedVariableDeclarationContextField = typeInfoCSharpSyntaxContext.GetField ("IsFixedVariableDeclarationContext");
+ isPossibleLambdaOrAnonymousMethodParameterTypeContextField = typeInfoCSharpSyntaxContext.GetField ("IsPossibleLambdaOrAnonymousMethodParameterTypeContext");
+ isImplicitOrExplicitOperatorTypeContextField = typeInfoCSharpSyntaxContext.GetField ("IsImplicitOrExplicitOperatorTypeContext");
+ isPrimaryFunctionExpressionContextField = typeInfoCSharpSyntaxContext.GetField ("IsPrimaryFunctionExpressionContext");
+ isCrefContextField = typeInfoCSharpSyntaxContext.GetField ("IsCrefContext");
+ isDelegateReturnTypeContextField = typeInfoCSharpSyntaxContext.GetField ("IsDelegateReturnTypeContext");
+ isEnumBaseListContextField = typeInfoCSharpSyntaxContext.GetField ("IsEnumBaseListContext");
+ isConstantExpressionContextField = typeInfoCSharpSyntaxContext.GetField ("IsConstantExpressionContext");
+ isMemberAttributeContextMethod = typeInfoCSharpSyntaxContext.GetMethod ("IsMemberAttributeContext", BindingFlags.Instance | BindingFlags.Public);
+ precedingModifiersField = typeInfoCSharpSyntaxContext.GetField ("PrecedingModifiers");
+ isTypeOfExpressionContextField = typeInfoCSharpSyntaxContext.GetField ("IsTypeOfExpressionContext");
+ containingTypeOrEnumDeclarationField = typeInfoCSharpSyntaxContext.GetField ("ContainingTypeOrEnumDeclaration");
+
+ isAttributeNameContextProperty = typeInfoAbstractSyntaxContext.GetProperty ("IsAttributeNameContext");
+ isInQueryProperty = typeInfoAbstractSyntaxContext.GetProperty ("IsInQuery");
+ }
+
+ public SemanticModel SemanticModel {
+ get;
+ private set;
+ }
+
+ public int Position {
+ get;
+ private set;
+ }
+
+ CSharpSyntaxContext (object instance)
+ {
+ this.instance = instance;
+ }
+
+ public static CSharpSyntaxContext CreateContext (Workspace workspace, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ try {
+ return new CSharpSyntaxContext (createContextMethod.Invoke (null, new object[] {
+ workspace,
+ semanticModel,
+ position,
+ cancellationToken
+ })) {
+ SemanticModel = semanticModel,
+ Position = position
+ };
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+ }
+
+ class CSharpTypeInferenceService
+ {
+ readonly static Type typeInfo;
+ readonly static MethodInfo inferTypesMethod;
+ readonly static MethodInfo inferTypes2Method;
+ readonly object instance;
+
+ static CSharpTypeInferenceService ()
+ {
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.CSharp.CSharpTypeInferenceService" + ReflectionNamespaces.CSWorkspacesAsmName, true);
+
+ inferTypesMethod = typeInfo.GetMethod ("InferTypes", new[] {
+ typeof(SemanticModel),
+ typeof(int),
+ typeof(CancellationToken)
+ });
+ inferTypes2Method = typeInfo.GetMethod ("InferTypes", new[] {
+ typeof(SemanticModel),
+ typeof(SyntaxNode),
+ typeof(CancellationToken)
+ });
+ }
+
+ public CSharpTypeInferenceService ()
+ {
+ instance = Activator.CreateInstance (typeInfo);
+ }
+
+ public IEnumerable<ITypeSymbol> InferTypes (SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ try {
+ return (IEnumerable<ITypeSymbol>)inferTypesMethod.Invoke (instance, new object[] {
+ semanticModel,
+ position,
+ cancellationToken
+ });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ public IEnumerable<ITypeSymbol> InferTypes (SemanticModel semanticModel, SyntaxNode expression, CancellationToken cancellationToken)
+ {
+ try {
+ return (IEnumerable<ITypeSymbol>)inferTypes2Method.Invoke (instance, new object[] {
+ semanticModel,
+ expression,
+ cancellationToken
+ });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+
+ public ITypeSymbol InferType(
+ SemanticModel semanticModel,
+ SyntaxNode expression,
+ bool objectAsDefault,
+ CancellationToken cancellationToken)
+ {
+ var types = InferTypes(semanticModel, expression, cancellationToken)
+ .WhereNotNull();
+
+ if (!types.Any())
+ {
+ return objectAsDefault ? semanticModel.Compilation.ObjectType : null;
+ }
+
+ return types.FirstOrDefault();
+ }
+
+
+ public INamedTypeSymbol InferDelegateType(
+ SemanticModel semanticModel,
+ SyntaxNode expression,
+ CancellationToken cancellationToken)
+ {
+ var type = this.InferType(semanticModel, expression, objectAsDefault: false, cancellationToken: cancellationToken);
+ return type.GetDelegateType(semanticModel.Compilation);
+ }
+
+
+ public ITypeSymbol InferType(
+ SemanticModel semanticModel,
+ int position,
+ bool objectAsDefault,
+ CancellationToken cancellationToken)
+ {
+ var types = this.InferTypes(semanticModel, position, cancellationToken)
+ .WhereNotNull();
+
+ if (!types.Any())
+ {
+ return objectAsDefault ? semanticModel.Compilation.ObjectType : null;
+ }
+
+ return types.FirstOrDefault();
+ }
+
+ }
+
+ class CaseCorrector
+ {
+ readonly static Type typeInfo;
+ readonly static MethodInfo caseCorrectAsyncMethod;
+
+ static CaseCorrector ()
+ {
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.CaseCorrection.CaseCorrector" + ReflectionNamespaces.WorkspacesAsmName, true);
+
+ Annotation = (SyntaxAnnotation)typeInfo.GetField ("Annotation", BindingFlags.Public | BindingFlags.Static).GetValue (null);
+
+ caseCorrectAsyncMethod = typeInfo.GetMethod ("CaseCorrectAsync", new[] {
+ typeof(Document),
+ typeof(SyntaxAnnotation),
+ typeof(CancellationToken)
+ });
+ }
+
+ public static readonly SyntaxAnnotation Annotation;
+
+ public static Task<Document> CaseCorrectAsync (Document document, SyntaxAnnotation annotation, CancellationToken cancellationToken)
+ {
+ try {
+ return (Task<Document>)caseCorrectAsyncMethod.Invoke (null, new object[] { document, annotation, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+ }
+
+
+}
diff --git a/main/src/addins/CSharpBinding/Util/CSharpSyntaxFactsService.cs b/main/src/addins/CSharpBinding/Util/CSharpSyntaxFactsService.cs
new file mode 100644
index 0000000000..1e14ae518a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/CSharpSyntaxFactsService.cs
@@ -0,0 +1,1040 @@
+//
+// CSharpSyntaxFactsService.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.Diagnostics;
+using System.Text;
+using System.Collections.Generic;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class CSharpSyntaxFactsService
+ {
+ public static bool IsAwaitKeyword (this SyntaxToken token)
+ {
+ return token.IsKind (SyntaxKind.AwaitKeyword);
+ }
+
+ public static bool IsIdentifier (this SyntaxToken token)
+ {
+ return token.IsKind (SyntaxKind.IdentifierToken);
+ }
+
+ public static bool IsGlobalNamespaceKeyword (this SyntaxToken token)
+ {
+ return token.IsKind (SyntaxKind.GlobalKeyword);
+ }
+
+ public static bool IsVerbatimIdentifier (this SyntaxToken token)
+ {
+ return token.IsKind (SyntaxKind.IdentifierToken) && token.Text.Length > 0 && token.Text [0] == '@';
+ }
+
+ public static bool IsOperator (this SyntaxToken token)
+ {
+ var kind = token.Kind ();
+
+ return
+ (SyntaxFacts.IsAnyUnaryExpression (kind) &&
+ (token.Parent is PrefixUnaryExpressionSyntax || token.Parent is PostfixUnaryExpressionSyntax)) ||
+ (SyntaxFacts.IsBinaryExpression (kind) && token.Parent is BinaryExpressionSyntax) ||
+ (SyntaxFacts.IsAssignmentExpressionOperatorToken (kind) && token.Parent is AssignmentExpressionSyntax);
+ }
+
+ public static bool IsKeyword (this SyntaxToken token)
+ {
+ var kind = (SyntaxKind)token.RawKind;
+ return
+ SyntaxFacts.IsKeywordKind (kind); // both contextual and reserved keywords
+ }
+ //
+ // public bool IsContextualKeyword(SyntaxToken token)
+ // {
+ // var kind = (SyntaxKind)token.RawKind;
+ // return
+ // SyntaxFacts.IsContextualKeyword(kind);
+ // }
+ //
+ // public bool IsPreprocessorKeyword(SyntaxToken token)
+ // {
+ // var kind = (SyntaxKind)token.RawKind;
+ // return
+ // SyntaxFacts.IsPreprocessorKeyword(kind);
+ // }
+ //
+ // public bool IsHashToken(SyntaxToken token)
+ // {
+ // return (SyntaxKind)token.RawKind == SyntaxKind.HashToken;
+ // }
+ //
+ // public bool IsInInactiveRegion(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ // {
+ // var csharpTree = syntaxTree as SyntaxTree;
+ // if (csharpTree == null)
+ // {
+ // return false;
+ // }
+ //
+ // return csharpTree.IsInInactiveRegion(position, cancellationToken);
+ // }
+ //
+ // public bool IsInNonUserCode(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ // {
+ // var csharpTree = syntaxTree as SyntaxTree;
+ // if (csharpTree == null)
+ // {
+ // return false;
+ // }
+ //
+ // return csharpTree.IsInNonUserCode(position, cancellationToken);
+ // }
+ //
+ // public bool IsEntirelyWithinStringOrCharLiteral(SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ // {
+ // var csharpTree = syntaxTree as SyntaxTree;
+ // if (csharpTree == null)
+ // {
+ // return false;
+ // }
+ //
+ // return csharpTree.IsEntirelyWithinStringOrCharLiteral(position, cancellationToken);
+ // }
+ //
+ // public bool IsDirective(SyntaxNode node)
+ // {
+ // return node is DirectiveTriviaSyntax;
+ // }
+ //
+ // public bool TryGetExternalSourceInfo(SyntaxNode node, out ExternalSourceInfo info)
+ // {
+ // var lineDirective = node as LineDirectiveTriviaSyntax;
+ // if (lineDirective != null)
+ // {
+ // if (lineDirective.Line.Kind() == SyntaxKind.DefaultKeyword)
+ // {
+ // info = new ExternalSourceInfo(null, ends: true);
+ // return true;
+ // }
+ // else if (lineDirective.Line.Kind() == SyntaxKind.NumericLiteralToken &&
+ // lineDirective.Line.Value is int)
+ // {
+ // info = new ExternalSourceInfo((int)lineDirective.Line.Value, false);
+ // return true;
+ // }
+ // }
+ //
+ // info = default(ExternalSourceInfo);
+ // return false;
+ // }
+
+ public static bool IsRightSideOfQualifiedName (this SyntaxNode node)
+ {
+ var name = node as SimpleNameSyntax;
+ return name.IsRightSideOfQualifiedName ();
+ }
+
+ public static bool IsMemberAccessExpressionName (this SyntaxNode node)
+ {
+ var name = node as SimpleNameSyntax;
+ return name.IsMemberAccessExpressionName ();
+ }
+
+ public static bool IsObjectCreationExpressionType (this SyntaxNode node)
+ {
+ return node.IsParentKind (SyntaxKind.ObjectCreationExpression) &&
+ ((ObjectCreationExpressionSyntax)node.Parent).Type == node;
+ }
+
+ public static bool IsAttributeName (this SyntaxNode node)
+ {
+ return SyntaxFacts.IsAttributeName (node);
+ }
+
+ // public bool IsInvocationExpression(SyntaxNode node)
+ // {
+ // return node is InvocationExpressionSyntax;
+ // }
+ //
+ // public bool IsAnonymousFunction(SyntaxNode node)
+ // {
+ // return node is ParenthesizedLambdaExpressionSyntax ||
+ // node is SimpleLambdaExpressionSyntax ||
+ // node is AnonymousMethodExpressionSyntax;
+ // }
+ //
+ // public bool IsGenericName(SyntaxNode node)
+ // {
+ // return node is GenericNameSyntax;
+ // }
+
+ public static bool IsNamedParameter (this SyntaxNode node)
+ {
+ return node.CheckParent<NameColonSyntax> (p => p.Name == node);
+ }
+
+ // public bool IsSkippedTokensTrivia(SyntaxNode node)
+ // {
+ // return node is SkippedTokensTriviaSyntax;
+ // }
+
+ public static bool HasIncompleteParentMember (this SyntaxNode node)
+ {
+ return node.IsParentKind (SyntaxKind.IncompleteMember);
+ }
+
+ // public SyntaxToken GetIdentifierOfGenericName(SyntaxNode genericName)
+ // {
+ // var csharpGenericName = genericName as GenericNameSyntax;
+ // return csharpGenericName != null
+ // ? csharpGenericName.Identifier
+ // : default(SyntaxToken);
+ // }
+ //
+ // public bool IsCaseSensitive
+ // {
+ // get
+ // {
+ // return true;
+ // }
+ // }
+ //
+ // public bool IsUsingDirectiveName(SyntaxNode node)
+ // {
+ // return
+ // node.IsParentKind(SyntaxKind.UsingDirective) &&
+ // ((UsingDirectiveSyntax)node.Parent).Name == node;
+ // }
+ //
+ // public bool IsForEachStatement(SyntaxNode node)
+ // {
+ // return node is ForEachStatementSyntax;
+ // }
+ //
+ // public bool IsLockStatement(SyntaxNode node)
+ // {
+ // return node is LockStatementSyntax;
+ // }
+ //
+ // public bool IsUsingStatement(SyntaxNode node)
+ // {
+ // return node is UsingStatementSyntax;
+ // }
+ //
+ // public bool IsThisConstructorInitializer(SyntaxToken token)
+ // {
+ // return token.Parent.IsKind(SyntaxKind.ThisConstructorInitializer) &&
+ // ((ConstructorInitializerSyntax)token.Parent).ThisOrBaseKeyword == token;
+ // }
+ //
+ // public bool IsBaseConstructorInitializer(SyntaxToken token)
+ // {
+ // return token.Parent.IsKind(SyntaxKind.BaseConstructorInitializer) &&
+ // ((ConstructorInitializerSyntax)token.Parent).ThisOrBaseKeyword == token;
+ // }
+ //
+ // public bool IsQueryExpression(SyntaxNode node)
+ // {
+ // return node is QueryExpressionSyntax;
+ // }
+ //
+ // public bool IsPredefinedType(SyntaxToken token)
+ // {
+ // PredefinedType actualType;
+ // return TryGetPredefinedType(token, out actualType) && actualType != PredefinedType.None;
+ // }
+ //
+ // public bool IsPredefinedType(SyntaxToken token, PredefinedType type)
+ // {
+ // PredefinedType actualType;
+ // return TryGetPredefinedType(token, out actualType) && actualType == type;
+ // }
+ //
+ // public bool TryGetPredefinedType(SyntaxToken token, out PredefinedType type)
+ // {
+ // type = GetPredefinedType(token);
+ // return type != PredefinedType.None;
+ // }
+ //
+ // private PredefinedType GetPredefinedType(SyntaxToken token)
+ // {
+ // switch ((SyntaxKind)token.RawKind)
+ // {
+ // case SyntaxKind.BoolKeyword:
+ // return PredefinedType.Boolean;
+ // case SyntaxKind.ByteKeyword:
+ // return PredefinedType.Byte;
+ // case SyntaxKind.SByteKeyword:
+ // return PredefinedType.SByte;
+ // case SyntaxKind.IntKeyword:
+ // return PredefinedType.Int32;
+ // case SyntaxKind.UIntKeyword:
+ // return PredefinedType.UInt32;
+ // case SyntaxKind.ShortKeyword:
+ // return PredefinedType.Int16;
+ // case SyntaxKind.UShortKeyword:
+ // return PredefinedType.UInt16;
+ // case SyntaxKind.LongKeyword:
+ // return PredefinedType.Int64;
+ // case SyntaxKind.ULongKeyword:
+ // return PredefinedType.UInt64;
+ // case SyntaxKind.FloatKeyword:
+ // return PredefinedType.Single;
+ // case SyntaxKind.DoubleKeyword:
+ // return PredefinedType.Double;
+ // case SyntaxKind.DecimalKeyword:
+ // return PredefinedType.Decimal;
+ // case SyntaxKind.StringKeyword:
+ // return PredefinedType.String;
+ // case SyntaxKind.CharKeyword:
+ // return PredefinedType.Char;
+ // case SyntaxKind.ObjectKeyword:
+ // return PredefinedType.Object;
+ // case SyntaxKind.VoidKeyword:
+ // return PredefinedType.Void;
+ // default:
+ // return PredefinedType.None;
+ // }
+ // }
+ //
+ // public bool IsPredefinedOperator(SyntaxToken token)
+ // {
+ // PredefinedOperator actualOperator;
+ // return TryGetPredefinedOperator(token, out actualOperator) && actualOperator != PredefinedOperator.None;
+ // }
+ //
+ // public bool IsPredefinedOperator(SyntaxToken token, PredefinedOperator op)
+ // {
+ // PredefinedOperator actualOperator;
+ // return TryGetPredefinedOperator(token, out actualOperator) && actualOperator == op;
+ // }
+ //
+ // public bool TryGetPredefinedOperator(SyntaxToken token, out PredefinedOperator op)
+ // {
+ // op = GetPredefinedOperator(token);
+ // return op != PredefinedOperator.None;
+ // }
+ //
+ // private PredefinedOperator GetPredefinedOperator(SyntaxToken token)
+ // {
+ // switch ((SyntaxKind)token.RawKind)
+ // {
+ // case SyntaxKind.PlusToken:
+ // case SyntaxKind.PlusEqualsToken:
+ // return PredefinedOperator.Addition;
+ //
+ // case SyntaxKind.MinusToken:
+ // case SyntaxKind.MinusEqualsToken:
+ // return PredefinedOperator.Subtraction;
+ //
+ // case SyntaxKind.AmpersandToken:
+ // case SyntaxKind.AmpersandEqualsToken:
+ // return PredefinedOperator.BitwiseAnd;
+ //
+ // case SyntaxKind.BarToken:
+ // case SyntaxKind.BarEqualsToken:
+ // return PredefinedOperator.BitwiseOr;
+ //
+ // case SyntaxKind.MinusMinusToken:
+ // return PredefinedOperator.Decrement;
+ //
+ // case SyntaxKind.PlusPlusToken:
+ // return PredefinedOperator.Increment;
+ //
+ // case SyntaxKind.SlashToken:
+ // case SyntaxKind.SlashEqualsToken:
+ // return PredefinedOperator.Division;
+ //
+ // case SyntaxKind.EqualsEqualsToken:
+ // return PredefinedOperator.Equality;
+ //
+ // case SyntaxKind.CaretToken:
+ // case SyntaxKind.CaretEqualsToken:
+ // return PredefinedOperator.ExclusiveOr;
+ //
+ // case SyntaxKind.GreaterThanToken:
+ // return PredefinedOperator.GreaterThan;
+ //
+ // case SyntaxKind.GreaterThanEqualsToken:
+ // return PredefinedOperator.GreaterThanOrEqual;
+ //
+ // case SyntaxKind.ExclamationEqualsToken:
+ // return PredefinedOperator.Inequality;
+ //
+ // case SyntaxKind.LessThanLessThanToken:
+ // case SyntaxKind.LessThanLessThanEqualsToken:
+ // return PredefinedOperator.LeftShift;
+ //
+ // case SyntaxKind.LessThanEqualsToken:
+ // return PredefinedOperator.LessThanOrEqual;
+ //
+ // case SyntaxKind.AsteriskToken:
+ // case SyntaxKind.AsteriskEqualsToken:
+ // return PredefinedOperator.Multiplication;
+ //
+ // case SyntaxKind.PercentToken:
+ // case SyntaxKind.PercentEqualsToken:
+ // return PredefinedOperator.Modulus;
+ //
+ // case SyntaxKind.ExclamationToken:
+ // case SyntaxKind.TildeToken:
+ // return PredefinedOperator.Complement;
+ //
+ // case SyntaxKind.GreaterThanGreaterThanToken:
+ // case SyntaxKind.GreaterThanGreaterThanEqualsToken:
+ // return PredefinedOperator.RightShift;
+ // }
+ //
+ // return PredefinedOperator.None;
+ // }
+ //
+ // public string GetText(int kind)
+ // {
+ // return SyntaxFacts.GetText((SyntaxKind)kind);
+ // }
+ //
+ // public bool IsIdentifierStartCharacter(char c)
+ // {
+ // return SyntaxFacts.IsIdentifierStartCharacter(c);
+ // }
+ //
+ // public bool IsIdentifierPartCharacter(char c)
+ // {
+ // return SyntaxFacts.IsIdentifierPartCharacter(c);
+ // }
+ //
+ // public bool IsIdentifierEscapeCharacter(char c)
+ // {
+ // return c == '@';
+ // }
+ //
+ // public bool IsValidIdentifier(string identifier)
+ // {
+ // var token = SyntaxFactory.ParseToken(identifier);
+ // return IsIdentifier(token) && !token.ContainsDiagnostics && token.ToString().Length == identifier.Length;
+ // }
+ //
+ // public bool IsVerbatimIdentifier(string identifier)
+ // {
+ // var token = SyntaxFactory.ParseToken(identifier);
+ // return IsIdentifier(token) && !token.ContainsDiagnostics && token.ToString().Length == identifier.Length && token.IsVerbatimIdentifier();
+ // }
+ //
+ // public bool IsTypeCharacter(char c)
+ // {
+ // return false;
+ // }
+ //
+ // public bool IsStartOfUnicodeEscapeSequence(char c)
+ // {
+ // return c == '\\';
+ // }
+ //
+ // public bool IsLiteral(SyntaxToken token)
+ // {
+ // switch (token.Kind())
+ // {
+ // case SyntaxKind.NumericLiteralToken:
+ // case SyntaxKind.CharacterLiteralToken:
+ // case SyntaxKind.StringLiteralToken:
+ // case SyntaxKind.NullKeyword:
+ // case SyntaxKind.TrueKeyword:
+ // case SyntaxKind.FalseKeyword:
+ // return true;
+ // }
+ //
+ // return false;
+ // }
+ //
+ // public bool IsStringLiteral(SyntaxToken token)
+ // {
+ // return token.IsKind(SyntaxKind.StringLiteralToken);
+ // }
+ //
+ // public bool IsTypeNamedVarInVariableOrFieldDeclaration(SyntaxToken token, SyntaxNode parent)
+ // {
+ // var typedToken = token;
+ // var typedParent = parent;
+ //
+ // if (typedParent.IsKind(SyntaxKind.IdentifierName))
+ // {
+ // TypeSyntax declaredType = null;
+ // if (typedParent.IsParentKind(SyntaxKind.VariableDeclaration))
+ // {
+ // declaredType = ((VariableDeclarationSyntax)typedParent.Parent).Type;
+ // }
+ // else if (typedParent.IsParentKind(SyntaxKind.FieldDeclaration))
+ // {
+ // declaredType = ((FieldDeclarationSyntax)typedParent.Parent).Declaration.Type;
+ // }
+ //
+ // return declaredType == typedParent && typedToken.ValueText == "var";
+ // }
+ //
+ // return false;
+ // }
+ //
+ // public bool IsTypeNamedDynamic(SyntaxToken token, SyntaxNode parent)
+ // {
+ // var typedParent = parent as ExpressionSyntax;
+ //
+ // if (typedParent != null)
+ // {
+ // if (SyntaxFacts.IsInTypeOnlyContext(typedParent) &&
+ // typedParent.IsKind(SyntaxKind.IdentifierName) &&
+ // token.ValueText == "dynamic")
+ // {
+ // return true;
+ // }
+ // }
+ //
+ // return false;
+ // }
+ //
+ // public bool IsBindableToken(SyntaxToken token)
+ // {
+ // if (this.IsWord(token) || this.IsLiteral(token) || this.IsOperator(token))
+ // {
+ // switch ((SyntaxKind)token.RawKind)
+ // {
+ // case SyntaxKind.DelegateKeyword:
+ // case SyntaxKind.VoidKeyword:
+ // return false;
+ // }
+ //
+ // return true;
+ // }
+ //
+ // return false;
+ // }
+
+ public static bool IsMemberAccessExpression (this SyntaxNode node)
+ {
+ return node is MemberAccessExpressionSyntax &&
+ ((MemberAccessExpressionSyntax)node).Kind () == SyntaxKind.SimpleMemberAccessExpression;
+ }
+
+ public static bool IsConditionalMemberAccessExpression (this SyntaxNode node)
+ {
+ return node is ConditionalAccessExpressionSyntax;
+ }
+
+ public static bool IsPointerMemberAccessExpression (this SyntaxNode node)
+ {
+ return node is MemberAccessExpressionSyntax &&
+ ((MemberAccessExpressionSyntax)node).Kind () == SyntaxKind.PointerMemberAccessExpression;
+ }
+
+ public static void GetNameAndArityOfSimpleName (this SyntaxNode node, out string name, out int arity)
+ {
+ name = null;
+ arity = 0;
+
+ var simpleName = node as SimpleNameSyntax;
+ if (simpleName != null) {
+ name = simpleName.Identifier.ValueText;
+ arity = simpleName.Arity;
+ }
+ }
+
+ public static SyntaxNode GetExpressionOfMemberAccessExpression (this SyntaxNode node)
+ {
+ if (node.IsKind (SyntaxKind.MemberBindingExpression)) {
+ if (node.IsParentKind (SyntaxKind.ConditionalAccessExpression)) {
+ return GetExpressionOfConditionalMemberAccessExpression (node.Parent);
+ }
+ if (node.IsParentKind (SyntaxKind.InvocationExpression) &&
+ node.Parent.IsParentKind (SyntaxKind.ConditionalAccessExpression)) {
+ return GetExpressionOfConditionalMemberAccessExpression (node.Parent.Parent);
+ }
+ }
+
+ return (node as MemberAccessExpressionSyntax)?.Expression;
+ }
+
+ public static SyntaxNode GetExpressionOfConditionalMemberAccessExpression (this SyntaxNode node)
+ {
+ return (node as ConditionalAccessExpressionSyntax)?.Expression;
+ }
+
+
+ public static bool IsInNamespaceOrTypeContext (this SyntaxNode node)
+ {
+ return SyntaxFacts.IsInNamespaceOrTypeContext (node as ExpressionSyntax);
+ }
+
+ public static SyntaxNode GetExpressionOfArgument (this SyntaxNode node)
+ {
+ return ((ArgumentSyntax)node).Expression;
+ }
+
+ public static RefKind GetRefKindOfArgument (this SyntaxNode node)
+ {
+ return (node as ArgumentSyntax).GetRefKind ();
+ }
+
+ public static bool IsInConstantContext (this SyntaxNode node)
+ {
+ return (node as ExpressionSyntax).IsInConstantContext ();
+ }
+
+ public static bool IsInConstructor (this SyntaxNode node)
+ {
+ return node.GetAncestor<ConstructorDeclarationSyntax> () != null;
+ }
+
+ // public bool IsUnsafeContext(SyntaxNode node)
+ // {
+ // return node.IsUnsafeContext();
+ // }
+
+ public static SyntaxNode GetNameOfAttribute (this SyntaxNode node)
+ {
+ return ((AttributeSyntax)node).Name;
+ }
+
+ public static bool IsAttribute (this SyntaxNode node)
+ {
+ return node is AttributeSyntax;
+ }
+
+ public static bool IsAttributeNamedArgumentIdentifier (this SyntaxNode node)
+ {
+ var identifier = node as IdentifierNameSyntax;
+ return
+ identifier != null &&
+ identifier.IsParentKind (SyntaxKind.NameEquals) &&
+ identifier.Parent.IsParentKind (SyntaxKind.AttributeArgument);
+ }
+
+ public static SyntaxNode GetContainingTypeDeclaration (this SyntaxNode root, int position)
+ {
+ if (root == null) {
+ throw new ArgumentNullException ("root");
+ }
+
+ if (position < 0 || position > root.Span.End) {
+ throw new ArgumentOutOfRangeException ("position");
+ }
+
+ return root
+ .FindToken (position)
+ .GetAncestors<SyntaxNode> ()
+ .FirstOrDefault (n => n is BaseTypeDeclarationSyntax || n is DelegateDeclarationSyntax);
+ }
+ //
+ // public SyntaxNode GetContainingVariableDeclaratorOfFieldDeclaration(SyntaxNode node)
+ // {
+ // throw ExceptionUtilities.Unreachable;
+ // }
+ //
+ // public SyntaxToken FindTokenOnLeftOfPosition(
+ // SyntaxNode node, int position, bool includeSkipped, bool includeDirectives, bool includeDocumentationComments)
+ // {
+ // return node.FindTokenOnLeftOfPosition(position, includeSkipped, includeDirectives, includeDocumentationComments);
+ // }
+ //
+ // public SyntaxToken FindTokenOnRightOfPosition(
+ // SyntaxNode node, int position, bool includeSkipped, bool includeDirectives, bool includeDocumentationComments)
+ // {
+ // return node.FindTokenOnRightOfPosition(position, includeSkipped, includeDirectives, includeDocumentationComments);
+ // }
+
+ public static bool IsObjectCreationExpression (this SyntaxNode node)
+ {
+ return node is ObjectCreationExpressionSyntax;
+ }
+
+ public static bool IsObjectInitializerNamedAssignmentIdentifier (this SyntaxNode node)
+ {
+ var identifier = node as IdentifierNameSyntax;
+ return
+ identifier != null &&
+ identifier.IsLeftSideOfAssignExpression () &&
+ identifier.Parent.IsParentKind (SyntaxKind.ObjectInitializerExpression);
+ }
+
+ public static bool IsElementAccessExpression (this SyntaxNode node)
+ {
+ return node.Kind () == SyntaxKind.ElementAccessExpression;
+ }
+
+ // public SyntaxToken ToIdentifierToken(string name)
+ // {
+ // return name.ToIdentifierToken();
+ // }
+
+ public static SyntaxNode Parenthesize (this SyntaxNode expression, bool includeElasticTrivia = true)
+ {
+ return ((ExpressionSyntax)expression).Parenthesize (includeElasticTrivia);
+ }
+
+ // public bool IsIndexerMemberCRef(SyntaxNode node)
+ // {
+ // return node.Kind() == SyntaxKind.IndexerMemberCref;
+ // }
+ //
+ // public SyntaxNode GetContainingMemberDeclaration(SyntaxNode root, int position)
+ // {
+ // Contract.ThrowIfNull(root, "root");
+ // Contract.ThrowIfTrue(position < 0 || position > root.FullSpan.End, "position");
+ //
+ // var end = root.FullSpan.End;
+ // if (end == 0)
+ // {
+ // // empty file
+ // return null;
+ // }
+ //
+ // // make sure position doesn't touch end of root
+ // position = Math.Min(position, end - 1);
+ //
+ // var node = root.FindToken(position).Parent;
+ // while (node != null)
+ // {
+ // if (node is MemberDeclarationSyntax)
+ // {
+ // return node;
+ // }
+ //
+ // node = node.Parent;
+ // }
+ //
+ // return null;
+ // }
+ //
+ // public bool IsMethodLevelMember(SyntaxNode node)
+ // {
+ // return node is BaseMethodDeclarationSyntax || node is BasePropertyDeclarationSyntax || node is EnumMemberDeclarationSyntax || node is BaseFieldDeclarationSyntax;
+ // }
+ //
+ // public bool IsTopLevelNodeWithMembers(SyntaxNode node)
+ // {
+ // return node is NamespaceDeclarationSyntax ||
+ // node is TypeDeclarationSyntax ||
+ // node is EnumDeclarationSyntax;
+ // }
+ //
+
+
+ public static bool DescentIntoSymbolForDeclarationSearch (SyntaxNode node)
+ {
+ var b = !(node is BlockSyntax);
+ return b;
+ }
+
+
+ //
+ // public List<SyntaxNode> GetMethodLevelMembers(SyntaxNode root)
+ // {
+ // var list = new List<SyntaxNode>();
+ // AppendMethodLevelMembers(root, list);
+ // return list;
+ // }
+ //
+ // private void AppendMethodLevelMembers(SyntaxNode node, List<SyntaxNode> list)
+ // {
+ // foreach (var member in node.GetMembers())
+ // {
+ // if (IsTopLevelNodeWithMembers(member))
+ // {
+ // AppendMethodLevelMembers(member, list);
+ // continue;
+ // }
+ //
+ // if (IsMethodLevelMember(member))
+ // {
+ // list.Add(member);
+ // }
+ // }
+ // }
+ //
+ // public TextSpan GetMemberBodySpanForSpeculativeBinding(SyntaxNode node)
+ // {
+ // if (node.Span.IsEmpty)
+ // {
+ // return default(TextSpan);
+ // }
+ //
+ // var member = GetContainingMemberDeclaration(node, node.SpanStart);
+ // if (member == null)
+ // {
+ // return default(TextSpan);
+ // }
+ //
+ // // TODO: currently we only support method for now
+ // var method = member as BaseMethodDeclarationSyntax;
+ // if (method != null)
+ // {
+ // if (method.Body == null)
+ // {
+ // return default(TextSpan);
+ // }
+ //
+ // return GetBlockBodySpan(method.Body);
+ // }
+ //
+ // return default(TextSpan);
+ // }
+ //
+ // public bool ContainsInMemberBody(SyntaxNode node, TextSpan span)
+ // {
+ // var constructor = node as ConstructorDeclarationSyntax;
+ // if (constructor != null)
+ // {
+ // return (constructor.Body != null && GetBlockBodySpan(constructor.Body).Contains(span)) ||
+ // (constructor.Initializer != null && constructor.Initializer.Span.Contains(span));
+ // }
+ //
+ // var method = node as BaseMethodDeclarationSyntax;
+ // if (method != null)
+ // {
+ // return method.Body != null && GetBlockBodySpan(method.Body).Contains(span);
+ // }
+ //
+ // var property = node as BasePropertyDeclarationSyntax;
+ // if (property != null)
+ // {
+ // return property.AccessorList != null && property.AccessorList.Span.Contains(span);
+ // }
+ //
+ // var @enum = node as EnumMemberDeclarationSyntax;
+ // if (@enum != null)
+ // {
+ // return @enum.EqualsValue != null && @enum.EqualsValue.Span.Contains(span);
+ // }
+ //
+ // var field = node as BaseFieldDeclarationSyntax;
+ // if (field != null)
+ // {
+ // return field.Declaration != null && field.Declaration.Span.Contains(span);
+ // }
+ //
+ // return false;
+ // }
+ //
+ // private TextSpan GetBlockBodySpan(BlockSyntax body)
+ // {
+ // return TextSpan.FromBounds(body.OpenBraceToken.Span.End, body.CloseBraceToken.SpanStart);
+ // }
+ //
+ // public int GetMethodLevelMemberId(SyntaxNode root, SyntaxNode node)
+ // {
+ // Contract.Requires(root.SyntaxTree == node.SyntaxTree);
+ //
+ // int currentId = 0;
+ // SyntaxNode currentNode;
+ // Contract.ThrowIfFalse(TryGetMethodLevelMember(root, (n, i) => n == node, ref currentId, out currentNode));
+ //
+ // Contract.ThrowIfFalse(currentId >= 0);
+ // CheckMemberId(root, node, currentId);
+ // return currentId;
+ // }
+ //
+ // public SyntaxNode GetMethodLevelMember(SyntaxNode root, int memberId)
+ // {
+ // int currentId = 0;
+ // SyntaxNode currentNode;
+ // if (!TryGetMethodLevelMember(root, (n, i) => i == memberId, ref currentId, out currentNode))
+ // {
+ // return null;
+ // }
+ //
+ // Contract.ThrowIfNull(currentNode);
+ // CheckMemberId(root, currentNode, memberId);
+ // return currentNode;
+ // }
+ //
+ // private bool TryGetMethodLevelMember(
+ // SyntaxNode node, Func<SyntaxNode, int, bool> predicate, ref int currentId, out SyntaxNode currentNode)
+ // {
+ // foreach (var member in node.GetMembers())
+ // {
+ // if (IsTopLevelNodeWithMembers(member))
+ // {
+ // if (TryGetMethodLevelMember(member, predicate, ref currentId, out currentNode))
+ // {
+ // return true;
+ // }
+ //
+ // continue;
+ // }
+ //
+ // if (IsMethodLevelMember(member))
+ // {
+ // if (predicate(member, currentId))
+ // {
+ // currentNode = member;
+ // return true;
+ // }
+ //
+ // currentId++;
+ // }
+ // }
+ //
+ // currentNode = null;
+ // return false;
+ // }
+ //
+ // [Conditional("DEBUG")]
+ // private void CheckMemberId(SyntaxNode root, SyntaxNode node, int memberId)
+ // {
+ // var list = GetMethodLevelMembers(root);
+ // var index = list.IndexOf(node);
+ //
+ // Contract.ThrowIfFalse(index == memberId);
+ // }
+ //
+ // public SyntaxNode GetBindableParent(SyntaxToken token)
+ // {
+ // var node = token.Parent;
+ // while (node != null)
+ // {
+ // var parent = node.Parent;
+ //
+ // // If this node is on the left side of a member access expression, don't ascend
+ // // further or we'll end up binding to something else.
+ // var memberAccess = parent as MemberAccessExpressionSyntax;
+ // if (memberAccess != null)
+ // {
+ // if (memberAccess.Expression == node)
+ // {
+ // break;
+ // }
+ // }
+ //
+ // // If this node is on the left side of a qualified name, don't ascend
+ // // further or we'll end up binding to something else.
+ // var qualifiedName = parent as QualifiedNameSyntax;
+ // if (qualifiedName != null)
+ // {
+ // if (qualifiedName.Left == node)
+ // {
+ // break;
+ // }
+ // }
+ //
+ // // If this node is on the left side of a alias-qualified name, don't ascend
+ // // further or we'll end up binding to something else.
+ // var aliasQualifiedName = parent as AliasQualifiedNameSyntax;
+ // if (aliasQualifiedName != null)
+ // {
+ // if (aliasQualifiedName.Alias == node)
+ // {
+ // break;
+ // }
+ // }
+ //
+ // // If this node is the type of an object creation expression, return the
+ // // object creation expression.
+ // var objectCreation = parent as ObjectCreationExpressionSyntax;
+ // if (objectCreation != null)
+ // {
+ // if (objectCreation.Type == node)
+ // {
+ // node = parent;
+ // break;
+ // }
+ // }
+ //
+ // // If this node is not parented by a name, we're done.
+ // var name = parent as NameSyntax;
+ // if (name == null)
+ // {
+ // break;
+ // }
+ //
+ // node = parent;
+ // }
+ //
+ // return node;
+ // }
+ //
+ // public IEnumerable<SyntaxNode> GetConstructors(SyntaxNode root, CancellationToken cancellationToken)
+ // {
+ // var compilationUnit = root as CompilationUnitSyntax;
+ // if (compilationUnit == null)
+ // {
+ // return SpecializedCollections.EmptyEnumerable<SyntaxNode>();
+ // }
+ //
+ // var constructors = new List<SyntaxNode>();
+ // AppendConstructors(compilationUnit.Members, constructors, cancellationToken);
+ // return constructors;
+ // }
+ //
+ // private void AppendConstructors(SyntaxList<MemberDeclarationSyntax> members, List<SyntaxNode> constructors, CancellationToken cancellationToken)
+ // {
+ // foreach (var member in members)
+ // {
+ // cancellationToken.ThrowIfCancellationRequested();
+ //
+ // var constructor = member as ConstructorDeclarationSyntax;
+ // if (constructor != null)
+ // {
+ // constructors.Add(constructor);
+ // continue;
+ // }
+ //
+ // var @namespace = member as NamespaceDeclarationSyntax;
+ // if (@namespace != null)
+ // {
+ // AppendConstructors(@namespace.Members, constructors, cancellationToken);
+ // }
+ //
+ // var @class = member as ClassDeclarationSyntax;
+ // if (@class != null)
+ // {
+ // AppendConstructors(@class.Members, constructors, cancellationToken);
+ // }
+ //
+ // var @struct = member as StructDeclarationSyntax;
+ // if (@struct != null)
+ // {
+ // AppendConstructors(@struct.Members, constructors, cancellationToken);
+ // }
+ // }
+ // }
+ //
+ // public bool TryGetCorrespondingOpenBrace(SyntaxToken token, out SyntaxToken openBrace)
+ // {
+ // if (token.Kind() == SyntaxKind.CloseBraceToken)
+ // {
+ // var tuple = token.Parent.GetBraces();
+ //
+ // openBrace = tuple.Item1;
+ // return openBrace.Kind() == SyntaxKind.OpenBraceToken;
+ // }
+ //
+ // openBrace = default(SyntaxToken);
+ // return false;
+ // }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/CSharpUtil.cs b/main/src/addins/CSharpBinding/Util/CSharpUtil.cs
new file mode 100644
index 0000000000..1784f099cf
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/CSharpUtil.cs
@@ -0,0 +1,183 @@
+//
+// CSharpUtil.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class CSharpUtil
+ {
+ /// <summary>
+ /// Inverts a boolean condition. Note: The condition object can be frozen (from AST) it's cloned internally.
+ /// </summary>
+ /// <param name="condition">The condition to invert.</param>
+ public static ExpressionSyntax InvertCondition(ExpressionSyntax condition)
+ {
+ return InvertConditionInternal(condition);
+ }
+
+ static ExpressionSyntax InvertConditionInternal(ExpressionSyntax condition)
+ {
+ if (condition is ParenthesizedExpressionSyntax) {
+ return SyntaxFactory.ParenthesizedExpression(InvertCondition(((ParenthesizedExpressionSyntax)condition).Expression));
+ }
+
+ if (condition is PrefixUnaryExpressionSyntax) {
+ var uOp = (PrefixUnaryExpressionSyntax)condition;
+ if (uOp.IsKind(SyntaxKind.LogicalNotExpression)) {
+ if (!(uOp.Parent is ExpressionSyntax))
+ return uOp.Operand.SkipParens();
+ return uOp.Operand;
+ }
+ return SyntaxFactory.PrefixUnaryExpression(SyntaxKind.LogicalNotExpression, uOp);
+ }
+
+ if (condition is BinaryExpressionSyntax) {
+ var bOp = (BinaryExpressionSyntax)condition;
+
+ if (bOp.IsKind(SyntaxKind.LogicalAndExpression) || bOp.IsKind(SyntaxKind.LogicalOrExpression))
+ return SyntaxFactory.BinaryExpression(NegateConditionOperator(bOp.Kind()), InvertCondition(bOp.Left), InvertCondition(bOp.Right));
+
+ if (bOp.IsKind(SyntaxKind.EqualsExpression) ||
+ bOp.IsKind(SyntaxKind.NotEqualsExpression) ||
+ bOp.IsKind(SyntaxKind.GreaterThanExpression) ||
+ bOp.IsKind(SyntaxKind.GreaterThanOrEqualExpression) ||
+ bOp.IsKind(SyntaxKind.LessThanExpression) ||
+ bOp.IsKind(SyntaxKind.LessThanOrEqualExpression))
+ return SyntaxFactory.BinaryExpression(NegateRelationalOperator(bOp.Kind()), bOp.Left, bOp.Right);
+
+ return SyntaxFactory.PrefixUnaryExpression(SyntaxKind.LogicalNotExpression, SyntaxFactory.ParenthesizedExpression(condition));
+ }
+
+ if (condition is ConditionalExpressionSyntax) {
+ var cEx = condition as ConditionalExpressionSyntax;
+ return cEx.WithCondition(InvertCondition(cEx.Condition));
+ }
+
+ if (condition is LiteralExpressionSyntax) {
+ if (condition.Kind() == SyntaxKind.TrueLiteralExpression)
+ return SyntaxFactory.LiteralExpression(SyntaxKind.FalseLiteralExpression);
+ if (condition.Kind() == SyntaxKind.FalseLiteralExpression)
+ return SyntaxFactory.LiteralExpression(SyntaxKind.TrueLiteralExpression);
+ }
+
+ return SyntaxFactory.PrefixUnaryExpression(SyntaxKind.LogicalNotExpression, AddParensForUnaryExpressionIfRequired(condition));
+ }
+
+ /// <summary>
+ /// When negating an expression this is required, otherwise you would end up with
+ /// a or b -> !a or b
+ /// </summary>
+ public static ExpressionSyntax AddParensForUnaryExpressionIfRequired(ExpressionSyntax expression)
+ {
+ if ((expression is BinaryExpressionSyntax) ||
+ (expression is AssignmentExpressionSyntax) ||
+ (expression is CastExpressionSyntax) ||
+ (expression is ParenthesizedLambdaExpressionSyntax) ||
+ (expression is SimpleLambdaExpressionSyntax) ||
+ (expression is ConditionalExpressionSyntax)) {
+ return SyntaxFactory.ParenthesizedExpression(expression);
+ }
+
+ return expression;
+ }
+
+ /// <summary>
+ /// Get negation of the specified relational operator
+ /// </summary>
+ /// <returns>
+ /// negation of the specified relational operator, or BinaryOperatorType.Any if it's not a relational operator
+ /// </returns>
+ public static SyntaxKind NegateRelationalOperator(SyntaxKind op)
+ {
+ switch (op) {
+ case SyntaxKind.EqualsExpression:
+ return SyntaxKind.NotEqualsExpression;
+ case SyntaxKind.NotEqualsExpression:
+ return SyntaxKind.EqualsExpression;
+ case SyntaxKind.GreaterThanExpression:
+ return SyntaxKind.LessThanOrEqualExpression;
+ case SyntaxKind.GreaterThanOrEqualExpression:
+ return SyntaxKind.LessThanExpression;
+ case SyntaxKind.LessThanExpression:
+ return SyntaxKind.GreaterThanOrEqualExpression;
+ case SyntaxKind.LessThanOrEqualExpression:
+ return SyntaxKind.GreaterThanExpression;
+ case SyntaxKind.LogicalOrExpression:
+ return SyntaxKind.LogicalAndExpression;
+ case SyntaxKind.LogicalAndExpression:
+ return SyntaxKind.LogicalOrExpression;
+ }
+ throw new ArgumentOutOfRangeException("op");
+ }
+
+ /// <summary>
+ /// Returns true, if the specified operator is a relational operator
+ /// </summary>
+ public static bool IsRelationalOperator(SyntaxKind op)
+ {
+ switch (op) {
+ case SyntaxKind.EqualsExpression:
+ case SyntaxKind.NotEqualsExpression:
+ case SyntaxKind.GreaterThanExpression:
+ case SyntaxKind.GreaterThanOrEqualExpression:
+ case SyntaxKind.LessThanExpression:
+ case SyntaxKind.LessThanOrEqualExpression:
+ case SyntaxKind.LogicalOrExpression:
+ case SyntaxKind.LogicalAndExpression:
+ return true;
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// Get negation of the condition operator
+ /// </summary>
+ /// <returns>
+ /// negation of the specified condition operator, or BinaryOperatorType.Any if it's not a condition operator
+ /// </returns>
+ public static SyntaxKind NegateConditionOperator(SyntaxKind op)
+ {
+ switch (op) {
+ case SyntaxKind.LogicalOrExpression:
+ return SyntaxKind.LogicalAndExpression;
+ case SyntaxKind.LogicalAndExpression:
+ return SyntaxKind.LogicalOrExpression;
+ }
+ throw new ArgumentOutOfRangeException("op");
+ }
+
+ public static bool AreConditionsEqual(ExpressionSyntax cond1, ExpressionSyntax cond2)
+ {
+ if (cond1 == null || cond2 == null)
+ return false;
+ return cond1.SkipParens().IsEquivalentTo(cond2.SkipParens(), true);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/Util/CastExpressionSyntaxExtensions.cs b/main/src/addins/CSharpBinding/Util/CastExpressionSyntaxExtensions.cs
new file mode 100644
index 0000000000..62daf3ab81
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/CastExpressionSyntaxExtensions.cs
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
+using System;
+using System.Reflection;
+using System.Runtime.ExceptionServices;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class CastExpressionSyntaxExtensions
+ {
+ readonly static MethodInfo isUnnecessaryCastMethod;
+
+ static CastExpressionSyntaxExtensions ()
+ {
+ var typeInfo = Type.GetType ("Microsoft.CodeAnalysis.CSharp.Extensions.CastExpressionSyntaxExtensions" + ReflectionNamespaces.CSWorkspacesAsmName, true);
+ isUnnecessaryCastMethod = typeInfo.GetMethod ("IsUnnecessaryCast", BindingFlags.Static | BindingFlags.Public);
+ }
+
+ public static bool IsUnnecessaryCast(this CastExpressionSyntax cast, SemanticModel semanticModel, CancellationToken cancellationToken)
+ {
+ try {
+ return (bool)isUnnecessaryCastMethod.Invoke (null, new object[] { cast, semanticModel, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/CloneableStack.cs b/main/src/addins/CSharpBinding/Util/CloneableStack.cs
new file mode 100644
index 0000000000..cc8d3d27d1
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/CloneableStack.cs
@@ -0,0 +1,201 @@
+//
+// CloneableStack.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Collections;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ class CloneableStack<T> : IEnumerable<T>, ICollection<T>, ICloneable, IEquatable<CloneableStack<T>>
+ {
+ int count;
+ StackItem top;
+
+ #region IEnumerable[T] implementation
+ public IEnumerator<T> GetEnumerator ()
+ {
+ return new StackItemEnumerator (top);
+ }
+
+ IEnumerator IEnumerable.GetEnumerator ()
+ {
+ return new StackItemEnumerator (top);
+ }
+ #endregion
+
+ #region ICloneable implementation
+ public CloneableStack<T> Clone ()
+ {
+ CloneableStack<T> result = new CloneableStack<T> ();
+ result.count = count;
+ result.top = top;
+ return result;
+ }
+
+ object ICloneable.Clone ()
+ {
+ return Clone();
+ }
+ #endregion
+
+ public void Clear ()
+ {
+ top = null;
+ count = 0;
+ }
+
+ public void Push (T item)
+ {
+ top = new StackItem (top, item);
+ count++;
+ }
+
+ public T Peek ()
+ {
+ return top.Item;
+ }
+
+ public T Pop ()
+ {
+ T result = top.Item;
+ top = top.Parent;
+ count--;
+ return result;
+ }
+
+ #region IEquatable[T] implementation
+ public bool Equals (CloneableStack<T> other)
+ {
+ return ReferenceEquals (top, other.top);
+ }
+ #endregion
+
+ #region ICollection[T] implementation
+ void ICollection<T>.Add (T item)
+ {
+ Push (item);
+ }
+
+ void ICollection<T>.Clear ()
+ {
+ top = null;
+ count = 0;
+ }
+
+ bool ICollection<T>.Contains (T item)
+ {
+ foreach (T t in this) {
+ if (t.Equals (item))
+ return true;
+ }
+ return false;
+ }
+
+ void ICollection<T>.CopyTo (T[] array, int arrayIndex)
+ {
+ int idx = arrayIndex;
+ foreach (T t in this) {
+ array[idx++] = t;
+ }
+ }
+
+ bool ICollection<T>.Remove (T item)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int Count {
+ get {
+ return count;
+ }
+ }
+
+ bool ICollection<T>.IsReadOnly {
+ get {
+ return false;
+ }
+ }
+ #endregion
+
+ class StackItem
+ {
+ public readonly StackItem Parent;
+ public readonly T Item;
+
+ public StackItem (StackItem parent, T item)
+ {
+ Parent = parent;
+ Item = item;
+ }
+ }
+
+ class StackItemEnumerator : IEnumerator<T>
+ {
+ StackItem cur, first;
+
+ public StackItemEnumerator (StackItem cur)
+ {
+ this.cur = first = new StackItem (cur, default(T));
+ }
+
+ #region IDisposable implementation
+ void IDisposable.Dispose ()
+ {
+ cur = first = null;
+ }
+ #endregion
+
+ #region IEnumerator implementation
+ bool IEnumerator.MoveNext ()
+ {
+ if (cur == null)
+ return false;
+ cur = cur.Parent;
+ return cur != null;
+ }
+
+ void IEnumerator.Reset ()
+ {
+ cur = first;
+ }
+
+ object IEnumerator.Current {
+ get {
+ return cur.Item;
+ }
+ }
+ #endregion
+
+ #region IEnumerator[T] implementation
+ T IEnumerator<T>.Current {
+ get {
+ return cur.Item;
+ }
+ }
+ #endregion
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/Util/CodeFixContextExtensions.cs b/main/src/addins/CSharpBinding/Util/CodeFixContextExtensions.cs
new file mode 100644
index 0000000000..824b169071
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/CodeFixContextExtensions.cs
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+using Microsoft.CodeAnalysis.CodeFixes;
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
+using System.Collections.Immutable;
+using Microsoft.CodeAnalysis.CodeActions;
+
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class CodeFixContextExtensions
+ {
+ /// <summary>
+ /// Use this helper to register multiple fixes (<paramref name="actions"/>) each of which addresses / fixes the same supplied <paramref name="diagnostic"/>.
+ /// </summary>
+ public static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, Diagnostic diagnostic)
+ {
+ foreach (var action in actions)
+ {
+ context.RegisterCodeFix(action, diagnostic);
+ }
+ }
+
+ /// <summary>
+ /// Use this helper to register multiple fixes (<paramref name="actions"/>) each of which addresses / fixes the same set of supplied <paramref name="diagnostics"/>.
+ /// </summary>
+ public static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, ImmutableArray<Diagnostic> diagnostics)
+ {
+ foreach (var action in actions)
+ {
+ context.RegisterCodeFix(action, diagnostics);
+ }
+ }
+ }
+
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/CodeGenerationSymbolFactory.cs b/main/src/addins/CSharpBinding/Util/CodeGenerationSymbolFactory.cs
new file mode 100644
index 0000000000..a81ad838af
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/CodeGenerationSymbolFactory.cs
@@ -0,0 +1,466 @@
+//
+// CodeGenerationSymbolFactory.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Reflection;
+using Microsoft.CodeAnalysis;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Linq;
+using Microsoft.CodeAnalysis.Editing;
+using System.Runtime.ExceptionServices;
+
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ /// <summary>
+ /// Generates symbols that describe declarations to be generated.
+ /// </summary>
+ static class CodeGenerationSymbolFactory
+ {
+ readonly static Type typeInfo;
+
+ static CodeGenerationSymbolFactory ()
+ {
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationSymbolFactory" + ReflectionNamespaces.WorkspacesAsmName, true);
+
+ isCodeGenerationSymbolMethod = typeInfo.GetMethod ("IsCodeGenerationSymbol", BindingFlags.Static | BindingFlags.Public, null, new [] { typeof(ISymbol) }, null);
+ if (isCodeGenerationSymbolMethod == null)
+ throw new InvalidOperationException ("IsCodeGenerationSymbol not found.");
+
+ createParameterSymbolMethod = typeInfo.GetMethods ().First (m => m.Name == "CreateParameterSymbol" && m.GetParameters ().Length == 8);
+
+ createTypeParameterSymbolMethod = typeInfo.GetMethod ("CreateTypeParameterSymbol", BindingFlags.Static | BindingFlags.Public, null, new [] { typeof(string), typeof(int) }, null);
+ if (createTypeParameterSymbolMethod == null)
+ throw new InvalidOperationException ("CreateTypeParameterSymbol not found.");
+
+ createTypeParameterMethod = typeInfo.GetMethod ("CreateTypeParameter", BindingFlags.Static | BindingFlags.Public, null, new [] { typeof(IList<AttributeData>), typeof(VarianceKind), typeof(string), typeof(ImmutableArray<ITypeSymbol>), typeof(bool), typeof(bool), typeof(bool), typeof(int) }, null);
+ if (createTypeParameterMethod == null)
+ throw new InvalidOperationException ("CreateTypeParameter not found.");
+
+ createMethodSymbolMethod = typeInfo.GetMethod ("CreateMethodSymbol", BindingFlags.Static | BindingFlags.Public, null, new [] { typeof(IList<AttributeData>), typeof(Accessibility), typeof(DeclarationModifiers), typeof(ITypeSymbol), typeof(IMethodSymbol), typeof(string), typeof(IList<ITypeParameterSymbol>), typeof(IList<IParameterSymbol>), typeof(IList<SyntaxNode>), typeof(IList<SyntaxNode>), typeof(IList<AttributeData>), typeof(MethodKind) }, null);
+ if (createMethodSymbolMethod == null)
+ throw new InvalidOperationException ("CreateMethodSymbol not found.");
+
+ createMethodSymbolMethod2 = typeInfo.GetMethod ("CreateMethodSymbol", BindingFlags.Static | BindingFlags.NonPublic, null, new [] { typeof(INamedTypeSymbol), typeof(IList<AttributeData>), typeof(Accessibility), typeof(DeclarationModifiers), typeof(ITypeSymbol), typeof(IMethodSymbol) , typeof(string), typeof(IList<ITypeParameterSymbol>), typeof(IList<IParameterSymbol>), typeof(IList<SyntaxNode>), typeof(IList<SyntaxNode>), typeof(IList<AttributeData>), typeof(MethodKind) }, null);
+ if (createMethodSymbolMethod2 == null)
+ throw new InvalidOperationException ("CreateMethodSymbol not found.");
+
+ createConstructorSymbolMethod = typeInfo.GetMethod ("CreateConstructorSymbol", BindingFlags.Static | BindingFlags.Public, null, new [] { typeof(IList<AttributeData>), typeof(Accessibility), typeof(DeclarationModifiers), typeof(string), typeof(IList<IParameterSymbol>), typeof(IList<SyntaxNode>), typeof(IList<SyntaxNode>), typeof(IList<SyntaxNode>) }, null);
+ if (createConstructorSymbolMethod == null)
+ throw new InvalidOperationException ("CreateConstructorSymbol not found.");
+
+
+ createAccessorSymbolMethod = typeInfo.GetMethod ("CreateAccessorSymbol", BindingFlags.Static | BindingFlags.Public, null, new [] { typeof(IList<AttributeData>), typeof(Accessibility), typeof(IList<SyntaxNode>) }, null);
+ if (createAccessorSymbolMethod == null)
+ throw new InvalidOperationException ("CreateAccessorSymbol not found.");
+
+ createPropertySymbolMethod = typeInfo.GetMethod ("CreatePropertySymbol", BindingFlags.Static | BindingFlags.Public, null, new [] { typeof(IList<AttributeData>), typeof(Accessibility), typeof(DeclarationModifiers), typeof(ITypeSymbol), typeof(IPropertySymbol), typeof(string), typeof(IList<IParameterSymbol>), typeof(IMethodSymbol), typeof(IMethodSymbol), typeof(bool) }, null);
+ if (createPropertySymbolMethod == null)
+ throw new InvalidOperationException ("CreatePropertySymbol not found.");
+
+ createFieldSymbolMethod = typeInfo.GetMethod ("CreateFieldSymbol", BindingFlags.Static | BindingFlags.Public, null, new [] { typeof(IList<AttributeData>), typeof(Accessibility), typeof(DeclarationModifiers), typeof(ITypeSymbol), typeof(string), typeof(bool), typeof(object), typeof(SyntaxNode) }, null);
+ if (createFieldSymbolMethod == null)
+ throw new InvalidOperationException ("CreateFieldSymbol not found.");
+
+ createPointerTypeSymbolMethod = typeInfo.GetMethod ("CreatePointerTypeSymbol", BindingFlags.Static | BindingFlags.Public, null, new [] { typeof(ITypeSymbol) }, null);
+ if (createPointerTypeSymbolMethod == null)
+ throw new InvalidOperationException ("CreatePointerTypeSymbol not found.");
+
+ createArrayTypeSymbolMethod = typeInfo.GetMethod ("CreateArrayTypeSymbol", BindingFlags.Static | BindingFlags.Public, null, new [] { typeof(ITypeSymbol), typeof(int) }, null);
+ if (createArrayTypeSymbolMethod == null)
+ throw new InvalidOperationException ("CreateArrayTypeSymbol not found.");
+
+ createNamespaceSymbolMethod = typeInfo.GetMethod ("CreateNamespaceSymbol", BindingFlags.Static | BindingFlags.Public, null, new [] { typeof(string), typeof(IList<ISymbol>), typeof(IList<INamespaceOrTypeSymbol>) }, null);
+ if (createNamespaceSymbolMethod == null)
+ throw new InvalidOperationException ("CreateNamespaceSymbol not found.");
+
+ createNamedTypeSymbolMethod = typeInfo.GetMethod ("CreateNamedTypeSymbol", BindingFlags.Static | BindingFlags.Public, null, new [] { typeof(IList<AttributeData>), typeof(Accessibility), typeof(DeclarationModifiers), typeof(TypeKind), typeof(string), typeof(IList<ITypeParameterSymbol>), typeof(INamedTypeSymbol), typeof(IList<INamedTypeSymbol>), typeof(SpecialType), typeof(IList<ISymbol>) }, null);
+ if (createNamedTypeSymbolMethod == null)
+ throw new InvalidOperationException ("CreateNamedTypeSymbol not found.");
+
+ createDelegateTypeSymbolMethod = typeInfo.GetMethod ("CreateDelegateTypeSymbol", BindingFlags.Static | BindingFlags.Public, null, new [] { typeof(IList<AttributeData>), typeof(Accessibility), typeof(DeclarationModifiers), typeof(ITypeSymbol), typeof(string), typeof(IList<ITypeParameterSymbol>), typeof(IList<IParameterSymbol>) }, null);
+ if (createDelegateTypeSymbolMethod == null)
+ throw new InvalidOperationException ("CreateDelegateTypeSymbol not found.");
+
+ createAttributeDataMethod = typeInfo.GetMethod ("CreateAttributeData", BindingFlags.Static | BindingFlags.Public, null, new [] { typeof(INamedTypeSymbol), typeof(ImmutableArray<TypedConstant>), typeof(ImmutableArray<KeyValuePair<string, TypedConstant>>) }, null);
+ if (createAttributeDataMethod == null)
+ throw new InvalidOperationException ("CreateAttributeData not found.");
+
+ createEventSymbol = typeInfo.GetMethod ("CreateEventSymbol", BindingFlags.Static | BindingFlags.Public, null, new [] { typeof(IList<AttributeData>), typeof(Accessibility), typeof(DeclarationModifiers), typeof(ITypeSymbol), typeof(IEventSymbol), typeof(string), typeof(IMethodSymbol), typeof(IMethodSymbol), typeof(IMethodSymbol), typeof(IList<IParameterSymbol>) }, null);
+ if (createEventSymbol == null)
+ throw new InvalidOperationException ("CreateEventSymbol not found.");
+
+ createPropertySymbolMethod2 = typeInfo.GetMethod ("CreatePropertySymbol", BindingFlags.Static | BindingFlags.NonPublic, null, new [] {
+ typeof(INamedTypeSymbol),
+ typeof(IList<AttributeData>),
+ typeof(Accessibility),
+ typeof(DeclarationModifiers),
+ typeof(ITypeSymbol),
+ typeof(IPropertySymbol),
+ typeof(string),
+ typeof(IList<IParameterSymbol>),
+ typeof(IMethodSymbol),
+ typeof(IMethodSymbol),
+ typeof(bool),
+ typeof(SyntaxNode)
+ }, null);
+ if (createPropertySymbolMethod2 == null)
+ throw new InvalidOperationException ("CreatePropertySymbol2 not found.");
+
+ }
+
+ static MethodInfo createPropertySymbolMethod2;
+
+ public static IPropertySymbol CreatePropertySymbol(
+ INamedTypeSymbol containingType,
+ IList<AttributeData> attributes,
+ Accessibility accessibility,
+ DeclarationModifiers modifiers,
+ ITypeSymbol type,
+ IPropertySymbol explicitInterfaceSymbol,
+ string name,
+ IList<IParameterSymbol> parameters,
+ IMethodSymbol getMethod,
+ IMethodSymbol setMethod,
+ bool isIndexer = false,
+ SyntaxNode initializer = null)
+ {
+ try {
+ return (IPropertySymbol)createPropertySymbolMethod2.Invoke (null, new object[] { containingType,
+ attributes,
+ accessibility,
+ modifiers,
+ type,
+ explicitInterfaceSymbol,
+ name,
+ parameters,
+ getMethod,
+ setMethod,
+ isIndexer,
+ initializer
+ });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+
+ static MethodInfo createEventSymbol;
+
+ public static IEventSymbol CreateEventSymbol(IList<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers, ITypeSymbol type, IEventSymbol explicitInterfaceSymbol, string name, IMethodSymbol addMethod = null, IMethodSymbol removeMethod = null, IMethodSymbol raiseMethod = null, IList<IParameterSymbol> parameterList = null)
+ {
+ try {
+ return (IEventSymbol)createEventSymbol.Invoke (null, new object[] { attributes, accessibility, modifiers, type, explicitInterfaceSymbol, name, addMethod, removeMethod, raiseMethod, parameterList });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ public static IEventSymbol CreateEventSymbol(
+ IEventSymbol @event,
+ IList<AttributeData> attributes = null,
+ Accessibility? accessibility = null,
+ DeclarationModifiers? modifiers = null,
+ IEventSymbol explicitInterfaceSymbol = null,
+ string name = null,
+ IMethodSymbol addMethod = null,
+ IMethodSymbol removeMethod = null)
+ {
+ return CodeGenerationSymbolFactory.CreateEventSymbol(
+ attributes,
+ accessibility ?? @event.DeclaredAccessibility,
+ modifiers ?? @event.GetSymbolModifiers(),
+ @event.Type,
+ explicitInterfaceSymbol,
+ name ?? @event.Name,
+ addMethod,
+ removeMethod);
+ }
+
+ public static IMethodSymbol CreateMethodSymbol(
+ IMethodSymbol method,
+ IList<AttributeData> attributes = null,
+ Accessibility? accessibility = null,
+ DeclarationModifiers? modifiers = null,
+ IMethodSymbol explicitInterfaceSymbol = null,
+ string name = null,
+ IList<SyntaxNode> statements = null)
+ {
+ return CodeGenerationSymbolFactory.CreateMethodSymbol(
+ attributes,
+ accessibility ?? method.DeclaredAccessibility,
+ modifiers ?? method.GetSymbolModifiers(),
+ method.ReturnType,
+ explicitInterfaceSymbol,
+ name ?? method.Name,
+ method.TypeParameters,
+ method.Parameters,
+ statements,
+ returnTypeAttributes: method.GetReturnTypeAttributes());
+ }
+
+ public static IPropertySymbol CreatePropertySymbol(
+ IPropertySymbol property,
+ IList<AttributeData> attributes = null,
+ Accessibility? accessibility = null,
+ DeclarationModifiers? modifiers = null,
+ IPropertySymbol explicitInterfaceSymbol = null,
+ string name = null,
+ bool? isIndexer = null,
+ IMethodSymbol getMethod = null,
+ IMethodSymbol setMethod = null)
+ {
+ return CodeGenerationSymbolFactory.CreatePropertySymbol(
+ attributes,
+ accessibility ?? property.DeclaredAccessibility,
+ modifiers ?? property.GetSymbolModifiers(),
+ property.Type,
+ explicitInterfaceSymbol,
+ name ?? property.Name,
+ property.Parameters,
+ getMethod,
+ setMethod,
+ isIndexer ?? property.IsIndexer);
+ }
+
+ public static IMethodSymbol CreateAccessorSymbol(
+ IMethodSymbol accessor,
+ IList<AttributeData> attributes = null,
+ Accessibility? accessibility = null,
+ IMethodSymbol explicitInterfaceSymbol = null,
+ IList<SyntaxNode> statements = null)
+ {
+ return CodeGenerationSymbolFactory.CreateMethodSymbol(
+ attributes,
+ accessibility ?? accessor.DeclaredAccessibility,
+ accessor.GetSymbolModifiers().WithIsAbstract(statements == null),
+ accessor.ReturnType,
+ explicitInterfaceSymbol ?? accessor.ExplicitInterfaceImplementations.FirstOrDefault(),
+ accessor.Name,
+ accessor.TypeParameters,
+ accessor.Parameters,
+ statements,
+ returnTypeAttributes: accessor.GetReturnTypeAttributes());
+ }
+
+
+ static MethodInfo createAttributeDataMethod;
+
+ public static AttributeData CreateAttributeData(
+ INamedTypeSymbol attributeClass,
+ ImmutableArray<TypedConstant> constructorArguments = default(ImmutableArray<TypedConstant>),
+ ImmutableArray<KeyValuePair<string, TypedConstant>> namedArguments = default(ImmutableArray<KeyValuePair<string, TypedConstant>>))
+ {
+ try {
+ return (AttributeData)createAttributeDataMethod.Invoke (null, new object[] { attributeClass, constructorArguments, namedArguments });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ static MethodInfo createNamedTypeSymbolMethod;
+ public static INamedTypeSymbol CreateNamedTypeSymbol(IList<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers, TypeKind typeKind, string name, IList<ITypeParameterSymbol> typeParameters = null, INamedTypeSymbol baseType = null, IList<INamedTypeSymbol> interfaces = null, SpecialType specialType = SpecialType.None, IList<ISymbol> members = null)
+ {
+ try {
+ return (INamedTypeSymbol)createNamedTypeSymbolMethod.Invoke (null, new object[] { attributes, accessibility, modifiers, typeKind, name, typeParameters, baseType, interfaces, specialType, members });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ static MethodInfo createDelegateTypeSymbolMethod;
+ public static INamedTypeSymbol CreateDelegateTypeSymbol(IList<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers, ITypeSymbol returnType, string name, IList<ITypeParameterSymbol> typeParameters = null, IList<IParameterSymbol> parameters = null)
+ {
+ try {
+ return (INamedTypeSymbol)createDelegateTypeSymbolMethod.Invoke (null, new object[] { attributes, accessibility, modifiers, returnType, name, typeParameters, parameters });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ static MethodInfo createNamespaceSymbolMethod;
+
+ public static INamespaceSymbol CreateNamespaceSymbol(string name, IList<ISymbol> imports = null, IList<INamespaceOrTypeSymbol> members = null)
+ {
+ try {
+ return (INamespaceSymbol)createNamespaceSymbolMethod.Invoke (null, new object[] { name, imports, members });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ static readonly MethodInfo isCodeGenerationSymbolMethod;
+ /// <summary>
+ /// Determines if the symbol is purely a code generation symbol.
+ /// </summary>
+ public static bool IsCodeGenerationSymbol(this ISymbol symbol)
+ {
+ try {
+ return (bool)isCodeGenerationSymbolMethod.Invoke (null, new object[] { symbol });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+
+ static readonly MethodInfo createParameterSymbolMethod;
+ public static IParameterSymbol CreateParameterSymbol(ITypeSymbol type, string name)
+ {
+ return CreateParameterSymbol(attributes: null, refKind: RefKind.None, isParams: false, type: type, name: name, isOptional: false);
+ }
+
+ public static IParameterSymbol CreateParameterSymbol(IList<AttributeData> attributes, RefKind refKind, bool isParams, ITypeSymbol type, string name, bool isOptional = false, bool hasDefaultValue = false, object defaultValue = null)
+ {
+ try {
+ return (IParameterSymbol)createParameterSymbolMethod.Invoke (null, new object[] { attributes, refKind, isParams, type, name, isOptional, hasDefaultValue, defaultValue });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ static readonly MethodInfo createTypeParameterSymbolMethod;
+ public static ITypeParameterSymbol CreateTypeParameterSymbol(string name, int ordinal = 0)
+ {
+ try {
+ return (ITypeParameterSymbol)createTypeParameterSymbolMethod.Invoke (null, new object[] { name, ordinal });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ static MethodInfo createTypeParameterMethod;
+ public static ITypeParameterSymbol CreateTypeParameter(IList<AttributeData> attributes, VarianceKind varianceKind, string name, ImmutableArray<ITypeSymbol> constraintTypes, bool hasConstructorConstraint = false, bool hasReferenceConstraint = false, bool hasValueConstraint = false, int ordinal = 0)
+ {
+ try {
+ return (ITypeParameterSymbol)createTypeParameterMethod.Invoke (null, new object[] { attributes, varianceKind, name, constraintTypes, hasConstructorConstraint, hasReferenceConstraint, hasValueConstraint, ordinal});
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ static MethodInfo createMethodSymbolMethod;
+ public static IMethodSymbol CreateMethodSymbol(IList<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers, ITypeSymbol returnType, IMethodSymbol explicitInterfaceSymbol, string name, IList<ITypeParameterSymbol> typeParameters, IList<IParameterSymbol> parameters, IList<SyntaxNode> statements = null, IList<SyntaxNode> handlesExpressions = null, IList<AttributeData> returnTypeAttributes = null, MethodKind methodKind = MethodKind.Ordinary)
+ {
+ try {
+ return (IMethodSymbol)createMethodSymbolMethod.Invoke (null, new object[] { attributes, accessibility, modifiers, returnType, explicitInterfaceSymbol, name, typeParameters, parameters, statements, handlesExpressions, returnTypeAttributes, methodKind });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ static MethodInfo createMethodSymbolMethod2;
+ public static IMethodSymbol CreateMethodSymbol(INamedTypeSymbol containingType, IList<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers, ITypeSymbol returnType, IMethodSymbol explicitInterfaceSymbol, string name, IList<ITypeParameterSymbol> typeParameters, IList<IParameterSymbol> parameters, IList<SyntaxNode> statements = null, IList<SyntaxNode> handlesExpressions = null, IList<AttributeData> returnTypeAttributes = null, MethodKind methodKind = MethodKind.Ordinary)
+ {
+ try {
+ return (IMethodSymbol)createMethodSymbolMethod2.Invoke (null, new object[] { containingType, attributes, accessibility, modifiers, returnType, explicitInterfaceSymbol, name, typeParameters, parameters, statements, null, returnTypeAttributes, methodKind });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ static MethodInfo createPointerTypeSymbolMethod;
+ public static IPointerTypeSymbol CreatePointerTypeSymbol(ITypeSymbol pointedAtType)
+ {
+ try {
+ return (IPointerTypeSymbol)createPointerTypeSymbolMethod.Invoke (null, new object[] { pointedAtType });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ static MethodInfo createArrayTypeSymbolMethod;
+ public static IArrayTypeSymbol CreateArrayTypeSymbol(ITypeSymbol elementType, int rank = 1)
+ {
+ try {
+ return (IArrayTypeSymbol)createArrayTypeSymbolMethod.Invoke (null, new object[] { elementType, rank });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ static MethodInfo createConstructorSymbolMethod;
+ public static IMethodSymbol CreateConstructorSymbol(IList<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers, string typeName, IList<IParameterSymbol> parameters, IList<SyntaxNode> statements = null, IList<SyntaxNode> baseConstructorArguments = null, IList<SyntaxNode> thisConstructorArguments = null)
+ {
+ try {
+ return (IMethodSymbol)createConstructorSymbolMethod.Invoke (null, new object[] { attributes, accessibility, modifiers, typeName, parameters, statements, baseConstructorArguments, thisConstructorArguments });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ static MethodInfo createAccessorSymbolMethod;
+ public static IMethodSymbol CreateAccessorSymbol(IList<AttributeData> attributes, Accessibility accessibility, IList<SyntaxNode> statements)
+ {
+ try {
+ return (IMethodSymbol)createAccessorSymbolMethod.Invoke (null, new object[] { attributes, accessibility, statements });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ static MethodInfo createPropertySymbolMethod;
+
+ /// <summary>
+ /// Creates a property symbol that can be used to describe a property declaration.
+ /// </summary>
+ public static IPropertySymbol CreatePropertySymbol(IList<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers, ITypeSymbol type, IPropertySymbol explicitInterfaceSymbol, string name, IList<IParameterSymbol> parameters, IMethodSymbol getMethod, IMethodSymbol setMethod, bool isIndexer = false)
+ {
+ try {
+ return (IPropertySymbol)createPropertySymbolMethod.Invoke (null, new object[] { attributes, accessibility, modifiers, type, explicitInterfaceSymbol, name, parameters, getMethod, setMethod, isIndexer });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ static MethodInfo createFieldSymbolMethod;
+
+ public static IFieldSymbol CreateFieldSymbol(IList<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers, ITypeSymbol type, string name, bool hasConstantValue = false, object constantValue = null, SyntaxNode initializer = null)
+ {
+ try {
+ return (IFieldSymbol)createFieldSymbolMethod.Invoke (null, new object[] { attributes, accessibility, modifiers, type, name, hasConstantValue, constantValue, initializer });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/CodeRefactoringContextExtensions.cs b/main/src/addins/CSharpBinding/Util/CodeRefactoringContextExtensions.cs
new file mode 100644
index 0000000000..9a7608c8f8
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/CodeRefactoringContextExtensions.cs
@@ -0,0 +1,43 @@
+//
+// CodeRefactoringContextExtensions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis.CodeRefactorings;
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis.CodeActions;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class CodeRefactoringContextExtensions
+ {
+ public static void RegisterRefactorings(this CodeRefactoringContext context, IEnumerable<CodeAction> actions)
+ {
+ foreach (var action in actions) {
+ context.RegisterRefactoring(action);
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/CommonAccessibilityUtilities.cs b/main/src/addins/CSharpBinding/Util/CommonAccessibilityUtilities.cs
new file mode 100644
index 0000000000..a143df376e
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/CommonAccessibilityUtilities.cs
@@ -0,0 +1,75 @@
+//
+// ITypeSymbolExtensions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Linq;
+using System.ComponentModel;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
+using System.Reflection;
+using System.Collections.Generic;
+using System.Threading;
+using System.Collections.Immutable;
+using System.Diagnostics;
+using System.Threading.Tasks;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class CommonAccessibilityUtilities
+ {
+ public static Accessibility Minimum(Accessibility accessibility1, Accessibility accessibility2)
+ {
+ if (accessibility1 == Accessibility.Private || accessibility2 == Accessibility.Private)
+ {
+ return Accessibility.Private;
+ }
+
+ if (accessibility1 == Accessibility.ProtectedAndInternal || accessibility2 == Accessibility.ProtectedAndInternal)
+ {
+ return Accessibility.ProtectedAndInternal;
+ }
+
+ if (accessibility1 == Accessibility.Protected || accessibility2 == Accessibility.Protected)
+ {
+ return Accessibility.Protected;
+ }
+
+ if (accessibility1 == Accessibility.Internal || accessibility2 == Accessibility.Internal)
+ {
+ return Accessibility.Internal;
+ }
+
+ if (accessibility1 == Accessibility.ProtectedOrInternal || accessibility2 == Accessibility.ProtectedOrInternal)
+ {
+ return Accessibility.ProtectedOrInternal;
+ }
+
+ return Accessibility.Public;
+ }
+ }
+
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/CommonLocationExtensions.cs b/main/src/addins/CSharpBinding/Util/CommonLocationExtensions.cs
new file mode 100644
index 0000000000..e5733fb93a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/CommonLocationExtensions.cs
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class CommonLocationExtensions
+ {
+ public static SyntaxToken FindToken(this Location location, CancellationToken cancellationToken)
+ {
+ return location.SourceTree.GetRoot(cancellationToken).FindToken(location.SourceSpan.Start);
+ }
+
+ public static bool IsVisibleSourceLocation(this Location loc)
+ {
+ if (!loc.IsInSource)
+ {
+ return false;
+ }
+
+ var tree = loc.SourceTree;
+ return !(tree == null || tree.IsHiddenPosition(loc.SourceSpan.Start));
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/CommonSyntaxNodeOrTokenExtensions.cs b/main/src/addins/CSharpBinding/Util/CommonSyntaxNodeOrTokenExtensions.cs
new file mode 100644
index 0000000000..b99585496f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/CommonSyntaxNodeOrTokenExtensions.cs
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class CommonSyntaxNodeOrTokenExtensions
+ {
+ public static IEnumerable<SyntaxNodeOrToken> DepthFirstTraversal(this SyntaxNodeOrToken node)
+ {
+ var stack = new Stack<SyntaxNodeOrToken>();
+ stack.Push(node);
+
+ while (!stack.IsEmpty())
+ {
+ var current = stack.Pop();
+
+ yield return current;
+
+ if (current.IsNode)
+ {
+ foreach (var child in current.ChildNodesAndTokens().Reverse())
+ {
+ stack.Push(child);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/CompilationExtensions.cs b/main/src/addins/CSharpBinding/Util/CompilationExtensions.cs
new file mode 100644
index 0000000000..39d7d56bf1
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/CompilationExtensions.cs
@@ -0,0 +1,67 @@
+//
+// CompilationExtensions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
+using System.Threading;
+using System.Linq;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class CompilationExtensions
+ {
+ static INamespaceSymbol FindNamespace(INamespaceSymbol globalNamespace, string fullName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (string.IsNullOrEmpty(fullName))
+ return globalNamespace;
+ var stack = new Stack<INamespaceSymbol>();
+ stack.Push(globalNamespace);
+
+ while (stack.Count > 0) {
+ if (cancellationToken.IsCancellationRequested)
+ return null;
+ var currentNs = stack.Pop();
+ if (currentNs.GetFullName() == fullName)
+ return currentNs;
+ foreach (var childNamespace in currentNs.GetNamespaceMembers())
+ stack.Push(childNamespace);
+ }
+ return null;
+ }
+
+ public static ITypeSymbol GetTypeSymbol(this Compilation compilation, string ns, string name, int arity, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (compilation == null)
+ throw new ArgumentNullException("compilation");
+ var nsSymbol = FindNamespace (compilation.GlobalNamespace, ns, cancellationToken);
+ if (nsSymbol == null)
+ return null;
+ return nsSymbol.GetTypeMembers(name, arity).FirstOrDefault ();
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/CompilationUnitSyntaxExtensions.cs b/main/src/addins/CSharpBinding/Util/CompilationUnitSyntaxExtensions.cs
new file mode 100644
index 0000000000..288720c479
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/CompilationUnitSyntaxExtensions.cs
@@ -0,0 +1,202 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class CompilationUnitSyntaxExtensions
+ {
+ public static bool CanAddUsingDirectives(this SyntaxNode contextNode, CancellationToken cancellationToken)
+ {
+ var usingDirectiveAncsestor = contextNode.GetAncestor<UsingDirectiveSyntax>();
+ if ((usingDirectiveAncsestor != null) && (usingDirectiveAncsestor.GetAncestor<NamespaceDeclarationSyntax>() == null))
+ {
+ // We are inside a top level using directive (i.e. one that's directly in the compilation unit).
+ return false;
+ }
+
+ if (contextNode.SyntaxTree.HasHiddenRegions())
+ {
+ var namespaceDeclaration = contextNode.GetInnermostNamespaceDeclarationWithUsings();
+ var root = contextNode.GetAncestorOrThis<CompilationUnitSyntax>();
+ var span = GetUsingsSpan(root, namespaceDeclaration);
+
+ if (contextNode.SyntaxTree.OverlapsHiddenPosition(span, cancellationToken))
+ {
+ return false;
+ }
+ }
+
+ if (cancellationToken.IsCancellationRequested)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ private static TextSpan GetUsingsSpan(CompilationUnitSyntax root, NamespaceDeclarationSyntax namespaceDeclaration)
+ {
+ if (namespaceDeclaration != null)
+ {
+ var usings = namespaceDeclaration.Usings;
+ var start = usings.First().SpanStart;
+ var end = usings.Last().Span.End;
+ return TextSpan.FromBounds(start, end);
+ }
+ else
+ {
+ var rootUsings = root.Usings;
+ if (rootUsings.Any())
+ {
+ var start = rootUsings.First().SpanStart;
+ var end = rootUsings.Last().Span.End;
+ return TextSpan.FromBounds(start, end);
+ }
+ else
+ {
+ var start = 0;
+ var end = root.Members.Any()
+ ? root.Members.First().GetFirstToken().Span.End
+ : root.Span.End;
+ return TextSpan.FromBounds(start, end);
+ }
+ }
+ }
+
+ public static CompilationUnitSyntax AddUsingDirective(
+ this CompilationUnitSyntax root,
+ UsingDirectiveSyntax usingDirective,
+ SyntaxNode contextNode,
+ bool placeSystemNamespaceFirst,
+ params SyntaxAnnotation[] annotations)
+ {
+ return root.AddUsingDirectives(new[] { usingDirective }, contextNode, placeSystemNamespaceFirst, annotations);
+ }
+
+ public static CompilationUnitSyntax AddUsingDirectives(
+ this CompilationUnitSyntax root,
+ IList<UsingDirectiveSyntax> usingDirectives,
+ SyntaxNode contextNode,
+ bool placeSystemNamespaceFirst,
+ params SyntaxAnnotation[] annotations)
+ {
+ if (!usingDirectives.Any())
+ {
+ return root;
+ }
+
+ var firstOuterNamespaceWithUsings = contextNode.GetInnermostNamespaceDeclarationWithUsings();
+
+ if (firstOuterNamespaceWithUsings == null)
+ {
+ return root.AddUsingDirectives(usingDirectives, placeSystemNamespaceFirst, annotations);
+ }
+ else
+ {
+ var newNamespace = firstOuterNamespaceWithUsings.AddUsingDirectives(usingDirectives, placeSystemNamespaceFirst, annotations);
+ return root.ReplaceNode(firstOuterNamespaceWithUsings, newNamespace);
+ }
+ }
+
+ public static CompilationUnitSyntax AddUsingDirectives(
+ this CompilationUnitSyntax root,
+ IList<UsingDirectiveSyntax> usingDirectives,
+ bool placeSystemNamespaceFirst,
+ params SyntaxAnnotation[] annotations)
+ {
+ if (usingDirectives.Count == 0)
+ {
+ return root;
+ }
+
+ var comparer = placeSystemNamespaceFirst
+ ? UsingsAndExternAliasesDirectiveComparer.SystemFirstInstance
+ : UsingsAndExternAliasesDirectiveComparer.NormalInstance;
+
+ var usings = AddUsingDirectives(root, usingDirectives);
+
+ // If the user likes to have their Usings statements unsorted, allow them to
+ if (root.Usings.IsSorted(comparer))
+ {
+ usings.Sort(comparer);
+ }
+
+ // If any using we added was moved to the first location, then take the trivia from
+ // the start of the first token and add it to the using we added. This way things
+ // like #define's and #r's will stay above the using.
+ var firstUsingChanged = root.Usings.Count == 0 || usings[0] != root.Usings[0];
+ if (firstUsingChanged && root.Externs.Count == 0)
+ {
+ var firstToken = root.GetFirstToken();
+
+ // Move the leading directives from the first directive to the new using.
+ var firstUsing = usings[0].WithLeadingTrivia(firstToken.LeadingTrivia.Where(t => !t.IsDocComment() && !t.IsElastic()));
+
+ // Remove the leading directives from the first token.
+ var newFirstToken = firstToken.WithLeadingTrivia(firstToken.LeadingTrivia.Where(t => t.IsDocComment() || t.IsElastic()));
+
+ // Remove the leading trivia from the first token from the tree.
+ root = root.ReplaceToken(firstToken, newFirstToken);
+
+ // Create the new list of usings.
+ var finalUsings = new List<UsingDirectiveSyntax>();
+ finalUsings.Add(firstUsing);
+ finalUsings.AddRange(root.Usings);
+ finalUsings.AddRange(usingDirectives.Except(new[] { usings[0] }));
+ finalUsings.Sort(comparer);
+ usings = finalUsings;
+ }
+
+ usings = usings.Select(u => u.WithAdditionalAnnotations(annotations)).ToList();
+ return root.WithUsings(usings.ToSyntaxList());
+ }
+
+ private static List<UsingDirectiveSyntax> AddUsingDirectives(CompilationUnitSyntax root, IList<UsingDirectiveSyntax> usingDirectives)
+ {
+ // We need to try and not place the using inside of a directive if possible.
+ var usings = new List<UsingDirectiveSyntax>();
+ var endOfList = root.Usings.Count - 1;
+ int startOfLastDirective = -1;
+ int endOfLastDirective = -1;
+ for (int i = 0; i < root.Usings.Count; i++)
+ {
+ if (root.Usings[i].GetLeadingTrivia().Any(trivia => trivia.IsKind(SyntaxKind.IfDirectiveTrivia)))
+ {
+ startOfLastDirective = i;
+ }
+
+ if (root.Usings[i].GetLeadingTrivia().Any(trivia => trivia.IsKind(SyntaxKind.EndIfDirectiveTrivia)))
+ {
+ endOfLastDirective = i;
+ }
+ }
+
+ // if the entire using is in a directive or there is a using list at the end outside of the directive add the using at the end,
+ // else place it before the last directive.
+ usings.AddRange(root.Usings);
+ if ((startOfLastDirective == 0 && (endOfLastDirective == endOfList || endOfLastDirective == -1)) ||
+ (startOfLastDirective == -1 && endOfLastDirective == -1) ||
+ (endOfLastDirective != endOfList && endOfLastDirective != -1))
+ {
+ usings.AddRange(usingDirectives);
+ }
+ else
+ {
+ usings.InsertRange(startOfLastDirective, usingDirectives);
+ }
+ return usings;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/ConflictResolver.cs b/main/src/addins/CSharpBinding/Util/ConflictResolver.cs
new file mode 100644
index 0000000000..760c1757be
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/ConflictResolver.cs
@@ -0,0 +1,114 @@
+//
+// ConflictResolver.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using System;
+using Microsoft.CodeAnalysis.Options;
+using System.Threading.Tasks;
+using System.Reflection;
+using System.Runtime.ExceptionServices;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ class ConflictResolution
+ {
+ //static Type typeInfo;
+ internal object instance;
+
+ static ConflictResolution ()
+ {
+ //typeInfo = Type.GetType ("Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolution" + ReflectionNamespaces.WorkspacesAsmName, true);
+
+ }
+
+ public ConflictResolution (object instance)
+ {
+ this.instance = instance;
+ }
+
+ }
+
+ class RenameLocations
+ {
+ //static Type typeInfo;
+ internal object instance;
+
+ static RenameLocations ()
+ {
+ //typeInfo = Type.GetType ("Microsoft.CodeAnalysis.Rename.RenameLocations" + ReflectionNamespaces.WorkspacesAsmName, true);
+
+ }
+
+ public RenameLocations (object instance)
+ {
+ this.instance = instance;
+ }
+
+ }
+
+
+ class ConflictResolver
+ {
+ static MethodInfo resolveConflictsAsyncMethod;
+ static Type typeInfo;
+
+ static ConflictResolver ()
+ {
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver" + ReflectionNamespaces.WorkspacesAsmName, true);
+ resolveConflictsAsyncMethod = typeInfo.GetMethod ("ResolveConflictsAsync");
+
+ }
+
+ public static Task<ConflictResolution> ResolveConflictsAsync(
+ RenameLocations renameLocationSet,
+ string originalText,
+ string replacementText,
+ OptionSet optionSet,
+ Func<IEnumerable<ISymbol>, bool?> hasConflict,
+ CancellationToken cancellationToken)
+ {
+ try {
+ var task = resolveConflictsAsyncMethod.Invoke (null, new object [] { renameLocationSet.instance, originalText, replacementText, optionSet, hasConflict, cancellationToken });
+ var propertyInfo = task.GetType ().GetProperty ("Result");
+ return Task.FromResult (new ConflictResolution (propertyInfo.GetValue (task)));
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/CrefSyntaxExtensions.cs b/main/src/addins/CSharpBinding/Util/CrefSyntaxExtensions.cs
new file mode 100644
index 0000000000..1d80af7b2f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/CrefSyntaxExtensions.cs
@@ -0,0 +1,136 @@
+//
+// CrefSyntaxExtensions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Simplification;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Rename.ConflictEngine;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Shared.Utilities;
+using Microsoft.CodeAnalysis.Simplification;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+using System;
+using System.Reflection;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class CrefSyntaxExtensions
+ {
+ public static bool TryReduceOrSimplifyExplicitName(
+ this CrefSyntax crefSyntax,
+ SemanticModel semanticModel,
+ out CrefSyntax replacementNode,
+ out TextSpan issueSpan,
+ OptionSet optionSet,
+ CancellationToken cancellationToken)
+ {
+ replacementNode = null;
+ issueSpan = default(TextSpan);
+
+ // Currently Qualified Cref is the only CrefSyntax We are handling separately
+ if (crefSyntax.Kind() != SyntaxKind.QualifiedCref)
+ {
+ return false;
+ }
+
+ var qualifiedCrefSyntax = (QualifiedCrefSyntax)crefSyntax;
+ var memberCref = qualifiedCrefSyntax.Member;
+
+ // Currently we are dealing with only the NameMemberCrefs
+ if (optionSet.GetOption(SimplificationOptions.PreferIntrinsicPredefinedTypeKeywordInMemberAccess, LanguageNames.CSharp) &&
+ (memberCref.Kind() == SyntaxKind.NameMemberCref))
+ {
+ var nameMemberCref = ((NameMemberCrefSyntax)memberCref).Name;
+ var symbolInfo = semanticModel.GetSymbolInfo(nameMemberCref, cancellationToken);
+ var symbol = symbolInfo.Symbol;
+
+ if (symbol == null)
+ {
+ return false;
+ }
+
+ if (symbol is INamespaceOrTypeSymbol)
+ {
+ //var namespaceOrTypeSymbol = (INamespaceOrTypeSymbol)symbol;
+
+ // 1. Check for Predefined Types
+ if (symbol is INamedTypeSymbol)
+ {
+ var namedSymbol = (INamedTypeSymbol)symbol;
+ var keywordKind = ExpressionSyntaxExtensions.GetPredefinedKeywordKind(namedSymbol.SpecialType);
+
+ if (keywordKind != SyntaxKind.None)
+ {
+ replacementNode = SyntaxFactory.TypeCref(
+ SyntaxFactory.PredefinedType(
+ SyntaxFactory.Token(crefSyntax.GetLeadingTrivia(), keywordKind, crefSyntax.GetTrailingTrivia())));
+ replacementNode = crefSyntax.CopyAnnotationsTo(replacementNode);
+
+ // we want to show the whole name expression as unnecessary
+ issueSpan = crefSyntax.Span;
+
+ return true;
+ }
+ }
+ }
+ }
+
+ var oldSymbol = semanticModel.GetSymbolInfo(crefSyntax, cancellationToken).Symbol;
+ if (oldSymbol != null)
+ {
+ var speculativeBindingOption = SpeculativeBindingOption.BindAsExpression;
+ if (oldSymbol is INamespaceOrTypeSymbol)
+ {
+ speculativeBindingOption = SpeculativeBindingOption.BindAsTypeOrNamespace;
+ }
+
+ var newSymbol = semanticModel.GetSpeculativeSymbolInfo(crefSyntax.SpanStart, memberCref, speculativeBindingOption).Symbol;
+
+ if (newSymbol == oldSymbol)
+ {
+ // Copy Trivia and Annotations
+ memberCref = memberCref.WithLeadingTrivia(crefSyntax.GetLeadingTrivia());
+ memberCref = crefSyntax.CopyAnnotationsTo(memberCref);
+ issueSpan = qualifiedCrefSyntax.Container.Span;
+ replacementNode = memberCref;
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+
+}
diff --git a/main/src/addins/CSharpBinding/Util/DirectiveSyntaxExtensions.cs b/main/src/addins/CSharpBinding/Util/DirectiveSyntaxExtensions.cs
new file mode 100644
index 0000000000..3bed8b6c58
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/DirectiveSyntaxExtensions.cs
@@ -0,0 +1,56 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.ExceptionServices;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ internal static partial class DirectiveSyntaxExtensions
+ {
+ readonly static MethodInfo getMatchingDirective;
+ readonly static MethodInfo getMatchingConditionalDirectives;
+
+ static DirectiveSyntaxExtensions()
+ {
+ var typeInfo = Type.GetType("Microsoft.CodeAnalysis.CSharp.Extensions.DirectiveSyntaxExtensions" + ReflectionNamespaces.CSWorkspacesAsmName, true);
+ if (typeInfo == null)
+ throw new InvalidOperationException ("DirectiveSyntaxExtensions not found.");
+ getMatchingDirective = typeInfo.GetMethod("GetMatchingDirective", BindingFlags.NonPublic | BindingFlags.Static);
+ if (getMatchingDirective == null)
+ throw new InvalidOperationException ("GetMatchingDirective not found.");
+ getMatchingConditionalDirectives = typeInfo.GetMethod("GetMatchingConditionalDirectives", BindingFlags.NonPublic | BindingFlags.Static);
+ if (getMatchingDirective == null)
+ throw new InvalidOperationException ("GetMatchingConditionalDirectives not found.");
+ }
+
+
+
+ internal static DirectiveTriviaSyntax GetMatchingDirective(this DirectiveTriviaSyntax directive, CancellationToken cancellationToken)
+ {
+ try {
+ return (DirectiveTriviaSyntax)getMatchingDirective.Invoke(null, new object[] { directive, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ internal static IReadOnlyList<DirectiveTriviaSyntax> GetMatchingConditionalDirectives(this DirectiveTriviaSyntax directive, CancellationToken cancellationToken)
+ {
+ try {
+ return (IReadOnlyList<DirectiveTriviaSyntax>)getMatchingConditionalDirectives.Invoke(null, new object[] { directive, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/Util/DocumentExtensions.cs b/main/src/addins/CSharpBinding/Util/DocumentExtensions.cs
new file mode 100644
index 0000000000..d61a6c9a79
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/DocumentExtensions.cs
@@ -0,0 +1,137 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.FindSymbols;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.SemanticModelWorkspaceService;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
+using System;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static partial class DocumentExtensions
+ {
+ public static TLanguageService GetLanguageService<TLanguageService>(this Document document) where TLanguageService : class, ILanguageService
+ {
+ return document.Project.LanguageServices.GetService<TLanguageService>();
+ }
+
+ public static bool IsOpen(this Document document)
+ {
+ var workspace = document.Project.Solution.Workspace as Workspace;
+ return workspace != null && workspace.IsDocumentOpen(document.Id);
+ }
+
+ /// <summary>
+ /// this will return either regular semantic model or speculative semantic based on context.
+ /// any feature that is involved in typing or run on UI thread should use this to take advantage of speculative semantic model
+ /// whenever possible automatically.
+ ///
+ /// when using this API, semantic model should only be used to ask node inside of the given span.
+ /// otherwise, it might throw if semantic model returned by this API is a speculative semantic model.
+ ///
+ /// also, symbols from the semantic model returned by this API might have out of date location information.
+ /// if exact location (not relative location) is needed from symbol, regular GetSemanticModel should be used.
+ /// </summary>
+ public static async Task<SemanticModel> GetSemanticModelForSpanAsync(this Document document, TextSpan span, CancellationToken cancellationToken)
+ {
+// var syntaxFactService = document.Project.LanguageServices.GetService<ISyntaxFactsService>();
+// var semanticModelService = document.Project.Solution.Workspace.Services.GetService<ISemanticModelService>();
+// if (semanticModelService == null || syntaxFactService == null)
+// {
+ return await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+// }
+//
+// var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+// var token = root.FindToken(span.Start);
+// if (token.Parent == null)
+// {
+// return await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+// }
+//
+// var node = token.Parent.AncestorsAndSelf().FirstOrDefault(a => a.FullSpan.Contains(span));
+// return await GetSemanticModelForNodeAsync(semanticModelService, syntaxFactService, document, node, span, cancellationToken).ConfigureAwait(false);
+ }
+
+ /// <summary>
+ /// this will return either regular semantic model or speculative semantic based on context.
+ /// any feature that is involved in typing or run on UI thread should use this to take advantage of speculative semantic model
+ /// whenever possible automatically.
+ ///
+ /// when using this API, semantic model should only be used to ask node inside of the given node except ones that belong to
+ /// member signature. otherwise, it might throw if semantic model returned by this API is a speculative semantic model.
+ ///
+ /// also, symbols from the semantic model returned by this API might have out of date location information.
+ /// if exact location (not relative location) is needed from symbol, regular GetSemanticModel should be used.
+ /// </summary>
+ public static Task<SemanticModel> GetSemanticModelForNodeAsync(this Document document, SyntaxNode node, CancellationToken cancellationToken)
+ {
+// var syntaxFactService = document.Project.LanguageServices.GetService<ISyntaxFactsService>();
+// var semanticModelService = document.Project.Solution.Workspace.Services.GetService<ISemanticModelService>();
+// if (semanticModelService == null || syntaxFactService == null || node == null)
+// {
+ return document.GetSemanticModelAsync(cancellationToken);
+// }
+//
+// return GetSemanticModelForNodeAsync(semanticModelService, syntaxFactService, document, node, node.FullSpan, cancellationToken);
+ }
+
+ public static async Task<IEnumerable<T>> GetUnionResultsFromDocumentAndLinks<T>(
+ this Document document,
+ IEqualityComparer<T> comparer,
+ Func<Document, CancellationToken, Task<IEnumerable<T>>> getItemsWorker,
+ CancellationToken cancellationToken)
+ {
+ var linkedDocumentIds = document.GetLinkedDocumentIds();
+ var itemsForCurrentContext = await getItemsWorker(document, cancellationToken).ConfigureAwait(false) ?? SpecializedCollections.EmptyEnumerable<T>();
+ if (!linkedDocumentIds.Any())
+ {
+ return itemsForCurrentContext;
+ }
+
+ ISet<T> totalItems = itemsForCurrentContext.ToSet(comparer);
+ foreach (var linkedDocumentId in linkedDocumentIds)
+ {
+ var linkedDocument = document.Project.Solution.GetDocument(linkedDocumentId);
+ var items = await getItemsWorker(linkedDocument, cancellationToken).ConfigureAwait(false);
+ if (items != null)
+ {
+ foreach (var item in items)
+ totalItems.Add (item);
+ }
+ }
+
+ return totalItems;
+ }
+
+ public static bool ShouldHideAdvancedMembers(this Document document)
+ {
+ return false;
+// var service = document.Project.Solution.Workspace.Services.GetService<IOptionService>();
+// return service.GetOption(CompletionOptions.HideAdvancedMembers, document.Project.Language);
+ }
+
+ public static async Task<Document> ReplaceNodeAsync<TNode>(this Document document, TNode oldNode, TNode newNode, CancellationToken cancellationToken) where TNode : SyntaxNode
+ {
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ var newRoot = root.ReplaceNode(oldNode, newNode);
+ return document.WithSyntaxRoot(newRoot);
+ }
+
+ public static async Task<Document> ReplaceNodesAsync(this Document document,
+ IEnumerable<SyntaxNode> nodes,
+ Func<SyntaxNode, SyntaxNode, SyntaxNode> computeReplacementNode,
+ CancellationToken cancellationToken)
+ {
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ var newRoot = root.ReplaceNodes(nodes, computeReplacementNode);
+ return document.WithSyntaxRoot(newRoot);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/EnumValueUtilities.cs b/main/src/addins/CSharpBinding/Util/EnumValueUtilities.cs
new file mode 100644
index 0000000000..deb4b97893
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/EnumValueUtilities.cs
@@ -0,0 +1,57 @@
+//
+// EnumValueUtilities.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Reflection;
+using Microsoft.CodeAnalysis;
+using System.Threading;
+using System.Runtime.ExceptionServices;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class EnumValueUtilities
+ {
+ readonly static Type typeInfo;
+
+ static EnumValueUtilities ()
+ {
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.Shared.Utilities.EnumValueUtilities" + ReflectionNamespaces.WorkspacesAsmName, true);
+ getNextEnumValueMethod = typeInfo.GetMethod ("GetNextEnumValue", BindingFlags.Static | BindingFlags.Public);
+ }
+
+ readonly static MethodInfo getNextEnumValueMethod;
+
+ public static object GetNextEnumValue(INamedTypeSymbol enumType, CancellationToken cancellationToken)
+ {
+ try {
+ return getNextEnumValueMethod.Invoke (null, new object[] { enumType, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/EnumerableExtensions.cs b/main/src/addins/CSharpBinding/Util/EnumerableExtensions.cs
new file mode 100644
index 0000000000..0d54dd99c0
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/EnumerableExtensions.cs
@@ -0,0 +1,351 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Diagnostics;
+using System.Linq;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static partial class EnumerableExtensions
+ {
+ public static IEnumerable<T> Do<T>(this IEnumerable<T> source, Action<T> action)
+ {
+ if (source == null)
+ {
+ throw new ArgumentNullException(nameof(source));
+ }
+
+ if (action == null)
+ {
+ throw new ArgumentNullException(nameof(action));
+ }
+
+ // perf optimization. try to not use enumerator if possible
+ var list = source as IList<T>;
+ if (list != null)
+ {
+ for (int i = 0, count = list.Count; i < count; i++)
+ {
+ action(list[i]);
+ }
+ }
+ else
+ {
+ foreach (var value in source)
+ {
+ action(value);
+ }
+ }
+
+ return source;
+ }
+
+ public static ReadOnlyCollection<T> ToReadOnlyCollection<T>(this IEnumerable<T> source)
+ {
+ if (source == null)
+ {
+ throw new ArgumentNullException(nameof(source));
+ }
+
+ return new ReadOnlyCollection<T>(source.ToList());
+ }
+
+ public static IEnumerable<T> Concat<T>(this IEnumerable<T> source, T value)
+ {
+ if (source == null)
+ {
+ throw new ArgumentNullException(nameof(source));
+ }
+
+ return source.ConcatWorker(value);
+ }
+
+ private static IEnumerable<T> ConcatWorker<T>(this IEnumerable<T> source, T value)
+ {
+ foreach (var v in source)
+ {
+ yield return v;
+ }
+
+ yield return value;
+ }
+
+ public static bool SetEquals<T>(this IEnumerable<T> source1, IEnumerable<T> source2, IEqualityComparer<T> comparer)
+ {
+ if (source1 == null)
+ {
+ throw new ArgumentNullException(nameof(source1));
+ }
+
+ if (source2 == null)
+ {
+ throw new ArgumentNullException(nameof(source2));
+ }
+
+ return source1.ToSet(comparer).SetEquals(source2);
+ }
+
+ public static bool SetEquals<T>(this IEnumerable<T> source1, IEnumerable<T> source2)
+ {
+ if (source1 == null)
+ {
+ throw new ArgumentNullException(nameof(source1));
+ }
+
+ if (source2 == null)
+ {
+ throw new ArgumentNullException(nameof(source2));
+ }
+
+ return source1.ToSet().SetEquals(source2);
+ }
+
+ public static ISet<T> ToSet<T>(this IEnumerable<T> source, IEqualityComparer<T> comparer)
+ {
+ if (source == null)
+ {
+ throw new ArgumentNullException(nameof(source));
+ }
+
+ return new HashSet<T>(source, comparer);
+ }
+
+ public static ISet<T> ToSet<T>(this IEnumerable<T> source)
+ {
+ if (source == null)
+ {
+ throw new ArgumentNullException(nameof(source));
+ }
+
+ return source as ISet<T> ?? new HashSet<T>(source);
+ }
+
+ public static T? FirstOrNullable<T>(this IEnumerable<T> source)
+ where T : struct
+ {
+ if (source == null)
+ {
+ throw new ArgumentNullException(nameof(source));
+ }
+
+ return source.Cast<T?>().FirstOrDefault();
+ }
+
+ public static T? FirstOrNullable<T>(this IEnumerable<T> source, Func<T, bool> predicate)
+ where T : struct
+ {
+ if (source == null)
+ {
+ throw new ArgumentNullException(nameof(source));
+ }
+
+ return source.Cast<T?>().FirstOrDefault(v => predicate(v.Value));
+ }
+
+ public static T? LastOrNullable<T>(this IEnumerable<T> source)
+ where T : struct
+ {
+ if (source == null)
+ {
+ throw new ArgumentNullException(nameof(source));
+ }
+
+ return source.Cast<T?>().LastOrDefault();
+ }
+
+ public static bool IsSingle<T>(this IEnumerable<T> list)
+ {
+ using (var enumerator = list.GetEnumerator())
+ {
+ return enumerator.MoveNext() && !enumerator.MoveNext();
+ }
+ }
+
+ public static bool IsEmpty<T>(this IEnumerable<T> source)
+ {
+ var readOnlyCollection = source as IReadOnlyCollection<T>;
+ if (readOnlyCollection != null)
+ {
+ return readOnlyCollection.Count == 0;
+ }
+
+ var genericCollection = source as ICollection<T>;
+ if (genericCollection != null)
+ {
+ return genericCollection.Count == 0;
+ }
+
+ var collection = source as ICollection;
+ if (collection != null)
+ {
+ return collection.Count == 0;
+ }
+
+ var str = source as string;
+ if (str != null)
+ {
+ return str.Length == 0;
+ }
+
+ foreach (var t in source)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static bool IsEmpty<T>(this IReadOnlyCollection<T> source)
+ {
+ return source.Count == 0;
+ }
+
+ public static bool IsEmpty<T>(this ICollection<T> source)
+ {
+ return source.Count == 0;
+ }
+
+ public static bool IsEmpty(this string source)
+ {
+ return source.Length == 0;
+ }
+
+ /// <remarks>
+ /// This method is necessary to avoid an ambiguity between <see cref="IsEmpty{T}(IReadOnlyCollection{T})"/> and <see cref="IsEmpty{T}(ICollection{T})"/>.
+ /// </remarks>
+ public static bool IsEmpty<T>(this T[] source)
+ {
+ return source.Length == 0;
+ }
+
+ /// <remarks>
+ /// This method is necessary to avoid an ambiguity between <see cref="IsEmpty{T}(IReadOnlyCollection{T})"/> and <see cref="IsEmpty{T}(ICollection{T})"/>.
+ /// </remarks>
+ public static bool IsEmpty<T>(this List<T> source)
+ {
+ return source.Count == 0;
+ }
+
+ private static readonly Func<object, bool> s_notNullTest = x => x != null;
+
+ public static IEnumerable<T> WhereNotNull<T>(this IEnumerable<T> source)
+ where T : class
+ {
+ if (source == null)
+ {
+ return SpecializedCollections.EmptyEnumerable<T>();
+ }
+
+ return source.Where((Func<T, bool>)s_notNullTest);
+ }
+
+ public static bool All(this IEnumerable<bool> source)
+ {
+ if (source == null)
+ {
+ throw new ArgumentNullException(nameof(source));
+ }
+
+ foreach (var b in source)
+ {
+ if (!b)
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static IEnumerable<T> Flatten<T>(this IEnumerable<IEnumerable<T>> sequence)
+ {
+ if (sequence == null)
+ {
+ throw new ArgumentNullException(nameof(sequence));
+ }
+
+ return sequence.SelectMany(s => s);
+ }
+
+ public static IEnumerable<T> OrderBy<T>(this IEnumerable<T> source, IComparer<T> comparer)
+ {
+ return source.OrderBy(t => t, comparer);
+ }
+
+// public static IEnumerable<T> OrderBy<T>(this IEnumerable<T> source, Comparison<T> compare)
+// {
+// return source.OrderBy(new ComparisonComparer<T>(compare));
+// }
+
+// public static IEnumerable<T> Order<T>(this IEnumerable<T> source) where T : IComparable<T>
+// {
+// return source.OrderBy((t1, t2) => t1.CompareTo(t2));
+// }
+
+ public static bool IsSorted<T>(this IEnumerable<T> enumerable, IComparer<T> comparer)
+ {
+ using (var e = enumerable.GetEnumerator())
+ {
+ if (!e.MoveNext())
+ {
+ return true;
+ }
+
+ var previous = e.Current;
+ while (e.MoveNext())
+ {
+ if (comparer.Compare(previous, e.Current) > 0)
+ {
+ return false;
+ }
+
+ previous = e.Current;
+ }
+
+ return true;
+ }
+ }
+
+ public static bool SequenceEqual<T>(this IEnumerable<T> first, IEnumerable<T> second, Func<T, T, bool> comparer)
+ {
+ Debug.Assert(comparer != null);
+
+ if (first == second)
+ {
+ return true;
+ }
+
+ if (first == null || second == null)
+ {
+ return false;
+ }
+
+ using (var enumerator = first.GetEnumerator())
+ using (var enumerator2 = second.GetEnumerator())
+ {
+ while (enumerator.MoveNext())
+ {
+ if (!enumerator2.MoveNext() || !comparer(enumerator.Current, enumerator2.Current))
+ {
+ return false;
+ }
+ }
+
+ if (enumerator2.MoveNext())
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static bool Contains<T>(this IEnumerable<T> sequence, Func<T, bool> predicate)
+ {
+ return sequence.Any(predicate);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/ExpressionSyntaxExtensions.cs b/main/src/addins/CSharpBinding/Util/ExpressionSyntaxExtensions.cs
new file mode 100644
index 0000000000..5fce0d401b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/ExpressionSyntaxExtensions.cs
@@ -0,0 +1,2380 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Extensions.ContextQuery;
+using Microsoft.CodeAnalysis.CSharp.Simplification;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Rename.ConflictEngine;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Shared.Utilities;
+using Microsoft.CodeAnalysis.Simplification;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+using System;
+using System.Reflection;
+using System.Runtime.ExceptionServices;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static partial class ExpressionSyntaxExtensions
+ {
+ static MethodInfo castIfPossibleMethod;
+
+
+ static ExpressionSyntaxExtensions ()
+ {
+ var typeInfo = Type.GetType("Microsoft.CodeAnalysis.CSharp.Extensions.ExpressionSyntaxExtensions" + ReflectionNamespaces.CSWorkspacesAsmName, true);
+ castIfPossibleMethod = typeInfo.GetMethod("CastIfPossible", BindingFlags.Static | BindingFlags.Public);
+ if (castIfPossibleMethod == null)
+ throw new Exception ("ExpressionSyntaxExtensions: CastIfPossible not found");
+ tryReduceOrSimplifyExplicitNameMethod = typeInfo.GetMethod("TryReduceOrSimplifyExplicitName", BindingFlags.Static | BindingFlags.Public);
+ if (tryReduceOrSimplifyExplicitNameMethod == null)
+ throw new Exception ("ExpressionSyntaxExtensions: TryReduceOrSimplifyExplicitName not found");
+ }
+
+ /// <summary>
+ /// Adds to <paramref name="targetType"/> if it does not contain an anonymous
+ /// type and binds to the same type at the given <paramref name="position"/>.
+ /// </summary>
+ public static ExpressionSyntax CastIfPossible(
+ this ExpressionSyntax expression,
+ ITypeSymbol targetType,
+ int position,
+ SemanticModel semanticModel)
+ {
+ try {
+ var args = new object [] { expression, targetType, position, semanticModel};
+ var result = (ExpressionSyntax)castIfPossibleMethod.Invoke (null, args);
+ return result;
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ throw ex;
+ }
+ }
+
+ public static ExpressionSyntax WalkUpParentheses(this ExpressionSyntax expression)
+ {
+ while (expression.IsParentKind(SyntaxKind.ParenthesizedExpression))
+ {
+ expression = (ExpressionSyntax)expression.Parent;
+ }
+
+ return expression;
+ }
+
+ public static ExpressionSyntax WalkDownParentheses(this ExpressionSyntax expression)
+ {
+ while (expression.IsKind(SyntaxKind.ParenthesizedExpression))
+ {
+ expression = ((ParenthesizedExpressionSyntax)expression).Expression;
+ }
+
+ return expression;
+ }
+
+ public static ExpressionSyntax Parenthesize(this ExpressionSyntax expression, bool includeElasticTrivia = true)
+ {
+ var leadingTrivia = expression.GetLeadingTrivia();
+ var trailingTrivia = expression.GetTrailingTrivia();
+ expression = expression.WithoutLeadingTrivia()
+ .WithoutTrailingTrivia();
+
+ if (includeElasticTrivia)
+ {
+ return SyntaxFactory.ParenthesizedExpression(expression)
+ .WithLeadingTrivia(leadingTrivia)
+ .WithTrailingTrivia(trailingTrivia)
+ .WithAdditionalAnnotations(Simplifier.Annotation);
+ }
+ else
+ {
+ return SyntaxFactory.ParenthesizedExpression(
+ SyntaxFactory.Token(SyntaxTriviaList.Empty, SyntaxKind.OpenParenToken, SyntaxTriviaList.Empty),
+ expression,
+ SyntaxFactory.Token(SyntaxTriviaList.Empty, SyntaxKind.CloseParenToken, SyntaxTriviaList.Empty))
+ .WithLeadingTrivia(leadingTrivia)
+ .WithTrailingTrivia(trailingTrivia)
+ .WithAdditionalAnnotations(Simplifier.Annotation);
+ }
+ }
+
+ public static CastExpressionSyntax Cast(
+ this ExpressionSyntax expression,
+ ITypeSymbol targetType)
+ {
+ return SyntaxFactory.CastExpression(
+ type: targetType.GenerateTypeSyntax(),
+ expression: expression.Parenthesize())
+ .WithAdditionalAnnotations(Simplifier.Annotation);
+ }
+
+ public static bool IsQualifiedCrefName(this ExpressionSyntax expression)
+ {
+ return expression.IsParentKind(SyntaxKind.NameMemberCref) && expression.Parent.IsParentKind(SyntaxKind.QualifiedCref);
+ }
+
+ public static bool IsMemberAccessExpressionName(this ExpressionSyntax expression)
+ {
+ return (expression.IsParentKind(SyntaxKind.SimpleMemberAccessExpression) && ((MemberAccessExpressionSyntax)expression.Parent).Name == expression) ||
+ (IsMemberBindingExpressionName(expression));
+ }
+
+ public static bool IsAnyMemberAccessExpressionName(this ExpressionSyntax expression)
+ {
+ if (expression == null)
+ {
+ return false;
+ }
+
+ return expression == (expression.Parent as MemberAccessExpressionSyntax)?.Name ||
+ expression.IsMemberBindingExpressionName();
+ }
+
+ private static bool IsMemberBindingExpressionName(this ExpressionSyntax expression)
+ {
+ return expression.IsParentKind(SyntaxKind.MemberBindingExpression) &&
+ ((MemberBindingExpressionSyntax)expression.Parent).Name == expression;
+ }
+
+ public static bool IsRightSideOfQualifiedName(this ExpressionSyntax expression)
+ {
+ return expression.IsParentKind(SyntaxKind.QualifiedName) && ((QualifiedNameSyntax)expression.Parent).Right == expression;
+ }
+
+ public static bool IsRightSideOfColonColon(this ExpressionSyntax expression)
+ {
+ return expression.IsParentKind(SyntaxKind.AliasQualifiedName) && ((AliasQualifiedNameSyntax)expression.Parent).Name == expression;
+ }
+
+ public static bool IsRightSideOfDot(this ExpressionSyntax name)
+ {
+ return IsMemberAccessExpressionName(name) || IsRightSideOfQualifiedName(name) || IsQualifiedCrefName(name);
+ }
+
+ public static bool IsRightSideOfDotOrArrow(this ExpressionSyntax name)
+ {
+ return IsAnyMemberAccessExpressionName(name) || IsRightSideOfQualifiedName(name);
+ }
+
+ public static bool IsRightSideOfDotOrColonColon(this ExpressionSyntax name)
+ {
+ return IsRightSideOfDot(name) || IsRightSideOfColonColon(name);
+ }
+
+ public static bool IsRightSideOfDotOrArrowOrColonColon(this ExpressionSyntax name)
+ {
+ return IsRightSideOfDotOrArrow(name) || IsRightSideOfColonColon(name);
+ }
+
+ public static bool IsRightOfCloseParen(this ExpressionSyntax expression)
+ {
+ var firstToken = expression.GetFirstToken();
+ return firstToken.Kind() != SyntaxKind.None
+ && firstToken.GetPreviousToken().Kind() == SyntaxKind.CloseParenToken;
+ }
+
+ public static bool IsLeftSideOfDot(this ExpressionSyntax expression)
+ {
+ return
+ IsLeftSideOfQualifiedName(expression) ||
+ (expression.IsParentKind(SyntaxKind.SimpleMemberAccessExpression) && ((MemberAccessExpressionSyntax)expression.Parent).Expression == expression);
+ }
+
+ public static bool IsLeftSideOfDotOrArrow(this ExpressionSyntax expression)
+ {
+ return
+ IsLeftSideOfQualifiedName(expression) ||
+ (expression.Parent is MemberAccessExpressionSyntax && ((MemberAccessExpressionSyntax)expression.Parent).Expression == expression);
+ }
+
+ public static bool IsLeftSideOfQualifiedName(this ExpressionSyntax expression)
+ {
+ return
+ expression.IsParentKind(SyntaxKind.QualifiedName) && ((QualifiedNameSyntax)expression.Parent).Left == expression;
+ }
+
+ public static bool IsExpressionOfInvocation(this ExpressionSyntax expression)
+ {
+ return
+ expression.IsParentKind(SyntaxKind.InvocationExpression) && ((InvocationExpressionSyntax)expression.Parent).Expression == expression;
+ }
+
+ public static bool TryGetNameParts(this ExpressionSyntax expression, out IList<string> parts)
+ {
+ var partsList = new List<string>();
+ if (!TryGetNameParts(expression, partsList))
+ {
+ parts = null;
+ return false;
+ }
+
+ parts = partsList;
+ return true;
+ }
+
+ public static bool TryGetNameParts(this ExpressionSyntax expression, List<string> parts)
+ {
+ if (expression.IsKind(SyntaxKind.SimpleMemberAccessExpression))
+ {
+ var memberAccess = (MemberAccessExpressionSyntax)expression;
+ if (!TryGetNameParts(memberAccess.Expression, parts))
+ {
+ return false;
+ }
+
+ return AddSimpleName(memberAccess.Name, parts);
+ }
+ else if (expression.IsKind(SyntaxKind.QualifiedName))
+ {
+ var qualifiedName = (QualifiedNameSyntax)expression;
+ if (!TryGetNameParts(qualifiedName.Left, parts))
+ {
+ return false;
+ }
+
+ return AddSimpleName(qualifiedName.Right, parts);
+ }
+ else if (expression is SimpleNameSyntax)
+ {
+ return AddSimpleName((SimpleNameSyntax)expression, parts);
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ private static bool AddSimpleName(SimpleNameSyntax simpleName, List<string> parts)
+ {
+ if (!simpleName.IsKind(SyntaxKind.IdentifierName))
+ {
+ return false;
+ }
+
+ parts.Add(simpleName.Identifier.ValueText);
+ return true;
+ }
+
+ public static bool IsAnyLiteralExpression(this ExpressionSyntax expression)
+ {
+ return
+ expression.IsKind(SyntaxKind.CharacterLiteralExpression) ||
+ expression.IsKind(SyntaxKind.FalseLiteralExpression) ||
+ expression.IsKind(SyntaxKind.NullLiteralExpression) ||
+ expression.IsKind(SyntaxKind.NumericLiteralExpression) ||
+ expression.IsKind(SyntaxKind.StringLiteralExpression) ||
+ expression.IsKind(SyntaxKind.TrueLiteralExpression);
+ }
+
+ public static bool IsInConstantContext(this ExpressionSyntax expression)
+ {
+ if (expression.GetAncestor<ParameterSyntax>() != null)
+ {
+ return true;
+ }
+
+ var attributeArgument = expression.GetAncestor<AttributeArgumentSyntax>();
+ if (attributeArgument != null)
+ {
+ if (attributeArgument.NameEquals == null ||
+ expression != attributeArgument.NameEquals.Name)
+ {
+ return true;
+ }
+ }
+
+ // TODO(cyrusn): Add more cases.
+ return false;
+ }
+
+ public static bool IsInOutContext(this ExpressionSyntax expression)
+ {
+ var argument = expression.Parent as ArgumentSyntax;
+ return
+ argument != null &&
+ argument.Expression == expression &&
+ argument.RefOrOutKeyword.Kind() == SyntaxKind.OutKeyword;
+ }
+
+ public static bool IsInRefContext(this ExpressionSyntax expression)
+ {
+ var argument = expression.Parent as ArgumentSyntax;
+ return
+ argument != null &&
+ argument.Expression == expression &&
+ argument.RefOrOutKeyword.Kind() == SyntaxKind.RefKeyword;
+ }
+
+ public static bool IsOnlyWrittenTo(this ExpressionSyntax expression)
+ {
+ if (expression.IsRightSideOfDotOrArrow())
+ {
+ expression = expression.Parent as ExpressionSyntax;
+ }
+
+ if (expression != null)
+ {
+ if (expression.IsInOutContext())
+ {
+ return true;
+ }
+
+ if (expression.Parent != null)
+ {
+ if (expression.IsLeftSideOfAssignExpression())
+ {
+ return true;
+ }
+
+ var nameEquals = expression.Parent as NameEqualsSyntax;
+ if (nameEquals != null && nameEquals.IsParentKind(SyntaxKind.AttributeArgument))
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsWrittenTo(this ExpressionSyntax expression)
+ {
+ if (expression.IsOnlyWrittenTo())
+ {
+ return true;
+ }
+
+ if (expression.IsRightSideOfDotOrArrow())
+ {
+ expression = expression.Parent as ExpressionSyntax;
+ }
+
+ if (expression != null)
+ {
+ if (expression.IsInRefContext())
+ {
+ return true;
+ }
+
+ // We're written if we're used in a ++, or -- expression.
+ if (expression.Parent != null)
+ {
+ switch (expression.Parent.Kind())
+ {
+ case SyntaxKind.PostIncrementExpression:
+ case SyntaxKind.PreIncrementExpression:
+ case SyntaxKind.PostDecrementExpression:
+ case SyntaxKind.PreDecrementExpression:
+ return true;
+ }
+
+ if (expression.IsLeftSideOfAnyAssignExpression())
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsNamedArgumentIdentifier(this ExpressionSyntax expression)
+ {
+ return expression is IdentifierNameSyntax && expression.Parent is NameColonSyntax;
+ }
+
+ public static bool IsInsideNameOf(this ExpressionSyntax expression)
+ {
+ return expression.SyntaxTree.IsNameOfContext(expression.SpanStart);
+ }
+
+ private static bool CanReplace(ISymbol symbol)
+ {
+ switch (symbol.Kind)
+ {
+ case SymbolKind.Field:
+ case SymbolKind.Local:
+ case SymbolKind.Method:
+ case SymbolKind.Parameter:
+ case SymbolKind.Property:
+ case SymbolKind.RangeVariable:
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool CanReplaceWithRValue(
+ this ExpressionSyntax expression, SemanticModel semanticModel, CancellationToken cancellationToken)
+ {
+ // An RValue can't be written into.
+ // i.e. you can't replace "a" in "a = b" with "Foo() = b".
+ return
+ expression != null &&
+ !expression.IsWrittenTo() &&
+ CanReplaceWithLValue(expression, semanticModel, cancellationToken);
+ }
+
+ public static bool CanReplaceWithLValue(
+ this ExpressionSyntax expression, SemanticModel semanticModel, CancellationToken cancellationToken)
+ {
+ if (expression.IsKind(SyntaxKind.StackAllocArrayCreationExpression))
+ {
+ // Stack alloc is very interesting. While it appears to be an expression, it is only
+ // such so it can appear in a variable decl. It is not a normal expression that can
+ // go anywhere.
+ return false;
+ }
+
+ if (expression.IsKind(SyntaxKind.BaseExpression) ||
+ expression.IsKind(SyntaxKind.CollectionInitializerExpression) ||
+ expression.IsKind(SyntaxKind.ObjectInitializerExpression) ||
+ expression.IsKind(SyntaxKind.ComplexElementInitializerExpression))
+ {
+ return false;
+ }
+
+ // literal can be always replaced.
+ if (expression is LiteralExpressionSyntax && !expression.IsParentKind(SyntaxKind.UnaryMinusExpression))
+ {
+ return true;
+ }
+
+ if (!(expression is ObjectCreationExpressionSyntax) && !(expression is AnonymousObjectCreationExpressionSyntax))
+ {
+ var symbolInfo = semanticModel.GetSymbolInfo(expression, cancellationToken);
+ if (!symbolInfo.GetBestOrAllSymbols().All(CanReplace))
+ {
+ // If the expression is actually a reference to a type, then it can't be replaced
+ // with an arbitrary expression.
+ return false;
+ }
+ }
+
+ switch (expression.Parent.Kind())
+ {
+ case SyntaxKind.InvocationExpression:
+ // Technically, you could introduce an LValue for "Foo" in "Foo()" even if "Foo" binds
+ // to a method. (i.e. by assigning to a Func<...> type). However, this is so contrived
+ // and none of the features that use this extension consider this replaceable.
+ if (expression.IsKind(SyntaxKind.IdentifierName) || expression is MemberAccessExpressionSyntax)
+ {
+ // If it looks like a method then we don't allow it to be replaced if it is a
+ // method (or if it doesn't bind).
+
+ var symbolInfo = semanticModel.GetSymbolInfo(expression, cancellationToken);
+ return symbolInfo.GetBestOrAllSymbols().Any() && !symbolInfo.GetBestOrAllSymbols().Any(s => s is IMethodSymbol);
+ }
+ else
+ {
+ // It doesn't look like a method, we allow this to be replaced.
+ return true;
+ }
+
+ case SyntaxKind.IsExpression:
+ case SyntaxKind.AsExpression:
+ // Can't introduce a variable for the type portion of an is/as check.
+ var isOrAsExpression = (BinaryExpressionSyntax)expression.Parent;
+ return expression == isOrAsExpression.Left;
+ case SyntaxKind.EqualsValueClause:
+ case SyntaxKind.ExpressionStatement:
+ case SyntaxKind.ArrayInitializerExpression:
+ case SyntaxKind.CollectionInitializerExpression:
+ case SyntaxKind.ConditionalAccessExpression:
+ case SyntaxKind.Argument:
+ case SyntaxKind.AttributeArgument:
+ case SyntaxKind.AnonymousObjectMemberDeclarator:
+ case SyntaxKind.ArrowExpressionClause:
+ case SyntaxKind.AwaitExpression:
+ case SyntaxKind.ReturnStatement:
+ case SyntaxKind.YieldReturnStatement:
+ case SyntaxKind.ParenthesizedLambdaExpression:
+ case SyntaxKind.SimpleLambdaExpression:
+ case SyntaxKind.ParenthesizedExpression:
+ case SyntaxKind.ArrayRankSpecifier:
+ case SyntaxKind.ConditionalExpression:
+ case SyntaxKind.IfStatement:
+ case SyntaxKind.CatchFilterClause:
+ case SyntaxKind.WhileStatement:
+ case SyntaxKind.DoStatement:
+ case SyntaxKind.ThrowStatement:
+ case SyntaxKind.SwitchStatement:
+ // TODO: uncomment on roslyn update
+ //case SyntaxKind.InterpolatedStringExpression:
+ case SyntaxKind.ComplexElementInitializerExpression:
+
+ // TODO: uncomment on roslyn update
+ // case SyntaxKind.Interpolation:
+ // Direct parent kind checks.
+ return true;
+ }
+
+ if (expression.Parent is PrefixUnaryExpressionSyntax)
+ {
+ if (!(expression is LiteralExpressionSyntax && expression.IsParentKind(SyntaxKind.UnaryMinusExpression)))
+ {
+ return true;
+ }
+ }
+
+ var parentNonExpression = expression.GetAncestors().SkipWhile(n => n is ExpressionSyntax).FirstOrDefault();
+ var topExpression = expression;
+ while (topExpression.Parent is TypeSyntax)
+ {
+ topExpression = (TypeSyntax)topExpression.Parent;
+ }
+
+ if (parentNonExpression != null &&
+ parentNonExpression.IsKind(SyntaxKind.FromClause) &&
+ topExpression != null &&
+ ((FromClauseSyntax)parentNonExpression).Type == topExpression)
+ {
+ return false;
+ }
+
+ // Parent type checks.
+ if (expression.Parent is PostfixUnaryExpressionSyntax ||
+ expression.Parent is BinaryExpressionSyntax ||
+ expression.Parent is AssignmentExpressionSyntax ||
+ expression.Parent is QueryClauseSyntax ||
+ expression.Parent is SelectOrGroupClauseSyntax ||
+ expression.Parent is CheckedExpressionSyntax)
+ {
+ return true;
+ }
+
+ // Specific child checks.
+ if (expression.CheckParent<ForEachStatementSyntax>(f => f.Expression == expression) ||
+ expression.CheckParent<MemberAccessExpressionSyntax>(m => m.Expression == expression) ||
+ expression.CheckParent<CastExpressionSyntax>(c => c.Expression == expression))
+ {
+ return true;
+ }
+
+ // Misc checks.
+ if ((expression.IsParentKind(SyntaxKind.NameEquals) && expression.Parent.IsParentKind(SyntaxKind.AttributeArgument)) ||
+ expression.IsLeftSideOfAnyAssignExpression())
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+// public static bool CanAccessInstanceAndStaticMembersOffOf(
+// this ExpressionSyntax expression,
+// SemanticModel semanticModel,
+// CancellationToken cancellationToken)
+// {
+// // Check for the Color Color case.
+// //
+// // color color: if you bind "A" and you get a symbol and the type of that symbol is
+// // Q; and if you bind "A" *again* as a type and you get type Q, then both A.static
+// // and A.instance are permitted
+// if (expression is IdentifierNameSyntax)
+// {
+// var instanceSymbol = semanticModel.GetSymbolInfo(expression, cancellationToken).GetAnySymbol();
+//
+// if (!(instanceSymbol is INamespaceOrTypeSymbol))
+// {
+// var instanceType = instanceSymbol.GetSymbolType();
+// if (instanceType != null)
+// {
+// var speculativeSymbolInfo = semanticModel.GetSpeculativeSymbolInfo(expression.SpanStart, expression, SpeculativeBindingOption.BindAsTypeOrNamespace);
+// if (speculativeSymbolInfo.CandidateReason != CandidateReason.NotATypeOrNamespace)
+// {
+// var staticType = speculativeSymbolInfo.GetAnySymbol().GetSymbolType();
+//
+// return SymbolEquivalenceComparer.Instance.Equals(instanceType, staticType);
+// }
+// }
+// }
+// }
+//
+// return false;
+// }
+
+ readonly static MethodInfo tryReduceOrSimplifyExplicitNameMethod;
+
+ public static bool TryReduceOrSimplifyExplicitName(
+ this ExpressionSyntax expression,
+ SemanticModel semanticModel,
+ out ExpressionSyntax replacementNode,
+ out TextSpan issueSpan,
+ OptionSet optionSet,
+ CancellationToken cancellationToken)
+ {
+ try {
+ var args = new object[] { expression, semanticModel, default(ExpressionSyntax), default(TextSpan), optionSet, cancellationToken };
+ var result = (bool)tryReduceOrSimplifyExplicitNameMethod.Invoke (null, args);
+ replacementNode = (ExpressionSyntax)args [2];
+ issueSpan = (TextSpan)args [3];
+ return result;
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ throw ex;
+ }
+ }
+
+// public static bool TryReduceExplicitName(
+// this ExpressionSyntax expression,
+// SemanticModel semanticModel,
+// out TypeSyntax replacementNode,
+// out TextSpan issueSpan,
+// OptionSet optionSet,
+// CancellationToken cancellationToken)
+// {
+// replacementNode = null;
+// issueSpan = default(TextSpan);
+//
+// if (expression.ContainsInterleavedDirective(cancellationToken))
+// {
+// return false;
+// }
+//
+// if (expression.Kind() == SyntaxKind.SimpleMemberAccessExpression)
+// {
+// var memberAccess = (MemberAccessExpressionSyntax)expression;
+// return memberAccess.TryReduce(semanticModel, out replacementNode, out issueSpan, optionSet, cancellationToken);
+// }
+// else if (expression is NameSyntax)
+// {
+// var name = (NameSyntax)expression;
+// return name.TryReduce(semanticModel, out replacementNode, out issueSpan, optionSet, cancellationToken);
+// }
+// else if (expression is TypeSyntax)
+// {
+// var typeName = (TypeSyntax)expression;
+// return typeName.IsReplacableByVar(semanticModel, out replacementNode, out issueSpan, optionSet, cancellationToken);
+// }
+//
+// return false;
+// }
+//
+// private static bool TryReduce(
+// this MemberAccessExpressionSyntax memberAccess,
+// SemanticModel semanticModel,
+// out TypeSyntax replacementNode,
+// out TextSpan issueSpan,
+// OptionSet optionSet,
+// CancellationToken cancellationToken)
+// {
+// replacementNode = null;
+// issueSpan = default(TextSpan);
+//
+// if (memberAccess.Name == null || memberAccess.Expression == null)
+// {
+// return false;
+// }
+//
+// if (optionSet.GetOption(SimplificationOptions.QualifyMemberAccessWithThisOrMe, semanticModel.Language) &&
+// memberAccess.Expression.Kind() == SyntaxKind.ThisExpression)
+// {
+// return false;
+// }
+//
+// // if this node is annotated as being a specialtype, let's use this information.
+// if (memberAccess.HasAnnotations(SpecialTypeAnnotation.Kind))
+// {
+// replacementNode = SyntaxFactory.PredefinedType(
+// SyntaxFactory.Token(
+// memberAccess.GetLeadingTrivia(),
+// GetPredefinedKeywordKind(SpecialTypeAnnotation.GetSpecialType(memberAccess.GetAnnotations(SpecialTypeAnnotation.Kind).First())),
+// memberAccess.GetTrailingTrivia()));
+//
+// issueSpan = memberAccess.Span;
+//
+// return true;
+// }
+//
+// // if this node is on the left side, we could simplify to aliases
+// if (!memberAccess.IsRightSideOfDot())
+// {
+// // Check if we need to replace this syntax with an alias identifier
+// IAliasSymbol aliasReplacement;
+// if (memberAccess.TryReplaceWithAlias(semanticModel, optionSet.GetOption(SimplificationOptions.PreferAliasToQualification), cancellationToken, out aliasReplacement))
+// {
+// // get the token text as it appears in source code to preserve e.g. unicode character escaping
+// var text = aliasReplacement.Name;
+// var syntaxRef = aliasReplacement.DeclaringSyntaxReferences.FirstOrDefault();
+//
+// if (syntaxRef != null)
+// {
+// var declIdentifier = ((UsingDirectiveSyntax)syntaxRef.GetSyntax(cancellationToken)).Alias.Name.Identifier;
+// text = declIdentifier.IsVerbatimIdentifier() ? declIdentifier.ToString().Substring(1) : declIdentifier.ToString();
+// }
+//
+// replacementNode = SyntaxFactory.IdentifierName(
+// memberAccess.Name.Identifier.CopyAnnotationsTo(SyntaxFactory.Identifier(
+// memberAccess.GetLeadingTrivia(),
+// SyntaxKind.IdentifierToken,
+// text,
+// aliasReplacement.Name,
+// memberAccess.GetTrailingTrivia())));
+//
+// replacementNode = memberAccess.CopyAnnotationsTo(replacementNode);
+// replacementNode = memberAccess.Name.CopyAnnotationsTo(replacementNode);
+//
+// issueSpan = memberAccess.Span;
+//
+// // In case the alias name is the same as the last name of the alias target, we only include
+// // the left part of the name in the unnecessary span to Not confuse uses.
+// if (memberAccess.Name.Identifier.ValueText == ((IdentifierNameSyntax)replacementNode).Identifier.ValueText)
+// {
+// issueSpan = memberAccess.Expression.Span;
+// }
+//
+// return true;
+// }
+//
+// // Check if the Expression can be replaced by Predefined Type keyword
+// if (PreferPredefinedTypeKeywordInMemberAccess(memberAccess, optionSet, semanticModel))
+// {
+// var symbol = semanticModel.GetSymbolInfo(memberAccess, cancellationToken).Symbol;
+// if (symbol != null && symbol.IsKind(SymbolKind.NamedType))
+// {
+// var keywordKind = GetPredefinedKeywordKind(((INamedTypeSymbol)symbol).SpecialType);
+// if (keywordKind != SyntaxKind.None)
+// {
+// replacementNode = CreatePredefinedTypeSyntax(memberAccess, keywordKind);
+//
+// issueSpan = memberAccess.Span; // we want to show the whole expression as unnecessary
+//
+// return true;
+// }
+// }
+// }
+// }
+//
+// replacementNode = memberAccess.Name.WithLeadingTrivia(memberAccess.GetLeadingTrivia()).WithTrailingTrivia(memberAccess.GetTrailingTrivia());
+// issueSpan = memberAccess.Expression.Span;
+//
+// if (replacementNode == null)
+// {
+// return false;
+// }
+//
+// return memberAccess.CanReplaceWithReducedName(replacementNode, semanticModel, cancellationToken);
+// }
+
+ private static bool InsideCrefReference(ExpressionSyntax expr)
+ {
+ var crefAttribute = expr.FirstAncestorOrSelf<XmlCrefAttributeSyntax>();
+ return crefAttribute != null;
+ }
+
+ private static bool InsideNameOfExpression(ExpressionSyntax expr, SemanticModel semanticModel)
+ {
+ var nameOfInvocationExpr = expr.FirstAncestorOrSelf<InvocationExpressionSyntax>(
+ invocationExpr =>
+ {
+ var expression = invocationExpr.Expression as IdentifierNameSyntax;
+ return (expression != null) && (expression.Identifier.Text == "nameof") &&
+ semanticModel.GetConstantValue(invocationExpr).HasValue &&
+ (semanticModel.GetTypeInfo(invocationExpr).Type.SpecialType == SpecialType.System_String);
+ });
+
+ return nameOfInvocationExpr != null;
+ }
+
+ private static bool PreferPredefinedTypeKeywordInDeclarations(NameSyntax name, OptionSet optionSet, SemanticModel semanticModel)
+ {
+ return (name.Parent != null) && !(name.Parent is MemberAccessExpressionSyntax) &&
+ !InsideCrefReference(name) && !InsideNameOfExpression(name, semanticModel) &&
+ optionSet.GetOption(SimplificationOptions.PreferIntrinsicPredefinedTypeKeywordInDeclaration, LanguageNames.CSharp);
+ }
+
+ private static bool PreferPredefinedTypeKeywordInMemberAccess(ExpressionSyntax memberAccess, OptionSet optionSet, SemanticModel semanticModel)
+ {
+ return (((memberAccess.Parent != null) && (memberAccess.Parent is MemberAccessExpressionSyntax)) || InsideCrefReference(memberAccess)) &&
+ !InsideNameOfExpression(memberAccess, semanticModel) &&
+ optionSet.GetOption(SimplificationOptions.PreferIntrinsicPredefinedTypeKeywordInMemberAccess, LanguageNames.CSharp);
+ }
+
+ public static bool IsAliasReplaceableExpression(this ExpressionSyntax expression)
+ {
+ if (expression.Kind() == SyntaxKind.IdentifierName ||
+ expression.Kind() == SyntaxKind.QualifiedName ||
+ expression.Kind() == SyntaxKind.AliasQualifiedName)
+ {
+ return true;
+ }
+
+ if (expression.Kind() == SyntaxKind.SimpleMemberAccessExpression)
+ {
+ var memberAccess = (MemberAccessExpressionSyntax)expression;
+ return memberAccess.Expression != null && memberAccess.Expression.IsAliasReplaceableExpression();
+ }
+
+ return false;
+ }
+//
+// private static bool TryReplaceWithAlias(this ExpressionSyntax node, SemanticModel semanticModel, bool preferAliasToQualifiedName, CancellationToken cancellationToken, out IAliasSymbol aliasReplacement)
+// {
+// aliasReplacement = null;
+//
+// if (!node.IsAliasReplaceableExpression())
+// {
+// return false;
+// }
+//
+// var symbol = semanticModel.GetSymbolInfo(node, cancellationToken).Symbol;
+//
+// // If the Symbol is a contrcutor get its containing type
+// if (symbol.IsConstructor())
+// {
+// symbol = symbol.ContainingType;
+// }
+//
+// if (node is QualifiedNameSyntax || node is AliasQualifiedNameSyntax)
+// {
+// SyntaxAnnotation aliasAnnotationInfo = null;
+//
+// // The following condition checks if the user has used alias in the original code and
+// // if so the expression is replaced with the Alias
+// if (node is QualifiedNameSyntax)
+// {
+// var qualifiedNameNode = (QualifiedNameSyntax)node;
+// if (qualifiedNameNode.Right.Identifier.HasAnnotations(AliasAnnotation.Kind))
+// {
+// aliasAnnotationInfo = qualifiedNameNode.Right.Identifier.GetAnnotations(AliasAnnotation.Kind).Single();
+// }
+// }
+//
+// if (node is AliasQualifiedNameSyntax)
+// {
+// var aliasQualifiedNameNode = (AliasQualifiedNameSyntax)node;
+// if (aliasQualifiedNameNode.Name.Identifier.HasAnnotations(AliasAnnotation.Kind))
+// {
+// aliasAnnotationInfo = aliasQualifiedNameNode.Name.Identifier.GetAnnotations(AliasAnnotation.Kind).Single();
+// }
+// }
+//
+// if (aliasAnnotationInfo != null)
+// {
+// var aliasName = AliasAnnotation.GetAliasName(aliasAnnotationInfo);
+// var aliasIdentifier = SyntaxFactory.IdentifierName(aliasName);
+//
+// var aliasTypeInfo = semanticModel.GetSpeculativeAliasInfo(node.SpanStart, aliasIdentifier, SpeculativeBindingOption.BindAsTypeOrNamespace);
+//
+// if (aliasTypeInfo != null)
+// {
+// aliasReplacement = aliasTypeInfo;
+// return ValidateAliasForTarget(aliasReplacement, semanticModel, node, symbol);
+// }
+// }
+// }
+//
+// if (node.Kind() == SyntaxKind.IdentifierName &&
+// semanticModel.GetAliasInfo((IdentifierNameSyntax)node, cancellationToken) != null)
+// {
+// return false;
+// }
+//
+// // an alias can only replace a type or namespace
+// if (symbol == null ||
+// (symbol.Kind != SymbolKind.Namespace && symbol.Kind != SymbolKind.NamedType))
+// {
+// return false;
+// }
+//
+// if (node is QualifiedNameSyntax)
+// {
+// var qualifiedName = (QualifiedNameSyntax)node;
+// if (!qualifiedName.Right.HasAnnotation(Simplifier.SpecialTypeAnnotation))
+// {
+// var type = semanticModel.GetTypeInfo(node, cancellationToken).Type;
+// if (type != null)
+// {
+// var keywordKind = GetPredefinedKeywordKind(type.SpecialType);
+// if (keywordKind != SyntaxKind.None)
+// {
+// preferAliasToQualifiedName = false;
+// }
+// }
+// }
+// }
+//
+// if (node is AliasQualifiedNameSyntax)
+// {
+// var aliasQualifiedNameSyntax = (AliasQualifiedNameSyntax)node;
+// if (!aliasQualifiedNameSyntax.Name.HasAnnotation(Simplifier.SpecialTypeAnnotation))
+// {
+// var type = semanticModel.GetTypeInfo(node, cancellationToken).Type;
+// if (type != null)
+// {
+// var keywordKind = GetPredefinedKeywordKind(type.SpecialType);
+// if (keywordKind != SyntaxKind.None)
+// {
+// preferAliasToQualifiedName = false;
+// }
+// }
+// }
+// }
+//
+// aliasReplacement = GetAliasForSymbol((INamespaceOrTypeSymbol)symbol, node.GetFirstToken(), semanticModel, cancellationToken);
+// if (aliasReplacement != null && preferAliasToQualifiedName)
+// {
+// return ValidateAliasForTarget(aliasReplacement, semanticModel, node, symbol);
+// }
+//
+// return false;
+// }
+//
+ // We must verify that the alias actually binds back to the thing it's aliasing.
+ // It's possible there's another symbol with the same name as the alias that binds
+ // first
+ private static bool ValidateAliasForTarget(IAliasSymbol aliasReplacement, SemanticModel semanticModel, ExpressionSyntax node, ISymbol symbol)
+ {
+ var aliasName = aliasReplacement.Name;
+
+ var boundSymbols = semanticModel.LookupNamespacesAndTypes(node.SpanStart, name: aliasName);
+
+ if (boundSymbols.Length == 1)
+ {
+ var boundAlias = boundSymbols[0] as IAliasSymbol;
+ if (boundAlias != null && aliasReplacement.Target.Equals(symbol))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+// public static IAliasSymbol GetAliasForSymbol(INamespaceOrTypeSymbol symbol, SyntaxToken token, SemanticModel semanticModel, CancellationToken cancellationToken)
+// {
+// var originalSemanticModel = (SemanticModel)semanticModel.GetOriginalSemanticModel();
+// if (!originalSemanticModel.SyntaxTree.HasCompilationUnitRoot)
+// {
+// return null;
+// }
+//
+// IAliasSymbol aliasSymbol;
+// var namespaceId = GetNamespaceIdForAliasSearch(semanticModel, token, cancellationToken);
+// if (namespaceId < 0)
+// {
+// return null;
+// }
+//
+// if (!AliasSymbolCache.TryGetAliasSymbol(originalSemanticModel, namespaceId, symbol, out aliasSymbol))
+// {
+// // add cache
+// AliasSymbolCache.AddAliasSymbols(originalSemanticModel, namespaceId, semanticModel.LookupNamespacesAndTypes(token.SpanStart).OfType<IAliasSymbol>());
+//
+// // retry
+// AliasSymbolCache.TryGetAliasSymbol(originalSemanticModel, namespaceId, symbol, out aliasSymbol);
+// }
+//
+// return aliasSymbol;
+// }
+//
+// private static SyntaxNode GetStartNodeForNamespaceId(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken)
+// {
+// if (!semanticModel.IsSpeculativeSemanticModel)
+// {
+// return token.Parent;
+// }
+//
+// var originalSemanticMode = (SemanticModel)semanticModel.GetOriginalSemanticModel();
+// token = originalSemanticMode.SyntaxTree.GetRoot(cancellationToken).FindToken(semanticModel.OriginalPositionForSpeculation);
+//
+// return token.Parent;
+// }
+
+// private static int GetNamespaceIdForAliasSearch(SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken)
+// {
+// var startNode = GetStartNodeForNamespaceId(semanticModel, token, cancellationToken);
+// if (!startNode.SyntaxTree.HasCompilationUnitRoot)
+// {
+// return -1;
+// }
+//
+// // NOTE: If we're currently in a block of usings, then we want to collect the
+// // aliases that are higher up than this block. Using aliases declared in a block of
+// // usings are not usable from within that same block.
+// var usingDirective = startNode.GetAncestorOrThis<UsingDirectiveSyntax>();
+// if (usingDirective != null)
+// {
+// startNode = usingDirective.Parent.Parent;
+// if (startNode == null)
+// {
+// return -1;
+// }
+// }
+//
+// // check whether I am under a namespace
+// var @namespace = startNode.GetAncestorOrThis<NamespaceDeclarationSyntax>();
+// if (@namespace != null)
+// {
+// // since we have node inside of the root, root should be already there
+// // search for namespace id should be quite cheap since normally there should be
+// // only a few namespace defined in a source file if it is not 1. that is why it is
+// // not cached.
+// var startIndex = 1;
+// return GetNamespaceId(startNode.SyntaxTree.GetRoot(cancellationToken), @namespace, ref startIndex);
+// }
+//
+// // no namespace, under compilation unit directly
+// return 0;
+// }
+//
+// private static int GetNamespaceId(SyntaxNode container, NamespaceDeclarationSyntax target, ref int index)
+// {
+// var compilation = container as CompilationUnitSyntax;
+// if (compilation != null)
+// {
+// return GetNamespaceId(compilation.Members, target, ref index);
+// }
+//
+// var @namespace = container as NamespaceDeclarationSyntax;
+// if (@namespace != null)
+// {
+// return GetNamespaceId(@namespace.Members, target, ref index);
+// }
+//
+// return Contract.FailWithReturn<int>("shouldn't reach here");
+// }
+//
+// private static int GetNamespaceId(SyntaxList<MemberDeclarationSyntax> members, NamespaceDeclarationSyntax target, ref int index)
+// {
+// foreach (var member in members)
+// {
+// var childNamespace = member as NamespaceDeclarationSyntax;
+// if (childNamespace == null)
+// {
+// continue;
+// }
+//
+// if (childNamespace == target)
+// {
+// return index;
+// }
+//
+// index++;
+// var result = GetNamespaceId(childNamespace, target, ref index);
+// if (result > 0)
+// {
+// return result;
+// }
+// }
+//
+// return -1;
+// }
+//
+// private static bool TryReduce(
+// this NameSyntax name,
+// SemanticModel semanticModel,
+// out TypeSyntax replacementNode,
+// out TextSpan issueSpan,
+// OptionSet optionSet,
+// CancellationToken cancellationToken)
+// {
+// replacementNode = null;
+// issueSpan = default(TextSpan);
+//
+// if (name.IsVar)
+// {
+// return false;
+// }
+//
+// // we should not simplify a name of a namespace declaration
+// if (IsPartOfNamespaceDeclarationName(name))
+// {
+// return false;
+// }
+//
+// // We can simplify Qualified names and AliasQualifiedNames. Generally, if we have
+// // something like "A.B.C.D", we only consider the full thing something we can simplify.
+// // However, in the case of "A.B.C<>.D", then we'll only consider simplifying up to the
+// // first open name. This is because if we remove the open name, we'll often change
+// // meaning as "D" will bind to C<T>.D which is different than C<>.D!
+// if (name is QualifiedNameSyntax)
+// {
+// var left = ((QualifiedNameSyntax)name).Left;
+// if (ContainsOpenName(left))
+// {
+// // Don't simplify A.B<>.C
+// return false;
+// }
+// }
+//
+// // 1. see whether binding the name binds to a symbol/type. if not, it is ambiguous and
+// // nothing we can do here.
+// var symbol = SimplificationHelpers.GetOriginalSymbolInfo(semanticModel, name);
+// if (symbol == null)
+// {
+// return false;
+// }
+//
+// // treat constructor names as types
+// var method = symbol as IMethodSymbol;
+// if (method.IsConstructor())
+// {
+// symbol = method.ContainingType;
+// }
+//
+// if (symbol.Kind == SymbolKind.Method && name.Kind() == SyntaxKind.GenericName)
+// {
+// // The option wants the generic method invocation name to be explicit, then quit the reduction
+// if (!optionSet.GetOption(SimplificationOptions.PreferImplicitTypeInference))
+// {
+// return false;
+// }
+//
+// var genericName = (GenericNameSyntax)name;
+// replacementNode = SyntaxFactory.IdentifierName(genericName.Identifier)
+// .WithLeadingTrivia(genericName.GetLeadingTrivia())
+// .WithTrailingTrivia(genericName.GetTrailingTrivia());
+//
+// issueSpan = genericName.TypeArgumentList.Span;
+// return name.CanReplaceWithReducedName(replacementNode, semanticModel, cancellationToken);
+// }
+//
+// if (!(symbol is INamespaceOrTypeSymbol))
+// {
+// return false;
+// }
+//
+// if (name.HasAnnotations(SpecialTypeAnnotation.Kind))
+// {
+// replacementNode = SyntaxFactory.PredefinedType(
+// SyntaxFactory.Token(
+// name.GetLeadingTrivia(),
+// GetPredefinedKeywordKind(SpecialTypeAnnotation.GetSpecialType(name.GetAnnotations(SpecialTypeAnnotation.Kind).First())),
+// name.GetTrailingTrivia()));
+//
+// issueSpan = name.Span;
+//
+// return name.CanReplaceWithReducedNameInContext(replacementNode, semanticModel, cancellationToken);
+// }
+// else
+// {
+// if (!name.IsRightSideOfDotOrColonColon())
+// {
+// IAliasSymbol aliasReplacement;
+// if (name.TryReplaceWithAlias(semanticModel, optionSet.GetOption(SimplificationOptions.PreferAliasToQualification), cancellationToken, out aliasReplacement))
+// {
+// // get the token text as it appears in source code to preserve e.g. unicode character escaping
+// var text = aliasReplacement.Name;
+// var syntaxRef = aliasReplacement.DeclaringSyntaxReferences.FirstOrDefault();
+//
+// if (syntaxRef != null)
+// {
+// var declIdentifier = ((UsingDirectiveSyntax)syntaxRef.GetSyntax(cancellationToken)).Alias.Name.Identifier;
+// text = declIdentifier.IsVerbatimIdentifier() ? declIdentifier.ToString().Substring(1) : declIdentifier.ToString();
+// }
+//
+// var identifierToken = SyntaxFactory.Identifier(
+// name.GetLeadingTrivia(),
+// SyntaxKind.IdentifierToken,
+// text,
+// aliasReplacement.Name,
+// name.GetTrailingTrivia());
+//
+// identifierToken = CSharpSimplificationService.TryEscapeIdentifierToken(identifierToken, name, semanticModel);
+// replacementNode = SyntaxFactory.IdentifierName(identifierToken);
+//
+// // Merge annotation to new syntax node
+// var annotatedNodesOrTokens = name.GetAnnotatedNodesAndTokens(RenameAnnotation.Kind);
+// foreach (var annotatedNodeOrToken in annotatedNodesOrTokens)
+// {
+// if (annotatedNodeOrToken.IsToken)
+// {
+// identifierToken = annotatedNodeOrToken.AsToken().CopyAnnotationsTo(identifierToken);
+// }
+// else
+// {
+// replacementNode = annotatedNodeOrToken.AsNode().CopyAnnotationsTo(replacementNode);
+// }
+// }
+//
+// annotatedNodesOrTokens = name.GetAnnotatedNodesAndTokens(AliasAnnotation.Kind);
+// foreach (var annotatedNodeOrToken in annotatedNodesOrTokens)
+// {
+// if (annotatedNodeOrToken.IsToken)
+// {
+// identifierToken = annotatedNodeOrToken.AsToken().CopyAnnotationsTo(identifierToken);
+// }
+// else
+// {
+// replacementNode = annotatedNodeOrToken.AsNode().CopyAnnotationsTo(replacementNode);
+// }
+// }
+//
+// replacementNode = ((SimpleNameSyntax)replacementNode).WithIdentifier(identifierToken);
+// issueSpan = name.Span;
+//
+// // In case the alias name is the same as the last name of the alias target, we only include
+// // the left part of the name in the unnecessary span to Not confuse uses.
+// if (name.Kind() == SyntaxKind.QualifiedName)
+// {
+// QualifiedNameSyntax qualifiedName = (QualifiedNameSyntax)name;
+//
+// if (qualifiedName.Right.Identifier.ValueText == identifierToken.ValueText)
+// {
+// issueSpan = qualifiedName.Left.Span;
+// }
+// }
+//
+// // first check if this would be a valid reduction
+// if (name.CanReplaceWithReducedNameInContext(replacementNode, semanticModel, cancellationToken))
+// {
+// // in case this alias name ends with "Attribute", we're going to see if we can also
+// // remove that suffix.
+// TypeSyntax replacementNodeWithoutAttributeSuffix;
+// TextSpan issueSpanWithoutAttributeSuffix;
+// if (TryReduceAttributeSuffix(
+// name,
+// identifierToken,
+// semanticModel,
+// out replacementNodeWithoutAttributeSuffix,
+// out issueSpanWithoutAttributeSuffix,
+// cancellationToken))
+// {
+// if (name.CanReplaceWithReducedName(replacementNodeWithoutAttributeSuffix, semanticModel, cancellationToken))
+// {
+// replacementNode = replacementNode.CopyAnnotationsTo(replacementNodeWithoutAttributeSuffix);
+// issueSpan = issueSpanWithoutAttributeSuffix;
+// }
+// }
+//
+// return true;
+// }
+//
+// return false;
+// }
+//
+// var nameHasNoAlias = false;
+//
+// if (name is SimpleNameSyntax)
+// {
+// var simpleName = (SimpleNameSyntax)name;
+// if (!simpleName.Identifier.HasAnnotations(AliasAnnotation.Kind))
+// {
+// nameHasNoAlias = true;
+// }
+// }
+//
+// if (name is QualifiedNameSyntax)
+// {
+// var qualifiedName = (QualifiedNameSyntax)name;
+// if (!qualifiedName.Right.HasAnnotation(Simplifier.SpecialTypeAnnotation))
+// {
+// nameHasNoAlias = true;
+// }
+// }
+//
+// if (name is AliasQualifiedNameSyntax)
+// {
+// var aliasQualifiedName = (AliasQualifiedNameSyntax)name;
+// if (aliasQualifiedName.Name is SimpleNameSyntax &&
+// !aliasQualifiedName.Name.Identifier.HasAnnotations(AliasAnnotation.Kind) &&
+// !aliasQualifiedName.Name.HasAnnotation(Simplifier.SpecialTypeAnnotation))
+// {
+// nameHasNoAlias = true;
+// }
+// }
+//
+// var aliasInfo = semanticModel.GetAliasInfo(name, cancellationToken);
+// if (nameHasNoAlias && aliasInfo == null)
+// {
+// if (IsReplacableByVar(name, semanticModel, out replacementNode, out issueSpan, optionSet, cancellationToken))
+// {
+// return true;
+// }
+//
+// if (PreferPredefinedTypeKeywordInDeclarations(name, optionSet, semanticModel) ||
+// PreferPredefinedTypeKeywordInMemberAccess(name, optionSet, semanticModel))
+// {
+// var type = semanticModel.GetTypeInfo(name, cancellationToken).Type;
+// if (type != null)
+// {
+// var keywordKind = GetPredefinedKeywordKind(type.SpecialType);
+// if (keywordKind != SyntaxKind.None)
+// {
+// return CanReplaceWithPredefinedTypeKeywordInContext(name, semanticModel, out replacementNode, ref issueSpan, keywordKind, cancellationToken);
+// }
+// }
+// else
+// {
+// var typeSymbol = semanticModel.GetSymbolInfo(name, cancellationToken).Symbol;
+// if (typeSymbol.IsKind(SymbolKind.NamedType))
+// {
+// var keywordKind = GetPredefinedKeywordKind(((INamedTypeSymbol)typeSymbol).SpecialType);
+// if (keywordKind != SyntaxKind.None)
+// {
+// return CanReplaceWithPredefinedTypeKeywordInContext(name, semanticModel, out replacementNode, ref issueSpan, keywordKind, cancellationToken);
+// }
+// }
+// }
+// }
+// }
+//
+// // nullable rewrite: Nullable<int> -> int?
+// // Don't rewrite in the case where Nullable<int> is part of some qualified name like Nullable<int>.Something
+// if (!name.IsVar && (symbol.Kind == SymbolKind.NamedType) && !name.IsLeftSideOfQualifiedName())
+// {
+// var type = (INamedTypeSymbol)symbol;
+// if (!type.IsUnboundGenericType && // Don't rewrite unbound generic type "Nullable<>"
+// type.IsNullable() &&
+// aliasInfo == null)
+// {
+// GenericNameSyntax genericName;
+// if (name.Kind() == SyntaxKind.QualifiedName)
+// {
+// genericName = (GenericNameSyntax)((QualifiedNameSyntax)name).Right;
+// }
+// else
+// {
+// genericName = (GenericNameSyntax)name;
+// }
+//
+// var oldType = genericName.TypeArgumentList.Arguments.First();
+// if (oldType.Kind() == SyntaxKind.OmittedTypeArgument)
+// {
+// return false;
+// }
+//
+// replacementNode = SyntaxFactory.NullableType(oldType)
+// .WithLeadingTrivia(name.GetLeadingTrivia())
+// .WithTrailingTrivia(name.GetTrailingTrivia());
+// issueSpan = name.Span;
+//
+// // we need to simplify the whole qualified name at once, because replacing the identifier on the left in
+// // System.Nullable<int> alone would be illegal.
+// // If this fails we want to continue to try at least to remove the System if possible.
+// if (name.CanReplaceWithReducedNameInContext(replacementNode, semanticModel, cancellationToken))
+// {
+// return true;
+// }
+// }
+// }
+// }
+//
+// SyntaxToken identifier;
+// switch (name.Kind())
+// {
+// case SyntaxKind.AliasQualifiedName:
+// var simpleName = ((AliasQualifiedNameSyntax)name).Name
+// .WithLeadingTrivia(name.GetLeadingTrivia());
+//
+// simpleName = simpleName.ReplaceToken(simpleName.Identifier,
+// ((AliasQualifiedNameSyntax)name).Name.Identifier.CopyAnnotationsTo(
+// simpleName.Identifier.WithLeadingTrivia(
+// ((AliasQualifiedNameSyntax)name).Alias.Identifier.LeadingTrivia)));
+//
+// replacementNode = simpleName;
+//
+// issueSpan = ((AliasQualifiedNameSyntax)name).Alias.Span;
+//
+// break;
+//
+// case SyntaxKind.QualifiedName:
+// replacementNode = ((QualifiedNameSyntax)name).Right.WithLeadingTrivia(name.GetLeadingTrivia());
+// issueSpan = ((QualifiedNameSyntax)name).Left.Span;
+//
+// break;
+//
+// case SyntaxKind.IdentifierName:
+// identifier = ((IdentifierNameSyntax)name).Identifier;
+//
+// // we can try to remove the Attribute suffix if this is the attribute name
+// TryReduceAttributeSuffix(name, identifier, semanticModel, out replacementNode, out issueSpan, cancellationToken);
+// break;
+// }
+// }
+//
+// if (replacementNode == null)
+// {
+// return false;
+// }
+//
+// return name.CanReplaceWithReducedName(replacementNode, semanticModel, cancellationToken);
+// }
+//
+// private static bool CanReplaceWithPredefinedTypeKeywordInContext(NameSyntax name, SemanticModel semanticModel, out TypeSyntax replacementNode, ref TextSpan issueSpan, SyntaxKind keywordKind, CancellationToken cancellationToken)
+// {
+// replacementNode = CreatePredefinedTypeSyntax(name, keywordKind);
+//
+// issueSpan = name.Span; // we want to show the whole name expression as unnecessary
+//
+// return name.CanReplaceWithReducedNameInContext(replacementNode, semanticModel, cancellationToken);
+// }
+//
+// private static TypeSyntax CreatePredefinedTypeSyntax(ExpressionSyntax expression, SyntaxKind keywordKind)
+// {
+// return SyntaxFactory.PredefinedType(SyntaxFactory.Token(expression.GetLeadingTrivia(), keywordKind, expression.GetTrailingTrivia()));
+// }
+//
+// private static bool TryReduceAttributeSuffix(
+// NameSyntax name,
+// SyntaxToken identifierToken,
+// SemanticModel semanticModel,
+// out TypeSyntax replacementNode,
+// out TextSpan issueSpan,
+// CancellationToken cancellationToken)
+// {
+// issueSpan = default(TextSpan);
+// replacementNode = default(TypeSyntax);
+//
+// // we can try to remove the Attribute suffix if this is the attribute name
+// if (SyntaxFacts.IsAttributeName(name))
+// {
+// if (name.Parent.Kind() == SyntaxKind.Attribute || name.IsRightSideOfDotOrColonColon())
+// {
+// const string AttributeName = "Attribute";
+//
+// // an attribute that should keep it (unnecessary "Attribute" suffix should be annotated with a DontSimplifyAnnotation
+// if (identifierToken.ValueText != AttributeName && identifierToken.ValueText.EndsWith(AttributeName) && !identifierToken.HasAnnotation(SimplificationHelpers.DontSimplifyAnnotation))
+// {
+// // weird. the semantic model is able to bind attribute syntax like "[as()]" although it's not valid code.
+// // so we need another check for keywords manually.
+// var newAttributeName = identifierToken.ValueText.Substring(0, identifierToken.ValueText.Length - 9);
+// if (SyntaxFacts.GetKeywordKind(newAttributeName) != SyntaxKind.None)
+// {
+// return false;
+// }
+//
+// // if this attribute name in source contained unicode escaping, we will loose it now
+// // because there is no easy way to determine the substring from identifier->ToString()
+// // which would be needed to pass to SyntaxFactory.Identifier
+// // The result is an unescaped unicode character in source.
+//
+// // once we remove the Attribute suffix, we can't use an escaped identifier
+// var newIdentifierToken = identifierToken.CopyAnnotationsTo(
+// SyntaxFactory.Identifier(
+// identifierToken.LeadingTrivia,
+// newAttributeName,
+// identifierToken.TrailingTrivia));
+//
+// replacementNode = SyntaxFactory.IdentifierName(newIdentifierToken)
+// .WithLeadingTrivia(name.GetLeadingTrivia());
+// issueSpan = new TextSpan(identifierToken.Span.End - 9, 9);
+//
+// return true;
+// }
+// }
+// }
+//
+// return false;
+// }
+//
+// /// <summary>
+// /// Checks if the SyntaxNode is a name of a namespace declaration. To be a namespace name, the syntax
+// /// must be parented by an namespace declaration and the node itself must be equal to the declaration's Name
+// /// property.
+// /// </summary>
+// /// <param name="node"></param>
+// /// <returns></returns>
+// public static bool IsPartOfNamespaceDeclarationName(SyntaxNode node)
+// {
+// var parent = node;
+//
+// while (parent != null)
+// {
+// switch (parent.Kind())
+// {
+// case SyntaxKind.IdentifierName:
+// case SyntaxKind.QualifiedName:
+// node = parent;
+// parent = parent.Parent;
+// break;
+//
+// case SyntaxKind.NamespaceDeclaration:
+// var namespaceDeclaration = (NamespaceDeclarationSyntax)parent;
+// return object.Equals(namespaceDeclaration.Name, node);
+//
+// default:
+// return false;
+// }
+// }
+//
+// return false;
+// }
+//
+// private static bool TrySimplify(
+// this ExpressionSyntax expression,
+// SemanticModel semanticModel,
+// OptionSet optionSet,
+// out ExpressionSyntax replacementNode,
+// out TextSpan issueSpan)
+// {
+// replacementNode = null;
+// issueSpan = default(TextSpan);
+//
+// switch (expression.Kind())
+// {
+// case SyntaxKind.SimpleMemberAccessExpression:
+// {
+// var memberAccess = (MemberAccessExpressionSyntax)expression;
+// ExpressionSyntax newLeft;
+//
+// if (IsMemberAccessADynamicInvocation(memberAccess, semanticModel))
+// {
+// return false;
+// }
+//
+// if (TrySimplifyMemberAccessOrQualifiedName(memberAccess.Expression, memberAccess.Name, semanticModel, optionSet, out newLeft, out issueSpan))
+// {
+// // replacement node might not be in it's simplest form, so add simplify annotation to it.
+// replacementNode = memberAccess.Update(newLeft, memberAccess.OperatorToken, memberAccess.Name)
+// .WithAdditionalAnnotations(Simplifier.Annotation);
+//
+// // Ensure that replacement doesn't change semantics.
+// return !ReplacementChangesSemantics(memberAccess, replacementNode, semanticModel);
+// }
+//
+// return false;
+// }
+//
+// case SyntaxKind.QualifiedName:
+// {
+// var qualifiedName = (QualifiedNameSyntax)expression;
+// ExpressionSyntax newLeft;
+// if (TrySimplifyMemberAccessOrQualifiedName(qualifiedName.Left, qualifiedName.Right, semanticModel, optionSet, out newLeft, out issueSpan))
+// {
+// // replacement node might not be in it's simplest form, so add simplify annotation to it.
+// replacementNode = qualifiedName.Update((NameSyntax)newLeft, qualifiedName.DotToken, qualifiedName.Right)
+// .WithAdditionalAnnotations(Simplifier.Annotation);
+//
+// // Ensure that replacement doesn't change semantics.
+// return !ReplacementChangesSemantics(qualifiedName, replacementNode, semanticModel);
+// }
+//
+// return false;
+// }
+// }
+//
+// return false;
+// }
+//
+// private static bool ReplacementChangesSemantics(ExpressionSyntax originalExpression, ExpressionSyntax replacedExpression, SemanticModel semanticModel)
+// {
+// var speculationAnalyzer = new SpeculationAnalyzer(originalExpression, replacedExpression, semanticModel, CancellationToken.None);
+// return speculationAnalyzer.ReplacementChangesSemantics();
+// }
+//
+// // Note: The caller needs to verify that replacement doesn't change semantics of the original expression.
+// private static bool TrySimplifyMemberAccessOrQualifiedName(
+// ExpressionSyntax left,
+// ExpressionSyntax right,
+// SemanticModel semanticModel,
+// OptionSet optionSet,
+// out ExpressionSyntax replacementNode,
+// out TextSpan issueSpan)
+// {
+// replacementNode = null;
+// issueSpan = default(TextSpan);
+//
+// if (left != null && right != null)
+// {
+// var leftSymbol = SimplificationHelpers.GetOriginalSymbolInfo(semanticModel, left);
+// if (leftSymbol != null && (leftSymbol.Kind == SymbolKind.NamedType))
+// {
+// var rightSymbol = SimplificationHelpers.GetOriginalSymbolInfo(semanticModel, right);
+// if (rightSymbol != null && (rightSymbol.IsStatic || rightSymbol.Kind == SymbolKind.NamedType))
+// {
+// // Static member access or nested type member access.
+// INamedTypeSymbol containingType = rightSymbol.ContainingType;
+//
+// var enclosingSymbol = semanticModel.GetEnclosingSymbol(left.SpanStart);
+// List<ISymbol> enclosingTypeParametersInsideOut = new List<ISymbol>();
+//
+// while (enclosingSymbol != null)
+// {
+// if (enclosingSymbol is IMethodSymbol)
+// {
+// var methodSymbol = (IMethodSymbol)enclosingSymbol;
+// if (methodSymbol.TypeArguments.Length != 0)
+// {
+// enclosingTypeParametersInsideOut.AddRange(methodSymbol.TypeArguments);
+// }
+// }
+//
+// if (enclosingSymbol is INamedTypeSymbol)
+// {
+// var namedTypeSymbol = (INamedTypeSymbol)enclosingSymbol;
+// if (namedTypeSymbol.TypeArguments.Length != 0)
+// {
+// enclosingTypeParametersInsideOut.AddRange(namedTypeSymbol.TypeArguments);
+// }
+// }
+//
+// enclosingSymbol = enclosingSymbol.ContainingSymbol;
+// }
+//
+// if (containingType != null && !containingType.Equals(leftSymbol))
+// {
+// var namedType = leftSymbol as INamedTypeSymbol;
+// if (namedType != null)
+// {
+// if ((namedType.GetBaseTypes().Contains(containingType) &&
+// !optionSet.GetOption(SimplificationOptions.AllowSimplificationToBaseType)) ||
+// (!optionSet.GetOption(SimplificationOptions.AllowSimplificationToGenericType) &&
+// containingType.TypeArguments.Count() != 0))
+// {
+// return false;
+// }
+// }
+//
+// // We have a static member access or a nested type member access using a more derived type.
+// // Simplify syntax so as to use accessed member's most immediate containing type instead of the derived type.
+// replacementNode = containingType.GenerateTypeSyntax()
+// .WithLeadingTrivia(left.GetLeadingTrivia())
+// .WithTrailingTrivia(left.GetTrailingTrivia());
+// issueSpan = left.Span;
+// return true;
+// }
+// }
+// }
+// }
+//
+// return false;
+// }
+//
+// /// <summary>
+// /// Returns True if enclosingTypeParametersInsideOut contains a symbol with the same name as the candidateSymbol
+// /// thereby saying that there exists a symbol which hides the candidate Symbol
+// /// </summary>
+// private static bool HidingTypeParameterSymbolExists(ISymbol candidateSymbol, List<ISymbol> enclosingTypeParametersInsideOut)
+// {
+// foreach (var enclosingTypeParameter in enclosingTypeParametersInsideOut)
+// {
+// ISymbol newCandidateSymbol = candidateSymbol;
+// if (candidateSymbol.IsKind(SymbolKind.ArrayType))
+// {
+// newCandidateSymbol = ((IArrayTypeSymbol)candidateSymbol).ElementType;
+// }
+//
+// if (newCandidateSymbol.MetadataName == enclosingTypeParameter.MetadataName)
+// {
+// if (SymbolEquivalenceComparer.Instance.Equals(newCandidateSymbol.GetOriginalUnreducedDefinition(), enclosingTypeParameter.GetOriginalUnreducedDefinition()))
+// {
+// return false;
+// }
+//
+// return true;
+// }
+// }
+//
+// return false;
+// }
+
+// private static bool CanReplaceWithReducedName(
+// this MemberAccessExpressionSyntax memberAccess,
+// ExpressionSyntax reducedName,
+// SemanticModel semanticModel,
+// CancellationToken cancellationToken)
+// {
+// if (!IsThisOrTypeOrNamespace(memberAccess, semanticModel))
+// {
+// return false;
+// }
+//
+// var speculationAnalyzer = new SpeculationAnalyzer(memberAccess, reducedName, semanticModel, cancellationToken);
+// if (!speculationAnalyzer.SymbolsForOriginalAndReplacedNodesAreCompatible() ||
+// speculationAnalyzer.ReplacementChangesSemantics())
+// {
+// return false;
+// }
+//
+// if (WillConflictWithExistingLocal(memberAccess, reducedName))
+// {
+// return false;
+// }
+//
+// if (IsMemberAccessADynamicInvocation(memberAccess, semanticModel))
+// {
+// return false;
+// }
+//
+// if (memberAccess.AccessMethodWithDynamicArgumentInsideStructConstructor(semanticModel))
+// {
+// return false;
+// }
+//
+// if (memberAccess.Expression.Kind() == SyntaxKind.BaseExpression)
+// {
+// var enclosingNamedType = semanticModel.GetEnclosingNamedType(memberAccess.SpanStart, cancellationToken);
+// var symbol = semanticModel.GetSymbolInfo(memberAccess.Name, cancellationToken).Symbol;
+// if (enclosingNamedType != null &&
+// !enclosingNamedType.IsSealed &&
+// symbol != null &&
+// symbol.IsOverridable())
+// {
+// return false;
+// }
+// }
+//
+// var invalidTransformation1 = ParserWouldTreatExpressionAsCast(reducedName, memberAccess);
+//
+// return !invalidTransformation1;
+// }
+
+ private static bool ParserWouldTreatExpressionAsCast(ExpressionSyntax reducedNode, MemberAccessExpressionSyntax originalNode)
+ {
+ SyntaxNode parent = originalNode;
+ while (parent != null)
+ {
+ if (parent.IsParentKind(SyntaxKind.SimpleMemberAccessExpression))
+ {
+ parent = parent.Parent;
+ continue;
+ }
+
+ if (!parent.IsParentKind(SyntaxKind.ParenthesizedExpression))
+ {
+ return false;
+ }
+
+ break;
+ }
+
+ var newExpression = parent.ReplaceNode(originalNode, reducedNode);
+
+ // detect cast ambiguities according to C# spec #7.7.6
+ if (IsNameOrMemberAccessButNoExpression(newExpression))
+ {
+ var nextToken = parent.Parent.GetLastToken().GetNextToken();
+
+ return nextToken.Kind() == SyntaxKind.OpenParenToken ||
+ nextToken.Kind() == SyntaxKind.TildeToken ||
+ nextToken.Kind() == SyntaxKind.ExclamationToken ||
+ (SyntaxFacts.IsKeywordKind(nextToken.Kind()) && !(nextToken.Kind() == SyntaxKind.AsKeyword || nextToken.Kind() == SyntaxKind.IsKeyword));
+ }
+
+ return false;
+ }
+
+ private static bool IsNameOrMemberAccessButNoExpression(SyntaxNode node)
+ {
+ if (node.IsKind(SyntaxKind.SimpleMemberAccessExpression))
+ {
+ var memberAccess = (MemberAccessExpressionSyntax)node;
+
+ return memberAccess.Expression.IsKind(SyntaxKind.IdentifierName) ||
+ IsNameOrMemberAccessButNoExpression(memberAccess.Expression);
+ }
+
+ return node.IsKind(SyntaxKind.IdentifierName);
+ }
+
+ /// <summary>
+ /// Tells if the Member access is the starting part of a Dynamic Invocation
+ /// </summary>
+ /// <param name="memberAccess"></param>
+ /// <param name="semanticModel"></param>
+ /// <returns>Return true, if the member access is the starting point of a Dynamic Invocation</returns>
+ private static bool IsMemberAccessADynamicInvocation(MemberAccessExpressionSyntax memberAccess, SemanticModel semanticModel)
+ {
+ var ancestorInvocation = memberAccess.FirstAncestorOrSelf<InvocationExpressionSyntax>();
+
+ if (ancestorInvocation != null && ancestorInvocation.SpanStart == memberAccess.SpanStart)
+ {
+ var typeInfo = semanticModel.GetTypeInfo(ancestorInvocation);
+ if (typeInfo.Type != null &&
+ typeInfo.Type.Kind == SymbolKind.DynamicType)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /*
+ * Name Reduction, to implicitly mean "this", is possible only after the initialization of all member variables but
+ * since the check for initialization of all member variable is a lot of work for this simplification we don't simplify
+ * even if all the member variables are initialized
+ */
+ private static bool AccessMethodWithDynamicArgumentInsideStructConstructor(this MemberAccessExpressionSyntax memberAccess, SemanticModel semanticModel)
+ {
+ var constructor = memberAccess.Ancestors().OfType<ConstructorDeclarationSyntax>().SingleOrDefault();
+
+ if (constructor == null || constructor.Parent.Kind() != SyntaxKind.StructDeclaration)
+ {
+ return false;
+ }
+
+ return semanticModel.GetSymbolInfo(memberAccess.Name).CandidateReason == CandidateReason.LateBound;
+ }
+
+// private static bool CanReplaceWithReducedName(this NameSyntax name, TypeSyntax reducedName, SemanticModel semanticModel, CancellationToken cancellationToken)
+// {
+// var speculationAnalyzer = new SpeculationAnalyzer(name, reducedName, semanticModel, cancellationToken);
+// if (speculationAnalyzer.ReplacementChangesSemantics())
+// {
+// return false;
+// }
+//
+// return CanReplaceWithReducedNameInContext(name, reducedName, semanticModel, cancellationToken);
+// }
+//
+// private static bool CanReplaceWithReducedNameInContext(this NameSyntax name, TypeSyntax reducedName, SemanticModel semanticModel, CancellationToken cancellationToken)
+// {
+// // Special case. if this new minimal name parses out to a predefined type, then we
+// // have to make sure that we're not in a using alias. That's the one place where the
+// // language doesn't allow predefined types. You have to use the fully qualified name
+// // instead.
+// var invalidTransformation1 = IsNonNameSyntaxInUsingDirective(name, reducedName);
+// var invalidTransformation2 = WillConflictWithExistingLocal(name, reducedName);
+// var invalidTransformation3 = IsAmbiguousCast(name, reducedName);
+// var invalidTransformation4 = IsNullableTypeInPointerExpression(name, reducedName);
+// var isNotNullableReplacable = name.IsNotNullableReplacable(reducedName);
+//
+// if (invalidTransformation1 || invalidTransformation2 || invalidTransformation3 || invalidTransformation4
+// || isNotNullableReplacable)
+// {
+// return false;
+// }
+//
+// return true;
+// }
+
+ private static bool IsNotNullableReplacable(this NameSyntax name, TypeSyntax reducedName)
+ {
+ var isNotNullableReplacable = false;
+ // var isLeftSideOfDot = name.IsLeftSideOfDot();
+ // var isRightSideOfDot = name.IsRightSideOfDot();
+
+ if (reducedName.Kind() == SyntaxKind.NullableType)
+ {
+ if (((NullableTypeSyntax)reducedName).ElementType.Kind() == SyntaxKind.OmittedTypeArgument)
+ {
+ isNotNullableReplacable = true;
+ }
+ else
+ {
+ isNotNullableReplacable = name.IsLeftSideOfDot() || name.IsRightSideOfDot();
+ }
+ }
+
+ return isNotNullableReplacable;
+ }
+
+// private static bool IsThisOrTypeOrNamespace(MemberAccessExpressionSyntax memberAccess, SemanticModel semanticModel)
+// {
+// if (memberAccess.Expression.Kind() == SyntaxKind.ThisExpression)
+// {
+// var previousToken = memberAccess.Expression.GetFirstToken().GetPreviousToken();
+//
+// var symbol = semanticModel.GetSymbolInfo(memberAccess.Name).Symbol;
+//
+// if (previousToken.Kind() == SyntaxKind.OpenParenToken &&
+// previousToken.Parent.IsKind(SyntaxKind.ParenthesizedExpression) &&
+// !previousToken.Parent.IsParentKind(SyntaxKind.ParenthesizedExpression) &&
+// ((ParenthesizedExpressionSyntax)previousToken.Parent).Expression.Kind() == SyntaxKind.SimpleMemberAccessExpression &&
+// symbol != null && symbol.Kind == SymbolKind.Method)
+// {
+// return false;
+// }
+//
+// return true;
+// }
+//
+// var expressionInfo = semanticModel.GetSymbolInfo(memberAccess.Expression);
+// if (SimplificationHelpers.IsValidSymbolInfo(expressionInfo.Symbol))
+// {
+// if (expressionInfo.Symbol is INamespaceOrTypeSymbol)
+// {
+// return true;
+// }
+//
+// if (expressionInfo.Symbol.IsThisParameter())
+// {
+// return true;
+// }
+// }
+//
+// return false;
+// }
+
+ private static bool IsReplacableByVar(
+ this TypeSyntax simpleName,
+ SemanticModel semanticModel,
+ out TypeSyntax replacementNode,
+ out TextSpan issueSpan,
+ OptionSet optionSet,
+ CancellationToken cancellationToken)
+ {
+ replacementNode = null;
+ issueSpan = default(TextSpan);
+
+ if (!optionSet.GetOption(SimplificationOptions.PreferImplicitTypeInLocalDeclaration))
+ {
+ return false;
+ }
+
+ // If it is already var
+ if (simpleName.IsVar)
+ {
+ return false;
+ }
+
+ var candidateReplacementNode = SyntaxFactory.IdentifierName("var")
+ .WithLeadingTrivia(simpleName.GetLeadingTrivia())
+ .WithTrailingTrivia(simpleName.GetTrailingTrivia());
+ var candidateIssueSpan = simpleName.Span;
+
+ // If there exists a Type called var , fail.
+ var checkSymbol = semanticModel.GetSpeculativeSymbolInfo(simpleName.SpanStart, candidateReplacementNode, SpeculativeBindingOption.BindAsTypeOrNamespace).Symbol;
+ if (checkSymbol != null && checkSymbol.IsKind(SymbolKind.NamedType) && ((INamedTypeSymbol)checkSymbol).TypeKind == TypeKind.Class && checkSymbol.Name == "var")
+ {
+ return false;
+ }
+
+ // If the simpleName is the type of the Variable Declaration Syntax belonging to LocalDeclaration, For Statement or Using statement
+ if (simpleName.IsParentKind(SyntaxKind.VariableDeclaration) &&
+ ((VariableDeclarationSyntax)simpleName.Parent).Type == simpleName &&
+ simpleName.Parent.Parent.IsKind(SyntaxKind.LocalDeclarationStatement, SyntaxKind.ForStatement, SyntaxKind.UsingStatement))
+ {
+ if (simpleName.Parent.IsParentKind(SyntaxKind.LocalDeclarationStatement) &&
+ ((LocalDeclarationStatementSyntax)simpleName.Parent.Parent).Modifiers.Any(n => n.Kind() == SyntaxKind.ConstKeyword))
+ {
+ return false;
+ }
+
+ var variableDeclaration = (VariableDeclarationSyntax)simpleName.Parent;
+
+ // Check the Initialized Value to see if it is allowed to be in the Var initialization
+ if (variableDeclaration.Variables.Count != 1 ||
+ !variableDeclaration.Variables.Single().Initializer.IsKind(SyntaxKind.EqualsValueClause))
+ {
+ return false;
+ }
+
+ var variable = variableDeclaration.Variables.Single();
+ var initializer = (EqualsValueClauseSyntax)variable.Initializer;
+ var identifier = variable.Identifier;
+
+ if (EqualsValueClauseNotSuitableForVar(identifier, simpleName, initializer, semanticModel, cancellationToken))
+ {
+ return false;
+ }
+
+ replacementNode = candidateReplacementNode;
+ issueSpan = candidateIssueSpan;
+ return true;
+ }
+
+ if (simpleName.IsParentKind(SyntaxKind.ForEachStatement) &&
+ ((ForEachStatementSyntax)simpleName.Parent).Type == simpleName)
+ {
+ replacementNode = candidateReplacementNode;
+ issueSpan = candidateIssueSpan;
+ return true;
+ }
+
+ return false;
+ }
+
+ private static bool EqualsValueClauseNotSuitableForVar(
+ SyntaxToken identifier,
+ TypeSyntax simpleName,
+ EqualsValueClauseSyntax equalsValueClause,
+ SemanticModel semanticModel,
+ CancellationToken cancellationToken)
+ {
+ // var cannot be assigned null
+ if (equalsValueClause.IsKind(SyntaxKind.NullLiteralExpression))
+ {
+ return true;
+ }
+
+ var type = semanticModel.GetTypeInfo(simpleName, cancellationToken).Type;
+
+ // the variable cannot be initialized to a method group or an anonymous function
+ if (type != null &&
+ type.TypeKind == TypeKind.Delegate)
+ {
+ return true;
+ }
+
+ var initializerType = semanticModel.GetTypeInfo(equalsValueClause.Value, cancellationToken).Type;
+
+ if (!type.Equals(initializerType))
+ {
+ return true;
+ }
+
+ // The assign expression in the initializer cannot be the same symbol as the i
+ var possibleSameLocals = equalsValueClause.DescendantNodesAndSelf().Where(n => n.Kind() == SyntaxKind.IdentifierName && ((IdentifierNameSyntax)n).Identifier.ValueText.Equals(identifier.ValueText));
+ var anyUse = possibleSameLocals.Any(n =>
+ {
+ var symbol = semanticModel.GetSymbolInfo(n, cancellationToken).Symbol;
+ if (symbol != null && symbol.Kind == SymbolKind.Local)
+ {
+ return true;
+ }
+
+ return false;
+ });
+
+ if (anyUse)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ private static bool ContainsOpenName(NameSyntax name)
+ {
+ if (name is QualifiedNameSyntax)
+ {
+ var qualifiedName = (QualifiedNameSyntax)name;
+ return ContainsOpenName(qualifiedName.Left) || ContainsOpenName(qualifiedName.Right);
+ }
+ else if (name is GenericNameSyntax)
+ {
+ return ((GenericNameSyntax)name).IsUnboundGenericName;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ private static bool IsNullableTypeInPointerExpression(ExpressionSyntax expression, ExpressionSyntax simplifiedNode)
+ {
+ // Note: nullable type syntax is not allowed in pointer type syntax
+ if (simplifiedNode.Kind() == SyntaxKind.NullableType &&
+ simplifiedNode.DescendantNodes().Any(n => n is PointerTypeSyntax))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ private static bool IsNonNameSyntaxInUsingDirective(ExpressionSyntax expression, ExpressionSyntax simplifiedNode)
+ {
+ return
+ expression.IsParentKind(SyntaxKind.UsingDirective) &&
+ !(simplifiedNode is NameSyntax);
+ }
+
+// private static bool WillConflictWithExistingLocal(ExpressionSyntax expression, ExpressionSyntax simplifiedNode)
+// {
+// if (simplifiedNode.Kind() == SyntaxKind.IdentifierName && !SyntaxFacts.IsInNamespaceOrTypeContext(expression))
+// {
+// var identifierName = (IdentifierNameSyntax)simplifiedNode;
+// var enclosingDeclarationSpace = FindImmediatelyEnclosingLocalVariableDeclarationSpace(expression);
+// var enclosingMemberDeclaration = expression.FirstAncestorOrSelf<MemberDeclarationSyntax>();
+// if (enclosingDeclarationSpace != null && enclosingMemberDeclaration != null)
+// {
+// var locals = enclosingMemberDeclaration.GetLocalDeclarationMap()[identifierName.Identifier.ValueText];
+// foreach (var token in locals)
+// {
+// if (token.GetAncestors<SyntaxNode>().Contains(enclosingDeclarationSpace))
+// {
+// return true;
+// }
+// }
+// }
+// }
+//
+// return false;
+// }
+
+ private static bool IsAmbiguousCast(ExpressionSyntax expression, ExpressionSyntax simplifiedNode)
+ {
+ // Can't simplify a type name in a cast expression if it would then cause the cast to be
+ // parsed differently. For example: (Foo::Bar)+1 is a cast. But if that simplifies to
+ // (Bar)+1 then that's an arithmetic expression.
+ if (expression.IsParentKind(SyntaxKind.CastExpression))
+ {
+ var castExpression = (CastExpressionSyntax)expression.Parent;
+ if (castExpression.Type == expression)
+ {
+ var newCastExpression = castExpression.ReplaceNode(castExpression.Type, simplifiedNode);
+ var reparsedCastExpression = SyntaxFactory.ParseExpression(newCastExpression.ToString());
+
+ if (!reparsedCastExpression.IsKind(SyntaxKind.CastExpression))
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ private static SyntaxNode FindImmediatelyEnclosingLocalVariableDeclarationSpace(SyntaxNode syntax)
+ {
+ for (var declSpace = syntax; declSpace != null; declSpace = declSpace.Parent)
+ {
+ switch (declSpace.Kind())
+ {
+ // These are declaration-space-defining syntaxes, by the spec:
+ case SyntaxKind.MethodDeclaration:
+ case SyntaxKind.IndexerDeclaration:
+ case SyntaxKind.OperatorDeclaration:
+ case SyntaxKind.ConstructorDeclaration:
+ case SyntaxKind.Block:
+ case SyntaxKind.ParenthesizedLambdaExpression:
+ case SyntaxKind.SimpleLambdaExpression:
+ case SyntaxKind.AnonymousMethodExpression:
+ case SyntaxKind.SwitchStatement:
+ case SyntaxKind.ForEachKeyword:
+ case SyntaxKind.ForStatement:
+ case SyntaxKind.UsingStatement:
+
+ // SPEC VIOLATION: We also want to stop walking out if, say, we are in a field
+ // initializer. Technically according to the wording of the spec it should be
+ // legal to use a simple name inconsistently inside a field initializer because
+ // it does not define a local variable declaration space. In practice of course
+ // we want to check for that. (As the native compiler does as well.)
+
+ case SyntaxKind.FieldDeclaration:
+ return declSpace;
+ }
+ }
+
+ return null;
+ }
+
+ /// <summary>
+ /// Returns the predefined keyword kind for a given specialtype.
+ /// </summary>
+ /// <param name="specialType">The specialtype of this type.</param>
+ /// <returns>The keyword kind for a given special type, or SyntaxKind.None if the type name is not a predefined type.</returns>
+ public static SyntaxKind GetPredefinedKeywordKind(SpecialType specialType)
+ {
+ switch (specialType)
+ {
+ case SpecialType.System_Boolean:
+ return SyntaxKind.BoolKeyword;
+ case SpecialType.System_Byte:
+ return SyntaxKind.ByteKeyword;
+ case SpecialType.System_SByte:
+ return SyntaxKind.SByteKeyword;
+ case SpecialType.System_Int32:
+ return SyntaxKind.IntKeyword;
+ case SpecialType.System_UInt32:
+ return SyntaxKind.UIntKeyword;
+ case SpecialType.System_Int16:
+ return SyntaxKind.ShortKeyword;
+ case SpecialType.System_UInt16:
+ return SyntaxKind.UShortKeyword;
+ case SpecialType.System_Int64:
+ return SyntaxKind.LongKeyword;
+ case SpecialType.System_UInt64:
+ return SyntaxKind.ULongKeyword;
+ case SpecialType.System_Single:
+ return SyntaxKind.FloatKeyword;
+ case SpecialType.System_Double:
+ return SyntaxKind.DoubleKeyword;
+ case SpecialType.System_Decimal:
+ return SyntaxKind.DecimalKeyword;
+ case SpecialType.System_String:
+ return SyntaxKind.StringKeyword;
+ case SpecialType.System_Char:
+ return SyntaxKind.CharKeyword;
+ case SpecialType.System_Object:
+ return SyntaxKind.ObjectKeyword;
+ case SpecialType.System_Void:
+ return SyntaxKind.VoidKeyword;
+ default:
+ return SyntaxKind.None;
+ }
+ }
+
+ public static NameSyntax GetRightmostName(this ExpressionSyntax node)
+ {
+ var memberAccess = node as MemberAccessExpressionSyntax;
+ if (memberAccess != null && memberAccess.Name != null)
+ {
+ return memberAccess.Name;
+ }
+
+ var qualified = node as QualifiedNameSyntax;
+ if (qualified != null && qualified.Right != null)
+ {
+ return qualified.Right;
+ }
+
+ var simple = node as SimpleNameSyntax;
+ if (simple != null)
+ {
+ return simple;
+ }
+
+ var conditional = node as ConditionalAccessExpressionSyntax;
+ if (conditional != null)
+ {
+ return conditional.WhenNotNull.GetRightmostName();
+ }
+
+ return null;
+ }
+
+ public static OperatorPrecedence GetOperatorPrecedence(this ExpressionSyntax expression)
+ {
+ switch (expression.Kind())
+ {
+ case SyntaxKind.SimpleMemberAccessExpression:
+ case SyntaxKind.InvocationExpression:
+ case SyntaxKind.ElementAccessExpression:
+ case SyntaxKind.PostIncrementExpression:
+ case SyntaxKind.PostDecrementExpression:
+ case SyntaxKind.ObjectCreationExpression:
+ case SyntaxKind.TypeOfExpression:
+ case SyntaxKind.DefaultExpression:
+ case SyntaxKind.CheckedExpression:
+ case SyntaxKind.UncheckedExpression:
+ case SyntaxKind.AnonymousMethodExpression:
+ // From C# spec, 7.3.1:
+ // Primary: x.y f(x) a[x] x++ x-- new typeof default checked unchecked delegate
+
+ return OperatorPrecedence.Primary;
+
+ case SyntaxKind.UnaryPlusExpression:
+ case SyntaxKind.UnaryMinusExpression:
+ case SyntaxKind.LogicalNotExpression:
+ case SyntaxKind.BitwiseNotExpression:
+ case SyntaxKind.PreIncrementExpression:
+ case SyntaxKind.PreDecrementExpression:
+ case SyntaxKind.CastExpression:
+ // From C# spec, 7.3.1:
+ // Unary: + - ! ~ ++x --x (T)x
+
+ return OperatorPrecedence.Unary;
+
+ case SyntaxKind.MultiplyExpression:
+ case SyntaxKind.DivideExpression:
+ case SyntaxKind.ModuloExpression:
+ // From C# spec, 7.3.1:
+ // Multiplicative: * / %
+
+ return OperatorPrecedence.Multiplicative;
+
+ case SyntaxKind.AddExpression:
+ case SyntaxKind.SubtractExpression:
+ // From C# spec, 7.3.1:
+ // Additive: + -
+
+ return OperatorPrecedence.Additive;
+
+ case SyntaxKind.LeftShiftExpression:
+ case SyntaxKind.RightShiftExpression:
+ // From C# spec, 7.3.1:
+ // Shift: << >>
+
+ return OperatorPrecedence.Shift;
+
+ case SyntaxKind.LessThanExpression:
+ case SyntaxKind.GreaterThanExpression:
+ case SyntaxKind.LessThanOrEqualExpression:
+ case SyntaxKind.GreaterThanOrEqualExpression:
+ case SyntaxKind.IsExpression:
+ case SyntaxKind.AsExpression:
+ // From C# spec, 7.3.1:
+ // Relational and type testing: < > <= >= is as
+
+ return OperatorPrecedence.RelationalAndTypeTesting;
+
+ case SyntaxKind.EqualsExpression:
+ case SyntaxKind.NotEqualsExpression:
+ // From C# spec, 7.3.1:
+ // Equality: == !=
+
+ return OperatorPrecedence.Equality;
+
+ case SyntaxKind.BitwiseAndExpression:
+ // From C# spec, 7.3.1:
+ // Logical AND: &
+
+ return OperatorPrecedence.LogicalAnd;
+
+ case SyntaxKind.ExclusiveOrExpression:
+ // From C# spec, 7.3.1:
+ // Logical XOR: ^
+
+ return OperatorPrecedence.LogicalXor;
+
+ case SyntaxKind.BitwiseOrExpression:
+ // From C# spec, 7.3.1:
+ // Logical OR: |
+
+ return OperatorPrecedence.LogicalOr;
+
+ case SyntaxKind.LogicalAndExpression:
+ // From C# spec, 7.3.1:
+ // Conditional AND: &&
+
+ return OperatorPrecedence.ConditionalAnd;
+
+ case SyntaxKind.LogicalOrExpression:
+ // From C# spec, 7.3.1:
+ // Conditional AND: ||
+
+ return OperatorPrecedence.ConditionalOr;
+
+ case SyntaxKind.CoalesceExpression:
+ // From C# spec, 7.3.1:
+ // Null coalescing: ??
+
+ return OperatorPrecedence.NullCoalescing;
+
+ case SyntaxKind.ConditionalExpression:
+ // From C# spec, 7.3.1:
+ // Conditional: ?:
+
+ return OperatorPrecedence.Conditional;
+
+ case SyntaxKind.SimpleAssignmentExpression:
+ case SyntaxKind.MultiplyAssignmentExpression:
+ case SyntaxKind.DivideAssignmentExpression:
+ case SyntaxKind.ModuloAssignmentExpression:
+ case SyntaxKind.AddAssignmentExpression:
+ case SyntaxKind.SubtractAssignmentExpression:
+ case SyntaxKind.LeftShiftAssignmentExpression:
+ case SyntaxKind.RightShiftAssignmentExpression:
+ case SyntaxKind.AndAssignmentExpression:
+ case SyntaxKind.ExclusiveOrAssignmentExpression:
+ case SyntaxKind.OrAssignmentExpression:
+ case SyntaxKind.SimpleLambdaExpression:
+ case SyntaxKind.ParenthesizedLambdaExpression:
+ // From C# spec, 7.3.1:
+ // Conditional: ?:
+
+ return OperatorPrecedence.AssignmentAndLambdaExpression;
+
+ default:
+ return OperatorPrecedence.None;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Operator precedence classes from section 7.3.1 of the C# language specification.
+ /// </summary>
+ enum OperatorPrecedence
+ {
+ None = 0,
+ AssignmentAndLambdaExpression,
+ Conditional,
+ NullCoalescing,
+ ConditionalOr,
+ ConditionalAnd,
+ LogicalOr,
+ LogicalXor,
+ LogicalAnd,
+ Equality,
+ RelationalAndTypeTesting,
+ Shift,
+ Additive,
+ Multiplicative,
+ Unary,
+ Primary
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/FastSerializer.cs b/main/src/addins/CSharpBinding/Util/FastSerializer.cs
new file mode 100644
index 0000000000..1216f712de
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/FastSerializer.cs
@@ -0,0 +1,1371 @@
+// Copyright (c) 2011 Daniel Grunwald
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy of this
+// software and associated documentation files (the "Software"), to deal in the Software
+// without restriction, including without limitation the rights to use, copy, modify, merge,
+// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+// to whom the Software is furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all copies or
+// substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Reflection;
+using System.Reflection.Emit;
+using System.Runtime.Serialization;
+
+namespace ICSharpCode.NRefactory6.Utils
+{
+ class FastSerializer
+ {
+ #region Properties
+ /// <summary>
+ /// Gets/Sets the serialization binder that is being used.
+ /// The default value is null, which will cause the FastSerializer to use the
+ /// full assembly and type names.
+ /// </summary>
+ public SerializationBinder SerializationBinder { get; set; }
+
+ /// <summary>
+ /// Can be used to set several 'fixed' instances.
+ /// When serializing, such instances will not be included; and any references to a fixed instance
+ /// will be stored as the index in this array.
+ /// When deserializing, the same (or equivalent) instances must be specified, and the deserializer
+ /// will use them in place of the fixed instances.
+ /// </summary>
+ public object[] FixedInstances { get; set; }
+ #endregion
+
+ #region Constants
+ const int magic = 0x71D28A5E;
+
+ const byte Type_ReferenceType = 1;
+ const byte Type_ValueType = 2;
+ const byte Type_SZArray = 3;
+ const byte Type_ParameterizedType = 4;
+ #endregion
+
+ #region Serialization
+ sealed class SerializationType
+ {
+ public readonly int ID;
+ public readonly Type Type;
+
+ public SerializationType(int iD, Type type)
+ {
+ this.ID = iD;
+ this.Type = type;
+ }
+
+ public ObjectScanner Scanner;
+ public ObjectWriter Writer;
+ public string TypeName;
+ public int AssemblyNameID;
+ }
+
+ sealed class SerializationContext
+ {
+ readonly Dictionary<object, int> objectToID = new Dictionary<object, int>(ReferenceComparer.Instance);
+ readonly List<object> instances = new List<object>(); // index: object ID
+ readonly List<SerializationType> objectTypes = new List<SerializationType>(); // index: object ID
+ SerializationType stringType;
+
+ readonly Dictionary<Type, SerializationType> typeMap = new Dictionary<Type, SerializationType>();
+ readonly List<SerializationType> types = new List<SerializationType>();
+
+ readonly Dictionary<string, int> assemblyNameToID = new Dictionary<string, int>();
+ readonly List<string> assemblyNames = new List<string>();
+
+ readonly FastSerializer fastSerializer;
+ public readonly BinaryWriter writer;
+ int fixedInstanceCount;
+
+ internal SerializationContext(FastSerializer fastSerializer, BinaryWriter writer)
+ {
+ this.fastSerializer = fastSerializer;
+ this.writer = writer;
+ instances.Add(null); // use object ID 0 for null
+ objectTypes.Add(null);
+ }
+
+ #region Scanning
+ public void MarkFixedInstances(object[] fixedInstances)
+ {
+ if (fixedInstances == null)
+ return;
+ foreach (object obj in fixedInstances) {
+ if (!objectToID.ContainsKey(obj)) {
+ objectToID.Add(obj, instances.Count);
+ instances.Add(obj);
+ fixedInstanceCount++;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Marks an instance for future scanning.
+ /// </summary>
+ public void Mark(object instance)
+ {
+ if (instance == null || objectToID.ContainsKey(instance))
+ return;
+ Log(" Mark {0}", instance.GetType().Name);
+
+ objectToID.Add(instance, instances.Count);
+ instances.Add(instance);
+ }
+
+ internal void Scan()
+ {
+ Log("Scanning...");
+ // starting from 1, because index 0 is null
+ // Also, do not scan any of the 'fixed instances'.
+ for (int i = 1 + fixedInstanceCount; i < instances.Count; i++) {
+ object instance = instances[i];
+ ISerializable serializable = instance as ISerializable;
+ Type type = instance.GetType();
+ Log("Scan #{0}: {1}", i, type.Name);
+ SerializationType sType = MarkType(type);
+ objectTypes.Add(sType);
+ if (serializable != null) {
+ SerializationInfo info = new SerializationInfo(type, fastSerializer.formatterConverter);
+ serializable.GetObjectData(info, fastSerializer.streamingContext);
+ instances[i] = info;
+ foreach (SerializationEntry entry in info) {
+ Mark(entry.Value);
+ }
+ sType.Writer = serializationInfoWriter;
+ } else {
+ ObjectScanner objectScanner = sType.Scanner;
+ if (objectScanner == null) {
+ objectScanner = fastSerializer.GetScanner(type);
+ sType.Scanner = objectScanner;
+ sType.Writer = fastSerializer.GetWriter(type);
+ }
+ objectScanner(this, instance);
+ }
+ }
+ }
+ #endregion
+
+ #region Scan Types
+ SerializationType MarkType(Type type)
+ {
+ SerializationType sType;
+ if (!typeMap.TryGetValue(type, out sType)) {
+ string assemblyName = null;
+ string typeName = null;
+ if (type.HasElementType) {
+ Debug.Assert(type.IsArray);
+ MarkType(type.GetElementType());
+ } else if (type.IsGenericType && !type.IsGenericTypeDefinition) {
+ MarkType(type.GetGenericTypeDefinition());
+ foreach (Type typeArg in type.GetGenericArguments())
+ MarkType(typeArg);
+ } else if (type.IsGenericParameter) {
+ throw new NotSupportedException();
+ } else {
+ var serializationBinder = fastSerializer.SerializationBinder;
+ if (serializationBinder != null) {
+ serializationBinder.BindToName(type, out assemblyName, out typeName);
+ } else {
+ assemblyName = type.Assembly.FullName;
+ typeName = type.FullName;
+ Debug.Assert(typeName != null);
+ }
+ }
+
+ sType = new SerializationType(typeMap.Count, type);
+ sType.TypeName = typeName;
+ if (assemblyName != null) {
+ if (!assemblyNameToID.TryGetValue(assemblyName, out sType.AssemblyNameID)) {
+ sType.AssemblyNameID = assemblyNames.Count;
+ assemblyNameToID.Add(assemblyName, sType.AssemblyNameID);
+ assemblyNames.Add(assemblyName);
+ Log("Registered assembly #{0}: {1}", sType.AssemblyNameID, assemblyName);
+ }
+ }
+ typeMap.Add(type, sType);
+ types.Add(sType);
+ Log("Registered type %{0}: {1}", sType.ID, type);
+ if (type == typeof(string)) {
+ stringType = sType;
+ }
+ }
+ return sType;
+ }
+
+ internal void ScanTypes()
+ {
+ for (int i = 0; i < types.Count; i++) {
+ Type type = types[i].Type;
+ if (type.IsGenericTypeDefinition || type.HasElementType)
+ continue;
+ if (typeof(ISerializable).IsAssignableFrom(type))
+ continue;
+ foreach (FieldInfo field in GetSerializableFields(type)) {
+ MarkType(field.FieldType);
+ }
+ }
+ }
+ #endregion
+
+ #region Writing
+ public void WriteObjectID(object instance)
+ {
+ int id = (instance == null) ? 0 : objectToID[instance];
+ if (instances.Count <= ushort.MaxValue)
+ writer.Write((ushort)id);
+ else
+ writer.Write(id);
+ }
+
+ void WriteTypeID(Type type)
+ {
+ Debug.Assert(typeMap.ContainsKey(type));
+ int typeID = typeMap[type].ID;
+ if (types.Count <= ushort.MaxValue)
+ writer.Write((ushort)typeID);
+ else
+ writer.Write(typeID);
+ }
+
+ internal void Write()
+ {
+ Log("Writing...");
+ writer.Write(magic);
+ // Write out type information
+ writer.Write(instances.Count);
+ writer.Write(types.Count);
+ writer.Write(assemblyNames.Count);
+ writer.Write(fixedInstanceCount);
+
+ foreach (string assemblyName in assemblyNames) {
+ writer.Write(assemblyName);
+ }
+
+ foreach (SerializationType sType in types) {
+ Type type = sType.Type;
+ if (type.HasElementType) {
+ if (type.IsArray) {
+ if (type.GetArrayRank() == 1)
+ writer.Write(Type_SZArray);
+ else
+ throw new NotSupportedException();
+ } else {
+ throw new NotSupportedException();
+ }
+ WriteTypeID(type.GetElementType());
+ } else if (type.IsGenericType && !type.IsGenericTypeDefinition) {
+ writer.Write(Type_ParameterizedType);
+ WriteTypeID(type.GetGenericTypeDefinition());
+ foreach (Type typeArg in type.GetGenericArguments()) {
+ WriteTypeID(typeArg);
+ }
+ } else {
+ if (type.IsValueType) {
+ writer.Write(Type_ValueType);
+ } else {
+ writer.Write(Type_ReferenceType);
+ }
+ if (assemblyNames.Count <= ushort.MaxValue)
+ writer.Write((ushort)sType.AssemblyNameID);
+ else
+ writer.Write(sType.AssemblyNameID);
+ writer.Write(sType.TypeName);
+ }
+ }
+ foreach (SerializationType sType in types) {
+ Type type = sType.Type;
+ if (type.IsGenericTypeDefinition || type.HasElementType)
+ continue;
+ writer.Write(FastSerializerVersionAttribute.GetVersionNumber(type));
+ if (type.IsPrimitive || typeof(ISerializable).IsAssignableFrom(type)) {
+ writer.Write(byte.MaxValue);
+ } else {
+ var fields = GetSerializableFields(type);
+ if (fields.Count >= byte.MaxValue)
+ throw new SerializationException("Too many fields.");
+ writer.Write((byte)fields.Count);
+ foreach (var field in fields) {
+ WriteTypeID(field.FieldType);
+ writer.Write(field.Name);
+ }
+ }
+ }
+
+ // Write out information necessary to create the instances
+ // starting from 1, because index 0 is null
+ for (int i = 1 + fixedInstanceCount; i < instances.Count; i++) {
+ SerializationType sType = objectTypes[i];
+ if (types.Count <= ushort.MaxValue)
+ writer.Write((ushort)sType.ID);
+ else
+ writer.Write(sType.ID);
+ if (sType == stringType) {
+ // Strings are written to the output immediately
+ // - we can't create an empty string and fill it later
+ writer.Write((string)instances[i]);
+ } else if (sType.Type.IsArray) {
+ // For arrays, write down the length, because we need that to create the array instance
+ writer.Write(((Array)instances[i]).Length);
+ }
+ }
+ // Write out information necessary to fill data into the instances
+ for (int i = 1 + fixedInstanceCount; i < instances.Count; i++) {
+ Log("0x{2:x6}, Write #{0}: {1}", i, objectTypes[i].Type.Name, writer.BaseStream.Position);
+ objectTypes[i].Writer(this, instances[i]);
+ }
+ Log("Serialization done.");
+ }
+ #endregion
+ }
+
+ #region Object Scanners
+ delegate void ObjectScanner(SerializationContext context, object instance);
+
+ static readonly MethodInfo mark = typeof(SerializationContext).GetMethod("Mark", new[] { typeof(object) });
+ static readonly FieldInfo writerField = typeof(SerializationContext).GetField("writer");
+
+ Dictionary<Type, ObjectScanner> scanners = new Dictionary<Type, ObjectScanner>();
+
+ ObjectScanner GetScanner(Type type)
+ {
+ ObjectScanner scanner;
+ if (!scanners.TryGetValue(type, out scanner)) {
+ scanner = CreateScanner(type);
+ scanners.Add(type, scanner);
+ }
+ return scanner;
+ }
+
+ ObjectScanner CreateScanner(Type type)
+ {
+ bool isArray = type.IsArray;
+ if (isArray) {
+ if (type.GetArrayRank() != 1)
+ throw new NotSupportedException();
+ type = type.GetElementType();
+ if (!type.IsValueType) {
+ return delegate (SerializationContext context, object array) {
+ foreach (object val in (object[])array) {
+ context.Mark(val);
+ }
+ };
+ }
+ }
+ for (Type baseType = type; baseType != null; baseType = baseType.BaseType) {
+ if (!baseType.IsSerializable)
+ throw new SerializationException("Type " + baseType + " is not [Serializable].");
+ }
+ List<FieldInfo> fields = GetSerializableFields(type);
+ fields.RemoveAll(f => !IsReferenceOrContainsReferences(f.FieldType));
+ if (fields.Count == 0) {
+ // The scanner has nothing to do for this object.
+ return delegate { };
+ }
+
+ DynamicMethod dynamicMethod = new DynamicMethod(
+ (isArray ? "ScanArray_" : "Scan_") + type.Name,
+ typeof(void), new [] { typeof(SerializationContext), typeof(object) },
+ true);
+ ILGenerator il = dynamicMethod.GetILGenerator();
+
+
+ if (isArray) {
+ var instance = il.DeclareLocal(type.MakeArrayType());
+ il.Emit(OpCodes.Ldarg_1);
+ il.Emit(OpCodes.Castclass, type.MakeArrayType());
+ il.Emit(OpCodes.Stloc, instance); // instance = (type[])arg_1;
+
+ // for (int i = 0; i < instance.Length; i++) scan instance[i];
+ var loopStart = il.DefineLabel();
+ var loopHead = il.DefineLabel();
+ var loopVariable = il.DeclareLocal(typeof(int));
+ il.Emit(OpCodes.Ldc_I4_0);
+ il.Emit(OpCodes.Stloc, loopVariable); // loopVariable = 0
+ il.Emit(OpCodes.Br, loopHead); // goto loopHead;
+
+ il.MarkLabel(loopStart);
+
+ il.Emit(OpCodes.Ldloc, instance); // instance
+ il.Emit(OpCodes.Ldloc, loopVariable); // instance, loopVariable
+ il.Emit(OpCodes.Ldelem, type); // &instance[loopVariable]
+ EmitScanValueType(il, type);
+
+
+ il.Emit(OpCodes.Ldloc, loopVariable); // loopVariable
+ il.Emit(OpCodes.Ldc_I4_1); // loopVariable, 1
+ il.Emit(OpCodes.Add); // loopVariable+1
+ il.Emit(OpCodes.Stloc, loopVariable); // loopVariable++;
+
+ il.MarkLabel(loopHead);
+ il.Emit(OpCodes.Ldloc, loopVariable); // loopVariable
+ il.Emit(OpCodes.Ldloc, instance); // loopVariable, instance
+ il.Emit(OpCodes.Ldlen); // loopVariable, instance.Length
+ il.Emit(OpCodes.Conv_I4);
+ il.Emit(OpCodes.Blt, loopStart); // if (loopVariable < instance.Length) goto loopStart;
+ } else if (type.IsValueType) {
+ // boxed value type
+ il.Emit(OpCodes.Ldarg_1);
+ il.Emit(OpCodes.Unbox_Any, type);
+ EmitScanValueType(il, type);
+ } else {
+ // reference type
+ var instance = il.DeclareLocal(type);
+ il.Emit(OpCodes.Ldarg_1);
+ il.Emit(OpCodes.Castclass, type);
+ il.Emit(OpCodes.Stloc, instance); // instance = (type)arg_1;
+
+ foreach (FieldInfo field in fields) {
+ EmitScanField(il, instance, field); // scan instance.Field
+ }
+ }
+ il.Emit(OpCodes.Ret);
+ return (ObjectScanner)dynamicMethod.CreateDelegate(typeof(ObjectScanner));
+ }
+
+ /// <summary>
+ /// Emit 'scan instance.Field'.
+ /// Stack transition: ... => ...
+ /// </summary>
+ void EmitScanField(ILGenerator il, LocalBuilder instance, FieldInfo field)
+ {
+ if (field.FieldType.IsValueType) {
+ il.Emit(OpCodes.Ldloc, instance); // instance
+ il.Emit(OpCodes.Ldfld, field); // instance.field
+ EmitScanValueType(il, field.FieldType);
+ } else {
+ il.Emit(OpCodes.Ldarg_0); // context
+ il.Emit(OpCodes.Ldloc, instance); // context, instance
+ il.Emit(OpCodes.Ldfld, field); // context, instance.field
+ il.Emit(OpCodes.Call, mark); // context.Mark(instance.field);
+ }
+ }
+
+ /// <summary>
+ /// Stack transition: ..., value => ...
+ /// </summary>
+ void EmitScanValueType(ILGenerator il, Type valType)
+ {
+ var fieldRef = il.DeclareLocal(valType);
+ il.Emit(OpCodes.Stloc, fieldRef);
+
+ foreach (FieldInfo field in GetSerializableFields(valType)) {
+ if (IsReferenceOrContainsReferences(field.FieldType)) {
+ EmitScanField(il, fieldRef, field);
+ }
+ }
+ }
+
+ static List<FieldInfo> GetSerializableFields(Type type)
+ {
+ List<FieldInfo> fields = new List<FieldInfo>();
+ for (Type baseType = type; baseType != null; baseType = baseType.BaseType) {
+ FieldInfo[] declFields = baseType.GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly);
+ Array.Sort(declFields, (a,b) => string.Compare(a.Name, b.Name, StringComparison.Ordinal));
+ fields.AddRange(declFields);
+ }
+ fields.RemoveAll(f => f.IsNotSerialized);
+ return fields;
+ }
+
+ static bool IsReferenceOrContainsReferences(Type type)
+ {
+ if (!type.IsValueType)
+ return true;
+ if (type.IsPrimitive)
+ return false;
+ foreach (FieldInfo field in GetSerializableFields(type)) {
+ if (IsReferenceOrContainsReferences(field.FieldType))
+ return true;
+ }
+ return false;
+ }
+ #endregion
+
+ #region Object Writers
+ delegate void ObjectWriter(SerializationContext context, object instance);
+
+ static readonly MethodInfo writeObjectID = typeof(SerializationContext).GetMethod("WriteObjectID", new[] { typeof(object) });
+
+ static readonly MethodInfo writeByte = typeof(BinaryWriter).GetMethod("Write", new[] { typeof(byte) });
+ static readonly MethodInfo writeShort = typeof(BinaryWriter).GetMethod("Write", new[] { typeof(short) });
+ static readonly MethodInfo writeInt = typeof(BinaryWriter).GetMethod("Write", new[] { typeof(int) });
+ static readonly MethodInfo writeLong = typeof(BinaryWriter).GetMethod("Write", new[] { typeof(long) });
+ static readonly MethodInfo writeFloat = typeof(BinaryWriter).GetMethod("Write", new[] { typeof(float) });
+ static readonly MethodInfo writeDouble = typeof(BinaryWriter).GetMethod("Write", new[] { typeof(double) });
+ OpCode callVirt = OpCodes.Callvirt;
+
+ static readonly ObjectWriter serializationInfoWriter = delegate(SerializationContext context, object instance) {
+ BinaryWriter writer = context.writer;
+ SerializationInfo info = (SerializationInfo)instance;
+ writer.Write(info.MemberCount);
+ foreach (SerializationEntry entry in info) {
+ writer.Write(entry.Name);
+ context.WriteObjectID(entry.Value);
+ }
+ };
+
+ Dictionary<Type, ObjectWriter> writers = new Dictionary<Type, ObjectWriter>();
+
+ ObjectWriter GetWriter(Type type)
+ {
+ ObjectWriter writer;
+ if (!writers.TryGetValue(type, out writer)) {
+ writer = CreateWriter(type);
+ writers.Add(type, writer);
+ }
+ return writer;
+ }
+
+ ObjectWriter CreateWriter(Type type)
+ {
+ if (type == typeof(string)) {
+ // String contents are written in the object creation section,
+ // not into the field value section.
+ return delegate {};
+ }
+ bool isArray = type.IsArray;
+ if (isArray) {
+ if (type.GetArrayRank() != 1)
+ throw new NotSupportedException();
+ type = type.GetElementType();
+ if (!type.IsValueType) {
+ return delegate (SerializationContext context, object array) {
+ foreach (object val in (object[])array) {
+ context.WriteObjectID(val);
+ }
+ };
+ } else if (type == typeof(byte)) {
+ return delegate (SerializationContext context, object array) {
+ context.writer.Write((byte[])array);
+ };
+ }
+ }
+ List<FieldInfo> fields = GetSerializableFields(type);
+ if (fields.Count == 0) {
+ // The writer has nothing to do for this object.
+ return delegate { };
+ }
+
+
+ DynamicMethod dynamicMethod = new DynamicMethod(
+ (isArray ? "WriteArray_" : "Write_") + type.Name,
+ typeof(void), new [] { typeof(SerializationContext), typeof(object) },
+ true);
+ ILGenerator il = dynamicMethod.GetILGenerator();
+
+ var writer = il.DeclareLocal(typeof(BinaryWriter));
+
+ il.Emit(OpCodes.Ldarg_0);
+ il.Emit(OpCodes.Ldfld, writerField);
+ il.Emit(OpCodes.Stloc, writer); // writer = context.writer;
+
+ if (isArray) {
+ var instance = il.DeclareLocal(type.MakeArrayType());
+ il.Emit(OpCodes.Ldarg_1);
+ il.Emit(OpCodes.Castclass, type.MakeArrayType());
+ il.Emit(OpCodes.Stloc, instance); // instance = (type[])arg_1;
+
+ // for (int i = 0; i < instance.Length; i++) write instance[i];
+
+ var loopStart = il.DefineLabel();
+ var loopHead = il.DefineLabel();
+ var loopVariable = il.DeclareLocal(typeof(int));
+ il.Emit(OpCodes.Ldc_I4_0);
+ il.Emit(OpCodes.Stloc, loopVariable); // loopVariable = 0
+ il.Emit(OpCodes.Br, loopHead); // goto loopHead;
+
+ il.MarkLabel(loopStart);
+
+ if (type.IsEnum || type.IsPrimitive) {
+ if (type.IsEnum) {
+ type = type.GetEnumUnderlyingType();
+ }
+ Debug.Assert(type.IsPrimitive);
+ il.Emit(OpCodes.Ldloc, writer); // writer
+ il.Emit(OpCodes.Ldloc, instance); // writer, instance
+ il.Emit(OpCodes.Ldloc, loopVariable); // writer, instance, loopVariable
+ switch (Type.GetTypeCode(type)) {
+ case TypeCode.Boolean:
+ case TypeCode.SByte:
+ case TypeCode.Byte:
+ il.Emit(OpCodes.Ldelem_I1); // writer, instance[loopVariable]
+ il.Emit(callVirt, writeByte); // writer.Write(instance[loopVariable]);
+ break;
+ case TypeCode.Char:
+ case TypeCode.Int16:
+ case TypeCode.UInt16:
+ il.Emit(OpCodes.Ldelem_I2); // writer, instance[loopVariable]
+ il.Emit(callVirt, writeShort); // writer.Write(instance[loopVariable]);
+ break;
+ case TypeCode.Int32:
+ case TypeCode.UInt32:
+ il.Emit(OpCodes.Ldelem_I4); // writer, instance[loopVariable]
+ il.Emit(callVirt, writeInt); // writer.Write(instance[loopVariable]);
+ break;
+ case TypeCode.Int64:
+ case TypeCode.UInt64:
+ il.Emit(OpCodes.Ldelem_I8); // writer, instance[loopVariable]
+ il.Emit(callVirt, writeLong); // writer.Write(instance[loopVariable]);
+ break;
+ case TypeCode.Single:
+ il.Emit(OpCodes.Ldelem_R4); // writer, instance[loopVariable]
+ il.Emit(callVirt, writeFloat); // writer.Write(instance[loopVariable]);
+ break;
+ case TypeCode.Double:
+ il.Emit(OpCodes.Ldelem_R8); // writer, instance[loopVariable]
+ il.Emit(callVirt, writeDouble); // writer.Write(instance[loopVariable]);
+ break;
+ default:
+ throw new NotSupportedException("Unknown primitive type " + type);
+ }
+ } else {
+ il.Emit(OpCodes.Ldloc, instance); // instance
+ il.Emit(OpCodes.Ldloc, loopVariable); // instance, loopVariable
+ il.Emit(OpCodes.Ldelem, type); // instance[loopVariable]
+ EmitWriteValueType(il, writer, type);
+ }
+
+ il.Emit(OpCodes.Ldloc, loopVariable); // loopVariable
+ il.Emit(OpCodes.Ldc_I4_1); // loopVariable, 1
+ il.Emit(OpCodes.Add); // loopVariable+1
+ il.Emit(OpCodes.Stloc, loopVariable); // loopVariable++;
+
+ il.MarkLabel(loopHead);
+ il.Emit(OpCodes.Ldloc, loopVariable); // loopVariable
+ il.Emit(OpCodes.Ldloc, instance); // loopVariable, instance
+ il.Emit(OpCodes.Ldlen); // loopVariable, instance.Length
+ il.Emit(OpCodes.Conv_I4);
+ il.Emit(OpCodes.Blt, loopStart); // if (loopVariable < instance.Length) goto loopStart;
+ } else if (type.IsValueType) {
+ // boxed value type
+ if (type.IsEnum || type.IsPrimitive) {
+ il.Emit(OpCodes.Ldloc, writer);
+ il.Emit(OpCodes.Ldarg_1);
+ il.Emit(OpCodes.Unbox_Any, type);
+ WritePrimitiveValue(il, type);
+ } else {
+ il.Emit(OpCodes.Ldarg_1);
+ il.Emit(OpCodes.Unbox_Any, type);
+ EmitWriteValueType(il, writer, type);
+ }
+ } else {
+ // reference type
+ var instance = il.DeclareLocal(type);
+ il.Emit(OpCodes.Ldarg_1);
+ il.Emit(OpCodes.Castclass, type);
+ il.Emit(OpCodes.Stloc, instance); // instance = (type)arg_1;
+
+ foreach (FieldInfo field in fields) {
+ EmitWriteField(il, writer, instance, field); // write instance.Field
+ }
+ }
+ il.Emit(OpCodes.Ret);
+ return (ObjectWriter)dynamicMethod.CreateDelegate(typeof(ObjectWriter));
+ }
+
+ /// <summary>
+ /// Emit 'write instance.Field'.
+ /// Stack transition: ... => ...
+ /// </summary>
+ void EmitWriteField(ILGenerator il, LocalBuilder writer, LocalBuilder instance, FieldInfo field)
+ {
+ Type fieldType = field.FieldType;
+ if (fieldType.IsValueType) {
+ if (fieldType.IsPrimitive || fieldType.IsEnum) {
+ il.Emit(OpCodes.Ldloc, writer); // writer
+ il.Emit(OpCodes.Ldloc, instance); // writer, instance
+ il.Emit(OpCodes.Ldfld, field); // writer, instance.field
+ WritePrimitiveValue(il, fieldType);
+ } else {
+ il.Emit(OpCodes.Ldloc, instance); // instance
+ il.Emit(OpCodes.Ldfld, field); // instance.field
+ EmitWriteValueType(il, writer, fieldType);
+ }
+ } else {
+ il.Emit(OpCodes.Ldarg_0); // context
+ il.Emit(OpCodes.Ldloc, instance); // context, instance
+ il.Emit(OpCodes.Ldfld, field); // context, instance.field
+ il.Emit(OpCodes.Call, writeObjectID); // context.WriteObjectID(instance.field);
+ }
+ }
+
+ /// <summary>
+ /// Writes a primitive value of the specified type.
+ /// Stack transition: ..., writer, value => ...
+ /// </summary>
+ void WritePrimitiveValue(ILGenerator il, Type fieldType)
+ {
+ if (fieldType.IsEnum) {
+ fieldType = fieldType.GetEnumUnderlyingType();
+ Debug.Assert(fieldType.IsPrimitive);
+ }
+ switch (Type.GetTypeCode(fieldType)) {
+ case TypeCode.Boolean:
+ case TypeCode.SByte:
+ case TypeCode.Byte:
+ il.Emit(callVirt, writeByte); // writer.Write(value);
+ break;
+ case TypeCode.Char:
+ case TypeCode.Int16:
+ case TypeCode.UInt16:
+ il.Emit(callVirt, writeShort); // writer.Write(value);
+ break;
+ case TypeCode.Int32:
+ case TypeCode.UInt32:
+ il.Emit(callVirt, writeInt); // writer.Write(value);
+ break;
+ case TypeCode.Int64:
+ case TypeCode.UInt64:
+ il.Emit(callVirt, writeLong); // writer.Write(value);
+ break;
+ case TypeCode.Single:
+ il.Emit(callVirt, writeFloat); // writer.Write(value);
+ break;
+ case TypeCode.Double:
+ il.Emit(callVirt, writeDouble); // writer.Write(value);
+ break;
+ default:
+ throw new NotSupportedException("Unknown primitive type " + fieldType);
+ }
+ }
+
+ /// <summary>
+ /// Stack transition: ..., value => ...
+ /// </summary>
+ void EmitWriteValueType(ILGenerator il, LocalBuilder writer, Type valType)
+ {
+ Debug.Assert(valType.IsValueType);
+ Debug.Assert(!(valType.IsEnum || valType.IsPrimitive));
+
+ var fieldVal = il.DeclareLocal(valType);
+ il.Emit(OpCodes.Stloc, fieldVal);
+
+ foreach (FieldInfo field in GetSerializableFields(valType)) {
+ EmitWriteField(il, writer, fieldVal, field);
+ }
+ }
+ #endregion
+
+ StreamingContext streamingContext = new StreamingContext(StreamingContextStates.All);
+ FormatterConverter formatterConverter = new FormatterConverter();
+
+ public void Serialize(Stream stream, object instance)
+ {
+ Serialize(new BinaryWriterWith7BitEncodedInts(stream), instance);
+ }
+
+ public void Serialize(BinaryWriter writer, object instance)
+ {
+ SerializationContext context = new SerializationContext(this, writer);
+ context.MarkFixedInstances(this.FixedInstances);
+ context.Mark(instance);
+ context.Scan();
+ context.ScanTypes();
+ context.Write();
+ context.WriteObjectID(instance);
+ }
+
+ delegate void TypeSerializer(object instance, SerializationContext context);
+ #endregion
+
+ #region Deserialization
+ sealed class DeserializationContext
+ {
+ public Type[] Types; // index: type ID
+
+ public object[] Objects; // index: object ID
+
+ public BinaryReader Reader;
+
+ public object ReadObject()
+ {
+ if (this.Objects.Length <= ushort.MaxValue)
+ return this.Objects[Reader.ReadUInt16()];
+ else
+ return this.Objects[Reader.ReadInt32()];
+ }
+
+ #region DeserializeTypeDescriptions
+ internal int ReadTypeID()
+ {
+ if (this.Types.Length <= ushort.MaxValue)
+ return Reader.ReadUInt16();
+ else
+ return Reader.ReadInt32();
+ }
+
+ internal void DeserializeTypeDescriptions()
+ {
+ for (int i = 0; i < this.Types.Length; i++) {
+ Type type = this.Types[i];
+ if (type.IsGenericTypeDefinition || type.HasElementType)
+ continue;
+ int versionNumber = Reader.ReadInt32();
+ if (versionNumber != FastSerializerVersionAttribute.GetVersionNumber(type))
+ throw new SerializationException("Type '" + type.FullName + "' was serialized with version " + versionNumber + ", but is version " + FastSerializerVersionAttribute.GetVersionNumber(type));
+
+ bool isCustomSerialization = typeof(ISerializable).IsAssignableFrom(type);
+ bool typeIsSpecial = type.IsPrimitive || isCustomSerialization;
+
+ byte serializedFieldCount = Reader.ReadByte();
+ if (serializedFieldCount == byte.MaxValue) {
+ // special type
+ if (!typeIsSpecial)
+ throw new SerializationException("Type '" + type.FullName + "' was serialized as special type, but isn't special now.");
+ } else {
+ if (typeIsSpecial)
+ throw new SerializationException("Type '" + type.FullName + "' wasn't serialized as special type, but is special now.");
+
+ var availableFields = GetSerializableFields(this.Types[i]);
+ if (availableFields.Count != serializedFieldCount)
+ throw new SerializationException("Number of fields on " + type.FullName + " has changed.");
+ for (int j = 0; j < serializedFieldCount; j++) {
+ int fieldTypeID = ReadTypeID();
+
+ string fieldName = Reader.ReadString();
+ FieldInfo fieldInfo = availableFields[j];
+ if (fieldInfo.Name != fieldName)
+ throw new SerializationException("Field mismatch on type " + type.FullName);
+ if (fieldInfo.FieldType != this.Types[fieldTypeID])
+ throw new SerializationException(type.FullName + "." + fieldName + " was serialized as " + this.Types[fieldTypeID] + ", but now is " + fieldInfo.FieldType);
+ }
+ }
+ }
+ }
+ #endregion
+ }
+
+ delegate void ObjectReader(DeserializationContext context, object instance);
+
+ public object Deserialize(Stream stream)
+ {
+ return Deserialize(new BinaryReaderWith7BitEncodedInts(stream));
+ }
+
+ public object Deserialize(BinaryReader reader)
+ {
+ if (reader.ReadInt32() != magic)
+ throw new SerializationException("The data cannot be read by FastSerializer (unknown magic value)");
+
+ DeserializationContext context = new DeserializationContext();
+ context.Reader = reader;
+ context.Objects = new object[reader.ReadInt32()];
+ context.Types = new Type[reader.ReadInt32()];
+ string[] assemblyNames = new string[reader.ReadInt32()];
+ int fixedInstanceCount = reader.ReadInt32();
+
+ if (fixedInstanceCount != 0) {
+ if (this.FixedInstances == null || this.FixedInstances.Length != fixedInstanceCount)
+ throw new SerializationException("Number of fixed instances doesn't match");
+ for (int i = 0; i < fixedInstanceCount; i++) {
+ context.Objects[i + 1] = this.FixedInstances[i];
+ }
+ }
+
+ for (int i = 0; i < assemblyNames.Length; i++) {
+ assemblyNames[i] = reader.ReadString();
+ }
+ int stringTypeID = -1;
+ for (int i = 0; i < context.Types.Length; i++) {
+ byte typeKind = reader.ReadByte();
+ switch (typeKind) {
+ case Type_ReferenceType:
+ case Type_ValueType:
+ int assemblyID;
+ if (assemblyNames.Length <= ushort.MaxValue)
+ assemblyID = reader.ReadUInt16();
+ else
+ assemblyID = reader.ReadInt32();
+ string assemblyName = assemblyNames[assemblyID];
+ string typeName = reader.ReadString();
+ Type type;
+ if (SerializationBinder != null) {
+ type = SerializationBinder.BindToType(assemblyName, typeName);
+ } else {
+ type = Assembly.Load(assemblyName).GetType(typeName);
+ }
+ if (type == null)
+ throw new SerializationException("Could not find '" + typeName + "' in '" + assemblyName + "'");
+ if (typeKind == Type_ValueType && !type.IsValueType)
+ throw new SerializationException("Expected '" + typeName + "' to be a value type, but it is reference type");
+ if (typeKind == Type_ReferenceType && type.IsValueType)
+ throw new SerializationException("Expected '" + typeName + "' to be a reference type, but it is value type");
+ context.Types[i] = type;
+ if (type == typeof(string))
+ stringTypeID = i;
+ break;
+ case Type_SZArray:
+ context.Types[i] = context.Types[context.ReadTypeID()].MakeArrayType();
+ break;
+ case Type_ParameterizedType:
+ Type genericType = context.Types[context.ReadTypeID()];
+ int typeParameterCount = genericType.GetGenericArguments().Length;
+ Type[] typeArguments = new Type[typeParameterCount];
+ for (int j = 0; j < typeArguments.Length; j++) {
+ typeArguments[j] = context.Types[context.ReadTypeID()];
+ }
+ context.Types[i] = genericType.MakeGenericType(typeArguments);
+ break;
+ default:
+ throw new SerializationException("Unknown type kind");
+ }
+ }
+ context.DeserializeTypeDescriptions();
+ int[] typeIDByObjectID = new int[context.Objects.Length];
+ for (int i = 1 + fixedInstanceCount; i < context.Objects.Length; i++) {
+ int typeID = context.ReadTypeID();
+
+ object instance;
+ if (typeID == stringTypeID) {
+ instance = reader.ReadString();
+ } else {
+ Type type = context.Types[typeID];
+ if (type.IsArray) {
+ int length = reader.ReadInt32();
+ instance = Array.CreateInstance(type.GetElementType(), length);
+ } else {
+ instance = FormatterServices.GetUninitializedObject(type);
+ }
+ }
+ context.Objects[i] = instance;
+ typeIDByObjectID[i] = typeID;
+ }
+ List<CustomDeserialization> customDeserializatons = new List<CustomDeserialization>();
+ ObjectReader[] objectReaders = new ObjectReader[context.Types.Length]; // index: type ID
+ for (int i = 1 + fixedInstanceCount; i < context.Objects.Length; i++) {
+ object instance = context.Objects[i];
+ int typeID = typeIDByObjectID[i];
+ Log("0x{2:x6} Read #{0}: {1}", i, context.Types[typeID].Name, reader.BaseStream.Position);
+ ISerializable serializable = instance as ISerializable;
+ if (serializable != null) {
+ Type type = context.Types[typeID];
+ SerializationInfo info = new SerializationInfo(type, formatterConverter);
+ int count = reader.ReadInt32();
+ for (int j = 0; j < count; j++) {
+ string name = reader.ReadString();
+ object val = context.ReadObject();
+ info.AddValue(name, val);
+ }
+ CustomDeserializationAction action = GetCustomDeserializationAction(type);
+ customDeserializatons.Add(new CustomDeserialization(instance, info, action));
+ } else {
+ ObjectReader objectReader = objectReaders[typeID];
+ if (objectReader == null) {
+ objectReader = GetReader(context.Types[typeID]);
+ objectReaders[typeID] = objectReader;
+ }
+ objectReader(context, instance);
+ }
+ }
+ Log("File was read successfully, now running {0} custom deserializations...", customDeserializatons.Count);
+ foreach (CustomDeserialization customDeserializaton in customDeserializatons) {
+ customDeserializaton.Run(streamingContext);
+ }
+ for (int i = 1 + fixedInstanceCount; i < context.Objects.Length; i++) {
+ IDeserializationCallback dc = context.Objects[i] as IDeserializationCallback;
+ if (dc != null)
+ dc.OnDeserialization(null);
+ }
+
+ return context.ReadObject();
+ }
+
+ #region Object Reader
+ static readonly FieldInfo readerField = typeof(DeserializationContext).GetField("Reader");
+ static readonly MethodInfo readObject = typeof(DeserializationContext).GetMethod("ReadObject");
+
+ static readonly MethodInfo readByte = typeof(BinaryReader).GetMethod("ReadByte");
+ static readonly MethodInfo readShort = typeof(BinaryReader).GetMethod("ReadInt16");
+ static readonly MethodInfo readInt = typeof(BinaryReader).GetMethod("ReadInt32");
+ static readonly MethodInfo readLong = typeof(BinaryReader).GetMethod("ReadInt64");
+ static readonly MethodInfo readFloat = typeof(BinaryReader).GetMethod("ReadSingle");
+ static readonly MethodInfo readDouble = typeof(BinaryReader).GetMethod("ReadDouble");
+
+ Dictionary<Type, ObjectReader> readers = new Dictionary<Type, ObjectReader>();
+
+ ObjectReader GetReader(Type type)
+ {
+ ObjectReader reader;
+ if (!readers.TryGetValue(type, out reader)) {
+ reader = CreateReader(type);
+ readers.Add(type, reader);
+ }
+ return reader;
+ }
+
+ ObjectReader CreateReader(Type type)
+ {
+ if (type == typeof(string)) {
+ // String contents are written in the object creation section,
+ // not into the field value section; so there's nothing to read here.
+ return delegate {};
+ }
+ bool isArray = type.IsArray;
+ if (isArray) {
+ if (type.GetArrayRank() != 1)
+ throw new NotSupportedException();
+ type = type.GetElementType();
+ if (!type.IsValueType) {
+ return delegate (DeserializationContext context, object arrayInstance) {
+ object[] array = (object[])arrayInstance;
+ for (int i = 0; i < array.Length; i++) {
+ array[i] = context.ReadObject();
+ }
+ };
+ } else if (type == typeof(byte)) {
+ return delegate (DeserializationContext context, object arrayInstance) {
+ byte[] array = (byte[])arrayInstance;
+ BinaryReader binaryReader = context.Reader;
+ int pos = 0;
+ int bytesRead;
+ do {
+ bytesRead = binaryReader.Read(array, pos, array.Length - pos);
+ pos += bytesRead;
+ } while (bytesRead > 0);
+ if (pos != array.Length)
+ throw new EndOfStreamException();
+ };
+ }
+ }
+ var fields = GetSerializableFields(type);
+ if (fields.Count == 0) {
+ // The reader has nothing to do for this object.
+ return delegate { };
+ }
+
+ DynamicMethod dynamicMethod = new DynamicMethod(
+ (isArray ? "ReadArray_" : "Read_") + type.Name,
+ MethodAttributes.Public | MethodAttributes.Static,
+ CallingConventions.Standard,
+ typeof(void), new [] { typeof(DeserializationContext), typeof(object) },
+ type,
+ true);
+ ILGenerator il = dynamicMethod.GetILGenerator();
+
+ var reader = il.DeclareLocal(typeof(BinaryReader));
+
+ il.Emit(OpCodes.Ldarg_0);
+ il.Emit(OpCodes.Ldfld, readerField);
+ il.Emit(OpCodes.Stloc, reader); // reader = context.reader;
+
+ if (isArray) {
+ var instance = il.DeclareLocal(type.MakeArrayType());
+ il.Emit(OpCodes.Ldarg_1);
+ il.Emit(OpCodes.Castclass, type.MakeArrayType());
+ il.Emit(OpCodes.Stloc, instance); // instance = (type[])arg_1;
+
+ // for (int i = 0; i < instance.Length; i++) read &instance[i];
+
+ var loopStart = il.DefineLabel();
+ var loopHead = il.DefineLabel();
+ var loopVariable = il.DeclareLocal(typeof(int));
+ il.Emit(OpCodes.Ldc_I4_0);
+ il.Emit(OpCodes.Stloc, loopVariable); // loopVariable = 0
+ il.Emit(OpCodes.Br, loopHead); // goto loopHead;
+
+ il.MarkLabel(loopStart);
+
+ if (type.IsEnum || type.IsPrimitive) {
+ if (type.IsEnum) {
+ type = type.GetEnumUnderlyingType();
+ }
+ Debug.Assert(type.IsPrimitive);
+ il.Emit(OpCodes.Ldloc, instance); // instance
+ il.Emit(OpCodes.Ldloc, loopVariable); // instance, loopVariable
+ ReadPrimitiveValue(il, reader, type); // instance, loopVariable, value
+ switch (Type.GetTypeCode(type)) {
+ case TypeCode.Boolean:
+ case TypeCode.SByte:
+ case TypeCode.Byte:
+ il.Emit(OpCodes.Stelem_I1); // instance[loopVariable] = value;
+ break;
+ case TypeCode.Char:
+ case TypeCode.Int16:
+ case TypeCode.UInt16:
+ il.Emit(OpCodes.Stelem_I2); // instance[loopVariable] = value;
+ break;
+ case TypeCode.Int32:
+ case TypeCode.UInt32:
+ il.Emit(OpCodes.Stelem_I4); // instance[loopVariable] = value;
+ break;
+ case TypeCode.Int64:
+ case TypeCode.UInt64:
+ il.Emit(OpCodes.Stelem_I8); // instance[loopVariable] = value;
+ break;
+ case TypeCode.Single:
+ il.Emit(OpCodes.Stelem_R4); // instance[loopVariable] = value;
+ break;
+ case TypeCode.Double:
+ il.Emit(OpCodes.Stelem_R8); // instance[loopVariable] = value;
+ break;
+ default:
+ throw new NotSupportedException("Unknown primitive type " + type);
+ }
+ } else {
+ il.Emit(OpCodes.Ldloc, instance); // instance
+ il.Emit(OpCodes.Ldloc, loopVariable); // instance, loopVariable
+ il.Emit(OpCodes.Ldelema, type); // instance[loopVariable]
+ EmitReadValueType(il, reader, type);
+ }
+
+ il.Emit(OpCodes.Ldloc, loopVariable); // loopVariable
+ il.Emit(OpCodes.Ldc_I4_1); // loopVariable, 1
+ il.Emit(OpCodes.Add); // loopVariable+1
+ il.Emit(OpCodes.Stloc, loopVariable); // loopVariable++;
+
+ il.MarkLabel(loopHead);
+ il.Emit(OpCodes.Ldloc, loopVariable); // loopVariable
+ il.Emit(OpCodes.Ldloc, instance); // loopVariable, instance
+ il.Emit(OpCodes.Ldlen); // loopVariable, instance.Length
+ il.Emit(OpCodes.Conv_I4);
+ il.Emit(OpCodes.Blt, loopStart); // if (loopVariable < instance.Length) goto loopStart;
+ } else if (type.IsValueType) {
+ // boxed value type
+ il.Emit(OpCodes.Ldarg_1); // instance
+ il.Emit(OpCodes.Unbox, type); // &(Type)instance
+ if (type.IsEnum || type.IsPrimitive) {
+ if (type.IsEnum) {
+ type = type.GetEnumUnderlyingType();
+ }
+ Debug.Assert(type.IsPrimitive);
+ ReadPrimitiveValue(il, reader, type); // &(Type)instance, value
+ switch (Type.GetTypeCode(type)) {
+ case TypeCode.Boolean:
+ case TypeCode.SByte:
+ case TypeCode.Byte:
+ il.Emit(OpCodes.Stind_I1);
+ break;
+ case TypeCode.Char:
+ case TypeCode.Int16:
+ case TypeCode.UInt16:
+ il.Emit(OpCodes.Stind_I2);
+ break;
+ case TypeCode.Int32:
+ case TypeCode.UInt32:
+ il.Emit(OpCodes.Stind_I4);
+ break;
+ case TypeCode.Int64:
+ case TypeCode.UInt64:
+ il.Emit(OpCodes.Stind_I8);
+ break;
+ case TypeCode.Single:
+ il.Emit(OpCodes.Stind_R4);
+ break;
+ case TypeCode.Double:
+ il.Emit(OpCodes.Stind_R8);
+ break;
+ default:
+ throw new NotSupportedException("Unknown primitive type " + type);
+ }
+ } else {
+ EmitReadValueType(il, reader, type);
+ }
+ } else {
+ // reference type
+ var instance = il.DeclareLocal(type);
+ il.Emit(OpCodes.Ldarg_1);
+ il.Emit(OpCodes.Castclass, type);
+ il.Emit(OpCodes.Stloc, instance); // instance = (type)arg_1;
+
+ foreach (FieldInfo field in fields) {
+ EmitReadField(il, reader, instance, field); // read instance.Field
+ }
+ }
+ il.Emit(OpCodes.Ret);
+ return (ObjectReader)dynamicMethod.CreateDelegate(typeof(ObjectReader));
+ }
+
+ void EmitReadField(ILGenerator il, LocalBuilder reader, LocalBuilder instance, FieldInfo field)
+ {
+ Type fieldType = field.FieldType;
+ if (fieldType.IsValueType) {
+ if (fieldType.IsPrimitive || fieldType.IsEnum) {
+ il.Emit(OpCodes.Ldloc, instance); // instance
+ ReadPrimitiveValue(il, reader, fieldType); // instance, value
+ il.Emit(OpCodes.Stfld, field); // instance.field = value;
+ } else {
+ il.Emit(OpCodes.Ldloc, instance); // instance
+ il.Emit(OpCodes.Ldflda, field); // &instance.field
+ EmitReadValueType(il, reader, fieldType);
+ }
+ } else {
+ il.Emit(OpCodes.Ldloc, instance); // instance
+ il.Emit(OpCodes.Ldarg_0); // instance, context
+ il.Emit(OpCodes.Call, readObject); // instance, context.ReadObject()
+ il.Emit(OpCodes.Castclass, fieldType);
+ il.Emit(OpCodes.Stfld, field); // instance.field = (fieldType) context.ReadObject();
+ }
+ }
+
+ /// <summary>
+ /// Reads a primitive value of the specified type.
+ /// Stack transition: ... => ..., value
+ /// </summary>
+ void ReadPrimitiveValue(ILGenerator il, LocalBuilder reader, Type fieldType)
+ {
+ if (fieldType.IsEnum) {
+ fieldType = fieldType.GetEnumUnderlyingType();
+ Debug.Assert(fieldType.IsPrimitive);
+ }
+ il.Emit(OpCodes.Ldloc, reader);
+ switch (Type.GetTypeCode(fieldType)) {
+ case TypeCode.Boolean:
+ case TypeCode.SByte:
+ case TypeCode.Byte:
+ il.Emit(callVirt, readByte);
+ break;
+ case TypeCode.Char:
+ case TypeCode.Int16:
+ case TypeCode.UInt16:
+ il.Emit(callVirt, readShort);
+ break;
+ case TypeCode.Int32:
+ case TypeCode.UInt32:
+ il.Emit(callVirt, readInt);
+ break;
+ case TypeCode.Int64:
+ case TypeCode.UInt64:
+ il.Emit(callVirt, readLong);
+ break;
+ case TypeCode.Single:
+ il.Emit(callVirt, readFloat);
+ break;
+ case TypeCode.Double:
+ il.Emit(callVirt, readDouble);
+ break;
+ default:
+ throw new NotSupportedException("Unknown primitive type " + fieldType);
+ }
+ }
+
+ /// <summary>
+ /// Stack transition: ..., field-ref => ...
+ /// </summary>
+ void EmitReadValueType(ILGenerator il, LocalBuilder reader, Type valType)
+ {
+ Debug.Assert(valType.IsValueType);
+ Debug.Assert(!(valType.IsEnum || valType.IsPrimitive));
+
+ var fieldRef = il.DeclareLocal(valType.MakeByRefType());
+ il.Emit(OpCodes.Stloc, fieldRef);
+
+ foreach (FieldInfo field in GetSerializableFields(valType)) {
+ EmitReadField(il, reader, fieldRef, field);
+ }
+ }
+ #endregion
+
+ #region Custom Deserialization
+ struct CustomDeserialization
+ {
+ readonly object instance;
+ readonly SerializationInfo serializationInfo;
+ readonly CustomDeserializationAction action;
+
+ public CustomDeserialization(object instance, SerializationInfo serializationInfo, CustomDeserializationAction action)
+ {
+ this.instance = instance;
+ this.serializationInfo = serializationInfo;
+ this.action = action;
+ }
+
+ public void Run(StreamingContext context)
+ {
+ action(instance, serializationInfo, context);
+ }
+ }
+
+ delegate void CustomDeserializationAction(object instance, SerializationInfo info, StreamingContext context);
+
+ Dictionary<Type, CustomDeserializationAction> customDeserializationActions = new Dictionary<Type, CustomDeserializationAction>();
+
+ CustomDeserializationAction GetCustomDeserializationAction(Type type)
+ {
+ CustomDeserializationAction action;
+ if (!customDeserializationActions.TryGetValue(type, out action)) {
+ action = CreateCustomDeserializationAction(type);
+ customDeserializationActions.Add(type, action);
+ }
+ return action;
+ }
+
+ static CustomDeserializationAction CreateCustomDeserializationAction(Type type)
+ {
+ ConstructorInfo ctor = type.GetConstructor(
+ BindingFlags.DeclaredOnly | BindingFlags.ExactBinding | BindingFlags.Instance
+ | BindingFlags.NonPublic | BindingFlags.Public,
+ null,
+ new Type [] { typeof(SerializationInfo), typeof(StreamingContext) },
+ null);
+ if (ctor == null)
+ throw new SerializationException("Could not find deserialization constructor for " + type.FullName);
+
+ DynamicMethod dynamicMethod = new DynamicMethod(
+ "CallCtor_" + type.Name,
+ MethodAttributes.Public | MethodAttributes.Static,
+ CallingConventions.Standard,
+ typeof(void), new [] { typeof(object), typeof(SerializationInfo), typeof(StreamingContext) },
+ type,
+ true);
+ ILGenerator il = dynamicMethod.GetILGenerator();
+ il.Emit(OpCodes.Ldarg_0);
+ il.Emit(OpCodes.Ldarg_1);
+ il.Emit(OpCodes.Ldarg_2);
+ il.Emit(OpCodes.Call, ctor);
+ il.Emit(OpCodes.Ret);
+ return (CustomDeserializationAction)dynamicMethod.CreateDelegate(typeof(CustomDeserializationAction));
+ }
+ #endregion
+ #endregion
+
+ [Conditional("DEBUG_SERIALIZER")]
+ static void Log(string format, params object[] args)
+ {
+ Debug.WriteLine(format, args);
+ }
+ }
+
+ /// <summary>
+ /// Specifies the version of the class.
+ /// The <see cref="FastSerializer"/> will refuse to deserialize an instance that was stored by
+ /// a different version of the class than the current one.
+ /// </summary>
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum)]
+ class FastSerializerVersionAttribute : Attribute
+ {
+ readonly int versionNumber;
+
+ public FastSerializerVersionAttribute(int versionNumber)
+ {
+ this.versionNumber = versionNumber;
+ }
+
+ public int VersionNumber {
+ get {
+ return versionNumber;
+ }
+ }
+
+ internal static int GetVersionNumber(Type type)
+ {
+ var arr = type.GetCustomAttributes(typeof(FastSerializerVersionAttribute), false);
+ if (arr.Length == 0)
+ return 0;
+ else
+ return ((FastSerializerVersionAttribute)arr[0]).VersionNumber;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/FindTokenHelper.cs b/main/src/addins/CSharpBinding/Util/FindTokenHelper.cs
new file mode 100644
index 0000000000..327f990410
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/FindTokenHelper.cs
@@ -0,0 +1,141 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ internal static class FindTokenHelper
+ {
+ /// <summary>
+ /// If the position is inside of token, return that token; otherwise, return the token to the right.
+ /// </summary>
+ public static SyntaxToken FindTokenOnRightOfPosition<TRoot>(
+ SyntaxNode root,
+ int position,
+ Func<SyntaxTriviaList, int, SyntaxToken> skippedTokenFinder,
+ bool includeSkipped = false,
+ bool includeDirectives = false,
+ bool includeDocumentationComments = false)
+ where TRoot : SyntaxNode
+ {
+ var findSkippedToken = skippedTokenFinder ?? ((l, p) => default(SyntaxToken));
+
+ var token = GetInitialToken<TRoot>(root, position, includeSkipped, includeDirectives, includeDocumentationComments);
+
+ if (position < token.SpanStart)
+ {
+ var skippedToken = findSkippedToken(token.LeadingTrivia, position);
+ token = skippedToken.RawKind != 0 ? skippedToken : token;
+ }
+ else if (token.Span.End <= position)
+ {
+ do
+ {
+ var skippedToken = findSkippedToken(token.TrailingTrivia, position);
+ token = skippedToken.RawKind != 0
+ ? skippedToken
+ : token.GetNextToken(includeZeroWidth: false, includeSkipped: includeSkipped, includeDirectives: includeDirectives, includeDocumentationComments: includeDocumentationComments);
+ }
+ while (token.RawKind != 0 && token.Span.End <= position && token.Span.End <= root.FullSpan.End);
+ }
+
+ if (token.Span.Length == 0)
+ {
+ token = token.GetNextToken();
+ }
+
+ return token;
+ }
+
+ /// <summary>
+ /// If the position is inside of token, return that token; otherwise, return the token to the left.
+ /// </summary>
+ public static SyntaxToken FindTokenOnLeftOfPosition<TRoot>(
+ SyntaxNode root,
+ int position,
+ Func<SyntaxTriviaList, int, SyntaxToken> skippedTokenFinder,
+ bool includeSkipped = false,
+ bool includeDirectives = false,
+ bool includeDocumentationComments = false)
+ where TRoot : SyntaxNode
+ {
+ var findSkippedToken = skippedTokenFinder ?? ((l, p) => default(SyntaxToken));
+
+ var token = GetInitialToken<TRoot>(root, position, includeSkipped, includeDirectives, includeDocumentationComments);
+
+ if (position <= token.SpanStart)
+ {
+ do
+ {
+ var skippedToken = findSkippedToken(token.LeadingTrivia, position);
+ token = skippedToken.RawKind != 0
+ ? skippedToken
+ : token.GetPreviousToken(includeZeroWidth: false, includeSkipped: includeSkipped, includeDirectives: includeDirectives, includeDocumentationComments: includeDocumentationComments);
+ }
+ while (position <= token.SpanStart && root.FullSpan.Start < token.SpanStart);
+ }
+ else if (token.Span.End < position)
+ {
+ var skippedToken = findSkippedToken(token.TrailingTrivia, position);
+ token = skippedToken.RawKind != 0 ? skippedToken : token;
+ }
+
+ if (token.Span.Length == 0)
+ {
+ token = token.GetPreviousToken();
+ }
+
+ return token;
+ }
+
+ private static SyntaxToken GetInitialToken<TRoot>(
+ SyntaxNode root,
+ int position,
+ bool includeSkipped = false,
+ bool includeDirectives = false,
+ bool includeDocumentationComments = false)
+ where TRoot : SyntaxNode
+ {
+ var token = (position < root.FullSpan.End || !(root is TRoot))
+ ? root.FindToken(position, includeSkipped || includeDirectives || includeDocumentationComments)
+ : root.GetLastToken(includeZeroWidth: true, includeSkipped: true, includeDirectives: true, includeDocumentationComments: true)
+ .GetPreviousToken(includeZeroWidth: false, includeSkipped: includeSkipped, includeDirectives: includeDirectives, includeDocumentationComments: includeDocumentationComments);
+ return token;
+ }
+
+ /// <summary>
+ /// Look inside a trivia list for a skipped token that contains the given position.
+ /// </summary>
+ public static SyntaxToken FindSkippedTokenBackward(IEnumerable<SyntaxToken> skippedTokenList, int position)
+ {
+ // the given skipped token list is already in order
+ var skippedTokenContainingPosition = skippedTokenList.LastOrDefault(skipped => skipped.Span.Length > 0 && skipped.SpanStart <= position);
+ if (skippedTokenContainingPosition != default(SyntaxToken))
+ {
+ return skippedTokenContainingPosition;
+ }
+
+ return default(SyntaxToken);
+ }
+
+ /// <summary>
+ /// Look inside a trivia list for a skipped token that contains the given position.
+ /// </summary>
+ public static SyntaxToken FindSkippedTokenForward(IEnumerable<SyntaxToken> skippedTokenList, int position)
+ {
+ // the given token list is already in order
+ var skippedTokenContainingPosition = skippedTokenList.FirstOrDefault(skipped => skipped.Span.Length > 0 && position <= skipped.Span.End);
+ if (skippedTokenContainingPosition != default(SyntaxToken))
+ {
+ return skippedTokenContainingPosition;
+ }
+
+ return default(SyntaxToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/FormatStringHelper.cs b/main/src/addins/CSharpBinding/Util/FormatStringHelper.cs
new file mode 100644
index 0000000000..563525da3e
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/FormatStringHelper.cs
@@ -0,0 +1,98 @@
+//
+// FormatStringHelper.cs
+//
+// Author:
+// Simon Lindgren <simon.n.lindgren@gmail.com>
+//
+// Copyright (c) 2012 Simon Lindgren
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.Threading;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class FormatStringHelper
+ {
+ static readonly string[] parameterNames = { "format", "frmt", "fmt" };
+
+ public static bool TryGetFormattingParameters(
+ SemanticModel semanticModel,
+ InvocationExpressionSyntax invocationExpression,
+ out ExpressionSyntax formatArgument, out IList<ExpressionSyntax> arguments,
+ Func<IParameterSymbol, ExpressionSyntax, bool> argumentFilter,
+ CancellationToken cancellationToken = default (CancellationToken))
+ {
+ if (semanticModel == null)
+ throw new ArgumentNullException("semanticModel");
+ if (invocationExpression == null)
+ throw new ArgumentNullException("invocationExpression");
+ var symbolInfo = semanticModel.GetSymbolInfo(invocationExpression.Expression, cancellationToken);
+ if (argumentFilter == null)
+ argumentFilter = (p, e) => true;
+
+ var symbol = symbolInfo.Symbol;
+ formatArgument = null;
+ arguments = new List<ExpressionSyntax>();
+ var method = symbol as IMethodSymbol;
+
+ if (method == null || method.Kind != SymbolKind.Method)
+ return false;
+
+ // Serach for method of type: void Name(string format, params object[] args);
+ IList<IMethodSymbol> methods = method.ContainingType.GetMembers (method.Name).OfType<IMethodSymbol>().ToList();
+ if (!methods.Any(m => m.Parameters.Length == 2 &&
+ m.Parameters[0].Type.SpecialType == SpecialType.System_String && parameterNames.Contains(m.Parameters[0].Name) &&
+ m.Parameters[1].IsParams))
+ return false;
+
+ //var argumentToParameterMap = invocationResolveResult.GetArgumentToParameterMap();
+ //var resolvedParameters = invocationResolveResult.Member.Parameters;
+ var allArguments = invocationExpression.ArgumentList.Arguments.ToArray();
+ for (int i = 0; i < allArguments.Length; i++) {
+ var parameterIndex = i; //argumentToParameterMap[i];
+ if (parameterIndex < 0 || parameterIndex >= method.Parameters.Length) {
+ // No valid mapping for this argument, skip it
+ continue;
+ }
+ var parameter = method.Parameters[parameterIndex];
+ var argument = allArguments[i];
+ if (i == 0 && parameter.Type.SpecialType == SpecialType.System_String && parameterNames.Contains(parameter.Name)) {
+ formatArgument = argument.Expression;
+ } /*else if (formatArgument != null && parameter.IsParams && !invocationResolveResult.IsExpandedForm) {
+ var ace = argument as ArrayCreateExpression;
+ if (ace == null || ace.Initializer.IsNull)
+ return false;
+ foreach (var element in ace.Initializer.Elements) {
+ if (argumentFilter(parameter, element))
+ arguments.Add(argument);
+ }
+ } else*/ if (formatArgument != null && argumentFilter(parameter, argument.Expression)) {
+ arguments.Add(argument.Expression);
+ }
+ }
+ return formatArgument != null;
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/GeneratedCodeRecognitionService.cs b/main/src/addins/CSharpBinding/Util/GeneratedCodeRecognitionService.cs
new file mode 100644
index 0000000000..7bae6c2031
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/GeneratedCodeRecognitionService.cs
@@ -0,0 +1,92 @@
+//
+// GeneratedCodeRecognitionService.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.IO;
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
+using System.Linq;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class GeneratedCodeRecognitionService
+ {
+ public static bool IsFileNameForGeneratedCode(string fileName)
+ {
+ if (fileName.StartsWith("TemporaryGeneratedFile_", StringComparison.OrdinalIgnoreCase))
+ {
+ return true;
+ }
+
+ string extension = Path.GetExtension(fileName);
+ if (extension != string.Empty)
+ {
+ fileName = Path.GetFileNameWithoutExtension(fileName);
+
+ if (fileName.EndsWith("AssemblyInfo", StringComparison.OrdinalIgnoreCase) ||
+ fileName.EndsWith(".designer", StringComparison.OrdinalIgnoreCase) ||
+ fileName.EndsWith(".generated", StringComparison.OrdinalIgnoreCase) ||
+ fileName.EndsWith(".g", StringComparison.OrdinalIgnoreCase) ||
+ fileName.EndsWith(".g.i", StringComparison.OrdinalIgnoreCase) ||
+ fileName.EndsWith(".AssemblyAttributes", StringComparison.OrdinalIgnoreCase))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private static IEnumerable<Location> GetPreferredSourceLocations(ISymbol symbol)
+ {
+ var locations = symbol.Locations;
+
+ // First return visible source locations if we have them. Else, go to the non-visible
+ // source locations.
+ var visibleSourceLocations = locations.Where(loc => loc.IsVisibleSourceLocation());
+ return visibleSourceLocations.Any()
+ ? visibleSourceLocations
+ : locations.Where(loc => loc.IsInSource);
+ }
+
+ public static IEnumerable<Location> GetPreferredSourceLocations(Solution solution, ISymbol symbol)
+ {
+ // Prefer non-generated source locations over generated ones.
+
+ var sourceLocations = GetPreferredSourceLocations(symbol);
+
+ var candidateLocationGroups = from c in sourceLocations
+ let doc = solution.GetDocument(c.SourceTree)
+ where doc != null
+ group c by IsFileNameForGeneratedCode(doc.FilePath);
+
+ var generatedSourceLocations = candidateLocationGroups.SingleOrDefault(g => g.Key) ?? SpecializedCollections.EmptyEnumerable<Location>();
+ var nonGeneratedSourceLocations = candidateLocationGroups.SingleOrDefault(g => !g.Key) ?? SpecializedCollections.EmptyEnumerable<Location>();
+
+ return nonGeneratedSourceLocations.Any() ? nonGeneratedSourceLocations : generatedSourceLocations;
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/Glyph.cs b/main/src/addins/CSharpBinding/Util/Glyph.cs
new file mode 100644
index 0000000000..912aa81f84
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/Glyph.cs
@@ -0,0 +1,130 @@
+//
+// Glyph.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ internal enum Glyph
+ {
+ Assembly,
+
+ BasicFile,
+ BasicProject,
+
+ ClassPublic,
+ ClassProtected,
+ ClassPrivate,
+ ClassInternal,
+
+ CSharpFile,
+ CSharpProject,
+
+ ConstantPublic,
+ ConstantProtected,
+ ConstantPrivate,
+ ConstantInternal,
+
+ DelegatePublic,
+ DelegateProtected,
+ DelegatePrivate,
+ DelegateInternal,
+
+ EnumPublic,
+ EnumProtected,
+ EnumPrivate,
+ EnumInternal,
+
+ EnumMember,
+
+ Error,
+
+ EventPublic,
+ EventProtected,
+ EventPrivate,
+ EventInternal,
+
+ ExtensionMethodPublic,
+ ExtensionMethodProtected,
+ ExtensionMethodPrivate,
+ ExtensionMethodInternal,
+
+ FieldPublic,
+ FieldProtected,
+ FieldPrivate,
+ FieldInternal,
+
+ InterfacePublic,
+ InterfaceProtected,
+ InterfacePrivate,
+ InterfaceInternal,
+
+ Intrinsic,
+
+ Keyword,
+
+ Label,
+
+ Local,
+
+ Namespace,
+
+ MethodPublic,
+ MethodProtected,
+ MethodPrivate,
+ MethodInternal,
+
+ ModulePublic,
+ ModuleProtected,
+ ModulePrivate,
+ ModuleInternal,
+
+ OpenFolder,
+
+ Operator,
+
+ Parameter,
+
+ PropertyPublic,
+ PropertyProtected,
+ PropertyPrivate,
+ PropertyInternal,
+
+ RangeVariable,
+
+ Reference,
+
+ StructurePublic,
+ StructureProtected,
+ StructurePrivate,
+ StructureInternal,
+
+ TypeParameter,
+
+ Snippet,
+
+ CompletionWarning
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/Hash.cs b/main/src/addins/CSharpBinding/Util/Hash.cs
new file mode 100644
index 0000000000..e6a2fa4ef0
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/Hash.cs
@@ -0,0 +1,350 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.IO;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class Hash
+ {
+ /// <summary>
+ /// This is how VB Anonymous Types combine hash values for fields.
+ /// </summary>
+ internal static int Combine(int newKey, int currentKey)
+ {
+ return unchecked((currentKey * (int)0xA5555529) + newKey);
+ }
+
+ internal static int Combine(bool newKeyPart, int currentKey)
+ {
+ return Combine(currentKey, newKeyPart ? 1 : 0);
+ }
+
+ /// <summary>
+ /// This is how VB Anonymous Types combine hash values for fields.
+ /// PERF: Do not use with enum types because that involves multiple
+ /// unnecessary boxing operations. Unfortunately, we can't constrain
+ /// T to "non-enum", so we'll use a more restrictive constraint.
+ /// </summary>
+ internal static int Combine<T>(T newKeyPart, int currentKey) where T : class
+ {
+ int hash = unchecked(currentKey * (int)0xA5555529);
+
+ if (newKeyPart != null)
+ {
+ return unchecked(hash + newKeyPart.GetHashCode());
+ }
+
+ return hash;
+ }
+
+ internal static int CombineValues<T>(IEnumerable<T> values, int maxItemsToHash = int.MaxValue)
+ {
+ if (values == null)
+ {
+ return 0;
+ }
+
+ var hashCode = 0;
+ var count = 0;
+ foreach (var value in values)
+ {
+ if (count++ >= maxItemsToHash)
+ {
+ break;
+ }
+
+ // Should end up with a constrained virtual call to object.GetHashCode (i.e. avoid boxing where possible).
+ if (value != null)
+ {
+ hashCode = Hash.Combine(value.GetHashCode(), hashCode);
+ }
+ }
+
+ return hashCode;
+ }
+
+ internal static int CombineValues<T>(T[] values, int maxItemsToHash = int.MaxValue)
+ {
+ if (values == null)
+ {
+ return 0;
+ }
+
+ var maxSize = Math.Min(maxItemsToHash, values.Length);
+ var hashCode = 0;
+
+ for (int i = 0; i < maxSize; i++)
+ {
+ T value = values[i];
+
+ // Should end up with a constrained virtual call to object.GetHashCode (i.e. avoid boxing where possible).
+ if (value != null)
+ {
+ hashCode = Hash.Combine(value.GetHashCode(), hashCode);
+ }
+ }
+
+ return hashCode;
+ }
+
+ internal static int CombineValues<T>(ImmutableArray<T> values, int maxItemsToHash = int.MaxValue)
+ {
+ if (values.IsDefaultOrEmpty)
+ {
+ return 0;
+ }
+
+ var hashCode = 0;
+ var count = 0;
+ foreach (var value in values)
+ {
+ if (count++ >= maxItemsToHash)
+ {
+ break;
+ }
+
+ // Should end up with a constrained virtual call to object.GetHashCode (i.e. avoid boxing where possible).
+ if (value != null)
+ {
+ hashCode = Hash.Combine(value.GetHashCode(), hashCode);
+ }
+ }
+
+ return hashCode;
+ }
+
+ internal static int CombineValues(IEnumerable<string> values, StringComparer stringComparer, int maxItemsToHash = int.MaxValue)
+ {
+ if (values == null)
+ {
+ return 0;
+ }
+
+ var hashCode = 0;
+ var count = 0;
+ foreach (var value in values)
+ {
+ if (count++ >= maxItemsToHash)
+ {
+ break;
+ }
+
+ if (value != null)
+ {
+ hashCode = Hash.Combine(stringComparer.GetHashCode(value), hashCode);
+ }
+ }
+
+ return hashCode;
+ }
+
+ /// <summary>
+ /// The offset bias value used in the FNV-1a algorithm
+ /// See http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
+ /// </summary>
+ internal const int FnvOffsetBias = unchecked((int)2166136261);
+
+ /// <summary>
+ /// The generative factor used in the FNV-1a algorithm
+ /// See http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
+ /// </summary>
+ internal const int FnvPrime = 16777619;
+
+ /// <summary>
+ /// Compute the FNV-1a hash of a sequence of bytes
+ /// See http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
+ /// </summary>
+ /// <param name="data">The sequence of bytes</param>
+ /// <returns>The FNV-1a hash of <paramref name="data"/></returns>
+ internal static int GetFNVHashCode(byte[] data)
+ {
+ int hashCode = Hash.FnvOffsetBias;
+
+ for (int i = 0; i < data.Length; i++)
+ {
+ hashCode = unchecked((hashCode ^ data[i]) * Hash.FnvPrime);
+ }
+
+ return hashCode;
+ }
+
+ /// <summary>
+ /// Compute the FNV-1a hash of a sequence of bytes and determines if the byte
+ /// sequence is valid ASCII and hence the hash code matches a char sequence
+ /// encoding the same text.
+ /// See http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
+ /// </summary>
+ /// <param name="data">The sequence of bytes that are likely to be ASCII text.</param>
+ /// <param name="length">The length of the sequence.</param>
+ /// <param name="isAscii">True if the sequence contains only characters in the ASCII range.</param>
+ /// <returns>The FNV-1a hash of <paramref name="data"/></returns>
+ internal static unsafe int GetFNVHashCode(byte* data, int length, out bool isAscii)
+ {
+ int hashCode = Hash.FnvOffsetBias;
+
+ byte asciiMask = 0;
+
+ for (int i = 0; i < length; i++)
+ {
+ byte b = data[i];
+ asciiMask |= b;
+ hashCode = unchecked((hashCode ^ b) * Hash.FnvPrime);
+ }
+
+ isAscii = (asciiMask & 0x80) == 0;
+ return hashCode;
+ }
+
+ /// <summary>
+ /// Compute the FNV-1a hash of a sequence of bytes
+ /// See http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
+ /// </summary>
+ /// <param name="data">The sequence of bytes</param>
+ /// <returns>The FNV-1a hash of <paramref name="data"/></returns>
+ internal static int GetFNVHashCode(ImmutableArray<byte> data)
+ {
+ int hashCode = Hash.FnvOffsetBias;
+
+ for (int i = 0; i < data.Length; i++)
+ {
+ hashCode = unchecked((hashCode ^ data[i]) * Hash.FnvPrime);
+ }
+
+ return hashCode;
+ }
+
+ /// <summary>
+ /// Compute the hashcode of a sub-string using FNV-1a
+ /// See http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
+ /// Note: FNV-1a was developed and tuned for 8-bit sequences. We're using it here
+ /// for 16-bit Unicode chars on the understanding that the majority of chars will
+ /// fit into 8-bits and, therefore, the algorithm will retain its desirable traits
+ /// for generating hash codes.
+ /// </summary>
+ /// <param name="text">The input string</param>
+ /// <param name="start">The start index of the first character to hash</param>
+ /// <param name="length">The number of characters, beginning with <paramref name="start"/> to hash</param>
+ /// <returns>The FNV-1a hash code of the substring beginning at <paramref name="start"/> and ending after <paramref name="length"/> characters.</returns>
+ internal static int GetFNVHashCode(string text, int start, int length)
+ {
+ int hashCode = Hash.FnvOffsetBias;
+ int end = start + length;
+
+ for (int i = start; i < end; i++)
+ {
+ hashCode = unchecked((hashCode ^ text[i]) * Hash.FnvPrime);
+ }
+
+ return hashCode;
+ }
+
+ /// <summary>
+ /// Compute the hashcode of a sub-string using FNV-1a
+ /// See http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
+ /// </summary>
+ /// <param name="text">The input string</param>
+ /// <param name="start">The start index of the first character to hash</param>
+ /// <returns>The FNV-1a hash code of the substring beginning at <paramref name="start"/> and ending at the end of the string.</returns>
+ internal static int GetFNVHashCode(string text, int start)
+ {
+ return GetFNVHashCode(text, start, length: text.Length - start);
+ }
+
+ /// <summary>
+ /// Compute the hashcode of a string using FNV-1a
+ /// See http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
+ /// </summary>
+ /// <param name="text">The input string</param>
+ /// <returns>The FNV-1a hash code of <paramref name="text"/></returns>
+ internal static int GetFNVHashCode(string text)
+ {
+ return CombineFNVHash(Hash.FnvOffsetBias, text);
+ }
+
+ /// <summary>
+ /// Compute the hashcode of a string using FNV-1a
+ /// See http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
+ /// </summary>
+ /// <param name="text">The input string</param>
+ /// <returns>The FNV-1a hash code of <paramref name="text"/></returns>
+ internal static int GetFNVHashCode(System.Text.StringBuilder text)
+ {
+ int hashCode = Hash.FnvOffsetBias;
+ int end = text.Length;
+
+ for (int i = 0; i < end; i++)
+ {
+ hashCode = unchecked((hashCode ^ text[i]) * Hash.FnvPrime);
+ }
+
+ return hashCode;
+ }
+
+ /// <summary>
+ /// Compute the hashcode of a sub string using FNV-1a
+ /// See http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
+ /// </summary>
+ /// <param name="text">The input string as a char array</param>
+ /// <param name="start">The start index of the first character to hash</param>
+ /// <param name="length">The number of characters, beginning with <paramref name="start"/> to hash</param>
+ /// <returns>The FNV-1a hash code of the substring beginning at <paramref name="start"/> and ending after <paramref name="length"/> characters.</returns>
+ internal static int GetFNVHashCode(char[] text, int start, int length)
+ {
+ int hashCode = Hash.FnvOffsetBias;
+ int end = start + length;
+
+ for (int i = start; i < end; i++)
+ {
+ hashCode = unchecked((hashCode ^ text[i]) * Hash.FnvPrime);
+ }
+
+ return hashCode;
+ }
+
+ /// <summary>
+ /// Compute the hashcode of a single character using the FNV-1a algorithm
+ /// See http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
+ /// Note: In general, this isn't any more useful than "char.GetHashCode". However,
+ /// it may be needed if you need to generate the same hash code as a string or
+ /// substring with just a single character.
+ /// </summary>
+ /// <param name="ch">The character to hash</param>
+ /// <returns>The FNV-1a hash code of the character.</returns>
+ internal static int GetFNVHashCode(char ch)
+ {
+ return Hash.CombineFNVHash(Hash.FnvOffsetBias, ch);
+ }
+
+ /// <summary>
+ /// Combine a string with an existing FNV-1a hash code
+ /// See http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
+ /// </summary>
+ /// <param name="hashCode">The accumulated hash code</param>
+ /// <param name="text">The string to combine</param>
+ /// <returns>The result of combining <paramref name="hashCode"/> with <paramref name="text"/> using the FNV-1a algorithm</returns>
+ internal static int CombineFNVHash(int hashCode, string text)
+ {
+ foreach (char ch in text)
+ {
+ hashCode = unchecked((hashCode ^ ch) * Hash.FnvPrime);
+ }
+
+ return hashCode;
+ }
+
+ /// <summary>
+ /// Combine a char with an existing FNV-1a hash code
+ /// See http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
+ /// </summary>
+ /// <param name="hashCode">The accumulated hash code</param>
+ /// <param name="ch">The new character to combine</param>
+ /// <returns>The result of combining <paramref name="hashCode"/> with <paramref name="ch"/> using the FNV-1a algorithm</returns>
+ internal static int CombineFNVHash(int hashCode, char ch)
+ {
+ return unchecked((hashCode ^ ch) * Hash.FnvPrime);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/HelpLink.cs b/main/src/addins/CSharpBinding/Util/HelpLink.cs
new file mode 100644
index 0000000000..6800e8c384
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/HelpLink.cs
@@ -0,0 +1,38 @@
+//
+// HelpLink.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class HelpLink
+ {
+ internal static string CreateFor (string diagnosticId)
+ {
+ return NRefactory6Host.GetHelpLinkForDiagnostic (diagnosticId);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/Util/IAssemblySymbolExtensions.cs b/main/src/addins/CSharpBinding/Util/IAssemblySymbolExtensions.cs
new file mode 100644
index 0000000000..7b5b2e1efe
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/IAssemblySymbolExtensions.cs
@@ -0,0 +1,84 @@
+//
+// IAssemblySymbolExtensions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class IAssemblySymbolExtensions
+ {
+ private const string AttributeSuffix = "Attribute";
+
+ public static bool ContainsNamespaceName(
+ this List<IAssemblySymbol> assemblies,
+ string namespaceName)
+ {
+ // PERF: Expansion of "assemblies.Any(a => a.NamespaceNames.Contains(namespaceName))"
+ // to avoid allocating a lambda.
+ foreach (var a in assemblies)
+ {
+ if (a.NamespaceNames.Contains(namespaceName))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool ContainsTypeName(this List<IAssemblySymbol> assemblies, string typeName, bool tryWithAttributeSuffix = false)
+ {
+ if (!tryWithAttributeSuffix)
+ {
+ // PERF: Expansion of "assemblies.Any(a => a.TypeNames.Contains(typeName))"
+ // to avoid allocating a lambda.
+ foreach (var a in assemblies)
+ {
+ if (a.TypeNames.Contains(typeName))
+ {
+ return true;
+ }
+ }
+ }
+ else
+ {
+ var attributeName = typeName + AttributeSuffix;
+ foreach (var a in assemblies)
+ {
+ var typeNames = a.TypeNames;
+ if (typeNames.Contains(typeName) || typeNames.Contains(attributeName))
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/ICodeDefinitionFactoryExtensions.cs b/main/src/addins/CSharpBinding/Util/ICodeDefinitionFactoryExtensions.cs
new file mode 100644
index 0000000000..781c4aecaa
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/ICodeDefinitionFactoryExtensions.cs
@@ -0,0 +1,147 @@
+using System;
+using System.Reflection;
+using System.Threading;
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Editing;
+using System.Collections.Immutable;
+using System.Linq;
+using System.Runtime.ExceptionServices;
+
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class ICodeDefinitionFactoryExtensions
+ {
+ readonly static Type typeInfo;
+
+ static ICodeDefinitionFactoryExtensions ()
+ {
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.Shared.Extensions.ICodeDefinitionFactoryExtensions" + ReflectionNamespaces.WorkspacesAsmName, true);
+ createFieldDelegatingConstructorMethod = typeInfo.GetMethod ("CreateFieldDelegatingConstructor", BindingFlags.Static | BindingFlags.Public);
+ createFieldsForParametersMethod = typeInfo.GetMethod ("CreateFieldsForParameters", BindingFlags.Static | BindingFlags.Public);
+ createAssignmentStatementMethod = typeInfo.GetMethod ("CreateAssignmentStatements", BindingFlags.Static | BindingFlags.Public);
+ createThrowNotImplementStatementMethod = typeInfo.GetMethod ("CreateThrowNotImplementStatement", new [] { typeof (SyntaxGenerator), typeof(Compilation) });
+
+ }
+
+ public static IList<SyntaxNode> CreateThrowNotImplementedStatementBlock(
+ this SyntaxGenerator codeDefinitionFactory,
+ Compilation compilation)
+ {
+ return new[] { CreateThrowNotImplementStatement(codeDefinitionFactory, compilation) };
+ }
+
+
+ static MethodInfo createThrowNotImplementStatementMethod;
+ public static SyntaxNode CreateThrowNotImplementStatement(
+ this SyntaxGenerator codeDefinitionFactory,
+ Compilation compilation)
+ {
+ try {
+ return (SyntaxNode)createThrowNotImplementStatementMethod.Invoke (null, new object[] { codeDefinitionFactory, compilation });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+
+ readonly static MethodInfo createFieldDelegatingConstructorMethod;
+
+ public static IEnumerable<ISymbol> CreateFieldDelegatingConstructor(
+ this SyntaxGenerator factory,
+ string typeName,
+ INamedTypeSymbol containingTypeOpt,
+ IList<IParameterSymbol> parameters,
+ IDictionary<string, ISymbol> parameterToExistingFieldMap,
+ IDictionary<string, string> parameterToNewFieldMap,
+ CancellationToken cancellationToken)
+ {
+ try {
+ return (IEnumerable<ISymbol>)createFieldDelegatingConstructorMethod.Invoke (null, new object[] {
+ factory,
+ typeName,
+ containingTypeOpt,
+ parameters,
+ parameterToExistingFieldMap,
+ parameterToNewFieldMap,
+ cancellationToken
+ });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ readonly static MethodInfo createFieldsForParametersMethod;
+
+ public static IEnumerable<IFieldSymbol> CreateFieldsForParameters(
+ this SyntaxGenerator factory,
+ IList<IParameterSymbol> parameters,
+ IDictionary<string, string> parameterToNewFieldMap)
+ {
+ try {
+ return (IEnumerable<IFieldSymbol>)createFieldsForParametersMethod.Invoke (null, new object[] {
+ factory,
+ parameters,
+ parameterToNewFieldMap
+ });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ readonly static MethodInfo createAssignmentStatementMethod;
+
+ public static IEnumerable<SyntaxNode> CreateAssignmentStatements(
+ this SyntaxGenerator factory,
+ IList<IParameterSymbol> parameters,
+ IDictionary<string, ISymbol> parameterToExistingFieldMap,
+ IDictionary<string, string> parameterToNewFieldMap)
+ {
+ try {
+ return (IEnumerable<SyntaxNode>)createAssignmentStatementMethod.Invoke (null, new object[] {
+ factory,
+ parameters,
+ parameterToExistingFieldMap,
+ parameterToNewFieldMap
+ });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ public static IList<SyntaxNode> CreateArguments(
+ this SyntaxGenerator factory,
+ ImmutableArray<IParameterSymbol> parameters)
+ {
+ return parameters.Select(p => CreateArgument(factory, p)).ToList();
+ }
+
+ private static SyntaxNode CreateArgument(
+ this SyntaxGenerator factory,
+ IParameterSymbol parameter)
+ {
+ return factory.Argument(parameter.RefKind, factory.IdentifierName(parameter.Name));
+ }
+
+ public static IMethodSymbol CreateBaseDelegatingConstructor(
+ this SyntaxGenerator factory,
+ IMethodSymbol constructor,
+ string typeName)
+ {
+ return CodeGenerationSymbolFactory.CreateConstructorSymbol(
+ attributes: null,
+ accessibility: Accessibility.Public,
+ modifiers: new DeclarationModifiers(),
+ typeName: typeName,
+ parameters: constructor.Parameters,
+ statements: null,
+ baseConstructorArguments: constructor.Parameters.Length == 0 ? null : factory.CreateArguments(constructor.Parameters));
+ }
+
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/ICompilationExtensions.cs b/main/src/addins/CSharpBinding/Util/ICompilationExtensions.cs
new file mode 100644
index 0000000000..28d70bbea1
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/ICompilationExtensions.cs
@@ -0,0 +1,124 @@
+//
+// ICompilationExtensions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class ICompilationExtensions
+ {
+ public static INamedTypeSymbol AttributeType(this Compilation compilation)
+ {
+ return compilation.GetTypeByMetadataName("System.Attribute");
+ }
+
+ public static INamedTypeSymbol ExceptionType(this Compilation compilation)
+ {
+ return compilation.GetTypeByMetadataName("System.Exception");
+ }
+
+ public static INamedTypeSymbol DesignerCategoryAttributeType(this Compilation compilation)
+ {
+ return compilation.GetTypeByMetadataName("System.ComponentModel.DesignerCategoryAttribute");
+ }
+
+ public static INamedTypeSymbol DesignerGeneratedAttributeType(this Compilation compilation)
+ {
+ return compilation.GetTypeByMetadataName("Microsoft.VisualBasic.CompilerServices.DesignerGeneratedAttribute");
+ }
+
+ public static INamedTypeSymbol HideModuleNameAttribute(this Compilation compilation)
+ {
+ return compilation.GetTypeByMetadataName("Microsoft.VisualBasic.HideModuleNameAttribute");
+ }
+
+ public static INamedTypeSymbol EventArgsType(this Compilation compilation)
+ {
+ return compilation.GetTypeByMetadataName("System.EventArgs");
+ }
+
+ public static INamedTypeSymbol NotImplementedExceptionType(this Compilation compilation)
+ {
+ return compilation.GetTypeByMetadataName("System.NotImplementedException");
+ }
+
+ public static INamedTypeSymbol EqualityComparerOfTType(this Compilation compilation)
+ {
+ return compilation.GetTypeByMetadataName("System.Collections.Generic.EqualityComparer`1");
+ }
+
+ public static INamedTypeSymbol ActionType(this Compilation compilation)
+ {
+ return compilation.GetTypeByMetadataName("System.Action");
+ }
+
+ public static INamedTypeSymbol ExpressionOfTType(this Compilation compilation)
+ {
+ return compilation.GetTypeByMetadataName("System.Linq.Expressions.Expression`1");
+ }
+
+ public static INamedTypeSymbol EditorBrowsableAttributeType(this Compilation compilation)
+ {
+ return compilation.GetTypeByMetadataName("System.ComponentModel.EditorBrowsableAttribute");
+ }
+
+ public static INamedTypeSymbol EditorBrowsableStateType(this Compilation compilation)
+ {
+ return compilation.GetTypeByMetadataName("System.ComponentModel.EditorBrowsableState");
+ }
+
+ public static INamedTypeSymbol TaskType(this Compilation compilation)
+ {
+ return compilation.GetTypeByMetadataName("System.Threading.Tasks.Task");
+ }
+
+ public static INamedTypeSymbol TaskOfTType(this Compilation compilation)
+ {
+ return compilation.GetTypeByMetadataName("System.Threading.Tasks.Task`1");
+ }
+
+ public static INamedTypeSymbol SerializableAttributeType(this Compilation compilation)
+ {
+ return compilation.GetTypeByMetadataName("System.SerializableAttribute");
+ }
+
+ public static INamedTypeSymbol CoClassType(this Compilation compilation)
+ {
+ return compilation.GetTypeByMetadataName("System.Runtime.InteropServices.CoClassAttribute");
+ }
+
+ public static INamedTypeSymbol ComAliasNameAttributeType(this Compilation compilation)
+ {
+ return compilation.GetTypeByMetadataName("System.Runtime.InteropServices.ComAliasNameAttribute");
+ }
+
+ public static INamedTypeSymbol SuppressMessageAttributeType(this Compilation compilation)
+ {
+ return compilation.GetTypeByMetadataName("System.Diagnostics.CodeAnalysis.SuppressMessageAttribute");
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/IDictionaryExtensions.cs b/main/src/addins/CSharpBinding/Util/IDictionaryExtensions.cs
new file mode 100644
index 0000000000..264f8b85f0
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/IDictionaryExtensions.cs
@@ -0,0 +1,90 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class IDictionaryExtensions
+ {
+ // Copied from ConcurrentDictionary since IDictionary doesn't have this useful method
+ public static V GetOrAdd<K, V>(this IDictionary<K, V> dictionary, K key, Func<K, V> function)
+ {
+ V value;
+ if (!dictionary.TryGetValue(key, out value))
+ {
+ value = function(key);
+ dictionary.Add(key, value);
+ }
+
+ return value;
+ }
+
+ public static TValue GetValueOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key)
+ {
+ TValue value;
+ if (dictionary.TryGetValue(key, out value))
+ {
+ return value;
+ }
+
+ return default(TValue);
+ }
+
+ public static bool DictionaryEquals<K, V>(this IDictionary<K, V> left, IDictionary<K, V> right, IEqualityComparer<KeyValuePair<K, V>> comparer = null)
+ {
+ comparer = comparer ?? EqualityComparer<KeyValuePair<K, V>>.Default;
+
+ // two dictionaries should have same number of entries
+ if (left.Count != right.Count)
+ {
+ return false;
+ }
+
+ // check two dictionaries have same key/value pairs
+ return left.All(pair => comparer.Equals(pair));
+ }
+
+ public static void MultiAdd<TKey, TValue, TCollection>(this IDictionary<TKey, TCollection> dictionary, TKey key, TValue value)
+ where TCollection : ICollection<TValue>, new()
+ {
+ TCollection collection;
+ if (!dictionary.TryGetValue(key, out collection))
+ {
+ collection = new TCollection();
+ dictionary.Add(key, collection);
+ }
+
+ collection.Add(value);
+ }
+
+ public static void MultiRemove<TKey, TValue, TCollection>(this IDictionary<TKey, TCollection> dictionary, TKey key, TValue value)
+ where TCollection : ICollection<TValue>
+ {
+ TCollection collection;
+ if (dictionary.TryGetValue(key, out collection))
+ {
+ collection.Remove(value);
+
+ if (collection.Count == 0)
+ {
+ dictionary.Remove(key);
+ }
+ }
+ }
+
+ public static void MultiAddRange<TKey, TValue, TCollection>(this IDictionary<TKey, TCollection> dictionary, TKey key, IEnumerable<TValue> values)
+ where TCollection : ICollection<TValue>, new()
+ {
+ TCollection collection;
+ if (!dictionary.TryGetValue(key, out collection))
+ {
+ collection = new TCollection();
+ dictionary.Add(key, collection);
+ }
+ foreach (var val in values)
+ collection.Add (val);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/IDocumentExtensions.cs b/main/src/addins/CSharpBinding/Util/IDocumentExtensions.cs
new file mode 100644
index 0000000000..00e100ee8e
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/IDocumentExtensions.cs
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class IDocumentExtensions
+ {
+ public static async Task<CompilationUnitSyntax> GetCSharpSyntaxRootAsync(this Document document, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ return (CompilationUnitSyntax)root;
+ }
+
+ public static Task<SyntaxTree> GetCSharpSyntaxTreeAsync(this Document document, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return document.GetSyntaxTreeAsync(cancellationToken);
+ }
+
+ public static Task<SemanticModel> GetCSharpSemanticModelAsync(this Document document, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return document.GetSemanticModelAsync(cancellationToken);
+ }
+
+ public static Task<SemanticModel> GetCSharpSemanticModelForNodeAsync(this Document document, SyntaxNode node, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return document.GetSemanticModelForNodeAsync(node, cancellationToken);
+ }
+
+ public static Task<SemanticModel> GetCSharpSemanticModelForSpanAsync(this Document document, TextSpan span, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return document.GetSemanticModelForSpanAsync(span, cancellationToken);
+ }
+
+ public static Task<Compilation> GetCSharpCompilationAsync(this Document document, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return document.Project.GetCompilationAsync(cancellationToken);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/IMethodSymbolExtensions.cs b/main/src/addins/CSharpBinding/Util/IMethodSymbolExtensions.cs
new file mode 100644
index 0000000000..cdb3788d4f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/IMethodSymbolExtensions.cs
@@ -0,0 +1,325 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Utilities;
+using Roslyn.Utilities;
+using System.Reflection;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class IMethodSymbolExtensions
+ {
+// public static bool CompatibleSignatureToDelegate(this IMethodSymbol method, INamedTypeSymbol delegateType)
+// {
+// //Contract.ThrowIfFalse(delegateType.TypeKind == TypeKind.Delegate);
+//
+// var invoke = delegateType.DelegateInvokeMethod;
+// if (invoke == null)
+// {
+// // It's possible to get events with no invoke method from metadata. We will assume
+// // that no method can be an event handler for one.
+// return false;
+// }
+//
+// if (method.Parameters.Length != invoke.Parameters.Length)
+// {
+// return false;
+// }
+//
+// if (method.ReturnsVoid != invoke.ReturnsVoid)
+// {
+// return false;
+// }
+//
+// if (!method.ReturnType.InheritsFromOrEquals(invoke.ReturnType))
+// {
+// return false;
+// }
+//
+// for (int i = 0; i < method.Parameters.Length; i++)
+// {
+// if (!invoke.Parameters[i].Type.InheritsFromOrEquals(method.Parameters[i].Type))
+// {
+// return false;
+// }
+// }
+//
+// return true;
+// }
+//
+ public static IMethodSymbol RenameTypeParameters(this IMethodSymbol method, IList<string> newNames)
+ {
+ if (method.TypeParameters.Select(t => t.Name).SequenceEqual(newNames))
+ {
+ return method;
+ }
+
+ var typeGenerator = new TypeGenerator();
+ var updatedTypeParameters = RenameTypeParameters(
+ method.TypeParameters, newNames, typeGenerator);
+
+ var mapping = new Dictionary<ITypeSymbol, ITypeSymbol>();
+ for (int i = 0; i < method.TypeParameters.Length; i++)
+ {
+ mapping.Add(method.TypeParameters[i], updatedTypeParameters[i]);
+ }
+
+ return CodeGenerationSymbolFactory.CreateMethodSymbol(
+ method.ContainingType,
+ method.GetAttributes(),
+ method.DeclaredAccessibility,
+ method.GetSymbolModifiers(),
+ method.ReturnType.SubstituteTypes(mapping, typeGenerator),
+ method.ExplicitInterfaceImplementations.FirstOrDefault(),
+ method.Name,
+ updatedTypeParameters,
+ method.Parameters.Select(p =>
+ CodeGenerationSymbolFactory.CreateParameterSymbol(p.GetAttributes(), p.RefKind, p.IsParams, p.Type.SubstituteTypes(mapping, typeGenerator), p.Name, p.IsOptional,
+ p.HasExplicitDefaultValue, p.HasExplicitDefaultValue ? p.ExplicitDefaultValue : null)).ToList());
+ }
+
+ public static IMethodSymbol RenameParameters(this IMethodSymbol method, IList<string> parameterNames)
+ {
+ var parameterList = method.Parameters;
+ if (parameterList.Select(p => p.Name).SequenceEqual(parameterNames))
+ {
+ return method;
+ }
+
+ var parameters = parameterList.RenameParameters(parameterNames);
+
+ return CodeGenerationSymbolFactory.CreateMethodSymbol(
+ method.ContainingType,
+ method.GetAttributes(),
+ method.DeclaredAccessibility,
+ method.GetSymbolModifiers(),
+ method.ReturnType,
+ method.ExplicitInterfaceImplementations.FirstOrDefault(),
+ method.Name,
+ method.TypeParameters,
+ parameters);
+ }
+
+ private static IList<ITypeParameterSymbol> RenameTypeParameters(
+ IList<ITypeParameterSymbol> typeParameters,
+ IList<string> newNames,
+ TypeGenerator typeGenerator)
+ {
+ // We generate the type parameter in two passes. The first creates the new type
+ // parameter. The second updates the constraints to point at this new type parameter.
+ var newTypeParameters = new List<CodeGenerationTypeParameterSymbol>();
+ var mapping = new Dictionary<ITypeSymbol, ITypeSymbol>();
+ for (int i = 0; i < typeParameters.Count; i++)
+ {
+ var typeParameter = typeParameters[i];
+
+ var newTypeParameter = new CodeGenerationTypeParameterSymbol(
+ typeParameter.ContainingType,
+ typeParameter.GetAttributes(),
+ typeParameter.Variance,
+ newNames[i],
+ typeParameter.ConstraintTypes,
+ typeParameter.HasConstructorConstraint,
+ typeParameter.HasReferenceTypeConstraint,
+ typeParameter.HasValueTypeConstraint,
+ typeParameter.Ordinal);
+
+ newTypeParameters.Add(newTypeParameter);
+ mapping.Add(typeParameter, (ITypeSymbol)newTypeParameter.Instance);
+ }
+
+ // Now we update the constraints.
+ foreach (var newTypeParameter in newTypeParameters)
+ {
+ newTypeParameter.ConstraintTypes = ImmutableArray.CreateRange(newTypeParameter.ConstraintTypes, t => t.SubstituteTypes(mapping, typeGenerator));
+ }
+
+ return newTypeParameters.Cast<ITypeParameterSymbol>().ToList();
+ }
+
+ public static IMethodSymbol EnsureNonConflictingNames(
+ this IMethodSymbol method, INamedTypeSymbol containingType, CancellationToken cancellationToken)
+ {
+ // The method's type parameters may conflict with the type parameters in the type
+ // we're generating into. In that case, rename them.
+ var parameterNames = NameGenerator.EnsureUniqueness(
+ method.Parameters.Select(p => p.Name).ToList(), isCaseSensitive: true);
+
+ var outerTypeParameterNames =
+ containingType.GetAllTypeParameters()
+ .Select(tp => tp.Name)
+ .Concat(method.Name)
+ .Concat(containingType.Name);
+
+ var unusableNames = parameterNames.Concat(outerTypeParameterNames).ToSet(StringComparer.Ordinal);
+
+ var newTypeParameterNames = NameGenerator.EnsureUniqueness(
+ method.TypeParameters.Select(tp => tp.Name).ToList(),
+ n => !unusableNames.Contains(n));
+
+ var updatedMethod = method.RenameTypeParameters(newTypeParameterNames);
+ return updatedMethod.RenameParameters(parameterNames);
+ }
+
+ public static IMethodSymbol RemoveAttributeFromParametersAndReturnType(
+ this IMethodSymbol method, INamedTypeSymbol attributeType,
+ IList<SyntaxNode> statements = null, IList<SyntaxNode> handlesExpressions = null)
+ {
+ if (attributeType == null)
+ {
+ return method;
+ }
+
+ var someParameterHasAttribute = method.Parameters
+ .Any(m => m.GetAttributes().Any(a => a.AttributeClass.Equals(attributeType)));
+
+ var returnTypeHasAttribute = method.GetReturnTypeAttributes()
+ .Any(a => a.AttributeClass.Equals(attributeType));
+
+ if (!someParameterHasAttribute && !returnTypeHasAttribute)
+ {
+ return method;
+ }
+
+ return CodeGenerationSymbolFactory.CreateMethodSymbol(
+ method.ContainingType,
+ method.GetAttributes(),
+ method.DeclaredAccessibility,
+ method.GetSymbolModifiers(),
+ method.ReturnType,
+ method.ExplicitInterfaceImplementations.FirstOrDefault(),
+ method.Name,
+ method.TypeParameters,
+ method.Parameters.Select(p =>
+ CodeGenerationSymbolFactory.CreateParameterSymbol(
+ p.GetAttributes().Where(a => !a.AttributeClass.Equals(attributeType)).ToList(),
+ p.RefKind, p.IsParams, p.Type, p.Name, p.IsOptional,
+ p.HasExplicitDefaultValue, p.HasExplicitDefaultValue ? p.ExplicitDefaultValue : null)).ToList(),
+ statements,
+ handlesExpressions,
+ method.GetReturnTypeAttributes().Where(a => !a.AttributeClass.Equals(attributeType)).ToList());
+ }
+
+ public static bool? IsMoreSpecificThan(this IMethodSymbol method1, IMethodSymbol method2)
+ {
+ var p1 = method1.Parameters;
+ var p2 = method2.Parameters;
+
+ // If the methods don't have the same parameter count, then method1 can't be more or
+ // less specific htan method2.
+ if (p1.Length != p2.Length)
+ {
+ return null;
+ }
+
+ // If the methods' parameter types differ, or they have different names, then one can't
+ // be more specific htan the other.
+ if (!SignatureComparer.HaveSameSignature(method1.Parameters, method2.Parameters) ||
+ !method1.Parameters.Select(p => p.Name).SequenceEqual(method2.Parameters.Select(p => p.Name)))
+ {
+ return null;
+ }
+
+ // Ok. We have two methods that look extremely similar to each other. However, one might
+ // be more specific if, for example, it was actually written with concrete types (like 'int')
+ // versus the other which may have been instantiated from a type parameter. i.e.
+ //
+ // class C<T> { void Foo(T t); void Foo(int t); }
+ //
+ // THe latter Foo is more specific when comparing "C<int>.Foo(int t)" (method1) vs
+ // "C<int>.Foo(int t)" (method2).
+ p1 = method1.OriginalDefinition.Parameters;
+ p2 = method2.OriginalDefinition.Parameters;
+ return p1.Select(p => p.Type).ToList().AreMoreSpecificThan(p2.Select(p => p.Type).ToList());
+ }
+
+ public static bool TryGetPredefinedComparisonOperator(this IMethodSymbol symbol, out PredefinedOperator op)
+ {
+ if (symbol.MethodKind == MethodKind.BuiltinOperator)
+ {
+ op = symbol.GetPredefinedOperator();
+ switch (op)
+ {
+ case PredefinedOperator.Equality:
+ case PredefinedOperator.Inequality:
+ case PredefinedOperator.GreaterThanOrEqual:
+ case PredefinedOperator.LessThanOrEqual:
+ case PredefinedOperator.GreaterThan:
+ case PredefinedOperator.LessThan:
+ return true;
+ }
+ }
+ else
+ {
+ op = PredefinedOperator.None;
+ }
+
+ return false;
+ }
+
+ public static PredefinedOperator GetPredefinedOperator(this IMethodSymbol symbol)
+ {
+ switch (symbol.Name)
+ {
+ case "op_Addition":
+ case "op_UnaryPlus":
+ return PredefinedOperator.Addition;
+ case "op_BitwiseAnd":
+ return PredefinedOperator.BitwiseAnd;
+ case "op_BitwiseOr":
+ return PredefinedOperator.BitwiseOr;
+ case "op_Concatenate":
+ return PredefinedOperator.Concatenate;
+ case "op_Decrement":
+ return PredefinedOperator.Decrement;
+ case "op_Division":
+ return PredefinedOperator.Division;
+ case "op_Equality":
+ return PredefinedOperator.Equality;
+ case "op_ExclusiveOr":
+ return PredefinedOperator.ExclusiveOr;
+ case "op_Exponent":
+ return PredefinedOperator.Exponent;
+ case "op_GreaterThan":
+ return PredefinedOperator.GreaterThan;
+ case "op_GreaterThanOrEqual":
+ return PredefinedOperator.GreaterThanOrEqual;
+ case "op_Increment":
+ return PredefinedOperator.Increment;
+ case "op_Inequality":
+ return PredefinedOperator.Inequality;
+ case "op_IntegerDivision":
+ return PredefinedOperator.IntegerDivision;
+ case "op_LeftShift":
+ return PredefinedOperator.LeftShift;
+ case "op_LessThan":
+ return PredefinedOperator.LessThan;
+ case "op_LessThanOrEqual":
+ return PredefinedOperator.LessThanOrEqual;
+ case "op_Like":
+ return PredefinedOperator.Like;
+ case "op_LogicalNot":
+ case "op_OnesComplement":
+ return PredefinedOperator.Complement;
+ case "op_Modulus":
+ return PredefinedOperator.Modulus;
+ case "op_Multiply":
+ return PredefinedOperator.Multiplication;
+ case "op_RightShift":
+ return PredefinedOperator.RightShift;
+ case "op_Subtraction":
+ case "op_UnaryNegation":
+ return PredefinedOperator.Subtraction;
+ default:
+ return PredefinedOperator.None;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/INamedTypeSymbolExtensions.cs b/main/src/addins/CSharpBinding/Util/INamedTypeSymbolExtensions.cs
new file mode 100644
index 0000000000..bce6cb39df
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/INamedTypeSymbolExtensions.cs
@@ -0,0 +1,518 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.FindSymbols;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static partial class INamedTypeSymbolExtensions
+ {
+ public static IEnumerable<INamedTypeSymbol> GetBaseTypesAndThis(this INamedTypeSymbol namedType)
+ {
+ var current = namedType;
+ while (current != null)
+ {
+ yield return current;
+ current = current.BaseType;
+ }
+ }
+
+// public static Task<IEnumerable<INamedTypeSymbol>> FindDerivedClassesAsync(
+// this INamedTypeSymbol type,
+// Solution solution,
+// CancellationToken cancellationToken)
+// {
+// return FindDerivedClassesAsync(type, solution, null, cancellationToken);
+// }
+
+// public static Task<IEnumerable<INamedTypeSymbol>> FindDerivedClassesAsync(
+// this INamedTypeSymbol type,
+// Solution solution,
+// IImmutableSet<Project> projects,
+// CancellationToken cancellationToken)
+// {
+// return DependentTypeFinder.FindDerivedClassesAsync(type, solution, projects, cancellationToken);
+// }
+//
+// public static Task<IEnumerable<INamedTypeSymbol>> FindDerivedInterfacesAsync(
+// this INamedTypeSymbol type,
+// Solution solution,
+// CancellationToken cancellationToken)
+// {
+// return FindDerivedInterfacesAsync(type, solution, null, cancellationToken);
+// }
+//
+// public static Task<IEnumerable<INamedTypeSymbol>> FindDerivedInterfacesAsync(
+// this INamedTypeSymbol type,
+// Solution solution,
+// IImmutableSet<Project> projects,
+// CancellationToken cancellationToken)
+// {
+// return DependentTypeFinder.FindDerivedInterfacesAsync(type, solution, projects, cancellationToken);
+// }
+//
+// public static Task<IEnumerable<INamedTypeSymbol>> FindImplementingTypesAsync(
+// this INamedTypeSymbol type,
+// Solution solution,
+// IImmutableSet<Project> projects,
+// CancellationToken cancellationToken)
+// {
+// return DependentTypeFinder.FindImplementingTypesAsync(type, solution, projects, cancellationToken);
+// }
+
+ public static IEnumerable<ITypeParameterSymbol> GetAllTypeParameters(this INamedTypeSymbol symbol)
+ {
+ var stack = GetContainmentStack(symbol);
+ return stack.SelectMany(n => n.TypeParameters);
+ }
+
+ public static IEnumerable<ITypeSymbol> GetAllTypeArguments(this INamedTypeSymbol symbol)
+ {
+ var stack = GetContainmentStack(symbol);
+ return stack.SelectMany(n => n.TypeArguments);
+ }
+
+ private static Stack<INamedTypeSymbol> GetContainmentStack(INamedTypeSymbol symbol)
+ {
+ var stack = new Stack<INamedTypeSymbol>();
+ for (var current = symbol; current != null; current = current.ContainingType)
+ {
+ stack.Push(current);
+ }
+
+ return stack;
+ }
+
+ public static bool IsContainedWithin(this INamedTypeSymbol symbol, INamedTypeSymbol outer)
+ {
+ // TODO(cyrusn): Should we be using OriginalSymbol here?
+ for (var current = symbol; current != null; current = current.ContainingType)
+ {
+ if (current.Equals(outer))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static ISymbol FindImplementationForAbstractMember(this INamedTypeSymbol type, ISymbol symbol)
+ {
+ if (symbol.IsAbstract)
+ {
+ return type.GetBaseTypesAndThis().SelectMany(t => t.GetMembers(symbol.Name))
+ .FirstOrDefault(s => symbol.Equals(GetOverriddenMember(s)));
+ }
+
+ return null;
+ }
+
+ private static ISymbol GetOverriddenMember(ISymbol symbol)
+ {
+ return symbol.TypeSwitch(
+ (IMethodSymbol method) => (ISymbol)method.OverriddenMethod,
+ (IPropertySymbol property) => property.OverriddenProperty,
+ (IEventSymbol @event) => @event.OverriddenEvent);
+ }
+
+ private static bool ImplementationExists(INamedTypeSymbol classOrStructType, ISymbol member)
+ {
+ return classOrStructType.FindImplementationForInterfaceMember(member) != null;
+ }
+
+ private static bool IsImplemented(
+ this INamedTypeSymbol classOrStructType,
+ ISymbol member,
+ Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation,
+ CancellationToken cancellationToken)
+ {
+ if (member.ContainingType.TypeKind == TypeKind.Interface)
+ {
+ if (member.Kind == SymbolKind.Property)
+ {
+ return IsInterfacePropertyImplemented(classOrStructType, (IPropertySymbol)member, cancellationToken);
+ }
+ else
+ {
+ return isValidImplementation(classOrStructType, member);
+ }
+ }
+
+ if (member.IsAbstract)
+ {
+ if (member.Kind == SymbolKind.Property)
+ {
+ return IsAbstractPropertyImplemented(classOrStructType, (IPropertySymbol)member, cancellationToken);
+ }
+ else
+ {
+ return classOrStructType.FindImplementationForAbstractMember(member) != null;
+ }
+ }
+
+ return true;
+ }
+
+ private static bool IsInterfacePropertyImplemented(INamedTypeSymbol classOrStructType, IPropertySymbol propertySymbol, CancellationToken cancellationToken)
+ {
+ // A property is only fully implemented if both it's setter and getter is implemented.
+ if (propertySymbol.GetMethod != null)
+ {
+ if (classOrStructType.FindImplementationForInterfaceMember(propertySymbol.GetMethod) == null)
+ {
+ return false;
+ }
+ }
+
+ if (propertySymbol.SetMethod != null)
+ {
+ if (classOrStructType.FindImplementationForInterfaceMember(propertySymbol.SetMethod) == null)
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private static bool IsAbstractPropertyImplemented(INamedTypeSymbol classOrStructType, IPropertySymbol propertySymbol, CancellationToken cancellationToken)
+ {
+ // A property is only fully implemented if both it's setter and getter is implemented.
+ if (propertySymbol.GetMethod != null)
+ {
+ if (classOrStructType.FindImplementationForAbstractMember(propertySymbol.GetMethod) == null)
+ {
+ return false;
+ }
+ }
+
+ if (propertySymbol.SetMethod != null)
+ {
+ if (classOrStructType.FindImplementationForAbstractMember(propertySymbol.SetMethod) == null)
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private static bool IsExplicitlyImplemented(
+ this INamedTypeSymbol classOrStructType,
+ ISymbol member,
+ Func<INamedTypeSymbol, ISymbol, bool> isValid,
+ CancellationToken cancellationToken)
+ {
+ var implementation = classOrStructType.FindImplementationForInterfaceMember(member);
+ return implementation.TypeSwitch(
+ (IEventSymbol @event) => @event.ExplicitInterfaceImplementations.Length > 0,
+ (IMethodSymbol method) => method.ExplicitInterfaceImplementations.Length > 0,
+ (IPropertySymbol property) => property.ExplicitInterfaceImplementations.Length > 0);
+ }
+
+ public static IList<Tuple<INamedTypeSymbol, IList<ISymbol>>> GetAllUnimplementedMembers(
+ this INamedTypeSymbol classOrStructType,
+ IEnumerable<INamedTypeSymbol> interfacesOrAbstractClasses,
+ CancellationToken cancellationToken)
+ {
+ return classOrStructType.GetAllUnimplementedMembers(
+ interfacesOrAbstractClasses,
+ IsImplemented,
+ ImplementationExists,
+ GetMembers,
+ allowReimplementation: false,
+ cancellationToken: cancellationToken);
+ }
+
+ public static IList<Tuple<INamedTypeSymbol, IList<ISymbol>>> GetAllUnimplementedMembersInThis(
+ this INamedTypeSymbol classOrStructType,
+ IEnumerable<INamedTypeSymbol> interfacesOrAbstractClasses,
+ CancellationToken cancellationToken)
+ {
+ return classOrStructType.GetAllUnimplementedMembers(
+ interfacesOrAbstractClasses,
+ IsImplemented,
+ (t, m) =>
+ {
+ var implementation = classOrStructType.FindImplementationForInterfaceMember(m);
+ return implementation != null && implementation.ContainingType == classOrStructType;
+ },
+ GetMembers,
+ allowReimplementation: true,
+ cancellationToken: cancellationToken);
+ }
+
+ public static IList<Tuple<INamedTypeSymbol, IList<ISymbol>>> GetAllUnimplementedMembersInThis(
+ this INamedTypeSymbol classOrStructType,
+ IEnumerable<INamedTypeSymbol> interfacesOrAbstractClasses,
+ Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter,
+ CancellationToken cancellationToken)
+ {
+ return classOrStructType.GetAllUnimplementedMembers(
+ interfacesOrAbstractClasses,
+ IsImplemented,
+ (t, m) =>
+ {
+ var implementation = classOrStructType.FindImplementationForInterfaceMember(m);
+ return implementation != null && implementation.ContainingType == classOrStructType;
+ },
+ interfaceMemberGetter,
+ allowReimplementation: true,
+ cancellationToken: cancellationToken);
+ }
+
+ public static IList<Tuple<INamedTypeSymbol, IList<ISymbol>>> GetAllUnimplementedMembers(
+ this INamedTypeSymbol classOrStructType,
+ IEnumerable<INamedTypeSymbol> interfacesOrAbstractClasses,
+ Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter,
+ CancellationToken cancellationToken)
+ {
+ return classOrStructType.GetAllUnimplementedMembers(
+ interfacesOrAbstractClasses,
+ IsImplemented,
+ ImplementationExists,
+ interfaceMemberGetter,
+ allowReimplementation: false,
+ cancellationToken: cancellationToken);
+ }
+
+ public static IList<Tuple<INamedTypeSymbol, IList<ISymbol>>> GetAllUnimplementedExplicitMembers(
+ this INamedTypeSymbol classOrStructType,
+ IEnumerable<INamedTypeSymbol> interfaces,
+ CancellationToken cancellationToken)
+ {
+ return classOrStructType.GetAllUnimplementedMembers(
+ interfaces,
+ IsExplicitlyImplemented,
+ ImplementationExists,
+ GetMembers,
+ allowReimplementation: false,
+ cancellationToken: cancellationToken);
+ }
+
+ public static IList<Tuple<INamedTypeSymbol, IList<ISymbol>>> GetAllUnimplementedExplicitMembers(
+ this INamedTypeSymbol classOrStructType,
+ IEnumerable<INamedTypeSymbol> interfaces,
+ Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter,
+ CancellationToken cancellationToken)
+ {
+ return classOrStructType.GetAllUnimplementedMembers(
+ interfaces,
+ IsExplicitlyImplemented,
+ ImplementationExists,
+ interfaceMemberGetter,
+ allowReimplementation: false,
+ cancellationToken: cancellationToken);
+ }
+
+ private static IList<Tuple<INamedTypeSymbol, IList<ISymbol>>> GetAllUnimplementedMembers(
+ this INamedTypeSymbol classOrStructType,
+ IEnumerable<INamedTypeSymbol> interfacesOrAbstractClasses,
+ Func<INamedTypeSymbol, ISymbol, Func<INamedTypeSymbol, ISymbol, bool>, CancellationToken, bool> isImplemented,
+ Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation,
+ Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter,
+ bool allowReimplementation,
+ CancellationToken cancellationToken)
+ {
+// Contract.ThrowIfNull(classOrStructType);
+// Contract.ThrowIfNull(interfacesOrAbstractClasses);
+// Contract.ThrowIfNull(isImplemented);
+
+ if (classOrStructType.TypeKind != TypeKind.Class && classOrStructType.TypeKind != TypeKind.Struct)
+ {
+ return SpecializedCollections.EmptyList<Tuple<INamedTypeSymbol, IList<ISymbol>>>();
+ }
+
+ if (!interfacesOrAbstractClasses.Any())
+ {
+ return SpecializedCollections.EmptyList<Tuple<INamedTypeSymbol, IList<ISymbol>>>();
+ }
+
+ if (!interfacesOrAbstractClasses.All(i => i.TypeKind == TypeKind.Interface) &&
+ !interfacesOrAbstractClasses.All(i => i.IsAbstractClass()))
+ {
+ return SpecializedCollections.EmptyList<Tuple<INamedTypeSymbol, IList<ISymbol>>>();
+ }
+
+ var typesToImplement = GetTypesToImplement(classOrStructType, interfacesOrAbstractClasses, allowReimplementation, cancellationToken);
+ return typesToImplement.Select(s => Tuple.Create(s, GetUnimplementedMembers(classOrStructType, s, isImplemented, isValidImplementation, interfaceMemberGetter, cancellationToken)))
+ .Where(t => t.Item2.Count > 0)
+ .ToList();
+ }
+
+ private static IList<INamedTypeSymbol> GetTypesToImplement(
+ INamedTypeSymbol classOrStructType,
+ IEnumerable<INamedTypeSymbol> interfacesOrAbstractClasses,
+ bool allowReimplementation,
+ CancellationToken cancellationToken)
+ {
+ return interfacesOrAbstractClasses.First().TypeKind == TypeKind.Interface
+ ? GetInterfacesToImplement(classOrStructType, interfacesOrAbstractClasses, allowReimplementation, cancellationToken)
+ : GetAbstractClassesToImplement(classOrStructType, interfacesOrAbstractClasses, cancellationToken);
+ }
+
+ private static IList<INamedTypeSymbol> GetAbstractClassesToImplement(
+ INamedTypeSymbol classOrStructType,
+ IEnumerable<INamedTypeSymbol> abstractClasses,
+ CancellationToken cancellationToken)
+ {
+ return abstractClasses.SelectMany(a => a.GetBaseTypesAndThis())
+ .Where(t => t.IsAbstractClass())
+ .ToList();
+ }
+
+ private static IList<INamedTypeSymbol> GetInterfacesToImplement(
+ INamedTypeSymbol classOrStructType,
+ IEnumerable<INamedTypeSymbol> interfaces,
+ bool allowReimplementation,
+ CancellationToken cancellationToken)
+ {
+ // We need to not only implement the specified interface, but also everything it
+ // inherits from.
+ cancellationToken.ThrowIfCancellationRequested();
+ var interfacesToImplement = new List<INamedTypeSymbol>(
+ interfaces.SelectMany(i => i.GetAllInterfacesIncludingThis()).Distinct());
+
+ // However, there's no need to reimplement any interfaces that our base types already
+ // implement. By definition they must contain all the necessary methods.
+ var baseType = classOrStructType.BaseType;
+ var alreadyImplementedInterfaces = baseType == null || allowReimplementation
+ ? SpecializedCollections.EmptyEnumerable<INamedTypeSymbol>()
+ : baseType.AllInterfaces;
+
+ cancellationToken.ThrowIfCancellationRequested();
+ foreach (var i in alreadyImplementedInterfaces)
+ interfacesToImplement.Remove (i);
+ return interfacesToImplement;
+ }
+
+ private static IList<ISymbol> GetUnimplementedMembers(
+ this INamedTypeSymbol classOrStructType,
+ INamedTypeSymbol interfaceType,
+ Func<INamedTypeSymbol, ISymbol, Func<INamedTypeSymbol, ISymbol, bool>, CancellationToken, bool> isImplemented,
+ Func<INamedTypeSymbol, ISymbol, bool> isValidImplementation,
+ Func<INamedTypeSymbol, ISymbol, ImmutableArray<ISymbol>> interfaceMemberGetter,
+ CancellationToken cancellationToken)
+ {
+ var q = from m in interfaceMemberGetter(interfaceType, classOrStructType)
+ where m.Kind != SymbolKind.NamedType
+ where m.Kind != SymbolKind.Method || ((IMethodSymbol)m).MethodKind == MethodKind.Ordinary
+ where m.Kind != SymbolKind.Property || ((IPropertySymbol)m).IsIndexer || ((IPropertySymbol)m).CanBeReferencedByName
+ where m.Kind != SymbolKind.Event || ((IEventSymbol)m).CanBeReferencedByName
+ where !isImplemented(classOrStructType, m, isValidImplementation, cancellationToken)
+ select m;
+
+ return q.ToList();
+ }
+
+ public static IEnumerable<ISymbol> GetAttributeNamedParameters(
+ this INamedTypeSymbol attributeSymbol,
+ Compilation compilation,
+ ISymbol within)
+ {
+ var systemAttributeType = compilation.AttributeType();
+
+ foreach (var type in attributeSymbol.GetBaseTypesAndThis())
+ {
+ if (type.Equals(systemAttributeType))
+ {
+ break;
+ }
+
+ foreach (var member in type.GetMembers())
+ {
+ var namedParameter = IsAttributeNamedParameter(member, within ?? compilation.Assembly);
+ if (namedParameter != null)
+ {
+ yield return namedParameter;
+ }
+ }
+ }
+ }
+
+ private static ISymbol IsAttributeNamedParameter(
+ ISymbol symbol,
+ ISymbol within)
+ {
+ if (!symbol.CanBeReferencedByName ||
+ !symbol.IsAccessibleWithin(within))
+ {
+ return null;
+ }
+
+ switch (symbol.Kind)
+ {
+ case SymbolKind.Field:
+ var fieldSymbol = (IFieldSymbol)symbol;
+ if (!fieldSymbol.IsConst &&
+ !fieldSymbol.IsReadOnly &&
+ !fieldSymbol.IsStatic)
+ {
+ return fieldSymbol;
+ }
+
+ break;
+
+ case SymbolKind.Property:
+ var propertySymbol = (IPropertySymbol)symbol;
+ if (!propertySymbol.IsReadOnly &&
+ !propertySymbol.IsWriteOnly &&
+ !propertySymbol.IsStatic &&
+ propertySymbol.GetMethod != null &&
+ propertySymbol.SetMethod != null &&
+ propertySymbol.GetMethod.IsAccessibleWithin(within) &&
+ propertySymbol.SetMethod.IsAccessibleWithin(within))
+ {
+ return propertySymbol;
+ }
+
+ break;
+ }
+
+ return null;
+ }
+
+ private static ImmutableArray<ISymbol> GetMembers(INamedTypeSymbol type, ISymbol within)
+ {
+ return type.GetMembers();
+ }
+
+ public static INamespaceOrTypeSymbol GenerateRootNamespaceOrType(this INamedTypeSymbol namedType, string[] containers)
+ {
+ INamespaceOrTypeSymbol currentSymbol = namedType;
+ for (int i = containers.Length - 1; i >= 0; i--)
+ {
+ currentSymbol = CodeGenerationSymbolFactory.CreateNamespaceSymbol(containers[i], members: new[] { currentSymbol });
+ }
+
+ return currentSymbol;
+ }
+
+ public static bool LastEnumValueHasInitializer(this INamedTypeSymbol namedTypeSymbol)
+ {
+ var enumDecl = namedTypeSymbol.DeclaringSyntaxReferences.Select(r => r.GetSyntax()).OfType<EnumDeclarationSyntax>().FirstOrDefault();
+ if (enumDecl != null)
+ {
+ var lastMember = enumDecl.Members.LastOrDefault();
+ if (lastMember != null)
+ {
+ return lastMember.EqualsValue != null;
+ }
+ }
+
+ return false;
+ }
+
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/INamespaceOrTypeSymbolExtensions.cs b/main/src/addins/CSharpBinding/Util/INamespaceOrTypeSymbolExtensions.cs
new file mode 100644
index 0000000000..8d82d1473e
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/INamespaceOrTypeSymbolExtensions.cs
@@ -0,0 +1,69 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static partial class INamespaceOrTypeSymbolExtensions
+ {
+ private static readonly ConditionalWeakTable<INamespaceOrTypeSymbol, List<string>> s_namespaceOrTypeToNameMap =
+ new ConditionalWeakTable<INamespaceOrTypeSymbol, List<string>>();
+
+ private static readonly SymbolDisplayFormat s_shortNameFormat = new SymbolDisplayFormat(
+ miscellaneousOptions: SymbolDisplayMiscellaneousOptions.UseSpecialTypes | SymbolDisplayMiscellaneousOptions.ExpandNullable);
+
+ public static readonly Comparison<INamespaceOrTypeSymbol> CompareNamespaceOrTypeSymbols = CompareTo;
+
+ public static string GetShortName(this INamespaceOrTypeSymbol symbol)
+ {
+ return symbol.ToDisplayString(s_shortNameFormat);
+ }
+
+ public static IEnumerable<IPropertySymbol> GetIndexers(this INamespaceOrTypeSymbol symbol)
+ {
+ return symbol == null
+ ? SpecializedCollections.EmptyEnumerable<IPropertySymbol>()
+ : symbol.GetMembers(WellKnownMemberNames.Indexer).OfType<IPropertySymbol>().Where(p => p.IsIndexer);
+ }
+
+ public static int CompareTo(this INamespaceOrTypeSymbol n1, INamespaceOrTypeSymbol n2)
+ {
+ var names1 = s_namespaceOrTypeToNameMap.GetValue(n1, GetNameParts);
+ var names2 = s_namespaceOrTypeToNameMap.GetValue(n2, GetNameParts);
+
+ for (var i = 0; i < Math.Min(names1.Count, names2.Count); i++)
+ {
+ var comp = names1[i].CompareTo(names2[i]);
+ if (comp != 0)
+ {
+ return comp;
+ }
+ }
+
+ return names1.Count - names2.Count;
+ }
+
+ private static List<string> GetNameParts(INamespaceOrTypeSymbol namespaceSymbol)
+ {
+ var result = new List<string>();
+ GetNameParts(namespaceSymbol, result);
+ return result;
+ }
+
+ private static void GetNameParts(INamespaceOrTypeSymbol namespaceOrTypeSymbol, List<string> result)
+ {
+ if (namespaceOrTypeSymbol == null || (namespaceOrTypeSymbol.IsNamespace && ((INamespaceSymbol)namespaceOrTypeSymbol).IsGlobalNamespace))
+ {
+ return;
+ }
+
+ GetNameParts(namespaceOrTypeSymbol.ContainingNamespace, result);
+ result.Add(namespaceOrTypeSymbol.Name);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/IParameterSymbolExtensions.cs b/main/src/addins/CSharpBinding/Util/IParameterSymbolExtensions.cs
new file mode 100644
index 0000000000..daddbf02a3
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/IParameterSymbolExtensions.cs
@@ -0,0 +1,43 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.Text;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class IParameterSymbolExtensions
+ {
+ public static bool IsRefOrOut(this IParameterSymbol symbol)
+ {
+ return symbol.RefKind != RefKind.None;
+ }
+
+ public static IParameterSymbol RenameParameter(this IParameterSymbol parameter, string parameterName)
+ {
+ return parameter.Name == parameterName
+ ? parameter
+ : CodeGenerationSymbolFactory.CreateParameterSymbol(
+ parameter.GetAttributes(),
+ parameter.RefKind,
+ parameter.IsParams,
+ parameter.Type,
+ parameterName,
+ parameter.IsOptional,
+ parameter.HasExplicitDefaultValue,
+ parameter.HasExplicitDefaultValue ? parameter.ExplicitDefaultValue : null);
+ }
+
+ public static IList<IParameterSymbol> RenameParameters(this IList<IParameterSymbol> parameters, IList<string> parameterNames)
+ {
+ var result = new List<IParameterSymbol>();
+ for (int i = 0; i < parameterNames.Count; i++)
+ {
+ result.Add(parameters[i].RenameParameter(parameterNames[i]));
+ }
+
+ return result;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/IPropertySymbolExtensions.cs b/main/src/addins/CSharpBinding/Util/IPropertySymbolExtensions.cs
new file mode 100644
index 0000000000..9ca69b2f10
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/IPropertySymbolExtensions.cs
@@ -0,0 +1,69 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeGeneration;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class IPropertySymbolExtensions
+ {
+ public static IPropertySymbol RenameParameters(this IPropertySymbol property, IList<string> parameterNames)
+ {
+ var parameterList = property.Parameters;
+ if (parameterList.Select(p => p.Name).SequenceEqual(parameterNames))
+ {
+ return property;
+ }
+
+ var parameters = parameterList.RenameParameters(parameterNames);
+
+ return CodeGenerationSymbolFactory.CreatePropertySymbol(
+ property.ContainingType,
+ property.GetAttributes(),
+ property.DeclaredAccessibility,
+ property.GetSymbolModifiers(),
+ property.Type,
+ property.ExplicitInterfaceImplementations.FirstOrDefault(),
+ property.Name,
+ parameters,
+ property.GetMethod,
+ property.SetMethod,
+ property.IsIndexer);
+ }
+
+ public static IPropertySymbol RemoveAttributeFromParameters(
+ this IPropertySymbol property, INamedTypeSymbol attributeType)
+ {
+ if (attributeType == null)
+ {
+ return property;
+ }
+
+ var someParameterHasAttribute = property.Parameters
+ .Any(p => p.GetAttributes().Any(a => a.AttributeClass.Equals(attributeType)));
+ if (!someParameterHasAttribute)
+ {
+ return property;
+ }
+
+ return CodeGenerationSymbolFactory.CreatePropertySymbol(
+ property.ContainingType,
+ property.GetAttributes(),
+ property.DeclaredAccessibility,
+ property.GetSymbolModifiers(),
+ property.Type,
+ property.ExplicitInterfaceImplementations.FirstOrDefault(),
+ property.Name,
+ property.Parameters.Select(p =>
+ CodeGenerationSymbolFactory.CreateParameterSymbol(
+ p.GetAttributes().Where(a => !a.AttributeClass.Equals(attributeType)).ToList(),
+ p.RefKind, p.IsParams, p.Type, p.Name, p.IsOptional,
+ p.HasExplicitDefaultValue, p.HasExplicitDefaultValue ? p.ExplicitDefaultValue : null)).ToList(),
+ property.GetMethod,
+ property.SetMethod,
+ property.IsIndexer);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/ISymbolExtensions.cs b/main/src/addins/CSharpBinding/Util/ISymbolExtensions.cs
new file mode 100644
index 0000000000..29bd917a4b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/ISymbolExtensions.cs
@@ -0,0 +1,49 @@
+//
+// ISymbolExtensions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Editing;
+using System.Collections.Generic;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class ISymbolExtensions
+ {
+ public static DeclarationModifiers GetSymbolModifiers(this ISymbol symbol)
+ {
+ // ported from roslyn source - why they didn't use DeclarationModifiers.From (symbol) ?
+ return DeclarationModifiers.None
+ .WithIsStatic (symbol.IsStatic)
+ .WithIsAbstract (symbol.IsAbstract)
+ .WithIsUnsafe (symbol.IsUnsafe ())
+ .WithIsVirtual (symbol.IsVirtual)
+ .WithIsOverride (symbol.IsOverride)
+ .WithIsSealed (symbol.IsSealed);
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/ITypeParameterSymbolExtensions.cs b/main/src/addins/CSharpBinding/Util/ITypeParameterSymbolExtensions.cs
new file mode 100644
index 0000000000..86b28def3a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/ITypeParameterSymbolExtensions.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class ITypeParameterSymbolExtensions
+ {
+ public static INamedTypeSymbol GetNamedTypeSymbolConstraint(this ITypeParameterSymbol typeParameter)
+ {
+ return typeParameter.ConstraintTypes.Select(GetNamedTypeSymbol).WhereNotNull().FirstOrDefault();
+ }
+
+ private static INamedTypeSymbol GetNamedTypeSymbol(ITypeSymbol type)
+ {
+ return type is INamedTypeSymbol
+ ? (INamedTypeSymbol)type
+ : type is ITypeParameterSymbol
+ ? GetNamedTypeSymbolConstraint((ITypeParameterSymbol)type)
+ : null;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/ITypeSymbolExtensions.cs b/main/src/addins/CSharpBinding/Util/ITypeSymbolExtensions.cs
new file mode 100644
index 0000000000..ff226ddfe1
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/ITypeSymbolExtensions.cs
@@ -0,0 +1,1108 @@
+//
+// ITypeSymbolExtensions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Linq;
+using System.ComponentModel;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
+using System.Reflection;
+using System.Collections.Generic;
+using System.Threading;
+using System.Collections.Immutable;
+using System.Diagnostics;
+using System.Threading.Tasks;
+using System.Runtime.ExceptionServices;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ [EditorBrowsableAttribute (EditorBrowsableState.Never)]
+ static class ITypeSymbolExtensions
+ {
+ readonly static MethodInfo generateTypeSyntax;
+ readonly static MethodInfo inheritsFromOrEqualsIgnoringConstructionMethod;
+
+ static ITypeSymbolExtensions()
+ {
+ var typeInfo = Type.GetType("Microsoft.CodeAnalysis.CSharp.Extensions.ITypeSymbolExtensions" + ReflectionNamespaces.CSWorkspacesAsmName, true);
+ generateTypeSyntax = typeInfo.GetMethod("GenerateTypeSyntax", new[] { typeof(ITypeSymbol) });
+ containingTypesOrSelfHasUnsafeKeywordMethod = typeInfo.GetMethod("ContainingTypesOrSelfHasUnsafeKeyword", BindingFlags.Public | BindingFlags.Static);
+
+ typeInfo = Type.GetType("Microsoft.CodeAnalysis.Shared.Extensions.ITypeSymbolExtensions" + ReflectionNamespaces.WorkspacesAsmName, true);
+ inheritsFromOrEqualsIgnoringConstructionMethod = typeInfo.GetMethod("InheritsFromOrEqualsIgnoringConstruction");
+ removeUnavailableTypeParametersMethod = typeInfo.GetMethod("RemoveUnavailableTypeParameters");
+ removeUnnamedErrorTypesMethod = typeInfo.GetMethod("RemoveUnnamedErrorTypes");
+ replaceTypeParametersBasedOnTypeConstraintsMethod = typeInfo.GetMethod("ReplaceTypeParametersBasedOnTypeConstraints");
+ foreach (var m in typeInfo.GetMethods (BindingFlags.Public | BindingFlags.Static)) {
+ if (m.Name != "SubstituteTypes")
+ continue;
+ var parameters = m.GetParameters ();
+ if (parameters.Length != 3)
+ continue;
+
+ if (parameters [2].Name == "typeGenerator") {
+ substituteTypesMethod2 = m;
+ } else if (parameters [2].Name == "compilation"){
+ substituteTypesMethod = m;
+ }
+ break;
+ }
+ }
+
+ public static TypeSyntax GenerateTypeSyntax (this ITypeSymbol typeSymbol)
+ {
+ return (TypeSyntax)generateTypeSyntax.Invoke (null, new [] { typeSymbol });
+ }
+
+ readonly static MethodInfo containingTypesOrSelfHasUnsafeKeywordMethod;
+ public static bool ContainingTypesOrSelfHasUnsafeKeyword(this ITypeSymbol containingType)
+ {
+ return (bool)containingTypesOrSelfHasUnsafeKeywordMethod.Invoke (null, new object[] { containingType });
+ }
+
+
+
+ private const string DefaultParameterName = "p";
+ private const string DefaultBuiltInParameterName = "v";
+
+ public static IList<INamedTypeSymbol> GetAllInterfacesIncludingThis(this ITypeSymbol type)
+ {
+ var allInterfaces = type.AllInterfaces;
+ var namedType = type as INamedTypeSymbol;
+ if (namedType != null && namedType.TypeKind == TypeKind.Interface && !allInterfaces.Contains(namedType))
+ {
+ var result = new List<INamedTypeSymbol>(allInterfaces.Length + 1);
+ result.Add(namedType);
+ result.AddRange(allInterfaces);
+ return result;
+ }
+
+ return allInterfaces;
+ }
+
+ public static bool IsAbstractClass(this ITypeSymbol symbol)
+ {
+ return symbol?.TypeKind == TypeKind.Class && symbol.IsAbstract;
+ }
+
+ public static bool IsSystemVoid(this ITypeSymbol symbol)
+ {
+ return symbol?.SpecialType == SpecialType.System_Void;
+ }
+
+ public static bool IsNullable(this ITypeSymbol symbol)
+ {
+ return symbol?.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T;
+ }
+
+ public static bool IsErrorType(this ITypeSymbol symbol)
+ {
+ return symbol?.TypeKind == TypeKind.Error;
+ }
+
+ public static bool IsModuleType(this ITypeSymbol symbol)
+ {
+ return symbol?.TypeKind == TypeKind.Module;
+ }
+
+ public static bool IsInterfaceType(this ITypeSymbol symbol)
+ {
+ return symbol?.TypeKind == TypeKind.Interface;
+ }
+
+ public static bool IsDelegateType(this ITypeSymbol symbol)
+ {
+ return symbol?.TypeKind == TypeKind.Delegate;
+ }
+
+ public static bool IsAnonymousType(this INamedTypeSymbol symbol)
+ {
+ return symbol?.IsAnonymousType == true;
+ }
+
+// public static ITypeSymbol RemoveNullableIfPresent(this ITypeSymbol symbol)
+// {
+// if (symbol.IsNullable())
+// {
+// return symbol.GetTypeArguments().Single();
+// }
+//
+// return symbol;
+// }
+
+// /// <summary>
+// /// Returns the corresponding symbol in this type or a base type that implements
+// /// interfaceMember (either implicitly or explicitly), or null if no such symbol exists
+// /// (which might be either because this type doesn't implement the container of
+// /// interfaceMember, or this type doesn't supply a member that successfully implements
+// /// interfaceMember).
+// /// </summary>
+// public static IEnumerable<ISymbol> FindImplementationsForInterfaceMember(
+// this ITypeSymbol typeSymbol,
+// ISymbol interfaceMember,
+// Workspace workspace,
+// CancellationToken cancellationToken)
+// {
+// // This method can return multiple results. Consider the case of:
+// //
+// // interface IFoo<X> { void Foo(X x); }
+// //
+// // class C : IFoo<int>, IFoo<string> { void Foo(int x); void Foo(string x); }
+// //
+// // If you're looking for the implementations of IFoo<X>.Foo then you want to find both
+// // results in C.
+//
+// // TODO(cyrusn): Implement this using the actual code for
+// // TypeSymbol.FindImplementationForInterfaceMember
+//
+// if (typeSymbol == null || interfaceMember == null)
+// {
+// yield break;
+// }
+//
+// if (interfaceMember.Kind != SymbolKind.Event &&
+// interfaceMember.Kind != SymbolKind.Method &&
+// interfaceMember.Kind != SymbolKind.Property)
+// {
+// yield break;
+// }
+//
+// // WorkItem(4843)
+// //
+// // 'typeSymbol' has to at least implement the interface containing the member. note:
+// // this just means that the interface shows up *somewhere* in the inheritance chain of
+// // this type. However, this type may not actually say that it implements it. For
+// // example:
+// //
+// // interface I { void Foo(); }
+// //
+// // class B { }
+// //
+// // class C : B, I { }
+// //
+// // class D : C { }
+// //
+// // D does implement I transitively through C. However, even if D has a "Foo" method, it
+// // won't be an implementation of I.Foo. The implementation of I.Foo must be from a type
+// // that actually has I in it's direct interface chain, or a type that's a base type of
+// // that. in this case, that means only classes C or B.
+// var interfaceType = interfaceMember.ContainingType;
+// if (!typeSymbol.ImplementsIgnoringConstruction(interfaceType))
+// {
+// yield break;
+// }
+//
+// // We've ascertained that the type T implements some constructed type of the form I<X>.
+// // However, we're not precisely sure which constructions of I<X> are being used. For
+// // example, a type C might implement I<int> and I<string>. If we're searching for a
+// // method from I<X> we might need to find several methods that implement different
+// // instantiations of that method.
+// var originalInterfaceType = interfaceMember.ContainingType.OriginalDefinition;
+// var originalInterfaceMember = interfaceMember.OriginalDefinition;
+// var constructedInterfaces = typeSymbol.AllInterfaces.Where(i =>
+// SymbolEquivalenceComparer.Instance.Equals(i.OriginalDefinition, originalInterfaceType));
+//
+// foreach (var constructedInterface in constructedInterfaces)
+// {
+// cancellationToken.ThrowIfCancellationRequested();
+// var constructedInterfaceMember = constructedInterface.GetMembers().FirstOrDefault(m =>
+ // SymbolEquivalenceComparer.Instance.Equals(m.OriginalDefinition, originalInterfaceMember));
+//
+// if (constructedInterfaceMember == null)
+// {
+// continue;
+// }
+//
+// // Now we need to walk the base type chain, but we start at the first type that actually
+// // has the interface directly in its interface hierarchy.
+// var seenTypeDeclaringInterface = false;
+// for (var currentType = typeSymbol; currentType != null; currentType = currentType.BaseType)
+// {
+// seenTypeDeclaringInterface = seenTypeDeclaringInterface ||
+// currentType.GetOriginalInterfacesAndTheirBaseInterfaces().Contains(interfaceType.OriginalDefinition);
+//
+// if (seenTypeDeclaringInterface)
+// {
+// var result = constructedInterfaceMember.TypeSwitch(
+// (IEventSymbol eventSymbol) => FindImplementations(currentType, eventSymbol, workspace, e => e.ExplicitInterfaceImplementations),
+// (IMethodSymbol methodSymbol) => FindImplementations(currentType, methodSymbol, workspace, m => m.ExplicitInterfaceImplementations),
+// (IPropertySymbol propertySymbol) => FindImplementations(currentType, propertySymbol, workspace, p => p.ExplicitInterfaceImplementations));
+//
+// if (result != null)
+// {
+// yield return result;
+// break;
+// }
+// }
+// }
+// }
+// }
+//
+// private static HashSet<INamedTypeSymbol> GetOriginalInterfacesAndTheirBaseInterfaces(
+// this ITypeSymbol type,
+// HashSet<INamedTypeSymbol> symbols = null)
+// {
+// symbols = symbols ?? new HashSet<INamedTypeSymbol>(SymbolEquivalenceComparer.Instance);
+//
+// foreach (var interfaceType in type.Interfaces)
+// {
+// symbols.Add(interfaceType.OriginalDefinition);
+// symbols.AddRange(interfaceType.AllInterfaces.Select(i => i.OriginalDefinition));
+// }
+//
+// return symbols;
+// }
+
+// private static ISymbol FindImplementations<TSymbol>(
+// ITypeSymbol typeSymbol,
+// TSymbol interfaceSymbol,
+// Workspace workspace,
+// Func<TSymbol, ImmutableArray<TSymbol>> getExplicitInterfaceImplementations) where TSymbol : class, ISymbol
+// {
+// // Check the current type for explicit interface matches. Otherwise, check
+// // the current type and base types for implicit matches.
+// var explicitMatches =
+// from member in typeSymbol.GetMembers().OfType<TSymbol>()
+// where getExplicitInterfaceImplementations(member).Length > 0
+// from explicitInterfaceMethod in getExplicitInterfaceImplementations(member)
+// where SymbolEquivalenceComparer.Instance.Equals(explicitInterfaceMethod, interfaceSymbol)
+// select member;
+//
+// var provider = workspace.Services.GetLanguageServices(typeSymbol.Language);
+// var semanticFacts = provider.GetService<ISemanticFactsService>();
+//
+// // Even if a language only supports explicit interface implementation, we
+// // can't enforce it for types from metadata. For example, a VB symbol
+// // representing System.Xml.XmlReader will say it implements IDisposable, but
+// // the XmlReader.Dispose() method will not be an explicit implementation of
+// // IDisposable.Dispose()
+// if (!semanticFacts.SupportsImplicitInterfaceImplementation &&
+// typeSymbol.Locations.Any(location => location.IsInSource))
+// {
+// return explicitMatches.FirstOrDefault();
+// }
+//
+// var syntaxFacts = provider.GetService<ISyntaxFactsService>();
+// var implicitMatches =
+// from baseType in typeSymbol.GetBaseTypesAndThis()
+// from member in baseType.GetMembers(interfaceSymbol.Name).OfType<TSymbol>()
+// where member.DeclaredAccessibility == Accessibility.Public &&
+// !member.IsStatic &&
+// SignatureComparer.Instance.HaveSameSignatureAndConstraintsAndReturnTypeAndAccessors(member, interfaceSymbol, syntaxFacts.IsCaseSensitive)
+// select member;
+//
+// return explicitMatches.FirstOrDefault() ?? implicitMatches.FirstOrDefault();
+// }
+
+ public static IEnumerable<ITypeSymbol> GetContainingTypesAndThis(this ITypeSymbol type)
+ {
+ var current = type;
+ while (current != null)
+ {
+ yield return current;
+ current = current.ContainingType;
+ }
+ }
+
+ public static IEnumerable<INamedTypeSymbol> GetContainingTypes(this ITypeSymbol type)
+ {
+ var current = type.ContainingType;
+ while (current != null)
+ {
+ yield return current;
+ current = current.ContainingType;
+ }
+ }
+
+// // Determine if "type" inherits from "baseType", ignoring constructed types, and dealing
+// // only with original types.
+// public static bool InheritsFromOrEquals(
+// this ITypeSymbol type, ITypeSymbol baseType)
+// {
+// return type.GetBaseTypesAndThis().Contains(t => SymbolEquivalenceComparer.Instance.Equals(t, baseType));
+// }
+//
+ // Determine if "type" inherits from "baseType", ignoring constructed types, and dealing
+ // only with original types.
+ public static bool InheritsFromOrEqualsIgnoringConstruction(
+ this ITypeSymbol type, ITypeSymbol baseType)
+ {
+ return (bool)inheritsFromOrEqualsIgnoringConstructionMethod.Invoke (null, new [] { type, baseType });
+ }
+//
+// // Determine if "type" inherits from "baseType", ignoring constructed types, and dealing
+// // only with original types.
+// public static bool InheritsFromIgnoringConstruction(
+// this ITypeSymbol type, ITypeSymbol baseType)
+// {
+// var originalBaseType = baseType.OriginalDefinition;
+//
+// // We could just call GetBaseTypes and foreach over it, but this
+// // is a hot path in Find All References. This avoid the allocation
+// // of the enumerator type.
+// var currentBaseType = type.BaseType;
+// while (currentBaseType != null)
+// {
+// if (SymbolEquivalenceComparer.Instance.Equals(currentBaseType.OriginalDefinition, originalBaseType))
+// {
+// return true;
+// }
+//
+// currentBaseType = currentBaseType.BaseType;
+// }
+//
+// return false;
+// }
+
+// public static bool ImplementsIgnoringConstruction(
+// this ITypeSymbol type, ITypeSymbol interfaceType)
+// {
+// var originalInterfaceType = interfaceType.OriginalDefinition;
+// if (type is INamedTypeSymbol && type.TypeKind == TypeKind.Interface)
+// {
+// // Interfaces don't implement other interfaces. They extend them.
+// return false;
+// }
+//
+// return type.AllInterfaces.Any(t => SymbolEquivalenceComparer.Instance.Equals(t.OriginalDefinition, originalInterfaceType));
+// }
+//
+// public static bool Implements(
+// this ITypeSymbol type, ITypeSymbol interfaceType)
+// {
+// return type.AllInterfaces.Contains(t => SymbolEquivalenceComparer.Instance.Equals(t, interfaceType));
+// }
+//
+ public static bool IsAttribute(this ITypeSymbol symbol)
+ {
+ for (var b = symbol.BaseType; b != null; b = b.BaseType)
+ {
+ if (b.MetadataName == "Attribute" &&
+ b.ContainingType == null &&
+ b.ContainingNamespace != null &&
+ b.ContainingNamespace.Name == "System" &&
+ b.ContainingNamespace.ContainingNamespace != null &&
+ b.ContainingNamespace.ContainingNamespace.IsGlobalNamespace)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ readonly static MethodInfo removeUnavailableTypeParametersMethod;
+
+ public static ITypeSymbol RemoveUnavailableTypeParameters(
+ this ITypeSymbol type,
+ Compilation compilation,
+ IEnumerable<ITypeParameterSymbol> availableTypeParameters)
+ {
+ try {
+ return (ITypeSymbol)removeUnavailableTypeParametersMethod.Invoke (null, new object[] { type, compilation, availableTypeParameters });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+
+ public static ITypeSymbol RemoveAnonymousTypes(
+ this ITypeSymbol type,
+ Compilation compilation)
+ {
+ return type?.Accept(new AnonymousTypeRemover(compilation));
+ }
+
+ private class AnonymousTypeRemover : SymbolVisitor<ITypeSymbol>
+ {
+ private readonly Compilation _compilation;
+
+ public AnonymousTypeRemover(Compilation compilation)
+ {
+ _compilation = compilation;
+ }
+
+ public override ITypeSymbol DefaultVisit(ISymbol node)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override ITypeSymbol VisitDynamicType(IDynamicTypeSymbol symbol)
+ {
+ return symbol;
+ }
+
+ public override ITypeSymbol VisitArrayType(IArrayTypeSymbol symbol)
+ {
+ var elementType = symbol.ElementType.Accept(this);
+ if (elementType != null && elementType.Equals(symbol.ElementType))
+ {
+ return symbol;
+ }
+
+ return _compilation.CreateArrayTypeSymbol(elementType, symbol.Rank);
+ }
+
+ public override ITypeSymbol VisitNamedType(INamedTypeSymbol symbol)
+ {
+ if (symbol.IsNormalAnonymousType() ||
+ symbol.IsAnonymousDelegateType())
+ {
+ return _compilation.ObjectType;
+ }
+
+ var arguments = symbol.TypeArguments.Select(t => t.Accept(this)).ToArray();
+ if (arguments.SequenceEqual(symbol.TypeArguments))
+ {
+ return symbol;
+ }
+
+ return symbol.ConstructedFrom.Construct(arguments.ToArray());
+ }
+
+ public override ITypeSymbol VisitPointerType(IPointerTypeSymbol symbol)
+ {
+ var elementType = symbol.PointedAtType.Accept(this);
+ if (elementType != null && elementType.Equals(symbol.PointedAtType))
+ {
+ return symbol;
+ }
+
+ return _compilation.CreatePointerTypeSymbol(elementType);
+ }
+
+ public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
+ {
+ return symbol;
+ }
+ }
+
+ readonly static MethodInfo replaceTypeParametersBasedOnTypeConstraintsMethod;
+ public static ITypeSymbol ReplaceTypeParametersBasedOnTypeConstraints(
+ this ITypeSymbol type,
+ Compilation compilation,
+ IEnumerable<ITypeParameterSymbol> availableTypeParameters,
+ Solution solution,
+ CancellationToken cancellationToken)
+ {
+ try {
+ return (ITypeSymbol)replaceTypeParametersBasedOnTypeConstraintsMethod.Invoke (null, new object[] { type, compilation, availableTypeParameters, solution, cancellationToken});
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ readonly static MethodInfo removeUnnamedErrorTypesMethod;
+ public static ITypeSymbol RemoveUnnamedErrorTypes(
+ this ITypeSymbol type,
+ Compilation compilation)
+ {
+ try {
+ return (ITypeSymbol)removeUnnamedErrorTypesMethod.Invoke (null, new object[] { type, compilation });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+
+ public static IList<ITypeParameterSymbol> GetReferencedMethodTypeParameters(
+ this ITypeSymbol type, IList<ITypeParameterSymbol> result = null)
+ {
+ result = result ?? new List<ITypeParameterSymbol>();
+ type?.Accept(new CollectTypeParameterSymbolsVisitor(result, onlyMethodTypeParameters: true));
+ return result;
+ }
+
+ public static IList<ITypeParameterSymbol> GetReferencedTypeParameters(
+ this ITypeSymbol type, IList<ITypeParameterSymbol> result = null)
+ {
+ result = result ?? new List<ITypeParameterSymbol>();
+ type?.Accept(new CollectTypeParameterSymbolsVisitor(result, onlyMethodTypeParameters: false));
+ return result;
+ }
+
+ private class CollectTypeParameterSymbolsVisitor : SymbolVisitor
+ {
+ private readonly HashSet<ISymbol> _visited = new HashSet<ISymbol>();
+ private readonly bool _onlyMethodTypeParameters;
+ private readonly IList<ITypeParameterSymbol> _typeParameters;
+
+ public CollectTypeParameterSymbolsVisitor(
+ IList<ITypeParameterSymbol> typeParameters,
+ bool onlyMethodTypeParameters)
+ {
+ _onlyMethodTypeParameters = onlyMethodTypeParameters;
+ _typeParameters = typeParameters;
+ }
+
+ public override void DefaultVisit(ISymbol node)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void VisitDynamicType(IDynamicTypeSymbol symbol)
+ {
+ }
+
+ public override void VisitArrayType(IArrayTypeSymbol symbol)
+ {
+ if (!_visited.Add(symbol))
+ {
+ return;
+ }
+
+ symbol.ElementType.Accept(this);
+ }
+
+ public override void VisitNamedType(INamedTypeSymbol symbol)
+ {
+ if (_visited.Add(symbol))
+ {
+ foreach (var child in symbol.GetAllTypeArguments())
+ {
+ child.Accept(this);
+ }
+ }
+ }
+
+ public override void VisitPointerType(IPointerTypeSymbol symbol)
+ {
+ if (!_visited.Add(symbol))
+ {
+ return;
+ }
+
+ symbol.PointedAtType.Accept(this);
+ }
+
+ public override void VisitTypeParameter(ITypeParameterSymbol symbol)
+ {
+ if (_visited.Add(symbol))
+ {
+ if (symbol.TypeParameterKind == TypeParameterKind.Method || !_onlyMethodTypeParameters)
+ {
+ if (!_typeParameters.Contains(symbol))
+ {
+ _typeParameters.Add(symbol);
+ }
+ }
+
+ foreach (var constraint in symbol.ConstraintTypes)
+ {
+ constraint.Accept(this);
+ }
+ }
+ }
+ }
+
+ readonly static MethodInfo substituteTypesMethod;
+ public static ITypeSymbol SubstituteTypes<TType1, TType2>(
+ this ITypeSymbol type,
+ IDictionary<TType1, TType2> mapping,
+ Compilation compilation)
+ where TType1 : ITypeSymbol
+ where TType2 : ITypeSymbol
+ {
+ if (type == null)
+ throw new ArgumentNullException ("type");
+ try {
+ return (ITypeSymbol)substituteTypesMethod.MakeGenericMethod (typeof(TType1), typeof(TType2)).Invoke (null, new object[] { type, mapping, compilation });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ readonly static MethodInfo substituteTypesMethod2;
+ public static ITypeSymbol SubstituteTypes<TType1, TType2>(
+ this ITypeSymbol type,
+ IDictionary<TType1, TType2> mapping,
+ TypeGenerator typeGenerator)
+ where TType1 : ITypeSymbol
+ where TType2 : ITypeSymbol
+ {
+ try {
+ return (ITypeSymbol)substituteTypesMethod2.MakeGenericMethod (typeof(TType1), typeof(TType2)).Invoke (null, new object[] { type, mapping, typeGenerator.Instance });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+
+ public static bool IsUnexpressableTypeParameterConstraint(this ITypeSymbol typeSymbol)
+ {
+ if (typeSymbol.IsSealed || typeSymbol.IsValueType)
+ {
+ return true;
+ }
+
+ switch (typeSymbol.TypeKind)
+ {
+ case TypeKind.Array:
+ case TypeKind.Delegate:
+ return true;
+ }
+
+ switch (typeSymbol.SpecialType)
+ {
+ case SpecialType.System_Array:
+ case SpecialType.System_Delegate:
+ case SpecialType.System_MulticastDelegate:
+ case SpecialType.System_Enum:
+ case SpecialType.System_ValueType:
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsNumericType(this ITypeSymbol type)
+ {
+ if (type != null)
+ {
+ switch (type.SpecialType)
+ {
+ case SpecialType.System_Byte:
+ case SpecialType.System_SByte:
+ case SpecialType.System_Int16:
+ case SpecialType.System_UInt16:
+ case SpecialType.System_Int32:
+ case SpecialType.System_UInt32:
+ case SpecialType.System_Int64:
+ case SpecialType.System_UInt64:
+ case SpecialType.System_Single:
+ case SpecialType.System_Double:
+ case SpecialType.System_Decimal:
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static Accessibility DetermineMinimalAccessibility(this ITypeSymbol typeSymbol)
+ {
+ return typeSymbol.Accept(MinimalAccessibilityVisitor.Instance);
+ }
+ private class MinimalAccessibilityVisitor : SymbolVisitor<Accessibility>
+ {
+ public static readonly SymbolVisitor<Accessibility> Instance = new MinimalAccessibilityVisitor();
+
+ public override Accessibility DefaultVisit(ISymbol node)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override Accessibility VisitAlias(IAliasSymbol symbol)
+ {
+ return symbol.Target.Accept(this);
+ }
+
+ public override Accessibility VisitArrayType(IArrayTypeSymbol symbol)
+ {
+ return symbol.ElementType.Accept(this);
+ }
+
+ public override Accessibility VisitDynamicType(IDynamicTypeSymbol symbol)
+ {
+ return Accessibility.Public;
+ }
+
+ public override Accessibility VisitNamedType(INamedTypeSymbol symbol)
+ {
+ var accessibility = symbol.DeclaredAccessibility;
+
+ foreach (var arg in symbol.TypeArguments)
+ {
+ accessibility = CommonAccessibilityUtilities.Minimum(accessibility, arg.Accept(this));
+ }
+
+ if (symbol.ContainingType != null)
+ {
+ accessibility = CommonAccessibilityUtilities.Minimum(accessibility, symbol.ContainingType.Accept(this));
+ }
+
+ return accessibility;
+ }
+
+ public override Accessibility VisitPointerType(IPointerTypeSymbol symbol)
+ {
+ return symbol.PointedAtType.Accept(this);
+ }
+
+ public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol)
+ {
+ // TODO(cyrusn): Do we have to consider the constraints?
+ return Accessibility.Public;
+ }
+ }
+ public static bool ContainsAnonymousType(this ITypeSymbol symbol)
+ {
+ return symbol.TypeSwitch(
+ (IArrayTypeSymbol a) => ContainsAnonymousType(a.ElementType),
+ (IPointerTypeSymbol p) => ContainsAnonymousType(p.PointedAtType),
+ (INamedTypeSymbol n) => ContainsAnonymousType(n),
+ _ => false);
+ }
+
+ private static bool ContainsAnonymousType(INamedTypeSymbol type)
+ {
+ if (type.IsAnonymousType)
+ {
+ return true;
+ }
+
+ foreach (var typeArg in type.GetAllTypeArguments())
+ {
+ if (ContainsAnonymousType(typeArg))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static string CreateParameterName(this ITypeSymbol type, bool capitalize = false)
+ {
+ while (true)
+ {
+ var arrayType = type as IArrayTypeSymbol;
+ if (arrayType != null)
+ {
+ type = arrayType.ElementType;
+ continue;
+ }
+
+ var pointerType = type as IPointerTypeSymbol;
+ if (pointerType != null)
+ {
+ type = pointerType.PointedAtType;
+ continue;
+ }
+
+ break;
+ }
+
+ var shortName = GetParameterName(type);
+ return capitalize ? shortName.ToPascalCase() : shortName.ToCamelCase();
+ }
+
+ private static string GetParameterName(ITypeSymbol type)
+ {
+ if (type == null || type.IsAnonymousType())
+ {
+ return DefaultParameterName;
+ }
+
+ if (type.IsSpecialType() || type.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T)
+ {
+ return DefaultBuiltInParameterName;
+ }
+
+ var shortName = type.GetShortName();
+ return shortName.Length == 0
+ ? DefaultParameterName
+ : shortName;
+ }
+
+ private static bool IsSpecialType(this ITypeSymbol symbol)
+ {
+ if (symbol != null)
+ {
+ switch (symbol.SpecialType)
+ {
+ case SpecialType.System_Object:
+ case SpecialType.System_Void:
+ case SpecialType.System_Boolean:
+ case SpecialType.System_SByte:
+ case SpecialType.System_Byte:
+ case SpecialType.System_Decimal:
+ case SpecialType.System_Single:
+ case SpecialType.System_Double:
+ case SpecialType.System_Int16:
+ case SpecialType.System_Int32:
+ case SpecialType.System_Int64:
+ case SpecialType.System_Char:
+ case SpecialType.System_String:
+ case SpecialType.System_UInt16:
+ case SpecialType.System_UInt32:
+ case SpecialType.System_UInt64:
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool CanSupportCollectionInitializer(this ITypeSymbol typeSymbol)
+ {
+ if (typeSymbol.AllInterfaces.Any (i => i.SpecialType == SpecialType.System_Collections_IEnumerable)) {
+ var curType = typeSymbol;
+ while (curType != null) {
+ if (HasAddMethod (curType))
+ return true;
+ curType = curType.BaseType;
+ }
+ }
+ return false;
+ }
+
+ static bool HasAddMethod (ITypeSymbol typeSymbol)
+ {
+ return typeSymbol
+ .GetMembers (WellKnownMemberNames.CollectionInitializerAddMethodName)
+ .OfType<IMethodSymbol> ().Any (m => m.Parameters.Any ());
+ }
+
+ public static INamedTypeSymbol GetDelegateType(this ITypeSymbol typeSymbol, Compilation compilation)
+ {
+ if (typeSymbol != null)
+ {
+ var expressionOfT = compilation.ExpressionOfTType();
+ if (typeSymbol.OriginalDefinition.Equals(expressionOfT))
+ {
+ var typeArgument = ((INamedTypeSymbol)typeSymbol).TypeArguments[0];
+ return typeArgument as INamedTypeSymbol;
+ }
+
+ if (typeSymbol.IsDelegateType())
+ {
+ return typeSymbol as INamedTypeSymbol;
+ }
+ }
+
+ return null;
+ }
+
+ public static IEnumerable<T> GetAccessibleMembersInBaseTypes<T>(this ITypeSymbol containingType, ISymbol within) where T : class, ISymbol
+ {
+ if (containingType == null)
+ {
+ return SpecializedCollections.EmptyEnumerable<T>();
+ }
+
+ var types = containingType.GetBaseTypes();
+ return types.SelectMany(x => x.GetMembers().OfType<T>().Where(m => m.IsAccessibleWithin(within)));
+ }
+
+ public static IEnumerable<T> GetAccessibleMembersInThisAndBaseTypes<T>(this ITypeSymbol containingType, ISymbol within) where T : class, ISymbol
+ {
+ if (containingType == null)
+ {
+ return SpecializedCollections.EmptyEnumerable<T>();
+ }
+
+ var types = containingType.GetBaseTypesAndThis();
+ return types.SelectMany(x => x.GetMembers().OfType<T>().Where(m => m.IsAccessibleWithin(within)));
+ }
+
+ public static bool? AreMoreSpecificThan(this IList<ITypeSymbol> t1, IList<ITypeSymbol> t2)
+ {
+ if (t1.Count != t2.Count)
+ {
+ return null;
+ }
+
+ // For t1 to be more specific than t2, it has to be not less specific in every member,
+ // and more specific in at least one.
+
+ bool? result = null;
+ for (int i = 0; i < t1.Count; ++i)
+ {
+ var r = t1[i].IsMoreSpecificThan(t2[i]);
+ if (r == null)
+ {
+ // We learned nothing. Do nothing.
+ }
+ else if (result == null)
+ {
+ // We have found the first more specific type. See if
+ // all the rest on this side are not less specific.
+ result = r;
+ }
+ else if (result != r)
+ {
+ // We have more specific types on both left and right, so we
+ // cannot succeed in picking a better type list. Bail out now.
+ return null;
+ }
+ }
+
+ return result;
+ }
+
+ private static bool? IsMoreSpecificThan(this ITypeSymbol t1, ITypeSymbol t2)
+ {
+ // SPEC: A type parameter is less specific than a non-type parameter.
+
+ var isTypeParameter1 = t1 is ITypeParameterSymbol;
+ var isTypeParameter2 = t2 is ITypeParameterSymbol;
+
+ if (isTypeParameter1 && !isTypeParameter2)
+ {
+ return false;
+ }
+
+ if (!isTypeParameter1 && isTypeParameter2)
+ {
+ return true;
+ }
+
+ if (isTypeParameter1)
+ {
+ Debug.Assert(isTypeParameter2);
+ return null;
+ }
+
+ if (t1.TypeKind != t2.TypeKind)
+ {
+ return null;
+ }
+
+ // There is an identity conversion between the types and they are both substitutions on type parameters.
+ // They had better be the same kind.
+
+ // UNDONE: Strip off the dynamics.
+
+ // SPEC: An array type is more specific than another
+ // SPEC: array type (with the same number of dimensions)
+ // SPEC: if the element type of the first is
+ // SPEC: more specific than the element type of the second.
+
+ if (t1 is IArrayTypeSymbol)
+ {
+ var arr1 = (IArrayTypeSymbol)t1;
+ var arr2 = (IArrayTypeSymbol)t2;
+
+ // We should not have gotten here unless there were identity conversions
+ // between the two types.
+
+ return arr1.ElementType.IsMoreSpecificThan(arr2.ElementType);
+ }
+
+ // SPEC EXTENSION: We apply the same rule to pointer types.
+
+ if (t1 is IPointerTypeSymbol)
+ {
+ var p1 = (IPointerTypeSymbol)t1;
+ var p2 = (IPointerTypeSymbol)t2;
+ return p1.PointedAtType.IsMoreSpecificThan(p2.PointedAtType);
+ }
+
+ // SPEC: A constructed type is more specific than another
+ // SPEC: constructed type (with the same number of type arguments) if at least one type
+ // SPEC: argument is more specific and no type argument is less specific than the
+ // SPEC: corresponding type argument in the other.
+
+ var n1 = t1 as INamedTypeSymbol;
+ var n2 = t2 as INamedTypeSymbol;
+
+ if (n1 == null)
+ {
+ return null;
+ }
+
+ // We should not have gotten here unless there were identity conversions between the
+ // two types.
+
+ var allTypeArgs1 = n1.GetAllTypeArguments().ToList();
+ var allTypeArgs2 = n2.GetAllTypeArguments().ToList();
+
+ return allTypeArgs1.AreMoreSpecificThan(allTypeArgs2);
+ }
+
+ public static bool IsOrDerivesFromExceptionType(this ITypeSymbol type, Compilation compilation)
+ {
+ if (type != null)
+ {
+ foreach (var baseType in type.GetBaseTypesAndThis())
+ {
+ if (baseType.Equals(compilation.ExceptionType()))
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsEnumType(this ITypeSymbol type)
+ {
+ return type.IsValueType && type.TypeKind == TypeKind.Enum;
+ }
+
+
+ public static async Task<ISymbol> FindApplicableAlias(this ITypeSymbol type, int position, SemanticModel semanticModel, CancellationToken cancellationToken)
+ {
+ if (semanticModel.IsSpeculativeSemanticModel)
+ {
+ position = semanticModel.OriginalPositionForSpeculation;
+ semanticModel = semanticModel.ParentModel;
+ }
+
+ var root = await semanticModel.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false);
+
+ IEnumerable<UsingDirectiveSyntax> applicableUsings = GetApplicableUsings(position, root as CompilationUnitSyntax);
+ foreach (var applicableUsing in applicableUsings)
+ {
+ var alias = semanticModel.GetOriginalSemanticModel().GetDeclaredSymbol(applicableUsing, cancellationToken) as IAliasSymbol;
+
+ if (alias != null && alias.Target == type)
+ {
+ return alias;
+ }
+ }
+
+ return null;
+ }
+
+ private static IEnumerable<UsingDirectiveSyntax> GetApplicableUsings(int position, SyntaxNode root)
+ {
+ var namespaceUsings = root.FindToken(position).Parent.GetAncestors<NamespaceDeclarationSyntax>().SelectMany(n => n.Usings);
+ var allUsings = root is CompilationUnitSyntax
+ ? ((CompilationUnitSyntax)root).Usings.Concat(namespaceUsings)
+ : namespaceUsings;
+ return allUsings.Where(u => u.Alias != null);
+ }
+
+ public static ITypeSymbol RemoveNullableIfPresent(this ITypeSymbol symbol)
+ {
+ if (symbol.IsNullable())
+ {
+ return symbol.GetTypeArguments().Single();
+ }
+
+ return symbol;
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/ImmutableArrayExtensions.cs b/main/src/addins/CSharpBinding/Util/ImmutableArrayExtensions.cs
new file mode 100644
index 0000000000..559c626422
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/ImmutableArrayExtensions.cs
@@ -0,0 +1,60 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class ImmutableArrayExtensions
+ {
+ public static ImmutableArray<T> ToImmutableArrayOrEmpty<T>(this IEnumerable<T> items)
+ {
+ if (items == null)
+ {
+ return ImmutableArray.Create<T>();
+ }
+
+ return ImmutableArray.CreateRange<T>(items);
+ }
+
+ public static ImmutableArray<T> ToImmutableArrayOrEmpty<T>(this ImmutableArray<T> items)
+ {
+ if (items.IsDefault)
+ {
+ return ImmutableArray.Create<T>();
+ }
+
+ return items;
+ }
+
+ // same as Array.BinarySearch but the ability to pass arbitrary value to the comparer without allocation
+ public static int BinarySearch<TElement, TValue>(this ImmutableArray<TElement> array, TValue value, Func<TElement, TValue, int> comparer)
+ {
+ int low = 0;
+ int high = array.Length - 1;
+
+ while (low <= high)
+ {
+ int middle = low + ((high - low) >> 1);
+ int comparison = comparer(array[middle], value);
+
+ if (comparison == 0)
+ {
+ return middle;
+ }
+
+ if (comparison > 0)
+ {
+ high = middle - 1;
+ }
+ else
+ {
+ low = middle + 1;
+ }
+ }
+
+ return ~low;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/LinkedListExtension.cs b/main/src/addins/CSharpBinding/Util/LinkedListExtension.cs
new file mode 100644
index 0000000000..af02a85afb
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/LinkedListExtension.cs
@@ -0,0 +1,50 @@
+//
+// LinkedListExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class LinkedListExtensions
+ {
+ public static void AddRangeAtHead<T>(this LinkedList<T> list, IEnumerable<T> values)
+ {
+ var currentNode = default(LinkedListNode<T>);
+ foreach (var value in values)
+ {
+ if (currentNode == null)
+ {
+ currentNode = list.AddFirst(value);
+ }
+ else
+ {
+ currentNode = list.AddAfter(currentNode, value);
+ }
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/Matcher.cs b/main/src/addins/CSharpBinding/Util/Matcher.cs
new file mode 100644
index 0000000000..4a0c90db95
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/Matcher.cs
@@ -0,0 +1,188 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using Microsoft.CodeAnalysis.Text;
+using System.Collections.Generic;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ abstract class Matcher<T>
+ {
+ // Tries to match this matcher against the provided sequence at the given index. If the
+ // match succeeds, 'true' is returned, and 'index' points to the location after the match
+ // ends. If the match fails, then false it returned and index remains the same. Note: the
+ // matcher does not need to consume to the end of the sequence to succeed.
+ public abstract bool TryMatch(IList<T> sequence, ref int index);
+
+ internal static Matcher<T> Repeat(Matcher<T> matcher)
+ {
+ return new RepeatMatcher(matcher);
+ }
+
+ internal static Matcher<T> OneOrMore(Matcher<T> matcher)
+ {
+ // m+ is the same as (m m*)
+ return Sequence(matcher, Repeat(matcher));
+ }
+
+ internal static Matcher<T> Choice(Matcher<T> matcher1, Matcher<T> matcher2)
+ {
+ return new ChoiceMatcher(matcher1, matcher2);
+ }
+
+ internal static Matcher<T> Sequence(params Matcher<T>[] matchers)
+ {
+ return new SequenceMatcher(matchers);
+ }
+
+ internal static Matcher<T> Single(Func<T, bool> predicate, string description)
+ {
+ return new SingleMatcher(predicate, description);
+ }
+ private class ChoiceMatcher : Matcher<T>
+ {
+ private readonly Matcher<T> _matcher1;
+ private readonly Matcher<T> _matcher2;
+
+ public ChoiceMatcher(Matcher<T> matcher1, Matcher<T> matcher2)
+ {
+ _matcher1 = matcher1;
+ _matcher2 = matcher2;
+ }
+
+ public override bool TryMatch(IList<T> sequence, ref int index)
+ {
+ return
+ _matcher1.TryMatch(sequence, ref index) ||
+ _matcher2.TryMatch(sequence, ref index);
+ }
+
+ public override string ToString()
+ {
+ return string.Format("({0}|{1})", _matcher1, _matcher2);
+ }
+ }
+ private class RepeatMatcher : Matcher<T>
+ {
+ private readonly Matcher<T> _matcher;
+
+ public RepeatMatcher(Matcher<T> matcher)
+ {
+ _matcher = matcher;
+ }
+
+ public override bool TryMatch(IList<T> sequence, ref int index)
+ {
+ while (_matcher.TryMatch(sequence, ref index))
+ {
+ }
+
+ return true;
+ }
+
+ public override string ToString()
+ {
+ return string.Format("({0}*)", _matcher);
+ }
+ }
+ private class SequenceMatcher : Matcher<T>
+ {
+ private readonly Matcher<T>[] _matchers;
+
+ public SequenceMatcher(params Matcher<T>[] matchers)
+ {
+ _matchers = matchers;
+ }
+
+ public override bool TryMatch(IList<T> sequence, ref int index)
+ {
+ var currentIndex = index;
+ foreach (var matcher in _matchers)
+ {
+ if (!matcher.TryMatch(sequence, ref currentIndex))
+ {
+ return false;
+ }
+ }
+
+ index = currentIndex;
+ return true;
+ }
+
+ public override string ToString()
+ {
+ return string.Format("({0})", string.Join(",", (object[])_matchers));
+ }
+ }
+ private class SingleMatcher : Matcher<T>
+ {
+ private readonly Func<T, bool> _predicate;
+ private readonly string _description;
+
+ public SingleMatcher(Func<T, bool> predicate, string description)
+ {
+ _predicate = predicate;
+ _description = description;
+ }
+
+ public override bool TryMatch(IList<T> sequence, ref int index)
+ {
+ if (index < sequence.Count && _predicate(sequence[index]))
+ {
+ index++;
+ return true;
+ }
+
+ return false;
+ }
+
+ public override string ToString()
+ {
+ return _description;
+ }
+ }
+ }
+
+ class Matcher
+ {
+ /// <summary>
+ /// Matcher equivalent to (m*)
+ /// </summary>
+ public static Matcher<T> Repeat<T>(Matcher<T> matcher)
+ {
+ return Matcher<T>.Repeat(matcher);
+ }
+
+ /// <summary>
+ /// Matcher equivalent to (m+)
+ /// </summary>
+ public static Matcher<T> OneOrMore<T>(Matcher<T> matcher)
+ {
+ return Matcher<T>.OneOrMore(matcher);
+ }
+
+ /// <summary>
+ /// Matcher equivalent to (m_1|m_2)
+ /// </summary>
+ public static Matcher<T> Choice<T>(Matcher<T> matcher1, Matcher<T> matcher2)
+ {
+ return Matcher<T>.Choice(matcher1, matcher2);
+ }
+
+ /// <summary>
+ /// Matcher equivalent to (m_1 ... m_n)
+ /// </summary>
+ public static Matcher<T> Sequence<T>(params Matcher<T>[] matchers)
+ {
+ return Matcher<T>.Sequence(matchers);
+ }
+
+ /// <summary>
+ /// Matcher that matches an element if the provide predicate returns true.
+ /// </summary>
+ public static Matcher<T> Single<T>(Func<T, bool> predicate, string description)
+ {
+ return Matcher<T>.Single(predicate, description);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/MemberDeclarationSyntaxExtensions.cs b/main/src/addins/CSharpBinding/Util/MemberDeclarationSyntaxExtensions.cs
new file mode 100644
index 0000000000..2b48ad393b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/MemberDeclarationSyntaxExtensions.cs
@@ -0,0 +1,341 @@
+using System.Linq;
+using System.Runtime.CompilerServices;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static partial class MemberDeclarationSyntaxExtensions
+ {
+// private static readonly ConditionalWeakTable<MemberDeclarationSyntax, Dictionary<string, ImmutableArray<SyntaxToken>>> s_declarationCache =
+// new ConditionalWeakTable<MemberDeclarationSyntax, Dictionary<string, ImmutableArray<SyntaxToken>>>();
+// private static readonly ConditionalWeakTable<MemberDeclarationSyntax, Dictionary<string, ImmutableArray<SyntaxToken>>>.CreateValueCallback s_createLocalDeclarationMap = CreateLocalDeclarationMap;
+//
+// public static Microsoft.CodeAnalysis.CSharp.Extensions.MemberDeclarationSyntaxExtensions.LocalDeclarationMap GetLocalDeclarationMap(this MemberDeclarationSyntax member)
+// {
+// var result = s_declarationCache.GetValue(member, s_createLocalDeclarationMap);
+// return new Microsoft.CodeAnalysis.CSharp.Extensions.MemberDeclarationSyntaxExtensions.LocalDeclarationMap(result);
+// }
+
+// private static Dictionary<string, ImmutableArray<SyntaxToken>> CreateLocalDeclarationMap(MemberDeclarationSyntax member)
+// {
+// var dictionary = DeclarationFinder.GetAllDeclarations(member);
+// return dictionary.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.AsImmutable<SyntaxToken>());
+// }
+
+ public static SyntaxList<AttributeListSyntax> GetAttributes(this MemberDeclarationSyntax member)
+ {
+ if (member != null)
+ {
+ switch (member.Kind())
+ {
+ case SyntaxKind.EnumDeclaration:
+ return ((EnumDeclarationSyntax)member).AttributeLists;
+ case SyntaxKind.EnumMemberDeclaration:
+ return ((EnumMemberDeclarationSyntax)member).AttributeLists;
+ case SyntaxKind.ClassDeclaration:
+ case SyntaxKind.InterfaceDeclaration:
+ case SyntaxKind.StructDeclaration:
+ return ((TypeDeclarationSyntax)member).AttributeLists;
+ case SyntaxKind.DelegateDeclaration:
+ return ((DelegateDeclarationSyntax)member).AttributeLists;
+ case SyntaxKind.FieldDeclaration:
+ return ((FieldDeclarationSyntax)member).AttributeLists;
+ case SyntaxKind.EventFieldDeclaration:
+ return ((EventFieldDeclarationSyntax)member).AttributeLists;
+ case SyntaxKind.ConstructorDeclaration:
+ return ((ConstructorDeclarationSyntax)member).AttributeLists;
+ case SyntaxKind.DestructorDeclaration:
+ return ((DestructorDeclarationSyntax)member).AttributeLists;
+ case SyntaxKind.PropertyDeclaration:
+ return ((PropertyDeclarationSyntax)member).AttributeLists;
+ case SyntaxKind.EventDeclaration:
+ return ((EventDeclarationSyntax)member).AttributeLists;
+ case SyntaxKind.IndexerDeclaration:
+ return ((IndexerDeclarationSyntax)member).AttributeLists;
+ case SyntaxKind.OperatorDeclaration:
+ return ((OperatorDeclarationSyntax)member).AttributeLists;
+ case SyntaxKind.ConversionOperatorDeclaration:
+ return ((ConversionOperatorDeclarationSyntax)member).AttributeLists;
+ case SyntaxKind.MethodDeclaration:
+ return ((MethodDeclarationSyntax)member).AttributeLists;
+ case SyntaxKind.IncompleteMember:
+ return ((IncompleteMemberSyntax)member).AttributeLists;
+ }
+ }
+
+ return SyntaxFactory.List<AttributeListSyntax>();
+ }
+
+ public static SyntaxToken GetNameToken(this MemberDeclarationSyntax member)
+ {
+ if (member != null)
+ {
+ switch (member.Kind())
+ {
+ case SyntaxKind.EnumDeclaration:
+ return ((EnumDeclarationSyntax)member).Identifier;
+ case SyntaxKind.ClassDeclaration:
+ case SyntaxKind.InterfaceDeclaration:
+ case SyntaxKind.StructDeclaration:
+ return ((TypeDeclarationSyntax)member).Identifier;
+ case SyntaxKind.DelegateDeclaration:
+ return ((DelegateDeclarationSyntax)member).Identifier;
+ case SyntaxKind.FieldDeclaration:
+ return ((FieldDeclarationSyntax)member).Declaration.Variables.First().Identifier;
+ case SyntaxKind.EventFieldDeclaration:
+ return ((EventFieldDeclarationSyntax)member).Declaration.Variables.First().Identifier;
+ case SyntaxKind.PropertyDeclaration:
+ return ((PropertyDeclarationSyntax)member).Identifier;
+ case SyntaxKind.EventDeclaration:
+ return ((EventDeclarationSyntax)member).Identifier;
+ case SyntaxKind.MethodDeclaration:
+ return ((MethodDeclarationSyntax)member).Identifier;
+ }
+ }
+
+ // Constructors, destructors, indexers and operators don't have names.
+ return default(SyntaxToken);
+ }
+
+ public static int GetArity(this MemberDeclarationSyntax member)
+ {
+ if (member != null)
+ {
+ switch (member.Kind())
+ {
+ case SyntaxKind.ClassDeclaration:
+ case SyntaxKind.InterfaceDeclaration:
+ case SyntaxKind.StructDeclaration:
+ return ((TypeDeclarationSyntax)member).Arity;
+ case SyntaxKind.DelegateDeclaration:
+ return ((DelegateDeclarationSyntax)member).Arity;
+ case SyntaxKind.MethodDeclaration:
+ return ((MethodDeclarationSyntax)member).Arity;
+ }
+ }
+
+ return 0;
+ }
+
+ public static TypeParameterListSyntax GetTypeParameterList(this MemberDeclarationSyntax member)
+ {
+ if (member != null)
+ {
+ switch (member.Kind())
+ {
+ case SyntaxKind.ClassDeclaration:
+ case SyntaxKind.InterfaceDeclaration:
+ case SyntaxKind.StructDeclaration:
+ return ((TypeDeclarationSyntax)member).TypeParameterList;
+ case SyntaxKind.DelegateDeclaration:
+ return ((DelegateDeclarationSyntax)member).TypeParameterList;
+ case SyntaxKind.MethodDeclaration:
+ return ((MethodDeclarationSyntax)member).TypeParameterList;
+ }
+ }
+
+ return null;
+ }
+
+ public static BaseParameterListSyntax GetParameterList(this MemberDeclarationSyntax member)
+ {
+ if (member != null)
+ {
+ switch (member.Kind())
+ {
+ case SyntaxKind.DelegateDeclaration:
+ return ((DelegateDeclarationSyntax)member).ParameterList;
+ case SyntaxKind.MethodDeclaration:
+ return ((MethodDeclarationSyntax)member).ParameterList;
+ case SyntaxKind.ConstructorDeclaration:
+ return ((ConstructorDeclarationSyntax)member).ParameterList;
+ case SyntaxKind.IndexerDeclaration:
+ return ((IndexerDeclarationSyntax)member).ParameterList;
+ case SyntaxKind.OperatorDeclaration:
+ return ((OperatorDeclarationSyntax)member).ParameterList;
+ case SyntaxKind.ConversionOperatorDeclaration:
+ return ((ConversionOperatorDeclarationSyntax)member).ParameterList;
+ }
+ }
+
+ return null;
+ }
+
+ public static MemberDeclarationSyntax WithParameterList(
+ this MemberDeclarationSyntax member,
+ BaseParameterListSyntax parameterList)
+ {
+ if (member != null)
+ {
+ switch (member.Kind())
+ {
+ case SyntaxKind.DelegateDeclaration:
+ return ((DelegateDeclarationSyntax)member).WithParameterList((ParameterListSyntax)parameterList);
+ case SyntaxKind.MethodDeclaration:
+ return ((MethodDeclarationSyntax)member).WithParameterList((ParameterListSyntax)parameterList);
+ case SyntaxKind.ConstructorDeclaration:
+ return ((ConstructorDeclarationSyntax)member).WithParameterList((ParameterListSyntax)parameterList);
+ case SyntaxKind.IndexerDeclaration:
+ return ((IndexerDeclarationSyntax)member).WithParameterList((BracketedParameterListSyntax)parameterList);
+ case SyntaxKind.OperatorDeclaration:
+ return ((OperatorDeclarationSyntax)member).WithParameterList((ParameterListSyntax)parameterList);
+ case SyntaxKind.ConversionOperatorDeclaration:
+ return ((ConversionOperatorDeclarationSyntax)member).WithParameterList((ParameterListSyntax)parameterList);
+ }
+ }
+
+ return null;
+ }
+
+ public static MemberDeclarationSyntax AddAttributeLists(
+ this MemberDeclarationSyntax member,
+ params AttributeListSyntax[] attributeLists)
+ {
+ return member.WithAttributeLists(member.GetAttributes().AddRange(attributeLists));
+ }
+
+ public static MemberDeclarationSyntax WithAttributeLists(
+ this MemberDeclarationSyntax member,
+ SyntaxList<AttributeListSyntax> attributeLists)
+ {
+ if (member != null)
+ {
+ switch (member.Kind())
+ {
+ case SyntaxKind.EnumDeclaration:
+ return ((EnumDeclarationSyntax)member).WithAttributeLists(attributeLists);
+ case SyntaxKind.EnumMemberDeclaration:
+ return ((EnumMemberDeclarationSyntax)member).WithAttributeLists(attributeLists);
+ case SyntaxKind.ClassDeclaration:
+ case SyntaxKind.InterfaceDeclaration:
+ case SyntaxKind.StructDeclaration:
+ return ((TypeDeclarationSyntax)member).WithAttributeLists(attributeLists);
+ case SyntaxKind.DelegateDeclaration:
+ return ((DelegateDeclarationSyntax)member).WithAttributeLists(attributeLists);
+ case SyntaxKind.FieldDeclaration:
+ return ((FieldDeclarationSyntax)member).WithAttributeLists(attributeLists);
+ case SyntaxKind.EventFieldDeclaration:
+ return ((EventFieldDeclarationSyntax)member).WithAttributeLists(attributeLists);
+ case SyntaxKind.ConstructorDeclaration:
+ return ((ConstructorDeclarationSyntax)member).WithAttributeLists(attributeLists);
+ case SyntaxKind.DestructorDeclaration:
+ return ((DestructorDeclarationSyntax)member).WithAttributeLists(attributeLists);
+ case SyntaxKind.PropertyDeclaration:
+ return ((PropertyDeclarationSyntax)member).WithAttributeLists(attributeLists);
+ case SyntaxKind.EventDeclaration:
+ return ((EventDeclarationSyntax)member).WithAttributeLists(attributeLists);
+ case SyntaxKind.IndexerDeclaration:
+ return ((IndexerDeclarationSyntax)member).WithAttributeLists(attributeLists);
+ case SyntaxKind.OperatorDeclaration:
+ return ((OperatorDeclarationSyntax)member).WithAttributeLists(attributeLists);
+ case SyntaxKind.ConversionOperatorDeclaration:
+ return ((ConversionOperatorDeclarationSyntax)member).WithAttributeLists(attributeLists);
+ case SyntaxKind.MethodDeclaration:
+ return ((MethodDeclarationSyntax)member).WithAttributeLists(attributeLists);
+ case SyntaxKind.IncompleteMember:
+ return ((IncompleteMemberSyntax)member).WithAttributeLists(attributeLists);
+ }
+ }
+
+ return null;
+ }
+
+ public static TypeSyntax GetMemberType(this MemberDeclarationSyntax member)
+ {
+ if (member != null)
+ {
+ switch (member.Kind())
+ {
+ case SyntaxKind.DelegateDeclaration:
+ return ((DelegateDeclarationSyntax)member).ReturnType;
+ case SyntaxKind.MethodDeclaration:
+ return ((MethodDeclarationSyntax)member).ReturnType;
+ case SyntaxKind.OperatorDeclaration:
+ return ((OperatorDeclarationSyntax)member).ReturnType;
+ case SyntaxKind.PropertyDeclaration:
+ return ((PropertyDeclarationSyntax)member).Type;
+ case SyntaxKind.IndexerDeclaration:
+ return ((IndexerDeclarationSyntax)member).Type;
+ case SyntaxKind.EventDeclaration:
+ return ((EventDeclarationSyntax)member).Type;
+ case SyntaxKind.EventFieldDeclaration:
+ return ((EventFieldDeclarationSyntax)member).Declaration.Type;
+ case SyntaxKind.FieldDeclaration:
+ return ((FieldDeclarationSyntax)member).Declaration.Type;
+ }
+ }
+
+ return null;
+ }
+
+ public static bool HasMethodShape(this MemberDeclarationSyntax memberDeclaration)
+ {
+ if (memberDeclaration != null)
+ {
+ switch (memberDeclaration.Kind())
+ {
+ case SyntaxKind.MethodDeclaration:
+ case SyntaxKind.OperatorDeclaration:
+ case SyntaxKind.ConversionOperatorDeclaration:
+ case SyntaxKind.ConstructorDeclaration:
+ case SyntaxKind.DestructorDeclaration:
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static BlockSyntax GetBody(this MemberDeclarationSyntax memberDeclaration)
+ {
+ if (memberDeclaration != null)
+ {
+ switch (memberDeclaration.Kind())
+ {
+ case SyntaxKind.MethodDeclaration:
+ return ((MethodDeclarationSyntax)memberDeclaration).Body;
+ case SyntaxKind.OperatorDeclaration:
+ return ((OperatorDeclarationSyntax)memberDeclaration).Body;
+ case SyntaxKind.ConversionOperatorDeclaration:
+ return ((ConversionOperatorDeclarationSyntax)memberDeclaration).Body;
+ case SyntaxKind.ConstructorDeclaration:
+ return ((ConstructorDeclarationSyntax)memberDeclaration).Body;
+ case SyntaxKind.DestructorDeclaration:
+ return ((DestructorDeclarationSyntax)memberDeclaration).Body;
+ }
+ }
+
+ return null;
+ }
+
+ public static MemberDeclarationSyntax WithBody(
+ this MemberDeclarationSyntax memberDeclaration,
+ BlockSyntax body)
+ {
+ if (memberDeclaration != null)
+ {
+ switch (memberDeclaration.Kind())
+ {
+ case SyntaxKind.MethodDeclaration:
+ return ((MethodDeclarationSyntax)memberDeclaration).WithBody(body);
+ case SyntaxKind.OperatorDeclaration:
+ return ((OperatorDeclarationSyntax)memberDeclaration).WithBody(body);
+ case SyntaxKind.ConversionOperatorDeclaration:
+ return ((ConversionOperatorDeclarationSyntax)memberDeclaration).WithBody(body);
+ case SyntaxKind.ConstructorDeclaration:
+ return ((ConstructorDeclarationSyntax)memberDeclaration).WithBody(body);
+ case SyntaxKind.DestructorDeclaration:
+ return ((DestructorDeclarationSyntax)memberDeclaration).WithBody(body);
+ }
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/NRefactory6Host.cs b/main/src/addins/CSharpBinding/Util/NRefactory6Host.cs
new file mode 100644
index 0000000000..95889820c3
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/NRefactory6Host.cs
@@ -0,0 +1,39 @@
+//
+// NRefactoryHost.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ /// <summary>
+ /// Needs to be implemented from IDE/host side.
+ /// </summary>
+ static class NRefactory6Host
+ {
+ public static Func<string, string> GetLocalizedString = s => s;
+ public static Func<string, string> GetHelpLinkForDiagnostic = id => null;
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/NameGenerator.cs b/main/src/addins/CSharpBinding/Util/NameGenerator.cs
new file mode 100644
index 0000000000..60331fd7f2
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/NameGenerator.cs
@@ -0,0 +1,159 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis.Text;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class NameGenerator
+ {
+ public static IList<string> EnsureUniqueness(
+ IList<string> names,
+ Func<string, bool> canUse = null)
+ {
+ return EnsureUniqueness(names, names.Select(_ => false).ToList(), canUse);
+ }
+
+ /// <summary>
+ /// Ensures that any 'names' is unique and does not collide with any other name. Names that
+ /// are marked as IsFixed can not be touched. This does mean that if there are two names
+ /// that are the same, and both are fixed that you will end up with non-unique names at the
+ /// end.
+ /// </summary>
+ public static IList<string> EnsureUniqueness(
+ IList<string> names,
+ IList<bool> isFixed,
+ Func<string, bool> canUse = null,
+ bool isCaseSensitive = true)
+ {
+ var copy = names.ToList();
+ EnsureUniquenessInPlace(copy, isFixed, canUse, isCaseSensitive);
+ return copy;
+ }
+
+ public static IList<string> EnsureUniqueness(IList<string> names, bool isCaseSensitive)
+ {
+ return EnsureUniqueness(names, names.Select(_ => false).ToList(), isCaseSensitive: isCaseSensitive);
+ }
+
+ /// <summary>
+ /// Transforms baseName into a name that does not conflict with any name in 'reservedNames'
+ /// </summary>
+ public static string EnsureUniqueness(
+ string baseName,
+ IEnumerable<string> reservedNames,
+ bool isCaseSensitive = true)
+ {
+ var names = new List<string> { baseName };
+ var isFixed = new List<bool> { false };
+
+ names.AddRange(reservedNames.Distinct());
+ isFixed.AddRange(Enumerable.Repeat(true, names.Count - 1));
+
+ var result = EnsureUniqueness(names, isFixed, isCaseSensitive: isCaseSensitive);
+ return result.First();
+ }
+
+ private static void EnsureUniquenessInPlace(
+ IList<string> names,
+ IList<bool> isFixed,
+ Func<string, bool> canUse,
+ bool isCaseSensitive = true)
+ {
+ canUse = canUse ?? (s => true);
+
+ // Don't enumerate as we will be modifying the collection in place.
+ for (var i = 0; i < names.Count; i++)
+ {
+ var name = names[i];
+ var collisionIndices = GetCollisionIndices(names, name, isCaseSensitive);
+
+ if (canUse(name) && collisionIndices.Count < 2)
+ {
+ // no problems with this parameter name, move onto the next one.
+ continue;
+ }
+
+ HandleCollisions(isFixed, names, name, collisionIndices, canUse, isCaseSensitive);
+ }
+ }
+
+ private static void HandleCollisions(
+ IList<bool> isFixed,
+ IList<string> names,
+ string name,
+ List<int> collisionIndices,
+ Func<string, bool> canUse,
+ bool isCaseSensitive = true)
+ {
+ var suffix = 1;
+ var comparer = isCaseSensitive ? StringComparer.Ordinal : StringComparer.OrdinalIgnoreCase;
+ for (var i = 0; i < collisionIndices.Count; i++)
+ {
+ var collisionIndex = collisionIndices[i];
+ if (isFixed[collisionIndex])
+ {
+ // can't do anything about this name.
+ continue;
+ }
+
+ while (true)
+ {
+ var newName = name + suffix++;
+ if (!names.Contains(newName, comparer) && canUse(newName))
+ {
+ // Found a name that doesn't conflict with anything else.
+ names[collisionIndex] = newName;
+ break;
+ }
+ }
+ }
+ }
+
+ private static List<int> GetCollisionIndices(
+ IList<string> names,
+ string name,
+ bool isCaseSensitive = true)
+ {
+ var comparer = isCaseSensitive ? StringComparer.Ordinal : StringComparer.OrdinalIgnoreCase;
+ var collisionIndices =
+ names.Select((currentName, index) => new { currentName, index })
+ .Where(t => comparer.Equals(t.currentName, name))
+ .Select(t => t.index)
+ .ToList();
+ return collisionIndices;
+ }
+
+ public static string GenerateUniqueName(string baseName, Func<string, bool> canUse)
+ {
+ return GenerateUniqueName(baseName, string.Empty, canUse);
+ }
+
+ public static string GenerateUniqueName(string baseName, ISet<string> names, StringComparer comparer)
+ {
+ return GenerateUniqueName(baseName, x => !names.Contains(x, comparer));
+ }
+
+ public static string GenerateUniqueName(string baseName, string extension, Func<string, bool> canUse)
+ {
+ if (!string.IsNullOrEmpty(extension) && !extension.StartsWith("."))
+ {
+ extension = "." + extension;
+ }
+
+ var name = baseName + extension;
+ var index = 1;
+
+ // Check for collisions
+ while (!canUse(name))
+ {
+ name = baseName + index + extension;
+ index++;
+ }
+
+ return name;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/NameSyntaxComparer.cs b/main/src/addins/CSharpBinding/Util/NameSyntaxComparer.cs
new file mode 100644
index 0000000000..9808e524a5
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/NameSyntaxComparer.cs
@@ -0,0 +1,177 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ internal class NameSyntaxComparer : IComparer<NameSyntax>
+ {
+ private readonly IComparer<SyntaxToken> _tokenComparer;
+ internal TypeSyntaxComparer TypeComparer;
+
+ internal NameSyntaxComparer(IComparer<SyntaxToken> tokenComparer)
+ {
+ _tokenComparer = tokenComparer;
+ }
+
+ public static IComparer<NameSyntax> Create()
+ {
+ return Create(TokenComparer.NormalInstance);
+ }
+
+ public static IComparer<NameSyntax> Create(IComparer<SyntaxToken> tokenComparer)
+ {
+ var nameComparer = new NameSyntaxComparer(tokenComparer);
+ var typeComparer = new TypeSyntaxComparer(tokenComparer);
+
+ nameComparer.TypeComparer = typeComparer;
+ typeComparer.NameComparer = nameComparer;
+
+ return nameComparer;
+ }
+
+ public int Compare(NameSyntax x, NameSyntax y)
+ {
+ if (x == y)
+ {
+ return 0;
+ }
+
+ if (x.IsMissing && y.IsMissing)
+ {
+ return 0;
+ }
+
+ if (x.IsMissing)
+ {
+ return -1;
+ }
+ else if (y.IsMissing)
+ {
+ return 1;
+ }
+
+ // If we have a basic name, then it's simple to compare. Just
+ // check that token versus whatever the other name has as the
+ // first token.
+ if (x is IdentifierNameSyntax && y is IdentifierNameSyntax)
+ {
+ return _tokenComparer.Compare(x.GetFirstToken(includeSkipped: true), y.GetFirstToken());
+ }
+ else if (x is GenericNameSyntax && y is GenericNameSyntax)
+ {
+ // if both names are generic, then use a specialized routine
+ // that will check the names *and* the arguments.
+ return Compare((GenericNameSyntax)x, (GenericNameSyntax)y);
+ }
+ else if (x is IdentifierNameSyntax && y is GenericNameSyntax)
+ {
+ int compare = _tokenComparer.Compare(x.GetFirstToken(includeSkipped: true), y.GetFirstToken());
+ if (compare != 0)
+ {
+ return compare;
+ }
+
+ // Foo goes before Foo<T>
+ return -1;
+ }
+ else if (x is GenericNameSyntax && y is IdentifierNameSyntax)
+ {
+ int compare = _tokenComparer.Compare(x.GetFirstToken(includeSkipped: true), y.GetFirstToken());
+ if (compare != 0)
+ {
+ return compare;
+ }
+
+ // Foo<T> goes after Foo
+ return 1;
+ }
+
+ // At this point one or both of the nodes is a dotted name or
+ // aliased name. Break them apart into individual pieces and
+ // compare those.
+
+ var xNameParts = DecomposeNameParts(x);
+ var yNameParts = DecomposeNameParts(y);
+
+ for (int i = 0; i < xNameParts.Count && i < yNameParts.Count; i++)
+ {
+ int compare = Compare(xNameParts[i], yNameParts[i]);
+ if (compare != 0)
+ {
+ return compare;
+ }
+ }
+
+ // they matched up to this point. The shorter one should come
+ // first.
+ return xNameParts.Count - yNameParts.Count;
+ }
+
+ private IList<SimpleNameSyntax> DecomposeNameParts(NameSyntax name)
+ {
+ var result = new List<SimpleNameSyntax>();
+ DecomposeNameParts(name, result);
+ return result;
+ }
+
+ private void DecomposeNameParts(NameSyntax name, List<SimpleNameSyntax> result)
+ {
+ switch (name.Kind())
+ {
+ case SyntaxKind.QualifiedName:
+ var dottedName = (QualifiedNameSyntax)name;
+ DecomposeNameParts(dottedName.Left, result);
+ DecomposeNameParts(dottedName.Right, result);
+ break;
+ case SyntaxKind.AliasQualifiedName:
+ var aliasedName = (AliasQualifiedNameSyntax)name;
+ result.Add(aliasedName.Alias);
+ DecomposeNameParts(aliasedName.Name, result);
+ break;
+ case SyntaxKind.IdentifierName:
+ result.Add((IdentifierNameSyntax)name);
+ break;
+ case SyntaxKind.GenericName:
+ result.Add((GenericNameSyntax)name);
+ break;
+ }
+ }
+
+ private int Compare(GenericNameSyntax x, GenericNameSyntax y)
+ {
+ int compare = _tokenComparer.Compare(x.Identifier, y.Identifier);
+ if (compare != 0)
+ {
+ return compare;
+ }
+
+ // The one with less type params comes first.
+ compare = x.Arity - y.Arity;
+ if (compare != 0)
+ {
+ return compare;
+ }
+
+ // Same name, same parameter count. Compare each parameter.
+ for (int i = 0; i < x.Arity; i++)
+ {
+ var xArg = x.TypeArgumentList.Arguments[i];
+ var yArg = y.TypeArgumentList.Arguments[i];
+
+ compare = TypeComparer.Compare(xArg, yArg);
+ if (compare != 0)
+ {
+ return compare;
+ }
+ }
+
+ return 0;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/NameSyntaxExtensions.cs b/main/src/addins/CSharpBinding/Util/NameSyntaxExtensions.cs
new file mode 100644
index 0000000000..7236ebf2b6
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/NameSyntaxExtensions.cs
@@ -0,0 +1,119 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class NameSyntaxExtensions
+ {
+ public static IList<NameSyntax> GetNameParts(this NameSyntax nameSyntax)
+ {
+ return new NameSyntaxIterator(nameSyntax).ToList();
+ }
+
+ public static NameSyntax GetLastDottedName(this NameSyntax nameSyntax)
+ {
+ var parts = nameSyntax.GetNameParts();
+ return parts[parts.Count - 1];
+ }
+
+ public static SyntaxToken GetNameToken(this NameSyntax nameSyntax)
+ {
+ while (true)
+ {
+ if (nameSyntax.Kind() == SyntaxKind.IdentifierName)
+ {
+ return ((IdentifierNameSyntax)nameSyntax).Identifier;
+ }
+ else if (nameSyntax.Kind() == SyntaxKind.QualifiedName)
+ {
+ nameSyntax = ((QualifiedNameSyntax)nameSyntax).Right;
+ }
+ else if (nameSyntax.Kind() == SyntaxKind.GenericName)
+ {
+ return ((GenericNameSyntax)nameSyntax).Identifier;
+ }
+ else if (nameSyntax.Kind() == SyntaxKind.AliasQualifiedName)
+ {
+ nameSyntax = ((AliasQualifiedNameSyntax)nameSyntax).Name;
+ }
+ else
+ {
+ throw new NotSupportedException();
+ }
+ }
+ }
+
+ public static bool CanBeReplacedWithAnyName(this NameSyntax nameSyntax)
+ {
+ if (nameSyntax.IsParentKind(SyntaxKind.AliasQualifiedName) ||
+ nameSyntax.IsParentKind(SyntaxKind.NameColon) ||
+ nameSyntax.IsParentKind(SyntaxKind.NameEquals) ||
+ nameSyntax.IsParentKind(SyntaxKind.TypeParameterConstraintClause))
+ {
+ return false;
+ }
+
+ if (nameSyntax.CheckParent<QualifiedNameSyntax>(q => q.Right == nameSyntax) ||
+ nameSyntax.CheckParent<MemberAccessExpressionSyntax>(m => m.Name == nameSyntax))
+ {
+ return false;
+ }
+
+ // TODO(cyrusn): Add more cases as the language changes.
+ return true;
+ }
+ }
+
+ internal class NameSyntaxIterator : IEnumerable<NameSyntax>
+ {
+ private readonly NameSyntax _name;
+
+ public NameSyntaxIterator(NameSyntax name)
+ {
+ if (name == null)
+ {
+ throw new ArgumentNullException(@"name");
+ }
+
+ _name = name;
+ }
+
+ public IEnumerator<NameSyntax> GetEnumerator()
+ {
+ var nodes = new LinkedList<NameSyntax>();
+
+ var currentNode = _name;
+ while (true)
+ {
+ if (currentNode.Kind() == SyntaxKind.QualifiedName)
+ {
+ var qualifiedName = currentNode as QualifiedNameSyntax;
+ nodes.AddFirst(qualifiedName.Right);
+ currentNode = qualifiedName.Left;
+ }
+ else
+ {
+ nodes.AddFirst(currentNode);
+ break;
+ }
+ }
+
+ return nodes.GetEnumerator();
+ }
+
+ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/NamespaceDeclarationSyntaxExtensions.cs b/main/src/addins/CSharpBinding/Util/NamespaceDeclarationSyntaxExtensions.cs
new file mode 100644
index 0000000000..de5cf065f5
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/NamespaceDeclarationSyntaxExtensions.cs
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class NamespaceDeclarationSyntaxExtensions
+ {
+ public static NamespaceDeclarationSyntax AddUsingDirectives(
+ this NamespaceDeclarationSyntax namespaceDeclaration,
+ IList<UsingDirectiveSyntax> usingDirectives,
+ bool placeSystemNamespaceFirst,
+ params SyntaxAnnotation[] annotations)
+ {
+ if (!usingDirectives.Any())
+ {
+ return namespaceDeclaration;
+ }
+
+ var specialCaseSystem = placeSystemNamespaceFirst;
+ var comparer = specialCaseSystem
+ ? UsingsAndExternAliasesDirectiveComparer.SystemFirstInstance
+ : UsingsAndExternAliasesDirectiveComparer.NormalInstance;
+
+ var usings = new List<UsingDirectiveSyntax>();
+ usings.AddRange(namespaceDeclaration.Usings);
+ usings.AddRange(usingDirectives);
+
+ if (namespaceDeclaration.Usings.IsSorted(comparer))
+ {
+ usings.Sort(comparer);
+ }
+
+ usings = usings.Select(u => u.WithAdditionalAnnotations(annotations)).ToList();
+ var newNamespace = namespaceDeclaration.WithUsings(usings.ToSyntaxList());
+
+ return newNamespace;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/ObjectExtensions.cs b/main/src/addins/CSharpBinding/Util/ObjectExtensions.cs
new file mode 100644
index 0000000000..cf055ed025
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/ObjectExtensions.cs
@@ -0,0 +1,7667 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Diagnostics.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+
+namespace ICSharpCode.NRefactory6
+{
+ static partial class ObjectExtensions
+ {
+
+
+ #region TypeSwitch on Action
+
+ public static void TypeSwitch<TBaseType, TDerivedType1>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TBaseType> defaultAction = null) where TDerivedType1 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TDerivedType14> matchAction14, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ matchAction14((TDerivedType14)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TDerivedType14> matchAction14, Action<TDerivedType15> matchAction15, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ matchAction14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ matchAction15((TDerivedType15)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TDerivedType14> matchAction14, Action<TDerivedType15> matchAction15, Action<TDerivedType16> matchAction16, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ matchAction14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ matchAction15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ matchAction16((TDerivedType16)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TDerivedType14> matchAction14, Action<TDerivedType15> matchAction15, Action<TDerivedType16> matchAction16, Action<TDerivedType17> matchAction17, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ matchAction14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ matchAction15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ matchAction16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ matchAction17((TDerivedType17)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TDerivedType14> matchAction14, Action<TDerivedType15> matchAction15, Action<TDerivedType16> matchAction16, Action<TDerivedType17> matchAction17, Action<TDerivedType18> matchAction18, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ matchAction14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ matchAction15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ matchAction16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ matchAction17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ matchAction18((TDerivedType18)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TDerivedType14> matchAction14, Action<TDerivedType15> matchAction15, Action<TDerivedType16> matchAction16, Action<TDerivedType17> matchAction17, Action<TDerivedType18> matchAction18, Action<TDerivedType19> matchAction19, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ matchAction14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ matchAction15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ matchAction16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ matchAction17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ matchAction18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ matchAction19((TDerivedType19)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TDerivedType14> matchAction14, Action<TDerivedType15> matchAction15, Action<TDerivedType16> matchAction16, Action<TDerivedType17> matchAction17, Action<TDerivedType18> matchAction18, Action<TDerivedType19> matchAction19, Action<TDerivedType20> matchAction20, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ matchAction14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ matchAction15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ matchAction16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ matchAction17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ matchAction18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ matchAction19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ matchAction20((TDerivedType20)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TDerivedType14> matchAction14, Action<TDerivedType15> matchAction15, Action<TDerivedType16> matchAction16, Action<TDerivedType17> matchAction17, Action<TDerivedType18> matchAction18, Action<TDerivedType19> matchAction19, Action<TDerivedType20> matchAction20, Action<TDerivedType21> matchAction21, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ matchAction14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ matchAction15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ matchAction16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ matchAction17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ matchAction18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ matchAction19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ matchAction20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ matchAction21((TDerivedType21)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TDerivedType14> matchAction14, Action<TDerivedType15> matchAction15, Action<TDerivedType16> matchAction16, Action<TDerivedType17> matchAction17, Action<TDerivedType18> matchAction18, Action<TDerivedType19> matchAction19, Action<TDerivedType20> matchAction20, Action<TDerivedType21> matchAction21, Action<TDerivedType22> matchAction22, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ matchAction14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ matchAction15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ matchAction16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ matchAction17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ matchAction18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ matchAction19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ matchAction20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ matchAction21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ matchAction22((TDerivedType22)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TDerivedType14> matchAction14, Action<TDerivedType15> matchAction15, Action<TDerivedType16> matchAction16, Action<TDerivedType17> matchAction17, Action<TDerivedType18> matchAction18, Action<TDerivedType19> matchAction19, Action<TDerivedType20> matchAction20, Action<TDerivedType21> matchAction21, Action<TDerivedType22> matchAction22, Action<TDerivedType23> matchAction23, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ matchAction14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ matchAction15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ matchAction16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ matchAction17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ matchAction18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ matchAction19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ matchAction20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ matchAction21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ matchAction22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ matchAction23((TDerivedType23)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TDerivedType14> matchAction14, Action<TDerivedType15> matchAction15, Action<TDerivedType16> matchAction16, Action<TDerivedType17> matchAction17, Action<TDerivedType18> matchAction18, Action<TDerivedType19> matchAction19, Action<TDerivedType20> matchAction20, Action<TDerivedType21> matchAction21, Action<TDerivedType22> matchAction22, Action<TDerivedType23> matchAction23, Action<TDerivedType24> matchAction24, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ matchAction14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ matchAction15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ matchAction16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ matchAction17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ matchAction18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ matchAction19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ matchAction20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ matchAction21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ matchAction22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ matchAction23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ matchAction24((TDerivedType24)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TDerivedType14> matchAction14, Action<TDerivedType15> matchAction15, Action<TDerivedType16> matchAction16, Action<TDerivedType17> matchAction17, Action<TDerivedType18> matchAction18, Action<TDerivedType19> matchAction19, Action<TDerivedType20> matchAction20, Action<TDerivedType21> matchAction21, Action<TDerivedType22> matchAction22, Action<TDerivedType23> matchAction23, Action<TDerivedType24> matchAction24, Action<TDerivedType25> matchAction25, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ matchAction14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ matchAction15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ matchAction16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ matchAction17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ matchAction18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ matchAction19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ matchAction20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ matchAction21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ matchAction22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ matchAction23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ matchAction24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ matchAction25((TDerivedType25)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TDerivedType14> matchAction14, Action<TDerivedType15> matchAction15, Action<TDerivedType16> matchAction16, Action<TDerivedType17> matchAction17, Action<TDerivedType18> matchAction18, Action<TDerivedType19> matchAction19, Action<TDerivedType20> matchAction20, Action<TDerivedType21> matchAction21, Action<TDerivedType22> matchAction22, Action<TDerivedType23> matchAction23, Action<TDerivedType24> matchAction24, Action<TDerivedType25> matchAction25, Action<TDerivedType26> matchAction26, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ matchAction14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ matchAction15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ matchAction16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ matchAction17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ matchAction18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ matchAction19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ matchAction20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ matchAction21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ matchAction22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ matchAction23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ matchAction24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ matchAction25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ matchAction26((TDerivedType26)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TDerivedType14> matchAction14, Action<TDerivedType15> matchAction15, Action<TDerivedType16> matchAction16, Action<TDerivedType17> matchAction17, Action<TDerivedType18> matchAction18, Action<TDerivedType19> matchAction19, Action<TDerivedType20> matchAction20, Action<TDerivedType21> matchAction21, Action<TDerivedType22> matchAction22, Action<TDerivedType23> matchAction23, Action<TDerivedType24> matchAction24, Action<TDerivedType25> matchAction25, Action<TDerivedType26> matchAction26, Action<TDerivedType27> matchAction27, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ matchAction14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ matchAction15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ matchAction16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ matchAction17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ matchAction18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ matchAction19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ matchAction20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ matchAction21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ matchAction22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ matchAction23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ matchAction24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ matchAction25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ matchAction26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ matchAction27((TDerivedType27)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TDerivedType14> matchAction14, Action<TDerivedType15> matchAction15, Action<TDerivedType16> matchAction16, Action<TDerivedType17> matchAction17, Action<TDerivedType18> matchAction18, Action<TDerivedType19> matchAction19, Action<TDerivedType20> matchAction20, Action<TDerivedType21> matchAction21, Action<TDerivedType22> matchAction22, Action<TDerivedType23> matchAction23, Action<TDerivedType24> matchAction24, Action<TDerivedType25> matchAction25, Action<TDerivedType26> matchAction26, Action<TDerivedType27> matchAction27, Action<TDerivedType28> matchAction28, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ where TDerivedType28 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ matchAction14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ matchAction15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ matchAction16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ matchAction17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ matchAction18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ matchAction19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ matchAction20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ matchAction21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ matchAction22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ matchAction23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ matchAction24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ matchAction25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ matchAction26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ matchAction27((TDerivedType27)obj);
+ }
+ else if (obj is TDerivedType28)
+ {
+ matchAction28((TDerivedType28)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TDerivedType14> matchAction14, Action<TDerivedType15> matchAction15, Action<TDerivedType16> matchAction16, Action<TDerivedType17> matchAction17, Action<TDerivedType18> matchAction18, Action<TDerivedType19> matchAction19, Action<TDerivedType20> matchAction20, Action<TDerivedType21> matchAction21, Action<TDerivedType22> matchAction22, Action<TDerivedType23> matchAction23, Action<TDerivedType24> matchAction24, Action<TDerivedType25> matchAction25, Action<TDerivedType26> matchAction26, Action<TDerivedType27> matchAction27, Action<TDerivedType28> matchAction28, Action<TDerivedType29> matchAction29, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ where TDerivedType28 : TBaseType
+ where TDerivedType29 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ matchAction14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ matchAction15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ matchAction16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ matchAction17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ matchAction18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ matchAction19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ matchAction20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ matchAction21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ matchAction22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ matchAction23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ matchAction24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ matchAction25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ matchAction26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ matchAction27((TDerivedType27)obj);
+ }
+ else if (obj is TDerivedType28)
+ {
+ matchAction28((TDerivedType28)obj);
+ }
+ else if (obj is TDerivedType29)
+ {
+ matchAction29((TDerivedType29)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29, TDerivedType30>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TDerivedType14> matchAction14, Action<TDerivedType15> matchAction15, Action<TDerivedType16> matchAction16, Action<TDerivedType17> matchAction17, Action<TDerivedType18> matchAction18, Action<TDerivedType19> matchAction19, Action<TDerivedType20> matchAction20, Action<TDerivedType21> matchAction21, Action<TDerivedType22> matchAction22, Action<TDerivedType23> matchAction23, Action<TDerivedType24> matchAction24, Action<TDerivedType25> matchAction25, Action<TDerivedType26> matchAction26, Action<TDerivedType27> matchAction27, Action<TDerivedType28> matchAction28, Action<TDerivedType29> matchAction29, Action<TDerivedType30> matchAction30, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ where TDerivedType28 : TBaseType
+ where TDerivedType29 : TBaseType
+ where TDerivedType30 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ matchAction14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ matchAction15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ matchAction16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ matchAction17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ matchAction18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ matchAction19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ matchAction20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ matchAction21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ matchAction22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ matchAction23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ matchAction24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ matchAction25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ matchAction26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ matchAction27((TDerivedType27)obj);
+ }
+ else if (obj is TDerivedType28)
+ {
+ matchAction28((TDerivedType28)obj);
+ }
+ else if (obj is TDerivedType29)
+ {
+ matchAction29((TDerivedType29)obj);
+ }
+ else if (obj is TDerivedType30)
+ {
+ matchAction30((TDerivedType30)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29, TDerivedType30, TDerivedType31>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TDerivedType14> matchAction14, Action<TDerivedType15> matchAction15, Action<TDerivedType16> matchAction16, Action<TDerivedType17> matchAction17, Action<TDerivedType18> matchAction18, Action<TDerivedType19> matchAction19, Action<TDerivedType20> matchAction20, Action<TDerivedType21> matchAction21, Action<TDerivedType22> matchAction22, Action<TDerivedType23> matchAction23, Action<TDerivedType24> matchAction24, Action<TDerivedType25> matchAction25, Action<TDerivedType26> matchAction26, Action<TDerivedType27> matchAction27, Action<TDerivedType28> matchAction28, Action<TDerivedType29> matchAction29, Action<TDerivedType30> matchAction30, Action<TDerivedType31> matchAction31, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ where TDerivedType28 : TBaseType
+ where TDerivedType29 : TBaseType
+ where TDerivedType30 : TBaseType
+ where TDerivedType31 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ matchAction14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ matchAction15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ matchAction16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ matchAction17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ matchAction18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ matchAction19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ matchAction20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ matchAction21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ matchAction22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ matchAction23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ matchAction24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ matchAction25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ matchAction26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ matchAction27((TDerivedType27)obj);
+ }
+ else if (obj is TDerivedType28)
+ {
+ matchAction28((TDerivedType28)obj);
+ }
+ else if (obj is TDerivedType29)
+ {
+ matchAction29((TDerivedType29)obj);
+ }
+ else if (obj is TDerivedType30)
+ {
+ matchAction30((TDerivedType30)obj);
+ }
+ else if (obj is TDerivedType31)
+ {
+ matchAction31((TDerivedType31)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29, TDerivedType30, TDerivedType31, TDerivedType32>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TDerivedType14> matchAction14, Action<TDerivedType15> matchAction15, Action<TDerivedType16> matchAction16, Action<TDerivedType17> matchAction17, Action<TDerivedType18> matchAction18, Action<TDerivedType19> matchAction19, Action<TDerivedType20> matchAction20, Action<TDerivedType21> matchAction21, Action<TDerivedType22> matchAction22, Action<TDerivedType23> matchAction23, Action<TDerivedType24> matchAction24, Action<TDerivedType25> matchAction25, Action<TDerivedType26> matchAction26, Action<TDerivedType27> matchAction27, Action<TDerivedType28> matchAction28, Action<TDerivedType29> matchAction29, Action<TDerivedType30> matchAction30, Action<TDerivedType31> matchAction31, Action<TDerivedType32> matchAction32, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ where TDerivedType28 : TBaseType
+ where TDerivedType29 : TBaseType
+ where TDerivedType30 : TBaseType
+ where TDerivedType31 : TBaseType
+ where TDerivedType32 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ matchAction14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ matchAction15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ matchAction16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ matchAction17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ matchAction18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ matchAction19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ matchAction20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ matchAction21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ matchAction22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ matchAction23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ matchAction24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ matchAction25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ matchAction26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ matchAction27((TDerivedType27)obj);
+ }
+ else if (obj is TDerivedType28)
+ {
+ matchAction28((TDerivedType28)obj);
+ }
+ else if (obj is TDerivedType29)
+ {
+ matchAction29((TDerivedType29)obj);
+ }
+ else if (obj is TDerivedType30)
+ {
+ matchAction30((TDerivedType30)obj);
+ }
+ else if (obj is TDerivedType31)
+ {
+ matchAction31((TDerivedType31)obj);
+ }
+ else if (obj is TDerivedType32)
+ {
+ matchAction32((TDerivedType32)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ public static void TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29, TDerivedType30, TDerivedType31, TDerivedType32, TDerivedType33>(this TBaseType obj, Action<TDerivedType1> matchAction1, Action<TDerivedType2> matchAction2, Action<TDerivedType3> matchAction3, Action<TDerivedType4> matchAction4, Action<TDerivedType5> matchAction5, Action<TDerivedType6> matchAction6, Action<TDerivedType7> matchAction7, Action<TDerivedType8> matchAction8, Action<TDerivedType9> matchAction9, Action<TDerivedType10> matchAction10, Action<TDerivedType11> matchAction11, Action<TDerivedType12> matchAction12, Action<TDerivedType13> matchAction13, Action<TDerivedType14> matchAction14, Action<TDerivedType15> matchAction15, Action<TDerivedType16> matchAction16, Action<TDerivedType17> matchAction17, Action<TDerivedType18> matchAction18, Action<TDerivedType19> matchAction19, Action<TDerivedType20> matchAction20, Action<TDerivedType21> matchAction21, Action<TDerivedType22> matchAction22, Action<TDerivedType23> matchAction23, Action<TDerivedType24> matchAction24, Action<TDerivedType25> matchAction25, Action<TDerivedType26> matchAction26, Action<TDerivedType27> matchAction27, Action<TDerivedType28> matchAction28, Action<TDerivedType29> matchAction29, Action<TDerivedType30> matchAction30, Action<TDerivedType31> matchAction31, Action<TDerivedType32> matchAction32, Action<TDerivedType33> matchAction33, Action<TBaseType> defaultAction = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ where TDerivedType28 : TBaseType
+ where TDerivedType29 : TBaseType
+ where TDerivedType30 : TBaseType
+ where TDerivedType31 : TBaseType
+ where TDerivedType32 : TBaseType
+ where TDerivedType33 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ matchAction1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ matchAction2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ matchAction3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ matchAction4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ matchAction5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ matchAction6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ matchAction7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ matchAction8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ matchAction9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ matchAction10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ matchAction11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ matchAction12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ matchAction13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ matchAction14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ matchAction15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ matchAction16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ matchAction17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ matchAction18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ matchAction19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ matchAction20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ matchAction21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ matchAction22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ matchAction23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ matchAction24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ matchAction25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ matchAction26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ matchAction27((TDerivedType27)obj);
+ }
+ else if (obj is TDerivedType28)
+ {
+ matchAction28((TDerivedType28)obj);
+ }
+ else if (obj is TDerivedType29)
+ {
+ matchAction29((TDerivedType29)obj);
+ }
+ else if (obj is TDerivedType30)
+ {
+ matchAction30((TDerivedType30)obj);
+ }
+ else if (obj is TDerivedType31)
+ {
+ matchAction31((TDerivedType31)obj);
+ }
+ else if (obj is TDerivedType32)
+ {
+ matchAction32((TDerivedType32)obj);
+ }
+ else if (obj is TDerivedType33)
+ {
+ matchAction33((TDerivedType33)obj);
+ }
+ else if (defaultAction != null)
+ {
+ defaultAction(obj);
+ }
+ }
+
+ #endregion
+
+ #region TypeSwitch on Func<T>
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TBaseType, TResult> defaultFunc = null) where TDerivedType1 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ return matchFunc21((TDerivedType21)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ return matchFunc21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ return matchFunc22((TDerivedType22)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ return matchFunc21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ return matchFunc22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ return matchFunc23((TDerivedType23)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ return matchFunc21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ return matchFunc22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ return matchFunc23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ return matchFunc24((TDerivedType24)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TDerivedType25, TResult> matchFunc25, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ return matchFunc21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ return matchFunc22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ return matchFunc23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ return matchFunc24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ return matchFunc25((TDerivedType25)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TDerivedType25, TResult> matchFunc25, Func<TDerivedType26, TResult> matchFunc26, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ return matchFunc21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ return matchFunc22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ return matchFunc23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ return matchFunc24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ return matchFunc25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ return matchFunc26((TDerivedType26)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TDerivedType25, TResult> matchFunc25, Func<TDerivedType26, TResult> matchFunc26, Func<TDerivedType27, TResult> matchFunc27, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ return matchFunc21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ return matchFunc22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ return matchFunc23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ return matchFunc24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ return matchFunc25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ return matchFunc26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ return matchFunc27((TDerivedType27)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TDerivedType25, TResult> matchFunc25, Func<TDerivedType26, TResult> matchFunc26, Func<TDerivedType27, TResult> matchFunc27, Func<TDerivedType28, TResult> matchFunc28, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ where TDerivedType28 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ return matchFunc21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ return matchFunc22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ return matchFunc23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ return matchFunc24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ return matchFunc25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ return matchFunc26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ return matchFunc27((TDerivedType27)obj);
+ }
+ else if (obj is TDerivedType28)
+ {
+ return matchFunc28((TDerivedType28)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TDerivedType25, TResult> matchFunc25, Func<TDerivedType26, TResult> matchFunc26, Func<TDerivedType27, TResult> matchFunc27, Func<TDerivedType28, TResult> matchFunc28, Func<TDerivedType29, TResult> matchFunc29, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ where TDerivedType28 : TBaseType
+ where TDerivedType29 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ return matchFunc21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ return matchFunc22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ return matchFunc23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ return matchFunc24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ return matchFunc25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ return matchFunc26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ return matchFunc27((TDerivedType27)obj);
+ }
+ else if (obj is TDerivedType28)
+ {
+ return matchFunc28((TDerivedType28)obj);
+ }
+ else if (obj is TDerivedType29)
+ {
+ return matchFunc29((TDerivedType29)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29, TDerivedType30, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TDerivedType25, TResult> matchFunc25, Func<TDerivedType26, TResult> matchFunc26, Func<TDerivedType27, TResult> matchFunc27, Func<TDerivedType28, TResult> matchFunc28, Func<TDerivedType29, TResult> matchFunc29, Func<TDerivedType30, TResult> matchFunc30, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ where TDerivedType28 : TBaseType
+ where TDerivedType29 : TBaseType
+ where TDerivedType30 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ return matchFunc21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ return matchFunc22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ return matchFunc23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ return matchFunc24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ return matchFunc25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ return matchFunc26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ return matchFunc27((TDerivedType27)obj);
+ }
+ else if (obj is TDerivedType28)
+ {
+ return matchFunc28((TDerivedType28)obj);
+ }
+ else if (obj is TDerivedType29)
+ {
+ return matchFunc29((TDerivedType29)obj);
+ }
+ else if (obj is TDerivedType30)
+ {
+ return matchFunc30((TDerivedType30)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29, TDerivedType30, TDerivedType31, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TDerivedType25, TResult> matchFunc25, Func<TDerivedType26, TResult> matchFunc26, Func<TDerivedType27, TResult> matchFunc27, Func<TDerivedType28, TResult> matchFunc28, Func<TDerivedType29, TResult> matchFunc29, Func<TDerivedType30, TResult> matchFunc30, Func<TDerivedType31, TResult> matchFunc31, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ where TDerivedType28 : TBaseType
+ where TDerivedType29 : TBaseType
+ where TDerivedType30 : TBaseType
+ where TDerivedType31 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ return matchFunc21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ return matchFunc22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ return matchFunc23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ return matchFunc24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ return matchFunc25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ return matchFunc26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ return matchFunc27((TDerivedType27)obj);
+ }
+ else if (obj is TDerivedType28)
+ {
+ return matchFunc28((TDerivedType28)obj);
+ }
+ else if (obj is TDerivedType29)
+ {
+ return matchFunc29((TDerivedType29)obj);
+ }
+ else if (obj is TDerivedType30)
+ {
+ return matchFunc30((TDerivedType30)obj);
+ }
+ else if (obj is TDerivedType31)
+ {
+ return matchFunc31((TDerivedType31)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29, TDerivedType30, TDerivedType31, TDerivedType32, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TDerivedType25, TResult> matchFunc25, Func<TDerivedType26, TResult> matchFunc26, Func<TDerivedType27, TResult> matchFunc27, Func<TDerivedType28, TResult> matchFunc28, Func<TDerivedType29, TResult> matchFunc29, Func<TDerivedType30, TResult> matchFunc30, Func<TDerivedType31, TResult> matchFunc31, Func<TDerivedType32, TResult> matchFunc32, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ where TDerivedType28 : TBaseType
+ where TDerivedType29 : TBaseType
+ where TDerivedType30 : TBaseType
+ where TDerivedType31 : TBaseType
+ where TDerivedType32 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ return matchFunc21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ return matchFunc22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ return matchFunc23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ return matchFunc24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ return matchFunc25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ return matchFunc26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ return matchFunc27((TDerivedType27)obj);
+ }
+ else if (obj is TDerivedType28)
+ {
+ return matchFunc28((TDerivedType28)obj);
+ }
+ else if (obj is TDerivedType29)
+ {
+ return matchFunc29((TDerivedType29)obj);
+ }
+ else if (obj is TDerivedType30)
+ {
+ return matchFunc30((TDerivedType30)obj);
+ }
+ else if (obj is TDerivedType31)
+ {
+ return matchFunc31((TDerivedType31)obj);
+ }
+ else if (obj is TDerivedType32)
+ {
+ return matchFunc32((TDerivedType32)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29, TDerivedType30, TDerivedType31, TDerivedType32, TDerivedType33, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TDerivedType25, TResult> matchFunc25, Func<TDerivedType26, TResult> matchFunc26, Func<TDerivedType27, TResult> matchFunc27, Func<TDerivedType28, TResult> matchFunc28, Func<TDerivedType29, TResult> matchFunc29, Func<TDerivedType30, TResult> matchFunc30, Func<TDerivedType31, TResult> matchFunc31, Func<TDerivedType32, TResult> matchFunc32, Func<TDerivedType33, TResult> matchFunc33, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ where TDerivedType28 : TBaseType
+ where TDerivedType29 : TBaseType
+ where TDerivedType30 : TBaseType
+ where TDerivedType31 : TBaseType
+ where TDerivedType32 : TBaseType
+ where TDerivedType33 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ return matchFunc21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ return matchFunc22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ return matchFunc23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ return matchFunc24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ return matchFunc25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ return matchFunc26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ return matchFunc27((TDerivedType27)obj);
+ }
+ else if (obj is TDerivedType28)
+ {
+ return matchFunc28((TDerivedType28)obj);
+ }
+ else if (obj is TDerivedType29)
+ {
+ return matchFunc29((TDerivedType29)obj);
+ }
+ else if (obj is TDerivedType30)
+ {
+ return matchFunc30((TDerivedType30)obj);
+ }
+ else if (obj is TDerivedType31)
+ {
+ return matchFunc31((TDerivedType31)obj);
+ }
+ else if (obj is TDerivedType32)
+ {
+ return matchFunc32((TDerivedType32)obj);
+ }
+ else if (obj is TDerivedType33)
+ {
+ return matchFunc33((TDerivedType33)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29, TDerivedType30, TDerivedType31, TDerivedType32, TDerivedType33, TDerivedType34, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TDerivedType25, TResult> matchFunc25, Func<TDerivedType26, TResult> matchFunc26, Func<TDerivedType27, TResult> matchFunc27, Func<TDerivedType28, TResult> matchFunc28, Func<TDerivedType29, TResult> matchFunc29, Func<TDerivedType30, TResult> matchFunc30, Func<TDerivedType31, TResult> matchFunc31, Func<TDerivedType32, TResult> matchFunc32, Func<TDerivedType33, TResult> matchFunc33, Func<TDerivedType34, TResult> matchFunc34, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ where TDerivedType28 : TBaseType
+ where TDerivedType29 : TBaseType
+ where TDerivedType30 : TBaseType
+ where TDerivedType31 : TBaseType
+ where TDerivedType32 : TBaseType
+ where TDerivedType33 : TBaseType
+ where TDerivedType34 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ return matchFunc21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ return matchFunc22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ return matchFunc23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ return matchFunc24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ return matchFunc25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ return matchFunc26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ return matchFunc27((TDerivedType27)obj);
+ }
+ else if (obj is TDerivedType28)
+ {
+ return matchFunc28((TDerivedType28)obj);
+ }
+ else if (obj is TDerivedType29)
+ {
+ return matchFunc29((TDerivedType29)obj);
+ }
+ else if (obj is TDerivedType30)
+ {
+ return matchFunc30((TDerivedType30)obj);
+ }
+ else if (obj is TDerivedType31)
+ {
+ return matchFunc31((TDerivedType31)obj);
+ }
+ else if (obj is TDerivedType32)
+ {
+ return matchFunc32((TDerivedType32)obj);
+ }
+ else if (obj is TDerivedType33)
+ {
+ return matchFunc33((TDerivedType33)obj);
+ }
+ else if (obj is TDerivedType34)
+ {
+ return matchFunc34((TDerivedType34)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29, TDerivedType30, TDerivedType31, TDerivedType32, TDerivedType33, TDerivedType34, TDerivedType35, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TDerivedType25, TResult> matchFunc25, Func<TDerivedType26, TResult> matchFunc26, Func<TDerivedType27, TResult> matchFunc27, Func<TDerivedType28, TResult> matchFunc28, Func<TDerivedType29, TResult> matchFunc29, Func<TDerivedType30, TResult> matchFunc30, Func<TDerivedType31, TResult> matchFunc31, Func<TDerivedType32, TResult> matchFunc32, Func<TDerivedType33, TResult> matchFunc33, Func<TDerivedType34, TResult> matchFunc34, Func<TDerivedType35, TResult> matchFunc35, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ where TDerivedType28 : TBaseType
+ where TDerivedType29 : TBaseType
+ where TDerivedType30 : TBaseType
+ where TDerivedType31 : TBaseType
+ where TDerivedType32 : TBaseType
+ where TDerivedType33 : TBaseType
+ where TDerivedType34 : TBaseType
+ where TDerivedType35 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ return matchFunc21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ return matchFunc22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ return matchFunc23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ return matchFunc24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ return matchFunc25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ return matchFunc26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ return matchFunc27((TDerivedType27)obj);
+ }
+ else if (obj is TDerivedType28)
+ {
+ return matchFunc28((TDerivedType28)obj);
+ }
+ else if (obj is TDerivedType29)
+ {
+ return matchFunc29((TDerivedType29)obj);
+ }
+ else if (obj is TDerivedType30)
+ {
+ return matchFunc30((TDerivedType30)obj);
+ }
+ else if (obj is TDerivedType31)
+ {
+ return matchFunc31((TDerivedType31)obj);
+ }
+ else if (obj is TDerivedType32)
+ {
+ return matchFunc32((TDerivedType32)obj);
+ }
+ else if (obj is TDerivedType33)
+ {
+ return matchFunc33((TDerivedType33)obj);
+ }
+ else if (obj is TDerivedType34)
+ {
+ return matchFunc34((TDerivedType34)obj);
+ }
+ else if (obj is TDerivedType35)
+ {
+ return matchFunc35((TDerivedType35)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29, TDerivedType30, TDerivedType31, TDerivedType32, TDerivedType33, TDerivedType34, TDerivedType35, TDerivedType36, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TDerivedType25, TResult> matchFunc25, Func<TDerivedType26, TResult> matchFunc26, Func<TDerivedType27, TResult> matchFunc27, Func<TDerivedType28, TResult> matchFunc28, Func<TDerivedType29, TResult> matchFunc29, Func<TDerivedType30, TResult> matchFunc30, Func<TDerivedType31, TResult> matchFunc31, Func<TDerivedType32, TResult> matchFunc32, Func<TDerivedType33, TResult> matchFunc33, Func<TDerivedType34, TResult> matchFunc34, Func<TDerivedType35, TResult> matchFunc35, Func<TDerivedType36, TResult> matchFunc36, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ where TDerivedType28 : TBaseType
+ where TDerivedType29 : TBaseType
+ where TDerivedType30 : TBaseType
+ where TDerivedType31 : TBaseType
+ where TDerivedType32 : TBaseType
+ where TDerivedType33 : TBaseType
+ where TDerivedType34 : TBaseType
+ where TDerivedType35 : TBaseType
+ where TDerivedType36 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ return matchFunc21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ return matchFunc22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ return matchFunc23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ return matchFunc24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ return matchFunc25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ return matchFunc26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ return matchFunc27((TDerivedType27)obj);
+ }
+ else if (obj is TDerivedType28)
+ {
+ return matchFunc28((TDerivedType28)obj);
+ }
+ else if (obj is TDerivedType29)
+ {
+ return matchFunc29((TDerivedType29)obj);
+ }
+ else if (obj is TDerivedType30)
+ {
+ return matchFunc30((TDerivedType30)obj);
+ }
+ else if (obj is TDerivedType31)
+ {
+ return matchFunc31((TDerivedType31)obj);
+ }
+ else if (obj is TDerivedType32)
+ {
+ return matchFunc32((TDerivedType32)obj);
+ }
+ else if (obj is TDerivedType33)
+ {
+ return matchFunc33((TDerivedType33)obj);
+ }
+ else if (obj is TDerivedType34)
+ {
+ return matchFunc34((TDerivedType34)obj);
+ }
+ else if (obj is TDerivedType35)
+ {
+ return matchFunc35((TDerivedType35)obj);
+ }
+ else if (obj is TDerivedType36)
+ {
+ return matchFunc36((TDerivedType36)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29, TDerivedType30, TDerivedType31, TDerivedType32, TDerivedType33, TDerivedType34, TDerivedType35, TDerivedType36, TDerivedType37, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TDerivedType25, TResult> matchFunc25, Func<TDerivedType26, TResult> matchFunc26, Func<TDerivedType27, TResult> matchFunc27, Func<TDerivedType28, TResult> matchFunc28, Func<TDerivedType29, TResult> matchFunc29, Func<TDerivedType30, TResult> matchFunc30, Func<TDerivedType31, TResult> matchFunc31, Func<TDerivedType32, TResult> matchFunc32, Func<TDerivedType33, TResult> matchFunc33, Func<TDerivedType34, TResult> matchFunc34, Func<TDerivedType35, TResult> matchFunc35, Func<TDerivedType36, TResult> matchFunc36, Func<TDerivedType37, TResult> matchFunc37, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ where TDerivedType28 : TBaseType
+ where TDerivedType29 : TBaseType
+ where TDerivedType30 : TBaseType
+ where TDerivedType31 : TBaseType
+ where TDerivedType32 : TBaseType
+ where TDerivedType33 : TBaseType
+ where TDerivedType34 : TBaseType
+ where TDerivedType35 : TBaseType
+ where TDerivedType36 : TBaseType
+ where TDerivedType37 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ return matchFunc21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ return matchFunc22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ return matchFunc23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ return matchFunc24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ return matchFunc25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ return matchFunc26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ return matchFunc27((TDerivedType27)obj);
+ }
+ else if (obj is TDerivedType28)
+ {
+ return matchFunc28((TDerivedType28)obj);
+ }
+ else if (obj is TDerivedType29)
+ {
+ return matchFunc29((TDerivedType29)obj);
+ }
+ else if (obj is TDerivedType30)
+ {
+ return matchFunc30((TDerivedType30)obj);
+ }
+ else if (obj is TDerivedType31)
+ {
+ return matchFunc31((TDerivedType31)obj);
+ }
+ else if (obj is TDerivedType32)
+ {
+ return matchFunc32((TDerivedType32)obj);
+ }
+ else if (obj is TDerivedType33)
+ {
+ return matchFunc33((TDerivedType33)obj);
+ }
+ else if (obj is TDerivedType34)
+ {
+ return matchFunc34((TDerivedType34)obj);
+ }
+ else if (obj is TDerivedType35)
+ {
+ return matchFunc35((TDerivedType35)obj);
+ }
+ else if (obj is TDerivedType36)
+ {
+ return matchFunc36((TDerivedType36)obj);
+ }
+ else if (obj is TDerivedType37)
+ {
+ return matchFunc37((TDerivedType37)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29, TDerivedType30, TDerivedType31, TDerivedType32, TDerivedType33, TDerivedType34, TDerivedType35, TDerivedType36, TDerivedType37, TDerivedType38, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TDerivedType25, TResult> matchFunc25, Func<TDerivedType26, TResult> matchFunc26, Func<TDerivedType27, TResult> matchFunc27, Func<TDerivedType28, TResult> matchFunc28, Func<TDerivedType29, TResult> matchFunc29, Func<TDerivedType30, TResult> matchFunc30, Func<TDerivedType31, TResult> matchFunc31, Func<TDerivedType32, TResult> matchFunc32, Func<TDerivedType33, TResult> matchFunc33, Func<TDerivedType34, TResult> matchFunc34, Func<TDerivedType35, TResult> matchFunc35, Func<TDerivedType36, TResult> matchFunc36, Func<TDerivedType37, TResult> matchFunc37, Func<TDerivedType38, TResult> matchFunc38, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ where TDerivedType28 : TBaseType
+ where TDerivedType29 : TBaseType
+ where TDerivedType30 : TBaseType
+ where TDerivedType31 : TBaseType
+ where TDerivedType32 : TBaseType
+ where TDerivedType33 : TBaseType
+ where TDerivedType34 : TBaseType
+ where TDerivedType35 : TBaseType
+ where TDerivedType36 : TBaseType
+ where TDerivedType37 : TBaseType
+ where TDerivedType38 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ return matchFunc21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ return matchFunc22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ return matchFunc23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ return matchFunc24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ return matchFunc25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ return matchFunc26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ return matchFunc27((TDerivedType27)obj);
+ }
+ else if (obj is TDerivedType28)
+ {
+ return matchFunc28((TDerivedType28)obj);
+ }
+ else if (obj is TDerivedType29)
+ {
+ return matchFunc29((TDerivedType29)obj);
+ }
+ else if (obj is TDerivedType30)
+ {
+ return matchFunc30((TDerivedType30)obj);
+ }
+ else if (obj is TDerivedType31)
+ {
+ return matchFunc31((TDerivedType31)obj);
+ }
+ else if (obj is TDerivedType32)
+ {
+ return matchFunc32((TDerivedType32)obj);
+ }
+ else if (obj is TDerivedType33)
+ {
+ return matchFunc33((TDerivedType33)obj);
+ }
+ else if (obj is TDerivedType34)
+ {
+ return matchFunc34((TDerivedType34)obj);
+ }
+ else if (obj is TDerivedType35)
+ {
+ return matchFunc35((TDerivedType35)obj);
+ }
+ else if (obj is TDerivedType36)
+ {
+ return matchFunc36((TDerivedType36)obj);
+ }
+ else if (obj is TDerivedType37)
+ {
+ return matchFunc37((TDerivedType37)obj);
+ }
+ else if (obj is TDerivedType38)
+ {
+ return matchFunc38((TDerivedType38)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29, TDerivedType30, TDerivedType31, TDerivedType32, TDerivedType33, TDerivedType34, TDerivedType35, TDerivedType36, TDerivedType37, TDerivedType38, TDerivedType39, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TDerivedType25, TResult> matchFunc25, Func<TDerivedType26, TResult> matchFunc26, Func<TDerivedType27, TResult> matchFunc27, Func<TDerivedType28, TResult> matchFunc28, Func<TDerivedType29, TResult> matchFunc29, Func<TDerivedType30, TResult> matchFunc30, Func<TDerivedType31, TResult> matchFunc31, Func<TDerivedType32, TResult> matchFunc32, Func<TDerivedType33, TResult> matchFunc33, Func<TDerivedType34, TResult> matchFunc34, Func<TDerivedType35, TResult> matchFunc35, Func<TDerivedType36, TResult> matchFunc36, Func<TDerivedType37, TResult> matchFunc37, Func<TDerivedType38, TResult> matchFunc38, Func<TDerivedType39, TResult> matchFunc39, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ where TDerivedType28 : TBaseType
+ where TDerivedType29 : TBaseType
+ where TDerivedType30 : TBaseType
+ where TDerivedType31 : TBaseType
+ where TDerivedType32 : TBaseType
+ where TDerivedType33 : TBaseType
+ where TDerivedType34 : TBaseType
+ where TDerivedType35 : TBaseType
+ where TDerivedType36 : TBaseType
+ where TDerivedType37 : TBaseType
+ where TDerivedType38 : TBaseType
+ where TDerivedType39 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ return matchFunc21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ return matchFunc22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ return matchFunc23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ return matchFunc24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ return matchFunc25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ return matchFunc26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ return matchFunc27((TDerivedType27)obj);
+ }
+ else if (obj is TDerivedType28)
+ {
+ return matchFunc28((TDerivedType28)obj);
+ }
+ else if (obj is TDerivedType29)
+ {
+ return matchFunc29((TDerivedType29)obj);
+ }
+ else if (obj is TDerivedType30)
+ {
+ return matchFunc30((TDerivedType30)obj);
+ }
+ else if (obj is TDerivedType31)
+ {
+ return matchFunc31((TDerivedType31)obj);
+ }
+ else if (obj is TDerivedType32)
+ {
+ return matchFunc32((TDerivedType32)obj);
+ }
+ else if (obj is TDerivedType33)
+ {
+ return matchFunc33((TDerivedType33)obj);
+ }
+ else if (obj is TDerivedType34)
+ {
+ return matchFunc34((TDerivedType34)obj);
+ }
+ else if (obj is TDerivedType35)
+ {
+ return matchFunc35((TDerivedType35)obj);
+ }
+ else if (obj is TDerivedType36)
+ {
+ return matchFunc36((TDerivedType36)obj);
+ }
+ else if (obj is TDerivedType37)
+ {
+ return matchFunc37((TDerivedType37)obj);
+ }
+ else if (obj is TDerivedType38)
+ {
+ return matchFunc38((TDerivedType38)obj);
+ }
+ else if (obj is TDerivedType39)
+ {
+ return matchFunc39((TDerivedType39)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+
+ public static TResult TypeSwitch<TBaseType, TDerivedType1, TDerivedType2, TDerivedType3, TDerivedType4, TDerivedType5, TDerivedType6, TDerivedType7, TDerivedType8, TDerivedType9, TDerivedType10, TDerivedType11, TDerivedType12, TDerivedType13, TDerivedType14, TDerivedType15, TDerivedType16, TDerivedType17, TDerivedType18, TDerivedType19, TDerivedType20, TDerivedType21, TDerivedType22, TDerivedType23, TDerivedType24, TDerivedType25, TDerivedType26, TDerivedType27, TDerivedType28, TDerivedType29, TDerivedType30, TDerivedType31, TDerivedType32, TDerivedType33, TDerivedType34, TDerivedType35, TDerivedType36, TDerivedType37, TDerivedType38, TDerivedType39, TDerivedType40, TResult>(this TBaseType obj, Func<TDerivedType1, TResult> matchFunc1, Func<TDerivedType2, TResult> matchFunc2, Func<TDerivedType3, TResult> matchFunc3, Func<TDerivedType4, TResult> matchFunc4, Func<TDerivedType5, TResult> matchFunc5, Func<TDerivedType6, TResult> matchFunc6, Func<TDerivedType7, TResult> matchFunc7, Func<TDerivedType8, TResult> matchFunc8, Func<TDerivedType9, TResult> matchFunc9, Func<TDerivedType10, TResult> matchFunc10, Func<TDerivedType11, TResult> matchFunc11, Func<TDerivedType12, TResult> matchFunc12, Func<TDerivedType13, TResult> matchFunc13, Func<TDerivedType14, TResult> matchFunc14, Func<TDerivedType15, TResult> matchFunc15, Func<TDerivedType16, TResult> matchFunc16, Func<TDerivedType17, TResult> matchFunc17, Func<TDerivedType18, TResult> matchFunc18, Func<TDerivedType19, TResult> matchFunc19, Func<TDerivedType20, TResult> matchFunc20, Func<TDerivedType21, TResult> matchFunc21, Func<TDerivedType22, TResult> matchFunc22, Func<TDerivedType23, TResult> matchFunc23, Func<TDerivedType24, TResult> matchFunc24, Func<TDerivedType25, TResult> matchFunc25, Func<TDerivedType26, TResult> matchFunc26, Func<TDerivedType27, TResult> matchFunc27, Func<TDerivedType28, TResult> matchFunc28, Func<TDerivedType29, TResult> matchFunc29, Func<TDerivedType30, TResult> matchFunc30, Func<TDerivedType31, TResult> matchFunc31, Func<TDerivedType32, TResult> matchFunc32, Func<TDerivedType33, TResult> matchFunc33, Func<TDerivedType34, TResult> matchFunc34, Func<TDerivedType35, TResult> matchFunc35, Func<TDerivedType36, TResult> matchFunc36, Func<TDerivedType37, TResult> matchFunc37, Func<TDerivedType38, TResult> matchFunc38, Func<TDerivedType39, TResult> matchFunc39, Func<TDerivedType40, TResult> matchFunc40, Func<TBaseType, TResult> defaultFunc = null)
+ where TDerivedType1 : TBaseType
+ where TDerivedType2 : TBaseType
+ where TDerivedType3 : TBaseType
+ where TDerivedType4 : TBaseType
+ where TDerivedType5 : TBaseType
+ where TDerivedType6 : TBaseType
+ where TDerivedType7 : TBaseType
+ where TDerivedType8 : TBaseType
+ where TDerivedType9 : TBaseType
+ where TDerivedType10 : TBaseType
+ where TDerivedType11 : TBaseType
+ where TDerivedType12 : TBaseType
+ where TDerivedType13 : TBaseType
+ where TDerivedType14 : TBaseType
+ where TDerivedType15 : TBaseType
+ where TDerivedType16 : TBaseType
+ where TDerivedType17 : TBaseType
+ where TDerivedType18 : TBaseType
+ where TDerivedType19 : TBaseType
+ where TDerivedType20 : TBaseType
+ where TDerivedType21 : TBaseType
+ where TDerivedType22 : TBaseType
+ where TDerivedType23 : TBaseType
+ where TDerivedType24 : TBaseType
+ where TDerivedType25 : TBaseType
+ where TDerivedType26 : TBaseType
+ where TDerivedType27 : TBaseType
+ where TDerivedType28 : TBaseType
+ where TDerivedType29 : TBaseType
+ where TDerivedType30 : TBaseType
+ where TDerivedType31 : TBaseType
+ where TDerivedType32 : TBaseType
+ where TDerivedType33 : TBaseType
+ where TDerivedType34 : TBaseType
+ where TDerivedType35 : TBaseType
+ where TDerivedType36 : TBaseType
+ where TDerivedType37 : TBaseType
+ where TDerivedType38 : TBaseType
+ where TDerivedType39 : TBaseType
+ where TDerivedType40 : TBaseType
+ {
+ if (obj is TDerivedType1)
+ {
+ return matchFunc1((TDerivedType1)obj);
+ }
+ else if (obj is TDerivedType2)
+ {
+ return matchFunc2((TDerivedType2)obj);
+ }
+ else if (obj is TDerivedType3)
+ {
+ return matchFunc3((TDerivedType3)obj);
+ }
+ else if (obj is TDerivedType4)
+ {
+ return matchFunc4((TDerivedType4)obj);
+ }
+ else if (obj is TDerivedType5)
+ {
+ return matchFunc5((TDerivedType5)obj);
+ }
+ else if (obj is TDerivedType6)
+ {
+ return matchFunc6((TDerivedType6)obj);
+ }
+ else if (obj is TDerivedType7)
+ {
+ return matchFunc7((TDerivedType7)obj);
+ }
+ else if (obj is TDerivedType8)
+ {
+ return matchFunc8((TDerivedType8)obj);
+ }
+ else if (obj is TDerivedType9)
+ {
+ return matchFunc9((TDerivedType9)obj);
+ }
+ else if (obj is TDerivedType10)
+ {
+ return matchFunc10((TDerivedType10)obj);
+ }
+ else if (obj is TDerivedType11)
+ {
+ return matchFunc11((TDerivedType11)obj);
+ }
+ else if (obj is TDerivedType12)
+ {
+ return matchFunc12((TDerivedType12)obj);
+ }
+ else if (obj is TDerivedType13)
+ {
+ return matchFunc13((TDerivedType13)obj);
+ }
+ else if (obj is TDerivedType14)
+ {
+ return matchFunc14((TDerivedType14)obj);
+ }
+ else if (obj is TDerivedType15)
+ {
+ return matchFunc15((TDerivedType15)obj);
+ }
+ else if (obj is TDerivedType16)
+ {
+ return matchFunc16((TDerivedType16)obj);
+ }
+ else if (obj is TDerivedType17)
+ {
+ return matchFunc17((TDerivedType17)obj);
+ }
+ else if (obj is TDerivedType18)
+ {
+ return matchFunc18((TDerivedType18)obj);
+ }
+ else if (obj is TDerivedType19)
+ {
+ return matchFunc19((TDerivedType19)obj);
+ }
+ else if (obj is TDerivedType20)
+ {
+ return matchFunc20((TDerivedType20)obj);
+ }
+ else if (obj is TDerivedType21)
+ {
+ return matchFunc21((TDerivedType21)obj);
+ }
+ else if (obj is TDerivedType22)
+ {
+ return matchFunc22((TDerivedType22)obj);
+ }
+ else if (obj is TDerivedType23)
+ {
+ return matchFunc23((TDerivedType23)obj);
+ }
+ else if (obj is TDerivedType24)
+ {
+ return matchFunc24((TDerivedType24)obj);
+ }
+ else if (obj is TDerivedType25)
+ {
+ return matchFunc25((TDerivedType25)obj);
+ }
+ else if (obj is TDerivedType26)
+ {
+ return matchFunc26((TDerivedType26)obj);
+ }
+ else if (obj is TDerivedType27)
+ {
+ return matchFunc27((TDerivedType27)obj);
+ }
+ else if (obj is TDerivedType28)
+ {
+ return matchFunc28((TDerivedType28)obj);
+ }
+ else if (obj is TDerivedType29)
+ {
+ return matchFunc29((TDerivedType29)obj);
+ }
+ else if (obj is TDerivedType30)
+ {
+ return matchFunc30((TDerivedType30)obj);
+ }
+ else if (obj is TDerivedType31)
+ {
+ return matchFunc31((TDerivedType31)obj);
+ }
+ else if (obj is TDerivedType32)
+ {
+ return matchFunc32((TDerivedType32)obj);
+ }
+ else if (obj is TDerivedType33)
+ {
+ return matchFunc33((TDerivedType33)obj);
+ }
+ else if (obj is TDerivedType34)
+ {
+ return matchFunc34((TDerivedType34)obj);
+ }
+ else if (obj is TDerivedType35)
+ {
+ return matchFunc35((TDerivedType35)obj);
+ }
+ else if (obj is TDerivedType36)
+ {
+ return matchFunc36((TDerivedType36)obj);
+ }
+ else if (obj is TDerivedType37)
+ {
+ return matchFunc37((TDerivedType37)obj);
+ }
+ else if (obj is TDerivedType38)
+ {
+ return matchFunc38((TDerivedType38)obj);
+ }
+ else if (obj is TDerivedType39)
+ {
+ return matchFunc39((TDerivedType39)obj);
+ }
+ else if (obj is TDerivedType40)
+ {
+ return matchFunc40((TDerivedType40)obj);
+ }
+ else if (defaultFunc != null)
+ {
+ return defaultFunc(obj);
+ }
+ else
+ {
+ return default(TResult);
+ }
+ }
+ #endregion
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/PredefinedOperator.cs b/main/src/addins/CSharpBinding/Util/PredefinedOperator.cs
new file mode 100644
index 0000000000..794f8f25c4
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/PredefinedOperator.cs
@@ -0,0 +1,32 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ enum PredefinedOperator
+ {
+ None = 0,
+ Addition = 1,
+ BitwiseAnd = 1 << 1,
+ BitwiseOr = 1 << 2,
+ Complement = 1 << 3, // ~ or ! in C#, 'Not' in VB.
+ Concatenate = 1 << 4,
+ Decrement = 1 << 5,
+ Division = 1 << 6,
+ Equality = 1 << 7,
+ ExclusiveOr = 1 << 8,
+ Exponent = 1 << 9,
+ GreaterThan = 1 << 10,
+ GreaterThanOrEqual = 1 << 11,
+ Increment = 1 << 12,
+ Inequality = 1 << 13,
+ IntegerDivision = 1 << 14,
+ LeftShift = 1 << 15,
+ LessThan = 1 << 16,
+ LessThanOrEqual = 1 << 17,
+ Like = 1 << 18,
+ Modulus = 1 << 19,
+ Multiplication = 1 << 20,
+ RightShift = 1 << 21,
+ Subtraction = 1 << 22,
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/QueryExpressionSyntaxExtensions.cs b/main/src/addins/CSharpBinding/Util/QueryExpressionSyntaxExtensions.cs
new file mode 100644
index 0000000000..ade55d10ae
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/QueryExpressionSyntaxExtensions.cs
@@ -0,0 +1,49 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class QueryExpressionSyntaxExtensions
+ {
+ public static IList<SyntaxNode> GetAllClauses(this QueryExpressionSyntax query)
+ {
+ var result = new List<SyntaxNode>();
+ result.Add(query.FromClause);
+ result.AddRange(query.Body.Clauses);
+ result.Add(query.Body.SelectOrGroup);
+ return result;
+ }
+
+ public static IList<SyntaxNode> GetAllClauses(this QueryBodySyntax body)
+ {
+ var result = new List<SyntaxNode>();
+ result.AddRange(body.Clauses);
+ result.Add(body.SelectOrGroup);
+ return result;
+ }
+
+ public static QueryExpressionSyntax WithAllClauses(
+ this QueryExpressionSyntax query,
+ IList<SyntaxNode> allClauses)
+ {
+ var fromClause = (FromClauseSyntax)allClauses.First();
+ return query.WithFromClause(fromClause).WithBody(query.Body.WithAllClauses(allClauses.Skip(1)));
+ }
+
+ public static QueryBodySyntax WithAllClauses(
+ this QueryBodySyntax body,
+ IEnumerable<SyntaxNode> allClauses)
+ {
+ var clauses = SyntaxFactory.List(allClauses.Take(allClauses.Count() - 1).Cast<QueryClauseSyntax>());
+ var selectOrGroup = (SelectOrGroupClauseSyntax)allClauses.Last();
+ return body.WithClauses(clauses).WithSelectOrGroup(selectOrGroup);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/RefactoringHelpers.cs b/main/src/addins/CSharpBinding/Util/RefactoringHelpers.cs
new file mode 100644
index 0000000000..561f73c241
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/RefactoringHelpers.cs
@@ -0,0 +1,140 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using MonoDevelop.CSharp.Completion;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ class RefactoringHelpers
+ {
+ public static TypeSyntax ConvertType(SemanticModel model, int position, ITypeSymbol type)
+ {
+ return SyntaxFactory.ParseTypeName(RoslynCompletionData.SafeMinimalDisplayString (type, model, position));
+ }
+
+ static string GetNameProposal(string eventName)
+ {
+ return "On" + char.ToUpper(eventName[0]) + eventName.Substring(1);
+ }
+
+ static string CreateBaseNameFromString(string str)
+ {
+ if (string.IsNullOrEmpty(str)) {
+ return "empty";
+ }
+ var sb = new StringBuilder();
+ bool firstLetter = true, wordStart = false;
+ foreach (char ch in str) {
+ if (char.IsWhiteSpace(ch)) {
+ wordStart = true;
+ continue;
+ }
+ if (!char.IsLetter(ch))
+ continue;
+ if (firstLetter) {
+ sb.Append(char.ToLower(ch));
+ firstLetter = false;
+ continue;
+ }
+ if (wordStart) {
+ sb.Append(char.ToUpper(ch));
+ wordStart = false;
+ continue;
+ }
+ sb.Append(ch);
+ }
+ return sb.Length == 0 ? "str" : sb.ToString();
+ }
+
+ public static string CreateBaseName(SyntaxNode node, ITypeSymbol type)
+ {
+ string name = null;
+
+ if (node.IsKind(SyntaxKind.Argument))
+ node = ((ArgumentSyntax)node).Expression;
+
+ if (node.IsKind(SyntaxKind.NullLiteralExpression))
+ return "o";
+ if (node.IsKind(SyntaxKind.InvocationExpression))
+ return CreateBaseName(((InvocationExpressionSyntax)node).Expression, type);
+ if (node.IsKind(SyntaxKind.IdentifierName)) {
+ name = node.ToString();
+ } else if (node is MemberAccessExpressionSyntax) {
+ name = ((MemberAccessExpressionSyntax)node).Name.ToString();
+ } else if (node is LiteralExpressionSyntax) {
+ var pe = (LiteralExpressionSyntax)node;
+ if (pe.IsKind(SyntaxKind.StringLiteralExpression)) {
+ name = CreateBaseNameFromString(pe.Token.ToString());
+ } else {
+ return char.ToLower(type.Name[0]).ToString();
+ }
+ } else if (node is ArrayCreationExpressionSyntax) {
+ name = "arr";
+ } else {
+ if (type.TypeKind == TypeKind.Error)
+ return "par";
+ name = GuessNameFromType(type);
+ }
+ var sb = new StringBuilder();
+ sb.Append(char.ToLower(name[0]));
+ for (int i = 1; i < name.Length; i++) {
+ var ch = name[i];
+ if (char.IsLetterOrDigit(ch) || ch == '_')
+ sb.Append(ch);
+ }
+ return sb.ToString();
+ }
+
+ internal static string GuessNameFromType(ITypeSymbol returnType)
+ {
+ switch (returnType.SpecialType) {
+ case SpecialType.System_Object:
+ return "obj";
+ case SpecialType.System_Boolean:
+ return "b";
+ case SpecialType.System_Char:
+ return "ch";
+ case SpecialType.System_SByte:
+ case SpecialType.System_Byte:
+ return "b";
+ case SpecialType.System_Int16:
+ case SpecialType.System_UInt16:
+ case SpecialType.System_Int32:
+ case SpecialType.System_UInt32:
+ case SpecialType.System_Int64:
+ case SpecialType.System_UInt64:
+ return "i";
+ case SpecialType.System_Decimal:
+ return "d";
+ case SpecialType.System_Single:
+ return "f";
+ case SpecialType.System_Double:
+ return "d";
+ case SpecialType.System_String:
+ return "str";
+ case SpecialType.System_IntPtr:
+ case SpecialType.System_UIntPtr:
+ return "ptr";
+ case SpecialType.System_DateTime:
+ return "date";
+ }
+ if (returnType.TypeKind == TypeKind.Array)
+ return "arr";
+ switch (returnType.GetFullName()) {
+ case "System.Exception":
+ return "e";
+ case "System.Object":
+ case "System.Func":
+ case "System.Action":
+ return "action";
+ }
+ return string.IsNullOrEmpty(returnType.Name) ? "obj" : returnType.Name;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/ReferenceComparer.cs b/main/src/addins/CSharpBinding/Util/ReferenceComparer.cs
new file mode 100644
index 0000000000..56e2352f66
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/ReferenceComparer.cs
@@ -0,0 +1,39 @@
+// Copyright (c) 2010-2013 AlphaSierraPapa for the SharpDevelop Team
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy of this
+// software and associated documentation files (the "Software"), to deal in the Software
+// without restriction, including without limitation the rights to use, copy, modify, merge,
+// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+// to whom the Software is furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all copies or
+// substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.CompilerServices;
+
+namespace ICSharpCode.NRefactory6.Utils
+{
+ sealed class ReferenceComparer : IEqualityComparer<object>
+ {
+ public readonly static ReferenceComparer Instance = new ReferenceComparer();
+
+ public new bool Equals(object x, object y)
+ {
+ return x == y;
+ }
+
+ public int GetHashCode(object obj)
+ {
+ return RuntimeHelpers.GetHashCode(obj);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/ReflectionCompatibilityExtensions.cs b/main/src/addins/CSharpBinding/Util/ReflectionCompatibilityExtensions.cs
new file mode 100644
index 0000000000..c9de6159e5
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/ReflectionCompatibilityExtensions.cs
@@ -0,0 +1,127 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ [Flags]
+ internal enum BindingFlags
+ {
+ Default = 0,
+ Instance = 1,
+ Static = 2,
+ Public = 4,
+ NonPublic = 8,
+ }
+
+ internal static class ReflectionCompatibilityExtensions
+ {
+ public static object[] GetCustomAttributes(this Type type, bool inherit)
+ {
+ return type.GetTypeInfo().GetCustomAttributes(inherit).ToArray();
+ }
+
+ public static MethodInfo GetMethod(this Type type, string name)
+ {
+ return type.GetTypeInfo().DeclaredMethods.FirstOrDefault(m => m.Name == name);
+ }
+
+ public static MethodInfo GetMethod(this Type type, string name, BindingFlags bindingFlags)
+ {
+ return type.GetTypeInfo().DeclaredMethods.FirstOrDefault(m => (m.Name == name) && IsConformWithBindingFlags(m, bindingFlags));
+ }
+
+ public static MethodInfo GetMethod(this Type type, string name, Type[] types)
+ {
+ return type.GetTypeInfo().DeclaredMethods.FirstOrDefault(
+ m => (m.Name == name) && TypesAreEqual(m.GetParameters().Select(p => p.ParameterType).ToArray(), types));
+ }
+
+ public static MethodInfo GetMethod(this Type type, string name, BindingFlags bindingFlags, object binder, Type[] types, object modifiers)
+ {
+ return type.GetTypeInfo().DeclaredMethods.FirstOrDefault(
+ m => (m.Name == name) && IsConformWithBindingFlags(m, bindingFlags) && TypesAreEqual(m.GetParameters().Select(p => p.ParameterType).ToArray(), types));
+ }
+
+ public static IEnumerable<MethodInfo> GetMethods(this Type type)
+ {
+ return type.GetTypeInfo().DeclaredMethods;
+ }
+
+ public static IEnumerable<MethodInfo> GetMethods(this Type type, string name)
+ {
+ return type.GetTypeInfo().DeclaredMethods.Where(m => m.Name == name);
+ }
+
+ public static IEnumerable<MethodInfo> GetMethods(this Type type, BindingFlags bindingFlags)
+ {
+ return type.GetTypeInfo().DeclaredMethods.Where(m => IsConformWithBindingFlags(m, bindingFlags));
+ }
+
+ public static FieldInfo GetField(this Type type, string name)
+ {
+ return type.GetTypeInfo().DeclaredFields.FirstOrDefault(f => f.Name == name);
+ }
+
+ public static FieldInfo GetField(this Type type, string name, BindingFlags bindingFlags)
+ {
+ return type.GetTypeInfo().DeclaredFields.FirstOrDefault(f => (f.Name == name) && IsConformWithBindingFlags(f, bindingFlags));
+ }
+
+ public static PropertyInfo GetProperty(this Type type, string name)
+ {
+ return type.GetTypeInfo().DeclaredProperties.FirstOrDefault(p => p.Name == name);
+ }
+
+ public static IEnumerable<PropertyInfo> GetProperties(this Type type)
+ {
+ return type.GetTypeInfo().DeclaredProperties;
+ }
+
+ private static bool TypesAreEqual(Type[] memberTypes, Type[] searchedTypes)
+ {
+ if (((memberTypes == null) || (searchedTypes == null)) && (memberTypes != searchedTypes))
+ return false;
+
+ if (memberTypes.Length != searchedTypes.Length)
+ return false;
+
+ for (int i = 0; i < memberTypes.Length; i++)
+ {
+ if (memberTypes[i] != searchedTypes[i])
+ return false;
+ }
+
+ return true;
+ }
+
+ private static bool IsConformWithBindingFlags(MethodBase method, BindingFlags bindingFlags)
+ {
+ if (method.IsPublic && !bindingFlags.HasFlag(BindingFlags.Public))
+ return false;
+ if (method.IsPrivate && !bindingFlags.HasFlag(BindingFlags.NonPublic))
+ return false;
+ if (method.IsStatic && !bindingFlags.HasFlag(BindingFlags.Static))
+ return false;
+ if (!method.IsStatic && !bindingFlags.HasFlag(BindingFlags.Instance))
+ return false;
+
+ return true;
+ }
+
+ private static bool IsConformWithBindingFlags(FieldInfo method, BindingFlags bindingFlags)
+ {
+ if (method.IsPublic && !bindingFlags.HasFlag(BindingFlags.Public))
+ return false;
+ if (method.IsPrivate && !bindingFlags.HasFlag(BindingFlags.NonPublic))
+ return false;
+ if (method.IsStatic && !bindingFlags.HasFlag(BindingFlags.Static))
+ return false;
+ if (!method.IsStatic && !bindingFlags.HasFlag(BindingFlags.Instance))
+ return false;
+
+ return true;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/SemanticDocument.cs b/main/src/addins/CSharpBinding/Util/SemanticDocument.cs
new file mode 100644
index 0000000000..b4d251aa51
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SemanticDocument.cs
@@ -0,0 +1,30 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ class SemanticDocument : SyntacticDocument
+ {
+ public readonly SemanticModel SemanticModel;
+
+ private SemanticDocument(Document document, SourceText text, SyntaxTree tree, SyntaxNode root, SemanticModel semanticModel)
+ : base(document, text, tree, root)
+ {
+ this.SemanticModel = semanticModel;
+ }
+
+ public static new async Task<SemanticDocument> CreateAsync(Document document, CancellationToken cancellationToken)
+ {
+ var text = await document.GetTextAsync(cancellationToken).ConfigureAwait(false);
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ var model = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ return new SemanticDocument(document, text, root.SyntaxTree, root, model);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/SemanticEquivalence.cs b/main/src/addins/CSharpBinding/Util/SemanticEquivalence.cs
new file mode 100644
index 0000000000..82da9dc7bb
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SemanticEquivalence.cs
@@ -0,0 +1,69 @@
+//
+// SemanticEquivalence.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Reflection;
+using Microsoft.CodeAnalysis;
+using System.Runtime.ExceptionServices;
+using System.ComponentModel.Design;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class SemanticEquivalence
+ {
+ readonly static Type typeInfo;
+
+ static SemanticEquivalence ()
+ {
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.Shared.Extensions.SemanticEquivalence" + ReflectionNamespaces.WorkspacesAsmName, true);
+ areSemanticallyEquivalentMethod = typeInfo.GetMethod ("AreSemanticallyEquivalent", BindingFlags.Static | BindingFlags.Public);
+ }
+
+ static readonly MethodInfo areSemanticallyEquivalentMethod;
+
+ public static bool AreSemanticallyEquivalent(
+ SemanticModel semanticModel1,
+ SemanticModel semanticModel2,
+ SyntaxNode node1,
+ SyntaxNode node2,
+ Func<SyntaxNode, bool> predicate = null)
+ {
+ try {
+ return (bool)areSemanticallyEquivalentMethod.Invoke (null, new object[] {
+ semanticModel1,
+ semanticModel2,
+ node1,
+ node2,
+ predicate
+ });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/SemanticMap.cs b/main/src/addins/CSharpBinding/Util/SemanticMap.cs
new file mode 100644
index 0000000000..ee69eb9fe6
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SemanticMap.cs
@@ -0,0 +1,81 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ partial class SemanticMap
+ {
+ private readonly Dictionary<SyntaxNode, SymbolInfo> _expressionToInfoMap =
+ new Dictionary<SyntaxNode, SymbolInfo>();
+
+ private readonly Dictionary<SyntaxToken, SymbolInfo> _tokenToInfoMap =
+ new Dictionary<SyntaxToken, SymbolInfo>();
+
+ private SemanticMap()
+ {
+ }
+
+ internal static SemanticMap From(SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ var map = new SemanticMap();
+ var walker = new Walker(semanticModel, map, cancellationToken);
+ walker.Visit(node);
+ return map;
+ }
+
+ public IEnumerable<ISymbol> AllReferencedSymbols
+ {
+ get
+ {
+ return _expressionToInfoMap.Values.Concat(_tokenToInfoMap.Values).Select(info => info.Symbol).Distinct();
+ }
+ }
+
+ private class Walker : SyntaxWalker
+ {
+ private readonly SemanticModel _semanticModel;
+ private readonly SemanticMap _map;
+ private readonly CancellationToken _cancellationToken;
+
+ public Walker(SemanticModel semanticModel, SemanticMap map, CancellationToken cancellationToken) :
+ base(SyntaxWalkerDepth.Token)
+ {
+ _semanticModel = semanticModel;
+ _map = map;
+ _cancellationToken = cancellationToken;
+ }
+
+ public override void Visit(SyntaxNode node)
+ {
+ var info = _semanticModel.GetSymbolInfo(node);
+ if (!IsNone(info))
+ {
+ _map._expressionToInfoMap.Add(node, info);
+ }
+
+ base.Visit(node);
+ }
+
+ protected override void VisitToken(SyntaxToken token)
+ {
+ var info = _semanticModel.GetSymbolInfo(token, _cancellationToken);
+ if (!IsNone(info))
+ {
+ _map._tokenToInfoMap.Add(token, info);
+ }
+
+ base.VisitToken(token);
+ }
+
+ private bool IsNone(SymbolInfo info)
+ {
+ return info.Symbol == null && info.CandidateSymbols.Length == 0;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/SemanticModelExtensions.cs b/main/src/addins/CSharpBinding/Util/SemanticModelExtensions.cs
new file mode 100644
index 0000000000..02c950ce07
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SemanticModelExtensions.cs
@@ -0,0 +1,622 @@
+//
+// SemanticModelExtensions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.Collections.Immutable;
+using Microsoft.CodeAnalysis.CSharp;
+using System.Linq;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class SemanticModelExtensions
+ {
+ public static IEnumerable<ITypeSymbol> LookupTypeRegardlessOfArity(
+ this SemanticModel semanticModel,
+ SyntaxToken name,
+ CancellationToken cancellationToken)
+ {
+ var expression = name.Parent as ExpressionSyntax;
+ if (expression != null)
+ {
+ var results = semanticModel.LookupName(expression, namespacesAndTypesOnly: true, cancellationToken: cancellationToken);
+ if (results.Length > 0)
+ {
+ return results.OfType<ITypeSymbol>();
+ }
+ }
+
+ return SpecializedCollections.EmptyEnumerable<ITypeSymbol>();
+ }
+
+ public static ImmutableArray<ISymbol> LookupName(
+ this SemanticModel semanticModel,
+ SyntaxToken name,
+ bool namespacesAndTypesOnly,
+ CancellationToken cancellationToken)
+ {
+ var expression = name.Parent as ExpressionSyntax;
+ if (expression != null)
+ {
+ return semanticModel.LookupName(expression, namespacesAndTypesOnly, cancellationToken);
+ }
+
+ return ImmutableArray.Create<ISymbol>();
+ }
+
+ /// <summary>
+ /// Decomposes a name or member access expression into its component parts.
+ /// </summary>
+ /// <param name="expression">The name or member access expression.</param>
+ /// <param name="qualifier">The qualifier (or left-hand-side) of the name expression. This may be null if there is no qualifier.</param>
+ /// <param name="name">The name of the expression.</param>
+ /// <param name="arity">The number of generic type parameters.</param>
+ private static void DecomposeName(ExpressionSyntax expression, out ExpressionSyntax qualifier, out string name, out int arity)
+ {
+ switch (expression.Kind())
+ {
+ case SyntaxKind.SimpleMemberAccessExpression:
+ case SyntaxKind.PointerMemberAccessExpression:
+ var max = (MemberAccessExpressionSyntax)expression;
+ qualifier = max.Expression;
+ name = max.Name.Identifier.ValueText;
+ arity = max.Name.Arity;
+ break;
+ case SyntaxKind.QualifiedName:
+ var qn = (QualifiedNameSyntax)expression;
+ qualifier = qn.Left;
+ name = qn.Right.Identifier.ValueText;
+ arity = qn.Arity;
+ break;
+ case SyntaxKind.AliasQualifiedName:
+ var aq = (AliasQualifiedNameSyntax)expression;
+ qualifier = aq.Alias;
+ name = aq.Name.Identifier.ValueText;
+ arity = aq.Name.Arity;
+ break;
+ case SyntaxKind.GenericName:
+ var gx = (GenericNameSyntax)expression;
+ qualifier = null;
+ name = gx.Identifier.ValueText;
+ arity = gx.Arity;
+ break;
+ case SyntaxKind.IdentifierName:
+ var nx = (IdentifierNameSyntax)expression;
+ qualifier = null;
+ name = nx.Identifier.ValueText;
+ arity = 0;
+ break;
+ default:
+ qualifier = null;
+ name = null;
+ arity = 0;
+ break;
+ }
+ }
+
+ public static ImmutableArray<ISymbol> LookupName(
+ this SemanticModel semanticModel,
+ ExpressionSyntax expression,
+ bool namespacesAndTypesOnly,
+ CancellationToken cancellationToken)
+ {
+ var expr = SyntaxFactory.GetStandaloneExpression(expression);
+
+ ExpressionSyntax qualifier;
+ string name;
+ int arity;
+ DecomposeName(expr, out qualifier, out name, out arity);
+
+ INamespaceOrTypeSymbol symbol = null;
+ if (qualifier != null)
+ {
+ var typeInfo = semanticModel.GetTypeInfo(qualifier, cancellationToken);
+ var symbolInfo = semanticModel.GetSymbolInfo(qualifier, cancellationToken);
+ if (typeInfo.Type != null)
+ {
+ symbol = typeInfo.Type;
+ }
+ else if (symbolInfo.Symbol != null)
+ {
+ symbol = symbolInfo.Symbol as INamespaceOrTypeSymbol;
+ }
+ }
+
+ return semanticModel.LookupSymbols(expr.SpanStart, container: symbol, name: name, includeReducedExtensionMethods: true);
+ }
+
+ public static SymbolInfo GetSymbolInfo(this SemanticModel semanticModel, SyntaxToken token)
+ {
+ if (!CanBindToken(token))
+ {
+ return default(SymbolInfo);
+ }
+
+ var expression = token.Parent as ExpressionSyntax;
+ if (expression != null)
+ {
+ return semanticModel.GetSymbolInfo(expression);
+ }
+
+ var attribute = token.Parent as AttributeSyntax;
+ if (attribute != null)
+ {
+ return semanticModel.GetSymbolInfo(attribute);
+ }
+
+ var constructorInitializer = token.Parent as ConstructorInitializerSyntax;
+ if (constructorInitializer != null)
+ {
+ return semanticModel.GetSymbolInfo(constructorInitializer);
+ }
+
+ return default(SymbolInfo);
+ }
+
+ private static bool CanBindToken(SyntaxToken token)
+ {
+ // Add more token kinds if necessary;
+ switch (token.Kind())
+ {
+ case SyntaxKind.CommaToken:
+ case SyntaxKind.DelegateKeyword:
+ return false;
+ }
+
+ return true;
+ }
+
+ /// <summary>
+ /// Given an argument node, tries to generate an appropriate name that can be used for that
+ /// argument.
+ /// </summary>
+ public static string GenerateNameForArgument(
+ this SemanticModel semanticModel, ArgumentSyntax argument)
+ {
+ // If it named argument then we use the name provided.
+ if (argument.NameColon != null)
+ {
+ return argument.NameColon.Name.Identifier.ValueText;
+ }
+
+ return semanticModel.GenerateNameForExpression(argument.Expression);
+ }
+
+ public static string GenerateNameForArgument(
+ this SemanticModel semanticModel, AttributeArgumentSyntax argument)
+ {
+ // If it named argument then we use the name provided.
+ if (argument.NameEquals != null)
+ {
+ return argument.NameEquals.Name.Identifier.ValueText;
+ }
+
+ return semanticModel.GenerateNameForExpression(argument.Expression);
+ }
+
+ /// <summary>
+ /// Given an expression node, tries to generate an appropriate name that can be used for
+ /// that expression.
+ /// </summary>
+ public static string GenerateNameForExpression(
+ this SemanticModel semanticModel, ExpressionSyntax expression, bool capitalize = false)
+ {
+ // Try to find a usable name node that we can use to name the
+ // parameter. If we have an expression that has a name as part of it
+ // then we try to use that part.
+ var current = expression;
+ while (true)
+ {
+ current = current.WalkDownParentheses();
+
+ if (current.Kind() == SyntaxKind.IdentifierName)
+ {
+ return ((IdentifierNameSyntax)current).Identifier.ValueText.ToCamelCase();
+ }
+ else if (current is MemberAccessExpressionSyntax)
+ {
+ return ((MemberAccessExpressionSyntax)current).Name.Identifier.ValueText.ToCamelCase();
+ }
+ else if (current is MemberBindingExpressionSyntax)
+ {
+ return ((MemberBindingExpressionSyntax)current).Name.Identifier.ValueText.ToCamelCase();
+ }
+ else if (current is ConditionalAccessExpressionSyntax)
+ {
+ current = ((ConditionalAccessExpressionSyntax)current).WhenNotNull;
+ }
+ else if (current is CastExpressionSyntax)
+ {
+ current = ((CastExpressionSyntax)current).Expression;
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ // Otherwise, figure out the type of the expression and generate a name from that
+ // isntead.
+ var info = semanticModel.GetTypeInfo(expression);
+
+ // If we can't determine the type, then fallback to some placeholders.
+ var type = info.Type;
+ return type.CreateParameterName(capitalize);
+ }
+
+ public static IList<string> GenerateParameterNames(
+ this SemanticModel semanticModel,
+ ArgumentListSyntax argumentList)
+ {
+ return semanticModel.GenerateParameterNames(argumentList.Arguments);
+ }
+
+ public static IList<string> GenerateParameterNames(
+ this SemanticModel semanticModel,
+ AttributeArgumentListSyntax argumentList)
+ {
+ return semanticModel.GenerateParameterNames(argumentList.Arguments);
+ }
+
+ public static IList<string> GenerateParameterNames(
+ this SemanticModel semanticModel,
+ IEnumerable<ArgumentSyntax> arguments,
+ IList<string> reservedNames = null)
+ {
+ reservedNames = reservedNames ?? SpecializedCollections.EmptyList<string>();
+
+ // We can't change the names of named parameters. Any other names we're flexible on.
+ var isFixed = reservedNames.Select(s => true).Concat(
+ arguments.Select(a => a.NameColon != null)).ToList();
+
+ var parameterNames = reservedNames.Concat(
+ arguments.Select(a => semanticModel.GenerateNameForArgument(a))).ToList();
+
+ return NameGenerator.EnsureUniqueness(parameterNames, isFixed).Skip(reservedNames.Count).ToList();
+ }
+
+ public static IList<string> GenerateParameterNames(
+ this SemanticModel semanticModel,
+ IEnumerable<AttributeArgumentSyntax> arguments,
+ IList<string> reservedNames = null)
+ {
+ reservedNames = reservedNames ?? SpecializedCollections.EmptyList<string>();
+
+ // We can't change the names of named parameters. Any other names we're flexible on.
+ var isFixed = reservedNames.Select(s => true).Concat(
+ arguments.Select(a => a.NameEquals != null)).ToList();
+
+ var parameterNames = reservedNames.Concat(
+ arguments.Select(a => semanticModel.GenerateNameForArgument(a))).ToList();
+
+ return NameGenerator.EnsureUniqueness(parameterNames, isFixed).Skip(reservedNames.Count).ToList();
+ }
+
+ public static ISet<INamespaceSymbol> GetUsingNamespacesInScope(this SemanticModel semanticModel, SyntaxNode location)
+ {
+ // Avoiding linq here for perf reasons. This is used heavily in the AddImport service
+ HashSet<INamespaceSymbol> result = null;
+
+ foreach (var @using in location.GetEnclosingUsingDirectives())
+ {
+ if (@using.Alias == null)
+ {
+ var symbolInfo = semanticModel.GetSymbolInfo(@using.Name);
+ if (symbolInfo.Symbol != null && symbolInfo.Symbol.Kind == SymbolKind.Namespace)
+ {
+ result = result ?? new HashSet<INamespaceSymbol>();
+ result.Add((INamespaceSymbol)symbolInfo.Symbol);
+ }
+ }
+ }
+
+ return result ?? SpecializedCollections.EmptySet<INamespaceSymbol>();
+ }
+
+ public static Accessibility DetermineAccessibilityConstraint(
+ this SemanticModel semanticModel,
+ TypeSyntax type,
+ CancellationToken cancellationToken)
+ {
+ if (type == null)
+ {
+ return Accessibility.Private;
+ }
+
+ type = GetOutermostType(type);
+
+ // Interesting cases based on 3.5.4 Accessibility constraints in the language spec.
+ // If any of the below hold, then we will override the default accessibility if the
+ // constraint wants the type to be more accessible. i.e. if by default we generate
+ // 'internal', but a constraint makes us 'public', then be public.
+
+ // 1) The direct base class of a class type must be at least as accessible as the
+ // class type itself.
+ //
+ // 2) The explicit base interfaces of an interface type must be at least as accessible
+ // as the interface type itself.
+ if (type != null)
+ {
+ if (type.Parent is BaseTypeSyntax && type.Parent.IsParentKind(SyntaxKind.BaseList) && ((BaseTypeSyntax)type.Parent).Type == type)
+ {
+ var containingType = semanticModel.GetDeclaredSymbol(type.GetAncestor<BaseTypeDeclarationSyntax>(), cancellationToken) as INamedTypeSymbol;
+ if (containingType != null && containingType.TypeKind == TypeKind.Interface)
+ {
+ return containingType.DeclaredAccessibility;
+ }
+ else if (((BaseListSyntax)type.Parent.Parent).Types[0] == type.Parent)
+ {
+ return containingType.DeclaredAccessibility;
+ }
+ }
+ }
+
+ // 4) The type of a constant must be at least as accessible as the constant itself.
+ // 5) The type of a field must be at least as accessible as the field itself.
+ if (type.IsParentKind(SyntaxKind.VariableDeclaration) &&
+ type.Parent.IsParentKind(SyntaxKind.FieldDeclaration))
+ {
+ var variableDeclaration = (VariableDeclarationSyntax)type.Parent;
+ return ((ISymbol)semanticModel.GetDeclaredSymbol(
+ variableDeclaration.Variables[0], cancellationToken)).DeclaredAccessibility;
+ }
+
+ // 3) The return type of a delegate type must be at least as accessible as the
+ // delegate type itself.
+ // 6) The return type of a method must be at least as accessible as the method
+ // itself.
+ // 7) The type of a property must be at least as accessible as the property itself.
+ // 8) The type of an event must be at least as accessible as the event itself.
+ // 9) The type of an indexer must be at least as accessible as the indexer itself.
+ // 10) The return type of an operator must be at least as accessible as the operator
+ // itself.
+ if (type.IsParentKind(SyntaxKind.DelegateDeclaration) ||
+ type.IsParentKind(SyntaxKind.MethodDeclaration) ||
+ type.IsParentKind(SyntaxKind.PropertyDeclaration) ||
+ type.IsParentKind(SyntaxKind.EventDeclaration) ||
+ type.IsParentKind(SyntaxKind.IndexerDeclaration) ||
+ type.IsParentKind(SyntaxKind.OperatorDeclaration))
+ {
+ return semanticModel.GetDeclaredSymbol(
+ type.Parent, cancellationToken).DeclaredAccessibility;
+ }
+
+ // 3) The parameter types of a delegate type must be at least as accessible as the
+ // delegate type itself.
+ // 6) The parameter types of a method must be at least as accessible as the method
+ // itself.
+ // 9) The parameter types of an indexer must be at least as accessible as the
+ // indexer itself.
+ // 10) The parameter types of an operator must be at least as accessible as the
+ // operator itself.
+ // 11) The parameter types of an instance constructor must be at least as accessible
+ // as the instance constructor itself.
+ if (type.IsParentKind(SyntaxKind.Parameter) && type.Parent.IsParentKind(SyntaxKind.ParameterList))
+ {
+ if (type.Parent.Parent.IsParentKind(SyntaxKind.DelegateDeclaration) ||
+ type.Parent.Parent.IsParentKind(SyntaxKind.MethodDeclaration) ||
+ type.Parent.Parent.IsParentKind(SyntaxKind.IndexerDeclaration) ||
+ type.Parent.Parent.IsParentKind(SyntaxKind.OperatorDeclaration))
+ {
+ return semanticModel.GetDeclaredSymbol(
+ type.Parent.Parent.Parent, cancellationToken).DeclaredAccessibility;
+ }
+
+ if (type.Parent.Parent.IsParentKind(SyntaxKind.ConstructorDeclaration))
+ {
+ var symbol = semanticModel.GetDeclaredSymbol(type.Parent.Parent.Parent, cancellationToken);
+ if (!symbol.IsStatic)
+ {
+ return symbol.DeclaredAccessibility;
+ }
+ }
+ }
+
+ // 8) The type of an event must be at least as accessible as the event itself.
+ if (type.IsParentKind(SyntaxKind.VariableDeclaration) &&
+ type.Parent.IsParentKind(SyntaxKind.EventFieldDeclaration))
+ {
+ var variableDeclaration = (VariableDeclarationSyntax)type.Parent;
+ var symbol = semanticModel.GetDeclaredSymbol(variableDeclaration.Variables[0], cancellationToken);
+ if (symbol != null)
+ {
+ return ((ISymbol)symbol).DeclaredAccessibility;
+ }
+ }
+
+ return Accessibility.Private;
+ }
+
+ private static TypeSyntax GetOutermostType(TypeSyntax type)
+ {
+ return type.GetAncestorsOrThis<TypeSyntax>().Last();
+ }
+
+ public static SemanticMap GetSemanticMap(this SemanticModel semanticModel, SyntaxNode node, CancellationToken cancellationToken)
+ {
+ return SemanticMap.From(semanticModel, node, cancellationToken);
+ }
+
+ /// <summary>
+ /// Gets semantic information, such as type, symbols, and diagnostics, about the parent of a token.
+ /// </summary>
+ /// <param name="semanticModel">The SemanticModel object to get semantic information
+ /// from.</param>
+ /// <param name="token">The token to get semantic information from. This must be part of the
+ /// syntax tree associated with the binding.</param>
+ /// <param name="cancellationToken">A cancellation token.</param>
+ public static SymbolInfo GetSymbolInfo(this SemanticModel semanticModel, SyntaxToken token, CancellationToken cancellationToken)
+ {
+ return semanticModel.GetSymbolInfo(token.Parent, cancellationToken);
+ }
+
+ public static ISymbol GetEnclosingNamedTypeOrAssembly(this SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ return semanticModel.GetEnclosingSymbol<INamedTypeSymbol>(position, cancellationToken) ??
+ (ISymbol)semanticModel.Compilation.Assembly;
+ }
+
+ public static INamespaceSymbol GetEnclosingNamespace(this SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ return semanticModel.GetEnclosingSymbol<INamespaceSymbol>(position, cancellationToken);
+ }
+
+ public static ITypeSymbol GetType(
+ this SemanticModel semanticModel,
+ SyntaxNode expression,
+ CancellationToken cancellationToken)
+ {
+ var typeInfo = semanticModel.GetTypeInfo(expression, cancellationToken);
+ var symbolInfo = semanticModel.GetSymbolInfo(expression, cancellationToken);
+ return typeInfo.Type ?? symbolInfo.GetAnySymbol().ConvertToType(semanticModel.Compilation);
+ }
+
+// public static IEnumerable<ISymbol> GetSymbols(
+// this SemanticModel semanticModel,
+// SyntaxToken token,
+// Workspace workspace,
+// bool bindLiteralsToUnderlyingType,
+// CancellationToken cancellationToken)
+// {
+// var languageServices = workspace.Services.GetLanguageServices(token.Language);
+// var syntaxFacts = languageServices.GetService<ISyntaxFactsService>();
+// if (!syntaxFacts.IsBindableToken(token))
+// {
+// return SpecializedCollections.EmptyEnumerable<ISymbol>();
+// }
+//
+// var semanticFacts = languageServices.GetService<ISemanticFactsService>();
+//
+// return GetSymbolsEnumerable(
+// semanticModel, semanticFacts, syntaxFacts,
+// token, bindLiteralsToUnderlyingType, cancellationToken)
+// .WhereNotNull()
+// .Select(MapSymbol);
+// }
+
+ private static ISymbol MapSymbol(ISymbol symbol)
+ {
+ return symbol.IsConstructor() && symbol.ContainingType.IsAnonymousType
+ ? symbol.ContainingType
+ : symbol;
+ }
+
+// private static IEnumerable<ISymbol> GetSymbolsEnumerable(
+// SemanticModel semanticModel,
+// ISemanticFactsService semanticFacts,
+// ISyntaxFactsService syntaxFacts,
+// SyntaxToken token,
+// bool bindLiteralsToUnderlyingType,
+// CancellationToken cancellationToken)
+// {
+// var declaredSymbol = semanticFacts.GetDeclaredSymbol(semanticModel, token, cancellationToken);
+// if (declaredSymbol != null)
+// {
+// yield return declaredSymbol;
+// yield break;
+// }
+//
+// var aliasInfo = semanticModel.GetAliasInfo(token.Parent, cancellationToken);
+// if (aliasInfo != null)
+// {
+// yield return aliasInfo;
+// }
+//
+// var bindableParent = syntaxFacts.GetBindableParent(token);
+// var allSymbols = semanticModel.GetSymbolInfo(bindableParent, cancellationToken).GetBestOrAllSymbols().ToList();
+// var type = semanticModel.GetTypeInfo(bindableParent, cancellationToken).Type;
+//
+// if (type != null && allSymbols.Count == 0)
+// {
+// if ((bindLiteralsToUnderlyingType && syntaxFacts.IsLiteral(token)) ||
+// syntaxFacts.IsAwaitKeyword(token))
+// {
+// yield return type;
+// }
+//
+// if (type.Kind == SymbolKind.NamedType)
+// {
+// var namedType = (INamedTypeSymbol)type;
+// if (namedType.TypeKind == TypeKind.Delegate ||
+// namedType.AssociatedSymbol != null)
+// {
+// yield return type;
+// }
+// }
+// }
+//
+// foreach (var symbol in allSymbols)
+// {
+// if (symbol.IsThisParameter() && type != null)
+// {
+// yield return type;
+// }
+// else if (symbol.IsFunctionValue())
+// {
+// var method = symbol.ContainingSymbol as IMethodSymbol;
+//
+// if (method != null)
+// {
+// if (method.AssociatedSymbol != null)
+// {
+// yield return method.AssociatedSymbol;
+// }
+// else
+// {
+// yield return method;
+// }
+// }
+// else
+// {
+// yield return symbol;
+// }
+// }
+// else
+// {
+// yield return symbol;
+// }
+// }
+// }
+
+ public static SemanticModel GetOriginalSemanticModel(this SemanticModel semanticModel)
+ {
+ if (!semanticModel.IsSpeculativeSemanticModel)
+ {
+ return semanticModel;
+ }
+
+// Contract.ThrowIfNull(semanticModel.ParentModel);
+// Contract.ThrowIfTrue(semanticModel.ParentModel.IsSpeculativeSemanticModel);
+// Contract.ThrowIfTrue(semanticModel.ParentModel.ParentModel != null);
+ return semanticModel.ParentModel;
+ }
+
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/SignatureComparer.cs b/main/src/addins/CSharpBinding/Util/SignatureComparer.cs
new file mode 100644
index 0000000000..4f9e4c02a7
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SignatureComparer.cs
@@ -0,0 +1,94 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Runtime.ExceptionServices;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class SignatureComparer
+ {
+ readonly static Type typeInfo;
+ readonly static object instance;
+ readonly static MethodInfo haveSameSignatureMethod;
+ readonly static MethodInfo haveSameSignature2Method;
+ readonly static MethodInfo haveSameSignature3Method;
+ readonly static MethodInfo haveSameSignature4Method;
+ readonly static MethodInfo haveSameSignature5Method;
+
+ static SignatureComparer()
+ {
+ typeInfo = Type.GetType("Microsoft.CodeAnalysis.Shared.Utilities.SignatureComparer" + ReflectionNamespaces.WorkspacesAsmName, true);
+
+ instance = typeInfo.GetField("Instance", BindingFlags.Public | BindingFlags.Static).GetValue(null);
+
+ haveSameSignatureMethod = typeInfo.GetMethod("HaveSameSignature", new[] { typeof(IList<IParameterSymbol>), typeof(IList<IParameterSymbol>) });
+ haveSameSignature2Method = typeInfo.GetMethod("HaveSameSignature", new[] { typeof(IPropertySymbol), typeof(IPropertySymbol), typeof(bool) });
+ haveSameSignature3Method = typeInfo.GetMethod("HaveSameSignature", new[] { typeof(ISymbol), typeof(ISymbol), typeof(bool) });
+ haveSameSignature4Method = typeInfo.GetMethod("HaveSameSignature", new[] { typeof(IMethodSymbol), typeof(IMethodSymbol), typeof(bool), typeof(bool), typeof(bool) });
+ haveSameSignature5Method = typeInfo.GetMethod("HaveSameSignature", new[] { typeof(IList<IParameterSymbol>), typeof(IList<IParameterSymbol>), typeof(bool), typeof(bool) });
+ haveSameSignatureAndConstraintsAndReturnTypeAndAccessorsMethod = typeInfo.GetMethod ("HaveSameSignatureAndConstraintsAndReturnTypeAndAccessors", BindingFlags.Public | BindingFlags.Instance);
+ }
+
+ public static bool HaveSameSignature (IList<IParameterSymbol> parameters1, IList<IParameterSymbol> parameters2)
+ {
+ try {
+ return (bool)haveSameSignatureMethod.Invoke (instance, new object [] { parameters1, parameters2 });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+
+ public static bool HaveSameSignature (IPropertySymbol property1, IPropertySymbol property2, bool caseSensitive)
+ {
+ try {
+ return (bool)haveSameSignature2Method.Invoke(instance, new object[] { property1, property2, caseSensitive });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+
+ public static bool HaveSameSignature (ISymbol symbol1, ISymbol symbol2, bool caseSensitive)
+ {
+ try {
+ return (bool)haveSameSignature3Method.Invoke(instance, new object[] { symbol1, symbol2, caseSensitive });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+
+ public static bool HaveSameSignature (IMethodSymbol method1, IMethodSymbol method2, bool caseSensitive, bool compareParameterName = false, bool isParameterCaseSensitive = false)
+ {
+ try {
+ return (bool)haveSameSignature4Method.Invoke(instance, new object[] { method1, method2, caseSensitive, compareParameterName, isParameterCaseSensitive });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+
+ public static bool HaveSameSignature (IList<IParameterSymbol> parameters1, IList<IParameterSymbol> parameters2, bool compareParameterName, bool isCaseSensitive)
+ {
+ try {
+ return (bool)haveSameSignature5Method.Invoke(instance, new object[] { parameters1, parameters2, compareParameterName, isCaseSensitive });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+
+ readonly static MethodInfo haveSameSignatureAndConstraintsAndReturnTypeAndAccessorsMethod;
+ public static bool HaveSameSignatureAndConstraintsAndReturnTypeAndAccessors(ISymbol symbol1, ISymbol symbol2, bool caseSensitive)
+ {
+ try {
+ return (bool)haveSameSignatureAndConstraintsAndReturnTypeAndAccessorsMethod.Invoke(instance, new object[] { symbol1, symbol2, caseSensitive });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/Util/SimpleNameSyntaxExtensions.cs b/main/src/addins/CSharpBinding/Util/SimpleNameSyntaxExtensions.cs
new file mode 100644
index 0000000000..f129328f64
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SimpleNameSyntaxExtensions.cs
@@ -0,0 +1,64 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class SimpleNameSyntaxExtensions
+ {
+ public static ExpressionSyntax GetLeftSideOfDot(this SimpleNameSyntax name)
+ {
+ if (name.IsMemberAccessExpressionName())
+ {
+ return ((MemberAccessExpressionSyntax)name.Parent).Expression;
+ }
+ else if (name.IsRightSideOfQualifiedName())
+ {
+ return ((QualifiedNameSyntax)name.Parent).Left;
+ }
+ else
+ {
+ return ((QualifiedCrefSyntax)name.Parent.Parent).Container;
+ }
+ }
+
+ // Returns true if this looks like a possible type name that is on it's own (i.e. not after
+ // a dot). This function is not exhaustive and additional checks may be added if they are
+ // beleived to be valuable.
+ public static bool LooksLikeStandaloneTypeName(this SimpleNameSyntax simpleName)
+ {
+ if (simpleName == null)
+ {
+ return false;
+ }
+
+ // Isn't stand-alone if it's on the right of a dot/arrow
+ if (simpleName.IsRightSideOfDotOrArrow())
+ {
+ return false;
+ }
+
+ // type names can't be invoked.
+ if (simpleName.IsParentKind(SyntaxKind.InvocationExpression) &&
+ ((InvocationExpressionSyntax)simpleName.Parent).Expression == simpleName)
+ {
+ return false;
+ }
+
+ // type names can't be indexed into.
+ if (simpleName.IsParentKind(SyntaxKind.ElementAccessExpression) &&
+ ((ElementAccessExpressionSyntax)simpleName.Parent).Expression == simpleName)
+ {
+ return false;
+ }
+
+ // Looks good. However, feel free to add additional checks if this funciton is too
+ // lenient in some circumstances.
+ return true;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/SourceTextExtensions.cs b/main/src/addins/CSharpBinding/Util/SourceTextExtensions.cs
new file mode 100644
index 0000000000..94bd2c4e6a
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SourceTextExtensions.cs
@@ -0,0 +1,191 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Threading;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ internal static class SourceTextExtensions
+ {
+ /// <summary>
+ /// Returns the leading whitespace of the line located at the specified position in the given snapshot.
+ /// </summary>
+ public static string GetLeadingWhitespaceOfLineAtPosition(this SourceText text, int position)
+ {
+ // Contract.ThrowIfNull(text);
+
+ var line = text.Lines.GetLineFromPosition(position);
+ var linePosition = line.GetFirstNonWhitespacePosition();
+ if (!linePosition.HasValue)
+ {
+ return line.ToString();
+ }
+
+ var lineText = line.ToString();
+ return lineText.Substring(0, linePosition.Value - line.Start);
+ }
+
+ public static void GetLineAndOffset(this SourceText text, int position, out int lineNumber, out int offset)
+ {
+ var line = text.Lines.GetLineFromPosition(position);
+
+ lineNumber = line.LineNumber;
+ offset = position - line.Start;
+ }
+
+ public static void GetLinesAndOffsets(
+ this SourceText text,
+ TextSpan textSpan,
+ out int startLineNumber,
+ out int startOffset,
+ out int endLineNumber,
+ out int endOffset)
+ {
+ text.GetLineAndOffset(textSpan.Start, out startLineNumber, out startOffset);
+ text.GetLineAndOffset(textSpan.End, out endLineNumber, out endOffset);
+ }
+
+ public static bool OverlapsHiddenPosition(
+ this SourceText text, TextSpan span, Func<int, CancellationToken, bool> isPositionHidden, CancellationToken cancellationToken)
+ {
+ var result = TryOverlapsHiddenPosition(text, span, isPositionHidden, cancellationToken);
+ cancellationToken.ThrowIfCancellationRequested();
+ return result;
+ }
+
+ /// <summary>
+ /// Same as OverlapsHiddenPosition but doesn't throw on cancellation. Instead, returns false
+ /// in that case.
+ /// </summary>
+ public static bool TryOverlapsHiddenPosition(
+ this SourceText text, TextSpan span, Func<int, CancellationToken, bool> isPositionHidden,
+ CancellationToken cancellationToken)
+ {
+ var startLineNumber = text.Lines.IndexOf(span.Start);
+ var endLineNumber = text.Lines.IndexOf(span.End);
+
+ // NOTE(cyrusn): It's safe to examine the start of a line because you can't have a line
+ // with both a pp directive and code on it. so, for example, if a node crosses a region
+ // then it must be the case that the start of some line from the start of the node to
+ // the end is hidden. i.e.:
+ #if false
+ ' class C
+ ' {
+ '#line hidden
+ ' }
+ '#line default
+ #endif
+ // The start of the line with the } on it is hidden, and thus the node overlaps a hidden
+ // region.
+
+ for (var lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++)
+ {
+ if (cancellationToken.IsCancellationRequested)
+ {
+ break;
+ }
+
+ var linePosition = text.Lines[lineNumber].Start;
+ var isHidden = isPositionHidden(linePosition, cancellationToken);
+ if (isHidden)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static TextChangeRange GetEncompassingTextChangeRange(this SourceText newText, SourceText oldText)
+ {
+ var ranges = newText.GetChangeRanges(oldText);
+ if (ranges.Count == 0)
+ {
+ return default(TextChangeRange);
+ }
+
+ // simple case.
+ if (ranges.Count == 1)
+ {
+ return ranges[0];
+ }
+
+ return TextChangeRange.Collapse(ranges);
+ }
+
+ public static int IndexOf(this SourceText text, string value, int startIndex, bool caseSensitive)
+ {
+ var length = text.Length - value.Length;
+ var normalized = caseSensitive ? value : value.ToLowerInvariant();
+
+ for (var i = startIndex; i <= length; i++)
+ {
+ var match = true;
+ for (var j = 0; j < normalized.Length; j++)
+ {
+ // just use indexer of source text. perf of indexer depends on actual implementation of SourceText.
+ // * all of our implementation at editor layer should provide either O(1) or O(logn).
+ //
+ // only one implementation we have that could have bad indexer perf is CompositeText with heavily modified text
+ // at compiler layer but I believe that being used in find all reference will be very rare if not none.
+ if (!Match(normalized[j], text[i + j], caseSensitive))
+ {
+ match = false;
+ break;
+ }
+ }
+
+ if (match)
+ {
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ public static int LastIndexOf(this SourceText text, string value, int startIndex, bool caseSensitive)
+ {
+ var normalized = caseSensitive ? value : value.ToLowerInvariant();
+ startIndex = startIndex + normalized.Length > text.Length
+ ? text.Length - normalized.Length
+ : startIndex;
+
+ for (var i = startIndex; i >= 0; i--)
+ {
+ var match = true;
+ for (var j = 0; j < normalized.Length; j++)
+ {
+ // just use indexer of source text. perf of indexer depends on actual implementation of SourceText.
+ // * all of our implementation at editor layer should provide either O(1) or O(logn).
+ //
+ // only one implementation we have that could have bad indexer perf is CompositeText with heavily modified text
+ // at compiler layer but I believe that being used in find all reference will be very rare if not none.
+ if (!Match(normalized[j], text[i + j], caseSensitive))
+ {
+ match = false;
+ break;
+ }
+ }
+
+ if (match)
+ {
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ private static readonly TextInfo s_invariantTextInfo = CultureInfo.InvariantCulture.TextInfo;
+
+ private static bool Match(char nomalizedLeft, char right, bool caseSensitive)
+ {
+ return caseSensitive ? nomalizedLeft == right : nomalizedLeft == s_invariantTextInfo.ToLower(right);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/SpecializedCollections.cs b/main/src/addins/CSharpBinding/Util/SpecializedCollections.cs
new file mode 100644
index 0000000000..18160000b6
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SpecializedCollections.cs
@@ -0,0 +1,673 @@
+//
+// SpecializedCollections.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Collections;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static partial class SpecializedCollections
+ {
+ public static readonly byte[] EmptyBytes = EmptyArray<byte>();
+ public static readonly object[] EmptyObjects = EmptyArray<object>();
+
+ public static T[] EmptyArray<T>()
+ {
+ return Empty.Array<T>.Instance;
+ }
+
+ public static IEnumerator<T> EmptyEnumerator<T>()
+ {
+ return Empty.Enumerator<T>.Instance;
+ }
+
+ public static IEnumerable<T> EmptyEnumerable<T>()
+ {
+ return Empty.List<T>.Instance;
+ }
+
+ public static ICollection<T> EmptyCollection<T>()
+ {
+ return Empty.List<T>.Instance;
+ }
+
+ public static IList<T> EmptyList<T>()
+ {
+ return Empty.List<T>.Instance;
+ }
+
+ public static IReadOnlyList<T> EmptyReadOnlyList<T>()
+ {
+ return Empty.List<T>.Instance;
+ }
+
+ public static ISet<T> EmptySet<T>()
+ {
+ return Empty.Set<T>.Instance;
+ }
+
+ public static IDictionary<TKey, TValue> EmptyDictionary<TKey, TValue>()
+ {
+ return Empty.Dictionary<TKey, TValue>.Instance;
+ }
+
+ public static IEnumerable<T> SingletonEnumerable<T>(T value)
+ {
+ return new Singleton.Collection<T>(value);
+ }
+
+ public static ICollection<T> SingletonCollection<T>(T value)
+ {
+ return new Singleton.Collection<T>(value);
+ }
+
+ public static IEnumerator<T> SingletonEnumerator<T>(T value)
+ {
+ return new Singleton.Enumerator<T>(value);
+ }
+
+ public static IEnumerable<T> ReadOnlyEnumerable<T>(IEnumerable<T> values)
+ {
+ return new ReadOnly.Enumerable<IEnumerable<T>, T>(values);
+ }
+
+ public static ICollection<T> ReadOnlyCollection<T>(ICollection<T> collection)
+ {
+ return collection == null || collection.Count == 0
+ ? EmptyCollection<T>()
+ : new ReadOnly.Collection<ICollection<T>, T>(collection);
+ }
+
+ public static ISet<T> ReadOnlySet<T>(ISet<T> set)
+ {
+ return set == null || set.Count == 0
+ ? EmptySet<T>()
+ : new ReadOnly.Set<ISet<T>, T>(set);
+ }
+
+ public static ISet<T> ReadOnlySet<T>(IEnumerable<T> values)
+ {
+ if (values is ISet<T>)
+ {
+ return ReadOnlySet((ISet<T>)values);
+ }
+
+ HashSet<T> result = null;
+ foreach (var item in values)
+ {
+ result = result ?? new HashSet<T>();
+ result.Add(item);
+ }
+
+ return ReadOnlySet(result);
+ }
+
+ private partial class Empty
+ {
+ internal class Array<T>
+ {
+ public static readonly T[] Instance = new T[0];
+ }
+
+ internal class Collection<T> : Enumerable<T>, ICollection<T>
+ {
+ public static readonly ICollection<T> Instance = new Collection<T>();
+
+ protected Collection()
+ {
+ }
+
+ public void Add(T item)
+ {
+ throw new NotSupportedException();
+ }
+
+ public void Clear()
+ {
+ }
+
+ public bool Contains(T item)
+ {
+ return false;
+ }
+
+ public void CopyTo(T[] array, int arrayIndex)
+ {
+ }
+
+ public int Count
+ {
+ get
+ {
+ return 0;
+ }
+ }
+
+ public bool IsReadOnly
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ public bool Remove(T item)
+ {
+ throw new NotSupportedException();
+ }
+ }
+
+ internal class Dictionary<TKey, TValue> : Collection<KeyValuePair<TKey, TValue>>, IDictionary<TKey, TValue>
+ {
+ public static readonly new IDictionary<TKey, TValue> Instance = new Dictionary<TKey, TValue>();
+
+ private Dictionary()
+ {
+ }
+
+ public void Add(TKey key, TValue value)
+ {
+ throw new NotSupportedException();
+ }
+
+ public bool ContainsKey(TKey key)
+ {
+ return false;
+ }
+
+ public ICollection<TKey> Keys
+ {
+ get
+ {
+ return Collection<TKey>.Instance;
+ }
+ }
+
+ public bool Remove(TKey key)
+ {
+ throw new NotSupportedException();
+ }
+
+ public bool TryGetValue(TKey key, out TValue value)
+ {
+ value = default(TValue);
+ return false;
+ }
+
+ public ICollection<TValue> Values
+ {
+ get
+ {
+ return Collection<TValue>.Instance;
+ }
+ }
+
+ public TValue this[TKey key]
+ {
+ get
+ {
+ throw new NotSupportedException();
+ }
+
+ set
+ {
+ throw new NotSupportedException();
+ }
+ }
+
+ }
+
+ internal class Enumerable<T> : IEnumerable<T>
+ {
+ // PERF: cache the instance of enumerator.
+ // accessing a generic static field is kinda slow from here,
+ // but since empty enumerables are singletons, there is no harm in having
+ // one extra instance field
+ private readonly IEnumerator<T> _enumerator = Enumerator<T>.Instance;
+
+ public IEnumerator<T> GetEnumerator()
+ {
+ return _enumerator;
+ }
+
+ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+ }
+
+ internal class Enumerator : IEnumerator
+ {
+ public static readonly IEnumerator Instance = new Enumerator();
+
+ protected Enumerator()
+ {
+ }
+
+ public object Current
+ {
+ get
+ {
+ throw new InvalidOperationException();
+ }
+ }
+
+ public bool MoveNext()
+ {
+ return false;
+ }
+
+ public void Reset()
+ {
+ throw new InvalidOperationException();
+ }
+ }
+
+ internal class Enumerator<T> : Enumerator, IEnumerator<T>
+ {
+ public static new readonly IEnumerator<T> Instance = new Enumerator<T>();
+
+ protected Enumerator()
+ {
+ }
+
+ public new T Current
+ {
+ get
+ {
+ throw new InvalidOperationException();
+ }
+ }
+
+ public void Dispose()
+ {
+ }
+ }
+
+ internal class List<T> : Collection<T>, IList<T>, IReadOnlyList<T>
+ {
+ public static readonly new List<T> Instance = new List<T>();
+
+ protected List()
+ {
+ }
+
+ public int IndexOf(T item)
+ {
+ return -1;
+ }
+
+ public void Insert(int index, T item)
+ {
+ throw new NotSupportedException();
+ }
+
+ public void RemoveAt(int index)
+ {
+ throw new NotSupportedException();
+ }
+
+ public T this[int index]
+ {
+ get
+ {
+ throw new ArgumentOutOfRangeException("index");
+ }
+
+ set
+ {
+ throw new NotSupportedException();
+ }
+ }
+ }
+
+ internal class Set<T> : Collection<T>, ISet<T>
+ {
+ public static readonly new ISet<T> Instance = new Set<T>();
+
+ protected Set()
+ {
+ }
+
+ public new bool Add(T item)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void ExceptWith(IEnumerable<T> other)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void IntersectWith(IEnumerable<T> other)
+ {
+ throw new NotImplementedException();
+ }
+
+ public bool IsProperSubsetOf(IEnumerable<T> other)
+ {
+ throw new NotImplementedException();
+ }
+
+ public bool IsProperSupersetOf(IEnumerable<T> other)
+ {
+ throw new NotImplementedException();
+ }
+
+ public bool IsSubsetOf(IEnumerable<T> other)
+ {
+ throw new NotImplementedException();
+ }
+
+ public bool IsSupersetOf(IEnumerable<T> other)
+ {
+ throw new NotImplementedException();
+ }
+
+ public bool Overlaps(IEnumerable<T> other)
+ {
+ throw new NotImplementedException();
+ }
+
+ public bool SetEquals(IEnumerable<T> other)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void SymmetricExceptWith(IEnumerable<T> other)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void UnionWith(IEnumerable<T> other)
+ {
+ throw new NotImplementedException();
+ }
+
+ public new System.Collections.IEnumerator GetEnumerator()
+ {
+ return Set<T>.Instance.GetEnumerator();
+ }
+ }
+ }
+
+ private static partial class ReadOnly
+ {
+ internal class Collection<TUnderlying, T> : Enumerable<TUnderlying, T>, ICollection<T>
+ where TUnderlying : ICollection<T>
+ {
+ public Collection(TUnderlying underlying)
+ : base(underlying)
+ {
+ }
+
+ public void Add(T item)
+ {
+ throw new NotSupportedException();
+ }
+
+ public void Clear()
+ {
+ throw new NotSupportedException();
+ }
+
+ public bool Contains(T item)
+ {
+ return this.Underlying.Contains(item);
+ }
+
+ public void CopyTo(T[] array, int arrayIndex)
+ {
+ this.Underlying.CopyTo(array, arrayIndex);
+ }
+
+ public int Count
+ {
+ get
+ {
+ return this.Underlying.Count;
+ }
+ }
+
+ public bool IsReadOnly
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ public bool Remove(T item)
+ {
+ throw new NotSupportedException();
+ }
+ }
+
+ internal class Enumerable<TUnderlying> : IEnumerable
+ where TUnderlying : IEnumerable
+ {
+ protected readonly TUnderlying Underlying;
+
+ public Enumerable(TUnderlying underlying)
+ {
+ this.Underlying = underlying;
+ }
+
+ public IEnumerator GetEnumerator()
+ {
+ return this.Underlying.GetEnumerator();
+ }
+ }
+
+ internal class Enumerable<TUnderlying, T> : Enumerable<TUnderlying>, IEnumerable<T>
+ where TUnderlying : IEnumerable<T>
+ {
+ public Enumerable(TUnderlying underlying)
+ : base(underlying)
+ {
+ }
+
+ public new IEnumerator<T> GetEnumerator()
+ {
+ return this.Underlying.GetEnumerator();
+ }
+ }
+
+ internal class Set<TUnderlying, T> : Collection<TUnderlying, T>, ISet<T>
+ where TUnderlying : ISet<T>
+ {
+ public Set(TUnderlying underlying)
+ : base(underlying)
+ {
+ }
+
+ public new bool Add(T item)
+ {
+ throw new NotSupportedException();
+ }
+
+ public void ExceptWith(IEnumerable<T> other)
+ {
+ throw new NotSupportedException();
+ }
+
+ public void IntersectWith(IEnumerable<T> other)
+ {
+ throw new NotSupportedException();
+ }
+
+ public bool IsProperSubsetOf(IEnumerable<T> other)
+ {
+ return Underlying.IsProperSubsetOf(other);
+ }
+
+ public bool IsProperSupersetOf(IEnumerable<T> other)
+ {
+ return Underlying.IsProperSupersetOf(other);
+ }
+
+ public bool IsSubsetOf(IEnumerable<T> other)
+ {
+ return Underlying.IsSubsetOf(other);
+ }
+
+ public bool IsSupersetOf(IEnumerable<T> other)
+ {
+ return Underlying.IsSupersetOf(other);
+ }
+
+ public bool Overlaps(IEnumerable<T> other)
+ {
+ return Underlying.Overlaps(other);
+ }
+
+ public bool SetEquals(IEnumerable<T> other)
+ {
+ return Underlying.SetEquals(other);
+ }
+
+ public void SymmetricExceptWith(IEnumerable<T> other)
+ {
+ throw new NotSupportedException();
+ }
+
+ public void UnionWith(IEnumerable<T> other)
+ {
+ throw new NotSupportedException();
+ }
+ }
+
+
+ }
+
+ private static partial class Singleton
+ {
+ internal sealed class Collection<T> : ICollection<T>, IReadOnlyCollection<T>
+ {
+ private T _loneValue;
+
+ public Collection(T value)
+ {
+ _loneValue = value;
+ }
+
+ public void Add(T item)
+ {
+ throw new NotSupportedException();
+ }
+
+ public void Clear()
+ {
+ throw new NotSupportedException();
+ }
+
+ public bool Contains(T item)
+ {
+ return EqualityComparer<T>.Default.Equals(_loneValue, item);
+ }
+
+ public void CopyTo(T[] array, int arrayIndex)
+ {
+ array[arrayIndex] = _loneValue;
+ }
+
+ public int Count
+ {
+ get { return 1; }
+ }
+
+ public bool IsReadOnly
+ {
+ get { return true; }
+ }
+
+ public bool Remove(T item)
+ {
+ throw new NotSupportedException();
+ }
+
+ public IEnumerator<T> GetEnumerator()
+ {
+ return new Enumerator<T>(_loneValue);
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+ }
+ internal class Enumerator<T> : IEnumerator<T>
+ {
+ private T _loneValue;
+ private bool _moveNextCalled;
+
+ public Enumerator(T value)
+ {
+ _loneValue = value;
+ _moveNextCalled = false;
+ }
+
+ public T Current
+ {
+ get
+ {
+ return _loneValue;
+ }
+ }
+
+ object IEnumerator.Current
+ {
+ get
+ {
+ return _loneValue;
+ }
+ }
+
+ public void Dispose()
+ {
+ }
+
+ public bool MoveNext()
+ {
+ if (!_moveNextCalled)
+ {
+ _moveNextCalled = true;
+ return true;
+ }
+
+ return false;
+ }
+
+ public void Reset()
+ {
+ _moveNextCalled = false;
+ }
+ }
+
+ }
+
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/Util/SpeculationAnalyzer.cs b/main/src/addins/CSharpBinding/Util/SpeculationAnalyzer.cs
new file mode 100644
index 0000000000..cbca2f38cd
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SpeculationAnalyzer.cs
@@ -0,0 +1,137 @@
+//
+// SpeculationAnalyzer.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Reflection;
+using System.Runtime.ExceptionServices;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ class SpeculationAnalyzer
+ {
+ readonly static Type typeInfo;
+ readonly static MethodInfo symbolsForOriginalAndReplacedNodesAreCompatibleMethod;
+ readonly static MethodInfo replacementChangesSemanticsMethod;
+ readonly object instance;
+
+ static SpeculationAnalyzer ()
+ {
+ Type[] abstractSpeculationAnalyzerGenericParams = new[] {
+ Type.GetType ("Microsoft.CodeAnalysis.SyntaxNode" + ReflectionNamespaces.CAAsmName, true),
+ Type.GetType ("Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax" + ReflectionNamespaces.CACSharpAsmName, true),
+ Type.GetType ("Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax" + ReflectionNamespaces.CACSharpAsmName, true),
+ Type.GetType ("Microsoft.CodeAnalysis.CSharp.Syntax.AttributeSyntax" + ReflectionNamespaces.CACSharpAsmName, true),
+ Type.GetType ("Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax" + ReflectionNamespaces.CACSharpAsmName, true),
+ Type.GetType ("Microsoft.CodeAnalysis.CSharp.Syntax.ForEachStatementSyntax" + ReflectionNamespaces.CACSharpAsmName, true),
+ Type.GetType ("Microsoft.CodeAnalysis.CSharp.Syntax.ThrowStatementSyntax" + ReflectionNamespaces.CACSharpAsmName, true),
+ Type.GetType ("Microsoft.CodeAnalysis.SemanticModel" + ReflectionNamespaces.CAAsmName, true),
+ Type.GetType ("Microsoft.CodeAnalysis.CSharp.Conversion" + ReflectionNamespaces.CACSharpAsmName, true)
+ };
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.Shared.Utilities.AbstractSpeculationAnalyzer`9" + ReflectionNamespaces.WorkspacesAsmName, true)
+ .MakeGenericType (abstractSpeculationAnalyzerGenericParams);
+
+ symbolsForOriginalAndReplacedNodesAreCompatibleMethod = typeInfo.GetMethod ("SymbolsForOriginalAndReplacedNodesAreCompatible", BindingFlags.Public | BindingFlags.Instance);
+ replacementChangesSemanticsMethod = typeInfo.GetMethod ("ReplacementChangesSemantics", BindingFlags.Public | BindingFlags.Instance);
+ symbolInfosAreCompatibleMethod = typeInfo.GetMethod ("SymbolInfosAreCompatible", BindingFlags.Public | BindingFlags.Static);
+
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.CSharp.Utilities.SpeculationAnalyzer" + ReflectionNamespaces.CSWorkspacesAsmName, true);
+ createSpeculativeSemanticModelForNodeMethod = typeInfo.GetMethod ("CreateSpeculativeSemanticModelForNode", BindingFlags.Public | BindingFlags.Static, null, new [] {typeof (SyntaxNode), typeof (SyntaxNode), typeof (SemanticModel)}, null);
+ }
+
+ public SpeculationAnalyzer (ExpressionSyntax expression, ExpressionSyntax newExpression, SemanticModel semanticModel, CancellationToken cancellationToken, bool skipVerificationForReplacedNode = false, bool failOnOverloadResolutionFailuresInOriginalCode = false)
+ {
+ instance = Activator.CreateInstance (typeInfo, new object[] {
+ expression,
+ newExpression,
+ semanticModel,
+ cancellationToken,
+ skipVerificationForReplacedNode,
+ failOnOverloadResolutionFailuresInOriginalCode
+ });
+ }
+
+ static MethodInfo symbolInfosAreCompatibleMethod;
+
+ public static bool SymbolInfosAreCompatible(SymbolInfo originalSymbolInfo, SymbolInfo newSymbolInfo, bool performEquivalenceCheck, bool requireNonNullSymbols = false)
+ {
+ try {
+ return (bool)symbolInfosAreCompatibleMethod.Invoke (null, new object [] { originalSymbolInfo, newSymbolInfo, performEquivalenceCheck, requireNonNullSymbols });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+
+ public bool SymbolsForOriginalAndReplacedNodesAreCompatible ()
+ {
+ try {
+ return (bool)symbolsForOriginalAndReplacedNodesAreCompatibleMethod.Invoke (instance, new object[0]);
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+
+ public bool ReplacementChangesSemantics ()
+ {
+ try {
+ return (bool)replacementChangesSemanticsMethod.Invoke (instance, new object[0]);
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+
+ readonly static MethodInfo createSpeculativeSemanticModelForNodeMethod;
+
+ public static SemanticModel CreateSpeculativeSemanticModelForNode(SyntaxNode originalNode, SyntaxNode nodeToSpeculate, SemanticModel semanticModel)
+ {
+ return (SemanticModel)createSpeculativeSemanticModelForNodeMethod.Invoke (null, new object[] {originalNode, nodeToSpeculate, semanticModel });
+ }
+
+ public static bool CanSpeculateOnNode(SyntaxNode node)
+ {
+ return (node is StatementSyntax && node.Kind() != SyntaxKind.Block) ||
+ node is TypeSyntax ||
+ node is CrefSyntax ||
+ node.Kind() == SyntaxKind.Attribute ||
+ node.Kind() == SyntaxKind.ThisConstructorInitializer ||
+ node.Kind() == SyntaxKind.BaseConstructorInitializer ||
+ node.Kind() == SyntaxKind.EqualsValueClause ||
+ node.Kind() == SyntaxKind.ArrowExpressionClause;
+ }
+
+ }
+
+}
diff --git a/main/src/addins/CSharpBinding/Util/StringExtensions.cs b/main/src/addins/CSharpBinding/Util/StringExtensions.cs
new file mode 100644
index 0000000000..29cf7ed7f1
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/StringExtensions.cs
@@ -0,0 +1,551 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Immutable;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using System.Diagnostics;
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Simplification;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class StringExtensions
+ {
+ public static int? GetFirstNonWhitespaceOffset(this string line)
+ {
+ // Contract.ThrowIfNull(line);
+
+ for (int i = 0; i < line.Length; i++)
+ {
+ if (!char.IsWhiteSpace(line[i]))
+ {
+ return i;
+ }
+ }
+
+ return null;
+ }
+
+ public static string GetLeadingWhitespace(this string lineText)
+ {
+ // Contract.ThrowIfNull(lineText);
+
+ var firstOffset = lineText.GetFirstNonWhitespaceOffset();
+
+ return firstOffset.HasValue
+ ? lineText.Substring(0, firstOffset.Value)
+ : lineText;
+ }
+
+ public static int GetTextColumn(this string text, int tabSize, int initialColumn)
+ {
+ var lineText = text.GetLastLineText();
+ if (text != lineText)
+ {
+ return lineText.GetColumnFromLineOffset(lineText.Length, tabSize);
+ }
+
+ return text.ConvertTabToSpace(tabSize, initialColumn, text.Length) + initialColumn;
+ }
+
+ public static int ConvertTabToSpace(this string textSnippet, int tabSize, int initialColumn, int endPosition)
+ {
+ // Contract.Requires(tabSize > 0);
+ // Contract.Requires(endPosition >= 0 && endPosition <= textSnippet.Length);
+
+ int column = initialColumn;
+
+ // now this will calculate indentation regardless of actual content on the buffer except TAB
+ for (int i = 0; i < endPosition; i++)
+ {
+ if (textSnippet[i] == '\t')
+ {
+ column += tabSize - column % tabSize;
+ }
+ else
+ {
+ column++;
+ }
+ }
+
+ return column - initialColumn;
+ }
+
+ public static int IndexOf(this string text, Func<char, bool> predicate)
+ {
+ if (text == null)
+ {
+ return -1;
+ }
+
+ for (int i = 0; i < text.Length; i++)
+ {
+ if (predicate(text[i]))
+ {
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ public static string GetFirstLineText(this string text)
+ {
+ var lineBreak = text.IndexOf('\n');
+ if (lineBreak < 0)
+ {
+ return text;
+ }
+
+ return text.Substring(0, lineBreak + 1);
+ }
+
+ public static string GetLastLineText(this string text)
+ {
+ var lineBreak = text.LastIndexOf('\n');
+ if (lineBreak < 0)
+ {
+ return text;
+ }
+
+ return text.Substring(lineBreak + 1);
+ }
+
+ public static bool ContainsLineBreak(this string text)
+ {
+ foreach (char ch in text)
+ {
+ if (ch == '\n' || ch == '\r')
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static int GetNumberOfLineBreaks(this string text)
+ {
+ int lineBreaks = 0;
+ for (int i = 0; i < text.Length; i++)
+ {
+ if (text[i] == '\n')
+ {
+ lineBreaks++;
+ }
+ else if (text[i] == '\r')
+ {
+ if (i + 1 == text.Length || text[i + 1] != '\n')
+ {
+ lineBreaks++;
+ }
+ }
+ }
+
+ return lineBreaks;
+ }
+
+ public static bool ContainsTab(this string text)
+ {
+ // PERF: Tried replacing this with "text.IndexOf('\t')>=0", but that was actually slightly slower
+ foreach (char ch in text)
+ {
+ if (ch == '\t')
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static ImmutableArray<SymbolDisplayPart> ToSymbolDisplayParts(this string text)
+ {
+ return ImmutableArray.Create<SymbolDisplayPart>(new SymbolDisplayPart(SymbolDisplayPartKind.Text, null, text));
+ }
+
+ public static int GetColumnOfFirstNonWhitespaceCharacterOrEndOfLine(this string line, int tabSize)
+ {
+ var firstNonWhitespaceChar = line.GetFirstNonWhitespaceOffset();
+
+ if (firstNonWhitespaceChar.HasValue)
+ {
+ return line.GetColumnFromLineOffset(firstNonWhitespaceChar.Value, tabSize);
+ }
+ else
+ {
+ // It's all whitespace, so go to the end
+ return line.GetColumnFromLineOffset(line.Length, tabSize);
+ }
+ }
+
+ public static int GetColumnFromLineOffset(this string line, int endPosition, int tabSize)
+ {
+// Contract.ThrowIfNull(line);
+// Contract.ThrowIfFalse(0 <= endPosition && endPosition <= line.Length);
+// Contract.ThrowIfFalse(tabSize > 0);
+
+ return ConvertTabToSpace(line, tabSize, 0, endPosition);
+ }
+
+ public static int GetLineOffsetFromColumn(this string line, int column, int tabSize)
+ {
+// Contract.ThrowIfNull(line);
+// Contract.ThrowIfFalse(column >= 0);
+// Contract.ThrowIfFalse(tabSize > 0);
+
+ var currentColumn = 0;
+
+ for (int i = 0; i < line.Length; i++)
+ {
+ if (currentColumn >= column)
+ {
+ return i;
+ }
+
+ if (line[i] == '\t')
+ {
+ currentColumn += tabSize - (currentColumn % tabSize);
+ }
+ else
+ {
+ currentColumn++;
+ }
+ }
+
+ // We're asking for a column past the end of the line, so just go to the end.
+ return line.Length;
+ }
+
+// public static void AppendToAliasNameSet(this string alias, ImmutableHashSet<string>.Builder builder)
+// {
+// if (string.IsNullOrWhiteSpace(alias))
+// {
+// return;
+// }
+//
+// builder.Add(alias);
+//
+// var caseSensitive = builder.KeyComparer == StringComparer.Ordinal;
+// // Contract.Requires(builder.KeyComparer == StringComparer.Ordinal || builder.KeyComparer == StringComparer.OrdinalIgnoreCase);
+//
+// string aliasWithoutAttribute;
+// if (alias.TryGetWithoutAttributeSuffix(caseSensitive, out aliasWithoutAttribute))
+// {
+// builder.Add(aliasWithoutAttribute);
+// return;
+// }
+//
+// builder.Add(alias.GetWithSingleAttributeSuffix(caseSensitive));
+// }
+
+
+ private static ImmutableArray<string> s_lazyNumerals;
+
+ internal static string GetNumeral(int number)
+ {
+ var numerals = s_lazyNumerals;
+ if (numerals.IsDefault)
+ {
+ numerals = ImmutableArray.Create("0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
+ ImmutableInterlocked.InterlockedInitialize(ref s_lazyNumerals, numerals);
+ }
+
+ Debug.Assert(number >= 0);
+ return (number < numerals.Length) ? numerals[number] : number.ToString();
+ }
+
+ public static string Join(this IEnumerable<string> source, string separator)
+ {
+ if (source == null)
+ {
+ throw new ArgumentNullException("source");
+ }
+
+ if (separator == null)
+ {
+ throw new ArgumentNullException("separator");
+ }
+
+ return string.Join(separator, source);
+ }
+
+ public static bool LooksLikeInterfaceName(this string name)
+ {
+ return name.Length >= 3 && name[0] == 'I' && char.IsUpper(name[1]) && char.IsLower(name[2]);
+ }
+
+ public static bool LooksLikeTypeParameterName(this string name)
+ {
+ return name.Length >= 3 && name[0] == 'T' && char.IsUpper(name[1]) && char.IsLower(name[2]);
+ }
+
+ private static readonly Func<char, char> s_toLower = char.ToLower;
+ private static readonly Func<char, char> s_toUpper = char.ToUpper;
+
+ public static string ToPascalCase(
+ this string shortName,
+ bool trimLeadingTypePrefix = true)
+ {
+ return ConvertCase(shortName, trimLeadingTypePrefix, s_toUpper);
+ }
+
+ public static string ToCamelCase(
+ this string shortName,
+ bool trimLeadingTypePrefix = true)
+ {
+ return ConvertCase(shortName, trimLeadingTypePrefix, s_toLower);
+ }
+
+ private static string ConvertCase(
+ this string shortName,
+ bool trimLeadingTypePrefix,
+ Func<char, char> convert)
+ {
+ // Special case the common .net pattern of "IFoo" as a type name. In this case we
+ // want to generate "foo" as the parameter name.
+ if (!string.IsNullOrEmpty(shortName))
+ {
+ if (trimLeadingTypePrefix && (shortName.LooksLikeInterfaceName() || shortName.LooksLikeTypeParameterName()))
+ {
+ return convert(shortName[1]) + shortName.Substring(2);
+ }
+
+ if (convert(shortName[0]) != shortName[0])
+ {
+ return convert(shortName[0]) + shortName.Substring(1);
+ }
+ }
+
+ return shortName;
+ }
+
+ internal static bool IsValidClrTypeName(this string name)
+ {
+ return !string.IsNullOrEmpty(name) && name.IndexOf('\0') == -1;
+ }
+
+ /// <summary>
+ /// Checks if the given name is a sequence of valid CLR names separated by a dot.
+ /// </summary>
+ internal static bool IsValidClrNamespaceName(this string name)
+ {
+ if (string.IsNullOrEmpty(name))
+ {
+ return false;
+ }
+
+ char lastChar = '.';
+ foreach (char c in name)
+ {
+ if (c == '\0' || (c == '.' && lastChar == '.'))
+ {
+ return false;
+ }
+
+ lastChar = c;
+ }
+
+ return lastChar != '.';
+ }
+
+ internal static string GetWithSingleAttributeSuffix(
+ this string name,
+ bool isCaseSensitive)
+ {
+ string cleaned = name;
+ while ((cleaned = GetWithoutAttributeSuffix(cleaned, isCaseSensitive)) != null)
+ {
+ name = cleaned;
+ }
+
+ return name + "Attribute";
+ }
+
+ internal static bool TryGetWithoutAttributeSuffix(
+ this string name,
+ out string result)
+ {
+ return TryGetWithoutAttributeSuffix(name, isCaseSensitive: true, result: out result);
+ }
+
+ internal static string GetWithoutAttributeSuffix(
+ this string name,
+ bool isCaseSensitive)
+ {
+ string result;
+ return TryGetWithoutAttributeSuffix(name, isCaseSensitive, out result) ? result : null;
+ }
+
+ internal static bool TryGetWithoutAttributeSuffix(
+ this string name,
+ bool isCaseSensitive,
+ out string result)
+ {
+ const string AttributeSuffix = "Attribute";
+ var comparison = isCaseSensitive ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase;
+ if (name.Length > AttributeSuffix.Length && name.EndsWith(AttributeSuffix, comparison))
+ {
+ result = name.Substring(0, name.Length - AttributeSuffix.Length);
+ return true;
+ }
+
+ result = null;
+ return false;
+ }
+
+ internal static bool IsValidUnicodeString(this string str)
+ {
+ int i = 0;
+ while (i < str.Length)
+ {
+ char c = str[i++];
+
+ // (high surrogate, low surrogate) makes a valid pair, anything else is invalid:
+ if (char.IsHighSurrogate(c))
+ {
+ if (i < str.Length && char.IsLowSurrogate(str[i]))
+ {
+ i++;
+ }
+ else
+ {
+ // high surrogate not followed by low surrogate
+ return false;
+ }
+ }
+ else if (char.IsLowSurrogate(c))
+ {
+ // previous character wasn't a high surrogate
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /// <summary>
+ /// Remove one set of leading and trailing double quote characters, if both are present.
+ /// </summary>
+ internal static string Unquote(this string arg)
+ {
+ bool quoted;
+ return Unquote(arg, out quoted);
+ }
+
+ internal static string Unquote(this string arg, out bool quoted)
+ {
+ if (arg.Length > 1 && arg[0] == '"' && arg[arg.Length - 1] == '"')
+ {
+ quoted = true;
+ return arg.Substring(1, arg.Length - 2);
+ }
+ else
+ {
+ quoted = false;
+ return arg;
+ }
+ }
+
+ internal static int IndexOfBalancedParenthesis(this string str, int openingOffset, char closing)
+ {
+ char opening = str[openingOffset];
+
+ int depth = 1;
+ for (int i = openingOffset + 1; i < str.Length; i++)
+ {
+ var c = str[i];
+ if (c == opening)
+ {
+ depth++;
+ }
+ else if (c == closing)
+ {
+ depth--;
+ if (depth == 0)
+ {
+ return i;
+ }
+ }
+ }
+
+ return -1;
+ }
+
+ // String isn't IEnumerable<char> in the current Portable profile.
+ internal static char First(this string arg)
+ {
+ return arg[0];
+ }
+
+ // String isn't IEnumerable<char> in the current Portable profile.
+ internal static char Last(this string arg)
+ {
+ return arg[arg.Length - 1];
+ }
+
+ // String isn't IEnumerable<char> in the current Portable profile.
+ internal static bool All(this string arg, Predicate<char> predicate)
+ {
+ foreach (char c in arg)
+ {
+ if (!predicate(c))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static string EscapeIdentifier(
+ this string identifier,
+ bool isQueryContext = false)
+ {
+ var nullIndex = identifier.IndexOf('\0');
+ if (nullIndex >= 0)
+ {
+ identifier = identifier.Substring(0, nullIndex);
+ }
+
+ var needsEscaping = SyntaxFacts.GetKeywordKind(identifier) != SyntaxKind.None;
+
+ // Check if we need to escape this contextual keyword
+ needsEscaping = needsEscaping || (isQueryContext && SyntaxFacts.IsQueryContextualKeyword(SyntaxFacts.GetContextualKeywordKind(identifier)));
+
+ return needsEscaping ? "@" + identifier : identifier;
+ }
+
+ public static SyntaxToken ToIdentifierToken (
+ this string identifier,
+ bool isQueryContext = false)
+ {
+ var escaped = identifier.EscapeIdentifier (isQueryContext);
+
+ if (escaped.Length == 0 || escaped [0] != '@') {
+ return SyntaxFactory.Identifier (escaped);
+ }
+
+ var unescaped = identifier.StartsWith ("@", StringComparison.Ordinal)
+ ? identifier.Substring (1)
+ : identifier;
+
+ var token = SyntaxFactory.Identifier (
+ default(SyntaxTriviaList), SyntaxKind.None, "@" + unescaped, unescaped, default(SyntaxTriviaList));
+
+ if (!identifier.StartsWith ("@", StringComparison.Ordinal)) {
+ token = token.WithAdditionalAnnotations (Simplifier.Annotation);
+ }
+
+ return token;
+ }
+
+ public static IdentifierNameSyntax ToIdentifierName (this string identifier)
+ {
+ return SyntaxFactory.IdentifierName (identifier.ToIdentifierToken ());
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/StringPclExtensions.cs b/main/src/addins/CSharpBinding/Util/StringPclExtensions.cs
new file mode 100644
index 0000000000..f0ea6b01b1
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/StringPclExtensions.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class StringPclExtensions
+ {
+ public static bool Any(this string source, Func<char, bool> predicate)
+ {
+ foreach (char ch in source)
+ {
+ if (predicate(ch))
+ return true;
+ }
+ return false;
+ }
+
+ public static IEnumerable<char> Take(this string source, int count)
+ {
+ if (count > source.Length)
+ count = source.Length;
+ for (int i = 0; i < count; i++)
+ {
+ yield return source[i];
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/SymbolEquivalenceComparer.cs b/main/src/addins/CSharpBinding/Util/SymbolEquivalenceComparer.cs
new file mode 100644
index 0000000000..81f4ad6d3e
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SymbolEquivalenceComparer.cs
@@ -0,0 +1,49 @@
+//
+// SymbolEquivalenceComparer.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
+using System.Reflection;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class SymbolEquivalenceComparer
+ {
+ public static readonly IEqualityComparer<ISymbol> Instance;
+ public static readonly IEqualityComparer<ISymbol> IgnoreAssembliesInstance;
+
+ static SymbolEquivalenceComparer ()
+ {
+ var typeInfo = Type.GetType("Microsoft.CodeAnalysis.Shared.Utilities.SymbolEquivalenceComparer" + ReflectionNamespaces.WorkspacesAsmName, true);
+ var instanceField = typeInfo.GetField ("Instance", BindingFlags.Static | BindingFlags.Public);
+ Instance = (IEqualityComparer<ISymbol> )instanceField.GetValue (null);
+
+ var ignoreAssembliesInstanceField = typeInfo.GetField ("IgnoreAssembliesInstance", BindingFlags.Static | BindingFlags.Public);
+ IgnoreAssembliesInstance = (IEqualityComparer<ISymbol> )ignoreAssembliesInstanceField.GetValue (null);
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/SymbolExtensions.cs b/main/src/addins/CSharpBinding/Util/SymbolExtensions.cs
new file mode 100644
index 0000000000..c6d108853b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SymbolExtensions.cs
@@ -0,0 +1,1382 @@
+//
+// SymbolExtensions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis;
+using System.Linq;
+using System.Collections.Immutable;
+using Microsoft.CodeAnalysis.Shared.Utilities;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+using System.Collections.Generic;
+using System.ComponentModel;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class SymbolExtensions
+ {
+ // public static string GetDocumentationId (this ISymbol symbol)
+ // {
+ // if (symbol.GetType().FullName != "Microsoft.CodeAnalysis.CSharp.Symbol")
+ // return null;
+ // var mi = symbol.GetType().GetMethod("GetDocumentationCommentId", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
+ // if (mi == null)
+ // return null;
+ // return (string)mi.Invoke(symbol, null);
+ // }
+
+ /// <summary>
+ /// Gets the EditorBrowsableState of an entity.
+ /// </summary>
+ /// <returns>
+ /// The editor browsable state.
+ /// </returns>
+ /// <param name='symbol'>
+ /// Entity.
+ /// </param>
+ public static System.ComponentModel.EditorBrowsableState GetEditorBrowsableState(this ISymbol symbol)
+ {
+ if (symbol == null)
+ throw new ArgumentNullException("symbol");
+ var browsableState = symbol.GetAttributes().FirstOrDefault(attr => attr.AttributeClass.Name == "EditorBrowsableAttribute" && attr.AttributeClass.ContainingNamespace.MetadataName == "System.ComponentModel");
+ if (browsableState != null && browsableState.ConstructorArguments.Length == 1) {
+ try {
+ return (System.ComponentModel.EditorBrowsableState)browsableState.ConstructorArguments [0].Value;
+ } catch {
+ }
+ }
+ return System.ComponentModel.EditorBrowsableState.Always;
+ }
+
+ /// <summary>
+ /// Determines if an entity should be shown in the code completion window. This is the same as:
+ /// <c>GetEditorBrowsableState (entity) != System.ComponentModel.EditorBrowsableState.Never</c>
+ /// </summary>
+ /// <returns>
+ /// <c>true</c> if the entity should be shown; otherwise, <c>false</c>.
+ /// </returns>
+ /// <param name='symbol'>
+ /// The entity.
+ /// </param>
+ public static bool IsEditorBrowsable(this ISymbol symbol)
+ {
+ if (symbol == null)
+ throw new ArgumentNullException("symbol");
+ return GetEditorBrowsableState(symbol) != System.ComponentModel.EditorBrowsableState.Never;
+ }
+ public static ImmutableArray<IParameterSymbol> GetParameters(this ISymbol symbol)
+ {
+ if (symbol == null)
+ throw new ArgumentNullException("symbol");
+ var method = symbol as IMethodSymbol;
+ if (method != null)
+ return method.Parameters;
+ var property = symbol as IPropertySymbol;
+ if (property != null)
+ return property.Parameters;
+ return ImmutableArray<IParameterSymbol>.Empty;
+ }
+
+ public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol symbol)
+ {
+ if (symbol == null)
+ throw new ArgumentNullException("symbol");
+ var type = symbol as INamedTypeSymbol;
+ if (type != null)
+ return type.TypeParameters;
+ var method = symbol as IMethodSymbol;
+ if (method != null)
+ return method.TypeParameters;
+ return ImmutableArray<ITypeParameterSymbol>.Empty;
+ }
+
+ public static bool IsAnyConstructor(this ISymbol symbol)
+ {
+ if (symbol == null)
+ throw new ArgumentNullException("symbol");
+ var method = symbol as IMethodSymbol;
+ return method != null && (method.MethodKind == MethodKind.Constructor || method.MethodKind == MethodKind.StaticConstructor);
+ }
+
+ public static bool IsConstructor(this ISymbol symbol)
+ {
+ if (symbol == null)
+ throw new ArgumentNullException("symbol");
+ return symbol is IMethodSymbol && ((IMethodSymbol)symbol).MethodKind == MethodKind.Constructor;
+ }
+
+ public static bool IsStaticConstructor(this ISymbol symbol)
+ {
+ if (symbol == null)
+ throw new ArgumentNullException("symbol");
+ return symbol is IMethodSymbol && ((IMethodSymbol)symbol).MethodKind == MethodKind.StaticConstructor;
+ }
+
+ public static bool IsDestructor(this ISymbol symbol)
+ {
+ if (symbol == null)
+ throw new ArgumentNullException("symbol");
+ return symbol is IMethodSymbol && ((IMethodSymbol)symbol).MethodKind == MethodKind.Destructor;
+ }
+
+ public static bool IsDelegateType(this ISymbol symbol)
+ {
+ if (symbol == null)
+ throw new ArgumentNullException("symbol");
+ return symbol is ITypeSymbol && ((ITypeSymbol)symbol).TypeKind == TypeKind.Delegate;
+ }
+
+ public static ParameterSyntax GenerateParameterSyntax (this IParameterSymbol symbol)
+ {
+ var result = SyntaxFactory.Parameter (SyntaxFactory.Identifier (symbol.Name));
+ result = result.WithType (symbol.Type.GenerateTypeSyntax ());
+ if (symbol.IsThis)
+ result = result.WithModifiers(SyntaxFactory.TokenList (SyntaxFactory.Token (SyntaxKind.ThisKeyword)));
+ if (symbol.IsParams)
+ result = result.WithModifiers(SyntaxFactory.TokenList (SyntaxFactory.Token (SyntaxKind.ParamsKeyword)));
+ if (symbol.RefKind == RefKind.Out)
+ result = result.WithModifiers(SyntaxFactory.TokenList (SyntaxFactory.Token (SyntaxKind.OutKeyword)));
+ if (symbol.RefKind == RefKind.Ref)
+ result = result.WithModifiers(SyntaxFactory.TokenList (SyntaxFactory.Token (SyntaxKind.RefKeyword)));
+ return result;
+ }
+
+ public static bool IsType(this ISymbol symbol)
+ {
+ var typeSymbol = symbol as ITypeSymbol;
+ return typeSymbol != null && typeSymbol.IsType;
+ }
+
+ public static bool IsAccessorMethod(this ISymbol symbol)
+ {
+ var accessorSymbol = symbol as IMethodSymbol;
+ return accessorSymbol != null &&
+ (accessorSymbol.MethodKind == MethodKind.PropertySet || accessorSymbol.MethodKind == MethodKind.PropertyGet ||
+ accessorSymbol.MethodKind == MethodKind.EventRemove || accessorSymbol.MethodKind == MethodKind.EventAdd);
+ }
+
+ public static bool IsPublic(this ISymbol symbol)
+ {
+ return symbol.DeclaredAccessibility == Accessibility.Public;
+ }
+
+ public static bool IsErrorType(this ISymbol symbol)
+ {
+ return
+ symbol is ITypeSymbol &&
+ ((ITypeSymbol)symbol).TypeKind == TypeKind.Error;
+ }
+
+
+ public static bool IsIndexer(this ISymbol symbol)
+ {
+ return (symbol as IPropertySymbol)?.IsIndexer == true;
+ }
+
+ public static bool IsUserDefinedOperator(this ISymbol symbol)
+ {
+ return (symbol as IMethodSymbol)?.MethodKind == MethodKind.UserDefinedOperator;
+ }
+
+ public static SymbolVisibility GetResultantVisibility(this ISymbol symbol)
+ {
+ // Start by assuming it's visible.
+ var visibility = SymbolVisibility.Public;
+
+ switch (symbol.Kind)
+ {
+ case SymbolKind.Alias:
+ // Aliases are uber private. They're only visible in the same file that they
+ // were declared in.
+ return SymbolVisibility.Private;
+
+ case SymbolKind.Parameter:
+ // Parameters are only as visible as their containing symbol
+ return GetResultantVisibility(symbol.ContainingSymbol);
+
+ case SymbolKind.TypeParameter:
+ // Type Parameters are private.
+ return SymbolVisibility.Private;
+ }
+
+ while (symbol != null && symbol.Kind != SymbolKind.Namespace)
+ {
+ switch (symbol.DeclaredAccessibility)
+ {
+ // If we see anything private, then the symbol is private.
+ case Accessibility.NotApplicable:
+ case Accessibility.Private:
+ return SymbolVisibility.Private;
+
+ // If we see anything internal, then knock it down from public to
+ // internal.
+ case Accessibility.Internal:
+ case Accessibility.ProtectedAndInternal:
+ visibility = SymbolVisibility.Internal;
+ break;
+
+ // For anything else (Public, Protected, ProtectedOrInternal), the
+ // symbol stays at the level we've gotten so far.
+ }
+
+ symbol = symbol.ContainingSymbol;
+ }
+
+ return visibility;
+ }
+
+ public static bool IsAnonymousType(this ISymbol symbol)
+ {
+ return symbol is INamedTypeSymbol && ((INamedTypeSymbol)symbol).IsAnonymousType;
+ }
+
+// public static SymbolVisibility GetResultantVisibility(this ISymbol symbol)
+// {
+// // Start by assuming it's visible.
+// var visibility = SymbolVisibility.Public;
+//
+// switch (symbol.Kind)
+// {
+// case SymbolKind.Alias:
+// // Aliases are uber private. They're only visible in the same file that they
+// // were declared in.
+// return SymbolVisibility.Private;
+//
+// case SymbolKind.Parameter:
+// // Parameters are only as visible as their containing symbol
+// return GetResultantVisibility(symbol.ContainingSymbol);
+//
+// case SymbolKind.TypeParameter:
+// // Type Parameters are private.
+// return SymbolVisibility.Private;
+// }
+//
+// while (symbol != null && symbol.Kind != SymbolKind.Namespace)
+// {
+// switch (symbol.DeclaredAccessibility)
+// {
+// // If we see anything private, then the symbol is private.
+// case Accessibility.NotApplicable:
+// case Accessibility.Private:
+// return SymbolVisibility.Private;
+//
+// // If we see anything internal, then knock it down from public to
+// // internal.
+// case Accessibility.Internal:
+// case Accessibility.ProtectedAndInternal:
+// visibility = SymbolVisibility.Internal;
+// break;
+//
+// // For anything else (Public, Protected, ProtectedOrInternal), the
+// // symbol stays at the level we've gotten so far.
+// }
+//
+// symbol = symbol.ContainingSymbol;
+// }
+//
+// return visibility;
+// }
+
+ public static ISymbol OverriddenMember(this ISymbol symbol)
+ {
+ switch (symbol.Kind)
+ {
+ case SymbolKind.Event:
+ return ((IEventSymbol)symbol).OverriddenEvent;
+
+ case SymbolKind.Method:
+ return ((IMethodSymbol)symbol).OverriddenMethod;
+
+ case SymbolKind.Property:
+ return ((IPropertySymbol)symbol).OverriddenProperty;
+
+ case SymbolKind.NamedType:
+ return ((INamedTypeSymbol)symbol).BaseType;
+ }
+
+ return null;
+ }
+
+ public static ImmutableArray<ISymbol> ExplicitInterfaceImplementations(this ISymbol symbol)
+ {
+ return symbol.TypeSwitch(
+ (IEventSymbol @event) => @event.ExplicitInterfaceImplementations.As<ISymbol>(),
+ (IMethodSymbol method) => method.ExplicitInterfaceImplementations.As<ISymbol>(),
+ (IPropertySymbol property) => property.ExplicitInterfaceImplementations.As<ISymbol>(),
+ _ => ImmutableArray.Create<ISymbol>());
+ }
+
+ public static bool IsOverridable(this ISymbol symbol)
+ {
+ return
+ symbol != null &&
+ symbol.ContainingType != null &&
+ symbol.ContainingType.TypeKind == TypeKind.Class &&
+ (symbol.IsVirtual || symbol.IsAbstract || symbol.IsOverride) &&
+ !symbol.IsSealed;
+ }
+
+ public static bool IsImplementable(this ISymbol symbol)
+ {
+ if (symbol != null &&
+ symbol.ContainingType != null &&
+ symbol.ContainingType.TypeKind == TypeKind.Interface)
+ {
+ if (symbol.Kind == SymbolKind.Event)
+ {
+ return true;
+ }
+
+ if (symbol.Kind == SymbolKind.Property)
+ {
+ return true;
+ }
+
+ if (symbol.Kind == SymbolKind.Method && ((IMethodSymbol)symbol).MethodKind == MethodKind.Ordinary)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static INamedTypeSymbol GetContainingTypeOrThis(this ISymbol symbol)
+ {
+ if (symbol is INamedTypeSymbol)
+ {
+ return (INamedTypeSymbol)symbol;
+ }
+
+ return symbol.ContainingType;
+ }
+
+ public static bool IsPointerType(this ISymbol symbol)
+ {
+ return symbol is IPointerTypeSymbol;
+ }
+
+ public static bool IsModuleType(this ISymbol symbol)
+ {
+ return (symbol as ITypeSymbol)?.IsModuleType() == true;
+ }
+
+ public static bool IsInterfaceType(this ISymbol symbol)
+ {
+ return (symbol as ITypeSymbol)?.IsInterfaceType() == true;
+ }
+
+ public static bool IsArrayType(this ISymbol symbol)
+ {
+ return symbol?.Kind == SymbolKind.ArrayType;
+ }
+
+ public static bool IsAnonymousFunction(this ISymbol symbol)
+ {
+ return (symbol as IMethodSymbol)?.MethodKind == MethodKind.AnonymousFunction;
+ }
+
+ public static bool IsKind(this ISymbol symbol, SymbolKind kind)
+ {
+ return symbol.MatchesKind(kind);
+ }
+
+ public static bool MatchesKind(this ISymbol symbol, SymbolKind kind)
+ {
+ return symbol?.Kind == kind;
+ }
+
+ public static bool MatchesKind(this ISymbol symbol, SymbolKind kind1, SymbolKind kind2)
+ {
+ return symbol != null
+ && (symbol.Kind == kind1 || symbol.Kind == kind2);
+ }
+
+ public static bool MatchesKind(this ISymbol symbol, SymbolKind kind1, SymbolKind kind2, SymbolKind kind3)
+ {
+ return symbol != null
+ && (symbol.Kind == kind1 || symbol.Kind == kind2 || symbol.Kind == kind3);
+ }
+
+ public static bool MatchesKind(this ISymbol symbol, params SymbolKind[] kinds)
+ {
+ return symbol != null
+ && kinds.Contains(symbol.Kind);
+ }
+
+ public static bool IsReducedExtension(this ISymbol symbol)
+ {
+ return symbol is IMethodSymbol && ((IMethodSymbol)symbol).MethodKind == MethodKind.ReducedExtension;
+ }
+
+ public static bool IsExtensionMethod(this ISymbol symbol)
+ {
+ return symbol.Kind == SymbolKind.Method && ((IMethodSymbol)symbol).IsExtensionMethod;
+ }
+
+ public static bool IsModuleMember(this ISymbol symbol)
+ {
+ return symbol != null && symbol.ContainingSymbol is INamedTypeSymbol && symbol.ContainingType.TypeKind == TypeKind.Module;
+ }
+
+
+ public static bool IsConversion(this ISymbol symbol)
+ {
+ return (symbol as IMethodSymbol)?.MethodKind == MethodKind.Conversion;
+ }
+
+ public static bool IsOrdinaryMethod(this ISymbol symbol)
+ {
+ return (symbol as IMethodSymbol)?.MethodKind == MethodKind.Ordinary;
+ }
+
+
+ public static bool IsNormalAnonymousType(this ISymbol symbol)
+ {
+ return symbol.IsAnonymousType() && !symbol.IsDelegateType();
+ }
+
+ public static bool IsAnonymousDelegateType(this ISymbol symbol)
+ {
+ return symbol.IsAnonymousType() && symbol.IsDelegateType();
+ }
+
+ public static bool IsAnonymousTypeProperty(this ISymbol symbol)
+ {
+ return symbol is IPropertySymbol && symbol.ContainingType.IsNormalAnonymousType();
+ }
+
+
+ public static bool IsWriteableFieldOrProperty(this ISymbol symbol)
+ {
+ var fieldSymbol = symbol as IFieldSymbol;
+ if (fieldSymbol != null)
+ {
+ return !fieldSymbol.IsReadOnly
+ && !fieldSymbol.IsConst;
+ }
+
+ var propertySymbol = symbol as IPropertySymbol;
+ if (propertySymbol != null)
+ {
+ return !propertySymbol.IsReadOnly;
+ }
+
+ return false;
+ }
+
+ public static ITypeSymbol GetMemberType(this ISymbol symbol)
+ {
+ switch (symbol.Kind)
+ {
+ case SymbolKind.Field:
+ return ((IFieldSymbol)symbol).Type;
+ case SymbolKind.Property:
+ return ((IPropertySymbol)symbol).Type;
+ case SymbolKind.Method:
+ return ((IMethodSymbol)symbol).ReturnType;
+ case SymbolKind.Event:
+ return ((IEventSymbol)symbol).Type;
+ }
+
+ return null;
+ }
+
+ public static int GetArity(this ISymbol symbol)
+ {
+ switch (symbol.Kind)
+ {
+ case SymbolKind.NamedType:
+ return ((INamedTypeSymbol)symbol).Arity;
+ case SymbolKind.Method:
+ return ((IMethodSymbol)symbol).Arity;
+ default:
+ return 0;
+ }
+ }
+
+ public static ISymbol GetOriginalUnreducedDefinition(this ISymbol symbol)
+ {
+ if (symbol.IsReducedExtension())
+ {
+ // note: ReducedFrom is only a method definition and includes no type arguments.
+ symbol = ((IMethodSymbol)symbol).GetConstructedReducedFrom();
+ }
+
+ if (symbol.IsFunctionValue())
+ {
+ var method = symbol.ContainingSymbol as IMethodSymbol;
+ if (method != null)
+ {
+ symbol = method;
+
+ if (method.AssociatedSymbol != null)
+ {
+ symbol = method.AssociatedSymbol;
+ }
+ }
+ }
+
+ if (symbol.IsNormalAnonymousType() || symbol.IsAnonymousTypeProperty())
+ {
+ return symbol;
+ }
+
+ var parameter = symbol as IParameterSymbol;
+ if (parameter != null)
+ {
+ var method = parameter.ContainingSymbol as IMethodSymbol;
+ if (method?.IsReducedExtension() == true)
+ {
+ symbol = method.GetConstructedReducedFrom().Parameters[parameter.Ordinal + 1];
+ }
+ }
+
+ return symbol?.OriginalDefinition;
+ }
+
+ public static bool IsFunctionValue(this ISymbol symbol)
+ {
+ return symbol is ILocalSymbol && ((ILocalSymbol)symbol).IsFunctionValue;
+ }
+
+ public static bool IsThisParameter(this ISymbol symbol)
+ {
+ return symbol != null && symbol.Kind == SymbolKind.Parameter && ((IParameterSymbol)symbol).IsThis;
+ }
+
+ public static ISymbol ConvertThisParameterToType(this ISymbol symbol)
+ {
+ if (symbol.IsThisParameter())
+ {
+ return ((IParameterSymbol)symbol).Type;
+ }
+
+ return symbol;
+ }
+
+ public static bool IsParams(this ISymbol symbol)
+ {
+ var parameters = symbol.GetParameters();
+ return parameters.Length > 0 && parameters[parameters.Length - 1].IsParams;
+ }
+
+ public static ImmutableArray<ITypeSymbol> GetTypeArguments(this ISymbol symbol)
+ {
+ return symbol.TypeSwitch(
+ (IMethodSymbol m) => m.TypeArguments,
+ (INamedTypeSymbol nt) => nt.TypeArguments,
+ _ => ImmutableArray.Create<ITypeSymbol>());
+ }
+
+ public static ImmutableArray<ITypeSymbol> GetAllTypeArguments(this ISymbol symbol)
+ {
+ var results = new List<ITypeSymbol>(symbol.GetTypeArguments());
+
+ var containingType = symbol.ContainingType;
+ while (containingType != null)
+ {
+ results.AddRange(containingType.GetTypeArguments());
+ containingType = containingType.ContainingType;
+ }
+
+ return ImmutableArray.CreateRange(results);
+ }
+
+ public static bool IsAttribute(this ISymbol symbol)
+ {
+ return (symbol as ITypeSymbol)?.IsAttribute() == true;
+ }
+
+ /// <summary>
+ /// Returns true if this symbol contains anything unsafe within it. for example
+ /// List&lt;int*[]&gt; is unsafe, as it "int* Foo { get; }"
+ /// </summary>
+ public static bool IsUnsafe(this ISymbol member)
+ {
+ // TODO(cyrusn): Defer to compiler code to handle this once it can.
+ return member?.Accept(new IsUnsafeVisitor()) == true;
+ }
+
+ private class IsUnsafeVisitor : SymbolVisitor<bool>
+ {
+ private readonly HashSet<ISymbol> _visited = new HashSet<ISymbol>();
+
+ public IsUnsafeVisitor()
+ {
+ }
+
+ public override bool DefaultVisit(ISymbol node)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override bool VisitArrayType(IArrayTypeSymbol symbol)
+ {
+ if (!_visited.Add(symbol))
+ {
+ return false;
+ }
+
+ return symbol.ElementType.Accept(this);
+ }
+
+ public override bool VisitDynamicType(IDynamicTypeSymbol symbol)
+ {
+ // The dynamic type is never unsafe (well....you know what I mean
+ return false;
+ }
+
+ public override bool VisitField(IFieldSymbol symbol)
+ {
+ if (!_visited.Add(symbol))
+ {
+ return false;
+ }
+
+ return symbol.Type.Accept(this);
+ }
+
+ public override bool VisitNamedType(INamedTypeSymbol symbol)
+ {
+ if (!_visited.Add(symbol))
+ {
+ return false;
+ }
+
+ return symbol.GetAllTypeArguments().Any(ts => ts.Accept(this));
+ }
+
+ public override bool VisitPointerType(IPointerTypeSymbol symbol)
+ {
+ if (!_visited.Add(symbol))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ public override bool VisitProperty(IPropertySymbol symbol)
+ {
+ if (!_visited.Add(symbol))
+ {
+ return false;
+ }
+
+ return
+ symbol.Type.Accept(this) ||
+ symbol.Parameters.Any(p => p.Accept(this));
+ }
+
+ public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
+ {
+ if (!_visited.Add(symbol))
+ {
+ return false;
+ }
+
+ return symbol.ConstraintTypes.Any(ts => ts.Accept(this));
+ }
+
+ public override bool VisitMethod(IMethodSymbol symbol)
+ {
+ if (!_visited.Add(symbol))
+ {
+ return false;
+ }
+
+ return
+ symbol.ReturnType.Accept(this) ||
+ symbol.Parameters.Any(p => p.Accept(this)) ||
+ symbol.TypeParameters.Any(tp => tp.Accept(this));
+ }
+
+ public override bool VisitParameter(IParameterSymbol symbol)
+ {
+ if (!_visited.Add(symbol))
+ {
+ return false;
+ }
+
+ return symbol.Type.Accept(this);
+ }
+
+ public override bool VisitEvent(IEventSymbol symbol)
+ {
+ if (!_visited.Add(symbol))
+ {
+ return false;
+ }
+
+ return symbol.Type.Accept(this);
+ }
+
+ public override bool VisitAlias(IAliasSymbol symbol)
+ {
+ if (!_visited.Add(symbol))
+ {
+ return false;
+ }
+
+ return symbol.Target.Accept(this);
+ }
+ }
+
+ public static ITypeSymbol ConvertToType(
+ this ISymbol symbol,
+ Compilation compilation,
+ bool extensionUsedAsInstance = false)
+ {
+ var type = symbol as ITypeSymbol;
+ if (type != null)
+ {
+ return type;
+ }
+
+ var method = (IMethodSymbol)symbol;
+ if (method != null && !method.Parameters.Any(p => p.RefKind != RefKind.None))
+ {
+ // Convert the symbol to Func<...> or Action<...>
+ if (method.ReturnsVoid)
+ {
+ var count = extensionUsedAsInstance ? method.Parameters.Length - 1 : method.Parameters.Length;
+ var skip = extensionUsedAsInstance ? 1 : 0;
+ count = Math.Max(0, count);
+ if (count == 0)
+ {
+ // Action
+ return compilation.ActionType();
+ }
+ else
+ {
+ // Action<TArg1, ..., TArgN>
+ var actionName = "System.Action`" + count;
+ var actionType = compilation.GetTypeByMetadataName(actionName);
+
+ if (actionType != null)
+ {
+ var types = method.Parameters
+ .Skip(skip)
+ .Select(p =>
+ (object)p.Type == null ?
+ compilation.GetSpecialType(SpecialType.System_Object) :
+ p.Type)
+ .ToArray();
+ return actionType.Construct(types);
+ }
+ }
+ }
+ else
+ {
+ // Func<TArg1,...,TArgN,TReturn>
+ //
+ // +1 for the return type.
+ var count = extensionUsedAsInstance ? method.Parameters.Length - 1 : method.Parameters.Length;
+ var skip = extensionUsedAsInstance ? 1 : 0;
+ var functionName = "System.Func`" + (count + 1);
+ var functionType = compilation.GetTypeByMetadataName(functionName);
+
+ if (functionType != null)
+ {
+ var types = method.Parameters
+ .Skip(skip)
+ .Select(p => p.Type)
+ .Concat(method.ReturnType)
+ .Select(t =>
+ (object)t == null ?
+ compilation.GetSpecialType(SpecialType.System_Object) :
+ t)
+ .ToArray();
+ return functionType.Construct(types);
+ }
+ }
+ }
+
+ // Otherwise, just default to object.
+ return compilation.ObjectType;
+ }
+
+ public static bool IsDeprecated(this ISymbol symbol)
+ {
+ // TODO(cyrusn): Implement this
+ return false;
+ }
+
+ public static bool IsStaticType(this ISymbol symbol)
+ {
+ return symbol != null && symbol.Kind == SymbolKind.NamedType && symbol.IsStatic;
+ }
+
+ public static bool IsNamespace(this ISymbol symbol)
+ {
+ return symbol?.Kind == SymbolKind.Namespace;
+ }
+
+// public static bool IsOrContainsAccessibleAttribute(this ISymbol symbol, ISymbol withinType, IAssemblySymbol withinAssembly)
+// {
+// var alias = symbol as IAliasSymbol;
+// if (alias != null)
+// {
+// symbol = alias.Target;
+// }
+//
+// var namespaceOrType = symbol as INamespaceOrTypeSymbol;
+// if (namespaceOrType == null)
+// {
+// return false;
+// }
+//
+// if (namespaceOrType.IsAttribute() && namespaceOrType.IsAccessibleWithin(withinType ?? withinAssembly))
+// {
+// return true;
+// }
+//
+// return namespaceOrType.GetMembers().Any(nt => nt.IsOrContainsAccessibleAttribute(withinType, withinAssembly));
+// }
+
+ public static IEnumerable<IPropertySymbol> GetValidAnonymousTypeProperties(this ISymbol symbol)
+ {
+ // Contract.ThrowIfFalse(symbol.IsNormalAnonymousType());
+ return ((INamedTypeSymbol)symbol).GetMembers().OfType<IPropertySymbol>().Where(p => p.CanBeReferencedByName);
+ }
+
+ public static Accessibility ComputeResultantAccessibility(this ISymbol symbol, ITypeSymbol finalDestination)
+ {
+ if (symbol == null)
+ {
+ return Accessibility.Private;
+ }
+
+ switch (symbol.DeclaredAccessibility)
+ {
+ default:
+ return symbol.DeclaredAccessibility;
+ case Accessibility.ProtectedAndInternal:
+ return symbol.ContainingAssembly.GivesAccessTo(finalDestination.ContainingAssembly)
+ ? Accessibility.ProtectedAndInternal
+ : Accessibility.Internal;
+ case Accessibility.ProtectedOrInternal:
+ return symbol.ContainingAssembly.GivesAccessTo(finalDestination.ContainingAssembly)
+ ? Accessibility.ProtectedOrInternal
+ : Accessibility.Protected;
+ }
+ }
+
+ /// <returns>
+ /// Returns true if symbol is a local variable and its declaring syntax node is
+ /// after the current position, false otherwise (including for non-local symbols)
+ /// </returns>
+ public static bool IsInaccessibleLocal(this ISymbol symbol, int position)
+ {
+ if (symbol.Kind != SymbolKind.Local)
+ {
+ return false;
+ }
+
+ // Implicitly declared locals (with Option Explicit Off in VB) are scoped to the entire
+ // method and should always be considered accessible from within the same method.
+ if (symbol.IsImplicitlyDeclared)
+ {
+ return false;
+ }
+
+ var declarationSyntax = symbol.DeclaringSyntaxReferences.Select(r => r.GetSyntax()).FirstOrDefault();
+ return declarationSyntax != null && position < declarationSyntax.SpanStart;
+ }
+
+// /// <summary>
+// /// Checks a given symbol for browsability based on its declaration location, attributes
+// /// explicitly limiting browsability, and whether showing of advanced members is enabled.
+// /// The optional attribute constructor parameters may be used to specify the symbols of the
+// /// constructors of the various browsability limiting attributes because finding these
+// /// repeatedly over a large list of symbols can be slow. If providing these constructor
+// /// symbols, they should be in the format provided by
+// /// EditorBrowsableHelpers.GetSpecial*AttributeConstructor(). If these are not provided,
+// /// they will be found in the compilation.
+// /// </summary>
+// public static bool IsEditorBrowsable(
+// this ISymbol symbol,
+// bool hideAdvancedMembers,
+// Compilation compilation,
+// IMethodSymbol editorBrowsableAttributeConstructor = null,
+// List<IMethodSymbol> typeLibTypeAttributeConstructors = null,
+// List<IMethodSymbol> typeLibFuncAttributeConstructors = null,
+// List<IMethodSymbol> typeLibVarAttributeConstructors = null,
+// INamedTypeSymbol hideModuleNameAttribute = null)
+// {
+// // Namespaces can't have attributes, so just return true here. This also saves us a
+// // costly check if this namespace has any locations in source (since a merged namespace
+// // needs to go collect all the locations).
+// if (symbol.Kind == SymbolKind.Namespace)
+// {
+// return true;
+// }
+//
+// // check for IsImplicitlyDeclared so we don't spend time examining VB's embedded types.
+// // This saves a few percent in typing scenarios. An implicitly declared symbol can't
+// // have attributes, so it can't be hidden by them.
+// if (symbol.IsImplicitlyDeclared)
+// {
+// return true;
+// }
+//
+// // Ignore browsability limiting attributes if the symbol is declared in source.
+// // Check all locations since some of VB's embedded My symbols are declared in
+// // both source and the MyTemplateLocation.
+// if (symbol.Locations.All(loc => loc.IsInSource))
+// {
+// // The HideModuleNameAttribute still applies to Modules defined in source
+// return !IsBrowsingProhibitedByHideModuleNameAttribute(symbol, compilation, hideModuleNameAttribute);
+// }
+//
+// return !IsBrowsingProhibited(
+// symbol,
+// hideAdvancedMembers,
+// compilation,
+// editorBrowsableAttributeConstructor,
+// typeLibTypeAttributeConstructors,
+// typeLibFuncAttributeConstructors,
+// typeLibVarAttributeConstructors,
+// hideModuleNameAttribute);
+// }
+//
+// private static bool IsBrowsingProhibited(
+// ISymbol symbol,
+// bool hideAdvancedMembers,
+// Compilation compilation,
+// IMethodSymbol editorBrowsableAttributeConstructor,
+// List<IMethodSymbol> typeLibTypeAttributeConstructors,
+// List<IMethodSymbol> typeLibFuncAttributeConstructors,
+// List<IMethodSymbol> typeLibVarAttributeConstructors,
+// INamedTypeSymbol hideModuleNameAttribute)
+// {
+// var attributes = symbol.GetAttributes();
+// if (attributes.Length == 0)
+// {
+// return false;
+// }
+//
+// return IsBrowsingProhibitedByEditorBrowsableAttribute(symbol, attributes, hideAdvancedMembers, compilation, editorBrowsableAttributeConstructor)
+// || IsBrowsingProhibitedByTypeLibTypeAttribute(symbol, attributes, compilation, typeLibTypeAttributeConstructors)
+// || IsBrowsingProhibitedByTypeLibFuncAttribute(symbol, attributes, compilation, typeLibFuncAttributeConstructors)
+// || IsBrowsingProhibitedByTypeLibVarAttribute(symbol, attributes, compilation, typeLibVarAttributeConstructors)
+// || IsBrowsingProhibitedByHideModuleNameAttribute(symbol, compilation, hideModuleNameAttribute, attributes);
+// }
+//
+// private static bool IsBrowsingProhibitedByHideModuleNameAttribute(
+// ISymbol symbol, Compilation compilation, INamedTypeSymbol hideModuleNameAttribute, ImmutableArray<AttributeData> attributes = default(ImmutableArray<AttributeData>))
+// {
+// if (!symbol.IsModuleType())
+// {
+// return false;
+// }
+//
+// attributes = attributes.IsDefault ? symbol.GetAttributes() : attributes;
+// hideModuleNameAttribute = hideModuleNameAttribute ?? compilation.HideModuleNameAttribute();
+// foreach (var attribute in attributes)
+// {
+// if (attribute.AttributeClass == hideModuleNameAttribute)
+// {
+// return true;
+// }
+// }
+//
+// return false;
+// }
+//
+// private static bool IsBrowsingProhibitedByEditorBrowsableAttribute(
+// ISymbol symbol, ImmutableArray<AttributeData> attributes, bool hideAdvancedMembers, Compilation compilation, IMethodSymbol constructor)
+// {
+// constructor = constructor ?? EditorBrowsableHelpers.GetSpecialEditorBrowsableAttributeConstructor(compilation);
+// if (constructor == null)
+// {
+// return false;
+// }
+//
+// foreach (var attribute in attributes)
+// {
+// if (attribute.AttributeConstructor == constructor &&
+// attribute.ConstructorArguments.Length == 1 &&
+// attribute.ConstructorArguments.First().Value is int)
+// {
+// var state = (EditorBrowsableState)attribute.ConstructorArguments.First().Value;
+//
+// if (EditorBrowsableState.Never == state ||
+// (hideAdvancedMembers && EditorBrowsableState.Advanced == state))
+// {
+// return true;
+// }
+// }
+// }
+//
+// return false;
+// }
+//
+// private static bool IsBrowsingProhibitedByTypeLibTypeAttribute(
+// ISymbol symbol, ImmutableArray<AttributeData> attributes, Compilation compilation, List<IMethodSymbol> constructors)
+// {
+// return IsBrowsingProhibitedByTypeLibAttributeWorker(
+// symbol,
+// attributes,
+// constructors ?? EditorBrowsableHelpers.GetSpecialTypeLibTypeAttributeConstructors(compilation),
+// TypeLibTypeFlagsFHidden);
+// }
+//
+// private static bool IsBrowsingProhibitedByTypeLibFuncAttribute(
+// ISymbol symbol, ImmutableArray<AttributeData> attributes, Compilation compilation, List<IMethodSymbol> constructors)
+// {
+// return IsBrowsingProhibitedByTypeLibAttributeWorker(
+// symbol,
+// attributes,
+// constructors ?? EditorBrowsableHelpers.GetSpecialTypeLibFuncAttributeConstructors(compilation),
+// TypeLibFuncFlagsFHidden);
+// }
+//
+// private static bool IsBrowsingProhibitedByTypeLibVarAttribute(
+// ISymbol symbol, ImmutableArray<AttributeData> attributes, Compilation compilation, List<IMethodSymbol> constructors)
+// {
+// return IsBrowsingProhibitedByTypeLibAttributeWorker(
+// symbol,
+// attributes,
+// constructors ?? EditorBrowsableHelpers.GetSpecialTypeLibVarAttributeConstructors(compilation),
+// TypeLibVarFlagsFHidden);
+// }
+
+ private const int TypeLibTypeFlagsFHidden = 0x0010;
+ private const int TypeLibFuncFlagsFHidden = 0x0040;
+ private const int TypeLibVarFlagsFHidden = 0x0040;
+
+ private static bool IsBrowsingProhibitedByTypeLibAttributeWorker(
+ ISymbol symbol, ImmutableArray<AttributeData> attributes, List<IMethodSymbol> attributeConstructors, int hiddenFlag)
+ {
+ foreach (var attribute in attributes)
+ {
+ if (attribute.ConstructorArguments.Length == 1)
+ {
+ foreach (var constructor in attributeConstructors)
+ {
+ if (attribute.AttributeConstructor == constructor)
+ {
+ var actualFlags = 0;
+
+ // Check for both constructor signatures. The constructor that takes a TypeLib*Flags reports an int argument.
+ var argumentValue = attribute.ConstructorArguments.First().Value;
+
+ if (argumentValue is int)
+ {
+ actualFlags = (int)argumentValue;
+ }
+ else if (argumentValue is short)
+ {
+ actualFlags = (short)argumentValue;
+ }
+ else
+ {
+ continue;
+ }
+
+ if ((actualFlags & hiddenFlag) == hiddenFlag)
+ {
+ return true;
+ }
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
+// public static bool IsAccessor(this ISymbol symbol)
+// {
+// return symbol.IsPropertyAccessor() || symbol.IsEventAccessor();
+// }
+//
+// public static bool IsPropertyAccessor(this ISymbol symbol)
+// {
+// return (symbol as IMethodSymbol)?.MethodKind.IsPropertyAccessor() == true;
+// }
+
+ public static bool IsEventAccessor(this ISymbol symbol)
+ {
+ var method = symbol as IMethodSymbol;
+ return method != null &&
+ (method.MethodKind == MethodKind.EventAdd ||
+ method.MethodKind == MethodKind.EventRaise ||
+ method.MethodKind == MethodKind.EventRemove);
+ }
+
+ public static ITypeSymbol GetSymbolType(this ISymbol symbol)
+ {
+ var localSymbol = symbol as ILocalSymbol;
+ if (localSymbol != null)
+ {
+ return localSymbol.Type;
+ }
+
+ var fieldSymbol = symbol as IFieldSymbol;
+ if (fieldSymbol != null)
+ {
+ return fieldSymbol.Type;
+ }
+
+ var propertySymbol = symbol as IPropertySymbol;
+ if (propertySymbol != null)
+ {
+ return propertySymbol.Type;
+ }
+
+ var parameterSymbol = symbol as IParameterSymbol;
+ if (parameterSymbol != null)
+ {
+ return parameterSymbol.Type;
+ }
+
+ var aliasSymbol = symbol as IAliasSymbol;
+ if (aliasSymbol != null)
+ {
+ return aliasSymbol.Target as ITypeSymbol;
+ }
+
+ return symbol as ITypeSymbol;
+ }
+
+ /// <summary>
+ /// If the <paramref name="symbol"/> is a method symbol, returns True if the method's return type is "awaitable".
+ /// If the <paramref name="symbol"/> is a type symbol, returns True if that type is "awaitable".
+ /// An "awaitable" is any type that exposes a GetAwaiter method which returns a valid "awaiter". This GetAwaiter method may be an instance method or an extension method.
+ /// </summary>
+ public static bool IsAwaitable(this ISymbol symbol, SemanticModel semanticModel, int position)
+ {
+ IMethodSymbol methodSymbol = symbol as IMethodSymbol;
+ ITypeSymbol typeSymbol = null;
+
+ if (methodSymbol == null)
+ {
+ typeSymbol = symbol as ITypeSymbol;
+ if (typeSymbol == null)
+ {
+ return false;
+ }
+ }
+ else
+ {
+ if (methodSymbol.ReturnType == null)
+ {
+ return false;
+ }
+
+ // dynamic
+ if (methodSymbol.ReturnType.TypeKind == TypeKind.Dynamic &&
+ methodSymbol.MethodKind != MethodKind.BuiltinOperator)
+ {
+ return true;
+ }
+ }
+
+ // otherwise: needs valid GetAwaiter
+ var potentialGetAwaiters = semanticModel.LookupSymbols(position,
+ container: typeSymbol ?? methodSymbol.ReturnType.OriginalDefinition,
+ name: WellKnownMemberNames.GetAwaiter,
+ includeReducedExtensionMethods: true);
+ var getAwaiters = potentialGetAwaiters.OfType<IMethodSymbol>().Where(x => !x.Parameters.Any());
+ return getAwaiters.Any(VerifyGetAwaiter);
+ }
+
+ private static bool VerifyGetAwaiter(IMethodSymbol getAwaiter)
+ {
+ var returnType = getAwaiter.ReturnType;
+ if (returnType == null)
+ {
+ return false;
+ }
+
+ // bool IsCompleted { get }
+ if (!returnType.GetMembers().OfType<IPropertySymbol>().Any(p => p.Name == WellKnownMemberNames.IsCompleted && p.Type.SpecialType == SpecialType.System_Boolean && p.GetMethod != null))
+ {
+ return false;
+ }
+
+ var methods = returnType.GetMembers().OfType<IMethodSymbol>();
+
+ // NOTE: (vladres) The current version of C# Spec, §7.7.7.3 'Runtime evaluation of await expressions', requires that
+ // NOTE: the interface method INotifyCompletion.OnCompleted or ICriticalNotifyCompletion.UnsafeOnCompleted is invoked
+ // NOTE: (rather than any OnCompleted method conforming to a certain pattern).
+ // NOTE: Should this code be updated to match the spec?
+
+ // void OnCompleted(Action)
+ // Actions are delegates, so we'll just check for delegates.
+ if (!methods.Any(x => x.Name == WellKnownMemberNames.OnCompleted && x.ReturnsVoid && x.Parameters.Length == 1 && x.Parameters.First().Type.TypeKind == TypeKind.Delegate))
+ {
+ return false;
+ }
+
+ // void GetResult() || T GetResult()
+ return methods.Any(m => m.Name == WellKnownMemberNames.GetResult && !m.Parameters.Any());
+ }
+
+ public static IList<SymbolDisplayPart> ToAwaitableParts(this ISymbol symbol, string awaitKeyword, string initializedVariableName, SemanticModel semanticModel, int position)
+ {
+ var spacePart = new SymbolDisplayPart(SymbolDisplayPartKind.Space, null, " ");
+ var parts = new List<SymbolDisplayPart>();
+
+ parts.Add(new SymbolDisplayPart(SymbolDisplayPartKind.Text, null, "\r\nUsage:\r\n "));
+
+ var returnType = symbol.InferAwaitableReturnType(semanticModel, position);
+ returnType = returnType != null && returnType.SpecialType != SpecialType.System_Void ? returnType : null;
+ if (returnType != null)
+ {
+ if (semanticModel.Language == "C#")
+ {
+ parts.AddRange(returnType.ToMinimalDisplayParts(semanticModel, position));
+ parts.Add(spacePart);
+ parts.Add(new SymbolDisplayPart(SymbolDisplayPartKind.LocalName, null, initializedVariableName));
+ }
+ else
+ {
+ parts.Add(new SymbolDisplayPart(SymbolDisplayPartKind.Keyword, null, "Dim"));
+ parts.Add(spacePart);
+ parts.Add(new SymbolDisplayPart(SymbolDisplayPartKind.LocalName, null, initializedVariableName));
+ parts.Add(spacePart);
+ parts.Add(new SymbolDisplayPart(SymbolDisplayPartKind.Keyword, null, "as"));
+ parts.Add(spacePart);
+ parts.AddRange(returnType.ToMinimalDisplayParts(semanticModel, position));
+ }
+
+ parts.Add(spacePart);
+ parts.Add(new SymbolDisplayPart(SymbolDisplayPartKind.Punctuation, null, "="));
+ parts.Add(spacePart);
+ }
+
+ parts.Add(new SymbolDisplayPart(SymbolDisplayPartKind.Keyword, null, awaitKeyword));
+ parts.Add(spacePart);
+ parts.Add(new SymbolDisplayPart(SymbolDisplayPartKind.MethodName, symbol, symbol.Name));
+ parts.Add(new SymbolDisplayPart(SymbolDisplayPartKind.Punctuation, null, "("));
+ parts.Add(new SymbolDisplayPart(SymbolDisplayPartKind.Punctuation, null, symbol.GetParameters().Any() ? "..." : ""));
+ parts.Add(new SymbolDisplayPart(SymbolDisplayPartKind.Punctuation, null, ")"));
+ parts.Add(new SymbolDisplayPart(SymbolDisplayPartKind.Punctuation, null, semanticModel.Language == "C#" ? ";" : ""));
+
+ return parts;
+ }
+
+ public static ITypeSymbol InferAwaitableReturnType(this ISymbol symbol, SemanticModel semanticModel, int position)
+ {
+ var methodSymbol = symbol as IMethodSymbol;
+ if (methodSymbol == null)
+ {
+ return null;
+ }
+
+ var returnType = methodSymbol.ReturnType;
+ if (returnType == null)
+ {
+ return null;
+ }
+
+ var potentialGetAwaiters = semanticModel.LookupSymbols(position, container: returnType, name: WellKnownMemberNames.GetAwaiter, includeReducedExtensionMethods: true);
+ var getAwaiters = potentialGetAwaiters.OfType<IMethodSymbol>().Where(x => !x.Parameters.Any());
+ if (!getAwaiters.Any())
+ {
+ return null;
+ }
+
+ var getResults = getAwaiters.SelectMany(g => semanticModel.LookupSymbols(position, container: g.ReturnType, name: WellKnownMemberNames.GetResult));
+
+ var getResult = getResults.OfType<IMethodSymbol>().FirstOrDefault(g => !g.IsStatic);
+ if (getResult == null)
+ {
+ return null;
+ }
+
+ return getResult.ReturnType;
+ }
+
+ /// <summary>
+ /// First, remove symbols from the set if they are overridden by other symbols in the set.
+ /// If a symbol is overridden only by symbols outside of the set, then it is not removed.
+ /// This is useful for filtering out symbols that cannot be accessed in a given context due
+ /// to the existence of overriding members. Second, remove remaining symbols that are
+ /// unsupported (e.g. pointer types in VB) or not editor browsable based on the EditorBrowsable
+ /// attribute.
+ /// </summary>
+// public static IEnumerable<T> FilterToVisibleAndBrowsableSymbols<T>(this IEnumerable<T> symbols, bool hideAdvancedMembers, Compilation compilation) where T : ISymbol
+// {
+// symbols = symbols.RemoveOverriddenSymbolsWithinSet();
+//
+// // Since all symbols are from the same compilation, find the required attribute
+// // constructors once and reuse.
+//
+// var editorBrowsableAttributeConstructor = EditorBrowsableHelpers.GetSpecialEditorBrowsableAttributeConstructor(compilation);
+// var typeLibTypeAttributeConstructors = EditorBrowsableHelpers.GetSpecialTypeLibTypeAttributeConstructors(compilation);
+// var typeLibFuncAttributeConstructors = EditorBrowsableHelpers.GetSpecialTypeLibFuncAttributeConstructors(compilation);
+// var typeLibVarAttributeConstructors = EditorBrowsableHelpers.GetSpecialTypeLibVarAttributeConstructors(compilation);
+// var hideModuleNameAttribute = compilation.HideModuleNameAttribute();
+//
+// // PERF: HasUnsupportedMetadata may require recreating the syntax tree to get the base class, so first
+// // check to see if we're referencing a symbol defined in source.
+// Func<Location, bool> isSymbolDefinedInSource = l => l.IsInSource;
+// return symbols.Where(s =>
+// (s.Locations.Any(isSymbolDefinedInSource) || !s.HasUnsupportedMetadata) &&
+// !s.IsDestructor() &&
+// s.IsEditorBrowsable(
+// hideAdvancedMembers,
+// compilation,
+// editorBrowsableAttributeConstructor,
+// typeLibTypeAttributeConstructors,
+// typeLibFuncAttributeConstructors,
+// typeLibVarAttributeConstructors,
+// hideModuleNameAttribute));
+// }
+
+ private static IEnumerable<T> RemoveOverriddenSymbolsWithinSet<T>(this IEnumerable<T> symbols) where T : ISymbol
+ {
+ HashSet<ISymbol> overriddenSymbols = new HashSet<ISymbol>();
+
+ foreach (var symbol in symbols)
+ {
+ if (symbol.OverriddenMember() != null && !overriddenSymbols.Contains(symbol.OverriddenMember()))
+ {
+ overriddenSymbols.Add(symbol.OverriddenMember());
+ }
+ }
+
+ return symbols.Where(s => !overriddenSymbols.Contains(s));
+ }
+
+// public static IEnumerable<T> FilterToVisibleAndBrowsableSymbolsAndNotUnsafeSymbols<T>(this IEnumerable<T> symbols, bool hideAdvancedMembers, Compilation compilation) where T : ISymbol
+// {
+// return symbols.FilterToVisibleAndBrowsableSymbols(hideAdvancedMembers, compilation).Where(s => !s.IsUnsafe());
+// }
+ }
+
+ enum SymbolVisibility
+ {
+ Public,
+ Internal,
+ Private,
+ }
+
+} \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/Util/SymbolInfoExtensions.cs b/main/src/addins/CSharpBinding/Util/SymbolInfoExtensions.cs
new file mode 100644
index 0000000000..9e652103c7
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SymbolInfoExtensions.cs
@@ -0,0 +1,73 @@
+//
+// SymbolInfoExtensions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class SymbolInfoExtensions
+ {
+ public static IEnumerable<ISymbol> GetAllSymbols(this SymbolInfo info)
+ {
+ return GetAllSymbolsWorker(info).Distinct();
+ }
+
+ private static IEnumerable<ISymbol> GetAllSymbolsWorker(this SymbolInfo info)
+ {
+ if (info.Symbol != null)
+ {
+ yield return info.Symbol;
+ }
+
+ foreach (var symbol in info.CandidateSymbols)
+ {
+ yield return symbol;
+ }
+ }
+
+ public static ISymbol GetAnySymbol(this SymbolInfo info)
+ {
+ return info.GetAllSymbols().FirstOrDefault();
+ }
+
+ public static IEnumerable<ISymbol> GetBestOrAllSymbols(this SymbolInfo info)
+ {
+ if (info.Symbol != null)
+ {
+ return SpecializedCollections.SingletonEnumerable(info.Symbol);
+ }
+ else if (info.CandidateSymbols.Length > 0)
+ {
+ return info.CandidateSymbols;
+ }
+
+ return SpecializedCollections.EmptyEnumerable<ISymbol>();
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/SymbolKeyExtensions.cs b/main/src/addins/CSharpBinding/Util/SymbolKeyExtensions.cs
new file mode 100644
index 0000000000..c190298089
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SymbolKeyExtensions.cs
@@ -0,0 +1,151 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Threading;
+using System;
+using Microsoft.CodeAnalysis;
+using System.Reflection;
+using System.Collections.Immutable;
+using System.Runtime.ExceptionServices;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ class SymbolKey
+ {
+ readonly static Type typeInfo;
+
+ readonly object instance;
+
+ static SymbolKey ()
+ {
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.SymbolKey" + ReflectionNamespaces.WorkspacesAsmName, true);
+ resolveMethod = typeInfo.GetMethod ("Resolve", BindingFlags.Instance | BindingFlags.Public);
+ createMethod = typeInfo.GetMethod ("Create", BindingFlags.Static | BindingFlags.NonPublic);
+ }
+
+ SymbolKey (object instance)
+ {
+ this.instance = instance;
+ }
+
+ static MethodInfo createMethod;
+
+ /// <summary>
+ /// <para>
+ /// This entry point should only be called from the actual Symbol classes. It should not be
+ /// used internally inside this type. Instead, any time we need to get the <see cref="SymbolKey"/> for a
+ /// related symbol (i.e. the containing namespace of a namespace) we should call
+ /// GetOrCreate. The benefit of this is twofold. First of all, it keeps the size of the
+ /// <see cref="SymbolKey"/> small by allowing up to reuse parts we've already created. For example, if we
+ /// have the <see cref="SymbolKey"/> for <c>Foo(int, int)</c>, then we will reuse the <see cref="SymbolKey"/>s for both <c>int</c>s.
+ /// Second, this allows us to deal with the recursive nature of MethodSymbols and
+ /// TypeParameterSymbols. Specifically, a MethodSymbol is defined by its signature. However,
+ /// it's signature may refer to type parameters of that method. Unfortunately, the type
+ /// parameters depend on their containing method.
+ /// </para>
+ /// <para>
+ /// For example, if there is <c><![CDATA[Foo<T>(T t)]]></c>, then we must avoid the situation where we:
+ /// <list type="number">
+ /// <item>try to get the symbol ID for the type parameter <c>T</c>, which in turn</item>
+ /// <item>tries to get the symbol ID for the method <c>T</c>, which in turn</item>
+ /// <item>tries to get the symbol IDs for the parameter types, which in turn</item>
+ /// <item>tries to get the symbol ID for the type parameter <c>T</c>, which leads back to 1 and infinitely loops.</item>
+ /// </list>
+ /// </para>
+ /// <para>
+ /// In order to break this circularity we do not create the SymbolIDs for a method's type
+ /// parameters directly in the visitor. Instead, we create the SymbolID for the method
+ /// itself. When the MethodSymbolId is created it will directly instantiate the SymbolIDs
+ /// for the type parameters, and directly assign the type parameter's method ID to itself.
+ /// It will also then directly store the mapping from the type parameter to its SymbolID in
+ /// the visitor cache. Then when we try to create the symbol IDs for the parameter types,
+ /// any reference to the type parameters can be found in the cache.
+ /// </para>
+ /// <para>
+ /// It is for this reason that it is essential that all calls to get related symbol IDs goes
+ /// through GetOrCreate and not Create.
+ /// </para>
+ /// </summary>
+ internal static SymbolKey Create(ISymbol symbol, Compilation compilation = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ try {
+ var instance = createMethod.Invoke (null, new object [] { symbol, compilation, cancellationToken });
+ return new SymbolKey (instance);
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ static MethodInfo resolveMethod;
+
+ public SymbolKeyResolution Resolve(Compilation compilation, bool ignoreAssemblyKey = false, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ try {
+ return new SymbolKeyResolution (resolveMethod.Invoke (instance, new object[] { compilation, ignoreAssemblyKey, cancellationToken }));
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+ }
+
+ class SymbolKeyResolution
+ {
+ readonly static Type typeInfo;
+ readonly static PropertyInfo symbolProperty;
+ readonly static PropertyInfo candidateSymbolsProperty;
+ readonly static PropertyInfo candidateReasonProperty;
+
+ readonly object instance;
+
+
+ public ISymbol Symbol
+ {
+ get { return (ISymbol)symbolProperty.GetValue (instance); }
+ }
+
+ public ImmutableArray<ISymbol> CandidateSymbols
+ {
+ get { return (ImmutableArray<ISymbol>)candidateSymbolsProperty.GetValue (instance); }
+ }
+
+ public CandidateReason CandidateReason
+ {
+ get { return (CandidateReason)candidateReasonProperty.GetValue (instance); }
+ }
+
+ static SymbolKeyResolution ()
+ {
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.SymbolKeyResolution" + ReflectionNamespaces.WorkspacesAsmName, true);
+
+ symbolProperty = typeInfo.GetProperty ("Symbol");
+ candidateSymbolsProperty = typeInfo.GetProperty ("CandidateSymbols");
+ candidateReasonProperty = typeInfo.GetProperty ("CandidateReason");
+
+ }
+
+ public SymbolKeyResolution (object instance)
+ {
+ this.instance = instance;
+ }
+
+
+ }
+
+ static class SymbolKeyExtensions
+ {
+ public static SymbolKey GetSymbolKey(this ISymbol symbol)
+ {
+ return SymbolKey.Create(symbol, null, CancellationToken.None);
+ }
+
+ #if false
+ internal static SymbolKey GetSymbolKey(this ISymbol symbol, Compilation compilation, CancellationToken cancellationToken)
+ {
+ return SymbolKey.Create(symbol, compilation, cancellationToken);
+ }
+ #endif
+
+
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/SymbolKeyResolutionExtensions.cs b/main/src/addins/CSharpBinding/Util/SymbolKeyResolutionExtensions.cs
new file mode 100644
index 0000000000..6440394c02
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SymbolKeyResolutionExtensions.cs
@@ -0,0 +1,44 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class SymbolKeyResolutionExtensions
+ {
+ public static ISymbol GetAnySymbol(this SymbolKeyResolution resolution)
+ {
+ if (resolution.Symbol != null)
+ {
+ return resolution.Symbol;
+ }
+
+ if (resolution.CandidateSymbols.Length > 0)
+ {
+ return resolution.CandidateSymbols[0];
+ }
+
+ return null;
+ }
+
+ public static IEnumerable<ISymbol> GetAllSymbols(this SymbolKeyResolution resolution)
+ {
+ return GetAllSymbolsWorker(resolution).Distinct();
+ }
+
+ private static IEnumerable<ISymbol> GetAllSymbolsWorker(SymbolKeyResolution resolution)
+ {
+ if (resolution.Symbol != null)
+ {
+ yield return resolution.Symbol;
+ }
+
+ foreach (var symbol in resolution.CandidateSymbols)
+ {
+ yield return symbol;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/SyntacticDocument.cs b/main/src/addins/CSharpBinding/Util/SyntacticDocument.cs
new file mode 100644
index 0000000000..2d23878be4
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SyntacticDocument.cs
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ class SyntacticDocument
+ {
+ public readonly Document Document;
+ public readonly SourceText Text;
+ public readonly SyntaxTree SyntaxTree;
+ public readonly SyntaxNode Root;
+
+ protected SyntacticDocument(Document document, SourceText text, SyntaxTree tree, SyntaxNode root)
+ {
+ this.Document = document;
+ this.Text = text;
+ this.SyntaxTree = tree;
+ this.Root = root;
+ }
+
+ public Project Project
+ {
+ get { return this.Document.Project; }
+ }
+
+ public static async Task<SyntacticDocument> CreateAsync(Document document, CancellationToken cancellationToken)
+ {
+ var text = await document.GetTextAsync(cancellationToken).ConfigureAwait(false);
+ var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
+ return new SyntacticDocument(document, text, root.SyntaxTree, root);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/SyntaxContext.cs b/main/src/addins/CSharpBinding/Util/SyntaxContext.cs
new file mode 100644
index 0000000000..caa230fddc
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SyntaxContext.cs
@@ -0,0 +1,180 @@
+//
+// SyntaxContext.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
+using System.Threading;
+using Microsoft.CodeAnalysis.Simplification;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ class SyntaxContext
+ {
+ readonly CSharpSyntaxContext ctx;
+ readonly List<ITypeSymbol> inferredTypes;
+
+ public CSharpSyntaxContext CSharpSyntaxContext {
+ get {
+ return ctx;
+ }
+ }
+
+
+ public SemanticModel SemanticModel { get; internal set; }
+
+ public List<ITypeSymbol> InferredTypes {
+ get {
+ return inferredTypes;
+ }
+ }
+
+ public SyntaxToken LeftToken {
+ get {
+ return ctx.LeftToken;
+ }
+ }
+
+ public SyntaxToken TargetToken {
+ get {
+ return ctx.TargetToken;
+ }
+ }
+
+ public bool IsIsOrAsTypeContext {
+ get {
+ return ctx.IsIsOrAsTypeContext;
+ }
+ }
+
+ public bool IsInstanceContext {
+ get {
+ return ctx.IsInstanceContext;
+ }
+ }
+
+ public bool IsNonAttributeExpressionContext {
+ get {
+ return ctx.IsNonAttributeExpressionContext;
+ }
+ }
+
+ public bool IsPreProcessorKeywordContext {
+ get {
+ return ctx.IsPreProcessorKeywordContext;
+ }
+ }
+
+ public bool IsPreProcessorExpressionContext {
+ get {
+ return ctx.IsPreProcessorExpressionContext;
+ }
+ }
+
+ public TypeDeclarationSyntax ContainingTypeDeclaration {
+ get {
+ return ctx.ContainingTypeDeclaration;
+ }
+ }
+
+ public bool IsGlobalStatementContext {
+ get {
+ return ctx.IsGlobalStatementContext;
+ }
+ }
+
+ public bool IsParameterTypeContext {
+ get {
+ return ctx.IsParameterTypeContext;
+ }
+ }
+
+ public SyntaxTree SyntaxTree {
+ get {
+ return ctx.SyntaxTree;
+ }
+ }
+
+ public bool IsInsideNamingContext (bool isRightAfterIdentifier)
+ {
+ var parent = ctx.TargetToken.Parent;
+ if (isRightAfterIdentifier) {
+ return parent.IsKind(SyntaxKind.IdentifierName) ||
+ parent.IsKind(SyntaxKind.PredefinedType);
+ }
+ if (parent.IsKind(SyntaxKind.NamespaceDeclaration)) {
+ return !ctx.TargetToken.IsKind(SyntaxKind.OpenBraceToken);
+ }
+ return parent.IsKind(SyntaxKind.IdentifierName) && (
+ parent.Parent.IsKind(SyntaxKind.Parameter) ||
+ parent.Parent.IsKind(SyntaxKind.ArrayType) ||
+ parent.Parent.IsKind(SyntaxKind.VariableDeclaration) ||
+ parent.Parent.IsKind(SyntaxKind.ForEachStatement)
+ );
+ }
+
+ SyntaxContext(CSharpSyntaxContext ctx, List<ITypeSymbol> inferredTypes)
+ {
+ this.inferredTypes = inferredTypes;
+ this.ctx = ctx;
+ }
+
+ static readonly CSharpTypeInferenceService inferenceService = new CSharpTypeInferenceService ();
+
+ public static CSharpTypeInferenceService InferenceService {
+ get {
+ return inferenceService;
+ }
+ }
+
+ public static SyntaxContext Create(Workspace workspace, Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ return new SyntaxContext(
+ CSharpSyntaxContext.CreateContext(workspace, semanticModel, position, cancellationToken),
+ inferenceService.InferTypes(semanticModel, position, cancellationToken).ToList()
+ );
+ }
+
+ public ITypeSymbol GetCurrentType(SemanticModel semanticModel)
+ {
+ foreach (var f in semanticModel.Compilation.GlobalNamespace.GetMembers()) {
+ foreach (var loc in f.Locations) {
+ if (loc.SourceTree.FilePath == SyntaxTree.FilePath) {
+ if (loc.SourceSpan == ContainingTypeDeclaration.Identifier.Span) {
+ return f as ITypeSymbol;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/SyntaxExtensions.cs b/main/src/addins/CSharpBinding/Util/SyntaxExtensions.cs
new file mode 100644
index 0000000000..1b378e9479
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SyntaxExtensions.cs
@@ -0,0 +1,550 @@
+//
+// SyntaxExtensions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Simplification;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp.Utilities;
+using Microsoft.CodeAnalysis.Options;
+using Microsoft.CodeAnalysis.Rename.ConflictEngine;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Shared.Utilities;
+using Microsoft.CodeAnalysis.Simplification;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using System;
+using System.Reflection;
+using System.Collections.Immutable;
+using System.Runtime.ExceptionServices;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class SyntaxExtensions
+ {
+ readonly static MethodInfo canRemoveParenthesesMethod;
+// readonly static MethodInfo isLeftSideOfDotMethod;
+// readonly static MethodInfo isRightSideOfDotMethod;
+// readonly static MethodInfo getEnclosingNamedTypeMethod;
+ readonly static MethodInfo getLocalDeclarationMapMethod;
+ readonly static PropertyInfo localDeclarationMapIndexer;
+ readonly static MethodInfo getAncestorsMethod;
+
+ static SyntaxExtensions()
+ {
+ var typeInfo = Type.GetType("Microsoft.CodeAnalysis.CSharp.Extensions.ParenthesizedExpressionSyntaxExtensions" + ReflectionNamespaces.CSWorkspacesAsmName, true);
+ canRemoveParenthesesMethod = typeInfo.GetMethod("CanRemoveParentheses", new[] { typeof(ParenthesizedExpressionSyntax) });
+
+// typeInfo = Type.GetType("Microsoft.CodeAnalysis.CSharp.Extensions.ExpressionSyntaxExtensions" + ReflectionNamespaces.CSWorkspacesAsmName, true);
+// isLeftSideOfDotMethod = typeInfo.GetMethod("IsLeftSideOfDot", new[] { typeof(ExpressionSyntax) });
+// isRightSideOfDotMethod = typeInfo.GetMethod("IsRightSideOfDot", new[] { typeof(ExpressionSyntax) });
+//
+// typeInfo = Type.GetType("Microsoft.CodeAnalysis.Shared.Extensions.SemanticModelExtensions" + ReflectionNamespaces.WorkspacesAsmName, true);
+// getEnclosingNamedTypeMethod = typeInfo.GetMethod("GetEnclosingNamedType", new[] { typeof(SemanticModel), typeof(int), typeof(CancellationToken) });
+//
+ typeInfo = Type.GetType("Microsoft.CodeAnalysis.CSharp.Extensions.MemberDeclarationSyntaxExtensions" + ReflectionNamespaces.CSWorkspacesAsmName, true);
+ getLocalDeclarationMapMethod = typeInfo.GetMethod("GetLocalDeclarationMap", new[] { typeof(MemberDeclarationSyntax) });
+
+ typeInfo = Type.GetType("Microsoft.CodeAnalysis.CSharp.Extensions.MemberDeclarationSyntaxExtensions+LocalDeclarationMap" + ReflectionNamespaces.CSWorkspacesAsmName, true);
+ localDeclarationMapIndexer = typeInfo.GetProperties().Single(p => p.GetIndexParameters().Any());
+
+ typeInfo = Type.GetType("Microsoft.CodeAnalysis.Shared.Extensions.SyntaxTokenExtensions" + ReflectionNamespaces.WorkspacesAsmName, true);
+ getAncestorsMethod = typeInfo.GetMethods().Single(m => m.Name == "GetAncestors" && m.IsGenericMethod && m.GetParameters().Length == 1);
+ }
+
+
+ /// <summary>
+ /// Look inside a trivia list for a skipped token that contains the given position.
+ /// </summary>
+ private static readonly Func<SyntaxTriviaList, int, SyntaxToken> s_findSkippedTokenBackward =
+ (l, p) => FindTokenHelper.FindSkippedTokenBackward(GetSkippedTokens(l), p);
+
+ /// <summary>
+ /// return only skipped tokens
+ /// </summary>
+ private static IEnumerable<SyntaxToken> GetSkippedTokens(SyntaxTriviaList list)
+ {
+ return list.Where(trivia => trivia.RawKind == (int)SyntaxKind.SkippedTokensTrivia)
+ .SelectMany(t => ((SkippedTokensTriviaSyntax)t.GetStructure()).Tokens);
+ }
+
+ /// <summary>
+ /// If the position is inside of token, return that token; otherwise, return the token to the left.
+ /// </summary>
+ public static SyntaxToken FindTokenOnLeftOfPosition(
+ this SyntaxNode root,
+ int position,
+ bool includeSkipped = true,
+ bool includeDirectives = false,
+ bool includeDocumentationComments = false)
+ {
+ var skippedTokenFinder = includeSkipped ? s_findSkippedTokenBackward : (Func<SyntaxTriviaList, int, SyntaxToken>)null;
+
+ return FindTokenHelper.FindTokenOnLeftOfPosition<CompilationUnitSyntax>(
+ root, position, skippedTokenFinder, includeSkipped, includeDirectives, includeDocumentationComments);
+ }
+
+
+
+// public static bool IntersectsWith(this SyntaxToken token, int position)
+// {
+// return token.Span.IntersectsWith(position);
+// }
+
+// public static bool IsLeftSideOfDot(this ExpressionSyntax syntax)
+// {
+// return (bool)isLeftSideOfDotMethod.Invoke(null, new object[] { syntax });
+// }
+//
+// public static bool IsRightSideOfDot(this ExpressionSyntax syntax)
+// {
+// return (bool)isRightSideOfDotMethod.Invoke(null, new object[] { syntax });
+// }
+
+// public static INamedTypeSymbol GetEnclosingNamedType(this SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+// {
+// return (INamedTypeSymbol)getEnclosingNamedTypeMethod.Invoke(null, new object[] { semanticModel, position, cancellationToken });
+// }
+//
+ static ImmutableArray<SyntaxToken> GetLocalDeclarationMap(this MemberDeclarationSyntax member, string localName)
+ {
+ try {
+ object map = getLocalDeclarationMapMethod.Invoke(null, new object[] { member });
+ return (ImmutableArray<SyntaxToken>)localDeclarationMapIndexer.GetValue(map, new object[] { localName });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return ImmutableArray<SyntaxToken>.Empty;
+ }
+ }
+
+ static IEnumerable<T> GetAncestors<T>(this SyntaxToken token) where T : SyntaxNode
+ {
+ try {
+ return (IEnumerable<T>)getAncestorsMethod.MakeGenericMethod(typeof(T)).Invoke(null, new object[] { token });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ public static ExpressionSyntax SkipParens(this ExpressionSyntax expression)
+ {
+ if (expression == null)
+ return null;
+ while (expression != null && expression.IsKind(SyntaxKind.ParenthesizedExpression)) {
+ expression = ((ParenthesizedExpressionSyntax)expression).Expression;
+ }
+ return expression;
+ }
+
+ public static SyntaxNode SkipArgument(this SyntaxNode expression)
+ {
+ if (expression is ArgumentSyntax)
+ return ((ArgumentSyntax)expression).Expression;
+ return expression;
+ }
+
+ public static bool CanRemoveParentheses(this ParenthesizedExpressionSyntax node)
+ {
+ try {
+ return (bool)canRemoveParenthesesMethod.Invoke(null, new object[] { node });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return false;
+ }
+ }
+
+ public static bool IsParentKind(this SyntaxNode node, SyntaxKind kind)
+ {
+ return node != null && node.Parent.IsKind(kind);
+ }
+
+ public static bool IsParentKind(this SyntaxToken node, SyntaxKind kind)
+ {
+ return node.Parent != null && node.Parent.IsKind(kind);
+ }
+
+ public static bool CanReplaceWithReducedName(
+ this MemberAccessExpressionSyntax memberAccess,
+ ExpressionSyntax reducedName,
+ SemanticModel semanticModel,
+ CancellationToken cancellationToken)
+ {
+ if (!IsThisOrTypeOrNamespace(memberAccess, semanticModel)) {
+ return false;
+ }
+
+ var speculationAnalyzer = new SpeculationAnalyzer(memberAccess, reducedName, semanticModel, cancellationToken);
+ if (!speculationAnalyzer.SymbolsForOriginalAndReplacedNodesAreCompatible() ||
+ speculationAnalyzer.ReplacementChangesSemantics()) {
+ return false;
+ }
+
+ if (WillConflictWithExistingLocal(memberAccess, reducedName)) {
+ return false;
+ }
+
+ if (IsMemberAccessADynamicInvocation(memberAccess, semanticModel)) {
+ return false;
+ }
+
+ if (memberAccess.AccessMethodWithDynamicArgumentInsideStructConstructor(semanticModel)) {
+ return false;
+ }
+
+ if (memberAccess.Expression.Kind() == SyntaxKind.BaseExpression) {
+ var enclosingNamedType = semanticModel.GetEnclosingNamedType(memberAccess.SpanStart, cancellationToken);
+ var symbol = semanticModel.GetSymbolInfo(memberAccess.Name).Symbol;
+ if (enclosingNamedType != null &&
+ !enclosingNamedType.IsSealed &&
+ symbol != null &&
+ symbol.IsOverridable()) {
+ return false;
+ }
+ }
+
+ var invalidTransformation1 = ParserWouldTreatExpressionAsCast(reducedName, memberAccess);
+
+ return !invalidTransformation1;
+ }
+
+ internal static bool IsValidSymbolInfo(ISymbol symbol)
+ {
+ // name bound to only one symbol is valid
+ return symbol != null && !symbol.IsErrorType ();
+ }
+
+ private static bool IsThisOrTypeOrNamespace(MemberAccessExpressionSyntax memberAccess, SemanticModel semanticModel)
+ {
+ if (memberAccess.Expression.Kind() == SyntaxKind.ThisExpression) {
+ var previousToken = memberAccess.Expression.GetFirstToken().GetPreviousToken();
+
+ var symbol = semanticModel.GetSymbolInfo(memberAccess.Name).Symbol;
+
+ if (previousToken.Kind() == SyntaxKind.OpenParenToken &&
+ previousToken.IsParentKind(SyntaxKind.ParenthesizedExpression) &&
+ !previousToken.Parent.IsParentKind(SyntaxKind.ParenthesizedExpression) &&
+ ((ParenthesizedExpressionSyntax)previousToken.Parent).Expression.Kind() == SyntaxKind.SimpleMemberAccessExpression &&
+ symbol != null && symbol.Kind == SymbolKind.Method) {
+ return false;
+ }
+
+ return true;
+ }
+
+ var expressionInfo = semanticModel.GetSymbolInfo(memberAccess.Expression);
+ if (IsValidSymbolInfo(expressionInfo.Symbol)) {
+ if (expressionInfo.Symbol is INamespaceOrTypeSymbol) {
+ return true;
+ }
+
+ if (expressionInfo.Symbol.IsThisParameter()) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private static bool WillConflictWithExistingLocal(ExpressionSyntax expression, ExpressionSyntax simplifiedNode)
+ {
+ if (simplifiedNode.Kind() == SyntaxKind.IdentifierName && !SyntaxFacts.IsInNamespaceOrTypeContext(expression)) {
+ var identifierName = (IdentifierNameSyntax)simplifiedNode;
+ var enclosingDeclarationSpace = FindImmediatelyEnclosingLocalVariableDeclarationSpace(expression);
+ var enclosingMemberDeclaration = expression.FirstAncestorOrSelf<MemberDeclarationSyntax>();
+ if (enclosingDeclarationSpace != null && enclosingMemberDeclaration != null) {
+ var locals = enclosingMemberDeclaration.GetLocalDeclarationMap(identifierName.Identifier.ValueText);
+ foreach (var token in locals) {
+ if (GetAncestors<SyntaxNode>(token).Contains(enclosingDeclarationSpace)) {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
+ private static SyntaxNode FindImmediatelyEnclosingLocalVariableDeclarationSpace(SyntaxNode syntax)
+ {
+ for (var declSpace = syntax; declSpace != null; declSpace = declSpace.Parent) {
+ switch (declSpace.Kind()) {
+ // These are declaration-space-defining syntaxes, by the spec:
+ case SyntaxKind.MethodDeclaration:
+ case SyntaxKind.IndexerDeclaration:
+ case SyntaxKind.OperatorDeclaration:
+ case SyntaxKind.ConstructorDeclaration:
+ case SyntaxKind.Block:
+ case SyntaxKind.ParenthesizedLambdaExpression:
+ case SyntaxKind.SimpleLambdaExpression:
+ case SyntaxKind.AnonymousMethodExpression:
+ case SyntaxKind.SwitchStatement:
+ case SyntaxKind.ForEachKeyword:
+ case SyntaxKind.ForStatement:
+ case SyntaxKind.UsingStatement:
+
+ // SPEC VIOLATION: We also want to stop walking out if, say, we are in a field
+ // initializer. Technically according to the wording of the spec it should be
+ // legal to use a simple name inconsistently inside a field initializer because
+ // it does not define a local variable declaration space. In practice of course
+ // we want to check for that. (As the native compiler does as well.)
+
+ case SyntaxKind.FieldDeclaration:
+ return declSpace;
+ }
+ }
+
+ return null;
+ }
+
+ private static bool ParserWouldTreatExpressionAsCast(ExpressionSyntax reducedNode, MemberAccessExpressionSyntax originalNode)
+ {
+ SyntaxNode parent = originalNode;
+ while (parent != null) {
+ if (parent.IsParentKind(SyntaxKind.SimpleMemberAccessExpression)) {
+ parent = parent.Parent;
+ continue;
+ }
+
+ if (!parent.IsParentKind(SyntaxKind.ParenthesizedExpression)) {
+ return false;
+ }
+
+ break;
+ }
+
+ var newExpression = parent.ReplaceNode((SyntaxNode)originalNode, reducedNode);
+
+ // detect cast ambiguities according to C# spec #7.7.6
+ if (IsNameOrMemberAccessButNoExpression(newExpression)) {
+ var nextToken = parent.Parent.GetLastToken().GetNextToken();
+
+ return nextToken.Kind() == SyntaxKind.OpenParenToken ||
+ nextToken.Kind() == SyntaxKind.TildeToken ||
+ nextToken.Kind() == SyntaxKind.ExclamationToken ||
+ (SyntaxFacts.IsKeywordKind(nextToken.Kind()) && !(nextToken.Kind() == SyntaxKind.AsKeyword || nextToken.Kind() == SyntaxKind.IsKeyword));
+ }
+
+ return false;
+ }
+
+ private static bool IsMemberAccessADynamicInvocation(MemberAccessExpressionSyntax memberAccess, SemanticModel semanticModel)
+ {
+ var ancestorInvocation = memberAccess.FirstAncestorOrSelf<InvocationExpressionSyntax>();
+
+ if (ancestorInvocation != null && ancestorInvocation.SpanStart == memberAccess.SpanStart) {
+ var typeInfo = semanticModel.GetTypeInfo(ancestorInvocation);
+ if (typeInfo.Type != null &&
+ typeInfo.Type.Kind == SymbolKind.DynamicType) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private static bool IsNameOrMemberAccessButNoExpression(SyntaxNode node)
+ {
+ if (node.IsKind(SyntaxKind.SimpleMemberAccessExpression)) {
+ var memberAccess = (MemberAccessExpressionSyntax)node;
+
+ return memberAccess.Expression.IsKind(SyntaxKind.IdentifierName) ||
+ IsNameOrMemberAccessButNoExpression(memberAccess.Expression);
+ }
+
+ return node.IsKind(SyntaxKind.IdentifierName);
+ }
+
+ private static bool AccessMethodWithDynamicArgumentInsideStructConstructor(this MemberAccessExpressionSyntax memberAccess, SemanticModel semanticModel)
+ {
+ var constructor = memberAccess.Ancestors().OfType<ConstructorDeclarationSyntax>().SingleOrDefault();
+
+ if (constructor == null || constructor.Parent.Kind() != SyntaxKind.StructDeclaration) {
+ return false;
+ }
+
+ return semanticModel.GetSymbolInfo(memberAccess.Name).CandidateReason == CandidateReason.LateBound;
+ }
+
+
+ public static bool CanReplaceWithReducedName(this NameSyntax name, TypeSyntax reducedName, SemanticModel semanticModel, CancellationToken cancellationToken)
+ {
+ var speculationAnalyzer = new SpeculationAnalyzer(name, reducedName, semanticModel, cancellationToken);
+ if (speculationAnalyzer.ReplacementChangesSemantics())
+ {
+ return false;
+ }
+
+ return CanReplaceWithReducedNameInContext(name, reducedName, semanticModel, cancellationToken);
+ }
+
+ private static bool CanReplaceWithReducedNameInContext(this NameSyntax name, TypeSyntax reducedName, SemanticModel semanticModel, CancellationToken cancellationToken)
+ {
+ // Special case. if this new minimal name parses out to a predefined type, then we
+ // have to make sure that we're not in a using alias. That's the one place where the
+ // language doesn't allow predefined types. You have to use the fully qualified name
+ // instead.
+ var invalidTransformation1 = IsNonNameSyntaxInUsingDirective(name, reducedName);
+ var invalidTransformation2 = WillConflictWithExistingLocal(name, reducedName);
+ var invalidTransformation3 = IsAmbiguousCast(name, reducedName);
+ var invalidTransformation4 = IsNullableTypeInPointerExpression(name, reducedName);
+ var isNotNullableReplacable = name.IsNotNullableReplacable(reducedName);
+
+ if (invalidTransformation1 || invalidTransformation2 || invalidTransformation3 || invalidTransformation4
+ || isNotNullableReplacable)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ private static bool IsNullableTypeInPointerExpression(ExpressionSyntax expression, ExpressionSyntax simplifiedNode)
+ {
+ // Note: nullable type syntax is not allowed in pointer type syntax
+ if (simplifiedNode.Kind() == SyntaxKind.NullableType &&
+ simplifiedNode.DescendantNodes().Any(n => n is PointerTypeSyntax))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ private static bool IsAmbiguousCast(ExpressionSyntax expression, ExpressionSyntax simplifiedNode)
+ {
+ // Can't simplify a type name in a cast expression if it would then cause the cast to be
+ // parsed differently. For example: (Foo::Bar)+1 is a cast. But if that simplifies to
+ // (Bar)+1 then that's an arithmetic expression.
+ if (expression.IsParentKind(SyntaxKind.CastExpression))
+ {
+ var castExpression = (CastExpressionSyntax)expression.Parent;
+ if (castExpression.Type == expression)
+ {
+ var newCastExpression = castExpression.ReplaceNode((SyntaxNode)castExpression.Type, simplifiedNode);
+ var reparsedCastExpression = SyntaxFactory.ParseExpression(newCastExpression.ToString());
+
+ if (!reparsedCastExpression.IsKind(SyntaxKind.CastExpression))
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+ private static bool IsNonNameSyntaxInUsingDirective(ExpressionSyntax expression, ExpressionSyntax simplifiedNode)
+ {
+ return
+ expression.IsParentKind(SyntaxKind.UsingDirective) &&
+ !(simplifiedNode is NameSyntax);
+ }
+
+ private static bool IsNotNullableReplacable(this NameSyntax name, TypeSyntax reducedName)
+ {
+ var isNotNullableReplacable = false;
+ // var isLeftSideOfDot = name.IsLeftSideOfDot();
+ // var isRightSideOfDot = name.IsRightSideOfDot();
+
+ if (reducedName.Kind() == SyntaxKind.NullableType)
+ {
+ if (((NullableTypeSyntax)reducedName).ElementType.Kind() == SyntaxKind.OmittedTypeArgument)
+ {
+ isNotNullableReplacable = true;
+ }
+ else
+ {
+ isNotNullableReplacable = name.IsLeftSideOfDot() || name.IsRightSideOfDot();
+ }
+ }
+
+ return isNotNullableReplacable;
+ }
+
+ public static SyntaxTokenList GetModifiers (this MemberDeclarationSyntax member)
+ {
+ if (member == null)
+ throw new ArgumentNullException("member");
+ var method = member as BaseMethodDeclarationSyntax;
+ if (method != null)
+ return method.Modifiers;
+ var property = member as BasePropertyDeclarationSyntax;
+ if (property != null)
+ return property.Modifiers;
+ var field = member as BaseFieldDeclarationSyntax;
+ if (field != null)
+ return field.Modifiers;
+ return new SyntaxTokenList ();
+ }
+
+ public static ExplicitInterfaceSpecifierSyntax GetExplicitInterfaceSpecifierSyntax (this MemberDeclarationSyntax member)
+ {
+ if (member == null)
+ throw new ArgumentNullException("member");
+ var method = member as MethodDeclarationSyntax;
+ if (method != null)
+ return method.ExplicitInterfaceSpecifier;
+ var property = member as BasePropertyDeclarationSyntax;
+ if (property != null)
+ return property.ExplicitInterfaceSpecifier;
+ var evt = member as EventDeclarationSyntax;
+ if (evt != null)
+ return evt.ExplicitInterfaceSpecifier;
+ return null;
+ }
+// public static bool IsKind(this SyntaxToken token, SyntaxKind kind)
+// {
+// return token.RawKind == (int)kind;
+// }
+//
+// public static bool IsKind(this SyntaxTrivia trivia, SyntaxKind kind)
+// {
+// return trivia.RawKind == (int)kind;
+// }
+//
+// public static bool IsKind(this SyntaxNode node, SyntaxKind kind)
+// {
+// return node?.RawKind == (int)kind;
+// }
+//
+// public static bool IsKind(this SyntaxNodeOrToken nodeOrToken, SyntaxKind kind)
+// {
+// return nodeOrToken.RawKind == (int)kind;
+// }
+//
+
+// public static SyntaxNode GetParent(this SyntaxNode node)
+// {
+// return node != null ? node.Parent : null;
+// }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/SyntaxKindSet.cs b/main/src/addins/CSharpBinding/Util/SyntaxKindSet.cs
new file mode 100644
index 0000000000..158a7dea36
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SyntaxKindSet.cs
@@ -0,0 +1,112 @@
+//
+// SyntaxKindSet.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis.CSharp;
+using System.Collections.Generic;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class SyntaxKindSet
+ {
+ public static readonly ISet<SyntaxKind> AllTypeModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.AbstractKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.NewKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.SealedKeyword,
+ SyntaxKind.StaticKeyword,
+ SyntaxKind.UnsafeKeyword
+ };
+
+ public static readonly ISet<SyntaxKind> AllMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.AbstractKeyword,
+ SyntaxKind.AsyncKeyword,
+ SyntaxKind.ExternKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.NewKeyword,
+ SyntaxKind.OverrideKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.ProtectedKeyword,
+ SyntaxKind.ReadOnlyKeyword,
+ SyntaxKind.SealedKeyword,
+ SyntaxKind.StaticKeyword,
+ SyntaxKind.UnsafeKeyword,
+ SyntaxKind.VirtualKeyword,
+ SyntaxKind.VolatileKeyword,
+ };
+
+ public static readonly ISet<SyntaxKind> AllGlobalMemberModifiers = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.ExternKeyword,
+ SyntaxKind.InternalKeyword,
+ SyntaxKind.NewKeyword,
+ SyntaxKind.OverrideKeyword,
+ SyntaxKind.PublicKeyword,
+ SyntaxKind.PrivateKeyword,
+ SyntaxKind.ReadOnlyKeyword,
+ SyntaxKind.StaticKeyword,
+ SyntaxKind.UnsafeKeyword,
+ SyntaxKind.VolatileKeyword,
+ };
+
+ public static readonly ISet<SyntaxKind> AllTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.InterfaceDeclaration,
+ SyntaxKind.ClassDeclaration,
+ SyntaxKind.StructDeclaration,
+ SyntaxKind.EnumDeclaration
+ };
+
+ public static readonly ISet<SyntaxKind> ClassInterfaceStructTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.InterfaceDeclaration,
+ SyntaxKind.ClassDeclaration,
+ SyntaxKind.StructDeclaration,
+ };
+
+ public static readonly ISet<SyntaxKind> ClassStructTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.ClassDeclaration,
+ SyntaxKind.StructDeclaration,
+ };
+
+ public static readonly ISet<SyntaxKind> ClassOnlyTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.ClassDeclaration,
+ };
+
+ public static readonly ISet<SyntaxKind> StructOnlyTypeDeclarations = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer)
+ {
+ SyntaxKind.StructDeclaration,
+ };
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/SyntaxListExtension.cs b/main/src/addins/CSharpBinding/Util/SyntaxListExtension.cs
new file mode 100644
index 0000000000..034fb840f7
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SyntaxListExtension.cs
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class SyntaxListExtensions
+ {
+ public static SyntaxList<T> RemoveRange<T>(this SyntaxList<T> syntaxList, int index, int count) where T : SyntaxNode
+ {
+ var result = new List<T>(syntaxList);
+ result.RemoveRange(index, count);
+ return SyntaxFactory.List(result);
+ }
+
+ public static SyntaxList<T> ToSyntaxList<T>(this IEnumerable<T> sequence) where T : SyntaxNode
+ {
+ return SyntaxFactory.List(sequence);
+ }
+
+ public static SyntaxList<T> Insert<T>(this SyntaxList<T> list, int index, T item) where T : SyntaxNode
+ {
+ return list.Take(index).Concat(new T[] { item } ).Concat(list.Skip(index)).ToSyntaxList();
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/SyntaxNodeExtensions.cs b/main/src/addins/CSharpBinding/Util/SyntaxNodeExtensions.cs
new file mode 100644
index 0000000000..dba318122c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SyntaxNodeExtensions.cs
@@ -0,0 +1,1721 @@
+//
+// SyntaxNodeExtensions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Collections;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Shared.Utilities;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using System.Threading.Tasks;
+using System.Reflection;
+using System.Runtime.ExceptionServices;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static partial class SyntaxNodeExtensions
+ {
+ public static IEnumerable<SyntaxNodeOrToken> DepthFirstTraversal(this SyntaxNode node)
+ {
+ return CommonSyntaxNodeOrTokenExtensions.DepthFirstTraversal(node);
+ }
+
+ public static IEnumerable<SyntaxNode> GetAncestors(this SyntaxNode node)
+ {
+ var current = node.Parent;
+
+ while (current != null)
+ {
+ yield return current;
+
+ current = current is IStructuredTriviaSyntax
+ ? ((IStructuredTriviaSyntax)current).ParentTrivia.Token.Parent
+ : current.Parent;
+ }
+ }
+
+ public static IEnumerable<TNode> GetAncestors<TNode>(this SyntaxNode node)
+ where TNode : SyntaxNode
+ {
+ var current = node.Parent;
+ while (current != null)
+ {
+ if (current is TNode)
+ {
+ yield return (TNode)current;
+ }
+
+ current = current is IStructuredTriviaSyntax
+ ? ((IStructuredTriviaSyntax)current).ParentTrivia.Token.Parent
+ : current.Parent;
+ }
+ }
+
+ public static TNode GetAncestor<TNode>(this SyntaxNode node)
+ where TNode : SyntaxNode
+ {
+ if (node == null)
+ {
+ return default(TNode);
+ }
+
+ return node.GetAncestors<TNode>().FirstOrDefault();
+ }
+
+ public static TNode GetAncestorOrThis<TNode>(this SyntaxNode node)
+ where TNode : SyntaxNode
+ {
+ if (node == null)
+ {
+ return default(TNode);
+ }
+
+ return node.GetAncestorsOrThis<TNode>().FirstOrDefault();
+ }
+
+ public static IEnumerable<TNode> GetAncestorsOrThis<TNode>(this SyntaxNode node)
+ where TNode : SyntaxNode
+ {
+ var current = node;
+ while (current != null)
+ {
+ if (current is TNode)
+ {
+ yield return (TNode)current;
+ }
+
+ current = current is IStructuredTriviaSyntax
+ ? ((IStructuredTriviaSyntax)current).ParentTrivia.Token.Parent
+ : current.Parent;
+ }
+ }
+
+ public static bool HasAncestor<TNode>(this SyntaxNode node)
+ where TNode : SyntaxNode
+ {
+ return node.GetAncestors<TNode>().Any();
+ }
+
+ public static IEnumerable<TSyntaxNode> Traverse<TSyntaxNode>(
+ this SyntaxNode node, TextSpan searchSpan, Func<SyntaxNode, bool> predicate)
+ where TSyntaxNode : SyntaxNode
+ {
+ // Contract.ThrowIfNull(node);
+
+ var nodes = new LinkedList<SyntaxNode>();
+ nodes.AddFirst(node);
+
+ while (nodes.Count > 0)
+ {
+ var currentNode = nodes.First.Value;
+ nodes.RemoveFirst();
+
+ if (currentNode != null && searchSpan.Contains(currentNode.FullSpan) && predicate(currentNode))
+ {
+ if (currentNode is TSyntaxNode)
+ {
+ yield return (TSyntaxNode)currentNode;
+ }
+
+ nodes.AddRangeAtHead(currentNode.ChildNodes());
+ }
+ }
+ }
+
+ public static bool CheckParent<T>(this SyntaxNode node, Func<T, bool> valueChecker) where T : SyntaxNode
+ {
+ if (node == null)
+ {
+ return false;
+ }
+
+ var parentNode = node.Parent as T;
+ if (parentNode == null)
+ {
+ return false;
+ }
+
+ return valueChecker(parentNode);
+ }
+
+ /// <summary>
+ /// Returns true if is a given token is a child token of of a certain type of parent node.
+ /// </summary>
+ /// <typeparam name="TParent">The type of the parent node.</typeparam>
+ /// <param name="node">The node that we are testing.</param>
+ /// <param name="childGetter">A function that, when given the parent node, returns the child token we are interested in.</param>
+ public static bool IsChildNode<TParent>(this SyntaxNode node, Func<TParent, SyntaxNode> childGetter)
+ where TParent : SyntaxNode
+ {
+ var ancestor = node.GetAncestor<TParent>();
+ if (ancestor == null)
+ {
+ return false;
+ }
+
+ var ancestorNode = childGetter(ancestor);
+
+ return node == ancestorNode;
+ }
+
+ /// <summary>
+ /// Returns true if this node is found underneath the specified child in the given parent.
+ /// </summary>
+ public static bool IsFoundUnder<TParent>(this SyntaxNode node, Func<TParent, SyntaxNode> childGetter)
+ where TParent : SyntaxNode
+ {
+ var ancestor = node.GetAncestor<TParent>();
+ if (ancestor == null)
+ {
+ return false;
+ }
+
+ var child = childGetter(ancestor);
+
+ // See if node passes through child on the way up to ancestor.
+ return node.GetAncestorsOrThis<SyntaxNode>().Contains(child);
+ }
+
+ public static SyntaxNode GetCommonRoot(this SyntaxNode node1, SyntaxNode node2)
+ {
+ //Contract.ThrowIfTrue(node1.RawKind == 0 || node2.RawKind == 0);
+
+ // find common starting node from two nodes.
+ // as long as two nodes belong to same tree, there must be at least one common root (Ex, compilation unit)
+ var ancestors = node1.GetAncestorsOrThis<SyntaxNode>();
+ var set = new HashSet<SyntaxNode>(node2.GetAncestorsOrThis<SyntaxNode>());
+
+ return ancestors.First(set.Contains);
+ }
+
+ public static int Width(this SyntaxNode node)
+ {
+ return node.Span.Length;
+ }
+
+ public static int FullWidth(this SyntaxNode node)
+ {
+ return node.FullSpan.Length;
+ }
+
+ public static SyntaxNode FindInnermostCommonNode(
+ this IEnumerable<SyntaxNode> nodes,
+ Func<SyntaxNode, bool> predicate)
+ {
+ IEnumerable<SyntaxNode> blocks = null;
+ foreach (var node in nodes)
+ {
+ blocks = blocks == null
+ ? node.AncestorsAndSelf().Where(predicate)
+ : blocks.Intersect(node.AncestorsAndSelf().Where(predicate));
+ }
+
+ return blocks == null ? null : blocks.First();
+ }
+
+ public static TSyntaxNode FindInnermostCommonNode<TSyntaxNode>(this IEnumerable<SyntaxNode> nodes)
+ where TSyntaxNode : SyntaxNode
+ {
+ return (TSyntaxNode)nodes.FindInnermostCommonNode(n => n is TSyntaxNode);
+ }
+
+ /// <summary>
+ /// create a new root node from the given root after adding annotations to the tokens
+ ///
+ /// tokens should belong to the given root
+ /// </summary>
+ public static SyntaxNode AddAnnotations(this SyntaxNode root, IEnumerable<Tuple<SyntaxToken, SyntaxAnnotation>> pairs)
+ {
+// Contract.ThrowIfNull(root);
+// Contract.ThrowIfNull(pairs);
+
+ var tokenMap = pairs.GroupBy(p => p.Item1, p => p.Item2).ToDictionary(g => g.Key, g => g.ToArray());
+ return root.ReplaceTokens(tokenMap.Keys, (o, n) => o.WithAdditionalAnnotations(tokenMap[o]));
+ }
+
+ /// <summary>
+ /// create a new root node from the given root after adding annotations to the nodes
+ ///
+ /// nodes should belong to the given root
+ /// </summary>
+ public static SyntaxNode AddAnnotations(this SyntaxNode root, IEnumerable<Tuple<SyntaxNode, SyntaxAnnotation>> pairs)
+ {
+// Contract.ThrowIfNull(root);
+// Contract.ThrowIfNull(pairs);
+
+ var tokenMap = pairs.GroupBy(p => p.Item1, p => p.Item2).ToDictionary(g => g.Key, g => g.ToArray());
+ return root.ReplaceNodes(tokenMap.Keys, (o, n) => o.WithAdditionalAnnotations(tokenMap[o]));
+ }
+
+ public static TextSpan GetContainedSpan(this IEnumerable<SyntaxNode> nodes)
+ {
+// Contract.ThrowIfNull(nodes);
+// Contract.ThrowIfFalse(nodes.Any());
+
+ TextSpan fullSpan = nodes.First().Span;
+ foreach (var node in nodes)
+ {
+ fullSpan = TextSpan.FromBounds(
+ Math.Min(fullSpan.Start, node.SpanStart),
+ Math.Max(fullSpan.End, node.Span.End));
+ }
+
+ return fullSpan;
+ }
+
+ public static IEnumerable<TextSpan> GetContiguousSpans(
+ this IEnumerable<SyntaxNode> nodes, Func<SyntaxNode, SyntaxToken> getLastToken = null)
+ {
+ SyntaxNode lastNode = null;
+ TextSpan? textSpan = null;
+ foreach (var node in nodes)
+ {
+ if (lastNode == null)
+ {
+ textSpan = node.Span;
+ }
+ else
+ {
+ var lastToken = getLastToken == null
+ ? lastNode.GetLastToken()
+ : getLastToken(lastNode);
+ if (lastToken.GetNextToken(includeDirectives: true) == node.GetFirstToken())
+ {
+ // Expand the span
+ textSpan = TextSpan.FromBounds(textSpan.Value.Start, node.Span.End);
+ }
+ else
+ {
+ // Return the last span, and start a new one
+ yield return textSpan.Value;
+ textSpan = node.Span;
+ }
+ }
+
+ lastNode = node;
+ }
+
+ if (textSpan.HasValue)
+ {
+ yield return textSpan.Value;
+ }
+ }
+
+ public static bool OverlapsHiddenPosition(this SyntaxNode node, CancellationToken cancellationToken)
+ {
+ return node.OverlapsHiddenPosition(node.Span, cancellationToken);
+ }
+
+ public static bool OverlapsHiddenPosition(this SyntaxNode node, TextSpan span, CancellationToken cancellationToken)
+ {
+ return node.SyntaxTree.OverlapsHiddenPosition(span, cancellationToken);
+ }
+
+ public static bool OverlapsHiddenPosition(this SyntaxNode declaration, SyntaxNode startNode, SyntaxNode endNode, CancellationToken cancellationToken)
+ {
+ var start = startNode.Span.End;
+ var end = endNode.SpanStart;
+
+ var textSpan = TextSpan.FromBounds(start, end);
+ return declaration.OverlapsHiddenPosition(textSpan, cancellationToken);
+ }
+
+ public static IEnumerable<T> GetAnnotatedNodes<T>(this SyntaxNode node, SyntaxAnnotation syntaxAnnotation) where T : SyntaxNode
+ {
+ return node.GetAnnotatedNodesAndTokens(syntaxAnnotation).Select(n => n.AsNode()).OfType<T>();
+ }
+
+ /// <summary>
+ /// Creates a new tree of nodes from the existing tree with the specified old nodes replaced with a newly computed nodes.
+ /// </summary>
+ /// <param name="root">The root of the tree that contains all the specified nodes.</param>
+ /// <param name="nodes">The nodes from the tree to be replaced.</param>
+ /// <param name="computeReplacementAsync">A function that computes a replacement node for
+ /// the argument nodes. The first argument is one of the original specified nodes. The second argument is
+ /// the same node possibly rewritten with replaced descendants.</param>
+ /// <param name="cancellationToken"></param>
+ public static Task<TRootNode> ReplaceNodesAsync<TRootNode>(
+ this TRootNode root,
+ IEnumerable<SyntaxNode> nodes,
+ Func<SyntaxNode, SyntaxNode, CancellationToken, Task<SyntaxNode>> computeReplacementAsync,
+ CancellationToken cancellationToken) where TRootNode : SyntaxNode
+ {
+ return root.ReplaceSyntaxAsync(
+ nodes: nodes, computeReplacementNodeAsync: computeReplacementAsync,
+ tokens: null, computeReplacementTokenAsync: null,
+ trivia: null, computeReplacementTriviaAsync: null,
+ cancellationToken: cancellationToken);
+ }
+
+// /// <summary>
+// /// Creates a new tree of tokens from the existing tree with the specified old tokens replaced with a newly computed tokens.
+// /// </summary>
+// /// <param name="root">The root of the tree that contains all the specified tokens.</param>
+// /// <param name="tokens">The tokens from the tree to be replaced.</param>
+// /// <param name="computeReplacementAsync">A function that computes a replacement token for
+// /// the argument tokens. The first argument is one of the originally specified tokens. The second argument is
+// /// the same token possibly rewritten with replaced trivia.</param>
+// /// <param name="cancellationToken"></param>
+// public static Task<TRootNode> ReplaceTokensAsync<TRootNode>(
+// this TRootNode root,
+// IEnumerable<SyntaxToken> tokens,
+// Func<SyntaxToken, SyntaxToken, CancellationToken, Task<SyntaxToken>> computeReplacementAsync,
+// CancellationToken cancellationToken) where TRootNode : SyntaxNode
+// {
+// return root.ReplaceSyntaxAsync(
+// nodes: null, computeReplacementNodeAsync: null,
+// tokens: tokens, computeReplacementTokenAsync: computeReplacementAsync,
+// trivia: null, computeReplacementTriviaAsync: null,
+// cancellationToken: cancellationToken);
+// }
+//
+// public static Task<TRoot> ReplaceTriviaAsync<TRoot>(
+// this TRoot root,
+// IEnumerable<SyntaxTrivia> trivia,
+// Func<SyntaxTrivia, SyntaxTrivia, CancellationToken, Task<SyntaxTrivia>> computeReplacementAsync,
+// CancellationToken cancellationToken) where TRoot : SyntaxNode
+// {
+// return root.ReplaceSyntaxAsync(
+// nodes: null, computeReplacementNodeAsync: null,
+// tokens: null, computeReplacementTokenAsync: null,
+// trivia: trivia, computeReplacementTriviaAsync: computeReplacementAsync,
+// cancellationToken: cancellationToken);
+// }
+
+ public static async Task<TRoot> ReplaceSyntaxAsync<TRoot>(
+ this TRoot root,
+ IEnumerable<SyntaxNode> nodes,
+ Func<SyntaxNode, SyntaxNode, CancellationToken, Task<SyntaxNode>> computeReplacementNodeAsync,
+ IEnumerable<SyntaxToken> tokens,
+ Func<SyntaxToken, SyntaxToken, CancellationToken, Task<SyntaxToken>> computeReplacementTokenAsync,
+ IEnumerable<SyntaxTrivia> trivia,
+ Func<SyntaxTrivia, SyntaxTrivia, CancellationToken, Task<SyntaxTrivia>> computeReplacementTriviaAsync,
+ CancellationToken cancellationToken)
+ where TRoot : SyntaxNode
+ {
+ // index all nodes, tokens and trivia by the full spans they cover
+ var nodesToReplace = nodes != null ? nodes.ToDictionary(n => n.FullSpan) : new Dictionary<TextSpan, SyntaxNode>();
+ var tokensToReplace = tokens != null ? tokens.ToDictionary(t => t.FullSpan) : new Dictionary<TextSpan, SyntaxToken>();
+ var triviaToReplace = trivia != null ? trivia.ToDictionary(t => t.FullSpan) : new Dictionary<TextSpan, SyntaxTrivia>();
+
+ var nodeReplacements = new Dictionary<SyntaxNode, SyntaxNode>();
+ var tokenReplacements = new Dictionary<SyntaxToken, SyntaxToken>();
+ var triviaReplacements = new Dictionary<SyntaxTrivia, SyntaxTrivia>();
+
+ var retryAnnotations = new AnnotationTable<object>("RetryReplace");
+
+ var spans = new List<TextSpan>(nodesToReplace.Count + tokensToReplace.Count + triviaToReplace.Count);
+ spans.AddRange(nodesToReplace.Keys);
+ spans.AddRange(tokensToReplace.Keys);
+ spans.AddRange(triviaToReplace.Keys);
+
+ while (spans.Count > 0)
+ {
+ // sort the spans of the items to be replaced so we can tell if any overlap
+ spans.Sort((x, y) =>
+ {
+ // order by end offset, and then by length
+ var d = x.End - y.End;
+
+ if (d == 0)
+ {
+ d = x.Length - y.Length;
+ }
+
+ return d;
+ });
+
+ // compute replacements for all nodes that will go in the same batch
+ // only spans that do not overlap go in the same batch.
+ TextSpan previous = default(TextSpan);
+ foreach (var span in spans)
+ {
+ // only add to replacement map if we don't intersect with the previous node. This taken with the sort order
+ // should ensure that parent nodes are not processed in the same batch as child nodes.
+ if (previous == default(TextSpan) || !previous.IntersectsWith(span))
+ {
+ SyntaxNode currentNode;
+ SyntaxToken currentToken;
+ SyntaxTrivia currentTrivia;
+
+ if (nodesToReplace.TryGetValue(span, out currentNode))
+ {
+ var original = (SyntaxNode)retryAnnotations.GetAnnotations(currentNode).SingleOrDefault() ?? currentNode;
+ var newNode = await computeReplacementNodeAsync(original, currentNode, cancellationToken).ConfigureAwait(false);
+ nodeReplacements[currentNode] = newNode;
+ }
+ else if (tokensToReplace.TryGetValue(span, out currentToken))
+ {
+ var original = (SyntaxToken)retryAnnotations.GetAnnotations(currentToken).SingleOrDefault();
+ if (original == default(SyntaxToken))
+ {
+ original = currentToken;
+ }
+
+ var newToken = await computeReplacementTokenAsync(original, currentToken, cancellationToken).ConfigureAwait(false);
+ tokenReplacements[currentToken] = newToken;
+ }
+ else if (triviaToReplace.TryGetValue(span, out currentTrivia))
+ {
+ var original = (SyntaxTrivia)retryAnnotations.GetAnnotations(currentTrivia).SingleOrDefault();
+ if (original == default(SyntaxTrivia))
+ {
+ original = currentTrivia;
+ }
+
+ var newTrivia = await computeReplacementTriviaAsync(original, currentTrivia, cancellationToken).ConfigureAwait(false);
+ triviaReplacements[currentTrivia] = newTrivia;
+ }
+ }
+
+ previous = span;
+ }
+
+ bool retryNodes = false;
+ bool retryTokens = false;
+ bool retryTrivia = false;
+
+ // replace nodes in batch
+ // submit all nodes so we can annotate the ones we don't replace
+ root = root.ReplaceSyntax(
+ nodes: nodesToReplace.Values,
+ computeReplacementNode: (original, rewritten) =>
+ {
+ SyntaxNode replaced;
+ if (rewritten != original || !nodeReplacements.TryGetValue(original, out replaced))
+ {
+ // the subtree did change, or we didn't have a replacement for it in this batch
+ // so we need to add an annotation so we can find this node again for the next batch.
+ replaced = retryAnnotations.WithAdditionalAnnotations(rewritten, original);
+ retryNodes = true;
+ }
+
+ return replaced;
+ },
+ tokens: tokensToReplace.Values,
+ computeReplacementToken: (original, rewritten) =>
+ {
+ SyntaxToken replaced;
+ if (rewritten != original || !tokenReplacements.TryGetValue(original, out replaced))
+ {
+ // the subtree did change, or we didn't have a replacement for it in this batch
+ // so we need to add an annotation so we can find this node again for the next batch.
+ replaced = retryAnnotations.WithAdditionalAnnotations(rewritten, original);
+ retryTokens = true;
+ }
+
+ return replaced;
+ },
+ trivia: triviaToReplace.Values,
+ computeReplacementTrivia: (original, rewritten) =>
+ {
+ SyntaxTrivia replaced;
+ if (!triviaReplacements.TryGetValue(original, out replaced))
+ {
+ // the subtree did change, or we didn't have a replacement for it in this batch
+ // so we need to add an annotation so we can find this node again for the next batch.
+ replaced = retryAnnotations.WithAdditionalAnnotations(rewritten, original);
+ retryTrivia = true;
+ }
+
+ return replaced;
+ });
+
+ nodesToReplace.Clear();
+ tokensToReplace.Clear();
+ triviaToReplace.Clear();
+ spans.Clear();
+
+ // prepare next batch out of all remaining annotated nodes
+ if (retryNodes)
+ {
+ nodesToReplace = retryAnnotations.GetAnnotatedNodes(root).ToDictionary(n => n.FullSpan);
+ spans.AddRange(nodesToReplace.Keys);
+ }
+
+ if (retryTokens)
+ {
+ tokensToReplace = retryAnnotations.GetAnnotatedTokens(root).ToDictionary(t => t.FullSpan);
+ spans.AddRange(tokensToReplace.Keys);
+ }
+
+ if (retryTrivia)
+ {
+ triviaToReplace = retryAnnotations.GetAnnotatedTrivia(root).ToDictionary(t => t.FullSpan);
+ spans.AddRange(triviaToReplace.Keys);
+ }
+ }
+
+ return root;
+ }
+
+
+ public static bool IsKind(this SyntaxNode node, SyntaxKind kind1, SyntaxKind kind2)
+ {
+ if (node == null)
+ {
+ return false;
+ }
+
+ var csharpKind = node.Kind();
+ return csharpKind == kind1 || csharpKind == kind2;
+ }
+
+ public static bool IsKind(this SyntaxNode node, SyntaxKind kind1, SyntaxKind kind2, SyntaxKind kind3)
+ {
+ if (node == null)
+ {
+ return false;
+ }
+
+ var csharpKind = node.Kind();
+ return csharpKind == kind1 || csharpKind == kind2 || csharpKind == kind3;
+ }
+
+ public static bool IsKind(this SyntaxNode node, SyntaxKind kind1, SyntaxKind kind2, SyntaxKind kind3, SyntaxKind kind4)
+ {
+ if (node == null)
+ {
+ return false;
+ }
+
+ var csharpKind = node.Kind();
+ return csharpKind == kind1 || csharpKind == kind2 || csharpKind == kind3 || csharpKind == kind4;
+ }
+
+ public static bool IsKind(this SyntaxNode node, SyntaxKind kind1, SyntaxKind kind2, SyntaxKind kind3, SyntaxKind kind4, SyntaxKind kind5)
+ {
+ if (node == null)
+ {
+ return false;
+ }
+
+ var csharpKind = node.Kind();
+ return csharpKind == kind1 || csharpKind == kind2 || csharpKind == kind3 || csharpKind == kind4 || csharpKind == kind5;
+ }
+
+ /// <summary>
+ /// Returns the list of using directives that affect <paramref name="node"/>. The list will be returned in
+ /// top down order.
+ /// </summary>
+ public static IEnumerable<UsingDirectiveSyntax> GetEnclosingUsingDirectives(this SyntaxNode node)
+ {
+ return node.GetAncestorOrThis<CompilationUnitSyntax>().Usings
+ .Concat(node.GetAncestorsOrThis<NamespaceDeclarationSyntax>()
+ .Reverse()
+ .SelectMany(n => n.Usings));
+ }
+
+ public static bool IsUnsafeContext(this SyntaxNode node)
+ {
+ if (node.GetAncestor<UnsafeStatementSyntax>() != null)
+ {
+ return true;
+ }
+
+ return node.GetAncestors<MemberDeclarationSyntax>().Any(
+ m => m.GetModifiers().Any(SyntaxKind.UnsafeKeyword));
+ }
+
+ public static bool IsInStaticContext(this SyntaxNode node)
+ {
+ // this/base calls are always static.
+ if (node.FirstAncestorOrSelf<ConstructorInitializerSyntax>() != null)
+ {
+ return true;
+ }
+
+ var memberDeclaration = node.FirstAncestorOrSelf<MemberDeclarationSyntax>();
+ if (memberDeclaration == null)
+ {
+ return false;
+ }
+
+ switch (memberDeclaration.Kind())
+ {
+ case SyntaxKind.MethodDeclaration:
+ case SyntaxKind.ConstructorDeclaration:
+ case SyntaxKind.PropertyDeclaration:
+ case SyntaxKind.EventDeclaration:
+ case SyntaxKind.IndexerDeclaration:
+ return memberDeclaration.GetModifiers().Any(SyntaxKind.StaticKeyword);
+
+ case SyntaxKind.FieldDeclaration:
+ // Inside a field one can only access static members of a type.
+ return true;
+
+ case SyntaxKind.DestructorDeclaration:
+ return false;
+ }
+
+ // Global statements are not a static context.
+ if (node.FirstAncestorOrSelf<GlobalStatementSyntax>() != null)
+ {
+ return false;
+ }
+
+ // any other location is considered static
+ return true;
+ }
+
+ public static NamespaceDeclarationSyntax GetInnermostNamespaceDeclarationWithUsings(this SyntaxNode contextNode)
+ {
+ var usingDirectiveAncsestor = contextNode.GetAncestor<UsingDirectiveSyntax>();
+ if (usingDirectiveAncsestor == null)
+ {
+ return contextNode.GetAncestorsOrThis<NamespaceDeclarationSyntax>().FirstOrDefault(n => n.Usings.Count > 0);
+ }
+ else
+ {
+ // We are inside a using directive. In this case, we should find and return the first 'parent' namespace with usings.
+ var containingNamespace = usingDirectiveAncsestor.GetAncestor<NamespaceDeclarationSyntax>();
+ if (containingNamespace == null)
+ {
+ // We are inside a top level using directive (i.e. one that's directly in the compilation unit).
+ return null;
+ }
+ else
+ {
+ return containingNamespace.GetAncestors<NamespaceDeclarationSyntax>().FirstOrDefault(n => n.Usings.Count > 0);
+ }
+ }
+ }
+
+ // Matches the following:
+ //
+ // (whitespace* newline)+
+ private static readonly Matcher<SyntaxTrivia> s_oneOrMoreBlankLines;
+
+ // Matches the following:
+ //
+ // (whitespace* (single-comment|multi-comment) whitespace* newline)+ OneOrMoreBlankLines
+ private static readonly Matcher<SyntaxTrivia> s_bannerMatcher;
+
+ static SyntaxNodeExtensions()
+ {
+ var whitespace = Matcher.Repeat(Match(SyntaxKind.WhitespaceTrivia, "\\b"));
+ var endOfLine = Match(SyntaxKind.EndOfLineTrivia, "\\n");
+ var singleBlankLine = Matcher.Sequence(whitespace, endOfLine);
+
+ var singleLineComment = Match(SyntaxKind.SingleLineCommentTrivia, "//");
+ var multiLineComment = Match(SyntaxKind.MultiLineCommentTrivia, "/**/");
+ var anyCommentMatcher = Matcher.Choice(singleLineComment, multiLineComment);
+
+ var commentLine = Matcher.Sequence(whitespace, anyCommentMatcher, whitespace, endOfLine);
+
+ s_oneOrMoreBlankLines = Matcher.OneOrMore(singleBlankLine);
+ s_bannerMatcher =
+ Matcher.Sequence(
+ Matcher.OneOrMore(commentLine),
+ s_oneOrMoreBlankLines);
+
+ var typeInfo = Type.GetType("Microsoft.CodeAnalysis.CSharp.Extensions.SyntaxNodeExtensions" + ReflectionNamespaces.CSWorkspacesAsmName, true);
+ containsInterleavedDirectiveMethod = typeInfo.GetMethod("ContainsInterleavedDirective", new[] { typeof(SyntaxNode), typeof (CancellationToken) });
+ }
+
+ private static Matcher<SyntaxTrivia> Match(SyntaxKind kind, string description)
+ {
+ return Matcher.Single<SyntaxTrivia>(t => t.Kind() == kind, description);
+ }
+
+ /// <summary>
+ /// Returns all of the trivia to the left of this token up to the previous token (concatenates
+ /// the previous token's trailing trivia and this token's leading trivia).
+ /// </summary>
+ public static IEnumerable<SyntaxTrivia> GetAllPrecedingTriviaToPreviousToken(this SyntaxToken token)
+ {
+ var prevToken = token.GetPreviousToken(includeSkipped: true);
+ if (prevToken.Kind() == SyntaxKind.None)
+ {
+ return token.LeadingTrivia;
+ }
+
+ return prevToken.TrailingTrivia.Concat(token.LeadingTrivia);
+ }
+
+ public static bool IsBreakableConstruct(this SyntaxNode node)
+ {
+ switch (node.Kind())
+ {
+ case SyntaxKind.DoStatement:
+ case SyntaxKind.WhileStatement:
+ case SyntaxKind.SwitchStatement:
+ case SyntaxKind.ForStatement:
+ case SyntaxKind.ForEachStatement:
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsContinuableConstruct(this SyntaxNode node)
+ {
+ switch (node.Kind())
+ {
+ case SyntaxKind.DoStatement:
+ case SyntaxKind.WhileStatement:
+ case SyntaxKind.ForStatement:
+ case SyntaxKind.ForEachStatement:
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsReturnableConstruct(this SyntaxNode node)
+ {
+ switch (node.Kind())
+ {
+ case SyntaxKind.AnonymousMethodExpression:
+ case SyntaxKind.SimpleLambdaExpression:
+ case SyntaxKind.ParenthesizedLambdaExpression:
+ case SyntaxKind.MethodDeclaration:
+ case SyntaxKind.ConstructorDeclaration:
+ case SyntaxKind.DestructorDeclaration:
+ case SyntaxKind.GetAccessorDeclaration:
+ case SyntaxKind.SetAccessorDeclaration:
+ case SyntaxKind.OperatorDeclaration:
+ case SyntaxKind.AddAccessorDeclaration:
+ case SyntaxKind.RemoveAccessorDeclaration:
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool SpansPreprocessorDirective<TSyntaxNode>(
+ this IEnumerable<TSyntaxNode> list)
+ where TSyntaxNode : SyntaxNode
+ {
+ if (list == null || !list.Any())
+ {
+ return false;
+ }
+
+ var tokens = list.SelectMany(n => n.DescendantTokens());
+
+ // todo: we need to dive into trivia here.
+ return tokens.SpansPreprocessorDirective();
+ }
+
+ public static T WithPrependedLeadingTrivia<T>(
+ this T node,
+ params SyntaxTrivia[] trivia) where T : SyntaxNode
+ {
+ if (trivia.Length == 0)
+ {
+ return node;
+ }
+
+ return node.WithPrependedLeadingTrivia((IEnumerable<SyntaxTrivia>)trivia);
+ }
+
+ public static T WithPrependedLeadingTrivia<T>(
+ this T node,
+ SyntaxTriviaList trivia) where T : SyntaxNode
+ {
+ if (trivia.Count == 0)
+ {
+ return node;
+ }
+
+ return node.WithLeadingTrivia(trivia.Concat(node.GetLeadingTrivia()));
+ }
+
+ public static T WithPrependedLeadingTrivia<T>(
+ this T node,
+ IEnumerable<SyntaxTrivia> trivia) where T : SyntaxNode
+ {
+ return node.WithPrependedLeadingTrivia(trivia.ToSyntaxTriviaList());
+ }
+
+ public static T WithAppendedTrailingTrivia<T>(
+ this T node,
+ params SyntaxTrivia[] trivia) where T : SyntaxNode
+ {
+ if (trivia.Length == 0)
+ {
+ return node;
+ }
+
+ return node.WithAppendedTrailingTrivia((IEnumerable<SyntaxTrivia>)trivia);
+ }
+
+ public static T WithAppendedTrailingTrivia<T>(
+ this T node,
+ SyntaxTriviaList trivia) where T : SyntaxNode
+ {
+ if (trivia.Count == 0)
+ {
+ return node;
+ }
+
+ return node.WithTrailingTrivia(node.GetTrailingTrivia().Concat(trivia));
+ }
+
+ public static T WithAppendedTrailingTrivia<T>(
+ this T node,
+ IEnumerable<SyntaxTrivia> trivia) where T : SyntaxNode
+ {
+ return node.WithAppendedTrailingTrivia(trivia.ToSyntaxTriviaList());
+ }
+
+ public static T With<T>(
+ this T node,
+ IEnumerable<SyntaxTrivia> leadingTrivia,
+ IEnumerable<SyntaxTrivia> trailingTrivia) where T : SyntaxNode
+ {
+ return node.WithLeadingTrivia(leadingTrivia).WithTrailingTrivia(trailingTrivia);
+ }
+
+ public static TNode ConvertToSingleLine<TNode>(this TNode node)
+ where TNode : SyntaxNode
+ {
+ if (node == null)
+ {
+ return node;
+ }
+
+ var rewriter = new SingleLineRewriter();
+ return (TNode)rewriter.Visit(node);
+ }
+
+ internal class SingleLineRewriter : CSharpSyntaxRewriter
+ {
+ private bool _lastTokenEndedInWhitespace;
+
+ public override SyntaxToken VisitToken(SyntaxToken token)
+ {
+ if (_lastTokenEndedInWhitespace)
+ {
+ token = token.WithLeadingTrivia(Enumerable.Empty<SyntaxTrivia>());
+ }
+ else if (token.LeadingTrivia.Count > 0)
+ {
+ token = token.WithLeadingTrivia(SyntaxFactory.Space);
+ }
+
+ if (token.TrailingTrivia.Count > 0)
+ {
+ token = token.WithTrailingTrivia(SyntaxFactory.Space);
+ _lastTokenEndedInWhitespace = true;
+ }
+ else
+ {
+ _lastTokenEndedInWhitespace = false;
+ }
+
+ return token;
+ }
+ }
+
+ public static bool IsAnyArgumentList(this SyntaxNode node)
+ {
+ return node.IsKind(SyntaxKind.ArgumentList) ||
+ node.IsKind(SyntaxKind.AttributeArgumentList) ||
+ node.IsKind(SyntaxKind.BracketedArgumentList) ||
+ node.IsKind(SyntaxKind.TypeArgumentList);
+ }
+
+ public static bool IsAnyLambda(this SyntaxNode node)
+ {
+ return
+ node.IsKind(SyntaxKind.ParenthesizedLambdaExpression) ||
+ node.IsKind(SyntaxKind.SimpleLambdaExpression);
+ }
+
+ public static bool IsAnyLambdaOrAnonymousMethod(this SyntaxNode node)
+ {
+ return node.IsAnyLambda() || node.IsKind(SyntaxKind.AnonymousMethodExpression);
+ }
+
+ readonly static MethodInfo containsInterleavedDirectiveMethod;
+
+ /// <summary>
+ /// Returns true if the passed in node contains an interleaved pp directive.
+ ///
+ /// i.e. The following returns false:
+ ///
+ /// void Foo() {
+ /// #if true
+ /// #endif
+ /// }
+ ///
+ /// #if true
+ /// void Foo() {
+ /// }
+ /// #endif
+ ///
+ /// but these return true:
+ ///
+ /// #if true
+ /// void Foo() {
+ /// #endif
+ /// }
+ ///
+ /// void Foo() {
+ /// #if true
+ /// }
+ /// #endif
+ ///
+ /// #if true
+ /// void Foo() {
+ /// #else
+ /// }
+ /// #endif
+ ///
+ /// i.e. the method returns true if it contains a PP directive that belongs to a grouping
+ /// constructs (like #if/#endif or #region/#endregion), but the grouping construct isn't
+ /// entirely contained within the span of the node.
+ /// </summary>
+ public static bool ContainsInterleavedDirective(
+ this SyntaxNode syntaxNode,
+ CancellationToken cancellationToken)
+ {
+ return (bool)containsInterleavedDirectiveMethod.Invoke (null, new object[] { syntaxNode, cancellationToken });
+ }
+
+
+// /// <summary>
+// /// Breaks up the list of provided nodes, based on how they are interspersed with pp
+// /// directives, into groups. Within these groups nodes can be moved around safely, without
+// /// breaking any pp constructs.
+// /// </summary>
+// public static IList<IList<TSyntaxNode>> SplitNodesOnPreprocessorBoundaries<TSyntaxNode>(
+// this IEnumerable<TSyntaxNode> nodes,
+// CancellationToken cancellationToken)
+// where TSyntaxNode : SyntaxNode
+// {
+// var result = new List<IList<TSyntaxNode>>();
+//
+// var currentGroup = new List<TSyntaxNode>();
+// foreach (var node in nodes)
+// {
+// var hasUnmatchedInteriorDirective = node.ContainsInterleavedDirective(cancellationToken);
+// var hasLeadingDirective = node.GetLeadingTrivia().Any(t => SyntaxFacts.IsPreprocessorDirective(t.Kind()));
+//
+// if (hasUnmatchedInteriorDirective)
+// {
+// // we have a #if/#endif/#region/#endregion/#else/#elif in
+// // this node that belongs to a span of pp directives that
+// // is not entirely contained within the node. i.e.:
+// //
+// // void Foo() {
+// // #if ...
+// // }
+// //
+// // This node cannot be moved at all. It is in a group that
+// // only contains itself (and thus can never be moved).
+//
+// // add whatever group we've built up to now. And reset the
+// // next group to empty.
+// result.Add(currentGroup);
+// currentGroup = new List<TSyntaxNode>();
+//
+// result.Add(new List<TSyntaxNode> { node });
+// }
+// else if (hasLeadingDirective)
+// {
+// // We have a PP directive before us. i.e.:
+// //
+// // #if ...
+// // void Foo() {
+// //
+// // That means we start a new group that is contained between
+// // the above directive and the following directive.
+//
+// // add whatever group we've built up to now. And reset the
+// // next group to empty.
+// result.Add(currentGroup);
+// currentGroup = new List<TSyntaxNode>();
+//
+// currentGroup.Add(node);
+// }
+// else
+// {
+// // simple case. just add ourselves to the current group
+// currentGroup.Add(node);
+// }
+// }
+//
+// // add the remainder of the final group.
+// result.Add(currentGroup);
+//
+// // Now, filter out any empty groups.
+// result = result.Where(group => !group.IsEmpty()).ToList();
+// return result;
+// }
+//
+// public static IEnumerable<SyntaxTrivia> GetLeadingBlankLines<TSyntaxNode>(
+// this TSyntaxNode node)
+// where TSyntaxNode : SyntaxNode
+// {
+// IEnumerable<SyntaxTrivia> blankLines;
+// node.GetNodeWithoutLeadingBlankLines(out blankLines);
+// return blankLines;
+// }
+//
+// public static TSyntaxNode GetNodeWithoutLeadingBlankLines<TSyntaxNode>(
+// this TSyntaxNode node)
+// where TSyntaxNode : SyntaxNode
+// {
+// IEnumerable<SyntaxTrivia> blankLines;
+// return node.GetNodeWithoutLeadingBlankLines(out blankLines);
+// }
+//
+// public static TSyntaxNode GetNodeWithoutLeadingBlankLines<TSyntaxNode>(
+// this TSyntaxNode node, out IEnumerable<SyntaxTrivia> strippedTrivia)
+// where TSyntaxNode : SyntaxNode
+// {
+// var leadingTriviaToKeep = new List<SyntaxTrivia>(node.GetLeadingTrivia());
+//
+// var index = 0;
+// s_oneOrMoreBlankLines.TryMatch(leadingTriviaToKeep, ref index);
+//
+// strippedTrivia = new List<SyntaxTrivia>(leadingTriviaToKeep.Take(index));
+//
+// return node.WithLeadingTrivia(leadingTriviaToKeep.Skip(index));
+// }
+
+ public static IEnumerable<SyntaxTrivia> GetLeadingBannerAndPreprocessorDirectives<TSyntaxNode>(
+ this TSyntaxNode node)
+ where TSyntaxNode : SyntaxNode
+ {
+ IEnumerable<SyntaxTrivia> leadingTrivia;
+ node.GetNodeWithoutLeadingBannerAndPreprocessorDirectives(out leadingTrivia);
+ return leadingTrivia;
+ }
+
+ public static TSyntaxNode GetNodeWithoutLeadingBannerAndPreprocessorDirectives<TSyntaxNode>(
+ this TSyntaxNode node)
+ where TSyntaxNode : SyntaxNode
+ {
+ IEnumerable<SyntaxTrivia> strippedTrivia;
+ return node.GetNodeWithoutLeadingBannerAndPreprocessorDirectives(out strippedTrivia);
+ }
+
+ public static TSyntaxNode GetNodeWithoutLeadingBannerAndPreprocessorDirectives<TSyntaxNode>(
+ this TSyntaxNode node, out IEnumerable<SyntaxTrivia> strippedTrivia)
+ where TSyntaxNode : SyntaxNode
+ {
+ var leadingTrivia = node.GetLeadingTrivia();
+
+ // Rules for stripping trivia:
+ // 1) If there is a pp directive, then it (and all preceding trivia) *must* be stripped.
+ // This rule supersedes all other rules.
+ // 2) If there is a doc comment, it cannot be stripped. Even if there is a doc comment,
+ // followed by 5 new lines, then the doc comment still must stay with the node. This
+ // rule does *not* supersede rule 1.
+ // 3) Single line comments in a group (i.e. with no blank lines between them) belong to
+ // the node *iff* there is no blank line between it and the following trivia.
+
+ List<SyntaxTrivia> leadingTriviaToStrip, leadingTriviaToKeep;
+
+ int ppIndex = -1;
+ for (int i = leadingTrivia.Count - 1; i >= 0; i--)
+ {
+ if (SyntaxFacts.IsPreprocessorDirective(leadingTrivia[i].Kind()))
+ {
+ ppIndex = i;
+ break;
+ }
+ }
+
+ if (ppIndex != -1)
+ {
+ // We have a pp directive. it (and all all previous trivia) must be stripped.
+ leadingTriviaToStrip = new List<SyntaxTrivia>(leadingTrivia.Take(ppIndex + 1));
+ leadingTriviaToKeep = new List<SyntaxTrivia>(leadingTrivia.Skip(ppIndex + 1));
+ }
+ else
+ {
+ leadingTriviaToKeep = new List<SyntaxTrivia>(leadingTrivia);
+ leadingTriviaToStrip = new List<SyntaxTrivia>();
+ }
+
+ // Now, consume as many banners as we can.
+ var index = 0;
+ while (
+ s_oneOrMoreBlankLines.TryMatch(leadingTriviaToKeep, ref index) ||
+ s_bannerMatcher.TryMatch(leadingTriviaToKeep, ref index))
+ {
+ }
+
+ leadingTriviaToStrip.AddRange(leadingTriviaToKeep.Take(index));
+
+ strippedTrivia = leadingTriviaToStrip;
+ return node.WithLeadingTrivia(leadingTriviaToKeep.Skip(index));
+ }
+
+ public static bool IsAnyAssignExpression(this SyntaxNode node)
+ {
+ return SyntaxFacts.IsAssignmentExpression(node.Kind());
+ }
+
+ public static bool IsCompoundAssignExpression(this SyntaxNode node)
+ {
+ switch (node.Kind())
+ {
+ case SyntaxKind.AddAssignmentExpression:
+ case SyntaxKind.SubtractAssignmentExpression:
+ case SyntaxKind.MultiplyAssignmentExpression:
+ case SyntaxKind.DivideAssignmentExpression:
+ case SyntaxKind.ModuloAssignmentExpression:
+ case SyntaxKind.AndAssignmentExpression:
+ case SyntaxKind.ExclusiveOrAssignmentExpression:
+ case SyntaxKind.OrAssignmentExpression:
+ case SyntaxKind.LeftShiftAssignmentExpression:
+ case SyntaxKind.RightShiftAssignmentExpression:
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsLeftSideOfAssignExpression(this SyntaxNode node)
+ {
+ return node.IsParentKind(SyntaxKind.SimpleAssignmentExpression) &&
+ ((AssignmentExpressionSyntax)node.Parent).Left == node;
+ }
+
+ public static bool IsLeftSideOfAnyAssignExpression(this SyntaxNode node)
+ {
+ return node.Parent.IsAnyAssignExpression() &&
+ ((AssignmentExpressionSyntax)node.Parent).Left == node;
+ }
+
+ public static bool IsRightSideOfAnyAssignExpression(this SyntaxNode node)
+ {
+ return node.Parent.IsAnyAssignExpression() &&
+ ((AssignmentExpressionSyntax)node.Parent).Right == node;
+ }
+
+ public static bool IsVariableDeclaratorValue(this SyntaxNode node)
+ {
+ return
+ node.IsParentKind(SyntaxKind.EqualsValueClause) &&
+ node.Parent.IsParentKind(SyntaxKind.VariableDeclarator) &&
+ ((EqualsValueClauseSyntax)node.Parent).Value == node;
+ }
+
+ public static BlockSyntax FindInnermostCommonBlock(this IEnumerable<SyntaxNode> nodes)
+ {
+ return nodes.FindInnermostCommonNode<BlockSyntax>();
+ }
+
+ public static IEnumerable<SyntaxNode> GetAncestorsOrThis(this SyntaxNode node, Func<SyntaxNode, bool> predicate)
+ {
+ var current = node;
+ while (current != null)
+ {
+ if (predicate(current))
+ {
+ yield return current;
+ }
+
+ current = current.Parent;
+ }
+ }
+
+ /// <summary>
+ /// Look inside a trivia list for a skipped token that contains the given position.
+ /// </summary>
+ private static readonly Func<SyntaxTriviaList, int, SyntaxToken> s_findSkippedTokenForward =
+ (l, p) => FindTokenHelper.FindSkippedTokenForward(GetSkippedTokens(l), p);
+
+ private static IEnumerable<SyntaxToken> GetSkippedTokens(SyntaxTriviaList list)
+ {
+ return list.Where(trivia => trivia.RawKind == (int)SyntaxKind.SkippedTokensTrivia)
+ .SelectMany(t => ((SkippedTokensTriviaSyntax)t.GetStructure()).Tokens);
+ }
+
+ /// <summary>
+ /// If the position is inside of token, return that token; otherwise, return the token to the right.
+ /// </summary>
+ public static SyntaxToken FindTokenOnRightOfPosition(
+ this SyntaxNode root,
+ int position,
+ bool includeSkipped = true,
+ bool includeDirectives = false,
+ bool includeDocumentationComments = false)
+ {
+ var skippedTokenFinder = includeSkipped ? s_findSkippedTokenForward : (Func<SyntaxTriviaList, int, SyntaxToken>)null;
+
+ return FindTokenHelper.FindTokenOnRightOfPosition<CompilationUnitSyntax>(
+ root, position, skippedTokenFinder, includeSkipped, includeDirectives, includeDocumentationComments);
+ }
+
+// /// <summary>
+// /// If the position is inside of token, return that token; otherwise, return the token to the left.
+// /// </summary>
+// public static SyntaxToken FindTokenOnLeftOfPosition(
+// this SyntaxNode root,
+// int position,
+// bool includeSkipped = true,
+// bool includeDirectives = false,
+// bool includeDocumentationComments = false)
+// {
+// var skippedTokenFinder = includeSkipped ? s_findSkippedTokenBackward : (Func<SyntaxTriviaList, int, SyntaxToken>)null;
+//
+// return FindTokenHelper.FindTokenOnLeftOfPosition<CompilationUnitSyntax>(
+// root, position, skippedTokenFinder, includeSkipped, includeDirectives, includeDocumentationComments);
+// }
+
+ /// <summary>
+ /// Returns child node or token that contains given position.
+ /// </summary>
+ /// <remarks>
+ /// This is a copy of <see cref="SyntaxNode.ChildThatContainsPosition"/> that also returns the index of the child node.
+ /// </remarks>
+ internal static SyntaxNodeOrToken ChildThatContainsPosition(this SyntaxNode self, int position, out int childIndex)
+ {
+ var childList = self.ChildNodesAndTokens();
+
+ int left = 0;
+ int right = childList.Count - 1;
+
+ while (left <= right)
+ {
+ int middle = left + ((right - left) / 2);
+ SyntaxNodeOrToken node = childList.ElementAt(middle);
+
+ var span = node.FullSpan;
+ if (position < span.Start)
+ {
+ right = middle - 1;
+ }
+ else if (position >= span.End)
+ {
+ left = middle + 1;
+ }
+ else
+ {
+ childIndex = middle;
+ return node;
+ }
+ }
+
+ // we could check up front that index is within FullSpan,
+ // but we wan to optimize for the common case where position is valid.
+ Debug.Assert(!self.FullSpan.Contains(position), "Position is valid. How could we not find a child?");
+ throw new ArgumentOutOfRangeException("position");
+ }
+
+ public static SyntaxNode GetParent(this SyntaxNode node)
+ {
+ return node != null ? node.Parent : null;
+ }
+
+ public static ValueTuple<SyntaxToken, SyntaxToken> GetBraces(this SyntaxNode node)
+ {
+ var namespaceNode = node as NamespaceDeclarationSyntax;
+ if (namespaceNode != null)
+ {
+ return ValueTuple.Create(namespaceNode.OpenBraceToken, namespaceNode.CloseBraceToken);
+ }
+
+ var baseTypeNode = node as BaseTypeDeclarationSyntax;
+ if (baseTypeNode != null)
+ {
+ return ValueTuple.Create(baseTypeNode.OpenBraceToken, baseTypeNode.CloseBraceToken);
+ }
+
+ var accessorListNode = node as AccessorListSyntax;
+ if (accessorListNode != null)
+ {
+ return ValueTuple.Create(accessorListNode.OpenBraceToken, accessorListNode.CloseBraceToken);
+ }
+
+ var blockNode = node as BlockSyntax;
+ if (blockNode != null)
+ {
+ return ValueTuple.Create(blockNode.OpenBraceToken, blockNode.CloseBraceToken);
+ }
+
+ var switchStatementNode = node as SwitchStatementSyntax;
+ if (switchStatementNode != null)
+ {
+ return ValueTuple.Create(switchStatementNode.OpenBraceToken, switchStatementNode.CloseBraceToken);
+ }
+
+ var anonymousObjectCreationExpression = node as AnonymousObjectCreationExpressionSyntax;
+ if (anonymousObjectCreationExpression != null)
+ {
+ return ValueTuple.Create(anonymousObjectCreationExpression.OpenBraceToken, anonymousObjectCreationExpression.CloseBraceToken);
+ }
+
+ var initializeExpressionNode = node as InitializerExpressionSyntax;
+ if (initializeExpressionNode != null)
+ {
+ return ValueTuple.Create(initializeExpressionNode.OpenBraceToken, initializeExpressionNode.CloseBraceToken);
+ }
+
+ return new ValueTuple<SyntaxToken, SyntaxToken>();
+ }
+
+ public static ValueTuple<SyntaxToken, SyntaxToken> GetParentheses(this SyntaxNode node)
+ {
+ return node.TypeSwitch(
+ (ParenthesizedExpressionSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (MakeRefExpressionSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (RefTypeExpressionSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (RefValueExpressionSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (CheckedExpressionSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (DefaultExpressionSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (TypeOfExpressionSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (SizeOfExpressionSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (ArgumentListSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (CastExpressionSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (WhileStatementSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (DoStatementSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (ForStatementSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (ForEachStatementSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (UsingStatementSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (FixedStatementSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (LockStatementSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (IfStatementSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (SwitchStatementSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (CatchDeclarationSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (AttributeArgumentListSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (ConstructorConstraintSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (ParameterListSyntax n) => ValueTuple.Create(n.OpenParenToken, n.CloseParenToken),
+ (SyntaxNode n) => default(ValueTuple<SyntaxToken, SyntaxToken>));
+ }
+
+ public static ValueTuple<SyntaxToken, SyntaxToken> GetBrackets(this SyntaxNode node)
+ {
+ return node.TypeSwitch(
+ (ArrayRankSpecifierSyntax n) => ValueTuple.Create(n.OpenBracketToken, n.CloseBracketToken),
+ (BracketedArgumentListSyntax n) => ValueTuple.Create(n.OpenBracketToken, n.CloseBracketToken),
+ (ImplicitArrayCreationExpressionSyntax n) => ValueTuple.Create(n.OpenBracketToken, n.CloseBracketToken),
+ (AttributeListSyntax n) => ValueTuple.Create(n.OpenBracketToken, n.CloseBracketToken),
+ (BracketedParameterListSyntax n) => ValueTuple.Create(n.OpenBracketToken, n.CloseBracketToken),
+ (SyntaxNode n) => default(ValueTuple<SyntaxToken, SyntaxToken>));
+ }
+
+ public static bool IsEmbeddedStatementOwner(this SyntaxNode node)
+ {
+ return node is IfStatementSyntax ||
+ node is ElseClauseSyntax ||
+ node is WhileStatementSyntax ||
+ node is ForStatementSyntax ||
+ node is ForEachStatementSyntax ||
+ node is UsingStatementSyntax ||
+ node is DoStatementSyntax;
+ }
+
+ public static StatementSyntax GetEmbeddedStatement(this SyntaxNode node)
+ {
+ return node.TypeSwitch(
+ (IfStatementSyntax n) => n.Statement,
+ (ElseClauseSyntax n) => n.Statement,
+ (WhileStatementSyntax n) => n.Statement,
+ (ForStatementSyntax n) => n.Statement,
+ (ForEachStatementSyntax n) => n.Statement,
+ (UsingStatementSyntax n) => n.Statement,
+ (DoStatementSyntax n) => n.Statement,
+ (SyntaxNode n) => null);
+ }
+
+ public static SyntaxTokenList GetModifiers(this SyntaxNode member)
+ {
+ if (member != null)
+ {
+ switch (member.Kind())
+ {
+ case SyntaxKind.EnumDeclaration:
+ return ((EnumDeclarationSyntax)member).Modifiers;
+ case SyntaxKind.ClassDeclaration:
+ case SyntaxKind.InterfaceDeclaration:
+ case SyntaxKind.StructDeclaration:
+ return ((TypeDeclarationSyntax)member).Modifiers;
+ case SyntaxKind.DelegateDeclaration:
+ return ((DelegateDeclarationSyntax)member).Modifiers;
+ case SyntaxKind.FieldDeclaration:
+ return ((FieldDeclarationSyntax)member).Modifiers;
+ case SyntaxKind.EventFieldDeclaration:
+ return ((EventFieldDeclarationSyntax)member).Modifiers;
+ case SyntaxKind.ConstructorDeclaration:
+ return ((ConstructorDeclarationSyntax)member).Modifiers;
+ case SyntaxKind.DestructorDeclaration:
+ return ((DestructorDeclarationSyntax)member).Modifiers;
+ case SyntaxKind.PropertyDeclaration:
+ return ((PropertyDeclarationSyntax)member).Modifiers;
+ case SyntaxKind.EventDeclaration:
+ return ((EventDeclarationSyntax)member).Modifiers;
+ case SyntaxKind.IndexerDeclaration:
+ return ((IndexerDeclarationSyntax)member).Modifiers;
+ case SyntaxKind.OperatorDeclaration:
+ return ((OperatorDeclarationSyntax)member).Modifiers;
+ case SyntaxKind.ConversionOperatorDeclaration:
+ return ((ConversionOperatorDeclarationSyntax)member).Modifiers;
+ case SyntaxKind.MethodDeclaration:
+ return ((MethodDeclarationSyntax)member).Modifiers;
+ case SyntaxKind.GetAccessorDeclaration:
+ case SyntaxKind.SetAccessorDeclaration:
+ case SyntaxKind.AddAccessorDeclaration:
+ case SyntaxKind.RemoveAccessorDeclaration:
+ return ((AccessorDeclarationSyntax)member).Modifiers;
+ }
+ }
+
+ return default(SyntaxTokenList);
+ }
+
+ public static SyntaxNode WithModifiers(this SyntaxNode member, SyntaxTokenList modifiers)
+ {
+ if (member != null)
+ {
+ switch (member.Kind())
+ {
+ case SyntaxKind.EnumDeclaration:
+ return ((EnumDeclarationSyntax)member).WithModifiers(modifiers);
+ case SyntaxKind.ClassDeclaration:
+ case SyntaxKind.InterfaceDeclaration:
+ case SyntaxKind.StructDeclaration:
+ return ((TypeDeclarationSyntax)member).WithModifiers(modifiers);
+ case SyntaxKind.DelegateDeclaration:
+ return ((DelegateDeclarationSyntax)member).WithModifiers(modifiers);
+ case SyntaxKind.FieldDeclaration:
+ return ((FieldDeclarationSyntax)member).WithModifiers(modifiers);
+ case SyntaxKind.EventFieldDeclaration:
+ return ((EventFieldDeclarationSyntax)member).WithModifiers(modifiers);
+ case SyntaxKind.ConstructorDeclaration:
+ return ((ConstructorDeclarationSyntax)member).WithModifiers(modifiers);
+ case SyntaxKind.DestructorDeclaration:
+ return ((DestructorDeclarationSyntax)member).WithModifiers(modifiers);
+ case SyntaxKind.PropertyDeclaration:
+ return ((PropertyDeclarationSyntax)member).WithModifiers(modifiers);
+ case SyntaxKind.EventDeclaration:
+ return ((EventDeclarationSyntax)member).WithModifiers(modifiers);
+ case SyntaxKind.IndexerDeclaration:
+ return ((IndexerDeclarationSyntax)member).WithModifiers(modifiers);
+ case SyntaxKind.OperatorDeclaration:
+ return ((OperatorDeclarationSyntax)member).WithModifiers(modifiers);
+ case SyntaxKind.ConversionOperatorDeclaration:
+ return ((ConversionOperatorDeclarationSyntax)member).WithModifiers(modifiers);
+ case SyntaxKind.MethodDeclaration:
+ return ((MethodDeclarationSyntax)member).WithModifiers(modifiers);
+ case SyntaxKind.GetAccessorDeclaration:
+ case SyntaxKind.SetAccessorDeclaration:
+ case SyntaxKind.AddAccessorDeclaration:
+ case SyntaxKind.RemoveAccessorDeclaration:
+ return ((AccessorDeclarationSyntax)member).WithModifiers(modifiers);
+ }
+ }
+
+ return null;
+ }
+
+ public static bool CheckTopLevel(this SyntaxNode node, TextSpan span)
+ {
+ var block = node as BlockSyntax;
+ if (block != null)
+ {
+ return block.ContainsInBlockBody(span);
+ }
+
+ var field = node as FieldDeclarationSyntax;
+ if (field != null)
+ {
+ foreach (var variable in field.Declaration.Variables)
+ {
+ if (variable.Initializer != null && variable.Initializer.Span.Contains(span))
+ {
+ return true;
+ }
+ }
+ }
+
+ var global = node as GlobalStatementSyntax;
+ if (global != null)
+ {
+ return true;
+ }
+
+ var constructorInitializer = node as ConstructorInitializerSyntax;
+ if (constructorInitializer != null)
+ {
+ return constructorInitializer.ContainsInArgument(span);
+ }
+
+ return false;
+ }
+
+ public static bool ContainsInArgument(this ConstructorInitializerSyntax initializer, TextSpan textSpan)
+ {
+ if (initializer == null)
+ {
+ return false;
+ }
+
+ return initializer.ArgumentList.Arguments.Any(a => a.Span.Contains(textSpan));
+ }
+
+ public static bool ContainsInBlockBody(this BlockSyntax block, TextSpan textSpan)
+ {
+ if (block == null)
+ {
+ return false;
+ }
+
+ var blockSpan = TextSpan.FromBounds(block.OpenBraceToken.Span.End, block.CloseBraceToken.SpanStart);
+ return blockSpan.Contains(textSpan);
+ }
+
+ public static IEnumerable<MemberDeclarationSyntax> GetMembers(this SyntaxNode node)
+ {
+ var compilation = node as CompilationUnitSyntax;
+ if (compilation != null)
+ {
+ return compilation.Members;
+ }
+
+ var @namespace = node as NamespaceDeclarationSyntax;
+ if (@namespace != null)
+ {
+ return @namespace.Members;
+ }
+
+ var type = node as TypeDeclarationSyntax;
+ if (type != null)
+ {
+ return type.Members;
+ }
+
+ var @enum = node as EnumDeclarationSyntax;
+ if (@enum != null)
+ {
+ return @enum.Members;
+ }
+
+ return SpecializedCollections.EmptyEnumerable<MemberDeclarationSyntax>();
+ }
+
+ public static IEnumerable<SyntaxNode> GetBodies(this SyntaxNode node)
+ {
+ var constructor = node as ConstructorDeclarationSyntax;
+ if (constructor != null)
+ {
+ var result = SpecializedCollections.SingletonEnumerable<SyntaxNode>(constructor.Body).WhereNotNull();
+ var initializer = constructor.Initializer;
+ if (initializer != null)
+ {
+ result = result.Concat(initializer.ArgumentList.Arguments.Select(a => (SyntaxNode)a.Expression).WhereNotNull());
+ }
+
+ return result;
+ }
+
+ var method = node as BaseMethodDeclarationSyntax;
+ if (method != null)
+ {
+ return SpecializedCollections.SingletonEnumerable<SyntaxNode>(method.Body).WhereNotNull();
+ }
+
+ var property = node as BasePropertyDeclarationSyntax;
+ if (property != null)
+ {
+ return property.AccessorList.Accessors.Select(a => a.Body).WhereNotNull();
+ }
+
+ var @enum = node as EnumMemberDeclarationSyntax;
+ if (@enum != null)
+ {
+ if (@enum.EqualsValue != null)
+ {
+ return SpecializedCollections.SingletonEnumerable(@enum.EqualsValue.Value).WhereNotNull();
+ }
+ }
+
+ var field = node as BaseFieldDeclarationSyntax;
+ if (field != null)
+ {
+ return field.Declaration.Variables.Where(v => v.Initializer != null).Select(v => v.Initializer.Value).WhereNotNull();
+ }
+
+ return SpecializedCollections.EmptyEnumerable<SyntaxNode>();
+ }
+
+ public static ConditionalAccessExpressionSyntax GetParentConditionalAccessExpression(this SyntaxNode node)
+ {
+ var parent = node.Parent;
+ while (parent != null)
+ {
+ // Because the syntax for conditional access is right associate, we cannot
+ // simply take the first ancestor ConditionalAccessExpression. Instead, we
+ // must walk upward until we find the ConditionalAccessExpression whose
+ // OperatorToken appears left of the MemberBinding.
+ if (parent.IsKind(SyntaxKind.ConditionalAccessExpression) &&
+ ((ConditionalAccessExpressionSyntax)parent).OperatorToken.Span.End <= node.SpanStart)
+ {
+ return (ConditionalAccessExpressionSyntax)parent;
+ }
+
+ parent = parent.Parent;
+ }
+
+ return null;
+ }
+
+ public static bool IsDelegateOrConstructorOrMethodParameterList(this SyntaxNode node)
+ {
+ if (!node.IsKind(SyntaxKind.ParameterList))
+ {
+ return false;
+ }
+
+ return
+ node.IsParentKind(SyntaxKind.MethodDeclaration) ||
+ node.IsParentKind(SyntaxKind.ConstructorDeclaration) ||
+ node.IsParentKind(SyntaxKind.DelegateDeclaration);
+ }
+
+ public static ConditionalAccessExpressionSyntax GetInnerMostConditionalAccessExpression(this SyntaxNode node)
+ {
+ if (!(node is ConditionalAccessExpressionSyntax))
+ {
+ return null;
+ }
+
+ var result = (ConditionalAccessExpressionSyntax)node;
+ while (result.WhenNotNull is ConditionalAccessExpressionSyntax)
+ {
+ result = (ConditionalAccessExpressionSyntax)result.WhenNotNull;
+ }
+
+ return result;
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/SyntaxTokenExtensions.cs b/main/src/addins/CSharpBinding/Util/SyntaxTokenExtensions.cs
new file mode 100644
index 0000000000..ad7e7ac08e
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SyntaxTokenExtensions.cs
@@ -0,0 +1,1111 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+using System;
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis.Text;
+using System.Threading;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class SyntaxTokenExtensions
+ {
+ public static SyntaxNode GetAncestor(this SyntaxToken token, Func<SyntaxNode, bool> predicate)
+ {
+ return token.GetAncestor<SyntaxNode>(predicate);
+ }
+
+ public static T GetAncestor<T>(this SyntaxToken token, Func<T, bool> predicate = null)
+ where T : SyntaxNode
+ {
+ return token.Parent != null
+ ? token.Parent.FirstAncestorOrSelf(predicate)
+ : default(T);
+ }
+
+ public static IEnumerable<T> GetAncestors<T>(this SyntaxToken token)
+ where T : SyntaxNode
+ {
+ return token.Parent != null
+ ? token.Parent.AncestorsAndSelf ().OfType<T> ()
+ : Enumerable.Empty<T> ();
+ }
+
+ public static IEnumerable<SyntaxNode> GetAncestors(this SyntaxToken token, Func<SyntaxNode, bool> predicate)
+ {
+ return token.Parent != null
+ ? token.Parent.AncestorsAndSelf().Where(predicate)
+ : Enumerable.Empty<SyntaxNode>();
+ }
+
+ public static SyntaxNode GetCommonRoot(this SyntaxToken token1, SyntaxToken token2)
+ {
+ // Contract.ThrowIfTrue(token1.RawKind == 0 || token2.RawKind == 0);
+
+ // find common starting node from two tokens.
+ // as long as two tokens belong to same tree, there must be at least on common root (Ex, compilation unit)
+ if (token1.Parent == null || token2.Parent == null)
+ {
+ return null;
+ }
+
+ return token1.Parent.GetCommonRoot(token2.Parent);
+ }
+
+ public static bool CheckParent<T>(this SyntaxToken token, Func<T, bool> valueChecker) where T : SyntaxNode
+ {
+ var parentNode = token.Parent as T;
+ if (parentNode == null)
+ {
+ return false;
+ }
+
+ return valueChecker(parentNode);
+ }
+
+ public static int Width(this SyntaxToken token)
+ {
+ return token.Span.Length;
+ }
+
+ public static int FullWidth(this SyntaxToken token)
+ {
+ return token.FullSpan.Length;
+ }
+
+ public static SyntaxToken FindTokenFromEnd(this SyntaxNode root, int position, bool includeZeroWidth = true, bool findInsideTrivia = false)
+ {
+ var token = root.FindToken(position, findInsideTrivia);
+ var previousToken = token.GetPreviousToken(
+ includeZeroWidth, findInsideTrivia, findInsideTrivia, findInsideTrivia);
+
+ if (token.SpanStart == position &&
+ previousToken.RawKind != 0 &&
+ previousToken.Span.End == position)
+ {
+ return previousToken;
+ }
+
+ return token;
+ }
+
+ public static bool IsUsingOrExternKeyword(this SyntaxToken token)
+ {
+ return
+ token.Kind() == SyntaxKind.UsingKeyword ||
+ token.Kind() == SyntaxKind.ExternKeyword;
+ }
+
+ public static bool IsUsingKeywordInUsingDirective(this SyntaxToken token)
+ {
+ if (token.IsKind(SyntaxKind.UsingKeyword))
+ {
+ var usingDirective = token.GetAncestor<UsingDirectiveSyntax>();
+ if (usingDirective != null &&
+ usingDirective.UsingKeyword == token)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsStaticKeywordInUsingDirective(this SyntaxToken token)
+ {
+ if (token.IsKind(SyntaxKind.StaticKeyword))
+ {
+ var usingDirective = token.GetAncestor<UsingDirectiveSyntax>();
+ if (usingDirective != null &&
+ usingDirective.StaticKeyword == token)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsBeginningOfStatementContext(this SyntaxToken token)
+ {
+ // cases:
+ // {
+ // |
+
+ // }
+ // |
+
+ // Note, the following is *not* a legal statement context:
+ // do { } |
+
+ // ...;
+ // |
+
+ // case 0:
+ // |
+
+ // default:
+ // |
+
+ // label:
+ // |
+
+ // if (foo)
+ // |
+
+ // while (true)
+ // |
+
+ // do
+ // |
+
+ // for (;;)
+ // |
+
+ // foreach (var v in c)
+ // |
+
+ // else
+ // |
+
+ // using (expr)
+ // |
+
+ // lock (expr)
+ // |
+
+ // for ( ; ; Foo(), |
+
+ if (token.Kind() == SyntaxKind.OpenBraceToken &&
+ token.Parent.IsKind(SyntaxKind.Block))
+ {
+ return true;
+ }
+
+ if (token.Kind() == SyntaxKind.SemicolonToken)
+ {
+ var statement = token.GetAncestor<StatementSyntax>();
+ if (statement != null && !statement.IsParentKind(SyntaxKind.GlobalStatement) &&
+ statement.GetLastToken(includeZeroWidth: true) == token)
+ {
+ return true;
+ }
+ }
+
+ if (token.Kind() == SyntaxKind.CloseBraceToken &&
+ token.Parent.IsKind(SyntaxKind.Block))
+ {
+ if (token.Parent.Parent is StatementSyntax)
+ {
+ // Most blocks that are the child of statement are places
+ // that we can follow with another statement. i.e.:
+ // if { }
+ // while () { }
+ // There are two exceptions.
+ // try {}
+ // do {}
+ if (!token.Parent.IsParentKind(SyntaxKind.TryStatement) &&
+ !token.Parent.IsParentKind(SyntaxKind.DoStatement))
+ {
+ return true;
+ }
+ }
+ else if (
+ token.Parent.IsParentKind(SyntaxKind.ElseClause) ||
+ token.Parent.IsParentKind(SyntaxKind.FinallyClause) ||
+ token.Parent.IsParentKind(SyntaxKind.CatchClause) ||
+ token.Parent.IsParentKind(SyntaxKind.SwitchSection))
+ {
+ return true;
+ }
+ }
+
+ if (token.Kind() == SyntaxKind.CloseBraceToken &&
+ token.Parent.IsKind(SyntaxKind.SwitchStatement))
+ {
+ return true;
+ }
+
+ if (token.Kind() == SyntaxKind.ColonToken)
+ {
+ if (token.Parent.IsKind(SyntaxKind.CaseSwitchLabel, SyntaxKind.DefaultSwitchLabel, SyntaxKind.LabeledStatement))
+ {
+ return true;
+ }
+ }
+
+ if (token.Kind() == SyntaxKind.DoKeyword &&
+ token.Parent.IsKind(SyntaxKind.DoStatement))
+ {
+ return true;
+ }
+
+ if (token.Kind() == SyntaxKind.CloseParenToken)
+ {
+ var parent = token.Parent;
+ if (parent.IsKind(SyntaxKind.ForStatement) ||
+ parent.IsKind(SyntaxKind.ForEachStatement) ||
+ parent.IsKind(SyntaxKind.WhileStatement) ||
+ parent.IsKind(SyntaxKind.IfStatement) ||
+ parent.IsKind(SyntaxKind.LockStatement) ||
+ parent.IsKind(SyntaxKind.UsingStatement))
+ {
+ return true;
+ }
+ }
+
+ if (token.Kind() == SyntaxKind.ElseKeyword)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsBeginningOfGlobalStatementContext(this SyntaxToken token)
+ {
+ // cases:
+ // }
+ // |
+
+ // ...;
+ // |
+
+ // extern alias Foo;
+ // using System;
+ // |
+
+ // [assembly: Foo]
+ // |
+
+ if (token.Kind() == SyntaxKind.CloseBraceToken)
+ {
+ var memberDeclaration = token.GetAncestor<MemberDeclarationSyntax>();
+ if (memberDeclaration != null && memberDeclaration.GetLastToken(includeZeroWidth: true) == token &&
+ memberDeclaration.IsParentKind(SyntaxKind.CompilationUnit))
+ {
+ return true;
+ }
+ }
+
+ if (token.Kind() == SyntaxKind.SemicolonToken)
+ {
+ var globalStatement = token.GetAncestor<GlobalStatementSyntax>();
+ if (globalStatement != null && globalStatement.GetLastToken(includeZeroWidth: true) == token)
+ {
+ return true;
+ }
+
+ var memberDeclaration = token.GetAncestor<MemberDeclarationSyntax>();
+ if (memberDeclaration != null && memberDeclaration.GetLastToken(includeZeroWidth: true) == token &&
+ memberDeclaration.IsParentKind(SyntaxKind.CompilationUnit))
+ {
+ return true;
+ }
+
+ var compUnit = token.GetAncestor<CompilationUnitSyntax>();
+ if (compUnit != null)
+ {
+ if (compUnit.Usings.Count > 0 && compUnit.Usings.Last().GetLastToken(includeZeroWidth: true) == token)
+ {
+ return true;
+ }
+
+ if (compUnit.Externs.Count > 0 && compUnit.Externs.Last().GetLastToken(includeZeroWidth: true) == token)
+ {
+ return true;
+ }
+ }
+ }
+
+ if (token.Kind() == SyntaxKind.CloseBracketToken)
+ {
+ var compUnit = token.GetAncestor<CompilationUnitSyntax>();
+ if (compUnit != null)
+ {
+ if (compUnit.AttributeLists.Count > 0 && compUnit.AttributeLists.Last().GetLastToken(includeZeroWidth: true) == token)
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsAfterPossibleCast(this SyntaxToken token)
+ {
+ if (token.Kind() == SyntaxKind.CloseParenToken)
+ {
+ if (token.Parent.IsKind(SyntaxKind.CastExpression))
+ {
+ return true;
+ }
+
+ if (token.Parent.IsKind(SyntaxKind.ParenthesizedExpression))
+ {
+ var parenExpr = token.Parent as ParenthesizedExpressionSyntax;
+ var expr = parenExpr.Expression;
+
+ if (expr is TypeSyntax)
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsLastTokenOfNode<T>(this SyntaxToken token)
+ where T : SyntaxNode
+ {
+ var node = token.GetAncestor<T>();
+ return node != null && token == node.GetLastToken(includeZeroWidth: true);
+ }
+
+ public static bool IsLastTokenOfQueryClause(this SyntaxToken token)
+ {
+ if (token.IsLastTokenOfNode<QueryClauseSyntax>())
+ {
+ return true;
+ }
+
+ if (token.Kind() == SyntaxKind.IdentifierToken &&
+ token.GetPreviousToken(includeSkipped: true).Kind() == SyntaxKind.IntoKeyword)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsPreProcessorExpressionContext(this SyntaxToken targetToken)
+ {
+ // cases:
+ // #if |
+ // #if foo || |
+ // #if foo && |
+ // #if ( |
+ // #if ! |
+ // Same for elif
+
+ if (targetToken.GetAncestor<ConditionalDirectiveTriviaSyntax>() == null)
+ {
+ return false;
+ }
+
+ // #if
+ // #elif
+ if (targetToken.Kind() == SyntaxKind.IfKeyword ||
+ targetToken.Kind() == SyntaxKind.ElifKeyword)
+ {
+ return true;
+ }
+
+ // ( |
+ if (targetToken.Kind() == SyntaxKind.OpenParenToken &&
+ targetToken.Parent.IsKind(SyntaxKind.ParenthesizedExpression))
+ {
+ return true;
+ }
+
+ // ! |
+ if (targetToken.Parent is PrefixUnaryExpressionSyntax)
+ {
+ var prefix = targetToken.Parent as PrefixUnaryExpressionSyntax;
+ return prefix.OperatorToken == targetToken;
+ }
+
+ // a &&
+ // a ||
+ if (targetToken.Parent is BinaryExpressionSyntax)
+ {
+ var binary = targetToken.Parent as BinaryExpressionSyntax;
+ return binary.OperatorToken == targetToken;
+ }
+
+ return false;
+ }
+
+ public static bool IsOrderByDirectionContext(this SyntaxToken targetToken)
+ {
+ // cases:
+ // orderby a |
+ // orderby a a|
+ // orderby a, b |
+ // orderby a, b a|
+
+ if (!targetToken.IsKind(SyntaxKind.IdentifierToken, SyntaxKind.CloseParenToken, SyntaxKind.CloseBracketToken))
+ {
+ return false;
+ }
+
+ var ordering = targetToken.GetAncestor<OrderingSyntax>();
+ if (ordering == null)
+ {
+ return false;
+ }
+
+ // orderby a |
+ // orderby a, b |
+ var lastToken = ordering.Expression.GetLastToken(includeSkipped: true);
+
+ if (targetToken == lastToken)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsSwitchLabelContext(this SyntaxToken targetToken)
+ {
+ // cases:
+ // case X: |
+ // default: |
+ // switch (e) { |
+ //
+ // case X: Statement(); |
+
+ if (targetToken.Kind() == SyntaxKind.OpenBraceToken &&
+ targetToken.Parent.IsKind(SyntaxKind.SwitchStatement))
+ {
+ return true;
+ }
+
+ if (targetToken.Kind() == SyntaxKind.ColonToken)
+ {
+ if (targetToken.Parent.IsKind(SyntaxKind.CaseSwitchLabel, SyntaxKind.DefaultSwitchLabel))
+ {
+ return true;
+ }
+ }
+
+ if (targetToken.Kind() == SyntaxKind.SemicolonToken ||
+ targetToken.Kind() == SyntaxKind.CloseBraceToken)
+ {
+ var section = targetToken.GetAncestor<SwitchSectionSyntax>();
+ if (section != null)
+ {
+ foreach (var statement in section.Statements)
+ {
+ if (targetToken == statement.GetLastToken(includeSkipped: true))
+ {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsXmlCrefParameterModifierContext(this SyntaxToken targetToken)
+ {
+ return targetToken.IsKind(SyntaxKind.CommaToken, SyntaxKind.OpenParenToken)
+ && targetToken.Parent.IsKind(SyntaxKind.CrefBracketedParameterList, SyntaxKind.CrefParameterList);
+ }
+
+ public static bool IsConstructorOrMethodParameterArgumentContext(this SyntaxToken targetToken)
+ {
+ // cases:
+ // Foo( |
+ // Foo(expr, |
+ // Foo(bar: |
+ // new Foo( |
+ // new Foo(expr, |
+ // new Foo(bar: |
+ // Foo : base( |
+ // Foo : base(bar: |
+ // Foo : this( |
+ // Foo : ths(bar: |
+
+ // Foo(bar: |
+ if (targetToken.Kind() == SyntaxKind.ColonToken &&
+ targetToken.Parent.IsKind(SyntaxKind.NameColon) &&
+ targetToken.Parent.IsParentKind(SyntaxKind.Argument) &&
+ targetToken.Parent.GetParent().IsParentKind(SyntaxKind.ArgumentList))
+ {
+ var owner = targetToken.Parent.GetParent().GetParent().GetParent();
+ if (owner.IsKind(SyntaxKind.InvocationExpression) ||
+ owner.IsKind(SyntaxKind.ObjectCreationExpression) ||
+ owner.IsKind(SyntaxKind.BaseConstructorInitializer) ||
+ owner.IsKind(SyntaxKind.ThisConstructorInitializer))
+ {
+ return true;
+ }
+ }
+
+ if (targetToken.Kind() == SyntaxKind.OpenParenToken ||
+ targetToken.Kind() == SyntaxKind.CommaToken)
+ {
+ if (targetToken.Parent.IsKind(SyntaxKind.ArgumentList))
+ {
+ if (targetToken.Parent.IsParentKind(SyntaxKind.InvocationExpression) ||
+ targetToken.Parent.IsParentKind(SyntaxKind.ObjectCreationExpression) ||
+ targetToken.Parent.IsParentKind(SyntaxKind.BaseConstructorInitializer) ||
+ targetToken.Parent.IsParentKind(SyntaxKind.ThisConstructorInitializer))
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsUnaryOperatorContext(this SyntaxToken targetToken)
+ {
+ if (targetToken.Kind() == SyntaxKind.OperatorKeyword &&
+ targetToken.GetPreviousToken(includeSkipped: true).IsLastTokenOfNode<TypeSyntax>())
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsUnsafeContext(this SyntaxToken targetToken)
+ {
+ return
+ targetToken.GetAncestors<StatementSyntax>().Any(s => s.IsKind(SyntaxKind.UnsafeStatement)) ||
+ targetToken.GetAncestors<MemberDeclarationSyntax>().Any(m => m.GetModifiers().Any(SyntaxKind.UnsafeKeyword));
+ }
+
+ public static bool IsAfterYieldKeyword(this SyntaxToken targetToken)
+ {
+ // yield |
+ // yield r|
+
+ if (targetToken.IsKindOrHasMatchingText(SyntaxKind.YieldKeyword))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsAccessorDeclarationContext<TMemberNode>(this SyntaxToken targetToken, int position, SyntaxKind kind = SyntaxKind.None)
+ where TMemberNode : SyntaxNode
+ {
+ if (!IsAccessorDeclarationContextWorker(targetToken))
+ {
+ return false;
+ }
+
+ var list = targetToken.GetAncestor<AccessorListSyntax>();
+ if (list == null)
+ {
+ return false;
+ }
+
+ // Check if we already have this accessor. (however, don't count it
+ // if the user is *on* that accessor.
+ var existingAccessor = list.Accessors
+ .Select(a => a.Keyword)
+ .FirstOrDefault(a => !a.IsMissing && a.IsKindOrHasMatchingText(kind));
+
+ if (existingAccessor.Kind() != SyntaxKind.None)
+ {
+ var existingAccessorSpan = existingAccessor.Span;
+ if (!existingAccessorSpan.IntersectsWith(position))
+ {
+ return false;
+ }
+ }
+
+ var decl = targetToken.GetAncestor<TMemberNode>();
+ return decl != null;
+ }
+
+ private static bool IsAccessorDeclarationContextWorker(SyntaxToken targetToken)
+ {
+ // cases:
+ // int Foo { |
+ // int Foo { private |
+ // int Foo { set { } |
+ // int Foo { set; |
+ // int Foo { [Bar]|
+
+ // Consume all preceding access modifiers
+ while (targetToken.Kind() == SyntaxKind.InternalKeyword ||
+ targetToken.Kind() == SyntaxKind.PublicKeyword ||
+ targetToken.Kind() == SyntaxKind.ProtectedKeyword ||
+ targetToken.Kind() == SyntaxKind.PrivateKeyword)
+ {
+ targetToken = targetToken.GetPreviousToken(includeSkipped: true);
+ }
+
+ // int Foo { |
+ // int Foo { private |
+ if (targetToken.Kind() == SyntaxKind.OpenBraceToken &&
+ targetToken.Parent.IsKind(SyntaxKind.AccessorList))
+ {
+ return true;
+ }
+
+ // int Foo { set { } |
+ // int Foo { set { } private |
+ if (targetToken.Kind() == SyntaxKind.CloseBraceToken &&
+ targetToken.Parent.IsKind(SyntaxKind.Block) &&
+ targetToken.Parent.GetParent() is AccessorDeclarationSyntax)
+ {
+ return true;
+ }
+
+ // int Foo { set; |
+ if (targetToken.Kind() == SyntaxKind.SemicolonToken &&
+ targetToken.Parent is AccessorDeclarationSyntax)
+ {
+ return true;
+ }
+
+ // int Foo { [Bar]|
+ if (targetToken.Kind() == SyntaxKind.CloseBracketToken &&
+ targetToken.Parent.IsKind(SyntaxKind.AttributeList) &&
+ targetToken.Parent.GetParent() is AccessorDeclarationSyntax)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ private static bool IsGenericInterfaceOrDelegateTypeParameterList(SyntaxNode node)
+ {
+ if (node.IsKind(SyntaxKind.TypeParameterList))
+ {
+ if (node.IsParentKind(SyntaxKind.InterfaceDeclaration))
+ {
+ var decl = node.Parent as TypeDeclarationSyntax;
+ return decl.TypeParameterList == node;
+ }
+ else if (node.IsParentKind(SyntaxKind.DelegateDeclaration))
+ {
+ var decl = node.Parent as DelegateDeclarationSyntax;
+ return decl.TypeParameterList == node;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsTypeParameterVarianceContext(this SyntaxToken targetToken)
+ {
+ // cases:
+ // interface IFoo<|
+ // interface IFoo<A,|
+ // interface IFoo<[Bar]|
+
+ // deletate X D<|
+ // deletate X D<A,|
+ // deletate X D<[Bar]|
+ if (targetToken.Kind() == SyntaxKind.LessThanToken &&
+ IsGenericInterfaceOrDelegateTypeParameterList(targetToken.Parent))
+ {
+ return true;
+ }
+
+ if (targetToken.Kind() == SyntaxKind.CommaToken &&
+ IsGenericInterfaceOrDelegateTypeParameterList(targetToken.Parent))
+ {
+ return true;
+ }
+
+ if (targetToken.Kind() == SyntaxKind.CloseBracketToken &&
+ targetToken.Parent.IsKind(SyntaxKind.AttributeList) &&
+ targetToken.Parent.IsParentKind(SyntaxKind.TypeParameter) &&
+ IsGenericInterfaceOrDelegateTypeParameterList(targetToken.Parent.GetParent().GetParent()))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsMandatoryNamedParameterPosition(this SyntaxToken token)
+ {
+ if (token.Kind() == SyntaxKind.CommaToken && token.Parent is BaseArgumentListSyntax)
+ {
+ var argumentList = (BaseArgumentListSyntax)token.Parent;
+
+ foreach (var item in argumentList.Arguments.GetWithSeparators())
+ {
+ if (item.IsToken && item.AsToken() == token)
+ {
+ return false;
+ }
+
+ if (item.IsNode)
+ {
+ var node = item.AsNode() as ArgumentSyntax;
+ if (node != null && node.NameColon != null)
+ {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsKindOrHasMatchingText(this SyntaxToken token, SyntaxKind kind)
+ {
+ return token.Kind() == kind || token.HasMatchingText(kind);
+ }
+
+ public static bool HasMatchingText(this SyntaxToken token, SyntaxKind kind)
+ {
+ return token.ToString() == SyntaxFacts.GetText(kind);
+ }
+
+ public static bool IsKind(this SyntaxToken token, SyntaxKind kind1, SyntaxKind kind2)
+ {
+ return token.Kind() == kind1
+ || token.Kind() == kind2;
+ }
+
+ public static bool IsKind(this SyntaxToken token, SyntaxKind kind1, SyntaxKind kind2, SyntaxKind kind3)
+ {
+ return token.Kind() == kind1
+ || token.Kind() == kind2
+ || token.Kind() == kind3;
+ }
+
+ public static bool IsKind(this SyntaxToken token, params SyntaxKind[] kinds)
+ {
+ return kinds.Contains(token.Kind());
+ }
+
+ public static bool IsKind(this SyntaxToken token, SyntaxKind kind)
+ {
+ return token.Kind() == kind;
+ }
+
+ public static bool IsLiteral(this SyntaxToken token)
+ {
+ switch (token.Kind())
+ {
+ case SyntaxKind.CharacterLiteralToken:
+ case SyntaxKind.FalseKeyword:
+ case SyntaxKind.NumericLiteralToken:
+ case SyntaxKind.StringLiteralToken:
+ case SyntaxKind.TrueKeyword:
+ return true;
+
+ default:
+ return false;
+ }
+ }
+
+ public static bool IntersectsWith(this SyntaxToken token, int position)
+ {
+ return token.Span.IntersectsWith(position);
+ }
+
+ public static SyntaxToken GetPreviousTokenIfTouchingWord(this SyntaxToken token, int position)
+ {
+ return token.IntersectsWith(position) && IsWord(token)
+ ? token.GetPreviousToken(includeSkipped: true)
+ : token;
+ }
+
+ public static bool IsWord(this SyntaxToken token)
+ {
+ return token.IsKind(SyntaxKind.IdentifierToken)
+ || SyntaxFacts.IsKeywordKind(token.Kind())
+ || SyntaxFacts.IsContextualKeyword(token.Kind())
+ || SyntaxFacts.IsPreprocessorKeyword(token.Kind());
+ }
+
+ public static SyntaxToken GetNextNonZeroWidthTokenOrEndOfFile(this SyntaxToken token)
+ {
+ return token.GetNextTokenOrEndOfFile();
+ }
+
+ public static SyntaxToken GetNextTokenOrEndOfFile(
+ this SyntaxToken token,
+ bool includeZeroWidth = false,
+ bool includeSkipped = false,
+ bool includeDirectives = false,
+ bool includeDocumentationComments = false)
+ {
+ var nextToken = token.GetNextToken(includeZeroWidth, includeSkipped, includeDirectives, includeDocumentationComments);
+
+ return nextToken.Kind() == SyntaxKind.None
+ ? token.GetAncestor<CompilationUnitSyntax>().EndOfFileToken
+ : nextToken;
+ }
+
+ public static SyntaxToken With(this SyntaxToken token, SyntaxTriviaList leading, SyntaxTriviaList trailing)
+ {
+ return token.WithLeadingTrivia(leading).WithTrailingTrivia(trailing);
+ }
+
+ /// <summary>
+ /// Determines whether the given SyntaxToken is the first token on a line in the specified SourceText.
+ /// </summary>
+ public static bool IsFirstTokenOnLine(this SyntaxToken token, SourceText text)
+ {
+ var previousToken = token.GetPreviousToken(includeSkipped: true, includeDirectives: true, includeDocumentationComments: true);
+ if (previousToken.Kind() == SyntaxKind.None)
+ {
+ return true;
+ }
+
+ var tokenLine = text.Lines.IndexOf(token.SpanStart);
+ var previousTokenLine = text.Lines.IndexOf(previousToken.SpanStart);
+ return tokenLine > previousTokenLine;
+ }
+
+ public static bool SpansPreprocessorDirective(this IEnumerable<SyntaxToken> tokens)
+ {
+ // we want to check all leading trivia of all tokens (except the
+ // first one), and all trailing trivia of all tokens (except the
+ // last one).
+
+ var first = true;
+ var previousToken = default(SyntaxToken);
+
+ foreach (var token in tokens)
+ {
+ if (first)
+ {
+ first = false;
+ }
+ else
+ {
+ // check the leading trivia of this token, and the trailing trivia
+ // of the previous token.
+ if (SpansPreprocessorDirective(token.LeadingTrivia) ||
+ SpansPreprocessorDirective(previousToken.TrailingTrivia))
+ {
+ return true;
+ }
+ }
+
+ previousToken = token;
+ }
+
+ return false;
+ }
+
+ private static bool SpansPreprocessorDirective(SyntaxTriviaList list)
+ {
+ return list.Any(t => t.GetStructure() is DirectiveTriviaSyntax);
+ }
+
+ public static SyntaxToken WithoutTrivia(
+ this SyntaxToken token,
+ params SyntaxTrivia[] trivia)
+ {
+ if (!token.LeadingTrivia.Any() && !token.TrailingTrivia.Any())
+ {
+ return token;
+ }
+
+ return token.With(new SyntaxTriviaList(), new SyntaxTriviaList());
+ }
+
+ public static SyntaxToken WithPrependedLeadingTrivia(
+ this SyntaxToken token,
+ params SyntaxTrivia[] trivia)
+ {
+ if (trivia.Length == 0)
+ {
+ return token;
+ }
+
+ return token.WithPrependedLeadingTrivia((IEnumerable<SyntaxTrivia>)trivia);
+ }
+
+ public static SyntaxToken WithPrependedLeadingTrivia(
+ this SyntaxToken token,
+ SyntaxTriviaList trivia)
+ {
+ if (trivia.Count == 0)
+ {
+ return token;
+ }
+
+ return token.WithLeadingTrivia(trivia.Concat(token.LeadingTrivia));
+ }
+
+ public static SyntaxToken WithPrependedLeadingTrivia(
+ this SyntaxToken token,
+ IEnumerable<SyntaxTrivia> trivia)
+ {
+ return token.WithPrependedLeadingTrivia(trivia.ToSyntaxTriviaList());
+ }
+
+ public static SyntaxToken WithAppendedTrailingTrivia(
+ this SyntaxToken token,
+ IEnumerable<SyntaxTrivia> trivia)
+ {
+ return token.WithTrailingTrivia(token.TrailingTrivia.Concat(trivia));
+ }
+
+ /// <summary>
+ /// Retrieves all trivia after this token, including it's trailing trivia and
+ /// the leading trivia of the next token.
+ /// </summary>
+ public static IEnumerable<SyntaxTrivia> GetAllTrailingTrivia(this SyntaxToken token)
+ {
+ foreach (var trivia in token.TrailingTrivia)
+ {
+ yield return trivia;
+ }
+
+ var nextToken = token.GetNextTokenOrEndOfFile(includeZeroWidth: true, includeSkipped: true, includeDirectives: true, includeDocumentationComments: true);
+
+ foreach (var trivia in nextToken.LeadingTrivia)
+ {
+ yield return trivia;
+ }
+ }
+
+ public static bool TryParseGenericName(this SyntaxToken genericIdentifier, CancellationToken cancellationToken, out GenericNameSyntax genericName)
+ {
+ if (genericIdentifier.GetNextToken(includeSkipped: true).Kind() == SyntaxKind.LessThanToken)
+ {
+ var lastToken = genericIdentifier.FindLastTokenOfPartialGenericName();
+
+ var syntaxTree = genericIdentifier.SyntaxTree;
+ var name = SyntaxFactory.ParseName(syntaxTree.GetText(cancellationToken).ToString(TextSpan.FromBounds(genericIdentifier.SpanStart, lastToken.Span.End)));
+
+ genericName = name as GenericNameSyntax;
+ return genericName != null;
+ }
+
+ genericName = null;
+ return false;
+ }
+
+ /// <summary>
+ /// Lexically, find the last token that looks like it's part of this generic name.
+ /// </summary>
+ /// <param name="genericIdentifier">The "name" of the generic identifier, last token before
+ /// the "&amp;"</param>
+ /// <returns>The last token in the name</returns>
+ /// <remarks>This is related to the code in <see cref="SyntaxTreeExtensions.IsInPartiallyWrittenGeneric(SyntaxTree, int, CancellationToken)"/></remarks>
+ public static SyntaxToken FindLastTokenOfPartialGenericName(this SyntaxToken genericIdentifier)
+ {
+ //Contract.ThrowIfFalse(genericIdentifier.Kind() == SyntaxKind.IdentifierToken);
+
+ // advance to the "<" token
+ var token = genericIdentifier.GetNextToken(includeSkipped: true);
+ //Contract.ThrowIfFalse(token.Kind() == SyntaxKind.LessThanToken);
+
+ int stack = 0;
+
+ do
+ {
+ // look forward one token
+ {
+ var next = token.GetNextToken(includeSkipped: true);
+ if (next.Kind() == SyntaxKind.None)
+ {
+ return token;
+ }
+
+ token = next;
+ }
+
+ if (token.Kind() == SyntaxKind.GreaterThanToken)
+ {
+ if (stack == 0)
+ {
+ return token;
+ }
+ else
+ {
+ stack--;
+ continue;
+ }
+ }
+
+ switch (token.Kind())
+ {
+ case SyntaxKind.LessThanLessThanToken:
+ stack++;
+ goto case SyntaxKind.LessThanToken;
+
+ // fall through
+ case SyntaxKind.LessThanToken:
+ stack++;
+ break;
+
+ case SyntaxKind.AsteriskToken: // for int*
+ case SyntaxKind.QuestionToken: // for int?
+ case SyntaxKind.ColonToken: // for global:: (so we don't dismiss help as you type the first :)
+ case SyntaxKind.ColonColonToken: // for global::
+ case SyntaxKind.CloseBracketToken:
+ case SyntaxKind.OpenBracketToken:
+ case SyntaxKind.DotToken:
+ case SyntaxKind.IdentifierToken:
+ case SyntaxKind.CommaToken:
+ break;
+
+ // If we see a member declaration keyword, we know we've gone too far
+ case SyntaxKind.ClassKeyword:
+ case SyntaxKind.StructKeyword:
+ case SyntaxKind.InterfaceKeyword:
+ case SyntaxKind.DelegateKeyword:
+ case SyntaxKind.EnumKeyword:
+ case SyntaxKind.PrivateKeyword:
+ case SyntaxKind.PublicKeyword:
+ case SyntaxKind.InternalKeyword:
+ case SyntaxKind.ProtectedKeyword:
+ case SyntaxKind.VoidKeyword:
+ return token.GetPreviousToken(includeSkipped: true);
+
+ default:
+ // user might have typed "in" on the way to typing "int"
+ // don't want to disregard this genericname because of that
+ if (SyntaxFacts.IsKeywordKind(token.Kind()))
+ {
+ break;
+ }
+
+ // anything else and we're sunk. Go back to the token before.
+ return token.GetPreviousToken(includeSkipped: true);
+ }
+ }
+ while (true);
+ }
+
+ public static bool IsRegularStringLiteral(this SyntaxToken token)
+ {
+ return token.Kind() == SyntaxKind.StringLiteralToken && !token.IsVerbatimStringLiteral();
+ }
+
+ public static bool IsValidAttributeTarget(this SyntaxToken token)
+ {
+ switch (token.Kind())
+ {
+ case SyntaxKind.AssemblyKeyword:
+ case SyntaxKind.ModuleKeyword:
+ case SyntaxKind.FieldKeyword:
+ case SyntaxKind.EventKeyword:
+ case SyntaxKind.MethodKeyword:
+ case SyntaxKind.ParamKeyword:
+ case SyntaxKind.PropertyKeyword:
+ case SyntaxKind.ReturnKeyword:
+ case SyntaxKind.TypeKeyword:
+ return true;
+
+ default:
+ return false;
+ }
+ }
+
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/SyntaxTreeExtensions.cs b/main/src/addins/CSharpBinding/Util/SyntaxTreeExtensions.cs
new file mode 100644
index 0000000000..cb556b3996
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SyntaxTreeExtensions.cs
@@ -0,0 +1,3322 @@
+//
+// SyntaxTreeExtensions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis;
+using System.Threading;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis.Text;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class SyntaxTreeExtensions
+ {
+// /// <summary>
+// /// Returns the identifier, keyword, contextual keyword or preprocessor keyword touching this
+// /// position, or a token of Kind = None if the caret is not touching either.
+// /// </summary>
+// public static SyntaxToken GetTouchingWord(
+// this SyntaxTree syntaxTree,
+// int position,
+// ISyntaxFactsService syntaxFacts,
+// CancellationToken cancellationToken,
+// bool findInsideTrivia = false)
+// {
+// return GetTouchingToken(syntaxTree, position, syntaxFacts.IsWord, cancellationToken, findInsideTrivia);
+// }
+
+ public static SyntaxToken GetTouchingToken(
+ this SyntaxTree syntaxTree,
+ int position,
+ CancellationToken cancellationToken,
+ bool findInsideTrivia = false)
+ {
+ return GetTouchingToken(syntaxTree, position, _ => true, cancellationToken, findInsideTrivia);
+ }
+
+ public static SyntaxToken GetTouchingToken(
+ this SyntaxTree syntaxTree,
+ int position,
+ Predicate<SyntaxToken> predicate,
+ CancellationToken cancellationToken,
+ bool findInsideTrivia = false)
+ {
+ // Contract.ThrowIfNull(syntaxTree);
+
+ if (position >= syntaxTree.Length)
+ {
+ return default(SyntaxToken);
+ }
+
+ var token = syntaxTree.GetRoot(cancellationToken).FindToken(position, findInsideTrivia);
+
+ if ((token.Span.Contains(position) || token.Span.End == position) && predicate(token))
+ {
+ return token;
+ }
+
+ token = token.GetPreviousToken();
+
+ if (token.Span.End == position && predicate(token))
+ {
+ return token;
+ }
+
+ // SyntaxKind = None
+ return default(SyntaxToken);
+ }
+
+ public static bool OverlapsHiddenPosition(this SyntaxTree tree, TextSpan span, CancellationToken cancellationToken)
+ {
+ if (tree == null)
+ {
+ return false;
+ }
+
+ var text = tree.GetText(cancellationToken);
+
+ return text.OverlapsHiddenPosition(span, (position, cancellationToken2) =>
+ {
+ // implements the ASP.Net IsHidden rule
+ var lineVisibility = tree.GetLineVisibility(position, cancellationToken2);
+ return lineVisibility == LineVisibility.Hidden || lineVisibility == LineVisibility.BeforeFirstLineDirective;
+ },
+ cancellationToken);
+ }
+
+ public static bool IsEntirelyHidden(this SyntaxTree tree, TextSpan span, CancellationToken cancellationToken)
+ {
+ if (!tree.HasHiddenRegions())
+ {
+ return false;
+ }
+
+ var text = tree.GetText(cancellationToken);
+ var startLineNumber = text.Lines.IndexOf(span.Start);
+ var endLineNumber = text.Lines.IndexOf(span.End);
+
+ for (var lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+
+ var linePosition = text.Lines[lineNumber].Start;
+ if (!tree.IsHiddenPosition(linePosition, cancellationToken))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /// <summary>
+ /// Returns <c>true</c> if the provided position is in a hidden region inaccessible to the user.
+ /// </summary>
+ public static bool IsHiddenPosition(this SyntaxTree tree, int position, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (!tree.HasHiddenRegions())
+ {
+ return false;
+ }
+
+ var lineVisibility = tree.GetLineVisibility(position, cancellationToken);
+ return lineVisibility == LineVisibility.Hidden || lineVisibility == LineVisibility.BeforeFirstLineDirective;
+ }
+
+ public static bool IsInteractiveOrScript(this SyntaxTree syntaxTree)
+ {
+ return syntaxTree.Options.Kind != SourceCodeKind.Regular;
+ }
+
+ public static ISet<SyntaxKind> GetPrecedingModifiers(
+ this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ var result = new HashSet<SyntaxKind>(SyntaxFacts.EqualityComparer);
+ while (true)
+ {
+ switch (token.Kind())
+ {
+ case SyntaxKind.PublicKeyword:
+ case SyntaxKind.InternalKeyword:
+ case SyntaxKind.ProtectedKeyword:
+ case SyntaxKind.PrivateKeyword:
+ case SyntaxKind.SealedKeyword:
+ case SyntaxKind.AbstractKeyword:
+ case SyntaxKind.StaticKeyword:
+ case SyntaxKind.VirtualKeyword:
+ case SyntaxKind.ExternKeyword:
+ case SyntaxKind.NewKeyword:
+ case SyntaxKind.OverrideKeyword:
+ case SyntaxKind.ReadOnlyKeyword:
+ case SyntaxKind.VolatileKeyword:
+ case SyntaxKind.UnsafeKeyword:
+ case SyntaxKind.AsyncKeyword:
+ result.Add(token.Kind());
+ token = token.GetPreviousToken(includeSkipped: true);
+ continue;
+ case SyntaxKind.IdentifierToken:
+ if (token.HasMatchingText(SyntaxKind.AsyncKeyword))
+ {
+ result.Add(SyntaxKind.AsyncKeyword);
+ token = token.GetPreviousToken(includeSkipped: true);
+ continue;
+ }
+
+ break;
+ }
+
+ break;
+ }
+
+ return result;
+ }
+
+ public static TypeDeclarationSyntax GetContainingTypeDeclaration(
+ this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ return syntaxTree.GetContainingTypeDeclarations(position, cancellationToken).FirstOrDefault();
+ }
+
+ public static BaseTypeDeclarationSyntax GetContainingTypeOrEnumDeclaration(
+ this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ return syntaxTree.GetContainingTypeOrEnumDeclarations(position, cancellationToken).FirstOrDefault();
+ }
+
+ public static IEnumerable<TypeDeclarationSyntax> GetContainingTypeDeclarations(
+ this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+
+ return token.GetAncestors<TypeDeclarationSyntax>().Where(t =>
+ {
+ return BaseTypeDeclarationContainsPosition(t, position);
+ });
+ }
+
+ private static bool BaseTypeDeclarationContainsPosition(BaseTypeDeclarationSyntax declaration, int position)
+ {
+ if (position <= declaration.OpenBraceToken.SpanStart)
+ {
+ return false;
+ }
+
+ if (declaration.CloseBraceToken.IsMissing)
+ {
+ return true;
+ }
+
+ return position <= declaration.CloseBraceToken.SpanStart;
+ }
+
+ public static IEnumerable<BaseTypeDeclarationSyntax> GetContainingTypeOrEnumDeclarations(
+ this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+
+ return token.GetAncestors<BaseTypeDeclarationSyntax>().Where(t => BaseTypeDeclarationContainsPosition(t, position));
+ }
+
+// /// <summary>
+// /// If the position is inside of token, return that token; otherwise, return the token to the right.
+// /// </summary>
+// public static SyntaxToken FindTokenOnRightOfPosition(
+// this SyntaxTree syntaxTree,
+// int position,
+// CancellationToken cancellationToken,
+// bool includeSkipped = true,
+// bool includeDirectives = false,
+// bool includeDocumentationComments = false)
+// {
+// return syntaxTree.GetRoot(cancellationToken).FindTokenOnRightOfPosition(
+// position, includeSkipped, includeDirectives, includeDocumentationComments);
+// }
+
+ /// <summary>
+ /// If the position is inside of token, return that token; otherwise, return the token to the left.
+ /// </summary>
+ public static SyntaxToken FindTokenOnLeftOfPosition(
+ this SyntaxTree syntaxTree,
+ int position,
+ CancellationToken cancellationToken,
+ bool includeSkipped = true,
+ bool includeDirectives = false,
+ bool includeDocumentationComments = false)
+ {
+ return syntaxTree.GetRoot(cancellationToken).FindTokenOnLeftOfPosition(
+ position, includeSkipped, includeDirectives, includeDocumentationComments);
+ }
+
+ private static readonly Func<SyntaxKind, bool> s_isDotOrArrow = k => k == SyntaxKind.DotToken || k == SyntaxKind.MinusGreaterThanToken;
+ private static readonly Func<SyntaxKind, bool> s_isDotOrArrowOrColonColon =
+ k => k == SyntaxKind.DotToken || k == SyntaxKind.MinusGreaterThanToken || k == SyntaxKind.ColonColonToken;
+
+ public static bool IsNamespaceDeclarationNameContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ var namespaceName = token.GetAncestor<NamespaceDeclarationSyntax>();
+ if (namespaceName == null)
+ {
+ return false;
+ }
+
+ return namespaceName.Name.Span.IntersectsWith(position);
+ }
+
+ public static bool IsRightOfDotOrArrowOrColonColon(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ return syntaxTree.IsRightOf(position, s_isDotOrArrowOrColonColon, cancellationToken);
+ }
+
+ public static bool IsRightOfDotOrArrow(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ return syntaxTree.IsRightOf(position, s_isDotOrArrow, cancellationToken);
+ }
+
+ private static bool IsRightOf(
+ this SyntaxTree syntaxTree, int position, Func<SyntaxKind, bool> predicate, CancellationToken cancellationToken)
+ {
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.None)
+ {
+ return false;
+ }
+
+ return predicate(token.Kind());
+ }
+
+ public static bool IsRightOfNumericLiteral(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ return token.Kind() == SyntaxKind.NumericLiteralToken;
+ }
+
+ public static bool IsPrimaryFunctionExpressionContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ return
+ syntaxTree.IsTypeOfExpressionContext(position, tokenOnLeftOfPosition, cancellationToken) ||
+ syntaxTree.IsDefaultExpressionContext(position, tokenOnLeftOfPosition, cancellationToken) ||
+ syntaxTree.IsSizeOfExpressionContext(position, tokenOnLeftOfPosition, cancellationToken);
+ }
+
+ public static bool IsAfterKeyword(this SyntaxTree syntaxTree, int position, SyntaxKind kind, CancellationToken cancellationToken)
+ {
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ return token.Kind() == kind;
+ }
+
+ public static bool IsInNonUserCode(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ return
+ syntaxTree.IsEntirelyWithinNonUserCodeComment(position, cancellationToken) ||
+ syntaxTree.IsEntirelyWithinStringOrCharLiteral(position, cancellationToken) ||
+ syntaxTree.IsInInactiveRegion(position, cancellationToken);
+ }
+
+ public static bool IsEntirelyWithinNonUserCodeComment(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ var inNonUserSingleLineDocComment =
+ syntaxTree.IsEntirelyWithinSingleLineDocComment(position, cancellationToken) && !syntaxTree.IsEntirelyWithinCrefSyntax(position, cancellationToken);
+ return
+ syntaxTree.IsEntirelyWithinTopLevelSingleLineComment(position, cancellationToken) ||
+ syntaxTree.IsEntirelyWithinPreProcessorSingleLineComment(position, cancellationToken) ||
+ syntaxTree.IsEntirelyWithinMultiLineComment(position, cancellationToken) ||
+ syntaxTree.IsEntirelyWithinMultiLineDocComment(position, cancellationToken) ||
+ inNonUserSingleLineDocComment;
+ }
+
+ public static bool IsEntirelyWithinComment(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ return
+ syntaxTree.IsEntirelyWithinTopLevelSingleLineComment(position, cancellationToken) ||
+ syntaxTree.IsEntirelyWithinPreProcessorSingleLineComment(position, cancellationToken) ||
+ syntaxTree.IsEntirelyWithinMultiLineComment(position, cancellationToken) ||
+ syntaxTree.IsEntirelyWithinMultiLineDocComment(position, cancellationToken) ||
+ syntaxTree.IsEntirelyWithinSingleLineDocComment(position, cancellationToken);
+ }
+
+ public static bool IsCrefContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken, includeDocumentationComments: true);
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Parent is XmlCrefAttributeSyntax)
+ {
+ var attribute = (XmlCrefAttributeSyntax)token.Parent;
+ return token == attribute.StartQuoteToken;
+ }
+
+ return false;
+ }
+
+ public static bool IsEntirelyWithinCrefSyntax(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ if (syntaxTree.IsCrefContext(position, cancellationToken))
+ {
+ return true;
+ }
+
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken, includeDocumentationComments: true);
+ return token.GetAncestor<CrefSyntax>() != null;
+ }
+
+ public static bool IsEntirelyWithinSingleLineDocComment(
+ this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ var root = syntaxTree.GetRoot(cancellationToken) as CompilationUnitSyntax;
+ var trivia = root.FindTrivia(position);
+
+ // If we ask right at the end of the file, we'll get back nothing.
+ // So move back in that case and ask again.
+ var eofPosition = root.FullWidth();
+ if (position == eofPosition)
+ {
+ var eof = root.EndOfFileToken;
+ if (eof.HasLeadingTrivia)
+ {
+ trivia = eof.LeadingTrivia.Last();
+ }
+ }
+
+ if (trivia.IsSingleLineDocComment())
+ {
+ var span = trivia.Span;
+ var fullSpan = trivia.FullSpan;
+ var endsWithNewLine = trivia.GetStructure().GetLastToken(includeSkipped: true).Kind() == SyntaxKind.XmlTextLiteralNewLineToken;
+
+ if (endsWithNewLine)
+ {
+ if (position > fullSpan.Start && position < fullSpan.End)
+ {
+ return true;
+ }
+ }
+ else
+ {
+ if (position > fullSpan.Start && position <= fullSpan.End)
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsEntirelyWithinMultiLineDocComment(
+ this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ var trivia = syntaxTree.GetRoot(cancellationToken).FindTrivia(position);
+
+ if (trivia.IsMultiLineDocComment())
+ {
+ var span = trivia.FullSpan;
+
+ if (position > span.Start && position < span.End)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsEntirelyWithinMultiLineComment(
+ this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ var trivia = FindTriviaAndAdjustForEndOfFile(syntaxTree, position, cancellationToken);
+
+ if (trivia.IsMultiLineComment())
+ {
+ var span = trivia.FullSpan;
+
+ return trivia.IsCompleteMultiLineComment()
+ ? position > span.Start && position < span.End
+ : position > span.Start && position <= span.End;
+ }
+
+ return false;
+ }
+
+ public static bool IsEntirelyWithinTopLevelSingleLineComment(
+ this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ var trivia = FindTriviaAndAdjustForEndOfFile(syntaxTree, position, cancellationToken);
+
+ if (trivia.Kind() == SyntaxKind.EndOfLineTrivia)
+ {
+ // Check if we're on the newline right at the end of a comment
+ trivia = trivia.GetPreviousTrivia(syntaxTree, cancellationToken);
+ }
+
+ if (trivia.IsSingleLineComment())
+ {
+ var span = trivia.FullSpan;
+
+ if (position > span.Start && position <= span.End)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsEntirelyWithinPreProcessorSingleLineComment(
+ this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ // Search inside trivia for directives to ensure that we recognize
+ // single-line comments at the end of preprocessor directives.
+ var trivia = FindTriviaAndAdjustForEndOfFile(syntaxTree, position, cancellationToken, findInsideTrivia: true);
+
+ if (trivia.Kind() == SyntaxKind.EndOfLineTrivia)
+ {
+ // Check if we're on the newline right at the end of a comment
+ trivia = trivia.GetPreviousTrivia(syntaxTree, cancellationToken, findInsideTrivia: true);
+ }
+
+ if (trivia.IsSingleLineComment())
+ {
+ var span = trivia.FullSpan;
+
+ if (position > span.Start && position <= span.End)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private static SyntaxTrivia FindTriviaAndAdjustForEndOfFile(
+ SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, bool findInsideTrivia = false)
+ {
+ var root = syntaxTree.GetRoot(cancellationToken) as CompilationUnitSyntax;
+ var trivia = root.FindTrivia(position, findInsideTrivia);
+
+ // If we ask right at the end of the file, we'll get back nothing.
+ // We handle that case specially for now, though SyntaxTree.FindTrivia should
+ // work at the end of a file.
+ if (position == root.FullWidth())
+ {
+ var endOfFileToken = root.EndOfFileToken;
+ if (endOfFileToken.HasLeadingTrivia)
+ {
+ trivia = endOfFileToken.LeadingTrivia.Last();
+ }
+ else
+ {
+ var token = endOfFileToken.GetPreviousToken(includeSkipped: true);
+ if (token.HasTrailingTrivia)
+ {
+ trivia = token.TrailingTrivia.Last();
+ }
+ }
+ }
+
+ return trivia;
+ }
+
+ private static bool AtEndOfIncompleteStringOrCharLiteral(SyntaxToken token, int position, char lastChar)
+ {
+ if (!token.IsKind(SyntaxKind.StringLiteralToken, SyntaxKind.CharacterLiteralToken))
+ {
+ throw new ArgumentException("Expected string or char literal.", "token");
+ }
+
+ int startLength = 1;
+ if (token.IsVerbatimStringLiteral())
+ {
+ startLength = 2;
+ }
+
+ return position == token.Span.End &&
+ (token.Span.Length == startLength || (token.Span.Length > startLength && token.ToString().Cast<char>().LastOrDefault() != lastChar));
+ }
+
+ public static bool IsEntirelyWithinStringOrCharLiteral(
+ this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ return
+ syntaxTree.IsEntirelyWithinStringLiteral(position, cancellationToken) ||
+ syntaxTree.IsEntirelyWithinCharLiteral(position, cancellationToken);
+ }
+
+ public static bool IsEntirelyWithinStringLiteral(
+ this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ var token = syntaxTree.GetRoot(cancellationToken).FindToken(position, findInsideTrivia: true);
+
+ // If we ask right at the end of the file, we'll get back nothing. We handle that case
+ // specially for now, though SyntaxTree.FindToken should work at the end of a file.
+ if (token.IsKind(SyntaxKind.EndOfDirectiveToken, SyntaxKind.EndOfFileToken))
+ {
+ token = token.GetPreviousToken(includeSkipped: true, includeDirectives: true);
+ }
+
+ if (token.IsKind(SyntaxKind.StringLiteralToken))
+ {
+ var span = token.Span;
+
+ // cases:
+ // "|"
+ // "| (e.g. incomplete string literal)
+ return (position > span.Start && position < span.End)
+ || AtEndOfIncompleteStringOrCharLiteral(token, position, '"');
+ }
+
+ // TODO: Uncomment InterpolatedStringTextToken on roslyn update !!!
+ if (token.IsKind(SyntaxKind.InterpolatedStringStartToken, /* SyntaxKind.InterpolatedStringTextToken, */SyntaxKind.InterpolatedStringEndToken))
+ {
+ return token.SpanStart < position && token.Span.End > position;
+ }
+
+ return false;
+ }
+
+ public static bool IsEntirelyWithinCharLiteral(
+ this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ var root = syntaxTree.GetRoot(cancellationToken) as CompilationUnitSyntax;
+ var token = root.FindToken(position, findInsideTrivia: true);
+
+ // If we ask right at the end of the file, we'll get back nothing.
+ // We handle that case specially for now, though SyntaxTree.FindToken should
+ // work at the end of a file.
+ if (position == root.FullWidth())
+ {
+ token = root.EndOfFileToken.GetPreviousToken(includeSkipped: true, includeDirectives: true);
+ }
+
+ if (token.Kind() == SyntaxKind.CharacterLiteralToken)
+ {
+ var span = token.Span;
+
+ // cases:
+ // '|'
+ // '| (e.g. incomplete char literal)
+ return (position > span.Start && position < span.End)
+ || AtEndOfIncompleteStringOrCharLiteral(token, position, '\'');
+ }
+
+ return false;
+ }
+
+ public static bool IsInInactiveRegion(
+ this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ // Contract.ThrowIfNull(syntaxTree);
+
+ // cases:
+ // $ is EOF
+
+ // #if false
+ // |
+
+ // #if false
+ // |$
+
+ // #if false
+ // |
+
+ // #if false
+ // |$
+
+ if (syntaxTree.IsPreProcessorKeywordContext(position, cancellationToken))
+ {
+ return false;
+ }
+
+ // The latter two are the hard cases we don't actually have an
+ // DisabledTextTrivia yet.
+ var trivia = syntaxTree.GetRoot(cancellationToken).FindTrivia(position, findInsideTrivia: false);
+ if (trivia.Kind() == SyntaxKind.DisabledTextTrivia)
+ {
+ return true;
+ }
+
+ var token = syntaxTree.FindTokenOrEndToken(position, cancellationToken);
+ var text = syntaxTree.GetText(cancellationToken);
+ var lineContainingPosition = text.Lines.IndexOf(position);
+ if (token.Kind() == SyntaxKind.EndOfFileToken)
+ {
+ var triviaList = token.LeadingTrivia;
+ foreach (var triviaTok in triviaList.Reverse())
+ {
+ if (triviaTok.HasStructure)
+ {
+ var structure = triviaTok.GetStructure();
+ if (structure is BranchingDirectiveTriviaSyntax)
+ {
+ var triviaLine = text.Lines.IndexOf(triviaTok.SpanStart);
+ if (triviaLine < lineContainingPosition)
+ {
+ var branch = (BranchingDirectiveTriviaSyntax)structure;
+ return !branch.IsActive || !branch.BranchTaken;
+ }
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsBeforeFirstToken(
+ this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ var firstToken = syntaxTree.GetRoot(cancellationToken).GetFirstToken(includeZeroWidth: true, includeSkipped: true);
+
+ return position <= firstToken.SpanStart;
+ }
+
+ public static SyntaxToken FindTokenOrEndToken(
+ this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ // Contract.ThrowIfNull(syntaxTree);
+
+ var root = syntaxTree.GetRoot(cancellationToken) as CompilationUnitSyntax;
+ var result = root.FindToken(position, findInsideTrivia: true);
+ if (result.Kind() != SyntaxKind.None)
+ {
+ return result;
+ }
+
+ // Special cases. See if we're actually at the end of a:
+ // a) doc comment
+ // b) pp directive
+ // c) file
+
+ var triviaList = root.EndOfFileToken.LeadingTrivia;
+ foreach (var trivia in triviaList.Reverse())
+ {
+ if (trivia.HasStructure)
+ {
+ var token = trivia.GetStructure().GetLastToken(includeZeroWidth: true);
+ if (token.Span.End == position)
+ {
+ return token;
+ }
+ }
+ }
+
+ if (position == root.FullSpan.End)
+ {
+ return root.EndOfFileToken;
+ }
+
+ return default(SyntaxToken);
+ }
+
+ public static IList<MemberDeclarationSyntax> GetMembersInSpan(
+ this SyntaxTree syntaxTree,
+ TextSpan textSpan,
+ CancellationToken cancellationToken)
+ {
+ var token = syntaxTree.GetRoot(cancellationToken).FindToken(textSpan.Start);
+ var firstMember = token.GetAncestors<MemberDeclarationSyntax>().FirstOrDefault();
+ if (firstMember != null)
+ {
+ var containingType = firstMember.Parent as TypeDeclarationSyntax;
+ if (containingType != null)
+ {
+ var members = GetMembersInSpan(textSpan, containingType, firstMember);
+ if (members != null)
+ {
+ return members;
+ }
+ }
+ }
+
+ return SpecializedCollections.EmptyList<MemberDeclarationSyntax>();
+ }
+
+ private static List<MemberDeclarationSyntax> GetMembersInSpan(
+ TextSpan textSpan,
+ TypeDeclarationSyntax containingType,
+ MemberDeclarationSyntax firstMember)
+ {
+ List<MemberDeclarationSyntax> selectedMembers = null;
+
+ var members = containingType.Members;
+ var fieldIndex = members.IndexOf(firstMember);
+ if (fieldIndex < 0)
+ {
+ return null;
+ }
+
+ for (var i = fieldIndex; i < members.Count; i++)
+ {
+ var member = members[i];
+ if (textSpan.Contains(member.Span))
+ {
+ selectedMembers = selectedMembers ?? new List<MemberDeclarationSyntax>();
+ selectedMembers.Add(member);
+ }
+ else if (textSpan.OverlapsWith(member.Span))
+ {
+ return null;
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ return selectedMembers;
+ }
+
+ public static bool IsInPartiallyWrittenGeneric(
+ this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ SyntaxToken genericIdentifier;
+ SyntaxToken lessThanToken;
+ return syntaxTree.IsInPartiallyWrittenGeneric(position, cancellationToken, out genericIdentifier, out lessThanToken);
+ }
+
+ public static bool IsInPartiallyWrittenGeneric(
+ this SyntaxTree syntaxTree,
+ int position,
+ CancellationToken cancellationToken,
+ out SyntaxToken genericIdentifier)
+ {
+ SyntaxToken lessThanToken;
+ return syntaxTree.IsInPartiallyWrittenGeneric(position, cancellationToken, out genericIdentifier, out lessThanToken);
+ }
+
+ public static bool IsInPartiallyWrittenGeneric(
+ this SyntaxTree syntaxTree,
+ int position,
+ CancellationToken cancellationToken,
+ out SyntaxToken genericIdentifier,
+ out SyntaxToken lessThanToken)
+ {
+ genericIdentifier = default(SyntaxToken);
+ lessThanToken = default(SyntaxToken);
+ int index = 0;
+
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ if (token.Kind() == SyntaxKind.None)
+ {
+ return false;
+ }
+
+ // check whether we are under type or member decl
+ if (token.GetAncestor<TypeParameterListSyntax>() != null)
+ {
+ return false;
+ }
+
+ int stack = 0;
+ while (true)
+ {
+ switch (token.Kind())
+ {
+ case SyntaxKind.LessThanToken:
+ if (stack == 0)
+ {
+ // got here so we read successfully up to a < now we have to read the
+ // name before that and we're done!
+ lessThanToken = token;
+ token = token.GetPreviousToken(includeSkipped: true);
+ if (token.Kind() == SyntaxKind.None)
+ {
+ return false;
+ }
+
+ // ok
+ // so we've read something like:
+ // ~~~~~~~~~<a,b,...
+ // but we need to know the simple name that precedes the <
+ // it could be
+ // ~~~~~~foo<a,b,...
+ if (token.Kind() == SyntaxKind.IdentifierToken)
+ {
+ // okay now check whether it is actually partially written
+ if (IsFullyWrittenGeneric(token, lessThanToken))
+ {
+ return false;
+ }
+
+ genericIdentifier = token;
+ return true;
+ }
+
+ return false;
+ }
+ else
+ {
+ stack--;
+ break;
+ }
+
+ case SyntaxKind.GreaterThanGreaterThanToken:
+ stack++;
+ goto case SyntaxKind.GreaterThanToken;
+
+ // fall through
+ case SyntaxKind.GreaterThanToken:
+ stack++;
+ break;
+
+ case SyntaxKind.AsteriskToken: // for int*
+ case SyntaxKind.QuestionToken: // for int?
+ case SyntaxKind.ColonToken: // for global:: (so we don't dismiss help as you type the first :)
+ case SyntaxKind.ColonColonToken: // for global::
+ case SyntaxKind.CloseBracketToken:
+ case SyntaxKind.OpenBracketToken:
+ case SyntaxKind.DotToken:
+ case SyntaxKind.IdentifierToken:
+ break;
+
+ case SyntaxKind.CommaToken:
+ if (stack == 0)
+ {
+ index++;
+ }
+
+ break;
+
+ default:
+ // user might have typed "in" on the way to typing "int"
+ // don't want to disregard this genericname because of that
+ if (SyntaxFacts.IsKeywordKind(token.Kind()))
+ {
+ break;
+ }
+
+ // anything else and we're sunk.
+ return false;
+ }
+
+ // look backward one token, include skipped tokens, because the parser frequently
+ // does skip them in cases like: "Func<A, B", which get parsed as: expression
+ // statement "Func<A" with missing semicolon, expression statement "B" with missing
+ // semicolon, and the "," is skipped.
+ token = token.GetPreviousToken(includeSkipped: true);
+ if (token.Kind() == SyntaxKind.None)
+ {
+ return false;
+ }
+ }
+ }
+
+ private static bool IsFullyWrittenGeneric(SyntaxToken token, SyntaxToken lessThanToken)
+ {
+ var genericName = token.Parent as GenericNameSyntax;
+
+ return genericName != null && genericName.TypeArgumentList != null &&
+ genericName.TypeArgumentList.LessThanToken == lessThanToken && !genericName.TypeArgumentList.GreaterThanToken.IsMissing;
+ }
+
+
+ public static bool IsAttributeNameContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ // cases:
+ // [ |
+ if (token.Kind() == SyntaxKind.OpenBracketToken &&
+ token.Parent.IsKind(SyntaxKind.AttributeList))
+ {
+ return true;
+ }
+
+ // cases:
+ // [Foo(1), |
+ if (token.Kind() == SyntaxKind.CommaToken &&
+ token.Parent.IsKind(SyntaxKind.AttributeList))
+ {
+ return true;
+ }
+
+ // cases:
+ // [specifier: |
+ if (token.Kind() == SyntaxKind.ColonToken &&
+ token.Parent.IsKind(SyntaxKind.AttributeTargetSpecifier))
+ {
+ return true;
+ }
+
+ // cases:
+ // [Namespace.|
+ if (token.Parent.IsKind(SyntaxKind.QualifiedName) &&
+ token.Parent.IsParentKind(SyntaxKind.Attribute))
+ {
+ return true;
+ }
+
+ // cases:
+ // [global::|
+ if (token.Parent.IsKind(SyntaxKind.AliasQualifiedName) &&
+ token.Parent.IsParentKind(SyntaxKind.Attribute))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsGlobalMemberDeclarationContext(
+ this SyntaxTree syntaxTree,
+ int position,
+ ISet<SyntaxKind> validModifiers,
+ CancellationToken cancellationToken)
+ {
+ if (!syntaxTree.IsInteractiveOrScript())
+ {
+ return false;
+ }
+
+ var tokenOnLeftOfPosition = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ var token = tokenOnLeftOfPosition.GetPreviousTokenIfTouchingWord(position);
+
+ var modifierTokens = syntaxTree.GetPrecedingModifiers(position, tokenOnLeftOfPosition, cancellationToken);
+ if (!modifierTokens.Any())
+ {
+ return false;
+ }
+
+ if (modifierTokens.IsSubsetOf(validModifiers))
+ {
+ // the parent is the member
+ // the grandparent is the container of the member
+ // in interactive, it's possible that there might be an intervening "incomplete" member for partially
+ // typed declarations that parse ambiguously. For example, "internal e".
+ if (token.Parent.IsKind(SyntaxKind.CompilationUnit) ||
+ (token.Parent.IsKind(SyntaxKind.IncompleteMember) && token.Parent.IsParentKind(SyntaxKind.CompilationUnit)))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsMemberDeclarationContext(
+ this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ // cases:
+ // class C {
+ // |
+
+ // class C {
+ // void Foo() {
+ // }
+ // |
+
+ // class C {
+ // int i;
+ // |
+
+ // class C {
+ // public |
+
+ // class C {
+ // [Foo]
+ // |
+
+ var originalToken = tokenOnLeftOfPosition;
+ var token = originalToken;
+
+ // If we're touching the right of an identifier, move back to
+ // previous token.
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.OpenBraceToken)
+ {
+ if (token.Parent is BaseTypeDeclarationSyntax)
+ {
+ return true;
+ }
+ }
+
+ // class C {
+ // int i;
+ // |
+ if (token.Kind() == SyntaxKind.SemicolonToken)
+ {
+ if (token.Parent is MemberDeclarationSyntax &&
+ token.Parent.GetParent() is BaseTypeDeclarationSyntax)
+ {
+ return true;
+ }
+ }
+
+ // class A {
+ // class C {}
+ // |
+
+ // class C {
+ // void Foo() {
+ // }
+ // |
+ if (token.Kind() == SyntaxKind.CloseBraceToken)
+ {
+ if (token.Parent is BaseTypeDeclarationSyntax &&
+ token.Parent.GetParent() is BaseTypeDeclarationSyntax)
+ {
+ // after a nested type
+ return true;
+ }
+ else if (token.Parent is AccessorListSyntax)
+ {
+ // after a property
+ return true;
+ }
+ else if (
+ token.Parent.IsKind(SyntaxKind.Block) &&
+ token.Parent.GetParent() is MemberDeclarationSyntax)
+ {
+ // after a method/operator/etc.
+ return true;
+ }
+ }
+
+ // namespace Foo {
+ // [Bar]
+ // |
+
+ if (token.Kind() == SyntaxKind.CloseBracketToken &&
+ token.Parent.IsKind(SyntaxKind.AttributeList))
+ {
+ // attributes belong to a member which itself is in a
+ // container.
+
+ // the parent is the attribute
+ // the grandparent is the owner of the attribute
+ // the great-grandparent is the container that the owner is in
+ var container = token.Parent.GetParent().GetParent();
+ if (container is BaseTypeDeclarationSyntax)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsMemberDeclarationContext(
+ this SyntaxTree syntaxTree,
+ int position,
+ CSharpSyntaxContext contextOpt,
+ ISet<SyntaxKind> validModifiers,
+ ISet<SyntaxKind> validTypeDeclarations,
+ bool canBePartial,
+ CancellationToken cancellationToken)
+ {
+ var typeDecl = contextOpt != null
+ ? contextOpt.ContainingTypeOrEnumDeclaration
+ : syntaxTree.GetContainingTypeOrEnumDeclaration(position, cancellationToken);
+
+ if (typeDecl == null)
+ {
+ return false;
+ }
+
+ if (!validTypeDeclarations.Contains(typeDecl.Kind()))
+ {
+ return false;
+ }
+
+ validTypeDeclarations = validTypeDeclarations ?? SpecializedCollections.EmptySet<SyntaxKind>();
+
+ // Check many of the simple cases first.
+ var leftToken = contextOpt != null
+ ? contextOpt.LeftToken
+ : syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+
+ if (syntaxTree.IsMemberDeclarationContext(position, leftToken, cancellationToken))
+ {
+ return true;
+ }
+
+ var token = contextOpt != null
+ ? contextOpt.TargetToken
+ : leftToken.GetPreviousTokenIfTouchingWord(position);
+
+ // A member can also show up after certain types of modifiers
+ if (canBePartial &&
+ token.IsKindOrHasMatchingText(SyntaxKind.PartialKeyword))
+ {
+ return true;
+ }
+
+ var modifierTokens = contextOpt != null
+ ? contextOpt.PrecedingModifiers
+ : syntaxTree.GetPrecedingModifiers(position, leftToken, cancellationToken);
+
+ if (!modifierTokens.Any())
+ {
+ return false;
+ }
+
+ validModifiers = validModifiers ?? SpecializedCollections.EmptySet<SyntaxKind>();
+
+ if (modifierTokens.IsSubsetOf(validModifiers))
+ {
+ var member = token.Parent;
+ if (token.HasMatchingText(SyntaxKind.AsyncKeyword))
+ {
+ // second appearance of "async", not followed by modifier: treat it as type
+ if (syntaxTree.GetPrecedingModifiers(token.SpanStart, token, cancellationToken).Any(x => x == SyntaxKind.AsyncKeyword))
+ {
+ return false;
+ }
+
+ // rule out async lambdas inside a method
+ if (token.GetAncestor<StatementSyntax>() == null)
+ {
+ member = token.GetAncestor<MemberDeclarationSyntax>();
+ }
+ }
+
+ // cases:
+ // public |
+ // async |
+ // public async |
+ return member != null &&
+ member.Parent is BaseTypeDeclarationSyntax;
+ }
+
+ return false;
+ }
+
+ public static bool IsTypeDeclarationContext(
+ this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ // cases:
+ // root: |
+
+ // extern alias a;
+ // |
+
+ // using Foo;
+ // |
+
+ // using Foo = Bar;
+ // |
+
+ // namespace N {}
+ // |
+
+ // namespace N {
+ // |
+
+ // class C {}
+ // |
+
+ // class C {
+ // |
+
+ // class C {
+ // void Foo() {
+ // }
+ // |
+
+ // class C {
+ // int i;
+ // |
+
+ // class C {
+ // public |
+
+ // class C {
+ // [Foo]
+ // |
+
+ var originalToken = tokenOnLeftOfPosition;
+ var token = originalToken;
+
+ // If we're touching the right of an identifier, move back to
+ // previous token.
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ // a type decl can't come before usings/externs
+ if (originalToken.GetNextToken(includeSkipped: true).IsUsingOrExternKeyword())
+ {
+ return false;
+ }
+
+ // root: |
+ if (token.Kind() == SyntaxKind.None)
+ {
+ // root namespace
+
+ // a type decl can't come before usings/externs
+ var compilationUnit = syntaxTree.GetRoot(cancellationToken) as CompilationUnitSyntax;
+ if (compilationUnit != null &&
+ (compilationUnit.Externs.Count > 0 ||
+ compilationUnit.Usings.Count > 0))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ if (token.Kind() == SyntaxKind.OpenBraceToken)
+ {
+ if (token.Parent.IsKind(SyntaxKind.ClassDeclaration, SyntaxKind.StructDeclaration))
+ {
+ return true;
+ }
+ else if (token.Parent.IsKind(SyntaxKind.NamespaceDeclaration))
+ {
+ return true;
+ }
+ }
+
+ // extern alias a;
+ // |
+
+ // using Foo;
+ // |
+
+ // class C {
+ // int i;
+ // |
+ if (token.Kind() == SyntaxKind.SemicolonToken)
+ {
+ if (token.Parent.IsKind(SyntaxKind.ExternAliasDirective, SyntaxKind.UsingDirective))
+ {
+ return true;
+ }
+ else if (token.Parent is MemberDeclarationSyntax)
+ {
+ return true;
+ }
+ }
+
+ // class C {}
+ // |
+
+ // namespace N {}
+ // |
+
+ // class C {
+ // void Foo() {
+ // }
+ // |
+ if (token.Kind() == SyntaxKind.CloseBraceToken)
+ {
+ if (token.Parent is BaseTypeDeclarationSyntax)
+ {
+ return true;
+ }
+ else if (token.Parent.IsKind(SyntaxKind.NamespaceDeclaration))
+ {
+ return true;
+ }
+ else if (token.Parent is AccessorListSyntax)
+ {
+ return true;
+ }
+ else if (
+ token.Parent.IsKind(SyntaxKind.Block) &&
+ token.Parent.GetParent() is MemberDeclarationSyntax)
+ {
+ return true;
+ }
+ }
+
+ // namespace Foo {
+ // [Bar]
+ // |
+
+ if (token.Kind() == SyntaxKind.CloseBracketToken &&
+ token.Parent.IsKind(SyntaxKind.AttributeList))
+ {
+ // assembly attributes belong to the containing compilation unit
+ if (token.Parent.IsParentKind(SyntaxKind.CompilationUnit))
+ {
+ return true;
+ }
+
+ // other attributes belong to a member which itself is in a
+ // container.
+
+ // the parent is the attribute
+ // the grandparent is the owner of the attribute
+ // the great-grandparent is the container that the owner is in
+ var container = token.Parent.GetParent().GetParent();
+ if (container.IsKind(SyntaxKind.CompilationUnit) ||
+ container.IsKind(SyntaxKind.NamespaceDeclaration) ||
+ container.IsKind(SyntaxKind.ClassDeclaration) ||
+ container.IsKind(SyntaxKind.StructDeclaration))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsTypeDeclarationContext(
+ this SyntaxTree syntaxTree,
+ int position,
+ CSharpSyntaxContext contextOpt,
+ ISet<SyntaxKind> validModifiers,
+ ISet<SyntaxKind> validTypeDeclarations,
+ bool canBePartial,
+ CancellationToken cancellationToken)
+ {
+ // We only allow nested types inside a class or struct, not inside a
+ // an interface or enum.
+ var typeDecl = contextOpt != null
+ ? contextOpt.ContainingTypeDeclaration
+ : syntaxTree.GetContainingTypeDeclaration(position, cancellationToken);
+
+ validTypeDeclarations = validTypeDeclarations ?? SpecializedCollections.EmptySet<SyntaxKind>();
+
+ if (typeDecl != null)
+ {
+ if (!validTypeDeclarations.Contains(typeDecl.Kind()))
+ {
+ return false;
+ }
+ }
+
+ // Check many of the simple cases first.
+ var leftToken = contextOpt != null
+ ? contextOpt.LeftToken
+ : syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+
+ if (syntaxTree.IsTypeDeclarationContext(position, leftToken, cancellationToken))
+ {
+ return true;
+ }
+
+ // If we're touching the right of an identifier, move back to
+ // previous token.
+ var token = contextOpt != null
+ ? contextOpt.TargetToken
+ : leftToken.GetPreviousTokenIfTouchingWord(position);
+
+ // A type can also show up after certain types of modifiers
+ if (canBePartial &&
+ token.IsKindOrHasMatchingText(SyntaxKind.PartialKeyword))
+ {
+ return true;
+ }
+
+ // using static | is never a type declaration context
+ if (token.IsStaticKeywordInUsingDirective())
+ {
+ return false;
+ }
+
+ var modifierTokens = contextOpt != null
+ ? contextOpt.PrecedingModifiers
+ : syntaxTree.GetPrecedingModifiers(position, leftToken, cancellationToken);
+
+ if (!modifierTokens.Any())
+ {
+ return false;
+ }
+
+ validModifiers = validModifiers ?? SpecializedCollections.EmptySet<SyntaxKind>();
+
+ if (modifierTokens.IsProperSubsetOf(validModifiers))
+ {
+ // the parent is the member
+ // the grandparent is the container of the member
+ var container = token.Parent.GetParent();
+ if (container.IsKind(SyntaxKind.CompilationUnit) ||
+ container.IsKind(SyntaxKind.NamespaceDeclaration) ||
+ container.IsKind(SyntaxKind.ClassDeclaration) ||
+ container.IsKind(SyntaxKind.StructDeclaration))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsNamespaceContext(
+ this SyntaxTree syntaxTree,
+ int position,
+ CancellationToken cancellationToken,
+ SemanticModel semanticModelOpt = null)
+ {
+ // first do quick exit check
+ if (syntaxTree.IsInNonUserCode(position, cancellationToken) ||
+ syntaxTree.IsRightOfDotOrArrow(position, cancellationToken))
+ {
+ return false;
+ }
+
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken)
+ .GetPreviousTokenIfTouchingWord(position);
+
+ // global::
+ if (token.Kind() == SyntaxKind.ColonColonToken &&
+ token.GetPreviousToken(includeSkipped: true).Kind() == SyntaxKind.GlobalKeyword)
+ {
+ return true;
+ }
+
+ // using |
+ // but not:
+ // using | = Bar
+
+ // Note: we take care of the using alias case in the IsTypeContext
+ // call below.
+
+ if (token.Kind() == SyntaxKind.UsingKeyword)
+ {
+ var usingDirective = token.GetAncestor<UsingDirectiveSyntax>();
+ if (usingDirective != null)
+ {
+ if (token.GetNextToken(includeSkipped: true).Kind() != SyntaxKind.EqualsToken &&
+ usingDirective.Alias == null)
+ {
+ return true;
+ }
+ }
+ }
+
+ // using static |
+ if (token.IsStaticKeywordInUsingDirective())
+ {
+ return true;
+ }
+
+ // if it is not using directive location, most of places where
+ // type can appear, namespace can appear as well
+ return syntaxTree.IsTypeContext(position, cancellationToken, semanticModelOpt);
+ }
+
+ public static bool IsDefinitelyNotTypeContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ return
+ syntaxTree.IsInNonUserCode(position, cancellationToken) ||
+ syntaxTree.IsRightOfDotOrArrow(position, cancellationToken);
+ }
+
+ public static bool IsTypeContext(
+ this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken, SemanticModel semanticModelOpt = null)
+ {
+ // first do quick exit check
+ if (syntaxTree.IsDefinitelyNotTypeContext(position, cancellationToken))
+ {
+ return false;
+ }
+
+ // okay, now it is a case where we can't use parse tree (valid or error recovery) to
+ // determine whether it is a right place to put type. use lex based one Cyrus created.
+
+ var tokenOnLeftOfPosition = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ return
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.ConstKeyword, cancellationToken) ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.CaseKeyword, cancellationToken) ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.EventKeyword, cancellationToken) ||
+ syntaxTree.IsAfterKeyword(position, SyntaxKind.StackAllocKeyword, cancellationToken) ||
+ syntaxTree.IsAttributeNameContext(position, cancellationToken) ||
+ syntaxTree.IsBaseClassOrInterfaceContext(position, cancellationToken) ||
+ syntaxTree.IsCatchVariableDeclarationContext(position, cancellationToken) ||
+ syntaxTree.IsDefiniteCastTypeContext(position, tokenOnLeftOfPosition, cancellationToken) ||
+ syntaxTree.IsDelegateReturnTypeContext(position, tokenOnLeftOfPosition, cancellationToken) ||
+ syntaxTree.IsExpressionContext(position, tokenOnLeftOfPosition, attributes: true, cancellationToken: cancellationToken, semanticModelOpt: semanticModelOpt) ||
+ syntaxTree.IsPrimaryFunctionExpressionContext(position, tokenOnLeftOfPosition, cancellationToken) ||
+ syntaxTree.IsGenericTypeArgumentContext(position, tokenOnLeftOfPosition, cancellationToken, semanticModelOpt) ||
+ syntaxTree.IsFixedVariableDeclarationContext(position, tokenOnLeftOfPosition, cancellationToken) ||
+ syntaxTree.IsImplicitOrExplicitOperatorTypeContext(position, tokenOnLeftOfPosition, cancellationToken) ||
+ syntaxTree.IsIsOrAsTypeContext(position, tokenOnLeftOfPosition, cancellationToken) ||
+ syntaxTree.IsLocalVariableDeclarationContext(position, tokenOnLeftOfPosition, cancellationToken) ||
+ syntaxTree.IsObjectCreationTypeContext(position, tokenOnLeftOfPosition, cancellationToken) ||
+ syntaxTree.IsParameterTypeContext(position, tokenOnLeftOfPosition, cancellationToken) ||
+ syntaxTree.IsPossibleLambdaOrAnonymousMethodParameterTypeContext(position, tokenOnLeftOfPosition, cancellationToken) ||
+ syntaxTree.IsStatementContext(position, tokenOnLeftOfPosition, cancellationToken) ||
+ syntaxTree.IsTypeParameterConstraintContext(position, tokenOnLeftOfPosition, cancellationToken) ||
+ syntaxTree.IsUsingAliasContext(position, cancellationToken) ||
+ syntaxTree.IsUsingStaticContext(position, cancellationToken) ||
+ syntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
+ syntaxTree.IsMemberDeclarationContext(
+ position,
+ contextOpt: null,
+ validModifiers: SyntaxKindSet.AllMemberModifiers,
+ validTypeDeclarations: SyntaxKindSet.ClassInterfaceStructTypeDeclarations,
+ canBePartial: false,
+ cancellationToken: cancellationToken);
+ }
+
+ public static bool IsBaseClassOrInterfaceContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ // class C : |
+ // class C : Bar, |
+
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.ColonToken ||
+ token.Kind() == SyntaxKind.CommaToken)
+ {
+ if (token.Parent.IsKind(SyntaxKind.BaseList))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsUsingAliasContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ // using Foo = |
+
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.EqualsToken &&
+ token.GetAncestor<UsingDirectiveSyntax>() != null)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsUsingStaticContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ // using static |
+
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ return token.IsStaticKeywordInUsingDirective();
+ }
+
+ public static bool IsTypeArgumentOfConstraintClause(
+ this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ // cases:
+ // where |
+ // class Foo<T> : Object where |
+
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.WhereKeyword &&
+ token.Parent.IsKind(SyntaxKind.TypeParameterConstraintClause))
+ {
+ return true;
+ }
+
+ if (token.Kind() == SyntaxKind.IdentifierToken &&
+ token.HasMatchingText(SyntaxKind.WhereKeyword) &&
+ token.Parent.IsKind(SyntaxKind.IdentifierName) &&
+ token.Parent.IsParentKind(SyntaxKind.SimpleBaseType) &&
+ token.Parent.Parent.IsParentKind(SyntaxKind.BaseList))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsTypeParameterConstraintStartContext(
+ this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ // cases:
+ // where T : |
+
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.ColonToken &&
+ token.GetPreviousToken(includeSkipped: true).Kind() == SyntaxKind.IdentifierToken &&
+ token.GetPreviousToken(includeSkipped: true).GetPreviousToken().Kind() == SyntaxKind.WhereKeyword)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsTypeParameterConstraintContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ if (syntaxTree.IsTypeParameterConstraintStartContext(position, tokenOnLeftOfPosition, cancellationToken))
+ {
+ return true;
+ }
+
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ // Can't come after new()
+ //
+ // where T : |
+ // where T : class, |
+ // where T : struct, |
+ // where T : Foo, |
+ if (token.Kind() == SyntaxKind.CommaToken &&
+ token.Parent.IsKind(SyntaxKind.TypeParameterConstraintClause))
+ {
+ var constraintClause = token.Parent as TypeParameterConstraintClauseSyntax;
+
+ // Check if there's a 'new()' constraint. If there isn't, or we're before it, then
+ // this is a type parameter constraint context.
+ var firstConstructorConstraint = constraintClause.Constraints.FirstOrDefault(t => t is ConstructorConstraintSyntax);
+ if (firstConstructorConstraint == null || firstConstructorConstraint.SpanStart > token.Span.End)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsTypeOfExpressionContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ var token = tokenOnLeftOfPosition.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.OpenParenToken && token.Parent.IsKind(SyntaxKind.TypeOfExpression))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsDefaultExpressionContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ var token = tokenOnLeftOfPosition.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.OpenParenToken && token.Parent.IsKind(SyntaxKind.DefaultExpression))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsSizeOfExpressionContext(
+ this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ var token = tokenOnLeftOfPosition.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.OpenParenToken && token.Parent.IsKind(SyntaxKind.SizeOfExpression))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsGenericTypeArgumentContext(
+ this SyntaxTree syntaxTree,
+ int position,
+ SyntaxToken tokenOnLeftOfPosition,
+ CancellationToken cancellationToken,
+ SemanticModel semanticModelOpt = null)
+ {
+ // cases:
+ // Foo<|
+ // Foo<Bar,|
+ // Foo<Bar<Baz<int[],|
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() != SyntaxKind.LessThanToken && token.Kind() != SyntaxKind.CommaToken)
+ {
+ return false;
+ }
+
+ if (token.Parent is TypeArgumentListSyntax)
+ {
+ // Easy case, it was known to be a generic name, so this is a type argument context.
+ return true;
+ }
+
+ SyntaxToken nameToken;
+ if (!syntaxTree.IsInPartiallyWrittenGeneric(position, cancellationToken, out nameToken))
+ {
+ return false;
+ }
+
+ var name = nameToken.Parent as NameSyntax;
+ if (name == null)
+ {
+ return false;
+ }
+
+ // Looks viable! If they provided a binding, then check if it binds properly to
+ // an actual generic entity.
+ if (semanticModelOpt == null)
+ {
+ // No binding. Just make the decision based on the syntax tree.
+ return true;
+ }
+
+ // '?' is syntactically ambiguous in incomplete top-level statements:
+ //
+ // T ? foo<|
+ //
+ // Might be an incomplete conditional expression or an incomplete declaration of a method returning a nullable type.
+ // Bind T to see if it is a type. If it is we don't show signature help.
+ if (name.IsParentKind(SyntaxKind.LessThanExpression) &&
+ name.Parent.IsParentKind(SyntaxKind.ConditionalExpression) &&
+ name.Parent.Parent.IsParentKind(SyntaxKind.ExpressionStatement) &&
+ name.Parent.Parent.Parent.IsParentKind(SyntaxKind.GlobalStatement))
+ {
+ var conditionOrType = semanticModelOpt.GetSymbolInfo(
+ ((ConditionalExpressionSyntax)name.Parent.Parent).Condition, cancellationToken);
+ if (conditionOrType.GetBestOrAllSymbols().FirstOrDefault() != null &&
+ conditionOrType.GetBestOrAllSymbols().FirstOrDefault().Kind == SymbolKind.NamedType)
+ {
+ return false;
+ }
+ }
+
+ var symbols = semanticModelOpt.LookupName(nameToken, namespacesAndTypesOnly: SyntaxFacts.IsInNamespaceOrTypeContext(name), cancellationToken: cancellationToken);
+ return symbols.Any(s =>
+ s.TypeSwitch(
+ (INamedTypeSymbol nt) => nt.Arity > 0,
+ (IMethodSymbol m) => m.Arity > 0));
+ }
+
+ public static bool IsParameterModifierContext(
+ this SyntaxTree syntaxTree,
+ int position,
+ SyntaxToken tokenOnLeftOfPosition,
+ CancellationToken cancellationToken,
+ int? allowableIndex = null)
+ {
+ // cases:
+ // Foo(|
+ // Foo(int i, |
+ // Foo([Bar]|
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.OpenParenToken &&
+ token.Parent.IsDelegateOrConstructorOrMethodParameterList())
+ {
+ if (allowableIndex.HasValue)
+ {
+ if (allowableIndex.Value != 0)
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ if (token.Kind() == SyntaxKind.CommaToken &&
+ token.Parent.IsDelegateOrConstructorOrMethodParameterList())
+ {
+ if (allowableIndex.HasValue)
+ {
+ var parameterList = token.GetAncestor<ParameterListSyntax>();
+ var commaIndex = parameterList.Parameters.GetWithSeparators().IndexOf(token);
+ var index = commaIndex / 2 + 1;
+ if (index != allowableIndex.Value)
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ if (token.Kind() == SyntaxKind.CloseBracketToken &&
+ token.Parent.IsKind(SyntaxKind.AttributeList) &&
+ token.Parent.IsParentKind(SyntaxKind.Parameter) &&
+ token.Parent.GetParent().GetParent().IsDelegateOrConstructorOrMethodParameterList())
+ {
+ if (allowableIndex.HasValue)
+ {
+ var parameter = token.GetAncestor<ParameterSyntax>();
+ var parameterList = parameter.GetAncestorOrThis<ParameterListSyntax>();
+
+ int parameterIndex = parameterList.Parameters.IndexOf(parameter);
+ if (allowableIndex.Value != parameterIndex)
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsDelegateReturnTypeContext(
+ this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.DelegateKeyword &&
+ token.Parent.IsKind(SyntaxKind.DelegateDeclaration))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsImplicitOrExplicitOperatorTypeContext(
+ this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.OperatorKeyword)
+ {
+ if (token.GetPreviousToken(includeSkipped: true).Kind() == SyntaxKind.ImplicitKeyword ||
+ token.GetPreviousToken(includeSkipped: true).Kind() == SyntaxKind.ExplicitKeyword)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsParameterTypeContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ var token = tokenOnLeftOfPosition.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.RefKeyword ||
+ token.Kind() == SyntaxKind.OutKeyword ||
+ token.Kind() == SyntaxKind.ParamsKeyword ||
+ token.Kind() == SyntaxKind.ThisKeyword)
+ {
+ position = token.SpanStart;
+ tokenOnLeftOfPosition = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ }
+
+ if (syntaxTree.IsParameterModifierContext(position, tokenOnLeftOfPosition, cancellationToken))
+ {
+ return true;
+ }
+
+ // int this[ |
+ // int this[int i, |
+ if (token.Kind() == SyntaxKind.OpenParenToken ||
+ token.Kind() == SyntaxKind.OpenBracketToken ||
+ token.Kind() == SyntaxKind.CommaToken)
+ {
+ if (token.Parent.IsKind(SyntaxKind.ParameterList, SyntaxKind.BracketedParameterList))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsPossibleLambdaParameterModifierContext(
+ this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.OpenParenToken ||
+ token.Kind() == SyntaxKind.CommaToken)
+ {
+ if (token.Parent.IsKind(SyntaxKind.ParameterList) &&
+ token.Parent.IsParentKind(SyntaxKind.ParenthesizedLambdaExpression))
+ {
+ return true;
+ }
+
+ // TODO(cyrusn): Tie into semantic analysis system to only
+ // consider this a lambda if this is a location where the
+ // lambda's type would be inferred because of a delegate
+ // or Expression<T> type.
+ if (token.Parent.IsKind(SyntaxKind.ParenthesizedExpression))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsAnonymousMethodParameterModifierContext(
+ this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.OpenParenToken ||
+ token.Kind() == SyntaxKind.CommaToken)
+ {
+ if (token.Parent.IsKind(SyntaxKind.ParameterList) &&
+ token.Parent.IsParentKind(SyntaxKind.AnonymousMethodExpression))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsPossibleLambdaOrAnonymousMethodParameterTypeContext(
+ this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.RefKeyword ||
+ token.Kind() == SyntaxKind.OutKeyword)
+ {
+ position = token.SpanStart;
+ tokenOnLeftOfPosition = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ }
+
+ if (IsAnonymousMethodParameterModifierContext(syntaxTree, position, tokenOnLeftOfPosition, cancellationToken) ||
+ IsPossibleLambdaParameterModifierContext(syntaxTree, position, tokenOnLeftOfPosition, cancellationToken))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsValidContextForFromClause(
+ this SyntaxTree syntaxTree,
+ int position,
+ SyntaxToken tokenOnLeftOfPosition,
+ CancellationToken cancellationToken,
+ SemanticModel semanticModelOpt = null)
+ {
+ if (syntaxTree.IsExpressionContext(position, tokenOnLeftOfPosition, attributes: false, cancellationToken: cancellationToken, semanticModelOpt: semanticModelOpt) &&
+ !syntaxTree.IsConstantExpressionContext(position, tokenOnLeftOfPosition, cancellationToken))
+ {
+ return true;
+ }
+
+ // cases:
+ // var q = |
+ // var q = f|
+ //
+ // var q = from x in y
+ // |
+ //
+ // var q = from x in y
+ // f|
+ //
+ // this list is *not* exhaustive.
+ // the first two are handled by 'IsExpressionContext'
+
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ // var q = from x in y
+ // |
+ if (!token.IntersectsWith(position) &&
+ token.IsLastTokenOfQueryClause())
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsValidContextForJoinClause(
+ this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ // var q = from x in y
+ // |
+ if (!token.IntersectsWith(position) &&
+ token.IsLastTokenOfQueryClause())
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsDeclarationExpressionContext(
+ this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ // cases:
+ // M(out var
+ // var x = var
+
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.IsKind (SyntaxKind.OutKeyword) &&
+ token.Parent.IsKind(SyntaxKind.Argument))
+ {
+ return true;
+ }
+
+ if (token.IsKind(SyntaxKind.EqualsToken) &&
+ token.Parent.IsKind(SyntaxKind.EqualsValueClause) &&
+ token.Parent.IsParentKind(SyntaxKind.VariableDeclarator))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsLocalVariableDeclarationContext(
+ this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ // cases:
+ // const var
+ // for (var
+ // foreach (var
+ // using (var
+ // from var
+ // join var
+
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.ConstKeyword &&
+ token.Parent.IsKind(SyntaxKind.LocalDeclarationStatement))
+ {
+ return true;
+ }
+
+ if (token.Kind() == SyntaxKind.OpenParenToken)
+ {
+ var previous = token.GetPreviousToken(includeSkipped: true);
+ if (previous.Kind() == SyntaxKind.ForKeyword ||
+ previous.Kind() == SyntaxKind.ForEachKeyword ||
+ previous.Kind() == SyntaxKind.UsingKeyword)
+ {
+ return true;
+ }
+ }
+
+ var tokenOnLeftOfStart = syntaxTree.FindTokenOnLeftOfPosition(token.SpanStart, cancellationToken);
+ if (token.IsKindOrHasMatchingText(SyntaxKind.FromKeyword) &&
+ syntaxTree.IsValidContextForFromClause(token.SpanStart, tokenOnLeftOfStart, cancellationToken))
+ {
+ return true;
+ }
+
+ if (token.IsKind(SyntaxKind.JoinKeyword) &&
+ syntaxTree.IsValidContextForJoinClause(token.SpanStart, tokenOnLeftOfStart, cancellationToken))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsFixedVariableDeclarationContext(
+ this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ // cases:
+ // fixed (var
+
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.OpenParenToken &&
+ token.GetPreviousToken(includeSkipped: true).Kind() == SyntaxKind.FixedKeyword)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsCatchVariableDeclarationContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ // cases:
+ // catch (var
+
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.OpenParenToken &&
+ token.GetPreviousToken(includeSkipped: true).Kind() == SyntaxKind.CatchKeyword)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsIsOrAsTypeContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.IsKeyword ||
+ token.Kind() == SyntaxKind.AsKeyword)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsObjectCreationTypeContext(
+ this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ var token = tokenOnLeftOfPosition.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.NewKeyword)
+ {
+ // we can follow a 'new' if it's the 'new' for an expression.
+ var start = token.SpanStart;
+ var tokenOnLeftOfStart = syntaxTree.FindTokenOnLeftOfPosition(start, cancellationToken);
+ return
+ IsNonConstantExpressionContext(syntaxTree, token.SpanStart, tokenOnLeftOfStart, cancellationToken) ||
+ syntaxTree.IsStatementContext(token.SpanStart, tokenOnLeftOfStart, cancellationToken) ||
+ syntaxTree.IsGlobalStatementContext(token.SpanStart, cancellationToken);
+ }
+
+ return false;
+ }
+
+ private static bool IsNonConstantExpressionContext(SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ return
+ syntaxTree.IsExpressionContext(position, tokenOnLeftOfPosition, attributes: true, cancellationToken: cancellationToken) &&
+ !syntaxTree.IsConstantExpressionContext(position, tokenOnLeftOfPosition, cancellationToken);
+ }
+
+ public static bool IsPreProcessorDirectiveContext(this SyntaxTree syntaxTree, int position, SyntaxToken preProcessorTokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ var token = preProcessorTokenOnLeftOfPosition;
+ var directive = token.GetAncestor<DirectiveTriviaSyntax>();
+
+ // Directives contain the EOL, so if the position is within the full span of the
+ // directive, then it is on that line, the only exception is if the directive is on the
+ // last line, the position at the end if technically not contained by the directive but
+ // its also not on a new line, so it should be considered part of the preprocessor
+ // context.
+ if (directive == null)
+ {
+ return false;
+ }
+
+ return
+ directive.FullSpan.Contains(position) ||
+ directive.FullSpan.End == syntaxTree.GetRoot(cancellationToken).FullSpan.End;
+ }
+
+ public static bool IsPreProcessorDirectiveContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ var leftToken = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken, includeDirectives: true);
+
+ return syntaxTree.IsPreProcessorDirectiveContext(position, leftToken, cancellationToken);
+ }
+
+ public static bool IsPreProcessorKeywordContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ return IsPreProcessorKeywordContext(
+ syntaxTree, position,
+ syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken, includeDirectives: true),
+ cancellationToken);
+ }
+
+ public static bool IsPreProcessorKeywordContext(this SyntaxTree syntaxTree, int position, SyntaxToken preProcessorTokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ // cases:
+ // #|
+ // #d|
+ // # |
+ // # d|
+
+ // note: comments are not allowed between the # and item.
+ var token = preProcessorTokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.HashToken)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsStatementContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ #if false
+ // we're in a statement if the thing that comes before allows for
+ // statements to follow. Or if we're on a just started identifier
+ // in the first position where a statement can go.
+ if (syntaxTree.IsInPreprocessorDirectiveContext(position, cancellationToken))
+ {
+ return false;
+ }
+ #endif
+
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ return token.IsBeginningOfStatementContext();
+ }
+
+ public static bool IsGlobalStatementContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ if (!syntaxTree.IsInteractiveOrScript())
+ {
+ return false;
+ }
+
+ #if false
+ if (syntaxTree.IsInPreprocessorDirectiveContext(position, cancellationToken))
+ {
+ return false;
+ }
+ #endif
+
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken)
+ .GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.None)
+ {
+ // global statements can't come before usings/externs
+ var compilationUnit = syntaxTree.GetRoot(cancellationToken) as CompilationUnitSyntax;
+ if (compilationUnit != null &&
+ (compilationUnit.Externs.Count > 0 ||
+ compilationUnit.Usings.Count > 0))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ return token.IsBeginningOfGlobalStatementContext();
+ }
+
+ public static bool IsInstanceContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ #if false
+ if (syntaxTree.IsInPreprocessorDirectiveContext(position, cancellationToken))
+ {
+ return false;
+ }
+ #endif
+
+ var token = tokenOnLeftOfPosition;
+
+ // We're in an instance context if we're in the body of an instance member
+ var containingMember = token.GetAncestor<MemberDeclarationSyntax>();
+ if (containingMember == null)
+ {
+ return false;
+ }
+
+ var modifiers = containingMember.GetModifiers();
+ if (modifiers.Any(SyntaxKind.StaticKeyword))
+ {
+ return false;
+ }
+
+ // Must be a property or something method-like.
+ if (containingMember.HasMethodShape())
+ {
+ var body = containingMember.GetBody();
+ return IsInBlock(body, position);
+ }
+
+ var accessor = token.GetAncestor<AccessorDeclarationSyntax>();
+ if (accessor != null)
+ {
+ return IsInBlock(accessor.Body, position);
+ }
+
+ return false;
+ }
+
+ private static bool IsInBlock(BlockSyntax bodyOpt, int position)
+ {
+ if (bodyOpt == null)
+ {
+ return false;
+ }
+
+ return bodyOpt.OpenBraceToken.Span.End <= position &&
+ (bodyOpt.CloseBraceToken.IsMissing || position <= bodyOpt.CloseBraceToken.SpanStart);
+ }
+
+ public static bool IsPossibleCastTypeContext(
+ this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ var token = tokenOnLeftOfPosition.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.IsKind(SyntaxKind.OpenParenToken) &&
+ syntaxTree.IsExpressionContext(token.SpanStart, syntaxTree.FindTokenOnLeftOfPosition(token.SpanStart, cancellationToken), false, cancellationToken))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsDefiniteCastTypeContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.OpenParenToken &&
+ token.Parent.IsKind(SyntaxKind.CastExpression))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsConstantExpressionContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ var token = tokenOnLeftOfPosition.GetPreviousTokenIfTouchingWord(position);
+
+ // case |
+ if (token.Kind() == SyntaxKind.CaseKeyword &&
+ token.Parent.IsKind(SyntaxKind.CaseSwitchLabel))
+ {
+ return true;
+ }
+
+ // goto case |
+ if (token.Kind() == SyntaxKind.CaseKeyword &&
+ token.Parent.IsKind(SyntaxKind.GotoCaseStatement))
+ {
+ return true;
+ }
+
+ if (token.Kind() == SyntaxKind.EqualsToken &&
+ token.Parent.IsKind(SyntaxKind.EqualsValueClause))
+ {
+ var equalsValue = (EqualsValueClauseSyntax)token.Parent;
+
+ if (equalsValue.IsParentKind(SyntaxKind.VariableDeclarator) &&
+ equalsValue.Parent.IsParentKind(SyntaxKind.VariableDeclaration))
+ {
+ // class C { const int i = |
+ var fieldDeclaration = equalsValue.GetAncestor<FieldDeclarationSyntax>();
+ if (fieldDeclaration != null)
+ {
+ return fieldDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword);
+ }
+
+ // void M() { const int i = |
+ var localDeclaration = equalsValue.GetAncestor<LocalDeclarationStatementSyntax>();
+ if (localDeclaration != null)
+ {
+ return localDeclaration.Modifiers.Any(SyntaxKind.ConstKeyword);
+ }
+ }
+
+ // enum E { A = |
+ if (equalsValue.IsParentKind(SyntaxKind.EnumMemberDeclaration))
+ {
+ return true;
+ }
+
+ // void M(int i = |
+ if (equalsValue.IsParentKind(SyntaxKind.Parameter))
+ {
+ return true;
+ }
+ }
+
+ // [Foo( |
+ // [Foo(x, |
+ if (token.Parent.IsKind(SyntaxKind.AttributeArgumentList) &&
+ (token.Kind() == SyntaxKind.CommaToken ||
+ token.Kind() == SyntaxKind.OpenParenToken))
+ {
+ return true;
+ }
+
+ // [Foo(x: |
+ if (token.Kind() == SyntaxKind.ColonToken &&
+ token.Parent.IsKind(SyntaxKind.NameColon) &&
+ token.Parent.IsParentKind(SyntaxKind.AttributeArgument))
+ {
+ return true;
+ }
+
+ // [Foo(X = |
+ if (token.Kind() == SyntaxKind.EqualsToken &&
+ token.Parent.IsKind(SyntaxKind.NameEquals) &&
+ token.Parent.IsParentKind(SyntaxKind.AttributeArgument))
+ {
+ return true;
+ }
+
+ // TODO: Fixed-size buffer declarations
+
+ return false;
+ }
+
+ public static bool IsLabelContext(this SyntaxTree syntaxTree, int position, CancellationToken cancellationToken)
+ {
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+
+ var gotoStatement = token.GetAncestor<GotoStatementSyntax>();
+ if (gotoStatement != null)
+ {
+ if (gotoStatement.GotoKeyword == token)
+ {
+ return true;
+ }
+
+ if (gotoStatement.Expression != null &&
+ !gotoStatement.Expression.IsMissing &&
+ gotoStatement.Expression is IdentifierNameSyntax &&
+ ((IdentifierNameSyntax)gotoStatement.Expression).Identifier == token &&
+ token.IntersectsWith(position))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsExpressionContext(
+ this SyntaxTree syntaxTree,
+ int position,
+ SyntaxToken tokenOnLeftOfPosition,
+ bool attributes,
+ CancellationToken cancellationToken,
+ SemanticModel semanticModelOpt = null)
+ {
+ // cases:
+ // var q = |
+ // var q = a|
+ // this list is *not* exhaustive.
+
+ var token = tokenOnLeftOfPosition.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.GetAncestor<ConditionalDirectiveTriviaSyntax>() != null)
+ {
+ return false;
+ }
+
+ if (!attributes)
+ {
+ if (token.GetAncestor<AttributeListSyntax>() != null)
+ {
+ return false;
+ }
+ }
+
+ if (syntaxTree.IsConstantExpressionContext(position, tokenOnLeftOfPosition, cancellationToken))
+ {
+ return true;
+ }
+
+ // no expressions after . :: ->
+ if (token.Kind() == SyntaxKind.DotToken ||
+ token.Kind() == SyntaxKind.ColonColonToken ||
+ token.Kind() == SyntaxKind.MinusGreaterThanToken)
+ {
+ return false;
+ }
+
+ // Normally you can have any sort of expression after an equals. However, this does not
+ // apply to a "using Foo = ..." situation.
+ if (token.Kind() == SyntaxKind.EqualsToken)
+ {
+ if (token.Parent.IsKind(SyntaxKind.NameEquals) &&
+ token.Parent.IsParentKind(SyntaxKind.UsingDirective))
+ {
+ return false;
+ }
+ }
+
+ // q = |
+ // q -= |
+ // q *= |
+ // q += |
+ // q /= |
+ // q ^= |
+ // q %= |
+ // q &= |
+ // q |= |
+ // q <<= |
+ // q >>= |
+ if (token.Kind() == SyntaxKind.EqualsToken ||
+ token.Kind() == SyntaxKind.MinusEqualsToken ||
+ token.Kind() == SyntaxKind.AsteriskEqualsToken ||
+ token.Kind() == SyntaxKind.PlusEqualsToken ||
+ token.Kind() == SyntaxKind.SlashEqualsToken ||
+ token.Kind() == SyntaxKind.ExclamationEqualsToken ||
+ token.Kind() == SyntaxKind.CaretEqualsToken ||
+ token.Kind() == SyntaxKind.AmpersandEqualsToken ||
+ token.Kind() == SyntaxKind.BarEqualsToken ||
+ token.Kind() == SyntaxKind.PercentEqualsToken ||
+ token.Kind() == SyntaxKind.LessThanLessThanEqualsToken ||
+ token.Kind() == SyntaxKind.GreaterThanGreaterThanEqualsToken)
+ {
+ return true;
+ }
+
+ // ( |
+ if (token.Kind() == SyntaxKind.OpenParenToken &&
+ token.Parent.IsKind(SyntaxKind.ParenthesizedExpression))
+ {
+ return true;
+ }
+
+ // - |
+ // + |
+ // ~ |
+ // ! |
+ if (token.Parent is PrefixUnaryExpressionSyntax)
+ {
+ var prefix = token.Parent as PrefixUnaryExpressionSyntax;
+ return prefix.OperatorToken == token;
+ }
+
+ // not sure about these:
+ // ++ |
+ // -- |
+ #if false
+ token.Kind == SyntaxKind.PlusPlusToken ||
+ token.Kind == SyntaxKind.DashDashToken)
+ #endif
+ // await |
+ if (token.Parent is AwaitExpressionSyntax)
+ {
+ var awaitExpression = token.Parent as AwaitExpressionSyntax;
+ return awaitExpression.AwaitKeyword == token;
+ }
+
+ // Check for binary operators.
+ // Note:
+ // - We handle < specially as it can be ambiguous with generics.
+ // - We handle * specially because it can be ambiguous with pointer types.
+
+ // a *
+ // a /
+ // a %
+ // a +
+ // a -
+ // a <<
+ // a >>
+ // a <
+ // a >
+ // a &&
+ // a ||
+ // a &
+ // a |
+ // a ^
+ if (token.Parent is BinaryExpressionSyntax)
+ {
+ // If the client provided a binding, then check if this is actually generic. If so,
+ // then this is not an expression context. i.e. if we have "Foo < |" then it could
+ // be an expression context, or it could be a type context if Foo binds to a type or
+ // method.
+ if (semanticModelOpt != null && syntaxTree.IsGenericTypeArgumentContext(position, tokenOnLeftOfPosition, cancellationToken, semanticModelOpt))
+ {
+ return false;
+ }
+
+ var binary = token.Parent as BinaryExpressionSyntax;
+ if (binary.OperatorToken == token)
+ {
+ // If this is a multiplication expression and a semantic model was passed in,
+ // check to see if the expression to the left is a type name. If it is, treat
+ // this as a pointer type.
+ if (token.Kind() == SyntaxKind.AsteriskToken && semanticModelOpt != null)
+ {
+ var type = binary.Left as TypeSyntax;
+ if (type != null && type.IsPotentialTypeName(semanticModelOpt, cancellationToken))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ }
+
+ // Special case:
+ // Foo * bar
+ // Foo ? bar
+ // This parses as a local decl called bar of type Foo* or Foo?
+ if (tokenOnLeftOfPosition.IntersectsWith(position) &&
+ tokenOnLeftOfPosition.Kind() == SyntaxKind.IdentifierToken)
+ {
+ var previousToken = tokenOnLeftOfPosition.GetPreviousToken(includeSkipped: true);
+ if (previousToken.Kind() == SyntaxKind.AsteriskToken ||
+ previousToken.Kind() == SyntaxKind.QuestionToken)
+ {
+ if (previousToken.Parent.IsKind(SyntaxKind.PointerType) ||
+ previousToken.Parent.IsKind(SyntaxKind.NullableType))
+ {
+ var type = previousToken.Parent as TypeSyntax;
+ if (type.IsParentKind(SyntaxKind.VariableDeclaration) &&
+ type.Parent.IsParentKind(SyntaxKind.LocalDeclarationStatement))
+ {
+ // var declStatement = type.Parent.Parent as LocalDeclarationStatementSyntax;
+
+ // note, this doesn't apply for cases where we know it
+ // absolutely is not multiplcation or a conditional expression.
+ var underlyingType = type is PointerTypeSyntax
+ ? ((PointerTypeSyntax)type).ElementType
+ : ((NullableTypeSyntax)type).ElementType;
+
+ if (!underlyingType.IsPotentialTypeName(semanticModelOpt, cancellationToken))
+ {
+ return true;
+ }
+ }
+ }
+ }
+ }
+
+ // new int[|
+ // new int[expr, |
+ if (token.Kind() == SyntaxKind.OpenBracketToken ||
+ token.Kind() == SyntaxKind.CommaToken)
+ {
+ if (token.Parent.IsKind(SyntaxKind.ArrayRankSpecifier))
+ {
+ return true;
+ }
+ }
+
+ // foo ? |
+ if (token.Kind() == SyntaxKind.QuestionToken &&
+ token.Parent.IsKind(SyntaxKind.ConditionalExpression))
+ {
+ // If the condition is simply a TypeSyntax that binds to a type, treat this as a nullable type.
+ var conditionalExpression = (ConditionalExpressionSyntax)token.Parent;
+ var type = conditionalExpression.Condition as TypeSyntax;
+
+ return type == null
+ || !type.IsPotentialTypeName(semanticModelOpt, cancellationToken);
+ }
+
+ // foo ? bar : |
+ if (token.Kind() == SyntaxKind.ColonToken &&
+ token.Parent.IsKind(SyntaxKind.ConditionalExpression))
+ {
+ return true;
+ }
+
+ // typeof(|
+ // default(|
+ // sizeof(|
+ if (token.Kind() == SyntaxKind.OpenParenToken)
+ {
+ if (token.Parent.IsKind(SyntaxKind.TypeOfExpression, SyntaxKind.DefaultExpression, SyntaxKind.SizeOfExpression))
+ {
+ return false;
+ }
+ }
+
+ // Foo(|
+ // Foo(expr, |
+ // this[|
+ if (token.Kind() == SyntaxKind.OpenParenToken ||
+ token.Kind() == SyntaxKind.OpenBracketToken ||
+ token.Kind() == SyntaxKind.CommaToken)
+ {
+ if (token.Parent.IsKind(SyntaxKind.ArgumentList, SyntaxKind.BracketedArgumentList))
+ {
+ return true;
+ }
+ }
+
+ // [Foo(|
+ // [Foo(expr, |
+ if (attributes)
+ {
+ if (token.Kind() == SyntaxKind.OpenParenToken ||
+ token.Kind() == SyntaxKind.CommaToken)
+ {
+ if (token.Parent.IsKind(SyntaxKind.AttributeArgumentList))
+ {
+ return true;
+ }
+ }
+ }
+
+ // Foo(ref |
+ // Foo(bar |
+ if (token.Kind() == SyntaxKind.RefKeyword ||
+ token.Kind() == SyntaxKind.OutKeyword)
+ {
+ if (token.Parent.IsKind(SyntaxKind.Argument))
+ {
+ return true;
+ }
+ }
+
+ // Foo(bar: |
+ if (token.Kind() == SyntaxKind.ColonToken &&
+ token.Parent.IsKind(SyntaxKind.NameColon) &&
+ token.Parent.IsParentKind(SyntaxKind.Argument))
+ {
+ return true;
+ }
+
+ // a => |
+ if (token.Kind() == SyntaxKind.EqualsGreaterThanToken)
+ {
+ return true;
+ }
+
+ // new List<int> { |
+ // new List<int> { expr, |
+ if (token.Kind() == SyntaxKind.OpenBraceToken ||
+ token.Kind() == SyntaxKind.CommaToken)
+ {
+ if (token.Parent is InitializerExpressionSyntax)
+ {
+ // The compiler treats the ambiguous case as an object initializer, so we'll say
+ // expressions are legal here
+ if (token.Parent.Kind() == SyntaxKind.ObjectInitializerExpression && token.Kind() == SyntaxKind.OpenBraceToken)
+ {
+ // In this position { a$$ =, the user is trying to type an object initializer.
+ if (!token.IntersectsWith(position) && token.GetNextToken().GetNextToken().Kind() == SyntaxKind.EqualsToken)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ // Perform a semantic check to determine whether or not the type being created
+ // can support a collection initializer. If not, this must be an object initializer
+ // and can't be an expression context.
+ if (semanticModelOpt != null &&
+ token.Parent.IsParentKind(SyntaxKind.ObjectCreationExpression))
+ {
+ var objectCreation = (ObjectCreationExpressionSyntax)token.Parent.Parent;
+ var type = semanticModelOpt.GetSymbolInfo(objectCreation.Type, cancellationToken).Symbol as ITypeSymbol;
+ if (type != null && !type.CanSupportCollectionInitializer())
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ }
+
+ // for (; |
+ // for (; ; |
+ if (token.Kind() == SyntaxKind.SemicolonToken &&
+ token.Parent.IsKind(SyntaxKind.ForStatement))
+ {
+ var forStatement = (ForStatementSyntax)token.Parent;
+ if (token == forStatement.FirstSemicolonToken ||
+ token == forStatement.SecondSemicolonToken)
+ {
+ return true;
+ }
+ }
+
+ // for ( |
+ if (token.Kind() == SyntaxKind.OpenParenToken &&
+ token.Parent.IsKind(SyntaxKind.ForStatement))
+ {
+ var forStatement = (ForStatementSyntax)token.Parent;
+ if (token == forStatement.OpenParenToken)
+ {
+ return true;
+ }
+ }
+
+ // for (; ; Foo(), |
+ // for ( Foo(), |
+ if (token.Kind() == SyntaxKind.CommaToken &&
+ token.Parent.IsKind(SyntaxKind.ForStatement))
+ {
+ return true;
+ }
+
+ // foreach (var v in |
+ // from a in |
+ // join b in |
+ if (token.Kind() == SyntaxKind.InKeyword)
+ {
+ if (token.Parent.IsKind(SyntaxKind.ForEachStatement, SyntaxKind.FromClause, SyntaxKind.JoinClause))
+ {
+ return true;
+ }
+ }
+
+ // join x in y on |
+ // join x in y on a equals |
+ if (token.Kind() == SyntaxKind.OnKeyword ||
+ token.Kind() == SyntaxKind.EqualsKeyword)
+ {
+ if (token.Parent.IsKind(SyntaxKind.JoinClause))
+ {
+ return true;
+ }
+ }
+
+ // where |
+ if (token.Kind() == SyntaxKind.WhereKeyword &&
+ token.Parent.IsKind(SyntaxKind.WhereClause))
+ {
+ return true;
+ }
+
+ // orderby |
+ // orderby a, |
+ if (token.Kind() == SyntaxKind.OrderByKeyword ||
+ token.Kind() == SyntaxKind.CommaToken)
+ {
+ if (token.Parent.IsKind(SyntaxKind.OrderByClause))
+ {
+ return true;
+ }
+ }
+
+ // select |
+ if (token.Kind() == SyntaxKind.SelectKeyword &&
+ token.Parent.IsKind(SyntaxKind.SelectClause))
+ {
+ return true;
+ }
+
+ // group |
+ // group expr by |
+ if (token.Kind() == SyntaxKind.GroupKeyword ||
+ token.Kind() == SyntaxKind.ByKeyword)
+ {
+ if (token.Parent.IsKind(SyntaxKind.GroupClause))
+ {
+ return true;
+ }
+ }
+
+ // return |
+ // yield return |
+ // but not: [return |
+ if (token.Kind() == SyntaxKind.ReturnKeyword)
+ {
+ if (token.GetPreviousToken(includeSkipped: true).Kind() != SyntaxKind.OpenBracketToken)
+ {
+ return true;
+ }
+ }
+
+ // throw |
+ if (token.Kind() == SyntaxKind.ThrowKeyword)
+ {
+ return true;
+ }
+
+ // while ( |
+ if (token.Kind() == SyntaxKind.OpenParenToken &&
+ token.GetPreviousToken(includeSkipped: true).Kind() == SyntaxKind.WhileKeyword)
+ {
+ return true;
+ }
+
+ // todo: handle 'for' cases.
+
+ // using ( |
+ if (token.Kind() == SyntaxKind.OpenParenToken &&
+ token.GetPreviousToken(includeSkipped: true).Kind() == SyntaxKind.UsingKeyword)
+ {
+ return true;
+ }
+
+ // lock ( |
+ if (token.Kind() == SyntaxKind.OpenParenToken &&
+ token.GetPreviousToken(includeSkipped: true).Kind() == SyntaxKind.LockKeyword)
+ {
+ return true;
+ }
+
+ // lock ( |
+ if (token.Kind() == SyntaxKind.OpenParenToken &&
+ token.GetPreviousToken(includeSkipped: true).Kind() == SyntaxKind.IfKeyword)
+ {
+ return true;
+ }
+
+ // switch ( |
+ if (token.Kind() == SyntaxKind.OpenParenToken &&
+ token.GetPreviousToken(includeSkipped: true).Kind() == SyntaxKind.SwitchKeyword)
+ {
+ return true;
+ }
+
+ // checked ( |
+ if (token.Kind() == SyntaxKind.OpenParenToken &&
+ token.GetPreviousToken(includeSkipped: true).Kind() == SyntaxKind.CheckedKeyword)
+ {
+ return true;
+ }
+
+ // unchecked ( |
+ if (token.Kind() == SyntaxKind.OpenParenToken &&
+ token.GetPreviousToken(includeSkipped: true).Kind() == SyntaxKind.UncheckedKeyword)
+ {
+ return true;
+ }
+
+ // TODO: Uncomment on roslyn update when keyord currently missing.
+ // when ( |
+// if (token.Kind() == SyntaxKind.OpenParenToken &&
+// token.GetPreviousToken(includeSkipped: true).Kind() == SyntaxKind.WhenKeyword)
+// {
+// return true;
+// }
+
+ // (SomeType) |
+ if (token.IsAfterPossibleCast())
+ {
+ return true;
+ }
+
+ // In anonymous type initializer.
+ //
+ // new { | We allow new inside of anonymous object member declarators, so that the user
+ // can dot into a member afterward. For example:
+ //
+ // var a = new { new C().Foo };
+ if (token.Kind() == SyntaxKind.OpenBraceToken || token.Kind() == SyntaxKind.CommaToken)
+ {
+ if (token.Parent.IsKind(SyntaxKind.AnonymousObjectCreationExpression))
+ {
+ return true;
+ }
+ }
+
+ // $"{ |
+ // $@"{ |
+ // $"{x} { |
+ // $@"{x} { |
+ // TODO: Uncomment on roslyn update.
+// if (token.Kind() == SyntaxKind.OpenBraceToken)
+// {
+// return token.Parent.IsKind(SyntaxKind.Interpolation)
+// && ((InterpolationSyntax)token.Parent).OpenBraceToken == token;
+// }
+//
+ return false;
+ }
+
+ public static bool IsNameOfContext(this SyntaxTree syntaxTree, int position, SemanticModel semanticModelOpt = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ // nameof(Foo.|
+ // nameof(Foo.Bar.|
+ // Locate the open paren.
+ if (token.IsKind(SyntaxKind.DotToken))
+ {
+ // Could have been parsed as member access
+ if (token.Parent.IsKind(SyntaxKind.SimpleMemberAccessExpression))
+ {
+ var parentMemberAccess = token.Parent;
+ while (parentMemberAccess.IsParentKind(SyntaxKind.SimpleMemberAccessExpression))
+ {
+ parentMemberAccess = parentMemberAccess.Parent;
+ }
+
+ if (parentMemberAccess.IsParentKind(SyntaxKind.Argument) &&
+ parentMemberAccess.Parent.IsChildNode<ArgumentListSyntax>(a => a.Arguments.FirstOrDefault()))
+ {
+ token = ((ArgumentListSyntax)parentMemberAccess.Parent.Parent).OpenParenToken;
+ }
+ }
+
+ // Could have been parsed as a qualified name.
+ if (token.Parent.IsKind(SyntaxKind.QualifiedName))
+ {
+ var parentQualifiedName = token.Parent;
+ while (parentQualifiedName.IsParentKind(SyntaxKind.QualifiedName))
+ {
+ parentQualifiedName = parentQualifiedName.Parent;
+ }
+
+ if (parentQualifiedName.IsParentKind(SyntaxKind.Argument) &&
+ parentQualifiedName.Parent.IsChildNode<ArgumentListSyntax>(a => a.Arguments.FirstOrDefault()))
+ {
+ token = ((ArgumentListSyntax)parentQualifiedName.Parent.Parent).OpenParenToken;
+ }
+ }
+ }
+
+ ExpressionSyntax parentExpression = null;
+
+ // if the nameof expression has a missing close paren, it is parsed as an invocation expression.
+ if (token.Parent.IsKind(SyntaxKind.ArgumentList) &&
+ token.Parent.IsParentKind(SyntaxKind.InvocationExpression))
+ {
+ var invocationExpression = (InvocationExpressionSyntax)token.Parent.Parent;
+ if (!invocationExpression.IsParentKind(SyntaxKind.ConditionalAccessExpression) &&
+ !invocationExpression.IsParentKind(SyntaxKind.SimpleMemberAccessExpression) &&
+ !invocationExpression.IsParentKind(SyntaxKind.PointerMemberAccessExpression) &&
+ invocationExpression.Expression.IsKind(SyntaxKind.IdentifierName) &&
+ ((IdentifierNameSyntax)invocationExpression.Expression).Identifier.IsKindOrHasMatchingText(SyntaxKind.NameOfKeyword))
+ {
+ parentExpression = invocationExpression;
+ }
+ }
+
+ if (parentExpression != null)
+ {
+ if (semanticModelOpt == null)
+ {
+ return true;
+ }
+
+ return semanticModelOpt.GetSymbolInfo(parentExpression, cancellationToken).Symbol == null;
+ }
+
+ return false;
+ }
+
+ public static bool IsIsOrAsContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ // cases:
+ // expr |
+
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.GetAncestor<BlockSyntax>() == null)
+ {
+ return false;
+ }
+
+ // is/as are valid after expressions.
+ if (token.IsLastTokenOfNode<ExpressionSyntax>())
+ {
+ // However, many names look like expressions. For example:
+ // foreach (var |
+ // ('var' is a TypeSyntax which is an expression syntax.
+
+ var type = token.GetAncestors<TypeSyntax>().LastOrDefault();
+ if (type == null)
+ {
+ return true;
+ }
+
+ if (type.IsKind(SyntaxKind.GenericName) ||
+ type.IsKind(SyntaxKind.AliasQualifiedName) ||
+ type.IsKind(SyntaxKind.PredefinedType))
+ {
+ return false;
+ }
+
+ ExpressionSyntax nameExpr = type;
+ if (IsRightSideName(nameExpr))
+ {
+ nameExpr = (ExpressionSyntax)nameExpr.Parent;
+ }
+
+ // If this name is the start of a local variable declaration context, we
+ // shouldn't show is or as. For example: for(var |
+ if (syntaxTree.IsLocalVariableDeclarationContext(token.SpanStart, syntaxTree.FindTokenOnLeftOfPosition(token.SpanStart, cancellationToken), cancellationToken))
+ {
+ return false;
+ }
+
+ // Not on the left hand side of an object initializer
+ if (token.IsKind(SyntaxKind.IdentifierToken) &&
+ token.Parent.IsKind(SyntaxKind.IdentifierName) &&
+ (token.Parent.IsParentKind(SyntaxKind.ObjectInitializerExpression) || token.Parent.IsParentKind(SyntaxKind.CollectionInitializerExpression)))
+ {
+ return false;
+ }
+
+ // Not after an 'out' declaration expression. For example: M(out var |
+ if (token.IsKind(SyntaxKind.IdentifierToken) &&
+ token.Parent.IsKind(SyntaxKind.IdentifierName))
+ {
+ if (token.Parent.IsParentKind(SyntaxKind.Argument) &&
+ ((ArgumentSyntax)token.Parent.Parent).RefOrOutKeyword.IsKind(SyntaxKind.OutKeyword))
+ {
+ return false;
+ }
+ }
+
+ // Now, make sure the name was actually in a location valid for
+ // an expression. If so, then we know we can follow it.
+ if (syntaxTree.IsExpressionContext(nameExpr.SpanStart, syntaxTree.FindTokenOnLeftOfPosition(nameExpr.SpanStart, cancellationToken), attributes: false, cancellationToken: cancellationToken))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ return false;
+ }
+
+ private static bool IsRightSideName(ExpressionSyntax name)
+ {
+ if (name.Parent != null)
+ {
+ switch (name.Parent.Kind())
+ {
+ case SyntaxKind.QualifiedName:
+ return ((QualifiedNameSyntax)name.Parent).Right == name;
+ case SyntaxKind.AliasQualifiedName:
+ return ((AliasQualifiedNameSyntax)name.Parent).Name == name;
+ case SyntaxKind.SimpleMemberAccessExpression:
+ return ((MemberAccessExpressionSyntax)name.Parent).Name == name;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsCatchOrFinallyContext(
+ this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ // cases:
+ // try {
+ // } |
+
+ // try {
+ // } c|
+
+ // try {
+ // } catch {
+ // } |
+
+ // try {
+ // } catch {
+ // } c|
+
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.Kind() == SyntaxKind.CloseBraceToken)
+ {
+ var block = token.GetAncestor<BlockSyntax>();
+
+ if (block != null && token == block.GetLastToken(includeSkipped: true))
+ {
+ if (block.IsParentKind(SyntaxKind.TryStatement) ||
+ block.IsParentKind(SyntaxKind.CatchClause))
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsCatchFilterContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition)
+ {
+ // cases:
+ // catch |
+ // catch i|
+ // catch (declaration) |
+ // catch (declaration) i|
+
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ if (token.IsKind(SyntaxKind.CatchKeyword))
+ {
+ return true;
+ }
+
+ if (token.IsKind(SyntaxKind.CloseParenToken) &&
+ token.Parent.IsKind(SyntaxKind.CatchDeclaration))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public static bool IsEnumBaseListContext(this SyntaxTree syntaxTree, int position, SyntaxToken tokenOnLeftOfPosition, CancellationToken cancellationToken)
+ {
+ var token = tokenOnLeftOfPosition;
+ token = token.GetPreviousTokenIfTouchingWord(position);
+
+ // Options:
+ // enum E : |
+ // enum E : i|
+
+ return
+ token.Kind() == SyntaxKind.ColonToken &&
+ token.Parent.IsKind(SyntaxKind.BaseList) &&
+ token.Parent.IsParentKind(SyntaxKind.EnumDeclaration);
+ }
+
+ public static bool IsEnumTypeMemberAccessContext(this SyntaxTree syntaxTree, SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ var token = syntaxTree
+ .FindTokenOnLeftOfPosition(position, cancellationToken)
+ .GetPreviousTokenIfTouchingWord(position);
+
+ if (!token.IsKind(SyntaxKind.DotToken) ||
+ !token.Parent.IsKind(SyntaxKind.SimpleMemberAccessExpression))
+ {
+ return false;
+ }
+
+ var memberAccess = (MemberAccessExpressionSyntax)token.Parent;
+ var leftHandBinding = semanticModel.GetSymbolInfo(memberAccess.Expression, cancellationToken);
+ var symbol = leftHandBinding.GetBestOrAllSymbols().FirstOrDefault();
+
+ if (symbol == null)
+ {
+ return false;
+ }
+
+ switch (symbol.Kind)
+ {
+ case SymbolKind.NamedType:
+ return ((INamedTypeSymbol)symbol).TypeKind == TypeKind.Enum;
+ case SymbolKind.Alias:
+ var target = ((IAliasSymbol)symbol).Target;
+ return target.IsType && ((ITypeSymbol)target).TypeKind == TypeKind.Enum;
+ }
+
+ return false;
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/SyntaxTriviaExtensions.cs b/main/src/addins/CSharpBinding/Util/SyntaxTriviaExtensions.cs
new file mode 100644
index 0000000000..6cf5554eee
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SyntaxTriviaExtensions.cs
@@ -0,0 +1,209 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class SyntaxTriviaExtensions
+ {
+ public static int Width(this SyntaxTrivia trivia)
+ {
+ return trivia.Span.Length;
+ }
+
+ public static int FullWidth(this SyntaxTrivia trivia)
+ {
+ return trivia.FullSpan.Length;
+ }
+
+ public static bool IsElastic(this SyntaxTrivia trivia)
+ {
+ return trivia.HasAnnotation(SyntaxAnnotation.ElasticAnnotation);
+ }
+
+ public static bool MatchesKind(this SyntaxTrivia trivia, SyntaxKind kind)
+ {
+ return trivia.Kind() == kind;
+ }
+
+ public static bool MatchesKind(this SyntaxTrivia trivia, SyntaxKind kind1, SyntaxKind kind2)
+ {
+ var triviaKind = trivia.Kind();
+ return triviaKind == kind1 || triviaKind == kind2;
+ }
+
+ public static bool MatchesKind(this SyntaxTrivia trivia, params SyntaxKind[] kinds)
+ {
+ return kinds.Contains(trivia.Kind());
+ }
+
+ public static bool IsRegularComment(this SyntaxTrivia trivia)
+ {
+ return trivia.IsSingleLineComment() || trivia.IsMultiLineComment();
+ }
+
+ public static bool IsRegularOrDocComment(this SyntaxTrivia trivia)
+ {
+ return trivia.IsSingleLineComment() || trivia.IsMultiLineComment() || trivia.IsDocComment();
+ }
+
+ public static bool IsSingleLineComment(this SyntaxTrivia trivia)
+ {
+ return trivia.Kind() == SyntaxKind.SingleLineCommentTrivia;
+ }
+
+ public static bool IsMultiLineComment(this SyntaxTrivia trivia)
+ {
+ return trivia.Kind() == SyntaxKind.MultiLineCommentTrivia;
+ }
+
+ public static bool IsCompleteMultiLineComment(this SyntaxTrivia trivia)
+ {
+ if (trivia.Kind() != SyntaxKind.MultiLineCommentTrivia)
+ {
+ return false;
+ }
+
+ var text = trivia.ToFullString();
+ return text.Length >= 4
+ && text[text.Length - 1] == '/'
+ && text[text.Length - 2] == '*';
+ }
+
+ public static bool IsDocComment(this SyntaxTrivia trivia)
+ {
+ return trivia.IsSingleLineDocComment() || trivia.IsMultiLineDocComment();
+ }
+
+ public static bool IsSingleLineDocComment(this SyntaxTrivia trivia)
+ {
+ return trivia.Kind() == SyntaxKind.SingleLineDocumentationCommentTrivia;
+ }
+
+ public static bool IsMultiLineDocComment(this SyntaxTrivia trivia)
+ {
+ return trivia.Kind() == SyntaxKind.MultiLineDocumentationCommentTrivia;
+ }
+
+ public static string GetCommentText(this SyntaxTrivia trivia)
+ {
+ var commentText = trivia.ToString();
+ if (trivia.Kind() == SyntaxKind.SingleLineCommentTrivia)
+ {
+ if (commentText.StartsWith("//"))
+ {
+ commentText = commentText.Substring(2);
+ }
+
+ return commentText.TrimStart(null);
+ }
+ else if (trivia.Kind() == SyntaxKind.MultiLineCommentTrivia)
+ {
+ var textBuilder = new StringBuilder();
+
+ if (commentText.EndsWith("*/"))
+ {
+ commentText = commentText.Substring(0, commentText.Length - 2);
+ }
+
+ if (commentText.StartsWith("/*"))
+ {
+ commentText = commentText.Substring(2);
+ }
+
+ commentText = commentText.Trim();
+
+ var newLine = Environment.NewLine;
+ var lines = commentText.Split(new[] { newLine }, StringSplitOptions.None);
+ foreach (var line in lines)
+ {
+ var trimmedLine = line.Trim();
+
+ // Note: we trim leading '*' characters in multi-line comments.
+ // If the '*' was intentional, sorry, it's gone.
+ if (trimmedLine.StartsWith("*"))
+ {
+ trimmedLine = trimmedLine.TrimStart('*');
+ trimmedLine = trimmedLine.TrimStart(null);
+ }
+
+ textBuilder.AppendLine(trimmedLine);
+ }
+
+ // remove last line break
+ textBuilder.Remove(textBuilder.Length - newLine.Length, newLine.Length);
+
+ return textBuilder.ToString();
+ }
+ else
+ {
+ throw new InvalidOperationException();
+ }
+ }
+
+ public static string AsString(this IEnumerable<SyntaxTrivia> trivia)
+ {
+ //Contract.ThrowIfNull(trivia);
+
+ if (trivia.Any())
+ {
+ var sb = new StringBuilder();
+ trivia.Select(t => t.ToFullString()).Do((s) => sb.Append(s));
+ return sb.ToString();
+ }
+ else
+ {
+ return string.Empty;
+ }
+ }
+
+ public static int GetFullWidth(this IEnumerable<SyntaxTrivia> trivia)
+ {
+ //Contract.ThrowIfNull(trivia);
+ return trivia.Sum(t => t.FullWidth());
+ }
+
+ public static SyntaxTriviaList AsTrivia(this string s)
+ {
+ return SyntaxFactory.ParseLeadingTrivia(s ?? string.Empty);
+ }
+
+ public static bool IsWhitespaceOrEndOfLine(this SyntaxTrivia trivia)
+ {
+ return trivia.Kind() == SyntaxKind.WhitespaceTrivia || trivia.Kind() == SyntaxKind.EndOfLineTrivia;
+ }
+
+ public static SyntaxTrivia GetPreviousTrivia(
+ this SyntaxTrivia trivia, SyntaxTree syntaxTree, CancellationToken cancellationToken, bool findInsideTrivia = false)
+ {
+ var span = trivia.FullSpan;
+ if (span.Start == 0)
+ {
+ return default(SyntaxTrivia);
+ }
+
+ return syntaxTree.GetRoot(cancellationToken).FindTrivia(span.Start - 1, findInsideTrivia);
+ }
+
+ #if false
+ public static int Width(this SyntaxTrivia trivia)
+ {
+ return trivia.Span.Length;
+ }
+
+ public static int FullWidth(this SyntaxTrivia trivia)
+ {
+ return trivia.FullSpan.Length;
+ }
+ #endif
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/SyntaxTriviaListExtensions.cs b/main/src/addins/CSharpBinding/Util/SyntaxTriviaListExtensions.cs
new file mode 100644
index 0000000000..b3c0723bcb
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/SyntaxTriviaListExtensions.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ internal static class SyntaxTriviaListExtensions
+ {
+ public static bool Any(this SyntaxTriviaList triviaList, params SyntaxKind[] kinds)
+ {
+ foreach (var trivia in triviaList)
+ {
+ if (trivia.MatchesKind(kinds))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static SyntaxTrivia? GetFirstNewLine(this SyntaxTriviaList triviaList)
+ {
+ return triviaList
+ .Where(t => t.Kind() == SyntaxKind.EndOfLineTrivia)
+ .FirstOrNullable();
+ }
+
+ public static SyntaxTrivia? GetLastComment(this SyntaxTriviaList triviaList)
+ {
+ return triviaList
+ .Where(t => t.MatchesKind(SyntaxKind.SingleLineCommentTrivia, SyntaxKind.MultiLineCommentTrivia))
+ .LastOrNullable();
+ }
+
+ public static IEnumerable<SyntaxTrivia> SkipInitialWhitespace(this SyntaxTriviaList triviaList)
+ {
+ return triviaList.SkipWhile(t => t.Kind() == SyntaxKind.WhitespaceTrivia);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/TaskExtensions.cs b/main/src/addins/CSharpBinding/Util/TaskExtensions.cs
new file mode 100644
index 0000000000..0b0ae8f69f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/TaskExtensions.cs
@@ -0,0 +1,363 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Diagnostics.CodeAnalysis;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.ErrorReporting;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ [SuppressMessage("ApiDesign", "RS0011", Justification = "Matching TPL Signatures")]
+ static partial class TaskExtensions
+ {
+ public static T WaitAndGetResult<T>(this Task<T> task, CancellationToken cancellationToken)
+ {
+ #if false // eventually this will go live for check-in
+ #if DEBUG
+ if (Microsoft.CodeAnalysis.Workspace.PrimaryWorkspace != null && // only care if we are in a UI situation.. this keeps normal unit tests from failing
+ Thread.CurrentThread.IsThreadPoolThread)
+ {
+ // This check is meant to catch improper waits on background threads when integration tests are run.
+ System.Diagnostics.Debug.Fail("WaitAndGetResult called from thread pool thread.");
+ }
+ #endif
+ #endif
+ task.Wait(cancellationToken);
+ return task.Result;
+ }
+
+ // NOTE(cyrusn): Once we switch over to .Net 4.5 we can make our SafeContinueWith overloads
+ // simply call into task.ContinueWith(..., TaskContinuationOptions.LazyCancellation, ...) as
+ // that will have the semantics that we want. From the TPL guys:
+ //
+ // In this situation:
+ #if false
+ Task A = Task.Run(...);
+ Task B = A.ContinueWith(..., cancellationToken);
+ Task C = B.ContinueWith(...);
+ #endif
+ // If "cancellationToken" is signaled, B completes immediately (if it has not yet started).
+ // Which means that C can start before A completes, which would seem to violate the rules of
+ // the dependency chain.
+ //
+ // We've added TaskContinuationOptions.LazyCancellation option to signify "this continuation
+ // will not complete due to cancellation until its antecedent has completed". We considered
+ // simply changing the default underlying behavior, but rejected that idea because there was
+ // a good chance that existing users had already drawn a dependency on the current behavior.
+
+ public static Task SafeContinueWith(
+ this Task task,
+ Action<Task> continuationAction,
+ CancellationToken cancellationToken,
+ TaskContinuationOptions continuationOptions,
+ TaskScheduler scheduler)
+ {
+ Func<Task, bool> continuationFunction = antecedent =>
+ {
+ continuationAction(antecedent);
+ return true;
+ };
+
+ return task.SafeContinueWith(continuationFunction, cancellationToken, continuationOptions, scheduler);
+ }
+
+ public static Task<TResult> SafeContinueWith<TInput, TResult>(
+ this Task<TInput> task,
+ Func<Task<TInput>, TResult> continuationFunction,
+ CancellationToken cancellationToken,
+ TaskScheduler scheduler)
+ {
+ return SafeContinueWith<TInput, TResult>(
+ task, continuationFunction, cancellationToken, TaskContinuationOptions.None, scheduler);
+ }
+
+ public static Task<TResult> SafeContinueWith<TInput, TResult>(
+ this Task<TInput> task,
+ Func<Task<TInput>, TResult> continuationFunction,
+ CancellationToken cancellationToken,
+ TaskContinuationOptions continuationOptions,
+ TaskScheduler scheduler)
+ {
+ return task.SafeContinueWith<TResult>(
+ (Task antecedent) => continuationFunction((Task<TInput>)antecedent), cancellationToken, continuationOptions, scheduler);
+ }
+
+ public static Task SafeContinueWith<TInput>(
+ this Task<TInput> task,
+ Action<Task<TInput>> continuationAction,
+ CancellationToken cancellationToken,
+ TaskContinuationOptions continuationOptions,
+ TaskScheduler scheduler)
+ {
+ return task.SafeContinueWith(
+ (Task antecedent) => continuationAction((Task<TInput>)antecedent), cancellationToken, continuationOptions, scheduler);
+ }
+
+ public static Task<TResult> SafeContinueWith<TResult>(
+ this Task task,
+ Func<Task, TResult> continuationFunction,
+ CancellationToken cancellationToken,
+ TaskContinuationOptions continuationOptions,
+ TaskScheduler scheduler)
+ {
+ // So here's the deal. Say you do the following:
+ #if false
+ // CancellationToken ct1 = ..., ct2 = ...;
+
+ // Task A = Task.Factory.StartNew(..., ct1);
+ // Task B = A.ContinueWith(..., ct1);
+ // Task C = B.ContinueWith(..., ct2);
+ #endif
+ // If ct1 is cancelled then the following may occur:
+ // 1) Task A can still be running (as it hasn't responded to the cancellation request
+ // yet).
+ // 2) Task C can start running. How? Well if B hasn't started running, it may
+ // immediately transition to the 'Cancelled/Completed' state. Moving to that state will
+ // immediately trigger C to run.
+ //
+ // We do not want this, so we pass the LazyCancellation flag to the TPL which implements
+ // the behavior we want.
+
+ Func<Task, TResult> outerFunction = t =>
+ {
+ try
+ {
+ return continuationFunction(t);
+ }
+ catch (Exception) //when (FatalError.ReportUnlessCanceled(e))
+ {
+ throw new InvalidOperationException ();
+ }
+ };
+
+ // This is the only place in the code where we're allowed to call ContinueWith.
+ return task.ContinueWith(outerFunction, cancellationToken, continuationOptions | TaskContinuationOptions.LazyCancellation, scheduler);
+ }
+
+ public static Task<TResult> SafeContinueWith<TResult>(
+ this Task task,
+ Func<Task, TResult> continuationFunction,
+ CancellationToken cancellationToken,
+ TaskScheduler scheduler)
+ {
+ return task.SafeContinueWith(continuationFunction, cancellationToken, TaskContinuationOptions.None, scheduler);
+ }
+
+ public static Task SafeContinueWith(
+ this Task task,
+ Action<Task> continuationAction,
+ TaskScheduler scheduler)
+ {
+ return task.SafeContinueWith(continuationAction, CancellationToken.None, TaskContinuationOptions.None, scheduler);
+ }
+
+ public static Task SafeContinueWith<TInput>(
+ this Task<TInput> task,
+ Action<Task<TInput>> continuationFunction,
+ TaskScheduler scheduler)
+ {
+ return task.SafeContinueWith(continuationFunction, CancellationToken.None, TaskContinuationOptions.None, scheduler);
+ }
+
+ public static Task<TResult> SafeContinueWith<TInput, TResult>(
+ this Task<TInput> task,
+ Func<Task<TInput>, TResult> continuationFunction,
+ TaskScheduler scheduler)
+ {
+ return task.SafeContinueWith(continuationFunction, CancellationToken.None, TaskContinuationOptions.None, scheduler);
+ }
+
+ public static Task SafeContinueWith(
+ this Task task,
+ Action<Task> continuationAction,
+ CancellationToken cancellationToken,
+ TaskScheduler scheduler)
+ {
+ return task.SafeContinueWith(continuationAction, cancellationToken, TaskContinuationOptions.None, scheduler);
+ }
+
+ // Code provided by Stephen Toub.
+ public static Task<TResult> ContinueWithAfterDelay<TInput, TResult>(
+ this Task<TInput> task,
+ Func<Task<TInput>, TResult> continuationFunction,
+ CancellationToken cancellationToken,
+ int millisecondsDelay,
+ TaskContinuationOptions taskContinuationOptions,
+ TaskScheduler scheduler)
+ {
+ return task.SafeContinueWith(t =>
+ Task.Delay(millisecondsDelay, cancellationToken).SafeContinueWith(
+ _ => continuationFunction(t), cancellationToken, TaskContinuationOptions.None, scheduler),
+ cancellationToken, taskContinuationOptions, scheduler).Unwrap();
+ }
+
+ public static Task<TNResult> ContinueWithAfterDelay<TNResult>(
+ this Task task,
+ Func<Task, TNResult> continuationFunction,
+ CancellationToken cancellationToken,
+ int millisecondsDelay,
+ TaskContinuationOptions taskContinuationOptions,
+ TaskScheduler scheduler)
+ {
+ return task.SafeContinueWith(t =>
+ Task.Delay(millisecondsDelay, cancellationToken).SafeContinueWith(
+ _ => continuationFunction(t), cancellationToken, TaskContinuationOptions.None, scheduler),
+ cancellationToken, taskContinuationOptions, scheduler).Unwrap();
+ }
+
+ public static Task ContinueWithAfterDelay(
+ this Task task,
+ Action continuationAction,
+ CancellationToken cancellationToken,
+ int millisecondsDelay,
+ TaskContinuationOptions taskContinuationOptions,
+ TaskScheduler scheduler)
+ {
+ return task.SafeContinueWith(t =>
+ Task.Delay(millisecondsDelay, cancellationToken).SafeContinueWith(
+ _ => continuationAction(), cancellationToken, TaskContinuationOptions.None, scheduler),
+ cancellationToken, taskContinuationOptions, scheduler).Unwrap();
+ }
+
+ public static Task<TResult> SafeContinueWithFromAsync<TInput, TResult>(
+ this Task<TInput> task,
+ Func<Task<TInput>, Task<TResult>> continuationFunction,
+ CancellationToken cancellationToken,
+ TaskContinuationOptions continuationOptions,
+ TaskScheduler scheduler)
+ {
+ return task.SafeContinueWithFromAsync<TResult>(
+ (Task antecedent) => continuationFunction((Task<TInput>)antecedent), cancellationToken, continuationOptions, scheduler);
+ }
+
+ public static Task<TResult> SafeContinueWithFromAsync<TResult>(
+ this Task task,
+ Func<Task, Task<TResult>> continuationFunction,
+ CancellationToken cancellationToken,
+ TaskContinuationOptions continuationOptions,
+ TaskScheduler scheduler)
+ {
+ // So here's the deal. Say you do the following:
+ #if false
+ // CancellationToken ct1 = ..., ct2 = ...;
+
+ // Task A = Task.Factory.StartNew(..., ct1);
+ // Task B = A.ContinueWith(..., ct1);
+ // Task C = B.ContinueWith(..., ct2);
+ #endif
+ // If ct1 is cancelled then the following may occur:
+ // 1) Task A can still be running (as it hasn't responded to the cancellation request
+ // yet).
+ // 2) Task C can start running. How? Well if B hasn't started running, it may
+ // immediately transition to the 'Cancelled/Completed' state. Moving to that state will
+ // immediately trigger C to run.
+ //
+ // We do not want this, so we pass the LazyCancellation flag to the TPL which implements
+ // the behavior we want.
+ // This is the only place in the code where we're allowed to call ContinueWith.
+ var nextTask = task.ContinueWith(continuationFunction, cancellationToken, continuationOptions | TaskContinuationOptions.LazyCancellation, scheduler).Unwrap();
+
+ nextTask.ContinueWith(ReportFatalError, continuationFunction,
+ CancellationToken.None,
+ TaskContinuationOptions.OnlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously,
+ TaskScheduler.Default);
+
+ return nextTask;
+ }
+
+ public static Task SafeContinueWithFromAsync(
+ this Task task,
+ Func<Task, Task> continuationFunction,
+ CancellationToken cancellationToken,
+ TaskScheduler scheduler)
+ {
+ return task.SafeContinueWithFromAsync(continuationFunction, cancellationToken, TaskContinuationOptions.None, scheduler);
+ }
+
+ public static Task SafeContinueWithFromAsync(
+ this Task task,
+ Func<Task, Task> continuationFunction,
+ CancellationToken cancellationToken,
+ TaskContinuationOptions continuationOptions,
+ TaskScheduler scheduler)
+ {
+ // So here's the deal. Say you do the following:
+ #if false
+ // CancellationToken ct1 = ..., ct2 = ...;
+
+ // Task A = Task.Factory.StartNew(..., ct1);
+ // Task B = A.ContinueWith(..., ct1);
+ // Task C = B.ContinueWith(..., ct2);
+ #endif
+ // If ct1 is cancelled then the following may occur:
+ // 1) Task A can still be running (as it hasn't responded to the cancellation request
+ // yet).
+ // 2) Task C can start running. How? Well if B hasn't started running, it may
+ // immediately transition to the 'Cancelled/Completed' state. Moving to that state will
+ // immediately trigger C to run.
+ //
+ // We do not want this, so we pass the LazyCancellation flag to the TPL which implements
+ // the behavior we want.
+ // This is the only place in the code where we're allowed to call ContinueWith.
+ var nextTask = task.ContinueWith(continuationFunction, cancellationToken, continuationOptions | TaskContinuationOptions.LazyCancellation, scheduler).Unwrap();
+ ReportFatalError(nextTask, continuationFunction);
+ return nextTask;
+ }
+
+ public static Task<TNResult> ContinueWithAfterDelayFromAsync<TNResult>(
+ this Task task,
+ Func<Task, Task<TNResult>> continuationFunction,
+ CancellationToken cancellationToken,
+ int millisecondsDelay,
+ TaskContinuationOptions taskContinuationOptions,
+ TaskScheduler scheduler)
+ {
+ return task.SafeContinueWith(t =>
+ Task.Delay(millisecondsDelay, cancellationToken).SafeContinueWithFromAsync(
+ _ => continuationFunction(t), cancellationToken, TaskContinuationOptions.None, scheduler),
+ cancellationToken, taskContinuationOptions, scheduler).Unwrap();
+ }
+
+ public static Task ContinueWithAfterDelayFromAsync(
+ this Task task,
+ Func<Task, Task> continuationFunction,
+ CancellationToken cancellationToken,
+ int millisecondsDelay,
+ TaskContinuationOptions taskContinuationOptions,
+ TaskScheduler scheduler)
+ {
+ return task.SafeContinueWith(t =>
+ Task.Delay(millisecondsDelay, cancellationToken).SafeContinueWithFromAsync(
+ _ => continuationFunction(t), cancellationToken, TaskContinuationOptions.None, scheduler),
+ cancellationToken, taskContinuationOptions, scheduler).Unwrap();
+ }
+
+ internal static void ReportFatalError(Task task, object continuationFunction)
+ {
+ task.ContinueWith(ReportFatalErrorWorker, continuationFunction,
+ CancellationToken.None,
+ TaskContinuationOptions.OnlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously,
+ TaskScheduler.Default);
+ }
+
+ [MethodImpl(MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)]
+ private static void ReportFatalErrorWorker(Task task, object continuationFunction)
+ {
+ var exception = task.Exception;
+ var methodInfo = ((Delegate)continuationFunction).GetMethodInfo();
+ exception.Data["ContinuationFunction"] = methodInfo.DeclaringType.FullName + "::" + methodInfo.Name;
+
+ // In case of a crash with ExecutionEngineException w/o call stack it might be possible to get the stack trace using WinDbg:
+ // > !threads // find thread with System.ExecutionEngineException
+ // ...
+ // 67 65 4760 692b5d60 1029220 Preemptive CD9AE70C:FFFFFFFF 012ad0f8 0 MTA (Threadpool Worker) System.ExecutionEngineException 03c51108
+ // ...
+ // > ~67s // switch to thread 67
+ // > !dso // dump stack objects
+ //FatalError.Report(exception);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/TextLineExtension.cs b/main/src/addins/CSharpBinding/Util/TextLineExtension.cs
new file mode 100644
index 0000000000..513df8fa98
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/TextLineExtension.cs
@@ -0,0 +1,63 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ internal static class TextLineExtensions
+ {
+ /// <summary>
+ /// Returns the first non-whitespace position on the given line, or null if
+ /// the line is empty or contains only whitespace.
+ /// </summary>
+ public static int? GetFirstNonWhitespacePosition(this TextLine line)
+ {
+ var firstNonWhitespaceOffset = line.GetFirstNonWhitespaceOffset();
+
+ return firstNonWhitespaceOffset.HasValue
+ ? firstNonWhitespaceOffset + line.Start
+ : null;
+ }
+
+ /// <summary>
+ /// Returns the first non-whitespace position on the given line as an offset
+ /// from the start of the line, or null if the line is empty or contains only
+ /// whitespace.
+ /// </summary>
+ public static int? GetFirstNonWhitespaceOffset(this TextLine line)
+ {
+ return line.ToString().GetFirstNonWhitespaceOffset();
+ }
+
+ public static string GetLeadingWhitespace(this TextLine line)
+ {
+ return line.ToString().GetLeadingWhitespace();
+ }
+
+ /// <summary>
+ /// Determines whether the specified line is empty or contains whitespace only.
+ /// </summary>
+ public static bool IsEmptyOrWhitespace(this TextLine line)
+ {
+ return string.IsNullOrWhiteSpace(line.ToString());
+ }
+
+ public static int GetColumnOfFirstNonWhitespaceCharacterOrEndOfLine(this TextLine line, int tabSize)
+ {
+ return line.ToString().GetColumnOfFirstNonWhitespaceCharacterOrEndOfLine(tabSize);
+ }
+
+ public static int GetColumnFromLineOffset(this TextLine line, int lineOffset, int tabSize)
+ {
+ return line.ToString().GetColumnFromLineOffset(lineOffset, tabSize);
+ }
+
+ public static int GetLineOffsetFromColumn(this TextLine line, int column, int tabSize)
+ {
+ return line.ToString().GetLineOffsetFromColumn(column, tabSize);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/TokenComparer.cs b/main/src/addins/CSharpBinding/Util/TokenComparer.cs
new file mode 100644
index 0000000000..2fe8d6f412
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/TokenComparer.cs
@@ -0,0 +1,83 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Globalization;
+using Microsoft.CodeAnalysis.CSharp.Extensions;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ internal class TokenComparer : IComparer<SyntaxToken>
+ {
+ private const string SystemNamespace = "System";
+
+ public static readonly IComparer<SyntaxToken> NormalInstance = new TokenComparer(specialCaseSystem: false);
+ public static readonly IComparer<SyntaxToken> SystemFirstInstance = new TokenComparer(specialCaseSystem: true);
+
+ private readonly bool _specialCaseSystem;
+
+ private TokenComparer(bool specialCaseSystem)
+ {
+ _specialCaseSystem = specialCaseSystem;
+ }
+
+ private static bool IsSystem(string s)
+ {
+ return s == SystemNamespace;
+ }
+
+ public int Compare(SyntaxToken x, SyntaxToken y)
+ {
+ if (_specialCaseSystem &&
+ x.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.UsingKeyword, SyntaxKind.StaticKeyword) &&
+ y.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.UsingKeyword, SyntaxKind.StaticKeyword))
+ {
+ var token1IsSystem = IsSystem(x.ValueText);
+ var token2IsSystem = IsSystem(y.ValueText);
+
+ if (token1IsSystem && !token2IsSystem)
+ {
+ return -1;
+ }
+ else if (!token1IsSystem && token2IsSystem)
+ {
+ return 1;
+ }
+ }
+
+ return CompareWorker(x, y);
+ }
+
+ private int CompareWorker(SyntaxToken x, SyntaxToken y)
+ {
+ if (x == y)
+ {
+ return 0;
+ }
+
+ // By using 'ValueText' we get the value that is normalized. i.e.
+ // @class will be 'class', and unicode escapes will be converted
+ // to actual unicode. This allows sorting to work properly across
+ // tokens that have different source representations, but which
+ // mean the same thing.
+ var string1 = x.ValueText;
+ var string2 = y.ValueText;
+
+ // First check in a case insensitive manner. This will put
+ // everything that starts with an 'a' or 'A' above everything
+ // that starts with a 'b' or 'B'.
+ var compare = CultureInfo.InvariantCulture.CompareInfo.Compare(string1, string2,
+ CompareOptions.IgnoreCase | CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreWidth);
+ if (compare != 0)
+ {
+ return compare;
+ }
+
+ // Now, once we've grouped such that 'a' words and 'A' words are
+ // together, sort such that 'a' words come before 'A' words.
+ return CultureInfo.InvariantCulture.CompareInfo.Compare(string1, string2,
+ CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreWidth);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/TypeDeclarationSyntaxExtensions.cs b/main/src/addins/CSharpBinding/Util/TypeDeclarationSyntaxExtensions.cs
new file mode 100644
index 0000000000..ee70daad0c
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/TypeDeclarationSyntaxExtensions.cs
@@ -0,0 +1,321 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis.Shared.Extensions;
+using Microsoft.CodeAnalysis.Text;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis.CSharp;
+using System;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class TypeDeclarationSyntaxExtensions
+ {
+ public static TypeDeclarationSyntax AddMembers(
+ this TypeDeclarationSyntax node, params MemberDeclarationSyntax[] members)
+ {
+ switch (node.Kind())
+ {
+ case SyntaxKind.ClassDeclaration:
+ return ((ClassDeclarationSyntax)node).AddMembers(members);
+ case SyntaxKind.InterfaceDeclaration:
+ return ((InterfaceDeclarationSyntax)node).AddMembers(members);
+ case SyntaxKind.StructDeclaration:
+ return ((StructDeclarationSyntax)node).AddMembers(members);
+ }
+
+ throw new InvalidOperationException ();
+ }
+
+ public static TypeDeclarationSyntax WithMembers(
+ this TypeDeclarationSyntax node, SyntaxList<MemberDeclarationSyntax> members)
+ {
+ switch (node.Kind())
+ {
+ case SyntaxKind.ClassDeclaration:
+ return ((ClassDeclarationSyntax)node).WithMembers(members);
+ case SyntaxKind.InterfaceDeclaration:
+ return ((InterfaceDeclarationSyntax)node).WithMembers(members);
+ case SyntaxKind.StructDeclaration:
+ return ((StructDeclarationSyntax)node).WithMembers(members);
+ }
+
+ throw new InvalidOperationException ();
+ }
+
+ public static TypeDeclarationSyntax WithAttributeLists(
+ this TypeDeclarationSyntax node, SyntaxList<AttributeListSyntax> attributes)
+ {
+ switch (node.Kind())
+ {
+ case SyntaxKind.ClassDeclaration:
+ return ((ClassDeclarationSyntax)node).WithAttributeLists(attributes);
+ case SyntaxKind.InterfaceDeclaration:
+ return ((InterfaceDeclarationSyntax)node).WithAttributeLists(attributes);
+ case SyntaxKind.StructDeclaration:
+ return ((StructDeclarationSyntax)node).WithAttributeLists(attributes);
+ }
+
+ throw new InvalidOperationException ();
+ }
+
+ public static TypeDeclarationSyntax WithIdentifier(
+ this TypeDeclarationSyntax node, SyntaxToken identifier)
+ {
+ switch (node.Kind())
+ {
+ case SyntaxKind.ClassDeclaration:
+ return ((ClassDeclarationSyntax)node).WithIdentifier(identifier);
+ case SyntaxKind.InterfaceDeclaration:
+ return ((InterfaceDeclarationSyntax)node).WithIdentifier(identifier);
+ case SyntaxKind.StructDeclaration:
+ return ((StructDeclarationSyntax)node).WithIdentifier(identifier);
+ }
+
+ throw new InvalidOperationException ();
+ }
+
+ public static TypeDeclarationSyntax WithModifiers(
+ this TypeDeclarationSyntax node, SyntaxTokenList modifiers)
+ {
+ switch (node.Kind())
+ {
+ case SyntaxKind.ClassDeclaration:
+ return ((ClassDeclarationSyntax)node).WithModifiers(modifiers);
+ case SyntaxKind.InterfaceDeclaration:
+ return ((InterfaceDeclarationSyntax)node).WithModifiers(modifiers);
+ case SyntaxKind.StructDeclaration:
+ return ((StructDeclarationSyntax)node).WithModifiers(modifiers);
+ }
+
+ throw new InvalidOperationException ();
+ }
+
+ public static TypeDeclarationSyntax WithTypeParameterList(
+ this TypeDeclarationSyntax node, TypeParameterListSyntax list)
+ {
+ switch (node.Kind())
+ {
+ case SyntaxKind.ClassDeclaration:
+ return ((ClassDeclarationSyntax)node).WithTypeParameterList(list);
+ case SyntaxKind.InterfaceDeclaration:
+ return ((InterfaceDeclarationSyntax)node).WithTypeParameterList(list);
+ case SyntaxKind.StructDeclaration:
+ return ((StructDeclarationSyntax)node).WithTypeParameterList(list);
+ }
+
+ throw new InvalidOperationException ();
+ }
+
+ public static TypeDeclarationSyntax WithBaseList(
+ this TypeDeclarationSyntax node, BaseListSyntax list)
+ {
+ switch (node.Kind())
+ {
+ case SyntaxKind.ClassDeclaration:
+ return ((ClassDeclarationSyntax)node).WithBaseList(list);
+ case SyntaxKind.InterfaceDeclaration:
+ return ((InterfaceDeclarationSyntax)node).WithBaseList(list);
+ case SyntaxKind.StructDeclaration:
+ return ((StructDeclarationSyntax)node).WithBaseList(list);
+ }
+
+ throw new InvalidOperationException ();
+ }
+
+ public static TypeDeclarationSyntax WithConstraintClauses(
+ this TypeDeclarationSyntax node, SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses)
+ {
+ switch (node.Kind())
+ {
+ case SyntaxKind.ClassDeclaration:
+ return ((ClassDeclarationSyntax)node).WithConstraintClauses(constraintClauses);
+ case SyntaxKind.InterfaceDeclaration:
+ return ((InterfaceDeclarationSyntax)node).WithConstraintClauses(constraintClauses);
+ case SyntaxKind.StructDeclaration:
+ return ((StructDeclarationSyntax)node).WithConstraintClauses(constraintClauses);
+ }
+
+ throw new InvalidOperationException ();
+ }
+
+ public static TypeDeclarationSyntax WithOpenBraceToken(
+ this TypeDeclarationSyntax node, SyntaxToken openBrace)
+ {
+ switch (node.Kind())
+ {
+ case SyntaxKind.ClassDeclaration:
+ return ((ClassDeclarationSyntax)node).WithOpenBraceToken(openBrace);
+ case SyntaxKind.InterfaceDeclaration:
+ return ((InterfaceDeclarationSyntax)node).WithOpenBraceToken(openBrace);
+ case SyntaxKind.StructDeclaration:
+ return ((StructDeclarationSyntax)node).WithOpenBraceToken(openBrace);
+ }
+
+ throw new InvalidOperationException ();
+ }
+
+ public static TypeDeclarationSyntax WithCloseBraceToken(
+ this TypeDeclarationSyntax node, SyntaxToken closeBrace)
+ {
+ switch (node.Kind())
+ {
+ case SyntaxKind.ClassDeclaration:
+ return ((ClassDeclarationSyntax)node).WithCloseBraceToken(closeBrace);
+ case SyntaxKind.InterfaceDeclaration:
+ return ((InterfaceDeclarationSyntax)node).WithCloseBraceToken(closeBrace);
+ case SyntaxKind.StructDeclaration:
+ return ((StructDeclarationSyntax)node).WithCloseBraceToken(closeBrace);
+ }
+
+ throw new InvalidOperationException ();
+ }
+
+ public static IList<bool> GetInsertionIndices(this TypeDeclarationSyntax destination, CancellationToken cancellationToken)
+ {
+ var members = destination.Members;
+
+ var indices = new List<bool>();
+ if (members.Count == 0)
+ {
+ var start = destination.OpenBraceToken.Span.End;
+ var end = GetEndToken(destination).SpanStart;
+
+ indices.Add(!destination.OverlapsHiddenPosition(TextSpan.FromBounds(start, end), cancellationToken));
+ }
+ else
+ {
+ var start = destination.OpenBraceToken.Span.End;
+ var end = destination.Members.First().SpanStart;
+ indices.Add(!destination.OverlapsHiddenPosition(TextSpan.FromBounds(start, end), cancellationToken));
+
+ for (int i = 0; i < members.Count - 1; i++)
+ {
+ var member1 = members[i];
+ var member2 = members[i + 1];
+
+ indices.Add(!destination.OverlapsHiddenPosition(member1, member2, cancellationToken));
+ }
+
+ start = members.Last().Span.End;
+ end = GetEndToken(destination).SpanStart;
+ indices.Add(!destination.OverlapsHiddenPosition(TextSpan.FromBounds(start, end), cancellationToken));
+ }
+
+ return indices;
+ }
+
+ private static SyntaxToken GetEndToken(SyntaxNode node)
+ {
+ var lastToken = node.GetLastToken(includeZeroWidth: true, includeSkipped: true);
+
+ if (lastToken.IsMissing)
+ {
+ var nextToken = lastToken.GetNextToken(includeZeroWidth: true, includeSkipped: true);
+ if (nextToken.RawKind != 0)
+ {
+ return nextToken;
+ }
+ }
+
+ return lastToken;
+ }
+
+ public static IEnumerable<BaseTypeSyntax> GetAllBaseListTypes(this TypeDeclarationSyntax typeNode, SemanticModel model, CancellationToken cancellationToken)
+ {
+
+ IEnumerable<BaseTypeSyntax> baseListTypes = SpecializedCollections.EmptyEnumerable<BaseTypeSyntax>();
+
+ var isPartialType = typeNode.Modifiers.Any(m => m.Kind() == SyntaxKind.PartialKeyword);
+ if (isPartialType)
+ {
+ var typeSymbol = model.GetDeclaredSymbol(typeNode, cancellationToken);
+ if (typeSymbol != null)
+ {
+ foreach (var syntaxRef in typeSymbol.DeclaringSyntaxReferences)
+ {
+ var typeDecl = syntaxRef.GetSyntax(cancellationToken) as TypeDeclarationSyntax;
+ if (typeDecl != null && typeDecl.BaseList != null)
+ {
+ baseListTypes = baseListTypes.Concat(typeDecl.BaseList.Types);
+ }
+ }
+ }
+ }
+ else if (typeNode.BaseList != null)
+ {
+ return typeNode.BaseList.Types;
+ }
+
+ return baseListTypes;
+ }
+
+ private static SyntaxToken EnsureToken(SyntaxToken token, bool prependNewLineIfMissing = false, bool appendNewLineIfMissing = false)
+ {
+ if (token.IsMissing)
+ {
+ var leadingTrivia = prependNewLineIfMissing ? token.LeadingTrivia.Insert(0, SyntaxFactory.CarriageReturnLineFeed) : token.LeadingTrivia;
+ var trailingTrivia = appendNewLineIfMissing ? token.TrailingTrivia.Insert(0, SyntaxFactory.CarriageReturnLineFeed) : token.TrailingTrivia;
+ return SyntaxFactory.Token(leadingTrivia, token.Kind(), trailingTrivia).WithAdditionalAnnotations(Formatter.Annotation);
+ }
+
+ return token;
+ }
+
+ private static void EnsureAndGetBraceTokens(
+ BaseTypeDeclarationSyntax typeDeclaration,
+ bool hasMembers,
+ out SyntaxToken openBrace,
+ out SyntaxToken closeBrace)
+ {
+ openBrace = EnsureToken(typeDeclaration.OpenBraceToken);
+ closeBrace = EnsureToken(typeDeclaration.CloseBraceToken, appendNewLineIfMissing: true);
+
+ if (!hasMembers)
+ {
+ // Bug 539673: If there are no members, take any trivia that
+ // belongs to the end brace and attach it to the opening brace.
+ int index = -1;
+ var leadingTrivia = closeBrace.LeadingTrivia;
+ for (int i = leadingTrivia.Count - 1; i >= 0; i--)
+ {
+ if (!leadingTrivia[i].IsWhitespaceOrEndOfLine())
+ {
+ index = i;
+ break;
+ }
+ }
+
+ if (index != -1)
+ {
+ openBrace = openBrace.WithTrailingTrivia(
+ openBrace.TrailingTrivia.Concat(closeBrace.LeadingTrivia.Take(index + 1)));
+ closeBrace = closeBrace.WithLeadingTrivia(
+ closeBrace.LeadingTrivia.Skip(index + 1));
+ }
+ }
+ }
+
+ public static TypeDeclarationSyntax EnsureOpenAndCloseBraceTokens(
+ this TypeDeclarationSyntax typeDeclaration)
+ {
+ SyntaxToken openBrace, closeBrace;
+ EnsureAndGetBraceTokens(typeDeclaration, typeDeclaration.Members.Count > 0, out openBrace, out closeBrace);
+ return typeDeclaration.WithOpenBraceToken(openBrace).WithCloseBraceToken(closeBrace);
+ }
+
+ public static EnumDeclarationSyntax EnsureOpenAndCloseBraceTokens(
+ this EnumDeclarationSyntax typeDeclaration)
+ {
+ SyntaxToken openBrace, closeBrace;
+ EnsureAndGetBraceTokens(typeDeclaration, typeDeclaration.Members.Count > 0, out openBrace, out closeBrace);
+ return typeDeclaration.WithOpenBraceToken(openBrace).WithCloseBraceToken(closeBrace);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/TypeExtensions.cs b/main/src/addins/CSharpBinding/Util/TypeExtensions.cs
new file mode 100644
index 0000000000..05f23948a3
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/TypeExtensions.cs
@@ -0,0 +1,154 @@
+//
+// TypeExtensions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Simplification;
+using System.Threading.Tasks;
+using System.Collections.Immutable;
+using System.Threading;
+using System.Text;
+using System.Reflection;
+using System.Runtime.ExceptionServices;
+using MonoDevelop.Ide.TypeSystem;
+using System.Runtime.CompilerServices;
+using System.Collections.Concurrent;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class TypeExtensions
+ {
+ readonly static MethodInfo generateTypeSyntaxMethod;
+ readonly static MethodInfo findImplementingTypesAsync;
+
+ static TypeExtensions()
+ {
+ var typeInfo = Type.GetType("Microsoft.CodeAnalysis.CSharp.Extensions.ITypeSymbolExtensions" + ReflectionNamespaces.CSWorkspacesAsmName, true);
+ generateTypeSyntaxMethod = typeInfo.GetMethod("GenerateTypeSyntax", new[] { typeof(ITypeSymbol) });
+
+ typeInfo = Type.GetType("Microsoft.CodeAnalysis.FindSymbols.DependentTypeFinder" + ReflectionNamespaces.WorkspacesAsmName, true);
+ findImplementingTypesAsync = typeInfo.GetMethod("FindImplementingTypesAsync", new[] { typeof(INamedTypeSymbol), typeof(Solution), typeof(IImmutableSet<Project>), typeof(CancellationToken) });
+ if (findImplementingTypesAsync == null)
+ throw new Exception ("Can't find FindImplementingTypesAsync");
+ }
+
+ public static TypeSyntax GenerateTypeSyntax(this ITypeSymbol typeSymbol, SyntaxAnnotation simplifierAnnotation = null)
+ {
+ var typeSyntax = (TypeSyntax)generateTypeSyntaxMethod.Invoke(null, new object[] { typeSymbol });
+ if (simplifierAnnotation != null)
+ return typeSyntax.WithAdditionalAnnotations(simplifierAnnotation);
+ return typeSyntax;
+ }
+
+ #region GetDelegateInvokeMethod
+ /// <summary>
+ /// Gets the invoke method for a delegate type.
+ /// </summary>
+ /// <remarks>
+ /// Returns null if the type is not a delegate type; or if the invoke method could not be found.
+ /// </remarks>
+ public static IMethodSymbol GetDelegateInvokeMethod(this ITypeSymbol type)
+ {
+ if (type == null)
+ throw new ArgumentNullException("type");
+ if (type.TypeKind == TypeKind.Delegate)
+ return type.GetMembers ("Invoke").OfType<IMethodSymbol>().FirstOrDefault(m => m.MethodKind == MethodKind.DelegateInvoke);
+ return null;
+ }
+ #endregion
+
+ public static Task<IEnumerable<INamedTypeSymbol>> FindImplementingTypesAsync (this INamedTypeSymbol type, Solution solution, IImmutableSet<Project> projects = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ try {
+ return (Task<IEnumerable<INamedTypeSymbol>>)findImplementingTypesAsync.Invoke(null, new object[] { type, solution, projects, cancellationToken });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ public static bool IsNullableType(this ITypeSymbol type)
+ {
+ var original = type.OriginalDefinition;
+ return original.SpecialType == SpecialType.System_Nullable_T;
+ }
+
+ public static ITypeSymbol GetNullableUnderlyingType(this ITypeSymbol type)
+ {
+ if (!IsNullableType(type))
+ return null;
+ return ((INamedTypeSymbol)type).TypeArguments[0];
+ }
+
+ /// <summary>
+ /// Gets all base classes and interfaces.
+ /// </summary>
+ /// <returns>All classes and interfaces.</returns>
+ /// <param name="type">Type.</param>
+ public static IEnumerable<INamedTypeSymbol> GetAllBaseClassesAndInterfaces (this INamedTypeSymbol type, bool includeSuperType = false)
+ {
+ if (!includeSuperType)
+ type = type.BaseType;
+ var curType = type;
+ while (curType != null) {
+ yield return curType;
+ curType = curType.BaseType;
+ }
+
+ foreach (var inter in type.AllInterfaces) {
+ yield return inter;
+ }
+ }
+
+ /// <summary>
+ /// Determines if derived from baseType. Includes itself, all base classes and all interfaces.
+ /// </summary>
+ /// <returns><c>true</c> if is derived from the specified type baseType; otherwise, <c>false</c>.</returns>
+ /// <param name="type">Type.</param>
+ /// <param name="baseType">Base type.</param>
+ public static bool IsDerivedFromClassOrInterface(this INamedTypeSymbol type, INamedTypeSymbol baseType)
+ {
+ //NR5 is returning true also for same type
+ for (; type != null; type = type.BaseType) {
+ if (type == baseType) {
+ return true;
+ }
+ }
+ //And interfaces
+ foreach (var inter in type.AllInterfaces) {
+ if (inter == baseType) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/TypeGenerator.cs b/main/src/addins/CSharpBinding/Util/TypeGenerator.cs
new file mode 100644
index 0000000000..6df4a4dd66
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/TypeGenerator.cs
@@ -0,0 +1,104 @@
+//
+// TypeGenerator.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Linq;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeGeneration;
+using Microsoft.CodeAnalysis.LanguageServices;
+using Microsoft.CodeAnalysis.Shared.Utilities;
+using Roslyn.Utilities;
+using System.Reflection;
+using System.Runtime.ExceptionServices;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ class TypeGenerator
+ {
+ readonly static Type typeInfo;
+
+ object instance;
+
+ readonly static MethodInfo createArrayTypeSymbolMethod;
+ readonly static MethodInfo createPointerTypeSymbolMethod;
+ readonly static MethodInfo constructMethod;
+
+ internal object Instance {
+ get {
+ return instance;
+ }
+ }
+
+ static TypeGenerator()
+ {
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.CodeGeneration.TypeGenerator" + ReflectionNamespaces.WorkspacesAsmName, true);
+
+ createArrayTypeSymbolMethod = typeInfo.GetMethod ("CreateArrayTypeSymbol");
+ createPointerTypeSymbolMethod = typeInfo.GetMethod ("CreatePointerTypeSymbol");
+ constructMethod = typeInfo.GetMethod ("Construct");
+
+ }
+
+ public TypeGenerator ()
+ {
+ instance = Activator.CreateInstance (typeInfo);
+ }
+
+ public ITypeSymbol CreateArrayTypeSymbol(ITypeSymbol elementType, int rank)
+ {
+ try {
+ return (ITypeSymbol)createArrayTypeSymbolMethod.Invoke(instance, new object[] { elementType, rank });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ public ITypeSymbol CreatePointerTypeSymbol(ITypeSymbol pointedAtType)
+ {
+ try {
+ return (ITypeSymbol)createPointerTypeSymbolMethod.Invoke(instance, new object[] { pointedAtType });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+
+ public ITypeSymbol Construct(INamedTypeSymbol namedType, ITypeSymbol[] typeArguments)
+ {
+ try {
+ return (ITypeSymbol)constructMethod.Invoke(instance, new object[] { namedType, typeArguments });
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ return null;
+ }
+ }
+ }
+
+}
diff --git a/main/src/addins/CSharpBinding/Util/TypeSyntaxComparer.cs b/main/src/addins/CSharpBinding/Util/TypeSyntaxComparer.cs
new file mode 100644
index 0000000000..ec46567e7f
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/TypeSyntaxComparer.cs
@@ -0,0 +1,64 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Symbols;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ internal class TypeSyntaxComparer : IComparer<TypeSyntax>
+ {
+ private readonly IComparer<SyntaxToken> _tokenComparer;
+ internal IComparer<NameSyntax> NameComparer;
+
+ internal TypeSyntaxComparer(IComparer<SyntaxToken> tokenComparer)
+ {
+ _tokenComparer = tokenComparer;
+ }
+
+ public int Compare(TypeSyntax x, TypeSyntax y)
+ {
+ if (x == y)
+ {
+ return 0;
+ }
+
+ x = UnwrapType(x);
+ y = UnwrapType(y);
+
+ if (x is NameSyntax && y is NameSyntax)
+ {
+ return NameComparer.Compare((NameSyntax)x, (NameSyntax)y);
+ }
+
+ // we have two predefined types, or a predefined type and a normal C# name. We only need
+ // to compare the first tokens here.
+ return _tokenComparer.Compare(x.GetFirstToken(includeSkipped: true), y.GetFirstToken());
+ }
+
+ private TypeSyntax UnwrapType(TypeSyntax type)
+ {
+ while (true)
+ {
+ switch (type.Kind())
+ {
+ case SyntaxKind.ArrayType:
+ type = ((ArrayTypeSyntax)type).ElementType;
+ break;
+ case SyntaxKind.PointerType:
+ type = ((PointerTypeSyntax)type).ElementType;
+ break;
+ case SyntaxKind.NullableType:
+ type = ((NullableTypeSyntax)type).ElementType;
+ break;
+ default:
+ return type;
+ }
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/TypeSyntaxExtensions.cs b/main/src/addins/CSharpBinding/Util/TypeSyntaxExtensions.cs
new file mode 100644
index 0000000000..4f47c1d8d2
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/TypeSyntaxExtensions.cs
@@ -0,0 +1,114 @@
+//
+// TypeSyntaxExtensions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+using System.Threading;
+using System.Linq;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class TypeSyntaxExtensions
+ {
+ public static bool IsPartial(this TypeSyntax typeSyntax)
+ {
+ return typeSyntax is IdentifierNameSyntax &&
+ ((IdentifierNameSyntax)typeSyntax).Identifier.IsKind(SyntaxKind.PartialKeyword);
+ }
+
+ public static bool IsPotentialTypeName(this TypeSyntax typeSyntax, SemanticModel semanticModelOpt, CancellationToken cancellationToken)
+ {
+ if (typeSyntax == null)
+ {
+ return false;
+ }
+
+ if (typeSyntax is PredefinedTypeSyntax ||
+ typeSyntax is ArrayTypeSyntax ||
+ typeSyntax is GenericNameSyntax ||
+ typeSyntax is PointerTypeSyntax ||
+ typeSyntax is NullableTypeSyntax)
+ {
+ return true;
+ }
+
+ if (semanticModelOpt == null)
+ {
+ return false;
+ }
+
+ var nameSyntax = typeSyntax as NameSyntax;
+ if (nameSyntax == null)
+ {
+ return false;
+ }
+
+ var nameToken = nameSyntax.GetNameToken();
+
+ var symbols = semanticModelOpt.LookupName(nameToken, namespacesAndTypesOnly: true, cancellationToken: cancellationToken);
+ var firstSymbol = symbols.FirstOrDefault();
+
+ var typeSymbol = firstSymbol != null && firstSymbol.Kind == SymbolKind.Alias
+ ? (firstSymbol as IAliasSymbol).Target
+ : firstSymbol as ITypeSymbol;
+
+ return typeSymbol != null
+ && !typeSymbol.IsErrorType();
+ }
+
+ /// <summary>
+ /// Determines whether the specified TypeSyntax is actually 'var'.
+ /// </summary>
+ public static bool IsTypeInferred(this TypeSyntax typeSyntax, SemanticModel semanticModel)
+ {
+ if (!typeSyntax.IsVar)
+ {
+ return false;
+ }
+
+ if (semanticModel.GetAliasInfo(typeSyntax) != null)
+ {
+ return false;
+ }
+
+ var type = semanticModel.GetTypeInfo(typeSyntax).Type;
+ if (type == null)
+ {
+ return false;
+ }
+
+ if (type.Name == "var")
+ {
+ return false;
+ }
+
+ return true;
+ }
+ }
+
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/UsingsAndExternAliasesDirectiveComparer.cs b/main/src/addins/CSharpBinding/Util/UsingsAndExternAliasesDirectiveComparer.cs
new file mode 100644
index 0000000000..f7f3c623a8
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/UsingsAndExternAliasesDirectiveComparer.cs
@@ -0,0 +1,121 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Roslyn.Utilities;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ class UsingsAndExternAliasesDirectiveComparer : IComparer<SyntaxNode>
+ {
+ public static readonly IComparer<SyntaxNode> NormalInstance = new UsingsAndExternAliasesDirectiveComparer(
+ NameSyntaxComparer.Create(TokenComparer.NormalInstance),
+ TokenComparer.NormalInstance);
+
+ public static readonly IComparer<SyntaxNode> SystemFirstInstance = new UsingsAndExternAliasesDirectiveComparer(
+ NameSyntaxComparer.Create(TokenComparer.SystemFirstInstance),
+ TokenComparer.SystemFirstInstance);
+
+ private readonly IComparer<NameSyntax> _nameComparer;
+ private readonly IComparer<SyntaxToken> _tokenComparer;
+
+ private UsingsAndExternAliasesDirectiveComparer(
+ IComparer<NameSyntax> nameComparer,
+ IComparer<SyntaxToken> tokenComparer)
+ {
+ _nameComparer = nameComparer;
+ _tokenComparer = tokenComparer;
+ }
+
+ public int Compare(SyntaxNode directive1, SyntaxNode directive2)
+ {
+ if (directive1 == directive2)
+ {
+ return 0;
+ }
+
+ var using1 = directive1 as UsingDirectiveSyntax;
+ var using2 = directive2 as UsingDirectiveSyntax;
+ var extern1 = directive1 as ExternAliasDirectiveSyntax;
+ var extern2 = directive2 as ExternAliasDirectiveSyntax;
+
+ var directive1IsExtern = extern1 != null;
+ var directive2IsExtern = extern2 != null;
+
+ var directive1IsNamespace = using1 != null && using1.Alias == null && !using1.StaticKeyword.IsKind(SyntaxKind.StaticKeyword);
+ var directive2IsNamespace = using2 != null && using2.Alias == null && !using2.StaticKeyword.IsKind(SyntaxKind.StaticKeyword);
+
+ var directive1IsUsingStatic = using1 != null && using1.StaticKeyword.IsKind(SyntaxKind.StaticKeyword);
+ var directive2IsUsingStatic = using2 != null && using2.StaticKeyword.IsKind(SyntaxKind.StaticKeyword);
+
+ var directive1IsAlias = using1 != null && using1.Alias != null;
+ var directive2IsAlias = using2 != null && using2.Alias != null;
+
+ // different types of usings get broken up into groups.
+ // * externs
+ // * usings
+ // * using statics
+ // * aliases
+
+ if (directive1IsExtern && !directive2IsExtern)
+ {
+ return -1;
+ }
+ else if (directive2IsExtern && !directive1IsExtern)
+ {
+ return 1;
+ }
+ else if (directive1IsNamespace && !directive2IsNamespace)
+ {
+ return -1;
+ }
+ else if (directive2IsNamespace && !directive1IsNamespace)
+ {
+ return 1;
+ }
+ else if (directive1IsUsingStatic && !directive2IsUsingStatic)
+ {
+ return -1;
+ }
+ else if (directive2IsUsingStatic && !directive1IsUsingStatic)
+ {
+ return 1;
+ }
+ else if (directive1IsAlias && !directive2IsAlias)
+ {
+ return -1;
+ }
+ else if (directive2IsAlias && !directive1IsAlias)
+ {
+ return 1;
+ }
+
+ // ok, it's the same type of using now.
+ if (directive1IsExtern)
+ {
+ // they're externs, sort by the alias
+ return _tokenComparer.Compare(extern1.Identifier, extern2.Identifier);
+ }
+ else if (directive1IsAlias)
+ {
+ var aliasComparisonResult = _tokenComparer.Compare(using1.Alias.Name.Identifier, using2.Alias.Name.Identifier);
+
+ if (aliasComparisonResult == 0)
+ {
+ // They both use the same alias, so compare the names.
+ return _nameComparer.Compare(using1.Name, using2.Name);
+ }
+ else
+ {
+ return aliasComparisonResult;
+ }
+ }
+ else
+ {
+ return _nameComparer.Compare(using1.Name, using2.Name);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/UsingsAndExternAliasesOrganizer.cs b/main/src/addins/CSharpBinding/Util/UsingsAndExternAliasesOrganizer.cs
new file mode 100644
index 0000000000..a4896cad84
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/UsingsAndExternAliasesOrganizer.cs
@@ -0,0 +1,63 @@
+//
+// UsingsAndExternAliasesOrganizer.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.Runtime.ExceptionServices;
+using System.Reflection;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class UsingsAndExternAliasesOrganizer
+ {
+ static UsingsAndExternAliasesOrganizer ()
+ {
+ var typeInfo = Type.GetType ("Microsoft.CodeAnalysis.CSharp.Utilities.UsingsAndExternAliasesOrganizer" + ReflectionNamespaces.CSWorkspacesAsmName, true);
+
+ organizeMethod = typeInfo.GetMethod ("Organize");
+ }
+
+ readonly static System.Reflection.MethodInfo organizeMethod;
+
+ public static void Organize(
+ SyntaxList<ExternAliasDirectiveSyntax> externAliasList,
+ SyntaxList<UsingDirectiveSyntax> usingList,
+ bool placeSystemNamespaceFirst,
+ out SyntaxList<ExternAliasDirectiveSyntax> organizedExternAliasList,
+ out SyntaxList<UsingDirectiveSyntax> organizedUsingList)
+ {
+ try {
+ var args = new object[] { externAliasList, usingList, placeSystemNamespaceFirst, default(SyntaxList<ExternAliasDirectiveSyntax>), default(SyntaxList<UsingDirectiveSyntax>)};
+ organizeMethod.Invoke (null, args);
+ organizedExternAliasList = (SyntaxList<ExternAliasDirectiveSyntax>)args [3];
+ organizedUsingList = (SyntaxList<UsingDirectiveSyntax>)args [4];
+ } catch (TargetInvocationException ex) {
+ ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/Util/ValueTuple.cs b/main/src/addins/CSharpBinding/Util/ValueTuple.cs
new file mode 100644
index 0000000000..aedf5bca99
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/ValueTuple.cs
@@ -0,0 +1,18 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ // tuple factory
+ static class ValueTuple
+ {
+ public static ValueTuple<T1, T2> Create<T1, T2>(T1 item1, T2 item2)
+ {
+ return new ValueTuple<T1, T2>(item1, item2);
+ }
+
+// public static ValueTuple<T1, T2, T3> Create<T1, T2, T3>(T1 item1, T2 item2, T3 item3)
+// {
+// return new ValueTuple<T1, T2, T3>(item1, item2, item3);
+// }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/ValueTuple`2.cs b/main/src/addins/CSharpBinding/Util/ValueTuple`2.cs
new file mode 100644
index 0000000000..96fcb2eb4b
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/ValueTuple`2.cs
@@ -0,0 +1,57 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Reflection;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ // struct with two values
+ struct ValueTuple<T1, T2> : IEquatable<ValueTuple<T1, T2>>
+ {
+ private static readonly EqualityComparer<T1> s_comparer1 = EqualityComparer<T1>.Default;
+ private static readonly EqualityComparer<T2> s_comparer2 = EqualityComparer<T2>.Default;
+
+ public readonly T1 Item1;
+ public readonly T2 Item2;
+
+ public ValueTuple(T1 item1, T2 item2)
+ {
+ this.Item1 = item1;
+ this.Item2 = item2;
+ }
+
+ public bool Equals(ValueTuple<T1, T2> other)
+ {
+ return s_comparer1.Equals(this.Item1, other.Item1)
+ && s_comparer2.Equals(this.Item2, other.Item2);
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (obj is ValueTuple<T1, T2>)
+ {
+ var other = (ValueTuple<T1, T2>)obj;
+ return this.Equals(other);
+ }
+
+ return false;
+ }
+
+ public override int GetHashCode()
+ {
+ return Hash.Combine(s_comparer1.GetHashCode(Item1), s_comparer2.GetHashCode(Item2));
+ }
+
+ public static bool operator ==(ValueTuple<T1, T2> left, ValueTuple<T1, T2> right)
+ {
+ return left.Equals(right);
+ }
+
+ public static bool operator !=(ValueTuple<T1, T2> left, ValueTuple<T1, T2> right)
+ {
+ return !left.Equals(right);
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/Util/WordParser.cs b/main/src/addins/CSharpBinding/Util/WordParser.cs
new file mode 100644
index 0000000000..34f70d3caa
--- /dev/null
+++ b/main/src/addins/CSharpBinding/Util/WordParser.cs
@@ -0,0 +1,71 @@
+//
+// WordParser.cs
+//
+// Author:
+// Michael Hutchinson <mhutch@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+
+namespace ICSharpCode.NRefactory6.CSharp
+{
+ static class WordParser
+ {
+ public static List<string> BreakWords (string identifier)
+ {
+ var words = new List<string> ();
+ int wordStart = 0;
+ bool lastWasLower = false, lastWasUpper = false;
+ for (int i = 0; i < identifier.Length; i++) {
+ char c = identifier[i];
+ var category = CharUnicodeInfo.GetUnicodeCategory (c);
+ if (category == System.Globalization.UnicodeCategory.LowercaseLetter) {
+ if (lastWasUpper && (i - wordStart) > 2) {
+ words.Add (identifier.Substring (wordStart, i - wordStart - 1));
+ wordStart = i - 1;
+ }
+ lastWasLower = true;
+ lastWasUpper = false;
+ } else if (category == System.Globalization.UnicodeCategory.UppercaseLetter) {
+ if (lastWasLower) {
+ words.Add (identifier.Substring (wordStart, i - wordStart));
+ wordStart = i;
+ }
+ lastWasLower = false;
+ lastWasUpper = true;
+ } else {
+ if (c == '_') {
+ if ((i - wordStart) > 0)
+ words.Add(identifier.Substring(wordStart, i - wordStart));
+ wordStart = i + 1;
+ lastWasLower = lastWasUpper = false;
+ }
+ }
+ }
+ if (wordStart < identifier.Length)
+ words.Add (identifier.Substring (wordStart));
+ return words;
+ }
+ }
+}
+
diff --git a/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.cs b/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.cs
new file mode 100644
index 0000000000..1dda3f6bac
--- /dev/null
+++ b/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.cs
@@ -0,0 +1,94 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace MonoDevelop.CSharp.ClassOutline
+{
+ internal partial class OutlineSortingPreferencesDialog
+ {
+ private global::Gtk.VBox vbox2;
+
+ private global::Gtk.Label label;
+
+ private global::MonoDevelop.Ide.Gui.Components.PriorityList priorityList;
+
+ private global::Gtk.Button buttonCancel;
+
+ private global::Gtk.Button buttonOk;
+
+ protected virtual void Build ()
+ {
+ global::Stetic.Gui.Initialize (this);
+ // Widget MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog
+ this.Name = "MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog";
+ this.Title = global::Mono.Unix.Catalog.GetString ("Document Outline Preferences");
+ this.WindowPosition = ((global::Gtk.WindowPosition)(4));
+ this.Modal = true;
+ this.DestroyWithParent = true;
+ // Internal child MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.VBox
+ global::Gtk.VBox w1 = this.VBox;
+ w1.Name = "dialog1_VBox";
+ w1.BorderWidth = ((uint)(2));
+ // Container child dialog1_VBox.Gtk.Box+BoxChild
+ this.vbox2 = new global::Gtk.VBox ();
+ this.vbox2.Name = "vbox2";
+ this.vbox2.Spacing = 6;
+ this.vbox2.BorderWidth = ((uint)(6));
+ // Container child vbox2.Gtk.Box+BoxChild
+ this.label = new global::Gtk.Label ();
+ this.label.WidthRequest = 400;
+ this.label.Name = "label";
+ this.label.LabelProp = global::Mono.Unix.Catalog.GetString ("Group sorting order when grouping is enabled:");
+ this.label.Wrap = true;
+ this.vbox2.Add (this.label);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.label]));
+ w2.Position = 0;
+ w2.Expand = false;
+ w2.Fill = false;
+ // Container child vbox2.Gtk.Box+BoxChild
+ this.priorityList = new global::MonoDevelop.Ide.Gui.Components.PriorityList ();
+ this.priorityList.Name = "priorityList";
+ this.vbox2.Add (this.priorityList);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.priorityList]));
+ w3.Position = 1;
+ w1.Add (this.vbox2);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2]));
+ w4.Position = 0;
+ // Internal child MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog.ActionArea
+ global::Gtk.HButtonBox w5 = this.ActionArea;
+ w5.Name = "dialog1_ActionArea";
+ w5.Spacing = 10;
+ w5.BorderWidth = ((uint)(5));
+ w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
+ // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
+ this.buttonCancel = new global::Gtk.Button ();
+ this.buttonCancel.CanDefault = true;
+ this.buttonCancel.CanFocus = true;
+ this.buttonCancel.Name = "buttonCancel";
+ this.buttonCancel.UseStock = true;
+ this.buttonCancel.UseUnderline = true;
+ this.buttonCancel.Label = "gtk-cancel";
+ this.AddActionWidget (this.buttonCancel, -6);
+ global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonCancel]));
+ w6.Expand = false;
+ w6.Fill = false;
+ // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
+ this.buttonOk = new global::Gtk.Button ();
+ this.buttonOk.CanDefault = true;
+ this.buttonOk.CanFocus = true;
+ this.buttonOk.Name = "buttonOk";
+ this.buttonOk.UseStock = true;
+ this.buttonOk.UseUnderline = true;
+ this.buttonOk.Label = "gtk-ok";
+ this.AddActionWidget (this.buttonOk, -5);
+ global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonOk]));
+ w7.Position = 1;
+ w7.Expand = false;
+ w7.Fill = false;
+ if ((this.Child != null)) {
+ this.Child.ShowAll ();
+ }
+ this.DefaultWidth = 424;
+ this.DefaultHeight = 367;
+ this.Hide ();
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionEditRuleDialog.cs b/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionEditRuleDialog.cs
new file mode 100644
index 0000000000..bf5870fd72
--- /dev/null
+++ b/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionEditRuleDialog.cs
@@ -0,0 +1,394 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace MonoDevelop.CSharp.Diagnostics.InconsistentNaming
+{
+ internal partial class NameConventionEditRuleDialog
+ {
+ private global::Gtk.VBox vbox3;
+
+ private global::Gtk.HBox hbox3;
+
+ private global::Gtk.Label label4;
+
+ private global::Gtk.Entry entryRuleName;
+
+ private global::Gtk.HBox hbox1;
+
+ private global::Gtk.Table table1;
+
+ private global::Gtk.ScrolledWindow GtkScrolledWindow;
+
+ private global::Gtk.TreeView treeviewEntities;
+
+ private global::Gtk.ScrolledWindow GtkScrolledWindow1;
+
+ private global::Gtk.TreeView treeviewAccessibility;
+
+ private global::Gtk.Label label5;
+
+ private global::Gtk.Label label6;
+
+ private global::Gtk.Table table2;
+
+ private global::Gtk.Entry entryPrefix;
+
+ private global::Gtk.Entry entryPrefixAllowed;
+
+ private global::Gtk.Entry entrySuffix;
+
+ private global::Gtk.Label label1;
+
+ private global::Gtk.Label label2;
+
+ private global::Gtk.Label label3;
+
+ private global::Gtk.Label label8;
+
+ private global::Gtk.ComboBox styleComboBox;
+
+ private global::Gtk.VBox vbox1;
+
+ private global::Gtk.CheckButton checkbuttonStatic;
+
+ private global::Gtk.CheckButton checkbuttonInstanceMembers;
+
+ private global::Gtk.VBox vbox5;
+
+ private global::Gtk.Label label9;
+
+ private global::Gtk.Button buttonCancel;
+
+ private global::Gtk.Button buttonOk;
+
+ protected virtual void Build ()
+ {
+ global::Stetic.Gui.Initialize (this);
+ // Widget MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionEditRuleDialog
+ this.WidthRequest = 640;
+ this.HeightRequest = 480;
+ this.Name = "MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionEditRuleDialog";
+ this.Title = global::Mono.Unix.Catalog.GetString ("Edit Naming Rule");
+ this.WindowPosition = ((global::Gtk.WindowPosition)(4));
+ this.Modal = true;
+ this.Resizable = false;
+ this.DestroyWithParent = true;
+ this.SkipPagerHint = true;
+ this.SkipTaskbarHint = true;
+ // Internal child MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionEditRuleDialog.VBox
+ global::Gtk.VBox w1 = this.VBox;
+ w1.Name = "dialog1_VBox";
+ w1.Spacing = 6;
+ w1.BorderWidth = ((uint)(2));
+ // Container child dialog1_VBox.Gtk.Box+BoxChild
+ this.vbox3 = new global::Gtk.VBox ();
+ this.vbox3.Name = "vbox3";
+ this.vbox3.Spacing = 6;
+ this.vbox3.BorderWidth = ((uint)(6));
+ // Container child vbox3.Gtk.Box+BoxChild
+ this.hbox3 = new global::Gtk.HBox ();
+ this.hbox3.Name = "hbox3";
+ this.hbox3.Spacing = 6;
+ // Container child hbox3.Gtk.Box+BoxChild
+ this.label4 = new global::Gtk.Label ();
+ this.label4.Name = "label4";
+ this.label4.Xalign = 1F;
+ this.label4.LabelProp = global::Mono.Unix.Catalog.GetString ("_Rule:");
+ this.label4.UseUnderline = true;
+ this.hbox3.Add (this.label4);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.label4]));
+ w2.Position = 0;
+ w2.Expand = false;
+ w2.Fill = false;
+ w2.Padding = ((uint)(6));
+ // Container child hbox3.Gtk.Box+BoxChild
+ this.entryRuleName = new global::Gtk.Entry ();
+ this.entryRuleName.CanFocus = true;
+ this.entryRuleName.Name = "entryRuleName";
+ this.entryRuleName.IsEditable = true;
+ this.entryRuleName.InvisibleChar = '●';
+ this.hbox3.Add (this.entryRuleName);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.entryRuleName]));
+ w3.Position = 1;
+ this.vbox3.Add (this.hbox3);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox3]));
+ w4.Position = 0;
+ w4.Expand = false;
+ w4.Fill = false;
+ // Container child vbox3.Gtk.Box+BoxChild
+ this.hbox1 = new global::Gtk.HBox ();
+ this.hbox1.Name = "hbox1";
+ this.hbox1.Spacing = 6;
+ // Container child hbox1.Gtk.Box+BoxChild
+ this.table1 = new global::Gtk.Table (((uint)(4)), ((uint)(2)), false);
+ this.table1.Name = "table1";
+ this.table1.RowSpacing = ((uint)(6));
+ this.table1.ColumnSpacing = ((uint)(6));
+ this.table1.BorderWidth = ((uint)(6));
+ // Container child table1.Gtk.Table+TableChild
+ this.GtkScrolledWindow = new global::Gtk.ScrolledWindow ();
+ this.GtkScrolledWindow.Name = "GtkScrolledWindow";
+ this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
+ // Container child GtkScrolledWindow.Gtk.Container+ContainerChild
+ this.treeviewEntities = new global::Gtk.TreeView ();
+ this.treeviewEntities.WidthRequest = 0;
+ this.treeviewEntities.CanFocus = true;
+ this.treeviewEntities.Name = "treeviewEntities";
+ this.treeviewEntities.HeadersVisible = false;
+ this.GtkScrolledWindow.Add (this.treeviewEntities);
+ this.table1.Add (this.GtkScrolledWindow);
+ global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1 [this.GtkScrolledWindow]));
+ w6.TopAttach = ((uint)(1));
+ w6.BottomAttach = ((uint)(2));
+ w6.RightAttach = ((uint)(2));
+ w6.YPadding = ((uint)(6));
+ w6.XOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child table1.Gtk.Table+TableChild
+ this.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow ();
+ this.GtkScrolledWindow1.Name = "GtkScrolledWindow1";
+ this.GtkScrolledWindow1.ShadowType = ((global::Gtk.ShadowType)(1));
+ // Container child GtkScrolledWindow1.Gtk.Container+ContainerChild
+ this.treeviewAccessibility = new global::Gtk.TreeView ();
+ this.treeviewAccessibility.CanFocus = true;
+ this.treeviewAccessibility.Name = "treeviewAccessibility";
+ this.treeviewAccessibility.HeadersVisible = false;
+ this.GtkScrolledWindow1.Add (this.treeviewAccessibility);
+ this.table1.Add (this.GtkScrolledWindow1);
+ global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table1 [this.GtkScrolledWindow1]));
+ w8.TopAttach = ((uint)(3));
+ w8.BottomAttach = ((uint)(4));
+ w8.XPadding = ((uint)(6));
+ w8.YPadding = ((uint)(6));
+ // Container child table1.Gtk.Table+TableChild
+ this.label5 = new global::Gtk.Label ();
+ this.label5.Name = "label5";
+ this.label5.Xalign = 0F;
+ this.label5.LabelProp = global::Mono.Unix.Catalog.GetString ("_Affected entities:");
+ this.label5.UseUnderline = true;
+ this.table1.Add (this.label5);
+ global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table1 [this.label5]));
+ w9.XOptions = ((global::Gtk.AttachOptions)(4));
+ w9.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child table1.Gtk.Table+TableChild
+ this.label6 = new global::Gtk.Label ();
+ this.label6.Name = "label6";
+ this.label6.Xalign = 0F;
+ this.label6.LabelProp = global::Mono.Unix.Catalog.GetString ("_Accessibility:");
+ this.label6.UseUnderline = true;
+ this.table1.Add (this.label6);
+ global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table1 [this.label6]));
+ w10.TopAttach = ((uint)(2));
+ w10.BottomAttach = ((uint)(3));
+ w10.XOptions = ((global::Gtk.AttachOptions)(4));
+ w10.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child table1.Gtk.Table+TableChild
+ this.table2 = new global::Gtk.Table (((uint)(5)), ((uint)(2)), false);
+ this.table2.Name = "table2";
+ this.table2.RowSpacing = ((uint)(6));
+ this.table2.ColumnSpacing = ((uint)(6));
+ // Container child table2.Gtk.Table+TableChild
+ this.entryPrefix = new global::Gtk.Entry ();
+ this.entryPrefix.CanFocus = true;
+ this.entryPrefix.Name = "entryPrefix";
+ this.entryPrefix.IsEditable = true;
+ this.entryPrefix.InvisibleChar = '●';
+ this.table2.Add (this.entryPrefix);
+ global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table2 [this.entryPrefix]));
+ w11.TopAttach = ((uint)(1));
+ w11.BottomAttach = ((uint)(2));
+ w11.LeftAttach = ((uint)(1));
+ w11.RightAttach = ((uint)(2));
+ w11.XOptions = ((global::Gtk.AttachOptions)(4));
+ w11.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child table2.Gtk.Table+TableChild
+ this.entryPrefixAllowed = new global::Gtk.Entry ();
+ this.entryPrefixAllowed.CanFocus = true;
+ this.entryPrefixAllowed.Name = "entryPrefixAllowed";
+ this.entryPrefixAllowed.IsEditable = true;
+ this.entryPrefixAllowed.InvisibleChar = '●';
+ this.table2.Add (this.entryPrefixAllowed);
+ global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table2 [this.entryPrefixAllowed]));
+ w12.TopAttach = ((uint)(2));
+ w12.BottomAttach = ((uint)(3));
+ w12.LeftAttach = ((uint)(1));
+ w12.RightAttach = ((uint)(2));
+ w12.XOptions = ((global::Gtk.AttachOptions)(4));
+ w12.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child table2.Gtk.Table+TableChild
+ this.entrySuffix = new global::Gtk.Entry ();
+ this.entrySuffix.CanFocus = true;
+ this.entrySuffix.Name = "entrySuffix";
+ this.entrySuffix.IsEditable = true;
+ this.entrySuffix.InvisibleChar = '●';
+ this.table2.Add (this.entrySuffix);
+ global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table2 [this.entrySuffix]));
+ w13.TopAttach = ((uint)(3));
+ w13.BottomAttach = ((uint)(4));
+ w13.LeftAttach = ((uint)(1));
+ w13.RightAttach = ((uint)(2));
+ w13.XOptions = ((global::Gtk.AttachOptions)(4));
+ w13.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child table2.Gtk.Table+TableChild
+ this.label1 = new global::Gtk.Label ();
+ this.label1.Name = "label1";
+ this.label1.Xalign = 1F;
+ this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("Prefix:");
+ this.table2.Add (this.label1);
+ global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table2 [this.label1]));
+ w14.TopAttach = ((uint)(1));
+ w14.BottomAttach = ((uint)(2));
+ w14.XOptions = ((global::Gtk.AttachOptions)(4));
+ w14.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child table2.Gtk.Table+TableChild
+ this.label2 = new global::Gtk.Label ();
+ this.label2.Name = "label2";
+ this.label2.Xalign = 1F;
+ this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Style:");
+ this.table2.Add (this.label2);
+ global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table2 [this.label2]));
+ w15.XOptions = ((global::Gtk.AttachOptions)(4));
+ w15.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child table2.Gtk.Table+TableChild
+ this.label3 = new global::Gtk.Label ();
+ this.label3.Name = "label3";
+ this.label3.Xalign = 1F;
+ this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("Suffix:");
+ this.table2.Add (this.label3);
+ global::Gtk.Table.TableChild w16 = ((global::Gtk.Table.TableChild)(this.table2 [this.label3]));
+ w16.TopAttach = ((uint)(3));
+ w16.BottomAttach = ((uint)(4));
+ w16.XOptions = ((global::Gtk.AttachOptions)(4));
+ w16.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child table2.Gtk.Table+TableChild
+ this.label8 = new global::Gtk.Label ();
+ this.label8.Name = "label8";
+ this.label8.Xalign = 1F;
+ this.label8.LabelProp = global::Mono.Unix.Catalog.GetString ("Optional Prefixes:");
+ this.table2.Add (this.label8);
+ global::Gtk.Table.TableChild w17 = ((global::Gtk.Table.TableChild)(this.table2 [this.label8]));
+ w17.TopAttach = ((uint)(2));
+ w17.BottomAttach = ((uint)(3));
+ w17.XOptions = ((global::Gtk.AttachOptions)(4));
+ w17.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child table2.Gtk.Table+TableChild
+ this.styleComboBox = global::Gtk.ComboBox.NewText ();
+ this.styleComboBox.Name = "styleComboBox";
+ this.table2.Add (this.styleComboBox);
+ global::Gtk.Table.TableChild w18 = ((global::Gtk.Table.TableChild)(this.table2 [this.styleComboBox]));
+ w18.LeftAttach = ((uint)(1));
+ w18.RightAttach = ((uint)(2));
+ w18.XOptions = ((global::Gtk.AttachOptions)(4));
+ w18.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child table2.Gtk.Table+TableChild
+ this.vbox1 = new global::Gtk.VBox ();
+ this.vbox1.Name = "vbox1";
+ this.vbox1.Spacing = 6;
+ // Container child vbox1.Gtk.Box+BoxChild
+ this.checkbuttonStatic = new global::Gtk.CheckButton ();
+ this.checkbuttonStatic.CanFocus = true;
+ this.checkbuttonStatic.Name = "checkbuttonStatic";
+ this.checkbuttonStatic.Label = global::Mono.Unix.Catalog.GetString ("_Static member and types");
+ this.checkbuttonStatic.Active = true;
+ this.checkbuttonStatic.DrawIndicator = true;
+ this.checkbuttonStatic.UseUnderline = true;
+ this.vbox1.Add (this.checkbuttonStatic);
+ global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.checkbuttonStatic]));
+ w19.Position = 0;
+ w19.Expand = false;
+ w19.Fill = false;
+ // Container child vbox1.Gtk.Box+BoxChild
+ this.checkbuttonInstanceMembers = new global::Gtk.CheckButton ();
+ this.checkbuttonInstanceMembers.CanFocus = true;
+ this.checkbuttonInstanceMembers.Name = "checkbuttonInstanceMembers";
+ this.checkbuttonInstanceMembers.Label = global::Mono.Unix.Catalog.GetString ("_Instance members and locals");
+ this.checkbuttonInstanceMembers.Active = true;
+ this.checkbuttonInstanceMembers.DrawIndicator = true;
+ this.checkbuttonInstanceMembers.UseUnderline = true;
+ this.vbox1.Add (this.checkbuttonInstanceMembers);
+ global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.checkbuttonInstanceMembers]));
+ w20.Position = 1;
+ w20.Expand = false;
+ w20.Fill = false;
+ this.table2.Add (this.vbox1);
+ global::Gtk.Table.TableChild w21 = ((global::Gtk.Table.TableChild)(this.table2 [this.vbox1]));
+ w21.TopAttach = ((uint)(4));
+ w21.BottomAttach = ((uint)(5));
+ w21.LeftAttach = ((uint)(1));
+ w21.RightAttach = ((uint)(2));
+ w21.XOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child table2.Gtk.Table+TableChild
+ this.vbox5 = new global::Gtk.VBox ();
+ this.vbox5.Name = "vbox5";
+ this.vbox5.Spacing = 6;
+ // Container child vbox5.Gtk.Box+BoxChild
+ this.label9 = new global::Gtk.Label ();
+ this.label9.Name = "label9";
+ this.label9.Xalign = 0F;
+ this.label9.LabelProp = global::Mono.Unix.Catalog.GetString ("Static/Non Static");
+ this.vbox5.Add (this.label9);
+ global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.label9]));
+ w22.Position = 0;
+ w22.Expand = false;
+ w22.Fill = false;
+ this.table2.Add (this.vbox5);
+ global::Gtk.Table.TableChild w23 = ((global::Gtk.Table.TableChild)(this.table2 [this.vbox5]));
+ w23.TopAttach = ((uint)(4));
+ w23.BottomAttach = ((uint)(5));
+ w23.XOptions = ((global::Gtk.AttachOptions)(4));
+ this.table1.Add (this.table2);
+ global::Gtk.Table.TableChild w24 = ((global::Gtk.Table.TableChild)(this.table1 [this.table2]));
+ w24.TopAttach = ((uint)(2));
+ w24.BottomAttach = ((uint)(4));
+ w24.LeftAttach = ((uint)(1));
+ w24.RightAttach = ((uint)(2));
+ w24.XOptions = ((global::Gtk.AttachOptions)(4));
+ w24.YOptions = ((global::Gtk.AttachOptions)(0));
+ this.hbox1.Add (this.table1);
+ global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.table1]));
+ w25.Position = 0;
+ this.vbox3.Add (this.hbox1);
+ global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox1]));
+ w26.Position = 1;
+ w1.Add (this.vbox3);
+ global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox3]));
+ w27.Position = 0;
+ w27.Padding = ((uint)(6));
+ // Internal child MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionEditRuleDialog.ActionArea
+ global::Gtk.HButtonBox w28 = this.ActionArea;
+ w28.Name = "dialog1_ActionArea";
+ w28.Spacing = 10;
+ w28.BorderWidth = ((uint)(5));
+ w28.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
+ // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
+ this.buttonCancel = new global::Gtk.Button ();
+ this.buttonCancel.CanDefault = true;
+ this.buttonCancel.CanFocus = true;
+ this.buttonCancel.Name = "buttonCancel";
+ this.buttonCancel.UseStock = true;
+ this.buttonCancel.UseUnderline = true;
+ this.buttonCancel.Label = "gtk-cancel";
+ this.AddActionWidget (this.buttonCancel, -6);
+ global::Gtk.ButtonBox.ButtonBoxChild w29 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w28 [this.buttonCancel]));
+ w29.Expand = false;
+ w29.Fill = false;
+ // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
+ this.buttonOk = new global::Gtk.Button ();
+ this.buttonOk.CanDefault = true;
+ this.buttonOk.CanFocus = true;
+ this.buttonOk.Name = "buttonOk";
+ this.buttonOk.UseStock = true;
+ this.buttonOk.UseUnderline = true;
+ this.buttonOk.Label = "gtk-ok";
+ this.AddActionWidget (this.buttonOk, -5);
+ global::Gtk.ButtonBox.ButtonBoxChild w30 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w28 [this.buttonOk]));
+ w30.Position = 1;
+ w30.Expand = false;
+ w30.Fill = false;
+ if ((this.Child != null)) {
+ this.Child.ShowAll ();
+ }
+ this.DefaultWidth = 804;
+ this.DefaultHeight = 508;
+ this.Show ();
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionPanelWidget.cs b/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionPanelWidget.cs
new file mode 100644
index 0000000000..ca3e1675e6
--- /dev/null
+++ b/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionPanelWidget.cs
@@ -0,0 +1,95 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace MonoDevelop.CSharp.Diagnostics.InconsistentNaming
+{
+ internal partial class NameConventionPanelWidget
+ {
+ private global::Gtk.HBox hbox3;
+
+ private global::Gtk.ScrolledWindow GtkScrolledWindow;
+
+ private global::Gtk.TreeView treeviewConventions;
+
+ private global::Gtk.VBox vbox3;
+
+ private global::Gtk.Button buttonEdit;
+
+ private global::Gtk.Button buttonAdd;
+
+ private global::Gtk.Button buttonRemove;
+
+ protected virtual void Build ()
+ {
+ global::Stetic.Gui.Initialize (this);
+ // Widget MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionPanelWidget
+ global::Stetic.BinContainer.Attach (this);
+ this.Name = "MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionPanelWidget";
+ // Container child MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionPanelWidget.Gtk.Container+ContainerChild
+ this.hbox3 = new global::Gtk.HBox ();
+ this.hbox3.Name = "hbox3";
+ this.hbox3.Spacing = 6;
+ // Container child hbox3.Gtk.Box+BoxChild
+ this.GtkScrolledWindow = new global::Gtk.ScrolledWindow ();
+ this.GtkScrolledWindow.Name = "GtkScrolledWindow";
+ this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
+ // Container child GtkScrolledWindow.Gtk.Container+ContainerChild
+ this.treeviewConventions = new global::Gtk.TreeView ();
+ this.treeviewConventions.CanFocus = true;
+ this.treeviewConventions.Name = "treeviewConventions";
+ this.GtkScrolledWindow.Add (this.treeviewConventions);
+ this.hbox3.Add (this.GtkScrolledWindow);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.GtkScrolledWindow]));
+ w2.Position = 0;
+ // Container child hbox3.Gtk.Box+BoxChild
+ this.vbox3 = new global::Gtk.VBox ();
+ this.vbox3.Name = "vbox3";
+ this.vbox3.Spacing = 6;
+ // Container child vbox3.Gtk.Box+BoxChild
+ this.buttonEdit = new global::Gtk.Button ();
+ this.buttonEdit.CanFocus = true;
+ this.buttonEdit.Name = "buttonEdit";
+ this.buttonEdit.UseStock = true;
+ this.buttonEdit.UseUnderline = true;
+ this.buttonEdit.Label = "gtk-edit";
+ this.vbox3.Add (this.buttonEdit);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.buttonEdit]));
+ w3.Position = 0;
+ w3.Expand = false;
+ w3.Fill = false;
+ // Container child vbox3.Gtk.Box+BoxChild
+ this.buttonAdd = new global::Gtk.Button ();
+ this.buttonAdd.CanFocus = true;
+ this.buttonAdd.Name = "buttonAdd";
+ this.buttonAdd.UseStock = true;
+ this.buttonAdd.UseUnderline = true;
+ this.buttonAdd.Label = "gtk-add";
+ this.vbox3.Add (this.buttonAdd);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.buttonAdd]));
+ w4.Position = 1;
+ w4.Expand = false;
+ w4.Fill = false;
+ // Container child vbox3.Gtk.Box+BoxChild
+ this.buttonRemove = new global::Gtk.Button ();
+ this.buttonRemove.CanFocus = true;
+ this.buttonRemove.Name = "buttonRemove";
+ this.buttonRemove.UseStock = true;
+ this.buttonRemove.UseUnderline = true;
+ this.buttonRemove.Label = "gtk-remove";
+ this.vbox3.Add (this.buttonRemove);
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.buttonRemove]));
+ w5.Position = 2;
+ w5.Expand = false;
+ w5.Fill = false;
+ this.hbox3.Add (this.vbox3);
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.vbox3]));
+ w6.Position = 1;
+ w6.Expand = false;
+ w6.Fill = false;
+ this.Add (this.hbox3);
+ if ((this.Child != null)) {
+ this.Child.ShowAll ();
+ }
+ this.Hide ();
+ }
+ }
+}
diff --git a/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Formatting.CSharpFormattingPolicyPanelWidget.cs b/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Formatting.CSharpFormattingPolicyPanelWidget.cs
index 323a37ccd6..cb4e5efaa8 100644
--- a/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Formatting.CSharpFormattingPolicyPanelWidget.cs
+++ b/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Formatting.CSharpFormattingPolicyPanelWidget.cs
@@ -2,12 +2,16 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.CSharp.Formatting
{
- internal partial class CSharpFormattingPolicyPanelWidget
+ partial class CSharpFormattingPolicyPanelWidget
{
private global::Gtk.VBox vbox1;
+
private global::Gtk.HBox hbox1;
+
private global::Gtk.Button buttonEdit;
+
private global::Gtk.Label label2;
+
private global::Gtk.ScrolledWindow scrolledwindow1;
protected virtual void Build ()
diff --git a/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs b/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs
index a44402e53d..77a4416fad 100644
--- a/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs
+++ b/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.cs
@@ -5,55 +5,59 @@ namespace MonoDevelop.CSharp.Formatting
internal partial class CSharpFormattingProfileDialog
{
private global::Gtk.VBox vbox5;
+
private global::Gtk.HPaned hpaned1;
+
private global::Gtk.VBox vbox2;
+
private global::Gtk.HBox hbox4;
+
private global::Gtk.Label label12;
+
private global::Gtk.ComboBox comboboxCategories;
+
private global::Gtk.Notebook notebookCategories;
+
private global::Gtk.VBox vbox8;
+
private global::Gtk.ScrolledWindow GtkScrolledWindow;
+
private global::Gtk.TreeView treeviewIndentOptions;
+
private global::Gtk.Label label8;
+
private global::Gtk.ScrolledWindow GtkScrolledWindow1;
- private global::Gtk.TreeView treeviewBracePositions;
+
+ private global::Gtk.TreeView treeviewNewLines;
+
private global::Gtk.Label label9;
- private global::Gtk.Table table4;
- private global::Gtk.Entry entryAfterUsings;
- private global::Gtk.Entry entryAroundRegion;
- private global::Gtk.Entry entryBeforeFirstDeclaration;
- private global::Gtk.Entry entryBeforUsings;
- private global::Gtk.Entry entryBetweenEvents;
- private global::Gtk.Entry entryBetweenFields;
- private global::Gtk.Entry entryBetweenMembers;
- private global::Gtk.Entry entryBetweenTypes;
- private global::Gtk.Entry entryInsideRegion;
- private global::Gtk.Label GtkLabel8;
- private global::Gtk.Label GtkLabel9;
- private global::Gtk.Label label1;
- private global::Gtk.Label label15;
- private global::Gtk.Label label16;
- private global::Gtk.Label label19;
- private global::Gtk.Label label20;
- private global::Gtk.Label label21;
- private global::Gtk.Label label22;
- private global::Gtk.Label label23;
- private global::Gtk.Label label24;
- private global::Gtk.Label label25;
+
+ private global::Gtk.ScrolledWindow GtkScrolledWindow5;
+
+ private global::Gtk.TreeView treeviewSpacing;
+
private global::Gtk.Label label14;
- private global::Gtk.ScrolledWindow GtkScrolledWindow3;
- private global::Gtk.TreeView treeviewWrappingCategory;
- private global::Gtk.Label label2;
+
private global::Gtk.ScrolledWindow GtkScrolledWindow2;
- private global::Gtk.TreeView treeviewInsertWhiteSpaceCategory;
+
+ private global::Gtk.TreeView treeviewWrapping;
+
private global::Gtk.Label label10;
- private global::Gtk.ScrolledWindow GtkScrolledWindow4;
- private global::Gtk.TreeView treeviewNewLines;
- private global::Gtk.Label label11;
+
+ private global::Gtk.ScrolledWindow GtkScrolledWindow3;
+
+ private global::Gtk.TreeView treeviewStyle;
+
+ private global::Gtk.Label label2;
+
private global::Gtk.VBox vbox6;
+
private global::Gtk.Label label13;
+
private global::Gtk.ScrolledWindow scrolledwindow;
+
private global::Gtk.Button buttonCancel;
+
private global::Gtk.Button buttonOk;
protected virtual void Build ()
@@ -131,7 +135,7 @@ namespace MonoDevelop.CSharp.Formatting
// Notebook tab
this.label8 = new global::Gtk.Label ();
this.label8.Name = "label8";
- this.label8.LabelProp = global::Mono.Unix.Catalog.GetString ("page1");
+ this.label8.LabelProp = global::Mono.Unix.Catalog.GetString ("Indentation");
this.notebookCategories.SetTabLabel (this.vbox8, this.label8);
this.label8.ShowAll ();
// Container child notebookCategories.Gtk.Notebook+NotebookChild
@@ -139,363 +143,79 @@ namespace MonoDevelop.CSharp.Formatting
this.GtkScrolledWindow1.Name = "GtkScrolledWindow1";
this.GtkScrolledWindow1.ShadowType = ((global::Gtk.ShadowType)(1));
// Container child GtkScrolledWindow1.Gtk.Container+ContainerChild
- this.treeviewBracePositions = new global::Gtk.TreeView ();
- this.treeviewBracePositions.CanFocus = true;
- this.treeviewBracePositions.Name = "treeviewBracePositions";
- this.GtkScrolledWindow1.Add (this.treeviewBracePositions);
+ this.treeviewNewLines = new global::Gtk.TreeView ();
+ this.treeviewNewLines.CanFocus = true;
+ this.treeviewNewLines.Name = "treeviewNewLines";
+ this.GtkScrolledWindow1.Add (this.treeviewNewLines);
this.notebookCategories.Add (this.GtkScrolledWindow1);
global::Gtk.Notebook.NotebookChild w9 = ((global::Gtk.Notebook.NotebookChild)(this.notebookCategories [this.GtkScrolledWindow1]));
w9.Position = 1;
// Notebook tab
this.label9 = new global::Gtk.Label ();
this.label9.Name = "label9";
- this.label9.LabelProp = global::Mono.Unix.Catalog.GetString ("page2");
+ this.label9.LabelProp = global::Mono.Unix.Catalog.GetString ("NewLines");
this.notebookCategories.SetTabLabel (this.GtkScrolledWindow1, this.label9);
this.label9.ShowAll ();
// Container child notebookCategories.Gtk.Notebook+NotebookChild
- this.table4 = new global::Gtk.Table (((uint)(12)), ((uint)(3)), false);
- this.table4.Name = "table4";
- this.table4.RowSpacing = ((uint)(6));
- this.table4.ColumnSpacing = ((uint)(6));
- // Container child table4.Gtk.Table+TableChild
- this.entryAfterUsings = new global::Gtk.Entry ();
- this.entryAfterUsings.CanFocus = true;
- this.entryAfterUsings.Name = "entryAfterUsings";
- this.entryAfterUsings.IsEditable = true;
- this.entryAfterUsings.WidthChars = 5;
- this.entryAfterUsings.InvisibleChar = '●';
- this.table4.Add (this.entryAfterUsings);
- global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table4 [this.entryAfterUsings]));
- w10.TopAttach = ((uint)(2));
- w10.BottomAttach = ((uint)(3));
- w10.LeftAttach = ((uint)(1));
- w10.RightAttach = ((uint)(2));
- w10.XOptions = ((global::Gtk.AttachOptions)(2));
- w10.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.entryAroundRegion = new global::Gtk.Entry ();
- this.entryAroundRegion.CanFocus = true;
- this.entryAroundRegion.Name = "entryAroundRegion";
- this.entryAroundRegion.IsEditable = true;
- this.entryAroundRegion.WidthChars = 5;
- this.entryAroundRegion.InvisibleChar = '●';
- this.table4.Add (this.entryAroundRegion);
- global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table4 [this.entryAroundRegion]));
- w11.TopAttach = ((uint)(10));
- w11.BottomAttach = ((uint)(11));
- w11.LeftAttach = ((uint)(1));
- w11.RightAttach = ((uint)(2));
- w11.XOptions = ((global::Gtk.AttachOptions)(0));
- w11.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.entryBeforeFirstDeclaration = new global::Gtk.Entry ();
- this.entryBeforeFirstDeclaration.CanFocus = true;
- this.entryBeforeFirstDeclaration.Name = "entryBeforeFirstDeclaration";
- this.entryBeforeFirstDeclaration.IsEditable = true;
- this.entryBeforeFirstDeclaration.WidthChars = 5;
- this.entryBeforeFirstDeclaration.InvisibleChar = '●';
- this.table4.Add (this.entryBeforeFirstDeclaration);
- global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table4 [this.entryBeforeFirstDeclaration]));
- w12.TopAttach = ((uint)(4));
- w12.BottomAttach = ((uint)(5));
- w12.LeftAttach = ((uint)(1));
- w12.RightAttach = ((uint)(2));
- w12.XOptions = ((global::Gtk.AttachOptions)(0));
- w12.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.entryBeforUsings = new global::Gtk.Entry ();
- this.entryBeforUsings.CanFocus = true;
- this.entryBeforUsings.Name = "entryBeforUsings";
- this.entryBeforUsings.IsEditable = true;
- this.entryBeforUsings.WidthChars = 5;
- this.entryBeforUsings.InvisibleChar = '●';
- this.table4.Add (this.entryBeforUsings);
- global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table4 [this.entryBeforUsings]));
- w13.TopAttach = ((uint)(1));
- w13.BottomAttach = ((uint)(2));
- w13.LeftAttach = ((uint)(1));
- w13.RightAttach = ((uint)(2));
- w13.XOptions = ((global::Gtk.AttachOptions)(2));
- w13.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.entryBetweenEvents = new global::Gtk.Entry ();
- this.entryBetweenEvents.CanFocus = true;
- this.entryBetweenEvents.Name = "entryBetweenEvents";
- this.entryBetweenEvents.IsEditable = true;
- this.entryBetweenEvents.WidthChars = 5;
- this.entryBetweenEvents.InvisibleChar = '●';
- this.table4.Add (this.entryBetweenEvents);
- global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table4 [this.entryBetweenEvents]));
- w14.TopAttach = ((uint)(8));
- w14.BottomAttach = ((uint)(9));
- w14.LeftAttach = ((uint)(1));
- w14.RightAttach = ((uint)(2));
- w14.XOptions = ((global::Gtk.AttachOptions)(0));
- w14.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.entryBetweenFields = new global::Gtk.Entry ();
- this.entryBetweenFields.CanFocus = true;
- this.entryBetweenFields.Name = "entryBetweenFields";
- this.entryBetweenFields.IsEditable = true;
- this.entryBetweenFields.WidthChars = 5;
- this.entryBetweenFields.InvisibleChar = '●';
- this.table4.Add (this.entryBetweenFields);
- global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table4 [this.entryBetweenFields]));
- w15.TopAttach = ((uint)(7));
- w15.BottomAttach = ((uint)(8));
- w15.LeftAttach = ((uint)(1));
- w15.RightAttach = ((uint)(2));
- w15.XOptions = ((global::Gtk.AttachOptions)(0));
- w15.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.entryBetweenMembers = new global::Gtk.Entry ();
- this.entryBetweenMembers.CanFocus = true;
- this.entryBetweenMembers.Name = "entryBetweenMembers";
- this.entryBetweenMembers.IsEditable = true;
- this.entryBetweenMembers.WidthChars = 5;
- this.entryBetweenMembers.InvisibleChar = '●';
- this.table4.Add (this.entryBetweenMembers);
- global::Gtk.Table.TableChild w16 = ((global::Gtk.Table.TableChild)(this.table4 [this.entryBetweenMembers]));
- w16.TopAttach = ((uint)(9));
- w16.BottomAttach = ((uint)(10));
- w16.LeftAttach = ((uint)(1));
- w16.RightAttach = ((uint)(2));
- w16.XOptions = ((global::Gtk.AttachOptions)(0));
- w16.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.entryBetweenTypes = new global::Gtk.Entry ();
- this.entryBetweenTypes.CanFocus = true;
- this.entryBetweenTypes.Name = "entryBetweenTypes";
- this.entryBetweenTypes.IsEditable = true;
- this.entryBetweenTypes.WidthChars = 5;
- this.entryBetweenTypes.InvisibleChar = '●';
- this.table4.Add (this.entryBetweenTypes);
- global::Gtk.Table.TableChild w17 = ((global::Gtk.Table.TableChild)(this.table4 [this.entryBetweenTypes]));
- w17.TopAttach = ((uint)(5));
- w17.BottomAttach = ((uint)(6));
- w17.LeftAttach = ((uint)(1));
- w17.RightAttach = ((uint)(2));
- w17.XOptions = ((global::Gtk.AttachOptions)(0));
- w17.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.entryInsideRegion = new global::Gtk.Entry ();
- this.entryInsideRegion.CanFocus = true;
- this.entryInsideRegion.Name = "entryInsideRegion";
- this.entryInsideRegion.IsEditable = true;
- this.entryInsideRegion.WidthChars = 5;
- this.entryInsideRegion.InvisibleChar = '●';
- this.table4.Add (this.entryInsideRegion);
- global::Gtk.Table.TableChild w18 = ((global::Gtk.Table.TableChild)(this.table4 [this.entryInsideRegion]));
- w18.TopAttach = ((uint)(11));
- w18.BottomAttach = ((uint)(12));
- w18.LeftAttach = ((uint)(1));
- w18.RightAttach = ((uint)(2));
- w18.XOptions = ((global::Gtk.AttachOptions)(0));
- w18.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.GtkLabel8 = new global::Gtk.Label ();
- this.GtkLabel8.Name = "GtkLabel8";
- this.GtkLabel8.Xalign = 0F;
- this.GtkLabel8.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Minimum blank lines in namespaces</b>");
- this.GtkLabel8.UseMarkup = true;
- this.table4.Add (this.GtkLabel8);
- global::Gtk.Table.TableChild w19 = ((global::Gtk.Table.TableChild)(this.table4 [this.GtkLabel8]));
- w19.TopAttach = ((uint)(3));
- w19.BottomAttach = ((uint)(4));
- w19.RightAttach = ((uint)(3));
- w19.XOptions = ((global::Gtk.AttachOptions)(4));
- w19.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.GtkLabel9 = new global::Gtk.Label ();
- this.GtkLabel9.Name = "GtkLabel9";
- this.GtkLabel9.Xalign = 0F;
- this.GtkLabel9.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Minimum blank lines in types</b>");
- this.GtkLabel9.UseMarkup = true;
- this.table4.Add (this.GtkLabel9);
- global::Gtk.Table.TableChild w20 = ((global::Gtk.Table.TableChild)(this.table4 [this.GtkLabel9]));
- w20.TopAttach = ((uint)(6));
- w20.BottomAttach = ((uint)(7));
- w20.RightAttach = ((uint)(3));
- w20.XOptions = ((global::Gtk.AttachOptions)(4));
- w20.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.label1 = new global::Gtk.Label ();
- this.label1.Name = "label1";
- this.label1.Xalign = 0F;
- this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Minimum blank lines in compilation unit</b>");
- this.label1.UseMarkup = true;
- this.table4.Add (this.label1);
- global::Gtk.Table.TableChild w21 = ((global::Gtk.Table.TableChild)(this.table4 [this.label1]));
- w21.RightAttach = ((uint)(3));
- w21.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.label15 = new global::Gtk.Label ();
- this.label15.Name = "label15";
- this.label15.Xalign = 1F;
- this.label15.LabelProp = global::Mono.Unix.Catalog.GetString ("Before using declaration:");
- this.table4.Add (this.label15);
- global::Gtk.Table.TableChild w22 = ((global::Gtk.Table.TableChild)(this.table4 [this.label15]));
- w22.TopAttach = ((uint)(1));
- w22.BottomAttach = ((uint)(2));
- w22.XOptions = ((global::Gtk.AttachOptions)(4));
- w22.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.label16 = new global::Gtk.Label ();
- this.label16.Name = "label16";
- this.label16.Xalign = 1F;
- this.label16.LabelProp = global::Mono.Unix.Catalog.GetString ("After using declaration:");
- this.table4.Add (this.label16);
- global::Gtk.Table.TableChild w23 = ((global::Gtk.Table.TableChild)(this.table4 [this.label16]));
- w23.TopAttach = ((uint)(2));
- w23.BottomAttach = ((uint)(3));
- w23.XOptions = ((global::Gtk.AttachOptions)(4));
- w23.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.label19 = new global::Gtk.Label ();
- this.label19.Name = "label19";
- this.label19.Xalign = 1F;
- this.label19.LabelProp = global::Mono.Unix.Catalog.GetString ("Between type declarations:");
- this.table4.Add (this.label19);
- global::Gtk.Table.TableChild w24 = ((global::Gtk.Table.TableChild)(this.table4 [this.label19]));
- w24.TopAttach = ((uint)(5));
- w24.BottomAttach = ((uint)(6));
- w24.XOptions = ((global::Gtk.AttachOptions)(4));
- w24.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.label20 = new global::Gtk.Label ();
- this.label20.Name = "label20";
- this.label20.Xalign = 1F;
- this.label20.LabelProp = global::Mono.Unix.Catalog.GetString ("Before first declaration:");
- this.table4.Add (this.label20);
- global::Gtk.Table.TableChild w25 = ((global::Gtk.Table.TableChild)(this.table4 [this.label20]));
- w25.TopAttach = ((uint)(4));
- w25.BottomAttach = ((uint)(5));
- w25.XOptions = ((global::Gtk.AttachOptions)(4));
- w25.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.label21 = new global::Gtk.Label ();
- this.label21.Name = "label21";
- this.label21.Xalign = 1F;
- this.label21.LabelProp = global::Mono.Unix.Catalog.GetString ("Between field declarations:");
- this.table4.Add (this.label21);
- global::Gtk.Table.TableChild w26 = ((global::Gtk.Table.TableChild)(this.table4 [this.label21]));
- w26.TopAttach = ((uint)(7));
- w26.BottomAttach = ((uint)(8));
- w26.XOptions = ((global::Gtk.AttachOptions)(4));
- w26.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.label22 = new global::Gtk.Label ();
- this.label22.Name = "label22";
- this.label22.Xalign = 1F;
- this.label22.LabelProp = global::Mono.Unix.Catalog.GetString ("Between other member declarations:");
- this.table4.Add (this.label22);
- global::Gtk.Table.TableChild w27 = ((global::Gtk.Table.TableChild)(this.table4 [this.label22]));
- w27.TopAttach = ((uint)(9));
- w27.BottomAttach = ((uint)(10));
- w27.XOptions = ((global::Gtk.AttachOptions)(4));
- w27.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.label23 = new global::Gtk.Label ();
- this.label23.Name = "label23";
- this.label23.Xalign = 1F;
- this.label23.LabelProp = global::Mono.Unix.Catalog.GetString ("Between simple event declarations:");
- this.table4.Add (this.label23);
- global::Gtk.Table.TableChild w28 = ((global::Gtk.Table.TableChild)(this.table4 [this.label23]));
- w28.TopAttach = ((uint)(8));
- w28.BottomAttach = ((uint)(9));
- w28.XOptions = ((global::Gtk.AttachOptions)(4));
- w28.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.label24 = new global::Gtk.Label ();
- this.label24.Name = "label24";
- this.label24.Xalign = 1F;
- this.label24.LabelProp = global::Mono.Unix.Catalog.GetString ("Around region:");
- this.table4.Add (this.label24);
- global::Gtk.Table.TableChild w29 = ((global::Gtk.Table.TableChild)(this.table4 [this.label24]));
- w29.TopAttach = ((uint)(10));
- w29.BottomAttach = ((uint)(11));
- w29.XOptions = ((global::Gtk.AttachOptions)(4));
- w29.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table4.Gtk.Table+TableChild
- this.label25 = new global::Gtk.Label ();
- this.label25.Name = "label25";
- this.label25.Xalign = 1F;
- this.label25.LabelProp = global::Mono.Unix.Catalog.GetString ("Inside region:");
- this.table4.Add (this.label25);
- global::Gtk.Table.TableChild w30 = ((global::Gtk.Table.TableChild)(this.table4 [this.label25]));
- w30.TopAttach = ((uint)(11));
- w30.BottomAttach = ((uint)(12));
- w30.XOptions = ((global::Gtk.AttachOptions)(4));
- w30.YOptions = ((global::Gtk.AttachOptions)(4));
- this.notebookCategories.Add (this.table4);
- global::Gtk.Notebook.NotebookChild w31 = ((global::Gtk.Notebook.NotebookChild)(this.notebookCategories [this.table4]));
- w31.Position = 2;
+ this.GtkScrolledWindow5 = new global::Gtk.ScrolledWindow ();
+ this.GtkScrolledWindow5.Name = "GtkScrolledWindow5";
+ this.GtkScrolledWindow5.ShadowType = ((global::Gtk.ShadowType)(1));
+ // Container child GtkScrolledWindow5.Gtk.Container+ContainerChild
+ this.treeviewSpacing = new global::Gtk.TreeView ();
+ this.treeviewSpacing.CanFocus = true;
+ this.treeviewSpacing.Name = "treeviewSpacing";
+ this.GtkScrolledWindow5.Add (this.treeviewSpacing);
+ this.notebookCategories.Add (this.GtkScrolledWindow5);
+ global::Gtk.Notebook.NotebookChild w11 = ((global::Gtk.Notebook.NotebookChild)(this.notebookCategories [this.GtkScrolledWindow5]));
+ w11.Position = 2;
// Notebook tab
this.label14 = new global::Gtk.Label ();
this.label14.Name = "label14";
- this.label14.LabelProp = global::Mono.Unix.Catalog.GetString ("page5");
- this.notebookCategories.SetTabLabel (this.table4, this.label14);
+ this.label14.LabelProp = global::Mono.Unix.Catalog.GetString ("Spacing");
+ this.notebookCategories.SetTabLabel (this.GtkScrolledWindow5, this.label14);
this.label14.ShowAll ();
// Container child notebookCategories.Gtk.Notebook+NotebookChild
- this.GtkScrolledWindow3 = new global::Gtk.ScrolledWindow ();
- this.GtkScrolledWindow3.Name = "GtkScrolledWindow3";
- this.GtkScrolledWindow3.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child GtkScrolledWindow3.Gtk.Container+ContainerChild
- this.treeviewWrappingCategory = new global::Gtk.TreeView ();
- this.treeviewWrappingCategory.CanFocus = true;
- this.treeviewWrappingCategory.Name = "treeviewWrappingCategory";
- this.GtkScrolledWindow3.Add (this.treeviewWrappingCategory);
- this.notebookCategories.Add (this.GtkScrolledWindow3);
- global::Gtk.Notebook.NotebookChild w33 = ((global::Gtk.Notebook.NotebookChild)(this.notebookCategories [this.GtkScrolledWindow3]));
- w33.Position = 3;
- // Notebook tab
- this.label2 = new global::Gtk.Label ();
- this.label2.Name = "label2";
- this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("page6");
- this.notebookCategories.SetTabLabel (this.GtkScrolledWindow3, this.label2);
- this.label2.ShowAll ();
- // Container child notebookCategories.Gtk.Notebook+NotebookChild
this.GtkScrolledWindow2 = new global::Gtk.ScrolledWindow ();
this.GtkScrolledWindow2.Name = "GtkScrolledWindow2";
this.GtkScrolledWindow2.ShadowType = ((global::Gtk.ShadowType)(1));
// Container child GtkScrolledWindow2.Gtk.Container+ContainerChild
- this.treeviewInsertWhiteSpaceCategory = new global::Gtk.TreeView ();
- this.treeviewInsertWhiteSpaceCategory.CanFocus = true;
- this.treeviewInsertWhiteSpaceCategory.Name = "treeviewInsertWhiteSpaceCategory";
- this.GtkScrolledWindow2.Add (this.treeviewInsertWhiteSpaceCategory);
+ this.treeviewWrapping = new global::Gtk.TreeView ();
+ this.treeviewWrapping.CanFocus = true;
+ this.treeviewWrapping.Name = "treeviewWrapping";
+ this.GtkScrolledWindow2.Add (this.treeviewWrapping);
this.notebookCategories.Add (this.GtkScrolledWindow2);
- global::Gtk.Notebook.NotebookChild w35 = ((global::Gtk.Notebook.NotebookChild)(this.notebookCategories [this.GtkScrolledWindow2]));
- w35.Position = 4;
+ global::Gtk.Notebook.NotebookChild w13 = ((global::Gtk.Notebook.NotebookChild)(this.notebookCategories [this.GtkScrolledWindow2]));
+ w13.Position = 3;
// Notebook tab
this.label10 = new global::Gtk.Label ();
this.label10.Name = "label10";
- this.label10.LabelProp = global::Mono.Unix.Catalog.GetString ("page3");
+ this.label10.LabelProp = global::Mono.Unix.Catalog.GetString ("Wrapping");
this.notebookCategories.SetTabLabel (this.GtkScrolledWindow2, this.label10);
this.label10.ShowAll ();
// Container child notebookCategories.Gtk.Notebook+NotebookChild
- this.GtkScrolledWindow4 = new global::Gtk.ScrolledWindow ();
- this.GtkScrolledWindow4.Name = "GtkScrolledWindow4";
- this.GtkScrolledWindow4.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child GtkScrolledWindow4.Gtk.Container+ContainerChild
- this.treeviewNewLines = new global::Gtk.TreeView ();
- this.treeviewNewLines.CanFocus = true;
- this.treeviewNewLines.Name = "treeviewNewLines";
- this.GtkScrolledWindow4.Add (this.treeviewNewLines);
- this.notebookCategories.Add (this.GtkScrolledWindow4);
- global::Gtk.Notebook.NotebookChild w37 = ((global::Gtk.Notebook.NotebookChild)(this.notebookCategories [this.GtkScrolledWindow4]));
- w37.Position = 5;
+ this.GtkScrolledWindow3 = new global::Gtk.ScrolledWindow ();
+ this.GtkScrolledWindow3.Name = "GtkScrolledWindow3";
+ this.GtkScrolledWindow3.ShadowType = ((global::Gtk.ShadowType)(1));
+ // Container child GtkScrolledWindow3.Gtk.Container+ContainerChild
+ this.treeviewStyle = new global::Gtk.TreeView ();
+ this.treeviewStyle.CanFocus = true;
+ this.treeviewStyle.Name = "treeviewStyle";
+ this.GtkScrolledWindow3.Add (this.treeviewStyle);
+ this.notebookCategories.Add (this.GtkScrolledWindow3);
+ global::Gtk.Notebook.NotebookChild w15 = ((global::Gtk.Notebook.NotebookChild)(this.notebookCategories [this.GtkScrolledWindow3]));
+ w15.Position = 4;
// Notebook tab
- this.label11 = new global::Gtk.Label ();
- this.label11.Name = "label11";
- this.label11.LabelProp = global::Mono.Unix.Catalog.GetString ("page4");
- this.notebookCategories.SetTabLabel (this.GtkScrolledWindow4, this.label11);
- this.label11.ShowAll ();
+ this.label2 = new global::Gtk.Label ();
+ this.label2.Name = "label2";
+ this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Style");
+ this.notebookCategories.SetTabLabel (this.GtkScrolledWindow3, this.label2);
+ this.label2.ShowAll ();
this.vbox2.Add (this.notebookCategories);
- global::Gtk.Box.BoxChild w38 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.notebookCategories]));
- w38.Position = 1;
+ global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.notebookCategories]));
+ w16.Position = 1;
this.hpaned1.Add (this.vbox2);
- global::Gtk.Paned.PanedChild w39 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.vbox2]));
- w39.Resize = false;
+ global::Gtk.Paned.PanedChild w17 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.vbox2]));
+ w17.Resize = false;
// Container child hpaned1.Gtk.Paned+PanedChild
this.vbox6 = new global::Gtk.VBox ();
this.vbox6.Name = "vbox6";
@@ -506,31 +226,31 @@ namespace MonoDevelop.CSharp.Formatting
this.label13.Xalign = 0F;
this.label13.LabelProp = global::Mono.Unix.Catalog.GetString ("Preview:");
this.vbox6.Add (this.label13);
- global::Gtk.Box.BoxChild w40 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.label13]));
- w40.Position = 0;
- w40.Expand = false;
- w40.Fill = false;
+ global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.label13]));
+ w18.Position = 0;
+ w18.Expand = false;
+ w18.Fill = false;
// Container child vbox6.Gtk.Box+BoxChild
this.scrolledwindow = new global::Gtk.ScrolledWindow ();
this.scrolledwindow.CanFocus = true;
this.scrolledwindow.Name = "scrolledwindow";
this.scrolledwindow.ShadowType = ((global::Gtk.ShadowType)(1));
this.vbox6.Add (this.scrolledwindow);
- global::Gtk.Box.BoxChild w41 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.scrolledwindow]));
- w41.Position = 1;
+ global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.scrolledwindow]));
+ w19.Position = 1;
this.hpaned1.Add (this.vbox6);
this.vbox5.Add (this.hpaned1);
- global::Gtk.Box.BoxChild w43 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hpaned1]));
- w43.Position = 0;
+ global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hpaned1]));
+ w21.Position = 0;
w1.Add (this.vbox5);
- global::Gtk.Box.BoxChild w44 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox5]));
- w44.Position = 0;
+ global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox5]));
+ w22.Position = 0;
// Internal child MonoDevelop.CSharp.Formatting.CSharpFormattingProfileDialog.ActionArea
- global::Gtk.HButtonBox w45 = this.ActionArea;
- w45.Name = "dialog1_ActionArea";
- w45.Spacing = 10;
- w45.BorderWidth = ((uint)(5));
- w45.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
+ global::Gtk.HButtonBox w23 = this.ActionArea;
+ w23.Name = "dialog1_ActionArea";
+ w23.Spacing = 10;
+ w23.BorderWidth = ((uint)(5));
+ w23.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.buttonCancel = new global::Gtk.Button ();
this.buttonCancel.CanDefault = true;
@@ -540,9 +260,9 @@ namespace MonoDevelop.CSharp.Formatting
this.buttonCancel.UseUnderline = true;
this.buttonCancel.Label = "gtk-cancel";
this.AddActionWidget (this.buttonCancel, -6);
- global::Gtk.ButtonBox.ButtonBoxChild w46 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w45 [this.buttonCancel]));
- w46.Expand = false;
- w46.Fill = false;
+ global::Gtk.ButtonBox.ButtonBoxChild w24 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w23 [this.buttonCancel]));
+ w24.Expand = false;
+ w24.Fill = false;
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.buttonOk = new global::Gtk.Button ();
this.buttonOk.CanDefault = true;
@@ -552,10 +272,10 @@ namespace MonoDevelop.CSharp.Formatting
this.buttonOk.UseUnderline = true;
this.buttonOk.Label = "gtk-ok";
this.AddActionWidget (this.buttonOk, -5);
- global::Gtk.ButtonBox.ButtonBoxChild w47 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w45 [this.buttonOk]));
- w47.Position = 1;
- w47.Expand = false;
- w47.Fill = false;
+ global::Gtk.ButtonBox.ButtonBoxChild w25 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w23 [this.buttonOk]));
+ w25.Position = 1;
+ w25.Expand = false;
+ w25.Fill = false;
if ((this.Child != null)) {
this.Child.ShowAll ();
}
diff --git a/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.cs b/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.cs
index 6dc530487f..a7544ac463 100644
--- a/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.cs
+++ b/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Formatting.NewFormattingProfileDialog.cs
@@ -2,14 +2,20 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.CSharp.Formatting
{
- internal partial class NewFormattingProfileDialog
+ partial class NewFormattingProfileDialog
{
private global::Gtk.VBox vbox4;
+
private global::Gtk.Label label3;
+
private global::Gtk.Entry entryProfileName;
+
private global::Gtk.Label label4;
+
private global::Gtk.ComboBox comboboxInitFrom;
+
private global::Gtk.Button buttonCancel;
+
private global::Gtk.Button buttonOk;
protected virtual void Build ()
diff --git a/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Project.CodeGenerationPanelWidget.cs b/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Project.CodeGenerationPanelWidget.cs
index 954a522bf3..73bb6d6a87 100644
--- a/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Project.CodeGenerationPanelWidget.cs
+++ b/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Project.CodeGenerationPanelWidget.cs
@@ -5,36 +5,67 @@ namespace MonoDevelop.CSharp.Project
internal partial class CodeGenerationPanelWidget
{
private global::Gtk.VBox vbox62;
+
private global::Gtk.Label label82;
+
private global::Gtk.HBox hbox56;
+
private global::Gtk.Label label81;
+
private global::Gtk.VBox vbox65;
+
private global::Gtk.Table table1;
+
private global::Gtk.CheckButton enableOptimizationCheckButton;
+
private global::Gtk.CheckButton generateOverflowChecksCheckButton;
+
private global::Gtk.HBox hbox1;
+
private global::Gtk.ComboBox comboPlatforms;
+
private global::Gtk.HBox hbox2;
+
private global::Gtk.ComboBox comboDebug;
+
private global::Gtk.HBox hbox4;
+
private global::Gtk.CheckButton generateXmlOutputCheckButton;
+
private global::MonoDevelop.Components.FileEntry xmlDocsEntry;
+
private global::Gtk.Label label1;
+
private global::Gtk.Label label2;
+
private global::Gtk.Label label87;
+
private global::Gtk.Entry symbolsEntry;
+
private global::Gtk.Label label93;
+
private global::Gtk.HBox hbox48;
+
private global::Gtk.Label label73;
+
private global::Gtk.VBox vbox67;
+
private global::Gtk.HBox hbox60;
+
private global::Gtk.Label label85;
+
private global::Gtk.SpinButton warningLevelSpinButton;
+
private global::Gtk.HBox hbox3;
+
private global::Gtk.Label label86;
+
private global::Gtk.Entry ignoreWarningsEntry;
+
private global::Gtk.CheckButton warningsAsErrorsCheckButton;
+
private global::Gtk.HBox hbox5;
+
private global::Gtk.Label label74;
protected virtual void Build ()
diff --git a/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Project.CompilerOptionsPanelWidget.cs b/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Project.CompilerOptionsPanelWidget.cs
index 25f72f18b7..9c54345a54 100644
--- a/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Project.CompilerOptionsPanelWidget.cs
+++ b/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Project.CompilerOptionsPanelWidget.cs
@@ -2,32 +2,56 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.CSharp.Project
{
- public partial class CompilerOptionsPanelWidget
+ partial class CompilerOptionsPanelWidget
{
private global::Gtk.VBox vbox1;
+
private global::Gtk.Label label82;
+
private global::Gtk.HBox hbox5;
+
private global::Gtk.Label label76;
+
private global::Gtk.VBox vbox2;
+
private global::Gtk.Table table7;
+
private global::Gtk.ComboBoxEntry codepageEntry;
+
private global::Gtk.HBox hbox57;
+
private global::Gtk.ComboBox compileTargetCombo;
+
private global::MonoDevelop.Components.FileEntry iconEntry;
+
private global::Gtk.Label label1;
+
private global::Gtk.Label label3;
+
private global::Gtk.Label label86;
+
private global::Gtk.Label label88;
+
private global::Gtk.ComboBoxEntry mainClassEntry;
+
private global::Gtk.CheckButton noStdLibCheckButton;
+
private global::Gtk.Label label83;
+
private global::Gtk.Label label75;
+
private global::Gtk.HBox hbox7;
+
private global::Gtk.Label label74;
+
private global::Gtk.VBox vbox3;
+
private global::Gtk.Table table2;
+
private global::Gtk.Label label2;
+
private global::Gtk.ComboBox langVerCombo;
+
private global::Gtk.CheckButton allowUnsafeCodeCheckButton;
protected virtual void Build ()
@@ -104,6 +128,7 @@ namespace MonoDevelop.CSharp.Project
// Container child table7.Gtk.Table+TableChild
this.iconEntry = new global::MonoDevelop.Components.FileEntry ();
this.iconEntry.Name = "iconEntry";
+ this.iconEntry.DisplayAsRelativePath = false;
this.table7.Add (this.iconEntry);
global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table7 [this.iconEntry]));
w6.TopAttach = ((uint)(2));
diff --git a/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionEditRuleDialog.cs b/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionEditRuleDialog.cs
deleted file mode 100644
index e1b750e4a6..0000000000
--- a/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionEditRuleDialog.cs
+++ /dev/null
@@ -1,366 +0,0 @@
-
-// This file has been generated by the GUI designer. Do not modify.
-namespace MonoDevelop.CSharp.Refactoring.CodeIssues
-{
- internal partial class NameConventionEditRuleDialog
- {
- private global::Gtk.VBox vbox3;
- private global::Gtk.HBox hbox3;
- private global::Gtk.Label label4;
- private global::Gtk.Entry entryRuleName;
- private global::Gtk.HBox hbox1;
- private global::Gtk.Table table1;
- private global::Gtk.ScrolledWindow GtkScrolledWindow;
- private global::Gtk.TreeView treeviewEntities;
- private global::Gtk.ScrolledWindow GtkScrolledWindow1;
- private global::Gtk.TreeView treeviewAccessibility;
- private global::Gtk.Label label5;
- private global::Gtk.Label label6;
- private global::Gtk.Table table2;
- private global::Gtk.Entry entryPrefix;
- private global::Gtk.Entry entryPrefixAllowed;
- private global::Gtk.Entry entrySuffix;
- private global::Gtk.Label label1;
- private global::Gtk.Label label2;
- private global::Gtk.Label label3;
- private global::Gtk.Label label8;
- private global::Gtk.ComboBox styleComboBox;
- private global::Gtk.VBox vbox1;
- private global::Gtk.CheckButton checkbuttonStatic;
- private global::Gtk.CheckButton checkbuttonInstanceMembers;
- private global::Gtk.VBox vbox5;
- private global::Gtk.Label label9;
- private global::Gtk.Button buttonCancel;
- private global::Gtk.Button buttonOk;
-
- protected virtual void Build ()
- {
- global::Stetic.Gui.Initialize (this);
- // Widget MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionEditRuleDialog
- this.WidthRequest = 640;
- this.HeightRequest = 480;
- this.Name = "MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionEditRuleDialog";
- this.Title = global::Mono.Unix.Catalog.GetString ("Edit Naming Rule");
- this.WindowPosition = ((global::Gtk.WindowPosition)(4));
- this.Modal = true;
- this.Resizable = false;
- this.DestroyWithParent = true;
- this.SkipPagerHint = true;
- this.SkipTaskbarHint = true;
- // Internal child MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionEditRuleDialog.VBox
- global::Gtk.VBox w1 = this.VBox;
- w1.Name = "dialog1_VBox";
- w1.Spacing = 6;
- w1.BorderWidth = ((uint)(2));
- // Container child dialog1_VBox.Gtk.Box+BoxChild
- this.vbox3 = new global::Gtk.VBox ();
- this.vbox3.Name = "vbox3";
- this.vbox3.Spacing = 6;
- this.vbox3.BorderWidth = ((uint)(6));
- // Container child vbox3.Gtk.Box+BoxChild
- this.hbox3 = new global::Gtk.HBox ();
- this.hbox3.Name = "hbox3";
- this.hbox3.Spacing = 6;
- // Container child hbox3.Gtk.Box+BoxChild
- this.label4 = new global::Gtk.Label ();
- this.label4.Name = "label4";
- this.label4.Xalign = 1F;
- this.label4.LabelProp = global::Mono.Unix.Catalog.GetString ("_Rule:");
- this.label4.UseUnderline = true;
- this.hbox3.Add (this.label4);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.label4]));
- w2.Position = 0;
- w2.Expand = false;
- w2.Fill = false;
- w2.Padding = ((uint)(6));
- // Container child hbox3.Gtk.Box+BoxChild
- this.entryRuleName = new global::Gtk.Entry ();
- this.entryRuleName.CanFocus = true;
- this.entryRuleName.Name = "entryRuleName";
- this.entryRuleName.IsEditable = true;
- this.entryRuleName.InvisibleChar = '●';
- this.hbox3.Add (this.entryRuleName);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.entryRuleName]));
- w3.Position = 1;
- this.vbox3.Add (this.hbox3);
- global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox3]));
- w4.Position = 0;
- w4.Expand = false;
- w4.Fill = false;
- // Container child vbox3.Gtk.Box+BoxChild
- this.hbox1 = new global::Gtk.HBox ();
- this.hbox1.Name = "hbox1";
- this.hbox1.Spacing = 6;
- // Container child hbox1.Gtk.Box+BoxChild
- this.table1 = new global::Gtk.Table (((uint)(4)), ((uint)(2)), false);
- this.table1.RowSpacing = ((uint)(6));
- this.table1.ColumnSpacing = ((uint)(6));
- this.table1.BorderWidth = ((uint)(6));
- // Container child table1.Gtk.Table+TableChild
- this.GtkScrolledWindow = new global::Gtk.ScrolledWindow ();
- this.GtkScrolledWindow.Name = "GtkScrolledWindow";
- this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child GtkScrolledWindow.Gtk.Container+ContainerChild
- this.treeviewEntities = new global::Gtk.TreeView ();
- this.treeviewEntities.WidthRequest = 0;
- this.treeviewEntities.CanFocus = true;
- this.treeviewEntities.Name = "treeviewEntities";
- this.treeviewEntities.HeadersVisible = false;
- this.GtkScrolledWindow.Add (this.treeviewEntities);
- this.table1.Add (this.GtkScrolledWindow);
- global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1 [this.GtkScrolledWindow]));
- w6.TopAttach = ((uint)(1));
- w6.BottomAttach = ((uint)(2));
- w6.RightAttach = ((uint)(2));
- w6.YPadding = ((uint)(6));
- w6.XOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow ();
- this.GtkScrolledWindow1.Name = "GtkScrolledWindow1";
- this.GtkScrolledWindow1.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child GtkScrolledWindow1.Gtk.Container+ContainerChild
- this.treeviewAccessibility = new global::Gtk.TreeView ();
- this.treeviewAccessibility.CanFocus = true;
- this.treeviewAccessibility.Name = "treeviewAccessibility";
- this.treeviewAccessibility.HeadersVisible = false;
- this.GtkScrolledWindow1.Add (this.treeviewAccessibility);
- this.table1.Add (this.GtkScrolledWindow1);
- global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table1 [this.GtkScrolledWindow1]));
- w8.TopAttach = ((uint)(3));
- w8.BottomAttach = ((uint)(4));
- w8.XPadding = ((uint)(6));
- w8.YPadding = ((uint)(6));
- // Container child table1.Gtk.Table+TableChild
- this.label5 = new global::Gtk.Label ();
- this.label5.Name = "label5";
- this.label5.Xalign = 0F;
- this.label5.LabelProp = global::Mono.Unix.Catalog.GetString ("_Affected entities:");
- this.label5.UseUnderline = true;
- this.table1.Add (this.label5);
- global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table1 [this.label5]));
- w9.XOptions = ((global::Gtk.AttachOptions)(4));
- w9.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.label6 = new global::Gtk.Label ();
- this.label6.Name = "label6";
- this.label6.Xalign = 0F;
- this.label6.LabelProp = global::Mono.Unix.Catalog.GetString ("_Accessibility:");
- this.label6.UseUnderline = true;
- this.table1.Add (this.label6);
- global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table1 [this.label6]));
- w10.TopAttach = ((uint)(2));
- w10.BottomAttach = ((uint)(3));
- w10.XOptions = ((global::Gtk.AttachOptions)(4));
- w10.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table1.Gtk.Table+TableChild
- this.table2 = new global::Gtk.Table (((uint)(5)), ((uint)(2)), false);
- this.table2.Name = "table2";
- this.table2.RowSpacing = ((uint)(6));
- this.table2.ColumnSpacing = ((uint)(6));
- // Container child table2.Gtk.Table+TableChild
- this.entryPrefix = new global::Gtk.Entry ();
- this.entryPrefix.CanFocus = true;
- this.entryPrefix.Name = "entryPrefix";
- this.entryPrefix.IsEditable = true;
- this.entryPrefix.InvisibleChar = '●';
- this.table2.Add (this.entryPrefix);
- global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table2 [this.entryPrefix]));
- w11.TopAttach = ((uint)(1));
- w11.BottomAttach = ((uint)(2));
- w11.LeftAttach = ((uint)(1));
- w11.RightAttach = ((uint)(2));
- w11.XOptions = ((global::Gtk.AttachOptions)(4));
- w11.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table2.Gtk.Table+TableChild
- this.entryPrefixAllowed = new global::Gtk.Entry ();
- this.entryPrefixAllowed.CanFocus = true;
- this.entryPrefixAllowed.Name = "entryPrefixAllowed";
- this.entryPrefixAllowed.IsEditable = true;
- this.entryPrefixAllowed.InvisibleChar = '●';
- this.table2.Add (this.entryPrefixAllowed);
- global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table2 [this.entryPrefixAllowed]));
- w12.TopAttach = ((uint)(2));
- w12.BottomAttach = ((uint)(3));
- w12.LeftAttach = ((uint)(1));
- w12.RightAttach = ((uint)(2));
- w12.XOptions = ((global::Gtk.AttachOptions)(4));
- w12.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table2.Gtk.Table+TableChild
- this.entrySuffix = new global::Gtk.Entry ();
- this.entrySuffix.CanFocus = true;
- this.entrySuffix.Name = "entrySuffix";
- this.entrySuffix.IsEditable = true;
- this.entrySuffix.InvisibleChar = '●';
- this.table2.Add (this.entrySuffix);
- global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table2 [this.entrySuffix]));
- w13.TopAttach = ((uint)(3));
- w13.BottomAttach = ((uint)(4));
- w13.LeftAttach = ((uint)(1));
- w13.RightAttach = ((uint)(2));
- w13.XOptions = ((global::Gtk.AttachOptions)(4));
- w13.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table2.Gtk.Table+TableChild
- this.label1 = new global::Gtk.Label ();
- this.label1.Name = "label1";
- this.label1.Xalign = 1F;
- this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("Prefix:");
- this.table2.Add (this.label1);
- global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table2 [this.label1]));
- w14.TopAttach = ((uint)(1));
- w14.BottomAttach = ((uint)(2));
- w14.XOptions = ((global::Gtk.AttachOptions)(4));
- w14.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table2.Gtk.Table+TableChild
- this.label2 = new global::Gtk.Label ();
- this.label2.Name = "label2";
- this.label2.Xalign = 1F;
- this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Style:");
- this.table2.Add (this.label2);
- global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table2 [this.label2]));
- w15.XOptions = ((global::Gtk.AttachOptions)(4));
- w15.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table2.Gtk.Table+TableChild
- this.label3 = new global::Gtk.Label ();
- this.label3.Name = "label3";
- this.label3.Xalign = 1F;
- this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("Suffix:");
- this.table2.Add (this.label3);
- global::Gtk.Table.TableChild w16 = ((global::Gtk.Table.TableChild)(this.table2 [this.label3]));
- w16.TopAttach = ((uint)(3));
- w16.BottomAttach = ((uint)(4));
- w16.XOptions = ((global::Gtk.AttachOptions)(4));
- w16.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table2.Gtk.Table+TableChild
- this.label8 = new global::Gtk.Label ();
- this.label8.Name = "label8";
- this.label8.Xalign = 1F;
- this.label8.LabelProp = global::Mono.Unix.Catalog.GetString ("Optional Prefixes:");
- this.table2.Add (this.label8);
- global::Gtk.Table.TableChild w17 = ((global::Gtk.Table.TableChild)(this.table2 [this.label8]));
- w17.TopAttach = ((uint)(2));
- w17.BottomAttach = ((uint)(3));
- w17.XOptions = ((global::Gtk.AttachOptions)(4));
- w17.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table2.Gtk.Table+TableChild
- this.styleComboBox = global::Gtk.ComboBox.NewText ();
- this.styleComboBox.Name = "styleComboBox";
- this.table2.Add (this.styleComboBox);
- global::Gtk.Table.TableChild w18 = ((global::Gtk.Table.TableChild)(this.table2 [this.styleComboBox]));
- w18.LeftAttach = ((uint)(1));
- w18.RightAttach = ((uint)(2));
- w18.XOptions = ((global::Gtk.AttachOptions)(4));
- w18.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table2.Gtk.Table+TableChild
- this.vbox1 = new global::Gtk.VBox ();
- this.vbox1.Name = "vbox1";
- this.vbox1.Spacing = 6;
- // Container child vbox1.Gtk.Box+BoxChild
- this.checkbuttonStatic = new global::Gtk.CheckButton ();
- this.checkbuttonStatic.CanFocus = true;
- this.checkbuttonStatic.Name = "checkbuttonStatic";
- this.checkbuttonStatic.Label = global::Mono.Unix.Catalog.GetString ("_Static member and types");
- this.checkbuttonStatic.Active = true;
- this.checkbuttonStatic.DrawIndicator = true;
- this.checkbuttonStatic.UseUnderline = true;
- this.vbox1.Add (this.checkbuttonStatic);
- global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.checkbuttonStatic]));
- w19.Position = 0;
- w19.Expand = false;
- w19.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.checkbuttonInstanceMembers = new global::Gtk.CheckButton ();
- this.checkbuttonInstanceMembers.CanFocus = true;
- this.checkbuttonInstanceMembers.Name = "checkbuttonInstanceMembers";
- this.checkbuttonInstanceMembers.Label = global::Mono.Unix.Catalog.GetString ("_Instance members and locals");
- this.checkbuttonInstanceMembers.Active = true;
- this.checkbuttonInstanceMembers.DrawIndicator = true;
- this.checkbuttonInstanceMembers.UseUnderline = true;
- this.vbox1.Add (this.checkbuttonInstanceMembers);
- global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.checkbuttonInstanceMembers]));
- w20.Position = 1;
- w20.Expand = false;
- w20.Fill = false;
- this.table2.Add (this.vbox1);
- global::Gtk.Table.TableChild w21 = ((global::Gtk.Table.TableChild)(this.table2 [this.vbox1]));
- w21.TopAttach = ((uint)(4));
- w21.BottomAttach = ((uint)(5));
- w21.LeftAttach = ((uint)(1));
- w21.RightAttach = ((uint)(2));
- w21.XOptions = ((global::Gtk.AttachOptions)(4));
- // Container child table2.Gtk.Table+TableChild
- this.vbox5 = new global::Gtk.VBox ();
- this.vbox5.Name = "vbox5";
- this.vbox5.Spacing = 6;
- // Container child vbox5.Gtk.Box+BoxChild
- this.label9 = new global::Gtk.Label ();
- this.label9.Name = "label9";
- this.label9.Xalign = 0F;
- this.label9.LabelProp = global::Mono.Unix.Catalog.GetString ("Static/Non Static");
- this.vbox5.Add (this.label9);
- global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.label9]));
- w22.Position = 0;
- w22.Expand = false;
- w22.Fill = false;
- this.table2.Add (this.vbox5);
- global::Gtk.Table.TableChild w23 = ((global::Gtk.Table.TableChild)(this.table2 [this.vbox5]));
- w23.TopAttach = ((uint)(4));
- w23.BottomAttach = ((uint)(5));
- w23.XOptions = ((global::Gtk.AttachOptions)(4));
- this.table1.Add (this.table2);
- global::Gtk.Table.TableChild w24 = ((global::Gtk.Table.TableChild)(this.table1 [this.table2]));
- w24.TopAttach = ((uint)(2));
- w24.BottomAttach = ((uint)(4));
- w24.LeftAttach = ((uint)(1));
- w24.RightAttach = ((uint)(2));
- w24.XOptions = ((global::Gtk.AttachOptions)(4));
- w24.YOptions = ((global::Gtk.AttachOptions)(0));
- this.hbox1.Add (this.table1);
- global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.table1]));
- w25.Position = 0;
- this.vbox3.Add (this.hbox1);
- global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox1]));
- w26.Position = 1;
- w1.Add (this.vbox3);
- global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox3]));
- w27.Position = 0;
- w27.Padding = ((uint)(6));
- // Internal child MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionEditRuleDialog.ActionArea
- global::Gtk.HButtonBox w28 = this.ActionArea;
- w28.Name = "dialog1_ActionArea";
- w28.Spacing = 10;
- w28.BorderWidth = ((uint)(5));
- w28.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
- // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
- this.buttonCancel = new global::Gtk.Button ();
- this.buttonCancel.CanDefault = true;
- this.buttonCancel.CanFocus = true;
- this.buttonCancel.Name = "buttonCancel";
- this.buttonCancel.UseStock = true;
- this.buttonCancel.UseUnderline = true;
- this.buttonCancel.Label = "gtk-cancel";
- this.AddActionWidget (this.buttonCancel, -6);
- global::Gtk.ButtonBox.ButtonBoxChild w29 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w28 [this.buttonCancel]));
- w29.Expand = false;
- w29.Fill = false;
- // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
- this.buttonOk = new global::Gtk.Button ();
- this.buttonOk.CanDefault = true;
- this.buttonOk.CanFocus = true;
- this.buttonOk.Name = "buttonOk";
- this.buttonOk.UseStock = true;
- this.buttonOk.UseUnderline = true;
- this.buttonOk.Label = "gtk-ok";
- this.AddActionWidget (this.buttonOk, -5);
- global::Gtk.ButtonBox.ButtonBoxChild w30 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w28 [this.buttonOk]));
- w30.Position = 1;
- w30.Expand = false;
- w30.Fill = false;
- if ((this.Child != null)) {
- this.Child.ShowAll ();
- }
- this.DefaultWidth = 804;
- this.DefaultHeight = 508;
- this.Show ();
- }
- }
-}
diff --git a/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionPanelWidget.cs b/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionPanelWidget.cs
deleted file mode 100644
index c508c70e70..0000000000
--- a/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionPanelWidget.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-
-// This file has been generated by the GUI designer. Do not modify.
-namespace MonoDevelop.CSharp.Refactoring.CodeIssues
-{
- public partial class NameConventionPanelWidget
- {
- private global::Gtk.HBox hbox3;
- private global::Gtk.ScrolledWindow GtkScrolledWindow;
- private global::Gtk.TreeView treeviewConventions;
- private global::Gtk.VBox vbox3;
- private global::Gtk.Button buttonEdit;
- private global::Gtk.Button buttonAdd;
- private global::Gtk.Button buttonRemove;
-
- protected virtual void Build ()
- {
- global::Stetic.Gui.Initialize (this);
- // Widget MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionPanelWidget
- global::Stetic.BinContainer.Attach (this);
- this.Name = "MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionPanelWidget";
- // Container child MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionPanelWidget.Gtk.Container+ContainerChild
- this.hbox3 = new global::Gtk.HBox ();
- this.hbox3.Name = "hbox3";
- this.hbox3.Spacing = 6;
- // Container child hbox3.Gtk.Box+BoxChild
- this.GtkScrolledWindow = new global::Gtk.ScrolledWindow ();
- this.GtkScrolledWindow.Name = "GtkScrolledWindow";
- this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child GtkScrolledWindow.Gtk.Container+ContainerChild
- this.treeviewConventions = new global::Gtk.TreeView ();
- this.treeviewConventions.CanFocus = true;
- this.treeviewConventions.Name = "treeviewConventions";
- this.GtkScrolledWindow.Add (this.treeviewConventions);
- this.hbox3.Add (this.GtkScrolledWindow);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.GtkScrolledWindow]));
- w2.Position = 0;
- // Container child hbox3.Gtk.Box+BoxChild
- this.vbox3 = new global::Gtk.VBox ();
- this.vbox3.Name = "vbox3";
- this.vbox3.Spacing = 6;
- // Container child vbox3.Gtk.Box+BoxChild
- this.buttonEdit = new global::Gtk.Button ();
- this.buttonEdit.CanFocus = true;
- this.buttonEdit.Name = "buttonEdit";
- this.buttonEdit.UseStock = true;
- this.buttonEdit.UseUnderline = true;
- this.buttonEdit.Label = "gtk-edit";
- this.vbox3.Add (this.buttonEdit);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.buttonEdit]));
- w3.Position = 0;
- w3.Expand = false;
- w3.Fill = false;
- // Container child vbox3.Gtk.Box+BoxChild
- this.buttonAdd = new global::Gtk.Button ();
- this.buttonAdd.CanFocus = true;
- this.buttonAdd.Name = "buttonAdd";
- this.buttonAdd.UseStock = true;
- this.buttonAdd.UseUnderline = true;
- this.buttonAdd.Label = "gtk-add";
- this.vbox3.Add (this.buttonAdd);
- global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.buttonAdd]));
- w4.Position = 1;
- w4.Expand = false;
- w4.Fill = false;
- // Container child vbox3.Gtk.Box+BoxChild
- this.buttonRemove = new global::Gtk.Button ();
- this.buttonRemove.CanFocus = true;
- this.buttonRemove.Name = "buttonRemove";
- this.buttonRemove.UseStock = true;
- this.buttonRemove.UseUnderline = true;
- this.buttonRemove.Label = "gtk-remove";
- this.vbox3.Add (this.buttonRemove);
- global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.buttonRemove]));
- w5.Position = 2;
- w5.Expand = false;
- w5.Fill = false;
- this.hbox3.Add (this.vbox3);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.vbox3]));
- w6.Position = 1;
- w6.Expand = false;
- w6.Fill = false;
- this.Add (this.hbox3);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
- }
- this.Hide ();
- }
- }
-}
diff --git a/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CodeGeneration.GenerateCodeWindow.cs b/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CodeGeneration.GenerateCodeWindow.cs
index 8654054487..47844e948e 100644
--- a/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CodeGeneration.GenerateCodeWindow.cs
+++ b/main/src/addins/CSharpBinding/gtk-gui/MonoDevelop.CodeGeneration.GenerateCodeWindow.cs
@@ -2,12 +2,16 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.CodeGeneration
{
- public partial class GenerateCodeWindow
+ partial class GenerateCodeWindow
{
private global::Gtk.VBox vbox1;
+
private global::Gtk.Label label2;
+
private global::Gtk.ScrolledWindow scrolledwindow1;
+
private global::Gtk.Label labelDescription;
+
private global::Gtk.ScrolledWindow scrolledwindow2;
protected virtual void Build ()
diff --git a/main/src/addins/CSharpBinding/gtk-gui/generated.cs b/main/src/addins/CSharpBinding/gtk-gui/generated.cs
index 3285e87c05..a89ced9baf 100644
--- a/main/src/addins/CSharpBinding/gtk-gui/generated.cs
+++ b/main/src/addins/CSharpBinding/gtk-gui/generated.cs
@@ -1,3 +1,4 @@
+#pragma warning disable 436
// This file has been generated by the GUI designer. Do not modify.
namespace Stetic
@@ -6,9 +7,10 @@ namespace Stetic
{
private static bool initialized;
- internal static void Initialize (Gtk.Widget iconRenderer)
+ internal static void Initialize(Gtk.Widget iconRenderer)
{
- if ((Stetic.Gui.initialized == false)) {
+ if ((Stetic.Gui.initialized == false))
+ {
Stetic.Gui.initialized = true;
}
}
diff --git a/main/src/addins/CSharpBinding/gtk-gui/gui.stetic b/main/src/addins/CSharpBinding/gtk-gui/gui.stetic
index ea86d2e379..ad4c8e592a 100644
--- a/main/src/addins/CSharpBinding/gtk-gui/gui.stetic
+++ b/main/src/addins/CSharpBinding/gtk-gui/gui.stetic
@@ -6,9 +6,7 @@
</configuration>
<import>
<widget-library name="../../../../build/bin/MonoDevelop.Ide.dll" />
- <widget-library name="../../../../build/bin/Mono.TextEditor.dll" />
<widget-library name="../../../../build/AddIns/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.dll" />
- <widget-library name="../../../../build/AddIns/DisplayBindings/SourceEditor/MonoDevelop.SourceEditor2.dll" />
<widget-library name="../../../../build/AddIns/MonoDevelop.Refactoring/MonoDevelop.Refactoring.dll" />
<widget-library name="../../../../build/AddIns/NUnit/MonoDevelop.NUnit.dll" />
<widget-library name="../../../../build/AddIns/BackendBindings/MonoDevelop.CSharpBinding.dll" internal="true" />
@@ -514,6 +512,7 @@ None</property>
</widget>
<widget class="Gtk.Bin" id="MonoDevelop.CSharp.Project.CompilerOptionsPanelWidget" design-size="471 438">
<property name="MemberName" />
+ <property name="GeneratePublic">False</property>
<child>
<widget class="Gtk.VBox" id="vbox1">
<property name="MemberName" />
@@ -1196,7 +1195,7 @@ None</property>
<child>
<widget class="Gtk.Label" id="label8">
<property name="MemberName" />
- <property name="LabelProp" translatable="yes">page1</property>
+ <property name="LabelProp" translatable="yes">Indentation</property>
</widget>
<packing>
<property name="type">tab</property>
@@ -1207,7 +1206,7 @@ None</property>
<property name="MemberName" />
<property name="ShadowType">In</property>
<child>
- <widget class="Gtk.TreeView" id="treeviewBracePositions">
+ <widget class="Gtk.TreeView" id="treeviewNewLines">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="ShowScrollbars">True</property>
@@ -1221,525 +1220,18 @@ None</property>
<child>
<widget class="Gtk.Label" id="label9">
<property name="MemberName" />
- <property name="LabelProp" translatable="yes">page2</property>
+ <property name="LabelProp" translatable="yes">NewLines</property>
</widget>
<packing>
<property name="type">tab</property>
</packing>
</child>
<child>
- <widget class="Gtk.Table" id="table4">
- <property name="MemberName" />
- <property name="NRows">12</property>
- <property name="NColumns">3</property>
- <property name="RowSpacing">6</property>
- <property name="ColumnSpacing">6</property>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <placeholder />
- </child>
- <child>
- <widget class="Gtk.Entry" id="entryAfterUsings">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="IsEditable">True</property>
- <property name="WidthChars">5</property>
- <property name="InvisibleChar">●</property>
- </widget>
- <packing>
- <property name="TopAttach">2</property>
- <property name="BottomAttach">3</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">False</property>
- <property name="XOptions">Shrink</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">False</property>
- <property name="XShrink">True</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Entry" id="entryAroundRegion">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="IsEditable">True</property>
- <property name="WidthChars">5</property>
- <property name="InvisibleChar">●</property>
- </widget>
- <packing>
- <property name="TopAttach">10</property>
- <property name="BottomAttach">11</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">False</property>
- <property name="XOptions">0</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">False</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Entry" id="entryBeforeFirstDeclaration">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="IsEditable">True</property>
- <property name="WidthChars">5</property>
- <property name="InvisibleChar">●</property>
- </widget>
- <packing>
- <property name="TopAttach">4</property>
- <property name="BottomAttach">5</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">False</property>
- <property name="XOptions">0</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">False</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Entry" id="entryBeforUsings">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="IsEditable">True</property>
- <property name="WidthChars">5</property>
- <property name="InvisibleChar">●</property>
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">False</property>
- <property name="XOptions">Shrink</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">False</property>
- <property name="XShrink">True</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Entry" id="entryBetweenEvents">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="IsEditable">True</property>
- <property name="WidthChars">5</property>
- <property name="InvisibleChar">●</property>
- </widget>
- <packing>
- <property name="TopAttach">8</property>
- <property name="BottomAttach">9</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">False</property>
- <property name="XOptions">0</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">False</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Entry" id="entryBetweenFields">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="IsEditable">True</property>
- <property name="WidthChars">5</property>
- <property name="InvisibleChar">●</property>
- </widget>
- <packing>
- <property name="TopAttach">7</property>
- <property name="BottomAttach">8</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">False</property>
- <property name="XOptions">0</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">False</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Entry" id="entryBetweenMembers">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="IsEditable">True</property>
- <property name="WidthChars">5</property>
- <property name="InvisibleChar">●</property>
- </widget>
- <packing>
- <property name="TopAttach">9</property>
- <property name="BottomAttach">10</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">False</property>
- <property name="XOptions">0</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">False</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Entry" id="entryBetweenTypes">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="IsEditable">True</property>
- <property name="WidthChars">5</property>
- <property name="InvisibleChar">●</property>
- </widget>
- <packing>
- <property name="TopAttach">5</property>
- <property name="BottomAttach">6</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">False</property>
- <property name="XOptions">0</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">False</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Entry" id="entryInsideRegion">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="IsEditable">True</property>
- <property name="WidthChars">5</property>
- <property name="InvisibleChar">●</property>
- </widget>
- <packing>
- <property name="TopAttach">11</property>
- <property name="BottomAttach">12</property>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">False</property>
- <property name="XOptions">0</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">False</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="GtkLabel8">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">&lt;b&gt;Minimum blank lines in namespaces&lt;/b&gt;</property>
- <property name="UseMarkup">True</property>
- </widget>
- <packing>
- <property name="TopAttach">3</property>
- <property name="BottomAttach">4</property>
- <property name="RightAttach">3</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="GtkLabel9">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">&lt;b&gt;Minimum blank lines in types&lt;/b&gt;</property>
- <property name="UseMarkup">True</property>
- </widget>
- <packing>
- <property name="TopAttach">6</property>
- <property name="BottomAttach">7</property>
- <property name="RightAttach">3</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label1">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">&lt;b&gt;Minimum blank lines in compilation unit&lt;/b&gt;</property>
- <property name="UseMarkup">True</property>
- </widget>
- <packing>
- <property name="RightAttach">3</property>
- <property name="AutoSize">False</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">True</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label15">
- <property name="MemberName" />
- <property name="Xalign">1</property>
- <property name="LabelProp" translatable="yes">Before using declaration:</property>
- </widget>
- <packing>
- <property name="TopAttach">1</property>
- <property name="BottomAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label16">
- <property name="MemberName" />
- <property name="Xalign">1</property>
- <property name="LabelProp" translatable="yes">After using declaration:</property>
- </widget>
- <packing>
- <property name="TopAttach">2</property>
- <property name="BottomAttach">3</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label19">
- <property name="MemberName" />
- <property name="Xalign">1</property>
- <property name="LabelProp" translatable="yes">Between type declarations:</property>
- </widget>
- <packing>
- <property name="TopAttach">5</property>
- <property name="BottomAttach">6</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label20">
- <property name="MemberName" />
- <property name="Xalign">1</property>
- <property name="LabelProp" translatable="yes">Before first declaration:</property>
- </widget>
- <packing>
- <property name="TopAttach">4</property>
- <property name="BottomAttach">5</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label21">
- <property name="MemberName" />
- <property name="Xalign">1</property>
- <property name="LabelProp" translatable="yes">Between field declarations:</property>
- </widget>
- <packing>
- <property name="TopAttach">7</property>
- <property name="BottomAttach">8</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label22">
- <property name="MemberName" />
- <property name="Xalign">1</property>
- <property name="LabelProp" translatable="yes">Between other member declarations:</property>
- </widget>
- <packing>
- <property name="TopAttach">9</property>
- <property name="BottomAttach">10</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label23">
- <property name="MemberName" />
- <property name="Xalign">1</property>
- <property name="LabelProp" translatable="yes">Between simple event declarations:</property>
- </widget>
- <packing>
- <property name="TopAttach">8</property>
- <property name="BottomAttach">9</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label24">
- <property name="MemberName" />
- <property name="Xalign">1</property>
- <property name="LabelProp" translatable="yes">Around region:</property>
- </widget>
- <packing>
- <property name="TopAttach">10</property>
- <property name="BottomAttach">11</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label25">
- <property name="MemberName" />
- <property name="Xalign">1</property>
- <property name="LabelProp" translatable="yes">Inside region:</property>
- </widget>
- <packing>
- <property name="TopAttach">11</property>
- <property name="BottomAttach">12</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="Position">2</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label14">
- <property name="MemberName" />
- <property name="LabelProp" translatable="yes">page5</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow3">
+ <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow5">
<property name="MemberName" />
<property name="ShadowType">In</property>
<child>
- <widget class="Gtk.TreeView" id="treeviewWrappingCategory">
+ <widget class="Gtk.TreeView" id="treeviewSpacing">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="ShowScrollbars">True</property>
@@ -1747,13 +1239,13 @@ None</property>
</child>
</widget>
<packing>
- <property name="Position">3</property>
+ <property name="Position">2</property>
</packing>
</child>
<child>
- <widget class="Gtk.Label" id="label2">
+ <widget class="Gtk.Label" id="label14">
<property name="MemberName" />
- <property name="LabelProp" translatable="yes">page6</property>
+ <property name="LabelProp" translatable="yes">Spacing</property>
</widget>
<packing>
<property name="type">tab</property>
@@ -1764,7 +1256,7 @@ None</property>
<property name="MemberName" />
<property name="ShadowType">In</property>
<child>
- <widget class="Gtk.TreeView" id="treeviewInsertWhiteSpaceCategory">
+ <widget class="Gtk.TreeView" id="treeviewWrapping">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="ShowScrollbars">True</property>
@@ -1772,24 +1264,24 @@ None</property>
</child>
</widget>
<packing>
- <property name="Position">4</property>
+ <property name="Position">3</property>
</packing>
</child>
<child>
<widget class="Gtk.Label" id="label10">
<property name="MemberName" />
- <property name="LabelProp" translatable="yes">page3</property>
+ <property name="LabelProp" translatable="yes">Wrapping</property>
</widget>
<packing>
<property name="type">tab</property>
</packing>
</child>
<child>
- <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow4">
+ <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow3">
<property name="MemberName" />
<property name="ShadowType">In</property>
<child>
- <widget class="Gtk.TreeView" id="treeviewNewLines">
+ <widget class="Gtk.TreeView" id="treeviewStyle">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="ShowScrollbars">True</property>
@@ -1797,13 +1289,13 @@ None</property>
</child>
</widget>
<packing>
- <property name="Position">5</property>
+ <property name="Position">4</property>
</packing>
</child>
<child>
- <widget class="Gtk.Label" id="label11">
+ <widget class="Gtk.Label" id="label2">
<property name="MemberName" />
- <property name="LabelProp" translatable="yes">page4</property>
+ <property name="LabelProp" translatable="yes">Style</property>
</widget>
<packing>
<property name="type">tab</property>
@@ -1916,9 +1408,10 @@ None</property>
</widget>
</child>
</widget>
- <widget class="Gtk.Bin" id="MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionPanelWidget" design-size="300 300">
+ <widget class="Gtk.Bin" id="MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionPanelWidget" design-size="300 300">
<property name="MemberName" />
<property name="Visible">False</property>
+ <property name="GeneratePublic">False</property>
<child>
<widget class="Gtk.HBox" id="hbox3">
<property name="MemberName" />
@@ -2085,7 +1578,7 @@ None</property>
</widget>
</child>
</widget>
- <widget class="Gtk.Dialog" id="MonoDevelop.CSharp.Refactoring.CodeIssues.NameConventionEditRuleDialog" design-size="804 508">
+ <widget class="Gtk.Dialog" id="MonoDevelop.CSharp.Diagnostics.InconsistentNaming.NameConventionEditRuleDialog" design-size="804 508">
<property name="MemberName" />
<property name="WidthRequest">640</property>
<property name="HeightRequest">480</property>
@@ -2609,4 +2102,190 @@ None</property>
</widget>
</child>
</widget>
+ <widget class="Gtk.Dialog" id="MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog" design-size="424 367">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <property name="GeneratePublic">False</property>
+ <property name="Title" translatable="yes">Document Outline Preferences</property>
+ <property name="WindowPosition">CenterOnParent</property>
+ <property name="Modal">True</property>
+ <property name="DestroyWithParent">True</property>
+ <property name="Buttons">2</property>
+ <property name="HelpButton">False</property>
+ <child internal-child="VBox">
+ <widget class="Gtk.VBox" id="dialog1_VBox">
+ <property name="MemberName" />
+ <property name="BorderWidth">2</property>
+ <child>
+ <widget class="Gtk.VBox" id="vbox2">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <property name="BorderWidth">6</property>
+ <child>
+ <widget class="Gtk.Label" id="label">
+ <property name="MemberName" />
+ <property name="WidthRequest">400</property>
+ <property name="LabelProp" translatable="yes">Group sorting order when grouping is enabled:</property>
+ <property name="Wrap">True</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="MonoDevelop.Ide.Gui.Components.PriorityList" id="priorityList">
+ <property name="MemberName" />
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ <child internal-child="ActionArea">
+ <widget class="Gtk.HButtonBox" id="dialog1_ActionArea">
+ <property name="MemberName" />
+ <property name="Spacing">10</property>
+ <property name="BorderWidth">5</property>
+ <property name="Size">2</property>
+ <property name="LayoutStyle">End</property>
+ <child>
+ <widget class="Gtk.Button" id="buttonCancel">
+ <property name="MemberName" />
+ <property name="CanDefault">True</property>
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-cancel</property>
+ <property name="ResponseId">-6</property>
+ <property name="label">gtk-cancel</property>
+ </widget>
+ <packing>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="buttonOk">
+ <property name="MemberName" />
+ <property name="CanDefault">True</property>
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-ok</property>
+ <property name="ResponseId">-5</property>
+ <property name="label">gtk-ok</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="Gtk.Dialog" id="MonoDevelop.CSharp.ClassOutline.OutlineSortingPreferencesDialog" design-size="424 367">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <property name="GeneratePublic">False</property>
+ <property name="Title" translatable="yes">Document Outline Preferences</property>
+ <property name="WindowPosition">CenterOnParent</property>
+ <property name="Modal">True</property>
+ <property name="DestroyWithParent">True</property>
+ <property name="Buttons">2</property>
+ <property name="HelpButton">False</property>
+ <child internal-child="VBox">
+ <widget class="Gtk.VBox" id="dialog1_VBox">
+ <property name="MemberName" />
+ <property name="BorderWidth">2</property>
+ <child>
+ <widget class="Gtk.VBox" id="vbox2">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <property name="BorderWidth">6</property>
+ <child>
+ <widget class="Gtk.Label" id="label">
+ <property name="MemberName" />
+ <property name="WidthRequest">400</property>
+ <property name="LabelProp" translatable="yes">Group sorting order when grouping is enabled:</property>
+ <property name="Wrap">True</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="MonoDevelop.Ide.Gui.Components.PriorityList" id="priorityList">
+ <property name="MemberName" />
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ <child internal-child="ActionArea">
+ <widget class="Gtk.HButtonBox" id="dialog1_ActionArea">
+ <property name="MemberName" />
+ <property name="Spacing">10</property>
+ <property name="BorderWidth">5</property>
+ <property name="Size">2</property>
+ <property name="LayoutStyle">End</property>
+ <child>
+ <widget class="Gtk.Button" id="buttonCancel">
+ <property name="MemberName" />
+ <property name="CanDefault">True</property>
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-cancel</property>
+ <property name="ResponseId">-6</property>
+ <property name="label">gtk-cancel</property>
+ </widget>
+ <packing>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="buttonOk">
+ <property name="MemberName" />
+ <property name="CanDefault">True</property>
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-ok</property>
+ <property name="ResponseId">-5</property>
+ <property name="label">gtk-ok</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
</stetic-interface> \ No newline at end of file
diff --git a/main/src/addins/CSharpBinding/templates/AssemblyInfo.xft.xml b/main/src/addins/CSharpBinding/templates/AssemblyInfo.xft.xml
index 699f2f2e79..e63409d17b 100644
--- a/main/src/addins/CSharpBinding/templates/AssemblyInfo.xft.xml
+++ b/main/src/addins/CSharpBinding/templates/AssemblyInfo.xft.xml
@@ -8,7 +8,7 @@
<TemplateConfiguration>
<_Name>Assembly Information</_Name>
<_Category>Misc</_Category>
- <Icon>md-file-source</Icon>
+ <Icon>md-file-information</Icon>
<LanguageName>C#</LanguageName>
<DefaultFilename IsFixed="True">AssemblyInfo.cs</DefaultFilename>
<_Description>A file defining assembly information attributes.</_Description>
diff --git a/main/src/addins/CSharpBinding/templates/PortableLibrary.xpt.xml b/main/src/addins/CSharpBinding/templates/PortableLibrary.xpt.xml
index f09a65c7f1..dd2b17ed3d 100644
--- a/main/src/addins/CSharpBinding/templates/PortableLibrary.xpt.xml
+++ b/main/src/addins/CSharpBinding/templates/PortableLibrary.xpt.xml
@@ -12,6 +12,7 @@
<LanguageName>C#</LanguageName>
<_Description>Creates a C# library that can be used in Windows, Mac, Silverlight, Windows Phone, Xamarin.iOS and Xamarin.Android.</_Description>
<DefaultFilename>PortableLibrary</DefaultFilename>
+ <GroupId>md-project-portable-library</GroupId>
</TemplateConfiguration>
<!-- Actions -->
@@ -25,7 +26,7 @@
<StartupProject>${ProjectName}</StartupProject>
</Options>
- <Project name = "${ProjectName}" directory = "." type = "PortableDotNet">
+ <Project name = "${ProjectName}" directory = "." type="C#PortableLibrary">
<Options Target = "Library" TargetFrameworkVersion = ".NETPortable,Version=v4.5,Profile=Profile78"/>
<References>
</References>
diff --git a/main/src/addins/CSharpBinding/templates/SharedAssetsProject.xpt.xml b/main/src/addins/CSharpBinding/templates/SharedAssetsProject.xpt.xml
index 6f2f0a7584..1a9bdef4a5 100644
--- a/main/src/addins/CSharpBinding/templates/SharedAssetsProject.xpt.xml
+++ b/main/src/addins/CSharpBinding/templates/SharedAssetsProject.xpt.xml
@@ -11,6 +11,7 @@
<Image id="md-shared-project" />
<_Description>Creates a project that allows sharing files between projects</_Description>
<DefaultFilename>Shared</DefaultFilename>
+ <GroupId>md-project-shared-library</GroupId>
<LanguageName>C#</LanguageName>
</TemplateConfiguration>
diff --git a/main/src/addins/ChangeLog b/main/src/addins/ChangeLog
deleted file mode 100644
index 2b4c0b8ec8..0000000000
--- a/main/src/addins/ChangeLog
+++ /dev/null
@@ -1,183 +0,0 @@
-2010-06-17 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am: Adding DocFood to the solution/build system.
-
-2010-06-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DocFood: Checked in doc food addin.
-
-2010-02-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Moved diff widget and algorithm to
- MonoDevelop.Components.
-
-2009-11-18 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am: Added hex editor display binding.
-
-2009-11-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.HexEditor: Added hex editor display binding.
-
-2009-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Wire the soft debug addin into the build.
-
-2009-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.Soft: Moved soft debug addin from
- extras.
-
-2009-08-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * TextTemplating: Include the ASP.NET MVC and TextTemplating
- addins in the main solution and build.
-
-2009-08-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am, AspNetAddin, AspNet: Move ASP.NET into a
- subdirectory and rename, in preparation for adding the MVC addin.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Fix build order.
-
-2009-07-22 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am: Fixed makefile.
-
-2009-07-03 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am: Corrected makefile.
-
-2009-07-01 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am: Moved refactoring support to an own assembly.
-
-2009-07-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring: Moved refactoring support to an own
- assembly.
-
-2009-06-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Fix build order. Version control now depends on
- the source editor.
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.Texteditor:
- * Mono.Texteditor/Styles:
- * Mono.Texteditor/gtk-gui:
- * Mono.Texteditor/ChangeLog:
- * Mono.Texteditor/Makefile.am:
- * Mono.Texteditor/SyntaxModes:
- * Mono.Texteditor/AssemblyInfo.cs:
- * Mono.Texteditor/Mono.TextEditor:
- * Mono.Texteditor/gtk-gui/gui.stetic:
- * Mono.Texteditor/Mono.TextEditor.Vi:
- * Mono.Texteditor/Styles/C64Style.xml:
- * Mono.Texteditor/gtk-gui/objects.xml:
- * Mono.Texteditor/gtk-gui/generated.cs:
- * Mono.Texteditor/Styles/BrownStyle.xml:
- * Mono.Texteditor/Mono.TextEditor.csproj:
- * Mono.Texteditor/ChangelogSyntaxMode.xml:
- * Mono.Texteditor/Mono.TextEditor/Caret.cs:
- * Mono.Texteditor/Styles/OblivionStyle.xml:
- * Mono.Texteditor/Mono.TextEditor/Margin.cs:
- * Mono.Texteditor/Styles/TangoLightStyle.xml:
- * Mono.Texteditor/Mono.TextEditor/IBuffer.cs:
- * Mono.Texteditor/Mono.TextEditor/Segment.cs:
- * Mono.Texteditor/Mono.TextEditor/EditMode.cs:
- * Mono.Texteditor/SyntaxModes/CSyntaxMode.xml:
- * Mono.Texteditor/Mono.TextEditor/ISegment.cs:
- * Mono.Texteditor/Mono.TextEditor/Document.cs:
- * Mono.Texteditor/Mono.TextEditor.Vi/ViMode.cs:
- * Mono.Texteditor/Mono.TextEditor.Highlighting:
- * Mono.Texteditor/Styles/VisualStudioStyle.xml:
- * Mono.Texteditor/Mono.TextEditor/GapBuffer.cs:
- * Mono.Texteditor/Mono.TextEditor/TextEditor.cs:
- * Mono.Texteditor/SyntaxModes/CPPSyntaxMode.xml:
- * Mono.Texteditor/Mono.TextEditor/IconMargin.cs:
- * Mono.Texteditor/Mono.TextEditor/TextMarker.cs:
- * Mono.Texteditor/SyntaxModes/BooSyntaxMode.xml:
- * Mono.Texteditor/SyntaxModes/XmlSyntaxMode.xml:
- * Mono.Texteditor/SyntaxModes/DiffSyntaxMode.xml:
- * Mono.Texteditor/Mono.TextEditor/FoldingType.cs:
- * Mono.Texteditor/Mono.TextEditor/FoldSegment.cs:
- * Mono.Texteditor/SyntaxModes/ValaSyntaxMode.xml:
- * Mono.Texteditor/SyntaxModes/JavaSyntaxMode.xml:
- * Mono.Texteditor/Mono.TextEditor/LineSegment.cs:
- * Mono.Texteditor/Mono.TextEditor/RedBlackTree.cs:
- * Mono.Texteditor/Mono.TextEditor/SearchResult.cs:
- * Mono.Texteditor/Mono.TextEditor.Vi/ViActions.cs:
- * Mono.Texteditor/SyntaxModes/VBNetSyntaxMode.xml:
- * Mono.Texteditor/Mono.TextEditor/GutterMargin.cs:
- * Mono.Texteditor/Mono.TextEditor/LineSplitter.cs:
- * Mono.Texteditor/Mono.TextEditor/HelperMethods.cs:
- * Mono.Texteditor/SyntaxModes/PythonSyntaxMode.xml:
- * Mono.Texteditor/SyntaxModes/CSharpSyntaxMode.xml:
- * Mono.Texteditor/Mono.TextEditor/LinkEventArgs.cs:
- * Mono.Texteditor/Mono.TextEditor/DeleteActions.cs:
- * Mono.Texteditor/Mono.TextEditor/LineEventArgs.cs:
- * Mono.Texteditor/Mono.TextEditor/SearchRequest.cs:
- * Mono.Texteditor/Mono.TextEditor/ISearchEngine.cs:
- * Mono.Texteditor/SyntaxModes/AspNetSyntaxMode.xml:
- * Mono.Texteditor/Mono.TextEditor/TextEditorData.cs:
- * Mono.Texteditor/Mono.TextEditor/SimpleEditMode.cs:
- * Mono.Texteditor/Mono.TextEditor/BookmarkMarker.cs:
- * Mono.Texteditor/Mono.TextEditor/TextViewMargin.cs:
- * Mono.Texteditor/Mono.TextEditor/LineSegmentTree.cs:
- * Mono.Texteditor/Mono.TextEditor.Vi/ViActionMaps.cs:
- * Mono.Texteditor/SyntaxModes/MakefileSyntaxMode.xml:
- * Mono.Texteditor/Mono.TextEditor/BookmarkActions.cs:
- * Mono.Texteditor/Mono.TextEditor/ReplaceEventArgs.cs:
- * Mono.Texteditor/SyntaxModes/ChangeLogSyntaxMode.xml:
- * Mono.Texteditor/Mono.TextEditor/ITooltipProvider.cs:
- * Mono.Texteditor/Mono.TextEditor/DocumentLocation.cs:
- * Mono.Texteditor/Mono.TextEditor/CaretMoveActions.cs:
- * Mono.Texteditor/Mono.TextEditor/FoldMarkerMargin.cs:
- * Mono.Texteditor/Mono.TextEditor/ClipboardActions.cs:
- * Mono.Texteditor/Mono.TextEditor/SelectionActions.cs:
- * Mono.Texteditor/SyntaxModes/JavascriptSyntaxMode.xml:
- * Mono.Texteditor/Mono.TextEditor/IWordFindStrategy.cs:
- * Mono.Texteditor/Mono.TextEditor/TextEditorOptions.cs:
- * Mono.Texteditor/Mono.TextEditor.Highlighting/Rule.cs:
- * Mono.Texteditor/Mono.TextEditor.Highlighting/Span.cs:
- * Mono.Texteditor/Mono.TextEditor/DefaultEditActions.cs:
- * Mono.Texteditor/Mono.TextEditor.Highlighting/Style.cs:
- * Mono.Texteditor/Mono.TextEditor.Highlighting/Match.cs:
- * Mono.Texteditor/Mono.TextEditor/BufferedTextReader.cs:
- * Mono.Texteditor/Mono.TextEditor.Highlighting/Chunk.cs:
- * Mono.Texteditor/Mono.TextEditor/ITextEditorOptions.cs:
- * Mono.Texteditor/Mono.TextEditor.Highlighting/Marker.cs:
- * Mono.Texteditor/Mono.TextEditor/EmacsWordFindStrategy.cs:
- * Mono.Texteditor/Mono.TextEditor.Highlighting/Keywords.cs:
- * Mono.Texteditor/Mono.TextEditor/DocumentUpdateRequest.cs:
- * Mono.Texteditor/Mono.TextEditor.Highlighting/ChunkStyle.cs:
- * Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.Texteditor/Mono.TextEditor/CodeSegmentPreviewWindow.cs:
- * Mono.Texteditor/Mono.TextEditor.Highlighting/IXmlProvider.cs:
- * Mono.Texteditor/Mono.TextEditor.Highlighting/WorkerThread.cs:
- * Mono.Texteditor/Mono.TextEditor.Highlighting/DefaultStyle.cs:
- * Mono.Texteditor/Mono.TextEditor.Highlighting/SemanticRule.cs:
- * Mono.Texteditor/Mono.TextEditor.Highlighting/XmlReadHelper.cs:
- * Mono.Texteditor/Mono.TextEditor/SharpDevelopWordFindStrategy.cs:
- * Mono.Texteditor/Mono.TextEditor.Highlighting/MarkupSyntaxMode.cs:
- * Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs:
- * Mono.Texteditor/Mono.TextEditor.Highlighting/ReferencedChunkStyle.cs:
- Moved text editor to core
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * Addins.mds: Migrated to MSBuild file format.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MacPlatform/AssemblyInfo.cs:
- * WindowsPlatform/AssemblyInfo.cs:
- * MacPlatform/MacPlatform.addin.xml:
- * WindowsPlatform/WindowsPlatform.addin.xml: Bump MD version.
-
diff --git a/main/src/addins/ChangeLogAddIn/AddLogEntryDialog.cs b/main/src/addins/ChangeLogAddIn/AddLogEntryDialog.cs
index 9b96e905d6..46985bc20e 100644
--- a/main/src/addins/ChangeLogAddIn/AddLogEntryDialog.cs
+++ b/main/src/addins/ChangeLogAddIn/AddLogEntryDialog.cs
@@ -35,7 +35,7 @@ using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.ChangeLogAddIn
{
- partial class AddLogEntryDialog : Dialog
+ partial class AddLogEntryDialog : Gtk.Dialog
{
readonly ListStore store;
readonly Dictionary<ChangeLogEntry, string> changes = new Dictionary<ChangeLogEntry, string> ();
diff --git a/main/src/addins/ChangeLogAddIn/ChangeLog b/main/src/addins/ChangeLogAddIn/ChangeLog
deleted file mode 100644
index 3e7009bade..0000000000
--- a/main/src/addins/ChangeLogAddIn/ChangeLog
+++ /dev/null
@@ -1,665 +0,0 @@
-2010-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.cs:
- * ProjectOptionPanelWidget.cs:
- * CommitDialogExtensionWidget.cs: Track api changes.
-
-2010-07-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * CommitDialogExtensionWidget.cs: Track api changes.
-
-2010-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * CommitDialogExtensionWidget.cs: Clean up dialog placement.
-
-2010-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * Policies.xml: Added attribute to explicitly allow
- differential serialization for a policy (which is disabled
- by default).
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * ChangeLogAddIn.addin.xml: Bumped MD version.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * ChangeLogAddIn.cs:
- * gtk-gui/gui.stetic:
- * ChangeLogService.cs:
- * AddLogEntryDialog.cs:
- * ChangeLogAddIn.csproj:
- * ProjectOptionPanel.cs:
- * ChangeLogAddIn.addin.xml:
- * ProjectOptionPanelWidget.cs:
- * CommitDialogExtensionWidget.cs: Merged MD.Projects into
- MD.Core, and MD.Projects.Gui, MD.Core.Gui and MD.Components
- into MD.Ide.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddLogEntryDialog.cs: Track api changes.
-
-2010-02-09 Mike Krüger <mkrueger@novell.com>
-
- * AddLogEntryDialog.cs: Track API changes for lazy loading
- images.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs:
- * gtk-gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs:
- Flush.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * ChangeLogAddIn.addin.xml: Bump MD version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * ChangeLogAddIn.csproj:
- * gtk-gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs:
- * gtk-gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs:
- Flush.
-
-2009-10-13 Ankit Jain <jankit@novell.com>
-
- * ChangeLogAddIn.csproj: Import md.targets .
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * ChangeLogAddIn.addin.xml: Update license.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * ChangeLogAddIn.addin.xml: Bump MD version.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.csproj: Updated dependencies. We now depend
- on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * CommitDialogExtensionWidget.cs: Ellipsize path names. Fixes
- bug #532661 - Changelog names in commit dialog should wrap.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs:
- Flush.
-
-2009-06-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * OldChangeLogData.cs: Track api changes.
-
-2009-06-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddLogEntryDialog.cs: Use the new DesktopService instead of
- PlatformService.
-
-2009-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * OldChangeLogData.cs: Track api changes.
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * AssemblyInfo.cs: Changed assembly info.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * AddLogEntryDialog.cs: Renamed PixbufService to ImageService.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * AddLogEntryDialog.cs: Track API changes.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * ChangeLogAddIn.csproj: don't require specific gtk-sharp version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * ChangeLogAddIn.addin.xml: Bump MD version.
-
-2009-03-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * OldChangeLogData.cs: Don't set value for commit message
- style. Fix whether solution already has a policy. Fixes "Bug
- 486756 - Regression in changelog addin".
-
-2009-03-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * OldChangeLogData.cs:
- * ChangeLogService.cs:
- * ProjectOptionPanel.cs:
- * ChangeLogAddIn.csproj:
- * ChangeLogAddIn.addin.xml: Migrate MD1 changelog settings to
- the policy system. Fixes "Bug 471285 - Project ChangeLog
- settings lost".
-
- * gtk-gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs:
- Flush.
-
-2009-03-13 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs:
- Making some strings not translatable.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * ChangeLogService.cs: Rename 'dir', as csc doesn't like
- multiple locals with the same name in a switch.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.mds:
- * ChangeLogAddIn.mdp:
- * ChangeLogAddIn.csproj: Migrated to MSBuild file format.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * ChangeLogAddIn.addin.xml: Bump MD version.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogService.cs: Fix nullref.
-
- * gtk-gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs:
- Flush.
-
-2009-02-02 <>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs: Fix
- typo.
-
-2009-02-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * ChangeLogPolicy.cs: Change default date formatting from
- yy/MM/dd to yyyy-MM-dd.
-
-2009-02-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Policies.xml: Use - instead of / in Mono date format.
-
- * CommitDialogExtensionWidget.cs: Appned 2 newlines to
- ChangeLog message.
-
- Fixes Bug 471286 - "ChangeLog integration now uses wrong
- date format and messed up my ChangeLog".
-
-2009-01-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * ChangeLogAddIn.addin.xml: Register policy panel as a default policy
- panel.
-
-2009-01-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * Policies.xml:
- * ChangeLogAddIn.cs:
- * ChangeLogPolicy.cs:
- * ProjectOptionPanelWidget.cs:
- * CommitDialogExtensionWidget.cs: Rename UserInformation to
- AuthorInformation, and change other strings correspondingly.
-
-2009-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * Policies.xml:
- * gtk-gui/gui.stetic:
- * ChangeLogPolicy.cs:
- * ChangeLogAddIn.mdp:
- * ChangeLogService.cs:
- * ChangeLogAddIn.addin.xml:
- * ProjectOptionPanelWidget.cs:
- * CommitDialogExtensionWidget.cs:
- * gtk-gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs: Added
- message style to changelog policy
-
-2009-01-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * ChangeLogService.cs:
- * CommitDialogExtensionWidget.cs: Implement support for per-project
- policies VcsIntegration.RequireEntry/Enabled/None.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * ChangeLogAddIn.mdp: Flush project format changes.
-
-2009-01-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * ChangeLogAddIn.mdp:
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs:
- * gtk-gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs:
- * gtk-gui/MonoDevelop.ChangeLogAddIn.ChangeLogAddInOptionPanelWidget.cs:
- Removed unused panel widget.
-
-2009-01-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * ChangeLogPolicy.cs:
- * ChangeLogService.cs:
- * ProjectOptionPanel.cs:
- * ProjectOptionPanelWidget.cs:
- * gtk-gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs: Move
- ChangeLog integration options to the policies storage.
-
- * ChangeLogData.cs:
- * ChangeLogAddInOptionsPanel.cs:
- * ChangeLogAddInOptionPanelWidget.cs: Unused; remove.
-
- * ChangeLogAddIn.cs: Use UserInformation API. Fix error on insertion of
- entries into new/empty ChangeLogs. Fix spaces->tabs formatting.
-
- * ChangeLogAddIn.addin.xml: Remove old data types and panels, and
- register ChangeLogPolicy type as a policy.
-
- * Makefile.am:
- * ChangeLogAddIn.mdp: Updated.
-
- * CommitDialogExtensionWidget.cs: Use UserInformation API.
-
-2009-01-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * CommitDialogExtensionWidget.cs: Show a warning if there are some files
- without a comment.
-
-2009-01-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.cs:
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * CommitDialogExtensionWidget.cs:
- * ChangeLogAddInOptionPanelWidget.cs:
- * gtk-gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs:
- * gtk-gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs:
- * gtk-gui/MonoDevelop.ChangeLogAddIn.ChangeLogAddInOptionPanelWidget.cs:
- Fix bug #440957 - Version Control/Changelog addin no longer gives
- warning when name is not set.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.mdp: All projects now require fx 3.5.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.mdp: Don't require a specific version of Mono.Addins.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Make it work for parallel build.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * AssemblyInfo.cs: Add AssemblyInfo.cs files that are autogenerated from
- the addin manifests.
-
-2008-11-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Fix build dependencies.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.addin.xml: Bump MD version.
-
-2008-10-07 Aaron Bockover <abockover@novell.com>
-
- * CommitDialogExtensionWidget.cs: Updated to use ChangeLogMessageStyle
- instead of the WriteHeader bool
-
-2008-10-07 Aaron Bockover <abockover@novell.com>
-
- * ChangeLogAddIn.cs:
- * CommitDialogExtensionWidget.cs: Make the addin use the new
- ChangeLogWriter
-
- * AddLogEntryDialog.cs: Make tabs 4 characters wide instead of the
- default 8; use the default monospace font as provided by
- PlatformService; set some other properties; make the widget at least
- 80 characters wide for better preview/editing of ChangeLogs by hand
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs,
- gtk-gui/MonoDevelop.ChangeLogAddIn.ChangeLogAddInOptionPanelWidget.cs,
- gtk-gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs: Updated
- generated code.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogData.cs: Moved serialization engine to MonoDevelop.Core. Use
- new syntax for specifying attribute scope.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.addin.xml: Bump MD version.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.addin.xml: Show the options dialog only for solution
- items and solutions.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.addin.xml: Merged the extension points for project and
- solution option panels into a single extension point. A single
- extension point will now be used for all kinds of items. Extension
- conditions can be used to make panels visible only for some
- specific item types.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * ProjectOptionPanel.cs, ChangeLogData.cs, ProjectOptionPanelWidget.cs,
- ChangeLogAddIn.addin.xml, ChangeLogAddIn.mdp, gtk-gui/gui.stetic,
- Makefile.am, ChangeLogService.cs: New project model changes.
-
-2008-03-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddInOptionsPanel.cs, ChangeLogAddIn.addin.xml,
- ChangeLogAddInOptionPanelWidget.cs: Use new options dialog
- infrastructure.
- * CommitDialogExtensionWidget.cs: Reduce width of comments, so it fits
- in 80 cols with tabsize 8.
-
-2008-02-26 Mike Krüger <mkrueger@novell.com>
-
-
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.addin.xml: Update MD version.
-
-2008-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.addin.xml: Updated add-in category and description.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * ChangeLogAddInOptionPanelWidget.cs: Make strings translatable.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.mdp: Updated project files. The order of extended
- properties won't change anymore.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs,
- gtk-gui/MonoDevelop.ChangeLogAddIn.ChangeLogAddInOptionPanelWidget.cs,
- gtk-gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs: Regenerated
- gui.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.addin.xml: Bump add-in versions.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.mdp, Makefile.am: Directory reorganization.
-
-2007-11-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.cs: If no file is open but one is selected in the tree, use
- it as reference file for the new entry. Fixes bug #339272.
-
-2007-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * ChangeLogService.cs, CommitDialogExtensionWidget.cs: Track LoggingService
- API changes.
-
-2007-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogService.cs: Fix ChangeLog location problem in
- single-changelog-per-project mode.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.addin.xml: Bump MD version.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.mdp: Project file names updated by change in MD path
- functions.
-
-2007-10-12 Mike Krüger <mkrueger@novell.com>
-
- * ChangeLogService.cs, CommitDialogExtensionWidget.cs: Applied changes that
- were neccassary for to the new FileService.
-
-2007-09-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.addin.xml: Add missing identifier for the add-in
- preferences dialog.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.addin.xml: Bump MD version.
-
-2007-09-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.addin.xml: Added an Other section in the MD property dialog
- and moved some options there to avoid too many branches.
-
-2007-09-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * CommitDialogExtensionWidget.cs: Regenerate changelog entries after
- changing the user name and mail options. Fixes bug #82745.
-
-2007-09-04 Michael Hutchinson <MHutchinson@novell.com>
-
- * ChangeLogAddInOptionPanelWidget.cs: Fix compiler warning.
-
-2007-08-31 Mike Krüger <mkrueger@novell.com>
-
- * ProjectOptionPanel.cs, ChangeLogAddIn.cs,
- gtk-gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs,
- ChangeLogAddInOptionPanelWidget.cs, CommitDialogExtensionWidget.cs:
- Changes due to new property infrastructure.
-
-2007-08-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddLogEntryDialog.cs: When changing selection, get the text from the
- changes table, if it has changed. Fixes bug #82437.
-
-2007-08-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.mdp, gtk-gui/gui.stetic, Makefile.am: Updated.
- * ChangeLogService.cs: Fix nullref exception.
- * CommitDialogExtensionWidget.cs: Fix warning.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.addin.xml, ChangeLogAddIn.mdp, Makefile.am: Reorganized the
- extension point hierarchy. Embedded all add-in manifests as resources.
-
-2007-08-06 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * ChangeLogAddin.cs: Fixed #82322.
-
-2007-08-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.ChangeLogAddIn.ProjectOptionPanelWidget.cs: Added
- missing file.
-
-2007-08-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * ProjectOptionPanel.cs, ChangeLogData.cs, ProjectOptionPanelWidget.cs,
- ChangeLogAddInOptionsPanel.cs, ChangeLogAddIn.cs, AddLogEntryDialog.cs,
- ChangeLogAddIn.addin.xml, ChangeLogAddIn.mdp, gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs,
- gtk-gui/gui.stetic, ChangeLogAddInOptionPanelWidget.cs, Makefile.am,
- ChangeLogService.cs, CommitDialogExtensionWidget.cs: Allow updating
- multiple changelog files at the same time. Updated licenses. Based on a
- patch by Jacob Ilsø Christensen.
-
-2007-07-03 Mike Krüger <mkrueger@novell.com>
-
- * ChangeLogAddIn.cs: Changed a bit because of the removal of custom
- collections in the Ide project.
-
-2007-06-22 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * ChangeLogAddIn.mdp: Included ChangeLog file.
-
-2007-05-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.mdp, Makefile.am: Reference shared assemblies from the
- correct location.
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.addin.xml, ChangeLogAddIn.mdp,
- gtk-gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs,
- gtk-gui/gui.stetic, Makefile.am: Migration to Mono.Addins.
-
-2007-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.addin.xml, ChangeLogAddIn.cs: Simplified a little bit the
- ChangeLogAddin. Just one command "Insert ChageLog Entry", an header is
- automatically added if missing or if the top-most header is different
- from the one we're about to add. The command can be issued from anywhere
- and the add-in looks for the right ChangeLog file and even creates one
- if necessary. Patch by Federico Di Gregorio.
-
- * AddLogEntryDialog.cs, gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs,
- CommitDialogExtensionWidget.cs: Use new the partial class model.
- * ChangeLogAddIn.mdp: Update.
- * ChangeLogAddInOptionsPanel.cs,
- gtk-gui/MonoDevelop.ChangeLogAddIn.ChangeLogAddInOptionPanelWidget.cs,
- gtk-gui/gui.stetic, ChangeLogAddInOptionPanelWidget.cs: Implemented the
- option panel using stetic.
- * Makefile.am: Added new files.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.addin.xml: Change add-in versions to 0.13.
- * ChangeLogAddIn.mdp: Updated.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.mdp, Makefile.am: Synchronized the MD project and the
- Makefile
-
-2007-02-05 Lluis Sanchez Gual <lluis@novell.com>
-
- i18n fixes.
-
-2007-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.cs: Track api changes in Document class.
-
-2007-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.mdp, gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs,
- gtk-gui/gui.stetic, Makefile.am: Split Stetic generated code in
- files.
-
-2006-12-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * CommitDialogExtensionWidget.cs: Use the FileService for copying and
- deleting files.
-
-2006-12-01 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Makefile.am: Only build if VersionControl AddIn is enabled,
- because this AddIn depends on it.
-
-2006-11-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.mdp, Makefile.am: Updated references to version
- control add-in.
- * gtk-gui/generated.cs, gtk-gui/gui.stetic: Updated.
- * CommitDialogExtensionWidget.cs: Don't try to commit the ChangeLog
- file if it is not really committable.
-
-2006-11-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddLogEntryDialog.cs: New dialog that shows a new entry to be added
- to a ChangeLog file.
- * ChangeLogAddIn.addin.xml: Added dependency to VersionControl.
- Registered extension to the commit dialog.
- * ChangeLogAddIn.mdp, Makefile.am: Updated.
- * ChangeLogAddInOptionsPanel.cs: Save the properties after changing
- user data.
- * gtk-gui/generated.cs, gtk-gui/gui.stetic: New gui files.
- * CommitDialogExtensionWidget.cs: New extension of the commit dialog.
-
-2006-09-19 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * ChangeLogAddIn.mdp: Updated.
- * .: Added svn:ignore for ChangeLogAddIn.pidb
-
-2006-07-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.addin.xml: Updated versions.
-
-2006-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.addin.xml: Updated versions.
- * ChangeLogAddIn.mdp: Updated.
-
-2006-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.addin.xml: Updated references.
-
-2006-03-24 Grzegorz Sobanski <silk@boktor.net>
-
- * Makefile.am: removed unneeded references to nunit.
-
-2006-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLogAddIn.mdp: Updated.
- * Makefile.am: Use an unified format. Patch by Matze Braun.
- * ChangeLogAddIn.addin.xml: Updated add-in versions.
-
-2006-02-28 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
- * ChangeLogAddIn.addin.xml:
- * ChangeLogAddInOptionsPanel.cs:
- * ChangeLogAddIn.cs:
- Fixed spelling.
-
-2006-01-29 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * ChangeLogAddIn.cs:
- * ChangeLogAddInOptionsPanel.cs:
- Added copyright comment.
-
-2006-01-25 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * ChangeLogAddIn.addin.xml: Fixed spelling of add-in.
-
-2005-12-15 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * Makefile.am: Added AssemblyInfo.cs
- * AssemblyInfo.cs: Added version info.
-
-2005-12-15 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * ChangeLogAddIn.cs: Fixed indention.
-
-2005-12-15 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * *:
- Initial version.
diff --git a/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.addin.xml b/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.addin.xml
index 226b186130..1af14056ce 100644
--- a/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.addin.xml
+++ b/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.addin.xml
@@ -17,7 +17,7 @@
<Extension path = "/MonoDevelop/ProjectModel/Gui/ItemOptionPanels/VersionControl">
<ComplexCondition>
<Or>
- <Condition id="ItemType" value="SolutionItem" />
+ <Condition id="ItemType" value="SolutionFolderItem" />
<Condition id="ItemType" value="Solution" />
</Or>
<Section id = "ChangeLogIntegration" _label = "ChangeLog Integration" fill="true" class="MonoDevelop.ChangeLogAddIn.ProjectOptionPanel" />
diff --git a/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.cs b/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.cs
index af7840f2b4..4b6aefb313 100644
--- a/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.cs
+++ b/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.cs
@@ -35,6 +35,8 @@ using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Gui.Pads.ProjectPad;
using MonoDevelop.Ide;
+using MonoDevelop.Ide.Editor;
+using System.Threading.Tasks;
namespace MonoDevelop.ChangeLogAddIn
{
@@ -45,9 +47,9 @@ namespace MonoDevelop.ChangeLogAddIn
public class InsertEntryHandler : CommandHandler
{
- protected override void Run()
+ protected override async void Run()
{
- Document document = GetActiveChangeLogDocument();
+ Document document = await GetActiveChangeLogDocument();
if (document == null) return;
if (InsertHeader(document))
@@ -80,7 +82,7 @@ namespace MonoDevelop.ChangeLogAddIn
static void InsertEntry(Document document)
{
- IEditableTextBuffer textBuffer = document.GetContent<IEditableTextBuffer>();
+ var textBuffer = document.GetContent<TextEditor>();
if (textBuffer == null) return;
string changeLogFileName = document.FileName;
@@ -98,16 +100,16 @@ namespace MonoDevelop.ChangeLogAddIn
textBuffer.InsertText (insertPos, text);
insertPos += text.Length;
- textBuffer.Select (insertPos, insertPos);
- textBuffer.CursorPosition = insertPos;
-
+ textBuffer.CaretOffset = insertPos;
+ textBuffer.SetSelection (insertPos, insertPos);
+
document.Select ();
}
}
static bool InsertHeader (Document document)
{
- IEditableTextBuffer textBuffer = document.GetContent<IEditableTextBuffer>();
+ var textBuffer = document.Editor;
if (textBuffer == null) return false;
AuthorInformation userInfo = document.Project != null ? document.Project.AuthorInformation : AuthorInformation.Default;
@@ -126,25 +128,25 @@ namespace MonoDevelop.ChangeLogAddIn
// Read the first line and compare it with the header: if they are
// the same don't insert a new header.
int pos = GetHeaderEndPosition(document);
- if (pos < 0 || (pos + 2 > textBuffer.Length) || textBuffer.GetText (0, pos + 2) != text)
+ if (pos < 0 || (pos + 2 > textBuffer.Length) || textBuffer.GetTextAt (0, pos + 2) != text)
textBuffer.InsertText (0, text);
return true;
}
static int GetHeaderEndPosition(Document document)
{
- IEditableTextBuffer textBuffer = document.GetContent<IEditableTextBuffer>();
+ var textBuffer = document.Editor;
if (textBuffer == null) return 0;
// This is less than optimal, we simply read 1024 chars hoping to
// find a newline there: if we don't find it we just return 0.
- string text = textBuffer.GetText (0, Math.Min (textBuffer.Length, 1023));
+ string text = textBuffer.GetTextAt (0, Math.Min (textBuffer.Length, 1023));
string eol = document.Editor != null ? document.Editor.EolMarker : Environment.NewLine;
return text.IndexOf (eol + eol, StringComparison.Ordinal);
}
- static Document GetActiveChangeLogDocument()
+ static async Task<Document> GetActiveChangeLogDocument()
{
string file = GetSelectedFile ();
if (file == null)
@@ -159,7 +161,7 @@ namespace MonoDevelop.ChangeLogAddIn
return null;
if (File.Exists (clog))
- return IdeApp.Workbench.OpenDocument (clog, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
+ return await IdeApp.Workbench.OpenDocument (clog, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
Document document = IdeApp.Workbench.NewDocument (clog, "text/plain", "");
document.Save();
diff --git a/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.csproj b/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.csproj
index d3edc7350f..c8b18f7435 100644
--- a/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.csproj
+++ b/main/src/addins/ChangeLogAddIn/ChangeLogAddIn.csproj
@@ -54,21 +54,11 @@
<Name>MonoDevelop.VersionControl</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
- <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
- <Name>Mono.TextEditor</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
<Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
<Name>ICSharpCode.NRefactory</Name>
<Private>False</Private>
</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="..\MonoDevelop.Debugger\MonoDevelop.Debugger.csproj">
<Project>{2357AABD-08C7-4808-A495-8FF2D3CDFDB0}</Project>
<Name>MonoDevelop.Debugger</Name>
diff --git a/main/src/addins/ChangeLogAddIn/ChangeLogService.cs b/main/src/addins/ChangeLogAddIn/ChangeLogService.cs
index 587bb5db7c..25581a2cf2 100644
--- a/main/src/addins/ChangeLogAddIn/ChangeLogService.cs
+++ b/main/src/addins/ChangeLogAddIn/ChangeLogService.cs
@@ -38,7 +38,7 @@ namespace MonoDevelop.ChangeLogAddIn
// Returns the path of the ChangeLog where changes of the provided file have to be logged.
// Returns null if no ChangeLog could be found.
// Returns an empty string if changes don't have to be logged.
- public static string GetChangeLogForFile (string baseCommitPath, FilePath file, out SolutionItem parentEntry, out ChangeLogPolicy policy)
+ public static string GetChangeLogForFile (string baseCommitPath, FilePath file, out SolutionFolderItem parentEntry, out ChangeLogPolicy policy)
{
parentEntry = null;
policy = null;
@@ -50,7 +50,7 @@ namespace MonoDevelop.ChangeLogAddIn
string bestPath = null;
file = file.CanonicalPath;
- foreach (SolutionItem e in IdeApp.Workspace.GetAllSolutionItems ()) {
+ foreach (SolutionFolderItem e in IdeApp.Workspace.GetAllSolutionItems ()) {
if (e is Project && ((Project)e).Files.GetFile (file) != null) {
parentEntry = e;
break;
@@ -108,18 +108,18 @@ namespace MonoDevelop.ChangeLogAddIn
public static string GetChangeLogForFile (string baseCommitPath, string file)
{
- SolutionItem parentEntry;
+ SolutionFolderItem parentEntry;
ChangeLogPolicy policy;
return GetChangeLogForFile (baseCommitPath, file, out parentEntry, out policy);
}
- public static CommitMessageStyle GetMessageStyle (SolutionItem item)
+ public static CommitMessageStyle GetMessageStyle (SolutionFolderItem item)
{
ChangeLogPolicy policy = item != null ? GetPolicy (item) : new ChangeLogPolicy ();
return policy.MessageStyle;
}
- static ChangeLogPolicy GetPolicy (SolutionItem item)
+ static ChangeLogPolicy GetPolicy (SolutionFolderItem item)
{
return item.Policies.Get<ChangeLogPolicy> ();
}
diff --git a/main/src/addins/ChangeLogAddIn/CommitDialogExtensionWidget.cs b/main/src/addins/ChangeLogAddIn/CommitDialogExtensionWidget.cs
index d23236c134..c2831dfbfe 100644
--- a/main/src/addins/ChangeLogAddIn/CommitDialogExtensionWidget.cs
+++ b/main/src/addins/ChangeLogAddIn/CommitDialogExtensionWidget.cs
@@ -156,7 +156,7 @@ namespace MonoDevelop.ChangeLogAddIn
}
if (!cset.ContainsFile (ce.File)) {
if (!cset.Repository.GetVersionInfo (ce.File).IsVersioned)
- cset.Repository.Add (ce.File, false, new MonoDevelop.Core.ProgressMonitoring.NullProgressMonitor ());
+ cset.Repository.Add (ce.File, false, new MonoDevelop.Core.ProgressMonitor ());
cset.AddFile (ce.File);
}
}
@@ -226,7 +226,7 @@ namespace MonoDevelop.ChangeLogAddIn
requireComment = false;
foreach (ChangeSetItem item in cset.Items) {
- SolutionItem parentItem;
+ SolutionFolderItem parentItem;
ChangeLogPolicy policy;
string logf = ChangeLogService.GetChangeLogForFile (cset.BaseLocalPath, item.LocalPath,
out parentItem, out policy);
diff --git a/main/src/addins/ChangeLogAddIn/ProjectOptionPanel.cs b/main/src/addins/ChangeLogAddIn/ProjectOptionPanel.cs
index 12a02a3337..43acbf321f 100644
--- a/main/src/addins/ChangeLogAddIn/ProjectOptionPanel.cs
+++ b/main/src/addins/ChangeLogAddIn/ProjectOptionPanel.cs
@@ -25,7 +25,7 @@
//
//
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Projects;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
@@ -36,7 +36,7 @@ namespace MonoDevelop.ChangeLogAddIn
{
ProjectOptionPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new ProjectOptionPanelWidget (this);
}
diff --git a/main/src/addins/ChangeLogAddIn/ProjectOptionPanelWidget.cs b/main/src/addins/ChangeLogAddIn/ProjectOptionPanelWidget.cs
index 1492307f2b..777de0e1e4 100644
--- a/main/src/addins/ChangeLogAddIn/ProjectOptionPanelWidget.cs
+++ b/main/src/addins/ChangeLogAddIn/ProjectOptionPanelWidget.cs
@@ -68,7 +68,7 @@ namespace MonoDevelop.ChangeLogAddIn
format.MaxColumns = 70;
format.Style = style;
- SolutionItem item = null;
+ SolutionFolderItem item = null;
if (parent.ConfiguredSolutionItem != null)
item = parent.ConfiguredSolutionItem;
else if (parent.ConfiguredSolution != null)
diff --git a/main/src/addins/ChangeLogAddIn/gtk-gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs b/main/src/addins/ChangeLogAddIn/gtk-gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs
index e88f8540d9..f71b2fb618 100644
--- a/main/src/addins/ChangeLogAddIn/gtk-gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs
+++ b/main/src/addins/ChangeLogAddIn/gtk-gui/MonoDevelop.ChangeLogAddIn.AddLogEntryDialog.cs
@@ -5,28 +5,49 @@ namespace MonoDevelop.ChangeLogAddIn
internal partial class AddLogEntryDialog
{
private global::Gtk.VBox vbox1;
+
private global::Gtk.VPaned vpaned1;
+
private global::Gtk.VBox vbox2;
+
private global::Gtk.Label label1;
+
private global::Gtk.ScrolledWindow scrolledwindow2;
+
private global::Gtk.TreeView fileList;
+
private global::Gtk.VBox vbox3;
+
private global::Gtk.Label label3;
+
private global::Gtk.ScrolledWindow scrolledwindow1;
+
private global::Gtk.TextView textview;
+
private global::Gtk.HBox boxNewFile;
- private global::Gtk.Image image36;
+
+ private global::MonoDevelop.Components.ImageView image36;
+
private global::Gtk.Label label7;
+
private global::Gtk.HBox boxNoFile;
- private global::Gtk.Image image37;
+
+ private global::MonoDevelop.Components.ImageView image37;
+
private global::Gtk.Label label8;
+
private global::Gtk.HBox hbox3;
+
private global::Gtk.VBox vbox4;
- private global::Gtk.Image image38;
+
+ private global::MonoDevelop.Components.ImageView image38;
+
private global::Gtk.Label label9;
+
private global::Gtk.Button button7;
- private global::Gtk.Button button119;
+ private global::Gtk.Button button119;
+
protected virtual void Build ()
{
global::Stetic.Gui.Initialize (this);
@@ -119,9 +140,10 @@ namespace MonoDevelop.ChangeLogAddIn
this.boxNewFile.Name = "boxNewFile";
this.boxNewFile.Spacing = 6;
// Container child boxNewFile.Gtk.Box+BoxChild
- this.image36 = new global::Gtk.Image ();
+ this.image36 = new global::MonoDevelop.Components.ImageView ();
this.image36.Name = "image36";
- this.image36.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-new", global::Gtk.IconSize.SmallToolbar);
+ this.image36.IconId = "gtk-new";
+ this.image36.IconSize = ((global::Gtk.IconSize)(2));
this.boxNewFile.Add (this.image36);
global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.boxNewFile [this.image36]));
w11.Position = 0;
@@ -149,9 +171,10 @@ namespace MonoDevelop.ChangeLogAddIn
this.boxNoFile.Name = "boxNoFile";
this.boxNoFile.Spacing = 6;
// Container child boxNoFile.Gtk.Box+BoxChild
- this.image37 = new global::Gtk.Image ();
+ this.image37 = new global::MonoDevelop.Components.ImageView ();
this.image37.Name = "image37";
- this.image37.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-dialog-warning", global::Gtk.IconSize.SmallToolbar);
+ this.image37.IconId = "gtk-dialog-warning";
+ this.image37.IconSize = ((global::Gtk.IconSize)(2));
this.boxNoFile.Add (this.image37);
global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.boxNoFile [this.image37]));
w14.Position = 0;
@@ -184,9 +207,10 @@ namespace MonoDevelop.ChangeLogAddIn
this.vbox4.Name = "vbox4";
this.vbox4.Spacing = 6;
// Container child vbox4.Gtk.Box+BoxChild
- this.image38 = new global::Gtk.Image ();
+ this.image38 = new global::MonoDevelop.Components.ImageView ();
this.image38.Name = "image38";
- this.image38.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-dialog-info", global::Gtk.IconSize.SmallToolbar);
+ this.image38.IconId = "gtk-dialog-info";
+ this.image38.IconSize = ((global::Gtk.IconSize)(2));
this.vbox4.Add (this.image38);
global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.image38]));
w17.Position = 0;
diff --git a/main/src/addins/ChangeLogAddIn/gtk-gui/generated.cs b/main/src/addins/ChangeLogAddIn/gtk-gui/generated.cs
index 36abc51341..75935e2e55 100644
--- a/main/src/addins/ChangeLogAddIn/gtk-gui/generated.cs
+++ b/main/src/addins/ChangeLogAddIn/gtk-gui/generated.cs
@@ -14,40 +14,6 @@ namespace Stetic
}
}
- internal class IconLoader
- {
- public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size)
- {
- Gdk.Pixbuf res = widget.RenderIcon (name, size, null);
- if ((res != null)) {
- return res;
- } else {
- int sz;
- int sy;
- global::Gtk.Icon.SizeLookup (size, out sz, out sy);
- try {
- return Gtk.IconTheme.Default.LoadIcon (name, sz, 0);
- } catch (System.Exception) {
- if ((name != "gtk-missing-image")) {
- return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size);
- } else {
- Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz);
- Gdk.GC gc = new Gdk.GC (pmap);
- gc.RgbFgColor = new Gdk.Color (255, 255, 255);
- pmap.DrawRectangle (gc, true, 0, 0, sz, sz);
- gc.RgbFgColor = new Gdk.Color (0, 0, 0);
- pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1));
- gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
- gc.RgbFgColor = new Gdk.Color (255, 0, 0);
- pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4)));
- pmap.DrawLine (gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)));
- return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
- }
- }
- }
- }
- }
-
internal class BinContainer
{
private Gtk.Widget child;
diff --git a/main/src/addins/ChangeLogAddIn/gtk-gui/gui.stetic b/main/src/addins/ChangeLogAddIn/gtk-gui/gui.stetic
index cc2a22e669..16bc54996d 100644
--- a/main/src/addins/ChangeLogAddIn/gtk-gui/gui.stetic
+++ b/main/src/addins/ChangeLogAddIn/gtk-gui/gui.stetic
@@ -8,6 +8,8 @@
<widget-library name="../../../../build/bin/MonoDevelop.Ide.dll" />
<widget-library name="../../../../build/AddIns/VersionControl/MonoDevelop.VersionControl.dll" />
<widget-library name="../../../../build/bin/Mono.TextEditor.dll" />
+ <widget-library name="../../../../build/AddIns/DisplayBindings/SourceEditor/MonoDevelop.SourceEditor2.dll" />
+ <widget-library name="../../../../build/AddIns/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.dll" />
<widget-library name="../../../../build/AddIns/ChangeLogAddIn/ChangeLogAddIn.dll" internal="true" />
</import>
<widget class="Gtk.Dialog" id="MonoDevelop.ChangeLogAddIn.AddLogEntryDialog" design-size="573 510">
@@ -125,9 +127,10 @@
<property name="Visible">False</property>
<property name="Spacing">6</property>
<child>
- <widget class="Gtk.Image" id="image36">
+ <widget class="MonoDevelop.Components.ImageView" id="image36">
<property name="MemberName" />
- <property name="Pixbuf">stock:gtk-new SmallToolbar</property>
+ <property name="IconId">gtk-new</property>
+ <property name="IconSize">SmallToolbar</property>
</widget>
<packing>
<property name="Position">0</property>
@@ -165,9 +168,10 @@
<property name="Visible">False</property>
<property name="Spacing">6</property>
<child>
- <widget class="Gtk.Image" id="image37">
+ <widget class="MonoDevelop.Components.ImageView" id="image37">
<property name="MemberName" />
- <property name="Pixbuf">stock:gtk-dialog-warning SmallToolbar</property>
+ <property name="IconId">gtk-dialog-warning</property>
+ <property name="IconSize">SmallToolbar</property>
</widget>
<packing>
<property name="Position">0</property>
@@ -209,9 +213,10 @@
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
- <widget class="Gtk.Image" id="image38">
+ <widget class="MonoDevelop.Components.ImageView" id="image38">
<property name="MemberName" />
- <property name="Pixbuf">stock:gtk-dialog-info SmallToolbar</property>
+ <property name="IconId">gtk-dialog-info</property>
+ <property name="IconSize">SmallToolbar</property>
</widget>
<packing>
<property name="Position">0</property>
diff --git a/main/src/addins/Deployment/ChangeLog b/main/src/addins/Deployment/ChangeLog
deleted file mode 100644
index b309d9eca6..0000000000
--- a/main/src/addins/Deployment/ChangeLog
+++ /dev/null
@@ -1,4 +0,0 @@
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * Deployment.mds: Migrated to MSBuild file format.
-
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/AddinInfo.cs b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/AddinInfo.cs
index b3d738acc3..e7dc673155 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/AddinInfo.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/AddinInfo.cs
@@ -6,7 +6,14 @@ using Mono.Addins.Description;
[assembly:Addin ("Deployment.Linux",
Namespace = "MonoDevelop",
Version = MonoDevelop.BuildInfo.Version,
- Category = "Deployment")]
+ Category = "Deployment",
+ EnabledByDefault =
+ #if GNOME
+ true
+ #else
+ false
+ #endif
+)]
[assembly:AddinName ("Deployment Services for Linux")]
[assembly:AddinDescription ("Provides basic deployment services for Linux")]
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/ChangeLog b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/ChangeLog
deleted file mode 100644
index 24818592e6..0000000000
--- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/ChangeLog
+++ /dev/null
@@ -1,517 +0,0 @@
-2010-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux/DotDesktopViewWidget.cs: Fix
- incorrect use of ShowCustomDialog/RunCustomDialog.
-
-2010-05-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Deployment.Linux/DotDesktopViewWidget.cs: More
- dialog placing.
-
-2010-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/MonoDevelop.Deployment.Linux.DotDesktopViewWidget.cs:
- Flush.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Deployment.Linux/DotDesktopView.cs: IViewContent
- widgets are now destroyed by the workspace window.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Deployment.Linux.addin.xml: Bumped MD version.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Deployment.Linux.csproj:
- * MonoDevelop.Deployment.Linux.addin.xml:
- * MonoDevelop.Deployment.Linux/BasicOptionPanel.cs:
- * MonoDevelop.Deployment.Linux/DotDesktopViewWidget.cs:
- * MonoDevelop.Deployment.Linux/LinuxDeploymentSetup.cs: Merged
- MD.Projects into MD.Core, and MD.Projects.Gui, MD.Core.Gui
- and MD.Components into MD.Ide.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.Deployment.Linux.DesktopPanelWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Linux.DotDesktopViewWidget.cs:
- * MonoDevelop.Deployment.Linux/LinuxIntegrationProjectFeature.cs:
- * gtk-gui/MonoDevelop.Deployment.Linux.BasicOptionPanelWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.cs:
- Flush.
-
-2010-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Deployment.Linux/DotDesktopDisplayBinding.cs:
- Track DisplayBinding API.
-
-2009-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux/BasicOptionPanelWidget.cs:
- Track api changes.
-
-2009-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux/LinuxDeployExtension.cs:
- Introduced the ConfigurationSelector class to all methods
- that previously took a configuration name as string. This
- eliminates the ambiguity between solution configuration
- names and project configuration names.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Deployment.Linux.addin.xml: Bump MD version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * MonoDevelop.Deployment.Linux.csproj:
- * gtk-gui/MonoDevelop.Deployment.Linux.DesktopPanelWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Linux.DotDesktopViewWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Linux.BasicOptionPanelWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.cs:
- Flush.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Deployment.Linux.addin.xml: Bump MD version.
-
-2009-09-09 Christian Hergert <chris@dronelabs.com>
-
- * MonoDevelop.Deployment.Linux/DotDesktopViewWidget.cs: Set dialog
- transient for the root window.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.csproj: Updated dependencies.
- We now depend on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Flush.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.cs:
- Flush.
-
-2009-06-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux/DotDesktopViewWidget.cs: Use
- the new DesktopService instead of PlatformService.
-
-2009-06-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux/LinuxDeployExtension.cs:
- * MonoDevelop.Deployment.Linux/BasicOptionPanelWidget.cs:
- Track api changes.
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Deployment.Linux/DotDesktopDisplayBinding.cs:
- Track API changes.
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Deployment.Linux/DotDesktopDisplayBinding.cs:
- Track API changes.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.Deployment.Linux.csproj: don't require specific
- gtk-sharp version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Deployment.Linux.addin.xml: Bump MD version.
-
-2009-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux/LinuxDeployExtension.cs: If
- version number is not set in the project, get the version
- from the solution.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Deployment.Linux.csproj: Flush MD's removal of
- newline at end of file that was introduced by manually
- editing with gedit.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Deployment.Linux.csproj: Remove invalid
- ApplicationIcon value that broke the build in VS.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.mdp:
- * MonoDevelop.Deployment.Linux.csproj: Migrated to MSBuild
- file format.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Deployment.Linux.addin.xml: Bump MD version.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.Deployment.Linux.DesktopPanelWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Linux.DotDesktopViewWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Linux.BasicOptionPanelWidget.cs:
- *
- gtk-gui/MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.cs:
- Flush.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Deployment.Linux.mdp: Flush project format changes.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.mdp: All projects now require fx 3.5.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.mdp: Don't require a specific version of
- Mono.Addins.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Make it work for parallel build.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * AssemblyInfo.cs: Add AssemblyInfo.cs files that are autogenerated from
- the addin manifests.
-
-2008-11-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Fix build dependencies.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.addin.xml: Bump MD version.
-
-2008-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Deployment.Linux/BasicOptionPanelWidget.cs: Track API.
- * MonoDevelop.Deployment.Linux/LinuxDeploymentSetup.cs: Added quick
- property for enabling translation of files. Supports multi-select.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux/DesktopPanelWidget.cs,
- MonoDevelop.Deployment.Linux/BasicOptionPanelWidget.cs,
- MonoDevelop.Deployment.Linux/DotDesktopViewWidget.cs,
- gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.Deployment.Linux.DesktopPanelWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Linux.BasicOptionPanelWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Linux.DotDesktopViewWidget.cs,
- gtk-gui/objects.xml,
- gtk-gui/MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.cs:
- Updated generated code.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Deployment.Linux.mdp: Removed some parts of the
- documentation service.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux/LinuxDeployData.cs: Moved serialization
- engine to MonoDevelop.Core. Use new syntax for specifying attribute
- scope.
-
-2008-06-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Fix required gtk version.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.addin.xml: Bump MD version.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.addin.xml: Merged the extension points
- for project and solution option panels into a single extension
- point. A single extension point will now be used for all kinds of
- items. Extension conditions can be used to make panels visible only
- for some specific item types.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.addin.xml,
- MonoDevelop.Deployment.Linux.mdp,
- MonoDevelop.Deployment.Linux/BasicOptionPanelWidget.cs,
- MonoDevelop.Deployment.Linux/LinuxDeploymentSetup.cs,
- MonoDevelop.Deployment.Linux/LinuxDeployData.cs,
- MonoDevelop.Deployment.Linux/LinuxIntegrationProjectFeature.cs,
- MonoDevelop.Deployment.Linux/LinuxDeployExtension.cs,
- MonoDevelop.Deployment.Linux/BasicOptionPanel.cs: New project model
- changes.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Deployment.Linux.mdp, gtk-gui/gui.stetic, Makefile.am: Removed
- some unused glade and gnome-sharp references (only the unused). But I'll
- continue to remove glade, we need to lower the dependency tree a bit.
-
-2008-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux/DotDesktopView.cs: Fixed nullref.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.addin.xml: Update MD version.
-
-2008-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.addin.xml: Updated add-in category and
- description.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * app.desktop.xft.xml: Make template categories translatable.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.mdp: Updated project files. The order of
- extended properties won't change anymore.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux/DotDesktopViewWidget.cs: Moved
- PlatformService to MD.Core.Gui. Removed old FileIconService class, which
- is now implemented in PlatformService.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Deployment.Linux.DotDesktopViewWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.cs,
- gtk-gui/gui.stetic: Flush.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Deployment.Linux.DotDesktopViewWidget.cs,
- gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.cs:
- Updated.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.addin.xml: Bump add-in versions.
-
-2007-12-06 Geoff Norton <gnorton@novell.com>
-
- * MonoDevelop.Deployment.Linux/DotDesktopViewWidget.cs: Use
- PlatformService to get mime information instead of Gnome.Vfs directly
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.mdp, Makefile.am: Directory reorganization.
-
-2007-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Deployment.Linux/LinuxDeploymentSetup.cs,
- MonoDevelop.Deployment.Linux/MenuCategorySelectorDialog.cs: Track
- LoggingService API changes.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.addin.xml: Bump MD version.
-
-2007-10-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.addin.xml, MonoDevelop.Deployment.Linux.mdp,
- MonoDevelop.Deployment.Linux/LinuxDeploymentSetup.cs,
- MonoDevelop.Deployment.Linux/LinuxDeployData.cs, app.desktop.xft.xml,
- Makefile.am: Added new file template for creating .desktop files. When a
- .desktop file is added to a project, set the deploy options so it is
- deployed to the .desktop app folder.
-
-2007-10-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux/LinuxDeployExtension.cs: Use the project
- description when generating .pc files, if available. Patch by Federico
- Di Gregorio.
-
-2007-10-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux/DotDesktopView.cs: Destroy the view widget
- when the view is disposed.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux/LinuxIntegrationProjectFeature.cs: Track api
- changes. Add description property.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.mdp: Project file names updated by change in
- MD path functions.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.addin.xml: Bump MD version.
-
-2007-09-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.Deployment.Linux.DesktopPanelWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Linux.BasicOptionPanelWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Linux.DotDesktopViewWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.cs:
- Regenerated gui files.
-
-2007-09-15 Andrés G. Aragoneses <knocte@gmail.com>
-
- * MonoDevelop.Deployment.Linux/DesktopInfo.xml: fix typo.
- * gtk-gui/MonoDevelop.Deployment.Linux.DesktopPanelWidget.cs:
- * gtk-gui/gui.stetic: Don't translate "page#" texts.
-
-2007-08-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Deployment.Linux/BasicOptionPanel.cs,
- gtk-gui/MonoDevelop.Deployment.Linux.DotDesktopViewWidget.cs: Changes
- due to new property infrastructure.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am, MonoDevelop.Deployment.Linux.mdp: Don't exclude the .addin
- file from the makefile.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.addin.xml, MonoDevelop.Deployment.Linux.mdp,
- Makefile.am: Reorganized the extension point hierarchy. Embedded all
- add-in manifests as resources.
-
-2007-07-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.mdp,
- gtk-gui/MonoDevelop.Deployment.Linux.DotDesktopViewWidget.cs,
- gtk-gui/gui.stetic: Updated.
-
-2007-07-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux/MenuCategorySelectorDialog.cs: Fix
- build.
-
-2007-07-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux/MenuCategorySelectorDialog.cs: Use the
- log service for logging errors.
-
-2007-07-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux/LinuxDeployExtension.cs: In the
- generated launch script, transfer script parameters to mono.
- * gtk-gui/objects.xml: Updated.
-
-2007-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux/MenuCategorySelectorDialog.cs: Always
- select a "main" category when selecting a subcategory.
-
-2007-05-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux/LinuxDeployData.cs: Don't set the
- ScriptName property by default, just return the name of the project
- when not set.
- * gtk-gui/MonoDevelop.Deployment.Linux.DesktopPanelWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Linux.DotDesktopViewWidget.cs,
- gtk-gui/gui.stetic: Updated.
-
-2007-05-13 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.Deployment.Linux/DotDesktopViewWidget.cs,
- MonoDevelop.Deployment.Linux/MenuCategorySelectorDialog.cs: Make
- strings translatable.
-
-2007-05-12 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.Deployment.Linux/LinuxDeployExtension.cs: Fixed typo.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.mdp: Don't copy project references.
-
-2007-05-10 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.Deployment.Linux.mdp: Add
- MonoDevelop.Deployment.Linux.addin.xml back to the file list,
- but exclude from makefile synching.
-
-2007-05-09 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Makefile.am: Eliminate duplication of
- MonoDevelop.Deployment.Linux.addin.xml target.
-
-2007-05-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.mdp, Makefile.am: Reference shared
- assemblies from the correct location.
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.addin.xml,
- MonoDevelop.Deployment.Linux.mdp,
- gtk-gui/MonoDevelop.Deployment.Linux.DotDesktopViewWidget.cs,
- Makefile.am: Migration to Mono.Addins.
-
-2007-04-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux/LinuxDeployData.cs: Added package name
- property.
- * MonoDevelop.Deployment.Linux/LinuxDeployExtension.cs: Rename
- app.desktop files to <package-name>.desktop when deploying.
-
-2007-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.addin.xml: Register new project feature
- editor. Place the .desktop editor before the default editor.
- * MonoDevelop.Deployment.Linux.mdp, Makefile.am: Added new file.
- * MonoDevelop.Deployment.Linux/DesktopEntry.cs: Write the [Desktop
- Entry] group name when a new file is created.
- * MonoDevelop.Deployment.Linux/BasicOptionPanelWidget.cs,
- MonoDevelop.Deployment.Linux/BasicOptionPanel.cs: Generate the
- .desktop file if that option is selected.
- * MonoDevelop.Deployment.Linux/LinuxIntegrationProjectFeature.cs:
- Implemented a project feature which allows setting unix integration
- options.
- * gtk-gui/MonoDevelop.Deployment.Linux.DotDesktopViewWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.cs,
- gtk-gui/gui.stetic: Updated.
-
-2007-04-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux/BasicOptionPanelWidget.cs,
- MonoDevelop.Deployment.Linux/LinuxDeployExtension.cs: Show library
- options for exes compiled as dll.
- * gtk-gui/MonoDevelop.Deployment.Linux.DotDesktopViewWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Linux.MenuCategorySelectorDialog.cs:
- Updated.
-
-2007-04-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Linux.mdp: Updated.
- * MonoDevelop.Deployment.Linux/LinuxDeployExtension.cs: Provide the
- source project and a description for generated .pc and script
- files.
-
-2007-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- New unix deployment add-in.
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux.addin.xml b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux.addin.xml
index f2396223f0..1d48c4a813 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux.addin.xml
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux.addin.xml
@@ -3,9 +3,6 @@
<Extension path = "/MonoDevelop/Ide/Commands">
</Extension>
- <Extension path = "/MonoDevelop/ProjectModel/SerializableClasses">
- </Extension>
-
<Extension path = "/MonoDevelop/Deployment/DeployDirectoryResolvers">
</Extension>
@@ -13,11 +10,6 @@
<Class id="Deployment.Linux" insertbefore="PrepareDeploy" class = "MonoDevelop.Deployment.Linux.LinuxDeployExtension" />
</Extension>
- <Extension path = "/MonoDevelop/ProjectModel/ExtendedProperties">
-<!-- <ItemProperty class = "MonoDevelop.Projects.ProjectFile"
- name = "DeployService.TargetDirectoryId" type = "System.String" />
---> </Extension>
-
<Extension path = "/MonoDevelop/Ide/Pads/ProjectPad">
<!-- <NodeBuilder class = "MonoDevelop.Deployment.NodeBuilders.PackagingProjectNodeBuilder"/>
<NodeBuilder class = "MonoDevelop.Deployment.NodeBuilders.PackageNodeBuilder"/>
@@ -49,11 +41,6 @@
</Condition>
</Extension>
- <Extension path = "/MonoDevelop/ProjectModel/ExtendedProperties">
- <ItemProperty class = "MonoDevelop.Projects.SolutionItem"
- name = "Deployment.LinuxDeployData" type = "MonoDevelop.Deployment.Linux.LinuxDeployData" />
- </Extension>
-
<Extension path = "/MonoDevelop/Deployment/DeployDirectories">
<Condition id="Platform" value="linux">
<DeployDirectory id="Linux.PkgConfig" _label="pkg-config folder" />
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux.csproj b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux.csproj
index 795bf7eab9..e9a5783a2e 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux.csproj
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux.csproj
@@ -40,6 +40,36 @@
<NoWarn>1591;1573</NoWarn>
<DocumentationFile>..\..\..\..\build\AddIns\MonoDevelop.Deployment\MonoDevelop.Deployment.Linux.xml</DocumentationFile>
</PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugGnome|AnyCPU' ">
+ <DebugSymbols>True</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\..\..\..\build\AddIns\MonoDevelop.Deployment</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>False</ConsolePause>
+ <Execution>
+ <Execution clr-version="Net_2_0" />
+ </Execution>
+ <DefineConstants>DEBUG;GNOME</DefineConstants>
+ <NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\..\build\AddIns\MonoDevelop.Deployment\MonoDevelop.Deployment.Linux.xml</DocumentationFile>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseGnome|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>True</Optimize>
+ <OutputPath>..\..\..\..\build\AddIns\MonoDevelop.Deployment</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>False</ConsolePause>
+ <Execution>
+ <Execution clr-version="Net_2_0" />
+ </Execution>
+ <DebugSymbols>true</DebugSymbols>
+ <DefineConstants>GNOME</DefineConstants>
+ <NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\..\build\AddIns\MonoDevelop.Deployment\MonoDevelop.Deployment.Linux.xml</DocumentationFile>
+ </PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
<Project>{7525BB88-6142-4A26-93B9-A30C6983390A}</Project>
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/BasicOptionPanel.cs b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/BasicOptionPanel.cs
index a042798746..64a564bcff 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/BasicOptionPanel.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/BasicOptionPanel.cs
@@ -1,6 +1,7 @@
-
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
+using MonoDevelop.Projects;
namespace MonoDevelop.Deployment.Linux
{
@@ -12,9 +13,9 @@ namespace MonoDevelop.Deployment.Linux
{
}
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
- return (widget = new BasicOptionPanelWidget (ConfiguredSolutionItem, false));
+ return (widget = new BasicOptionPanelWidget ((Project) ConfiguredSolutionItem, false));
}
public override void ApplyChanges ()
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/BasicOptionPanelWidget.cs b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/BasicOptionPanelWidget.cs
index dd9d2e72cc..c1464cdb01 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/BasicOptionPanelWidget.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/BasicOptionPanelWidget.cs
@@ -10,9 +10,9 @@ namespace MonoDevelop.Deployment.Linux
[System.ComponentModel.ToolboxItem(true)]
public partial class BasicOptionPanelWidget : Gtk.Bin
{
- SolutionItem entry;
+ SolutionFolderItem entry;
- public BasicOptionPanelWidget (SolutionItem entry, bool creatingProject)
+ public BasicOptionPanelWidget (Project entry, bool creatingProject)
{
this.Build();
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopDisplayBinding.cs b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopDisplayBinding.cs
index 1b33518c28..c965434b68 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopDisplayBinding.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopDisplayBinding.cs
@@ -16,7 +16,7 @@ namespace MonoDevelop.Deployment.Linux
|| (mimeType != null && mimeType == "application/x-desktop");
}
- public IViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
+ public ViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
{
return new DotDesktopView ();
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopView.cs b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopView.cs
index 939f8b75df..6a3e10d45d 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopView.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/DotDesktopView.cs
@@ -1,10 +1,12 @@
using System;
+using MonoDevelop.Components;
+using System.Threading.Tasks;
using MonoDevelop.Ide.Gui;
namespace MonoDevelop.Deployment.Linux
{
- public class DotDesktopView: AbstractViewContent
+ public class DotDesktopView: ViewContent
{
DotDesktopViewWidget widget;
DesktopEntry entry;
@@ -25,20 +27,22 @@ namespace MonoDevelop.Deployment.Linux
}
}
- public override void Load (string fileName)
+ public override Task Load (FileOpenInformation fileOpenInformation)
{
- ContentName = fileName;
- entry.Load (fileName);
+ ContentName = fileOpenInformation.FileName;
+ entry.Load (fileOpenInformation.FileName);
widget.DesktopEntry = entry;
+ return Task.FromResult (true);
}
- public override void Save (string fileName)
+ public override Task Save (FileSaveInformation fileSaveInformation)
{
- entry.Save (fileName);
+ entry.Save (fileSaveInformation.FileName);
IsDirty = false;
+ return Task.FromResult (true);
}
- public override Gtk.Widget Control {
+ public override Control Control {
get { return widget; }
}
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/LinuxDeployData.cs b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/LinuxDeployData.cs
index 255b54257b..aed6187f73 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/LinuxDeployData.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment.Linux/MonoDevelop.Deployment.Linux/LinuxDeployData.cs
@@ -2,9 +2,13 @@
using System;
using MonoDevelop.Projects;
using MonoDevelop.Core.Serialization;
+using System.Xml;
+using System.IO;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.Deployment.Linux
{
+ [DataItem ("Deployment.LinuxDeployData")]
public class LinuxDeployData
{
[ItemProperty (DefaultValue=true)]
@@ -22,10 +26,9 @@ namespace MonoDevelop.Deployment.Linux
[ItemProperty (DefaultValue=true)]
bool generatePcFile = true;
- SolutionItem entry;
- bool connected;
-
- internal LinuxDeployData (SolutionItem entry)
+ Project entry;
+
+ internal LinuxDeployData (Project entry)
{
this.entry = entry;
}
@@ -34,44 +37,39 @@ namespace MonoDevelop.Deployment.Linux
{
}
- public static LinuxDeployData GetLinuxDeployData (SolutionItem entry)
+ public static LinuxDeployData GetLinuxDeployData (Project entry)
{
LinuxDeployData data = (LinuxDeployData) entry.ExtendedProperties ["Deployment.LinuxDeployData"];
- if (data != null) {
- if (data.entry == null) {
- data.Bind (entry);
- data.connected = true;
- }
- return data;
- }
-
- data = (LinuxDeployData) entry.ExtendedProperties ["Temp.Deployment.LinuxDeployData"];
if (data != null)
return data;
- data = CreateDefault (entry);
- entry.ExtendedProperties ["Temp.Deployment.LinuxDeployData"] = data;
- data.Bind (entry);
+ var elem = entry.MSBuildProject.GetMonoDevelopProjectExtension ("Deployment.LinuxDeployData");
+ if (elem != null) {
+ XmlDataSerializer ser = new XmlDataSerializer (new DataContext ());
+ data = (LinuxDeployData) ser.Deserialize (new XmlNodeReader (elem), typeof(LinuxDeployData));
+ } else {
+ data = CreateDefault (entry);
+ }
+ data.entry = entry;
+ entry.ExtendedProperties ["Deployment.LinuxDeployData"] = data;
return data;
}
- internal static LinuxDeployData CreateDefault (SolutionItem entry)
+ internal static LinuxDeployData CreateDefault (Project entry)
{
return new LinuxDeployData (entry);
}
- void Bind (SolutionItem entry)
- {
- this.entry = entry;
- }
-
void UpdateEntry ()
{
- if (connected)
- return;
- entry.ExtendedProperties ["Deployment.LinuxDeployData"] = this;
- entry.ExtendedProperties.Remove ("Temp.Deployment.LinuxDeployData");
- connected = true;
+ var ser = new DataSerializer (new DataContext ());
+ var data = ser.Serialize (this);
+
+ XmlDocument doc = new XmlDocument ();
+ var writer = new XmlConfigurationWriter { Namespace = MSBuildProject.Schema };
+ var elem = writer.Write (doc, data);
+
+ entry.MSBuildProject.SetMonoDevelopProjectExtension ("Deployment.LinuxDeployData", elem);
}
public string PackageName {
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/AddinInfo.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/AddinInfo.cs
index db9f908173..990811ac25 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/AddinInfo.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/AddinInfo.cs
@@ -6,7 +6,14 @@ using Mono.Addins.Description;
[assembly:Addin ("Deployment",
Namespace = "MonoDevelop",
Version = MonoDevelop.BuildInfo.Version,
- Category = "Deployment")]
+ Category = "Deployment",
+ EnabledByDefault =
+ #if GNOME
+ true
+ #else
+ false
+ #endif
+ )]
[assembly:AddinName ("Deployment Services Core")]
[assembly:AddinDescription ("Provides basic deployment services")]
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/ChangeLog b/main/src/addins/Deployment/MonoDevelop.Deployment/ChangeLog
deleted file mode 100644
index bd3996b701..0000000000
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/ChangeLog
+++ /dev/null
@@ -1,1092 +0,0 @@
-2010-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment/DefaultDeployServiceExtension.cs: Get
- the output file list using the new Project.GetOutputFiles
- method. This includes the output assembly, but also the
- debug info file and satellite assemblies.
-
-2010-06-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/PackagingProject.xpt.xml: Don't include the
- assembly name in the project type name since it doesn't work
- well when running on .NET
-
-2010-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Commands/Commands.cs:
- * MonoDevelop.Deployment.Gui/DeployOperations.cs: Fix
- incorrect use of ShowCustomDialog/RunCustomDialog.
-
-2010-05-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Deployment.Commands/Commands.cs:
- * MonoDevelop.Deployment.Gui/DeployOperations.cs: More dialog
- placing.
-
-2010-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Targets/CommandPackageBuilder.cs:
- Track api changes.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Deployment.addin.xml: Bumped MD version.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Deployment.csproj:
- * MonoDevelop.Deployment.addin.xml:
- * MonoDevelop.Deployment/PackageBuilder.cs:
- * MonoDevelop.Deployment.Gui/DeployDialog.cs:
- * MonoDevelop.Deployment.Commands/Commands.cs:
- * MonoDevelop.Deployment.Gui/DeployOperations.cs:
- * MonoDevelop.Deployment.Gui/EditPackageDialog.cs:
- * MonoDevelop.Deployment.Gui/EntrySelectionTree.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs:
- * MonoDevelop.Deployment.Gui/DialogFileReplacePolicy.cs:
- * MonoDevelop.Deployment.NodeBuilders/PackageNodeBuilder.cs:
- * MonoDevelop.Deployment.NodeBuilders/PackagingProjectNodeBuilder.cs:
- Merged MD.Projects into MD.Core, and MD.Projects.Gui,
- MD.Core.Gui and MD.Components into MD.Ide.
-
-2010-03-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Deployment/DeployProperties.cs: Track
- ProjectFile Link API.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Gui/PackagingFeature.cs: Track api
- changes.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.InstallDialog.cs:
- * gtk-gui/MonoDevelop.Deployment.FileReplaceDialog.cs:
- * gtk-gui/MonoDevelop.Deployment.DeployFileListWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.EntrySelectionTree.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.PackagingFeatureWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.SourcesZipEditorWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.BinariesZipEditorWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.CommandDeployEditorWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.FileCopyConfigurationSelector.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.LocalFileCopyConfigurationEditorWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.SshFuseFileCopyConfigurationEditorWidget.cs:
- Flush.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/PackagingProject.xpt.xml: Move to Other category.
-
-2009-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment/IDeployable.cs:
- * MonoDevelop.Deployment/DeployService.cs:
- * MonoDevelop.Deployment/PackageBuilder.cs:
- * MonoDevelop.Deployment/InstallResolver.cs:
- * MonoDevelop.Deployment/PackagingProject.cs:
- * MonoDevelop.Deployment.Gui/DeployOperations.cs:
- * MonoDevelop.Deployment/DeployServiceExtension.cs:
- * MonoDevelop.Deployment.Gui/DeployFileListWidget.cs:
- * MonoDevelop.Deployment/DefaultDeployServiceExtension.cs:
- * MonoDevelop.Deployment.Targets/BinariesZipPackageBuilder.cs:
- Introduced the ConfigurationSelector class to all methods
- that previously took a configuration name as string. This
- eliminates the ambiguity between solution configuration
- names and project configuration names.
-
-2009-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment/DefaultDeployServiceExtension.cs: Use
- a runtime-dependent method for getting the debug info file
- of an assembly.
-
-2009-11-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Deployment/DefaultDeployServiceExtension.cs: Fix
- .mdb filenames.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Deployment.addin.xml: Bump MD version.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment\DefaultDeployServiceExtension.cs:
- When targetting MS.NET, deploy .pdb files instead of .mdb.
-
- * MonoDevelop.Deployment.Gui\DialogFileReplacePolicy.cs: Use
- better method for making a sync call in the gui thread.
- Fixes bug #550806.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * MonoDevelop.Deployment.csproj:
- * gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.InstallDialog.cs:
- * gtk-gui/MonoDevelop.Deployment.FileReplaceDialog.cs:
- * gtk-gui/MonoDevelop.Deployment.DeployFileListWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.EntrySelectionTree.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.PackagingFeatureWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.SourcesZipEditorWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.BinariesZipEditorWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.CommandDeployEditorWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.FileCopyConfigurationSelector.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.LocalFileCopyConfigurationEditorWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.SshFuseFileCopyConfigurationEditorWidget.cs:
- Flush.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Deployment.addin.xml: Bump MD version.
-
-2009-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Gui/DeployFileListWidget.cs: Fix
- FilePath conversion issue.
-
-2009-09-09 Christian Hergert <chris@dronelabs.com>
-
- * MonoDevelop.Deployment.Commands/Commands.cs: Set dialog transient
- for the root window.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.csproj: Updated dependencies. We now
- depend on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment/PackageBuilder.cs: When running on
- command line, don't try to get the opened solution.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Targets/BinariesZipPackageBuilder.cs:
- Improve error reporting.
-
-2009-08-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml: Enable serialization of
- the "Deploy" property. Fixes bug #521374.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Deployment.Gui.SourcesZipEditorWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.BinariesZipEditorWidget.cs:
- Flush.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.NodeBuilders/PackagingProjectNodeBuilder.cs:
- Use the new api for removing projects from a solution.
-
- * MonoDevelop.Deployment.csproj: Don't use a specific version
- for SharpZipLib.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs:
- * gtk-gui/MonoDevelop.Deployment.FileReplaceDialog.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.InstallDialog.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs:
- Flush.
-
-2009-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment/DeployDirectoryInfo.cs:
- * MonoDevelop.Deployment.Gui/DeployDirectoryInfoEditor.cs:
- Track api changes.
-
-2009-06-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.NodeBuilders/PackageNodeBuilder.cs:
- * MonoDevelop.Deployment.NodeBuilders/PackagingProjectNodeBuilder.cs:
- Use the new DesktopService instead of PlatformService.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment\DeployFile.cs: Use the new FilePath
- class for handling file and directory paths.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Deployment.Gui/DeployDialog.cs:
- * MonoDevelop.Deployment.Gui/EditPackageDialog.cs: Renamed
- PixbufService to ImageService.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Deployment.Gui/DeployDialog.cs:
- * MonoDevelop.Deployment.Gui/EditPackageDialog.cs: Track API
- changes.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.Deployment.csproj: don't require specific
- gtk-sharp version.
-
-2009-04-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Deployment.Gui/EntrySelectionTree.cs: Removed
- project service.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Deployment.addin.xml: Bump MD version.
-
-2009-03-13 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * MonoDevelop.Deployment.Targets/SshFuseFileCopyHandler.cs:
- Making some strings not translatable.
-
-2009-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Deployment.Gui/PropertyProvider.cs: Worked on
- propertygrid localization.
-
-2009-02-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml: Track merge of the project
- pad context menu.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.mdp:
- * MonoDevelop.Deployment.csproj: Migrated to MSBuild file
- format.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Deployment.addin.xml: Bump MD version.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Deployment.mdp: Flush project format changes.
-
-2009-01-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * gtk-gui/objects.xml:
- * gtk-gui/generated.cs:
- * MonoDevelop.Deployment.mdp:
- * gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs:
- * gtk-gui/MonoDevelop.Deployment.FileReplaceDialog.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.InstallDialog.cs:
- * gtk-gui/MonoDevelop.Deployment.DeployFileListWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.EntrySelectionTree.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.SourcesZipEditorWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.PackagingFeatureWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.BinariesZipEditorWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.CommandDeployEditorWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.FileCopyConfigurationSelector.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.LocalFileCopyConfigurationEditorWidget.cs:
- * gtk-gui/MonoDevelop.Deployment.Gui.SshFuseFileCopyConfigurationEditorWidget.cs:
- Updated generated code and removed objects.xml, which is not required
- anymore.
-
-2008-12-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml: Fix label.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.mdp: All projects now require fx 3.5.
-
-2008-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.mdp: No specific version of Mono.Addins is
- required.
-
-2008-12-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml: Hide/protect add-ins.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Make it work for parallel build.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic: Flush.
-
- * AssemblyInfo.cs: Add AssemblyInfo.cs files that are autogenerated from
- the addin manifests.
-
-2008-11-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Deployment.Gui/DeployFileListWidget.cs: Null check to
- prevent NRE.
-
-2008-11-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Fix build dependencies.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml: Bump MD version.
-
-2008-10-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Deployment/MD1Serializer.cs: Another shot at BuildAction
- mapping, with comments.
-
-2008-10-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Deployment/MD1Serializer.cs: Add missing deploy key,
- remove unused variable.
-
-2008-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Deployment.addin.xml, MonoDevelop.Deployment.mdp,
- MonoDevelop.Deployment/MD1Serializer.cs,
- MonoDevelop.Deployment/DefaultDeployServiceExtension.cs,
- MonoDevelop.Deployment/DeployProjectServiceExtension.cs,
- MonoDevelop.Deployment/DeployContext.cs,
- MonoDevelop.Deployment/DeployProperties.cs,
- MonoDevelop.Deployment.Gui/PropertyProvider.cs, md1format.xml,
- MonoDevelop.Deployment.Targets/LocalFileCopyHandler.cs: Integrate
- deployment with the new "local copy" features in core. MD1 format
- compatibility is a little ugly.
- * Makefile.am: Added quick property for enabling translation of files.
- Supports multi-select.
-
-2008-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.mdp: Updated projects.
-
-2008-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml: Add icon for Create Package
- command.
- * MonoDevelop.Deployment/DefaultDeployServiceExtension.cs: Fix bug
- #422764 - Support "App.config" as well as "app.config" (lowercase)
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Deployment.Gui.InstallDialog.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.EntrySelectionTree.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.LocalFileCopyConfigurationEditorWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.BinariesZipEditorWidget.cs,
- gtk-gui/objects.xml,
- gtk-gui/MonoDevelop.Deployment.Gui.FileCopyConfigurationSelector.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.PackagingFeatureWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.CommandDeployEditorWidget.cs,
- gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.Deployment.FileReplaceDialog.cs,
- gtk-gui/MonoDevelop.Deployment.DeployFileListWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.SshFuseFileCopyConfigurationEditorWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.SourcesZipEditorWidget.cs,
- MonoDevelop.Deployment.Gui/SourcesZipEditorWidget.cs,
- MonoDevelop.Deployment.Gui/EntrySelectionTree.cs,
- MonoDevelop.Deployment.Gui/BinariesZipEditorWidget.cs,
- MonoDevelop.Deployment.Gui/DeployFileListWidget.cs,
- MonoDevelop.Deployment.Gui/FileCopyConfigurationSelector.cs,
- MonoDevelop.Deployment.Gui/PackagingFeatureWidget.cs: Updated
- generated code.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.NodeBuilders/PackagingProjectNodeBuilder.cs,
- MonoDevelop.Deployment.NodeBuilders/PackageNodeBuilder.cs: Moved
- the extensible tree view to its own directory.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Deployment.mdp: Removed some parts of the documentation
- service.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * md1format.xml,
- MonoDevelop.Deployment.Targets/BaseFuseFileCopyConfiguration.cs,
- MonoDevelop.Deployment.Targets/BinariesZipPackageBuilder.cs,
- MonoDevelop.Deployment.Targets/CommandPackageBuilder.cs,
- MonoDevelop.Deployment.Targets/LocalFileCopyConfiguration.cs,
- MonoDevelop.Deployment.Targets/SourcesZipPackageBuilder.cs,
- MonoDevelop.Deployment/DeployService.cs,
- MonoDevelop.Deployment/FileCopyConfiguration.cs,
- MonoDevelop.Deployment/InstallResolver.cs,
- MonoDevelop.Deployment/MD1Serializer.cs,
- MonoDevelop.Deployment/Package.cs,
- MonoDevelop.Deployment/PackageBuilder.cs,
- MonoDevelop.Deployment/PackageCollection.cs,
- MonoDevelop.Deployment/PackagingProject.cs,
- MonoDevelop.Deployment/UnknownFileCopyConfiguration.cs,
- MonoDevelop.Deployment/UnknownPackageBuilder.cs: Moved
- serialization engine to MonoDevelop.Core. Use new syntax for
- specifying attribute scope.
-
-2008-06-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml: Add missing serializable type.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment/DefaultDeployServiceExtension.cs,
- MonoDevelop.Deployment/DeployProjectServiceExtension.cs: Some
- parameter renames to make it more explicit that configuration names
- refer to solution configurations, not project configurations.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml: Bump MD version.
-
-2008-06-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Gui/DeployFileListWidget.cs,
- MonoDevelop.Deployment.Gui/DeployDirectoryInfoEditor.cs: Use the
- OnDestroyed event instead of Dispose, since with the latest changes
- in gtk#, Dispose is not called anymore when a widget is destroyed.
-
-2008-05-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment/DeployProjectServiceExtension.cs: Don't deploy
- files if the build failed.
-
-2008-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Targets/CommandPackageBuilder.cs: Track api
- changes.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml: Merged the extension points for
- project and solution option panels into a single extension point. A
- single extension point will now be used for all kinds of items.
- Extension conditions can be used to make panels visible only for
- some specific item types.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment/PackagingProject.cs,
- MonoDevelop.Deployment/DeployProjectServiceExtension.cs,
- MonoDevelop.Deployment.Targets/BinariesZipPackageBuilder.cs:
- Replaced ICompilerResult/DefaultCompilerResult/CompilerResults by a
- new BuildResult class, which has owner information at error level,
- so it is possible to know which project generated an error when
- building a solution. Updated Task and TaskService to use the new
- owner information.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml,
- MonoDevelop.Deployment.NodeBuilders/PackageNodeBuilder.cs,
- MonoDevelop.Deployment.NodeBuilders/PackagingProjectNodeBuilder.cs,
- MonoDevelop.Deployment.mdp,
- MonoDevelop.Deployment/MD1Serializer.cs,
- MonoDevelop.Deployment/PackagingProject.cs,
- MonoDevelop.Deployment/DeployService.cs,
- MonoDevelop.Deployment/DefaultDeployServiceExtension.cs,
- MonoDevelop.Deployment/UnknownPackageBuilder.cs,
- MonoDevelop.Deployment/InstallResolver.cs,
- MonoDevelop.Deployment/IDeployable.cs,
- MonoDevelop.Deployment/DeployFile.cs,
- MonoDevelop.Deployment/DeployProjectServiceExtension.cs,
- MonoDevelop.Deployment/PackageBuilder.cs,
- MonoDevelop.Deployment/DeployServiceExtension.cs,
- MonoDevelop.Deployment.Commands/Commands.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.BinariesZipEditorWidget.cs,
- gtk-gui/MonoDevelop.Deployment.DeployFileListWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs,
- gtk-gui/gui.stetic, MonoDevelop.Deployment.Gui/DeployDialog.cs,
- MonoDevelop.Deployment.Gui/SourcesZipEditorWidget.cs,
- MonoDevelop.Deployment.Gui/EditPackageDialog.cs,
- MonoDevelop.Deployment.Gui/InstallDialog.cs,
- MonoDevelop.Deployment.Gui/EntrySelectionTree.cs,
- MonoDevelop.Deployment.Gui/BinariesZipEditorWidget.cs,
- MonoDevelop.Deployment.Gui/DeployFileListWidget.cs,
- MonoDevelop.Deployment.Gui/DeployOperations.cs,
- MonoDevelop.Deployment.Gui/PackagingFeature.cs,
- MonoDevelop.Deployment.Gui/PackagingFeatureWidget.cs, Makefile.am,
- md1format.xml,
- MonoDevelop.Deployment.Targets/CommandPackageBuilder.cs,
- MonoDevelop.Deployment.Targets/BinariesZipPackageBuilder.cs,
- MonoDevelop.Deployment.Targets/SourcesZipPackageBuilder.cs: New
- project model changes.
-
-2008-05-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml: Removed obsolete attributes.
-
-2008-04-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Deployment.Targets/LocalFileCopyHandler.cs: Remove extra
- copy operation, thereby avoiding re-copying entire file every 1 kb,
- and vastly improving performance on large files. Thanks to
- firegrass on #MonoDevelop IRC for catching this bug.
-
-2008-03-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Deployment.Gui/DialogFileReplacePolicy.cs: Message
- service is no longer GUI-thread synched, so handle that here
- instead.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Deployment.NodeBuilders/PackageNodeBuilder.cs,
- MonoDevelop.Deployment.NodeBuilders/PackagingProjectNodeBuilder.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs, gtk-gui/gui.stetic,
- MonoDevelop.Deployment.Gui/DialogFileReplacePolicy.cs,
- MonoDevelop.Deployment.Gui/DeployDialog.cs,
- MonoDevelop.Deployment.Gui/EditPackageDialog.cs: Worked on gnome hig
- compliant alerts.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Deployment.mdp, Makefile.am: Removed some unused glade and
- gnome-sharp references (only the unused). But I'll continue to remove
- glade, we need to lower the dependency tree a bit.
-
-2008-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.NodeBuilders/PackageNodeBuilder.cs,
- MonoDevelop.Deployment.NodeBuilders/PackagingProjectNodeBuilder.cs:
- Handle the delete key in TreeViewPad, so it will work event if the
- shortcut is not defined.
-
-2008-02-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Deployment.addin.xml: Structured main menu.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml: Update MD version.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/objects.xml, gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs,
- gtk-gui/gui.stetic,
- MonoDevelop.Deployment.Gui/EditDeployTargetDialog.cs: Code cleanup.
-
-2008-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml: Updated add-in category and description.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/PackagingProject.xpt.xml: Make template categories translatable.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.mdp: Updated project files. The order of extended
- properties won't change anymore.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Deployment.Gui.FileCopyConfigurationSelector.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs, gtk-gui/gui.stetic,
- MonoDevelop.Deployment.Gui/FileCopyConfigurationSelector.cs: FileCopy*
- classes need to be public.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml,
- MonoDevelop.Deployment.NodeBuilders/PackageNodeBuilder.cs,
- MonoDevelop.Deployment.NodeBuilders/PackagingProjectNodeBuilder.cs,
- MonoDevelop.Deployment.mdp, MonoDevelop.Deployment/DeployData.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.EntrySelectionTree.cs,
- gtk-gui/objects.xml,
- gtk-gui/MonoDevelop.Deployment.Gui.FileCopyConfigurationSelector.cs,
- gtk-gui/MonoDevelop.Deployment.DeployFileListWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.SshFuseFileCopyConfigurationEditorWidget.cs,
- gtk-gui/gui.stetic,
- MonoDevelop.Deployment.Gui/SshFuseFileCopyConfigurationEditorWidget.cs,
- MonoDevelop.Deployment.Gui/SourcesZipEditorWidget.cs,
- MonoDevelop.Deployment.Gui/LocalFileCopyConfigurationEditor.cs,
- MonoDevelop.Deployment.Gui/LocalFileCopyConfigurationEditorWidget.cs,
- MonoDevelop.Deployment.Gui/BinariesZipEditorWidget.cs,
- MonoDevelop.Deployment.Gui/PackagingFeature.cs,
- MonoDevelop.Deployment.Gui/FileCopyConfigurationSelector.cs,
- MonoDevelop.Deployment.Gui/DeployDirectoryInfoEditor.cs,
- MonoDevelop.Deployment.Gui/CommandDeployEditorWidget.cs,
- MonoDevelop.Deployment.Gui/PackageBuilderEditor.cs,
- MonoDevelop.Deployment.Gui/SshFuseFileCopyConfigurationEditor.cs,
- Makefile.am,
- MonoDevelop.Deployment.Targets/LocalFileCopyConfiguration.cs,
- MonoDevelop.Deployment.Targets/BaseFuseFileCopyConfiguration.cs,
- MonoDevelop.Deployment.Targets/CommandPackageBuilder.cs,
- MonoDevelop.Deployment.Targets/BinariesZipPackageBuilder.cs,
- MonoDevelop.Deployment.Targets/LocalFileCopyHandler.cs,
- MonoDevelop.Deployment.Targets/BaseFuseFileCopyHandler.cs,
- MonoDevelop.Deployment.Targets/SourcesZipPackageBuilder.cs,
- MonoDevelop.Deployment.Targets/SshFuseFileCopyHandler.cs: API cleanup.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment/DeployDirectoryNodeType.cs,
- MonoDevelop.Deployment/DeployPlatformNodeType.cs: Fix warning.
- * gtk-gui/objects.xml, gtk-gui/gui.stetic: Updated.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml: Bump add-in versions.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml, MonoDevelop.Deployment.mdp,
- gtk-gui/gui.stetic, Makefile.am: Directory reorganization.
-
-2007-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment/DeployDirectoryNodeType.cs,
- MonoDevelop.Deployment/DeployPlatformNodeType.cs: Make some attributes
- localizable.
- * MonoDevelop.Deployment/PackageBuilder.cs: Added some null checks.
- * gtk-gui/objects.xml: Updated.
- * MonoDevelop.Deployment.Gui/EntrySelectionTree.cs: Avoid nullref when
- creating the project.
- * MonoDevelop.Deployment.Gui/PackagingFeature.cs,
- MonoDevelop.Deployment.Gui/PackagingFeatureWidget.cs: Show the packaging
- feature widget when creating a new packaging project.
-
-2007-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Deployment/DeployContext.cs,
- MonoDevelop.Deployment.Targets/SshFuseFileCopyHandler.cs,
- MonoDevelop.Deployment.Gui/PackageBuilderEditor.cs: Track LoggingService
- API changes.
-
-2007-11-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.Gui/DeployDialog.cs,
- MonoDevelop.Deployment.Gui/EntrySelectionTree.cs,
- MonoDevelop.Deployment.Gui/PackagingFeatureWidget.cs,
- MonoDevelop.Deployment/PackageBuilder.cs: Use RootCombine instead of
- CurrentOpenCombine when possible.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml: Bump MD version.
-
-2007-10-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml, MonoDevelop.Deployment.mdp,
- gtk-gui/objects.xml, Makefile.am, icons/packaging-project-16.png,
- icons/packaging-32.png, icons/packaging-16.png,
- icons/packaging-project-32.png, templates/PackagingProject.xpt.xml:
- Updated project icons. Use the base project icon with an overlay to show
- the type.
- * MonoDevelop.Deployment.Gui/EntrySelectionTree.cs: Track api changes.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/objects.xml, gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs,
- gtk-gui/gui.stetic: Updated.
- * MonoDevelop.Deployment.Gui/PackagingFeature.cs: Track api changes. Add
- description property.
- * MonoDevelop.Deployment.Gui/PackagingFeatureWidget.cs: If the only option
- is to create a new packaging project, don't show a checkbox, a label is
- enough.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.mdp: Project file names updated by change in MD
- path functions.
-
-2007-10-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Deployment/InstallResolver.cs,
- MonoDevelop.Deployment/DeployFile.cs,
- MonoDevelop.Deployment/DeployProjectServiceExtension.cs,
- MonoDevelop.Deployment/PackageBuilder.cs,
- MonoDevelop.Deployment.Targets/BinariesZipPackageBuilder.cs,
- MonoDevelop.Deployment.Targets/SourcesZipPackageBuilder.cs: Applied
- changes that were neccassary for to the new FileService.
-
-2007-10-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Deployment.addin.xml, MonoDevelop.Deployment.mdp,
- gtk-gui/objects.xml, gtk-gui/gui.stetic, Makefile.am: Updated.
- * gtk-gui/MonoDevelop.Deployment.Gui.SshFuseFileCopyConfigurationEditorWidget.cs,
- MonoDevelop.Deployment.Gui/SshFuseFileCopyConfigurationEditorWidget.cs,
- MonoDevelop.Deployment.Gui/SshFuseFileCopyConfigurationEditor.cs: New
- widget for editing SSH FUSE copy config.
- * MonoDevelop.Deployment.Gui/DialogFileReplacePolicy.cs: Remove old code.
- * MonoDevelop.Deployment.Gui/LocalFileCopyConfigurationEditor.cs,
- MonoDevelop.Deployment.Targets/LocalFileCopyConfiguration.cs,
- MonoDevelop.Deployment.Targets/BaseFuseFileCopyConfiguration.cs,
- MonoDevelop.Deployment.Targets/LocalFileCopyHandler.cs,
- MonoDevelop.Deployment.Targets/BaseFuseFileCopyHandler.cs: Base work to
- support FUSE file copiers.
- * MonoDevelop.Deployment.Targets/SshFuseFileCopyHandler.cs: New file deploy
- handler that copies files over an SSH FUSE connection to a remote
- computer.
-
-2007-09-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Deployment.mdp,
- gtk-gui/MonoDevelop.Deployment.Gui.EntrySelectionTree.cs,
- gtk-gui/objects.xml, gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.Deployment.DeployFileListWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs,
- gtk-gui/gui.stetic, Makefile.am: Updated.
- * MonoDevelop.Deployment/DeployService.cs: Actually register to handle file
- copier extensions.
- * MonoDevelop.Deployment/IFileCopyHandler.cs,
- MonoDevelop.Deployment/FileCopyHandler.cs: Pass DeployContext in
- CopyFiles operation so that directories can be resolved.
- * MonoDevelop.Deployment/UnknownFileCopyConfiguration.cs: New
- FriendlyLocation property that specifies how the location should be
- shown to the user.
- * MonoDevelop.Deployment/FileCopyConfiguration.cs: Implement
- FriendlyLocation. Track API change in CopyFiles.
- * MonoDevelop.Deployment/IFileReplacePolicy.cs: Name FileReplaceMode = 0 as
- NotSet.
- * gtk-gui/MonoDevelop.Deployment.Gui.FileCopyConfigurationSelector.cs,
- MonoDevelop.Deployment.Gui/FileCopyConfigurationSelector.cs: Make
- public.
- * gtk-gui/MonoDevelop.Deployment.FileReplaceDialog.cs,
- MonoDevelop.Deployment.Gui/DialogFileReplacePolicy.cs,
- MonoDevelop.Deployment.Gui/FileReplaceDialog.cs: Much, much better
- dialog IFileReplacePolicy implementation.
- * MonoDevelop.Deployment.Targets/LocalFileCopyConfiguration.cs: Implement
- FriendlyLocation. Make TargetLocation virtual so that inheriting classes
- can override it in order that it's handled correctly by the
- LocalFileCopyHandler.
- * MonoDevelop.Deployment.Targets/LocalFileCopyHandler.cs: Update handler so
- it can report progress to monitor, and also gives much better feedback
- on problems. Use DeployContext to look up target directories.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml, gtk-gui/gui.stetic: Bump MD version.
-
-2007-09-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Deployment.Gui.FileCopyConfigurationSelector.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.PackagingFeatureWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.InstallDialog.cs,
- gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.CommandDeployEditorWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.EntrySelectionTree.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.LocalFileCopyConfigurationEditorWidget.cs,
- gtk-gui/MonoDevelop.Deployment.DeployFileListWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.BinariesZipEditorWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.SourcesZipEditorWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs: Regenerated gui
- files.
-
-2007-09-15 Andrés G. Aragoneses <knocte@gmail.com>
-
- * gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs:
- * gtk-gui/gui.stetic: Don't translate "page#" texts.
-
-2007-09-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml: Cosmetic fix in command label.
-
-2007-08-23 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * MonoDevelop.Deployment/InstallResolver.cs: Added support for
- targets Include and IncludeRoot.
-
- * MonoDevelop.Deployment/TargetDirectory.cs: Added targets Include
- and IncludeRoot.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml: Removed the CommandService class.
- Everything is done directly with CommandManager. Moved all extension
- node types to MD.Components.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml,
- MonoDevelop.Deployment.NodeBuilders/PackageNodeBuilder.cs,
- MonoDevelop.Deployment.NodeBuilders/PackagingProjectNodeBuilder.cs,
- MonoDevelop.Deployment.mdp, MonoDevelop.Deployment/DeployService.cs,
- gtk-gui/objects.xml,
- MonoDevelop.Deployment.Gui/FileCopyConfigurationSelector.cs,
- MonoDevelop.Deployment.Gui/PackageBuilderEditor.cs, Makefile.am:
- Reorganized the extension point hierarchy. Embedded all add-in manifests
- as resources.
-
-2007-08-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.NodeBuilders/PackageNodeBuilder.cs,
- MonoDevelop.Deployment.NodeBuilders/PackagingProjectNodeBuilder.cs:
- Converted DispatchService to a static class.
-
-2007-07-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment/DeployContext.cs: Fix build.
-
-2007-07-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment/DeployContext.cs,
- MonoDevelop.Deployment.Gui/PackageBuilderEditor.cs: Use the log
- service for logging errors.
-
-2007-07-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment/InstallResolver.cs,
- MonoDevelop.Deployment/DeployFile.cs,
- MonoDevelop.Deployment/DeployProperties.cs,
- MonoDevelop.Deployment.Gui/PropertyProvider.cs: Added property for
- specifying the attributes that the deployed file will have.
- * gtk-gui/objects.xml, gtk-gui/gui.stetic: Updated.
-
-2007-06-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs,
- gtk-gui/objects.xml,
- gtk-gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs,
- gtk-gui/gui.stetic: Updated.
-
-2007-06-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs,
- gtk-gui/objects.xml, gtk-gui/gui.stetic: Updated.
-
-2007-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Deployment.Gui.FileCopyConfigurationSelector.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.PackagingFeatureWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.InstallDialog.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.CommandDeployEditorWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.EntrySelectionTree.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.LocalFileCopyConfigurationEditorWidget.cs,
- gtk-gui/MonoDevelop.Deployment.DeployFileListWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.BinariesZipEditorWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.SourcesZipEditorWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs: Made
- private gui components internal.
-
-2007-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment/DeployService.cs: Handle add-in unloading.
- * gtk-gui/gui.stetic, MonoDevelop.Deployment.Gui/DeployDialog.cs,
- MonoDevelop.Deployment.Gui/SourcesZipEditorWidget.cs,
- MonoDevelop.Deployment.Gui/EditPackageDialog.cs,
- MonoDevelop.Deployment.Gui/InstallDialog.cs,
- MonoDevelop.Deployment.Gui/EntrySelectionTree.cs,
- MonoDevelop.Deployment.Gui/LocalFileCopyConfigurationEditorWidget.cs,
- MonoDevelop.Deployment.Gui/BinariesZipEditorWidget.cs,
- MonoDevelop.Deployment.Gui/DeployFileListWidget.cs,
- MonoDevelop.Deployment.Gui/FileCopyConfigurationSelector.cs,
- MonoDevelop.Deployment.Gui/PackagingFeatureWidget.cs,
- MonoDevelop.Deployment.Gui/CommandDeployEditorWidget.cs: Made gui
- classes internal.
-
-2007-05-22 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Deployment.Gui/DeployOperations.cs (Install):
- Destroy dialog in finally block.
- (ShowPackageSettings): Likewise.
-
-2007-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml: Register the new property.
-
-2007-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment/DeployProperties.cs: Added
- UseProjecRelativePath property. When set, the file will be deployed
- to the same relative path it has in the project.
- * MonoDevelop.Deployment.Gui/PropertyProvider.cs: Use a custom type
- descriptor. Disable the deploy properties when the file is not set
- for deployment.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.mdp: Don't copy project references.
-
-2007-05-10 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.Deployment.mdp: Add MonoDevelop.Deployment.addin.xml
- back to the file list, but exclude from makefile synching.
-
-2007-05-09 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.Deployment/Makefile.am: Eliminate duplication of
- MonoDevelop.Deployment.addin.xml target.
-
-2007-05-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml: Added missing dependency.
- * MonoDevelop.Deployment.mdp, Makefile.am: Reference shared assemblies
- from the correct location.
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment/DeployProjectServiceExtension.cs: Avoid
- copying files when the target destination is the same file.
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml, MonoDevelop.Deployment.mdp,
- MonoDevelop.Deployment/DeployService.cs,
- MonoDevelop.Deployment/DeployDirectoryNodeType.cs,
- MonoDevelop.Deployment/DeployPlatformNodeType.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.InstallDialog.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs,
- gtk-gui/gui.stetic,
- MonoDevelop.Deployment.Gui/FileCopyConfigurationSelector.cs,
- MonoDevelop.Deployment.Gui/PackageBuilderEditor.cs, Makefile.am:
- Migration to Mono.Addins.
-
-2007-04-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml, MonoDevelop.Deployment.mdp,
- MonoDevelop.Deployment/DeployService.cs,
- MonoDevelop.Deployment/DeployProjectServiceExtension.cs,
- Makefile.am: After building a project, copy to the output directory
- all files marked with the deploy flag.
- * MonoDevelop.Deployment/DefaultDeployServiceExtension.cs: Rename
- app.config files to <assembly-name>.config when deploying.
-
-2007-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment/PackageBuilder.cs: Avoid including duplicated
- entries to the package builder.
- * MonoDevelop.Deployment.Gui/DeployDialog.cs: Minor fix.
- * MonoDevelop.Deployment.Gui/SourcesZipEditorWidget.cs: Properly select
- the default format (comparison is done now by name, since the file
- formant instances may be different).
- * MonoDevelop.Deployment.Gui/EntrySelectionTree.cs: Don't explicitely
- exclude PackagingProjects. The package builders will do it.
- * MonoDevelop.Deployment.Gui/PackagingFeatureWidget.cs: Include the
- parent combine in new packages.
- * MonoDevelop.Deployment.Targets/BinariesZipPackageBuilder.cs: Don't
- allow including PackagingProjects in the archive. Compile the
- project before generating the package.
- * MonoDevelop.Deployment.Targets/SourcesZipPackageBuilder.cs: Use the
- file format of the source project by default.
-
-2007-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.addin.xml,
- gtk-gui/MonoDevelop.Deployment.Gui.PackagingFeatureWidget.cs,
- gtk-gui/gui.stetic, MonoDevelop.Deployment.Gui/PackagingFeature.cs,
- MonoDevelop.Deployment.Gui/PackagingFeatureWidget.cs: Implemented a
- project feature which allows creating packages for new projects.
- * MonoDevelop.Deployment.NodeBuilders/PackageNodeBuilder.cs: Show the
- package type name if it is different from the package name.
- * MonoDevelop.Deployment.mdp, Makefile.am: Added new files.
- * MonoDevelop.Deployment/DeployService.cs: Added method for getting the
- extension of an archive.
- * MonoDevelop.Deployment/PackageBuilder.cs: Added DefaultName and
- CreateDefaultBuilders(). Implemented method for add-in new combine
- entries to the builder.
- * gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs,
- gtk-gui/objects.xml: Updated.
- * MonoDevelop.Deployment.Gui/DeployDialog.cs: Minor fixes.
- * MonoDevelop.Deployment.Gui/EntrySelectionTree.cs: Moved common
- combine selection code to PackageBuilder.
- * MonoDevelop.Deployment.Targets/BinariesZipPackageBuilder.cs,
- MonoDevelop.Deployment.Targets/SourcesZipPackageBuilder.cs:
- Implemented DefaultName and CreateDefaultBuilders().
- * BinariesZipEditorWidget.cs: Moved to GUI directory.
-
-2007-04-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment/PackagingProject.cs,
- MonoDevelop.Deployment.Commands/Commands.cs: Provide the package
- name when creating a new package.
- * MonoDevelop.Deployment/DeployService.cs: In GetDeployFiles, remove
- files excluded by the deploy context.
- * MonoDevelop.Deployment/DefaultDeployServiceExtension.cs: Clone the
- file list returned by IDeployable, since the list is going to be
- modified.
- * MonoDevelop.Deployment/DeployFile.cs: Added copy constructor.
- * MonoDevelop.Deployment/DeployContext.cs: Added method which allows
- filtering the deploy file list.
- * MonoDevelop.Deployment/PackageBuilder.cs: Added property which allows
- specifying files which have to be excluded from the package. If a
- combine is open in the IDE, try to get combine entries to package
- from it.
- * MonoDevelop.Deployment/DeployProperties.cs: TargetDirectory now
- returns ProgramFiles by default.
- * gtk-gui/MonoDevelop.Deployment.DeployFileListWidget.cs: Removed the
- Add button.
- * gtk-gui/objects.xml: Updated.
- * gtk-gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs,
- gtk-gui/gui.stetic,
- MonoDevelop.Deployment.Gui/EditPackageDialog.cs,
- MonoDevelop.Deployment.Gui/EntrySelectionTree.cs: Added a page for
- selecting the combine entries to deploy.
- * MonoDevelop.Deployment.Gui/DeployFileListWidget.cs: Allow selecting
- the files to deploy.
- * MonoDevelop.Deployment.Targets/BinariesZipPackageBuilder.cs: Track
- api changes.
- * MonoDevelop.Deployment.Targets/SourcesZipPackageBuilder.cs: Source
- package don't need a deploy context.
-
-2007-04-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Deployment.mdp, Makefile.am: Updated.
- * MonoDevelop.Deployment/PackagingProject.cs,
- MonoDevelop.Deployment/Package.cs,
- MonoDevelop.Deployment/PackageBuilder.cs: Store the path to the
- entry to package in the package builder. Allow specifying a list of
- child entries to be included in the package, in this way it is
- possible to create packages which include only some of the
- projects.
- * MonoDevelop.Deployment/DeployService.cs,
- MonoDevelop.Deployment/DeployServiceExtension.cs,
- MonoDevelop.Deployment.Commands/Commands.cs,
- MonoDevelop.Deployment.Gui/SourcesZipEditorWidget.cs,
- MonoDevelop.Deployment.Gui/IPackageBuilderEditor.cs,
- MonoDevelop.Deployment.Gui/PackageBuilderEditor.cs,
- MonoDevelop.Deployment.Targets/CommandPackageBuilder.cs,
- MonoDevelop.Deployment.Targets/BinariesZipPackageBuilder.cs,
- MonoDevelop.Deployment.Targets/SourcesZipPackageBuilder.cs: The
- combine entry to package (and the child entries to include) are now
- part of the package builder configuration.
- * MonoDevelop.Deployment/DefaultDeployServiceExtension.cs: Provide the
- source project in the deploy file constructor.
- * MonoDevelop.Deployment/UnknownPackageBuilder.cs,
- MonoDevelop.Deployment/InstallResolver.cs,
- BinariesZipEditorWidget.cs: Track api changes.
- * MonoDevelop.Deployment/DeployFile.cs: Added SourceCombineEntry, which
- returns the combine entry which generated this file, and
- DisplayName, which is a descriptive name of the file.
- * gtk-gui/MonoDevelop.Deployment.Gui.InstallDialog.cs,
- gtk-gui/MonoDevelop.Deployment.DeployFileListWidget.cs,
- gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs,
- gtk-gui/objects.xml,
- gtk-gui/MonoDevelop.Deployment.Gui.EditPackageDialog.cs,
- gtk-gui/gui.stetic: Implemented new deploy file list widget.
- Changed order of steps in the package creation wizard.
- * MonoDevelop.Deployment.Gui/DeployDialog.cs: Changed the order of some
- steps. The first step is now selecting the package type, and the
- second step is selecting the projects/solutions to include in the
- package.
- * MonoDevelop.Deployment.Gui/EditPackageDialog.cs,
- MonoDevelop.Deployment.Gui/DeployFileListWidget.cs: Added a new
- view which shows the list of files to be deployed.
- * MonoDevelop.Deployment.Gui/EntrySelectionTree.cs: Allow selecting
- multiple projects/solutions.
-
-2007-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- New deployment add-in. Some classes have been moved from MonoDevelop.Projects.
-
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Commands/Commands.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Commands/Commands.cs
index 0664524e34..175c6b5905 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Commands/Commands.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Commands/Commands.cs
@@ -18,7 +18,7 @@ namespace MonoDevelop.Deployment
{
protected override void Run ()
{
- SolutionItem entry = IdeApp.ProjectOperations.CurrentSelectedSolutionItem;
+ SolutionFolderItem entry = IdeApp.ProjectOperations.CurrentSelectedSolutionItem;
DeployDialog dlg = new DeployDialog (entry, false);
try {
if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) {
@@ -33,11 +33,11 @@ namespace MonoDevelop.Deployment
project.FileName = Path.Combine (dlg.NewProjectSolution.BaseDirectory, project.Name + ".mdse");
project.Packages.Add (p);
dlg.NewProjectSolution.Items.Add (project);
- IdeApp.ProjectOperations.Save (dlg.NewProjectSolution.ParentSolution);
+ IdeApp.ProjectOperations.SaveAsync (dlg.NewProjectSolution.ParentSolution);
}
else {
dlg.ExistingPackagingProject.Packages.Add (p);
- IdeApp.ProjectOperations.Save (dlg.ExistingPackagingProject);
+ IdeApp.ProjectOperations.SaveAsync (dlg.ExistingPackagingProject);
}
}
Package pkg = new Package (dlg.PackageBuilder);
@@ -64,7 +64,7 @@ namespace MonoDevelop.Deployment
try {
if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) {
project.AddPackage (dlg.NewPackageName, dlg.PackageBuilder);
- IdeApp.ProjectOperations.Save (project);
+ IdeApp.ProjectOperations.SaveAsync (project);
}
} finally {
dlg.Destroy ();
@@ -82,7 +82,7 @@ namespace MonoDevelop.Deployment
{
protected override void Run ()
{
- SolutionItem entry = IdeApp.ProjectOperations.CurrentSelectedSolutionItem;
+ SolutionFolderItem entry = IdeApp.ProjectOperations.CurrentSelectedSolutionItem;
DeployOperations.Install (entry, IdeApp.Workspace.ActiveConfiguration);
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployDialog.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployDialog.cs
index 7fa3039562..4fbe017f7b 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployDialog.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployDialog.cs
@@ -7,6 +7,7 @@ using MonoDevelop.Projects;
using MonoDevelop.Core;
using MonoDevelop.Ide;
using MonoDevelop.Components;
+using System.Linq;
namespace MonoDevelop.Deployment.Gui
{
@@ -16,11 +17,11 @@ namespace MonoDevelop.Deployment.Gui
List<PackageBuilder> builders = new List<PackageBuilder> ();
PackageBuilder currentBuilder;
Gtk.Widget currentEditor;
- ReadOnlyCollection<SolutionFolder> combineList;
- ReadOnlyCollection<PackagingProject> projectsList;
- SolutionItem defaultEntry;
+ List<SolutionFolder> combineList;
+ List<PackagingProject> projectsList;
+ SolutionFolderItem defaultEntry;
- public DeployDialog (SolutionItem defaultEntry, bool createBuilderOnly)
+ public DeployDialog (SolutionFolderItem defaultEntry, bool createBuilderOnly)
{
this.Build();
notebook.ShowTabs = false;
@@ -104,7 +105,7 @@ namespace MonoDevelop.Deployment.Gui
{
// Fill the combine list
int n=0, sel=-1;
- combineList = IdeApp.ProjectOperations.CurrentSelectedSolution.GetAllSolutionItems<SolutionFolder> ();
+ combineList = IdeApp.ProjectOperations.CurrentSelectedSolution.GetAllItems<SolutionFolder> ().ToList ();
foreach (SolutionFolder c in combineList) {
string name = c.Name;
SolutionFolder co = c;
@@ -121,7 +122,7 @@ namespace MonoDevelop.Deployment.Gui
comboCreateProject.Active = 0;
// Fill the packaging project list
- projectsList = IdeApp.ProjectOperations.CurrentSelectedSolution.GetAllSolutionItems<PackagingProject> ();
+ projectsList = IdeApp.ProjectOperations.CurrentSelectedSolution.GetAllItems<PackagingProject> ().ToList();
if (projectsList.Count == 0) {
radioAddProject.Sensitive = false;
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployOperations.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployOperations.cs
index be535a78bc..d3ee220353 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployOperations.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DeployOperations.cs
@@ -3,14 +3,15 @@ using System.Collections;
using MonoDevelop.Core;
using MonoDevelop.Ide;
using MonoDevelop.Projects;
+using System.Threading.Tasks;
namespace MonoDevelop.Deployment.Gui
{
public static class DeployOperations
{
- public static void Install (SolutionItem entry, ConfigurationSelector configuration)
+ public static void Install (SolutionFolderItem entry, ConfigurationSelector configuration)
{
- using (IProgressMonitor mon = IdeApp.Workbench.ProgressMonitors.GetRunProgressMonitor ()) {
+ using (ProgressMonitor mon = IdeApp.Workbench.ProgressMonitors.GetRunProgressMonitor ()) {
InstallDialog dlg = new InstallDialog (entry);
try {
if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok)
@@ -22,36 +23,29 @@ namespace MonoDevelop.Deployment.Gui
}
}
- public static IAsyncOperation BuildPackages (PackagingProject project)
+ public static Task BuildPackages (PackagingProject project)
{
return BuildPackages (project.Packages);
}
- static IAsyncOperation BuildPackages (ICollection packages)
+ static async Task BuildPackages (ICollection packages)
{
- IProgressMonitor mon = IdeApp.Workbench.ProgressMonitors.GetToolOutputProgressMonitor (true);
+ ProgressMonitor mon = IdeApp.Workbench.ProgressMonitors.GetToolOutputProgressMonitor (true);
// Run the deploy command in a background thread to avoid
// deadlocks with the gui thread
- System.Threading.Thread t = new System.Threading.Thread (
- delegate () {
- using (mon) {
- mon.BeginTask ("Creating packages", packages.Count);
- foreach (Package p in packages) {
- DeployService.BuildPackage (mon, p);
- mon.Step (1);
- }
- mon.EndTask ();
+ using (mon) {
+ mon.BeginTask ("Creating packages", packages.Count);
+ foreach (Package p in packages) {
+ await DeployService.BuildPackage (mon, p);
+ mon.Step (1);
}
- });
- t.IsBackground = true;
- t.Start ();
-
- return mon.AsyncOperation;
+ mon.EndTask ();
+ }
}
- public static IAsyncOperation BuildPackage (Package package)
+ public static Task BuildPackage (Package package)
{
return BuildPackages (new object[] { package });
}
@@ -60,7 +54,7 @@ namespace MonoDevelop.Deployment.Gui
{
using (EditPackageDialog dlg = new EditPackageDialog (package)) {
if (MessageService.ShowCustomDialog (dlg) == (int)Gtk.ResponseType.Ok)
- IdeApp.ProjectOperations.Save (package.ParentProject);
+ IdeApp.ProjectOperations.SaveAsync (package.ParentProject);
}
}
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DialogFileReplacePolicy.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DialogFileReplacePolicy.cs
index 3d9f2fda4e..1552b656cb 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DialogFileReplacePolicy.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/DialogFileReplacePolicy.cs
@@ -27,7 +27,7 @@
//
using System;
-
+using MonoDevelop.Core;
using MonoDevelop.Deployment;
using MonoDevelop.Ide;
@@ -58,10 +58,10 @@ namespace MonoDevelop.Deployment.Gui
//IFileReplacePolicy is not likely to be running in the GUI thread
//so use some DispatchService magic to synchronously call the dialog in the GUI thread
- DispatchService.GuiSyncDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
using (var dialog = new FileReplaceDialog (response, source, sourceModified.ToString (), target, targetModified.ToString ()))
response = (FileReplaceDialog.ReplaceResponse) MessageService.ShowCustomDialog (dialog);
- });
+ }).Wait ();
switch (response) {
case FileReplaceDialog.ReplaceResponse.Replace:
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/EditPackageDialog.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/EditPackageDialog.cs
index 7c2b81062e..58049d30d0 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/EditPackageDialog.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/EditPackageDialog.cs
@@ -54,7 +54,7 @@ namespace MonoDevelop.Deployment.Gui
protected virtual void OnEntrySelectorSelectionChanged(object sender, System.EventArgs e)
{
- SolutionItem ce = entrySelector.GetSelectedEntry ();
+ SolutionFolderItem ce = entrySelector.GetSelectedEntry ();
if (ce != null)
target.SetSolutionItem (ce, entrySelector.GetSelectedChildren ());
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/EntrySelectionTree.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/EntrySelectionTree.cs
index d5e531f3b8..662d2da34f 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/EntrySelectionTree.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/EntrySelectionTree.cs
@@ -7,6 +7,7 @@ using System.Collections.ObjectModel;
using MonoDevelop.Ide;
using MonoDevelop.Projects;
using MonoDevelop.Components;
+using System.Linq;
namespace MonoDevelop.Deployment.Gui
{
@@ -15,7 +16,7 @@ namespace MonoDevelop.Deployment.Gui
internal partial class EntrySelectionTree : Gtk.Bin
{
TreeStore store;
- Dictionary<SolutionItem,SolutionItem> selectedEntries = new Dictionary<SolutionItem,SolutionItem> ();
+ Dictionary<SolutionFolderItem,SolutionFolderItem> selectedEntries = new Dictionary<SolutionFolderItem,SolutionFolderItem> ();
PackageBuilder builder;
Solution solution;
@@ -44,13 +45,13 @@ namespace MonoDevelop.Deployment.Gui
tree.AppendColumn (col);
}
- public void Fill (PackageBuilder builder, SolutionItem selection)
+ public void Fill (PackageBuilder builder, SolutionFolderItem selection)
{
store.Clear ();
this.builder = builder;
if (selection is SolutionFolder) {
- foreach (SolutionItem e in ((SolutionFolder)selection).GetAllItems ()) {
+ foreach (SolutionFolderItem e in ((SolutionFolder)selection).GetAllItems ()) {
if (builder.CanBuild (e))
selectedEntries [e] = e;
}
@@ -64,17 +65,15 @@ namespace MonoDevelop.Deployment.Gui
else {
solution = IdeApp.ProjectOperations.CurrentSelectedSolution;
if (solution == null) {
- ReadOnlyCollection<Solution> items = IdeApp.ProjectOperations.CurrentSelectedWorkspaceItem.GetAllSolutions ();
- if (items.Count > 0)
- solution = items [0];
- else
+ solution = IdeApp.ProjectOperations.CurrentSelectedWorkspaceItem.GetAllItems<Solution> ().FirstOrDefault();
+ if (solution == null)
return;
}
}
AddEntry (TreeIter.Zero, solution.RootFolder);
}
- void AddEntry (TreeIter iter, SolutionItem entry)
+ void AddEntry (TreeIter iter, SolutionFolderItem entry)
{
string icon;
if (entry.ParentFolder == null)
@@ -101,49 +100,49 @@ namespace MonoDevelop.Deployment.Gui
tree.ExpandToPath (store.GetPath (iter));
if (entry is SolutionFolder) {
- foreach (SolutionItem ce in ((SolutionFolder)entry).Items) {
+ foreach (SolutionFolderItem ce in ((SolutionFolder)entry).Items) {
AddEntry (iter, ce);
}
}
}
- public void SetSelection (SolutionItem rootEntry, SolutionItem[] childEntries)
+ public void SetSelection (SolutionFolderItem rootEntry, SolutionFolderItem[] childEntries)
{
selectedEntries.Clear ();
selectedEntries [rootEntry] = rootEntry;
- foreach (SolutionItem e in childEntries)
+ foreach (SolutionFolderItem e in childEntries)
selectedEntries [e] = e;
UpdateSelectionChecks (TreeIter.Zero, true);
}
- public SolutionItem GetSelectedEntry ()
+ public SolutionFolderItem GetSelectedEntry ()
{
return GetCommonSolutionItem ();
}
- public SolutionItem[] GetSelectedChildren ()
+ public SolutionFolderItem[] GetSelectedChildren ()
{
// The first entry is the root entry
- SolutionItem common = GetCommonSolutionItem ();
+ SolutionFolderItem common = GetCommonSolutionItem ();
if (common == null)
return null;
ArrayList list = new ArrayList ();
- foreach (SolutionItem e in selectedEntries.Keys)
+ foreach (SolutionFolderItem e in selectedEntries.Keys)
if (e != common)
list.Add (e);
- return (SolutionItem[]) list.ToArray (typeof(SolutionItem));
+ return (SolutionFolderItem[]) list.ToArray (typeof(SolutionFolderItem));
}
void OnToggled (object sender, Gtk.ToggledArgs args)
{
TreeIter iter;
store.GetIterFromString (out iter, args.Path);
- SolutionItem ob = (SolutionItem) store.GetValue (iter, 2);
+ SolutionFolderItem ob = (SolutionFolderItem) store.GetValue (iter, 2);
if (selectedEntries.ContainsKey (ob)) {
selectedEntries.Remove (ob);
store.SetValue (iter, 3, false);
if (ob is SolutionFolder) {
- foreach (SolutionItem e in ((SolutionFolder)ob).GetAllItems ())
+ foreach (SolutionFolderItem e in ((SolutionFolder)ob).GetAllItems ())
selectedEntries.Remove (e);
UpdateSelectionChecks (TreeIter.Zero, false);
}
@@ -151,13 +150,13 @@ namespace MonoDevelop.Deployment.Gui
selectedEntries [ob] = ob;
store.SetValue (iter, 3, true);
if (ob is SolutionFolder) {
- foreach (SolutionItem e in ((SolutionFolder)ob).GetAllItems ()) {
+ foreach (SolutionFolderItem e in ((SolutionFolder)ob).GetAllItems ()) {
if (builder.CanBuild (e))
selectedEntries [e] = e;
}
UpdateSelectionChecks (TreeIter.Zero, false);
}
- SelectCommonCombine ((SolutionItem)ob);
+ SelectCommonCombine ((SolutionFolderItem)ob);
}
if (SelectionChanged != null)
SelectionChanged (this, EventArgs.Empty);
@@ -174,7 +173,7 @@ namespace MonoDevelop.Deployment.Gui
return;
}
do {
- bool sel = selectedEntries.ContainsKey ((SolutionItem) store.GetValue (iter, 2));
+ bool sel = selectedEntries.ContainsKey ((SolutionFolderItem) store.GetValue (iter, 2));
store.SetValue (iter, 3, sel);
if (sel)
tree.ExpandToPath (store.GetPath (iter));
@@ -183,16 +182,16 @@ namespace MonoDevelop.Deployment.Gui
while (store.IterNext (ref iter));
}
- void SelectCommonCombine (SolutionItem e)
+ void SelectCommonCombine (SolutionFolderItem e)
{
- SolutionItem common = GetCommonSolutionItem ();
+ SolutionFolderItem common = GetCommonSolutionItem ();
if (common == null)
return;
selectedEntries [common] = common;
- SolutionItem[] entries = new SolutionItem [selectedEntries.Count];
+ SolutionFolderItem[] entries = new SolutionFolderItem [selectedEntries.Count];
selectedEntries.Keys.CopyTo (entries, 0);
- foreach (SolutionItem se in entries) {
- SolutionItem ce = se;
+ foreach (SolutionFolderItem se in entries) {
+ SolutionFolderItem ce = se;
while (ce != null && ce != common) {
selectedEntries [ce] = ce;
ce = ce.ParentFolder;
@@ -201,7 +200,7 @@ namespace MonoDevelop.Deployment.Gui
UpdateSelectionChecks (TreeIter.Zero, false);
}
- SolutionItem GetCommonSolutionItem ()
+ SolutionFolderItem GetCommonSolutionItem ()
{
return PackageBuilder.GetCommonSolutionItem (selectedEntries.Keys);
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/InstallDialog.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/InstallDialog.cs
index 921eab2bb2..e82e53a0d9 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/InstallDialog.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/InstallDialog.cs
@@ -6,7 +6,7 @@ namespace MonoDevelop.Deployment.Gui
{
internal partial class InstallDialog : Gtk.Dialog
{
- public InstallDialog (SolutionItem entry)
+ public InstallDialog (SolutionFolderItem entry)
{
this.Build();
nameEntry.Text = entry.Name;
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/PackagingFeatureWidget.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/PackagingFeatureWidget.cs
index 75a45746c2..9f3b43045b 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/PackagingFeatureWidget.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/PackagingFeatureWidget.cs
@@ -4,6 +4,7 @@ using System.Collections;
using System.Collections.ObjectModel;
using MonoDevelop.Core;
using MonoDevelop.Projects;
+using System.Linq;
namespace MonoDevelop.Deployment.Gui
{
@@ -11,22 +12,22 @@ namespace MonoDevelop.Deployment.Gui
[System.ComponentModel.ToolboxItem(true)]
internal partial class PackagingFeatureWidget : Gtk.Bin
{
- SolutionItem entry;
+ SolutionFolderItem entry;
SolutionFolder parentFolder;
ArrayList packages = new ArrayList ();
PackagingProject newPackProject;
bool creatingPackProject;
- public PackagingFeatureWidget (SolutionFolder parentFolder, SolutionItem entry)
+ public PackagingFeatureWidget (SolutionFolder parentFolder, SolutionFolderItem entry)
{
this.Build();
this.entry = entry;
this.parentFolder = parentFolder;
-
+
creatingPackProject = entry is PackagingProject;
if (!creatingPackProject) {
- ReadOnlyCollection<PackagingProject> packProjects = parentFolder.ParentSolution.GetAllSolutionItems<PackagingProject> ();
+ var packProjects = parentFolder.ParentSolution.GetAllItems<PackagingProject> ().ToList ();
newPackProject = new PackagingProject ();
string label = GettextCatalog.GetString ("Create packages for this project in a new Packaging Project");
@@ -146,12 +147,12 @@ namespace MonoDevelop.Deployment.Gui
if (creatingPackProject) {
pb.SetSolutionItem (parentFolder.ParentSolution.RootFolder);
// Add all compatible projects
- foreach (SolutionItem e in parentFolder.ParentSolution.GetAllSolutionItems ()) {
+ foreach (SolutionFolderItem e in parentFolder.ParentSolution.GetAllSolutionItems ()) {
if (pb.CanBuild (e))
pb.AddEntry (e);
}
} else {
- pb.SetSolutionItem (parentFolder, new SolutionItem [] { entry });
+ pb.SetSolutionItem (parentFolder, new SolutionFolderItem [] { entry });
}
PackageBuilder[] defp = pb.CreateDefaultBuilders ();
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/SourcesZipEditorWidget.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/SourcesZipEditorWidget.cs
index 11422d8478..fd428d98ef 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/SourcesZipEditorWidget.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Gui/SourcesZipEditorWidget.cs
@@ -4,6 +4,8 @@ using System.Collections;
using System.IO;
using MonoDevelop.Projects;
using MonoDevelop.Deployment.Targets;
+using MonoDevelop.Projects.MSBuild;
+using System.Linq;
namespace MonoDevelop.Deployment.Gui
{
@@ -11,20 +13,20 @@ namespace MonoDevelop.Deployment.Gui
[System.ComponentModel.ToolboxItem(true)]
internal partial class SourcesZipEditorWidget : Gtk.Bin
{
- FileFormat[] formats;
+ MSBuildFileFormat[] formats;
SourcesZipPackageBuilder target;
bool loading;
- public SourcesZipEditorWidget (PackageBuilder target, FileFormat selectedFormat)
+ public SourcesZipEditorWidget (PackageBuilder target, MSBuildFileFormat selectedFormat)
{
this.Build();
this.target = (SourcesZipPackageBuilder) target;
loading = true;
if (target.RootSolutionItem is SolutionFolder)
- formats = Services.ProjectService.FileFormats.GetFileFormatsForObject (target.Solution);
+ formats = MSBuildFileFormat.GetSupportedFormats (target.Solution).ToArray ();
else
- formats = Services.ProjectService.FileFormats.GetFileFormatsForObject (target.RootSolutionItem);
+ formats = MSBuildFileFormat.GetSupportedFormats ((SolutionItem)target.RootSolutionItem).ToArray ();
if (selectedFormat == null) selectedFormat = this.target.FileFormat;
if (selectedFormat == null)
@@ -77,7 +79,7 @@ namespace MonoDevelop.Deployment.Gui
UpdateTarget ();
}
- public FileFormat Format {
+ public MSBuildFileFormat Format {
get { return formats [comboFormat.Active]; }
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.NodeBuilders/PackageNodeBuilder.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.NodeBuilders/PackageNodeBuilder.cs
index 9ac26fb2c2..07ee6b9f76 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.NodeBuilders/PackageNodeBuilder.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.NodeBuilders/PackageNodeBuilder.cs
@@ -39,13 +39,6 @@ namespace MonoDevelop.Deployment.NodeBuilders
{
internal class PackageNodeBuilder: TypeNodeBuilder
{
- EventHandler configsChanged;
-
- public PackageNodeBuilder ()
- {
- configsChanged = (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnConfigurationsChanged));
- }
-
public override Type CommandHandlerType {
get { return typeof(PackageNodeCommandHandler); }
}
@@ -81,13 +74,13 @@ namespace MonoDevelop.Deployment.NodeBuilders
public override void OnNodeAdded (object dataObject)
{
Package package = dataObject as Package;
- package.Changed += configsChanged;
+ package.Changed += OnConfigurationsChanged;
}
public override void OnNodeRemoved (object dataObject)
{
Package package = dataObject as Package;
- package.Changed -= configsChanged;
+ package.Changed -= OnConfigurationsChanged;
}
public void OnConfigurationsChanged (object sender, EventArgs args)
@@ -123,7 +116,7 @@ namespace MonoDevelop.Deployment.NodeBuilders
Package package = CurrentNode.DataItem as Package;
if (MessageService.AskQuestion (GettextCatalog.GetString ("Are you sure you want to delete the package '{0}'?", package.Name), AlertButton.Cancel, AlertButton.Delete) == AlertButton.Delete) {
package.ParentProject.Packages.Remove (package);
- IdeApp.ProjectOperations.Save (package.ParentProject);
+ IdeApp.ProjectOperations.SaveAsync (package.ParentProject);
}
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.NodeBuilders/PackagingProjectNodeBuilder.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.NodeBuilders/PackagingProjectNodeBuilder.cs
index 001fcccd4f..2bb36a5d35 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.NodeBuilders/PackagingProjectNodeBuilder.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.NodeBuilders/PackagingProjectNodeBuilder.cs
@@ -38,13 +38,6 @@ namespace MonoDevelop.Deployment.NodeBuilders
{
internal class PackagingProjectNodeBuilder: TypeNodeBuilder
{
- EventHandler configsChanged;
-
- public PackagingProjectNodeBuilder ()
- {
- configsChanged = (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnConfigurationsChanged));
- }
-
public override Type CommandHandlerType {
get { return typeof(PackagingProjectNodeCommandHandler); }
}
@@ -72,9 +65,7 @@ namespace MonoDevelop.Deployment.NodeBuilders
public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
{
PackagingProject project = dataObject as PackagingProject;
-
- foreach (Package p in project.Packages)
- builder.AddChild (p);
+ builder.AddChildren (project.Packages);
}
public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
@@ -86,13 +77,13 @@ namespace MonoDevelop.Deployment.NodeBuilders
public override void OnNodeAdded (object dataObject)
{
PackagingProject project = dataObject as PackagingProject;
- project.PackagesChanged += configsChanged;
+ project.PackagesChanged += OnConfigurationsChanged;
}
public override void OnNodeRemoved (object dataObject)
{
PackagingProject project = dataObject as PackagingProject;
- project.PackagesChanged -= configsChanged;
+ project.PackagesChanged -= OnConfigurationsChanged;
}
public void OnConfigurationsChanged (object sender, EventArgs args)
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/BaseFuseFileCopyHandler.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/BaseFuseFileCopyHandler.cs
index b93a173858..dfaca87060 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/BaseFuseFileCopyHandler.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/BaseFuseFileCopyHandler.cs
@@ -44,7 +44,7 @@ namespace MonoDevelop.Deployment.Targets
get { throw new NotImplementedException ("Inheriting classes must override this."); }
}
- public override void CopyFiles (IProgressMonitor monitor, IFileReplacePolicy replacePolicy, FileCopyConfiguration copyConfig, DeployFileCollection deployFiles, DeployContext context)
+ public override void CopyFiles (ProgressMonitor monitor, IFileReplacePolicy replacePolicy, FileCopyConfiguration copyConfig, DeployFileCollection deployFiles, DeployContext context)
{
DirectoryInfo tempDir = null;
try {
@@ -93,9 +93,9 @@ namespace MonoDevelop.Deployment.Targets
tempDir.Delete ();
}
- public abstract void MountTempDirectory (IProgressMonitor monitor, FileCopyConfiguration copyConfig, string tempPath);
+ public abstract void MountTempDirectory (ProgressMonitor monitor, FileCopyConfiguration copyConfig, string tempPath);
- protected void RunFuseCommand (IProgressMonitor monitor, string command, string args)
+ protected void RunFuseCommand (ProgressMonitor monitor, string command, string args)
{
LoggingService.LogInfo ("Running FUSE command: {0} {1}", command, args);
var log = new StringWriter ();
@@ -104,13 +104,12 @@ namespace MonoDevelop.Deployment.Targets
RedirectStandardOutput = true,
UseShellExecute = false,
};
- using (var opMon = new AggregatedOperationMonitor (monitor)) {
- using (var pWrapper = MonoDevelop.Core.Runtime.ProcessService.StartProcess (psi, log, log, null)) {
- opMon.AddOperation (pWrapper);
- pWrapper.WaitForOutput ();
- if (pWrapper.ExitCode != 0)
- throw new Exception (log.ToString ());
- }
+
+ using (var pWrapper = Runtime.ProcessService.StartProcess (psi, log, log, null))
+ using (monitor.CancellationToken.Register (pWrapper.Cancel)) {
+ pWrapper.WaitForOutput ();
+ if (pWrapper.ExitCode != 0)
+ throw new Exception (log.ToString ());
}
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/BinariesZipPackageBuilder.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/BinariesZipPackageBuilder.cs
index b663c990b9..2149ea019b 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/BinariesZipPackageBuilder.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/BinariesZipPackageBuilder.cs
@@ -39,7 +39,7 @@ namespace MonoDevelop.Deployment.Targets
get { return "Archive of Binaries"; }
}
- public override void InitializeSettings (SolutionItem entry)
+ public override void InitializeSettings (SolutionFolderItem entry)
{
targetFile = Path.Combine (entry.BaseDirectory, entry.Name) + ".tar.gz";
if (entry.ParentSolution != null)
@@ -51,7 +51,7 @@ namespace MonoDevelop.Deployment.Targets
return configuration != null ? new string [] { configuration } : new string [0];
}
- public override bool CanBuild (SolutionItem entry)
+ public override bool CanBuild (SolutionFolderItem entry)
{
// Can build anything but PackagingProject
return !(entry is PackagingProject);
@@ -62,18 +62,21 @@ namespace MonoDevelop.Deployment.Targets
return new DeployContext (this, platform, null);
}
- protected override bool OnBuild (IProgressMonitor monitor, DeployContext ctx)
+ protected override bool OnBuild (ProgressMonitor monitor, DeployContext ctx)
{
string tmpFolder = null;
-
+
try {
SolutionConfigurationSelector conf = (SolutionConfigurationSelector) configuration;
- BuildResult res = RootSolutionItem.Build (monitor, conf);
- if (res.ErrorCount > 0) {
- foreach (BuildError e in res.Errors)
- monitor.ReportError (e.ToString (), null);
- monitor.ReportError (GettextCatalog.GetString ("The source project failed to build."), null);
- return false;
+ var bt = RootSolutionItem as IBuildTarget;
+ if (bt != null) {
+ BuildResult res = bt.Build (monitor, conf).Result;
+ if (res.ErrorCount > 0) {
+ foreach (BuildError e in res.Errors)
+ monitor.ReportError (e.ToString (), null);
+ monitor.ReportError (GettextCatalog.GetString ("The source project failed to build."), null);
+ return false;
+ }
}
tmpFolder = FileService.CreateTempDirectory ();
@@ -107,8 +110,7 @@ namespace MonoDevelop.Deployment.Targets
if (tmpFolder != null)
Directory.Delete (tmpFolder, true);
}
- if (monitor.AsyncOperation.Success)
- monitor.Log.WriteLine (GettextCatalog.GetString ("Created file: {0}", targetFile));
+ monitor.Log.WriteLine (GettextCatalog.GetString ("Created file: {0}", targetFile));
return true;
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/CommandPackageBuilder.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/CommandPackageBuilder.cs
index 353331931a..d6e22cf712 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/CommandPackageBuilder.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/CommandPackageBuilder.cs
@@ -33,6 +33,7 @@ using MonoDevelop.Projects;
using MonoDevelop.Core.Serialization;
using MonoDevelop.Core;
using MonoDevelop.Core.Execution;
+using System.Threading;
namespace MonoDevelop.Deployment.Targets
{
@@ -49,7 +50,7 @@ namespace MonoDevelop.Deployment.Targets
}
public override string Icon {
- get { return "gtk-execute"; }
+ get { return MonoDevelop.Ide.Gui.Stock.RunProgramIcon; }
}
[ItemProperty]
@@ -88,12 +89,12 @@ namespace MonoDevelop.Deployment.Targets
}
}
- protected override bool OnBuild (IProgressMonitor monitor, DeployContext ctx)
+ protected override bool OnBuild (ProgressMonitor monitor, DeployContext ctx)
{
string consMsg;
- IConsole cons;
+ OperationConsole cons;
if (ExternalConsole) {
- cons = ExternalConsoleFactory.Instance.CreateConsole (CloseConsoleWhenDone);
+ cons = ExternalConsoleFactory.Instance.CreateConsole (CloseConsoleWhenDone, monitor.CancellationToken);
consMsg = GettextCatalog.GetString ("(in external terminal)");
} else {
cons = new MonitorConsole (monitor);
@@ -101,9 +102,9 @@ namespace MonoDevelop.Deployment.Targets
}
monitor.Log.WriteLine (GettextCatalog.GetString ("Executing: {0} {1} {2}", Command, Arguments, consMsg));
- IProcessAsyncOperation process = Runtime.ProcessService.StartConsoleProcess (Command, Arguments, workingDirectory, cons, null);
+ ProcessAsyncOperation process = Runtime.ProcessService.StartConsoleProcess (Command, Arguments, workingDirectory, cons);
- process.WaitForCompleted ();
+ process.Task.Wait ();
if (cons is MonitorConsole) {
((MonitorConsole)cons).Dispose ();
@@ -112,29 +113,24 @@ namespace MonoDevelop.Deployment.Targets
}
}
- class MonitorConsole: IConsole
+ class MonitorConsole: OperationConsole
{
StringReader nullReader;
- IProgressMonitor monitor;
+ ProgressMonitor monitor;
+ CancellationTokenRegistration tr;
- public MonitorConsole (IProgressMonitor monitor)
+ public MonitorConsole (ProgressMonitor monitor)
{
this.monitor = monitor;
- monitor.CancelRequested += OnCancel;
+ tr = monitor.CancellationToken.Register (CancellationSource.Cancel);
}
- public void Dispose ()
+ public override void Dispose ()
{
- monitor.CancelRequested -= OnCancel;
+ tr.Dispose ();
}
- void OnCancel (IProgressMonitor monitor)
- {
- if (CancelRequested != null)
- CancelRequested (this, EventArgs.Empty);
- }
-
- public TextReader In {
+ public override TextReader In {
get {
if (nullReader == null)
nullReader = new StringReader ("");
@@ -142,22 +138,16 @@ namespace MonoDevelop.Deployment.Targets
}
}
- public TextWriter Out {
+ public override TextWriter Out {
get { return monitor.Log; }
}
- public TextWriter Error {
+ public override TextWriter Error {
get { return monitor.Log; }
}
- public TextWriter Log {
+ public override TextWriter Log {
get { return Out; }
}
-
- public bool CloseOnDispose {
- get { return false; }
- }
-
- public event EventHandler CancelRequested;
}
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/LocalFileCopyHandler.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/LocalFileCopyHandler.cs
index f961d05edf..e143d62d39 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/LocalFileCopyHandler.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/LocalFileCopyHandler.cs
@@ -51,12 +51,12 @@ namespace MonoDevelop.Deployment.Targets
return new LocalFileCopyConfiguration ();
}
- public virtual void CopyFiles (IProgressMonitor monitor, IFileReplacePolicy replacePolicy, FileCopyConfiguration copyConfig, DeployFileCollection deployFiles, DeployContext context)
+ public virtual void CopyFiles (ProgressMonitor monitor, IFileReplacePolicy replacePolicy, FileCopyConfiguration copyConfig, DeployFileCollection deployFiles, DeployContext context)
{
InternalCopyFiles (monitor, replacePolicy, copyConfig, deployFiles, context, null);
}
- internal void InternalCopyFiles (IProgressMonitor monitor, IFileReplacePolicy replacePolicy, FileCopyConfiguration copyConfig, DeployFileCollection deployFiles, DeployContext context, string realPrefix)
+ internal void InternalCopyFiles (ProgressMonitor monitor, IFileReplacePolicy replacePolicy, FileCopyConfiguration copyConfig, DeployFileCollection deployFiles, DeployContext context, string realPrefix)
{
string targetDirectory = ((LocalFileCopyConfiguration) copyConfig).TargetDirectory;
@@ -111,7 +111,7 @@ namespace MonoDevelop.Deployment.Targets
long carry = 0;
monitor.BeginTask (copyConfig.FriendlyLocation, progressBarLength);
CopyReportCallback copyCallback = delegate (long bytes) {
- if (monitor.IsCancelRequested)
+ if (monitor.CancellationToken.IsCancellationRequested)
return false;
int steps = (int) (bytes / stepSize);
carry += bytes % stepSize;
@@ -127,7 +127,7 @@ namespace MonoDevelop.Deployment.Targets
//now the actual copy
foreach (DeployFileConf file in files) {
//abort the copy if cancelling
- if (monitor.IsCancelRequested)
+ if (monitor.CancellationToken.IsCancellationRequested)
break;
EnsureDirectoryExists (Path.GetDirectoryName (file.InternalTargetFile));
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/SourcesZipPackageBuilder.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/SourcesZipPackageBuilder.cs
index 83c06ffc2d..1fa649f2ee 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/SourcesZipPackageBuilder.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/SourcesZipPackageBuilder.cs
@@ -7,6 +7,7 @@ using MonoDevelop.Core;
using MonoDevelop.Core.ProgressMonitoring;
using MonoDevelop.Projects;
using MonoDevelop.Core.Serialization;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.Deployment.Targets
{
@@ -18,24 +19,24 @@ namespace MonoDevelop.Deployment.Targets
[ItemProperty]
string format;
- FileFormat fileFormat;
+ MSBuildFileFormat fileFormat;
public override string Description {
get { return "Archive of Sources"; }
}
- public override bool CanBuild (SolutionItem entry)
+ public override bool CanBuild (SolutionFolderItem entry)
{
- return entry is SolutionFolder || entry is SolutionEntityItem;
+ return entry is SolutionFolder || entry is SolutionItem;
}
- public FileFormat FileFormat {
+ public MSBuildFileFormat FileFormat {
get {
if (fileFormat == null) {
if (string.IsNullOrEmpty (format))
return null;
- foreach (FileFormat f in Services.ProjectService.FileFormats.GetAllFileFormats ()) {
+ foreach (var f in MSBuildFileFormat.GetSupportedFormats ()) {
if (f.GetType ().FullName == format) {
fileFormat = f;
break;
@@ -58,17 +59,17 @@ namespace MonoDevelop.Deployment.Targets
set { targetFile = value; }
}
- protected override bool OnBuild (IProgressMonitor monitor, DeployContext ctx)
+ protected override bool OnBuild (ProgressMonitor monitor, DeployContext ctx)
{
string sourceFile;
- SolutionItem entry = RootSolutionItem;
+ SolutionFolderItem entry = RootSolutionItem;
if (entry is SolutionFolder)
sourceFile = entry.ParentSolution.FileName;
else
- sourceFile = ((SolutionEntityItem)entry).FileName;
+ sourceFile = ((SolutionItem)entry).FileName;
AggregatedProgressMonitor mon = new AggregatedProgressMonitor ();
- mon.AddSlaveMonitor (monitor, MonitorAction.WriteLog|MonitorAction.ReportError|MonitorAction.ReportWarning|MonitorAction.ReportSuccess);
+ mon.AddFollowerMonitor (monitor, MonitorAction.WriteLog|MonitorAction.ReportError|MonitorAction.ReportWarning|MonitorAction.ReportSuccess);
string tmpFolder = FileService.CreateTempDirectory ();
@@ -81,13 +82,13 @@ namespace MonoDevelop.Deployment.Targets
// Export the project
- SolutionItem[] ents = GetChildEntries ();
+ SolutionFolderItem[] ents = GetChildEntries ();
string[] epaths = new string [ents.Length];
for (int n=0; n<ents.Length; n++)
epaths [n] = ents [n].ItemId;
- Services.ProjectService.Export (mon, sourceFile, epaths, folder, FileFormat);
- if (!mon.AsyncOperation.Success)
+ var r = Services.ProjectService.Export (mon, sourceFile, epaths, folder, FileFormat).Result;
+ if (string.IsNullOrEmpty (r))
return false;
// Create the archive
@@ -99,12 +100,11 @@ namespace MonoDevelop.Deployment.Targets
finally {
Directory.Delete (tmpFolder, true);
}
- if (monitor.AsyncOperation.Success)
- monitor.Log.WriteLine (GettextCatalog.GetString ("Created file: {0}", targetFile));
+ monitor.Log.WriteLine (GettextCatalog.GetString ("Created file: {0}", targetFile));
return true;
}
- public override void InitializeSettings (SolutionItem entry)
+ public override void InitializeSettings (SolutionFolderItem entry)
{
targetFile = Path.Combine (entry.BaseDirectory, entry.Name) + ".tar.gz";
if (entry.ParentSolution != null)
@@ -147,14 +147,15 @@ namespace MonoDevelop.Deployment.Targets
public override PackageBuilder[] CreateDefaultBuilders ()
{
List<PackageBuilder> list = new List<PackageBuilder> ();
-
- foreach (FileFormat format in Services.ProjectService.FileFormats.GetFileFormatsForObject (RootSolutionItem)) {
+
+ IMSBuildFileObject root = RootSolutionItem is SolutionItem ? (IMSBuildFileObject)RootSolutionItem : (IMSBuildFileObject) RootSolutionItem.ParentSolution;
+ foreach (MSBuildFileFormat format in MSBuildFileFormat.GetSupportedFormats (root)) {
SourcesZipPackageBuilder pb = (SourcesZipPackageBuilder) Clone ();
pb.FileFormat = format;
// The suffix for the archive will be the extension of the file format.
// If there is no extension, use the whole file name.
- string fname = format.GetValidFileName (RootSolutionItem, RootSolutionItem.ParentSolution.FileName);
+ string fname = format.GetValidFormatName (RootSolutionItem, RootSolutionItem.ParentSolution.FileName);
string suffix = Path.GetExtension (fname);
if (suffix.Length > 0)
suffix = suffix.Substring (1).ToLower (); // Remove the initial dot
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/SshFuseFileCopyHandler.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/SshFuseFileCopyHandler.cs
index fef148d5c1..4029434912 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/SshFuseFileCopyHandler.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.Targets/SshFuseFileCopyHandler.cs
@@ -42,7 +42,7 @@ namespace MonoDevelop.Deployment.Targets
get { return "SSH (FUSE)"; }
}
- public override void MountTempDirectory (IProgressMonitor monitor, FileCopyConfiguration copyConfig, string tempPath)
+ public override void MountTempDirectory (ProgressMonitor monitor, FileCopyConfiguration copyConfig, string tempPath)
{
SshFuseFileCopyConfiguration config = (SshFuseFileCopyConfiguration) copyConfig;
string fuseArgs = string.Format ("{0} {1} {2}", config.TargetDirectory, tempPath, config.ExtraMountArguments);
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.addin.xml b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.addin.xml
index 35e725d92f..7fcdefd213 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.addin.xml
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.addin.xml
@@ -4,7 +4,6 @@
<Category _name = "Deployment" id = "Deployment">
<Command id = "MonoDevelop.Deployment.Commands.CreatePackage"
defaultHandler = "MonoDevelop.Deployment.CreatePackageHandler"
- icon = "md-package"
_label = "Create Package..." />
<Command id = "MonoDevelop.Deployment.Commands.AddPackage"
defaultHandler = "MonoDevelop.Deployment.AddPackageHandler"
@@ -117,21 +116,8 @@
<Class class = "MonoDevelop.Deployment.Gui.PropertyProvider"/>
</Extension>
- <Extension path = "/MonoDevelop/ProjectModel/ExtendedProperties">
- <ItemProperty class = "MonoDevelop.Projects.ProjectFile"
- name = "DeployService.Deploy" type = "System.Boolean" />
- <ItemProperty class = "MonoDevelop.Projects.ProjectFile"
- name = "DeployService.TargetDirectoryId" type = "System.String" />
- <ItemProperty class = "MonoDevelop.Projects.ProjectFile"
- name = "DeployService.RelativeDeployPath" type = "System.String" />
- <ItemProperty class = "MonoDevelop.Projects.ProjectFile"
- name = "DeployService.HasPathReferences" type = "System.Boolean" />
- <ItemProperty class = "MonoDevelop.Projects.ProjectFile"
- name = "DeployService.UseProjectRelativePath" type = "System.Boolean" />
- </Extension>
-
<Extension path = "/MonoDevelop/Ide/ProjectTemplates">
- <ProjectTemplate id = "PackagingProject" resource = "PackagingProject.xpt.xml"/>
+ <ProjectTemplate id = "MonoDevelop.PackagingProject" resource = "PackagingProject.xpt.xml"/>
</Extension>
<Extension path = "/MonoDevelop/Ide/Pads/ProjectPad">
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.csproj b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.csproj
index 6950d93dc2..5369de6b67 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.csproj
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.csproj
@@ -40,6 +40,36 @@
<NoWarn>1591;1573</NoWarn>
<DocumentationFile>..\..\..\..\build\AddIns\MonoDevelop.Deployment\MonoDevelop.Deployment.xml</DocumentationFile>
</PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugGnome|AnyCPU' ">
+ <DebugSymbols>True</DebugSymbols>
+ <Optimize>false</Optimize>
+ <OutputPath>..\..\..\..\build\AddIns\MonoDevelop.Deployment</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>False</ConsolePause>
+ <Execution>
+ <Execution clr-version="Net_2_0" />
+ </Execution>
+ <DefineConstants>DEBUG;GNOME</DefineConstants>
+ <NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\..\build\AddIns\MonoDevelop.Deployment\MonoDevelop.Deployment.xml</DocumentationFile>
+ <DebugType>full</DebugType>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseGnome|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>True</Optimize>
+ <OutputPath>..\..\..\..\build\AddIns\MonoDevelop.Deployment</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>False</ConsolePause>
+ <Execution>
+ <Execution clr-version="Net_2_0" />
+ </Execution>
+ <DebugSymbols>true</DebugSymbols>
+ <DefineConstants>GNOME</DefineConstants>
+ <NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\..\build\AddIns\MonoDevelop.Deployment\MonoDevelop.Deployment.xml</DocumentationFile>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Mono.Posix" />
@@ -173,18 +203,72 @@
<EmbeddedResource Include="icons\package-16%402x.png">
<LogicalName>package-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\package-16~dark.png">
+ <LogicalName>package-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-16~dark%402x.png">
+ <LogicalName>package-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-16~sel.png">
+ <LogicalName>package-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-16~sel%402x.png">
+ <LogicalName>package-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-16~dark~sel.png">
+ <LogicalName>package-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-16~dark~sel%402x.png">
+ <LogicalName>package-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\package-32.png">
<LogicalName>package-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\package-32%402x.png">
<LogicalName>package-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\package-32~dark.png">
+ <LogicalName>package-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-32~dark%402x.png">
+ <LogicalName>package-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-32~sel.png">
+ <LogicalName>package-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-32~sel%402x.png">
+ <LogicalName>package-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-32~dark~sel.png">
+ <LogicalName>package-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-32~dark~sel%402x.png">
+ <LogicalName>package-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\package-48.png">
<LogicalName>package-48.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\package-48%402x.png">
<LogicalName>package-48@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\package-48~dark.png">
+ <LogicalName>package-48~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-48~dark%402x.png">
+ <LogicalName>package-48~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-48~sel.png">
+ <LogicalName>package-48~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-48~sel%402x.png">
+ <LogicalName>package-48~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-48~dark~sel.png">
+ <LogicalName>package-48~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-48~dark~sel%402x.png">
+ <LogicalName>package-48~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="gtk-gui\gui.stetic">
<LogicalName>gui.stetic</LogicalName>
</EmbeddedResource>
@@ -200,6 +284,12 @@
<EmbeddedResource Include="templates\images\packaging-project%402x.png">
<LogicalName>packaging-project@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="templates\images\packaging-project~dark.png">
+ <LogicalName>packaging-project~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="templates\images\packaging-project~dark%402x.png">
+ <LogicalName>packaging-project~dark@2x.png</LogicalName>
+ </EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DefaultDeployServiceExtension.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DefaultDeployServiceExtension.cs
index 52715746d0..3b6554e7be 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DefaultDeployServiceExtension.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DefaultDeployServiceExtension.cs
@@ -8,7 +8,7 @@ namespace MonoDevelop.Deployment
{
class DefaultDeployServiceExtension: DeployServiceExtension
{
- public override DeployFileCollection GetDeployFiles (DeployContext ctx, SolutionItem entry, ConfigurationSelector configuration)
+ public override DeployFileCollection GetDeployFiles (DeployContext ctx, SolutionFolderItem entry, ConfigurationSelector configuration)
{
if (entry is IDeployable)
return new DeployFileCollection (((IDeployable)entry).GetDeployFiles (configuration));
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DeployFile.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DeployFile.cs
index b8287104a5..e03eb8b89d 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DeployFile.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DeployFile.cs
@@ -44,7 +44,7 @@ namespace MonoDevelop.Deployment
string targetDirectoryID;
DeployContext deployContext;
bool isTemplate;
- SolutionItem sourceSolutionItem;
+ SolutionFolderItem sourceSolutionItem;
string displayName;
DeployFileAttributes attributes;
@@ -60,12 +60,12 @@ namespace MonoDevelop.Deployment
sourceSolutionItem = pfile.Project;
}
- public DeployFile (SolutionItem sourceSolutionItem, FilePath sourcePath, FilePath relativeTargetPath)
+ public DeployFile (SolutionFolderItem sourceSolutionItem, FilePath sourcePath, FilePath relativeTargetPath)
: this (sourceSolutionItem, sourcePath, relativeTargetPath, TargetDirectory.ProgramFiles)
{
}
- public DeployFile (SolutionItem sourceSolutionItem, FilePath sourcePath, FilePath relativeTargetPath, string targetDirectoryID)
+ public DeployFile (SolutionFolderItem sourceSolutionItem, FilePath sourcePath, FilePath relativeTargetPath, string targetDirectoryID)
{
this.targetDirectoryID = targetDirectoryID;
this.sourcePath = sourcePath;
@@ -78,7 +78,7 @@ namespace MonoDevelop.Deployment
this.deployContext = deployContext;
}
- public SolutionItem SourceSolutionItem {
+ public SolutionFolderItem SourceSolutionItem {
get { return sourceSolutionItem; }
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DeployProperties.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DeployProperties.cs
index 02fe988fd7..47db17e6ad 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DeployProperties.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DeployProperties.cs
@@ -18,16 +18,12 @@ namespace MonoDevelop.Deployment
get {
if (MarkedCopyToOutput)
return true;
-
- object val = file.ExtendedProperties ["DeployService.Deploy"];
- return val != null && (bool) val;
+
+ return file.Metadata.GetValue<bool> ("DeployService.Deploy", false);
}
set {
AssertNotCopyToOutput ();
- if (!value)
- file.ExtendedProperties.Remove ("DeployService.Deploy");
- else
- file.ExtendedProperties ["DeployService.Deploy"] = true;
+ file.Metadata.SetValue ("DeployService.Deploy", value, false);
}
}
@@ -36,19 +32,13 @@ namespace MonoDevelop.Deployment
get {
if (MarkedCopyToOutput)
return MonoDevelop.Deployment.TargetDirectory.ProgramFiles;
-
- string d = file.ExtendedProperties ["DeployService.TargetDirectoryId"] as string;
- if (string.IsNullOrEmpty (d))
- return MonoDevelop.Deployment.TargetDirectory.ProgramFiles;
- else
- return d;
+ return file.Metadata.GetValue ("DeployService.TargetDirectoryId", MonoDevelop.Deployment.TargetDirectory.ProgramFiles);
}
set {
AssertNotCopyToOutput ();
- if (string.IsNullOrEmpty (value) || value == MonoDevelop.Deployment.TargetDirectory.ProgramFiles)
- file.ExtendedProperties.Remove ("DeployService.TargetDirectoryId");
- else
- file.ExtendedProperties ["DeployService.TargetDirectoryId"] = value;
+ if (string.IsNullOrEmpty (value))
+ value = MonoDevelop.Deployment.TargetDirectory.ProgramFiles;
+ file.Metadata.SetValue ("DeployService.TargetDirectoryId", value, MonoDevelop.Deployment.TargetDirectory.ProgramFiles);
}
}
@@ -59,18 +49,14 @@ namespace MonoDevelop.Deployment
if (UseProjectRelativePath)
return file.ProjectVirtualPath;
- string s = file.ExtendedProperties ["DeployService.RelativeDeployPath"] as string;
- if (string.IsNullOrEmpty (s))
- return Path.GetFileName (file.Name);
- else
- return s;
+ return file.Metadata.GetValue ("DeployService.RelativeDeployPath", Path.GetFileName (file.Name));
}
set {
AssertNotCopyToOutput ();
- if (string.IsNullOrEmpty (value) || value == Path.GetFileName (file.Name))
- file.ExtendedProperties.Remove ("DeployService.RelativeDeployPath");
- else
- file.ExtendedProperties ["DeployService.RelativeDeployPath"] = value;
+ var defname = Path.GetFileName (file.Name);
+ if (string.IsNullOrEmpty (value))
+ value = defname;
+ file.Metadata.SetValue ("DeployService.RelativeDeployPath", value, defname);
}
}
@@ -78,16 +64,11 @@ namespace MonoDevelop.Deployment
get {
if (MarkedCopyToOutput)
return false;
-
- object val = file.ExtendedProperties ["DeployService.HasPathReferences"];
- return val != null && (bool) val;
+ return file.Metadata.GetValue ("DeployService.HasPathReferences", false);
}
set {
AssertNotCopyToOutput ();
- if (!value)
- file.ExtendedProperties.Remove ("DeployService.HasPathReferences");
- else
- file.ExtendedProperties ["DeployService.HasPathReferences"] = true;
+ file.Metadata.SetValue ("DeployService.HasPathReferences", value, false);
}
}
@@ -97,17 +78,13 @@ namespace MonoDevelop.Deployment
if (MarkedCopyToOutput)
return false;
- object val = file.ExtendedProperties ["DeployService.UseProjectRelativePath"];
- return val != null && (bool) val;
+ return file.Metadata.GetValue ("DeployService.UseProjectRelativePath", false);
}
set {
AssertNotCopyToOutput ();
- if (!value)
- file.ExtendedProperties.Remove ("DeployService.UseProjectRelativePath");
- else {
+ if (value)
RelativeDeployPath = "";
- file.ExtendedProperties ["DeployService.UseProjectRelativePath"] = true;
- }
+ file.Metadata.SetValue ("DeployService.UseProjectRelativePath", value, false);
}
}
@@ -115,16 +92,12 @@ namespace MonoDevelop.Deployment
get {
if (MarkedCopyToOutput)
return DeployFileAttributes.None;
-
- object val = file.ExtendedProperties ["DeployService.FileAttributes"];
- return val != null ? (DeployFileAttributes) val : DeployFileAttributes.None;
+
+ return file.Metadata.GetValue ("DeployService.FileAttributes", DeployFileAttributes.None);
}
set {
AssertNotCopyToOutput ();
- if (value == DeployFileAttributes.None)
- file.ExtendedProperties.Remove ("DeployService.FileAttributes");
- else
- file.ExtendedProperties ["DeployService.FileAttributes"] = value;
+ file.Metadata.SetValue ("DeployService.FileAttributes", value, DeployFileAttributes.None);
}
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DeployService.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DeployService.cs
index b6f9695245..51fbdf8329 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DeployService.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DeployService.cs
@@ -48,6 +48,7 @@ using ICSharpCode.SharpZipLib.Zip;
using System.Reflection;
using Mono.Unix.Native;
using Mono.Unix;
+using System.Threading.Tasks;
namespace MonoDevelop.Deployment
{
@@ -90,7 +91,7 @@ namespace MonoDevelop.Deployment
return props;
}
- public static PackageBuilder[] GetSupportedPackageBuilders (SolutionItem entry)
+ public static PackageBuilder[] GetSupportedPackageBuilders (SolutionFolderItem entry)
{
object[] builders = AddinManager.GetExtensionObjects ("/MonoDevelop/DeployService/PackageBuilders", false);
ArrayList list = new ArrayList ();
@@ -110,13 +111,13 @@ namespace MonoDevelop.Deployment
return (PackageBuilder[]) AddinManager.GetExtensionObjects ("/MonoDevelop/DeployService/PackageBuilders", typeof(PackageBuilder), false);
}
- public static void Install (IProgressMonitor monitor, SolutionItem entry, string prefix, string appName, ConfigurationSelector configuration)
+ public static void Install (ProgressMonitor monitor, SolutionFolderItem entry, string prefix, string appName, ConfigurationSelector configuration)
{
InstallResolver res = new InstallResolver ();
res.Install (monitor, entry, appName, prefix, configuration);
}
- public static void CreateArchive (IProgressMonitor mon, string folder, string targetFile)
+ public static void CreateArchive (ProgressMonitor mon, string folder, string targetFile)
{
string tf = Path.GetFileNameWithoutExtension (targetFile);
if (tf.EndsWith (".tar")) tf = Path.GetFileNameWithoutExtension (tf);
@@ -235,27 +236,29 @@ namespace MonoDevelop.Deployment
return null;
}
- public static bool BuildPackage (IProgressMonitor mon, Package package)
+ public static Task<bool> BuildPackage (ProgressMonitor mon, Package package)
{
return BuildPackage (mon, package.PackageBuilder);
}
- public static bool BuildPackage (IProgressMonitor mon, PackageBuilder builder)
+ public static Task<bool> BuildPackage (ProgressMonitor mon, PackageBuilder builder)
{
- DeployServiceExtension extensionChain = GetExtensionChain ();
- return extensionChain.BuildPackage (mon, builder);
+ return Task<bool>.Factory.StartNew (delegate {
+ DeployServiceExtension extensionChain = GetExtensionChain ();
+ return extensionChain.BuildPackage (mon, builder);
+ });
}
- public static DeployFileCollection GetDeployFiles (DeployContext ctx, SolutionItem[] entries, ConfigurationSelector configuration)
+ public static DeployFileCollection GetDeployFiles (DeployContext ctx, SolutionFolderItem[] entries, ConfigurationSelector configuration)
{
DeployFileCollection col = new DeployFileCollection ();
- foreach (SolutionItem e in entries) {
+ foreach (SolutionFolderItem e in entries) {
col.AddRange (GetDeployFiles (ctx, e, configuration));
}
return col;
}
- public static DeployFileCollection GetDeployFiles (DeployContext ctx, SolutionItem entry, ConfigurationSelector configuration)
+ public static DeployFileCollection GetDeployFiles (DeployContext ctx, SolutionFolderItem entry, ConfigurationSelector configuration)
{
ArrayList todel = new ArrayList ();
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DeployServiceExtension.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DeployServiceExtension.cs
index ef9335b420..4359230f6b 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DeployServiceExtension.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DeployServiceExtension.cs
@@ -9,7 +9,7 @@ namespace MonoDevelop.Deployment
{
internal DeployServiceExtension Next;
- public virtual bool BuildPackage (IProgressMonitor monitor, PackageBuilder builder)
+ public virtual bool BuildPackage (ProgressMonitor monitor, PackageBuilder builder)
{
if (Next != null)
return Next.BuildPackage (monitor, builder);
@@ -17,7 +17,7 @@ namespace MonoDevelop.Deployment
return builder.Build (monitor);
}
- public virtual DeployFileCollection GetDeployFiles (DeployContext ctx, SolutionItem entry, ConfigurationSelector configuration)
+ public virtual DeployFileCollection GetDeployFiles (DeployContext ctx, SolutionFolderItem entry, ConfigurationSelector configuration)
{
if (entry is SolutionFolder)
return GetCombineDeployFiles (ctx, (SolutionFolder) entry, configuration);
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/FileCopyConfiguration.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/FileCopyConfiguration.cs
index 0149d1040d..53c916d787 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/FileCopyConfiguration.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/FileCopyConfiguration.cs
@@ -69,7 +69,7 @@ namespace MonoDevelop.Deployment
get;
}
- public void CopyFiles (IProgressMonitor monitor, IFileReplacePolicy replacePolicy, DeployFileCollection files, DeployContext context)
+ public void CopyFiles (ProgressMonitor monitor, IFileReplacePolicy replacePolicy, DeployFileCollection files, DeployContext context)
{
Handler.CopyFiles (monitor, replacePolicy, this, files, context);
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/FileCopyHandler.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/FileCopyHandler.cs
index 38108b7ded..7b1f3c2f00 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/FileCopyHandler.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/FileCopyHandler.cs
@@ -59,7 +59,7 @@ namespace MonoDevelop.Deployment
return c;
}
- internal void CopyFiles (IProgressMonitor monitor, IFileReplacePolicy replacePolicy, FileCopyConfiguration copyConfig, DeployFileCollection files, DeployContext context)
+ internal void CopyFiles (ProgressMonitor monitor, IFileReplacePolicy replacePolicy, FileCopyConfiguration copyConfig, DeployFileCollection files, DeployContext context)
{
handler.CopyFiles (monitor, replacePolicy, copyConfig, files, context);
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/IFileCopyHandler.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/IFileCopyHandler.cs
index 58f41c36c7..1aabddc49e 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/IFileCopyHandler.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/IFileCopyHandler.cs
@@ -40,6 +40,6 @@ namespace MonoDevelop.Deployment
string Id { get; }
string Name { get; }
FileCopyConfiguration CreateConfiguration ();
- void CopyFiles (IProgressMonitor monitor, IFileReplacePolicy replacePolicy, FileCopyConfiguration copyConfig, DeployFileCollection files, DeployContext context);
+ void CopyFiles (ProgressMonitor monitor, IFileReplacePolicy replacePolicy, FileCopyConfiguration copyConfig, DeployFileCollection files, DeployContext context);
}
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/InstallResolver.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/InstallResolver.cs
index 50e1ca8951..778eb928ee 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/InstallResolver.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/InstallResolver.cs
@@ -40,7 +40,7 @@ namespace MonoDevelop.Deployment
{
string appName;
- public void Install (IProgressMonitor monitor, SolutionItem entry, string appName, string prefix, ConfigurationSelector configuration)
+ public void Install (ProgressMonitor monitor, SolutionFolderItem entry, string appName, string prefix, ConfigurationSelector configuration)
{
this.appName = appName;
@@ -49,9 +49,9 @@ namespace MonoDevelop.Deployment
}
}
- void InstallEntry (IProgressMonitor monitor, DeployContext ctx, SolutionItem entry, ConfigurationSelector configuration)
+ void InstallEntry (ProgressMonitor monitor, DeployContext ctx, SolutionFolderItem entry, ConfigurationSelector configuration)
{
- foreach (DeployFile df in DeployService.GetDeployFiles (ctx, new SolutionItem[] { entry }, configuration)) {
+ foreach (DeployFile df in DeployService.GetDeployFiles (ctx, new SolutionFolderItem[] { entry }, configuration)) {
string targetPath = df.ResolvedTargetFile;
if (targetPath == null) {
monitor.ReportWarning ("Could not copy file '" + df.RelativeTargetPath + "': Unknown target directory.");
@@ -64,7 +64,7 @@ namespace MonoDevelop.Deployment
SolutionFolder c = entry as SolutionFolder;
if (c != null) {
monitor.BeginTask ("Installing solution '" + c.Name + "'", c.Items.Count);
- foreach (SolutionItem ce in c.Items) {
+ foreach (SolutionFolderItem ce in c.Items) {
InstallEntry (monitor, ctx, ce, configuration);
monitor.Step (1);
}
@@ -72,7 +72,7 @@ namespace MonoDevelop.Deployment
}
}
- void CopyFile (IProgressMonitor monitor, string src, string dest, DeployFileAttributes atts)
+ void CopyFile (ProgressMonitor monitor, string src, string dest, DeployFileAttributes atts)
{
dest = FileService.GetFullPath (dest);
monitor.Log.WriteLine (GettextCatalog.GetString ("Deploying file {0}.", dest));
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/Package.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/Package.cs
index 8eeac21c76..13911d12a6 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/Package.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/Package.cs
@@ -6,6 +6,7 @@ using MonoDevelop.Core;
using MonoDevelop.Core.ProgressMonitoring;
using MonoDevelop.Projects;
using MonoDevelop.Core.Serialization;
+using System.Threading.Tasks;
namespace MonoDevelop.Deployment
{
@@ -46,11 +47,11 @@ namespace MonoDevelop.Deployment
set { builder = value; NotifyChanged (); }
}
- public bool Build (IProgressMonitor monitor)
+ public async Task<bool> Build (ProgressMonitor monitor)
{
- DeployService.BuildPackage (monitor, this);
+ var res = await DeployService.BuildPackage (monitor, this);
needsBuilding = false;
- return true;
+ return res;
}
public bool NeedsBuilding {
@@ -62,13 +63,14 @@ namespace MonoDevelop.Deployment
}
}
- public void Clean (IProgressMonitor monitor)
+ public void Clean (ProgressMonitor monitor)
{
needsBuilding = true;
}
void NotifyChanged ()
{
+ Runtime.AssertMainThread ();
if (Changed != null)
Changed (this, EventArgs.Empty);
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/PackageBuilder.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/PackageBuilder.cs
index 3df5f51486..6a06ad615b 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/PackageBuilder.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/PackageBuilder.cs
@@ -34,6 +34,8 @@ using MonoDevelop.Core;
using MonoDevelop.Core.ProgressMonitoring;
using MonoDevelop.Projects;
using MonoDevelop.Ide;
+using System.Threading.Tasks;
+using System.Linq;
namespace MonoDevelop.Deployment
{
@@ -50,8 +52,8 @@ namespace MonoDevelop.Deployment
[ItemProperty ("RootEntry")]
SolutionItemReference rootEntry;
- List<SolutionItem> childCombineEntries;
- SolutionItem rootSolutionItem;
+ List<SolutionFolderItem> childCombineEntries;
+ SolutionFolderItem rootSolutionItem;
public PackageBuilder ()
{
@@ -76,7 +78,7 @@ namespace MonoDevelop.Deployment
return null;
}
- internal bool Build (IProgressMonitor monitor)
+ internal bool Build (ProgressMonitor monitor)
{
monitor.BeginTask ("Package: " + Description, 1);
DeployContext ctx = null;
@@ -85,13 +87,11 @@ namespace MonoDevelop.Deployment
if (ctx != null)
ctx.FileFilter = this;
if (!OnBuild (monitor, ctx)) {
- monitor.AsyncOperation.Cancel ();
return false;
}
} catch (Exception ex) {
monitor.ReportError ("Package creation failed", ex);
LoggingService.LogError ("Package creation failed", ex);
- monitor.AsyncOperation.Cancel ();
return false;
} finally {
monitor.EndTask ();
@@ -101,12 +101,12 @@ namespace MonoDevelop.Deployment
return true;
}
- public virtual bool CanBuild (SolutionItem entry)
+ public virtual bool CanBuild (SolutionFolderItem entry)
{
return true;
}
- public virtual void InitializeSettings (SolutionItem entry)
+ public virtual void InitializeSettings (SolutionFolderItem entry)
{
}
@@ -123,7 +123,7 @@ namespace MonoDevelop.Deployment
rootEntry = other.rootEntry;
if (other.childCombineEntries != null)
- childCombineEntries = new List<SolutionItem> (other.childCombineEntries);
+ childCombineEntries = new List<SolutionFolderItem> (other.childCombineEntries);
else
childCombineEntries = null;
if (other.excludedFiles != null)
@@ -138,7 +138,7 @@ namespace MonoDevelop.Deployment
return new PackageBuilder [0];
}
- protected virtual bool OnBuild (IProgressMonitor monitor, DeployContext ctx)
+ protected virtual bool OnBuild (ProgressMonitor monitor, DeployContext ctx)
{
return true;
}
@@ -158,15 +158,15 @@ namespace MonoDevelop.Deployment
return new DeployContext (this, DeployService.CurrentPlatform, null);
}
- public void SetSolutionItem (SolutionItem entry)
+ public void SetSolutionItem (SolutionFolderItem entry)
{
SetSolutionItem (entry, null);
}
- public void SetSolutionItem (SolutionItem rootSolutionItem, IEnumerable<SolutionItem> childEntries)
+ public void SetSolutionItem (SolutionFolderItem rootSolutionItem, IEnumerable<SolutionFolderItem> childEntries)
{
this.rootSolutionItem = rootSolutionItem;
- childCombineEntries = new List<SolutionItem> ();
+ childCombineEntries = new List<SolutionFolderItem> ();
if (childEntries != null)
childCombineEntries.AddRange (childEntries);
@@ -187,11 +187,11 @@ namespace MonoDevelop.Deployment
{
this.rootEntry = new SolutionItemReference (rootSolutionItem);
this.childEntries.Clear ();
- foreach (SolutionItem e in childCombineEntries)
+ foreach (SolutionFolderItem e in childCombineEntries)
childEntries.Add (new SolutionItemReference (e));
}
- public SolutionItem RootSolutionItem {
+ public SolutionFolderItem RootSolutionItem {
get {
if (rootSolutionItem == null && rootEntry != null)
rootSolutionItem = GetEntry (rootEntry);
@@ -205,7 +205,7 @@ namespace MonoDevelop.Deployment
}
}
- public void AddEntry (SolutionItem entry)
+ public void AddEntry (SolutionFolderItem entry)
{
SolutionItemReference fp = new SolutionItemReference (entry);
foreach (SolutionItemReference s in childEntries)
@@ -215,7 +215,7 @@ namespace MonoDevelop.Deployment
if (rootEntry == fp)
return;
- List<SolutionItem> list = new List<SolutionItem> ();
+ List<SolutionFolderItem> list = new List<SolutionFolderItem> ();
if (RootSolutionItem != null)
list.Add (RootSolutionItem);
list.AddRange (GetChildEntries());
@@ -224,8 +224,8 @@ namespace MonoDevelop.Deployment
rootSolutionItem = GetCommonSolutionItem (list);
list.Remove (rootSolutionItem);
- foreach (SolutionItem e in list.ToArray ()) {
- SolutionItem ce = e.ParentFolder;
+ foreach (SolutionFolderItem e in list.ToArray ()) {
+ SolutionFolderItem ce = e.ParentFolder;
while (ce != rootSolutionItem) {
if (!list.Contains (ce))
list.Add (ce);
@@ -236,36 +236,36 @@ namespace MonoDevelop.Deployment
UpdateEntryNames ();
}
- public SolutionItem[] GetChildEntries ()
+ public SolutionFolderItem[] GetChildEntries ()
{
if (childCombineEntries != null)
return childCombineEntries.ToArray ();
- childCombineEntries = new List<SolutionItem> ();
+ childCombineEntries = new List<SolutionFolderItem> ();
foreach (SolutionItemReference en in childEntries) {
- SolutionItem re = GetEntry (en);
+ SolutionFolderItem re = GetEntry (en);
if (re != null && !(re is UnknownSolutionItem))
childCombineEntries.Add (re);
}
return childCombineEntries.ToArray ();
}
- public SolutionItem[] GetAllEntries ()
+ public SolutionFolderItem[] GetAllEntries ()
{
- List<SolutionItem> list = new List<SolutionItem> ();
+ List<SolutionFolderItem> list = new List<SolutionFolderItem> ();
if (RootSolutionItem != null)
list.Add (RootSolutionItem);
list.AddRange (GetChildEntries ());
return list.ToArray ();
}
- SolutionItem GetEntry (SolutionItemReference reference)
+ SolutionFolderItem GetEntry (SolutionItemReference reference)
{
if (IdeApp.IsInitialized)
- return Services.ProjectService.ReadSolutionItem (new NullProgressMonitor (), reference, IdeApp.Workspace.Items.ToArray ());
+ return Services.ProjectService.ReadSolutionItem (new ProgressMonitor (), reference, IdeApp.Workspace.Items.ToArray ()).Result;
else
- return Services.ProjectService.ReadSolutionItem (new NullProgressMonitor (), reference);
+ return Services.ProjectService.ReadSolutionItem (new ProgressMonitor (), reference).Result;
}
public virtual DeployFileCollection GetDeployFiles (DeployContext ctx, ConfigurationSelector configuration)
@@ -307,10 +307,10 @@ namespace MonoDevelop.Deployment
}
- internal static SolutionItem GetCommonSolutionItem (IEnumerable<SolutionItem> entries)
+ internal static SolutionFolderItem GetCommonSolutionItem (IEnumerable<SolutionFolderItem> entries)
{
- SolutionItem common = null;
- foreach (SolutionItem it in entries) {
+ SolutionFolderItem common = null;
+ foreach (SolutionFolderItem it in entries) {
if (common == null)
common = it;
else
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/PackagingProject.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/PackagingProject.cs
index 184b2dee9f..ebb504dd5b 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/PackagingProject.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/PackagingProject.cs
@@ -5,10 +5,11 @@ using System.Collections.Generic;
using MonoDevelop.Core;
using MonoDevelop.Projects;
using MonoDevelop.Core.Serialization;
+using System.Threading.Tasks;
namespace MonoDevelop.Deployment
{
- public class PackagingProject: SolutionEntityItem
+ public class PackagingProject: Project
{
PackageCollection packages;
@@ -16,6 +17,7 @@ namespace MonoDevelop.Deployment
public PackagingProject()
{
+ Initialize (this);
packages = new PackageCollection (this);
}
@@ -33,28 +35,24 @@ namespace MonoDevelop.Deployment
get { return packages; }
}
- public override SolutionItemConfiguration CreateConfiguration (string name)
+ protected override SolutionItemConfiguration OnCreateConfiguration (string id, ConfigurationKind kind)
{
- PackagingProjectConfiguration conf = new PackagingProjectConfiguration ();
- conf.Name = name;
- return conf;
+ return new PackagingProjectConfiguration (id);
}
- protected override void OnClean (IProgressMonitor monitor, ConfigurationSelector configuration)
+ protected override Task<BuildResult> OnClean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
foreach (Package p in packages)
p.Clean (monitor);
+ return Task.FromResult (BuildResult.CreateSuccess ());
}
- protected override BuildResult OnBuild (IProgressMonitor monitor, ConfigurationSelector configuration)
+ protected async override Task<BuildResult> OnBuild (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
foreach (Package p in packages)
- p.Build (monitor);
- return null;
- }
-
- protected override void OnExecute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
- {
+ if (!await p.Build (monitor))
+ break;
+ return BuildResult.CreateSuccess ();
}
protected override bool OnGetNeedsBuilding (ConfigurationSelector configuration)
@@ -65,14 +63,9 @@ namespace MonoDevelop.Deployment
return false;
}
- protected override void OnSetNeedsBuilding (bool val, ConfigurationSelector configuration)
- {
- foreach (Package p in packages)
- p.NeedsBuilding = val;
- }
-
internal void NotifyPackagesChanged ()
{
+ AssertMainThread ();
if (PackagesChanged != null)
PackagesChanged (this, EventArgs.Empty);
}
@@ -80,5 +73,8 @@ namespace MonoDevelop.Deployment
public class PackagingProjectConfiguration : SolutionItemConfiguration
{
+ public PackagingProjectConfiguration (string id) : base (id)
+ {
+ }
}
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/UnknownPackageBuilder.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/UnknownPackageBuilder.cs
index 04d3e92770..72b356dc5d 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/UnknownPackageBuilder.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/UnknownPackageBuilder.cs
@@ -54,7 +54,7 @@ namespace MonoDevelop.Deployment
}
}
- protected override bool OnBuild (IProgressMonitor monitor, DeployContext ctx)
+ protected override bool OnBuild (ProgressMonitor monitor, DeployContext ctx)
{
monitor.ReportError ("Unknown package type. The package can't be generated.", null);
return false;
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.FileReplaceDialog.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.FileReplaceDialog.cs
index 2ef71e78f3..4064b84ff4 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.FileReplaceDialog.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.FileReplaceDialog.cs
@@ -5,44 +5,81 @@ namespace MonoDevelop.Deployment
public partial class FileReplaceDialog
{
private global::Gtk.HBox hbox1;
+
private global::Gtk.Label label7;
- private global::Gtk.Image image1;
+
+ private global::MonoDevelop.Components.ImageView image1;
+
private global::Gtk.Label label5;
+
private global::Gtk.Label label6;
+
private global::Gtk.Label label2;
+
private global::Gtk.HBox hbox2;
+
private global::Gtk.Label label8;
+
private global::Gtk.VBox vbox4;
+
private global::Gtk.HBox hbox3;
+
private global::Gtk.RadioButton radioReplace;
+
private global::Gtk.VBox vbox5;
+
private global::Gtk.Label replaceLabel;
+
private global::Gtk.HBox hbox6;
+
private global::Gtk.Label label25;
+
private global::Gtk.Label sourceName;
+
private global::Gtk.HBox hbox7;
+
private global::Gtk.Label label26;
+
private global::Gtk.Label sourceModified;
+
private global::Gtk.HBox hbox4;
+
private global::Gtk.RadioButton radioKeep;
+
private global::Gtk.VBox vbox6;
+
private global::Gtk.Label keepLabel;
+
private global::Gtk.HBox hbox8;
+
private global::Gtk.Label label27;
+
private global::Gtk.Label targetName;
+
private global::Gtk.HBox hbox9;
+
private global::Gtk.Label label28;
+
private global::Gtk.Label targetModified;
+
private global::Gtk.HBox hbox5;
+
private global::Gtk.RadioButton radioNewest;
+
private global::Gtk.VBox vbox7;
+
private global::Gtk.Label newestLabel;
+
private global::Gtk.Label label20;
+
private global::Gtk.CheckButton applyAll;
+
private global::Gtk.Label label11;
+
private global::Gtk.Button cancelButton;
- private global::Gtk.Button okButton;
+ private global::Gtk.Button okButton;
+
protected virtual void Build ()
{
global::Stetic.Gui.Initialize (this);
@@ -70,9 +107,10 @@ namespace MonoDevelop.Deployment
global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label7]));
w2.Position = 0;
// Container child hbox1.Gtk.Box+BoxChild
- this.image1 = new global::Gtk.Image ();
+ this.image1 = new global::MonoDevelop.Components.ImageView ();
this.image1.Name = "image1";
- this.image1.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-dialog-warning", global::Gtk.IconSize.Dialog);
+ this.image1.IconId = "gtk-dialog-warning";
+ this.image1.IconSize = ((global::Gtk.IconSize)(6));
this.hbox1.Add (this.image1);
global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.image1]));
w3.Position = 1;
@@ -390,26 +428,11 @@ namespace MonoDevelop.Deployment
this.cancelButton.CanFocus = true;
this.cancelButton.Name = "cancelButton";
this.cancelButton.UseUnderline = true;
- // Container child cancelButton.Gtk.Container+ContainerChild
- global::Gtk.Alignment w39 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
- // Container child GtkAlignment.Gtk.Container+ContainerChild
- global::Gtk.HBox w40 = new global::Gtk.HBox ();
- w40.Spacing = 2;
- // Container child GtkHBox.Gtk.Container+ContainerChild
- global::Gtk.Image w41 = new global::Gtk.Image ();
- w41.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-cancel", global::Gtk.IconSize.Button);
- w40.Add (w41);
- // Container child GtkHBox.Gtk.Container+ContainerChild
- global::Gtk.Label w43 = new global::Gtk.Label ();
- w43.LabelProp = global::Mono.Unix.Catalog.GetString ("_Cancel deployment");
- w43.UseUnderline = true;
- w40.Add (w43);
- w39.Add (w40);
- this.cancelButton.Add (w39);
+ this.cancelButton.Label = global::Mono.Unix.Catalog.GetString ("_Cancel deployment");
this.AddActionWidget (this.cancelButton, -6);
- global::Gtk.ButtonBox.ButtonBoxChild w47 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w38 [this.cancelButton]));
- w47.Expand = false;
- w47.Fill = false;
+ global::Gtk.ButtonBox.ButtonBoxChild w39 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w38 [this.cancelButton]));
+ w39.Expand = false;
+ w39.Fill = false;
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.okButton = new global::Gtk.Button ();
this.okButton.CanDefault = true;
@@ -419,10 +442,10 @@ namespace MonoDevelop.Deployment
this.okButton.UseUnderline = true;
this.okButton.Label = "gtk-ok";
this.AddActionWidget (this.okButton, -5);
- global::Gtk.ButtonBox.ButtonBoxChild w48 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w38 [this.okButton]));
- w48.Position = 1;
- w48.Expand = false;
- w48.Fill = false;
+ global::Gtk.ButtonBox.ButtonBoxChild w40 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w38 [this.okButton]));
+ w40.Position = 1;
+ w40.Expand = false;
+ w40.Fill = false;
if ((this.Child != null)) {
this.Child.ShowAll ();
}
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs
index 504f5d72d3..29affc7b0e 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/MonoDevelop.Deployment.Gui.DeployDialog.cs
@@ -5,57 +5,109 @@ namespace MonoDevelop.Deployment.Gui
internal partial class DeployDialog
{
private global::Gtk.HBox hbox1;
+
private global::Gtk.VBox vbox2;
- private global::Gtk.Image image2;
+
+ private global::MonoDevelop.Components.ImageView image2;
+
private global::Gtk.Notebook notebook;
+
private global::Gtk.VBox vbox3;
+
private global::Gtk.Label labelTitle;
+
private global::Gtk.HSeparator hseparator2;
+
private global::Gtk.Label label1;
+
private global::Gtk.ScrolledWindow scrolledwindow2;
+
private global::Gtk.TreeView targetsTree;
+
private global::Gtk.Label label2;
+
private global::Gtk.VBox pageSelectProject;
+
private global::Gtk.Label labelTitle1;
+
private global::Gtk.HSeparator hseparator4;
+
private global::Gtk.Label label4;
+
private global::MonoDevelop.Deployment.Gui.EntrySelectionTree entryTree;
+
private global::Gtk.Label label3;
+
private global::Gtk.VBox vbox4;
+
private global::Gtk.Label label5;
+
private global::Gtk.HSeparator hseparator3;
+
private global::Gtk.EventBox editorBox;
+
private global::Gtk.HSeparator saveSeparator;
+
private global::Gtk.HBox hbox2;
+
private global::Gtk.CheckButton checkSave;
+
private global::Gtk.Label label6;
+
private global::Gtk.VBox pageSave;
+
private global::Gtk.Label label7;
+
private global::Gtk.HSeparator hseparator5;
+
private global::Gtk.VBox vbox7;
+
private global::Gtk.Label label14;
+
private global::Gtk.HBox hbox4;
+
private global::Gtk.Label label13;
+
private global::Gtk.Entry entrySaveName;
+
private global::Gtk.VBox vboxSaveProject;
+
private global::Gtk.HSeparator hseparator6;
+
private global::Gtk.Label label15;
+
private global::Gtk.RadioButton radioCreateProject;
+
private global::Gtk.HBox hbox5;
+
private global::Gtk.Label label9;
+
private global::Gtk.Table tableNewProject;
+
private global::Gtk.ComboBox comboCreateProject;
+
private global::Gtk.Entry entryProjectName;
+
private global::Gtk.Label label11;
+
private global::Gtk.Label label16;
+
private global::Gtk.RadioButton radioAddProject;
+
private global::Gtk.HBox boxAddProject;
+
private global::Gtk.Label label10;
+
private global::Gtk.Label label12;
+
private global::Gtk.ComboBox comboSelProject;
+
private global::Gtk.Label label8;
+
private global::Gtk.Button buttonCancel;
+
private global::Gtk.Button buttonBack;
+
private global::Gtk.Button buttonNext;
protected virtual void Build ()
@@ -80,9 +132,10 @@ namespace MonoDevelop.Deployment.Gui
this.vbox2 = new global::Gtk.VBox ();
this.vbox2.Name = "vbox2";
// Container child vbox2.Gtk.Box+BoxChild
- this.image2 = new global::Gtk.Image ();
+ this.image2 = new global::MonoDevelop.Components.ImageView ();
this.image2.Name = "image2";
- this.image2.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("package-48.png");
+ this.image2.IconId = "md-package";
+ this.image2.IconSize = ((global::Gtk.IconSize)(6));
this.vbox2.Add (this.image2);
global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.image2]));
w2.Position = 0;
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/generated.cs b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/generated.cs
index 5cdc11900b..3285e87c05 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/generated.cs
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/generated.cs
@@ -67,40 +67,6 @@ namespace Stetic
}
}
- internal class IconLoader
- {
- public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size)
- {
- Gdk.Pixbuf res = widget.RenderIcon (name, size, null);
- if ((res != null)) {
- return res;
- } else {
- int sz;
- int sy;
- global::Gtk.Icon.SizeLookup (size, out sz, out sy);
- try {
- return Gtk.IconTheme.Default.LoadIcon (name, sz, 0);
- } catch (System.Exception) {
- if ((name != "gtk-missing-image")) {
- return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size);
- } else {
- Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz);
- Gdk.GC gc = new Gdk.GC (pmap);
- gc.RgbFgColor = new Gdk.Color (255, 255, 255);
- pmap.DrawRectangle (gc, true, 0, 0, sz, sz);
- gc.RgbFgColor = new Gdk.Color (0, 0, 0);
- pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1));
- gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
- gc.RgbFgColor = new Gdk.Color (255, 0, 0);
- pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4)));
- pmap.DrawLine (gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)));
- return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
- }
- }
- }
- }
- }
-
internal class ActionGroups
{
public static Gtk.ActionGroup GetActionGroup (System.Type type)
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/gui.stetic b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/gui.stetic
index 7d5838219c..76b23ed078 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/gui.stetic
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/gtk-gui/gui.stetic
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<stetic-interface>
<configuration>
<images-root-path>..</images-root-path>
@@ -237,9 +237,10 @@
<widget class="Gtk.VBox" id="vbox2">
<property name="MemberName" />
<child>
- <widget class="Gtk.Image" id="image2">
+ <widget class="MonoDevelop.Components.ImageView" id="image2">
<property name="MemberName" />
- <property name="Pixbuf">resource:package-48.png</property>
+ <property name="IconId">md-package</property>
+ <property name="IconSize">Dialog</property>
</widget>
<packing>
<property name="Position">0</property>
@@ -1849,9 +1850,10 @@
</packing>
</child>
<child>
- <widget class="Gtk.Image" id="image1">
+ <widget class="MonoDevelop.Components.ImageView" id="image1">
<property name="MemberName" />
- <property name="Pixbuf">stock:gtk-dialog-warning Dialog</property>
+ <property name="IconId">gtk-dialog-warning</property>
+ <property name="IconSize">Dialog</property>
</widget>
<packing>
<property name="Position">1</property>
@@ -2274,8 +2276,7 @@
<widget class="Gtk.Button" id="cancelButton">
<property name="MemberName" />
<property name="CanFocus">True</property>
- <property name="Type">TextAndIcon</property>
- <property name="Icon">stock:gtk-cancel Button</property>
+ <property name="Type">TextOnly</property>
<property name="Label" translatable="yes">_Cancel deployment</property>
<property name="UseUnderline">True</property>
<property name="ResponseId">-6</property>
@@ -2467,4 +2468,4 @@
</widget>
</child>
</widget>
-</stetic-interface>
+</stetic-interface> \ No newline at end of file
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16.png
index be53353283..8519a6420d 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16.png
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16@2x.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16@2x.png
index 6f21d7aa77..9708a1eded 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16@2x.png
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16@2x.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~dark.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~dark.png
new file mode 100644
index 0000000000..25d4814e13
--- /dev/null
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~dark.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~dark@2x.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~dark@2x.png
new file mode 100644
index 0000000000..6b099dbfbc
--- /dev/null
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~dark~sel.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~dark~sel.png
new file mode 100644
index 0000000000..9eeaade789
--- /dev/null
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~dark~sel@2x.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~dark~sel@2x.png
new file mode 100644
index 0000000000..e58ff00899
--- /dev/null
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~sel.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~sel.png
new file mode 100644
index 0000000000..9eeaade789
--- /dev/null
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~sel.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~sel@2x.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~sel@2x.png
new file mode 100644
index 0000000000..e58ff00899
--- /dev/null
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32.png
index 6f21d7aa77..9708a1eded 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32.png
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32@2x.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32@2x.png
index 8b687efa3d..56b0c40ada 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32@2x.png
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32@2x.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~dark.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~dark.png
new file mode 100644
index 0000000000..6b099dbfbc
--- /dev/null
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~dark.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~dark@2x.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~dark@2x.png
new file mode 100644
index 0000000000..70b6d95f29
--- /dev/null
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~dark@2x.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~dark~sel.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~dark~sel.png
new file mode 100644
index 0000000000..e58ff00899
--- /dev/null
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~dark~sel.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~dark~sel@2x.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~dark~sel@2x.png
new file mode 100644
index 0000000000..ddb889f387
--- /dev/null
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~sel.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~sel.png
new file mode 100644
index 0000000000..e58ff00899
--- /dev/null
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~sel.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~sel@2x.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~sel@2x.png
new file mode 100644
index 0000000000..ddb889f387
--- /dev/null
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-32~sel@2x.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48.png
index 81a5324fce..6dbcbea034 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48.png
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48@2x.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48@2x.png
index 3862bac535..0484944163 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48@2x.png
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48@2x.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~dark.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~dark.png
new file mode 100644
index 0000000000..2fb74b25c1
--- /dev/null
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~dark.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~dark@2x.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~dark@2x.png
new file mode 100644
index 0000000000..07520b847c
--- /dev/null
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~dark@2x.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~dark~sel.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~dark~sel.png
new file mode 100644
index 0000000000..7fec138598
--- /dev/null
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~dark~sel.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~dark~sel@2x.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~dark~sel@2x.png
new file mode 100644
index 0000000000..e134ffbf43
--- /dev/null
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~sel.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~sel.png
new file mode 100644
index 0000000000..7fec138598
--- /dev/null
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~sel.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~sel@2x.png b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~sel@2x.png
new file mode 100644
index 0000000000..e134ffbf43
--- /dev/null
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/icons/package-48~sel@2x.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/packaging-project.png b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/packaging-project.png
index 976dbfb101..a8e3546967 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/packaging-project.png
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/packaging-project.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/packaging-project@2x.png b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/packaging-project@2x.png
index d30d817102..9750e76184 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/packaging-project@2x.png
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/packaging-project@2x.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/packaging-project~dark.png b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/packaging-project~dark.png
new file mode 100644
index 0000000000..7083d65998
--- /dev/null
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/packaging-project~dark.png
Binary files differ
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/packaging-project~dark@2x.png b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/packaging-project~dark@2x.png
new file mode 100644
index 0000000000..2205268213
--- /dev/null
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/packaging-project~dark@2x.png
Binary files differ
diff --git a/main/src/addins/GnomePlatform/ChangeLog b/main/src/addins/GnomePlatform/ChangeLog
deleted file mode 100644
index 4456b3ffb9..0000000000
--- a/main/src/addins/GnomePlatform/ChangeLog
+++ /dev/null
@@ -1,236 +0,0 @@
-2010-06-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * GnomePlatform.cs: Implemented
- CanOpenTerminal/OpenInTerminal.
-
-2010-04-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * GnomePlatform.cs: Track StartConsoleProcess API.
-
-2010-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.cs: External console processes are now wrapped
- by a IProcessAsyncOperation interface, instead of a Process
- instance. In this way it is possible to create external
- consoles which are not directly bound to a process.
-
-2010-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.cs: Moved external console creation to the
- platform service.
-
-2010-03-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.cs: If getting the mime type using gio fails
- for some reason, fallback to vfs.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * GnomePlatform.addin.xml: Bumped MD version.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gio.cs:
- * Makefile.am:
- * GnomePlatform.cs:
- * GnomePlatform.csproj:
- * GnomePlatform.addin.xml: Merged MD.Projects into MD.Core,
- and MD.Projects.Gui, MD.Core.Gui and MD.Components into
- MD.Ide.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.csproj: Add missing reference.
-
-2010-02-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * GnomePlatform.cs: Tidy up GIO vs. GnomeVFS a bit.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * GnomePlatform.addin.xml: Bump MD version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.csproj: Flush.
-
-2009-10-08 Ankit Jain <jankit@novell.com>
-
- * GnomePlatform.csproj: Mark gtk-sharp/pango-sharp with
- SpecificVersion=false. Add 'GnomePlatform.dll.config' to
- the project, this is already there in the makefile.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * GnomePlatform.addin.xml: Bump MD version.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.csproj: Updated dependencies. We now depend on
- gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-06-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.cs: Fallback to Vfs if Gio doesn't have mime
- type info for a file.
-
-2009-04-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.csproj: Don't require a specific gtk# version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * GnomePlatform.addin.xml: Bump MD version.
-
-2009-02-26 Mike Kestner <mkestner@novell.com>
-
- * Gio.cs: remove an unref that can cause double frees, even
- though the docs say the GFileInfo should be unref'd.
-
-2009-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * GnomePlatform.csproj: Remove more inadvertent local copying
- of references.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.csproj: Flush.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.mdp:
- * GnomePlatform.csproj: Migrated to MSBuild file format.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * GnomePlatform.addin.xml: Bump MD version.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * GnomePlatform.mdp: Flush project format changes.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.mdp: All projects now require fx 3.5.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * GnomePlatform.mdp: Fix project file.
-
- * GnomePlatform.cs: Remove unused code.
-
-2008-12-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.addin.xml: Hide/protect add-ins.
-
-2008-12-04 Mike Kestner <mkestner@novell.com>
-
- * GnomePlatform.cs: still need to initialize gnomevfs for the icon
- lookup.
-
-2008-12-04 Mike Kestner <mkestner@novell.com>
-
- * GnomePlatform.cs: add gio hooks.
- * GnomePlatform.dll.config: pinvoke-fu.
- * Gio.cs: gio-based mime lookup code.
- * Makefile.am: new files and config file magic.
- [Fixes #400642]
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Make it work for parallel build.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * AssemblyInfo.cs:
- * GnomePlatform.mdp: Add AssemblyInfo.cs files that are autogenerated
- from the addin manifests.
-
-2008-11-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Fix build dependencies.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.addin.xml: Bump MD version.
-
-2008-07-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.cs: Escape file names when querying the mime type.
-
-2008-07-15 Mike Krüger <mkrueger@novell.com>
-
- * GnomePlatform.cs: Fixed possible null reference exception.
-
-2008-06-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.mdp: Fix runtime version.
- * GnomePlatform.cs: Gnome.Icon.LookupSync crashes in old gnome versions
- if the file doesn't exist. Fixed this case in OnGetPixbufForFile.
- Fixes bug #400297.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.addin.xml: Bump MD version.
-
-2008-06-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.mdp: Some fixes in project files.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am, GnomePlatform.mdp: New project model changes.
-
-2008-05-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * GnomePlatform.cs: Moved the code here that uses the gedit file
- association to check whether a file is text.
-
-2008-04-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.mdp: Remove unneeded reference.
- * GnomePlatform.cs: Track api changes.
-
-2008-03-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * GnomePlatform.cs: Try to use the base implementation of GetMimeTypeForUri
- to get a useful value, before falling back to GnomeVFS. Allows finding
- mimetypes not registered on the system.
-
-2008-02-14 Geoff Norton <gnorton@novell.com>
-
- * GnomePlatform.cs: Expose the Name property.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.addin.xml: Update MD version.
-
-2008-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.addin.xml: Updated add-in category and description.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.addin.xml, Makefile.am, GnomePlatform.mdp, GnomePlatform.cs:
- Moved PlatformService to MD.Core.Gui. Removed old FileIconService class,
- which is now implemented in PlatformService.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.addin.xml: Fix typo.
- * Makefile.am, GnomePlatform.mdp: Added MD project.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * GnomePlatform.addin.xml: Bump add-in versions.
-
-2007-12-06 Geoff Norton <gnorton@novell.com>
-
- * Initial check-in for the Gnome backend to the PlatformService
diff --git a/main/src/addins/GnomePlatform/GnomePlatform.cs b/main/src/addins/GnomePlatform/GnomePlatform.cs
index beb5f8e4c0..72ceff795f 100644
--- a/main/src/addins/GnomePlatform/GnomePlatform.cs
+++ b/main/src/addins/GnomePlatform/GnomePlatform.cs
@@ -208,7 +208,7 @@ namespace MonoDevelop.Platform
TerminalRunnerHandler runner;
TerminalOpenFolderRunnerHandler openDirectoryRunner;
- public override IProcessAsyncOperation StartConsoleProcess (string command, string arguments, string workingDirectory,
+ public override ProcessAsyncOperation StartConsoleProcess (string command, string arguments, string workingDirectory,
IDictionary<string, string> environmentVariables,
string title, bool pauseWhenFinished)
{
@@ -225,7 +225,7 @@ namespace MonoDevelop.Platform
ProcessWrapper proc = new ProcessWrapper ();
proc.StartInfo = psi;
proc.Start ();
- return proc;
+ return proc.ProcessAsyncOperation;
}
#region Terminal runner implementations
diff --git a/main/src/addins/ILAsmBinding/ChangeLog b/main/src/addins/ILAsmBinding/ChangeLog
deleted file mode 100644
index 7929182082..0000000000
--- a/main/src/addins/ILAsmBinding/ChangeLog
+++ /dev/null
@@ -1,468 +0,0 @@
-2010-06-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmCompilerManager.cs: Track api changes.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * ILAsmBinding.addin.xml: Bumped MD version.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * ILAsmBinding.csproj:
- * ILAsmBinding.addin.xml:
- * Gui/CompilerParametersPanelWidget.cs: Merged MD.Projects
- into MD.Core, and MD.Projects.Gui, MD.Core.Gui and
- MD.Components into MD.Ide.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/ILAsmBinding.CompilerParametersPanelWidget.cs:
- Flush.
-
-2009-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmLanguageBinding.cs:
- * ILAsmCompilerManager.cs: Introduced the
- ConfigurationSelector class to all methods that previously
- took a configuration name as string. This eliminates the
- ambiguity between solution configuration names and project
- configuration names.
-
-2009-11-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmCompilerManager.cs: Minor fix in error parsing.
-
-2009-11-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmConsoleProject.xpt.xml: Add mscorlib reference to the
- template.
-
-2009-11-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmCompilerManager.cs: Make the error parsing regex work
- on ms.net.
-
-2009-11-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmCompilerManager.cs: Show an error message when ilasm is
- not found.
-
-2009-11-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmCompilerManager.cs: Get the ilasm path using the target
- runtime. Should fix bug #553536 - IL Console project
- completely broken on windows.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * ILAsmBinding.addin.xml: Bump MD version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.csproj:
- * gtk-gui/generated.cs:
- * gtk-gui/ILAsmBinding.CompilerParametersPanelWidget.cs:
- Flush.
-
-2009-10-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmConsoleProject.xpt.xml: Track language binding id
- change.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * ILAsmBinding.addin.xml: Bump MD version.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * ILAsmCompilerManager.cs: Fixed warning.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.csproj: Updated dependencies. We now depend on
- gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-05-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmCompilerManager.cs: Track api changes.
-
-2009-04-27 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui:
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * gtk-gui/ILAsmBinding.CompilerParametersPanelWidget.cs:
- Checked in gtk-gui
-
-2009-04-27 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * ILAsmBinding.csproj:
- * ILAsmBinding.addin.xml:
- * ILAsmLanguageBinding.cs:
- * ILAsmCompilerManager.cs:
- * Gui/CompilerParametersPanel.cs:
- * Project/ILAsmCompilerParameters.cs:
- * Gui/CompilerParametersPanelWidget.cs: Worked on IL binding.
-
-2009-04-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * ILAsmLanguageBinding.cs: Track comment tag API.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * ILAsmBinding.csproj: don't require specific gtk-sharp version.
-
-2009-04-17 Mike Krüger <mkrueger@novell.com>
-
- * ILAsmLanguageBinding.cs: Removed icon service.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * ILAsmBinding.addin.xml: Bump MD version.
-
-2009-02-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmLanguageBinding.cs:
- * Project/ILAsmCompilerParameters.cs: Track api changes.
-
-2009-02-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmLanguageBinding.cs:
- * ILAsmCompilerManager.cs: Track API changes. Use the new
- ProjectItem collection.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * ILAsmBinding.csproj: Make implicit references explicit. Csc
- is much pickier about these.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.mdp:
- * ILAsmBinding.csproj: Migrated to MSBuild file format.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * ILAsmBinding.addin.xml: Bump MD version.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * ILAsmBinding.mdp: Flush project format changes.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.mdp: All projects now require fx 3.5.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.mdp: Don't require a specific version of Mono.Addins.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Make it work for parallel build.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * AssemblyInfo.cs: Add AssemblyInfo.cs files that are autogenerated from
- the addin manifests.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.addin.xml: Bump MD version.
-
-2008-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * ILAsmCompilerManager.cs: Track API.
-
-2008-08-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.addin.xml: Register the project guid for msbuild. Fixes
- bug #405480.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * ILAsmLanguageBinding.cs: Translated old code to new dom.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/ILAsmCompilerParameters.cs: Moved serialization engine to
- MonoDevelop.Core. Use new syntax for specifying attribute scope.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.addin.xml: Bump MD version.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.addin.xml: Merged the extension points for project and
- solution option panels into a single extension point. A single
- extension point will now be used for all kinds of items. Extension
- conditions can be used to make panels visible only for some
- specific item types.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmCompilerManager.cs, ILAsmLanguageBinding.cs: Replaced
- ICompilerResult/DefaultCompilerResult/CompilerResults by a new
- BuildResult class, which has owner information at error level, so
- it is possible to know which project generated an error when
- building a solution. Updated Task and TaskService to use the new
- owner information.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.mdp, Gui/CompilerParametersPanel.cs,
- ILAsmLanguageBinding.cs, Makefile.am, ILAsmBinding.addin.xml: New
- project model changes.
-
-2008-02-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmCompilerManager.cs: Properly detect and report compiler errors. Fixes
- bug #358360.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.addin.xml: Update MD version.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * ILAsmConsoleProject.xpt.xml: Make template categories translatable.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.addin.xml: Bump add-in versions.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.mdp, Makefile.am: Directory reorganization.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.addin.xml: Bump MD version.
-
-2007-10-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.mdp, ILAsmConsoleProject.xpt.xml, Makefile.am,
- icons/ILAsm.Project.DOSProject: Updated project icons. Use the base
- project icon with an overlay to show the type.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.mdp: Project file names updated by change in MD path
- functions.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.addin.xml: Bump MD version.
-
-2007-09-04 Michael Hutchinson <MHutchinson@novell.com>
-
- * Gui/CompilerParametersPanel.cs: Fix compiler warning.
-
-2007-08-31 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CompilerParametersPanel.cs: Changes due to new property
- infrastructure.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.mdp, Makefile.am, ILAsmBinding.addin.xml: Reorganized the
- extension point hierarchy. Embedded all add-in manifests as resources.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.mdp: Copy the .addins.xml file to the output dir.
-
-2007-05-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.mdp, Makefile.am: Reference shared assemblies from the
- correct location.
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.mdp, Gui/CompilerParametersPanel.cs, Makefile.am,
- ILAsmBinding.addin.xml: Migration to Mono.Addins.
-
-2007-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.mdp: Don't copy referenced assemblies.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.addin.xml: Change add-in versions to 0.13.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs: Removed version auto-increment.
- * ILAsmBinding.mdp, Makefile.am: Synchronized the MD project and the
- Makefile
-
-2006-12-07 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * ILAsmBinding.mdp: Updated to ensure it can be
- built from MonoDevelop.
-
-2006-09-18 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * ILAsmBinding.mdp: Updated.
-
-2006-07-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.addin.xml: Updated versions.
-
-2006-06-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.addin.xml: Use the DataType element instead fof Class
- to declare serializable types.
-
-2006-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.addin.xml: Updated versions.
- * ILAsmBinding.mdp: Updated.
-
-2006-04-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmLanguageBinding.cs: Implement GetSupportedClrVersions.
-
-2006-04-07 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * ILAsmBinding.addin.xml: renamed attribute in FileFilter Extension
-
-2006-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * ILAsmBinding.addin.xml: Updated references.
-
-2006-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.mdp: Updated.
- * Makefile.am: Use an unified format. Patch by Matze Braun.
- * ILAsmBinding.addin.xml: Updated add-in versions.
-
-2005-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmLanguageBinding.cs: Implemented the new methods in
- IDotNetLanguageBinding.
-
-2005-10-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.addin.xml: Fixed addin header information.
- Use "id" attribuet instead of "name" to identify addins.
-
-2005-10-06 John Luke <john.luke@gmail.com>
-
- * ILAsmCompilerManager.cs: remove unused fileUtilityService
- * Gui/CompilerParametersPanel.cs: comment out unused code that
- caused a warning
-
-2005-10-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.addin.xml:
- * ILAsmLanguageBinding.cs: Register serializable types in the addin
- configuration file.
-
-2005-10-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmBinding.addin.xml: Added addin dependencies.
-
-2005-08-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmConsoleProject.xpt.xml: Properly reference resource icons.
- * ILAsmBinding.addin.xml:
- * Makefile.am: Embed icon and templates as resources.
-
-2005-08-10 Ben Motmans <ben.motmans@gmail.com>
-
- * ILAsmBinding.mdp: references update
-
-2005-07-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/ILAsmCompilerParameters.cs: Implement ICloneable.
- * ILAsmLanguageBinding.cs: CreateCompilationParameters now returns an
- ICloneable.
-
-2005-04-17 John Luke <john.luke@gmail.com>
-
- * Makefile.am: fix distcheck
-
-2005-02-16 Ben Motmans <ben.motmans@gmail.com>
-
- * ILAsmConsoleProject.xpt.xml: Consistent naming
-
-2005-01-24 John Luke <john.luke@gmail.com>
-
- * ILAsmCompilerManager.cs: update to work like CSharpBinding
- and add some primitive error parsing
-
-2005-01-24 John Luke <john.luke@gmail.com>
-
- * ILAsmCompilerManager.cs: remove unused lines and fix 2 warnings
-
-2005-01-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmLanguageBinding.cs:
- * ILAsmCompilerManager.cs: Use the new progress monitor API.
-
-2005-01-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmCompilerManager.cs:
- * Gui/CompilerParametersPanel.cs:
- * ILAsmBinding.addin.xml:
- * ILAsmLanguageBinding.cs: Follow architecture changes.
-
- * Project/ILAsmProject.cs: Removed. Not needed any more.
- * Project/ILAsmCompilerParameters.cs: All parameters have been moved to
- DotNetProjectConfiguration.
- * Project/CompilationTarget.cs: Moved to Monodevelop.Base.
- * Makefile.am: Updated.
-
-2004-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * ILAsmCompilerManager.cs: StatusBarService.ProgressMonitor is not a
- StatusBar widget any more.
-
-2004-12-07 Alexandre Gomes <alexmipego@hotmail.com>
-
- * ILAsmLanguageBinding.cs: Added CommentTag to be used by (Un)CommentCode
-
-2004-06-08 John Luke <jluke@cfl.rr.com>
-
- * ILAsmCompilerManager.cs:
- * ILAsmExecutionManager.cs: use (cmd, args) overload of ProcessStartInfo
- constructor so I can compile and run hello world on Beta2
-
-2004-05-25 Todd Berman <tberman@sevenl.net>
-
- * ILAsmLanguageBinding.cs: sigchange for GenerateMakefile
-
-2004-04-28 Todd Berman <tberman@sevenl.net>
-
- * ILAsmLanguageBinding.cs: stubbing GenerateMakefile
-
-
-2004-04-26 John Luke <jluke@cfl.rr.com>
-
- * *.cs: ILAsmBinding namespace
- * ILAsmCompilerManager.cs: change it to work like the Java one
- * Project/CompilationParameters.cs: use /exe and /dll
-
-
-
-
- import from SD svn
- not yet working and untested
-
diff --git a/main/src/addins/ILAsmBinding/Gui/CompilerParametersPanelWidget.cs b/main/src/addins/ILAsmBinding/Gui/CompilerParametersPanelWidget.cs
index fca18554b9..e4fa67756f 100644
--- a/main/src/addins/ILAsmBinding/Gui/CompilerParametersPanelWidget.cs
+++ b/main/src/addins/ILAsmBinding/Gui/CompilerParametersPanelWidget.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Projects;
using Gtk;
@@ -53,13 +54,13 @@ namespace ILAsmBinding
this.project = project;
this.configuration = configuration;
compileTargetCombo.Active = configuration.CompileTarget == CompileTarget.Exe ? 0 : 1;
- checkbuttonIncludeDebugInfo.Active = configuration.DebugMode;
+ checkbuttonIncludeDebugInfo.Active = configuration.DebugSymbols;
}
public void Store ()
{
project.CompileTarget = compileTargetCombo.Active == 0 ? CompileTarget.Exe : CompileTarget.Library;
- configuration.DebugMode = checkbuttonIncludeDebugInfo.Active;
+ configuration.DebugSymbols = checkbuttonIncludeDebugInfo.Active;
}
}
@@ -67,7 +68,7 @@ namespace ILAsmBinding
{
CompilerParametersPanelWidget widget;
- public override Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
return widget = new CompilerParametersPanelWidget ();
}
diff --git a/main/src/addins/ILAsmBinding/ILAsmBinding.addin.xml b/main/src/addins/ILAsmBinding/ILAsmBinding.addin.xml
index 6ddaeb5f90..f40c5d46d7 100644
--- a/main/src/addins/ILAsmBinding/ILAsmBinding.addin.xml
+++ b/main/src/addins/ILAsmBinding/ILAsmBinding.addin.xml
@@ -1,28 +1,29 @@
<ExtensionModel>
<Extension path = "/MonoDevelop/Ide/ProjectTemplates">
- <ProjectTemplate id = "ILAsmConsoleProject" resource = "ILAsmConsoleProject.xpt.xml"/>
+ <ProjectTemplate id = "MonoDevelop.IL.ConsoleProject" resource = "ILAsmConsoleProject.xpt.xml"/>
</Extension>
<Extension path = "/MonoDevelop/Ide/FileFilters">
<FileFilter id = "ILAsm Files" _label = "ILAsm Files" extensions = "*.il"/>
</Extension>
<Extension path = "/MonoDevelop/ProjectModel/Gui/ItemOptionPanels/Build">
- <Condition id="ActiveLanguage" value = "IL">
+ <Condition id="ProjectTypeId" value = "IL">
<Section id = "ILAsmCompilerParametersPanel" _label = "Compiler" class = "ILAsmBinding.CompilerParametersPanel"/>
</Condition>
</Extension>
<Extension path = "/MonoDevelop/ProjectModel/LanguageBindings">
- <LanguageBinding id = "ILAsm" supportedextensions = ".il" class = "ILAsmBinding.ILAsmLanguageBinding"/>
+ <LanguageBinding id = "IL" extensions = ".il" singleLineCommentTag = "//" blockCommentStartTag = "/*" blockCommentEndTag = "*/" />
</Extension>
- <Extension path = "/MonoDevelop/ProjectModel/SerializableClasses">
- <DataType class = "ILAsmBinding.ILAsmCompilerParameters" />
- </Extension>
-
<Extension path = "/MonoDevelop/ProjectModel/MSBuildItemTypes">
- <DotNetProject language="IL" extension="ilproj" guid="{B4EC64DC-6D44-11DD-AAB0-C9A155D89593}"/>
+ <DotNetProjectType
+ language="IL"
+ extension="ilproj"
+ guid="{B4EC64DC-6D44-11DD-AAB0-C9A155D89593}"
+ type="ILAsmBinding.ILAsmProject"
+ msbuildSupport="NotSupported" />
</Extension>
</ExtensionModel>
diff --git a/main/src/addins/ILAsmBinding/ILAsmBinding.csproj b/main/src/addins/ILAsmBinding/ILAsmBinding.csproj
index 62a3fff13c..7eb5d92e8c 100644
--- a/main/src/addins/ILAsmBinding/ILAsmBinding.csproj
+++ b/main/src/addins/ILAsmBinding/ILAsmBinding.csproj
@@ -90,11 +90,11 @@
<Compile Include="Project\ILAsmCompilerParameters.cs" />
<Compile Include="ILAsmCompilerManager.cs" />
<Compile Include="AssemblyInfo.cs" />
- <Compile Include="ILAsmLanguageBinding.cs" />
<Compile Include="Gui\CompilerParametersPanelWidget.cs" />
<Compile Include="gtk-gui\generated.cs" />
<Compile Include="gtk-gui\ILAsmBinding.CompilerParametersPanelWidget.cs" />
<Compile Include="AddinInfo.cs" />
+ <Compile Include="ILAsmProject.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
diff --git a/main/src/addins/ILAsmBinding/ILAsmCompilerManager.cs b/main/src/addins/ILAsmBinding/ILAsmCompilerManager.cs
index ca951872d9..941bf906a0 100644
--- a/main/src/addins/ILAsmBinding/ILAsmCompilerManager.cs
+++ b/main/src/addins/ILAsmBinding/ILAsmCompilerManager.cs
@@ -48,7 +48,7 @@ namespace ILAsmBinding
sb.Append ("\" ");
}
- public static BuildResult Compile (ProjectItemCollection projectItems, DotNetProjectConfiguration configuration, ConfigurationSelector configSelector, IProgressMonitor monitor)
+ public static BuildResult Compile (ProjectItemCollection projectItems, DotNetProjectConfiguration configuration, ConfigurationSelector configSelector, ProgressMonitor monitor)
{
// ILAsmCompilerParameters compilerParameters = (ILAsmCompilerParameters)configuration.CompilationParameters ?? new ILAsmCompilerParameters ();
string outputName = configuration.CompiledOutputName;
@@ -69,7 +69,7 @@ namespace ILAsmBinding
break;
}
- if (configuration.DebugMode)
+ if (configuration.DebugSymbols)
sb.Append ("/debug ");
foreach (ProjectFile finfo in projectItems.GetAll<ProjectFile> ()) {
diff --git a/main/src/addins/ILAsmBinding/ILAsmLanguageBinding.cs b/main/src/addins/ILAsmBinding/ILAsmLanguageBinding.cs
deleted file mode 100644
index c45ea65c3f..0000000000
--- a/main/src/addins/ILAsmBinding/ILAsmLanguageBinding.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// ILAsmLanguageBinding.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.IO;
-using System.Xml;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Core;
-
-namespace ILAsmBinding
-{
- class ILAsmLanguageBinding : IDotNetLanguageBinding
- {
- public string Language {
- get {
- return "IL";
- }
- }
-
- public string ProjectStockIcon {
- get {
- return "md-project";
- }
- }
-
- public bool IsSourceCodeFile (FilePath fileName)
- {
- return String.Compare (Path.GetExtension (fileName), ".il", StringComparison.OrdinalIgnoreCase) == 0;
- }
-
- public BuildResult Compile (ProjectItemCollection projectItems, DotNetProjectConfiguration configuration, ConfigurationSelector configSelector, IProgressMonitor monitor)
- {
- return ILAsmCompilerManager.Compile (projectItems, configuration, configSelector, monitor);
- }
-
- public ConfigurationParameters CreateCompilationParameters (XmlElement projectOptions)
- {
- return new ILAsmCompilerParameters();
- }
-
- public ProjectParameters CreateProjectParameters (XmlElement projectOptions)
- {
- return null;
- }
-
- public string SingleLineCommentTag { get { return "//"; } }
- public string BlockCommentStartTag { get { return "/*"; } }
- public string BlockCommentEndTag { get { return "*/"; } }
-
- public System.CodeDom.Compiler.CodeDomProvider GetCodeDomProvider ()
- {
- return null;
- }
-
- public FilePath GetFileName (FilePath baseName)
- {
- return baseName + ".il";
- }
-
- public ClrVersion[] GetSupportedClrVersions ()
- {
- return new [] {
- ClrVersion.Net_1_1,
- ClrVersion.Net_2_0,
- ClrVersion.Clr_2_1,
- ClrVersion.Net_4_0,
- ClrVersion.Net_4_5,
- };
- }
- }
-}
diff --git a/main/src/addins/ILAsmBinding/ILAsmProject.cs b/main/src/addins/ILAsmBinding/ILAsmProject.cs
new file mode 100644
index 0000000000..da8ba321f0
--- /dev/null
+++ b/main/src/addins/ILAsmBinding/ILAsmProject.cs
@@ -0,0 +1,56 @@
+//
+// ILAsmProject.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Projects;
+using MonoDevelop.Core;
+
+namespace ILAsmBinding
+{
+ public class ILAsmProject: DotNetProject
+ {
+ protected override BuildResult OnCompileSources (ProjectItemCollection items, DotNetProjectConfiguration configuration, ConfigurationSelector configSelector, ProgressMonitor monitor)
+ {
+ return ILAsmCompilerManager.Compile (items, configuration, configSelector, monitor);
+ }
+
+ protected override DotNetCompilerParameters OnCreateCompilationParameters (DotNetProjectConfiguration config, ConfigurationKind kind)
+ {
+ return new ILAsmCompilerParameters();
+ }
+
+ protected override ClrVersion[] OnGetSupportedClrVersions ()
+ {
+ return new [] {
+ ClrVersion.Net_1_1,
+ ClrVersion.Net_2_0,
+ ClrVersion.Clr_2_1,
+ ClrVersion.Net_4_0,
+ ClrVersion.Net_4_5,
+ };
+ }
+ }
+}
+
diff --git a/main/src/addins/ILAsmBinding/Project/ILAsmCompilerParameters.cs b/main/src/addins/ILAsmBinding/Project/ILAsmCompilerParameters.cs
index 80c1af76db..9b509a6112 100644
--- a/main/src/addins/ILAsmBinding/Project/ILAsmCompilerParameters.cs
+++ b/main/src/addins/ILAsmBinding/Project/ILAsmCompilerParameters.cs
@@ -26,7 +26,7 @@
namespace ILAsmBinding
{
- class ILAsmCompilerParameters : MonoDevelop.Projects.ConfigurationParameters
+ class ILAsmCompilerParameters : MonoDevelop.Projects.DotNetCompilerParameters
{
}
}
diff --git a/main/src/addins/MacPlatform/ChangeLog b/main/src/addins/MacPlatform/ChangeLog
deleted file mode 100644
index 9b29d2c928..0000000000
--- a/main/src/addins/MacPlatform/ChangeLog
+++ /dev/null
@@ -1,861 +0,0 @@
-2010-07-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs: Better fix for Bug 617276 - MonoDevelop
- crashes when clicking on a script error in Unity3d.
-
-2010-06-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs: Quote paths when opening files.
-
-2010-06-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs: Implemented CanOpenTerminal/OpenInTerminal.
-
-2010-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * Updater/UpdateService.cs: Fix incorrect use of
- ShowCustomDialog/RunCustomDialog.
-
-2010-05-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * Menus/OSXMenu.cs: Add a Return glyph mapping.
-
-2010-05-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs: More Macification.
-
-2010-05-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs: Macify some command names.
-
-2010-05-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Menus/OSXMenu.cs: Attempt to fix keyval->menu accel mapping
- for non-English keyboards.
-
-2010-05-11 Levi Bard <levi@unity3d.com>
-
- * Framework/AppleEvent.cs: Off-by-one.
-
-2010-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Menus/OSXMenu.cs: Track api changes.
-
-2010-05-04 Jonathan Pobst <monkey@jpobst.com>
-
- * Framework/AppleScript.cs: csc can't do Enum->Struct cast,
- make it an Enum->int->Struct cast.
-
-2010-04-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MacPlatform.cs:
- * MacPlatform.csproj:
- * Framework/AppleScript.cs:
- * ExternalConsoleProcess.cs: Implemented Mac external console,
- somewhat hackily.
-
-2010-04-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs:
- * Menus/OSXMenu.cs: Cleaner OpenUrl implementation.
-
-2010-04-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MacPlatform.cs:
- * MacPlatform.csproj: Call 'open' directly when opening urls
- to avoid the -W argument that mono adds, which leaves us
- with lots of zombie 'open' processes.
-
-2010-04-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * Framework/Carbon.cs:
- * Framework/AppleEvent.cs:
- * Framework/AppleScript.cs: Moved all the AE stuff from Carbon
- to AppleEvents.
-
-2010-04-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * Framework/Carbon.cs:
- * Framework/AppleEvent.cs:
- * Framework/AppleScript.cs:
- * Framework/ComponentManager.cs: Finally, working support for
- running AppleScript directly.
-
-2010-04-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MacPlatform.csproj:
- * Framework/Carbon.cs:
- * Framework/NavDialog.cs:
- * Framework/AppleEvent.cs:
- * Framework/AppleScript.cs:
- * Framework/ComponentManager.cs: Bind some OSA/AppleScript
- stuff.
-
-2010-04-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs: Track API.
-
-2010-04-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * Menus/OSXMenu.cs: Remove debug code.
-
-2010-04-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * Menus/OSXMenu.cs: Pass source type to command dispatch. Use
- command dispatch event to flash menubar when commands are
- triggered from a keybinding.
-
- * MacPlatform.cs: Convert enum command IDs to strings in a
- compatible way so they can be matched against the values we
- get from the command service.
-
- * Framework/HIToolbox.cs: Add P/Invoke sigs.
-
-2010-03-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs:
- * Framework/Carbon.cs:
- * Framework/ApplicationEvents.cs: Don't crash when the user
- cancels quitting.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MacPlatform.addin.xml: Bumped MD version.
-
-2010-03-18 Levi Bard <levi@unity3d.com>
-
- * MacPlatform.cs: Track API changes.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * Commands.cs:
- * MacPlatform.cs:
- * Menus/OSXMenu.cs:
- * MacPlatform.csproj:
- * gtk-gui/gui.stetic:
- * MacPlatform.addin.xml:
- * Updater/UpdateResult.cs:
- * Updater/UpdateDialog.cs:
- * Updater/UpdateService.cs: Merged MD.Projects into MD.Core,
- and MD.Projects.Gui, MD.Core.Gui and MD.Components into
- MD.Ide.
-
-2010-03-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs: Unbreak the OpenDocuments handler - the
- position handling changes stopped it from working when
- starting MD and when opening solutions.
-
-2010-03-16 Levi Bard <levi@unity3d.com>
-
- * MacPlatform/MacPlatform.cs
- * MacPlatform/Framework/Carbon.cs
- * MacPlatform/Framework/ApplicationEvents.cs: Enable position
- to be passed in OpenDocuments call.
-
-2010-02-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MacPlatform.csproj:
- * Framework/NavDialog.cs:
- * Framework/HIToolbox.cs:
- * Framework/AppleEvent.cs:
- * Framework/CoreFoundation.cs:
- * MacSelectFileDialogHandler.cs: More work on native dialogs.
-
-2010-02-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.addin.xml: Fix extensions.
-
- * MacSelectFileDialogHandler.cs: Stub other dialog handlers.
-
-2010-02-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * Framework/Carbon.cs: Better errors in exceptions.
-
-2010-02-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MacPlatform.csproj:
- * Framework/Carbon.cs:
- * MacPlatform.addin.xml:
- * Framework/NavDialog.cs:
- * MacSelectFileDialogHandler.cs: First shot at implementing
- Mac native dialogs.
-
-2010-01-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * Updater/UpdateService.cs: Send env flags to the update
- server.
-
-2010-01-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * Updater/UpdateDialog.cs: Colorize betas and alphas in the
- update dialog.
-
-2010-01-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * Updater/UpdateResult.cs: Fix property initialization.
-
- * Updater/UpdateDialog.cs: Remove unused field.
-
- * Updater/UpdateService.cs: Fix attribute name.
-
-2010-01-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * Updater/UpdateDialog.cs: Fix threading issue.
-
-2010-01-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * Updater/UpdateResult.cs:
- * Updater/UpdateDialog.cs:
- * Updater/UpdateService.cs:
- * gtk-gui/MonoDevelop.Platform.Updater.UpdateDialog.cs: Add
- new alpha channel and clean up GUI for switching channels.
-
-2010-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * Updater/UpdateDialog.cs: Remove stray ShowAll call.
-
-2010-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * Updater/UpdateDialog.cs: Tidy up updater GUI a little more.
-
-2010-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * Updater/UpdateDialog.cs: Improve update GUI a bit more.
-
-2010-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * Updater/UpdateDialog.cs: Tidy up the update list a little.
-
-2010-01-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * Framework/Carbon.cs:
- * Framework/ApplicationEvents.cs: Fix HandleOpenUrls event
- class and string marshalling. Also fix event uninstallation.
-
-2010-01-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Framework/ApplicationEvents.cs: Fix event IDs. Use
- GetUrlListFromEventRef.
-
- * Framework/Carbon.cs: New GetUrlListFromEventRef and
- GetStringFromAEPtr methods.
-
-2010-01-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs:
- * Framework/ApplicationEvents.cs: Remove OpenContents event
- since it didn't really work.
-
-2010-01-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Framework/ApplicationEvents.cs: Fix locking.
-
-2010-01-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MacPlatform.cs:
- * MacPlatform.csproj:
- * Framework/Carbon.cs:
- * Framework/ApplicationEvents.cs: Refactor out
- ApplicationEvents code.
-
-2010-01-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * Updater/UpdateDialog.cs: Cache the stable/unstable result so
- we don't re-request on every toggle.
-
-2010-01-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Updater/UpdateDialog.cs:
- * Updater/UpdateService.cs: Let the server handle the logic of
- showing stable updates to users with unstable versions when
- they opt back out of the unstable channel.
-
-2010-01-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Updater/UpdateDialog.cs:
- * Updater/UpdateResult.cs:
- * Updater/UpdateService.cs: Filter and flag unstable updates.
-
-2010-01-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * Updater/UpdateDialog.cs:
- * gtk-gui/MonoDevelop.Platform.Updater.UpdateDialog.cs: Tweak
- layout. Show message when fetching unstable updates.
-
-2010-01-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Updater:
- * Makefile.am:
- * Commands.cs:
- * MacUpdater.cs:
- * UpdateDialog.cs:
- * MacPlatform.csproj:
- * gtk-gui/gui.stetic:
- * Updater/Commands.cs:
- * MacPlatform.addin.xml:
- * Updater/UpdateResult.cs:
- * Updater/UpdateDialog.cs:
- * Updater/UpdateService.cs:
- * gtk-gui/MonoDevelop.Platform.UpdateDialog.cs:
- * gtk-gui/MonoDevelop.Platform.Updater.UpdateDialog.cs:
- Refactor the updater code into something a bit more
- reusable. Make update dialog singleton. Allow checking for
- unstable updates, when the web service allows it. Present
- errors in the updater dialog iteself.
-
-2009-12-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * Menus/OSXMenu.cs: Use new Workbench.HasToplevelFocus
- property so that the main menu is enabled when focus is in
- floating pad.
-
-2009-12-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacUpdater.cs: Add the updateinfo for MonoTouch source.
-
-2009-12-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs:
- * Framework/Carbon.cs: Try to set the process name using
- private carbon API, to make sure that the main menu displays
- correctly, even on 2.6 previews and when started from a
- launch script directly.
-
-2009-12-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs: Check that apache mime DB exists before
- trying to read it.
-
-2009-12-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs: Don't return an invalid application from
- GetAllApplications. Fixes "Bug 552403 - Right clicking Open
- With -> List of programs to open with on a file results in
- an exception".
-
-2009-11-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.addin.xml: Fix author.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MacPlatform.addin.xml: Bump MD version.
-
-2009-10-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Menus/OSXMenu.cs: Oops, fix menu item index. With last few
- commits, fixes Bug 545151 - Dynamic submenus in Mac main
- menu don't work.
-
-2009-10-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Menus/OSXMenu.cs: Set the refcon in dynamic submenus, so the
- command can be run.
-
-2009-10-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Menus/OSXMenu.cs: Handle array separators, try 3.
-
-2009-10-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * Menus/OSXMenu.cs: Fix separators in arrays commands, try 2.
-
-2009-10-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * Menus/OSXMenu.cs: Fix separators in dynamic submenus.
-
-2009-10-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacUpdater.cs: Add csdk updateinfo file. Remove the hack for
- forcing Mono updateinfos as it won't work with the
- architectural variations of the Mono packages.
-
-2009-10-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Commands.cs:
- * MacUpdater.cs:
- * UpdateDialog.cs: Add workaround for updating older versions
- of Mono that don't have updateinfo file. Clean up API.
-
-2009-10-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacUpdater.cs: Tidy up.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MacPlatform.addin.xml: Bump MD version.
-
-2009-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * UpdateDialog.cs: Fix closure capturing var from loop. Tweak
- spacing.
-
-2009-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Platform.UpdateDialog.cs: Fix label
- alignment.
-
-2009-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * UpdateDialog.cs: Make textviews noneditable. Fix margins and
- wrapping.
-
-2009-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * UpdateDialog.cs: Tweak presentation of release notes.
-
-2009-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacUpdater.cs:
- * UpdateDialog.cs: Better presentation of older releases.
- Tweak packing.
-
-2009-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * UpdateDialog.cs:
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Platform.UpdateDialog.cs: Tweak frames.
-
-2009-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * UpdateDialog.cs: Add frames around the updates.
-
-2009-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * UpdateDialog.cs:
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Platform.UpdateDialog.cs: Restore the
- info label.
-
-2009-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Commands.cs:
- * MacPlatform.cs:
- * MacPlatform.addin.xml: Use a proper startup command handler.
-
- * MacUpdater.cs:
- * UpdateDialog.cs:
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Platform.UpdateDialog.cs: Simplify
- dialog and show it down there are no updates.
-
-2009-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * UpdateDialog.cs:
- * gtk-gui/MonoDevelop.Platform.UpdateDialog.cs: Prettify
- update dialog.
-
-2009-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Commands.cs: Hide command when no updateable packages exist.
-
- * MacUpdater.cs: Fix update paths.
-
-2009-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * UpdateDialog.cs: Add missing ShowAll call.
-
- * MacUpdater.cs: If explictly checking for updates, tell the
- user if there are none.
-
-2009-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.addin.xml: Fix command handler name.
-
-2009-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Commands.cs:
- * MacPlatform.addin.xml: Add command for checking for updates.
-
- * Makefile.am:
- * MacPlatform.csproj: Updated.
-
- * MacUpdater.cs:
- * UpdateDialog.cs: Add updater dialog.
-
- * gtk-gui:
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.Platform.UpdateDialog.cs: Add generated
- files.
-
-2009-09-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MacUpdater.cs:
- * MacPlatform.cs:
- * MacPlatform.csproj: Add mostly-implemented Mac updater.
-
-2009-09-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Commands.cs:
- * Framework/Carbon.cs: ProcessHICommand takes command by ref.
-
-2009-09-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Commands.cs:
- * Framework/Carbon.cs: Send the commands from the menu.
-
-2009-09-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.addin.xml: Fix command names.
-
-2009-09-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Commands.cs:
- * Framework/Carbon.cs:
- * MacPlatform.addin.xml: Add command handlers for Hide Window
- and Hide Others.
-
-2009-09-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.addin.xml: Fix casing of addin attribute.
-
-2009-09-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.addin.xml: Depend on the Ide addin.
-
-2009-09-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.addin.xml: Put the command in the menu.
-
-2009-09-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * Commands.cs:
- * Makefile.am:
- * MacPlatform.csproj:
- * MacPlatform.addin.xml: Add a Minimize command.
-
-2009-09-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs: Change default font to Monaco now that the
- text editor offset bug is fixed.
-
-2009-09-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs: Bump GTK+ requirement to 2.17.9 to require
- client-side windows, which greatly reduces rendering
- glitches.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MacPlatform.csproj: Updated dependencies. We now depend on
- gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Menus/OSXMenu.cs: Implement simple GMarkup stripping for
- command strings.
-
-2009-07-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * Menus/OSXMenu.cs: Fix unhiding of menu items.
-
-2009-05-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Menus/OSXMenu.cs: Tweaks to display some glyphs correctly.
-
-2009-04-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs: Check GTK# version. Fix default font string.
-
- * Framework/Carbon.cs: Fix build.
-
-2009-04-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs: Use Osaka Regular-Mono font as a workaround
- for kerning-related text selection issues with other
- Monospace fonts on Mac.
-
-2009-04-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Framework/Carbon.cs: More bindings.
-
-2009-04-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Framework/Carbon.cs: In-progress wrappers for file dialog
- APIs.
-
-2009-04-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs: Open files when the open-documents event
- comes in.
-
- * Framework/Carbon.cs: Add a note about path length.
-
-2009-04-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * Framework/Carbon.cs: Added P/Invokes and structure/enum
- definitions for AEDesc and FSRef manipulation.
-
- * MacPlatform.cs: Register for file open events, and extract
- the filenames. Staticify some global stuff.
-
-2009-04-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * Menus/OSXMenu.cs: Add some notes. Don't show accelerators
- with modifiers we can't display.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MacPlatform.addin.xml: Bump MD version.
-
-2009-04-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * Menus/OSXMenu.cs: Implement support for link commands. Tidy
- up errors and warnings.
-
-2009-04-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Menus/OSXMenu.cs: When array commands have no items, leave
- an invisible item in the list so it can still get updated
- later.
-
- * Framework/HIToolbox.cs: More P/Invokes.
-
-2009-04-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MacPlatform.csproj: Updated.
-
- * Ige:
- * Ige/IgeMacDock.cs:
- * Ige/IgeMacMenu.cs:
- * Ige/IgeMacBundle.cs:
- * Ige/ObjectManager.cs:
- * Ige/IgeMacMenuGroup.cs:
- * Ige/IgeMacAttentionType.cs:
- * Ige/IgeMacAttentionRequest.cs: Remove IGE, as it's no longer
- used.
-
- * Menus/OSXMenu.cs: Make comment clearer.
-
- * MacPlatform.cs: Remove IGE. Add dock quit and click support.
- Stub doc open support.
-
- * Framework/Carbon.cs: Add some more definitions.
-
-2009-04-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Menus/OSXMenu.cs: Implement support for array commands and
- dynamically populated submenus.
-
- * Framework/HIToolbox.cs: More P/Invokes and enums.
-
-2009-04-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Menus/OSXMenu.cs: Keep commands ID mappings around
- permanently, so that recreation is cleaner. Fixes app menu
- commands after recreation.
-
- * MacPlatform.cs: Hide quit command from file menu, since it's
- in app menu. Track API.
-
-2009-04-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Menus/OSXMenu.cs: Lots of refactoring. Handle updating text,
- accelerators, visibility, sensitivity. Hide unnecessary
- separators. Disable menus when MD root window doesn't have
- toplevel focus so that it can't interfere with modal
- dialogs. Map commands to standard command IDs when possible.
- Dispatch commands after returning from handler. Avoid
- command ID 0 since it's used when there's no command ID. Add
- an API for handling the app menu.
-
- * MacPlatform.cs: Install app menu items without using IGE.
- Enable Mac menu since it mostly works now.
-
- * Framework/Carbon.cs: More bindings. Fix Handled/NotHandled
- values (MWF had them the wrong way round).
-
- * Framework/HIToolbox.cs: More bindings.
-
-2009-04-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MacPlatform.csproj: Add System.Core ref.
-
- * Menus/OSXMenu.cs: Implement command enabled/disable
- updating.
-
- * Framework/Carbon.cs: Add command enums values.
-
- * Framework/HIToolbox.cs: More P/Invokes.
-
- * MacPlatform.cs: Track API. Hide commands that're in the app
- menu.
-
-2009-04-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs: Track API. Update menu when the command set
- changes.
-
- * Framework/Carbon.cs: Wrap Install*EventHandler in nicer API.
-
- * Framework/HIToolbox.cs: Add ClearMenuBar and DeleteMenu
- P/Invokes, and wrap CreateMenu in nicer API.
-
- * Menus/OSXMenu.cs: Heavy refactoring. Make static, since
- there is only ever one global menu. Handle
- destorying/recreating menu. Track P/Invokes API wrapper
- changes.
-
-2009-04-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * Menus/OSXMenu.cs: Don't use instance methods as callbacks,
- as the managed objects are currently GC'd. We can now handle
- the menu open events and writeline the menu names.
-
- * Framework/Carbon.cs: Add a GetEventParameter overload for
- IntPtr.
-
- * Framework/HIToolbox.cs: ToString overload for
- CarbonMenuException.
-
-2009-04-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Framework:
- * Makefile.am:
- * MacPlatform.csproj:
- * Framework/Carbon.cs:
- * Framework/HIToolbox.cs:
- * Framework/CoreFoundation.cs: Move the P/Invokes and wrappers
- into a separate framework namespace.
-
- * Menus/OSXMenu.cs: Add an event handler so that the commands
- are run when the menu's clicked. Move P/Invokes and wrappers
- into another namespace.
-
-2009-04-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs: Use the OSXMenu wrapper instead of IGE.
- Currently disabled.
-
- * Menus:
- * Makefile.am:
- * Menus/OSXMenu.cs:
- * MacPlatform.csproj: Add Miguel's first pass at wrapping the
- OS X menus.
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MacPlatform.csproj: Flush.
-
-2009-02-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.csproj: Remove unwanted local copies.
-
-2009-02-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.csproj: Enable makefile integration.
-
- * Makefile.am: Update.
-
-2009-02-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs: Add working main menu support, but disable,
- because the menus don't display correctly. Add Mac-like
- close window, quit, etc behaviour. Add App menu commands.
-
-2009-02-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.csproj: Embed the addin manifest.
-
-2009-02-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.csproj: Updated.
-
- * Ige:
- * Ige/IgeMacDock.cs:
- * Ige/IgeMacMenu.cs:
- * Ige/IgeMacBundle.cs:
- * Ige/ObjectManager.cs:
- * Ige/IgeMacMenuGroup.cs:
- * Ige/IgeMacAttentionType.cs:
- * Ige/IgeMacAttentionRequest.cs: Add local copy of Mac
- integration binding.
-
- * MacPlatform.cs: Implement main menu and Dock Quit
- integration. Untested.
-
-2009-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.csproj: Remove more inadvertent local copying of
- references.
-
-2009-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.csproj: Add project file for MacPlatform addin.
-
-2009-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MacPlatform.cs: Fix spelling of default font's name.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Make it work for parallel build.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * AssemblyInfo.cs: Add AssemblyInfo.cs files that are autogenerated from
- the addin manifests.
-
-2008-11-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Fix build dependencies.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MacPlatform.addin.xml: Bump MD version.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MacPlatform.addin.xml: Bump MD version.
-
-2008-04-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MacPlatform.cs: Track api changes.
-
-2008-02-14 Geoff Norton <gnorton@novell.com>
-
- * MacPlatform.cs: Expose the Name property.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MacPlatform.addin.xml: Update MD version.
-
-2007-12-17 Geoff Norton <gnorton@novell.com>
-
- * Makefile.am: Fix the build on the Mac profile
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MacPlatform.addin.xml, MacPlatform.cs: Moved PlatformService to
- MD.Core.Gui. Removed old FileIconService class, which is now implemented
- in PlatformService.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MacPlatform.addin.xml: Bump add-in versions.
-
-2007-12-06 Geoff Norton <gnorton@novell.com>
-
- * Initial check in of the Mac PlatformService that provides
- Mac equivalents to the Gnome calls in Gnome.Vfs
diff --git a/main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs b/main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs
index 6dae47989f..51cbec79bf 100644
--- a/main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs
+++ b/main/src/addins/MacPlatform/Dialogs/MacAlertDialogHandler.cs
@@ -46,6 +46,7 @@ namespace MonoDevelop.MacIntegration
{
using (var alert = new NSAlert ()) {
alert.Window.Title = data.Title ?? BrandingService.ApplicationName;
+ IdeTheme.ApplyTheme (alert.Window);
bool stockIcon;
if (data.Message.Icon == MonoDevelop.Ide.Gui.Stock.Error || data.Message.Icon == Gtk.Stock.DialogError) {
@@ -61,7 +62,13 @@ namespace MonoDevelop.MacIntegration
if (!stockIcon && !string.IsNullOrEmpty (data.Message.Icon)) {
var img = ImageService.GetIcon (data.Message.Icon, Gtk.IconSize.Dialog);
- alert.Icon = img.ToNSImage ();
+ // HACK: VK The icon is not rendered in dark style correctly
+ // Use light variant and reder it here
+ // as long as NSAppearance.NameVibrantDark is broken
+ if (IdeTheme.UserInterfaceSkin == Skin.Dark)
+ alert.Icon = img.WithStyles ("-dark").ToBitmap (GtkWorkarounds.GetScaleFactor ()).ToNSImage ();
+ else
+ alert.Icon = img.ToNSImage ();
} else {
//for some reason the NSAlert doesn't pick up the app icon by default
alert.Icon = NSApplication.SharedApplication.ApplicationIconImage;
@@ -149,7 +156,9 @@ namespace MonoDevelop.MacIntegration
}
if (!data.Message.CancellationToken.IsCancellationRequested) {
+
var result = (int)alert.RunModal () - (long)(int)NSAlertButtonReturn.First;
+
completed = true;
if (result >= 0 && result < buttons.Count) {
data.ResultButton = buttons [(int)result];
@@ -171,7 +180,9 @@ namespace MonoDevelop.MacIntegration
if (applyToAllCheck != null && applyToAllCheck.State != 0)
data.ApplyToAll = true;
-
+
+
+
GtkQuartz.FocusWindow (data.TransientFor ?? MessageService.RootWindow);
}
diff --git a/main/src/addins/MacPlatform/Dialogs/MacExceptionDialogHandler.cs b/main/src/addins/MacPlatform/Dialogs/MacExceptionDialogHandler.cs
deleted file mode 100644
index 44670fe2ed..0000000000
--- a/main/src/addins/MacPlatform/Dialogs/MacExceptionDialogHandler.cs
+++ /dev/null
@@ -1,260 +0,0 @@
-//
-// MacErrorDialogHandler.cs
-//
-// Author:
-// Alan McGovern <alan@xamarin.com>
-//
-// Copyright 2011 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Linq;
-using System.Collections.Generic;
-
-using Foundation;
-using CoreGraphics;
-using AppKit;
-
-using MonoDevelop.Core;
-using MonoDevelop.Ide;
-using MonoDevelop.Components.Extensions;
-using MonoDevelop.MacInterop;
-
-namespace MonoDevelop.MacIntegration
-{
- class MacExceptionDialogHandler : IExceptionDialogHandler
- {
- class MyTextView : NSTextView
- {
- public MyTextView (CGRect frame)
- : base (frame)
- {
-
- }
-
- public override void KeyDown (NSEvent theEvent)
- {
- if (theEvent.ModifierFlags.HasFlag (NSEventModifierMask.CommandKeyMask)) {
- switch (theEvent.Characters) {
- case "x":
- Cut (this);
- break;
- case "c":
- NSRange range = SelectedRange;
- if (range.Length == 0)
- SelectAll (this);
- Copy (this);
- break;
- case "a":
- SelectAll (this);
- break;
- }
- }
-
- base.KeyDown (theEvent);
- }
- }
-
- public bool Run (ExceptionDialogData data)
- {
- using (var alert = new NSAlert { AlertStyle = NSAlertStyle.Critical }) {
- alert.Icon = NSApplication.SharedApplication.ApplicationIconImage;
-
- alert.MessageText = data.Title ?? GettextCatalog.GetString ("Error");
-
- if (!string.IsNullOrEmpty (data.Message)) {
- alert.InformativeText = data.Message;
- }
-
- List<AlertButton> buttons = null;
- if (data.Buttons != null && data.Buttons.Length > 0)
- buttons = data.Buttons.Reverse ().ToList ();
-
- if (buttons != null) {
- foreach (var button in buttons) {
- var label = button.Label;
- if (button.IsStockButton)
- label = Gtk.Stock.Lookup (label).Label;
- label = label.Replace ("_", "");
-
- //this message seems to be a standard Mac message since alert handles it specially
- if (button == AlertButton.CloseWithoutSave)
- label = GettextCatalog.GetString ("Don't Save");
-
- alert.AddButton (label);
- }
- }
-
- if (data.Exception != null) {
- var scrollSize = new CGSize (400, 130);
- const float spacing = 4;
-
- string title = GettextCatalog.GetString ("View details");
- string altTitle = GettextCatalog.GetString ("Hide details");
-
- var buttonFrame = new CGRect (0, 0, 0, 0);
- var button = new NSButton (buttonFrame) {
- BezelStyle = NSBezelStyle.Disclosure,
- Title = "",
- AlternateTitle = "",
- };
- button.SetButtonType (NSButtonType.OnOff);
- button.SizeToFit ();
-
- var label = new MDClickableLabel (title) {
- Alignment = NSTextAlignment.Left,
- };
- label.SizeToFit ();
-
- button.SetFrameSize (new CGSize (button.Frame.Width, NMath.Max (button.Frame.Height, label.Frame.Height)));
- label.SetFrameOrigin (new CGPoint (button.Frame.Width + 5, button.Frame.Y));
-
- var text = new MyTextView (new CGRect (0, 0, float.MaxValue, float.MaxValue)) {
- HorizontallyResizable = true,
- };
- text.TextContainer.ContainerSize = new CGSize (float.MaxValue, float.MaxValue);
- text.TextContainer.WidthTracksTextView = true;
- text.InsertText (new NSString (data.Exception.ToString ()));
- text.Editable = false;
-
- var scrollView = new NSScrollView (new CGRect (CGPoint.Empty, CGSize.Empty)) {
- HasHorizontalScroller = true,
- HasVerticalScroller = true,
- };
-
- var accessory = new NSView (new CGRect (0, 0, scrollSize.Width, button.Frame.Height));
- accessory.AddSubview (scrollView);
- accessory.AddSubview (button);
- accessory.AddSubview (label);
-
- alert.AccessoryView = accessory;
-
- button.Activated += delegate {
- nfloat change;
- if (button.State == NSCellStateValue.On) {
- change = scrollSize.Height + spacing;
- label.StringValue = altTitle;
- scrollView.Hidden = false;
- scrollView.Frame = new CGRect (CGPoint.Empty, scrollSize);
- scrollView.DocumentView = text;
- } else {
- change = -(scrollSize.Height + spacing);
- label.StringValue = title;
- scrollView.Hidden = true;
- scrollView.Frame = new CGRect (CGPoint.Empty, CGSize.Empty);
- }
- var f = accessory.Frame;
- f.Height += change;
- accessory.Frame = f;
- var lf = label.Frame;
- lf.Y += change;
- label.Frame = lf;
- var bf = button.Frame;
- bf.Y += change;
- button.Frame = bf;
- label.SizeToFit ();
- var panel = alert.Window;
- var pf = panel.Frame;
- pf.Height += change;
- pf.Y -= change;
- panel.SetFrame (pf, true, true);
- //unless we assign the icon again, it starts nesting old icon into the warning icon
- alert.Icon = NSApplication.SharedApplication.ApplicationIconImage;
- alert.Layout ();
- };
- label.OnMouseUp += (sender, e) => button.PerformClick (e.Event);
- }
-
- var result = (int)(nint)alert.RunModal () - (int)(long)NSAlertButtonReturn.First;
- data.ResultButton = buttons != null ? buttons [result] : null;
- GtkQuartz.FocusWindow (data.TransientFor ?? MessageService.RootWindow);
- }
-
- return true;
- }
-
- class MDClickableLabel: MDLabel
- {
- public MDClickableLabel (string text) : base (text)
- {
- }
-
- public override void MouseDown (NSEvent theEvent)
- {
- if (OnMouseDown != null)
- OnMouseDown (this, new NSEventArgs (theEvent));
- else
- base.MouseDown (theEvent);
- }
-
- public event EventHandler<NSEventArgs> OnMouseDown;
-
- public override void MouseUp (NSEvent theEvent)
- {
- if (OnMouseUp != null)
- OnMouseUp (this, new NSEventArgs (theEvent));
- else
- base.MouseUp (theEvent);
- }
-
- public event EventHandler<NSEventArgs> OnMouseUp;
-
- public override void MouseEntered (NSEvent theEvent)
- {
- if (OnMouseEntered != null)
- OnMouseEntered (this, new NSEventArgs (theEvent));
- else
- base.MouseEntered (theEvent);
- }
-
- public event EventHandler<NSEventArgs> OnMouseEntered;
-
- public override void MouseExited (NSEvent theEvent)
- {
- if (OnMouseExited != null)
- OnMouseExited (this, new NSEventArgs (theEvent));
- else
- base.MouseExited (theEvent);
- }
-
- public event EventHandler<NSEventArgs> OnMouseExited;
-
- public override void MouseMoved (NSEvent theEvent)
- {
- if (OnMouseMoved != null)
- OnMouseMoved (this, new NSEventArgs (theEvent));
- else
- base.MouseMoved (theEvent);
- }
-
- public event EventHandler<NSEventArgs> OnMouseMoved;
- }
-
- class NSEventArgs : EventArgs
- {
- public NSEventArgs (NSEvent evt)
- {
- this.Event = evt;
- }
-
- public NSEvent Event { get; private set; }
- }
- }
-}
diff --git a/main/src/addins/MacPlatform/Dialogs/MacOpenFileDialogHandler.cs b/main/src/addins/MacPlatform/Dialogs/MacOpenFileDialogHandler.cs
index 5dca5957c8..4f01020f21 100644
--- a/main/src/addins/MacPlatform/Dialogs/MacOpenFileDialogHandler.cs
+++ b/main/src/addins/MacPlatform/Dialogs/MacOpenFileDialogHandler.cs
@@ -34,6 +34,7 @@ using AppKit;
using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Extensions;
using MonoDevelop.Ide.Gui;
using MonoDevelop.MacInterop;
@@ -56,7 +57,7 @@ namespace MonoDevelop.MacIntegration
CanChooseFiles = (data.Action & FileChooserAction.FileFlags) != 0,
};
}
-
+
MacSelectFileDialogHandler.SetCommonPanelProperties (data, panel);
SelectEncodingPopUpButton encodingSelector = null;
@@ -216,7 +217,8 @@ namespace MonoDevelop.MacIntegration
if (closeSolutionButton != null)
closeSolutionButton.State = NSCellStateValue.On;
- selected = 0;
+ if (!CanBeOpenedInAssemblyBrowser (filename))
+ selected = 0;
hasWorkbenchViewer = true;
i++;
}
@@ -241,6 +243,11 @@ namespace MonoDevelop.MacIntegration
return hasWorkbenchViewer;
}
+ static bool CanBeOpenedInAssemblyBrowser (FilePath filename)
+ {
+ return filename.Extension.ToLower () == ".exe" || filename.Extension.ToLower () == ".dll";
+ }
+
static void CenterAccessoryView (MDBox box)
{
box.Layout ();
diff --git a/main/src/addins/MacPlatform/Dialogs/MacSelectFileDialogHandler.cs b/main/src/addins/MacPlatform/Dialogs/MacSelectFileDialogHandler.cs
index fa9914aab5..578f2dbb85 100644
--- a/main/src/addins/MacPlatform/Dialogs/MacSelectFileDialogHandler.cs
+++ b/main/src/addins/MacPlatform/Dialogs/MacSelectFileDialogHandler.cs
@@ -55,6 +55,7 @@ namespace MonoDevelop.MacIntegration
panel = new NSOpenPanel {
CanChooseDirectories = (data.Action & FileChooserAction.FolderFlags) != 0,
CanChooseFiles = (data.Action & FileChooserAction.FileFlags) != 0,
+ CanCreateDirectories = (data.Action & FileChooserAction.CreateFolder) != 0,
ResolvesAliases = false,
};
}
diff --git a/main/src/addins/MacPlatform/Dialogs/SelectEncodingPopUpButton.cs b/main/src/addins/MacPlatform/Dialogs/SelectEncodingPopUpButton.cs
index c8787d809f..5483cbbd78 100644
--- a/main/src/addins/MacPlatform/Dialogs/SelectEncodingPopUpButton.cs
+++ b/main/src/addins/MacPlatform/Dialogs/SelectEncodingPopUpButton.cs
@@ -32,6 +32,7 @@ using AppKit;
using MonoDevelop.Core;
using MonoDevelop.Ide;
using MonoDevelop.Projects.Text;
+using System.Linq;
namespace MonoDevelop.MacIntegration
{
diff --git a/main/src/addins/MacPlatform/ExtendedTitleBarDialogBackend.cs b/main/src/addins/MacPlatform/ExtendedTitleBarDialogBackend.cs
index b65f0debb0..4781869e98 100644
--- a/main/src/addins/MacPlatform/ExtendedTitleBarDialogBackend.cs
+++ b/main/src/addins/MacPlatform/ExtendedTitleBarDialogBackend.cs
@@ -33,7 +33,7 @@ using Xwt.GtkBackend;
namespace MonoDevelop.MacIntegration
{
- class ExtendedTitleBarDialogBackend: Xwt.GtkBackend.DialogBackend, IExtendedTitleBarDialogBackend
+ class ExtendedTitleBarDialogBackend: ThemedGtkDialogBackend, IExtendedTitleBarDialogBackend
{
CustomToolbar toolbar;
@@ -44,7 +44,7 @@ namespace MonoDevelop.MacIntegration
WidgetFlags |= Gtk.WidgetFlags.AppPaintable;
}
- public Cairo.ImageSurface Background {
+ public Gdk.Pixbuf Background {
get;
set;
}
@@ -67,10 +67,12 @@ namespace MonoDevelop.MacIntegration
context.LineWidth = 1;
if (Background != null && Background.Width > 0) {
for (int x=0; x < Allocation.Width; x += Background.Width) {
- Background.Show (context, x, -TitleBarHeight);
+ Gdk.CairoHelper.SetSourcePixbuf (context, Background, x, -TitleBarHeight);
+ context.Paint ();
}
} else {
context.Rectangle (0, 0, Allocation.Width, Allocation.Height);
+
using (var lg = new Cairo.LinearGradient (0, 0, 0, Allocation.Height)) {
lg.AddColorStop (0, Style.Light (Gtk.StateType.Normal).ToCairoColor ());
lg.AddColorStop (1, Style.Mid (Gtk.StateType.Normal).ToCairoColor ());
@@ -79,14 +81,10 @@ namespace MonoDevelop.MacIntegration
context.Fill ();
}
- context.MoveTo (0, Allocation.Height - 0.5);
- context.RelLineTo (Allocation.Width, 0);
- context.SetSourceColor (MonoDevelop.Ide.Gui.Styles.ToolbarBottomBorderColor);
- context.Stroke ();
- context.MoveTo (0, Allocation.Height - 1.5);
+ context.MoveTo (0, Allocation.Height - 0.5);
context.RelLineTo (Allocation.Width, 0);
- context.SetSourceColor (MonoDevelop.Ide.Gui.Styles.ToolbarBottomGlowColor);
+ context.SetSourceColor (Ide.Gui.Styles.ToolbarBottomBorderColor.ToCairoColor ());
context.Stroke ();
}
@@ -102,18 +100,17 @@ namespace MonoDevelop.MacIntegration
{
base.Initialize ();
- var resource = "maintoolbarbg.png";
+ var image = Xwt.Drawing.Image.FromResource (typeof(MacPlatformService).Assembly, "maintoolbarbg.png");
Window.Realized += delegate {
NSWindow w = GtkQuartz.GetWindow (Window);
w.IsOpaque = false;
- NSImage img = MacPlatformService.LoadImage (resource);
- w.BackgroundColor = NSColor.FromPatternImage (img);
+ w.BackgroundColor = NSColor.FromPatternImage (image.ToBitmap().ToNSImage());
w.StyleMask |= NSWindowStyle.TexturedBackground;
};
toolbar = new CustomToolbar ();
- toolbar.Background = MonoDevelop.Components.CairoExtensions.LoadImage (typeof(MacPlatformService).Assembly, resource);
+ toolbar.Background = (Gdk.Pixbuf)Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk).GetNativeImage (image);
toolbar.TitleBarHeight = MacPlatformService.GetTitleBarHeight ();
MainBox.PackStart (toolbar, false, false, 0);
((Gtk.Box.BoxChild)MainBox [toolbar]).Position = 0;
diff --git a/main/src/addins/MacPlatform/ExtendedTitleBarWindowBackend.cs b/main/src/addins/MacPlatform/ExtendedTitleBarWindowBackend.cs
index d6dc9051d1..efa431d912 100644
--- a/main/src/addins/MacPlatform/ExtendedTitleBarWindowBackend.cs
+++ b/main/src/addins/MacPlatform/ExtendedTitleBarWindowBackend.cs
@@ -33,7 +33,7 @@ using Xwt.GtkBackend;
namespace MonoDevelop.MacIntegration
{
- class ExtendedTitleBarWindowBackend: Xwt.GtkBackend.WindowBackend, IExtendedTitleBarWindowBackend
+ class ExtendedTitleBarWindowBackend: ThemedGtkWindowBackend, IExtendedTitleBarWindowBackend
{
CustomToolbar toolbar;
@@ -44,7 +44,7 @@ namespace MonoDevelop.MacIntegration
WidgetFlags |= Gtk.WidgetFlags.AppPaintable;
}
- public Cairo.ImageSurface Background {
+ public Gdk.Pixbuf Background {
get;
set;
}
@@ -67,10 +67,13 @@ namespace MonoDevelop.MacIntegration
context.LineWidth = 1;
if (Background != null && Background.Width > 0) {
for (int x=0; x < Allocation.Width; x += Background.Width) {
- Background.Show (context, x, -TitleBarHeight);
+ Gdk.CairoHelper.SetSourcePixbuf (context, Background, x, -TitleBarHeight);
+ context.Paint ();
}
} else {
context.Rectangle (0, 0, Allocation.Width, Allocation.Height);
+
+ // FIXME: VV: Remove gradient features
using (var lg = new Cairo.LinearGradient (0, 0, 0, Allocation.Height)) {
lg.AddColorStop (0, Style.Light (Gtk.StateType.Normal).ToCairoColor ());
lg.AddColorStop (1, Style.Mid (Gtk.StateType.Normal).ToCairoColor ());
@@ -79,14 +82,10 @@ namespace MonoDevelop.MacIntegration
context.Fill ();
}
- context.MoveTo (0, Allocation.Height - 0.5);
- context.RelLineTo (Allocation.Width, 0);
- context.SetSourceColor (MonoDevelop.Ide.Gui.Styles.ToolbarBottomBorderColor);
- context.Stroke ();
- context.MoveTo (0, Allocation.Height - 1.5);
+ context.MoveTo (0, Allocation.Height - 0.5);
context.RelLineTo (Allocation.Width, 0);
- context.SetSourceColor (MonoDevelop.Ide.Gui.Styles.ToolbarBottomGlowColor);
+ context.SetSourceColor (Ide.Gui.Styles.ToolbarBottomBorderColor.ToCairoColor ());
context.Stroke ();
}
@@ -102,18 +101,17 @@ namespace MonoDevelop.MacIntegration
{
base.Initialize ();
- var resource = "maintoolbarbg.png";
+ var image = Xwt.Drawing.Image.FromResource (typeof(MacPlatformService).Assembly, "maintoolbarbg.png");
Window.Realized += delegate {
NSWindow w = GtkQuartz.GetWindow (Window);
w.IsOpaque = false;
- NSImage img = MacPlatformService.LoadImage (resource);
- w.BackgroundColor = NSColor.FromPatternImage (img);
+ w.BackgroundColor = NSColor.FromPatternImage (image.ToBitmap().ToNSImage());
w.StyleMask |= NSWindowStyle.TexturedBackground;
};
toolbar = new CustomToolbar ();
- toolbar.Background = MonoDevelop.Components.CairoExtensions.LoadImage (typeof(MacPlatformService).Assembly, resource);
+ toolbar.Background = (Gdk.Pixbuf)Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk).GetNativeImage (image);
toolbar.TitleBarHeight = MacPlatformService.GetTitleBarHeight ();
MainBox.PackStart (toolbar, false, false, 0);
((Gtk.Box.BoxChild)MainBox [toolbar]).Position = 0;
diff --git a/main/src/addins/MacPlatform/MacExternalConsoleProcess.cs b/main/src/addins/MacPlatform/MacExternalConsoleProcess.cs
index dcafe4127f..dd88c7128b 100644
--- a/main/src/addins/MacPlatform/MacExternalConsoleProcess.cs
+++ b/main/src/addins/MacPlatform/MacExternalConsoleProcess.cs
@@ -33,10 +33,12 @@ using System.Collections.Generic;
using MonoDevelop.Core;
using MonoDevelop.Core.Execution;
using MonoDevelop.MacInterop;
+using System.Threading.Tasks;
+using System.IO;
namespace MonoDevelop.MacIntegration
{
- internal class MacExternalConsoleProcess : IProcessAsyncOperation
+ internal class MacExternalConsoleProcess : ProcessAsyncOperation
{
/*
NOTES ON CONTROLLING A TERMINAL WITH APPLESCRIPT
@@ -79,25 +81,37 @@ where running an explicit exec causes it to quit after the exec runs, so we can'
bash pause on exit trick
*/
string tabId, windowId;
- bool cancelled;
-
+
public MacExternalConsoleProcess (string command, string arguments, string workingDirectory,
IDictionary<string, string> environmentVariables,
string title, bool pauseWhenFinished)
{
- RunTerminal (
+ CancellationTokenSource = new CancellationTokenSource ();
+ CancellationTokenSource.Token.Register (CloseTerminal);
+
+ // FIXME set value of ProcessId, if possible
+
+ var intTask = RunTerminal (
command, arguments, workingDirectory, environmentVariables, title, pauseWhenFinished,
- out tabId, out windowId
+ out tabId, out windowId, CancellationTokenSource.Token
);
+ intTask.ContinueWith (delegate {
+ ExitCode = intTask.Result;
+ });
+ Task = intTask;
}
#region AppleScript terminal manipulation
- internal static void RunTerminal (
+ internal static Task<int> RunTerminal (
string command, string arguments, string workingDirectory,
IDictionary<string, string> environmentVariables,
- string title, bool pauseWhenFinished, out string tabId, out string windowId)
+ string title, bool pauseWhenFinished, out string tabId, out string windowId, CancellationToken cancelToken = default(CancellationToken))
{
+ TaskCompletionSource<int> taskSource = new TaskCompletionSource<int> ();
+ cancelToken.Register (delegate {
+ taskSource.SetCanceled ();
+ });
//build the sh command
var sb = new StringBuilder ("clear; ");
if (!string.IsNullOrEmpty (workingDirectory))
@@ -112,6 +126,19 @@ bash pause on exit trick
}
if (command != null) {
sb.AppendFormat ("\"{0}\" {1}", Escape (command), arguments);
+ var tempFileName = Path.GetTempFileName ();
+ sb.Append ($"; echo $? > {tempFileName}");
+ var fileWatcher = new FileSystemWatcher (Path.GetDirectoryName (tempFileName), Path.GetFileName (tempFileName));
+ fileWatcher.EnableRaisingEvents = true;
+ fileWatcher.Changed += delegate {
+ lock(taskSource) {
+ if (taskSource.Task.IsCompleted)
+ return;
+ taskSource.SetResult (int.Parse (File.ReadAllText (tempFileName)));
+ File.Delete (tempFileName);
+ }
+ };
+
if (pauseWhenFinished)
sb.Append ("; echo; read -p 'Press any key to continue...' -n1");
sb.Append ("; exit");
@@ -135,9 +162,10 @@ bash pause on exit trick
try {
AppleScript.Run (sb.ToString ());
- } catch (AppleScriptException) {
- //it may already have closed
+ } catch (Exception ex) {
+ taskSource.SetException (ex);
}
+ return taskSource.Task;
}
//FIXME: make escaping work properly
@@ -168,67 +196,14 @@ end tell", tabId, windowId);
#endregion
- #region IProcessAsyncOperation implementation
-
- public void Dispose ()
- {
- }
-
- public int ExitCode {
- get {
- //FIXME: implement. is it possible?
- return 0;
- }
- }
-
- public int ProcessId {
- get {
- //FIXME: implement. is it possible?
- return 0;
- }
- }
-
- #endregion
-
#region IAsyncOperation implementation
- public event OperationHandler Completed;
-
- public void Cancel ()
+ void CloseTerminal ()
{
- cancelled = true;
//FIXME: try to kill the process without closing the window, if pauseWhenFinished is true
CloseTerminalWindow (tabId, windowId);
}
-
- public void WaitForCompleted ()
- {
- while (!IsCompleted) {
- Thread.Sleep (1000);
- }
- }
-
- public bool IsCompleted {
- get {
- //FIXME: get the status of the process, not the whole script
- return !TabExists (tabId, windowId);
- }
- }
-
- public bool Success {
- get {
- //FIXME: any way to get the real result?
- return !cancelled;
- }
- }
-
-
- public bool SuccessWithWarnings {
- get {
- return Success;
- }
- }
-
+
#endregion
}
} \ No newline at end of file
diff --git a/main/src/addins/MacPlatform/MacInterop/CoreFoundation.cs b/main/src/addins/MacPlatform/MacInterop/CoreFoundation.cs
index 5937356f09..e2d4ab8949 100644
--- a/main/src/addins/MacPlatform/MacInterop/CoreFoundation.cs
+++ b/main/src/addins/MacPlatform/MacInterop/CoreFoundation.cs
@@ -64,7 +64,7 @@ namespace MonoDevelop.MacInterop
[DllImport (CFLib, CharSet=CharSet.Unicode)]
extern static IntPtr CFStringGetCharacters (IntPtr handle, CFRange range, IntPtr buffer);
-
+
public static string FetchString (IntPtr handle)
{
if (handle == IntPtr.Zero)
@@ -151,7 +151,7 @@ namespace MonoDevelop.MacInterop
All = 0xFFFFFFFF
}
- static IntPtr CreatePathUrl (string path)
+ public static IntPtr CreatePathUrl (string path)
{
IntPtr str = IntPtr.Zero;
IntPtr url = IntPtr.Zero;
diff --git a/main/src/addins/MacPlatform/MacInterop/Keychain.cs b/main/src/addins/MacPlatform/MacInterop/Keychain.cs
index a3717ebeb2..42afd88a92 100644
--- a/main/src/addins/MacPlatform/MacInterop/Keychain.cs
+++ b/main/src/addins/MacPlatform/MacInterop/Keychain.cs
@@ -210,11 +210,11 @@ namespace MonoDevelop.MacInterop
#region CFRange
struct CFRange {
- public int Location, Length;
+ public IntPtr Location, Length;
public CFRange (int l, int len)
{
- Location = l;
- Length = len;
+ Location = (IntPtr) l;
+ Length = (IntPtr) len;
}
}
diff --git a/main/src/addins/MacPlatform/MacInterop/LaunchServices.cs b/main/src/addins/MacPlatform/MacInterop/LaunchServices.cs
index cba21f5a40..18cbe899e6 100644
--- a/main/src/addins/MacPlatform/MacInterop/LaunchServices.cs
+++ b/main/src/addins/MacPlatform/MacInterop/LaunchServices.cs
@@ -27,7 +27,11 @@
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
+using System.Linq;
+
+using MonoDevelop.Core;
using Foundation;
+using AppKit;
namespace MonoDevelop.MacInterop
{
@@ -89,119 +93,79 @@ namespace MonoDevelop.MacInterop
public static class LaunchServices
{
- const string APP_SERVICES = "/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices";
- const string CFLIB = "/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation";
-
- [DllImport (APP_SERVICES)]
- static extern OSStatus LSOpenApplication (ref LSApplicationParameters appParams, out ProcessSerialNumber psn);
-
- public static ProcessSerialNumber OpenApplication (string application)
+ public static int OpenApplication (string application)
{
return OpenApplication (new ApplicationStartInfo (application));
}
-
- public static ProcessSerialNumber OpenApplication (ApplicationStartInfo application)
+
+ // This function can be replaced by NSWorkspace.LaunchApplication but it currently doesn't work
+ // https://bugzilla.xamarin.com/show_bug.cgi?id=32540
+
+ [DllImport ("/usr/lib/libobjc.dylib", EntryPoint = "objc_msgSend")]
+ static extern IntPtr IntPtr_objc_msgSend_IntPtr_UInt32_IntPtr_IntPtr (IntPtr receiver, IntPtr selector, IntPtr url, UInt32 options, IntPtr configuration, out IntPtr error);
+ static readonly IntPtr launchApplicationAtURLOptionsConfigurationErrorSelector = ObjCRuntime.Selector.GetHandle ("launchApplicationAtURL:options:configuration:error:");
+ public static int OpenApplication (ApplicationStartInfo application)
{
if (application == null)
throw new ArgumentNullException ("application");
-
+
if (string.IsNullOrEmpty (application.Application) || !System.IO.Directory.Exists (application.Application))
throw new ArgumentException ("Application is not valid");
-
- var appParams = new LSApplicationParameters ();
- if (application.NewInstance)
- appParams.flags |= LSLaunchFlags.NewInstance;
- if (application.Async)
- appParams.flags |= LSLaunchFlags.Async;
-
- NSArray argv = null;
+
+ NSUrl appUrl = NSUrl.FromFilename (application.Application);
+
+ // TODO: Once the above bug is fixed, we can replace the code below with
+ //NSRunningApplication app = NSWorkspace.SharedWorkspace.LaunchApplication (appUrl, 0, new NSDictionary (), null);
+
+ var config = new NSMutableDictionary ();
if (application.Args != null && application.Args.Length > 0) {
- var args = application.Args;
- NSObject[] arr = new NSObject[args.Length];
- for (int i = 0; i < args.Length; i++)
- arr[i] = new NSString (args[i]);
- argv = NSArray.FromNSObjects (arr);
- appParams.argv = argv.Handle;
- }
-
- NSDictionary dict = null;
- if (application.Environment.Count > 0) {
- dict = new NSMutableDictionary ();
- foreach (var kvp in application.Environment)
- dict.SetValueForKey (new NSString (kvp.Value), new NSString (kvp.Key));
- appParams.environment = dict.Handle;
+ var args = new NSMutableArray ();
+ foreach (string arg in application.Args) {
+ args.Add (new NSString (arg));
+ }
+ config.Add (new NSString ("NSWorkspaceLaunchConfigurationArguments"), args);
}
-
- var cfUrl = global::CoreFoundation.CFUrl.FromFile (application.Application);
- ProcessSerialNumber psn;
-
- try {
- appParams.application = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (FSRef)));
-
- if (!CoreFoundation.CFURLGetFSRef (cfUrl.Handle, appParams.application))
- throw new Exception ("Could not create FSRef from CFUrl");
-
- var status = LSOpenApplication (ref appParams, out psn);
- if (status != OSStatus.Ok)
- throw new LaunchServicesException ((int)status);
- } finally {
- if (appParams.application != IntPtr.Zero)
- Marshal.FreeHGlobal (appParams.application);
- appParams.application = IntPtr.Zero;
- if (dict != null)
- dict.Dispose (); //also ensures the NSDictionary is kept alive for the params
- if (argv != null)
- argv.Dispose (); //also ensures the NSArray is kept alive for the params
+
+ if (application.Environment != null && application.Environment.Count > 0) {
+ var envValueStrings = application.Environment.Values.Select (t => new NSString (t)).ToArray ();
+ var envKeyStrings = application.Environment.Keys.Select (t => new NSString (t)).ToArray ();
+
+ var envDict = new NSMutableDictionary ();
+ for (int i = 0; i < envValueStrings.Length; i++) {
+ envDict.Add (envKeyStrings[i], envValueStrings[i]);
+ }
+
+ config.Add (new NSString ("NSWorkspaceLaunchConfigurationEnvironment"), envDict);
}
-
- return psn;
- }
-
- struct LSApplicationParameters
- {
- public IntPtr version; // CFIndex, must be 0
- public LSLaunchFlags flags;
- public IntPtr application; //FSRef *
- public IntPtr asyncLaunchRefCon; // void *
- public IntPtr environment; // CFDictionaryRef
- public IntPtr argv; // CFArrayRef
- public IntPtr initialEvent; // AppleEvent *
+
+ UInt32 options = 0;
+
+ if (application.Async)
+ options |= (UInt32) LaunchOptions.NSWorkspaceLaunchAsync;
+ if (application.NewInstance)
+ options |= (UInt32) LaunchOptions.NSWorkspaceLaunchNewInstance;
+
+ IntPtr error;
+ var appHandle = IntPtr_objc_msgSend_IntPtr_UInt32_IntPtr_IntPtr (NSWorkspace.SharedWorkspace.Handle, launchApplicationAtURLOptionsConfigurationErrorSelector, appUrl.Handle, options, config.Handle, out error);
+ NSRunningApplication app = (NSRunningApplication)ObjCRuntime.Runtime.GetNSObject (appHandle);
+
+ return app.ProcessIdentifier;
}
-
+
[Flags]
- public enum LSLaunchFlags : uint
- {
- Defaults = 0x00000001,
- AndPrint = 0x00000002,
- AndDisplayErrors = 0x00000040,
- InhibitBGOnly = 0x00000080,
- DontAddToRecents = 0x00000100,
- DontSwitch = 0x00000200,
- NoParams = 0x00000800,
- Async = 0x00010000,
- StartClassic = 0x00020000,
- InClassic = 0x00040000,
- NewInstance = 0x00080000,
- AndHide = 0x00100000,
- AndHideOthers = 0x00200000,
- HasUntrustedContents = 0x00400000
- }
-
- static class CoreFoundation
- {
- [DllImport (CFLIB)]
- public static extern bool CFURLGetFSRef (IntPtr urlPtr, IntPtr fsRefPtr);
- }
-
- //this is an 80-byte opaque object
- [StructLayout(LayoutKind.Sequential, Size = 80)]
- struct FSRef
- {
- }
-
- enum OSStatus
- {
- Ok = 0
- }
+ enum LaunchOptions {
+ NSWorkspaceLaunchAndPrint = 0x00000002,
+ NSWorkspaceLaunchWithErrorPresentation = 0x00000040,
+ NSWorkspaceLaunchInhibitingBackgroundOnly = 0x00000080,
+ NSWorkspaceLaunchWithoutAddingToRecents = 0x00000100,
+ NSWorkspaceLaunchWithoutActivation = 0x00000200,
+ NSWorkspaceLaunchAsync = 0x00010000,
+ NSWorkspaceLaunchAllowingClassicStartup = 0x00020000,
+ NSWorkspaceLaunchPreferringClassic = 0x00040000,
+ NSWorkspaceLaunchNewInstance = 0x00080000,
+ NSWorkspaceLaunchAndHide = 0x00100000,
+ NSWorkspaceLaunchAndHideOthers = 0x00200000,
+ NSWorkspaceLaunchDefault = NSWorkspaceLaunchAsync | NSWorkspaceLaunchAllowingClassicStartup
+ };
}
}
diff --git a/main/src/addins/MacPlatform/MacInterop/ProcessManager.cs b/main/src/addins/MacPlatform/MacInterop/ProcessManager.cs
index ac047eeacb..1de2daa783 100644
--- a/main/src/addins/MacPlatform/MacInterop/ProcessManager.cs
+++ b/main/src/addins/MacPlatform/MacInterop/ProcessManager.cs
@@ -27,6 +27,8 @@
using System;
using System.Runtime.InteropServices;
+using AppKit;
+
namespace MonoDevelop.MacInterop
{
public static class ProcessManager
@@ -46,12 +48,27 @@ namespace MonoDevelop.MacInterop
return pid;
return -1;
}
-
+
+ [Obsolete ("Use KillProcess (int pid) instead")]
public static bool KillProcess (ProcessSerialNumber psn)
{
return KillProcess (ref psn) == OSStatus.Ok;
}
-
+
+ public static bool KillProcess (int pid)
+ {
+ NSRunningApplication runningApp = NSRunningApplication.GetRunningApplication (pid);
+ if (runningApp == null)
+ return false;
+
+ return runningApp.Terminate ();
+ }
+
+ public static bool IsRunning (int pid)
+ {
+ return NSRunningApplication.GetRunningApplication (pid) != null;
+ }
+
enum OSStatus
{
Ok = 0
diff --git a/main/src/addins/MacPlatform/MacPlatform.addin.xml b/main/src/addins/MacPlatform/MacPlatform.addin.xml
index bc7dd76041..75534803db 100644
--- a/main/src/addins/MacPlatform/MacPlatform.addin.xml
+++ b/main/src/addins/MacPlatform/MacPlatform.addin.xml
@@ -64,7 +64,6 @@
<Class class="MonoDevelop.MacIntegration.MacAddFileDialogHandler" />
<Class class="MonoDevelop.MacIntegration.MacOpenFileDialogHandler" />
<Class class="MonoDevelop.MacIntegration.MacAlertDialogHandler" />
- <Class class="MonoDevelop.MacIntegration.MacExceptionDialogHandler" />
</Condition>
</Extension>
diff --git a/main/src/addins/MacPlatform/MacPlatform.cs b/main/src/addins/MacPlatform/MacPlatform.cs
index 203f239de5..2deadd3935 100644
--- a/main/src/addins/MacPlatform/MacPlatform.cs
+++ b/main/src/addins/MacPlatform/MacPlatform.cs
@@ -65,11 +65,22 @@ namespace MonoDevelop.MacIntegration
Lazy<Dictionary<string, string>> mimemap;
+ static string applicationMenuName;
+
+ public static string ApplicationMenuName {
+ get {
+ return applicationMenuName ?? BrandingService.ApplicationName;
+ }
+ set {
+ if (applicationMenuName != value) {
+ applicationMenuName = value;
+ OnApplicationMenuNameChanged ();
+ }
+ }
+ }
+
public MacPlatformService ()
{
- if (IntPtr.Size == 8)
- throw new Exception ("Mac integration is not yet 64-bit safe");
-
if (initedGlobal)
throw new Exception ("Only one MacPlatformService instance allowed");
initedGlobal = true;
@@ -183,17 +194,8 @@ namespace MonoDevelop.MacIntegration
mimeTimer.BeginTiming ();
try {
- using (var file = File.OpenRead ("/etc/apache2/mime.types")) {
- using (var reader = new StreamReader (file)) {
- var mime = new Regex ("([a-zA-Z]+/[a-zA-z0-9+-_.]+)\t+([a-zA-Z]+)", RegexOptions.Compiled);
- string line;
- while ((line = reader.ReadLine ()) != null) {
- Match m = mime.Match (line);
- if (m.Success)
- map ["." + m.Groups [2].Captures [0].Value] = m.Groups [1].Captures [0].Value;
- }
- }
- }
+ var loader = new MimeMapLoader (map);
+ loader.LoadMimeMap ("/etc/apache2/mime.types");
} catch (Exception ex){
LoggingService.LogError ("Could not load Apache mime database", ex);
}
@@ -265,9 +267,9 @@ namespace MonoDevelop.MacIntegration
//mac-ify these command names
commandManager.GetCommand (EditCommands.MonodevelopPreferences).Text = GettextCatalog.GetString ("Preferences...");
commandManager.GetCommand (EditCommands.DefaultPolicies).Text = GettextCatalog.GetString ("Custom Policies...");
- commandManager.GetCommand (HelpCommands.About).Text = GettextCatalog.GetString ("About {0}", BrandingService.ApplicationName);
- commandManager.GetCommand (MacIntegrationCommands.HideWindow).Text = GettextCatalog.GetString ("Hide {0}", BrandingService.ApplicationName);
- commandManager.GetCommand (ToolCommands.AddinManager).Text = GettextCatalog.GetString ("Add-in Manager...");
+ commandManager.GetCommand (HelpCommands.About).Text = GetAboutCommandText ();
+ commandManager.GetCommand (MacIntegrationCommands.HideWindow).Text = GetHideWindowCommandText ();
+ commandManager.GetCommand (ToolCommands.AddinManager).Text = GettextCatalog.GetString ("Add-ins...");
initedApp = true;
@@ -281,47 +283,77 @@ namespace MonoDevelop.MacIntegration
}
PatchGtkTheme ();
+ NSNotificationCenter.DefaultCenter.AddObserver (NSCell.ControlTintChangedNotification, notif => Runtime.RunInMainThread (
+ delegate {
+ Styles.LoadStyle();
+ PatchGtkTheme();
+ }));
+
+ // FIXME: Immediate theme switching disabled, until NSAppearance issues are fixed
+ //IdeApp.Preferences.UserInterfaceTheme.Changed += (s,a) => PatchGtkTheme ();
}
- // This will dynamically generate a gtkrc for certain widgets using system control colors.
- void PatchGtkTheme ()
+ static string GetAboutCommandText ()
{
- string color_hex, text_hex;
+ return GettextCatalog.GetString ("About {0}", ApplicationMenuName);
+ }
- if (MonoDevelop.Core.Platform.OSVersion >= MonoDevelop.Core.MacSystemInformation.Yosemite) {
- NSControlTint tint = NSColor.CurrentControlTint;
- NSColor text = NSColor.SelectedMenuItemText.UsingColorSpace (NSColorSpace.GenericRGBColorSpace);
- NSColor color = tint == NSControlTint.Blue ? NSColor.SelectedMenuItem.UsingColorSpace (NSColorSpace.GenericRGBColorSpace) : NSColor.SelectedMenuItem.UsingColorSpace (NSColorSpace.DeviceWhite);
+ static string GetHideWindowCommandText ()
+ {
+ return GettextCatalog.GetString ("Hide {0}", ApplicationMenuName);
+ }
- color_hex = ConvertColorToHex (color);
- text_hex = ConvertColorToHex (text);
- } else {
- color_hex = "#c5d4e0";
- text_hex = "#000";
- }
+ static void OnApplicationMenuNameChanged ()
+ {
+ Command aboutCommand = IdeApp.CommandService.GetCommand (HelpCommands.About);
+ if (aboutCommand != null)
+ aboutCommand.Text = GetAboutCommandText ();
- string gtkrc = String.Format (@"
- style ""treeview"" = ""default"" {{
- GtkTreeView::odd-row-color = ""#f5f5f5""
-
- base[SELECTED] = ""{0}""
- base[ACTIVE] = ""{0}""
- text[SELECTED] = ""{1}""
- text[ACTIVE] = ""{1}""
- engine ""xamarin"" {{
- roundness = 0
- gradient_shades = {{ 1.0, 0.95, 0.95, 0.90 }}
- glazestyle = 1
- }}
- }}
-
- widget_class ""*.<GtkTreeView>*"" style ""treeview""
- ",
- color_hex,
- text_hex
- );
+ Command hideCommand = IdeApp.CommandService.GetCommand (MacIntegrationCommands.HideWindow);
+ if (hideCommand != null)
+ hideCommand.Text = GetHideWindowCommandText ();
+
+ Carbon.SetProcessName (ApplicationMenuName);
+ }
- Gtk.Rc.ParseString (gtkrc);
+ // VV/VK: Disable tint based color generation
+ // This will dynamically generate a gtkrc for certain widgets using system control colors.
+ void PatchGtkTheme ()
+ {
+// string color_hex, text_hex;
+//
+// if (MonoDevelop.Core.Platform.OSVersion >= MonoDevelop.Core.MacSystemInformation.Yosemite) {
+// NSControlTint tint = NSColor.CurrentControlTint;
+// NSColor text = NSColor.SelectedMenuItemText.UsingColorSpace (NSColorSpace.GenericRGBColorSpace);
+// NSColor color = tint == NSControlTint.Blue ? NSColor.SelectedMenuItem.UsingColorSpace (NSColorSpace.GenericRGBColorSpace) : NSColor.SelectedMenuItem.UsingColorSpace (NSColorSpace.DeviceWhite);
+//
+// color_hex = ConvertColorToHex (color);
+// text_hex = ConvertColorToHex (text);
+// } else {
+// color_hex = "#c5d4e0";
+// text_hex = "#000";
+// }
+//
+// string gtkrc = String.Format (@"
+// style ""treeview"" = ""default"" {{
+// base[SELECTED] = ""{0}""
+// base[ACTIVE] = ""{0}""
+// text[SELECTED] = ""{1}""
+// text[ACTIVE] = ""{1}""
+// engine ""xamarin"" {{
+// roundness = 0
+// gradient_shades = {{ 1.01, 1.01, 1.01, 1.01 }}
+// glazestyle = 1
+// }}
+// }}
+//
+// widget_class ""*.<GtkTreeView>*"" style ""treeview""
+// ",
+// color_hex,
+// text_hex
+// );
+//
+// Gtk.Rc.ParseString (gtkrc);
}
void GlobalSetup ()
@@ -406,6 +438,8 @@ namespace MonoDevelop.MacIntegration
//if not running inside an app bundle (at dev time), need to do some additional setup
if (NSBundle.MainBundle.InfoDictionary ["CFBundleIdentifier"] == null) {
SetupWithoutBundle ();
+ } else {
+ SetupDockIcon ();
}
} catch (Exception ex) {
LoggingService.LogError ("Could not install app event handlers", ex);
@@ -413,27 +447,26 @@ namespace MonoDevelop.MacIntegration
}
}
- static void SetupWithoutBundle ()
+ static void SetupDockIcon ()
{
- // set a bundle IDE to prevent NSProgress crash
- // https://bugzilla.xamarin.com/show_bug.cgi?id=8850
- NSBundle.MainBundle.InfoDictionary ["CFBundleIdentifier"] = new NSString ("com.xamarin.monodevelop");
+ NSObject initialBundleIconFileValue;
+
+ // Don't do anything if we're inside an app bundle.
+ if (NSBundle.MainBundle.InfoDictionary.TryGetValue (new NSString ("CFBundleIconFile"), out initialBundleIconFileValue)) {
+ return;
+ }
+ // Setup without bundle.
FilePath exePath = System.Reflection.Assembly.GetExecutingAssembly ().Location;
- string iconFile;
- iconFile = BrandingService.GetString ("ApplicationIcon");
- if (iconFile != null) {
- iconFile = BrandingService.GetFile (iconFile);
+ string iconName = BrandingService.GetString ("ApplicationIcon");
+ string iconFile = null;
+
+ if (iconName != null) {
+ iconFile = BrandingService.GetFile (iconName);
} else {
- var bundleRoot = GetAppBundleRoot (exePath);
- if (bundleRoot.IsNotNull) {
- //running from inside an app bundle, use its icon
- iconFile = bundleRoot.Combine ("Contents", "Resources", "monodevelop.icns");
- } else {
- // assume running from build directory
- var mdSrcMain = exePath.ParentDirectory.ParentDirectory.ParentDirectory;
- iconFile = mdSrcMain.Combine ("theme-icons", "Mac", "monodevelop.icns");
- }
+ // assume running from build directory
+ var mdSrcMain = exePath.ParentDirectory.ParentDirectory.ParentDirectory;
+ iconFile = mdSrcMain.Combine ("theme-icons", "Mac", "monodevelop.icns");
}
if (File.Exists (iconFile)) {
@@ -441,6 +474,15 @@ namespace MonoDevelop.MacIntegration
}
}
+ static void SetupWithoutBundle ()
+ {
+ // set a bundle IDE to prevent NSProgress crash
+ // https://bugzilla.xamarin.com/show_bug.cgi?id=8850
+ NSBundle.MainBundle.InfoDictionary ["CFBundleIdentifier"] = new NSString ("com.xamarin.monodevelop");
+
+ SetupDockIcon ();
+ }
+
static FilePath GetAppBundleRoot (FilePath path)
{
do {
@@ -562,7 +604,7 @@ namespace MonoDevelop.MacIntegration
return res != null ? res.ToXwtImage () : base.OnGetIconForFile (filename);
}
- public override IProcessAsyncOperation StartConsoleProcess (string command, string arguments, string workingDirectory,
+ public override ProcessAsyncOperation StartConsoleProcess (string command, string arguments, string workingDirectory,
IDictionary<string, string> environmentVariables,
string title, bool pauseWhenFinished)
{
@@ -635,11 +677,12 @@ namespace MonoDevelop.MacIntegration
}
}
- public override Gdk.Rectangle GetUsableMonitorGeometry (Gdk.Screen screen, int monitor)
+ public override Xwt.Rectangle GetUsableMonitorGeometry (int screenNumber, int monitorNumber)
{
- Gdk.Rectangle ygeometry = screen.GetMonitorGeometry (monitor);
+ var screen = Gdk.Display.Default.GetScreen (screenNumber);
+ Gdk.Rectangle ygeometry = screen.GetMonitorGeometry (monitorNumber);
Gdk.Rectangle xgeometry = screen.GetMonitorGeometry (0);
- NSScreen nss = NSScreen.Screens[monitor];
+ NSScreen nss = NSScreen.Screens[monitorNumber];
var visible = nss.VisibleFrame;
var frame = nss.Frame;
@@ -671,10 +714,10 @@ namespace MonoDevelop.MacIntegration
width = NMath.Min (visible.Width, frame.Width);
x = NMath.Max (visible.X, frame.X);
- return new Gdk.Rectangle ((int) x, (int) y, (int) width, (int) height);
+ return new Xwt.Rectangle ((int) x, (int) y, (int) width, (int) height);
}
- public override void GrabDesktopFocus (Gtk.Window window)
+ internal override void GrabDesktopFocus (Gtk.Window window)
{
window.Present ();
NSApplication.SharedApplication.ActivateIgnoringOtherApps (true);
@@ -731,6 +774,7 @@ namespace MonoDevelop.MacIntegration
NSWindow w = GtkQuartz.GetWindow (window);
w.IsOpaque = true;
w.StyleMask |= NSWindowStyle.UnifiedTitleAndToolbar;
+ IdeTheme.ApplyTheme (w);
}
internal override void RemoveWindowShadow (Gtk.Window window)
@@ -762,7 +806,7 @@ namespace MonoDevelop.MacIntegration
return new FdoRecentFiles (UserProfile.Current.LocalConfigDir.Combine ("RecentlyUsed.xml"));
}
- public override bool GetIsFullscreen (Gtk.Window window)
+ public override bool GetIsFullscreen (Window window)
{
if (MacSystemInformation.OsVersion < MacSystemInformation.Lion) {
return base.GetIsFullscreen (window);
@@ -772,7 +816,7 @@ namespace MonoDevelop.MacIntegration
return (nswin.StyleMask & NSWindowStyle.FullScreenWindow) != 0;
}
- public override void SetIsFullscreen (Gtk.Window window, bool isFullscreen)
+ public override void SetIsFullscreen (Window window, bool isFullscreen)
{
if (MacSystemInformation.OsVersion < MacSystemInformation.Lion) {
base.SetIsFullscreen (window, isFullscreen);
@@ -788,19 +832,11 @@ namespace MonoDevelop.MacIntegration
{
var toplevels = GtkQuartz.GetToplevels ();
- // When we're looking for modal windows that don't belong to GTK, exclude
- // NSStatusBarWindow (which is visible on Mavericks when we're in fullscreen) and
- // NSToolbarFullscreenWindow (which is visible on Yosemite in fullscreen).
- // _NSFullScreenTileDividerWindow (which is visible on El Capitan when two apps share the same fullscreen).
- return toplevels.Any (t => t.Key.IsVisible && (t.Value == null || t.Value.Modal) &&
- !(t.Key.DebugDescription.StartsWith("<NSStatusBarWindow", StringComparison.Ordinal) ||
- t.Key.DebugDescription.StartsWith ("<NSToolbarFullScreenWindow", StringComparison.Ordinal) ||
- t.Key.DebugDescription.StartsWith ("<NSCarbonMenuWindow", StringComparison.Ordinal) ||
- t.Key.DebugDescription.StartsWith ("<_NSFullScreenTileDividerWindow", StringComparison.Ordinal)
- ));
+ // Check GtkWindow's Modal flag or for a visible NSPanel
+ return toplevels.Any (t => (t.Value != null && t.Value.Modal && t.Value.Visible) || (t.Key.IsVisible && (t.Key is NSPanel)));
}
- public override void AddChildWindow (Gtk.Window parent, Gtk.Window child)
+ internal override void AddChildWindow (Gtk.Window parent, Gtk.Window child)
{
NSWindow w = GtkQuartz.GetWindow (parent);
child.Realize ();
@@ -809,7 +845,7 @@ namespace MonoDevelop.MacIntegration
w.AddChildWindow (overlay, NSWindowOrderingMode.Above);
}
- public override void PlaceWindow (Gtk.Window window, int x, int y, int width, int height)
+ internal override void PlaceWindow (Gtk.Window window, int x, int y, int width, int height)
{
if (window.GdkWindow == null)
return; // Not yet realized
diff --git a/main/src/addins/MacPlatform/MacPlatform.csproj b/main/src/addins/MacPlatform/MacPlatform.csproj
index 0603aa73b6..be4b802c65 100644
--- a/main/src/addins/MacPlatform/MacPlatform.csproj
+++ b/main/src/addins/MacPlatform/MacPlatform.csproj
@@ -119,7 +119,6 @@
<Compile Include="MacExternalConsoleProcess.cs" />
<Compile Include="MacInterop\Carbon.cs" />
<Compile Include="MacInterop\AppleEvents\Native.cs" />
- <Compile Include="Dialogs\MacExceptionDialogHandler.cs" />
<Compile Include="MacMenu\MDLinkMenuItem.cs" />
<Compile Include="MacMenu\MDMenu.cs" />
<Compile Include="MacMenu\MDMenuItem.cs" />
@@ -135,9 +134,13 @@
<Compile Include="MainToolbar\ButtonBar.cs" />
<Compile Include="MainToolbar\SelectorView.cs" />
<Compile Include="MainToolbar\StatusBar.cs" />
- <Compile Include="MainToolbar\CenteringSpace.cs" />
- <Compile Include="MainToolbar\CALayerExtensions.cs" />
<Compile Include="MainToolbar\VerticallyCenteredTextFieldCell.cs" />
+ <Compile Include="MainToolbar\AwesomeBar.cs" />
+ <Compile Include="MainToolbar\ButtonBarContainer.cs" />
+ <Compile Include="MainToolbar\Styles.cs" />
+ <Compile Include="MainToolbar\MultiResImage.cs" />
+ <Compile Include="MimeMapLoader.cs" />
+ <Compile Include="ScreenMonitor.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Makefile.am" />
@@ -156,30 +159,66 @@
<EmbeddedResource Include="icons\build%402x.png">
<LogicalName>build@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\build~dark.png">
+ <LogicalName>build~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\build~dark%402x.png">
+ <LogicalName>build~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\continue.png">
<LogicalName>continue.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\continue%402x.png">
<LogicalName>continue@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\continue~dark.png">
+ <LogicalName>continue~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\continue~dark%402x.png">
+ <LogicalName>continue~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\device.png">
<LogicalName>device.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\device%402x.png">
<LogicalName>device@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\device~dark.png">
+ <LogicalName>device~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\device~dark%402x.png">
+ <LogicalName>device~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\project.png">
<LogicalName>project.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\project%402x.png">
<LogicalName>project@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\project~dark.png">
+ <LogicalName>project~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project~dark%402x.png">
+ <LogicalName>project~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\stop.png">
<LogicalName>stop.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\stop%402x.png">
<LogicalName>stop@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\stop~dark.png">
+ <LogicalName>stop~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\stop~dark%402x.png">
+ <LogicalName>stop~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="maintoolbarbg~dark.png">
+ <LogicalName>maintoolbarbg~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="maintoolbarbg~dark%402x.png">
+ <LogicalName>maintoolbarbg~dark@2x.png</LogicalName>
+ </EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Folder Include="Dialogs\" />
diff --git a/main/src/addins/MacPlatform/MacProxyCredentialProvider.cs b/main/src/addins/MacPlatform/MacProxyCredentialProvider.cs
index 9ccc5d79d7..8b929b78d9 100644
--- a/main/src/addins/MacPlatform/MacProxyCredentialProvider.cs
+++ b/main/src/addins/MacPlatform/MacProxyCredentialProvider.cs
@@ -98,7 +98,7 @@ namespace MonoDevelop.MacIntegration
{
NetworkCredential result = null;
- DispatchService.GuiSyncDispatch (() => {
+ Runtime.RunInMainThread (() => {
using (var ns = new NSAutoreleasePool ()) {
var message = credentialType == CredentialType.ProxyCredentials
@@ -163,7 +163,7 @@ namespace MonoDevelop.MacIntegration
var password = passwordInput.StringValue;
result = new NetworkCredential (username, password);
}
- });
+ }).Wait ();
// store the obtained credentials in the keychain
// but don't store for the root url since it may have other credentials
diff --git a/main/src/addins/MacPlatform/MainToolbar/AwesomeBar.cs b/main/src/addins/MacPlatform/MainToolbar/AwesomeBar.cs
new file mode 100644
index 0000000000..9ccbb431ce
--- /dev/null
+++ b/main/src/addins/MacPlatform/MainToolbar/AwesomeBar.cs
@@ -0,0 +1,188 @@
+//
+// AwesomeBar.cs
+//
+// Author:
+// iain <iain@xamarin.com>
+//
+// Copyright (c) 2015 Copyright © 2015 Xamarin, Inc
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+using AppKit;
+using CoreGraphics;
+using Foundation;
+using MonoDevelop.Core;
+
+using MonoDevelop.Core;
+using MonoDevelop.Ide;
+
+namespace MonoDevelop.MacIntegration.MainToolbar
+{
+ public class AwesomeBar : NSView
+ {
+ internal RunButton RunButton { get; set; }
+ internal SelectorView SelectorView { get; set; }
+ internal StatusBar StatusBar { get; set; }
+ internal SearchBar SearchBar { get; set; }
+ internal ButtonBarContainer ButtonBarContainer { get; private set; }
+
+ public AwesomeBar ()
+ {
+ RunButton = new RunButton ();
+ AddSubview (RunButton);
+
+ SelectorView = new SelectorView ();
+ SelectorView.SizeChanged += (object sender, EventArgs e) => UpdateLayout ();
+ AddSubview (SelectorView);
+
+ ButtonBarContainer = new ButtonBarContainer ();
+ ButtonBarContainer.SizeChanged += (object sender, EventArgs e) => UpdateLayout ();
+ AddSubview (ButtonBarContainer);
+
+ StatusBar = new StatusBar ();
+ AddSubview (StatusBar);
+
+ SearchBar = new SearchBar ();
+ AddSubview (SearchBar);
+
+ Ide.Gui.Styles.Changed += (o, e) => UpdateLayout ();
+ }
+
+ const float toolbarPadding = 8.0f;
+ const float maxSearchBarWidth = 270.0f;
+ const float minSearchBarWidth = 150.0f;
+ const float maxStatusBarWidth = 700.0f;
+ const float minStatusBarWidth = 220.0f;
+ const float runButtonWidth = 38.0f;
+ public static float ToolbarWidgetHeight {
+ get {
+ return MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 24.0f : 22.0f;
+ }
+ }
+
+ NSObject superviewFrameChangeObserver;
+ public override void ViewWillMoveToSuperview (NSView newSuperview)
+ {
+ if (Superview != null && superviewFrameChangeObserver != null) {
+ NSNotificationCenter.DefaultCenter.RemoveObserver (superviewFrameChangeObserver);
+ superviewFrameChangeObserver = null;
+
+ Superview.PostsFrameChangedNotifications = false;
+ }
+
+ base.ViewWillMoveToSuperview (newSuperview);
+ }
+
+ public override void ViewDidMoveToSuperview ()
+ {
+ base.ViewDidMoveToSuperview ();
+
+ if (Superview != null) {
+ Superview.PostsFrameChangedNotifications = true;
+ superviewFrameChangeObserver = NSNotificationCenter.DefaultCenter.AddObserver (NSView.FrameChangedNotification, (note) => {
+ // Centre vertically in superview frame
+ Frame = new CGRect (0, Superview.Frame.Y + (Superview.Frame.Height - ToolbarWidgetHeight) / 2, Superview.Frame.Width, ToolbarWidgetHeight);
+ }, Superview);
+ }
+ }
+
+ void UpdateLayout ()
+ {
+ RunButton.Frame = new CGRect (toolbarPadding, 0, runButtonWidth, ToolbarWidgetHeight);
+ var statusbarWidth = Math.Max (Math.Min (Math.Round ( Frame.Width * 0.3), maxStatusBarWidth), minStatusBarWidth);
+ var searchbarWidth = maxSearchBarWidth;
+ if (statusbarWidth < searchbarWidth) {
+ searchbarWidth = minSearchBarWidth;
+ }
+
+ // We only need to work out the width on the left side of the window because the statusbar is centred
+ // Gap + RunButton.Width + Gap + ButtonBar.Width + Gap + Half of StatusBar.Width
+ var spaceLeft = (Frame.Width / 2) - (toolbarPadding + runButtonWidth + toolbarPadding + ButtonBarContainer.Frame.Width + toolbarPadding + (statusbarWidth / 2));
+
+ StatusBar.Frame = new CGRect (Math.Round((Frame.Width - statusbarWidth) / 2), 0, statusbarWidth - 2, ToolbarWidgetHeight);
+
+ if (IdeApp.Preferences.UserInterfaceSkin == Skin.Dark) {
+ SearchBar.Frame = new CGRect (Frame.Width - searchbarWidth, 0, searchbarWidth, ToolbarWidgetHeight);
+ } else {
+ nfloat elcapYOffset = 0;
+ nfloat elcapHOffset = 0;
+
+ if (MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan) {
+ nfloat scaleFactor = 1;
+
+ if (Window != null && Window.Screen != null) {
+ scaleFactor = Window.Screen.BackingScaleFactor;
+ }
+ elcapYOffset = scaleFactor == 2 ? -0.5f : -1;
+ elcapHOffset = 1.0f;
+ }
+ SearchBar.Frame = new CGRect (Frame.Width - searchbarWidth, 0 + elcapYOffset, searchbarWidth, ToolbarWidgetHeight + elcapHOffset);
+ }
+
+ var selectorSize = SelectorView.SizeThatFits (new CGSize (spaceLeft, ToolbarWidgetHeight));
+
+ SelectorView.Frame = new CGRect (toolbarPadding + runButtonWidth + toolbarPadding, 0, Math.Round (selectorSize.Width), ToolbarWidgetHeight);
+ ButtonBarContainer.SetFrameOrigin (new CGPoint(SelectorView.Frame.GetMaxX () + toolbarPadding, -2));
+
+ // Finally check if the StatusBar overlaps the ButtonBarContainer (and its padding) and adjust is accordingly
+ if (StatusBar.Frame.IntersectsWith (ButtonBarContainer.Frame.Inset (-toolbarPadding, 0))) {
+ StatusBar.SetFrameOrigin (new CGPoint (ButtonBarContainer.Frame.GetMaxX () + toolbarPadding, StatusBar.Frame.Y));
+ }
+ }
+
+ public override void MouseDown (NSEvent theEvent)
+ {
+ base.MouseDown (theEvent);
+
+ var locationInSV = Superview.ConvertPointFromView (theEvent.LocationInWindow, null);
+ if (theEvent.ClickCount == 2 && HitTest (locationInSV) == this) {
+ bool miniaturise = false;
+
+ if (MacSystemInformation.OsVersion < MacSystemInformation.ElCapitan) {
+ miniaturise = NSUserDefaults.StandardUserDefaults.BoolForKey ("AppleMiniaturizeOnDoubleClick");
+ } else {
+ var action = NSUserDefaults.StandardUserDefaults.StringForKey ("AppleActionOnDoubleClick");
+ if (action == "None") {
+ return;
+ } else if (action == "Minimize") {
+ miniaturise = true;
+ }
+ }
+
+ if (miniaturise) {
+ Window.Miniaturize (this);
+ } else {
+ Window.Zoom (this);
+ }
+ }
+ }
+
+ public override CGRect Frame {
+ get {
+ return base.Frame;
+ }
+ set {
+ base.Frame = value;
+ UpdateLayout ();
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/MacPlatform/MainToolbar/ButtonBar.cs b/main/src/addins/MacPlatform/MainToolbar/ButtonBar.cs
index 9b05f2b679..5c9766f166 100644
--- a/main/src/addins/MacPlatform/MainToolbar/ButtonBar.cs
+++ b/main/src/addins/MacPlatform/MainToolbar/ButtonBar.cs
@@ -27,23 +27,67 @@ using System;
using System.Collections.Generic;
using System.Linq;
using AppKit;
+using CoreGraphics;
using Foundation;
using MonoDevelop.Components;
using MonoDevelop.Components.Commands;
+using MonoDevelop.Components.Mac;
using MonoDevelop.Components.MainToolbar;
using MonoDevelop.Core;
using MonoDevelop.Ide;
-namespace MonoDevelop.MacIntegration
+namespace MonoDevelop.MacIntegration.MainToolbar
{
[Register]
class ButtonBar : NSSegmentedControl
{
+ class DarkSkinSegmentedCell : NSSegmentedCell
+ {
+ public override void DrawWithFrame (CGRect cellFrame, NSView inView)
+ {
+ if (IdeApp.Preferences.UserInterfaceSkin == Skin.Dark) {
+ var inset = cellFrame.Inset (0.25f, 0.25f);
+ inset = new CGRect (inset.X, inset.Y + 2, inset.Width, inset.Height - 2);
+
+ var path = NSBezierPath.FromRoundedRect (inset, 3, 3);
+ path.LineWidth = 0.5f;
+ Styles.DarkBorderColor.ToNSColor ().SetStroke ();
+ path.Stroke ();
+
+ inset = new CGRect (inset.X + 3, inset.Y, inset.Width, inset.Height);
+ DrawInteriorWithFrame (inset, inView);
+
+ path = new NSBezierPath ();
+
+ // Draw the separators
+ for (int segment = 1; segment < SegmentCount; segment++) {
+ nfloat x = inset.X + (33 * segment);
+ path.MoveTo (new CGPoint (x, 0));
+ path.LineTo (new CGPoint (x, inset.Y + inset.Height));
+ }
+ path.LineWidth = 0.5f;
+ path.Stroke ();
+ } else {
+ base.DrawWithFrame (cellFrame, inView);
+ }
+ }
+
+ public override void DrawSegment (nint segment, CGRect frame, NSView controlView)
+ {
+ var img = base.GetImageForSegment (segment);
+ var rect = new CGRect (Math.Round (frame.X + ((frame.Width / 2) - (img.Size.Width / 2))), Math.Round (frame.Y + ((frame.Height / 2) - (img.Size.Height / 2))), img.Size.Width, img.Size.Height);
+
+ img.Draw (rect);
+ }
+ }
+
readonly Dictionary<IButtonBarButton, int> indexMap = new Dictionary<IButtonBarButton, int> ();
readonly IReadOnlyList<IButtonBarButton> buttons;
public ButtonBar (IEnumerable<IButtonBarButton> buttons)
{
+ Cell = new DarkSkinSegmentedCell ();
+
this.buttons = buttons.ToList ();
foreach (var button in buttons) {
@@ -51,12 +95,13 @@ namespace MonoDevelop.MacIntegration
button.ImageChanged += (o, e) => {
if (!indexMap.ContainsKey (_button))
return;
- SetImage (ImageService.GetIcon (_button.Image, Gtk.IconSize.Menu).ToNSImage (), indexMap [_button]);
+ LoadIcon (_button);
SetNeedsDisplay ();
};
button.EnabledChanged += (o, e) => {
if (!indexMap.ContainsKey (_button))
return;
+ LoadIcon (_button);
SetEnabled (_button.Enabled, indexMap [_button]);
SetNeedsDisplay ();
};
@@ -74,6 +119,18 @@ namespace MonoDevelop.MacIntegration
Cell.TrackingMode = NSSegmentSwitchTracking.Momentary;
}
+ void LoadIcon (IButtonBarButton button)
+ {
+ if (!indexMap.ContainsKey (button))
+ return;
+ NSImage img;
+ if (button.Enabled)
+ img = ImageService.GetIcon (button.Image, Gtk.IconSize.Menu).ToNSImage ();
+ else
+ img = ImageService.GetIcon (button.Image, Gtk.IconSize.Menu).WithStyles ("disabled").ToNSImage ();
+ SetImage (img, indexMap [button]);
+ }
+
public override nint SegmentCount {
get { return base.SegmentCount; }
set {
@@ -109,17 +166,12 @@ namespace MonoDevelop.MacIntegration
void UpdateButton (IButtonBarButton button, int idx)
{
- var img = ImageService.GetIcon (button.Image, Gtk.IconSize.Menu);
- if (img.ToNSImage () != GetImage (idx)) {
- SetImage (ImageService.GetIcon (button.Image, Gtk.IconSize.Menu).ToNSImage (), idx);
- SetNeedsDisplay ();
- }
- if (button.Enabled != IsEnabled (idx)) {
+ LoadIcon (button);
+ if (button.Enabled != IsEnabled (idx))
SetEnabled (button.Enabled, idx);
- SetNeedsDisplay ();
- }
if (button.Tooltip != Cell.GetToolTip (idx))
Cell.SetToolTip (button.Tooltip, idx);
+ SetNeedsDisplay ();
}
public event EventHandler ResizeRequested;
diff --git a/main/src/addins/MacPlatform/MainToolbar/ButtonBarContainer.cs b/main/src/addins/MacPlatform/MainToolbar/ButtonBarContainer.cs
new file mode 100644
index 0000000000..c26018205f
--- /dev/null
+++ b/main/src/addins/MacPlatform/MainToolbar/ButtonBarContainer.cs
@@ -0,0 +1,105 @@
+//
+// ButtonBarContainer.cs
+//
+// Author:
+// iain holmes <iain@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using AppKit;
+using CoreGraphics;
+using MonoDevelop.Ide;
+
+namespace MonoDevelop.MacIntegration.MainToolbar
+{
+ public class ButtonBarContainer : NSView
+ {
+ internal event EventHandler<EventArgs> SizeChanged;
+
+ List<ButtonBar> buttonBars;
+ internal List<ButtonBar> ButtonBars {
+ get {
+ return buttonBars;
+ }
+
+ set {
+ if (buttonBars != null) {
+ foreach (var bar in buttonBars) {
+ bar.ResizeRequested -= ResizeRequested;
+ bar.RemoveFromSuperview ();
+ }
+ }
+
+ buttonBars = value;
+ foreach (var bar in buttonBars) {
+ bar.ResizeRequested += ResizeRequested;
+ AddSubview (bar);
+ }
+
+ LayoutButtonBars ();
+ }
+ }
+
+ public ButtonBarContainer ()
+ {
+ Ide.Gui.Styles.Changed += (o, e) => LayoutButtonBars ();
+ }
+
+ const float segmentWidth = 33.0f;
+ const float buttonBarSpacing = 8.0f;
+ const float extraPadding = 6.0f;
+
+ void ResizeRequested (object sender, EventArgs e)
+ {
+ LayoutButtonBars ();
+ }
+
+ void LayoutButtonBars ()
+ {
+ nfloat nextX = 0;
+ nfloat y = 0;
+ nfloat height = AwesomeBar.ToolbarWidgetHeight;
+
+ if (IdeApp.Preferences.UserInterfaceSkin == Skin.Dark) {
+ y = 2;
+ height += 2;
+ } else {
+ height += 5;
+ y = -1;
+ }
+
+ foreach (ButtonBar bar in buttonBars) {
+ var frame = new CGRect (nextX, y, extraPadding + (bar.SegmentCount * segmentWidth), height);
+ bar.Frame = frame;
+
+ nextX = frame.GetMaxX () + buttonBarSpacing;
+ }
+
+ SetFrameSize (new CGSize (nextX - buttonBarSpacing, height));
+
+ if (SizeChanged != null) {
+ SizeChanged (this, EventArgs.Empty);
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/MacPlatform/MainToolbar/CALayerExtensions.cs b/main/src/addins/MacPlatform/MainToolbar/CALayerExtensions.cs
deleted file mode 100644
index 2a6544de02..0000000000
--- a/main/src/addins/MacPlatform/MainToolbar/CALayerExtensions.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// CALayerExtensions.cs
-//
-// Author:
-// Marius Ungureanu <marius.ungureanu@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using CoreAnimation;
-using MonoDevelop.Components;
-using CoreGraphics;
-using MonoDevelop.Ide;
-
-namespace MonoDevelop.MacIntegration.MainToolbar
-{
- static class CALayerExtensions
- {
- internal static void SetImage (this CALayer layer, string resource, nfloat scale)
- {
- SetImage (layer, ImageService.GetIcon (resource, Gtk.IconSize.Menu), scale);
- }
-
- internal static void SetImage (this CALayer layer, Xwt.Drawing.Image xwtImage, nfloat scale)
- {
- var image = xwtImage.ToNSImage ();
- layer.ContentsScale = scale;
- var layerContents = image.GetLayerContentsForContentsScale (layer.ContentsScale);
-
- void_objc_msgSend_IntPtr (layer.Handle, setContentsSelector, layerContents.Handle);
- layer.Bounds = new CGRect (0, 0, image.Size.Width, image.Size.Height);
- }
-
- static readonly IntPtr setContentsSelector = ObjCRuntime.Selector.GetHandle ("setContents:");
- const string LIBOBJC_DYLIB = "/usr/lib/libobjc.dylib";
- [System.Runtime.InteropServices.DllImport (LIBOBJC_DYLIB, EntryPoint="objc_msgSend")]
- public extern static void void_objc_msgSend_IntPtr (IntPtr receiver, IntPtr selector, IntPtr arg);
- }
-}
-
diff --git a/main/src/addins/MacPlatform/MainToolbar/CenteringSpace.cs b/main/src/addins/MacPlatform/MainToolbar/CenteringSpace.cs
deleted file mode 100644
index 4684c43565..0000000000
--- a/main/src/addins/MacPlatform/MainToolbar/CenteringSpace.cs
+++ /dev/null
@@ -1,132 +0,0 @@
-//
-// CenteringSpace.cs
-//
-// Author:
-// Marius Ungureanu <marius.ungureanu@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using AppKit;
-using CoreGraphics;
-using Foundation;
-using MonoDevelop.Ide;
-
-namespace MonoDevelop.MacIntegration.MainToolbar
-{
- [Register]
- class CenteringSpaceView : NSView
- {
- internal CenteringSpaceToolbarItem toolbarItem;
- public override bool AcceptsFirstMouse (NSEvent theEvent)
- {
- return false;
- }
-
- public override void ViewDidMoveToWindow ()
- {
- NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidResizeNotification, notif =>
- DispatchService.GuiDispatch (toolbarItem.UpdateWidth));
- NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.WillEnterFullScreenNotification, notif =>
- CenteringSpaceToolbarItem.WindowFullscreening = true);
- NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidEnterFullScreenNotification, notif => {
- CenteringSpaceToolbarItem.WindowFullscreening = false;
- DispatchService.GuiDispatch (toolbarItem.UpdateWidth);
- });
-
- base.ViewDidMoveToWindow ();
- }
- }
-
- [Register]
- class CenteringSpaceToolbarItem : NSToolbarItem
- {
- internal static bool WindowFullscreening;
- public CenteringSpaceToolbarItem ()
- {
- Initialize ();
- }
-
- public CenteringSpaceToolbarItem (IntPtr handle) : base (handle)
- {
- Initialize ();
- }
-
- public CenteringSpaceToolbarItem (string itemIdentifier) : base (itemIdentifier)
- {
- Initialize ();
- }
-
- void Initialize ()
- {
- Label = "";
- View = new CenteringSpaceView {
- toolbarItem = this,
- Frame = new CGRect (0, 0, 1, 1),
- };
- }
-
- public override CGSize MinSize {
- get {
- // Do NOT let this calculate any values while the window is fullscreening.
- // Everything changes, and the size might end up with bogus values and cause a native crash
- // that is totally unrelated. See BXC 29261.
- if (WindowFullscreening)
- return base.MinSize;
-
- NSToolbarItem[] items = Toolbar.Items;
- int index = Array.IndexOf (items, this);
-
- if (index != -1 && View.Superview != null) {
- CGRect frame = View.Superview.Frame;
- if (frame.Left > 0) {
- nfloat space = 0;
- // There is a next item.
- if (items.Length > index + 1) {
- NSView nextItem = items [index + 1].View.Superview;
- if (nextItem != null) {
- CGRect nextFrame = nextItem.Frame;
- CGRect toolbarFrame = nextItem.Superview.Frame;
-
- // nextFrame is in center of the toolbar.
- // so Left + space = toolbarFrame / 2 - nextFrame.Width / 2.
- space = (toolbarFrame.Width - nextFrame.Width) / 2 - frame.Left;
- if (space < 0)
- space = 0;
- }
- }
-
- base.MinSize = new CGSize (space, base.MinSize.Height);
- base.MaxSize = new CGSize (space, base.MaxSize.Height);
- }
- }
- return base.MinSize;
- }
- set { base.MinSize = value; }
- }
-
- internal void UpdateWidth ()
- {
- // Trigger updates.
- MinSize = MinSize;
- }
- }
-}
-
diff --git a/main/src/addins/MacPlatform/MainToolbar/MainToolbar.cs b/main/src/addins/MacPlatform/MainToolbar/MainToolbar.cs
index cd14af52ea..7f568c27cf 100644
--- a/main/src/addins/MacPlatform/MainToolbar/MainToolbar.cs
+++ b/main/src/addins/MacPlatform/MainToolbar/MainToolbar.cs
@@ -33,6 +33,7 @@ using AppKit;
using CoreGraphics;
using Foundation;
using MonoDevelop.Ide;
+using MonoDevelop.MacIntegration;
using Xwt;
namespace MonoDevelop.MacIntegration.MainToolbar
@@ -40,191 +41,35 @@ namespace MonoDevelop.MacIntegration.MainToolbar
class MainToolbar : IMainToolbarView
{
const string MainToolbarId = "XSMainToolbar";
- const string RunButtonId = "RunToolbarItem";
- const string ButtonBarId = "ButtonBarToolbarItem";
- const string SelectorId = "SelectorToolbarItem";
- const string SearchBarId = "SearchBarToolbarItem";
- const string StatusBarId = "StatusBarToolbarItem";
- const string CenteringSpaceId = "CenteringSpaceToolbarItem";
+ const string AwesomeBarId = "AwesomeBarToolbarItem";
internal NSToolbar widget;
internal Gtk.Window gtkWindow;
- int runButtonIdx;
- RunButton runButton {
- get { return (RunButton)widget.Items[runButtonIdx].View; }
- }
+ AwesomeBar awesomeBar;
- int buttonBarStartIdx, buttonBarCount;
-
- CenteringSpaceToolbarItem centeringSpace {
- get { return (CenteringSpaceToolbarItem)widget.Items[buttonBarStartIdx + buttonBarCount]; }
+ RunButton runButton {
+ get { return awesomeBar.RunButton; }
}
- int statusBarIdx;
StatusBar statusBar {
- get { return (StatusBar)widget.Items[statusBarIdx + buttonBarCount].View; }
+ get { return awesomeBar.StatusBar; }
}
- int selectorIdx;
SelectorView selector {
- get { return (SelectorView)widget.Items[selectorIdx].View; }
+ get { return awesomeBar.SelectorView; }
}
SelectorView.PathSelectorView selectorView {
- get { return (SelectorView.PathSelectorView)widget.Items[selectorIdx].View.Subviews [0]; }
+ get { return awesomeBar.SelectorView.RealSelectorView; }
}
- int searchEntryIdx;
SearchBar searchEntry {
- get { return (SearchBar)widget.Items[searchEntryIdx + buttonBarCount].View; }
- }
-
- // TODO: Remove this when XamMac 2.2 goes stable.
- static HashSet<object> viewCache = new HashSet<object> ();
- static HashSet<ButtonBar> buttonBarCache = new HashSet<ButtonBar> ();
-
- NSToolbarItem CreateRunToolbarItem ()
- {
- var button = new RunButton ();
- viewCache.Add (button);
- button.Activated += (o, e) => {
- if (RunButtonClicked != null)
- RunButtonClicked (o, e);
- };
-
- var item = new NSToolbarItem (RunButtonId) {
- View = button,
- MinSize = new CGSize (button.FittingSize.Width + 12, button.FittingSize.Height),
- MaxSize = new CGSize (button.FittingSize.Width + 12, button.FittingSize.Height),
- };
- return item;
- }
-
- OverflowInfoEventArgs FillOverflowInfo (OverflowInfoEventArgs e)
- {
- var visibleItems = widget.VisibleItems;
- var allItems = widget.Items;
-
- e.WindowWidth = gtkWindow.Allocation.Width;
- foreach (var iter in allItems) {
- e.AllItemsWidth += iter.MinSize.Width;
- if (!visibleItems.Contains (iter))
- e.ItemsInOverflowWidth += iter.MinSize.Width;
- }
- // Add spacings.
- nfloat spacing = (allItems.Length - 1) * 16;
- e.AllItemsWidth += spacing;
-
- return e;
- }
-
- bool IsCorrectNotification (NSView view, NSObject notifObject)
- {
- var window = selector.Window;
-
- // Skip updates with a null Window. Only crashes on Mavericks.
- // The View gets updated once again when the window resize finishes.
- // We're getting notified about all windows in the application (for example, NSPopovers) that change size when really we only care about
- // the window the bar is in.
- return window != null && notifObject == window;
- }
-
- NSToolbarItem CreateSelectorToolbarItem ()
- {
- var selector = new SelectorView ();
- viewCache.Add (selector);
- var item = new NSToolbarItem (SelectorId) {
- View = selector,
- MinSize = new CGSize (150, 25),
- MaxSize = new CGSize (150, 25),
- };
- selector.ResizeRequested += (o, e) => {
- item.MinSize = item.MaxSize = e.Size;
- centeringSpace.UpdateWidth ();
- };
- selector.OverflowInfoRequested += (o, e) => {
- FillOverflowInfo (e);
- };
-
- IDisposable resizeTimer = null;
- NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.WillStartLiveResizeNotification, notif => DispatchService.GuiDispatch (() => {
- if (!IsCorrectNotification (selector, notif.Object))
- return;
-
- if (resizeTimer != null)
- resizeTimer.Dispose ();
-
- resizeTimer = Application.TimeoutInvoke (100, () => {
- if (widget.Items.Length != widget.VisibleItems.Length)
- selector.RequestResize ();
- return true;
- });
- }));
-
- NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidResizeNotification, notif => DispatchService.GuiDispatch (() => {
- if (!IsCorrectNotification (selector, notif.Object))
- return;
-
- // Don't check difference in overflow menus. This could cause issues since we're doing resizing of widgets and the views might go in front
- // or behind while we're doing the resize request.
- selector.RequestResize ();
- }));
-
- NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidEndLiveResizeNotification, notif => DispatchService.GuiDispatch (() => {
- if (!IsCorrectNotification (selector, notif.Object))
- return;
-
- if (resizeTimer != null)
- resizeTimer.Dispose ();
-
- resizeTimer = Application.TimeoutInvoke (300, selector.RequestResize);
- }));
-
- var pathSelector = (SelectorView.PathSelectorView)selector.Subviews [0];
- pathSelector.ConfigurationChanged += (sender, e) => {
- if (ConfigurationChanged != null)
- ConfigurationChanged (sender, e);
- };
- pathSelector.RuntimeChanged += (sender, ea) => {
- if (RuntimeChanged != null)
- RuntimeChanged (sender, ea);
- };
- return item;
- }
-
- NSToolbarItem CreateButtonBarToolbarItem ()
- {
- var bar = new ButtonBar (barItems);
- buttonBarCache.Add (bar);
-
- // Note: We're leaving a 1 dead pixel size here because Apple bug
- // on Yosemite. Segmented controls have 3px padding on left and right
- // on Mavericks.
- nfloat size = 6 + 33 * bar.SegmentCount;
-
- // By default, Cocoa doesn't want to duplicate items in the toolbar.
- // Use different Ids to prevent this and not have to subclass.
- var item = new NSToolbarItem (ButtonBarId + buttonBarCount) {
- View = bar,
- MinSize = new CGSize (size, bar.FittingSize.Height),
- MaxSize = new CGSize (size, bar.FittingSize.Height),
- };
- bar.ResizeRequested += (o, e) => {
- nfloat resize = 6 + 33 * bar.SegmentCount;
- item.MinSize = new CGSize (resize, bar.FittingSize.Height);
- item.MaxSize = new CGSize (resize, bar.FittingSize.Height);
- selector.RequestResize ();
- centeringSpace.UpdateWidth ();
- };
- return item;
+ get { return awesomeBar.SearchBar; }
}
void AttachToolbarEvents (SearchBar bar)
{
- if (bar.EventsAttached)
- return;
-
bar.Changed += (o, e) => {
if (SearchEntryChanged != null)
SearchEntryChanged (o, e);
@@ -237,109 +82,79 @@ namespace MonoDevelop.MacIntegration.MainToolbar
if (SearchEntryLostFocus != null)
SearchEntryLostFocus (o, e);
};
- bar.Activated += (o, e) => {
+ bar.SelectionActivated += (o, e) => {
if (SearchEntryActivated != null)
SearchEntryActivated (o, e);
};
- bar.EventsAttached = true;
}
- NSToolbarItem CreateSearchBarToolbarItem ()
+ public MainToolbar (Gtk.Window window)
{
- var bar = new SearchBar ();
+ gtkWindow = window;
+ widget = new NSToolbar (MainToolbarId) {
+ DisplayMode = NSToolbarDisplayMode.Icon,
+ };
+
+ awesomeBar = new AwesomeBar ();
+ awesomeBar.RunButton.Activated += (o, e) => {
+ if (RunButtonClicked != null)
+ RunButtonClicked (o, e);
+ };
// Remove the focus from the Gtk system when Cocoa has focus
// Fixes BXC #29601
- bar.GainedFocus += (o, e) => IdeApp.Workbench.RootWindow.Focus = null;
+ awesomeBar.SearchBar.GainedFocus += (o, e) => IdeApp.Workbench.RootWindow.Focus = null;
- viewCache.Add (bar);
- var item = new NSToolbarItem (SearchBarId) {
- View = bar,
- MinSize = new CGSize (150, bar.FittingSize.Height),
- MaxSize = new CGSize (270, bar.FittingSize.Height),
+ AttachToolbarEvents (awesomeBar.SearchBar);
+
+ selectorView.ConfigurationChanged += (sender, e) => {
+ if (ConfigurationChanged != null)
+ ConfigurationChanged (sender, e);
};
- AttachToolbarEvents (bar);
- return item;
- }
- NSToolbarItem CreateStatusBarToolbarItem ()
- {
- var bar = new StatusBar ();
- viewCache.Add (bar);
- var item = new NSToolbarItem (StatusBarId) {
- View = bar,
- // Place some temporary values in there.
- MinSize = new CGSize (360, 22),
- MaxSize = new CGSize (360, 22),
+ selectorView.RuntimeChanged += (sender, ea) => {
+ if (RuntimeChanged != null)
+ RuntimeChanged (sender, ea);
};
- Action<NSNotification> resizeAction = notif => DispatchService.GuiDispatch (() => {
- // Skip updates with a null Window. Only crashes on Mavericks.
- // The View gets updated once again when the window resize finishes.
- if (bar.Window == null)
- return;
+ widget.WillInsertItem = (tool, id, send) => {
+ switch (id) {
+ case AwesomeBarId:
+ return new NSToolbarItem (AwesomeBarId) {
+ View = awesomeBar,
+ MinSize = new CGSize (1024, AwesomeBar.ToolbarWidgetHeight),
+ MaxSize = new CGSize (1024, AwesomeBar.ToolbarWidgetHeight)
+ };
+
+ default:
+ throw new NotImplementedException ();
+ }
+ };
- // We're getting notified about all windows in the application (for example, NSPopovers) that change size when really we only care about
- // the window the bar is in.
- if (notif.Object != bar.Window)
+ Action<NSNotification> resizeAction = notif => Runtime.RunInMainThread (() => {
+ var win = awesomeBar.Window;
+ if (win == null) {
return;
+ }
- double maxSize = Math.Round (bar.Window.Frame.Width * 0.30f);
- double minSize = Math.Round (bar.Window.Frame.Width * 0.25f);
- item.MinSize = new CGSize ((nfloat)Math.Max (220, minSize), 22);
- item.MaxSize = new CGSize ((nfloat)Math.Min (700, maxSize), 22);
- bar.RepositionStatusLayers ();
- });
+ var item = widget.Items[0];
- NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidResizeNotification, resizeAction);
- NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidEndLiveResizeNotification, resizeAction);
- return item;
- }
+ var abFrameInWindow = awesomeBar.ConvertRectToView (awesomeBar.Frame, null);
+ var awesomebarHeight = AwesomeBar.ToolbarWidgetHeight;
+ var size = new CGSize (win.Frame.Width - abFrameInWindow.X - 4, awesomebarHeight);
- NSToolbarItem CreateCenteringSpaceItem ()
- {
- var item = new CenteringSpaceToolbarItem (CenteringSpaceId);
- viewCache.Add (item.View);
- return item;
- }
+ item.MinSize = size;
+ item.MaxSize = size;
+ });
- public MainToolbar (Gtk.Window window)
- {
- gtkWindow = window;
- widget = new NSToolbar (MainToolbarId) {
- DisplayMode = NSToolbarDisplayMode.Icon,
- };
- widget.WillInsertItem = (tool, id, send) => {
- switch (id) {
- case RunButtonId:
- return CreateRunToolbarItem ();
- case ButtonBarId:
- return CreateButtonBarToolbarItem ();
- case SearchBarId:
- return CreateSearchBarToolbarItem ();
- case SelectorId:
- return CreateSelectorToolbarItem ();
- case StatusBarId:
- return CreateStatusBarToolbarItem ();
- case CenteringSpaceId:
- return CreateCenteringSpaceItem ();
- }
- throw new NotImplementedException ();
- };
+ NSWindow nswin = GtkMacInterop.GetNSWindow (window);
+ NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidResizeNotification, resizeAction, nswin);
+ NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidEndLiveResizeNotification, resizeAction, nswin);
}
internal void Initialize ()
{
- int total = -1;
- widget.InsertItem (RunButtonId, runButtonIdx = ++total);
- widget.InsertItem (SelectorId, selectorIdx = ++total);
- widget.InsertItem (CenteringSpaceId, buttonBarStartIdx = ++total);
- widget.InsertItem (StatusBarId, statusBarIdx = ++total);
- widget.InsertItem (NSToolbar.NSToolbarFlexibleSpaceItemIdentifier, ++total);
- widget.InsertItem (SearchBarId, searchEntryIdx = ++total);
-
- // NSButton -> NSToolbarItemViewer -> _NSToolbarClipView -> NSToolbarView -> NSToolbarClippedItemsIndicator
- viewCache.Add (runButton.Superview.Superview.Superview);
+ widget.InsertItem (AwesomeBarId, 0);
}
#region IMainToolbarView implementation
@@ -358,26 +173,28 @@ namespace MonoDevelop.MacIntegration.MainToolbar
searchEntry.Focus ();
var entry = searchEntry;
- entry.SelectText (entry);
+ if (!string.IsNullOrEmpty (entry.StringValue)) {
+ entry.SelectText (entry);
+ }
}
- List<IButtonBarButton> barItems = new List<IButtonBarButton> ();
public void RebuildToolbar (IEnumerable<IButtonBarButton> buttons)
{
- buttonBarCache.Clear ();
- while (buttonBarCount > 0) {
- widget.RemoveItem (buttonBarStartIdx);
- --buttonBarCount;
- }
+ List<IButtonBarButton> barItems = new List<IButtonBarButton> ();
+ List<ButtonBar> buttonBars = new List<ButtonBar> ();
foreach (var item in buttons) {
if (item.IsSeparator) {
- widget.InsertItem (ButtonBarId, buttonBarStartIdx + buttonBarCount++);
+ var bar = new ButtonBar (barItems);
+ buttonBars.Add (bar);
+
barItems.Clear ();
} else {
barItems.Add (item);
}
}
+
+ awesomeBar.ButtonBarContainer.ButtonBars = buttonBars;
}
public bool RunButtonSensitivity {
@@ -430,8 +247,9 @@ namespace MonoDevelop.MacIntegration.MainToolbar
public bool ButtonBarSensitivity {
set {
- for (int start = buttonBarStartIdx; start < buttonBarStartIdx + buttonBarCount; ++start)
- ((ButtonBar)widget.Items [start].View).Enabled = value;
+ foreach (var bar in awesomeBar.ButtonBarContainer.ButtonBars) {
+ bar.Enabled = value;
+ }
}
}
@@ -442,7 +260,6 @@ namespace MonoDevelop.MacIntegration.MainToolbar
};
foreach (var item in value)
menu.AddItem (new NSMenuItem (item.DisplayString, (o, e) => item.NotifyActivated ()));
-
searchEntry.SearchMenuTemplate = menu;
}
}
@@ -470,9 +287,14 @@ namespace MonoDevelop.MacIntegration.MainToolbar
var entry = searchEntry;
var widget = entry.gtkWidget;
var window = GtkMacInterop.GetGtkWindow (entry.Window);
+
+ // window will be null if the app is fullscreen.
if (window != null) {
widget.GdkWindow = window.GdkWindow;
- widget.Allocation = new Gdk.Rectangle ((int)entry.Superview.Frame.X, (int)entry.Superview.Frame.Y, (int)entry.Superview.Frame.Width, 0);
+
+ // We need to adjust the position of the frame so the popup will line up correctly
+ var abFrameInWindow = awesomeBar.ConvertRectToView (awesomeBar.Frame, null);
+ widget.Allocation = new Gdk.Rectangle ((int)(entry.Frame.X + abFrameInWindow.X - 8), (int)entry.Frame.Y, (int)entry.Frame.Width, 0);
} else {
// Reset the Gtk Widget each time since we can't set the GdkWindow to null.
widget.Dispose ();
@@ -481,15 +303,11 @@ namespace MonoDevelop.MacIntegration.MainToolbar
var nsWindows = NSApplication.SharedApplication.Windows;
var fullscreenToolbarNsWindow = nsWindows.FirstOrDefault (nswin =>
nswin.IsVisible && nswin.Description.StartsWith ("<NSToolbarFullScreenWindow", StringComparison.Ordinal));
- var workbenchNsWindow = nsWindows.FirstOrDefault (nswin =>
- GtkMacInterop.GetGtkWindow (nswin) is MonoDevelop.Ide.Gui.DefaultWorkbench);
-
- // Gtk and Cocoa coordinates are not the same. Offset by left and top screens to get the correct
- // coordinate for the popup window based on Cocoa coordinates which offset left/top from current desktop.
- nfloat xOffset = -NSScreen.Screens.Min (screen => screen.Frame.Left);
- nfloat yOffset = NSScreen.Screens.Max (screen => screen.Frame.Bottom);
- widget.Allocation = new Gdk.Rectangle (0, (int)(yOffset - workbenchNsWindow.Frame.Height),
- (int)(xOffset + fullscreenToolbarNsWindow.Frame.Width), 0);
+
+ CGPoint gdkOrigin = ScreenMonitor.GdkPointForNSScreen (searchEntry.Window.Screen);
+
+ widget.Allocation = new Gdk.Rectangle (0, (int)(gdkOrigin.Y + fullscreenToolbarNsWindow.Frame.Height - 20),
+ (int)(gdkOrigin.X + fullscreenToolbarNsWindow.Frame.Width - 16), 0);
}
return widget;
}
@@ -497,7 +315,9 @@ namespace MonoDevelop.MacIntegration.MainToolbar
public string SearchPlaceholderMessage {
// Analysis disable once ValueParameterNotUsed
- set { }
+ set {
+ searchEntry.PlaceholderText = value;
+ }
}
public MonoDevelop.Ide.StatusBar StatusBar {
diff --git a/main/src/addins/MacPlatform/MainToolbar/MultiResImage.cs b/main/src/addins/MacPlatform/MainToolbar/MultiResImage.cs
new file mode 100644
index 0000000000..d4221451f7
--- /dev/null
+++ b/main/src/addins/MacPlatform/MainToolbar/MultiResImage.cs
@@ -0,0 +1,103 @@
+//
+// MultiResImage.cs
+//
+// Author:
+// iain holmes <iain@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin, Inc
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Reflection;
+using AppKit;
+using Foundation;
+
+using MonoDevelop.Ide;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.MacIntegration.MainToolbar
+{
+ public static class MultiResImage
+ {
+ public static NSImage CreateMultiResImage (string filename, string style)
+ {
+ var image = new NSImage ();
+
+ var image1x = NSImageFromResource (MakeResName (filename, style));
+ var image2x = NSImageFromResource (MakeResName (filename, style, true));
+
+ if (image1x != null) {
+ image.AddRepresentations (image1x.Representations ());
+ }
+
+ if (image2x != null) {
+ image.AddRepresentations (image2x.Representations ());
+ }
+
+ image.Size = new CoreGraphics.CGSize (0, 0);
+ return image;
+ }
+
+ static string MakeResName (string filename, string style, bool retina = false)
+ {
+ bool dark = IdeApp.Preferences.UserInterfaceSkin == Skin.Dark;
+
+ if (!string.IsNullOrEmpty (style)) {
+ style = "~" + style;
+ }
+
+ string resname = string.Format ("{0}{1}{2}{3}.png", filename, dark ? "~dark" : "", style, retina ? "@2x" : "");
+ if (Assembly.GetCallingAssembly ().GetManifestResourceInfo (resname) != null) {
+ return resname;
+ }
+
+ resname = string.Format ("{0}{1}{2}.png", filename, dark ? "~dark" : "", retina ? "@2x" : "");
+ if (Assembly.GetCallingAssembly ().GetManifestResourceInfo (resname) != null) {
+ return resname;
+ }
+
+ resname = string.Format ("{0}{1}.png", filename, retina ? "@2x" : "");
+ if (Assembly.GetCallingAssembly ().GetManifestResourceInfo (resname) != null) {
+ return resname;
+ }
+
+ // If all those failed, try again, but without retina
+ if (retina) {
+ LoggingService.LogWarning ("{0} {1} missing @2x", filename, style);
+ return MakeResName (filename, style);
+ }
+
+ return null;
+ }
+
+ static NSImage NSImageFromResource (string res)
+ {
+ if (string.IsNullOrEmpty (res)) {
+ return null;
+ }
+
+ var stream = Assembly.GetCallingAssembly ().GetManifestResourceStream (res);
+ using (stream)
+ using (NSData data = NSData.FromStream (stream)) {
+ return new NSImage (data);
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/MacPlatform/MainToolbar/RunButton.cs b/main/src/addins/MacPlatform/MainToolbar/RunButton.cs
index 262387e9af..c3b404922a 100644
--- a/main/src/addins/MacPlatform/MainToolbar/RunButton.cs
+++ b/main/src/addins/MacPlatform/MainToolbar/RunButton.cs
@@ -26,37 +26,76 @@
using System;
using AppKit;
using Foundation;
+using CoreGraphics;
using MonoDevelop.Components.MainToolbar;
using MonoDevelop.Ide;
using MonoDevelop.Components;
+using Xwt.Mac;
+using CoreImage;
namespace MonoDevelop.MacIntegration.MainToolbar
{
[Register]
class RunButton : NSButton
{
+ NSImage stopIcon, continueIcon, buildIcon;
+
+
public RunButton ()
{
+ UpdateIcons ();
+
+ Ide.Gui.Styles.Changed += (o, e) => UpdateCell ();
+
+ Cell = new ColoredButtonCell ();
+
icon = OperationIcon.Run;
- Image = GetIcon ();
ImagePosition = NSCellImagePosition.ImageOnly;
BezelStyle = NSBezelStyle.TexturedRounded;
+
Enabled = false;
}
+ void UpdateIcons (object sender = null, EventArgs e = null)
+ {
+ stopIcon = MultiResImage.CreateMultiResImage ("stop", "");
+ continueIcon = MultiResImage.CreateMultiResImage ("continue", "");
+ buildIcon = MultiResImage.CreateMultiResImage ("build", "");
+
+ // We can use Template images supported by NSButton, thus no reloading
+ // on theme/skin change is required.
+ stopIcon.Template = continueIcon.Template = buildIcon.Template = true;
+ }
+
+ void UpdateCell ()
+ {
+ Appearance = NSAppearance.GetAppearance (IdeApp.Preferences.UserInterfaceSkin == Skin.Dark ? NSAppearance.NameVibrantDark : NSAppearance.NameAqua);
+ NeedsDisplay = true;
+ }
+
NSImage GetIcon ()
{
switch (icon) {
case OperationIcon.Stop:
- return ImageService.GetIcon ("stop").ToNSImage ();
+ return stopIcon;
case OperationIcon.Run:
- return ImageService.GetIcon ("continue").ToNSImage ();
+ return continueIcon;
case OperationIcon.Build:
- return ImageService.GetIcon ("build").ToNSImage ();
+ return buildIcon;
}
throw new InvalidOperationException ();
}
+ public override bool Enabled {
+ get {
+ return base.Enabled;
+ }
+ set {
+ base.Enabled = value;
+ Image = GetIcon ();
+ }
+ }
+
OperationIcon icon;
public OperationIcon Icon {
get { return icon; }
@@ -67,6 +106,46 @@ namespace MonoDevelop.MacIntegration.MainToolbar
Image = GetIcon ();
}
}
+
+ public override CGSize IntrinsicContentSize {
+ get {
+ return new CGSize (38, 25);
+ }
+ }
+ }
+
+ class ColoredButtonCell : NSButtonCell
+ {
+ public override void DrawBezelWithFrame (CGRect frame, NSView controlView)
+ {
+ if (IdeApp.Preferences.UserInterfaceSkin == Skin.Dark) {
+ var inset = frame.Inset (0.25f, 0.25f);
+
+ var path = NSBezierPath.FromRoundedRect (inset, 3, 3);
+ path.LineWidth = 0.5f;
+
+ // The first time the view is drawn it has a filter of some sort attached so that the colours set here
+ // are made lighter onscreen.
+ // NSColor.FromRgba (0.244f, 0.247f, 0.245f, 1).SetStroke ();
+ // would make the initial colour actually be .56,.56,.56
+ //
+ // However after switching theme this filter is removed and the colour set here is the actual colour
+ // displayed onscreen.
+ Styles.DarkBorderBrokenColor.ToNSColor ().SetStroke ();
+ path.Stroke ();
+ } else {
+ if (controlView.Window?.Screen?.BackingScaleFactor == 2) {
+ frame = new CGRect (frame.X, frame.Y + 0.5f, frame.Width, frame.Height);
+ }
+ base.DrawBezelWithFrame (frame, controlView);
+ }
+ }
+
+ public override void DrawInteriorWithFrame (CGRect cellFrame, NSView inView)
+ {
+ cellFrame = new CGRect (cellFrame.X, cellFrame.Y + 0.5f, cellFrame.Width, cellFrame.Height);
+ base.DrawInteriorWithFrame (cellFrame, inView);
+ }
}
}
diff --git a/main/src/addins/MacPlatform/MainToolbar/SearchBar.cs b/main/src/addins/MacPlatform/MainToolbar/SearchBar.cs
index 9e3f902190..00f7149c79 100644
--- a/main/src/addins/MacPlatform/MainToolbar/SearchBar.cs
+++ b/main/src/addins/MacPlatform/MainToolbar/SearchBar.cs
@@ -26,8 +26,10 @@
using System;
using AppKit;
using Foundation;
+using CoreGraphics;
using Gtk;
-using MonoDevelop.Components.Mac;
+using MonoDevelop.Core;
+
using MonoDevelop.Ide;
using Xwt.Mac;
@@ -36,39 +38,184 @@ namespace MonoDevelop.MacIntegration.MainToolbar
[Register]
class SearchBar : NSSearchField
{
+ bool debugSearchbar;
internal Widget gtkWidget;
internal event EventHandler<Xwt.KeyEventArgs> KeyPressed;
internal event EventHandler LostFocus;
- new internal event EventHandler Activated;
+ internal event EventHandler SelectionActivated;
public event EventHandler GainedFocus;
- /// <summary>
- /// This tells whether events have been attached when created from the menu.
- /// </summary>
- internal bool EventsAttached;
+ // To only draw the border, NSSearchFieldCell needs to be subclassed. Unfortunately this stops the
+ // animation on activation working. I suspect this is implemented inside the NSSearchField rather
+ // than the NSSearchFieldCell which can't do animation.
+ class DarkSkinSearchFieldCell : NSSearchFieldCell
+ {
+ public override void DrawWithFrame (CGRect cellFrame, NSView inView)
+ {
+ if (IdeApp.Preferences.UserInterfaceSkin == Skin.Dark) {
+ var inset = cellFrame.Inset (0.25f, 0.25f);
+ if (!ShowsFirstResponder) {
+ var path = NSBezierPath.FromRoundedRect (inset, 3, 3);
+ path.LineWidth = 0.5f;
+
+ Styles.DarkBorderColor.ToNSColor ().SetStroke ();
+ path.Stroke ();
+ }
+
+ // Can't just call base.DrawInteriorWithFrame because it draws the placeholder text
+ // with a strange emboss effect when it the view is not first responder.
+ // Again, probably because the NSSearchField handles the not first responder state itself
+ // rather than using NSSearchFieldCell
+ //base.DrawInteriorWithFrame (inset, inView);
+
+ // So instead, draw the various extra cells and text in the correct places
+ SearchButtonCell.DrawWithFrame (SearchButtonRectForBounds (inset), inView);
+
+ if (!ShowsFirstResponder) {
+ PlaceholderAttributedString.DrawInRect (SearchTextRectForBounds (inset));
+ }
+
+ if (!string.IsNullOrEmpty (StringValue)) {
+ CancelButtonCell.DrawWithFrame (CancelButtonRectForBounds (inset), inView);
+ }
+ } else {
+ if (inView.Window?.Screen?.BackingScaleFactor == 2) {
+ nfloat yOffset = 0f;
+ nfloat hOffset = 0f;
+
+ if (MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan) {
+ if (inView.Window.IsKeyWindow) {
+ yOffset = 0.5f;
+ hOffset = -0.5f;
+ } else {
+ yOffset = 0f;
+ hOffset = 1.0f;
+ }
+ } else {
+ yOffset = 1f;
+ hOffset = -1f;
+ }
+ cellFrame = new CGRect (cellFrame.X, cellFrame.Y + yOffset, cellFrame.Width, cellFrame.Height + hOffset);
+ } else {
+ nfloat yOffset = 0f;
+ nfloat hOffset = 0f;
+
+ cellFrame = new CGRect (cellFrame.X, cellFrame.Y + yOffset, cellFrame.Width, cellFrame.Height + hOffset);
+ }
+ base.DrawWithFrame (cellFrame, inView);
+ }
+ }
+
+ // This is the rect for the placeholder text, not the text field entry
+ public override CGRect SearchTextRectForBounds (CGRect rect)
+ {
+ if (ShowsFirstResponder) {
+ rect = new CGRect (rect.X + 26, 0, rect.Width - 52, 22);
+ } else {
+ nfloat y = MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 4 : 3;
+ rect = new CGRect (rect.X + 28, y, rect.Width - 56, 22);
+ }
+
+ return rect;
+ }
+
+ // The rect for the search icon
+ public override CGRect SearchButtonRectForBounds (CGRect rect)
+ {
+ rect = new CGRect (0, 0, 26, rect.Height);
+ return rect;
+ }
+
+ // The rect for the cancel button
+ public override CGRect CancelButtonRectForBounds (CGRect rect)
+ {
+ rect = new CGRect (rect.X + rect.Width - 26.0, 0, 26, rect.Height);
+
+ return rect;
+ }
+
+ // When customising the NSCell these are the methods which determine
+ // where the editing and selecting text appears
+ public override void EditWithFrame (CGRect aRect, NSView inView, NSText editor, NSObject delegateObject, NSEvent theEvent)
+ {
+ aRect = new CGRect (aRect.X, aRect.Y + 10, aRect.Width - 66, aRect.Height);
+ base.EditWithFrame (aRect, inView, editor, delegateObject, theEvent);
+ }
+
+ public override void SelectWithFrame (CGRect aRect, NSView inView, NSText editor, NSObject delegateObject, nint selStart, nint selLength)
+ {
+ nfloat xOffset = 0;
+ if (IdeApp.Preferences.UserInterfaceSkin == Skin.Dark) {
+ xOffset = -1.5f;
+ }
+ // y does not appear to affect anything. Whatever value is set here for y will always be 1px below the
+ // placeholder text
+ aRect = new CGRect (aRect.X + xOffset, aRect.Y, aRect.Width, aRect.Height);
+ base.SelectWithFrame (aRect, inView, editor, delegateObject, selStart, selLength);
+ }
+ }
+
+ static string FirstResponderPlaceholder {
+ get {
+ return GettextCatalog.GetString ("Search");
+ }
+ }
+
+ string placeholderText;
+ public string PlaceholderText {
+ get {
+ return placeholderText ?? FirstResponderPlaceholder;
+ }
+ set {
+ placeholderText = value ?? FirstResponderPlaceholder;
+ PlaceholderAttributedString = MakePlaceholderString (placeholderText);
+ }
+ }
public SearchBar ()
{
- Cell.Scrollable = true;
+ Cell = new DarkSkinSearchFieldCell ();
+
Initialize ();
+ var debugFilePath = System.IO.Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), ".xs-searchbar-debug");
+ debugSearchbar = System.IO.File.Exists (debugFilePath);
+
+ Ide.Gui.Styles.Changed += (o, e) => UpdateLayout ();
+ UpdateLayout ();
}
- public SearchBar (IntPtr ptr) : base (ptr)
+ NSAttributedString MakePlaceholderString (string t)
{
- Initialize ();
+ return new NSAttributedString (t, foregroundColor: NSColor.FromRgba (0.63f, 0.63f, 0.63f, 1.0f));
+ }
+
+ void UpdateLayout ()
+ {
+ Bezeled = true;
+ BezelStyle = NSTextFieldBezelStyle.Rounded;
+ Editable = true;
+ Cell.Scrollable = true;
+ Selectable = true;
+
+ PlaceholderAttributedString = MakePlaceholderString (PlaceholderText);
}
void Initialize ()
{
- NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidResignKeyNotification, notification => DispatchService.GuiDispatch (() => {
- if (notification.Object == Window)
+ NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidResignKeyNotification, notification => Runtime.RunInMainThread (() => {
+ var other = (NSWindow)notification.Object;
+
+ if (notification.Object == Window) {
if (LostFocus != null)
LostFocus (this, null);
+ }
}));
- NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidResizeNotification, notification => DispatchService.GuiDispatch (() => {
- if (notification.Object == Window)
+ NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidResizeNotification, notification => Runtime.RunInMainThread (() => {
+ var other = (NSWindow)notification.Object;
+ if (notification.Object == Window) {
if (LostFocus != null)
LostFocus (this, null);
+ }
}));
}
@@ -82,13 +229,24 @@ namespace MonoDevelop.MacIntegration.MainToolbar
public override bool PerformKeyEquivalent (NSEvent theEvent)
{
- return SendKeyPressed (theEvent.ToXwtKeyEventArgs ()) || base.PerformKeyEquivalent (theEvent);
+ var popupHandled = SendKeyPressed (theEvent.ToXwtKeyEventArgs ());
+ if (popupHandled)
+ return true;
+ return base.PerformKeyEquivalent (theEvent);;
}
+ bool ignoreEndEditing = false;
public override void DidEndEditing (NSNotification notification)
{
base.DidEndEditing (notification);
+ if (ignoreEndEditing) {
+ ignoreEndEditing = false;
+ return;
+ }
+
+ PlaceholderAttributedString = MakePlaceholderString (PlaceholderText);
+
nint value = ((NSNumber)notification.UserInfo.ValueForKey ((NSString)"NSTextMovement")).LongValue;
if (value == (nint)(long)NSTextMovement.Tab) {
SelectText (this);
@@ -96,15 +254,16 @@ namespace MonoDevelop.MacIntegration.MainToolbar
}
if (value == (nint)(long)NSTextMovement.Return) {
- if (Activated != null)
- Activated (this, null);
+ if (SelectionActivated != null)
+ SelectionActivated (this, null);
return;
}
// This means we've reached a focus loss event.
var replacedWith = notification.UserInfo.ValueForKey ((NSString)"_NSFirstResponderReplacingFieldEditor");
- if (replacedWith != this && LostFocus != null)
+ if (replacedWith != this && LostFocus != null) {
LostFocus (this, null);
+ }
}
public override void ViewDidMoveToWindow ()
@@ -112,22 +271,26 @@ namespace MonoDevelop.MacIntegration.MainToolbar
base.ViewDidMoveToWindow ();
// Needs to be grabbed after it's parented.
- gtkWidget = GtkMacInterop.NSViewToGtkWidget (this);
+ gtkWidget = Components.Mac.GtkMacInterop.NSViewToGtkWidget (this);
}
public override bool BecomeFirstResponder ()
{
bool firstResponder = base.BecomeFirstResponder ();
- if (firstResponder)
- Focus ();
+ if (firstResponder) {
+ ignoreEndEditing = true;
+ PlaceholderAttributedString = MakePlaceholderString (FirstResponderPlaceholder);
+ ignoreEndEditing = false;
+
+ GainedFocus?.Invoke (this, EventArgs.Empty);
+ }
return firstResponder;
}
public void Focus ()
{
- if (GainedFocus != null)
- GainedFocus (this, EventArgs.Empty);
+ Window.MakeFirstResponder (this);
}
}
}
diff --git a/main/src/addins/MacPlatform/MainToolbar/SelectorView.cs b/main/src/addins/MacPlatform/MainToolbar/SelectorView.cs
index 21b7f938d0..318b849118 100644
--- a/main/src/addins/MacPlatform/MainToolbar/SelectorView.cs
+++ b/main/src/addins/MacPlatform/MainToolbar/SelectorView.cs
@@ -30,6 +30,7 @@ using AppKit;
using CoreGraphics;
using Foundation;
using MonoDevelop.Components;
+using MonoDevelop.Components.Mac;
using MonoDevelop.Components.MainToolbar;
using MonoDevelop.Core;
using MonoDevelop.Ide;
@@ -55,47 +56,64 @@ namespace MonoDevelop.MacIntegration.MainToolbar
[Register]
class SelectorView : NSButton
{
- public event EventHandler<SizeRequestedEventArgs> ResizeRequested;
- public event EventHandler<OverflowInfoEventArgs> OverflowInfoRequested;
+ public event EventHandler<EventArgs> SizeChanged;
internal const int ConfigurationIdx = 0;
internal const int RuntimeIdx = 1;
+ internal PathSelectorView RealSelectorView { get; private set; }
+
public SelectorView ()
{
- Title = "";
+ Cell = new ColoredButtonCell ();
BezelStyle = NSBezelStyle.TexturedRounded;
- var pathSelectorView = new PathSelectorView (new CGRect (6, 0, 1, 1));
- pathSelectorView.UnregisterDraggedTypes ();
- AddSubview (pathSelectorView);
+ Title = "";
+
+ RealSelectorView = new PathSelectorView (new CGRect (6, 0, 1, 1));
+ RealSelectorView.UnregisterDraggedTypes ();
+ AddSubview (RealSelectorView);
}
- public bool RequestResize ()
+ public override CGSize SizeThatFits (CGSize size)
{
- var p = (PathSelectorView)Subviews [0];
- var overflowInfo = new OverflowInfoEventArgs ();
- if (OverflowInfoRequested != null)
- OverflowInfoRequested (this, overflowInfo);
+ var fitSize = RealSelectorView.SizeThatFits (size);
- var size = new CGSize (p.ResizeIfNeeded (overflowInfo), Frame.Height);
+ return new CGSize (Math.Round (fitSize.Width) + 12.0, size.Height);
+ }
- if (size != Frame.Size) {
- if (ResizeRequested != null)
- ResizeRequested (this, new SizeRequestedEventArgs (size));
+ public override void SetFrameSize (CGSize newSize)
+ {
+ base.SetFrameSize (newSize);
+ RealSelectorView.SetFrameSize (newSize);
+ }
- SetFrameSize (size);
- p.SetFrameSize (size);
+ public override void ViewDidMoveToWindow ()
+ {
+ base.ViewDidMoveToWindow ();
+ UpdateLayout ();
+ }
- SetNeedsDisplay ();
- p.SetNeedsDisplay ();
- return true;
+ void UpdateLayout ()
+ {
+ // Correct the offset position for the screen
+ nfloat yOffset = 1f;
+ if (Window?.Screen?.BackingScaleFactor == 2) {
+ yOffset = 0.5f;
}
- return false;
+
+ RealSelectorView.Frame = new CGRect (RealSelectorView.Frame.X, yOffset, RealSelectorView.Frame.Width, RealSelectorView.Frame.Height);
}
- public override void ViewWillDraw ()
+ public override void DidChangeBackingProperties ()
{
- RequestResize ();
- base.ViewWillDraw ();
+ base.DidChangeBackingProperties ();
+ UpdateLayout ();
+ }
+
+ internal void OnSizeChanged ()
+ {
+ if (SizeChanged != null) {
+ SizeChanged (this, EventArgs.Empty);
+ }
}
#region PathSelectorView
@@ -115,57 +133,73 @@ namespace MonoDevelop.MacIntegration.MainToolbar
static readonly string RuntimePlaceholder = GettextCatalog.GetString ("Default");
CellState state = CellState.AllShown;
- nfloat UpdatePathCellForSize (int idx, nfloat remaining, CellState newStateIfEnoughSize)
+ public override CGSize SizeThatFits (CGSize size)
{
- var cell = PathComponentCells [idx];
- string text;
- if (idx == ConfigurationIdx) {
- if (ActiveConfiguration != null)
- text = ActiveConfiguration.DisplayString;
- else
- text = ConfigurationPlaceholder;
- } else {
- if (ActiveRuntime != null) {
- using (var mutableModel = ActiveRuntime.GetMutableModel ())
- text = mutableModel.FullDisplayString;
- } else
- text = RuntimePlaceholder;
+ nfloat rtWidth, cWidth;
+
+ WidthsForPathCells (out cWidth, out rtWidth);
+
+ if (10 + cWidth + rtWidth < size.Width) {
+ state = CellState.AllShown;
+ UpdatePathText (ConfigurationIdx, TextForActiveConfiguration);
+ UpdatePathText (RuntimeIdx, TextForRuntimeConfiguration);
+ return new CGSize (10 + cWidth + rtWidth, size.Height);
}
- var size = new NSAttributedString (text, new NSStringAttributes { Font = cell.Font }).Size.Width + 20;
- if (size < remaining) {
- state |= newStateIfEnoughSize;
- UpdatePathText (idx, text);
+
+ if (10 + 28 + cWidth < size.Width) {
+ state = CellState.ConfigurationShown;
+ UpdatePathText (ConfigurationIdx, TextForActiveConfiguration);
+ UpdatePathText (RuntimeIdx, string.Empty);
+ return new CGSize (10 + 28 + cWidth, size.Height);
}
- return remaining - size;
+
+ state = CellState.AllHidden;
+ UpdatePathText (ConfigurationIdx, string.Empty);
+ UpdatePathText (RuntimeIdx, string.Empty);
+ return new CGSize (10 + 52.0, size.Height);
}
- internal nfloat ResizeIfNeeded (OverflowInfoEventArgs args)
+ string EllipsizeString (string s)
{
- var remaining = args.WindowWidth - args.AllItemsWidth;
- if (remaining < 0 || args.ItemsInOverflowWidth > 0) {
- var cell = PathComponentCells [RuntimeIdx];
- var size = new NSAttributedString (cell.Title, new NSStringAttributes { Font = cell.Font }).Size.Width;
- remaining += size;
- args.ItemsInOverflowWidth -= size;
- if ((state & CellState.RuntimeShown) != 0) {
- state &= ~CellState.RuntimeShown;
- UpdatePathText (RuntimeIdx, string.Empty);
- }
- if ((remaining < 0 || args.ItemsInOverflowWidth > 0) && (state & CellState.ConfigurationShown) != 0) {
- state &= ~CellState.ConfigurationShown;
- UpdatePathText (ConfigurationIdx, string.Empty);
- }
+ if (s.Length > 50) {
+ var start = s.Substring (0, 20);
+ var end = s.Substring (s.Length - 20, 20);
+
+ return start + "…" + end;
} else {
- remaining = remaining - args.ItemsInOverflowWidth;
- if ((state & CellState.ConfigurationShown) == 0)
- remaining = UpdatePathCellForSize (ConfigurationIdx, remaining, CellState.ConfigurationShown);
- if ((state & CellState.RuntimeShown) == 0)
- UpdatePathCellForSize (RuntimeIdx, remaining, CellState.RuntimeShown);
+ return s;
}
+ }
- return 10 +
- PathComponentCells [ConfigurationIdx].CellSize.Width +
- PathComponentCells [RuntimeIdx].CellSize.Width + Frame.Left;
+ string TextForActiveConfiguration {
+ get {
+ return EllipsizeString (ActiveConfiguration != null ? ActiveConfiguration.DisplayString : ConfigurationPlaceholder);
+ }
+ }
+
+ string TextForRuntimeConfiguration {
+ get {
+ if (ActiveRuntime != null) {
+ using (var mutableModel = ActiveRuntime.GetMutableModel ())
+ return EllipsizeString (mutableModel.FullDisplayString);
+ } else {
+ return EllipsizeString (RuntimePlaceholder);
+ }
+ }
+ }
+
+ void WidthsForPathCells (out nfloat configWidth, out nfloat runtimeWidth)
+ {
+ string text;
+ NSPathComponentCell cell;
+
+ text = TextForActiveConfiguration;
+ cell = PathComponentCells [ConfigurationIdx];
+ configWidth = new NSAttributedString (text, new NSStringAttributes { Font = cell.Font }).Size.Width + 28;
+
+ text = TextForRuntimeConfiguration;
+ cell = PathComponentCells [RuntimeIdx];
+ runtimeWidth = new NSAttributedString (text, new NSStringAttributes { Font = cell.Font }).Size.Width + 28;
}
NSMenu CreateSubMenuForRuntime (IRuntimeModel runtime)
@@ -183,7 +217,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
return menu;
}
- void CreateMenuItem (NSMenu menu, IRuntimeModel runtime)
+ NSMenuItem CreateMenuItem (NSMenu menu, IRuntimeModel runtime)
{
NSMenuItem menuItem;
string runtimeFullDisplayString;
@@ -231,95 +265,149 @@ namespace MonoDevelop.MacIntegration.MainToolbar
};
}
menu.AddItem (menuItem);
+ return menuItem;
}
-
public PathSelectorView (CGRect frameRect) : base (frameRect)
{
PathComponentCells = new [] {
new NSPathComponentCell {
- Image = ImageService.GetIcon ("project").ToNSImage (),
- Title = ConfigurationPlaceholder,
+ Image = MultiResImage.CreateMultiResImage ("project", "disabled"),
+ Title = TextForActiveConfiguration,
Enabled = false,
- TextColor = NSColor.FromRgba (0.34f, 0.34f, 0.34f, 1),
},
new NSPathComponentCell {
- Image = ImageService.GetIcon ("device").ToNSImage (),
- Title = RuntimePlaceholder,
+ Image = MultiResImage.CreateMultiResImage ("device", "disabled"),
+ Title = TextForRuntimeConfiguration,
Enabled = false,
- TextColor = NSColor.FromRgba (0.34f, 0.34f, 0.34f, 1),
}
};
+ UpdateStyle ();
BackgroundColor = NSColor.Clear;
FocusRingType = NSFocusRingType.None;
- Activated += (sender, e) => {
- var item = ClickedPathComponentCell;
- if (item == null)
+
+ Ide.Gui.Styles.Changed += UpdateStyle;
+ }
+
+ int IndexOfCellAtX (nfloat x)
+ {
+ nfloat rWidth, cWidth;
+ WidthsForPathCells (out cWidth, out rWidth);
+
+ if (x >= 0 && x <= cWidth) {
+ return ConfigurationIdx;
+ } else if (x > cWidth && x <= cWidth + 10) {
+ // The > in the middle
+ return -1;
+ } else {
+ return RuntimeIdx;
+ }
+ }
+
+ public override void MouseDown (NSEvent theEvent)
+ {
+ if (!Enabled)
+ return;
+
+ var locationInView = ConvertPointFromView (theEvent.LocationInWindow, null);
+
+ var cellIdx = IndexOfCellAtX (locationInView.X);
+ if (cellIdx == -1) {
+ return;
+ }
+
+ var item = PathComponentCells [cellIdx];
+ if (item == null || !item.Enabled)
+ return;
+
+ var componentRect = ((NSPathCell)Cell).GetRect (item, Frame, this);
+ int idx = -1;
+ int i = 0;
+
+ NSMenuItem selectedItem = null;
+ var menu = new NSMenu {
+ AutoEnablesItems = false,
+ ShowsStateColumn = false,
+ Font = NSFont.MenuFontOfSize (12),
+ };
+ if (cellIdx == ConfigurationIdx) {
+ if (ActiveConfiguration == null)
return;
- var componentRect = ((NSPathCell)Cell).GetRect (item, Frame, this);
- int idx = -1;
- int i = 0;
+ foreach (var configuration in ConfigurationModel) {
- var menu = new NSMenu {
- AutoEnablesItems = false,
- ShowsStateColumn = false,
- Font = NSFont.MenuFontOfSize (12),
- };
- if (object.ReferenceEquals (ClickedPathComponentCell, PathComponentCells [ConfigurationIdx])) {
- if (ActiveConfiguration == null)
- return;
-
- foreach (var configuration in ConfigurationModel) {
- if (idx == -1 && configuration.OriginalId == ActiveConfiguration.OriginalId)
- idx = i;
-
- var _configuration = configuration;
- menu.AddItem (new NSMenuItem (configuration.DisplayString, (o2, e2) => {
- ActiveConfiguration = configurationModel.First (c => c.OriginalId == _configuration.OriginalId);
- if (ConfigurationChanged != null)
- ConfigurationChanged (o2, e2);
- UpdatePathText (ConfigurationIdx, _configuration.DisplayString);
- }) {
- Enabled = true,
- IndentationLevel = 1,
- });
- ++i;
- }
- } else if (object.ReferenceEquals (ClickedPathComponentCell, PathComponentCells [RuntimeIdx])) {
- if (ActiveRuntime == null)
- return;
-
- using (var activeMutableModel = ActiveRuntime.GetMutableModel ()) {
- foreach (var runtime in RuntimeModel) {
- using (var mutableModel = runtime.GetMutableModel ()) {
- if (idx == -1 && mutableModel.DisplayString == activeMutableModel.DisplayString)
- idx = i;
- }
-
- if (runtime.HasParent)
- continue;
-
- if (runtime.IsSeparator)
- menu.AddItem (NSMenuItem.SeparatorItem);
- else
- CreateMenuItem (menu, runtime);
- ++i;
+ var _configuration = configuration;
+ var menuitem = new NSMenuItem (configuration.DisplayString, (o2, e2) => {
+ ActiveConfiguration = configurationModel.First (c => c.OriginalId == _configuration.OriginalId);
+ }) {
+ Enabled = true,
+ IndentationLevel = 1,
+ };
+
+ menu.AddItem (menuitem);
+
+ if (selectedItem == null && configuration.OriginalId == ActiveConfiguration.OriginalId)
+ selectedItem = menuitem;
+ }
+ } else if (cellIdx == RuntimeIdx) {
+ if (ActiveRuntime == null)
+ return;
+
+ using (var activeMutableModel = ActiveRuntime.GetMutableModel ()) {
+ foreach (var runtime in RuntimeModel) {
+ if (runtime.HasParent)
+ continue;
+
+ NSMenuItem menuitem = null;
+ if (runtime.IsSeparator)
+ menu.AddItem (NSMenuItem.SeparatorItem);
+ else
+ menuitem = CreateMenuItem (menu, runtime);
+
+ using (var mutableModel = runtime.GetMutableModel ()) {
+ if (selectedItem == null && menuitem != null && mutableModel.DisplayString == activeMutableModel.DisplayString)
+ selectedItem = menuitem;
}
+
+ ++i;
}
- } else
- throw new NotSupportedException ();
+ }
+ } else
+ throw new NotSupportedException ();
- if (menu.Count > 1) {
- var offs = new CGPoint (componentRect.Left + 3, componentRect.Top + 3);
+ if (menu.Count > 1) {
+ var offs = new CGPoint (componentRect.Left + 3, componentRect.Top + 3);
- if (Window.Screen.BackingScaleFactor == 2)
- offs.Y += 0.5f; // fine tune menu position on retinas
+ if (Window?.Screen?.BackingScaleFactor == 2)
+ offs.Y += 0.5f; // fine tune menu position on retinas
- menu.PopUpMenu (null, offs, this);
- }
- };
+ menu.PopUpMenu (selectedItem, offs, this);
+ }
+ }
+
+ public override void DidChangeBackingProperties ()
+ {
+ base.DidChangeBackingProperties ();
+
+ // Force a redraw because NSPathControl does not redraw itself when switching to a different resolution
+ // and the icons need redrawn
+ NeedsDisplay = true;
+ }
+
+ void UpdateStyle (object sender = null, EventArgs e = null)
+ {
+ PathComponentCells [ConfigurationIdx].TextColor = Styles.BaseForegroundColor.ToNSColor ();
+ PathComponentCells [RuntimeIdx].TextColor = Styles.BaseForegroundColor.ToNSColor ();
+
+ UpdateImages ();
+ }
+
+ protected override void Dispose (bool disposing)
+ {
+ if (disposing)
+ Ide.Gui.Styles.Changed -= UpdateStyle;
+ base.Dispose (disposing);
}
public override void ViewDidMoveToWindow ()
@@ -327,7 +415,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
base.ViewDidMoveToWindow ();
NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidChangeBackingPropertiesNotification,
- notification => DispatchService.GuiDispatch (RealignTexts));
+ notification => Runtime.RunInMainThread ((Action) RealignTexts));
RealignTexts ();
}
@@ -344,22 +432,47 @@ namespace MonoDevelop.MacIntegration.MainToolbar
void UpdatePathText (int idx, string text)
{
- bool showText = (idx == ConfigurationIdx && (state & CellState.ConfigurationShown) != 0) || (idx == RuntimeIdx && (state & CellState.RuntimeShown) != 0);
- PathComponentCells [idx].Title = showText ? text : "\u00A0";
- PathComponentCells [ConfigurationIdx].Image = ImageService.GetIcon ("project").ToNSImage ();
- PathComponentCells [RuntimeIdx].Image = ImageService.GetIcon ("device").ToNSImage ();
+ PathComponentCells [idx].Title = text;
+ UpdateImages ();
+ }
+ void UpdateImages ()
+ {
+ string projectStyle = "";
+ string deviceStyle = "";
+ if (!PathComponentCells [ConfigurationIdx].Enabled)
+ projectStyle = "disabled";
+
+ if (!PathComponentCells [ConfigurationIdx].Enabled)
+ deviceStyle = "disabled";
+
+ // HACK
+ // For some reason NSPathControl does not like the images that ImageService provides. To use them it requires
+ // ToBitmap() to be called first. But a second problem is that ImageService only seems to provide a single resolution
+ // for its icons. It may be related to the images being initially loaded through the Gtk backend and then converted to NSImage
+ // at a later date.
+ // For whatever reason, we custom load the images here through NSImage, providing both 1x and 2x image reps.
+ PathComponentCells [ConfigurationIdx].Image = MultiResImage.CreateMultiResImage ("project", deviceStyle);
+ PathComponentCells [RuntimeIdx].Image = MultiResImage.CreateMultiResImage ("device", deviceStyle);
RealignTexts ();
}
+ void OnSizeChanged ()
+ {
+ var sview = (SelectorView)Superview;
+ sview.OnSizeChanged ();
+ }
+
IConfigurationModel activeConfiguration;
public IConfigurationModel ActiveConfiguration {
get { return activeConfiguration; }
set {
activeConfiguration = value;
state |= CellState.ConfigurationShown;
+ if (ConfigurationChanged != null)
+ ConfigurationChanged (this, EventArgs.Empty);
UpdatePathText (ConfigurationIdx, value.DisplayString);
- ((SelectorView)Superview).RequestResize ();
+ OnSizeChanged ();
}
}
@@ -371,7 +484,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
using (var mutableModel = value.GetMutableModel ()) {
state |= CellState.RuntimeShown;
UpdatePathText (RuntimeIdx, mutableModel.FullDisplayString);
- ((SelectorView)Superview).RequestResize ();
+ OnSizeChanged ();
}
}
}
@@ -385,9 +498,10 @@ namespace MonoDevelop.MacIntegration.MainToolbar
if (count == 0) {
state |= CellState.ConfigurationShown;
UpdatePathText (ConfigurationIdx, ConfigurationPlaceholder);
- ((SelectorView)Superview).RequestResize ();
+ activeConfiguration = null;
}
PathComponentCells [ConfigurationIdx].Enabled = count > 1;
+ OnSizeChanged ();
}
}
@@ -400,14 +514,29 @@ namespace MonoDevelop.MacIntegration.MainToolbar
if (count == 0) {
state |= CellState.RuntimeShown;
UpdatePathText (RuntimeIdx, RuntimePlaceholder);
- ((SelectorView)Superview).RequestResize ();
+ activeRuntime = null;
}
PathComponentCells [RuntimeIdx].Enabled = count > 1;
+ OnSizeChanged ();
}
}
public event EventHandler ConfigurationChanged;
public event EventHandler<HandledEventArgs> RuntimeChanged;
+
+ public override bool Enabled {
+ get {
+ return base.Enabled;
+ }
+ set {
+ base.Enabled = value;
+
+ if (value) {
+ PathComponentCells [RuntimeIdx].Enabled = runtimeModel.Count () > 1;
+ PathComponentCells [ConfigurationIdx].Enabled = configurationModel.Count () > 1;
+ }
+ }
+ }
}
#endregion
}
diff --git a/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs b/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs
index 2331b24551..4078703c30 100644
--- a/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs
+++ b/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs
@@ -26,6 +26,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Timers;
using AppKit;
using Foundation;
using CoreAnimation;
@@ -37,19 +38,34 @@ using MonoDevelop.Components.MainToolbar;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.Ide.Tasks;
+using MonoDevelop.Components.Mac;
namespace MonoDevelop.MacIntegration.MainToolbar
{
- class StatusIcon : StatusBarIcon
+ class StatusIcon : NSView, StatusBarIcon
{
StatusBar bar;
- CALayer layer;
+ NSImageView imageView;
- public StatusIcon (StatusBar bar, CALayer layer, NSTrackingArea trackingArea)
+ public StatusIcon (StatusBar bar) : base (CGRect.Empty)
{
+ imageView = new NSImageView (CGRect.Empty);
+ AddSubview (imageView);
+
+ var trackingArea = new NSTrackingArea (CGRect.Empty, NSTrackingAreaOptions.ActiveInKeyWindow | NSTrackingAreaOptions.InVisibleRect | NSTrackingAreaOptions.MouseEnteredAndExited, this, null);
+ AddTrackingArea (trackingArea);
+
this.bar = bar;
- this.layer = layer;
- TrackingArea = trackingArea;
+ }
+
+ public override CGRect Frame {
+ get {
+ return base.Frame;
+ }
+ set {
+ base.Frame = value;
+ imageView.Frame = new CGRect (0, 0, value.Width, value.Height);
+ }
}
public void SetAlertMode (int seconds)
@@ -57,18 +73,14 @@ namespace MonoDevelop.MacIntegration.MainToolbar
// Create fade-out fade-in animation.
}
- public void Dispose ()
+ public new void Dispose ()
{
- layer.RemoveFromSuperLayer ();
- bar.RemoveStatusLayer (layer);
- }
-
- public string ToolTip {
- get;
- set;
+ bar.RemoveStatusIcon (this);
+ RemoveFromSuperview ();
+ base.Dispose ();
}
- internal NSTrackingArea TrackingArea {
+ public new string ToolTip {
get;
set;
}
@@ -78,10 +90,30 @@ namespace MonoDevelop.MacIntegration.MainToolbar
get { return image; }
set {
image = value;
- layer.SetImage (value, bar.Window.BackingScaleFactor);
+ imageView.Image = value.ToNSImage ();
+ SetFrameSize (new CGSize (image.Width, image.Height));
}
}
+ public override void MouseEntered (NSEvent theEvent)
+ {
+ if (Entered != null) {
+ Entered (this, EventArgs.Empty);
+ }
+ }
+
+ public override void MouseExited (NSEvent theEvent)
+ {
+ if (Exited != null) {
+ Exited (this, EventArgs.Empty);
+ }
+ }
+
+ public override void MouseUp (NSEvent theEvent)
+ {
+ NotifyClicked (StatusBar.NSEventButtonToXwt (theEvent));
+ }
+
internal void NotifyClicked (Xwt.PointerButton button)
{
if (Clicked != null)
@@ -91,37 +123,247 @@ namespace MonoDevelop.MacIntegration.MainToolbar
}
public event EventHandler<StatusBarIconClickedEventArgs> Clicked;
+ public event EventHandler<EventArgs> Entered;
+ public event EventHandler<EventArgs> Exited;
+ }
+
+ class BuildResultsView : NSView
+ {
+ NSAttributedString resultString;
+ int resultCount;
+ public int ResultCount {
+ get {
+ return resultCount;
+ }
+ set {
+ resultCount = value;
+ resultString = new NSAttributedString (value.ToString (), foregroundColor: Styles.BaseForegroundColor.ToNSColor (),
+ font: NSFont.SystemFontOfSize (NSFont.SmallSystemFontSize - 1));
+ ResizeToFit ();
+ }
+ }
+
+ NSImage iconImage;
+ public NSImage IconImage {
+ get {
+ return iconImage;
+ }
+ set {
+ iconImage = value;
+ ResizeToFit ();
+ }
+ }
+
+ public BuildResultsView () : base (new CGRect (0, 0, 0, 0))
+ {
+ }
+
+ public override void DrawRect (CGRect dirtyRect)
+ {
+ if (iconImage == null || resultString == null) {
+ return;
+ }
+
+ iconImage.Draw (new CGRect (0, (Frame.Size.Height - iconImage.Size.Height) / 2, iconImage.Size.Width, iconImage.Size.Height));
+ resultString.DrawAtPoint (new CGPoint (iconImage.Size.Width, (Frame.Size.Height - resultString.Size.Height) / 2));
+ }
+
+ void ResizeToFit ()
+ {
+ if (iconImage == null || resultString == null) {
+ return;
+ }
+
+ var stringSize = resultString.GetSize ();
+ Frame = new CGRect (Frame.X, Frame.Y, iconImage.Size.Width + stringSize.Width, Frame.Height);
+ NeedsDisplay = true;
+ }
+
+ public override void MouseDown (NSEvent theEvent)
+ {
+ IdeApp.Workbench.GetPad<MonoDevelop.Ide.Gui.Pads.ErrorListPad> ().BringToFront ();
+ }
+ }
+
+ // We need a separate layer backed view to put over the NSTextFields because the NSTextField draws itself differently
+ // if it is layer backed so we can't make it or its superview layer backed.
+ class ProgressView : NSView
+ {
+ const string ProgressLayerFadingId = "ProgressLayerFading";
+ const string growthAnimationKey = "bounds";
+
+ CALayer progressLayer;
+ Stack<double> progressMarks = new Stack<double> ();
+ bool inProgress;
+ double oldFraction;
+
+ const int barHeight = 2;
+
+ public ProgressView ()
+ {
+ WantsLayer = true;
+ Layer.CornerRadius = MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 3 : 4;
+
+ progressLayer = new CALayer ();
+ Layer.AddSublayer (progressLayer);
+ Layer.BorderWidth = 0;
+
+ var xamBlue = NSColor.FromRgba (52f / 255, 152f / 255, 219f / 255, 1f);
+ progressLayer.BackgroundColor = xamBlue.CGColor;
+ progressLayer.BorderWidth = 0;
+ progressLayer.FillMode = CAFillMode.Forwards;
+ progressLayer.Frame = new CGRect (0, 0, 0, barHeight);
+ progressLayer.AnchorPoint = new CGPoint (0, 0);
+ }
+
+ public void BeginProgress ()
+ {
+ oldFraction = 0.0;
+ progressLayer.Hidden = false;
+ progressLayer.Opacity = 1;
+ progressLayer.Frame = new CGRect (0, 0, 0, barHeight);
+ }
+
+ public void SetProgressFraction (double work)
+ {
+ progressMarks.Push (work);
+ if (!inProgress) {
+ inProgress = true;
+ StartProgress (progressMarks.Peek ());
+ }
+ }
+
+ public void EndProgress ()
+ {
+ progressMarks.Clear ();
+ if (progressLayer != null) {
+ progressLayer.RemoveAnimation (growthAnimationKey);
+ progressLayer.Hidden = true;
+ }
+ inProgress = false;
+ }
+
+ CAAnimation CreateMoveAndGrowAnimation (CALayer progress, double growToFraction)
+ {
+ CAAnimationGroup grp = CAAnimationGroup.CreateAnimation ();
+ grp.Duration = 0.2;
+ grp.FillMode = CAFillMode.Forwards;
+ grp.RemovedOnCompletion = false;
+
+ CABasicAnimation grow = CABasicAnimation.FromKeyPath ("bounds");
+ grow.From = NSValue.FromCGRect (new CGRect (0, 0, Frame.Width * (nfloat)oldFraction, barHeight));
+ grow.To = NSValue.FromCGRect (new CGRect (0, 0, Frame.Width * (nfloat)growToFraction, barHeight));
+ grp.Animations = new [] {
+ grow,
+ };
+ return grp;
+ }
+
+ CAAnimation CreateAutoPulseAnimation ()
+ {
+ CABasicAnimation move = CABasicAnimation.FromKeyPath ("position.x");
+ move.From = NSNumber.FromDouble (-frameAutoPulseWidth);
+ move.To = NSNumber.FromDouble (Frame.Width + frameAutoPulseWidth);
+ move.RepeatCount = float.PositiveInfinity;
+ move.RemovedOnCompletion = false;
+ move.Duration = 4;
+ return move;
+ }
+
+ void AttachFadeoutAnimation (CALayer progress, CAAnimation animation, Func<bool> fadeoutVerifier)
+ {
+ animation.AnimationStopped += (sender, e) => {
+ if (!fadeoutVerifier ())
+ return;
+
+ CABasicAnimation fadeout = CABasicAnimation.FromKeyPath ("opacity");
+ fadeout.From = NSNumber.FromDouble (1);
+ fadeout.To = NSNumber.FromDouble (0);
+ fadeout.Duration = 0.5;
+ fadeout.FillMode = CAFillMode.Forwards;
+ fadeout.RemovedOnCompletion = false;
+ fadeout.AnimationStopped += (sender2, e2) => {
+ if (!e2.Finished)
+ return;
+
+ inProgress = false;
+ progress.Opacity = 0;
+ progress.RemoveAllAnimations ();
+ };
+ progress.Name = ProgressLayerFadingId;
+ progress.AddAnimation (fadeout, "opacity");
+ };
+ progress.AddAnimation (animation, growthAnimationKey);
+ }
+
+ public void StartProgress (double newFraction)
+ {
+ progressMarks.Clear ();
+ var grp = CreateMoveAndGrowAnimation (progressLayer, newFraction);
+ oldFraction = newFraction;
+
+ AttachFadeoutAnimation (progressLayer, grp, () => {
+ if (oldFraction < 1 && inProgress) {
+ if (progressMarks.Count != 0) {
+ StartProgress (progressMarks.Peek ());
+ } else {
+ inProgress = false;
+ }
+ return false;
+ }
+ return true;
+ });
+ }
+
+ const double frameAutoPulseWidth = 100;
+ public void StartProgressAutoPulse ()
+ {
+ var move = CreateAutoPulseAnimation ();
+ AttachFadeoutAnimation (progressLayer, move, () => true);
+ }
}
[Register]
- class StatusBar : NSTextField, MonoDevelop.Ide.StatusBar
+ class StatusBar : NSButton, MonoDevelop.Ide.StatusBar
{
- const string ProgressLayerId = "ProgressLayer";
+ public enum MessageType
+ {
+ Ready,
+ Information,
+ Warning,
+ Error,
+ }
+
const string ProgressLayerFadingId = "ProgressLayerFading";
- const string StatusIconPrefixId = "StatusLayer";
- const string BuildIconLayerId = "BuildIconLayer";
- const string BuildTextLayerId = "BuildTextLayer";
- const string SeparatorLayerId = "SeparatorLayer";
const string growthAnimationKey = "bounds";
StatusBarContextHandler ctxHandler;
Stack<double> progressMarks = new Stack<double> ();
bool currentTextIsMarkup;
string text;
+ MessageType messageType;
NSColor textColor;
NSImage image;
IconId icon;
AnimatedIcon iconAnimation;
IDisposable xwtAnimation;
+ readonly BuildResultsView buildResults;
NSAttributedString GetStatusString (string text, NSColor color)
{
+ nfloat fontSize = NSFont.SystemFontSize;
+ if (Window != null && Window.Screen != null) {
+ fontSize -= Window.Screen.BackingScaleFactor == 2 ? 2 : 1;
+ } else {
+ fontSize -= 1;
+ }
+
return new NSAttributedString (text, new NSStringAttributes {
ForegroundColor = color,
ParagraphStyle = new NSMutableParagraphStyle {
HeadIndent = imageView.Frame.Width,
LineBreakMode = NSLineBreakMode.TruncatingMiddle,
},
- Font = NSFont.SystemFontOfSize (NSFont.SystemFontSize - 2),
+ Font = NSFont.SystemFontOfSize (fontSize),
});
}
@@ -138,57 +380,56 @@ namespace MonoDevelop.MacIntegration.MainToolbar
Editable = false,
Selectable = false,
};
+ NSTrackingArea textFieldArea;
+ ProgressView progressView;
TaskEventHandler updateHandler;
public StatusBar ()
{
- AllowsEditingTextAttributes = Selectable = Editable = false;
+ Cell = new ColoredButtonCell ();
+ BezelStyle = NSBezelStyle.TexturedRounded;
+ Title = "";
+ Enabled = false;
- textField.Cell = new VerticallyCenteredTextFieldCell (yOffset: -0.5f);
+ LoadStyles ();
+
+ // We don't need to resize the Statusbar here as a style change will trigger a complete relayout of the Awesomebar
+ Ide.Gui.Styles.Changed += LoadStyles;
+
+ textField.Cell = new VerticallyCenteredTextFieldCell (0f);
textField.Cell.StringValue = "";
- textField.Cell.PlaceholderAttributedString = GetStatusString (BrandingService.ApplicationName, NSColor.DisabledControlText);
+ UpdateApplicationNamePlaceholderText ();
+
+ // The rect is empty because we use InVisibleRect to track the whole of the view.
+ textFieldArea = new NSTrackingArea (CGRect.Empty, NSTrackingAreaOptions.MouseEnteredAndExited | NSTrackingAreaOptions.ActiveInKeyWindow | NSTrackingAreaOptions.InVisibleRect, this, null);
+ textField.AddTrackingArea (textFieldArea);
+
+ imageView.Frame = new CGRect (0.5, 0, 0, 0);
imageView.Image = ImageService.GetIcon (Stock.StatusSteady).ToNSImage ();
- // Fixes a render glitch of a whiter bg than the others.
- if (MacSystemInformation.OsVersion >= MacSystemInformation.Yosemite)
- BezelStyle = NSTextFieldBezelStyle.Rounded;
+ buildResults = new BuildResultsView ();
+ buildResults.Hidden = true;
- WantsLayer = true;
- Layer.CornerRadius = MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 6 : 4;
ctxHandler = new StatusBarContextHandler (this);
updateHandler = delegate {
- int ec=0, wc=0;
+ int ec = 0, wc = 0;
- foreach (Task t in TaskService.Errors) {
+ foreach (var t in TaskService.Errors) {
if (t.Severity == TaskSeverity.Error)
ec++;
else if (t.Severity == TaskSeverity.Warning)
wc++;
}
- DispatchService.GuiDispatch (delegate {
- if (ec > 0) {
- buildResultVisible = true;
- buildResultText.AttributedString = new NSAttributedString (ec.ToString (), foregroundColor: NSColor.Text,
- font: NSFont.SystemFontOfSize (NSFont.SmallSystemFontSize - 1));
- buildResultText.ContentsScale = Window.BackingScaleFactor;
- buildResultIcon.SetImage (buildImageId = "md-status-error-count", Window.BackingScaleFactor);
- } else if (wc > 0) {
- buildResultVisible = true;
- buildResultText.AttributedString = new NSAttributedString (wc.ToString (), foregroundColor: NSColor.Text,
- font: NSFont.SystemFontOfSize (NSFont.SmallSystemFontSize - 1));
- buildResultText.ContentsScale = Window.BackingScaleFactor;
- buildResultIcon.SetImage (buildImageId = "md-status-warning-count", Window.BackingScaleFactor);
- } else
- buildResultVisible = false;
-
- CATransaction.DisableActions = true;
- nfloat buildResultPosition = DrawBuildResults ();
- CATransaction.DisableActions = false;
- if (buildResultPosition == nfloat.PositiveInfinity)
- return;
- textField.SetFrameSize (new CGSize (buildResultPosition - 6 - textField.Frame.Left, Frame.Height));
+ Runtime.RunInMainThread (delegate {
+ buildResults.Hidden = (ec == 0 && wc == 0);
+ buildResults.ResultCount = ec > 0 ? ec : wc;
+
+ buildImageId = ec > 0 ? "md-status-error-count" : "md-status-warning-count";
+ buildResults.IconImage = ImageService.GetIcon (buildImageId, Gtk.IconSize.Menu).ToNSImage ();
+
+ RepositionStatusIcons ();
});
};
@@ -196,208 +437,168 @@ namespace MonoDevelop.MacIntegration.MainToolbar
TaskService.Errors.TasksAdded += updateHandler;
TaskService.Errors.TasksRemoved += updateHandler;
+ BrandingService.ApplicationNameChanged += ApplicationNameChanged;
- NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidChangeBackingPropertiesNotification, notif => DispatchService.GuiDispatch (() => {
- if (Window == null)
- return;
-
- ReconstructString (updateTrackingAreas: true);
- foreach (var layer in Layer.Sublayers) {
- if (layer.Name != null && layer.Name.StartsWith (StatusIconPrefixId, StringComparison.Ordinal))
- layer.SetImage (layerToStatus [layer.Name].Image, Window.BackingScaleFactor);
- }
- if (buildResultVisible) {
- buildResultIcon.SetImage (buildImageId, Window.BackingScaleFactor);
- buildResultText.ContentsScale = Window.BackingScaleFactor;
- }
- }));
-
+ AddSubview (buildResults);
AddSubview (imageView);
AddSubview (textField);
+
+ progressView = new ProgressView ();
+ AddSubview (progressView);
}
- public override void DrawRect (CGRect dirtyRect)
+ void UpdateApplicationNamePlaceholderText ()
{
- if (imageView.Frame.Location == CGPoint.Empty)
- imageView.Frame = new CGRect (6, 0, 16, Frame.Height);
- if (textField.Frame.Location == CGPoint.Empty)
- textField.Frame = new CGRect (imageView.Frame.Right, 0, Frame.Width - 16, Frame.Height);
+ textField.Cell.PlaceholderAttributedString = GetStatusString (BrandingService.ApplicationLongName, ColorForType (MessageType.Ready));
+ }
- base.DrawRect (dirtyRect);
+ void ApplicationNameChanged (object sender, EventArgs e)
+ {
+ UpdateApplicationNamePlaceholderText ();
+ }
+
+ public override void DidChangeBackingProperties ()
+ {
+ base.DidChangeBackingProperties ();
+ ReconstructString ();
+ RepositionContents ();
+ }
+
+ void LoadStyles (object sender = null, EventArgs args = null)
+ {
+ if (IdeApp.Preferences.UserInterfaceSkin == Skin.Dark) {
+ Appearance = NSAppearance.GetAppearance (NSAppearance.NameVibrantDark);
+ } else {
+ Appearance = NSAppearance.GetAppearance (NSAppearance.NameAqua);
+ }
+
+ UpdateApplicationNamePlaceholderText ();
+ textColor = ColorForType (messageType);
+ ReconstructString ();
}
protected override void Dispose (bool disposing)
{
TaskService.Errors.TasksAdded -= updateHandler;
TaskService.Errors.TasksRemoved -= updateHandler;
+ Ide.Gui.Styles.Changed -= LoadStyles;
+ BrandingService.ApplicationNameChanged -= ApplicationNameChanged;
base.Dispose (disposing);
}
- NSTrackingArea textFieldArea;
- void ReconstructString (bool updateTrackingAreas)
+ public override void DrawRect (CGRect dirtyRect)
+ {
+ base.DrawRect (dirtyRect);
+
+ if (statusIcons.Count == 0 || buildResults.Hidden) {
+ return;
+ }
+
+ var x = LeftMostStatusItemX ();
+ var sepRect = new CGRect (x - 6.5, MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 4 : 3, 1, 16);
+ if (!sepRect.IntersectsWith (dirtyRect)) {
+ return;
+ }
+
+ NSColor.LightGray.SetFill ();
+ NSBezierPath.FillRect (sepRect);
+ }
+
+ public override void ViewDidMoveToWindow ()
+ {
+ base.ViewDidMoveToWindow ();
+ ReconstructString ();
+ RepositionContents ();
+ }
+
+ void ReconstructString ()
{
if (string.IsNullOrEmpty (text)) {
textField.AttributedStringValue = new NSAttributedString ("");
+ UpdateApplicationNamePlaceholderText ();
imageView.Image = ImageService.GetIcon (Stock.StatusSteady).ToNSImage ();
} else {
textField.AttributedStringValue = GetStatusString (text, textColor);
imageView.Image = image;
}
-
- var width = textField.AttributedStringValue.BoundingRectWithSize (new CGSize (nfloat.MaxValue, textField.Frame.Height),
- NSStringDrawingOptions.UsesFontLeading | NSStringDrawingOptions.UsesLineFragmentOrigin).Width;
-
- if (!updateTrackingAreas)
- return;
-
- if (textFieldArea != null) {
- RemoveTrackingArea (textFieldArea);
- DestroyPopover ();
- }
-
- if (width > textField.Frame.Width) {
- textFieldArea = new NSTrackingArea (textField.Frame, NSTrackingAreaOptions.MouseEnteredAndExited | NSTrackingAreaOptions.ActiveInKeyWindow, this, null);
- AddTrackingArea (textFieldArea);
- } else
- textFieldArea = null;
}
- CALayer ProgressLayer {
- get { return Layer.Sublayers.FirstOrDefault (l => l.Name == ProgressLayerId); }
- }
+ readonly List<StatusIcon> statusIcons = new List<StatusIcon> ();
- readonly Dictionary<string, StatusIcon> layerToStatus = new Dictionary<string, StatusIcon> ();
- internal void RemoveStatusLayer (CALayer statusLayer)
+ internal void RemoveStatusIcon (StatusIcon icon)
{
- RemoveTrackingArea (layerToStatus [statusLayer.Name].TrackingArea);
- layerToStatus.Remove (statusLayer.Name);
- RepositionStatusLayers ();
+ statusIcons.Remove (icon);
+
+ icon.Entered -= ShowPopoverForIcon;
+ icon.Exited -= DestroyPopover;
+ icon.Clicked -= DestroyPopover;
+
+ RepositionStatusIcons ();
}
nfloat LeftMostStatusItemX ()
{
- if (Layer.Sublayers == null)
- return Layer.Frame.Width;
-
- var left = Layer.Sublayers.Min<CALayer, nfloat> (layer => {
- if (layer.Name == null)
- return nfloat.PositiveInfinity;
+ if (statusIcons.Count == 0) {
+ return Frame.Width;
+ }
- if (layer.Name.StartsWith (StatusIconPrefixId, StringComparison.Ordinal))
- return layer.Frame.Left;
- return nfloat.PositiveInfinity;
- });
- return left == nfloat.PositiveInfinity ? Layer.Frame.Width : left;
+ return statusIcons.Last ().Frame.X;
}
nfloat DrawSeparatorIfNeeded (nfloat right)
{
- CALayer layer = Layer.Sublayers.FirstOrDefault (l => l.Name == SeparatorLayerId);
- if (layerToStatus.Count == 0) {
- if (layer != null)
- layer.RemoveFromSuperLayer ();
+ NeedsDisplay = true;
+
+ if (statusIcons.Count == 0) {
return right;
}
- right -= 9;
- if (layer != null) {
- layer.Frame = new CGRect (right, MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 4 : 3, 1, 16);
- layer.SetNeedsDisplay ();
- } else {
- layer = CALayer.Create ();
- layer.Name = SeparatorLayerId;
- layer.Frame = new CGRect (right, MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 4 : 3, 1, 16);
- layer.BackgroundColor = NSColor.LightGray.CGColor;
- Layer.AddSublayer (layer);
- }
- return right - 3;
+ return right - 12;
}
- bool buildResultVisible;
- readonly CATextLayer buildResultText = new CATextLayer {
- Name = BuildTextLayerId,
- };
IconId buildImageId;
- readonly CALayer buildResultIcon = new CALayer {
- Name = BuildIconLayerId,
- };
- nfloat DrawBuildResults ()
- {
- if (!buildResultVisible) {
- if (Layer.Sublayers != null) {
- CALayer layer;
- layer = Layer.Sublayers.FirstOrDefault (l => l.Name != null && l.Name.StartsWith (BuildIconLayerId, StringComparison.Ordinal));
- if (layer != null)
- layer.RemoveFromSuperLayer ();
-
- layer = Layer.Sublayers.FirstOrDefault (l => l.Name != null && l.Name.StartsWith (BuildTextLayerId, StringComparison.Ordinal));
- if (layer != null)
- layer.RemoveFromSuperLayer ();
-
- layer = Layer.Sublayers.FirstOrDefault (l => l.Name != null && l.Name.StartsWith (SeparatorLayerId, StringComparison.Ordinal));
- if (layer != null)
- layer.RemoveFromSuperLayer ();
- }
- return nfloat.PositiveInfinity;
- }
-
- nfloat right = DrawSeparatorIfNeeded (LeftMostStatusItemX ());
- CGSize size = buildResultText.AttributedString.Size;
- right = right - 6 - size.Width;
- buildResultText.Frame = new CGRect (right, MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 6 : 5, size.Width, size.Height);
- if (buildResultText.SuperLayer == null)
- Layer.AddSublayer (buildResultText);
- buildResultText.SetNeedsDisplay ();
- right -= buildResultIcon.Bounds.Width;
- buildResultIcon.Frame = new CGRect (right, MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 4 : 3, buildResultIcon.Bounds.Width, buildResultIcon.Bounds.Height);
- if (buildResultIcon.SuperLayer == null)
- Layer.AddSublayer (buildResultIcon);
- return right;
+ void PositionBuildResults (nfloat right)
+ {
+ right = DrawSeparatorIfNeeded (right);
+ right -= buildResults.Frame.Width;
+ buildResults.SetFrameOrigin (new CGPoint (right, buildResults.Frame.Y));
}
- internal void RepositionStatusLayers ()
+ internal void RepositionStatusIcons ()
{
- nfloat right = Layer.Frame.Width;
- CATransaction.DisableActions = true;
- foreach (var item in Layer.Sublayers) {
- if (item.Name != null && item.Name.StartsWith (StatusIconPrefixId, StringComparison.Ordinal)) {
- var icon = layerToStatus [item.Name];
- if (icon.TrackingArea != null)
- RemoveTrackingArea (icon.TrackingArea);
+ nfloat right = Frame.Width - 6;
- right -= item.Bounds.Width + 6;
- item.Frame = new CGRect (right, MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 4 : 3, item.Bounds.Width, item.Bounds.Height);
+ foreach (var item in statusIcons) {
+ right -= item.Bounds.Width + 1;
+ item.Frame = new CGRect (right, MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 4 : 3, item.Bounds.Width, item.Bounds.Height);
+ }
- var area = new NSTrackingArea (item.Frame, NSTrackingAreaOptions.MouseEnteredAndExited | NSTrackingAreaOptions.ActiveInKeyWindow, this, null);
- AddTrackingArea (area);
+ PositionBuildResults (right);
- icon.TrackingArea = area;
- }
- }
+ right -= 2;
- nfloat buildResultPosition = DrawBuildResults ();
- CATransaction.DisableActions = false;
- if (buildResultPosition < right) { // We have a build result layer.
- textField.SetFrameSize (new CGSize (buildResultPosition - 6 - textField.Frame.Left, Frame.Height));
+ if (!buildResults.Hidden) { // We have a build result layer.
+ textField.SetFrameSize (new CGSize (buildResults.Frame.X - 3 - textField.Frame.Left, Frame.Height));
} else
- textField.SetFrameSize (new CGSize (right - 6 - textField.Frame.Left, Frame.Height));
+ textField.SetFrameSize (new CGSize (right - 3 - textField.Frame.Left, Frame.Height));
}
- long statusCounter;
public StatusBarIcon ShowStatusIcon (Xwt.Drawing.Image pixbuf)
{
- var layer = CALayer.Create ();
- layer.Name = StatusIconPrefixId + (++statusCounter);
- layer.Bounds = new CGRect (0, 0, (nfloat)pixbuf.Width, (nfloat)pixbuf.Height);
- var statusIcon = new StatusIcon (this, layer, null) {
+ var statusIcon = new StatusIcon (this) {
Image = pixbuf,
};
- layerToStatus [layer.Name] = statusIcon;
+ statusIcons.Add (statusIcon);
+
+ statusIcon.Entered += ShowPopoverForIcon;
+ statusIcon.Exited += DestroyPopover;
- Layer.AddSublayer (layer);
+ // We need to destroy the popover otherwise the window doesn't come up correctly
+ statusIcon.Clicked += DestroyPopover;
- RepositionStatusLayers ();
+ AddSubview (statusIcon);
+ RepositionStatusIcons ();
return statusIcon;
}
@@ -409,7 +610,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
public void ShowReady ()
{
- ShowMessage (null, "", false, NSColor.DisabledControlText);
+ ShowMessage (null, "", false, MessageType.Ready);
}
static Pad sourcePad;
@@ -420,45 +621,46 @@ namespace MonoDevelop.MacIntegration.MainToolbar
public void ShowError (string error)
{
- ShowMessage (Stock.StatusError, error, false, NSColor.FromDeviceRgba (228f / 255, 84f / 255, 55f / 255, 1));
+ ShowMessage (Stock.StatusError, error, false, MessageType.Error);
+
}
public void ShowWarning (string warning)
{
- ShowMessage (Stock.StatusWarning, warning, false, NSColor.FromDeviceRgba (235f / 255, 161f / 255, 7f / 255, 1));
+ ShowMessage (Stock.StatusWarning, warning, false, MessageType.Warning);
}
public void ShowMessage (string message)
{
- ShowMessage (null, message, false, NSColor.FromRgba (0.34f, 0.34f, 0.34f, 1));
+ ShowMessage (null, message, false, MessageType.Information);
}
public void ShowMessage (string message, bool isMarkup)
{
- ShowMessage (null, message, true, NSColor.FromRgba (0.34f, 0.34f, 0.34f, 1));
+ ShowMessage (null, message, true, MessageType.Information);
}
public void ShowMessage (IconId image, string message)
{
- ShowMessage (image, message, false, NSColor.FromRgba (0.34f, 0.34f, 0.34f, 1));
+ ShowMessage (image, message, false, MessageType.Information);
}
public void ShowMessage (IconId image, string message, bool isMarkup)
{
- ShowMessage (image, message, isMarkup, NSColor.FromRgba (0.34f, 0.34f, 0.34f, 1));
+ ShowMessage (image, message, isMarkup, MessageType.Information);
}
- public void ShowMessage (IconId image, string message, bool isMarkup, NSColor color)
+ public void ShowMessage (IconId image, string message, bool isMarkup, MessageType statusType)
{
- DispatchService.AssertGuiThread ();
+ Runtime.AssertMainThread ();
- bool changed = LoadText (message, isMarkup, color);
+ bool changed = LoadText (message, isMarkup, statusType);
LoadPixbuf (image);
if (changed)
- ReconstructString (updateTrackingAreas: true);
+ ReconstructString ();
}
- bool LoadText (string message, bool isMarkup, NSColor color)
+ bool LoadText (string message, bool isMarkup, MessageType statusType)
{
message = message ?? "";
message = message.Replace (Environment.NewLine, " ").Replace ("\n", " ").Trim ();
@@ -468,11 +670,26 @@ namespace MonoDevelop.MacIntegration.MainToolbar
text = message;
currentTextIsMarkup = isMarkup;
- textColor = color;
+ messageType = statusType;
+ textColor = ColorForType (statusType);
return true;
}
+ NSColor ColorForType (MessageType messageType)
+ {
+ switch (messageType) {
+ case MessageType.Error:
+ return Styles.StatusErrorTextColor.ToNSColor ();
+ case MessageType.Warning:
+ return Styles.StatusWarningTextColor.ToNSColor ();
+ case MessageType.Ready:
+ return Styles.StatusReadyTextColor.ToNSColor ();
+ default:
+ return Styles.BaseForegroundColor.ToNSColor ();
+ }
+ }
+
static bool iconLoaded;
void LoadPixbuf (IconId iconId)
{
@@ -499,7 +716,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
image = iconAnimation.FirstFrame.ToNSImage ();
xwtAnimation = iconAnimation.StartAnimation (p => {
image = p.ToNSImage ();
- ReconstructString (updateTrackingAreas: false);
+ ReconstructString ();
});
} else {
image = ImageService.GetIcon (iconId).ToNSImage ();
@@ -510,48 +727,29 @@ namespace MonoDevelop.MacIntegration.MainToolbar
public void BeginProgress (string name)
{
- EndProgress ();
- ShowMessage (name);
- oldFraction = 0;
-
- if (AutoPulse)
- StartProgressAutoPulse ();
+ BeginProgress (null, name);
}
public void BeginProgress (IconId image, string name)
{
EndProgress ();
ShowMessage (image, name);
- oldFraction = 0;
if (AutoPulse)
- StartProgressAutoPulse ();
+ progressView.StartProgressAutoPulse ();
+ else
+ progressView.BeginProgress ();
}
- bool inProgress;
- double oldFraction;
+
public void SetProgressFraction (double work)
{
- if (AutoPulse)
- return;
-
- progressMarks.Push (work);
- if (!inProgress) {
- inProgress = true;
- StartProgress (progressMarks.Peek ());
- }
+ progressView.SetProgressFraction (work);
}
public void EndProgress ()
{
- progressMarks.Clear ();
- if (ProgressLayer != null) {
- ProgressLayer.RemoveAnimation (growthAnimationKey);
- if (inProgress == false)
- ProgressLayer.RemoveFromSuperLayer ();
- }
- inProgress = false;
- AutoPulse = false;
+ progressView.EndProgress ();
}
public void Pulse ()
@@ -570,117 +768,6 @@ namespace MonoDevelop.MacIntegration.MainToolbar
set;
}
- static CGColor xamBlue = new CGColor (52f / 255, 152f / 255, 219f / 255);
- static nfloat verticalOffset = MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 2 : 0;
- CALayer CreateProgressBarLayer (double width)
- {
- CALayer progress = ProgressLayer;
- if (progress == null) {
- progress = CALayer.Create ();
- progress.Name = ProgressLayerId;
- progress.BackgroundColor = xamBlue;
- progress.BorderColor = xamBlue;
- progress.FillMode = CAFillMode.Forwards;
- progress.Frame = new CGRect (0, Frame.Height - barHeight - verticalOffset, (nfloat)width, barHeight);
- }
- return progress;
- }
-
- CAAnimation CreateMoveAndGrowAnimation (CALayer progress, double growToFraction)
- {
- CAAnimationGroup grp = CAAnimationGroup.CreateAnimation ();
- grp.Duration = 0.2;
- grp.FillMode = CAFillMode.Forwards;
- grp.RemovedOnCompletion = false;
-
- CABasicAnimation move = CABasicAnimation.FromKeyPath ("position.x");
- double oldOffset = (progress.Frame.Width / 2) * oldFraction;
- double newOffset = (progress.Frame.Width / 2) * growToFraction;
- move.From = NSNumber.FromDouble (oldOffset);
- move.To = NSNumber.FromDouble (newOffset);
-
- CABasicAnimation grow = CABasicAnimation.FromKeyPath ("bounds");
- grow.From = NSValue.FromCGRect (new CGRect (0, 0, progress.Frame.Width * (nfloat)oldFraction, barHeight));
- grow.To = NSValue.FromCGRect (new CGRect (0, 0, progress.Frame.Width * (nfloat)growToFraction, barHeight));
- grp.Animations = new [] {
- move,
- grow,
- };
- return grp;
- }
-
- CAAnimation CreateAutoPulseAnimation ()
- {
- CABasicAnimation move = CABasicAnimation.FromKeyPath ("position.x");
- move.From = NSNumber.FromDouble (-frameAutoPulseWidth);
- move.To = NSNumber.FromDouble (Layer.Frame.Width + frameAutoPulseWidth);
- move.RepeatCount = float.PositiveInfinity;
- move.RemovedOnCompletion = false;
- move.Duration = 4;
- return move;
- }
-
- void AttachFadeoutAnimation (CALayer progress, CAAnimation animation, Func<bool> fadeoutVerifier)
- {
- animation.AnimationStopped += (sender, e) => {
- if (!fadeoutVerifier ())
- return;
-
- CABasicAnimation fadeout = CABasicAnimation.FromKeyPath ("opacity");
- fadeout.From = NSNumber.FromDouble (1);
- fadeout.To = NSNumber.FromDouble (0);
- fadeout.Duration = 0.5;
- fadeout.FillMode = CAFillMode.Forwards;
- fadeout.RemovedOnCompletion = false;
- fadeout.AnimationStopped += (sender2, e2) => {
- if (!e2.Finished)
- return;
-
- inProgress = false;
- progress.Opacity = 0;
- progress.RemoveAllAnimations ();
- progress.RemoveFromSuperLayer ();
- };
- progress.Name = ProgressLayerFadingId;
- progress.AddAnimation (fadeout, "opacity");
- };
- progress.AddAnimation (animation, growthAnimationKey);
- var oldLayer = ProgressLayer;
- if (oldLayer == null)
- Layer.AddSublayer (progress);
-
- UpdateLayer ();
- }
-
- const int barHeight = 2;
- void StartProgress (double newFraction)
- {
- progressMarks.Clear ();
- var progress = CreateProgressBarLayer (Layer.Frame.Width);
- var grp = CreateMoveAndGrowAnimation (progress, newFraction);
- oldFraction = newFraction;
-
- AttachFadeoutAnimation (progress, grp, () => {
- if (oldFraction < 1 && inProgress) {
- if (progressMarks.Count != 0) {
- StartProgress (progressMarks.Peek ());
- } else {
- inProgress = false;
- }
- return false;
- }
- return true;
- });
- }
-
- const double frameAutoPulseWidth = 100;
- void StartProgressAutoPulse ()
- {
- var progress = CreateProgressBarLayer (frameAutoPulseWidth);
- var move = CreateAutoPulseAnimation ();
- AttachFadeoutAnimation (progress, move, () => true);
- }
-
static NSAttributedString GetPopoverString (string text)
{
return new NSAttributedString (text, new NSStringAttributes {
@@ -715,9 +802,9 @@ namespace MonoDevelop.MacIntegration.MainToolbar
((NSTextField)popover.ContentViewController.View).AttributedStringValue = attrString;
}
- bool CreatePopoverForLayer (CALayer layer)
+ bool CreatePopoverForIcon (StatusBarIcon icon)
{
- string tooltip = layerToStatus [layer.Name].ToolTip;
+ string tooltip = icon.ToolTip;
if (tooltip == null)
return false;
@@ -730,18 +817,17 @@ namespace MonoDevelop.MacIntegration.MainToolbar
CreatePopoverCommon (Frame.Width, textField.AttributedStringValue.Value);
}
- void ShowPopoverForLayer (CALayer layer)
+ void ShowPopoverForIcon (object sender, EventArgs args)
{
if (popover != null)
return;
- if (!layerToStatus.ContainsKey (layer.Name))
- return;
+ var icon = (StatusIcon) sender;
- if (!CreatePopoverForLayer (layer))
+ if (!CreatePopoverForIcon (icon))
return;
- popover.Show (layer.Frame, this, NSRectEdge.MinYEdge);
+ popover.Show (icon.Frame, this, NSRectEdge.MinYEdge);
}
void ShowPopoverForStatusBar ()
@@ -753,59 +839,46 @@ namespace MonoDevelop.MacIntegration.MainToolbar
popover.Show (textField.Frame, this, NSRectEdge.MinYEdge);
}
- void DestroyPopover ()
+ void DestroyPopover (object sender, EventArgs args)
{
- oldLayer = null;
if (popover != null)
popover.Close ();
popover = null;
}
-
- bool InTextField (CGPoint location)
- {
- return textField.IsMouseInRect (location, textField.Frame);
- }
-
- CALayer LayerForPoint (CGPoint location)
- {
- CALayer layer = Layer.PresentationLayer.HitTest (location);
- return layer != null ? layer.ModelLayer : null;
- }
-
- string oldLayer;
+
public override void MouseEntered (NSEvent theEvent)
{
base.MouseEntered (theEvent);
- CGPoint location = ConvertPointFromView (theEvent.LocationInWindow, null);
-
- if (InTextField (location)) {
+ var width = textField.AttributedStringValue.BoundingRectWithSize (new CGSize (nfloat.MaxValue, textField.Frame.Height),
+ NSStringDrawingOptions.UsesFontLeading | NSStringDrawingOptions.UsesLineFragmentOrigin).Width;
+ if (width > textField.Frame.Width) {
ShowPopoverForStatusBar ();
- return;
- }
-
- var layer = LayerForPoint (location);
- if (layer == null)
- return;
-
- if (layer.Name == oldLayer) {
- StatusIcon icon;
- if (!layerToStatus.TryGetValue (layer.Name, out icon))
- return;
-
- if (string.IsNullOrEmpty (icon.ToolTip))
- return;
}
-
- oldLayer = layer.Name;
- ShowPopoverForLayer (layer);
}
public override void MouseExited (NSEvent theEvent)
{
base.MouseExited (theEvent);
+ DestroyPopover (null, null);
+ }
+
+ internal static Xwt.PointerButton NSEventButtonToXwt (NSEvent theEvent)
+ {
+ Xwt.PointerButton button = Xwt.PointerButton.Left;
+ switch ((NSEventType)(long)theEvent.ButtonNumber) {
+ case NSEventType.LeftMouseDown:
+ button = Xwt.PointerButton.Left;
+ break;
+ case NSEventType.RightMouseDown:
+ button = Xwt.PointerButton.Right;
+ break;
+ case NSEventType.OtherMouseDown:
+ button = Xwt.PointerButton.Middle;
+ break;
+ }
- DestroyPopover ();
+ return button;
}
public override void MouseDown (NSEvent theEvent)
@@ -813,41 +886,35 @@ namespace MonoDevelop.MacIntegration.MainToolbar
base.MouseDown (theEvent);
CGPoint location = ConvertPointFromView (theEvent.LocationInWindow, null);
- var layer = LayerForPoint (location);
- if (layer != null && layer.Name != null) {
- Xwt.PointerButton button = Xwt.PointerButton.Left;
- switch ((NSEventType)(long)theEvent.ButtonNumber) {
- case NSEventType.LeftMouseDown:
- button = Xwt.PointerButton.Left;
- break;
- case NSEventType.RightMouseDown:
- button = Xwt.PointerButton.Right;
- break;
- case NSEventType.OtherMouseDown:
- button = Xwt.PointerButton.Middle;
- break;
- }
-
- if (layerToStatus.ContainsKey (layer.Name)) {
- DestroyPopover ();
- layerToStatus [layer.Name].NotifyClicked (button);
- return;
- }
-
- if (layer.Name == BuildIconLayerId || layer.Name == BuildTextLayerId) { // We clicked error icon.
- IdeApp.Workbench.GetPad<MonoDevelop.Ide.Gui.Pads.ErrorListPad> ().BringToFront ();
- return;
- }
+ if (textField.IsMouseInRect (location, textField.Frame) && sourcePad != null) {
+ sourcePad.BringToFront (true);
}
+ }
- if (sourcePad != null)
- sourcePad.BringToFront (true);
+ public override CGRect Frame {
+ get {
+ return base.Frame;
+ }
+ set {
+ base.Frame = value;
+ RepositionContents ();
+ }
}
- public override void ViewDidEndLiveResize ()
+ void RepositionContents ()
{
- base.ViewDidEndLiveResize ();
- RepositionStatusLayers ();
+ nfloat yOffset = 0f;
+ if (Window != null && Window.Screen != null && Window.Screen.BackingScaleFactor == 2) {
+ yOffset = 0.5f;
+ }
+
+ imageView.Frame = new CGRect (6, 0, 16, Frame.Height);
+ textField.Frame = new CGRect (imageView.Frame.Right, yOffset, Frame.Width - 16, Frame.Height);
+
+ buildResults.Frame = new CGRect (buildResults.Frame.X, buildResults.Frame.Y, buildResults.Frame.Width, Frame.Height);
+ RepositionStatusIcons ();
+
+ progressView.Frame = new CGRect (0.5f, MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 1f : 2f, Frame.Width - 2, Frame.Height - 2);
}
}
}
diff --git a/main/src/addins/MacPlatform/MainToolbar/Styles.cs b/main/src/addins/MacPlatform/MainToolbar/Styles.cs
new file mode 100644
index 0000000000..0c4878aac4
--- /dev/null
+++ b/main/src/addins/MacPlatform/MainToolbar/Styles.cs
@@ -0,0 +1,79 @@
+//
+// Styles.cs
+//
+// Author:
+// Vsevolod Kukol <sevo@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using MonoDevelop.Ide;
+using Xwt.Drawing;
+
+namespace MonoDevelop.MacIntegration.MainToolbar
+{
+ public static class Styles
+ {
+ public static Color BaseBackgroundColor { get; private set; }
+ public static Color BaseForegroundColor { get; private set; }
+ public static Color DisabledForegroundColor { get; private set; }
+
+ public static Color StatusErrorTextColor { get; private set; }
+ public static Color StatusWarningTextColor { get; private set; }
+ public static Color StatusReadyTextColor { get; private set; }
+
+ // Dark workaround colors
+ public static Color DarkBorderColor { get; private set; }
+ public static Color DarkBorderBrokenColor { get; private set; }
+
+ static Styles ()
+ {
+ LoadStyles ();
+ Ide.Gui.Styles.Changed += (o, e) => LoadStyles ();
+ }
+
+ public static void LoadStyles ()
+ {
+ if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light) {
+ BaseBackgroundColor = Ide.Gui.Styles.BaseBackgroundColor;
+ BaseForegroundColor = Ide.Gui.Styles.BaseForegroundColor;
+ DisabledForegroundColor = Xwt.Mac.Util.ToXwtColor (AppKit.NSColor.DisabledControlText); //Ide.Gui.Styles.DimTextColor;
+ StatusErrorTextColor = Color.FromName ("#fa5433");
+ StatusWarningTextColor = Color.FromName ("#e8bd0d");
+ StatusReadyTextColor = Color.FromName ("#7f7f7f");
+ } else {
+ BaseBackgroundColor = Color.FromName ("#000000");
+ BaseForegroundColor = Color.FromName ("#ffffff");
+ DisabledForegroundColor = Color.FromName ("#e1e1e1");
+ StatusErrorTextColor = Color.FromName ("#fa5433");
+ StatusWarningTextColor = Color.FromName ("#e8bd0d");
+ StatusReadyTextColor = Color.FromName ("#7f7f7f");
+
+ DarkBorderColor = Color.FromName ("#8f8f8f");
+
+ // With the NSAppearance.NameVibrantDark appearance the first time a NSButtonCell
+ // is drawn it has a filter of some sort attached so that the colours are made lighter onscreen.
+ // To get the DarkBorderColor we need to use a workaround.
+ // See comment in ColoredButtonCell.DrawBezelWithFrame (RunButton.cs)
+ DarkBorderBrokenColor = Color.FromName ("#3e3e3e");
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/MacPlatform/MimeMapLoader.cs b/main/src/addins/MacPlatform/MimeMapLoader.cs
new file mode 100644
index 0000000000..2ffb9b5c40
--- /dev/null
+++ b/main/src/addins/MacPlatform/MimeMapLoader.cs
@@ -0,0 +1,72 @@
+//
+// MimeMapLoader.cs
+//
+// Author:
+// Geoff Norton <gnorton@novell.com>
+// Michael Hutchinson <m.j.hutchinson@gmail.com
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (C) 2007-2011 Novell, Inc (http://www.novell.com)
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text.RegularExpressions;
+
+namespace MonoDevelop.MacIntegration
+{
+ class MimeMapLoader
+ {
+ static char [] splitChars = new char [] { ' ' };
+ Dictionary<string, string> map;
+
+ public MimeMapLoader (Dictionary<string, string> map)
+ {
+ this.map = map;
+ }
+
+ public void LoadMimeMap (string fileName)
+ {
+ using (var file = File.OpenRead (fileName)) {
+ using (var reader = new StreamReader (file)) {
+ LoadMimeMap (reader);
+ }
+ }
+ }
+
+ public void LoadMimeMap (TextReader reader)
+ {
+ var mime = new Regex ("([a-zA-Z]+/[a-zA-z0-9+-_.]+)\t+([a-zA-Z0-9 ]+)", RegexOptions.Compiled);
+ string line;
+ while ((line = reader.ReadLine ()) != null) {
+ Match m = mime.Match (line);
+ if (m.Success) {
+ string extensions = m.Groups [2].Captures [0].Value;
+ foreach (string extension in extensions.Split (splitChars, StringSplitOptions.RemoveEmptyEntries)) {
+ map ["." + extension] = m.Groups [1].Captures [0].Value;
+ }
+ }
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/MacPlatform/ScreenMonitor.cs b/main/src/addins/MacPlatform/ScreenMonitor.cs
new file mode 100644
index 0000000000..ce0361ce90
--- /dev/null
+++ b/main/src/addins/MacPlatform/ScreenMonitor.cs
@@ -0,0 +1,101 @@
+//
+// ScreenMonitor.cs
+//
+// Author:
+// iain <iain@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin, Inc
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+
+using AppKit;
+using CoreGraphics;
+using Foundation;
+
+namespace MonoDevelop.MacIntegration
+{
+ public static class ScreenMonitor
+ {
+ // Maps NSScreens to the coordinates they have in GdkScreen space.
+ //
+ // [ Monitor1: 1024x800 ] [ Laptop: 2046x1600 ] | [ Monitor2: 1024x800]
+ //
+ // In Cocoa the main screen is 0,0 and all other screens are given coordinates relative
+ // to that screen, so in this example Laptop would be the main screen and the screenspace coordinates are
+ // relative to it.
+ // Monitor1: -1024, 0
+ // Laptop: 0, 0
+ // Monitor2: 2046, 0
+ //
+ // But GdkScreen is different, it creates a giant rectangle encompassing all the screens
+ // and coordinates in that screenspace are relative to the top left corner
+ // Monitor1: 0, 0
+ // Laptop: 1024, 0
+ // Monitor2: 3070, 0
+ //
+ static Dictionary<NSScreen, CGPoint> screenToGdk = null;
+
+ static ScreenMonitor ()
+ {
+ screenToGdk = UpdateScreenLayout ();
+ NSNotificationCenter.DefaultCenter.AddObserver (NSApplication.DidChangeScreenParametersNotification, (obj) => {
+ screenToGdk = UpdateScreenLayout ();
+ });
+ }
+
+ public static CGPoint GdkPointForNSScreen (NSScreen screen)
+ {
+ return screenToGdk [screen];
+ }
+
+ static Dictionary<NSScreen, CGPoint> UpdateScreenLayout ()
+ {
+ var screenMap = new Dictionary<NSScreen, CGPoint> ();
+
+ var screens = NSScreen.Screens;
+ if (screens == null) {
+ return screenMap;
+ }
+
+ nfloat lowestLeft = 0.0f, highestBottom = 0.0f;
+ foreach (var screen in screens) {
+ if (screen.Frame.Left < lowestLeft) {
+ lowestLeft = screen.Frame.Left;
+ }
+
+ if (screen.Frame.Bottom > highestBottom) {
+ highestBottom = screen.Frame.Bottom;
+ }
+ }
+
+ // Now we know that the GdkScreen origin is lowestLeft,highestBottom in NSScreen space
+ screens = NSScreen.Screens;
+ foreach (var screen in screens) {
+ var gdkOrigin = new CGPoint (screen.Frame.Left - lowestLeft, highestBottom - screen.Frame.Bottom);
+
+ screenMap [screen] = gdkOrigin;
+ }
+
+ return screenMap;
+ }
+ }
+}
+
diff --git a/main/src/addins/MacPlatform/icons/build.png b/main/src/addins/MacPlatform/icons/build.png
index 60db083214..ac14af146a 100644
--- a/main/src/addins/MacPlatform/icons/build.png
+++ b/main/src/addins/MacPlatform/icons/build.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/build@2x.png b/main/src/addins/MacPlatform/icons/build@2x.png
index 7dfb19221b..3508ce49e3 100644
--- a/main/src/addins/MacPlatform/icons/build@2x.png
+++ b/main/src/addins/MacPlatform/icons/build@2x.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/build~dark.png b/main/src/addins/MacPlatform/icons/build~dark.png
new file mode 100644
index 0000000000..1da2895e09
--- /dev/null
+++ b/main/src/addins/MacPlatform/icons/build~dark.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/build~dark@2x.png b/main/src/addins/MacPlatform/icons/build~dark@2x.png
new file mode 100644
index 0000000000..e0f1da6ecf
--- /dev/null
+++ b/main/src/addins/MacPlatform/icons/build~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/continue.png b/main/src/addins/MacPlatform/icons/continue.png
index 9d8db8c1cb..ce03a6208b 100644
--- a/main/src/addins/MacPlatform/icons/continue.png
+++ b/main/src/addins/MacPlatform/icons/continue.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/continue@2x.png b/main/src/addins/MacPlatform/icons/continue@2x.png
index 1a74564c7d..2f2e41cfc5 100644
--- a/main/src/addins/MacPlatform/icons/continue@2x.png
+++ b/main/src/addins/MacPlatform/icons/continue@2x.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/continue~dark.png b/main/src/addins/MacPlatform/icons/continue~dark.png
new file mode 100644
index 0000000000..42f0572c2a
--- /dev/null
+++ b/main/src/addins/MacPlatform/icons/continue~dark.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/continue~dark@2x.png b/main/src/addins/MacPlatform/icons/continue~dark@2x.png
new file mode 100644
index 0000000000..f4537f3453
--- /dev/null
+++ b/main/src/addins/MacPlatform/icons/continue~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/device.png b/main/src/addins/MacPlatform/icons/device.png
index 51690547be..f31a0b3395 100644
--- a/main/src/addins/MacPlatform/icons/device.png
+++ b/main/src/addins/MacPlatform/icons/device.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/device@2x.png b/main/src/addins/MacPlatform/icons/device@2x.png
index a045e0817c..a1996aae86 100644
--- a/main/src/addins/MacPlatform/icons/device@2x.png
+++ b/main/src/addins/MacPlatform/icons/device@2x.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/device~dark.png b/main/src/addins/MacPlatform/icons/device~dark.png
new file mode 100644
index 0000000000..659a8524ed
--- /dev/null
+++ b/main/src/addins/MacPlatform/icons/device~dark.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/device~dark@2x.png b/main/src/addins/MacPlatform/icons/device~dark@2x.png
new file mode 100644
index 0000000000..2c116ae133
--- /dev/null
+++ b/main/src/addins/MacPlatform/icons/device~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/project.png b/main/src/addins/MacPlatform/icons/project.png
index f25fdbfb2e..8bcf80e198 100644
--- a/main/src/addins/MacPlatform/icons/project.png
+++ b/main/src/addins/MacPlatform/icons/project.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/project@2x.png b/main/src/addins/MacPlatform/icons/project@2x.png
index e5e08d504f..c105ae6dad 100644
--- a/main/src/addins/MacPlatform/icons/project@2x.png
+++ b/main/src/addins/MacPlatform/icons/project@2x.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/project~dark.png b/main/src/addins/MacPlatform/icons/project~dark.png
new file mode 100644
index 0000000000..b7e415813e
--- /dev/null
+++ b/main/src/addins/MacPlatform/icons/project~dark.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/project~dark@2x.png b/main/src/addins/MacPlatform/icons/project~dark@2x.png
new file mode 100644
index 0000000000..4ff49d2d73
--- /dev/null
+++ b/main/src/addins/MacPlatform/icons/project~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/stop.png b/main/src/addins/MacPlatform/icons/stop.png
index 62501d3cab..6af6b394c7 100644
--- a/main/src/addins/MacPlatform/icons/stop.png
+++ b/main/src/addins/MacPlatform/icons/stop.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/stop@2x.png b/main/src/addins/MacPlatform/icons/stop@2x.png
index 3870bc446d..a7d453d517 100644
--- a/main/src/addins/MacPlatform/icons/stop@2x.png
+++ b/main/src/addins/MacPlatform/icons/stop@2x.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/stop~dark.png b/main/src/addins/MacPlatform/icons/stop~dark.png
new file mode 100644
index 0000000000..c93648fc0a
--- /dev/null
+++ b/main/src/addins/MacPlatform/icons/stop~dark.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/stop~dark@2x.png b/main/src/addins/MacPlatform/icons/stop~dark@2x.png
new file mode 100644
index 0000000000..e6c46dad8c
--- /dev/null
+++ b/main/src/addins/MacPlatform/icons/stop~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/maintoolbarbg~dark.png b/main/src/addins/MacPlatform/maintoolbarbg~dark.png
new file mode 100644
index 0000000000..3baa390e31
--- /dev/null
+++ b/main/src/addins/MacPlatform/maintoolbarbg~dark.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/maintoolbarbg~dark@2x.png b/main/src/addins/MacPlatform/maintoolbarbg~dark@2x.png
new file mode 100644
index 0000000000..edc2ef3803
--- /dev/null
+++ b/main/src/addins/MacPlatform/maintoolbarbg~dark@2x.png
Binary files differ
diff --git a/main/src/addins/Makefile.am b/main/src/addins/Makefile.am
index 2baa722c8e..6dd237dad5 100644
--- a/main/src/addins/Makefile.am
+++ b/main/src/addins/Makefile.am
@@ -17,14 +17,14 @@ SUBDIRS = \
AspNet \
CSharpBinding \
ILAsmBinding \
- NUnit \
+ MonoDevelop.UnitTesting \
+ MonoDevelop.UnitTesting.NUnit \
MonoDeveloperExtensions \
VBNetBinding \
MonoDevelop.GtkCore \
ChangeLogAddIn \
MonoDevelop.WebReferences \
MonoDevelop.RegexToolkit \
- CBinding \
MonoDevelop.AssemblyBrowser \
MonoDevelop.Debugger.Soft \
WindowsPlatform \
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/ChangeLog b/main/src/addins/MonoDevelop.AssemblyBrowser/ChangeLog
deleted file mode 100644
index 54645d74a6..0000000000
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/ChangeLog
+++ /dev/null
@@ -1,1122 +0,0 @@
-2010-04-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DisplayBinding.cs: Fix bug #Bug
- 593622 - assembly browser conflix with wine.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.AssemblyBrowser.addin.xml: Bumped MD version.
-
-2010-03-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AssemblyBrowser.addin.xml: Remove unrequired
- assembly import.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.AssemblyBrowser.csproj:
- * MonoDevelop.AssemblyBrowser/DisplayBinding.cs:
- * MonoDevelop.AssemblyBrowser/NamespaceBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ErrorNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ResourceNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserView.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ReferenceNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomReturnTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/BaseTypeFolderNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ResourceFolderNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ReferenceFolderNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ModuleReferenceNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ModuleDefinitionNodeBuilder.cs:
- * gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs:
- Merged MD.Projects into MD.Core, and MD.Projects.Gui,
- MD.Core.Gui and MD.Components into MD.Ide.
-
-2010-03-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AssemblyBrowser.csproj: Don't local-copy project
- refs, as it duplicates assemblies and breaks running on
- .NET.
-
-2010-03-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs: Nicer
- error message and kill console spew.
-
-2010-03-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs: Fixed
- 'Bug 583515 - No code completion for set-only properties'.
-
-2010-03-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs: Delegates
- are now formatted like c# in c# mode.
-
-2010-02-25 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.AssemblyBrowser/DocumentationPanel.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs:
- Fixed 'Bug 583017 - Wrong font in the Assembly Browser.' /
- applied patch from Alexander Cherniuk <ts33kr@gmail.com>
-
-
-2010-01-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser.addin.xml:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserView.cs: Added
- FindDerivedClasses command.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs:
- Flush.
-
-2010-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AssemblyBrowser.addin.xml:
- * MonoDevelop.AssemblyBrowser/DisplayBinding.cs: Track
- DisplayBinding API.
-
-2010-01-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.AssemblyBrowser.csproj: Fix project reference.
-
-2010-01-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ColoredCSharpFormatter.cs: fixed
- 'Bug 571177 - Assembly browser text widget issues'.
-
-2010-01-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs: fixed
- 'Bug 571178 - Assembly browser should show protected
- members'.
-
-2010-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.AssemblyBrowser.csproj:
- * MonoDevelop.AssemblyBrowser.addin.xml: Fix the Cecil
- decompiler in the build. Make building MD with Makefiles
- work again, and puts the decompiler properly in its own dll
- instead of merging it into a franken-Cecil.
-
-2010-01-15 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.AssemblyBrowser.csproj:
- * MonoDevelop.AssemblyBrowser/Decompiler.cs:
- * MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ColoredCSharpFormatter.cs: Now
- using the cecil decompiler.
-
-2010-01-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomReturnTypeNodeBuilder.cs:
- Implemented go to base type.
-
-2010-01-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs:
- Reduce spacing and tweak borders.
-
-2009-12-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs:
- Remove the cancel-search button, because it duplicates the
- function clear-textbox button.
-
-2009-12-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * gtk-gui/objects.xml:
- * MonoDevelop.AssemblyBrowser.csproj:
- * MonoDevelop.AssemblyBrowser/SearchEntry.cs:
- * MonoDevelop.AssemblyBrowser/HoverImageButton.cs:
- * gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs:
- Moved the SearchEntry to MonoDevelop.Components.
-
-2009-12-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/objects.xml:
- * gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs:
- Fix layout of the navigation bar.
-
-2009-12-04 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * gtk-gui/objects.xml:
- * gtk-gui/generated.cs:
- * MonoDevelop.AssemblyBrowser.csproj:
- * MonoDevelop.AssemblyBrowser/SearchEntry.cs:
- * MonoDevelop.AssemblyBrowser/NamespaceBuilder.cs:
- * MonoDevelop.AssemblyBrowser/HoverImageButton.cs:
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DocumentationPanel.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs:
- Overworked the assembly browser GUI.
-
-2009-11-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/Decompiler.cs: Fixed 'Bug 554836
- - error in assembly browser while showing C# code'.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.AssemblyBrowser.addin.xml: Bump MD version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * MonoDevelop.AssemblyBrowser.csproj:
- * gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs:
- Flush.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs:
- moved toolbar.
-
-2009-10-08 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.AssemblyBrowser.csproj: Use \ instead of '/'
- in the Import.
-
-2009-10-08 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.AssemblyBrowser.csproj: Mark the Refactoring
- project reference as Private.
-
-2009-10-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: set
- correct inspect widget.
-
-2009-10-07 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/objects.xml:
- * MonoDevelop.AssemblyBrowser/DisplayBinding.cs:
- * MonoDevelop.AssemblyBrowser/NamespaceBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ReferenceNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomReturnTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/BaseTypeFolderNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ReferenceFolderNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ModuleDefinitionNodeBuilder.cs:
- * gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserTypeNodeBuilder.cs:
- Worked on memory leaks.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.AssemblyBrowser.addin.xml: Bump MD version.
-
-2009-10-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserView.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: cancel
- search worken on destroy.
-
-2009-10-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Track
- API changes.
-
-2009-10-07 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/objects.xml:
-
- * Makefile.am:
- * MonoDevelop.AssemblyBrowser.csproj:
- * MonoDevelop.AssemblyBrowser/NamespaceBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ReferenceNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomReturnTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/BaseTypeFolderNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ReferenceFolderNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ModuleDefinitionNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserTypeNodeBuilder.cs:
- Worked on assembly browser.
-
-2009-10-06 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.AssemblyBrowser.csproj:
- * MonoDevelop.AssemblyBrowser/NamespaceBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DocumentationPanel.cs:
- * MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ModuleDefinitionNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/IAssemblyBrowserNodeBuilder.cs:
- Added documentation panel.
-
-2009-10-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/BaseTypeFolder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: turned
- off tree disposing.
-
-2009-10-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/Namespace.cs: took out type
- dispose.
-
-2009-10-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: took
- out dom dispose chain.
-
-2009-10-05 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
-
- * MonoDevelop.AssemblyBrowser/Namespace.cs:
- * MonoDevelop.AssemblyBrowser/BaseTypeFolder.cs:
- * MonoDevelop.AssemblyBrowser/ResourceFolder.cs:
- * MonoDevelop.AssemblyBrowser/ReferenceFolder.cs:
- * MonoDevelop.AssemblyBrowser/NamespaceBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserView.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * MonoDevelop.AssemblyBrowser/BaseTypeFolderNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ResourceFolderNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ReferenceFolderNodeBuilder.cs:
- Added dispose chain.
-
-2009-09-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs: Renamed
- IDomVisitable -> INode
-
-2009-08-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AssemblyBrowser.addin.xml: Don't use the text
- editor display binding id as reference for registering the
- designer view. Removed unused supportedFormats attribute.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/NamespaceBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs: fixed
- typo.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/Error.cs:
- * MonoDevelop.AssemblyBrowser/Namespace.cs:
- * MonoDevelop.AssemblyBrowser/BaseTypeFolder.cs:
- * MonoDevelop.AssemblyBrowser/ResourceFolder.cs:
- * MonoDevelop.AssemblyBrowser/ReferenceFolder.cs:
- * MonoDevelop.AssemblyBrowser/NamespaceBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ReferenceNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Worked
- on assembly browser.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Fixed
- compiler warnings.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AssemblyBrowser.csproj: Updated dependencies. We
- now depend on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * MonoDevelop.AssemblyBrowser/ReferenceFolderNodeBuilder.cs:
- Use the new AssemblyContext class to query and resolve
- assemblies.
-
-2009-08-07 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.AssemblyBrowser.csproj:
- * MonoDevelop.AssemblyBrowser.addin.xml:
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserView.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Added
- find references command to the assembly browser context
- menu.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Flush.
-
-2009-06-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: fixed
- "Bug 517032 - Crash when using search in assembly browser".
-
-2009-06-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Fixed
- "Bug 512533 - Assembly browser sometimes crashes".
-
-2009-06-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Fixed
- crash case reported in "Bug 513383 - Going to declaration of
- extension method of System.Drawing.Bitmap crashes MD badly".
-
-2009-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * MonoDevelop.AssemblyBrowser/ReferenceFolderNodeBuilder.cs:
- Track assembly lookup APIs.
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DisplayBinding.cs: Track API
- changes.
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DisplayBinding.cs: Track API
- changes.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs:
- Renamed PixbufService to ImageService.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs: Track
- API changes.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.AssemblyBrowser.csproj: don't require specific
- gtk-sharp version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.AssemblyBrowser.addin.xml: Bump MD version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * MonoDevelop.AssemblyBrowser/ReferenceFolderNodeBuilder.cs:
- Track api changes to support multiple target runtimes.
-
-2009-03-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs: fixed
- some output issues in ilasm view.
-
-2009-03-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AssemblyBrowser.csproj: Don't local-copy project
- refs.
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser.csproj: Moved text editor to
- core
-
-2009-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- Constructors are not longer filtered out.
-
-2009-03-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Worked
- on 'Bug 479976 - Links in assembly browser are only shown
- for intrinsic types'.
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AssemblyBrowser.csproj: Flush.
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- Changed override Destroy --> override OnDestroyed.
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserView.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Worked
- on ressource de-allocation.
-
-2009-02-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: open
- is now done with a timeout handler.
-
-2009-02-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.AssemblyBrowser.csproj: Enable building without
- make. Add System.Core reference, as it's not implicit in MD
- builds.
-
-2009-02-20 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs:
- implmented forward/backward navigation. shift+click/middle
- click now opens a reference in a new window.
-
-2009-02-20 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
-
- * MonoDevelop.AssemblyBrowser/AssemblyNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * MonoDevelop.AssemblyBrowser/ModuleDefinitionNodeBuilder.cs:
- module node now gets expanded + module "decompiliation view"
- now shows a list of all containing namespaces.
-
-2009-02-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * MonoDevelop.AssemblyBrowser/ReferenceFolderNodeBuilder.cs:
- Track api changes.
-
-2009-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AssemblyBrowser.csproj: Remove more inadvertent
- local copying of references.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AssemblyBrowser.mdp:
- * MonoDevelop.AssemblyBrowser.csproj: Migrated to MSBuild file
- format.
-
-2009-02-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/NamespaceBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs: Track
- renamings.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.AssemblyBrowser.addin.xml: Bump MD version.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Flush.
-
-2009-02-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Track
- TextEditorOptions API changes.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.AssemblyBrowser.mdp: Flush project format changes.
-
-2009-01-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs: Assembly
- browser now shows custom attributes.
-
-2009-01-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Remove property
- changed event handler on dispose.
-
-2009-01-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs: Show constructors
- in type view.
-
-2009-01-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/Decompiler.cs:
- * MonoDevelop.AssemblyBrowser/NamespaceBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Worked on
- assembly browser output now looks like syntax highlighting &
- clickable types. (fixing Bug 456306 - "Assembly Browser: types should
- be clickable.")
-
-2009-01-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Added loading of
- references when clicking on types that are not loaded.
-
-2009-01-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/NamespaceBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ReferenceNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * MonoDevelop.AssemblyBrowser/ReferenceFolderNodeBuilder.cs: Types are
- now clickable.
-
-2009-01-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/NamespaceBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ModuleDefinitionNodeBuilder.cs: fixed "Bug
- 456308 - Assembly Browser: namespace browser".
-
-2009-01-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs: Added
- link support (Loading of referenced links still missing).
-
-2009-01-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs: Track api changes.
-
-2009-01-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DisplayBinding.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserView.cs: Only "one" browser
- now can be open.
-
-2009-01-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Added support
- for generic help urls.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AssemblyBrowser.mdp: All projects now require fx 3.5.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DisplayBinding.cs: In
- CanCreateContentForFile, return true for assemblies.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Make it work for parallel build.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * AssemblyInfo.cs: Add AssemblyInfo.cs files that are autogenerated from
- the addin manifests.
-
-2008-11-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomReturnTypeNodeBuilder.cs: renamed
- emitmarkup.
-
-2008-11-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs: Changed postprocess
- synopsis.
-
-2008-11-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs: Worked on
- assembly browser.
-
-2008-11-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/Decompiler.cs:
- * MonoDevelop.AssemblyBrowser/NamespaceBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs: Worked on
- assembly browser.
-
-2008-11-11 Mike Krüger <mike@icsharpcode.net>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: removed the
- documentation tab out of the assembly browser.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AssemblyBrowser.addin.xml: Bump MD version.
-
-2008-10-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/Reference.cs:
- * MonoDevelop.AssemblyBrowser/ReferenceNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * MonoDevelop.AssemblyBrowser/ReferenceFolderNodeBuilder.cs: Worked on
- reference loading.
-
-2008-10-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/NamespaceBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/IAssemblyBrowserNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ModuleDefinitionNodeBuilder.cs:
- * gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs: Worked
- on assembly browser
-
-2008-10-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserView.cs:
- * MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs:
- * MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs:
- * MonoDevelop.AssemblyBrowser/ModuleDefinitionNodeBuilder.cs: Worked on
- assembly browser.
-
-2008-09-24 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs,
- MonoDevelop.AssemblyBrowser/Decompiler.cs,
- MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs,
- MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomReturnTypeNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DisplayBinding.cs,
- MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/ReferenceFolderNodeBuilder.cs: Worked
- on assembly browser, removed debug messages.
-
-2008-09-24 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs,
- gtk-gui/gui.stetic: Removed unnecessary label.
-
-2008-09-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs,
- MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomReturnTypeNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs: fixed 'Bug
- 412704 - Assembly browser does not escape type names, breaking
- markup'.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs,
- MonoDevelop.AssemblyBrowser.mdp: Updated generated code.
-
-2008-09-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Changed
- compilation unit/document meta information interface.
-
-2008-09-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs: some changed
- due dom changes.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Renamed
- MonoDevelopTreeView to ExtensibleTreeView.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/objects.xml,
- MonoDevelop.AssemblyBrowser/ModuleDefinitionNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/ModuleReferenceNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/BaseTypeFolderNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs,
- MonoDevelop.AssemblyBrowser/AssemblyNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomReturnTypeNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/ResourceFolderNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/NamespaceBuilder.cs,
- MonoDevelop.AssemblyBrowser/ResourceNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/ErrorNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/ReferenceFolderNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/IAssemblyBrowserNodeBuilder.cs: Moved
- the extensible tree view to its own directory.
-
-2008-08-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Fixing
- compilation error.
-
-2008-07-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/ModuleDefinitionNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/AssemblyNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomReturnTypeNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/NamespaceBuilder.cs: Worked on code
- completion/new dom.
-
-2008-07-17 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs,
- MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Worked on
- documentation view.
-
-2008-07-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/ModuleDefinitionNodeBuilder.cs: some dom
- changes.
-
-2008-07-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/ModuleDefinitionNodeBuilder.cs: API
- change.
-
-2008-06-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser.Dom/DomCecilCompilationUnit.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilMethod.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilParameter.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilType.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilEvent.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilReturnType.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilField.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilAttribute.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilProperty.cs,
- MonoDevelop.AssemblyBrowser/ModuleDefinitionNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/ModuleReferenceNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/Decompiler.cs,
- MonoDevelop.AssemblyBrowser/BaseTypeFolderNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs,
- MonoDevelop.AssemblyBrowser/AssemblyNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/ResourceFolderNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/NamespaceBuilder.cs,
- MonoDevelop.AssemblyBrowser/ResourceNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/ErrorNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/ReferenceFolderNodeBuilder.cs:
- Refactored dom cecil layer.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AssemblyBrowser.addin.xml: Bump MD version.
-
-2008-05-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser.Dom/DomCecilCompilationUnit.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilMethod.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilParameter.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilType.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilEvent.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilReturnType.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilField.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilAttribute.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilProperty.cs,
- MonoDevelop.AssemblyBrowser.mdp,
- MonoDevelop.AssemblyBrowser/ModuleDefinitionNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/ModuleReferenceNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/BaseTypeFolderNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs,
- MonoDevelop.AssemblyBrowser/AssemblyNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/Namespace.cs,
- MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomReturnTypeNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/ResourceFolderNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/NamespaceBuilder.cs,
- MonoDevelop.AssemblyBrowser/ResourceNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/ErrorNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/ReferenceFolderNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/BaseTypeFolder.cs: Added new dom & new
- class browser.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.AssemblyBrowser.mdp: New project model changes.
-
-2008-04-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser.addin.xml: Updated assembly browser for
- the managed editor.
-
-2008-03-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs: fixed warning.
-
-2008-03-02 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Workaraound a bug in
- mono 1.2.4 where anonymous delegates ignore usings.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: worked on search
- feature.
-
-2008-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Added progress bar
- for search operations.
-
-2008-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/Decompiler.cs,
- MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs,
- MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs: Added search in
- disassembler/decompiler feature (helpful for compiler writers).
-
-2008-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: added some gettext
- calls.
-
-2008-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser.Dom/DomCecilCompilationUnit.cs,
- MonoDevelop.AssemblyBrowser/BaseTypeFolderNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs,
- MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs: Worked on
- assembly browser (search types & members)
-
-2008-02-24 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs,
- MonoDevelop.AssemblyBrowser/AssemblyBrowserView.cs,
- MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs,
- MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs: Worked on assembly
- browser.
-
-2008-02-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser.Dom/DomCecilMethod.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilType.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilEvent.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilField.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilProperty.cs,
- MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs: Worked on
- assembly browser.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/Decompiler.cs: Added new decompiler changes
- from Andrea. (most opcodes should work (however switch ... case doesn't
- work yet))
-
-2008-02-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/Decompiler.cs,
- MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs: Added basic c#
- decompiler (Very BASIC).
-
-2008-02-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser.Dom/DomCecilType.cs: Changed dom.
-
-2008-02-07 Zach Lute <zach.lute@gmail.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Fix to use a full
- qualifier in an anonymous delegate so things would build in Mono 1.2.4.
-
-2008-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs: Formated the IL
- output a bit nicer.
-
-2008-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser.Dom/DomCecilParameter.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilEvent.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilField.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilAttribute.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilProperty.cs,
- MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs,
- MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs: Fixed some compile
- warnings.
-
-2008-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser.mdp, Makefile.am: Added assembly browser to
- the build.
-
-2008-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser.mdp, Makefile.am: Added makefile.
-
-2008-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser.Dom/DomCecilType.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilReturnType.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilAttribute.cs,
- MonoDevelop.AssemblyBrowser.mdp,
- MonoDevelop.AssemblyBrowser/ModuleDefinitionNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/ModuleReferenceNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs,
- MonoDevelop.AssemblyBrowser/AssemblyNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/NamespaceBuilder.cs,
- MonoDevelop.AssemblyBrowser/IAssemblyBrowserNodeBuilder.cs: Worked on
- assembly browser.
-
-2008-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Changed pane
- positioning.
-
-2008-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser.Dom/DomCecilType.cs,
- MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs,
- MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomReturnTypeNodeBuilder.cs: Dom output is
- now used for all nodes.
-
-2008-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Changed disassembler
- colors & font.
-
-2008-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs: Assembly browser can
- now be used to open referenced assemblies.
-
-2008-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser.Dom/DomCecilMethod.cs,
- MonoDevelop.AssemblyBrowser.mdp,
- MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs,
- MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/NamespaceBuilder.cs,
- MonoDevelop.AssemblyBrowser/IAssemblyBrowserNodeBuilder.cs: Worked on
- assembly browser.
-
-2008-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.AssemblyBrowser.Dom/DomCecilMethod.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilParameter.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilType.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilEvent.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilReturnType.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilField.cs,
- MonoDevelop.AssemblyBrowser.Dom/DomCecilProperty.cs,
- MonoDevelop.AssemblyBrowser/BaseTypeFolderNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs,
- MonoDevelop.AssemblyBrowser/DomMethodNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomReturnTypeNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomEventNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomTypeNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomFieldNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/DomPropertyNodeBuilder.cs,
- MonoDevelop.AssemblyBrowser/BaseTypeFolder.cs: Worked on assembly
- browser (Now using dom output).
-
-2008-02-07 Mike Krüger <mkrueger@novell.com>
-
-
-
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser.addin.xml b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser.addin.xml
index b8ef864ae9..8c01141657 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser.addin.xml
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser.addin.xml
@@ -10,7 +10,7 @@
<Extension path = "/MonoDevelop/Ide/Commands">
<Command id = "MonoDevelop.AssemblyBrowser.ShowAssemblyBrowser"
defaultHandler = "MonoDevelop.AssemblyBrowser.AssemblyBrowserHandler"
- _label = "_Assembly browser" />
+ _label = "_Assembly Browser" />
</Extension>
<Extension path = "/MonoDevelop/Ide/DisplayBindings">
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser.csproj b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser.csproj
index b0beb0d94c..6efa20747e 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser.csproj
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser.csproj
@@ -46,7 +46,6 @@
<ItemGroup>
<Reference Include="Mono.Posix" />
<Reference Include="System" />
- <Reference Include="System.Xml" />
<Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<SpecificVersion>False</SpecificVersion>
</Reference>
@@ -64,6 +63,20 @@
</Reference>
<Reference Include="System.Core" />
<Reference Include="Mono.Cairo" />
+ <Reference Include="monodoc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Reflection.Metadata">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Reflection.Metadata.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Collections.Immutable">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Collections.Immutable.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
@@ -76,11 +89,6 @@
<Name>MonoDevelop.Ide</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
- <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
- <Name>Mono.TextEditor</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\MonoDevelop.Refactoring\MonoDevelop.Refactoring.csproj">
<Project>{100568FC-F4E8-439B-94AD-41D11724E45B}</Project>
<Name>MonoDevelop.Refactoring</Name>
@@ -96,11 +104,6 @@
<Name>ICSharpCode.Decompiler</Name>
<Private>False</Private>
</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="..\..\..\external\cecil\Mono.Cecil.csproj">
<Project>{D68133BD-1E63-496E-9EDE-4FBDBF77B486}</Project>
<Name>Mono.Cecil</Name>
@@ -169,6 +172,9 @@
<Compile Include="XmlDocIdLib\OperatorType.cs" />
<Compile Include="XmlDocIdLib\XmlDocIdGenerator.cs" />
<Compile Include="AddinInfo.cs" />
+ <Compile Include="MonoDevelop.AssemblyBrowser\NRefactoryStock.cs" />
+ <Compile Include="MonoDevelop.AssemblyBrowser\HelpExtensions.cs" />
+ <Compile Include="MonoDevelop.AssemblyBrowser\AssemblyBrowserNavigationPoint.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="gtk-gui\gui.stetic">
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserNavigationPoint.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserNavigationPoint.cs
new file mode 100644
index 0000000000..f62d47d205
--- /dev/null
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserNavigationPoint.cs
@@ -0,0 +1,103 @@
+//
+// AssemblyBrowserNavigationPoint.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide.Navigation;
+using ICSharpCode.NRefactory.TypeSystem;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.AssemblyBrowser
+{
+ class AssemblyBrowserNavigationPoint : NavigationPoint
+ {
+ List<AssemblyLoader> definitions;
+ string idString;
+
+ public AssemblyBrowserNavigationPoint (List<AssemblyLoader> definitions, string idString)
+ {
+ this.definitions = definitions;
+ this.idString = idString;
+ }
+
+ Document DoShow ()
+ {
+ Document result = null;
+ foreach (var view in Ide.IdeApp.Workbench.Documents) {
+ if (view.GetContent<AssemblyBrowserViewContent> () != null) {
+ view.Window.SelectWindow ();
+ result = view;
+ break;
+ }
+ }
+
+ if (result == null) {
+ var binding = DisplayBindingService.GetBindings<AssemblyBrowserDisplayBinding> ().FirstOrDefault ();
+ var assemblyBrowserView = binding != null ? binding.GetViewContent () : new AssemblyBrowserViewContent ();
+ assemblyBrowserView.FillWidget ();
+ result = Ide.IdeApp.Workbench.OpenDocument (assemblyBrowserView, true);
+ }
+ if (idString != null) {
+ var view = result.GetContent<AssemblyBrowserViewContent> ();
+ view.Widget.suspendNavigation = true;
+ view.EnsureDefinitionsLoaded (definitions);
+ view.Open (idString, expandNode: false);
+ }
+ return result;
+ }
+
+ public override bool Equals (object obj)
+ {
+ var other = obj as AssemblyBrowserNavigationPoint;
+ if (other == null)
+ return false;
+ return other.idString.Equals (idString);
+ }
+
+ public override int GetHashCode ()
+ {
+ return idString.GetHashCode ();
+ }
+
+ #region implemented abstract members of NavigationPoint
+
+ public override Task<Document> ShowDocument ()
+ {
+ return Task.FromResult (DoShow ());
+ }
+
+ public override string DisplayName {
+ get {
+ return GettextCatalog.GetString ("Assembly Browser");
+ }
+ }
+
+ #endregion
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserViewContent.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserViewContent.cs
index c6ab4132c6..8c24cc2b07 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserViewContent.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserViewContent.cs
@@ -27,33 +27,33 @@
//
using MonoDevelop.Ide.Gui;
-using MonoDevelop.Refactoring;
using System;
using ICSharpCode.NRefactory.TypeSystem;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Navigation;
using MonoDevelop.Projects;
-using System.Linq;
-using MonoDevelop.Ide;
+using System.Collections.Generic;
+using System.Threading.Tasks;
namespace MonoDevelop.AssemblyBrowser
{
- class AssemblyBrowserViewContent : AbstractViewContent, IOpenNamedElementHandler, INavigable
+ class AssemblyBrowserViewContent : ViewContent, IOpenNamedElementHandler, INavigable
{
readonly static string[] defaultAssemblies = new string[] { "mscorlib", "System", "System.Core", "System.Xml" };
AssemblyBrowserWidget widget;
- protected override void OnWorkbenchWindowChanged (EventArgs e)
+ protected override void OnWorkbenchWindowChanged ()
{
- base.OnWorkbenchWindowChanged (e);
+ base.OnWorkbenchWindowChanged ();
if (WorkbenchWindow != null) {
var toolbar = WorkbenchWindow.GetToolbar (this);
widget.SetToolbar (toolbar);
}
}
- public override Gtk.Widget Control {
+ public override Control Control {
get {
return widget;
}
@@ -72,12 +72,18 @@ namespace MonoDevelop.AssemblyBrowser
IsDisposed = false;
}
- public override void Load (string fileName)
+ public override Task Load (FileOpenInformation fileOpenInformation)
{
ContentName = GettextCatalog.GetString ("Assembly Browser");
- widget.AddReferenceByFileName (fileName);
+ widget.AddReferenceByFileName (fileOpenInformation.FileName);
+ return Task.FromResult (true);
}
-
+
+ internal void EnsureDefinitionsLoaded (List<AssemblyLoader> definitions)
+ {
+ widget.EnsureDefinitionsLoaded (definitions);
+ }
+
public override bool IsFile {
get {
return false;
@@ -94,44 +100,38 @@ namespace MonoDevelop.AssemblyBrowser
IsDisposed = true;
base.Dispose ();
widget = null;
- GC.Collect ();
+ if (Disposed != null)
+ Disposed (this, EventArgs.Empty);
}
+ internal event EventHandler Disposed;
+
#region INavigable implementation
public NavigationPoint BuildNavigationPoint ()
{
- return new AssemblyBrowserNavigationPoint ();
+ return widget.BuildNavigationPoint ();
}
#endregion
#region IUrlHandler implementation
- public void Open (INamedElement element)
+ public void Open (Microsoft.CodeAnalysis.ISymbol element, bool expandNode = true)
{
- var member = element as IUnresolvedEntity;
- if (member == null) {
- var entity = element as IMember;
- if (entity != null)
- member = entity.UnresolvedMember;
+ var url = element.OriginalDefinition.GetDocumentationCommentId ();//AssemblyBrowserWidget.GetIdString (member);
+ if (element.DeclaredAccessibility != Microsoft.CodeAnalysis.Accessibility.Public)
+ widget.PublicApiOnly = false;
+ widget.Open (url, expandNode: expandNode);
+ }
- }
- if (member == null) {
- var entity = element as IType;
- if (entity != null)
- member = entity.GetDefinition ().Parts [0];
- }
- if (member == null)
- return;
- var url = AssemblyBrowserWidget.GetIdString (member);
- try {
- widget.Open (url);
- } catch (Exception e) {
- MessageService.ShowError (GettextCatalog.GetString ("{0} could not be opened", url), e);
- }
+ public void Open (string documentationCommentId, bool openInPublicOnlyMode = true, bool expandNode = true)
+ {
+ if (!openInPublicOnlyMode)
+ widget.PublicApiOnly = false;
+ widget.Open (documentationCommentId, expandNode: expandNode);
}
-
+
#endregion
[MonoDevelop.Components.Commands.CommandHandler(MonoDevelop.Refactoring.RefactoryCommands.FindReferences)]
@@ -140,7 +140,7 @@ namespace MonoDevelop.AssemblyBrowser
var member = widget.ActiveMember as IMember;
if (member == null)
return;
- FindReferencesHandler.FindRefs (member);
+ // FindReferencesHandler.FindRefs (member);
}
[MonoDevelop.Components.Commands.CommandHandler(MonoDevelop.Refactoring.RefactoryCommands.FindDerivedClasses)]
@@ -149,10 +149,10 @@ namespace MonoDevelop.AssemblyBrowser
var type = widget.ActiveMember as ITypeDefinition;
if (type == null)
return;
- FindDerivedClassesHandler.FindDerivedClasses (type);
+ //FindDerivedClassesHandler.FindDerivedClasses (type);
}
- public void FillWidget ()
+ public async void FillWidget ()
{
if (Ide.IdeApp.ProjectOperations.CurrentSelectedSolution == null) {
foreach (var assembly in defaultAssemblies) {
@@ -165,7 +165,7 @@ namespace MonoDevelop.AssemblyBrowser
var netProject = project as DotNetProject;
if (netProject == null)
continue;
- foreach (string file in netProject.GetReferencedAssemblies (ConfigurationSelector.Default, false)) {
+ foreach (string file in await netProject.GetReferencedAssemblies (ConfigurationSelector.Default, false)) {
if (!System.IO.File.Exists (file))
continue;
Widget.AddReferenceByFileName (file);
@@ -175,37 +175,5 @@ namespace MonoDevelop.AssemblyBrowser
}
}
- class AssemblyBrowserNavigationPoint : NavigationPoint
- {
- static Document DoShow ()
- {
- foreach (var view in Ide.IdeApp.Workbench.Documents) {
- if (view.GetContent<AssemblyBrowserViewContent> () != null) {
- view.Window.SelectWindow ();
- return view;
- }
- }
-
- var binding = DisplayBindingService.GetBindings<AssemblyBrowserDisplayBinding> ().FirstOrDefault ();
- var assemblyBrowserView = binding != null ? binding.GetViewContent () : new AssemblyBrowserViewContent ();
- assemblyBrowserView.FillWidget ();
-
- return Ide.IdeApp.Workbench.OpenDocument (assemblyBrowserView, true);
- }
-
- #region implemented abstract members of NavigationPoint
-
- public override Document ShowDocument ()
- {
- return DoShow ();
- }
-
- public override string DisplayName {
- get {
- return GettextCatalog.GetString ("Assembly Browser");
- }
- }
- #endregion
- }
}
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs
index c1401c7094..ebbdb39a3a 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyBrowserWidget.cs
@@ -40,28 +40,32 @@ using MonoDevelop.Ide;
using MonoDevelop.Ide.Commands;
using MonoDevelop.Ide.Gui.Components;
using System.Linq;
-using Mono.TextEditor;
using MonoDevelop.Ide.TypeSystem;
using ICSharpCode.NRefactory.Documentation;
using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Projects;
using ICSharpCode.NRefactory.TypeSystem.Implementation;
-using Mono.TextEditor.Theatrics;
-using MonoDevelop.SourceEditor;
using XmlDocIdLib;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Components;
using System.Threading.Tasks;
using System.Threading;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Navigation;
+using MonoDevelop.Ide.Gui.Content;
+using System.IO;
namespace MonoDevelop.AssemblyBrowser
{
+ enum SearchMemberState {
+ TypesAndMembers,
+ Types,
+ Members
+ }
[System.ComponentModel.Category("MonoDevelop.AssemblyBrowser")]
[System.ComponentModel.ToolboxItem(true)]
partial class AssemblyBrowserWidget : Gtk.Bin
{
- Gtk.Button buttonBack;
- Gtk.Button buttonForeward;
Gtk.ComboBox comboboxVisibilty;
MonoDevelop.Components.SearchEntry searchentry1;
Gtk.ComboBox languageCombobox;
@@ -75,11 +79,9 @@ namespace MonoDevelop.AssemblyBrowser
get {
return TreeView.PublicApiOnly;
}
- }
-
- Ambience ambience = AmbienceService.GetAmbience ("text/x-csharp");
- public Ambience Ambience {
- get { return ambience; }
+ set {
+ comboboxVisibilty.Active = value ? 0 : 1;
+ }
}
DocumentationPanel documentationPanel = new DocumentationPanel ();
@@ -111,23 +113,93 @@ namespace MonoDevelop.AssemblyBrowser
}
}
- public AssemblyBrowserWidget ()
+ static string GetLink (ReferenceSegment referencedSegment, out bool? isNotPublic)
{
- this.Build ();
+ isNotPublic = null;
+ if (referencedSegment == null)
+ return null;
+
+ var td = referencedSegment.Reference as TypeDefinition;
+ if (td != null) {
+ isNotPublic = !td.IsPublic;
+ return new XmlDocIdGenerator ().GetXmlDocPath ((TypeDefinition)referencedSegment.Reference);
+ }
+ var md = referencedSegment.Reference as MethodDefinition;
+ if (md != null) {
+ isNotPublic = !md.IsPublic;
+ return new XmlDocIdGenerator ().GetXmlDocPath ((MethodDefinition)referencedSegment.Reference);
+ }
- buttonBack = new Gtk.Button (ImageService.GetImage ("md-breadcrumb-prev", Gtk.IconSize.Menu));
- buttonBack.Clicked += OnNavigateBackwardActionActivated;
+ var pd = referencedSegment.Reference as PropertyDefinition;
+ if (pd != null) {
+ isNotPublic = (pd.GetMethod == null || !pd.GetMethod.IsPublic) &&
+ (pd.SetMethod == null || !pd.SetMethod.IsPublic);
+ return new XmlDocIdGenerator ().GetXmlDocPath ((PropertyDefinition)referencedSegment.Reference);
+ }
- buttonForeward = new Gtk.Button (ImageService.GetImage ("md-breadcrumb-next", Gtk.IconSize.Menu));
- buttonForeward.Clicked += OnNavigateForwardActionActivated;
+ var fd = referencedSegment.Reference as FieldDefinition;
+ if (fd != null) {
+ isNotPublic = !fd.IsPublic;
+ return new XmlDocIdGenerator ().GetXmlDocPath ((FieldDefinition)referencedSegment.Reference);
+ }
+
+ var ed = referencedSegment.Reference as EventDefinition;
+ if (ed != null) {
+ return new XmlDocIdGenerator ().GetXmlDocPath ((EventDefinition)referencedSegment.Reference);
+ }
+
+ var tref = referencedSegment.Reference as MemberReference;
+ if (tref != null) {
+ return new XmlDocIdGenerator ().GetXmlDocPath (tref);
+ }
+
+ return referencedSegment.Reference.ToString ();
+ }
+
+ class FastNonInterningProvider : InterningProvider
+ {
+ Dictionary<string, string> stringDict = new Dictionary<string, string>();
+
+ public override string Intern (string text)
+ {
+ if (text == null)
+ return null;
+
+ string output;
+ if (stringDict.TryGetValue(text, out output))
+ return output;
+ stringDict [text] = text;
+ return text;
+ }
+
+ public override ISupportsInterning Intern (ISupportsInterning obj)
+ {
+ return obj;
+ }
+
+ public override IList<T> InternList<T>(IList<T> list)
+ {
+ return list;
+ }
+
+ public override object InternValue (object obj)
+ {
+ return obj;
+ }
+ }
+
+ public AssemblyBrowserWidget ()
+ {
+ this.Build ();
comboboxVisibilty = ComboBox.NewText ();
comboboxVisibilty.InsertText (0, GettextCatalog.GetString ("Only public members"));
comboboxVisibilty.InsertText (1, GettextCatalog.GetString ("All members"));
- comboboxVisibilty.Active = 0;
+ comboboxVisibilty.Active = Math.Min (1, Math.Max (0, PropertyService.Get ("AssemblyBrowser.MemberSelection", 0)));
comboboxVisibilty.Changed += delegate {
TreeView.PublicApiOnly = comboboxVisibilty.Active == 0;
- FillInspectLabel ();
+ PropertyService.Set ("AssemblyBrowser.MemberSelection", comboboxVisibilty.Active);
+ FillInspectLabel ();
};
searchentry1 = new MonoDevelop.Components.SearchEntry ();
@@ -135,36 +207,58 @@ namespace MonoDevelop.AssemblyBrowser
searchentry1.HasFrame = true;
searchentry1.WidthRequest = 200;
searchentry1.Visible = true;
- searchentry1.EmptyMessage = GettextCatalog.GetString ("Search for types or members");
+ UpdateSearchEntryMessage ();
searchentry1.InnerEntry.Changed += SearchEntryhandleChanged;
- CheckMenuItem checkMenuItem = this.searchentry1.AddFilterOption (0, GettextCatalog.GetString ("Types"));
- checkMenuItem.Active = true;
+ CheckMenuItem checkMenuItem = this.searchentry1.AddFilterOption (0, GettextCatalog.GetString ("Types and Members"));
+ checkMenuItem.Active = PropertyService.Get ("AssemblyBrowser.SearchMemberState", SearchMemberState.TypesAndMembers) == SearchMemberState.TypesAndMembers;
checkMenuItem.Toggled += delegate {
if (checkMenuItem.Active) {
+ searchMode = AssemblyBrowserWidget.SearchMode.TypeAndMembers;
+ CreateColumns ();
+ StartSearch ();
+ }
+ if (checkMenuItem.Active)
+ PropertyService.Set ("AssemblyBrowser.SearchMemberState", SearchMemberState.TypesAndMembers);
+ UpdateSearchEntryMessage ();
+ };
+
+ CheckMenuItem checkMenuItem2 = this.searchentry1.AddFilterOption (0, GettextCatalog.GetString ("Types"));
+ checkMenuItem2.Active = PropertyService.Get ("AssemblyBrowser.SearchMemberState", SearchMemberState.TypesAndMembers) == SearchMemberState.Types;
+ checkMenuItem2.Toggled += delegate {
+ if (checkMenuItem2.Active) {
searchMode = AssemblyBrowserWidget.SearchMode.Type;
CreateColumns ();
StartSearch ();
}
+ if (checkMenuItem.Active)
+ PropertyService.Set ("AssemblyBrowser.SearchMemberState", SearchMemberState.Types);
+ UpdateSearchEntryMessage ();
};
CheckMenuItem checkMenuItem1 = this.searchentry1.AddFilterOption (1, GettextCatalog.GetString ("Members"));
+ checkMenuItem.Active = PropertyService.Get ("AssemblyBrowser.SearchMemberState", SearchMemberState.TypesAndMembers) == SearchMemberState.Members;
checkMenuItem1.Toggled += delegate {
if (checkMenuItem1.Active) {
searchMode = AssemblyBrowserWidget.SearchMode.Member;
CreateColumns ();
StartSearch ();
}
+ if (checkMenuItem.Active)
+ PropertyService.Set ("AssemblyBrowser.SearchMemberState", SearchMemberState.Members);
+ UpdateSearchEntryMessage ();
+
};
languageCombobox = Gtk.ComboBox.NewText ();
languageCombobox.AppendText (GettextCatalog.GetString ("Summary"));
languageCombobox.AppendText (GettextCatalog.GetString ("IL"));
languageCombobox.AppendText (GettextCatalog.GetString ("C#"));
- languageCombobox.Active = Math.Min (0, PropertyService.Get ("AssemblyBrowser.Language", 0));
+ languageCombobox.Active = Math.Min (2, Math.Max (0, PropertyService.Get ("AssemblyBrowser.Language", 0)));
languageCombobox.Changed += LanguageComboboxhandleChanged;
-
+#pragma warning disable 618
loader = new CecilLoader (true);
+ loader.InterningProvider = new FastNonInterningProvider ();
loader.IncludeInternalMembers = true;
TreeView = new AssemblyBrowserTreeView (new NodeBuilder[] {
new ErrorNodeBuilder (),
@@ -184,12 +278,9 @@ namespace MonoDevelop.AssemblyBrowser
new BaseTypeFolderNodeBuilder (this),
new BaseTypeNodeBuilder (this)
}, new TreePadOption [0]);
- TreeView.Tree.Selection.Mode = Gtk.SelectionMode.Single;
- TreeView.Tree.CursorChanged += HandleCursorChanged;
- TreeView.ShadowType = ShadowType.None;
- TreeView.BorderWidth = 1;
- TreeView.ShowBorderLine = false;
- TreeView.Zoom = 1.0;
+ TreeView.PublicApiOnly = comboboxVisibilty.Active == 0;
+ TreeView.AllowsMultipleSelection = false;
+ TreeView.SelectionChanged += HandleCursorChanged;
treeViewPlaceholder.Add (TreeView);
@@ -198,48 +289,17 @@ namespace MonoDevelop.AssemblyBrowser
// this.documentationLabel.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (255, 255, 225));
// this.documentationLabel.Wrap = true;
- var options = new MonoDevelop.Ide.Gui.CommonTextEditorOptions () {
- ShowFoldMargin = false,
- ShowIconMargin = false,
- ShowLineNumberMargin = false,
- HighlightCaretLine = true,
- };
- inspectEditor = new TextEditor (new TextDocument (), options);
- inspectEditor.ButtonPressEvent += HandleInspectEditorButtonPressEvent;
+
+ inspectEditor = TextEditorFactory.CreateNewEditor ();
+ inspectEditor.Options = DefaultSourceEditorOptions.PlainEditor;
+
+ //inspectEditor.ButtonPressEvent += HandleInspectEditorButtonPressEvent;
- this.inspectEditor.Document.ReadOnly = true;
+ this.inspectEditor.IsReadOnly = true;
// this.inspectEditor.Document.SyntaxMode = new Mono.TextEditor.Highlighting.MarkupSyntaxMode ();
- this.inspectEditor.TextViewMargin.GetLink = delegate(Mono.TextEditor.MarginMouseEventArgs arg) {
- var loc = inspectEditor.PointToLocation (arg.X, arg.Y);
- int offset = inspectEditor.LocationToOffset (loc);
- var referencedSegment = ReferencedSegments != null ? ReferencedSegments.FirstOrDefault (seg => seg.Segment.Contains (offset)) : null;
- if (referencedSegment == null)
- return null;
- if (referencedSegment.Reference is TypeDefinition)
- return new XmlDocIdGenerator ().GetXmlDocPath ((TypeDefinition)referencedSegment.Reference);
-
- if (referencedSegment.Reference is MethodDefinition)
- return new XmlDocIdGenerator ().GetXmlDocPath ((MethodDefinition)referencedSegment.Reference);
-
- if (referencedSegment.Reference is PropertyDefinition)
- return new XmlDocIdGenerator ().GetXmlDocPath ((PropertyDefinition)referencedSegment.Reference);
-
- if (referencedSegment.Reference is FieldDefinition)
- return new XmlDocIdGenerator ().GetXmlDocPath ((FieldDefinition)referencedSegment.Reference);
-
- if (referencedSegment.Reference is EventDefinition)
- return new XmlDocIdGenerator ().GetXmlDocPath ((EventDefinition)referencedSegment.Reference);
-
- if (referencedSegment.Reference is FieldDefinition)
- return new XmlDocIdGenerator ().GetXmlDocPath ((FieldDefinition)referencedSegment.Reference);
+// this.inspectEditor.LinkRequest += InspectEditorhandleLinkRequest;
- if (referencedSegment.Reference is TypeReference) {
- return new XmlDocIdGenerator ().GetXmlDocPath ((TypeReference)referencedSegment.Reference);
- }
- return referencedSegment.Reference.ToString ();
- };
- this.inspectEditor.LinkRequest += InspectEditorhandleLinkRequest;
- documentationScrolledWindow.Add (inspectEditor);
+ documentationScrolledWindow.PackStart (inspectEditor, true, true, 0);
this.hpaned1.ExposeEvent += HPaneExpose;
hpaned1 = hpaned1.ReplaceWithWidget (new HPanedThin (), true);
@@ -270,14 +330,26 @@ namespace MonoDevelop.AssemblyBrowser
this.ShowAll ();
}
- internal void SetToolbar (DocumentToolbar toolbar)
+ void UpdateSearchEntryMessage ()
{
- toolbar.Add (buttonBack);
-
- toolbar.Add (buttonForeward);
+ switch (PropertyService.Get ("AssemblyBrowser.SearchMemberState", SearchMemberState.TypesAndMembers)) {
+ case SearchMemberState.TypesAndMembers:
+ searchentry1.EmptyMessage = GettextCatalog.GetString ("Search for types and members");
+ break;
+ case SearchMemberState.Types:
+ searchentry1.EmptyMessage = GettextCatalog.GetString ("Search for types");
+ break;
+ case SearchMemberState.Members:
+ searchentry1.EmptyMessage = GettextCatalog.GetString ("Search for members");
+ break;
+ default:
+ throw new ArgumentOutOfRangeException ();
+ }
- toolbar.Add (new VSeparator ());
+ }
+ internal void SetToolbar (DocumentToolbar toolbar)
+ {
Gtk.Label la = new Label (GettextCatalog.GetString ("Visibility"));
toolbar.Add (la);
@@ -299,13 +371,13 @@ namespace MonoDevelop.AssemblyBrowser
[CommandHandler (EditCommands.Copy)]
protected void OnCopyCommand ()
{
- inspectEditor.RunAction (Mono.TextEditor.ClipboardActions.Copy);
+ EditActions.ClipboardCopy (inspectEditor);
}
[CommandHandler (EditCommands.SelectAll)]
protected void OnSelectAllCommand ()
{
- inspectEditor.RunAction (Mono.TextEditor.SelectionActions.SelectAll);
+ EditActions.SelectAll (inspectEditor);
}
void HandleInspectEditorButtonPressEvent (object o, ButtonPressEventArgs args)
@@ -322,8 +394,8 @@ namespace MonoDevelop.AssemblyBrowser
{
TreeIter selectedIter;
if (searchTreeview.Selection.GetSelected (out selectedIter)) {
- var member = (IUnresolvedEntity)(searchMode != SearchMode.Type ? memberListStore.GetValue (selectedIter, 4) : typeListStore.GetValue (selectedIter, 4));
-
+ var member = (IUnresolvedEntity)(searchMode == SearchMode.Member ? memberListStore.GetValue (selectedIter, 4) : typeListStore.GetValue (selectedIter, 4));
+
var nav = SearchMember (member);
if (nav != null) {
notebook1.Page = 0;
@@ -343,22 +415,7 @@ namespace MonoDevelop.AssemblyBrowser
FillInspectLabel ();
}
- void InspectEditorhandleLinkRequest (object sender, Mono.TextEditor.LinkEventArgs args)
- {
- var loader = (AssemblyLoader)this.TreeView.GetSelectedNode ().GetParentDataItem (typeof(AssemblyLoader), true);
- if (args.Button == 2 || (args.Button == 1 && (args.ModifierState & Gdk.ModifierType.ShiftMask) == Gdk.ModifierType.ShiftMask)) {
- AssemblyBrowserViewContent assemblyBrowserView = new AssemblyBrowserViewContent ();
- foreach (var cu in definitions) {
- assemblyBrowserView.Load (cu.UnresolvedAssembly.AssemblyName);
- }
- IdeApp.Workbench.OpenDocument (assemblyBrowserView, true);
- ((AssemblyBrowserWidget)assemblyBrowserView.Control).Open (args.Link);
- } else {
- this.Open (args.Link, loader);
- }
- }
-
public IEntity ActiveMember {
get;
set;
@@ -370,20 +427,20 @@ namespace MonoDevelop.AssemblyBrowser
TreeView.GrabFocus ();
}
- ITreeNavigator SearchMember (IUnresolvedEntity member)
+ ITreeNavigator SearchMember (IUnresolvedEntity member, bool expandNode = true)
{
- return SearchMember (GetIdString (member));
+ return SearchMember (GetIdString (member), expandNode);
}
- ITreeNavigator SearchMember (string helpUrl)
+ ITreeNavigator SearchMember (string helpUrl, bool expandNode = true)
{
- var nav = SearchMember (TreeView.GetRootNode (), helpUrl);
+ var nav = SearchMember (TreeView.GetRootNode (), helpUrl, expandNode);
if (nav != null)
return nav;
// Constructor may be a generated default without implementation.
var ctorIdx = helpUrl.IndexOf (".#ctor", StringComparison.Ordinal);
if (helpUrl.StartsWith ("M:", StringComparison.Ordinal) && ctorIdx > 0) {
- return SearchMember ("T" + helpUrl.Substring (1, ctorIdx - 1));
+ return SearchMember ("T" + helpUrl.Substring (1, ctorIdx - 1), expandNode);
}
return null;
}
@@ -441,9 +498,9 @@ namespace MonoDevelop.AssemblyBrowser
if (p == null)
continue;
AppendTypeReference (result, p.Type);
- if (p.IsRef)
+ if (p.IsOut)
result.Append ("&");
- if (p.IsOut) {
+ if (p.IsRef) {
result.Append ("@");
}
}
@@ -456,7 +513,7 @@ namespace MonoDevelop.AssemblyBrowser
StringBuilder sb;
switch (member.SymbolKind) {
- case SymbolKind.TypeDefinition:
+ case ICSharpCode.NRefactory.TypeSystem.SymbolKind.TypeDefinition:
var type = member as IUnresolvedTypeDefinition;
if (type.TypeParameters.Count == 0)
return "T:" + type.FullName;
@@ -583,7 +640,7 @@ namespace MonoDevelop.AssemblyBrowser
return false;
}
- ITreeNavigator SearchMember (ITreeNavigator nav, string helpUrl)
+ ITreeNavigator SearchMember (ITreeNavigator nav, string helpUrl, bool expandNode = true)
{
if (nav == null)
return null;
@@ -592,13 +649,18 @@ namespace MonoDevelop.AssemblyBrowser
if (IsMatch (nav, helpUrl, searchType)) {
inspectEditor.ClearSelection ();
nav.ExpandToNode ();
- nav.Selected = nav.Expanded = true;
- nav.ScrollToNode ();
+ if (expandNode) {
+ nav.Selected = nav.Expanded = true;
+ nav.ScrollToNode ();
+ } else {
+ nav.Selected = true;
+ nav.ScrollToNode ();
+ }
return nav;
}
if (!SkipChildren (nav, helpUrl, searchType) && nav.HasChildren ()) {
nav.MoveToFirstChild ();
- ITreeNavigator result = SearchMember (nav, helpUrl);
+ ITreeNavigator result = SearchMember (nav, helpUrl, expandNode);
if (result != null)
return result;
@@ -608,7 +670,7 @@ namespace MonoDevelop.AssemblyBrowser
try {
if (nav.DataItem is TypeDefinition && PublicApiOnly) {
nav.MoveToFirstChild ();
- result = SearchMember (nav, helpUrl);
+ result = SearchMember (nav, helpUrl, expandNode);
if (result != null)
return result;
nav.MoveToParent ();
@@ -625,7 +687,8 @@ namespace MonoDevelop.AssemblyBrowser
Type = 0,
Member = 1,
Disassembler = 2,
- Decompiler = 3
+ Decompiler = 3,
+ TypeAndMembers = 4
}
SearchMode searchMode = SearchMode.Type;
@@ -651,14 +714,40 @@ namespace MonoDevelop.AssemblyBrowser
col.PackStart (crt, true);
col.AddAttribute (crp, "image", 0);
col.AddAttribute (crt, "text", 1);
+ col.SortColumnId = 1;
searchTreeview.AppendColumn (col);
col.Resizable = true;
col = searchTreeview.AppendColumn (GettextCatalog.GetString ("Declaring Type"), new Gtk.CellRendererText (), "text", 2);
+ col.SortColumnId = 2;
col.Resizable = true;
col = searchTreeview.AppendColumn (GettextCatalog.GetString ("Assembly"), new Gtk.CellRendererText (), "text", 3);
+ col.SortColumnId = 3;
col.Resizable = true;
searchTreeview.Model = memberListStore;
break;
+ case SearchMode.TypeAndMembers:
+ col = new TreeViewColumn ();
+ col.Title = GettextCatalog.GetString ("Results");
+ crp = new CellRendererImage ();
+ crt = new Gtk.CellRendererText ();
+ col.PackStart (crp, false);
+ col.PackStart (crt, true);
+ col.AddAttribute (crp, "image", 0);
+ col.AddAttribute (crt, "text", 1);
+ col.SortColumnId = 1;
+
+ searchTreeview.AppendColumn (col);
+ col.Resizable = true;
+ col = searchTreeview.AppendColumn (GettextCatalog.GetString ("Parent"), new Gtk.CellRendererText (), "text", 2);
+ col.SortColumnId = 2;
+
+ col.Resizable = true;
+ col = searchTreeview.AppendColumn (GettextCatalog.GetString ("Assembly"), new Gtk.CellRendererText (), "text", 3);
+ col.SortColumnId = 3;
+
+ col.Resizable = true;
+ searchTreeview.Model = typeListStore;
+ break;
case SearchMode.Type:
col = new TreeViewColumn ();
col.Title = GettextCatalog.GetString ("Type");
@@ -668,11 +757,16 @@ namespace MonoDevelop.AssemblyBrowser
col.PackStart (crt, true);
col.AddAttribute (crp, "image", 0);
col.AddAttribute (crt, "text", 1);
+ col.SortColumnId = 1;
searchTreeview.AppendColumn (col);
col.Resizable = true;
+
col = searchTreeview.AppendColumn (GettextCatalog.GetString ("Namespace"), new Gtk.CellRendererText (), "text", 2);
+ col.SortColumnId = 2;
col.Resizable = true;
+
col = searchTreeview.AppendColumn (GettextCatalog.GetString ("Assembly"), new Gtk.CellRendererText (), "text", 3);
+ col.SortColumnId = 3;
col.Resizable = true;
searchTreeview.Model = typeListStore;
break;
@@ -706,6 +800,9 @@ namespace MonoDevelop.AssemblyBrowser
case SearchMode.Type:
IdeApp.Workbench.StatusBar.BeginProgress (GettextCatalog.GetString ("Searching type..."));
break;
+ case SearchMode.TypeAndMembers:
+ IdeApp.Workbench.StatusBar.BeginProgress (GettextCatalog.GetString ("Searching types and members..."));
+ break;
}
memberListStore.Clear ();
typeListStore.Clear ();
@@ -723,6 +820,7 @@ namespace MonoDevelop.AssemblyBrowser
void SearchDoWork (object sender, DoWorkEventArgs e)
{
+ var publicOnly = PublicApiOnly;
BackgroundWorker worker = sender as BackgroundWorker;
try {
string pattern = e.Argument.ToString ().ToUpper ();
@@ -738,10 +836,14 @@ namespace MonoDevelop.AssemblyBrowser
foreach (var type in unit.UnresolvedAssembly.TopLevelTypeDefinitions) {
if (worker.CancellationPending)
return;
+ if (!type.IsPublic && publicOnly)
+ continue;
curType++;
foreach (var member in type.Members) {
if (worker.CancellationPending)
return;
+ if (!member.IsPublic && publicOnly)
+ continue;
if (member.Name.ToUpper ().Contains (pattern)) {
members.Add (member);
}
@@ -837,7 +939,9 @@ namespace MonoDevelop.AssemblyBrowser
foreach (var type in unit.UnresolvedAssembly.TopLevelTypeDefinitions) {
if (worker.CancellationPending)
return;
- if (type.FullName.ToUpper ().IndexOf (pattern) >= 0)
+ if (!type.IsPublic && publicOnly)
+ continue;
+ if (type.FullName.ToUpper ().IndexOf (pattern, StringComparison.Ordinal) >= 0)
typeList.Add (type);
}
typeDict [unit] = typeList;
@@ -857,10 +961,54 @@ namespace MonoDevelop.AssemblyBrowser
});
break;
+ case SearchMode.TypeAndMembers:
+ var typeDict2 = new Dictionary<AssemblyLoader, List<Tuple<IUnresolvedEntity, string>>> ();
+ foreach (var unit in this.definitions) {
+ var typeList = new List<Tuple<IUnresolvedEntity, string>> ();
+ foreach (var type in unit.UnresolvedAssembly.TopLevelTypeDefinitions) {
+ if (worker.CancellationPending)
+ return;
+ if (!type.IsPublic && publicOnly)
+ continue;
+ var parent = type.FullName;
+ if (parent.ToUpper ().IndexOf (pattern, StringComparison.Ordinal) >= 0)
+ typeList.Add (Tuple.Create ((IUnresolvedEntity)type, type.Namespace));
+
+ foreach (var member in type.Members) {
+ if (worker.CancellationPending)
+ return;
+ if (!member.IsPublic && publicOnly)
+ continue;
+ if (member.Name.ToUpper ().Contains (pattern)) {
+ typeList.Add (Tuple.Create ((IUnresolvedEntity)member, parent));
+ }
+ }
+
+ }
+ typeDict2 [unit] = typeList;
+ }
+
+ Gtk.Application.Invoke (delegate {
+ foreach (var kv in typeDict2) {
+ foreach (var tuple in kv.Value) {
+ if (worker.CancellationPending)
+ return;
+ var type = tuple.Item1;
+ typeListStore.AppendValues (ImageService.GetIcon (type.GetStockIcon (), Gtk.IconSize.Menu),
+ type.Name,
+ tuple.Item2,
+ kv.Key.Assembly.FullName,
+ type);
+ }
+ }
+ });
+
+ break;
}
} finally {
Gtk.Application.Invoke (delegate {
IdeApp.Workbench.StatusBar.EndProgress ();
+ IdeApp.Workbench.StatusBar.ShowReady ();
});
}
}
@@ -1066,34 +1214,62 @@ namespace MonoDevelop.AssemblyBrowser
return result.ToString ();
}
-
+
List<ReferenceSegment> ReferencedSegments = new List<ReferenceSegment>();
- List<UnderlineMarker> underlineMarkers = new List<UnderlineMarker> ();
+ List<ITextSegmentMarker> underlineMarkers = new List<ITextSegmentMarker> ();
public void ClearReferenceSegment ()
{
ReferencedSegments = null;
- underlineMarkers.ForEach (m => inspectEditor.Document.RemoveMarker (m));
+ underlineMarkers.ForEach (m => inspectEditor.RemoveMarker (m));
underlineMarkers.Clear ();
}
- public void SetReferencedSegments (List<ReferenceSegment> refs)
+ internal void SetReferencedSegments (List<ReferenceSegment> refs)
{
ReferencedSegments = refs;
if (ReferencedSegments == null)
return;
- foreach (var seg in refs) {
- DocumentLine line = inspectEditor.GetLineByOffset (seg.Offset);
+ foreach (var _seg in refs) {
+ var seg = _seg;
+ var line = inspectEditor.GetLineByOffset (seg.Offset);
if (line == null)
continue;
// FIXME: ILSpy sometimes gives reference segments for punctuation. See http://bugzilla.xamarin.com/show_bug.cgi?id=2918
- string text = inspectEditor.GetTextAt (seg);
+ string text = inspectEditor.GetTextAt (seg.Offset, seg.Length);
if (text != null && text.Length == 1 && !(char.IsLetter (text [0]) || text [0] == '…'))
continue;
- var marker = new UnderlineMarker (new Cairo.Color (0, 0, 1.0), 1 + seg.Offset - line.Offset, 1 + seg.EndOffset - line.Offset);
- marker.Wave = false;
+ var marker = TextMarkerFactory.CreateLinkMarker (inspectEditor, seg.Offset, seg.Length, delegate (LinkRequest request) {
+ bool? isNotPublic;
+ var link = GetLink (seg, out isNotPublic);
+ if (link == null)
+ return;
+ if (isNotPublic.HasValue) {
+ if (isNotPublic.Value) {
+ PublicApiOnly = false;
+ }
+ } else {
+ // unable to determine if the member is public or not (in case of member references) -> try to search
+ var nav = SearchMember (link, false);
+ if (nav == null)
+ PublicApiOnly = false;
+ }
+ var loader = (AssemblyLoader)this.TreeView.GetSelectedNode ().GetParentDataItem (typeof(AssemblyLoader), true);
+ // args.Button == 2 || (args.Button == 1 && (args.ModifierState & Gdk.ModifierType.ShiftMask) == Gdk.ModifierType.ShiftMask)
+ if (request == LinkRequest.RequestNewView) {
+ AssemblyBrowserViewContent assemblyBrowserView = new AssemblyBrowserViewContent ();
+ foreach (var cu in definitions) {
+ assemblyBrowserView.Load (cu.UnresolvedAssembly.AssemblyName);
+ }
+ IdeApp.Workbench.OpenDocument (assemblyBrowserView, true);
+ ((AssemblyBrowserWidget)assemblyBrowserView.Control).Open (link);
+ } else {
+ this.Open (link, loader);
+ }
+ });
+ marker.OnlyShowLinkOnHover = true;
underlineMarkers.Add (marker);
- inspectEditor.Document.AddMarker (line, marker);
+ inspectEditor.AddMarker (marker);
}
}
@@ -1104,34 +1280,33 @@ namespace MonoDevelop.AssemblyBrowser
return;
IAssemblyBrowserNodeBuilder builder = nav.TypeNodeBuilder as IAssemblyBrowserNodeBuilder;
if (builder == null) {
- this.inspectEditor.Document.Text = "";
+ this.inspectEditor.Text = "";
return;
}
ClearReferenceSegment ();
- inspectEditor.Document.ClearFoldSegments ();
+ inspectEditor.SetFoldings (Enumerable.Empty<IFoldSegment> ());
switch (this.languageCombobox.Active) {
case 0:
- inspectEditor.Options.ShowFoldMargin = true;
- this.inspectEditor.Document.MimeType = "text/x-csharp";
- SetReferencedSegments (builder.GetSummary (inspectEditor.GetTextEditorData (), nav, PublicApiOnly));
+ inspectEditor.Options = DefaultSourceEditorOptions.PlainEditor;
+ this.inspectEditor.MimeType = "text/x-csharp";
+ SetReferencedSegments (builder.GetSummary (inspectEditor, nav, PublicApiOnly));
break;
case 1:
- inspectEditor.Options.ShowFoldMargin = true;
- this.inspectEditor.Document.MimeType = "text/x-ilasm";
- SetReferencedSegments (builder.Disassemble (inspectEditor.GetTextEditorData (), nav));
+ inspectEditor.Options = DefaultSourceEditorOptions.PlainEditor;
+ this.inspectEditor.MimeType = "text/x-ilasm";
+ SetReferencedSegments (builder.Disassemble (inspectEditor, nav));
break;
case 2:
- inspectEditor.Options.ShowFoldMargin = true;
- this.inspectEditor.Document.MimeType = "text/x-csharp";
- SetReferencedSegments (builder.Decompile (inspectEditor.GetTextEditorData (), nav, PublicApiOnly));
+ inspectEditor.Options = DefaultSourceEditorOptions.PlainEditor;
+ this.inspectEditor.MimeType = "text/x-csharp";
+ SetReferencedSegments (builder.Decompile (inspectEditor, nav, PublicApiOnly));
break;
default:
- inspectEditor.Options.ShowFoldMargin = false;
- this.inspectEditor.Document.Text = "Invalid combobox value: " + this.languageCombobox.Active;
+ inspectEditor.Options = DefaultSourceEditorOptions.PlainEditor;
+ this.inspectEditor.Text = "Invalid combobox value: " + this.languageCombobox.Active;
break;
}
- this.inspectEditor.QueueDraw ();
}
void CreateOutput ()
@@ -1187,11 +1362,12 @@ namespace MonoDevelop.AssemblyBrowser
this.hpaned1.Position = Math.Min (350, this.Allocation.Width * 2 / 3);
}
- public void Open (string url, AssemblyLoader currentAssembly = null)
+ internal void Open (string url, AssemblyLoader currentAssembly = null, bool expandNode = true)
{
Task.WhenAll (this.definitions.Select (d => d.LoadingTask).ToArray ()).ContinueWith (d => {
Application.Invoke (delegate {
- ITreeNavigator nav = SearchMember (url);
+ suspendNavigation = false;
+ ITreeNavigator nav = SearchMember (url, expandNode);
if (definitions == null) // we've been disposed
return;
if (nav != null)
@@ -1209,7 +1385,7 @@ namespace MonoDevelop.AssemblyBrowser
});
}
- void OpenFromAssembly (string url, AssemblyLoader currentAssembly)
+ void OpenFromAssembly (string url, AssemblyLoader currentAssembly, bool expandNode = true)
{
var cecilObject = loader.GetCecilObject (currentAssembly.UnresolvedAssembly);
if (cecilObject == null)
@@ -1231,11 +1407,10 @@ namespace MonoDevelop.AssemblyBrowser
}
var result = AddReferenceByFileName (fileName);
result.LoadingTask.ContinueWith (t2 => {
- t2.Wait ();
if (definitions == null) // disposed
return;
Application.Invoke (delegate {
- var nav = SearchMember (url);
+ var nav = SearchMember (url, expandNode);
if (nav == null) {
if (++i == references.Count)
LoggingService.LogError ("Assembly browser: Can't find: " + url + ".");
@@ -1345,7 +1520,7 @@ namespace MonoDevelop.AssemblyBrowser
if (this.TreeView != null) {
// Dispose (TreeView.GetRootNode ());
- TreeView.Tree.CursorChanged -= HandleCursorChanged;
+ TreeView.SelectionChanged -= HandleCursorChanged;
this.TreeView.Clear ();
this.TreeView = null;
}
@@ -1372,11 +1547,11 @@ namespace MonoDevelop.AssemblyBrowser
documentationPanel.Destroy ();
documentationPanel = null;
}
- if (inspectEditor != null) {
- inspectEditor.TextViewMargin.GetLink = null;
- inspectEditor.LinkRequest -= InspectEditorhandleLinkRequest;
- inspectEditor.Destroy ();
- }
+// if (inspectEditor != null) {
+// inspectEditor.TextViewMargin.GetLink = null;
+// inspectEditor.LinkRequest -= InspectEditorhandleLinkRequest;
+// inspectEditor.Destroy ();
+// }
if (this.UIManager != null) {
this.UIManager.Dispose ();
@@ -1389,15 +1564,6 @@ namespace MonoDevelop.AssemblyBrowser
// this.searchEntry.Changed -= SearchEntryhandleChanged;
this.searchTreeview.RowActivated -= SearchTreeviewhandleRowActivated;
hpaned1.ExposeEvent -= HPaneExpose;
- if (NavigateBackwardAction != null) {
- this.NavigateBackwardAction.Dispose ();
- this.NavigateBackwardAction = null;
- }
-
- if (NavigateForwardAction != null) {
- this.NavigateForwardAction.Dispose ();
- this.NavigateForwardAction = null;
- }
base.OnDestroyed ();
}
@@ -1420,12 +1586,12 @@ namespace MonoDevelop.AssemblyBrowser
List<AssemblyLoader> definitions = new List<AssemblyLoader> ();
List<Project> projects = new List<Project> ();
- public AssemblyLoader AddReferenceByAssemblyName (AssemblyNameReference reference)
+ internal AssemblyLoader AddReferenceByAssemblyName (AssemblyNameReference reference)
{
return AddReferenceByAssemblyName (reference.Name);
}
- public AssemblyLoader AddReferenceByAssemblyName (string assemblyFullName)
+ internal AssemblyLoader AddReferenceByAssemblyName (string assemblyFullName)
{
string assemblyFile = Runtime.SystemAssemblyService.DefaultAssemblyContext.GetAssemblyLocation (assemblyFullName, null);
if (assemblyFile == null || !System.IO.File.Exists (assemblyFile)) {
@@ -1441,7 +1607,7 @@ namespace MonoDevelop.AssemblyBrowser
return AddReferenceByFileName (assemblyFile);
}
- public AssemblyLoader AddReferenceByFileName (string fileName)
+ internal AssemblyLoader AddReferenceByFileName (string fileName)
{
var result = definitions.FirstOrDefault (d => d.FileName == fileName);
if (result != null) {
@@ -1457,6 +1623,8 @@ namespace MonoDevelop.AssemblyBrowser
return result;
}
+ if (!File.Exists (fileName))
+ return null;
result = new AssemblyLoader (this, fileName);
definitions.Add (result);
@@ -1471,8 +1639,7 @@ namespace MonoDevelop.AssemblyBrowser
} else {
builder = TreeView.AddChild (result);
}
- TreeIter iter;
- if (!TreeView.Tree.Selection.GetSelected (out iter))
+ if (TreeView.GetSelectedNode () == null)
builder.Selected = builder.Expanded = true;
} catch (Exception e) {
LoggingService.LogError ("Error while adding assembly to the assembly list", e);
@@ -1510,131 +1677,47 @@ namespace MonoDevelop.AssemblyBrowser
builder.Selected = builder.Expanded = selectReference;
}
- [CommandHandler (SearchCommands.FindNext)]
- public void FindNext ()
- {
- SearchAndReplaceWidget.FindNext (this.inspectEditor);
- }
+ //MonoDevelop.Components.RoundedFrame popupWidgetFrame;
- [CommandHandler (SearchCommands.FindPrevious)]
- public void FindPrevious ()
- {
- SearchAndReplaceWidget.FindPrevious (this.inspectEditor);
- }
-
- [CommandHandler (SearchCommands.Find)]
- public void ShowSearchWidget ()
- {
- if (searchAndReplaceWidget == null) {
- popupWidgetFrame = new MonoDevelop.Components.RoundedFrame ();
- //searchAndReplaceWidgetFrame.SetFillColor (MonoDevelop.Components.CairoExtensions.GdkColorToCairoColor (widget.TextEditor.ColorStyle.Default.BackgroundColor));
- popupWidgetFrame.SetFillColor (MonoDevelop.Components.CairoExtensions.GdkColorToCairoColor (Style.Background (StateType.Normal)));
- popupWidgetFrame.Show ();
-
- popupWidgetFrame.Child = searchAndReplaceWidget = new SearchAndReplaceWidget (inspectEditor, popupWidgetFrame);
- searchAndReplaceWidget.Destroyed += (sender, e) => {
- DestroyFrames ();
- if (inspectEditor.IsRealized)
- inspectEditor.GrabFocus ();
- };
- searchAndReplaceWidget.UpdateSearchPattern ();
- inspectEditor.AddAnimatedWidget (popupWidgetFrame, 300, Mono.TextEditor.Theatrics.Easing.ExponentialInOut, Blocking.Downstage, inspectEditor.Allocation.Width - 400, -searchAndReplaceWidget.Allocation.Height);
- searchAndReplaceWidget.IsReplaceMode = false;
- }
-
- searchAndReplaceWidget.Focus ();
- }
-
- MonoDevelop.Components.RoundedFrame popupWidgetFrame;
-
- GotoLineNumberWidget gotoLineNumberWidget;
- SearchAndReplaceWidget searchAndReplaceWidget;
- void DestroyFrames ()
- {
- if (popupWidgetFrame != null) {
- popupWidgetFrame.Destroy ();
- popupWidgetFrame = null;
- gotoLineNumberWidget = null;
- searchAndReplaceWidget = null;
- }
- }
-
- [CommandHandler (SearchCommands.GotoLineNumber)]
- public void ShowGotoLineNumberWidget ()
- {
- if (gotoLineNumberWidget == null) {
- DestroyFrames ();
- popupWidgetFrame = new MonoDevelop.Components.RoundedFrame ();
- //searchAndReplaceWidgetFrame.SetFillColor (MonoDevelop.Components.CairoExtensions.GdkColorToCairoColor (widget.TextEditor.ColorStyle.Default.BackgroundColor));
- popupWidgetFrame.SetFillColor (MonoDevelop.Components.CairoExtensions.GdkColorToCairoColor (Style.Background (StateType.Normal)));
- popupWidgetFrame.Show ();
-
- popupWidgetFrame.Child = gotoLineNumberWidget = new GotoLineNumberWidget (inspectEditor, popupWidgetFrame);
- gotoLineNumberWidget.Destroyed += (sender, e) => {
- DestroyFrames ();
- if (inspectEditor.IsRealized)
- inspectEditor.GrabFocus ();
- };
- inspectEditor.AddAnimatedWidget (popupWidgetFrame, 300, Mono.TextEditor.Theatrics.Easing.ExponentialInOut, Blocking.Downstage, inspectEditor.Allocation.Width - 400, -gotoLineNumberWidget.Allocation.Height);
- }
-
- gotoLineNumberWidget.Focus ();
- }
-
-
#region NavigationHistory
- Stack<ITreeNavigator> navigationBackwardHistory = new Stack<ITreeNavigator> ();
- Stack<ITreeNavigator> navigationForwardHistory = new Stack<ITreeNavigator> ();
- ITreeNavigator currentItem = null;
- bool inNavigationOperation = false;
+ internal bool suspendNavigation;
void HandleCursorChanged (object sender, EventArgs e)
{
- if (!inNavigationOperation) {
- if (currentItem != null)
- navigationBackwardHistory.Push (currentItem);
- currentItem = TreeView.GetSelectedNode ();
- ActiveMember = currentItem.DataItem as IEntity;
- navigationForwardHistory.Clear ();
+ if (!suspendNavigation) {
+ var selectedEntity = TreeView.GetSelectedNode ()?.DataItem as IUnresolvedEntity;
+ if (selectedEntity != null)
+ NavigationHistoryService.LogActiveDocument ();
}
notebook1.Page = 0;
- UpdateNavigationActions ();
CreateOutput ();
}
-
- void UpdateNavigationActions ()
- {
- if (buttonBack != null) {
- buttonBack.Sensitive = navigationBackwardHistory.Count != 0;
- buttonForeward.Sensitive = navigationForwardHistory.Count != 0;
- }
- }
-
- protected virtual void OnNavigateBackwardActionActivated (object sender, System.EventArgs e)
+
+ public NavigationPoint BuildNavigationPoint ()
{
- if (navigationBackwardHistory.Count == 0)
- return;
- inNavigationOperation = true;
- ITreeNavigator item = navigationBackwardHistory.Pop ();
- item.Selected = true;
- navigationForwardHistory.Push (currentItem);
- currentItem = item;
- inNavigationOperation = false;
- UpdateNavigationActions ();
+ var selectedEntity = TreeView.GetSelectedNode ()?.DataItem as IUnresolvedEntity;
+ if (selectedEntity == null)
+ return null;
+ return new AssemblyBrowserNavigationPoint (definitions, GetIdString (selectedEntity));
}
-
- protected virtual void OnNavigateForwardActionActivated (object sender, System.EventArgs e)
+ #endregion
+
+ internal void EnsureDefinitionsLoaded (List<AssemblyLoader> definitions)
{
- if (navigationForwardHistory.Count == 0)
- return;
- inNavigationOperation = true;
- ITreeNavigator item = navigationForwardHistory.Pop ();
- item.Selected = true;
- navigationBackwardHistory.Push (currentItem);
- currentItem = item;
- inNavigationOperation = false;
- UpdateNavigationActions ();
+ if (definitions == null)
+ throw new ArgumentNullException (nameof (definitions));
+ foreach (var def in definitions) {
+ if (!this.definitions.Contains (def)) {
+ this.definitions.Add (def);
+ Application.Invoke (delegate {
+ if (definitions.Count + projects.Count == 1) {
+ TreeView.LoadTree (def.LoadingTask.Result);
+ } else {
+ TreeView.AddChild (def.LoadingTask.Result);
+ }
+ });
+ }
+ }
}
- #endregion
}
}
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyLoader.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyLoader.cs
index d5859582ac..58f80337fa 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyLoader.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyLoader.cs
@@ -43,9 +43,9 @@ namespace MonoDevelop.AssemblyBrowser
private set;
}
- Task<AssemblyDefinition> assemblyLoaderTask;
+ Task<Tuple<AssemblyDefinition, IUnresolvedAssembly>> assemblyLoaderTask;
- public Task<AssemblyDefinition> LoadingTask {
+ public Task<Tuple<AssemblyDefinition, IUnresolvedAssembly>> LoadingTask {
get {
return assemblyLoaderTask;
}
@@ -56,46 +56,39 @@ namespace MonoDevelop.AssemblyBrowser
public AssemblyDefinition Assembly {
get {
- return assemblyLoaderTask.Result;
+ return assemblyLoaderTask.Result?.Item1;
}
}
-
- readonly Lazy<IUnresolvedAssembly> unresolvedAssembly;
+
public IUnresolvedAssembly UnresolvedAssembly {
get {
- return unresolvedAssembly.Value;
+ return assemblyLoaderTask.Result.Item2;
}
}
public AssemblyLoader (AssemblyBrowserWidget widget, string fileName)
{
if (widget == null)
- throw new ArgumentNullException ("widget");
+ throw new ArgumentNullException (nameof (widget));
if (fileName == null)
- throw new ArgumentNullException ("fileName");
+ throw new ArgumentNullException (nameof (fileName));
this.widget = widget;
- this.FileName = fileName;
+ FileName = fileName;
if (!File.Exists (fileName))
- throw new ArgumentException ("File doesn't exist.", "fileName");
- this.assemblyLoaderTask = Task.Factory.StartNew<AssemblyDefinition> (() => {
+ throw new ArgumentException ("File doesn't exist.", nameof (fileName));
+ assemblyLoaderTask = Task.Run (async () => {
try {
- return AssemblyDefinition.ReadAssembly (FileName, new ReaderParameters {
+ var asm = AssemblyDefinition.ReadAssembly (FileName, new ReaderParameters {
AssemblyResolver = this
});
+ var loadedAssembley = await Runtime.RunInMainThread (() => widget.CecilLoader.LoadAssembly (asm));
+
+ return Tuple.Create (asm, loadedAssembley);
} catch (Exception e) {
LoggingService.LogError ("Error while reading assembly " + FileName, e);
return null;
}
}, src.Token);
-
- this.unresolvedAssembly = new Lazy<IUnresolvedAssembly> (delegate {
- try {
- return widget.CecilLoader.LoadAssembly (Assembly);
- } catch (Exception e) {
- LoggingService.LogError ("Error while loading assembly", e);
- return new ICSharpCode.NRefactory.TypeSystem.Implementation.DefaultUnresolvedAssembly (FileName);
- }
- });
}
#region IAssemblyResolver implementation
@@ -127,7 +120,7 @@ namespace MonoDevelop.AssemblyBrowser
public string LookupAssembly (string fullAssemblyName)
{
var assemblyFile = Runtime.SystemAssemblyService.DefaultAssemblyContext.GetAssemblyLocation (fullAssemblyName, null);
- if (assemblyFile != null && System.IO.File.Exists (assemblyFile))
+ if (assemblyFile != null && File.Exists (assemblyFile))
return assemblyFile;
var name = AssemblyNameReference.Parse (fullAssemblyName);
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyReferenceFolder.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyReferenceFolder.cs
index 36912b98df..d0266fe485 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyReferenceFolder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/AssemblyReferenceFolder.cs
@@ -34,7 +34,6 @@ using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Pads;
using MonoDevelop.Ide.Gui.Components;
-using Mono.TextEditor;
using System.Collections.Generic;
using ICSharpCode.NRefactory.TypeSystem;
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/ColoredCSharpFormatter.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/ColoredCSharpFormatter.cs
index 05d9a3fbfc..e63acbb988 100755
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/ColoredCSharpFormatter.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/ColoredCSharpFormatter.cs
@@ -28,9 +28,10 @@ using ICSharpCode.NRefactory;
using System;
using System.Text;
using ICSharpCode.Decompiler;
-using Mono.TextEditor;
using System.Collections.Generic;
using System.Linq;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AssemblyBrowser
{
@@ -80,13 +81,13 @@ namespace MonoDevelop.AssemblyBrowser
class ColoredCSharpFormatter : ICSharpCode.Decompiler.ITextOutput
{
public StringBuilder sb = new StringBuilder();
- TextDocument doc;
+ TextEditor doc;
bool write_indent;
int indent;
- public List<FoldSegment> FoldSegments = new List<FoldSegment>();
+ public List<IFoldSegment> FoldSegments = new List<IFoldSegment>();
public List<ReferenceSegment> ReferencedSegments = new List<ReferenceSegment>();
- public ColoredCSharpFormatter (TextDocument doc)
+ public ColoredCSharpFormatter (TextEditor doc)
{
this.doc = doc;
}
@@ -94,7 +95,7 @@ namespace MonoDevelop.AssemblyBrowser
public void SetDocumentData ()
{
doc.Text = sb.ToString ();
- doc.UpdateFoldSegments (FoldSegments, false);
+ doc.SetFoldings (FoldSegments);
}
#region ITextOutput implementation
@@ -105,9 +106,9 @@ namespace MonoDevelop.AssemblyBrowser
}
}
- public TextLocation Location {
+ public ICSharpCode.NRefactory.TextLocation Location {
get {
- return new TextLocation (currentLine, 1);
+ return new ICSharpCode.NRefactory.TextLocation (currentLine, 1);
}
}
@@ -193,9 +194,8 @@ namespace MonoDevelop.AssemblyBrowser
public void MarkFoldEnd ()
{
var curFold = foldSegmentStarts.Pop ();
- FoldSegments.Add (new FoldSegment (doc, curFold.Item2 ,curFold.Item1, sb.Length - curFold.Item1, FoldingType.None) {
- IsFolded = curFold.Item3
- });
+ var seg = FoldSegmentFactory.CreateFoldSegment (doc, curFold.Item1, sb.Length - curFold.Item1, curFold.Item3, curFold.Item2);
+ FoldSegments.Add (seg);
}
#endregion
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DisplayBinding.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DisplayBinding.cs
index 71ded99d16..f992060d7e 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DisplayBinding.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DisplayBinding.cs
@@ -53,14 +53,14 @@ namespace MonoDevelop.AssemblyBrowser
{
if (viewContent == null || viewContent.IsDisposed) {
viewContent = new AssemblyBrowserViewContent ();
- viewContent.Control.Destroyed += HandleDestroyed;
+ viewContent.Disposed += HandleDestroyed;
}
return viewContent;
}
void HandleDestroyed (object sender, EventArgs e)
{
- ((Gtk.Widget)sender).Destroyed -= HandleDestroyed;
+ ((AssemblyBrowserViewContent)sender).Disposed -= HandleDestroyed;
this.viewContent = null;
}
@@ -71,7 +71,7 @@ namespace MonoDevelop.AssemblyBrowser
|| mimeType == "application/x-msdownload";
}
- public IViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
+ public ViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
{
return GetViewContent ();
}
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DocumentationPanel.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DocumentationPanel.cs
index a7dabd0e11..b7191c7738 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DocumentationPanel.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/DocumentationPanel.cs
@@ -46,7 +46,7 @@ namespace MonoDevelop.AssemblyBrowser
{
layout = new Pango.Layout (PangoContext);
layout.Wrap = Pango.WrapMode.Word;
- layout.FontDescription = Pango.FontDescription.FromString (PropertyService.Get<string> ("FontName"));
+ //layout.FontDescription = Pango.FontDescription.FromString (PropertyService.Get<string> ("FontName"));
}
protected override void OnDestroyed ()
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/HelpExtensions.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/HelpExtensions.cs
new file mode 100644
index 0000000000..34b3838425
--- /dev/null
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/HelpExtensions.cs
@@ -0,0 +1,168 @@
+//
+// HelpExtensions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Linq;
+using Monodoc;
+using System.Threading;
+using MonoDevelop.Core;
+using Mono.Addins;
+using System.IO;
+using System.Collections.Generic;
+using MonoDevelop.Projects.Extensions;
+using System.Text;
+using System.Xml;
+using ICSharpCode.NRefactory.TypeSystem;
+using MonoDevelop.Projects;
+using ICSharpCode.NRefactory.Documentation;
+
+namespace MonoDevelop.AssemblyBrowser
+{
+ static class HelpExtension
+ {
+ static void AppendTypeReference (StringBuilder result, ITypeReference type)
+ {
+ if (type is ArrayTypeReference) {
+ var array = (ArrayTypeReference)type;
+ AppendTypeReference (result, array.ElementType);
+ result.Append ("[");
+ result.Append (new string (',', array.Dimensions));
+ result.Append ("]");
+ return;
+ }
+
+ if (type is PointerTypeReference) {
+ var ptr = (PointerTypeReference)type;
+ AppendTypeReference (result, ptr.ElementType);
+ result.Append ("*");
+ return;
+ }
+
+ if (type is IType)
+ result.Append (((IType)type).FullName);
+ }
+
+
+ static void AppendHelpParameterList (StringBuilder result, IList<IParameter> parameters)
+ {
+ result.Append ('(');
+ if (parameters != null) {
+ for (int i = 0; i < parameters.Count; i++) {
+ if (i > 0)
+ result.Append (',');
+ var p = parameters [i];
+ if (p == null)
+ continue;
+ if (p.IsRef || p.IsOut)
+ result.Append ("&");
+ AppendTypeReference (result, p.Type.ToTypeReference ());
+ }
+ }
+ result.Append (')');
+ }
+
+ static void AppendHelpParameterList (StringBuilder result, IList<IUnresolvedParameter> parameters)
+ {
+ result.Append ('(');
+ if (parameters != null) {
+ for (int i = 0; i < parameters.Count; i++) {
+ if (i > 0)
+ result.Append (',');
+ var p = parameters [i];
+ if (p == null)
+ continue;
+ if (p.IsRef || p.IsOut)
+ result.Append ("&");
+ AppendTypeReference (result, p.Type);
+ }
+ }
+ result.Append (')');
+ }
+
+ static XmlNode FindMatch (IMethod method, XmlNodeList nodes)
+ {
+ foreach (XmlNode node in nodes) {
+ XmlNodeList paramList = node.SelectNodes ("Parameters/*");
+ if (method.Parameters.Count == 0 && paramList.Count == 0)
+ return node;
+ if (method.Parameters.Count != paramList.Count)
+ continue;
+
+ /* bool matched = true;
+ for (int i = 0; i < p.Count; i++) {
+ if (p [i].ReturnType.FullName != paramList [i].Attributes ["Type"].Value) {
+ matched = false;
+ break;
+ }
+ }
+ if (matched)*/
+ return node;
+ }
+ return null;
+ }
+#pragma warning disable 618
+ public static XmlNode GetMonodocDocumentation (this IEntity member)
+ {
+ if (member.SymbolKind == SymbolKind.TypeDefinition) {
+ var helpXml = HelpService.HelpTree != null ? HelpService.HelpTree.GetHelpXml (IdStringProvider.GetIdString (member)) : null;
+ if (helpXml == null)
+ return null;
+ return helpXml.SelectSingleNode ("/Type/Docs");
+ }
+
+ var declaringXml = HelpService.HelpTree != null && member.DeclaringTypeDefinition != null ? HelpService.HelpTree.GetHelpXml (member.DeclaringTypeDefinition.GetIdString ()) : null;
+ if (declaringXml == null)
+ return null;
+
+ switch (member.SymbolKind) {
+ case SymbolKind.Method:
+ {
+ var nodes = declaringXml.SelectNodes ("/Type/Members/Member[@MemberName='" + member.Name + "']");
+ XmlNode node = nodes.Count == 1 ? nodes [0] : FindMatch ((IMethod)member, nodes);
+ if (node != null) {
+ System.Xml.XmlNode result = node.SelectSingleNode ("Docs");
+ return result;
+ }
+ return null;
+ }
+ case SymbolKind.Constructor:
+ {
+ var nodes = declaringXml.SelectNodes ("/Type/Members/Member[@MemberName='.ctor']");
+ XmlNode node = nodes.Count == 1 ? nodes [0] : FindMatch ((IMethod)member, nodes);
+ if (node != null) {
+ System.Xml.XmlNode result = node.SelectSingleNode ("Docs");
+ return result;
+ }
+ return null;
+ }
+ default:
+ return declaringXml.SelectSingleNode ("/Type/Members/Member[@MemberName='" + member.Name + "']/Docs");
+ }
+ }
+
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/IAssemblyBrowserNodeBuilder.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/IAssemblyBrowserNodeBuilder.cs
index 7a13a020b6..2355c9897c 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/IAssemblyBrowserNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/IAssemblyBrowserNodeBuilder.cs
@@ -29,16 +29,16 @@
using System;
using MonoDevelop.Ide.Gui.Pads;
using MonoDevelop.Ide.Gui.Components;
-using Mono.TextEditor;
using System.Collections.Generic;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AssemblyBrowser
{
interface IAssemblyBrowserNodeBuilder
{
string GetDocumentationMarkup (ITreeNavigator navigator);
- List<ReferenceSegment> Disassemble (TextEditorData data, ITreeNavigator navigator);
- List<ReferenceSegment> Decompile (TextEditorData data, ITreeNavigator navigator, bool publicOnly);
- List<ReferenceSegment> GetSummary (TextEditorData data, ITreeNavigator navigator, bool publicOnly);
+ List<ReferenceSegment> Disassemble (TextEditor data, ITreeNavigator navigator);
+ List<ReferenceSegment> Decompile (TextEditor data, ITreeNavigator navigator, bool publicOnly);
+ List<ReferenceSegment> GetSummary (TextEditor data, ITreeNavigator navigator, bool publicOnly);
}
}
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/NRefactoryStock.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/NRefactoryStock.cs
new file mode 100644
index 0000000000..661e52c07d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/NRefactoryStock.cs
@@ -0,0 +1,232 @@
+//
+// NRefactoryStock.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core;
+using ICSharpCode.NRefactory.TypeSystem;
+
+namespace MonoDevelop.AssemblyBrowser
+{
+ static class NRefactoryStock
+ {
+ static readonly IconId Field = "md-field";
+ public static readonly IconId Namespace = "md-name-space";
+
+ public static IconId GetStockIcon (this INamedElement element)
+ {
+ if (element is IType)
+ return ((IType)element).GetStockIcon ();
+ if (element is ITypeParameter)
+ return ((ITypeParameter)element).GetStockIcon ();
+ if (element is IUnresolvedEntity)
+ return ((IUnresolvedEntity)element).GetStockIcon ();
+ return ((IEntity)element).GetStockIcon ();
+ }
+
+ public static IconId GetStockIcon (this ITypeDefinition entity)
+ {
+ return GetStockIcon ((IType)entity);
+ }
+
+ public static IconId GetStockIcon (this IField field)
+ {
+ return GetStockIcon ((IEntity)field);
+ }
+
+ public static IconId GetStockIcon (this IVariable variable)
+ {
+ return Field;
+ }
+
+ public static IconId GetStockIcon (this IParameter parameter)
+ {
+ return Field;
+ }
+
+ public static IconId GetStockIcon (this IUnresolvedTypeParameter parameter)
+ {
+ return Field;
+ }
+
+ public static IconId GetStockIcon (this IEntity entity, bool showAccessibility = true)
+ {
+ return "md-" + GetAccess (entity) + GetGlobal (entity) + GetSource (entity);
+ }
+
+ static string GetAccess (IEntity entity)
+ {
+ switch (entity.Accessibility) {
+ case Accessibility.None:
+ return "";
+ case Accessibility.Private:
+ return "private-";
+ case Accessibility.Public:
+ return "";
+ case Accessibility.Protected:
+ return "protected-";
+ case Accessibility.Internal:
+ return "internal-";
+ case Accessibility.ProtectedOrInternal:
+ case Accessibility.ProtectedAndInternal:
+ return "ProtectedOrInternal-";
+ default:
+ throw new ArgumentOutOfRangeException ();
+ }
+ }
+
+ static string GetGlobal (IEntity entity)
+ {
+ switch (entity.SymbolKind) {
+ case SymbolKind.Field:
+ if (((IField)entity).IsConst)
+ return "";
+ return entity.IsStatic ? "static-" : "";
+ case SymbolKind.Method:
+ case SymbolKind.Constructor:
+ case SymbolKind.Destructor:
+ case SymbolKind.Operator:
+ case SymbolKind.Property:
+ case SymbolKind.Indexer:
+ return entity.IsStatic ? "static-" : "";
+ }
+ return "";
+
+ }
+
+ static string GetSource (IEntity entity)
+ {
+ switch (entity.SymbolKind) {
+ case SymbolKind.TypeDefinition:
+ var type = (IType)entity;
+ switch (type.Kind) {
+ case TypeKind.Class:
+ return "class";
+ case TypeKind.Interface:
+ return "interface";
+ case TypeKind.Struct:
+ return "struct";
+ case TypeKind.Delegate:
+ return "delegate";
+ case TypeKind.Enum:
+ return "enum";
+ }
+ return "class";
+ case SymbolKind.Field:
+ if (((IField)entity).IsConst)
+ return "literal";
+ return "field";
+ case SymbolKind.Event:
+ return "event";
+ case SymbolKind.Method:
+ case SymbolKind.Constructor:
+ case SymbolKind.Destructor:
+ case SymbolKind.Operator:
+ return "method";
+ case SymbolKind.Property:
+ case SymbolKind.Indexer:
+ return "property";
+ }
+ return "";
+ }
+
+ public static IconId GetStockIcon (this IUnresolvedEntity entity, bool showAccessibility = true)
+ {
+ return "md-" + GetAccess (entity) + GetGlobal (entity) + GetSource (entity);
+ }
+
+ static string GetAccess (IUnresolvedEntity entity)
+ {
+ switch (entity.Accessibility) {
+ case Accessibility.None:
+ return "";
+ case Accessibility.Private:
+ return "private-";
+ case Accessibility.Public:
+ return "";
+ case Accessibility.Protected:
+ return "protected-";
+ case Accessibility.Internal:
+ return "internal-";
+ case Accessibility.ProtectedOrInternal:
+ case Accessibility.ProtectedAndInternal:
+ return "ProtectedOrInternal-";
+ default:
+ throw new ArgumentOutOfRangeException ();
+ }
+ }
+
+ static string GetGlobal (IUnresolvedEntity entity)
+ {
+ switch (entity.SymbolKind) {
+ case SymbolKind.Field:
+ var field = (IUnresolvedField)entity;
+ return field.IsStatic && !field.IsConst ? "static-" : "";
+ case SymbolKind.Method:
+ case SymbolKind.Constructor:
+ case SymbolKind.Destructor:
+ case SymbolKind.Operator:
+ case SymbolKind.Property:
+ case SymbolKind.Indexer:
+ return entity.IsStatic ? "static-" : "";
+ }
+ return "";
+ }
+
+ static string GetSource (IUnresolvedEntity entity)
+ {
+ switch (entity.SymbolKind) {
+ case SymbolKind.TypeDefinition:
+ var type = (IUnresolvedTypeDefinition)entity;
+ switch (type.Kind) {
+ case TypeKind.Class:
+ return "class";
+ case TypeKind.Interface:
+ return "interface";
+ case TypeKind.Struct:
+ return "struct";
+ case TypeKind.Delegate:
+ return "delegate";
+ case TypeKind.Enum:
+ return "enum";
+ }
+ return "class";
+ case SymbolKind.Field:
+ var field = (IUnresolvedField)entity;
+ return field.IsConst ? "literal" : "field";
+ case SymbolKind.Event:
+ return "event";
+ case SymbolKind.Method:
+ case SymbolKind.Constructor:
+ case SymbolKind.Destructor:
+ case SymbolKind.Operator:
+ return "method";
+ case SymbolKind.Property:
+ case SymbolKind.Indexer:
+ return "property";
+ }
+ return "";
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyBrowserTypeNodeBuilder.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyBrowserTypeNodeBuilder.cs
index 99f4050b9c..683c8b04a1 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyBrowserTypeNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyBrowserTypeNodeBuilder.cs
@@ -32,6 +32,7 @@ using ICSharpCode.NRefactory.TypeSystem.Implementation;
using MonoDevelop.Core;
using MonoDevelop.Projects;
using MonoDevelop.Ide.TypeSystem;
+using ICSharpCode.NRefactory.CSharp;
namespace MonoDevelop.AssemblyBrowser
{
@@ -41,10 +42,11 @@ namespace MonoDevelop.AssemblyBrowser
get;
private set;
}
-
- protected MonoDevelop.Ide.TypeSystem.Ambience Ambience {
+ readonly static CSharpAmbience ambience = new CSharpAmbience ();
+
+ protected CSharpAmbience Ambience {
get {
- return Widget.Ambience;
+ return ambience;
}
}
@@ -104,9 +106,11 @@ namespace MonoDevelop.AssemblyBrowser
var simpleCompilation = new SimpleCompilation (mainAssembly);
return new SimpleTypeResolveContext (simpleCompilation.MainAssembly);
}
- var project = (Project)treeBuilder.GetParentDataItem (typeof(Project), true);
- var compilation = TypeSystemService.GetCompilation (project);
- return new SimpleTypeResolveContext (compilation.MainAssembly);
+ // TODO: roslyn port ?
+ // var project = (Project)treeBuilder.GetParentDataItem (typeof(Project), true);
+ // var compilation = TypeSystemService.GetCompilation (project);
+ // return new SimpleTypeResolveContext (compilation.MainAssembly);
+ return null;
}
protected IMember Resolve (ITreeNavigator treeBuilder, IUnresolvedMember member, ITypeDefinition currentType = null)
@@ -122,9 +126,11 @@ namespace MonoDevelop.AssemblyBrowser
var simpleCompilation = new SimpleCompilation (mainAssembly);
return type.Resolve (new SimpleTypeResolveContext (simpleCompilation.MainAssembly));
}
- var project = (Project)treeBuilder.GetParentDataItem (typeof(Project), true);
- var ctx = TypeSystemService.GetCompilation (project);
- return ctx.MainAssembly.GetTypeDefinition (type.Namespace, type.Name, type.TypeParameters.Count);
+ // TODO: roslyn port ?
+ // var project = (Project)treeBuilder.GetParentDataItem (typeof(Project), true);
+ // var ctx = TypeSystemService.GetCompilation (project);
+ // return ctx.MainAssembly.GetTypeDefinition (type.Namespace, type.Name, type.TypeParameters.Count);
+ return null;
}
}
}
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyNodeBuilder.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyNodeBuilder.cs
index a9dd6a68ba..ed73ec940b 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyNodeBuilder.cs
@@ -34,12 +34,10 @@ using Mono.Cecil;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Pads;
using MonoDevelop.Ide.Gui.Components;
-using Mono.TextEditor;
using System.Collections.Generic;
-using ICSharpCode.NRefactory.TypeSystem;
using System.IO;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AssemblyBrowser
{
@@ -67,17 +65,18 @@ namespace MonoDevelop.AssemblyBrowser
nodeInfo.Icon = Context.GetIcon (Stock.Reference);
}
- public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
+ public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
{
var compilationUnit = (AssemblyLoader)dataObject;
-
+ if (compilationUnit.Assembly == null)
+ return;
var references = new AssemblyReferenceFolder (compilationUnit.Assembly);
if (references.AssemblyReferences.Any () || references.ModuleReferences.Any ())
- builder.AddChild (references);
+ treeBuilder.AddChild (references);
var resources = new AssemblyResourceFolder (compilationUnit.Assembly);
if (resources.Resources.Any ())
- builder.AddChild (resources);
+ treeBuilder.AddChild (resources);
var namespaces = new Dictionary<string, Namespace> ();
bool publicOnly = Widget.PublicApiOnly;
@@ -90,18 +89,14 @@ namespace MonoDevelop.AssemblyBrowser
var ns = namespaces [namespaceName];
ns.Types.Add (type);
}
-
- foreach (var ns in namespaces.Values) {
- if (publicOnly && !ns.Types.Any (t => t.IsPublic))
- continue;
- builder.AddChild (ns);
- }
+
+ treeBuilder.AddChildren (namespaces.Values.Where (ns => !publicOnly || ns.Types.Any (t => t.IsPublic)));
}
public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
{
var compilationUnit = (AssemblyLoader)dataObject;
- return compilationUnit.Assembly.MainModule.HasTypes;
+ return compilationUnit?.Assembly?.MainModule.HasTypes == true;
}
public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
@@ -114,12 +109,12 @@ namespace MonoDevelop.AssemblyBrowser
if (e1 == null && e2 == null)
return 0;
- if (e1 == null)
+ if (e1 == null || e1.Assembly == null)
return 1;
- if (e2 == null)
+ if (e2 == null || e2.Assembly == null)
return -1;
- return e1.Assembly.Name.Name.CompareTo (e2.Assembly.Name.Name);
+ return string.Compare (e1.Assembly.Name.Name, e2.Assembly.Name.Name, StringComparison.Ordinal);
} catch (Exception e) {
LoggingService.LogError ("Exception in assembly browser sort function.", e);
return -1;
@@ -130,10 +125,10 @@ namespace MonoDevelop.AssemblyBrowser
void PrintAssemblyHeader (StringBuilder result, AssemblyDefinition assemblyDefinition)
{
result.Append ("<span style=\"comment\">");
- result.Append (Ambience.SingleLineComment (
- String.Format (GettextCatalog.GetString ("Assembly <b>{0}</b>, Version {1}"),
+ result.Append ("// " +
+ string.Format (GettextCatalog.GetString ("Assembly <b>{0}</b>, Version {1}"),
assemblyDefinition.Name.Name,
- assemblyDefinition.Name.Version)));
+ assemblyDefinition.Name.Version));
result.Append ("</span>");
result.AppendLine ();
}
@@ -151,7 +146,7 @@ namespace MonoDevelop.AssemblyBrowser
return GettextCatalog.GetString ("Unknown");
}
- public List<ReferenceSegment> Disassemble (TextEditorData data, ITreeNavigator navigator)
+ public List<ReferenceSegment> Disassemble (TextEditor data, ITreeNavigator navigator)
{
var assembly = ((AssemblyLoader)navigator.DataItem).UnresolvedAssembly;
var compilationUnit = Widget.CecilLoader.GetCecilObject (assembly);
@@ -163,7 +158,7 @@ namespace MonoDevelop.AssemblyBrowser
}
- public List<ReferenceSegment> Decompile (TextEditorData data, ITreeNavigator navigator, bool publicOnly)
+ public List<ReferenceSegment> Decompile (TextEditor data, ITreeNavigator navigator, bool publicOnly)
{
var assembly = ((AssemblyLoader)navigator.DataItem).UnresolvedAssembly;
var compilationUnit = Widget.CecilLoader.GetCecilObject (assembly);
@@ -177,7 +172,7 @@ namespace MonoDevelop.AssemblyBrowser
});
}
- List<ReferenceSegment> IAssemblyBrowserNodeBuilder.GetSummary (TextEditorData data, ITreeNavigator navigator, bool publicOnly)
+ List<ReferenceSegment> IAssemblyBrowserNodeBuilder.GetSummary (TextEditor data, ITreeNavigator navigator, bool publicOnly)
{
var assembly = ((AssemblyLoader)navigator.DataItem).UnresolvedAssembly;
var compilationUnit = Widget.CecilLoader.GetCecilObject (assembly);
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyReferenceFolderNodeBuilder.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyReferenceFolderNodeBuilder.cs
index 283b5c6e54..bf90fb52c7 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyReferenceFolderNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyReferenceFolderNodeBuilder.cs
@@ -72,10 +72,8 @@ namespace MonoDevelop.AssemblyBrowser
// ctx.AddChild (new Error (MonoDevelop.Core.GettextCatalog.GetString ("Error while loading:") + assemblyNameReference.FullName + "/" + e.Message));
}
}
-
- foreach (ModuleReference moduleRef in referenceFolder.ModuleReferences) {
- ctx.AddChild (moduleRef);
- }
+
+ ctx.AddChildren (referenceFolder.ModuleReferences);
}
public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyResourceFolderNodeBuilder.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyResourceFolderNodeBuilder.cs
index 2eb286fa19..f699a83fe6 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyResourceFolderNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/AssemblyResourceFolderNodeBuilder.cs
@@ -54,9 +54,7 @@ namespace MonoDevelop.AssemblyBrowser
public override void BuildChildNodes (ITreeBuilder ctx, object dataObject)
{
var resourceFolder = (AssemblyResourceFolder)dataObject;
- foreach (object resource in resourceFolder.Resources) {
- ctx.AddChild (resource);
- }
+ ctx.AddChildren (resourceFolder.Resources);
}
public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/BaseTypeFolderNodeBuilder.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/BaseTypeFolderNodeBuilder.cs
index 497e590111..acf0f19327 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/BaseTypeFolderNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/BaseTypeFolderNodeBuilder.cs
@@ -100,9 +100,7 @@ namespace MonoDevelop.AssemblyBrowser
public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
{
var baseTypeFolder = (BaseTypeFolder)dataObject;
- foreach (var type in baseTypeFolder.Type.BaseTypes) {
- builder.AddChild (type);
- }
+ builder.AddChildren (baseTypeFolder.Type.BaseTypes);
}
public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
{
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomEventNodeBuilder.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomEventNodeBuilder.cs
index e84b5022c2..c03962bf13 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomEventNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomEventNodeBuilder.cs
@@ -34,12 +34,13 @@ using MonoDevelop.Ide;
using ICSharpCode.Decompiler.Ast;
using ICSharpCode.Decompiler;
using System.Threading;
-using Mono.TextEditor;
using System.Collections.Generic;
using Mono.Cecil;
using MonoDevelop.Ide.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem.Implementation;
+using MonoDevelop.Ide.Editor;
+using ICSharpCode.NRefactory.CSharp;
namespace MonoDevelop.AssemblyBrowser
{
@@ -64,7 +65,7 @@ namespace MonoDevelop.AssemblyBrowser
var evt = (IUnresolvedEvent)dataObject;
try {
var resolved = Resolve (treeBuilder, evt);
- nodeInfo.Label = Ambience.GetString (resolved, OutputFlags.ClassBrowserEntries | OutputFlags.IncludeMarkup | OutputFlags.CompletionListFomat);
+ nodeInfo.Label = MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (Ambience.ConvertSymbol (resolved));
} catch (Exception) {
nodeInfo.Label = evt.Name;
}
@@ -90,7 +91,7 @@ namespace MonoDevelop.AssemblyBrowser
}
#region IAssemblyBrowserNodeBuilder
- List<ReferenceSegment> IAssemblyBrowserNodeBuilder.Disassemble (TextEditorData data, ITreeNavigator navigator)
+ List<ReferenceSegment> IAssemblyBrowserNodeBuilder.Disassemble (TextEditor data, ITreeNavigator navigator)
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
@@ -98,7 +99,7 @@ namespace MonoDevelop.AssemblyBrowser
return DomMethodNodeBuilder.Disassemble (data, rd => rd.DisassembleEvent (evt));
}
- List<ReferenceSegment> IAssemblyBrowserNodeBuilder.Decompile (TextEditorData data, ITreeNavigator navigator, bool publicOnly)
+ List<ReferenceSegment> IAssemblyBrowserNodeBuilder.Decompile (TextEditor data, ITreeNavigator navigator, bool publicOnly)
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
@@ -108,7 +109,7 @@ namespace MonoDevelop.AssemblyBrowser
return DomMethodNodeBuilder.Decompile (data, DomMethodNodeBuilder.GetModule (navigator), evt.DeclaringType, b => b.AddEvent (evt));
}
- List<ReferenceSegment> IAssemblyBrowserNodeBuilder.GetSummary (TextEditorData data, ITreeNavigator navigator, bool publicOnly)
+ List<ReferenceSegment> IAssemblyBrowserNodeBuilder.GetSummary (TextEditor data, ITreeNavigator navigator, bool publicOnly)
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
@@ -124,17 +125,12 @@ namespace MonoDevelop.AssemblyBrowser
var resolved = Resolve (navigator, evt);
StringBuilder result = new StringBuilder ();
result.Append ("<big>");
- result.Append (Ambience.GetString (resolved, OutputFlags.AssemblyBrowserDescription));
+ result.Append (MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (Ambience.ConvertSymbol (resolved)));
result.Append ("</big>");
result.AppendLine ();
-
- var options = new AmbienceService.DocumentationFormatOptions ();
- options.MaxLineLength = -1;
- options.BigHeadings = true;
- options.Ambience = Ambience;
result.AppendLine ();
-
- result.Append (AmbienceService.GetDocumentationMarkup (resolved, AmbienceService.GetDocumentation (resolved), options));
+
+ //result.Append (AmbienceService.GetDocumentationMarkup (resolved, AmbienceService.GetDocumentation (resolved), options));
return result.ToString ();
}
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomFieldNodeBuilder.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomFieldNodeBuilder.cs
index 136f27b442..fcdd6b8672 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomFieldNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomFieldNodeBuilder.cs
@@ -34,12 +34,12 @@ using MonoDevelop.Ide;
using ICSharpCode.Decompiler.Ast;
using ICSharpCode.Decompiler;
using System.Threading;
-using Mono.TextEditor;
using System.Collections.Generic;
using Mono.Cecil;
using MonoDevelop.Ide.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem.Implementation;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AssemblyBrowser
{
@@ -65,7 +65,7 @@ namespace MonoDevelop.AssemblyBrowser
var field = (IUnresolvedField)dataObject;
try {
var resolved = Resolve (treeBuilder, field);
- nodeInfo.Label = Ambience.GetString (resolved, OutputFlags.ClassBrowserEntries | OutputFlags.IncludeMarkup | OutputFlags.CompletionListFomat);
+ nodeInfo.Label = MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (Ambience.ConvertSymbol (resolved));
} catch (Exception) {
nodeInfo.Label = field.Name;
}
@@ -77,7 +77,7 @@ namespace MonoDevelop.AssemblyBrowser
#region IAssemblyBrowserNodeBuilder
- List<ReferenceSegment> IAssemblyBrowserNodeBuilder.Disassemble (TextEditorData data, ITreeNavigator navigator)
+ List<ReferenceSegment> IAssemblyBrowserNodeBuilder.Disassemble (TextEditor data, ITreeNavigator navigator)
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
@@ -87,7 +87,7 @@ namespace MonoDevelop.AssemblyBrowser
return DomMethodNodeBuilder.Disassemble (data, rd => rd.DisassembleField (field));
}
- List<ReferenceSegment> IAssemblyBrowserNodeBuilder.Decompile (TextEditorData data, ITreeNavigator navigator, bool publicOnly)
+ List<ReferenceSegment> IAssemblyBrowserNodeBuilder.Decompile (TextEditor data, ITreeNavigator navigator, bool publicOnly)
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
@@ -97,7 +97,7 @@ namespace MonoDevelop.AssemblyBrowser
return DomMethodNodeBuilder.Decompile (data, DomMethodNodeBuilder.GetModule (navigator), field.DeclaringType, b => b.AddField (field));
}
- List<ReferenceSegment> IAssemblyBrowserNodeBuilder.GetSummary (TextEditorData data, ITreeNavigator navigator, bool publicOnly)
+ List<ReferenceSegment> IAssemblyBrowserNodeBuilder.GetSummary (TextEditor data, ITreeNavigator navigator, bool publicOnly)
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
@@ -113,17 +113,11 @@ namespace MonoDevelop.AssemblyBrowser
var resolved = Resolve (navigator, field);
StringBuilder result = new StringBuilder ();
result.Append ("<big>");
- result.Append (Ambience.GetString (resolved, OutputFlags.AssemblyBrowserDescription));
+ result.Append (MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (Ambience.ConvertSymbol (resolved)));
result.Append ("</big>");
result.AppendLine ();
-
- var options = new AmbienceService.DocumentationFormatOptions ();
- options.MaxLineLength = -1;
- options.BigHeadings = true;
- options.Ambience = Ambience;
- result.AppendLine ();
-
- result.Append (AmbienceService.GetDocumentationMarkup (resolved, AmbienceService.GetDocumentation (resolved), options));
+
+ //result.Append (AmbienceService.GetDocumentationMarkup (resolved, AmbienceService.GetDocumentation (resolved), options));
return result.ToString ();
}
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomMethodNodeBuilder.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomMethodNodeBuilder.cs
index 1a9b29e791..841aafac55 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomMethodNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomMethodNodeBuilder.cs
@@ -40,13 +40,14 @@ using ICSharpCode.Decompiler.Ast;
using ICSharpCode.Decompiler;
using System.Threading;
using ICSharpCode.Decompiler.Disassembler;
-using Mono.TextEditor;
using MonoDevelop.Ide.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem.Implementation;
using System.IO;
using ICSharpCode.NRefactory.CSharp;
using MonoDevelop.Projects;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
namespace MonoDevelop.AssemblyBrowser
{
@@ -78,8 +79,9 @@ namespace MonoDevelop.AssemblyBrowser
var method = (IUnresolvedMethod)dataObject;
var dt = new DefaultResolvedTypeDefinition (GetContext (treeBuilder), method.DeclaringTypeDefinition);
var resolved = (DefaultResolvedMethod)Resolve (treeBuilder, method, dt);
+ var ambience = new CSharpAmbience ();
try {
- nodeInfo.Label = Ambience.GetString (resolved, OutputFlags.ClassBrowserEntries | OutputFlags.IncludeMarkup | OutputFlags.CompletionListFomat);
+ nodeInfo.Label = MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (ambience.ConvertSymbol (resolved));
} catch (Exception) {
nodeInfo.Label = method.Name;
}
@@ -119,16 +121,16 @@ namespace MonoDevelop.AssemblyBrowser
return (ModuleDefinition)nav.DataItem;
}
- public static List<ReferenceSegment> Decompile (TextEditorData data, ModuleDefinition module, TypeDefinition currentType, Action<AstBuilder> setData)
+ public static List<ReferenceSegment> Decompile (TextEditor data, ModuleDefinition module, TypeDefinition currentType, Action<AstBuilder> setData)
{
- var types = DesktopService.GetMimeTypeInheritanceChain (data.Document.MimeType);
+ var types = DesktopService.GetMimeTypeInheritanceChain (data.MimeType);
var codePolicy = MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy> (types);
var settings = DomTypeNodeBuilder.CreateDecompilerSettings (false, codePolicy);
return Decompile (data, module, currentType, setData, settings);
}
- public static List<ReferenceSegment> Decompile (TextEditorData data, ModuleDefinition module, TypeDefinition currentType, Action<AstBuilder> setData, DecompilerSettings settings)
+ public static List<ReferenceSegment> Decompile (TextEditor data, ModuleDefinition module, TypeDefinition currentType, Action<AstBuilder> setData, DecompilerSettings settings)
{
var context = new DecompilerContext (module);
var source = new CancellationTokenSource ();
@@ -140,7 +142,7 @@ namespace MonoDevelop.AssemblyBrowser
setData (astBuilder);
astBuilder.RunTransformations (o => false);
GeneratedCodeSettings.Default.Apply (astBuilder.SyntaxTree);
- var output = new ColoredCSharpFormatter (data.Document);
+ var output = new ColoredCSharpFormatter (data);
astBuilder.GenerateCode (output);
output.SetDocumentData ();
return output.ReferencedSegments;
@@ -152,10 +154,10 @@ namespace MonoDevelop.AssemblyBrowser
setData (astBuilder);
astBuilder.RunTransformations (o => false);
GeneratedCodeSettings.Default.Apply (astBuilder.SyntaxTree);
- var output = new ColoredCSharpFormatter (data.Document);
+ var output = new ColoredCSharpFormatter (data);
astBuilder.GenerateCode (output);
output.SetDocumentData ();
- data.Document.Insert (data.Document.TextLength, "/* body decompilation failed: \n" + e + " */");
+ data.InsertText (data.Length, "/* body decompilation failed: \n" + e + " */");
} catch (Exception e2) {
data.Text = "/* fallback decompilation failed: \n" + e2 +"*/";
}
@@ -163,15 +165,15 @@ namespace MonoDevelop.AssemblyBrowser
return null;
}
- public static List<ReferenceSegment> GetSummary (TextEditorData data, ModuleDefinition module, TypeDefinition currentType, Action<AstBuilder> setData)
+ public static List<ReferenceSegment> GetSummary (TextEditor data, ModuleDefinition module, TypeDefinition currentType, Action<AstBuilder> setData)
{
- var types = DesktopService.GetMimeTypeInheritanceChain (data.Document.MimeType);
+ var types = DesktopService.GetMimeTypeInheritanceChain (data.MimeType);
var codePolicy = MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy> (types);
var settings = DomTypeNodeBuilder.CreateDecompilerSettings (false, codePolicy);
return GetSummary (data, module, currentType, setData, settings);
}
- public static List<ReferenceSegment> GetSummary (TextEditorData data, ModuleDefinition module, TypeDefinition currentType, Action<AstBuilder> setData, DecompilerSettings settings)
+ public static List<ReferenceSegment> GetSummary (TextEditor data, ModuleDefinition module, TypeDefinition currentType, Action<AstBuilder> setData, DecompilerSettings settings)
{
var context = new DecompilerContext (module);
var source = new CancellationTokenSource ();
@@ -184,7 +186,7 @@ namespace MonoDevelop.AssemblyBrowser
setData (astBuilder);
astBuilder.RunTransformations (o => false);
GeneratedCodeSettings.Default.Apply (astBuilder.SyntaxTree);
- var output = new ColoredCSharpFormatter (data.Document);
+ var output = new ColoredCSharpFormatter (data);
astBuilder.GenerateCode (output);
output.SetDocumentData ();
return output.ReferencedSegments;
@@ -194,20 +196,22 @@ namespace MonoDevelop.AssemblyBrowser
return null;
}
- internal static string GetAttributes (Ambience ambience, IEnumerable<IAttribute> attributes)
+ internal static string GetAttributes (IEnumerable<IAttribute> attributes)
{
- StringBuilder result = new StringBuilder ();
+ var result = new StringBuilder ();
+ //var ambience = new CSharpAmbience ();
+
foreach (var attr in attributes) {
if (result.Length > 0)
result.AppendLine ();
- // result.Append (ambience.GetString (attr, OutputFlags.AssemblyBrowserDescription));
+ // result.Append (ambience.ConvertSymbol (attr));
}
if (result.Length > 0)
result.AppendLine ();
return result.ToString ();
}
- public List<ReferenceSegment> Decompile (TextEditorData data, ITreeNavigator navigator, bool publicOnly)
+ public List<ReferenceSegment> Decompile (TextEditor data, ITreeNavigator navigator, bool publicOnly)
{
var method = (IUnresolvedMethod)navigator.DataItem;
if (HandleSourceCodeEntity (navigator, data))
@@ -218,7 +222,7 @@ namespace MonoDevelop.AssemblyBrowser
return DomMethodNodeBuilder.Decompile (data, DomMethodNodeBuilder.GetModule (navigator), cecilMethod.DeclaringType, b => b.AddMethod (cecilMethod));
}
- List<ReferenceSegment> IAssemblyBrowserNodeBuilder.GetSummary (TextEditorData data, ITreeNavigator navigator, bool publicOnly)
+ List<ReferenceSegment> IAssemblyBrowserNodeBuilder.GetSummary (TextEditor data, ITreeNavigator navigator, bool publicOnly)
{
var method = (IUnresolvedMethod)navigator.DataItem;
if (HandleSourceCodeEntity (navigator, data))
@@ -238,29 +242,29 @@ namespace MonoDevelop.AssemblyBrowser
sb.Append ("</a></u></span>");
}
- public static List<ReferenceSegment> Disassemble (TextEditorData data, Action<ReflectionDisassembler> setData)
+ public static List<ReferenceSegment> Disassemble (TextEditor data, Action<ReflectionDisassembler> setData)
{
var source = new CancellationTokenSource ();
- var output = new ColoredCSharpFormatter (data.Document);
+ var output = new ColoredCSharpFormatter (data);
var disassembler = new ReflectionDisassembler (output, true, source.Token);
setData (disassembler);
output.SetDocumentData ();
return output.ReferencedSegments;
}
- internal static bool HandleSourceCodeEntity (ITreeNavigator navigator, TextEditorData data)
+ internal static bool HandleSourceCodeEntity (ITreeNavigator navigator, TextEditor data)
{
if (IsFromAssembly (navigator))
return false;
var method = (IUnresolvedEntity)navigator.DataItem;
- data.Text = Mono.TextEditor.Utils.TextFileUtility.ReadAllText (method.Region.FileName);
- data.Caret.Location = method.Region.Begin;
- data.CenterToCaret ();
+ var source = StringTextSource.ReadFrom (method.Region.FileName);
+ data.Text = source.Text;
+ data.CaretLocation = new MonoDevelop.Ide.Editor.DocumentLocation (method.Region.BeginLine, method.Region.BeginColumn);
return true;
}
- List<ReferenceSegment> IAssemblyBrowserNodeBuilder.Disassemble (TextEditorData data, ITreeNavigator navigator)
+ List<ReferenceSegment> IAssemblyBrowserNodeBuilder.Disassemble (TextEditor data, ITreeNavigator navigator)
{
var method = (IUnresolvedMethod)navigator.DataItem;
if (HandleSourceCodeEntity (navigator, data))
@@ -276,21 +280,15 @@ namespace MonoDevelop.AssemblyBrowser
var method = (IUnresolvedMethod)navigator.DataItem;
var resolved = Resolve (navigator, method);
if (GetMainAssembly (navigator) == null) {
- return Mono.TextEditor.Utils.TextFileUtility.ReadAllText (method.Region.FileName);
+ return StringTextSource.ReadFrom (method.Region.FileName).Text;
}
StringBuilder result = new StringBuilder ();
result.Append ("<big>");
- result.Append (Ambience.GetString (resolved, OutputFlags.AssemblyBrowserDescription | OutputFlags.IncludeConstraints));
+ result.Append (MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (Ambience.ConvertSymbol (resolved)));
result.Append ("</big>");
result.AppendLine ();
-
- AmbienceService.DocumentationFormatOptions options = new AmbienceService.DocumentationFormatOptions ();
- options.MaxLineLength = -1;
- options.BigHeadings = true;
- options.Ambience = Ambience;
- result.AppendLine ();
-
- result.Append (AmbienceService.GetDocumentationMarkup (resolved, AmbienceService.GetDocumentation (resolved), options));
+
+ //result.Append (AmbienceService.GetDocumentationMarkup (resolved, AmbienceService.GetDocumentation (resolved), options));
return result.ToString ();
}
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomPropertyNodeBuilder.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomPropertyNodeBuilder.cs
index 1ef796d40c..9c69994a8c 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomPropertyNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomPropertyNodeBuilder.cs
@@ -35,12 +35,12 @@ using MonoDevelop.Projects.Text;
using ICSharpCode.Decompiler.Ast;
using ICSharpCode.Decompiler;
using System.Threading;
-using Mono.TextEditor;
using System.Collections.Generic;
using Mono.Cecil;
using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem.Implementation;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AssemblyBrowser
{
@@ -66,7 +66,7 @@ namespace MonoDevelop.AssemblyBrowser
var property = (IUnresolvedProperty)dataObject;
try {
var resolved = Resolve (treeBuilder, property);
- nodeInfo.Label = Ambience.GetString (resolved, OutputFlags.ClassBrowserEntries | OutputFlags.IncludeMarkup | OutputFlags.CompletionListFomat);
+ nodeInfo.Label = MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (Ambience.ConvertSymbol (resolved));
} catch (Exception) {
nodeInfo.Label = property.Name;
}
@@ -87,7 +87,7 @@ namespace MonoDevelop.AssemblyBrowser
#region IAssemblyBrowserNodeBuilder
- List<ReferenceSegment> IAssemblyBrowserNodeBuilder.Disassemble (TextEditorData data, ITreeNavigator navigator)
+ List<ReferenceSegment> IAssemblyBrowserNodeBuilder.Disassemble (TextEditor data, ITreeNavigator navigator)
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
@@ -107,7 +107,7 @@ namespace MonoDevelop.AssemblyBrowser
return result;
}
- List<ReferenceSegment> IAssemblyBrowserNodeBuilder.Decompile (TextEditorData data, ITreeNavigator navigator, bool publicOnly)
+ List<ReferenceSegment> IAssemblyBrowserNodeBuilder.Decompile (TextEditor data, ITreeNavigator navigator, bool publicOnly)
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
@@ -117,7 +117,7 @@ namespace MonoDevelop.AssemblyBrowser
return DomMethodNodeBuilder.Decompile (data, DomMethodNodeBuilder.GetModule (navigator), property.DeclaringType, b => b.AddProperty (property));
}
- List<ReferenceSegment> IAssemblyBrowserNodeBuilder.GetSummary (TextEditorData data, ITreeNavigator navigator, bool publicOnly)
+ List<ReferenceSegment> IAssemblyBrowserNodeBuilder.GetSummary (TextEditor data, ITreeNavigator navigator, bool publicOnly)
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
@@ -133,17 +133,11 @@ namespace MonoDevelop.AssemblyBrowser
var resolved = Resolve (navigator, property);
StringBuilder result = new StringBuilder ();
result.Append ("<big>");
- result.Append (Ambience.GetString (resolved, OutputFlags.AssemblyBrowserDescription));
+ result.Append (MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (Ambience.ConvertSymbol (resolved)));
result.Append ("</big>");
result.AppendLine ();
-
- AmbienceService.DocumentationFormatOptions options = new AmbienceService.DocumentationFormatOptions ();
- options.MaxLineLength = -1;
- options.BigHeadings = true;
- options.Ambience = Ambience;
- result.AppendLine ();
-
- result.Append (AmbienceService.GetDocumentationMarkup (resolved, AmbienceService.GetDocumentation (resolved), options));
+
+ //result.Append (AmbienceService.GetDocumentationMarkup (resolved, AmbienceService.GetDocumentation (resolved), options));
return result.ToString ();
}
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomTypeNodeBuilder.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomTypeNodeBuilder.cs
index 35ba03ed84..4bfa9b4ecc 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomTypeNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/DomTypeNodeBuilder.cs
@@ -30,19 +30,20 @@ using System;
using System.Text;
using System.Linq;
using Mono.Cecil;
-
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Components;
-using Mono.TextEditor.Highlighting;
using MonoDevelop.Ide;
using ICSharpCode.Decompiler.Ast;
using ICSharpCode.Decompiler;
using System.Threading;
-using Mono.TextEditor;
using System.Collections.Generic;
using MonoDevelop.Ide.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem.Implementation;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Highlighting;
+using MonoDevelop.Ide.Gui.Content;
+using ICSharpCode.NRefactory.CSharp;
namespace MonoDevelop.AssemblyBrowser
{
@@ -58,51 +59,8 @@ namespace MonoDevelop.AssemblyBrowser
public DomTypeNodeBuilder (AssemblyBrowserWidget widget) : base (widget)
{
-
}
-
- internal static OutputSettings settings;
- static SyntaxMode mode = SyntaxModeService.GetSyntaxMode (null, "text/x-csharp");
- internal static string MarkupKeyword (string text)
- {
- foreach (Keywords words in mode.Keywords) {
- foreach (string word in words.Words) {
- if (word == text) {
- return "<span style=\"" + words.Color + "\">" + text + "</span>";
- }
- }
- }
- return text;
- }
-
- static DomTypeNodeBuilder ()
- {
- DomTypeNodeBuilder.settings = new OutputSettings (OutputFlags.AssemblyBrowserDescription);
-
- DomTypeNodeBuilder.settings.MarkupCallback += delegate (string text) {
- return "<span style=\"text\">" + text + "</span>";
- };
- DomTypeNodeBuilder.settings.EmitModifiersCallback = delegate (string text) {
- return "<span style=\"keyword.modifier\">" + text + "</span>";
- };
- DomTypeNodeBuilder.settings.EmitKeywordCallback = delegate (string text) {
- return MarkupKeyword (text);
- };
-// DomTypeNodeBuilder.settings.EmitNameCallback = delegate (IEntity domVisitable, ref string outString) {
-// if (domVisitable is IType) {
-// outString = "<span style=\"text.link\"><u><a ref=\"" + ((IType)domVisitable).HelpUrl + "\">" + outString + "</a></u></span>";
-// } else {
-// outString = "<span style=\"text\">" + outString + "</span>";
-// }
-// };
-// DomTypeNodeBuilder.settings.PostProcessCallback = delegate (IEntity domVisitable, ref string outString) {
-// if (domVisitable is IReturnType) {
-// outString = "<span style=\"text.link\"><u><a ref=\"" + ((IReturnType)domVisitable).HelpUrl + "\">" + outString + "</a></u></span>";
-// }
-// };
- }
-
public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
{
var type = (IUnresolvedTypeDefinition)dataObject;
@@ -114,7 +72,7 @@ namespace MonoDevelop.AssemblyBrowser
var type = (IUnresolvedTypeDefinition)dataObject;
try {
var resolved = Resolve (treeBuilder, type);
- nodeInfo.Label = Ambience.GetString (resolved, OutputFlags.ClassBrowserEntries | OutputFlags.IncludeMarkup | OutputFlags.UseNETTypeNames);
+ nodeInfo.Label = MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (Ambience.ConvertType (resolved));
} catch (Exception) {
nodeInfo.Label = type.Name;
}
@@ -161,7 +119,7 @@ namespace MonoDevelop.AssemblyBrowser
var resolved = Resolve (navigator, type);
StringBuilder result = new StringBuilder ();
result.Append ("<span font_family=\"monospace\">");
- result.Append (Ambience.GetString (resolved, OutputFlags.AssemblyBrowserDescription));
+ result.Append (MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (Ambience.ConvertType (resolved)));
result.Append ("</span>");
result.AppendLine ();
result.Append (String.Format (GettextCatalog.GetString ("<b>Name:</b>\t{0}"), type.FullName));
@@ -170,7 +128,7 @@ namespace MonoDevelop.AssemblyBrowser
return result.ToString ();
}
- public List<ReferenceSegment> Disassemble (TextEditorData data, ITreeNavigator navigator)
+ public List<ReferenceSegment> Disassemble (TextEditor data, ITreeNavigator navigator)
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
@@ -193,19 +151,19 @@ namespace MonoDevelop.AssemblyBrowser
LockStatement = true,
AsyncAwait = true,
ShowXmlDocumentation = true,
- CSharpFormattingOptions = codePolicy.CreateOptions (),
+ CSharpFormattingOptions = FormattingOptionsFactory.CreateMono (),
HideNonPublicMembers = publicOnly
};
}
- public List<ReferenceSegment> Decompile (TextEditorData data, ITreeNavigator navigator, bool publicOnly)
+ public List<ReferenceSegment> Decompile (TextEditor data, ITreeNavigator navigator, bool publicOnly)
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
var type = CecilLoader.GetCecilObject ((IUnresolvedTypeDefinition)navigator.DataItem);
if (type == null)
return null;
- var types = DesktopService.GetMimeTypeInheritanceChain (data.Document.MimeType);
+ var types = DesktopService.GetMimeTypeInheritanceChain (data.MimeType);
var codePolicy = MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy> (types);
var settings = CreateDecompilerSettings (publicOnly, codePolicy);
return DomMethodNodeBuilder.Decompile (data, DomMethodNodeBuilder.GetModule (navigator), type, builder => {
@@ -213,14 +171,14 @@ namespace MonoDevelop.AssemblyBrowser
}, settings);
}
- List<ReferenceSegment> IAssemblyBrowserNodeBuilder.GetSummary (TextEditorData data, ITreeNavigator navigator, bool publicOnly)
+ List<ReferenceSegment> IAssemblyBrowserNodeBuilder.GetSummary (TextEditor data, ITreeNavigator navigator, bool publicOnly)
{
if (DomMethodNodeBuilder.HandleSourceCodeEntity (navigator, data))
return null;
var type = CecilLoader.GetCecilObject ((IUnresolvedTypeDefinition)navigator.DataItem);
if (type == null)
return null;
- var types = DesktopService.GetMimeTypeInheritanceChain (data.Document.MimeType);
+ var types = DesktopService.GetMimeTypeInheritanceChain (data.MimeType);
var codePolicy = MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy> (types);
var settings = CreateDecompilerSettings (publicOnly, codePolicy);
return DomMethodNodeBuilder.GetSummary (data, DomMethodNodeBuilder.GetModule (navigator), type, builder => {
@@ -228,24 +186,17 @@ namespace MonoDevelop.AssemblyBrowser
}, settings);
}
-
string IAssemblyBrowserNodeBuilder.GetDocumentationMarkup (ITreeNavigator navigator)
{
var type = (IUnresolvedTypeDefinition)navigator.DataItem;
var resolved = Resolve (navigator, type);
var result = new StringBuilder ();
result.Append ("<big>");
- result.Append (Ambience.GetString (resolved, OutputFlags.AssemblyBrowserDescription));
+ result.Append (MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (Ambience.ConvertType (resolved)));
result.Append ("</big>");
result.AppendLine ();
- AmbienceService.DocumentationFormatOptions options = new AmbienceService.DocumentationFormatOptions ();
- options.MaxLineLength = -1;
- options.BigHeadings = true;
- options.Ambience = Ambience;
- result.AppendLine ();
-
- result.Append (AmbienceService.GetDocumentationMarkup (resolved.GetDefinition (), AmbienceService.GetDocumentation (resolved.GetDefinition ()), options));
+ //result.Append (AmbienceService.GetDocumentationMarkup (resolved.GetDefinition (), AmbienceService.GetDocumentation (resolved.GetDefinition ()), options));
return result.ToString ();
}
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/ErrorNodeBuilder.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/ErrorNodeBuilder.cs
index 5956529f81..ed9c4f4614 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/ErrorNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/ErrorNodeBuilder.cs
@@ -51,7 +51,7 @@ namespace MonoDevelop.AssemblyBrowser
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
{
Error error = (Error)dataObject;
- nodeInfo.Label = error.Message;
+ nodeInfo.Label = MonoDevelop.Ide.TypeSystem.Ambience.EscapeText (error.Message);
nodeInfo.Icon = Context.GetIcon (Stock.Error);
}
}
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/NamespaceBuilder.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/NamespaceBuilder.cs
index e19351f894..dd0854bd00 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/NamespaceBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/NamespaceBuilder.cs
@@ -31,9 +31,9 @@ using System.Text;
using System.Linq;
using MonoDevelop.Ide.Gui.Components;
-using Mono.TextEditor;
using System.Collections.Generic;
using MonoDevelop.Core;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AssemblyBrowser
{
@@ -98,7 +98,7 @@ namespace MonoDevelop.AssemblyBrowser
#region IAssemblyBrowserNodeBuilder
- public List<ReferenceSegment> Disassemble (TextEditorData data, ITreeNavigator navigator)
+ public List<ReferenceSegment> Disassemble (TextEditor data, ITreeNavigator navigator)
{
// bool publicOnly = Widget.PublicApiOnly;
Namespace ns = (Namespace)navigator.DataItem;
@@ -107,12 +107,12 @@ namespace MonoDevelop.AssemblyBrowser
return null;
}
- public List<ReferenceSegment> Decompile (TextEditorData data, ITreeNavigator navigator, bool publicOnly)
+ public List<ReferenceSegment> Decompile (TextEditor data, ITreeNavigator navigator, bool publicOnly)
{
return Disassemble (data, navigator);
}
- List<ReferenceSegment> IAssemblyBrowserNodeBuilder.GetSummary (TextEditorData data, ITreeNavigator navigator, bool publicOnly)
+ List<ReferenceSegment> IAssemblyBrowserNodeBuilder.GetSummary (TextEditor data, ITreeNavigator navigator, bool publicOnly)
{
return Disassemble (data, navigator);
}
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/ProjectNodeBuilder.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/ProjectNodeBuilder.cs
index 21269962f9..cd01bb0bf4 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/ProjectNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/ProjectNodeBuilder.cs
@@ -34,7 +34,6 @@ using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Pads;
using MonoDevelop.Ide.Gui.Components;
-using Mono.TextEditor;
using System.Collections.Generic;
using ICSharpCode.NRefactory.TypeSystem;
using System.IO;
@@ -69,40 +68,42 @@ namespace MonoDevelop.AssemblyBrowser
{
var project = (Project)dataObject;
- nodeInfo.Label = project.Name;
+ nodeInfo.Label = Ambience.EscapeText (project.Name);
nodeInfo.Icon = Context.GetIcon (project.StockIcon);
}
public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
{
- var project = (Project)dataObject;
- var ctx = TypeSystemService.GetProjectContext (project);
- if (ctx == null)
- return;
-
- var namespaces = new Dictionary<string, Namespace> ();
-
- foreach (var type in ctx.TopLevelTypeDefinitions) {
- string namespaceName = string.IsNullOrEmpty (type.Namespace) ? "-" : type.Namespace;
- if (!namespaces.ContainsKey (namespaceName))
- namespaces [namespaceName] = new Namespace (namespaceName);
-
- var ns = namespaces [namespaceName];
- ns.Types.Add (type);
- }
-
- foreach (var ns in namespaces.Values) {
- builder.AddChild (ns);
- }
+ //var project = (Project)dataObject;
+ // TODO: Roslyn port.
+// var ctx = TypeSystemService.GetProjectContext (project);
+// if (ctx == null)
+// return;
+//
+// var namespaces = new Dictionary<string, Namespace> ();
+//
+// foreach (var type in ctx.TopLevelTypeDefinitions) {
+// string namespaceName = string.IsNullOrEmpty (type.Namespace) ? "-" : type.Namespace;
+// if (!namespaces.ContainsKey (namespaceName))
+// namespaces [namespaceName] = new Namespace (namespaceName);
+//
+// var ns = namespaces [namespaceName];
+// ns.Types.Add (type);
+// }
+//
+// foreach (var ns in namespaces.Values) {
+// builder.AddChild (ns);
+// }
}
public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
{
- var project = (Project)dataObject;
- var ctx = TypeSystemService.GetProjectContext (project);
- if (ctx == null)
+ //var project = (Project)dataObject;
+ // TODO: Roslyn port.
+ //var ctx = TypeSystemService.GetProjectContext (project);
+ //if (ctx == null)
return false;
- return ctx.TopLevelTypeDefinitions.Any ();
+ // return ctx.TopLevelTypeDefinitions.Any ();
}
public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/ResourceNodeBuilder.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/ResourceNodeBuilder.cs
index 41c6c1a998..a9b6fae962 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/ResourceNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/MonoDevelop.AssemblyBrowser/TreeNodes/ResourceNodeBuilder.cs
@@ -49,7 +49,7 @@ namespace MonoDevelop.AssemblyBrowser
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
{
Mono.Cecil.Resource resource = (Mono.Cecil.Resource)dataObject;
- nodeInfo.Label = resource.Name;
+ nodeInfo.Label = Ide.TypeSystem.Ambience.EscapeText (resource.Name);
nodeInfo.Icon = Context.GetIcon (Stock.ResourceFileIcon);
}
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/XmlDocIdLib/XmlDocIdGenerator.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/XmlDocIdLib/XmlDocIdGenerator.cs
index c4437e568d..558d0c08e9 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/XmlDocIdLib/XmlDocIdGenerator.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/XmlDocIdLib/XmlDocIdGenerator.cs
@@ -7,7 +7,7 @@ using Mono.Cecil;
namespace XmlDocIdLib
{
#region XmlDocIdGenerator
- class XmlDocIdGenerator
+ class XmlDocIdGenerator
{
#region Constructors
public XmlDocIdGenerator()
@@ -256,9 +256,9 @@ namespace XmlDocIdLib
CurrPath.Add("}");
}
}
- else if (Member is MethodDefinition)
+ else if (Member is MethodReference)
{
- MethodDefinition thisMethodDef = Member as MethodDefinition;
+ var thisMethodDef = Member as MethodReference;
// method, get type's path firstAppend
CurrPath.Add("M:");
@@ -269,11 +269,11 @@ namespace XmlDocIdLib
// check whether this is constructor method, or explicitly implemented method
strExplicitPath = GetXmlDocExplicitIfaceImplPath(Member);
- if (thisMethodDef.IsStatic && thisMethodDef.IsConstructor)
- stbTempPath.Append(".#cctor");
- if (!thisMethodDef.IsStatic && thisMethodDef.IsConstructor)
- stbTempPath.Append(".#ctor");
- else if (strExplicitPath.Length > 0)
+ //if (thisMethodDef.IsStatic && thisMethodDef.IsConstructor)
+ // stbTempPath.Append(".#cctor");
+ //if (!thisMethodDef.IsStatic && thisMethodDef.IsConstructor)
+ // stbTempPath.Append(".#ctor");
+ if (strExplicitPath.Length > 0)
stbTempPath.Append("." + strExplicitPath);
else
stbTempPath.Append("." + thisMethodDef.Name);
@@ -299,22 +299,22 @@ namespace XmlDocIdLib
// check whether this is a conversion operator (implicit or explicit)
// if so, we have to read return type and add "~" char.
- if (IsOperator(thisMethodDef))
- {
- OperatorType OpType = GetOperatorType(thisMethodDef);
-
- if (OpType == OperatorType.op_Implicit || OpType == OperatorType.op_Explicit)
- {
- // add return type parameter path
- stbTempPath.Append("~");
- stbTempPath.Append(GetXmlDocParameterPath(thisMethodDef.ReturnType, false));
- }
- }
+ //if (IsOperator(thisMethodDef))
+ //{
+ // OperatorType OpType = GetOperatorType(thisMethodDef);
+
+ // if (OpType == OperatorType.op_Implicit || OpType == OperatorType.op_Explicit)
+ // {
+ // // add return type parameter path
+ // stbTempPath.Append("~");
+ // stbTempPath.Append(GetXmlDocParameterPath(thisMethodDef.ReturnType, false));
+ // }
+ //}
// add to path
CurrPath.Add(stbTempPath.ToString());
}
- else if (Member is FieldDefinition)
+ else if (Member is FieldReference)
{
// field, get type's path name
CurrPath.Add("F:");
@@ -324,7 +324,7 @@ namespace XmlDocIdLib
// field's path
CurrPath.Add("." + Member.Name);
}
- else if (Member is PropertyDefinition)
+ else if (Member is PropertyReference)
{
// property or indexer, get declaring type's path
CurrPath.Add("P:");
@@ -359,7 +359,7 @@ namespace XmlDocIdLib
CurrPath.Add(stbTempPath.ToString());
}
- else if (Member is EventDefinition)
+ else if (Member is EventReference)
{
// event, get type's path firstAppend
CurrPath.Add("E:");
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs
index 5ebb678ab8..1c632f10b1 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.cs
@@ -2,102 +2,102 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.AssemblyBrowser
{
- internal partial class AssemblyBrowserWidget
+ public partial class AssemblyBrowserWidget
{
private global::Gtk.UIManager UIManager;
- private global::Gtk.Action NavigateBackwardAction;
- private global::Gtk.Action NavigateForwardAction;
+
private global::Gtk.VBox vbox1;
+
private global::Gtk.HPaned hpaned1;
+
private global::Gtk.Alignment treeViewPlaceholder;
+
private global::Gtk.VBox vbox3;
+
private global::Gtk.Notebook notebook1;
- private global::MonoDevelop.Components.CompactScrolledWindow documentationScrolledWindow;
+
+ private global::Gtk.HBox documentationScrolledWindow;
+
private global::Gtk.VBox searchWidget;
+
private global::Gtk.ScrolledWindow scrolledwindow1;
+
private global::Gtk.TreeView searchTreeview;
- protected virtual void Build ()
+ protected virtual void Build()
{
- global::Stetic.Gui.Initialize (this);
+#pragma warning disable 436
+ global::Stetic.Gui.Initialize(this);
// Widget MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget
- Stetic.BinContainer w1 = global::Stetic.BinContainer.Attach (this);
- this.UIManager = new global::Gtk.UIManager ();
- global::Gtk.ActionGroup w2 = new global::Gtk.ActionGroup ("Default");
- this.NavigateBackwardAction = new global::Gtk.Action ("NavigateBackwardAction", global::Mono.Unix.Catalog.GetString ("Navigate backward"), null, "gtk-go-back");
- this.NavigateBackwardAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Navigate backward");
- w2.Add (this.NavigateBackwardAction, null);
- this.NavigateForwardAction = new global::Gtk.Action ("NavigateForwardAction", global::Mono.Unix.Catalog.GetString ("Navigate forward"), null, "gtk-go-forward");
- this.NavigateForwardAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Navigate forward");
- w2.Add (this.NavigateForwardAction, null);
- this.UIManager.InsertActionGroup (w2, 0);
+ Stetic.BinContainer w1 = global::Stetic.BinContainer.Attach(this);
+ this.UIManager = new global::Gtk.UIManager();
+ global::Gtk.ActionGroup w2 = new global::Gtk.ActionGroup("Default");
+ this.UIManager.InsertActionGroup(w2, 0);
this.Name = "MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget";
// Container child MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget.Gtk.Container+ContainerChild
- this.vbox1 = new global::Gtk.VBox ();
+ this.vbox1 = new global::Gtk.VBox();
this.vbox1.Name = "vbox1";
this.vbox1.Spacing = 2;
// Container child vbox1.Gtk.Box+BoxChild
- this.hpaned1 = new global::Gtk.HPaned ();
+ this.hpaned1 = new global::Gtk.HPaned();
this.hpaned1.CanFocus = true;
this.hpaned1.Name = "hpaned1";
this.hpaned1.Position = 271;
// Container child hpaned1.Gtk.Paned+PanedChild
- this.treeViewPlaceholder = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
+ this.treeViewPlaceholder = new global::Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
this.treeViewPlaceholder.Name = "treeViewPlaceholder";
- this.hpaned1.Add (this.treeViewPlaceholder);
- global::Gtk.Paned.PanedChild w3 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.treeViewPlaceholder]));
+ this.hpaned1.Add(this.treeViewPlaceholder);
+ global::Gtk.Paned.PanedChild w3 = ((global::Gtk.Paned.PanedChild)(this.hpaned1[this.treeViewPlaceholder]));
w3.Resize = false;
// Container child hpaned1.Gtk.Paned+PanedChild
- this.vbox3 = new global::Gtk.VBox ();
+ this.vbox3 = new global::Gtk.VBox();
this.vbox3.Name = "vbox3";
this.vbox3.Spacing = 6;
// Container child vbox3.Gtk.Box+BoxChild
- this.notebook1 = new global::Gtk.Notebook ();
+ this.notebook1 = new global::Gtk.Notebook();
this.notebook1.CanFocus = true;
this.notebook1.Name = "notebook1";
this.notebook1.CurrentPage = 0;
this.notebook1.ShowBorder = false;
// Container child notebook1.Gtk.Notebook+NotebookChild
- this.documentationScrolledWindow = new global::MonoDevelop.Components.CompactScrolledWindow ();
- this.documentationScrolledWindow.CanFocus = true;
+ this.documentationScrolledWindow = new global::Gtk.HBox();
this.documentationScrolledWindow.Name = "documentationScrolledWindow";
- this.documentationScrolledWindow.ShowBorderLine = false;
- this.notebook1.Add (this.documentationScrolledWindow);
+ this.documentationScrolledWindow.Spacing = 6;
+ this.notebook1.Add(this.documentationScrolledWindow);
// Container child notebook1.Gtk.Notebook+NotebookChild
- this.searchWidget = new global::Gtk.VBox ();
+ this.searchWidget = new global::Gtk.VBox();
this.searchWidget.Name = "searchWidget";
this.searchWidget.Spacing = 6;
// Container child searchWidget.Gtk.Box+BoxChild
- this.scrolledwindow1 = new global::Gtk.ScrolledWindow ();
+ this.scrolledwindow1 = new global::Gtk.ScrolledWindow();
this.scrolledwindow1.CanFocus = true;
this.scrolledwindow1.Name = "scrolledwindow1";
this.scrolledwindow1.ShadowType = ((global::Gtk.ShadowType)(1));
// Container child scrolledwindow1.Gtk.Container+ContainerChild
- this.searchTreeview = new global::Gtk.TreeView ();
+ this.searchTreeview = new global::Gtk.TreeView();
this.searchTreeview.CanFocus = true;
this.searchTreeview.Name = "searchTreeview";
- this.scrolledwindow1.Add (this.searchTreeview);
- this.searchWidget.Add (this.scrolledwindow1);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.searchWidget [this.scrolledwindow1]));
+ this.scrolledwindow1.Add(this.searchTreeview);
+ this.searchWidget.Add(this.scrolledwindow1);
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.searchWidget[this.scrolledwindow1]));
w6.Position = 0;
- this.notebook1.Add (this.searchWidget);
- global::Gtk.Notebook.NotebookChild w7 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.searchWidget]));
+ this.notebook1.Add(this.searchWidget);
+ global::Gtk.Notebook.NotebookChild w7 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1[this.searchWidget]));
w7.Position = 1;
- this.vbox3.Add (this.notebook1);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.notebook1]));
+ this.vbox3.Add(this.notebook1);
+ global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.notebook1]));
w8.Position = 0;
- this.hpaned1.Add (this.vbox3);
- this.vbox1.Add (this.hpaned1);
- global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hpaned1]));
+ this.hpaned1.Add(this.vbox3);
+ this.vbox1.Add(this.hpaned1);
+ global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hpaned1]));
w10.Position = 0;
- this.Add (this.vbox1);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
+ this.Add(this.vbox1);
+ if ((this.Child != null))
+ {
+ this.Child.ShowAll();
}
- w1.SetUiManager (UIManager);
- this.Hide ();
- this.NavigateBackwardAction.Activated += new global::System.EventHandler (this.OnNavigateBackwardActionActivated);
- this.NavigateForwardAction.Activated += new global::System.EventHandler (this.OnNavigateForwardActionActivated);
+ w1.SetUiManager(UIManager);
+ this.Hide();
}
}
}
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/generated.cs b/main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/generated.cs
index 75935e2e55..8bc1a8b869 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/generated.cs
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/generated.cs
@@ -1,3 +1,4 @@
+#pragma warning disable 436
// This file has been generated by the GUI designer. Do not modify.
namespace Stetic
@@ -6,9 +7,10 @@ namespace Stetic
{
private static bool initialized;
- internal static void Initialize (Gtk.Widget iconRenderer)
+ internal static void Initialize(Gtk.Widget iconRenderer)
{
- if ((Stetic.Gui.initialized == false)) {
+ if ((Stetic.Gui.initialized == false))
+ {
Stetic.Gui.initialized = true;
}
}
@@ -17,49 +19,55 @@ namespace Stetic
internal class BinContainer
{
private Gtk.Widget child;
+
private Gtk.UIManager uimanager;
- public static BinContainer Attach (Gtk.Bin bin)
+ public static BinContainer Attach(Gtk.Bin bin)
{
- BinContainer bc = new BinContainer ();
- bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested);
- bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated);
- bin.Added += new Gtk.AddedHandler (bc.OnAdded);
+ BinContainer bc = new BinContainer();
+ bin.SizeRequested += new Gtk.SizeRequestedHandler(bc.OnSizeRequested);
+ bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated);
+ bin.Added += new Gtk.AddedHandler(bc.OnAdded);
return bc;
}
- private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args)
+ private void OnSizeRequested(object sender, Gtk.SizeRequestedArgs args)
{
- if ((this.child != null)) {
- args.Requisition = this.child.SizeRequest ();
+ if ((this.child != null))
+ {
+ args.Requisition = this.child.SizeRequest();
}
}
- private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args)
+ private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args)
{
- if ((this.child != null)) {
+ if ((this.child != null))
+ {
this.child.Allocation = args.Allocation;
}
}
- private void OnAdded (object sender, Gtk.AddedArgs args)
+ private void OnAdded(object sender, Gtk.AddedArgs args)
{
this.child = args.Widget;
}
- public void SetUiManager (Gtk.UIManager uim)
+ public void SetUiManager(Gtk.UIManager uim)
{
this.uimanager = uim;
- this.child.Realized += new System.EventHandler (this.OnRealized);
+ this.child.Realized += new System.EventHandler(this.OnRealized);
}
- private void OnRealized (object sender, System.EventArgs args)
+ private void OnRealized(object sender, System.EventArgs args)
{
- if ((this.uimanager != null)) {
+ if ((this.uimanager != null))
+ {
Gtk.Widget w;
w = this.child.Toplevel;
- if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) {
- ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup);
+ if (((w != null)
+ && typeof(Gtk.Window).IsInstanceOfType(w)))
+ {
+ ((Gtk.Window)(w)).AddAccelGroup(this.uimanager.AccelGroup);
this.uimanager = null;
}
}
@@ -68,12 +76,12 @@ namespace Stetic
internal class ActionGroups
{
- public static Gtk.ActionGroup GetActionGroup (System.Type type)
+ public static Gtk.ActionGroup GetActionGroup(System.Type type)
{
- return Stetic.ActionGroups.GetActionGroup (type.FullName);
+ return Stetic.ActionGroups.GetActionGroup(type.FullName);
}
- public static Gtk.ActionGroup GetActionGroup (string name)
+ public static Gtk.ActionGroup GetActionGroup(string name)
{
return null;
}
diff --git a/main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/gui.stetic b/main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/gui.stetic
index 3eef8c0c9a..689f8cf582 100644
--- a/main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/gui.stetic
+++ b/main/src/addins/MonoDevelop.AssemblyBrowser/gtk-gui/gui.stetic
@@ -6,32 +6,15 @@
</configuration>
<import>
<widget-library name="../../../../build/bin/MonoDevelop.Ide.dll" />
- <widget-library name="../../../../build/bin/Mono.TextEditor.dll" />
<widget-library name="../../../../build/AddIns/MonoDevelop.Refactoring/MonoDevelop.Refactoring.dll" />
<widget-library name="../../../../build/AddIns/BackendBindings/MonoDevelop.CSharpBinding.dll" />
- <widget-library name="../../../../build/AddIns/DisplayBindings/SourceEditor/MonoDevelop.SourceEditor2.dll" />
+ <widget-library name="../../../../build/bin/Mono.TextEditor.dll" />
<widget-library name="../../../../build/AddIns/DisplayBindings/AssemblyBrowser/MonoDevelop.AssemblyBrowser.dll" internal="true" />
</import>
<widget class="Gtk.Bin" id="MonoDevelop.AssemblyBrowser.AssemblyBrowserWidget" design-size="702 482">
- <action-group name="Default">
- <action id="NavigateBackwardAction">
- <property name="Type">Action</property>
- <property name="Label" translatable="yes">Navigate backward</property>
- <property name="ShortLabel" translatable="yes">Navigate backward</property>
- <property name="StockId">gtk-go-back</property>
- <signal name="Activated" handler="OnNavigateBackwardActionActivated" />
- </action>
- <action id="NavigateForwardAction">
- <property name="Type">Action</property>
- <property name="Label" translatable="yes">Navigate forward</property>
- <property name="ShortLabel" translatable="yes">Navigate forward</property>
- <property name="StockId">gtk-go-forward</property>
- <signal name="Activated" handler="OnNavigateForwardActionActivated" />
- </action>
- </action-group>
+ <action-group name="Default" />
<property name="MemberName" />
<property name="Visible">False</property>
- <property name="GeneratePublic">False</property>
<child>
<widget class="Gtk.VBox" id="vbox1">
<property name="MemberName" />
@@ -63,10 +46,12 @@
<property name="CurrentPage">0</property>
<property name="ShowBorder">False</property>
<child>
- <widget class="MonoDevelop.Components.CompactScrolledWindow" id="documentationScrolledWindow">
+ <widget class="Gtk.HBox" id="documentationScrolledWindow">
<property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="ShowBorderLine">False</property>
+ <property name="Spacing">6</property>
+ <child>
+ <placeholder />
+ </child>
</widget>
</child>
<child>
diff --git a/main/src/addins/MonoDevelop.Autotools/AutotoolsContext.cs b/main/src/addins/MonoDevelop.Autotools/AutotoolsContext.cs
index 2b5465c414..99b3f1d937 100644
--- a/main/src/addins/MonoDevelop.Autotools/AutotoolsContext.cs
+++ b/main/src/addins/MonoDevelop.Autotools/AutotoolsContext.cs
@@ -45,7 +45,7 @@ namespace MonoDevelop.Autotools
Set<SystemPackage> commonPackages;
Set<string> globalFilesReferences = new Set<string>();
Set<string> compilers = new Set<string> ();
- Set<SolutionItem> builtProjects = new Set<SolutionItem> ();
+ Set<SolutionFolderItem> builtProjects = new Set<SolutionFolderItem> ();
// Useful for cleaning up in case of a problem in generation
List<string> generatedFiles = new List<string> ();
@@ -190,12 +190,12 @@ namespace MonoDevelop.Autotools
globalFilesReferences.Add (filePath);
}
- public void RegisterBuiltProject (SolutionItem item)
+ public void RegisterBuiltProject (SolutionFolderItem item)
{
builtProjects.Add (item);
}
- public IEnumerable<SolutionItem> GetBuiltProjects ()
+ public IEnumerable<SolutionFolderItem> GetBuiltProjects ()
{
return builtProjects;
}
@@ -292,7 +292,7 @@ namespace MonoDevelop.Autotools
// TODO: add an extension point with which addins can implement
// autotools functionality.
- public static IMakefileHandler GetMakefileHandler (SolutionItem entry, MakefileType mt)
+ public static IMakefileHandler GetMakefileHandler (SolutionFolderItem entry, MakefileType mt)
{
foreach (IMakefileHandler mh in AddinManager.GetExtensionObjects ("/MonoDevelop/Autotools/MakefileHandlers", typeof(IMakefileHandler), true)) {
if (mh.CanDeploy (entry, mt))
diff --git a/main/src/addins/MonoDevelop.Autotools/ChangeLog b/main/src/addins/MonoDevelop.Autotools/ChangeLog
deleted file mode 100644
index 398f8bf091..0000000000
--- a/main/src/addins/MonoDevelop.Autotools/ChangeLog
+++ /dev/null
@@ -1,1742 +0,0 @@
-2010-06-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * AutotoolsContext.cs:
- * SolutionDeployer.cs:
- * SolutionMakefileHandler.cs: Don't allow spaces in paths.
-
-2010-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * Commands.cs: Fix incorrect use of
- ShowCustomDialog/RunCustomDialog.
-
-2010-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * TarballBuilderEditorWidget.cs: Use ShowCustomDialog (which
- destroys the dialog when done) instead of RunCustomDialog
- (which doesn't).
-
-2010-05-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * Commands.cs:
- * TarballBuilderEditorWidget.cs: More dialog placing.
-
-2010-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * SimpleProjectMakefileHandler.cs: Removed unnecessary
- ToMakefilePath call (it is already called when adding paths
- to extraFiles).
-
- * MakefileData.cs: Properly escape spaces.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Autotools.addin.xml: Bumped MD version.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * Commands.cs:
- * MakefileData.cs:
- * gtk-gui/gui.stetic:
- * MakefileOptionPanel.cs:
- * ImportMakefileDialog.cs:
- * GenerateMakefilesDialog.cs:
- * FileNodeBuilderExtension.cs:
- * MakefileOptionPanelWidget.cs:
- * MonoDevelop.Autotools.csproj:
- * MonoDevelop.Autotools.addin.xml: Merged MD.Projects into
- MD.Core, and MD.Projects.Gui, MD.Core.Gui and MD.Components
- into MD.Ide.
-
-2010-03-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MakefileData.cs:
- * SimpleProjectMakefileHandler.cs: Track ProjectFile Link API.
-
-2010-03-03 Levi Bard <levi@unity3d.com>
-
- * MakefileData.cs:
- * gtk-gui/gui.stetic:
- * MakefileOptionPanelWidget.cs:
- * MakefileProjectServiceExtension.cs:
- * gtk-gui/MonoDevelop.Autotools.MakefileOptionPanelWidget.cs:
- Add option for number of parallel build processes.
-
-2010-02-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileData.cs: Fix assembly resolution issue when loading
- a project.
-
-2010-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MakefileReaderExtension.cs:
- * MonoDevelop.Autotools.csproj: Remove usnused extension.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileIntegrationFeature.cs: Track api changes.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.Autotools.MakefileSwitchEditor.cs:
- * gtk-gui/MonoDevelop.Autotools.GenerateMakefilesDialog.cs:
- * gtk-gui/MonoDevelop.Autotools.MakefileOptionPanelWidget.cs:
- * gtk-gui/MonoDevelop.Autotools.TarballBuilderEditorWidget.cs:
- * gtk-gui/MonoDevelop.Autotools.MakefileSwitchEditorWidget.cs:
- * gtk-gui/MonoDevelop.Autotools.MakefileIntegrationFeatureWidget.cs:
- Flush.
-
-2010-01-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * SolutionDeployer.cs: Fix Bug 572048 - Spelling mistake in
- Packaging Output.
-
-2009-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * Handler.cs:
- * MakefileData.cs:
- * ConfigSection.cs:
- * GenerateMakefilesDialog.cs:
- * SolutionMakefileHandler.cs:
- * SimpleProjectMakefileHandler.cs:
- * MakefileProjectServiceExtension.cs: Introduced the
- ConfigurationSelector class to all methods that previously
- took a configuration name as string. This eliminates the
- ambiguity between solution configuration names and project
- configuration names.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Autotools.addin.xml: Bump MD version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileOptionPanelWidget.cs: Improve error handling.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.Autotools.MakefileSwitchEditor.cs:
- * gtk-gui/MonoDevelop.Autotools.GenerateMakefilesDialog.cs:
- * gtk-gui/MonoDevelop.Autotools.MakefileOptionPanelWidget.cs:
- * gtk-gui/MonoDevelop.Autotools.MakefileSwitchEditorWidget.cs:
- * gtk-gui/MonoDevelop.Autotools.TarballBuilderEditorWidget.cs:
- * gtk-gui/MonoDevelop.Autotools.MakefileIntegrationFeatureWidget.cs:
- Flush.
-
-2009-10-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.csproj: Flush.
-
- * MonoDevelop.Autotools.addin.xml: Disable autotools features
- on windows.
-
-2009-10-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.addin.xml: Disabled autotools and
- makefile generation on windows.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Autotools.addin.xml: Bump MD version.
-
-2009-10-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileData.cs: Absolute or relative paths should not be
- considered for package reference. Fixes bug #510595.
-
-2009-10-02 Mike Krüger <mkrueger@novell.com>
-
- * MakefileData.cs: Handled the required packages references.
-
-2009-10-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * SimpleProjectMakefileHandler.cs: Avoid variable name
- colisions for files to be deployed. Fixes bug #537497 -
- Generated Makefiles should use relative paths for rule names
- instead of just filenames for content files.
-
-2009-09-28 Mike Krüger <mkrueger@novell.com>
-
- * MakefileData.cs: Makefiles are no longer changed, when a
- package is included that is already included using a package
- requirement.
-
-2009-09-09 Christian Hergert <chris@dronelabs.com>
-
- * MakefileReaderExtension.cs: Make dialog transient to the
- root monodevelop window.
-
-2009-09-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * SimpleProjectMakefileHandler.cs: Include Content files to
- the list of files to deploy. Fixes bug #502111 - Generated
- tarballs do not include .desktop files.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.csproj: Updated dependencies. We now
- depend on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/Makefile.am.project.template:
- * templates/Makefile.noauto.project.template: Fix issue that
- prevented generated makefiles from working in parallel
- builds. Patch by Bertrand Lorentz. Closes bug #531349 -
- Generated Makefile.am does not properly support parallel
- make.
-
-2009-08-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Handler.cs: Store TargetDirectory as a relative path. Fixes
- bug #532295 - TargetDirectory for a packaging project should
- be relative to the project.
-
-2009-08-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileData.cs:
- * CustomMakefile.cs: Track api changes.
-
-2009-08-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileData.cs: Track api changes.
-
-2009-08-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileData.cs:
- * MakefileOptionPanelWidget.cs: Use the new AssemblyContext
- class to query and resolve assemblies.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Autotools.TarballBuilderEditorWidget.cs:
- Fix layout of Edit Switches button.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Flush.
-
-2009-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileData.cs:
- * MakefileOptionPanelWidget.cs: Removed
- CorePackageAssemblyNames because it doesn't really support
- multiple frameworks. The GetAssemblyFullName method already
- does the job of converting assembly names to full names.
-
-2009-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * SolutionDeployer.cs: Fix nullref.
-
-2009-07-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * SimpleProjectMakefileHandler.cs: Fix nullref.
-
-2009-06-23 Jérémie Laval <jeremie.laval@gmail.com>
- * MonoDevelop.Autotools.csproj:
- * Makefile.am: Added the new files
-
- * Switch.cs:
- * gtk-gui/MonoDevelop.Autotools.MakefileSwitchEditor.cs
- * gtk-gui/MonoDevelop.Autotools.MakefileSwitchEditorWidget.cs:
- * MakefileSwitchEditorWidget.cs:
- * MakefileSwitchEditor.cs: new switch editor code
-
- * gtk-gui/objects.xml:
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Autotools.TarballBuilderEditorWidget.cs:
- * SimpleProjectMakefileHandler.cs:
- * Handler.cs:
- * SolutionDeployer.cs:
- * AutotoolsContext.cs:
- * TarballBuilderEditorWidget.cs: Added switch editor support code
-
-2009-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MakefileData.cs: Track assembly lookup APIs.
-
-2009-05-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileData.cs:
- * MakefileProjectServiceExtension.cs: Disable makefile
- integration on windows for now.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileData.cs:
- * AutotoolsContext.cs:
- * SimpleProjectMakefileHandler.cs:
- * MakefileProjectServiceExtension.cs: Use the new FilePath
- class for handling file and directory paths.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.Autotools.csproj: don't require specific
- gtk-sharp version.
-
-2009-04-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileData.cs:
- * SolutionDeployer.cs:
- * AutotoolsContext.cs:
- * SimpleProjectMakefileHandler.cs: Moved SystemAssemblyService
- and related classes to the namespace
- MonoDevelop.Core.Assemblies.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Autotools.addin.xml: Bump MD version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileData.cs:
- * SimpleProjectMakefileHandler.cs: Track api changes to
- support multiple target runtimes.
-
-2009-02-26 Mike Krüger <mkrueger@novell.com>
-
- * PropertyProvider.cs: Worked on propertygrid localization.
-
-2009-02-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.addin.xml: Track merge of the project
- pad context menu.
-
-2009-02-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileData.cs:
- * SimpleProjectMakefileHandler.cs: Track api changes.
-
-2009-02-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/configure.ac.template: Fix for bug #465118 -
- AM_MAINTANER_MODE missing from generated configure.ac.
-
-2009-02-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/Makefile.include: Added targets for installing
- satellite assemblies.
-
-2009-02-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * AutotoolsContext.cs:
- * SolutionDeployer.cs: Read templates from the right
- directory.
-
- * MakefileData.cs: Track api changes.
-
-2009-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Autotools.addin.xml: Move template file location
- to a subdirectory to match the location MSBuild and MD copy
- them.
-
- * MonoDevelop.Autotools.csproj: Copy templates to output only
- if newer.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.mdp:
- * MonoDevelop.Autotools.csproj: Migrated to MSBuild file
- format.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Autotools.addin.xml: Bump MD version.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.Autotools.GenerateMakefilesDialog.cs:
- * gtk-gui/MonoDevelop.Autotools.MakefileOptionPanelWidget.cs:
- * gtk-gui/MonoDevelop.Autotools.TarballBuilderEditorWidget.cs:
- *
- gtk-gui/MonoDevelop.Autotools.MakefileIntegrationFeatureWidget.cs:
- Flush.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * CustomMakefile.cs: Make some regex static.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Autotools.mdp: Flush project format changes.
-
-2009-01-19 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MakefileData.cs: Update vala error regex to catch gcc errors as well.
-
-2009-01-15 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MakefileOptionPanelWidget.cs: Don't overwrite saved targets.
-
-2009-01-14 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MakefileData.cs: Add vala error regexes.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.mdp: All projects now require fx 3.5.
-
-2008-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileData.cs:
- * SimpleProjectMakefileHandler.cs: Track API changes.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.mdp: Don't require a specific version of
- Mono.Addins.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * AssemblyInfo.cs: Add AssemblyInfo.cs files that are autogenerated from
- the addin manifests.
-
-2008-11-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileOptionPanelWidget.cs: Avoid asking for creating makefiles when
- switching pages.
-
-2008-11-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Commands.cs:
- * MakefileOptionPanelWidget.cs: When enabling makefile integration, if
- no makefiles are found in the project directory, show a message
- offering generating them.
-
-2008-11-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileProjectServiceExtension.cs: Allow executing when a makefile
- execution target is defined.
-
- * Makefile.am: Fix parallel build issues.
-
-2008-11-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Fix build dependencies.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.addin.xml: Bump MD version.
-
-2008-11-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * SimpleProjectMakefileHandler.cs: Fix naming of satellite assemblies.
- Base name must be the name of the original assembly, not the default
- namespace.
-
- * MakefileProjectServiceExtension.cs: Include referenced configure.in
- file in the item's list.
-
- * MakefileData.cs: Fix string formatting.
-
-2008-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Autotools.addin.xml, FileNodeBuilderExtension.cs: Added
- quick property for enabling inclusion in makefiles synching.
- Supports multi-select.
- * SimpleProjectMakefileHandler.cs, MakefileData.cs: Track API.
-
-2008-09-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * SimpleProjectMakefileHandler.cs: If an assembly is going to be
- signed, make sure the key is distributed.
-
-2008-09-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/Makefile.include: Set MONO_IOMAP=drive when running resgen
- since resx files may contain Windows style paths. Fixes bug
- #398812.
- * gtk-gui/objects.xml: Update.
-
-2008-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.mdp: Updated projects.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileIntegrationFeatureWidget.cs, gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.Autotools.MakefileIntegrationFeatureWidget.cs,
- gtk-gui/MonoDevelop.Autotools.TarballBuilderEditorWidget.cs,
- gtk-gui/objects.xml,
- gtk-gui/MonoDevelop.Autotools.MakefileOptionPanelWidget.cs,
- gtk-gui/MonoDevelop.Autotools.GenerateMakefilesDialog.cs: Updated
- generated code.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * FileNodeBuilderExtension.cs, Commands.cs: Moved the extensible tree
- view to its own directory.
-
-2008-08-15 Dean Brettle <dean@brettle.com>
-
- * SimpleProjectMakefileHandler.cs:
- Fixed bug 417791 by using "resgen1" (for ClrVersion.Net_1_1 )
- and "resgen2" for ClrVersion.Net_2_0, but only when the current
- runtime major version is greater than 1.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Autotools.mdp: Removed some parts of the documentation
- service.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Handler.cs, MakefileData.cs, MakefileVar.cs,
- SimpleProjectMakefileHandler.cs, SolutionDeployer.cs: Moved
- serialization engine to MonoDevelop.Core. Use new syntax for
- specifying attribute scope.
-
-2008-06-10 Andres G. Aragoneses <aaragoneses@novell.com>
-
- * SimpleProjectMakefileHandler.cs: Implement feature to allow unmanaged
- project references in a managed project (bug#397490).
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * SimpleProjectMakefileHandler.cs: GetOutputFileName now requires a
- solution configuration, not a project configuration.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.addin.xml: Bump MD version.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.addin.xml: Merged the extension points for
- project and solution option panels into a single extension point. A
- single extension point will now be used for all kinds of items.
- Extension conditions can be used to make panels visible only for
- some specific item types.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileProjectServiceExtension.cs: Replaced
- ICompilerResult/DefaultCompilerResult/CompilerResults by a new
- BuildResult class, which has owner information at error level, so
- it is possible to know which project generated an error when
- building a solution. Updated Task and TaskService to use the new
- owner information.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileGeneratorTool.cs, IMakefileHandler.cs,
- MonoDevelop.Autotools.addin.xml, ImportMakefileDialog.cs,
- MakefileOptionPanelWidget.cs, MakefileReaderExtension.cs,
- MakefileProject.cs, SolutionMakefileHandler.cs,
- SimpleProjectMakefileHandler.cs, Handler.cs, SolutionDeployer.cs,
- MakefileProjectServiceExtension.cs, MakefileOptionPanel.cs,
- FileNodeBuilderExtension.cs, templates/autogen.sh.template,
- templates/rules.make, GenerateMakefilesDialog.cs,
- MakefileIntegrationFeature.cs, AutotoolsContext.cs, Commands.cs,
- gtk-gui/MonoDevelop.Autotools.GenerateMakefilesDialog.cs,
- gtk-gui/gui.stetic, TarballBuilderEditorWidget.cs, MakefileData.cs,
- CustomMakefile.cs: New project model changes.
-
-2008-04-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Autotools.TarballBuilderEditorWidget.cs: Updated.
- * MakefileData.cs: Added regex for boo messages.
-
-2008-03-27 Ankit Jain <jankit@novell.com>
-
- * templates/Makefile.solution.template:
- * templates/make-dist.targets:
- * templates/rules.make: Remove evil bash arrays.
- Fixes from Raja Harinath.
-
-2008-03-26 Ankit Jain <jankit@novell.com>
-
- Add support for handling paths containing spaces.
- Fix bug #353979.
- * SimpleMakefileHandler.cs (EscapeSpace): New.
- Escape and quote paths appropriately.
- * SolutionMakefileHandler.cs: Include Makefile.include also.
- * templates/Makefile.noauto.project.template:
- * templates/Makefile.am.project.template: Use emit_resgen_targets macro.
- Use '$(shell dirname ' instead of '$(dir ' as it can't handle paths with
- spaces.
- * templates/Makefile.include:
- * templates/make-dist.targets:
- * templates/Makefile.solution.template:
- * templates/rules.make: Add the necessary changes for the support.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * ImportMakefileDialog.cs, MakefileOptionPanelWidget.cs, Commands.cs,
- gtk-gui/MonoDevelop.Autotools.MakefileOptionPanelWidget.cs,
- gtk-gui/gui.stetic, MakefileData.cs: Worked on gnome hig compliant
- alerts.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Autotools.mdp, Makefile.am: Removed some unused glade and
- gnome-sharp references (only the unused). But I'll continue to remove
- glade, we need to lower the dependency tree a bit.
-
-2008-02-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Autotools.addin.xml: Track main menu layout changes.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.addin.xml: Update MD version.
-
-2008-01-24 Ankit Jain <jankit@novell.com>
- Raja R Harinath <harinath@gmail.com>
-
- Fix bugs #333847.
- * SimpleProjectMakefileHandler.cs:
- * SolutionDeployer.cs:
- * templates/Makefile.am.project.template:
- * templates/Makefile.include:
- * templates/Makefile.noauto.project.template:
- Add support for generating satellite assemblies.
-
-2008-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.addin.xml: Updated add-in category and description.
-
-2008-01-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.addin.xml, MonoDevelop.Autotools.mdp,
- SimpleProjectMakefileHandler.cs, Handler.cs, SolutionDeployer.cs,
- templates/expansions.m4, templates/configure.template,
- templates/configure.ac.template, Makefile.am: Properly implement support
- for libdir, bindir and datadir in both autotools and simple makefiles.
- Fixes bug #354128.
-
-2008-01-20 Ankit Jain <jankit@novell.com>
-
- * Change Console.WriteLines to LoggingService calls.
-
-2008-01-19 Ankit Jain <jankit@novell.com>
-
- * SimpleProjectMakefileHandler.cs: Ensure that custom-hooks.make is
- included after the first target (all:). If the file exists then add it
- to EXTRA_DIST.
- Track change in emit-deploy-wrapper macro.
- * SolutionDeployer.cs: Emit sed script to generate wrapper only for
- simple makefiles.
- * SolutionMakefileHandler.cs: Use AppendToVariable for EXTRA_DIST, to
- allow a project to add to EXTRA_DIST.
- * templates/Makefile.include: sed is not required for autotools based
- makefiles.
- * templates/Makefile.auto.project.template: Add INCLUDE_CUSTOM_HOOKS
- after 'all:' target.
-
-2008-01-16 Ankit Jain <jankit@novell.com>
-
- * SolutionDeployer.cs: Sort the list of common and required packages
- emitted in the configure script.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MakefileData.cs: Improve grammar/formatting for translatable strings.
- Replace console writes with logging.
- * MakefileOptionPanelWidget.cs, SimpleProjectMakefileHandler.cs: Improve
- formatting of translatable strings.
-
-2007-12-31 Ankit Jain <jankit@novell.com>
-
- * SimpleProjectMakefileHandler.cs: Use macros for emitting deploy
- targets. Saves lot of redundant lines.
- Honor dir structure of the source deploy file (eg. f1/f2/foo.txt should
- be deployed to BUILD_DIR/f1/f2/foo.txt). Do this for install/uninstall
- targets also.
- * templates/Makefile.include: Add macros for emitting deploy targets.
- * templates/Makefile.am.project.template: Fix positioning of include
- Makefile.include to fix macros for autotools based makefiles.
-
-2007-12-21 Miguel de Icaza <miguel@novell.com>
-
-
-
-2007-12-20 Ankit Jain <jankit@novell.com>
-
- * MakefileGeneratorTool.cs: Use GettextCatalog.GetString for
- user-visible strings.
-
-2007-12-18 Ankit Jain <jankit@novell.com>
-
- Fix bug #349419
- * SimpleProjectMakefileHandler.cs: Honor DESTDIR.
- * templates/Makefile.solution.template: Make sure exit_codes work
- (escape shell so $$final_exit means something)
- * templates/make-dist.targets: Remove spurious spaces.
- Based on patches by Wade Berrier.
-
-2007-12-17 Ankit Jain <jankit@novell.com>
-
- * Minor fixes like use String.Empty instead of "" etc.
-
-2007-12-14 Ankit Jain <jankit@novell.com>
-
- * MakefileData.cs: Re-init Build vars when the owner project gets set.
-
-2007-12-14 Ankit Jain <jankit@novell.com>
-
- * SolutionDeployer.cs: Remove dead code.
-
-2007-12-14 Ankit Jain <jankit@novell.com>
-
- Fix bug #347649
- * AutotoolsContext.cs (AddRequiredPackages): Allow packages to be
- specified per config.
- (GetRequiredPackages): Per config.
- (GetCommonRequiredPackages): Packages common to all configs.
- * Set.cs (Intersect): New.
- (Count): New.
- (ToString): Override.
- * SimpleProjectMakefileHandler.cs: Keep track of packages per config.
- * SolutionDeployer.cs: Emit package requirements per config in
- configure.ac and the configure script.
- * templates/configure.ac.template: Update.
- * templates/configure.template: Update to check per config packages.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.mdp: Updated project files. The order of extended
- properties won't change anymore.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/configure.template: Applied some fixes from the MD config
- script.
- * gtk-gui/MonoDevelop.Autotools.TarballBuilderEditorWidget.cs: Updated.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.addin.xml: Bump add-in versions.
-
-2007-12-11 Ankit Jain <jankit@novell.com>
-
- * MakefileData.cs: Use LoggingService.
-
-2007-12-07 Ankit Jain <jankit@novell.com>
-
- Fix bug #344837.
- * MakefileOptionPanelWidget.cs: Improve error message.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.mdp, gtk-gui/gui.stetic, Makefile.am: Directory
- reorganization.
-
-2007-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * SimpleProjectMakefileHandler.cs: Fix warnings.
-
-2007-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * TemplateEngine.cs, MakefileData.cs: Track LoggingService API changes.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.addin.xml: Bump MD version.
-
-2007-10-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.Autotools.MakefileIntegrationFeatureWidget.cs,
- gtk-gui/MonoDevelop.Autotools.TarballBuilderEditorWidget.cs,
- gtk-gui/MonoDevelop.Autotools.MakefileOptionPanelWidget.cs,
- gtk-gui/MonoDevelop.Autotools.GenerateMakefilesDialog.cs,
- gtk-gui/gui.stetic, TarballBuilderEditorWidget.cs: Cosmetic fixes in the
- tarball options dialog. Use a radio button instead of a checkbox to
- choose between simple and autotools based makefile.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileIntegrationFeature.cs: Track api changes. Add description
- property.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.mdp: Project file names updated by change in MD path
- functions.
-
-2007-10-16 Ankit Jain <jankit@novell.com>
-
- * SimpleProjectMakefileHandler.cs (Deploy): Add support for emitting
- custom commands for simple makefiles.
- (EmitCustomCommandTargets): New.
- * templates/Makefile.noauto.project.template: Insert calls to *Build targets.
- * templates/rules.make: Insert calls to *Clean targets and add empty default
- targets for the custom commands.
-
-2007-10-12 Mike Krüger <mkrueger@novell.com>
-
- * SolutionMakefileHandler.cs, SimpleProjectMakefileHandler.cs, Handler.cs,
- SolutionDeployer.cs, AutotoolsContext.cs, MakefileData.cs: Applied
- changes that were neccassary for to the new FileService.
-
-2007-09-28 Ankit Jain <jankit@novell.com>
-
- Fix bug #325674.
- * MakefileOptionPanelWidget.cs: Use FocusChildSet event instead of
- FocusoutEvent for the makefile entry widget.
-
-2007-09-28 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MakefileData.cs (InitCompilerMessageRegex): Cosmetic fix.
-
-2007-09-28 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MakefileData.cs: Update standard gcc regex to also match column info.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.addin.xml: Bump MD version.
-
-2007-09-04 Michael Hutchinson <MHutchinson@novell.com>
-
- * MakefileOptionPanelWidget.cs, MakefileOptionPanel.cs: Fix some compile
- warnings.
-
-2007-08-31 Mike Krüger <mkrueger@novell.com>
-
- * MakefileOptionPanelWidget.cs, MakefileOptionPanel.cs: Changes due to new
- property infrastructure.
-
-2007-08-23 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * Handler.cs: Added support for Include and IncludeRoot targets.
-
-2007-08-22 Ankit Jain <jankit@novell.com>
-
- * templates/*: Add invocation for various hooks.
- * SimpleProjectMakefileHandler.cs: Include custom-hooks.make .
- * SolutionMakefileHandler.cs: Include custom-hooks.make . Emit
- invocation for hooks.
-
-2007-08-22 Ankit Jain <jankit@novell.com>
-
- * templates/Makefile.solution.template: Replace all *-recursive targets
- with a single %-recursive target.
- * templates/*: minor updates.
- * SimpleProjectMakefileHandler.cs: Update.
-
-2007-08-22 Ankit Jain <jankit@novell.com>
-
- * templates/*: Improve generated makefiles to support '-k'.
-
-2007-08-21 Ankit Jain <jankit@novell.com>
-
- * ConfigSection.cs: New.
- * SimpleProjectMakefileHandler.cs: Refactor to support correctly
- building multiple configurations. Referenced assembly names/paths can depend
- on the config (Eg. for project references).
- * TemplateEngine.cs: Update to use typed Dictionary instead of
- hashtable.
- * templates/Makefile.am.project.template:
- * templates/Makefile.noauto.project.template: $(ASSEMBLY).mdb might not
- be available in all configs.
- * templates/Makefile.solution.template: Exit if build/install for a
- subdir fails.
- * templates/make-dist.targets: Subdir could be multilevel, so use
- absolute paths for 'dist'.
- * templates/rules.make: Likewise.
-
- * SolutionDeployer.cs (GenerateFiles): Emit exception stack trace also.
-
-2007-08-21 Ankit Jain <jankit@novell.com>
-
- * MakefileGeneratorTool.cs: Add short option "-s" for
- --simple-makefiles.
-
-2007-08-14 Ankit Jain <jankit@novell.com>
-
- Add uninstall target.
- * SimpleProjectMakefileHandler.cs: Emit uninstall rules.
- * SolutionMakefileHandler.cs: Emit uninstall target.
- * templates/Makefile.noauto.project.template:
- * templates/Makefile.solution.template: Add uninstall target.
-
-2007-08-10 Ankit Jain <jankit@novell.com>
-
- * templates/*: Update to support generating partial classes with xamlg.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.mdp, Makefile.am: Don't exclude the addin.xml file
- from the makefile.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * IMakefileHandler.cs, MonoDevelop.Autotools.addin.xml,
- MonoDevelop.Autotools.mdp, SolutionMakefileHandler.cs,
- SimpleProjectMakefileHandler.cs, SolutionDeployer.cs,
- AutotoolsContext.cs, Makefile.am: Added an extension point for
- registering new IMakefileHandlers.
- * TemplateEngine.cs: Removed log4net dependency.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Add missing resoruce.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.addin.xml, MonoDevelop.Autotools.mdp,
- SimpleProjectMakefileHandler.cs,
- gtk-gui/MonoDevelop.Autotools.TarballBuilderEditorWidget.cs,
- gtk-gui/gui.stetic, Makefile.am: Reorganized the extension point
- hierarchy. Embedded all add-in manifests as resources.
-
-2007-08-03 Ankit Jain <jankit@novell.com>
-
- Fix bug#82254.
- * Commands.cs (NodeExtension.CanBuildNode): Allow for CombineEntry also.
- (AutotoolsCommandHandler.OnGenerate): Handle command for projects.
- * MonoDevelop.Autotools.addin.xml: Add GenerateFiles to project's context
- menu.
-
-2007-08-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileReaderExtension.cs, Makefile.am: Converted DispatchService to a
- static class.
-
-2007-08-02 Ankit Jain <jankit@novell.com>
-
- * templates/make-dist.targets: Forgot to commit this!
-
-2007-08-02 Ankit Jain <jankit@novell.com>
-
- * AutotoolsContext.cs (TargetCombine): New. Combine on which 'Generate
- makefiles' command was invoked.
- * SolutionDeployer.cs: Set TargetCombine.
- * SimpleProjectMakefileHandler.cs: Update to use TargetCombine instead
- of RootCombine.
-
- Fixes to handle nested solutions.
- * SolutionMakefileHandler.cs (Deploy):
- * templates/Makefile.solution.template:
- * templates/rules.make:
- * templates/make-dist.targets: New.
-
-2007-07-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * SolutionOptionsPanel.cs: Removed unused file.
-
-2007-07-31 Ankit Jain <jankit@novell.com>
-
- * MakefileGeneratorTool.cs:
- * MonoDevelop.Autotools.addin.xml: New. Tool for generating makefiles.
- * Makefile.am: Update.
- * MonoDevelop.Autotools.mdp: Update.
-
-2007-07-30 Ankit Jain <jankit@novell.com>
-
- * MakefileData.cs (ConfiguredPackagesManager.ReadPackagesList): Handle
- [] used for quoting m4 strings.
-
-2007-07-30 Ankit Jain <jankit@novell.com>
-
- * SimpleProjectMakefileHandler.cs (Deploy): Make prefix for REFERENCES
- variable consistent with other ref variables.
- Fix emitted path for DLL_REFERENCES to be compatible with makefile integration.
- * SolutionDeployer.cs (CreateConfigureDotAC): Use @defaultConf.
- * templates/Makefile.include: Update to add prefix for REFERENCES (when required).
- * templates/configure.template: Small fix.
-
-2007-07-25 Ankit Jain <jankit@novell.com>
-
- * templates/configure.template: Don't use "\n" or "\t" in echo-s, sh doesn't
- seem to be able to handle them.
-
-2007-07-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.addin.xml, MonoDevelop.Autotools.mdp,
- gtk-gui/MonoDevelop.Autotools.GenerateMakefilesDialog.cs,
- gtk-gui/gui.stetic: Cosmetic fixes.
-
-2007-07-25 Ankit Jain <jankit@novell.com>
-
- * SimpleProjectMakefileHandler.cs (Deploy): 'chmod +x' exe-wrappers.
- Ensure that .in files are regen'ed on configure.
-
-2007-07-25 Ankit Jain <jankit@novell.com>
-
- * GenerateMakefilesDialog.cs:
- * gtk-gui/MonoDevelop.Autotools.GenerateMakefilesDialog.cs:
- * gtk-gui/gui.stetic:
- Use radio buttons instead of a checkbox.
- * templates/configure.template: Improve message.
-
-2007-07-24 Ankit Jain <jankit@novell.com>
-
- * templates/Makefile.noauto.project.template:
- * templates/Makefile.solution.template:
- * templates/configure.template:
- * templates/rules.make:
- Missed these too :(
-
-2007-07-24 Ankit Jain <jankit@novell.com>
-
- * GenerateMakefilesDialog.cs:
- * gtk-gui/MonoDevelop.Autotools.GenerateMakefilesDialog.cs:
- Oops, forgot to commit!
-
-2007-07-24 Ankit Jain <jankit@novell.com>
-
- Add support for generating non-autotools (simple) makefiles.
-
- * SolutionDeployer.cs: Update to use new templates for simple
- makefiles and generate those.
- * SolutionMakefileHandler.cs: Likewise.
- * SimpleProjectMakefileHandler.cs: Likewise.
-
- * AutotoolsContext.cs (TemplateDir): New.
- (GetConfigurations): New.
- (AddGeneratedFile): New.
- (GetGeneratedFiles): New.
- * Commands.cs: Ask user whether to generate simple makefiles with
- GenerateMakefilesDialog.
- * Handler.cs (GenerateAutotools): New.
-
- * GenerateMakefilesDialog.cs: New.
- * gtk-gui/MonoDevelop.Autotools.GenerateMakefilesDialog.cs: New.
- * TarballBuilderEditorWidget.cs: Add a checkbox for 'Autotools files'.
- * gtk-gui/MonoDevelop.Autotools.TarballBuilderEditorWidget.cs: New.
- * gtk-gui/Gui.stetic: Updated.
-
- * templates/Makefile.am.project.template: Update.
- * templates/Makefile.noauto.project.template: New. Makefile template for
- projects.
- * templates/Makefile.solution.template: New. Simple makefile for top
- level solution.
- * templates/configure.template: New. Configure script.
- * templates/rules.make: New.
-
- * Makefile.am: Update to include the new files.
- * MonoDevelop.Autotools.mdp: Likewise.
- * MonoDevelop.Autotools.addin.xml: Update menu item from 'Generate
- autotools files' to 'Generate makefiles'.
-
-2007-07-17 Ankit Jain <jankit@novell.com>
-
- * MakefileData.cs (PackagedAssemblyNames): Rename to ..
- (CorePackageAssemblyNames): .. this. This has entries for assemblies
- from the 'core' package only.
- * MakefileOptionPanelWidget.cs (CheckRefs): Track changes in api.
-
-2007-07-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * SolutionMakefileHandler.cs, AutotoolsContext.cs: Keep track of the
- project build sequence in AutotoolsContext. In CalculateSubDirOrder
- ignore references to projects built earlier in the build sequence.
- Fixes bug #80588. Also, track changes in the Set class.
- * SimpleProjectMakefileHandler.cs, Set.cs: Set is now a generic class.
-
-2007-07-11 Ankit Jain <jankit@novell.com>
-
- * MakefileOptionPanelWidget.cs (FindConfigureScript): New.
- (GuessVariables): Try to look for configure.(in|ac) script.
- (ResetAll): Reset the configure script related widgets also.
-
-2007-07-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileOptionPanelWidget.cs, MakefileData.cs: Load configure.ac in
- place of configure.in if it exist.
- * gtk-gui/objects.xml: Updated.
-
-2007-06-18 Ankit Jain <jankit@novell.com>
-
- * MakefileOptionPanelWidget.cs: On loading a new makefile, try to guess
- possible variables and prefixes for various lists like files, references etc.
- If guess'ing fails, then try some usual variable names.
- When a variable is selected in the combo by the user, try to guess the
- prefix.
-
-2007-06-18 Ankit Jain <jankit@novell.com>
-
- * MakefileData.cs (PackagedAssemblyNames): New. Table for mapping short
- assembly names (like System.Xml) to their full names.
- (ParseReferenceAsGac): Use the new PackagedAssemblyNames table. This will
- help avoid doing Assembly.Load to find full names for names
- like System.Xml . Speeds up loading for large projects.
-
-2007-06-14 Ankit Jain <jankit@novell.com>
-
- * MakefileData.cs (PkgManagerTable): New. A global table to keep weak
- references to ConfiguredPackagesManager objects.
- (UpdateProject): Use the new PkgManagerTable.
- (ConfiguredPackagesManager.LastWriteTime): New.
-
-2007-06-07 Ankit Jain <jankit@novell.com>
-
- * AutotoolsContext.cs (NormalizeRelativePath): Moved to Runtime.FileService .
- Track api change.
- * SimpleProjectMakefileHandler.cs: Track api change.
- * SolutionDeployer.cs: Track api change.
-
-2007-05-31 Ankit Jain <jankit@novell.com>
-
- * SimpleProjectMakefileHandler.cs: Comment out all .pc file generation
- related code. It is handled by the deployment infrastructure.
- * SolutionDeployer.cs (GenerateFiles): Remove code related to .pc file
- generation.
-
- SolutionOptionsPanel.cs is not used now.
- * Makefile.am: Remove SolutionOptionsPanel.cs from the list of files.
- * MonoDevelop.Autotools.mdp: Likewise
- * MonoDevelop.Autotools.addin.xml: Remove extensions related to
- SolutionOptionsPanel.
-
-2007-05-29 Ankit Jain <jankit@novell.com>
-
- * SimpleProjectMakefileHandler.cs (Deploy): GetDeployFiles can return
- duplicates, ignore them. Update code for change in GetProjectConfig.
- (GetProjectConfig): Look for project's config in ParentCombine's
- configs.
-
-2007-05-29 Ankit Jain <jankit@novell.com>
-
- * SimpleProjectMakefileHandler.cs (Deploy): Enumerate solution level
- configs, and use the corresponding project config for emitting Makefile.am
- (GetProjectConfig): New.
- * AutotoolsContext.cs (EscapeStringForAutoconf): Escape '|' .
-
-2007-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.mdp,
- gtk-gui/MonoDevelop.Autotools.TarballBuilderEditorWidget.cs,
- gtk-gui/MonoDevelop.Autotools.MakefileOptionPanelWidget.cs,
- gtk-gui/gui.stetic: Updated.
- * Handler.cs: Report an error when the project can't be exported. This
- fixes bug #81755.
- * TarballBuilderEditorWidget.cs: Make it work when the selected root
- entry is not a combine.
-
-2007-05-24 Ankit Jain <jankit@novell.com>
-
- * SolutionMakefileHandler.cs (Deploy): Emit an empty initializer for
- EXTRA_DIST in makefiles for projects which have their own directory.
- Include project specific makefile only if required.
- * SimpleProjectMakefileHandler.cs (Deploy): Don't emit a project
- specific *.make file.
-
- * templates/Makefile.include (EXTRA_DIST): Use = instead of +=.
- * templates/Project.make.template: Remove the file and move contents ..
- * templates/Makefile.am.project.template: .. here.
- * Makefile.am: Update.
- * MonoDevelop.Autotools.mdp: Update.
-
-2007-05-24 Ankit Jain <jankit@novell.com>
- Raja R Harinath <rharinath@novell.com>
-
- * SolutionMakefileHandler.cs (Deploy): If a project is in the same
- directory as the solution, then directly "include" the project specific
- makefile in the solution's Makefile.am .
- * SimpleProjectMakefileHandler.cs (Deploy): Treat all assembly
- references as globalReferencedFiles. Emit path relative to $(BUILD_DIR).
- Emit deploy-files path relative to project's directory.
- Emit project specific makefiles.
- * SolutionDeployer.cs: Normalize paths emitted.
-
- * AutotoolsContext.cs (AddGlobalReferencedFile): New.
- * Makefile.cs (Write): Write variables before the "content".
- * Makefile.am: Add new Project.make.template .
- * MonoDevelop.Autotools.mdp: Update.
-
- * templates/Makefile.include (EXTRA_DIST): Use += .
- (DISTCLEANFILES): Add $(BUILD_DIR)/* .
- * templates/Makefile.am.project.template: Add placeholder for including
- project specific makefile. Move older contents to ..
- * templates/Project.make.template: .. here.
-
-2007-05-22 Ankit Jain <jankit@novell.com>
- Raja R Harinath <rharinath@novell.com>
-
- * SimpleProjectMakefileHandler.cs (Deploy): Emit resgen script name.
- Emit resourceId if required.
- * templates/Makefile.include, templates/Makefile.am: Several improvements.
- Added support for compiling resx resources with custom resource ids.
-
-2007-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.addin.xml: Removed empty extension element.
- * PropertyProvider.cs: Added a more complete description of the
- IncludeInMakefile property.
-
-2007-05-16 Ankit Jain <jankit@novell.com>
-
- * AutotoolsContext.cs (EscapeAndUpperConfigName): New.
- (EscapeStringForAutoconf): Escape ' ' also.
- * SolutionMakefileHandler.cs: Use EscapeAndUpperConfigName when emitting
- config name.
- * SimpleProjectMakefileHandler.cs: Likewise.
- * SolutionDeployer.cs: Likewise.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.mdp: Don't copy project references.
- * Makefile.am: Updated.
-
-2007-05-10 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.Autotools.mdp: Add MonoDevelop.Autotools.addin.xml
- back to the file list, but exclude from makefile synching.
-
-2007-05-09 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.Autotools/Makefile.am: Eliminate duplication of
- MonoDevelop.Autotools.addin.xml target.
- Fix dependencies for DATA_FILE_BUILD.
-
-2007-05-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.addin.xml: Added missing dependency.
- * MonoDevelop.Autotools.mdp, Makefile.am: Updated assembly references.
- * MakefileData.cs: Use top_srcdir to reference files not generated at
- build time.
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.Addins.mdp: Updated.
- * Mono.Addins/ExtensionContext.cs: Fixed GetExtensionObjects overload
- which was not using the correct reuseCachedInstance value.
- * Mono.Addins/ExtensionTree.cs: Improved error message. When looking
- for a type in an assembly, avoid throwing an exception too early,
- since it may be found in other assemblies.
- * Mono.Addins.Database/AddinDatabase.cs: In the addin info cache, also
- store information about unsuccessful lookups, to avoid looking for
- an add-in again if we found that it doesn't exist. In Update(),
- don't use verbose output by default.
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.addin.xml, MonoDevelop.Autotools.mdp,
- SimpleProjectMakefileHandler.cs, gtk-gui/objects.xml, Makefile.am:
- Migration to Mono.Addins.
-
-2007-04-28 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MakefileData.cs: Use InvariantCulture for string sorting to stop
- reordering of file lists on different systems.
-
-2007-04-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * SolutionMakefileHandler.cs: Make sure that makefiles are generated in
- the same order in which they will be built, since there is some
- data collected by the context that it is important to get in the
- correct order (e.g. list of built files).
- * Set.cs: Avoid unneeded boxing.
-
-2007-04-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * SimpleProjectMakefileHandler.cs, SolutionDeployer.cs,
- templates/Makefile.include, templates/Makefile.am.project.template,
- AutotoolsContext.cs: Fixed several problems in the autotools file
- generation. Files to be deployed are now copied to the build
- directory (doing the change name if necessary), and they are
- installed from there. Fixes bug #81470.
-
-2007-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * Handler.cs, SolutionDeployer.cs: Fixed CanBuild method. Any combine
- entry for which there is a IMakefileHandler can be deployed.
-
-2007-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.addin.xml, MonoDevelop.Autotools.mdp,
- MakefileIntegrationFeatureWidget.cs, Handler.cs,
- MakefileIntegrationFeature.cs,
- gtk-gui/MonoDevelop.Autotools.MakefileIntegrationFeatureWidget.cs,
- gtk-gui/objects.xml, gtk-gui/gui.stetic, Makefile.am: Added classes
- for supporting a makefile integration project feature, but it is
- not yet enabled.
-
-2007-04-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.mdp, Makefile.am: Synchronized project with
- makefile.
- * Handler.cs, SolutionDeployer.cs: Allow creating a tarball from
- autotools files already generated, instead of always generating new
- files.
- * MakefileProjectServiceExtension.cs: Include referenced makefiles when
- exporting a project.
- * TarballBuilderEditorWidget.cs, TarballTargetEditorWidget.cs,
- gtk-gui/MonoDevelop.Autotools.TarballBuilderEditorWidget.cs,
- gtk-gui/gui.stetic: Implemented the tarball configuration editor
- using stetic.
- * gtk-gui/objects.xml: Updated.
- * MakefileData.cs: Fixed warning.
-
-2007-04-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * SimpleProjectMakefileHandler.cs, TarballTargetEditorWidget.cs: Track
- api changes.
- * Handler.cs: Track api changes. Added support for exporting a
- selection of projects from a solution.
-
-2007-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.addin.xml, Commands.cs,
- TarballTargetEditorWidget.cs: Track api changes in deployment api.
- * MonoDevelop.Autotools.mdp, gtk-gui/gui.stetic, Makefile.am: Added
- dependency to MonoDevelop.Deployment.
- * SolutionMakefileHandler.cs: Allow generating makefiles a combine even
- if it contains unsupported projects. Those will be ignored.
- * SimpleProjectMakefileHandler.cs, Handler.cs, SolutionDeployer.cs,
- templates/Makefile.include: Use the new deployment api to get the
- list of files to deploy.
- * FileNodeBuilderExtension.cs, MakefileData.cs: Moved makefile
- integration check to MakefileData.
- * AutotoolsContext.cs: Keep a list of directories to deploy. Store the
- DeployContext in a field.
- * PropertyProvider.cs: New property provider which allows setting the
- makefile integration flag for each file.
- * gtk-gui/objects.xml: Updated.
-
-2007-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Handler.cs: Remove unused namespace.
-
-2007-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Handler.cs, MonoDevelop.Autotools.addin.xml: Track API changes.
- * MonoDevelop.Autotools.mdp: Don't local-copy references.
-
-2007-03-29 Ankit Jain <jankit@novell.com>
-
- * MakefileOptionPanelWidget.cs: Ensure reference combos are disabled for
- non-dotnet projects even when enabling for the first time.
-
-2007-03-28 Ankit Jain <jankit@novell.com>
-
- * MakefileOptionPanelWidget.cs: Disable References combos etc for
- non-dotnet projects.
-
-2007-03-28 Ankit Jain <jankit@novell.com>
-
- * MakefileOptionPanelWidget.cs (FillCombos): Sort list of variables.
-
-2007-03-28 Ankit Jain <jankit@novell.com>
-
- * CustomMakefile.cs (InitVarToValuesDict): Skip blank entries.
- * MakefileData.cs: Replace StartsWith with direct comparisons for small
- strings. For references, ignore empty entries.
- (ParseReference):
- (GacRefToString): Catch specific exceptions for AssemblyName.GetAssemblyName
-
-2007-03-21 Ankit Jain <jankit@novell.com>
-
- * MakefileData.cs (PkgCheckModulesRegex): Fix regex to correctly handle
- strings like 'PKG_CHECK_MODULES(FOO,foo0 >= 2.4 foo1 foo2)', this should
- give 3 packages : foo0, foo1 and foo2.
-
-2007-03-04 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.Autotools/Handler.cs: make strings translatable.
-
-2007-03-04 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * gtk-gui/MonoDevelop.Autotools.MakefileOptionPanelWidget.cs,
- * gtk-gui/gui.stetic: make all strings in option panel translatable.
-
-2007-02-28 Ankit Jain <jankit@novell.com>
-
- * MakefileData.cs (WriteFiles): Ignore directory entries.
-
-2007-02-22 Ankit Jain <jankit@novell.com>
-
- * MakefileOptionPanelWidget.cs: Disable the AssemblyName and OutputDir
- combos, as they are not being used right now.
- * gtk-gui/*: Update.
-
-2007-02-21 Ankit Jain <jankit@novell.com>
-
- * CustomMakefile.cs: Avoid adding extra spaces for empty variables.
-
-2007-02-20 Ankit Jain <jankit@novell.com>
-
- * MakefileData.cs: Support escaping filenames. Escaping only '\' and '#'
- currently.
-
-2007-02-20 Ankit Jain <jankit@novell.com>
-
- * MakefileOptionPanelWidget.cs: Ensure that entry boxes for make targets
- are activated only if required when loading the gui. These should be
- activated only if a valid makefile is specified.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Autotools.addin.xml: Change add-in versions to 0.13.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileProjectServiceExtension.cs: Don't run make if the build
- target is not specified.
- * MonoDevelop.Autotools.addin.xml, FileNodeBuilderExtension.cs,
- Commands.cs, MakefileData.cs: Allow excluding a file from the
- makefile integration. Added menu option for enabling/disabling the
- exclusion.
- * MakefileOptionPanelWidget.cs,
- gtk-gui/MonoDevelop.Autotools.MakefileOptionPanelWidget.cs,
- gtk-gui/gui.stetic: Added checkboxes for enabling/disabling
- makefile targets.
- * MonoDevelop.Autotools.mdp, Makefile.am: Added new file.
-
-2007-02-13 Ankit Jain <jankit@novell.com>
-
- * MakefileData.cs: Add support for custom regexes for compiler messages.
- * MakefileOptionPanelWidget.cs: Add widgets for custom regex.
- * MakefileProjectServiceExtension.cs: Use the new custom regexes
- MakefileData.
-
-2007-02-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * SimpleProjectMakefileHandler.cs: Fix spelling.
-
-2007-02-09 Ankit Jain <jankit@novell.com>
-
- * MakefileData.cs: Avoid unnecessary add/remove for references.
-
-2007-02-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * CustomMakefile.cs: Avoid adding or removing blank lines around
- variables.
-
-2007-02-09 Ankit Jain <jankit@novell.com>
-
- * MakefileOptionPanelWidget.cs: Add a null check.
- * MakefileData.cs: Refactor encodeValues into a property. Initiliaze it
- outside UpdateProject.
-
-2007-02-09 Ankit Jain <jankit@novell.com>
-
- * MakefileData.cs: Keep the list of references sorted in the makefile.
- * CustomMakefile.cs: Write to the makefile only if something changed.
-
-2007-02-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileProjectServiceExtension.cs: After reading a project, reset
- the needs building flag (to ignore changes done while loading)
- * Makefile.am: distckeck fixes.
-
-2007-02-08 Ankit Jain <jankit@novell.com>
-
- * MakefileData.cs: OutputFileName can be null for generic projects.
-
-2007-02-08 Ankit Jain <jankit@novell.com>
-
- * CustomMakefile.cs: Make Regex for makefile variables static.
-
-2007-02-08 Ankit Jain <jankit@novell.com>
-
- * MakefileProjectServiceExtension.cs (Load): Resolve project references
- once the top-level combine has loaded.
- * MakefileData.cs: Cache gac refererences to prevent repeats. Remove
- repeats from the project file, if any. Save the makefile after resolving
- project references.
- Add only valid assemblies as Gac refs, others could be project references.
- Prevent repeats for assembly/project references.
-
-2007-02-08 Ankit Jain <jankit@novell.com>
-
- * MakefileOptionPanelWidget.cs (.ctor): Don't set .Sensitive for
- fileEntryMakefilePath.
-
-2007-02-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileProjectServiceExtension.cs: Reset the needs building flag
- after successfully building a project.
- * MakefileData.cs: Cosmetic fixes. Remove "./" from relative names, and
- keep file lists sorted.
-
-2007-02-07 Ankit Jain <jankit@novell.com>
-
- * MakefileOptionPanelWidget.cs (Store): Save 'disabled' state.
-
-2007-02-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileProjectServiceExtension.cs: Track api changes. In
- GetNeedsBuilding, return what the default implementation provides.
- * MonoDevelop.Autotools.addin.xml: Unregistered the makefile reader.
- * MonoDevelop.Autotools.mdp: Minor update.
-
-2007-02-07 Ankit Jain <jankit@novell.com>
-
- * CustomMakefile.cs: Fix regex to allow empty variables.
-
-2007-02-07 Ankit Jain <jankit@novell.com>
-
- * MakefileData.cs (encodeValues): New. Dictionary to keep track of which
- variables to encode when emitting.
- (UpdateProject): Initialize encodeValues.
- (ReadFilesActual): Keep track of whether encoding is required or not.
- (ParseReference): Likewise. Alter signature to take a MakefileVar param.
- (ResolveBuildVars): Add a ref param 'varFound'
- (WriteFiles): EncodeFilename only if required.
- (AsmRefToString): Likewise.
-
-2007-02-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileData.cs: Write the resource id to the makefile only when
- really necessary.
-
-2007-02-07 Ankit Jain <jankit@novell.com>
-
- * MakefileProjectServiceExtension.cs (ParseOutput): Add a 'baseDir'
- param.
- (CreateCompilerErrorFromString): Use baseDir to convert relative paths
- to absolute.
-
-2007-02-06 Ankit Jain <jankit@novell.com>
-
- * MakefileProjectServiceExtension.cs (Execute): New.
- * MakefileOptionPanelWidget.cs: Add ExecuteTargetName and update.
- Trim () strings from entry boxes.
- * gtk-gui/*: Update.
- * MakefileData.cs (.ctor): Set default value for buildTargetName to "all".
-
-2007-02-06 Ankit Jain <jankit@novell.com>
-
- * MakefileOptionPanel.cs (CheckNonEmptyFileVar): Remove. Has been moved
- to MakefileOptionPanelWidget.cs
- * MakefileData.cs: Emit resourceId while writing only if atleast one of
- the resources had it when reading.
- * CustomMakefile.cs (Save): Remove dead code. Use StreamWriter.Write
- instead of StreamWriter.WriteLine
-
-2007-02-06 Ankit Jain <jankit@novell.com>
-
- * MakefileOptionPanelWidget.cs: Combo boxes for file variables should
- react to change in 'Sync' checkbox.
- * gtk-gui/*: Updated.
-
-2007-02-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MakefileOptionPanel.cs, MakefileOptionPanelWidget.cs: Moved all
- validation code from MakefileOptionPanel to
- MakefileOptionPanelWidget, so it can be reused by the import
- dialog.
- * ImportMakefileDialog.cs: New dialog for importing makefiles.
- * MonoDevelop.Autotools.addin.xml: Registered new extension.
- * MonoDevelop.Autotools.mdp, Makefile.am: Added new files.
- * MakefileReaderExtension.cs: Extension for importing makefiles into
- projects.
- * gtk-gui/MonoDevelop.Autotools.MakefileOptionPanelWidget.cs,
- gtk-gui/gui.stetic: Updated.
- * MakefileProject.cs: New project class.
-
-2007-02-05 Ankit Jain <jankit@novell.com>
-
- * MakefileProjectServiceExtension.cs: New.
- * MakefileData.cs: New.
- * MakefileVar.cs: New.
- * CustomMakefile.cs: New.
- * MakefileOptionPanel.cs: New.
- * MakefileOptionPanelWidget.cs: New.
- * gtk-gui/*: New.
- Initial implementation of support for limited Makefile Integration.
-
- * Makefile.am: Update.
- * MonoDevelop.Autotools.addin.xml: Update.
- * MonoDevelop.Autotools.mdp: Update.
-
-2007-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * Handler.cs: Track api changes.
-
-2006-12-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * SimpleProjectMakefileHandler.cs, SolutionDeployer.cs: Use the
- FileService for copying and deleting files.
-
-2006-11-24 Scott Ellington <scott.ellington@gmail.com>
-
- * SolutionDeployer.cs:
- * AutotoolsContext.cs:
- escape for periods for autoconf variables besides the version
- (fixes #79857)
- * templates/configure.ac.template: add a line to end of file to
- avoid bug http://www.mail-archive.com/bug-m4@gnu.org/msg01841.html
-
-2006-09-28 Matej Urbas <matej.urbas@gmail.com>
-
- * SolutionDeployer.cs: fixed the case of autotooling empty projects
- i.e. projects with no active configuration.
- * MonoDevelop.Autotools.mdp: Added...
-
-2006-08-31 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * SimpleProjectMakefileHandler.cs: Win32 pathing vs autotools fixes.
- * SolutionDeployer.cs: Win32 pathing vs autotools fixes, syscall workaround.
- * SolutionMakefileHandler.cs: Win32 pathing fixes.
-
-2006-08-19 Scott Ellington <scott.ellington@gmail.com>
-
- * SimpleProjectMakefileHandler.cs:
- * SolutionMakefileHandler.cs:
- don't handle configurations which are not in the top-level deployed
- solution
- * SolutionDeployer.cs: provide combine configurations to AutotoolsContext.
- always provide _LIB autoconf variables
- * AutotoolsContext.cs: store supported configurations
- * templates/exe.wrapper.in.template: cd into installed directory
-
-2006-08-14 Scott Ellington <scott.ellington@gmail.com>
-
- * SolutionDeployer.cs:
- * SimpleProjectMakefileHandler.cs:
- * MonoDevelop.Autotools.addin.xml:
- * templates/Makefile.include:
- * SolutionOptionsPanel.cs:
- add support for creating pc files per library
-
-2006-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * SimpleProjectMakefileHandler.cs:
- * templates/Makefile.include:
- * templates/Makefile.am.project.template: Add support for project files
- with the FileCopy build action.
-
-2006-07-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * SimpleProjectMakefileHandler.cs: Track changes in the SystemAssemblyService
- class.
-
-2006-07-12 Scott Ellington <scott.ellington@gmail.com>
-
- * SolutionDeployer.cs:
- * templates/package.pc.template:
- add Libraries variable
-
-2006-07-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * Handler.cs: Track changes in the deployment api.
- * MonoDevelop.Autotools.addin.xml: Updated versions.
-
-2006-06-28 Scott Ellington <scott.ellington@gmail.com>
-
- * Makefile.cs: can append values to variables
- * SolutionDeployer.cs: implement pkgconfig stuff
- * MonoDevelop.Autotools.addin.xml: add option panel and store pref
- * templates/package.pc.template: template for pc file
- * Makefile.am: add new files
- * SolutionOptionsPanel.cs: new option panel
-
-2006-06-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * TarballTargetEditorWidget.cs: Added null check. Fix the build for
- gtk# 2.4.
-
-2006-06-20 Scott Ellington <scott.ellington@gmail.com>
-
- * AutotoolsContext.cs:
- * templates/Makefile.am.project.template:
- * SimpleProjectMakefileHandler.cs: copy resources outside of
- autotools hierarchy into project directory
- * templates/Makefile.include: include files of
- BuildAction.Nothing in distribution
-
-2006-06-19 Scott Ellington <scott.ellington@gmail.com>
-
- * SimpleProjectMakefileHandler.cs:
- * AutotoolsContext.cs:
- * SolutionDeployer.cs:
- use the new CombineEntry.Version property
- * TarballTargetEditorWidget.cs: default to active config
-
-2006-06-16 Scott Ellington <scott.ellington@gmail.com>
-
- * SolutionDeployer.cs: Deploy and GenerateFiles can now
- take a configuration parameter
- * Makefile.am: added new file.
- * TarballTargetEditorWidget.cs:
- * Handler.cs:
- Add option to set a default configuration at deployment.
-
-2006-06-15 Scott Ellington <scott.ellington@gmail.com>
-
- * SolutionDeployer.cs: always run autogen.sh on Deploy
- * templates/Makefile.include: clean up
-
-2006-06-15 Scott Ellington <scott.ellington@gmail.com>
-
- * SimpleProjectMakefileHandler.cs:
- * templates/exe.wrapper.in.template:
- pass runtime parameters on to exe wrapper
- * Handler.cs:
- * SolutionDeployer.cs:
- * MonoDevelop.Autotools.addin.xml:
- * Commands.cs:
- Moved 'make dist' functionality into SolutionDeployer to
- be consumed by the new IDeployHandler interface and removed
- 'Create Distributable' command.
- * Makefile.am: rename DeployHandler to Commands and
- removed a trailing space.
-
-2006-06-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Handler.cs: Implemented a basic IDeployHandler and the
- needed support classes.
- * MonoDevelop.Autotools.addin.xml: Registered the new deploy
- handler to the deploy service.
- * Makefile.am: Added Handler.cs and updated references.
-
-2006-06-15 Scott Ellington <scott.ellington@gmail.com>
-
- * SimpleProjectMakefileHandler.cs:
- * SolutionDeployer.cs:
- * templates/Makefile.include:
- * templates/Makefile.am.project.template:
- * templates/configure.ac.template:
- * ISimpleAutotoolsSetup.cs:
- * AutotoolsContext.cs:
- * SolutionMakefileHandler.cs:
- Handle project configurations
-
-2006-06-13 Scott Ellington <scott.ellington@gmail.com>
-
- * SimpleProjectMakefileHandler.cs:
- remove Console.WriteLine
- * SolutionDeployer.cs:
- * MonoDevelop.Autotools.addin.xml:
- * DeployHandler.cs:
- * Makefile.am:
- Add new functionality which wraps 'make dist'
- and other changes
-
-2006-06-09 Scott Ellington <scott.ellington@gmail.com>
-
- * SimpleProjectMakefileHandler.cs:
- * SolutionDeployer.cs:
- * IMakefileHandler.cs:
- * DeployHandler.cs:
- * templates/Makefile.include:
- * templates/Makefile.am.project.template:
- * Set.cs:
- * AutotoolsContext.cs:
- * SolutionMakefileHandler.cs:
- Add a IProgressMonitor and fixes for various project types.
-
-2006-06-08 Scott Ellington <scott.ellington@gmail.com>
-
- * AutotoolsContext.cs: fix loading of templates to allow readonly
-
-2006-06-07 Scott Ellington <scott.ellington@gmail.com>
-
- * Makefile.am: removed CSharpBinding dll ref
-
-2006-06-05 Scott Ellington <scott.ellington@gmail.com>
-
- Added Autotools Addin.
diff --git a/main/src/addins/MonoDevelop.Autotools/Commands.cs b/main/src/addins/MonoDevelop.Autotools/Commands.cs
index b8c020daf9..556ed2fc07 100644
--- a/main/src/addins/MonoDevelop.Autotools/Commands.cs
+++ b/main/src/addins/MonoDevelop.Autotools/Commands.cs
@@ -39,7 +39,7 @@ namespace MonoDevelop.Autotools
{
public override bool CanBuildNode (Type dataType)
{
- return typeof (Solution).IsAssignableFrom (dataType) || typeof (SolutionItem).IsAssignableFrom (dataType);
+ return typeof (Solution).IsAssignableFrom (dataType) || typeof (SolutionFolderItem).IsAssignableFrom (dataType);
}
public override Type CommandHandlerType {
@@ -52,25 +52,25 @@ namespace MonoDevelop.Autotools
[CommandHandler (Commands.GenerateFiles)]
protected void OnGenerate()
{
- SolutionItem entry = CurrentNode.DataItem as SolutionItem;
+ SolutionFolderItem entry = CurrentNode.DataItem as SolutionFolderItem;
Solution solution = CurrentNode.DataItem as Solution;
GenerateMakefiles (entry, solution);
}
- internal static void GenerateMakefiles (SolutionItem entry, Solution solution)
+ internal static void GenerateMakefiles (SolutionFolderItem entry, Solution solution)
{
if (solution == null) {
AlertButton generateMakefilesButton = new AlertButton (GettextCatalog.GetString ("_Generate Makefiles"));
if (MessageService.AskQuestion (GettextCatalog.GetString ("Generating Makefiles is not supported for single projects. Do you want to generate them for the full solution - '{0}' ?", entry.ParentSolution.Name),
AlertButton.Cancel,
generateMakefilesButton) == generateMakefilesButton)
- solution = ((SolutionItem)entry).ParentSolution;
+ solution = ((SolutionFolderItem)entry).ParentSolution;
else
return;
}
DeployContext ctx = null;
- IProgressMonitor monitor = null;
+ ProgressMonitor monitor = null;
GenerateMakefilesDialog dialog = new GenerateMakefilesDialog (solution);
try {
diff --git a/main/src/addins/MonoDevelop.Autotools/FileNodeBuilderExtension.cs b/main/src/addins/MonoDevelop.Autotools/FileNodeBuilderExtension.cs
index c586f3681e..882ea0a81e 100644
--- a/main/src/addins/MonoDevelop.Autotools/FileNodeBuilderExtension.cs
+++ b/main/src/addins/MonoDevelop.Autotools/FileNodeBuilderExtension.cs
@@ -22,8 +22,6 @@ namespace MonoDevelop.Autotools
class FileNodeCommandHandler: NodeCommandHandler
{
- const string infoProperty = "MonoDevelop.Autotools.MakefileInfo";
-
[CommandHandler (Commands.SynchWithMakefile)]
[AllowMultiSelection]
public void OnExclude ()
@@ -34,7 +32,7 @@ namespace MonoDevelop.Autotools
foreach (ITreeNavigator node in CurrentNodes) {
ProjectFile file = (ProjectFile) node.DataItem;
if (file.Project != null) {
- MakefileData data = file.Project.ExtendedProperties [infoProperty] as MakefileData;
+ MakefileData data = file.Project.GetMakefileData ();
if (data != null && data.IsFileIntegrationEnabled (file.BuildAction)) {
if (data.IsFileExcluded (file.FilePath)) {
allChecked = false;
@@ -44,20 +42,20 @@ namespace MonoDevelop.Autotools
}
}
- Set<SolutionEntityItem> projects = new Set<SolutionEntityItem> ();
+ Set<SolutionItem> projects = new Set<SolutionItem> ();
foreach (ITreeNavigator node in CurrentNodes) {
ProjectFile file = (ProjectFile) node.DataItem;
if (file.Project != null) {
projects.Add (file.Project);
- MakefileData data = file.Project.ExtendedProperties [infoProperty] as MakefileData;
+ MakefileData data = file.Project.GetMakefileData ();
if (data != null && data.IntegrationEnabled) {
data.SetFileExcluded (file.FilePath, allChecked);
}
}
}
- IdeApp.ProjectOperations.Save (projects);
+ IdeApp.ProjectOperations.SaveAsync (projects);
}
[CommandUpdateHandler (Commands.SynchWithMakefile)]
@@ -71,7 +69,7 @@ namespace MonoDevelop.Autotools
foreach (ITreeNavigator node in CurrentNodes) {
ProjectFile file = (ProjectFile) node.DataItem;
if (file.Project != null) {
- MakefileData data = file.Project.ExtendedProperties [infoProperty] as MakefileData;
+ MakefileData data = file.Project.GetMakefileData ();
if (data != null && data.IsFileIntegrationEnabled (file.BuildAction)) {
anyEnabled = true;
if (!data.IsFileExcluded (file.FilePath)) {
diff --git a/main/src/addins/MonoDevelop.Autotools/Handler.cs b/main/src/addins/MonoDevelop.Autotools/Handler.cs
index ccf029a7bd..a8622a6c59 100644
--- a/main/src/addins/MonoDevelop.Autotools/Handler.cs
+++ b/main/src/addins/MonoDevelop.Autotools/Handler.cs
@@ -76,18 +76,18 @@ namespace MonoDevelop.Autotools
set { defaultConfig = value; }
}
- public override bool CanBuild (SolutionItem entry)
+ public override bool CanBuild (SolutionFolderItem entry)
{
SolutionDeployer deployer = new SolutionDeployer (generateAutotools);
return deployer.CanDeploy ( entry );
}
- public override void InitializeSettings (SolutionItem entry)
+ public override void InitializeSettings (SolutionFolderItem entry)
{
if (string.IsNullOrEmpty (targetDir))
targetDir = entry.BaseDirectory;
if (string.IsNullOrEmpty (defaultConfig)) {
- SolutionEntityItem se = entry as SolutionEntityItem;
+ SolutionItem se = entry as SolutionItem;
defaultConfig = se != null ? se.GetConfigurations () [0] : null;
}
if (File.Exists (Path.Combine (entry.BaseDirectory, "autogen.sh")) ||
@@ -99,18 +99,18 @@ namespace MonoDevelop.Autotools
}
- protected override bool OnBuild (IProgressMonitor monitor, DeployContext ctx)
+ protected override bool OnBuild (ProgressMonitor monitor, DeployContext ctx)
{
string tmpFolder = FileService.CreateTempDirectory ();
Solution solution = null;
- SolutionItem entry = RootSolutionItem;
+ SolutionFolderItem entry = RootSolutionItem;
try {
if (generateFiles) {
List<string> childEntries = new List<string> ();
if (entry is SolutionFolder) {
- SolutionItem[] ents = GetChildEntries ();
- foreach (SolutionItem it in ents)
+ SolutionFolderItem[] ents = GetChildEntries ();
+ foreach (SolutionFolderItem it in ents)
childEntries.Add (it.ItemId);
}
else {
@@ -123,22 +123,21 @@ namespace MonoDevelop.Autotools
if (entry is SolutionFolder)
sourceFile = entry.ParentSolution.FileName;
else
- sourceFile = ((SolutionEntityItem)entry).FileName;
+ sourceFile = ((SolutionItem)entry).FileName;
- string efile = Services.ProjectService.Export (new FilteredProgressMonitor (monitor), sourceFile, childEntries.ToArray (), tmpFolder, null);
+ string efile = Services.ProjectService.Export (new FilteredProgressMonitor (monitor), sourceFile, childEntries.ToArray (), tmpFolder, null).Result;
if (efile == null) {
monitor.ReportError (GettextCatalog.GetString ("The project could not be exported."), null);
return false;
}
- solution = Services.ProjectService.ReadWorkspaceItem (new NullProgressMonitor (), efile) as Solution;
+ solution = Services.ProjectService.ReadWorkspaceItem (new ProgressMonitor (), efile).Result as Solution;
}
else {
solution = entry.ParentSolution;
}
- solution.Build (monitor, (SolutionConfigurationSelector) defaultConfig);
-
- if (monitor.IsCancelRequested || !monitor.AsyncOperation.Success)
+ var res = solution.Build (monitor, (SolutionConfigurationSelector) defaultConfig).Result;
+ if (res.HasErrors || monitor.CancellationToken.IsCancellationRequested)
return false;
SolutionDeployer deployer = new SolutionDeployer (generateAutotools);
diff --git a/main/src/addins/MonoDevelop.Autotools/IMakefileHandler.cs b/main/src/addins/MonoDevelop.Autotools/IMakefileHandler.cs
index ac4a8ed108..31c6b18ccc 100644
--- a/main/src/addins/MonoDevelop.Autotools/IMakefileHandler.cs
+++ b/main/src/addins/MonoDevelop.Autotools/IMakefileHandler.cs
@@ -29,9 +29,9 @@ namespace MonoDevelop.Autotools
{
public interface IMakefileHandler
{
- bool CanDeploy (SolutionItem entry, MakefileType type);
+ bool CanDeploy (SolutionFolderItem entry, MakefileType type);
- Makefile Deploy (AutotoolsContext ctx, SolutionItem entry, IProgressMonitor monitor);
+ Makefile Deploy (AutotoolsContext ctx, SolutionFolderItem entry, ProgressMonitor monitor);
}
public enum MakefileType
diff --git a/main/src/addins/MonoDevelop.Autotools/MakefileData.cs b/main/src/addins/MonoDevelop.Autotools/MakefileData.cs
index 8101bcfe67..a11cb8d733 100644
--- a/main/src/addins/MonoDevelop.Autotools/MakefileData.cs
+++ b/main/src/addins/MonoDevelop.Autotools/MakefileData.cs
@@ -38,10 +38,12 @@ using MonoDevelop.Core.Serialization;
using MonoDevelop.Projects;
using MonoDevelop.Core.Assemblies;
using MonoDevelop.Ide;
+using System.Xml;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.Autotools
{
- [DataItem ("MakefileInfo")]
+ [DataItem ("MonoDevelop.Autotools.MakefileInfo")]
public class MakefileData : ICloneable
{
bool integrationEnabled;
@@ -70,6 +72,25 @@ namespace MonoDevelop.Autotools
if (assemblyContext == null)
integrationEnabled = false;
}
+
+ public static MakefileData Read (XmlElement ext)
+ {
+ XmlDataSerializer ser = new XmlDataSerializer (new DataContext ());
+ return (MakefileData) ser.Deserialize (new XmlNodeReader (ext), typeof(MakefileData));
+ }
+
+ public XmlElement Write ()
+ {
+ XmlDataSerializer ser = new XmlDataSerializer (new DataContext ());
+ ser.Namespace = MSBuildProject.Schema;
+ var sw = new StringWriter ();
+ ser.Serialize (new XmlTextWriter (sw), this);
+ XmlDocument doc = new XmlDocument ();
+ doc.LoadXml (sw.ToString ());
+ var elem = doc.DocumentElement;
+ doc.RemoveChild (elem);
+ return elem;
+ }
internal static IAssemblyContext GetMonoRuntimeContext ()
{
@@ -613,7 +634,7 @@ namespace MonoDevelop.Autotools
return customRegex [index];
}
- IProgressMonitor monitor = null;
+ ProgressMonitor monitor = null;
// VarName -> Encode filenames Eg. $(srcdir)
Dictionary<string, bool> encodeValues;
@@ -651,7 +672,7 @@ namespace MonoDevelop.Autotools
}
//use events..
- public void UpdateProject (IProgressMonitor monitor, bool promptForRemoval)
+ public void UpdateProject (ProgressMonitor monitor, bool promptForRemoval)
{
if (!IntegrationEnabled)
return;
@@ -1170,14 +1191,14 @@ namespace MonoDevelop.Autotools
ProjectReference AddNewPackageReference (DotNetProject project, SystemAssembly sa)
{
- ProjectReference pref = new ProjectReference (sa);
+ ProjectReference pref = ProjectReference.CreateAssemblyReference (sa);
project.References.Add (pref);
newPackageRefs [sa.Location] = pref;
return pref;
}
- public static void ResolveProjectReferences (SolutionFolder folder, IProgressMonitor monitor)
+ public static void ResolveProjectReferences (SolutionFolder folder, ProgressMonitor monitor)
{
Dictionary<string, DotNetProject> projects = new Dictionary<string, DotNetProject> ();
foreach (DotNetProject p in folder.GetAllItems<DotNetProject> ()) {
@@ -1188,7 +1209,7 @@ namespace MonoDevelop.Autotools
}
foreach (DotNetProject sproj in projects.Values) {
- MakefileData mdata = sproj.ExtendedProperties ["MonoDevelop.Autotools.MakefileInfo"] as MakefileData;
+ MakefileData mdata = sproj.GetMakefileData ();
if (mdata == null)
continue;
@@ -1216,7 +1237,7 @@ namespace MonoDevelop.Autotools
} else {
// Try as a project ref
if (projects.ContainsKey (refstr)) {
- sproj.References.Add (new ProjectReference (projects [refstr]));
+ sproj.References.Add (ProjectReference.CreateProjectReference (projects [refstr]));
toRemove.Add (refstr);
}
}
@@ -1227,7 +1248,7 @@ namespace MonoDevelop.Autotools
// Add all remaining unresolved refs as Assembly refs
foreach (string s in mdata.UnresolvedReferences.Keys)
- sproj.References.Add (new ProjectReference (ReferenceType.Assembly, s));
+ sproj.References.Add (ProjectReference.CreateAssemblyFileReference (s));
// Remove asm/project refs not found in UnresolvedReferences
foreach (ProjectReference pr in asmProjectRefs.Values)
@@ -1325,7 +1346,7 @@ namespace MonoDevelop.Autotools
//Writing methods
- public void UpdateMakefile (IProgressMonitor monitor)
+ public void UpdateMakefile (ProgressMonitor monitor)
{
//FIXME: AssemblyName & OutputDir
@@ -1839,4 +1860,20 @@ namespace MonoDevelop.Autotools
this.Name = name;
}
}
+
+ internal static class MakefileDataExtension
+ {
+ public static MakefileData GetMakefileData (this Project project)
+ {
+ var ex = project.GetService<MakefileProjectExtension> ();
+ return ex != null ? ex.MakefileData : null;
+ }
+
+ public static void SetMakefileData (this Project project, MakefileData data)
+ {
+ var ex = project.GetService<MakefileProjectExtension> ();
+ if (ex != null)
+ ex.MakefileData = data;
+ }
+ }
}
diff --git a/main/src/addins/MonoDevelop.Autotools/MakefileGeneratorTool.cs b/main/src/addins/MonoDevelop.Autotools/MakefileGeneratorTool.cs
index 8c483aff93..efa1f2e142 100644
--- a/main/src/addins/MonoDevelop.Autotools/MakefileGeneratorTool.cs
+++ b/main/src/addins/MonoDevelop.Autotools/MakefileGeneratorTool.cs
@@ -4,6 +4,7 @@ using MonoDevelop.Core.ProgressMonitoring;
using MonoDevelop.Core;
using MonoDevelop.Deployment;
using MonoDevelop.Projects;
+using System.Threading.Tasks;
namespace MonoDevelop.Autotools
{
@@ -13,7 +14,7 @@ namespace MonoDevelop.Autotools
string defaultConfig = null;
string filename = null;
- public int Run (string [] arguments)
+ public async Task<int> Run (string [] arguments)
{
Console.WriteLine ("MonoDevelop Makefile generator");
if (arguments.Length == 0) {
@@ -50,7 +51,7 @@ namespace MonoDevelop.Autotools
Console.WriteLine (GettextCatalog.GetString ("Loading solution file {0}", filename));
ConsoleProgressMonitor monitor = new ConsoleProgressMonitor ();
- Solution solution = Services.ProjectService.ReadWorkspaceItem (monitor, filename) as Solution;
+ Solution solution = await Services.ProjectService.ReadWorkspaceItem (monitor, filename) as Solution;
if (solution == null) {
Console.WriteLine (GettextCatalog.GetString ("Error: Makefile generation supported only for solutions.\n"));
return 1;
diff --git a/main/src/addins/MonoDevelop.Autotools/MakefileOptionPanel.cs b/main/src/addins/MonoDevelop.Autotools/MakefileOptionPanel.cs
index aad187c6ef..598bcd1d1d 100644
--- a/main/src/addins/MonoDevelop.Autotools/MakefileOptionPanel.cs
+++ b/main/src/addins/MonoDevelop.Autotools/MakefileOptionPanel.cs
@@ -1,5 +1,5 @@
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
@@ -13,10 +13,10 @@ namespace MonoDevelop.Autotools
{
}
- public override Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
Project project = ConfiguredProject;
- MakefileData data = project.ExtendedProperties ["MonoDevelop.Autotools.MakefileInfo"] as MakefileData;
+ MakefileData data = project.GetMakefileData ();
MakefileData tmpData = null;
if (data != null) {
diff --git a/main/src/addins/MonoDevelop.Autotools/MakefileOptionPanelWidget.cs b/main/src/addins/MonoDevelop.Autotools/MakefileOptionPanelWidget.cs
index 58a156eaef..2b8e9474df 100644
--- a/main/src/addins/MonoDevelop.Autotools/MakefileOptionPanelWidget.cs
+++ b/main/src/addins/MonoDevelop.Autotools/MakefileOptionPanelWidget.cs
@@ -205,7 +205,7 @@ namespace MonoDevelop.Autotools
// Data validation
- MakefileData oldData = project.ExtendedProperties ["MonoDevelop.Autotools.MakefileInfo"] as MakefileData;
+ MakefileData oldData = project.GetMakefileData ();
MakefileData tmpData = data;
if (tmpData.IntegrationEnabled) {
@@ -266,9 +266,9 @@ namespace MonoDevelop.Autotools
}
//FIXME: Do this only if there are changes b/w tmpData and Data
- project.ExtendedProperties ["MonoDevelop.Autotools.MakefileInfo"] = tmpData;
+ project.SetMakefileData (tmpData);
- using (IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor (
+ using (ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor (
GettextCatalog.GetString ("Updating project"), "gtk-run", true)) {
tmpData.UpdateProject (monitor, oldData == null || (!oldData.IntegrationEnabled && tmpData.IntegrationEnabled));
diff --git a/main/src/addins/MonoDevelop.Autotools/MakefileProject.cs b/main/src/addins/MonoDevelop.Autotools/MakefileProject.cs
index 91dd984bd9..f2fb5fec65 100644
--- a/main/src/addins/MonoDevelop.Autotools/MakefileProject.cs
+++ b/main/src/addins/MonoDevelop.Autotools/MakefileProject.cs
@@ -11,20 +11,22 @@ namespace MonoDevelop.Autotools
{
}
- public override SolutionItemConfiguration CreateConfiguration (string name)
+ protected override SolutionItemConfiguration OnCreateConfiguration (string id, ConfigurationKind kind)
{
- MakefileProjectConfiguration conf = new MakefileProjectConfiguration ();
- conf.Name = name;
- return conf;
+ return new MakefileProjectConfiguration (id);
}
-
- public override IEnumerable<string> GetProjectTypes ()
+
+ protected override void OnGetTypeTags (HashSet<string> types)
{
- yield return "MakefileProject";
+ base.OnGetTypeTags (types);
+ types.Add ("MakefileProject");
}
}
public class MakefileProjectConfiguration: ProjectConfiguration
{
+ public MakefileProjectConfiguration (string id) : base (id)
+ {
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.Autotools/MakefileProjectServiceExtension.cs b/main/src/addins/MonoDevelop.Autotools/MakefileProjectServiceExtension.cs
index 5c71be9a49..7c39600a08 100644
--- a/main/src/addins/MonoDevelop.Autotools/MakefileProjectServiceExtension.cs
+++ b/main/src/addins/MonoDevelop.Autotools/MakefileProjectServiceExtension.cs
@@ -38,89 +38,96 @@ using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
+using System.Linq;
+using System.Threading.Tasks;
namespace MonoDevelop.Autotools
{
- public class MakefileProjectServiceExtension : ProjectServiceExtension
+ public class MakefileProjectServiceExtension : SolutionExtension
{
- public override WorkspaceItem LoadWorkspaceItem (IProgressMonitor monitor, string fileName)
+ protected override void OnReadSolution (ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.SlnFile file)
{
- WorkspaceItem item = base.LoadWorkspaceItem (monitor, fileName);
-
- Solution sol = item as Solution;
- if (sol != null) {
- //Resolve project references
- try {
- MakefileData.ResolveProjectReferences (sol.RootFolder, monitor);
- } catch (Exception e) {
- LoggingService.LogError (GettextCatalog.GetString (
- "Error resolving Makefile based project references for solution {0}", sol.Name), e);
- monitor.ReportError (GettextCatalog.GetString (
- "Error resolving Makefile based project references for solution {0}", sol.Name), e);
- }
+ base.OnReadSolution (monitor, file);
+
+ //Resolve project references
+ try {
+ MakefileData.ResolveProjectReferences (Solution.RootFolder, monitor);
+ } catch (Exception e) {
+ LoggingService.LogError (GettextCatalog.GetString (
+ "Error resolving Makefile based project references for solution {0}", Solution.Name), e);
+ monitor.ReportError (GettextCatalog.GetString (
+ "Error resolving Makefile based project references for solution {0}", Solution.Name), e);
}
-
- return item;
+
+ // All done, dispose myself
+ Dispose ();
}
+ }
-
- protected override SolutionEntityItem LoadSolutionItem (IProgressMonitor monitor, string fileName)
+ public class MakefileProjectExtension: ProjectExtension
+ {
+ MakefileData data;
+
+ public MakefileProjectExtension ()
{
- SolutionEntityItem entry = base.LoadSolutionItem (monitor, fileName);
- if (entry == null)
- return null;
-
- Project project = entry as Project;
- if (project == null)
- return entry;
+ }
- //Project
- MakefileData data = entry.ExtendedProperties ["MonoDevelop.Autotools.MakefileInfo"] as MakefileData;
+ public MakefileData MakefileData {
+ get { return data; }
+ set { data = value; }
+ }
+
+ protected override void OnReadProject (ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject)
+ {
+ base.OnReadProject (monitor, msproject);
+ var ext = msproject.GetMonoDevelopProjectExtension ("MonoDevelop.Autotools.MakefileInfo");
+ if (ext == null)
+ return;
+
+ data = MakefileData.Read (ext);
if (data == null)
- return entry;
+ return;
monitor.BeginTask (GettextCatalog.GetString ("Updating project from Makefile"), 1);
try {
- data.OwnerProject = project;
+ data.OwnerProject = Project;
if (data.SupportsIntegration)
data.UpdateProject (monitor, false);
monitor.Step (1);
} catch (Exception e) {
monitor.ReportError (GettextCatalog.GetString (
- "Error loading Makefile for project {0}", project.Name), e);
+ "\tError loading Makefile for project {0}", Project.Name), e);
} finally {
monitor.EndTask ();
}
- return entry;
}
- public override void Save (IProgressMonitor monitor, SolutionEntityItem entry)
+ protected override void OnWriteProject (ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject)
{
- base.Save (monitor, entry);
-
- Project project = entry as Project;
- if (project == null)
- return;
-
- MakefileData data = project.ExtendedProperties ["MonoDevelop.Autotools.MakefileInfo"] as MakefileData;
- if (data == null || !data.SupportsIntegration)
+ base.OnWriteProject (monitor, msproject);
+
+ if (data == null)
return;
+ msproject.SetMonoDevelopProjectExtension ("MonoDevelop.Autotools.MakefileInfo", data.Write ());
+
+ if (!data.SupportsIntegration)
+ return;
+
try {
data.UpdateMakefile (monitor);
} catch (Exception e) {
LoggingService.LogError (GettextCatalog.GetString ("Error saving to Makefile ({0}) for project {1}",
- data.AbsoluteMakefileName, project.Name, e));
+ data.AbsoluteMakefileName, Project.Name, e));
monitor.ReportError (GettextCatalog.GetString (
- "Error saving to Makefile ({0}) for project {1}", data.AbsoluteMakefileName, project.Name), e);
+ "Error saving to Makefile ({0}) for project {1}", data.AbsoluteMakefileName, Project.Name), e);
}
}
- public override List<FilePath> GetItemFiles (SolutionEntityItem entry, bool includeReferencedFiles)
+ protected override IEnumerable<FilePath> OnGetItemFiles (bool includeReferencedFiles)
{
- List<FilePath> col = base.GetItemFiles (entry, includeReferencedFiles);
+ List<FilePath> col = base.OnGetItemFiles (includeReferencedFiles).ToList ();
- MakefileData data = entry.ExtendedProperties ["MonoDevelop.Autotools.MakefileInfo"] as MakefileData;
if (data == null || !data.SupportsIntegration || string.IsNullOrEmpty (data.AbsoluteMakefileName))
return col;
@@ -136,31 +143,20 @@ namespace MonoDevelop.Autotools
}
- //TODO
- protected override bool GetNeedsBuilding (SolutionEntityItem entry, ConfigurationSelector configuration)
- {
- return base.GetNeedsBuilding (entry, configuration);
- }
-
//FIXME: Check whether autogen.sh is required or not
- protected override BuildResult Build (IProgressMonitor monitor, SolutionEntityItem entry, ConfigurationSelector configuration)
+ protected async override Task<BuildResult> OnBuild (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
- Project project = entry as Project;
- if (project == null)
- return base.Build (monitor, entry, configuration);
-
- MakefileData data = project.ExtendedProperties ["MonoDevelop.Autotools.MakefileInfo"] as MakefileData;
if (data == null || !data.SupportsIntegration || String.IsNullOrEmpty (data.BuildTargetName))
- return base.Build (monitor, entry, configuration);
+ return await base.OnBuild (monitor, configuration, operationContext);
//FIXME: Gen autofoo ? autoreconf?
string output = String.Empty;
int exitCode = 0;
- monitor.BeginTask (GettextCatalog.GetString ("Building {0}", project.Name), 1);
+ monitor.BeginTask (GettextCatalog.GetString ("Building {0}", Project.Name), 1);
try
{
- string baseDir = project.BaseDirectory;
+ string baseDir = Project.BaseDirectory;
string args = string.Format ("-j {0} {1}", data.ParallelProcesses, data.BuildTargetName);
using (var swOutput = new StringWriter ()) {
@@ -174,7 +170,8 @@ namespace MonoDevelop.Autotools
chainedOutput,
chainedOutput,
null)) {
- process.WaitForOutput ();
+
+ await process.Task;
chainedOutput.UnchainWriter (monitor.Log);
chainedOutput.UnchainWriter (swOutput);
@@ -200,7 +197,7 @@ namespace MonoDevelop.Autotools
Regex regexError = data.GetErrorRegex (false);
Regex regexWarning = data.GetWarningRegex (false);
- BuildResult cr = ParseOutput (tf, output, project.BaseDirectory, regexError, regexWarning);
+ BuildResult cr = ParseOutput (tf, output, Project.BaseDirectory, regexError, regexWarning);
if (exitCode != 0 && cr.FailedBuildCount == 0)
cr.AddError (GettextCatalog.GetString ("Build failed. See Build Output panel."));
@@ -330,24 +327,16 @@ namespace MonoDevelop.Autotools
return null;
}
- protected override void Clean (IProgressMonitor monitor, SolutionEntityItem entry, ConfigurationSelector configuration)
+ protected async override Task<BuildResult> OnClean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
- Project proj = entry as Project;
- if (proj == null) {
- base.Clean (monitor, entry, configuration);
- return;
- }
-
- MakefileData data = proj.ExtendedProperties ["MonoDevelop.Autotools.MakefileInfo"] as MakefileData;
if (data == null || !data.SupportsIntegration || String.IsNullOrEmpty (data.CleanTargetName)) {
- base.Clean (monitor, entry, configuration);
- return;
+ return await base.OnClean (monitor, configuration, operationContext);
}
monitor.BeginTask ( GettextCatalog.GetString( "Cleaning project"), 1);
try
{
- string baseDir = proj.BaseDirectory;
+ string baseDir = Project.BaseDirectory;
ProcessWrapper process = Runtime.ProcessService.StartProcess ( "make",
data.CleanTargetName,
@@ -355,7 +344,8 @@ namespace MonoDevelop.Autotools
monitor.Log,
monitor.Log,
null );
- process.WaitForOutput ();
+
+ await process.Task;
if ( process.ExitCode > 0 )
throw new Exception ( GettextCatalog.GetString ("An unspecified error occurred while running '{0}'", "make " + data.CleanTargetName) );
@@ -365,52 +355,45 @@ namespace MonoDevelop.Autotools
catch ( Exception e )
{
monitor.ReportError ( GettextCatalog.GetString ("Project could not be cleaned: "), e );
- return;
+ var res = new BuildResult ();
+ res.AddError (GettextCatalog.GetString ("Project could not be cleaned: ") + e.Message);
+ return res;
}
finally
{
monitor.EndTask ();
}
monitor.ReportSuccess ( GettextCatalog.GetString ( "Project successfully cleaned"));
+ return BuildResult.CreateSuccess ();
}
- protected override bool CanExecute (SolutionEntityItem item, ExecutionContext context, ConfigurationSelector configuration)
+ protected override bool OnGetCanExecute (ExecutionContext context, ConfigurationSelector configuration)
{
- Project project = item as Project;
- if (project != null) {
- MakefileData data = project.ExtendedProperties ["MonoDevelop.Autotools.MakefileInfo"] as MakefileData;
- if (data != null && data.SupportsIntegration && !String.IsNullOrEmpty (data.ExecuteTargetName))
- return true;
- }
- return base.CanExecute (item, context, configuration);
+ if (data != null && data.SupportsIntegration && !String.IsNullOrEmpty (data.ExecuteTargetName))
+ return true;
+ return base.OnGetCanExecute (context, configuration);
}
- protected override void Execute (IProgressMonitor monitor, SolutionEntityItem entry, ExecutionContext context, ConfigurationSelector configuration)
+ protected async override Task OnExecute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
{
- Project project = entry as Project;
- if (project == null) {
- base.Execute (monitor, entry, context, configuration);
- return;
- }
-
- MakefileData data = project.ExtendedProperties ["MonoDevelop.Autotools.MakefileInfo"] as MakefileData;
if (data == null || !data.SupportsIntegration || String.IsNullOrEmpty (data.ExecuteTargetName)) {
- base.Execute (monitor, entry, context, configuration);
+ await base.OnExecute (monitor, context, configuration);
return;
}
- IConsole console = context.ConsoleFactory.CreateConsole (true);
- monitor.BeginTask (GettextCatalog.GetString ("Executing {0}", project.Name), 1);
+ OperationConsole console = context.ConsoleFactory.CreateConsole ();
+ monitor.BeginTask (GettextCatalog.GetString ("Executing {0}", Project.Name), 1);
try
{
ProcessWrapper process = Runtime.ProcessService.StartProcess ("make",
- data.ExecuteTargetName,
- project.BaseDirectory,
- console.Out,
- console.Error,
- null);
- process.WaitForOutput ();
+ data.ExecuteTargetName,
+ Project.BaseDirectory,
+ console.Out,
+ console.Error,
+ null);
+
+ await process.Task;
monitor.Log.WriteLine (GettextCatalog.GetString ("The application exited with code: {0}", process.ExitCode));
monitor.Step (1);
diff --git a/main/src/addins/MonoDevelop.Autotools/MonoDevelop.Autotools.addin.xml b/main/src/addins/MonoDevelop.Autotools/MonoDevelop.Autotools.addin.xml
index adf5f61704..c79817c2a0 100644
--- a/main/src/addins/MonoDevelop.Autotools/MonoDevelop.Autotools.addin.xml
+++ b/main/src/addins/MonoDevelop.Autotools/MonoDevelop.Autotools.addin.xml
@@ -23,9 +23,10 @@
<NodeBuilder id = "AutotoolNodeExtension" class = "MonoDevelop.Autotools.NodeExtension"/>
</Extension>
- <Extension path = "/MonoDevelop/ProjectModel/ProjectServiceExtensions">
+ <Extension path = "/MonoDevelop/ProjectModel/ProjectModelExtensions">
<Condition id="Platform" value="!windows">
- <Class class = "MonoDevelop.Autotools.MakefileProjectServiceExtension" id="MakefileProjectServiceExtension" insertafter="FinalStep"/>
+ <Class class = "MonoDevelop.Autotools.MakefileProjectServiceExtension" insertafter="FinalStep"/>
+ <Class class = "MonoDevelop.Autotools.MakefileProjectExtension" insertafter="FinalStep"/>
</Condition>
</Extension>
@@ -99,11 +100,6 @@
</Condition>
</Extension>
- <Extension path = "/MonoDevelop/ProjectModel/ExtendedProperties">
- <ItemProperty class = "MonoDevelop.Projects.Project"
- name = "MonoDevelop.Autotools.MakefileInfo" type = "MonoDevelop.Autotools.MakefileData" />
- </Extension>
-
<Extension path = "/MonoDevelop/DesignerSupport/PropertyProviders">
<Condition id="Platform" value="!windows">
<Class class = "MonoDevelop.Autotools.PropertyProvider"/>
diff --git a/main/src/addins/MonoDevelop.Autotools/MonoDevelop.Autotools.csproj b/main/src/addins/MonoDevelop.Autotools/MonoDevelop.Autotools.csproj
index b36b6287f8..4250661754 100644
--- a/main/src/addins/MonoDevelop.Autotools/MonoDevelop.Autotools.csproj
+++ b/main/src/addins/MonoDevelop.Autotools/MonoDevelop.Autotools.csproj
@@ -85,6 +85,7 @@
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<SpecificVersion>False</SpecificVersion>
</Reference>
+ <Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
diff --git a/main/src/addins/MonoDevelop.Autotools/PropertyProvider.cs b/main/src/addins/MonoDevelop.Autotools/PropertyProvider.cs
index ef96d97d0f..368ce87e2f 100644
--- a/main/src/addins/MonoDevelop.Autotools/PropertyProvider.cs
+++ b/main/src/addins/MonoDevelop.Autotools/PropertyProvider.cs
@@ -12,7 +12,7 @@ namespace MonoDevelop.Autotools
{
ProjectFile file = obj as ProjectFile;
if (file != null && file.Project != null) {
- MakefileData data = file.Project.ExtendedProperties ["MonoDevelop.Autotools.MakefileInfo"] as MakefileData;
+ MakefileData data = file.Project.GetMakefileData ();
if (data != null && data.IsFileIntegrationEnabled (file.BuildAction))
return true;
}
@@ -33,7 +33,7 @@ namespace MonoDevelop.Autotools
public ProjectFileWrapper (ProjectFile file)
{
this.file = file;
- data = file.Project.ExtendedProperties ["MonoDevelop.Autotools.MakefileInfo"] as MakefileData;
+ data = file.Project.GetMakefileData ();
}
[LocalizedCategory ("Makefile Integration")]
diff --git a/main/src/addins/MonoDevelop.Autotools/SimpleProjectMakefileHandler.cs b/main/src/addins/MonoDevelop.Autotools/SimpleProjectMakefileHandler.cs
index 6f4d39496f..74f91b4895 100644
--- a/main/src/addins/MonoDevelop.Autotools/SimpleProjectMakefileHandler.cs
+++ b/main/src/addins/MonoDevelop.Autotools/SimpleProjectMakefileHandler.cs
@@ -71,7 +71,7 @@ namespace MonoDevelop.Autotools
// store all refs for easy access
Set<SystemPackage> pkgs;
- public bool CanDeploy (SolutionItem entry, MakefileType type)
+ public bool CanDeploy (SolutionFolderItem entry, MakefileType type)
{
Project project = entry as Project;
if ( project == null ) return false;
@@ -89,7 +89,7 @@ namespace MonoDevelop.Autotools
return null;
}
- public Makefile Deploy (AutotoolsContext ctx, SolutionItem entry, IProgressMonitor monitor)
+ public Makefile Deploy (AutotoolsContext ctx, SolutionFolderItem entry, ProgressMonitor monitor)
{
generateAutotools = ctx.MakefileType == MakefileType.AutotoolsMakefile;
@@ -268,7 +268,7 @@ namespace MonoDevelop.Autotools
configSection.BuildVariablesBuilder.AppendFormat ("ASSEMBLY = {0}\n",
AutotoolsContext.EscapeStringForAutomake (assembly));
configSection.BuildVariablesBuilder.AppendFormat ("ASSEMBLY_MDB = {0}\n",
- config.DebugMode ? "$(ASSEMBLY).mdb" : String.Empty);
+ config.DebugSymbols ? "$(ASSEMBLY).mdb" : String.Empty);
string target;
switch (config.CompileTarget)
@@ -297,8 +297,10 @@ namespace MonoDevelop.Autotools
{
if (reference.ReferenceType != ReferenceType.Project)
continue;
- Project refp = GetProjectFromName (reference.Reference, ctx.TargetSolution);
-
+ Project refp = reference.ResolveProject (ctx.TargetSolution);
+ if (refp == null) {
+ throw new Exception (GettextCatalog.GetString ("Couldn't find referenced project '{0}'", reference.Reference));
+ }
if (!(refp is DotNetProject))
continue;
@@ -324,7 +326,7 @@ namespace MonoDevelop.Autotools
ctx.AddBuiltFile (Path.Combine (config.OutputDirectory, bfile));
DeployFileCollection deployFiles = DeployService.GetDeployFiles (
- ctx.DeployContext, new SolutionItem[] { project }, config.Selector);
+ ctx.DeployContext, new SolutionFolderItem[] { project }, config.Selector);
ProcessDeployFilesForConfig (deployFiles, project, configSection, ctx, config);
configSections.Add (configSection);
@@ -343,7 +345,7 @@ namespace MonoDevelop.Autotools
// Register files generated by the compiler
ctx.AddBuiltFile (project.GetOutputFileName (combineConfig.Selector));
- if (config.DebugMode)
+ if (config.DebugSymbols)
ctx.AddBuiltFile (project.GetOutputFileName (combineConfig.Selector) + ".mdb");
if (config.SignAssembly) {
@@ -677,7 +679,7 @@ endif", s.SwitchName.Replace ('-', '_').ToUpperInvariant (), s.Define));
return dir;
}
- void EmitCustomCommandTargets (CustomCommandCollection commands, Project project, StringBuilder builder, string configName, CustomCommandType[] types, IProgressMonitor monitor)
+ void EmitCustomCommandTargets (CustomCommandCollection commands, Project project, StringBuilder builder, string configName, CustomCommandType[] types, ProgressMonitor monitor)
{
bool warned = false;
configName = configName.ToUpper ();
@@ -735,7 +737,7 @@ endif", s.SwitchName.Replace ('-', '_').ToUpperInvariant (), s.Define));
}
// Get the Project config corresponding to its @parentConfig
- internal static SolutionItemConfiguration GetProjectConfig (string parentConfig, SolutionEntityItem entry, out bool enabled)
+ internal static SolutionItemConfiguration GetProjectConfig (string parentConfig, SolutionItem entry, out bool enabled)
{
enabled = false;
SolutionConfiguration solutionConfig = entry.ParentSolution.Configurations [parentConfig] as SolutionConfiguration;
@@ -772,18 +774,6 @@ endif", s.SwitchName.Replace ('-', '_').ToUpperInvariant (), s.Define));
dict [extName] = filePath;
return extName;
}
-
- Project GetProjectFromName (string name, Solution targetSolution)
- {
- Project refp = null;
- if (targetSolution != null) refp = targetSolution.FindProjectByName (name);
-
- if (refp == null)
- throw new Exception ( GettextCatalog.GetString ("Couldn't find referenced project '{0}'",
- name ) );
-
- return refp;
- }
}
class DeployFileData
diff --git a/main/src/addins/MonoDevelop.Autotools/SolutionDeployer.cs b/main/src/addins/MonoDevelop.Autotools/SolutionDeployer.cs
index c8388d61c5..52b20478f1 100644
--- a/main/src/addins/MonoDevelop.Autotools/SolutionDeployer.cs
+++ b/main/src/addins/MonoDevelop.Autotools/SolutionDeployer.cs
@@ -71,14 +71,14 @@ namespace MonoDevelop.Autotools
}
}
- public bool CanDeploy (SolutionItem entry)
+ public bool CanDeploy (SolutionFolderItem entry)
{
MakefileType mt = generateAutotools ? MakefileType.AutotoolsMakefile : MakefileType.SimpleMakefile;
IMakefileHandler handler = AutotoolsContext.GetMakefileHandler (entry, mt);
return handler != null;
}
- public bool GenerateFiles (DeployContext ctx, Solution solution, string defaultConf, IProgressMonitor monitor )
+ public bool GenerateFiles (DeployContext ctx, Solution solution, string defaultConf, ProgressMonitor monitor )
{
string filesString = generateAutotools ? "Autotools files" : "Makefiles";
monitor.BeginTask ( GettextCatalog.GetString ("Generating {0} for Solution {1}", filesString, solution.Name), 1 );
@@ -153,7 +153,7 @@ namespace MonoDevelop.Autotools
return true;
}
- public bool Deploy ( DeployContext ctx, Solution solution, string defaultConf, string targetDir, bool generateFiles, IProgressMonitor monitor )
+ public bool Deploy ( DeployContext ctx, Solution solution, string defaultConf, string targetDir, bool generateFiles, ProgressMonitor monitor )
{
if (generateFiles) {
if ( !GenerateFiles ( ctx, solution, defaultConf, monitor ) )
@@ -231,7 +231,7 @@ namespace MonoDevelop.Autotools
if ( File.Exists ( file ) ) FileService.DeleteFile ( file );
}
- void AddTopLevelMakefileVars ( Makefile makefile, IProgressMonitor monitor)
+ void AddTopLevelMakefileVars ( Makefile makefile, ProgressMonitor monitor)
{
monitor.Log.WriteLine ( GettextCatalog.GetString ("Adding variables to top-level Makefile") );
@@ -251,7 +251,7 @@ namespace MonoDevelop.Autotools
// makefile.AppendToVariable ( "pkglib_DATA", "$(DLL_REFERENCES)" );
}
- void CreateAutoGenDotSH (AutotoolsContext context, IProgressMonitor monitor)
+ void CreateAutoGenDotSH (AutotoolsContext context, ProgressMonitor monitor)
{
monitor.Log.WriteLine ( GettextCatalog.GetString ("Creating autogen.sh") );
@@ -274,7 +274,7 @@ namespace MonoDevelop.Autotools
Syscall.chmod ( fileName , FilePermissions.S_IXOTH | FilePermissions.S_IROTH | FilePermissions.S_IRWXU | FilePermissions.S_IRWXG );
}
- void CreateConfigureDotAC (Solution solution, string defaultConf, IProgressMonitor monitor, AutotoolsContext context)
+ void CreateConfigureDotAC (Solution solution, string defaultConf, ProgressMonitor monitor, AutotoolsContext context)
{
monitor.Log.WriteLine ( GettextCatalog.GetString ("Creating configure.ac") );
TemplateEngine templateEngine = new TemplateEngine();
@@ -390,7 +390,7 @@ AM_CONDITIONAL(ENABLE_{3}, test x$enable_{2} = xyes)",
context.AddGeneratedFile (configureFileName);
}
- void CreateConfigureScript (Solution solution, string defaultConf, AutotoolsContext ctx, IProgressMonitor monitor)
+ void CreateConfigureScript (Solution solution, string defaultConf, AutotoolsContext ctx, ProgressMonitor monitor)
{
monitor.Log.WriteLine ( GettextCatalog.GetString ("Creating configure script") );
@@ -465,7 +465,7 @@ AM_CONDITIONAL(ENABLE_{3}, test x$enable_{2} = xyes)",
return builder.ToString ();
}
- void CreateMakefileInclude (AutotoolsContext context, IProgressMonitor monitor)
+ void CreateMakefileInclude (AutotoolsContext context, ProgressMonitor monitor)
{
monitor.Log.WriteLine ( GettextCatalog.GetString ("Creating Makefile.include") );
diff --git a/main/src/addins/MonoDevelop.Autotools/SolutionMakefileHandler.cs b/main/src/addins/MonoDevelop.Autotools/SolutionMakefileHandler.cs
index b31e5ddba0..ab70a6472d 100644
--- a/main/src/addins/MonoDevelop.Autotools/SolutionMakefileHandler.cs
+++ b/main/src/addins/MonoDevelop.Autotools/SolutionMakefileHandler.cs
@@ -33,12 +33,12 @@ namespace MonoDevelop.Autotools
bool generateAutotools = true;
// Recurses into children and tests if they are deployable.
- public bool CanDeploy (SolutionItem entry, MakefileType type)
+ public bool CanDeploy (SolutionFolderItem entry, MakefileType type)
{
return entry is SolutionFolder;
}
- public Makefile Deploy (AutotoolsContext ctx, SolutionItem entry, IProgressMonitor monitor)
+ public Makefile Deploy (AutotoolsContext ctx, SolutionFolderItem entry, ProgressMonitor monitor)
{
generateAutotools = ctx.MakefileType == MakefileType.AutotoolsMakefile;
@@ -78,10 +78,10 @@ namespace MonoDevelop.Autotools
subdirs.Append (" SUBDIRS = ");
- foreach (SolutionItem ce in CalculateSubDirOrder (ctx, solutionFolder, config))
+ foreach (SolutionFolderItem ce in CalculateSubDirOrder (ctx, solutionFolder, config))
{
string baseDirectory;
- if (!(ce is SolutionEntityItem) && !(ce is SolutionFolder))
+ if (!(ce is SolutionItem) && !(ce is SolutionFolder))
continue;
// Ignore projects which can't be deployed
@@ -118,7 +118,7 @@ namespace MonoDevelop.Autotools
string includedProject = null;
// deploy recursively
- foreach (SolutionItem ce in children)
+ foreach (SolutionFolderItem ce in children)
{
IMakefileHandler handler = AutotoolsContext.GetMakefileHandler ( ce, ctx.MakefileType );
Makefile makefile;
@@ -206,11 +206,11 @@ namespace MonoDevelop.Autotools
}
// utility function for finding the correct order to process directories
- List<SolutionItem> CalculateSubDirOrder (AutotoolsContext ctx, SolutionFolder folder, SolutionConfiguration config)
+ List<SolutionFolderItem> CalculateSubDirOrder (AutotoolsContext ctx, SolutionFolder folder, SolutionConfiguration config)
{
- List<SolutionItem> resultOrder = new List<SolutionItem>();
- Set<SolutionItem> dependenciesMet = new Set<SolutionItem>();
- Set<SolutionItem> inResult = new Set<SolutionItem>();
+ List<SolutionFolderItem> resultOrder = new List<SolutionFolderItem>();
+ Set<SolutionFolderItem> dependenciesMet = new Set<SolutionFolderItem>();
+ Set<SolutionFolderItem> inResult = new Set<SolutionFolderItem>();
// We don't have to worry about projects built in parent combines
dependenciesMet.Union (ctx.GetBuiltProjects ());
@@ -222,24 +222,24 @@ namespace MonoDevelop.Autotools
added = false;
notMet = null;
- List<SolutionItem> items = new List<SolutionItem> ();
+ List<SolutionFolderItem> items = new List<SolutionFolderItem> ();
GetSubItems (items, folder);
- foreach (SolutionItem item in items)
+ foreach (SolutionFolderItem item in items)
{
- Set<SolutionItem> references, provides;
+ Set<SolutionFolderItem> references, provides;
if (inResult.Contains (item))
continue;
- if (item is SolutionEntityItem)
+ if (item is SolutionItem)
{
- SolutionEntityItem entry = (SolutionEntityItem) item;
+ SolutionItem entry = (SolutionItem) item;
if (!config.BuildEnabledForItem (entry))
continue;
- references = new Set<SolutionItem> ();
- provides = new Set<SolutionItem>();
+ references = new Set<SolutionFolderItem> ();
+ provides = new Set<SolutionFolderItem>();
references.Union (entry.GetReferencedItems (config.Selector));
provides.Add (entry);
}
@@ -266,12 +266,12 @@ namespace MonoDevelop.Autotools
return resultOrder;
}
- void GetSubItems (List<SolutionItem> list, SolutionFolder folder)
+ void GetSubItems (List<SolutionFolderItem> list, SolutionFolder folder)
{
// This method returns the subitems of a folder.
// If a folder does not match a phisical folder, it will be ignored.
- foreach (SolutionItem item in folder.Items) {
+ foreach (SolutionFolderItem item in folder.Items) {
if (item is SolutionFolder) {
if (item.BaseDirectory != folder.BaseDirectory)
list.Add (item);
@@ -290,25 +290,25 @@ namespace MonoDevelop.Autotools
* returns a set of projects that a combine contains and a set of projects
* that are referenced from combine projects but not part of the combine
*/
- void GetAllProjects (SolutionFolder folder, SolutionConfiguration config, out Set<SolutionItem> projects, out Set<SolutionItem> references)
+ void GetAllProjects (SolutionFolder folder, SolutionConfiguration config, out Set<SolutionFolderItem> projects, out Set<SolutionFolderItem> references)
{
- List<SolutionItem> subitems = new List<SolutionItem> ();
+ List<SolutionFolderItem> subitems = new List<SolutionFolderItem> ();
GetSubItems (subitems, folder);
- projects = (Set<SolutionItem>) combineProjects [folder];
+ projects = (Set<SolutionFolderItem>) combineProjects [folder];
if (projects != null) {
- references = (Set<SolutionItem>) combineReferences [folder];
+ references = (Set<SolutionFolderItem>) combineReferences [folder];
return;
}
- projects = new Set<SolutionItem>();
- references = new Set<SolutionItem>();
+ projects = new Set<SolutionFolderItem>();
+ references = new Set<SolutionFolderItem>();
- foreach (SolutionItem item in subitems)
+ foreach (SolutionFolderItem item in subitems)
{
- if (item is SolutionEntityItem)
+ if (item is SolutionItem)
{
- SolutionEntityItem entry = (SolutionEntityItem) item;
+ SolutionItem entry = (SolutionItem) item;
if (!config.BuildEnabledForItem (entry))
continue;
projects.Add (entry);
@@ -316,8 +316,8 @@ namespace MonoDevelop.Autotools
}
else if (item is SolutionFolder)
{
- Set<SolutionItem> subProjects;
- Set<SolutionItem> subReferences;
+ Set<SolutionFolderItem> subProjects;
+ Set<SolutionFolderItem> subReferences;
GetAllProjects ((SolutionFolder)item, config, out subProjects, out subReferences);
projects.Union (subProjects);
references.Union (subReferences);
diff --git a/main/src/addins/MonoDevelop.Autotools/TarballBuilderEditorWidget.cs b/main/src/addins/MonoDevelop.Autotools/TarballBuilderEditorWidget.cs
index ac60b13b23..cbfea0d795 100644
--- a/main/src/addins/MonoDevelop.Autotools/TarballBuilderEditorWidget.cs
+++ b/main/src/addins/MonoDevelop.Autotools/TarballBuilderEditorWidget.cs
@@ -17,7 +17,7 @@ namespace MonoDevelop.Autotools
alignment1.Xscale = 0.04f;
this.target = target;
- SolutionItem targetCombine = target.RootSolutionItem;
+ SolutionFolderItem targetCombine = target.RootSolutionItem;
folderEntry.Path = target.TargetDir;
if (string.IsNullOrEmpty (target.DefaultConfiguration)) {
diff --git a/main/src/addins/MonoDevelop.CodeMetrics/ChangeLog b/main/src/addins/MonoDevelop.CodeMetrics/ChangeLog
deleted file mode 100644
index 4698064fc0..0000000000
--- a/main/src/addins/MonoDevelop.CodeMetrics/ChangeLog
+++ /dev/null
@@ -1,265 +0,0 @@
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeMetrics/CodeMetricsWidget.cs: Track API
- changes.
-
-2010-07-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeMetrics/CodeMetricsWidget.cs: Replaced
- custom workerthread with
- system.compontentmodel.backgroundworker.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeMetrics/CodeMetricsView.cs: IViewContent
- widgets are now destroyed by the workspace window.
-
-2010-04-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.CodeMetrics.csproj: Add system.core reference.
-
-2010-04-01 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am: Fixed build.
-
-2010-04-01 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.CodeMetrics.csproj:
- * MonoDevelop.CodeMetrics/Commands.cs:
- * MonoDevelop.CodeMetrics/Cohesion.cs:
- * MonoDevelop.CodeMetrics/Coupling.cs:
- * MonoDevelop.CodeMetrics/ASTVisitor.cs:
- * MonoDevelop.CodeMetrics/LOCEvaluate.cs:
- * MonoDevelop.CodeMetrics/IProperties.cs:
- * MonoDevelop.CodeMetrics/MetricsContext.cs:
- * MonoDevelop.CodeMetrics/EnumProperties.cs:
- * MonoDevelop.CodeMetrics/FieldProperties.cs:
- * MonoDevelop.CodeMetrics/InheritanceTree.cs:
- * MonoDevelop.CodeMetrics/CodeMetricsView.cs:
- * MonoDevelop.CodeMetrics/ClassProperties.cs:
- * MonoDevelop.CodeMetrics/StructProperties.cs:
- * MonoDevelop.CodeMetrics/MethodProperties.cs:
- * MonoDevelop.CodeMetrics/ComplexityMetrics.cs:
- * MonoDevelop.CodeMetrics/ProjectProperties.cs:
- * MonoDevelop.CodeMetrics/CodeMetricsWidget.cs:
- * MonoDevelop.CodeMetrics/DelegateProperties.cs:
- * MonoDevelop.CodeMetrics/NamespaceProperties.cs:
- * MonoDevelop.CodeMetrics/InterfaceProperties.cs:
- * MonoDevelop.CodeMetrics/CodeMetricsServices.cs:
- * MonoDevelop.CodeMetrics/ObjectOrientedMetrics.cs:
- * MonoDevelop.CodeMetrics/CodeMetricsNodeExtension.cs:
- * MonoDevelop.CodeMetrics/AssociationBetweenClasses.cs: Added
- the code metrics addin from 'nikhil sarda
- <diff.operator@gmail.com>'.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.CodeMetrics.addin.xml: Bumped MD version.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.CodeMetrics.csproj:
- * MonoDevelop.CodeMetrics.addin.xml:
- * MonoDevelop.CodeMetrics/Commands.cs:
- * MonoDevelop.CodeMetrics/CodeMetricsView.cs:
- * MonoDevelop.CodeMetrics/CodeMetricsWidget.cs:
- * MonoDevelop.CodeMetrics/CodeMetricsNodeExtension.cs: Merged
- MD.Projects into MD.Core, and MD.Projects.Gui, MD.Core.Gui
- and MD.Components into MD.Ide.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.CodeMetrics.CodeMetricsWidget.cs: Flush.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.CodeMetrics.addin.xml: Bump MD version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * MonoDevelop.CodeMetrics.csproj:
- * gtk-gui/MonoDevelop.CodeMetrics.CodeMetricsWidget.cs: Flush.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.CodeMetrics.addin.xml: Bump MD version.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeMetrics/CodeMetricsWidget.cs: Fixed warning.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CodeMetrics.csproj: Updated dependencies. We now
- depend on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.CodeMetrics.csproj: don't require specific
- gtk-sharp version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.CodeMetrics.addin.xml: Bump MD version.
-
-2009-03-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CodeMetrics.csproj: Don't local-copy project
- refs.
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeMetrics.csproj: Moved text editor to core
-
-2009-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeMetrics/CodeMetricsWidget.cs:
- * MonoDevelop.CodeMetrics/CodeMetricsNodeExtension.cs: fixed
- bug in code metrics.
-
-2009-02-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.CodeMetrics.csproj: Fix output path.
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
-
- * MonoDevelop.CodeMetrics/CodeMetricsWidget.cs: Changed
- override Destroy --> override OnDestroyed.
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeMetrics/CodeMetricsView.cs:
- * MonoDevelop.CodeMetrics/CodeMetricsWidget.cs: Worked on
- ressource de-allocation.
-
-2009-02-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CodeMetrics.addin.xml:
- * MonoDevelop.CodeMetrics/CodeMetricsNodeExtension.cs: Track
- merge of the project pad context menu.
-
-2009-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeMetrics/CodeMetricsWidget.cs: fixed
- warnings.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CodeMetrics.mdp:
- * MonoDevelop.CodeMetrics.csproj: Migrated to MSBuild file
- format.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.CodeMetrics.addin.xml: Bump MD version.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.CodeMetrics.CodeMetricsWidget.cs:
- Flush.
-
-2009-01-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CodeMetrics/CodeMetricsWidget.cs: Comment out license
- detection, as standard headers are not guaranteed to be licenses.
- Also, standard header API has changed.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.CodeMetrics.mdp: Flush project format changes.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CodeMetrics.mdp: All projects now require fx 3.5.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CodeMetrics.mdp: Don't require a specific version of
- Mono.Addins.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Make it work for parallel build.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * AssemblyInfo.cs: Add AssemblyInfo.cs files that are autogenerated from
- the addin manifests.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CodeMetrics.addin.xml: Bump MD version.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CodeMetrics.mdp,
- gtk-gui/MonoDevelop.CodeMetrics.CodeMetricsWidget.cs,
- gtk-gui/generated.cs: Updated generated code.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CodeMetrics/CodeMetricsNodeExtension.cs: Moved the
- extensible tree view to its own directory.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CodeMetrics.mdp: Updated.
- * MonoDevelop.CodeMetrics/CodeMetricsWidget.cs: Make the main column
- resizable.
-
-2008-06-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeMetrics/CodeMetricsWidget.cs: fixed 'Bug 388247 -
- Code Metrics Quick Fix'.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CodeMetrics.addin.xml: Bump MD version.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CodeMetrics.addin.xml, MonoDevelop.CodeMetrics.mdp,
- MonoDevelop.CodeMetrics/CodeMetricsView.cs,
- MonoDevelop.CodeMetrics/Commands.cs,
- MonoDevelop.CodeMetrics/CodeMetricsNodeExtension.cs,
- MonoDevelop.CodeMetrics/CodeMetricsWidget.cs: New project model
- changes.
-
-2008-03-14 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * MonoDevelop.CodeMetrics/CodeMetricsWidget.cs: Workaround bug in mono 1.2.4
- where usings are ignored inside anonymous methods.
-
-2008-03-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeMetrics/CodeMetricsWidget.cs: fixed warning.
-
-2008-03-07 Mike Krüger <mkrueger@novell.com>
-
-
-
-2008-03-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeMetrics/CodeMetricsWidget.cs: Added getstring call.
-
diff --git a/main/src/addins/MonoDevelop.Debugger.Gdb/ChangeLog b/main/src/addins/MonoDevelop.Debugger.Gdb/ChangeLog
deleted file mode 100644
index ce5286dfe1..0000000000
--- a/main/src/addins/MonoDevelop.Debugger.Gdb/ChangeLog
+++ /dev/null
@@ -1,365 +0,0 @@
-2010-06-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * configure: Bump MD version.
-
-2010-05-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * configure: Bump MD version.
-
-2010-05-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbBacktrace.cs: Track api changes.
-
-2010-05-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbBacktrace.cs: Track api changes.
-
-2010-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbSession.cs: Increased console creation timeout.
-
-2010-04-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbSession.cs: Track api changes.
-
-2010-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbBacktrace.cs: Track api changes.
-
- * MonoDevelop.Debugger.csproj: Flush.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * configure:
- * AssemblyInfo.cs:
- * Manifest.addin.xml: Bumped MD version.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.csproj: Flush.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.csproj: Merged MD.Projects into
- MD.Core, and MD.Projects.Gui, MD.Core.Gui and MD.Components
- into MD.Ide.
-
-2010-03-15 David Makovský <yakeen@sannyas-on.net>
-
- * GdbBacktrace.cs: fixes for C++ structures (thx Martin Vejnár
- <avakar@ratatanek.cz>)
-
-2010-03-08 Jonathan Pryor <jpryor@novell.com>
-
- * configure: Create a $(CSC) make variable.
- * MonoDevelop.Debugger.Gdb.make: Set $(ASSEMBLY_COMPILER_COMMAND) to
- $(CSC). This allows a top-level CSC override to be used within this
- module (e.g. top-level `make CSC=dmcs` for a v4 build).
-
-2010-03-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * GdbSession.cs: Name the reader thread.
-
-2010-03-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.Gdb.sln: The invariant policy can't be
- used anymore as base policy set.
-
-2010-02-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbBacktrace.cs: Track api changes.
-
-2010-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbBacktrace.cs: Add missing method.
-
-2010-02-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbBacktrace.cs: Track api changes.
-
-2010-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * Manifest.addin.xml:
- * GdbSessionFactory.cs: Track api changes. Some engine info is
- now taken from extension node metadata.
-
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger.Gdb.sln: Flush.
-
- * GdbSession.cs: Expressions are now printed by the debugging
- service.
-
-2009-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbBacktrace.cs: Track api changes.
-
-2009-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbSessionFactory.cs: Implement Id property.
-
-2009-11-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbBacktrace.cs: Track api changes.
-
-2009-11-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbEvent.cs: Reason can be an array. Handle this case.
-
- * MonoDevelop.Debugger.csproj: Flush.
-
- * GdbSession.cs: If there is an error while initializing,
- report that the process has exited.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * configure:
- * AssemblyInfo.cs:
- * Manifest.addin.xml: Bump MD version.
-
-2009-10-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * GdbSession.cs: Fix Pocess/Process spelling.
-
-2009-10-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * GdbSessionFactory.cs: Fix spelling of GetAttachableProcesses
- API.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * configure:
- * AssemblyInfo.cs:
- * Manifest.addin.xml: Bump MD version.
-
-2009-10-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbSession.cs:
- * GdbBacktrace.cs: Use long for thread and process id.
-
-2009-10-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.Gdb.sln:
-
- * GdbSession.cs: Don't crash if a breakpoint can't be set.
-
-2009-08-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger.Gdb.sln: Updated.
-
- * GdbSession.cs: Quote file names when needed.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.csproj: Flush.
-
-2009-04-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbSessionFactory.cs:
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger.Gdb.make: Track api changes.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * configure:
- * AssemblyInfo.cs:
- * Manifest.addin.xml: Bump MD version.
-
-2009-03-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbSessionFactory.cs: Removed unused CanDebugPlatform and
- rename CanDebugFile to CanDebugCommand.
-
-2009-03-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbSessionFactory.cs: Changed the way execution handlers
- work. We are not using platform ids anymore. Instead, we use
- command strings when looking for execution handlers.
- IExecutionHandlerFactory has been removed and now everything
- is handled by IExecutionHandler, which has a new CanExecute
- method. This model is more simple and more generic.
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.Gdb.sln: Flush.
-
-2009-02-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.Gdb.sln: Set policies. Remove unused
- name attribute.
-
-2009-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.csproj: Updated references.
-
-2009/02/06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.mdp:
- * MonoDevelop.Debugger.mds:
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger.Gdb.mds:
- * MonoDevelop.Debugger.Gdb.sln: Migrated to MSBuild file format.
-
-2009/02/03 Lluis Sanchez Gual <lluis@novell.com>
-
- * configure:
- * AssemblyInfo.cs:
- * Manifest.addin.xml: Bump MD version.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.mdp: Flush project format changes.
-
-2008-12-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.mdp: Updated.
-
- * GdbBacktrace.cs: Track api changes.
-
-2008-12-09 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * GdbSession.cs: Fallback to relative source file path.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Manifest.addin.xml: Set correct add-in category.
-
- * GdbSession.cs:
- * GdbSessionFactory.cs:
- * MonoDevelop.Debugger.mdp: Track api changes.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Manifest.addin.xml: Change addin version number to match
- configure/tarball version number.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * AssemblyInfo.cs: Add AssemblyInfo.cs files that are autogenerated from
- the addin manifests.
-
-2008-12-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.mdp:
- * MonoDevelop.Debugger.Gdb.make: Remove .pc file. It's not required.
-
-2008-11-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * Manifest.addin.xml: Track api changes.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * configure:
- * Manifest.addin.xml: Bump MD version.
-
-2008-10-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * configure: Fix tarball name.
-
-2008-09-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbBacktrace.cs, GdbSession.cs: When debugging a mono process, try to
- get managed method names for unknown stack frames.
-
-2008-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.mdp: Updated projects.
-
-2008-09-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbSession.cs: Track api changes.
-
-2008-08-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * Manifest.addin.xml, MonoDevelop.Debugger.mdp: Extension point
- location has changed.
-
-2008-08-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.mdp: Fix reference to Mono.TextEditor. The
- incorrect add-in version number causes problems in the makefile
- synchronization.
-
-2008-08-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbSession.cs: Implemented support for conditions, trace expressions
- and hit counts.
-
-2008-08-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbSession.cs: Track api changes.
-
-2008-07-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbBacktrace.cs: Implement GetAllLocals.
-
-2008-07-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbSession.cs: Track api changes.
-
-2008-07-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbSessionFactory.cs: Fix construction process command line string.
- * GdbSession.cs: Track api changes.
-
-2008-07-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.Gdb.make: Install the assemblies to the correct
- directory.
-
-2008-07-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbSession.cs: Track api changes.
-
-2008-07-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbBacktrace.cs: Added support for code completion.
-
-2008-07-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbBacktrace.cs: Track api changes.
- * GdbSession.cs: Clean temporary variables.
-
-2008-07-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbBacktrace.cs: Track api changes.
-
-2008-07-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbBacktrace.cs: Support modifying variable values.
- * GdbSession.cs: Implemented support for disassembling files.
-
-2008-07-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbSession.cs: Track api changes.
-
-2008-06-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbBacktrace.cs, GdbSession.cs: Allow setting the active thread.
- Implemented GetThreads and GetProcesses.
- * ResultData.cs: Handle weird case where a tuple can have several
- values for a property.
-
-2008-06-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbSession.cs: Implemented detach.
-
-2008-06-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * GdbSessionFactory.cs, GdbBacktrace.cs, GdbSession.cs, ResultData.cs:
- Implemented process attaching, variable query, disassemble.
-
-2008-06-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.Gdb.make, configure, MonoDevelop.Debugger.mdp,
- MonoDevelop.Debugger.mds, Makefile.include, rules.make,
- monodevelop.debugger.gdb.pc.in, Makefile: Added missing build
- files.
-
-2008-06-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs, GdbBacktrace.cs, GdbEvent.cs, GdbSession.cs,
- CommandStatus.cs, GdbSessionFactory.cs, ResultData.cs,
- GdbCommandResult.cs, Manifest.addin.xml: Initial support for gdb
- integration.
-
diff --git a/main/src/addins/MonoDevelop.Debugger.Gdb/GdbSession.cs b/main/src/addins/MonoDevelop.Debugger.Gdb/GdbSession.cs
index f7ad8dfa67..44dc1f91e1 100644
--- a/main/src/addins/MonoDevelop.Debugger.Gdb/GdbSession.cs
+++ b/main/src/addins/MonoDevelop.Debugger.Gdb/GdbSession.cs
@@ -45,7 +45,7 @@ namespace MonoDevelop.Debugger.Gdb
Process proc;
StreamReader sout;
StreamWriter sin;
- IProcessAsyncOperation console;
+ ProcessAsyncOperation console;
GdbCommandResult lastResult;
bool running;
Thread thread;
diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/ChangeLog b/main/src/addins/MonoDevelop.Debugger.Soft/ChangeLog
deleted file mode 100644
index 6f0aab0bcb..0000000000
--- a/main/src/addins/MonoDevelop.Debugger.Soft/ChangeLog
+++ /dev/null
@@ -1,59 +0,0 @@
-2010-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.Soft.IPhone/IPhoneDebuggerSession.cs:
- Use the new namespace for the soft debugger. Updated the sdb
- client library.
-
-2010-01-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * Mono.Debugging.Soft: Split out a new dll Mono.Debugging.Soft
- from the soft debugger addin. It has the bits that have with
- no MD deps apart from Mono.Debugging, and it's strongnamed
- so MonoVS can use it.
-
-2009-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Wire the soft debug addin into the build.
-
-2009-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.Soft.sln:
- * MonoDevelop.Debugger.Soft.IPhone:
- * MonoDevelop.Debugger.Soft.IPhone/ChangeLog:
- * MonoDevelop.Debugger.Soft.IPhone/Manifest.addin.xml:
- * MonoDevelop.Debugger.Soft.IPhone/IPhoneDebuggerSession.cs:
- * MonoDevelop.Debugger.Soft.IPhone/IPhoneSoftDebuggerEngine.cs:
- * MonoDevelop.Debugger.Soft.IPhone/MonoDevelop.Debugger.Soft.IPhone.csproj:
- Move the IPhone soft debugger addin to the IPhone sln.
-
-2009-11-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.Soft.sln: Tweak policy.
-
-2009-11-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.Soft.sln: Set default policies.
-
-2009-11-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile: make the "clean" target work without mdtool.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * configure: Bump MD version.
-
-2009-10-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.Soft.sln:
- * MonoDevelop.Debugger.Soft.IPhone: Stubbed. Not working yet.
-
-2009-10-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile:
- * configure: Patch into the extras configure system.
-
-2009-09-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * .temp-addin-registry: Remove temp dir.
-
diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/AspNetSoftDebuggerEngine.cs b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/AspNetSoftDebuggerEngine.cs
index 61ea302cb4..045f907c8f 100644
--- a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/AspNetSoftDebuggerEngine.cs
+++ b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/AspNetSoftDebuggerEngine.cs
@@ -75,6 +75,11 @@ namespace MonoDevelop.Debugger.Soft.AspNet
if (!evars.ContainsKey (v.Key))
evars.Add (v.Key, v.Value);
}
+
+ //HACK: work around Mono trying to create registry in non-writable location
+ if (cmd.TargetRuntime is MonoTargetRuntime && !Platform.IsWindows) {
+ evars ["MONO_REGISTRY_PATH"] = UserProfile.Current.TempDir.Combine ("aspnet-registry");
+ }
var startInfo = new SoftDebuggerStartInfo (runtime.Prefix, evars) {
WorkingDirectory = cmd.BaseDirectory,
diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/ChangeLog b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/ChangeLog
deleted file mode 100644
index 492a9e91c9..0000000000
--- a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/ChangeLog
+++ /dev/null
@@ -1,78 +0,0 @@
-2010-06-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetSoftDebuggerEngine.cs: On windows, xsp is placed under
- a winhack dir. Fixes bug #594193 - [sdb] Can't debug web
- apps on Windows.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * Manifest.addin.xml: Bumped MD version.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Debugger.Soft.AspNet.csproj: Merged MD.Projects
- into MD.Core, and MD.Projects.Gui, MD.Core.Gui and
- MD.Components into MD.Ide.
-
-2010-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * Manifest.addin.xml:
- * AspNetSoftDebuggerEngine.cs: Track api changes. Some engine
- info is now taken from extension node metadata.
-
-2010-01-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * AspNetSoftDebuggerEngine.cs:
- * MonoDevelop.Debugger.Soft.AspNet.csproj: Fix deps to track
- the dll split.
-
-2009-11-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * AspNetSoftDebuggerEngine.cs: Set UserAssemblyPaths.
-
-2009-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * AspNetSoftDebuggerEngine.cs: Implement ID member.
-
-2009-11-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * AspNetSoftDebuggerEngine.cs: Use new async launch/listen
- APIs. Add proper support for parallel runtimes.
-
-2009-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.Soft.AspNet.csproj: Add makefiles to
- project files.
-
-2009-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.Soft.AspNet.csproj: Don't local-copy
- project refs.
-
-2009-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Debugger.Soft.AspNet.csproj: Wire the soft debug
- addin into the build.
-
-2009-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.Soft.AspNet.csproj: Moved soft debug
- addin from extras.
-
-2009-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.Soft.AspNet.csproj: Updated.
-
-2009-11-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * AspNetSoftDebuggerSession.cs: Unneeded.
-
- * AspNetSoftDebuggerEngine.cs: Implement support for debugging
- xsp.
-
- * MonoDevelop.Debugger.Soft.AspNet.csproj: Remove unneeded
- file.
-
diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.Moonlight/ChangeLog b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.Moonlight/ChangeLog
deleted file mode 100644
index 40c398e8e4..0000000000
--- a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.Moonlight/ChangeLog
+++ /dev/null
@@ -1,90 +0,0 @@
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * Manifest.addin.xml: Bumped MD version.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Debugger.Soft.Moonlight.csproj: Merged
- MD.Projects into MD.Core, and MD.Projects.Gui, MD.Core.Gui
- and MD.Components into MD.Ide.
-
-2010-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * Manifest.addin.xml:
- * MoonlightSoftDebuggerEngine.cs: Track api changes. Some
- engine info is now taken from extension node metadata.
-
-2010-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MoonlightSoftDebuggerSession.cs: Use the new namespace for
- the soft debugger. Updated the sdb client library.
-
-2010-01-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Debugger.Soft.Moonlight.csproj: Fix deps to
- track the dll split.
-
-2009-12-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MoonlightSoftDebuggerSession.cs: Create the
- monodevelop-moonlight-debug Firefox profile if necessary.
-
-2009-11-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MoonlightSoftDebuggerEngine.cs: Set UserAssemblyPaths.
-
-2009-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MoonlightSoftDebuggerEngine.cs: Implement ID member.
-
-2009-11-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MoonlightSoftDebuggerEngine.cs: Fix OS check.
-
-2009-11-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MoonlightSoftDebuggerEngine.cs:
- * MoonlightSoftDebuggerSession.cs: Track AppName API, and fix
- the moonlight app name.
-
-2009-11-12 Geoff Norton <gnorton@novell.com>
-
- * MoonlightSoftDebuggerEngine.cs: Dont try to hook up a
- Console output.
- * MoonlightSoftDebuggerSession.cs: UseShellExecute = false is
- required to redirect the stdout and stderr. Don't try to
- Kill an exited process. Fix a typo in Substring
-
-2009-11-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MoonlightSoftDebuggerEngine.cs:
- * MoonlightSoftDebuggerSession.cs: First stab at implementing
- the Moonlight debug session.
-
-2009-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.Soft.Moonlight.csproj: Add makefiles to
- project files.
-
-2009-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.Soft.Moonlight.csproj: Don't local-copy
- project refs.
-
-2009-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Debugger.Soft.Moonlight.csproj: Wire the soft
- debug addin into the build.
-
-2009-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.Soft.Moonlight.csproj: Moved soft debug
- addin from extras.
-
-2009-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.Soft.Moonlight.csproj: Updated.
-
diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/ChangeLog b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/ChangeLog
deleted file mode 100644
index f4a793a605..0000000000
--- a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/ChangeLog
+++ /dev/null
@@ -1,639 +0,0 @@
-2010-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * RemoteSoftDebuggerSession.cs: Fix incorrect use of
- ShowCustomDialog/RunCustomDialog.
-
-2010-04-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerEngine.cs: Track API changes.
-
-2010-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerEngine.cs: External console processes are now
- wrapped by a IProcessAsyncOperation interface, instead of a
- Process instance. In this way it is possible to create
- external consoles which are not directly bound to a process.
-
-2010-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerEngine.cs: Fix external console support again.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * Manifest.addin.xml: Bumped MD version.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * SoftDebuggerEngine.cs:
- * RemoteSoftDebuggerSession.cs:
- * MonoDevelop.Debugger.Soft.csproj: Merged MD.Projects into
- MD.Core, and MD.Projects.Gui, MD.Core.Gui and MD.Components
- into MD.Ide.
-
-2010-03-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerEngine.cs: Track logging API.
-
-2010-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * Manifest.addin.xml:
- * SoftDebuggerEngine.cs: Track api changes. Some engine info
- is now taken from extension node metadata.
-
-2010-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * RemoteSoftDebuggerSession.cs: Use the new namespace for the
- soft debugger. Updated the sdb client library.
-
-2010-01-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * ArrayAdaptor.cs:
- * SoftDebuggerEngine.cs:
- * SoftDebuggerSession.cs:
- * SoftDebuggerAdaptor.cs:
- * FieldValueReference.cs:
- * Mono.Debugger.Soft.dll:
- * SoftDebuggerBacktrace.cs:
- * SoftEvaluationContext.cs:
- * VariableValueReference.cs:
- * PropertyValueReference.cs:
- * Mono.Debugger.Soft.dll.mdb:
- * RemoteSoftDebuggerSession.cs:
- * MonoDevelop.Debugger.Soft.csproj: Split out a new dll
- Mono.Debugging.Soft from the soft debugger addin. It has the
- bits that have with no MD deps apart from Mono.Debugging,
- and it's strongnamed so MonoVS can use it.
-
-2010-01-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerAdaptor.cs: In the log message for failed
- invokes, include info about the object and method.
-
-2010-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerAdaptor.cs: Fix the error calling ToString when
- inspecting structs that don't override it.
-
-2009-12-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerAdaptor.cs: Fixed ToString call for structs.
- Improve casting between primitive types and enums. Add some
- missing null checks.
-
- * FieldValueReference.cs: Allow getting struct and primitive
- value fields.
-
- * VariableValueReference.cs: Return correct origin flag.
-
-2009-12-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs: Flag 'external' assemblies as such
- in the log.
-
-2009-12-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs: Ignore VMDisconnectedException when
- exiting/disposing. Log errors instead of console.writeline.
-
-2009-12-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs: Add an environment variable for
- enabling sdb logging.
-
-2009-12-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerEngine.cs:
- * SoftDebuggerSession.cs:
- * RemoteSoftDebuggerSession.cs: Pass the message along to the
- debugger log output about missing user assemblies or errors
- getting assembly name.
-
-2009-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerAdaptor.cs: Implement TryConvert.
-
-2009-12-10 Geoff Norton <gnorton@novell.com>
-
- * RemoteSoftDebuggerSession.cs: Only redirect the output when
- asked to do so.
-
-2009-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerAdaptor.cs: Hide abstract properties. There is
- nothing we can do with them.
-
-2009-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerAdaptor.cs: Convert StructMirrors of type IntPtr
- to real IntPtr objects.
-
-2009-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerSession.cs: Add support for external console.
-
-2009-12-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.Debugger.Soft.dll:
- * Mono.Debugger.Soft.dll.mdb: Updated.
-
-2009-12-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs:
- * RemoteSoftDebuggerSession.cs: Add an OnConnected virtual
- method that subclasses can use to hook into when the app is
- successfully started.
-
-2009-12-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs: Pass isError to OnTargetOutput.
-
-2009-12-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs:
- * RemoteSoftDebuggerSession.cs: Add a fallback to try to kill
- hung debugger processes.
-
-2009-12-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs: When pausing and picking a frame to
- display, pick one with user code.
-
-2009-12-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.Debugger.Soft.dll:
- * Mono.Debugger.Soft.dll.mdb: Updated.
-
-2009-12-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * FieldValueReference.cs:
- * SoftDebuggerAdaptor.cs:
- * PropertyValueReference.cs: Allow modifying field values on
- structs. Track api changes.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.Debugger.Soft.dll: Updated, fixes debugger keeping
- socket open after cancellation.
- * Mono.Debugger.Soft.dll.mdb:
- * Makefile.am: Include the debugger mdb file.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs: Name threads to make debugging
- easier.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs: Avoid NREs disposing session that
- never connected.
-
-2009-12-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * FieldValueReference.cs:
- * PropertyValueReference.cs: Don't allow setting field or
- property values on structs. It is not supported for now.
-
-2009-12-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerAdaptor.cs: Properly handle boxed primitive
- values.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * RemoteSoftDebuggerSession.cs: Revert the previous change, as
- it's no longer necessary after making the base
- DebuggerSession terminate the session if Run throws.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * RemoteSoftDebuggerSession.cs: If we get an exception while
- connecting, kill the session, or it doesn't exit and the
- thread pads start throwing NREs on a null vm.
-
-2009-12-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerSession.cs: Run CancelAsyncOperations in a
- background thread, since it can block and cause a deadlock
- with the main session lock. Fixes bug #558273.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs: Don't show the socket exception
- that's caused by cancelling the session.
-
-2009-12-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerAdaptor.cs:
- * SoftDebuggerSession.cs: Implemented IsExternalType.
-
-2009-12-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerAdaptor.cs: Implement GetBaseType. Hide members
- that have the CompilerGenerated attribute.
-
- * FieldValueReference.cs:
- * PropertyValueReference.cs: Implement DeclaringType. Set the
- correct flags for fields and properties.
-
-2009-12-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerAdaptor.cs: Properly handle properties with
- private accessors.
-
- * PropertyValueReference.cs: Set the ReadOnly flag if the
- property is read-only.
-
-2009-11-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * PropertyValueReference.cs: Allow getting and setting
- nonpublic properties.
-
-2009-11-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerAdaptor.cs: Don't NRE in
- MethodCall.WaitForCompleted if it was never invoked, or if
- there was an exception in Invoke.
-
-2009-11-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerAdaptor.cs: Don't call ToString when it doesn't
- have been overriden.
-
-2009-11-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs: Fix picking a default thread
- to position to when pausing. The current_thread value
- had been nulled on resume to fix BP queuing, so
- introduce a new recent_thread field. Also, make
- a better attempt to find a non-ended thread if the
- recent_thread has ended.
-
-2009-11-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs: When disabling or removing
- breakpoints or catchpoints, flush any queued occurrences of
- them on other threads.
-
-2009-11-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerSession.cs: Fix potential null ref.
-
-2009-11-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs:
- * SoftDebuggerBacktrace.cs: Mark frames that are external
- code.
-
-2009-11-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerBacktrace.cs: Include the type name in the
- method name. Fixes bug #556941.
-
-2009-11-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerEngine.cs:
- * SoftDebuggerSession.cs: Add support for tracepoints and
- conditional breakpoints.
-
-2009-11-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerAdaptor.cs: Track API.
- * Mono.Debugger.Soft.dll: Updated.
-
-2009-11-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerSession.cs: The stepping request should always
- be disabled when stopping for whatever reason.
-
-2009-11-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Manifest.addin.xml: Declare dep on Mono.Debugger.Soft.dll.
-
-2009-11-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.Debugger.Soft.dll: Updated.
-
- * Makefile.am:
- * MonoDevelop.Debugger.Soft.csproj: Ref Cecil.
-
- * SoftDebuggerEngine.cs:
- * SoftDebuggerSession.cs:
- * RemoteSoftDebuggerSession.cs: Implement support for assembly
- filters.
-
-2009-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerEngine.cs: Implement ID member.
-
-2009-11-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerAdaptor.cs: In GetMember, look for members in
- parent types.
-
-2009-11-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerSession.cs: Fix disposing code.
-
-2009-11-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerAdaptor.cs: Properly implement
- MethodCall.Shutdown.
-
-2009-11-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerAdaptor.cs:
- * SoftDebuggerSession.cs:
- * SoftEvaluationContext.cs:
- * SoftDebuggerBacktrace.cs: Track api changes. Moved some code
- to Mono.Debugging.
-
-2009-11-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerAdaptor.cs: Fix race in async eval. We didn't
- actually need a callback, since we're just wrapping one
- async API in another.
-
-2009-11-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerAdaptor.cs: Make MethodCall class more readable.
-
-2009-11-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerAdaptor.cs: Use the async eval API instead of
- creating a thread.
-
-2009-11-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerAdaptor.cs: Fix invocation options.
-
-2009-11-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftEvaluationContext.cs: Minor fix.
-
-2009-11-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerAdaptor.cs:
- * SoftEvaluationContext.cs:
- * SoftDebuggerBacktrace.cs:
- * PropertyValueReference.cs: Track api changes. Call
- ToString() to convert objects to values, when that option is
- enabled.
-
-2009-11-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerEngine.cs:
- * SoftDebuggerSession.cs:
- * RemoteSoftDebuggerSession.cs: Use the user modules as
- assembly filters for stepping, if the startinfo has them (it
- doesn't yet).
-
-2009-11-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs: Fix the active thread object.
-
-2009-11-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerAdaptor.cs: Make invokes single-threaded and
- ignoring breakpoints.
-
-2009-11-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs:
- * RemoteSoftDebuggerSession.cs: Empty the process info cache
- when we resume, so that the process and thread lists get
- updated.
-
-2009-11-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftEvaluationContext.cs:
- * SoftDebuggerBacktrace.cs: Use the new options object.
-
- * SoftDebuggerSession.cs: Propagate busy state changes.
- Dispose the vm in a background thread, to avoid unnecessary
- waits. Cancel evaluation operations before continuing
- execution.
-
- * SoftDebuggerAdaptor.cs: Improve support for
- AllowTargetInvoke flag. Don't try to abort target invokes.
- That's not yet supported.
-
-2009-11-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.Debugger.Soft.dll: Updated.
-
- * SoftDebuggerSession.cs: Queue stop events when more than one
- come in at once, and dequeue them when resuming.
-
-2009-11-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * RemoteSoftDebuggerSession.cs: Unify the AppName handling for
- remote sessions.
-
-2009-11-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs: Refactor to tidy up the main event
- handler.
-
-2009-11-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerSession.cs:
- * SoftEvaluationContext.cs: After an evaluation in the target,
- the current frame may be invalidated, so it has to be
- queried again.
-
- * SoftDebuggerAdaptor.cs: Misc value conversion fixes.
-
- * VariableValueReference.cs: Implement local variable
- assignment.
-
-2009-11-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerSession.cs: Add missing call to base dispose.
-
- * RemoteSoftDebuggerSession.cs: Fix warning.
-
-2009-11-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerSession.cs: Avoid IDE crash when an exception is
- thrown in the event handler.
-
-2009-11-12 Geoff Norton <gnorton@novell.com>
-
- * RemoteSoftDebuggerSession.cs: Not all Listen() events redirect
- the console as well.
-
-2009-11-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs: Catch exceptions when getting
- process name. Works around Mono bug with symlinked runtimes.
-
-2009-11-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs: Fix bad state check.
-
-2009-11-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerEngine.cs:
- * SoftDebuggerSession.cs:
- * Mono.Debugger.Soft.dll:
- * RemoteSoftDebuggerSession.cs: Use new async launch/listen
- APIs. Add proper support for parallel runtimes.
-
-2009-11-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Fixed bad copy.
-
-2009-11-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerEngine.cs: Don't try to parse version number.
- Instead check for presence of Mono.Debugger.Soft.dll.
-
-2009-11-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * RemoteSoftDebuggerSession.cs: Make GetListenMessage virtual
- instead of abstract.
-
-2009-11-09 Geoff Norton <gnorton@novell.com>
-
- * SoftDebuggerSession.cs: Don't handle disconnects or
- VMDeath, as we will (erroneously) try to resume a dead
- vm
-
-2009-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.Soft.csproj: Add makefiles to project
- files.
-
- * Makefile.am: Install the Mono.Debugger.Soft assembly.
-
-2009-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.Soft.csproj: Don't local-copy project
- refs.
-
-2009-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Debugger.Soft.csproj: Wire the soft debug addin
- into the build.
-
-2009-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.Soft.csproj: Moved soft debug addin
- from extras.
-
-2009-11-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * SoftDebuggerSession.cs: Redirect errors. Improve handling of
- vm disconnection.
-
-2009-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.Soft.csproj: Added refs to GTK.
-
- * SoftDebuggerSession.cs: Remove unneeded option.
-
- * RemoteSoftDebuggerSession.cs: Abstracted out listening code
- from the iPhone debugger session.
-
-2009-11-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerEngine.cs: Stub out support for targetting
- different Mono runtimes. Expose a static CanDebugRuntime
- method.
-
-2009-11-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs: Better handling of the sim process
- exiting while listen dialog is open.
-
-2009-11-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs: Fix the dispatch dervice deadlock in
- the debugger start.
-
-2009-11-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs: In progress.
-
-2009-11-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerEngine.cs: Disable for runtime < 2.8
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * Manifest.addin.xml: Bump MD version.
-
-2009-10-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerEngine.cs: Disable sdb for Mono 2.4/2.5/2.6.
-
-2009-10-23 Geoff Norton <gnorton@novell.com>
-
- * SoftDebuggerSession.cs: Add a ConnectOutput call that is
- protected for other consumers.
- * Mono.Debugger.dll: Updated
-
-2009-10-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs: Make exiting more robust.
-
-2009-10-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerEngine.cs:
- * SoftDebuggerSession.cs: Add preliminary support for
- catchpoints.
-
-2009-10-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.Debugger.dll: Updated.
-
- * SoftDebuggerSession.cs: Stop at most recent thread when
- stopping.
-
-2009-10-21 Geoff Norton <gnorton@novell.com>
-
- * SoftDebuggerSession.cs: Fix the formatting in the output pad.
- Dont call .Enable() directly as this could result in duplicate
- entries in the target.
-
-2009-10-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerSession.cs: Expose some API for subclasses to
- override.
-
-2009-10-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.Soft.csproj: Don't require specific
- versions of refs.
-
-2009-10-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * SoftDebuggerEngine.cs: Fix spelling of
- GetAttachableProcesses API.
-
-2009-10-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * AssemblyInfo.cs:
- * Manifest.addin.xml: Fixed description.
-
- * MonoDevelop.Debugger.Soft.csproj: Patch into the extras
- configure system.
-
-2009-10-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * ArrayAdaptor.cs:
- * Mono.Debugger.dll:
- * SoftDebuggerAdaptor.cs:
- * SoftDebuggerSession.cs: Ongoing work.
-
-2009-09-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * ArrayAdaptor.cs:
- * SoftDebuggerSession.cs:
- * SoftDebuggerAdaptor.cs: Ongoing work.
-
diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/CustomSoftDebuggerEngine.cs b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/CustomSoftDebuggerEngine.cs
index 682b68eab9..65ad712d29 100644
--- a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/CustomSoftDebuggerEngine.cs
+++ b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/CustomSoftDebuggerEngine.cs
@@ -80,7 +80,7 @@ namespace MonoDevelop.Debugger.Soft
static T InvokeSynch<T> (Func<T> func)
{
- if (MonoDevelop.Ide.DispatchService.IsGuiThread)
+ if (Runtime.IsMainThread)
return func ();
var ev = new System.Threading.ManualResetEvent (false);
@@ -103,7 +103,7 @@ namespace MonoDevelop.Debugger.Soft
class CustomSoftDebuggerSession : SoftDebuggerSession
{
- IProcessAsyncOperation process;
+ ProcessAsyncOperation process;
bool usingExternalConsole;
protected override void OnRun (DebuggerStartInfo startInfo)
@@ -133,8 +133,7 @@ namespace MonoDevelop.Debugger.Soft
usingExternalConsole = true;
var console = ExternalConsoleFactory.Instance.CreateConsole (info.CloseExternalConsoleOnExit);
process = Runtime.ProcessService.StartConsoleProcess (
- info.Command, info.Arguments, info.WorkingDirectory, info.EnvironmentVariables,
- console, null);
+ info.Command, info.Arguments, info.WorkingDirectory, console, info.EnvironmentVariables);
} else {
var psi = new ProcessStartInfo (info.Command, info.Arguments) {
WorkingDirectory = info.WorkingDirectory,
@@ -143,7 +142,7 @@ namespace MonoDevelop.Debugger.Soft
foreach (KeyValuePair<string,string> kvp in info.EnvironmentVariables)
psi.EnvironmentVariables [kvp.Key] = kvp.Value;
- process = Runtime.ProcessService.StartProcess (psi, ProcessOutput, ProcessError, null);
+ process = Runtime.ProcessService.StartProcess (psi, ProcessOutput, ProcessError, null).ProcessAsyncOperation;
}
}
diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/SoftDebuggerEngine.cs b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/SoftDebuggerEngine.cs
index acdfd4e14a..fbdcd76b24 100644
--- a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/SoftDebuggerEngine.cs
+++ b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/SoftDebuggerEngine.cs
@@ -35,6 +35,7 @@ using Mono.Debugging.Client;
using MonoDevelop.Core;
using MonoDevelop.Core.Execution;
using MonoDevelop.Core.Assemblies;
+using System.Threading.Tasks;
namespace MonoDevelop.Debugger.Soft
{
@@ -72,12 +73,13 @@ namespace MonoDevelop.Debugger.Soft
{
var cmd = (DotNetExecutionCommand) c;
var runtime = (MonoTargetRuntime)cmd.TargetRuntime;
- var dsi = new SoftDebuggerStartInfo (runtime.Prefix, runtime.EnvironmentVariables) {
+ var dsi = new SoftDebuggerStartInfo (null, runtime.EnvironmentVariables) {
Command = cmd.Command,
Arguments = cmd.Arguments,
WorkingDirectory = cmd.WorkingDirectory,
};
-
+ ((SoftDebuggerLaunchArgs)dsi.StartArgs).MonoExecutableFileName = runtime.GetMonoExecutableForAssembly (cmd.Command);
+
SetUserAssemblyNames (dsi, cmd.UserAssemblyPaths);
foreach (KeyValuePair<string,string> var in cmd.EnvironmentVariables)
@@ -86,9 +88,9 @@ namespace MonoDevelop.Debugger.Soft
var varsCopy = new Dictionary<string, string> (cmd.EnvironmentVariables);
var startArgs = (SoftDebuggerLaunchArgs) dsi.StartArgs;
startArgs.ExternalConsoleLauncher = delegate (System.Diagnostics.ProcessStartInfo info) {
- IProcessAsyncOperation oper;
+ ProcessAsyncOperation oper;
oper = Runtime.ProcessService.StartConsoleProcess (info.FileName, info.Arguments, info.WorkingDirectory,
- varsCopy, ExternalConsoleFactory.Instance.CreateConsole (dsi.CloseExternalConsoleOnExit), null);
+ ExternalConsoleFactory.Instance.CreateConsole (dsi.CloseExternalConsoleOnExit), varsCopy);
return new ProcessAdapter (oper, Path.GetFileName (info.FileName));
};
@@ -169,17 +171,17 @@ namespace MonoDevelop.Debugger.Soft
class ProcessAdapter: Mono.Debugger.Soft.ITargetProcess
{
- IProcessAsyncOperation oper;
+ ProcessAsyncOperation oper;
string name;
- public ProcessAdapter (IProcessAsyncOperation oper, string name)
+ public ProcessAdapter (ProcessAsyncOperation oper, string name)
{
this.oper = oper;
this.name = name;
- oper.Completed += delegate {
+ oper.Task.ContinueWith (t => {
if (Exited != null)
Exited (this, EventArgs.Empty);
- };
+ }, Runtime.MainTaskScheduler);
}
#region IProcess implementation
diff --git a/main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/ChangeLog b/main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/ChangeLog
deleted file mode 100644
index 6b8c824978..0000000000
--- a/main/src/addins/MonoDevelop.Debugger.Win32/CorApi2/ChangeLog
+++ /dev/null
@@ -1,6 +0,0 @@
-2010-04-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * Metadata\CorMetadata.cs:
- * Metadata\MetadataType.cs: The Make*Type methods are now
- public.
-
diff --git a/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/AddinInfo.cs b/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/AddinInfo.cs
index be6398819e..3ad32e24e5 100644
--- a/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/AddinInfo.cs
+++ b/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/AddinInfo.cs
@@ -14,4 +14,4 @@ using Mono.Addins.Description;
[assembly:AddinDependency ("Core", MonoDevelop.BuildInfo.Version)]
[assembly:AddinDependency ("Ide", MonoDevelop.BuildInfo.Version)]
[assembly:AddinDependency ("Debugger", MonoDevelop.BuildInfo.Version)]
-[assembly:AddinDependency ("AspNet", MonoDevelop.BuildInfo.Version)]
+[assembly:AddinDependency ("AspNet", MonoDevelop.BuildInfo.Version)] \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/ChangeLog b/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/ChangeLog
deleted file mode 100644
index ccbb1ba699..0000000000
--- a/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/ChangeLog
+++ /dev/null
@@ -1,49 +0,0 @@
-2010-04-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * CorEvaluationContext.cs: New helper property.
-
- * CorObjectAdaptor.cs: Improved CallToString. Fixed enum
- conversions. Implemented some missing overrideables:
- CreateTypeObject, GetEnumMembers, GetIndexerReference.
-
- * CorDebuggerSession.cs: Improved implementation of
- GetTypeInfo. It now supports primitive, generic and array
- types.
-
- * FieldReference.cs: When getting enum members, convert the
- integer value to an enum value
-
- * PropertyReference.cs: Improved implementation of indexers.
- Properly box primitive values when setting/getting the
- property.
-
- * MonoDevelop.Debugger.Win32.csproj: Updated.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.Win32.addin.xml: Bumped MD version.
-
-2009-12-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * CorObjectAdaptor.cs:
-
-2009-12-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * CorObjectAdaptor.cs: Track api changes.
-
-2009-12-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * FieldReference.cs:
- * CorObjectAdaptor.cs:
- * PropertyReference.cs: Implement GetBaseType and
- DeclaringType. Honor the DeclareOnly flag.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.Win32.addin.xml: Bump MD version.
-
-2009-10-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * CorDebuggerEngine.cs:
- * CorDebuggerSession.cs: Fix Pocess/Process spelling.
-
diff --git a/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/CorDebuggerEngine.cs b/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/CorDebuggerEngine.cs
index 9d1d77f225..db58871ac4 100644
--- a/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/CorDebuggerEngine.cs
+++ b/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/CorDebuggerEngine.cs
@@ -4,7 +4,9 @@ using System.IO;
using Mono.Debugging.Client;
using MonoDevelop.Core;
using MonoDevelop.Core.Execution;
+#if ASPNET
using MonoDevelop.AspNet.Execution;
+#endif
namespace MonoDevelop.Debugger.Win32
{
@@ -17,9 +19,11 @@ namespace MonoDevelop.Debugger.Win32
DotNetExecutionCommand cmd = command as DotNetExecutionCommand;
if (cmd != null)
return (cmd.TargetRuntime == null || cmd.TargetRuntime.RuntimeId == "MS.NET");
+#if ASPNET
var acmd = command as AspNetExecutionCommand;
if (acmd != null)
return (acmd.TargetRuntime == null || acmd.TargetRuntime.RuntimeId == "MS.NET");
+#endif
return false;
}
@@ -37,7 +41,7 @@ namespace MonoDevelop.Debugger.Win32
}
return startInfo;
}
-
+#if ASPNET
var acmd = command as AspNetExecutionCommand;
if (acmd != null) {
DebuggerStartInfo startInfo = new DebuggerStartInfo ();
@@ -56,12 +60,13 @@ namespace MonoDevelop.Debugger.Win32
startInfo.EnvironmentVariables["DEVPATH"] = Path.GetDirectoryName (xspPath);
return startInfo;
}
+#endif
throw new NotSupportedException ();
}
public DebuggerSession CreateSession ( )
{
- return new CorDebuggerSession ();
+ return MtaThread.Run(() => new CorDebuggerSession());
}
public ProcessInfo[] GetAttachableProcesses ( )
diff --git a/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/CorObjectAdaptor.cs b/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/CorObjectAdaptor.cs
index dc4a4e5969..8d31ebd7a8 100644
--- a/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/CorObjectAdaptor.cs
+++ b/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/CorObjectAdaptor.cs
@@ -1217,8 +1217,8 @@ namespace MonoDevelop.Debugger.Win32
{
CorValue obj = GetRealObject (ctx, objr);
- if ((obj is CorReferenceValue) && ((CorReferenceValue) obj).IsNull)
- return new EvaluationResult ("(null)");
+ if ((obj is CorReferenceValue) && ((CorReferenceValue)obj).IsNull)
+ return null;
CorStringValue stringVal = obj as CorStringValue;
if (stringVal != null) {
diff --git a/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32.csproj b/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32.csproj
index 951b9df5ba..4dc0f0fbb3 100644
--- a/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32.csproj
+++ b/main/src/addins/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32/MonoDevelop.Debugger.Win32.csproj
@@ -38,7 +38,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\..\build\AddIns\MonoDevelop.Debugger.Win32</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DefineConstants>DEBUG;TRACE;ASPNET</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
@@ -47,7 +47,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\..\build\AddIns\MonoDevelop.Debugger.Win32</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
+ <DefineConstants>TRACE;ASPNET</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
diff --git a/main/src/addins/MonoDevelop.Debugger/ChangeLog b/main/src/addins/MonoDevelop.Debugger/ChangeLog
deleted file mode 100644
index c2254df404..0000000000
--- a/main/src/addins/MonoDevelop.Debugger/ChangeLog
+++ /dev/null
@@ -1,1439 +0,0 @@
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/DebugCommands.cs:
- * MonoDevelop.Debugger/DebuggingService.cs: Track API changes.
-
-2010-07-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Track API
- changes.
-
-2010-07-13 Levi Bard <levi@unity3d.com>
-
- * MonoDevelop.Debugger/ExceptionCaughtDialog.cs:
- Unescape exception message.
-
-2010-07-07 Levi Bard <levi@unity3d.com>
-
- * MonoDevelop.Debugger/LocalsPad.cs:
- Persist local pad tree state while single-stepping within the same function.
-
-2010-06-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * icons/debug-overlay-24.png:
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger.addin.xml: Fix icon composition
- warning.
-
-2010-06-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/DisassemblyView.cs: Track API changes.
-
-2010-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: Fix incorrect use
- of ShowCustomDialog/RunCustomDialog.
-
-2010-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: Use
- ShowCustomDialog (which destroys the dialog when done)
- instead of RunCustomDialog (which doesn't).
-
-2010-05-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/DebugCommands.cs: More dialog placement
- cleanup.
-
-2010-05-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: More dialog
- placing.
-
-2010-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/DebugCommands.cs: Clean up dialog
- placement.
-
- * gtk-gui/MonoDevelop.Debugger.BreakpointPropertiesDialog.cs:
- Flush.
-
-2010-05-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Show the
- exception information when double clicking on it in the
- locals or watch pads.
-
- * MonoDevelop.Debugger/ExceptionCaughtDialog.cs: Don't crash
- if there is a change event after the dialog is closed.
-
-2010-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/ExceptionCaughtDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.ExceptionCaughtDialog.cs:
- Improved exception dialog. It now shows the stack trace.
- Track api changes.
-
-2010-05-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Track API
- changes.
-
-2010-05-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: Unsubscribe all
- events from the session when stopping the debugger. Ensures
- that the old session is completely disconnected from the
- debugging service, so if something goes wrong while shutting
- down, it will not interfere with a new session. This might
- be a fix for bug #602476.
-
-2010-05-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/BusyEvaluatorDialog.cs: Dont re-show
- the busy dialog if the user clicks on Keep Waiting. Instead,
- show it when the user tries to continue debugging. Also show
- a flashing status icon while in busy mode.
-
-2010-05-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.addin.xml: Remove unused icon sizes.
-
-2010-05-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ImmediatePad.cs: Really fix not
- supported expression error reporting.
-
-2010-05-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ImmediatePad.cs: Improve error message
- when an expression is not supported.
-
-2010-05-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ObjectValuePad.cs:
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger.Visualizer/TextVisualizer.cs:
- * MonoDevelop.Debugger.Visualizer/PixbufVisualizer.cs: Track
- api changes. When evaluation options change, update the
- value pads.
-
-2010-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Debugger/ObjectValueTreeView.cs:
- * MonoDevelop.Debugger/ExceptionCaughtDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.ExceptionCaughtDialog.cs:
- Exception dialog fixes. Wrap the exception message. Don't
- show new lines in the value column.
-
-2010-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.csproj: Flush.
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Properly update
- expanders visibility when refreshing a row.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/DisassemblyView.cs: ViewContent widgets
- are now destroyed by the workspace window.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Track API
- changes.
-
-2010-04-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/DebugExecutionHandlerFactory.cs: Make
- IProcessAsyncOperation IDisposable.
-
-2010-04-23 Carlo Kok <ck@remobjects.com>
-
- * MakeFile.am:
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/ExpressionEvaluatorExtensionNode.cs:
- * MonoDevelop.Debugger/LocalsPad.cs:
- Allow for custom debug expression evaluator plugins.
-
-2010-04-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Improved column
- size handling.
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Debugger.ExpressionEvaluatorDialog.cs:
- Changed default size for evaluator dialog.
-
-2010-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Reduce size of
- refresh and visualizer buttons. Moved refresh button to the
- front of the column.
-
- * MonoDevelop.Debugger/ExpressionEvaluatorDialog.cs: Allow
- expanding.
-
-2010-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger.addin.xml:
- * MonoDevelop.Debugger.Visualizer:
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/ObjectValueTreeView.cs:
- * MonoDevelop.Debugger.Visualizer/TextVisualizer.cs:
- * MonoDevelop.Debugger.Visualizer/PixbufVisualizer.cs:
- * MonoDevelop.Debugger.Visualizer/IValueVisualizer.cs:
- * gtk-gui/MonoDevelop.Debugger.ExceptionCaughtDialog.cs:
- * MonoDevelop.Debugger.Visualizer/ValueVisualizerDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.ExpressionEvaluatorDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.BreakpointPropertiesDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.Viewers.ValueVisualizerDialog.cs:
- Add basic support for custom visualizers.
-
- * MonoDevelop.Debugger/PinnedWatch.cs: Set the correct
- expression name.
-
-2010-04-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/BreakpointPropertiesDialog.cs: Added
- new test suite for StackFrame. Reorganized a bit the
- namespaces. Added tests for bug #580994.
-
-2010-04-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/BreakpointPropertiesDialog.cs: When
- checking if some breakpoint features are supported, check it
- for the startup project too, since the current project may
- be a library and not executable.
-
-2010-04-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/BreakpointPad.cs: Use the delete key
- command to bind the delete key.
-
-2010-04-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.addin.xml:
- * MonoDevelop.Debugger/WatchPad.cs:
- * MonoDevelop.Debugger/DebugCommands.cs:
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Added a context
- menu to ObjectValueTreeView, which includes a command which
- allows adding a value to the watch pad.
-
-2010-04-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Don't set
- change the pin icon while editing.
-
-2010-04-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Debugger.BreakpointPropertiesDialog.cs:
- Remove dead space at bottom of dialog.
-
-2010-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Debugger.BreakpointPropertiesDialog.cs:
- Flush.
-
- * MonoDevelop.Debugger/StackTracePad.cs: Alloy copying the
- call stack to the clipboard. Added context menu.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.addin.xml:
- * MonoDevelop.Debugger/DebugCommands.cs: Fixed some command
- descriptions.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Debugger.addin.xml: Bumped MD version.
-
-2010-03-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.addin.xml: Set the default location for
- debug pads. Register a new Debug layout.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger.addin.xml:
- * MonoDevelop.Debugger/WatchPad.cs:
- * MonoDevelop.Debugger/LocalsPad.cs:
- * MonoDevelop.Debugger/Extensions.cs:
- * MonoDevelop.Debugger/ThreadsPad.cs:
- * MonoDevelop.Debugger/Initializer.cs:
- * MonoDevelop.Debugger/ImmediatePad.cs:
- * MonoDevelop.Debugger/StackTracePad.cs:
- * MonoDevelop.Debugger/DebugCommands.cs:
- * MonoDevelop.Debugger/BreakpointPad.cs:
- * MonoDevelop.Debugger/ObjectValuePad.cs:
- * MonoDevelop.Debugger/ExceptionsDialog.cs:
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/ObjectValueTreeView.cs:
- * MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs:
- * MonoDevelop.Debugger/BreakpointPropertiesDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.BreakpointPropertiesDialog.cs:
- Merged MD.Projects into MD.Core, and MD.Projects.Gui,
- MD.Core.Gui and MD.Components into MD.Ide.
-
-2010-03-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ImmediatePad.cs: Show the clear button
- in the dock item toolbar.
-
-2010-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ThreadsPad.cs:
- * MonoDevelop.Debugger/StackTracePad.cs: Icons are set in the
- extension node.
-
- * MonoDevelop.Debugger/BreakpointPad.cs: Remove unrequired
- shadow.
-
-2010-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger/BreakpointPad.cs: Use the new
- DockItemToolbar class for showing toolbar commands.
-
-2010-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Added target for running the tests.
-
-2010-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: Clean the
- breakpoint list when closing the solution.
-
-2010-02-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ExceptionsDialog.cs: Fix bug #579754 -
- Duplicate exception names in debugger exception dialog
-
-2010-02-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/ExceptionCaughtDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.ExceptionCaughtDialog.cs: Added
- new dialog which is shown when an exception is caught.
-
- * MonoDevelop.Debugger/ImmediatePad.cs: Use new expression
- validation method.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ThreadsPad.cs:
- * MonoDevelop.Debugger/StackTracePad.cs:
- * MonoDevelop.Debugger/BreakpointPad.cs:
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Track api
- changes.
-
-2010-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DebuggerEngine.cs: Properly initialize
- the engine.
-
-2010-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger.addin.xml:
- * MonoDevelop.Debugger/Extensions.cs:
- * MonoDevelop.Debugger/DebuggerEngine.cs:
- * MonoDevelop.Debugger/IDebuggerEngine.cs:
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/DebugExecutionModeSet.cs:
- * MonoDevelop.Debugger/AttachToProcessDialog.cs:
- * MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs:
- * MonoDevelop.Debugger/DebuggerEngineExtensionNode.cs:
- * MonoDevelop.Debugger/DebugExecutionHandlerFactory.cs: Added
- support for lazy loading of add-ins
-
-2010-02-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/ThreadsPad.cs:
- * MonoDevelop.Debugger/StackTracePad.cs:
- * MonoDevelop.Debugger/BreakpointPad.cs:
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Track API
- changes for lazy loading images.
-
-2010-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/ExceptionsDialog.cs: Include
- System.Exception in exceptions list.
-
-2010-02-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: init pinned
- watch coordinates to -1.
-
-2010-02-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger/PinnedWatch.cs:
- * MonoDevelop.Debugger/PinnedWatchStore.cs:
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/ObjectValueTreeView.cs:
- * gtk-gui/MonoDevelop.Debugger.ExpressionEvaluatorDialog.cs:
- Implemented infrastructure for supporting persistent pinned
- watches.
-
-2010-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DebugCommands.cs: Warn the user when
- trying to debug an outdated exe. Fixes bug #540979.
-
-2010-01-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Track API
- changes.
-
-2010-01-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Made GetIcon
- public.
-
-2010-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.Debugger.ExceptionsDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.BusyEvaluatorDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.AddTracePointDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.AttachToProcessDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.ExpressionEvaluatorDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.BreakpointPropertiesDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.DebuggerOptionsPanelWidget.cs:
- Flush.
-
-2010-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: Implement a type
- resolver. Helps fixing bug #570855 - Poor type resolution in
- debugger.
-
-2010-01-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Track API
- changes.
-
-2009-12-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.Tests:
- * MonoDevelop.Debugger.Tests.TestApp: Added new testing
- projects.
-
- * MonoDevelop.Debugger/DebuggingService.cs: Allow using the
- debugging service when the Ide is not initialized.
-
-2009-12-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: Ensure that soft
- debugger is prioritised over newly installed debuggers.
-
-2009-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Debugger.csproj:
- * icons/view-debug-watch-16.png:
- * icons/view-debug-locals-16.png:
- * MonoDevelop.Debugger.addin.xml:
- * icons/view-debug-threads-16.png:
- * icons/view-debug-call-stack-16.png:
- * icons/view-debug-breakpoints-16.png: Added some new icons.
-
-2009-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Use the new
- DisplayValue property.
-
-2009-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: Pass along the
- external console option.
-
-2009-12-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: Use
- Workbench.Present so that we can special-case for different
- platforms.
-
-2009-12-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Debugger.DebuggerOptionsPanelWidget.cs:
- Added new grouping options to the options panel.
-
- * MonoDevelop.Debugger/DebuggingService.cs: Moved all options
- properties to a single object.
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Show the new
- static member icons.
-
-2009-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.addin.xml: Fix shortcut conflict.
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Debugger.ExpressionEvaluatorDialog.cs:
- Evaluate expression when pressing enter in the expression
- evaluator dialog.
-
-2009-11-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: Remove FIXME that
- was fixed.
-
-2009-11-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/StackTracePad.cs: Don't prevent the
- user from jumping to frames if source exists, even if
- they're not user code.
-
-2009-11-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/Initializer.cs: Take external code
- into account when picking frame to show when stopping.
-
-2009-11-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DebugTextMarker.cs: New marker for
- tracepoints.
-
-2009-11-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/StackTracePad.cs: Don't jump to
- external frames.
-
-2009-11-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/StackTracePad.cs: Make frames that are
- external code italic.
-
- * MonoDevelop.Debugger/Initializer.cs:
- * MonoDevelop.Debugger/DebuggingService.cs: Only display the
- current visible frame, not external code frames.
-
-2009-11-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger.addin.xml:
- * MonoDevelop.Debugger/DebugCommands.cs:
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/AddTracePointDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.AddTracePointDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.BreakpointPropertiesDialog.cs:
- Implemented Add Tracepoint command.
-
-2009-11-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: Add a call for
- accessing the next "visible" stack frame.
-
- * MonoDevelop.Debugger/Initializer.cs: Track API.
-
- * MonoDevelop.Debugger/DebugTextMarker.cs: New marker.
-
-2009-11-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Debugger.DebuggerOptionsPanelWidget.cs:
- Add setting for user-code-only debugging.
-
-2009-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Debugger/IDebuggerEngine.cs:
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Debugger.DebuggerOptionsPanelWidget.cs:
- Added options panel for setting debugger engine selection
- priority.
-
-2009-11-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Add support for
- the new EvaluatingGroup value type.
-
-2009-11-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: Remove debug code.
-
-2009-11-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Debugger/ImmediatePad.cs:
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/ObjectValueTreeView.cs:
- * MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Debugger.DebuggerOptionsPanelWidget.cs:
- Add support for refreshing values. Added option for enabling
- ToString evaluation. Track api changes.
-
-2009-11-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.addin.xml:
- * MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs: Added
- options panel for the debugger options.
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * MonoDevelop.Debugger.csproj:
- * gtk-gui/MonoDevelop.Debugger.ExceptionsDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.BusyEvaluatorDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.AttachToProcessDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.ExpressionEvaluatorDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.DebuggerOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Debugger.BreakpointPropertiesDialog.cs:
- Updated.
-
- * MonoDevelop.Debugger/DebuggingService.cs: Use the options
- entered by the user for timeout and target evaluation. Show
- the busy dialog when the debugger is busy.
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Use the default
- timeout when evaluating expressions.
-
- * MonoDevelop.Debugger/BusyEvaluatorDialog.cs: New dialog
- shown when the debugger is busy executing target methods.
-
-2009-11-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: Fix bug #549886 -
- Pressing Enter at the end of a line with a breakpoint moves
- the breakpoint down a line.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Debugger.addin.xml: Bump MD version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Debugger.csproj: Reference the mono-cairo
- package.
-
- * MonoDevelop.Debugger/Initializer.cs:
- * MonoDevelop.Debugger/DebuggingService.cs: Properly check
- debugger features while in a debug session.
-
- * MonoDevelop.Debugger/ThreadsPad.cs: Improve error handling.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.Debugger.ExceptionsDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.AttachToProcessDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.ExpressionEvaluatorDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.BreakpointPropertiesDialog.cs:
- Flush.
-
-2009-10-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: Fixed 'Bug 550179
- - Caret should not pulse when debugger stepping'.
-
-2009-10-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.addin.xml: Add Mac shortcuts.
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Debugger.csproj: Flush.
-
-2009-10-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/ThreadsPad.cs: Fix Pocess/Process
- spelling.
-
-2009-10-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/IDebuggerEngine.cs:
- * MonoDevelop.Debugger/AttachToProcessDialog.cs: Fix spelling
- of GetAttachableProcesses API.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: Added new event to
- disable conditional compilation for a document.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Debugger.addin.xml: Bump MD version.
-
-2009-10-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/AttachToProcessDialog.cs: Track api
- changes.
-
-2009-10-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: Avoid deadlock by
- delaying the display of error dialogs.
-
-2009-09-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/Initializer.cs: Don't show the
- disassembly window if not supported.
-
-2009-09-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.addin.xml:
- * MonoDevelop.Debugger/DebugCommands.cs:
- * MonoDevelop.Debugger/DebuggingService.cs: Implemented Show
- Current Execution Line command.
-
-2009-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: Added null check.
-
-2009-09-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: Report debugger
- exceptions in a dialog.
-
- * MonoDevelop.Debugger/BreakpointPad.cs: Disable the
- breakpoints pad if the breakpoint store is read-only while
- running.
-
- * MonoDevelop.Debugger/DebugCommands.cs: Disable breakpoint
- commands when the breakpoint store is read-only.
-
-2009-09-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger\DebuggingService.cs: Fire the stopped
- event after disposing the session.
-
-2009-09-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ImmediatePad.cs: Added a toolbar with a
- clean button.
-
-2009-09-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Track API
- changes.
-
-2009-09-09 Christian Hergert <chris@dronelabs.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/DebugCommands.cs: Make windows transient
- for the root monodevelop window.
-
-2009-09-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Track api
- changes.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.csproj: Updated dependencies. We now
- depend on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/BreakpointPad.cs: Fix issue with
- context menu. Fixes bug #480535.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger\StackTracePad.cs: Improve stack frame
- formatting.
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Track API
- changes.
-
-2009-08-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.addin.xml: Try some different Mac
- keyboard mappings for build and run commands.
-
-2009-08-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.csproj: Don't make local copies of
- project references.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Debugger.BreakpointPropertiesDialog.cs:
- Flush.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Debugger.ExceptionsDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.AttachToProcessDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.ExpressionEvaluatorDialog.cs:
- Flush.
-
-2009-07-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/DebugCommands.cs: Run has now "Run
- again" functionality when no debugger is installed.
-
-2009-07-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Track API
- changes.
-
-2009-07-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Track api
- changes.
-
-2009-06-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ImmediatePad.cs: Use the new
- DesktopService instead of PlatformService.
-
-2009-06-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger.addin.xml:
- * MonoDevelop.Debugger/ImmediatePad.cs: Added immediate pad.
-
-2009-05-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger\ThreadsPad.cs: Don't try to get the
- list of threads if the debugger is running.
-
- * MonoDevelop.Debugger\DebugCommands.cs: Fix logic for
- checking if debugging is supported.
-
-2009-05-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger\ThreadsPad.cs:
- * MonoDevelop.Debugger\StackTracePad.cs: Don't render a
- border. The dock item already provides one.
-
-2009-05-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger\Initializer.cs:
- * MonoDevelop.Debugger\DebuggingService.cs: Use FilePath for
- representing paths.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/Extensions.cs:
- * MonoDevelop.Debugger/DebugCommands.cs: Workaround for what
- seems to be a mcs bug. Looks like it can't properly resolve
- the implicit conversion of null to string.
-
-2009-05-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.addin.xml: More Mac shortcuts.
-
-2009-04-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger/IDebuggerEngine.cs: Moved
- IDebuggerEngine from Mono.Debugging.
-
- * MonoDevelop.Debugger/DebuggingService.cs: IDebuggerEngine
- now takes an ExecutionCommand as parameter.
-
-2009-04-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger.addin.xml:
- * MonoDevelop.Debugger/DebugExecutionModeSet.cs: Created an
- execution mode set for debuggers.
-
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/DebugExecutionHandlerFactory.cs: Track
- api changes done in IExecutionHandler.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.Debugger.csproj: don't require specific
- gtk-sharp version.
-
-2009-04-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/WatchPad.cs: Changed IMementoCapable
- interface.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Debugger.addin.xml: Bump MD version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ExceptionsDialog.cs: Track api changes
- to support multiple target runtimes.
-
-2009-04-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Track api
- changes (Made the 'undo' of code completion operations more
- intelligent.)
-
-2009-03-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger/DisassemblyView.cs:
- * MonoDevelop.Debugger/DebugTextMarker.cs: Fixed compilation
- error.
-
-2009-03-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Track api
- changes.
-
-2009-03-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.csproj: Don't local-copy project refs.
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger.csproj: Moved text editor to core
-
-2009-03-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Fix bug #478331
- - Adding second (third, etc) variable to watch pad takes
- type of first variable.
-
-2009-03-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: Removed unused
- CanDebugPlatform and rename CanDebugFile to CanDebugCommand.
-
-2009-03-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/Extensions.cs:
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/DebugExecutionHandlerFactory.cs:
- Changed the way execution handlers work. We are not using
- platform ids anymore. Instead, we use command strings when
- looking for execution handlers. IExecutionHandlerFactory has
- been removed and now everything is handled by
- IExecutionHandler, which has a new CanExecute method. This
- model is more simple and more generic.
-
-2009-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/BreakpointPropertiesDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.BreakpointPropertiesDialog.cs:
- Moved breakpoint properties dialog from MD.Ide. Disable
- conditional and tracepoint options if they are not supported
- by the project.
-
-2009-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/Extensions.cs: Fixed NRE when the
- current view does not have a file name. Fixes bug #480823 -
- NRE when closing solution.
-
-2009-03-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: commented out
- debug message.
-
-2009-02-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/ThreadsPad.cs:
- * MonoDevelop.Debugger/StackTracePad.cs: Added translatable
- strings. Patch from Bálint Kriván.
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.csproj: Flush.
-
-2009-02-23 Scott Ellington <scott.ellington@gmail.com>
-
- * Makefile.am:
- * icons/step-out-24.png:
- * icons/step-into-24.png:
- * icons/step-over-24.png:
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger.addin.xml: add 24 px icons and debug
- toolbar
-
-2009-02-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.addin.xml: Track merge of the project
- pad context menu.
-
-2009-02-20 Scott Ellington <scott.ellington@gmail.com>
-
- * Makefile.am:
- * icons/step-out-22.png:
- * icons/step-out-16.png:
- * icons/step-over-22.png:
- * icons/step-over-16.png:
- * icons/step-into-16.png:
- * icons/step-into-22.png:
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger.addin.xml: add step icons
-
-2009-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/WatchPad.cs: When restoring the watch
- pad state, clear the old state.
-
-2009-02-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ExceptionsDialog.cs: Track api changes.
-
-2009-02-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/LocalsPad.cs:
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Add locals all
- at once to the list.
-
- * MonoDevelop.Debugger/DebugCommands.cs: Allow editing the
- exceptions even when the debugger is not running.
-
-2009-02-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * icons:
- * Makefile.am:
- * icons/debug-overlay-32.png:
- * icons/debug-overlay-22.png:
- * icons/debug-overlay-16.png:
- * MonoDevelop.Debugger.csproj:
- * MonoDevelop.Debugger.addin.xml:
- * MonoDevelop.Debugger/DebugCommands.cs: Added icon for debug
- command. Make sure the run command is visible in the toolbar
- even when there are no debuggers installed.
-
-2009-02-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/ThreadsPad.cs:
- * MonoDevelop.Debugger/StackTracePad.cs:
- * MonoDevelop.Debugger/BreakpointPad.cs:
- * MonoDevelop.Debugger/ObjectValuePad.cs:
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Use pad font.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.csproj: Don't require a specific
- version of Mono.Addins.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.csproj: Flush MD's removal of newline
- at end of file that was introduced by manually editing with
- gedit.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.csproj: Make debug configuration build
- debug symbols.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.mdp:
- * MonoDevelop.Debugger.csproj: Migrated to MSBuild file
- format.
-
-2009-02-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/DisassemblyView.cs: track api changes.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Debugger.addin.xml: Bump MD version.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.Debugger.ExceptionsDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.AttachToProcessDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.ExpressionEvaluatorDialog.cs:
- Flush.
-
- * Makefile.am:
- * MonoDevelop.Debugger.mdp: Updated Mono.Cairo reference.
-
-2009-02-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/DisassemblyView.cs: Track
- TextEditorOptions API changes.
-
-2009-02-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Track changes in MD's assembly handling.
- Mono.Cairo is no longer considered to be a "system"
- assembly.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger.mdp: Flush project format changes.
-
-2008-12-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Use the new async
- evaluation feature.
-
- * MonoDevelop.Debugger/StackTracePad.cs:
- * MonoDevelop.Debugger/ObjectValuePad.cs: Make sure the pad is updated
- only when it is visible.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.mdp: All projects now require fx 3.5.
-
-2008-12-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: When cleaning up the
- session, dispose it as last step, since it may be slow, and it might
- delay all other cleanup operations.
-
-2008-12-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DebuggingService.cs: If something goes wrong when
- starting the debugger, cleanup the session.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Debugger.addin.xml:
- * MonoDevelop.Debugger/Initializer.cs:
- * MonoDevelop.Debugger/DebugCommands.cs:
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/AttachToProcessDialog.cs: Hide debugger commands
- which are not supported by the installed debuggers.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.addin.xml: Updated key bindings to match VS.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.addin.xml: Changed default label of debug command
- for projects since to avoid it being confused with the global debug
- command in the key bindings panel.
-
- * MonoDevelop.Debugger/Extensions.cs: Honor the RunWithWarning and
- BuildBeforeExecuting preferences.
-
- * MonoDevelop.Debugger/DebugExecutionHandlerFactory.cs: Track api
- changes.
-
- * MonoDevelop.Debugger/DebugCommands.cs: Honor the RunWithWarning and
- BuildBeforeExecuting preferences. If no debugger is installed, the
- Debug command will work as a regular Run command.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * AssemblyInfo.cs: Add AssemblyInfo.cs files that are autogenerated from
- the addin manifests.
-
-2008-12-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Allow editing by pressing
- F2.
-
-2008-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.addin.xml: Fix command names.
-
-2008-11-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * MonoDevelop.Debugger.mdp:
- * MonoDevelop.Debugger.addin.xml:
- * MonoDevelop.Debugger/DebugCommands.cs:
- * MonoDevelop.Debugger/ExceptionsDialog.cs:
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/ObjectValueTreeView.cs:
- * gtk-gui/MonoDevelop.Debugger.ExceptionsDialog.cs:
- * MonoDevelop.Debugger/ExpressionEvaluatorDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.ExpressionEvaluatorDialog.cs: Implemented
- exceptions dialog and expression evaluation dialog.
-
-2008-11-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Debugger.mdp:
- * MonoDevelop.Debugger.addin.xml:
- * MonoDevelop.Debugger/LocalsPad.cs:
- * MonoDevelop.Debugger/Extensions.cs:
- * MonoDevelop.Debugger/ThreadsPad.cs:
- * MonoDevelop.Debugger/Initializer.cs:
- * MonoDevelop.Debugger/StackTracePad.cs:
- * MonoDevelop.Debugger/DebugCommands.cs:
- * MonoDevelop.Debugger/BreakpointPad.cs:
- * MonoDevelop.Debugger/ObjectValuePad.cs:
- * MonoDevelop.Debugger/DisassemblyView.cs:
- * MonoDevelop.Debugger/ExceptionsDialog.cs:
- * MonoDevelop.Debugger/DebuggingService.cs:
- * MonoDevelop.Debugger/ObjectValueTreeView.cs:
- * MonoDevelop.Debugger/AttachToProcessDialog.cs:
- * gtk-gui/MonoDevelop.Debugger.ExceptionsDialog.cs:
- * MonoDevelop.Debugger/DebugExecutionHandlerFactory.cs:
- * gtk-gui/MonoDevelop.Debugger.AttachToProcessDialog.cs: Moved here all
- debug commands previously implemented in MD.Ide.
-
-2008-11-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Debugger.mdp: Updated.
-
-2008-11-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/Initializer.cs:
- * MonoDevelop.Debugger/DisasemblyView.cs:
- * MonoDevelop.Debugger/DisassemblyView.cs: Fix spelling.
-
-2008-11-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/DebugTextMarker.cs: fixed compilation error.
-
-2008-11-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Fix build dependencies.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.addin.xml: Bump MD version.
-
-2008-10-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Track APIs.
-
-2008-10-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Track CompletionData API.
-
-2008-10-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Remove ambiguity.
-
-2008-10-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Track API.
-
-2008-09-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: implemented IComparable.
-
-2008-09-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Really fix.
-
-2008-09-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Track api changes.
-
-2008-09-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ObjectValuePad.cs: Fix nullref.
-
-2008-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.mdp: Updated projects.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs: Updated generated code.
-
-2008-08-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/DisasemblyView.cs: made some changes caused by
- text editor changes.
-
-2008-08-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Debugger.BreakpointPropertiesDialog.cs,
- gtk-gui/gui.stetic, MonoDevelop.Debugger.mdp, Makefile.am,
- MonoDevelop.Debugger/BreakpointPropertiesDialog.cs,
- MonoDevelop.Debugger/BreakpointPad.cs: Moved breakpoint properties
- dialog to MD.Ide.
- * MonoDevelop.Debugger/DebugTextMarker.cs: Track api changes.
-
-2008-08-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui, gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.Debugger.BreakpointPropertiesDialog.cs,
- gtk-gui/gui.stetic, MonoDevelop.Debugger.mdp, Makefile.am,
- MonoDevelop.Debugger/BreakpointPropertiesDialog.cs,
- MonoDevelop.Debugger/BreakpointPad.cs: Improved breakpoints pad.
- Implemented the breakpoint properties dialog.
-
-2008-08-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.addin.xml, MonoDevelop.Debugger.mdp,
- Makefile.am, MonoDevelop.Debugger/ThreadsPad.cs: Added threads pad.
- Based on the work by Alfonso Santos Luaces.
- * MonoDevelop.Debugger/BreakpointPad.cs: Properly unsubscribe debug
- service events.
-
-2008-08-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DisasemblyView.cs: Track api changes.
-
-2008-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ObjectValuePad.cs: Remove debug code.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger.mdp: Removed some parts of the documentation
- service.
-
-2008-07-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.addin.xml, MonoDevelop.Debugger.mdp,
- Makefile.am, MonoDevelop.Debugger/WatchPad.cs,
- MonoDevelop.Debugger/LocalsPad.cs,
- MonoDevelop.Debugger/BreakpointPad.cs,
- MonoDevelop.Debugger/ObjectValuePad.cs: Implemented LocalsPad.
- Moved all logic shared with the WatchPad to ObjectValuePad.
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Highlight values that
- have changed since the last time the debugger was stopped.
-
-2008-07-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.addin.xml, MonoDevelop.Debugger.mdp,
- Makefile.am, MonoDevelop.Debugger/BreakpointPad.cs: Initial
- implementation of the breakpoints pad by Alfonso Santos Luaces.
-
-2008-07-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/WatchPad.cs: Make sure the value tree is
- properly initialized the first time it is shown.
-
-2008-07-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am, MonoDevelop.Debugger.mdp: Fix automake build paths. Add
- System.Xml reference and don't local copy refs, for build within
- MD.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Remove ellupsizing.
- Doesn't work well with the debug tooltip.
-
-2008-07-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs,
- MonoDevelop.Debugger/WatchPad.cs: Store watch pad expressions into
- the user preferences when closing a solution.
-
-2008-07-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Make columns resizable.
-
-2008-07-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Show icons for Type and
- Namespace values.
-
-2008-07-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.mdp, Makefile.am,
- MonoDevelop.Debugger/WatchPad.cs,
- MonoDevelop.Debugger/ObjectValueTreeView.cs: Added support for code
- completion.
-
-2008-07-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/WatchPad.cs: Don't update the tree if there is
- no current frame, since it will reset the current expansion state.
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Added events which are
- fired when value editing starts/ends. Fixes some text escaping
- issues.
-
-2008-07-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/WatchPad.cs,
- MonoDevelop.Debugger/ObjectValueTreeView.cs: Show member icons in
- the watch pad. Support a new compact mode to be used in the debug
- tooltips.
-
-2008-07-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Debugger/DebugTextMarker.cs,
- MonoDevelop.Debugger/DisasemblyView.cs: debug markers are now using
- color styles instead of hard coded colors.
-
-2008-07-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger/DebugTextMarker.cs: Improved colors.
- * MonoDevelop.Debugger/ObjectValueTreeView.cs: Allow editing variable
- values.
- * MonoDevelop.Debugger/Initializer.cs: Implement ShowDisassembly
- command.
- * MonoDevelop.Debugger/DisasemblyView.cs: Implemented support for mixed
- assembler/source code view.
-
-2008-07-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.addin.xml: Fix add-in id.
-
-2008-07-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.mdp, Makefile.am,
- MonoDevelop.Debugger/DebugTextMarker.cs: Implemented markers for
- breakpoint and current execution line.
- * MonoDevelop.Debugger/DisasemblyView.cs: Use new current line marker.
-
-2008-06-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.addin.xml, MonoDevelop.Debugger.mdp,
- Makefile.am, MonoDevelop.Debugger/WatchPad.cs,
- MonoDevelop.Debugger/ObjectValueTreeView.cs,
- MonoDevelop.Debugger/Initializer.cs,
- MonoDevelop.Debugger/DisasemblyView.cs,
- MonoDevelop.Debugger/StackTracePad.cs: Improved call stack view.
- Implemented disassemble view.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.addin.xml: Bump MD version.
-
-2008-05-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.addin.xml, MonoDevelop.Debugger.mdp,
- Makefile.am, MonoDevelop.Debugger/WatchPad.cs,
- MonoDevelop.Debugger/ObjectValueTreeView.cs,
- MonoDevelop.Debugger/StackTracePad.cs: Implemented initial watch
- pad.
-
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs
index 604979ad5e..00fa8d0e8b 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/GenericPreviewVisualizer.cs
@@ -27,6 +27,7 @@ using System;
using MonoDevelop.Components;
using Mono.Debugging.Client;
using Gtk;
+using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.Debugger.PreviewVisualizers
{
@@ -42,23 +43,16 @@ namespace MonoDevelop.Debugger.PreviewVisualizers
public override Control GetVisualizerWidget (ObjectValue val)
{
string value = val.Value;
- Gdk.Color col = new Gdk.Color (85, 85, 85);
+ Gdk.Color col = Styles.PreviewVisualizerTextColor.ToGdkColor ();
if (!val.IsNull && (val.TypeName == "string" || val.TypeName == "char[]"))
value = '"' + GetString (val) + '"';
if (DebuggingService.HasInlineVisualizer (val))
value = DebuggingService.GetInlineVisualizer (val).InlineVisualize (val);
- var label = new Gtk.Label (value);
- var font = label.Style.FontDescription.Copy ();
-
- if (font.SizeIsAbsolute) {
- font.AbsoluteSize = font.Size - 1;
- } else {
- font.Size -= (int)(Pango.Scale.PangoScale);
- }
-
- label.ModifyFont (font);
+ var label = new Gtk.Label ();
+ label.Text = value;
+ label.ModifyFont (FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11));
label.ModifyFg (StateType.Normal, col);
label.SetPadding (4, 4);
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs
index a3bd79b733..5a2bb447e7 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.PreviewVisualizers/PreviewVisualizerWindow.cs
@@ -31,6 +31,7 @@ using Gdk;
using Gtk;
using MonoDevelop.Ide;
using MonoDevelop.Debugger.PreviewVisualizers;
+using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.Debugger
{
@@ -44,7 +45,7 @@ namespace MonoDevelop.Debugger
this.Modal = true;
TransientFor = (Gtk.Window) invokingWidget.Toplevel;
- Theme.SetFlatColor (new Cairo.Color (245 / 256.0, 245 / 256.0, 245 / 256.0));
+ Theme.SetBackgroundColor (Styles.PreviewVisualizerBackgroundColor.ToCairoColor ());
Theme.Padding = 3;
ShowArrow = true;
var mainBox = new VBox ();
@@ -64,8 +65,8 @@ namespace MonoDevelop.Debugger
headerTable.Attach (hb, 0, 1, 0, 1);
var headerTitle = new Label ();
- headerTitle.ModifyFg (StateType.Normal, new Color (36, 36, 36));
- var font = headerTitle.Style.FontDescription.Copy ();
+ headerTitle.ModifyFg (StateType.Normal, Styles.PreviewVisualizerHeaderTextColor.ToGdkColor ());
+ var font = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale12);
font.Weight = Pango.Weight.Bold;
headerTitle.ModifyFont (font);
headerTitle.Text = val.TypeName;
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests.TestApp/ChangeLog b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests.TestApp/ChangeLog
deleted file mode 100644
index a7cef8394d..0000000000
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests.TestApp/ChangeLog
+++ /dev/null
@@ -1,19 +0,0 @@
-2010-04-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Main.cs: Added new test suite for StackFrame. Reorganized a
- bit the namespaces. Added tests for bug #580994.
-
-2010-04-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * Main.cs: Add unit test for bug 595270: Flags enums in
- debugger show the zero value.
-
-2010-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Main.cs: Added boxing tests. Disable assignment tests for
- MDB only, they now work with SDB.
-
-2010-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.Tests.TestApp.csproj: Flush.
-
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests.TestApp/TestEvaluation.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests.TestApp/TestEvaluation.cs
index 13b590023a..d227d6dc48 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests.TestApp/TestEvaluation.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests.TestApp/TestEvaluation.cs
@@ -34,19 +34,56 @@ using System.Threading.Tasks;
namespace MonoDevelop.Debugger.Tests.TestApp
{
+ interface IFoo
+ {
+ int this[int index] { get; }
+ int Prop { get; }
+ }
+ interface IBar
+ {
+ int this[int index] { get; }
+ int Prop { get; }
+ }
+ class Bo
+ {
+ public int Prop { get { return 4; } }
+ }
+ class FooBar : Bo, IFoo, IBar
+ {
+ int IBar.Prop { get { return 1; } }
+ int IFoo.Prop { get { return 2; } }
+ public int Prop { get { return 3; } }
+
+ int IFoo.this[int index]
+ {
+ get
+ {
+ return index;
+ }
+ }
+
+ int IBar.this[int index]
+ {
+ get
+ {
+ return -index;
+ }
+ }
+ }
+
class TestEvaluationParent
{
public int TestMethodBase ()
{
float c = 4;
- return 1;
+ return 2;
}
protected string ProtectedStringProperty{ get; set; }
public virtual int TestMethodBase (string a)
{
- return int.Parse (a) + 1;
+ return int.Parse (a) + 2;
}
protected int TestMethodBase (int a)
@@ -188,11 +225,19 @@ namespace MonoDevelop.Debugger.Tests.TestApp
}
}
+ FooBar = new FooBar ();
+ Foo = new FooBar ();
+ Bar = new FooBar ();
+
var testEvaluationChild = new TestEvaluationChild ();
Console.WriteLine (n); /*break*/
}
+ public FooBar FooBar { get; set; }
+ public IBar Bar { get; set; }
+ public IFoo Foo { get; set; }
+
public string TestCastingArgument (myNint nint)
{
return nint.v.ToString ();
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/BreakpointsAndSteppingTests.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/BreakpointsAndSteppingTests.cs
index f6140c6ce9..a1d16e178a 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/BreakpointsAndSteppingTests.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/BreakpointsAndSteppingTests.cs
@@ -444,6 +444,12 @@ namespace MonoDevelop.Debugger.Tests
[Test]
public void DebuggerStepperBoundaryMethod2ProjectAssembliesOnly ()
{
+ IgnoreSoftDebugger ("Fix me");
+ //SDB Ignore: DebuggerStepperBoundary is stupid and pretty much uselss attribute anyway
+ //Problem that we have here is that DebuggerStepperBoundary is handled on IDE side
+ //and if method that has DebuggerStepperBoundary also has DebuggerNonUserCode IDE
+ //is never notified about entering such method since runtime handles DebuggerNonUserCode
+ //hence bug
InitializeTest ();
Session.Options.ProjectAssembliesOnly = true;
AddBreakpoint ("f3a22b38-596a-4463-a562-20b342fdec12");
@@ -874,6 +880,7 @@ namespace MonoDevelop.Debugger.Tests
public void CatchPointTest2 ()
{
IgnoreSoftDebugger ("I'm having problem testing this because. There is error nonstop happening in framework about CurrentCulture featching.");
+ IgnoreCorDebugger ("Randomly fails");
InitializeTest ();
AddCatchpoint ("System.Exception", true);
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/ChangeLog b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/ChangeLog
deleted file mode 100644
index 920c56f624..0000000000
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/ChangeLog
+++ /dev/null
@@ -1,44 +0,0 @@
-2010-04-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * StackFrameTests.cs:
- * MdbStackFrameTests.cs:
- * SdbEvaluationTests.cs:
- * SdbStackFrameTests.cs:
- * MdbEvaluationTests.cs:
- * MonoDevelop.Debugger.Tests.csproj: Added new test suite for
- StackFrame. Reorganized a bit the namespaces. Added tests
- for bug #580994.
-
-2010-04-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * EvaluationTests.cs: Make some tests work on windows.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.Tests.csproj: Merged MD.Projects into
- MD.Core, and MD.Projects.Gui, MD.Core.Gui and MD.Components
- into MD.Ide.
-
-2010-03-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * EvaluationTests.cs:
- * MdbEvaluationTests.cs: Fix tests. Formatting rules have
- changed.
-
-2010-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * DebugTests.cs:
- * EvaluationTests.cs:
- * MdbEvaluationTests.cs: Added boxing tests. Disable
- assignment tests for MDB only, they now work with SDB.
-
-2010-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.Tests.csproj: Flush.
-
- * DebugTests.cs: Added support for lazy loading of add-ins
-
-2009-12-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Debugger.Tests.csproj: Add missing file.
-
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/DebugTests.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/DebugTests.cs
index 6b2e752541..fafb2b96c6 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/DebugTests.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/DebugTests.cs
@@ -139,7 +139,7 @@ namespace MonoDevelop.Debugger.Tests
return;
}
- Console.WriteLine ("Target Runtime: " + runtime.DisplayRuntimeName + " " + runtime.Version);
+ Console.WriteLine ("Target Runtime: " + runtime.DisplayRuntimeName + " " + runtime.Version + " " + (IntPtr.Size == 8 ? "64bit" : "32bit"));
// main/build/tests
FilePath path = Path.GetDirectoryName (GetType ().Assembly.Location);
@@ -204,9 +204,16 @@ namespace MonoDevelop.Debugger.Tests
};
Session.TargetStopped += (sender, e) => {
- Frame = e.Backtrace.GetFrame (0);
- lastStoppedPosition = Frame.SourceLocation;
- targetStoppedEvent.Set ();
+ //This can be null in case of ForcedStop
+ //which is called when exception is thrown
+ //when Continue & Stepping is executed
+ if (e.Backtrace != null) {
+ Frame = e.Backtrace.GetFrame (0);
+ lastStoppedPosition = Frame.SourceLocation;
+ targetStoppedEvent.Set ();
+ } else {
+ Console.WriteLine ("e.Backtrace is null");
+ }
};
var targetExited = new ManualResetEvent (false);
@@ -215,6 +222,10 @@ namespace MonoDevelop.Debugger.Tests
};
Session.Run (dsi, ops);
+ Session.ExceptionHandler = (ex) => {
+ Console.WriteLine ("Session.ExceptionHandler:" + Environment.NewLine + ex.ToString ());
+ return true;
+ };
switch (WaitHandle.WaitAny (new WaitHandle[]{ done, targetExited }, 30000)) {
case 0:
//Breakpoint is hit good... run tests now
@@ -295,7 +306,7 @@ namespace MonoDevelop.Debugger.Tests
public bool CheckPosition (string guid, int offset = 0, string statement = null, bool silent = false)
{
- if (!targetStoppedEvent.WaitOne (3000)) {
+ if (!targetStoppedEvent.WaitOne (6000)) {
if (!silent)
Assert.Fail ("CheckPosition failure: Target stop timeout");
return false;
@@ -427,7 +438,7 @@ namespace MonoDevelop.Debugger.Tests
lock (locker) {
while (val.IsEvaluating) {
- if (!Monitor.Wait (locker, 4000))
+ if (!Monitor.Wait (locker, 8000))
throw new Exception ("Timeout while waiting for value evaluation");
}
}
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/EvaluationTests.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/EvaluationTests.cs
index 4f06ceae1d..5451a66b67 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/EvaluationTests.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/EvaluationTests.cs
@@ -78,6 +78,12 @@ namespace MonoDevelop.Debugger.Tests
return "MonoDevelop";
case "SomeEnum":
return "SomeEnum";
+ case "IFoo":
+ return "MonoDevelop.Debugger.Tests.TestApp.IFoo";
+ case "IBar":
+ return "MonoDevelop.Debugger.Tests.TestApp.IBar";
+ case "Bo":
+ return "MonoDevelop.Debugger.Tests.TestApp.Bo";
}
return null;
}
@@ -488,23 +494,34 @@ namespace MonoDevelop.Debugger.Tests
val = val.Sync ();
}
Assert.AreEqual ("\"AbstractImplementation\"", val.Value);
+ Assert.AreEqual ("string", val.TypeName);
+
+ IgnoreCorDebugger("TODO: CorDebugger support explicit interfaces");
+
+ val = Eval ("((IInterfaceWithMethodA)objWithMethodA).MethodA()");
+ if (!AllowTargetInvokes) {
+ var options = Session.Options.EvaluationOptions.Clone ();
+ options.AllowTargetInvoke = true;
+
+ Assert.IsTrue (val.IsNotSupported);
+ val.Refresh (options);
+ val = val.Sync ();
+ }
+ Assert.AreEqual ("\"InterfaceImplementation\"", val.Value);
Assert.AreEqual ("string", val.TypeName);
- // FIXME: failing on CorDebugger
- if (Session is SoftDebuggerSession) {
- val = Eval ("true.ToString()");
- if (!AllowTargetInvokes) {
- var options = Session.Options.EvaluationOptions.Clone ();
- options.AllowTargetInvoke = true;
-
- Assert.IsTrue (val.IsNotSupported);
- val.Refresh (options);
- val = val.Sync ();
- }
+ val = Eval ("true.ToString()");
+ if (!AllowTargetInvokes) {
+ var options = Session.Options.EvaluationOptions.Clone ();
+ options.AllowTargetInvoke = true;
- Assert.AreEqual ("\"True\"", val.Value);
- Assert.AreEqual ("string", val.TypeName);
+ Assert.IsTrue (val.IsNotSupported);
+ val.Refresh (options);
+ val = val.Sync ();
}
+
+ Assert.AreEqual ("\"True\"", val.Value);
+ Assert.AreEqual ("string", val.TypeName);
}
[Test]
@@ -596,15 +613,15 @@ namespace MonoDevelop.Debugger.Tests
ObjectValue val = Eval ("numbers[0]");
Assert.AreEqual ("\"one\"", val.Value);
Assert.AreEqual ("string", val.TypeName);
-
+
val = Eval ("numbers[1]");
Assert.AreEqual ("\"two\"", val.Value);
Assert.AreEqual ("string", val.TypeName);
-
+
val = Eval ("numbers[2]");
Assert.AreEqual ("\"three\"", val.Value);
Assert.AreEqual ("string", val.TypeName);
-
+
val = Eval ("staticString[2]");
if (!AllowTargetInvokes) {
var options = Session.Options.EvaluationOptions.Clone ();
@@ -616,7 +633,7 @@ namespace MonoDevelop.Debugger.Tests
}
Assert.AreEqual ("'m'", val.Value);
Assert.AreEqual ("char", val.TypeName);
-
+
val = Eval ("alist[0]");
if (!AllowTargetInvokes) {
var options = Session.Options.EvaluationOptions.Clone ();
@@ -628,7 +645,7 @@ namespace MonoDevelop.Debugger.Tests
}
Assert.AreEqual ("1", val.Value);
Assert.AreEqual ("int", val.TypeName);
-
+
val = Eval ("alist[1]");
if (!AllowTargetInvokes) {
var options = Session.Options.EvaluationOptions.Clone ();
@@ -640,7 +657,7 @@ namespace MonoDevelop.Debugger.Tests
}
Assert.AreEqual ("\"two\"", val.Value);
Assert.AreEqual ("string", val.TypeName);
-
+
val = Eval ("alist[2]");
if (!AllowTargetInvokes) {
var options = Session.Options.EvaluationOptions.Clone ();
@@ -652,6 +669,57 @@ namespace MonoDevelop.Debugger.Tests
}
Assert.AreEqual ("3", val.Value);
Assert.AreEqual ("int", val.TypeName);
+
+ IgnoreCorDebugger("TODO: CorDebugger support explicit interfaces");
+
+ val = Eval ("FooBar[2]");
+ Assert.IsTrue (val.IsUnknown);
+ //We have IFoo and IBar implementation but without typecasting and determening which implementation user wants
+ //we have to return error/Unknown instead of random implementation(FooBar[2] is not compilable anyway)
+ val = Eval ("((IFoo)FooBar)[2]");
+ if (!AllowTargetInvokes) {
+ var options = Session.Options.EvaluationOptions.Clone ();
+ options.AllowTargetInvoke = true;
+
+ Assert.IsTrue (val.IsNotSupported);
+ val.Refresh (options);
+ val = val.Sync ();
+ }
+ Assert.AreEqual ("int", val.TypeName);
+ Assert.AreEqual ("2", val.Value);
+ val = Eval ("((IBar)FooBar)[2]");
+ if (!AllowTargetInvokes) {
+ var options = Session.Options.EvaluationOptions.Clone ();
+ options.AllowTargetInvoke = true;
+
+ Assert.IsTrue (val.IsNotSupported);
+ val.Refresh (options);
+ val = val.Sync ();
+ }
+ Assert.AreEqual ("int", val.TypeName);
+ Assert.AreEqual ("-2", val.Value);
+ val = Eval ("Bar[3]");
+ if (!AllowTargetInvokes) {
+ var options = Session.Options.EvaluationOptions.Clone ();
+ options.AllowTargetInvoke = true;
+
+ Assert.IsTrue (val.IsNotSupported);
+ val.Refresh (options);
+ val = val.Sync ();
+ }
+ Assert.AreEqual ("int", val.TypeName);
+ Assert.AreEqual ("-3", val.Value);
+ val = Eval ("Foo[3]");
+ if (!AllowTargetInvokes) {
+ var options = Session.Options.EvaluationOptions.Clone ();
+ options.AllowTargetInvoke = true;
+
+ Assert.IsTrue (val.IsNotSupported);
+ val.Refresh (options);
+ val = val.Sync ();
+ }
+ Assert.AreEqual ("int", val.TypeName);
+ Assert.AreEqual ("3", val.Value);
}
void CheckValue (string expected, string actual, bool isSimpleProperty)
@@ -874,7 +942,73 @@ namespace MonoDevelop.Debugger.Tests
val = val.Sync ();
}
Assert.AreEqual ("3", val.Value);
+ Assert.AreEqual ("int", val.TypeName);
+
+ IgnoreCorDebugger("TODO: CorDebugger support explicit interfaces");
+
+ val = Eval ("Bar.Prop");
+ if (!AllowTargetInvokes) {
+ var options = Session.Options.EvaluationOptions.Clone ();
+ options.AllowTargetInvoke = true;
+
+ Assert.IsTrue (val.IsNotSupported);
+ val.Refresh (options);
+ val = val.Sync ();
+ }
+ Assert.AreEqual ("int", val.TypeName);
+ Assert.AreEqual ("1", val.Value);
+ val = Eval ("Foo.Prop");
+ if (!AllowTargetInvokes) {
+ var options = Session.Options.EvaluationOptions.Clone ();
+ options.AllowTargetInvoke = true;
+
+ Assert.IsTrue (val.IsNotSupported);
+ val.Refresh (options);
+ val = val.Sync ();
+ }
+ Assert.AreEqual ("int", val.TypeName);
+ Assert.AreEqual ("2", val.Value);
+ val = Eval ("FooBar.Prop");
Assert.AreEqual ("int", val.TypeName);
+ Assert.AreEqual ("3", val.Value);
+ val = Eval ("((Bo)FooBar).Prop");
+ Assert.AreEqual ("int", val.TypeName);
+ Assert.AreEqual ("4", val.Value);
+ val = Eval ("FooBar");
+ richChildren = val.GetAllChildrenSync ();
+ Assert.AreEqual ("Prop (MonoDevelop.Debugger.Tests.TestApp.FooBar)", richChildren [0].Name);
+ Assert.AreEqual ("int", richChildren [0].TypeName);
+ Assert.AreEqual ("3", richChildren [0].Value);
+ Assert.AreEqual ("Prop (MonoDevelop.Debugger.Tests.TestApp.Bo)", richChildren [1].Name);
+ Assert.AreEqual ("int", richChildren [1].TypeName);
+ Assert.AreEqual ("4", richChildren [1].Value);
+ if (!AllowTargetInvokes) {
+ var options = Session.Options.EvaluationOptions.Clone ();
+ options.AllowTargetInvoke = true;
+
+ Assert.IsTrue (richChildren [2].IsNotSupported);
+ richChildren [2].Refresh (options);
+ richChildren [2] = richChildren [2].Sync ();
+ Assert.IsTrue (richChildren [3].IsNotSupported);
+ richChildren [3].Refresh (options);
+ richChildren [3] = richChildren [3].Sync ();
+ }
+ //TODO: Include interface names into sorting
+ if ("Prop (MonoDevelop.Debugger.Tests.TestApp.IFoo)" == richChildren [2].Name) {
+ Assert.AreEqual ("Prop (MonoDevelop.Debugger.Tests.TestApp.IFoo)", richChildren [2].Name);
+ Assert.AreEqual ("int", richChildren [2].TypeName);
+ Assert.AreEqual ("2", richChildren [2].Value);
+ Assert.AreEqual ("Prop (MonoDevelop.Debugger.Tests.TestApp.IBar)", richChildren [3].Name);
+ Assert.AreEqual ("int", richChildren [3].TypeName);
+ Assert.AreEqual ("1", richChildren [3].Value);
+ } else {
+ Assert.AreEqual ("Prop (MonoDevelop.Debugger.Tests.TestApp.IFoo)", richChildren [3].Name);
+ Assert.AreEqual ("int", richChildren [3].TypeName);
+ Assert.AreEqual ("2", richChildren [3].Value);
+ Assert.AreEqual ("Prop (MonoDevelop.Debugger.Tests.TestApp.IBar)", richChildren [2].Name);
+ Assert.AreEqual ("int", richChildren [2].TypeName);
+ Assert.AreEqual ("1", richChildren [2].Value);
+ }
}
[Test]
@@ -1520,7 +1654,7 @@ namespace MonoDevelop.Debugger.Tests
public void FormatArray ()
{
ObjectValue val;
-
+
val = Eval ("numbers");
Assert.AreEqual ("{string[3]}", val.Value);
Assert.AreEqual ("string[]", val.TypeName);
@@ -1529,19 +1663,22 @@ namespace MonoDevelop.Debugger.Tests
Assert.AreEqual ("{int[2][]}", val.Value);
Assert.AreEqual ("int[][]", val.TypeName);
+ IgnoreCorDebugger ("Randomly fails");
+
+ val = Eval ("arrayWithLowerBounds");
+ Assert.AreEqual ("int[,,]", val.TypeName);
+ Assert.AreEqual ("{int[3,4,5]}", val.Value);
+
val = Eval ("numbersMulti");
Assert.AreEqual ("{int[3,4,5]}", val.Value);
Assert.AreEqual ("int[,,]", val.TypeName);
Assert.IsFalse (val.IsNull);
+ IgnoreSoftDebugger ("Randomly fails, tracked as Bug 36712");
val = Eval ("nulledByteArray");
Assert.AreEqual ("(null)", val.Value);
Assert.AreEqual ("byte[]", val.TypeName);
Assert.IsTrue (val.IsNull);
-
- val = Eval ("arrayWithLowerBounds");
- Assert.AreEqual ("int[,,]", val.TypeName);
- Assert.AreEqual ("{int[3,4,5]}", val.Value);
}
[Test]
@@ -1654,21 +1791,6 @@ namespace MonoDevelop.Debugger.Tests
{
ObjectValue val;
- //When fixed put into Inheriting test
- val = Eval ("b.TestMethod ()");
- Assert.AreEqual ("2", val.Value);
- Assert.AreEqual ("int", val.TypeName);
-
- //When fixed put into Inheriting test
- val = Eval ("b.TestMethod (42)");
- Assert.AreEqual ("44", val.Value);
- Assert.AreEqual ("int", val.TypeName);
-
- //When fixed put into Inheriting test
- val = Eval ("base.TestMethodBase ()");
- Assert.AreEqual ("2", val.Value);
- Assert.AreEqual ("int", val.TypeName);
-
val = Eval ("base.TestMethodBase (\"23\")");
Assert.AreEqual ("25", val.Value);
Assert.AreEqual ("int", val.TypeName);
@@ -1677,10 +1799,6 @@ namespace MonoDevelop.Debugger.Tests
Assert.AreEqual ("44", val.Value);
Assert.AreEqual ("int", val.TypeName);
- val = Eval ("base.TestMethodBaseNotOverrided ()");
- Assert.AreEqual ("1", val.Value);
- Assert.AreEqual ("int", val.TypeName);
-
//When fixed put into TypeReferenceGeneric
val = Eval ("Dictionary<string,NestedClass>");
Assert.AreEqual ("System.Collections.Generic.Dictionary<string,MonoDevelop.Debugger.Tests.TestApp.TestEvaluation.NestedClass>", val.Value);
@@ -1693,18 +1811,6 @@ namespace MonoDevelop.Debugger.Tests
Assert.AreEqual ("<type>", val.TypeName);
Assert.AreEqual (ObjectValueFlags.Type, val.Flags & ObjectValueFlags.OriginMask);
- //When fixed put into MethodInvoke(failing also on CorDebugger)
- val = Eval ("((IInterfaceWithMethodA)objWithMethodA).MethodA()");
- if (!AllowTargetInvokes) {
- var options = Session.Options.EvaluationOptions.Clone ();
- options.AllowTargetInvoke = true;
-
- Assert.IsTrue (val.IsNotSupported);
- val.Refresh (options);
- val = val.Sync ();
- }
- Assert.AreEqual ("\"InterfaceImplementation\"", val.Value);
- Assert.AreEqual ("string", val.TypeName);
}
[Test]
@@ -1855,6 +1961,9 @@ namespace MonoDevelop.Debugger.Tests
Assert.AreEqual ("43", val.Value);
Assert.AreEqual ("int", val.TypeName);
+ if (soft != null && soft.ProtocolVersion < new Version (2, 40))
+ Assert.Ignore ("A newer version of the Mono runtime is required.");
+
val = Eval ("b.Prop");
if (!AllowTargetInvokes) {
var options = Session.Options.EvaluationOptions.Clone ();
@@ -1867,7 +1976,7 @@ namespace MonoDevelop.Debugger.Tests
Assert.AreEqual ("2", val.Value);
Assert.AreEqual ("int", val.TypeName);
- val = Eval ("b.PropNoVirt1");
+ val = Eval ("((B)b).PropNoVirt1");
if (!AllowTargetInvokes && soft == null) {
var options = Session.Options.EvaluationOptions.Clone ();
options.AllowTargetInvoke = true;
@@ -1879,7 +1988,7 @@ namespace MonoDevelop.Debugger.Tests
Assert.AreEqual ("2", val.Value);
Assert.AreEqual ("int", val.TypeName);
- val = Eval ("b.PropNoVirt2");
+ val = Eval ("((B)b).PropNoVirt2");
if (!AllowTargetInvokes && soft == null) {
var options = Session.Options.EvaluationOptions.Clone ();
options.AllowTargetInvoke = true;
@@ -1891,7 +2000,7 @@ namespace MonoDevelop.Debugger.Tests
Assert.AreEqual ("2", val.Value);
Assert.AreEqual ("int", val.TypeName);
- val = Eval ("b.IntField");
+ val = Eval ("((B)b).IntField");
Assert.AreEqual ("2", val.Value);
Assert.AreEqual ("int", val.TypeName);
@@ -1991,9 +2100,6 @@ namespace MonoDevelop.Debugger.Tests
Assert.AreEqual ("1", val.Value);
Assert.AreEqual ("int", val.TypeName);
- if (soft != null && soft.ProtocolVersion < new Version (2, 40))
- Assert.Ignore ("A newer version of the Mono runtime is required.");
-
val = Eval ("b.TestMethod (\"23\")");
if (!AllowTargetInvokes) {
var options = Session.Options.EvaluationOptions.Clone ();
@@ -2006,25 +2112,102 @@ namespace MonoDevelop.Debugger.Tests
Assert.AreEqual ("25", val.Value);
Assert.AreEqual ("int", val.TypeName);
- if (Session is SoftDebuggerSession) {
- val = Eval ("System.Text.Encoding.UTF8.GetPreamble ()");
- if (!AllowTargetInvokes) {
- var options = Session.Options.EvaluationOptions.Clone ();
- options.AllowTargetInvoke = true;
-
- Assert.IsTrue (val.IsNotSupported);
- val.Refresh (options);
- val = val.Sync ();
- }
- Assert.AreEqual ("byte[]", val.TypeName);
- Assert.AreEqual ("{byte[3]}", val.Value);
- var bytes = ((RawValueArray)val.GetRawValue ()).ToArray ();
- Assert.AreEqual (239, bytes.GetValue (0));
- Assert.AreEqual (187, bytes.GetValue (1));
- Assert.AreEqual (191, bytes.GetValue (2));
- } else {
- Assert.Ignore ("Not working on CorDebugger");
+ val = Eval ("base.TestMethodBaseNotOverrided ()");
+ if (!AllowTargetInvokes) {
+ var options = Session.Options.EvaluationOptions.Clone ();
+ options.AllowTargetInvoke = true;
+
+ Assert.IsTrue (val.IsNotSupported);
+ val.Refresh (options);
+ val = val.Sync ();
+ }
+ Assert.AreEqual ("1", val.Value);
+ Assert.AreEqual ("int", val.TypeName);
+
+ val = Eval("base.TestMethodBase ()");
+ if (!AllowTargetInvokes)
+ {
+ var options = Session.Options.EvaluationOptions.Clone();
+ options.AllowTargetInvoke = true;
+
+ Assert.IsTrue(val.IsNotSupported);
+ val.Refresh(options);
+ val = val.Sync();
}
+ Assert.AreEqual("2", val.Value);
+ Assert.AreEqual("int", val.TypeName);
+
+ IgnoreCorDebugger("Not working on CorDebugger");
+
+ val = Eval("b.PropNoVirt2");
+ if (!AllowTargetInvokes)
+ {
+ var options = Session.Options.EvaluationOptions.Clone();
+ options.AllowTargetInvoke = true;
+
+ Assert.IsTrue(val.IsNotSupported);
+ val.Refresh(options);
+ val = val.Sync();
+ }
+ Assert.AreEqual("1", val.Value);
+ Assert.AreEqual("int", val.TypeName);
+
+ val = Eval("b.IntField");
+ Assert.AreEqual("1", val.Value);
+ Assert.AreEqual("int", val.TypeName);
+
+ val = Eval("b.PropNoVirt1");
+ if (!AllowTargetInvokes && soft == null)
+ {
+ var options = Session.Options.EvaluationOptions.Clone();
+ options.AllowTargetInvoke = true;
+
+ Assert.IsTrue(val.IsNotSupported);
+ val.Refresh(options);
+ val = val.Sync();
+ }
+ Assert.AreEqual("1", val.Value);
+ Assert.AreEqual("int", val.TypeName);
+
+ val = Eval ("System.Text.Encoding.UTF8.GetPreamble ()");
+ if (!AllowTargetInvokes) {
+ var options = Session.Options.EvaluationOptions.Clone ();
+ options.AllowTargetInvoke = true;
+
+ Assert.IsTrue (val.IsNotSupported);
+ val.Refresh (options);
+ val = val.Sync ();
+ }
+ Assert.AreEqual ("byte[]", val.TypeName);
+ Assert.AreEqual ("{byte[3]}", val.Value);
+ var bytes = ((RawValueArray)val.GetRawValue ()).ToArray ();
+ Assert.AreEqual (239, bytes.GetValue (0));
+ Assert.AreEqual (187, bytes.GetValue (1));
+ Assert.AreEqual (191, bytes.GetValue (2));
+
+ val = Eval ("b.TestMethod ()");
+ if (!AllowTargetInvokes) {
+ var options = Session.Options.EvaluationOptions.Clone ();
+ options.AllowTargetInvoke = true;
+
+ Assert.IsTrue (val.IsNotSupported);
+ val.Refresh (options);
+ val = val.Sync ();
+ }
+ Assert.AreEqual ("1", val.Value);
+ Assert.AreEqual ("int", val.TypeName);
+
+ val = Eval ("b.TestMethod (42)");
+ if (!AllowTargetInvokes) {
+ var options = Session.Options.EvaluationOptions.Clone ();
+ options.AllowTargetInvoke = true;
+
+ Assert.IsTrue (val.IsNotSupported);
+ val.Refresh (options);
+ val = val.Sync ();
+ }
+ Assert.AreEqual ("43", val.Value);
+ Assert.AreEqual ("int", val.TypeName);
}
[Test]
@@ -2060,14 +2243,11 @@ namespace MonoDevelop.Debugger.Tests
Assert.AreEqual ("\"b\"", children [1].Value);
} else {
// when AllowTargetInvokes is disabled, it also disables debugger proxies
- Assert.AreEqual (7, children.Length);
+ Assert.AreEqual (18, children.Length);
Assert.AreEqual ("Comparer", children [0].Name);
- Assert.AreEqual ("Count", children [1].Name);
- Assert.AreEqual ("Keys", children [2].Name);
- Assert.AreEqual ("Values", children [3].Name);
- Assert.AreEqual ("Static members", children [4].Name);
- Assert.AreEqual ("Non-public members", children [5].Name);
- Assert.AreEqual ("IEnumerator", children [6].Name);
+ Assert.AreEqual ("Static members", children [15].Name);
+ Assert.AreEqual ("Non-public members", children [16].Name);
+ Assert.AreEqual ("IEnumerator", children [17].Name);
}
val = Eval ("stringList");
@@ -2085,12 +2265,11 @@ namespace MonoDevelop.Debugger.Tests
Assert.AreEqual ("\"ccc\"", children [2].Value);
} else {
// when AllowTargetInvokes is disabled, it also disables debugger proxies
- Assert.AreEqual (5, children.Length);
+ Assert.AreEqual (10, children.Length);
Assert.AreEqual ("Capacity", children [0].Name);
- Assert.AreEqual ("Count", children [1].Name);
- Assert.AreEqual ("Static members", children [2].Name);
- Assert.AreEqual ("Non-public members", children [3].Name);
- Assert.AreEqual ("IEnumerator", children [4].Name);
+ Assert.AreEqual ("Static members", children [7].Name);
+ Assert.AreEqual ("Non-public members", children [8].Name);
+ Assert.AreEqual ("IEnumerator", children [9].Name);
}
val = Eval ("alist");
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/MonoDevelop.Debugger.Tests.csproj b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/MonoDevelop.Debugger.Tests.csproj
index 25bf813d8d..b1212633d0 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/MonoDevelop.Debugger.Tests.csproj
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/MonoDevelop.Debugger.Tests.csproj
@@ -60,11 +60,6 @@
<Name>MonoDevelop.Core</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
- <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
- <Name>Mono.TextEditor</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\..\..\core\MonoDevelop.Ide\MonoDevelop.Ide.csproj">
<Project>{27096E7F-C91C-4AC6-B289-6897A701DF21}</Project>
<Name>MonoDevelop.Ide</Name>
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.addin.xml b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.addin.xml
index 78c001deee..806bbfd00f 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.addin.xml
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.addin.xml
@@ -30,12 +30,12 @@
</ExtensionPoint>
<Extension path = "/MonoDevelop/Ide/Pads">
<Category id="Debug" _name="Debug Windows">
- <Pad id = "MonoDevelop.Debugger.WatchPad" defaultLayout="Debug" defaultPlacement = "Bottom" icon="md-view-debug-watch" class = "MonoDevelop.Debugger.WatchPad" _label="Watch" />
- <Pad id = "MonoDevelop.Debugger.LocalsPad" defaultLayout="Debug" defaultPlacement = "Bottom" icon="md-view-debug-locals" class = "MonoDevelop.Debugger.LocalsPad" _label="Locals" />
<Pad id = "MonoDevelop.Debugger.BreakpointPad" defaultLayout="Debug" defaultPlacement = "Bottom" icon="md-view-debug-breakpoints" class = "MonoDevelop.Debugger.BreakpointPad" _label="Breakpoints" />
- <Pad id = "MonoDevelop.Debugger.ThreadsPad" defaultLayout="Debug" defaultPlacement = "Bottom" icon="md-view-debug-threads" class = "MonoDevelop.Debugger.ThreadsPad" _label="Threads" />
- <Pad id = "MonoDevelop.Debugger.StackTracePad" defaultLayout="Debug" defaultPlacement = "MonoDevelop.Debugger.WatchPad/Right Bottom" icon="md-view-debug-call-stack" class = "MonoDevelop.Debugger.StackTracePad" _label="Call Stack" />
+ <Pad id = "MonoDevelop.Debugger.LocalsPad" defaultLayout="Debug" defaultPlacement = "Bottom" icon="md-view-debug-locals" class = "MonoDevelop.Debugger.LocalsPad" _label="Locals" />
+ <Pad id = "MonoDevelop.Debugger.WatchPad" defaultLayout="Debug" defaultPlacement = "Bottom" icon="md-view-debug-watch" class = "MonoDevelop.Debugger.WatchPad" _label="Watch" />
<Pad id = "MonoDevelop.Debugger.ImmediatePad" defaultLayout="Debug" defaultPlacement = "MonoDevelop.Debugger.StackTracePad/Center Bottom" icon="md-view-debug-immediate" class = "MonoDevelop.Debugger.ImmediatePad" _label="Immediate" />
+ <Pad id = "MonoDevelop.Debugger.StackTracePad" defaultLayout="Debug" defaultPlacement = "MonoDevelop.Debugger.WatchPad/Right Bottom" icon="md-view-debug-call-stack" class = "MonoDevelop.Debugger.StackTracePad" _label="Call Stack" />
+ <Pad id = "MonoDevelop.Debugger.ThreadsPad" defaultLayout="Debug" defaultPlacement = "Bottom" icon="md-view-debug-threads" class = "MonoDevelop.Debugger.ThreadsPad" _label="Threads" />
</Category>
</Extension>
@@ -56,14 +56,14 @@
<Extension path = "/MonoDevelop/Ide/Commands/Project">
<Command id = "MonoDevelop.Debugger.DebugCommands.Debug"
defaultHandler = "MonoDevelop.Debugger.DebugHandler"
- icon = "md-execute-debug"
+ icon = "md-bug"
shortcut = "F5"
macShortcut = "Meta|Return"
_description = "Start debugging"
_label = "Start _Debugging" />
<Command id = "MonoDevelop.Debugger.DebugCommands.DebugEntry"
defaultHandler = "MonoDevelop.Debugger.DebugEntryHandler"
- icon = "md-execute-debug"
+ icon = "md-bug"
_description = "Debug current project"
_label = "Start D_ebugging Item" />
</Extension>
@@ -124,7 +124,7 @@
<Command id = "MonoDevelop.Debugger.DebugCommands.NewCatchpoint"
defaultHandler = "MonoDevelop.Debugger.NewCatchpointHandler"
_label = "New Exception Catchpoint"
- icon = "md-breakpoint-new" />
+ icon = "md-catchpoint-new" />
<Command id = "MonoDevelop.Debugger.DebugCommands.ShowBreakpoints"
defaultHandler = "MonoDevelop.Debugger.ShowBreakpointsHandler"
_label = "View Breakpoints"
@@ -164,6 +164,7 @@
defaultHandler = "MonoDevelop.Debugger.ExpressionEvaluatorCommand" />
<Command id = "MonoDevelop.Debugger.DebugCommands.ShowCurrentExecutionLine"
_label = "Show Current Execution Line"
+ icon = "md-go-to-line"
shortcut = "Alt|*"
defaultHandler = "MonoDevelop.Debugger.ShowCurrentExecutionLineCommand" />
<Command id = "MonoDevelop.Debugger.DebugCommands.AddWatch"
@@ -230,15 +231,12 @@
</Extension>
<Extension path = "/MonoDevelop/Core/StockIcons">
- <StockIcon stockid = "md-execute-debug" icon = "gtk-execute|res:debug-overlay-16.png" size = "Menu"/>
- <StockIcon stockid = "md-execute-debug" icon = "gtk-execute|res:debug-overlay-22.png" size = "SmallToolbar"/>
- <StockIcon stockid = "md-execute-debug" icon = "gtk-execute|res:debug-overlay-24.png" size = "LargeToolbar"/>
<StockIcon stockid = "md-continue-debug" resource = "continue-16.png" size = "Menu"/>
<StockIcon stockid = "md-pause-debug" resource = "pause-16.png" size = "Menu"/>
<StockIcon stockid = "md-step-into-debug" resource = "step-in-16.png" size = "Menu"/>
<StockIcon stockid = "md-step-out-debug" resource = "step-out-16.png" size = "Menu"/>
<StockIcon stockid = "md-step-over-debug" resource = "step-over-16.png" size = "Menu"/>
- <StockIcon stockid = "md-view-debug-breakpoints" resource = "breakpoint-16.png" size="Menu" />
+ <StockIcon stockid = "md-view-debug-breakpoints" resource = "pad-breakpoints-16.png" size="Menu" />
<StockIcon stockid = "md-view-debug-call-stack" resource = "pad-call-stack-16.png" size="Menu" />
<StockIcon stockid = "md-view-debug-locals" resource = "pad-locals-16.png" size="Menu" />
<StockIcon stockid = "md-view-debug-threads" resource = "pad-threads-16.png" size="Menu" />
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj
index b90a0b4dd1..3bece5c534 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj
@@ -91,6 +91,26 @@
<Reference Include="System.Core" />
<Reference Include="Mono.Cairo" />
<Reference Include="System.Drawing" />
+ <Reference Include="System.Reflection.Metadata">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Reflection.Metadata.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Collections.Immutable">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Collections.Immutable.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.Workspaces">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.Workspaces.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.CSharp">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
@@ -103,11 +123,6 @@
<Name>MonoDevelop.Ide</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
- <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
- <Name>Mono.TextEditor</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
<Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
<Name>ICSharpCode.NRefactory</Name>
@@ -136,7 +151,6 @@
<Compile Include="MonoDevelop.Debugger\WatchPad.cs" />
<Compile Include="MonoDevelop.Debugger\Initializer.cs" />
<Compile Include="MonoDevelop.Debugger\DisassemblyView.cs" />
- <Compile Include="MonoDevelop.Debugger\DebugTextMarker.cs" />
<Compile Include="MonoDevelop.Debugger\BreakpointPad.cs" />
<Compile Include="MonoDevelop.Debugger\LocalsPad.cs" />
<Compile Include="MonoDevelop.Debugger\ObjectValuePad.cs" />
@@ -186,6 +200,7 @@
<Compile Include="MonoDevelop.Debugger\SourceCodeLookup.cs" />
<Compile Include="gtk-gui\MonoDevelop.Debugger.DebugApplicationDialog.cs" />
<Compile Include="MonoDevelop.Debugger\DebugApplicationDialog.cs" />
+ <Compile Include="MonoDevelop.Debugger\Styles.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="MonoDevelop.Debugger.addin.xml">
@@ -194,35 +209,53 @@
<EmbeddedResource Include="gtk-gui\gui.stetic">
<LogicalName>gui.stetic</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\debug-overlay-16.png">
- <LogicalName>debug-overlay-16.png</LogicalName>
+ <EmbeddedResource Include="icons\breakpoint-16.png">
+ <LogicalName>breakpoint-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-16%402x.png">
+ <LogicalName>breakpoint-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\debug-overlay-16%402x.png">
- <LogicalName>debug-overlay-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\breakpoint-16~dark.png">
+ <LogicalName>breakpoint-16~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\debug-overlay-22.png">
- <LogicalName>debug-overlay-22.png</LogicalName>
+ <EmbeddedResource Include="icons\breakpoint-16~dark%402x.png">
+ <LogicalName>breakpoint-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\debug-overlay-22%402x.png">
- <LogicalName>debug-overlay-22@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\breakpoint-16~disabled.png">
+ <LogicalName>breakpoint-16~disabled.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\debug-overlay-24.png">
- <LogicalName>debug-overlay-24.png</LogicalName>
+ <EmbeddedResource Include="icons\breakpoint-16~disabled%402x.png">
+ <LogicalName>breakpoint-16~disabled@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\debug-overlay-24%402x.png">
- <LogicalName>debug-overlay-24@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\breakpoint-16~dark~disabled.png">
+ <LogicalName>breakpoint-16~dark~disabled.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\debug-overlay-32.png">
- <LogicalName>debug-overlay-32.png</LogicalName>
+ <EmbeddedResource Include="icons\breakpoint-16~dark~disabled%402x.png">
+ <LogicalName>breakpoint-16~dark~disabled@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\debug-overlay-32%402x.png">
- <LogicalName>debug-overlay-32@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\pad-breakpoints-16.png">
+ <LogicalName>pad-breakpoints-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\breakpoint-16.png">
- <LogicalName>breakpoint-16.png</LogicalName>
+ <EmbeddedResource Include="icons\pad-breakpoints-16%402x.png">
+ <LogicalName>pad-breakpoints-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\breakpoint-16%402x.png">
- <LogicalName>breakpoint-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\pad-breakpoints-16~dark.png">
+ <LogicalName>pad-breakpoints-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-breakpoints-16~dark%402x.png">
+ <LogicalName>pad-breakpoints-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-breakpoints-16~sel.png">
+ <LogicalName>pad-breakpoints-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-breakpoints-16~sel%402x.png">
+ <LogicalName>pad-breakpoints-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-breakpoints-16~dark~sel.png">
+ <LogicalName>pad-breakpoints-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-breakpoints-16~dark~sel%402x.png">
+ <LogicalName>pad-breakpoints-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\pad-call-stack-16.png">
<LogicalName>pad-call-stack-16.png</LogicalName>
@@ -230,84 +263,246 @@
<EmbeddedResource Include="icons\pad-call-stack-16%402x.png">
<LogicalName>pad-call-stack-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-call-stack-16~dark.png">
+ <LogicalName>pad-call-stack-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-call-stack-16~dark%402x.png">
+ <LogicalName>pad-call-stack-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-call-stack-16~sel.png">
+ <LogicalName>pad-call-stack-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-call-stack-16~sel%402x.png">
+ <LogicalName>pad-call-stack-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-call-stack-16~dark~sel.png">
+ <LogicalName>pad-call-stack-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-call-stack-16~dark~sel%402x.png">
+ <LogicalName>pad-call-stack-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\pad-locals-16.png">
<LogicalName>pad-locals-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\pad-locals-16%402x.png">
<LogicalName>pad-locals-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-locals-16~dark.png">
+ <LogicalName>pad-locals-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-locals-16~dark%402x.png">
+ <LogicalName>pad-locals-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-locals-16~sel.png">
+ <LogicalName>pad-locals-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-locals-16~sel%402x.png">
+ <LogicalName>pad-locals-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-locals-16~dark~sel.png">
+ <LogicalName>pad-locals-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-locals-16~dark~sel%402x.png">
+ <LogicalName>pad-locals-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\pad-threads-16.png">
<LogicalName>pad-threads-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\pad-threads-16%402x.png">
<LogicalName>pad-threads-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-threads-16~dark.png">
+ <LogicalName>pad-threads-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-threads-16~dark%402x.png">
+ <LogicalName>pad-threads-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-threads-16~sel.png">
+ <LogicalName>pad-threads-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-threads-16~sel%402x.png">
+ <LogicalName>pad-threads-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-threads-16~dark~sel.png">
+ <LogicalName>pad-threads-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-threads-16~dark~sel%402x.png">
+ <LogicalName>pad-threads-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\pad-watch-16.png">
<LogicalName>pad-watch-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\pad-watch-16%402x.png">
<LogicalName>pad-watch-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-watch-16~dark.png">
+ <LogicalName>pad-watch-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-watch-16~dark%402x.png">
+ <LogicalName>pad-watch-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-watch-16~sel.png">
+ <LogicalName>pad-watch-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-watch-16~sel%402x.png">
+ <LogicalName>pad-watch-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-watch-16~dark~sel.png">
+ <LogicalName>pad-watch-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-watch-16~dark~sel%402x.png">
+ <LogicalName>pad-watch-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-debugger-16.png">
<LogicalName>prefs-debugger-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-debugger-16%402x.png">
<LogicalName>prefs-debugger-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-debugger-16~dark.png">
+ <LogicalName>prefs-debugger-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-debugger-16~dark%402x.png">
+ <LogicalName>prefs-debugger-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-debugger-16~sel.png">
+ <LogicalName>prefs-debugger-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-debugger-16~sel%402x.png">
+ <LogicalName>prefs-debugger-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-debugger-16~dark~sel.png">
+ <LogicalName>prefs-debugger-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-debugger-16~dark~sel%402x.png">
+ <LogicalName>prefs-debugger-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\lightning-16.png">
<LogicalName>lightning-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\lightning-16%402x.png">
<LogicalName>lightning-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\lightning-16~dark.png">
+ <LogicalName>lightning-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\lightning-16~dark%402x.png">
+ <LogicalName>lightning-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\lightning-16~disabled.png">
+ <LogicalName>lightning-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\lightning-16~disabled%402x.png">
+ <LogicalName>lightning-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\lightning-16~dark~disabled.png">
+ <LogicalName>lightning-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\lightning-16~dark~disabled%402x.png">
+ <LogicalName>lightning-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\exception-48~dark.png">
+ <LogicalName>exception-48~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\exception-48~dark%402x.png">
+ <LogicalName>exception-48~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\gutter-breakpoint-15.png">
<LogicalName>gutter-breakpoint-15.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\gutter-breakpoint-15%402x.png">
<LogicalName>gutter-breakpoint-15@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-breakpoint-15~dark.png">
+ <LogicalName>gutter-breakpoint-15~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-breakpoint-15~dark%402x.png">
+ <LogicalName>gutter-breakpoint-15~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\gutter-breakpoint-disabled-15.png">
<LogicalName>gutter-breakpoint-disabled-15.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\gutter-breakpoint-disabled-15%402x.png">
<LogicalName>gutter-breakpoint-disabled-15@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-breakpoint-disabled-15~dark.png">
+ <LogicalName>gutter-breakpoint-disabled-15~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-breakpoint-disabled-15~dark%402x.png">
+ <LogicalName>gutter-breakpoint-disabled-15~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\gutter-breakpoint-invalid-15.png">
<LogicalName>gutter-breakpoint-invalid-15.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\gutter-breakpoint-invalid-15%402x.png">
<LogicalName>gutter-breakpoint-invalid-15@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-breakpoint-invalid-15~dark.png">
+ <LogicalName>gutter-breakpoint-invalid-15~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-breakpoint-invalid-15~dark%402x.png">
+ <LogicalName>gutter-breakpoint-invalid-15~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\gutter-execution-15.png">
<LogicalName>gutter-execution-15.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\gutter-execution-15%402x.png">
<LogicalName>gutter-execution-15@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-execution-15~dark.png">
+ <LogicalName>gutter-execution-15~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-execution-15~dark%402x.png">
+ <LogicalName>gutter-execution-15~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\gutter-stack-15.png">
<LogicalName>gutter-stack-15.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\gutter-stack-15%402x.png">
<LogicalName>gutter-stack-15@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-stack-15~dark.png">
+ <LogicalName>gutter-stack-15~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-stack-15~dark%402x.png">
+ <LogicalName>gutter-stack-15~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\gutter-tracepoint-15.png">
<LogicalName>gutter-tracepoint-15.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\gutter-tracepoint-15%402x.png">
<LogicalName>gutter-tracepoint-15@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-tracepoint-15~dark.png">
+ <LogicalName>gutter-tracepoint-15~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-tracepoint-15~dark%402x.png">
+ <LogicalName>gutter-tracepoint-15~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\gutter-tracepoint-disabled-15.png">
<LogicalName>gutter-tracepoint-disabled-15.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\gutter-tracepoint-disabled-15%402x.png">
<LogicalName>gutter-tracepoint-disabled-15@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-tracepoint-disabled-15~dark.png">
+ <LogicalName>gutter-tracepoint-disabled-15~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-tracepoint-disabled-15~dark%402x.png">
+ <LogicalName>gutter-tracepoint-disabled-15~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\gutter-tracepoint-invalid-15.png">
<LogicalName>gutter-tracepoint-invalid-15.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\gutter-tracepoint-invalid-15%402x.png">
<LogicalName>gutter-tracepoint-invalid-15@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-tracepoint-invalid-15~dark.png">
+ <LogicalName>gutter-tracepoint-invalid-15~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-tracepoint-invalid-15~dark%402x.png">
+ <LogicalName>gutter-tracepoint-invalid-15~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\stack-pointer-16.png">
<LogicalName>stack-pointer-16.png</LogicalName>
</EmbeddedResource>
@@ -326,6 +521,24 @@
<EmbeddedResource Include="icons\exception-outline-16%402x.png">
<LogicalName>exception-outline-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\stack-pointer-16~dark.png">
+ <LogicalName>stack-pointer-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\stack-pointer-16~dark%402x.png">
+ <LogicalName>stack-pointer-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\stack-pointer-16~disabled.png">
+ <LogicalName>stack-pointer-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\stack-pointer-16~disabled%402x.png">
+ <LogicalName>stack-pointer-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\stack-pointer-16~dark~disabled.png">
+ <LogicalName>stack-pointer-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\stack-pointer-16~dark~disabled%402x.png">
+ <LogicalName>stack-pointer-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
</ItemGroup>
<ItemGroup Condition=" '$(Configuration)' != 'DebugMac' AND '$(Configuration)' != 'ReleaseMac' ">
<EmbeddedResource Include="icons\pause-16.png">
@@ -334,62 +547,158 @@
<EmbeddedResource Include="icons\pause-16%402x.png">
<LogicalName>pause-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\pause-16~dark.png">
+ <LogicalName>pause-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pause-16~dark%402x.png">
+ <LogicalName>pause-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\step-in-16.png">
<LogicalName>step-in-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\step-in-16%402x.png">
<LogicalName>step-in-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\step-in-16~dark.png">
+ <LogicalName>step-in-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\step-in-16~dark%402x.png">
+ <LogicalName>step-in-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\step-out-16.png">
<LogicalName>step-out-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\step-out-16%402x.png">
<LogicalName>step-out-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\step-out-16~dark.png">
+ <LogicalName>step-out-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\step-out-16~dark%402x.png">
+ <LogicalName>step-out-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\step-over-16.png">
<LogicalName>step-over-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\step-over-16%402x.png">
<LogicalName>step-over-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\step-over-16~dark.png">
+ <LogicalName>step-over-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\step-over-16~dark%402x.png">
+ <LogicalName>step-over-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\continue-16.png">
<LogicalName>continue-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\continue-16%402x.png">
<LogicalName>continue-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\continue-16~dark.png">
+ <LogicalName>continue-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\continue-16~dark%402x.png">
+ <LogicalName>continue-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
</ItemGroup>
<ItemGroup Condition=" '$(Configuration)' == 'DebugMac' OR '$(Configuration)' == 'ReleaseMac' ">
- <EmbeddedResource Include="icons\mac\pause.png">
+ <EmbeddedResource Include="icons\mac\pause-16.png">
<LogicalName>pause-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\pause%402x.png">
+ <EmbeddedResource Include="icons\mac\pause-16%402x.png">
<LogicalName>pause-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\pause-16~dark.png">
+ <LogicalName>pause-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\pause-16~dark%402x.png">
+ <LogicalName>pause-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\mac\continue-16.png">
<LogicalName>continue-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\mac\continue-16%402x.png">
<LogicalName>continue-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\continue-16~dark.png">
+ <LogicalName>continue-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\continue-16~dark%402x.png">
+ <LogicalName>continue-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\mac\step-in-16%402x.png">
<LogicalName>step-in-16@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\mac\step-in-16.png">
<LogicalName>step-in-16.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\step-in-16~disabled.png">
+ <LogicalName>step-in-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\step-in-16~disabled%402x.png">
+ <LogicalName>step-in-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\step-in-16~dark.png">
+ <LogicalName>step-in-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\step-in-16~dark%402x.png">
+ <LogicalName>step-in-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\step-in-16~disabled~dark.png">
+ <LogicalName>step-in-16~disabled~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\step-in-16~disabled~dark%402x.png">
+ <LogicalName>step-in-16~disabled~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\mac\step-out-16.png">
<LogicalName>step-out-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\mac\step-out-16%402x.png">
<LogicalName>step-out-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\step-out-16~disabled.png">
+ <LogicalName>step-out-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\step-out-16~disabled%402x.png">
+ <LogicalName>step-out-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\step-out-16~dark.png">
+ <LogicalName>step-out-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\step-out-16~dark%402x.png">
+ <LogicalName>step-out-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\step-out-16~disabled~dark.png">
+ <LogicalName>step-out-16~disabled~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\step-out-16~disabled~dark%402x.png">
+ <LogicalName>step-out-16~disabled~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\mac\step-over-16.png">
<LogicalName>step-over-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\mac\step-over-16%402x.png">
<LogicalName>step-over-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\step-over-16~disabled.png">
+ <LogicalName>step-over-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\step-over-16~disabled%402x.png">
+ <LogicalName>step-over-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\step-over-16~dark.png">
+ <LogicalName>step-over-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\step-over-16~dark%402x.png">
+ <LogicalName>step-over-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\step-over-16~disabled~dark.png">
+ <LogicalName>step-over-16~disabled~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\mac\step-over-16~disabled~dark%402x.png">
+ <LogicalName>step-over-16~disabled~dark@2x.png</LogicalName>
+ </EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs
index fe65568897..9c395b5889 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs
@@ -40,7 +40,7 @@ using MonoDevelop.Ide;
namespace MonoDevelop.Debugger
{
- public class BreakpointPad : IPadContent
+ public class BreakpointPad : PadContent
{
BreakpointStore breakpoints;
@@ -51,11 +51,6 @@ namespace MonoDevelop.Debugger
CommandEntrySet menuSet;
TreeViewState treeState;
- EventHandler<BreakpointEventArgs> breakpointUpdatedHandler;
- EventHandler<BreakpointEventArgs> breakpointRemovedHandler;
- EventHandler<BreakpointEventArgs> breakpointAddedHandler;
- EventHandler breakpointChangedHandler;
-
enum Columns
{
Icon,
@@ -74,12 +69,13 @@ namespace MonoDevelop.Debugger
Properties
}
- public void Initialize (IPadWindow window)
+ protected override void Initialize (IPadWindow window)
{
+ Id = "MonoDevelop.Debugger.BreakpointPad";
// Toolbar and menu definitions
ActionCommand gotoCmd = new ActionCommand (LocalCommands.GoToFile, GettextCatalog.GetString ("Go to File"));
- ActionCommand propertiesCmd = new ActionCommand (LocalCommands.Properties, GettextCatalog.GetString ("Properties"), Gtk.Stock.Properties);
+ ActionCommand propertiesCmd = new ActionCommand (LocalCommands.Properties, GettextCatalog.GetString ("Properties"), Stock.Properties);
menuSet = new CommandEntrySet ();
menuSet.Add (gotoCmd);
@@ -99,8 +95,8 @@ namespace MonoDevelop.Debugger
toolbarSet.AddSeparator ();
toolbarSet.Add (propertiesCmd);
toolbarSet.AddSeparator ();
- toolbarSet.Add (new CommandEntry (DebugCommands.NewFunctionBreakpoint){ DispayType = CommandEntryDisplayType.IconAndText });
- toolbarSet.Add (new CommandEntry (DebugCommands.NewCatchpoint){ DispayType = CommandEntryDisplayType.IconAndText });
+ toolbarSet.Add (new CommandEntry (DebugCommands.NewFunctionBreakpoint){ DisplayType = CommandEntryDisplayType.IconAndText });
+ toolbarSet.Add (new CommandEntry (DebugCommands.NewCatchpoint){ DisplayType = CommandEntryDisplayType.IconAndText });
// The breakpoint list
@@ -162,15 +158,10 @@ namespace MonoDevelop.Debugger
UpdateDisplay ();
- breakpointUpdatedHandler = DispatchService.GuiDispatch<EventHandler<BreakpointEventArgs>> (OnBreakpointUpdated);
- breakpointRemovedHandler = DispatchService.GuiDispatch<EventHandler<BreakpointEventArgs>> (OnBreakpointRemoved);
- breakpointAddedHandler = DispatchService.GuiDispatch<EventHandler<BreakpointEventArgs>> (OnBreakpointAdded);
- breakpointChangedHandler = DispatchService.GuiDispatch<EventHandler> (OnBreakpointChanged);
-
- breakpoints.BreakpointAdded += breakpointAddedHandler;
- breakpoints.BreakpointRemoved += breakpointRemovedHandler;
- breakpoints.Changed += breakpointChangedHandler;
- breakpoints.BreakpointUpdated += breakpointUpdatedHandler;
+ breakpoints.BreakpointAdded += OnBreakpointAdded;
+ breakpoints.BreakpointRemoved += OnBreakpointRemoved;
+ breakpoints.Changed += OnBreakpointChanged;
+ breakpoints.BreakpointUpdated += OnBreakpointUpdated;
DebuggingService.PausedEvent += OnDebuggerStatusCheck;
DebuggingService.ResumedEvent += OnDebuggerStatusCheck;
@@ -178,21 +169,22 @@ namespace MonoDevelop.Debugger
tree.RowActivated += OnRowActivated;
- DockItemToolbar toolbar = window.GetToolbar (PositionType.Top);
+ DockItemToolbar toolbar = window.GetToolbar (DockPositionType.Top);
toolbar.Add (toolbarSet, sw);
toolbar.ShowAll ();
}
- public void Dispose ()
+ public override void Dispose ()
{
- breakpoints.BreakpointAdded -= breakpointAddedHandler;
- breakpoints.BreakpointRemoved -= breakpointRemovedHandler;
- breakpoints.Changed -= breakpointChangedHandler;
- breakpoints.BreakpointUpdated -= breakpointUpdatedHandler;
+ breakpoints.BreakpointAdded -= OnBreakpointAdded;
+ breakpoints.BreakpointRemoved -= OnBreakpointRemoved;
+ breakpoints.Changed -= OnBreakpointChanged;
+ breakpoints.BreakpointUpdated -= OnBreakpointUpdated;
DebuggingService.PausedEvent -= OnDebuggerStatusCheck;
DebuggingService.ResumedEvent -= OnDebuggerStatusCheck;
DebuggingService.StoppedEvent -= OnDebuggerStatusCheck;
+ base.Dispose ();
}
void ShowPopup (Gdk.EventButton evt)
@@ -226,7 +218,7 @@ namespace MonoDevelop.Debugger
[CommandHandler (DebugCommands.EnableDisableBreakpoint)]
protected void OnEnableDisable ()
{
- breakpoints.Changed -= breakpointChangedHandler;
+ breakpoints.Changed -= OnBreakpointChanged;
try {
bool enable = false;
@@ -258,7 +250,7 @@ namespace MonoDevelop.Debugger
store.SetValue (iter, (int) Columns.Selected, enable);
}
} finally {
- breakpoints.Changed += breakpointChangedHandler;
+ breakpoints.Changed += OnBreakpointChanged;
}
}
@@ -282,7 +274,7 @@ namespace MonoDevelop.Debugger
{
bool deleted = false;
- breakpoints.BreakpointRemoved -= breakpointRemovedHandler;
+ breakpoints.BreakpointRemoved -= OnBreakpointRemoved;
try {
// Note: since we'll be modifying the list of breakpoints, we need to sort
@@ -302,7 +294,7 @@ namespace MonoDevelop.Debugger
deleted = true;
}
} finally {
- breakpoints.BreakpointRemoved += breakpointRemovedHandler;
+ breakpoints.BreakpointRemoved += OnBreakpointRemoved;
}
return deleted;
@@ -369,7 +361,7 @@ namespace MonoDevelop.Debugger
void ItemToggled (object o, ToggledArgs args)
{
- breakpoints.Changed -= breakpointChangedHandler;
+ breakpoints.Changed -= OnBreakpointChanged;
try {
TreeIter iter;
@@ -382,7 +374,7 @@ namespace MonoDevelop.Debugger
store.SetValue (iter, (int) Columns.Selected, bp.Enabled);
}
} finally {
- breakpoints.Changed += breakpointChangedHandler;
+ breakpoints.Changed += OnBreakpointChanged;
}
}
@@ -430,36 +422,38 @@ namespace MonoDevelop.Debugger
void OnBreakpointUpdated (object s, BreakpointEventArgs args)
{
- TreeIter it;
-
- if (!store.GetIterFirst (out it))
- return;
-
- do {
- var bp = (BreakEvent) store.GetValue (it, (int) Columns.Breakpoint);
- if (bp == args.Breakpoint) {
- string hitCount = bp.HitCountMode != HitCountMode.None ? bp.CurrentHitCount.ToString () : "";
- string traceVal = (bp.HitAction & HitAction.PrintExpression) != HitAction.None ? bp.LastTraceValue : "";
- store.SetValue (it, (int) Columns.HitCount, hitCount);
- store.SetValue (it, (int) Columns.LastTrace, traceVal);
- break;
- }
- } while (store.IterNext (ref it));
+ Runtime.RunInMainThread (() => {
+ TreeIter it;
+
+ if (!store.GetIterFirst (out it))
+ return;
+
+ do {
+ var bp = (BreakEvent) store.GetValue (it, (int) Columns.Breakpoint);
+ if (bp == args.Breakpoint) {
+ string hitCount = bp.HitCountMode != HitCountMode.None ? bp.CurrentHitCount.ToString () : "";
+ string traceVal = (bp.HitAction & HitAction.PrintExpression) != HitAction.None ? bp.LastTraceValue : "";
+ store.SetValue (it, (int) Columns.HitCount, hitCount);
+ store.SetValue (it, (int) Columns.LastTrace, traceVal);
+ break;
+ }
+ } while (store.IterNext (ref it));
+ });
}
protected void OnBreakpointAdded (object o, EventArgs args)
{
- UpdateDisplay ();
+ Runtime.RunInMainThread ((System.Action)UpdateDisplay);
}
protected void OnBreakpointRemoved (object o, EventArgs args)
{
- UpdateDisplay ();
+ Runtime.RunInMainThread ((System.Action)UpdateDisplay);
}
protected void OnBreakpointChanged (object o, EventArgs args)
{
- UpdateDisplay ();
+ Runtime.RunInMainThread ((System.Action)UpdateDisplay);
}
void OnDebuggerStatusCheck (object s, EventArgs a)
@@ -473,25 +467,16 @@ namespace MonoDevelop.Debugger
OnBpJumpTo ();
}
- public Gtk.Widget Control {
+ public override Control Control {
get {
return control;
}
}
- public string Id {
- get { return "MonoDevelop.Debugger.BreakpointPad"; }
- }
-
public string DefaultPlacement {
get { return "Bottom"; }
}
- public void RedrawContent ()
- {
- UpdateDisplay ();
- }
-
protected void OnDeleteClicked (object o, EventArgs args)
{
OnDeleted ();
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPropertiesDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPropertiesDialog.cs
index 8e11088ce8..225366c8c1 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPropertiesDialog.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPropertiesDialog.cs
@@ -36,6 +36,7 @@ using Xwt;
using Xwt.Drawing;
using System.Linq;
using System.IO;
+using System.Threading.Tasks;
namespace MonoDevelop.Debugger
{
@@ -203,7 +204,7 @@ namespace MonoDevelop.Debugger
public BreakpointPropertiesDialog (BreakEvent be, BreakpointType breakpointType)
{
this.be = be;
- LoadExceptionList ();
+ Task.Run (LoadExceptionList);
Initialize ();
SetInitialData ();
SetLayout ();
@@ -351,7 +352,7 @@ namespace MonoDevelop.Debugger
if (project != null) {
// Check the startup project of the solution too, since the current project may be a library
- SolutionEntityItem startup = project.ParentSolution.StartupItem;
+ SolutionItem startup = project.ParentSolution.StartupItem;
entryConditionalExpression.Sensitive = DebuggingService.IsFeatureSupported (project, DebuggerFeatures.ConditionalBreakpoints) ||
DebuggingService.IsFeatureSupported (startup, DebuggerFeatures.ConditionalBreakpoints);
@@ -419,8 +420,8 @@ namespace MonoDevelop.Debugger
IdeApp.Workbench.ActiveDocument.Editor != null &&
IdeApp.Workbench.ActiveDocument.FileName != FilePath.Null) {
breakpointLocation.Update (IdeApp.Workbench.ActiveDocument.FileName,
- IdeApp.Workbench.ActiveDocument.Editor.Caret.Line,
- IdeApp.Workbench.ActiveDocument.Editor.Caret.Column);
+ IdeApp.Workbench.ActiveDocument.Editor.CaretLine,
+ IdeApp.Workbench.ActiveDocument.Editor.CaretColumn);
entryLocationFile.Text = breakpointLocation.ToString ();
stopOnLocation.Active = true;
}
@@ -441,7 +442,7 @@ namespace MonoDevelop.Debugger
public void Update (string location)
{
if (string.IsNullOrWhiteSpace (location)) {
- Warning = GettextCatalog.GetString ("Enter location");
+ Warning = GettextCatalog.GetString ("Enter location.");
return;
}
var splitted = location.Split (':');
@@ -455,22 +456,22 @@ namespace MonoDevelop.Debugger
}
splitted = newSplitted;
} else {
- Warning = GettextCatalog.GetString ("File does not exist");
+ Warning = GettextCatalog.GetString ("File does not exist.");
return;
}
}
if (splitted.Length < 2) {
- Warning = GettextCatalog.GetString ("Missing ':' for line declaration");
+ Warning = GettextCatalog.GetString ("Missing ':' for line declaration.");
return;
}
FileName = splitted [0];
if (!int.TryParse (splitted [1], out line)) {
- Warning = GettextCatalog.GetString ("Line is not a number");
+ Warning = GettextCatalog.GetString ("Line is not a number.");
return;
}
if (splitted.Length > 2 && !int.TryParse (splitted [2], out column)) {
- Warning = GettextCatalog.GetString ("Column is not a number");
+ Warning = GettextCatalog.GetString ("Column is not a number.");
return;
} else {
column = 1;
@@ -486,7 +487,7 @@ namespace MonoDevelop.Debugger
public void Update (string filePath, int line, int column)
{
if (!System.IO.File.Exists (filePath)) {
- Warning = GettextCatalog.GetString ("File does not exist");
+ Warning = GettextCatalog.GetString ("File does not exist.");
} else {
Warning = "";
}
@@ -617,7 +618,7 @@ namespace MonoDevelop.Debugger
if (breakpointActionPrint.Active && string.IsNullOrWhiteSpace (entryPrintExpression.Text)) {
warningPrintExpression.Show ();
- warningPrintExpression.ToolTip = GettextCatalog.GetString ("Trace expression not specified");
+ warningPrintExpression.ToolTip = GettextCatalog.GetString ("Enter trace expression.");
result = false;
}
@@ -627,13 +628,13 @@ namespace MonoDevelop.Debugger
if (stopOnFunction.Active) {
if (text.Length == 0) {
warningFunction.Show ();
- warningFunction.ToolTip = GettextCatalog.GetString ("Function name not specified");
+ warningFunction.ToolTip = GettextCatalog.GetString ("Enter function name.");
result = false;
}
if (!TryParseFunction (text, out parsedFunction, out parsedParamTypes)) {
warningFunction.Show ();
- warningFunction.ToolTip = GettextCatalog.GetString ("Invalid function syntax");
+ warningFunction.ToolTip = GettextCatalog.GetString ("Invalid function syntax.");
result = false;
}
}
@@ -645,10 +646,16 @@ namespace MonoDevelop.Debugger
result = false;
}
} else if (stopOnException.Active) {
- if (!classes.Contains (entryExceptionType.Text)) {
+ if (string.IsNullOrWhiteSpace (entryExceptionType.Text)) {
warningException.Show ();
- warningException.ToolTip = GettextCatalog.GetString ("Exception not identified");
+ warningException.ToolTip = GettextCatalog.GetString ("Enter exception type.");
result = false;
+ } else if (!classes.Contains (entryExceptionType.Text)) {
+ warningException.Show ();
+ warningException.ToolTip = GettextCatalog.GetString ("Exception not identified in exception list generated from currently selected project.");
+ //We might be missing some exceptions that are loaded at runtime from outside our project
+ //or we don't have project at all, hence show warning but still allow user to close window
+ result = true;
}
}
return result;
@@ -684,24 +691,35 @@ namespace MonoDevelop.Debugger
return true;
}
- void LoadExceptionList ()
+ async Task LoadExceptionList ()
{
classes.Add ("System.Exception");
- if (IdeApp.ProjectOperations.CurrentSelectedProject != null) {
- var dom = TypeSystemService.GetCompilation (IdeApp.ProjectOperations.CurrentSelectedProject);
- foreach (var t in dom.FindType (typeof (Exception)).GetSubTypeDefinitions ())
- classes.Add (t.ReflectionName);
- } else {
- // no need to unload this assembly context, it's not cached.
- var unresolvedAssembly = TypeSystemService.LoadAssemblyContext (Runtime.SystemAssemblyService.CurrentRuntime, MonoDevelop.Core.Assemblies.TargetFramework.Default, typeof(Uri).Assembly.Location);
- var mscorlib = TypeSystemService.LoadAssemblyContext (Runtime.SystemAssemblyService.CurrentRuntime, MonoDevelop.Core.Assemblies.TargetFramework.Default, typeof(object).Assembly.Location);
- if (unresolvedAssembly != null && mscorlib != null) {
- var dom = new ICSharpCode.NRefactory.TypeSystem.Implementation.SimpleCompilation (unresolvedAssembly, mscorlib);
- foreach (var t in dom.FindType (typeof (Exception)).GetSubTypeDefinitions ())
- classes.Add (t.ReflectionName);
+ try {
+ Microsoft.CodeAnalysis.Compilation compilation = null;
+ Microsoft.CodeAnalysis.ProjectId dummyProjectId = null;
+ if (IdeApp.ProjectOperations.CurrentSelectedProject != null) {
+ compilation = await TypeSystemService.GetCompilationAsync (IdeApp.ProjectOperations.CurrentSelectedProject);
+ }
+ if (compilation == null) {
+ //no need to unload this assembly context, it's not cached.
+ dummyProjectId = Microsoft.CodeAnalysis.ProjectId.CreateNewId ("GetExceptionsProject");
+ compilation = Microsoft.CodeAnalysis.CSharp.CSharpCompilation.Create ("GetExceptions")
+ .AddReferences (MetadataReferenceCache.LoadReference (dummyProjectId, System.Reflection.Assembly.GetAssembly (typeof (object)).Location))//corlib
+ .AddReferences (MetadataReferenceCache.LoadReference (dummyProjectId, System.Reflection.Assembly.GetAssembly (typeof (Uri)).Location));//System.dll
}
+ var exceptionClass = compilation.GetTypeByMetadataName ("System.Exception");
+ foreach (var t in compilation.GlobalNamespace.GetAllTypes ().Where ((arg) => arg.IsDerivedFromClass (exceptionClass))) {
+ classes.Add (t.GetFullMetadataName ());
+ }
+ if (dummyProjectId != null) {
+ MetadataReferenceCache.RemoveReferences (dummyProjectId);
+ }
+ } catch (Exception e) {
+ LoggingService.LogError ("Failed to obtain exceptions list in breakpoint dialog.", e);
}
- entryExceptionType.SetCodeCompletionList (classes.ToList ());
+ await Runtime.RunInMainThread (() => {
+ entryExceptionType.SetCodeCompletionList (classes.ToList ());
+ });
}
public BreakEvent GetBreakEvent ()
@@ -824,4 +842,4 @@ namespace MonoDevelop.Debugger
base.Dispose (disposing);
}
}
-} \ No newline at end of file
+}
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BusyEvaluatorDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BusyEvaluatorDialog.cs
index d82779bcbc..48bdacad81 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BusyEvaluatorDialog.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BusyEvaluatorDialog.cs
@@ -26,27 +26,46 @@
using System;
using Mono.Debugging.Client;
+using MonoDevelop.Ide;
namespace MonoDevelop.Debugger
{
- public partial class BusyEvaluatorDialog : Gtk.Dialog
+ class BusyEvaluator
{
- public BusyEvaluatorDialog ()
- {
- this.Build ();
- //Prevent closing dialog via X button, user can either wait with
- //dialog open or press "Stop Debugger" button
- DeleteEvent += (o, args) => args.RetVal = true;
+ public BusyEvaluatorDialog Dialog {
+ get;
+ private set;
}
public void UpdateBusyState (BusyStateEventArgs args)
{
if (!args.IsBusy) {
- Hide ();
+ if (Dialog != null) {
+ Dialog.Destroy ();
+ Dialog.Dispose ();
+ Dialog = null;
+ }
} else {
- Show ();
+ if (Dialog == null)
+ Dialog = new BusyEvaluatorDialog ();
+
+ Dialog.Show ();
}
}
+ }
+
+ public partial class BusyEvaluatorDialog : Gtk.Dialog
+ {
+ public BusyEvaluatorDialog ()
+ {
+ this.Build ();
+ //Prevent closing dialog via X button, user can either wait with
+ //dialog open or press "Stop Debugger" button
+ DeleteEvent += (o, args) => args.RetVal = true;
+ Modal = true;
+ TransientFor = MessageService.RootWindow;
+ DestroyWithParent = true;
+ }
protected virtual void OnButtonCancelClicked (object sender, System.EventArgs e)
{
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebugCommands.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebugCommands.cs
index 7eb9ee537d..cb282f2f2b 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebugCommands.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebugCommands.cs
@@ -79,40 +79,18 @@ namespace MonoDevelop.Debugger
IdeApp.ProjectOperations.CurrentSelectedBuildTarget;
}
- internal static void BuildAndDebug ()
+ internal async static void BuildAndDebug ()
{
if (!DebuggingService.IsDebuggingSupported && !IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted) {
MonoDevelop.Ide.Commands.StopHandler.StopBuildOperations ();
- IdeApp.ProjectOperations.CurrentRunOperation.WaitForCompleted ();
+ await IdeApp.ProjectOperations.CurrentRunOperation.Task;
}
if (IdeApp.Workspace.IsOpen) {
var it = GetRunTarget ();
- var op = IdeApp.ProjectOperations.CheckAndBuildForExecute (it);
- op.Completed += delegate {
- if (op.Success)
- ExecuteSolution (it);
- };
+ ExecuteSolution (it);
return;
}
-
- Document doc = IdeApp.Workbench.ActiveDocument;
- if (doc == null)
- return;
-
- if (!IdeApp.Preferences.BuildBeforeExecuting) {
- ExecuteDocument (doc);
- return;
- }
-
- doc.Save ();
- IAsyncOperation docOp = doc.Build ();
- docOp.Completed += delegate {
- if (docOp.SuccessWithWarnings && !IdeApp.Preferences.RunWithWarnings)
- return;
- if (docOp.Success)
- ExecuteDocument (doc);
- };
}
static void ExecuteSolution (IBuildTarget target)
@@ -123,14 +101,6 @@ namespace MonoDevelop.Debugger
IdeApp.ProjectOperations.Execute (target);
}
- static void ExecuteDocument (Document doc)
- {
- if (doc.CanDebug ())
- doc.Debug ();
- else
- doc.Run ();
- }
-
protected override void Run ()
{
if (DebuggingService.IsPaused) {
@@ -159,7 +129,7 @@ namespace MonoDevelop.Debugger
// just run, so the label has to be changed accordingly.
if (!DebuggingService.IsDebuggingSupported) {
info.Text = IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted ? GettextCatalog.GetString ("Start Without Debugging") : GettextCatalog.GetString ("Restart Without Debugging");
- info.Icon = "gtk-execute";
+ info.Icon = Stock.RunProgramIcon;
}
if (IdeApp.Workspace.IsOpen) {
@@ -171,23 +141,18 @@ namespace MonoDevelop.Debugger
info.Enabled = canExecute && (IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted || !DebuggingService.IsDebuggingSupported);
} else {
- Document doc = IdeApp.Workbench.ActiveDocument;
- info.Enabled = (doc != null && doc.IsBuildTarget) && (doc.CanRun () || doc.CanDebug ());
+ info.Enabled = false;
}
}
}
class DebugEntryHandler: CommandHandler
{
- protected override void Run ()
+ protected async override void Run ()
{
IBuildTarget entry = IdeApp.ProjectOperations.CurrentSelectedBuildTarget;
- var op = IdeApp.ProjectOperations.CheckAndBuildForExecute (entry);
- op.Completed += delegate {
- if (op.Success)
- IdeApp.ProjectOperations.Debug (entry);
- };
+ await IdeApp.ProjectOperations.Debug (entry).Task;
}
protected override void Update (CommandInfo info)
@@ -386,13 +351,13 @@ namespace MonoDevelop.Debugger
Breakpoint bp;
lock (breakpoints)
- bp = breakpoints.Toggle (IdeApp.Workbench.ActiveDocument.FileName, IdeApp.Workbench.ActiveDocument.Editor.Caret.Line, IdeApp.Workbench.ActiveDocument.Editor.Caret.Column);
+ bp = breakpoints.Toggle (IdeApp.Workbench.ActiveDocument.FileName, IdeApp.Workbench.ActiveDocument.Editor.CaretLine, IdeApp.Workbench.ActiveDocument.Editor.CaretColumn);
// If the breakpoint could not be inserted in the caret location, move the caret
// to the real line of the breakpoint, so that if the Toggle command is run again,
// this breakpoint will be removed
- if (bp != null && bp.Line != IdeApp.Workbench.ActiveDocument.Editor.Caret.Line)
- IdeApp.Workbench.ActiveDocument.Editor.Caret.Line = bp.Line;
+ if (bp != null && bp.Line != IdeApp.Workbench.ActiveDocument.Editor.CaretLine)
+ IdeApp.Workbench.ActiveDocument.Editor.CaretLine = bp.Line;
}
protected override void Update (CommandInfo info)
@@ -404,7 +369,7 @@ namespace MonoDevelop.Debugger
!DebuggingService.Breakpoints.IsReadOnly;
}
}
-
+
class EnableDisableBreakpointHandler: CommandHandler
{
protected override void Run ()
@@ -412,7 +377,7 @@ namespace MonoDevelop.Debugger
var breakpoints = DebuggingService.Breakpoints;
lock (breakpoints) {
- foreach (var bp in breakpoints.GetBreakpointsAtFileLine (IdeApp.Workbench.ActiveDocument.FileName, IdeApp.Workbench.ActiveDocument.Editor.Caret.Line))
+ foreach (var bp in breakpoints.GetBreakpointsAtFileLine (IdeApp.Workbench.ActiveDocument.FileName, IdeApp.Workbench.ActiveDocument.Editor.CaretLine))
bp.Enabled = !bp.Enabled;
}
}
@@ -427,7 +392,7 @@ namespace MonoDevelop.Debugger
IdeApp.Workbench.ActiveDocument.FileName != FilePath.Null &&
!breakpoints.IsReadOnly) {
lock (breakpoints)
- info.Enabled = breakpoints.GetBreakpointsAtFileLine (IdeApp.Workbench.ActiveDocument.FileName, IdeApp.Workbench.ActiveDocument.Editor.Caret.Line).Count > 0;
+ info.Enabled = breakpoints.GetBreakpointsAtFileLine (IdeApp.Workbench.ActiveDocument.FileName, IdeApp.Workbench.ActiveDocument.Editor.CaretLine).Count > 0;
} else {
info.Enabled = false;
}
@@ -487,7 +452,7 @@ namespace MonoDevelop.Debugger
lock (breakpoints) {
IEnumerable<Breakpoint> brs = breakpoints.GetBreakpointsAtFileLine (
IdeApp.Workbench.ActiveDocument.FileName,
- IdeApp.Workbench.ActiveDocument.Editor.Caret.Line);
+ IdeApp.Workbench.ActiveDocument.Editor.CaretLine);
List<Breakpoint> list = new List<Breakpoint> (brs);
foreach (Breakpoint bp in list)
@@ -505,7 +470,7 @@ namespace MonoDevelop.Debugger
IdeApp.Workbench.ActiveDocument.FileName != FilePath.Null &&
!breakpoints.IsReadOnly) {
lock (breakpoints)
- info.Enabled = breakpoints.GetBreakpointsAtFileLine (IdeApp.Workbench.ActiveDocument.FileName, IdeApp.Workbench.ActiveDocument.Editor.Caret.Line).Count > 0;
+ info.Enabled = breakpoints.GetBreakpointsAtFileLine (IdeApp.Workbench.ActiveDocument.FileName, IdeApp.Workbench.ActiveDocument.Editor.CaretLine).Count > 0;
} else {
info.Enabled = false;
}
@@ -590,11 +555,11 @@ namespace MonoDevelop.Debugger
var doc = IdeApp.Workbench.ActiveDocument;
if (DebuggingService.IsPaused) {
- DebuggingService.RunToCursor (doc.FileName, doc.Editor.Caret.Line, doc.Editor.Caret.Column);
+ DebuggingService.RunToCursor (doc.FileName, doc.Editor.CaretLine, doc.Editor.CaretColumn);
return;
}
- var bp = new RunToCursorBreakpoint (doc.FileName, doc.Editor.Caret.Line, doc.Editor.Caret.Column);
+ var bp = new RunToCursorBreakpoint (doc.FileName, doc.Editor.CaretLine, doc.Editor.CaretColumn);
DebuggingService.Breakpoints.Add (bp);
DebugHandler.BuildAndDebug ();
}
@@ -616,7 +581,7 @@ namespace MonoDevelop.Debugger
info.Enabled = target != null && IdeApp.ProjectOperations.CanDebug (target);
} else {
- info.Enabled = doc.IsBuildTarget && doc.CanDebug ();
+ info.Enabled = false;
}
} else {
info.Enabled = false;
@@ -634,7 +599,7 @@ namespace MonoDevelop.Debugger
lock (breakpoints) {
brs = breakpoints.GetBreakpointsAtFileLine (
IdeApp.Workbench.ActiveDocument.FileName,
- IdeApp.Workbench.ActiveDocument.Editor.Caret.Line);
+ IdeApp.Workbench.ActiveDocument.Editor.CaretLine);
}
if (brs.Count > 0) {
@@ -653,7 +618,7 @@ namespace MonoDevelop.Debugger
IdeApp.Workbench.ActiveDocument.FileName != FilePath.Null &&
!breakpoints.IsReadOnly) {
lock (breakpoints)
- info.Enabled = breakpoints.GetBreakpointsAtFileLine (IdeApp.Workbench.ActiveDocument.FileName, IdeApp.Workbench.ActiveDocument.Editor.Caret.Line).Count > 0;
+ info.Enabled = breakpoints.GetBreakpointsAtFileLine (IdeApp.Workbench.ActiveDocument.FileName, IdeApp.Workbench.ActiveDocument.Editor.CaretLine).Count > 0;
} else {
info.Enabled = false;
}
@@ -721,7 +686,7 @@ namespace MonoDevelop.Debugger
var doc = IdeApp.Workbench.ActiveDocument;
try {
- DebuggingService.SetNextStatement (doc.FileName, doc.Editor.Caret.Line, doc.Editor.Caret.Column);
+ DebuggingService.SetNextStatement (doc.FileName, doc.Editor.CaretLine, doc.Editor.CaretColumn);
} catch (Exception e) {
if (e is NotSupportedException || e.InnerException is NotSupportedException) {
MessageService.ShowError ("Unable to set the next statement to this location.");
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebugExecutionHandlerFactory.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebugExecutionHandlerFactory.cs
index 55cc770269..fb30399b30 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebugExecutionHandlerFactory.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebugExecutionHandlerFactory.cs
@@ -34,6 +34,7 @@ using MonoDevelop.Core.Execution;
using Mono.Debugging.Client;
using MonoDevelop.Ide.Gui;
using Mono.Debugging;
+using System.Threading.Tasks;
namespace MonoDevelop.Debugger
{
@@ -44,103 +45,42 @@ namespace MonoDevelop.Debugger
return DebuggingService.CanDebugCommand (command);
}
- public IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
+ public ProcessAsyncOperation Execute (ExecutionCommand command, OperationConsole console)
{
if (!CanExecute (command))
return null;
- DebugExecutionHandler h = new DebugExecutionHandler (null);
- return h.Execute (command, console);
+ return DebuggingService.Run (command, console);
}
}
-
- class DebugExecutionHandler: IProcessAsyncOperation
+
+ class DebugAsyncOperation: ProcessAsyncOperation
{
- bool done;
- ManualResetEvent stopEvent;
- DebuggerEngine factory;
-
- public DebugExecutionHandler (DebuggerEngine factory)
- {
- this.factory = factory;
- DebuggingService.StoppedEvent += new EventHandler (OnStopDebug);
- }
-
- public IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
- {
- DebuggingService.InternalRun (command, factory, console);
- return this;
- }
-
- public void Cancel ()
+ TaskCompletionSource<int> taskSource;
+
+ public DebugAsyncOperation ()
{
- DebuggingService.Stop ();
+ taskSource = new TaskCompletionSource<int> ();
+ DebuggingService.StoppedEvent += OnStopDebug;
+ CancellationTokenSource = new CancellationTokenSource ();
+ CancellationTokenSource.Token.Register (DebuggingService.Stop);
+ Task = taskSource.Task;
}
-
- public void WaitForCompleted ()
+
+ public void Cleanup ()
{
- lock (this) {
- if (done) return;
- if (stopEvent == null)
- stopEvent = new ManualResetEvent (false);
+ if (taskSource != null) {
+ taskSource.SetResult (0);
+ taskSource = null;
}
- stopEvent.WaitOne ();
- }
-
- public int ExitCode {
- get { return 0; }
- }
-
- public bool IsCompleted {
- get { return done; }
- }
-
- public bool Success {
- get { return true; }
- }
-
- public bool SuccessWithWarnings {
- get { return true; }
+ DebuggingService.StoppedEvent -= OnStopDebug;
}
void OnStopDebug (object sender, EventArgs args)
{
- lock (this) {
- done = true;
- if (stopEvent != null)
- stopEvent.Set ();
- if (completedEvent != null)
- completedEvent (this);
- }
-
- DebuggingService.StoppedEvent -= new EventHandler (OnStopDebug);
- }
-
- event OperationHandler IAsyncOperation.Completed {
- add {
- bool raiseNow = false;
- lock (this) {
- if (done)
- raiseNow = true;
- else
- completedEvent += value;
- }
- if (raiseNow)
- value (this);
+ if (taskSource != null) {
+ taskSource.SetResult (0);
+ taskSource = null;
}
- remove {
- lock (this) {
- completedEvent -= value;
- }
- }
- }
-
- //FIXME:
- public int ProcessId {
- get { return -1; }
}
-
- event OperationHandler completedEvent;
-
- void IDisposable.Dispose () {}
}
}
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebugTextMarker.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebugTextMarker.cs
deleted file mode 100644
index 6bd1bcd4d8..0000000000
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebugTextMarker.cs
+++ /dev/null
@@ -1,281 +0,0 @@
-// DebugTextMarker.cs
-//
-// Authors: Lluis Sanchez Gual <lluis@novell.com>
-// Jeffrey Stedfast <jeff@xamarin.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.Linq;
-
-using Mono.TextEditor;
-using Mono.TextEditor.Highlighting;
-
-using MonoDevelop.Components;
-
-using Xwt.Drawing;
-
-namespace MonoDevelop.Debugger
-{
- public abstract class DebugTextMarker : MarginMarker
- {
- protected DebugTextMarker (TextEditor editor)
- {
- Editor = editor;
- }
-
- protected abstract Cairo.Color BackgroundColor {
- get;
- }
-
- protected abstract Cairo.Color BorderColor {
- get;
- }
-
- protected Cairo.Color GetBorderColor (AmbientColor color)
- {
- if (color.HasBorderColor)
- return color.BorderColor;
- return color.Color;
- }
-
- protected TextEditor Editor {
- get; private set;
- }
-
- public override bool CanDrawBackground (Margin margin)
- {
- return margin is TextViewMargin;
- }
-
- public override bool CanDrawForeground (Margin margin)
- {
- return margin is IconMargin;
- }
-
- public override bool DrawBackground (TextEditor editor, Cairo.Context cr, double y, LineMetrics metrics)
- {
- // check, if a message bubble is active in that line.
- if (LineSegment != null && LineSegment.Markers.Any (m => m != this && (m is IExtendingTextLineMarker)))
- return false;
-
- var sidePadding = 4;
- var rounding = editor.LineHeight / 2 - 1;
-
- var d = metrics.TextRenderEndPosition - metrics.TextRenderStartPosition;
- if (d > 0) {
- cr.LineWidth = 1;
- cr.RoundedRectangle (metrics.TextRenderStartPosition, Math.Floor (y) + 0.5, d + sidePadding, metrics.LineHeight - 1, rounding);
- cr.SetSourceColor (BackgroundColor);
- cr.FillPreserve ();
- cr.SetSourceColor (BorderColor);
- cr.Stroke ();
- }
-
- return base.DrawBackground (editor, cr, y, metrics);
- }
-
- public override void DrawForeground (TextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
- {
- double size = metrics.Margin.Width;
- double borderLineWidth = cr.LineWidth;
-
- double x = Math.Floor (metrics.Margin.XOffset - borderLineWidth / 2);
- double y = Math.Floor (metrics.Y + (metrics.Height - size) / 2);
-
- DrawMarginIcon (cr, x, y, size);
- }
-
- protected virtual void SetForegroundColor (ChunkStyle style)
- {
- }
-
- public override ChunkStyle GetStyle (ChunkStyle baseStyle)
- {
- if (baseStyle == null)
- return null;
-
- var style = new ChunkStyle (baseStyle);
- // style.Background = BackgroundColor;
- SetForegroundColor (style);
-
- return style;
- }
-
- protected void DrawImage (Cairo.Context cr, Image image, double x, double y, double size)
- {
- var deltaX = size / 2 - image.Width / 2 + 0.5f;
- var deltaY = size / 2 - image.Height / 2 + 0.5f;
-
- cr.DrawImage (Editor, image, Math.Round (x + deltaX), Math.Round (y + deltaY));
- }
-
- protected virtual void DrawMarginIcon (Cairo.Context cr, double x, double y, double size)
- {
- }
- }
-
- public class BreakpointTextMarker : DebugTextMarker
- {
- static readonly Image breakpoint = Image.FromResource ("gutter-breakpoint-15.png");
- static readonly Image tracepoint = Image.FromResource ("gutter-tracepoint-15.png");
-
- public BreakpointTextMarker (TextEditor editor, bool tracepoint) : base (editor)
- {
- IsTracepoint = tracepoint;
- }
-
- public bool IsTracepoint {
- get; private set;
- }
-
- protected override Cairo.Color BackgroundColor {
- get { return Editor.ColorStyle.BreakpointMarker.Color; }
- }
-
- protected override Cairo.Color BorderColor {
- get { return GetBorderColor (Editor.ColorStyle.BreakpointMarker); }
- }
-
- protected override void SetForegroundColor (ChunkStyle style)
- {
- style.Foreground = Editor.ColorStyle.BreakpointText.Foreground;
- }
-
- protected override void DrawMarginIcon (Cairo.Context cr, double x, double y, double size)
- {
- DrawImage (cr, IsTracepoint ? tracepoint : breakpoint, x, y, size);
- }
- }
-
- public class DisabledBreakpointTextMarker : DebugTextMarker
- {
- static readonly Image breakpoint = Image.FromResource ("gutter-breakpoint-disabled-15.png");
- static readonly Image tracepoint = Image.FromResource ("gutter-tracepoint-disabled-15.png");
-
- public DisabledBreakpointTextMarker (TextEditor editor, bool tracepoint) : base (editor)
- {
- IsTracepoint = tracepoint;
- }
-
- public bool IsTracepoint {
- get; private set;
- }
-
- protected override Cairo.Color BackgroundColor {
- get { return Editor.ColorStyle.BreakpointMarkerDisabled.Color; }
- }
-
- protected override Cairo.Color BorderColor {
- get { return GetBorderColor (Editor.ColorStyle.BreakpointMarkerDisabled); }
- }
-
- protected override void DrawMarginIcon (Cairo.Context cr, double x, double y, double size)
- {
- DrawImage (cr, IsTracepoint ? tracepoint : breakpoint, x, y, size);
- }
- }
-
- public class InvalidBreakpointTextMarker : DebugTextMarker
- {
- static readonly Image breakpoint = Image.FromResource ("gutter-breakpoint-invalid-15.png");
- static readonly Image tracepoint = Image.FromResource ("gutter-tracepoint-invalid-15.png");
-
- public InvalidBreakpointTextMarker (TextEditor editor, bool tracepoint) : base (editor)
- {
- IsTracepoint = tracepoint;
- }
-
- public bool IsTracepoint {
- get; private set;
- }
-
- protected override Cairo.Color BackgroundColor {
- get { return Editor.ColorStyle.BreakpointMarkerInvalid.Color; }
- }
-
- protected override Cairo.Color BorderColor {
- get { return GetBorderColor (Editor.ColorStyle.BreakpointMarkerInvalid); }
- }
-
- protected override void DrawMarginIcon (Cairo.Context cr, double x, double y, double size)
- {
- DrawImage (cr, IsTracepoint ? tracepoint : breakpoint, x, y, size);
- }
- }
-
- public class CurrentDebugLineTextMarker : DebugTextMarker
- {
- static readonly Image currentLine = Image.FromResource ("gutter-execution-15.png");
-
- public CurrentDebugLineTextMarker (TextEditor editor) : base (editor)
- {
- }
-
- protected override Cairo.Color BackgroundColor {
- get { return Editor.ColorStyle.DebuggerCurrentLineMarker.Color; }
- }
-
- protected override Cairo.Color BorderColor {
- get { return GetBorderColor (Editor.ColorStyle.DebuggerCurrentLineMarker); }
- }
-
- protected override void SetForegroundColor (ChunkStyle style)
- {
- style.Foreground = Editor.ColorStyle.DebuggerCurrentLine.Foreground;
- }
-
- protected override void DrawMarginIcon (Cairo.Context cr, double x, double y, double size)
- {
- DrawImage (cr, currentLine, x, y, size);
- }
- }
-
- public class DebugStackLineTextMarker : DebugTextMarker
- {
- static readonly Image stackLine = Image.FromResource ("gutter-stack-15.png");
-
- public DebugStackLineTextMarker (TextEditor editor) : base (editor)
- {
- }
-
- protected override Cairo.Color BackgroundColor {
- get { return Editor.ColorStyle.DebuggerStackLineMarker.Color; }
- }
-
- protected override Cairo.Color BorderColor {
- get { return GetBorderColor (Editor.ColorStyle.DebuggerStackLineMarker); }
- }
-
- protected override void SetForegroundColor (ChunkStyle style)
- {
- style.Foreground = Editor.ColorStyle.DebuggerStackLine.Foreground;
- }
-
- protected override void DrawMarginIcon (Cairo.Context cr, double x, double y, double size)
- {
- DrawImage (cr, stackLine, x, y, size);
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerConsoleView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerConsoleView.cs
index f67ee7864a..8c4e058e05 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerConsoleView.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerConsoleView.cs
@@ -30,6 +30,7 @@ using System.Collections.Generic;
using MonoDevelop.Ide;
using MonoDevelop.Components;
using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Ide.Editor.Extension;
namespace MonoDevelop.Debugger
{
@@ -51,7 +52,7 @@ namespace MonoDevelop.Debugger
TextView.KeyReleaseEvent += OnEditKeyRelease;
TextView.FocusOutEvent += TextView_FocusOutEvent;
- IdeApp.Preferences.CustomOutputPadFontChanged += OnCustomOutputPadFontChanged;
+ IdeApp.Preferences.CustomOutputPadFont.Changed += OnCustomOutputPadFontChanged;
CompletionWindowManager.WindowClosed += OnCompletionWindowClosed;
}
@@ -274,7 +275,7 @@ namespace MonoDevelop.Debugger
if (keyHandled)
return;
- CompletionWindowManager.PostProcessKeyEvent (key, keyChar, modifier);
+ CompletionWindowManager.PostProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifier));
PopupCompletion ();
}
@@ -292,7 +293,7 @@ namespace MonoDevelop.Debugger
}
if (currentCompletionData != null) {
- if ((keyHandled = CompletionWindowManager.PreProcessKeyEvent (key, keyChar, modifier)))
+ if ((keyHandled = CompletionWindowManager.PreProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifier))))
return true;
}
@@ -331,6 +332,9 @@ namespace MonoDevelop.Debugger
int Position {
get { return Cursor.Offset - TokenBegin.Offset; }
+ set {
+ throw new NotSupportedException ();
+ }
}
#region ICompletionWidget implementation
@@ -370,6 +374,15 @@ namespace MonoDevelop.Debugger
get {
return Position;
}
+ set {
+ Position = value;
+ }
+ }
+
+ double ICompletionWidget.ZoomLevel {
+ get {
+ return 1;
+ }
}
char ICompletionWidget.GetChar (int offset)
@@ -457,7 +470,7 @@ namespace MonoDevelop.Debugger
protected override void OnDestroyed ()
{
- IdeApp.Preferences.CustomOutputPadFontChanged -= OnCustomOutputPadFontChanged;
+ IdeApp.Preferences.CustomOutputPadFont.Changed -= OnCustomOutputPadFontChanged;
CompletionWindowManager.WindowClosed -= OnCompletionWindowClosed;
CompletionWindowManager.HideWindow ();
TextView.FocusOutEvent -= TextView_FocusOutEvent;
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs
index 85c5ef476b..ec6d84fafd 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs
@@ -26,6 +26,7 @@
using System;
using Mono.Debugging.Client;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using Xwt;
using MonoDevelop.Core;
@@ -36,7 +37,7 @@ namespace MonoDevelop.Debugger
{
DebuggerOptionsPanelWidget w;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
w = new DebuggerOptionsPanelWidget ();
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs
index 3422b1cf87..22d0c1fc1f 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs
@@ -38,8 +38,6 @@ using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Projects;
using MonoDevelop.Debugger.Viewers;
-using ICSharpCode.NRefactory.Semantics;
-using ICSharpCode.NRefactory.TypeSystem;
/*
* Some places we should be doing some error handling we used to toss
@@ -47,6 +45,8 @@ using ICSharpCode.NRefactory.TypeSystem;
*/
using MonoDevelop.Ide.TextEditing;
using System.Linq;
+using System.Threading.Tasks;
+using MonoDevelop.Ide.TypeSystem;
namespace MonoDevelop.Debugger
{
@@ -62,7 +62,8 @@ namespace MonoDevelop.Debugger
static readonly BreakpointStore breakpoints = new BreakpointStore ();
static readonly DebugExecutionHandlerFactory executionHandlerFactory;
- static IConsole console;
+ static OperationConsole console;
+ static IDisposable cancelRegistration;
static Dictionary<long, SourceLocation> nextStatementLocations = new Dictionary<long, SourceLocation> ();
static DebuggerEngine currentEngine;
@@ -72,10 +73,12 @@ namespace MonoDevelop.Debugger
static ExceptionCaughtMessage exceptionDialog;
- static BusyEvaluatorDialog busyDialog;
+ static BusyEvaluator busyEvaluator;
static StatusBarIcon busyStatusIcon;
static bool isBusy;
+ static DebugAsyncOperation currentDebugOperation = new DebugAsyncOperation ();
+
static public event EventHandler DebugSessionStarted;
static public event EventHandler PausedEvent;
static public event EventHandler ResumedEvent;
@@ -97,10 +100,7 @@ namespace MonoDevelop.Debugger
IdeApp.Workspace.StoringUserPreferences += OnStoreUserPrefs;
IdeApp.Workspace.LoadingUserPreferences += OnLoadUserPrefs;
IdeApp.Workspace.LastWorkspaceItemClosed += OnSolutionClosed;
- busyDialog = new BusyEvaluatorDialog ();
- busyDialog.Modal = true;
- busyDialog.TransientFor = MessageService.RootWindow;
- busyDialog.DestroyWithParent = true;
+ busyEvaluator = new BusyEvaluator ();
};
AddinManager.AddExtensionNodeHandler (FactoriesPath, delegate {
// Refresh the engines list
@@ -138,7 +138,8 @@ namespace MonoDevelop.Debugger
if (liveUpdate) {
var bp = new Breakpoint (watch.File, watch.Line);
bp.TraceExpression = "{" + watch.Expression + "}";
- bp.HitAction |= HitAction.PrintExpression;
+ bp.HitAction = HitAction.PrintExpression;
+ bp.NonUserBreakpoint = true;
lock (breakpoints)
breakpoints.Add (bp);
pinnedWatches.Bind (watch, bp);
@@ -378,10 +379,11 @@ namespace MonoDevelop.Debugger
session.ConnectionDialogCreator = delegate {
return new StatusBarConnectionDialog ();
};
+ currentDebugOperation = new DebugAsyncOperation ();
- console.CancelRequested += OnCancelRequested;
+ cancelRegistration = console.CancellationToken.Register (Stop);
- DispatchService.GuiDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
if (DebugSessionStarted != null)
DebugSessionStarted (null, EventArgs.Empty);
NotifyLocationChanged ();
@@ -394,7 +396,7 @@ namespace MonoDevelop.Debugger
{
DebuggerSession currentSession;
StatusBarIcon currentIcon;
- IConsole currentConsole;
+ OperationConsole currentConsole;
lock (cleanup_lock) {
if (!IsDebugging)
@@ -423,13 +425,14 @@ namespace MonoDevelop.Debugger
currentSession.TypeResolverHandler = null;
currentSession.OutputWriter = null;
currentSession.LogWriter = null;
-
+ currentDebugOperation.Cleanup ();
+
if (currentConsole != null) {
- currentConsole.CancelRequested -= OnCancelRequested;
+ cancelRegistration.Dispose ();
currentConsole.Dispose ();
}
- DispatchService.GuiDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
HideExceptionCaughtDialog ();
if (currentIcon != null) {
@@ -452,23 +455,23 @@ namespace MonoDevelop.Debugger
static void UnsetDebugLayout ()
{
// Dispatch synchronously to avoid start/stop races
- DispatchService.GuiSyncDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
IdeApp.Workbench.HideCommandBar ("Debug");
if (IdeApp.Workbench.CurrentLayout == "Debug") {
IdeApp.Workbench.CurrentLayout = oldLayout ?? "Solution";
}
oldLayout = null;
- });
+ }).Wait ();
}
static void SetDebugLayout ()
{
// Dispatch synchronously to avoid start/stop races
- DispatchService.GuiSyncDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
oldLayout = IdeApp.Workbench.CurrentLayout;
IdeApp.Workbench.CurrentLayout = "Debug";
IdeApp.Workbench.ShowCommandBar ("Debug");
- });
+ }).Wait ();
}
public static bool IsDebugging {
@@ -502,6 +505,7 @@ namespace MonoDevelop.Debugger
public static void Resume ()
{
+ Runtime.AssertMainThread ();
if (CheckIsBusy ())
return;
@@ -511,6 +515,7 @@ namespace MonoDevelop.Debugger
public static void RunToCursor (string fileName, int line, int column)
{
+ Runtime.AssertMainThread ();
if (CheckIsBusy ())
return;
@@ -523,6 +528,7 @@ namespace MonoDevelop.Debugger
public static void SetNextStatement (string fileName, int line, int column)
{
+ Runtime.AssertMainThread ();
if (!IsDebugging || IsRunning || CheckIsBusy ())
return;
@@ -533,14 +539,14 @@ namespace MonoDevelop.Debugger
NotifyLocationChanged ();
}
- public static IProcessAsyncOperation Run (string file, IConsole console)
+ public static ProcessAsyncOperation Run (string file, OperationConsole console)
{
- return Run (file, null, null, null, console);
+ var cmd = Runtime.ProcessService.CreateCommand (file);
+ return Run (cmd, console);
}
- public static IProcessAsyncOperation Run (string file, string args, string workingDir, IDictionary<string,string> envVars, IConsole console)
+ public static ProcessAsyncOperation Run (string file, string args, string workingDir, IDictionary<string,string> envVars, OperationConsole console)
{
- var h = new DebugExecutionHandler (null);
var cmd = Runtime.ProcessService.CreateCommand (file);
if (args != null)
cmd.Arguments = args;
@@ -548,24 +554,29 @@ namespace MonoDevelop.Debugger
cmd.WorkingDirectory = workingDir;
if (envVars != null)
cmd.EnvironmentVariables = envVars;
+ return Run (cmd, console);
+ }
- return h.Execute (cmd, console);
+ public static ProcessAsyncOperation Run (ExecutionCommand cmd, OperationConsole console, DebuggerEngine engine = null)
+ {
+ InternalRun (cmd, engine, console);
+ return currentDebugOperation;
}
- public static IAsyncOperation AttachToProcess (DebuggerEngine debugger, ProcessInfo proc)
+ public static AsyncOperation AttachToProcess (DebuggerEngine debugger, ProcessInfo proc)
{
currentEngine = debugger;
session = debugger.CreateSession ();
session.ExceptionHandler = ExceptionHandler;
- IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetRunProgressMonitor ();
- console = monitor as IConsole;
+ var monitor = IdeApp.Workbench.ProgressMonitors.GetRunProgressMonitor ();
+ console = monitor.Console;
SetupSession ();
session.TargetExited += delegate {
monitor.Dispose ();
};
SetDebugLayout ();
session.AttachToProcess (proc, GetUserOptions ());
- return monitor.AsyncOperation;
+ return currentDebugOperation;
}
public static DebuggerSessionOptions GetUserOptions ()
@@ -610,7 +621,7 @@ namespace MonoDevelop.Debugger
DisassemblyRequested (null, EventArgs.Empty);
}
- internal static void InternalRun (ExecutionCommand cmd, DebuggerEngine factory, IConsole c)
+ internal static void InternalRun (ExecutionCommand cmd, DebuggerEngine factory, OperationConsole c)
{
if (factory == null) {
factory = GetFactoryForCommand (cmd);
@@ -623,7 +634,8 @@ namespace MonoDevelop.Debugger
DebuggerStartInfo startInfo = factory.CreateDebuggerStartInfo (cmd);
startInfo.UseExternalConsole = c is ExternalConsole;
- startInfo.CloseExternalConsoleOnExit = c.CloseOnDispose;
+ if (startInfo.UseExternalConsole)
+ startInfo.CloseExternalConsoleOnExit = ((ExternalConsole)c).CloseOnDispose;
currentEngine = factory;
session = factory.CreateSession ();
session.ExceptionHandler = ExceptionHandler;
@@ -631,7 +643,7 @@ namespace MonoDevelop.Debugger
// When using an external console, create a new internal console which will be used
// to show the debugger log
if (startInfo.UseExternalConsole)
- console = (IConsole) IdeApp.Workbench.ProgressMonitors.GetRunProgressMonitor ();
+ console = IdeApp.Workbench.ProgressMonitors.GetRunProgressMonitor ().Console;
else
console = c;
@@ -671,19 +683,9 @@ namespace MonoDevelop.Debugger
static void DebugWriter (int level, string category, string message)
{
var logger = console;
- var debugLogger = logger as IDebugConsole;
- if (logger != null) {
- if (debugLogger != null) {
- debugLogger.Debug (level, category, message);
- } else {
- if (level == 0 && string.IsNullOrEmpty (category)) {
- logger.Log.Write (message);
- } else {
- logger.Log.Write (string.Format ("[{0}:{1}] {2}", level, category, message));
- }
- }
- }
+ if (logger != null)
+ logger.Debug (level, category, message);
}
static void OutputWriter (bool iserr, string text)
@@ -698,33 +700,37 @@ namespace MonoDevelop.Debugger
}
}
- static void OnBusyStateChanged (object s, BusyStateEventArgs args)
+ static async void OnBusyStateChanged (object s, BusyStateEventArgs args)
{
isBusy = args.IsBusy;
- DispatchService.GuiDispatch (delegate {
- busyDialog.UpdateBusyState (args);
+ await Runtime.RunInMainThread (delegate {
+ busyEvaluator.UpdateBusyState (args);
if (args.IsBusy) {
if (busyStatusIcon == null) {
- busyStatusIcon = IdeApp.Workbench.StatusBar.ShowStatusIcon (ImageService.GetIcon ("md-execute-debug", Gtk.IconSize.Menu));
+ busyStatusIcon = IdeApp.Workbench.StatusBar.ShowStatusIcon (ImageService.GetIcon ("md-bug", Gtk.IconSize.Menu));
busyStatusIcon.SetAlertMode (100);
busyStatusIcon.ToolTip = GettextCatalog.GetString ("The debugger runtime is not responding. You can wait for it to recover, or stop debugging.");
- busyStatusIcon.Clicked += delegate {
- MessageService.PlaceDialog (busyDialog, MessageService.RootWindow);
- };
+ busyStatusIcon.Clicked += OnBusyStatusIconClicked;
}
} else {
if (busyStatusIcon != null) {
+ busyStatusIcon.Clicked -= OnBusyStatusIconClicked;
busyStatusIcon.Dispose ();
busyStatusIcon = null;
}
}
});
}
+
+ static void OnBusyStatusIconClicked (object sender, StatusBarIconClickedEventArgs args)
+ {
+ MessageService.PlaceDialog (busyEvaluator.Dialog, MessageService.RootWindow);
+ }
static bool CheckIsBusy ()
{
- if (isBusy && !busyDialog.Visible)
- MessageService.PlaceDialog (busyDialog, MessageService.RootWindow);
+ if (isBusy && !busyEvaluator.Dialog.Visible)
+ MessageService.PlaceDialog (busyEvaluator.Dialog, MessageService.RootWindow);
return isBusy;
}
@@ -733,7 +739,7 @@ namespace MonoDevelop.Debugger
nextStatementLocations.Clear ();
currentBacktrace = null;
- DispatchService.GuiDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
HideExceptionCaughtDialog ();
if (ResumedEvent != null)
ResumedEvent (null, a);
@@ -781,7 +787,7 @@ namespace MonoDevelop.Debugger
static void NotifyPaused ()
{
- DispatchService.GuiDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
if (PausedEvent != null)
PausedEvent (null, EventArgs.Empty);
NotifyLocationChanged ();
@@ -792,7 +798,7 @@ namespace MonoDevelop.Debugger
static void NotifyException (TargetEventArgs args)
{
if (args.Type == TargetEventType.UnhandledException || args.Type == TargetEventType.ExceptionThrown) {
- DispatchService.GuiDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
if (CurrentFrame != null) {
ShowExceptionCaughtDialog ();
}
@@ -802,6 +808,7 @@ namespace MonoDevelop.Debugger
static void NotifyLocationChanged ()
{
+ Runtime.AssertMainThread ();
if (ExecutionLocationChanged != null)
ExecutionLocationChanged (null, EventArgs.Empty);
}
@@ -820,11 +827,6 @@ namespace MonoDevelop.Debugger
CallStackChanged (null, EventArgs.Empty);
}
- static void OnCancelRequested (object sender, EventArgs args)
- {
- Stop ();
- }
-
public static void Stop ()
{
if (!IsDebugging)
@@ -836,6 +838,8 @@ namespace MonoDevelop.Debugger
public static void StepInto ()
{
+ Runtime.AssertMainThread ();
+
if (!IsDebugging || IsRunning || CheckIsBusy ())
return;
@@ -845,6 +849,8 @@ namespace MonoDevelop.Debugger
public static void StepOver ()
{
+ Runtime.AssertMainThread ();
+
if (!IsDebugging || IsRunning || CheckIsBusy ())
return;
@@ -854,6 +860,8 @@ namespace MonoDevelop.Debugger
public static void StepOut ()
{
+ Runtime.AssertMainThread ();
+
if (!IsDebugging || IsRunning || CheckIsBusy ())
return;
@@ -907,7 +915,7 @@ namespace MonoDevelop.Debugger
set {
if (currentBacktrace != null && value < currentBacktrace.FrameCount) {
currentFrame = value;
- DispatchService.GuiDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
NotifyCurrentFrameChanged ();
});
}
@@ -934,30 +942,32 @@ namespace MonoDevelop.Debugger
else
currentFrame = -1;
- DispatchService.GuiDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
NotifyCallStackChanged ();
NotifyCurrentFrameChanged ();
NotifyLocationChanged ();
});
}
- public static void ShowCurrentExecutionLine ()
+ public static async void ShowCurrentExecutionLine ()
{
+ Runtime.AssertMainThread ();
if (currentBacktrace != null) {
var sf = GetCurrentVisibleFrame ();
if (sf != null && !string.IsNullOrEmpty (sf.SourceLocation.FileName) && System.IO.File.Exists (sf.SourceLocation.FileName) && sf.SourceLocation.Line != -1) {
- Document document = IdeApp.Workbench.OpenDocument (sf.SourceLocation.FileName, null, sf.SourceLocation.Line, 1, OpenDocumentOptions.Debugger);
+ Document document = await IdeApp.Workbench.OpenDocument (sf.SourceLocation.FileName, null, sf.SourceLocation.Line, 1, OpenDocumentOptions.Debugger);
OnDisableConditionalCompilation (new DocumentEventArgs (document));
}
}
}
- public static void ShowNextStatement ()
+ public static async void ShowNextStatement ()
{
+ Runtime.AssertMainThread ();
var location = NextStatementLocation;
if (location != null && System.IO.File.Exists (location.FileName)) {
- Document document = IdeApp.Workbench.OpenDocument (location.FileName, null, location.Line, 1, OpenDocumentOptions.Debugger);
+ Document document = await IdeApp.Workbench.OpenDocument (location.FileName, null, location.Line, 1, OpenDocumentOptions.Debugger);
OnDisableConditionalCompilation (new DocumentEventArgs (document));
} else {
ShowCurrentExecutionLine ();
@@ -1038,7 +1048,7 @@ namespace MonoDevelop.Debugger
args.Properties.SetValue ("MonoDevelop.Ide.DebuggingService.PinnedWatches", pinnedWatches);
}
- static void OnLoadUserPrefs (object s, UserPreferencesEventArgs args)
+ static Task OnLoadUserPrefs (object s, UserPreferencesEventArgs args)
{
var elem = args.Properties.GetValue<XmlElement> ("MonoDevelop.Ide.DebuggingService.Breakpoints") ?? args.Properties.GetValue<XmlElement> ("MonoDevelop.Ide.DebuggingService");
@@ -1053,6 +1063,8 @@ namespace MonoDevelop.Debugger
lock (breakpoints)
pinnedWatches.BindAll (breakpoints);
+
+ return Task.FromResult (true);
}
static void OnSolutionClosed (object s, EventArgs args)
@@ -1067,13 +1079,18 @@ namespace MonoDevelop.Debugger
if (doc != null) {
ITextEditorResolver textEditorResolver = doc.GetContent <ITextEditorResolver> ();
if (textEditorResolver != null) {
- var rr = textEditorResolver.GetLanguageItem (doc.Editor.Document.LocationToOffset (location.Line, 1), identifier);
- var ns = rr as NamespaceResolveResult;
+ var rr = textEditorResolver.GetLanguageItem (doc.Editor.LocationToOffset (location.Line, 1), identifier);
+ var ns = rr as Microsoft.CodeAnalysis.INamespaceSymbol;
if (ns != null)
- return ns.NamespaceName;
- var result = rr as TypeResolveResult;
- if (result != null && !result.IsError && !(result.Type.Kind == TypeKind.Dynamic && result.Type.FullName == "dynamic"))
- return result.Type.FullName;
+ return ns.ToDisplayString (Microsoft.CodeAnalysis.SymbolDisplayFormat.CSharpErrorMessageFormat);
+ var result = rr as Microsoft.CodeAnalysis.INamedTypeSymbol;
+ if (result != null && !(result.TypeKind == Microsoft.CodeAnalysis.TypeKind.Dynamic && result.ToDisplayString (Microsoft.CodeAnalysis.SymbolDisplayFormat.CSharpErrorMessageFormat) == "dynamic")) {
+ return result.ToDisplayString (new Microsoft.CodeAnalysis.SymbolDisplayFormat (
+ typeQualificationStyle: Microsoft.CodeAnalysis.SymbolDisplayTypeQualificationStyle.NameAndContainingTypesAndNamespaces,
+ miscellaneousOptions:
+ Microsoft.CodeAnalysis.SymbolDisplayMiscellaneousOptions.EscapeKeywordIdentifiers |
+ Microsoft.CodeAnalysis.SymbolDisplayMiscellaneousOptions.UseSpecialTypes));
+ }
}
}
return null;
@@ -1107,7 +1124,7 @@ namespace MonoDevelop.Debugger
return SupportedFeatures != DebuggerFeatures.None;
}
- public IProcessAsyncOperation Execute (ExecutionCommand cmd, IConsole console)
+ public ProcessAsyncOperation Execute (ExecutionCommand cmd, OperationConsole console)
{
// Never called
throw new NotImplementedException ();
@@ -1128,10 +1145,9 @@ namespace MonoDevelop.Debugger
return engine.CanDebugCommand (command);
}
- public IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
+ public ProcessAsyncOperation Execute (ExecutionCommand command, OperationConsole console)
{
- var h = new DebugExecutionHandler (engine);
- return h.Execute (command, console);
+ return DebuggingService.Run (command, console, engine);
}
}
@@ -1142,7 +1158,7 @@ namespace MonoDevelop.Debugger
public void SetMessage (DebuggerStartInfo dsi, string message, bool listening, int attemptNumber)
{
Gtk.Application.Invoke (delegate {
- IdeApp.Workbench.StatusBar.ShowMessage (Stock.StatusConnecting, message);
+ IdeApp.Workbench.StatusBar.ShowMessage (Ide.Gui.Stock.StatusConnecting, message);
});
}
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DisassemblyView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DisassemblyView.cs
index 890d216812..fbd0d511a3 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DisassemblyView.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DisassemblyView.cs
@@ -35,20 +35,19 @@ using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.Commands;
-using TextEditor = Mono.TextEditor.TextEditor;
-using Mono.TextEditor;
using Mono.Debugging.Client;
-using Mono.TextEditor.Highlighting;
+using MonoDevelop.Ide.Editor;
using Gtk;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Ide;
using System.Security.Cryptography;
using Gdk;
using MonoDevelop.Components;
+using System.Threading.Tasks;
namespace MonoDevelop.Debugger
{
- public class DisassemblyView: AbstractViewContent, IClipboardHandler
+ public class DisassemblyView: ViewContent, IClipboardHandler
{
Gtk.ScrolledWindow sw;
TextEditor editor;
@@ -56,10 +55,10 @@ namespace MonoDevelop.Debugger
int lastLine;
Dictionary<string,int> addressLines = new Dictionary<string,int> ();
bool autoRefill;
- CurrentDebugLineTextMarker currentDebugLineMarker;
+ ICurrentDebugLineTextMarker currentDebugLineMarker;
bool dragging;
FilePath currentFile;
- AsmLineMarker asmMarker = new AsmLineMarker ();
+ ITextLineMarker asmMarker;
List<AssemblyLine> cachedLines = new List<AssemblyLine> ();
string cachedLinesAddrSpace;
@@ -70,12 +69,11 @@ namespace MonoDevelop.Debugger
{
ContentName = GettextCatalog.GetString ("Disassembly");
sw = new Gtk.ScrolledWindow ();
- editor = new TextEditor ();
- editor.Document.ReadOnly = true;
-
- editor.Options = new CommonTextEditorOptions {
- ShowLineNumberMargin = false,
- };
+ editor = TextEditorFactory.CreateNewEditor ();
+ editor.IsReadOnly = true;
+ asmMarker = TextMarkerFactory.CreateAsmLineMarker (editor);
+
+ editor.Options = DefaultSourceEditorOptions.PlainEditor;
sw.Add (editor);
sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
@@ -88,27 +86,26 @@ namespace MonoDevelop.Debugger
sw.ShadowType = Gtk.ShadowType.In;
sw.Sensitive = false;
-
- currentDebugLineMarker = new CurrentDebugLineTextMarker (editor);
+
DebuggingService.StoppedEvent += OnStop;
}
-
- OverlayMessageWindow messageOverlayWindow;
+ HBox messageOverlayContent;
void ShowLoadSourceFile (StackFrame sf)
{
- if (messageOverlayWindow != null) {
- messageOverlayWindow.Destroy ();
- messageOverlayWindow = null;
+ if (messageOverlayContent != null) {
+ editor.RemoveOverlay (messageOverlayContent);
+ messageOverlayContent = null;
}
- messageOverlayWindow = new OverlayMessageWindow ();
+ messageOverlayContent = new HBox ();
var hbox = new HBox ();
hbox.Spacing = 8;
var label = new Label (string.Format ("{0} not found. Find source file at alternative location.", Path.GetFileName (sf.SourceLocation.FileName)));
hbox.TooltipText = sf.SourceLocation.FileName;
- var color = (HslColor)editor.ColorStyle.NotificationText.Foreground;
+
+ var color = (HslColor)editor.Options.GetColorStyle ().NotificationText.Foreground;
label.ModifyFg (StateType.Normal, color);
int w, h;
@@ -119,13 +116,10 @@ namespace MonoDevelop.Debugger
openButton.WidthRequest = 60;
hbox.PackEnd (openButton, false, false, 0);
- var container = new HBox ();
const int containerPadding = 8;
- container.PackStart (hbox, true, true, containerPadding);
- messageOverlayWindow.Child = container;
- messageOverlayWindow.ShowOverlay (editor);
+ messageOverlayContent.PackStart (hbox, true, true, containerPadding);
+ editor.AddOverlay (messageOverlayContent,() => openButton.SizeRequest ().Width + w + hbox.Spacing * 5 + containerPadding * 2);
- messageOverlayWindow.SizeFunc = () => openButton.SizeRequest ().Width + w + hbox.Spacing * 5 + containerPadding * 2;
openButton.Clicked += delegate {
var dlg = new OpenFileDialog (GettextCatalog.GetString ("File to Open"), MonoDevelop.Components.FileChooserAction.Open) {
TransientFor = IdeApp.Workbench.RootWindow,
@@ -161,15 +155,11 @@ namespace MonoDevelop.Debugger
}
}
- public override Gtk.Widget Control {
+ public override Control Control {
get {
return sw;
}
}
-
- public override void Load (string fileName)
- {
- }
public override bool IsFile {
get {
@@ -180,13 +170,15 @@ namespace MonoDevelop.Debugger
public void Update ()
{
autoRefill = false;
-
- editor.Document.RemoveMarker (currentDebugLineMarker);
+ if (currentDebugLineMarker != null) {
+ editor.RemoveMarker (currentDebugLineMarker);
+ currentDebugLineMarker = null;
+ }
if (DebuggingService.CurrentFrame == null) {
- if (messageOverlayWindow != null) {
- messageOverlayWindow.Destroy ();
- messageOverlayWindow = null;
+ if (messageOverlayContent != null) {
+ editor.RemoveOverlay (messageOverlayContent);
+ messageOverlayContent = null;
}
sw.Sensitive = false;
return;
@@ -197,9 +189,9 @@ namespace MonoDevelop.Debugger
if (!string.IsNullOrWhiteSpace (sf.SourceLocation.FileName) && sf.SourceLocation.Line != -1 && sf.SourceLocation.FileHash != null) {
ShowLoadSourceFile (sf);
} else {
- if (messageOverlayWindow != null) {
- messageOverlayWindow.Destroy ();
- messageOverlayWindow = null;
+ if (messageOverlayContent != null) {
+ editor.RemoveOverlay (messageOverlayContent);
+ messageOverlayContent = null;
}
}
if (!string.IsNullOrEmpty (sf.SourceLocation.FileName) && File.Exists (sf.SourceLocation.FileName))
@@ -223,7 +215,7 @@ namespace MonoDevelop.Debugger
}
currentFile = sf.SourceLocation.FileName;
addressLines.Clear ();
- editor.Document.Text = string.Empty;
+ editor.Text = string.Empty;
StreamReader sr = new StreamReader (sf.SourceLocation.FileName);
string line;
int sourceLine = 1;
@@ -239,9 +231,9 @@ namespace MonoDevelop.Debugger
}
sourceLine++;
}
- editor.Document.Text = sb.ToString ();
+ editor.Text = sb.ToString ();
foreach (int li in asmLineNums)
- editor.Document.AddMarker (li, asmMarker);
+ editor.AddMarker (li, asmMarker);
}
int aline;
if (!addressLines.TryGetValue (GetAddrId (sf.Address, sf.AddressSpace), out aline))
@@ -287,8 +279,8 @@ namespace MonoDevelop.Debugger
firstLine = -150;
lastLine = 150;
- editor.Document.MimeType = "text/plain";
- editor.Document.Text = string.Empty;
+ editor.MimeType = "text/plain";
+ editor.Text = string.Empty;
InsertLines (0, firstLine, lastLine, out firstLine, out lastLine);
autoRefill = true;
@@ -298,19 +290,23 @@ namespace MonoDevelop.Debugger
void UpdateCurrentLineMarker (bool moveCaret)
{
- editor.Document.RemoveMarker (currentDebugLineMarker);
+ if (currentDebugLineMarker != null) {
+ editor.RemoveMarker (currentDebugLineMarker);
+ currentDebugLineMarker = null;
+ }
StackFrame sf = DebuggingService.CurrentFrame;
int line;
if (addressLines.TryGetValue (GetAddrId (sf.Address, sf.AddressSpace), out line)) {
- editor.Document.AddMarker (line, currentDebugLineMarker);
+ var docLine = editor.GetLine (line);
+ currentDebugLineMarker = TextMarkerFactory.CreateCurrentDebugLineTextMarker (editor, docLine.Offset, docLine.Length);
+ editor.AddMarker (line, currentDebugLineMarker);
if (moveCaret) {
- editor.Caret.Line = line;
+ editor.CaretLine = line;
GLib.Timeout.Add (100, delegate {
editor.CenterToCaret ();
return false;
});
}
- editor.QueueDraw ();
}
}
@@ -332,8 +328,9 @@ namespace MonoDevelop.Debugger
if (!autoRefill || dragging)
return;
- DocumentLocation loc = editor.PointToLocation (0, 0);
- DocumentLocation loc2 = editor.PointToLocation (0, editor.Allocation.Height);
+ var loc = editor.PointToLocation (0, 0);
+ Gtk.Widget widget = editor;
+ var loc2 = editor.PointToLocation (0, widget.Allocation.Height);
//bool moveCaret = editor.Caret.Line >= loc.Line && editor.Caret.Line <= loc2.Line;
if (firstLine != int.MinValue && loc.Line < FillMarginLines) {
@@ -348,17 +345,17 @@ namespace MonoDevelop.Debugger
addressLines = newLines;
//if (moveCaret)
- editor.Caret.Line += num;
+ editor.CaretLine += num;
double hinc = num * editor.LineHeight;
sw.Vadjustment.Value += hinc;
UpdateCurrentLineMarker (false);
}
- if (lastLine != int.MinValue && loc2.Line >= editor.Document.LineCount - FillMarginLines) {
- int num = (loc2.Line - (editor.Document.LineCount - FillMarginLines) + 1) * 2;
+ if (lastLine != int.MinValue && loc2.Line >= editor.LineCount - FillMarginLines) {
+ int num = (loc2.Line - (editor.LineCount - FillMarginLines) + 1) * 2;
int newFirst;
- InsertLines (editor.Document.TextLength, lastLine + 1, lastLine + num, out newFirst, out lastLine);
+ InsertLines (editor.Length, lastLine + 1, lastLine + num, out newFirst, out lastLine);
}
}
@@ -383,15 +380,16 @@ namespace MonoDevelop.Debugger
lines.RemoveRange (j + 1, lines.Count - j - 1);
int lineCount = 0;
- int editorLine = editor.GetTextEditorData ().OffsetToLineNumber (offset);
+ int editorLine = editor.OffsetToLineNumber (offset);
foreach (AssemblyLine li in lines) {
if (li.IsOutOfRange)
continue;
InsertAssemblerLine (sb, editorLine++, li);
lineCount++;
}
- editor.Insert (offset, sb.ToString ());
- editor.Document.CommitUpdateAll ();
+ editor.IsReadOnly = false;
+ editor.InsertText (offset, sb.ToString ());
+ editor.IsReadOnly = true;
if (offset == 0)
this.cachedLines.InsertRange (0, lines);
else
@@ -403,13 +401,13 @@ namespace MonoDevelop.Debugger
{
addressLines.Clear ();
currentFile = null;
- if (messageOverlayWindow != null) {
- messageOverlayWindow.Destroy ();
- messageOverlayWindow = null;
+ if (messageOverlayContent != null) {
+ editor.RemoveOverlay (messageOverlayContent);
+ messageOverlayContent = null;
}
sw.Sensitive = false;
autoRefill = false;
- editor.Document.Text = string.Empty;
+ editor.Text = string.Empty;
cachedLines.Clear ();
}
@@ -453,7 +451,7 @@ namespace MonoDevelop.Debugger
void IClipboardHandler.Copy ()
{
- editor.RunAction (ClipboardActions.Copy);
+ editor.EditorActionHost.ClipboardCopy ();
}
void IClipboardHandler.Paste ()
@@ -468,7 +466,7 @@ namespace MonoDevelop.Debugger
void IClipboardHandler.SelectAll ()
{
- editor.RunAction (SelectionActions.SelectAll);
+ editor.EditorActionHost.SelectAll ();
}
bool IClipboardHandler.EnableCut {
@@ -476,7 +474,7 @@ namespace MonoDevelop.Debugger
}
bool IClipboardHandler.EnableCopy {
- get { return !editor.SelectionRange.IsEmpty; }
+ get { return !editor.IsSomethingSelected; }
}
bool IClipboardHandler.EnablePaste {
@@ -493,107 +491,4 @@ namespace MonoDevelop.Debugger
#endregion
}
-
- class AsmLineMarker: TextLineMarker
- {
- public override ChunkStyle GetStyle (ChunkStyle baseStyle)
- {
- ChunkStyle st = new ChunkStyle (baseStyle);
- st.Foreground = new Cairo.Color (125, 125, 125);
- return st;
- }
- }
-
- //Copy pasted from SourceEditor
- class OverlayMessageWindow : Gtk.EventBox
- {
- const int border = 8;
-
- public Func<int> SizeFunc;
-
- TextEditor textEditor;
-
- public OverlayMessageWindow ()
- {
- AppPaintable = true;
- }
-
- public void ShowOverlay (TextEditor textEditor)
- {
- this.textEditor = textEditor;
- this.ShowAll ();
- textEditor.AddTopLevelWidget (this, 0, 0);
- textEditor.SizeAllocated += HandleSizeAllocated;
- var child = (TextEditor.EditorContainerChild)textEditor [this];
- child.FixedPosition = true;
- }
-
- protected override void OnDestroyed ()
- {
- base.OnDestroyed ();
- if (textEditor != null) {
- textEditor.SizeAllocated -= HandleSizeAllocated;
- textEditor = null;
- }
- }
-
- protected override void OnSizeRequested (ref Requisition requisition)
- {
- base.OnSizeRequested (ref requisition);
-
- if (wRequest > 0) {
- requisition.Width = wRequest;
- }
- }
-
- protected override void OnSizeAllocated (Gdk.Rectangle allocation)
- {
- base.OnSizeAllocated (allocation);
- Resize (allocation);
- }
-
- int wRequest = -1;
-
- void HandleSizeAllocated (object o, Gtk.SizeAllocatedArgs args)
- {
- if (SizeFunc != null) {
- var req = Math.Min (SizeFunc (), textEditor.Allocation.Width - border * 2);
- if (req != wRequest) {
- wRequest = req;
- QueueResize ();
- }
- } else {
- if (Allocation.Width > textEditor.Allocation.Width - border * 2) {
- if (textEditor.Allocation.Width - border * 2 > 0) {
- QueueResize ();
- }
- }
- }
- Resize (Allocation);
- }
-
- void Resize (Gdk.Rectangle alloc)
- {
- textEditor.MoveTopLevelWidget (this, (textEditor.Allocation.Width - alloc.Width) / 2, textEditor.Allocation.Height - alloc.Height - 8);
- }
-
- protected override bool OnExposeEvent (Gdk.EventExpose evnt)
- {
- using (var cr = CairoHelper.Create (evnt.Window)) {
- cr.LineWidth = 1;
- cr.Rectangle (0, 0, Allocation.Width, Allocation.Height);
- cr.SetSourceColor (textEditor.ColorStyle.NotificationText.Background);
- cr.Fill ();
- cr.RoundedRectangle (0, 0, Allocation.Width, Allocation.Height, 3);
- cr.SetSourceColor (textEditor.ColorStyle.NotificationText.Background);
- cr.FillPreserve ();
-
- cr.SetSourceColor (textEditor.ColorStyle.NotificationBorder.Color);
- cr.Stroke ();
- }
-
- return base.OnExposeEvent (evnt);
- }
-
- }
}
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs
index 779c3da033..da38a4f745 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExceptionCaughtDialog.cs
@@ -38,12 +38,12 @@ using MonoDevelop.Core;
using MonoDevelop.Components;
using MonoDevelop.Ide.TextEditing;
using MonoDevelop.Ide.Gui.Content;
-using Mono.TextEditor;
+using MonoDevelop.Ide.Editor.Extension;
using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.Debugger
{
- class ExceptionCaughtDialog : Dialog
+ class ExceptionCaughtDialog : Gtk.Dialog
{
static readonly Xwt.Drawing.Image WarningIconPixbuf = Xwt.Drawing.Image.FromResource ("toolbar-icon.png");
static readonly Xwt.Drawing.Image WarningIconPixbufInner = Xwt.Drawing.Image.FromResource ("exception-outline-16.png");
@@ -74,6 +74,7 @@ namespace MonoDevelop.Debugger
public ExceptionCaughtDialog (ExceptionInfo ex, ExceptionCaughtMessage msg)
{
this.Name = "wizard_dialog";
+ this.ApplyTheme ();
selected = exception = ex;
message = msg;
@@ -132,6 +133,7 @@ namespace MonoDevelop.Debugger
{
ExceptionValueTreeView = new ObjectValueTreeView ();
ExceptionValueTreeView.Frame = DebuggingService.CurrentFrame;
+ ExceptionValueTreeView.ModifyBase (StateType.Normal, Styles.ExceptionCaughtDialog.TreeBackgroundColor.ToGdkColor ());
ExceptionValueTreeView.AllowPopupMenu = false;
ExceptionValueTreeView.AllowExpanding = true;
ExceptionValueTreeView.AllowPinning = false;
@@ -794,7 +796,7 @@ namespace MonoDevelop.Debugger
dlg.Line = Line;
}
- public override Widget CreateWidget ()
+ public override Control CreateWidget ()
{
var icon = Xwt.Drawing.Image.FromResource ("lightning-16.png");
var image = new Xwt.ImageView (icon).ToGtkWidget ();
@@ -888,7 +890,7 @@ namespace MonoDevelop.Debugger
dlg.Line = Line;
}
- public override Widget CreateWidget ()
+ public override Control CreateWidget ()
{
var box = new EventBox ();
box.VisibleWindow = false;
@@ -908,17 +910,17 @@ namespace MonoDevelop.Debugger
class ExceptionCaughtTextEditorExtension : TextEditorExtension
{
- public override bool KeyPress (Gdk.Key key, char keyChar, Gdk.ModifierType modifier)
+ public override bool KeyPress (KeyDescriptor descriptor)
{
- if (key == Gdk.Key.Escape && DebuggingService.ExceptionCaughtMessage != null &&
+ if (descriptor.SpecialKey == SpecialKey.Escape && DebuggingService.ExceptionCaughtMessage != null &&
!DebuggingService.ExceptionCaughtMessage.IsMinimized &&
- DebuggingService.ExceptionCaughtMessage.File.CanonicalPath == Document.FileName.CanonicalPath) {
+ DebuggingService.ExceptionCaughtMessage.File.CanonicalPath == new FilePath(DocumentContext.Name).CanonicalPath) {
DebuggingService.ExceptionCaughtMessage.ShowMiniButton ();
return true;
}
- return base.KeyPress (key, keyChar, modifier);
+ return base.KeyPress (descriptor);
}
}
}
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExpressionEvaluatorDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExpressionEvaluatorDialog.cs
index 2a2f7e93dd..f35088bf82 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExpressionEvaluatorDialog.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ExpressionEvaluatorDialog.cs
@@ -28,6 +28,7 @@
using System;
using MonoDevelop.Ide.CodeCompletion;
using Gtk;
+using MonoDevelop.Ide.Editor.Extension;
namespace MonoDevelop.Debugger
{
@@ -112,7 +113,7 @@ namespace MonoDevelop.Debugger
if (keyHandled)
return;
- CompletionWindowManager.PostProcessKeyEvent (key, keyChar, modifier);
+ CompletionWindowManager.PostProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifier));
PopupCompletion ((Entry) sender);
}
@@ -131,7 +132,7 @@ namespace MonoDevelop.Debugger
}
if (currentCompletionData != null)
- args.RetVal = keyHandled = CompletionWindowManager.PreProcessKeyEvent (key, keyChar, modifier);
+ args.RetVal = keyHandled = CompletionWindowManager.PreProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifier));
}
void OnEditFocusOut (object sender, FocusOutEventArgs args)
@@ -181,6 +182,9 @@ namespace MonoDevelop.Debugger
get {
return entry.Position;
}
+ set {
+ entry.Position = value;
+ }
}
char ICompletionWidget.GetChar (int offset)
@@ -255,6 +259,12 @@ namespace MonoDevelop.Debugger
return entry.Style;
}
}
+
+ double ICompletionWidget.ZoomLevel {
+ get {
+ return 1;
+ }
+ }
#endregion
}
}
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Extensions.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Extensions.cs
index 8ce3fe3f98..c1a7fac6ae 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Extensions.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Extensions.cs
@@ -32,6 +32,7 @@ using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Projects;
using System.Collections.Generic;
+using System.Threading.Tasks;
namespace MonoDevelop.Debugger
{
@@ -39,50 +40,51 @@ namespace MonoDevelop.Debugger
{
public static bool CanDebug (this ProjectOperations opers, IBuildTarget entry)
{
- ExecutionContext context = new ExecutionContext (DebuggingService.GetExecutionHandler (), IdeApp.Workbench.ProgressMonitors, IdeApp.Workspace.ActiveExecutionTarget);
+ ExecutionContext context = new ExecutionContext (DebuggingService.GetExecutionHandler (), IdeApp.Workbench.ProgressMonitors.ConsoleFactory, IdeApp.Workspace.ActiveExecutionTarget);
return opers.CanExecute (entry, context);
}
- public static IAsyncOperation Debug (this ProjectOperations opers, IBuildTarget entry)
+ public static AsyncOperation Debug (this ProjectOperations opers, IBuildTarget entry, bool buildBeforeExecuting = true)
{
if (opers.CurrentRunOperation != null && !opers.CurrentRunOperation.IsCompleted)
return opers.CurrentRunOperation;
- ExecutionContext context = new ExecutionContext (DebuggingService.GetExecutionHandler (), IdeApp.Workbench.ProgressMonitors, IdeApp.Workspace.ActiveExecutionTarget);
+ ExecutionContext context = new ExecutionContext (DebuggingService.GetExecutionHandler (), IdeApp.Workbench.ProgressMonitors.ConsoleFactory, IdeApp.Workspace.ActiveExecutionTarget);
- IAsyncOperation op = opers.Execute (entry, context);
+ AsyncOperation op = opers.Execute (entry, context, buildBeforeExecuting);
return op;
}
public static bool CanDebugFile (this ProjectOperations opers, string file)
{
- var context = new ExecutionContext (DebuggingService.GetExecutionHandler (), IdeApp.Workbench.ProgressMonitors, IdeApp.Workspace.ActiveExecutionTarget);
+ var context = new ExecutionContext (DebuggingService.GetExecutionHandler (), IdeApp.Workbench.ProgressMonitors.ConsoleFactory, IdeApp.Workspace.ActiveExecutionTarget);
return opers.CanExecuteFile (file, context);
}
- public static IAsyncOperation DebugFile (this ProjectOperations opers, string file)
+ public static AsyncOperation DebugFile (this ProjectOperations opers, string file)
{
- var context = new ExecutionContext (DebuggingService.GetExecutionHandler (), IdeApp.Workbench.ProgressMonitors, IdeApp.Workspace.ActiveExecutionTarget);
+ var context = new ExecutionContext (DebuggingService.GetExecutionHandler (), IdeApp.Workbench.ProgressMonitors.ConsoleFactory, IdeApp.Workspace.ActiveExecutionTarget);
return opers.ExecuteFile (file, context);
}
- public static IAsyncOperation DebugApplication (this ProjectOperations opers, string executableFile, string args, string workingDir, IDictionary<string,string> envVars)
+ public static AsyncOperation DebugApplication (this ProjectOperations opers, string executableFile, string args, string workingDir, IDictionary<string,string> envVars)
{
if (opers.CurrentRunOperation != null && !opers.CurrentRunOperation.IsCompleted)
return opers.CurrentRunOperation;
var monitor = IdeApp.Workbench.ProgressMonitors.GetRunProgressMonitor ();
- var oper = DebuggingService.Run (executableFile, args, workingDir, envVars, (IConsole) monitor);
- oper.Completed += delegate {
+ var oper = DebuggingService.Run (executableFile, args, workingDir, envVars, monitor.Console);
+ opers.CurrentRunOperation = oper;
+
+ oper.Task.ContinueWith (t => {
monitor.Dispose ();
- };
+ });
- opers.CurrentRunOperation = monitor.AsyncOperation;
- return opers.CurrentRunOperation;
+ return oper;
}
- public static IAsyncOperation AttachToProcess (this ProjectOperations opers, DebuggerEngine debugger, ProcessInfo proc)
+ public static AsyncOperation AttachToProcess (this ProjectOperations opers, DebuggerEngine debugger, ProcessInfo proc)
{
if (opers.CurrentRunOperation != null && !opers.CurrentRunOperation.IsCompleted)
return opers.CurrentRunOperation;
@@ -92,15 +94,5 @@ namespace MonoDevelop.Debugger
opers.CurrentRunOperation = oper;
return opers.CurrentRunOperation;
}
-
- public static IAsyncOperation Debug (this Document doc)
- {
- return IdeApp.ProjectOperations.DebugFile (doc.FileName);
- }
-
- public static bool CanDebug (this Document doc)
- {
- return doc.FileName != FilePath.Null && IdeApp.ProjectOperations.CanDebugFile (doc.FileName);
- }
}
}
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/IDebuggerExpressionResolver.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/IDebuggerExpressionResolver.cs
index 5844aa54ae..a2009111f0 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/IDebuggerExpressionResolver.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/IDebuggerExpressionResolver.cs
@@ -26,13 +26,33 @@
using System;
-using Mono.TextEditor;
using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide.Editor;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.Text;
+using System.Threading;
namespace MonoDevelop.Debugger
{
+ public struct DebugDataTipInfo
+ {
+ public readonly TextSpan Span;
+ public readonly string Text;
+
+ public DebugDataTipInfo (TextSpan span, string text)
+ {
+ this.Span = span;
+ this.Text = text;
+ }
+
+ public bool IsDefault
+ {
+ get { return Span.Length == 0 && Span.Start == 0 && Text == null; }
+ }
+ }
+
public interface IDebuggerExpressionResolver
{
- string ResolveExpression (TextEditorData editor, Document doc, int offset, out int startOffset);
+ Task<DebugDataTipInfo> ResolveExpressionAsync (IReadonlyTextDocument editor, DocumentContext doc, int offset, CancellationToken cancellationToken);
}
}
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ImmediatePad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ImmediatePad.cs
index dd5ac17ce9..1b5489e8f8 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ImmediatePad.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ImmediatePad.cs
@@ -37,13 +37,13 @@ using MonoDevelop.Components;
namespace MonoDevelop.Debugger
{
- public class ImmediatePad: IPadContent
+ public class ImmediatePad: PadContent
{
static readonly object mutex = new object();
DebuggerConsoleView view;
readonly List<uint> timersList = new List<uint>();
- public void Initialize (IPadWindow container)
+ protected override void Initialize (IPadWindow container)
{
view = new DebuggerConsoleView ();
view.ConsoleInput += OnViewConsoleInput;
@@ -263,21 +263,18 @@ namespace MonoDevelop.Debugger
});
}
- public void RedrawContent ()
- {
- }
-
- public Gtk.Widget Control {
+ public override Control Control {
get {
return view;
}
}
- public void Dispose ()
+ public override void Dispose ()
{
DebuggingService.PausedEvent -= DebuggerPaused;
DebuggingService.ResumedEvent -= DebuggerResumed;
DebuggingService.StoppedEvent -= DebuggerStopped;
+ base.Dispose ();
}
void DebuggerResumed (object sender, EventArgs e)
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/InfoFrame.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/InfoFrame.cs
index ca2cebd26b..882f54980b 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/InfoFrame.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/InfoFrame.cs
@@ -1,33 +1,34 @@
-//
-// InfoFrame.cs
-//
-// Author:
-// Jeffrey Stedfast <jeff@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
+//
+// InfoFrame.cs
+//
+// Author:
+// Jeffrey Stedfast <jeff@xamarin.com>
+//
+// Copyright (c) 2013 Xamarin Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
using System;
using Gtk;
-
+using MonoDevelop.Components;
+
namespace MonoDevelop.Debugger
{
[System.ComponentModel.ToolboxItem (true)]
@@ -49,10 +50,10 @@ namespace MonoDevelop.Debugger
cr.Rectangle (Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height);
cr.ClipPreserve ();
- cr.SetSourceRGB (1.00, 0.98, 0.91);
+ cr.SetSourceColor (Styles.ExceptionCaughtDialog.InfoFrameBackgroundColor.ToCairoColor ());
cr.FillPreserve ();
- cr.SetSourceRGB (0.87, 0.83, 0.74);
+ cr.SetSourceColor (Styles.ExceptionCaughtDialog.InfoFrameBorderColor.ToCairoColor ());
cr.LineWidth = 2;
cr.Stroke ();
}
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Initializer.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Initializer.cs
index 530207a977..34a83ac4ab 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Initializer.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Initializer.cs
@@ -126,8 +126,10 @@ namespace MonoDevelop.Debugger
if (!sf.IsExternalCode &&
sf.SourceLocation.Line != -1 &&
!string.IsNullOrEmpty (sf.SourceLocation.FileName) &&
- //Uncomment condition below once logic for ProjectOnlyCode in runtime is fixed
- (/*DebuggingService.CurrentSessionSupportsFeature (DebuggerFeatures.Disassembly) ||*/ System.IO.File.Exists (sf.SourceLocation.FileName))) {
+ //Uncomment condition below once logic for ProjectOnlyCode in runtime is fixed
+ (/*DebuggingService.CurrentSessionSupportsFeature (DebuggerFeatures.Disassembly) ||*/
+ System.IO.File.Exists (sf.SourceLocation.FileName) ||
+ SourceCodeLookup.FindSourceFile (sf.SourceLocation.FileName, sf.SourceLocation.FileHash).IsNotNull)) {
if (n != DebuggingService.CurrentFrameIndex)
DebuggingService.CurrentFrameIndex = n;
break;
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/LocalsPad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/LocalsPad.cs
index feb6d9c0c3..e0c66098b2 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/LocalsPad.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/LocalsPad.cs
@@ -49,7 +49,7 @@ namespace MonoDevelop.Debugger
if (frame == null)
return;
- tree.ClearAll ();
+ tree.ClearValues ();
tree.AddValues (frame.GetAllLocals ().Where (l => !string.IsNullOrWhiteSpace (l.Name) && l.Name != "?").ToArray ());
}
}
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValuePad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValuePad.cs
index 1a5f3dcf5e..eb6217ecec 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValuePad.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValuePad.cs
@@ -29,20 +29,20 @@ using System;
using Gtk;
using MonoDevelop.Ide.Gui;
using Mono.Debugging.Client;
+using MonoDevelop.Components;
namespace MonoDevelop.Debugger
{
- public class ObjectValuePad: IPadContent
+ public class ObjectValuePad: PadContent
{
protected ObjectValueTreeView tree;
readonly ScrolledWindow scrolled;
bool needsUpdate;
- IPadWindow container;
bool initialResume;
StackFrame lastFrame;
PadFontChanger fontChanger;
- public Gtk.Widget Control {
+ public override Control Control {
get {
return scrolled;
}
@@ -76,7 +76,7 @@ namespace MonoDevelop.Debugger
initialResume = !DebuggingService.IsDebugging;
}
- public void Dispose ()
+ public override void Dispose ()
{
if (fontChanger == null)
return;
@@ -88,21 +88,17 @@ namespace MonoDevelop.Debugger
DebuggingService.ResumedEvent -= OnDebuggerResumed;
DebuggingService.StoppedEvent -= OnDebuggerStopped;
DebuggingService.EvaluationOptionsChanged -= OnEvaluationOptionsChanged;
+ base.Dispose ();
}
- public void Initialize (IPadWindow container)
+ protected override void Initialize (IPadWindow container)
{
- this.container = container;
container.PadContentShown += delegate {
if (needsUpdate)
OnUpdateList ();
};
}
- public void RedrawContent ()
- {
- }
-
public virtual void OnUpdateList ()
{
needsUpdate = false;
@@ -113,7 +109,7 @@ namespace MonoDevelop.Debugger
protected virtual void OnFrameChanged (object s, EventArgs a)
{
- if (container != null && container.ContentVisible)
+ if (Window != null && Window.ContentVisible)
OnUpdateList ();
else
needsUpdate = true;
@@ -144,7 +140,7 @@ namespace MonoDevelop.Debugger
{
if (!DebuggingService.IsRunning) {
lastFrame = null;
- if (container != null && container.ContentVisible)
+ if (Window != null && Window.ContentVisible)
OnUpdateList ();
else
needsUpdate = true;
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs
index da3940e4b1..5a864961fd 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValueTreeView.cs
@@ -39,9 +39,9 @@ using MonoDevelop.Ide;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.Commands;
-using Mono.TextEditor;
+using MonoDevelop.Ide.Editor.Extension;
using System.Linq;
-
+using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.Debugger
{
@@ -90,10 +90,6 @@ namespace MonoDevelop.Debugger
readonly TreeViewColumn typeCol;
readonly TreeViewColumn pinCol;
- const string errorColor = "red";
- const string modifiedColor = "blue";
- const string disabledColor = "gray";
-
static readonly CommandEntrySet menuSet;
const int NameColumn = 0;
@@ -168,7 +164,7 @@ namespace MonoDevelop.Debugger
if (!icon.IsNull) {
using (var ctx = Gdk.CairoHelper.Create (window)) {
using (var layout = new Pango.Layout (widget.PangoContext)) {
- layout.FontDescription = FontDesc.Copy ();
+ layout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11);
layout.FontDescription.Family = Family;
layout.SetText (Text);
int w, h;
@@ -192,7 +188,7 @@ namespace MonoDevelop.Debugger
Uri uri;
if (value != null && Uri.TryCreate (value.Trim ('"', '{', '}'), UriKind.Absolute, out uri) && (uri.Scheme == "http" || uri.Scheme == "https")) {
Underline = Pango.Underline.Single;
- Foreground = "#197CEF";
+ Foreground = Ide.Gui.Styles.LinkForegroundColor.ToHexString (false);
} else {
Underline = Pango.Underline.None;
}
@@ -256,9 +252,9 @@ namespace MonoDevelop.Debugger
cell_area.Height - TopBottomPadding * 2 - 1,
(cell_area.Height - (TopBottomPadding * 2)) / 2);
cr.LineWidth = 1;
- cr.SetSourceRGB (233 / 255.0, 242 / 255.0, 252 / 255.0);
+ cr.SetSourceColor (Styles.ObjectValueTreeValuesButtonBackground.ToCairoColor ());
cr.FillPreserve ();
- cr.SetSourceRGB (82 / 255.0, 148 / 255.0, 235 / 255.0);
+ cr.SetSourceColor (Styles.ObjectValueTreeValuesButtonBorder.ToCairoColor ());
cr.Stroke ();
int YOffset = (cell_area.Height - h) / 2;
@@ -267,7 +263,7 @@ namespace MonoDevelop.Debugger
window.DrawLayoutWithColors (widget.Style.TextGC (StateType.Normal),
cell_area.X + (cell_area.Height - TopBottomPadding * 2 + 1) / 2 + xpad,
cell_area.Y + YOffset,
- layout, new Gdk.Color (82, 148, 235), new Gdk.Color (233, 242, 252));
+ layout, Styles.ObjectValueTreeValuesButtonText.ToGdkColor(), Styles.ObjectValueTreeValuesButtonBackground.ToGdkColor());
}
}
}
@@ -302,11 +298,10 @@ namespace MonoDevelop.Debugger
Selection.Mode = Gtk.SelectionMode.Multiple;
Selection.Changed += HandleSelectionChanged;
ResetColumnSizes ();
-
- Pango.FontDescription newFont = Style.FontDescription.Copy ();
- newFont.Size = (newFont.Size * 8) / 10;
- liveIcon = ImageService.GetIcon (Stock.Execute, IconSize.Menu);
+ Pango.FontDescription newFont = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11);
+
+ liveIcon = ImageService.GetIcon ("md-live", IconSize.Menu);
noLiveIcon = liveIcon.WithAlpha (0.5);
expCol = new TreeViewColumn ();
@@ -474,8 +469,6 @@ namespace MonoDevelop.Debugger
}
}
- Dictionary<TreeIter, bool> evalSpinnersIcons = new Dictionary<TreeIter, bool>();
-
void HandleSelectionChanged (object sender, EventArgs e)
{
if (!currentHoverIter.Equals (TreeIter.Zero) && store.IterIsValid (currentHoverIter)) {
@@ -485,25 +478,21 @@ namespace MonoDevelop.Debugger
SetPreviewButtonIcon (iconBeforeSelected, currentHoverIter);
}
}
- foreach (var s in evalSpinnersIcons.ToArray()) {
- if (store.IterIsValid (s.Key) && Selection.IterIsSelected (s.Key)) {
- if (!s.Value) {
- store.LoadIcon (s.Key, EvaluateStatusIconColumn, "md-spinner-selected-16", IconSize.Menu);
- evalSpinnersIcons [s.Key] = true;
- }
- } else {
- if (s.Value) {
- store.LoadIcon (s.Key, EvaluateStatusIconColumn, "md-spinner-normal-16", IconSize.Menu);
- evalSpinnersIcons [s.Key] = false;
- }
- }
- }
}
+ Adjustment oldHadjustment;
+ Adjustment oldVadjustment;
+ //Don't convert this event handler to override OnSetScrollAdjustments as it causes problems
void HandleScrollAdjustmentsSet (object o, ScrollAdjustmentsSetArgs args)
{
- Hadjustment.ValueChanged += UpdatePreviewPosition;
- Vadjustment.ValueChanged += UpdatePreviewPosition;
+ if (oldHadjustment != null) {
+ oldHadjustment.ValueChanged -= UpdatePreviewPosition;
+ oldVadjustment.ValueChanged -= UpdatePreviewPosition;
+ }
+ oldHadjustment = Hadjustment;
+ oldVadjustment = Vadjustment;
+ oldHadjustment.ValueChanged += UpdatePreviewPosition;
+ oldVadjustment.ValueChanged += UpdatePreviewPosition;
}
void UpdatePreviewPosition (object sender, EventArgs e)
@@ -560,8 +549,13 @@ namespace MonoDevelop.Debugger
valueCol.RemoveNotification ("width", OnColumnWidthChanged);
expCol.RemoveNotification ("width", OnColumnWidthChanged);
- Hadjustment.ValueChanged -= UpdatePreviewPosition;
- Vadjustment.ValueChanged -= UpdatePreviewPosition;
+ ScrollAdjustmentsSet -= HandleScrollAdjustmentsSet;
+ if (oldHadjustment != null) {
+ oldHadjustment.ValueChanged -= UpdatePreviewPosition;
+ oldVadjustment.ValueChanged -= UpdatePreviewPosition;
+ oldHadjustment = null;
+ oldVadjustment = null;
+ }
values.Clear ();
valueNames.Clear ();
@@ -747,12 +741,11 @@ namespace MonoDevelop.Debugger
compact = value;
Pango.FontDescription newFont;
if (compact) {
- newFont = Style.FontDescription.Copy ();
- newFont.Size = (newFont.Size * 8) / 10;
+ newFont = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11);
valueCol.MaxWidth = 800;
crpViewer.Image = ImageService.GetIcon (Stock.Edit).WithSize (12,12);
} else {
- newFont = Style.FontDescription;
+ newFont = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale12);
valueCol.MaxWidth = int.MaxValue;
}
typeCol.Visible = !compact;
@@ -888,7 +881,7 @@ namespace MonoDevelop.Debugger
ShowExpanders = true;
if (AllowAdding)
- store.AppendValues (createMsg, "", "", null, true, true, null, disabledColor, disabledColor);
+ store.AppendValues (createMsg, "", "", null, true, true, null, Ide.Gui.Styles.ColorGetHex (Styles.ObjectValueTreeValueDisabledText), Ide.Gui.Styles.ColorGetHex (Styles.ObjectValueTreeValueDisabledText));
LoadState ();
}
@@ -1135,7 +1128,7 @@ namespace MonoDevelop.Debugger
if (val.IsUnknown) {
if (frame != null) {
strval = GettextCatalog.GetString ("The name '{0}' does not exist in the current context.", val.Name);
- nameColor = disabledColor;
+ nameColor = Ide.Gui.Styles.ColorGetHex (Styles.ObjectValueTreeValueDisabledText);
canEdit = false;
} else {
canEdit = !val.IsReadOnly;
@@ -1148,27 +1141,22 @@ namespace MonoDevelop.Debugger
int i = strval.IndexOf ('\n');
if (i != -1)
strval = strval.Substring (0, i);
- valueColor = errorColor;
+ valueColor = Ide.Gui.Styles.ColorGetHex (Styles.ObjectValueTreeValueErrorText);
canEdit = false;
} else if (val.IsNotSupported) {
strval = "";//val.Value; with new "Show Value" button we don't want to display message "Implicit evaluation is disabled"
- valueColor = disabledColor;
+ valueColor = Ide.Gui.Styles.ColorGetHex (Styles.ObjectValueTreeValueDisabledText);
if (val.CanRefresh)
valueButton = GettextCatalog.GetString ("Show Value");
canEdit = false;
} else if (val.IsEvaluating) {
strval = GettextCatalog.GetString ("Evaluating...");
- if (Selection.IterIsSelected (it)) {
- evalSpinnersIcons [it] = true;
- evaluateStatusIcon = "md-spinner-selected-16";
- } else {
- evalSpinnersIcons [it] = false;
- evaluateStatusIcon = "md-spinner-normal-16";
- }
- valueColor = disabledColor;
+ evaluateStatusIcon = "md-spinner-16";
+
+ valueColor = Ide.Gui.Styles.ColorGetHex (Styles.ObjectValueTreeValueDisabledText);
if (val.IsEvaluatingGroup) {
- nameColor = disabledColor;
+ nameColor = Ide.Gui.Styles.ColorGetHex (Styles.ObjectValueTreeValueDisabledText);
name = val.Name;
}
canEdit = false;
@@ -1193,7 +1181,7 @@ namespace MonoDevelop.Debugger
strval = val.DisplayValue ?? "(null)";
}
if (oldValue != null && strval != oldValue)
- nameColor = valueColor = modifiedColor;
+ nameColor = valueColor = Ide.Gui.Styles.ColorGetHex (Styles.ObjectValueTreeValueModifiedText);
}
strval = strval.Replace ("\r\n", " ").Replace ("\n", " ");
@@ -1209,9 +1197,6 @@ namespace MonoDevelop.Debugger
store.SetValue (it, IconColumn, icon);
store.SetValue (it, NameColorColumn, nameColor);
store.SetValue (it, ValueColorColumn, valueColor);
- if (evaluateStatusIcon != "md-spinner-normal-16" && evaluateStatusIcon != "md-spinner-selected-16") {
- evalSpinnersIcons.Remove (it);
- }
store.SetValue (it, EvaluateStatusIconVisibleColumn, evaluateStatusIcon != null);
store.LoadIcon (it, EvaluateStatusIconColumn, evaluateStatusIcon, IconSize.Menu);
store.SetValue (it, ValueButtonVisibleColumn, valueButton != null);
@@ -1496,7 +1481,7 @@ namespace MonoDevelop.Debugger
string oldValue;
if (oldValues.TryGetValue (valPath, out oldValue)) {
if (oldValue != val.Value)
- newColor = modifiedColor;
+ newColor = Ide.Gui.Styles.ColorGetHex (Styles.ObjectValueTreeValueModifiedText);
}
store.SetValue (it, NameColorColumn, newColor);
@@ -1533,7 +1518,7 @@ namespace MonoDevelop.Debugger
void OnEditKeyRelease (object sender, EventArgs e)
{
if (!wasHandled) {
- CompletionWindowManager.PostProcessKeyEvent (key, keyChar, modifierState);
+ CompletionWindowManager.PostProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifierState));
PopupCompletion ((Entry) sender);
}
}
@@ -1555,7 +1540,7 @@ namespace MonoDevelop.Debugger
keyValue = args.Event.KeyValue;
if (currentCompletionData != null) {
- wasHandled = CompletionWindowManager.PreProcessKeyEvent (key, keyChar, modifierState);
+ wasHandled = CompletionWindowManager.PreProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifierState));
args.RetVal = wasHandled;
}
}
@@ -1738,10 +1723,10 @@ namespace MonoDevelop.Debugger
void CleanPinIcon ()
{
- if (!lastPinIter.Equals (TreeIter.Zero)) {
+ if (!lastPinIter.Equals (TreeIter.Zero) && store.IterIsValid (lastPinIter)) {
store.SetValue (lastPinIter, PinIconColumn, null);
- lastPinIter = TreeIter.Zero;
}
+ lastPinIter = TreeIter.Zero;
}
protected override bool OnLeaveNotifyEvent (Gdk.EventCrossing evnt)
@@ -1853,9 +1838,8 @@ namespace MonoDevelop.Debugger
TreePath path;
bool closePreviewWindow = true;
- if (CanQueryDebugger && evnt.Button == 1 && GetCellAtPos ((int)evnt.X, (int)evnt.Y, out path, out col, out cr)) {
- TreeIter it;
- store.GetIter (out it, path);
+ TreeIter it;
+ if (CanQueryDebugger && evnt.Button == 1 && GetCellAtPos ((int)evnt.X, (int)evnt.Y, out path, out col, out cr) && store.GetIter (out it, path)) {
if (cr == crpViewer) {
var val = (ObjectValue)store.GetValue (it, ObjectColumn);
DebuggingService.ShowValueVisualizer (val);
@@ -2245,7 +2229,13 @@ namespace MonoDevelop.Debugger
return ((ICompletionWidget)this).CreateCodeCompletionContext (editEntry.Position);
}
}
-
+
+ public double ZoomLevel {
+ get {
+ return 1;
+ }
+ }
+
public event EventHandler CompletionContextChanged;
protected virtual void OnCompletionContextChanged (EventArgs e)
@@ -2280,6 +2270,9 @@ namespace MonoDevelop.Debugger
get {
return editEntry.Position;
}
+ set {
+ editEntry.Position = value;
+ }
}
char ICompletionWidget.GetChar (int offset)
@@ -2352,6 +2345,7 @@ namespace MonoDevelop.Debugger
return editEntry.Style;
}
}
+
#endregion
ObjectValue[] GetValues (string[] names)
@@ -2401,8 +2395,9 @@ namespace MonoDevelop.Debugger
}
}
- class DebugCompletionDataList: List<ICSharpCode.NRefactory.Completion.ICompletionData>, ICompletionDataList
+ class DebugCompletionDataList: List<MonoDevelop.Ide.CodeCompletion.CompletionData>, ICompletionDataList
{
+ public int TriggerWordLength { get; set; }
public bool IsSorted { get; set; }
public DebugCompletionDataList (Mono.Debugging.Client.CompletionData data)
{
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/PinnedWatchStore.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/PinnedWatchStore.cs
index 4d9bc48f2f..52ac37e34e 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/PinnedWatchStore.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/PinnedWatchStore.cs
@@ -272,7 +272,7 @@ namespace MonoDevelop.Debugger
batchChanged.Add (watch);
return;
}
- DispatchService.GuiDispatch (() => {
+ Runtime.RunInMainThread (() => {
if (WatchChanged != null)
WatchChanged (this, new PinnedWatchEventArgs (watch));
});
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs
index 97164a0ca5..3e46fd0f6d 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs
@@ -45,7 +45,29 @@ using System.Linq;
namespace MonoDevelop.Debugger
{
- public class StackTracePad : ScrolledWindow, IPadContent
+ public class StackTracePad : PadContent
+ {
+ StackTracePadWidget control;
+
+ public StackTracePad ()
+ {
+ Id = "MonoDevelop.Debugger.StackTracePad";
+ control = new StackTracePadWidget ();
+ }
+
+ protected override void Initialize (IPadWindow window)
+ {
+ control.Initialize (window);
+ }
+
+ public override Control Control {
+ get {
+ return control;
+ }
+ }
+ }
+
+ public class StackTracePadWidget : ScrolledWindow
{
const int IconColumn = 0;
const int MethodColumn = 1;
@@ -62,9 +84,9 @@ namespace MonoDevelop.Debugger
IPadWindow window;
bool needsUpdate;
- static Xwt.Drawing.Image pointerImage = Xwt.Drawing.Image.FromResource ("stack-pointer-16.png");
+ static Xwt.Drawing.Image pointerImage = ImageService.GetIcon ("md-stack-pointer", IconSize.Menu);
- public StackTracePad ()
+ public StackTracePadWidget ()
{
this.ShadowType = ShadowType.None;
@@ -189,7 +211,7 @@ namespace MonoDevelop.Debugger
return !value.Contains (key);
}
- void IPadContent.Initialize (IPadWindow window)
+ public void Initialize (IPadWindow window)
{
this.window = window;
window.PadContentShown += delegate {
@@ -344,25 +366,6 @@ namespace MonoDevelop.Debugger
ActivateFrame ();
}
- public Widget Control {
- get {
- return this;
- }
- }
-
- public string Id {
- get { return "MonoDevelop.Debugger.StackTracePad"; }
- }
-
- public string DefaultPlacement {
- get { return "Bottom"; }
- }
-
- public void RedrawContent ()
- {
- UpdateDisplay ();
- }
-
void ShowPopup (Gdk.EventButton evt)
{
var context_menu = new ContextMenu ();
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Styles.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Styles.cs
new file mode 100644
index 0000000000..d4f4f51226
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/Styles.cs
@@ -0,0 +1,104 @@
+//
+// Styles.cs
+//
+// Author:
+// Vsevolod Kukol <sevo@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using MonoDevelop.Ide;
+using Xwt.Drawing;
+
+namespace MonoDevelop.Debugger
+{
+ public static class Styles
+ {
+ public static Color ObjectValueTreeValuesButtonBackground { get; internal set; }
+ public static Color ObjectValueTreeValuesButtonText { get; internal set; }
+ public static Color ObjectValueTreeValuesButtonBorder { get; internal set; }
+ public static Color ObjectValueTreeValueErrorText { get; internal set; }
+ public static Color ObjectValueTreeValueDisabledText { get; internal set; }
+ public static Color ObjectValueTreeValueModifiedText { get; internal set; }
+ public static Color PreviewVisualizerBackgroundColor { get; internal set; }
+ public static Color PreviewVisualizerTextColor { get; internal set; }
+ public static Color PreviewVisualizerHeaderTextColor { get; internal set; }
+
+ public static ExceptionCaughtDialogStyle ExceptionCaughtDialog { get; internal set; }
+
+ public class ExceptionCaughtDialogStyle
+ {
+ public Color TreeBackgroundColor { get; internal set; }
+ public Color InfoFrameBackgroundColor { get; internal set; }
+ public Color InfoFrameBorderColor { get; internal set; }
+ public Color LineNumberBackgroundColor { get; internal set; }
+ public Color LineNumberInUserCodeBackgroundColor { get; internal set; }
+ public Color LineNumberTextColor { get; internal set; }
+ }
+
+ static Styles ()
+ {
+ LoadStyles ();
+ Ide.Gui.Styles.Changed += (o, e) => LoadStyles ();
+ }
+
+ public static void LoadStyles ()
+ {
+ ExceptionCaughtDialog = new ExceptionCaughtDialogStyle ();
+
+ if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light) {
+ ObjectValueTreeValuesButtonBackground = Color.FromName ("#e9f2fc");
+ ObjectValueTreeValuesButtonText = Color.FromName ("#5294eb");
+ ObjectValueTreeValuesButtonBorder = Color.FromName ("#5294eb");
+ ObjectValueTreeValueDisabledText = Color.FromName ("#7f7f7f");
+ ObjectValueTreeValueModifiedText = Color.FromName ("#1FAECE");
+
+ ExceptionCaughtDialog.InfoFrameBackgroundColor = Color.FromName ("#fbefce");
+ ExceptionCaughtDialog.InfoFrameBorderColor = Color.FromName ("#f0e4c2");
+ ExceptionCaughtDialog.LineNumberBackgroundColor = Color.FromName ("#c4c4c4");
+ ExceptionCaughtDialog.LineNumberInUserCodeBackgroundColor = Color.FromName ("#e599de");
+ ExceptionCaughtDialog.LineNumberTextColor = Color.FromName ("#ffffff");
+ } else {
+ ObjectValueTreeValuesButtonBackground = Color.FromName ("#7c8695");
+ ObjectValueTreeValuesButtonText = Color.FromName ("#cbe5ff");
+ ObjectValueTreeValuesButtonBorder = Color.FromName ("#a4bbd5");
+ ObjectValueTreeValueDisabledText = Color.FromName ("#5a5a5a");
+ ObjectValueTreeValueModifiedText = Color.FromName ("#4FCAE6");
+
+ ExceptionCaughtDialog.InfoFrameBackgroundColor = Color.FromName ("#675831");
+ ExceptionCaughtDialog.InfoFrameBorderColor = Color.FromName ("#7a6a3d");
+ ExceptionCaughtDialog.LineNumberBackgroundColor = Color.FromName ("#c4c4c4");
+ ExceptionCaughtDialog.LineNumberInUserCodeBackgroundColor = Color.FromName ("#e599de");
+ ExceptionCaughtDialog.LineNumberTextColor = Color.FromName ("#222222");
+ }
+
+ // Shared
+
+ ObjectValueTreeValueErrorText = Ide.Gui.Styles.WarningForegroundColor;
+
+ PreviewVisualizerBackgroundColor = Ide.Gui.Styles.PopoverWindow.DefaultBackgroundColor;
+ PreviewVisualizerTextColor = Ide.Gui.Styles.PopoverWindow.DefaultTextColor;
+ PreviewVisualizerHeaderTextColor = Ide.Gui.Styles.PopoverWindow.DefaultTextColor;
+
+ ExceptionCaughtDialog.TreeBackgroundColor = Ide.Gui.Styles.PrimaryBackgroundColor;
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/TextEntryWithCodeCompletion.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/TextEntryWithCodeCompletion.cs
index 8d78436425..108ea39c90 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/TextEntryWithCodeCompletion.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/TextEntryWithCodeCompletion.cs
@@ -27,6 +27,7 @@ using System;
using Xwt;
using MonoDevelop.Ide.CodeCompletion;
using System.Collections.Generic;
+using MonoDevelop.Ide.Editor.Extension;
namespace MonoDevelop.Debugger
{
@@ -51,6 +52,12 @@ namespace MonoDevelop.Debugger
CompletionWindowManager.WindowClosed += HandleWindowClosed;
}
+ protected override void Dispose (bool disposing)
+ {
+ CompletionWindowManager.WindowClosed -= HandleWindowClosed;
+ base.Dispose (disposing);
+ }
+
void HandleWindowClosed (object sender, EventArgs e)
{
ctx = null;
@@ -73,7 +80,7 @@ namespace MonoDevelop.Debugger
}
if (list != null)
- args.RetVal = keyHandled = CompletionWindowManager.PreProcessKeyEvent (key, keyChar, modifier);
+ args.RetVal = keyHandled = CompletionWindowManager.PreProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifier));
}
void HandleKeyReleaseEvent (object o, Gtk.KeyReleaseEventArgs args)
@@ -83,7 +90,7 @@ namespace MonoDevelop.Debugger
string text = ctx == null ? Text : Text.Substring (Math.Max (0, Math.Min (ctx.TriggerOffset, Text.Length)));
CompletionWindowManager.UpdateWordSelection (text);
- CompletionWindowManager.PostProcessKeyEvent (key, keyChar, modifier);
+ CompletionWindowManager.PostProcessKeyEvent (KeyDescriptor.FromGtk (key, keyChar, modifier));
PopupCompletion ();
}
@@ -116,19 +123,19 @@ namespace MonoDevelop.Debugger
{
#region ICompletionKeyHandler implementation
- public bool PreProcessKey (CompletionListWindow listWindow, Gdk.Key key, char keyChar, Gdk.ModifierType modifier, out KeyActions keyAction)
+ public bool PreProcessKey (CompletionListWindow listWindow, KeyDescriptor descriptor, out KeyActions keyAction)
{
keyAction = KeyActions.None;
- if (keyChar == '.') {
+ if (descriptor.KeyChar == '.') {
return true;
}
return false;
}
- public bool PostProcessKey (CompletionListWindow listWindow, Gdk.Key key, char keyChar, Gdk.ModifierType modifier, out KeyActions keyAction)
+ public bool PostProcessKey (CompletionListWindow listWindow, KeyDescriptor descriptor, out KeyActions keyAction)
{
keyAction = KeyActions.None;
- if (keyChar == '.') {
+ if (descriptor.KeyChar == '.') {
return true;
}
return false;
@@ -150,6 +157,11 @@ namespace MonoDevelop.Debugger
return Text.Substring (startOffset, endOffset - startOffset);
}
+ public void AddSkipChar (int cursorPosition, char c)
+ {
+ // ignore
+ }
+
public char GetChar (int offset)
{
if (offset >= Text.Length)
@@ -214,6 +226,9 @@ namespace MonoDevelop.Debugger
get {
return gtkEntry.Position;
}
+ set {
+ gtkEntry.Position = value;
+ }
}
public int TextLength {
@@ -234,6 +249,11 @@ namespace MonoDevelop.Debugger
}
}
+ double ICompletionWidget.ZoomLevel {
+ get {
+ return 1;
+ }
+ }
#endregion
}
}
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ThreadsPad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ThreadsPad.cs
index 073c65ba75..9fa65e2afc 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ThreadsPad.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ThreadsPad.cs
@@ -41,7 +41,24 @@ using MonoDevelop.Ide;
namespace MonoDevelop.Debugger
{
- public class ThreadsPad : Gtk.ScrolledWindow, IPadContent
+ public class ThreadsPad: PadContent
+ {
+ ThreadsPadWidget control = new ThreadsPadWidget ();
+
+ protected override void Initialize (IPadWindow window)
+ {
+ Id = "MonoDevelop.Debugger.ThreadsPad";
+ control.Initialize (window);
+ }
+
+ public override Control Control {
+ get {
+ return control;
+ }
+ }
+ }
+
+ public class ThreadsPadWidget : Gtk.ScrolledWindow
{
TreeViewState treeViewState;
PadTreeView tree;
@@ -59,7 +76,7 @@ namespace MonoDevelop.Debugger
Location
}
- public ThreadsPad ()
+ public ThreadsPadWidget ()
{
this.ShadowType = ShadowType.None;
@@ -127,7 +144,7 @@ namespace MonoDevelop.Debugger
UpdateDisplay ();
}
- void IPadContent.Initialize (IPadWindow window)
+ public void Initialize (IPadWindow window)
{
this.window = window;
window.PadContentShown += delegate {
@@ -234,7 +251,7 @@ namespace MonoDevelop.Debugger
void OnRowActivated (object s, RowActivatedArgs args)
{
- TreeIter iter, selected;
+ TreeIter selected;
if (!tree.Selection.GetSelected (out selected))
return;
@@ -254,23 +271,6 @@ namespace MonoDevelop.Debugger
}
}
- public Widget Control {
- get { return this; }
- }
-
- public string Id {
- get { return "MonoDevelop.Debugger.ThreadsPad"; }
- }
-
- public string DefaultPlacement {
- get { return "Bottom"; }
- }
-
- public void RedrawContent ()
- {
- UpdateDisplay ();
- }
-
void OnDebuggerPaused (object s, EventArgs a)
{
UpdateDisplay ();
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16.png b/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16.png
index c0c017eb32..b9a52a2203 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16@2x.png
index 9f68a52e2f..e9c7987cef 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16@2x.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~dark.png
new file mode 100644
index 0000000000..de38a0fb46
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~dark@2x.png
new file mode 100644
index 0000000000..040f23e224
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~dark~disabled.png b/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~dark~disabled.png
new file mode 100644
index 0000000000..2c4c08f2d9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~dark~disabled.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~dark~disabled@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..a411a244df
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~disabled.png b/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~disabled.png
new file mode 100644
index 0000000000..40138ca93c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~disabled.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~disabled@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~disabled@2x.png
new file mode 100644
index 0000000000..0aa16e9590
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/breakpoint-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/continue-16~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/continue-16~dark.png
new file mode 100644
index 0000000000..55be4cd553
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/continue-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/continue-16~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/continue-16~dark@2x.png
new file mode 100644
index 0000000000..e537469f3e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/continue-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-16.png b/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-16.png
deleted file mode 100644
index f26e32207e..0000000000
--- a/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-16@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-16@2x.png
deleted file mode 100644
index 158308d290..0000000000
--- a/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-22.png b/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-22.png
deleted file mode 100644
index 610440161f..0000000000
--- a/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-22.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-22@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-22@2x.png
deleted file mode 100644
index fae72407dd..0000000000
--- a/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-22@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-24.png b/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-24.png
deleted file mode 100644
index 80cd6238a2..0000000000
--- a/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-24.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-24@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-24@2x.png
deleted file mode 100644
index ef83576302..0000000000
--- a/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-24@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-32.png b/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-32.png
deleted file mode 100644
index e17cb11f60..0000000000
--- a/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-32.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-32@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-32@2x.png
deleted file mode 100644
index 07f213f055..0000000000
--- a/main/src/addins/MonoDevelop.Debugger/icons/debug-overlay-32@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/exception-48.png b/main/src/addins/MonoDevelop.Debugger/icons/exception-48.png
new file mode 100644
index 0000000000..c4c6a89206
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/exception-48.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/exception-48@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/exception-48@2x.png
new file mode 100644
index 0000000000..f0aedb903c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/exception-48@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/exception-48~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/exception-48~dark.png
new file mode 100644
index 0000000000..f51108466b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/exception-48~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/exception-48~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/exception-48~dark@2x.png
new file mode 100644
index 0000000000..ad0ac47266
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/exception-48~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-15.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-15.png
index 20ecca2fc7..66e56539b2 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-15.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-15.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-15@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-15@2x.png
index 872a5ff363..f93311be73 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-15@2x.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-15@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-15~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-15~dark.png
new file mode 100644
index 0000000000..9264ccc01e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-15~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-15~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-15~dark@2x.png
new file mode 100644
index 0000000000..86c904bca7
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-15~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-disabled-15.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-disabled-15.png
index ada1ad3fb5..b6a2c3ed16 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-disabled-15.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-disabled-15.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-disabled-15@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-disabled-15@2x.png
index a56d3aef2d..415b83ec16 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-disabled-15@2x.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-disabled-15@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-disabled-15~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-disabled-15~dark.png
new file mode 100644
index 0000000000..7b8522627b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-disabled-15~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-disabled-15~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-disabled-15~dark@2x.png
new file mode 100644
index 0000000000..69a9ea9df7
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-disabled-15~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-invalid-15.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-invalid-15.png
index bfaf88cf34..e35a7fe46a 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-invalid-15.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-invalid-15.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-invalid-15@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-invalid-15@2x.png
index cbf06776a2..8516777e7b 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-invalid-15@2x.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-invalid-15@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-invalid-15~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-invalid-15~dark.png
new file mode 100644
index 0000000000..3e17554ad6
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-invalid-15~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-invalid-15~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-invalid-15~dark@2x.png
new file mode 100644
index 0000000000..e69eb688e6
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-breakpoint-invalid-15~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-execution-15.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-execution-15.png
index d66862ca68..4aff120d7f 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/gutter-execution-15.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-execution-15.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-execution-15@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-execution-15@2x.png
index 493c4c5647..2d6626b35b 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/gutter-execution-15@2x.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-execution-15@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-execution-15~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-execution-15~dark.png
new file mode 100644
index 0000000000..75d029e290
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-execution-15~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-execution-15~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-execution-15~dark@2x.png
new file mode 100644
index 0000000000..d80113c471
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-execution-15~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-stack-15.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-stack-15.png
index 04730ee9f5..10f0020062 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/gutter-stack-15.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-stack-15.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-stack-15@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-stack-15@2x.png
index d731b20293..8db6d07582 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/gutter-stack-15@2x.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-stack-15@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-stack-15~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-stack-15~dark.png
new file mode 100644
index 0000000000..838d428b56
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-stack-15~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-stack-15~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-stack-15~dark@2x.png
new file mode 100644
index 0000000000..b136fe4252
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-stack-15~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-15.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-15.png
index e17b374a94..b8d8dee132 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-15.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-15.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-15@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-15@2x.png
index dc4002600d..58ae8d61a5 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-15@2x.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-15@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-15~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-15~dark.png
new file mode 100644
index 0000000000..7c3b36e74a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-15~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-15~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-15~dark@2x.png
new file mode 100644
index 0000000000..b4709dcc77
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-15~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-disabled-15.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-disabled-15.png
index d06ef8747f..51093a409f 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-disabled-15.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-disabled-15.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-disabled-15@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-disabled-15@2x.png
index 66f4d95b84..e82a46c94c 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-disabled-15@2x.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-disabled-15@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-disabled-15~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-disabled-15~dark.png
new file mode 100644
index 0000000000..e9bb5e5067
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-disabled-15~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-disabled-15~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-disabled-15~dark@2x.png
new file mode 100644
index 0000000000..df49804f20
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-disabled-15~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-invalid-15.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-invalid-15.png
index 4f126b81b3..5d1692454e 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-invalid-15.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-invalid-15.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-invalid-15@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-invalid-15@2x.png
index e100e3de2c..2337f90cb7 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-invalid-15@2x.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-invalid-15@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-invalid-15~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-invalid-15~dark.png
new file mode 100644
index 0000000000..fa41eef150
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-invalid-15~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-invalid-15~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-invalid-15~dark@2x.png
new file mode 100644
index 0000000000..d7660a1ed0
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/gutter-tracepoint-invalid-15~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/lightning-16.png b/main/src/addins/MonoDevelop.Debugger/icons/lightning-16.png
index f55eaee908..4d329b86de 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/lightning-16.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/lightning-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/lightning-16@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/lightning-16@2x.png
index 172998cd35..6ee71a6ad6 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/lightning-16@2x.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/lightning-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/lightning-16~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/lightning-16~dark.png
new file mode 100644
index 0000000000..a30a6b829d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/lightning-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/lightning-16~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/lightning-16~dark@2x.png
new file mode 100644
index 0000000000..3231ab61b1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/lightning-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/lightning-16~dark~disabled.png b/main/src/addins/MonoDevelop.Debugger/icons/lightning-16~dark~disabled.png
new file mode 100644
index 0000000000..5fe3aea858
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/lightning-16~dark~disabled.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/lightning-16~dark~disabled@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/lightning-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..e847c5bf2f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/lightning-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/lightning-16~disabled.png b/main/src/addins/MonoDevelop.Debugger/icons/lightning-16~disabled.png
new file mode 100644
index 0000000000..0c142aece1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/lightning-16~disabled.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/lightning-16~disabled@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/lightning-16~disabled@2x.png
new file mode 100644
index 0000000000..2d6e69fac9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/lightning-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/continue-16.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/continue-16.png
index 70960c9a1d..4d3bc37de5 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/mac/continue-16.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/continue-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/continue-16@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/continue-16@2x.png
index a1d9ab2387..ed0aba7675 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/mac/continue-16@2x.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/continue-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/continue-16~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/continue-16~dark.png
new file mode 100644
index 0000000000..479a5dcc25
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/continue-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/continue-16~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/continue-16~dark@2x.png
new file mode 100644
index 0000000000..058843874b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/continue-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/pause-16.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/pause-16.png
new file mode 100644
index 0000000000..442624355f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/pause-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/pause-16@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/pause-16@2x.png
new file mode 100644
index 0000000000..c6cb9c762b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/pause-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/pause-16~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/pause-16~dark.png
new file mode 100644
index 0000000000..3caf33cd7e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/pause-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/pause-16~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/pause-16~dark@2x.png
new file mode 100644
index 0000000000..d559606f8f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/pause-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/pause.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/pause.png
deleted file mode 100644
index 6603c0d1cf..0000000000
--- a/main/src/addins/MonoDevelop.Debugger/icons/mac/pause.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/pause@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/pause@2x.png
deleted file mode 100644
index f1cd97e5ae..0000000000
--- a/main/src/addins/MonoDevelop.Debugger/icons/mac/pause@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16.png
index 9dcded3b92..4d4936779b 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16@2x.png
index 5e455c726e..58797d6652 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16@2x.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~dark.png
new file mode 100644
index 0000000000..265152a27f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~dark@2x.png
new file mode 100644
index 0000000000..2fbe610a91
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~disabled.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~disabled.png
new file mode 100644
index 0000000000..9de59a516c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~disabled.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~disabled@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~disabled@2x.png
new file mode 100644
index 0000000000..1b3044a2be
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~disabled~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~disabled~dark.png
new file mode 100644
index 0000000000..85a3ff79df
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~disabled~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~disabled~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~disabled~dark@2x.png
new file mode 100644
index 0000000000..fcfae41a39
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-in-16~disabled~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16.png
index 67eed7f9da..10cff84795 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16@2x.png
index eb9aa52862..b6fdedfe42 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16@2x.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~dark.png
new file mode 100644
index 0000000000..89041ced27
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~dark@2x.png
new file mode 100644
index 0000000000..d95df3d982
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~disabled.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~disabled.png
new file mode 100644
index 0000000000..c3e39ecec0
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~disabled.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~disabled@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~disabled@2x.png
new file mode 100644
index 0000000000..06704e58d4
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~disabled~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~disabled~dark.png
new file mode 100644
index 0000000000..f451ea5798
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~disabled~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~disabled~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~disabled~dark@2x.png
new file mode 100644
index 0000000000..e5525d478b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-out-16~disabled~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16.png
index bcdacbb88b..8d69d17061 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16@2x.png
index 0a7b96e9ce..7e040e8dbf 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16@2x.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~dark.png
new file mode 100644
index 0000000000..f2da4e883e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~dark@2x.png
new file mode 100644
index 0000000000..be282f1dd1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~disabled.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~disabled.png
new file mode 100644
index 0000000000..d10925a213
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~disabled.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~disabled@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~disabled@2x.png
new file mode 100644
index 0000000000..9168634ddc
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~disabled~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~disabled~dark.png
new file mode 100644
index 0000000000..9d1563efdb
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~disabled~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~disabled~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~disabled~dark@2x.png
new file mode 100644
index 0000000000..aeb917d31b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/mac/step-over-16~disabled~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16.png
new file mode 100644
index 0000000000..879d553aca
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16@2x.png
new file mode 100644
index 0000000000..5778c526cc
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~dark.png
new file mode 100644
index 0000000000..7ade180b2a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~dark@2x.png
new file mode 100644
index 0000000000..d04fcbaa44
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~dark~sel.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~dark~sel.png
new file mode 100644
index 0000000000..4805daf179
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~dark~sel@2x.png
new file mode 100644
index 0000000000..e1cb0c72ea
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~sel.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~sel.png
new file mode 100644
index 0000000000..4805daf179
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~sel@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~sel@2x.png
new file mode 100644
index 0000000000..e1cb0c72ea
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-breakpoints-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16.png
index ee336018f8..a3441895de 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16@2x.png
index 04577e051a..06e6ec4268 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16@2x.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~dark.png
new file mode 100644
index 0000000000..910478d160
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~dark@2x.png
new file mode 100644
index 0000000000..89082d5735
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~dark~sel.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~dark~sel.png
new file mode 100644
index 0000000000..50bf3900bf
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~dark~sel@2x.png
new file mode 100644
index 0000000000..139f3cc034
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~sel.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~sel.png
new file mode 100644
index 0000000000..50bf3900bf
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~sel@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~sel@2x.png
new file mode 100644
index 0000000000..139f3cc034
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-call-stack-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16.png
index bd7976085e..cd3124c76c 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16@2x.png
index b88716e4b9..7e6f661afe 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16@2x.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~dark.png
new file mode 100644
index 0000000000..4eedc51b5a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~dark@2x.png
new file mode 100644
index 0000000000..0ba8d38c46
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~dark~sel.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~dark~sel.png
new file mode 100644
index 0000000000..829a25877b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~dark~sel@2x.png
new file mode 100644
index 0000000000..9182a875cb
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~sel.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~sel.png
new file mode 100644
index 0000000000..829a25877b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~sel@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~sel@2x.png
new file mode 100644
index 0000000000..9182a875cb
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-locals-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16.png
index 7a77d14929..7256ded2cf 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16@2x.png
index dfd9e9f12e..71d19442d5 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16@2x.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~dark.png
new file mode 100644
index 0000000000..efeff10ce7
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~dark@2x.png
new file mode 100644
index 0000000000..b2c40af2a5
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~dark~sel.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~dark~sel.png
new file mode 100644
index 0000000000..9bdc6e66f1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~dark~sel@2x.png
new file mode 100644
index 0000000000..fb0259fb85
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~sel.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~sel.png
new file mode 100644
index 0000000000..9bdc6e66f1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~sel@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~sel@2x.png
new file mode 100644
index 0000000000..fb0259fb85
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-threads-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16.png
index bfb4cd5e3b..a69ea1fc49 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16@2x.png
index 63120d12ce..8ae68592ed 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16@2x.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~dark.png
new file mode 100644
index 0000000000..6f0b38f989
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~dark@2x.png
new file mode 100644
index 0000000000..6c9424c687
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~dark~sel.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~dark~sel.png
new file mode 100644
index 0000000000..fa35a1ecd9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~dark~sel@2x.png
new file mode 100644
index 0000000000..2d5c8dbc0d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~sel.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~sel.png
new file mode 100644
index 0000000000..fa35a1ecd9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~sel@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~sel@2x.png
new file mode 100644
index 0000000000..2d5c8dbc0d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pad-watch-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pause-16~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/pause-16~dark.png
new file mode 100644
index 0000000000..7964ea8283
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pause-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/pause-16~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/pause-16~dark@2x.png
new file mode 100644
index 0000000000..d2feceaeb9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/pause-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16.png b/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16.png
index f26e32207e..c00254dd9f 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16@2x.png
index b8681ba963..4c1654ebfd 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16@2x.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~dark.png
new file mode 100644
index 0000000000..dbd2c9da8f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~dark@2x.png
new file mode 100644
index 0000000000..d03a48d630
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~dark~sel.png b/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~dark~sel.png
new file mode 100644
index 0000000000..9f98c3062b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~dark~sel@2x.png
new file mode 100644
index 0000000000..0b660d7edc
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~sel.png b/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~sel.png
new file mode 100644
index 0000000000..9f98c3062b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~sel@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~sel@2x.png
new file mode 100644
index 0000000000..0b660d7edc
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/prefs-debugger-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16.png b/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16.png
index a9c99d7ea1..3c0b36c9c6 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16@2x.png
index 2379b82339..6a0e1eb227 100644
--- a/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16@2x.png
+++ b/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~dark.png
new file mode 100644
index 0000000000..d94d819df0
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~dark@2x.png
new file mode 100644
index 0000000000..0e16ba3d8a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~dark~disabled.png b/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~dark~disabled.png
new file mode 100644
index 0000000000..388ec23b6c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~dark~disabled.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~dark~disabled@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..9fd925bd50
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~disabled.png b/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~disabled.png
new file mode 100644
index 0000000000..b90f6cfd67
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~disabled.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~disabled@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~disabled@2x.png
new file mode 100644
index 0000000000..74fd0875d0
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/stack-pointer-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/step-in-16~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/step-in-16~dark.png
new file mode 100644
index 0000000000..9f77c395f5
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/step-in-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/step-in-16~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/step-in-16~dark@2x.png
new file mode 100644
index 0000000000..5e82ea7766
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/step-in-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/step-out-16~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/step-out-16~dark.png
new file mode 100644
index 0000000000..9c5471918d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/step-out-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/step-out-16~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/step-out-16~dark@2x.png
new file mode 100644
index 0000000000..8b34d302f3
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/step-out-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/step-over-16~dark.png b/main/src/addins/MonoDevelop.Debugger/icons/step-over-16~dark.png
new file mode 100644
index 0000000000..8813df49da
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/step-over-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger/icons/step-over-16~dark@2x.png b/main/src/addins/MonoDevelop.Debugger/icons/step-over-16~dark@2x.png
new file mode 100644
index 0000000000..2a4035681a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/icons/step-over-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/ChangeLog b/main/src/addins/MonoDevelop.DesignerSupport/ChangeLog
deleted file mode 100644
index ce289cd2ae..0000000000
--- a/main/src/addins/MonoDevelop.DesignerSupport/ChangeLog
+++ /dev/null
@@ -1,2074 +0,0 @@
-2010-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Flush.
-
-2010-07-21 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.DesignerSupport.csproj:
- * MonoDevelop.DesignerSupport/BindingService.cs:
- * MonoDevelop.DesignerSupport/OpenDocumentFileProvider.cs: Use
- the file provider from monodevelop.ide.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs:
- Track API changes.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/TextToolboxNode.cs:
- Track API changes.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.DesignerSupport.csproj:
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs:
- Track API changes.
-
-2010-07-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml: Borrow a keybinding
- from Xcode for "Switch between related files".
-
-2010-07-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport/WrapperDesignView.cs: Track API
- changes.
-
-2010-07-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs:
- Swapped gradient.
-
-2010-07-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs:
- Removed inner border around the toolbox widget.
-
-2010-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs: Fix incorrect
- use of ShowCustomDialog/RunCustomDialog.
-
-2010-05-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs: More dialog
- placing.
-
-2010-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ComponentSelectorDialog.cs:
- Clean up dialog placement.
-
-2010-05-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/TextToolboxNode.cs:
- * MonoDevelop.DesignerSupport.Toolbox/ITextToolboxNode.cs:
- * MonoDevelop.DesignerSupport.Toolbox/TemplateToolboxNode.cs:
- Give text toolbox nodes more control over how they insert
- text into the document.
-
-2010-05-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.DesignerSupport.csproj:
- * MonoDevelop.DesignerSupport/SwapCodeBehindCommand.cs:
- * MonoDevelop.DesignerSupport/SwitchBetweenRelatedFilesCommand.cs:
- Rename file to match class.
-
-2010-05-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.DesignerSupport.csproj:
- * MonoDevelop.DesignerSupport.addin.xml:
- * MonoDevelop.DesignerSupport/Commands.cs:
- * MonoDevelop.DesignerSupport/CodeBehind.cs:
- * MonoDevelop.DesignerSupport/SwapCodeBehindCommand.cs:
- Implemented a command for cycling between grouped files,
- based on a patch from Curtis Wensley
- <curtis.wensley@gmail.com>.
-
-2010-05-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs: Reduce
- the number of unnecessary redraws.
-
-2010-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: Fix crash in
- toolbox. Fixes bug #586776 - Toolbox search widget broken.
-
-2010-04-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: moved code
- from Dispose -> OnDestroyed
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport/WrapperDesignView.cs:
- ViewContent widgets are now destroyed by the workspace
- window.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs:
- removed unnecessary dispose call.
-
-2010-04-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport/DocumentOutlinePad.cs:
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs:
- Fixed 'GLib.MissingIntPtrCtorException: GLib.Object subclass
- MonoDevelop.Components.CompactScrolledWindow must provide a
- protected or public IntPtr ctor to support wrapping of
- native object handles.' exception.
-
-
-2010-04-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs:
- Free up wasted space between scrollbars and treeview
- contents.
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: Free up
- wasted space between scrollbars and contents.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.DesignerSupport.addin.xml: Bumped MD version.
-
-2010-03-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml: Set the default
- location for designer pads. Register a new Visual Design
- layout.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.DesignerSupport.csproj:
- * MonoDevelop.DesignerSupport.addin.xml:
- * MonoDevelop.DesignerSupport/BindingService.cs:
- * MonoDevelop.DesignerSupport/ToolboxService.cs:
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs:
- * MonoDevelop.DesignerSupport/CodeBehindWriter.cs:
- * MonoDevelop.DesignerSupport/WrapperDesignView.cs:
- * MonoDevelop.DesignerSupport/DocumentOutlinePad.cs:
- * MonoDevelop.DesignerSupport/DesignerSupportService.cs:
- * MonoDevelop.DesignerSupport/OpenDocumentFileProvider.cs:
- * MonoDevelop.DesignerSupport.Projects/ComponentNodeBuilder.cs:
- * MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs:
- * MonoDevelop.DesignerSupport.Projects/SolutionItemDescriptor.cs:
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs:
- * MonoDevelop.DesignerSupport.Toolbox/ComponentSelectorDialog.cs:
- * MonoDevelop.DesignerSupport.Projects/WorkspaceItemDescriptor.cs:
- * MonoDevelop.DesignerSupport.Projects/ProjectReferenceDescriptor.cs:
- * MonoDevelop.DesignerSupport.Toolbox/CodeTemplateToolboxProvider.cs:
- * MonoDevelop.DesignerSupport.Projects/PropertyPadTextEditorExtension.cs:
- Merged MD.Projects into MD.Core, and MD.Projects.Gui,
- MD.Core.Gui and MD.Components into MD.Ide.
-
-2010-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.DesignerSupport.csproj:
- * MonoDevelop.DesignerSupport/ToolboxPad.cs:
- * MonoDevelop.DesignerSupport/PropertyPad.cs:
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: Use the new
- DockItemToolbar class for showing toolbar commands.
-
-2010-03-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs:
- Display CustomTool/CustomToolNamespace.
-
-2010-03-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs:
- changed update delay to 1s.
-
-2010-03-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs:
- Refresh sooner than the 5sec timer, if the document wasn't
- parsed at the start.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.csproj: Flush.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs:
- * MonoDevelop.DesignerSupport.Toolbox/ComponentSelectorDialog.cs:
- Track api changes.
-
-2010-02-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml: Set correct
- serializable type name.
-
-2010-02-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: Add tooltips
- to toolbar items.
-
-2010-02-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: Use the
- image service to get icons.
-
-2010-02-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ComponentSelectorDialog.cs:
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs:
- Track API changes for lazy loading images.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs:
- Flush.
-
-2010-01-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs:
- Added an accessor for the Generator property.
-
-2009-12-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/CodeTemplateToolboxProvider.cs:
- Set icon for template items.
-
-2009-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Use the correct Mono.Cairo reference.
-
-2009-11-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs: Remove
- ancient reflection code now we depend on a reasonable GTK#
- version.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.DesignerSupport.addin.xml: Bump MD version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.DesignerSupport.csproj: Reference mono-cairo
- package.
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs:
- Flush.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.DesignerSupport.addin.xml: Bump MD version.
-
-2009-09-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.DesignerSupport.csproj: Eliminate the property
- grid's System.Windows.Forms dependency, because it hurts Mac
- cold startup time.
-
-2009-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxLoader.cs:
- Use reflection only when running on ms.net.
-
-2009-09-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: Tweak remove
- message wording. Refine the GTK# item filtering hack a bit.
-
-2009-09-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs:
- Fixed Bug 538072 - NullRef in the background (not causing
- crash).
-
-2009-09-09 Christian Hergert <chris@dronelabs.com>
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs: Set the dialog
- transient to the root ide window.
-
-2009-09-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Projects/ComponentNodeBuilder.cs:
- Fix bu #535825 - Property pad should be disabled when
- multiple items selected.
-
-2009-08-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: Fixed Bug
- 373203 - Add widget to toolbox could be beefed up & Bug
- 373202 - Ask before removing widgets from toolbox.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.csproj: Updated dependencies. We
- now depend on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/CodeBehind.cs: Fix checking for
- parent - don't return nonexistent file.
-
-2009-08-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxLoader.cs:
- Track api changes.
-
-2009-08-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs:
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxLoader.cs:
- Use the new AssemblyContext class to query and resolve
- assemblies.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Flush.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs:
- Flush.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/IToolboxLoader.cs: Track
- api changes.
-
-2009-07-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Projects/SolutionItemDescriptor.cs:
- * MonoDevelop.DesignerSupport.Projects/WorkspaceItemDescriptor.cs:
- Use the new api for renaming projects and solutions.
-
-2009-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.DesignerSupport.csproj:
- * MonoDevelop.DesignerSupport.PropertyGrid:
- * MonoDevelop.DesignerSupport/PropertyPad.cs:
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors:
- * MonoDevelop.DesignerSupport/PropertyPadVisitor.cs:
- * MonoDevelop.DesignerSupport/IPropertyPadProvider.cs:
- * MonoDevelop.DesignerSupport/DesignerSupportService.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyGrid.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid/EditorManager.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/IntRange.cs:
- * MonoDevelop.DesignerSupport.Projects/ComponentNodeBuilder.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyGridTree.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid/EventPropertyTab.cs:
- * icons/MonoDevelop.DesignerSupport.PropertyGrid.SortByCat.png:
- * MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/TextEditor.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/FloatRange.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid/DefaultPropertyTab.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyEditorCell.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyPadVisitor.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/EventEditor.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid/IPropertyPadProvider.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/DefaultEditor.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/TimeSpanEditor.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/DateTimeEditor.cs:
- * icons/MonoDevelop.DesignerSupport.PropertyGrid.EventPropertyTab.svg:
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/ColorEditorCell.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/FlagsEditorCell.cs:
- * icons/MonoDevelop.DesignerSupport.PropertyGrid.EventPropertyTab.bmp:
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/TextEditorDialog.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/CollectionEditor.cs:
- * icons/MonoDevelop.DesignerSupport.PropertyGrid.DefaultPropertyTab.svg:
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/BooleanEditorCell.cs:
- * icons/MonoDevelop.DesignerSupport.PropertyGrid.DefaultPropertyTab.bmp:
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/CharPropertyEditor.cs:
- * MonoDevelop.DesignerSupport.Projects/PropertyPadTextEditorExtension.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyEditorTypeAttribute.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/FlagsSelectorDialog.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/EnumerationEditorCell.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyValueChangedEventArgs.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/ExpandableObjectEditor.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid/SurrogateUITypeEditorAttribute.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyValueChangedEventHandler.cs:
- Moved property grid to MD.Components.
-
-2009-07-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.DesignerSupport.csproj:
- * MonoDevelop.DesignerSupport/CodeBehindWriter.cs: Move
- CodeBehindWriter from MonoDevelop.AspNet to
- MonoDevelop.DesignerSupport.
-
-2009-07-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyGrid.cs:
- Added property for showing/hiding the toolbar.
-
-2009-06-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs:
- Use the new DesktopService instead of PlatformService.
-
-2009-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs: Track
- assembly lookup APIs.
-
-2009-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs:
- Cosmetic fix.
-
-2009-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyGridTree.cs:
- Don't copy fonts from the widget style to the layout. It is
- problematic on windows. Not sure what this was needed for.
-
-2009-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.PropertyGrid\PropertyGrid.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid\PropertyGridTree.cs:
- Removed the borders. Let the dock manager handle that.
-
-2009-05-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.PropertyGrid\PropertyGridTree.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors\CollectionEditor.cs:
- Don't use Gtk.TreeIter.Equals since it is broken. Use
- TreePath instead.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/BindingService.cs: Workaround
- for what seems to be a mcs bug. Looks like it can't properly
- resolve the implicit conversion of null to string.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport\CodeBehind.cs:
- * MonoDevelop.DesignerSupport\OpenDocumentFileProvider.cs: Use
- the new FilePath class for handling file and directory
- paths.
-
-2009-05-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.csproj: Disable overflow
- checking.
-
-2009-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs:
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs:
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs: Load
- the default toolbox items in the background, to avoid delays
- the first time the toolbox is shown.
-
- * MonoDevelop.DesignerSupport.Toolbox/IToolboxLoader.cs: Don't
- create a toolbox service instance in the external process,
- since it may recursively create other external processes.
- Fixes bug #498685 - MD Locks up when toolbox is opened.
-
-2009-04-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.csproj:
-
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs:
- Track API changes.
-
-2009-04-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport/WrapperDesignView.cs: Removed
- unused namespace.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs:
- Renamed PixbufService to ImageService.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs:
- Track API changes.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.DesignerSupport.csproj: don't require specific
- gtk-sharp version.
-
-2009-04-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs:
- * MonoDevelop.DesignerSupport.Toolbox/IToolboxLoader.cs:
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxLoader.cs:
- Moved SystemAssemblyService and related classes to the
- namespace MonoDevelop.Core.Assemblies.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.DesignerSupport.addin.xml: Bump MD version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.DesignerSupport.csproj:
- * MonoDevelop.DesignerSupport/ToolboxService.cs:
- * MonoDevelop.DesignerSupport.Toolbox/IToolboxLoader.cs:
- * MonoDevelop.DesignerSupport.Toolbox/CecilToolboxItemLoader.cs:
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxLoader.cs:
- Add support for multiple target runtimes.
-
-2009-03-23 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.DesignerSupport.csproj:
- * MonoDevelop.DesignerSupport.Toolbox/TextToolboxNode.cs:
- * MonoDevelop.DesignerSupport.Toolbox/TemplateToolboxNode.cs:
- * MonoDevelop.DesignerSupport.Toolbox/CodeTemplateToolboxProvider.cs:
- "fixed Bug 487736 - Clipboard ring and code snippets not
- shown anymore in the toolbox".
-
-2009-03-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/CodeTemplateToolboxProvider.cs:
- Fix build.
-
-2009-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/TypeReference.cs:
- * MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs:
- * MonoDevelop.DesignerSupport.Projects/SolutionItemDescriptor.cs:
- * MonoDevelop.DesignerSupport.Projects/WorkspaceItemDescriptor.cs:
- Added explicit "Misc" category for localization.
-
-2009-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs:
- Worked on property pad translation.
-
-2009-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/TypeReference.cs:
- * MonoDevelop.DesignerSupport.Toolbox/TextToolboxNode.cs:
- * MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs:
- * MonoDevelop.DesignerSupport.Projects/SolutionItemDescriptor.cs:
- * MonoDevelop.DesignerSupport.Projects/WorkspaceItemDescriptor.cs:
- * MonoDevelop.DesignerSupport.Projects/ProjectReferenceDescriptor.cs:
- Worked on propertygrid localization.
-
-2009-02-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs: Track api
- changes.
-
- * MonoDevelop.DesignerSupport.Projects/ProjectReferenceDescriptor.cs:
- Show the source package of the reference.
-
-2009-02-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyGridTree.cs:
- Dispose Gdk cursors, else finalisers destroy them outside of
- the GUI thread and often crash MD due to X asserts resulting
- in _XCBUnlockDisplay errors.
-
-2009-02-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: Use pad
- font.
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs:
- Handling font size and style propagation.
-
-2009-02-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs:
- Use Pad font.
-
-2009-02-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs: Fix
- warning number.
-
-2009-02-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs:
- Indentation.
-
- * MonoDevelop.DesignerSupport/BindingService.cs: Implement
- method for converting CodeMemberMethod to an IMethod.
-
-2009-02-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs: Revert
- Mike's commenting of unused method; it was in fact reflected
- at runtime.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.csproj: Don't local-copy other
- addins' dlls.
-
-2009-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport/BindingService.cs:
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs:
- * MonoDevelop.DesignerSupport/ErrorInFileException.cs:
- * MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs:
- * MonoDevelop.DesignerSupport.Toolbox/ItemToolboxNode.cs:
- Fixed compiler warnings.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp:
- * MonoDevelop.DesignerSupport.csproj: Migrated to MSBuild file
- format.
-
-2009-02-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/BindingService.cs: Improve
- method matching; it now finds methods with broader parameter
- types. Tweak event/method matching API. Use ordinal string
- compares.
-
-2009-02-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/BindingService.cs: Require a
- parent project for several methods, since getting it from
- the IType was unreliable.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.DesignerSupport.addin.xml: Bump MD version.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.DesignerSupport.mdp: Use the system Mono.Cairo.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- *
- gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs:
- Flush.
-
-2009-02-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Track changes in MD's assembly handling.
- Mono.Cairo is no longer considered to be a "system"
- assembly.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp: Flush project format changes.
-
-2009-01-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/DocumentOutlinePad.cs: Clean up widget
- management.
-
-2009-01-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs:
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyGrid.cs: Make sure
- the list is the first widget to be focused when presenting the pad.
-
-2008-12-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs: TooltipWindow
- has been moved to MD.Components.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp: All projects now require fx 3.5.
-
-2008-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs: Track API changes.
-
-2008-12-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/DocumentOutlinePad.cs: Track changes in
- the active view as well as the active document. Fixes Bug 450238 -
- Document outline should show source when in source view. Alsouse
- Alignment widget instead of custom InvisibleFrame.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp: Don't require a specific version of
- Mono.Addins.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Projects/ProjectReferenceDescriptor.cs:
- Allow setting the SpecificVersion flag.
-
-2008-12-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs: Track
- api changes.
-
-2008-12-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml: Hide/protect add-ins.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Make it work for parallel build.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * AssemblyInfo.cs:
- * MonoDevelop.DesignerSupport.mdp: Add AssemblyInfo.cs files that are
- autogenerated from the addin manifests.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml: Bump MD version.
-
-2008-11-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs:
- * MonoDevelop.DesignerSupport.Toolbox/ComponentSelectorDialog.cs: Fix
- bug #430494 - When adding components, there is no way to stop the
- process.
-
-2008-10-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.DesignerSupport.mdp: Updated.
-
- * MonoDevelop.DesignerSupport/CodeBehind.cs: Moved designer/codebehind
- lookup from MonoDevelop.AspNet.
-
-2008-10-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/BindingService.cs: Null checks in case
- event's ReturnType is null or unresolvable.
-
-2008-10-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: Remove lock, and add a
- GUI thread assertion so we can find the rogue thread that's causing
- Bug 434065.
-
-2008-10-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: Added lock for
- refresh.
-
-2008-10-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml,
- MonoDevelop.DesignerSupport/DesignerSupportService.cs: Use a simple
- lazy singleton instead of an IService.
-
-2008-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/TextEditor.cs,
- MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs: Add
- support for using property grid to set arbitrary build actions.
-
-2008-09-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs: Track
- API, fix .ctor display formatting.
-
-2008-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp: Updated projects.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs:
- Updated generated code.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/BindingService.cs: Track api changes.
-
-2008-09-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs:
- Changed compilation unit/document meta information interface.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Projects/ComponentNodeBuilder.cs: Moved
- the extensible tree view to its own directory.
-
-2008-08-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyGridTree.cs: Make
- property grid groups default to expanded.
-
-2008-08-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/TextEditor.cs: Add
- support for standard values and exclusive values if the converter
- supports/provides them. Supply an ITypeDescriptorContext to the
- TypeConverter.
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/EnumerationEditorCell.cs:
- Don't allow text caret, since the values are not editable.
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyEditorCell.cs:
- Implement ITypeDescriptorContext on EditorSession, so that cell
- editors can easily provide one to the TypeConverter.
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyGridTree.cs: Change
- some "as" casts to real casts -- InvalidCastException is more
- informative than NRE.
-
-2008-07-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs:
- Restore class outline functionality.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs,
- MonoDevelop.DesignerSupport/WrapperDesignView.cs: Translated old
- code to new dom.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport/TypeNotFoundException.cs,
- MonoDevelop.DesignerSupport/MemberExistsException.cs,
- MonoDevelop.DesignerSupport/BindingService.cs,
- MonoDevelop.DesignerSupport/ErrorInFileException.cs: Changes for
- converted refactoring infrastructure.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ItemToolboxNode.cs,
- MonoDevelop.DesignerSupport.Toolbox/ToolboxConfiguration.cs,
- MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxNode.cs,
- MonoDevelop.DesignerSupport.Toolbox/ToolboxList.cs,
- MonoDevelop.DesignerSupport.Toolbox/TypeReference.cs,
- MonoDevelop.DesignerSupport.Toolbox/TypeToolboxNode.cs,
- MonoDevelop.DesignerSupport.Toolbox/UnknownToolboxNode.cs,
- MonoDevelop.DesignerSupport/ToolboxService.cs: Moved serialization
- engine to MonoDevelop.Core. Use new syntax for specifying attribute
- scope.
-
-2008-07-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyGrid.cs: Add button
- to enable/disable help pane in property grid.
-
-2008-06-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/BindingService.cs: Require a specific
- class part when creating members.
-
-2008-06-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/BindingService.cs: Make
- IdentifierExistsInClass public again.
-
-2008-06-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs: Group
- members in regions. Reduce frequency of updates to 0.2Hz.
-
-2008-06-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/MemberExistsException.cs: Improve
- translatability.
- * MonoDevelop.DesignerSupport/BindingService.cs: Fix a possible NRE.
- Check base classes when looking for conflicting identifiers.
-
-2008-06-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs: Cache
- precendence selection results in IEnumerable merger.
-
-2008-06-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs: List
- members in the order they're present in the file.
-
-2008-06-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml,
- MonoDevelop.DesignerSupport.mdp,
- MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs,
- Makefile.am: Implement document outline for .NET source files.
-
-2008-06-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml,
- MonoDevelop.DesignerSupport.mdp,
- MonoDevelop.DesignerSupport/DesignerSupportService.cs,
- MonoDevelop.DesignerSupport/CodeBehindService.cs,
- MonoDevelop.DesignerSupport.CodeBehind/CodeBehindMissingClassBuilder.cs,
- MonoDevelop.DesignerSupport.CodeBehind/CodeBehindDisplayBinding.cs,
- MonoDevelop.DesignerSupport.CodeBehind/CodeBehindProjectFileExtension.cs,
- MonoDevelop.DesignerSupport.CodeBehind/ICodeBehindProvider.cs,
- MonoDevelop.DesignerSupport.CodeBehind/CodeBehindClassEventArgs.cs,
- MonoDevelop.DesignerSupport.CodeBehind/CodeBehindClass.cs,
- MonoDevelop.DesignerSupport.CodeBehind/CodeBehindViewContent.cs,
- Makefile.am: Remove old CodeBehind grouping mechanism.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml: Bump MD version.
-
-2008-06-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/TextEditor.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/EnumerationEditorCell.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/FlagsEditorCell.cs,
- MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs: Use the
- OnDestroyed event instead of Dispose, since with the latest changes
- in gtk#, Dispose is not called anymore when a widget is destroyed.
-
-2008-05-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/CecilToolboxItemLoader.cs: Fix
- warning.
-
-2008-05-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs: Fix exception
- catching from GTK thread.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp, Makefile.am,
- MonoDevelop.DesignerSupport.Projects/WorkspaceItemDescriptor.cs,
- MonoDevelop.DesignerSupport.Projects/ComponentNodeBuilder.cs: Add
- support for solution and workspaces.
- * MonoDevelop.DesignerSupport.Projects/SolutionItemPropertyProvider.cs,
- MonoDevelop.DesignerSupport.Projects/SolutionItemDescriptor.cs:
- Renamed.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Projects/CombineEntryDescriptor.cs: Allow
- editing the root folder.
-
-2008-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs: Update the toolbox
- when project properties change.
-
-2008-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxLoader.cs:
- Detect the runtime that the assembly references and pass it on to
- the node builder. Catch and log more errors.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml,
- MonoDevelop.DesignerSupport/BindingService.cs,
- MonoDevelop.DesignerSupport/CodeBehindService.cs,
- MonoDevelop.DesignerSupport.Projects/CombineEntryDescriptor.cs,
- MonoDevelop.DesignerSupport.Projects/CombineEntryPropertyProvider.cs,
- MonoDevelop.DesignerSupport.Projects/ComponentNodeBuilder.cs,
- MonoDevelop.DesignerSupport.Projects/PropertyPadTextEditorExtension.cs,
- MonoDevelop.DesignerSupport.Projects/ProjectReferenceDescriptor.cs:
- New project model changes.
-
-2008-05-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: fixed 'Bug 389065 -
- Toolbox tooltips show while a drag taking place and do not hide'
-
-2008-05-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/TextToolboxNode.cs,
- MonoDevelop.DesignerSupport.Toolbox/ITextToolboxNode.cs: Change
- ITextToolboxNode API so that nodes have more control over when
- they're shown.
-
-2008-05-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml,
- MonoDevelop.DesignerSupport.mdp, gtk-gui/gui.stetic, Makefile.am:
- Updated.
- * MonoDevelop.DesignerSupport/ToolboxService.cs,
- MonoDevelop.DesignerSupport.Toolbox/ComponentSelectorDialog.cs,
- MonoDevelop.DesignerSupport.Toolbox/IToolboxProvider.cs: Track API.
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/TextEditor.cs: Use
- string.Empty instead of "".
- * MonoDevelop.DesignerSupport.Toolbox/ItemToolboxNode.cs,
- MonoDevelop.DesignerSupport.Toolbox/TextToolboxNode.cs: Remove dead
- code. Mark up for property grid. Fix filtering. Fix comparisons.
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxNode.cs: Fix
- Equals.
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: Fix filtering. Remove
- old API usage. Implement IPropertyPadProvider for the toolpad.
- * MonoDevelop.DesignerSupport.Toolbox/BaseToolboxNode.cs,
- MonoDevelop.DesignerSupport.Toolbox/CategoryToolboxNode.cs,
- MonoDevelop.DesignerSupport.Toolbox/ToolboxStore.cs: Remove dead
- code.
- * MonoDevelop.DesignerSupport.Toolbox/CodeTemplateToolboxProvider.cs:
- Fix logic. Remove cursor insertion marker.
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs: Remove use of
- deprecated API. Need to fix the Droptarget/Iconise/Sort properties
- of the categories.
- * MonoDevelop.DesignerSupport.Toolbox/CecilToolboxItemLoader.cs:
- Abstract toolbox loader that uses Cecil to reflect for attributes.
- * MonoDevelop.DesignerSupport.Toolbox/TypeToolboxNode.cs: Fix Equals
- (calls to Equals on ItemToolboxNode were resolving to base-specific
- overloads, which weren't calling the overridden children).
- * MonoDevelop.DesignerSupport.Toolbox/TypeReference.cs: Mark up for
- property grid.
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxLoader.cs:
- Refactor to work better as a base class for loaders.
- * MonoDevelop.DesignerSupport.Toolbox/CecilTypeResolver.cs: Copied from
- the Cecil linker.
- * MonoDevelop.DesignerSupport.PropertyGrid/EditorManager.cs: Make
- expanding properties work with subclasses of ExpandableObject
- typeconverter.
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyGridTree.cs: Make
- expanding properties work with subclasses of ExpandableObject
- typeconverter. Use string.Empty instead of "".
-
-2008-05-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/CodeTemplateToolboxProvider.cs:
- Fix compilation.
-
-2008-05-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml,
- MonoDevelop.DesignerSupport.mdp,
- MonoDevelop.DesignerSupport.Toolbox/CodeTemplateToolboxProvider.cs,
- Makefile.am: Add toolbox snippet provider that shows valid snippets
- for text files.
-
-2008-05-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp, Makefile.am: Updated.
-
-2008-05-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs: Use tooltip
- window base class.
-
-2008-05-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml: Removed default ToolboxItem
- loader.
- * MonoDevelop.DesignerSupport.mdp, Makefile.am: Updated.
- * MonoDevelop.DesignerSupport/ToolboxService.cs: Catch exceptions in
- drag handlers so that they don't prevent the drag from completing.
- Allow toolbox consumers to fully override filtering.
- * MonoDevelop.DesignerSupport.Toolbox/IToolboxConsumer.cs: Add new
- ICustomFilteringToolboxConsumer interface for consumers that want
- to override the filtering completely.
- * MonoDevelop.DesignerSupport.Toolbox/ItemToolboxNode.cs: Make
- ItemFilters generic.
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxNode.cs:
- Reqimplemented Equals. Fixes a NRE.
- * MonoDevelop.DesignerSupport.Toolbox/TypeReference.cs: Add convenience
- method for getting a ProjectReference.
- * MonoDevelop.DesignerSupport.Toolbox/TextToolboxNode.cs: Implement
- ITextToolboxNode.
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxLoader.cs: Make
- this a convenience base class.
- * MonoDevelop.DesignerSupport.Toolbox/ITextToolboxNode.cs: Add
- interface for toolbox items that can provide text to a text editor,
- filtered by file extension or mimetype.
-
-2008-05-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/CodeBehindService.cs: Remove unneeded
- code; the parser service seems to handle parsing at startup.
-
-2008-05-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.CodeBehind/ICodeBehindProvider.cs,
- MonoDevelop.DesignerSupport/CodeBehindService.cs,
- MonoDevelop.DesignerSupport/DesignerSupportService.cs,
- MonoDevelop.DesignerSupport.addin.xml: Change CodeBehind grouping
- API so that it now uses parser service instread of an extension
- point.
-
-2008-04-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml,
- MonoDevelop.DesignerSupport.mdp,
- MonoDevelop.DesignerSupport/IOutlinedDocument.cs,
- MonoDevelop.DesignerSupport/DocumentOutlinePad.cs, Makefile.am,
- icons/pad-document-outline-16.png: Add document outline pad that
- will display an outline widget from documents that implement
- IOutlinedDocument.
-
-2008-04-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs: Show
- mime type description in the properties pad.
-
-2008-04-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/BindingService.cs: Add methods for
- getting CodeMemberMethod signatures from MD's parser DOM.
-
-2008-03-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs: Properly handle
- the leave event. Should fix bug #366131.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs,
- gtk-gui/gui.stetic,
- MonoDevelop.DesignerSupport.Toolbox/ComponentSelectorDialog.cs: Worked
- on gnome hig compliant alerts.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs: fixes tooltip bug.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs: Ctrl+F1 work now in
- the toolbox.
-
-2008-02-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs,
- MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs,
- MonoDevelop.DesignerSupport.Toolbox/CategoryToolboxNode.cs: Fixed "Bug
- 365624 - Widget toolbox are shown unsorted".
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ItemToolboxNode.cs: Fixed comparer bug
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs,
- MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs,
- MonoDevelop.DesignerSupport.Toolbox/CategoryToolboxNode.cs,
- MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs,
- MonoDevelop.DesignerSupport.Toolbox/IToolboxProvider.cs: Worked on
- category support for the toolbox service.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs: Fixed
- nullrefexception.
-
-2008-02-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs,
- MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs: Label is now taken
- as tooltip, when Description is not set.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp, Makefile.am: Removed some unused glade
- and gnome-sharp references (only the unused). But I'll continue to
- remove glade, we need to lower the dependency tree a bit.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs: Fixed toolbar widget
- scrolling bug.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs: Added no tools
- available message.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs,
- MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: Added some support for
- view dynamic providers.
-
-2008-02-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: Added resize in toolbox
- refresh.
-
-2008-02-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: Fixed little dnd bug.
-
-2008-02-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs,
- MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs: Replaced old
- toolbox with a new one.
-
-2008-02-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml: Removed source editor dependency.
-
-2008-02-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/BindingService.cs: If no specific part is
- specified when adding a member to a class, add it to the first part.
- Fixes an error in the ASP.NET designer (and anything else using the
- binding service without explicitly specifying class parts).
-
-2008-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml, MonoDevelop.DesignerSupport.mdp,
- Makefile.am, icons/toolbox-pad-16.png, icons/properties-pad-16.png: New
- tango icons by Vinicius Depizzol.
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/BooleanEditorCell.cs:
- Properly draw checkboxes.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml: Update MD version.
-
-2008-01-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: Use the correct class to
- get the node_hash private field.
-
-2008-01-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyGrid.cs: Use a smaller
- toolbar.
-
-2008-01-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/CodeBehindService.cs: Improve error reporting
- for invalid IClasses.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp: Updated project files. The order of
- extended properties won't change anymore.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs: The ide is not yet fully
- initialized when the toolbox service is created.
-
-2007-12-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs,
- MonoDevelop.DesignerSupport.Toolbox/CompactToolboxView.cs: Don't draw
- shadows in pads (the new docking library does that already). Haven't
- fixed property pad as it doesn't seem to be possible to remove the
- borders from the Vpaned.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs: Make sure Gtk is properly
- initialized in the process that looks for components. Added some missing
- check.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml: Bump add-in versions.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs: Make sure the toolbox is
- filled the first time it is shown.
- * gtk-gui/gui.stetic: Updated.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp, Makefile.am: Directory reorganization.
-
-2007-11-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml, MonoDevelop.DesignerSupport.mdp,
- Makefile.am,
- MonoDevelop.DesignerSupport.Projects/CombineEntryDescriptor.cs,
- MonoDevelop.DesignerSupport.Projects/CombineEntryPropertyProvider.cs,
- MonoDevelop.DesignerSupport.Projects/ProjectReferenceDescriptor.cs,
- MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs,
- MonoDevelop.DesignerSupport.Projects/ProjectItemPropertyProvider.cs,
- MonoDevelop.DesignerSupport.Projects/ProjectsPropertyProvider.cs: Added
- some property descriptors for references and CombineEntry.
-
-2007-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/CodeBehindService.cs,
- MonoDevelop.DesignerSupport/ToolboxService.cs,
- MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: Track LoggingService API
- changes.
-
-2007-11-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyGridTree.cs: Use a more
- convenient color for grup headers.
-
-2007-11-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/BindingService.cs: Use RootCombine instead of
- CurrentOpenCombine when possible.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml: Bump MD version.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp: Project file names updated by change in
- MD path functions.
-
-2007-10-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp, Makefile.am: Updated.
- * MonoDevelop.DesignerSupport/TypeNotFoundException.cs,
- MonoDevelop.DesignerSupport/MemberExistsException.cs,
- MonoDevelop.DesignerSupport/BindingService.cs,
- MonoDevelop.DesignerSupport/ErrorInFileException.cs: Better error
- reporting, including filename/line number.
-
-2007-10-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/BindingService.cs,
- MonoDevelop.DesignerSupport/MemberExistsException.cs: Improve error
- output when Codebehind generation fails.
-
-2007-10-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport/BindingService.cs: Walk down into base classes
- when checking if compatible members are present in a class. If members
- with same name exist, check type compatibility down through the class
- hierarchy.
-
-2007-10-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxLoader.cs:
- Initialize Gtk before trying to load the toolbox item. Needed since this
- is done out of process.
-
-2007-10-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ItemToolboxNode.cs: Implement
- IComparable so that the ToolboxService's array sort doesn't break on
- non-GTK#-component toolbox nodes. Fixes AspNetEdit.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml: Bump MD version.
-
-2007-09-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.CodeBehind/CodeBehindProjectFileExtension.cs:
- In BuildChildNodes, don't assume that HasChildNodes is false, because
- other extensions may have added children to this node.
-
-2007-09-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs,
- gtk-gui/gui.stetic: Regenerated GUI files.
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: Added NodeView subclass
- and overrided OnDragDataDelete. This is necessary to avoid a GTK warning
- about the need to override drag_data_delete.
-
-2007-09-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp,
- MonoDevelop.DesignerSupport/BindingService.cs,
- MonoDevelop.DesignerSupport/OpenDocumentFileProvider.cs, Makefile.am:
- Make OpenDocumentFileProvider publicly accessible so it can be used
- elsewhere.
-
-2007-09-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp,
- MonoDevelop.DesignerSupport/CodeBehindService.cs,
- MonoDevelop.DesignerSupport.CodeBehind/CodeBehindMissingClassBuilder.cs,
- MonoDevelop.DesignerSupport.CodeBehind/CodeBehindProjectFileExtension.cs,
- MonoDevelop.DesignerSupport.CodeBehind/CodeBehindClassEventArgs.cs,
- MonoDevelop.DesignerSupport.CodeBehind/CodeBehindClass.cs, Makefile.am:
- In CodeBehind service, track class names rather than IClasses, as
- IClasses can change. Now much more careful to trigger only the
- rebuilding of nodes which need to be rebuilt. May still be some
- performance issues on large projects (from linear lookups of class
- names, and requirement for CodeBehind parent parsing to happen at
- project load time).
-
-2007-09-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml,
- MonoDevelop.DesignerSupport/CodeBehindService.cs,
- MonoDevelop.DesignerSupport.CodeBehind/CodeBehindMissingClassBuilder.cs,
- MonoDevelop.DesignerSupport.CodeBehind/CodeBehindClassBuilder.cs,
- MonoDevelop.DesignerSupport.CodeBehind/CodeBehindProjectFileExtension.cs:
- Audit and restructure the CodeBehind grouping so that it updates
- correctly and handles partial classes.
- * MonoDevelop.DesignerSupport.mdp, Makefile.am, gtk-gui/gui.stetic: Updated
- & fix GTK# version at 2.8.
- * MonoDevelop.DesignerSupport.CodeBehind/CodeBehindDisplayBinding.cs:
- Disable fully, as it doesn't work properly. Needs some core work to make
- it workable.
-
-2007-09-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.PropertyGrid/IPropertyPadProvider.cs: Added
- some documentation.
-
-2007-09-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml, MonoDevelop.DesignerSupport.mdp,
- Makefile.am,
- MonoDevelop.DesignerSupport.Projects/PropertyPadTextEditorExtension.cs:
- When the focus is in the text editor, show the properties of the file in
- the property pad. Fixes bug #82255.
-
-2007-08-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport/DesignerSupportService.cs,
- MonoDevelop.DesignerSupport/ToolboxService.cs,
- MonoDevelop.DesignerSupport/PropertyPad.cs,
- MonoDevelop.DesignerSupport.Projects/ComponentNodeBuilder.cs,
- MonoDevelop.DesignerSupport.PropertyGrid/IPropertyPadProvider.cs,
- MonoDevelop.DesignerSupport.PropertyGrid/PropertyPadVisitor.cs: Changes
- due to new property infrastructure.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/DesignerSupportService.cs: Add missing null
- check.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml,
- MonoDevelop.DesignerSupport/DesignerSupportService.cs: Removed the
- CommandService class. Everything is done directly with CommandManager.
- Moved all extension node types to MD.Components.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml, MonoDevelop.DesignerSupport.mdp,
- gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs,
- Makefile.am: Reorganized the extension point hierarchy. Embedded all
- add-in manifests as resources.
-
-2007-08-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.CodeBehind/CodeBehindProjectFileExtension.cs:
- Converted DispatchService to a static class.
-
-2007-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/PropertyPad.cs: Assign the property pad
- to the service only when it is completely initialized.
-
-2007-07-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs: Sort toolbox items.
-
-2007-07-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/DesignerSupportService.cs: When the
- property pad is show, initialize it with the data of the latest
- provider found. Fixes bug #82166.
-
-2007-07-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs,
- MonoDevelop.DesignerSupport.Toolbox/CompactToolboxView.cs: Fixed
- Bug 82104:Toolbox White Using Dark Theme.
-
-2007-07-19 Ben Motmans <ben.motmans@gmail.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: overwrite the
- node_hash field with a standard hashtable [fixes #81942]
-
-2007-07-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/CompactToolboxView.cs: Improve
- tooltip look.
-
-2007-07-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml,
- MonoDevelop.DesignerSupport.mdp,
- MonoDevelop.DesignerSupport/Commands.cs,
- MonoDevelop.DesignerSupport/ToolboxService.cs,
- MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs, Makefile.am: Added
- a context menu to the toolbox, which allows adding/removing items.
- * MonoDevelop.DesignerSupport.Toolbox/CompactToolboxView.cs: Show the
- tooltip centered. Avoid the selection to be cleared when clicking
- on an item. Redraw the widget when the item list changes.
-
-2007-07-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp,
- MonoDevelop.DesignerSupport/ToolboxService.cs,
- gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs,
- gtk-gui/gui.stetic,
- MonoDevelop.DesignerSupport.Toolbox/ItemToolboxNode.cs,
- MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxNode.cs,
- MonoDevelop.DesignerSupport.Toolbox/ComponentSelectorDialog.cs,
- Makefile.am: Implemented an index of components, which can be used
- by the user to select which components have to be shown in the
- toolbar.
- * MonoDevelop.DesignerSupport/DesignerSupportService.cs: Toolbox
- configuration loading/saving is now handled by the toolbox service.
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/TextEditor.cs: Fix
- warning.
- * MonoDevelop.DesignerSupport.Toolbox/IToolboxConsumer.cs: Removed
- TODO.
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxConfiguration.cs: New
- class that stores toolbox information.
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxList.cs: Moved
- serialization code to ToolboxConfiguration.
- * MonoDevelop.DesignerSupport.Toolbox/IToolboxProvider.cs:
- Implementations of IToolboxDefaultProviders can now return a file
- that implements toolbox items and all of them will be loaded by
- default in the toolbox. It is not necessary to specify all default
- items one by one, although it can still be done.
-
-2007-07-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs,
- MonoDevelop.DesignerSupport.Toolbox/CompactToolboxView.cs: Worked
- on toolbox view (tooltips, sizing and some behavior issues).
-
-2007-06-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/CompactToolboxView.cs: Fix size
- request calculation.
-
-2007-06-28 Mike Krüger <mkrueger@novell.com>
-
- * icons/md-design-listboxtoggle.png: Added an icon for the toolbox
- listbox toggle.
-
-2007-06-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/CompactToolboxView.cs: Removed
- some debugging code.
-
-2007-06-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/CompactToolboxView.cs: Worked on
- tooltips & scrolling.
-
-2007-06-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs,
- MonoDevelop.DesignerSupport.Toolbox/CompactToolboxView.cs,
- MonoDevelop.DesignerSupport.Toolbox/CategoryToolboxNode.cs: Worked
- on a more compact owner drawn toolbox view.
-
-2007-06-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs: Avoid adding
- duplicated widgets.
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: Catch exception
- thrown when dragging items.
-
-2007-06-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml,
- MonoDevelop.DesignerSupport/PropertyPad.cs: Default pad placement
- is now specified in the xml file.
-
-2007-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.Projects/ComponentNodeBuilder.cs: Don't
- use the CurrentNode property in the OnChanged event since it may
- not be properly initialized when the event is fired.
-
-2007-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml: Changed add-in category.
-
-2007-05-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp,
- MonoDevelop.DesignerSupport/CustomDescriptor.cs, Makefile.am: Added
- default implementation of ICustomTypeDescriptor.
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/TextEditor.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/CollectionEditor.cs:
- Removed debug code.
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/EnumerationEditorCell.cs:
- If an enum member has a Description attribute applied to it, use it
- as display name.
- * MonoDevelop.DesignerSupport.Projects/ProjectsPropertyProvider.cs:
- Added more complete descriptions of the properties. Disable the
- ResourceId property if the file is not a resource.
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyGrid.cs,
- MonoDevelop.DesignerSupport.PropertyGrid/PropertyGridTree.cs: When
- the value of a property changes, update all other properties, since
- their values may also change, or they may be enabled/disabled.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp: Deploy the addin.xml file.
- * MonoDevelop.DesignerSupport/DesignerSupportService.cs: Added some
- null checks.
-
-2007-05-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp, Makefile.am: Reference shared
- assemblies from the correct location.
-
-2007-03-07 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.DesignerSupport.PropertyGrid/EditorManager.cs: Avoid
- some invalid PropertyEditorCell casts.
-
- * MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs: Tweaks to aid
- in tracking down exceptions. The error display should really be moved
- into the MD thread so that the entire designer process can go down,
- or we risk having loose ends.
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml,
- MonoDevelop.DesignerSupport.mdp,
- MonoDevelop.DesignerSupport/DesignerSupportService.cs,
- MonoDevelop.DesignerSupport/CodeBehindService.cs,
- MonoDevelop.DesignerSupport/ToolboxService.cs, Makefile.am:
- Migration to Mono.Addins.
-
-2007-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml,
- MonoDevelop.DesignerSupport.Projects/ComponentNodeBuilder.cs,
- MonoDevelop.DesignerSupport.Projects/ProjectsPropertyProvider.cs:
- Implemented property providers for the Project and Class pad.
- * MonoDevelop.DesignerSupport.mdp, Makefile.am: Updated.
- * MonoDevelop.DesignerSupport/DesignerSupportService.cs,
- MonoDevelop.DesignerSupport/IPropertyProvider.cs,
- MonoDevelop.DesignerSupport/PropertyPad.cs,
- MonoDevelop.DesignerSupport.PropertyGrid/PropertyGrid.cs:
- Implemented support for multiple property providers for a
- component. Property providers can add properties to be shown in the
- property pad for a specific type of object. Add-ins can register
- new property providers in a new extension point.
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/FloatRange.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/ColorEditorCell.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/BooleanEditorCell.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/TimeSpanEditor.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/EventEditor.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/CharPropertyEditor.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/TextEditor.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/EnumerationEditorCell.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/FlagsEditorCell.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/DateTimeEditor.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/IntRange.cs,
- MonoDevelop.DesignerSupport.PropertyGrid/PropertyPadVisitor.cs:
- Track api changes.
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyEditorCell.cs: When
- initializing a cell, provide the EditSession instead of the
- PropertyDescriptor. In this way the cell can have more control over
- the property editing session.
- * MonoDevelop.DesignerSupport.PropertyGrid/IPropertyPadProvider.cs:
- Added method which allows providing the object from which to get
- and set properties, which can now be different from the real
- component (it can be for example a wrapper). Also added methods
- which are called when the edit session ends.
- * MonoDevelop.DesignerSupport.PropertyGrid/EditorManager.cs: Allow
- specifying cell editors using the EditorAttribute.
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyGridTree.cs: Fire
- Changed and EndEditing events.
-
-2007-03-07 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.DesignerSupport/BindingService.cs: Clean up
- CreateAndShowMember. Jump to selected member. Remove GUI
- threadsafety code -- consumers should handle this.
-
-2007-03-07 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Makefile.am: Remove ENABLE_DESIGNERSUPP check as it should always
- be built now.
-
-2007-03-07 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs:
- Only restart GUI thread if it was stopped by an exception. This
- means that the GUI thread will now be able to stop, so there
- won't be lots of orphaned mdhost processes left around.
-
-2007-03-06 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/EventEditor.cs:
- Initialize override should call base, so display text gets set.
-
-2007-03-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp, Makefile.am: Updated.
- * MonoDevelop.DesignerSupport/DesignerSupportService.cs: Added methods
- for changing the content of the property pad.
- * MonoDevelop.DesignerSupport/MemberExistsException.cs,
- MonoDevelop.DesignerSupport.CodeBehind/CodeBehindDisplayBinding.cs,
- MonoDevelop.DesignerSupport.CodeBehind/CodeBehindViewContent.cs:
- Fix warnings.
- * MonoDevelop.DesignerSupport/ToolboxService.cs: Implement support for
- drag&drop and track changes in dynamic item providers.
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/EnumEditor.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/StringEditor.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/BaseEditor.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/ColorEditor.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/NumberEditor.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/BoolEditor.cs:
- Removed old editors.
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/TextEditorDialog.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/FlagsSelectorDialog.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/FloatRange.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/ColorEditorCell.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/BooleanEditorCell.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/TimeSpanEditor.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/EventEditor.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/CharPropertyEditor.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/TextEditor.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/DefaultEditor.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/EnumerationEditorCell.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/ExpandableObjectEditor.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/CollectionEditor.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/FlagsEditorCell.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/DateTimeEditor.cs,
- MonoDevelop.DesignerSupport.PropertyGrid.Editors/IntRange.cs:
- Implemented editors for the new TreeView based property grid.
- * MonoDevelop.DesignerSupport.Toolbox/IToolboxConsumer.cs: Added
- support for drag&drop.
- * MonoDevelop.DesignerSupport.Toolbox/ItemToolboxNode.cs,
- MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxNode.cs,
- MonoDevelop.DesignerSupport.Toolbox/TypeToolboxNode.cs,
- MonoDevelop.DesignerSupport.Toolbox/TypeReference.cs: Implement
- GetHashCode().
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: Add support for
- drag&drop. Use smaller icons for the toolbar.
- * MonoDevelop.DesignerSupport.Toolbox/IToolboxProvider.cs: Added event
- to update the toolbox items of a dynamic provider.
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyEditorCell.cs,
- MonoDevelop.DesignerSupport.PropertyGrid/PropertyGrid.cs,
- MonoDevelop.DesignerSupport.PropertyGrid/PropertyGridTree.cs:
- Implemented TreeView based property grid.
- * MonoDevelop.DesignerSupport.PropertyGrid/GridRow.cs: Removed, not
- needed anymore.
- * MonoDevelop.DesignerSupport.PropertyGrid/IPropertyPadProvider.cs: New
- interfaces for providing custom property pad content.
- * MonoDevelop.DesignerSupport.PropertyGrid/EditorManager.cs: New
- manager for the TreeView based property grid.
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyPadVisitor.cs: New
- command target visitor for getting the currently selected
- component.
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyValueChangedEventArgs.cs:
- Track api changes.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.addin.xml: Change add-in versions to
- 0.13.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp, Makefile.am: Synchronized the MD
- project and the Makefile
-
-2007-02-06 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyGrid.cs,
- * MonoDevelop.DesignerSupport.PropertyGrid/EventPropertyTab.cs,
- * MonoDevelop.DesignerSupport.PropertyGrid/DefaultPropertyTab.cs,
- * MonoDevelop.DesignerSupport/ToolboxService.cs: make strings translatable
-
-2006-02-01 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/TypeToolboxNode.cs:
- * MonoDevelop.DesignerSupport.Toolbox/TypeReference.cs:
- * Makefile.am:
- Split class into separate file. Improve comments.
-
- * MonoDevelop.DesignerSupport/DesignerSupportService.cs:
- * MonoDevelop.DesignerSupport/CodeBehindService.cs:
- Added an Initialise method to CodeBehindService so that it can
- subscribe to project events.
-
- * MonoDevelop.DesignerSupport.CodeBehind/ICodeBehindProvider.cs:
- Completely changed the way the Codebehind bindings are provided.
-
- * MonoDevelop.DesignerSupport/CodeBehindService.cs:
- Keep a list of CodeBehind bindings and update it as file change and
- class change events come in.
- Fire CodeBehind change events when anything is updated.
-
- * MonoDevelop.DesignerSupport.CodeBehind/CodeBehindClassBuilder.cs:
- If CodeBehind class cannot be found, display a notice to that effect.
-
- * MonoDevelop.DesignerSupport.CodeBehind/CodeBehindProjectFileExtension.cs:
- Only hide class files if they just contain a single codebehind file.
- Use events from CodeBehindService to rebuild nodes selectively.
-
-2007-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/WrapperDesignView.cs: Use the new
- GetContent method instead of casting the view to the required
- interface.
-
-2007-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport.mdp: Updated.
- * MonoDevelop.DesignerSupport/BindingService.cs,
- MonoDevelop.DesignerSupport/WrapperDesignView.cs: Track api changes
- in Document class.
-
-2006-11-14 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Makefile.am:
- * MonoDevelop.DesignerSupport.mdp: Updated.
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs:
- * MonoDevelop.DesignerSupport/ToolboxService.cs:
- * MonoDevelop.DesignerSupport/DesignerSupportService.cs: Renamed
- ToolboxService.(Load|Save)Contents to (Load|Save)SaveUserToolbox.
-
- * MonoDevelop.DesignerSupport.Toolbox/IToolboxProvider.cs: New file.
- * MonoDevelop.DesignerSupport.addin.xml:
- * MonoDevelop.DesignerSupport/ToolboxService.cs:
- New IToolboxDefaultProvider and IToolboxDynamicProvider extension
- points so that AddIns can provide default and dynamic toolbox items.
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs: Split allItems source
- of toolbox items. It now sources from userItems, defaultItems and
- dynamicProviders.
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxList.cs: New file.
- Expanded ToolboxList to handle loading/saving functionality.
-
- * MonoDevelop.DesignerSupport.Toolbox/IToolboxConsumer.cs: Removed
- GetDynamicItems method; this functionality can now be implemented
- separately as a dynamic toolbox provider.
-
- * MonoDevelop.DesignerSupport.Toolbox/ItemToolboxNode.cs:
- * MonoDevelop.DesignerSupport.Toolbox/TypeToolboxNode.cs:
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxNode.cs:
- Proper Equals implementation, so that we can avoid node duplication.
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxLoader.cs:
- New overload for Load using an Assembly instead of a filename.
-
-2006-10-21 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxLoader.cs:
- Record the assembly location if it did not come from the GAC.
- * MonoDevelop.DesignerSupport.Toolbox/TypeToolboxNode.cs:
- Avoid trying to load from GAC when we actually have the assembly
- location, so avoiding an exception.
- Together these are part 2 of getting custom controls to load.
-
- * MonoDevelop.DesignerSupport.Toolbox/TypeToolboxNode.cs:
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxNode.cs:
- Helper constructors for recording assembly location for types that
- come from non-GAC assemblies.
-
-2006-09-16 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.DesignerSupport/BindingService.cs: Refactor a lot of code
- from AddMemberToClass into GetCompatibleMemberInClass, because it's
- useful separately.
-
-2006-08-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.addin.xml:
- Updated add-in dependencies.
-
-2006-08-21 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.DesignerSupport.CodeBehind/CodeBehindDisplayBinding.cs:
- Disable CodeBehind display binding. Needs some works on Core to make
- it work properly.
-
-2006-08-05 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.DesignerSupport/ToolboxPad.cs:
- Clean up namespace alias.
-
- * MonoDevelop.DesignerSupport/BindingService.cs:
- Add a lot of methods to support AspNetEdit event binding.
- Make static, because there's nothing large to initialise.
- Enable refactoring of open files (broken for secondary ViewContents).
-
- * MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs:
- Fix exception handling and GUI threading.
-
- * MonoDevelop.DesignerSupport/DesignerSupportService.cs:
- Remove Binding service; it's now static.
-
- * MonoDevelop.DesignerSupport/WrapperDesignView.cs:
- Dispose child ViewContent content.
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs:
- * MonoDevelop.DesignerSupport.Toolbox/IToolboxConsumer.cs:
- Support for displaying dynamic items provided by current consumer.
- Rename Use method to ConsumeItem.
- Hide UnknownToolboxNodes.
-
- * MonoDevelop.DesignerSupport.CodeBehind/CodeBehindDisplayBinding.cs:
- Load file into child view. No idea why this was working before.
-
- * MonoDevelop.DesignerSupport/ToolboxPad.cs:
- * MonoDevelop.DesignerSupport/BindingService.cs:
- * MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs:
- * MonoDevelop.DesignerSupport/DesignerSupportService.cs:
- * MonoDevelop.DesignerSupport/CodeBehindService.cs:
- * MonoDevelop.DesignerSupport/MemberExistsException.cs:
- * MonoDevelop.DesignerSupport/ToolboxService.cs:
- * MonoDevelop.DesignerSupport/PropertyPad.cs:
- * MonoDevelop.DesignerSupport.CodeBehind/CodeBehindDisplayBinding.cs:
- * MonoDevelop.DesignerSupport.CodeBehind/ICodeBehindProvider.cs:
- * MonoDevelop.DesignerSupport.Toolbox/IToolboxConsumer.cs:
- * MonoDevelop.DesignerSupport.Toolbox/UnknownToolboxNode.cs:
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxLoader.cs:
- * MonoDevelop.DesignerSupport.Toolbox/IToolboxLoader.cs:
- Add missing copyright information.
-
-2006-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.DesignerSupport/WrapperDesignView.cs: Add support
- for IEncodedTextContent.
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs: Fix build for
- gtk# 2.4.
-
-2006-07-29 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs:
- More flexible exception handling, and display errors.
-
- * MonoDevelop.DesignerSupport/WrapperDesignView.cs:
- Add a means of adding a 'bar' to the top of the view.
- * MonoDevelop.DesignerSupport.CodeBehind/CodeBehindViewContent.cs:
- Move file name from tab to top 'bar'.
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs:
- Rename OnToolboxChanged to OnToolboxContentChanged to remove ambiguity.
- Re-enable contextual filtering.
- Use project service's DataContext for serialisation.
-
- * MonoDevelop.DesignerSupport/PropertyPad.cs:
- Remove shadow from frame.
-
- * MonoDevelop.DesignerSupport.Toolbox/ItemToolboxNode.cs:
- * MonoDevelop.DesignerSupport.Toolbox/TypeToolboxNode.cs:
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxNode.cs:
- * MonoDevelop.DesignerSupport.Toolbox/BaseToolboxNode.cs:
- Fix serialisation, both for persisting toolbox and for remoting
- toolbox nodes.
-
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs:
- Track OnToolboxChanged name change.
-
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyGrid.cs:
- Reduce height of help pane.
- Make sure that image resource comes from correct assembly when remoting.
-
-2006-07-25 Matej Urbas <matej.urbas@gmail.com>
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs: Prevent null
- exception when all documents are closed.
-
-2006-07-25 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.DesignerSupport.mdp:
- * Makefile.am: Add files to build.
-
- * MonoDevelop.DesignerSupport/BindingService.cs:
- * MonoDevelop.DesignerSupport/MemberExistsException.cs:
- * MonoDevelop.DesignerSupport/DesignerSupportService.cs:
- New service, assists with adding CodeBehind memebers. Incomplete.
-
- * MonoDevelop.DesignerSupport/RemoteDesignerProcess.cs: Base class for
- remoted designer, handles Gtk.Sockets and the Gtk# thread.
-
- * MonoDevelop.DesignerSupport/WrapperDesignView.cs: Override base member
- instead of hiding it.
-
- * MonoDevelop.DesignerSupport/PropertyPad.cs:
- Fix widget reparenting.
-
-2006-07-25 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.DesignerSupport/ToolboxService.cs: Close file after
- deserialising toolbox.
-
-2006-07-21 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.DesignerSupport/DesignerSupportService.cs:
- Store toolbox data in the correct location.
- * ChangeLog: add missing entries.
-
-2006-07-21 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/*:
- * MonoDevelop.DesignerSupport.PropertyGrid/*:
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/*:
- * MonoDevelop.DesignerSupport/*:
- * MonoDevelop.DesignerSupport.CodeBehind/*:
- * Makefile.am:
- * MonoDevelop.DesignerSupport.addin.xml:
- * MonoDevelop.DesignerSupport.mdp:
- * icons/*:
- Import the Designer Support addin.
-
-2006-07-21 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/*:
- * MonoDevelop.DesignerSupport.PropertyGrid/*:
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/*:
- Import AspNetEdit property grid and toolbox.
-
-2006-04-27 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/CategoryToolboxNode.cs:
- Make sure we cover all items in filtering loop.
-
-2006-04-27 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxNode.cs:
- Accessor for ToolboxItem.
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxStore.cs:
- Don't rebuild after blank filter.
- * MonoDevelop.DesignerSupport.Toolbox/CategoryToolboxNode.cs:
- Add Clear () method to remove all children.
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs:
- Get categories from ToolboxService, and maintain expansion
- and selection state where possible.
-
-2006-04-26 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.DesignerSupport.Toolbox/BaseToolboxNode.cs:
- * MonoDevelop.DesignerSupport.Toolbox/CategoryToolboxNode.cs:
- * MonoDevelop.DesignerSupport.Toolbox/ItemToolboxNode.cs:
- * MonoDevelop.DesignerSupport.Toolbox/TextToolboxNode.cs:
- * MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs:
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxItemToolboxNode.cs:
- * MonoDevelop.DesignerSupport.Toolbox/ToolboxStore.cs:
- Add new NodeStore-based Toolbox.
-
- * MonoDevelop.DesignerSupport.PropertyGrid/PropertyGrid.cs:
- Add Refresh method as interim workaround for not being
- able to track externally changed values of properties.
-
-2006-01-16 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.DesignerSupport.PropertyGrid.Editors/StringEditor.cs:
- Write helpful trace message after swallowing PropertyConverter failure.
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ComponentNodeBuilder.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ComponentNodeBuilder.cs
index 2505bd214e..eec13371ac 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ComponentNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ComponentNodeBuilder.cs
@@ -42,9 +42,9 @@ namespace MonoDevelop.DesignerSupport.Projects
// Don't use the CurrentNode property here since it may not be properly initialized when the event is fired.
ITreeNavigator nav = Tree.GetNodeAtObject (obj);
if (nav != null) {
- IWorkspaceFileObject ce = (IWorkspaceFileObject) nav.GetParentDataItem (typeof(IWorkspaceFileObject), true);
+ var ce = nav.GetParentDataItem<WorkspaceObject> (true);
if (ce != null) {
- IdeApp.ProjectOperations.Save (ce);
+ IdeApp.ProjectOperations.SaveAsync (ce);
return;
}
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/PropertyPadTextEditorExtension.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/PropertyPadTextEditorExtension.cs
index d97b8c2284..356dcaf632 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/PropertyPadTextEditorExtension.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/PropertyPadTextEditorExtension.cs
@@ -28,6 +28,7 @@
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide;
+using MonoDevelop.Ide.Editor.Extension;
namespace MonoDevelop.DesignerSupport.Projects
{
@@ -42,9 +43,9 @@ namespace MonoDevelop.DesignerSupport.Projects
{
// Return the ProjectFile object of the file being edited
- if (Document.HasProject) {
- string file = Document.FileName;
- return Document.Project.Files.GetFile (file);
+ if (DocumentContext.HasProject) {
+ string file = DocumentContext.Name;
+ return DocumentContext.Project.Files.GetFile (file);
}
else
return null;
@@ -61,8 +62,8 @@ namespace MonoDevelop.DesignerSupport.Projects
public void OnChanged (object obj)
{
- if (Document.HasProject)
- IdeApp.ProjectOperations.Save (Document.Project);
+ if (DocumentContext.HasProject)
+ IdeApp.ProjectOperations.SaveAsync (DocumentContext.Project);
}
}
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/SolutionItemDescriptor.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/SolutionItemDescriptor.cs
index 95721e4e71..54c19f43e9 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/SolutionItemDescriptor.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/SolutionItemDescriptor.cs
@@ -33,9 +33,9 @@ namespace MonoDevelop.DesignerSupport.Projects
{
class SolutionItemDescriptor: CustomDescriptor
{
- SolutionItem entry;
+ SolutionFolderItem entry;
- public SolutionItemDescriptor (SolutionItem entry)
+ public SolutionItemDescriptor (SolutionFolderItem entry)
{
this.entry = entry;
}
@@ -58,8 +58,8 @@ namespace MonoDevelop.DesignerSupport.Projects
[LocalizedDescription ("File path of the solution item.")]
public string FilePath {
get {
- if (entry is SolutionEntityItem)
- return ((SolutionEntityItem) entry).FileName;
+ if (entry is SolutionItem)
+ return ((SolutionItem) entry).FileName;
else
return "";
}
@@ -77,5 +77,14 @@ namespace MonoDevelop.DesignerSupport.Projects
entry.BaseDirectory = value;
}
}
+
+ [LocalizedCategory ("Misc")]
+ [LocalizedDisplayName ("File Format")]
+ [LocalizedDescription ("File format of the project file.")]
+ public string FileFormat {
+ get {
+ return entry.ParentSolution.FileFormat.ProductDescription;
+ }
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/SolutionItemPropertyProvider.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/SolutionItemPropertyProvider.cs
index bfa8ea1faf..2753614d1a 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/SolutionItemPropertyProvider.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/SolutionItemPropertyProvider.cs
@@ -38,12 +38,12 @@ namespace MonoDevelop.DesignerSupport.Projects
if (obj is WorkspaceItem)
return new WorkspaceItemDescriptor ((WorkspaceItem)obj);
else
- return new SolutionItemDescriptor ((SolutionItem)obj);
+ return new SolutionItemDescriptor ((SolutionFolderItem)obj);
}
public bool SupportsObject (object obj)
{
- return obj is SolutionItem || obj is WorkspaceItem;
+ return obj is SolutionFolderItem || obj is WorkspaceItem;
}
}
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/WorkspaceItemDescriptor.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/WorkspaceItemDescriptor.cs
index d742398ef3..df8ff31114 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/WorkspaceItemDescriptor.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/WorkspaceItemDescriptor.cs
@@ -77,7 +77,7 @@ namespace MonoDevelop.DesignerSupport.Projects
[LocalizedDescription ("File format of the project file.")]
public string FileFormat {
get {
- return item.FileFormat.Name;
+ return item is Solution ? ((Solution)item).FileFormat.ProductDescription : "";
}
}
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/CodeTemplateToolboxProvider.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/CodeTemplateToolboxProvider.cs
index bb48770836..5f2514e67b 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/CodeTemplateToolboxProvider.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/CodeTemplateToolboxProvider.cs
@@ -29,6 +29,8 @@
using System;
using MonoDevelop.Ide.CodeTemplates;
using MonoDevelop.Ide;
+using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.DesignerSupport.Toolbox
{
@@ -40,11 +42,9 @@ namespace MonoDevelop.DesignerSupport.Toolbox
public System.Collections.Generic.IEnumerable<ItemToolboxNode> GetDynamicItems (IToolboxConsumer consumer)
{
-
- MonoDevelop.Ide.Gui.Content.IExtensibleTextEditor editor
- = consumer as MonoDevelop.Ide.Gui.Content.IExtensibleTextEditor;
+ var editor = consumer as IReadonlyTextDocument;
if (editor != null) {
- foreach (CodeTemplate ct in CodeTemplateService.GetCodeTemplatesForFile (editor.Name)) {
+ foreach (CodeTemplate ct in CodeTemplateService.GetCodeTemplatesForFile (editor.FileName)) {
if (ct.CodeTemplateContext != CodeTemplateContext.Standard)
continue;
yield return new TemplateToolboxNode (ct) {
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ComponentSelectorDialog.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ComponentSelectorDialog.cs
index a257f5a9ca..2d32c17973 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ComponentSelectorDialog.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ComponentSelectorDialog.cs
@@ -57,10 +57,11 @@ namespace MonoDevelop.DesignerSupport.Toolbox
public ComponentSelectorDialog (IToolboxConsumer currentConsumer)
{
- using (IProgressMonitor monitor = new MessageDialogProgressMonitor (true, true, false, true)) {
+ using (ProgressMonitor monitor = new MessageDialogProgressMonitor (true, true, false, true)) {
index = DesignerSupport.Service.ToolboxService.GetComponentIndex (monitor);
}
-
+
+ this.ApplyTheme ();
this.Build();
store = new TreeStore (typeof(bool), typeof(string), typeof(string), typeof(string), typeof(string), typeof(Xwt.Drawing.Image), typeof(ItemToolboxNode), typeof(bool), typeof(int));
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/IToolboxLoader.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/IToolboxLoader.cs
index f7fad29038..f5e8edc5b8 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/IToolboxLoader.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/IToolboxLoader.cs
@@ -64,7 +64,7 @@ namespace MonoDevelop.DesignerSupport.Toolbox
ExternalLoader eloader;
if (!externalLoaders.TryGetValue (runtime, out eloader)) {
- eloader = (ExternalLoader) Runtime.ProcessService.CreateExternalProcessObject (typeof(ExternalLoader), runtime);
+ eloader = (ExternalLoader) Runtime.ProcessService.CreateExternalProcessObject (typeof(ExternalLoader), runtime.GetExecutionHandler ());
externalLoaders [runtime] = eloader;
values [counter++] = eloader;
} else {
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ItemToolboxNode.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ItemToolboxNode.cs
index f719a3468b..263f31f300 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ItemToolboxNode.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ItemToolboxNode.cs
@@ -58,7 +58,10 @@ namespace MonoDevelop.DesignerSupport.Toolbox
string category = "";
[ItemProperty ("description")]
- string description = "";
+ string description = "";
+
+ [ItemProperty ("source")]
+ string source = "";
List <ToolboxItemFilterAttribute> itemFilters = new List <ToolboxItemFilterAttribute> ();
@@ -94,6 +97,11 @@ namespace MonoDevelop.DesignerSupport.Toolbox
public virtual string Description {
get { return description; }
set { description = value; }
+ }
+
+ public virtual string Source {
+ get { return source; }
+ set { source = value; }
}
[Browsable(false)]
@@ -113,13 +121,14 @@ namespace MonoDevelop.DesignerSupport.Toolbox
public virtual bool Filter (string keyword)
{
return ((Name != null) && (Name.IndexOf (keyword, StringComparison.InvariantCultureIgnoreCase) >= 0))
- || ((Description != null) && (Description.IndexOf (keyword, StringComparison.InvariantCultureIgnoreCase) >= 0));
+ || ((Description != null) && (Description.IndexOf (keyword, StringComparison.InvariantCultureIgnoreCase) >= 0))
+ || ((Source != null) && (Source.IndexOf (keyword, StringComparison.InvariantCultureIgnoreCase) >= 0));
}
public override bool Equals (object o)
{
ItemToolboxNode node = o as ItemToolboxNode;
- return (node != null) && (node.Name == this.Name) && (node.Category == this.Category) && (node.Description == this.Description);
+ return (node != null) && (node.Name == this.Name) && (node.Category == this.Category) && (node.Description == this.Description) && (node.Source == this.Source);
}
public override int GetHashCode ()
@@ -131,6 +140,8 @@ namespace MonoDevelop.DesignerSupport.Toolbox
code ^= Category.GetHashCode ();
if (Description != null)
code ^= Description.GetHashCode ();
+ if (Source != null)
+ code ^= Source.GetHashCode ();
return code;
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs
index 0a8b4f495a..bda69169b5 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/Toolbox.cs
@@ -38,7 +38,6 @@ using MonoDevelop.Ide.Gui;
using MonoDevelop.Components.Commands;
using MonoDevelop.Components.Docking;
using MonoDevelop.Ide;
-using Mono.TextEditor;
using MonoDevelop.Components;
namespace MonoDevelop.DesignerSupport.Toolbox
@@ -67,7 +66,7 @@ namespace MonoDevelop.DesignerSupport.Toolbox
this.container = container;
#region Toolbar
- DockItemToolbar toolbar = container.GetToolbar (PositionType.Top);
+ DockItemToolbar toolbar = container.GetToolbar (DockPositionType.Top);
filterEntry = new SearchEntry();
filterEntry.Ready = true;
@@ -79,7 +78,7 @@ namespace MonoDevelop.DesignerSupport.Toolbox
toolbar.Add (filterEntry, true);
catToggleButton = new ToggleButton ();
- catToggleButton.Image = new Image (Ide.Gui.Stock.GroupByCategory, IconSize.Menu);
+ catToggleButton.Image = new ImageView (Ide.Gui.Stock.GroupByCategory, IconSize.Menu);
catToggleButton.Toggled += new EventHandler (toggleCategorisation);
catToggleButton.TooltipText = GettextCatalog.GetString ("Show categories");
toolbar.Add (catToggleButton);
@@ -90,7 +89,7 @@ namespace MonoDevelop.DesignerSupport.Toolbox
compactModeToggleButton.TooltipText = GettextCatalog.GetString ("Use compact display");
toolbar.Add (compactModeToggleButton);
- toolboxAddButton = new Button (new Gtk.Image (Ide.Gui.Stock.Add, IconSize.Menu));
+ toolboxAddButton = new Button (new ImageView (Ide.Gui.Stock.Add, IconSize.Menu));
toolbar.Add (toolboxAddButton);
toolboxAddButton.TooltipText = GettextCatalog.GetString ("Add toolbox items");
toolboxAddButton.Clicked += new EventHandler (toolboxAddButton_Clicked);
@@ -229,7 +228,7 @@ namespace MonoDevelop.DesignerSupport.Toolbox
public void Refresh ()
{
// GUI assert here is to catch Bug 434065 - Exception while going to the editor
- DispatchService.AssertGuiThread ();
+ Runtime.AssertMainThread ();
if (toolboxService.Initializing) {
toolboxWidget.CustomMessage = GettextCatalog.GetString ("Initializing...");
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs
index d15045ffbc..15e5dcc830 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs
@@ -32,7 +32,6 @@ using System.Collections.ObjectModel;
using Gtk;
using Pango;
using Gdk;
-using Mono.TextEditor;
using MonoDevelop.Ide;
using MonoDevelop.Components;
@@ -205,11 +204,6 @@ namespace MonoDevelop.DesignerSupport.Toolbox
const int ItemIconTextItemSpacing = 4;
const int IconModePadding = 2;
- static readonly Cairo.Color CategoryBackgroundGradientStartColor = new Cairo.Color (248d/255d, 248d/255d, 248d/255d);
- static readonly Cairo.Color CategoryBackgroundGradientEndColor = new Cairo.Color (240d/255d, 240d/255d, 240d/255d);
- static readonly Cairo.Color CategoryBorderColor = new Cairo.Color (217d/255d, 217d/255d, 217d/255d);
- static readonly Cairo.Color CategoryLabelColor = new Cairo.Color (128d/255d, 128d/255d, 128d/255d);
-
protected override bool OnExposeEvent (Gdk.EventExpose e)
{
Cairo.Context cr = Gdk.CairoHelper.Create (e.Window);
@@ -253,24 +247,21 @@ namespace MonoDevelop.DesignerSupport.Toolbox
if (!area.IntersectsWith (new Gdk.Rectangle (new Gdk.Point (xpos, ypos), itemDimension)))
return true;
cr.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height);
- using (var pat = new Cairo.LinearGradient (xpos, ypos, xpos, ypos + itemDimension.Height)) {
- pat.AddColorStop (0, CategoryBackgroundGradientStartColor);
- pat.AddColorStop (1, CategoryBackgroundGradientEndColor);
- cr.SetSource (pat);
- cr.Fill ();
- }
+ cr.SetSourceColor (Ide.Gui.Styles.PadCategoryBackgroundColor.ToCairoColor ());
+ cr.Fill ();
+
if (lastCategory == null || lastCategory.IsExpanded || lastCategory.AnimatingExpand) {
cr.MoveTo (xpos, ypos + 0.5);
cr.LineTo (itemDimension.Width, ypos + 0.5);
}
cr.MoveTo (0, ypos + itemDimension.Height - 0.5);
cr.LineTo (xpos + Allocation.Width, ypos + itemDimension.Height - 0.5);
- cr.SetSourceColor (CategoryBorderColor);
+ cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryBorderColor.ToCairoColor ());
cr.Stroke ();
- headerLayout.SetText (category.Text);
+ headerLayout.SetMarkup (category.Text);
int width, height;
- cr.SetSourceColor (CategoryLabelColor);
+ cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryLabelColor.ToCairoColor ());
layout.GetPixelSize (out width, out height);
cr.MoveTo (xpos + CategoryLeftPadding, ypos + (double)(Math.Round ((double)(itemDimension.Height - height) / 2)));
Pango.CairoHelper.ShowLayout (cr, headerLayout);
@@ -285,22 +276,24 @@ namespace MonoDevelop.DesignerSupport.Toolbox
}, delegate (Category curCategory, Item item, Gdk.Size itemDimension) {
if (!area.IntersectsWith (new Gdk.Rectangle (new Gdk.Point (xpos, ypos), itemDimension)))
return true;
-
+
+ var icon = item.Icon;
if (item == SelectedItem) {
+ icon = icon.WithStyles ("sel");
cr.SetSourceColor (Style.Base (StateType.Selected).ToCairoColor ());
cr.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height);
cr.Fill ();
}
if (listMode || !curCategory.CanIconizeItems) {
- cr.DrawImage (this, item.Icon, xpos + ItemLeftPadding, ypos + Math.Round ((itemDimension.Height - item.Icon.Height) / 2));
- layout.SetText (item.Text);
+ cr.DrawImage (this, icon, xpos + ItemLeftPadding, ypos + Math.Round ((itemDimension.Height - icon.Height) / 2));
+ layout.SetMarkup (item.Text);
int width, height;
layout.GetPixelSize (out width, out height);
cr.SetSourceColor (Style.Text (item != this.SelectedItem ? StateType.Normal : StateType.Selected).ToCairoColor ());
cr.MoveTo (xpos + ItemLeftPadding + IconSize.Width + ItemIconTextItemSpacing, ypos + (double)(Math.Round ((double)(itemDimension.Height - height) / 2)));
Pango.CairoHelper.ShowLayout (cr, layout);
} else {
- cr.DrawImage (this, item.Icon, xpos + Math.Round ((itemDimension.Width - item.Icon.Width) / 2), ypos + Math.Round ((itemDimension.Height - item.Icon.Height) / 2));
+ cr.DrawImage (this, icon, xpos + Math.Round ((itemDimension.Width - icon.Width) / 2), ypos + Math.Round ((itemDimension.Height - icon.Height) / 2));
}
if (item == mouseOverItem) {
@@ -318,7 +311,7 @@ namespace MonoDevelop.DesignerSupport.Toolbox
// Closing line when animating the last group of the toolbox
cr.MoveTo (area.X, ypos + 0.5);
cr.RelLineTo (area.Width, 0);
- cr.SetSourceColor (CategoryBorderColor);
+ cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.PadCategoryBorderColor.ToCairoColor ());
cr.Stroke ();
}
@@ -836,7 +829,7 @@ namespace MonoDevelop.DesignerSupport.Toolbox
int x, y = item.ItemHeight;
if (y == 0) {
- layout.SetText (item.Text);
+ layout.SetMarkup (item.Text);
layout.GetPixelSize (out x, out y);
y = Math.Max (IconSize.Height, y);
y += ItemTopBottomPadding * 2;
@@ -876,7 +869,7 @@ namespace MonoDevelop.DesignerSupport.Toolbox
int x, y = category.ItemHeight;
if (y == 0) {
- layout.SetText (category.Text);
+ layout.SetMarkup (category.Text);
layout.GetPixelSize (out x, out y);
y += CategoryTopBottomPadding * 2;
category.ItemHeight = y;
@@ -1135,8 +1128,14 @@ namespace MonoDevelop.DesignerSupport.Toolbox
public string Text {
get {
- if (node != null)
- return node.Name;
+ if (node != null) {
+ var t = GLib.Markup.EscapeText (node.Name);
+ if (!string.IsNullOrEmpty (node.Source)) {
+ var c = MonoDevelop.Ide.Gui.Styles.DimTextColor.ToHexString ().Substring (0, 7);
+ t += string.Format (" <span size=\"smaller\" color=\"{1}\">{0}</span>", node.Source, c);
+ }
+ return t;
+ }
return text;
}
}
@@ -1183,7 +1182,7 @@ namespace MonoDevelop.DesignerSupport.Toolbox
public Item (Xwt.Drawing.Image icon, string text, string tooltip, object tag)
{
this.icon = icon;
- this.text = text;
+ this.text = GLib.Markup.EscapeText (text);
this.tooltip = tooltip;
this.tag = tag;
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/TypeReference.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/TypeReference.cs
index 2cde0bbec1..74fb08fe4c 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/TypeReference.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/TypeReference.cs
@@ -155,13 +155,9 @@ namespace MonoDevelop.DesignerSupport.Toolbox
public MonoDevelop.Projects.ProjectReference GetProjectReference ()
{
if (string.IsNullOrEmpty (assemblyLocation)) {
- return new MonoDevelop.Projects.ProjectReference (
- MonoDevelop.Projects.ReferenceType.Package,
- assemblyName);
+ return MonoDevelop.Projects.ProjectReference.CreateAssemblyReference (assemblyName);
} else {
- return new MonoDevelop.Projects.ProjectReference (
- MonoDevelop.Projects.ReferenceType.Assembly,
- assemblyLocation);
+ return MonoDevelop.Projects.ProjectReference.CreateAssemblyFileReference (assemblyLocation);
}
}
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.addin.xml b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.addin.xml
index 47bd4434ec..da0c3b2c3f 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.addin.xml
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.addin.xml
@@ -115,7 +115,6 @@
<Extension path = "/MonoDevelop/Ide/TextEditorExtensions">
<Class class = "MonoDevelop.DesignerSupport.Projects.PropertyPadTextEditorExtension" />
- <Class class = "MonoDevelop.DesignerSupport.ClassOutlineTextEditorExtension" />
</Extension>
<Extension path = "/MonoDevelop/DesignerSupport/ToolboxProviders">
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj
index 39b8165b52..330da725d4 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.csproj
@@ -63,6 +63,18 @@
</Reference>
<Reference Include="System.Core" />
<Reference Include="Mono.Cairo" />
+ <Reference Include="System.Reflection.Metadata">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Reflection.Metadata.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Collections.Immutable">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Collections.Immutable.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
@@ -75,26 +87,11 @@
<Name>MonoDevelop.Ide</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
- <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
- <Name>Mono.TextEditor</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\..\..\external\cecil\Mono.Cecil.csproj">
<Project>{D68133BD-1E63-496E-9EDE-4FBDBF77B486}</Project>
<Name>Mono.Cecil</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
- <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
- <Name>ICSharpCode.NRefactory</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory.CSharp\ICSharpCode.NRefactory.CSharp.csproj">
- <Project>{53DCA265-3C3C-42F9-B647-F72BA678122B}</Project>
- <Name>ICSharpCode.NRefactory.CSharp</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\..\..\external\mono-addins\Mono.Addins\Mono.Addins.csproj">
<Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
<Name>Mono.Addins</Name>
@@ -143,7 +140,6 @@
<Compile Include="MonoDevelop.DesignerSupport.Toolbox\CodeTemplateToolboxProvider.cs" />
<Compile Include="MonoDevelop.DesignerSupport.Toolbox\CecilToolboxItemLoader.cs" />
<Compile Include="MonoDevelop.DesignerSupport.Toolbox\CecilTypeResolver.cs" />
- <Compile Include="MonoDevelop.DesignerSupport\ClassOutlineTextEditorExtension.cs" />
<Compile Include="MonoDevelop.DesignerSupport\CodeBehind.cs" />
<Compile Include="AssemblyInfo.cs" />
<Compile Include="MonoDevelop.DesignerSupport.Toolbox\TemplateToolboxNode.cs" />
@@ -159,10 +155,6 @@
<Compile Include="MonoDevelop.DesignerSupport\IPropertyPadProvider.cs" />
<Compile Include="MonoDevelop.DesignerSupport\CodeBehindWriter.cs" />
<Compile Include="MonoDevelop.DesignerSupport\SwitchBetweenRelatedFilesCommand.cs" />
- <Compile Include="MonoDevelop.DesignerSupport\ClassOutlineNodeComparer.cs" />
- <Compile Include="MonoDevelop.DesignerSupport\ClassOutlineSortingPreferencesDialog.cs" />
- <Compile Include="gtk-gui\MonoDevelop.DesignerSupport.ClassOutlineSortingPreferencesDialog.cs" />
- <Compile Include="MonoDevelop.DesignerSupport\ClassOutlineSettings.cs" />
<Compile Include="MonoDevelop.DesignerSupport.Toolbox\IToolboxCustomizer.cs" />
<Compile Include="AddinInfo.cs" />
<Compile Include="MonoDevelop.DesignerSupport.Projects\ImplicitFrameworkAssemblyReferenceDescriptor.cs" />
@@ -180,24 +172,84 @@
<EmbeddedResource Include="icons\compact-display-16%402x.png">
<LogicalName>compact-display-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\compact-display-16~dark.png">
+ <LogicalName>compact-display-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\compact-display-16~dark%402x.png">
+ <LogicalName>compact-display-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\pad-properties-16.png">
<LogicalName>pad-properties-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\pad-properties-16%402x.png">
<LogicalName>pad-properties-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-properties-16~dark.png">
+ <LogicalName>pad-properties-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-properties-16~dark%402x.png">
+ <LogicalName>pad-properties-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-properties-16~sel.png">
+ <LogicalName>pad-properties-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-properties-16~sel%402x.png">
+ <LogicalName>pad-properties-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-properties-16~dark~sel.png">
+ <LogicalName>pad-properties-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-properties-16~dark~sel%402x.png">
+ <LogicalName>pad-properties-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\pad-toolbox-16.png">
<LogicalName>pad-toolbox-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\pad-toolbox-16%402x.png">
<LogicalName>pad-toolbox-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-toolbox-16~dark.png">
+ <LogicalName>pad-toolbox-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-toolbox-16~dark%402x.png">
+ <LogicalName>pad-toolbox-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-toolbox-16~sel.png">
+ <LogicalName>pad-toolbox-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-toolbox-16~sel%402x.png">
+ <LogicalName>pad-toolbox-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-toolbox-16~dark~sel.png">
+ <LogicalName>pad-toolbox-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-toolbox-16~dark~sel%402x.png">
+ <LogicalName>pad-toolbox-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\pad-document-outline-16.png">
<LogicalName>pad-document-outline-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\pad-document-outline-16%402x.png">
<LogicalName>pad-document-outline-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-document-outline-16~dark.png">
+ <LogicalName>pad-document-outline-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-document-outline-16~dark%402x.png">
+ <LogicalName>pad-document-outline-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-document-outline-16~sel.png">
+ <LogicalName>pad-document-outline-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-document-outline-16~sel%402x.png">
+ <LogicalName>pad-document-outline-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-document-outline-16~dark~sel.png">
+ <LogicalName>pad-document-outline-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-document-outline-16~dark~sel%402x.png">
+ <LogicalName>pad-document-outline-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="Makefile.am" />
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/BindingService.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/BindingService.cs
index 86d068d441..445685d6b9 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/BindingService.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/BindingService.cs
@@ -29,18 +29,18 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+// TODO: Roslyn port. (Maybe move to the ASP.NET binding).
using System;
using System.CodeDom;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis;
using MonoDevelop.Projects;
using MonoDevelop.Core;
using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem.Implementation;
-using System.Linq;
using MonoDevelop.Ide.TypeSystem;
namespace MonoDevelop.DesignerSupport
@@ -51,165 +51,165 @@ namespace MonoDevelop.DesignerSupport
{
//TODO: currently case-sensitive, so some languages may not like this
const bool ignoreCase = false;
-
- public static IUnresolvedMember GetCompatibleMemberInClass (ICompilation ctx, ITypeDefinition cls, CodeTypeMember member)
- {
- // TODO Type system conversion
-// //check for identical property names
-// foreach (var prop in cls.Properties) {
-// if (string.Compare (prop.Name, member.Name, StringComparison.OrdinalIgnoreCase) == 0) {
-// string rt = prop.ReturnType.ReflectionName;
-// EnsureClassExists (ctx, rt, GetValidRegion (prop));
-// CodeMemberProperty memProp = member as CodeMemberProperty;
-// if (memProp == null || !IsTypeCompatible (ctx, rt, memProp.Type.BaseType))
-// throw new MemberExistsException (cls.FullName, MemberType.Property, member, GetValidRegion (prop), cls.Region.FileName);
-// return prop;
-// }
-// }
-//
-// //check for identical method names
-// foreach (var meth in cls.Methods) {
-// if (string.Compare (meth.Name, member.Name, StringComparison.OrdinalIgnoreCase) == 0) {
-// string rt = meth.ReturnType.ReflectionName;
-// EnsureClassExists (ctx, rt, GetValidRegion (meth));
-// CodeMemberMethod memMeth = member as CodeMemberMethod;
-// if (memMeth == null || !IsTypeCompatible (ctx, rt, memMeth.ReturnType.BaseType))
-// throw new MemberExistsException (cls.FullName, MemberType.Method, member, GetValidRegion (meth), cls.Region.FileName);
-// return meth;
-// }
-// }
+
+// public static IUnresolvedMember GetCompatibleMemberInClass (ICompilation ctx, ITypeDefinition cls, CodeTypeMember member)
+// {
+// // TODO Type system conversion
+//// //check for identical property names
+//// foreach (var prop in cls.Properties) {
+//// if (string.Compare (prop.Name, member.Name, StringComparison.OrdinalIgnoreCase) == 0) {
+//// string rt = prop.ReturnType.ReflectionName;
+//// EnsureClassExists (ctx, rt, GetValidRegion (prop));
+//// CodeMemberProperty memProp = member as CodeMemberProperty;
+//// if (memProp == null || !IsTypeCompatible (ctx, rt, memProp.Type.BaseType))
+//// throw new MemberExistsException (cls.FullName, MemberType.Property, member, GetValidRegion (prop), cls.Region.FileName);
+//// return prop;
+//// }
+//// }
+////
+//// //check for identical method names
+//// foreach (var meth in cls.Methods) {
+//// if (string.Compare (meth.Name, member.Name, StringComparison.OrdinalIgnoreCase) == 0) {
+//// string rt = meth.ReturnType.ReflectionName;
+//// EnsureClassExists (ctx, rt, GetValidRegion (meth));
+//// CodeMemberMethod memMeth = member as CodeMemberMethod;
+//// if (memMeth == null || !IsTypeCompatible (ctx, rt, memMeth.ReturnType.BaseType))
+//// throw new MemberExistsException (cls.FullName, MemberType.Method, member, GetValidRegion (meth), cls.Region.FileName);
+//// return meth;
+//// }
+//// }
+////
+//// //check for identical event names
+//// foreach (var ev in cls.Events) {
+//// if (string.Compare (ev.Name, member.Name, StringComparison.OrdinalIgnoreCase) == 0) {
+//// string rt = ev.ReturnType.ReflectionName;
+//// EnsureClassExists (ctx, rt, GetValidRegion (ev));
+//// CodeMemberEvent memEv = member as CodeMemberEvent;
+//// if (memEv == null || !IsTypeCompatible (ctx, rt, memEv.Type.BaseType))
+//// throw new MemberExistsException (cls.FullName, MemberType.Event, member, GetValidRegion (ev), cls.Region.FileName);
+//// return ev;
+//// }
+//// }
+////
+//// //check for identical field names
+//// foreach (var field in cls.Fields) {
+//// if (string.Compare (field.Name, member.Name, StringComparison.OrdinalIgnoreCase) == 0) {
+//// string rt = field.ReturnType.ReflectionName;
+//// EnsureClassExists (ctx, rt, GetValidRegion (field));
+//// CodeMemberField memField = member as CodeMemberField;
+//// if (memField == null || !IsTypeCompatible (ctx, rt, memField.Type.BaseType))
+//// throw new MemberExistsException (cls.FullName, MemberType.Field, member, GetValidRegion (field), cls.Region.FileName);
+//// return field;
+//// }
+//// }
+////
+//// //walk down into base classes, if any
+//// foreach (var baseType in cls.GetAllBaseTypeDefinitions ()) {
+//// IMember mem = GetCompatibleMemberInClass (ctx, baseType, member);
+//// if (mem != null)
+//// return mem;
+//// }
//
-// //check for identical event names
-// foreach (var ev in cls.Events) {
-// if (string.Compare (ev.Name, member.Name, StringComparison.OrdinalIgnoreCase) == 0) {
-// string rt = ev.ReturnType.ReflectionName;
-// EnsureClassExists (ctx, rt, GetValidRegion (ev));
-// CodeMemberEvent memEv = member as CodeMemberEvent;
-// if (memEv == null || !IsTypeCompatible (ctx, rt, memEv.Type.BaseType))
-// throw new MemberExistsException (cls.FullName, MemberType.Event, member, GetValidRegion (ev), cls.Region.FileName);
-// return ev;
-// }
-// }
-//
-// //check for identical field names
-// foreach (var field in cls.Fields) {
-// if (string.Compare (field.Name, member.Name, StringComparison.OrdinalIgnoreCase) == 0) {
-// string rt = field.ReturnType.ReflectionName;
-// EnsureClassExists (ctx, rt, GetValidRegion (field));
-// CodeMemberField memField = member as CodeMemberField;
-// if (memField == null || !IsTypeCompatible (ctx, rt, memField.Type.BaseType))
-// throw new MemberExistsException (cls.FullName, MemberType.Field, member, GetValidRegion (field), cls.Region.FileName);
-// return field;
-// }
+// //return null if no match
+// return null;
+// }
+//
+// static DomRegion GetValidRegion (IMember member)
+// {
+// if (member.BodyRegion.IsEmpty || member.DeclaringTypeDefinition.Region.FileName == FilePath.Null)
+// return member.DeclaringTypeDefinition.Region;
+// return member.BodyRegion;
+// }
+//
+// static DomRegion GetValidRegion (IUnresolvedMember member)
+// {
+// if (member.BodyRegion.IsEmpty || member.DeclaringTypeDefinition.Region.FileName == FilePath.Null)
+// return member.DeclaringTypeDefinition.Region;
+// return member.BodyRegion;
+// }
+//
+// static IType EnsureClassExists (ICompilation ctx, string className, DomRegion location)
+// {
+// string ns;
+// string name;
+// int idx = className.LastIndexOf (".");
+// if (idx < 0) {
+// ns = "";
+// name = className;
+// } else {
+// ns = className.Substring (0, idx);
+// name = className.Substring (idx + 1);
// }
-//
-// //walk down into base classes, if any
+// var cls = ctx.MainAssembly.GetTypeDefinition (ns, name, 0);
+// if (cls == null)
+// throw new TypeNotFoundException (className, location, null);
+// return cls;
+// }
+//
+// static bool IsTypeCompatible (ICompilation ctx, string existingType, string checkType)
+// {
+// if (existingType == checkType)
+// return true;
+// IType cls = EnsureClassExists (ctx, checkType, DomRegion.Empty);
// foreach (var baseType in cls.GetAllBaseTypeDefinitions ()) {
-// IMember mem = GetCompatibleMemberInClass (ctx, baseType, member);
-// if (mem != null)
-// return mem;
+// if (IsTypeCompatible (ctx, existingType, baseType.FullName))
+// return true;
// }
-
- //return null if no match
- return null;
- }
-
- static DomRegion GetValidRegion (IMember member)
- {
- if (member.BodyRegion.IsEmpty || member.DeclaringTypeDefinition.Region.FileName == FilePath.Null)
- return member.DeclaringTypeDefinition.Region;
- return member.BodyRegion;
- }
-
- static DomRegion GetValidRegion (IUnresolvedMember member)
- {
- if (member.BodyRegion.IsEmpty || member.DeclaringTypeDefinition.Region.FileName == FilePath.Null)
- return member.DeclaringTypeDefinition.Region;
- return member.BodyRegion;
- }
-
- static IType EnsureClassExists (ICompilation ctx, string className, DomRegion location)
- {
- string ns;
- string name;
- int idx = className.LastIndexOf (".");
- if (idx < 0) {
- ns = "";
- name = className;
- } else {
- ns = className.Substring (0, idx);
- name = className.Substring (idx + 1);
- }
- var cls = ctx.MainAssembly.GetTypeDefinition (ns, name, 0);
- if (cls == null)
- throw new TypeNotFoundException (className, location, null);
- return cls;
- }
-
- static bool IsTypeCompatible (ICompilation ctx, string existingType, string checkType)
- {
- if (existingType == checkType)
- return true;
- IType cls = EnsureClassExists (ctx, checkType, DomRegion.Empty);
- foreach (var baseType in cls.GetAllBaseTypeDefinitions ()) {
- if (IsTypeCompatible (ctx, existingType, baseType.FullName))
- return true;
- }
- return false;
- }
-
- public static INamedElement AddMemberToClass (Project project, ITypeDefinition cls, IUnresolvedTypeDefinition specificPartToAffect, CodeTypeMember member, bool throwIfExists)
- {
- bool isChildClass = false;
- foreach (var c in cls.Parts)
- if (c == specificPartToAffect)
- isChildClass = true;
- if (!isChildClass)
- throw new ArgumentException ("Class specificPartToAffect is not a part of class cls");
-
- var dom = TypeSystemService.GetCompilation (project);
- var existingMember = GetCompatibleMemberInClass (dom, cls, member);
-
- if (existingMember == null)
- return CodeGenerationService.AddCodeDomMember (project, specificPartToAffect, member);
-
-
- if (throwIfExists)
- throw new MemberExistsException (cls.Name, member, MemberType.Method, existingMember.BodyRegion, cls.Region.FileName);
-
- return existingMember;
- }
-
-// public static CodeRefactorer GetCodeGenerator (Project project)
-// {
-// CodeRefactorer cr = new CodeRefactorer (project.ParentSolution);
-// cr.TextFileProvider = MonoDevelop.Ide.TextFileProvider.Instance;
-// return cr;
+// return false;
+// }
+//
+// public static void AddMemberToClass (Project project, INamedTypeSymbol cls, Location specificPartToAffect, CodeTypeMember member, bool throwIfExists)
+// {
+// bool isChildClass = false;
+// foreach (var c in cls.Locations)
+// if (c == specificPartToAffect)
+// isChildClass = true;
+// if (!isChildClass)
+// throw new ArgumentException ("Class specificPartToAffect is not a part of class cls");
+//
+// var dom = TypeSystemService.GetCompilation (project);
+// var existingMember = GetCompatibleMemberInClass (dom, cls, member);
+//
+// if (existingMember == null)
+// return CodeGenerationService.AddCodeDomMember (project, specificPartToAffect, member);
+//
+//
+// if (throwIfExists)
+// throw new MemberExistsException (cls.Name, member, MemberType.Method, existingMember.BodyRegion, cls.Region.FileName);
+//
+// return existingMember;
// }
+//
+//// public static CodeRefactorer GetCodeGenerator (Project project)
+//// {
+//// CodeRefactorer cr = new CodeRefactorer (project.ParentSolution);
+//// cr.TextFileProvider = MonoDevelop.Ide.TextFileProvider.Instance;
+//// return cr;
+//// }
- public static IEnumerable<IMethod> GetCompatibleMethodsInClass (IType cls, IEvent eve)
+ public static IEnumerable<IMethodSymbol> GetCompatibleMethodsInClass (ITypeSymbol cls, IEventSymbol eve)
{
- IMethod eveMeth = GetMethodSignature (eve);
+ IMethodSymbol eveMeth = GetMethodSignature (eve);
if (eveMeth == null)
- return new IMethod[0];
+ return new IMethodSymbol[0];
return GetCompatibleMethodsInClass (cls, eveMeth);
}
//TODO: check accessibility
- public static IEnumerable<IMethod> GetCompatibleMethodsInClass (IType cls, IMethod matchMeth)
+ public static IEnumerable<IMethodSymbol> GetCompatibleMethodsInClass (ITypeSymbol cls, IMethodSymbol matchMeth)
{
- IType[] pars = new IType[matchMeth.Parameters.Count];
- List<IType>[] baseTypes = new List<IType>[matchMeth.Parameters.Count];
- for (int i = 0; i < matchMeth.Parameters.Count; i++) {
+ ITypeSymbol[] pars = new ITypeSymbol[matchMeth.Parameters.Length];
+ List<ITypeSymbol>[] baseTypes = new List<ITypeSymbol>[matchMeth.Parameters.Length];
+ for (int i = 0; i < matchMeth.Parameters.Length; i++) {
pars[i] = matchMeth.Parameters[i].Type;
- baseTypes[i] = new List<IType> (pars[i].GetAllBaseTypes ());
+ baseTypes[i] = new List<ITypeSymbol> (pars[i].GetBaseTypes ());
}
-
+
var matchMethType = matchMeth.ReturnType;
- foreach (IMethod method in cls.GetMethods ()) {
- if (method.IsPrivate || method.Parameters.Count != pars.Length || !method.ReturnType.Equals (matchMethType)
- || method.IsInternal)
+ foreach (IMethodSymbol method in cls.GetAccessibleMembersInThisAndBaseTypes<IMethodSymbol> (cls)) {
+ if (method.DeclaredAccessibility == Accessibility.Private || method.Parameters.Length != pars.Length || !method.ReturnType.Equals (matchMethType)
+ || method.DeclaredAccessibility == Accessibility.Internal)
continue;
bool allCompatible = true;
@@ -229,12 +229,12 @@ namespace MonoDevelop.DesignerSupport
}
}
- public static bool IdentifierExistsInClass (IType cls, string identifier)
+ public static bool IdentifierExistsInClass (ITypeSymbol cls, string identifier)
{
return cls.GetMembers ().Any (m => m.Name == identifier);
}
- public static string GenerateIdentifierUniqueInClass (IType cls, string trialIdentifier)
+ public static string GenerateIdentifierUniqueInClass (ITypeSymbol cls, string trialIdentifier)
{
string trialValue = trialIdentifier;
@@ -249,156 +249,156 @@ namespace MonoDevelop.DesignerSupport
throw new Exception ("Tried identifiers up to " + trialValue + " and all already existed");
}
- static DomRegion GetRegion (INamedElement el)
- {
- if (el is IEntity)
- return ((IEntity)el).BodyRegion;
- return ((IUnresolvedEntity)el).BodyRegion;
- }
- //opens the code view with the desired method, creating it if it doesn't already exist
- public static void CreateAndShowMember (Project project, ITypeDefinition cls, IUnresolvedTypeDefinition specificPartToAffect, CodeTypeMember member)
- {
- //only adds the method if it doesn't already exist
- var mem = AddMemberToClass (project, cls, specificPartToAffect, member, false);
-
- //some tests in case code refactorer returns bad values
- int beginline = specificPartToAffect.BodyRegion.BeginLine;
- var region = GetRegion (mem);
- if (!region.IsEmpty && region.BeginLine >= beginline && region.BeginLine <= specificPartToAffect.BodyRegion.EndLine)
- beginline = region.BeginLine;
-
- //jump to the member or class
- IdeApp.Workbench.OpenDocument (specificPartToAffect.Region.FileName, beginline, 1);
- }
-
- public static System.CodeDom.CodeTypeMember ReflectionToCodeDomMember (MemberInfo memberInfo)
- {
- if (memberInfo is MethodInfo)
- return ReflectionToCodeDomMethod ((MethodInfo) memberInfo);
-
- throw new NotImplementedException ();
- }
-
- public static System.CodeDom.CodeMemberMethod ReflectionToCodeDomMethod (MethodInfo mi)
- {
- CodeMemberMethod newMethod = new CodeMemberMethod ();
- newMethod.Name = mi.Name;
- newMethod.ReturnType = new System.CodeDom.CodeTypeReference (mi.ReturnType.FullName);
-
- newMethod.Attributes = System.CodeDom.MemberAttributes.Private;
- switch (mi.Attributes) {
- case System.Reflection.MethodAttributes.Assembly:
- newMethod.Attributes |= System.CodeDom.MemberAttributes.Assembly;
- break;
- case System.Reflection.MethodAttributes.FamANDAssem:
- newMethod.Attributes |= System.CodeDom.MemberAttributes.FamilyAndAssembly;
- break;
- case System.Reflection.MethodAttributes.Family:
- newMethod.Attributes |= System.CodeDom.MemberAttributes.Family;
- break;
- case System.Reflection.MethodAttributes.FamORAssem:
- newMethod.Attributes |= System.CodeDom.MemberAttributes.FamilyAndAssembly;
- break;
- case System.Reflection.MethodAttributes.Public:
- newMethod.Attributes |= System.CodeDom.MemberAttributes.Public;
- break;
- case System.Reflection.MethodAttributes.Static:
- newMethod.Attributes |= System.CodeDom.MemberAttributes.Static;
- break;
- }
-
- ParameterInfo[] pinfos = mi.GetParameters ();
- foreach (ParameterInfo pi in pinfos) {
- CodeParameterDeclarationExpression newPar = new CodeParameterDeclarationExpression (pi.ParameterType.FullName, pi.Name);
- if (pi.IsIn) newPar.Direction = FieldDirection.In;
- else if (pi.IsOut) newPar.Direction = FieldDirection.Out;
- newMethod.Parameters.Add (newPar);
- }
-
- return newMethod;
- }
+// static DomRegion GetRegion (INamedElement el)
+// {
+// if (el is IEntity)
+// return ((IEntity)el).BodyRegion;
+// return ((IUnresolvedEntity)el).BodyRegion;
+// }
+// //opens the code view with the desired method, creating it if it doesn't already exist
+// public static void CreateAndShowMember (Project project, ITypeDefinition cls, IUnresolvedTypeDefinition specificPartToAffect, CodeTypeMember member)
+// {
+// //only adds the method if it doesn't already exist
+// var mem = AddMemberToClass (project, cls, specificPartToAffect, member, false);
+//
+// //some tests in case code refactorer returns bad values
+// int beginline = specificPartToAffect.BodyRegion.BeginLine;
+// var region = GetRegion (mem);
+// if (!region.IsEmpty && region.BeginLine >= beginline && region.BeginLine <= specificPartToAffect.BodyRegion.EndLine)
+// beginline = region.BeginLine;
+//
+// //jump to the member or class
+// IdeApp.Workbench.OpenDocument (specificPartToAffect.Region.FileName, beginline, 1);
+// }
+//
+// public static System.CodeDom.CodeTypeMember ReflectionToCodeDomMember (MemberInfo memberInfo)
+// {
+// if (memberInfo is MethodInfo)
+// return ReflectionToCodeDomMethod ((MethodInfo) memberInfo);
+//
+// throw new NotImplementedException ();
+// }
+//
+// public static System.CodeDom.CodeMemberMethod ReflectionToCodeDomMethod (MethodInfo mi)
+// {
+// CodeMemberMethod newMethod = new CodeMemberMethod ();
+// newMethod.Name = mi.Name;
+// newMethod.ReturnType = new System.CodeDom.CodeTypeReference (mi.ReturnType.FullName);
+//
+// newMethod.Attributes = System.CodeDom.MemberAttributes.Private;
+// switch (mi.Attributes) {
+// case System.Reflection.MethodAttributes.Assembly:
+// newMethod.Attributes |= System.CodeDom.MemberAttributes.Assembly;
+// break;
+// case System.Reflection.MethodAttributes.FamANDAssem:
+// newMethod.Attributes |= System.CodeDom.MemberAttributes.FamilyAndAssembly;
+// break;
+// case System.Reflection.MethodAttributes.Family:
+// newMethod.Attributes |= System.CodeDom.MemberAttributes.Family;
+// break;
+// case System.Reflection.MethodAttributes.FamORAssem:
+// newMethod.Attributes |= System.CodeDom.MemberAttributes.FamilyAndAssembly;
+// break;
+// case System.Reflection.MethodAttributes.Public:
+// newMethod.Attributes |= System.CodeDom.MemberAttributes.Public;
+// break;
+// case System.Reflection.MethodAttributes.Static:
+// newMethod.Attributes |= System.CodeDom.MemberAttributes.Static;
+// break;
+// }
+//
+// ParameterInfo[] pinfos = mi.GetParameters ();
+// foreach (ParameterInfo pi in pinfos) {
+// CodeParameterDeclarationExpression newPar = new CodeParameterDeclarationExpression (pi.ParameterType.FullName, pi.Name);
+// if (pi.IsIn) newPar.Direction = FieldDirection.In;
+// else if (pi.IsOut) newPar.Direction = FieldDirection.Out;
+// newMethod.Parameters.Add (newPar);
+// }
+//
+// return newMethod;
+// }
- public static IMethod GetMethodSignature (IEvent ev)
+ public static IMethodSymbol GetMethodSignature (IEventSymbol ev)
{
- if (ev.ReturnType == null)
+ if (ev.Type == null)
return null;
- IType cls = ev.ReturnType;
- if (cls.Kind == TypeKind.Unknown)
+ ITypeSymbol cls = ev.Type;
+ if (cls.TypeKind == TypeKind.Unknown)
return null;
- foreach (var m in cls.GetMethods ())
+ foreach (var m in cls.GetAccessibleMembersInThisAndBaseTypes<IMethodSymbol> (cls))
if (m.Name == "Invoke")
return m;
return null;
}
- //TODO: handle generics
- public static IUnresolvedMethod CodeDomToMDDomMethod (CodeMemberMethod method)
- {
- var meth = new DefaultUnresolvedMethod (null, method.Name);
- meth.ReturnType = new DefaultUnresolvedTypeDefinition (method.ReturnType.BaseType);
-
- CodeDomModifiersToMDDom (meth, method.Attributes);
-
- foreach (CodeParameterDeclarationExpression dec in method.Parameters) {
- var paramType = new DefaultUnresolvedTypeDefinition (dec.Type.BaseType);
- var par = new DefaultUnresolvedParameter (paramType, dec.Name);
- if (dec.Direction == FieldDirection.Ref)
- par.IsRef = true;
- else if (dec.Direction == FieldDirection.Out)
- par.IsOut = true;
- meth.Parameters.Add (par);
- }
-
- return meth;
- }
-
- public static CodeMemberMethod MDDomToCodeDomMethod (IEvent eve)
+// //TODO: handle generics
+// public static IUnresolvedMethod CodeDomToMDDomMethod (CodeMemberMethod method)
+// {
+// var meth = new DefaultUnresolvedMethod (null, method.Name);
+// meth.ReturnType = new DefaultUnresolvedTypeDefinition (method.ReturnType.BaseType);
+//
+// CodeDomModifiersToMDDom (meth, method.Attributes);
+//
+// foreach (CodeParameterDeclarationExpression dec in method.Parameters) {
+// var paramType = new DefaultUnresolvedTypeDefinition (dec.Type.BaseType);
+// var par = new DefaultUnresolvedParameter (paramType, dec.Name);
+// if (dec.Direction == FieldDirection.Ref)
+// par.IsRef = true;
+// else if (dec.Direction == FieldDirection.Out)
+// par.IsOut = true;
+// meth.Parameters.Add (par);
+// }
+//
+// return meth;
+// }
+
+ public static CodeMemberMethod MDDomToCodeDomMethod (IEventSymbol eve)
{
- IMethod meth = GetMethodSignature (eve);
+ IMethodSymbol meth = GetMethodSignature (eve);
return meth != null ? MDDomToCodeDomMethod (meth) : null;
}
- static void CodeDomModifiersToMDDom (DefaultUnresolvedMethod method, MemberAttributes modifiers)
- {
- if ((modifiers & MemberAttributes.FamilyOrAssembly) != 0) {
- method.Accessibility = Accessibility.ProtectedOrInternal;
- }
- else if ((modifiers & MemberAttributes.FamilyOrAssembly) != 0) {
- method.Accessibility = Accessibility.ProtectedAndInternal;
- }
- else if ((modifiers & MemberAttributes.Family) != 0) {
- method.Accessibility = Accessibility.Protected;
- }
- else if ((modifiers & MemberAttributes.Assembly) != 0) {
- method.Accessibility = Accessibility.Internal;
- }
- else if ((modifiers & MemberAttributes.Public) != 0) {
- method.Accessibility = Accessibility.Public;
- }
- else if ((modifiers & MemberAttributes.Private) != 0) {
- method.Accessibility = Accessibility.Private;
- }
-
- if ((modifiers & MemberAttributes.Abstract) != 0) {
- method.IsAbstract = true;
- }
- else if ((modifiers & MemberAttributes.Final) != 0) {
- method.IsSealed = true;
- }
- else if ((modifiers & MemberAttributes.Static) != 0) {
- method.IsStatic = true;
- }
- else if ((modifiers & MemberAttributes.Override) != 0) {
- method.IsOverride = true;
- }
-// else if ((modifiers & MemberAttributes.Const) != 0) { // methods are never const.
-// initialState = (initialState & ~ScopeMask) | Modifiers.Const;
+// static void CodeDomModifiersToMDDom (DefaultUnresolvedMethod method, MemberAttributes modifiers)
+// {
+// if ((modifiers & MemberAttributes.FamilyOrAssembly) != 0) {
+// method.Accessibility = Accessibility.ProtectedOrInternal;
// }
- }
+// else if ((modifiers & MemberAttributes.FamilyOrAssembly) != 0) {
+// method.Accessibility = Accessibility.ProtectedAndInternal;
+// }
+// else if ((modifiers & MemberAttributes.Family) != 0) {
+// method.Accessibility = Accessibility.Protected;
+// }
+// else if ((modifiers & MemberAttributes.Assembly) != 0) {
+// method.Accessibility = Accessibility.Internal;
+// }
+// else if ((modifiers & MemberAttributes.Public) != 0) {
+// method.Accessibility = Accessibility.Public;
+// }
+// else if ((modifiers & MemberAttributes.Private) != 0) {
+// method.Accessibility = Accessibility.Private;
+// }
+//
+// if ((modifiers & MemberAttributes.Abstract) != 0) {
+// method.IsAbstract = true;
+// }
+// else if ((modifiers & MemberAttributes.Final) != 0) {
+// method.IsSealed = true;
+// }
+// else if ((modifiers & MemberAttributes.Static) != 0) {
+// method.IsStatic = true;
+// }
+// else if ((modifiers & MemberAttributes.Override) != 0) {
+// method.IsOverride = true;
+// }
+//// else if ((modifiers & MemberAttributes.Const) != 0) { // methods are never const.
+//// initialState = (initialState & ~ScopeMask) | Modifiers.Const;
+//// }
+// }
- static MemberAttributes ApplyMDDomModifiersToCodeDom (IEntity entity, MemberAttributes initialState)
+ static MemberAttributes ApplyMDDomModifiersToCodeDom (ISymbol entity, MemberAttributes initialState)
{
- switch (entity.Accessibility) {
+ switch (entity.DeclaredAccessibility) {
case Accessibility.ProtectedOrInternal:
initialState = (initialState & ~MemberAttributes.AccessMask) | MemberAttributes.FamilyOrAssembly;
break;
@@ -429,11 +429,11 @@ namespace MonoDevelop.DesignerSupport
else if (entity.IsStatic) {
initialState = (initialState & ~MemberAttributes.ScopeMask) | MemberAttributes.Static;
}
- else if (entity.IsShadowing) {
+ else if (entity.IsOverride) {
initialState = (initialState & ~MemberAttributes.ScopeMask) | MemberAttributes.Override;
}
- if (entity is IField) {
- var f = (IField)entity;
+ if (entity is IFieldSymbol) {
+ var f = (IFieldSymbol)entity;
if (f.IsReadOnly && f.IsStatic)
initialState = (initialState & ~MemberAttributes.ScopeMask) | MemberAttributes.Const;
}
@@ -442,19 +442,19 @@ namespace MonoDevelop.DesignerSupport
}
- public static System.CodeDom.CodeMemberMethod MDDomToCodeDomMethod (IMethod mi)
+ public static System.CodeDom.CodeMemberMethod MDDomToCodeDomMethod (IMethodSymbol mi)
{
CodeMemberMethod newMethod = new CodeMemberMethod ();
newMethod.Name = mi.Name;
- string returnType = mi.ReturnType.ReflectionName ?? "System.Void";
+ string returnType = mi.ReturnType.GetFullMetadataName () ?? "System.Void";
newMethod.ReturnType = new System.CodeDom.CodeTypeReference (returnType);
newMethod.Attributes = ApplyMDDomModifiersToCodeDom (mi, newMethod.Attributes);
- foreach (IParameter p in mi.Parameters) {
+ foreach (IParameterSymbol p in mi.Parameters) {
var newPar = new CodeParameterDeclarationExpression (returnType, p.Name);
- if (p.IsRef)
+ if (p.RefKind == RefKind.Ref)
newPar.Direction = FieldDirection.Ref;
- else if (p.IsOut)
+ else if (p.RefKind == RefKind.Out)
newPar.Direction = FieldDirection.Out;
else
newPar.Direction = FieldDirection.In;
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ClassOutlineNodeComparer.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ClassOutlineNodeComparer.cs
deleted file mode 100755
index c6bc863697..0000000000
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ClassOutlineNodeComparer.cs
+++ /dev/null
@@ -1,303 +0,0 @@
-//
-// ClassOutlineNodeComparer.cs
-//
-// Authors:
-// Helmut Duregger <helmutduregger@gmx.at>
-//
-// Copyright (c) 2010 Helmut Duregger
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.Xml.Serialization;
-
-using Gtk;
-
-using MonoDevelop.Core;
-using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem;
-
-namespace MonoDevelop.DesignerSupport
-{
- /// <remarks>
- /// This implementation uses a primary sort key (int based on node's group) and
- /// a secondary sort key (string based on node's name) for comparison.
- /// </remarks>
- /// <seealso cref="MonoDevelop.DesignerSupport.ClassOutlineSettings"/>
- class ClassOutlineNodeComparer : IComparer<TreeIter>
- {
- const string DEFAULT_REGION_NAME = "region";
-
- Ambience ambience;
- TreeModel model;
- ClassOutlineSettings settings;
- int[] groupTable;
-
- /// <param name="ambience">
- /// The ambience used on retrieval of node names.
- /// </param>
- /// <param name="settings">
- /// The properties used on retrieval of node sort keys and sorting settings.
- /// </param>
- /// <param name="model">
- /// The model containing the nodes to compare.
- /// </param>
- public ClassOutlineNodeComparer (Ambience ambience, ClassOutlineSettings settings, TreeModel model)
- {
- this.ambience = ambience;
- this.settings = settings;
- this.model = model;
- BuildGroupTable ();
- }
-
- public int Compare (TreeIter a, TreeIter b)
- {
- return CompareNodes (model, a, b);
- }
-
- /// <summary>
- /// Compares nodes by primary (group) and secondary (name) sort keys depending on
- /// sort properties.
- /// </summary>
- /// <remarks>
- /// For methods, constructors and destructors are sorted at the top.
- /// </remarks>
- /// <param name="model">
- /// The TreeModel that the iterators refer to.
- /// </param>
- /// <param name="node1">
- /// The first tree node that will be compared.
- /// </param>
- /// <param name="node2">
- /// The second tree node that will be compared.
- /// </param>
- /// <returns>
- /// Less than zero if nodeA &lt; nodeB
- /// Zero if nodeA == nodeB.
- /// Greater than zero if nodeA &gt; nodeB.
- /// </returns>
- public int CompareNodes (TreeModel model, TreeIter node1, TreeIter node2)
- {
- object o1 = model.GetValue (node1, 0);
- object o2 = model.GetValue (node2, 0);
- if (o1 == null) {
- return o2 == null? 0 : 1;
- } else if (o2 == null) {
- return -1;
- }
-
- if (settings.IsGrouped) {
- int groupOrder = GetGroupPriority (o1) - GetGroupPriority (o2);
- if (groupOrder != 0)
- return groupOrder;
-
- IMethod m1 = o1 as IMethod;
- if (m1 != null)
- return CompareMethods (m1, (IMethod)o2, settings.IsSorted);
- }
-
- if (settings.IsSorted)
- return CompareName (o1, o2);
-
- return CompareRegion (o1, o2);
- }
-
- int CompareName (object o1, object o2)
- {
- var sort = string.Compare (
- GetSortName (o1),
- GetSortName (o2),
- System.Globalization.CultureInfo.CurrentCulture,
- System.Globalization.CompareOptions.IgnoreSymbols);
- if (sort == 0)
- return CompareRegion (o1, o2);
- return sort;
- }
-
- int CompareMethods (IMethod m1, IMethod m2, bool isSortingAlphabetically)
- {
- // Here we sort constructors before finalizers before other methods.
- // Remember that two constructors have the same name.
-
- // Sort constructors at top.
-
- bool isCtor1 = m1.IsConstructor;
- bool isCtor2 = m2.IsConstructor;
-
- if (isCtor1) {
- if (isCtor2)
- return CompareRegion (m1, m2);
- else
- return -1;
- } else if (isCtor2) {
- return 1;
- }
-
- // Sort finalizers after constructors.
- //
- // Sorting two finalizers even though this is not valid C#. This gives a correct
- // outline during editing.
-
- bool isFinalizer1 = IsFinalizer (m1);
- bool isFinalizer2 = IsFinalizer (m2);
-
- if (isFinalizer1) {
- if (isFinalizer2)
- return CompareRegion (m1, m2);
- else
- return -1;
- } else if (isFinalizer2) {
- return 1;
- }
-
- if (isSortingAlphabetically)
- return CompareName (m1, m2);
- else
- return CompareRegion (m1, m2);
- }
-
- bool IsConstructor (object node)
- {
- if (node is IMethod) {
- return ((IMethod) node).IsConstructor;
- }
-
- return false;
- }
-
- bool IsFinalizer (object node)
- {
- if (node is IMethod) {
- return ((IMethod) node).IsDestructor;
- }
-
- return false;
- }
-
- const int GROUP_INDEX_REGIONS = 0;
- const int GROUP_INDEX_NAMESPACES = 1;
- const int GROUP_INDEX_TYPES = 2;
- const int GROUP_INDEX_FIELDS = 3;
- const int GROUP_INDEX_PROPERTIES = 4;
- const int GROUP_INDEX_EVENTS = 5;
- const int GROUP_INDEX_METHODS = 6;
-
- void BuildGroupTable ()
- {
- groupTable = new int[7];
- int i = -10;
- foreach (var g in settings.GroupOrder) {
- switch (g) {
- case ClassOutlineSettings.GroupRegions:
- groupTable[GROUP_INDEX_REGIONS] = i++;
- break;
- case ClassOutlineSettings.GroupNamespaces:
- groupTable[GROUP_INDEX_NAMESPACES] = i++;
- break;
- case ClassOutlineSettings.GroupTypes:
- groupTable[GROUP_INDEX_TYPES] = i++;
- break;
- case ClassOutlineSettings.GroupFields:
- groupTable[GROUP_INDEX_FIELDS] = i++;
- break;
- case ClassOutlineSettings.GroupProperties:
- groupTable[GROUP_INDEX_PROPERTIES] = i++;
- break;
- case ClassOutlineSettings.GroupEvents:
- groupTable[GROUP_INDEX_EVENTS] = i++;
- break;
- case ClassOutlineSettings.GroupMethods:
- groupTable[GROUP_INDEX_METHODS] = i++;
- break;
- }
- }
- }
-
- int GetGroupPriority (object node)
- {
- if (node is FoldingRegion)
- return groupTable[GROUP_INDEX_REGIONS];
- if (node is string)
- return groupTable[GROUP_INDEX_NAMESPACES];
- if (node is IType)
- return groupTable[GROUP_INDEX_TYPES];
- if (node is IField)
- return groupTable[GROUP_INDEX_FIELDS];
- if (node is IProperty)
- return groupTable[GROUP_INDEX_PROPERTIES];
- if (node is IEvent)
- return groupTable[GROUP_INDEX_EVENTS];
- if (node is IMethod)
- return groupTable[GROUP_INDEX_METHODS];
- return 0;
- }
-
- /// <summary>
- /// Returns the name of the node that should be used as a secondary sort key.
- /// </summary>
- /// <param name="node">
- /// A node in the tree. Expected to be either an IMember or a FoldingRegion.
- /// </param>
- /// <returns>
- /// A string representing the secondary sort key.
- /// The empty string if node is neither an IMember nor a FoldingRegion.
- /// </returns>
- string GetSortName (object node)
- {
- if (node is IEntity) {
- // Return the name without type or parameters
- return ambience.GetString ((IEntity)node, 0);
- }
-
- if (node is FoldingRegion) {
- // Return trimmed region name or fallback
- string name = ((FoldingRegion)node).Name.Trim ();
-
- // ClassOutlineTextEditorExtension uses a fallback name for regions
- // so we do the same here with a slighty different name.
- if (name.Length == 0)
- name = DEFAULT_REGION_NAME;
-
- return name;
- }
-
- return string.Empty;
- }
-
- internal static DomRegion GetRegion (object o)
- {
- var m = o as IEntity;
- if (m != null)
- return m.BodyRegion.IsEmpty ? m.Region : m.BodyRegion;
- var m2 = o as IUnresolvedEntity;
- if (m2 != null)
- return m2.BodyRegion.IsEmpty ? m2.Region : m2.BodyRegion;
- if (o is FoldingRegion)
- return ((FoldingRegion)o).Region;
- return DomRegion.Empty;
- }
-
- internal static int CompareRegion (object o1, object o2)
- {
- return GetRegion (o1).Begin.CompareTo (GetRegion (o2).Begin);
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ClassOutlineSettings.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ClassOutlineSettings.cs
deleted file mode 100644
index f928255b7e..0000000000
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ClassOutlineSettings.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// ClassOutlineSortingProperties.cs
-//
-// Authors:
-// Helmut Duregger <helmutduregger@gmx.at>
-//
-// Copyright (c) 2010 Helmut Duregger
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Xml.Serialization;
-using System.Linq;
-
-using MonoDevelop.Core;
-
-namespace MonoDevelop.DesignerSupport
-{
- /// <summary>
- /// Stores sorting status and is serialized to configuration properties.
- /// </summary>
- /// <remarks>
- /// Stores the sorting configuration, e.g. if the class outline is currently sorted
- /// or what primary sort key values the individual node groups have. This class is
- /// serialized to the configuration file MonoDevelopProperties.xml.
- /// </remarks>
- /// <seealso cref="MonoDevelop.DesignerSupport.ClassOutlineTextEditorExtension"/>
- class ClassOutlineSettings
- {
- const string KEY_GROUP_ORDER = "MonoDevelop.DesignerSupport.ClassOutline.GroupOrder";
- const string KEY_IS_GROUPED = "MonoDevelop.DesignerSupport.ClassOutline.IsGrouped";
- const string KEY_IS_SORTED = "MonoDevelop.DesignerSupport.ClassOutline.IsSorted";
-
- public const string GroupRegions = "Regions";
- public const string GroupNamespaces = "Namespaces";
- public const string GroupTypes = "Types";
- public const string GroupFields = "Fields";
- public const string GroupProperties = "Properties";
- public const string GroupEvents = "Events";
- public const string GroupMethods = "Methods";
-
- static Dictionary<string,string> groupNames = new Dictionary<string, string> {
- { GroupRegions, GettextCatalog.GetString ("Regions") },
- { GroupNamespaces, GettextCatalog.GetString ("Namespaces") },
- { GroupTypes, GettextCatalog.GetString ("Types") },
- { GroupProperties, GettextCatalog.GetString ("Properties") },
- { GroupFields, GettextCatalog.GetString ("Fields") },
- { GroupEvents, GettextCatalog.GetString ("Events") },
- { GroupMethods, GettextCatalog.GetString ("Methods") },
- };
-
- ClassOutlineSettings ()
- {
- }
-
- public static ClassOutlineSettings Load ()
- {
- var cs = new ClassOutlineSettings ();
- cs.IsGrouped = PropertyService.Get (KEY_IS_GROUPED, false);
- cs.IsSorted = PropertyService.Get (KEY_IS_SORTED, false);
-
- string s = PropertyService.Get (KEY_GROUP_ORDER, "");
- if (s.Length == 0) {
- cs.GroupOrder = groupNames.Keys.ToArray ();
- } else {
- cs.GroupOrder = s.Split (new char[] {','}, StringSplitOptions.RemoveEmptyEntries);
- }
- return cs;
- }
-
- public void Save ()
- {
- PropertyService.Set (KEY_IS_GROUPED, IsGrouped);
- PropertyService.Set (KEY_IS_SORTED, IsSorted);
- PropertyService.Set (KEY_GROUP_ORDER, string.Join (",", GroupOrder));
- }
-
- public static string GetGroupName (string group)
- {
- return groupNames [group];
- }
-
- public IList<string> GroupOrder { get; set; }
- public bool IsGrouped { get; set; }
- public bool IsSorted { get; set; }
- }
-} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ClassOutlineSortingPreferencesDialog.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ClassOutlineSortingPreferencesDialog.cs
deleted file mode 100644
index 170e1d7929..0000000000
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ClassOutlineSortingPreferencesDialog.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// SortingPreferencesDialog.cs
-//
-// Authors:
-// Helmut Duregger <helmutduregger@gmx.at>
-//
-// Copyright (c) 2011 Helmut Duregger
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-
-using Gtk;
-
-using MonoDevelop.Core;
-
-
-namespace MonoDevelop.DesignerSupport
-{
- /// <summary>
- /// Provides a priority list of the groups that items in the class outline can be grouped in.
- /// </summary>
- /// <remarks>
- /// The user can sort the list with button presses and thereby change the order of groups
- /// in the outline, while grouping is active.
- /// </remarks>
- partial class ClassOutlineSortingPreferencesDialog : Dialog
- {
- ClassOutlineSettings settings;
-
- public ClassOutlineSortingPreferencesDialog (ClassOutlineSettings settings)
- {
- this.Build ();
-
- priorityList.Model = new ListStore (typeof (string), typeof (string));
- priorityList.AppendColumn ("", new CellRendererText (), "text", 1);
-
- priorityList.Model.Clear ();
- foreach (string g in settings.GroupOrder) {
- priorityList.Model.AppendValues (g, ClassOutlineSettings.GetGroupName (g));
- }
-
- this.settings = settings;
- }
-
- public void SaveSettings ()
- {
- TreeIter iter;
- if (priorityList.Model.GetIterFirst (out iter)) {
- var order = new List<string> ();
- do {
- order.Add ((string) priorityList.Model.GetValue (iter, 0));
- } while (priorityList.Model.IterNext (ref iter));
- settings.GroupOrder = order;
- }
- settings.Save ();
- }
- }
-} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs
deleted file mode 100644
index 1956f5b4f8..0000000000
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ClassOutlineTextEditorExtension.cs
+++ /dev/null
@@ -1,443 +0,0 @@
-//
-// ClassOutlineTextEditorExtension.cs
-//
-// Author:
-// Michael Hutchinson <mhutchinson@novell.com>
-//
-// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using Gtk;
-
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Content;
-using MonoDevelop.Ide;
-using MonoDevelop.Components;
-using MonoDevelop.Components.Docking;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Ide.TypeSystem;
-using MonoDevelop.Projects;
-
-namespace MonoDevelop.DesignerSupport
-{
- /// <summary>
- /// Displays a types and members outline of the current document.
- /// </summary>
- /// <remarks>
- /// Document types and members are displayed in a tree view.
- /// The displayed nodes can be sorted by changing the sorting properties state.
- /// The sort behaviour is serialized into MonoDevelopProperties.xml.
- /// Nodes with lower sortKey value will be sorted before nodes with higher value.
- /// Nodes with equal sortKey will be sorted by string comparison of the name of the nodes.
- /// The string comparison ignores symbols (e.g. sort 'Foo()' next to '~Foo()').
- /// </remarks>
- /// <seealso cref="MonoDevelop.DesignerSupport.ClassOutlineNodeComparer"/>
- /// <seealso cref="MonoDevelop.DesignerSupport.ClassOutlineSettings"/>
- public class ClassOutlineTextEditorExtension : TextEditorExtension, IOutlinedDocument
- {
- ParsedDocument lastCU = null;
-
- MonoDevelop.Ide.Gui.Components.PadTreeView outlineTreeView;
- TreeStore outlineTreeStore;
- TreeModelSort outlineTreeModelSort;
- Widget[] toolbarWidgets;
-
- ClassOutlineNodeComparer comparer;
- ClassOutlineSettings settings;
-
- bool refreshingOutline;
- bool disposed;
- bool outlineReady;
-
- public override bool ExtendsEditor (Document doc, IEditableTextBuffer editor)
- {
- var binding = LanguageBindingService.GetBindingPerFileName (doc.Name);
- return binding != null && binding is IDotNetLanguageBinding;
- }
-
- public override void Initialize ()
- {
- base.Initialize ();
- if (Document != null)
- Document.DocumentParsed += UpdateDocumentOutline;
- }
-
- public override void Dispose ()
- {
- if (disposed)
- return;
- disposed = true;
- if (Document != null)
- Document.DocumentParsed -= UpdateDocumentOutline;
- RemoveRefillOutlineStoreTimeout ();
- lastCU = null;
- settings = null;
- comparer = null;
- base.Dispose ();
- }
-
- Widget MonoDevelop.DesignerSupport.IOutlinedDocument.GetOutlineWidget ()
- {
- if (outlineTreeView != null)
- return outlineTreeView;
-
- outlineTreeStore = new TreeStore (typeof(object));
- outlineTreeModelSort = new TreeModelSort (outlineTreeStore);
-
- settings = ClassOutlineSettings.Load ();
- comparer = new ClassOutlineNodeComparer (GetAmbience (), settings, outlineTreeModelSort);
-
- outlineTreeModelSort.SetSortFunc (0, comparer.CompareNodes);
- outlineTreeModelSort.SetSortColumnId (0, SortType.Ascending);
-
- outlineTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView (outlineTreeStore);
-
- var pixRenderer = new CellRendererImage ();
- pixRenderer.Xpad = 0;
- pixRenderer.Ypad = 0;
-
- outlineTreeView.TextRenderer.Xpad = 0;
- outlineTreeView.TextRenderer.Ypad = 0;
-
- TreeViewColumn treeCol = new TreeViewColumn ();
- treeCol.PackStart (pixRenderer, false);
-
- treeCol.SetCellDataFunc (pixRenderer, new TreeCellDataFunc (OutlineTreeIconFunc));
- treeCol.PackStart (outlineTreeView.TextRenderer, true);
-
- treeCol.SetCellDataFunc (outlineTreeView.TextRenderer, new TreeCellDataFunc (OutlineTreeTextFunc));
- outlineTreeView.AppendColumn (treeCol);
-
- outlineTreeView.HeadersVisible = false;
-
- outlineTreeView.Selection.Changed += delegate {
- JumpToDeclaration (false);
- };
-
- outlineTreeView.RowActivated += delegate {
- JumpToDeclaration (true);
- };
-
- this.lastCU = Document.ParsedDocument;
-
- outlineTreeView.Realized += delegate { RefillOutlineStore (); };
- UpdateSorting ();
-
- var sw = new CompactScrolledWindow ();
- sw.Add (outlineTreeView);
- sw.ShowAll ();
- return sw;
- }
-
- IEnumerable<Widget> MonoDevelop.DesignerSupport.IOutlinedDocument.GetToolbarWidgets ()
- {
- if (toolbarWidgets != null)
- return toolbarWidgets;
-
- var groupToggleButton = new ToggleButton () {
- Image = new Image (Ide.Gui.Stock.GroupByCategory, IconSize.Menu),
- TooltipText = GettextCatalog.GetString ("Group entries by type"),
- Active = settings.IsGrouped,
- };
- groupToggleButton.Toggled += delegate {
- if (groupToggleButton.Active == settings.IsGrouped)
- return;
- settings.IsGrouped = groupToggleButton.Active;
- UpdateSorting ();
- };
-
- var sortAlphabeticallyToggleButton = new ToggleButton () {
- Image = new Image (Ide.Gui.Stock.SortAlphabetically, IconSize.Menu),
- TooltipText = GettextCatalog.GetString ("Sort entries alphabetically"),
- Active = settings.IsSorted,
- };
- sortAlphabeticallyToggleButton.Toggled += delegate {
- if (sortAlphabeticallyToggleButton.Active == settings.IsSorted)
- return;
- settings.IsSorted = sortAlphabeticallyToggleButton.Active;
- UpdateSorting ();
- };
-
- var preferencesButton = new DockToolButton (Ide.Gui.Stock.Options) {
- TooltipText = GettextCatalog.GetString ("Open preferences dialog"),
- };
- preferencesButton.Clicked += delegate {
- using (var dialog = new ClassOutlineSortingPreferencesDialog (settings)) {
- if (MonoDevelop.Ide.MessageService.ShowCustomDialog (dialog) == (int)Gtk.ResponseType.Ok) {
- dialog.SaveSettings ();
- comparer = new ClassOutlineNodeComparer (GetAmbience (), settings, outlineTreeModelSort);
- UpdateSorting ();
- }
- }
- };
-
- return toolbarWidgets = new Widget[] {
- groupToggleButton,
- sortAlphabeticallyToggleButton,
- new VSeparator (),
- preferencesButton,
- };
- }
-
- void JumpToDeclaration (bool focusEditor)
- {
- if (!outlineReady)
- return;
- TreeIter iter;
- if (!outlineTreeView.Selection.GetSelected (out iter))
- return;
-
- object o;
-
- if (IsSorting ()) {
- o = outlineTreeStore.GetValue (outlineTreeModelSort.ConvertIterToChildIter (iter), 0);
- }
- else {
- o = outlineTreeStore.GetValue (iter, 0);
- }
-
- IdeApp.ProjectOperations.JumpToDeclaration (o as IEntity);
- if (focusEditor)
- IdeApp.Workbench.ActiveDocument.Select ();
- }
-
- void OutlineTreeIconFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
- {
- var pixRenderer = (CellRendererImage)cell;
- object o = model.GetValue (iter, 0);
- if (o is IEntity) {
- pixRenderer.Image = ImageService.GetIcon (((IEntity)o).GetStockIcon (), IconSize.Menu);
- } else if (o is FoldingRegion) {
- pixRenderer.Image = ImageService.GetIcon (Ide.Gui.Stock.Add, IconSize.Menu);
- }
- }
-
- void OutlineTreeTextFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
- {
- CellRendererText txtRenderer = (CellRendererText)cell;
- object o = model.GetValue (iter, 0);
- Ambience am = GetAmbience ();
- if (o is IEntity) {
- txtRenderer.Text = am.GetString ((IEntity)o, OutputFlags.ClassBrowserEntries);
- } else if (o is FoldingRegion) {
- string name = ((FoldingRegion)o).Name.Trim ();
- if (string.IsNullOrEmpty (name))
- name = "#region";
- txtRenderer.Text = name;
- }
- }
-
- void MonoDevelop.DesignerSupport.IOutlinedDocument.ReleaseOutlineWidget ()
- {
- if (outlineTreeView == null)
- return;
- var w = (ScrolledWindow)outlineTreeView.Parent;
- w.Destroy ();
- if (outlineTreeModelSort != null) {
- outlineTreeModelSort.Dispose ();
- outlineTreeModelSort = null;
- }
- if (outlineTreeStore != null) {
- outlineTreeStore.Dispose ();
- outlineTreeStore = null;
- }
- outlineTreeView = null;
- settings = null;
- foreach (var tw in toolbarWidgets)
- tw.Destroy ();
- toolbarWidgets = null;
- comparer = null;
- }
-
- void RemoveRefillOutlineStoreTimeout ()
- {
- if (refillOutlineStoreId == 0)
- return;
- GLib.Source.Remove (refillOutlineStoreId);
- refillOutlineStoreId = 0;
- }
-
- uint refillOutlineStoreId;
- void UpdateDocumentOutline (object sender, EventArgs args)
- {
- lastCU = Document.ParsedDocument;
- //limit update rate to 3s
- if (!refreshingOutline) {
- refreshingOutline = true;
- refillOutlineStoreId = GLib.Timeout.Add (3000, RefillOutlineStore);
- }
- }
-
- bool RefillOutlineStore ()
- {
- DispatchService.AssertGuiThread ();
- Gdk.Threads.Enter ();
- refreshingOutline = false;
- if (outlineTreeStore == null || !outlineTreeView.IsRealized) {
- refillOutlineStoreId = 0;
- return false;
- }
-
- outlineReady = false;
- outlineTreeStore.Clear ();
- if (lastCU != null) {
- BuildTreeChildren (outlineTreeStore, TreeIter.Zero, lastCU);
- TreeIter it;
- if (IsSorting ()) {
- if (outlineTreeModelSort.GetIterFirst (out it))
- outlineTreeView.Selection.SelectIter (it);
- } else {
- if (outlineTreeStore.GetIterFirst (out it))
- outlineTreeView.Selection.SelectIter (it);
- }
-
- outlineTreeView.ExpandAll ();
- }
- outlineReady = true;
-
- Gdk.Threads.Leave ();
-
- //stop timeout handler
- refillOutlineStoreId = 0;
- return false;
- }
-
- void BuildTreeChildren (TreeStore store, TreeIter parent, ParsedDocument parsedDocument)
- {
- if (parsedDocument == null)
- return;
-
- foreach (var unresolvedCls in parsedDocument.TopLevelTypeDefinitions) {
- var cls = document.Compilation.MainAssembly.GetTypeDefinition (unresolvedCls.FullTypeName);
- if (cls == null)
- continue;
- TreeIter childIter;
- if (!parent.Equals (TreeIter.Zero))
- childIter = store.AppendValues (parent, cls);
- else
- childIter = store.AppendValues (cls);
-
- AddTreeClassContents (store, childIter, parsedDocument, cls, unresolvedCls);
- }
- }
-
- static void AddTreeClassContents (TreeStore store, TreeIter parent, ParsedDocument parsedDocument, ITypeDefinition cls, IUnresolvedTypeDefinition part)
- {
- List<object> items = new List<object> ();
- if (cls.Kind != TypeKind.Delegate) {
- foreach (var o in cls.GetMembers (m => part.Region.FileName == m.Region.FileName && part.Region.IsInside (m.Region.Begin))) {
- items.Add (o);
- }
- foreach (var o in cls.GetNestedTypes (m => part.Region.FileName == m.Region.FileName && part.Region.IsInside (m.Region.Begin))) {
- if (o.DeclaringType == cls)
- items.Add (o);
- }
- foreach (var o in cls.GetConstructors (m => part.Region.FileName == m.Region.FileName && part.Region.IsInside (m.Region.Begin))) {
- if (o.IsSynthetic)
- continue;
- items.Add (o);
- }
- }
- items.Sort (ClassOutlineNodeComparer.CompareRegion);
- List<FoldingRegion> regions = new List<FoldingRegion> ();
- foreach (FoldingRegion fr in parsedDocument.UserRegions)
- //check regions inside class
- if (cls.BodyRegion.IsInside (fr.Region.Begin) && cls.BodyRegion.IsInside (fr.Region.End))
- regions.Add (fr);
- regions.Sort (delegate(FoldingRegion x, FoldingRegion y) { return x.Region.Begin.CompareTo (y.Region.Begin); });
-
- IEnumerator<FoldingRegion> regionEnumerator = regions.GetEnumerator ();
- if (!regionEnumerator.MoveNext ())
- regionEnumerator = null;
-
- FoldingRegion currentRegion = null;
- TreeIter currentParent = parent;
- foreach (object item in items) {
-
- //no regions left; quick exit
- if (regionEnumerator != null) {
- DomRegion itemRegion = ClassOutlineNodeComparer.GetRegion (item);
-
- //advance to a region that could potentially contain this member
- while (regionEnumerator != null && !OuterEndsAfterInner (regionEnumerator.Current.Region, itemRegion))
- if (!regionEnumerator.MoveNext ())
- regionEnumerator = null;
-
- //if member is within region, make sure it's the current parent.
- //If not, move target iter back to class parent
- if (regionEnumerator != null && regionEnumerator.Current.Region.IsInside (itemRegion.Begin)) {
- if (currentRegion != regionEnumerator.Current) {
- currentParent = store.AppendValues (parent, regionEnumerator.Current);
- currentRegion = regionEnumerator.Current;
- }
- } else {
- currentParent = parent;
- }
- }
-
- TreeIter childIter = store.AppendValues (currentParent, item);
- if (item is ITypeDefinition)
- AddTreeClassContents (store, childIter, parsedDocument, (ITypeDefinition)item, part);
-
- }
- }
-
- static DomRegion GetRegion (object o)
- {
- if (o is IEntity) {
- var m = (IEntity)o;
- return m.Region; //m.BodyRegion.IsEmpty ? new DomRegion (m.Location, m.Location) : m.BodyRegion;
- }
- throw new InvalidOperationException (o.GetType ().ToString ());
- }
-
- static bool OuterEndsAfterInner (DomRegion outer, DomRegion inner)
- {
- return ((outer.End.Line > 1 && outer.End.Line > inner.End.Line)
- || (outer.End.Line == inner.End.Line && outer.End.Column > inner.End.Column));
- }
-
- void UpdateSorting ()
- {
- if (IsSorting ()) {
- // Sort the model, sort keys may have changed.
- // Only setting the column again does not re-sort so we set the function instead.
- outlineTreeModelSort.SetSortFunc (0, comparer.CompareNodes);
- outlineTreeView.Model = outlineTreeModelSort;
- } else {
- outlineTreeView.Model = outlineTreeStore;
- }
-
- // Because sorting the tree by setting the sort function also collapses the tree view we expand
- // the whole tree.
- outlineTreeView.ExpandAll ();
- }
-
- bool IsSorting ()
- {
- return settings.IsGrouped || settings.IsSorted;
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/CodeBehind.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/CodeBehind.cs
index 7ab9a0288d..02e18d5ef7 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/CodeBehind.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/CodeBehind.cs
@@ -29,10 +29,11 @@
using System;
using System.IO;
using System.Collections.Generic;
+using System.Globalization;
+using Microsoft.CodeAnalysis;
using MonoDevelop.Projects;
-using System.Globalization;
-using ICSharpCode.NRefactory.TypeSystem;
+using System.Linq;
namespace MonoDevelop.DesignerSupport
{
@@ -102,30 +103,32 @@ namespace MonoDevelop.DesignerSupport
return null;
}
- public static IUnresolvedTypeDefinition GetDesignerClass (IType cls)
- {
- if (cls.GetDefinition ().Parts.Count == 1)
- return null;
-
- string designerEnding = ".designer" + Path.GetExtension (cls.GetDefinition ().Region.FileName);
-
- foreach (var c in cls.GetDefinition ().Parts)
- if (c.Region.FileName.EndsWith (designerEnding, StringComparison.OrdinalIgnoreCase))
- return c;
-
- return null;
- }
-
- public static IUnresolvedTypeDefinition GetNonDesignerClass (IType cls)
+// public static IUnresolvedTypeDefinition GetDesignerClass (IType cls)
+// {
+// if (cls.GetDefinition ().Parts.Count == 1)
+// return null;
+//
+// string designerEnding = ".designer" + Path.GetExtension (cls.GetDefinition ().Region.FileName);
+//
+// foreach (var c in cls.GetDefinition ().Parts)
+// if (c.Region.FileName.EndsWith (designerEnding, StringComparison.OrdinalIgnoreCase))
+// return c;
+//
+// return null;
+// }
+
+ public static Location GetNonDesignerClassLocation (ITypeSymbol cls)
{
- if (cls.GetDefinition ().Parts.Count == 1)
+ if (cls.Locations.Length == 1)
return null;
+
+ var foo = cls.ContainingType;
- string designerEnding = ".designer" + Path.GetExtension (cls.GetDefinition ().Region.FileName);
+ string designerEnding = ".designer" + Path.GetExtension (cls.Locations.First ().SourceTree.FilePath);
- foreach (var c in cls.GetDefinition ().Parts)
- if (!c.Region.FileName.EndsWith (designerEnding, StringComparison.OrdinalIgnoreCase))
- return c;
+ foreach (var location in cls.Locations)
+ if (!location.SourceTree.FilePath.EndsWith (designerEnding, StringComparison.OrdinalIgnoreCase))
+ return location;
return null;
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/CodeBehindWriter.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/CodeBehindWriter.cs
index 44d2c1bc8f..3f8fbdeb1c 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/CodeBehindWriter.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/CodeBehindWriter.cs
@@ -44,7 +44,7 @@ namespace MonoDevelop.DesignerSupport
List<KeyValuePair<FilePath,string>> filesToWrite = new List<KeyValuePair<FilePath,string>> ();
CodeDomProvider provider;
CodeGeneratorOptions options;
- IProgressMonitor monitor;
+ ProgressMonitor monitor;
public CodeDomProvider Provider { get { return provider; } }
public CodeGeneratorOptions GeneratorOptions { get { return options; } }
@@ -59,14 +59,14 @@ namespace MonoDevelop.DesignerSupport
{
}
- CodeBehindWriter (IProgressMonitor monitor, CodeDomProvider provider, CodeGeneratorOptions options)
+ CodeBehindWriter (ProgressMonitor monitor, CodeDomProvider provider, CodeGeneratorOptions options)
{
this.provider = provider;
this.options = options;
this.monitor = monitor;
}
- public static CodeBehindWriter CreateForProject (IProgressMonitor monitor, DotNetProject project)
+ public static CodeBehindWriter CreateForProject (ProgressMonitor monitor, DotNetProject project)
{
var pol = project.Policies.Get<TextStylePolicy> ();
var options = new CodeGeneratorOptions () {
@@ -84,11 +84,11 @@ namespace MonoDevelop.DesignerSupport
openFiles = new List<string> ();
if (!IdeApp.IsInitialized)
return openFiles;
- DispatchService.GuiSyncDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
foreach (var doc in IdeApp.Workbench.Documents)
- if (doc.GetContent<IEditableTextBuffer> () != null)
- openFiles.Add (doc.FileName);
- });
+ if (doc.Editor != null)
+ openFiles.Add (doc.FileName);
+ }).Wait ();
}
return openFiles;
}
@@ -116,9 +116,15 @@ namespace MonoDevelop.DesignerSupport
});
WrittenCount++;
} catch (IOException ex) {
- monitor.ReportError (GettextCatalog.GetString ("Failed to write file '{0}'.", path), ex);
+ if (monitor != null)
+ monitor.ReportError (GettextCatalog.GetString ("Failed to write file '{0}'.", path), ex);
+ else
+ LoggingService.LogError ("CodeBehindWriter failed", ex);
} catch (Exception ex) {
- monitor.ReportError (GettextCatalog.GetString ("Failed to generate code for file '{0}'.", path), ex);
+ if (monitor != null)
+ monitor.ReportError (GettextCatalog.GetString ("Failed to generate code for file '{0}'.", path), ex);
+ else
+ LoggingService.LogError ("CodeBehindWriter failed", ex);
}
}
@@ -145,9 +151,15 @@ namespace MonoDevelop.DesignerSupport
});
WrittenCount++;
} catch (IOException ex) {
- monitor.ReportError (GettextCatalog.GetString ("Failed to write file '{0}'.", path), ex);
+ if (monitor != null)
+ monitor.ReportError (GettextCatalog.GetString ("Failed to write file '{0}'.", path), ex);
+ else
+ LoggingService.LogError ("CodeBehindWriter failed", ex);
} catch (Exception ex) {
- monitor.ReportError (GettextCatalog.GetString ("Failed to generate code for file '{0}'.", path), ex);
+ if (monitor != null)
+ monitor.ReportError (GettextCatalog.GetString ("Failed to generate code for file '{0}'.", path), ex);
+ else
+ LoggingService.LogError ("CodeBehindWriter failed", ex);
}
}
@@ -163,14 +175,14 @@ namespace MonoDevelop.DesignerSupport
}
//these documents are open, so needs to run in GUI thread
- DispatchService.GuiSyncDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
foreach (KeyValuePair<FilePath, string> item in filesToWrite) {
try {
bool updated = false;
foreach (MonoDevelop.Ide.Gui.Document doc in IdeApp.Workbench.Documents) {
if (doc.FileName == item.Key) {
- var textFile = doc.GetContent<MonoDevelop.Projects.Text.IEditableTextFile> ();
+ var textFile = doc.GetContent<MonoDevelop.Ide.Editor.TextEditor> ();
if (textFile == null)
continue;
@@ -195,12 +207,13 @@ namespace MonoDevelop.DesignerSupport
WrittenCount++;
} catch (IOException ex) {
- monitor.ReportError (
- GettextCatalog.GetString ("Failed to write file '{0}'.", item.Key),
- ex);
+ if (monitor != null)
+ monitor.ReportError (GettextCatalog.GetString ("Failed to write file '{0}'.", item.Key), ex);
+ else
+ LoggingService.LogError ("CodeBehindWriter failed", ex);
}
}
- });
+ }).Wait ();
filesToWrite = null;
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs
index fb87b62f38..b86f6f6ac1 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/DocumentOutlinePad.cs
@@ -34,12 +34,13 @@ using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide;
using System.Collections.Generic;
+using MonoDevelop.Components;
namespace MonoDevelop.DesignerSupport
{
- public class DocumentOutlinePad : AbstractPadContent
+ public class DocumentOutlinePad : PadContent
{
Alignment box;
IOutlinedDocument currentOutlineDoc;
@@ -54,12 +55,12 @@ namespace MonoDevelop.DesignerSupport
box.ShowAll ();
}
- public override void Initialize (IPadWindow window)
+ protected override void Initialize (IPadWindow window)
{
base.Initialize (window);
IdeApp.Workbench.ActiveDocumentChanged += DocumentChangedHandler;
CurrentDoc = IdeApp.Workbench.ActiveDocument;
- toolbar = window.GetToolbar (PositionType.Top);
+ toolbar = window.GetToolbar (DockPositionType.Top);
toolbar.Visible = false;
Update ();
}
@@ -85,7 +86,7 @@ namespace MonoDevelop.DesignerSupport
}
}
- public override Gtk.Widget Control {
+ public override Control Control {
get { return box; }
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ErrorInFileException.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ErrorInFileException.cs
index ca6f701e0c..7db1a0bbc0 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ErrorInFileException.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ErrorInFileException.cs
@@ -27,7 +27,7 @@
//
using System;
-using ICSharpCode.NRefactory.TypeSystem;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.DesignerSupport
{
@@ -38,10 +38,10 @@ namespace MonoDevelop.DesignerSupport
int column = 0;
string fileName = null;
- public ErrorInFileException (DomRegion region, string fileName)
+ public ErrorInFileException (DocumentLocation region, string fileName)
{
- this.line = region.BeginLine;
- this.column = region.BeginColumn;
+ this.line = region.Line;
+ this.column = region.Column;
this.fileName = fileName;
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/MemberExistsException.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/MemberExistsException.cs
index 7da3385ae6..d4d89d58b0 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/MemberExistsException.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/MemberExistsException.cs
@@ -1,128 +1,128 @@
+////
+//// MemberExistsException.cs: Thrown if identifier already exists when
+//// binding CodeBehind members.
+////
+//// Authors:
+//// Michael Hutchinson <m.j.hutchinson@gmail.com>
+////
+//// Copyright (C) 2006 Michael Hutchinson
+////
+////
+//// This source code is licenced under The MIT License:
+////
+//// Permission is hereby granted, free of charge, to any person obtaining
+//// a copy of this software and associated documentation files (the
+//// "Software"), to deal in the Software without restriction, including
+//// without limitation the rights to use, copy, modify, merge, publish,
+//// distribute, sublicense, and/or sell copies of the Software, and to
+//// permit persons to whom the Software is furnished to do so, subject to
+//// the following conditions:
+////
+//// The above copyright notice and this permission notice shall be
+//// included in all copies or substantial portions of the Software.
+////
+//// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+//// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+//// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+//// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+//// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+//// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+//// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+////
//
-// MemberExistsException.cs: Thrown if identifier already exists when
-// binding CodeBehind members.
+//using System;
+//using ICSharpCode.NRefactory.TypeSystem;
//
-// Authors:
-// Michael Hutchinson <m.j.hutchinson@gmail.com>
-//
-// Copyright (C) 2006 Michael Hutchinson
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using ICSharpCode.NRefactory.TypeSystem;
-
-namespace MonoDevelop.DesignerSupport
-{
- public class MemberExistsException : ErrorInFileException
- {
- string className;
- string memberName;
-
- MemberType existingMemberType = MemberType.Member;
- MemberType newMemberType = MemberType.Member;
-
- public MemberExistsException (string className, string memberName)
- : base (DomRegion.Empty, null)
- {
- this.className = className;
- this.memberName = memberName;
- }
-
- public MemberExistsException (string className, string memberName, MemberType existingMemberType, MemberType newMemberType, DomRegion errorLocation, string fileName)
- : base (errorLocation, fileName)
- {
- this.className = className;
- this.memberName = memberName;
- this.existingMemberType = existingMemberType;
- this.newMemberType = newMemberType;
- }
-
- public MemberExistsException (string className, MemberType newMemberType, System.CodeDom.CodeTypeMember existingMember, DomRegion errorLocation, string fileName)
- : this (className, existingMember.Name, newMemberType, GetMemberTypeFromCodeTypeMember (existingMember), errorLocation, fileName)
- {
- }
-
- public MemberExistsException (string className, System.CodeDom.CodeTypeMember newMember, MemberType existingMemberType, DomRegion errorLocation, string fileName)
- : this (className, newMember.Name, GetMemberTypeFromCodeTypeMember (newMember), existingMemberType, errorLocation, fileName)
- {
- }
-
- protected static MemberType GetMemberTypeFromCodeTypeMember (System.CodeDom.CodeTypeMember mem)
- {
- if (mem is System.CodeDom.CodeMemberEvent)
- return MemberType.Event;
- else if (mem is System.CodeDom.CodeMemberProperty)
- return MemberType.Property;
- else if (mem is System.CodeDom.CodeMemberField)
- return MemberType.Field;
- else if (mem is System.CodeDom.CodeMemberMethod)
- return MemberType.Method;
- return MemberType.Member;
- }
-
- public string ClassName {
- get { return className; }
- set { className = value; }
- }
-
- public string MemberName {
- get { return memberName; }
- set { memberName = value; }
- }
-
- public MemberType ExistingMemberType {
- get { return existingMemberType; }
- set { existingMemberType = value; }
- }
-
- public MemberType NewMemberType {
- get { return newMemberType; }
- set { newMemberType = value; }
- }
-
- public override string ToString ()
- {
- string str;
- if (NewMemberType == ExistingMemberType)
- str = MonoDevelop.Core.GettextCatalog.GetString ("Cannot add {0} '{1}' to class '{2}', " +
- "because there is already a {3} with that name with an incompatible return type.");
- else
- str = MonoDevelop.Core.GettextCatalog.GetString ("Cannot add {0} '{1}' to class '{2}', " +
- "because there is already a {3} with that name.");
-
- return string.Format (str, newMemberType.ToString ().ToLower (), memberName, className,
- existingMemberType.ToString ().ToLower ());
- }
- }
-
- public enum MemberType
- {
- Member,
- Field,
- Property,
- Method,
- Event
- }
-}
+//namespace MonoDevelop.DesignerSupport
+//{
+// public class MemberExistsException : ErrorInFileException
+// {
+// string className;
+// string memberName;
+//
+// MemberType existingMemberType = MemberType.Member;
+// MemberType newMemberType = MemberType.Member;
+//
+// public MemberExistsException (string className, string memberName)
+// : base (DomRegion.Empty, null)
+// {
+// this.className = className;
+// this.memberName = memberName;
+// }
+//
+// public MemberExistsException (string className, string memberName, MemberType existingMemberType, MemberType newMemberType, DomRegion errorLocation, string fileName)
+// : base (errorLocation, fileName)
+// {
+// this.className = className;
+// this.memberName = memberName;
+// this.existingMemberType = existingMemberType;
+// this.newMemberType = newMemberType;
+// }
+//
+// public MemberExistsException (string className, MemberType newMemberType, System.CodeDom.CodeTypeMember existingMember, DomRegion errorLocation, string fileName)
+// : this (className, existingMember.Name, newMemberType, GetMemberTypeFromCodeTypeMember (existingMember), errorLocation, fileName)
+// {
+// }
+//
+// public MemberExistsException (string className, System.CodeDom.CodeTypeMember newMember, MemberType existingMemberType, DomRegion errorLocation, string fileName)
+// : this (className, newMember.Name, GetMemberTypeFromCodeTypeMember (newMember), existingMemberType, errorLocation, fileName)
+// {
+// }
+//
+// protected static MemberType GetMemberTypeFromCodeTypeMember (System.CodeDom.CodeTypeMember mem)
+// {
+// if (mem is System.CodeDom.CodeMemberEvent)
+// return MemberType.Event;
+// else if (mem is System.CodeDom.CodeMemberProperty)
+// return MemberType.Property;
+// else if (mem is System.CodeDom.CodeMemberField)
+// return MemberType.Field;
+// else if (mem is System.CodeDom.CodeMemberMethod)
+// return MemberType.Method;
+// return MemberType.Member;
+// }
+//
+// public string ClassName {
+// get { return className; }
+// set { className = value; }
+// }
+//
+// public string MemberName {
+// get { return memberName; }
+// set { memberName = value; }
+// }
+//
+// public MemberType ExistingMemberType {
+// get { return existingMemberType; }
+// set { existingMemberType = value; }
+// }
+//
+// public MemberType NewMemberType {
+// get { return newMemberType; }
+// set { newMemberType = value; }
+// }
+//
+// public override string ToString ()
+// {
+// string str;
+// if (NewMemberType == ExistingMemberType)
+// str = MonoDevelop.Core.GettextCatalog.GetString ("Cannot add {0} '{1}' to class '{2}', " +
+// "because there is already a {3} with that name with an incompatible return type.");
+// else
+// str = MonoDevelop.Core.GettextCatalog.GetString ("Cannot add {0} '{1}' to class '{2}', " +
+// "because there is already a {3} with that name.");
+//
+// return string.Format (str, newMemberType.ToString ().ToLower (), memberName, className,
+// existingMemberType.ToString ().ToLower ());
+// }
+// }
+//
+// public enum MemberType
+// {
+// Member,
+// Field,
+// Property,
+// Method,
+// Event
+// }
+//}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPad.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPad.cs
index 690aa67385..fb18f70238 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPad.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPad.cs
@@ -41,11 +41,12 @@ using System.Collections.Generic;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Commands;
+using MonoDevelop.Components;
namespace MonoDevelop.DesignerSupport
{
- public class PropertyPad : AbstractPadContent, ICommandDelegator
+ public class PropertyPad : PadContent, ICommandDelegator
{
pg.PropertyGrid grid;
InvisibleFrame frame;
@@ -64,10 +65,10 @@ namespace MonoDevelop.DesignerSupport
frame.ShowAll ();
}
- public override void Initialize (IPadWindow container)
+ protected override void Initialize (IPadWindow container)
{
base.Initialize (container);
- toolbarProvider.Attach (container.GetToolbar (Gtk.PositionType.Top));
+ toolbarProvider.Attach (container.GetToolbar (DockPositionType.Top));
grid.SetToolbarProvider (toolbarProvider);
this.container = container;
DesignerSupport.Service.SetPad (this);
@@ -79,13 +80,14 @@ namespace MonoDevelop.DesignerSupport
#region AbstractPadContent implementations
- public override Gtk.Widget Control {
+ public override Control Control {
get { return frame; }
}
public override void Dispose()
{
DesignerSupport.Service.SetPad (null);
+ base.Dispose ();
}
#endregion
@@ -118,7 +120,7 @@ namespace MonoDevelop.DesignerSupport
customWidget = false;
frame.Remove (frame.Child);
frame.Add (grid);
- toolbarProvider.Attach (container.GetToolbar (Gtk.PositionType.Top));
+ toolbarProvider.Attach (container.GetToolbar (DockPositionType.Top));
}
return grid;
@@ -138,7 +140,7 @@ namespace MonoDevelop.DesignerSupport
void ClearToolbar ()
{
if (container != null) {
- var toolbar = container.GetToolbar (Gtk.PositionType.Top);
+ var toolbar = container.GetToolbar (DockPositionType.Top);
foreach (var w in toolbar.Children)
toolbar.Remove (w);
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPadVisitor.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPadVisitor.cs
index 8ba3317a35..e3431daaa1 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPadVisitor.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/PropertyPadVisitor.cs
@@ -83,6 +83,10 @@ namespace MonoDevelop.DesignerSupport
if (ob == ((DefaultWorkbench)IdeApp.Workbench.RootWindow).ActiveWorkbenchWindow)
visitedCurrentDoc = true;
+ if (ob is MonoDevelop.Components.Docking.AutoHideBox) {
+ found = true;
+ return true;
+ }
if (ob is PropertyPad) {
// Don't change the property grid selection when the focus is inside the property grid itself
found = true;
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxPad.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxPad.cs
index e6abccb836..f27049ed61 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxPad.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxPad.cs
@@ -35,11 +35,12 @@ using MonoDevelop.Ide.Gui;
using MonoDevelop.DesignerSupport;
using MonoDevelop.DesignerSupport.Toolbox;
+using MonoDevelop.Components;
namespace MonoDevelop.DesignerSupport
{
- public class ToolboxPad : AbstractPadContent
+ public class ToolboxPad : PadContent
{
Toolbox.Toolbox toolbox;
@@ -47,7 +48,7 @@ namespace MonoDevelop.DesignerSupport
{
}
- public override void Initialize (IPadWindow container)
+ protected override void Initialize (IPadWindow container)
{
base.Initialize (container);
toolbox = new Toolbox.Toolbox (DesignerSupport.Service.ToolboxService, container);
@@ -56,7 +57,7 @@ namespace MonoDevelop.DesignerSupport
#region AbstractPadContent implementations
- public override Gtk.Widget Control {
+ public override Control Control {
get { return toolbox; }
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxService.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxService.cs
index f69e96ea71..68c6ddf7f8 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxService.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxService.cs
@@ -184,7 +184,7 @@ namespace MonoDevelop.DesignerSupport
ctx.Dispose ();
}
- DispatchService.GuiDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
AddUserItems (nodes);
initializing--;
SaveConfiguration ();
@@ -541,7 +541,7 @@ namespace MonoDevelop.DesignerSupport
throw new InvalidOperationException ("Unexpected ToolboxItemFilterType value.");
}
- internal ComponentIndex GetComponentIndex (IProgressMonitor monitor)
+ internal ComponentIndex GetComponentIndex (ProgressMonitor monitor)
{
// Returns an index of all components that can be added to the toolbox.
@@ -558,7 +558,7 @@ namespace MonoDevelop.DesignerSupport
todelete.Add (ia);
if (ia.NeedsUpdate)
toupdate.Add (ia);
- if (monitor.IsCancelRequested)
+ if (monitor.CancellationToken.IsCancellationRequested)
return index;
}
@@ -571,7 +571,7 @@ namespace MonoDevelop.DesignerSupport
index.Files.Add (c);
toupdate.Add (c);
}
- if (monitor.IsCancelRequested)
+ if (monitor.CancellationToken.IsCancellationRequested)
return index;
}
}
@@ -587,7 +587,7 @@ namespace MonoDevelop.DesignerSupport
foreach (ComponentIndexFile ia in toupdate) {
ia.Update (ctx);
monitor.Step (1);
- if (monitor.IsCancelRequested)
+ if (monitor.CancellationToken.IsCancellationRequested)
return index;
}
} finally {
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/TypeNotFoundException.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/TypeNotFoundException.cs
index eae3b3b743..1427f6a311 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/TypeNotFoundException.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/TypeNotFoundException.cs
@@ -28,7 +28,7 @@
using System;
using MonoDevelop.Core;
-using ICSharpCode.NRefactory.TypeSystem;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.DesignerSupport
{
@@ -36,7 +36,7 @@ namespace MonoDevelop.DesignerSupport
{
string className;
- public TypeNotFoundException (string className, DomRegion location, string fileName)
+ public TypeNotFoundException (string className, DocumentLocation location, string fileName)
: base (location, fileName)
{
this.ClassName = className;
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/WrapperDesignView.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/WrapperDesignView.cs
index 3f047bb62b..8de2800c5f 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/WrapperDesignView.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/WrapperDesignView.cs
@@ -1,5 +1,5 @@
//
-// WrapperDesignView.cs: base class for wrapping an IViewContent. Heavily based on
+// WrapperDesignView.cs: base class for wrapping an ViewContent. Heavily based on
// MonoDevelop.GtkCore.GuiBuilder.CombinedDesignView
//
// Author:
@@ -31,28 +31,30 @@
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide;
+using System.Collections.Generic;
+using System.Threading.Tasks;
namespace MonoDevelop.DesignerSupport
{
- public class WrapperDesignView : AbstractViewContent
+ public class WrapperDesignView : ViewContent
{
- IViewContent content;
+ ViewContent content;
Gtk.VBox contentBox;
Gtk.Widget topBar;
- public WrapperDesignView (IViewContent content)
+ public WrapperDesignView (ViewContent content)
{
this.content = content;
this.contentBox = new Gtk.VBox ();
this.contentBox.PackEnd (content.Control, true, true, 0);
this.contentBox.ShowAll ();
- content.ContentChanged += new EventHandler (OnTextContentChanged);
content.DirtyChanged += new EventHandler (OnTextDirtyChanged);
-
+
IdeApp.Workbench.ActiveDocumentChanged += new EventHandler (OnActiveDocumentChanged);
}
@@ -76,50 +78,53 @@ namespace MonoDevelop.DesignerSupport
}
}
- protected IViewContent Content {
+ protected ViewContent Content {
get { return content; }
}
- public override MonoDevelop.Projects.Project Project {
- get { return base.Project; }
- set {
- base.Project = value;
- content.Project = value;
+ protected override void OnSetProject (MonoDevelop.Projects.Project project)
+ {
+ base.OnSetProject (project);
+ content.Project = project;
+ }
+
+ public override ProjectReloadCapability ProjectReloadCapability {
+ get {
+ return content.ProjectReloadCapability;
}
}
- protected override void OnWorkbenchWindowChanged (EventArgs e)
+ protected override void OnWorkbenchWindowChanged ()
{
- base.OnWorkbenchWindowChanged (e);
+ base.OnWorkbenchWindowChanged ();
content.WorkbenchWindow = WorkbenchWindow;
}
public override void Dispose ()
{
- content.ContentChanged -= new EventHandler (OnTextContentChanged);
content.DirtyChanged -= new EventHandler (OnTextDirtyChanged);
IdeApp.Workbench.ActiveDocumentChanged -= new EventHandler (OnActiveDocumentChanged);
base.Dispose ();
}
- public override void Load (string fileName)
+ public override Task Load (FileOpenInformation fileOpenInformation)
{
- ContentName = fileName;
- content.Load (fileName);
+ ContentName = fileOpenInformation.FileName;
+ return content.Load (ContentName);
}
- public override void LoadNew (System.IO.Stream content, string mimeType)
+ public override Task LoadNew (System.IO.Stream content, string mimeType)
{
- this.content.LoadNew (content, mimeType);
+ return this.content.LoadNew (content, mimeType);
}
- public override Gtk.Widget Control {
+ public override Control Control {
get { return contentBox; }
}
- public override void Save (string fileName)
+ public override Task Save (FileSaveInformation fileSaveInformation)
{
- content.Save (fileName);
+ return content.Save (fileSaveInformation);
}
public override bool IsDirty {
@@ -138,19 +143,15 @@ namespace MonoDevelop.DesignerSupport
}
}
- public override string ContentName {
- get { return content.ContentName; }
- set { content.ContentName = value; }
- }
-
- void OnTextContentChanged (object s, EventArgs args)
+ protected override void OnContentNameChanged ()
{
- OnContentChanged (args);
+ base.OnContentNameChanged ();
+ content.ContentName = ContentName;
}
-
+
void OnTextDirtyChanged (object s, EventArgs args)
{
- OnDirtyChanged (args);
+ OnDirtyChanged ();
}
void OnActiveDocumentChanged (object s, EventArgs args)
@@ -163,10 +164,10 @@ namespace MonoDevelop.DesignerSupport
protected virtual void OnDocumentActivated ()
{
}
-
- public override object GetContent (Type type)
+
+ protected override IEnumerable<object> OnGetContents (Type type)
{
- return base.GetContent (type) ?? content.GetContent (type);
+ return base.OnGetContents (type).Concat (content.GetContents (type));
}
}
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.ClassOutlineSortingPreferencesDialog.cs b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.ClassOutlineSortingPreferencesDialog.cs
deleted file mode 100644
index debf11a674..0000000000
--- a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.ClassOutlineSortingPreferencesDialog.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-
-// This file has been generated by the GUI designer. Do not modify.
-namespace MonoDevelop.DesignerSupport
-{
- internal partial class ClassOutlineSortingPreferencesDialog
- {
- private global::Gtk.VBox vbox2;
- private global::Gtk.Label label;
- private global::MonoDevelop.Ide.Gui.Components.PriorityList priorityList;
- private global::Gtk.Button buttonCancel;
- private global::Gtk.Button buttonOk;
-
- protected virtual void Build ()
- {
- global::Stetic.Gui.Initialize (this);
- // Widget MonoDevelop.DesignerSupport.ClassOutlineSortingPreferencesDialog
- this.Name = "MonoDevelop.DesignerSupport.ClassOutlineSortingPreferencesDialog";
- this.Title = global::Mono.Unix.Catalog.GetString ("Document Outline Preferences");
- this.WindowPosition = ((global::Gtk.WindowPosition)(4));
- this.Modal = true;
- this.DestroyWithParent = true;
- // Internal child MonoDevelop.DesignerSupport.ClassOutlineSortingPreferencesDialog.VBox
- global::Gtk.VBox w1 = this.VBox;
- w1.Name = "dialog1_VBox";
- w1.BorderWidth = ((uint)(2));
- // Container child dialog1_VBox.Gtk.Box+BoxChild
- this.vbox2 = new global::Gtk.VBox ();
- this.vbox2.Name = "vbox2";
- this.vbox2.Spacing = 6;
- this.vbox2.BorderWidth = ((uint)(6));
- // Container child vbox2.Gtk.Box+BoxChild
- this.label = new global::Gtk.Label ();
- this.label.WidthRequest = 400;
- this.label.Name = "label";
- this.label.LabelProp = global::Mono.Unix.Catalog.GetString ("Group sorting order when grouping is enabled:");
- this.label.Wrap = true;
- this.vbox2.Add (this.label);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.label]));
- w2.Position = 0;
- w2.Expand = false;
- w2.Fill = false;
- // Container child vbox2.Gtk.Box+BoxChild
- this.priorityList = new global::MonoDevelop.Ide.Gui.Components.PriorityList ();
- this.priorityList.Name = "priorityList";
- this.vbox2.Add (this.priorityList);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.priorityList]));
- w3.Position = 1;
- w1.Add (this.vbox2);
- global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2]));
- w4.Position = 0;
- // Internal child MonoDevelop.DesignerSupport.ClassOutlineSortingPreferencesDialog.ActionArea
- global::Gtk.HButtonBox w5 = this.ActionArea;
- w5.Name = "dialog1_ActionArea";
- w5.Spacing = 10;
- w5.BorderWidth = ((uint)(5));
- w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
- // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
- this.buttonCancel = new global::Gtk.Button ();
- this.buttonCancel.CanDefault = true;
- this.buttonCancel.CanFocus = true;
- this.buttonCancel.Name = "buttonCancel";
- this.buttonCancel.UseStock = true;
- this.buttonCancel.UseUnderline = true;
- this.buttonCancel.Label = "gtk-cancel";
- this.AddActionWidget (this.buttonCancel, -6);
- global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonCancel]));
- w6.Expand = false;
- w6.Fill = false;
- // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
- this.buttonOk = new global::Gtk.Button ();
- this.buttonOk.CanDefault = true;
- this.buttonOk.CanFocus = true;
- this.buttonOk.Name = "buttonOk";
- this.buttonOk.UseStock = true;
- this.buttonOk.UseUnderline = true;
- this.buttonOk.Label = "gtk-ok";
- this.AddActionWidget (this.buttonOk, -5);
- global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5 [this.buttonOk]));
- w7.Position = 1;
- w7.Expand = false;
- w7.Fill = false;
- if ((this.Child != null)) {
- this.Child.ShowAll ();
- }
- this.DefaultWidth = 424;
- this.DefaultHeight = 367;
- this.Hide ();
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs
index ad3979a16d..2aa3075445 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.cs
@@ -5,17 +5,33 @@ namespace MonoDevelop.DesignerSupport.Toolbox
internal partial class ComponentSelectorDialog
{
private global::Gtk.VBox vbox2;
+
private global::Gtk.HBox hbox1;
+
private global::Gtk.Label label1;
+
private global::Gtk.ComboBox comboType;
+
private global::Gtk.VSeparator vseparator1;
+
private global::Gtk.Button button24;
+
+ private global::Gtk.HBox hbox2;
+
+ private global::MonoDevelop.Components.ImageView imageview1;
+
+ private global::Gtk.Label label2;
+
private global::Gtk.ScrolledWindow scrolledwindow1;
+
private global::Gtk.TreeView listView;
+
private global::Gtk.CheckButton checkGroupByCat;
+
private global::Gtk.Button buttonCancel;
- private global::Gtk.Button buttonOk;
+ private global::Gtk.Button buttonOk;
+
protected virtual void Build ()
{
global::Stetic.Gui.Initialize (this);
@@ -64,33 +80,40 @@ namespace MonoDevelop.DesignerSupport.Toolbox
this.button24 = new global::Gtk.Button ();
this.button24.CanFocus = true;
this.button24.Name = "button24";
- this.button24.UseUnderline = true;
// Container child button24.Gtk.Container+ContainerChild
- global::Gtk.Alignment w5 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
- // Container child GtkAlignment.Gtk.Container+ContainerChild
- global::Gtk.HBox w6 = new global::Gtk.HBox ();
- w6.Spacing = 2;
- // Container child GtkHBox.Gtk.Container+ContainerChild
- global::Gtk.Image w7 = new global::Gtk.Image ();
- w7.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-add", global::Gtk.IconSize.Menu);
- w6.Add (w7);
- // Container child GtkHBox.Gtk.Container+ContainerChild
- global::Gtk.Label w9 = new global::Gtk.Label ();
- w9.LabelProp = global::Mono.Unix.Catalog.GetString ("Add Assembly...");
- w9.UseUnderline = true;
- w6.Add (w9);
- w5.Add (w6);
- this.button24.Add (w5);
+ this.hbox2 = new global::Gtk.HBox ();
+ this.hbox2.Name = "hbox2";
+ this.hbox2.Spacing = 2;
+ // Container child hbox2.Gtk.Box+BoxChild
+ this.imageview1 = new global::MonoDevelop.Components.ImageView ();
+ this.imageview1.Name = "imageview1";
+ this.imageview1.IconId = "gtk-add";
+ this.imageview1.IconSize = ((global::Gtk.IconSize)(1));
+ this.hbox2.Add (this.imageview1);
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.imageview1]));
+ w5.Position = 0;
+ w5.Expand = false;
+ w5.Fill = false;
+ // Container child hbox2.Gtk.Box+BoxChild
+ this.label2 = new global::Gtk.Label ();
+ this.label2.Name = "label2";
+ this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Add Assembly...");
+ this.label2.UseUnderline = true;
+ this.hbox2.Add (this.label2);
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.label2]));
+ w6.Position = 1;
+ w6.Expand = false;
+ w6.Fill = false;
+ this.button24.Add (this.hbox2);
this.hbox1.Add (this.button24);
- global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.button24]));
- w13.Position = 3;
- w13.Expand = false;
- w13.Fill = false;
+ global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.button24]));
+ w8.Position = 3;
+ w8.Expand = false;
this.vbox2.Add (this.hbox1);
- global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1]));
- w14.Position = 0;
- w14.Expand = false;
- w14.Fill = false;
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1]));
+ w9.Position = 0;
+ w9.Expand = false;
+ w9.Fill = false;
// Container child vbox2.Gtk.Box+BoxChild
this.scrolledwindow1 = new global::Gtk.ScrolledWindow ();
this.scrolledwindow1.CanFocus = true;
@@ -102,8 +125,8 @@ namespace MonoDevelop.DesignerSupport.Toolbox
this.listView.Name = "listView";
this.scrolledwindow1.Add (this.listView);
this.vbox2.Add (this.scrolledwindow1);
- global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.scrolledwindow1]));
- w16.Position = 1;
+ global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.scrolledwindow1]));
+ w11.Position = 1;
// Container child vbox2.Gtk.Box+BoxChild
this.checkGroupByCat = new global::Gtk.CheckButton ();
this.checkGroupByCat.CanFocus = true;
@@ -112,19 +135,19 @@ namespace MonoDevelop.DesignerSupport.Toolbox
this.checkGroupByCat.DrawIndicator = true;
this.checkGroupByCat.UseUnderline = true;
this.vbox2.Add (this.checkGroupByCat);
- global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.checkGroupByCat]));
- w17.Position = 2;
- w17.Expand = false;
- w17.Fill = false;
+ global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.checkGroupByCat]));
+ w12.Position = 2;
+ w12.Expand = false;
+ w12.Fill = false;
w1.Add (this.vbox2);
- global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2]));
- w18.Position = 0;
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2]));
+ w13.Position = 0;
// Internal child MonoDevelop.DesignerSupport.Toolbox.ComponentSelectorDialog.ActionArea
- global::Gtk.HButtonBox w19 = this.ActionArea;
- w19.Name = "dialog1_ActionArea";
- w19.Spacing = 10;
- w19.BorderWidth = ((uint)(5));
- w19.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
+ global::Gtk.HButtonBox w14 = this.ActionArea;
+ w14.Name = "dialog1_ActionArea";
+ w14.Spacing = 10;
+ w14.BorderWidth = ((uint)(5));
+ w14.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.buttonCancel = new global::Gtk.Button ();
this.buttonCancel.CanDefault = true;
@@ -134,9 +157,9 @@ namespace MonoDevelop.DesignerSupport.Toolbox
this.buttonCancel.UseUnderline = true;
this.buttonCancel.Label = "gtk-cancel";
this.AddActionWidget (this.buttonCancel, -6);
- global::Gtk.ButtonBox.ButtonBoxChild w20 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w19 [this.buttonCancel]));
- w20.Expand = false;
- w20.Fill = false;
+ global::Gtk.ButtonBox.ButtonBoxChild w15 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w14 [this.buttonCancel]));
+ w15.Expand = false;
+ w15.Fill = false;
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.buttonOk = new global::Gtk.Button ();
this.buttonOk.CanDefault = true;
@@ -145,11 +168,11 @@ namespace MonoDevelop.DesignerSupport.Toolbox
this.buttonOk.UseStock = true;
this.buttonOk.UseUnderline = true;
this.buttonOk.Label = "gtk-ok";
- w19.Add (this.buttonOk);
- global::Gtk.ButtonBox.ButtonBoxChild w21 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w19 [this.buttonOk]));
- w21.Position = 1;
- w21.Expand = false;
- w21.Fill = false;
+ w14.Add (this.buttonOk);
+ global::Gtk.ButtonBox.ButtonBoxChild w16 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w14 [this.buttonOk]));
+ w16.Position = 1;
+ w16.Expand = false;
+ w16.Fill = false;
if ((this.Child != null)) {
this.Child.ShowAll ();
}
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/generated.cs b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/generated.cs
index d608548128..9ef3363981 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/generated.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/generated.cs
@@ -14,40 +14,6 @@ namespace Stetic
}
}
- internal class IconLoader
- {
- public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size)
- {
- Gdk.Pixbuf res = widget.RenderIcon (name, size, null);
- if ((res != null)) {
- return res;
- } else {
- int sz;
- int sy;
- global::Gtk.Icon.SizeLookup (size, out sz, out sy);
- try {
- return Gtk.IconTheme.Default.LoadIcon (name, sz, 0);
- } catch (System.Exception) {
- if ((name != "gtk-missing-image")) {
- return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size);
- } else {
- Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz);
- Gdk.GC gc = new Gdk.GC (pmap);
- gc.RgbFgColor = new Gdk.Color (255, 255, 255);
- pmap.DrawRectangle (gc, true, 0, 0, sz, sz);
- gc.RgbFgColor = new Gdk.Color (0, 0, 0);
- pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1));
- gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
- gc.RgbFgColor = new Gdk.Color (255, 0, 0);
- pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4)));
- pmap.DrawLine (gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)));
- return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
- }
- }
- }
- }
- }
-
internal class ActionGroups
{
public static Gtk.ActionGroup GetActionGroup (System.Type type)
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/gui.stetic b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/gui.stetic
index 37f2b3a0bf..be5dc01e5f 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/gui.stetic
+++ b/main/src/addins/MonoDevelop.DesignerSupport/gtk-gui/gui.stetic
@@ -70,17 +70,48 @@
<widget class="Gtk.Button" id="button24">
<property name="MemberName" />
<property name="CanFocus">True</property>
- <property name="Type">TextAndIcon</property>
- <property name="Icon">stock:gtk-add Menu</property>
- <property name="Label" translatable="yes">Add Assembly...</property>
- <property name="UseUnderline">True</property>
+ <property name="Type">Custom</property>
<signal name="Clicked" handler="OnButton24Clicked" />
+ <child>
+ <widget class="Gtk.HBox" id="hbox2">
+ <property name="MemberName" />
+ <property name="Spacing">2</property>
+ <child>
+ <widget class="MonoDevelop.Components.ImageView" id="imageview1">
+ <property name="MemberName" />
+ <property name="IconId">gtk-add</property>
+ <property name="IconSize">Menu</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="label2">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">Add Assembly...</property>
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ </widget>
+ </child>
</widget>
<packing>
<property name="Position">3</property>
- <property name="AutoSize">True</property>
+ <property name="AutoSize">False</property>
<property name="Expand">False</property>
- <property name="Fill">False</property>
</packing>
</child>
</widget>
@@ -177,97 +208,4 @@
</widget>
</child>
</widget>
- <widget class="Gtk.Dialog" id="MonoDevelop.DesignerSupport.ClassOutlineSortingPreferencesDialog" design-size="424 367">
- <property name="MemberName" />
- <property name="Visible">False</property>
- <property name="GeneratePublic">False</property>
- <property name="Title" translatable="yes">Document Outline Preferences</property>
- <property name="WindowPosition">CenterOnParent</property>
- <property name="Modal">True</property>
- <property name="DestroyWithParent">True</property>
- <property name="Buttons">2</property>
- <property name="HelpButton">False</property>
- <child internal-child="VBox">
- <widget class="Gtk.VBox" id="dialog1_VBox">
- <property name="MemberName" />
- <property name="BorderWidth">2</property>
- <child>
- <widget class="Gtk.VBox" id="vbox2">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <property name="BorderWidth">6</property>
- <child>
- <widget class="Gtk.Label" id="label">
- <property name="MemberName" />
- <property name="WidthRequest">400</property>
- <property name="LabelProp" translatable="yes">Group sorting order when grouping is enabled:</property>
- <property name="Wrap">True</property>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="MonoDevelop.Ide.Gui.Components.PriorityList" id="priorityList">
- <property name="MemberName" />
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">False</property>
- </packing>
- </child>
- </widget>
- </child>
- <child internal-child="ActionArea">
- <widget class="Gtk.HButtonBox" id="dialog1_ActionArea">
- <property name="MemberName" />
- <property name="Spacing">10</property>
- <property name="BorderWidth">5</property>
- <property name="Size">2</property>
- <property name="LayoutStyle">End</property>
- <child>
- <widget class="Gtk.Button" id="buttonCancel">
- <property name="MemberName" />
- <property name="CanDefault">True</property>
- <property name="CanFocus">True</property>
- <property name="UseStock">True</property>
- <property name="Type">StockItem</property>
- <property name="StockId">gtk-cancel</property>
- <property name="ResponseId">-6</property>
- <property name="label">gtk-cancel</property>
- </widget>
- <packing>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Button" id="buttonOk">
- <property name="MemberName" />
- <property name="CanDefault">True</property>
- <property name="CanFocus">True</property>
- <property name="UseStock">True</property>
- <property name="Type">StockItem</property>
- <property name="StockId">gtk-ok</property>
- <property name="ResponseId">-5</property>
- <property name="label">gtk-ok</property>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
</stetic-interface> \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/compact-display-16.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/compact-display-16.png
index c29fc8585c..38a0e09dca 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/icons/compact-display-16.png
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/compact-display-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/compact-display-16@2x.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/compact-display-16@2x.png
index 13bbf3cf71..4406a7a500 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/icons/compact-display-16@2x.png
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/compact-display-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/compact-display-16~dark.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/compact-display-16~dark.png
new file mode 100644
index 0000000000..d125fbd522
--- /dev/null
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/compact-display-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/compact-display-16~dark@2x.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/compact-display-16~dark@2x.png
new file mode 100644
index 0000000000..c41db4ed17
--- /dev/null
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/compact-display-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16.png
index 49172a9f53..d8d188576e 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16.png
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16@2x.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16@2x.png
index 5b677d5c08..23b95dcd43 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16@2x.png
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~dark.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~dark.png
new file mode 100644
index 0000000000..e3911c83ba
--- /dev/null
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~dark@2x.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~dark@2x.png
new file mode 100644
index 0000000000..ebf9d91493
--- /dev/null
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~dark~sel.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~dark~sel.png
new file mode 100644
index 0000000000..2a6db9b28a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~dark~sel@2x.png
new file mode 100644
index 0000000000..e2f82cc6ee
--- /dev/null
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~sel.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~sel.png
new file mode 100644
index 0000000000..2a6db9b28a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~sel@2x.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~sel@2x.png
new file mode 100644
index 0000000000..e2f82cc6ee
--- /dev/null
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-document-outline-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16.png
index bff9c389c1..a455c12131 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16.png
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16@2x.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16@2x.png
index e061e98cae..7a52394201 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16@2x.png
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~dark.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~dark.png
new file mode 100644
index 0000000000..a4a3d47159
--- /dev/null
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~dark@2x.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~dark@2x.png
new file mode 100644
index 0000000000..9fae72d0d1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~dark~sel.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~dark~sel.png
new file mode 100644
index 0000000000..d6b7b2652d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~dark~sel@2x.png
new file mode 100644
index 0000000000..128cc11f7b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~sel.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~sel.png
new file mode 100644
index 0000000000..d6b7b2652d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~sel@2x.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~sel@2x.png
new file mode 100644
index 0000000000..128cc11f7b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-properties-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16.png
index feb26140d4..499a330b7e 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16.png
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16@2x.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16@2x.png
index 743318a76e..2c71672555 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16@2x.png
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~dark.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~dark.png
new file mode 100644
index 0000000000..fa5dd18620
--- /dev/null
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~dark@2x.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~dark@2x.png
new file mode 100644
index 0000000000..829495f647
--- /dev/null
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~dark~sel.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~dark~sel.png
new file mode 100644
index 0000000000..90190f2cee
--- /dev/null
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~dark~sel@2x.png
new file mode 100644
index 0000000000..f5281dbc84
--- /dev/null
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~sel.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~sel.png
new file mode 100644
index 0000000000..90190f2cee
--- /dev/null
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~sel@2x.png b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~sel@2x.png
new file mode 100644
index 0000000000..f5281dbc84
--- /dev/null
+++ b/main/src/addins/MonoDevelop.DesignerSupport/icons/pad-toolbox-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.DocFood/ChangeLog b/main/src/addins/MonoDevelop.DocFood/ChangeLog
deleted file mode 100644
index cf83291dc7..0000000000
--- a/main/src/addins/MonoDevelop.DocFood/ChangeLog
+++ /dev/null
@@ -1,64 +0,0 @@
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DocFood/Commands.cs:
- * MonoDevelop.DocFood/DocFoodTextEditorExtension.cs: Track API
- changes.
-
-2010-07-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.DocFood/DocFoodTextEditorExtension.cs: Track
- ProjectDomService/Parser API.
-
-2010-07-08 Levi Bard <levi@unity3d.com>
-
- * MonoDevelop.DocFood/DocFoodTextEditorExtension.cs:
- Prevent array overrun.
-
-2010-06-28 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.DocFood.csproj: Added texteditor reference.
-
-2010-06-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.DocFood/DocGenerator.cs: Assume that method
- sentences start with a verb.
-
-2010-06-17 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui:
- * Main.cs:
- * ChangeLog:
- * Makefile.am:
- * AssemblyInfo.cs:
- * DocFood.addin.xml:
- * DocFood.config.xml:
- * gtk-gui/gui.stetic:
- * MonoDevelop.DocFood:
- * gtk-gui/generated.cs:
- * MonoDevelop.DocFood.csproj:
- * MonoDevelop.DocFood.Options:
- * MonoDevelop.DocFood/Node.cs:
- * MonoDevelop.DocFood/Section.cs:
- * MonoDevelop.DocFood/Commands.cs:
- * MonoDevelop.DocFood/DocConfig.cs:
- * MonoDevelop.DocFood/IfStatement.cs:
- * MonoDevelop.DocFood/DocGenerator.cs:
- * MonoDevelop.DocFood/MemberVisitor.cs:
- * MonoDevelop.DocFood/IfNotStatement.cs:
- * MonoDevelop.DocFood/SwitchStatement.cs:
- * MonoDevelop.DocFood.Options/RulesPanelWidget.cs:
- * MonoDevelop.DocFood/DocFoodTextEditorExtension.cs:
- * MonoDevelop.DocFood.Options/OptionsPanelWidget.cs:
- * MonoDevelop.DocFood.Options/AcronymsPanelWidget.cs:
- * MonoDevelop.DocFood.Options/ExpansionsPanelWidget.cs:
- * MonoDevelop.DocFood.Options/OfTheReorderingWidget.cs:
- * MonoDevelop.DocFood.Options/NoTheReorderingWidget.cs:
- * gtk-gui/MonoDevelop.DocFood.Options.RulesPanelWidget.cs:
- * gtk-gui/MonoDevelop.DocFood.Options.OptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.DocFood.Options.AcronymsPanelWidget.cs:
- * gtk-gui/MonoDevelop.DocFood.Options.NoTheReorderingWidget.cs:
- * gtk-gui/MonoDevelop.DocFood.Options.ExpansionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.DocFood.Options.OfTheReorderingWidget.cs:
- Checked in doc food addin.
-
diff --git a/main/src/addins/MonoDevelop.DocFood/DocFood.addin.xml b/main/src/addins/MonoDevelop.DocFood/DocFood.addin.xml
index 609679061f..7178a45275 100644
--- a/main/src/addins/MonoDevelop.DocFood/DocFood.addin.xml
+++ b/main/src/addins/MonoDevelop.DocFood/DocFood.addin.xml
@@ -10,7 +10,7 @@
_label = "Document this" /> -->
<Command id = "MonoDevelop.DocFood.Commands.DocumentBuffer"
defaultHandler = "MonoDevelop.DocFood.DocumentBufferHandler"
- _label = "Document buffer" />
+ _label = "Document Buffer" />
</Extension>
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/AcronymsPanelWidget.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/AcronymsPanelWidget.cs
index 056df0d5fb..1e9ba38bae 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/AcronymsPanelWidget.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/AcronymsPanelWidget.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.DocFood.Options
@@ -44,7 +45,7 @@ namespace MonoDevelop.DocFood.Options
{
AcronymsPanelWidget panel;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
panel = new AcronymsPanelWidget (DocConfig.Instance);
return panel;
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/ExpansionsPanelWidget.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/ExpansionsPanelWidget.cs
index ef67d760f9..537a6c973b 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/ExpansionsPanelWidget.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/ExpansionsPanelWidget.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.DocFood.Options
@@ -54,7 +55,7 @@ namespace MonoDevelop.DocFood.Options
/// <returns>
/// The panel widget.
/// </returns>
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
panel = new ExpansionsPanelWidget (DocConfig.Instance);
return panel;
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/NoTheReorderingWidget.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/NoTheReorderingWidget.cs
index d8f9bd3f9d..e6d6613f9a 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/NoTheReorderingWidget.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/NoTheReorderingWidget.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.DocFood.Options
@@ -44,7 +45,7 @@ namespace MonoDevelop.DocFood.Options
{
NoTheReorderingWidget panel;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
panel = new NoTheReorderingWidget (DocConfig.Instance);
return panel;
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/OfTheReorderingWidget.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/OfTheReorderingWidget.cs
index 7a9e9f9012..a654d53e17 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/OfTheReorderingWidget.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/OfTheReorderingWidget.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.DocFood.Options
@@ -44,7 +45,7 @@ namespace MonoDevelop.DocFood.Options
{
OfTheReorderingWidget panel;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
panel = new OfTheReorderingWidget (DocConfig.Instance);
return panel;
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/OptionsPanelWidget.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/OptionsPanelWidget.cs
index 8bc50381fc..4ebfbd8e80 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/OptionsPanelWidget.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/OptionsPanelWidget.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.DocFood.Options
@@ -44,7 +45,7 @@ namespace MonoDevelop.DocFood.Options
{
OptionsPanelWidget panel;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
panel = new OptionsPanelWidget (DocConfig.Instance);
return panel;
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/RulesPanelWidget.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/RulesPanelWidget.cs
index 0de058c177..7bee353ab2 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/RulesPanelWidget.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.Options/RulesPanelWidget.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.DocFood.Options
@@ -44,7 +45,7 @@ namespace MonoDevelop.DocFood.Options
{
RulesPanelWidget panel;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
panel = new RulesPanelWidget (DocConfig.Instance);
return panel;
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.csproj b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.csproj
index f97eff30ac..89dad2b139 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.csproj
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood.csproj
@@ -49,6 +49,26 @@
<Reference Include="Mono.Posix" />
<Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference Include="System.Reflection.Metadata">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Reflection.Metadata.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Collections.Immutable">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Collections.Immutable.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.CSharp.Workspaces">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.CSharp.Workspaces.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.CSharp">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
@@ -114,16 +134,6 @@
<Name>Mono.TextEditor</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
- <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
- <Name>ICSharpCode.NRefactory</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory.CSharp\ICSharpCode.NRefactory.CSharp.csproj">
- <Project>{53DCA265-3C3C-42F9-B647-F72BA678122B}</Project>
- <Name>ICSharpCode.NRefactory.CSharp</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\MonoDevelop.SourceEditor2\MonoDevelop.SourceEditor.csproj">
<Project>{F8F92AA4-A376-4679-A9D4-60E7B7FBF477}</Project>
<Name>MonoDevelop.SourceEditor</Name>
@@ -149,5 +159,10 @@
<Name>Mono.Addins</Name>
<Private>False</Private>
</ProjectReference>
+ <ProjectReference Include="..\CSharpBinding\CSharpBinding.csproj">
+ <Project>{07CC7654-27D6-421D-A64C-0FFA40456FA2}</Project>
+ <Name>CSharpBinding</Name>
+ <Private>False</Private>
+ </ProjectReference>
</ItemGroup>
</Project>
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/Commands.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/Commands.cs
index d21033a71d..e83619fdf9 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/Commands.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/Commands.cs
@@ -28,9 +28,9 @@ using MonoDevelop.Components.Commands;
using MonoDevelop.Ide;
using System.Collections.Generic;
using System.Text;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
+using Microsoft.CodeAnalysis;
+using System.Linq;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.DocFood
{
@@ -45,7 +45,7 @@ namespace MonoDevelop.DocFood
{
info.Enabled = IdeApp.Workbench.ActiveDocument != null &&
IdeApp.Workbench.ActiveDocument.Editor != null &&
- IdeApp.Workbench.ActiveDocument.Editor.Document.MimeType == "text/x-csharp";
+ IdeApp.Workbench.ActiveDocument.Editor.MimeType == "text/x-csharp";
base.Update (info);
}
@@ -61,77 +61,78 @@ namespace MonoDevelop.DocFood
{
info.Enabled = IdeApp.Workbench.ActiveDocument != null &&
IdeApp.Workbench.ActiveDocument.Editor != null &&
- IdeApp.Workbench.ActiveDocument.Editor.Document.MimeType == "text/x-csharp";
+ IdeApp.Workbench.ActiveDocument.Editor.MimeType == "text/x-csharp";
base.Update (info);
}
protected override void Run ()
{
- var document = IdeApp.Workbench.ActiveDocument;
- if (document == null)
- return;
- var unit = document.ParsedDocument;
- if (unit == null)
- return;
- TextEditorData data = IdeApp.Workbench.ActiveDocument.Editor;
- var types = new Stack<IUnresolvedTypeDefinition> (unit.TopLevelTypeDefinitions);
- var docs = new List<KeyValuePair<int, string>> ();
- while (types.Count > 0) {
- var curType = types.Pop ();
- foreach (var member in curType.Members) {
- if (member is IUnresolvedTypeDefinition) {
- types.Push ((IUnresolvedTypeDefinition)member);
- continue;
- }
- if (!member.IsPublic) {
- if (member.DeclaringTypeDefinition != null && member.DeclaringTypeDefinition.Kind != TypeKind.Interface)
- continue;
- }
- if (!NeedsDocumentation (data, member))
- continue;
- int offset;
- var ctx = (unit.ParsedFile as CSharpUnresolvedFile).GetTypeResolveContext (document.Compilation, member.Region.Begin);
- var resolvedMember = member.CreateResolved (ctx);
- string indent = GetIndent (data, resolvedMember, out offset);
- string documentation = GenerateDocumentation (data, resolvedMember, indent);
- if (documentation.Trim ().Length == 0)
- continue;
- docs.Add (new KeyValuePair <int, string> (offset, documentation));
- }
- }
- docs.Sort ((a, b) => b.Key.CompareTo (a.Key));
- using (var undo = data.OpenUndoGroup ()) {
- docs.ForEach (doc => data.Insert (doc.Key, doc.Value));
- }
+// var document = IdeApp.Workbench.ActiveDocument;
+// if (document == null)
+// return;
+// var unit = document.ParsedDocument;
+// if (unit == null)
+// return;
+// TextEditorData data = IdeApp.Workbench.ActiveDocument.Editor;
+// var types = new Stack<IUnresolvedTypeDefinition> (unit.TopLevelTypeDefinitions);
+// var docs = new List<KeyValuePair<int, string>> ();
+// while (types.Count > 0) {
+// var curType = types.Pop ();
+// foreach (var member in curType.Members) {
+// if (member is IUnresolvedTypeDefinition) {
+// types.Push ((IUnresolvedTypeDefinition)member);
+// continue;
+// }
+// if (!member.IsPublic) {
+// if (member.DeclaringTypeDefinition != null && member.DeclaringTypeDefinition.Kind != TypeKind.Interface)
+// continue;
+// }
+// if (!NeedsDocumentation (data, member))
+// continue;
+// int offset;
+// var ctx = (unit.ParsedFile as CSharpUnresolvedFile).GetTypeResolveContext (document.Compilation, member.Region.Begin);
+// var resolvedMember = member.CreateResolved (ctx);
+// string indent = GetIndent (data, resolvedMember, out offset);
+// string documentation = GenerateDocumentation (data, resolvedMember, indent);
+// if (documentation.Trim ().Length == 0)
+// continue;
+// docs.Add (new KeyValuePair <int, string> (offset, documentation));
+// }
+// }
+// docs.Sort ((a, b) => b.Key.CompareTo (a.Key));
+// using (var undo = data.OpenUndoGroup ()) {
+// docs.ForEach (doc => data.Insert (doc.Key, doc.Value));
+// }
}
- static bool NeedsDocumentation (TextEditorData data, IUnresolvedEntity member)
+ static bool NeedsDocumentation (IReadonlyTextDocument data, ISymbol member)
{
- int lineNr = member.Region.BeginLine - 1;
- DocumentLine line;
+ int lineNr = data.OffsetToLineNumber (member.Locations.First().SourceSpan.Start) - 1;
+ IDocumentLine line;
+
do {
- line = data.Document.GetLine (lineNr--);
- } while (lineNr > 0 && data.Document.GetLineIndent (line).Length == line.Length);
- return !data.Document.GetTextAt (line).TrimStart ().StartsWith ("///", StringComparison.Ordinal);
+ line = data.GetLine (lineNr--);
+ } while (lineNr > 0 && data.GetLineIndent (line).Length == line.Length);
+ return !data.GetTextAt (line).TrimStart ().StartsWith ("///", StringComparison.Ordinal);
}
- static string GetIndent (TextEditorData data, IEntity member, out int offset)
+ static string GetIndent (IReadonlyTextDocument data, ISymbol member, out int offset)
{
- DocumentLine line = data.Document.GetLine (member.Region.BeginLine);
+ var line = data.GetLineByOffset (member.Locations.First().SourceSpan.Start);
offset = line.Offset;
- return data.Document.GetLineIndent (line);
+ return data.GetLineIndent (line);
}
- internal static string GenerateDocumentation (TextEditorData data, IEntity member, string indent)
+ internal static string GenerateDocumentation (IReadonlyTextDocument data, ISymbol member, string indent)
{
return GenerateDocumentation (data, member, indent, "/// ");
}
- internal static string GenerateDocumentation (TextEditorData data, IEntity member, string indent, string prefix)
+ internal static string GenerateDocumentation (IReadonlyTextDocument data, ISymbol member, string indent, string prefix)
{
StringBuilder result = new StringBuilder ();
- DocGenerator generator = new DocGenerator (data);
+ var generator = new DocGenerator (data);
generator.GenerateDoc (member);
bool first = true;
@@ -217,7 +218,7 @@ namespace MonoDevelop.DocFood
return result.ToString ();
}
- internal static string GenerateEmptyDocumentation (TextEditorData data, IEntity member, string indent)
+ internal static string GenerateEmptyDocumentation (IReadonlyTextDocument data, ISymbol member, string indent)
{
StringBuilder result = new StringBuilder ();
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocFoodTextEditorExtension.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocFoodTextEditorExtension.cs
index 8ab889cb73..7ccb5b775d 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocFoodTextEditorExtension.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocFoodTextEditorExtension.cs
@@ -1,6 +1,6 @@
//
// TextEditorExtension.cs
-//
+// =
// Author:
// Mike Krüger <mkrueger@novell.com>
//
@@ -24,91 +24,84 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using MonoDevelop.Ide.Gui.Content;
-using Mono.TextEditor;
-using System.Text;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
-using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Extension;
namespace MonoDevelop.DocFood
{
class DocFoodTextEditorExtension : TextEditorExtension
{
- TextEditorData textEditorData {
- get {
- return Document.Editor;
- }
- }
-
- string GenerateDocumentation (IEntity member, string indent)
+ string GenerateDocumentation (ISymbol member, string indent)
{
- string doc = DocumentBufferHandler.GenerateDocumentation (textEditorData, member, indent);
+ string doc = DocumentBufferHandler.GenerateDocumentation (Editor, member, indent);
int trimStart = (Math.Min (doc.Length - 1, indent.Length + "//".Length));
return doc.Substring (trimStart).TrimEnd ('\n', '\r');
}
- string GenerateEmptyDocumentation (IEntity member, string indent)
+ string GenerateEmptyDocumentation (ISymbol member, string indent)
{
- string doc = DocumentBufferHandler.GenerateEmptyDocumentation (textEditorData, member, indent);
+ string doc = DocumentBufferHandler.GenerateEmptyDocumentation (Editor, member, indent);
int trimStart = (Math.Min (doc.Length - 1, indent.Length + "//".Length));
return doc.Substring (trimStart).TrimEnd ('\n', '\r');
}
- public override bool KeyPress (Gdk.Key key, char keyChar, Gdk.ModifierType modifier)
+ public override bool KeyPress (KeyDescriptor descriptor)
{
- if (keyChar != '/')
- return base.KeyPress (key, keyChar, modifier);
+ if (descriptor.KeyChar != '/')
+ return base.KeyPress (descriptor);
- var line = textEditorData.Document.GetLine (textEditorData.Caret.Line);
- string text = textEditorData.Document.GetTextAt (line.Offset, line.Length);
+ var line = Editor.GetLine (Editor.CaretLine);
+ string text = Editor.GetTextAt (line.Offset, line.Length);
- if (!text.EndsWith ("//"))
- return base.KeyPress (key, keyChar, modifier);
+ if (!text.EndsWith ("//", StringComparison.Ordinal))
+ return base.KeyPress (descriptor);
// check if there is doc comment above or below.
var l = line.PreviousLine;
while (l != null && l.Length == 0)
l = l.PreviousLine;
- if (l != null && textEditorData.GetTextAt (l).TrimStart ().StartsWith ("///"))
- return base.KeyPress (key, keyChar, modifier);
+ if (l != null && Editor.GetTextAt (l).TrimStart ().StartsWith ("///", StringComparison.Ordinal))
+ return base.KeyPress (descriptor);
l = line.NextLine;
while (l != null && l.Length == 0)
l = l.NextLine;
- if (l != null && textEditorData.GetTextAt (l).TrimStart ().StartsWith ("///"))
- return base.KeyPress (key, keyChar, modifier);
+ if (l != null && Editor.GetTextAt (l).TrimStart ().StartsWith ("///", StringComparison.Ordinal))
+ return base.KeyPress (descriptor);
var member = GetMemberToDocument ();
if (member == null)
- return base.KeyPress (key, keyChar, modifier);
+ return base.KeyPress (descriptor);
- string documentation = GenerateDocumentation (member, textEditorData.Document.GetLineIndent (line));
+ string documentation = GenerateDocumentation (member, Editor.GetLineIndent (line));
if (string.IsNullOrEmpty (documentation))
- return base.KeyPress (key, keyChar, modifier);
+ return base.KeyPress (descriptor);
- string documentationEmpty = GenerateEmptyDocumentation (member, textEditorData.Document.GetLineIndent (line));
+ string documentationEmpty = GenerateEmptyDocumentation (member, Editor.GetLineIndent (line));
- int offset = textEditorData.Caret.Offset;
+ int offset = Editor.CaretOffset;
int insertedLength;
// Insert key (3rd undo step)
- textEditorData.Insert (offset, "/");
-
- using (var undo = textEditorData.OpenUndoGroup ()) {
- insertedLength = textEditorData.Replace (offset, 1, documentationEmpty);
+ Editor.InsertText (offset, "/");
+ using (var undo = Editor.OpenUndoGroup ()) {
+ documentationEmpty = Editor.FormatString (offset, documentationEmpty);
+ insertedLength = documentationEmpty.Length;
+ Editor.ReplaceText (offset, 1, documentationEmpty);
// important to set the caret position here for the undo step
- textEditorData.Caret.Offset = offset + insertedLength;
+ Editor.CaretOffset = offset + insertedLength;
}
- using (var undo = textEditorData.OpenUndoGroup ()) {
- insertedLength = textEditorData.Replace (offset, insertedLength, documentation);
+ using (var undo = Editor.OpenUndoGroup ()) {
+ documentation = Editor.FormatString (offset, documentation);
+ Editor.ReplaceText (offset, insertedLength, documentation);
+ insertedLength = documentation.Length;
if (SelectSummary (offset, insertedLength, documentation) == false)
- textEditorData.Caret.Offset = offset + insertedLength;
+ Editor.CaretOffset = offset + insertedLength;
}
return false;
}
@@ -136,63 +129,65 @@ namespace MonoDevelop.DocFood
const string summaryStart = "<summary>";
const string summaryEnd = "</summary>";
- int start = documentation.IndexOf (summaryStart);
- int end = documentation.IndexOf (summaryEnd);
+ int start = documentation.IndexOf (summaryStart, StringComparison.Ordinal);
+ int end = documentation.IndexOf (summaryEnd, StringComparison.Ordinal);
if (start < 0 || end < 0)
return false;
start += summaryStart.Length;
string summaryText = documentation.Substring (start, end - start).Trim (new char[] {' ', '\t', '\r', '\n', '/'});
- start = documentation.IndexOf (summaryText, start);
+ start = documentation.IndexOf (summaryText, start, StringComparison.Ordinal);
if (start < 0)
return false;
- textEditorData.Caret.Offset = offset + start;
- textEditorData.SetSelection (offset + start, offset + start + summaryText.Length);
+ Editor.CaretOffset = offset + start;
+ Editor.SetSelection (offset + start, offset + start + summaryText.Length);
return true;
}
bool IsEmptyBetweenLines (int start, int end)
{
for (int i = start + 1; i < end - 1; i++) {
- DocumentLine lineSegment = textEditorData.GetLine (i);
+ var lineSegment = Editor.GetLine (i);
if (lineSegment == null)
break;
- if (lineSegment.Length != textEditorData.GetLineIndent (lineSegment).Length)
+ if (lineSegment.Length != Editor.GetLineIndent (lineSegment).Length)
return false;
}
return true;
}
- IEntity GetMemberToDocument ()
+ ISymbol GetMemberToDocument ()
{
- var parsedDocument = Document.UpdateParseDocument ();
-
- var type = parsedDocument.GetInnermostTypeDefinition (textEditorData.Caret.Location);
- if (type == null) {
- foreach (var t in parsedDocument.TopLevelTypeDefinitions) {
- if (t.Region.BeginLine > textEditorData.Caret.Line) {
- var ctx = (parsedDocument.ParsedFile as CSharpUnresolvedFile).GetTypeResolveContext (Document.Compilation, t.Region.Begin);
- return t.Resolve (ctx).GetDefinition ();
- }
- }
+ var parsedDocument = DocumentContext.ParsedDocument;
+ if (parsedDocument == null)
return null;
- }
-
- IEntity result = null;
- foreach (var member in type.Members) {
- if (member.Region.Begin > new TextLocation (textEditorData.Caret.Line, textEditorData.Caret.Column) && (result == null || member.Region.Begin < result.Region.Begin) && IsEmptyBetweenLines (textEditorData.Caret.Line, member.Region.BeginLine)) {
- var ctx = (parsedDocument.ParsedFile as CSharpUnresolvedFile).GetTypeResolveContext (Document.Compilation, member.Region.Begin);
- result = member.CreateResolved (ctx);
+ var semanticModel = parsedDocument.GetAst<SemanticModel> ();
+ if (semanticModel == null)
+ return null;
+ var caretOffset = Editor.CaretOffset;
+ var offset = caretOffset;
+ var root = semanticModel.SyntaxTree.GetRoot ();
+ while (offset < Editor.Length) {
+ var node = root.FindNode (TextSpan.FromBounds (offset, offset));
+ if (node == null || node.GetLastToken ().SpanStart < caretOffset) {
+ offset++;
+ continue;
+ }
+ var fieldDeclarationSyntax = node as FieldDeclarationSyntax;
+ if (fieldDeclarationSyntax != null) {
+ node = fieldDeclarationSyntax.Declaration.Variables.First ();
}
- }
- foreach (var member in type.NestedTypes) {
- if (member.Region.Begin > new TextLocation (textEditorData.Caret.Line, textEditorData.Caret.Column) && (result == null || member.Region.Begin < result.Region.Begin) && IsEmptyBetweenLines (textEditorData.Caret.Line, member.Region.BeginLine)) {
- var ctx = (parsedDocument.ParsedFile as CSharpUnresolvedFile).GetTypeResolveContext (Document.Compilation, member.Region.Begin);
- result = member.Resolve (ctx).GetDefinition ();
+ var eventDeclaration = node as EventFieldDeclarationSyntax;
+ if (eventDeclaration != null) {
+ node = eventDeclaration.Declaration.Variables.First ();
}
+ var declaredSymbol = semanticModel.GetDeclaredSymbol (node);
+ if (declaredSymbol != null)
+ return declaredSymbol;
+ offset = node.FullSpan.End + 1;
}
- return result;
+ return null;
}
}
}
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocGenerator.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocGenerator.cs
index 5f3d13dbbc..22dfccc500 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocGenerator.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocGenerator.cs
@@ -28,10 +28,11 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
-using Mono.TextEditor;
using MonoDevelop.Core;
using MonoDevelop.Refactoring;
-using ICSharpCode.NRefactory.TypeSystem;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp;
+using MonoDevelop.Ide.Editor;
using MonoDevelop.Ide.TypeSystem;
namespace MonoDevelop.DocFood
@@ -47,37 +48,38 @@ namespace MonoDevelop.DocFood
}
- public DocGenerator (TextEditorData data)
+ public DocGenerator (IReadonlyTextDocument data)
{
// this.data = data;
}
- public static string GetBaseDocumentation (IEntity member)
+ public static string GetBaseDocumentation (ISymbol member)
{
- if (member.DeclaringTypeDefinition == null)
+ if (member.ContainingType == null)
return null;
- if (member is IMethod && (((IMethod)member).IsConstructor || ((IMethod)member).IsDestructor))
- return null;
- foreach (var type in member.DeclaringTypeDefinition.GetAllBaseTypeDefinitions ()) {
- if (type.Equals (member.DeclaringTypeDefinition))
- continue;
- IMember documentMember = null;
- foreach (var searchedMember in type.Members.Where (m => m.Name == member.Name)) {
- if (searchedMember.SymbolKind == member.SymbolKind && searchedMember.Name == member.Name) {
- if ((searchedMember is IParameterizedMember) && ((IParameterizedMember)searchedMember).Parameters.Count != ((IParameterizedMember)member).Parameters.Count)
- continue;
- if (searchedMember.Accessibility != member.Accessibility)
- continue;
- documentMember = searchedMember;
- break;
- }
- }
- if (documentMember != null) {
- string documentation = AmbienceService.GetDocumentation (documentMember);
- if (documentation != null)
- return documentation;
- }
- }
+ // TODO: Roslyn port!
+// if (member is IMethodSymbol && (((IMethodSymbol)member).IsConstructor || ((IMethodSymbol)member).IsDestructor))
+// return null;
+// foreach (var type in member.ContainingType.GetAllBaseTypeDefinitions ()) {
+// if (type.Equals (member.ContainingType))
+// continue;
+// IMember documentMember = null;
+// foreach (var searchedMember in type.Members.Where (m => m.Name == member.Name)) {
+// if (searchedMember.SymbolKind == member.SymbolKind && searchedMember.Name == member.Name) {
+// if ((searchedMember is IParameterizedMember) && ((IParameterizedMember)searchedMember).Parameters.Count != ((IParameterizedMember)member).Parameters.Count)
+// continue;
+// if (searchedMember.Accessibility != member.Accessibility)
+// continue;
+// documentMember = searchedMember;
+// break;
+// }
+// }
+// if (documentMember != null) {
+// string documentation = AmbienceService.GetDocumentation (documentMember);
+// if (documentation != null)
+// return documentation;
+// }
+// }
return null;
}
@@ -124,34 +126,38 @@ namespace MonoDevelop.DocFood
}
}
- public INamedElement member;
+ public ISymbol member;
// MemberVisitor visitor = new MemberVisitor ();
string currentType;
int wordCount;
- static string GetType (IEntity member)
+ static string GetType (ISymbol member)
{
- switch (member.SymbolKind) {
+ switch (member.Kind) {
case SymbolKind.Event:
return "event";
case SymbolKind.Field:
return "field";
- case SymbolKind.Constructor:
- return "constructor";
- case SymbolKind.Destructor:
- return "destructor";
- case SymbolKind.Operator:
- return "operator";
case SymbolKind.Method:
+ switch (((IMethodSymbol)member).MethodKind) {
+ case MethodKind.StaticConstructor:
+ case MethodKind.Constructor:
+ return "constructor";
+ case MethodKind.Destructor:
+ return "destructor";
+ case MethodKind.UserDefinedOperator:
+ case MethodKind.BuiltinOperator:
+ return "operator";
+ }
return "method";
-// case MemberType.Parameter:
-// return "parameter";
- case SymbolKind.Indexer:
- return "indexer";
+ case SymbolKind.Parameter:
+ return "parameter";
case SymbolKind.Property:
+ if (((IPropertySymbol)member).IsIndexer)
+ return "indexer";
return "property";
- case SymbolKind.TypeDefinition:
- switch (((ITypeDefinition)member).Kind) {
+ case SymbolKind.NamedType:
+ switch (((INamedTypeSymbol)member).TypeKind) {
case TypeKind.Class:
return "class";
case TypeKind.Delegate:
@@ -228,14 +234,12 @@ namespace MonoDevelop.DocFood
return null;
}
- static string GetName (object member)
+ static string GetName (ISymbol member)
{
- if (member is IParameter)
- return ((IParameter)member).Name;
- return ((INamedElement)member).Name;
+ return member.Name;
}
- public bool EvaluateCondition (List<KeyValuePair<string, string>> conditions, object member)
+ public bool EvaluateCondition (List<KeyValuePair<string, string>> conditions, ISymbol member)
{
foreach (var condition in conditions) {
bool result = false;
@@ -245,42 +249,38 @@ namespace MonoDevelop.DocFood
result |= val == currentType;
break;
case "modifier":
- if (member is IMember) {
- if (val.ToUpperInvariant () == "STATIC"){
- result |= ((IMember)member).IsStatic;
- } else {
- try {
- var mod = (Accessibility)Enum.Parse (typeof(Accessibility), val);
- result |= ((IMember)member).Accessibility == mod;
- } catch (Exception) {
- }
+ if (val.ToUpperInvariant () == "STATIC"){
+ result |= member.IsStatic;
+ } else {
+ try {
+ var mod = (Accessibility)Enum.Parse (typeof(Accessibility), val);
+ result |= member.DeclaredAccessibility == mod;
+ } catch (Exception) {
}
}
break;
case "paramCount":
- if (member is IParameterizedMember)
- result |= Int32.Parse (val) == ((IParameterizedMember)member).Parameters.Count;
+ var parameters = member.GetParameters ();
+ result |= Int32.Parse (val) == parameters.Length;
break;
case "parameter":
- if (!(member is IParameterizedMember))
- break;
+ parameters = member.GetParameters ();
string[] par = val.Split(':');
int idx = Int32.Parse (par[0]);
string name = par[1];
- result |= idx < ((IParameterizedMember)member).Parameters.Count && name == ((IParameterizedMember)member).Parameters[idx].Name;
+ result |= idx < parameters.Length && name == parameters[idx].Name;
break;
case "returns":
- if (member is IParameter) {
- result |= val == ((IParameter)member).Type.ToString ();
+ if (member is IParameterSymbol) {
+ result |= val == ((IParameterSymbol)member).Type.ToString ();
break;
}
- if ((member as IMember) == null)
- break;
- result |= val == ((IMember)member).ReturnType.ToString ();
+
+ result |= val == member.GetReturnType ().ToString ();
break;
case "name":
- IMethod method = member as IMethod;
- if (method != null && method.IsSynthetic) {
+ var method = member as IMethodSymbol;
+ if (method != null && method.MethodKind == MethodKind.UserDefinedOperator) {
string op = GetOperator (method.Name);
if (op != null) {
result |= val == op;
@@ -293,17 +293,18 @@ namespace MonoDevelop.DocFood
case "endsWith":
if (member == null)
break;
- result |= GetName (member).EndsWith (val);
+ result |= GetName (member).EndsWith (val, StringComparison.Ordinal);
break;
case "startsWith":
if (member == null)
break;
- result |= GetName (member).StartsWith (val);
+ result |= GetName (member).StartsWith (val, StringComparison.Ordinal);
break;
case "startsWithWord":
if (member == null)
break;
- result |= GetName (member).StartsWith (val);
+ var name2 = SeparateWords (GetName (member));
+ result |= name2.StartsWith (val + " ");
break;
case "wordCount":
result |= Int32.Parse (val) == wordCount;
@@ -319,7 +320,7 @@ namespace MonoDevelop.DocFood
}
internal string curName;
- public void GenerateDoc (IEntity member)
+ public void GenerateDoc (ISymbol member)
{
Init (member);
@@ -327,9 +328,9 @@ namespace MonoDevelop.DocFood
this.currentType = GetType (member);
DocConfig.Instance.Rules.ForEach (r => r.Run (this, member));
- if (member is IParameterizedMember) {
+ if (member is IPropertySymbol || member is IMethodSymbol) {
this.currentType = "parameter";
- foreach (var p in ((IParameterizedMember)member).Parameters) {
+ foreach (var p in member.GetParameters ()) {
curName = p.Name;
this.member = member;
SplitWords (p, p.Name);
@@ -337,8 +338,8 @@ namespace MonoDevelop.DocFood
}
}
- if (member is IMethod) {
- IMethod method = (IMethod)member;
+ if (member is IMethodSymbol) {
+ var method = (IMethodSymbol)member;
int count = 1;
foreach (var param in method.TypeParameters) {
this.currentType = "typeparam";
@@ -398,7 +399,7 @@ namespace MonoDevelop.DocFood
// }
}
- void Init (IEntity member)
+ void Init (ISymbol member)
{
if (member == null)
throw new ArgumentNullException ("member");
@@ -414,9 +415,9 @@ namespace MonoDevelop.DocFood
foreach (var macro in DocConfig.Instance.Macros) {
tags.Add (macro.Key, macro.Value);
}
- if (member.DeclaringTypeDefinition != null) {
- tags ["DeclaringType"] = "<see cref=\"" + member.DeclaringTypeDefinition.ReflectionName + "\"/>";
- switch (member.DeclaringTypeDefinition.Kind) {
+ if (member.ContainingType != null) {
+ tags ["DeclaringType"] = "<see cref=\"" + member.ContainingType.GetDocumentationCommentId () + "\"/>";
+ switch (member.ContainingType.TypeKind) {
case TypeKind.Class:
tags ["DeclaringTypeKind"] = "class";
break;
@@ -434,13 +435,14 @@ namespace MonoDevelop.DocFood
break;
}
}
- if (member is IMember)
- tags ["ReturnType"] = ((IMember)member).ReturnType != null ? "<see cref=\"" + ((IMember)member).ReturnType + "\"/>" : "";
+ var returnType = member.GetReturnType ();
+ tags ["ReturnType"] = returnType != null ? "<see cref=\"" + returnType.GetDocumentationCommentId () + "\"/>" : "";
tags ["Member"] = "<see cref=\"" + member.Name + "\"/>";
- if (member is IParameterizedMember) {
- List<string> parameterNames = new List<string> (from p in ((IParameterizedMember)member).Parameters select p.Name);
+ if (member is IPropertySymbol || member is IMethodSymbol) {
+ var parameters = member.GetParameters ();
+ var parameterNames = new List<string> (from p in parameters select p.Name);
tags ["ParameterSentence"] = string.Join (" ", parameterNames.ToArray ());
StringBuilder paramList = new StringBuilder ();
for (int i = 0; i < parameterNames.Count; i++) {
@@ -454,25 +456,25 @@ namespace MonoDevelop.DocFood
paramList.Append (parameterNames [i]);
}
tags ["ParameterList"] = paramList.ToString ();
- for (int i = 0; i < ((IParameterizedMember)member).Parameters.Count; i++) {
- tags ["Parameter" + i + ".Type"] = ((IParameterizedMember)member).Parameters [i].Type != null ? "<see cref=\"" + ((IParameterizedMember)member).Parameters [i].Type + "\"/>" : "";
- tags ["Parameter" + i + ".Name"] = "<c>" + ((IParameterizedMember)member).Parameters [i].Name + "</c>";
+ for (int i = 0; i < parameters.Length; i++) {
+ tags ["Parameter" + i + ".Type"] = parameters [i].Type != null ? "<see cref=\"" + parameters [i].Type + "\"/>" : "";
+ tags ["Parameter" + i + ".Name"] = "<c>" + parameters [i].Name + "</c>";
}
- var property = member as IProperty;
+ var property = member as IPropertySymbol;
if (property != null) {
- var hasPublicGetter = property.Getter != null && property.Getter.Accessibility != Accessibility.Private;
- var hasPublicSetter = property.Setter != null && property.Setter.Accessibility != Accessibility.Private;
+ var hasPublicGetter = property.GetMethod != null && property.GetMethod.DeclaredAccessibility != Accessibility.Private;
+ var hasPublicSetter = property.SetMethod != null && property.SetMethod.DeclaredAccessibility != Accessibility.Private;
- if (property.CanGet && property.CanSet && hasPublicGetter && hasPublicSetter) {
+ if (property.GetMethod != null && property.SetMethod != null && hasPublicGetter && hasPublicSetter) {
tags ["AccessText"] = "Gets or sets";
- } else if (property.CanGet && hasPublicGetter) {
+ } else if (property.GetMethod != null && hasPublicGetter) {
tags ["AccessText"] = "Gets";
} else if (hasPublicSetter) {
tags ["AccessText"] = "Sets";
- } else if (property.CanGet && property.CanSet) {
+ } else if (property.GetMethod != null && property.SetMethod != null) {
tags ["AccessText"] = "Gets or sets";
- } else if (property.CanGet) {
+ } else if (property.GetMethod != null) {
tags ["AccessText"] = "Gets";
} else {
tags ["AccessText"] = "Sets";
@@ -875,90 +877,112 @@ namespace MonoDevelop.DocFood
void SplitWords (object obj, string name)
{
- StringBuilder result = new StringBuilder ();
- bool wasUnderscore = false;
- for (int i = 0; i < name.Length; i++) {
- char ch = name [i];
- if (ch == '_') {
- wasUnderscore = true;
- continue;
+ if (obj is ITypeSymbol){
+ var type = (ITypeSymbol)obj;
+ if (type.TypeKind == TypeKind.Interface && name.Length > 1 && name[0] == 'I' && char.IsUpper (name[1])) {
+ name = name.Substring (1);
}
- if (char.IsUpper (ch) || wasUnderscore) {
- wasUnderscore = false;
- if (result.Length > 0)
- result.Append (" ");
- if (i + 1 < name.Length && char.IsUpper (name[i + 1])) {
- while (i + 1 < name.Length && char.IsUpper (name[i + 1])) {
- result.Append (name[i]);
- i++;
- }
- if (i + 1 < name.Length) {
- result.Append (" ");
- result.Append (char.ToLower (name[i]));
- }
- continue;
- }
- }
- wasUnderscore = false;
- result.Append (char.ToLower (ch));
}
-
- List<string> words = new List<string> (result.ToString ().Split (' '));
+
+ List<string> words = new List<string> (SeparateWords (name).Split (' '));
wordCount = words.Count;
for (int i = 0; i < words.Count; i++) {
- string lowerWord = words[i].ToLower ();
+ string lowerWord = words [i].ToLower ();
if (DocConfig.Instance.WordExpansions.ContainsKey (lowerWord)) {
- words[i] = DocConfig.Instance.WordExpansions[lowerWord];
- } else if (DocConfig.Instance.WordLists["acronyms"].Contains (words[i].ToUpper ())) {
- words[i] = words[i].ToUpper ();
+ words [i] = DocConfig.Instance.WordExpansions [lowerWord];
+ } else if (DocConfig.Instance.WordLists ["acronyms"].Contains (words [i].ToUpper ())) {
+ words [i] = words [i].ToUpper ();
}
}
- tags["First"] = words[0];
- tags["AllWords"] = string.Join (" ", words.ToArray ());
- tags["AllWordsExceptFirst"] = string.Join (" ", words.ToArray (), 1, words.Count - 1);
-
+ tags ["First"] = words [0];
+ tags ["AllWords"] = string.Join (" ", words.ToArray ());
+ tags ["AllWordsExceptFirst"] = string.Join (" ", words.ToArray (), 1, words.Count - 1);
+
int theIndex = 0;
int ofTheIndex = 0;
- if (obj is IMethod) {
+ if (obj is IMethodSymbol) {
theIndex = ofTheIndex = 1;
}
-
- if (ofTheIndex < words.Count && DocConfig.Instance.WordLists["prefixThe"].Contains (words[ofTheIndex].ToLower ()))
+
+ if (ofTheIndex < words.Count && DocConfig.Instance.WordLists ["prefixThe"].Contains (words [ofTheIndex].ToLower ()))
ofTheIndex++;
-
+
int ofIndex = words.Count - 1;
- if (ofTheIndex + 1 < words.Count && DocConfig.Instance.WordLists["ofThe"].Contains (words[ofIndex].ToLower ())) {
- string word = words[ofIndex];
+ if (ofTheIndex + 1 < words.Count && DocConfig.Instance.WordLists ["ofThe"].Contains (words [ofIndex].ToLower ())) {
+ string word = words [ofIndex];
words.RemoveAt (ofIndex);
words.Insert (ofTheIndex, "the");
words.Insert (ofTheIndex, "of");
words.Insert (ofTheIndex, word);
- }
+ }
- tags["FirstAsVerbPastParticiple"] = GetPastParticipleVerb (words[0]);
- if (obj is IMethod && words.Count > 1) {
- if (words[0].EndsWith("s")) {
- words[0] += "es";
- } else if (words[0].EndsWith("y")) {
- words[0] = words[0].Substring (0, words[0].Length - 1) + "ies";
+ tags ["FirstAsVerbPastParticiple"] = GetPastParticipleVerb (words [0]);
+ if (obj is IMethodSymbol && words.Count > 1) {
+ if (words [0].EndsWith ("s")) {
+ words [0] += "es";
+ } else if (words [0].EndsWith ("y")) {
+ words [0] = words [0].Substring (0, words [0].Length - 1) + "ies";
} else {
- words[0] += "s";
+ words [0] += "s";
}
theIndex = 1;
}
-
- tags["FirstAsVerb"] = words[0];
-
- if (theIndex < words.Count && !DocConfig.Instance.WordLists["noThe"].Contains (words[theIndex].ToLower ()))
+
+ tags ["FirstAsVerb"] = words [0];
+
+ if (theIndex < words.Count && !DocConfig.Instance.WordLists ["noThe"].Contains (words [theIndex].ToLower ()))
words.Insert (theIndex, "the");
-
- tags["Sentence"] = string.Join (" ", words.ToArray ());
+
+ tags ["Sentence"] = string.Join (" ", words.ToArray ());
}
-
+
+ static string SeparateWords (string name)
+ {
+ var result = new StringBuilder ();
+ bool wasUnderscore = false;
+ for (int i = 0; i < name.Length; i++) {
+ char ch = name [i];
+ if (ch == '_') {
+ wasUnderscore = true;
+ continue;
+ }
+ if (char.IsUpper (ch) || wasUnderscore) {
+ wasUnderscore = false;
+ if (result.Length > 0)
+ result.Append (" ");
+ if (i + 1 < name.Length && char.IsUpper (name [i + 1])) {
+ int j = i;
+ while (i < name.Length && char.IsUpper (name [i])) {
+ i++;
+ }
+ if (i >= name.Length || name [i] == '_') {
+ if (i != j)
+ result.Append (name.Substring (j, i - j).ToLower ());
+ continue;
+ }
+ if (i != j)
+ result.Append (name.Substring (j, i - j));
+ if (i + 1 < name.Length) {
+ result.Append (" ");
+ result.Append (char.ToLower (name [i]));
+ }
+ continue;
+ }
+ }
+ wasUnderscore = false;
+ result.Append (char.ToLower (ch));
+ }
+
+ return result.ToString ();
+ }
+
+
public void Set (string name, string parameterName, string doc)
{
- if (name.StartsWith ("param") && name.Length > "param".Length) {
- parameterName = ((IParameterizedMember)member).Parameters[int.Parse (name.Substring("param".Length))].Name;
+ if (name.StartsWith ("param", StringComparison.Ordinal) && name.Length > "param".Length) {
+ var parameters = member.GetParameters ();
+ var idx = int.Parse (name.Substring ("param".Length));
+ parameterName = idx < parameters.Length ? parameters [idx].Name : "unknown";
name = "param";
}
Section newSection = new Section (name);
@@ -981,7 +1005,7 @@ namespace MonoDevelop.DocFood
}
#region implemented abstract members of MonoDevelop.Projects.Text.DocGenerator
- public override string GenerateDocumentation (IMember member, string linePrefix)
+ public override string GenerateDocumentation (ISymbol member, string linePrefix)
{
return DocumentBufferHandler.GenerateDocumentation (null, member, "", linePrefix);
}
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/IfNotStatement.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/IfNotStatement.cs
index 4112858c7a..08dfc750f7 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/IfNotStatement.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/IfNotStatement.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System;
using System.Xml;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.DocFood
{
@@ -32,7 +33,7 @@ namespace MonoDevelop.DocFood
{
public const string XmlTag = "IfNot";
- public override void Run (DocGenerator generator, object member)
+ public override void Run (DocGenerator generator, ISymbol member)
{
if (!generator.EvaluateCondition (Attributes, member))
Children.ForEach (child => child.Run (generator, member));
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/IfStatement.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/IfStatement.cs
index d9c30a53df..022242e8b9 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/IfStatement.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/IfStatement.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System;
using System.Xml;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.DocFood
{
@@ -32,7 +33,7 @@ namespace MonoDevelop.DocFood
{
public const string XmlTag = "If";
- public override void Run (DocGenerator generator, object member)
+ public override void Run (DocGenerator generator, ISymbol member)
{
if (generator.EvaluateCondition (Attributes, member))
Children.ForEach (child => child.Run (generator, member));
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/MemberVisitor.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/MemberVisitor.cs
index 74afb6872e..d3e79c295a 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/MemberVisitor.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/MemberVisitor.cs
@@ -24,22 +24,21 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using ICSharpCode.NRefactory.CSharp;
using System.Collections.Generic;
namespace MonoDevelop.DocFood
{
- class MemberVisitor : DepthFirstAstVisitor<object, object>
- {
- public List<AstType> Exceptions = new List<AstType> ();
-
- public override object VisitThrowStatement (ThrowStatement throwStatement, object data)
- {
- var oce = throwStatement.Expression as ObjectCreateExpression;
- if (oce != null)
- Exceptions.Add (oce.Type);
- return null;
- }
- }
+// class MemberVisitor : DepthFirstAstVisitor<object, object>
+// {
+// public List<AstType> Exceptions = new List<AstType> ();
+//
+// public override object VisitThrowStatement (ThrowStatement throwStatement, object data)
+// {
+// var oce = throwStatement.Expression as ObjectCreateExpression;
+// if (oce != null)
+// Exceptions.Add (oce.Type);
+// return null;
+// }
+// }
}
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/Node.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/Node.cs
index cb67dfea17..0897c0e43b 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/Node.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/Node.cs
@@ -27,6 +27,7 @@ using System;
using System.Collections.Generic;
using System.Xml;
using MonoDevelop.Core;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.DocFood
{
@@ -39,12 +40,12 @@ namespace MonoDevelop.DocFood
public List<Node> Children = new List<Node> ();
- public Node ()
+ protected Node ()
{
Attributes = new List<KeyValuePair<string, string>> ();
}
- public abstract void Run (DocGenerator generator, object member);
+ public abstract void Run (DocGenerator generator, ISymbol member);
public void SetAttribute (string name, string value)
{
@@ -63,7 +64,7 @@ namespace MonoDevelop.DocFood
public static List<Node> ReadNodeList (XmlReader reader, string tag)
{
- List<Node> result = new List<Node> ();
+ var result = new List<Node> ();
XmlReadHelper.ReadList (reader, tag, delegate () {
switch (reader.LocalName) {
case Section.XmlTag:
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/Section.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/Section.cs
index 75ef11856f..0fbf9c19f4 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/Section.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/Section.cs
@@ -29,6 +29,7 @@ using System.Collections.Generic;
using System.Xml;
using MonoDevelop.Core;
using System.Linq;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.DocFood
{
@@ -54,7 +55,7 @@ namespace MonoDevelop.DocFood
this.Name = name;
}
- public override void Run (DocGenerator generator, object member)
+ public override void Run (DocGenerator generator, ISymbol member)
{
string str = StringParserService.Parse (Documentation, generator.tags).Trim ();
if (!char.IsUpper (str[0]))
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/SwitchStatement.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/SwitchStatement.cs
index 3170e35215..e50140d17d 100644
--- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/SwitchStatement.cs
+++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/SwitchStatement.cs
@@ -27,6 +27,9 @@ using System;
using System.Collections.Generic;
using System.Xml;
using MonoDevelop.Core;
+using Microsoft.CodeAnalysis;
+
+
namespace MonoDevelop.DocFood
{
class SwitchStatement : Node
@@ -43,7 +46,7 @@ namespace MonoDevelop.DocFood
CaseSections = new List<Node> ();
}
- public override void Run (DocGenerator generator, object member)
+ public override void Run (DocGenerator generator, ISymbol member)
{
if (!generator.EvaluateCondition (Attributes, member))
return;
@@ -73,7 +76,7 @@ namespace MonoDevelop.DocFood
public static SwitchStatement Read (XmlReader reader)
{
- SwitchStatement result = new SwitchStatement ();
+ var result = new SwitchStatement ();
if (reader.MoveToFirstAttribute ()) {
do {
result.SetAttribute (reader.LocalName, reader.Value);
@@ -94,11 +97,11 @@ namespace MonoDevelop.DocFood
return result;
}
- public class CaseStatement : Node
+ class CaseStatement : Node
{
public const string XmlTag = "Case";
- public override void Run (DocGenerator generator, object member)
+ public override void Run (DocGenerator generator, ISymbol member)
{
if (generator.EvaluateCondition (Attributes, member))
Children.ForEach (child => child.Run (generator, member));
diff --git a/main/src/addins/MonoDevelop.DocFood/gtk-gui/generated.cs b/main/src/addins/MonoDevelop.DocFood/gtk-gui/generated.cs
index 75935e2e55..c75fb5f90c 100644
--- a/main/src/addins/MonoDevelop.DocFood/gtk-gui/generated.cs
+++ b/main/src/addins/MonoDevelop.DocFood/gtk-gui/generated.cs
@@ -1,3 +1,4 @@
+#pragma warning disable 436
// This file has been generated by the GUI designer. Do not modify.
namespace Stetic
diff --git a/main/src/addins/MonoDevelop.Gettext/ChangeLog b/main/src/addins/MonoDevelop.Gettext/ChangeLog
deleted file mode 100644
index 77c63490fd..0000000000
--- a/main/src/addins/MonoDevelop.Gettext/ChangeLog
+++ /dev/null
@@ -1,1512 +0,0 @@
-2010-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext/Catalog.cs: Track api changes.
-
-2010-07-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Replaced
- custom workerthread with
- system.compontentmodel.backgroundworker.
-
-2010-06-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext.addin.xml: Fix icon size names.
-
-2010-06-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/TranslationProject.xpt.xml: Don't include the
- assembly name in the project type name since it doesn't work
- well when running on .NET
-
-2010-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext/GettextFeatureWidget.cs:
- * MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs:
- Fix incorrect use of ShowCustomDialog/RunCustomDialog.
-
-2010-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs:
- Use ShowCustomDialog (which destroys the dialog when done)
- instead of RunCustomDialog (which doesn't).
-
-2010-05-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext/GettextFeatureWidget.cs:
- * MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs:
- More dialog placing.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/CatalogEditorView.cs: ViewContent
- widgets are now destroyed by the workspace window.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: call destroy
- instead of dispose.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Gettext.addin.xml: Bumped MD version.
-
-2010-03-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Use the new
- status bar model.
-
- * gtk-gui/objects.xml: Flush.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Commands.cs:
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * gtk-gui/objects.xml:
- * MonoDevelop.Gettext.csproj:
- * MonoDevelop.Gettext.addin.xml:
- * MonoDevelop.Gettext/Catalog.cs:
- * MonoDevelop.Gettext/TranslationProject.cs:
- * MonoDevelop.Gettext/GettextFeatureWidget.cs:
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs:
- * gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs:
- * MonoDevelop.Gettext/TranslationProjectOptionsDialog.cs:
- * MonoDevelop.Gettext.NodeBuilders/TranslationNodeBuilder.cs:
- * MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs:
- * MonoDevelop.Gettext.NodeBuilders/ProjectFileNodeBuilderExtension.cs:
- Merged MD.Projects into MD.Core, and MD.Projects.Gui,
- MD.Core.Gui and MD.Components into MD.Ide.
-
-2010-03-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Alexander
- Cherniuk <ts33kr@gmail.com>: Make the font inside the editor
- to be configurable, rather that being hardcoded.
-
-2010-03-09 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs:
- * gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs: Improved
- gettext addin gui.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Track api
- changes.
-
-2010-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.addin.xml:
- * templates/TranslationProject.xpt.xml:
- * MonoDevelop.Gettext/TranslationService.cs: Removed useless
- startup handler.
-
-2010-02-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Track API
- changes for lazy loading images.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext/GettextFeature.cs: Track api changes.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs:
- * gtk-gui/MonoDevelop.Gettext.GettextFeatureWidget.cs:
- * gtk-gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs:
- * gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs:
- * gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs:
- Flush.
-
-2010-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext.Editor/GettextEditorDisplayBinding.cs:
- Track DisplayBinding API.
-
-2009-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext/Translation.cs:
- * MonoDevelop.Gettext/TranslationProject.cs: Introduced the
- ConfigurationSelector class to all methods that previously
- took a configuration name as string. This eliminates the
- ambiguity between solution configuration names and project
- configuration names.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Gettext.addin.xml: Bump MD version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * MonoDevelop.Gettext.csproj:
- * gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs:
- * gtk-gui/MonoDevelop.Gettext.GettextFeatureWidget.cs:
- * gtk-gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs:
- * gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs:
- * gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs:
- Flush.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Gettext.addin.xml: Bump MD version.
-
-2009-10-01 David Makovský <yakeen@sannyas-on.net>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: fixed
- translatable string typo
-
-2009-09-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Optimized
- gettext editor.
-
-2009-09-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Force reset of
- scrollbars when changing text.
-
-2009-09-09 Christian Hergert <chris@dronelabs.com>
-
- * MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs:
- * MonoDevelop.Gettext/GettextFeatureWidget.cs: Make dialogs transient
- for the root window.
-
-2009-09-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Fixed progress
- bar status message.
-
-2009-09-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Show file icon
- in found in list.
-
-2009-08-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.addin.xml: Don't use the text editor
- display binding id as reference for registering the gettext
- view. Use DefaultDisplayBinding instead. Removed unused
- supportedextensions attribute.
-
-2009-08-28 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs:
- * gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs:
- * gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs:
- Fixed Bug 481221 - Translation editor doesn't show
- whitespaces & Bug 481222 - Original translatable string is
- vertically centered.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: fixed
- tooltips.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.csproj: Updated dependencies. We now
- depend on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext/Catalog.cs: Handled same bug in
- different method.
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext/Catalog.cs: Handled possible exception
- (I think I've encountered a mono bug).
-
-2009-08-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Fix build
- error.
-
-2009-08-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.Editor\POEditorWidget.cs: Track api
- changes.
-
-2009-08-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext/Translation.cs:
- * MonoDevelop.Gettext/TranslationProject.cs: Quote filenames
- when invoking msmerge and msgfmt. Fixes bug #529200.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs:
- * gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs:
- Flush.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs:
- Use the new api from removing projects from a solution.
-
-2009-06-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext/TranslationProject.cs: Use the new
- DesktopService instead of PlatformService.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext\Translation.cs:
- * MonoDevelop.Gettext\TranslationProject.cs: Use the new
- FilePath class for handling file and directory paths.
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.addin.xml: Ensure that the display
- binding is inserted before the text editor
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/GettextEditorDisplayBinding.cs:
- Track API changes.
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/GettextEditorDisplayBinding.cs:
- Track API changes.
-
-2009-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Added rule for
- '_' in translation, but not original string.
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Added new
- translation rule - translation should end with ' ' when
- original string ends with ' '.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.Gettext.csproj: don't require specific
- gtk-sharp version.
-
-2009-04-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.addin.xml:
- * MonoDevelop.Gettext/TranslationProjectOptionsDialog.cs:
- Removed icon service.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Gettext.addin.xml: Bump MD version.
-
-2009-03-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext.csproj: Don't local-copy project refs.
-
-2009-03-13 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs:
- Making some strings not translatable.
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.csproj: Moved text editor to core
-
-2009-03-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs:
- * gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs:
- * MonoDevelop.Gettext.Editor/CatalogEditorView.cs: Added
- undo/redo support to the gettext editor.
-
-2009-03-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: fixed "Bug
- 480125 - Gettext editor's filter is buggy".
-
-2009-03-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Removed some
- debug messages.
-
-2009-03-06 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * icons/silk_error.png:
- * icons/silk_accept.png:
- * MonoDevelop.Gettext.csproj:
- * icons/silk_exclamation.png:
- * MonoDevelop.Gettext.addin.xml:
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs:
- * gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs: Added silk
- icons to replace the old fuzzy/missing/valid icons. (But I'm
- still unsure what to take)
-
-2009-03-06 Mike Krüger <mkrueger@novell.com>
-
- * icons/translation-fuzzy-16.png:
- * icons/translation-valid-16.png:
- * icons/translation-missing-16.png: Worked on icons.
-
-2009-03-06 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * gtk-gui/objects.xml:
- * gtk-gui/generated.cs:
- * MonoDevelop.Gettext.csproj:
- * MonoDevelop.Gettext.addin.xml:
- * icons/translation-valid-16.png:
- * icons/translation-fuzzy-16.png:
- * icons/translation-missing-16.png:
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs:
- * gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs: Now using
- custom icons for fuzzy/missing/valid translations instead of
- abusing system icons.
-
-2009-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Fixed gettext
- options menu.
-
-2009-03-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: fixed "Bug
- 481217 - Translation editor is unusable with dark themes".
-
-2009-02-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Translation
- fixes. Patch from Kriván Bálint.
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.csproj: Flush.
-
-2009-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.addin.xml:
- * MonoDevelop.Gettext/PropertyProvider.cs:
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Worked on
- propertygrid localization.
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * gtk-gui/objects.xml:
- * MonoDevelop.Gettext.csproj:
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs:
- * MonoDevelop.Gettext.Editor/CatalogEditorView.cs: Fixed "Bug
- 479376 - remove extra error check in Gettext addin".
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Changed
- override Destroy --> override OnDestroyed.
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/objects.xml:
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs:
- * MonoDevelop.Gettext.Editor/CatalogEditorView.cs: Worked on
- ressource de-allocation.
-
-2009-02-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.addin.xml:
- * MonoDevelop.Gettext/Translation.cs:
- * MonoDevelop.Gettext.NodeBuilders/TranslationNodeBuilder.cs:
- * MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs:
- Track merge of the project pad context menu.
-
-2009-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: fixed "Bug
- 478442 - Really hard to edit PO files because of slowness"
-
-2009-02-19 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/objects.xml:
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: fixed "Bug
- 477062 - Sorting on status column of translation view causes
- hang".
-
-2009-02-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext/Catalog.cs: Don't write newlines into
- empty (untranslated) messages, as this breaks msgfmt. Add a
- log message instead of silently swallowing an exception.
-
-2009-02-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext/GettextTool.cs: Handle general solution
- files, not just mds.
-
-2009-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext.csproj: Exorcise more unwanted local
- copy.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext.csproj: Flush MD's removal of newline at
- end of file that was introduced by manually editing with
- gedit.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext.csproj: Remove invalid ApplicationIcon
- value that broke the build in VS.
-
-2009-02-06 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/objects.xml:
-
- * MonoDevelop.Gettext.Editor/CatalogEditorView.cs: fixed
- catalog editor view
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.mdp:
- * MonoDevelop.Gettext.csproj: Migrated to MSBuild file format.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Gettext.addin.xml: Bump MD version.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs:
- * gtk-gui/MonoDevelop.Gettext.GettextFeatureWidget.cs:
- * gtk-gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs:
- * gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs:
- *
- gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs:
- Flush.
-
-2009-01-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext/Catalog.cs: Rename UserInformation to
- AuthorInformation, and change other strings correspondingly.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext.mdp: Flush project format changes.
-
-2009-01-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext/Catalog.cs:
- * MonoDevelop.Gettext/CatalogParser.cs:
- * MonoDevelop.Gettext/TranslationProject.cs:
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs:
- * MonoDevelop.Gettext.Editor/CatalogEditorView.cs:
- * MonoDevelop.Gettext.Editor/GettextEditorDisplayBinding.cs: Use the
- UserInformation API, which requires a parent SolutionItem.
-
-2008-12-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/objects.xml: TooltipWindow has been moved to MD.Components.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.mdp: All projects now require fx 3.5.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.mdp: Don't require a specific version of
- Mono.Addins.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * AssemblyInfo.cs: Add AssemblyInfo.cs files that are autogenerated from
- the addin manifests.
-
-2008-11-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext/RegexFileScanner.cs: Remove debug writelines.
-
-2008-11-24 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: set labels on the
- valid/missing/fuzzy filter buttons. Use a MenuButton to ensure
- proper menu placement on the options button. Fixes #367274.
-
-2008-11-24 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.Gettext.Editor/CatalogHeadersWidget.cs: some null
- guarding for a couple strings.
-
-2008-11-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * icons/locale.svg:
- * MonoDevelop.Gettext.mdp:
- * MonoDevelop.Gettext.addin.xml: Removed the locale.svg file.
- PixbufLoader does not support svg in all platforms.
-
-2008-11-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Fix build dependencies.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.addin.xml: Bump MD version.
-
-2008-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext.addin.xml,
- MonoDevelop.Gettext.NodeBuilders/ProjectFileNodeBuilderExtension.cs,
- MonoDevelop.Gettext.mdp, Commands.cs, Makefile.am: Added quick
- property for enabling translation of files. Supports multi-select.
-
-2008-09-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/CatalogEditorView.cs,
- MonoDevelop.Gettext.Editor/POEditorWidget.cs: fixed some minor
- issues in the po editor.
-
-2008-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.mdp: Updated projects.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Gettext.GettextFeatureWidget.cs,
- gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs,
- gtk-gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs,
- gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs:
- Updated generated code.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.NodeBuilders/TranslationNodeBuilder.cs,
- MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs:
- Moved the extensible tree view to its own directory.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext/TranslationProject.cs: Don't set the dirty flag
- when a translation is added while loading the project.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.mdp,
- gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs,
- gtk-gui/gui.stetic: Updated.
- * MonoDevelop.Gettext/TranslationProject.cs,
- MonoDevelop.Gettext/Translation.cs: Properly check if a translation
- needs to be built.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * GettextProjectBinding.cs, MonoDevelop.Gettext/Translation.cs,
- MonoDevelop.Gettext/TranslationProject.cs: Moved serialization
- engine to MonoDevelop.Core. Use new syntax for specifying attribute
- scope.
-
-2008-06-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext/TranslationProjectOptionsDialog.cs: fixed bug in
- options dialog.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.addin.xml: Bump MD version.
-
-2008-06-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs, gtk-gui/gui.stetic: Use
- the OnDestroyed event instead of Dispose, since with the latest
- changes in gtk#, Dispose is not called anymore when a widget is
- destroyed.
-
-2008-06-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext/TranslationProject.cs: Track api changes.
-
-2008-05-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/GettextEditorDisplayBinding.cs,
- MonoDevelop.Gettext.Editor/CatalogEditorView.cs: Fixed bug (gettext
- addin didn't work).
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext/TranslationProject.cs: Replaced
- ICompilerResult/DefaultCompilerResult/CompilerResults by a new
- BuildResult class, which has owner information at error level, so
- it is possible to know which project generated an error when
- building a solution. Updated Task and TaskService to use the new
- owner information.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.NodeBuilders/TranslationNodeBuilder.cs,
- MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs,
- MonoDevelop.Gettext.mdp,
- MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs,
- gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs,
- gtk-gui/gui.stetic, Makefile.am,
- MonoDevelop.Gettext/MakefileHandler.cs,
- MonoDevelop.Gettext/TranslationService.cs,
- MonoDevelop.Gettext/TranslationProjectOptionsDialog.cs,
- MonoDevelop.Gettext/GettextTool.cs,
- MonoDevelop.Gettext/TranslationProject.cs,
- MonoDevelop.Gettext/Translation.cs,
- MonoDevelop.Gettext/GettextFeature.cs,
- MonoDevelop.Gettext/GettextFeatureWidget.cs,
- MonoDevelop.Gettext/TranslationCollection.cs: New project model
- changes.
-
-2008-05-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext.addin.xml: Set "isText" attribute on the mimetype
- definitions.
-
-2008-04-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.addin.xml: Use the new mime type extension to
- register new file types.
-
-2008-03-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: POEditor has a new rule
- (checks for {0}, {1}, {*} mismatch). Rules are now threaded.
-
-2008-03-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/CatalogEditorView.cs,
- MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs,
- gtk-gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs,
- gtk-gui/gui.stetic: Worked on gettext addin.
-
-2008-03-13 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic: Made the language chooser dialog gnome compliant.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.NodeBuilders/TranslationNodeBuilder.cs,
- MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs,
- MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs,
- gtk-gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs: Worked on
- gnome hig compliant alerts.
-
-2008-03-02 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Workaraound a bug in mono
- 1.2.4 where anonymous delegates ignore usings.
-
-2008-03-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Filter is not preserved
- anymore (this was more annoying than helpful).
-
-2008-03-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs: Added some filter
- options.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.addin.xml,
- MonoDevelop.Gettext.NodeBuilders/TranslationNodeBuilder.cs,
- MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs,
- Commands.cs, MonoDevelop.Gettext/TranslationProject.cs: Added command to
- update a single translation.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.addin.xml: Added many shortcuts.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs: Fixed bug in po editor.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- MonoDevelop.Gettext/Catalog.cs: Not longer using Thread.Abort
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
-
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: filter updates more nicely.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs: Refactored status bar.
-
-2008-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Untranslated <--> translated
- update now works in entry list.
-
-2008-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext/CatalogParser.cs: Fixed plural message bug.
-
-2008-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Columns are now resizeable.
-
-2008-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs: Improved ui: original
- strings are now selectable.Fixed ui glitch: original string in the
- entrylist is now in gettext format too.
-
-2008-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- MonoDevelop.Gettext/StringEscaping.cs,
- MonoDevelop.Gettext/PluralForms.cs: Now using the gettext format for
- text input instead of the plain text (otherwise the translation of some
- strings is impossible and I assume that the translators are used to the
- \n, \r, \t escape sequences).
-
-2008-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/CatalogEditorView.cs,
- MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- MonoDevelop.Gettext.Editor/CatalogHeadersWidget.cs,
- gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs,
- MonoDevelop.Gettext/CatalogParser.cs,
- MonoDevelop.Gettext/CatalogEntry.cs,
- MonoDevelop.Gettext/CatalogHeaders.cs, MonoDevelop.Gettext/Catalog.cs:
- Refactored gettext addin, fixed bug in headers widget.
-
-2008-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/GettextEditorDisplayBinding.cs,
- MonoDevelop.Gettext.Editor/CatalogEditorView.cs,
- MonoDevelop.Gettext.Editor/CatalogEditor.cs,
- MonoDevelop.Gettext.Editor/CatalogHeadersWidget.cs,
- gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs,
- gtk-gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs,
- MonoDevelop.Gettext/CatalogHeaders.cs, MonoDevelop.Gettext/Catalog.cs:
- Fixed bug in header editor. Added feature to ensure that no line end is
- forgotton or accidentally added.
-
-2008-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Made the update operation a
- lot faster.
-
-2008-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext/StringEscaping.cs: Fixed bug in FromGettextFormat.
-
-2008-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.addin.xml: Added shortcuts to menu items.
-
-2008-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext/CatalogParser.cs: Fixed multiline bug.
-
-2008-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.addin.xml,
- MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs,
- MonoDevelop.Gettext/StringEscaping.cs,
- MonoDevelop.Gettext/CatalogDeletedEntry.cs,
- MonoDevelop.Gettext/RegexFileScanner.cs,
- MonoDevelop.Gettext/CatalogParser.cs,
- MonoDevelop.Gettext/CatalogEntry.cs, MonoDevelop.Gettext/Catalog.cs:
- Fixed some gettext issues (at least for monodevelop/german it works now)
-
-2008-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: gettext pad now updates the
- changes in the translated message list.
-
-2008-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs: Added
- some tooltips for the description button
-
-2008-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.GettextFeatureWidget.cs,
- gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs,
- gtk-gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs,
- gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs,
- MonoDevelop.Gettext/StringEscaping.cs: Added filter & sort functions to
- the gettext editor.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.mdp, gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs,
- MonoDevelop.Gettext/TranslationService.cs: Removed reference to
- gnome-vfs-sharp and fixed 2 warnings.
-
-2008-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.NodeBuilders/TranslationNodeBuilder.cs,
- MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs:
- Handle the delete key in TreeViewPad, so it will work event if the
- shortcut is not defined.
-
-2008-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext/TranslationProject.cs: Include .po files in the list
- of exportable files of the project. Fixes bug #362567.
-
-2008-01-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext.addin.xml, MonoDevelop.Gettext/RegexFileScanner.cs,
- MonoDevelop.Gettext.ExtensionNodes/IncludeExtensionNode.cs,
- MonoDevelop.Gettext.ExtensionNodes/RegexScannerExtensionNode.cs,
- MonoDevelop.Gettext.ExtensionNodes/XmlRegexScannerExtensionNode.cs:
- Rework unescaping of C# and XML translatable strings.
- * MonoDevelop.Gettext.mdp, Makefile.am: Updated.
- * MonoDevelop.Gettext/StringEscaping.cs: Helper class for
- escaping/unescaping text.
- * MonoDevelop.Gettext/Catalog.cs: Rework escaping of strings.
-
- Fixes "Bug 355967 - Translation issues with regex toolkit descriptions".
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.addin.xml: Update MD version.
-
-2008-01-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/Makefile.am.template: CLEANFILES must be set before including
- Makefile.include.
-
-2008-01-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext/RegexFileScanner.cs: Remove debug code.
-
-2008-01-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext/TranslationProject.cs: Performance improvement.
-
-2008-01-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs: Make
- string translatable.
- * MonoDevelop.Gettext/TranslationProject.cs: Wait for child process's output
- before writing completion message.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/TranslationProject.xpt.xml: Make template categories
- translatable.
-
-2008-01-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext.addin.xml: Handle simple concatenated strings in C#.
- Allows line breaks when specifying long strings.
- * MonoDevelop.Gettext/RegexFileScanner.cs: Apply transforms to plural
- strings as well. Add the capability to specify regex options.
- * MonoDevelop.Gettext.ExtensionNodes/TransformExtensionNode.cs,
- MonoDevelop.Gettext.ExtensionNodes/ExcludeRegex.cs,
- MonoDevelop.Gettext.ExtensionNodes/IncludeExtensionNode.cs,
- MonoDevelop.Gettext.ExtensionNodes/RegexScannerExtensionNode.cs,
- MonoDevelop.Gettext.ExtensionNodes/XmlRegexScannerExtensionNode.cs: Add
- the capability to specify regex options.
-
-2008-01-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext.addin.xml: Plural string regexes needed to capture
- first string. Partial fix for "Bug 351017 - Gettext addin is extracting
- some translation messages wrongly".
-
-2007-12-31 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * gtk-gui/gui.stetic,
- * gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs: Fixed typo in initialization string.
-
-2007-12-19 Ankit Jain <jankit@novell.com>
-
- * MakefileHandler.cs: Set top_srcdir and all_target correctly.
- * TranslationProject.cs: Set the default value for RelPath
- to empty string instead of null.
- Remove AbsPath.
- * MonoDevelop.Gettext/TranslationProjectOptionsDialog: Update.
- * templates/Makefile.template: Make top_srcdir and all_target template
- variables to allow setting from MakefileHandler.
-
-2007-12-18 Ankit Jain <jankit@novell.com>
-
- Fix bug #349419.
- * templates/Makefile.template: Remove EXTRA_DIST, it gets generated.
- * MakefileHandler.cs: Honor DESTDIR for INSTALL_DIR.
- Based on patch by Wade Berrier.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.mdp: Updated project files. The order of extended
- properties won't change anymore.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext/TranslationProject.cs: Moved PlatformService to
- MD.Core.Gui. Removed old FileIconService class, which is now implemented
- in PlatformService.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext/TranslationProject.cs: API cleanup.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Updated.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.addin.xml: Bump add-in versions.
-
-2007-12-06 Geoff Norton <gnorton@novell.com>
-
- * MonoDevelop.Gettext/GetTextTool.cs:
- * MonoDevelop.Gettext/TranslationProject.cs: Do not call Gnome.Vfs directly;
- utilize the PlatformService to get mime information.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.mdp, Makefile.am: Directory reorganization.
-
-2007-12-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext/Catalog.cs: Fix build.
-
-2007-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext/Translation.cs: Added properties for getting the Po
- and Out files.
- * Makefile.am, MonoDevelop.Gettext.addin.xml,
- MonoDevelop.Gettext.ExtensionNodes/ExcludeRegex.cs,
- MonoDevelop.Gettext.ExtensionNodes/IncludeExtensionNode.cs,
- MonoDevelop.Gettext.ExtensionNodes/RegexScannerExtensionNode.cs,
- MonoDevelop.Gettext.ExtensionNodes/TransformExtensionNode.cs,
- MonoDevelop.Gettext.ExtensionNodes/XmlRegexScannerExtensionNode.cs,
- MonoDevelop.Gettext.mdp, MonoDevelop.Gettext/Catalog.cs,
- MonoDevelop.Gettext/IFileScanner.cs,
- MonoDevelop.Gettext/RegexFileScanner.cs,
- MonoDevelop.Gettext/TranslationProject.cs,
- MonoDevelop.Gettext/TranslationProjectOptionsDialog.cs,
- MonoDevelop.Gettext/TranslationService.cs,
- templates/TranslationProject.xpt.xml: Added an extension point for
- specifying regular expressions to use for scanning files. Fixed some old
- regexes. Moved some properties from TranslationProjectConfiguration to
- TranslationProject, since it is not really useful to handle that info
- per-config.
- * MonoDevelop.Gettext/MakefileHandler.cs, templates/Makefile.template: Set
- the correct install dir depending on the project output type.
-
-2007-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext/GettextFeature.cs,
- MonoDevelop.Gettext/GettextFeatureWidget.cs: Show the gettext feature
- when creating new Packaging projects.
-
-2007-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs: Run the
- translation update in a background thread.
- * MonoDevelop.Gettext/GettextTool.cs: New command line tool for updating
- translation projects.
- * gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs,
- gtk-gui/MonoDevelop.Gettext.GettextFeatureWidget.cs,
- gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs,
- gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs:
- Updated.
-
-2007-11-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs,
- Makefile.am, MonoDevelop.Gettext.mdp,
- MonoDevelop.Gettext/TranslationService.cs,
- MonoDevelop.Gettext/TranslationProject.cs,
- MonoDevelop.Gettext/Catalog.cs: Now message strings are extracted using
- regexes instead of xgettext.
-
-2007-11-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext/TranslationProject.cs: Process output is now written
- to the monitor.Log.
-
-2007-11-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext/TranslationProject.cs: gettext addin now only scans
- code files for translations.
-
-2007-11-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs,
- MonoDevelop.Gettext/TranslationProject.cs,
- MonoDevelop.Gettext/Catalog.cs: Added some gui update code.
-
-2007-11-16 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.Gettext.GettextFeatureWidget.cs,
- gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs,
- gtk-gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs,
- gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs,
- MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs,
- MonoDevelop.Gettext/TranslationService.cs,
- MonoDevelop.Gettext/TranslationProject.cs,
- MonoDevelop.Gettext/CatalogParser.cs: The gettext addin now uses
- xgettext and msgmerge command line tools instead of custom routines.
- Fixed some bugs in the po editor and catalog parser.
-
-2007-11-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs,
- gtk-gui/gui.stetic: Updated.
- * MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs: Moved
- code for updating translation to TranslationProject.
- * MonoDevelop.Gettext/TranslationService.cs,
- MonoDevelop.Gettext/TranslationProject.cs,
- MonoDevelop.Gettext/Catalog.cs,
- MonoDevelop.Gettext.Editor/CatalogEditor.cs: Use progress monitors to
- report errors.
- * MonoDevelop.Gettext/TranslationProjectOptionsDialog.cs: Create a new
- configuration if none exist.
-
-2007-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Gettext/TranslationService.cs, MonoDevelop.Gettext/Catalog.cs:
- Track LoggingService API changes.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.addin.xml: Bump MD version.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext/TranslationProject.cs: Set correct target directory
- path.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Gettext.GettextFeatureWidget.cs,
- gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs,
- gtk-gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs,
- gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs: Updated
- project icons. Use the base project icon with an overlay to show the
- type.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.addin.xml: Track changes in the Icon extension node.
-
-2007-10-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext/CatalogParser.cs, MonoDevelop.Gettext/Catalog.cs:
- Fixed some parsing/generationg errors in the catalog.
-
-2007-10-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.Editor/CatalogEditor.cs: Destroy the view widget when
- the view is disposed.
-
-2007-10-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/GtkSpell.cs,
- MonoDevelop.Gettext/TranslationService.cs,
- MonoDevelop.Gettext/TranslationProject.cs,
- MonoDevelop.Gettext/CatalogEntry.cs, MonoDevelop.Gettext/Catalog.cs:
- Speed optimized the update process.
-
-2007-10-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.addin.xml, MonoDevelop.Gettext.mdp, Makefile.am,
- MonoDevelop.Gettext/TranslationProjectOptionsDialog.cs,
- icons/md-gettext-project_16.png, icons/gettext-overlay-32.png,
- icons/gettext-overlay-16.png, icons/md-gettext-project_22.png,
- icons/md-gettext-project_32.png, templates/TranslationProject.xpt.xml:
- Updated project icons. Use the base project icon with an overlay to show
- the type.
-
-2007-10-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext/TranslationService.cs,
- MonoDevelop.Gettext/TranslationProject.cs,
- MonoDevelop.Gettext/CatalogEntry.cs, MonoDevelop.Gettext/Catalog.cs:
- Fixed re opened "Bug 335326 - Gettext addin breaks zh_CN.po".
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Gettext.GettextFeatureWidget.cs, gtk-gui/gui.stetic,
- MonoDevelop.Gettext/GettextFeature.cs: Cosmetic changes in the feature
- widget. Don't show scrollbars, just grow the list as new items are
- added.
- * gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs: Cosmetic
- fix.
- * MonoDevelop.Gettext.mdp: Updated.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.mdp: Project file names updated by change in MD path
- functions.
-
-2007-10-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext/TranslationService.cs,
- MonoDevelop.Gettext/TranslationProject.cs,
- MonoDevelop.Gettext/CatalogEntry.cs: Optimized the speed a bit.
-
-2007-10-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic, MonoDevelop.Gettext.mdp: Updated.
- * gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs: Some
- cosmetic fixes.
- * MonoDevelop.Gettext/TranslationProjectOptionsDialog.cs: Show all cell
- renderers in a single column. Fixes some alignment issues in the tree.
-
-2007-10-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs,
- MonoDevelop.Gettext/TranslationService.cs: Fixed "Bug 335335 - Gettext
- addin: updating the translations of MD takes forever".
-
-2007-10-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs:
- Updating translations is now done async.
-
-2007-10-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext/CatalogParser.cs, MonoDevelop.Gettext/Catalog.cs:
- Fixed "Bug 335326 - Gettext addin breaks zh_CN.po".
-
-2007-10-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.NodeBuilders/TranslationNodeBuilder.cs,
- MonoDevelop.Gettext/TranslationProject.cs: Applied changes that were
- neccassary for to the new FileService.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.addin.xml: Bump MD version.
-
-2007-09-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Gettext.GettextFeatureWidget.cs, gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs,
- gtk-gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs,
- gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs:
- Regenerated GUI files.
-
-2007-09-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext/TranslationProject.cs: Fixed 82693: Rebuild not
- working.
-
-2007-09-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext/TranslationProject.cs: Fixed 82693: Rebuild not
- working.
-
-2007-08-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic, MonoDevelop.Gettext.addin.xml,
- MonoDevelop.Gettext.mdp, Makefile.am,
- MonoDevelop.Gettext/MakefileHandler.cs, templates/Makefile.am.template,
- templates/Makefile.template: Added support for makefile generation.
-
-2007-08-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.addin.xml: Changed addin path.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext/GettextFeatureWidget.cs: Workaround to mcs bug.
-
-2007-08-09 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.Gettext.GettextFeatureWidget.cs,
- gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs,
- MonoDevelop.Gettext/GettextFeature.cs,
- MonoDevelop.Gettext/GettextFeatureWidget.cs: Fixed 82340: Gettext
- addin: translation project creation should be available as a
- 'project feature'.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.addin.xml: Removed the CommandService class.
- Everything is done directly with CommandManager. Moved all extension
- node types to MD.Components.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs,
- gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs,
- gtk-gui/gui.stetic, MonoDevelop.Gettext.addin.xml,
- MonoDevelop.Gettext.mdp, Makefile.am: Reorganized the extension point
- hierarchy. Embedded all add-in manifests as resources.
-
-2007-08-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.addin.xml,
- MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs,
- MonoDevelop.Gettext/PropertyProvider.cs,
- MonoDevelop.Gettext/TranslationProject.cs: Fixed bug 82334: Gettext
- addin: can't choose which files to translate. It's now possible to
- choose, if a file can be translated in the file properties.
-
-2007-08-09 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs:
- Fixed Bug 82341: Gettext addin: Language selection combo too big.
-
-2007-08-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs,
- gtk-gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs,
- gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs:
- Fixed 82337: Gettext addin: usability issues in the PO editor
-
-2007-08-08 Mike Krüger <mkrueger@novell.com>
- * MonoDevelop.Gettext/TranslationProjectOptionsDialog.cs: Removed
- some debug code.
-
-2007-08-08 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs,
- MonoDevelop.Gettext/TranslationProjectOptionsDialog.cs: Fixed
- 82336:Gettext addin: Translation project options dialog not HIG
- compliant.
-
-2007-08-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs,
- MonoDevelop.Gettext/TranslationProjectOptionsDialog.cs,
- MonoDevelop.Gettext/TranslationProject.cs: Fixed 82335: Gettext
- addin: can't choose which projects to translate.
-
-2007-08-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: added bugfix from
- Rafael Teixeira. Plural descriptions are now taken from
- Catalog.PluralFormsDescription.
-
-2007-08-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs: Editor now supports
- n plural forms instead of 2.
-
-2007-08-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/GtkSpell.cs,
- MonoDevelop.Gettext.Editor/POEditorWidget.cs: Added spellchecking
- to original string (hardcoded currently to "en" - maybe shoul add
- an option to the translationproject for this ?). Fixed spellcheck
- updating bug.
-
-2007-08-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/GtkSpell.cs,
- MonoDevelop.Gettext.Editor/POEditorWidget.cs: Fixed gtk spell
- support.
-
-2007-07-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.mdp, Makefile.am: Makefile fixes.
-
-2007-07-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.Gettext.Translator.LanguageChooserDialog.cs,
- gtk-gui/MonoDevelop.Gettext.Editor.CatalogHeadersWidget.cs: Add
- missing files.
-
-2007-07-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: Workaround for bug in
- the compiler. Looks like gmcs gets confused when using anon
- delegates in a partial class, and it will fail unless classes are
- referenced using the full name.
- * MonoDevelop.Gettext.mdp, Makefile.am: Added makefile.
-
-2007-07-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/CatalogEditor.cs,
- MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- MonoDevelop.Gettext/TranslationProject.cs,
- MonoDevelop.Gettext/Catalog.cs: added remove entry function to
- delete unused translation strings.
-
-2007-07-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs:
- updated some translation strings.
-
-2007-07-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs, Commands.cs,
- MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs,
- MonoDevelop.Gettext/TranslationService.cs,
- MonoDevelop.Gettext/Catalog.cs: Added manual udate command, missing
- messages are now recognized.
-
-2007-07-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext/TranslationProject.cs: Worked on gettext
- deployment.
-
-2007-07-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext/TranslationService.cs,
- MonoDevelop.Gettext/TranslationProject.cs: Improved update code.
-
-2007-07-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs,
- MonoDevelop.Gettext/TranslationService.cs,
- MonoDevelop.Gettext/TranslationProject.cs: New Translations are now
- containing a list of all translation strings.
-
-2007-07-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.NodeBuilders/TranslationNodeBuilder.cs,
- MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs,
- MonoDevelop.Gettext/TranslationProject.cs: Translations can now be
- removed.
-
-2007-07-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/CatalogEntry.cs,
- MonoDevelop.Gettext.Editor/CatalogEditor.cs,
- MonoDevelop.Gettext.Editor/CatalogDeletedEntry.cs,
- MonoDevelop.Gettext.Editor/GtkSpell.cs,
- MonoDevelop.Gettext.Editor/CatalogEditorWidget.cs,
- MonoDevelop.Gettext.Editor/CatalogHeaders.cs,
- MonoDevelop.Gettext.Editor/PluralForms.cs,
- MonoDevelop.Gettext.Editor/CatalogParser.cs,
- MonoDevelop.Gettext.Editor/CatalogEntryEditorWidget.cs,
- MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- MonoDevelop.Gettext.Editor/Catalog.cs,
- MonoDevelop.Gettext.Translator/TranslationFileDescriptionTemplate.cs,
- MonoDevelop.Gettext.Translator/PropertyProvider.cs,
- MonoDevelop.Gettext.Translator/TranslationProjectInfo.cs,
- MonoDevelop.Gettext.Translator/TranslatorCoreService.cs,
- MonoDevelop.Gettext.Translator/TranslatorInfo.cs,
- MonoDevelop.Gettext.Translator/TranslationProject.cs, Commands.cs,
- MonoDevelop.Gettext.addin.xml, gtk-gui/gui.stetic,
- MonoDevelop.Gettext.mdp, MonoDevelop.Gettext/CatalogEntry.cs,
- MonoDevelop.Gettext/CatalogDeletedEntry.cs,
- MonoDevelop.Gettext/CatalogHeaders.cs,
- MonoDevelop.Gettext/PluralForms.cs,
- MonoDevelop.Gettext/CatalogParser.cs,
- MonoDevelop.Gettext/IsoCodes.cs, MonoDevelop.Gettext/Catalog.cs,
- IsoCodes.cs: Restructured/Refactored the project.
-
-2007-07-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/POEditorWidget.cs: changed formatting.
-
-2007-07-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.Editor/CatalogEntry.cs,
- MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- MonoDevelop.Gettext/TranslationService.cs,
- MonoDevelop.Gettext/TranslationProject.cs: Improved reference
- update code. Fixed comment handling and some translation editor
- behavior issues.
-
-2007-07-18 Mike Krüger <mike@icsharpcode.net>
-
- * MonoDevelop.Gettext.Editor/CatalogEntry.cs,
- MonoDevelop.Gettext.Editor/CatalogEditor.cs,
- MonoDevelop.Gettext.Editor/CatalogDeletedEntry.cs,
- MonoDevelop.Gettext.Editor/CatalogHeaders.cs,
- MonoDevelop.Gettext.Editor/CatalogParser.cs,
- MonoDevelop.Gettext.Editor/POEditorWidget.cs,
- MonoDevelop.Gettext.Editor/Catalog.cs,
- gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs,
- MonoDevelop.Gettext/TranslationService.cs,
- MonoDevelop.Gettext/TranslationProject.cs: Worked on gettext addin.
- New (stetic based) editor, some fixes.
-
-2007-07-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext/TranslationService.cs,
- MonoDevelop.Gettext/TranslationProject.cs: Worked on translation
- addin.
-
-2007-07-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.addin.xml,
- gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs,
- MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs,
- MonoDevelop.Gettext/TranslationService.cs,
- MonoDevelop.Gettext/TranslationProjectOptionsDialog.cs,
- MonoDevelop.Gettext/TranslationProject.cs,
- templates/TranslationProject.xpt.xml: Worked on translation project
- options.
-
-2007-07-11 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.Gettext.TranslationProjectOptionsDialog.cs,
- MonoDevelop.Gettext/TranslationProjectOptionsDialog.cs,
- MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationProject.cs,
- MonoDevelop.Gettext/TranslationService.cs,
- MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs: Fixed
- little bug. Added options dialog.
-
-2007-07-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.addin.xml: worked on translation addin.
-
-2007-07-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Gettext.addin.xml: Worked on translation.
-
-2007-07-06 Mike Krüger <mkrueger@novell.com>
-
- * .: Adding the localization addin. Already worked on the translation
- system.
-
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/CatalogEditorView.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/CatalogEditorView.cs
index a8b406d6fd..d33b7ec7be 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/CatalogEditorView.cs
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/CatalogEditorView.cs
@@ -32,13 +32,15 @@ using System;
using System.Collections.Generic;
using Gtk;
using Gdk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Content;
+using System.Threading.Tasks;
namespace MonoDevelop.Gettext.Editor
{
- class CatalogEditorView : AbstractViewContent, IUndoHandler
+ class CatalogEditorView : ViewContent, IUndoHandler
{
Catalog catalog;
POEditorWidget poEditorWidget;
@@ -52,8 +54,9 @@ namespace MonoDevelop.Gettext.Editor
};
}
- public override void Load (string fileName)
+ public override Task Load (FileOpenInformation fileOpenInformation)
{
+ var fileName = fileOpenInformation.FileName;
// using (IProgressMonitor mon = IdeApp.Workbench.ProgressMonitors.GetLoadProgressMonitor (true)) {
catalog.Load (null, fileName);
// }
@@ -63,21 +66,17 @@ namespace MonoDevelop.Gettext.Editor
this.ContentName = fileName;
this.IsDirty = false;
+ return Task.FromResult (true);
}
- public override void Save (string fileName)
+ public override Task Save (FileSaveInformation fileSaveInformation)
{
- OnBeforeSave (EventArgs.Empty);
- catalog.Save (fileName);
- ContentName = fileName;
- IsDirty = false;
+ catalog.Save (fileSaveInformation.FileName);
+ ContentName = fileSaveInformation.FileName;
+ IsDirty = false;
+ return Task.FromResult (true);
}
- public override void Save ()
- {
- Save (this.ContentName);
- }
-
#region IUndoHandler implementation
void IUndoHandler.Undo ()
{
@@ -107,7 +106,7 @@ namespace MonoDevelop.Gettext.Editor
}
#endregion
- public override Widget Control
+ public override Control Control
{
get { return poEditorWidget; }
}
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/GettextEditorDisplayBinding.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/GettextEditorDisplayBinding.cs
index 9a7d402c95..0f9d629cfd 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/GettextEditorDisplayBinding.cs
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/GettextEditorDisplayBinding.cs
@@ -47,9 +47,9 @@ namespace MonoDevelop.Gettext
return filePath.IsNotNull && filePath.HasExtension (".po");
}
- public IViewContent CreateContent (FilePath filePath, string mimeType, Project project)
+ public ViewContent CreateContent (FilePath filePath, string mimeType, Project project)
{
- foreach (TranslationProject tp in IdeApp.Workspace.GetAllSolutionItems<TranslationProject> ())
+ foreach (TranslationProject tp in IdeApp.Workspace.GetAllItems<TranslationProject> ())
if (tp.BaseDirectory == Path.GetDirectoryName (filePath))
return new Editor.CatalogEditorView (tp, filePath);
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs
index 007bacc01c..3063b00c27 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs
@@ -38,12 +38,14 @@ using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Tasks;
using MonoDevelop.Gettext.Editor;
-using Mono.TextEditor;
using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.Ide;
using System.ComponentModel;
using System.Threading;
using MonoDevelop.Components;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Gui;
namespace MonoDevelop.Gettext
{
@@ -55,9 +57,8 @@ namespace MonoDevelop.Gettext
ListStore foundInStore;
Catalog catalog;
string poFileName;
- Mono.TextEditor.TextEditorOptions options = new Mono.TextEditor.TextEditorOptions ();
- Mono.TextEditor.TextEditor texteditorOriginal = new Mono.TextEditor.TextEditor ();
- Mono.TextEditor.TextEditor texteditorPlural = new Mono.TextEditor.TextEditor ();
+ TextEditor texteditorOriginal = TextEditorFactory.CreateNewEditor ();
+ TextEditor texteditorPlural = TextEditorFactory.CreateNewEditor ();
static List<POEditorWidget> widgets = new List<POEditorWidget> ();
@@ -186,7 +187,7 @@ namespace MonoDevelop.Gettext
lineNr = 1 + int.Parse (line);
} catch {
}
- IdeApp.Workbench.OpenDocument (file, lineNr, 1);
+ IdeApp.Workbench.OpenDocument (new FileOpenInformation (file, project, lineNr, 1, OpenDocumentOptions.Default));
};
this.notebookTranslated.RemovePage (0);
this.searchEntryFilter.Entry.Text = "";
@@ -239,22 +240,26 @@ namespace MonoDevelop.Gettext
widgets.Add (this);
checkbuttonWhiteSpaces.Toggled += CheckbuttonWhiteSpacesToggled;
- options.ShowLineNumberMargin = false;
- options.ShowFoldMargin = false;
- options.ShowIconMargin = false;
- options.ColorScheme = IdeApp.Preferences.ColorScheme;
- options.FontName = PropertyService.Get<string> ("FontName");
-
+
this.scrolledwindowOriginal.Child = this.texteditorOriginal;
this.scrolledwindowPlural.Child = this.texteditorPlural;
- this.texteditorOriginal.Show ();
- this.texteditorPlural.Show ();
- texteditorOriginal.ModifyBase (Gtk.StateType.Normal, Style.Base (Gtk.StateType.Insensitive));
- texteditorPlural.ModifyBase (Gtk.StateType.Normal, Style.Base (Gtk.StateType.Insensitive));
- this.texteditorOriginal.Options = options;
- this.texteditorPlural.Options = options;
- this.texteditorOriginal.Document.ReadOnly = true;
- this.texteditorPlural.Document.ReadOnly = true;
+ this.scrolledwindowOriginal.Child.Show ();
+ this.scrolledwindowPlural.Child.Show ();
+ scrolledwindowOriginal.Child.ModifyBase (Gtk.StateType.Normal, Style.Base (Gtk.StateType.Insensitive));
+ scrolledwindowPlural.Child.ModifyBase (Gtk.StateType.Normal, Style.Base (Gtk.StateType.Insensitive));
+ this.texteditorOriginal.Options = DefaultSourceEditorOptions.PlainEditor;
+ this.texteditorPlural.Options = DefaultSourceEditorOptions.PlainEditor;
+ this.texteditorOriginal.IsReadOnly = true;
+ this.texteditorPlural.IsReadOnly = true;
+ toolbarPages.ModifyBg (StateType.Normal, Styles.POEditor.TabBarBackgroundColor);
+
+ MonoDevelop.Ide.Gui.Styles.Changed += HandleStylesChanged;
+ }
+
+ void HandleStylesChanged (object sender, EventArgs e)
+ {
+ UpdateFromCatalog ();
+ toolbarPages.ModifyBg (StateType.Normal, Styles.POEditor.TabBarBackgroundColor);
}
void HandleCellRendFuzzyToggled (object sender, ToggledArgs args)
@@ -299,13 +304,6 @@ namespace MonoDevelop.Gettext
void CheckbuttonWhiteSpacesToggled (object sender, EventArgs e)
{
- texteditorOriginal.QueueDraw ();
- texteditorPlural.QueueDraw ();
- for (int i = this.notebookTranslated.NPages - 1; i >= 0; i--) {
- Mono.TextEditor.TextEditor view = GetTextView (i);
- if (view != null)
- view.QueueDraw ();
- }
}
#region Options
@@ -328,25 +326,25 @@ namespace MonoDevelop.Gettext
searchIn = PropertyService.Get ("GettetAddin.Search.SearchIn", SearchIn.Both);
}
- static bool IsCaseSensitive {
- get {
- return isCaseSensitive;
+ static bool IsCaseSensitive {
+ get {
+ return isCaseSensitive;
}
set {
PropertyService.Set ("GettetAddin.Search.IsCaseSensitive", value);
isCaseSensitive = value;
- }
+ }
}
- static bool IsWholeWordOnly {
- get {
- return isWholeWordOnly;
- }
+ static bool IsWholeWordOnly {
+ get {
+ return isWholeWordOnly;
+ }
set {
PropertyService.Set ("GettetAddin.Search.IsWholeWordOnly", value);
isWholeWordOnly = value;
- }
- }
+ }
+ }
static bool RegexSearch {
get {
@@ -467,13 +465,10 @@ namespace MonoDevelop.Gettext
this.Catalog = newCatalog;
UpdateTasks ();
}
-
- Mono.TextEditor.TextEditor GetTextView (int index)
+ List<TextEditor> notebookTranslatedEditors = new List<TextEditor> ();
+ TextEditor GetTextView (int index)
{
- ScrolledWindow window = this.notebookTranslated.GetNthPage (index) as ScrolledWindow;
- if (window != null)
- return window.Child as Mono.TextEditor.TextEditor;
- return null;
+ return notebookTranslatedEditors[index];
}
void ClearTextview ()
@@ -485,24 +480,23 @@ namespace MonoDevelop.Gettext
void AddTextview (int index)
{
ScrolledWindow window = new ScrolledWindow ();
- Mono.TextEditor.TextEditor textView = new Mono.TextEditor.TextEditor ();
+ var textView = TextEditorFactory.CreateNewEditor ();
window.Child = textView;
- textView.Options = options;
- textView.Document.TextReplaced += delegate {
+ textView.TextChanged += delegate {
if (this.isUpdating)
return;
try {
if (this.currentEntry != null) {
- string escapedText = textView.Document.Text;
+ string escapedText = textView.Text;
string oldText = this.currentEntry.GetTranslation (index);
this.currentEntry.SetTranslation (escapedText, index);
AddChange (this.currentEntry, oldText, escapedText, index);
}
IdeApp.Workbench.StatusBar.ShowReady ();
- textView.ModifyBase (Gtk.StateType.Normal, Style.Base (Gtk.StateType.Normal));
+ window.Child.ModifyBase (Gtk.StateType.Normal, Style.Base (Gtk.StateType.Normal));
} catch (System.Exception e) {
IdeApp.Workbench.StatusBar.ShowError (e.Message);
- textView.ModifyBase (Gtk.StateType.Normal, errorColor);
+ window.Child.ModifyBase (Gtk.StateType.Normal, errorColor);
}
treeviewEntries.QueueDraw ();
UpdateProgressBar ();
@@ -513,6 +507,7 @@ namespace MonoDevelop.Gettext
label.Text = this.Catalog.PluralFormsDescriptions [index];
window.ShowAll ();
this.notebookTranslated.AppendPage (window, label);
+ notebookTranslatedEditors.Add (textView);
}
void ShowPopup (EventButton evt)
@@ -601,14 +596,15 @@ namespace MonoDevelop.Gettext
void RemoveTextViewsFrom (int index)
{
for (int i = this.notebookTranslated.NPages - 1; i >= index; i--) {
- Mono.TextEditor.TextEditor view = GetTextView (i);
+ var view = GetTextView (i);
if (view == null)
continue;
// if (gtkSpellSet.ContainsKey (view)) {
// GtkSpell.Detach (view);
// gtkSpellSet.Remove (view);
// }
- this.notebookTranslated.RemovePage (i);
+ notebookTranslated.RemovePage (i);
+ notebookTranslatedEditors.RemoveAt (i);
}
}
@@ -617,9 +613,9 @@ namespace MonoDevelop.Gettext
this.isUpdating = true;
try {
currentEntry = entry;
- this.texteditorOriginal.Caret.Location = new DocumentLocation (1, 1);
- this.texteditorOriginal.Document.Text = entry != null ? entry.String : "";
- this.texteditorOriginal.VAdjustment.Value = this.texteditorOriginal.HAdjustment.Value = 0;
+ this.texteditorOriginal.CaretLocation = new DocumentLocation (1, 1);
+ this.texteditorOriginal.Text = entry != null ? entry.String : "";
+ //this.texteditorOriginal.VAdjustment.Value = this.texteditorOriginal.HAdjustment.Value = 0;
// if (GtkSpell.IsSupported && !gtkSpellSet.ContainsKey (this.textviewOriginal)) {
// GtkSpell.Attach (this.textviewOriginal, "en");
@@ -630,9 +626,9 @@ namespace MonoDevelop.Gettext
this.notebookTranslated.ShowTabs = entry != null && entry.HasPlural;
if (entry != null && entry.HasPlural) {
- this.texteditorPlural.Caret.Location = new DocumentLocation (1, 1);
- this.texteditorPlural.Document.Text = entry.PluralString;
- this.texteditorPlural.VAdjustment.Value = this.texteditorPlural.HAdjustment.Value = 0;
+ this.texteditorPlural.CaretLocation = new DocumentLocation (1, 1);
+ this.texteditorPlural.Text = entry.PluralString;
+ //this.texteditorPlural.VAdjustment.Value = this.texteditorPlural.HAdjustment.Value = 0;
// if (GtkSpell.IsSupported && !gtkSpellSet.ContainsKey (this.textviewOriginalPlural)) {
// GtkSpell.Attach (this.textviewOriginalPlural, "en");
// this.gtkSpellSet[this.textviewOriginalPlural] = true;
@@ -649,14 +645,12 @@ namespace MonoDevelop.Gettext
}
for (int i = 0; i < entry.NumberOfTranslations; i++) {
- Mono.TextEditor.TextEditor textView = GetTextView (i);
+ var textView = GetTextView (i);
if (textView == null)
continue;
textView.ClearSelection ();
- textView.Document.Text = entry != null ? entry.GetTranslation (i) : "";
- textView.Caret.Offset = textView.Document.Text.Length;
- textView.VAdjustment.Value = textView.HAdjustment.Value = 0;
- textView.Document.CommitUpdateAll ();
+ textView.Text = entry != null ? entry.GetTranslation (i) : "";
+ EditActions.MoveCaretToDocumentEnd (textView);
}
foreach (string reference in entry.References) {
@@ -703,26 +697,21 @@ namespace MonoDevelop.Gettext
return entry.IsFuzzy ? iconFuzzy : entry.IsTranslated ? iconValid : iconMissing;
}
- static string iconFuzzy = "error-16.png";// "md-translation-fuzzy";
- static string iconValid = "done-16.png";//"md-translation-valid";
- static string iconMissing = "warning-16.png";//"md-translation-missing";
-
-// static Color translated = new Color (255, 255, 255);
- static Color untranslated = new Color (234, 232, 227);
- static Color fuzzy = new Color (237, 226, 187);
- static Color missing = new Color (237, 167, 167);
+ static string iconFuzzy = "md-error";// "md-translation-fuzzy";
+ static string iconValid = "md-done";//"md-translation-valid";
+ static string iconMissing = "md-warning";//"md-translation-missing";
Color GetRowColorForEntry (CatalogEntry entry)
{
if (entry.References.Length == 0)
- return missing;
- return entry.IsFuzzy ? fuzzy : entry.IsTranslated ? Style.Base (StateType.Normal) : untranslated;
+ return Styles.POEditor.EntryMissingBackgroundColor;
+ return entry.IsFuzzy ? Styles.POEditor.EntryFuzzyBackgroundColor : entry.IsTranslated ? Style.Base (StateType.Normal) : Styles.POEditor.EntryUntranslatedBackgroundColor;
}
Color GetForeColorForEntry (CatalogEntry entry)
{
if (entry.References.Length == 0)
- return missing;
+ return Styles.POEditor.EntryMissingBackgroundColor;
return entry.IsFuzzy ? Style.Black : entry.IsTranslated ? Style.Text (StateType.Normal) : Style.Black;
}
@@ -810,7 +799,7 @@ namespace MonoDevelop.Gettext
}
string filter = "";
- Regex regex = new Regex ("");
+ System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex ("");
void UpdateFromCatalog ()
{
@@ -822,14 +811,16 @@ namespace MonoDevelop.Gettext
RegexOptions options = RegexOptions.Compiled;
if (!IsCaseSensitive)
options |= RegexOptions.IgnoreCase;
- regex = new Regex (filter, options);
+ regex = new System.Text.RegularExpressions.Regex (filter, options);
} catch (Exception e) {
IdeApp.Workbench.StatusBar.ShowError (e.Message);
this.searchEntryFilter.Entry.ModifyBase (StateType.Normal, errorColor);
+ this.searchEntryFilter.QueueDraw ();
return;
}
}
this.searchEntryFilter.Entry.ModifyBase (StateType.Normal, Style.Base (StateType.Normal));
+ this.searchEntryFilter.QueueDraw ();
int found = 0;
ListStore newStore = new ListStore (typeof(CatalogEntry));
@@ -891,7 +882,7 @@ namespace MonoDevelop.Gettext
TreeIter iter;
if (store.GetIterFirst (out iter)) {
do {
- CatalogEntry curEntry = store.GetValue (iter, 4) as CatalogEntry;
+ CatalogEntry curEntry = store.GetValue (iter, 0) as CatalogEntry;
if (entry == curEntry) {
this.treeviewEntries.Selection.SelectIter (iter);
TreePath iterPath = store.GetPath (iter);
@@ -958,6 +949,7 @@ namespace MonoDevelop.Gettext
protected override void OnDestroyed ()
{
+ MonoDevelop.Ide.Gui.Styles.Changed -= HandleStylesChanged;
StopTaskWorkerThread ();
if (store != null) {
@@ -976,7 +968,7 @@ namespace MonoDevelop.Gettext
base.OnDestroyed ();
}
#region Tasks
- public class TranslationTask : Task
+ public class TranslationTask : TaskListEntry
{
POEditorWidget widget;
CatalogEntry entry;
@@ -1000,7 +992,7 @@ namespace MonoDevelop.Gettext
TaskService.Errors.ClearByOwner (this);
}
- static bool CompareTasks (List<Task> list1, List<Task> list2)
+ static bool CompareTasks (List<TaskListEntry> list1, List<TaskListEntry> list2)
{
if (list1.Count != list2.Count)
return false;
@@ -1110,7 +1102,7 @@ namespace MonoDevelop.Gettext
{
public override bool EntryFails (CatalogEntry entry)
{
- foreach (System.Text.RegularExpressions.Match match in Regex.Matches (entry.String, @"\{.\}", RegexOptions.None)) {
+ foreach (System.Text.RegularExpressions.Match match in System.Text.RegularExpressions.Regex.Matches (entry.String, @"\{.\}", RegexOptions.None)) {
if (!entry.GetTranslation (0).Contains (match.Value))
return true;
}
@@ -1119,7 +1111,7 @@ namespace MonoDevelop.Gettext
public override string FailReason (CatalogEntry entry)
{
- foreach (System.Text.RegularExpressions.Match match in Regex.Matches (entry.String, @"\{.\}", RegexOptions.None)) {
+ foreach (System.Text.RegularExpressions.Match match in System.Text.RegularExpressions.Regex.Matches (entry.String, @"\{.\}", RegexOptions.None)) {
if (!entry.GetTranslation (0).Contains (match.Value))
return GettextCatalog.GetString ("Original string '{0}' contains '{1}', translation doesn't.", entry.String, match.Value);
}
@@ -1128,7 +1120,7 @@ namespace MonoDevelop.Gettext
}
- List<Task> currentTasks = new List<Task> ();
+ List<TaskListEntry> currentTasks = new List<TaskListEntry> ();
BackgroundWorker updateTaskThread = null;
@@ -1140,7 +1132,7 @@ namespace MonoDevelop.Gettext
return;
}
- List<Task> tasks = new List<Task> ();
+ List<TaskListEntry> tasks = new List<TaskListEntry> ();
try {
foreach (CatalogEntryRule rule in rules) {
foreach (CatalogEntry entry in catalog) {
@@ -1223,9 +1215,9 @@ namespace MonoDevelop.Gettext
{
widget.inUndoOperation = true;
widget.SelectEntry (Entry);
- Mono.TextEditor.TextEditor textView = widget.GetTextView (Index);
+ var textView = widget.GetTextView (Index);
if (textView != null)
- textView.Document.Text = OldText;
+ textView.Text = OldText;
widget.inUndoOperation = false;
}
@@ -1233,9 +1225,9 @@ namespace MonoDevelop.Gettext
{
widget.inUndoOperation = true;
widget.SelectEntry (Entry);
- Mono.TextEditor.TextEditor textView = widget.GetTextView (Index);
+ var textView = widget.GetTextView (Index);
if (textView != null)
- textView.Document.Text = Text;
+ textView.Text = Text;
widget.inUndoOperation = false;
}
}
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/Styles.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/Styles.cs
new file mode 100644
index 0000000000..60d41c71b3
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/Styles.cs
@@ -0,0 +1,66 @@
+//
+// Styles.cs
+//
+// Author:
+// Vsevolod Kukol <sevo@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using MonoDevelop.Ide;
+using Xwt.Drawing;
+
+namespace MonoDevelop.Gettext
+{
+ public static class Styles
+ {
+ public static POEditorStyle POEditor { get; internal set; }
+
+ public class POEditorStyle
+ {
+ public Gdk.Color EntryUntranslatedBackgroundColor { get; internal set; }
+ public Gdk.Color EntryMissingBackgroundColor { get; internal set; }
+ public Gdk.Color EntryFuzzyBackgroundColor { get; internal set; }
+ public Gdk.Color TabBarBackgroundColor { get; internal set; }
+ }
+
+ static Styles ()
+ {
+ LoadStyles ();
+ MonoDevelop.Ide.Gui.Styles.Changed += (o, e) => LoadStyles ();
+ }
+
+ public static void LoadStyles ()
+ {
+ POEditor = new POEditorStyle ();
+ if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light) {
+ POEditor.EntryUntranslatedBackgroundColor = new Gdk.Color (234, 232, 227);
+ POEditor.EntryMissingBackgroundColor = new Gdk.Color (237, 226, 187);
+ POEditor.EntryFuzzyBackgroundColor = new Gdk.Color (255, 199, 186);
+ POEditor.TabBarBackgroundColor = new Gdk.Color (241, 241, 241);
+ } else {
+ POEditor.EntryUntranslatedBackgroundColor = new Gdk.Color (255, 238, 194);
+ POEditor.EntryMissingBackgroundColor = new Gdk.Color (255, 0, 255); // TODO: VV
+ POEditor.EntryFuzzyBackgroundColor = new Gdk.Color (255, 195, 183);
+ POEditor.TabBarBackgroundColor = new Gdk.Color (51, 51, 51);
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.NodeBuilders/ProjectFileNodeBuilderExtension.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.NodeBuilders/ProjectFileNodeBuilderExtension.cs
index 4d051544cb..510eb1e294 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.NodeBuilders/ProjectFileNodeBuilderExtension.cs
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.NodeBuilders/ProjectFileNodeBuilderExtension.cs
@@ -60,27 +60,21 @@ namespace MonoDevelop.Gettext.NodeBuilders
bool allChecked = true;
foreach (ITreeNavigator node in CurrentNodes) {
ProjectFile file = (ProjectFile) node.DataItem;
- object prop = file.ExtendedProperties [scanForTranslationsProperty];
- bool val = prop == null? true : (bool) prop;
- if (!val) {
+ if (!file.Metadata.GetValue (scanForTranslationsProperty, true)) {
allChecked = false;
break;
}
}
- Set<SolutionEntityItem> projects = new Set<SolutionEntityItem> ();
+ Set<SolutionItem> projects = new Set<SolutionItem> ();
foreach (ITreeNavigator node in CurrentNodes) {
ProjectFile file = (ProjectFile) node.DataItem;
projects.Add (file.Project);
- if (allChecked) {
- file.ExtendedProperties [scanForTranslationsProperty] = false;
- } else {
- file.ExtendedProperties.Remove (scanForTranslationsProperty);
- }
+ file.Metadata.SetValue (scanForTranslationsProperty, !allChecked, true);
}
- IdeApp.ProjectOperations.Save (projects);
+ IdeApp.ProjectOperations.SaveAsync (projects);
}
[CommandUpdateHandler (Commands.ScanForTranslations)]
@@ -88,9 +82,7 @@ namespace MonoDevelop.Gettext.NodeBuilders
{
foreach (ITreeNavigator node in CurrentNodes) {
ProjectFile file = (ProjectFile) node.DataItem;
- object prop = file.ExtendedProperties [scanForTranslationsProperty];
- bool val = prop == null? true : (bool) prop;
- if (val) {
+ if (file.Metadata.GetValue (scanForTranslationsProperty, true)) {
cinfo.Checked = true;
} else if (cinfo.Checked) {
cinfo.CheckedInconsistent = true;
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.NodeBuilders/TranslationNodeBuilder.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.NodeBuilders/TranslationNodeBuilder.cs
index 029efd19d4..b8bfda44ad 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.NodeBuilders/TranslationNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.NodeBuilders/TranslationNodeBuilder.cs
@@ -33,6 +33,7 @@ using MonoDevelop.Core;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.Ide;
+using System.Threading.Tasks;
namespace MonoDevelop.Gettext.NodeBuilders
{
@@ -80,7 +81,7 @@ namespace MonoDevelop.Gettext.NodeBuilders
} else {
nodeInfo.Label = "(" + translation.IsoCode + ")";
}
- nodeInfo.Icon = Context.GetIcon ("md-gettext-locale");
+ nodeInfo.Icon = Context.GetIcon ("md-po-file");
}
class TranslationNodeCommandHandler : NodeCommandHandler
@@ -91,7 +92,7 @@ namespace MonoDevelop.Gettext.NodeBuilders
Translation translation = CurrentNode.DataItem as Translation;
if (project == null || translation == null)
return;
- IdeApp.Workbench.OpenDocument (Path.Combine (project.BaseDirectory, translation.FileName));
+ IdeApp.Workbench.OpenDocument (Path.Combine (project.BaseDirectory, translation.FileName), project);
}
public override void DeleteItem ()
@@ -111,7 +112,7 @@ namespace MonoDevelop.Gettext.NodeBuilders
}
project.RemoveTranslation (translation.IsoCode);
- IdeApp.ProjectOperations.Save (project);
+ IdeApp.ProjectOperations.SaveAsync (project);
}
}
@@ -125,14 +126,10 @@ namespace MonoDevelop.Gettext.NodeBuilders
UpdateTranslations (project, translation);
}
- static IAsyncOperation currentUpdateTranslationOperation = MonoDevelop.Core.ProgressMonitoring.NullAsyncOperation.Success;
+ static Task currentUpdateTranslationOperation = Task.FromResult (0);
- void UpdateTranslationsAsync (object ob)
+ void UpdateTranslationsAsync (ProgressMonitor monitor, TranslationProject project, Translation translation)
{
- object[] data = (object[]) ob;
- IProgressMonitor monitor = (IProgressMonitor) data [0];
- TranslationProject project = (TranslationProject) data [1];
- Translation translation = (Translation) data [2];
try {
project.UpdateTranslations (monitor, translation);
Gtk.Application.Invoke (delegate {
@@ -151,9 +148,8 @@ namespace MonoDevelop.Gettext.NodeBuilders
{
if (currentUpdateTranslationOperation != null && !currentUpdateTranslationOperation.IsCompleted)
return;
- IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetBuildProgressMonitor ();
- currentUpdateTranslationOperation = monitor.AsyncOperation;
- DispatchService.BackgroundDispatch (new StatefulMessageHandler (UpdateTranslationsAsync), new object[] {monitor, project, translation});
+ ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetBuildProgressMonitor ();
+ currentUpdateTranslationOperation = Task.Run (() => UpdateTranslationsAsync (monitor, project, translation));
}
}
}
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs
index 172b831ef5..687dd4558d 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.NodeBuilders/TranslationProjectNodeBuilder.cs
@@ -32,6 +32,7 @@ using MonoDevelop.Core;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.Ide;
+using System.Threading.Tasks;
namespace MonoDevelop.Gettext.NodeBuilders
{
@@ -92,9 +93,8 @@ namespace MonoDevelop.Gettext.NodeBuilders
TranslationProject project = dataObject as TranslationProject;
if (project == null)
return;
-
- foreach (Translation translation in project.Translations)
- builder.AddChild (translation);
+
+ builder.AddChildren (project.Translations);
}
public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
@@ -121,9 +121,10 @@ namespace MonoDevelop.Gettext.NodeBuilders
TranslationProject project = CurrentNode.DataItem as TranslationProject;
if (project == null)
return;
+
using (var dlg = new TranslationProjectOptionsDialog (project))
MessageService.ShowCustomDialog (dlg);
- IdeApp.Workspace.Save ();
+ IdeApp.Workspace.SaveAsync ();
}
[CommandUpdateHandler (Commands.AddTranslation)]
@@ -145,7 +146,7 @@ namespace MonoDevelop.Gettext.NodeBuilders
if (MessageService.RunCustomDialog (chooser) == (int)ResponseType.Ok) {
string language = chooser.Language + (chooser.HasCountry ? "_" + chooser.Country : "");
- using (IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetOutputProgressMonitor (monitorTitle, "md-package", true, true)) {
+ using (ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetOutputProgressMonitor (monitorTitle, "md-package", true, true)) {
project.AddNewTranslation (language, monitor);
UpdateTranslations (project);
}
@@ -156,14 +157,10 @@ namespace MonoDevelop.Gettext.NodeBuilders
chooser.Dispose ();
}
}
- static IAsyncOperation currentUpdateTranslationOperation = MonoDevelop.Core.ProgressMonitoring.NullAsyncOperation.Success;
+ static Task currentUpdateTranslationOperation = Task.FromResult (0);
- void UpdateTranslationsAsync (object ob)
+ void UpdateTranslationsAsync (ProgressMonitor monitor, TranslationProject project)
{
- object[] data = (object[]) ob;
- IProgressMonitor monitor = (IProgressMonitor) data [0];
- TranslationProject project = (TranslationProject) data [1];
-
try {
project.UpdateTranslations (monitor);
Gtk.Application.Invoke (delegate {
@@ -182,9 +179,8 @@ namespace MonoDevelop.Gettext.NodeBuilders
{
if (currentUpdateTranslationOperation != null && !currentUpdateTranslationOperation.IsCompleted)
return;
- IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetBuildProgressMonitor ();
- currentUpdateTranslationOperation = monitor.AsyncOperation;
- DispatchService.BackgroundDispatch (new StatefulMessageHandler (UpdateTranslationsAsync), new object[] {monitor, project});
+ ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetBuildProgressMonitor ();
+ currentUpdateTranslationOperation = Task.Run (() => UpdateTranslationsAsync (monitor, project));
}
[CommandHandler (Commands.UpdateTranslations)]
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.addin.xml b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.addin.xml
index 06e3c02ece..a65c81440e 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.addin.xml
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.addin.xml
@@ -40,19 +40,12 @@
</Extension>
<Extension path = "/MonoDevelop/Core/StockIcons">
- <StockIcon stockid = "md-gettext-locale" resource = "locale_22x22.png" />
- <StockIcon stockid = "md-gettext-locale" resource = "locale_16x16.png" size = "Menu" />
- <StockIcon stockid = "md-gettext-locale" resource = "locale_22x22.png" size = "Button" />
- <StockIcon stockid = "md-gettext-locale" resource = "locale_32x32.png" size = "Dnd" />
- <StockIcon stockid = "md-gettext-project" icon = "md-project|res:gettext-overlay-16.png" size = "Menu" />
- <StockIcon stockid = "md-gettext-project" icon = "md-project|res:gettext-overlay-32.png" size = "Dnd"/>
- <StockIcon stockid = "md-po-file" resource = "locale_22x22.png" />
- <StockIcon stockid = "md-po-file" resource = "locale_16x16.png" size = "Menu" />
- <StockIcon stockid = "md-po-file" resource = "locale_22x22.png" size = "Button" />
- <StockIcon stockid = "md-po-file" resource = "locale_32x32.png" size = "Dnd" />
- <StockIcon stockid = "silk_accept" resource = "done-16.png" size = "Menu"/>
- <StockIcon stockid = "silk_error" resource = "error-16.png" size = "Menu"/>
- <StockIcon stockid = "silk_exclamation" resource = "warning-16.png" size = "Menu"/>
+ <StockIcon stockid = "md-gettext-locale" resource = "locale-16.png" size = "Menu" />
+ <StockIcon stockid = "md-gettext-project" resource = "project-locale-16.png" size = "Menu" />
+ <StockIcon stockid = "md-po-file" resource = "file-locale-16.png" size = "Menu" />
+ <StockIcon stockid = "md-po-file" resource = "file-locale-32.png" size = "Dnd" />
+ <StockIcon stockid = "md-locale-overlay" resource="project-locale-overlay-32.png" size="Dnd" />
+ <StockIcon stockid = "md-project-locale" icon="md-project|md-locale-overlay" size="Dnd" />
</Extension>
<Extension path = "/MonoDevelop/Core/MimeTypes">
@@ -93,7 +86,11 @@
</Extension>
<Extension path = "/MonoDevelop/Ide/ProjectTemplates">
- <ProjectTemplate id = "MonoDevelop.Gettext.TranslationInfo" resource = "TranslationProject.xpt.xml" />
+ <ProjectTemplate id = "MonoDevelop.Gettext.TranslationProject" resource = "TranslationProject.xpt.xml" />
+ </Extension>
+
+ <Extension path = "/MonoDevelop/Ide/TemplateImages">
+ <Image id = "md-locale-project" resource = "locale-project.png" />
</Extension>
<Extension path = "/MonoDevelop/Ide/Pads/ProjectPad">
@@ -105,11 +102,6 @@
<Extension path = "/MonoDevelop/DesignerSupport/PropertyProviders">
<Class class = "MonoDevelop.Gettext.PropertyProvider"/>
</Extension>
-
- <Extension path = "/MonoDevelop/ProjectModel/ExtendedProperties">
- <ItemProperty class = "MonoDevelop.Projects.ProjectFile"
- name = "Gettext.ScanForTranslations" type = "System.Boolean" />
- </Extension>
<Extension path = "/MonoDevelop/Autotools/MakefileHandlers">
<Class class = "MonoDevelop.Gettext.MakefileHandler"/>
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj
index ba1b944522..e33a277af4 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.csproj
@@ -59,6 +59,18 @@
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System.Core" />
+ <Reference Include="System.Reflection.Metadata">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Reflection.Metadata.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Collections.Immutable">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Collections.Immutable.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
@@ -86,16 +98,6 @@
<Name>MonoDevelop.Deployment</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
- <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
- <Name>Mono.TextEditor</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
- <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
- <Name>ICSharpCode.NRefactory</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\..\..\external\mono-addins\Mono.Addins\Mono.Addins.csproj">
<Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
<Name>Mono.Addins</Name>
@@ -149,6 +151,7 @@
<Compile Include="MonoDevelop.Gettext\TranslationCollection.cs" />
<Compile Include="MonoDevelop.Gettext.NodeBuilders\ProjectFileNodeBuilderExtension.cs" />
<Compile Include="AddinInfo.cs" />
+ <Compile Include="MonoDevelop.Gettext.Editor\Styles.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="gtk-gui\gui.stetic">
@@ -157,14 +160,125 @@
<EmbeddedResource Include="MonoDevelop.Gettext.addin.xml">
<LogicalName>MonoDevelop.Gettext.addin.xml</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\locale_22x22.png">
- <LogicalName>locale_22x22.png</LogicalName>
+ <EmbeddedResource Include="icons\locale-16.png">
+ <LogicalName>locale-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\locale-16%402x.png">
+ <LogicalName>locale-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\locale-16~dark.png">
+ <LogicalName>locale-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\locale-16~dark%402x.png">
+ <LogicalName>locale-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\locale-16~sel.png">
+ <LogicalName>locale-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\locale-16~sel%402x.png">
+ <LogicalName>locale-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\locale-16~dark~sel.png">
+ <LogicalName>locale-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\locale-16~dark~sel%402x.png">
+ <LogicalName>locale-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-locale-16.png">
+ <LogicalName>project-locale-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-locale-16%402x.png">
+ <LogicalName>project-locale-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-locale-16~dark.png">
+ <LogicalName>project-locale-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-locale-16~dark%402x.png">
+ <LogicalName>project-locale-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-locale-16~sel.png">
+ <LogicalName>project-locale-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-locale-16~sel%402x.png">
+ <LogicalName>project-locale-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-locale-16~dark~sel.png">
+ <LogicalName>project-locale-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-locale-16~dark~sel%402x.png">
+ <LogicalName>project-locale-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-locale-overlay-32.png">
+ <LogicalName>project-locale-overlay-32.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-locale-overlay-32%402x.png">
+ <LogicalName>project-locale-overlay-32@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-locale-overlay-32~dark.png">
+ <LogicalName>project-locale-overlay-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-locale-overlay-32~dark%402x.png">
+ <LogicalName>project-locale-overlay-32~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\locale_16x16.png">
- <LogicalName>locale_16x16.png</LogicalName>
+ <EmbeddedResource Include="icons\project-locale-overlay-32~sel.png">
+ <LogicalName>project-locale-overlay-32~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\locale_32x32.png">
- <LogicalName>locale_32x32.png</LogicalName>
+ <EmbeddedResource Include="icons\project-locale-overlay-32~sel%402x.png">
+ <LogicalName>project-locale-overlay-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-locale-overlay-32~dark~sel.png">
+ <LogicalName>project-locale-overlay-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-locale-overlay-32~dark~sel%402x.png">
+ <LogicalName>project-locale-overlay-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-locale-16.png">
+ <LogicalName>file-locale-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-locale-16%402x.png">
+ <LogicalName>file-locale-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-locale-16~dark.png">
+ <LogicalName>file-locale-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-locale-16~dark%402x.png">
+ <LogicalName>file-locale-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-locale-16~sel.png">
+ <LogicalName>file-locale-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-locale-16~sel%402x.png">
+ <LogicalName>file-locale-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-locale-16~dark~sel.png">
+ <LogicalName>file-locale-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-locale-16~dark~sel%402x.png">
+ <LogicalName>file-locale-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-locale-32.png">
+ <LogicalName>file-locale-32.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-locale-32%402x.png">
+ <LogicalName>file-locale-32@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-locale-32~dark.png">
+ <LogicalName>file-locale-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-locale-32~dark%402x.png">
+ <LogicalName>file-locale-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-locale-32~sel.png">
+ <LogicalName>file-locale-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-locale-32~sel%402x.png">
+ <LogicalName>file-locale-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-locale-32~dark~sel.png">
+ <LogicalName>file-locale-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-locale-32~dark~sel%402x.png">
+ <LogicalName>file-locale-32~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="templates\TranslationProject.xpt.xml">
<LogicalName>TranslationProject.xpt.xml</LogicalName>
@@ -175,35 +289,41 @@
<EmbeddedResource Include="templates\Makefile.am.template">
<LogicalName>Makefile.am.template</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\gettext-overlay-16.png">
- <LogicalName>gettext-overlay-16.png</LogicalName>
+ <EmbeddedResource Include="icons\prefs-language-16.png">
+ <LogicalName>prefs-language-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-language-16%402x.png">
+ <LogicalName>prefs-language-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\gettext-overlay-32.png">
- <LogicalName>gettext-overlay-32.png</LogicalName>
+ <EmbeddedResource Include="icons\prefs-language-16~dark.png">
+ <LogicalName>prefs-language-16~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\done-16.png">
- <LogicalName>done-16.png</LogicalName>
+ <EmbeddedResource Include="icons\prefs-language-16~dark%402x.png">
+ <LogicalName>prefs-language-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\done-16%402x.png">
- <LogicalName>done-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\prefs-language-16~dark~sel.png">
+ <LogicalName>prefs-language-16~dark~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\error-16.png">
- <LogicalName>error-16.png</LogicalName>
+ <EmbeddedResource Include="icons\prefs-language-16~dark~sel%402x.png">
+ <LogicalName>prefs-language-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\error-16%402x.png">
- <LogicalName>error-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\prefs-language-16~sel.png">
+ <LogicalName>prefs-language-16~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\warning-16.png">
- <LogicalName>warning-16.png</LogicalName>
+ <EmbeddedResource Include="icons\prefs-language-16~sel%402x.png">
+ <LogicalName>prefs-language-16~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\warning-16%402x.png">
- <LogicalName>warning-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\locale-project.png">
+ <LogicalName>locale-project.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\prefs-language-16.png">
- <LogicalName>prefs-language-16.png</LogicalName>
+ <EmbeddedResource Include="icons\locale-project%402x.png">
+ <LogicalName>locale-project@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\prefs-language-16%402x.png">
- <LogicalName>prefs-language-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\locale-project~dark.png">
+ <LogicalName>locale-project~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\locale-project~dark%402x.png">
+ <LogicalName>locale-project~dark@2x.png</LogicalName>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/Catalog.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/Catalog.cs
index e661be4572..55cd1613cf 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/Catalog.cs
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/Catalog.cs
@@ -201,7 +201,7 @@ namespace MonoDevelop.Gettext
/// <summary>
/// Loads catalog from .po file.
/// </summary>
- public bool Load (IProgressMonitor monitor, string poFile)
+ public bool Load (ProgressMonitor monitor, string poFile)
{
Clear ();
isOk = false;
@@ -439,7 +439,7 @@ namespace MonoDevelop.Gettext
}
// Updates the catalog from POT file.
- public bool UpdateFromPOT (IProgressMonitor mon, string potFile, bool summary)
+ public bool UpdateFromPOT (ProgressMonitor mon, string potFile, bool summary)
{
if (! isOk)
return false;
@@ -685,7 +685,7 @@ namespace MonoDevelop.Gettext
// (in the sense of msgmerge -- this catalog is old one with
// translations, \a refcat is reference catalog created by Update().)
// return true if the merge was successfull, false otherwise.
- public bool Merge (IProgressMonitor mon, Catalog refCat)
+ public bool Merge (ProgressMonitor mon, Catalog refCat)
{
// TODO: implement via monitor, not in a GUI thread...
// But mind about it as it would be used during build.
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/GettextFeatureWidget.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/GettextFeatureWidget.cs
index a6fc5751f3..00d5f9ded3 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/GettextFeatureWidget.cs
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/GettextFeatureWidget.cs
@@ -31,7 +31,7 @@ using Gtk;
using MonoDevelop.Projects;
using MonoDevelop.Gettext.Translator;
-using MonoDevelop.Core.ProgressMonitoring;
+using MonoDevelop.Core;
using MonoDevelop.Ide;
namespace MonoDevelop.Gettext
@@ -75,7 +75,7 @@ namespace MonoDevelop.Gettext
};
}
- public void ApplyFeature (SolutionFolder parentCombine, SolutionItem entry)
+ public void ApplyFeature (SolutionFolder parentCombine, SolutionFolderItem entry)
{
TranslationProject newProject;
if (entry is TranslationProject)
@@ -94,7 +94,7 @@ namespace MonoDevelop.Gettext
if (store.GetIterFirst (out iter)) {
do {
string code = (string)store.GetValue (iter, 1);
- newProject.AddNewTranslation (code, new NullProgressMonitor ());
+ newProject.AddNewTranslation (code, new ProgressMonitor ());
} while (store.IterNext (ref iter));
}
}
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/GettextTool.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/GettextTool.cs
index 96bf769a7a..c2848375cc 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/GettextTool.cs
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/GettextTool.cs
@@ -31,6 +31,7 @@ using System.Collections.Generic;
using MonoDevelop.Projects;
using MonoDevelop.Core;
using MonoDevelop.Core.ProgressMonitoring;
+using System.Threading.Tasks;
namespace MonoDevelop.Gettext
{
@@ -40,7 +41,7 @@ namespace MonoDevelop.Gettext
string file;
string project;
- public int Run (string[] arguments)
+ public async Task<int> Run (string[] arguments)
{
Console.WriteLine (BrandingService.BrandApplicationName ("MonoDevelop Gettext Update Tool"));
foreach (string s in arguments)
@@ -74,7 +75,7 @@ namespace MonoDevelop.Gettext
ConsoleProgressMonitor monitor = new ConsoleProgressMonitor ();
monitor.IgnoreLogMessages = true;
- WorkspaceItem centry = Services.ProjectService.ReadWorkspaceItem (monitor, file);
+ WorkspaceItem centry = await Services.ProjectService.ReadWorkspaceItem (monitor, file);
monitor.IgnoreLogMessages = false;
Solution solution = centry as Solution;
@@ -84,7 +85,7 @@ namespace MonoDevelop.Gettext
}
if (project != null) {
- SolutionEntityItem item = solution.FindProjectByName (project);
+ SolutionItem item = solution.FindProjectByName (project);
if (item == null) {
Console.WriteLine ("The project '" + project + "' could not be found in " + file);
@@ -98,7 +99,7 @@ namespace MonoDevelop.Gettext
tp.UpdateTranslations (monitor);
}
else {
- foreach (TranslationProject p in solution.GetAllSolutionItems <TranslationProject>())
+ foreach (TranslationProject p in solution.GetAllItems <TranslationProject>())
p.UpdateTranslations (monitor);
}
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/IFileScanner.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/IFileScanner.cs
index 3f722b7b16..fabcabb70e 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/IFileScanner.cs
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/IFileScanner.cs
@@ -33,6 +33,6 @@ namespace MonoDevelop.Gettext
interface IFileScanner
{
bool CanScan (TranslationProject project, Catalog catalog, string fileName, string mimeType);
- void UpdateCatalog (TranslationProject project, Catalog catalog, IProgressMonitor monitor, string fileName);
+ void UpdateCatalog (TranslationProject project, Catalog catalog, ProgressMonitor monitor, string fileName);
}
}
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/MakefileHandler.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/MakefileHandler.cs
index baca1511d0..72ddc7c24e 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/MakefileHandler.cs
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/MakefileHandler.cs
@@ -39,12 +39,12 @@ namespace MonoDevelop.Gettext
{
class MakefileHandler: IMakefileHandler
{
- public bool CanDeploy (SolutionItem entry, MakefileType type)
+ public bool CanDeploy (SolutionFolderItem entry, MakefileType type)
{
return entry is TranslationProject;
}
- public Makefile Deploy (AutotoolsContext ctx, SolutionItem entry, IProgressMonitor monitor)
+ public Makefile Deploy (AutotoolsContext ctx, SolutionFolderItem entry, ProgressMonitor monitor)
{
Makefile mkfile = new Makefile ();
TranslationProject project = (TranslationProject) entry;
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/PropertyProvider.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/PropertyProvider.cs
index e8646605bc..5fc09b234b 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/PropertyProvider.cs
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/PropertyProvider.cs
@@ -61,15 +61,10 @@ namespace MonoDevelop.Gettext
[LocalizedDescription ("Include this file in the translation scan.")]
public bool ScanForTranslations {
get {
- object result = file.ExtendedProperties [scanForTranslationsProperty];
- return result == null ? true : (bool)result;
+ return file.Metadata.GetValue (scanForTranslationsProperty, true);
}
set {
- if (value) {
- file.ExtendedProperties.Remove (scanForTranslationsProperty);
- } else {
- file.ExtendedProperties [scanForTranslationsProperty] = value;
- }
+ file.Metadata.SetValue (scanForTranslationsProperty, value, true);
}
}
}
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/RegexFileScanner.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/RegexFileScanner.cs
index 0e84bc1ee1..144d1b69c1 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/RegexFileScanner.cs
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/RegexFileScanner.cs
@@ -118,7 +118,7 @@ namespace MonoDevelop.Gettext
return r;
}
- public virtual void UpdateCatalog (TranslationProject project, Catalog catalog, IProgressMonitor monitor, string fileName)
+ public virtual void UpdateCatalog (TranslationProject project, Catalog catalog, ProgressMonitor monitor, string fileName)
{
string text = File.ReadAllText (fileName);
string relativeFileName = MonoDevelop.Core.FileService.AbsoluteToRelativePath (project.BaseDirectory, fileName);
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/StringEscaping.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/StringEscaping.cs
index 8ae6882391..efe8b973e1 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/StringEscaping.cs
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/StringEscaping.cs
@@ -237,11 +237,21 @@ namespace MonoDevelop.Gettext
sb.Append ('\t');
break;
case 'U':
- //FIXME UNICODE
- //break;
+ uint Uc;
+ if (!TryParseHex (text, i + 1, 8, out Uc) || NeedsEscaping (Uc)) {
+ throw new FormatException ("Invalid escape '\\" + text.Substring (i, 9) + "' in translatable string.");
+ }
+ sb.Append (char.ConvertFromUtf32 ((int)Uc));
+ i += 8;
+ break;
case 'u':
- //FIXME unicode
- //break;
+ uint uc;
+ if (!TryParseHex (text, i + 1, 4, out uc) || NeedsEscaping (uc)) {
+ throw new FormatException ("Invalid escape '\\" + text.Substring (i, 5) + "' in translatable string.");
+ }
+ sb.Append ((char)uc);
+ i += 4;
+ break;
case 'x':
//FIXME hex unicode
//break;
@@ -259,6 +269,44 @@ namespace MonoDevelop.Gettext
}
return sb.ToString ();
}
+
+ static bool NeedsEscaping (uint c)
+ {
+ //TODO: there are other chars we should error on?
+ if (c > char.MaxValue)
+ return false;
+ return char.IsControl ((char)c);
+ }
+
+ static bool TryParseHex (string str, int offset, int length, out uint val)
+ {
+ val = 0x0;
+
+ for (int i = offset; i < offset + length; i++) {
+ uint bits;
+ switch (str[i]) {
+ case '0': bits = 0; break;
+ case '1': bits = 1; break;
+ case '2': bits = 2; break;
+ case '3': bits = 3; break;
+ case '4': bits = 4; break;
+ case '5': bits = 5; break;
+ case '6': bits = 6; break;
+ case '7': bits = 7; break;
+ case '8': bits = 8; break;
+ case '9': bits = 9; break;
+ case 'A': case 'a': bits = 10; break;
+ case 'B': case 'b': bits = 11; break;
+ case 'C': case 'c': bits = 12; break;
+ case 'D': case 'd': bits = 13; break;
+ case 'E': case 'e': bits = 14; break;
+ case 'F': case 'f': bits = 15; break;
+ default: return false;
+ }
+ val = (val << 4) | bits;
+ }
+ return true;
+ }
public enum EscapeMode
{
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/Translation.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/Translation.cs
index 84a8ecf5cd..178a069000 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/Translation.cs
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/Translation.cs
@@ -84,7 +84,7 @@ namespace MonoDevelop.Gettext
return Path.Combine (moDirectory, parentProject.PackageName + ".mo");
}
- public BuildResult Build (IProgressMonitor monitor, ConfigurationSelector configuration)
+ public BuildResult Build (ProgressMonitor monitor, ConfigurationSelector configuration)
{
BuildResult results = new BuildResult ("", 0, 0);
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationProject.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationProject.cs
index fcef46a792..14e4396528 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationProject.cs
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationProject.cs
@@ -38,10 +38,12 @@ using MonoDevelop.Core.Serialization;
using MonoDevelop.Deployment;
using MonoDevelop.Ide;
using MonoDevelop.Core.Execution;
+using System.Linq;
+using System.Threading.Tasks;
namespace MonoDevelop.Gettext
{
- class TranslationProject : SolutionEntityItem, IDeployable
+ class TranslationProject : Project, IDeployable
{
[ItemProperty("packageName")]
string packageName = null;
@@ -85,18 +87,13 @@ namespace MonoDevelop.Gettext
public TranslationProject ()
{
+ Initialize (this);
translations = new TranslationCollection (this);
-
- //NOTE: we don't really need multiple configurations for this project type, since nothing actually uses them
- //but it makes the solution configuration mapping look more consistent
- //Perhaps in future there will be some per-config settings
- foreach (string config in new [] { "Debug", "Release"})
- Configurations.Add (new TranslationProjectConfiguration (config));
}
-
- protected override List<FilePath> OnGetItemFiles (bool includeReferencedFiles)
+
+ protected override IEnumerable<FilePath> OnGetItemFiles (bool includeReferencedFiles)
{
- List<FilePath> col = base.OnGetItemFiles (includeReferencedFiles);
+ List<FilePath> col = base.OnGetItemFiles (includeReferencedFiles).ToList();
if (includeReferencedFiles) {
foreach (Translation tr in translations)
col.Add (tr.PoFile);
@@ -104,7 +101,7 @@ namespace MonoDevelop.Gettext
return col;
}
- public TranslationProjectInformation GetProjectInformation (SolutionItem entry, bool force)
+ public TranslationProjectInformation GetProjectInformation (SolutionFolderItem entry, bool force)
{
foreach (TranslationProjectInformation info in this.projectInformations) {
if (info.ProjectName == entry.Name)
@@ -118,7 +115,7 @@ namespace MonoDevelop.Gettext
return null;
}
- public bool IsIncluded (SolutionItem entry)
+ public bool IsIncluded (SolutionFolderItem entry)
{
TranslationProjectInformation info = GetProjectInformation (entry, false);
if (info != null)
@@ -126,8 +123,14 @@ namespace MonoDevelop.Gettext
return true;
}
- public override void InitializeFromTemplate (XmlElement template)
+ protected override void OnInitializeFromTemplate (ProjectCreateInformation projectCreateInfo, XmlElement template)
{
+ //NOTE: we don't really need multiple configurations for this project type, since nothing actually uses them
+ //but it makes the solution configuration mapping look more consistent
+ //Perhaps in future there will be some per-config settings
+ foreach (string config in new [] { "Debug", "Release"})
+ Configurations.Add (new TranslationProjectConfiguration (config));
+
OutputType = (TranslationOutputType)Enum.Parse (typeof(TranslationOutputType), template.GetAttribute ("outputType"));
PackageName = template.GetAttribute ("packageName");
RelPath = template.GetAttribute ("relPath");
@@ -169,7 +172,7 @@ namespace MonoDevelop.Gettext
}
- public Translation AddNewTranslation (string isoCode, IProgressMonitor monitor)
+ public Translation AddNewTranslation (string isoCode, ProgressMonitor monitor)
{
try {
Translation tr = new Translation (this, isoCode);
@@ -182,7 +185,7 @@ namespace MonoDevelop.Gettext
monitor.ReportSuccess (String.Format (GettextCatalog.GetString ("Language '{0}' successfully added."), isoCode));
monitor.Step (1);
- this.Save (monitor);
+ SaveAsync (monitor);
return tr;
} catch (Exception e) {
monitor.ReportError (String.Format ( GettextCatalog.GetString ("Language '{0}' could not be added: "), isoCode), e);
@@ -221,7 +224,7 @@ namespace MonoDevelop.Gettext
OnTranslationRemoved (EventArgs.Empty);
}
- public override SolutionItemConfiguration CreateConfiguration (string name)
+ protected override SolutionItemConfiguration OnCreateConfiguration (string name, ConfigurationKind kind)
{
return new TranslationProjectConfiguration (name);
}
@@ -236,7 +239,7 @@ namespace MonoDevelop.Gettext
return Path.Combine (this.ParentSolution.StartupItem.BaseDirectory, RelPath);
}
- void CreateDefaultCatalog (IProgressMonitor monitor)
+ void CreateDefaultCatalog (ProgressMonitor monitor)
{
IFileScanner[] scanners = TranslationService.GetFileScanners ();
@@ -259,19 +262,19 @@ namespace MonoDevelop.Gettext
}
}
}
- if (monitor.IsCancelRequested)
+ if (monitor.CancellationToken.IsCancellationRequested)
return;
monitor.Step (1);
}
catalog.Save (Path.Combine (this.BaseDirectory, "messages.po"));
}
- public void UpdateTranslations (IProgressMonitor monitor)
+ public void UpdateTranslations (ProgressMonitor monitor)
{
UpdateTranslations (monitor, translations.ToArray ());
}
- public void UpdateTranslations (IProgressMonitor monitor, params Translation[] translations)
+ public void UpdateTranslations (ProgressMonitor monitor, params Translation[] translations)
{
monitor.BeginTask (null, Translations.Count + 1);
@@ -288,7 +291,7 @@ namespace MonoDevelop.Gettext
monitor.EndTask ();
monitor.Step (1);
}
- if (monitor.IsCancelRequested) {
+ if (monitor.CancellationToken.IsCancellationRequested) {
monitor.Log.WriteLine (GettextCatalog.GetString ("Operation cancelled."));
return;
}
@@ -324,7 +327,7 @@ namespace MonoDevelop.Gettext
monitor.EndTask ();
monitor.Step (1);
}
- if (monitor.IsCancelRequested) {
+ if (monitor.CancellationToken.IsCancellationRequested) {
monitor.Log.WriteLine (GettextCatalog.GetString ("Operation cancelled."));
return;
}
@@ -335,7 +338,7 @@ namespace MonoDevelop.Gettext
foreach (Translation translation in this.Translations) {
string poFileName = translation.PoFile;
Catalog catalog = new Catalog (this);
- catalog.Load (new MonoDevelop.Core.ProgressMonitoring.NullProgressMonitor (), poFileName);
+ catalog.Load (new MonoDevelop.Core.ProgressMonitor (), poFileName);
CatalogEntry entry = catalog.FindItem (msgstr);
if (entry != null) {
catalog.RemoveItem (entry);
@@ -344,40 +347,43 @@ namespace MonoDevelop.Gettext
}
}
- protected override BuildResult OnBuild (IProgressMonitor monitor, ConfigurationSelector configuration)
+ protected async override Task<BuildResult> OnBuild (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
+ var toBuild = Translations.Where (t => t.NeedsBuilding(configuration)).ToArray ();
BuildResult results = new BuildResult ("", 1, 0);
string outputDirectory = GetOutputDirectory (configuration);
if (!string.IsNullOrEmpty (outputDirectory)) {
- foreach (Translation translation in this.Translations) {
- if (translation.NeedsBuilding (configuration)) {
- BuildResult res = translation.Build (monitor, configuration);
- results.Append (res);
+ await Task.Run (delegate {
+ foreach (Translation translation in toBuild) {
+ if (translation.NeedsBuilding (configuration)) {
+ BuildResult res = translation.Build (monitor, configuration);
+ results.Append (res);
+ }
}
- }
- isDirty = false;
+ isDirty = false;
+ });
}
return results;
}
- protected override void OnClean (IProgressMonitor monitor, ConfigurationSelector configuration)
+ protected async override Task<BuildResult> OnClean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
isDirty = true;
monitor.Log.WriteLine (GettextCatalog.GetString ("Removing all .mo files."));
string outputDirectory = GetOutputDirectory (configuration);
if (string.IsNullOrEmpty (outputDirectory))
- return;
- foreach (Translation translation in this.Translations) {
- string moFileName = translation.GetOutFile (configuration);
- if (File.Exists (moFileName))
- File.Delete (moFileName);
- }
- }
-
- protected override void OnExecute (IProgressMonitor monitor, MonoDevelop.Projects.ExecutionContext context, ConfigurationSelector configuration)
- {
+ return BuildResult.CreateSuccess ();
+
+ var toClean = Translations.Select (t => t.GetOutFile (configuration)).ToArray ();
+ await Task.Run (delegate {
+ foreach (string moFileName in toClean) {
+ if (File.Exists (moFileName))
+ File.Delete (moFileName);
+ }
+ });
+ return BuildResult.CreateSuccess ();
}
-
+
#region Deployment
public DeployFileCollection GetDeployFiles (ConfigurationSelector configuration)
{
@@ -410,11 +416,6 @@ namespace MonoDevelop.Gettext
return false;
}
- protected override void OnSetNeedsBuilding (bool val, ConfigurationSelector configuration)
- {
- isDirty = val;
- }
-
protected virtual void OnTranslationAdded (EventArgs e)
{
if (TranslationAdded != null)
@@ -437,13 +438,9 @@ namespace MonoDevelop.Gettext
SystemPath
}
- class TranslationProjectConfiguration : SolutionItemConfiguration
+ class TranslationProjectConfiguration : ProjectConfiguration
{
- public TranslationProjectConfiguration ()
- {
- }
-
- public TranslationProjectConfiguration (string name): base (name)
+ public TranslationProjectConfiguration (string id): base (id)
{
}
}
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationProjectOptionsDialog.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationProjectOptionsDialog.cs
index 185e521dc7..b1199da866 100644
--- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationProjectOptionsDialog.cs
+++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationProjectOptionsDialog.cs
@@ -67,7 +67,7 @@ namespace MonoDevelop.Gettext
this.Destroy ();
};
- store = new TreeStore (typeof(string), typeof(bool), typeof(string), typeof(SolutionItem), typeof(bool));
+ store = new TreeStore (typeof(string), typeof(bool), typeof(string), typeof(SolutionFolderItem), typeof(bool));
treeviewProjectList.Model = store;
treeviewProjectList.HeadersVisible = false;
@@ -98,7 +98,7 @@ namespace MonoDevelop.Gettext
TreeIter iter;
if (store.GetIterFromString (out iter, e.Path)) {
bool isTogglod = (bool)store.GetValue (iter, 1);
- SolutionItem entry = (SolutionItem)store.GetValue (iter, 3);
+ SolutionFolderItem entry = (SolutionFolderItem)store.GetValue (iter, 3);
if (entry is Project) {
TranslationProjectInformation info = project.GetProjectInformation (entry, true);
info.IsIncluded = !isTogglod;
@@ -108,7 +108,7 @@ namespace MonoDevelop.Gettext
}
TreeStore store;
- string GetIcon (SolutionItem entry)
+ string GetIcon (SolutionFolderItem entry)
{
if (entry is SolutionFolder)
return MonoDevelop.Ide.Gui.Stock.Solution;
@@ -119,10 +119,10 @@ namespace MonoDevelop.Gettext
return MonoDevelop.Ide.Gui.Stock.Project;
}
- bool IsIncluded (SolutionItem entry)
+ bool IsIncluded (SolutionFolderItem entry)
{
if (entry is SolutionFolder) {
- foreach (SolutionItem childEntry in ((SolutionFolder)entry).Items)
+ foreach (SolutionFolderItem childEntry in ((SolutionFolder)entry).Items)
if (!IsIncluded (childEntry))
return false;
return true;
@@ -134,7 +134,7 @@ namespace MonoDevelop.Gettext
return true;
}
- void FillTree (TreeIter iter, SolutionItem entry)
+ void FillTree (TreeIter iter, SolutionFolderItem entry)
{
TreeIter curIter;
if (!iter.Equals (TreeIter.Zero)) {
@@ -144,10 +144,10 @@ namespace MonoDevelop.Gettext
}
if (entry is SolutionFolder) {
// Add solutions first, then projects
- foreach (SolutionItem childEntry in ((SolutionFolder)entry).Items)
+ foreach (SolutionFolderItem childEntry in ((SolutionFolder)entry).Items)
if (childEntry is SolutionFolder)
FillTree (curIter, childEntry);
- foreach (SolutionItem childEntry in ((SolutionFolder)entry).Items)
+ foreach (SolutionFolderItem childEntry in ((SolutionFolder)entry).Items)
if (!(childEntry is TranslationProject) && (childEntry is Project))
FillTree (curIter, childEntry);
}
diff --git a/main/src/addins/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs b/main/src/addins/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs
index c91ffde2da..3d99d3fd00 100644
--- a/main/src/addins/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs
+++ b/main/src/addins/MonoDevelop.Gettext/gtk-gui/MonoDevelop.Gettext.POEditorWidget.cs
@@ -5,42 +5,97 @@ namespace MonoDevelop.Gettext
internal partial class POEditorWidget
{
private global::Gtk.UIManager UIManager;
+
private global::Gtk.VBox vbox2;
+
private global::Gtk.Notebook notebookPages;
+
private global::Gtk.VBox vbox7;
+
private global::Gtk.HBox hbox2;
+
private global::Gtk.Label label2;
+
private global::MonoDevelop.Components.SearchEntry searchEntryFilter;
+
private global::Gtk.ToggleButton togglebuttonOk;
+
+ private global::Gtk.HBox togglebuttonOkHbox;
+
+ private global::MonoDevelop.Components.ImageView togglebuttonOkIcon;
+
+ private global::Gtk.Label togglebuttonOkLabel;
+
private global::Gtk.ToggleButton togglebuttonMissing;
+
+ private global::Gtk.HBox togglebuttonMissingHbox;
+
+ private global::MonoDevelop.Components.ImageView togglebuttonMissingIcon;
+
+ private global::Gtk.Label togglebuttonMissingLabel;
+
private global::Gtk.ToggleButton togglebuttonFuzzy;
+
+ private global::Gtk.HBox togglebuttonFuzzyHbox;
+
+ private global::MonoDevelop.Components.ImageView togglebuttonFuzzyIcon;
+
+ private global::Gtk.Label togglebuttonFuzzyLabel;
+
private global::Gtk.VPaned vpaned2;
+
private global::Gtk.ScrolledWindow scrolledwindow1;
+
private global::Gtk.TreeView treeviewEntries;
+
private global::Gtk.Table table1;
+
private global::Gtk.VBox vbox3;
+
private global::Gtk.Label label6;
+
private global::Gtk.ScrolledWindow scrolledwindow3;
+
private global::Gtk.TextView textviewComments;
+
private global::Gtk.VBox vbox4;
+
private global::Gtk.Label label7;
+
private global::Gtk.Notebook notebookTranslated;
+
private global::Gtk.Label label1;
+
private global::Gtk.VBox vbox5;
+
private global::Gtk.HBox hbox3;
+
private global::Gtk.Label label8;
+
private global::Gtk.CheckButton checkbuttonWhiteSpaces;
+
private global::Gtk.ScrolledWindow scrolledwindowOriginal;
+
private global::Gtk.VBox vbox8;
+
private global::Gtk.Label label9;
+
private global::Gtk.ScrolledWindow scrolledwindowPlural;
+
private global::Gtk.VBox vbox6;
+
private global::Gtk.Label label4;
+
private global::Gtk.ScrolledWindow scrolledwindow2;
+
private global::Gtk.TreeView treeviewFoundIn;
+
private global::Gtk.Label label5;
+
private global::Gtk.HBox hbox1;
+
private global::Gtk.Toolbar toolbarPages;
+
private global::Gtk.ProgressBar progressbar1;
protected virtual void Build ()
@@ -98,49 +153,109 @@ namespace MonoDevelop.Gettext
this.togglebuttonOk = new global::Gtk.ToggleButton ();
this.togglebuttonOk.CanFocus = true;
this.togglebuttonOk.Name = "togglebuttonOk";
- this.togglebuttonOk.UseUnderline = true;
- this.togglebuttonOk.Label = global::Mono.Unix.Catalog.GetString ("Valid");
- global::Gtk.Image w5 = new global::Gtk.Image ();
- w5.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("done-16.png");
- this.togglebuttonOk.Image = w5;
- this.hbox2.Add (this.togglebuttonOk);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.togglebuttonOk]));
- w6.Position = 2;
+ // Container child togglebuttonOk.Gtk.Container+ContainerChild
+ this.togglebuttonOkHbox = new global::Gtk.HBox ();
+ this.togglebuttonOkHbox.Name = "togglebuttonOkHbox";
+ this.togglebuttonOkHbox.Spacing = 2;
+ // Container child togglebuttonOkHbox.Gtk.Box+BoxChild
+ this.togglebuttonOkIcon = new global::MonoDevelop.Components.ImageView ();
+ this.togglebuttonOkIcon.Name = "togglebuttonOkIcon";
+ this.togglebuttonOkIcon.IconId = "md-done";
+ this.togglebuttonOkIcon.IconSize = ((global::Gtk.IconSize)(1));
+ this.togglebuttonOkHbox.Add (this.togglebuttonOkIcon);
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.togglebuttonOkHbox [this.togglebuttonOkIcon]));
+ w5.Position = 0;
+ w5.Expand = false;
+ w5.Fill = false;
+ // Container child togglebuttonOkHbox.Gtk.Box+BoxChild
+ this.togglebuttonOkLabel = new global::Gtk.Label ();
+ this.togglebuttonOkLabel.Name = "togglebuttonOkLabel";
+ this.togglebuttonOkLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Valid");
+ this.togglebuttonOkLabel.UseUnderline = true;
+ this.togglebuttonOkHbox.Add (this.togglebuttonOkLabel);
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.togglebuttonOkHbox [this.togglebuttonOkLabel]));
+ w6.Position = 1;
w6.Expand = false;
w6.Fill = false;
+ this.togglebuttonOk.Add (this.togglebuttonOkHbox);
+ this.hbox2.Add (this.togglebuttonOk);
+ global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.togglebuttonOk]));
+ w8.Position = 2;
+ w8.Expand = false;
+ w8.Fill = false;
// Container child hbox2.Gtk.Box+BoxChild
this.togglebuttonMissing = new global::Gtk.ToggleButton ();
this.togglebuttonMissing.CanFocus = true;
this.togglebuttonMissing.Name = "togglebuttonMissing";
- this.togglebuttonMissing.UseUnderline = true;
- this.togglebuttonMissing.Label = global::Mono.Unix.Catalog.GetString ("Missing");
- global::Gtk.Image w7 = new global::Gtk.Image ();
- w7.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("warning-16.png");
- this.togglebuttonMissing.Image = w7;
+ // Container child togglebuttonMissing.Gtk.Container+ContainerChild
+ this.togglebuttonMissingHbox = new global::Gtk.HBox ();
+ this.togglebuttonMissingHbox.Name = "togglebuttonMissingHbox";
+ this.togglebuttonMissingHbox.Spacing = 2;
+ // Container child togglebuttonMissingHbox.Gtk.Box+BoxChild
+ this.togglebuttonMissingIcon = new global::MonoDevelop.Components.ImageView ();
+ this.togglebuttonMissingIcon.Name = "togglebuttonMissingIcon";
+ this.togglebuttonMissingIcon.IconId = "md-warning";
+ this.togglebuttonMissingIcon.IconSize = ((global::Gtk.IconSize)(1));
+ this.togglebuttonMissingHbox.Add (this.togglebuttonMissingIcon);
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.togglebuttonMissingHbox [this.togglebuttonMissingIcon]));
+ w9.Position = 0;
+ w9.Expand = false;
+ w9.Fill = false;
+ // Container child togglebuttonMissingHbox.Gtk.Box+BoxChild
+ this.togglebuttonMissingLabel = new global::Gtk.Label ();
+ this.togglebuttonMissingLabel.Name = "togglebuttonMissingLabel";
+ this.togglebuttonMissingLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Missing");
+ this.togglebuttonMissingLabel.UseUnderline = true;
+ this.togglebuttonMissingHbox.Add (this.togglebuttonMissingLabel);
+ global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.togglebuttonMissingHbox [this.togglebuttonMissingLabel]));
+ w10.Position = 1;
+ w10.Expand = false;
+ w10.Fill = false;
+ this.togglebuttonMissing.Add (this.togglebuttonMissingHbox);
this.hbox2.Add (this.togglebuttonMissing);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.togglebuttonMissing]));
- w8.Position = 3;
- w8.Expand = false;
- w8.Fill = false;
+ global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.togglebuttonMissing]));
+ w12.Position = 3;
+ w12.Expand = false;
+ w12.Fill = false;
// Container child hbox2.Gtk.Box+BoxChild
this.togglebuttonFuzzy = new global::Gtk.ToggleButton ();
this.togglebuttonFuzzy.CanFocus = true;
this.togglebuttonFuzzy.Name = "togglebuttonFuzzy";
- this.togglebuttonFuzzy.UseUnderline = true;
- this.togglebuttonFuzzy.Label = global::Mono.Unix.Catalog.GetString ("Fuzzy");
- global::Gtk.Image w9 = new global::Gtk.Image ();
- w9.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("error-16.png");
- this.togglebuttonFuzzy.Image = w9;
+ // Container child togglebuttonFuzzy.Gtk.Container+ContainerChild
+ this.togglebuttonFuzzyHbox = new global::Gtk.HBox ();
+ this.togglebuttonFuzzyHbox.Name = "togglebuttonFuzzyHbox";
+ this.togglebuttonFuzzyHbox.Spacing = 2;
+ // Container child togglebuttonFuzzyHbox.Gtk.Box+BoxChild
+ this.togglebuttonFuzzyIcon = new global::MonoDevelop.Components.ImageView ();
+ this.togglebuttonFuzzyIcon.Name = "togglebuttonFuzzyIcon";
+ this.togglebuttonFuzzyIcon.IconId = "md-error";
+ this.togglebuttonFuzzyIcon.IconSize = ((global::Gtk.IconSize)(1));
+ this.togglebuttonFuzzyHbox.Add (this.togglebuttonFuzzyIcon);
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.togglebuttonFuzzyHbox [this.togglebuttonFuzzyIcon]));
+ w13.Position = 0;
+ w13.Expand = false;
+ w13.Fill = false;
+ // Container child togglebuttonFuzzyHbox.Gtk.Box+BoxChild
+ this.togglebuttonFuzzyLabel = new global::Gtk.Label ();
+ this.togglebuttonFuzzyLabel.Name = "togglebuttonFuzzyLabel";
+ this.togglebuttonFuzzyLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Fuzzy");
+ this.togglebuttonFuzzyLabel.UseUnderline = true;
+ this.togglebuttonFuzzyHbox.Add (this.togglebuttonFuzzyLabel);
+ global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.togglebuttonFuzzyHbox [this.togglebuttonFuzzyLabel]));
+ w14.Position = 1;
+ w14.Expand = false;
+ w14.Fill = false;
+ this.togglebuttonFuzzy.Add (this.togglebuttonFuzzyHbox);
this.hbox2.Add (this.togglebuttonFuzzy);
- global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.togglebuttonFuzzy]));
- w10.Position = 4;
- w10.Expand = false;
- w10.Fill = false;
+ global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.togglebuttonFuzzy]));
+ w16.Position = 4;
+ w16.Expand = false;
+ w16.Fill = false;
this.vbox7.Add (this.hbox2);
- global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox7 [this.hbox2]));
- w11.Position = 0;
- w11.Expand = false;
- w11.Fill = false;
+ global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox7 [this.hbox2]));
+ w17.Position = 0;
+ w17.Expand = false;
+ w17.Fill = false;
// Container child vbox7.Gtk.Box+BoxChild
this.vpaned2 = new global::Gtk.VPaned ();
this.vpaned2.CanFocus = true;
@@ -157,8 +272,8 @@ namespace MonoDevelop.Gettext
this.treeviewEntries.Name = "treeviewEntries";
this.scrolledwindow1.Add (this.treeviewEntries);
this.vpaned2.Add (this.scrolledwindow1);
- global::Gtk.Paned.PanedChild w13 = ((global::Gtk.Paned.PanedChild)(this.vpaned2 [this.scrolledwindow1]));
- w13.Resize = false;
+ global::Gtk.Paned.PanedChild w19 = ((global::Gtk.Paned.PanedChild)(this.vpaned2 [this.scrolledwindow1]));
+ w19.Resize = false;
// Container child vpaned2.Gtk.Paned+PanedChild
this.table1 = new global::Gtk.Table (((uint)(2)), ((uint)(2)), true);
this.table1.Name = "table1";
@@ -175,10 +290,10 @@ namespace MonoDevelop.Gettext
this.label6.LabelProp = global::Mono.Unix.Catalog.GetString ("_Comments:");
this.label6.UseUnderline = true;
this.vbox3.Add (this.label6);
- global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.label6]));
- w14.Position = 0;
- w14.Expand = false;
- w14.Fill = false;
+ global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.label6]));
+ w20.Position = 0;
+ w20.Expand = false;
+ w20.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
this.scrolledwindow3 = new global::Gtk.ScrolledWindow ();
this.scrolledwindow3.CanFocus = true;
@@ -191,15 +306,15 @@ namespace MonoDevelop.Gettext
this.textviewComments.AcceptsTab = false;
this.scrolledwindow3.Add (this.textviewComments);
this.vbox3.Add (this.scrolledwindow3);
- global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.scrolledwindow3]));
- w16.Position = 1;
+ global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.scrolledwindow3]));
+ w22.Position = 1;
this.table1.Add (this.vbox3);
- global::Gtk.Table.TableChild w17 = ((global::Gtk.Table.TableChild)(this.table1 [this.vbox3]));
- w17.TopAttach = ((uint)(1));
- w17.BottomAttach = ((uint)(2));
- w17.LeftAttach = ((uint)(1));
- w17.RightAttach = ((uint)(2));
- w17.XOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w23 = ((global::Gtk.Table.TableChild)(this.table1 [this.vbox3]));
+ w23.TopAttach = ((uint)(1));
+ w23.BottomAttach = ((uint)(2));
+ w23.LeftAttach = ((uint)(1));
+ w23.RightAttach = ((uint)(2));
+ w23.XOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
this.vbox4 = new global::Gtk.VBox ();
this.vbox4.Name = "vbox4";
@@ -211,33 +326,33 @@ namespace MonoDevelop.Gettext
this.label7.LabelProp = global::Mono.Unix.Catalog.GetString ("_Translated (msgstr):");
this.label7.UseUnderline = true;
this.vbox4.Add (this.label7);
- global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.label7]));
- w18.Position = 0;
- w18.Expand = false;
- w18.Fill = false;
+ global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.label7]));
+ w24.Position = 0;
+ w24.Expand = false;
+ w24.Fill = false;
// Container child vbox4.Gtk.Box+BoxChild
this.notebookTranslated = new global::Gtk.Notebook ();
this.notebookTranslated.CanFocus = true;
this.notebookTranslated.Name = "notebookTranslated";
this.notebookTranslated.CurrentPage = 0;
// Notebook tab
- global::Gtk.Label w19 = new global::Gtk.Label ();
- w19.Visible = true;
- this.notebookTranslated.Add (w19);
+ global::Gtk.Label w25 = new global::Gtk.Label ();
+ w25.Visible = true;
+ this.notebookTranslated.Add (w25);
this.label1 = new global::Gtk.Label ();
this.label1.Name = "label1";
this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("page1");
- this.notebookTranslated.SetTabLabel (w19, this.label1);
+ this.notebookTranslated.SetTabLabel (w25, this.label1);
this.label1.ShowAll ();
this.vbox4.Add (this.notebookTranslated);
- global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.notebookTranslated]));
- w20.Position = 1;
+ global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.notebookTranslated]));
+ w26.Position = 1;
this.table1.Add (this.vbox4);
- global::Gtk.Table.TableChild w21 = ((global::Gtk.Table.TableChild)(this.table1 [this.vbox4]));
- w21.TopAttach = ((uint)(1));
- w21.BottomAttach = ((uint)(2));
- w21.XOptions = ((global::Gtk.AttachOptions)(4));
- w21.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w27 = ((global::Gtk.Table.TableChild)(this.table1 [this.vbox4]));
+ w27.TopAttach = ((uint)(1));
+ w27.BottomAttach = ((uint)(2));
+ w27.XOptions = ((global::Gtk.AttachOptions)(4));
+ w27.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
this.vbox5 = new global::Gtk.VBox ();
this.vbox5.Name = "vbox5";
@@ -252,8 +367,8 @@ namespace MonoDevelop.Gettext
this.label8.Xalign = 0F;
this.label8.LabelProp = global::Mono.Unix.Catalog.GetString ("Original (msgid):");
this.hbox3.Add (this.label8);
- global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.label8]));
- w22.Position = 0;
+ global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.label8]));
+ w28.Position = 0;
// Container child hbox3.Gtk.Box+BoxChild
this.checkbuttonWhiteSpaces = new global::Gtk.CheckButton ();
this.checkbuttonWhiteSpaces.CanFocus = true;
@@ -262,22 +377,22 @@ namespace MonoDevelop.Gettext
this.checkbuttonWhiteSpaces.DrawIndicator = true;
this.checkbuttonWhiteSpaces.UseUnderline = true;
this.hbox3.Add (this.checkbuttonWhiteSpaces);
- global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.checkbuttonWhiteSpaces]));
- w23.Position = 1;
- w23.Expand = false;
+ global::Gtk.Box.BoxChild w29 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.checkbuttonWhiteSpaces]));
+ w29.Position = 1;
+ w29.Expand = false;
this.vbox5.Add (this.hbox3);
- global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hbox3]));
- w24.Position = 0;
- w24.Expand = false;
- w24.Fill = false;
+ global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hbox3]));
+ w30.Position = 0;
+ w30.Expand = false;
+ w30.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
this.scrolledwindowOriginal = new global::Gtk.ScrolledWindow ();
this.scrolledwindowOriginal.CanFocus = true;
this.scrolledwindowOriginal.Name = "scrolledwindowOriginal";
this.scrolledwindowOriginal.ShadowType = ((global::Gtk.ShadowType)(1));
this.vbox5.Add (this.scrolledwindowOriginal);
- global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.scrolledwindowOriginal]));
- w25.Position = 1;
+ global::Gtk.Box.BoxChild w31 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.scrolledwindowOriginal]));
+ w31.Position = 1;
// Container child vbox5.Gtk.Box+BoxChild
this.vbox8 = new global::Gtk.VBox ();
this.vbox8.Name = "vbox8";
@@ -288,21 +403,21 @@ namespace MonoDevelop.Gettext
this.label9.Xalign = 0F;
this.label9.LabelProp = global::Mono.Unix.Catalog.GetString ("Original plural (msgid_plural):");
this.vbox8.Add (this.label9);
- global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.vbox8 [this.label9]));
- w26.Position = 0;
- w26.Expand = false;
- w26.Fill = false;
+ global::Gtk.Box.BoxChild w32 = ((global::Gtk.Box.BoxChild)(this.vbox8 [this.label9]));
+ w32.Position = 0;
+ w32.Expand = false;
+ w32.Fill = false;
// Container child vbox8.Gtk.Box+BoxChild
this.scrolledwindowPlural = new global::Gtk.ScrolledWindow ();
this.scrolledwindowPlural.CanFocus = true;
this.scrolledwindowPlural.Name = "scrolledwindowPlural";
this.scrolledwindowPlural.ShadowType = ((global::Gtk.ShadowType)(1));
this.vbox8.Add (this.scrolledwindowPlural);
- global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.vbox8 [this.scrolledwindowPlural]));
- w27.Position = 1;
+ global::Gtk.Box.BoxChild w33 = ((global::Gtk.Box.BoxChild)(this.vbox8 [this.scrolledwindowPlural]));
+ w33.Position = 1;
this.vbox5.Add (this.vbox8);
- global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.vbox8]));
- w28.Position = 2;
+ global::Gtk.Box.BoxChild w34 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.vbox8]));
+ w34.Position = 2;
this.table1.Add (this.vbox5);
// Container child table1.Gtk.Table+TableChild
this.vbox6 = new global::Gtk.VBox ();
@@ -315,10 +430,10 @@ namespace MonoDevelop.Gettext
this.label4.LabelProp = global::Mono.Unix.Catalog.GetString ("F_ound in:");
this.label4.UseUnderline = true;
this.vbox6.Add (this.label4);
- global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.label4]));
- w30.Position = 0;
- w30.Expand = false;
- w30.Fill = false;
+ global::Gtk.Box.BoxChild w36 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.label4]));
+ w36.Position = 0;
+ w36.Expand = false;
+ w36.Fill = false;
// Container child vbox6.Gtk.Box+BoxChild
this.scrolledwindow2 = new global::Gtk.ScrolledWindow ();
this.scrolledwindow2.CanFocus = true;
@@ -330,20 +445,20 @@ namespace MonoDevelop.Gettext
this.treeviewFoundIn.Name = "treeviewFoundIn";
this.scrolledwindow2.Add (this.treeviewFoundIn);
this.vbox6.Add (this.scrolledwindow2);
- global::Gtk.Box.BoxChild w32 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.scrolledwindow2]));
- w32.Position = 1;
+ global::Gtk.Box.BoxChild w38 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.scrolledwindow2]));
+ w38.Position = 1;
this.table1.Add (this.vbox6);
- global::Gtk.Table.TableChild w33 = ((global::Gtk.Table.TableChild)(this.table1 [this.vbox6]));
- w33.LeftAttach = ((uint)(1));
- w33.RightAttach = ((uint)(2));
- w33.XOptions = ((global::Gtk.AttachOptions)(4));
- w33.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w39 = ((global::Gtk.Table.TableChild)(this.table1 [this.vbox6]));
+ w39.LeftAttach = ((uint)(1));
+ w39.RightAttach = ((uint)(2));
+ w39.XOptions = ((global::Gtk.AttachOptions)(4));
+ w39.YOptions = ((global::Gtk.AttachOptions)(4));
this.vpaned2.Add (this.table1);
- global::Gtk.Paned.PanedChild w34 = ((global::Gtk.Paned.PanedChild)(this.vpaned2 [this.table1]));
- w34.Resize = false;
+ global::Gtk.Paned.PanedChild w40 = ((global::Gtk.Paned.PanedChild)(this.vpaned2 [this.table1]));
+ w40.Resize = false;
this.vbox7.Add (this.vpaned2);
- global::Gtk.Box.BoxChild w35 = ((global::Gtk.Box.BoxChild)(this.vbox7 [this.vpaned2]));
- w35.Position = 1;
+ global::Gtk.Box.BoxChild w41 = ((global::Gtk.Box.BoxChild)(this.vbox7 [this.vpaned2]));
+ w41.Position = 1;
this.notebookPages.Add (this.vbox7);
// Notebook tab
this.label5 = new global::Gtk.Label ();
@@ -352,8 +467,8 @@ namespace MonoDevelop.Gettext
this.notebookPages.SetTabLabel (this.vbox7, this.label5);
this.label5.ShowAll ();
this.vbox2.Add (this.notebookPages);
- global::Gtk.Box.BoxChild w37 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.notebookPages]));
- w37.Position = 0;
+ global::Gtk.Box.BoxChild w43 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.notebookPages]));
+ w43.Position = 0;
// Container child vbox2.Gtk.Box+BoxChild
this.hbox1 = new global::Gtk.HBox ();
this.hbox1.Name = "hbox1";
@@ -366,19 +481,19 @@ namespace MonoDevelop.Gettext
this.toolbarPages.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0));
this.toolbarPages.IconSize = ((global::Gtk.IconSize)(3));
this.hbox1.Add (this.toolbarPages);
- global::Gtk.Box.BoxChild w38 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.toolbarPages]));
- w38.Position = 0;
+ global::Gtk.Box.BoxChild w44 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.toolbarPages]));
+ w44.Position = 0;
// Container child hbox1.Gtk.Box+BoxChild
this.progressbar1 = new global::Gtk.ProgressBar ();
this.progressbar1.Name = "progressbar1";
this.hbox1.Add (this.progressbar1);
- global::Gtk.Box.BoxChild w39 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.progressbar1]));
- w39.Position = 1;
+ global::Gtk.Box.BoxChild w45 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.progressbar1]));
+ w45.Position = 1;
this.vbox2.Add (this.hbox1);
- global::Gtk.Box.BoxChild w40 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1]));
- w40.Position = 1;
- w40.Expand = false;
- w40.Fill = false;
+ global::Gtk.Box.BoxChild w46 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1]));
+ w46.Position = 1;
+ w46.Expand = false;
+ w46.Fill = false;
this.Add (this.vbox2);
if ((this.Child != null)) {
this.Child.ShowAll ();
diff --git a/main/src/addins/MonoDevelop.Gettext/gtk-gui/generated.cs b/main/src/addins/MonoDevelop.Gettext/gtk-gui/generated.cs
index 75935e2e55..886fd2e124 100644
--- a/main/src/addins/MonoDevelop.Gettext/gtk-gui/generated.cs
+++ b/main/src/addins/MonoDevelop.Gettext/gtk-gui/generated.cs
@@ -17,6 +17,7 @@ namespace Stetic
internal class BinContainer
{
private Gtk.Widget child;
+
private Gtk.UIManager uimanager;
public static BinContainer Attach (Gtk.Bin bin)
@@ -58,7 +59,8 @@ namespace Stetic
if ((this.uimanager != null)) {
Gtk.Widget w;
w = this.child.Toplevel;
- if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) {
+ if (((w != null)
+ && typeof(Gtk.Window).IsInstanceOfType (w))) {
((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup);
this.uimanager = null;
}
diff --git a/main/src/addins/MonoDevelop.Gettext/gtk-gui/gui.stetic b/main/src/addins/MonoDevelop.Gettext/gtk-gui/gui.stetic
index b9c986485f..9c7797d417 100644
--- a/main/src/addins/MonoDevelop.Gettext/gtk-gui/gui.stetic
+++ b/main/src/addins/MonoDevelop.Gettext/gtk-gui/gui.stetic
@@ -617,7 +617,7 @@
<property name="Events">ButtonPressMask</property>
<property name="GeneratePublic">False</property>
<property name="Title" translatable="yes">Create New Localization</property>
- <property name="Icon">resource:locale_16x16.png</property>
+ <property name="Icon">resource:locale-16.png</property>
<property name="TypeHint">Dialog</property>
<property name="WindowPosition">CenterOnParent</property>
<property name="Modal">True</property>
@@ -1320,10 +1320,39 @@
<widget class="Gtk.ToggleButton" id="togglebuttonOk">
<property name="MemberName" />
<property name="CanFocus">True</property>
- <property name="Type">TextAndIcon</property>
- <property name="Icon">resource:silk_accept.png</property>
- <property name="Label" translatable="yes">Valid</property>
- <property name="UseUnderline">True</property>
+ <property name="Type">Custom</property>
+ <child>
+ <widget class="Gtk.HBox" id="togglebuttonOkHbox">
+ <property name="MemberName" />
+ <property name="Spacing">2</property>
+ <child>
+ <widget class="MonoDevelop.Components.ImageView" id="togglebuttonOkIcon">
+ <property name="MemberName" />
+ <property name="IconId">md-done</property>
+ <property name="IconSize">Menu</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="togglebuttonOkLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">Valid</property>
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
</widget>
<packing>
<property name="Position">2</property>
@@ -1336,10 +1365,39 @@
<widget class="Gtk.ToggleButton" id="togglebuttonMissing">
<property name="MemberName" />
<property name="CanFocus">True</property>
- <property name="Type">TextAndIcon</property>
- <property name="Icon">resource:silk_exclamation.png</property>
- <property name="Label" translatable="yes">Missing</property>
- <property name="UseUnderline">True</property>
+ <property name="Type">Custom</property>
+ <child>
+ <widget class="Gtk.HBox" id="togglebuttonMissingHbox">
+ <property name="MemberName" />
+ <property name="Spacing">2</property>
+ <child>
+ <widget class="MonoDevelop.Components.ImageView" id="togglebuttonMissingIcon">
+ <property name="MemberName" />
+ <property name="IconId">md-warning</property>
+ <property name="IconSize">Menu</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="togglebuttonMissingLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">Missing</property>
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
</widget>
<packing>
<property name="Position">3</property>
@@ -1352,10 +1410,39 @@
<widget class="Gtk.ToggleButton" id="togglebuttonFuzzy">
<property name="MemberName" />
<property name="CanFocus">True</property>
- <property name="Type">TextAndIcon</property>
- <property name="Icon">resource:silk_error.png</property>
- <property name="Label" translatable="yes">Fuzzy</property>
- <property name="UseUnderline">True</property>
+ <property name="Type">Custom</property>
+ <child>
+ <widget class="Gtk.HBox" id="togglebuttonFuzzyHbox">
+ <property name="MemberName" />
+ <property name="Spacing">2</property>
+ <child>
+ <widget class="MonoDevelop.Components.ImageView" id="togglebuttonFuzzyIcon">
+ <property name="MemberName" />
+ <property name="IconId">md-error</property>
+ <property name="IconSize">Menu</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="togglebuttonFuzzyLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">Fuzzy</property>
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
</widget>
<packing>
<property name="Position">4</property>
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/done-16.png b/main/src/addins/MonoDevelop.Gettext/icons/done-16.png
deleted file mode 100644
index 7799066c43..0000000000
--- a/main/src/addins/MonoDevelop.Gettext/icons/done-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/done-16@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/done-16@2x.png
deleted file mode 100644
index c63d3974d1..0000000000
--- a/main/src/addins/MonoDevelop.Gettext/icons/done-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/error-16.png b/main/src/addins/MonoDevelop.Gettext/icons/error-16.png
deleted file mode 100644
index 30b5da6e9b..0000000000
--- a/main/src/addins/MonoDevelop.Gettext/icons/error-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/error-16@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/error-16@2x.png
deleted file mode 100644
index adfd2b7b19..0000000000
--- a/main/src/addins/MonoDevelop.Gettext/icons/error-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16.png b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16.png
new file mode 100644
index 0000000000..b1bd5ba34e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16@2x.png
new file mode 100644
index 0000000000..fe4f9501c5
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~dark.png b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~dark.png
new file mode 100644
index 0000000000..d2262d4db0
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~dark@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~dark@2x.png
new file mode 100644
index 0000000000..727ba616af
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~dark~sel.png b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~dark~sel.png
new file mode 100644
index 0000000000..40022bb616
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~dark~sel@2x.png
new file mode 100644
index 0000000000..8581ac664e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~sel.png b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~sel.png
new file mode 100644
index 0000000000..df213b8ce3
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~sel@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~sel@2x.png
new file mode 100644
index 0000000000..5d4cc57947
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32.png b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32.png
new file mode 100644
index 0000000000..fe4f9501c5
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32@2x.png
new file mode 100644
index 0000000000..81c72637be
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~dark.png b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~dark.png
new file mode 100644
index 0000000000..727ba616af
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~dark@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~dark@2x.png
new file mode 100644
index 0000000000..1475f47e80
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~dark~sel.png b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~dark~sel.png
new file mode 100644
index 0000000000..8581ac664e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~dark~sel@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~dark~sel@2x.png
new file mode 100644
index 0000000000..1d028da49c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~sel.png b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~sel.png
new file mode 100644
index 0000000000..5d4cc57947
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~sel@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~sel@2x.png
new file mode 100644
index 0000000000..34a8ad6b78
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/file-locale-32~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/gettext-overlay-16.png b/main/src/addins/MonoDevelop.Gettext/icons/gettext-overlay-16.png
deleted file mode 100644
index 728c2a3e96..0000000000
--- a/main/src/addins/MonoDevelop.Gettext/icons/gettext-overlay-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/gettext-overlay-32.png b/main/src/addins/MonoDevelop.Gettext/icons/gettext-overlay-32.png
deleted file mode 100644
index 9fc3638ad5..0000000000
--- a/main/src/addins/MonoDevelop.Gettext/icons/gettext-overlay-32.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/locale-16.png b/main/src/addins/MonoDevelop.Gettext/icons/locale-16.png
new file mode 100644
index 0000000000..55c0d46d39
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/locale-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/locale-16@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/locale-16@2x.png
new file mode 100644
index 0000000000..300f1af1b9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/locale-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/locale-16~dark.png b/main/src/addins/MonoDevelop.Gettext/icons/locale-16~dark.png
new file mode 100644
index 0000000000..b3e94dcae9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/locale-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/locale-16~dark@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/locale-16~dark@2x.png
new file mode 100644
index 0000000000..b2fe7e006e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/locale-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/locale-16~dark~sel.png b/main/src/addins/MonoDevelop.Gettext/icons/locale-16~dark~sel.png
new file mode 100644
index 0000000000..4f3888b3b2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/locale-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/locale-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/locale-16~dark~sel@2x.png
new file mode 100644
index 0000000000..df2816f8b2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/locale-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/locale-16~sel.png b/main/src/addins/MonoDevelop.Gettext/icons/locale-16~sel.png
new file mode 100644
index 0000000000..4f3888b3b2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/locale-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/locale-16~sel@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/locale-16~sel@2x.png
new file mode 100644
index 0000000000..df2816f8b2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/locale-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/locale-project.png b/main/src/addins/MonoDevelop.Gettext/icons/locale-project.png
new file mode 100644
index 0000000000..c031aa8bf6
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/locale-project.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/locale-project@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/locale-project@2x.png
new file mode 100644
index 0000000000..b5c0bb6b6a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/locale-project@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/locale-project~dark.png b/main/src/addins/MonoDevelop.Gettext/icons/locale-project~dark.png
new file mode 100644
index 0000000000..366bea4021
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/locale-project~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/locale-project~dark@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/locale-project~dark@2x.png
new file mode 100644
index 0000000000..4c9297d0ff
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/locale-project~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/locale_16x16.png b/main/src/addins/MonoDevelop.Gettext/icons/locale_16x16.png
deleted file mode 100644
index 6479612f33..0000000000
--- a/main/src/addins/MonoDevelop.Gettext/icons/locale_16x16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/locale_22x22.png b/main/src/addins/MonoDevelop.Gettext/icons/locale_22x22.png
deleted file mode 100644
index 38b36b48c3..0000000000
--- a/main/src/addins/MonoDevelop.Gettext/icons/locale_22x22.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/locale_32x32.png b/main/src/addins/MonoDevelop.Gettext/icons/locale_32x32.png
deleted file mode 100644
index 608a0b1e95..0000000000
--- a/main/src/addins/MonoDevelop.Gettext/icons/locale_32x32.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16.png b/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16.png
index 19f2663360..87f2953c12 100644
--- a/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16.png
+++ b/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16@2x.png
index 1e4d00deb6..d5e0271f66 100644
--- a/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16@2x.png
+++ b/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~dark.png b/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~dark.png
new file mode 100644
index 0000000000..778eac0789
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~dark@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~dark@2x.png
new file mode 100644
index 0000000000..7ac3c2cd5a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~dark~sel.png b/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~dark~sel.png
new file mode 100644
index 0000000000..6038f48200
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~dark~sel@2x.png
new file mode 100644
index 0000000000..b2fb37ecd9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~sel.png b/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~sel.png
new file mode 100644
index 0000000000..6038f48200
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~sel@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~sel@2x.png
new file mode 100644
index 0000000000..b2fb37ecd9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/prefs-language-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16.png b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16.png
new file mode 100644
index 0000000000..3f7b1d0dec
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16@2x.png
new file mode 100644
index 0000000000..10d033c51d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~dark.png b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~dark.png
new file mode 100644
index 0000000000..8dfe4e7979
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~dark@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~dark@2x.png
new file mode 100644
index 0000000000..f0a7407bcd
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~dark~sel.png b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~dark~sel.png
new file mode 100644
index 0000000000..8bc5219cdd
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~dark~sel@2x.png
new file mode 100644
index 0000000000..5b7cc657e1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~sel.png b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~sel.png
new file mode 100644
index 0000000000..8bc5219cdd
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~sel@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~sel@2x.png
new file mode 100644
index 0000000000..5b7cc657e1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32.png b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32.png
new file mode 100644
index 0000000000..e8865b78d7
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32@2x.png
new file mode 100644
index 0000000000..1ad3730d21
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~dark.png b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~dark.png
new file mode 100644
index 0000000000..03370c8a93
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~dark@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~dark@2x.png
new file mode 100644
index 0000000000..e372e05d81
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~dark~sel.png b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~dark~sel.png
new file mode 100644
index 0000000000..8d7eec7d91
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~dark~sel@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~dark~sel@2x.png
new file mode 100644
index 0000000000..698371647b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~sel.png b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~sel.png
new file mode 100644
index 0000000000..8d7eec7d91
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~sel@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~sel@2x.png
new file mode 100644
index 0000000000..698371647b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Gettext/icons/project-locale-overlay-32~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/warning-16.png b/main/src/addins/MonoDevelop.Gettext/icons/warning-16.png
deleted file mode 100644
index 36e3484d08..0000000000
--- a/main/src/addins/MonoDevelop.Gettext/icons/warning-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/icons/warning-16@2x.png b/main/src/addins/MonoDevelop.Gettext/icons/warning-16@2x.png
deleted file mode 100644
index c457998b0a..0000000000
--- a/main/src/addins/MonoDevelop.Gettext/icons/warning-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Gettext/templates/TranslationProject.xpt.xml b/main/src/addins/MonoDevelop.Gettext/templates/TranslationProject.xpt.xml
index b2abd26391..05613c9a30 100644
--- a/main/src/addins/MonoDevelop.Gettext/templates/TranslationProject.xpt.xml
+++ b/main/src/addins/MonoDevelop.Gettext/templates/TranslationProject.xpt.xml
@@ -5,7 +5,8 @@
<TemplateConfiguration>
<_Name>Translation Project</_Name>
<Category>other/misc/generic</Category>
- <Icon>md-project|res:gettext-overlay-32.png</Icon>
+ <Icon>md-project-locale</Icon>
+ <Image id="md-locale-project" />
<_Description>Creates a translation project.</_Description>
<DefaultFilename>TranslationProject</DefaultFilename>
<FileExtension>.mdproj</FileExtension>
diff --git a/main/src/addins/MonoDevelop.GtkCore/ChangeLog b/main/src/addins/MonoDevelop.GtkCore/ChangeLog
deleted file mode 100644
index a2652e2c37..0000000000
--- a/main/src/addins/MonoDevelop.GtkCore/ChangeLog
+++ /dev/null
@@ -1,2796 +0,0 @@
-2010-07-22 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.GtkCore.csproj: Added System.Core reference for
- windows.
-
-2010-07-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- Track ProjectDomService/Parser API.
-
-2010-07-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Track
- API changes.
-
-2010-06-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: Don't offer
- the gtk feature if gtk# is not installed in the active
- runtime. Fixes bug #608052 - The New Solution wizard throws
- an exception after choosing project features.
-
-2010-05-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- * MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs:
- * MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs:
- More dialog placing.
-
-2010-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- Converted some static fields which don't need to be static
- into local vars.
-
-2010-05-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Track
- API.
-
-2010-04-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Track
- AddFilesToProject API.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs:
- ViewContent widgets are now destroyed by the workspace
- window.
-
-
-2010-04-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: call
- destroy on the container vbox during
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs: Found better work
- around for the "gnome-sharp" reference issue.
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs: Fixed 'Bug 599335 -
- Error CS0433: The imported type `Gtk.DeleteEventArgs' is
- defined multiple times (CS0433)'.
-
-2010-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Added
- null check.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.GtkCore.addin.xml: Bumped MD version.
-
-2010-03-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Use the
- stock Visual Design layout as layout for stetic.
-
-2010-03-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Fix
- race in SteticApp initialization.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.GtkCore.csproj:
- * MonoDevelop.GtkCore.addin.xml:
- * MonoDevelop.GtkCore/GtkDesignInfo.cs:
- * MonoDevelop.GtkCore/ReferenceManager.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs:
- * MonoDevelop.GtkCore/ProjectResourceProvider.cs:
- * MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs:
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs:
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs:
- * MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs:
- * MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs:
- * MonoDevelop.GtkCore.Dialogs/GtkDesignerOptionsPanelWidget.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- Merged MD.Projects into MD.Core, and MD.Projects.Gui,
- MD.Core.Gui and MD.Components into MD.Ide.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs:
- Track api changes.
-
-2010-02-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs:
- Track API changes for lazy loading images.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: Track api
- changes.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.GtkCore.Dialogs.GtkDesignerOptionsPanelWidget.cs:
- Flush.
-
-2010-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- Track DisplayBinding API.
-
-2010-01-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.GtkCore.csproj:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Format
- generated files using the MD formatter to ensure that the
- generated text is the same for al platforms and
- environments.
-
- * gtk-gui/gui.stetic: Use global:: for type references in
- generated code.
-
-2009-12-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- Implement SupportsItem.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: When
- adding a stock gtk widget to a window there is no need to
- update the references. Fixes bug #565492.
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.GtkCore.Dialogs.GtkDesignerOptionsPanelWidget.cs:
- Flush.
-
-2009-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- Introduced the ConfigurationSelector class to all methods
- that previously took a configuration name as string. This
- eliminates the ambiguity between solution configuration
- names and project configuration names.
-
-2009-11-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders\WindowsFolder.cs:
- Implemented Equals/GetHashCode. Fixes bug #549902 - MD
- crashes when adding a new gtk form.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.GtkCore.addin.xml: Bump MD version.
-
-2009-10-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * MonoDevelop.GtkCore.csproj:
- * gtk-gui/MonoDevelop.GtkCore.Dialogs.GtkDesignerOptionsPanelWidget.cs:
- Flush.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Use
- typed collection instead of ArrayList.
-
-2009-10-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs:
- Handled icon loading failures.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.GtkCore.addin.xml: Bump MD version.
-
-2009-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Route
- commands to the text editor view. Fixes bug #536740 -
- Expression evaluator unnecessarily in context menu.
-
-2009-09-09 Christian Hergert <chris@dronelabs.com>
-
- * libstetic/editor/Accelerator.cs:
- * libstetic/editor/GroupPicker.cs:
- * libstetic/editor/TextEditor.cs:
- * libstetic/editor/SelectImageDialog.cs:
- * libstetic/editor/NonContainerWarningDialog.cs:
- * libstetic/editor/TextEditorDialog.cs:
- * libstetic/editor/EditIconDialog.cs:
- * libstetic/editor/IconSelectorMenu.cs:
- * libstetic/editor/Image.cs:
- * libstetic/editor/ActionGroupEditor.cs:
- * libstetic/editor/StringArray.cs:
- * libstetic/editor/EditIconFactoryDialog.cs:
- * libstetic/editor/SelectIconDialog.cs:
- * MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs:
- * MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs:
- * MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Fixes to
- make windows and dialogs Transient to either their parent
- window/dialog or the MD root window (when applicable).
-
-2009-09-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/ProjectResourceProvider.cs: Use real
- resource Ids instead of file names. Fixes bug #528309 -
- Button Icons are not displayed.
-
-2009-09-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs: Store the
- GuiBuilderProject on which the ChangedEvent was subscribed,
- and use that reference when unsubscribing on Dispose. This
- is required because the GuiBuilderProject bound to a project
- may change. Fixes bug #525421 - Removing gtk-sharp reference
- from a project causes it to not function properly.
-
-2009-08-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Don't use the text editor
- display binding id as reference for registering the designer
- view. Use DefaultDisplayBinding instead. Removed unused
- supportedFormats attribute.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.csproj: Updated dependencies. We now
- depend on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- Added support for saving and restoring the status of the
- designer, including the undo queue. This allows implenting
- ISupportsProjectReload.
-
-2009-08-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/FolderNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/GuiBuilderProjectNodeBuilder.cs:
- Remove unused files.
-
-2009-08-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Use the
- new AssemblyContext class to query and resolve assemblies.
-
-2009-08-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.GtkCore.csproj:
- * MonoDevelop.GtkCore/Counters.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Added
- some performance counters.
-
-2009-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDocumentOutline.cs:
- Track api changes.
-
-2009-07-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: No more
- missing IntPtr constructor exceptions.
-
-2009-06-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/ProjectResourceProvider.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Use the
- new DesktopService instead of PlatformService.
-
-2009-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Track
- assembly lookup APIs.
-
-2009-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore\ProjectResourceProvider.cs:
- GetMimeTypeForUri doesn't really support uris.
-
-2009-06-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs:
- GetGtkAssemblyVersion is expected to return the version and
- token, not only the version.
-
-2009-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore\ReferenceManager.cs: Don't get the
- package version from the gtk# package. Instead, get it from
- the first version numbers of the gtk-sharp assembly. That's
- necessary because in windows there is no gtk# package.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs:
- Workaround for what seems to be a mcs bug. Looks like it
- can't properly resolve the implicit conversion of null to
- string.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore\GtkDesignInfo.cs:
- * MonoDevelop.GtkCore.GuiBuilder\GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder\GuiBuilderProject.cs: Use the
- new FilePath class for handling file and directory paths.
-
-2009-05-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Don't
- create a new drop target list. Use the one defined by
- Stetic.
-
-2009-04-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.csproj: Don't require a specific gtk#
- version.
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: gui designer is now before
- the text editor (wrong text editor id).
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- Track API changes.
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- Track API changes.
-
-2009-04-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs: Remove vte-sharp
- from the gnome libs list, since it now has its own package.
-
-2009-04-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Track
- API changes.
-
-2009-04-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs:
- Removed unused namespace.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs:
- * MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs:
- Renamed PixbufService to ImageService.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs:
- * MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs:
- Track API changes.
-
-2009-04-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs: Moved
- SystemAssemblyService and related classes to the namespace
- MonoDevelop.Core.Assemblies.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.GtkCore.addin.xml: Bump MD version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs:
- * MonoDevelop.GtkCore/ReferenceManager.cs:
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs:
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: Add
- support for multiple target runtimes.
-
-2009-03-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- Track API changes.
-
-2009-03-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: When the stetic files
- are generated for the first time, ensure that their write
- date is < the write date of the .stetic file, otherwise they
- won't be regenerated when building. Fixes bug #483970 -
- [Regression] Default C# Gtk# app no longer builds.
-
-2009-03-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Flush.
-
-2009-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- Don't try to generate files when not building inside the
- IDE.
-
-2009-02-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: In
- ForceCodeGenerationOnBuild, force a rebuild of the project
- too. Fixes bug #472683.
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.csproj: Flush.
-
-2009-02-26 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/ProjectResourcesProvider.cs: lookup mime
- type and use more specific ResourceInfo ctor. [Fixes #475820]
-
-2009-02-26 Mike Kestner <mkestner@novell.com>
-
- * libsteticui/WidgetDesignerBackend.cs: implement Delete key
- support. [Fixes #470637]
-
-2009-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Added
- explicit "Misc" category for localization.
-
-2009-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Worked on
- propertygrid localization.
-
-2009-02-25 Mike Kestner <mkestner@novell.com>
-
- * libsteticui/ApplicationBackend.cs: Reload the registry libraries
- in LoadLibraries, since adding a library doesn't necessarily refresh
- an out-of-date previously registered library.
- * libsteticui/CecilWidgetLibrary.cs: enhance NeedsReload check to
- use a cache refresh and the new change notification so that the
- library stays 'dirty' until it's reloaded.
- * libsteticui/LibraryCache.cs: add change notification for cache items.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: do an update
- of the steticapp libs even if the list hasn't changed in case the
- contents of any of them have changed.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: check for
- 'dirty' references when regenerating code. [Fixes #472683]
-
-2009-02-24 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: only touch the design file
- when forcing rebuilds.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: don't regen
- if design file and generated files have equal timestamps to avoid
- regenerations on fresh checkouts. [#478894]
-
-2009-02-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml:
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs:
- Track merge of the project pad context menu.
-
-2009-02-18 Mike Kestner <mkestner@novell.com>
-
- * libstetic/wrapper/ScrolledWindow.cs: when the child viewport itself
- is being replaced, don't try to remove the viewport from itself.
- * libstetic/wrapper/Viewport.cs: add case for when placeholders are
- being replaced by scrollable widgets to insert the new child directly
- into the parent scrolled window. [Fixes #404861]
-
-2009-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: Fix
- crash when the project's gtk# is not installed.
-
-2009-02-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.csproj: Set correct resource name for
- DrawingArea template.
-
-2009-02-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Track api
- changes.
-
-2009-02-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Fix build. Looks like the makefiles can't cope
- with resources with IDs.
-
-2009-02-13 Mike Kestner <mkestner@novell.com>
-
- * Makefile.am: add template resource
- * MonoDevelop.GtkCore.addin.xml: ditto.
- * templates/DrawingArea.xft.xml: new DrawingArea subclass template
- with stubs for OnExposeEvent, OnButtonPressEvent, OnSizeRequested,
- OnSizeAllocated, and ctor. Helps speed up the development of custom
- drawn widgets. [Fixes #472665]
-
-2009-02-11 Mike Kestner <mkestner@novell.com>
-
- * libstetic/Registry.cs: account for reloading of the coreLib,
- since this can happen when dogfooding MD. [Fixes #365983]
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.csproj: Remove a local-copy ref.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mds:
- * MonoDevelop.GtkCore.mdp:
- * MonoDevelop.GtkCore.csproj: Migrated to MSBuild file format.
-
-2009-02-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * MonoDevelop.GtkCore.mdp:
- * MonoDevelop.GtkCore.addin.xml:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.Dialogs/GtkDesignerOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.GtkCore.Dialogs.GtkDesignerOptionsPanelWidget.cs:
- Added option for enabling/disabling auto-switch of the GUI
- builder layout. Disabled from now on by default.
-
-2009-02-04 Mike Kestner <mkestner@novell.com>
-
- * libstetic/wrapper/objects.xml: explicit default values for Table
- NRows and NCols values so they don't default to 1. Fixes #471242.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.GtkCore.addin.xml: Bump MD version.
-
-2009-02-02 Mike Kestner <mkestner@novell.com>
-
- * libstetic/PropertyDescriptor.cs: null guard the ValueToString
- formatting for string arrays.
-
-2009-02-02 Mike Kestner <mkestner@novell.com>
-
- * libstetic/PropertyDescriptor.cs: handle empty string lists
- * libstetic/wrapper/ComboBox.cs: some more null guarding for Items.
- [Fixes #471244]
-
-2009-01-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: Propagate a
- policy parent SolutionItem through project/file creation so that
- policies can always be resolved correctly.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.mdp:
- * libsteticui/libsteticui.mdp: Flush project format changes.
-
-2009-01-26 Mike Kestner <mkestner@novell.com>
-
- * libstetic/wrapper/ActionTree.cs: guard against removing unsaved
- actions. [Fixes #443472]
-
-2009-01-22 Mike Kestner <mkestner@novell.com>
-
- * libstetic/editor/StringArray.cs: display "(Collection)" in the
- label instead of a joined list on \n which displays garbage chars.
- This approach is consistent with another very popular IDE. ;-)
- * libstetic/wrapper/objects.xml: use Editor.StringArray for the Items
- property of ComboBox.
- * libstetic/wrapper/ComboBox.cs: switch Items to a string[]. Luckily
- this is backwards compat since we currently saved string[] as a newline
- join of the member strings. [Fixes #405396]
-
-2009-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Don't serialize the GtkDesignInfo
- element when it is empty.
-
-2009-01-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Added missing
- nullref check.
-
-2009-01-13 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: adds a
- FileAddedToProject handler which scans the file for classes and
- checks the deleted-designs cache for matches to restore to the
- project.
-
-2009-01-13 Mike Kestner <mkestner@novell.com>
-
- * libsteticui/ProjectBackend.cs (RemoveWidget): export the widget
- to a deleted-designs dir for later recovery if necessary. Should
- also decide on some cleanup mechanism to remove old designs and
- automate recovery in the move case if possible. Or we can wait for
- 1wpf which should solve the move case more cleanly.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: reenable
- OnFileRemovedFromProject handler. Revamp to use a ParseDocument of
- the removed file to scan for removed classes to kill.
- [Fixes #366392]
-
-2009-01-09 Mike Kestner <mkestner@novell.com>
-
- * libsteticui/Project.cs: forward isInternal to the backend in
- AddWidgetLibrary.
-
-2009-01-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * libsteticui/LibraryCache.cs: Don't ignore internal classes when
- looking for widgets. If a widget is internal, set the "internal" flag
- to true. Don't abort AddObjects if there is an assembly resolution
- error.
-
-2009-01-08 Mike Kestner <mkestner@novell.com>
-
- * libsteticui/LibraryCache.cs : delay cache directory creation until
- files are going to be written to it.
-
-2009-01-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * libsteticui/CecilWidgetLibrary.cs: Don't try to resolve full assembly
- paths.
-
-2008-12-18 Mike Kestner <mkestner@novell.com>
-
- * libstetic/editor/Flags.cs : fix cs0030 under new mcs.
- * libstetic/editor/FlagsSelectionDialog.cs : fix cs0030 under new mcs.
- * libstetic/editor/ResponseId.cs : fix cs0030 under new mcs.
-
-2008-12-13 Mike Kestner <mkestner@novell.com>
-
- * libstetic/wrapper/Container.cs: generate tooltips based on the target
- version, using the new Tooltip API for >= 2.12. Fixes #372015.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/WidgetParser.cs: Properly search for subclasses of
- Gtk.Widget.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp:
- * libsteticui/libsteticui.mdp: All projects now require fx 3.5.
-
-2008-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Remove the mono
- version number comment from the generated files.
-
-2008-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs: Track API changes.
-
-2008-12-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDocumentOutline.cs: Use an
- Alignment as the concrete Bin instead of custom InvisibleFrame.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Don't require a specific version of
- Mono.Addins.
-
-2008-12-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/WidgetParser.cs: Optimized GetToolboxItems.
-
-2008-12-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/WidgetParser.cs:
- * MonoDevelop.GtkCore/ObjectsDocument.cs: Getting the list of widgets is
- an expensive operation. It shouldn't be a property.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * AssemblyInfo.cs:
- * MonoDevelop.GtkCore.mdp: Add AssemblyInfo.cs files that are
- autogenerated from the addin manifests.
-
-2008-12-01 Mike Kestner <mkestner@novell.com>
-
- * libstetic/wrapper/objects.xml: move ToggleButton ahead of CheckButton
- and add ToggleButton signal item group to CheckButton. Remove toggled
- signal from RadioButton since it inherits it from CheckButton.
- [Fixes #450237]
-
-2008-11-25 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: refactor the default and
- supported version checks into the ReferenceManager, with all the other
- package and assembly code.
- * MonoDevelop.GtkCore/ReferenceManager.cs: refactored default and
- supported version properties.
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: use new api.
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: use new api.
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: use new api.
-
-2008-11-23 Mike Kestner <mkestner@novell.com>
-
- * *: I've typed lib/stetic/libstetic(ui) a few too many times.
-
-2008-11-18 Mike Kestner <mkestner@novell.com>
-
- * */Makefile.am: break the gnome/gconf-sharp dependencies.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: set up
- callbacks to the PlatformService for MIME resolution and showing
- urls.
-
-2008-11-11 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: use the
- new ForceUpdate method on the ProjectDom returned by GetParserContext
- to ensure a fully updated database.
-
-2008-11-11 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: null guarding for
- all the things that can possibly go wrong with the parse in
- GetClass.
-
-2008-11-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Create the
- formInfos list when the project is loaded. This is necessary since
- the list is destroyed when the project is unloaded. Fixes bug #Bug
- 431723 - Cannot build GTK applications with sln format.
-
-2008-11-06 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- revert the context menu changes. Don't show them if the project has no
- gtk-sharp ref, only add the templates to the dialog, per Lluis.
-
-2008-11-06 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- show Add Widget|Window|Dialog|ActionGroup template items in the context
- menu and Add File dialog even when the project has no Gtk# reference.
-
-2008-11-05 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: needed to revert
- the >= to <= change from the 440435 fix since the refmgr is now
- reporting TargetGtkVersion without Version=. oops.
-
-2008-11-05 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs: strip Version= out of
- TargetGtkVersion.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Bump MD version.
-
-2008-10-30 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- switch to a x.y TargetGtkVersion obtained by parsing the gtk-sharp
- reference version. Invert the version comparison in the toolboxitem
- filter. We want toolbox items that are less than the project target
- version, not greater. Fixes #440435.
-
-2008-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Don't notify the
- file has changed unless the changes are saved to disk. Fixes bug
- #430497 - Widget names created in Stetic not available for
- autocomplete.
-
-2008-10-29 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs (ShowPage): only
- regenerate the dummy structure when switching to the source page.
-
-2008-10-28 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs: switch default updating
- to use the current assembly StoredReference version. Avoids problems
- when the stored version has no corresponding installed package.
- Fixes #436246.
-
-2008-10-27 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: don't store
- configuration on Project Save. Avoids a crash due to file availability
- when saving config while loading and it's extraneous since we store
- the config on app exit and it contains no project specific props.
-
-2008-10-22 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs (HasDesignedObjects): guard
- against null projects.
-
-2008-10-21 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs (HasDesignedObjects): don't
- instantiate just to get the SteticFile. Avoids project file garbage.
- [Fixes #436201]
-
-2008-10-21 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: guard against null
- documents returned from parse. I think this is related to the old
- ErrorsDuringCompile check that was commented with the new parser port.
- [Fixes #436998]
-
-2008-10-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: fixed TODO.
-
-2008-10-03 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding:
- rework GetWindow method. now uses the ParsedDocument for a requested
- file to check if any of its types have a GuiBuilderWindow.
- The existing method of walking the project windows list and using
- the ProjectDom database to lookup their file locations is susceptible
- to timing problems due to imcomplete parse databases. This method is
- probably slightly more efficient as well.
-
-2008-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/ProjectResourceProvider.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Track API.
-
-2008-09-23 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: bandaid to
- avoid exceptions when removing non-existent buttons. Fixes #377414.
-
-2008-09-23 Mike Kestner <mkestner@novell.com>
-
- * lib/stetic/libsteticui/CecilWidgetLibrary.cs: don't hold assembly
- reference beyond load operation. Recreate it on each load so we are
- always accessing the current assembly instance. Only access cache
- using filename. Ensure Class description lookups cause spew to
- console.
- * lib/stetic/libsteticui/LibraryCache.cs: enhance the path lookup
- logic in Refresh to avoid some churn on named lookups.
- * lib/stetic/libsteticui/ProjectBackend.cs: reload library if
- necessary before getting component types. Fixes #427334.
-
-2008-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Updated projects.
-
-2008-09-15 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCode.GuiBuilder/GtkProjectServiceExtension.cs:
- add the project stetic file to any generation warnings produced.
- Fixes #373244.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.mdp, lib/libstetic.mdp, lib/gtk-gui/generated.cs,
- gtk-gui/generated.cs: Updated generated code.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs,
- MonoDevelop.GtkCore/WidgetParser.cs: Track api changes.
-
-2008-09-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Changes caused by
- interface changes.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs: Moved
- the extensible tree view to its own directory.
-
-2008-08-27 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/WidgetFileDesciptionTemplate.cs: perform a
- project save after the file insertions and updates. This seems
- suboptimal, since it would probably be better to mark the project
- dirty and let the user save the project, but until we switch to
- one-widget-per-design-file, we probably need to save the project
- automatically to avoid problems.
- Fixes #385712.
-
-2008-08-27 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- Restrict to DotNetProjects and verify ProjectFolders are for DNPs.
- Fixes #412448.
-
-2008-08-22 Mike Kestner <mkestner@novell.com>
-
- Fixes bug #413275 and delays more GtkDesignInfo-related project file
- churn.
- * MonoDevelop.GtkCore/GtkCoreService.cs: init the refmgr on startup.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Remove targetVersion field and
- associated prop. Move reference updating logic to Ref Manager. Target
- Version is now exclusively tracked via reference version by the
- ReferenceManager.
- * MonoDevelop.GtkCore/ReferenceManager.cs: new class to encapsulate all
- reference management behaviors, from responding to user add removes to
- automated updates for designer projects.
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: only show feature
- for projects which support refactoring, since it advertises designer
- support and that's not available without refactoring yet. Use refmgr
- for version updates.
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionsPanel.cs: use refmgr
- for version info and suppress gettext options if no designed objects
- exist.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: use refmgr for
- target version.
-
-2008-08-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs: Remove
- the "resources folder" feature. Resources are now shown in the
- solution tree like any other files. For a detailed explanation see
- "Bug 381430 - [PATCH] Display resource files in main project tree".
-
-2008-08-19 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: revert a silly
- change that was causing explicit paths to be inserted into gui.stetic
- files for gac references. [Fixes #412960]
-
-2008-08-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: fixed issue in
- GetSourceCodeFile.
-
-2008-08-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: fixed some
- possible nullrefs.
-
-2008-08-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.mdp, lib/libsteticui.mdp: re-set project
- references (fix some libstetic.dll not found issue, localcopy ==
- true was missing).
-
-2008-08-18 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: make HasDesignedObjects
- and SupportsDesigner static so that we can defer a few more instance
- creation scenarios.
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs:
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs:
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs:
- Update to new static API.
-
-2008-08-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Add a null
- check.
-
-2008-08-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: fixed possible
- null references in the unload method.
-
-2008-08-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Fix crash when looking for
- designed objects in a project that doesn't support it.
-
-2008-07-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Fixed some
- issues.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs,
- MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Translated
- old code to new dom.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/ObjectsDocument.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Changes for converted
- refactoring infrastructure.
-
-2008-07-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/WidgetParser.cs,
- MonoDevelop.GtkCore/ObjectsDocument.cs,
- MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/ClassUtils.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Worked on code
- completion/new dom.
-
-2008-07-24 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: get paths
- for gac references to simplify the lookup in stetic.
-
-2008-07-23 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- Use HasDesignedObjects not SupportsDesigner.
-
-2008-07-23 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: delay creation of guifolder
- until GuiBuilderProject is accessed. Refactor Bind into a Project
- property to gather all the connect/disconnects together. Add new
- HasDesignedObjects prop for when SupportsDesigner doesn't cut it.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs: use new
- HasDesignedObjects prop.
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs:
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: don't
- need to update the folder for these options any more.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs: get
- GuiBuilderProject from design info directly.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: kill
- BeforeCompile handler and GetGuiBuilderProject method. Use new
- HasDesignedObjects to control code generation.
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs: kill
- GenerateSteticCode field. It was always set to true. Use new
- HasDesignedObjects prop to control generation.
-
-2008-07-22 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Connect to project file
- events and trigger objects.xml updates. Translate a confirm button
- label. Require AddAttribute refactoring.
- * MonoDevelop.GtkCore/ObjectsDocument.cs: new class reinstating some
- old document updating code and adding some new. Inserts ToolBoxItem
- and Category attrs into sources for a first-time "upgrade" to enable
- the attr-sync feature now controlled by a root attribute on the
- document.
- * MonoDevelop.GtkCore/WidgetParser.cs: new class reinstating some
- old parsing code and adding some new. This will become the home
- for all source parsing in the addin. Refactoring to come...
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Add WidgetParser
- prop. Remove Debug spew.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs,
- MonoDevelop.GtkCore/GtkDesignInfo.cs: Moved serialization engine to
- MonoDevelop.Core. Use new syntax for specifying attribute scope.
-
-2008-07-15 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: add an updatingVersion
- state to prevent warning when we are adjusting reference versions.
-
-2008-07-15 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: add a user confirmation for
- disabling the designer on reference removal. Leave the stetic.gui
- and objects.xml files on disk, though we still remove them from the
- project.
-
-2008-07-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Fixed possible
- null reference.
-
-2008-07-10 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs (FromProject): return an
- empty instance for non-DotNetProjects which will report false
- on SupportsDesigner.
-
-2008-07-10 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: Gutted. Moved everything
- that took a Project parameter to GtkDesignInfo. Removed all the
- enable/disable/get info methods replaced by GtkDesignInfo.FromProject.
- Killed all the objects file updating. Moved designer support checks
- to DesignInfo.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Add FromProject static
- method to replace GtkCoreService.GetGtkInfo. Remove ExportedWidgets
- and IsWidgetLibrary functionality. Enable and disable designer based
- on presence of gtk-sharp reference on projects. Refactor/move code
- generation to GuiBuilderProject from UpdateGtkFolder. Kill
- GeneratePartialClasses since it's a simple project property access
- and all users of GtkDesignInfo access it via the project. Moved
- Refactory checks from GtkCoreService to encapsulate SupportsDesigner.
- Fix Reference updating checks for Mono.Posix, since the
- StoredReference returns a simple name for it.
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: switched to
- FromProject api. Killed ExportedWidget handling.
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: removed widget
- library checkbox. s/Gtk#/GTK# for consistency. Updated to new
- DesignInfo API.
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: removed
- all the Exported Widgets and WidgetLibrary tab stuff, simplified to
- a vbox and hand-written to remove glade taint.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- switched to new DesignInfo API.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- switched to new DesignInfo API. moved gui folder file generation
- here instead of DesignInfo iterating over builder properties.
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs:
- Added category mangling for ToolboxItems so that they are placed
- by project.
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs:
- switched to new DesignInfo api.
- * templates/Widget.xft.xml: add ToolboxItem attr.
- * templates/WidgetPartial.xft.xml: add ToolboxItem attr.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Bump MD version.
-
-2008-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Explicitly set the resource ids
- for gui.stetic and objects.xml, since msbuild uses different
- default ids.
-
-2008-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: Track api
- changes.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Merged the extension points for
- project and solution option panels into a single extension point. A
- single extension point will now be used for all kinds of items.
- Extension conditions can be used to make panels visible only for
- some specific item types.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- Replaced ICompilerResult/DefaultCompilerResult/CompilerResults by a
- new BuildResult class, which has owner information at error level,
- so it is possible to know which project generated an error when
- building a solution. Updated Task and TaskService to use the new
- owner information.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs,
- MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs,
- MonoDevelop.GtkCore/ProjectResourceProvider.cs,
- MonoDevelop.GtkCore.addin.xml,
- MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore.mdp,
- MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs,
- MonoDevelop.GtkCore.mds, lib/libsteticui.mdp, lib/libstetic.mdp,
- Makefile.am,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs,
- MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: New project
- model changes.
-
-2008-05-20 Mike Kestner <mkestner@novell.com>
-
- * templates/Widget.xft.xml:
- * templates/WidgetPartial.xft.xml:
- Mark the custom widgets Visible=false to conform to the Gtk convention
- of widgets being shown explicitly. [Fixes #364985]
-
-2008-05-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Track API. Mark up
- for property grid.
-
-2008-05-13 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: use new
- Stetic.ApplicationFactory api.
-
-2008-05-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Track API.
-
-2008-04-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp, gtk-gui,
- gtk-gui/generated.cs, gtk-gui/gui.stetic, Makefile.am,
- icons/pad-widget-tree-16.png,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDocumentOutline.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs: Implement
- IOutlinedDocument instead of custom pad. Set GTK# version to 2.8.
-
-2008-03-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Removed unneeded dependency.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: fixed bugfix (thanks
- ankit)
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Fixed possible null
- reference exception.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Worked on gnome hig
- compliant alerts.
-
-2008-03-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Fixed null ref.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Refactored content
- interfaces
-
-2008-02-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.mdp: Set correct makefile ver for files.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Worked on category
- support for the toolbox service.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.mdp, lib/libsteticui.mdp: Removed some unused glade
- and gnome-sharp references (only the unused). But I'll continue to
- remove glade, we need to lower the dependency tree a bit.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Added IViewContent
- switching logic (but should be done centrally using the secondaryview
- paradigmn).
-
-2008-02-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Workaround for mono bug
- #350432.
-
-2008-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs: Handle the delete
- key in TreeViewPad, so it will work event if the shortcut is not
- defined.
-
-2008-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp, Makefile.am,
- icons/pad-widget-tree-16.png: Added widget tree icon.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Update MD version.
-
-2008-01-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs,
- MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs,
- MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: Made internal
- some classes that don't need to be public.
-
-2008-01-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Notify file changes
- through the FileService.
-
-2008-01-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Stetic code must be
- generated in the GUI thread. Should fix bug #349505.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Feed default layout
- name to Gettext for translation.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/WidgetPartial.xft.xml, templates/Widget.xft.xml,
- templates/WindowPartial.xft.xml, templates/ActionGroupPartial.xft.xml,
- templates/Window.xft.xml, templates/ActionGroup.xft.xml,
- templates/DialogPartial.xft.xml, templates/Dialog.xft.xml: Make template
- categories translatable.
-
-2008-01-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Added null check on the
- result of UpdateFile. Should fix bug #352194.
-
-2008-01-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs,
- MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs,
- MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs,
- MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs: Handle
- projects which don't support the GTK# designer. Window and widget
- generation options are hidden, and code is never generated. Fixes bug
- #350632.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Don't update bindings if the
- file has syntax errors. May fix bug #347590.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Bump add-in versions.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Update after build reorg.
-
-2007-12-06 Geoff Norton <gnorton@novell.com>
-
- * Makefile.am: Only build the GtkCore addin if we have gnome-sharp
- available.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp, lib/libsteticui.mdp, lib/libstetic.mdp,
- Makefile.am: Directory reorganization.
-
-2007-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * gui.glade, MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs: Removed
- Gnome.FileEntry.
-
-2007-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs: Track
- LoggingService API changes.
-
-2007-11-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Use RootCombine
- instead of CurrentOpenCombine when possible.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Bump MD version.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Fix nullref. Happens
- when removing a project from a solution while one of the windows of that
- project is open.
-
-2007-10-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/ActionGroup.xft.xml, templates/ActionGroupPartial.xft.xml,
- templates/Dialog.xft.xml, templates/DialogPartial.xft.xml,
- templates/Widget.xft.xml, templates/WidgetPartial.xft.xml,
- templates/Window.xft.xml, templates/WindowPartial.xft.xml: Use tango
- file icons. Removed obsolete icons.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: Track api changes. Added
- Description property.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.mdp, lib/libstetic.mdp: Project file names updated by
- change in MD path functions.
-
-2007-10-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mds, Makefile.am: Added custom command for updating
- the Stetic sources.
-
-2007-10-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Set a more meaningful category name for
- addin commands.
- * MonoDevelop.GtkCore.mdp, MonoDevelop.GtkCore.mds: Updated.
-
-2007-10-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: If the current selection
- can't be deleted, just ignore the delete command, so the default handler
- will be executed. Fixes bug #325440.
-
-2007-10-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.mdp: Fix required gtk# version.
-
-2007-10-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Applied changes that
- were neccassary for to the new FileService.
-
-2007-10-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: Changed calls for
- the new StringParser.
-
-2007-10-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: In Bind(), don't subscribe the
- NameChanged event at every call.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: The designer needs to
- be explicitely destroyed.
-
-2007-10-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: No need to implement
- IComparable; it's done in the base class now.
-
-2007-09-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: Assign the selected
- target gtk# version to the new project.
-
-2007-09-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Use ProjectReference.StoredReference
- rather than ProjectReference.Reference, in order to refer to the actual
- stored reference string rather than a temporarily bumped version.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Bump MD version.
-
-2007-09-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Implemented an
- assembly resolver for the stetic app, so assembly widgets registered
- with .pc files can be found.
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs: If a widget dll belongs
- to a package, store it as a package reference in the toolbox index.
-
-2007-09-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Allow setting TargetGtkVersion to
- DefaultGtkVersion when current value is null.
-
-2007-09-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Don't touch GTK# assembly versions
- when a target version is not set. Don't use gtkVersion=null to represent
- default version.
- * MonoDevelop.GtkCore/GtkCoreService.cs: Set TargetGtkVersion on new
- projects. Bump default version to 2.8.
-
-2007-09-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.mdp, lib/libsteticui.mdp, lib/libstetic.mdp,
- lib/Makefile.am, MonoDevelop.GtkCore.mds, Makefile.am: Use projects for
- imported stetic libraries.
-
-2007-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Removed access to
- Component object.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Remove unused method.
-
-2007-09-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs,
- MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs,
- MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs: Fix warnings.
-
-2007-09-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * lib/stetic, Makefile.am, lib/Makefile.am: Build stetic from
- svn:externals.
- * lib/libsteticui.dll.config, lib/libstetic.dll.config,
- lib/libstetic.dll, lib/libsteticui.dll: Removed.
-
-2007-09-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/WidgetPartial.xft.xml, templates/Widget.xft.xml,
- templates/WindowPartial.xft.xml, templates/Window.xft.xml,
- templates/ActionGroupPartial.xft.xml, templates/ActionGroup.xft.xml,
- templates/DialogPartial.xft.xml, templates/Dialog.xft.xml: Remove
- deprecated FileOptions element from templates.
-
-2007-09-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Changed the way to
- set the active designer (the api changed). Fixed some renaming issues.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs: Track api changes.
-
-2007-09-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/Window.xft.xml: Oops, PartialTypeSupport should be set to
- Disabled for non-partial window.
-
-2007-09-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.mdp, Makefile.am: Updated.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs: Use DotNetProject.UsePartialTypes
- instead of custom setting.
- * MonoDevelop.GtkCore/WidgetFileTemplatePartialClass.cs,
- MonoDevelop.GtkCore/WidgetFileTemplateFullClass.cs: No longer needed.
- * templates/WidgetPartial.xft.xml, templates/Widget.xft.xml,
- templates/WindowPartial.xft.xml, templates/Window.xft.xml,
- templates/ActionGroupPartial.xft.xml, templates/ActionGroup.xft.xml,
- templates/DialogPartial.xft.xml, templates/Dialog.xft.xml: Use
- PartialTypes condition instead of custom file template.
-
-2007-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- Includes fixes for bugs #82671, #82527, #82476, #81763 and #81238.
-
-2007-08-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/PropertiesWidget.cs: Changes due to new
- property infrastructure.
-
-2007-08-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs: By default use the project name
- as category name for new custom widgets.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Don't show the full
- name of widgets in the toolbar.
-
-2007-08-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: In FindClass, make
- sure the getUserClass parameter is taken into account when the found
- class is not a multi-part class. Fixes bug #82258.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Removed the CommandService class.
- Everything is done directly with CommandManager. Moved all extension
- node types to MD.Components.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml,
- MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore.mdp, Makefile.am: Reorganized the extension point
- hierarchy. Embedded all add-in manifests as resources.
- * lib/libstetic.dll: Updated from stetic module.
-
-2007-08-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Improved error
- reporting.
-
-2007-08-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Converted
- DispatchService to a static class.
-
-2007-08-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.dll: Updated.
-
-2007-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Fixed some
- problems with the target gtk version. It was not assigned to the
- stetic project. Also fixed some stock icon rendering issues in
- Stetic.
-
-2007-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- Includes a nullref fix.
-
-2007-07-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Layout switch
- delay is not needed anymore.
-
-2007-07-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: Fix nullref
- when gtk support is not enabled. Patch by Chris Howie.
-
-2007-07-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- Don't try to use the CurrentNode property after adding the file,
- since it may have changed. Should fix bug #82123.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
- Fixes bugs #81846 and #82144.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Fix window
- source file lookup.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Use the new methods
- for checking clipboard operations on the current selection.
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Include the
- current project in the list of libraries to show in the toolbox.
- Fixes bug #82125.
-
-2007-07-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated. Fixes bugs 81977,
- 81810 and 82052.
-
-2007-07-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Properly rename
- fields when the widget name is changed. Fixes bug #81976.
-
-2007-07-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs: Update the
- properties pad when the focus is on the widget tree pad. Fixes bug
- #81971.
-
-2007-07-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Added null
- check.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Track api changes
- in DesignerSupport. When adding a project reference to a widget
- library, take into account that widgets may be implemented in a
- library different from the one providing the widget list.
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: In
- GetDynamicItems, only return widgets provided by libraries
- referenced by the project. Don't return widgets from libstetic
- since those are already included by default in the toolbox.
- Implemented IToolboxDefaultProvider.
-
-2007-07-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Changed a bit
- because of the removal of custom collections in the Ide project.
-
-2007-06-30 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * gui.glade: Fixed capitalization.
-
-2007-06-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs: Don't show windows
- in the toolbox.
- * lib/libstetic.dll, lib/libsteticui.dll: Updated from Stetic module.
-
-2007-06-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
-
-2007-06-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * gui.glade, MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs,
- MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: Allow selecting
- the target GTK# version of the project.
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp, Makefile.am,
- MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Implemented a
- toolbox loader, which allows registering assemblies in the toolbox.
- When a widget from a toolbox is dropped to a window, MD will now
- add a reference to the required assembly.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
-
-2007-06-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll: One last update.
-
-2007-06-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
-
-2007-06-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Set the import
- file callback when editing project stock icons.
- * MonoDevelop.GtkCore/ProjectResourceProvider.cs: The GetResources
- method only returns resource files now.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
-
-2007-06-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs: Default pad
- placement is now specified in the xml file.
-
-2007-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: In GetBaseType, use
- Project.GetWidgetTypes to get all registered wiget types, including
- base widget types (which were not provided by GetComponentTypes).
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- Includes fix for bug #81785.
-
-2007-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: Don't include non-public
- members to the objects.xml file.
-
-2007-05-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Updated.
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: Fix feature message.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
- Includes fixes for bugs #81761, #81758 and #81762.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- (UpdateLibraries) Properly check for library changes.
-
-2007-05-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- Fixes bugs #80783 and #81683.
-
-2007-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp, Makefile.am: Added new dependency.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from svn. Fixes bug
- #81590.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: When selecting an
- image file in the widget designer, import the file into the
- project.
-
-2007-05-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Added some delay
- in the code that changes the workbench layout when selecting the
- designer. Fixes bug #80963.
-
-2007-05-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp, Makefile.am,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPalettePad.cs: Removed old
- palette pad.
- * MonoDevelop.GtkCore/GtkCoreService.cs: Set the 'internal' flag for
- widgets implemented by private classes.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from svn module.
- Fixes bugs #80875, #81261, #81365.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: If the project
- is a library, add itself as an internal widget library, so widgets
- with internal visibility will be shown.
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: When saving a window,
- use the visibility of the class to set the visibility of the
- component. Together with all changes done in stetic, fixes bug
- #80875.
-
-2007-05-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs,
- MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Track api changes in
- Stetic.
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: Delay
- library updating until really necessary.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Copy the .addins.xml file to the output dir.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Copy stetic dlls together with the assembly.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated.
-
-2007-05-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp, Makefile.am: Reference shared assemblies
- from the correct location.
-
-2007-05-04 Wade Berrier <wberrier@novell.com>
- * lib/libstetic.dll.config:
- * lib/libsteticui.dll.config:
- Fix os attribute formats (mono-config.c separates oses by comma,
- and ignores or includes the whole string.)
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp, Makefile.am:
- Migration to Mono.Addins.
-
-2007-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp,
- MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs, Makefile.am:
- Implemented project feature for enabling gtk# support in new
- projects.
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs: Use
- Menu icon size in the project pad.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
-
-2007-04-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs: Show a
- relative path in the window delete confirm dialog, since the
- absolute path may take too much space.
- * MonoDevelop.GtkCore.mdp: Updated.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * templates/DialogPartial.xft.xml, templates/Dialog.xft.xml: Add
- Ok/Cancel buttons by default in new dialogs.
-
-2007-03-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- Includes fixes for bugs 81033, 81086, 81239, 81143, 81014 and
- 81015.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Allow pasting when
- a placeholder is selected. Fixes bug #81246.
-
-2007-03-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml,
- MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.mdp, Makefile.am, icons/image-x-generic.png:
- Show a "Stock Icons" node in the User Interface folder. It's easier
- to discover than the context menu option.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.Commands/GladeCommands.cs: Added menu option
- for opening the gtk# settings.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Don't crash if
- the gtk-gui folder doesn't exist. Fixes bug #81152.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Hide the border
- of the combined view notebook.
-
-2007-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.dll: Updated from stetic module. Fixes NRE crash.
-
-2007-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Fix null ref.
-
-2007-03-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Register a new toolbox loader. Removed
- old properties pads.
- * MonoDevelop.GtkCore.mdp, Makefile.am: Added reference to
- MonoDevelop.DesignerSupport.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from svn module.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/PropertiesWidget.cs,
- MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Integrate Stetic
- widgets in the main toolbox.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: Implement
- ICustomPropertyPadProvider and return the Stetic property pad.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs: Renamed.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Fix warning.
-
-2007-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- Updated from Stetic module. Includes fix for bug #80864.
-
-2007-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from SVN. Fixes some
- memory leaks and bug #79453.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Explicitely
- destroy notebook children, since notebook doesnt do it because of a
- gtk bug.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Some fixes in the
- dispose code.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Use
- ProjectOperations.SaveProject to save projects.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Change add-in versions to 0.13.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Fix nullref.
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs: Log
- error message.
- * Makefile.am, MonoDevelop.GtkCore.mdp: Synchronized MD project and
- makefile.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Avoid throwing
- delayed events after the project has been disposed.
-
-2007-02-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Added missing
- null check.
-
-2007-02-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Ask for user
- confirmation when reloading a designer only when the designer has
- unsaved changes.
-
-2007-02-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs,
- MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Detect external
- changes in the gui.stetic files, and reload it when it changes.
- Take into account that the load of gui.stetic can fail. Added
- several workarounds for this case.
-
-2007-02-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from SVN. Includes
- fixes for bugs #80722, #79427 and #80127.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Store some
- Stetic configuration in the MD properties.
-
-2007-02-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * gui.glade, MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Added options
- for enabling/disabling gtk support, and for gettext support.
- * MonoDevelop.GtkCore.addin.xml: Change options panel name.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Make sure the
- MD project is saved together with the stetic project, if necessary.
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: Avoid saving
- the MD project twice.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs: If gtk
- integration status changes for a project, refresh the tree.
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs: Null check.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Added support for gettext and
- gettext class options for generated code.
- * MonoDevelop.GtkCore/GtkCoreService.cs: Added events for notifying
- when the gtk integration status changes for a project.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * Makefile.am: distcheck fixes
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: When a designer
- project is disposed, hide the designer view in the editor.
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- Factorized some code into GtkDesignInfo.
-
-2007-02-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Make sure the code generation
- extension is executed before the last step.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- Hide the add window commands when the project is not DotNet
- * MonoDevelop.GtkCore.mdp, lib/libsteticui.dll, lib/libstetic.dll:
- Updated.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Intercept calls
- to the IPositionable interface, and show the editor page when
- jumping to a line.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: When looking for
- the window class, avoid returning the generated partial class.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Show the editor
- page when jumping to a signal handler.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Warn the user if
- the gtk-sharp-2 package can't be found. Some distros don't include
- the .pc file in the gtk# package, only in the -devel package.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
-
-2007-01-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.dll.config, lib/libsteticui.dll, lib/libstetic.dll,
- lib/libsteticui.dll.config: Updated from Stetic module.
-
-2007-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Track api
- changes in Document class.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated form Stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Removed
- implementation of all text editor interfaces. Now the view
- overrides GetContent and calls editor.GetContent when a requested
- interface is not found.
-
-2007-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Updated.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Removed unused namespace.
- * MonoDevelop.GtkCore/GtkCoreService.cs: Use the new base-type property
- to describe custom widgets. When looking for properties and events,
- look in the base classes as well as in the widget class.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * Makefile.am,
- MonoDevelop.GtkCore.WidgetLibrary/ProjectClassDescriptor.cs,
- MonoDevelop.GtkCore.WidgetLibrary/ProjectSignalDescriptor.cs,
- MonoDevelop.GtkCore.WidgetLibrary/BaseWidgetLibrary.cs,
- MonoDevelop.GtkCore.WidgetLibrary/AssemblyReferenceWidgetLibrary.cs,
- MonoDevelop.GtkCore.WidgetLibrary/ProjectPropertyDescriptor.cs:
- Removed unused files. All widget library functionality has been
- moved to stetic.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Removed all
- widget library management, which has been moved to Stetic.
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Added some null checks.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Use the new way
- of managing dependencies in projects.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- templates/WindowPartial.xft.xml, templates/Window.xft.xml: The
- window constructor now takes the window type.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Some gui
- improvements and added some null checks.
-
-2007-01-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Don't crash if the
- designer can't be loaded for some reason.
-
-2007-01-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml,
- MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs,
- MonoDevelop.GtkCore/WidgetFileTemplatePartialClass.cs,
- MonoDevelop.GtkCore/WidgetFileTemplateFullClass.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs,
- templates/WidgetPartial.xft.xml, templates/Widget.xft.xml,
- templates/WindowPartial.xft.xml, templates/Window.xft.xml,
- templates/ActionGroupPartial.xft.xml,
- templates/ActionGroup.xft.xml, templates/DialogPartial.xft.xml,
- templates/Dialog.xft.xml: Implemented support for generating code
- in partial classes.
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs: Use the
- correct method for saving the project.
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs: Refresh the user
- interface folder when the gui project is reloaded.
- * MonoDevelop.GtkCore.mdp: Updated.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Added support for partial
- classes. In the GuiBuilderProject property, don't update the
- gtk-gui folder since this call may change the contents of the
- project, and weird things happen when called by the project pad to
- fill the tree.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * Makefile.am: Added new files.
- * MonoDevelop.GtkCore.WidgetLibrary/BaseWidgetLibrary.cs,
- MonoDevelop.GtkCore.WidgetLibrary/AssemblyReferenceWidgetLibrary.cs:
- Make it work even when the assembly it references has been deleted
- (maybe as a result of cleaning a project). In this case the widget
- library is shown as empty.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Added support
- for Loading/Unloading a project, to optimize use of memory for
- solutions with many gui projects. Implemented support for
- generating code in partial classes.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Implemented
- support for generating code in partial classes. Implemented support
- for UNDO/REDO.
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- Generation of gui code is now done from the Build method of a
- project service extension. Fixes some issues when building a
- project which contains custom components.
-
-2006-12-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: Track API changes in
- FileService.
-
-2006-12-13 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Don't
- generate stetic code if CurrentOpenCombine is null.
-
-2006-12-07 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.GtkCore.mdp: Updated to it can be
- built from MonoDevelop.
-
-2006-11-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Simplified the
- code by using global events from the Ide, instead of combine
- events.
-
-2006-10-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Added RemoveExportedWidget method.
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: track
- API changes.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: If the name of a
- widget changes and it is being exported, update it in the objects.xml
- file. Fixes bug #79656.
-
-2006-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from Stetic module. It provides a redesigned API
- which will allow running designers in a separate process.
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs:
- * MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs:
- * MonoDevelop.GtkCore.WidgetLibrary/AssemblyReferenceWidgetLibrary.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPalettePad.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs:
- Track api changes.
-
- * MonoDevelop.GtkCore.WidgetLibrary/BaseWidgetLibrary.cs: Make sure
- parse information is up to date before loading an assembly library.
- * MonoDevelop.GtkCore/ProjectResourceProvider.cs: Make sure this object
- is always alive when remoted.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Added null check.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs: Not needed anymore.
- * MonoDevelop.GtkCore.addin.xml: Removed build step. Code generation
- is done now before compiling.
-
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectWidgetLibrary.cs:
- * MonoDevelop.GtkCore.WidgetLibrary/CachedProjectWidgetLibrary.cs:
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: ProjectWidgetLibrary is not used
- anymore. All libraries are now handled by AssemblyReferenceWidgetLibrary.
-
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopWidgetActionBar.cs:
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopActionGroupToolbar.cs:
- Moved to Stetic.
-
- * Makefile.am:
- * MonoDevelop.GtkCore.mdp: Updated.
-
-2006-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Track api changes.
-
-2006-09-19 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * .: Added svn:ignore for MonoDevelop.GtkCore.pidb
-
-2006-09-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from stetic module. Includes fix for bug #79247.
-
-2006-09-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from stetic module.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- Save the project after editing the icons.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Set the
- ResourceProvider for the main stetic project. Added null check.
-
-2006-08-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Fixed bug about
- adding the wrong widget as action designer page.
-
-2006-08-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: Only export properties which
- return primitive types. Fixes bug #79195.
- * lib/*: Updated from stetic module.
- * MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs: Unsubscribe close
- event when done.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Handle designer
- commands in its own tab page.
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: Explicitely dispose
- custom widgets to avoid memory leaks.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Track api changes.
-
- * MonoDevelop.GtkCore.mdp: Updated.
-
-2006-08-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * gui.glade: Minor fix.
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs: Track api
- changes.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Stetic files don't need
- to be added as resource to projects.
- * MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs: Make it
- work for action groups.
- * lib/*: several fixes.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Added method
- for removing an action group.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Track API changes
- in Stetic. Properly bound edit commands from the main menu.
-
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs:
- * MonoDevelop.GtkCore.addin.xml: Implemented Open and Delete
- commands for global action groups.
-
- * MonoDevelop.GtkCore.mdp: Updated.
-
-2006-08-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from Stetic module. Includes fixes for
- bugs #79043, #79044 and #79045
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Don't
- crash if something goes wrong when binding a class.
- Fixed nullref.
-
-2006-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- CreateContentForFile should not load the file, just create
- the view.
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Add
- support for IEncodedTextContent.
-
-2006-08-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- Set the resource provider before loading the project.
- Fixes bug #78966.
-
- * libs/*: Updated from Stetic module. Fixes several bugs:
- 78938, 78916, 78909, 78956, and 78867.
-
-2006-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectClassDescriptor.cs:
- Added null check.
-
- * MonoDevelop.GtkCore.WidgetLibrary/AssemblyReferenceWidgetLibrary.cs:
- Get the parser context using the assembly file name, not the full
- assembly name.
-
-2006-07-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Factorized several
- more or less duplicate methods into GuiBuilderProject, specially
- methods for locating the class bound to a window. GuiBuilderProject
- now will explicitelly update the parser database the first time it
- needs to locate a class, so it will work even if the parser service
- is busy parsing assemblies.
-
-2006-07-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.dll: Updated from stetic module. Fixes a bug
- in the table wrapper which may cause an endless loop.
-
-2006-07-05 Matej Urbas <matej.urbas@gmail.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.WidgetLibrary/BaseWidgetLibrary.cs: Updated to use
- ReturnType as BaseTypes in IClass instances.
-
-2006-07-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from Stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Fixed automatic
- layout switch policy.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Fix showing of
- action group view.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs: Properly
- bind actions when pressing "BindToField".
-
- * MonoDevelop.GtkCore.addin.xml: Updated versions.
-
-2006-06-29 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.GtkCore.addin.xml: Only display WidgetBuilderOptionPanel
- for "DotNet" projects.
-
-2006-06-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from Stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Switch to the
- designer workbench layout when selecting an action group file.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: Support jumping
- to signal hanlder when double-clicking it in the signals editor.
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Removed debug code.
-
- * templates/ActionGroup.xft.xml:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- Fix code generation of action groups.
-
-2006-06-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: If a member has a [Browsable(false)]
- attribute, don't add it to the objects.xml file. Also don't add
- read-only properties.
- * lib/*: Updated from stetic module. Fixes bugs #78622 and #78620.
- Adds an icon for expander and fixes a bug in ColorButton (fix by ml)
-
-2006-06-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll:
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopWidgetActionBar.cs:
- Track changes in the api.
-
-2006-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * libs/*: Updated from stetic module. Several improvements.
- Also fixes bug #78160.
-
-2006-05-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- Added DisplayName property.
-
-2006-05-29 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: reverted interface changes - missing file change
-
-2006-05-29 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: reverted interface changes
-
-2006-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * libs/*: Updated from stetic module. Adds support for toolbars.
-
-2006-05-23 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: track api changes
-
-2006-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Commands/GladeCommands.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- * MonoDevelop.GtkCore.addin.xml: Added commands for creating
- an action group and editing the project icons.
-
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs: Show local
- action groups as children of the window node.
-
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs: Moved
- some event subscriptions to WindowsFolder.cs
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs: Open the
- corresponding file when clicking on local action groups.
-
- * Makefile.am:
- * MonoDevelop.GtkCore.mdp: Added action group template.
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: Added support for
- action group file templates.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Notify changes in
- local action groups.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Don't show the actions
- tab until there is at least one action group.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs: Don't show
- properties or signals for global actions.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Added virtual method
- OnActiveDocumentChanged, which is called when the view is brought to front.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Use the new MemberName
- field when binding fields.
-
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopActionGroupToolbar.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: Several minor fixes.
-
- * lib/*: Updated.
-
-
-2006-05-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Initial support for the menu editor. Still very unstable!!
-
- * lib/*: Updated from Stetic module.
- * MonoDevelop.GtkCore.addin.xml: Register a node builder and and
- display binding for action groups.
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs: Update
- the folder when action groups change.
- * MonoDevelop.GtkCore/GtkCoreService.cs: Fix nullref.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs: Factorized
- some code into CodeBinder.cs
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Factorized some
- code into CombinedDesignView.cs.
-
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs: New node
- builder for action groups.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs: New display
- binding for editing global action groups.
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopWidgetActionBar.cs: Moved from
- GuiBuilderView.cs.
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopActionGroupToolbar.cs: A new
- toolbar for the action group designer.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: A view for editing
- global action groups.
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Moved here some code
- from GuiBuilderEditSession.cs.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Moved here some
- code from GuiBuilderView.cs.
-
- * Makefile.am:
- * MonoDevelop.GtkCore.mdp: Added new files.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Track api changes.
-
-2006-05-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.dll: Updated from Stetic module. Includes
- a fix for bug #78307.
-
-2006-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Updated versions.
- * MonoDevelop.GtkCore.mdp: Updated.
-
-2006-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from Stetic module. Includes fixes for
- bugs #78266, #78240 and #78276.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Track changes
- in the Stetic API.
-
-2006-04-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Don't
- crash if a stetic project can't be loaded. Fixes bug #78169.
- * lib/libstetic.dll: Updated from Stetic module. Fixes bug #78167.
-
-2006-04-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * libs/*: Updated from stetic module. Fixed construction of
- scales and scrollbars.
-
-2006-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectClassDescriptor.cs: When
- creating a widget from a widget design, remove the signals since
- those signals reference handlers in the widget class, not the
- widget container class.
-
-2006-04-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * libs/*: Fix nullref in some themes.
-
-2006-04-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: Fix typo.
- * libs/*: Fix for #78111, #78092 and #78090.
-
-2006-04-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/ProjectResourceProvider.cs: Save the project
- after adding or removing a resource.
-
-2006-04-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated.
-
-2006-03-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Get open
- combine events in the GUI thread.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs: Properly
- delete signals for which there isn't a handler. Half fixed field
- renaming.
- * lib/*: Updated.
-
-2006-03-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/MonoDevelop.GtkCore.addin.xml: Fix ID and
- description. Added stetic config files to add-in package.
-
-2006-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Updated references.
-
-2006-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- Don't crash if no parse info is available for the file
- being edited. Should fix #77885.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Don't show
- the bind to field button for the root container.
- * lib/*: Updated.
-
-2006-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Use an unified format. Patch by Matze Braun.
- * MonoDevelop.GtkCore.addin.xml: Updated add-in versions.
-
-2006-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml:
- * MonoDevelop.GtkCore.mdp: Removed GladeFileDisplayBinding.
- * lib/*: Updated.
- * Makefile.am: Updated. Some files have been moved to Stetic.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Fixed
- layout switching. Don't show the widget tree pad by default,
- since it is already available as a combo in the designer.
- * MonoDevelop.GtkCore.GuiBuilder/GladeFileDisplayBinding.cs: Removed.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs: use
- the new property tree instead of the grid.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: The designer
- toolbar has been moved to Stetic.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs: Changed
- default placement.
-
-2006-03-19 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * .: Added Makefile.in and Makefile to svn:ignore.
-
-2006-03-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.GtkCore.mdp: Updated.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Added support for using
- resource images in the designer.
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: Check if the objects.xml
- file exists before loading it.
- * MonoDevelop.GtkCore/GeneratorBuildStep.cs: Don't generate code
- if the stetic file has not been modified since the last
- generation.
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: If Gtk
- support is not enabled, don't enable it if no widgets have
- been selected.
- * lib/libstetic.dll: Updated.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Mapped some
- commands.
- * templates/Window.xft.xml: The constructor of Gtk.Window requires
- the title of the window.
-
-2006-03-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp, Makefile.am: Updated.
- * MonoDevelop.GtkCore/GeneratorBuildStep.cs: When generating
- code for a project that exports widgets, include the own
- project library to the generation, since there can be
- widgets that contain other widgets defined in the project.
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectClassDescriptor.cs:
- removed some IdeApp dependencies.
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectWidgetLibrary.cs:
- added method for getting the class information from
- a project.
- * CachedProjectWidgetLibrary.cs: New widget library class
- which takes class information from a collection of
- ProjectClassInfo objects.
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectPropertyDescriptor.cs:
- Consider all properties runtime-properties, since they have
- been created from class properties.
- * lib/*: Updated.
-
-2006-03-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: removed debug files.
-
-2006-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Propagate
- project changes to the editor.
-
-2006-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- Initial implementation of the Stetic add-in.
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/GtkDesignerOptionsPanelWidget.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/GtkDesignerOptionsPanelWidget.cs
index cce24542b0..41f1b27042 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/GtkDesignerOptionsPanelWidget.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/GtkDesignerOptionsPanelWidget.cs
@@ -26,7 +26,7 @@
using System;
using MonoDevelop.GtkCore.GuiBuilder;
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.GtkCore.Dialogs
@@ -35,7 +35,7 @@ namespace MonoDevelop.GtkCore.Dialogs
{
GtkDesignerOptionsPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
widget = new GtkDesignerOptionsPanelWidget ();
widget.AutoSwitchLayout = GuiBuilderService.AutoSwitchGuiLayout;
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs
index 68c127d053..0b74290fe3 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs
@@ -32,10 +32,10 @@ using Gtk;
using Gdk;
using Glade;
using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Components;
-
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp;
namespace MonoDevelop.GtkCore.Dialogs
{
@@ -45,7 +45,7 @@ namespace MonoDevelop.GtkCore.Dialogs
[Glade.Widget] protected Gtk.TreeView treeClasses;
ListStore store;
- public SelectRenamedClassDialog (IEnumerable<IType> classes)
+ public SelectRenamedClassDialog (IEnumerable<INamedTypeSymbol> classes)
{
XML glade = new XML (null, "gui.glade", "SelectRenamedClassDialog", null);
glade.Autoconnect (this);
@@ -67,7 +67,7 @@ namespace MonoDevelop.GtkCore.Dialogs
foreach (var cls in classes) {
var pic = ImageService.GetIcon (cls.GetStockIcon ());
- store.AppendValues (pic, cls.FullName);
+ store.AppendValues (pic, cls.GetFullName ());
}
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs
index 4fb717ece7..794b08476b 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs
@@ -29,7 +29,8 @@
using Gtk;
-
+
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Projects;
using MonoDevelop.Ide.Gui.Dialogs;
@@ -121,7 +122,7 @@ namespace MonoDevelop.GtkCore.Dialogs
WidgetBuilderOptionPanelWidget widget;
- public override Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
return (widget = new WidgetBuilderOptionPanelWidget (ConfiguredProject));
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs
index 84f42d5050..5eae8f19fd 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs
@@ -35,8 +35,16 @@ using MonoDevelop.Ide.Gui;
using MonoDevelop.Projects;
using MonoDevelop.GtkCore.Dialogs;
using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using ICSharpCode.NRefactory6.CSharp.Completion;
+using ICSharpCode.NRefactory6.CSharp;
+using System.Linq;
+using MonoDevelop.CSharp.Refactoring;
+using MonoDevelop.Refactoring;
namespace MonoDevelop.GtkCore.GuiBuilder
@@ -53,7 +61,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
get { return true; }
}
- public bool CanHandle (FilePath fileName, string mimeType, Project ownerProject)
+ public bool CanHandle (FilePath fileName, string mimeType, MonoDevelop.Projects.Project ownerProject)
{
if (excludeThis)
return false;
@@ -73,7 +81,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
return db != null;
}
- public IViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
+ public ViewContent CreateContent (FilePath fileName, string mimeType, MonoDevelop.Projects.Project ownerProject)
{
excludeThis = true;
var db = DisplayBindingService.GetDefaultViewBinding (fileName, mimeType, ownerProject);
@@ -87,14 +95,14 @@ namespace MonoDevelop.GtkCore.GuiBuilder
Stetic.ActionGroupInfo GetActionGroup (string file)
{
- Project project = IdeApp.Workspace.GetProjectContainingFile (file);
+ var project = IdeApp.Workspace.GetProjectsContainingFile (file).FirstOrDefault ();
if (!GtkDesignInfo.HasDesignedObjects (project))
return null;
return GtkDesignInfo.FromProject (project).GuiBuilderProject.GetActionGroupForFile (file);
}
- internal static string BindToClass (Project project, Stetic.ActionGroupInfo group)
+ internal static string BindToClass (MonoDevelop.Projects.Project project, Stetic.ActionGroupInfo group)
{
GuiBuilderProject gproject = GtkDesignInfo.FromProject (project).GuiBuilderProject;
string file = gproject.GetSourceCodeFile (group);
@@ -105,9 +113,9 @@ namespace MonoDevelop.GtkCore.GuiBuilder
ArrayList list = new ArrayList ();
var ctx = gproject.GetParserContext ();
- foreach (var cls in ctx.MainAssembly.GetAllTypeDefinitions ())
+ foreach (var cls in ctx.GetAllTypesInMainAssembly ())
if (IsValidClass (cls))
- list.Add (cls.FullName);
+ list.Add (cls.GetFullName ());
// Ask what to do
@@ -124,44 +132,63 @@ namespace MonoDevelop.GtkCore.GuiBuilder
return gproject.GetSourceCodeFile (group);
}
- static IUnresolvedTypeDefinition CreateClass (Project project, Stetic.ActionGroupComponent group, string name, string namspace, string folder)
+ static ITypeSymbol CreateClass (MonoDevelop.Projects.Project project, Stetic.ActionGroupComponent group, string name, string namspace, string folder)
{
string fullName = namspace.Length > 0 ? namspace + "." + name : name;
- var type = new CodeTypeDeclaration ();
- type.Name = name;
- type.IsClass = true;
- type.BaseTypes.Add (new CodeTypeReference ("Gtk.ActionGroup"));
+ var type = SyntaxFactory.ClassDeclaration (name)
+ .AddBaseListTypes (SyntaxFactory.SimpleBaseType (SyntaxFactory.ParseTypeName ("Gtk.ActionGroup")));
// Generate the constructor. It contains the call that builds the widget.
+ var members = new SyntaxList<MemberDeclarationSyntax> ();
- var ctor = new CodeConstructor ();
- ctor.Attributes = MemberAttributes.Public | MemberAttributes.Final;
- ctor.BaseConstructorArgs.Add (new CodePrimitiveExpression (fullName));
-
- var call = new CodeMethodInvokeExpression (
- new CodeMethodReferenceExpression (
- new CodeTypeReferenceExpression ("Stetic.Gui"),
- "Build"
- ),
- new CodeThisReferenceExpression (),
- new CodeTypeOfExpression (fullName)
+ var ctor = SyntaxFactory.ConstructorDeclaration (
+ new SyntaxList<AttributeListSyntax> (),
+ SyntaxFactory.TokenList (SyntaxFactory.Token (SyntaxKind.PublicKeyword)),
+ SyntaxFactory.Identifier (name),
+ SyntaxFactory.ParameterList (),
+ SyntaxFactory.ConstructorInitializer (SyntaxKind.BaseKeyword, SyntaxFactory.ArgumentList (new SeparatedSyntaxList<ArgumentSyntax> { SyntaxFactory.Argument (SyntaxFactory.ParseExpression (fullName)) } )),
+ SyntaxFactory.Block (
+ SyntaxFactory.ExpressionStatement (
+ SyntaxFactory.InvocationExpression (
+ SyntaxFactory.ParseExpression ("Stetic.Gui.Build"),
+ SyntaxFactory.ArgumentList (
+ new SeparatedSyntaxList<ArgumentSyntax> {
+ SyntaxFactory.Argument (SyntaxFactory.ThisExpression ()),
+ SyntaxFactory.Argument (SyntaxFactory.ParseExpression (fullName))
+ }
+ )
+ )
+ )
+ )
);
- ctor.Statements.Add (call);
- type.Members.Add (ctor);
+
+ type = type.AddMembers (ctor);
// Add signal handlers
foreach (Stetic.ActionComponent action in group.GetActions ()) {
foreach (Stetic.Signal signal in action.GetSignals ()) {
- CodeMemberMethod met = new CodeMemberMethod ();
- met.Name = signal.Handler;
- met.Attributes = MemberAttributes.Family;
- met.ReturnType = new CodeTypeReference (signal.SignalDescriptor.HandlerReturnTypeName);
- foreach (Stetic.ParameterDescriptor pinfo in signal.SignalDescriptor.HandlerParameters)
- met.Parameters.Add (new CodeParameterDeclarationExpression (pinfo.TypeName, pinfo.Name));
+ var parameters = new SeparatedSyntaxList<ParameterSyntax> ();
+ foreach (var p in signal.SignalDescriptor.HandlerParameters) {
+ parameters = parameters.Add (SyntaxFactory.Parameter (new SyntaxList<AttributeListSyntax> (), SyntaxFactory.TokenList (), SyntaxFactory.ParseTypeName (p.TypeName), SyntaxFactory.Identifier (p.Name), null));
+ }
+
+ var met = SyntaxFactory.MethodDeclaration (
+ new SyntaxList<AttributeListSyntax> (),
+ SyntaxFactory.TokenList (SyntaxFactory.Token (SyntaxKind.ProtectedKeyword)),
+ SyntaxFactory.ParseTypeName (signal.SignalDescriptor.HandlerReturnTypeName),
+ null,
+ SyntaxFactory.Identifier (signal.Handler),
+ null,
+ SyntaxFactory.ParameterList (parameters),
+ new SyntaxList<TypeParameterConstraintClauseSyntax> (),
+ SyntaxFactory.Block (),
+ null
+ );
+
- type.Members.Add (met);
+ type = type.AddMembers (met);
}
}
@@ -169,17 +196,13 @@ namespace MonoDevelop.GtkCore.GuiBuilder
return CodeGenerationService.AddType ((DotNetProject)project, folder, namspace, type);
}
- internal static bool IsValidClass (IType cls)
+ internal static bool IsValidClass (ITypeSymbol cls)
{
- foreach (var bt in cls.DirectBaseTypes) {
- if (bt.ReflectionName == "Gtk.ActionGroup")
- return true;
-
- var baseCls = bt;
- if (baseCls != null && IsValidClass (baseCls))
- return true;
- }
- return false;
+ if (cls.SpecialType == SpecialType.System_Object)
+ return false;
+ if (cls.BaseType.GetFullName () == "Gtk.ActionGroup")
+ return true;
+ return IsValidClass (cls.BaseType);
}
}
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs
index f0d9cb95e6..9bd11bc1f6 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs
@@ -27,7 +27,7 @@
//
using System;
-using System.Collections;
+using System.Linq;
using MonoDevelop.Projects;
using MonoDevelop.Core;
@@ -35,8 +35,10 @@ using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Commands;
using MonoDevelop.Components.Commands;
using MonoDevelop.DesignerSupport;
-using ICSharpCode.NRefactory.TypeSystem;
-
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide;
+using System.Threading.Tasks;
+using MonoDevelop.Refactoring;
namespace MonoDevelop.GtkCore.GuiBuilder
{
@@ -49,7 +51,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
Stetic.ActionGroupInfo groupInfo;
string groupName;
- public ActionGroupView (IViewContent content, Stetic.ActionGroupInfo group, GuiBuilderProject project): base (content)
+ public ActionGroupView (ViewContent content, Stetic.ActionGroupInfo group, GuiBuilderProject project): base (content)
{
groupName = group.Name;
this.project = project;
@@ -139,15 +141,15 @@ namespace MonoDevelop.GtkCore.GuiBuilder
codeBinder.TargetObject = designer.RootComponent;
}
- public override void Save (string fileName)
+ public override async Task Save (FileSaveInformation fileSaveInformation)
{
string oldBuildFile = GuiBuilderService.GetBuildCodeFileName (project.Project, groupInfo.Name);
- base.Save (fileName);
+ await base.Save (fileSaveInformation);
if (designer == null)
return;
- codeBinder.UpdateBindings (fileName);
+ codeBinder.UpdateBindings (fileSaveInformation.FileName);
designer.Save ();
@@ -179,19 +181,15 @@ namespace MonoDevelop.GtkCore.GuiBuilder
public override void JumpToSignalHandler (Stetic.Signal signal)
{
var cls = codeBinder.GetClass ();
- foreach (var met in cls.Methods) {
- if (met.Name == signal.Handler) {
- ShowPage (1);
- JumpTo (met.Region.BeginLine, met.Region.BeginColumn);
- break;
- }
+ var met = cls.GetMembers (signal.Handler).OfType<IMethodSymbol> ().FirstOrDefault ();
+ if (met != null) {
+ ShowPage (1);
+ RefactoringService.RoslynJumpToDeclaration(met);
}
}
void OnGroupModified (object s, EventArgs a)
{
- if (designer.Modified)
- OnContentChanged (a);
IsDirty = designer.Modified;
}
@@ -200,15 +198,15 @@ namespace MonoDevelop.GtkCore.GuiBuilder
codeBinder.BindSignal (a.Signal);
}
- void OnSignalChanged (object s, Stetic.ComponentSignalEventArgs a)
+ async void OnSignalChanged (object s, Stetic.ComponentSignalEventArgs a)
{
- codeBinder.UpdateSignal (a.OldSignal, a.Signal);
+ await codeBinder.UpdateSignal (a.OldSignal, a.Signal);
}
- void OnBindField (object s, EventArgs args)
+ async void OnBindField (object s, EventArgs args)
{
if (designer.SelectedAction != null) {
- codeBinder.BindToField (designer.SelectedAction);
+ await codeBinder.BindToField (designer.SelectedAction);
}
}
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ClassUtils.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ClassUtils.cs
index 15ad4bc0ca..8c5d0a5462 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ClassUtils.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ClassUtils.cs
@@ -30,32 +30,31 @@ using Gtk;
using System;
using System.Collections;
using System.CodeDom;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.Semantics;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.GtkCore.GuiBuilder
{
internal class ClassUtils
{
- public static IField FindWidgetField (ITypeDefinition cls, string name)
+ public static IFieldSymbol FindWidgetField (ITypeSymbol cls, string name)
{
- foreach (IField field in cls.Fields) {
+ foreach (var field in cls.GetMembers ().OfType<IFieldSymbol> ()) {
if (name == GetWidgetFieldName (field))
return field;
}
return null;
}
- public static string GetWidgetFieldName (IField field)
+ public static string GetWidgetFieldName (IFieldSymbol field)
{
- foreach (IAttribute att in field.Attributes) {
- var type = att.AttributeType;
- if (type.ReflectionName == "Glade.Widget" || type.ReflectionName == "Widget" || type.ReflectionName == "Glade.WidgetAttribute" || type.ReflectionName == "WidgetAttribute") {
- var pArgs = att.PositionalArguments;
- if (pArgs != null && pArgs.Count > 0) {
- var exp = pArgs[0] as ConstantResolveResult;
+ foreach (AttributeData att in field.GetAttributes ()) {
+ var type = att.AttributeClass;
+ if (type.Name == "Widget" || type.Name == "WidgetAttribute") {
+ var pArgs = att.ConstructorArguments;
+ if (pArgs != null && pArgs.Length > 0) {
+ var exp = pArgs[0].Value;
if (exp != null)
- return exp.ConstantValue.ToString ();
+ return exp.ToString ();
} else {
return field.Name;
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs
index 7e4e54a0b6..bff4e49428 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs
@@ -37,10 +37,17 @@ using MonoDevelop.Projects.Text;
using MonoDevelop.Ide.Gui;
using MonoDevelop.GtkCore.Dialogs;
using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Ide.FindInFiles;
-using ICSharpCode.NRefactory.TypeSystem.Implementation;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using ICSharpCode.NRefactory6.CSharp;
+using MonoDevelop.CSharp.Refactoring;
+using MonoDevelop.Refactoring;
+using System.Xml.XPath;
+using System.IO;
+using System.Threading.Tasks;
namespace MonoDevelop.GtkCore.GuiBuilder
{
@@ -55,12 +62,12 @@ namespace MonoDevelop.GtkCore.GuiBuilder
{
ITextFileProvider textFileProvider;
Stetic.Component targetObject;
- Project project;
+ MonoDevelop.Projects.Project project;
GuiBuilderProject gproject;
string className;
string classFile;
- public CodeBinder (Project project, ITextFileProvider textFileProvider, Stetic.Component targetObject)
+ public CodeBinder (MonoDevelop.Projects.Project project, ITextFileProvider textFileProvider, Stetic.Component targetObject)
{
this.project = project;
this.textFileProvider = textFileProvider;
@@ -77,8 +84,8 @@ namespace MonoDevelop.GtkCore.GuiBuilder
if (targetObject != null) {
var cls = gproject.FindClass (GetClassName (targetObject));
if (cls != null) {
- className = cls.FullName;
- classFile = cls.Region.FileName;
+ className = cls.GetFullName ();
+ classFile = cls.Locations.First ().SourceTree.FilePath;
}
}
}
@@ -89,20 +96,17 @@ namespace MonoDevelop.GtkCore.GuiBuilder
{
if (targetObject == null)
return;
-
- var doc = TypeSystemService.ParseFile (project, fileName);
+ FileService.NotifyFileChanged (fileName);
classFile = fileName;
- if (doc != null) {
- var cls = GetClass ();
+ var cls = GetClass ();
+ if (cls != null) {
UpdateBindings (targetObject, cls);
-
- if (cls != null)
- targetObject.GeneratePublic = cls.IsPublic;
+ targetObject.GeneratePublic = cls.DeclaredAccessibility == Accessibility.Public;
}
}
- void UpdateBindings (Stetic.Component obj, IUnresolvedTypeDefinition cls)
+ void UpdateBindings (Stetic.Component obj, ITypeSymbol cls)
{
if (targetObject == null || cls == null)
return;
@@ -113,9 +117,8 @@ namespace MonoDevelop.GtkCore.GuiBuilder
if (objectSignals != null) {
Stetic.Signal[] signals = new Stetic.Signal [objectSignals.Count];
objectSignals.CopyTo (signals, 0);
- var resolved = cls.Resolve (project);
foreach (Stetic.Signal signal in signals) {
- if (FindSignalHandler (resolved, signal) == null) {
+ if (FindSignalHandler (cls, signal) == null) {
obj.RemoveSignal (signal);
}
}
@@ -127,17 +130,12 @@ namespace MonoDevelop.GtkCore.GuiBuilder
UpdateBindings (ob, cls);
}
- IMethod FindSignalHandler (IType cls, Stetic.Signal signal)
+ static IMethodSymbol FindSignalHandler (ITypeSymbol cls, Stetic.Signal signal)
{
- foreach (var met in cls.GetMethods ()) {
- if (met.Name == signal.Handler) {
- return met;
- }
- }
- return null;
+ return cls.GetMembers (signal.Handler).OfType<IMethodSymbol> ().FirstOrDefault ();
}
- public void UpdateField (Stetic.Component obj, string oldName)
+ public async Task UpdateField (Stetic.Component obj, string oldName)
{
if (targetObject == null)
return;
@@ -152,9 +150,9 @@ namespace MonoDevelop.GtkCore.GuiBuilder
return;
if (cls != null) {
- var f = ClassUtils.FindWidgetField (cls.Resolve (project).GetDefinition (), oldName);
+ var f = ClassUtils.FindWidgetField (cls, oldName);
if (f != null) {
- MonoDevelop.Refactoring.Rename.RenameRefactoring.Rename (f, newName);
+ await MonoDevelop.Refactoring.Rename.RenameRefactoring.Rename (f, newName);
}
}
}
@@ -168,21 +166,36 @@ namespace MonoDevelop.GtkCore.GuiBuilder
var cls = GetClass ();
if (cls == null)
return;
-
- if (FindSignalHandler (cls.Resolve (project), signal) != null)
+
+ if (FindSignalHandler (cls, signal) != null)
return;
-
- var met = new DefaultUnresolvedMethod (cls, signal.Handler) {
- Accessibility = Accessibility.Protected,
- ReturnType = ReflectionHelper.ParseReflectionName (signal.SignalDescriptor.HandlerReturnTypeName)
- };
+
+ var met = SyntaxFactory.MethodDeclaration (SyntaxFactory.ParseTypeName (signal.SignalDescriptor.HandlerReturnTypeName),
+ signal.Handler)
+ .WithBody (SyntaxFactory.Block ())
+ .AddModifiers (SyntaxFactory.Token (SyntaxKind.ProtectedKeyword));
+
+ var parameters = new List<ParameterSyntax> ();
foreach (Stetic.ParameterDescriptor pinfo in signal.SignalDescriptor.HandlerParameters)
- met.Parameters.Add (new DefaultUnresolvedParameter (ReflectionHelper.ParseReflectionName (pinfo.TypeName), pinfo.Name));
- var resolvedCls = cls.Resolve (project).GetDefinition ();
- CodeGenerationService.AddNewMember (resolvedCls, cls, met);
+ parameters.Add (SyntaxFactory.Parameter (new SyntaxList<AttributeListSyntax> (), new SyntaxTokenList (), SyntaxFactory.ParseTypeName (pinfo.TypeName), SyntaxFactory.Identifier (pinfo.Name), null));
+ met = met.AddParameterListParameters (parameters.ToArray ());
+
+ CodeGenerationService.AddNewMember (project, cls, GetSourceLocation (cls), met);
}
-
- public void UpdateSignal (Stetic.Signal oldSignal, Stetic.Signal newSignal)
+
+ static Location GetSourceLocation (INamedTypeSymbol cls)
+ {
+ foreach (var loc in cls.Locations) {
+ if (loc.IsInSource) {
+ if (!Path.GetDirectoryName (loc.SourceTree.FilePath).EndsWith ("gtk-gui", FilePath.PathComparison))
+ return loc;
+ }
+ }
+
+ return cls.Locations.First ();
+ }
+
+ public async Task UpdateSignal (Stetic.Signal oldSignal, Stetic.Signal newSignal)
{
if (targetObject == null)
return;
@@ -193,14 +206,14 @@ namespace MonoDevelop.GtkCore.GuiBuilder
var cls = GetClass ();
if (cls == null)
return;
- IMethod met = FindSignalHandler (cls.Resolve (project), oldSignal);
+ var met = FindSignalHandler (cls, oldSignal);
if (met == null)
return;
- MonoDevelop.Refactoring.Rename.RenameRefactoring.Rename (met, newSignal.Handler);
+ await MonoDevelop.Refactoring.Rename.RenameRefactoring.Rename (met, newSignal.Handler);
}
/// Adds a field to the class
- public void BindToField (Stetic.Component obj)
+ public async Task BindToField (Stetic.Component obj)
{
if (targetObject == null)
return;
@@ -208,40 +221,45 @@ namespace MonoDevelop.GtkCore.GuiBuilder
string name = GetMemberName (obj);
var cls = GetClass ();
- if (FindField (cls.Resolve (project), name) != null)
+ if (FindField (cls, name) != null)
return;
- Document doc = IdeApp.Workbench.OpenDocument (cls.Region.FileName, true);
+ var location = GetSourceLocation(cls);
+ var doc = await IdeApp.Workbench.OpenDocument (location.SourceTree.FilePath, project, true);
- IEditableTextFile editor = doc.GetContent<IEditableTextFile> ();
+ var editor = doc.Editor;
if (editor != null) {
- var resolvedCls = cls.Resolve (project).GetDefinition ();
- CodeGenerationService.AddNewMember (resolvedCls, cls, GetFieldCode (cls, obj, name));
+ await CodeGenerationService.AddNewMember (project, cls, cls.Locations.First (), GetFieldCode (cls, obj, name));
}
}
- IUnresolvedField GetFieldCode (IUnresolvedTypeDefinition cls, Stetic.Component obj, string name)
+ FieldDeclarationSyntax GetFieldCode (ITypeSymbol cls, Stetic.Component obj, string name)
{
- return new DefaultUnresolvedField (cls, name) {
- ReturnType = ReflectionHelper.ParseReflectionName (obj.Type.ClassName),
- Accessibility = Accessibility.Protected
- };
- }
+ return SyntaxFactory.FieldDeclaration (
+ SyntaxFactory.VariableDeclaration (
+ SyntaxFactory.ParseTypeName (obj.Type.ClassName),
+ new SeparatedSyntaxList<VariableDeclaratorSyntax> {
+ SyntaxFactory.VariableDeclarator (name)
+ }
+ )
+ ).AddModifiers (SyntaxFactory.Token (SyntaxKind.ProtectedKeyword));
+ }
+
- IField FindField (IType cls, string name)
+ static IFieldSymbol FindField (ITypeSymbol cls, string name)
{
- foreach (IField field in cls.GetFields ())
- if (field.Name == name)
- return field;
- return null;
+ return cls
+ .GetMembers (name)
+ .OfType<IFieldSymbol> ()
+ .FirstOrDefault ();
}
- public IUnresolvedTypeDefinition GetClass ()
+ public INamedTypeSymbol GetClass ()
{
return GetClass (true);
}
- public IUnresolvedTypeDefinition GetClass (bool getUserClass)
+ public INamedTypeSymbol GetClass (bool getUserClass)
{
if (targetObject == null)
return null;
@@ -251,62 +269,59 @@ namespace MonoDevelop.GtkCore.GuiBuilder
return cls;
// The class name may have changed. Try to guess the new name.
-
- var matches = new List<IUnresolvedTypeDefinition> ();
- ParsedDocument unit = null;
- var ctx = gproject.GetParserContext ();
- var doc = TypeSystemService.ParseFile (project, classFile);
- if (doc != null) {
- unit = doc;
- foreach (var fcls in unit.TopLevelTypeDefinitions) {
- if (IsValidClass (fcls.Resolve (project), targetObject))
- matches.Add (fcls);
- }
- }
-
- // If found the class, just return it
- if (matches.Count == 1) {
- cls = matches [0];
- className = cls.FullName;
- targetObject.Name = className;
- gproject.SaveWindow (true, targetObject.Name);
- return cls;
- }
-
- // If not found, warn the user.
-
- if (unit != null && unit.TopLevelTypeDefinitions.Count > 0) {
- using (SelectRenamedClassDialog dialog = new SelectRenamedClassDialog (unit.TopLevelTypeDefinitions.Select (c => c.Resolve (project)))) {
- if (dialog.Run ()) {
- className = dialog.SelectedClass;
- if (className == null)
- return null;
- else {
- targetObject.Name = className;
- gproject.SaveWindow (true, targetObject.Name);
- return gproject.FindClass (className);
- }
- }
- }
- } else {
- MessageService.ShowError (GettextCatalog.GetString ("The class bound to the component '{0}' could not be found. This may be due to syntax errors in the source code file.", GetObjectName(targetObject)));
- }
+// TODO (roslyn port) - is that really required ?
+// var matches = new List<INamedTypeSymbol> ();
+// ParsedDocument unit = null;
+// var ctx = gproject.GetParserContext ();
+// var doc = TypeSystemService.ParseFile (project, classFile);
+// if (doc != null) {
+// unit = doc;
+// foreach (var fcls in unit.TopLevelTypeDefinitions) {
+// if (IsValidClass (fcls, targetObject))
+// matches.Add (fcls);
+// }
+// }
+//
+// // If found the class, just return it
+// if (matches.Count == 1) {
+// cls = matches [0];
+// className = cls.GetFullName ();
+// targetObject.Name = className;
+// gproject.SaveWindow (true, targetObject.Name);
+// return cls;
+// }
+//
+// // If not found, warn the user.
+//
+// if (unit != null && unit.TopLevelTypeDefinitions.Count > 0) {
+// using (var dialog = new SelectRenamedClassDialog (unit.TopLevelTypeDefinitions.Select (c => c.Resolve (project)))) {
+// if (dialog.Run ()) {
+// className = dialog.SelectedClass;
+// if (className == null)
+// return null;
+// else {
+// targetObject.Name = className;
+// gproject.SaveWindow (true, targetObject.Name);
+// return gproject.FindClass (className);
+// }
+// }
+// }
+// } else {
+// MessageService.ShowError (GettextCatalog.GetString ("The class bound to the component '{0}' could not be found. This may be due to syntax errors in the source code file.", GetObjectName(targetObject)));
+// }
return null;
}
- static bool IsValidClass (IType cls, Stetic.Component obj)
+ static bool IsValidClass (ITypeSymbol cls, Stetic.Component obj)
{
+ if (cls.BaseType.SpecialType == SpecialType.System_Object)
+ return false;
string typeName = obj.Type.ClassName;
- foreach (var bt in cls.DirectBaseTypes) {
- if (bt.FullName == typeName)
- return true;
-
- if (IsValidClass (bt, obj))
- return true;
- }
- return false;
+ if (cls.BaseType.GetFullName () == typeName)
+ return true;
+ return IsValidClass (cls.BaseType, obj);
}
internal static string GetClassName (Stetic.Component obj)
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs
index 551760fe69..eb93b3efe0 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs
@@ -30,22 +30,25 @@
using System;
using System.Linq;
using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide;
using System.Collections.Generic;
+using MonoDevelop.Ide.Editor;
+using System.Threading.Tasks;
namespace MonoDevelop.GtkCore.GuiBuilder
{
- public class CombinedDesignView : AbstractViewContent
+ public class CombinedDesignView : ViewContent
{
- IViewContent content;
+ ViewContent content;
Gtk.Widget control;
List<TabView> tabs = new List<TabView> ();
- public CombinedDesignView (IViewContent content)
+ public CombinedDesignView (ViewContent content)
{
this.content = content;
/* This code causes that chagnes in a version control view always select the source code view.
@@ -54,7 +57,6 @@ namespace MonoDevelop.GtkCore.GuiBuilder
ShowPage (0);
};
}*/
- content.ContentChanged += new EventHandler (OnTextContentChanged);
content.DirtyChanged += new EventHandler (OnTextDirtyChanged);
CommandRouterContainer crc = new CommandRouterContainer (content.Control, content, true);
@@ -86,7 +88,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
public bool HasPage (Gtk.Widget page)
{
- return tabs.Any (p => p.Control == page);
+ return tabs.Any (p => p.Control.GetNativeWidget<Gtk.Widget> () == page);
}
public void RemoveButton (Gtk.Widget page)
@@ -107,18 +109,23 @@ namespace MonoDevelop.GtkCore.GuiBuilder
ShowPage (0);*/
}
- public override MonoDevelop.Projects.Project Project {
- get { return base.Project; }
- set {
- base.Project = value;
- content.Project = value;
+ protected override void OnSetProject (Projects.Project project)
+ {
+ base.OnSetProject (project);
+ content.Project = project;
+ }
+
+ public override ProjectReloadCapability ProjectReloadCapability {
+ get {
+ return content.ProjectReloadCapability;
}
}
- protected override void OnWorkbenchWindowChanged (EventArgs e)
+ protected override void OnWorkbenchWindowChanged ()
{
- base.OnWorkbenchWindowChanged (e);
- content.WorkbenchWindow = WorkbenchWindow;
+ base.OnWorkbenchWindowChanged ();
+ if (content != null)
+ content.WorkbenchWindow = WorkbenchWindow;
if (WorkbenchWindow != null) {
foreach (TabView view in tabs) {
view.WorkbenchWindow = WorkbenchWindow;
@@ -160,7 +167,9 @@ namespace MonoDevelop.GtkCore.GuiBuilder
public override void Dispose ()
{
- content.ContentChanged -= new EventHandler (OnTextContentChanged);
+ if (content == null)
+ return;
+
content.DirtyChanged -= new EventHandler (OnTextDirtyChanged);
IdeApp.Workbench.ActiveDocumentChanged -= new EventHandler (OnActiveDocumentChanged);
content.Dispose ();
@@ -171,19 +180,19 @@ namespace MonoDevelop.GtkCore.GuiBuilder
base.Dispose ();
}
- public override void Load (string fileName)
+ public override Task Load (FileOpenInformation fileOpenInformation)
{
- ContentName = fileName;
- content.Load (fileName);
+ ContentName = fileOpenInformation.FileName;
+ return content.Load (ContentName);
}
- public override Gtk.Widget Control {
+ public override Control Control {
get { return control; }
}
- public override void Save (string fileName)
+ public override Task Save (FileSaveInformation fileSaveInformation)
{
- content.Save (fileName);
+ return content.Save (fileSaveInformation);
}
public override bool IsDirty {
@@ -210,14 +219,9 @@ namespace MonoDevelop.GtkCore.GuiBuilder
{
}
- void OnTextContentChanged (object s, EventArgs args)
- {
- OnContentChanged (args);
- }
-
void OnTextDirtyChanged (object s, EventArgs args)
{
- OnDirtyChanged (args);
+ OnDirtyChanged ();
}
void OnActiveDocumentChanged (object s, EventArgs args)
@@ -230,7 +234,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
{
}
- public override object GetContent (Type type)
+ protected override object OnGetContent (Type type)
{
// if (type == typeof(IEditableTextBuffer)) {
// // Intercept the IPositionable interface, since we need to
@@ -241,20 +245,20 @@ namespace MonoDevelop.GtkCore.GuiBuilder
// return null;
// }
//
- return base.GetContent (type) ?? (content !=null ? content.GetContent (type) : null);
+ return base.OnGetContent (type) ?? (content !=null ? content.GetContent (type) : null);
}
public void JumpTo (int line, int column)
{
- IEditableTextBuffer ip = (IEditableTextBuffer) content.GetContent (typeof(IEditableTextBuffer));
+ var ip = (TextEditor) content.GetContent (typeof(TextEditor));
if (ip != null) {
ShowPage (0);
- ip.SetCaretTo (line, column);
+ ip.SetCaretLocation (line, column);
}
}
}
- class TabView: AbstractBaseViewContent, IAttachableViewContent
+ class TabView: BaseViewContent
{
string label;
Gtk.Widget content;
@@ -265,32 +269,14 @@ namespace MonoDevelop.GtkCore.GuiBuilder
this.content = content;
}
- public override object GetContent (Type type)
+ protected override object OnGetContent (Type type)
{
- if (type.IsInstanceOfType (Control))
- return Control;
- return base.GetContent (type);
+ if (type.IsInstanceOfType (content))
+ return content;
+ return base.OnGetContent (type);
}
- #region IAttachableViewContent implementation
- public virtual void Selected ()
- {
- }
-
- public virtual void Deselected ()
- {
- }
-
- public virtual void BeforeSave ()
- {
- }
-
- public virtual void BaseContentChanged ()
- {
- }
- #endregion
-
- public override Widget Control {
+ public override Control Control {
get {
return content;
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs
index ef787a9b26..04e2b66bd2 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs
@@ -3,47 +3,66 @@ using System;
using System.Threading;
using MonoDevelop.Core;
using MonoDevelop.Projects;
+using MonoDevelop.Core.Serialization;
using MonoDevelop.Ide;
+using System.Threading.Tasks;
namespace MonoDevelop.GtkCore.GuiBuilder
{
- public class GtkProjectServiceExtension: ProjectServiceExtension
+ public class GtkProjectServiceExtension: DotNetProjectExtension
{
- public override bool SupportsItem (IBuildTarget item)
+ [ItemProperty ("GtkDesignInfo", IsExternal = true, SkipEmpty = true)]
+ GtkDesignInfo info;
+
+ protected override bool SupportsObject (WorkspaceObject item)
{
- if (!IdeApp.IsInitialized)
- return false;
-
- DotNetProject project = item as DotNetProject;
- return project != null && project.References.Count != 0 && GtkDesignInfo.HasDesignedObjects (project);
+ return base.SupportsObject (item) && IdeApp.IsInitialized;
}
- protected override BuildResult Build (IProgressMonitor monitor, SolutionEntityItem entry, ConfigurationSelector configuration)
+ protected override void OnReadProject (ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject)
{
- DotNetProject project = (DotNetProject) entry;
- GtkDesignInfo info = GtkDesignInfo.FromProject (project);
+ base.OnReadProject (monitor, msproject);
+ if (info != null)
+ info.Project = Project;
+ }
+
+ public GtkDesignInfo DesignInfo {
+ get {
+ if (info == null)
+ info = new GtkDesignInfo (Project);
+ return info;
+ }
+ set {
+ info = value;
+ }
+ }
+
+ protected async override Task<BuildResult> OnBuild (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
+ {
+ if (Project.References.Count == 0 || !GtkDesignInfo.HasDesignedObjects (Project))
+ return await base.OnBuild (monitor, configuration, operationContext);
- // The code generator must run in the GUI thread since it needs to
- // access to Gtk classes
Generator gen = new Generator ();
- lock (gen) {
- Gtk.Application.Invoke (delegate { gen.Run (monitor, project, configuration); });
- Monitor.Wait (gen);
+ if (!await gen.Run (monitor, Project, configuration)) {
+ BuildResult gr = new BuildResult ();
+ foreach (string s in gen.Messages)
+ gr.AddError (DesignInfo.GuiBuilderProject.File, 0, 0, null, s);
+ return gr;
}
- BuildResult res = base.Build (monitor, entry, configuration);
+ BuildResult res = await base.OnBuild (monitor, configuration, operationContext);
if (gen.Messages != null) {
foreach (string s in gen.Messages)
- res.AddWarning (info.GuiBuilderProject.File, 0, 0, null, s);
+ res.AddWarning (DesignInfo.GuiBuilderProject.File, 0, 0, null, s);
if (gen.Messages.Length > 0)
- info.ForceCodeGenerationOnBuild ();
+ DesignInfo.ForceCodeGenerationOnBuild ();
}
if (res.Failed && !Platform.IsWindows && !Platform.IsMac) {
// Some gtk# packages don't include the .pc file unless you install gtk-sharp-devel
- if (project.AssemblyContext.GetPackage ("gtk-sharp-2.0") == null) {
+ if (Project.AssemblyContext.GetPackage ("gtk-sharp-2.0") == null) {
string msg = GettextCatalog.GetString (
"ERROR: MonoDevelop could not find the Gtk# 2.0 development package. " +
"Compilation of projects depending on Gtk# libraries will fail. " +
@@ -59,19 +78,18 @@ namespace MonoDevelop.GtkCore.GuiBuilder
class Generator
{
- public void Run (IProgressMonitor monitor, DotNetProject project, ConfigurationSelector configuration)
+ public async Task<bool> Run (ProgressMonitor monitor, DotNetProject project, ConfigurationSelector configuration)
{
- lock (this) {
- try {
- Stetic.CodeGenerationResult res = GuiBuilderService.GenerateSteticCode (monitor, project, configuration);
- if (res != null)
- Messages = res.Warnings;
- } catch (Exception ex) {
- Error = ex;
- LoggingService.LogError (ex.ToString ());
- Messages = new string [] { Error.Message };
- }
- Monitor.PulseAll (this);
+ try {
+ Stetic.CodeGenerationResult res = await GuiBuilderService.GenerateSteticCode (monitor, project, configuration);
+ if (res != null)
+ Messages = res.Warnings;
+ return true;
+ } catch (Exception ex) {
+ Error = ex;
+ LoggingService.LogError (ex.ToString ());
+ Messages = new [] { Error.Message };
+ return false;
}
}
public string[] Messages;
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs
index 603b0beccb..c9f93016f6 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs
@@ -30,6 +30,11 @@ using MonoDevelop.Ide.Gui;
using MonoDevelop.Projects;
using MonoDevelop.Ide;
using MonoDevelop.Ide.TypeSystem;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp;
+using System;
+using ICSharpCode.NRefactory6.CSharp;
namespace MonoDevelop.GtkCore.GuiBuilder
@@ -54,7 +59,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
if (fileName.IsNullOrEmpty)
return false;
- if (GetWindow (fileName) == null)
+ if (GetWindow (fileName, ownerProject) == null)
return false;
excludeThis = true;
@@ -63,42 +68,46 @@ namespace MonoDevelop.GtkCore.GuiBuilder
return db != null;
}
- public IViewContent CreateContent (MonoDevelop.Core.FilePath fileName, string mimeType, Project ownerProject)
+ public ViewContent CreateContent (MonoDevelop.Core.FilePath fileName, string mimeType, Project ownerProject)
{
excludeThis = true;
var db = DisplayBindingService.GetDefaultViewBinding (fileName, mimeType, ownerProject);
var content = db.CreateContent (fileName, mimeType, ownerProject);
- GuiBuilderView view = new GuiBuilderView (content, GetWindow (fileName));
+ var window = GetWindow (fileName, ownerProject);
+ if (window == null)
+ throw new InvalidOperationException ("GetWindow == null");
+ GuiBuilderView view = new GuiBuilderView (content, window);
excludeThis = false;
return view;
}
- internal static GuiBuilderWindow GetWindow (string file)
+ internal static GuiBuilderWindow GetWindow (string file, Project project)
{
if (!IdeApp.Workspace.IsOpen)
return null;
-
- Project project = null;
- foreach (Project p in IdeApp.Workspace.GetAllProjects ()) {
- if (p.IsFileInProject (file)) {
- project = p;
- break;
- }
- }
-
if (!GtkDesignInfo.HasDesignedObjects (project))
return null;
-
GtkDesignInfo info = GtkDesignInfo.FromProject (project);
if (file.StartsWith (info.GtkGuiFolder))
return null;
-
- var doc = TypeSystemService.ParseFile (project, file);
+ var docId = TypeSystemService.GetDocumentId (project, file);
+ if (docId == null)
+ return null;
+ var doc = TypeSystemService.GetCodeAnalysisDocument (docId);
if (doc == null)
return null;
-
- foreach (var t in doc.TopLevelTypeDefinitions) {
- GuiBuilderWindow win = info.GuiBuilderProject.GetWindowForClass (t.FullName);
+ Microsoft.CodeAnalysis.SemanticModel semanticModel;
+ try {
+ semanticModel = doc.GetSemanticModelAsync ().Result;
+ } catch {
+ return null;
+ }
+ if (semanticModel == null)
+ return null;
+ var root = semanticModel.SyntaxTree.GetRoot ();
+ foreach (var classDeclaration in root.DescendantNodesAndSelf (child => !(child is BaseTypeDeclarationSyntax)).OfType<ClassDeclarationSyntax> ()) {
+ var c = semanticModel.GetDeclaredSymbol (classDeclaration);
+ GuiBuilderWindow win = info.GuiBuilderProject.GetWindowForClass (c.ToDisplayString (Microsoft.CodeAnalysis.SymbolDisplayFormat.CSharpErrorMessageFormat));
if (win != null)
return win;
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs
index 0e16502285..2f2e4c8591 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs
@@ -37,9 +37,12 @@ using System.CodeDom.Compiler;
using MonoDevelop.Core;
using MonoDevelop.Projects;
using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
using System.Linq;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp.Completion;
+using ICSharpCode.NRefactory6.CSharp;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace MonoDevelop.GtkCore.GuiBuilder
{
@@ -114,7 +117,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
if (System.IO.File.Exists (fileName)) {
watcher.Path = Path.GetDirectoryName (fileName);
watcher.Filter = Path.GetFileName (fileName);
- watcher.Changed += (FileSystemEventHandler) DispatchService.GuiDispatch (new FileSystemEventHandler (OnSteticFileChanged));
+ watcher.Changed += OnSteticFileChanged;
watcher.EnableRaisingEvents = true;
}
}
@@ -158,17 +161,19 @@ namespace MonoDevelop.GtkCore.GuiBuilder
void OnSteticFileChanged (object s, FileSystemEventArgs args)
{
- lock (fileSaveLock) {
- if (lastSaveTime == System.IO.File.GetLastWriteTime (fileName))
- return;
- }
-
- if (GuiBuilderService.HasOpenDesigners (project, true)) {
- if (MessageService.AskQuestion (GettextCatalog.GetString ("The project '{0}' has been modified by an external application. Do you want to reload it?", project.Name), GettextCatalog.GetString ("Unsaved changes in the open GTK designers will be lost."), AlertButton.Cancel, AlertButton.Reload) != AlertButton.Reload)
- return;
- }
- if (!disposed)
- Reload ();
+ Runtime.RunInMainThread (() => {
+ lock (fileSaveLock) {
+ if (lastSaveTime == System.IO.File.GetLastWriteTime (fileName))
+ return;
+ }
+
+ if (GuiBuilderService.HasOpenDesigners (project, true)) {
+ if (MessageService.AskQuestion (GettextCatalog.GetString ("The project '{0}' has been modified by an external application. Do you want to reload it?", project.Name), GettextCatalog.GetString ("Unsaved changes in the open GTK designers will be lost."), AlertButton.Cancel, AlertButton.Reload) != AlertButton.Reload)
+ return;
+ }
+ if (!disposed)
+ Reload ();
+ });
}
public void Reload ()
@@ -219,7 +224,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
}
if (GtkDesignInfo.FromProject (project).UpdateGtkFolder () && saveMdProject)
- IdeApp.ProjectOperations.Save (project);
+ IdeApp.ProjectOperations.SaveAsync (project);
}
public string File {
@@ -337,16 +342,23 @@ namespace MonoDevelop.GtkCore.GuiBuilder
void OnFileAdded (object sender, ProjectFileEventArgs e)
{
foreach (ProjectFileEventInfo args in e) {
- var doc = TypeSystemService.ParseFile (args.Project, args.ProjectFile.Name);
+ var docId = TypeSystemService.GetDocumentId (args.Project, args.ProjectFile.Name);
+ if (docId == null)
+ continue;
+ var doc = TypeSystemService.GetCodeAnalysisDocument (docId);
if (doc == null)
continue;
string dir = Path.Combine (Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "stetic"), "deleted-designs");
if (!Directory.Exists (dir) || Directory.GetFiles (dir).Length == 0)
continue;
-
- foreach (var t in doc.TopLevelTypeDefinitions) {
- string path = Path.Combine (dir, t.FullName + ".xml");
+ var semanticModel = doc.GetSemanticModelAsync ().Result;
+ if (semanticModel == null)
+ continue;
+
+ foreach (var classDeclaration in semanticModel.SyntaxTree.GetRoot ().DescendantNodesAndSelf (child => !(child is BaseTypeDeclarationSyntax)).OfType<ClassDeclarationSyntax> ()) {
+ var c = semanticModel.GetDeclaredSymbol (classDeclaration);
+ string path = Path.Combine (dir, c.ToDisplayString (Microsoft.CodeAnalysis.SymbolDisplayFormat.CSharpErrorMessageFormat) + ".xml");
if (!System.IO.File.Exists (path))
continue;
XmlDocument xmldoc = new XmlDocument ();
@@ -362,12 +374,21 @@ namespace MonoDevelop.GtkCore.GuiBuilder
ArrayList toDelete = new ArrayList ();
foreach (ProjectFileEventInfo args in e) {
- var doc = TypeSystemService.ParseFile (args.Project, args.ProjectFile.Name);
+
+ var docId = TypeSystemService.GetDocumentId (args.Project, args.ProjectFile.Name);
+ if (docId == null)
+ continue;
+ var doc = TypeSystemService.GetCodeAnalysisDocument (docId);
if (doc == null)
continue;
+ var semanticModel = doc.GetSemanticModelAsync ().Result;
+ if (semanticModel == null)
+ continue;
+
- foreach (var t in doc.TopLevelTypeDefinitions) {
- GuiBuilderWindow win = GetWindowForClass (t.FullName);
+ foreach (var classDeclaration in semanticModel.SyntaxTree.GetRoot ().DescendantNodesAndSelf (child => !(child is BaseTypeDeclarationSyntax)).OfType<ClassDeclarationSyntax> ()) {
+ var c = semanticModel.GetDeclaredSymbol (classDeclaration);
+ GuiBuilderWindow win = GetWindowForClass (c.ToDisplayString (Microsoft.CodeAnalysis.SymbolDisplayFormat.MinimallyQualifiedFormat));
if (win != null)
toDelete.Add (win);
}
@@ -410,7 +431,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
string path = null;
if (pref.ReferenceType == ReferenceType.Project) {
- DotNetProject p = project.ParentSolution.FindProjectByName (pref.Reference) as DotNetProject;
+ DotNetProject p = pref.ResolveProject (project.ParentSolution) as DotNetProject;
if (p != null)
path = p.GetOutputFileName (IdeApp.Workspace.ActiveConfiguration);
} else if (pref.ReferenceType == ReferenceType.Assembly) {
@@ -444,8 +465,8 @@ namespace MonoDevelop.GtkCore.GuiBuilder
}
}
return null;
- }
-
+ }
+
public GuiBuilderWindow GetWindowForFile (FilePath fileName)
{
if (Windows != null) {
@@ -466,8 +487,8 @@ namespace MonoDevelop.GtkCore.GuiBuilder
}
}
return null;
- }
-
+ }
+
public Stetic.ActionGroupInfo GetActionGroupForFile (FilePath fileName)
{
foreach (Stetic.ActionGroupInfo group in SteticProject.ActionGroups) {
@@ -480,67 +501,70 @@ namespace MonoDevelop.GtkCore.GuiBuilder
public Stetic.ActionGroupInfo GetActionGroup (string name)
{
return SteticProject.GetActionGroup (name);
- }
-
+ }
+
public FilePath GetSourceCodeFile (Stetic.ProjectItemInfo obj)
{
return GetSourceCodeFile (obj, true);
- }
-
+ }
+
public FilePath GetSourceCodeFile (Stetic.ProjectItemInfo obj, bool getUserClass)
{
var cls = GetClass (obj, getUserClass);
if (cls != null)
- return cls.Region.FileName;
+ return cls.Locations.First ().SourceTree.FilePath;
return null;
}
- IUnresolvedTypeDefinition GetClass (Stetic.ProjectItemInfo obj, bool getUserClass)
+ INamedTypeSymbol GetClass (Stetic.ProjectItemInfo obj, bool getUserClass)
{
string name = CodeBinder.GetClassName (obj);
return FindClass (name, getUserClass);
}
- public IUnresolvedTypeDefinition FindClass (string className)
+ public INamedTypeSymbol FindClass (string className)
{
return FindClass (className, true);
}
- public IUnresolvedTypeDefinition FindClass (string className, bool getUserClass)
- {
+ public INamedTypeSymbol FindClass (string className, bool getUserClass)
+ {
FilePath gui_folder = GtkDesignInfo.FromProject (project).GtkGuiFolder;
var ctx = GetParserContext ();
if (ctx == null)
return null;
- var classes = ctx.MainAssembly.GetAllTypeDefinitions ();
- if (classes == null)
- return null;
- foreach (var cls in classes) {
- if (cls.FullName == className) {
+ foreach (var cls in ctx.GetAllTypesInMainAssembly ()) {
+ if (cls.GetFullName() == className) {
if (getUserClass) {
// Return this class only if it is declared outside the gtk-gui
// folder. Generated partial classes will be ignored.
- foreach (var part in cls.Parts) {
- if (!string.IsNullOrEmpty (part.Region.FileName) && !((FilePath)cls.Region.FileName).IsChildPathOf (gui_folder)) {
- return part;
+ foreach (var part in cls.Locations) {
+ var filePath = part.SourceTree.FilePath;
+ if (!string.IsNullOrEmpty (filePath) && !((FilePath)filePath).IsChildPathOf (gui_folder)) {
+ return cls;
}
}
continue;
}
- if (getUserClass && !string.IsNullOrEmpty (cls.Region.FileName) && ((FilePath)cls.Region.FileName).IsChildPathOf (gui_folder))
+ if (getUserClass && !string.IsNullOrEmpty (cls.Locations.First ().SourceTree.FilePath) && ((FilePath)cls.Locations.First ().SourceTree.FilePath).IsChildPathOf (gui_folder))
continue;
- return cls.Parts.First ();
+ return cls;
}
}
return null;
}
- public ICompilation GetParserContext ()
+ public Compilation GetParserContext ()
{
- var dom = TypeSystemService.GetCompilation (Project);
+ System.Threading.Tasks.Task<Compilation> task;
+ do {
+ task = TypeSystemService.GetCompilationAsync (Project);
+ task.Wait (500);
+ } while (!task.IsCompleted);
+
+ var dom = task.Result;
if (dom != null && needsUpdate) {
needsUpdate = false;
-// dom.ForceUpdate ();
}
return dom;
}
@@ -629,7 +653,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
if (hasError)
return files;
- IDotNetLanguageBinding binding = LanguageBindingService.GetBindingPerLanguageName (project.LanguageName) as IDotNetLanguageBinding;
+ var binding = LanguageBindingService.GetBindingPerLanguageName (project.LanguageName);
string path = Path.Combine (guiFolder, binding.GetFileName ("generated"));
if (!System.IO.File.Exists (path)) {
// Generate an empty build class
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs
index 40b3c74d59..c765892291 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs
@@ -42,6 +42,8 @@ using MonoDevelop.Projects.Policies;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.TypeSystem;
+using System.Threading.Tasks;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.GtkCore.GuiBuilder
@@ -111,7 +113,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
public static Stetic.Application SteticApp {
get {
// Stetic is not thread safe, so all has to be done in the gui thread
- DispatchService.AssertGuiThread ();
+ Runtime.AssertMainThread ();
if (steticApp == null) {
steticApp = Stetic.ApplicationFactory.CreateApplication (Stetic.IsolationMode.None);
steticApp.AllowInProcLibraries = false;
@@ -166,7 +168,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
}
}
- public static ActionGroupView OpenActionGroup (Project project, Stetic.ActionGroupInfo group)
+ public static async Task<ActionGroupView> OpenActionGroup (Project project, Stetic.ActionGroupInfo group)
{
GuiBuilderProject p = GtkDesignInfo.FromProject (project).GuiBuilderProject ;
string file = p != null ? p.GetSourceCodeFile (group) : null;
@@ -174,7 +176,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
file = ActionGroupDisplayBinding.BindToClass (project, group);
}
- Document doc = IdeApp.Workbench.OpenDocument (file, true);
+ Document doc = await IdeApp.Workbench.OpenDocument (file, true);
if (doc != null) {
ActionGroupView view = doc.GetContent<ActionGroupView> ();
if (view != null) {
@@ -323,7 +325,6 @@ namespace MonoDevelop.GtkCore.GuiBuilder
component = item.Component;
CodeCompileUnit cu = new CodeCompileUnit ();
-
if (project.UsePartialTypes) {
CodeNamespace cns = new CodeNamespace (ns);
cu.Namespaces.Add (cns);
@@ -333,6 +334,11 @@ namespace MonoDevelop.GtkCore.GuiBuilder
type.Attributes = MemberAttributes.Public;
type.TypeAttributes = System.Reflection.TypeAttributes.Public;
cns.Types.Add (type);
+ type.Members.Add (
+ new CodeMemberMethod () {
+ Name = "Build"
+ }
+ );
foreach (Stetic.ObjectBindInfo binfo in component.GetObjectBindInfo ()) {
// When a component is being renamed, we have to generate the
@@ -369,10 +375,9 @@ namespace MonoDevelop.GtkCore.GuiBuilder
text = fileStream.ToString ();
text = FormatGeneratedFile (fileName, text, project, provider);
}
-
if (saveToFile)
File.WriteAllText (fileName, text);
- TypeSystemService.ParseFile (project, fileName);
+ TypeSystemService.NotifyFileChange (fileName, text);
//
// if (ProjectDomService.HasDom (project)) {
// // Only update the parser database if the project is actually loaded in the IDE.
@@ -385,7 +390,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
}
- public static Stetic.CodeGenerationResult GenerateSteticCode (IProgressMonitor monitor, DotNetProject project, ConfigurationSelector configuration)
+ public async static Task<Stetic.CodeGenerationResult> GenerateSteticCode (ProgressMonitor monitor, DotNetProject project, ConfigurationSelector configuration)
{
if (generating || !GtkDesignInfo.HasDesignedObjects (project))
return null;
@@ -422,9 +427,9 @@ namespace MonoDevelop.GtkCore.GuiBuilder
return null;
if (info.GuiBuilderProject.HasError) {
- monitor.ReportError (GettextCatalog.GetString ("GUI code generation failed for project '{0}'. The file '{1}' could not be loaded.", project.Name, info.SteticFile), null);
- monitor.AsyncOperation.Cancel ();
- return null;
+ var error = GettextCatalog.GetString ("GUI code generation failed for project '{0}'. The file '{1}' could not be loaded.", project.Name, info.SteticFile);
+ monitor.ReportError (error, null);
+ throw new UserException (error);
}
if (info.GuiBuilderProject.IsEmpty)
@@ -454,8 +459,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
if (!canGenerateInProcess) {
timer.Trace ("Generating out of process");
- // Run the generation in another thread to avoid freezing the GUI
- System.Threading.ThreadPool.QueueUserWorkItem (delegate {
+ await Task.Run (delegate {
try {
// Generate the code in another process if stetic is not isolated
CodeGeneratorProcess cob = (CodeGeneratorProcess)Runtime.ProcessService.CreateExternalProcessObject (typeof(CodeGeneratorProcess), false);
@@ -469,10 +473,6 @@ namespace MonoDevelop.GtkCore.GuiBuilder
}
});
- while (generating) {
- DispatchService.RunPendingEvents ();
- System.Threading.Thread.Sleep (100);
- }
} else {
timer.Trace ("Generating in-process");
// No need to create another process, since stetic has its own backend process
@@ -544,7 +544,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
// Make sure the generated files are added to the project
if (info.UpdateGtkFolder ()) {
Gtk.Application.Invoke (delegate {
- IdeApp.ProjectOperations.Save (project);
+ IdeApp.ProjectOperations.SaveAsync (project);
});
}
@@ -592,7 +592,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
static string StripHeaderAndBlankLines (string text, CodeDomProvider provider)
{
- Mono.TextEditor.TextDocument doc = new Mono.TextEditor.TextDocument ();
+ var doc = TextEditorFactory.CreateNewDocument ();
doc.Text = text;
int realStartLine = 0;
for (int i = 1; i <= doc.LineCount; i++) {
@@ -610,11 +610,11 @@ namespace MonoDevelop.GtkCore.GuiBuilder
if (provider is Microsoft.CSharp.CSharpCodeProvider) {
bool previousWasBlank = false;
for (int i = 1; i <= doc.LineCount; i++) {
- Mono.TextEditor.DocumentLine line = doc.GetLine (i);
+ var line = doc.GetLine (i);
bool isBlank, isBracket;
CheckLine (doc, line, out isBlank, out isBracket);
if (isBlank && previousWasBlank && line.LengthIncludingDelimiter > 0) {
- doc.Remove (line.Offset, line.LengthIncludingDelimiter);
+ doc.RemoveText (line.Offset, line.LengthIncludingDelimiter);
i--;
}
previousWasBlank = isBlank || isBracket;
@@ -622,10 +622,10 @@ namespace MonoDevelop.GtkCore.GuiBuilder
}
int offset = doc.GetLine (realStartLine).Offset;
- return doc.GetTextAt (offset, doc.TextLength - offset);
+ return doc.GetTextAt (offset, doc.Length - offset);
}
- static void CheckLine (Mono.TextEditor.TextDocument doc, Mono.TextEditor.DocumentLine line, out bool isBlank, out bool isBracket)
+ static void CheckLine (IReadonlyTextDocument doc, IDocumentLine line, out bool isBlank, out bool isBracket)
{
isBlank = true;
isBracket = false;
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs
index 0a33c84717..f1b4ded7ea 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs
@@ -28,6 +28,7 @@
using System;
+using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
@@ -37,16 +38,19 @@ using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Commands;
using MonoDevelop.Components.Commands;
using MonoDevelop.Projects;
-using MonoDevelop.DesignerSupport.Toolbox;
+using MonoDevelop.DesignerSupport.Toolbox;
using MonoDevelop.DesignerSupport;
using Gtk;
using Gdk;
using MonoDevelop.Ide;
+using Microsoft.CodeAnalysis;
+using System.Threading.Tasks;
+using MonoDevelop.Refactoring;
namespace MonoDevelop.GtkCore.GuiBuilder
{
- public class GuiBuilderView : CombinedDesignView, ISupportsProjectReload
+ public class GuiBuilderView : CombinedDesignView
{
Stetic.WidgetDesigner designer;
Stetic.ActionGroupDesigner actionsBox;
@@ -61,7 +65,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
string rootName;
object designerStatus;
- public GuiBuilderView (IViewContent content, GuiBuilderWindow window): base (content)
+ public GuiBuilderView (ViewContent content, GuiBuilderWindow window): base (content)
{
rootName = window.Name;
@@ -84,14 +88,16 @@ namespace MonoDevelop.GtkCore.GuiBuilder
LoadDesigner ();
}
- ProjectReloadCapability ISupportsProjectReload.ProjectReloadCapability {
+ public override ProjectReloadCapability ProjectReloadCapability {
get {
return ProjectReloadCapability.Full;
}
}
-
- void ISupportsProjectReload.Update (Project project)
+
+ protected override void OnSetProject (Projects.Project project)
{
+ base.OnSetProject (project);
+
if (gproject != null && gproject.Project == project)
return;
@@ -101,7 +107,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
CloseDesigner ();
CloseProject ();
if (project != null) {
- GuiBuilderWindow w = GuiBuilderDisplayBinding.GetWindow (this.ContentName);
+ GuiBuilderWindow w = GuiBuilderDisplayBinding.GetWindow (this.ContentName, project);
if (w != null) {
AttachWindow (w);
if (designerStatus != null)
@@ -262,7 +268,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
codeBinder.TargetObject = designer.RootComponent;
}
- void OnComponentNameChanged (object s, Stetic.ComponentNameEventArgs args)
+ async void OnComponentNameChanged (object s, Stetic.ComponentNameEventArgs args)
{
try {
// Make sure the fields in the partial class are up to date.
@@ -273,7 +279,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
if (gproject.Project.UsePartialTypes)
GuiBuilderService.GenerateSteticCodeStructure ((DotNetProject)gproject.Project, designer.RootComponent, args, false, false);
- codeBinder.UpdateField (args.Component, args.OldName);
+ await codeBinder.UpdateField (args.Component, args.OldName);
}
catch (Exception ex) {
LoggingService.LogInternalError (ex);
@@ -294,21 +300,19 @@ namespace MonoDevelop.GtkCore.GuiBuilder
void OnWindowModifiedChanged (object s, EventArgs args)
{
- if (IsDirty)
- OnContentChanged (args);
- OnDirtyChanged (args);
+ OnDirtyChanged ();
}
- void OnBindWidgetField (object o, EventArgs a)
+ async void OnBindWidgetField (object o, EventArgs a)
{
if (designer.Selection != null)
- codeBinder.BindToField (designer.Selection);
+ await codeBinder.BindToField (designer.Selection);
}
- void OnBindActionField (object o, EventArgs a)
+ async void OnBindActionField (object o, EventArgs a)
{
if (actionsBox.SelectedAction != null)
- codeBinder.BindToField (actionsBox.SelectedAction);
+ await codeBinder.BindToField (actionsBox.SelectedAction);
}
void OnSignalAdded (object sender, Stetic.ComponentSignalEventArgs args)
@@ -320,21 +324,21 @@ namespace MonoDevelop.GtkCore.GuiBuilder
{
}
- void OnSignalChanged (object sender, Stetic.ComponentSignalEventArgs args)
+ async void OnSignalChanged (object sender, Stetic.ComponentSignalEventArgs args)
{
- codeBinder.UpdateSignal (args.OldSignal, args.Signal);
+ await codeBinder.UpdateSignal (args.OldSignal, args.Signal);
}
- public override void Save (string fileName)
+ public override async Task Save (FileSaveInformation fileSaveInformation)
{
- base.Save (fileName);
+ await base.Save (fileSaveInformation);
if (designer == null)
return;
string oldBuildFile = GuiBuilderService.GetBuildCodeFileName (gproject.Project, window.RootWidget.Name);
- codeBinder.UpdateBindings (fileName);
+ codeBinder.UpdateBindings (fileSaveInformation.FileName);
if (!ErrorMode) {
if (designer != null)
designer.Save ();
@@ -369,12 +373,13 @@ namespace MonoDevelop.GtkCore.GuiBuilder
var cls = codeBinder.GetClass ();
if (cls == null)
return;
- foreach (var met in cls.Methods) {
- if (met.Name == signal.Handler) {
- ShowPage (0);
- JumpTo (met.Region.BeginLine, met.Region.BeginColumn);
- break;
- }
+ var met = cls
+ .GetMembers (signal.Handler)
+ .OfType<IMethodSymbol> ()
+ .FirstOrDefault ();
+ if (met != null) {
+ ShowPage (0);
+ RefactoringService.RoslynJumpToDeclaration (met);
}
}
@@ -490,7 +495,7 @@ namespace MonoDevelop.GtkCore.GuiBuilder
if (node.Reference == null)
return;
- ProjectReference pref;
+ MonoDevelop.Projects.ProjectReference pref;
// If the class name includes an assembly name it means that the
// widget is implemented in another assembly, not in the one that
@@ -506,16 +511,16 @@ namespace MonoDevelop.GtkCore.GuiBuilder
if (asm == null)
return;
if (gproject.Project.AssemblyContext.GetPackagesFromFullName (asm).Length > 0) {
- pref = new ProjectReference (ReferenceType.Package, asm);
+ pref = MonoDevelop.Projects.ProjectReference.CreateAssemblyReference (asm);
} else {
asm = gproject.Project.AssemblyContext.GetAssemblyLocation (asm, gproject.Project.TargetFramework);
- pref = new ProjectReference (ReferenceType.Assembly, asm);
+ pref = MonoDevelop.Projects.ProjectReference.CreateAssemblyFileReference (asm);
}
}
else
- pref = new ProjectReference (node.ReferenceType, node.Reference);
+ pref = MonoDevelop.Projects.ProjectReference.CreateCustomReference (node.ReferenceType, node.Reference);
- foreach (ProjectReference pr in gproject.Project.References) {
+ foreach (var pr in gproject.Project.References) {
if (pr.Reference == pref.Reference)
return;
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs
index 6b16de95e7..4a60c3f121 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs
@@ -37,7 +37,11 @@ using MonoDevelop.Projects;
using MonoDevelop.Projects.Text;
using MonoDevelop.GtkCore.Dialogs;
using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.TypeSystem;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp;
+using ICSharpCode.NRefactory6.CSharp.Completion;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.TypeSystem;
namespace MonoDevelop.GtkCore.GuiBuilder
{
@@ -107,9 +111,9 @@ namespace MonoDevelop.GtkCore.GuiBuilder
// Find the classes that could be bound to this design
var ctx = fproject.GetParserContext ();
ArrayList list = new ArrayList ();
- foreach (var cls in ctx.MainAssembly.GetAllTypeDefinitions ()) {
+ foreach (var cls in ctx.GetAllTypesInMainAssembly ()) {
if (IsValidClass (cls))
- list.Add (cls.FullName);
+ list.Add (cls.GetFullName ());
}
// Ask what to do
@@ -224,27 +228,23 @@ namespace MonoDevelop.GtkCore.GuiBuilder
}
}
- internal bool IsValidClass (IType cls)
+ internal bool IsValidClass (ITypeSymbol cls)
{
- foreach (var bt in cls.DirectBaseTypes) {
- if (bt.ReflectionName == rootWidget.Component.Type.ClassName)
- return true;
-
- var baseCls = bt;
- if (baseCls != null && IsValidClass (baseCls))
- return true;
- }
- return false;
+ if (cls.SpecialType == Microsoft.CodeAnalysis.SpecialType.System_Object)
+ return false;
+ if (cls.BaseType.GetFullName () == rootWidget.Component.Type.ClassName)
+ return true;
+ return IsValidClass (cls.BaseType);
}
}
class OpenDocumentFileProvider: ITextFileProvider
- {
- public IEditableTextFile GetEditableTextFile (FilePath filePath)
+ {
+ public ITextDocument GetEditableTextFile (FilePath filePath)
{
- foreach (Document doc in IdeApp.Workbench.Documents) {
+ foreach (var doc in IdeApp.Workbench.Documents) {
if (doc.FileName == filePath) {
- IEditableTextFile ef = doc.GetContent<IEditableTextFile> ();
+ var ef = doc.Editor;
if (ef != null) return ef;
}
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs
index 1cb98ff733..78ca552c89 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs
@@ -58,11 +58,10 @@ namespace MonoDevelop.GtkCore.GuiBuilder
}
List<ItemToolboxNode> list = new List<ItemToolboxNode> ();
- ComponentType[] types = null;
- DispatchService.GuiSyncDispatch (delegate {
+ var types = Runtime.RunInMainThread (delegate {
// Stetic is not thread safe, it has to be used from the gui thread
- types = GuiBuilderService.SteticApp.GetComponentTypes (filename);
- });
+ return GuiBuilderService.SteticApp.GetComponentTypes (filename);
+ }).Result;
foreach (ComponentType ct in types) {
if (ct.Category == "window")
continue;
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs
index b83e9e7a11..ad6f2b722b 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs
@@ -86,14 +86,14 @@ namespace MonoDevelop.GtkCore.NodeBuilders
class ActionGroupCommandHandler: NodeCommandHandler
{
- public override void ActivateItem ()
+ public override async void ActivateItem ()
{
GuiBuilderWindow w = (GuiBuilderWindow) CurrentNode.GetParentDataItem (typeof(GuiBuilderWindow), false);
if (w != null) {
if (w.SourceCodeFile == FilePath.Null && !w.BindToClass ())
return;
- Document doc = IdeApp.Workbench.OpenDocument (w.SourceCodeFile, true);
+ Document doc = await IdeApp.Workbench.OpenDocument (w.SourceCodeFile, true);
if (doc != null) {
GuiBuilderView view = doc.GetContent<GuiBuilderView> ();
if (view != null)
@@ -103,7 +103,7 @@ namespace MonoDevelop.GtkCore.NodeBuilders
else {
Project project = (Project) CurrentNode.GetParentDataItem (typeof(Project), false);
Stetic.ActionGroupInfo group = (Stetic.ActionGroupInfo) CurrentNode.DataItem;
- GuiBuilderService.OpenActionGroup (project, group);
+ await GuiBuilderService.OpenActionGroup (project, group);
}
}
@@ -136,7 +136,7 @@ namespace MonoDevelop.GtkCore.NodeBuilders
}
gproject.RemoveActionGroup (group);
gproject.SaveProject (false);
- IdeApp.ProjectOperations.Save (project);
+ IdeApp.ProjectOperations.SaveAsync (project);
}
}
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs
index 59c1529d1a..42cfbd603d 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs
@@ -182,7 +182,7 @@ namespace MonoDevelop.GtkCore.NodeBuilders
IdeApp.ProjectOperations.CreateProjectFile (project, path, id);
- IdeApp.ProjectOperations.Save (project);
+ IdeApp.ProjectOperations.SaveAsync (project);
ITreeNavigator nav = Tree.GetNodeAtObject (dataItem);
if (nav != null)
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs
index 79e0b00d81..cf1ce14602 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs
@@ -81,9 +81,7 @@ namespace MonoDevelop.GtkCore.NodeBuilders
public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
{
GuiBuilderWindow win = (GuiBuilderWindow) dataObject;
- foreach (Stetic.ActionGroupInfo agroup in win.RootWidget.ActionGroups) {
- builder.AddChild (agroup);
- }
+ builder.AddChildren (win.RootWidget.ActionGroups);
}
public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
@@ -114,13 +112,13 @@ namespace MonoDevelop.GtkCore.NodeBuilders
class GladeWindowCommandHandler: NodeCommandHandler
{
- public override void ActivateItem ()
+ public override async void ActivateItem ()
{
GuiBuilderWindow w = (GuiBuilderWindow) CurrentNode.DataItem;
if (w.SourceCodeFile == FilePath.Null && !w.BindToClass ())
return;
- Document doc = IdeApp.Workbench.OpenDocument (w.SourceCodeFile, true);
+ Document doc = await IdeApp.Workbench.OpenDocument (w.SourceCodeFile, true);
if (doc != null) {
GuiBuilderView view = doc.GetContent<GuiBuilderView> ();
if (view != null)
@@ -141,7 +139,7 @@ namespace MonoDevelop.GtkCore.NodeBuilders
}
w.Project.Remove (w);
w.Project.SaveProject (false);
- IdeApp.ProjectOperations.Save (w.Project.Project);
+ IdeApp.ProjectOperations.SaveAsync (w.Project.Project);
}
}
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs
index b06919dae1..aea532fc77 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs
@@ -39,13 +39,6 @@ namespace MonoDevelop.GtkCore.NodeBuilders
{
public class WindowsFolderNodeBuilder: TypeNodeBuilder
{
- EventHandler updateDelegate;
-
- public WindowsFolderNodeBuilder ()
- {
- updateDelegate = (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnUpdateFiles));
- }
-
public override Type NodeDataType {
get { return typeof(WindowsFolder); }
}
@@ -82,10 +75,8 @@ namespace MonoDevelop.GtkCore.NodeBuilders
GtkDesignInfo info = GtkDesignInfo.FromProject (p);
if (!info.GuiBuilderProject.HasError) {
builder.AddChild (new StockIconsNode (p));
- foreach (GuiBuilderWindow fi in info.GuiBuilderProject.Windows)
- builder.AddChild (fi);
- foreach (Stetic.ActionGroupInfo group in info.GuiBuilderProject.SteticProject.ActionGroups)
- builder.AddChild (group);
+ builder.AddChildren (info.GuiBuilderProject.Windows);
+ builder.AddChildren (info.GuiBuilderProject.SteticProject.ActionGroups);
}
}
@@ -105,13 +96,13 @@ namespace MonoDevelop.GtkCore.NodeBuilders
public override void OnNodeAdded (object dataObject)
{
WindowsFolder w = (WindowsFolder) dataObject;
- w.Changed += updateDelegate;
+ w.Changed += OnUpdateFiles;
}
public override void OnNodeRemoved (object dataObject)
{
WindowsFolder w = (WindowsFolder)dataObject;
- w.Changed -= updateDelegate;
+ w.Changed -= OnUpdateFiles;
w.Dispose ();
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.addin.xml b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.addin.xml
index 16df403f52..3132051581 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.addin.xml
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.addin.xml
@@ -115,13 +115,6 @@
<CommandItem id = "MonoDevelop.GtkCore.GtkCommands.EditIcons" />
</Extension>
- <Extension path = "/MonoDevelop/ProjectModel/ExtendedProperties">
- <ItemProperty class = "MonoDevelop.Projects.Project"
- name = "GtkDesignInfo"
- skipEmpty = "True"
- type = "MonoDevelop.GtkCore.GtkDesignInfo" />
- </Extension>
-
<Extension path = "/MonoDevelop/Ide/StartupHandlers">
<Class class="MonoDevelop.GtkCore.GtkCoreStartupCommand" />
</Extension>
@@ -146,7 +139,7 @@
<StockIcon stockid = "md-gtkcore-actiongroup" resource = "actiongroup.png" />
</Extension>
- <Extension path = "/MonoDevelop/ProjectModel/ProjectServiceExtensions">
+ <Extension path = "/MonoDevelop/ProjectModel/ProjectModelExtensions">
<Class class = "MonoDevelop.GtkCore.GuiBuilder.GtkProjectServiceExtension" insertafter="MidStep"/>
</Extension>
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.csproj b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.csproj
index 6e4960f5ff..9b5c179396 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.csproj
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore.csproj
@@ -61,6 +61,26 @@
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System.Core" />
+ <Reference Include="System.Reflection.Metadata">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Reflection.Metadata.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Collections.Immutable">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Collections.Immutable.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.CSharp">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.Workspaces">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.Workspaces.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
@@ -93,11 +113,6 @@
<Name>libsteticui</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
- <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
- <Name>Mono.TextEditor</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\MonoDevelop.Refactoring\MonoDevelop.Refactoring.csproj">
<Project>{100568FC-F4E8-439B-94AD-41D11724E45B}</Project>
<Name>MonoDevelop.Refactoring</Name>
@@ -108,11 +123,6 @@
<Name>Mono.Cecil</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
- <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
- <Name>ICSharpCode.NRefactory</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\..\..\external\mono-addins\Mono.Addins\Mono.Addins.csproj">
<Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
<Name>Mono.Addins</Name>
@@ -123,6 +133,21 @@
<Name>Xwt</Name>
<Private>False</Private>
</ProjectReference>
+ <ProjectReference Include="..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
+ <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
+ <Name>Mono.TextEditor</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\CSharpBinding\CSharpBinding.csproj">
+ <Project>{07CC7654-27D6-421D-A64C-0FFA40456FA2}</Project>
+ <Name>CSharpBinding</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory.CSharp\ICSharpCode.NRefactory.CSharp.csproj">
+ <Project>{53DCA265-3C3C-42F9-B647-F72BA678122B}</Project>
+ <Name>ICSharpCode.NRefactory.CSharp</Name>
+ <Private>False</Private>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Makefile.am" />
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/GtkDesignInfo.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/GtkDesignInfo.cs
index e19b126148..c039499739 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/GtkDesignInfo.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/GtkDesignInfo.cs
@@ -45,7 +45,7 @@ namespace MonoDevelop.GtkCore
{
DotNetProject project;
GuiBuilderProject builderProject;
- IDotNetLanguageBinding binding;
+ LanguageBinding binding;
ProjectResourceProvider resourceProvider;
ReferenceManager referenceManager;
@@ -58,18 +58,16 @@ namespace MonoDevelop.GtkCore
[ItemProperty (DefaultValue="Gdk.Pixbuf")]
string imageResourceLoaderClass = "Gdk.Pixbuf";
- GtkDesignInfo ()
+ internal GtkDesignInfo ()
{
}
- GtkDesignInfo (DotNetProject project)
+ internal GtkDesignInfo (DotNetProject project)
{
- IExtendedDataItem item = (IExtendedDataItem) project;
- item.ExtendedProperties ["GtkDesignInfo"] = this;
Project = project;
}
- DotNetProject Project {
+ internal DotNetProject Project {
get { return project; }
set {
if (project == value)
@@ -86,7 +84,7 @@ namespace MonoDevelop.GtkCore
}
project = value;
if (project != null) {
- binding = LanguageBindingService.GetBindingPerLanguageName (project.LanguageName) as IDotNetLanguageBinding;
+ binding = LanguageBindingService.GetBindingPerLanguageName (project.LanguageName);
project.FileAddedToProject += OnFileEvent;
project.FileChangedInProject += OnFileEvent;
project.FileRemovedFromProject += OnFileEvent;
@@ -348,24 +346,21 @@ namespace MonoDevelop.GtkCore
info.CleanGtkFolder (saveFiles);
project.Files.Remove (info.ObjectsFile);
project.Files.Remove (info.SteticFile);
- IExtendedDataItem item = (IExtendedDataItem) project;
- item.ExtendedProperties.Remove ("GtkDesignInfo");
+
+ var ext = project.GetService<GtkProjectServiceExtension> ();
+ if (ext != null)
+ ext.DesignInfo = null;
info.Dispose ();
+
ProjectNodeBuilder.OnSupportChanged (project);
}
public static GtkDesignInfo FromProject (Project project)
{
- if (!(project is DotNetProject))
- return new GtkDesignInfo ();
-
- IExtendedDataItem item = (IExtendedDataItem) project;
- GtkDesignInfo info = item.ExtendedProperties ["GtkDesignInfo"] as GtkDesignInfo;
- if (info == null)
- info = new GtkDesignInfo ((DotNetProject) project);
- else
- info.Project = (DotNetProject) project;
- return info;
+ var ext = project.GetService<GtkProjectServiceExtension> ();
+ if (ext != null)
+ return ext.DesignInfo;
+ return new GtkDesignInfo ();
}
}
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ObjectsDocument.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ObjectsDocument.cs
index 14f8981c79..1a9d592dfb 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ObjectsDocument.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ObjectsDocument.cs
@@ -33,9 +33,11 @@ using System.CodeDom;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
-
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp;
+using MonoDevelop.CSharp.Refactoring;
+using MonoDevelop.Refactoring;
namespace MonoDevelop.GtkCore
{
@@ -143,7 +145,7 @@ namespace MonoDevelop.GtkCore
StringCollection tb_names = new StringCollection ();
foreach (var cls in parser.GetToolboxItems().Values) {
UpdateClass (parser, stetic, cls, null);
- tb_names.Add (cls.FullName);
+ tb_names.Add (cls.GetFullName ());
}
List<XmlElement> toDelete = new List<XmlElement> ();
@@ -160,9 +162,9 @@ namespace MonoDevelop.GtkCore
Save ();
}
- void UpdateClass (WidgetParser parser, Stetic.Project stetic, ITypeDefinition widgetClass, ITypeDefinition wrapperClass)
+ void UpdateClass (WidgetParser parser, Stetic.Project stetic, ITypeSymbol widgetClass, ITypeSymbol wrapperClass)
{
- string typeName = widgetClass.FullName;
+ string typeName = widgetClass.GetFullName();
string basetypeName = GetBaseType (parser, widgetClass, stetic);
XmlElement objectElem = (XmlElement) SelectSingleNode ("objects/object[@type='" + typeName + "']");
@@ -171,14 +173,14 @@ namespace MonoDevelop.GtkCore
// The widget class is not yet in the XML file. Create an element for it.
objectElem = CreateElement ("object");
objectElem.SetAttribute ("type", typeName);
- string category = parser.GetCategory (widgetClass);
+ string category = widgetClass.GetComponentCategory();
if (category == String.Empty)
objectElem.SetAttribute ("palette-category", "General");
else
objectElem.SetAttribute ("palette-category", category);
objectElem.SetAttribute ("allow-children", "false");
if (wrapperClass != null)
- objectElem.SetAttribute ("wrapper", wrapperClass.FullName);
+ objectElem.SetAttribute ("wrapper", wrapperClass.GetFullName());
// By default add a reference to Gtk.Widget properties and events
XmlElement itemGroups = objectElem.OwnerDocument.CreateElement ("itemgroups");
@@ -194,7 +196,7 @@ namespace MonoDevelop.GtkCore
UpdateObject (parser, basetypeName, objectElem, widgetClass, wrapperClass);
}
- string GetBaseType (WidgetParser parser, ITypeDefinition widgetClass, Stetic.Project stetic)
+ string GetBaseType (WidgetParser parser, ITypeSymbol widgetClass, Stetic.Project stetic)
{
string[] types = stetic.GetWidgetTypes ();
Hashtable typesHash = new Hashtable ();
@@ -205,9 +207,9 @@ namespace MonoDevelop.GtkCore
return ret ?? "Gtk.Widget";
}
- void UpdateObject (WidgetParser parser, string topType, XmlElement objectElem, ITypeDefinition widgetClass, ITypeDefinition wrapperClass)
+ void UpdateObject (WidgetParser parser, string topType, XmlElement objectElem, ITypeSymbol widgetClass, ITypeSymbol wrapperClass)
{
- if (widgetClass.IsPublic)
+ if (widgetClass.DeclaredAccessibility == Accessibility.Public)
objectElem.RemoveAttribute ("internal");
else
objectElem.SetAttribute ("internal", "true");
@@ -219,10 +221,10 @@ namespace MonoDevelop.GtkCore
if (wrapperClass != null)
parser.CollectMembers (wrapperClass, false, null, properties, events);
- foreach (IProperty prop in properties.Values)
+ foreach (IPropertySymbol prop in properties.Values)
MergeProperty (parser, objectElem, prop);
- foreach (IEvent ev in events.Values)
+ foreach (IEventSymbol ev in events.Values)
MergeEvent (parser, objectElem, ev);
// Remove old properties
@@ -246,7 +248,7 @@ namespace MonoDevelop.GtkCore
}
}
- void MergeProperty (WidgetParser parser, XmlElement objectElem, IProperty prop)
+ void MergeProperty (WidgetParser parser, XmlElement objectElem, IPropertySymbol prop)
{
XmlElement itemGroups = objectElem ["itemgroups"];
if (itemGroups == null) {
@@ -254,8 +256,8 @@ namespace MonoDevelop.GtkCore
objectElem.AppendChild (itemGroups);
}
- string cat = parser.GetCategory (prop);
- XmlElement itemGroup = GetItemGroup (prop.DeclaringType, itemGroups, cat, "Properties");
+ string cat = prop.GetComponentCategory ();
+ XmlElement itemGroup = GetItemGroup (prop.ContainingType, itemGroups, cat, "Properties");
XmlElement propElem = (XmlElement) itemGroup.SelectSingleNode ("property[@name='" + prop.Name + "']");
if (propElem == null) {
@@ -265,7 +267,7 @@ namespace MonoDevelop.GtkCore
}
}
- void MergeEvent (WidgetParser parser, XmlElement objectElem, IEvent evnt)
+ void MergeEvent (WidgetParser parser, XmlElement objectElem, IEventSymbol evnt)
{
XmlElement itemGroups = objectElem ["signals"];
if (itemGroups == null) {
@@ -273,8 +275,8 @@ namespace MonoDevelop.GtkCore
objectElem.AppendChild (itemGroups);
}
- string cat = parser.GetCategory (evnt);
- XmlElement itemGroup = GetItemGroup (evnt.DeclaringType, itemGroups, cat, "Signals");
+ string cat = evnt.GetComponentCategory ();
+ XmlElement itemGroup = GetItemGroup (evnt.ContainingType, itemGroups, cat, "Signals");
XmlElement signalElem = (XmlElement) itemGroup.SelectSingleNode ("signal[@name='" + evnt.Name + "']");
if (signalElem == null) {
@@ -284,7 +286,7 @@ namespace MonoDevelop.GtkCore
}
}
- XmlElement GetItemGroup (IType cls, XmlElement itemGroups, string cat, string groupName)
+ XmlElement GetItemGroup (ITypeSymbol cls, XmlElement itemGroups, string cat, string groupName)
{
XmlElement itemGroup;
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ProjectResourceProvider.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ProjectResourceProvider.cs
index e1c46517d8..6128a6a9bf 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ProjectResourceProvider.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ProjectResourceProvider.cs
@@ -65,7 +65,7 @@ namespace MonoDevelop.GtkCore
public Stetic.ResourceInfo AddResource (string fileName)
{
ProjectFile file = project.AddFile (fileName, BuildAction.EmbeddedResource);
- IdeApp.ProjectOperations.Save (project);
+ IdeApp.ProjectOperations.SaveAsync (project);
return new Stetic.ResourceInfo (file.ResourceId, fileName);
}
@@ -74,7 +74,7 @@ namespace MonoDevelop.GtkCore
foreach (ProjectFile file in project.Files) {
if (resourceName == file.ResourceId) {
project.Files.Remove (file);
- IdeApp.ProjectOperations.Save (project);
+ IdeApp.ProjectOperations.SaveAsync (project);
return;
}
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ReferenceManager.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ReferenceManager.cs
index c3358977e4..f765f2a8f8 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ReferenceManager.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/ReferenceManager.cs
@@ -156,16 +156,16 @@ namespace MonoDevelop.GtkCore {
if (version != assm_version) {
project.References.Remove (r);
if (name == "gnome-sharp" && assm_version == "Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f") {
- project.References.Add (new ProjectReference (ReferenceType.Package, name + ", Version=2.24.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f"));
+ project.References.Add (ProjectReference.CreateAssemblyReference (name + ", Version=2.24.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f"));
} else {
- project.References.Add (new ProjectReference (ReferenceType.Package, name + ", " + assm_version));
+ project.References.Add (ProjectReference.CreateAssemblyReference (name + ", " + assm_version));
}
changed = true;
}
}
if (!gtk) {
- project.References.Add (new ProjectReference (ReferenceType.Package, "gtk-sharp" + ", " + assm_version));
+ project.References.Add (ProjectReference.CreateAssemblyReference ("gtk-sharp" + ", " + assm_version));
project.ExtendedProperties ["GtkReferenceExists"] = true;
changed = true;
}
@@ -175,7 +175,7 @@ namespace MonoDevelop.GtkCore {
GtkDesignInfo info = GtkDesignInfo.FromProject (project);
if (!gdk) {
- project.References.Add (new ProjectReference (ReferenceType.Package, "gdk-sharp" + ", " + assm_version));
+ project.References.Add (ProjectReference.CreateAssemblyReference ("gdk-sharp" + ", " + assm_version));
changed = true;
}
@@ -185,7 +185,7 @@ namespace MonoDevelop.GtkCore {
if (aname != null) {
aname = project.AssemblyContext.GetAssemblyNameForVersion (aname, project.TargetFramework);
if (aname != null) {
- project.References.Add (new ProjectReference (ReferenceType.Package, aname));
+ project.References.Add (ProjectReference.CreateAssemblyReference (aname));
changed = true;
}
}
@@ -231,7 +231,7 @@ namespace MonoDevelop.GtkCore {
dnp.ExtendedProperties ["GtkReferenceExists"] = false;
GtkDesignInfo.DisableProject (dnp);
} else
- dnp.References.Add (new ProjectReference (ReferenceType.Package, args.ProjectReference.StoredReference));
+ dnp.References.Add (ProjectReference.CreateAssemblyReference (args.ProjectReference.StoredReference));
}
static string GetReferenceName (ProjectReference pref)
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs
index 68161a0a33..898b68a8cc 100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs
@@ -77,7 +77,7 @@ namespace MonoDevelop.GtkCore
return (project is DotNetProject) && GtkDesignInfo.SupportsRefactoring (project as DotNetProject);
}
- public override bool AddToProject (SolutionItem policyParent, Project project, string language, string directory, string name)
+ public override bool AddToProject (SolutionFolderItem policyParent, Project project, string language, string directory, string name)
{
if (!GtkDesignInfo.SupportsDesigner (project)) {
ReferenceManager mgr = new ReferenceManager (project as DotNetProject);
@@ -92,8 +92,8 @@ namespace MonoDevelop.GtkCore
string fileName = fileTemplate.GetFileName (policyParent, project, language, directory, name);
fileTemplate.AddToProject (policyParent, project, language, directory, name);
- TypeSystemService.ParseFile (project, fileName);
-
+ FileService.NotifyFileChanged (fileName);
+
DotNetProject netProject = project as DotNetProject;
string ns = netProject != null ? netProject.GetDefaultNamespace (fileName) : "";
string cname = Path.GetFileNameWithoutExtension (fileName);
@@ -114,7 +114,7 @@ namespace MonoDevelop.GtkCore
gproject.AddNewComponent (doc.DocumentElement);
gproject.SaveAll (false);
- IdeApp.ProjectOperations.Save (project);
+ IdeApp.ProjectOperations.SaveAsync (project);
return true;
}
@@ -128,7 +128,7 @@ namespace MonoDevelop.GtkCore
gproject.SteticProject.AddNewActionGroup (doc.DocumentElement);
gproject.SaveAll (false);
- IdeApp.ProjectOperations.Save (project);
+ IdeApp.ProjectOperations.SaveAsync (project);
return true;
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/WidgetParser.cs b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/WidgetParser.cs
index 71d2d8d953..4a8a594040 100755..100644
--- a/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/WidgetParser.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/MonoDevelop.GtkCore/WidgetParser.cs
@@ -33,193 +33,99 @@ using System.CodeDom;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.Semantics;
using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem.Implementation;
+using Microsoft.CodeAnalysis;
+using ICSharpCode.NRefactory6.CSharp.Completion;
+using System.Linq;
+using ICSharpCode.NRefactory6.CSharp;
namespace MonoDevelop.GtkCore
{
public class WidgetParser
{
- ICompilation ctx;
+ Compilation ctx;
- public ICompilation Ctx {
+ public Compilation Ctx {
get {
return ctx;
}
}
- public WidgetParser (ICompilation ctx)
+ public WidgetParser (Compilation ctx)
{
this.ctx = ctx;
}
- public Dictionary<string, ITypeDefinition> GetToolboxItems ()
+ static bool IsWidget(INamedTypeSymbol type)
{
- Dictionary<string, ITypeDefinition> tb_items = new Dictionary<string, ITypeDefinition> ();
+ if (type.SpecialType == SpecialType.System_Object)
+ return false;
+ if (type.GetFullName () == "Gtk.Widget")
+ return true;
+
+ return IsWidget (type.BaseType);
+ }
+
+ public Dictionary<string, INamedTypeSymbol> GetToolboxItems ()
+ {
+ var tb_items = new Dictionary<string, INamedTypeSymbol> ();
- var wt = ctx.FindType (new FullTypeName ("Gtk.Widget"));
- if (wt != null && !(wt is UnknownType)) {
- foreach (var t in wt.GetSubTypeDefinitions ()) {
- if (IsToolboxWidget (t))
- tb_items [t.FullName] = t;
- }
+ foreach (var t in ctx.GetAllTypesInMainAssembly ()) {
+ if (t.IsToolboxItem() && IsWidget(t))
+ tb_items [t.GetFullName ()] = t;
}
return tb_items;
}
- public void CollectMembers (ITypeDefinition cls, bool inherited, string topType, ListDictionary properties, ListDictionary events)
+ public void CollectMembers (ITypeSymbol cls, bool inherited, string topType, ListDictionary properties, ListDictionary events)
{
- if (cls.FullName == topType)
+ if (cls.GetFullName () == topType)
return;
- foreach (IProperty prop in cls.Properties)
+ foreach (var prop in cls.GetMembers ().OfType<IPropertySymbol> ())
if (IsBrowsable (prop))
properties [prop.Name] = prop;
- foreach (IEvent ev in cls.Events)
+ foreach (var ev in cls.GetMembers ().OfType<IEventSymbol> ())
if (IsBrowsable (ev))
events [ev.Name] = ev;
if (inherited) {
- foreach (var bcls in cls.DirectBaseTypes) {
- if (bcls.GetDefinition () != null && bcls.Kind != TypeKind.Class)
- CollectMembers (bcls.GetDefinition (), true, topType, properties, events);
- }
+ CollectMembers (cls.BaseType, true, topType, properties, events);
}
}
- public string GetBaseType (ITypeDefinition cls, Hashtable knownTypes)
+ public string GetBaseType (ITypeSymbol cls, Hashtable knownTypes)
{
- foreach (var bt in cls.DirectBaseTypes) {
- string name = bt.ReflectionName;
- if (knownTypes.Contains (name))
- return name;
- }
-
- foreach (var bcls in cls.DirectBaseTypes) {
- if (bcls.GetDefinition () != null) {
- string ret = GetBaseType (bcls.GetDefinition (), knownTypes);
- if (ret != null)
- return ret;
- }
- }
- return null;
+ if (cls.SpecialType == SpecialType.System_Object)
+ return null;
+ if (knownTypes.Contains (cls.BaseType.GetFullName ()))
+ return cls.BaseType.GetFullName ();
+ return GetBaseType (cls.BaseType, knownTypes);
}
- public string GetCategory (IEntity decoration)
- {
-// foreach (IAttributeSection section in decoration.Attributes) {
- foreach (IAttribute at in decoration.Attributes) {
- var type = at.AttributeType;
- switch (type.ReflectionName) {
- case "Category":
- case "CategoryAttribute":
- case "System.ComponentModel.Category":
- case "System.ComponentModel.CategoryAttribute":
- break;
- default:
- continue;
- }
- var pargs = at.PositionalArguments;
- if (pargs != null && pargs.Count > 0) {
- var val = pargs[0] as ConstantResolveResult;
- if (val != null && val.ConstantValue is string)
- return val.ConstantValue.ToString ();
- }
- }
- // }
- return "";
- }
- public ITypeDefinition GetClass (string classname)
+ public INamedTypeSymbol GetClass (string classname)
{
- string name, ns;
- int idx =classname.LastIndexOf ('.');
- if (idx >= 0){
- ns = classname.Substring (0, idx);
- name = classname.Substring (idx + 1);
- } else {
- ns = "";
- name = classname;
- }
- return ctx.MainAssembly.GetTypeDefinition (ns, name, 0);
+ return ctx.GetTypeByMetadataName (classname);
}
- public bool IsBrowsable (IMember member)
+ public bool IsBrowsable (ISymbol member)
{
- if (!member.IsPublic)
+ if (member.DeclaredAccessibility != Accessibility.Public)
return false;
- IProperty prop = member as IProperty;
+ var prop = member as IPropertySymbol;
if (prop != null) {
- if (!prop.CanGet || !prop.CanSet)
+ if (prop.GetMethod == null || prop.SetMethod == null)
return false;
- if (Array.IndexOf (supported_types, prop.ReturnType.ReflectionName) == -1)
+ if (Array.IndexOf (supported_types, prop.Type.GetFullName ()) == -1)
return false;
}
- // foreach (IAttributeSection section in member.Attributes) {
- foreach (IAttribute at in member.Attributes) {
- var type = at.AttributeType;
- switch (type.ReflectionName) {
- case "Browsable":
- case "BrowsableAttribute":
- case "System.ComponentModel.Browsable":
- case "System.ComponentModel.BrowsableAttribute":
- break;
- default:
- continue;
- }
- var pargs = at.PositionalArguments;
- if (pargs != null && pargs.Count > 0) {
- var val = pargs[0] as ConstantResolveResult;
- if (val.ConstantValue is bool) {
- return (bool) val.ConstantValue;
- }
- }
- }
- // }
- return true;
- }
-
- public bool IsToolboxWidget (ITypeDefinition cls)
- {
- if (!cls.IsPublic)
- return false;
-
- foreach (IAttribute at in cls.Attributes) {
- var type = at.AttributeType;
- switch (type.ReflectionName) {
- case "ToolboxItem":
- case "ToolboxItemAttribute":
- case "System.ComponentModel.ToolboxItem":
- case "System.ComponentModel.ToolboxItemAttribute":
- break;
- default:
- continue;
- }
- var pargs = at.PositionalArguments;
- if (pargs != null && pargs.Count > 0) {
- var val = pargs[0] as ConstantResolveResult;
- if (val.ConstantValue == null)
- return false;
- else if (val.ConstantValue is bool)
- return (bool) val.ConstantValue;
- else
- return val.ConstantValue != null;
- }
- }
-
- foreach (var bcls in cls.DirectBaseTypes) {
- if (bcls.GetDefinition () != null && bcls.Kind != TypeKind.Interface)
- return IsToolboxWidget (bcls.GetDefinition ());
- }
-
- return false;
+ return member.IsDesignerBrowsable ();
}
static string[] supported_types = new string[] {
diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/ChangeLog b/main/src/addins/MonoDevelop.GtkCore/libstetic/ChangeLog
deleted file mode 100644
index 70f98ba295..0000000000
--- a/main/src/addins/MonoDevelop.GtkCore/libstetic/ChangeLog
+++ /dev/null
@@ -1,1748 +0,0 @@
-2010-06-09 Mike Krüger <mkrueger@novell.com>
-
- * DND.cs: Fixed stetic crash when drag & drop widgets on mac.
-
-2010-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * GladeUtils.cs:
- * wrapper/objects.xml:
- * wrapper/ActionToolbarWrapper.cs: Allow setting "System
- Default" as icon size. Fixed handling of default toolbar
- style. Should fix bug #609132 - Large toolbar reverts to
- small toolbar after compiling program.
-
-2010-04-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * editor/ActionMenu.cs: Explicit destroy of children should
- not be required.
-
-2010-04-30 Mike Krüger <mkrueger@novell.com>
-
- * editor/ActionMenu.cs: moved code from dispose -> destroy.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * editor/ActionMenu.cs:
- * editor/ActionToolbar.cs:
- * editor/ActionMenuBar.cs: Destroy gtk components instead of
- disposing them.
-
-2010-04-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * GladeUtils.cs: Fix glade import. GtkWindow and GtkDialog
- need to be special cased, since we are not creating real
- Gtk.Window objects anymore.
-
-2010-04-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Misc.cs: Show alignment buttons as toggles.
-
-2010-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Widget.cs:
- * wrapper/Container.cs: When setting the name of a widget,
- make sure the old name field is also set. Fixes bug #549463
- - Forms designer renames variables it shouldn't.
-
-2010-01-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * TypedPropertyDescriptor.cs: Don't translate property names
- in the property grid. See bug #571351.
-
-2010-01-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * GeneratorContext.cs: When loading an icon, don't hardcode
- the required size. Instead, call SizeLookup to get the
- correct size for the current theme.
-
-2010-01-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * ImageInfo.cs:
- * wrapper/Bin.cs:
- * WidgetUtils.cs:
- * libstetic.csproj:
- * ObjectWrapper.cs:
- * wrapper/Action.cs:
- * wrapper/Widget.cs:
- * wrapper/VScale.cs:
- * wrapper/HScale.cs:
- * wrapper/MenuBar.cs:
- * wrapper/Expander.cs:
- * GeneratorContext.cs:
- * wrapper/Notebook.cs:
- * wrapper/ComboBox.cs:
- * wrapper/Container.cs:
- * RadioGroupManager.cs:
- * wrapper/VScrollbar.cs:
- * ProjectIconFactory.cs:
- * wrapper/HScrollbar.cs:
- * wrapper/ToolButton.cs:
- * wrapper/ActionTree.cs:
- * wrapper/ActionGroup.cs:
- * wrapper/ComboBoxEntry.cs:
- * wrapper/ActionToolbarWrapper.cs:
- * wrapper/RadioActionGroupManager.cs: Use global:: for type
- references in generated code.
-
- * Placeholder.cs:
- * editor/Flags.cs:
- * editor/Enumeration.cs:
- * editor/ActionMenuItem.cs:
- * editor/ActionToolItem.cs: Fix warnings.
-
-2009-12-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * libstetic.csproj: Flush.
-
-2009-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Table.cs: Fix table creation issue. Sync call has no
- effect while loading a widget.
-
-2009-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Widget.cs: Fix check for top level window.
-
-2009-11-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * wrapper/MenuBar.cs:
- * wrapper/ActionToolbarWrapper.cs: Propagate the menu name to
- the action tree. Fixes bug #540512.
-
-2009-11-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * ObjectReader.cs:
- * ObjectWrapper.cs:
- * ClassDescriptor.cs: Ensure the Loading flag is set when
- loading internal children of a widget.
-
-2009-11-05 Mike Kestner <mkestner@novell.com>
-
- * wrapper/*.cs: improper new keyword warning cleanup.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * libstetic.csproj: Reference mono-cairo package.
-
-2009-10-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Widget.cs: Don't fire the name changed event while
- loading.
-
- * wrapper/Container.cs: Set the loading flag when loading.
-
-2009-10-16 Mike Krüger <mkrueger@novell.com>
-
- * DND.cs:
- * WidgetUtils.cs:
- * CommandDescriptor.cs:
- * editor/Translatable.cs:
- * editor/ActionMenuItem.cs: Handled icon loading failures.
-
-2009-09-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Paned.cs: Avoid unnecessary Changed event.
-
-2009-09-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper\Paned.cs: Restore the paned position after
- realizing. It may have been reset during the realization.
- Fixes bug #542227.
-
-2009-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Widget.cs: Fire name change event when name changes.
- Fixes bug #540512 - NullReferenceException in stetic
- generated code.
-
-2009-09-10 Christian Hergert <chris@dronelabs.com>
-
- * libstetic/libstetic.dll.config: Use quartz on osx.
-
-2009-09-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Action.cs: For stock gtk and gnome icons, use the
- stock id as base name for the action identifier. Fixes bug
- #525571.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * libstetic.csproj: Updated dependencies. We now depend on
- gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Container.cs: Properly validate widget ids when
- pasting a child. If there is a conflict, the child has to be
- modified. Fixes bug #530086 - When copy/pasting widgets in
- stetic, the original is renamed.
-
-2009-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Notebook.cs: Fix issue with adding a widget with
- ShowScrollbars=true to a notebook. Fixes bug 526434 -
- Notebook Tab Labels Revert Back to "Page 1".
-
-2009-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/ComboBox.cs:
- * wrapper/ComboBoxEntry.cs: Changed the sensitivity mode to
- 'always on'. Since gtk+ 2.14, empty combos are disabled by
- default.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/objects.xml: Fix invalid xml.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/objects.xml: Fix some default values.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/objects.xml: Make sure the default value for
- HasSeparator is true.
-
-2009-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/objects.xml: Removed Version=2.6.0.0 specification
- from Pango.EllipsizeMode type. This allows other GTK
- versions to work. Patch by Daniel Newton.
-
-
-2009-07-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * ClassDescriptor.cs: When creating a widget instance,
- initialize the properties after creating the wrapper, since
- some properties may be implemented in the wrapper. This
- should fix bug #505083 - hbuttonbox1.cs file being created
- in gtk-gui causing problems with compilation.
-
-2009-05-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * Placeholder.cs:
- * libstetic.csproj: Improved the look of placeholders.
-
-2009-05-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * ItemDescriptor.cs: Added missing BindingFlags.Instance flag.
-
- * wrapper/Container.cs: Fix bug when showing the selection
- box.
-
- * TopLevelWindow.cs:
- * TopLevelDialog.cs:
- * wrapper/Dialog.cs:
- * wrapper/Window.cs:
- * wrapper/objects.xml: Top level windows are not represented
- using a Gtk.Window anymore at design time. Instead they are
- represented by TopLevelWindow. This is a regular widget, so
- window embedding hacks are not required anymore. The same
- has been done for Gtk.Dialog/TopLevelDialog.
-
- * libstetic.csproj: Added new files.
-
- * Makefile.am: Updated.
-
- * DND.cs: Accept copy as drop target. Fixed the target list.
-
- * TypedClassDescriptor.cs: Invocation of a constructor does
- not need an instance reference.
-
-2009-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Registry.cs: Make sure GetType can find the type when the
- provided assembly name does not have version info.
-
- * libstetic.csproj: Copy the config file to the output dir.
-
- * TypedPropertyDescriptor.cs: Catch ambiguous match exception
- when looking for properties.
-
-2009-04-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * libstetic.csproj: Don't require a specific gtk# version.
-
-2009-03-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * Registry.cs:
- * WidgetLibrary.cs: Flush cached data when closing a change
- set.
-
-2009-02-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Table.cs:
- * wrapper/objects.xml: A better fix for the default row/column
- issue.
-
-2009-02-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * libstetic.csproj: Don't build with make, since MD can build
- these just fine.
-
-2009-02-07 Mike Krüger <mkrueger@novell.com>
-
- * GladeUtils.cs: fixed compiler warning.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * libstetic.mdp:
- * libstetic.csproj: Migrated to MSBuild file format.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * libstetic.mdp: Flush project format changes.
-
-2009-01-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/objects.xml: Added some defaults.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * libstetic.mdp: All projects now require fx 3.5.
-
-2008-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * PropertyDescriptor.cs: Use invariant culture when converting types.
-
-2008-07-27 Mike Krüger <mkrueger@novell.com>
-
-
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.mdp, lib/libsteticui.mdp: Removed some unused glade
- and gnome-sharp references (only the unused). But I'll continue to
- remove glade, we need to lower the dependency tree a bit.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Added IViewContent
- switching logic (but should be done centrally using the secondaryview
- paradigmn).
-
-2008-02-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Workaround for mono bug
- #350432.
-
-2008-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs: Handle the delete
- key in TreeViewPad, so it will work event if the shortcut is not
- defined.
-
-2008-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp, Makefile.am,
- icons/pad-widget-tree-16.png: Added widget tree icon.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Update MD version.
-
-2008-01-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs,
- MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs,
- MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: Made internal
- some classes that don't need to be public.
-
-2008-01-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Notify file changes
- through the FileService.
-
-2008-01-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Stetic code must be
- generated in the GUI thread. Should fix bug #349505.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Feed default layout
- name to Gettext for translation.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/WidgetPartial.xft.xml, templates/Widget.xft.xml,
- templates/WindowPartial.xft.xml, templates/ActionGroupPartial.xft.xml,
- templates/Window.xft.xml, templates/ActionGroup.xft.xml,
- templates/DialogPartial.xft.xml, templates/Dialog.xft.xml: Make template
- categories translatable.
-
-2008-01-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Added null check on the
- result of UpdateFile. Should fix bug #352194.
-
-2008-01-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs,
- MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs,
- MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs,
- MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs: Handle
- projects which don't support the GTK# designer. Window and widget
- generation options are hidden, and code is never generated. Fixes bug
- #350632.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Don't update bindings if the
- file has syntax errors. May fix bug #347590.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Bump add-in versions.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Update after build reorg.
-
-2007-12-06 Geoff Norton <gnorton@novell.com>
-
- * Makefile.am: Only build the GtkCore addin if we have gnome-sharp
- available.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp, lib/libsteticui.mdp, lib/libstetic.mdp,
- Makefile.am: Directory reorganization.
-
-2007-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * gui.glade, MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs: Removed
- Gnome.FileEntry.
-
-2007-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs: Track
- LoggingService API changes.
-
-2007-11-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Use RootCombine
- instead of CurrentOpenCombine when possible.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Bump MD version.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Fix nullref. Happens
- when removing a project from a solution while one of the windows of that
- project is open.
-
-2007-10-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/ActionGroup.xft.xml, templates/ActionGroupPartial.xft.xml,
- templates/Dialog.xft.xml, templates/DialogPartial.xft.xml,
- templates/Widget.xft.xml, templates/WidgetPartial.xft.xml,
- templates/Window.xft.xml, templates/WindowPartial.xft.xml: Use tango
- file icons. Removed obsolete icons.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: Track api changes. Added
- Description property.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.mdp, lib/libstetic.mdp: Project file names updated by
- change in MD path functions.
-
-2007-10-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mds, Makefile.am: Added custom command for updating
- the Stetic sources.
-
-2007-10-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Set a more meaningful category name for
- addin commands.
- * MonoDevelop.GtkCore.mdp, MonoDevelop.GtkCore.mds: Updated.
-
-2007-10-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: If the current selection
- can't be deleted, just ignore the delete command, so the default handler
- will be executed. Fixes bug #325440.
-
-2007-10-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.mdp: Fix required gtk# version.
-
-2007-10-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Applied changes that
- were neccassary for to the new FileService.
-
-2007-10-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: Changed calls for
- the new StringParser.
-
-2007-10-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: In Bind(), don't subscribe the
- NameChanged event at every call.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: The designer needs to
- be explicitely destroyed.
-
-2007-10-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: No need to implement
- IComparable; it's done in the base class now.
-
-2007-09-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: Assign the selected
- target gtk# version to the new project.
-
-2007-09-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Use ProjectReference.StoredReference
- rather than ProjectReference.Reference, in order to refer to the actual
- stored reference string rather than a temporarily bumped version.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Bump MD version.
-
-2007-09-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Implemented an
- assembly resolver for the stetic app, so assembly widgets registered
- with .pc files can be found.
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs: If a widget dll belongs
- to a package, store it as a package reference in the toolbox index.
-
-2007-09-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Allow setting TargetGtkVersion to
- DefaultGtkVersion when current value is null.
-
-2007-09-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Don't touch GTK# assembly versions
- when a target version is not set. Don't use gtkVersion=null to represent
- default version.
- * MonoDevelop.GtkCore/GtkCoreService.cs: Set TargetGtkVersion on new
- projects. Bump default version to 2.8.
-
-2007-09-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.mdp, lib/libsteticui.mdp, lib/libstetic.mdp,
- lib/Makefile.am, MonoDevelop.GtkCore.mds, Makefile.am: Use projects for
- imported stetic libraries.
-
-2007-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Removed access to
- Component object.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Remove unused method.
-
-2007-09-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs,
- MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs,
- MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs: Fix warnings.
-
-2007-09-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * lib/stetic, Makefile.am, lib/Makefile.am: Build stetic from
- svn:externals.
- * lib/libsteticui.dll.config, lib/libstetic.dll.config,
- lib/libstetic.dll, lib/libsteticui.dll: Removed.
-
-2007-09-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/WidgetPartial.xft.xml, templates/Widget.xft.xml,
- templates/WindowPartial.xft.xml, templates/Window.xft.xml,
- templates/ActionGroupPartial.xft.xml, templates/ActionGroup.xft.xml,
- templates/DialogPartial.xft.xml, templates/Dialog.xft.xml: Remove
- deprecated FileOptions element from templates.
-
-2007-09-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Changed the way to
- set the active designer (the api changed). Fixed some renaming issues.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs: Track api changes.
-
-2007-09-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/Window.xft.xml: Oops, PartialTypeSupport should be set to
- Disabled for non-partial window.
-
-2007-09-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.mdp, Makefile.am: Updated.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs: Use DotNetProject.UsePartialTypes
- instead of custom setting.
- * MonoDevelop.GtkCore/WidgetFileTemplatePartialClass.cs,
- MonoDevelop.GtkCore/WidgetFileTemplateFullClass.cs: No longer needed.
- * templates/WidgetPartial.xft.xml, templates/Widget.xft.xml,
- templates/WindowPartial.xft.xml, templates/Window.xft.xml,
- templates/ActionGroupPartial.xft.xml, templates/ActionGroup.xft.xml,
- templates/DialogPartial.xft.xml, templates/Dialog.xft.xml: Use
- PartialTypes condition instead of custom file template.
-
-2007-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- Includes fixes for bugs #82671, #82527, #82476, #81763 and #81238.
-
-2007-08-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/PropertiesWidget.cs: Changes due to new
- property infrastructure.
-
-2007-08-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs: By default use the project name
- as category name for new custom widgets.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Don't show the full
- name of widgets in the toolbar.
-
-2007-08-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: In FindClass, make
- sure the getUserClass parameter is taken into account when the found
- class is not a multi-part class. Fixes bug #82258.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Removed the CommandService class.
- Everything is done directly with CommandManager. Moved all extension
- node types to MD.Components.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml,
- MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore.mdp, Makefile.am: Reorganized the extension point
- hierarchy. Embedded all add-in manifests as resources.
- * lib/libstetic.dll: Updated from stetic module.
-
-2007-08-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Improved error
- reporting.
-
-2007-08-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Converted
- DispatchService to a static class.
-
-2007-08-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.dll: Updated.
-
-2007-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Fixed some
- problems with the target gtk version. It was not assigned to the
- stetic project. Also fixed some stock icon rendering issues in
- Stetic.
-
-2007-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- Includes a nullref fix.
-
-2007-07-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Layout switch
- delay is not needed anymore.
-
-2007-07-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: Fix nullref
- when gtk support is not enabled. Patch by Chris Howie.
-
-2007-07-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- Don't try to use the CurrentNode property after adding the file,
- since it may have changed. Should fix bug #82123.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
- Fixes bugs #81846 and #82144.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Fix window
- source file lookup.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Use the new methods
- for checking clipboard operations on the current selection.
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Include the
- current project in the list of libraries to show in the toolbox.
- Fixes bug #82125.
-
-2007-07-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated. Fixes bugs 81977,
- 81810 and 82052.
-
-2007-07-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Properly rename
- fields when the widget name is changed. Fixes bug #81976.
-
-2007-07-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs: Update the
- properties pad when the focus is on the widget tree pad. Fixes bug
- #81971.
-
-2007-07-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Added null
- check.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Track api changes
- in DesignerSupport. When adding a project reference to a widget
- library, take into account that widgets may be implemented in a
- library different from the one providing the widget list.
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: In
- GetDynamicItems, only return widgets provided by libraries
- referenced by the project. Don't return widgets from libstetic
- since those are already included by default in the toolbox.
- Implemented IToolboxDefaultProvider.
-
-2007-07-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Changed a bit
- because of the removal of custom collections in the Ide project.
-
-2007-06-30 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * gui.glade: Fixed capitalization.
-
-2007-06-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs: Don't show windows
- in the toolbox.
- * lib/libstetic.dll, lib/libsteticui.dll: Updated from Stetic module.
-
-2007-06-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
-
-2007-06-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * gui.glade, MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs,
- MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: Allow selecting
- the target GTK# version of the project.
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp, Makefile.am,
- MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Implemented a
- toolbox loader, which allows registering assemblies in the toolbox.
- When a widget from a toolbox is dropped to a window, MD will now
- add a reference to the required assembly.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
-
-2007-06-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll: One last update.
-
-2007-06-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
-
-2007-06-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Set the import
- file callback when editing project stock icons.
- * MonoDevelop.GtkCore/ProjectResourceProvider.cs: The GetResources
- method only returns resource files now.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
-
-2007-06-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs: Default pad
- placement is now specified in the xml file.
-
-2007-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: In GetBaseType, use
- Project.GetWidgetTypes to get all registered wiget types, including
- base widget types (which were not provided by GetComponentTypes).
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- Includes fix for bug #81785.
-
-2007-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: Don't include non-public
- members to the objects.xml file.
-
-2007-05-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Updated.
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: Fix feature message.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
- Includes fixes for bugs #81761, #81758 and #81762.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- (UpdateLibraries) Properly check for library changes.
-
-2007-05-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- Fixes bugs #80783 and #81683.
-
-2007-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp, Makefile.am: Added new dependency.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from svn. Fixes bug
- #81590.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: When selecting an
- image file in the widget designer, import the file into the
- project.
-
-2007-05-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Added some delay
- in the code that changes the workbench layout when selecting the
- designer. Fixes bug #80963.
-
-2007-05-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp, Makefile.am,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPalettePad.cs: Removed old
- palette pad.
- * MonoDevelop.GtkCore/GtkCoreService.cs: Set the 'internal' flag for
- widgets implemented by private classes.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from svn module.
- Fixes bugs #80875, #81261, #81365.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: If the project
- is a library, add itself as an internal widget library, so widgets
- with internal visibility will be shown.
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: When saving a window,
- use the visibility of the class to set the visibility of the
- component. Together with all changes done in stetic, fixes bug
- #80875.
-
-2007-05-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs,
- MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Track api changes in
- Stetic.
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: Delay
- library updating until really necessary.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Copy the .addins.xml file to the output dir.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Copy stetic dlls together with the assembly.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated.
-
-2007-05-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp, Makefile.am: Reference shared assemblies
- from the correct location.
-
-2007-05-04 Wade Berrier <wberrier@novell.com>
- * lib/libstetic.dll.config:
- * lib/libsteticui.dll.config:
- Fix os attribute formats (mono-config.c separates oses by comma,
- and ignores or includes the whole string.)
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp, Makefile.am:
- Migration to Mono.Addins.
-
-2007-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp,
- MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs, Makefile.am:
- Implemented project feature for enabling gtk# support in new
- projects.
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs: Use
- Menu icon size in the project pad.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
-
-2007-04-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs: Show a
- relative path in the window delete confirm dialog, since the
- absolute path may take too much space.
- * MonoDevelop.GtkCore.mdp: Updated.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * templates/DialogPartial.xft.xml, templates/Dialog.xft.xml: Add
- Ok/Cancel buttons by default in new dialogs.
-
-2007-03-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- Includes fixes for bugs 81033, 81086, 81239, 81143, 81014 and
- 81015.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Allow pasting when
- a placeholder is selected. Fixes bug #81246.
-
-2007-03-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml,
- MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.mdp, Makefile.am, icons/image-x-generic.png:
- Show a "Stock Icons" node in the User Interface folder. It's easier
- to discover than the context menu option.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.Commands/GladeCommands.cs: Added menu option
- for opening the gtk# settings.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Don't crash if
- the gtk-gui folder doesn't exist. Fixes bug #81152.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Hide the border
- of the combined view notebook.
-
-2007-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.dll: Updated from stetic module. Fixes NRE crash.
-
-2007-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Fix null ref.
-
-2007-03-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Register a new toolbox loader. Removed
- old properties pads.
- * MonoDevelop.GtkCore.mdp, Makefile.am: Added reference to
- MonoDevelop.DesignerSupport.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from svn module.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/PropertiesWidget.cs,
- MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Integrate Stetic
- widgets in the main toolbox.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: Implement
- ICustomPropertyPadProvider and return the Stetic property pad.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs: Renamed.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Fix warning.
-
-2007-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- Updated from Stetic module. Includes fix for bug #80864.
-
-2007-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from SVN. Fixes some
- memory leaks and bug #79453.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Explicitely
- destroy notebook children, since notebook doesnt do it because of a
- gtk bug.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Some fixes in the
- dispose code.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Use
- ProjectOperations.SaveProject to save projects.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Change add-in versions to 0.13.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Fix nullref.
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs: Log
- error message.
- * Makefile.am, MonoDevelop.GtkCore.mdp: Synchronized MD project and
- makefile.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Avoid throwing
- delayed events after the project has been disposed.
-
-2007-02-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Added missing
- null check.
-
-2007-02-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Ask for user
- confirmation when reloading a designer only when the designer has
- unsaved changes.
-
-2007-02-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs,
- MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Detect external
- changes in the gui.stetic files, and reload it when it changes.
- Take into account that the load of gui.stetic can fail. Added
- several workarounds for this case.
-
-2007-02-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from SVN. Includes
- fixes for bugs #80722, #79427 and #80127.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Store some
- Stetic configuration in the MD properties.
-
-2007-02-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * gui.glade, MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Added options
- for enabling/disabling gtk support, and for gettext support.
- * MonoDevelop.GtkCore.addin.xml: Change options panel name.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Make sure the
- MD project is saved together with the stetic project, if necessary.
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: Avoid saving
- the MD project twice.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs: If gtk
- integration status changes for a project, refresh the tree.
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs: Null check.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Added support for gettext and
- gettext class options for generated code.
- * MonoDevelop.GtkCore/GtkCoreService.cs: Added events for notifying
- when the gtk integration status changes for a project.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * Makefile.am: distcheck fixes
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: When a designer
- project is disposed, hide the designer view in the editor.
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- Factorized some code into GtkDesignInfo.
-
-2007-02-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Make sure the code generation
- extension is executed before the last step.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- Hide the add window commands when the project is not DotNet
- * MonoDevelop.GtkCore.mdp, lib/libsteticui.dll, lib/libstetic.dll:
- Updated.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Intercept calls
- to the IPositionable interface, and show the editor page when
- jumping to a line.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: When looking for
- the window class, avoid returning the generated partial class.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Show the editor
- page when jumping to a signal handler.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Warn the user if
- the gtk-sharp-2 package can't be found. Some distros don't include
- the .pc file in the gtk# package, only in the -devel package.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
-
-2007-01-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.dll.config, lib/libsteticui.dll, lib/libstetic.dll,
- lib/libsteticui.dll.config: Updated from Stetic module.
-
-2007-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Track api
- changes in Document class.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated form Stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Removed
- implementation of all text editor interfaces. Now the view
- overrides GetContent and calls editor.GetContent when a requested
- interface is not found.
-
-2007-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Updated.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Removed unused namespace.
- * MonoDevelop.GtkCore/GtkCoreService.cs: Use the new base-type property
- to describe custom widgets. When looking for properties and events,
- look in the base classes as well as in the widget class.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * Makefile.am,
- MonoDevelop.GtkCore.WidgetLibrary/ProjectClassDescriptor.cs,
- MonoDevelop.GtkCore.WidgetLibrary/ProjectSignalDescriptor.cs,
- MonoDevelop.GtkCore.WidgetLibrary/BaseWidgetLibrary.cs,
- MonoDevelop.GtkCore.WidgetLibrary/AssemblyReferenceWidgetLibrary.cs,
- MonoDevelop.GtkCore.WidgetLibrary/ProjectPropertyDescriptor.cs:
- Removed unused files. All widget library functionality has been
- moved to stetic.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Removed all
- widget library management, which has been moved to Stetic.
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Added some null checks.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Use the new way
- of managing dependencies in projects.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- templates/WindowPartial.xft.xml, templates/Window.xft.xml: The
- window constructor now takes the window type.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Some gui
- improvements and added some null checks.
-
-2007-01-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Don't crash if the
- designer can't be loaded for some reason.
-
-2007-01-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml,
- MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs,
- MonoDevelop.GtkCore/WidgetFileTemplatePartialClass.cs,
- MonoDevelop.GtkCore/WidgetFileTemplateFullClass.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs,
- templates/WidgetPartial.xft.xml, templates/Widget.xft.xml,
- templates/WindowPartial.xft.xml, templates/Window.xft.xml,
- templates/ActionGroupPartial.xft.xml,
- templates/ActionGroup.xft.xml, templates/DialogPartial.xft.xml,
- templates/Dialog.xft.xml: Implemented support for generating code
- in partial classes.
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs: Use the
- correct method for saving the project.
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs: Refresh the user
- interface folder when the gui project is reloaded.
- * MonoDevelop.GtkCore.mdp: Updated.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Added support for partial
- classes. In the GuiBuilderProject property, don't update the
- gtk-gui folder since this call may change the contents of the
- project, and weird things happen when called by the project pad to
- fill the tree.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * Makefile.am: Added new files.
- * MonoDevelop.GtkCore.WidgetLibrary/BaseWidgetLibrary.cs,
- MonoDevelop.GtkCore.WidgetLibrary/AssemblyReferenceWidgetLibrary.cs:
- Make it work even when the assembly it references has been deleted
- (maybe as a result of cleaning a project). In this case the widget
- library is shown as empty.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Added support
- for Loading/Unloading a project, to optimize use of memory for
- solutions with many gui projects. Implemented support for
- generating code in partial classes.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Implemented
- support for generating code in partial classes. Implemented support
- for UNDO/REDO.
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- Generation of gui code is now done from the Build method of a
- project service extension. Fixes some issues when building a
- project which contains custom components.
-
-2006-12-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: Track API changes in
- FileService.
-
-2006-12-13 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Don't
- generate stetic code if CurrentOpenCombine is null.
-
-2006-12-07 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.GtkCore.mdp: Updated to it can be
- built from MonoDevelop.
-
-2006-11-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Simplified the
- code by using global events from the Ide, instead of combine
- events.
-
-2006-10-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Added RemoveExportedWidget method.
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: track
- API changes.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: If the name of a
- widget changes and it is being exported, update it in the objects.xml
- file. Fixes bug #79656.
-
-2006-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from Stetic module. It provides a redesigned API
- which will allow running designers in a separate process.
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs:
- * MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs:
- * MonoDevelop.GtkCore.WidgetLibrary/AssemblyReferenceWidgetLibrary.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPalettePad.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs:
- Track api changes.
-
- * MonoDevelop.GtkCore.WidgetLibrary/BaseWidgetLibrary.cs: Make sure
- parse information is up to date before loading an assembly library.
- * MonoDevelop.GtkCore/ProjectResourceProvider.cs: Make sure this object
- is always alive when remoted.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Added null check.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs: Not needed anymore.
- * MonoDevelop.GtkCore.addin.xml: Removed build step. Code generation
- is done now before compiling.
-
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectWidgetLibrary.cs:
- * MonoDevelop.GtkCore.WidgetLibrary/CachedProjectWidgetLibrary.cs:
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: ProjectWidgetLibrary is not used
- anymore. All libraries are now handled by AssemblyReferenceWidgetLibrary.
-
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopWidgetActionBar.cs:
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopActionGroupToolbar.cs:
- Moved to Stetic.
-
- * Makefile.am:
- * MonoDevelop.GtkCore.mdp: Updated.
-
-2006-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Track api changes.
-
-2006-09-19 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * .: Added svn:ignore for MonoDevelop.GtkCore.pidb
-
-2006-09-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from stetic module. Includes fix for bug #79247.
-
-2006-09-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from stetic module.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- Save the project after editing the icons.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Set the
- ResourceProvider for the main stetic project. Added null check.
-
-2006-08-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Fixed bug about
- adding the wrong widget as action designer page.
-
-2006-08-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: Only export properties which
- return primitive types. Fixes bug #79195.
- * lib/*: Updated from stetic module.
- * MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs: Unsubscribe close
- event when done.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Handle designer
- commands in its own tab page.
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: Explicitely dispose
- custom widgets to avoid memory leaks.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Track api changes.
-
- * MonoDevelop.GtkCore.mdp: Updated.
-
-2006-08-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * gui.glade: Minor fix.
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs: Track api
- changes.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Stetic files don't need
- to be added as resource to projects.
- * MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs: Make it
- work for action groups.
- * lib/*: several fixes.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Added method
- for removing an action group.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Track API changes
- in Stetic. Properly bound edit commands from the main menu.
-
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs:
- * MonoDevelop.GtkCore.addin.xml: Implemented Open and Delete
- commands for global action groups.
-
- * MonoDevelop.GtkCore.mdp: Updated.
-
-2006-08-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from Stetic module. Includes fixes for
- bugs #79043, #79044 and #79045
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Don't
- crash if something goes wrong when binding a class.
- Fixed nullref.
-
-2006-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- CreateContentForFile should not load the file, just create
- the view.
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Add
- support for IEncodedTextContent.
-
-2006-08-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- Set the resource provider before loading the project.
- Fixes bug #78966.
-
- * libs/*: Updated from Stetic module. Fixes several bugs:
- 78938, 78916, 78909, 78956, and 78867.
-
-2006-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectClassDescriptor.cs:
- Added null check.
-
- * MonoDevelop.GtkCore.WidgetLibrary/AssemblyReferenceWidgetLibrary.cs:
- Get the parser context using the assembly file name, not the full
- assembly name.
-
-2006-07-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Factorized several
- more or less duplicate methods into GuiBuilderProject, specially
- methods for locating the class bound to a window. GuiBuilderProject
- now will explicitelly update the parser database the first time it
- needs to locate a class, so it will work even if the parser service
- is busy parsing assemblies.
-
-2006-07-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.dll: Updated from stetic module. Fixes a bug
- in the table wrapper which may cause an endless loop.
-
-2006-07-05 Matej Urbas <matej.urbas@gmail.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.WidgetLibrary/BaseWidgetLibrary.cs: Updated to use
- ReturnType as BaseTypes in IClass instances.
-
-2006-07-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from Stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Fixed automatic
- layout switch policy.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Fix showing of
- action group view.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs: Properly
- bind actions when pressing "BindToField".
-
- * MonoDevelop.GtkCore.addin.xml: Updated versions.
-
-2006-06-29 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.GtkCore.addin.xml: Only display WidgetBuilderOptionPanel
- for "DotNet" projects.
-
-2006-06-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from Stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Switch to the
- designer workbench layout when selecting an action group file.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: Support jumping
- to signal hanlder when double-clicking it in the signals editor.
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Removed debug code.
-
- * templates/ActionGroup.xft.xml:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- Fix code generation of action groups.
-
-2006-06-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: If a member has a [Browsable(false)]
- attribute, don't add it to the objects.xml file. Also don't add
- read-only properties.
- * lib/*: Updated from stetic module. Fixes bugs #78622 and #78620.
- Adds an icon for expander and fixes a bug in ColorButton (fix by ml)
-
-2006-06-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll:
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopWidgetActionBar.cs:
- Track changes in the api.
-
-2006-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * libs/*: Updated from stetic module. Several improvements.
- Also fixes bug #78160.
-
-2006-05-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- Added DisplayName property.
-
-2006-05-29 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: reverted interface changes - missing file change
-
-2006-05-29 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: reverted interface changes
-
-2006-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * libs/*: Updated from stetic module. Adds support for toolbars.
-
-2006-05-23 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: track api changes
-
-2006-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Commands/GladeCommands.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- * MonoDevelop.GtkCore.addin.xml: Added commands for creating
- an action group and editing the project icons.
-
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs: Show local
- action groups as children of the window node.
-
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs: Moved
- some event subscriptions to WindowsFolder.cs
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs: Open the
- corresponding file when clicking on local action groups.
-
- * Makefile.am:
- * MonoDevelop.GtkCore.mdp: Added action group template.
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: Added support for
- action group file templates.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Notify changes in
- local action groups.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Don't show the actions
- tab until there is at least one action group.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs: Don't show
- properties or signals for global actions.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Added virtual method
- OnActiveDocumentChanged, which is called when the view is brought to front.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Use the new MemberName
- field when binding fields.
-
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopActionGroupToolbar.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: Several minor fixes.
-
- * lib/*: Updated.
-
-
-2006-05-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Initial support for the menu editor. Still very unstable!!
-
- * lib/*: Updated from Stetic module.
- * MonoDevelop.GtkCore.addin.xml: Register a node builder and and
- display binding for action groups.
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs: Update
- the folder when action groups change.
- * MonoDevelop.GtkCore/GtkCoreService.cs: Fix nullref.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs: Factorized
- some code into CodeBinder.cs
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Factorized some
- code into CombinedDesignView.cs.
-
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs: New node
- builder for action groups.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs: New display
- binding for editing global action groups.
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopWidgetActionBar.cs: Moved from
- GuiBuilderView.cs.
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopActionGroupToolbar.cs: A new
- toolbar for the action group designer.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: A view for editing
- global action groups.
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Moved here some code
- from GuiBuilderEditSession.cs.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Moved here some
- code from GuiBuilderView.cs.
-
- * Makefile.am:
- * MonoDevelop.GtkCore.mdp: Added new files.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Track api changes.
-
-2006-05-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.dll: Updated from Stetic module. Includes
- a fix for bug #78307.
-
-2006-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Updated versions.
- * MonoDevelop.GtkCore.mdp: Updated.
-
-2006-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from Stetic module. Includes fixes for
- bugs #78266, #78240 and #78276.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Track changes
- in the Stetic API.
-
-2006-04-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Don't
- crash if a stetic project can't be loaded. Fixes bug #78169.
- * lib/libstetic.dll: Updated from Stetic module. Fixes bug #78167.
-
-2006-04-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * libs/*: Updated from stetic module. Fixed construction of
- scales and scrollbars.
-
-2006-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectClassDescriptor.cs: When
- creating a widget from a widget design, remove the signals since
- those signals reference handlers in the widget class, not the
- widget container class.
-
-2006-04-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * libs/*: Fix nullref in some themes.
-
-2006-04-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: Fix typo.
- * libs/*: Fix for #78111, #78092 and #78090.
-
-2006-04-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/ProjectResourceProvider.cs: Save the project
- after adding or removing a resource.
-
-2006-04-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated.
-
-2006-03-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Get open
- combine events in the GUI thread.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs: Properly
- delete signals for which there isn't a handler. Half fixed field
- renaming.
- * lib/*: Updated.
-
-2006-03-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/MonoDevelop.GtkCore.addin.xml: Fix ID and
- description. Added stetic config files to add-in package.
-
-2006-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Updated references.
-
-2006-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- Don't crash if no parse info is available for the file
- being edited. Should fix #77885.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Don't show
- the bind to field button for the root container.
- * lib/*: Updated.
-
-2006-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Use an unified format. Patch by Matze Braun.
- * MonoDevelop.GtkCore.addin.xml: Updated add-in versions.
-
-2006-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml:
- * MonoDevelop.GtkCore.mdp: Removed GladeFileDisplayBinding.
- * lib/*: Updated.
- * Makefile.am: Updated. Some files have been moved to Stetic.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Fixed
- layout switching. Don't show the widget tree pad by default,
- since it is already available as a combo in the designer.
- * MonoDevelop.GtkCore.GuiBuilder/GladeFileDisplayBinding.cs: Removed.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs: use
- the new property tree instead of the grid.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: The designer
- toolbar has been moved to Stetic.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs: Changed
- default placement.
-
-2006-03-19 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * .: Added Makefile.in and Makefile to svn:ignore.
-
-2006-03-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.GtkCore.mdp: Updated.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Added support for using
- resource images in the designer.
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: Check if the objects.xml
- file exists before loading it.
- * MonoDevelop.GtkCore/GeneratorBuildStep.cs: Don't generate code
- if the stetic file has not been modified since the last
- generation.
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: If Gtk
- support is not enabled, don't enable it if no widgets have
- been selected.
- * lib/libstetic.dll: Updated.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Mapped some
- commands.
- * templates/Window.xft.xml: The constructor of Gtk.Window requires
- the title of the window.
-
-2006-03-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp, Makefile.am: Updated.
- * MonoDevelop.GtkCore/GeneratorBuildStep.cs: When generating
- code for a project that exports widgets, include the own
- project library to the generation, since there can be
- widgets that contain other widgets defined in the project.
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectClassDescriptor.cs:
- removed some IdeApp dependencies.
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectWidgetLibrary.cs:
- added method for getting the class information from
- a project.
- * CachedProjectWidgetLibrary.cs: New widget library class
- which takes class information from a collection of
- ProjectClassInfo objects.
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectPropertyDescriptor.cs:
- Consider all properties runtime-properties, since they have
- been created from class properties.
- * lib/*: Updated.
-
-2006-03-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: removed debug files.
-
-2006-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Propagate
- project changes to the editor.
-
-2006-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- Initial implementation of the Stetic add-in.
diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/Placeholder.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/Placeholder.cs
index c1aced580b..b0dbb9f292 100644
--- a/main/src/addins/MonoDevelop.GtkCore/libstetic/Placeholder.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/libstetic/Placeholder.cs
@@ -103,6 +103,8 @@ namespace Stetic {
cr.RelLineTo (-rect.Width, 0);
cr.RelLineTo (0, -rect.Height);
cr.ClosePath ();
+
+ // FIXME: VV: Remove gradient features
using (var pat = new Cairo.LinearGradient (rect.X + rect.Width*fx, rect.Y + rect.Height*fy, rect.X + rect.Width*fw, rect.Y + rect.Height*fh)) {
pat.AddColorStop (0, c1);
pat.AddColorStop (1, c2);
diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/PropertyEditorCell.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/PropertyEditorCell.cs
index faec75ffc3..ea7f4a401e 100644
--- a/main/src/addins/MonoDevelop.GtkCore/libstetic/PropertyEditorCell.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/libstetic/PropertyEditorCell.cs
@@ -33,7 +33,7 @@ namespace Stetic
editors[typeof (float)] = typeof (Stetic.Editor.FloatRange);
editors[typeof (double)] = typeof (Stetic.Editor.FloatRange);
editors[typeof (char)] = typeof (Stetic.Editor.Char);
- editors[typeof (string)] = typeof (Stetic.Editor.TextEditor);
+ editors[typeof (string)] = typeof (Stetic.Editor.PropertyTextEditor);
editors[typeof (DateTime)] = typeof (Stetic.Editor.DateTimeEditorCell);
editors[typeof (TimeSpan)] = typeof (Stetic.Editor.TimeSpanEditorCell);
editors[typeof (string[])] = typeof (Stetic.Editor.StringArray);
@@ -60,6 +60,7 @@ namespace Stetic
layout.Width = -1;
Pango.FontDescription des = container.Style.FontDescription.Copy();
+ des.Size = 10 * (int) Pango.Scale.PangoScale;
layout.FontDescription = des;
this.property = property;
diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/PropertyTextEditor.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/PropertyTextEditor.cs
new file mode 100644
index 0000000000..6f8c996c11
--- /dev/null
+++ b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/PropertyTextEditor.cs
@@ -0,0 +1,83 @@
+
+using System;
+using Gtk;
+using Gdk;
+
+namespace Stetic.Editor
+{
+ public class PropertyTextEditor: Gtk.HBox, IPropertyEditor
+ {
+ protected Gtk.Entry entry;
+ protected Gtk.Button button;
+ PropertyDescriptor prop;
+ object obj;
+
+ public PropertyTextEditor()
+ {
+ Spacing = 3;
+ entry = new Entry ();
+ entry.HasFrame = false;
+ PackStart (entry, true, true, 0);
+ button = new Button ("...");
+ button.Relief = ReliefStyle.Half;
+ PackStart (button, false, false, 0);
+ button.Clicked += ButtonClicked;
+ entry.Activated += TextChanged;
+ ShowAll ();
+ }
+
+ void ButtonClicked (object s, EventArgs a)
+ {
+ using (TextEditorDialog dlg = new TextEditorDialog ()) {
+ dlg.Text = entry.Text;
+ dlg.SetTranslatable (prop.Translatable);
+ dlg.TransientFor = this.Toplevel as Gtk.Window;
+ if (prop.Translatable) {
+ dlg.Translated = prop.IsTranslated (obj);
+ dlg.ContextHint = prop.TranslationContext (obj);
+ dlg.Comment = prop.TranslationComment (obj);
+ }
+ if (dlg.Run () == (int) ResponseType.Ok) {
+ if (prop.Translatable) {
+ prop.SetTranslated (obj, dlg.Translated);
+ if (dlg.Translated) {
+ prop.SetTranslationComment (obj, dlg.Comment);
+ prop.SetTranslationContext (obj, dlg.ContextHint);
+ }
+ }
+ entry.Text = dlg.Text;
+ TextChanged (null, null);
+ }
+ }
+ }
+
+ void TextChanged (object s, EventArgs a)
+ {
+ if (ValueChanged != null)
+ ValueChanged (this, a);
+ }
+
+ public void Initialize (PropertyDescriptor descriptor)
+ {
+ if (descriptor.PropertyType != typeof(string))
+ throw new InvalidOperationException ("TextEditor only can edit string properties");
+ prop = descriptor;
+ }
+
+ public void AttachObject (object obj)
+ {
+ this.obj = obj;
+ }
+
+ // Gets/Sets the value of the editor. If the editor supports
+ // several value types, it is the responsibility of the editor
+ // to return values with the expected type.
+ public object Value {
+ get { return entry.Text; }
+ set { entry.Text = value != null ? (string) value : ""; }
+ }
+
+ // To be fired when the edited value changes.
+ public event EventHandler ValueChanged;
+ }
+}
diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Text.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Text.cs
index 667ccb2537..4bb92de628 100644
--- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Text.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/Text.cs
@@ -2,7 +2,7 @@ using System;
namespace Stetic.Editor
{
- public class Text : TextEditor
+ public class Text : PropertyTextEditor
{
public Text ()
{
diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/TextEditor.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/TextEditor.cs
deleted file mode 100644
index d2c135a2a6..0000000000
--- a/main/src/addins/MonoDevelop.GtkCore/libstetic/editor/TextEditor.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-
-using System;
-using Gtk;
-using Gdk;
-
-namespace Stetic.Editor
-{
- public class TextEditor: Gtk.HBox, IPropertyEditor
- {
- protected Gtk.Entry entry;
- protected Gtk.Button button;
- PropertyDescriptor prop;
- object obj;
-
- public TextEditor()
- {
- Spacing = 3;
- entry = new Entry ();
- entry.HasFrame = false;
- PackStart (entry, true, true, 0);
- button = new Button ("...");
- button.Relief = ReliefStyle.Half;
- PackStart (button, false, false, 0);
- button.Clicked += ButtonClicked;
- entry.Activated += TextChanged;
- ShowAll ();
- }
-
- void ButtonClicked (object s, EventArgs a)
- {
- using (TextEditorDialog dlg = new TextEditorDialog ()) {
- dlg.Text = entry.Text;
- dlg.SetTranslatable (prop.Translatable);
- dlg.TransientFor = this.Toplevel as Gtk.Window;
- if (prop.Translatable) {
- dlg.Translated = prop.IsTranslated (obj);
- dlg.ContextHint = prop.TranslationContext (obj);
- dlg.Comment = prop.TranslationComment (obj);
- }
- if (dlg.Run () == (int) ResponseType.Ok) {
- if (prop.Translatable) {
- prop.SetTranslated (obj, dlg.Translated);
- if (dlg.Translated) {
- prop.SetTranslationComment (obj, dlg.Comment);
- prop.SetTranslationContext (obj, dlg.ContextHint);
- }
- }
- entry.Text = dlg.Text;
- TextChanged (null, null);
- }
- }
- }
-
- void TextChanged (object s, EventArgs a)
- {
- if (ValueChanged != null)
- ValueChanged (this, a);
- }
-
- public void Initialize (PropertyDescriptor descriptor)
- {
- if (descriptor.PropertyType != typeof(string))
- throw new InvalidOperationException ("TextEditor only can edit string properties");
- prop = descriptor;
- }
-
- public void AttachObject (object obj)
- {
- this.obj = obj;
- }
-
- // Gets/Sets the value of the editor. If the editor supports
- // several value types, it is the responsibility of the editor
- // to return values with the expected type.
- public object Value {
- get { return entry.Text; }
- set { entry.Text = value != null ? (string) value : ""; }
- }
-
- // To be fired when the edited value changes.
- public event EventHandler ValueChanged;
- }
-}
diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/libstetic.csproj b/main/src/addins/MonoDevelop.GtkCore/libstetic/libstetic.csproj
index 053a866ec1..43a845d8f2 100644
--- a/main/src/addins/MonoDevelop.GtkCore/libstetic/libstetic.csproj
+++ b/main/src/addins/MonoDevelop.GtkCore/libstetic/libstetic.csproj
@@ -111,7 +111,6 @@
<Compile Include="editor\StringArray.cs" />
<Compile Include="editor\Text.cs" />
<Compile Include="editor\TextBox.cs" />
- <Compile Include="editor\TextEditor.cs" />
<Compile Include="editor\TextEditorDialog.cs" />
<Compile Include="editor\ThemedIcon.cs" />
<Compile Include="editor\ThemedIconList.cs" />
@@ -224,6 +223,7 @@
<Compile Include="TopLevelWindow.cs" />
<Compile Include="wrapper\NotifyWorkaround.cs" />
<Compile Include="editor\GtkWorkarounds.cs" />
+ <Compile Include="editor\PropertyTextEditor.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="stetic.glade">
diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ChangeLog b/main/src/addins/MonoDevelop.GtkCore/libsteticui/ChangeLog
deleted file mode 100644
index 3467198ee3..0000000000
--- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/ChangeLog
+++ /dev/null
@@ -1,228 +0,0 @@
-2010-05-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * CecilWidgetLibrary.cs: Fix potential null ref. Fixes bug
- #583516 - Stetic breaks building MonoDevelop.IPhone.
-
-2010-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * LibraryCache.cs: Fixed problem with resolution of base
- types.
-
-2010-04-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * CecilSignalDescriptor.cs: Cecil uses '/' as separator for
- inner classes. Convert to the standard '+' separator.
-
-2010-01-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * CodeGenerator.cs:
- * libsteticui.csproj:
- * CodeGeneratorPartialClass.cs:
- * CodeGeneratorInternalClass.cs: Use global:: for type
- references in generated code.
-
-2010-01-15 Mike Krüger <mkrueger@novell.com>
-
- * libsteticui.csproj: upgraded to v3.5 framework.
-
-2009-12-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * WidgetDesignerBackend.cs: Disable checkerboard background
- because redraw is super-inefficient and makes resizing
- unbearably slow. It needs to do more selective invalidation
- in resizes (like GTK viewport), and take the exposed area
- into account in expose events.
-
-2009-11-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * WidgetDesignerBackend.cs: Don't try to realize the child if
- the widget is not anchored. Fixes bug #553475 -
- "Gtk-Critical: gtk_widget_realize: assertion" when running a
- gtk# app inside MD.
-
-2009-11-05 Mike Kestner <mkestner@novell.com>
-
- * Application.cs:
- * ApplicationBackend.cs:
- * CodeGenerator.cs: some warning cleanup.
-
-2009-10-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * libsteticui.csproj: Flush.
-
-2009-10-16 Mike Krüger <mkrueger@novell.com>
-
- * ActionComponent.cs: Handled icon loading failures.
-
-2009-10-08 Ankit Jain <jankit@novell.com>
-
- * libsteticui.csproj: Mark Mono.Cecil project referece
- as private.
-
-2009-09-10 Christian Hergert <chris@dronelabs.com>
-
- * libsteticui/libsteticui.dll.config: Use quartz on osx.
-
-2009-09-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * Metacity/Preview.cs: Use Assembly.LoadWithPartialName. It's
- obsolete, but at least it works.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * Metacity/Preview.cs:
- * WidgetDesignerBackend.cs: Worked on designer decoration.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * Grid.cs:
- * LibraryCache.cs:
- * Windows/Preview.cs:
- * WidgetActionBar.cs:
- * ApplicationBackend.cs: Fixed some warnings.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * libsteticui.csproj: Updated dependencies. We now depend on
- gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project.cs:
- * UndoQueue.cs:
- * WidgetDesigner.cs:
- * ProjectBackend.cs:
- * WidgetEditSession.cs: Added support for saving and restoring
- the status of the designer, including the undo queue. This
- allows implenting ISupportsProjectReload.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * Metacity/Preview.cs: Remove debug code.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * Windows/Preview.cs: Dont try to create a Win32 preview
- window when not running on Windows.
-
-2009-07-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * WidgetDesigner.cs:
- * ActionGroupDesigner.cs:
- * WidgetDesignerBackend.cs:
- * ActionGroupEditSession.cs: No more missing IntPtr
- constructor exceptions.
-
-2009-06-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * WidgetDesignerBackend.cs: Fix rendering of the window
- decoration.
-
-2009-06-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * WidgetDesigner.cs:
- * WidgetDesignerBackend.cs: Dispose is not guaranteed to be
- called when destroying a widget. Use OnDestroyed instead.
-
-2009-06-25 Mike Krüger <mkrueger@novell.com>
-
- * WidgetDesignerBackend.cs: Draw dialog background.
-
-2009-06-25 Mike Krüger <mkrueger@novell.com>
-
- * WidgetDesignerBackend.cs: Draw checkboard background in the
- gui designer instead of monochrome dialog background.
-
-2009-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * PluggableWidget.cs: When replacing the child widget (because
- of reloading of the project for example), make sure the old
- one is destroyed.
-
-2009-05-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * libsteticui.csproj: Updated.
-
- * Metacity/Theme.cs:
- * Metacity/FrameType.cs:
- * Metacity/FrameFlags.cs:
- * Metacity/ButtonLayout.cs:
- * Metacity/ObjectManager.cs:
- * Metacity/ButtonFunction.cs: Use a better namespace.
-
- * Metacity/Preview.cs: Use the new TopLevelWindow class. Track
- changes in the title of the window.
-
- * Windows:
- * Windows/Preview.cs:
- * Windows/WindowsTheme.cs:
- * WidgetDesignerBackend.cs: Added support for win32 window
- decorations.
-
- * EmbedWindow.cs:
- * UserInterface.cs: EmbedWindow is not required anymore.
-
-2009-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * libsteticui.csproj: Copy the config file to the output dir.
- Set project type to library.
-
- * Metacity/Preview.cs:
- * WidgetDesignerBackend.cs: Avoid exception in the
- MetacityPreview class constructor, since it crashes MD under
- ms.net.
-
-2009-04-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * libsteticui.csproj: Don't require a specific gtk# version.
-
-2009-03-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * LibraryCache.cs: Avoid recursive loading of
- AssemblyDefinition. Rely on cache info to check if a
- referenced library contains widget definitions.
-
- * AssemblyResolver.cs: Make sure the resolver returns full
- paths.
-
- * CecilWidgetLibrary.cs: Use the full path to query info from
- the cache. Properly unsubscribe the Changed event from the
- cache. Resolve assemblies using the provided assembly
- resolver.
-
- * ApplicationBackend.cs:
- * AssemblyWidgetLibrary.cs: From now on the registry and the
- library cache only handle libraries with full paths.
-
- * Project.cs: Make sure unused project backends are properly
- disposed.
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * libsteticui.csproj: Flush.
-
-2009-02-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * PropertyTree.cs:
- * WidgetDesignerBackend.cs: Dispose Gdk cursors, else
- finalisers destroy them outside of the GUI thread and often
- crash MD due to X asserts resulting in _XCBUnlockDisplay
- errors.
-
-2009-02-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * libsteticui.csproj: Don't build with make, since MD can
- build these just fine.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * libsteticui.csproj: Allow unsafe code, since Shadow.cs has
- unsafe code.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * libsteticui.mdp:
- * libsteticui.csproj: Migrated to MSBuild file format.
-
diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/PropertyTree.cs b/main/src/addins/MonoDevelop.GtkCore/libsteticui/PropertyTree.cs
index f89aa36754..cbff163a9e 100644
--- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/PropertyTree.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/libsteticui/PropertyTree.cs
@@ -224,6 +224,7 @@ namespace Stetic
layout = new Pango.Layout (this.PangoContext);
layout.Wrap = Pango.WrapMode.Char;
Pango.FontDescription des = this.Style.FontDescription.Copy();
+ des.Size = 10 * (int) Pango.Scale.PangoScale;
layout.FontDescription = des;
}
@@ -444,6 +445,7 @@ namespace Stetic
layout.Wrap = Pango.WrapMode.Char;
Pango.FontDescription des = tree.Style.FontDescription.Copy();
+ des.Size = 10 * (int) Pango.Scale.PangoScale;
layout.FontDescription = des;
}
diff --git a/main/src/addins/MonoDevelop.GtkCore2/ChangeLog b/main/src/addins/MonoDevelop.GtkCore2/ChangeLog
deleted file mode 100644
index 8235e70571..0000000000
--- a/main/src/addins/MonoDevelop.GtkCore2/ChangeLog
+++ /dev/null
@@ -1,2935 +0,0 @@
-2010-10-04 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * MonoDevelop.GtkCore2.csproj:
-
-2010-09-30 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * gtk-gui/gui.stetic:
-
-2010-09-22 Krzysztof Marecki <marecki.krzysztof@gmail.com>
- Implements ReloadDesigner commands.
- * Makefile.am:
- * MonoDevelop.GtkCore2.csproj:
- * MonoDevelop.GtkCore2.addin.xml:
- * MonoDevelop.GtkCore.Commands/GtkCommands.cs:
- * MonoDevelop.GtkCore.Commands/GladeCommands.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFileNodeBuilderExtension.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
-
-
-2010-09-21 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * MonoDevelop.GtkCore2.csproj:
-
-2010-09-20 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * MonoDevelop.GtkCore2.addin.xml:
-
-2010-09-17 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * MonoDevelop.GtkCore2.csproj:
-
-2010-09-17 Krzysztof Marecki <marecki.krzysztof@gmail.com>
- Reorganizing project pad menu items.
- * MonoDevelop.GtkCore2.csproj:
- * MonoDevelop.GtkCore2.addin.xml:
-
-2010-09-15 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.GtkCore2.csproj:
- * MonoDevelop.GtkCore2.addin.xml:
- * MonoDevelop.GtkCore/GtkDesignInfo.cs:
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
-
-
-2010-08-30 Krzysztof Marecki <freefirma@gmail.com>
-
- * Makefile.am:
- * MonoDevelop.GtkCore2.csproj:
-
-2010-08-27 Krzysztof Marecki <freefirma@gmail.com>
-
- * Makefile.am:
- * MonoDevelop.GtkCore2.csproj:
- * MonoDevelop.GtkCore2.addin.xml:
- * MonoDevelop.GtkCore2.xbuild.csproj:
-
-2010-08-17 Krzysztof Marecki <freefirma@gmail.com>
-
- * Makefile.am:
- * MonoDevelop.GtkCore2.csproj:
- * MonoDevelop.GtkCore.addin.xml:
-
-2010-08-16 Krzysztof Marecki <freefirma@gmail.com>
-
- * MonoDevelop.GtkCore.addin.xml:
-
-2010-08-15 Krzysztof Marecki <freefirma@gmail.com>
-
- * MonoDevelop.GtkCore.addin.xml:
-
-2010-08-15 Krzysztof Marecki <freefirma@gmail.com>
-
- * Makefile.am:
- * MonoDevelop.GtkCore2.csproj:
- * MonoDevelop.GtkCore.addin.xml:
-
-2010-08-09 Krzysztof Marecki <freefirma@gmail.com>
-
- * Makefile.am:
- * MonoDevelop.GtkCore2.csproj:
- * MonoDevelop.GtkCore.addin.xml: Add GuiFolderBuilderNode extension
-
-2010-08-07 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * MonoDevelop.GtkCore2.csproj:
-
-2010-08-04 Krzysztof Marecki <freefirma@gmail.com>
-
- * MonoDevelop.GtkCore2.csproj:
-
-2010-07-27 Krzysztof Marecki <freefirma@gmail.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- Remove autoCommit argument
-
-2010-07-05 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Makefile.am:
- * MonoDevelop.GtkCore2.csproj:
- * MonoDevelop.GtkCore.addin.xml:
-
-2010-06-28 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFileExtension.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFileNodeBuilderExtension.cs:
- Fixes fo better file grouping in the project pad
-
-
-2010-06-28 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * MonoDevelop.GtkCore2.csproj:
-
-2010-06-23 Krzysztof Marecki <marecki.krzysztof@gmail.com>
- Draw action group icon
- * gtk-gui/gui.stetic:
- * MonoDevelop.GtkCore2.csproj:
- * MonoDevelop.GtkCore/GtkDesignInfo.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFileExtension.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFileNodeBuilderExtension.cs:
-
-2010-06-23 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Makefile.am:
- * MonoDevelop.GtkCore2.csproj:
-
-2010-06-22 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Makefile.am:
- * MonoDevelop.GtkCore2.csproj:
- * MonoDevelop.GtkCore.addin.xml:
- * MonoDevelop.GtkCore/GtkDesignInfo.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFileExtension.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFileNodeBuilderExtension.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
-
-
-2010-06-16 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * MonoDevelop.GtkCore.addin.xml:
-
-2010-06-15 Krzysztof Marecki <marecki.krzysztof@gmail.com>
- Changes in the project pad for displaying grouped component files
-
- * Makefile.am:
- * MonoDevelop.GtkCore2.csproj:
- * MonoDevelop.GtkCore.addin.xml:
- * MonoDevelop.GtkCore/GtkDesignInfo.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFileNodeBuilderExtension.cs:
-
-
-2010-06-09 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.GtkCore2.csproj:
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Add gtkx files to project
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
-
-2010-06-07 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.GtkCore/GtkDesignInfo.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
-
-2010-06-02 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Makefile.am:
- * MonoDevelop.GtkCore2.csproj:
- * MonoDevelop.GtkCore/GtkDesignInfo.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- Move generated partial class for components from gtk-gui.
-
-2010-04-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Track
- AddFilesToProject API.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs:
- ViewContent widgets are now destroyed by the workspace
- window.
-
-
-2010-04-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: call
- destroy on the container vbox during
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs: Found better work
- around for the "gnome-sharp" reference issue.
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs: Fixed 'Bug 599335 -
- Error CS0433: The imported type `Gtk.DeleteEventArgs' is
- defined multiple times (CS0433)'.
-
-2010-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Added
- null check.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.GtkCore.addin.xml: Bumped MD version.
-
-2010-03-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Use the
- stock Visual Design layout as layout for stetic.
-
-2010-03-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Fix
- race in SteticApp initialization.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.GtkCore.csproj:
- * MonoDevelop.GtkCore.addin.xml:
- * MonoDevelop.GtkCore/GtkDesignInfo.cs:
- * MonoDevelop.GtkCore/ReferenceManager.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs:
- * MonoDevelop.GtkCore/ProjectResourceProvider.cs:
- * MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs:
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs:
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs:
- * MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs:
- * MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs:
- * MonoDevelop.GtkCore.Dialogs/GtkDesignerOptionsPanelWidget.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- Merged MD.Projects into MD.Core, and MD.Projects.Gui,
- MD.Core.Gui and MD.Components into MD.Ide.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs:
- Track api changes.
-
-2010-02-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs:
- Track API changes for lazy loading images.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: Track api
- changes.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.GtkCore.Dialogs.GtkDesignerOptionsPanelWidget.cs:
- Flush.
-
-2010-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- Track DisplayBinding API.
-
-2010-01-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.GtkCore.csproj:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Format
- generated files using the MD formatter to ensure that the
- generated text is the same for al platforms and
- environments.
-
- * gtk-gui/gui.stetic: Use global:: for type references in
- generated code.
-
-2009-12-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- Implement SupportsItem.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: When
- adding a stock gtk widget to a window there is no need to
- update the references. Fixes bug #565492.
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.GtkCore.Dialogs.GtkDesignerOptionsPanelWidget.cs:
- Flush.
-
-2009-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- Introduced the ConfigurationSelector class to all methods
- that previously took a configuration name as string. This
- eliminates the ambiguity between solution configuration
- names and project configuration names.
-
-2009-11-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders\WindowsFolder.cs:
- Implemented Equals/GetHashCode. Fixes bug #549902 - MD
- crashes when adding a new gtk form.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.GtkCore.addin.xml: Bump MD version.
-
-2009-10-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * MonoDevelop.GtkCore.csproj:
- * gtk-gui/MonoDevelop.GtkCore.Dialogs.GtkDesignerOptionsPanelWidget.cs:
- Flush.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Use
- typed collection instead of ArrayList.
-
-2009-10-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs:
- Handled icon loading failures.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.GtkCore.addin.xml: Bump MD version.
-
-2009-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Route
- commands to the text editor view. Fixes bug #536740 -
- Expression evaluator unnecessarily in context menu.
-
-2009-09-09 Christian Hergert <chris@dronelabs.com>
-
- * libstetic/editor/Accelerator.cs:
- * libstetic/editor/GroupPicker.cs:
- * libstetic/editor/TextEditor.cs:
- * libstetic/editor/SelectImageDialog.cs:
- * libstetic/editor/NonContainerWarningDialog.cs:
- * libstetic/editor/TextEditorDialog.cs:
- * libstetic/editor/EditIconDialog.cs:
- * libstetic/editor/IconSelectorMenu.cs:
- * libstetic/editor/Image.cs:
- * libstetic/editor/ActionGroupEditor.cs:
- * libstetic/editor/StringArray.cs:
- * libstetic/editor/EditIconFactoryDialog.cs:
- * libstetic/editor/SelectIconDialog.cs:
- * MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs:
- * MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs:
- * MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Fixes to
- make windows and dialogs Transient to either their parent
- window/dialog or the MD root window (when applicable).
-
-2009-09-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/ProjectResourceProvider.cs: Use real
- resource Ids instead of file names. Fixes bug #528309 -
- Button Icons are not displayed.
-
-2009-09-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs: Store the
- GuiBuilderProject on which the ChangedEvent was subscribed,
- and use that reference when unsubscribing on Dispose. This
- is required because the GuiBuilderProject bound to a project
- may change. Fixes bug #525421 - Removing gtk-sharp reference
- from a project causes it to not function properly.
-
-2009-08-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Don't use the text editor
- display binding id as reference for registering the designer
- view. Use DefaultDisplayBinding instead. Removed unused
- supportedFormats attribute.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.csproj: Updated dependencies. We now
- depend on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- Added support for saving and restoring the status of the
- designer, including the undo queue. This allows implenting
- ISupportsProjectReload.
-
-2009-08-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/FolderNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/GuiBuilderProjectNodeBuilder.cs:
- Remove unused files.
-
-2009-08-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Use the
- new AssemblyContext class to query and resolve assemblies.
-
-2009-08-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.GtkCore.csproj:
- * MonoDevelop.GtkCore/Counters.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Added
- some performance counters.
-
-2009-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDocumentOutline.cs:
- Track api changes.
-
-2009-07-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: No more
- missing IntPtr constructor exceptions.
-
-2009-06-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/ProjectResourceProvider.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Use the
- new DesktopService instead of PlatformService.
-
-2009-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Track
- assembly lookup APIs.
-
-2009-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore\ProjectResourceProvider.cs:
- GetMimeTypeForUri doesn't really support uris.
-
-2009-06-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs:
- GetGtkAssemblyVersion is expected to return the version and
- token, not only the version.
-
-2009-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore\ReferenceManager.cs: Don't get the
- package version from the gtk# package. Instead, get it from
- the first version numbers of the gtk-sharp assembly. That's
- necessary because in windows there is no gtk# package.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs:
- Workaround for what seems to be a mcs bug. Looks like it
- can't properly resolve the implicit conversion of null to
- string.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore\GtkDesignInfo.cs:
- * MonoDevelop.GtkCore.GuiBuilder\GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder\GuiBuilderProject.cs: Use the
- new FilePath class for handling file and directory paths.
-
-2009-05-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Don't
- create a new drop target list. Use the one defined by
- Stetic.
-
-2009-04-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.csproj: Don't require a specific gtk#
- version.
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: gui designer is now before
- the text editor (wrong text editor id).
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- Track API changes.
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- Track API changes.
-
-2009-04-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs: Remove vte-sharp
- from the gnome libs list, since it now has its own package.
-
-2009-04-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Track
- API changes.
-
-2009-04-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs:
- Removed unused namespace.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs:
- * MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs:
- Renamed PixbufService to ImageService.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs:
- * MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs:
- Track API changes.
-
-2009-04-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs: Moved
- SystemAssemblyService and related classes to the namespace
- MonoDevelop.Core.Assemblies.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.GtkCore.addin.xml: Bump MD version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs:
- * MonoDevelop.GtkCore/ReferenceManager.cs:
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs:
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: Add
- support for multiple target runtimes.
-
-2009-03-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- Track API changes.
-
-2009-03-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: When the stetic files
- are generated for the first time, ensure that their write
- date is < the write date of the .stetic file, otherwise they
- won't be regenerated when building. Fixes bug #483970 -
- [Regression] Default C# Gtk# app no longer builds.
-
-2009-03-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Flush.
-
-2009-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- Don't try to generate files when not building inside the
- IDE.
-
-2009-02-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: In
- ForceCodeGenerationOnBuild, force a rebuild of the project
- too. Fixes bug #472683.
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.csproj: Flush.
-
-2009-02-26 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/ProjectResourcesProvider.cs: lookup mime
- type and use more specific ResourceInfo ctor. [Fixes #475820]
-
-2009-02-26 Mike Kestner <mkestner@novell.com>
-
- * libsteticui/WidgetDesignerBackend.cs: implement Delete key
- support. [Fixes #470637]
-
-2009-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Added
- explicit "Misc" category for localization.
-
-2009-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Worked on
- propertygrid localization.
-
-2009-02-25 Mike Kestner <mkestner@novell.com>
-
- * libsteticui/ApplicationBackend.cs: Reload the registry libraries
- in LoadLibraries, since adding a library doesn't necessarily refresh
- an out-of-date previously registered library.
- * libsteticui/CecilWidgetLibrary.cs: enhance NeedsReload check to
- use a cache refresh and the new change notification so that the
- library stays 'dirty' until it's reloaded.
- * libsteticui/LibraryCache.cs: add change notification for cache items.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: do an update
- of the steticapp libs even if the list hasn't changed in case the
- contents of any of them have changed.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: check for
- 'dirty' references when regenerating code. [Fixes #472683]
-
-2009-02-24 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: only touch the design file
- when forcing rebuilds.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: don't regen
- if design file and generated files have equal timestamps to avoid
- regenerations on fresh checkouts. [#478894]
-
-2009-02-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml:
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs:
- Track merge of the project pad context menu.
-
-2009-02-18 Mike Kestner <mkestner@novell.com>
-
- * libstetic/wrapper/ScrolledWindow.cs: when the child viewport itself
- is being replaced, don't try to remove the viewport from itself.
- * libstetic/wrapper/Viewport.cs: add case for when placeholders are
- being replaced by scrollable widgets to insert the new child directly
- into the parent scrolled window. [Fixes #404861]
-
-2009-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: Fix
- crash when the project's gtk# is not installed.
-
-2009-02-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.csproj: Set correct resource name for
- DrawingArea template.
-
-2009-02-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Track api
- changes.
-
-2009-02-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Fix build. Looks like the makefiles can't cope
- with resources with IDs.
-
-2009-02-13 Mike Kestner <mkestner@novell.com>
-
- * Makefile.am: add template resource
- * MonoDevelop.GtkCore.addin.xml: ditto.
- * templates/DrawingArea.xft.xml: new DrawingArea subclass template
- with stubs for OnExposeEvent, OnButtonPressEvent, OnSizeRequested,
- OnSizeAllocated, and ctor. Helps speed up the development of custom
- drawn widgets. [Fixes #472665]
-
-2009-02-11 Mike Kestner <mkestner@novell.com>
-
- * libstetic/Registry.cs: account for reloading of the coreLib,
- since this can happen when dogfooding MD. [Fixes #365983]
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.csproj: Remove a local-copy ref.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mds:
- * MonoDevelop.GtkCore.mdp:
- * MonoDevelop.GtkCore.csproj: Migrated to MSBuild file format.
-
-2009-02-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * MonoDevelop.GtkCore.mdp:
- * MonoDevelop.GtkCore.addin.xml:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.Dialogs/GtkDesignerOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.GtkCore.Dialogs.GtkDesignerOptionsPanelWidget.cs:
- Added option for enabling/disabling auto-switch of the GUI
- builder layout. Disabled from now on by default.
-
-2009-02-04 Mike Kestner <mkestner@novell.com>
-
- * libstetic/wrapper/objects.xml: explicit default values for Table
- NRows and NCols values so they don't default to 1. Fixes #471242.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.GtkCore.addin.xml: Bump MD version.
-
-2009-02-02 Mike Kestner <mkestner@novell.com>
-
- * libstetic/PropertyDescriptor.cs: null guard the ValueToString
- formatting for string arrays.
-
-2009-02-02 Mike Kestner <mkestner@novell.com>
-
- * libstetic/PropertyDescriptor.cs: handle empty string lists
- * libstetic/wrapper/ComboBox.cs: some more null guarding for Items.
- [Fixes #471244]
-
-2009-01-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: Propagate a
- policy parent SolutionItem through project/file creation so that
- policies can always be resolved correctly.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.mdp:
- * libsteticui/libsteticui.mdp: Flush project format changes.
-
-2009-01-26 Mike Kestner <mkestner@novell.com>
-
- * libstetic/wrapper/ActionTree.cs: guard against removing unsaved
- actions. [Fixes #443472]
-
-2009-01-22 Mike Kestner <mkestner@novell.com>
-
- * libstetic/editor/StringArray.cs: display "(Collection)" in the
- label instead of a joined list on \n which displays garbage chars.
- This approach is consistent with another very popular IDE. ;-)
- * libstetic/wrapper/objects.xml: use Editor.StringArray for the Items
- property of ComboBox.
- * libstetic/wrapper/ComboBox.cs: switch Items to a string[]. Luckily
- this is backwards compat since we currently saved string[] as a newline
- join of the member strings. [Fixes #405396]
-
-2009-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Don't serialize the GtkDesignInfo
- element when it is empty.
-
-2009-01-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Added missing
- nullref check.
-
-2009-01-13 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: adds a
- FileAddedToProject handler which scans the file for classes and
- checks the deleted-designs cache for matches to restore to the
- project.
-
-2009-01-13 Mike Kestner <mkestner@novell.com>
-
- * libsteticui/ProjectBackend.cs (RemoveWidget): export the widget
- to a deleted-designs dir for later recovery if necessary. Should
- also decide on some cleanup mechanism to remove old designs and
- automate recovery in the move case if possible. Or we can wait for
- 1wpf which should solve the move case more cleanly.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: reenable
- OnFileRemovedFromProject handler. Revamp to use a ParseDocument of
- the removed file to scan for removed classes to kill.
- [Fixes #366392]
-
-2009-01-09 Mike Kestner <mkestner@novell.com>
-
- * libsteticui/Project.cs: forward isInternal to the backend in
- AddWidgetLibrary.
-
-2009-01-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * libsteticui/LibraryCache.cs: Don't ignore internal classes when
- looking for widgets. If a widget is internal, set the "internal" flag
- to true. Don't abort AddObjects if there is an assembly resolution
- error.
-
-2009-01-08 Mike Kestner <mkestner@novell.com>
-
- * libsteticui/LibraryCache.cs : delay cache directory creation until
- files are going to be written to it.
-
-2009-01-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * libsteticui/CecilWidgetLibrary.cs: Don't try to resolve full assembly
- paths.
-
-2008-12-18 Mike Kestner <mkestner@novell.com>
-
- * libstetic/editor/Flags.cs : fix cs0030 under new mcs.
- * libstetic/editor/FlagsSelectionDialog.cs : fix cs0030 under new mcs.
- * libstetic/editor/ResponseId.cs : fix cs0030 under new mcs.
-
-2008-12-13 Mike Kestner <mkestner@novell.com>
-
- * libstetic/wrapper/Container.cs: generate tooltips based on the target
- version, using the new Tooltip API for >= 2.12. Fixes #372015.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/WidgetParser.cs: Properly search for subclasses of
- Gtk.Widget.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp:
- * libsteticui/libsteticui.mdp: All projects now require fx 3.5.
-
-2008-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Remove the mono
- version number comment from the generated files.
-
-2008-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs: Track API changes.
-
-2008-12-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDocumentOutline.cs: Use an
- Alignment as the concrete Bin instead of custom InvisibleFrame.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Don't require a specific version of
- Mono.Addins.
-
-2008-12-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/WidgetParser.cs: Optimized GetToolboxItems.
-
-2008-12-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/WidgetParser.cs:
- * MonoDevelop.GtkCore/ObjectsDocument.cs: Getting the list of widgets is
- an expensive operation. It shouldn't be a property.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * AssemblyInfo.cs:
- * MonoDevelop.GtkCore.mdp: Add AssemblyInfo.cs files that are
- autogenerated from the addin manifests.
-
-2008-12-01 Mike Kestner <mkestner@novell.com>
-
- * libstetic/wrapper/objects.xml: move ToggleButton ahead of CheckButton
- and add ToggleButton signal item group to CheckButton. Remove toggled
- signal from RadioButton since it inherits it from CheckButton.
- [Fixes #450237]
-
-2008-11-25 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: refactor the default and
- supported version checks into the ReferenceManager, with all the other
- package and assembly code.
- * MonoDevelop.GtkCore/ReferenceManager.cs: refactored default and
- supported version properties.
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: use new api.
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: use new api.
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: use new api.
-
-2008-11-23 Mike Kestner <mkestner@novell.com>
-
- * *: I've typed lib/stetic/libstetic(ui) a few too many times.
-
-2008-11-18 Mike Kestner <mkestner@novell.com>
-
- * */Makefile.am: break the gnome/gconf-sharp dependencies.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: set up
- callbacks to the PlatformService for MIME resolution and showing
- urls.
-
-2008-11-11 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: use the
- new ForceUpdate method on the ProjectDom returned by GetParserContext
- to ensure a fully updated database.
-
-2008-11-11 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: null guarding for
- all the things that can possibly go wrong with the parse in
- GetClass.
-
-2008-11-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Create the
- formInfos list when the project is loaded. This is necessary since
- the list is destroyed when the project is unloaded. Fixes bug #Bug
- 431723 - Cannot build GTK applications with sln format.
-
-2008-11-06 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- revert the context menu changes. Don't show them if the project has no
- gtk-sharp ref, only add the templates to the dialog, per Lluis.
-
-2008-11-06 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- show Add Widget|Window|Dialog|ActionGroup template items in the context
- menu and Add File dialog even when the project has no Gtk# reference.
-
-2008-11-05 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: needed to revert
- the >= to <= change from the 440435 fix since the refmgr is now
- reporting TargetGtkVersion without Version=. oops.
-
-2008-11-05 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs: strip Version= out of
- TargetGtkVersion.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Bump MD version.
-
-2008-10-30 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- switch to a x.y TargetGtkVersion obtained by parsing the gtk-sharp
- reference version. Invert the version comparison in the toolboxitem
- filter. We want toolbox items that are less than the project target
- version, not greater. Fixes #440435.
-
-2008-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Don't notify the
- file has changed unless the changes are saved to disk. Fixes bug
- #430497 - Widget names created in Stetic not available for
- autocomplete.
-
-2008-10-29 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs (ShowPage): only
- regenerate the dummy structure when switching to the source page.
-
-2008-10-28 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/ReferenceManager.cs: switch default updating
- to use the current assembly StoredReference version. Avoids problems
- when the stored version has no corresponding installed package.
- Fixes #436246.
-
-2008-10-27 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: don't store
- configuration on Project Save. Avoids a crash due to file availability
- when saving config while loading and it's extraneous since we store
- the config on app exit and it contains no project specific props.
-
-2008-10-22 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs (HasDesignedObjects): guard
- against null projects.
-
-2008-10-21 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs (HasDesignedObjects): don't
- instantiate just to get the SteticFile. Avoids project file garbage.
- [Fixes #436201]
-
-2008-10-21 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: guard against null
- documents returned from parse. I think this is related to the old
- ErrorsDuringCompile check that was commented with the new parser port.
- [Fixes #436998]
-
-2008-10-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: fixed TODO.
-
-2008-10-03 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding:
- rework GetWindow method. now uses the ParsedDocument for a requested
- file to check if any of its types have a GuiBuilderWindow.
- The existing method of walking the project windows list and using
- the ProjectDom database to lookup their file locations is susceptible
- to timing problems due to imcomplete parse databases. This method is
- probably slightly more efficient as well.
-
-2008-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/ProjectResourceProvider.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Track API.
-
-2008-09-23 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: bandaid to
- avoid exceptions when removing non-existent buttons. Fixes #377414.
-
-2008-09-23 Mike Kestner <mkestner@novell.com>
-
- * lib/stetic/libsteticui/CecilWidgetLibrary.cs: don't hold assembly
- reference beyond load operation. Recreate it on each load so we are
- always accessing the current assembly instance. Only access cache
- using filename. Ensure Class description lookups cause spew to
- console.
- * lib/stetic/libsteticui/LibraryCache.cs: enhance the path lookup
- logic in Refresh to avoid some churn on named lookups.
- * lib/stetic/libsteticui/ProjectBackend.cs: reload library if
- necessary before getting component types. Fixes #427334.
-
-2008-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Updated projects.
-
-2008-09-15 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCode.GuiBuilder/GtkProjectServiceExtension.cs:
- add the project stetic file to any generation warnings produced.
- Fixes #373244.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.mdp, lib/libstetic.mdp, lib/gtk-gui/generated.cs,
- gtk-gui/generated.cs: Updated generated code.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs,
- MonoDevelop.GtkCore/WidgetParser.cs: Track api changes.
-
-2008-09-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Changes caused by
- interface changes.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs: Moved
- the extensible tree view to its own directory.
-
-2008-08-27 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/WidgetFileDesciptionTemplate.cs: perform a
- project save after the file insertions and updates. This seems
- suboptimal, since it would probably be better to mark the project
- dirty and let the user save the project, but until we switch to
- one-widget-per-design-file, we probably need to save the project
- automatically to avoid problems.
- Fixes #385712.
-
-2008-08-27 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- Restrict to DotNetProjects and verify ProjectFolders are for DNPs.
- Fixes #412448.
-
-2008-08-22 Mike Kestner <mkestner@novell.com>
-
- Fixes bug #413275 and delays more GtkDesignInfo-related project file
- churn.
- * MonoDevelop.GtkCore/GtkCoreService.cs: init the refmgr on startup.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Remove targetVersion field and
- associated prop. Move reference updating logic to Ref Manager. Target
- Version is now exclusively tracked via reference version by the
- ReferenceManager.
- * MonoDevelop.GtkCore/ReferenceManager.cs: new class to encapsulate all
- reference management behaviors, from responding to user add removes to
- automated updates for designer projects.
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: only show feature
- for projects which support refactoring, since it advertises designer
- support and that's not available without refactoring yet. Use refmgr
- for version updates.
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionsPanel.cs: use refmgr
- for version info and suppress gettext options if no designed objects
- exist.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: use refmgr for
- target version.
-
-2008-08-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs: Remove
- the "resources folder" feature. Resources are now shown in the
- solution tree like any other files. For a detailed explanation see
- "Bug 381430 - [PATCH] Display resource files in main project tree".
-
-2008-08-19 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: revert a silly
- change that was causing explicit paths to be inserted into gui.stetic
- files for gac references. [Fixes #412960]
-
-2008-08-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: fixed issue in
- GetSourceCodeFile.
-
-2008-08-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: fixed some
- possible nullrefs.
-
-2008-08-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.mdp, lib/libsteticui.mdp: re-set project
- references (fix some libstetic.dll not found issue, localcopy ==
- true was missing).
-
-2008-08-18 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: make HasDesignedObjects
- and SupportsDesigner static so that we can defer a few more instance
- creation scenarios.
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs:
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs:
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs:
- Update to new static API.
-
-2008-08-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Add a null
- check.
-
-2008-08-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: fixed possible
- null references in the unload method.
-
-2008-08-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Fix crash when looking for
- designed objects in a project that doesn't support it.
-
-2008-07-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Fixed some
- issues.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs,
- MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Translated
- old code to new dom.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/ObjectsDocument.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Changes for converted
- refactoring infrastructure.
-
-2008-07-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/WidgetParser.cs,
- MonoDevelop.GtkCore/ObjectsDocument.cs,
- MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/ClassUtils.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Worked on code
- completion/new dom.
-
-2008-07-24 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: get paths
- for gac references to simplify the lookup in stetic.
-
-2008-07-23 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- Use HasDesignedObjects not SupportsDesigner.
-
-2008-07-23 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: delay creation of guifolder
- until GuiBuilderProject is accessed. Refactor Bind into a Project
- property to gather all the connect/disconnects together. Add new
- HasDesignedObjects prop for when SupportsDesigner doesn't cut it.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs: use new
- HasDesignedObjects prop.
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs:
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: don't
- need to update the folder for these options any more.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs: get
- GuiBuilderProject from design info directly.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: kill
- BeforeCompile handler and GetGuiBuilderProject method. Use new
- HasDesignedObjects to control code generation.
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs: kill
- GenerateSteticCode field. It was always set to true. Use new
- HasDesignedObjects prop to control generation.
-
-2008-07-22 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Connect to project file
- events and trigger objects.xml updates. Translate a confirm button
- label. Require AddAttribute refactoring.
- * MonoDevelop.GtkCore/ObjectsDocument.cs: new class reinstating some
- old document updating code and adding some new. Inserts ToolBoxItem
- and Category attrs into sources for a first-time "upgrade" to enable
- the attr-sync feature now controlled by a root attribute on the
- document.
- * MonoDevelop.GtkCore/WidgetParser.cs: new class reinstating some
- old parsing code and adding some new. This will become the home
- for all source parsing in the addin. Refactoring to come...
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Add WidgetParser
- prop. Remove Debug spew.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs,
- MonoDevelop.GtkCore/GtkDesignInfo.cs: Moved serialization engine to
- MonoDevelop.Core. Use new syntax for specifying attribute scope.
-
-2008-07-15 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: add an updatingVersion
- state to prevent warning when we are adjusting reference versions.
-
-2008-07-15 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: add a user confirmation for
- disabling the designer on reference removal. Leave the stetic.gui
- and objects.xml files on disk, though we still remove them from the
- project.
-
-2008-07-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Fixed possible
- null reference.
-
-2008-07-10 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs (FromProject): return an
- empty instance for non-DotNetProjects which will report false
- on SupportsDesigner.
-
-2008-07-10 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: Gutted. Moved everything
- that took a Project parameter to GtkDesignInfo. Removed all the
- enable/disable/get info methods replaced by GtkDesignInfo.FromProject.
- Killed all the objects file updating. Moved designer support checks
- to DesignInfo.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Add FromProject static
- method to replace GtkCoreService.GetGtkInfo. Remove ExportedWidgets
- and IsWidgetLibrary functionality. Enable and disable designer based
- on presence of gtk-sharp reference on projects. Refactor/move code
- generation to GuiBuilderProject from UpdateGtkFolder. Kill
- GeneratePartialClasses since it's a simple project property access
- and all users of GtkDesignInfo access it via the project. Moved
- Refactory checks from GtkCoreService to encapsulate SupportsDesigner.
- Fix Reference updating checks for Mono.Posix, since the
- StoredReference returns a simple name for it.
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: switched to
- FromProject api. Killed ExportedWidget handling.
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: removed widget
- library checkbox. s/Gtk#/GTK# for consistency. Updated to new
- DesignInfo API.
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: removed
- all the Exported Widgets and WidgetLibrary tab stuff, simplified to
- a vbox and hand-written to remove glade taint.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- switched to new DesignInfo API.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- switched to new DesignInfo API. moved gui folder file generation
- here instead of DesignInfo iterating over builder properties.
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs:
- Added category mangling for ToolboxItems so that they are placed
- by project.
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs:
- switched to new DesignInfo api.
- * templates/Widget.xft.xml: add ToolboxItem attr.
- * templates/WidgetPartial.xft.xml: add ToolboxItem attr.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Bump MD version.
-
-2008-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Explicitly set the resource ids
- for gui.stetic and objects.xml, since msbuild uses different
- default ids.
-
-2008-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: Track api
- changes.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Merged the extension points for
- project and solution option panels into a single extension point. A
- single extension point will now be used for all kinds of items.
- Extension conditions can be used to make panels visible only for
- some specific item types.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- Replaced ICompilerResult/DefaultCompilerResult/CompilerResults by a
- new BuildResult class, which has owner information at error level,
- so it is possible to know which project generated an error when
- building a solution. Updated Task and TaskService to use the new
- owner information.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs,
- MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs,
- MonoDevelop.GtkCore/ProjectResourceProvider.cs,
- MonoDevelop.GtkCore.addin.xml,
- MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore.mdp,
- MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs,
- MonoDevelop.GtkCore.mds, lib/libsteticui.mdp, lib/libstetic.mdp,
- Makefile.am,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs,
- MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: New project
- model changes.
-
-2008-05-20 Mike Kestner <mkestner@novell.com>
-
- * templates/Widget.xft.xml:
- * templates/WidgetPartial.xft.xml:
- Mark the custom widgets Visible=false to conform to the Gtk convention
- of widgets being shown explicitly. [Fixes #364985]
-
-2008-05-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Track API. Mark up
- for property grid.
-
-2008-05-13 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: use new
- Stetic.ApplicationFactory api.
-
-2008-05-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Track API.
-
-2008-04-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp, gtk-gui,
- gtk-gui/generated.cs, gtk-gui/gui.stetic, Makefile.am,
- icons/pad-widget-tree-16.png,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDocumentOutline.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs: Implement
- IOutlinedDocument instead of custom pad. Set GTK# version to 2.8.
-
-2008-03-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Removed unneeded dependency.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: fixed bugfix (thanks
- ankit)
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Fixed possible null
- reference exception.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Worked on gnome hig
- compliant alerts.
-
-2008-03-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Fixed null ref.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Refactored content
- interfaces
-
-2008-02-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.mdp: Set correct makefile ver for files.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Worked on category
- support for the toolbox service.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.mdp, lib/libsteticui.mdp: Removed some unused glade
- and gnome-sharp references (only the unused). But I'll continue to
- remove glade, we need to lower the dependency tree a bit.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Added IViewContent
- switching logic (but should be done centrally using the secondaryview
- paradigmn).
-
-2008-02-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Workaround for mono bug
- #350432.
-
-2008-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs: Handle the delete
- key in TreeViewPad, so it will work event if the shortcut is not
- defined.
-
-2008-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp, Makefile.am,
- icons/pad-widget-tree-16.png: Added widget tree icon.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Update MD version.
-
-2008-01-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs,
- MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs,
- MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: Made internal
- some classes that don't need to be public.
-
-2008-01-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Notify file changes
- through the FileService.
-
-2008-01-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Stetic code must be
- generated in the GUI thread. Should fix bug #349505.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Feed default layout
- name to Gettext for translation.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/WidgetPartial.xft.xml, templates/Widget.xft.xml,
- templates/WindowPartial.xft.xml, templates/ActionGroupPartial.xft.xml,
- templates/Window.xft.xml, templates/ActionGroup.xft.xml,
- templates/DialogPartial.xft.xml, templates/Dialog.xft.xml: Make template
- categories translatable.
-
-2008-01-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Added null check on the
- result of UpdateFile. Should fix bug #352194.
-
-2008-01-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs,
- MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs,
- MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs,
- MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs: Handle
- projects which don't support the GTK# designer. Window and widget
- generation options are hidden, and code is never generated. Fixes bug
- #350632.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Don't update bindings if the
- file has syntax errors. May fix bug #347590.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Bump add-in versions.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Update after build reorg.
-
-2007-12-06 Geoff Norton <gnorton@novell.com>
-
- * Makefile.am: Only build the GtkCore addin if we have gnome-sharp
- available.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp, lib/libsteticui.mdp, lib/libstetic.mdp,
- Makefile.am: Directory reorganization.
-
-2007-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * gui.glade, MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs: Removed
- Gnome.FileEntry.
-
-2007-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs: Track
- LoggingService API changes.
-
-2007-11-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Use RootCombine
- instead of CurrentOpenCombine when possible.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Bump MD version.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Fix nullref. Happens
- when removing a project from a solution while one of the windows of that
- project is open.
-
-2007-10-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/ActionGroup.xft.xml, templates/ActionGroupPartial.xft.xml,
- templates/Dialog.xft.xml, templates/DialogPartial.xft.xml,
- templates/Widget.xft.xml, templates/WidgetPartial.xft.xml,
- templates/Window.xft.xml, templates/WindowPartial.xft.xml: Use tango
- file icons. Removed obsolete icons.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: Track api changes. Added
- Description property.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.mdp, lib/libstetic.mdp: Project file names updated by
- change in MD path functions.
-
-2007-10-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mds, Makefile.am: Added custom command for updating
- the Stetic sources.
-
-2007-10-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Set a more meaningful category name for
- addin commands.
- * MonoDevelop.GtkCore.mdp, MonoDevelop.GtkCore.mds: Updated.
-
-2007-10-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: If the current selection
- can't be deleted, just ignore the delete command, so the default handler
- will be executed. Fixes bug #325440.
-
-2007-10-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.mdp: Fix required gtk# version.
-
-2007-10-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Applied changes that
- were neccassary for to the new FileService.
-
-2007-10-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: Changed calls for
- the new StringParser.
-
-2007-10-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: In Bind(), don't subscribe the
- NameChanged event at every call.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: The designer needs to
- be explicitely destroyed.
-
-2007-10-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: No need to implement
- IComparable; it's done in the base class now.
-
-2007-09-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: Assign the selected
- target gtk# version to the new project.
-
-2007-09-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Use ProjectReference.StoredReference
- rather than ProjectReference.Reference, in order to refer to the actual
- stored reference string rather than a temporarily bumped version.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Bump MD version.
-
-2007-09-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Implemented an
- assembly resolver for the stetic app, so assembly widgets registered
- with .pc files can be found.
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs: If a widget dll belongs
- to a package, store it as a package reference in the toolbox index.
-
-2007-09-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Allow setting TargetGtkVersion to
- DefaultGtkVersion when current value is null.
-
-2007-09-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Don't touch GTK# assembly versions
- when a target version is not set. Don't use gtkVersion=null to represent
- default version.
- * MonoDevelop.GtkCore/GtkCoreService.cs: Set TargetGtkVersion on new
- projects. Bump default version to 2.8.
-
-2007-09-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.mdp, lib/libsteticui.mdp, lib/libstetic.mdp,
- lib/Makefile.am, MonoDevelop.GtkCore.mds, Makefile.am: Use projects for
- imported stetic libraries.
-
-2007-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Removed access to
- Component object.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Remove unused method.
-
-2007-09-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs,
- MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs,
- MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs: Fix warnings.
-
-2007-09-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * lib/stetic, Makefile.am, lib/Makefile.am: Build stetic from
- svn:externals.
- * lib/libsteticui.dll.config, lib/libstetic.dll.config,
- lib/libstetic.dll, lib/libsteticui.dll: Removed.
-
-2007-09-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/WidgetPartial.xft.xml, templates/Widget.xft.xml,
- templates/WindowPartial.xft.xml, templates/Window.xft.xml,
- templates/ActionGroupPartial.xft.xml, templates/ActionGroup.xft.xml,
- templates/DialogPartial.xft.xml, templates/Dialog.xft.xml: Remove
- deprecated FileOptions element from templates.
-
-2007-09-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Changed the way to
- set the active designer (the api changed). Fixed some renaming issues.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs: Track api changes.
-
-2007-09-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/Window.xft.xml: Oops, PartialTypeSupport should be set to
- Disabled for non-partial window.
-
-2007-09-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.mdp, Makefile.am: Updated.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs: Use DotNetProject.UsePartialTypes
- instead of custom setting.
- * MonoDevelop.GtkCore/WidgetFileTemplatePartialClass.cs,
- MonoDevelop.GtkCore/WidgetFileTemplateFullClass.cs: No longer needed.
- * templates/WidgetPartial.xft.xml, templates/Widget.xft.xml,
- templates/WindowPartial.xft.xml, templates/Window.xft.xml,
- templates/ActionGroupPartial.xft.xml, templates/ActionGroup.xft.xml,
- templates/DialogPartial.xft.xml, templates/Dialog.xft.xml: Use
- PartialTypes condition instead of custom file template.
-
-2007-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- Includes fixes for bugs #82671, #82527, #82476, #81763 and #81238.
-
-2007-08-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/PropertiesWidget.cs: Changes due to new
- property infrastructure.
-
-2007-08-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs: By default use the project name
- as category name for new custom widgets.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Don't show the full
- name of widgets in the toolbar.
-
-2007-08-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: In FindClass, make
- sure the getUserClass parameter is taken into account when the found
- class is not a multi-part class. Fixes bug #82258.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Removed the CommandService class.
- Everything is done directly with CommandManager. Moved all extension
- node types to MD.Components.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml,
- MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore.mdp, Makefile.am: Reorganized the extension point
- hierarchy. Embedded all add-in manifests as resources.
- * lib/libstetic.dll: Updated from stetic module.
-
-2007-08-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Improved error
- reporting.
-
-2007-08-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Converted
- DispatchService to a static class.
-
-2007-08-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.dll: Updated.
-
-2007-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Fixed some
- problems with the target gtk version. It was not assigned to the
- stetic project. Also fixed some stock icon rendering issues in
- Stetic.
-
-2007-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- Includes a nullref fix.
-
-2007-07-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Layout switch
- delay is not needed anymore.
-
-2007-07-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: Fix nullref
- when gtk support is not enabled. Patch by Chris Howie.
-
-2007-07-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- Don't try to use the CurrentNode property after adding the file,
- since it may have changed. Should fix bug #82123.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
- Fixes bugs #81846 and #82144.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Fix window
- source file lookup.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Use the new methods
- for checking clipboard operations on the current selection.
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Include the
- current project in the list of libraries to show in the toolbox.
- Fixes bug #82125.
-
-2007-07-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated. Fixes bugs 81977,
- 81810 and 82052.
-
-2007-07-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Properly rename
- fields when the widget name is changed. Fixes bug #81976.
-
-2007-07-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs: Update the
- properties pad when the focus is on the widget tree pad. Fixes bug
- #81971.
-
-2007-07-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Added null
- check.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Track api changes
- in DesignerSupport. When adding a project reference to a widget
- library, take into account that widgets may be implemented in a
- library different from the one providing the widget list.
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: In
- GetDynamicItems, only return widgets provided by libraries
- referenced by the project. Don't return widgets from libstetic
- since those are already included by default in the toolbox.
- Implemented IToolboxDefaultProvider.
-
-2007-07-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Changed a bit
- because of the removal of custom collections in the Ide project.
-
-2007-06-30 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * gui.glade: Fixed capitalization.
-
-2007-06-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs: Don't show windows
- in the toolbox.
- * lib/libstetic.dll, lib/libsteticui.dll: Updated from Stetic module.
-
-2007-06-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
-
-2007-06-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * gui.glade, MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs,
- MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: Allow selecting
- the target GTK# version of the project.
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp, Makefile.am,
- MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Implemented a
- toolbox loader, which allows registering assemblies in the toolbox.
- When a widget from a toolbox is dropped to a window, MD will now
- add a reference to the required assembly.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
-
-2007-06-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll: One last update.
-
-2007-06-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
-
-2007-06-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Set the import
- file callback when editing project stock icons.
- * MonoDevelop.GtkCore/ProjectResourceProvider.cs: The GetResources
- method only returns resource files now.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
-
-2007-06-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs: Default pad
- placement is now specified in the xml file.
-
-2007-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: In GetBaseType, use
- Project.GetWidgetTypes to get all registered wiget types, including
- base widget types (which were not provided by GetComponentTypes).
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- Includes fix for bug #81785.
-
-2007-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: Don't include non-public
- members to the objects.xml file.
-
-2007-05-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Updated.
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: Fix feature message.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
- Includes fixes for bugs #81761, #81758 and #81762.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- (UpdateLibraries) Properly check for library changes.
-
-2007-05-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- Fixes bugs #80783 and #81683.
-
-2007-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp, Makefile.am: Added new dependency.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from svn. Fixes bug
- #81590.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: When selecting an
- image file in the widget designer, import the file into the
- project.
-
-2007-05-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Added some delay
- in the code that changes the workbench layout when selecting the
- designer. Fixes bug #80963.
-
-2007-05-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp, Makefile.am,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPalettePad.cs: Removed old
- palette pad.
- * MonoDevelop.GtkCore/GtkCoreService.cs: Set the 'internal' flag for
- widgets implemented by private classes.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from svn module.
- Fixes bugs #80875, #81261, #81365.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: If the project
- is a library, add itself as an internal widget library, so widgets
- with internal visibility will be shown.
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: When saving a window,
- use the visibility of the class to set the visibility of the
- component. Together with all changes done in stetic, fixes bug
- #80875.
-
-2007-05-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs,
- MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Track api changes in
- Stetic.
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: Delay
- library updating until really necessary.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Copy the .addins.xml file to the output dir.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Copy stetic dlls together with the assembly.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated.
-
-2007-05-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp, Makefile.am: Reference shared assemblies
- from the correct location.
-
-2007-05-04 Wade Berrier <wberrier@novell.com>
- * lib/libstetic.dll.config:
- * lib/libsteticui.dll.config:
- Fix os attribute formats (mono-config.c separates oses by comma,
- and ignores or includes the whole string.)
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp, Makefile.am:
- Migration to Mono.Addins.
-
-2007-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp,
- MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs, Makefile.am:
- Implemented project feature for enabling gtk# support in new
- projects.
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs: Use
- Menu icon size in the project pad.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
-
-2007-04-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs: Show a
- relative path in the window delete confirm dialog, since the
- absolute path may take too much space.
- * MonoDevelop.GtkCore.mdp: Updated.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * templates/DialogPartial.xft.xml, templates/Dialog.xft.xml: Add
- Ok/Cancel buttons by default in new dialogs.
-
-2007-03-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- Includes fixes for bugs 81033, 81086, 81239, 81143, 81014 and
- 81015.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Allow pasting when
- a placeholder is selected. Fixes bug #81246.
-
-2007-03-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml,
- MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.mdp, Makefile.am, icons/image-x-generic.png:
- Show a "Stock Icons" node in the User Interface folder. It's easier
- to discover than the context menu option.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.Commands/GladeCommands.cs: Added menu option
- for opening the gtk# settings.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Don't crash if
- the gtk-gui folder doesn't exist. Fixes bug #81152.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Hide the border
- of the combined view notebook.
-
-2007-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.dll: Updated from stetic module. Fixes NRE crash.
-
-2007-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Fix null ref.
-
-2007-03-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Register a new toolbox loader. Removed
- old properties pads.
- * MonoDevelop.GtkCore.mdp, Makefile.am: Added reference to
- MonoDevelop.DesignerSupport.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from svn module.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/PropertiesWidget.cs,
- MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Integrate Stetic
- widgets in the main toolbox.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: Implement
- ICustomPropertyPadProvider and return the Stetic property pad.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs: Renamed.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Fix warning.
-
-2007-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- Updated from Stetic module. Includes fix for bug #80864.
-
-2007-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from SVN. Fixes some
- memory leaks and bug #79453.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Explicitely
- destroy notebook children, since notebook doesnt do it because of a
- gtk bug.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Some fixes in the
- dispose code.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Use
- ProjectOperations.SaveProject to save projects.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Change add-in versions to 0.13.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Fix nullref.
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs: Log
- error message.
- * Makefile.am, MonoDevelop.GtkCore.mdp: Synchronized MD project and
- makefile.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Avoid throwing
- delayed events after the project has been disposed.
-
-2007-02-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Added missing
- null check.
-
-2007-02-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Ask for user
- confirmation when reloading a designer only when the designer has
- unsaved changes.
-
-2007-02-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs,
- MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Detect external
- changes in the gui.stetic files, and reload it when it changes.
- Take into account that the load of gui.stetic can fail. Added
- several workarounds for this case.
-
-2007-02-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from SVN. Includes
- fixes for bugs #80722, #79427 and #80127.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Store some
- Stetic configuration in the MD properties.
-
-2007-02-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * gui.glade, MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Added options
- for enabling/disabling gtk support, and for gettext support.
- * MonoDevelop.GtkCore.addin.xml: Change options panel name.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Make sure the
- MD project is saved together with the stetic project, if necessary.
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: Avoid saving
- the MD project twice.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs: If gtk
- integration status changes for a project, refresh the tree.
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs: Null check.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Added support for gettext and
- gettext class options for generated code.
- * MonoDevelop.GtkCore/GtkCoreService.cs: Added events for notifying
- when the gtk integration status changes for a project.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * Makefile.am: distcheck fixes
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: When a designer
- project is disposed, hide the designer view in the editor.
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- Factorized some code into GtkDesignInfo.
-
-2007-02-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Make sure the code generation
- extension is executed before the last step.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- Hide the add window commands when the project is not DotNet
- * MonoDevelop.GtkCore.mdp, lib/libsteticui.dll, lib/libstetic.dll:
- Updated.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Intercept calls
- to the IPositionable interface, and show the editor page when
- jumping to a line.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: When looking for
- the window class, avoid returning the generated partial class.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Show the editor
- page when jumping to a signal handler.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Warn the user if
- the gtk-sharp-2 package can't be found. Some distros don't include
- the .pc file in the gtk# package, only in the -devel package.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
-
-2007-01-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.dll.config, lib/libsteticui.dll, lib/libstetic.dll,
- lib/libsteticui.dll.config: Updated from Stetic module.
-
-2007-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Track api
- changes in Document class.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated form Stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Removed
- implementation of all text editor interfaces. Now the view
- overrides GetContent and calls editor.GetContent when a requested
- interface is not found.
-
-2007-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Updated.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Removed unused namespace.
- * MonoDevelop.GtkCore/GtkCoreService.cs: Use the new base-type property
- to describe custom widgets. When looking for properties and events,
- look in the base classes as well as in the widget class.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * Makefile.am,
- MonoDevelop.GtkCore.WidgetLibrary/ProjectClassDescriptor.cs,
- MonoDevelop.GtkCore.WidgetLibrary/ProjectSignalDescriptor.cs,
- MonoDevelop.GtkCore.WidgetLibrary/BaseWidgetLibrary.cs,
- MonoDevelop.GtkCore.WidgetLibrary/AssemblyReferenceWidgetLibrary.cs,
- MonoDevelop.GtkCore.WidgetLibrary/ProjectPropertyDescriptor.cs:
- Removed unused files. All widget library functionality has been
- moved to stetic.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Removed all
- widget library management, which has been moved to Stetic.
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Added some null checks.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Use the new way
- of managing dependencies in projects.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- templates/WindowPartial.xft.xml, templates/Window.xft.xml: The
- window constructor now takes the window type.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Some gui
- improvements and added some null checks.
-
-2007-01-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Don't crash if the
- designer can't be loaded for some reason.
-
-2007-01-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml,
- MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs,
- MonoDevelop.GtkCore/WidgetFileTemplatePartialClass.cs,
- MonoDevelop.GtkCore/WidgetFileTemplateFullClass.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs,
- templates/WidgetPartial.xft.xml, templates/Widget.xft.xml,
- templates/WindowPartial.xft.xml, templates/Window.xft.xml,
- templates/ActionGroupPartial.xft.xml,
- templates/ActionGroup.xft.xml, templates/DialogPartial.xft.xml,
- templates/Dialog.xft.xml: Implemented support for generating code
- in partial classes.
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs: Use the
- correct method for saving the project.
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs: Refresh the user
- interface folder when the gui project is reloaded.
- * MonoDevelop.GtkCore.mdp: Updated.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Added support for partial
- classes. In the GuiBuilderProject property, don't update the
- gtk-gui folder since this call may change the contents of the
- project, and weird things happen when called by the project pad to
- fill the tree.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * Makefile.am: Added new files.
- * MonoDevelop.GtkCore.WidgetLibrary/BaseWidgetLibrary.cs,
- MonoDevelop.GtkCore.WidgetLibrary/AssemblyReferenceWidgetLibrary.cs:
- Make it work even when the assembly it references has been deleted
- (maybe as a result of cleaning a project). In this case the widget
- library is shown as empty.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Added support
- for Loading/Unloading a project, to optimize use of memory for
- solutions with many gui projects. Implemented support for
- generating code in partial classes.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Implemented
- support for generating code in partial classes. Implemented support
- for UNDO/REDO.
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- Generation of gui code is now done from the Build method of a
- project service extension. Fixes some issues when building a
- project which contains custom components.
-
-2006-12-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: Track API changes in
- FileService.
-
-2006-12-13 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Don't
- generate stetic code if CurrentOpenCombine is null.
-
-2006-12-07 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.GtkCore.mdp: Updated to it can be
- built from MonoDevelop.
-
-2006-11-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Simplified the
- code by using global events from the Ide, instead of combine
- events.
-
-2006-10-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Added RemoveExportedWidget method.
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: track
- API changes.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: If the name of a
- widget changes and it is being exported, update it in the objects.xml
- file. Fixes bug #79656.
-
-2006-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from Stetic module. It provides a redesigned API
- which will allow running designers in a separate process.
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs:
- * MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs:
- * MonoDevelop.GtkCore.WidgetLibrary/AssemblyReferenceWidgetLibrary.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPalettePad.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs:
- Track api changes.
-
- * MonoDevelop.GtkCore.WidgetLibrary/BaseWidgetLibrary.cs: Make sure
- parse information is up to date before loading an assembly library.
- * MonoDevelop.GtkCore/ProjectResourceProvider.cs: Make sure this object
- is always alive when remoted.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Added null check.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs: Not needed anymore.
- * MonoDevelop.GtkCore.addin.xml: Removed build step. Code generation
- is done now before compiling.
-
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectWidgetLibrary.cs:
- * MonoDevelop.GtkCore.WidgetLibrary/CachedProjectWidgetLibrary.cs:
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: ProjectWidgetLibrary is not used
- anymore. All libraries are now handled by AssemblyReferenceWidgetLibrary.
-
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopWidgetActionBar.cs:
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopActionGroupToolbar.cs:
- Moved to Stetic.
-
- * Makefile.am:
- * MonoDevelop.GtkCore.mdp: Updated.
-
-2006-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Track api changes.
-
-2006-09-19 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * .: Added svn:ignore for MonoDevelop.GtkCore.pidb
-
-2006-09-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from stetic module. Includes fix for bug #79247.
-
-2006-09-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from stetic module.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- Save the project after editing the icons.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Set the
- ResourceProvider for the main stetic project. Added null check.
-
-2006-08-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Fixed bug about
- adding the wrong widget as action designer page.
-
-2006-08-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: Only export properties which
- return primitive types. Fixes bug #79195.
- * lib/*: Updated from stetic module.
- * MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs: Unsubscribe close
- event when done.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Handle designer
- commands in its own tab page.
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: Explicitely dispose
- custom widgets to avoid memory leaks.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Track api changes.
-
- * MonoDevelop.GtkCore.mdp: Updated.
-
-2006-08-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * gui.glade: Minor fix.
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs: Track api
- changes.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Stetic files don't need
- to be added as resource to projects.
- * MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs: Make it
- work for action groups.
- * lib/*: several fixes.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Added method
- for removing an action group.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Track API changes
- in Stetic. Properly bound edit commands from the main menu.
-
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs:
- * MonoDevelop.GtkCore.addin.xml: Implemented Open and Delete
- commands for global action groups.
-
- * MonoDevelop.GtkCore.mdp: Updated.
-
-2006-08-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from Stetic module. Includes fixes for
- bugs #79043, #79044 and #79045
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Don't
- crash if something goes wrong when binding a class.
- Fixed nullref.
-
-2006-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- CreateContentForFile should not load the file, just create
- the view.
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Add
- support for IEncodedTextContent.
-
-2006-08-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- Set the resource provider before loading the project.
- Fixes bug #78966.
-
- * libs/*: Updated from Stetic module. Fixes several bugs:
- 78938, 78916, 78909, 78956, and 78867.
-
-2006-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectClassDescriptor.cs:
- Added null check.
-
- * MonoDevelop.GtkCore.WidgetLibrary/AssemblyReferenceWidgetLibrary.cs:
- Get the parser context using the assembly file name, not the full
- assembly name.
-
-2006-07-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Factorized several
- more or less duplicate methods into GuiBuilderProject, specially
- methods for locating the class bound to a window. GuiBuilderProject
- now will explicitelly update the parser database the first time it
- needs to locate a class, so it will work even if the parser service
- is busy parsing assemblies.
-
-2006-07-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.dll: Updated from stetic module. Fixes a bug
- in the table wrapper which may cause an endless loop.
-
-2006-07-05 Matej Urbas <matej.urbas@gmail.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.WidgetLibrary/BaseWidgetLibrary.cs: Updated to use
- ReturnType as BaseTypes in IClass instances.
-
-2006-07-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from Stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Fixed automatic
- layout switch policy.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Fix showing of
- action group view.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs: Properly
- bind actions when pressing "BindToField".
-
- * MonoDevelop.GtkCore.addin.xml: Updated versions.
-
-2006-06-29 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.GtkCore.addin.xml: Only display WidgetBuilderOptionPanel
- for "DotNet" projects.
-
-2006-06-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from Stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Switch to the
- designer workbench layout when selecting an action group file.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: Support jumping
- to signal hanlder when double-clicking it in the signals editor.
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Removed debug code.
-
- * templates/ActionGroup.xft.xml:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- Fix code generation of action groups.
-
-2006-06-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: If a member has a [Browsable(false)]
- attribute, don't add it to the objects.xml file. Also don't add
- read-only properties.
- * lib/*: Updated from stetic module. Fixes bugs #78622 and #78620.
- Adds an icon for expander and fixes a bug in ColorButton (fix by ml)
-
-2006-06-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll:
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopWidgetActionBar.cs:
- Track changes in the api.
-
-2006-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * libs/*: Updated from stetic module. Several improvements.
- Also fixes bug #78160.
-
-2006-05-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- Added DisplayName property.
-
-2006-05-29 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: reverted interface changes - missing file change
-
-2006-05-29 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: reverted interface changes
-
-2006-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * libs/*: Updated from stetic module. Adds support for toolbars.
-
-2006-05-23 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: track api changes
-
-2006-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Commands/GladeCommands.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- * MonoDevelop.GtkCore.addin.xml: Added commands for creating
- an action group and editing the project icons.
-
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs: Show local
- action groups as children of the window node.
-
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs: Moved
- some event subscriptions to WindowsFolder.cs
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs: Open the
- corresponding file when clicking on local action groups.
-
- * Makefile.am:
- * MonoDevelop.GtkCore.mdp: Added action group template.
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: Added support for
- action group file templates.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Notify changes in
- local action groups.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Don't show the actions
- tab until there is at least one action group.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs: Don't show
- properties or signals for global actions.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Added virtual method
- OnActiveDocumentChanged, which is called when the view is brought to front.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Use the new MemberName
- field when binding fields.
-
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopActionGroupToolbar.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: Several minor fixes.
-
- * lib/*: Updated.
-
-
-2006-05-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Initial support for the menu editor. Still very unstable!!
-
- * lib/*: Updated from Stetic module.
- * MonoDevelop.GtkCore.addin.xml: Register a node builder and and
- display binding for action groups.
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs: Update
- the folder when action groups change.
- * MonoDevelop.GtkCore/GtkCoreService.cs: Fix nullref.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs: Factorized
- some code into CodeBinder.cs
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Factorized some
- code into CombinedDesignView.cs.
-
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs: New node
- builder for action groups.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs: New display
- binding for editing global action groups.
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopWidgetActionBar.cs: Moved from
- GuiBuilderView.cs.
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopActionGroupToolbar.cs: A new
- toolbar for the action group designer.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: A view for editing
- global action groups.
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Moved here some code
- from GuiBuilderEditSession.cs.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Moved here some
- code from GuiBuilderView.cs.
-
- * Makefile.am:
- * MonoDevelop.GtkCore.mdp: Added new files.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Track api changes.
-
-2006-05-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.dll: Updated from Stetic module. Includes
- a fix for bug #78307.
-
-2006-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Updated versions.
- * MonoDevelop.GtkCore.mdp: Updated.
-
-2006-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from Stetic module. Includes fixes for
- bugs #78266, #78240 and #78276.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Track changes
- in the Stetic API.
-
-2006-04-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Don't
- crash if a stetic project can't be loaded. Fixes bug #78169.
- * lib/libstetic.dll: Updated from Stetic module. Fixes bug #78167.
-
-2006-04-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * libs/*: Updated from stetic module. Fixed construction of
- scales and scrollbars.
-
-2006-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectClassDescriptor.cs: When
- creating a widget from a widget design, remove the signals since
- those signals reference handlers in the widget class, not the
- widget container class.
-
-2006-04-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * libs/*: Fix nullref in some themes.
-
-2006-04-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: Fix typo.
- * libs/*: Fix for #78111, #78092 and #78090.
-
-2006-04-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/ProjectResourceProvider.cs: Save the project
- after adding or removing a resource.
-
-2006-04-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated.
-
-2006-03-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Get open
- combine events in the GUI thread.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs: Properly
- delete signals for which there isn't a handler. Half fixed field
- renaming.
- * lib/*: Updated.
-
-2006-03-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/MonoDevelop.GtkCore.addin.xml: Fix ID and
- description. Added stetic config files to add-in package.
-
-2006-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Updated references.
-
-2006-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- Don't crash if no parse info is available for the file
- being edited. Should fix #77885.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Don't show
- the bind to field button for the root container.
- * lib/*: Updated.
-
-2006-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Use an unified format. Patch by Matze Braun.
- * MonoDevelop.GtkCore.addin.xml: Updated add-in versions.
-
-2006-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml:
- * MonoDevelop.GtkCore.mdp: Removed GladeFileDisplayBinding.
- * lib/*: Updated.
- * Makefile.am: Updated. Some files have been moved to Stetic.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Fixed
- layout switching. Don't show the widget tree pad by default,
- since it is already available as a combo in the designer.
- * MonoDevelop.GtkCore.GuiBuilder/GladeFileDisplayBinding.cs: Removed.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs: use
- the new property tree instead of the grid.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: The designer
- toolbar has been moved to Stetic.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs: Changed
- default placement.
-
-2006-03-19 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * .: Added Makefile.in and Makefile to svn:ignore.
-
-2006-03-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.GtkCore.mdp: Updated.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Added support for using
- resource images in the designer.
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: Check if the objects.xml
- file exists before loading it.
- * MonoDevelop.GtkCore/GeneratorBuildStep.cs: Don't generate code
- if the stetic file has not been modified since the last
- generation.
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: If Gtk
- support is not enabled, don't enable it if no widgets have
- been selected.
- * lib/libstetic.dll: Updated.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Mapped some
- commands.
- * templates/Window.xft.xml: The constructor of Gtk.Window requires
- the title of the window.
-
-2006-03-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp, Makefile.am: Updated.
- * MonoDevelop.GtkCore/GeneratorBuildStep.cs: When generating
- code for a project that exports widgets, include the own
- project library to the generation, since there can be
- widgets that contain other widgets defined in the project.
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectClassDescriptor.cs:
- removed some IdeApp dependencies.
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectWidgetLibrary.cs:
- added method for getting the class information from
- a project.
- * CachedProjectWidgetLibrary.cs: New widget library class
- which takes class information from a collection of
- ProjectClassInfo objects.
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectPropertyDescriptor.cs:
- Consider all properties runtime-properties, since they have
- been created from class properties.
- * lib/*: Updated.
-
-2006-03-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: removed debug files.
-
-2006-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Propagate
- project changes to the editor.
-
-2006-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- Initial implementation of the Stetic add-in.
diff --git a/main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore.Commands/ChangeLog b/main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore.Commands/ChangeLog
deleted file mode 100644
index b2765325e1..0000000000
--- a/main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore.Commands/ChangeLog
+++ /dev/null
@@ -1,4 +0,0 @@
-2010-08-15 Krzysztof Marecki <freefirma@gmail.com>
-
- * GladeCommands.cs:
-
diff --git a/main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore.Dialogs/ChangeLog b/main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore.Dialogs/ChangeLog
deleted file mode 100644
index c48d43c59e..0000000000
--- a/main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore.Dialogs/ChangeLog
+++ /dev/null
@@ -1,18 +0,0 @@
-2010-08-15 Krzysztof Marecki <freefirma@gmail.com>
-
- * ProjectConversionDialog.cs:
-
-2010-08-13 Krzysztof Marecki <freefirma@gmail.com>
-
- * ProjectConversionDialog.cs:
- * WidgetBuilderOptionPanel.cs:
-
-2010-07-06 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * ProjectConversionDialog.cs:
-
-2010-06-23 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * ProjectConversionDialog.cs: Initial commit
- * WidgetBuilderOptionPanel.cs:
-
diff --git a/main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore.GuiBuilder/ChangeLog b/main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore.GuiBuilder/ChangeLog
deleted file mode 100644
index a57bb556bb..0000000000
--- a/main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore.GuiBuilder/ChangeLog
+++ /dev/null
@@ -1,101 +0,0 @@
-2010-10-28 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * GuiBuilderView.cs:
- * GuiBuilderWindow.cs:
- * GuiBuilderProject.cs:
-
-2010-09-08 Krzysztof Marecki <freefirma@gmail.com>
-
- * GuiBuilderWindow.cs:
- * GuiBuilderService.cs:
- * CombinedDesignView.cs:
-
-2010-08-30 Krzysztof Marecki <freefirma@gmail.com>
-
- * GuiBuilderProject.cs:
-
-2010-08-16 Krzysztof Marecki <freefirma@gmail.com>
-
- * GuiBuilderView.cs:
- * ActionGroupView.cs:
- * GuiBuilderProject.cs:
- * GuiBuilderService.cs:
- * GuiBuilderDisplayBinding.cs:
- * ActionGroupDisplayBinding.cs:
- * GtkProjectServiceExtension.cs:
-
-2010-08-15 Krzysztof Marecki <freefirma@gmail.com>
-
- * GuiBuilderProject.cs:
-
-2010-08-15 Krzysztof Marecki <freefirma@gmail.com>
-
- * GuiBuilderProject.cs:
- * GuiBuilderService.cs:
-
-2010-08-13 Krzysztof Marecki <freefirma@gmail.com>
-
- * GuiBuilderView.cs:
- * GuiBuilderProject.cs:
- * GuiBuilderService.cs:
- * GuiBuilderDisplayBinding.cs:
- * ActionGroupDisplayBinding.cs:
-
-2010-08-09 Krzysztof Marecki <freefirma@gmail.com>
-
- * GuiBuilderProject.cs: Generate stetic code after a project converting
- * GuiBuilderService.cs:
- * GuiBuilderDisplayBinding.cs: Don't use component display binding for
- generated partial files
-
-2010-08-07 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * GuiBuilderView.cs: Raise OnDirtyChanged after saving.
- * CombinedDesignView.cs: Track Api Changes.
-
-2010-08-05 Krzysztof Marecki <freefirma@gmail.com>
-
- * GuiBuilderView.cs: Remove ModifiedChanged handler
-
-2010-08-04 Krzysztof Marecki <freefirma@gmail.com>
-
- * CodeBinder.cs: Bump Api
- * GuiBuilderWindow.cs:
- * GuiBuilderService.cs:
- * CombinedDesignView.cs:
- * ActionGroupDisplayBinding.cs:
-
-2010-08-03 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * GuiBuilderProject.cs: When Updatinglibraries don't save
- if Stetic.Project was uninitialized
-
-2010-07-27 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * GuiBuilderView.cs:
- * CombinedDesignView.cs:
-
-2010-07-06 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * GuiBuilderProject.cs:
- * GuiBuilderService.cs:
-
-2010-07-05 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * GuiBuilderProject.cs:
- * CombinedDesignView.cs:
-
-2010-06-23 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * GuiBuilderProject.cs:
-
-2010-06-21 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * GuiBuilderProject.cs: Add Convert method
-
-2010-06-07 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * GuiBuilderProject.cs:
- * GuiBuilderService.cs:
- * GtkProjectServiceExtension.cs:
-
diff --git a/main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore.NodeBuilders/ChangeLog b/main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore.NodeBuilders/ChangeLog
deleted file mode 100644
index f73c1a92e9..0000000000
--- a/main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore.NodeBuilders/ChangeLog
+++ /dev/null
@@ -1,83 +0,0 @@
-2010-09-17 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * GuiProjectFolderNodeBuilder.cs:
-
-2010-09-09 Krzysztof Marecki <freefirma@gmail.com>
-
- * ProjectNodeBuilder.cs:
-
-2010-08-30 Krzysztof Marecki <freefirma@gmail.com>
-
- * ProjectFileNodeBuilderExtension.cs:
-
-2010-08-17 Krzysztof Marecki <freefirma@gmail.com>
-
- * WindowsFolder.cs:
- * WidgetNodeBuilder.cs:
- * WindowsFolderNodeBuilder.cs:
- * ProjectFileNodeBuilderExtension.cs:
-
-2010-08-16 Krzysztof Marecki <freefirma@gmail.com>
-
- * ProjectNodeBuilder.cs:
- * GuiProjectFolderNodeBuilder.cs:
- * ProjectFolderNodeBuilderExtension.cs:
-
-2010-08-15 Krzysztof Marecki <freefirma@gmail.com>
-
- * ProjectNodeBuilder.cs:
- * GuiProjectFolderNodeBuilder.cs:
-
-2010-08-15 Krzysztof Marecki <freefirma@gmail.com>
-
- * ProjectFileExtension.cs:
- * GuiProjectFolderNodeBuilder.cs:
- * ProjectFileNodeBuilderExtension.cs:
- * ProjectFolderNodeBuilderExtension.cs:
-
-2010-08-13 Krzysztof Marecki <freefirma@gmail.com>
-
- * ProjectNodeBuilder.cs:
- * StockIconsNodeBuilder.cs:
- * ProjectFileNodeBuilderExtension.cs:
- * ProjectFolderNodeBuilderExtension.cs:
-
-2010-08-09 Krzysztof Marecki <freefirma@gmail.com>
-
- * GuiProjectFolder.cs: Put gui project folder directly below References
- in the project pad
- * ProjectNodeBuilder.cs:
- * GuiProjectFolderNodeBuilder.cs:
- * ProjectFolderNodeBuilderExtension.cs:
-
-2010-07-06 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * ProjectFileExtension.cs: Move cursor in entryFolder to the end.
-
-2010-07-05 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * ProjectFileExtension.cs: Better approach for obtaining GtkComponentType
- * ProjectFileNodeBuilderExtension.cs:
- * ProjectFolderNodeBuilderExtension.cs:
-
-2010-06-28 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * ProjectNodeBuilder.cs:
- * ProjectFileNodeBuilderExtension.cs:
- * ProjectFolderNodeBuilderExtension.cs:
-
-2010-06-23 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * ProjectNodeBuilder.cs:
- * ProjectFileNodeBuilderExtension.cs: Show ProjectConversionDialog before
- conversion
-
-2010-06-21 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * ProjectNodeBuilder.cs: Convert a project file layout on open
- * ProjectFileNodeBuilderExtension.cs: Group components files
-
-2010-06-16 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * ProjectFileNodeBuilderExtension.cs:
-
diff --git a/main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore/ChangeLog b/main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore/ChangeLog
deleted file mode 100644
index a613ab6eb0..0000000000
--- a/main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore/ChangeLog
+++ /dev/null
@@ -1,68 +0,0 @@
-2010-09-20 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * WidgetFileDescriptionTemplate.cs:
-
-2010-09-17 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * GtkDesignInfo.cs:
-
-2010-09-09 Krzysztof Marecki <freefirma@gmail.com>
-
- * GtkDesignInfo.cs:
-
-2010-09-08 Krzysztof Marecki <freefirma@gmail.com>
-
- * WidgetFileDescriptionTemplate.cs:
-
-2010-08-30 Krzysztof Marecki <freefirma@gmail.com>
-
- * GtkDesignInfo.cs:
-
-2010-08-27 Krzysztof Marecki <freefirma@gmail.com>
-
- * GtkDesignInfo.cs:
-
-2010-08-17 Krzysztof Marecki <freefirma@gmail.com>
-
- * GtkDesignInfo.cs:
-
-2010-08-16 Krzysztof Marecki <freefirma@gmail.com>
-
- * GtkDesignInfo.cs:
-
-2010-08-15 Krzysztof Marecki <freefirma@gmail.com>
-
- * WidgetFileDescriptionTemplate.cs:
-
-2010-08-15 Krzysztof Marecki <freefirma@gmail.com>
-
- * GtkDesignInfo.cs:
-
-2010-08-13 Krzysztof Marecki <freefirma@gmail.com>
-
- * GtkDesignInfo.cs:
-
-2010-08-09 Krzysztof Marecki <freefirma@gmail.com>
-
- * GtkDesignInfo.cs: Add ComponentNeedsCodeGeneration method,
-
-2010-08-04 Krzysztof Marecki <freefirma@gmail.com>
-
- * WidgetFileDescriptionTemplate.cs: Bump Api
-
-2010-07-06 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * GtkDesignInfo.cs: Remove gtk-gui folder after project conversion
-
-2010-06-23 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * GtkDesignInfo.cs:
-
-2010-06-16 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * GtkDesignInfo.cs:
-
-2010-06-07 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * GtkDesignInfo.cs: Transition from project file name to project folder.
-
diff --git a/main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore2.addin.xml b/main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore2.addin.xml
index d86f60ec76..68333ec2a5 100644
--- a/main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore2.addin.xml
+++ b/main/src/addins/MonoDevelop.GtkCore2/MonoDevelop.GtkCore2.addin.xml
@@ -175,7 +175,7 @@
</Extension>
<Extension path = "/MonoDevelop/Core/MimeTypes">
- <MimeType id="text/x-gtkx" _description="Gtk# designer file" icon="gtk-page-setup" isText="true">
+ <MimeType id="text/x-gtkx" _description="Gtk# designer file" isText="true">
<File pattern="*.gtkx" />
</MimeType>
</Extension>
diff --git a/main/src/addins/MonoDevelop.GtkCore2/changes.patch b/main/src/addins/MonoDevelop.GtkCore2/changes.patch
index 9fbc84e921..9857ba3bd7 100644
--- a/main/src/addins/MonoDevelop.GtkCore2/changes.patch
+++ b/main/src/addins/MonoDevelop.GtkCore2/changes.patch
@@ -4034,7 +4034,7 @@ Index: MonoDevelop.GtkCore.addin.xml
</Extension>
+ <Extension path = "/MonoDevelop/Core/MimeTypes">
-+ <MimeType id="text/x-gtkx" _description="Gtk# designer file" icon="gtk-page-setup" isText="true">
++ <MimeType id="text/x-gtkx" _description="Gtk# designer file" isText="true">
+ <File pattern="*.gtkx" />
+ </MimeType>
+ </Extension>
diff --git a/main/src/addins/MonoDevelop.GtkCore2/gtk-gui/ChangeLog b/main/src/addins/MonoDevelop.GtkCore2/gtk-gui/ChangeLog
deleted file mode 100644
index 3e2aea8cac..0000000000
--- a/main/src/addins/MonoDevelop.GtkCore2/gtk-gui/ChangeLog
+++ /dev/null
@@ -1,50 +0,0 @@
-2010-08-27 Krzysztof Marecki <freefirma@gmail.com>
-
- * gui.stetic:
-
-2010-08-15 Krzysztof Marecki <freefirma@gmail.com>
-
- * gui.stetic:
- * MonoDevelop.GtkCore.Dialogs.ProjectConversionDialog.cs:
-
-2010-08-13 Krzysztof Marecki <freefirma@gmail.com>
-
- * gui.stetic:
-
-2010-08-09 Krzysztof Marecki <freefirma@gmail.com>
-
- * gui.stetic:
-
-2010-08-07 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * gui.stetic:
-
-2010-08-05 Krzysztof Marecki <freefirma@gmail.com>
-
- * gui.stetic:
-
-2010-08-04 Krzysztof Marecki <freefirma@gmail.com>
-
- * gui.stetic:
-
-2010-08-03 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * gui.stetic:
-
-2010-07-05 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * gui.stetic:
-
-2010-06-23 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * gui.stetic:
- * MonoDevelop.GtkCore.Dialogs.ProjectConversionDialog.cs:
-
-2010-06-16 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * gui.stetic:
-
-2010-06-07 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * gui.stetic:
-
diff --git a/main/src/addins/MonoDevelop.GtkCore2/icons/ChangeLog b/main/src/addins/MonoDevelop.GtkCore2/icons/ChangeLog
deleted file mode 100644
index 86f901e6a8..0000000000
--- a/main/src/addins/MonoDevelop.GtkCore2/icons/ChangeLog
+++ /dev/null
@@ -1,5 +0,0 @@
-2010-08-15 Krzysztof Marecki <freefirma@gmail.com>
-
- * gtkx.png:
- * gtk-logo.png:
-
diff --git a/main/src/addins/MonoDevelop.GtkCore2/libstetic/ChangeLog b/main/src/addins/MonoDevelop.GtkCore2/libstetic/ChangeLog
deleted file mode 100644
index 4d98b372cf..0000000000
--- a/main/src/addins/MonoDevelop.GtkCore2/libstetic/ChangeLog
+++ /dev/null
@@ -1,1793 +0,0 @@
-2010-10-28 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Makefile.am:
-
-2010-10-04 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * TypedClassDescriptor.cs:
-
-2010-09-30 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Registry.cs:
-
-2010-09-30 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Registry.cs:
- * TypedClassDescriptor.cs:
-
-2010-09-21 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * wrapper/Bin.cs: Set RootWrapperName
-
-2010-08-15 Krzysztof Marecki <freefirma@gmail.com>
-
- * DND.cs:
- * IProject.cs:
-
-2010-08-13 Krzysztof Marecki <freefirma@gmail.com>
-
- * GeneratorContext.cs:
-
-2010-08-07 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * IProject.cs: Remove Modified property, add WasModified method which check state of a given top level
-
-2010-08-03 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * GladeUtils.cs: Set ObjectWrapper.RootWrapperName when reading from xml
- * WidgetUtils.cs:
- * ObjectReader.cs:
- * ObjectWrapper.cs:
- * wrapper/Frame.cs:
- * wrapper/Window.cs:
- * wrapper/MenuItem.cs:
- * wrapper/Expander.cs:
- * undo/UndoManager.cs:
- * wrapper/Notebook.cs:
- * wrapper/Container.cs:
- * wrapper/OptionMenu.cs:
-
-2010-08-03 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * ObjectWrapper.cs: Save a root wrapper name
-
-2010-06-07 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * IProject.cs:
- * ErrorWidget.cs:
-
-2010-04-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * editor/ActionMenu.cs: Explicit destroy of children should
- not be required.
-
-2010-04-30 Mike Krüger <mkrueger@novell.com>
-
- * editor/ActionMenu.cs: moved code from dispose -> destroy.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * editor/ActionMenu.cs:
- * editor/ActionToolbar.cs:
- * editor/ActionMenuBar.cs: Destroy gtk components instead of
- disposing them.
-
-2010-04-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * GladeUtils.cs: Fix glade import. GtkWindow and GtkDialog
- need to be special cased, since we are not creating real
- Gtk.Window objects anymore.
-
-2010-04-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Misc.cs: Show alignment buttons as toggles.
-
-2010-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Widget.cs:
- * wrapper/Container.cs: When setting the name of a widget,
- make sure the old name field is also set. Fixes bug #549463
- - Forms designer renames variables it shouldn't.
-
-2010-01-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * TypedPropertyDescriptor.cs: Don't translate property names
- in the property grid. See bug #571351.
-
-2010-01-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * GeneratorContext.cs: When loading an icon, don't hardcode
- the required size. Instead, call SizeLookup to get the
- correct size for the current theme.
-
-2010-01-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * ImageInfo.cs:
- * wrapper/Bin.cs:
- * WidgetUtils.cs:
- * libstetic.csproj:
- * ObjectWrapper.cs:
- * wrapper/Action.cs:
- * wrapper/Widget.cs:
- * wrapper/VScale.cs:
- * wrapper/HScale.cs:
- * wrapper/MenuBar.cs:
- * wrapper/Expander.cs:
- * GeneratorContext.cs:
- * wrapper/Notebook.cs:
- * wrapper/ComboBox.cs:
- * wrapper/Container.cs:
- * RadioGroupManager.cs:
- * wrapper/VScrollbar.cs:
- * ProjectIconFactory.cs:
- * wrapper/HScrollbar.cs:
- * wrapper/ToolButton.cs:
- * wrapper/ActionTree.cs:
- * wrapper/ActionGroup.cs:
- * wrapper/ComboBoxEntry.cs:
- * wrapper/ActionToolbarWrapper.cs:
- * wrapper/RadioActionGroupManager.cs: Use global:: for type
- references in generated code.
-
- * Placeholder.cs:
- * editor/Flags.cs:
- * editor/Enumeration.cs:
- * editor/ActionMenuItem.cs:
- * editor/ActionToolItem.cs: Fix warnings.
-
-2009-12-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * libstetic.csproj: Flush.
-
-2009-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Table.cs: Fix table creation issue. Sync call has no
- effect while loading a widget.
-
-2009-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Widget.cs: Fix check for top level window.
-
-2009-11-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * wrapper/MenuBar.cs:
- * wrapper/ActionToolbarWrapper.cs: Propagate the menu name to
- the action tree. Fixes bug #540512.
-
-2009-11-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * ObjectReader.cs:
- * ObjectWrapper.cs:
- * ClassDescriptor.cs: Ensure the Loading flag is set when
- loading internal children of a widget.
-
-2009-11-05 Mike Kestner <mkestner@novell.com>
-
- * wrapper/*.cs: improper new keyword warning cleanup.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * libstetic.csproj: Reference mono-cairo package.
-
-2009-10-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Widget.cs: Don't fire the name changed event while
- loading.
-
- * wrapper/Container.cs: Set the loading flag when loading.
-
-2009-10-16 Mike Krüger <mkrueger@novell.com>
-
- * DND.cs:
- * WidgetUtils.cs:
- * CommandDescriptor.cs:
- * editor/Translatable.cs:
- * editor/ActionMenuItem.cs: Handled icon loading failures.
-
-2009-09-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Paned.cs: Avoid unnecessary Changed event.
-
-2009-09-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper\Paned.cs: Restore the paned position after
- realizing. It may have been reset during the realization.
- Fixes bug #542227.
-
-2009-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Widget.cs: Fire name change event when name changes.
- Fixes bug #540512 - NullReferenceException in stetic
- generated code.
-
-2009-09-10 Christian Hergert <chris@dronelabs.com>
-
- * libstetic/libstetic.dll.config: Use quartz on osx.
-
-2009-09-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Action.cs: For stock gtk and gnome icons, use the
- stock id as base name for the action identifier. Fixes bug
- #525571.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * libstetic.csproj: Updated dependencies. We now depend on
- gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Container.cs: Properly validate widget ids when
- pasting a child. If there is a conflict, the child has to be
- modified. Fixes bug #530086 - When copy/pasting widgets in
- stetic, the original is renamed.
-
-2009-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Notebook.cs: Fix issue with adding a widget with
- ShowScrollbars=true to a notebook. Fixes bug 526434 -
- Notebook Tab Labels Revert Back to "Page 1".
-
-2009-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/ComboBox.cs:
- * wrapper/ComboBoxEntry.cs: Changed the sensitivity mode to
- 'always on'. Since gtk+ 2.14, empty combos are disabled by
- default.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/objects.xml: Fix invalid xml.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/objects.xml: Fix some default values.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/objects.xml: Make sure the default value for
- HasSeparator is true.
-
-2009-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/objects.xml: Removed Version=2.6.0.0 specification
- from Pango.EllipsizeMode type. This allows other GTK
- versions to work. Patch by Daniel Newton.
-
-
-2009-07-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * ClassDescriptor.cs: When creating a widget instance,
- initialize the properties after creating the wrapper, since
- some properties may be implemented in the wrapper. This
- should fix bug #505083 - hbuttonbox1.cs file being created
- in gtk-gui causing problems with compilation.
-
-2009-05-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * Placeholder.cs:
- * libstetic.csproj: Improved the look of placeholders.
-
-2009-05-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * ItemDescriptor.cs: Added missing BindingFlags.Instance flag.
-
- * wrapper/Container.cs: Fix bug when showing the selection
- box.
-
- * TopLevelWindow.cs:
- * TopLevelDialog.cs:
- * wrapper/Dialog.cs:
- * wrapper/Window.cs:
- * wrapper/objects.xml: Top level windows are not represented
- using a Gtk.Window anymore at design time. Instead they are
- represented by TopLevelWindow. This is a regular widget, so
- window embedding hacks are not required anymore. The same
- has been done for Gtk.Dialog/TopLevelDialog.
-
- * libstetic.csproj: Added new files.
-
- * Makefile.am: Updated.
-
- * DND.cs: Accept copy as drop target. Fixed the target list.
-
- * TypedClassDescriptor.cs: Invocation of a constructor does
- not need an instance reference.
-
-2009-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Registry.cs: Make sure GetType can find the type when the
- provided assembly name does not have version info.
-
- * libstetic.csproj: Copy the config file to the output dir.
-
- * TypedPropertyDescriptor.cs: Catch ambiguous match exception
- when looking for properties.
-
-2009-04-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * libstetic.csproj: Don't require a specific gtk# version.
-
-2009-03-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * Registry.cs:
- * WidgetLibrary.cs: Flush cached data when closing a change
- set.
-
-2009-02-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/Table.cs:
- * wrapper/objects.xml: A better fix for the default row/column
- issue.
-
-2009-02-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * libstetic.csproj: Don't build with make, since MD can build
- these just fine.
-
-2009-02-07 Mike Krüger <mkrueger@novell.com>
-
- * GladeUtils.cs: fixed compiler warning.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * libstetic.mdp:
- * libstetic.csproj: Migrated to MSBuild file format.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * libstetic.mdp: Flush project format changes.
-
-2009-01-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * wrapper/objects.xml: Added some defaults.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * libstetic.mdp: All projects now require fx 3.5.
-
-2008-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * PropertyDescriptor.cs: Use invariant culture when converting types.
-
-2008-07-27 Mike Krüger <mkrueger@novell.com>
-
-
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.mdp, lib/libsteticui.mdp: Removed some unused glade
- and gnome-sharp references (only the unused). But I'll continue to
- remove glade, we need to lower the dependency tree a bit.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Added IViewContent
- switching logic (but should be done centrally using the secondaryview
- paradigmn).
-
-2008-02-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Workaround for mono bug
- #350432.
-
-2008-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs: Handle the delete
- key in TreeViewPad, so it will work event if the shortcut is not
- defined.
-
-2008-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp, Makefile.am,
- icons/pad-widget-tree-16.png: Added widget tree icon.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Update MD version.
-
-2008-01-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs,
- MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs,
- MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: Made internal
- some classes that don't need to be public.
-
-2008-01-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Notify file changes
- through the FileService.
-
-2008-01-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Stetic code must be
- generated in the GUI thread. Should fix bug #349505.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Feed default layout
- name to Gettext for translation.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/WidgetPartial.xft.xml, templates/Widget.xft.xml,
- templates/WindowPartial.xft.xml, templates/ActionGroupPartial.xft.xml,
- templates/Window.xft.xml, templates/ActionGroup.xft.xml,
- templates/DialogPartial.xft.xml, templates/Dialog.xft.xml: Make template
- categories translatable.
-
-2008-01-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Added null check on the
- result of UpdateFile. Should fix bug #352194.
-
-2008-01-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs,
- MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs,
- MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs,
- MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs: Handle
- projects which don't support the GTK# designer. Window and widget
- generation options are hidden, and code is never generated. Fixes bug
- #350632.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Don't update bindings if the
- file has syntax errors. May fix bug #347590.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Bump add-in versions.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Update after build reorg.
-
-2007-12-06 Geoff Norton <gnorton@novell.com>
-
- * Makefile.am: Only build the GtkCore addin if we have gnome-sharp
- available.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp, lib/libsteticui.mdp, lib/libstetic.mdp,
- Makefile.am: Directory reorganization.
-
-2007-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * gui.glade, MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs: Removed
- Gnome.FileEntry.
-
-2007-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs: Track
- LoggingService API changes.
-
-2007-11-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Use RootCombine
- instead of CurrentOpenCombine when possible.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Bump MD version.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Fix nullref. Happens
- when removing a project from a solution while one of the windows of that
- project is open.
-
-2007-10-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/ActionGroup.xft.xml, templates/ActionGroupPartial.xft.xml,
- templates/Dialog.xft.xml, templates/DialogPartial.xft.xml,
- templates/Widget.xft.xml, templates/WidgetPartial.xft.xml,
- templates/Window.xft.xml, templates/WindowPartial.xft.xml: Use tango
- file icons. Removed obsolete icons.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: Track api changes. Added
- Description property.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.mdp, lib/libstetic.mdp: Project file names updated by
- change in MD path functions.
-
-2007-10-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mds, Makefile.am: Added custom command for updating
- the Stetic sources.
-
-2007-10-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Set a more meaningful category name for
- addin commands.
- * MonoDevelop.GtkCore.mdp, MonoDevelop.GtkCore.mds: Updated.
-
-2007-10-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: If the current selection
- can't be deleted, just ignore the delete command, so the default handler
- will be executed. Fixes bug #325440.
-
-2007-10-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.mdp: Fix required gtk# version.
-
-2007-10-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Applied changes that
- were neccassary for to the new FileService.
-
-2007-10-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: Changed calls for
- the new StringParser.
-
-2007-10-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: In Bind(), don't subscribe the
- NameChanged event at every call.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: The designer needs to
- be explicitely destroyed.
-
-2007-10-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: No need to implement
- IComparable; it's done in the base class now.
-
-2007-09-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: Assign the selected
- target gtk# version to the new project.
-
-2007-09-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Use ProjectReference.StoredReference
- rather than ProjectReference.Reference, in order to refer to the actual
- stored reference string rather than a temporarily bumped version.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Bump MD version.
-
-2007-09-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Implemented an
- assembly resolver for the stetic app, so assembly widgets registered
- with .pc files can be found.
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs: If a widget dll belongs
- to a package, store it as a package reference in the toolbox index.
-
-2007-09-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Allow setting TargetGtkVersion to
- DefaultGtkVersion when current value is null.
-
-2007-09-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Don't touch GTK# assembly versions
- when a target version is not set. Don't use gtkVersion=null to represent
- default version.
- * MonoDevelop.GtkCore/GtkCoreService.cs: Set TargetGtkVersion on new
- projects. Bump default version to 2.8.
-
-2007-09-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.mdp, lib/libsteticui.mdp, lib/libstetic.mdp,
- lib/Makefile.am, MonoDevelop.GtkCore.mds, Makefile.am: Use projects for
- imported stetic libraries.
-
-2007-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Removed access to
- Component object.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Remove unused method.
-
-2007-09-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/SelectRenamedClassDialog.cs,
- MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs,
- MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs: Fix warnings.
-
-2007-09-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * lib/stetic, Makefile.am, lib/Makefile.am: Build stetic from
- svn:externals.
- * lib/libsteticui.dll.config, lib/libstetic.dll.config,
- lib/libstetic.dll, lib/libsteticui.dll: Removed.
-
-2007-09-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/WidgetPartial.xft.xml, templates/Widget.xft.xml,
- templates/WindowPartial.xft.xml, templates/Window.xft.xml,
- templates/ActionGroupPartial.xft.xml, templates/ActionGroup.xft.xml,
- templates/DialogPartial.xft.xml, templates/Dialog.xft.xml: Remove
- deprecated FileOptions element from templates.
-
-2007-09-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Changed the way to
- set the active designer (the api changed). Fixed some renaming issues.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs: Track api changes.
-
-2007-09-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/Window.xft.xml: Oops, PartialTypeSupport should be set to
- Disabled for non-partial window.
-
-2007-09-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.GtkCore.mdp, Makefile.am: Updated.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs: Use DotNetProject.UsePartialTypes
- instead of custom setting.
- * MonoDevelop.GtkCore/WidgetFileTemplatePartialClass.cs,
- MonoDevelop.GtkCore/WidgetFileTemplateFullClass.cs: No longer needed.
- * templates/WidgetPartial.xft.xml, templates/Widget.xft.xml,
- templates/WindowPartial.xft.xml, templates/Window.xft.xml,
- templates/ActionGroupPartial.xft.xml, templates/ActionGroup.xft.xml,
- templates/DialogPartial.xft.xml, templates/Dialog.xft.xml: Use
- PartialTypes condition instead of custom file template.
-
-2007-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- Includes fixes for bugs #82671, #82527, #82476, #81763 and #81238.
-
-2007-08-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/PropertiesWidget.cs: Changes due to new
- property infrastructure.
-
-2007-08-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs: By default use the project name
- as category name for new custom widgets.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Don't show the full
- name of widgets in the toolbar.
-
-2007-08-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: In FindClass, make
- sure the getUserClass parameter is taken into account when the found
- class is not a multi-part class. Fixes bug #82258.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Removed the CommandService class.
- Everything is done directly with CommandManager. Moved all extension
- node types to MD.Components.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml,
- MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore.mdp, Makefile.am: Reorganized the extension point
- hierarchy. Embedded all add-in manifests as resources.
- * lib/libstetic.dll: Updated from stetic module.
-
-2007-08-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Improved error
- reporting.
-
-2007-08-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Converted
- DispatchService to a static class.
-
-2007-08-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.dll: Updated.
-
-2007-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Fixed some
- problems with the target gtk version. It was not assigned to the
- stetic project. Also fixed some stock icon rendering issues in
- Stetic.
-
-2007-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- Includes a nullref fix.
-
-2007-07-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Layout switch
- delay is not needed anymore.
-
-2007-07-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: Fix nullref
- when gtk support is not enabled. Patch by Chris Howie.
-
-2007-07-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- Don't try to use the CurrentNode property after adding the file,
- since it may have changed. Should fix bug #82123.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
- Fixes bugs #81846 and #82144.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Fix window
- source file lookup.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Use the new methods
- for checking clipboard operations on the current selection.
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Include the
- current project in the list of libraries to show in the toolbox.
- Fixes bug #82125.
-
-2007-07-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated. Fixes bugs 81977,
- 81810 and 82052.
-
-2007-07-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Properly rename
- fields when the widget name is changed. Fixes bug #81976.
-
-2007-07-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs: Update the
- properties pad when the focus is on the widget tree pad. Fixes bug
- #81971.
-
-2007-07-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Added null
- check.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Track api changes
- in DesignerSupport. When adding a project reference to a widget
- library, take into account that widgets may be implemented in a
- library different from the one providing the widget list.
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: In
- GetDynamicItems, only return widgets provided by libraries
- referenced by the project. Don't return widgets from libstetic
- since those are already included by default in the toolbox.
- Implemented IToolboxDefaultProvider.
-
-2007-07-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Changed a bit
- because of the removal of custom collections in the Ide project.
-
-2007-06-30 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * gui.glade: Fixed capitalization.
-
-2007-06-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs: Don't show windows
- in the toolbox.
- * lib/libstetic.dll, lib/libsteticui.dll: Updated from Stetic module.
-
-2007-06-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
-
-2007-06-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * gui.glade, MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs,
- MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: Allow selecting
- the target GTK# version of the project.
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp, Makefile.am,
- MonoDevelop.GtkCore.GuiBuilder/ToolboxLoader.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Implemented a
- toolbox loader, which allows registering assemblies in the toolbox.
- When a widget from a toolbox is dropped to a window, MD will now
- add a reference to the required assembly.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
-
-2007-06-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll: One last update.
-
-2007-06-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
-
-2007-06-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Set the import
- file callback when editing project stock icons.
- * MonoDevelop.GtkCore/ProjectResourceProvider.cs: The GetResources
- method only returns resource files now.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
-
-2007-06-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs: Default pad
- placement is now specified in the xml file.
-
-2007-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: In GetBaseType, use
- Project.GetWidgetTypes to get all registered wiget types, including
- base widget types (which were not provided by GetComponentTypes).
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- Includes fix for bug #81785.
-
-2007-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: Don't include non-public
- members to the objects.xml file.
-
-2007-05-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Updated.
- * MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs: Fix feature message.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
- Includes fixes for bugs #81761, #81758 and #81762.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- (UpdateLibraries) Properly check for library changes.
-
-2007-05-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- Fixes bugs #80783 and #81683.
-
-2007-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp, Makefile.am: Added new dependency.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from svn. Fixes bug
- #81590.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: When selecting an
- image file in the widget designer, import the file into the
- project.
-
-2007-05-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Added some delay
- in the code that changes the workbench layout when selecting the
- designer. Fixes bug #80963.
-
-2007-05-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp, Makefile.am,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPalettePad.cs: Removed old
- palette pad.
- * MonoDevelop.GtkCore/GtkCoreService.cs: Set the 'internal' flag for
- widgets implemented by private classes.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from svn module.
- Fixes bugs #80875, #81261, #81365.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: If the project
- is a library, add itself as an internal widget library, so widgets
- with internal visibility will be shown.
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: When saving a window,
- use the visibility of the class to set the visibility of the
- component. Together with all changes done in stetic, fixes bug
- #80875.
-
-2007-05-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs,
- MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Track api changes in
- Stetic.
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: Delay
- library updating until really necessary.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Copy the .addins.xml file to the output dir.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Copy stetic dlls together with the assembly.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated.
-
-2007-05-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp, Makefile.am: Reference shared assemblies
- from the correct location.
-
-2007-05-04 Wade Berrier <wberrier@novell.com>
- * lib/libstetic.dll.config:
- * lib/libsteticui.dll.config:
- Fix os attribute formats (mono-config.c separates oses by comma,
- and ignores or includes the whole string.)
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp, Makefile.am:
- Migration to Mono.Addins.
-
-2007-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml, MonoDevelop.GtkCore.mdp,
- MonoDevelop.GtkCore.Dialogs/GtkFeatureWidget.cs, Makefile.am:
- Implemented project feature for enabling gtk# support in new
- projects.
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs: Use
- Menu icon size in the project pad.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
-
-2007-04-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs: Show a
- relative path in the window delete confirm dialog, since the
- absolute path may take too much space.
- * MonoDevelop.GtkCore.mdp: Updated.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * templates/DialogPartial.xft.xml, templates/Dialog.xft.xml: Add
- Ok/Cancel buttons by default in new dialogs.
-
-2007-03-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- Includes fixes for bugs 81033, 81086, 81239, 81143, 81014 and
- 81015.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Allow pasting when
- a placeholder is selected. Fixes bug #81246.
-
-2007-03-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml,
- MonoDevelop.GtkCore.NodeBuilders/StockIconsNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.mdp, Makefile.am, icons/image-x-generic.png:
- Show a "Stock Icons" node in the User Interface folder. It's easier
- to discover than the context menu option.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.Commands/GladeCommands.cs: Added menu option
- for opening the gtk# settings.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Don't crash if
- the gtk-gui folder doesn't exist. Fixes bug #81152.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Hide the border
- of the combined view notebook.
-
-2007-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.dll: Updated from stetic module. Fixes NRE crash.
-
-2007-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Fix null ref.
-
-2007-03-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Register a new toolbox loader. Removed
- old properties pads.
- * MonoDevelop.GtkCore.mdp, Makefile.am: Added reference to
- MonoDevelop.DesignerSupport.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from svn module.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs,
- MonoDevelop.GtkCore.GuiBuilder/PropertiesWidget.cs,
- MonoDevelop.GtkCore.GuiBuilder/ToolboxProvider.cs: Integrate Stetic
- widgets in the main toolbox.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: Implement
- ICustomPropertyPadProvider and return the Stetic property pad.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs: Renamed.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Fix warning.
-
-2007-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- Updated from Stetic module. Includes fix for bug #80864.
-
-2007-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from SVN. Fixes some
- memory leaks and bug #79453.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Explicitely
- destroy notebook children, since notebook doesnt do it because of a
- gtk bug.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Some fixes in the
- dispose code.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Use
- ProjectOperations.SaveProject to save projects.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Change add-in versions to 0.13.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Fix nullref.
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs: Log
- error message.
- * Makefile.am, MonoDevelop.GtkCore.mdp: Synchronized MD project and
- makefile.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Avoid throwing
- delayed events after the project has been disposed.
-
-2007-02-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Added missing
- null check.
-
-2007-02-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Ask for user
- confirmation when reloading a designer only when the designer has
- unsaved changes.
-
-2007-02-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs,
- MonoDevelop.GtkCore/GtkDesignInfo.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Detect external
- changes in the gui.stetic files, and reload it when it changes.
- Take into account that the load of gui.stetic can fail. Added
- several workarounds for this case.
-
-2007-02-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from SVN. Includes
- fixes for bugs #80722, #79427 and #80127.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Store some
- Stetic configuration in the MD properties.
-
-2007-02-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * gui.glade, MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Added options
- for enabling/disabling gtk support, and for gettext support.
- * MonoDevelop.GtkCore.addin.xml: Change options panel name.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Make sure the
- MD project is saved together with the stetic project, if necessary.
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: Avoid saving
- the MD project twice.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectNodeBuilder.cs: If gtk
- integration status changes for a project, refresh the tree.
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs: Null check.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Added support for gettext and
- gettext class options for generated code.
- * MonoDevelop.GtkCore/GtkCoreService.cs: Added events for notifying
- when the gtk integration status changes for a project.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * Makefile.am: distcheck fixes
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs,
- MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: When a designer
- project is disposed, hide the designer view in the editor.
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- Factorized some code into GtkDesignInfo.
-
-2007-02-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Make sure the code generation
- extension is executed before the last step.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- Hide the add window commands when the project is not DotNet
- * MonoDevelop.GtkCore.mdp, lib/libsteticui.dll, lib/libstetic.dll:
- Updated.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Intercept calls
- to the IPositionable interface, and show the editor page when
- jumping to a line.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: When looking for
- the window class, avoid returning the generated partial class.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Show the editor
- page when jumping to a signal handler.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Warn the user if
- the gtk-sharp-2 package can't be found. Some distros don't include
- the .pc file in the gtk# package, only in the -devel package.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from Stetic module.
-
-2007-01-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.dll.config, lib/libsteticui.dll, lib/libstetic.dll,
- lib/libsteticui.dll.config: Updated from Stetic module.
-
-2007-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs,
- MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Track api
- changes in Document class.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated form Stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Removed
- implementation of all text editor interfaces. Now the view
- overrides GetContent and calls editor.GetContent when a requested
- interface is not found.
-
-2007-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp: Updated.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Removed unused namespace.
- * MonoDevelop.GtkCore/GtkCoreService.cs: Use the new base-type property
- to describe custom widgets. When looking for properties and events,
- look in the base classes as well as in the widget class.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * Makefile.am,
- MonoDevelop.GtkCore.WidgetLibrary/ProjectClassDescriptor.cs,
- MonoDevelop.GtkCore.WidgetLibrary/ProjectSignalDescriptor.cs,
- MonoDevelop.GtkCore.WidgetLibrary/BaseWidgetLibrary.cs,
- MonoDevelop.GtkCore.WidgetLibrary/AssemblyReferenceWidgetLibrary.cs,
- MonoDevelop.GtkCore.WidgetLibrary/ProjectPropertyDescriptor.cs:
- Removed unused files. All widget library functionality has been
- moved to stetic.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Removed all
- widget library management, which has been moved to Stetic.
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Added some null checks.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Use the new way
- of managing dependencies in projects.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- templates/WindowPartial.xft.xml, templates/Window.xft.xml: The
- window constructor now takes the window type.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Some gui
- improvements and added some null checks.
-
-2007-01-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Don't crash if the
- designer can't be loaded for some reason.
-
-2007-01-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml,
- MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.GtkCore/GtkCoreService.cs,
- MonoDevelop.GtkCore/WidgetFileTemplatePartialClass.cs,
- MonoDevelop.GtkCore/WidgetFileTemplateFullClass.cs,
- MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs,
- MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs,
- templates/WidgetPartial.xft.xml, templates/Widget.xft.xml,
- templates/WindowPartial.xft.xml, templates/Window.xft.xml,
- templates/ActionGroupPartial.xft.xml,
- templates/ActionGroup.xft.xml, templates/DialogPartial.xft.xml,
- templates/Dialog.xft.xml: Implemented support for generating code
- in partial classes.
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs: Use the
- correct method for saving the project.
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs: Refresh the user
- interface folder when the gui project is reloaded.
- * MonoDevelop.GtkCore.mdp: Updated.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Added support for partial
- classes. In the GuiBuilderProject property, don't update the
- gtk-gui folder since this call may change the contents of the
- project, and weird things happen when called by the project pad to
- fill the tree.
- * lib/libsteticui.dll, lib/libstetic.dll: Updated from stetic module.
- * Makefile.am: Added new files.
- * MonoDevelop.GtkCore.WidgetLibrary/BaseWidgetLibrary.cs,
- MonoDevelop.GtkCore.WidgetLibrary/AssemblyReferenceWidgetLibrary.cs:
- Make it work even when the assembly it references has been deleted
- (maybe as a result of cleaning a project). In this case the widget
- library is shown as empty.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Added support
- for Loading/Unloading a project, to optimize use of memory for
- solutions with many gui projects. Implemented support for
- generating code in partial classes.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs,
- MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Implemented
- support for generating code in partial classes. Implemented support
- for UNDO/REDO.
- * MonoDevelop.GtkCore.GuiBuilder/GtkProjectServiceExtension.cs:
- Generation of gui code is now done from the Build method of a
- project service extension. Fixes some issues when building a
- project which contains custom components.
-
-2006-12-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: Track API changes in
- FileService.
-
-2006-12-13 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Don't
- generate stetic code if CurrentOpenCombine is null.
-
-2006-12-07 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.GtkCore.mdp: Updated to it can be
- built from MonoDevelop.
-
-2006-11-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Simplified the
- code by using global events from the Ide, instead of combine
- events.
-
-2006-10-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Added RemoveExportedWidget method.
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: track
- API changes.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: If the name of a
- widget changes and it is being exported, update it in the objects.xml
- file. Fixes bug #79656.
-
-2006-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from Stetic module. It provides a redesigned API
- which will allow running designers in a separate process.
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs:
- * MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs:
- * MonoDevelop.GtkCore.WidgetLibrary/AssemblyReferenceWidgetLibrary.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPalettePad.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs:
- Track api changes.
-
- * MonoDevelop.GtkCore.WidgetLibrary/BaseWidgetLibrary.cs: Make sure
- parse information is up to date before loading an assembly library.
- * MonoDevelop.GtkCore/ProjectResourceProvider.cs: Make sure this object
- is always alive when remoted.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Added null check.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs: Not needed anymore.
- * MonoDevelop.GtkCore.addin.xml: Removed build step. Code generation
- is done now before compiling.
-
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectWidgetLibrary.cs:
- * MonoDevelop.GtkCore.WidgetLibrary/CachedProjectWidgetLibrary.cs:
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: ProjectWidgetLibrary is not used
- anymore. All libraries are now handled by AssemblyReferenceWidgetLibrary.
-
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopWidgetActionBar.cs:
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopActionGroupToolbar.cs:
- Moved to Stetic.
-
- * Makefile.am:
- * MonoDevelop.GtkCore.mdp: Updated.
-
-2006-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Track api changes.
-
-2006-09-19 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * .: Added svn:ignore for MonoDevelop.GtkCore.pidb
-
-2006-09-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from stetic module. Includes fix for bug #79247.
-
-2006-09-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from stetic module.
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- Save the project after editing the icons.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Set the
- ResourceProvider for the main stetic project. Added null check.
-
-2006-08-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Fixed bug about
- adding the wrong widget as action designer page.
-
-2006-08-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: Only export properties which
- return primitive types. Fixes bug #79195.
- * lib/*: Updated from stetic module.
- * MonoDevelop.GtkCore.Dialogs/BindDesignDialog.cs: Unsubscribe close
- event when done.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Handle designer
- commands in its own tab page.
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: Explicitely dispose
- custom widgets to avoid memory leaks.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Track api changes.
-
- * MonoDevelop.GtkCore.mdp: Updated.
-
-2006-08-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * gui.glade: Minor fix.
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs: Track api
- changes.
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Stetic files don't need
- to be added as resource to projects.
- * MonoDevelop.GtkCore.Dialogs/ConfirmWindowDeleteDialog.cs: Make it
- work for action groups.
- * lib/*: several fixes.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Added method
- for removing an action group.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Track API changes
- in Stetic. Properly bound edit commands from the main menu.
-
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs:
- * MonoDevelop.GtkCore.addin.xml: Implemented Open and Delete
- commands for global action groups.
-
- * MonoDevelop.GtkCore.mdp: Updated.
-
-2006-08-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from Stetic module. Includes fixes for
- bugs #79043, #79044 and #79045
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Don't
- crash if something goes wrong when binding a class.
- Fixed nullref.
-
-2006-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- CreateContentForFile should not load the file, just create
- the view.
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Add
- support for IEncodedTextContent.
-
-2006-08-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- Set the resource provider before loading the project.
- Fixes bug #78966.
-
- * libs/*: Updated from Stetic module. Fixes several bugs:
- 78938, 78916, 78909, 78956, and 78867.
-
-2006-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectClassDescriptor.cs:
- Added null check.
-
- * MonoDevelop.GtkCore.WidgetLibrary/AssemblyReferenceWidgetLibrary.cs:
- Get the parser context using the assembly file name, not the full
- assembly name.
-
-2006-07-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkDesignInfo.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Factorized several
- more or less duplicate methods into GuiBuilderProject, specially
- methods for locating the class bound to a window. GuiBuilderProject
- now will explicitelly update the parser database the first time it
- needs to locate a class, so it will work even if the parser service
- is busy parsing assemblies.
-
-2006-07-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.dll: Updated from stetic module. Fixes a bug
- in the table wrapper which may cause an endless loop.
-
-2006-07-05 Matej Urbas <matej.urbas@gmail.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.WidgetLibrary/BaseWidgetLibrary.cs: Updated to use
- ReturnType as BaseTypes in IClass instances.
-
-2006-07-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from Stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Fixed automatic
- layout switch policy.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Fix showing of
- action group view.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs: Properly
- bind actions when pressing "BindToField".
-
- * MonoDevelop.GtkCore.addin.xml: Updated versions.
-
-2006-06-29 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.GtkCore.addin.xml: Only display WidgetBuilderOptionPanel
- for "DotNet" projects.
-
-2006-06-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from Stetic module.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Switch to the
- designer workbench layout when selecting an action group file.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: Support jumping
- to signal hanlder when double-clicking it in the signals editor.
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Removed debug code.
-
- * templates/ActionGroup.xft.xml:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- Fix code generation of action groups.
-
-2006-06-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: If a member has a [Browsable(false)]
- attribute, don't add it to the objects.xml file. Also don't add
- read-only properties.
- * lib/*: Updated from stetic module. Fixes bugs #78622 and #78620.
- Adds an icon for expander and fixes a bug in ColorButton (fix by ml)
-
-2006-06-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libsteticui.dll:
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopWidgetActionBar.cs:
- Track changes in the api.
-
-2006-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * libs/*: Updated from stetic module. Several improvements.
- Also fixes bug #78160.
-
-2006-05-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderDisplayBinding.cs:
- Added DisplayName property.
-
-2006-05-29 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: reverted interface changes - missing file change
-
-2006-05-29 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: reverted interface changes
-
-2006-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * libs/*: Updated from stetic module. Adds support for toolbars.
-
-2006-05-23 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: track api changes
-
-2006-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.Commands/GladeCommands.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- * MonoDevelop.GtkCore.addin.xml: Added commands for creating
- an action group and editing the project icons.
-
- * MonoDevelop.GtkCore.NodeBuilders/WidgetNodeBuilder.cs: Show local
- action groups as children of the window node.
-
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolder.cs:
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs: Moved
- some event subscriptions to WindowsFolder.cs
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs:
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs: Open the
- corresponding file when clicking on local action groups.
-
- * Makefile.am:
- * MonoDevelop.GtkCore.mdp: Added action group template.
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: Added support for
- action group file templates.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs: Notify changes in
- local action groups.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Don't show the actions
- tab until there is at least one action group.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs: Don't show
- properties or signals for global actions.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Added virtual method
- OnActiveDocumentChanged, which is called when the view is brought to front.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Use the new MemberName
- field when binding fields.
-
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopActionGroupToolbar.cs:
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: Several minor fixes.
-
- * lib/*: Updated.
-
-
-2006-05-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Initial support for the menu editor. Still very unstable!!
-
- * lib/*: Updated from Stetic module.
- * MonoDevelop.GtkCore.addin.xml: Register a node builder and and
- display binding for action groups.
- * MonoDevelop.GtkCore.NodeBuilders/WindowsFolderNodeBuilder.cs: Update
- the folder when action groups change.
- * MonoDevelop.GtkCore/GtkCoreService.cs: Fix nullref.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs: Factorized
- some code into CodeBinder.cs
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Factorized some
- code into CombinedDesignView.cs.
-
- * MonoDevelop.GtkCore.NodeBuilders/ActionGroupNodeBuilder.cs: New node
- builder for action groups.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupDisplayBinding.cs: New display
- binding for editing global action groups.
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopWidgetActionBar.cs: Moved from
- GuiBuilderView.cs.
- * MonoDevelop.GtkCore.GuiBuilder/MonoDevelopActionGroupToolbar.cs: A new
- toolbar for the action group designer.
- * MonoDevelop.GtkCore.GuiBuilder/ActionGroupView.cs: A view for editing
- global action groups.
- * MonoDevelop.GtkCore.GuiBuilder/CodeBinder.cs: Moved here some code
- from GuiBuilderEditSession.cs.
- * MonoDevelop.GtkCore.GuiBuilder/CombinedDesignView.cs: Moved here some
- code from GuiBuilderView.cs.
-
- * Makefile.am:
- * MonoDevelop.GtkCore.mdp: Added new files.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Track api changes.
-
-2006-05-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/libstetic.dll: Updated from Stetic module. Includes
- a fix for bug #78307.
-
-2006-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Updated versions.
- * MonoDevelop.GtkCore.mdp: Updated.
-
-2006-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated from Stetic module. Includes fixes for
- bugs #78266, #78240 and #78276.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderWindow.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs:
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Track changes
- in the Stetic API.
-
-2006-04-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProject.cs: Don't
- crash if a stetic project can't be loaded. Fixes bug #78169.
- * lib/libstetic.dll: Updated from Stetic module. Fixes bug #78167.
-
-2006-04-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * libs/*: Updated from stetic module. Fixed construction of
- scales and scrollbars.
-
-2006-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectClassDescriptor.cs: When
- creating a widget from a widget design, remove the signals since
- those signals reference handlers in the widget class, not the
- widget container class.
-
-2006-04-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * libs/*: Fix nullref in some themes.
-
-2006-04-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/WidgetFileDescriptionTemplate.cs: Fix typo.
- * libs/*: Fix for #78111, #78092 and #78090.
-
-2006-04-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/ProjectResourceProvider.cs: Save the project
- after adding or removing a resource.
-
-2006-04-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/*: Updated.
-
-2006-03-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Get open
- combine events in the GUI thread.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs: Properly
- delete signals for which there isn't a handler. Half fixed field
- renaming.
- * lib/*: Updated.
-
-2006-03-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore/MonoDevelop.GtkCore.addin.xml: Fix ID and
- description. Added stetic config files to add-in package.
-
-2006-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml: Updated references.
-
-2006-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- Don't crash if no parse info is available for the file
- being edited. Should fix #77885.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Don't show
- the bind to field button for the root container.
- * lib/*: Updated.
-
-2006-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Use an unified format. Patch by Matze Braun.
- * MonoDevelop.GtkCore.addin.xml: Updated add-in versions.
-
-2006-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.addin.xml:
- * MonoDevelop.GtkCore.mdp: Removed GladeFileDisplayBinding.
- * lib/*: Updated.
- * Makefile.am: Updated. Some files have been moved to Stetic.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderService.cs: Fixed
- layout switching. Don't show the widget tree pad by default,
- since it is already available as a combo in the designer.
- * MonoDevelop.GtkCore.GuiBuilder/GladeFileDisplayBinding.cs: Removed.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderPropertiesPad.cs: use
- the new property tree instead of the grid.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: The designer
- toolbar has been moved to Stetic.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderProjectPad.cs: Changed
- default placement.
-
-2006-03-19 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * .: Added Makefile.in and Makefile to svn:ignore.
-
-2006-03-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.GtkCore.mdp: Updated.
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderEditSession.cs:
- * MonoDevelop.GtkCore/GtkDesignInfo.cs: Added support for using
- resource images in the designer.
-
- * MonoDevelop.GtkCore/GtkCoreService.cs: Check if the objects.xml
- file exists before loading it.
- * MonoDevelop.GtkCore/GeneratorBuildStep.cs: Don't generate code
- if the stetic file has not been modified since the last
- generation.
- * MonoDevelop.GtkCore.Dialogs/WidgetBuilderOptionPanel.cs: If Gtk
- support is not enabled, don't enable it if no widgets have
- been selected.
- * lib/libstetic.dll: Updated.
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Mapped some
- commands.
- * templates/Window.xft.xml: The constructor of Gtk.Window requires
- the title of the window.
-
-2006-03-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.mdp, Makefile.am: Updated.
- * MonoDevelop.GtkCore/GeneratorBuildStep.cs: When generating
- code for a project that exports widgets, include the own
- project library to the generation, since there can be
- widgets that contain other widgets defined in the project.
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectClassDescriptor.cs:
- removed some IdeApp dependencies.
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectWidgetLibrary.cs:
- added method for getting the class information from
- a project.
- * CachedProjectWidgetLibrary.cs: New widget library class
- which takes class information from a collection of
- ProjectClassInfo objects.
- * MonoDevelop.GtkCore.WidgetLibrary/ProjectPropertyDescriptor.cs:
- Consider all properties runtime-properties, since they have
- been created from class properties.
- * lib/*: Updated.
-
-2006-03-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: removed debug files.
-
-2006-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.GtkCore.GuiBuilder/GuiBuilderView.cs: Propagate
- project changes to the editor.
-
-2006-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- Initial implementation of the Stetic add-in.
diff --git a/main/src/addins/MonoDevelop.GtkCore2/libstetic/Placeholder.cs b/main/src/addins/MonoDevelop.GtkCore2/libstetic/Placeholder.cs
index d5a6b69bec..1a55e0258e 100644
--- a/main/src/addins/MonoDevelop.GtkCore2/libstetic/Placeholder.cs
+++ b/main/src/addins/MonoDevelop.GtkCore2/libstetic/Placeholder.cs
@@ -103,6 +103,8 @@ namespace Stetic {
cr.RelLineTo (-rect.Width, 0);
cr.RelLineTo (0, -rect.Height);
cr.ClosePath ();
+
+ // FIXME: VV: Remove gradient features
Cairo.LinearGradient pat = new Cairo.LinearGradient (rect.X + rect.Width*fx, rect.Y + rect.Height*fy, rect.X + rect.Width*fw, rect.Y + rect.Height*fh);
pat.AddColorStop (0, c1);
pat.AddColorStop (1, c2);
diff --git a/main/src/addins/MonoDevelop.GtkCore2/libstetic/PropertyEditorCell.cs b/main/src/addins/MonoDevelop.GtkCore2/libstetic/PropertyEditorCell.cs
index faec75ffc3..1079054eb1 100644
--- a/main/src/addins/MonoDevelop.GtkCore2/libstetic/PropertyEditorCell.cs
+++ b/main/src/addins/MonoDevelop.GtkCore2/libstetic/PropertyEditorCell.cs
@@ -60,6 +60,7 @@ namespace Stetic
layout.Width = -1;
Pango.FontDescription des = container.Style.FontDescription.Copy();
+ des.Size = 10 * (int) Pango.Scale.PangoScale;
layout.FontDescription = des;
this.property = property;
diff --git a/main/src/addins/MonoDevelop.GtkCore2/libstetic/editor/ChangeLog b/main/src/addins/MonoDevelop.GtkCore2/libstetic/editor/ChangeLog
deleted file mode 100644
index 35c0dbd643..0000000000
--- a/main/src/addins/MonoDevelop.GtkCore2/libstetic/editor/ChangeLog
+++ /dev/null
@@ -1,16 +0,0 @@
-2010-08-07 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * SelectIconDialog.cs: Remove setting Project.Modified property
- * EditIconFactoryDialog.cs: Remove setting Project.Modified property
-
-2010-08-03 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * ActionMenu.cs: Pass root wrapper as an argument for ObjectWrapper.Create
- * ActionToolbar.cs:
- * ActionMenuBar.cs:
- * ActionGroupEditor.cs:
-
-2010-06-07 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * SelectImageDialog.cs:
-
diff --git a/main/src/addins/MonoDevelop.GtkCore2/libstetic/wrapper/ChangeLog b/main/src/addins/MonoDevelop.GtkCore2/libstetic/wrapper/ChangeLog
deleted file mode 100644
index b9ccf74b8f..0000000000
--- a/main/src/addins/MonoDevelop.GtkCore2/libstetic/wrapper/ChangeLog
+++ /dev/null
@@ -1,12 +0,0 @@
-2010-08-03 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Frame.cs: Pass root wrapper as an argument for ObjectWrapper.Create
- * Action.cs:
- * Window.cs:
- * Button.cs:
- * Widget.cs:
- * Expander.cs:
- * Container.cs:
- * ActionGroup.cs:
- * ScrolledWindow.cs:
-
diff --git a/main/src/addins/MonoDevelop.GtkCore2/libsteticui/ChangeLog b/main/src/addins/MonoDevelop.GtkCore2/libsteticui/ChangeLog
deleted file mode 100644
index 8d924e5e94..0000000000
--- a/main/src/addins/MonoDevelop.GtkCore2/libsteticui/ChangeLog
+++ /dev/null
@@ -1,431 +0,0 @@
-2010-10-28 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * ApplicationBackend.cs:
-
-2010-10-04 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Makefile.am:
- * libsteticui2.csproj:
- * ApplicationBackend.cs:
-
-2010-09-30 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * ApplicationBackend.cs:
-
-2010-09-30 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Makefile.am:
- * libsteticui2.csproj:
- * ApplicationBackend.cs:
-
-2010-09-22 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Project.cs: Add ReloadComponent method
- * ProjectBackend.cs:
-
-2010-09-21 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Project.cs: Code cleanup
- * ProjectBackend.cs:
-
-2010-09-20 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * ProjectBackend.cs:
-
-2010-09-17 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * libsteticui2.csproj:
-
-2010-09-17 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * libsteticui2.csproj:
-
-2010-09-15 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * libsteticui2.csproj:
-
-2010-09-08 Krzysztof Marecki <freefirma@gmail.com>
-
- * SignalsEditorBackend.cs:
-
-2010-08-17 Krzysztof Marecki <freefirma@gmail.com>
-
- * Application.cs:
- * ProjectBackend.cs:
-
-2010-08-16 Krzysztof Marecki <freefirma@gmail.com>
-
- * ProjectBackend.cs:
- * WidgetEditSession.cs:
- * IProjectDesignInfo.cs:
-
-2010-08-15 Krzysztof Marecki <freefirma@gmail.com>
-
- * CodeGenerator.cs:
- * ProjectBackend.cs:
- * WidgetEditSession.cs:
- * CodeGeneratorPartialClass.cs:
-
-2010-08-13 Krzysztof Marecki <freefirma@gmail.com>
-
- * Project.cs:
- * Makefile.am:
- * CodeGenerator.cs:
- * libsteticui2.csproj:
- * ActionGroupEditSession.cs:
- * CodeGeneratorPartialClass.cs:
- * CodeGeneratorInternalClass.cs: Remove class
-
-2010-08-09 Krzysztof Marecki <freefirma@gmail.com>
-
- * Project.cs: Add ComponentNeedsCodeGeneration method
- * ProjectBackend.cs:
- * IProjectDesignInfo.cs:
- * CodeGeneratorPartialClass.cs: Only generate code for components that
- have been changed
-
-2010-08-07 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Project.cs: Remove Modifies property
- * ProjectBackend.cs: Add modifiedTopLevel list, handled on project loading, saving.
- * libsteticui2.csproj:
- * WidgetEditSession.cs: Use ProjectBackend.WasModified to determine if it was modified
-
-2010-08-05 Krzysztof Marecki <freefirma@gmail.com>
-
- * WidgetDesigner.cs:
- * ProjectBackend.cs:
-
-2010-08-05 Krzysztof Marecki <marecki.krzysztof@gmail.com>
- Remove ModifiedChanged event,
- change Changed event to ProjectChangedEventHandler (pass name of changed widget)
- * Project.cs:
- * WidgetDesigner.cs:
- * ProjectBackend.cs:
- * WidgetEditSession.cs:
-
-2010-08-04 Krzysztof Marecki <freefirma@gmail.com>
-
- * Project.cs: Pass root widget name in NotifyChanged
- * Makefile.am:
- * ProjectBackend.cs:
- * libsteticui2.csproj:
-
-2010-08-03 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Glade.cs:
- * Makefile.am:
- * ProjectBackend.cs:
-
-2010-08-03 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Makefile.am:
- * ProjectBackend.cs: Return empty string when GtktargetVersion
- is not initialized
-
-2010-07-27 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Project.cs: Remove autoCommit argument
- * Makefile.am:
- * WidgetDesigner.cs: Remove temporary project
- * ProjectBackend.cs: Do not clear libraries on Close
- * WidgetEditSession.cs: Remove temporary project
-
-2010-07-27 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Project.cs:
- * WidgetDesigner.cs:
- * ProjectBackend.cs:
-
-2010-07-06 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Project.cs: Add parameter to Convert method for passing
- a new gtk gui folder name.
- * ProjectBackend.cs:
-
-2010-07-05 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Glade.cs:
- * Project.cs: AddComponent method
- * Makefile.am:
- * ProjectBackend.cs:
- * libsteticui2.csproj:
-
-2010-06-28 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Project.cs: Find class name for given .gtkx file
- * Makefile.am:
- * ProjectBackend.cs:
- * IProjectDesignInfo.cs:
-
-2010-06-28 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Makefile.am:
- * ProjectBackend.cs:
- * libsteticui2.csproj:
-
-2010-06-23 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Makefile.am:
- * libsteticui2.csproj:
-
-2010-06-23 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Makefile.am:
- * libsteticui2.csproj:
-
-2010-06-22 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Makefile.am:
-
-2010-06-16 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Makefile.am:
-
-2010-06-15 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Project.cs: Create backend for Convert
-
-2010-06-09 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Makefile.am:
- * libsteticui2.csproj:
-
-2010-06-07 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Project.cs: Transition from project file name to project folder.
- * Makefile.am:
- * Application.cs:
- * ProjectBackend.cs:
- * WidgetEditSession.cs:
-
-2010-06-07 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Project.cs:
- * Makefile.am:
- * ProjectBackend.cs:
- * IProjectDesignInfo.cs:
-
-2010-06-02 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * Makefile.am:
- * libsteticui2.csproj:
-
-2010-04-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * CecilSignalDescriptor.cs: Cecil uses '/' as separator for
- inner classes. Convert to the standard '+' separator.
-
-2010-01-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * CodeGenerator.cs:
- * libsteticui.csproj:
- * CodeGeneratorPartialClass.cs:
- * CodeGeneratorInternalClass.cs: Use global:: for type
- references in generated code.
-
-2010-01-15 Mike Krüger <mkrueger@novell.com>
-
- * libsteticui.csproj: upgraded to v3.5 framework.
-
-2009-12-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * WidgetDesignerBackend.cs: Disable checkerboard background
- because redraw is super-inefficient and makes resizing
- unbearably slow. It needs to do more selective invalidation
- in resizes (like GTK viewport), and take the exposed area
- into account in expose events.
-
-2009-11-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * WidgetDesignerBackend.cs: Don't try to realize the child if
- the widget is not anchored. Fixes bug #553475 -
- "Gtk-Critical: gtk_widget_realize: assertion" when running a
- gtk# app inside MD.
-
-2009-11-05 Mike Kestner <mkestner@novell.com>
-
- * Application.cs:
- * ApplicationBackend.cs:
- * CodeGenerator.cs: some warning cleanup.
-
-2009-10-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * libsteticui.csproj: Flush.
-
-2009-10-16 Mike Krüger <mkrueger@novell.com>
-
- * ActionComponent.cs: Handled icon loading failures.
-
-2009-10-08 Ankit Jain <jankit@novell.com>
-
- * libsteticui.csproj: Mark Mono.Cecil project referece
- as private.
-
-2009-09-10 Christian Hergert <chris@dronelabs.com>
-
- * libsteticui/libsteticui.dll.config: Use quartz on osx.
-
-2009-09-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * Metacity/Preview.cs: Use Assembly.LoadWithPartialName. It's
- obsolete, but at least it works.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * Metacity/Preview.cs:
- * WidgetDesignerBackend.cs: Worked on designer decoration.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * Grid.cs:
- * LibraryCache.cs:
- * Windows/Preview.cs:
- * WidgetActionBar.cs:
- * ApplicationBackend.cs: Fixed some warnings.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * libsteticui.csproj: Updated dependencies. We now depend on
- gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project.cs:
- * UndoQueue.cs:
- * WidgetDesigner.cs:
- * ProjectBackend.cs:
- * WidgetEditSession.cs: Added support for saving and restoring
- the status of the designer, including the undo queue. This
- allows implenting ISupportsProjectReload.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * Metacity/Preview.cs: Remove debug code.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * Windows/Preview.cs: Dont try to create a Win32 preview
- window when not running on Windows.
-
-2009-07-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * WidgetDesigner.cs:
- * ActionGroupDesigner.cs:
- * WidgetDesignerBackend.cs:
- * ActionGroupEditSession.cs: No more missing IntPtr
- constructor exceptions.
-
-2009-06-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * WidgetDesignerBackend.cs: Fix rendering of the window
- decoration.
-
-2009-06-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * WidgetDesigner.cs:
- * WidgetDesignerBackend.cs: Dispose is not guaranteed to be
- called when destroying a widget. Use OnDestroyed instead.
-
-2009-06-25 Mike Krüger <mkrueger@novell.com>
-
- * WidgetDesignerBackend.cs: Draw dialog background.
-
-2009-06-25 Mike Krüger <mkrueger@novell.com>
-
- * WidgetDesignerBackend.cs: Draw checkboard background in the
- gui designer instead of monochrome dialog background.
-
-2009-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * PluggableWidget.cs: When replacing the child widget (because
- of reloading of the project for example), make sure the old
- one is destroyed.
-
-2009-05-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * libsteticui.csproj: Updated.
-
- * Metacity/Theme.cs:
- * Metacity/FrameType.cs:
- * Metacity/FrameFlags.cs:
- * Metacity/ButtonLayout.cs:
- * Metacity/ObjectManager.cs:
- * Metacity/ButtonFunction.cs: Use a better namespace.
-
- * Metacity/Preview.cs: Use the new TopLevelWindow class. Track
- changes in the title of the window.
-
- * Windows:
- * Windows/Preview.cs:
- * Windows/WindowsTheme.cs:
- * WidgetDesignerBackend.cs: Added support for win32 window
- decorations.
-
- * EmbedWindow.cs:
- * UserInterface.cs: EmbedWindow is not required anymore.
-
-2009-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * libsteticui.csproj: Copy the config file to the output dir.
- Set project type to library.
-
- * Metacity/Preview.cs:
- * WidgetDesignerBackend.cs: Avoid exception in the
- MetacityPreview class constructor, since it crashes MD under
- ms.net.
-
-2009-04-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * libsteticui.csproj: Don't require a specific gtk# version.
-
-2009-03-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * LibraryCache.cs: Avoid recursive loading of
- AssemblyDefinition. Rely on cache info to check if a
- referenced library contains widget definitions.
-
- * AssemblyResolver.cs: Make sure the resolver returns full
- paths.
-
- * CecilWidgetLibrary.cs: Use the full path to query info from
- the cache. Properly unsubscribe the Changed event from the
- cache. Resolve assemblies using the provided assembly
- resolver.
-
- * ApplicationBackend.cs:
- * AssemblyWidgetLibrary.cs: From now on the registry and the
- library cache only handle libraries with full paths.
-
- * Project.cs: Make sure unused project backends are properly
- disposed.
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * libsteticui.csproj: Flush.
-
-2009-02-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * PropertyTree.cs:
- * WidgetDesignerBackend.cs: Dispose Gdk cursors, else
- finalisers destroy them outside of the GUI thread and often
- crash MD due to X asserts resulting in _XCBUnlockDisplay
- errors.
-
-2009-02-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * libsteticui.csproj: Don't build with make, since MD can
- build these just fine.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * libsteticui.csproj: Allow unsafe code, since Shadow.cs has
- unsafe code.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * libsteticui.mdp:
- * libsteticui.csproj: Migrated to MSBuild file format.
-
diff --git a/main/src/addins/MonoDevelop.GtkCore2/libsteticui/PropertyTree.cs b/main/src/addins/MonoDevelop.GtkCore2/libsteticui/PropertyTree.cs
index c846444392..231db4d780 100644
--- a/main/src/addins/MonoDevelop.GtkCore2/libsteticui/PropertyTree.cs
+++ b/main/src/addins/MonoDevelop.GtkCore2/libsteticui/PropertyTree.cs
@@ -224,6 +224,7 @@ namespace Stetic
layout = new Pango.Layout (this.PangoContext);
layout.Wrap = Pango.WrapMode.Char;
Pango.FontDescription des = this.Style.FontDescription.Copy();
+ des.Size = 10 * (int) Pango.Scale.PangoScale;
layout.FontDescription = des;
}
@@ -444,6 +445,7 @@ namespace Stetic
layout.Wrap = Pango.WrapMode.Char;
Pango.FontDescription des = tree.Style.FontDescription.Copy();
+ des.Size = 10 * (int) Pango.Scale.PangoScale;
layout.FontDescription = des;
}
diff --git a/main/src/addins/MonoDevelop.GtkCore2/templates/ChangeLog b/main/src/addins/MonoDevelop.GtkCore2/templates/ChangeLog
deleted file mode 100644
index 01d4fb5ad6..0000000000
--- a/main/src/addins/MonoDevelop.GtkCore2/templates/ChangeLog
+++ /dev/null
@@ -1,4 +0,0 @@
-2010-09-20 Krzysztof Marecki <marecki.krzysztof@gmail.com>
-
- * WidgetPartial.xft.xml:
-
diff --git a/main/src/addins/MonoDevelop.HexEditor/ChangeLog b/main/src/addins/MonoDevelop.HexEditor/ChangeLog
deleted file mode 100644
index 7a9fa37460..0000000000
--- a/main/src/addins/MonoDevelop.HexEditor/ChangeLog
+++ /dev/null
@@ -1,137 +0,0 @@
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.HexEditor.addin.xml: Bumped MD version.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.HexEditor.csproj: Remove import off mono.addins
- targets.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.HexEditor.csproj:
- * MonoDevelop.HexEditor.addin.xml:
- * MonoDevelop.HexEditor/DisplayBinding.cs:
- * MonoDevelop.HexEditor/HexEditorNodeExtension.cs: Merged
- MD.Projects into MD.Core, and MD.Projects.Gui, MD.Core.Gui
- and MD.Components into MD.Ide.
-
-2010-03-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.MHex.Data/PieceTable.cs: fixed cut&paste error.
-
-2010-03-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.MHex.Data/PieceTable.cs: Fixed bug in piece table.
-
-2010-03-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.HexEditor.csproj: Don't local-copy project refs,
- as it duplicates assemblies and breaks running on .NET.
-
-2010-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.HexEditor.addin.xml: disabled open with hex
- editor command (is already in 'Open with'...)
-
-2010-02-22 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.HexEditor.csproj:
- * MonoDevelop.HexEditor.addin.xml:
- * MonoDevelop.HexEditor/HexEditorNodeExtension.cs: Added open
- with hex editor command in the project pad.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs: Flush.
-
-2010-01-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.HexEditor.csproj: Don't use makefiles for
- building.
-
-2010-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.HexEditor.addin.xml:
- * MonoDevelop.HexEditor/DisplayBinding.cs: Mark hex editor as
- non-default so it doesn't try to take over all filetypes.
- Users will have to open it explicitly if they need it.
-
-2009-12-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.HexEditor.addin.xml: Added missing dependency.
-
-2009-12-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.HexEditor/MonoDevelopHexEditorStyle.cs: Fixed
- build.
-
-2009-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Use correct cairo lib.
-
-2009-11-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.HexEditor.csproj: Don't local copy. Don't
- require specific versions.
-
-2009-11-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.HexEditor/HexEditorView.cs: Implemented
- IZoomable.
-
-2009-11-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.HexEditor/HexEditorView.cs: Set dirty flag after
- change.
-
-2009-11-18 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui:
- * Mono.MHex:
- * Makefile.am:
- * Mono.MHex.Data:
- * AssemblyInfo.cs:
- * gtk-gui/gui.stetic:
- * Mono.MHex.Rendering:
- * gtk-gui/generated.cs:
- * MonoDevelop.HexEditor:
- * Mono.MHex/HexEditor.cs:
- * Mono.MHex.Data/Caret.cs:
- * Mono.MHex/MiscActions.cs:
- * Mono.MHex.Data/Buffer.cs:
- * Mono.MHex.Data/Segment.cs:
- * Mono.MHex.Data/ISegment.cs:
- * Mono.MHex/DeleteActions.cs:
- * Mono.MHex/ScrollActions.cs:
- * Mono.MHex.Data/EditMode.cs:
- * Mono.MHex.Data/Selection.cs:
- * Mono.MHex/SimpleEditMode.cs:
- * Mono.MHex/BookmarkActions.cs:
- * Mono.MHex.Data/PieceTable.cs:
- * MonoDevelop.HexEditor.csproj:
- * Mono.MHex.Rendering/Margin.cs:
- * Mono.MHex/CaretMoveActions.cs:
- * Mono.MHex/SelectionActions.cs:
- * Mono.MHex/HexEditorOptions.cs:
- * Mono.MHex.Data/RedBlackTree.cs:
- * Mono.MHex/IHexEditorOptions.cs:
- * Mono.MHex.Data/HexEditorData.cs:
- * MonoDevelop.HexEditor.addin.xml:
- * Mono.MHex.Data/UpdateRequest.cs:
- * Mono.MHex.Rendering/IconMargin.cs:
- * Mono.MHex.Data/ReplaceEventArgs.cs:
- * Mono.MHex.Rendering/GutterMargin.cs:
- * Mono.MHex.Rendering/HexEditorStyle.cs:
- * Mono.MHex.Rendering/HexEditorMargin.cs:
- * MonoDevelop.HexEditor/HexEditorView.cs:
- * Mono.MHex.Rendering/DashedLineMargin.cs:
- * MonoDevelop.HexEditor/DisplayBinding.cs:
- * Mono.MHex.Rendering/TextEditorMargin.cs:
- * Mono.MHex.Rendering/EmptySpaceMargin.cs:
- * MonoDevelop.HexEditor/MonoDevelopHexEditorStyle.cs: Added
- hex editor display binding.
-
diff --git a/main/src/addins/MonoDevelop.HexEditor/Mono.MHex.Data/Buffer.cs b/main/src/addins/MonoDevelop.HexEditor/Mono.MHex.Data/Buffer.cs
index 4b5e64b651..31f8c29d7a 100644
--- a/main/src/addins/MonoDevelop.HexEditor/Mono.MHex.Data/Buffer.cs
+++ b/main/src/addins/MonoDevelop.HexEditor/Mono.MHex.Data/Buffer.cs
@@ -26,6 +26,7 @@
using System;
using System.IO;
+using System.Threading.Tasks;
namespace Mono.MHex.Data
{
@@ -81,6 +82,16 @@ namespace Mono.MHex.Data
return new ArrayBuffer (buf);
}
+ public static async Task<IBuffer> LoadAsync (Stream stream)
+ {
+ int count = (int) stream.Length;
+ byte[] buf = new byte[count];
+
+ await stream.ReadAsync (buf, 0, count);
+
+ return new ArrayBuffer (buf);
+ }
+
public static IBuffer Load (string fileName)
{
using (Stream stream = File.OpenRead (fileName)) {
diff --git a/main/src/addins/MonoDevelop.HexEditor/Mono.MHex/HexEditor.cs b/main/src/addins/MonoDevelop.HexEditor/Mono.MHex/HexEditor.cs
index dc0950d48b..bdea66542d 100644
--- a/main/src/addins/MonoDevelop.HexEditor/Mono.MHex/HexEditor.cs
+++ b/main/src/addins/MonoDevelop.HexEditor/Mono.MHex/HexEditor.cs
@@ -161,6 +161,17 @@ namespace Mono.MHex
Options = HexEditorOptions.DefaultOptions;
Options.Changed += OptionsChanged;
}
+
+ protected override void Dispose (bool disposing)
+ {
+ Options.Changed -= OptionsChanged;
+ if (caretTimer != null) {
+ caretTimer.Elapsed -= UpdateCaret;
+ caretTimer.Dispose ();
+ caretTimer = null;
+ }
+ base.Dispose (disposing);
+ }
public void PurgeLayoutCaches ()
{
@@ -226,9 +237,7 @@ namespace Mono.MHex
void OptionsChanged (object sender, EventArgs e)
{
- gutterMargin.IsVisible = Options.ShowLineNumberMargin;
- iconMargin.IsVisible = iconMargin.IsVisible;
-
+ iconMargin.IsVisible = gutterMargin.IsVisible = Options.ShowLineNumberMargin;
Margins.ForEach (margin => {
margin.PurgeLayoutCache ();
diff --git a/main/src/addins/MonoDevelop.HexEditor/Mono.MHex/HexEditorDebugger.cs b/main/src/addins/MonoDevelop.HexEditor/Mono.MHex/HexEditorDebugger.cs
index fe8590e91e..9419238d43 100644
--- a/main/src/addins/MonoDevelop.HexEditor/Mono.MHex/HexEditorDebugger.cs
+++ b/main/src/addins/MonoDevelop.HexEditor/Mono.MHex/HexEditorDebugger.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System;
using Mono.MHex.Data;
+using MonoDevelop.HexEditor;
using Xwt;
namespace Mono.MHex
@@ -69,6 +70,7 @@ namespace Mono.MHex
public HexEditorDebugger ()
{
+ editor.HexEditorStyle = new MonoDevelopHexEditorStyle (editor);
var comboBox = new ComboBox ();
comboBox.Items.Add ("Hex 8");
comboBox.Items.Add ("Hex 16");
diff --git a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj
index 90f243d1ab..29cfbde299 100644
--- a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj
+++ b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor.csproj
@@ -93,11 +93,6 @@
<Folder Include="MonoDevelop.HexEditor\" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
- <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
- <Name>Mono.TextEditor</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
<Project>{7525BB88-6142-4A26-93B9-A30C6983390A}</Project>
<Name>MonoDevelop.Core</Name>
@@ -108,11 +103,6 @@
<Name>MonoDevelop.Ide</Name>
<Private>False</Private>
</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="..\MonoDevelop.Debugger\MonoDevelop.Debugger.csproj">
<Project>{2357AABD-08C7-4808-A495-8FF2D3CDFDB0}</Project>
<Name>MonoDevelop.Debugger</Name>
@@ -128,21 +118,6 @@
<Name>MonoDevelop.Refactoring</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\MonoDevelop.AssemblyBrowser\MonoDevelop.AssemblyBrowser.csproj">
- <Project>{0EA3AD14-404A-4D3F-979B-F087E2E70C82}</Project>
- <Name>MonoDevelop.AssemblyBrowser</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
- <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
- <Name>ICSharpCode.NRefactory</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\CSharpBinding\CSharpBinding.csproj">
- <Project>{07CC7654-27D6-421D-A64C-0FFA40456FA2}</Project>
- <Name>CSharpBinding</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\..\..\external\mono-addins\Mono.Addins\Mono.Addins.csproj">
<Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
<Name>Mono.Addins</Name>
diff --git a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/DisplayBinding.cs b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/DisplayBinding.cs
index 12a5f4c3d2..11c6c884fc 100644
--- a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/DisplayBinding.cs
+++ b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/DisplayBinding.cs
@@ -39,7 +39,7 @@ namespace MonoDevelop.HexEditor
}
}
- public IViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
+ public ViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
{
return new HexEditorView ();
diff --git a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorView.cs b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorView.cs
index b4f8bc4820..f23c5fc900 100644
--- a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorView.cs
+++ b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorView.cs
@@ -32,6 +32,8 @@ using Mono.MHex.Data;
using MonoDevelop.Ide.Gui.Content;
using Xwt;
using MonoDevelop.Ide.Fonts;
+using MonoDevelop.Ide.Editor;
+using System.Threading.Tasks;
namespace MonoDevelop.HexEditor
{
@@ -50,15 +52,25 @@ namespace MonoDevelop.HexEditor
{
hexEditor.HexEditorStyle = new MonoDevelopHexEditorStyle (hexEditor);
SetOptions ();
- MonoDevelop.SourceEditor.DefaultSourceEditorOptions.Instance.Changed += delegate {
- SetOptions ();
- };
+ DefaultSourceEditorOptions.Instance.Changed += Instance_Changed;
hexEditor.HexEditorData.Replaced += delegate {
this.IsDirty = true;
};
window = new ScrollView (hexEditor);
}
-
+
+ public override void Dispose ()
+ {
+ ((MonoDevelopHexEditorStyle)hexEditor.HexEditorStyle).Dispose ();
+ DefaultSourceEditorOptions.Instance.Changed -= Instance_Changed;
+ base.Dispose ();
+ }
+
+ void Instance_Changed (object sender, EventArgs e)
+ {
+ SetOptions ();
+ }
+
void SetOptions ()
{
var name = FontService.FilterFontName (FontService.GetUnderlyingFontName ("Editor"));
@@ -67,17 +79,19 @@ namespace MonoDevelop.HexEditor
hexEditor.Repaint ();
}
- public override void Save (string fileName)
+ public override Task Save (FileSaveInformation fileSaveInformation)
{
- File.WriteAllBytes (fileName, hexEditor.HexEditorData.Bytes);
- ContentName = fileName;
+ File.WriteAllBytes (fileSaveInformation.FileName, hexEditor.HexEditorData.Bytes);
+ ContentName = fileSaveInformation.FileName;
this.IsDirty = false;
+ return Task.FromResult (true);
}
- public override void Load (string fileName)
+ public override async Task Load (FileOpenInformation fileOpenInformation)
{
+ var fileName = fileOpenInformation.FileName;
using (Stream stream = File.OpenRead (fileName)) {
- hexEditor.HexEditorData.Buffer = ArrayBuffer.Load (stream);
+ hexEditor.HexEditorData.Buffer = await ArrayBuffer.LoadAsync (stream);
}
ContentName = fileName;
diff --git a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs
index e63dee04d6..7897809fdd 100644
--- a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs
+++ b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/HexEditorVisualizer.cs
@@ -33,6 +33,7 @@ using MonoDevelop.Debugger;
using MonoDevelop.Core;
using Mono.MHex.Data;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.HexEditor
{
@@ -82,7 +83,7 @@ namespace MonoDevelop.HexEditor
void SetHexEditorOptions ()
{
- hexEditor.Options.FontName = MonoDevelop.SourceEditor.DefaultSourceEditorOptions.Instance.FontName;
+ hexEditor.Options.FontName = DefaultSourceEditorOptions.Instance.FontName;
hexEditor.PurgeLayoutCaches ();
hexEditor.Repaint ();
}
diff --git a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/MonoDevelopHexEditorStyle.cs b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/MonoDevelopHexEditorStyle.cs
index 24d4bb1105..c77914e172 100644
--- a/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/MonoDevelopHexEditorStyle.cs
+++ b/main/src/addins/MonoDevelop.HexEditor/MonoDevelop.HexEditor/MonoDevelopHexEditorStyle.cs
@@ -25,17 +25,17 @@
// THE SOFTWARE.
using System;
-using Mono.TextEditor.Highlighting;
using Mono.MHex.Rendering;
using Xwt;
using MonoDevelop.Core;
using MonoDevelop.Ide;
-using Mono.TextEditor;
using Xwt.Drawing;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Highlighting;
namespace MonoDevelop.HexEditor
{
- class MonoDevelopHexEditorStyle : HexEditorStyle
+ class MonoDevelopHexEditorStyle : HexEditorStyle, IDisposable
{
ColorScheme colorStyle;
Mono.MHex.HexEditor hexEditor;
@@ -44,12 +44,15 @@ namespace MonoDevelop.HexEditor
{
this.hexEditor = hexEditor;
SetStyle ();
- IdeApp.Preferences.ColorSchemeChanged += delegate {
- SetStyle ();
- this.hexEditor.Options.RaiseChanged ();
- this.hexEditor.PurgeLayoutCaches ();
- this.hexEditor.Repaint ();
- };
+ IdeApp.Preferences.ColorScheme.Changed += ColorSchemeChanged;
+ }
+
+ void ColorSchemeChanged (object sender, EventArgs e)
+ {
+ SetStyle ();
+ this.hexEditor.Options.RaiseChanged ();
+ this.hexEditor.PurgeLayoutCaches ();
+ this.hexEditor.Repaint ();
}
void SetStyle ()
@@ -62,6 +65,11 @@ namespace MonoDevelop.HexEditor
return new Color (foreground.R, foreground.G, foreground.B, foreground.A);
}
+ public void Dispose ()
+ {
+ IdeApp.Preferences.ColorScheme.Changed -= ColorSchemeChanged;
+ }
+
public override Color HexOffset {
get {
return ConvertColor (colorStyle.LineNumbers.Foreground);
diff --git a/main/src/addins/MonoDevelop.Moonlight/ChangeLog b/main/src/addins/MonoDevelop.Moonlight/ChangeLog
deleted file mode 100644
index 8f00715899..0000000000
--- a/main/src/addins/MonoDevelop.Moonlight/ChangeLog
+++ /dev/null
@@ -1,828 +0,0 @@
-2010-07-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight.addin.xml:
- * MonoDevelop.Moonlight/MoonlightParser.cs: Track
- ProjectDomService/Parser API.
-
-2010-07-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightFrameworkBackend.cs:
- Workaround for gmcs bug.
-
-2010-07-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Include
- redist assemblies in manifest AssemblyParts. Should fix Bug
- 600727 - Moonlight: DataGrid missing.
-
-2010-07-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightFrameworkBackend.cs: reverted
- change (the bug is gone).
-
-2010-07-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightFrameworkBackend.cs: added
- null check.
-
-2010-06-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Track api
- changes.
-
-2010-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic: Flush.
-
-2010-05-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightProject.cs: Remove
- SupportedClrVersions, as it's been superseded by
- SupportsFramework.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightEditorExtension.cs: Make use
- of the new Document.Dom property.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Moonlight.addin.xml: Bumped MD version.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Moonlight.csproj: Remove import off mono.addins
- targets.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Moonlight.csproj:
- * MonoDevelop.Moonlight.addin.xml:
- * MonoDevelop.Moonlight/MoonlightEditorExtension.cs:
- * MonoDevelop.Moonlight.Gui/MoonlightOptionsPanel.cs:
- * MonoDevelop.Moonlight/MoonlightExecutionHandler.cs: Merged
- MD.Projects into MD.Core, and MD.Projects.Gui, MD.Core.Gui
- and MD.Components into MD.Ide.
-
-2010-03-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Track
- ProjectFile Link API.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Moonlight.csproj:
- * Templates/framework_SL_2_0.xml:
- * Templates/framework_SL_3_0.xml:
- * MonoDevelop.Moonlight.addin.xml:
- * MonoDevelop.Moonlight/framework_SL_2_0.xml:
- * MonoDevelop.Moonlight/framework_SL_3_0.xml: Moved framework
- declarations from resources to standalone files, so they can
- be loaded without loading the assembly.
-
-2010-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Moonlight.addin.xml: Added some conditions to
- avoid early loading of extensions.
-
- * MonoDevelop.Moonlight/MoonlightEditorExtension.cs: Track api
- changes.
-
-2010-02-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightFrameworkBackend.cs: Make
- sure not to ever use smcs.exe directly. It needs magic
- runtime args and maybe a different Mono - and we need the
- smcs script to handle that.
-
-2010-02-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightParser.cs: Use
- DomRegion.Empty.
-
-2010-02-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightFrameworkBackend.cs: Redist
- assemblies are neither GAC nor Core. Fixes refs to redist
- assemblies.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.Moonlight.Gui.MoonlightOptionsPanelWidget.cs:
- Flush.
-
-2010-01-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Quote
- respack arguments.
-
-2010-01-19 Rolf Bjarne Kvinge <RKvinge@novell.com>
-
- * MonoDevelop.Moonlight/XamlG.cs: A file without a x:Class attribute
- generates a zero-length code-behind file.
-
-2010-01-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Use
- FilePath to clean up code, and set resource IDs for respack.
-
-2010-01-13 Chris Toshok <toshok@ximian.com>
-
- * MonoDevelop.Moonlight/XamlG.cs: when generating fields for fully
- qualified types, use global references to keep from conflicting
- type/namespace names.
-
-2009-12-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightProject.cs: Fix preventing
- showing a console for moonlight run. If we do create a
- console, dispose it. We need a real way to avoid showing
- consoles for execution handlers that don't use them.
-
-2009-12-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightFrameworkBackend.cs: Check
- MOONLIGHT_SDK_PATH from env as well as the target runtime,
- since Moonlight needn't be bound strictly to a single target
- runtime.
-
-2009-12-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: If the
- framework package is not found, fall back to default version
- string.
-
-2009-12-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Fix logic
- error.
-
-2009-12-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs:
- * MonoDevelop.Moonlight/MoonlightFrameworkBackend.cs: Fix
- fxversion lookup for manifest.
-
-2009-12-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Moonlight.csproj:
- * MonoDevelop.Moonlight/MoonlightFrameworkBackend.cs:
- * MonoDevelop.Moonlight/SilverlightFrameworkBackend.cs:
- Renamed file. Remove MONO_PATH in the tools env vars if the
- base runtime sets it.
-
-2009-12-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/SilverlightFrameworkBackend.cs: Fix
- enumertion properly.
-
-2009-12-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/SilverlightFrameworkBackend.cs: Fix
- redist package enumeration.
-
- * MonoDevelop.Moonlight/MoonlightProject.cs: Try 3.0 first,
- fall back to 2.0.
-
-2009-12-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Moonlight.csproj:
- * MonoDevelop.Moonlight.addin.xml:
- * MonoDevelop.Moonlight/MoonlightProject.cs:
- * MonoDevelop.Moonlight/framework_SL_2_0.xml:
- * MonoDevelop.Moonlight/framework_SL_3_0.xml:
- * MonoDevelop.Moonlight/framework_Silverlight.xml:
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs:
- * MonoDevelop.Moonlight/SilverlightFrameworkBackend.cs: Track
- the new moonlight dev bits layout. Add preliminary support
- for multi-targetting SL2 and SL3.
-
-2009-12-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightExecutionHandler.cs: Track
- BrowserLauncher API.
-
-2009-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightProject.cs:
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Introduced
- the ConfigurationSelector class to all methods that
- previously took a configuration name as string. This
- eliminates the ambiguity between solution configuration
- names and project configuration names.
-
-2009-11-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightProject.cs: Track API. Set
- UserAssemblyPaths. Get correct configuration.
-
- * MonoDevelop.Moonlight/MoonlightExecutionCommand.cs: Add
- property for list of user assemblies.
-
-2009-11-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightProject.cs:
- * MonoDevelop.Moonlight/MoonlightExecutionCommand.cs: Fix
- build.
-
-2009-11-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Hack to
- copy mdb files into the xap so that sdb works.
-
- * MonoDevelop.Moonlight/MoonlightProject.cs: Create a debug
- console except if we're using the "run" mode.
-
-2009-11-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightProject.cs: Fix creation of
- Moonlight project configurations.
-
-2009-10-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Moonlight.csproj:
- * MonoDevelop.Moonlight.addin.xml:
- * MonoDevelop.Moonlight/MoonlightProject.cs:
- * MonoDevelop.Moonlight/MoonlightExecutionCommand.cs:
- * MonoDevelop.Moonlight/MoonlightExecutionHandler.cs:
- * MonoDevelop.Moonlight/MoonlightProjectConfiguration.cs: Use
- an execution handler so that the debugger command doesn't
- get enabled.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Moonlight.addin.xml: Bump MD version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * MonoDevelop.Moonlight.csproj:
- * gtk-gui/MonoDevelop.Moonlight.Gui.MoonlightOptionsPanelWidget.cs:
- Flush.
-
-2009-10-08 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Moonlight.csproj: Import md.targets .
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Moonlight.addin.xml: Bump MD version.
-
-2009-10-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightEditorExtension.cs: Tweak API
- so classes can return completion lists instead of modifying
- one they're given.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Moonlight.csproj: Updated dependencies. We now
- depend on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight.csproj: Don't local-copy project refs.
-
-2009-08-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight.csproj: Fix build.
-
-2009-08-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Moonlight/SilverlightFrameworkBackend.cs: Track
- api changes.
-
-2009-07-31 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Don't
- double-resolve configurations.
-
-2009-07-31 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightProject.cs: Limit compatible
- fx to prevent conflict with iPhone.
-
-2009-06-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Remove
- MergeResults members and replace with calls to
- result.Append. Tidy up a little.
-
- * MonoDevelop.Moonlight/SilverlightFrameworkBackend.cs: Fix
- building ML apps with separate SDK by allowing tool
- fallbacks to the base 3.5 framework.
-
-2009-06-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Moonlight.Gui.MoonlightOptionsPanelWidget.cs:
- Get design and code back in sync.
-
-2009-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight.addin.xml: Fix typo in framework ID.
-
-2009-06-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Moonlight.csproj:
- * MonoDevelop.Moonlight.addin.xml:
- * MonoDevelop.Moonlight/framework_Silverlight.xml:
- * MonoDevelop.Moonlight/SilverlightFrameworkBackend.cs: Define
- and register the Silverlight framework.
-
-2009-05-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Moonlight\MoonlightBuildExtension.cs: Track api
- changes.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Moonlight\MoonlightBuildExtension.cs: Use the
- new FilePath class for handling file and directory paths.
-
-2009-05-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightParser.cs: Fix logic.
-
-2009-05-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight.Gui/MoonlightOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Moonlight.Gui.MoonlightOptionsPanelWidget.cs:
- Improve the moonlight options panel. Add support for setting
- entry point.
-
-2009-05-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightParser.cs: Implement
- resolving types' namespaces.
-
-2009-05-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightProject.cs: Use project name
- for app entry point, since default namespace isn't
- initalised during project creation.
-
-2009-05-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Handle
- respack.exe if the runtime gives us that.
-
-2009-05-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Fix
- dependency checks for respacked files.
-
-2009-05-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Write
- assembly error message to monitor's log.
-
-2009-05-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Assembly
- reference validation messages are empty, not null.
-
-2009-05-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Fix
- previous namespace fix.
-
-2009-05-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Fix
- deployment namespace handling.
-
-2009-05-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: More
- status messages. Some handling of cancelling build.
-
- * Templates/Moonlight-ApplicationProject.xpt.xml: Fix
- template.
-
-2009-05-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightProject.cs: Set entry point
- and enable manifest generation on new projects.
-
-2009-05-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightProject.cs: Fix
- OnGetCanExecute.
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Embed Page
- and ApplicationDefinition files. Fix resource ID for
- resources file. Clean test page and manifest. Fix paths and
- namespaces in app definition generation. Write out app
- manifest.
-
-2009-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Track api
- changes.
-
-2009-05-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightProject.cs: Fix path
- serialization. Add StartPageUrl property. Update DoExecute
- and implement CanExecute.
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Fixed
- failed build tracking. Implement manifest generation.
- Implement test page creation. Add manifest and referenced
- assemblies to XAP.
-
-2009-05-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Moonlight.csproj:
- * Templates/PreviewTemplate.html: Add HTML template for
- previewing.
-
-2009-05-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/XamlG.cs:
- * MonoDevelop.Moonlight/MoonlightParser.cs: Add
- System.Windows.Controls.Primitives to the generated imports.
-
-2009-05-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Remove xap
- file in clean step.
-
-2009-05-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Implement
- support for checking when we need to rebuild.
-
-2009-05-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Fix dll
- filenames.
-
-2009-05-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Fix
- zipping.
-
-2009-05-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Moonlight.csproj: Add xapification code.
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Add
- initial xapification support.
-
-2009-05-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs:
- Fix respack execution.
-
-2009-05-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Implement
- respack invocation. Fix updating of xaml.g.cs files.
-
-2009-05-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Moonlight.csproj:
- * MonoDevelop.Moonlight/XamlG.cs:
- * MonoDevelop.Moonlight.addin.xml:
- * MonoDevelop.Moonlight/MoonlightBuildExtension.cs: Add a
- build step that generates and injects the xaml.g.cs files.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.Moonlight.csproj: don't require specific
- gtk-sharp version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Moonlight.addin.xml: Bump MD version.
-
-2009-03-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightParser.cs: Track API changes.
-
-2009-03-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Fix Silverlight.js install directory.
-
-2009-03-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightProject.cs: Fix framework ID.
-
-2009-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight.csproj: Exorcise more unwanted local
- copy.
-
-2009-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Moonlight.addin.xml: Move js file location to a
- subdirectory to match the location MSBuild and MD copy it.
-
- * MonoDevelop.Moonlight.csproj: Flush.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight.csproj: Don't local-copy other addins'
- dlls.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Moonlight.csproj: More explicit references to
- keep csc happy.
-
-2009-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Moonlight/XamlG.cs:
- * MonoDevelop.Moonlight/MoonlightEditorExtension.cs: Fixed
- compiler warnings.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Moonlight.mdp:
- * MonoDevelop.Moonlight.csproj: Migrated to MSBuild file
- format.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Moonlight.addin.xml: Bump MD version.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- *
- gtk-gui/MonoDevelop.Moonlight.Gui.MoonlightOptionsPanelWidget.cs:
- Flush.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight.mdp: Flush project format changes.
-
-2009-01-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight.addin.xml: Make sure Moonlight parser takes
- precedence over XML parser.
-
-2008-12-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightEditorExtension.cs: Moved
- outline-building code to be the default implementation in
- BaseXmlEditorExtension, since it works with any XmlParsedDocument.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Moonlight.mdp: All projects now require fx 3.5.
-
-2008-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightProject.cs:
- * MonoDevelop.Moonlight/MoonlightEditorExtension.cs: Track API changes.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Make it work for parallel build.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * AssemblyInfo.cs:
- * MonoDevelop.Moonlight.mdp: Add AssemblyInfo.cs files that are
- autogenerated from the addin manifests.
-
-2008-11-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Moonlight.mdp: Updated.
-
- * MonoDevelop.Moonlight/MoonlightParser.cs:
- * MonoDevelop.Moonlight/MoonlightParsedDocument.cs:
- * MonoDevelop.Moonlight/MoonlightEditorExtension.cs: Moved
- MoonlightParsedDocument to XmlParsedDocument in the Xml addin.
-
-2008-11-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightParsedDocument.cs: Fix build
- dependencies.
-
-2008-11-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightProject.cs: Use new API; move default
- build action code into GetDefaultBuildAction override.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Moonlight.addin.xml: Bump MD version.
-
-2008-11-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightProject.cs: Override new
- IsLibraryBasedProjectType property, consolidating code in base class.
-
-2008-11-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Moonlight.mdp: Updated.
-
- * MonoDevelop.Moonlight/MoonlightEditorExtension.cs: Added some very
- simple XAML completions.
-
-2008-10-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Moonlight.addin.xml: fixed 'Bug 399737 - Code completion
- busted for referenced assemblies that are not in GAC, are outside of
- the solution, and which are referenced by other non-GAC outside
- referenced assemblies'.
-
-2008-10-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * MonoDevelop.Moonlight.mdp:
- * MonoDevelop.Moonlight.Gui:
- * MonoDevelop.Moonlight.addin.xml:
- * MonoDevelop.Moonlight.Gui/MoonlightOptionsPanel.cs:
- * MonoDevelop.Moonlight.Gui/MoonlightOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Moonlight.Gui.MoonlightOptionsPanelWidget.cs: Add
- options panel for Moonlight settings.
-
-2008-10-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightEditorExtension.cs: Implement document
- outline.
-
-2008-10-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightParsedDocument.cs: Enable folding.
-
- * Makefile.am:
- * MonoDevelop.Moonlight.mdp: Updated.
-
- * MonoDevelop.Moonlight/MoonlightParser.cs: Use StateEngine XML parser.
- Gives better position information and more robust errors.
-
-2008-10-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightParser.cs: Fix return type of
- InitialiseComponent.
-
-2008-10-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Templates/Moonlight-UserControlXaml.xft.xml:
- * Templates/Moonlight-ApplicationProject.xpt.xml: Fix end tag in user
- control.
-
- * MonoDevelop.Moonlight/MoonlightEditorExtension.cs: Add stub editor
- extension. Enables path bar.
-
- * MonoDevelop.Moonlight/XamlG.cs: Import xamlg from moonlight.
-
- * Makefile.am:
- * MonoDevelop.Moonlight.mdp:
- * MonoDevelop.Moonlight.addin.xml: Updated.
-
- * MonoDevelop.Moonlight/MoonlightParser.cs: Add live parser based on
- xamlg to inject member info on the fly.
-
-2008-10-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightProject.cs: Set generator and content
- type on added xaml files. Auto-add codebehind.
-
- * Makefile.am:
- * MonoDevelop.Moonlight.mdp: Updated.
-
- * MonoDevelop.Moonlight.addin.xml:
- * Templates/Moonlight-Xaml.xft.xml:
- * Templates/Moonlight-Library.xpt.xml:
- * Templates/Moonlight-Application.xpt.xml:
- * Templates/Moonlight-LibraryProject.xpt.xml:
- * Templates/Moonlight-UserControlXaml.xft.xml:
- * Templates/Moonlight-ApplicationXaml.xft.xml:
- * Templates/Moonlight-XamlWithCodeBehind.xft.xml:
- * Templates/Moonlight-ApplicationProject.xpt.xml: Updated templates.
-
-2008-10-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * Templates/MoonlightProject.xpt.xml:
- * Templates/Moonlight-TestPage.xft.xml:
- * Templates/MoonlightProject-Empty.xpt.xml:
- * Templates/Moonlight-CreateSilverlightJs.xft.xml: Remove outdated
- templates.
-
- * Makefile.am:
- * MonoDevelop.Moonlight.mdp:
- * MonoDevelop.Moonlight.addin.xml: Updated.
-
- * Templates/Silverlight.js: Add.
-
- * Templates/Moonlight-Library.xpt.xml:
- * Templates/Moonlight-Application.xpt.xml:
- * MonoDevelop.Moonlight/MoonlightProject.cs: Create VS-compatible
- Moonlight/Silverlight projects. Limit it to C# for now.
-
-2008-10-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight.addin.xml:
- * MonoDevelop.Moonlight/MoonlightProject.cs: Enable loading of SL 2.0
- projects. Currently only works with C#.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Moonlight.mdp, gtk-gui/generated.cs: Updated generated
- code.
-
-2008-06-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * Templates/MoonlightProject.xpt.xml: Use escaped project name for
- identifier of main class.
-
-2008-06-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight.mdp,
- MonoDevelop.Moonlight/MoonlightCodebehindProvider.cs, Makefile.am:
- Remove old CodeBehind grouping mechanism.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Moonlight.addin.xml: Bump MD version.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightProject.cs: New project model changes.
-
-2008-05-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight.addin.xml: Set "isText" attribute on the
- mimetype definitions.
-
-2008-05-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight.addin.xml,
- MonoDevelop.Moonlight/MoonlightCodebehindProvider.cs: Remove use of
- removed extension point.
-
-2008-04-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Moonlight.addin.xml: Use the new mime type extension to
- register new file types.
-
-2008-03-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightProject.cs: Allow more paths for startup
- page. Should really make this an option at some point.
-
-2008-03-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightProject.cs,
- Templates/Moonlight-XamlWithCodeBehind.xft.xml: Change "bin" to
- "ClientBin", which seems to be more conventional.
-
-2008-03-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight/MoonlightProject.cs: Avoid NRE because BaseDirectory
- isn't set during project creation.
-
-2008-03-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Moonlight.mdp: Fix build paths and disable local copy of
- project refs.
- * MonoDevelop.Moonlight/MoonlightCodebehindProvider.cs: Make regex actually
- work.
- * MonoDevelop.Moonlight/MoonlightProject.cs: Set default properties and
- paths needed for new Moonlight projects to work.
- * Templates/Moonlight-XamlWithCodeBehind.xft.xml: Use text file template
- rather than ASP.NET file template. Add some default XAML. Reference the
- actual codebehind dll and class.
- * Templates/Moonlight-CreateSilverlightJs.xft.xml: Use text file template
- rather than ASP.NET file template.
- * Templates/Moonlight-Xaml.xft.xml: Use text file template rather than
- ASP.NET file template. Add some default XAML.
-
-2008-03-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * *.*: Initial commit of unfinished Moonlight addin.
-
diff --git a/main/src/addins/MonoDevelop.PackageManagement/AddinInfo.cs b/main/src/addins/MonoDevelop.PackageManagement/AddinInfo.cs
index 4e583304c7..6b768fe71c 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/AddinInfo.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/AddinInfo.cs
@@ -9,8 +9,9 @@ using Mono.Addins.Description;
Category = "IDE extensions")]
[assembly:AddinName ("NuGet Package Management")]
-[assembly:AddinDescription ("Provides support for adding and maintaining NuGet packages in your project. Uses NuGet 2.8.1")]
+[assembly:AddinDescription ("Provides support for adding and maintaining NuGet packages in your project. Uses NuGet 2.8.7")]
[assembly:AddinDependency ("Core", MonoDevelop.BuildInfo.Version)]
[assembly:AddinDependency ("Ide", MonoDevelop.BuildInfo.Version)]
[assembly:AddinDependency ("DesignerSupport", MonoDevelop.BuildInfo.Version)]
+[assembly:AddinDependency ("Refactoring", MonoDevelop.BuildInfo.Version)]
diff --git a/main/src/addins/MonoDevelop.PackageManagement/AssemblyInfo.cs b/main/src/addins/MonoDevelop.PackageManagement/AssemblyInfo.cs
index c6a9914c74..57b9b48471 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/AssemblyInfo.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/AssemblyInfo.cs
@@ -1,8 +1,15 @@

using System.Reflection;
+using System.Runtime.CompilerServices;
[assembly: AssemblyProduct ("MonoDevelop")]
[assembly: AssemblyTitle("MonoDevelop.PackageManagement")]
[assembly: AssemblyDescription("NuGet addin for MonoDevelop")]
[assembly: AssemblyVersion ("1.0")]
[assembly: AssemblyCopyright ("MIT X11")]
+[assembly: InternalsVisibleTo ("MonoDevelop.MonoDroid")]
+[assembly: InternalsVisibleTo ("MonoDevelop.PackageManagement.Cmdlets")]
+[assembly: InternalsVisibleTo ("MonoDevelop.PackageManagement.Extensions")]
+[assembly: InternalsVisibleTo ("MonoDevelop.PackageManagement.Tests")]
+[assembly: InternalsVisibleTo ("Xamarin.Ide")]
+[assembly: InternalsVisibleTo ("Xamarin.Ide.Insights")]
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/AddPackagesHandler.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/AddPackagesHandler.cs
index 927b6b00f2..c16dc31352 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/AddPackagesHandler.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/AddPackagesHandler.cs
@@ -28,7 +28,7 @@ using System;
namespace MonoDevelop.PackageManagement.Commands
{
- public class AddPackagesHandler : PackagesCommandHandler
+ internal class AddPackagesHandler : PackagesCommandHandler
{
protected override void Run ()
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ManagePackagesHandler.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ManagePackagesHandler.cs
index ff92a2f132..a5a36004f2 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ManagePackagesHandler.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ManagePackagesHandler.cs
@@ -27,13 +27,13 @@
//
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Ide;
using MonoDevelop.Core;
namespace MonoDevelop.PackageManagement.Commands
{
- public class ManagePackagesHandler : PackagesCommandHandler
+ internal class ManagePackagesHandler : PackagesCommandHandler
{
protected override void Run ()
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackageManagementStartupHandler.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackageManagementStartupHandler.cs
index 4a9a933c57..d7c72eabcd 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackageManagementStartupHandler.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackageManagementStartupHandler.cs
@@ -26,7 +26,6 @@
using System;
using System.Linq;
-using ICSharpCode.PackageManagement;
using MonoDevelop.Components.Commands;
using MonoDevelop.Core;
using MonoDevelop.Ide;
@@ -34,35 +33,28 @@ using MonoDevelop.Projects;
namespace MonoDevelop.PackageManagement.Commands
{
- public class PackageManagementStartupHandler : CommandHandler
+ internal class PackageManagementStartupHandler : CommandHandler
{
- IPackageManagementProjectService projectService;
-
- public PackageManagementStartupHandler ()
- {
- projectService = PackageManagementServices.ProjectService;
- }
-
protected override void Run ()
{
- projectService.SolutionLoaded += SolutionLoaded;
- projectService.SolutionUnloaded += SolutionUnloaded;
+ IdeApp.Workspace.SolutionLoaded += SolutionLoaded;
+ IdeApp.Workspace.SolutionUnloaded += SolutionUnloaded;
IdeApp.Workspace.ItemUnloading += WorkspaceItemUnloading;
}
- void SolutionLoaded (object sender, EventArgs e)
+ void SolutionLoaded (object sender, SolutionEventArgs e)
{
ClearUpdatedPackagesInSolution ();
if (ShouldRestorePackages) {
- RestoreAndCheckForUpdates ();
- } else if (ShouldCheckForUpdates && AnyProjectHasPackages ()) {
+ RestoreAndCheckForUpdates (e.Solution);
+ } else if (ShouldCheckForUpdates && AnyProjectHasPackages (e.Solution)) {
// Use background dispatch even though the check is not done on the
// background dispatcher thread so that the solution load completes before
// the check for updates starts. Otherwise the check for updates finishes
// before the solution loads and the status bar never reports that
// package updates were being checked.
- DispatchService.BackgroundDispatch (() => {
+ PackageManagementBackgroundDispatcher.Dispatch (() => {
CheckForUpdates ();
});
}
@@ -81,29 +73,29 @@ namespace MonoDevelop.PackageManagement.Commands
PackageManagementServices.UpdatedPackagesInSolution.Clear ();
}
- void SolutionUnloaded (object sender, EventArgs e)
+ void SolutionUnloaded (object sender, SolutionEventArgs e)
{
ClearUpdatedPackagesInSolution ();
}
- void RestoreAndCheckForUpdates ()
+ void RestoreAndCheckForUpdates (Solution solution)
{
- bool checkUpdatesAfterRestore = ShouldCheckForUpdates && AnyProjectHasPackages ();
+ bool checkUpdatesAfterRestore = ShouldCheckForUpdates && AnyProjectHasPackages (solution);
- var restorer = new PackageRestorer (projectService.OpenSolution.Solution);
- DispatchService.BackgroundDispatch (() => {
+ var packageManagementSolution = new PackageManagementSolution (new PackageManagementSolutionProjectService (solution));
+ var restorer = new PackageRestorer (packageManagementSolution);
+ PackageManagementBackgroundDispatcher.Dispatch (() => {
restorer.Restore ();
if (checkUpdatesAfterRestore && !restorer.RestoreFailed) {
CheckForUpdates ();
}
+ restorer = null;
});
}
- bool AnyProjectHasPackages ()
+ bool AnyProjectHasPackages (Solution solution)
{
- return projectService
- .OpenSolution
- .Solution
+ return solution
.GetAllProjectsWithPackages ()
.Any ();
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackageReferenceNodeCommandHandler.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackageReferenceNodeCommandHandler.cs
index 38e9b4411c..1b95ecafc6 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackageReferenceNodeCommandHandler.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackageReferenceNodeCommandHandler.cs
@@ -27,15 +27,15 @@
using System;
using MonoDevelop.Components.Commands;
using MonoDevelop.Core;
+using MonoDevelop.Ide;
using MonoDevelop.Ide.Commands;
using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.PackageManagement.NodeBuilders;
using MonoDevelop.Projects;
-using ICSharpCode.PackageManagement;
namespace MonoDevelop.PackageManagement.Commands
{
- public class PackageReferenceNodeCommandHandler : NodeCommandHandler
+ internal class PackageReferenceNodeCommandHandler : NodeCommandHandler
{
public override void DeleteItem ()
{
@@ -51,7 +51,7 @@ namespace MonoDevelop.PackageManagement.Commands
void RemovePackage (PackageReferenceNode packageReferenceNode, ProgressMonitorStatusMessage progressMessage)
{
- IPackageManagementProject project = PackageManagementServices.Solution.GetActiveProject ();
+ IPackageManagementProject project = PackageManagementServices.Solution.GetProject (packageReferenceNode.Project);
UninstallPackageAction action = project.CreateUninstallPackageAction ();
action.Package = project.FindPackage (packageReferenceNode.Id);
@@ -86,12 +86,14 @@ namespace MonoDevelop.PackageManagement.Commands
var packageReferenceNode = (PackageReferenceNode)CurrentNode.DataItem;
try {
- IPackageManagementProject project = PackageManagementServices.Solution.GetActiveProject ();
+ IPackageManagementProject project = PackageManagementServices.Solution.GetProject (packageReferenceNode.Project);
ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateUpdatingSinglePackageMessage (packageReferenceNode.Id, project);
UpdatePackageAction action = project.CreateUpdatePackageAction ();
action.PackageId = packageReferenceNode.Id;
+ action.AllowPrereleaseVersions = !packageReferenceNode.IsReleaseVersion ();
- RestoreBeforeUpdateAction.Restore (project, () => {
+ IPackageManagementSolution solution = GetPackageManagementSolution ();
+ RestoreBeforeUpdateAction.Restore (solution, project, () => {
UpdatePackage (progressMessage, action);
});
} catch (Exception ex) {
@@ -131,6 +133,24 @@ namespace MonoDevelop.PackageManagement.Commands
var reinstaller = new PackageReinstaller ();
reinstaller.Run (packageReferenceNode);
}
+
+ Solution GetSelectedSolution ()
+ {
+ var project = IdeApp.ProjectOperations.CurrentSelectedProject as DotNetProject;
+ if (project != null) {
+ return project.ParentSolution;
+ }
+ return IdeApp.ProjectOperations.CurrentSelectedSolution;
+ }
+
+ IPackageManagementSolution GetPackageManagementSolution ()
+ {
+ Solution solution = GetSelectedSolution ();
+ if (solution != null) {
+ return new PackageManagementSolution (new PackageManagementSolutionProjectService (solution));
+ }
+ return null;
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackageReferenceNodeCommands.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackageReferenceNodeCommands.cs
index 646d91226d..5da9002452 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackageReferenceNodeCommands.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackageReferenceNodeCommands.cs
@@ -28,7 +28,7 @@ using System;
namespace MonoDevelop.PackageManagement.Commands
{
- public enum PackageReferenceNodeCommands
+ internal enum PackageReferenceNodeCommands
{
ShowPackageVersion,
UpdatePackage,
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackagesCommandHandler.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackagesCommandHandler.cs
index 34ee152473..ae58f73082 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackagesCommandHandler.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackagesCommandHandler.cs
@@ -26,17 +26,13 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
-using System.Linq;
-using ICSharpCode.PackageManagement;
using MonoDevelop.Components.Commands;
-using MonoDevelop.Core;
using MonoDevelop.Ide;
using MonoDevelop.Projects;
namespace MonoDevelop.PackageManagement.Commands
{
- public abstract class PackagesCommandHandler : CommandHandler
+ internal abstract class PackagesCommandHandler : CommandHandler
{
protected override void Update (CommandInfo info)
{
@@ -93,5 +89,23 @@ namespace MonoDevelop.PackageManagement.Commands
}
return false;
}
+
+ Solution GetSelectedSolution ()
+ {
+ DotNetProject project = GetSelectedDotNetProject ();
+ if (project != null) {
+ return project.ParentSolution;
+ }
+ return IdeApp.ProjectOperations.CurrentSelectedSolution;
+ }
+
+ protected IPackageManagementSolution GetPackageManagementSolution ()
+ {
+ Solution solution = GetSelectedSolution ();
+ if (solution != null) {
+ return new PackageManagementSolution (new PackageManagementSolutionProjectService (solution));
+ }
+ return null;
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ProjectPackagesFolderNodeCommandHandler.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ProjectPackagesFolderNodeCommandHandler.cs
index 01a2c9ef91..5113aa6e27 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ProjectPackagesFolderNodeCommandHandler.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ProjectPackagesFolderNodeCommandHandler.cs
@@ -29,7 +29,7 @@ using MonoDevelop.Ide.Gui.Components;
namespace MonoDevelop.PackageManagement.Commands
{
- public class ProjectPackagesFolderNodeCommandHandler : NodeCommandHandler
+ internal class ProjectPackagesFolderNodeCommandHandler : NodeCommandHandler
{
public override void ActivateItem ()
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ReinstallAllPackagesInProjectHandler.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ReinstallAllPackagesInProjectHandler.cs
index c42d992967..8a3e452544 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ReinstallAllPackagesInProjectHandler.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ReinstallAllPackagesInProjectHandler.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Components.Commands;
using MonoDevelop.PackageManagement.NodeBuilders;
using MonoDevelop.Projects;
@@ -35,7 +35,7 @@ using NuGet;
namespace MonoDevelop.PackageManagement.Commands
{
- public class ReinstallAllPackagesInProjectHandler : PackagesCommandHandler
+ internal class ReinstallAllPackagesInProjectHandler : PackagesCommandHandler
{
protected override void Run ()
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/RestorePackagesHandler.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/RestorePackagesHandler.cs
index f2b33d8bd5..8d34126269 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/RestorePackagesHandler.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/RestorePackagesHandler.cs
@@ -26,24 +26,18 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
-using ICSharpCode.PackageManagement;
-using MonoDevelop.Core;
-using MonoDevelop.Core.Execution;
-using MonoDevelop.Ide;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Core.ProgressMonitoring;
using MonoDevelop.Components.Commands;
namespace MonoDevelop.PackageManagement.Commands
{
- public class RestorePackagesHandler : PackagesCommandHandler
+ internal class RestorePackagesHandler : PackagesCommandHandler
{
protected override void Run ()
{
- var runner = new PackageRestoreRunner ();
- DispatchService.BackgroundDispatch (() => {
+ var runner = new PackageRestoreRunner (GetPackageManagementSolution ());
+ PackageManagementBackgroundDispatcher.Dispatch (() => {
runner.Run ();
+ runner = null;
});
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/RestorePackagesInProjectHandler.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/RestorePackagesInProjectHandler.cs
index cd12b8ef75..3f2fc07199 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/RestorePackagesInProjectHandler.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/RestorePackagesInProjectHandler.cs
@@ -25,12 +25,11 @@
// THE SOFTWARE.
using MonoDevelop.Components.Commands;
-using MonoDevelop.Ide;
using MonoDevelop.Projects;
namespace MonoDevelop.PackageManagement.Commands
{
- public class RestorePackagesInProjectHandler : PackagesCommandHandler
+ internal class RestorePackagesInProjectHandler : PackagesCommandHandler
{
protected override void Run ()
{
@@ -39,9 +38,11 @@ namespace MonoDevelop.PackageManagement.Commands
return;
ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateRestoringPackagesInProjectMessage ();
- var runner = new PackageRestoreRunner ();
- DispatchService.BackgroundDispatch (() => {
+ var runner = new PackageRestoreRunner (GetPackageManagementSolution ());
+ PackageManagementBackgroundDispatcher.Dispatch (() => {
runner.Run (project, progressMessage);
+ runner = null;
+ project = null;
});
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/UpdateAllPackagesInProjectHandler.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/UpdateAllPackagesInProjectHandler.cs
index 0619a141f5..d56cabf8a7 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/UpdateAllPackagesInProjectHandler.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/UpdateAllPackagesInProjectHandler.cs
@@ -1,46 +1,48 @@
-//
-// UpdateAllPackagesInProjectHandler.cs
-//
-// Author:
-// Matt Ward <matt.ward@xamarin.com>
-//
-// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
+//
+// UpdateAllPackagesInProjectHandler.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide;
-
+using MonoDevelop.Core;
+
namespace MonoDevelop.PackageManagement.Commands
{
- public class UpdateAllPackagesInProjectHandler : PackagesCommandHandler
+ internal class UpdateAllPackagesInProjectHandler : PackagesCommandHandler
{
protected override void Run ()
{
- try {
+ try {
+ IPackageManagementSolution solution = GetPackageManagementSolution ();
IPackageManagementProject project = PackageManagementServices.Solution.GetActiveProject ();
- RestoreBeforeUpdateAction.Restore (project, () => {
- DispatchService.GuiSyncDispatch (() => Update (project));
+ RestoreBeforeUpdateAction.Restore (solution, project, () => {
+ Runtime.RunInMainThread (() => Update (project)).Wait ();
});
} catch (Exception ex) {
ShowStatusBarError (ex);
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/UpdateAllPackagesInSolutionHandler.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/UpdateAllPackagesInSolutionHandler.cs
index bb850711ba..710470aff6 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/UpdateAllPackagesInSolutionHandler.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/UpdateAllPackagesInSolutionHandler.cs
@@ -1,49 +1,49 @@
-//
-// UpdateAllPackagesInSolutionCommandHandler.cs
-//
-// Author:
-// Matt Ward <matt.ward@xamarin.com>
-//
-// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
+//
+// UpdateAllPackagesInSolutionCommandHandler.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
using MonoDevelop.Components.Commands;
-using MonoDevelop.Ide;
-
+using MonoDevelop.Core;
+
namespace MonoDevelop.PackageManagement.Commands
{
- public class UpdateAllPackagesInSolutionHandler : PackagesCommandHandler
+ internal class UpdateAllPackagesInSolutionHandler : PackagesCommandHandler
{
protected override void Run ()
{
- try {
- UpdateAllPackagesInSolution updateAllPackages = CreateUpdateAllPackagesInSolution ();
+ try {
+ IPackageManagementSolution solution = GetPackageManagementSolution ();
+ UpdateAllPackagesInSolution updateAllPackages = CreateUpdateAllPackagesInSolution (solution);
ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateUpdatingPackagesInSolutionMessage (updateAllPackages.Projects);
- RestoreBeforeUpdateAction.Restore (updateAllPackages.Projects, () => {
- DispatchService.GuiSyncDispatch (() => {
+ RestoreBeforeUpdateAction.Restore (solution, updateAllPackages.Projects, () => {
+ Runtime.RunInMainThread (() => {
Update (updateAllPackages, progressMessage);
- });
+ }).Wait ();
});
} catch (Exception ex) {
ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateUpdatingPackagesInSolutionMessage ();
@@ -61,10 +61,10 @@ namespace MonoDevelop.PackageManagement.Commands
}
}
- UpdateAllPackagesInSolution CreateUpdateAllPackagesInSolution ()
+ UpdateAllPackagesInSolution CreateUpdateAllPackagesInSolution (IPackageManagementSolution solution)
{
return new UpdateAllPackagesInSolution (
- PackageManagementServices.Solution,
+ solution,
PackageManagementServices.PackageRepositoryCache.CreateAggregateRepository ());
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackageSourceDialog.UI.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackageSourceDialog.UI.cs
index 1b291e8e2b..31dab786d6 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackageSourceDialog.UI.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackageSourceDialog.UI.cs
@@ -30,7 +30,7 @@ using Xwt;
namespace MonoDevelop.PackageManagement
{
- public partial class AddPackageSourceDialog : Dialog
+ internal partial class AddPackageSourceDialog : Dialog
{
TextEntry packageSourceNameTextEntry;
TextEntry packageSourceUrlTextEntry;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackageSourceDialog.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackageSourceDialog.cs
index dec492da47..a101cc2b88 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackageSourceDialog.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackageSourceDialog.cs
@@ -25,12 +25,12 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
namespace MonoDevelop.PackageManagement
{
- public partial class AddPackageSourceDialog
+ internal partial class AddPackageSourceDialog
{
RegisteredPackageSourcesViewModel viewModel;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackagesDialog.UI.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackagesDialog.UI.cs
index 7fe0956497..912ed31c8c 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackagesDialog.UI.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackagesDialog.UI.cs
@@ -27,14 +27,14 @@
using System;
using ExtendedTitleBarDialog = MonoDevelop.Components.ExtendedTitleBarDialog;
using Mono.Unix;
+using MonoDevelop.Core;
using MonoDevelop.Ide;
-using MonoDevelop.Ide.Gui;
using Xwt;
using Xwt.Drawing;
namespace MonoDevelop.PackageManagement
{
- public partial class AddPackagesDialog : ExtendedTitleBarDialog
+ internal partial class AddPackagesDialog : ExtendedTitleBarDialog
{
ComboBox packageSourceComboBox;
SearchTextEntry packageSearchEntry;
@@ -60,8 +60,7 @@ namespace MonoDevelop.PackageManagement
Label errorMessageLabel;
Label loadingSpinnerLabel;
FrameBox noPackagesFoundFrame;
- Color lineBorderColor = Color.FromBytes (163, 166, 171);
- Color packageInfoBackgroundColor = Color.FromBytes (227, 231, 237);
+ int packageInfoFontSize = 11;
void Build ()
{
@@ -70,6 +69,10 @@ namespace MonoDevelop.PackageManagement
Height = 520;
Padding = new WidgetSpacing ();
+ if (Platform.IsWindows) {
+ packageInfoFontSize = 9;
+ }
+
// Top part of dialog:
// Package sources and search.
var topHBox = new HBox ();
@@ -95,7 +98,7 @@ namespace MonoDevelop.PackageManagement
var middleFrame = new FrameBox ();
middleFrame.Content = middleHBox;
middleFrame.BorderWidth = new WidgetSpacing (0, 0, 0, 1);
- middleFrame.BorderColor = lineBorderColor;
+ middleFrame.BorderColor = Styles.LineBorderColor;
mainVBox.PackStart (middleFrame, true, true);
// Error information.
@@ -103,15 +106,15 @@ namespace MonoDevelop.PackageManagement
packagesListVBox.Spacing = 0;
errorMessageHBox = new HBox ();
errorMessageHBox.Margin = new WidgetSpacing ();
- errorMessageHBox.BackgroundColor = Colors.Orange;
+ errorMessageHBox.BackgroundColor = Styles.ErrorBackgroundColor;
errorMessageHBox.Visible = false;
var errorImage = new ImageView ();
errorImage.Margin = new WidgetSpacing (10, 0, 0, 0);
- errorImage.Image = ImageService.GetIcon (Stock.Warning, Gtk.IconSize.Menu);
+ errorImage.Image = ImageService.GetIcon (MonoDevelop.Ide.Gui.Stock.Warning, Gtk.IconSize.Menu);
errorImage.HorizontalPlacement = WidgetPlacement.End;
errorMessageHBox.PackStart (errorImage);
errorMessageLabel = new Label ();
- errorMessageLabel.TextColor = Colors.White;
+ errorMessageLabel.TextColor = Styles.ErrorForegroundColor;
errorMessageLabel.Margin = new WidgetSpacing (5, 5, 5, 5);
errorMessageLabel.Wrap = WrapMode.Word;
errorMessageHBox.PackStart (errorMessageLabel, true);
@@ -138,7 +141,7 @@ namespace MonoDevelop.PackageManagement
loadingSpinnerFrame = new FrameBox ();
loadingSpinnerFrame.Visible = false;
- loadingSpinnerFrame.BackgroundColor = Colors.White;
+ loadingSpinnerFrame.BackgroundColor = Styles.BackgroundColor;
loadingSpinnerFrame.Content = loadingSpinnerHBox;
loadingSpinnerFrame.BorderWidth = new WidgetSpacing ();
packagesListVBox.PackStart (loadingSpinnerFrame, true, true);
@@ -153,7 +156,7 @@ namespace MonoDevelop.PackageManagement
noPackagesFoundFrame = new FrameBox ();
noPackagesFoundFrame.Visible = false;
- noPackagesFoundFrame.BackgroundColor = Colors.White;
+ noPackagesFoundFrame.BackgroundColor = Styles.BackgroundColor;
noPackagesFoundFrame.Content = noPackagesFoundHBox;
noPackagesFoundFrame.BorderWidth = new WidgetSpacing ();
packagesListVBox.PackStart (noPackagesFoundFrame, true, true);
@@ -161,7 +164,7 @@ namespace MonoDevelop.PackageManagement
// Package information
packageInfoVBox = new VBox ();
var packageInfoFrame = new FrameBox ();
- packageInfoFrame.BackgroundColor = packageInfoBackgroundColor;
+ packageInfoFrame.BackgroundColor = Styles.PackageInfoBackgroundColor;
packageInfoFrame.BorderWidth = new WidgetSpacing ();
packageInfoFrame.Content = packageInfoVBox;
packageInfoVBox.Margin = new WidgetSpacing (15, 12, 15, 12);
@@ -173,11 +176,11 @@ namespace MonoDevelop.PackageManagement
packageInfoScrollView.BorderVisible = false;
packageInfoScrollView.HorizontalScrollPolicy = ScrollPolicy.Never;
packageInfoScrollView.Content = packageInfoContainerVBox;
- packageInfoScrollView.BackgroundColor = packageInfoBackgroundColor;
+ packageInfoScrollView.BackgroundColor = Styles.PackageInfoBackgroundColor;
var packageInfoScrollViewFrame = new FrameBox ();
- packageInfoScrollViewFrame.BackgroundColor = packageInfoBackgroundColor;
+ packageInfoScrollViewFrame.BackgroundColor = Styles.PackageInfoBackgroundColor;
packageInfoScrollViewFrame.BorderWidth = new WidgetSpacing (1, 0, 0, 0);
- packageInfoScrollViewFrame.BorderColor = lineBorderColor;
+ packageInfoScrollViewFrame.BorderColor = Styles.LineBorderColor;
packageInfoScrollViewFrame.Content = packageInfoScrollView;
middleHBox.PackEnd (packageInfoScrollViewFrame);
@@ -187,18 +190,20 @@ namespace MonoDevelop.PackageManagement
packageNameLabel = new Label ();
packageNameLabel.Ellipsize = EllipsizeMode.End;
- Font packageInfoSmallFont = packageNameLabel.Font.WithScaledSize (0.8);
+ Font packageInfoSmallFont = packageNameLabel.Font.WithSize (packageInfoFontSize);
+ packageNameLabel.Font = packageInfoSmallFont;
packageNameHBox.PackStart (packageNameLabel, true);
packageVersionLabel = new Label ();
packageVersionLabel.TextAlignment = Alignment.End;
+ packageVersionLabel.Font = packageInfoSmallFont;
packageNameHBox.PackEnd (packageVersionLabel);
// Package description.
packageDescription = new Label ();
packageDescription.Wrap = WrapMode.Word;
- packageDescription.Font = packageNameLabel.Font.WithScaledSize (0.9);
- packageDescription.BackgroundColor = packageInfoBackgroundColor;
+ packageDescription.Font = packageNameLabel.Font.WithSize (packageInfoFontSize);
+ packageDescription.BackgroundColor = Styles.PackageInfoBackgroundColor;
packageInfoVBox.PackStart (packageDescription);
// Package id.
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackagesDialog.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackagesDialog.cs
index ec8e0f7f69..fc3b7c756e 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackagesDialog.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackagesDialog.cs
@@ -28,10 +28,12 @@ using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using System.Threading.Tasks;
+using MonoDevelop.PackageManagement;
using Mono.Unix;
using MonoDevelop.Core;
using MonoDevelop.Ide;
+using MonoDevelop.Projects;
using NuGet;
using Xwt;
using Xwt.Drawing;
@@ -40,7 +42,7 @@ using PropertyChangedEventArgs = System.ComponentModel.PropertyChangedEventArgs;
namespace MonoDevelop.PackageManagement
{
- public partial class AddPackagesDialog
+ internal partial class AddPackagesDialog
{
IBackgroundPackageActionRunner backgroundActionRunner;
IRecentPackageRepository recentPackageRepository;
@@ -60,6 +62,7 @@ namespace MonoDevelop.PackageManagement
new PackageSource ("", Catalog.GetString ("Configure Sources..."));
ImageLoader imageLoader = new ImageLoader ();
bool loadingMessageVisible;
+ const string IncludePrereleaseUserPreferenceName = "NuGet.AddPackagesDialog.IncludePrerelease";
public AddPackagesDialog (ManagePackagesViewModel parentViewModel, string initialSearch = null)
: this (
@@ -108,6 +111,9 @@ namespace MonoDevelop.PackageManagement
viewModel.PropertyChanged -= ViewModelPropertyChanged;
parentViewModel.Dispose ();
DisposeExistingTimer ();
+ packageStore.Clear ();
+ viewModel = null;
+ parentViewModel = null;
base.Dispose (disposing);
}
@@ -187,6 +193,31 @@ namespace MonoDevelop.PackageManagement
void ShowPrereleaseCheckBoxClicked (object sender, EventArgs e)
{
viewModel.IncludePrerelease = !viewModel.IncludePrerelease;
+
+ SaveIncludePrereleaseUserPreference ();
+ }
+
+ void SaveIncludePrereleaseUserPreference ()
+ {
+ Solution solution = IdeApp.ProjectOperations.CurrentSelectedSolution;
+ if (solution != null) {
+ if (viewModel.IncludePrerelease) {
+ solution.UserProperties.SetValue (IncludePrereleaseUserPreferenceName, viewModel.IncludePrerelease);
+ } else {
+ solution.UserProperties.RemoveValue (IncludePrereleaseUserPreferenceName);
+ }
+ solution.SaveUserProperties ();
+ }
+ }
+
+ bool GetIncludePrereleaseUserPreference ()
+ {
+ Solution solution = IdeApp.ProjectOperations.CurrentSelectedSolution;
+ if (solution != null) {
+ return solution.UserProperties.GetValue (IncludePrereleaseUserPreferenceName, false);
+ }
+
+ return false;
}
void LoadViewModel (string initialSearch)
@@ -194,6 +225,9 @@ namespace MonoDevelop.PackageManagement
viewModel.ClearPackagesOnPaging = false;
viewModel.SearchTerms = initialSearch;
+ viewModel.IncludePrerelease = GetIncludePrereleaseUserPreference ();
+ showPrereleaseCheckBox.Active = viewModel.IncludePrerelease;
+
ClearSelectedPackageInformation ();
PopulatePackageSources ();
viewModel.PropertyChanged += ViewModelPropertyChanged;
@@ -416,7 +450,7 @@ namespace MonoDevelop.PackageManagement
// Workaround: Image loading is incorrectly being done on GUI thread
// since the wrong synchronization context seems to be used. So
// here we switch to a background thread and then back to the GUI thread.
- DispatchService.BackgroundDispatch (() => LoadImage (packageViewModel.IconUrl, row));
+ Task.Run (() => LoadImage (packageViewModel.IconUrl, row));
}
}
@@ -424,7 +458,7 @@ namespace MonoDevelop.PackageManagement
{
// Put it back on the GUI thread so the correct synchronization context
// is used. The image loading will be done on a background thread.
- DispatchService.GuiDispatch (() => imageLoader.LoadFrom (iconUrl, row));
+ Runtime.RunInMainThread (() => imageLoader.LoadFrom (iconUrl, row));
}
bool IsOddRow (int row)
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackagesDialogRunner.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackagesDialogRunner.cs
index 4d5ac983d6..2c17e14bd9 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackagesDialogRunner.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/AddPackagesDialogRunner.cs
@@ -25,14 +25,14 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Ide;
using Xwt;
using MonoDevelop.Core;
namespace MonoDevelop.PackageManagement
{
- public class AddPackagesDialogRunner
+ internal class AddPackagesDialogRunner
{
public void Run (string initialSearch = null)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/DialogExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/DialogExtensions.cs
index a2581c158f..06225fa73d 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/DialogExtensions.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/DialogExtensions.cs
@@ -30,7 +30,7 @@ using Xwt;
namespace MonoDevelop.PackageManagement
{
- public static class DialogExtensions
+ internal static class DialogExtensions
{
public static Command ShowWithParent (this Dialog dialog)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/HyperlinkWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/HyperlinkWidget.cs
index d42dc53f3c..43aede9353 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/HyperlinkWidget.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/HyperlinkWidget.cs
@@ -33,7 +33,7 @@ using MonoDevelop.Ide;
namespace MonoDevelop.PackageManagement
{
[System.ComponentModel.ToolboxItem(true)]
- public partial class HyperlinkWidget : Gtk.Bin
+ internal partial class HyperlinkWidget : Gtk.Bin
{
LinkButton linkButton;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/LicenseAcceptanceDialog.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/LicenseAcceptanceDialog.cs
index 5327c86e0f..e3ea8887c2 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/LicenseAcceptanceDialog.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/LicenseAcceptanceDialog.cs
@@ -27,12 +27,14 @@
//
using System;
-using ICSharpCode.PackageManagement;
-using NuGet;
+using Gtk;
+using MonoDevelop.Components;
+using MonoDevelop.Core;
+using MonoDevelop.Ide;
namespace MonoDevelop.PackageManagement
{
- public partial class LicenseAcceptanceDialog : Gtk.Dialog
+ internal partial class LicenseAcceptanceDialog : Gtk.Dialog
{
LicenseAcceptanceViewModel viewModel;
@@ -42,21 +44,43 @@ namespace MonoDevelop.PackageManagement
this.viewModel = viewModel;
this.subTitleHBoxForSinglePackage.Visible = viewModel.HasOnePackage;
this.subTitleHBoxForMultiplePackages.Visible = viewModel.HasMultiplePackages;
+
AddPackages ();
}
void AddPackages ()
{
foreach (PackageLicenseViewModel package in viewModel.Packages) {
- AddPackageWidget (package);
+ AddPackage (package);
}
this.packagesVBox.ShowAll ();
}
- void AddPackageWidget (PackageLicenseViewModel package)
+ void AddPackage (PackageLicenseViewModel package)
+ {
+ var label = new Label () {
+ Xalign = 0,
+ Yalign = 0,
+ Xpad = 5,
+ Ypad = 5,
+ Wrap = true,
+ Markup = CreatePackageMarkup (package)
+ };
+
+ GtkWorkarounds.SetLinkHandler (label, DesktopService.ShowUrl);
+
+ this.packagesVBox.PackStart (label, false, false, 0);
+ }
+
+ string CreatePackageMarkup (PackageLicenseViewModel package)
{
- var widget = new PackageLicenseWidget (package);
- this.packagesVBox.Add (widget);
+ return String.Format (
+ "<span weight='bold'>{0}</span>\t{1}\n<a href='{2}'>{3}</a>",
+ package.Id,
+ package.GetAuthors (),
+ package.LicenseUrl,
+ GettextCatalog.GetString ("View License")
+ );
}
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs
index ec08175f9e..bc692b9745 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs
@@ -28,11 +28,11 @@
using System;
using Gtk;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement
{
- public partial class ManagePackagesDialog : Gtk.Dialog
+ internal partial class ManagePackagesDialog : Gtk.Dialog
{
ManagePackagesViewModel viewModel;
IPackageManagementEvents packageManagementEvents;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageCellView.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageCellView.cs
index 5b2df5a845..cb16c4ae39 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageCellView.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageCellView.cs
@@ -25,23 +25,34 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.Core;
using Xwt;
using Xwt.Drawing;
namespace MonoDevelop.PackageManagement
{
- public class PackageCellView : CanvasCellView
+ internal class PackageCellView : CanvasCellView
{
+ int packageIdFontSize;
+ int packageDescriptionFontSize;
+
public PackageCellView ()
{
CellWidth = 260;
- BackgroundColor = Color.FromBytes (243, 246, 250);
- StrongSelectionColor = Color.FromBytes (49, 119, 216);
- SelectionColor = Color.FromBytes (204, 204, 204);
+ BackgroundColor = Styles.CellBackgroundColor;
+ StrongSelectionColor = Styles.CellStrongSelectionColor;
+ SelectionColor = Styles.CellSelectionColor;
UseStrongSelectionColor = true;
+
+ if (Platform.IsWindows) {
+ packageIdFontSize = 10;
+ packageDescriptionFontSize = 9;
+ } else {
+ packageIdFontSize = 12;
+ packageDescriptionFontSize = 11;
+ }
}
public IDataField<PackageViewModel> PackageField { get; set; }
@@ -88,6 +99,7 @@ namespace MonoDevelop.PackageManagement
// Package Id.
var packageIdTextLayout = new TextLayout ();
+ packageIdTextLayout.Font = packageIdTextLayout.Font.WithSize (packageIdFontSize);
packageIdTextLayout.Markup = packageViewModel.GetNameMarkup ();
packageIdTextLayout.Trimming = TextTrimming.WordElipsis;
Size packageIdTextSize = packageIdTextLayout.GetSize ();
@@ -99,7 +111,7 @@ namespace MonoDevelop.PackageManagement
// Package description.
var descriptionTextLayout = new TextLayout ();
- descriptionTextLayout.Font = descriptionTextLayout.Font.WithScaledSize (0.9);
+ descriptionTextLayout.Font = descriptionTextLayout.Font.WithSize (packageDescriptionFontSize);
descriptionTextLayout.Width = cellArea.Width - packageDescriptionPadding.HorizontalSpacing - packageDescriptionLeftOffset;
descriptionTextLayout.Height = cellArea.Height - packageIdTextSize.Height - packageDescriptionPadding.VerticalSpacing;
descriptionTextLayout.Text = packageViewModel.Summary;
@@ -114,9 +126,9 @@ namespace MonoDevelop.PackageManagement
void UpdateTextColor (Context ctx)
{
if (UseStrongSelectionColor && Selected) {
- ctx.SetColor (Colors.White);
+ ctx.SetColor (Styles.CellTextSelectionColor);
} else {
- ctx.SetColor (Colors.Black);
+ ctx.SetColor (Styles.CellTextColor);
}
}
@@ -230,6 +242,9 @@ namespace MonoDevelop.PackageManagement
image = defaultPackageImage;
}
+ if (Selected)
+ image = image.WithStyles ("sel");
+
if (PackageImageNeedsResizing (image)) {
Point imageLocation = GetPackageImageLocation (maxPackageImageSize, cellArea);
ctx.DrawImage (
@@ -263,7 +278,7 @@ namespace MonoDevelop.PackageManagement
{
var layout = new TextLayout ();
layout.Text = "W";
- layout.Font = layout.Font.WithScaledSize (0.9);
+ layout.Font = layout.Font.WithSize (packageDescriptionFontSize);
Size size = layout.GetSize ();
return new Size (CellWidth, size.Height * linesDisplayedCount + packageDescriptionPaddingHeight + packageDescriptionPadding.VerticalSpacing);
}
@@ -317,7 +332,7 @@ namespace MonoDevelop.PackageManagement
Image checkedCheckBoxWithBackgroundColorImage;
Image uncheckedCheckBoxWithBackgroundColorImage;
- static readonly Image defaultPackageImage = Image.FromResource (typeof(PackageCellView), "reference-48.png");
+ static readonly Image defaultPackageImage = Image.FromResource (typeof(PackageCellView), "package-48.png");
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageCellViewCheckBox.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageCellViewCheckBox.cs
index 9addd492fc..5e0277c98d 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageCellViewCheckBox.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageCellViewCheckBox.cs
@@ -30,7 +30,7 @@ using Gtk;
namespace MonoDevelop.PackageManagement
{
- public class PackageCellViewCheckBox
+ internal class PackageCellViewCheckBox
{
static int indicatorSize;
static int indicatorSpacing;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageCellViewEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageCellViewEventArgs.cs
index 5a459272a0..32b9d14bef 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageCellViewEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageCellViewEventArgs.cs
@@ -25,11 +25,11 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement
{
- public class PackageCellViewEventArgs : EventArgs
+ internal class PackageCellViewEventArgs : EventArgs
{
public PackageCellViewEventArgs (PackageViewModel packageViewModel)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageLicenseWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageLicenseWidget.cs
index 3a84ae9e05..709e6c8314 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageLicenseWidget.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageLicenseWidget.cs
@@ -27,13 +27,13 @@
//
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement
{
[System.ComponentModel.ToolboxItem(true)]
- public partial class PackageLicenseWidget : Gtk.Bin
+ internal partial class PackageLicenseWidget : Gtk.Bin
{
public PackageLicenseWidget (PackageLicenseViewModel viewModel)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsPanel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsPanel.cs
index 977256acc9..ac5c61c5f2 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsPanel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsPanel.cs
@@ -27,16 +27,17 @@
//
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.Components;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.PackageManagement.Gui
{
- public class PackageManagementOptionsPanel : OptionsPanel
+ internal class PackageManagementOptionsPanel : OptionsPanel
{
PackageManagementOptionsViewModel optionsViewModel;
-
- public override Gtk.Widget CreatePanelWidget()
+
+ public override Control CreatePanelWidget()
{
var viewModels = new PackageManagementViewModels ();
optionsViewModel = viewModels.PackageManagementOptionsViewModel;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsWidget.cs
index 5bb930bede..521df0f699 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsWidget.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsWidget.cs
@@ -27,12 +27,12 @@
//
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement
{
[System.ComponentModel.ToolboxItem(true)]
- public partial class PackageManagementOptionsWidget : Gtk.Bin
+ internal partial class PackageManagementOptionsWidget : Gtk.Bin
{
PackageManagementOptionsViewModel viewModel;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourceCellRenderer.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourceCellRenderer.cs
index 5e788c8ea7..b66eb067eb 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourceCellRenderer.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourceCellRenderer.cs
@@ -26,14 +26,14 @@
using System;
using Gtk;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Components;
using MonoDevelop.Ide;
using Gdk;
namespace MonoDevelop.PackageManagement
{
- public class PackageSourceCellRenderer : CellRenderer
+ internal class PackageSourceCellRenderer : CellRenderer
{
[GLib.Property("package-source")]
public PackageSourceViewModel PackageSourceViewModel { get; set; }
@@ -56,7 +56,7 @@ namespace MonoDevelop.PackageManagement
int packageSourceNameWidth = GetLayoutWidth (layout);
StateType state = GetState (widget, flags);
- layout.SetMarkup (GetPackageSourceDescriptionMarkup ());
+ layout.SetMarkup (GetPackageSourceDescriptionMarkup (flags));
window.DrawLayout (widget.Style.TextGC (state), cell_area.X + textSpacing, cell_area.Y + textTopSpacing, layout);
@@ -65,7 +65,7 @@ namespace MonoDevelop.PackageManagement
ctx.DrawImage (widget, warningImage, cell_area.X + textSpacing + packageSourceNameWidth + imageSpacing, cell_area.Y + textTopSpacing);
}
- layout.SetMarkup (GetPackageSourceErrorMarkup ());
+ layout.SetMarkup (GetPackageSourceErrorMarkup (flags));
int packageSourceErrorTextX = cell_area.X + textSpacing + packageSourceNameWidth + (int)warningImage.Width + (2 * imageSpacing);
window.DrawLayout (widget.Style.TextGC (state), packageSourceErrorTextX, cell_area.Y + textTopSpacing, layout);
}
@@ -104,18 +104,20 @@ namespace MonoDevelop.PackageManagement
return new Size (width, height);
}
- string GetPackageSourceDescriptionMarkup ()
+ string GetPackageSourceDescriptionMarkup (CellRendererState flags = CellRendererState.Focused)
{
return MarkupString.Format (
- "<b>{0}</b>\n<span foreground='#747474'>{1}</span>",
+ "<b>{0}</b>\n<span foreground='{2}'>{1}</span>",
PackageSourceViewModel.Name,
- PackageSourceViewModel.SourceUrl);
+ PackageSourceViewModel.SourceUrl,
+ Ide.Gui.Styles.ColorGetHex (flags.HasFlag (CellRendererState.Selected) ? Styles.PackageSourceUrlSelectedTextColor : Styles.PackageSourceUrlTextColor));
}
- string GetPackageSourceErrorMarkup ()
+ string GetPackageSourceErrorMarkup (CellRendererState flags = CellRendererState.Focused)
{
return MarkupString.Format (
- "<span foreground='#656565'>{0}</span>",
+ "<span foreground='{0}'>{1}</span>",
+ Ide.Gui.Styles.ColorGetHex (flags.HasFlag (CellRendererState.Selected) ? Styles.PackageSourceErrorSelectedTextColor : Styles.PackageSourceErrorTextColor),
PackageSourceViewModel.ValidationFailureMessage);
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesOptionsPanel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesOptionsPanel.cs
index d89d2bc405..22f60668a9 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesOptionsPanel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesOptionsPanel.cs
@@ -30,19 +30,20 @@ using System;
using System.Linq;
using System.IO;
using System.Security.Cryptography;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.Components;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.PackageManagement.Gui
{
- public class PackageSourcesOptionsPanel : OptionsPanel
+ internal class PackageSourcesOptionsPanel : OptionsPanel
{
PackageManagementViewModels viewModels;
PackageSourcesWidget packageSourcesWidget;
- public override Gtk.Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
viewModels = new PackageManagementViewModels ();
viewModels.RegisteredPackageSourcesViewModel.Load ();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesWidget.cs
index 0b27fbaf60..11cc284a27 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesWidget.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesWidget.cs
@@ -4,14 +4,14 @@ using System.Collections.Specialized;
using System.Linq;
using Gtk;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.Components;
namespace MonoDevelop.PackageManagement
{
[System.ComponentModel.ToolboxItem(true)]
- public partial class PackageSourcesWidget : Gtk.Bin
+ internal partial class PackageSourcesWidget : Gtk.Bin
{
RegisteredPackageSourcesViewModel viewModel;
ListStore packageSourcesStore;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackagesWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackagesWidget.cs
index 322c4db9c4..6412603bd3 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackagesWidget.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackagesWidget.cs
@@ -33,14 +33,14 @@ using System.Linq;
using Gdk;
using Gtk;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Ide;
using NuGet;
namespace MonoDevelop.PackageManagement
{
[System.ComponentModel.ToolboxItem(true)]
- public partial class PackagesWidget : Gtk.Bin
+ internal partial class PackagesWidget : Gtk.Bin
{
PackagesViewModel viewModel;
List<PackageSource> packageSources;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PagedResultsWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PagedResultsWidget.cs
index a596b7d59e..ed5c2a3677 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PagedResultsWidget.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PagedResultsWidget.cs
@@ -29,13 +29,13 @@
using System;
using System.Collections.Generic;
using Gtk;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using System.ComponentModel;
namespace MonoDevelop.PackageManagement
{
[System.ComponentModel.ToolboxItem(true)]
- public partial class PagedResultsWidget : Gtk.Bin
+ internal partial class PagedResultsWidget : Gtk.Bin
{
PackagesViewModel viewModel;
List<Button> buttons;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/SelectProjectsDialog.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/SelectProjectsDialog.cs
index 5c3f11168b..7a22f46a72 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/SelectProjectsDialog.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/SelectProjectsDialog.cs
@@ -30,11 +30,11 @@ using System;
using System.Collections.Generic;
using System.Linq;
using Gtk;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement
{
- public partial class SelectProjectsDialog : Gtk.Dialog
+ internal partial class SelectProjectsDialog : Gtk.Dialog
{
SelectProjectsViewModel viewModel;
ListStore projectsStore;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/Styles.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/Styles.cs
new file mode 100644
index 0000000000..aaea5a60c0
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/Styles.cs
@@ -0,0 +1,87 @@
+//
+// Styles.cs
+//
+// Author:
+// Vsevolod Kukol <sevo@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using MonoDevelop.Ide;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.PackageManagement
+{
+ internal static class Styles
+ {
+ public static Xwt.Drawing.Color LineBorderColor { get; internal set; }
+ public static Xwt.Drawing.Color BackgroundColor { get; internal set; }
+ public static Xwt.Drawing.Color PackageInfoBackgroundColor { get; internal set; }
+ public static Xwt.Drawing.Color CellBackgroundColor { get; internal set; }
+ public static Xwt.Drawing.Color CellSelectionColor { get; internal set; }
+ public static Xwt.Drawing.Color CellStrongSelectionColor { get; internal set; }
+ public static Xwt.Drawing.Color CellTextColor { get; internal set; }
+ public static Xwt.Drawing.Color CellTextSelectionColor { get; internal set; }
+ public static Xwt.Drawing.Color PackageSourceUrlTextColor { get; internal set; }
+ public static Xwt.Drawing.Color PackageSourceUrlSelectedTextColor { get; internal set; }
+ public static Xwt.Drawing.Color PackageSourceErrorTextColor { get; internal set; }
+ public static Xwt.Drawing.Color PackageSourceErrorSelectedTextColor { get; internal set; }
+ public static Xwt.Drawing.Color ErrorBackgroundColor { get; internal set; }
+ public static Xwt.Drawing.Color ErrorForegroundColor { get; internal set; }
+
+ static Styles ()
+ {
+ LoadStyles ();
+ Ide.Gui.Styles.Changed += (o, e) => LoadStyles ();
+ }
+
+ public static void LoadStyles ()
+ {
+ if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light) {
+ CellBackgroundColor = Ide.Gui.Styles.PadBackground;
+ } else {
+ CellBackgroundColor = Xwt.Drawing.Color.FromName ("#3c3c3c");
+ }
+
+ // Shared
+
+ BackgroundColor = Ide.Gui.Styles.PrimaryBackgroundColor;
+
+ CellTextColor = Ide.Gui.Styles.BaseForegroundColor;
+ CellStrongSelectionColor = Ide.Gui.Styles.BaseSelectionBackgroundColor;
+ CellSelectionColor = Ide.Gui.Styles.BaseSelectionBackgroundColor;
+ CellTextSelectionColor = Ide.Gui.Styles.BaseSelectionTextColor;
+
+ PackageInfoBackgroundColor = Ide.Gui.Styles.SecondaryBackgroundLighterColor;
+ PackageSourceErrorTextColor = Ide.Gui.Styles.ErrorForegroundColor;
+ PackageSourceUrlTextColor = Ide.Gui.Styles.DimTextColor;
+
+ PackageSourceErrorSelectedTextColor = PackageSourceErrorTextColor;
+
+ // Blue selection text color only on Mac
+ PackageSourceUrlSelectedTextColor = Platform.IsMac ? Xwt.Drawing.Color.FromName ("#ffffff") : Ide.Gui.Styles.DimTextColor;
+
+ LineBorderColor = Ide.Gui.Styles.SeparatorColor;
+
+ ErrorBackgroundColor = Ide.Gui.Styles.StatusWarningBackgroundColor;
+ ErrorForegroundColor = Ide.Gui.Styles.StatusWarningTextColor;
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/PackageReferenceNode.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/PackageReferenceNode.cs
index 915328acfd..da3636f7b5 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/PackageReferenceNode.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/PackageReferenceNode.cs
@@ -33,14 +33,16 @@ using NuGet;
namespace MonoDevelop.PackageManagement.NodeBuilders
{
- public class PackageReferenceNode
+ internal class PackageReferenceNode
{
public PackageReferenceNode (
+ ProjectPackagesFolderNode parentNode,
PackageReference packageReference,
bool installed,
bool pending = false,
IPackageName updatedPackage = null)
{
+ ParentNode = parentNode;
PackageReference = packageReference;
Installed = installed;
IsInstallPending = pending;
@@ -62,6 +64,13 @@ namespace MonoDevelop.PackageManagement.NodeBuilders
public bool IsInstallPending { get; private set; }
public bool IsReinstallNeeded { get; private set; }
+
+ ProjectPackagesFolderNode ParentNode { get; set; }
+
+ public IDotNetProject Project {
+ get { return ParentNode.Project; }
+ }
+
public string Name {
get { return PackageReference.Id; }
}
@@ -148,6 +157,11 @@ namespace MonoDevelop.PackageManagement.NodeBuilders
{
return (!Installed || IsInstallPending);
}
+
+ public bool IsReleaseVersion ()
+ {
+ return PackageReference.IsReleaseVersion ();
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/PackageReferenceNodeBuilder.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/PackageReferenceNodeBuilder.cs
index 149b61f265..bff21aff91 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/PackageReferenceNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/PackageReferenceNodeBuilder.cs
@@ -33,7 +33,7 @@ using MonoDevelop.PackageManagement.Commands;
namespace MonoDevelop.PackageManagement.NodeBuilders
{
- public class PackageReferenceNodeBuilder : TypeNodeBuilder
+ internal class PackageReferenceNodeBuilder : TypeNodeBuilder
{
public override Type NodeDataType {
get { return typeof(PackageReferenceNode); }
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/PackageReferenceNodeDescriptor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/PackageReferenceNodeDescriptor.cs
index 76e0d796db..e91d50f65d 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/PackageReferenceNodeDescriptor.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/PackageReferenceNodeDescriptor.cs
@@ -32,7 +32,7 @@ using System.Runtime.Versioning;
namespace MonoDevelop.PackageManagement.NodeBuilders
{
- public class PackageReferenceNodeDescriptor : CustomDescriptor
+ internal class PackageReferenceNodeDescriptor : CustomDescriptor
{
PackageReferenceNode packageReferenceNode;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/PackageReferenceNodePropertyProvider.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/PackageReferenceNodePropertyProvider.cs
index 1ec7365af2..4c5fa6f110 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/PackageReferenceNodePropertyProvider.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/PackageReferenceNodePropertyProvider.cs
@@ -29,7 +29,7 @@ using MonoDevelop.DesignerSupport;
namespace MonoDevelop.PackageManagement.NodeBuilders
{
- public class PackageReferenceNodePropertyProvider : IPropertyProvider
+ internal class PackageReferenceNodePropertyProvider : IPropertyProvider
{
public bool SupportsObject (object obj)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectPackagesFolderNode.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectPackagesFolderNode.cs
index 45e629c2de..969ea872b2 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectPackagesFolderNode.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectPackagesFolderNode.cs
@@ -27,7 +27,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Projects;
@@ -35,7 +34,7 @@ using NuGet;
namespace MonoDevelop.PackageManagement.NodeBuilders
{
- public class ProjectPackagesFolderNode
+ internal class ProjectPackagesFolderNode
{
IDotNetProject project;
IUpdatedPackagesInSolution updatedPackagesInSolution;
@@ -54,10 +53,14 @@ namespace MonoDevelop.PackageManagement.NodeBuilders
this.updatedPackagesInSolution = updatedPackagesInSolution;
}
- public DotNetProject Project {
+ public DotNetProject DotNetProject {
get { return project.DotNetProject; }
}
+ internal IDotNetProject Project {
+ get { return project; }
+ }
+
public IconId Icon {
get { return Stock.OpenReferenceFolder; }
}
@@ -129,6 +132,7 @@ namespace MonoDevelop.PackageManagement.NodeBuilders
PackageReferenceNode CreatePackageReferenceNode (PackageReference reference, UpdatedPackagesInProject updatedPackages)
{
return new PackageReferenceNode (
+ this,
reference,
IsPackageInstalled (reference),
false,
@@ -139,6 +143,11 @@ namespace MonoDevelop.PackageManagement.NodeBuilders
{
return reference.IsPackageInstalled (project.DotNetProject);
}
+
+ public void ClearPackageReferences ()
+ {
+ packageReferences = null;
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectPackagesFolderNodeBuilder.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectPackagesFolderNodeBuilder.cs
index 0fd8f7242f..02f8d0d84e 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectPackagesFolderNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectPackagesFolderNodeBuilder.cs
@@ -28,7 +28,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using Gdk;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Components;
@@ -38,7 +38,7 @@ using NuGet;
namespace MonoDevelop.PackageManagement.NodeBuilders
{
- public class ProjectPackagesFolderNodeBuilder : TypeNodeBuilder
+ internal class ProjectPackagesFolderNodeBuilder : TypeNodeBuilder
{
public override Type NodeDataType {
get { return typeof(ProjectPackagesFolderNode); }
@@ -80,9 +80,9 @@ namespace MonoDevelop.PackageManagement.NodeBuilders
List<PackageReferenceNode> nodes = projectPackagesNode.GetPackageReferencesNodes ().ToList ();
- foreach (InstallPackageAction installAction in GetPendingInstallActions (projectPackagesNode.Project)) {
+ foreach (InstallPackageAction installAction in GetPendingInstallActions (projectPackagesNode.DotNetProject)) {
if (!nodes.Any (node => node.Id == installAction.GetPackageId ())) {
- nodes.Add (CreatePackageReferenceNode (installAction));
+ nodes.Add (CreatePackageReferenceNode (projectPackagesNode, installAction));
}
}
@@ -96,9 +96,10 @@ namespace MonoDevelop.PackageManagement.NodeBuilders
return PackageManagementServices.BackgroundPackageActionRunner.PendingInstallActionsForProject (project);
}
- PackageReferenceNode CreatePackageReferenceNode (InstallPackageAction installAction)
+ PackageReferenceNode CreatePackageReferenceNode (ProjectPackagesFolderNode parentNode, InstallPackageAction installAction)
{
return new PackageReferenceNode (
+ parentNode,
new PackageReference (installAction.GetPackageId (), installAction.GetPackageVersion (), null, null, false),
false,
true);
@@ -106,9 +107,7 @@ namespace MonoDevelop.PackageManagement.NodeBuilders
public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
{
- foreach (PackageReferenceNode packageReference in GetPackageReferencesNodes (dataObject)) {
- treeBuilder.AddChild (packageReference);
- }
+ treeBuilder.AddChildren (GetPackageReferencesNodes (dataObject));
}
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectPackagesProjectNodeBuilderExtension.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectPackagesProjectNodeBuilderExtension.cs
index aecc5d8174..b4033cbcf8 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectPackagesProjectNodeBuilderExtension.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectPackagesProjectNodeBuilderExtension.cs
@@ -26,7 +26,7 @@
using System;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui.Components;
@@ -34,7 +34,7 @@ using MonoDevelop.Projects;
namespace MonoDevelop.PackageManagement.NodeBuilders
{
- public class ProjectPackagesProjectNodeBuilderExtension : NodeBuilderExtension
+ internal class ProjectPackagesProjectNodeBuilderExtension : NodeBuilderExtension
{
IPackageManagementEvents packageManagementEvents;
@@ -72,8 +72,8 @@ namespace MonoDevelop.PackageManagement.NodeBuilders
void RefreshAllChildNodes ()
{
- DispatchService.GuiDispatch (() => {
- foreach (DotNetProject project in IdeApp.Workspace.GetAllSolutionItems<DotNetProject> ()) {
+ Runtime.RunInMainThread (() => {
+ foreach (DotNetProject project in IdeApp.Workspace.GetAllItems<DotNetProject> ()) {
RefreshChildNodes (project);
}
});
@@ -83,7 +83,17 @@ namespace MonoDevelop.PackageManagement.NodeBuilders
{
ITreeBuilder builder = Context.GetTreeBuilder (project);
if (builder != null) {
- builder.UpdateChildren ();
+ if (builder.MoveToChild ("References", typeof (ProjectReferenceCollection))) {
+ builder.UpdateAll ();
+ builder.MoveToParent ();
+ }
+
+ if (builder.MoveToChild ("Packages", typeof (ProjectPackagesFolderNode))) {
+ var packagesFolder = (ProjectPackagesFolderNode)builder.DataItem;
+ packagesFolder.ClearPackageReferences ();
+ builder.UpdateAll ();
+ builder.MoveToParent ();
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectReferenceNodeBuilderExtension.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectReferenceNodeBuilderExtension.cs
index 9fdee1fd20..f65d0c2902 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectReferenceNodeBuilderExtension.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectReferenceNodeBuilderExtension.cs
@@ -30,11 +30,11 @@ using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.Ide.Gui.Pads.ProjectPad;
using MonoDevelop.Projects;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement.NodeBuilders
{
- public class ProjectReferenceNodeBuilderExtension : NodeBuilderExtension
+ internal class ProjectReferenceNodeBuilderExtension : NodeBuilderExtension
{
public override bool CanBuildNode (Type dataType)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectReferencesFromPackagesFolderNode.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectReferencesFromPackagesFolderNode.cs
index 6dea1b81be..d6f4bf7270 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectReferencesFromPackagesFolderNode.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectReferencesFromPackagesFolderNode.cs
@@ -25,14 +25,14 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
using System.Collections.Generic;
using System.Linq;
namespace MonoDevelop.PackageManagement.NodeBuilders
{
- public class ProjectReferencesFromPackagesFolderNode
+ internal class ProjectReferencesFromPackagesFolderNode
{
public ProjectReferencesFromPackagesFolderNode (
DotNetProject project,
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectReferencesFromPackagesFolderNodeBuilder.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectReferencesFromPackagesFolderNodeBuilder.cs
index 0705cf9826..aa529a834d 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectReferencesFromPackagesFolderNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectReferencesFromPackagesFolderNodeBuilder.cs
@@ -33,7 +33,7 @@ using System.Linq;
namespace MonoDevelop.PackageManagement.NodeBuilders
{
- public class ProjectReferencesFromPackagesFolderNodeBuilder : TypeNodeBuilder
+ internal class ProjectReferencesFromPackagesFolderNodeBuilder : TypeNodeBuilder
{
public override Type NodeDataType {
get { return typeof(ProjectReferencesFromPackagesFolderNode); }
@@ -65,9 +65,7 @@ namespace MonoDevelop.PackageManagement.NodeBuilders
public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
{
- foreach (ProjectReference projectReference in GetReferencesFromPackages (dataObject)) {
- treeBuilder.AddChild (projectReference);
- }
+ treeBuilder.AddChildren (GetReferencesFromPackages (dataObject));
}
IEnumerable<ProjectReference> GetReferencesFromPackages (object dataObject)
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectReferencesNodeBuilderExtension.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectReferencesNodeBuilderExtension.cs
index 0ec0d6c16e..dd36fc27b8 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectReferencesNodeBuilderExtension.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.NodeBuilders/ProjectReferencesNodeBuilderExtension.cs
@@ -25,13 +25,13 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.Projects;
namespace MonoDevelop.PackageManagement.NodeBuilders
{
- public class ProjectReferencesNodeBuilderExtension : NodeBuilderExtension
+ internal class ProjectReferencesNodeBuilderExtension : NodeBuilderExtension
{
public override bool CanBuildNode (Type dataType)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Refactoring/PackageCodeDiagnosticProvider.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Refactoring/PackageCodeDiagnosticProvider.cs
new file mode 100644
index 0000000000..1b14140a14
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Refactoring/PackageCodeDiagnosticProvider.cs
@@ -0,0 +1,104 @@
+//
+// PackageCodeDiagnosticProvider.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using MonoDevelop.CodeIssues;
+using MonoDevelop.PackageManagement;
+using MonoDevelop.Projects;
+using System.Linq;
+using System.IO;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Threading;
+using System.Threading.Tasks;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide;
+
+namespace MonoDevelop.PackageManagement.Refactoring
+{
+ sealed class PackageCodeDiagnosticProvider : CodeDiagnosticProvider
+ {
+ static readonly Dictionary<Project, AnalyzersFromAssembly> diagnosticCache = new Dictionary<Project, AnalyzersFromAssembly> ();
+
+ static PackageCodeDiagnosticProvider ()
+ {
+ IdeApp.Workspace.SolutionUnloaded += delegate {
+ diagnosticCache.Clear ();
+ };
+ IdeApp.Workspace.ActiveConfigurationChanged += delegate {
+ diagnosticCache.Clear ();
+ };
+ }
+
+ public async override Task<IEnumerable<CodeDiagnosticFixDescriptor>> GetCodeFixDescriptorsAsync (DocumentContext document, string language, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var diags = await GetProjectDiagnosticsAsync (document.Project, language, cancellationToken).ConfigureAwait (false);
+ return diags.Fixes;
+ }
+
+ public async override Task<IEnumerable<CodeDiagnosticDescriptor>> GetCodeDiagnosticDescriptorsAsync (DocumentContext document, string language, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var diags = await GetProjectDiagnosticsAsync (document.Project, language, cancellationToken).ConfigureAwait (false);
+ return diags.Analyzers;
+ }
+
+ public async override Task<IEnumerable<MonoDevelop.CodeActions.CodeRefactoringDescriptor>> GetCodeRefactoringDescriptorsAsync (DocumentContext document, string language, CancellationToken cancellationToken)
+ {
+ var diags = await GetProjectDiagnosticsAsync (document.Project, language, cancellationToken).ConfigureAwait (false);
+ return diags.Refactorings;
+ }
+
+ static Task<AnalyzersFromAssembly> GetProjectDiagnosticsAsync (Project project, string language, CancellationToken cancellationToken)
+ {
+ if (project == null)
+ return Task.FromResult (AnalyzersFromAssembly.Empty);
+ AnalyzersFromAssembly result;
+ if (diagnosticCache.TryGetValue(project, out result))
+ return Task.FromResult (result);
+
+ result = new AnalyzersFromAssembly ();
+
+ var dotNetProject = project as DotNetProject;
+ if (dotNetProject != null) {
+ var proxy = new DotNetProjectProxy (dotNetProject);
+ if (proxy.HasPackages ()) {
+ var packagesPath = new SolutionPackageRepositoryPath (proxy, PackageManagementServices.Options);
+ foreach (var file in Directory.EnumerateFiles (packagesPath.PackageRepositoryPath, "*.dll", SearchOption.AllDirectories)) {
+ cancellationToken.ThrowIfCancellationRequested ();
+ try {
+ var asm = Assembly.LoadFrom (file);
+ result.AddAssembly (asm);
+ } catch (Exception) {
+ }
+ }
+ }
+ }
+ diagnosticCache[project] = result;
+ return Task.FromResult (result);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/ExceptionThrowingProcessPackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/ExceptionThrowingProcessPackageAction.cs
index c224dfaabf..ab04f3fad3 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/ExceptionThrowingProcessPackageAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/ExceptionThrowingProcessPackageAction.cs
@@ -28,7 +28,7 @@ using System;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class ExceptionThrowingProcessPackageAction : TestableProcessPackageAction
+ class ExceptionThrowingProcessPackageAction : TestableProcessPackageAction
{
public Exception ExceptionToThrowInExecuteCore =
new Exception ("Error");
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/ExceptionThrowingRegisteredPackageRepositories.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/ExceptionThrowingRegisteredPackageRepositories.cs
index 19bd75e12a..d67d3e878c 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/ExceptionThrowingRegisteredPackageRepositories.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/ExceptionThrowingRegisteredPackageRepositories.cs
@@ -29,7 +29,7 @@ using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class ExceptionThrowingRegisteredPackageRepositories : FakeRegisteredPackageRepositories
+ class ExceptionThrowingRegisteredPackageRepositories : FakeRegisteredPackageRepositories
{
public Exception ExceptionToThrowWhenActiveRepositoryAccessed { get; set; }
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeBackgroundPackageActionRunner.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeBackgroundPackageActionRunner.cs
index 4be9a1cbb3..f8819225b3 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeBackgroundPackageActionRunner.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeBackgroundPackageActionRunner.cs
@@ -26,12 +26,12 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakeBackgroundPackageActionRunner : IBackgroundPackageActionRunner
+ class FakeBackgroundPackageActionRunner : IBackgroundPackageActionRunner
{
public IEnumerable<InstallPackageAction> PendingInstallActionsForProject (DotNetProject project)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeDotNetProject.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeDotNetProject.cs
index 6f0aeca6d7..7bb4c0cb71 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeDotNetProject.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeDotNetProject.cs
@@ -30,10 +30,11 @@ using MonoDevelop.Core;
using MonoDevelop.Core.Assemblies;
using MonoDevelop.Projects;
using System.Linq;
+using System.Threading.Tasks;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakeDotNetProject : FakeProject, IDotNetProject
+ class FakeDotNetProject : FakeProject, IDotNetProject
{
public FakeDotNetProject ()
{
@@ -81,10 +82,10 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
public Action SaveAction = () => { };
- public override void Save ()
+ public override async Task SaveAsync ()
{
SaveAction ();
- base.Save ();
+ await base.SaveAsync ();
ReferencesWhenSavedCount = References.Count;
FilesAddedWhenSavedCount = FilesAdded.Count;
FilesInProjectWhenSavedCount = Files.Count;
@@ -104,11 +105,9 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
return buildAction;
}
- public List<ImportAndCondition> ImportsAdded = new List<ImportAndCondition> ();
-
public void AddImportIfMissing (string name, string condition)
{
- ImportsAdded.Add (new ImportAndCondition (name, condition));
+ throw new ApplicationException ("Obsolete should not be called.");
}
public List<string> ImportsRemoved = new List <string> ();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeFileService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeFileService.cs
index de138df6cf..8b8d0f3fdd 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeFileService.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeFileService.cs
@@ -28,11 +28,11 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakeFileService : IPackageManagementFileService
+ class FakeFileService : IPackageManagementFileService
{
public string PathPassedToRemoveFile;
public string PathPassedToRemoveDirectory;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeInstallPackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeInstallPackageAction.cs
index e353410e14..792eff1f63 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeInstallPackageAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeInstallPackageAction.cs
@@ -26,12 +26,12 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakeInstallPackageAction : InstallPackageAction
+ class FakeInstallPackageAction : InstallPackageAction
{
public FakeInstallPackageAction ()
: this (null)
@@ -44,8 +44,19 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
}
public FakeInstallPackageAction (IPackageManagementProject project, IPackageManagementEvents packageManagementEvents)
- : base (project, packageManagementEvents)
+ : this (project, packageManagementEvents, new FakeFileRemover (), new FakeLicenseAcceptanceService ())
{
+ }
+
+ public FakeInstallPackageAction (
+ IPackageManagementProject project,
+ IPackageManagementEvents packageManagementEvents,
+ FakeFileRemover fileRemover,
+ FakeLicenseAcceptanceService licenseAcceptanceService)
+ : base (project, packageManagementEvents, fileRemover, licenseAcceptanceService)
+ {
+ FileRemover = fileRemover;
+ LicenseAcceptanceService = licenseAcceptanceService;
Operations = new List<PackageOperation> ();
Logger = new FakeLogger ();
}
@@ -63,6 +74,9 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
}
public Action ExecuteAction = () => { };
+
+ public FakeFileRemover FileRemover;
+ public FakeLicenseAcceptanceService LicenseAcceptanceService;
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeLicenseAcceptanceService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeLicenseAcceptanceService.cs
new file mode 100644
index 0000000000..1ae0c6c837
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeLicenseAcceptanceService.cs
@@ -0,0 +1,45 @@
+//
+// FakeLicenseAcceptanceService.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Linq;
+using System.Collections.Generic;
+using NuGet;
+
+namespace MonoDevelop.PackageManagement.Tests.Helpers
+{
+ public class FakeLicenseAcceptanceService : ILicenseAcceptanceService
+ {
+ public bool AcceptLicensesReturnValue = true;
+ public List<IPackage> PackagesAccepted;
+
+ public bool AcceptLicenses (IEnumerable<IPackage> packages)
+ {
+ PackagesAccepted = packages.ToList ();
+ return AcceptLicensesReturnValue;
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeMachineCache.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeMachineCache.cs
index 04a52331d6..a96a575670 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeMachineCache.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeMachineCache.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeNuGetPackageNewImportsHandler.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeNuGetPackageNewImportsHandler.cs
new file mode 100644
index 0000000000..ac2a71ea6a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeNuGetPackageNewImportsHandler.cs
@@ -0,0 +1,48 @@
+//
+// FakeNuGetPackageNewImportsHandler.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Collections.Generic;
+using NuGet;
+
+namespace MonoDevelop.PackageManagement.Tests.Helpers
+{
+ public class FakeNuGetPackageNewImportsHandler : INuGetPackageNewImportsHandler
+ {
+ public bool IsDisposed;
+ public List<ImportAndCondition> ImportsAdded = new List<ImportAndCondition> ();
+
+ public void AddImportIfMissing (string name, string condition, ProjectImportLocation location)
+ {
+ ImportsAdded.Add (new ImportAndCondition (name, condition, location));
+ }
+
+ public void Dispose ()
+ {
+ IsDisposed = true;
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackage.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackage.cs
index 7ebab31800..b621fe6bd4 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackage.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackage.cs
@@ -28,7 +28,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Versioning;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagementProject.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagementProject.cs
index b4e225fdcf..eb9318b244 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagementProject.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagementProject.cs
@@ -28,13 +28,13 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Versioning;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakePackageManagementProject : IPackageManagementProject
+ class FakePackageManagementProject : IPackageManagementProject
{
public FakePackageManagementProject ()
: this ("Test")
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagementProjectFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagementProjectFactory.cs
index 95d3e04eb0..4fb30c6769 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagementProjectFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagementProjectFactory.cs
@@ -26,13 +26,12 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakePackageManagementProjectFactory : IPackageManagementProjectFactory
+ class FakePackageManagementProjectFactory : IPackageManagementProjectFactory
{
public FakePackageManagementProjectFactory ()
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagementProjectService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagementProjectService.cs
index e473bdf56c..3832caaf4e 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagementProjectService.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagementProjectService.cs
@@ -26,12 +26,12 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakePackageManagementProjectService : IPackageManagementProjectService
+ class FakePackageManagementProjectService : IPackageManagementProjectService
{
public IProject CurrentProject { get; set; }
public ISolution OpenSolution { get; set; }
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagementSolution.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagementSolution.cs
index adfddb3d8e..f2495b0445 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagementSolution.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagementSolution.cs
@@ -27,13 +27,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using MonoDevelop.Projects;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakePackageManagementSolution : IPackageManagementSolution
+ class FakePackageManagementSolution : IPackageManagementSolution
{
public void AddPackageToActiveProjectLocalRepository (FakePackage package)
{
@@ -218,6 +218,11 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
{
SolutionPackageRepository.AddPackageReference (packageId, packageVersion);
}
+
+ public IPackageManagementProject GetProject (IDotNetProject project)
+ {
+ return FakeActiveProject;
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManager.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManager.cs
index a6a3c7787c..21f358b016 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManager.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManager.cs
@@ -27,12 +27,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakePackageManager : ISharpDevelopPackageManager
+ class FakePackageManager : IMonoDevelopPackageManager
{
public FakeProjectManager FakeProjectManager = new FakeProjectManager ();
public FakePackageManagementProjectService FakeProjectService = new FakePackageManagementProjectService ();
@@ -65,7 +64,7 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
public IPackageRepository SourceRepository { get; set; }
- public ISharpDevelopProjectManager ProjectManager { get; set; }
+ public IMonoDevelopProjectManager ProjectManager { get; set; }
public FakePackageRepository FakeSourceRepository = new FakePackageRepository ();
@@ -257,5 +256,9 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
public void AddPackageReference (IPackage package, bool ignoreDependencies, bool allowPrereleaseVersions)
{
}
+
+ public void InstallPackageIntoSolutionRepository (IPackage package)
+ {
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagerFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagerFactory.cs
index e66d160c69..a9e07fa479 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagerFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageManagerFactory.cs
@@ -26,19 +26,19 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakePackageManagerFactory : IPackageManagerFactory
+ class FakePackageManagerFactory : IPackageManagerFactory
{
public FakePackageManager FakePackageManager = new FakePackageManager ();
public IPackageRepository PackageRepositoryPassedToCreatePackageManager;
public IDotNetProject ProjectPassedToCreateRepository;
public ISolutionPackageRepository SolutionPackageRepositoryPassedToCreatePackageManager;
- public ISharpDevelopPackageManager CreatePackageManager (IPackageRepository sourceRepository, IDotNetProject project)
+ public IMonoDevelopPackageManager CreatePackageManager (IPackageRepository sourceRepository, IDotNetProject project)
{
PackageRepositoryPassedToCreatePackageManager = sourceRepository;
ProjectPassedToCreateRepository = project;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageOperationResolverFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageOperationResolverFactory.cs
index 5c66ad1845..7677db192f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageOperationResolverFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageOperationResolverFactory.cs
@@ -25,12 +25,12 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakePackageOperationResolverFactory : IPackageOperationResolverFactory
+ class FakePackageOperationResolverFactory : IPackageOperationResolverFactory
{
public FakePackageOperationResolver FakeInstallPackageOperationResolver = new FakePackageOperationResolver ();
public IPackageRepository LocalRepositoryPassedToCreateInstallPackageOperationsResolver;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageRepository.cs
index 93dea0d78d..2bd4b437bd 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageRepository.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageRepository.cs
@@ -27,12 +27,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakePackageRepository : IRecentPackageRepository, IProgressProvider
+ public class FakePackageRepository : IRecentPackageRepository, IProgressProvider, ICloneableRepository
{
public List<FakePackage> FakePackages = new List<FakePackage> ();
public bool IsRemovePackageCalled;
@@ -91,6 +91,20 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
ProgressAvailable (this, e);
}
}
+
+ public FakePackageRepository ClonedRepository;
+
+ public bool IsCloneOf (FakePackageRepository packageRepository)
+ {
+ return ClonedRepository == packageRepository;
+ }
+
+ public IPackageRepository Clone ()
+ {
+ return new FakePackageRepository () {
+ ClonedRepository = this
+ };
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageRepositoryFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageRepositoryFactory.cs
index cf406c1fd5..ab21fc5b7e 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageRepositoryFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageRepositoryFactory.cs
@@ -26,13 +26,13 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakePackageRepositoryFactory : IPackageRepositoryCache
+ class FakePackageRepositoryFactory : IPackageRepositoryCache
{
public List<string> PackageSourcesPassedToCreateRepository
= new List<string> ();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageRepositoryFactoryEvents.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageRepositoryFactoryEvents.cs
index 867e7c83de..ecf70fad17 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageRepositoryFactoryEvents.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageRepositoryFactoryEvents.cs
@@ -25,11 +25,11 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement.Tests
{
- public class FakePackageRepositoryFactoryEvents : IPackageRepositoryFactoryEvents
+ class FakePackageRepositoryFactoryEvents : IPackageRepositoryFactoryEvents
{
public event EventHandler<PackageRepositoryFactoryEventArgs> RepositoryCreated;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageViewModelFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageViewModelFactory.cs
index 52b88e9c19..e7866e947b 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageViewModelFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackageViewModelFactory.cs
@@ -25,12 +25,12 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakePackageViewModelFactory : IPackageViewModelFactory
+ class FakePackageViewModelFactory : IPackageViewModelFactory
{
public FakePackageManagementSolution FakeSolution = new FakePackageManagementSolution ();
PackageManagementEvents packageManagementEvents = new PackageManagementEvents ();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProcess.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProcess.cs
index 376be932ab..c922d58210 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProcess.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProcess.cs
@@ -25,7 +25,7 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProgressMonitor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProgressMonitor.cs
index a06a2dc3df..3f00df6491 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProgressMonitor.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProgressMonitor.cs
@@ -29,14 +29,15 @@ using System.IO;
using System.Text;
using MonoDevelop.Core;
using NUnit.Framework;
+using System.Threading;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakeProgressMonitor : IProgressMonitor
+ public class FakeProgressMonitor : ProgressMonitor
{
public event MonitorHandler CancelRequested;
- protected virtual void OnCancelRequested (IProgressMonitor monitor)
+ protected virtual void OnCancelRequested (ProgressMonitor monitor)
{
var handler = CancelRequested;
if (handler != null)
@@ -48,7 +49,7 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
Log = new StringWriter (LoggedMessages);
}
- public void BeginTask (string name, int totalWork)
+ protected override void OnBeginTask (string name, int totalWork, int stepWork)
{
BeginTaskTotalWork = totalWork;
}
@@ -59,14 +60,14 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
{
}
- public void EndTask ()
+ protected override void OnEndTask (string name, int totalWork, int stepWork)
{
IsTaskEnded = true;
}
public bool IsTaskEnded;
- public void Step (int work)
+ protected override void OnStep (string message, int work)
{
StepCalledCount++;
TotalStepWork += work;
@@ -75,21 +76,21 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
public int StepCalledCount;
public int TotalStepWork;
- public void ReportWarning (string message)
+ protected override void OnWarningReported (string message)
{
ReportedWarningMessage = message;
}
public string ReportedWarningMessage;
- public void ReportSuccess (string message)
+ protected override void OnSuccessReported (string message)
{
ReportedSuccessMessage = message;
}
public string ReportedSuccessMessage;
- public void ReportError (string message, Exception exception)
+ protected override void OnErrorReported (string message, Exception exception)
{
ReportedErrorMessage = message;
}
@@ -110,13 +111,13 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
Assert.IsFalse (log.Contains (message), log);
}
- public TextWriter Log { get; set; }
public bool IsCancelRequested { get; set; }
- public IAsyncOperation AsyncOperation { get; set; }
+ public AsyncOperation AsyncOperation { get; set; }
public object SyncRoot { get; set; }
- public void Dispose ()
+ public override void Dispose ()
{
+ base.Dispose ();
IsDisposed = true;
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProgressMonitorFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProgressMonitorFactory.cs
index 90e62b3268..f7b28eb358 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProgressMonitorFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProgressMonitorFactory.cs
@@ -34,7 +34,7 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
public FakeProgressMonitor ProgressMonitor = new FakeProgressMonitor ();
public string StatusText;
- public IProgressMonitor CreateProgressMonitor (string statusText)
+ public ProgressMonitor CreateProgressMonitor (string statusText)
{
StatusText = statusText;
return ProgressMonitor;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProject.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProject.cs
index 18971e4641..6debd6da0c 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProject.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProject.cs
@@ -27,10 +27,12 @@
using System;
using System.Collections;
using MonoDevelop.Core;
+using System.Collections.Generic;
+using System.Threading.Tasks;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakeProject : IProject
+ class FakeProject : IProject
{
public string Name { get; set; }
public FilePath FileName { get; set; }
@@ -57,9 +59,14 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
public bool IsSaved;
- public virtual void Save ()
+ public virtual Task SaveAsync ()
{
IsSaved = true;
+ return Task.FromResult (0);
+ }
+
+ public IEnumerable<string> FlavorGuids {
+ get { yield break; }
}
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProjectManager.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProjectManager.cs
index 9cbbe9b1cc..f279c7c4e6 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProjectManager.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProjectManager.cs
@@ -25,13 +25,13 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using System.Collections.Generic;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakeProjectManager : ISharpDevelopProjectManager
+ public class FakeProjectManager : IMonoDevelopProjectManager
{
public FakePackageRepository FakeLocalRepository {
get { return LocalRepository as FakePackageRepository; }
@@ -55,8 +55,13 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
protected virtual void OnPackageReferenceAdded (IPackage package)
{
+ OnPackageReferenceAdded (new PackageOperationEventArgs (package, null, String.Empty));
+ }
+
+ protected virtual void OnPackageReferenceAdded (PackageOperationEventArgs eventArgs)
+ {
if (PackageReferenceAdded != null) {
- PackageReferenceAdded (this, new PackageOperationEventArgs (package, null, String.Empty));
+ PackageReferenceAdded (this, eventArgs);
}
}
@@ -115,6 +120,11 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
OnPackageReferenceAdded (package);
}
+ public void FirePackageReferenceAdded (PackageOperationEventArgs eventArgs)
+ {
+ OnPackageReferenceAdded (eventArgs);
+ }
+
public void FirePackageReferenceRemoved (IPackage package)
{
FirePackageReferenceRemoved (new PackageOperationEventArgs (package, null, String.Empty));
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProjectSystemFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProjectSystemFactory.cs
index fc88fcd103..5cca970fb0 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProjectSystemFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeProjectSystemFactory.cs
@@ -25,13 +25,13 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakeProjectSystemFactory : ISharpDevelopProjectSystemFactory
+ public class FakeProjectSystemFactory : IMonoDevelopProjectSystemFactory
{
public FakeProjectSystem FakeProjectSystem = new FakeProjectSystem ();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeRecentPackageRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeRecentPackageRepository.cs
index b9ba5142c3..fe607f739d 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeRecentPackageRepository.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeRecentPackageRepository.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeRegisteredPackageRepositories.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeRegisteredPackageRepositories.cs
index 77b047d9b5..c7ac9bef61 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeRegisteredPackageRepositories.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeRegisteredPackageRepositories.cs
@@ -26,12 +26,12 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakeRegisteredPackageRepositories : IRegisteredPackageRepositories
+ class FakeRegisteredPackageRepositories : IRegisteredPackageRepositories
{
public FakeRegisteredPackageRepositories ()
{
@@ -96,7 +96,7 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
public PackageSource AddOnePackageSource (string name)
{
- var source = new PackageSource ("http://sharpdevelop.codeplex.com", name);
+ var source = new PackageSource ("http://monodevelop.codeplex.com", name);
PackageSources.Add (source);
return source;
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSettings.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSettings.cs
index 24b3593320..0ea24e7221 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSettings.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSettings.cs
@@ -26,7 +26,7 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using System.Linq;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSolution.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSolution.cs
index ff5cc14ba2..38b766b63f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSolution.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSolution.cs
@@ -31,7 +31,7 @@ using MonoDevelop.Projects;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakeSolution : ISolution
+ class FakeSolution : ISolution
{
public FilePath BaseDirectory { get; set; }
public FilePath FileName { get; set; }
@@ -65,6 +65,15 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
ProjectAdded (this, new DotNetProjectEventArgs (project));
}
}
+
+ public event EventHandler<DotNetProjectEventArgs> ProjectRemoved;
+
+ public void RaiseProjectRemovedEvent (IDotNetProject project)
+ {
+ if (ProjectRemoved != null) {
+ ProjectRemoved (this, new DotNetProjectEventArgs (project));
+ }
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSolutionPackageRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSolutionPackageRepository.cs
index f7a3ec399a..2671eb0fff 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSolutionPackageRepository.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSolutionPackageRepository.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSolutionPackageRepositoryFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSolutionPackageRepositoryFactory.cs
index 4cc0386417..cedda70399 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSolutionPackageRepositoryFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSolutionPackageRepositoryFactory.cs
@@ -25,11 +25,11 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakeSolutionPackageRepositoryFactory : ISolutionPackageRepositoryFactory
+ class FakeSolutionPackageRepositoryFactory : ISolutionPackageRepositoryFactory
{
public FakeSolutionPackageRepository FakeSolutionPackageRepository = new FakeSolutionPackageRepository ();
public ISolution SolutionPassedToCreateSolutionPackageRepository;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeTask.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeTask.cs
index 0743a8ba33..f22870d226 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeTask.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeTask.cs
@@ -25,11 +25,11 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakeTask<TResult> : ITask<TResult>
+ class FakeTask<TResult> : ITask<TResult>
{
public bool IsStartCalled;
public bool IsCancelCalled;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeTaskFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeTaskFactory.cs
index 70e5a37e08..4f6fcfa20e 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeTaskFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeTaskFactory.cs
@@ -26,12 +26,12 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakeTaskFactory : ITaskFactory
+ class FakeTaskFactory : ITaskFactory
{
public bool IsCreateTaskCalled;
public bool RunTasksSynchronously;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeUninstallPackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeUninstallPackageAction.cs
index 2e8bdfe0b1..1e5777b56b 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeUninstallPackageAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeUninstallPackageAction.cs
@@ -25,11 +25,11 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakeUninstallPackageAction : UninstallPackageAction
+ class FakeUninstallPackageAction : UninstallPackageAction
{
public bool IsExecuted;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeUpdatePackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeUpdatePackageAction.cs
index 069cc62210..5da205d6dd 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeUpdatePackageAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeUpdatePackageAction.cs
@@ -25,15 +25,17 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakeUpdatePackageAction : UpdatePackageAction
+ class FakeUpdatePackageAction : UpdatePackageAction
{
public bool IsExecuted;
public FakePackageManagementProject FakeProject;
+ public FakeFileRemover FileRemover;
+ public FakeLicenseAcceptanceService LicenseAcceptanceService;
public FakeUpdatePackageAction ()
: this (new FakePackageManagementProject ())
@@ -41,11 +43,23 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
}
public FakeUpdatePackageAction (IPackageManagementProject project)
- : base (project, null)
+ : this (project, null, new FakeFileRemover (), new FakeLicenseAcceptanceService ())
{
FakeProject = project as FakePackageManagementProject;
}
+ public FakeUpdatePackageAction (
+ IPackageManagementProject project,
+ IPackageManagementEvents packageManagementEvents,
+ FakeFileRemover fileRemover,
+ FakeLicenseAcceptanceService licenseAcceptanceService)
+ : base (project, packageManagementEvents, fileRemover, licenseAcceptanceService)
+ {
+ FakeProject = project as FakePackageManagementProject;
+ FileRemover = fileRemover;
+ LicenseAcceptanceService = licenseAcceptanceService;
+ }
+
protected override void ExecuteCore ()
{
IsExecuted = true;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeUpdatedPackagesInSolution.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeUpdatedPackagesInSolution.cs
index bc0bfa4791..2f940c8df0 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeUpdatedPackagesInSolution.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeUpdatedPackagesInSolution.cs
@@ -31,7 +31,7 @@ using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class FakeUpdatedPackagesInSolution : IUpdatedPackagesInSolution
+ class FakeUpdatedPackagesInSolution : IUpdatedPackagesInSolution
{
public List<UpdatedPackagesInProject> ProjectsWithUpdatedPackages = new List<UpdatedPackagesInProject> ();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/ImportAndCondition.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/ImportAndCondition.cs
index 33b99da2fb..c073ef5e2e 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/ImportAndCondition.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/ImportAndCondition.cs
@@ -1,43 +1,50 @@
-//
-// ImportAndCondition.cs
-//
-// Author:
-// Matt Ward <matt.ward@xamarin.com>
-//
-// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
+//
+// ImportAndCondition.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using NuGet;
+
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
public class ImportAndCondition
- {
- public ImportAndCondition (string name, string condition)
+ {
+ public ImportAndCondition (string name, string condition)
+ : this (name, condition, ProjectImportLocation.Bottom)
+ {
+ }
+
+ public ImportAndCondition (string name, string condition, ProjectImportLocation location)
{
Name = name;
- Condition = condition;
+ Condition = condition;
+ Location = location;
}
public string Name { get; set; }
- public string Condition { get; set; }
+ public string Condition { get; set; }
+ public ProjectImportLocation Location { get; set; }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/InstallPackageHelper.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/InstallPackageHelper.cs
index 303cc48702..5b19ebb45f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/InstallPackageHelper.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/InstallPackageHelper.cs
@@ -26,12 +26,12 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class InstallPackageHelper
+ class InstallPackageHelper
{
InstallPackageAction action;
@@ -64,7 +64,7 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
return package;
}
- public PackageSource PackageSource = new PackageSource ("http://sharpdevelop/packages");
+ public PackageSource PackageSource = new PackageSource ("http://monodevelop/packages");
public bool IgnoreDependencies;
public bool AllowPrereleaseVersions;
public SemanticVersion Version;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/OneRegisteredPackageSourceHelper.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/OneRegisteredPackageSourceHelper.cs
index 1f48502c50..0dc030e9a1 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/OneRegisteredPackageSourceHelper.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/OneRegisteredPackageSourceHelper.cs
@@ -25,16 +25,16 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class OneRegisteredPackageSourceHelper
+ class OneRegisteredPackageSourceHelper
{
public TestablePackageManagementOptions Options;
public FakeSettings FakeSettings;
- public PackageSource PackageSource = new PackageSource ("http://sharpdevelop.com", "Test Package Source");
+ public PackageSource PackageSource = new PackageSource ("http://monodevelop.com", "Test Package Source");
public RegisteredPackageSources RegisteredPackageSources {
get { return Options.PackageSources; }
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/PackageCollectionAssert.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/PackageCollectionAssert.cs
index 7b2e29d67c..4462399efa 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/PackageCollectionAssert.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/PackageCollectionAssert.cs
@@ -26,13 +26,13 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using NUnit.Framework;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public static class PackageCollectionAssert
+ static class PackageCollectionAssert
{
public static void AreEqual (IEnumerable<IPackage> expectedPackages, IEnumerable<PackageViewModel> actualViewModels)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/PackageSourceCollectionAssert.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/PackageSourceCollectionAssert.cs
index 8d4d19074b..9c0a1389ab 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/PackageSourceCollectionAssert.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/PackageSourceCollectionAssert.cs
@@ -26,12 +26,12 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class PackageSourceCollectionAssert
+ class PackageSourceCollectionAssert
{
public static void AreEqual (IEnumerable<PackageSource> expectedSources, IEnumerable<PackageSourceViewModel> actualViewModels)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/PageCollectionAssert.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/PageCollectionAssert.cs
index a09c580545..cd87754a84 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/PageCollectionAssert.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/PageCollectionAssert.cs
@@ -26,12 +26,12 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NUnit.Framework;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public static class PageCollectionAssert
+ static class PageCollectionAssert
{
public static void AreEqual (IEnumerable<Page> expectedPages, IEnumerable<Page> actualPages)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/RecentPackageInfoCollectionAssert.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/RecentPackageInfoCollectionAssert.cs
index 970b49e684..a005c9fabe 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/RecentPackageInfoCollectionAssert.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/RecentPackageInfoCollectionAssert.cs
@@ -26,11 +26,11 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public static class RecentPackageInfoCollectionAssert
+ static class RecentPackageInfoCollectionAssert
{
public static void AreEqual (IEnumerable<RecentPackageInfo> expectedPackages, IEnumerable<RecentPackageInfo> actualPackages)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/SelectedProjectCollectionAssert.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/SelectedProjectCollectionAssert.cs
index aa8cb49aac..166509a9e2 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/SelectedProjectCollectionAssert.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/SelectedProjectCollectionAssert.cs
@@ -26,12 +26,12 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NUnit.Framework;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public static class SelectedProjectCollectionAssert
+ static class SelectedProjectCollectionAssert
{
public static void AreEqual (
IEnumerable<IPackageManagementSelectedProject> expected,
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableBackgroundPackageActionRunner.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableBackgroundPackageActionRunner.cs
index 0bcbdb5ac4..702d9d07e9 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableBackgroundPackageActionRunner.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableBackgroundPackageActionRunner.cs
@@ -26,16 +26,16 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.Ide;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class TestableBackgroundPackageActionRunner : BackgroundPackageActionRunner
+ class TestableBackgroundPackageActionRunner : BackgroundPackageActionRunner
{
- public List<MessageHandler> BackgroundDispatchersQueued = new List<MessageHandler> ();
+ public List<Action> BackgroundActionsQueued = new List<Action> ();
public TestableBackgroundPackageActionRunner (
IPackageManagementProgressMonitorFactory progressMonitorFactory,
@@ -56,46 +56,35 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
public void ExecuteSingleBackgroundDispatch ()
{
- BackgroundDispatchersQueued [0].Invoke ();
- BackgroundDispatchersQueued.RemoveAt (0);
+ BackgroundActionsQueued [0].Invoke ();
+ BackgroundActionsQueued.RemoveAt (0);
}
public void ExecuteBackgroundDispatch ()
{
- foreach (MessageHandler dispatcher in BackgroundDispatchersQueued) {
- dispatcher.Invoke ();
+ foreach (Action action in BackgroundActionsQueued) {
+ action ();
}
- BackgroundDispatchersQueued.Clear ();
+ BackgroundActionsQueued.Clear ();
}
- protected override void BackgroundDispatch (MessageHandler handler)
+ protected override void BackgroundDispatch (Action action)
{
- BackgroundDispatchersQueued.Add (handler);
+ BackgroundActionsQueued.Add (action);
}
- public bool InvokeBackgroundDispatchAndWaitImmediately = true;
-
- protected override void BackgroundDispatchAndWait (MessageHandler handler)
- {
- if (InvokeBackgroundDispatchAndWaitImmediately) {
- handler.Invoke ();
- } else {
- BackgroundDispatchersQueued.Add (handler);
- }
- }
-
- protected override void GuiDispatch (MessageHandler handler)
+ protected override void GuiDispatch (Action action)
{
- handler.Invoke ();
+ action ();
}
- public Func<IProgressMonitor,
+ public Func<ProgressMonitor,
IPackageManagementEvents,
IProgressProvider,
PackageManagementEventsMonitor> CreateEventMonitorAction;
protected override PackageManagementEventsMonitor CreateEventMonitor (
- IProgressMonitor monitor,
+ ProgressMonitor monitor,
IPackageManagementEvents packageManagementEvents,
IProgressProvider progressProvider)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableCheckForUpdatesTaskRunner.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableCheckForUpdatesTaskRunner.cs
index 6744012901..7493238378 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableCheckForUpdatesTaskRunner.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableCheckForUpdatesTaskRunner.cs
@@ -26,12 +26,12 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Ide;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class TestableCheckForUpdatesTaskRunner : CheckForUpdatesTaskRunner
+ class TestableCheckForUpdatesTaskRunner : CheckForUpdatesTaskRunner
{
public List<string> LoggedErrorMessages = new List<string> ();
public List<Exception> LoggedExceptions = new List<Exception> ();
@@ -41,11 +41,6 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
{
}
- protected override void GuiBackgroundDispatch (MessageHandler handler)
- {
- handler.Invoke ();
- }
-
protected override void LogError (string message, Exception ex)
{
LoggedErrorMessages.Add (message);
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableInstallPackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableInstallPackageAction.cs
index 31cc20bd58..0185597a5b 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableInstallPackageAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableInstallPackageAction.cs
@@ -25,18 +25,29 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class TestableInstallPackageAction : InstallPackageAction
+ class TestableInstallPackageAction : InstallPackageAction
{
public TestableInstallPackageAction (
IPackageManagementProject project,
IPackageManagementEvents packageManagementEvents,
FakeFileRemover fileRemover)
- : base (project, packageManagementEvents, fileRemover)
+ : this (project, packageManagementEvents, fileRemover, new FakeLicenseAcceptanceService ())
{
+ }
+
+ public TestableInstallPackageAction (
+ IPackageManagementProject project,
+ IPackageManagementEvents packageManagementEvents,
+ FakeFileRemover fileRemover,
+ FakeLicenseAcceptanceService licenseAcceptanceService)
+ : base (project, packageManagementEvents, fileRemover, licenseAcceptanceService)
+ {
+ LicenseAcceptanceService = licenseAcceptanceService;
+
CreateOpenPackageReadMeMonitorAction = packageId => {
IOpenPackageReadMeMonitor monitor = base.CreateOpenPackageReadMeMonitor (packageId);
OpenPackageReadMeMonitor = monitor as OpenPackageReadMeMonitor;
@@ -54,6 +65,8 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
}
public bool NullOpenPackageReadMeMonitorIsCreated;
+
+ public FakeLicenseAcceptanceService LicenseAcceptanceService;
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableMonoDevelopProjectSystem.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableMonoDevelopProjectSystem.cs
index 708e46f146..145b665048 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableMonoDevelopProjectSystem.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableMonoDevelopProjectSystem.cs
@@ -26,12 +26,13 @@
using System;
using System.IO;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Ide;
+using System.Threading.Tasks;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class TestableMonoDevelopProjectSystem : SharpDevelopProjectSystem
+ class TestableMonoDevelopProjectSystem : MonoDevelopProjectSystem
{
public string PathPassedToPhysicalFileSystemAddFile;
public Stream StreamPassedToPhysicalFileSystemAddFile;
@@ -46,8 +47,10 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
public ReferenceAndProjectName ReferenceAndProjectNamePassedToLogAddedReferenceToProject;
public ReferenceAndProjectName ReferenceAndProjectNamePassedToLogRemovedReferenceFromProject;
public FileNameAndProjectName FileNameAndProjectNamePassedToLogAddedFileToProject;
+ public FakeNuGetPackageNewImportsHandler NewImportsHandler;
- public static Action<MessageHandler> GuiSyncDispatcher = handler => handler.Invoke ();
+ public static Action<Action> GuiSyncDispatcher = handler => handler.Invoke ();
+ public static Func<Func<Task>,Task> GuiSyncDispatcherFunc = handler => handler.Invoke();
public TestableMonoDevelopProjectSystem (IDotNetProject project)
: this (
@@ -65,7 +68,7 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
IPackageManagementProjectService projectService,
PackageManagementEvents packageManagementEvents,
FakeLogger logger)
- : base (project, fileService, projectService, packageManagementEvents, GuiSyncDispatcher)
+ : base (project, fileService, projectService, packageManagementEvents, GuiSyncDispatcher, GuiSyncDispatcherFunc)
{
FakeFileService = (FakeFileService)fileService;
FakeProjectService = (FakePackageManagementProjectService)projectService;
@@ -117,6 +120,12 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
FileNameAndProjectNamePassedToLogAddedFileToProject =
new FileNameAndProjectName (fileName, projectName);
}
+
+ protected override INuGetPackageNewImportsHandler CreateNewImportsHandler ()
+ {
+ NewImportsHandler = new FakeNuGetPackageNewImportsHandler ();
+ return NewImportsHandler;
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageCompatibilityChecker.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageCompatibilityChecker.cs
index e675032f49..877dbe3a14 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageCompatibilityChecker.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageCompatibilityChecker.cs
@@ -25,13 +25,13 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using MonoDevelop.Ide;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class TestablePackageCompatibilityChecker : PackageCompatibilityChecker
+ class TestablePackageCompatibilityChecker : PackageCompatibilityChecker
{
public TestablePackageCompatibilityChecker (
IPackageManagementSolution solution,
@@ -47,7 +47,7 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
return PackageReferenceFile;
}
- protected override void GuiDispatch (MessageHandler handler)
+ protected override void GuiDispatch (Action handler)
{
handler.Invoke ();
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageCompatibilityRunner.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageCompatibilityRunner.cs
index 2ebee582a5..ebfa45b83f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageCompatibilityRunner.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageCompatibilityRunner.cs
@@ -25,16 +25,16 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using MonoDevelop.Core;
using MonoDevelop.Ide;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class TestablePackageCompatibilityRunner : PackageCompatibilityRunner
+ class TestablePackageCompatibilityRunner : PackageCompatibilityRunner
{
- MessageHandler backgroundDispatcher;
+ Action backgroundDispatcher;
public TestablePackageCompatibilityRunner (
IDotNetProject project,
@@ -59,13 +59,13 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
backgroundDispatcher.Invoke ();
}
- protected override void BackgroundDispatch (MessageHandler handler)
+ protected override void BackgroundDispatch (Action action)
{
- backgroundDispatcher = handler;
+ backgroundDispatcher = action;
}
protected override PackageManagementEventsMonitor CreateEventMonitor (
- IProgressMonitor monitor,
+ ProgressMonitor monitor,
IPackageManagementEvents packageManagementEvents,
IProgressProvider progressProvider)
{
@@ -97,7 +97,7 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
public bool PackageConsoleIsShown;
- protected override void ShowPackageConsole (IProgressMonitor progressMonitor)
+ protected override void ShowPackageConsole (ProgressMonitor progressMonitor)
{
PackageConsoleIsShown = true;
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageFromRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageFromRepository.cs
index ec2d653666..1af31686a7 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageFromRepository.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageFromRepository.cs
@@ -25,11 +25,11 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class TestablePackageFromRepository : PackageFromRepository
+ class TestablePackageFromRepository : PackageFromRepository
{
public FakePackage FakePackagePassedToConstructor;
public FakePackageRepository FakePackageRepositoryPassedToConstructor;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageManagementEventsMonitor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageManagementEventsMonitor.cs
index 0c114f4535..e108b80d57 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageManagementEventsMonitor.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageManagementEventsMonitor.cs
@@ -26,17 +26,17 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Ide;
using MonoDevelop.Core;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class TestablePackageManagementEventsMonitor : PackageManagementEventsMonitor
+ class TestablePackageManagementEventsMonitor : PackageManagementEventsMonitor
{
public TestablePackageManagementEventsMonitor (
- IProgressMonitor progressMonitor,
+ ProgressMonitor progressMonitor,
IPackageManagementEvents packageManagementEvents,
IProgressProvider progressProvider)
: base (progressMonitor, packageManagementEvents, progressProvider)
@@ -50,19 +50,19 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
FilesChanged.AddRange (files);
}
- protected override void GuiSyncDispatch (MessageHandler handler)
+ protected override void GuiSyncDispatch (Action action)
{
- handler.Invoke ();
+ action.Invoke ();
}
- protected override void ShowPackageConsole (IProgressMonitor progressMonitor)
+ protected override void ShowPackageConsole (ProgressMonitor progressMonitor)
{
IsPackageConsoleShown = true;
ProgressMonitorPassedToShowPackageConsole = progressMonitor;
}
public bool IsPackageConsoleShown;
- public IProgressMonitor ProgressMonitorPassedToShowPackageConsole;
+ public ProgressMonitor ProgressMonitorPassedToShowPackageConsole;
protected override void ReconnectAssemblyReferences (IPackageManagementProject project)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageManagementOptions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageManagementOptions.cs
index 365d634fc9..826a775458 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageManagementOptions.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageManagementOptions.cs
@@ -25,12 +25,12 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class TestablePackageManagementOptions : PackageManagementOptions
+ class TestablePackageManagementOptions : PackageManagementOptions
{
public Properties Properties;
public FakeSettings FakeSettings;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageViewModel.cs
index 94d0a57325..283815f95d 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageViewModel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackageViewModel.cs
@@ -1,10 +1,10 @@
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class TestablePackageViewModel : PackageViewModel
+ class TestablePackageViewModel : PackageViewModel
{
public FakePackageManagementSolution FakeSolution;
public PackageManagementEvents PackageManagementEvents;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackagesViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackagesViewModel.cs
index fb05a1aa84..0d3b9259df 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackagesViewModel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestablePackagesViewModel.cs
@@ -28,12 +28,12 @@ using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class TestablePackagesViewModel : PackagesViewModel
+ class TestablePackagesViewModel : PackagesViewModel
{
public FakeRegisteredPackageRepositories FakeRegisteredPackageRepositories;
public FakeTaskFactory FakeTaskFactory;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableProcessPackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableProcessPackageAction.cs
index b85eb37b2d..38939273ff 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableProcessPackageAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableProcessPackageAction.cs
@@ -24,11 +24,11 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class TestableProcessPackageAction : ProcessPackageAction
+ class TestableProcessPackageAction : ProcessPackageAction
{
public FakePackageManagementProject FakeProject;
public PackageManagementEvents PackageManagementEvents;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableProjectManager.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableProjectManager.cs
index 068652c3d3..bcc0ed0e9e 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableProjectManager.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableProjectManager.cs
@@ -26,12 +26,12 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class TestableProjectManager : SharpDevelopProjectManager
+ class TestableProjectManager : MonoDevelopProjectManager
{
public IPackage PackagePassedToAddPackageReference;
public bool IgnoreDependenciesPassedToAddPackageReference;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableProjectPackagesFolderNode.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableProjectPackagesFolderNode.cs
index 6e54edd67b..9351ca65b0 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableProjectPackagesFolderNode.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableProjectPackagesFolderNode.cs
@@ -31,7 +31,7 @@ using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class TestableProjectPackagesFolderNode : ProjectPackagesFolderNode
+ class TestableProjectPackagesFolderNode : ProjectPackagesFolderNode
{
public TestableProjectPackagesFolderNode (
IDotNetProject project,
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableSolutionPackageRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableSolutionPackageRepository.cs
index 78cbae75c9..68fb33cc77 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableSolutionPackageRepository.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableSolutionPackageRepository.cs
@@ -25,16 +25,16 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class TestableSolutionPackageRepository : SolutionPackageRepository
+ class TestableSolutionPackageRepository : SolutionPackageRepository
{
public TestableSolutionPackageRepository (
ISolution solution,
- ISharpDevelopPackageRepositoryFactory repositoryFactory,
+ IMonoDevelopPackageRepositoryFactory repositoryFactory,
PackageManagementOptions options)
: base (solution, repositoryFactory, options)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableUpdatePackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableUpdatePackageAction.cs
index 01cb896f23..da0456771f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableUpdatePackageAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableUpdatePackageAction.cs
@@ -25,18 +25,28 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class TestableUpdatePackageAction : UpdatePackageAction
+ class TestableUpdatePackageAction : UpdatePackageAction
{
public TestableUpdatePackageAction (
IPackageManagementProject project,
IPackageManagementEvents packageManagementEvents,
IFileRemover fileRemover)
- : base (project, packageManagementEvents, fileRemover)
+ : this (project, packageManagementEvents, fileRemover, new FakeLicenseAcceptanceService ())
{
+ }
+
+ public TestableUpdatePackageAction (
+ IPackageManagementProject project,
+ IPackageManagementEvents packageManagementEvents,
+ IFileRemover fileRemover,
+ FakeLicenseAcceptanceService licenseAcceptanceService)
+ : base (project, packageManagementEvents, fileRemover, licenseAcceptanceService)
+ {
+ LicenseAcceptanceService = licenseAcceptanceService;
CreateOpenPackageReadMeMonitorAction = packageId => {
OpenPackageReadMeMonitor = base.CreateOpenPackageReadMeMonitor (packageId) as OpenPackageReadMeMonitor;
return OpenPackageReadMeMonitor;
@@ -50,6 +60,8 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
{
return CreateOpenPackageReadMeMonitorAction (packageId);
}
+
+ public FakeLicenseAcceptanceService LicenseAcceptanceService;
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableUpdatedPackagesInSolution.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableUpdatedPackagesInSolution.cs
index 03e0f88235..391bf97b96 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableUpdatedPackagesInSolution.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableUpdatedPackagesInSolution.cs
@@ -25,12 +25,12 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Ide;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class TestableUpdatedPackagesInSolution : UpdatedPackagesInSolution
+ class TestableUpdatedPackagesInSolution : UpdatedPackagesInSolution
{
public TestableUpdatedPackagesInSolution (
IPackageManagementSolution solution,
@@ -48,9 +48,9 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
};
}
- protected override void GuiDispatch (MessageHandler handler)
+ protected override void GuiDispatch (Action action)
{
- handler.Invoke ();
+ action.Invoke ();
}
public Func<string, bool> FileExistsAction;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableViewModelBase.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableViewModelBase.cs
index 37656ef548..76128eaa28 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableViewModelBase.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableViewModelBase.cs
@@ -25,11 +25,11 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class TestableViewModelBase : ViewModelBase<TestableViewModelBase>
+ class TestableViewModelBase : ViewModelBase<TestableViewModelBase>
{
public string MyProperty { get; set; }
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/UninstallPackageHelper.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/UninstallPackageHelper.cs
index 3139f5a247..e6eed525b0 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/UninstallPackageHelper.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/UninstallPackageHelper.cs
@@ -25,12 +25,12 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class UninstallPackageHelper
+ class UninstallPackageHelper
{
UninstallPackageAction action;
@@ -50,7 +50,7 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
}
public SemanticVersion Version;
- public PackageSource PackageSource = new PackageSource ("http://sharpdevelop.net");
+ public PackageSource PackageSource = new PackageSource ("http://monodevelop.net");
public bool ForceRemove;
public bool RemoveDependencies;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/UpdatePackageHelper.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/UpdatePackageHelper.cs
index 1a61cddd71..26da8b9e5a 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/UpdatePackageHelper.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/UpdatePackageHelper.cs
@@ -26,12 +26,12 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public class UpdatePackageHelper
+ class UpdatePackageHelper
{
UpdatePackageAction action;
@@ -63,7 +63,7 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
return package;
}
- public PackageSource PackageSource = new PackageSource ("http://sharpdevelop/packages");
+ public PackageSource PackageSource = new PackageSource ("http://monodevelop/packages");
public bool UpdateDependencies;
public bool AllowPrereleaseVersions;
public SemanticVersion Version;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.csproj b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.csproj
index 71f6d04262..ac04c8f64c 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.csproj
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.csproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<ProjectGuid>{2645C9F3-9ED5-4806-AB09-DAD9BE90C67B}</ProjectGuid>
@@ -212,6 +212,8 @@
<Compile Include="MonoDevelop.PackageManagement.Tests\DotNetProjectExtensionsTests.cs" />
<Compile Include="MonoDevelop.PackageManagement.Tests.Helpers\TestableCheckForUpdatesTaskRunner.cs" />
<Compile Include="MonoDevelop.PackageManagement.Tests\MinClientVersionTests.cs" />
+ <Compile Include="MonoDevelop.PackageManagement.Tests.Helpers\FakeLicenseAcceptanceService.cs" />
+ <Compile Include="MonoDevelop.PackageManagement.Tests.Helpers\FakeNuGetPackageNewImportsHandler.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/AvailablePackagesViewModelTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/AvailablePackagesViewModelTests.cs
index 86cdc0025d..845d13fa87 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/AvailablePackagesViewModelTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/AvailablePackagesViewModelTests.cs
@@ -24,28 +24,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy of this
-// software and associated documentation files (the "Software"), to deal in the Software
-// without restriction, including without limitation the rights to use, copy, modify, merge,
-// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
-// to whom the Software is furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all copies or
-// substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
-// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-// DEALINGS IN THE SOFTWARE.
-
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NuGet;
using NUnit.Framework;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/BackgroundPackageActionRunnerTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/BackgroundPackageActionRunnerTests.cs
index cc692abc1d..34e787f129 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/BackgroundPackageActionRunnerTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/BackgroundPackageActionRunnerTests.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NUnit.Framework;
using NuGet;
@@ -76,18 +76,6 @@ namespace MonoDevelop.PackageManagement.Tests
runner.Run (progressMessage, actions);
}
- void RunAndWait ()
- {
- runner.InvokeBackgroundDispatchAndWaitImmediately = true;
- runner.RunAndWait (progressMessage, actions);
- }
-
- void RunAndWaitWithoutBackgroundDispatch ()
- {
- runner.InvokeBackgroundDispatchAndWaitImmediately = false;
- runner.RunAndWait (progressMessage, actions);
- }
-
FakeInstallPackageAction AddInstallAction ()
{
var action = new FakeInstallPackageAction (new FakePackageManagementProject (), packageManagementEvents);
@@ -119,6 +107,7 @@ namespace MonoDevelop.PackageManagement.Tests
operations.Add (new PackageOperation (package, PackageAction.Install));
action.Operations = operations;
action.Package = package;
+ action.LicensesMustBeAccepted = false;
}
void AddInstallActionWithMissingPackageId (string packageId = "Unknown")
@@ -567,26 +556,6 @@ namespace MonoDevelop.PackageManagement.Tests
}
[Test]
- public void IsRunning_OneUninstallActionAndRunAndWaitCalledButDispatcherNotComplete_IsRunningIsTrue ()
- {
- CreateRunner ();
- AddUninstallAction ();
- RunAndWaitWithoutBackgroundDispatch ();
-
- Assert.IsTrue (runner.IsRunning);
- }
-
- [Test]
- public void IsRunning_OneUninstallActionAndRunAndWaitCalledAndDispatcherCompletes_IsRunningIsFalse ()
- {
- CreateRunner ();
- AddUninstallAction ();
- RunAndWait ();
-
- Assert.IsFalse (runner.IsRunning);
- }
-
- [Test]
public void IsRunning_ExceptionThrownRunningBackgroundDispatcher_IsRunningIsFalse ()
{
CreateRunner ();
@@ -599,20 +568,6 @@ namespace MonoDevelop.PackageManagement.Tests
Assert.IsFalse (runner.IsRunning);
}
-
- [Test]
- public void IsRunning_ExceptionThrownRunningBackgroundDispatcherWithRunAndWait_IsRunningIsFalse ()
- {
- CreateRunner ();
- AddUninstallAction ();
- runner.CreateEventMonitorAction = (monitor, packageManagementEvents, progressProvider) => {
- throw new ApplicationException ("Error");
- };
-
- RunAndWait ();
-
- Assert.IsFalse (runner.IsRunning);
- }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/DelegateCommandTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/DelegateCommandTests.cs
index eee4b6f1da..2f50d599f9 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/DelegateCommandTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/DelegateCommandTests.cs
@@ -25,7 +25,7 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NUnit.Framework;
namespace MonoDevelop.PackageManagement.Tests
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/DotNetProjectExtensionsTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/DotNetProjectExtensionsTests.cs
index a0d6d171cc..338491bd76 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/DotNetProjectExtensionsTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/DotNetProjectExtensionsTests.cs
@@ -25,7 +25,7 @@
// THE SOFTWARE.
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NUnit.Framework;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/EnsureNuGetPackageBuildImportsTargetUpdaterTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/EnsureNuGetPackageBuildImportsTargetUpdaterTests.cs
index 7d3887e3ee..10d81693ac 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/EnsureNuGetPackageBuildImportsTargetUpdaterTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/EnsureNuGetPackageBuildImportsTargetUpdaterTests.cs
@@ -26,7 +26,7 @@
using System;
using System.Linq;
-using MonoDevelop.Projects.Formats.MSBuild;
+using MonoDevelop.Projects.MSBuild;
using NUnit.Framework;
namespace MonoDevelop.PackageManagement.Tests
@@ -41,7 +41,7 @@ namespace MonoDevelop.PackageManagement.Tests
void CreateMSBuildProject (string xml)
{
msbuildProject = new MSBuildProject ();
- msbuildProject.Document.LoadXml (xml);
+ msbuildProject.LoadXml (xml);
}
void CreateUpdaterWithImportToRemove (string import)
@@ -55,7 +55,7 @@ namespace MonoDevelop.PackageManagement.Tests
using (updater) {
PackageManagementMSBuildExtension.Updater = updater;
msbuildExtension = new PackageManagementMSBuildExtension ();
- msbuildExtension.SaveProject (null, null, msbuildProject);
+ msbuildExtension.UpdateProject (msbuildProject);
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/IPackageExtensionsTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/IPackageExtensionsTests.cs
index 5113b3f35d..385c39fd42 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/IPackageExtensionsTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/IPackageExtensionsTests.cs
@@ -25,7 +25,7 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NUnit.Framework;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/InstallPackageActionTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/InstallPackageActionTests.cs
index 584bf146be..bd6a95bf4e 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/InstallPackageActionTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/InstallPackageActionTests.cs
@@ -28,7 +28,6 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using ICSharpCode.PackageManagement;
using NuGet;
using NUnit.Framework;
using MonoDevelop.PackageManagement.Tests.Helpers;
@@ -422,9 +421,10 @@ namespace MonoDevelop.PackageManagement.Tests
}
[Test]
- public void Execute_ProjectHasOnePackageInstallOperationThatHasALicenseToBeAccepted_AcceptLicensesEventRaised ()
+ public void Execute_ProjectHasOnePackageInstallOperationThatHasALicenseToBeAcceptedAndLicensesMustBeAcceptedIsFalse_AcceptLicensesEventRaised ()
{
CreateAction ();
+ action.LicensesMustBeAccepted = false;
FakePackage expectedPackage = fakeProject.FakeSourceRepository.AddFakePackageWithVersion ("Test", "1.0");
expectedPackage.RequireLicenseAcceptance = true;
var expectedPackages = new IPackage [] { expectedPackage };
@@ -444,9 +444,10 @@ namespace MonoDevelop.PackageManagement.Tests
}
[Test]
- public void Execute_ProjectHasOnePackageInstallOperationThatHasALicenseToBeAcceptedButPackageInstalledAlready_NoAcceptLicensesEventIsRaised ()
+ public void Execute_ProjectHasOnePackageInstallOperationThatHasALicenseToBeAcceptedButPackageInstalledAlreadyAndLicensesMustBeAcceptedIsFalse_NoAcceptLicensesEventIsRaised ()
{
CreateAction ();
+ action.LicensesMustBeAccepted = false;
FakePackage expectedPackage = fakeProject.FakeSourceRepository.AddFakePackageWithVersion ("Test", "1.0");
expectedPackage.RequireLicenseAcceptance = true;
var operation = new FakePackageOperation (expectedPackage, PackageAction.Install);
@@ -465,9 +466,10 @@ namespace MonoDevelop.PackageManagement.Tests
}
[Test]
- public void Execute_ProjectHasOnePackageInstallOperationThatHasALicenseToBeAcceptedAndLicensesNotAccepted_ExceptionThrown ()
+ public void Execute_ProjectHasOnePackageInstallOperationThatHasALicenseToBeAcceptedAndLicensesNotAcceptedAndLicensesMustBeAcceptedIsFalse_ExceptionThrown ()
{
CreateAction ();
+ action.LicensesMustBeAccepted = false;
FakePackage expectedPackage = fakeProject.FakeSourceRepository.AddFakePackageWithVersion ("Test", "1.0");
expectedPackage.RequireLicenseAcceptance = true;
var operation = new FakePackageOperation (expectedPackage, PackageAction.Install);
@@ -536,12 +538,11 @@ namespace MonoDevelop.PackageManagement.Tests
CreateAction ();
fakeProject.FakePackages.Add (new FakePackage ("Test", "1.0"));
action.Package = new FakePackage ("Test", "1.1");
- var firstReferenceBeingAdded = new ProjectReference (ReferenceType.Assembly, "NewAssembly");
- var secondReferenceBeingAdded = new ProjectReference (ReferenceType.Assembly, "NUnit.Framework");
+ var firstReferenceBeingAdded = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "NewAssembly");
+ var secondReferenceBeingAdded = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "NUnit.Framework");
fakeProject.InstallPackageAction = (p, a) => {
- var referenceBeingRemoved = new ProjectReference (ReferenceType.Assembly, "NUnit.Framework") {
- LocalCopy = false
- };
+ var referenceBeingRemoved = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "NUnit.Framework");
+ referenceBeingRemoved.LocalCopy = false;
packageManagementEvents.OnReferenceRemoving (referenceBeingRemoved);
packageManagementEvents.OnReferenceAdding (firstReferenceBeingAdded);
packageManagementEvents.OnReferenceAdding (secondReferenceBeingAdded);
@@ -559,12 +560,11 @@ namespace MonoDevelop.PackageManagement.Tests
CreateAction ();
fakeProject.FakePackages.Add (new FakePackage ("Test", "1.0"));
action.Package = new FakePackage ("Test", "1.1");
- var firstReferenceBeingAdded = new ProjectReference (ReferenceType.Assembly, "NewAssembly");
- var secondReferenceBeingAdded = new ProjectReference (ReferenceType.Assembly, "NUnit.Framework");
+ var firstReferenceBeingAdded = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "NewAssembly");
+ var secondReferenceBeingAdded = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "NUnit.Framework");
fakeProject.InstallPackageAction = (p, a) => {
- var referenceBeingRemoved = new ProjectReference (ReferenceType.Assembly, "NUnit.Framework") {
- LocalCopy = false
- };
+ var referenceBeingRemoved = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "NUnit.Framework");
+ referenceBeingRemoved.LocalCopy = false;
packageManagementEvents.OnReferenceRemoving (referenceBeingRemoved);
packageManagementEvents.OnReferenceAdding (firstReferenceBeingAdded);
packageManagementEvents.OnReferenceAdding (secondReferenceBeingAdded);
@@ -685,5 +685,49 @@ namespace MonoDevelop.PackageManagement.Tests
Assert.IsTrue (fileRemovedResult.Value);
Assert.IsNull (fileRemover.FileRemoved);
}
+
+ [Test]
+ public void NewInstance_LicensesMustBeAccepted_TrueByDefault ()
+ {
+ CreateAction ();
+
+ Assert.IsTrue (action.LicensesMustBeAccepted);
+ }
+
+ [Test]
+ public void Execute_ProjectHasOnePackageInstallOperationThatHasALicenseToBeAccepted_PackagesPassedToLicenseAcceptanceService ()
+ {
+ CreateAction ();
+ FakePackage expectedPackage = fakeProject.FakeSourceRepository.AddFakePackageWithVersion ("Test", "1.0");
+ expectedPackage.RequireLicenseAcceptance = true;
+ var expectedPackages = new IPackage [] { expectedPackage };
+ var operation = new FakePackageOperation (expectedPackage, PackageAction.Install);
+ action.PackageId = expectedPackage.Id;
+ action.PackageVersion = expectedPackage.Version;
+ fakeProject.FakeInstallOperations.Add (operation);
+
+ action.Execute ();
+
+ PackageCollectionAssert.AreEqual (expectedPackages, action.LicenseAcceptanceService.PackagesAccepted);
+ }
+
+ [Test]
+ public void Execute_ProjectHasOnePackageInstallOperationThatHasALicenseToBeAcceptedAndLicensesNotAccepted_LicenseAcceptanceServiceUsedAndExceptionThrown ()
+ {
+ CreateAction ();
+ FakePackage expectedPackage = fakeProject.FakeSourceRepository.AddFakePackageWithVersion ("Test", "1.0");
+ expectedPackage.RequireLicenseAcceptance = true;
+ var expectedPackages = new IPackage [] { expectedPackage };
+ var operation = new FakePackageOperation (expectedPackage, PackageAction.Install);
+ action.PackageId = expectedPackage.Id;
+ action.PackageVersion = expectedPackage.Version;
+ fakeProject.FakeInstallOperations.Add (operation);
+ action.LicenseAcceptanceService.AcceptLicensesReturnValue = false;
+
+ Exception ex = Assert.Throws (typeof(ApplicationException), () => action.Execute ());
+
+ Assert.AreEqual ("Licenses not accepted.", ex.Message);
+ PackageCollectionAssert.AreEqual (expectedPackages, action.LicenseAcceptanceService.PackagesAccepted);
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MSBuildProjectExtensionsTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MSBuildProjectExtensionsTests.cs
index 78593251e5..59ed4dd6da 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MSBuildProjectExtensionsTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MSBuildProjectExtensionsTests.cs
@@ -1,10 +1,11 @@

using System;
using System.Xml;
-using ICSharpCode.PackageManagement;
-using MonoDevelop.Projects.Formats.MSBuild;
+using MonoDevelop.PackageManagement;
+using MonoDevelop.Projects.MSBuild;
using NuGet;
using NUnit.Framework;
+using System.Linq;
namespace MonoDevelop.PackageManagement.Tests
{
@@ -30,44 +31,38 @@ namespace MonoDevelop.PackageManagement.Tests
void AssertLastMSBuildImportElementHasProjectAttributeValue (string expectedAttributeValue)
{
- XmlElement import = GetLastMSBuildImportElement ();
- string actualAttributeValue = import.GetAttribute ("Project");
+ MSBuildImport import = GetLastMSBuildImportElement ();
+ string actualAttributeValue = import.Project;
Assert.AreEqual (expectedAttributeValue, actualAttributeValue);
}
void AssertLastMSBuildImportElementHasCondition (string expectedCondition)
{
- XmlElement import = GetLastMSBuildImportElement ();
- string actualCondition = import.GetAttribute ("Condition");
- Assert.AreEqual (expectedCondition, actualCondition);
+ MSBuildImport import = GetLastMSBuildImportElement ();
+ Assert.AreEqual (expectedCondition, import.Condition);
}
- XmlElement GetLastMSBuildImportElement ()
+ MSBuildImport GetLastMSBuildImportElement ()
{
- var import = project.Document.DocumentElement.LastChild as XmlElement;
- Assert.AreEqual (import.LocalName, "Import");
- return import;
+ return project.Imports.LastOrDefault ();
}
void AssertFirstMSBuildImportElementHasProjectAttributeValue (string expectedAttributeValue)
{
- XmlElement import = GetFirstMSBuildImportElement ();
- string actualAttributeValue = import.GetAttribute ("Project");
+ MSBuildImport import = GetFirstMSBuildImportElement ();
+ string actualAttributeValue = import.Project;
Assert.AreEqual (expectedAttributeValue, actualAttributeValue);
}
- XmlElement GetFirstMSBuildImportElement ()
+ MSBuildImport GetFirstMSBuildImportElement ()
{
- var import = project.Document.DocumentElement.FirstChild as XmlElement;
- Assert.AreEqual (import.LocalName, "Import");
- return import;
+ return project.Imports.FirstOrDefault ();
}
void AssertFirstMSBuildImportElementHasCondition (string expectedCondition)
{
- XmlElement import = GetFirstMSBuildImportElement ();
- string actualCondition = import.GetAttribute ("Condition");
- Assert.AreEqual (expectedCondition, actualCondition);
+ var import = GetFirstMSBuildImportElement ();
+ Assert.AreEqual (expectedCondition, import.Condition);
}
[Test]
@@ -135,7 +130,7 @@ namespace MonoDevelop.PackageManagement.Tests
AddImportIfMissingAtBottom (import);
- Assert.AreEqual (1, project.Document.DocumentElement.ChildNodes.Count);
+ Assert.AreEqual (1, project.Imports.Count ());
}
[Test]
@@ -160,7 +155,7 @@ namespace MonoDevelop.PackageManagement.Tests
project.RemoveImportIfExists (import);
- Assert.AreEqual (0, project.Document.DocumentElement.ChildNodes.Count);
+ Assert.AreEqual (0, project.Imports.Count ());
}
[Test]
@@ -173,7 +168,7 @@ namespace MonoDevelop.PackageManagement.Tests
project.RemoveImportIfExists (import2);
- Assert.AreEqual (0, project.Document.DocumentElement.ChildNodes.Count);
+ Assert.AreEqual (0, project.Imports.Count ());
}
[Test]
@@ -210,7 +205,7 @@ namespace MonoDevelop.PackageManagement.Tests
AddImportIfMissingAtTop (import);
- Assert.AreEqual (1, project.Document.DocumentElement.ChildNodes.Count);
+ Assert.AreEqual (1, project.Imports.Count ());
}
}
} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MSBuildTargetsRestoredMonitorTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MSBuildTargetsRestoredMonitorTests.cs
index 93ae95c5b1..eed15ff652 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MSBuildTargetsRestoredMonitorTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MSBuildTargetsRestoredMonitorTests.cs
@@ -24,7 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NUnit.Framework;
using MonoDevelop.PackageManagement.Tests.Helpers;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopPackageManagerFactoryTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopPackageManagerFactoryTests.cs
index 921e216264..c64ab3283c 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopPackageManagerFactoryTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopPackageManagerFactoryTests.cs
@@ -1,5 +1,5 @@
//
-// SharpDevelopPackageManagerFactoryTests.cs
+// MonoDevelopPackageManagerFactoryTests.cs
//
// Author:
// Matt Ward <matt.ward@xamarin.com>
@@ -25,7 +25,7 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using NUnit.Framework;
using MonoDevelop.PackageManagement.Tests.Helpers;
@@ -35,7 +35,7 @@ namespace MonoDevelop.PackageManagement.Tests
[TestFixture]
public class MonoDevelopPackageManagerFactoryTests
{
- SharpDevelopPackageManagerFactory factory;
+ MonoDevelopPackageManagerFactory factory;
IPackageManager packageManager;
FakePackageRepository fakePackageRepository;
FakeDotNetProject testProject;
@@ -48,7 +48,7 @@ namespace MonoDevelop.PackageManagement.Tests
options = new TestablePackageManagementOptions ();
fakePackageRepositoryFactory = new FakePackageRepositoryFactory ();
fakeProjectSystemFactory = new FakeProjectSystemFactory ();
- factory = new SharpDevelopPackageManagerFactory (fakePackageRepositoryFactory, fakeProjectSystemFactory, options);
+ factory = new MonoDevelopPackageManagerFactory (fakePackageRepositoryFactory, fakeProjectSystemFactory, options);
}
void CreateTestProject ()
@@ -131,8 +131,8 @@ namespace MonoDevelop.PackageManagement.Tests
string expectedDirectory = @"c:\projects\MyProject\packages\TestPackage.1.0.0.0".ToNativePath ();
- SharpDevelopPackageManager sharpDevelopPackageManager = packageManager as SharpDevelopPackageManager;
- string actualDirectory = sharpDevelopPackageManager.PathResolver.GetInstallPath (package);
+ MonoDevelopPackageManager monoDevelopPackageManager = packageManager as MonoDevelopPackageManager;
+ string actualDirectory = monoDevelopPackageManager.PathResolver.GetInstallPath (package);
Assert.AreEqual (expectedDirectory, actualDirectory);
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopPackageManagerTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopPackageManagerTests.cs
index beb98f08ff..cc50fb5172 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopPackageManagerTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopPackageManagerTests.cs
@@ -1,5 +1,5 @@
//
-// SharpDevelopPackageManagerTests.cs
+// MonoDevelopPackageManagerTests.cs
//
// Author:
// Matt Ward <matt.ward@xamarin.com>
@@ -27,7 +27,7 @@
using System;
using System.Linq;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using NUnit.Framework;
using MonoDevelop.PackageManagement.Tests.Helpers;
@@ -37,7 +37,7 @@ namespace MonoDevelop.PackageManagement.Tests
[TestFixture]
public class MonoDevelopPackageManagerTests
{
- SharpDevelopPackageManager packageManager;
+ MonoDevelopPackageManager packageManager;
FakePackageRepository fakeFeedSourceRepository;
FakeSharedPackageRepository fakeSolutionSharedRepository;
FakeProject project;
@@ -51,6 +51,14 @@ namespace MonoDevelop.PackageManagement.Tests
void CreatePackageManager (IProject project, PackageReferenceRepositoryHelper packageRefRepositoryHelper)
{
+ CreatePackageManager (project, packageRefRepositoryHelper, new FakePackageRepository ());
+ }
+
+ void CreatePackageManager (
+ IProject project,
+ PackageReferenceRepositoryHelper packageRefRepositoryHelper,
+ IPackageRepository sourceRepository)
+ {
options = new TestablePackageManagementOptions ();
options.PackagesDirectory = "packages";
@@ -59,7 +67,7 @@ namespace MonoDevelop.PackageManagement.Tests
fakeFileSystem = new FakeFileSystem ();
- fakeFeedSourceRepository = new FakePackageRepository ();
+ fakeFeedSourceRepository = sourceRepository as FakePackageRepository;
fakeSolutionSharedRepository = packageRefRepositoryHelper.FakeSharedSourceRepository;
fakePackageOperationResolverFactory = new FakePackageOperationResolverFactory ();
@@ -70,7 +78,7 @@ namespace MonoDevelop.PackageManagement.Tests
fakeSolutionPackageRepository.PackagePathResolver = pathResolver;
fakeSolutionPackageRepository.FakeSharedRepository = fakeSolutionSharedRepository;
- packageManager = new SharpDevelopPackageManager (fakeFeedSourceRepository,
+ packageManager = new MonoDevelopPackageManager (sourceRepository,
packageRefRepositoryHelper.FakeProjectSystem,
fakeSolutionPackageRepository,
fakePackageOperationResolverFactory);
@@ -78,9 +86,14 @@ namespace MonoDevelop.PackageManagement.Tests
void CreatePackageManager ()
{
+ CreatePackageManager (new FakePackageRepository ());
+ }
+
+ void CreatePackageManager (IPackageRepository sourceRepository)
+ {
CreateTestProject ();
CreatePackageReferenceRepositoryHelper ();
- CreatePackageManager (project, packageRefRepositoryHelper);
+ CreatePackageManager (project, packageRefRepositoryHelper, sourceRepository);
}
void CreatePackageReferenceRepositoryHelper ()
@@ -342,6 +355,17 @@ namespace MonoDevelop.PackageManagement.Tests
() => eventArgs.ToList ().ForEach (eventArg => projectManager.FirePackageReferenceRemoved (eventArg)));
}
+ void RaisePackageAddedEventWhenPackageReferenceUpdated (
+ FakeProjectManager projectManager,
+ FakePackage updatedPackage,
+ params PackageOperationEventArgs[] eventArgs)
+ {
+ projectManager.WhenUpdatePackageReferenceCalled (
+ updatedPackage.Id,
+ updatedPackage.Version,
+ () => eventArgs.ToList ().ForEach (eventArg => projectManager.FirePackageReferenceAdded (eventArg)));
+ }
+
void RaisePackageRemovedEventWhenPackageReferenceAdded (
FakeProjectManager projectManager,
FakePackage newPackage,
@@ -353,11 +377,44 @@ namespace MonoDevelop.PackageManagement.Tests
() => eventArgs.ToList ().ForEach (eventArg => projectManager.FirePackageReferenceRemoved (eventArg)));
}
+ void RaisePackageAddedEventWhenPackageReferenceAdded (
+ FakeProjectManager projectManager,
+ FakePackage newPackage,
+ params PackageOperationEventArgs[] eventArgs)
+ {
+ projectManager.WhenAddPackageReferenceCalled (
+ newPackage.Id,
+ newPackage.Version,
+ () => eventArgs.ToList ().ForEach (eventArg => projectManager.FirePackageReferenceAdded (eventArg)));
+ }
+
[Test]
- public void ProjectManager_InstanceCreated_SourceRepositoryIsSharedRepositoryPassedToPackageManager ()
+ public void ProjectManager_InstanceCreated_SourceRepositoryIsAggregrateRepositoryContainingSharedRepositoryPassedToPackageManager ()
{
CreatePackageManager ();
- Assert.AreEqual (fakeSolutionSharedRepository, packageManager.ProjectManager.SourceRepository);
+
+ var aggregateRepository = packageManager.ProjectManager.SourceRepository as AggregateRepository;
+ var secondaryRepository = aggregateRepository.Repositories.Last () as FakePackageRepository;
+ Assert.AreEqual (2, aggregateRepository.Repositories.Count ());
+ Assert.AreEqual (fakeSolutionSharedRepository, aggregateRepository.Repositories.First ());
+ Assert.IsTrue (secondaryRepository.IsCloneOf (fakeFeedSourceRepository));
+ }
+
+ [Test]
+ public void ProjectManager_LocalRepositoryIsFallbackRepository_SourceRepositoryIsFallbackContainingSharedRepositoryPassedToPackageManager ()
+ {
+ var primaryRepository = new FakePackageRepository ();
+ var dependencyResolver = new FakePackageRepository ();
+ var fallbackRepository = new FallbackRepository (primaryRepository, dependencyResolver);
+ CreatePackageManager (fallbackRepository);
+
+ var sourceRepository = packageManager.ProjectManager.SourceRepository as FallbackRepository;
+ var aggregateRepository = sourceRepository.SourceRepository as AggregateRepository;
+ Assert.AreEqual (dependencyResolver, sourceRepository.DependencyResolver);
+ var secondaryRepository = aggregateRepository.Repositories.Last () as FakePackageRepository;
+ Assert.AreEqual (2, aggregateRepository.Repositories.Count ());
+ Assert.AreEqual (fakeSolutionSharedRepository, aggregateRepository.Repositories.First ());
+ Assert.IsTrue (secondaryRepository.IsCloneOf (primaryRepository));
}
[Test]
@@ -1133,6 +1190,84 @@ namespace MonoDevelop.PackageManagement.Tests
Assert.IsTrue (fakeSolutionSharedRepository.FakePackages.Contains (installedPackage));
}
+
+ [Test]
+ public void InstallPackage_PackageReferenceIsAddedForPackageNotInstalledInLocalRepository_PackageIsInstalled ()
+ {
+ CreatePackageManager ();
+ var fakeProjectManager = new FakeProjectManager ();
+ packageManager.ProjectManager = fakeProjectManager;
+ var packageReferenced = new FakePackage ("FooBar", "1.0");
+ FakePackage newPackage = fakeFeedSourceRepository.AddFakePackageWithVersion ("MyPackage", "1.1");
+ var eventArgs = new PackageOperationEventArgs (packageReferenced, null, null);
+ RaisePackageAddedEventWhenPackageReferenceAdded (fakeProjectManager, newPackage, eventArgs);
+ var installAction = new FakeInstallPackageAction {
+ Operations = new List<PackageOperation> ()
+ };
+
+ packageManager.InstallPackage (newPackage, installAction);
+
+ Assert.IsTrue (fakeSolutionSharedRepository.PackagesAdded.Contains (packageReferenced));
+ }
+
+ [Test]
+ public void InstallPackage_PackageReferenceIsAddedForPackageInstalledInLocalRepository_PackageIsNotInstalledToLocalRepositoryAgain ()
+ {
+ CreatePackageManager ();
+ var fakeProjectManager = new FakeProjectManager ();
+ packageManager.ProjectManager = fakeProjectManager;
+ var packageReferenced = new FakePackage ("FooBar", "1.0");
+ fakeSolutionSharedRepository.FakePackages.Add (packageReferenced);
+ FakePackage newPackage = fakeFeedSourceRepository.AddFakePackageWithVersion ("MyPackage", "1.1");
+ var eventArgs = new PackageOperationEventArgs (packageReferenced, null, null);
+ RaisePackageAddedEventWhenPackageReferenceAdded (fakeProjectManager, newPackage, eventArgs);
+ var installAction = new FakeInstallPackageAction {
+ Operations = new List<PackageOperation> ()
+ };
+
+ packageManager.InstallPackage (newPackage, installAction);
+
+ Assert.IsFalse (fakeSolutionSharedRepository.PackagesAdded.Contains (packageReferenced));
+ }
+
+ [Test]
+ public void UpdatePackage_PackageReferenceIsAddedForPackageNotInstalledInLocalRepository_PackageIsInstalled ()
+ {
+ CreatePackageManager ();
+ var fakeProjectManager = new FakeProjectManager ();
+ packageManager.ProjectManager = fakeProjectManager;
+ var packageReferenced = new FakePackage ("FooBar", "1.0");
+ FakePackage newPackage = fakeFeedSourceRepository.AddFakePackageWithVersion ("MyPackage", "1.1");
+ var eventArgs = new PackageOperationEventArgs (packageReferenced, null, null);
+ RaisePackageAddedEventWhenPackageReferenceUpdated (fakeProjectManager, newPackage, eventArgs);
+ var updateAction = new FakeUpdatePackageAction {
+ Operations = new List<PackageOperation> ()
+ };
+
+ packageManager.UpdatePackage (newPackage, updateAction);
+
+ Assert.IsTrue (fakeSolutionSharedRepository.PackagesAdded.Contains (packageReferenced));
+ }
+
+ [Test]
+ public void UpdatePackage_PackageReferenceIsAddedForPackageInstalledInLocalRepository_PackageIsNotInstalledAgainInLocalRepository ()
+ {
+ CreatePackageManager ();
+ var fakeProjectManager = new FakeProjectManager ();
+ packageManager.ProjectManager = fakeProjectManager;
+ var packageReferenced = new FakePackage ("FooBar", "1.0");
+ fakeSolutionSharedRepository.FakePackages.Add (packageReferenced);
+ FakePackage newPackage = fakeFeedSourceRepository.AddFakePackageWithVersion ("MyPackage", "1.1");
+ var eventArgs = new PackageOperationEventArgs (packageReferenced, null, null);
+ RaisePackageAddedEventWhenPackageReferenceUpdated (fakeProjectManager, newPackage, eventArgs);
+ var updateAction = new FakeUpdatePackageAction {
+ Operations = new List<PackageOperation> ()
+ };
+
+ packageManager.UpdatePackage (newPackage, updateAction);
+
+ Assert.IsFalse (fakeSolutionSharedRepository.PackagesAdded.Contains (packageReferenced));
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopProjectManagerTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopProjectManagerTests.cs
index 754f648a29..49ce6e4f04 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopProjectManagerTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopProjectManagerTests.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NuGet;
using NUnit.Framework;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopProjectSystemTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopProjectSystemTests.cs
index fd3280c147..0fa66464e2 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopProjectSystemTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MonoDevelopProjectSystemTests.cs
@@ -1,5 +1,5 @@
//
-// SharpDevelopProjectSystemTests.cs
+// MonoDevelopProjectSystemTests.cs
//
// Author:
// Matt Ward <matt.ward@xamarin.com>
@@ -28,12 +28,12 @@ using System;
using System.IO;
using System.Linq;
using System.Runtime.Versioning;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.Core.Assemblies;
using MonoDevelop.PackageManagement.Tests.Helpers;
using MonoDevelop.Projects;
-using MonoDevelop.Projects.Formats.MSBuild;
+using MonoDevelop.Projects.MSBuild;
using NuGet;
using NUnit.Framework;
@@ -87,26 +87,38 @@ namespace MonoDevelop.PackageManagement.Tests
void AssertLastMSBuildChildElementHasProjectAttributeValue (string expectedImport)
{
- ImportAndCondition import = project.ImportsAdded.Last ();
+ ImportAndCondition import = projectSystem.NewImportsHandler.ImportsAdded.Last ();
Assert.AreEqual (expectedImport, import.Name);
}
void AssertLastImportHasCondition (string expectedCondition)
{
- ImportAndCondition import = project.ImportsAdded.Last ();
+ ImportAndCondition import = projectSystem.NewImportsHandler.ImportsAdded.Last ();
Assert.AreEqual (expectedCondition, import.Condition);
}
+ void AssertLastImportHasImportLocation (ProjectImportLocation expectedLocation)
+ {
+ ImportAndCondition import = projectSystem.NewImportsHandler.ImportsAdded.Last ();
+ Assert.AreEqual (expectedLocation, import.Location);
+ }
+
void AssertFirstMSBuildChildElementHasProjectAttributeValue (string expectedImport)
{
- ImportAndCondition import = project.ImportsAdded.First ();
+ ImportAndCondition import = projectSystem.NewImportsHandler.ImportsAdded.First ();
Assert.AreEqual (expectedImport, import.Name);
}
void AssertFirstImportHasCondition (string expectedCondition)
{
- ImportAndCondition import = project.ImportsAdded.First ();
+ ImportAndCondition import = projectSystem.NewImportsHandler.ImportsAdded.First ();
Assert.AreEqual (expectedCondition, import.Condition);
+ }
+
+ void AssertFirstImportHasImportLocation (ProjectImportLocation expectedLocation)
+ {
+ ImportAndCondition import = projectSystem.NewImportsHandler.ImportsAdded.First ();
+ Assert.AreEqual (expectedLocation, import.Location);
}
void AssertImportRemoved (string expectedImportRemoved)
@@ -117,7 +129,7 @@ namespace MonoDevelop.PackageManagement.Tests
MSBuildProject CreateMSBuildProject (string xml)
{
var msbuildProject = new MSBuildProject ();
- msbuildProject.Document.LoadXml (xml);
+ msbuildProject.LoadXml (xml);
return msbuildProject;
}
@@ -402,7 +414,7 @@ namespace MonoDevelop.PackageManagement.Tests
ProjectReference actualReference = project.References [0];
Assert.AreEqual ("nunit.framework", actualReference.Reference);
- Assert.AreEqual (fileName, actualReference.HintPath);
+ Assert.AreEqual (fileName, actualReference.HintPath.ToString());
}
[Test]
@@ -417,7 +429,7 @@ namespace MonoDevelop.PackageManagement.Tests
ProjectReference actualReference = project.References [0];
Assert.AreEqual ("nunit.framework", actualReference.Reference);
- Assert.AreEqual (fullFileName, actualReference.HintPath);
+ Assert.AreEqual (fullFileName, actualReference.HintPath.ToString());
}
[Test]
@@ -899,6 +911,7 @@ namespace MonoDevelop.PackageManagement.Tests
projectSystem.AddImport (targetPath, ProjectImportLocation.Bottom);
AssertLastMSBuildChildElementHasProjectAttributeValue (@"..\packages\Foo.0.1\build\Foo.targets");
+ AssertLastImportHasImportLocation (ProjectImportLocation.Bottom);
}
[Test]
@@ -911,6 +924,7 @@ namespace MonoDevelop.PackageManagement.Tests
projectSystem.AddImport (targetPath, ProjectImportLocation.Bottom);
AssertLastMSBuildChildElementHasProjectAttributeValue (@"packages\Foo.0.1\build\Foo.targets");
+ AssertLastImportHasImportLocation (ProjectImportLocation.Bottom);
}
[Test]
@@ -923,6 +937,7 @@ namespace MonoDevelop.PackageManagement.Tests
projectSystem.AddImport (targetPath, ProjectImportLocation.Bottom);
AssertLastImportHasCondition ("Exists('..\\packages\\Foo.0.1\\build\\Foo.targets')");
+ AssertLastImportHasImportLocation (ProjectImportLocation.Bottom);
}
[Test]
@@ -931,11 +946,12 @@ namespace MonoDevelop.PackageManagement.Tests
CreateTestProject (@"d:\projects\MyProject\MyProject\MyProject.csproj");
CreateProjectSystem (project);
string targetPath = @"d:\projects\MyProject\packages\Foo.0.1\build\Foo.targets".ToNativePath ();
- projectSystem.AddImport (targetPath, ProjectImportLocation.Bottom);
projectSystem.AddImport (targetPath, ProjectImportLocation.Bottom);
+ Assert.AreEqual (1, projectSystem.NewImportsHandler.ImportsAdded.Count);
- Assert.AreEqual (2, project.ImportsAdded.Count);
+ projectSystem.AddImport (targetPath, ProjectImportLocation.Bottom);
+ Assert.AreEqual (1, projectSystem.NewImportsHandler.ImportsAdded.Count);
}
[Test]
@@ -945,11 +961,12 @@ namespace MonoDevelop.PackageManagement.Tests
CreateProjectSystem (project);
string targetPath1 = @"d:\projects\MyProject\packages\Foo.0.1\build\Foo.targets".ToNativePath ();
string targetPath2 = @"d:\projects\MyProject\packages\Foo.0.1\BUILD\FOO.TARGETS".ToNativePath ();
+
projectSystem.AddImport (targetPath1, ProjectImportLocation.Bottom);
+ Assert.AreEqual (1, projectSystem.NewImportsHandler.ImportsAdded.Count);
projectSystem.AddImport (targetPath2, ProjectImportLocation.Bottom);
-
- Assert.AreEqual (2, project.ImportsAdded.Count);
+ Assert.AreEqual (1, projectSystem.NewImportsHandler.ImportsAdded.Count);
}
[Test]
@@ -988,7 +1005,7 @@ namespace MonoDevelop.PackageManagement.Tests
projectSystem.RemoveImport (targetPath2);
- Assert.AreEqual (1, project.ImportsAdded.Count);
+ Assert.AreEqual (1, projectSystem.NewImportsHandler.ImportsAdded.Count);
Assert.AreEqual (2, project.ImportsRemoved.Count);
}
@@ -1013,6 +1030,7 @@ namespace MonoDevelop.PackageManagement.Tests
projectSystem.AddImport (targetPath, ProjectImportLocation.Top);
AssertFirstMSBuildChildElementHasProjectAttributeValue (@"..\packages\Foo.0.1\build\Foo.targets");
+ AssertFirstImportHasImportLocation (ProjectImportLocation.Top);
}
[Test]
@@ -1025,6 +1043,7 @@ namespace MonoDevelop.PackageManagement.Tests
projectSystem.AddImport (targetPath, ProjectImportLocation.Top);
AssertFirstImportHasCondition ("Exists('..\\packages\\Foo.0.1\\build\\Foo.targets')");
+ AssertFirstImportHasImportLocation (ProjectImportLocation.Top);
}
[Test]
@@ -1033,11 +1052,13 @@ namespace MonoDevelop.PackageManagement.Tests
CreateTestProject (@"d:\projects\MyProject\MyProject\MyProject.csproj");
CreateProjectSystem (project);
string targetPath = @"d:\projects\MyProject\packages\Foo.0.1\build\Foo.targets".ToNativePath ();
+
projectSystem.AddImport (targetPath, ProjectImportLocation.Top);
+ Assert.AreEqual (1, projectSystem.NewImportsHandler.ImportsAdded.Count);
projectSystem.AddImport (targetPath, ProjectImportLocation.Top);
- Assert.AreEqual (2, project.ImportsAdded.Count);
+ Assert.AreEqual (1, projectSystem.NewImportsHandler.ImportsAdded.Count);
}
[Test]
@@ -1172,7 +1193,7 @@ namespace MonoDevelop.PackageManagement.Tests
int targetCountBeforeSave = msbuildProject.Targets.Count ();
project.SaveAction = () => {
var msbuildExtension = new PackageManagementMSBuildExtension ();
- msbuildExtension.SaveProject (null, null, msbuildProject);
+ msbuildExtension.UpdateProject (msbuildProject);
};
projectSystem.RemoveImport (targetPath);
@@ -1195,7 +1216,7 @@ namespace MonoDevelop.PackageManagement.Tests
string fileName = @"d:\projects\packages\nunit\nunit.framework.dll".ToNativePath ();
projectSystem.AddReference (fileName, null);
- Assert.AreEqual (fileName, referenceBeingAdded.HintPath);
+ Assert.AreEqual (fileName, referenceBeingAdded.HintPath.ToString ());
Assert.IsTrue (referenceBeingAdded.LocalCopy);
}
@@ -1215,8 +1236,20 @@ namespace MonoDevelop.PackageManagement.Tests
projectSystem.RemoveReference (fileName);
- Assert.AreEqual (fileName, referenceBeingRemoved.HintPath);
+ Assert.AreEqual (fileName, referenceBeingRemoved.HintPath.ToString ());
Assert.IsFalse (projectIsSaved);
+ }
+
+ [Test]
+ public void AddImport_FullImportFilePathAndBottomOfProject_ImportHandlerIsDisposed ()
+ {
+ CreateTestProject (@"d:\projects\MyProject\MyProject\MyProject.csproj");
+ CreateProjectSystem (project);
+ string targetPath = @"d:\projects\MyProject\packages\Foo.0.1\build\Foo.targets".ToNativePath ();
+
+ projectSystem.AddImport (targetPath, ProjectImportLocation.Bottom);
+
+ Assert.IsTrue (projectSystem.NewImportsHandler.IsDisposed);
}
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/OpenDotNetProjectTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/OpenDotNetProjectTests.cs
index 84d7b1a2ae..39ddd0638f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/OpenDotNetProjectTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/OpenDotNetProjectTests.cs
@@ -26,7 +26,7 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NUnit.Framework;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageCompatibilityRunnerTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageCompatibilityRunnerTests.cs
index d8b6e7e655..b9b290a0ff 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageCompatibilityRunnerTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageCompatibilityRunnerTests.cs
@@ -28,7 +28,7 @@ using System;
using System.IO;
using System.Linq;
using System.Text;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.Core.Assemblies;
using MonoDevelop.PackageManagement.Tests.Helpers;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageFilesTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageFilesTests.cs
index 30d245fe04..acf36c1ef4 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageFilesTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageFilesTests.cs
@@ -26,7 +26,7 @@
using System;
using NUnit.Framework;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
namespace MonoDevelop.PackageManagement.Tests
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageFromRepositoryTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageFromRepositoryTests.cs
index c83b4aee72..a0ad251140 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageFromRepositoryTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageFromRepositoryTests.cs
@@ -126,10 +126,10 @@ namespace MonoDevelop.PackageManagement.Tests
}
[Test]
- public void IconUrl_WrappedPackageIconUrlIsHttpSharpDevelopNet_ReturnsHttpSharpDevelopNet ()
+ public void IconUrl_WrappedPackageIconUrlIsHttpMonoDevelopNet_ReturnsHttpMonoDevelopNet ()
{
CreatePackage ();
- var expectedUrl = new Uri ("http://sharpdevelop.net");
+ var expectedUrl = new Uri ("http://monodevelop.net");
fakePackage.IconUrl = expectedUrl;
Uri url = package.IconUrl;
@@ -137,10 +137,10 @@ namespace MonoDevelop.PackageManagement.Tests
}
[Test]
- public void LicenseUrl_WrappedPackageLicenseUrlIsHttpSharpDevelopNet_ReturnsHttpSharpDevelopNet ()
+ public void LicenseUrl_WrappedPackageLicenseUrlIsHttpMonoDevelopNet_ReturnsHttpMonoDevelopNet ()
{
CreatePackage ();
- var expectedUrl = new Uri ("http://sharpdevelop.net");
+ var expectedUrl = new Uri ("http://monodevelop.net");
fakePackage.LicenseUrl = expectedUrl;
Uri url = package.LicenseUrl;
@@ -148,10 +148,10 @@ namespace MonoDevelop.PackageManagement.Tests
}
[Test]
- public void ProjectUrl_WrappedPackageProjectUrlIsHttpSharpDevelopNet_ReturnsHttpSharpDevelopNet ()
+ public void ProjectUrl_WrappedPackageProjectUrlIsHttpMonoDevelopNet_ReturnsHttpMonoDevelopNet ()
{
CreatePackage ();
- var expectedUrl = new Uri ("http://sharpdevelop.net");
+ var expectedUrl = new Uri ("http://monodevelop.net");
fakePackage.ProjectUrl = expectedUrl;
Uri url = package.ProjectUrl;
@@ -159,10 +159,10 @@ namespace MonoDevelop.PackageManagement.Tests
}
[Test]
- public void ReportAbuseUrl_WrappedPackageReportAbuseUrlIsHttpSharpDevelopNet_ReturnsHttpSharpDevelopNet ()
+ public void ReportAbuseUrl_WrappedPackageReportAbuseUrlIsHttpMonoDevelopNet_ReturnsHttpMonoDevelopNet ()
{
CreatePackage ();
- var expectedUrl = new Uri ("http://sharpdevelop.net");
+ var expectedUrl = new Uri ("http://monodevelop.net");
fakePackage.ReportAbuseUrl = expectedUrl;
Uri url = package.ReportAbuseUrl;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementEventsTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementEventsTests.cs
index 5e7f7074e9..8327d86530 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementEventsTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementEventsTests.cs
@@ -26,7 +26,7 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using NUnit.Framework;
using MonoDevelop.PackageManagement.Tests.Helpers;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementLoggerTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementLoggerTests.cs
index cce2a5c9e9..360cd4e72b 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementLoggerTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementLoggerTests.cs
@@ -26,7 +26,7 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using NUnit.Framework;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementOptionsTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementOptionsTests.cs
index 48f81bc6d7..6505eabb04 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementOptionsTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementOptionsTests.cs
@@ -29,7 +29,7 @@ using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Xml;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NuGet;
@@ -228,11 +228,11 @@ namespace MonoDevelop.PackageManagement.Tests
public void ActivePackageSource_SourceChanged_ActivePackageSourceUpdatedInSettings ()
{
CreateOptions ();
- var packageSource = new PackageSource ("http://sharpdevelop.com", "Test");
+ var packageSource = new PackageSource ("http://monodevelop.com", "Test");
options.ActivePackageSource = packageSource;
- var expectedSetting = new SettingValue ("Test", "http://sharpdevelop.com", false);
+ var expectedSetting = new SettingValue ("Test", "http://monodevelop.com", false);
SettingValue actualSetting = fakeSettings.GetValuePassedToSetValueForActivePackageSourceSection ();
Assert.AreEqual (expectedSetting, actualSetting);
@@ -285,7 +285,7 @@ namespace MonoDevelop.PackageManagement.Tests
{
CreateOptions ();
- options.ActivePackageSource = new PackageSource ("http://sharpdevelop.com", "Test");
+ options.ActivePackageSource = new PackageSource ("http://monodevelop.com", "Test");
bool sectionDeleted = fakeSettings.IsActivePackageSourceSectionDeleted;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementOptionsViewModelTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementOptionsViewModelTests.cs
index 8686205e1f..1f18cd7c90 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementOptionsViewModelTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementOptionsViewModelTests.cs
@@ -26,7 +26,7 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NUnit.Framework;
using MonoDevelop.Core;
using MonoDevelop.PackageManagement.Tests.Helpers;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementProjectTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementProjectTests.cs
index bad7bed11b..d0ec929a40 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementProjectTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementProjectTests.cs
@@ -28,7 +28,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using NUnit.Framework;
using MonoDevelop.PackageManagement.Tests.Helpers;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementSelectedProjectTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementSelectedProjectTests.cs
index ab4f35a0aa..77d06c2fad 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementSelectedProjectTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementSelectedProjectTests.cs
@@ -25,7 +25,7 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NUnit.Framework;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementSelectedProjectsTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementSelectedProjectsTests.cs
index 97c363af45..e820f8a489 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementSelectedProjectsTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementSelectedProjectsTests.cs
@@ -28,7 +28,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NuGet;
using NUnit.Framework;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementSolutionTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementSolutionTests.cs
index d7d5b380ca..63b6b51f9f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementSolutionTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementSolutionTests.cs
@@ -28,7 +28,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using MonoDevelop.PackageManagement.Tests.Helpers;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using NUnit.Framework;
@@ -101,7 +101,7 @@ namespace MonoDevelop.PackageManagement.Tests
}
[Test]
- public void GetActiveProject_ProjectIsSelected_CreatesProjectUsingCurrentProjectSelectedInSharpDevelop ()
+ public void GetActiveProject_ProjectIsSelected_CreatesProjectUsingCurrentProjectSelectedInMonoDevelop ()
{
CreateSolution ();
@@ -196,7 +196,7 @@ namespace MonoDevelop.PackageManagement.Tests
{
CreateSolution ();
FakeDotNetProject expectedProject = AddProjectToOpenProjects ("Test");
- var source = new PackageSource ("http://sharpdevelop.net");
+ var source = new PackageSource ("http://monodevelop.net");
solution.GetProject (source, "Test");
@@ -210,7 +210,7 @@ namespace MonoDevelop.PackageManagement.Tests
{
CreateSolution ();
FakeDotNetProject expectedProject = AddProjectToOpenProjects ("Test");
- var source = new PackageSource ("http://sharpdevelop.net");
+ var source = new PackageSource ("http://monodevelop.net");
solution.GetProject (source, "TEST");
@@ -224,7 +224,7 @@ namespace MonoDevelop.PackageManagement.Tests
{
CreateSolution ();
AddProjectToOpenProjects ("Test");
- var source = new PackageSource ("http://sharpdevelop.net");
+ var source = new PackageSource ("http://monodevelop.net");
IPackageManagementProject project = solution.GetProject (source, "Test");
FakePackageManagementProject expectedProject = fakeProjectFactory.FirstFakeProjectCreated;
@@ -237,7 +237,7 @@ namespace MonoDevelop.PackageManagement.Tests
{
CreateSolution ();
AddProjectToOpenProjects ("Test");
- var expectedSource = new PackageSource ("http://sharpdevelop.net");
+ var expectedSource = new PackageSource ("http://monodevelop.net");
solution.GetProject (expectedSource, "Test");
PackageSource actualSource = fakeRegisteredPackageRepositories.PackageSourcePassedToCreateRepository;
@@ -713,6 +713,22 @@ namespace MonoDevelop.PackageManagement.Tests
Assert.AreEqual (fakeSolutionPackageRepositoryFactory.SolutionPassedToCreateSolutionPackageRepository, fakeSolution);
Assert.AreEqual (fakeSolutionPackageRepositoryFactory.FakeSolutionPackageRepository, repository);
}
+
+ [Test]
+ public void GetProject_NoRepositorySpecified_CreatesProjectUsingAggregateRepository ()
+ {
+ CreateSolution ();
+ var dotNetProject = new FakeDotNetProject ();
+ AggregateRepository expectedRepository = CreateAggregateRepositoryWithOneRepository ();
+ fakeRegisteredPackageRepositories.CreateAggregateRepositoryAction = () => expectedRepository;
+
+ IPackageManagementProject project = solution.GetProject (dotNetProject);
+
+ IPackageRepository repository = fakeProjectFactory.FirstRepositoryPassedToCreateProject;
+ IPackageManagementProject expectedProject = fakeProjectFactory.FirstFakeProjectCreated;
+ Assert.AreEqual (expectedRepository, repository);
+ Assert.AreEqual (expectedProject, project);
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageOperationMessageTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageOperationMessageTests.cs
index 6f5c077c16..f0e6dd813d 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageOperationMessageTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageOperationMessageTests.cs
@@ -25,7 +25,7 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using NUnit.Framework;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageReferenceNodeTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageReferenceNodeTests.cs
index 3f7609c3d1..09a5d8d0b8 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageReferenceNodeTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageReferenceNodeTests.cs
@@ -45,7 +45,7 @@ namespace MonoDevelop.PackageManagement.Tests
bool installPending = false,
PackageName updatedPackage = null)
{
- node = new PackageReferenceNode (packageReference, installed, installPending, updatedPackage);
+ node = new PackageReferenceNode (null, packageReference, installed, installPending, updatedPackage);
}
void CreatePackageReference (
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageReinstallerTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageReinstallerTests.cs
index 06fd381977..51651487dc 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageReinstallerTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageReinstallerTests.cs
@@ -58,7 +58,8 @@ namespace MonoDevelop.PackageManagement.Tests
null,
false);
- var node = new PackageReferenceNode (packageReference, true);
+ var parentNode = new TestableProjectPackagesFolderNode (project.FakeDotNetProject, null);
+ var node = new PackageReferenceNode (parentNode, packageReference, true);
reinstaller.Run (node);
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageRepositoryCacheTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageRepositoryCacheTests.cs
index 6c02e947bc..58aad3dd12 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageRepositoryCacheTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageRepositoryCacheTests.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using NUnit.Framework;
using MonoDevelop.PackageManagement.Tests.Helpers;
@@ -62,7 +62,7 @@ namespace MonoDevelop.PackageManagement.Tests
CreateCacheUsingPackageSources (fakePackageRepositoryFactory);
}
- void CreateCacheUsingPackageSources (ISharpDevelopPackageRepositoryFactory repositoryFactory)
+ void CreateCacheUsingPackageSources (IMonoDevelopPackageRepositoryFactory repositoryFactory)
{
nuGetPackageSource = new PackageSource ("http://nuget.org", "NuGet");
machineCache = new FakePackageRepository ();
@@ -92,10 +92,10 @@ namespace MonoDevelop.PackageManagement.Tests
}
[Test]
- public void CreateRepository_CacheCastToISharpDevelopPackageRepositoryFactory_CreatesPackageRepositoryUsingPackageRepositoryFactoryPassedInConstructor ()
+ public void CreateRepository_CacheCastToIMonoDevelopPackageRepositoryFactory_CreatesPackageRepositoryUsingPackageRepositoryFactoryPassedInConstructor ()
{
CreateCache ();
- var factory = cache as ISharpDevelopPackageRepositoryFactory;
+ var factory = cache as IMonoDevelopPackageRepositoryFactory;
IPackageRepository repository = factory.CreateRepository (nuGetPackageSource.Source);
Assert.AreEqual (fakePackageRepositoryFactory.FakePackageRepository, repository);
@@ -451,7 +451,7 @@ namespace MonoDevelop.PackageManagement.Tests
packageSourcesHelper.RegisteredPackageSources.Clear ();
var invalidPackageSource = new PackageSource (String.Empty, "InvalidSource");
packageSourcesHelper.RegisteredPackageSources.Add (invalidPackageSource);
- var factory = new SharpDevelopPackageRepositoryFactory ();
+ var factory = new MonoDevelopPackageRepositoryFactory ();
CreateCacheUsingPackageSources (factory);
IPackageRepository repository = cache.CreateAggregateRepository ();
var aggregateRepository = (MonoDevelopAggregateRepository)repository;
@@ -468,7 +468,7 @@ namespace MonoDevelop.PackageManagement.Tests
packageSourcesHelper.RegisteredPackageSources.Clear ();
var invalidPackageSource = new PackageSource (String.Empty, "InvalidSource");
packageSourcesHelper.RegisteredPackageSources.Add (invalidPackageSource);
- var factory = new SharpDevelopPackageRepositoryFactory ();
+ var factory = new MonoDevelopPackageRepositoryFactory ();
CreateCacheUsingPackageSources (factory);
IPackageRepository repository = cache.CreateAggregateRepository ();
var aggregateRepository = (MonoDevelopAggregateRepository)repository;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageSourceViewModelTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageSourceViewModelTests.cs
index 1790b4c647..1f4727ff65 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageSourceViewModelTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageSourceViewModelTests.cs
@@ -25,7 +25,7 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using NUnit.Framework;
@@ -39,7 +39,7 @@ namespace MonoDevelop.PackageManagement.Tests
void CreatePackageSource ()
{
- CreatePackageSource ("http://sharpdevelop.codeplex.com", "Test");
+ CreatePackageSource ("http://monodevelop.codeplex.com", "Test");
}
void CreatePackageSource (string source, string name)
@@ -49,7 +49,7 @@ namespace MonoDevelop.PackageManagement.Tests
void CreatePackageSourceWithName (string name)
{
- CreatePackageSource ("http://sharpdevelop.codeplex.com", name);
+ CreatePackageSource ("http://monodevelop.codeplex.com", name);
}
void CreatePackageSourceWithSourceUrl (string sourceUrl)
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageViewModelTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageViewModelTests.cs
index b406395815..86800e3cec 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageViewModelTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageViewModelTests.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NuGet;
using NUnit.Framework;
@@ -221,7 +221,7 @@ namespace MonoDevelop.PackageManagement.Tests
public void HasLicenseUrl_PackageHasLicenseUrl_ReturnsTrue ()
{
CreateViewModel ();
- fakePackage.LicenseUrl = new Uri ("http://sharpdevelop.com");
+ fakePackage.LicenseUrl = new Uri ("http://monodevelop.com");
Assert.IsTrue (viewModel.HasLicenseUrl);
}
@@ -239,7 +239,7 @@ namespace MonoDevelop.PackageManagement.Tests
public void HasProjectUrl_PackageHasProjectUrl_ReturnsTrue ()
{
CreateViewModel ();
- fakePackage.ProjectUrl = new Uri ("http://sharpdevelop.com");
+ fakePackage.ProjectUrl = new Uri ("http://monodevelop.com");
Assert.IsTrue (viewModel.HasProjectUrl);
}
@@ -257,7 +257,7 @@ namespace MonoDevelop.PackageManagement.Tests
public void HasReportAbuseUrl_PackageHasReportAbuseUrl_ReturnsTrue ()
{
CreateViewModel ();
- fakePackage.ReportAbuseUrl = new Uri ("http://sharpdevelop.com");
+ fakePackage.ReportAbuseUrl = new Uri ("http://monodevelop.com");
Assert.IsTrue (viewModel.HasReportAbuseUrl);
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackagesViewModelTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackagesViewModelTests.cs
index 1dd3518bb4..988738e90d 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackagesViewModelTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackagesViewModelTests.cs
@@ -29,7 +29,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NuGet;
using NUnit.Framework;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ProcessPackageActionTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ProcessPackageActionTests.cs
index ef9622d12d..213dbfb3e8 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ProcessPackageActionTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ProcessPackageActionTests.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NuGet;
using NUnit.Framework;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ProjectHelper.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ProjectHelper.cs
index 0ea0adcad9..64343c5b98 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ProjectHelper.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ProjectHelper.cs
@@ -26,15 +26,14 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
-using MonoDevelop.Core;
using MonoDevelop.PackageManagement;
+using MonoDevelop.Core;
using MonoDevelop.Projects;
using System.Linq;
namespace MonoDevelop.PackageManagement.Tests.Helpers
{
- public static class ProjectHelper
+ static class ProjectHelper
{
public static ISolution CreateSolution ()
{
@@ -96,13 +95,13 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
public static void AddReference (FakeDotNetProject project, string referenceName, string hintPath = null)
{
- var reference = new ProjectReference (ReferenceType.Assembly, referenceName, hintPath);
+ var reference = ProjectReference.CreateCustomReference (ReferenceType.Assembly, referenceName, hintPath);
project.References.Add (reference);
}
public static void AddGacReference (FakeDotNetProject project, string referenceName)
{
- var reference = new ProjectReference (ReferenceType.Package, referenceName);
+ var reference = ProjectReference.CreateAssemblyReference (referenceName);
project.References.Add (reference);
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ProjectTargetFrameworkMonitorTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ProjectTargetFrameworkMonitorTests.cs
index 2286de495b..7be5ccceed 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ProjectTargetFrameworkMonitorTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ProjectTargetFrameworkMonitorTests.cs
@@ -310,6 +310,24 @@ namespace MonoDevelop.PackageManagement.Tests
Assert.AreEqual (1, eventArgs.Count);
Assert.AreEqual (secondProject, eventArgs [0].Project);
}
+
+ [Test]
+ public void ProjectTargetFrameworkChanged_ProjectRemovedFromSolutionAndProjectTargetFrameworkChanged_EventDoesNotFire ()
+ {
+ CreateProjectTargetFrameworkMonitor ();
+ FakeDotNetProject originalProject = LoadSolutionWithOneProject ();
+ CaptureProjectTargetFrameworkChangedEvents ();
+ // Ensure IDotNetProject.Equals method is used since a new DotNetProjectProxy is
+ // created for the event so the object instances will be different and just removing
+ // the instance from the list matching the instance is incorrect.
+ var project = new FakeDotNetProject ();
+ originalProject.EqualsAction = p => p == project;
+ solution.RaiseProjectRemovedEvent (project);
+
+ originalProject.RaiseModifiedEvent (originalProject, targetFrameworkPropertyName);
+
+ Assert.AreEqual (0, eventArgs.Count);
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RecentPackageInfoTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RecentPackageInfoTests.cs
index 0ed79dbc6c..fb35e28ed3 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RecentPackageInfoTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RecentPackageInfoTests.cs
@@ -25,7 +25,7 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NuGet;
using NUnit.Framework;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RecentPackageRepositoryTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RecentPackageRepositoryTests.cs
index ab9d358517..923997dae6 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RecentPackageRepositoryTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RecentPackageRepositoryTests.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NuGet;
using NUnit.Framework;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ReducedPackageOperationsTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ReducedPackageOperationsTests.cs
index 644f16fa5a..b230cf0802 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ReducedPackageOperationsTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ReducedPackageOperationsTests.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using NUnit.Framework;
using MonoDevelop.PackageManagement.Tests.Helpers;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RegisteredPackageRepositoriesTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RegisteredPackageRepositoriesTests.cs
index 61967dfbe5..d13ffd344b 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RegisteredPackageRepositoriesTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RegisteredPackageRepositoriesTests.cs
@@ -26,7 +26,7 @@
using System;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NuGet;
using NUnit.Framework;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RegisteredPackageSourcesViewModelTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RegisteredPackageSourcesViewModelTests.cs
index bfb9c04719..c793eff96e 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RegisteredPackageSourcesViewModelTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RegisteredPackageSourcesViewModelTests.cs
@@ -26,7 +26,7 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NuGet;
@@ -127,7 +127,7 @@ namespace MonoDevelop.PackageManagement.Tests
public void Load_PackageSourceModifiedAfterLoadAndSaveNotCalled_RegisteredPackageSourcesInOptionsUnchanged ()
{
CreateViewModel ();
- AddPackageSourceToOptions ("Test", "http://sharpdevelop.com");
+ AddPackageSourceToOptions ("Test", "http://monodevelop.com");
viewModel.Load ();
PackageSourceViewModel packageSourceViewModel = viewModel.PackageSourceViewModels [0];
@@ -135,7 +135,7 @@ namespace MonoDevelop.PackageManagement.Tests
packageSourceViewModel.SourceUrl = "changed-url";
var expectedSources = new PackageSource[] {
- new PackageSource ("http://sharpdevelop.com", "Test")
+ new PackageSource ("http://monodevelop.com", "Test")
};
PackageSourceCollectionAssert.AreEqual (expectedSources, packageSources);
@@ -145,7 +145,7 @@ namespace MonoDevelop.PackageManagement.Tests
public void Save_PackageSourceModifiedAfterLoad_RegisteredPackageSourcesInOptionsUpdated ()
{
CreateViewModel ();
- AddPackageSourceToOptions ("Test", "http://sharpdevelop.com");
+ AddPackageSourceToOptions ("Test", "http://monodevelop.com");
viewModel.Load ();
PackageSourceViewModel packageSourceViewModel = viewModel.PackageSourceViewModels [0];
@@ -165,17 +165,17 @@ namespace MonoDevelop.PackageManagement.Tests
public void Save_OnePackageSourceAddedAfterLoadAndBeforeSave_TwoRegisteredPackageSourcesInOptions ()
{
CreateViewModel ();
- AddPackageSourceToOptions ("Test", "http://sharpdevelop.com/1");
+ AddPackageSourceToOptions ("Test", "http://monodevelop.com/1");
viewModel.Load ();
- var newSource = new PackageSource ("http://sharpdevelop.com/2", "Test");
+ var newSource = new PackageSource ("http://monodevelop.com/2", "Test");
var newPackageSourceViewModel = new PackageSourceViewModel (newSource);
viewModel.PackageSourceViewModels.Add (newPackageSourceViewModel);
viewModel.Save ();
- var expectedSource = new PackageSource ("http://sharpdevelop.com/1", "Test");
+ var expectedSource = new PackageSource ("http://monodevelop.com/1", "Test");
var expectedSources = new PackageSource[] {
expectedSource,
@@ -191,12 +191,12 @@ namespace MonoDevelop.PackageManagement.Tests
CreateViewModel ();
viewModel.Load ();
viewModel.NewPackageSourceName = "Test";
- viewModel.NewPackageSourceUrl = "http://sharpdevelop.com";
+ viewModel.NewPackageSourceUrl = "http://monodevelop.com";
viewModel.AddPackageSourceCommand.Execute (null);
var expectedSources = new PackageSource[] {
- new PackageSource ("http://sharpdevelop.com", "Test")
+ new PackageSource ("http://monodevelop.com", "Test")
};
PackageSourceCollectionAssert.AreEqual (expectedSources, viewModel.PackageSourceViewModels);
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ReinstallPackageActionTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ReinstallPackageActionTests.cs
index 188523a129..06943b7899 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ReinstallPackageActionTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ReinstallPackageActionTests.cs
@@ -24,7 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
using MonoDevelop.Projects;
using NuGet;
@@ -99,12 +99,11 @@ namespace MonoDevelop.PackageManagement.Tests
{
CreateAction ("MyPackage", "1.2.3.4");
FakePackage package = AddPackageToSourceRepository ("MyPackage", "1.2.3.4");
- var firstReferenceBeingAdded = new ProjectReference (ReferenceType.Assembly, "NewAssembly");
- var secondReferenceBeingAdded = new ProjectReference (ReferenceType.Assembly, "NUnit.Framework");
+ var firstReferenceBeingAdded = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "NewAssembly");
+ var secondReferenceBeingAdded = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "NUnit.Framework");
project.FakeUninstallPackageAction.ExecuteAction = () => {
- var referenceBeingRemoved = new ProjectReference (ReferenceType.Assembly, "NUnit.Framework") {
- LocalCopy = false
- };
+ var referenceBeingRemoved = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "NUnit.Framework");
+ referenceBeingRemoved.LocalCopy = false;
packageManagementEvents.OnReferenceRemoving (referenceBeingRemoved);
};
bool installActionMaintainsLocalCopyReferences = false;
@@ -169,6 +168,18 @@ namespace MonoDevelop.PackageManagement.Tests
Assert.IsTrue (fileRemovedResult.Value);
Assert.IsNull (fileRemover.FileRemoved);
}
+
+ [Test]
+ public void Execute_PackageExistsInSourceRepository_PackageIsInstalledWithoutLicenseAgreementDialogShowns ()
+ {
+ CreateAction ("MyPackage", "1.2.3.4");
+ AddPackageToSourceRepository ("MyPackage", "1.2.3.4");
+
+ action.Execute ();
+
+ Assert.IsTrue (project.LastInstallPackageCreated.IsExecuteCalled);
+ Assert.IsFalse (project.LastInstallPackageCreated.LicensesMustBeAccepted);
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ReinstallProjectPackagesActionTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ReinstallProjectPackagesActionTests.cs
index 61ff6616d5..9fc767cacf 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ReinstallProjectPackagesActionTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ReinstallProjectPackagesActionTests.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NuGet;
using NUnit.Framework;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RestorePackagesActionTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RestorePackagesActionTests.cs
index fb19a62571..78dd92bf9f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RestorePackagesActionTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/RestorePackagesActionTests.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NUnit.Framework;
using NuGet;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/SettingProviderTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/SettingProviderTests.cs
index 6ce4d4f783..07c464a8f8 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/SettingProviderTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/SettingProviderTests.cs
@@ -25,7 +25,7 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using NUnit.Framework;
using MonoDevelop.PackageManagement.Tests.Helpers;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/SolutionPackageRepositoryPathTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/SolutionPackageRepositoryPathTests.cs
index ef40415b0b..058761fc55 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/SolutionPackageRepositoryPathTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/SolutionPackageRepositoryPathTests.cs
@@ -25,7 +25,7 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NUnit.Framework;
using MonoDevelop.Core;
using MonoDevelop.PackageManagement.Tests.Helpers;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/SolutionPackageRepositoryTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/SolutionPackageRepositoryTests.cs
index 7980a7767a..0952b5ca56 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/SolutionPackageRepositoryTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/SolutionPackageRepositoryTests.cs
@@ -28,7 +28,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using NUnit.Framework;
using MonoDevelop.PackageManagement.Tests.Helpers;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ThreadSafePackageManagementEventsTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ThreadSafePackageManagementEventsTests.cs
index 42810f1dac..9151e6067d 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ThreadSafePackageManagementEventsTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/ThreadSafePackageManagementEventsTests.cs
@@ -26,7 +26,7 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NuGet;
using NUnit.Framework;
@@ -49,10 +49,10 @@ namespace MonoDevelop.PackageManagement.Tests
threadSafeEvents = new ThreadSafePackageManagementEvents (unsafeEvents, RunGuiSyncDispatch);
}
- void RunGuiSyncDispatch (MessageHandler messageHandler)
+ void RunGuiSyncDispatch (Action action)
{
isGuiSyncDispatchCalled = true;
- messageHandler.Invoke ();
+ action.Invoke ();
}
void OnEventHandlerFired (object sender, EventArgs e)
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UninstallPackageActionTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UninstallPackageActionTests.cs
index 948780a2ab..23ab02a146 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UninstallPackageActionTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UninstallPackageActionTests.cs
@@ -26,7 +26,7 @@
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NuGet;
using NUnit.Framework;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdateAllPackagesInProjectTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdateAllPackagesInProjectTests.cs
index 4d267ceeae..45861805d4 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdateAllPackagesInProjectTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdateAllPackagesInProjectTests.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using NUnit.Framework;
using MonoDevelop.PackageManagement.Tests.Helpers;
@@ -47,9 +47,9 @@ namespace MonoDevelop.PackageManagement.Tests
updateAllPackagesInProject = new UpdateAllPackagesInProject (fakeProject);
}
- void AddPackageToProject (string packageId)
+ void AddPackageToProject (string packageId, string version = "1.0")
{
- var package = new FakePackage (packageId, "1.0");
+ var package = new FakePackage (packageId, version);
fakeProject.FakePackagesInReverseDependencyOrder.Add (package);
}
@@ -227,6 +227,20 @@ namespace MonoDevelop.PackageManagement.Tests
Assert.IsTrue (update);
}
+
+ [Test]
+ public void CreateActions_TwoPackagesInProjectOnePrereleaseOneStable_AllowPrereleaseIsTrueForPrereleasePackage ()
+ {
+ CreateUpdateAllPackagesInProject ();
+ AddPackageToProject ("Test1", "1.0.0-alpha");
+ AddPackageToProject ("Test2", "1.0.0");
+ CallCreateActions ();
+
+ Assert.AreEqual ("Test1", updateActions [0].PackageId);
+ Assert.AreEqual ("Test2", updateActions [1].PackageId);
+ Assert.AreEqual (true, updateActions [0].AllowPrereleaseVersions);
+ Assert.AreEqual (false, updateActions [1].AllowPrereleaseVersions);
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdateAllPackagesInSolutionTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdateAllPackagesInSolutionTests.cs
index d73ffc3db6..6e923e2d59 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdateAllPackagesInSolutionTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdateAllPackagesInSolutionTests.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using NUnit.Framework;
using MonoDevelop.PackageManagement.Tests.Helpers;
@@ -49,9 +49,9 @@ namespace MonoDevelop.PackageManagement.Tests
updateAllPackagesInSolution = new UpdateAllPackagesInSolution (fakeSolution, fakeSourceRepository);
}
- void AddPackageToSolution (string packageId)
+ void AddPackageToSolution (string packageId, string version = "1.0")
{
- var package = new FakePackage (packageId, "1.0");
+ var package = new FakePackage (packageId, version);
fakeSolution.FakePackagesInReverseDependencyOrder.Add (package);
}
@@ -261,6 +261,21 @@ namespace MonoDevelop.PackageManagement.Tests
Assert.IsTrue (updateAllPackagesInSolution.UpdateDependencies);
}
+
+ [Test]
+ public void CreateActions_TwoPackagesOneStableOnePrereleaseInSolutionWithOneProject_ReturnsTwoActionsWithAllowPrereleaseTrueForPrereleasePackage ()
+ {
+ CreateUpdateAllPackagesInSolution ();
+ FakePackageManagementProject project = AddProjectToSolution ("MyProject");
+ AddPackageToSolution ("Test1", "1.0.0-alpha");
+ AddPackageToSolution ("Test2", "1.0");
+ CallCreateActions ();
+
+ Assert.AreEqual ("Test1", project.FirstFakeUpdatePackageActionCreated.PackageId);
+ Assert.AreEqual (true, project.FirstFakeUpdatePackageActionCreated.AllowPrereleaseVersions);
+ Assert.AreEqual ("Test2", project.FakeUpdatePackageActionsCreated [1].PackageId);
+ Assert.AreEqual (false, project.FakeUpdatePackageActionsCreated[1].AllowPrereleaseVersions);
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdatePackageActionTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdatePackageActionTests.cs
index 15c0419c37..df84c7bd79 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdatePackageActionTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdatePackageActionTests.cs
@@ -28,7 +28,6 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using ICSharpCode.PackageManagement;
using NuGet;
using NUnit.Framework;
using MonoDevelop.PackageManagement.Tests.Helpers;
@@ -490,12 +489,11 @@ namespace MonoDevelop.PackageManagement.Tests
CreateSolution ();
fakeProject.FakePackages.Add (new FakePackage ("Test", "1.0"));
action.Package = new FakePackage ("Test", "1.1");
- var firstReferenceBeingAdded = new ProjectReference (ReferenceType.Assembly, "NewAssembly");
- var secondReferenceBeingAdded = new ProjectReference (ReferenceType.Assembly, "NUnit.Framework");
+ var firstReferenceBeingAdded = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "NewAssembly");
+ var secondReferenceBeingAdded = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "NUnit.Framework");
fakeProject.UpdatePackageAction = (p, a) => {
- var referenceBeingRemoved = new ProjectReference (ReferenceType.Assembly, "NUnit.Framework") {
- LocalCopy = true
- };
+ var referenceBeingRemoved = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "NUnit.Framework");
+ referenceBeingRemoved.LocalCopy = true;
packageManagementEvents.OnReferenceRemoving (referenceBeingRemoved);
packageManagementEvents.OnReferenceAdding (firstReferenceBeingAdded);
packageManagementEvents.OnReferenceAdding (secondReferenceBeingAdded);
@@ -512,12 +510,11 @@ namespace MonoDevelop.PackageManagement.Tests
CreateSolution ();
fakeProject.FakePackages.Add (new FakePackage ("Test", "1.0"));
action.Package = new FakePackage ("Test", "1.1");
- var firstReferenceBeingAdded = new ProjectReference (ReferenceType.Assembly, "NewAssembly");
- var secondReferenceBeingAdded = new ProjectReference (ReferenceType.Assembly, "NUnit.Framework");
+ var firstReferenceBeingAdded = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "NewAssembly");
+ var secondReferenceBeingAdded = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "NUnit.Framework");
fakeProject.UpdatePackageAction = (p, a) => {
- var referenceBeingRemoved = new ProjectReference (ReferenceType.Assembly, "nunit.framework") {
- LocalCopy = true
- };
+ var referenceBeingRemoved = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "nunit.framework");
+ referenceBeingRemoved.LocalCopy = true;
packageManagementEvents.OnReferenceRemoving (referenceBeingRemoved);
packageManagementEvents.OnReferenceAdding (firstReferenceBeingAdded);
packageManagementEvents.OnReferenceAdding (secondReferenceBeingAdded);
@@ -534,14 +531,12 @@ namespace MonoDevelop.PackageManagement.Tests
CreateSolution ();
fakeProject.FakePackages.Add (new FakePackage ("Test", "1.0"));
action.Package = new FakePackage ("Test", "1.1");
- var firstReferenceBeingAdded = new ProjectReference (ReferenceType.Assembly, "NewAssembly") {
- LocalCopy = true
- };
- var secondReferenceBeingAdded = new ProjectReference (ReferenceType.Assembly, "NUnit.Framework");
+ var firstReferenceBeingAdded = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "NewAssembly");
+ firstReferenceBeingAdded.LocalCopy = true;
+ var secondReferenceBeingAdded = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "NUnit.Framework");
fakeProject.UpdatePackageAction = (p, a) => {
- var referenceBeingRemoved = new ProjectReference (ReferenceType.Assembly, "NUnit.Framework") {
- LocalCopy = false
- };
+ var referenceBeingRemoved = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "NUnit.Framework");
+ referenceBeingRemoved.LocalCopy = false;
packageManagementEvents.OnReferenceRemoving (referenceBeingRemoved);
packageManagementEvents.OnReferenceAdding (firstReferenceBeingAdded);
packageManagementEvents.OnReferenceAdding (secondReferenceBeingAdded);
@@ -558,14 +553,12 @@ namespace MonoDevelop.PackageManagement.Tests
CreateSolution ();
fakeProject.FakePackages.Add (new FakePackage ("Test", "1.0"));
action.Package = new FakePackage ("Test", "1.1");
- var firstReferenceBeingAdded = new ProjectReference (ReferenceType.Assembly, "NewAssembly") {
- LocalCopy = true
- };
- var secondReferenceBeingAdded = new ProjectReference (ReferenceType.Assembly, "NUnit.Framework");
+ var firstReferenceBeingAdded = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "NewAssembly");
+ firstReferenceBeingAdded.LocalCopy = true;
+ var secondReferenceBeingAdded = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "NUnit.Framework");
fakeProject.UpdatePackageAction = (p, a) => {
- var referenceBeingRemoved = new ProjectReference (ReferenceType.Assembly, "nunit.framework") {
- LocalCopy = false
- };
+ var referenceBeingRemoved = ProjectReference.CreateCustomReference (ReferenceType.Assembly, "nunit.framework");
+ referenceBeingRemoved.LocalCopy = false;
packageManagementEvents.OnReferenceRemoving (referenceBeingRemoved);
packageManagementEvents.OnReferenceAdding (firstReferenceBeingAdded);
packageManagementEvents.OnReferenceAdding (secondReferenceBeingAdded);
@@ -651,6 +644,35 @@ namespace MonoDevelop.PackageManagement.Tests
Assert.AreEqual (expectedFileName, fileRemover.FileRemoved);
Assert.IsFalse (fileRemovedResult.Value);
}
+
+ [Test]
+ public void NewInstance_LicensesMustBeAccepted_TrueByDefault ()
+ {
+ CreateSolution ();
+
+ Assert.IsTrue (action.LicensesMustBeAccepted);
+ }
+
+ [Test]
+ public void Execute_UpdateIfPackageDoesNotExistInProjectSetToFalseAndPackageDoesNotExistInProjectAndPackageRequiresLicenseAcceptance_PackageLicenseAcceptanceIsNotRequested ()
+ {
+ CreateSolution ();
+ var package = new FakePackage ("Test") {
+ RequireLicenseAcceptance = true
+ };
+ action.Package = package;
+ var operation = new FakePackageOperation (package, PackageAction.Install);
+ action.PackageId = package.Id;
+ action.PackageVersion = package.Version;
+ fakeProject.FakeInstallOperations.Add (operation);
+ action.UpdateIfPackageDoesNotExistInProject = false;
+ action.Execute ();
+
+ bool updated = fakeProject.IsUpdatePackageCalled;
+
+ Assert.IsFalse (updated);
+ Assert.IsNull (action.LicenseAcceptanceService.PackagesAccepted);
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdatedPackagesInSolutionTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdatedPackagesInSolutionTests.cs
index a67593fd7c..0a0a83eed6 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdatedPackagesInSolutionTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdatedPackagesInSolutionTests.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NUnit.Framework;
@@ -588,6 +588,103 @@ namespace MonoDevelop.PackageManagement.Tests
Assert.AreEqual ("MyPackage", updatedPackages.GetPackages ().First ().Id);
Assert.AreEqual ("1.8", updatedPackages.GetPackages ().First ().Version.ToString ());
}
+
+ [Test]
+ public void CheckForUpdates_ProjectHasPreReleasePackageWhichHasUpdatedPrereleasePackage_OnePrereleaseUpdateFound ()
+ {
+ CreateUpdatedPackagesInSolution ();
+ FakePackageManagementProject project = AddProjectToSolution ();
+ project.AddPackageReference ("MyPackage", "1.0.1-alpha");
+ AddUpdatedPackageToAggregateSourceRepository ("MyPackage", "1.0.1-beta");
+ updatedPackagesInSolution.CheckForUpdates ();
+
+ UpdatedPackagesInProject updatedPackages = updatedPackagesInSolution.GetUpdatedPackages (project.Project);
+
+ Assert.AreEqual (1, updatedPackages.GetPackages ().Count ());
+ Assert.AreEqual ("MyPackage", updatedPackages.GetPackages ().First ().Id);
+ Assert.AreEqual ("1.0.1-beta", updatedPackages.GetPackages ().First ().Version.ToString ());
+ }
+
+ [Test]
+ public void CheckForUpdates_ProjectHasPreReleasePackageWhichHasUpdatedStablePackage_OneStableUpdateFound ()
+ {
+ CreateUpdatedPackagesInSolution ();
+ FakePackageManagementProject project = AddProjectToSolution ();
+ project.AddPackageReference ("MyPackage", "1.0.1-alpha");
+ AddUpdatedPackageToAggregateSourceRepository ("MyPackage", "1.0.1");
+ updatedPackagesInSolution.CheckForUpdates ();
+
+ UpdatedPackagesInProject updatedPackages = updatedPackagesInSolution.GetUpdatedPackages (project.Project);
+
+ Assert.AreEqual (1, updatedPackages.GetPackages ().Count ());
+ Assert.AreEqual ("MyPackage", updatedPackages.GetPackages ().First ().Id);
+ Assert.AreEqual ("1.0.1", updatedPackages.GetPackages ().First ().Version.ToString ());
+ }
+
+ [Test]
+ public void CheckForUpdates_ProjectHasStableAndPreReleasePackagesBothWithUpdatese_TwoUpdatesFound ()
+ {
+ CreateUpdatedPackagesInSolution ();
+ FakePackageManagementProject project = AddProjectToSolution ();
+ project.AddPackageReference ("MyPackage", "1.0.1-alpha");
+ project.AddPackageReference ("AnotherPackage", "1.0");
+ AddUpdatedPackageToAggregateSourceRepository ("MyPackage", "1.0.1-beta");
+ AddUpdatedPackageToAggregateSourceRepository ("AnotherPackage", "1.1");
+ updatedPackagesInSolution.CheckForUpdates ();
+
+ UpdatedPackagesInProject updatedPackages = updatedPackagesInSolution.GetUpdatedPackages (project.Project);
+
+ Assert.AreEqual (2, updatedPackages.GetPackages ().Count ());
+ Assert.AreEqual ("AnotherPackage", updatedPackages.GetPackages ().First ().Id);
+ Assert.AreEqual ("1.1", updatedPackages.GetPackages ().First ().Version.ToString ());
+ Assert.AreEqual ("MyPackage", updatedPackages.GetPackages ().Last ().Id);
+ Assert.AreEqual ("1.0.1-beta", updatedPackages.GetPackages ().Last ().Version.ToString ());
+ }
+
+ [Test]
+ public void CheckForUpdates_ProjectHasStablePackageWhichHasUpdatedPrereleasePackage_NoUpdatesFound ()
+ {
+ CreateUpdatedPackagesInSolution ();
+ FakePackageManagementProject project = AddProjectToSolution ();
+ project.AddPackageReference ("MyPackage", "1.0.1");
+ AddUpdatedPackageToAggregateSourceRepository ("MyPackage", "1.1.0-alpha");
+ updatedPackagesInSolution.CheckForUpdates ();
+
+ UpdatedPackagesInProject updatedPackages = updatedPackagesInSolution.GetUpdatedPackages (project.Project);
+
+ Assert.AreEqual (0, updatedPackages.GetPackages ().Count ());
+ }
+
+ [Test]
+ public void GetUpdatedPackages_UpdatingThreeOldAndroidPackagesInstallsOneAndUpdatesOneAndRemovesOneWithOneInstall_NoUpdatesRemain ()
+ {
+ CreateUpdatedPackagesInSolution ();
+ FakePackageManagementProject project = AddProjectToSolution ();
+ project.AddPackageReference ("Xamarin.Android.Support.v13", "20.0.0.4");
+ project.AddPackageReference ("Xamarin.Android.Support.v4", "20.0.0.4");
+ project.AddPackageReference ("Xamarin.Android.Support.v7.AppCompat", "20.0.0.2");
+ AddUpdatedPackageToAggregateSourceRepository ("Xamarin.Android.Support.v13", "23.1.1.0");
+ AddUpdatedPackageToAggregateSourceRepository ("Xamarin.Android.Support.v4", "23.1.1.0");
+ AddUpdatedPackageToAggregateSourceRepository ("Xamarin.Android.Support.v7.AppCompat", "23.1.1.0");
+ updatedPackagesInSolution.CheckForUpdates ();
+ int originalUpdatesAvailable = updatedPackagesInSolution
+ .GetUpdatedPackages (project.Project)
+ .GetPackages ()
+ .Count ();
+ var task = taskFactory.FakeTasksCreated [0] as FakeTask<CheckForUpdatesTask>;
+ task.ExecuteTaskButNotContinueWith ();
+ project.PackageReferences.Clear ();
+ project.AddPackageReference ("Xamarin.Android.Support.v4", "23.1.1.0");
+ project.AddPackageReference ("Xamarin.Android.Support.v7.AppCompat", "23.1.1.0");
+ var installedPackage = FakePackage.CreatePackageWithVersion ("Xamarin.Android.Support.v4", "23.1.1.0");
+ packageManagementEvents.OnParentPackageInstalled (installedPackage, project);
+ task.ExecuteContinueWith ();
+
+ UpdatedPackagesInProject updatedPackages = updatedPackagesInSolution.GetUpdatedPackages (project.Project);
+
+ Assert.AreEqual (3, originalUpdatesAvailable);
+ Assert.AreEqual (0, updatedPackages.GetPackages ().Count ());
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdatedPackagesTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdatedPackagesTests.cs
index 31407117ee..9b4c2316c9 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdatedPackagesTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdatedPackagesTests.cs
@@ -28,7 +28,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Versioning;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using NUnit.Framework;
using MonoDevelop.PackageManagement.Tests.Helpers;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UserAgentGeneratorForRepositoryRequestsTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UserAgentGeneratorForRepositoryRequestsTests.cs
index 6a729abaa7..74da61618b 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UserAgentGeneratorForRepositoryRequestsTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UserAgentGeneratorForRepositoryRequestsTests.cs
@@ -26,7 +26,7 @@
using System;
using System.Net;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NuGet;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.addin.xml b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.addin.xml
index 2c2bb34b98..caa93c4622 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.addin.xml
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.addin.xml
@@ -7,6 +7,7 @@
</Runtime>
<Extension path = "/MonoDevelop/Ide/Commands">
+ <Category _name = "NuGet" id = "NuGet">
<Command
id = "MonoDevelop.PackageManagement.Commands.AddNuGetPackages"
_description = "Add NuGet packages to the project"
@@ -54,6 +55,7 @@
_description="Retargets all packages"
_label="Re_target"
defaultHandler="MonoDevelop.PackageManagement.Commands.ReinstallAllPackagesInProjectHandler" />
+ </Category>
</Extension>
<Extension path="/MonoDevelop/Ide/MainMenu/Project">
@@ -97,7 +99,7 @@
</Extension>
<Extension path="/MonoDevelop/Core/StockIcons">
- <StockIcon stockid="md-nuget-package" resource="reference-48.png" />
+ <StockIcon stockid="md-nuget-package" resource="package-48.png" />
<StockIcon stockid="md-nuget-package-source" resource="package-source-32.png" size="Dnd" />
<StockIcon stockid="md-prefs-package" resource="prefs-package-16.png" size="Menu" />
<StockIcon stockid="md-prefs-package-source" resource="prefs-package-source-16.png" size="Menu" />
@@ -146,7 +148,11 @@
<Class class="MonoDevelop.PackageManagement.SearchPackagesSearchCategory" />
</Extension>
- <Extension path="/MonoDevelop/ProjectModel/MSBuildExtensions">
+ <Extension path="/MonoDevelop/ProjectModel/ProjectModelExtensions">
<Class class="MonoDevelop.PackageManagement.PackageManagementMSBuildExtension" />
</Extension>
+ <!--
+ <Extension path="/MonoDevelop/Refactoring/CodeDiagnosticProvider">
+ <Class class="MonoDevelop.PackageManagement.Refactoring.PackageCodeDiagnosticProvider" />
+ </Extension>-->
</ExtensionModel>
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj
index e1673e7ae1..ffb8d42e5f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj
@@ -115,10 +115,6 @@
<Compile Include="MonoDevelop.PackageManagement\IRegisteredPackageRepositories.cs" />
<Compile Include="MonoDevelop.PackageManagement\ISelectProjectsService.cs" />
<Compile Include="MonoDevelop.PackageManagement\ISettingsFactory.cs" />
- <Compile Include="MonoDevelop.PackageManagement\ISharpDevelopPackageManager.cs" />
- <Compile Include="MonoDevelop.PackageManagement\ISharpDevelopPackageRepositoryFactory.cs" />
- <Compile Include="MonoDevelop.PackageManagement\ISharpDevelopProjectManager.cs" />
- <Compile Include="MonoDevelop.PackageManagement\ISharpDevelopProjectSystemFactory.cs" />
<Compile Include="MonoDevelop.PackageManagement\ISolutionPackageRepository.cs" />
<Compile Include="MonoDevelop.PackageManagement\ISolutionPackageRepositoryFactory.cs" />
<Compile Include="MonoDevelop.PackageManagement\ITask.cs" />
@@ -159,7 +155,7 @@
<Compile Include="MonoDevelop.PackageManagement\RecentPackagesViewModel.cs" />
<Compile Include="MonoDevelop.PackageManagement\ReducedPackageOperations.cs" />
<Compile Include="MonoDevelop.PackageManagement\RegisteredPackageSourcesViewModel.cs" />
- <Compile Include="MonoDevelop.PackageManagement\RemovedPackageReferenceMonitor.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageReferenceMonitor.cs" />
<Compile Include="MonoDevelop.PackageManagement\ResolveFileConflictEventArgs.cs" />
<Compile Include="MonoDevelop.PackageManagement\SelectedProjectsForInstalledPackages.cs" />
<Compile Include="MonoDevelop.PackageManagement\SelectedProjectsForUpdatedPackages.cs" />
@@ -194,7 +190,6 @@
<Compile Include="MonoDevelop.PackageManagement\ProcessPackageAction.cs" />
<Compile Include="MonoDevelop.PackageManagement\ProcessPackageOperationsAction.cs" />
<Compile Include="MonoDevelop.PackageManagement\ProjectBrowserUpdater.cs" />
- <Compile Include="MonoDevelop.PackageManagement\ProjectExtensions.cs" />
<Compile Include="MonoDevelop.PackageManagement\ProjectTargetFramework.cs" />
<Compile Include="MonoDevelop.PackageManagement\ProjectTemplatePackageRepositoryCache.cs" />
<Compile Include="MonoDevelop.PackageManagement\ProjectTemplatePackageSettingsFileName.cs" />
@@ -207,12 +202,6 @@
<Compile Include="MonoDevelop.PackageManagement\RegisteredProjectTemplatePackageSources.cs" />
<Compile Include="MonoDevelop.PackageManagement\SettingsFactory.cs" />
<Compile Include="MonoDevelop.PackageManagement\MonoDevelopHttpUserAgent.cs" />
- <Compile Include="MonoDevelop.PackageManagement\SharpDevelopPackageManager.cs" />
- <Compile Include="MonoDevelop.PackageManagement\SharpDevelopPackageManagerFactory.cs" />
- <Compile Include="MonoDevelop.PackageManagement\SharpDevelopPackageRepositoryFactory.cs" />
- <Compile Include="MonoDevelop.PackageManagement\SharpDevelopProjectManager.cs" />
- <Compile Include="MonoDevelop.PackageManagement\SharpDevelopProjectSystem.cs" />
- <Compile Include="MonoDevelop.PackageManagement\SharpDevelopProjectSystemFactory.cs" />
<Compile Include="MonoDevelop.PackageManagement\SolutionExtensions.cs" />
<Compile Include="MonoDevelop.PackageManagement\SolutionPackageRepository.cs" />
<Compile Include="MonoDevelop.PackageManagement\SolutionPackageRepositoryFactory.cs" />
@@ -285,7 +274,6 @@
<Compile Include="MonoDevelop.PackageManagement\PackageRestoreRunner.cs" />
<Compile Include="MonoDevelop.PackageManagement.Gui\PackageCellView.cs" />
<Compile Include="MonoDevelop.PackageManagement\SearchPackagesSearchCategory.cs" />
- <Compile Include="MonoDevelop.PackageManagement\SearchPackagesDataSource.cs" />
<Compile Include="MonoDevelop.PackageManagement.Gui\AddPackagesDialogRunner.cs" />
<Compile Include="MonoDevelop.PackageManagement.Commands\ProjectPackagesFolderNodeCommandHandler.cs" />
<Compile Include="MonoDevelop.PackageManagement.NodeBuilders\ProjectReferenceNodeBuilderExtension.cs" />
@@ -300,6 +288,7 @@
</Compile>
<Compile Include="MonoDevelop.PackageManagement.Gui\DialogExtensions.cs" />
<Compile Include="MonoDevelop.PackageManagement.Gui\PackageCellViewEventArgs.cs" />
+ <Compile Include="MonoDevelop.PackageManagement.Gui\Styles.cs" />
<Compile Include="MonoDevelop.PackageManagement\ImageLoader.cs" />
<Compile Include="MonoDevelop.PackageManagement\ImageLoadedEventArgs.cs" />
<Compile Include="MonoDevelop.PackageManagement\PackageSourceViewModelChecker.cs" />
@@ -366,6 +355,7 @@
<Compile Include="MonoDevelop.PackageManagement\EnsureNuGetPackageBuildImportsTargetUpdater.cs" />
<Compile Include="MonoDevelop.PackageManagement\CheckForUpdatesTaskRunner.cs" />
<Compile Include="MonoDevelop.PackageManagement\CheckForUpdatesTask.cs" />
+ <Compile Include="MonoDevelop.PackageManagement.Refactoring\PackageCodeDiagnosticProvider.cs" />
<Compile Include="MonoDevelop.PackageManagement\ProjectReloadedEventArgs.cs" />
<Compile Include="MonoDevelop.PackageManagement\OpenPackageReadmeMonitor.cs" />
<Compile Include="MonoDevelop.PackageManagement\IOpenPackageReadMeMonitor.cs" />
@@ -375,6 +365,20 @@
<Compile Include="MonoDevelop.PackageManagement\LocalCopyReferenceMaintainer.cs" />
<Compile Include="MonoDevelop.PackageManagement\DotNetSolutionEventArgs.cs" />
<Compile Include="MonoDevelop.PackageManagement\DotNetProjectImportEventArgs.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IMonoDevelopProjectManager.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IMonoDevelopPackageManager.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\MonoDevelopPackageManagerFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IMonoDevelopPackageRepositoryFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IMonoDevelopProjectSystemFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\MonoDevelopPackageRepositoryFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\MonoDevelopPackageManager.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\MonoDevelopProjectManager.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\MonoDevelopProjectSystem.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\MonoDevelopProjectSystemFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementBackgroundDispatcher.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementSolutionProjectService.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\NuGetPackageNewImportsHandler.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\INuGetPackageNewImportsHandler.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="MonoDevelop.PackageManagement.addin.xml" />
@@ -387,25 +391,97 @@
<EmbeddedResource Include="icons\package-source-32%402x.png">
<LogicalName>package-source-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\package-source-32~dark.png">
+ <LogicalName>package-source-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-source-32~dark%402x.png">
+ <LogicalName>package-source-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-source-32~sel.png">
+ <LogicalName>package-source-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-source-32~sel%402x.png">
+ <LogicalName>package-source-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-source-32~dark~sel.png">
+ <LogicalName>package-source-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-source-32~dark~sel%402x.png">
+ <LogicalName>package-source-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-package-16.png">
<LogicalName>prefs-package-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-package-16%402x.png">
<LogicalName>prefs-package-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-package-16~dark.png">
+ <LogicalName>prefs-package-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-package-16~dark%402x.png">
+ <LogicalName>prefs-package-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-package-16~sel.png">
+ <LogicalName>prefs-package-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-package-16~sel%402x.png">
+ <LogicalName>prefs-package-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-package-16~dark~sel.png">
+ <LogicalName>prefs-package-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-package-16~dark~sel%402x.png">
+ <LogicalName>prefs-package-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-package-source-16.png">
<LogicalName>prefs-package-source-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-package-source-16%402x.png">
<LogicalName>prefs-package-source-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-package-source-16~dark.png">
+ <LogicalName>prefs-package-source-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-package-source-16~dark%402x.png">
+ <LogicalName>prefs-package-source-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-package-source-16~sel.png">
+ <LogicalName>prefs-package-source-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-package-source-16~sel%402x.png">
+ <LogicalName>prefs-package-source-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-package-source-16~dark~sel.png">
+ <LogicalName>prefs-package-source-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-package-source-16~dark~sel%402x.png">
+ <LogicalName>prefs-package-source-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
</ItemGroup>
<ItemGroup>
- <EmbeddedResource Include="icons\reference-48.png">
- <LogicalName>reference-48.png</LogicalName>
+ <EmbeddedResource Include="icons\package-48.png">
+ <LogicalName>package-48.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\reference-48%402x.png">
- <LogicalName>reference-48@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\package-48%402x.png">
+ <LogicalName>package-48@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-48~dark.png">
+ <LogicalName>package-48~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-48~dark%402x.png">
+ <LogicalName>package-48~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-48~sel.png">
+ <LogicalName>package-48~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-48~sel%402x.png">
+ <LogicalName>package-48~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-48~dark~sel.png">
+ <LogicalName>package-48~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-48~dark~sel%402x.png">
+ <LogicalName>package-48~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
@@ -415,11 +491,6 @@
<Name>MonoDevelop.Core</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\core\MonoDevelop.Ide\MonoDevelop.Ide.csproj">
- <Project>{27096E7F-C91C-4AC6-B289-6897A701DF21}</Project>
- <Name>MonoDevelop.Ide</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\..\..\external\mono-addins\Mono.Addins\Mono.Addins.csproj">
<Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
<Name>Mono.Addins</Name>
@@ -440,6 +511,16 @@
<Name>ICSharpCode.NRefactory</Name>
<Private>False</Private>
</ProjectReference>
+ <ProjectReference Include="..\..\core\MonoDevelop.Ide\MonoDevelop.Ide.csproj">
+ <Project>{27096E7F-C91C-4AC6-B289-6897A701DF21}</Project>
+ <Name>MonoDevelop.Ide</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\MonoDevelop.Refactoring\MonoDevelop.Refactoring.csproj">
+ <Project>{100568FC-F4E8-439B-94AD-41D11724E45B}</Project>
+ <Name>MonoDevelop.Refactoring</Name>
+ <Private>False</Private>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="MonoDevelop.PackageManagement.NodeBuilders\" />
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AcceptLicensesEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AcceptLicensesEventArgs.cs
index 4f4eeeedde..1ba27e9429 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AcceptLicensesEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AcceptLicensesEventArgs.cs
@@ -30,9 +30,9 @@ using System;
using System.Collections.Generic;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class AcceptLicensesEventArgs : EventArgs
+ internal class AcceptLicensesEventArgs : EventArgs
{
public AcceptLicensesEventArgs(IEnumerable<IPackage> packages)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AggregateExceptionErrorMessage.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AggregateExceptionErrorMessage.cs
index c8e33a8997..35a27c720b 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AggregateExceptionErrorMessage.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AggregateExceptionErrorMessage.cs
@@ -30,9 +30,9 @@ using System;
using System.Collections.Generic;
using System.Text;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class AggregateExceptionErrorMessage
+ internal class AggregateExceptionErrorMessage
{
AggregateException ex;
StringBuilder errorMessage = new StringBuilder();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AvailablePackagesViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AvailablePackagesViewModel.cs
index 1af600c304..9e3a3b2a80 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AvailablePackagesViewModel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AvailablePackagesViewModel.cs
@@ -34,9 +34,9 @@ using MonoDevelop.PackageManagement;
using NuGet;
using MonoDevelop.Core;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class AvailablePackagesViewModel : PackagesViewModel
+ internal class AvailablePackagesViewModel : PackagesViewModel
{
ISolutionPackageRepository solutionPackageRepository;
IPackageRepository repository;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/BackgroundPackageActionRunner.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/BackgroundPackageActionRunner.cs
index 258e102084..49c4b94f00 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/BackgroundPackageActionRunner.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/BackgroundPackageActionRunner.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.Ide;
using MonoDevelop.Projects;
@@ -35,7 +35,7 @@ using NuGet;
namespace MonoDevelop.PackageManagement
{
- public class BackgroundPackageActionRunner : IBackgroundPackageActionRunner
+ internal class BackgroundPackageActionRunner : IBackgroundPackageActionRunner
{
static MonoDevelop.Core.Instrumentation.Counter InstallPackageCounter = MonoDevelop.Core.Instrumentation.InstrumentationService.CreateCounter ("Package Installed", "Package Management", id:"PackageManagement.Package.Installed");
static MonoDevelop.Core.Instrumentation.Counter UninstallPackageCounter = MonoDevelop.Core.Instrumentation.InstrumentationService.CreateCounter ("Package Uninstalled", "Package Management", id:"PackageManagement.Package.Uninstalled");
@@ -79,7 +79,13 @@ namespace MonoDevelop.PackageManagement
AddInstallActionsToPendingQueue (actions);
packageManagementEvents.OnPackageOperationsStarting ();
runCount++;
- BackgroundDispatch (() => TryRunActionsWithProgressMonitor (progressMessage, actions.ToList ()));
+
+ List<IPackageAction> actionsList = actions.ToList ();
+ BackgroundDispatch (() => {
+ TryRunActionsWithProgressMonitor (progressMessage, actionsList);
+ actionsList = null;
+ progressMessage = null;
+ });
}
void AddInstallActionsToPendingQueue (IEnumerable<IPackageAction> actions)
@@ -89,14 +95,6 @@ namespace MonoDevelop.PackageManagement
}
}
- public void RunAndWait (ProgressMonitorStatusMessage progressMessage, IEnumerable<IPackageAction> actions)
- {
- AddInstallActionsToPendingQueue (actions);
- packageManagementEvents.OnPackageOperationsStarting ();
- runCount++;
- BackgroundDispatchAndWait (() => TryRunActionsWithProgressMonitor (progressMessage, actions.ToList ()));
- }
-
void TryRunActionsWithProgressMonitor (ProgressMonitorStatusMessage progressMessage, IList<IPackageAction> actions)
{
try {
@@ -110,7 +108,7 @@ namespace MonoDevelop.PackageManagement
void RunActionsWithProgressMonitor (ProgressMonitorStatusMessage progressMessage, IList<IPackageAction> installPackageActions)
{
- using (IProgressMonitor monitor = progressMonitorFactory.CreateProgressMonitor (progressMessage.Status)) {
+ using (ProgressMonitor monitor = progressMonitorFactory.CreateProgressMonitor (progressMessage.Status)) {
using (PackageManagementEventsMonitor eventMonitor = CreateEventMonitor (monitor)) {
try {
monitor.BeginTask (null, installPackageActions.Count);
@@ -130,20 +128,20 @@ namespace MonoDevelop.PackageManagement
}
}
- PackageManagementEventsMonitor CreateEventMonitor (IProgressMonitor monitor)
+ PackageManagementEventsMonitor CreateEventMonitor (ProgressMonitor monitor)
{
return CreateEventMonitor (monitor, packageManagementEvents, progressProvider);
}
protected virtual PackageManagementEventsMonitor CreateEventMonitor (
- IProgressMonitor monitor,
+ ProgressMonitor monitor,
IPackageManagementEvents packageManagementEvents,
IProgressProvider progressProvider)
{
return new PackageManagementEventsMonitor (monitor, packageManagementEvents, progressProvider);
}
- void RunActionsWithProgressMonitor (IProgressMonitor monitor, IList<IPackageAction> packageActions)
+ void RunActionsWithProgressMonitor (ProgressMonitor monitor, IList<IPackageAction> packageActions)
{
foreach (IPackageAction action in packageActions) {
action.Execute ();
@@ -216,26 +214,21 @@ namespace MonoDevelop.PackageManagement
public void ShowError (ProgressMonitorStatusMessage progressMessage, string error)
{
- using (IProgressMonitor monitor = progressMonitorFactory.CreateProgressMonitor (progressMessage.Status)) {
+ using (ProgressMonitor monitor = progressMonitorFactory.CreateProgressMonitor (progressMessage.Status)) {
monitor.Log.WriteLine (error);
monitor.ReportError (progressMessage.Error, null);
monitor.ShowPackageConsole ();
}
}
- protected virtual void BackgroundDispatch (MessageHandler handler)
+ protected virtual void BackgroundDispatch (Action action)
{
- DispatchService.BackgroundDispatch (handler);
+ PackageManagementBackgroundDispatcher.Dispatch (action);
}
-
- protected virtual void BackgroundDispatchAndWait (MessageHandler handler)
- {
- DispatchService.BackgroundDispatchAndWait (handler);
- }
-
- protected virtual void GuiDispatch (MessageHandler handler)
+
+ protected virtual void GuiDispatch (Action handler)
{
- DispatchService.GuiDispatch (handler);
+ Runtime.RunInMainThread (handler);
}
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatedPackagesAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatedPackagesAction.cs
index 96f915c177..bdc748dc10 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatedPackagesAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatedPackagesAction.cs
@@ -25,12 +25,12 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Ide;
namespace MonoDevelop.PackageManagement
{
- public class CheckForUpdatedPackagesAction : IPackageAction
+ internal class CheckForUpdatedPackagesAction : IPackageAction
{
IUpdatedPackagesInSolution updatedPackagesInSolution;
@@ -54,7 +54,7 @@ namespace MonoDevelop.PackageManagement
{
// Queue the check for updates with the background dispatcher so
// the NuGet addin does not create another separate Package Console.
- DispatchService.BackgroundDispatch (() => {
+ PackageManagementBackgroundDispatcher.Dispatch (() => {
updatedPackagesInSolution.CheckForUpdates ();
});
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesTask.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesTask.cs
index d59e6517f8..45b7375059 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesTask.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesTask.cs
@@ -27,12 +27,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
namespace MonoDevelop.PackageManagement
{
- public class CheckForUpdatesTask : IDisposable
+ internal class CheckForUpdatesTask : IDisposable
{
UpdatedPackagesInSolution updatedPackagesInSolution;
List<IPackageManagementProject> projects;
@@ -61,15 +61,18 @@ namespace MonoDevelop.PackageManagement
projectsWithUpdatedPackages.Add (updatedPackages);
}
}
+
+ projects.Clear ();
+
+ if (disposed) {
+ projectsWithUpdatedPackages.Clear ();
+ }
}
public void CheckForUpdatesCompleted ()
{
- updatedPackagesInSolution.CheckForUpdatesCompleted (this);
- }
-
- public IEnumerable<UpdatedPackagesInProject> ProjectsWithUpdatedPackages {
- get { return projectsWithUpdatedPackages; }
+ updatedPackagesInSolution.CheckForUpdatesCompleted (projectsWithUpdatedPackages);
+ projectsWithUpdatedPackages.Clear ();
}
public void Dispose ()
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesTaskRunner.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesTaskRunner.cs
index c323d30246..c2149758ef 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesTaskRunner.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesTaskRunner.cs
@@ -25,13 +25,13 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.Ide;
namespace MonoDevelop.PackageManagement
{
- public class CheckForUpdatesTaskRunner : IDisposable
+ internal class CheckForUpdatesTaskRunner : IDisposable
{
ITaskFactory taskFactory;
CheckForUpdatesTask currentCheckForUpdatesTask;
@@ -132,9 +132,9 @@ namespace MonoDevelop.PackageManagement
return taskToCompare == task;
}
- protected virtual void GuiBackgroundDispatch (MessageHandler handler)
+ protected virtual void GuiBackgroundDispatch (Action action)
{
- DispatchService.BackgroundDispatch (handler);
+ PackageManagementBackgroundDispatcher.Dispatch (action);
}
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ConfigSettingsFileSystem.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ConfigSettingsFileSystem.cs
index 8e656126b1..b772683c12 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ConfigSettingsFileSystem.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ConfigSettingsFileSystem.cs
@@ -32,9 +32,9 @@ using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class ConfigSettingsFileSystem : PhysicalFileSystem
+ internal class ConfigSettingsFileSystem : PhysicalFileSystem
{
ConfigSettingsFileSystem(string root)
: base(root)
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DefaultProjectTemplatePackageSource.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DefaultProjectTemplatePackageSource.cs
index bb3180a475..8bb65f4ad9 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DefaultProjectTemplatePackageSource.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DefaultProjectTemplatePackageSource.cs
@@ -29,9 +29,9 @@ using System;
using System.IO;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class DefaultProjectTemplatePackageSource
+ internal class DefaultProjectTemplatePackageSource
{
PackageSource packageSource;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DelegateCommand.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DelegateCommand.cs
index fa114d2128..bba2b1b012 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DelegateCommand.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DelegateCommand.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class DelegateCommand : ICommand
+ internal class DelegateCommand : ICommand
{
Action<object> execute;
Predicate<object> canExecute;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectEventArgs.cs
index 42572cc64c..9cd4e3406b 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectEventArgs.cs
@@ -29,7 +29,7 @@ using MonoDevelop.Projects;
namespace MonoDevelop.PackageManagement
{
- public class DotNetProjectEventArgs : EventArgs
+ internal class DotNetProjectEventArgs : EventArgs
{
public DotNetProjectEventArgs (IDotNetProject project)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectExtensions.cs
index 13c5aefb37..38ba1cae5f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectExtensions.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectExtensions.cs
@@ -34,9 +34,9 @@ using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public static class DotNetProjectExtensions
+ internal static class DotNetProjectExtensions
{
public static readonly Guid WebApplication = Guid.Parse("{349C5851-65DF-11DA-9384-00065B846F21}");
public static readonly Guid WebSite = Guid.Parse("{E24C65DC-7377-472B-9ABA-BC803B73C61A}");
@@ -47,7 +47,7 @@ namespace ICSharpCode.PackageManagement
{
return project.HasProjectType(WebApplication) || project.HasProjectType(WebSite);
}
-
+
public static bool HasProjectType(this IDotNetProject project, Guid projectTypeGuid)
{
foreach (string guid in project.GetProjectTypeGuids()) {
@@ -57,13 +57,13 @@ namespace ICSharpCode.PackageManagement
}
return false;
}
-
+
public static string[] GetProjectTypeGuids(this IDotNetProject project)
{
string projectTypeGuids = project.GetProjectTypeGuidPropertyValue();
return projectTypeGuids.Split(new char[] {';'}, StringSplitOptions.RemoveEmptyEntries);
}
-
+
static bool IsMatch(Guid guid, string guidStringToMatch)
{
Guid result;
@@ -72,7 +72,7 @@ namespace ICSharpCode.PackageManagement
}
return false;
}
-
+
public static string GetProjectTypeGuidPropertyValue (this IDotNetProject project)
{
string propertyValue = null;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectImportEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectImportEventArgs.cs
index cf0b696498..81fb3ebe65 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectImportEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectImportEventArgs.cs
@@ -28,7 +28,7 @@ using System;
namespace MonoDevelop.PackageManagement
{
- public class DotNetProjectImportEventArgs : EventArgs
+ internal class DotNetProjectImportEventArgs : EventArgs
{
public DotNetProjectImportEventArgs (IDotNetProject project, string import)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectProxy.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectProxy.cs
index bbc942d40e..07dc225d42 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectProxy.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectProxy.cs
@@ -30,7 +30,7 @@ using MonoDevelop.Projects;
namespace MonoDevelop.PackageManagement
{
- public class DotNetProjectProxy : ProjectProxy, IDotNetProject
+ internal class DotNetProjectProxy : ProjectProxy, IDotNetProject
{
DotNetProject project;
EventHandler<ProjectModifiedEventArgs> projectModifiedHandler;
@@ -120,7 +120,7 @@ namespace MonoDevelop.PackageManagement
public void DisposeProjectBuilder ()
{
- DotNetProject.DisposeProjectBuilder ();
+ DotNetProject.ReloadProjectBuilder ();
}
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectReferenceEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectReferenceEventArgs.cs
index 09d4cf6528..4f39b93f46 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectReferenceEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectReferenceEventArgs.cs
@@ -29,7 +29,7 @@ using MonoDevelop.Projects;
namespace MonoDevelop.PackageManagement
{
- public class DotNetProjectReferenceEventArgs : EventArgs
+ internal class DotNetProjectReferenceEventArgs : EventArgs
{
public DotNetProjectReferenceEventArgs (ProjectReference reference)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetSolutionEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetSolutionEventArgs.cs
index 43e3f47630..04d15288b7 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetSolutionEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetSolutionEventArgs.cs
@@ -28,7 +28,7 @@ using System;
namespace MonoDevelop.PackageManagement
{
- public class DotNetSolutionEventArgs : EventArgs
+ internal class DotNetSolutionEventArgs : EventArgs
{
public DotNetSolutionEventArgs (ISolution solution)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/EnsureNuGetPackageBuildImportsTargetUpdater.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/EnsureNuGetPackageBuildImportsTargetUpdater.cs
index fcdaa000d9..01d16ee5f7 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/EnsureNuGetPackageBuildImportsTargetUpdater.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/EnsureNuGetPackageBuildImportsTargetUpdater.cs
@@ -27,7 +27,7 @@
using System;
using System.Linq;
using System.Xml;
-using MonoDevelop.Projects.Formats.MSBuild;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.PackageManagement
{
@@ -44,7 +44,7 @@ namespace MonoDevelop.PackageManagement
/// EnsureNuGetPackageBuildImports target element then the
/// EnsureNuGetPackageBuildImports is removed.
/// </summary>
- public class EnsureNuGetPackageBuildImportsTargetUpdater : IDisposable
+ internal class EnsureNuGetPackageBuildImportsTargetUpdater : IDisposable
{
static readonly string NuGetTargetName = "EnsureNuGetPackageBuildImports";
@@ -73,10 +73,10 @@ namespace MonoDevelop.PackageManagement
if (msbuildTask == null)
return;
- RemoveFromProject (msbuildTask.Element);
+ nugetImportTarget.RemoveTask (msbuildTask);
if (nugetImportTarget.Tasks.Count () == 0) {
- RemoveFromProject (nugetImportTarget.Element);
+ project.Remove (nugetImportTarget);
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FailingPackageRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FailingPackageRepository.cs
index e45a612994..7315ccbde3 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FailingPackageRepository.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FailingPackageRepository.cs
@@ -36,7 +36,7 @@ namespace MonoDevelop.PackageManagement
/// This is only used when creating an AggregateRepository so it does not prevent packages
/// being returned from other valid package repositories.
/// </summary>
- public class FailingPackageRepository : IPackageRepository
+ internal class FailingPackageRepository : IPackageRepository
{
string source;
Exception exception;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FallbackRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FallbackRepository.cs
index dff511195d..343472aff2 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FallbackRepository.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FallbackRepository.cs
@@ -25,7 +25,7 @@ namespace NuGet
/// <summary>
/// Represents a package repository that implements a dependency provider.
/// </summary>
- public class FallbackRepository : IDependencyResolver, IServiceBasedRepository, IPackageLookup, ILatestPackageLookup, IOperationAwareRepository
+ internal class FallbackRepository : IDependencyResolver, IServiceBasedRepository, IPackageLookup, ILatestPackageLookup, IOperationAwareRepository
{
private readonly IPackageRepository _primaryRepository;
private readonly IPackageRepository _dependencyResolver;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileConflictResolver.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileConflictResolver.cs
index 613274d54c..58f84caff8 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileConflictResolver.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileConflictResolver.cs
@@ -30,9 +30,9 @@ using System;
using MonoDevelop.Ide;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class FileConflictResolver : IFileConflictResolver
+ internal class FileConflictResolver : IFileConflictResolver
{
static AlertButton YesToAllButton = new AlertButton ("Yes to All");
static AlertButton NoToAllButton = new AlertButton ("No to All");
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FilePathExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FilePathExtensions.cs
index 7c6cd512b7..d6ecfad26c 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FilePathExtensions.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FilePathExtensions.cs
@@ -30,7 +30,7 @@ using NuGet;
namespace MonoDevelop.PackageManagement
{
- public static class FilePathExtensions
+ internal static class FilePathExtensions
{
public static bool IsPackagesConfigFileName (this FilePath filePath)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileRemover.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileRemover.cs
index 96849ca9d0..9fe43414d0 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileRemover.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileRemover.cs
@@ -29,7 +29,7 @@ using System.IO;
namespace MonoDevelop.PackageManagement
{
- public class FileRemover : IFileRemover
+ internal class FileRemover : IFileRemover
{
public void RemoveFile (string fileName)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileRemovingEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileRemovingEventArgs.cs
index 557b185dca..1cd1b3fb8c 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileRemovingEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileRemovingEventArgs.cs
@@ -29,7 +29,7 @@ using MonoDevelop.Core;
namespace MonoDevelop.PackageManagement
{
- public class FileRemovingEventArgs : EventArgs
+ internal class FileRemovingEventArgs : EventArgs
{
public FileRemovingEventArgs (string fileName)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FolderBrowser.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FolderBrowser.cs
index 93bc7421ea..c09b2ab79f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FolderBrowser.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FolderBrowser.cs
@@ -29,9 +29,9 @@
using System;
using MonoDevelop.Components;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class FolderBrowser : IFolderBrowser
+ internal class FolderBrowser : IFolderBrowser
{
public string SelectFolder ()
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IBackgroundPackageActionRunner.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IBackgroundPackageActionRunner.cs
index fb236aed59..ccd2b79b5c 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IBackgroundPackageActionRunner.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IBackgroundPackageActionRunner.cs
@@ -26,12 +26,12 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
namespace MonoDevelop.PackageManagement
{
- public interface IBackgroundPackageActionRunner
+ internal interface IBackgroundPackageActionRunner
{
IEnumerable<InstallPackageAction> PendingInstallActions { get; }
IEnumerable<InstallPackageAction> PendingInstallActionsForProject (DotNetProject project);
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ICommand.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ICommand.cs
index 13ad4de0f5..eeb880ce65 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ICommand.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ICommand.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface ICommand
+ internal interface ICommand
{
bool CanExecute(object parameter);
void Execute(object parameter);
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ICompilerMessageView.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ICompilerMessageView.cs
index dc57f7fefe..0defab266e 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ICompilerMessageView.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ICompilerMessageView.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface ICompilerMessageView
+ internal interface ICompilerMessageView
{
IMessageViewCategory Create(string categoryName, string categoryDisplayName);
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IDotNetProject.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IDotNetProject.cs
index 04f1a5550d..d1e2fc0f11 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IDotNetProject.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IDotNetProject.cs
@@ -30,7 +30,7 @@ using MonoDevelop.Projects;
namespace MonoDevelop.PackageManagement
{
- public interface IDotNetProject : IProject
+ internal interface IDotNetProject : IProject
{
event EventHandler<ProjectModifiedEventArgs> Modified;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IFileRemover.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IFileRemover.cs
index b9a19bb0d4..d79bdf74a9 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IFileRemover.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IFileRemover.cs
@@ -28,7 +28,7 @@ using System;
namespace MonoDevelop.PackageManagement
{
- public interface IFileRemover
+ internal interface IFileRemover
{
void RemoveFile (string fileName);
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IFolderBrowser.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IFolderBrowser.cs
index ee2625484e..b278dda9c6 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IFolderBrowser.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IFolderBrowser.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IFolderBrowser
+ internal interface IFolderBrowser
{
string SelectFolder();
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ILicenseAcceptanceService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ILicenseAcceptanceService.cs
index b31c251516..1f98fe8e08 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ILicenseAcceptanceService.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ILicenseAcceptanceService.cs
@@ -30,9 +30,9 @@ using System;
using System.Collections.Generic;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface ILicenseAcceptanceService
+ internal interface ILicenseAcceptanceService
{
bool AcceptLicenses(IEnumerable<IPackage> packages);
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMachinePackageCache.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMachinePackageCache.cs
index 3965ddb4a6..727aaf7857 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMachinePackageCache.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMachinePackageCache.cs
@@ -30,9 +30,9 @@ using System;
using System.Linq;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IMachinePackageCache
+ internal interface IMachinePackageCache
{
IQueryable<IPackage> GetPackages();
void Clear();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMessageViewCategory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMessageViewCategory.cs
index 6faad20cc1..725d50a4bb 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMessageViewCategory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMessageViewCategory.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IMessageViewCategory
+ internal interface IMessageViewCategory
{
void AppendLine(string text);
void Clear();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopPackageManager.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopPackageManager.cs
new file mode 100644
index 0000000000..0851e40070
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopPackageManager.cs
@@ -0,0 +1,53 @@
+//
+// IMonoDevelopPackageManager.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012-2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.Collections.Generic;
+using NuGet;
+
+namespace MonoDevelop.PackageManagement
+{
+ internal interface IMonoDevelopPackageManager : IPackageManager
+ {
+ IMonoDevelopProjectManager ProjectManager { get; }
+
+ void InstallPackage(IPackage package, InstallPackageAction installAction);
+ void UninstallPackage(IPackage package, UninstallPackageAction uninstallAction);
+ void UpdatePackage(IPackage package, UpdatePackageAction updateAction);
+ void UpdatePackages(UpdatePackagesAction updateAction);
+ void UpdatePackageReference(IPackage package, IUpdatePackageSettings settings);
+ void AddPackageReference (IPackage package, bool ignoreDependencies, bool allowPrereleaseVersions);
+
+ IEnumerable<PackageOperation> GetInstallPackageOperations(IPackage package, InstallPackageAction installAction);
+ IEnumerable<PackageOperation> GetUpdatePackageOperations(IEnumerable<IPackage> packages, IUpdatePackageSettings settings);
+ ReinstallPackageOperations GetReinstallPackageOperations (IEnumerable<IPackage> packages);
+
+ void RunPackageOperations(IEnumerable<PackageOperation> operations);
+
+ void InstallPackageIntoSolutionRepository (IPackage package);
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopPackageRepositoryFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopPackageRepositoryFactory.cs
new file mode 100644
index 0000000000..adc6245783
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopPackageRepositoryFactory.cs
@@ -0,0 +1,48 @@
+//
+// IMonoDevelopPackageRepositoryFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace MonoDevelop.PackageManagement
+{
+ internal interface IMonoDevelopPackageRepositoryFactory : IPackageRepositoryFactory
+ {
+ ISharedPackageRepository CreateSharedRepository(
+ IPackagePathResolver pathResolver,
+ IFileSystem fileSystem,
+ IFileSystem configSettingsFileSystem);
+
+ IRecentPackageRepository CreateRecentPackageRepository(
+ IList<RecentPackageInfo> recentPackages,
+ IPackageRepository aggregateRepository);
+
+ IPackageRepository CreateAggregateRepository(IEnumerable<IPackageRepository> repositories);
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopProjectManager.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopProjectManager.cs
new file mode 100644
index 0000000000..78e2b907f4
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopProjectManager.cs
@@ -0,0 +1,42 @@
+//
+// IMonoDevelopProjectManager.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012-2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace MonoDevelop.PackageManagement
+{
+ internal interface IMonoDevelopProjectManager : IProjectManager
+ {
+ IPackagePathResolver PathResolver { get; }
+ bool IsInstalled(string packageId);
+ bool HasOlderPackageInstalled(IPackage package);
+ IEnumerable<PackageReference> GetPackageReferences ();
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopProjectSystemFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopProjectSystemFactory.cs
new file mode 100644
index 0000000000..80b5a8ca03
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMonoDevelopProjectSystemFactory.cs
@@ -0,0 +1,39 @@
+//
+// IMonoDevelopProjectSystemFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Projects;
+using NuGet;
+
+namespace MonoDevelop.PackageManagement
+{
+ internal interface IMonoDevelopProjectSystemFactory
+ {
+ IProjectSystem CreateProjectSystem(DotNetProject project);
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/INuGetPackageNewImportsHandler.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/INuGetPackageNewImportsHandler.cs
new file mode 100644
index 0000000000..766d06270b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/INuGetPackageNewImportsHandler.cs
@@ -0,0 +1,37 @@
+//
+// INuGetPackageNewImportsHandler.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using NuGet;
+
+namespace MonoDevelop.PackageManagement
+{
+ internal interface INuGetPackageNewImportsHandler : IDisposable
+ {
+ void AddImportIfMissing (string name, string condition, ProjectImportLocation location);
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IOpenPackageReadMeMonitor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IOpenPackageReadMeMonitor.cs
index d24baf45c4..d7ca135f49 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IOpenPackageReadMeMonitor.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IOpenPackageReadMeMonitor.cs
@@ -28,7 +28,7 @@ using System;
namespace MonoDevelop.PackageManagement
{
- public interface IOpenPackageReadMeMonitor : IDisposable
+ internal interface IOpenPackageReadMeMonitor : IDisposable
{
void OpenReadMeFile ();
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageAction.cs
index 1e544319d4..fcd937dd40 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageAction.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IPackageAction
+ internal interface IPackageAction
{
void Execute();
bool HasPackageScriptsToRun();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageActionRunner.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageActionRunner.cs
index a90f8977d3..bfd26ce4b7 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageActionRunner.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageActionRunner.cs
@@ -29,9 +29,9 @@
using System;
using System.Collections.Generic;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IPackageActionRunner
+ internal interface IPackageActionRunner
{
void Run(IPackageAction action);
void Run(IEnumerable<IPackageAction> actions);
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageExtensions.cs
index 0ba7363c9d..fc730e53a9 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageExtensions.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageExtensions.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public static class IPackageExtensions
+ internal static class IPackageExtensions
{
/// <summary>
/// Returns description if summary is missing.
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageFromRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageFromRepository.cs
index 947bed8b9f..42742205c2 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageFromRepository.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageFromRepository.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IPackageFromRepository : IPackage
+ internal interface IPackageFromRepository : IPackage
{
IPackageRepository Repository { get; }
bool HasDependencies { get; }
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageFromRepositoryExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageFromRepositoryExtensions.cs
index 8ddae3f231..d2ec8f6c11 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageFromRepositoryExtensions.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageFromRepositoryExtensions.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public static class IPackageFromRepositoryExtensions
+ internal static class IPackageFromRepositoryExtensions
{
public static IDisposable StartInstallOperation(this IPackageFromRepository package)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementEvents.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementEvents.cs
index c830df588d..468567a479 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementEvents.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementEvents.cs
@@ -33,9 +33,9 @@ using MonoDevelop.PackageManagement;
using NuGet;
using MonoDevelop.Projects;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IPackageManagementEvents
+ internal interface IPackageManagementEvents
{
event EventHandler PackageOperationsStarting;
event EventHandler PackageOperationsFinished;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementFileService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementFileService.cs
index 938562338e..f0dc1fff03 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementFileService.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementFileService.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IPackageManagementFileService
+ internal interface IPackageManagementFileService
{
void RemoveFile(string path);
void RemoveDirectory(string path);
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementOutputMessagesView.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementOutputMessagesView.cs
index 89dd3c1719..949f0a0eff 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementOutputMessagesView.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementOutputMessagesView.cs
@@ -28,9 +28,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IPackageManagementOutputMessagesView
+ internal interface IPackageManagementOutputMessagesView
{
void Clear();
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProgressMonitorFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProgressMonitorFactory.cs
index efecca66e2..2f95ad5c68 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProgressMonitorFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProgressMonitorFactory.cs
@@ -29,9 +29,9 @@ using MonoDevelop.Core;
namespace MonoDevelop.PackageManagement
{
- public interface IPackageManagementProgressMonitorFactory
+ internal interface IPackageManagementProgressMonitorFactory
{
- IProgressMonitor CreateProgressMonitor (string statusText);
+ ProgressMonitor CreateProgressMonitor (string statusText);
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProject.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProject.cs
index 5c325681e4..b5c91c7e86 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProject.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProject.cs
@@ -35,9 +35,9 @@ using NuGet;
using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IPackageManagementProject
+ internal interface IPackageManagementProject
{
event EventHandler<PackageOperationEventArgs> PackageInstalled;
event EventHandler<PackageOperationEventArgs> PackageUninstalled;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProjectFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProjectFactory.cs
index b9dbd43d97..11d33f3c5c 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProjectFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProjectFactory.cs
@@ -29,9 +29,9 @@ using System;
using MonoDevelop.PackageManagement;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IPackageManagementProjectFactory
+ internal interface IPackageManagementProjectFactory
{
IPackageManagementProject CreateProject (IPackageRepository sourceRepository, IDotNetProject project);
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProjectService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProjectService.cs
index 57feeb967c..8e16b8eaa1 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProjectService.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProjectService.cs
@@ -31,9 +31,9 @@ using System.Collections.Generic;
using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IPackageManagementProjectService
+ internal interface IPackageManagementProjectService
{
event EventHandler SolutionLoaded;
event EventHandler SolutionUnloaded;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementSelectedProject.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementSelectedProject.cs
index e7089d2caf..09d7f66efa 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementSelectedProject.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementSelectedProject.cs
@@ -30,9 +30,9 @@ using System;
using System.Collections.Generic;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IPackageManagementSelectedProject
+ internal interface IPackageManagementSelectedProject
{
string Name { get; }
bool IsSelected { get; set; }
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementSolution.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementSolution.cs
index f7c0036588..6e187b79af 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementSolution.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementSolution.cs
@@ -26,23 +26,21 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using System.Collections.Generic;
using System.Linq;
-using MonoDevelop.PackageManagement;
-using MonoDevelop.Projects;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IPackageManagementSolution
+ internal interface IPackageManagementSolution
{
IPackageManagementProject GetActiveProject();
IPackageManagementProject GetActiveProject(IPackageRepository sourceRepository);
IPackageManagementProject GetProject(PackageSource source, string projectName);
IPackageManagementProject GetProject(IPackageRepository sourceRepository, string projectName);
IPackageManagementProject GetProject (IPackageRepository sourceRepository, IDotNetProject project);
+ IPackageManagementProject GetProject (IDotNetProject project);
IEnumerable<IPackageManagementProject> GetProjects(IPackageRepository sourceRepository);
IDotNetProject GetActiveDotNetProject ();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagerFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagerFactory.cs
index 49b0f81ba2..fda6556de6 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagerFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagerFactory.cs
@@ -30,11 +30,11 @@ using System;
using MonoDevelop.PackageManagement;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IPackageManagerFactory
+ internal interface IPackageManagerFactory
{
- ISharpDevelopPackageManager CreatePackageManager (
+ IMonoDevelopPackageManager CreatePackageManager (
IPackageRepository sourceRepository,
IDotNetProject project);
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageOperationResolverFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageOperationResolverFactory.cs
index e4e6f2fe27..104662c580 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageOperationResolverFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageOperationResolverFactory.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IPackageOperationResolverFactory
+ internal interface IPackageOperationResolverFactory
{
IPackageOperationResolver CreateInstallPackageOperationResolver(
IPackageRepository localRepository,
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryCache.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryCache.cs
index 8524d1a07a..e8199509ac 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryCache.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryCache.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IPackageRepositoryCache : ISharpDevelopPackageRepositoryFactory
+ internal interface IPackageRepositoryCache : IMonoDevelopPackageRepositoryFactory
{
IRecentPackageRepository RecentPackageRepository { get; }
IPackageRepository CreateAggregateRepository();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryExtensions.cs
index fce99ffbc0..d5858da9a3 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryExtensions.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryExtensions.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public static class IPackageRepositoryExtensions
+ internal static class IPackageRepositoryExtensions
{
public static IDisposable StartInstallOperation(this IPackageRepository repository, string mainPackageId = null, string mainPackageVersion = null)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryFactoryEvents.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryFactoryEvents.cs
index a59e910baf..7495928d47 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryFactoryEvents.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryFactoryEvents.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IPackageRepositoryFactoryEvents
+ internal interface IPackageRepositoryFactoryEvents
{
event EventHandler<PackageRepositoryFactoryEventArgs> RepositoryCreated;
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageViewModelFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageViewModelFactory.cs
index 9c6e84e042..e8506064fb 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageViewModelFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageViewModelFactory.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IPackageViewModelFactory
+ internal interface IPackageViewModelFactory
{
PackageViewModel CreatePackageViewModel(IPackageViewModelParent parent, IPackageFromRepository package);
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageViewModelParent.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageViewModelParent.cs
index 767e169d3e..4b7079404b 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageViewModelParent.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageViewModelParent.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IPackageViewModelParent
+ internal interface IPackageViewModelParent
{
bool IncludePrerelease { get; }
void OnPackageCheckedChanged (PackageViewModel packageViewModel);
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProcess.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProcess.cs
index d67b526c9c..b936f1701a 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProcess.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProcess.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IProcess
+ internal interface IProcess
{
void Start(string fileName);
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProject.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProject.cs
index d359be3c57..0d77622f83 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProject.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProject.cs
@@ -27,18 +27,21 @@
using System;
using System.Collections;
using MonoDevelop.Core;
+using System.Collections.Generic;
+using System.Threading.Tasks;
namespace MonoDevelop.PackageManagement
{
- public interface IProject
+ internal interface IProject
{
string Name { get; }
FilePath FileName { get; }
FilePath BaseDirectory { get; }
ISolution ParentSolution { get; }
IDictionary ExtendedProperties { get; }
+ IEnumerable<string> FlavorGuids { get; }
- void Save ();
+ Task SaveAsync ();
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProjectBrowserUpdater.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProjectBrowserUpdater.cs
index 4bffc15d8d..f49363208c 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProjectBrowserUpdater.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProjectBrowserUpdater.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IProjectBrowserUpdater : IDisposable
+ internal interface IProjectBrowserUpdater : IDisposable
{
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPropertyService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPropertyService.cs
index 664fe023d6..25f335d046 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPropertyService.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPropertyService.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IPropertyService
+ internal interface IPropertyService
{
string DataDirectory { get; }
string ConfigDirectory { get; }
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IRecentPackageRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IRecentPackageRepository.cs
index c9b4b03a72..1fa838eafc 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IRecentPackageRepository.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IRecentPackageRepository.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IRecentPackageRepository : IPackageRepository
+ internal interface IRecentPackageRepository : IPackageRepository
{
void Clear();
bool HasRecentPackages { get; }
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IRegisteredPackageRepositories.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IRegisteredPackageRepositories.cs
index a09f9d2ef9..5adc777250 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IRegisteredPackageRepositories.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IRegisteredPackageRepositories.cs
@@ -30,9 +30,9 @@ using System;
using System.Collections.Generic;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IRegisteredPackageRepositories
+ internal interface IRegisteredPackageRepositories
{
IPackageRepository ActiveRepository { get; }
IRecentPackageRepository RecentPackageRepository { get; }
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISelectProjectsService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISelectProjectsService.cs
index 8a79ad0a66..cf632388aa 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISelectProjectsService.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISelectProjectsService.cs
@@ -29,9 +29,9 @@
using System;
using System.Collections.Generic;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface ISelectProjectsService
+ internal interface ISelectProjectsService
{
bool SelectProjects(IEnumerable<IPackageManagementSelectedProject> projects);
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISettingsFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISettingsFactory.cs
index 4199af4034..4a57175be2 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISettingsFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISettingsFactory.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface ISettingsFactory
+ internal interface ISettingsFactory
{
ISettings CreateSettings(string directory);
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISettingsProvider.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISettingsProvider.cs
index aa0fa620cf..90a99fec45 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISettingsProvider.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISettingsProvider.cs
@@ -29,7 +29,7 @@ using NuGet;
namespace MonoDevelop.PackageManagement
{
- public interface ISettingsProvider
+ internal interface ISettingsProvider
{
event EventHandler SettingsChanged;
ISettings LoadSettings();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopPackageManager.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopPackageManager.cs
deleted file mode 100644
index 8c18ec2372..0000000000
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopPackageManager.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// ISharpDevelopPackageManager.cs
-//
-// Author:
-// Matt Ward <ward.matt@gmail.com>
-//
-// Copyright (C) 2012-2013 Matthew Ward
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using MonoDevelop.PackageManagement;
-using NuGet;
-
-namespace ICSharpCode.PackageManagement
-{
- public interface ISharpDevelopPackageManager : IPackageManager
- {
- ISharpDevelopProjectManager ProjectManager { get; }
-
- void InstallPackage(IPackage package, InstallPackageAction installAction);
- void UninstallPackage(IPackage package, UninstallPackageAction uninstallAction);
- void UpdatePackage(IPackage package, UpdatePackageAction updateAction);
- void UpdatePackages(UpdatePackagesAction updateAction);
- void UpdatePackageReference(IPackage package, IUpdatePackageSettings settings);
- void AddPackageReference (IPackage package, bool ignoreDependencies, bool allowPrereleaseVersions);
-
- IEnumerable<PackageOperation> GetInstallPackageOperations(IPackage package, InstallPackageAction installAction);
- IEnumerable<PackageOperation> GetUpdatePackageOperations(IEnumerable<IPackage> packages, IUpdatePackageSettings settings);
- ReinstallPackageOperations GetReinstallPackageOperations (IEnumerable<IPackage> packages);
-
- void RunPackageOperations(IEnumerable<PackageOperation> operations);
- }
-}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopPackageRepositoryFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopPackageRepositoryFactory.cs
deleted file mode 100644
index f4f0b8ad96..0000000000
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopPackageRepositoryFactory.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// ISharpDevelopPackageRepositoryFactory.cs
-//
-// Author:
-// Matt Ward <ward.matt@gmail.com>
-//
-// Copyright (C) 2012 Matthew Ward
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using NuGet;
-
-namespace ICSharpCode.PackageManagement
-{
- public interface ISharpDevelopPackageRepositoryFactory : IPackageRepositoryFactory
- {
- ISharedPackageRepository CreateSharedRepository(
- IPackagePathResolver pathResolver,
- IFileSystem fileSystem,
- IFileSystem configSettingsFileSystem);
-
- IRecentPackageRepository CreateRecentPackageRepository(
- IList<RecentPackageInfo> recentPackages,
- IPackageRepository aggregateRepository);
-
- IPackageRepository CreateAggregateRepository(IEnumerable<IPackageRepository> repositories);
- }
-}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopProjectManager.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopProjectManager.cs
deleted file mode 100644
index f6c03db717..0000000000
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopProjectManager.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// ISharpDevelopProjectManager.cs
-//
-// Author:
-// Matt Ward <ward.matt@gmail.com>
-//
-// Copyright (C) 2012-2013 Matthew Ward
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using NuGet;
-
-namespace ICSharpCode.PackageManagement
-{
- public interface ISharpDevelopProjectManager : IProjectManager
- {
- IPackagePathResolver PathResolver { get; }
- bool IsInstalled(string packageId);
- bool HasOlderPackageInstalled(IPackage package);
- IEnumerable<PackageReference> GetPackageReferences ();
- }
-}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopProjectSystemFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopProjectSystemFactory.cs
deleted file mode 100644
index a9bd683b0b..0000000000
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopProjectSystemFactory.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// ISharpDevelopProjectSystemFactory.cs
-//
-// Author:
-// Matt Ward <ward.matt@gmail.com>
-//
-// Copyright (C) 2012 Matthew Ward
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using MonoDevelop.Projects;
-using NuGet;
-
-namespace ICSharpCode.PackageManagement
-{
- public interface ISharpDevelopProjectSystemFactory
- {
- IProjectSystem CreateProjectSystem(DotNetProject project);
- }
-}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolution.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolution.cs
index e64ab2b6a1..072b2a235c 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolution.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolution.cs
@@ -31,7 +31,7 @@ using MonoDevelop.Projects;
namespace MonoDevelop.PackageManagement
{
- public interface ISolution
+ internal interface ISolution
{
Solution Solution { get; }
@@ -41,6 +41,7 @@ namespace MonoDevelop.PackageManagement
IEnumerable<IDotNetProject> GetAllProjects ();
event EventHandler<DotNetProjectEventArgs> ProjectAdded;
+ event EventHandler<DotNetProjectEventArgs> ProjectRemoved;
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolutionPackageRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolutionPackageRepository.cs
index 3c00c845e5..ec46b343c8 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolutionPackageRepository.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolutionPackageRepository.cs
@@ -32,9 +32,9 @@ using System.Linq;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface ISolutionPackageRepository
+ internal interface ISolutionPackageRepository
{
string GetInstallPath(IPackage package);
IEnumerable<IPackage> GetPackagesByDependencyOrder();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolutionPackageRepositoryFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolutionPackageRepositoryFactory.cs
index c9cc090a9c..ddbc2c948e 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolutionPackageRepositoryFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolutionPackageRepositoryFactory.cs
@@ -30,9 +30,9 @@ using System;
using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface ISolutionPackageRepositoryFactory
+ internal interface ISolutionPackageRepositoryFactory
{
ISolutionPackageRepository CreateSolutionPackageRepository (ISolution solution);
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ITask.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ITask.cs
index ff7af23c3a..436feeb7c7 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ITask.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ITask.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface ITask<TResult>
+ internal interface ITask<TResult>
{
void Start();
void Cancel();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ITaskFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ITaskFactory.cs
index 92e04d0dd9..6604b89e3b 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ITaskFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ITaskFactory.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface ITaskFactory
+ internal interface ITaskFactory
{
ITask<TResult> CreateTask<TResult>(
Func<TResult> function,
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IThreadSafePackageManagementEvents.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IThreadSafePackageManagementEvents.cs
index 26abff3221..436f2e7621 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IThreadSafePackageManagementEvents.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IThreadSafePackageManagementEvents.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IThreadSafePackageManagementEvents : IPackageManagementEvents, IDisposable
+ internal interface IThreadSafePackageManagementEvents : IPackageManagementEvents, IDisposable
{
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackageActions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackageActions.cs
index b02670416b..105698dab4 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackageActions.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackageActions.cs
@@ -29,9 +29,9 @@
using System;
using System.Collections.Generic;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IUpdatePackageActions : IUpdatePackageSettings
+ internal interface IUpdatePackageActions : IUpdatePackageSettings
{
//IPackageScriptRunner PackageScriptRunner { get; set; }
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackageSettings.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackageSettings.cs
index fe56a04af8..e8091917ae 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackageSettings.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackageSettings.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IUpdatePackageSettings
+ internal interface IUpdatePackageSettings
{
bool UpdateDependencies { get; set; }
bool AllowPrereleaseVersions { get; set; }
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackagesAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackagesAction.cs
index b78ee7506b..37953cacb9 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackagesAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackagesAction.cs
@@ -30,9 +30,9 @@ using System;
using System.Collections.Generic;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public interface IUpdatePackagesAction : IPackageAction, IUpdatePackageSettings
+ internal interface IUpdatePackagesAction : IPackageAction, IUpdatePackageSettings
{
IEnumerable<PackageOperation> Operations { get; }
ILogger Logger { get; set; }
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatedPackagesInSolution.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatedPackagesInSolution.cs
index bf18b5e521..b1bb3e9cf8 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatedPackagesInSolution.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatedPackagesInSolution.cs
@@ -28,7 +28,7 @@ using System;
namespace MonoDevelop.PackageManagement
{
- public interface IUpdatedPackagesInSolution
+ internal interface IUpdatedPackagesInSolution
{
void Clear ();
void CheckForUpdates ();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ImageCache.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ImageCache.cs
index b012c143cc..bd23d1b8d7 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ImageCache.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ImageCache.cs
@@ -30,7 +30,7 @@ using Xwt.Drawing;
namespace MonoDevelop.PackageManagement
{
- public class ImageCache
+ internal class ImageCache
{
const int MaxImageCount = 50;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ImageLoadedEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ImageLoadedEventArgs.cs
index a483a1de3e..52b9be6406 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ImageLoadedEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ImageLoadedEventArgs.cs
@@ -29,7 +29,7 @@ using Xwt.Drawing;
namespace MonoDevelop.PackageManagement
{
- public class ImageLoadedEventArgs : EventArgs
+ internal class ImageLoadedEventArgs : EventArgs
{
public ImageLoadedEventArgs (Image image, Uri uri, object state)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ImageLoader.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ImageLoader.cs
index 9bb27d746f..64cf38aa79 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ImageLoader.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ImageLoader.cs
@@ -30,13 +30,13 @@ using System.Net;
using System.Threading.Tasks;
using MonoDevelop.Ide;
using NuGet;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using Xwt.Drawing;
using System.Collections.Generic;
namespace MonoDevelop.PackageManagement
{
- public class ImageLoader
+ internal class ImageLoader
{
public event EventHandler<ImageLoadedEventArgs> Loaded;
@@ -91,8 +91,7 @@ namespace MonoDevelop.PackageManagement
ImageLoadedEventArgs LoadImage (Uri uri, object state)
{
try {
- var httpClient = new HttpClient (uri);
- Stream stream = httpClient.GetResponse ().GetResponseStream ();
+ Stream stream = GetResponseStream (uri);
Image image = Image.FromStream (stream);
return new ImageLoadedEventArgs (image, uri, state);
@@ -101,6 +100,17 @@ namespace MonoDevelop.PackageManagement
}
}
+ static Stream GetResponseStream (Uri uri)
+ {
+ if (uri.IsFile) {
+ var request = WebRequest.Create (uri);
+ return request.GetResponse ().GetResponseStream ();
+ }
+
+ var httpClient = new HttpClient (uri);
+ return httpClient.GetResponse ().GetResponseStream ();
+ }
+
void OnLoaded (ITask<ImageLoadedEventArgs> task, Uri uri, object state)
{
if (task.IsFaulted) {
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstallPackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstallPackageAction.cs
index f5854cf48f..07c1d0f685 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstallPackageAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstallPackageAction.cs
@@ -28,12 +28,11 @@
using System;
using System.Collections.Generic;
-using MonoDevelop.PackageManagement;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class InstallPackageAction : ProcessPackageOperationsAction
+ internal class InstallPackageAction : ProcessPackageOperationsAction
{
IFileRemover fileRemover;
@@ -48,12 +47,22 @@ namespace ICSharpCode.PackageManagement
IPackageManagementProject project,
IPackageManagementEvents packageManagementEvents,
IFileRemover fileRemover)
- : base (project, packageManagementEvents)
+ : this (project, packageManagementEvents, fileRemover, new LicenseAcceptanceService ())
+ {
+ }
+
+ public InstallPackageAction (
+ IPackageManagementProject project,
+ IPackageManagementEvents packageManagementEvents,
+ IFileRemover fileRemover,
+ ILicenseAcceptanceService licenseAcceptanceService)
+ : base (project, packageManagementEvents, licenseAcceptanceService)
{
this.fileRemover = fileRemover;
OpenReadMeText = true;
PreserveLocalCopyReferences = true;
+ LicensesMustBeAccepted = true;
}
public bool IgnoreDependencies { get; set; }
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackageViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackageViewModel.cs
index 42e8a84343..cd88ac2f02 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackageViewModel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackageViewModel.cs
@@ -30,9 +30,9 @@ using System;
using System.Collections.Generic;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class InstalledPackageViewModel : PackageViewModel
+ internal class InstalledPackageViewModel : PackageViewModel
{
public InstalledPackageViewModel(
IPackageViewModelParent parent,
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackageViewModelFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackageViewModelFactory.cs
index ea31b50e6d..f14164dacc 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackageViewModelFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackageViewModelFactory.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class InstalledPackageViewModelFactory : PackageViewModelFactory
+ internal class InstalledPackageViewModelFactory : PackageViewModelFactory
{
SelectedProjectsForInstalledPackages selectedProjectsForInstalledPackages;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackagesViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackagesViewModel.cs
index 97277f10fa..9348cfa62c 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackagesViewModel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackagesViewModel.cs
@@ -31,9 +31,9 @@ using System.Linq;
using System.Collections.Generic;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class InstalledPackagesViewModel : PackagesViewModel
+ internal class InstalledPackagesViewModel : PackagesViewModel
{
IPackageManagementSolution solution;
IPackageManagementEvents packageManagementEvents;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs
index 82c7dcae77..a5110e4a2e 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs
@@ -26,24 +26,37 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using System.Collections.Generic;
+using MonoDevelop.Core;
using MonoDevelop.Ide;
-using MonoDevelop.PackageManagement;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class LicenseAcceptanceService : ILicenseAcceptanceService
+ internal class LicenseAcceptanceService : ILicenseAcceptanceService
{
- public bool AcceptLicenses(IEnumerable<IPackage> packages)
+ public bool AcceptLicenses (IEnumerable<IPackage> packages)
+ {
+ if (Runtime.IsMainThread) {
+ return ShowLicenseAcceptanceDialog (packages);
+ }
+
+ bool accepted = false;
+ Runtime.RunInMainThread (() => {
+ accepted = ShowLicenseAcceptanceDialog (packages);
+ }).Wait ();
+ return accepted;
+ }
+
+ bool ShowLicenseAcceptanceDialog (IEnumerable<IPackage> packages)
{
using (LicenseAcceptanceDialog dialog = CreateLicenseAcceptanceDialog (packages)) {
- int result = MessageService.ShowCustomDialog (dialog);
+ dialog.Modal = false;
+ int result = MessageService.ShowCustomDialog (dialog, IdeApp.Workbench.RootWindow);
return result == (int)Gtk.ResponseType.Ok;
}
}
-
+
LicenseAcceptanceDialog CreateLicenseAcceptanceDialog(IEnumerable<IPackage> packages)
{
var viewModel = new LicenseAcceptanceViewModel(packages);
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceViewModel.cs
index 2b3d123122..bc17c68314 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceViewModel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceViewModel.cs
@@ -31,9 +31,9 @@ using System.Collections.Generic;
using System.Linq;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class LicenseAcceptanceViewModel : ViewModelBase<LicenseAcceptanceViewModel>
+ internal class LicenseAcceptanceViewModel : ViewModelBase<LicenseAcceptanceViewModel>
{
IList<PackageLicenseViewModel> packages;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LocalCopyReferenceMaintainer.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LocalCopyReferenceMaintainer.cs
index 2637df430b..40cf81b6b5 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LocalCopyReferenceMaintainer.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LocalCopyReferenceMaintainer.cs
@@ -27,12 +27,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
namespace MonoDevelop.PackageManagement
{
- public class LocalCopyReferenceMaintainer : IDisposable
+ internal class LocalCopyReferenceMaintainer : IDisposable
{
readonly IPackageManagementEvents packageManagementEvents;
List<ProjectReference> referencesRemovedWithLocalCopyFalse = new List<ProjectReference> ();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MSBuildProjectExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MSBuildProjectExtensions.cs
index 7ef89003a4..48b81b69ba 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MSBuildProjectExtensions.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MSBuildProjectExtensions.cs
@@ -31,12 +31,12 @@ using System.Collections.Generic;
using System.Linq;
using System.Xml;
-using MonoDevelop.Projects.Formats.MSBuild;
+using MonoDevelop.Projects.MSBuild;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public static class MSBuildProjectExtensions
+ internal static class MSBuildProjectExtensions
{
static readonly XmlNamespaceManager namespaceManager =
new XmlNamespaceManager (new NameTable ());
@@ -64,63 +64,18 @@ namespace ICSharpCode.PackageManagement
ProjectImportLocation importLocation,
string condition)
{
- XmlElement import = project.AddImportElement (importedProjectFile, importLocation);
- import.SetAttribute ("Condition", condition);
- }
-
- static XmlElement AddImportElement(
- this MSBuildProject project,
- string importedProjectFile,
- ProjectImportLocation importLocation)
- {
- if (importLocation == ProjectImportLocation.Top) {
- return project.AddImportElementAtTop (importedProjectFile);
- }
- XmlElement import = project.CreateImportElement (importedProjectFile);
- project.Document.DocumentElement.AppendChild (import);
- return import;
- }
-
- static XmlElement CreateImportElement(this MSBuildProject project, string importedProjectFile)
- {
- XmlElement import = project.Document.CreateElement ("Import", MSBuildProject.Schema);
- import.SetAttribute ("Project", importedProjectFile);
- return import;
- }
-
- static XmlElement AddImportElementAtTop (this MSBuildProject project, string importedProjectFile)
- {
- XmlElement import = project.CreateImportElement (importedProjectFile);
- XmlElement projectRoot = project.Document.DocumentElement;
- projectRoot.InsertBefore (import, projectRoot.FirstChild);
- return import;
+ var before = importLocation == ProjectImportLocation.Top ? project.GetAllObjects ().FirstOrDefault () : null;
+ project.AddNewImport (importedProjectFile, condition, before);
}
public static void RemoveImportIfExists (this MSBuildProject project, string importedProjectFile)
{
- XmlElement import = project.FindImportElement (importedProjectFile);
- if (import != null) {
- import.ParentNode.RemoveChild (import);
- }
+ project.RemoveImport (importedProjectFile);
}
public static bool ImportExists (this MSBuildProject project, string importedProjectFile)
{
- return project.FindImportElement (importedProjectFile) != null;
- }
-
- static XmlElement FindImportElement (this MSBuildProject project, string importedProjectFile)
- {
- return project
- .Imports ()
- .FirstOrDefault (import => String.Equals (import.GetAttribute ("Project"), importedProjectFile, StringComparison.OrdinalIgnoreCase));
- }
-
- static IEnumerable <XmlElement> Imports (this MSBuildProject project)
- {
- foreach (XmlElement import in project.Document.DocumentElement.SelectNodes ("tns:Import", namespaceManager)) {
- yield return import;
- }
+ return project.GetImport (importedProjectFile) != null;
}
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MSBuildTargetsRestoredMonitor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MSBuildTargetsRestoredMonitor.cs
index 1f8f80f58c..a9e8ee54dc 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MSBuildTargetsRestoredMonitor.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MSBuildTargetsRestoredMonitor.cs
@@ -26,12 +26,12 @@
using System;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement
{
- public class MSBuildTargetsRestoredMonitor : IDisposable
+ internal class MSBuildTargetsRestoredMonitor : IDisposable
{
IPackageManagementEvents packageManagementEvents;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MachinePackageCache.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MachinePackageCache.cs
index 4b13b7c84b..01a909f82d 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MachinePackageCache.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MachinePackageCache.cs
@@ -30,9 +30,9 @@ using System;
using System.Linq;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class MachinePackageCache : IMachinePackageCache
+ internal class MachinePackageCache : IMachinePackageCache
{
public IQueryable<IPackage> GetPackages()
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewModel.cs
index d794208cbc..eda1c66dfa 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewModel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewModel.cs
@@ -32,9 +32,9 @@ using System.Linq;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class ManagePackagesViewModel : ViewModelBase<ManagePackagesViewModel>, IDisposable
+ internal class ManagePackagesViewModel : ViewModelBase<ManagePackagesViewModel>, IDisposable
{
IThreadSafePackageManagementEvents packageManagementEvents;
PackagesViewModels packagesViewModels;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewTitle.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewTitle.cs
index c07724593c..48a8243b4c 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewTitle.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewTitle.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class ManagePackagesViewTitle
+ internal class ManagePackagesViewTitle
{
public ManagePackagesViewTitle(IPackageManagementSolution solution)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MarkupString.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MarkupString.cs
index 3137ec55a0..52d1ccc9d0 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MarkupString.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MarkupString.cs
@@ -30,9 +30,9 @@ using System;
using System.Linq;
using GLib;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public static class MarkupString
+ internal static class MarkupString
{
public static string Format (string format, params string[] args)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopAggregateRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopAggregateRepository.cs
index 3a140e6802..3463ea7f8f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopAggregateRepository.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopAggregateRepository.cs
@@ -33,7 +33,7 @@ using NuGet;
namespace MonoDevelop.PackageManagement
{
- public class MonoDevelopAggregateRepository : AggregateRepository
+ internal class MonoDevelopAggregateRepository : AggregateRepository
{
ConcurrentQueue<Exception> failures = new ConcurrentQueue<Exception> ();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopCredentialProvider.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopCredentialProvider.cs
index e9dbe4417b..3678763e21 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopCredentialProvider.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopCredentialProvider.cs
@@ -30,7 +30,7 @@ using System;
using System.Net;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
class MonoDevelopCredentialProvider : ICredentialProvider
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopHttpUserAgent.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopHttpUserAgent.cs
index 6c8ec642c8..8a2e703a0f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopHttpUserAgent.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopHttpUserAgent.cs
@@ -1,5 +1,5 @@
//
-// SharpDevelopHttpUserAgent.cs
+// MonoDevelopHttpUserAgent.cs
//
// Author:
// Matt Ward <ward.matt@gmail.com>
@@ -31,9 +31,9 @@ using MonoDevelop.Core;
using MonoDevelop.Ide;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class MonoDevelopHttpUserAgent
+ internal class MonoDevelopHttpUserAgent
{
public MonoDevelopHttpUserAgent()
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopPackageManager.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopPackageManager.cs
new file mode 100644
index 0000000000..dd3985fa06
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopPackageManager.cs
@@ -0,0 +1,251 @@
+//
+// MonoDevelopPackageManager.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012-2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.Collections.Generic;
+using NuGet;
+
+namespace MonoDevelop.PackageManagement
+{
+ internal class MonoDevelopPackageManager : PackageManager, IMonoDevelopPackageManager
+ {
+ IProjectSystem projectSystem;
+ IPackageOperationResolverFactory packageOperationResolverFactory;
+
+ public MonoDevelopPackageManager(
+ IPackageRepository sourceRepository,
+ IProjectSystem projectSystem,
+ ISolutionPackageRepository solutionPackageRepository,
+ IPackageOperationResolverFactory packageOperationResolverFactory)
+ : base(
+ sourceRepository,
+ solutionPackageRepository.PackagePathResolver,
+ solutionPackageRepository.FileSystem,
+ solutionPackageRepository.Repository)
+ {
+ this.projectSystem = projectSystem;
+ this.packageOperationResolverFactory = packageOperationResolverFactory;
+ CreateProjectManager();
+ }
+
+ /// <summary>
+ /// project manager should be created with:
+ /// local repo = PackageReferenceRepository(projectSystem, sharedRepo)
+ /// packageRefRepo should have its RegisterIfNecessary() method called before creating the project manager.
+ /// source repo = sharedRepository
+ /// </summary>
+ void CreateProjectManager()
+ {
+ var packageRefRepository = CreatePackageReferenceRepository();
+ ProjectManager = CreateProjectManager(packageRefRepository);
+ }
+
+ PackageReferenceRepository CreatePackageReferenceRepository()
+ {
+ var sharedRepository = LocalRepository as ISharedPackageRepository;
+ var packageRefRepository = new PackageReferenceRepository(projectSystem, projectSystem.ProjectName, sharedRepository);
+ packageRefRepository.RegisterIfNecessary();
+ return packageRefRepository;
+ }
+
+ public IMonoDevelopProjectManager ProjectManager { get; set; }
+
+ MonoDevelopProjectManager CreateProjectManager(PackageReferenceRepository packageRefRepository)
+ {
+ IPackageRepository sourceRepository = CreateProjectManagerSourceRepository ();
+ return new MonoDevelopProjectManager (sourceRepository, PathResolver, projectSystem, packageRefRepository);
+ }
+
+ IPackageRepository CreateProjectManagerSourceRepository ()
+ {
+ var fallbackRepository = SourceRepository as FallbackRepository;
+ if (fallbackRepository != null) {
+ var primaryRepositories = new [] {
+ LocalRepository,
+ fallbackRepository.SourceRepository.Clone () };
+
+ return new FallbackRepository (
+ new AggregateRepository (primaryRepositories),
+ fallbackRepository.DependencyResolver);
+ }
+ return new AggregateRepository (new [] { LocalRepository, SourceRepository.Clone () });
+ }
+
+ public void InstallPackage(IPackage package)
+ {
+ bool ignoreDependencies = false;
+ bool allowPreleaseVersions = false;
+ InstallPackage(package, ignoreDependencies, allowPreleaseVersions);
+ }
+
+ public void InstallPackage(IPackage package, InstallPackageAction installAction)
+ {
+ RunPackageOperations(installAction.Operations);
+ AddPackageReference(package, installAction.IgnoreDependencies, installAction.AllowPrereleaseVersions);
+ }
+
+ public void AddPackageReference (IPackage package, bool ignoreDependencies, bool allowPrereleaseVersions)
+ {
+ var monitor = new PackageReferenceMonitor (ProjectManager, this);
+ using (monitor) {
+ ProjectManager.AddPackageReference(package.Id, package.Version, ignoreDependencies, allowPrereleaseVersions);
+ }
+
+ monitor.PackagesRemoved.ForEach(packageRemoved => UninstallPackageFromSolutionRepository(packageRemoved));
+ }
+
+ public override void InstallPackage(IPackage package, bool ignoreDependencies, bool allowPrereleaseVersions)
+ {
+ base.InstallPackage(package, ignoreDependencies, allowPrereleaseVersions);
+ AddPackageReference(package, ignoreDependencies, allowPrereleaseVersions);
+ }
+
+ public void UninstallPackage(IPackage package, UninstallPackageAction uninstallAction)
+ {
+ UninstallPackage(package, uninstallAction.ForceRemove, uninstallAction.RemoveDependencies);
+ }
+
+ public override void UninstallPackage(IPackage package, bool forceRemove, bool removeDependencies)
+ {
+ ProjectManager.RemovePackageReference(package.Id, forceRemove, removeDependencies);
+ if (!IsPackageReferencedByOtherProjects(package)) {
+ base.UninstallPackage(package, forceRemove, removeDependencies);
+ }
+ }
+
+ public void UninstallPackageFromSolutionRepository(IPackage package)
+ {
+ if (!IsPackageReferencedByOtherProjects(package)) {
+ ExecuteUninstall(package);
+ }
+ }
+
+ public void InstallPackageIntoSolutionRepository (IPackage package)
+ {
+ if (!LocalRepository.Exists (package)) {
+ ExecuteInstall (package);
+ }
+ }
+
+ bool IsPackageReferencedByOtherProjects(IPackage package)
+ {
+ var sharedRepository = LocalRepository as ISharedPackageRepository;
+ return sharedRepository.IsReferenced(package.Id, package.Version);
+ }
+
+ public IEnumerable<PackageOperation> GetInstallPackageOperations(IPackage package, InstallPackageAction installAction)
+ {
+ IPackageOperationResolver resolver = CreateInstallPackageOperationResolver(installAction);
+ return resolver.ResolveOperations(package);
+ }
+
+ IPackageOperationResolver CreateInstallPackageOperationResolver(InstallPackageAction installAction)
+ {
+ return packageOperationResolverFactory.CreateInstallPackageOperationResolver(
+ LocalRepository,
+ SourceRepository,
+ Logger,
+ installAction);
+ }
+
+ public void UpdatePackage(IPackage package, UpdatePackageAction updateAction)
+ {
+ RunPackageOperations(updateAction.Operations);
+ UpdatePackageReference(package, updateAction);
+ }
+
+ public void UpdatePackageReference(IPackage package, IUpdatePackageSettings settings)
+ {
+ UpdatePackageReference(package, settings.UpdateDependencies, settings.AllowPrereleaseVersions);
+ }
+
+ void UpdatePackageReference(IPackage package, bool updateDependencies, bool allowPrereleaseVersions)
+ {
+ var monitor = new PackageReferenceMonitor (ProjectManager, this);
+ using (monitor) {
+ ProjectManager.UpdatePackageReference(package.Id, package.Version, updateDependencies, allowPrereleaseVersions);
+ }
+
+ monitor.PackagesRemoved.ForEach(packageRemoved => UninstallPackageFromSolutionRepository(packageRemoved));
+ }
+
+ public void UpdatePackages(UpdatePackagesAction updateAction)
+ {
+ RunPackageOperations(updateAction.Operations);
+ foreach (IPackage package in updateAction.Packages) {
+ UpdatePackageReference(package, updateAction);
+ }
+ }
+
+ public IEnumerable<PackageOperation> GetUpdatePackageOperations(
+ IEnumerable<IPackage> packages,
+ IUpdatePackageSettings settings)
+ {
+ IPackageOperationResolver resolver = CreateUpdatePackageOperationResolver(settings);
+
+ var reducedOperations = new ReducedPackageOperations(resolver, packages);
+ reducedOperations.Reduce();
+ return reducedOperations.Operations;
+ }
+
+ IPackageOperationResolver CreateUpdatePackageOperationResolver(IUpdatePackageSettings settings)
+ {
+ return packageOperationResolverFactory.CreateUpdatePackageOperationResolver(
+ LocalRepository,
+ SourceRepository,
+ Logger,
+ settings);
+ }
+
+ public void RunPackageOperations(IEnumerable<PackageOperation> operations)
+ {
+ foreach (PackageOperation operation in operations) {
+ Execute(operation);
+ }
+ }
+
+ public ReinstallPackageOperations GetReinstallPackageOperations (IEnumerable<IPackage> packages)
+ {
+ var installWalker = new InstallWalker (
+ LocalRepository,
+ SourceRepository,
+ ProjectManager.Project.TargetFramework,
+ ProjectManager.Logger,
+ ignoreDependencies: true,
+ allowPrereleaseVersions: false,
+ dependencyVersion: DependencyVersion.Lowest);
+
+ IList<IPackage> packagesInDependencyOrder;
+ IList<PackageOperation> operations = installWalker.ResolveOperations (
+ packages,
+ out packagesInDependencyOrder,
+ allowPrereleaseVersionsBasedOnPackage: true);
+
+ return new ReinstallPackageOperations (operations, packagesInDependencyOrder);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopPackageManagerFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopPackageManagerFactory.cs
new file mode 100644
index 0000000000..f9b191e565
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopPackageManagerFactory.cs
@@ -0,0 +1,95 @@
+//
+// MonoDevelopPackageManagerFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using MonoDevelop.PackageManagement;
+using MonoDevelop.Projects;
+using NuGet;
+
+namespace MonoDevelop.PackageManagement
+{
+ internal class MonoDevelopPackageManagerFactory : IPackageManagerFactory
+ {
+ PackageManagementOptions options;
+ IMonoDevelopPackageRepositoryFactory packageRepositoryFactory;
+ IMonoDevelopProjectSystemFactory projectSystemFactory;
+
+ public MonoDevelopPackageManagerFactory()
+ : this(
+ new MonoDevelopPackageRepositoryFactory(),
+ new MonoDevelopProjectSystemFactory(),
+ PackageManagementServices.Options)
+ {
+ }
+
+ public MonoDevelopPackageManagerFactory(
+ IMonoDevelopPackageRepositoryFactory packageRepositoryFactory,
+ IMonoDevelopProjectSystemFactory projectSystemFactory,
+ PackageManagementOptions options)
+ {
+ this.packageRepositoryFactory = packageRepositoryFactory;
+ this.projectSystemFactory = projectSystemFactory;
+ this.options = options;
+ }
+
+ public IMonoDevelopPackageManager CreatePackageManager(
+ IPackageRepository sourceRepository,
+ IDotNetProject project)
+ {
+ SolutionPackageRepository solutionPackageRepository = CreateSolutionPackageRepository (project.ParentSolution);
+ IProjectSystem projectSystem = CreateProjectSystem (project.DotNetProject);
+ PackageOperationsResolverFactory packageOperationResolverFactory = new PackageOperationsResolverFactory();
+
+ return new MonoDevelopPackageManager(
+ sourceRepository,
+ projectSystem,
+ solutionPackageRepository,
+ packageOperationResolverFactory);
+ }
+
+ SolutionPackageRepository CreateSolutionPackageRepository (ISolution solution)
+ {
+ return new SolutionPackageRepository (solution, packageRepositoryFactory, options);
+ }
+
+ IProjectSystem CreateProjectSystem(DotNetProject project)
+ {
+ return projectSystemFactory.CreateProjectSystem(project);
+ }
+
+ public IPackageManager CreatePackageManager (
+ IPackageRepository sourceRepository,
+ ISolutionPackageRepository solutionPackageRepository)
+ {
+ return new PackageManager (
+ sourceRepository,
+ solutionPackageRepository.PackagePathResolver,
+ solutionPackageRepository.FileSystem,
+ solutionPackageRepository.Repository);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopPackageRepositoryFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopPackageRepositoryFactory.cs
new file mode 100644
index 0000000000..47a35521cc
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopPackageRepositoryFactory.cs
@@ -0,0 +1,58 @@
+//
+// MonoDevelopPackageRepositoryFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using MonoDevelop.PackageManagement;
+using NuGet;
+
+namespace MonoDevelop.PackageManagement
+{
+ internal class MonoDevelopPackageRepositoryFactory : PackageRepositoryFactory, IMonoDevelopPackageRepositoryFactory
+ {
+ public ISharedPackageRepository CreateSharedRepository(
+ IPackagePathResolver pathResolver,
+ IFileSystem fileSystem,
+ IFileSystem configSettingsFileSystem)
+ {
+ return new SharedPackageRepository(pathResolver, fileSystem, configSettingsFileSystem);
+ }
+
+ public IRecentPackageRepository CreateRecentPackageRepository(
+ IList<RecentPackageInfo> recentPackages,
+ IPackageRepository aggregateRepository)
+ {
+ return new RecentPackageRepository(recentPackages, aggregateRepository);
+ }
+
+ public IPackageRepository CreateAggregateRepository(IEnumerable<IPackageRepository> repositories)
+ {
+ return new MonoDevelopAggregateRepository (repositories);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopProjectManager.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopProjectManager.cs
new file mode 100644
index 0000000000..445c6260f5
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopProjectManager.cs
@@ -0,0 +1,64 @@
+//
+// MonoDevelopProjectManager.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace MonoDevelop.PackageManagement
+{
+ internal class MonoDevelopProjectManager : ProjectManager, IMonoDevelopProjectManager
+ {
+ public MonoDevelopProjectManager(
+ IPackageRepository sourceRepository,
+ IPackagePathResolver pathResolver,
+ IProjectSystem project,
+ IPackageRepository localRepository)
+ : base(sourceRepository, pathResolver, project, localRepository)
+ {
+ }
+
+ public bool IsInstalled(string packageId)
+ {
+ return LocalRepository.Exists(packageId);
+ }
+
+ public bool HasOlderPackageInstalled(IPackage package)
+ {
+ IPackage installedPackage = LocalRepository.FindPackage(package.Id);
+ return (installedPackage != null) &&
+ (installedPackage.Version < package.Version);
+ }
+
+ public IEnumerable<PackageReference> GetPackageReferences ()
+ {
+ var repository = LocalRepository as PackageReferenceRepository;
+ return repository.ReferenceFile.GetPackageReferences ();
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopProjectSystem.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopProjectSystem.cs
new file mode 100644
index 0000000000..2679c57a95
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopProjectSystem.cs
@@ -0,0 +1,498 @@
+//
+// MonoDevelopProjectSystem.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+using System.Runtime.Versioning;
+using System.Threading.Tasks;
+
+using MonoDevelop.Core;
+using MonoDevelop.Ide;
+using MonoDevelop.PackageManagement;
+using MonoDevelop.Projects;
+using MonoDevelop.Projects.MSBuild;
+using NuGet;
+
+namespace MonoDevelop.PackageManagement
+{
+ internal class MonoDevelopProjectSystem : PhysicalFileSystem, IProjectSystem
+ {
+ IDotNetProject project;
+ ProjectTargetFramework targetFramework;
+ IPackageManagementFileService fileService;
+ IPackageManagementEvents packageManagementEvents;
+ Action<Action> guiSyncDispatcher;
+ Func<Func<Task>,Task> guiSyncDispatcherFunc;
+
+ public MonoDevelopProjectSystem(DotNetProject project)
+ : this (
+ new DotNetProjectProxy (project),
+ new PackageManagementFileService (),
+ PackageManagementServices.ProjectService,
+ PackageManagementServices.PackageManagementEvents,
+ DefaultGuiSyncDispatcher,
+ GuiSyncDispatchWithException)
+ {
+ }
+
+ public MonoDevelopProjectSystem (
+ IDotNetProject project,
+ IPackageManagementFileService fileService,
+ IPackageManagementProjectService projectService,
+ IPackageManagementEvents packageManagementEvents,
+ Action<Action> guiSyncDispatcher,
+ Func<Func<Task>, Task> guiSyncDispatcherFunc)
+ : base (AppendTrailingSlashToDirectory (project.BaseDirectory))
+ {
+ this.project = project;
+ this.fileService = fileService;
+ this.packageManagementEvents = packageManagementEvents;
+ this.guiSyncDispatcher = guiSyncDispatcher;
+ this.guiSyncDispatcherFunc = guiSyncDispatcherFunc;
+ }
+
+ static string AppendTrailingSlashToDirectory(string directory)
+ {
+ return directory + Path.DirectorySeparatorChar.ToString();
+ }
+
+ public bool IsBindingRedirectSupported { get; set; }
+
+ public FrameworkName TargetFramework {
+ get {
+ return GuiSyncDispatch (() => GetTargetFramework ());
+ }
+ }
+
+ FrameworkName GetTargetFramework()
+ {
+ if (targetFramework == null) {
+ targetFramework = new ProjectTargetFramework(project);
+ }
+ return targetFramework.TargetFrameworkName;
+ }
+
+ public string ProjectName {
+ get {
+ return GuiSyncDispatch (() => project.Name);
+ }
+ }
+
+ public dynamic GetPropertyValue (string propertyName)
+ {
+ return GuiSyncDispatch (() => {
+ if ("RootNamespace".Equals(propertyName, StringComparison.OrdinalIgnoreCase)) {
+ return project.DefaultNamespace;
+ }
+ return String.Empty;
+ });
+ }
+
+ public void AddReference(string referencePath, Stream stream)
+ {
+ GuiSyncDispatch (async () => {
+ ProjectReference assemblyReference = CreateReference (referencePath);
+ packageManagementEvents.OnReferenceAdding (assemblyReference);
+ await AddReferenceToProject (assemblyReference);
+ });
+ }
+
+ ProjectReference CreateReference(string referencePath)
+ {
+ string fullPath = GetFullPath(referencePath);
+ return ProjectReference.CreateAssemblyFileReference (fullPath);
+ }
+
+ async Task AddReferenceToProject(ProjectReference assemblyReference)
+ {
+ project.References.Add (assemblyReference);
+ await project.SaveAsync ();
+ LogAddedReferenceToProject(assemblyReference);
+ }
+
+ void LogAddedReferenceToProject(ProjectReference referenceProjectItem)
+ {
+ LogAddedReferenceToProject(referenceProjectItem.Reference, ProjectName);
+ }
+
+ protected virtual void LogAddedReferenceToProject(string referenceName, string projectName)
+ {
+ DebugLogFormat("Added reference '{0}' to project '{1}'.", referenceName, projectName);
+ }
+
+ void DebugLogFormat(string format, params object[] args)
+ {
+ Logger.Log(MessageLevel.Debug, format, args);
+ }
+
+ public bool ReferenceExists(string name)
+ {
+ return GuiSyncDispatch (() => {
+ ProjectReference referenceProjectItem = FindReference (name);
+ if (referenceProjectItem != null) {
+ return true;
+ }
+ return false;
+ });
+ }
+
+ ProjectReference FindReference(string name)
+ {
+ string referenceName = GetReferenceName(name);
+ foreach (ProjectReference referenceProjectItem in project.References) {
+ string projectReferenceName = GetProjectReferenceName(referenceProjectItem.Reference);
+ if (IsMatchIgnoringCase(projectReferenceName, referenceName)) {
+ return referenceProjectItem;
+ }
+ }
+ return null;
+ }
+
+ string GetReferenceName(string name)
+ {
+ if (HasDllOrExeFileExtension(name)) {
+ return Path.GetFileNameWithoutExtension(name);
+ }
+ return name;
+ }
+
+ string GetProjectReferenceName(string name)
+ {
+ string referenceName = GetReferenceName(name);
+ return GetAssemblyShortName(referenceName);
+ }
+
+ string GetAssemblyShortName(string name)
+ {
+ string[] parts = name.Split(',');
+ return parts[0];
+ }
+
+ bool HasDllOrExeFileExtension(string name)
+ {
+ string extension = Path.GetExtension(name);
+ return
+ IsMatchIgnoringCase(extension, ".dll") ||
+ IsMatchIgnoringCase(extension, ".exe");
+ }
+
+ bool IsMatchIgnoringCase(string lhs, string rhs)
+ {
+ return String.Equals(lhs, rhs, StringComparison.InvariantCultureIgnoreCase);
+ }
+
+ public void RemoveReference(string name)
+ {
+ GuiSyncDispatch (async () => {
+ ProjectReference referenceProjectItem = FindReference (name);
+ if (referenceProjectItem != null) {
+ packageManagementEvents.OnReferenceRemoving (referenceProjectItem);
+ project.References.Remove (referenceProjectItem);
+ await project.SaveAsync ();
+ LogRemovedReferenceFromProject (referenceProjectItem);
+ }
+ });
+ }
+
+ void LogRemovedReferenceFromProject(ProjectReference referenceProjectItem)
+ {
+ LogRemovedReferenceFromProject(referenceProjectItem.Reference, ProjectName);
+ }
+
+ protected virtual void LogRemovedReferenceFromProject(string referenceName, string projectName)
+ {
+ DebugLogFormat("Removed reference '{0}' from project '{1}'.", referenceName, projectName);
+ }
+
+ public bool IsSupportedFile(string path)
+ {
+ return GuiSyncDispatch (() => {
+ if (project.IsWebProject ()) {
+ return !IsAppConfigFile (path);
+ }
+ return !IsWebConfigFile (path);
+ });
+ }
+
+ bool IsWebConfigFile(string path)
+ {
+ return IsFileNameMatchIgnoringPath("web.config", path);
+ }
+
+ bool IsAppConfigFile(string path)
+ {
+ return IsFileNameMatchIgnoringPath("app.config", path);
+ }
+
+ bool IsFileNameMatchIgnoringPath(string fileName1, string path)
+ {
+ string fileName2 = Path.GetFileName(path);
+ return IsMatchIgnoringCase(fileName1, fileName2);
+ }
+
+ public override void AddFile(string path, Stream stream)
+ {
+ PhysicalFileSystemAddFile(path, stream);
+ GuiSyncDispatch (async () => await AddFileToProject (path));
+ }
+
+ protected virtual void PhysicalFileSystemAddFile(string path, Stream stream)
+ {
+ base.AddFile(path, stream);
+ }
+
+ public override void AddFile(string path, Action<Stream> writeToStream)
+ {
+ PhysicalFileSystemAddFile (path, writeToStream);
+ GuiSyncDispatch (async () => await AddFileToProject (path));
+ }
+
+ protected virtual void PhysicalFileSystemAddFile (string path, Action<Stream> writeToStream)
+ {
+ base.AddFile(path, writeToStream);
+ }
+
+ async Task AddFileToProject(string path)
+ {
+ if (ShouldAddFileToProject(path)) {
+ await AddFileProjectItemToProject(path);
+ }
+ OnFileChanged (path);
+ LogAddedFileToProject(path);
+ }
+
+ bool ShouldAddFileToProject(string path)
+ {
+ return !IsBinDirectory(path) && !FileExistsInProject(path);
+ }
+
+ void OnFileChanged (string path)
+ {
+ GuiSyncDispatch (() => fileService.OnFileChanged (GetFullPath (path)));
+ }
+
+ bool IsBinDirectory(string path)
+ {
+ string directoryName = Path.GetDirectoryName(path);
+ return IsMatchIgnoringCase(directoryName, "bin");
+ }
+
+ public bool FileExistsInProject(string path)
+ {
+ string fullPath = GetFullPath(path);
+ return GuiSyncDispatch (() => {
+ return project.IsFileInProject (fullPath);
+ });
+ }
+
+ async Task AddFileProjectItemToProject(string path)
+ {
+ ProjectFile fileItem = CreateFileProjectItem (path);
+ project.AddFile (fileItem);
+ await project.SaveAsync ();
+ }
+
+ ProjectFile CreateFileProjectItem(string path)
+ {
+ //TODO custom tool?
+ string fullPath = GetFullPath(path);
+ string buildAction = project.GetDefaultBuildAction(fullPath);
+ return new ProjectFile(fullPath) {
+ BuildAction = buildAction
+ };
+ }
+
+ void LogAddedFileToProject(string fileName)
+ {
+ LogAddedFileToProject(fileName, ProjectName);
+ }
+
+ protected virtual void LogAddedFileToProject(string fileName, string projectName)
+ {
+ DebugLogFormat("Added file '{0}' to project '{1}'.", fileName, projectName);
+ }
+
+ public override void DeleteDirectory(string path, bool recursive)
+ {
+ GuiSyncDispatch (async () => {
+ string directory = GetFullPath (path);
+ fileService.RemoveDirectory (directory);
+ await project.SaveAsync ();
+ LogDeletedDirectory (path);
+ });
+ }
+
+ public override void DeleteFile(string path)
+ {
+ GuiSyncDispatch (async () => {
+ string fileName = GetFullPath (path);
+ project.Files.Remove (fileName);
+ fileService.RemoveFile (fileName);
+ await project.SaveAsync ();
+ LogDeletedFileInfo (path);
+ });
+ }
+
+ protected virtual void LogDeletedDirectory(string folder)
+ {
+ DebugLogFormat("Removed folder '{0}'.", folder);
+ }
+
+ void LogDeletedFileInfo(string path)
+ {
+ string fileName = Path.GetFileName(path);
+ string directory = Path.GetDirectoryName(path);
+ if (String.IsNullOrEmpty(directory)) {
+ LogDeletedFile(fileName);
+ } else {
+ LogDeletedFileFromDirectory(fileName, directory);
+ }
+ }
+
+ protected virtual void LogDeletedFile(string fileName)
+ {
+ DebugLogFormat("Removed file '{0}'.", fileName);
+ }
+
+ protected virtual void LogDeletedFileFromDirectory(string fileName, string directory)
+ {
+ DebugLogFormat("Removed file '{0}' from folder '{1}'.", fileName, directory);
+ }
+
+ public void AddFrameworkReference(string name)
+ {
+ GuiSyncDispatch (async () => {
+ ProjectReference assemblyReference = CreateGacReference (name);
+ await AddReferenceToProject (assemblyReference);
+ });
+ }
+
+ ProjectReference CreateGacReference(string name)
+ {
+ return ProjectReference.CreateAssemblyReference (name);
+ }
+
+ public string ResolvePath(string path)
+ {
+ return path;
+ }
+
+ public void AddImport(string targetPath, ProjectImportLocation location)
+ {
+ GuiSyncDispatch (async () => {
+ string relativeTargetPath = GetRelativePath (targetPath);
+ string condition = GetCondition (relativeTargetPath);
+ using (var handler = CreateNewImportsHandler ()) {
+ handler.AddImportIfMissing (relativeTargetPath, condition, location);
+ await project.SaveAsync ();
+ }
+ });
+ }
+
+ protected virtual INuGetPackageNewImportsHandler CreateNewImportsHandler ()
+ {
+ return new NuGetPackageNewImportsHandler ();
+ }
+
+ static string GetCondition (string targetPath)
+ {
+ return String.Format ("Exists('{0}')", targetPath);
+ }
+
+ string GetRelativePath(string path)
+ {
+ return MSBuildProjectService.ToMSBuildPath (project.BaseDirectory, path);
+ }
+
+ public void RemoveImport(string targetPath)
+ {
+ GuiSyncDispatch (async () => {
+ string relativeTargetPath = GetRelativePath (targetPath);
+ project.RemoveImport (relativeTargetPath);
+ RemoveImportWithForwardSlashes (targetPath);
+
+ using (var updater = new EnsureNuGetPackageBuildImportsTargetUpdater ()) {
+ updater.RemoveImport (relativeTargetPath);
+ await project.SaveAsync ();
+ }
+
+ packageManagementEvents.OnImportRemoved (project, relativeTargetPath);
+ });
+ }
+
+ void RemoveImportWithForwardSlashes (string targetPath)
+ {
+ string relativeTargetPath = FileService.AbsoluteToRelativePath (project.BaseDirectory, targetPath);
+ if (Path.DirectorySeparatorChar == '\\') {
+ relativeTargetPath = relativeTargetPath.Replace ('\\', '/');
+ }
+ project.RemoveImport (relativeTargetPath);
+ }
+
+ /// <summary>
+ /// NuGet sometimes uses CreateFile to replace an existing file.
+ /// This happens when the XML transformation (web.config.transform) is reverted on
+ /// uninstalling a NuGet package. It also happens when an XML document transform
+ /// (.install.xdt, .uninstall.xdt) is run.
+ /// </summary>
+ public override Stream CreateFile (string path)
+ {
+ OnFileChanged (path);
+ return base.CreateFile (path);
+ }
+
+ T GuiSyncDispatch<T> (Func<T> action)
+ {
+ T result = default(T);
+ guiSyncDispatcher (() => result = action ());
+ return result;
+ }
+
+ void GuiSyncDispatch (Action action)
+ {
+ guiSyncDispatcher (() => action ());
+ }
+
+ static Task GuiSyncDispatchWithException (Func<Task> func)
+ {
+ if (Runtime.IsMainThread)
+ throw new InvalidOperationException ("GuiSyncDispatch called from GUI thread");
+ return Runtime.RunInMainThread (func);
+ }
+
+ public static void DefaultGuiSyncDispatcher (Action action)
+ {
+ Runtime.RunInMainThread (action).Wait ();
+ }
+
+ void GuiSyncDispatch (Func<Task> func)
+ {
+ guiSyncDispatcherFunc (func).Wait ();
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopProjectSystemFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopProjectSystemFactory.cs
new file mode 100644
index 0000000000..62dc7d1817
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopProjectSystemFactory.cs
@@ -0,0 +1,42 @@
+//
+// MonoDevelopProjectSystemFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Projects;
+using NuGet;
+
+namespace MonoDevelop.PackageManagement
+{
+ internal class MonoDevelopProjectSystemFactory : IMonoDevelopProjectSystemFactory
+ {
+ public IProjectSystem CreateProjectSystem(DotNetProject project)
+ {
+ return new MonoDevelopProjectSystem(project);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/NuGetPackageNewImportsHandler.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/NuGetPackageNewImportsHandler.cs
new file mode 100644
index 0000000000..ba687b81a1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/NuGetPackageNewImportsHandler.cs
@@ -0,0 +1,65 @@
+//
+// NuGetPackageNewImportsHandler.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using MonoDevelop.Projects.MSBuild;
+using NuGet;
+
+namespace MonoDevelop.PackageManagement
+{
+ internal class NuGetPackageNewImportsHandler : INuGetPackageNewImportsHandler
+ {
+ string name;
+ string condition;
+ ProjectImportLocation location;
+
+ public NuGetPackageNewImportsHandler ()
+ {
+ PackageManagementMSBuildExtension.NewImportsHandler = this;
+ }
+
+ public void Dispose ()
+ {
+ PackageManagementMSBuildExtension.NewImportsHandler = null;
+ }
+
+ public void AddImportIfMissing (string name, string condition, ProjectImportLocation location)
+ {
+ this.name = name;
+ this.condition = condition;
+ this.location = location;
+ }
+
+ public void UpdateProject (MSBuildProject project)
+ {
+ if (String.IsNullOrEmpty (name))
+ return;
+
+ project.AddImportIfMissing (name, location, condition);
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/NullOpenPackageReadMeMonitor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/NullOpenPackageReadMeMonitor.cs
index 51414a77f0..679b82cb30 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/NullOpenPackageReadMeMonitor.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/NullOpenPackageReadMeMonitor.cs
@@ -26,7 +26,7 @@
namespace MonoDevelop.PackageManagement
{
- public class NullOpenPackageReadMeMonitor : IOpenPackageReadMeMonitor
+ internal class NullOpenPackageReadMeMonitor : IOpenPackageReadMeMonitor
{
public static readonly IOpenPackageReadMeMonitor Null = new NullOpenPackageReadMeMonitor ();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/OpenDotNetProjects.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/OpenDotNetProjects.cs
index cd3138b4bc..1faa3b74a9 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/OpenDotNetProjects.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/OpenDotNetProjects.cs
@@ -31,9 +31,9 @@ using System.Collections.Generic;
using MonoDevelop.Projects;
using MonoDevelop.PackageManagement;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class OpenDotNetProjects
+ internal class OpenDotNetProjects
{
IPackageManagementProjectService projectService;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/OpenPackageReadmeMonitor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/OpenPackageReadmeMonitor.cs
index dcef59e884..a88d721192 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/OpenPackageReadmeMonitor.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/OpenPackageReadmeMonitor.cs
@@ -27,12 +27,12 @@
using System;
using System.IO;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement
{
- public class OpenPackageReadMeMonitor : IOpenPackageReadMeMonitor
+ internal class OpenPackageReadMeMonitor : IOpenPackageReadMeMonitor
{
IPackageManagementProject project;
IPackageManagementFileService fileService;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageActionRunner.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageActionRunner.cs
index 9e5eebfacf..3836dbeff3 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageActionRunner.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageActionRunner.cs
@@ -30,9 +30,9 @@ using System;
using System.Collections.Generic;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageActionRunner : IPackageActionRunner
+ internal class PackageActionRunner : IPackageActionRunner
{
IPackageManagementEvents packageManagementEvents;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageCompatibility.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageCompatibility.cs
index c4841df845..69922f7a32 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageCompatibility.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageCompatibility.cs
@@ -28,12 +28,12 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Versioning;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement
{
- public class PackageCompatibility
+ internal class PackageCompatibility
{
IDotNetProject project;
IPackage package;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageCompatibilityChecker.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageCompatibilityChecker.cs
index 1252aa9018..38ae89ad1e 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageCompatibilityChecker.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageCompatibilityChecker.cs
@@ -1,41 +1,42 @@
-//
-// PackageCompatibilityChecker.cs
-//
-// Author:
-// Matt Ward <matt.ward@xamarin.com>
-//
-// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
+//
+// PackageCompatibilityChecker.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Versioning;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Ide;
using NuGet;
-
+using MonoDevelop.Core;
+
namespace MonoDevelop.PackageManagement
{
- public class PackageCompatibilityChecker
+ internal class PackageCompatibilityChecker
{
IPackageManagementSolution solution;
IRegisteredPackageRepositories registeredRepositories;
@@ -118,9 +119,9 @@ namespace MonoDevelop.PackageManagement
return packageReferences.Any (packageReference => packageReference.RequireReinstallation);
}
- protected virtual void GuiDispatch (MessageHandler handler)
+ protected virtual void GuiDispatch (Action handler)
{
- DispatchService.GuiDispatch (handler);
+ Runtime.RunInMainThread (handler);
}
public void GenerateReport (TextWriter writer)
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageCompatibilityHandler.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageCompatibilityHandler.cs
index 07d943a34b..f01886e712 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageCompatibilityHandler.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageCompatibilityHandler.cs
@@ -25,12 +25,12 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Ide;
namespace MonoDevelop.PackageManagement
{
- public class PackageCompatibilityHandler
+ internal class PackageCompatibilityHandler
{
public void MonitorTargetFrameworkChanges (ProjectTargetFrameworkMonitor projectTargetFrameworkMonitor)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageCompatibilityRunner.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageCompatibilityRunner.cs
index 5d52a4614d..90ed0fe71e 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageCompatibilityRunner.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageCompatibilityRunner.cs
@@ -26,21 +26,22 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using System.Threading.Tasks;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.Ide;
using NuGet;
namespace MonoDevelop.PackageManagement
{
- public class PackageCompatibilityRunner
+ internal class PackageCompatibilityRunner
{
IDotNetProject project;
IPackageManagementSolution solution;
IRegisteredPackageRepositories registeredRepositories;
IPackageManagementProgressMonitorFactory progressMonitorFactory;
ProgressMonitorStatusMessage progressMessage;
- IProgressMonitor progressMonitor;
+ ProgressMonitor progressMonitor;
IPackageManagementEvents packageManagementEvents;
IProgressProvider progressProvider;
@@ -76,9 +77,9 @@ namespace MonoDevelop.PackageManagement
BackgroundDispatch (() => RunInternal ());
}
- protected virtual void BackgroundDispatch (MessageHandler handler)
+ protected virtual void BackgroundDispatch (Action action)
{
- DispatchService.BackgroundDispatch (() => RunInternal ());
+ PackageManagementBackgroundDispatcher.Dispatch (action);
}
void RunInternal ()
@@ -101,18 +102,18 @@ namespace MonoDevelop.PackageManagement
return ProgressMonitorStatusMessageFactory.CreateCheckingPackageCompatibilityMessage ();
}
- IProgressMonitor CreateProgressMonitor ()
+ ProgressMonitor CreateProgressMonitor ()
{
return progressMonitorFactory.CreateProgressMonitor (progressMessage.Status);
}
- PackageManagementEventsMonitor CreateEventMonitor (IProgressMonitor monitor)
+ PackageManagementEventsMonitor CreateEventMonitor (ProgressMonitor monitor)
{
return CreateEventMonitor (monitor, packageManagementEvents, progressProvider);
}
protected virtual PackageManagementEventsMonitor CreateEventMonitor (
- IProgressMonitor monitor,
+ ProgressMonitor monitor,
IPackageManagementEvents packageManagementEvents,
IProgressProvider progressProvider)
{
@@ -157,7 +158,7 @@ namespace MonoDevelop.PackageManagement
ShowPackageConsole (progressMonitor);
}
- protected virtual void ShowPackageConsole (IProgressMonitor progressMonitor)
+ protected virtual void ShowPackageConsole (ProgressMonitor progressMonitor)
{
progressMonitor.ShowPackageConsole ();
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFiles.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFiles.cs
index 79d2189ecc..c809d8585e 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFiles.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFiles.cs
@@ -33,9 +33,9 @@ using System.Linq;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageFiles
+ internal class PackageFiles
{
IEnumerable<IPackageFile> files;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFilesForOperations.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFilesForOperations.cs
index 9ebb699d91..d8d8f9ec7c 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFilesForOperations.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFilesForOperations.cs
@@ -30,9 +30,9 @@ using System;
using System.Collections.Generic;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageFilesForOperations
+ internal class PackageFilesForOperations
{
IEnumerable<PackageOperation> operations;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFromRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFromRepository.cs
index f597c22480..c5b6ec36f5 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFromRepository.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFromRepository.cs
@@ -33,9 +33,9 @@ using System.Runtime.Versioning;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageFromRepository : IPackageFromRepository
+ internal class PackageFromRepository : IPackageFromRepository
{
IPackage package;
bool? hasDependencies;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageLicenseViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageLicenseViewModel.cs
index b6269554cc..81bc2c340c 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageLicenseViewModel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageLicenseViewModel.cs
@@ -27,11 +27,14 @@
//
using System;
+using System.Collections.Generic;
+using System.Linq;
+using MonoDevelop.Core;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageLicenseViewModel : ViewModelBase<PackageLicenseViewModel>
+ internal class PackageLicenseViewModel : ViewModelBase<PackageLicenseViewModel>
{
IPackage package;
@@ -51,5 +54,22 @@ namespace ICSharpCode.PackageManagement
public Uri LicenseUrl {
get { return package.LicenseUrl; }
}
+
+ internal string GetAuthors ()
+ {
+ List<string> authors = package.Authors.ToList ();
+
+ string authorStartText = null;
+ if (authors.Count > 1) {
+ authorStartText = GettextCatalog.GetString ("Authors:");
+ } else {
+ authorStartText = GettextCatalog.GetString ("Author:");
+ }
+
+ return String.Format (
+ "{0} {1}",
+ authorStartText,
+ String.Join (", ", authors));
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageListViewTextFormatter.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageListViewTextFormatter.cs
index 3bcaf06a72..82eb773db9 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageListViewTextFormatter.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageListViewTextFormatter.cs
@@ -29,7 +29,7 @@ using System.Text;
namespace MonoDevelop.PackageManagement
{
- public static class PackageListViewTextFormatter
+ internal static class PackageListViewTextFormatter
{
public static string Format (string text)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementBackgroundDispatcher.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementBackgroundDispatcher.cs
new file mode 100644
index 0000000000..1839762c2c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementBackgroundDispatcher.cs
@@ -0,0 +1,96 @@
+//
+// PackageManagementBackgroundDispatcher.cs
+//
+// Author:
+// Todd Berman <tberman@off.net>
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2005 Todd Berman <tberman@off.net>
+// Copyright (c) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Threading;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.PackageManagement
+{
+ class PackageManagementBackgroundDispatcher
+ {
+ static Queue<Action> backgroundQueue = new Queue<Action> ();
+ static ManualResetEvent backgroundThreadWait = new ManualResetEvent (false);
+ static Thread backgroundThread;
+
+ public static void Initialize ()
+ {
+ backgroundThread = new Thread (new ThreadStart (RunDispatcher)) {
+ Name = "NuGet background dispatcher",
+ IsBackground = true,
+ Priority = ThreadPriority.Lowest,
+ };
+ backgroundThread.Start ();
+ }
+
+ static void RunDispatcher ()
+ {
+ while (true) {
+ Action action = null;
+ bool wait = false;
+ lock (backgroundQueue) {
+ if (backgroundQueue.Count == 0) {
+ backgroundThreadWait.Reset ();
+ wait = true;
+ } else
+ action = backgroundQueue.Dequeue ();
+ }
+
+ if (wait) {
+ backgroundThreadWait.WaitOne ();
+ continue;
+ }
+
+ if (action != null) {
+ try {
+ action ();
+ } catch (Exception ex) {
+ LoggingService.LogError ("BackgroundDispatcher error.", ex);
+ }
+ }
+ }
+ }
+
+ public static void Dispatch (Action action)
+ {
+ QueueBackground (action);
+ }
+
+ static void QueueBackground (Action action)
+ {
+ lock (backgroundQueue) {
+ backgroundQueue.Enqueue (action);
+ if (backgroundQueue.Count == 1)
+ backgroundThreadWait.Set ();
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementCompilerMessageView.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementCompilerMessageView.cs
index 60d8f50aa1..0cc26c372f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementCompilerMessageView.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementCompilerMessageView.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageManagementCompilerMessageView : ICompilerMessageView
+ internal class PackageManagementCompilerMessageView : ICompilerMessageView
{
public IMessageViewCategory Create(string categoryName, string categoryDisplayName)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEnumerableExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEnumerableExtensions.cs
index 4033521c6e..302eca8e84 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEnumerableExtensions.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEnumerableExtensions.cs
@@ -30,9 +30,9 @@ using System;
using System.Collections.Generic;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public static class PackageManagementEnumerableExtensions
+ internal static class PackageManagementEnumerableExtensions
{
public static IEnumerable<TSource> DistinctLast<TSource>(this IEnumerable<TSource> source, IEqualityComparer<TSource> comparer)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEvents.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEvents.cs
index fa67203211..f060f0f8ab 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEvents.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEvents.cs
@@ -33,9 +33,9 @@ using NuGet;
using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageManagementEvents : IPackageManagementEvents
+ internal class PackageManagementEvents : IPackageManagementEvents
{
public event EventHandler PackageOperationsStarting;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEventsMonitor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEventsMonitor.cs
index a6130d65f7..4676b26668 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEventsMonitor.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEventsMonitor.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.Ide;
using NuGet;
@@ -35,9 +35,9 @@ using MonoDevelop.Ide.TypeSystem;
namespace MonoDevelop.PackageManagement
{
- public class PackageManagementEventsMonitor : IDisposable
+ internal class PackageManagementEventsMonitor : IDisposable
{
- IProgressMonitor progressMonitor;
+ ProgressMonitor progressMonitor;
IPackageManagementEvents packageManagementEvents;
IProgressProvider progressProvider;
FileConflictResolution lastFileConflictResolution;
@@ -48,7 +48,7 @@ namespace MonoDevelop.PackageManagement
ISolution solutionContainingProjectBuildersToDispose;
public PackageManagementEventsMonitor (
- IProgressMonitor progressMonitor,
+ ProgressMonitor progressMonitor,
IPackageManagementEvents packageManagementEvents,
IProgressProvider progressProvider)
{
@@ -99,9 +99,9 @@ namespace MonoDevelop.PackageManagement
(lastFileConflictResolution == FileConflictResolution.OverwriteAll);
}
- protected virtual void GuiSyncDispatch (MessageHandler handler)
+ protected virtual void GuiSyncDispatch (Action action)
{
- DispatchService.GuiSyncDispatch (handler);
+ Runtime.RunInMainThread (action).Wait ();
}
void PackageOperationMessageLogged (object sender, PackageOperationMessageLoggedEventArgs e)
@@ -199,7 +199,7 @@ namespace MonoDevelop.PackageManagement
packageManagementEvents.OnPackageOperationError (ex);
}
- protected virtual void ShowPackageConsole (IProgressMonitor progressMonitor)
+ protected virtual void ShowPackageConsole (ProgressMonitor progressMonitor)
{
progressMonitor.ShowPackageConsole ();
}
@@ -213,10 +213,11 @@ namespace MonoDevelop.PackageManagement
protected virtual void ReconnectAssemblyReferences (IPackageManagementProject project)
{
- var projectWrapper = TypeSystemService.GetProjectContentWrapper (project.DotNetProject);
- if (projectWrapper != null) {
- projectWrapper.ReconnectAssemblyReferences ();
- }
+ // TODO : Roslyn port ?
+// var projectWrapper = TypeSystemService.GetProjectContentWrapper (project.DotNetProject);
+// if (projectWrapper != null) {
+// projectWrapper.ReconnectAssemblyReferences ();
+// }
}
void PackageInstalled (object sender, ParentPackageOperationEventArgs e)
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementFileService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementFileService.cs
index e222021128..16f46e11d5 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementFileService.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementFileService.cs
@@ -31,9 +31,9 @@ using System.IO;
using MonoDevelop.Core;
using MonoDevelop.Ide;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageManagementFileService : IPackageManagementFileService
+ internal class PackageManagementFileService : IPackageManagementFileService
{
IPackageManagementEvents packageManagementEvents;
@@ -71,9 +71,9 @@ namespace ICSharpCode.PackageManagement
public void OpenFile (string path)
{
- DispatchService.GuiSyncDispatch (() => {
+ Runtime.RunInMainThread (() => {
IdeApp.Workbench.OpenDocument (path, null, true);
- });
+ }).Wait ();
}
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementLogger.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementLogger.cs
index c1e0f33bfc..688188d843 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementLogger.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementLogger.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageManagementLogger : ILogger
+ internal class PackageManagementLogger : ILogger
{
IPackageManagementEvents packageManagementEvents;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementMSBuildExtension.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementMSBuildExtension.cs
index 596a30aafa..2d7ea6dca8 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementMSBuildExtension.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementMSBuildExtension.cs
@@ -27,19 +27,31 @@
using System;
using MonoDevelop.Core;
using MonoDevelop.Projects;
-using MonoDevelop.Projects.Formats.MSBuild;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.PackageManagement
{
- public class PackageManagementMSBuildExtension : MSBuildExtension
+ internal class PackageManagementMSBuildExtension : ProjectExtension
{
public static EnsureNuGetPackageBuildImportsTargetUpdater Updater;
+ public static NuGetPackageNewImportsHandler NewImportsHandler;
- public override void SaveProject (IProgressMonitor monitor, SolutionEntityItem item, MSBuildProject project)
+ protected override void OnWriteProject (ProgressMonitor monitor, MSBuildProject msproject)
+ {
+ UpdateProject (msproject);
+ base.OnWriteProject (monitor, msproject);
+ }
+
+ public void UpdateProject (MSBuildProject msproject)
{
EnsureNuGetPackageBuildImportsTargetUpdater currentUpdater = Updater;
if (currentUpdater != null) {
- currentUpdater.UpdateProject (project);
+ currentUpdater.UpdateProject (msproject);
+ }
+
+ NuGetPackageNewImportsHandler importsHandler = NewImportsHandler;
+ if (importsHandler != null) {
+ importsHandler.UpdateProject (msproject);
}
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementMessageViewCategory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementMessageViewCategory.cs
index 3bd784677f..8665006a0d 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementMessageViewCategory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementMessageViewCategory.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageManagementMessageViewCategory : IMessageViewCategory
+ internal class PackageManagementMessageViewCategory : IMessageViewCategory
{
// MessageViewCategory messageViewCategory;
//
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOptions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOptions.cs
index 2e15423ba0..6965afb94a 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOptions.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOptions.cs
@@ -34,9 +34,9 @@ using MonoDevelop.Core;
using MonoDevelop.PackageManagement;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageManagementOptions
+ internal class PackageManagementOptions
{
const string PackageDirectoryPropertyName = "PackagesDirectory";
const string RecentPackagesPropertyName = "RecentPackages";
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOptionsViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOptionsViewModel.cs
index 72f74dbded..125fd06ca8 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOptionsViewModel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOptionsViewModel.cs
@@ -29,9 +29,9 @@
using System;
using System.Linq;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageManagementOptionsViewModel : ViewModelBase<PackageManagementOptionsViewModel>
+ internal class PackageManagementOptionsViewModel : ViewModelBase<PackageManagementOptionsViewModel>
{
PackageManagementOptions options;
IRecentPackageRepository recentPackageRepository;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOutputMessagesView.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOutputMessagesView.cs
index 87614c038e..9a8be1795d 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOutputMessagesView.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOutputMessagesView.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageManagementOutputMessagesView : IPackageManagementOutputMessagesView
+ internal class PackageManagementOutputMessagesView : IPackageManagementOutputMessagesView
{
public static readonly string CategoryName = "PackageManagement";
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProgressMonitor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProgressMonitor.cs
index 01df99b9a0..1bda3c5992 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProgressMonitor.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProgressMonitor.cs
@@ -1,4 +1,4 @@
-//
+//
// PackageManagementProgressMonitor.cs
//
// Author:
@@ -30,166 +30,94 @@ using System.IO;
using System.Linq;
using MonoDevelop.Core;
using MonoDevelop.Core.Execution;
+using System.Threading;
using MonoDevelop.Core.ProgressMonitoring;
namespace MonoDevelop.PackageManagement
{
- public class PackageManagementProgressMonitor : IProgressMonitor, IAsyncOperation
+ internal class PackageManagementProgressMonitor : ProgressMonitor
{
- IProgressMonitor consoleMonitor;
- IProgressMonitor statusMonitor;
- List<string> warnings = new List<string> ();
- List<string> errors = new List<string> ();
+ OutputProgressMonitor consoleMonitor;
+ CancellationTokenRegistration consoleMonitorReg;
+ CancellationTokenRegistration statusMonitorReg;
- public IProgressMonitor ConsoleMonitor {
+ public ProgressMonitor ConsoleMonitor {
get { return consoleMonitor; }
}
- public IConsole Console {
- get { return (IConsole)this.consoleMonitor; }
+ public OperationConsole Console {
+ get { return consoleMonitor.Console; }
}
- public PackageManagementProgressMonitor (IProgressMonitor consoleMonitor, IProgressMonitor statusMonitor)
+ public PackageManagementProgressMonitor (OutputProgressMonitor consoleMonitor, ProgressMonitor statusMonitor)
{
+ AddFollowerMonitor (statusMonitor);
this.consoleMonitor = consoleMonitor;
- this.statusMonitor = statusMonitor;
-
- consoleMonitor.CancelRequested += OnCancelRequested;
- statusMonitor.CancelRequested += OnCancelRequested;
- }
-
- public void BeginTask (string name, int totalWork)
- {
- statusMonitor.BeginTask (name, totalWork);
- }
-
- public void BeginStepTask (string name, int totalWork, int stepSize)
- {
- statusMonitor.BeginStepTask (name, totalWork, stepSize);
- }
-
- public void EndTask ()
- {
- statusMonitor.EndTask ();
- }
- public void Step (int work)
- {
- statusMonitor.Step (work);
+ consoleMonitorReg = consoleMonitor.CancellationToken.Register (OnCancelRequested);
+ statusMonitorReg = statusMonitor.CancellationToken.Register (OnCancelRequested);
}
- public TextWriter Log
+ protected override void OnWriteLog (string message)
{
- get { return consoleMonitor.Log; }
+ consoleMonitor.Log.Write (message);
}
- public void ReportSuccess (string message)
+ protected override void OnWriteErrorLog (string message)
{
- consoleMonitor.ReportSuccess (message);
- statusMonitor.ReportSuccess (message);
+ consoleMonitor.ErrorLog.Write (message);
}
- public void ReportWarning (string message)
+ public override void Dispose ()
{
- warnings.Add (message);
- statusMonitor.ReportWarning (message);
- }
+ consoleMonitorReg.Dispose ();
+ statusMonitorReg.Dispose ();
- public void ReportError (string message, Exception ex)
- {
- errors.Add (message);
- statusMonitor.ReportError (message, ex);
- }
-
- public void Dispose ()
- {
- consoleMonitor.CancelRequested -= OnCancelRequested;
- statusMonitor.CancelRequested -= OnCancelRequested;
+ foreach (var m in SuccessMessages)
+ consoleMonitor.ReportSuccess (m);
// Do not report warnings if there are errors otherwise the warnings will
// appear at the end of the Package Console and hide the error which
// should be the last line of text visible to the user.
- if (errors.Count == 0) {
+ if (Errors.Length == 0) {
ReportAllWarningsButLastToConsole ();
}
ReportAllErrorsButLastToConsole ();
consoleMonitor.Dispose ();
- statusMonitor.Dispose ();
+
+ base.Dispose ();
}
void ReportAllWarningsButLastToConsole ()
{
- warnings = warnings.Distinct ().ToList ();
+ var warnings = Warnings.Distinct ().ToList ();
RemoveLastItem (warnings);
warnings.ForEach (warning => consoleMonitor.ReportWarning (warning));
}
void ReportAllErrorsButLastToConsole ()
{
+ var errors = Errors.ToList ();
RemoveLastItem (errors);
- errors.ForEach (error => consoleMonitor.ReportError (error, null));
+ errors.ForEach (error => consoleMonitor.ReportError (error.Message, error.Exception));
}
- static void RemoveLastItem (List<string> items)
+ static void RemoveLastItem<T> (List<T> items)
{
if (items.Count > 0) {
items.RemoveAt (items.Count - 1);
}
}
- public bool IsCancelRequested
- {
- get {
- return consoleMonitor.IsCancelRequested || statusMonitor.IsCancelRequested;
- }
- }
-
public object SyncRoot {
get { return this; }
}
- void OnCancelRequested (IProgressMonitor sender)
- {
- AsyncOperation.Cancel ();
- }
-
- public IAsyncOperation AsyncOperation
- {
- get { return this; }
- }
-
- void IAsyncOperation.Cancel ()
- {
- consoleMonitor.AsyncOperation.Cancel ();
- }
-
- void IAsyncOperation.WaitForCompleted ()
+ void OnCancelRequested ()
{
- consoleMonitor.AsyncOperation.WaitForCompleted ();
- }
-
- public bool IsCompleted {
- get { return consoleMonitor.AsyncOperation.IsCompleted; }
- }
-
- bool IAsyncOperation.Success {
- get { return consoleMonitor.AsyncOperation.Success; }
- }
-
- bool IAsyncOperation.SuccessWithWarnings {
- get { return consoleMonitor.AsyncOperation.SuccessWithWarnings; }
- }
-
- public event MonitorHandler CancelRequested {
- add { consoleMonitor.CancelRequested += value; }
- remove { consoleMonitor.CancelRequested -= value; }
- }
-
- public event OperationHandler Completed {
- add { consoleMonitor.AsyncOperation.Completed += value; }
- remove { consoleMonitor.AsyncOperation.Completed -= value; }
+ CancellationTokenSource.Cancel ();
}
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProgressMonitorFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProgressMonitorFactory.cs
index d15afde849..4289e0278d 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProgressMonitorFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProgressMonitorFactory.cs
@@ -29,18 +29,19 @@ using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide;
using MonoDevelop.Core.ProgressMonitoring;
+using MonoDevelop.Core.Execution;
namespace MonoDevelop.PackageManagement
{
- public class PackageManagementProgressMonitorFactory : IPackageManagementProgressMonitorFactory
+ internal class PackageManagementProgressMonitorFactory : IPackageManagementProgressMonitorFactory
{
- public IProgressMonitor CreateProgressMonitor (string title)
+ public ProgressMonitor CreateProgressMonitor (string title)
{
- IProgressMonitor consoleMonitor = CreatePackageConsoleOutputMonitor ();
+ OutputProgressMonitor consoleMonitor = CreatePackageConsoleOutputMonitor ();
Pad pad = IdeApp.Workbench.ProgressMonitors.GetPadForMonitor (consoleMonitor);
- IProgressMonitor statusMonitor = IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor (
+ ProgressMonitor statusMonitor = IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor (
title,
Stock.StatusSolutionOperation,
false,
@@ -51,7 +52,7 @@ namespace MonoDevelop.PackageManagement
return new PackageManagementProgressMonitor (consoleMonitor, statusMonitor);
}
- IProgressMonitor CreatePackageConsoleOutputMonitor ()
+ OutputProgressMonitor CreatePackageConsoleOutputMonitor ()
{
return IdeApp.Workbench.ProgressMonitors.GetOutputProgressMonitor (
"PackageConsole",
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProgressProvider.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProgressProvider.cs
index 4c2353b194..ce0833db17 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProgressProvider.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProgressProvider.cs
@@ -1,48 +1,49 @@
-//
-// PackageManagementProgressProvider.cs
-//
-// Author:
-// Matt Ward <matt.ward@xamarin.com>
-//
-// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
+//
+// PackageManagementProgressProvider.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using MonoDevelop.Ide;
-
+using MonoDevelop.Core;
+
namespace MonoDevelop.PackageManagement
{
- public class PackageManagementProgressProvider : IProgressProvider
+ internal class PackageManagementProgressProvider : IProgressProvider
{
- Action<MessageHandler> guiDispatcher;
+ Action<Action> guiDispatcher;
public PackageManagementProgressProvider (IPackageRepositoryFactoryEvents repositoryFactoryEvents)
- : this (repositoryFactoryEvents, DispatchService.GuiDispatch)
+ : this (repositoryFactoryEvents, h => Runtime.RunInMainThread (h))
{
}
public PackageManagementProgressProvider (
IPackageRepositoryFactoryEvents repositoryFactoryEvents,
- Action<MessageHandler> guiDispatcher)
+ Action<Action> guiDispatcher)
{
repositoryFactoryEvents.RepositoryCreated += RepositoryCreated;
this.guiDispatcher = guiDispatcher;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProject.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProject.cs
index 2aa0377574..4b5c6c8eeb 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProject.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProject.cs
@@ -35,12 +35,12 @@ using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageManagementProject : IPackageManagementProject
+ internal class PackageManagementProject : IPackageManagementProject
{
- ISharpDevelopPackageManager packageManager;
- ISharpDevelopProjectManager projectManager;
+ IMonoDevelopPackageManager packageManager;
+ IMonoDevelopProjectManager projectManager;
IPackageManagementEvents packageManagementEvents;
IDotNetProject project;
ProjectTargetFramework targetFramework;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectFactory.cs
index 6dfe3931de..94d4efbd09 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectFactory.cs
@@ -30,11 +30,11 @@ using System;
using MonoDevelop.PackageManagement;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageManagementProjectFactory : IPackageManagementProjectFactory
+ internal class PackageManagementProjectFactory : IPackageManagementProjectFactory
{
- SharpDevelopPackageManagerFactory factory = new SharpDevelopPackageManagerFactory();
+ MonoDevelopPackageManagerFactory factory = new MonoDevelopPackageManagerFactory();
IPackageManagementEvents packageManagementEvents;
public PackageManagementProjectFactory(IPackageManagementEvents packageManagementEvents)
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectOperations.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectOperations.cs
index b550cf2910..9f418a756b 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectOperations.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectOperations.cs
@@ -1,45 +1,45 @@
-//
-// PackageManagementProjectOperations.cs
-//
-// Author:
-// Matt Ward <matt.ward@xamarin.com>
-//
-// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
+//
+// PackageManagementProjectOperations.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Ide;
using MonoDevelop.Projects;
using NuGet;
-
+using MonoDevelop.Core;
+
namespace MonoDevelop.PackageManagement
{
- public class PackageManagementProjectOperations : IPackageManagementProjectOperations
+ internal class PackageManagementProjectOperations : IPackageManagementProjectOperations
{
IPackageManagementSolution solution;
IRegisteredPackageRepositories registeredPackageRepositories;
BackgroundPackageActionRunner backgroundActionRunner;
- IPackageManagementEvents packageManagementEvents;
public PackageManagementProjectOperations (
IPackageManagementSolution solution,
@@ -50,7 +50,6 @@ namespace MonoDevelop.PackageManagement
this.solution = solution;
this.registeredPackageRepositories = registeredPackageRepositories;
this.backgroundActionRunner = backgroundActionRunner;
- this.packageManagementEvents = packageManagementEvents;
packageManagementEvents.ParentPackageInstalled += PackageInstalled;
packageManagementEvents.ParentPackageUninstalled += PackageUninstalled;
@@ -66,19 +65,20 @@ namespace MonoDevelop.PackageManagement
{
List<IPackageAction> actions = null;
- DispatchService.GuiSyncDispatch (() => {
+ Runtime.RunInMainThread (() => {
IPackageRepository repository = CreatePackageRepository (packageSourceUrl);
IPackageManagementProject packageManagementProject = solution.GetProject (repository, new DotNetProjectProxy ((DotNetProject)project));
actions = packages.Select (packageReference => {
InstallPackageAction action = packageManagementProject.CreateInstallPackageAction ();
action.PackageId = packageReference.Id;
- action.PackageVersion = new SemanticVersion (packageReference.Version);
+ action.PackageVersion = new SemanticVersion (packageReference.Version);
+ action.LicensesMustBeAccepted = false;
return (IPackageAction)action;
}).ToList ();
- });
+ }).Wait ();
ProgressMonitorStatusMessage progressMessage = GetProgressMonitorStatusMessages (actions);
- backgroundActionRunner.RunAndWait (progressMessage, actions);
+ backgroundActionRunner.Run (progressMessage, actions);
}
IPackageRepository CreatePackageRepository (string packageSourceUrl)
@@ -98,19 +98,35 @@ namespace MonoDevelop.PackageManagement
public IEnumerable<PackageManagementPackageReference> GetInstalledPackages (Project project)
{
- List<PackageManagementPackageReference> packageReferences = null;
-
- DispatchService.GuiSyncDispatch (() => {
+ return Runtime.RunInMainThread (() => {
string url = RegisteredPackageSources.DefaultPackageSourceUrl;
var repository = registeredPackageRepositories.CreateRepository (new PackageSource (url));
IPackageManagementProject packageManagementProject = solution.GetProject (repository, new DotNetProjectProxy ((DotNetProject)project));
- packageReferences = packageManagementProject
+
+ var packages = packageManagementProject
.GetPackageReferences ()
.Select (packageReference => new PackageManagementPackageReference (packageReference.Id, packageReference.Version.ToString ()))
- .ToList ();
- });
-
- return packageReferences;
+ .ToList ();
+
+ packages.AddRange (GetMissingPackagesBeingInstalled (packages, (DotNetProject)project));
+ return packages;
+ }).Result;
+ }
+
+ IEnumerable<PackageManagementPackageReference> GetMissingPackagesBeingInstalled (
+ IEnumerable<PackageManagementPackageReference> existingPackages,
+ DotNetProject project)
+ {
+ return GetPackagesBeingInstalled (project)
+ .Where (package => !existingPackages.Any (existingPackage => existingPackage.Id == package.Id));
+ }
+
+ static IEnumerable<PackageManagementPackageReference> GetPackagesBeingInstalled (DotNetProject project)
+ {
+ return PackageManagementServices.BackgroundPackageActionRunner.PendingInstallActionsForProject (project)
+ .Select (installAction => new PackageManagementPackageReference (
+ installAction.GetPackageId (),
+ installAction.GetPackageVersion ().ToString ()));
}
void PackageUninstalled (object sender, ParentPackageOperationEventArgs e)
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectService.cs
index 00bd3ab908..27b1348402 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectService.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectService.cs
@@ -32,9 +32,9 @@ using MonoDevelop.Ide;
using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageManagementProjectService : IPackageManagementProjectService
+ internal class PackageManagementProjectService : IPackageManagementProjectService
{
public PackageManagementProjectService ()
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementPropertyService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementPropertyService.cs
index ea0936f826..4f29cd7248 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementPropertyService.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementPropertyService.cs
@@ -29,9 +29,9 @@
using System;
using MonoDevelop.Core;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageManagementPropertyService : IPropertyService
+ internal class PackageManagementPropertyService : IPropertyService
{
public string DataDirectory {
get { return UserProfile.Current.ConfigDir; }
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSelectedProject.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSelectedProject.cs
index d4eef0a928..4d0b7656ad 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSelectedProject.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSelectedProject.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageManagementSelectedProject : IPackageManagementSelectedProject
+ internal class PackageManagementSelectedProject : IPackageManagementSelectedProject
{
public PackageManagementSelectedProject(IPackageManagementProject project)
: this(project, selected: false)
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSelectedProjects.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSelectedProjects.cs
index d2d5b69700..a99fcd5fd5 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSelectedProjects.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSelectedProjects.cs
@@ -36,9 +36,9 @@ using MonoDevelop.Projects;
using NuGet;
using MonoDevelop.PackageManagement;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageManagementSelectedProjects
+ internal class PackageManagementSelectedProjects
{
bool? singleProjectSelected;
IDotNetProject singleDotNetProjectSelected;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementServices.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementServices.cs
index f07f6e48b2..80f1349706 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementServices.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementServices.cs
@@ -28,10 +28,9 @@
using System;
using NuGet;
-using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
public static class PackageManagementServices
{
@@ -81,9 +80,10 @@ namespace ICSharpCode.PackageManagement
projectOperations = new PackageManagementProjectOperations (solution, registeredPackageRepositories, backgroundPackageActionRunner, packageManagementEvents);
InitializeCredentialProvider();
+ PackageManagementBackgroundDispatcher.Initialize ();
}
- public static void InitializeCredentialProvider()
+ internal static void InitializeCredentialProvider()
{
HttpClient.DefaultCredentialProvider = CreateSettingsCredentialProvider (new MonoDevelopCredentialProvider ());
}
@@ -105,63 +105,63 @@ namespace ICSharpCode.PackageManagement
return NullSettings.Instance;
}
- public static PackageManagementOptions Options {
+ internal static PackageManagementOptions Options {
get { return options; }
}
- public static IPackageManagementSolution Solution {
+ internal static IPackageManagementSolution Solution {
get { return solution; }
}
- public static IRegisteredPackageRepositories RegisteredPackageRepositories {
+ internal static IRegisteredPackageRepositories RegisteredPackageRepositories {
get { return registeredPackageRepositories; }
}
- public static IPackageRepositoryCache PackageRepositoryCache {
+ internal static IPackageRepositoryCache PackageRepositoryCache {
get { return packageRepositoryCache; }
}
- public static IPackageManagementEvents PackageManagementEvents {
+ internal static IPackageManagementEvents PackageManagementEvents {
get { return packageManagementEvents; }
}
- public static IPackageManagementOutputMessagesView OutputMessagesView {
+ internal static IPackageManagementOutputMessagesView OutputMessagesView {
get { return outputMessagesView; }
}
- public static IPackageManagementProjectService ProjectService {
+ internal static IPackageManagementProjectService ProjectService {
get { return projectService; }
}
- public static IPackageActionRunner PackageActionRunner {
+ internal static IPackageActionRunner PackageActionRunner {
get { return packageActionRunner; }
}
- public static IPackageRepositoryCache ProjectTemplatePackageRepositoryCache {
+ internal static IPackageRepositoryCache ProjectTemplatePackageRepositoryCache {
get { return projectTemplatePackageRepositoryCache; }
}
- public static RegisteredPackageSources ProjectTemplatePackageSources {
+ internal static RegisteredPackageSources ProjectTemplatePackageSources {
get { return projectTemplatePackageSources.PackageSources; }
}
- public static IBackgroundPackageActionRunner BackgroundPackageActionRunner {
+ internal static IBackgroundPackageActionRunner BackgroundPackageActionRunner {
get { return backgroundPackageActionRunner; }
}
- public static IPackageManagementProgressMonitorFactory ProgressMonitorFactory {
+ internal static IPackageManagementProgressMonitorFactory ProgressMonitorFactory {
get { return progressMonitorFactory; }
}
- public static IRecentPackageRepository RecentPackageRepository {
+ internal static IRecentPackageRepository RecentPackageRepository {
get { return packageRepositoryCache.RecentPackageRepository; }
}
- public static IProgressProvider ProgressProvider {
+ internal static IProgressProvider ProgressProvider {
get { return progressProvider; }
}
- public static IUpdatedPackagesInSolution UpdatedPackagesInSolution {
+ internal static IUpdatedPackagesInSolution UpdatedPackagesInSolution {
get { return updatedPackagesInSolution; }
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolution.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolution.cs
index f732ecd211..b5c5418f23 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolution.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolution.cs
@@ -26,21 +26,28 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using System.Collections.Generic;
using System.Linq;
-using MonoDevelop.PackageManagement;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageManagementSolution : IPackageManagementSolution
+ internal class PackageManagementSolution : IPackageManagementSolution
{
IRegisteredPackageRepositories registeredPackageRepositories;
IPackageManagementProjectService projectService;
IPackageManagementProjectFactory projectFactory;
ISolutionPackageRepositoryFactory solutionPackageRepositoryFactory;
-
+
+ internal PackageManagementSolution (
+ IPackageManagementProjectService projectService)
+ : this (
+ PackageManagementServices.RegisteredPackageRepositories,
+ projectService,
+ PackageManagementServices.PackageManagementEvents)
+ {
+ }
+
public PackageManagementSolution(
IRegisteredPackageRepositories registeredPackageRepositories,
IPackageManagementProjectService projectService,
@@ -153,6 +160,11 @@ namespace ICSharpCode.PackageManagement
{
return CreateProject (sourceRepository, project);
}
+
+ public IPackageManagementProject GetProject (IDotNetProject project)
+ {
+ return CreateProject (registeredPackageRepositories.CreateAggregateRepository(), project);
+ }
public IEnumerable<IDotNetProject> GetDotNetProjects ()
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolutionExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolutionExtensions.cs
index 4f9ef87876..128412cff8 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolutionExtensions.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolutionExtensions.cs
@@ -24,19 +24,16 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using System;
-using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public static class PackageManagementSolutionExtensions
+ internal static class PackageManagementSolutionExtensions
{
public static IPackageManagementProject GetProject (this IPackageManagementSolution solution, DotNetProject project)
{
var projectProxy = new DotNetProjectProxy (project);
- var repository = PackageManagementServices.PackageRepositoryCache.CreateAggregateWithPriorityMachineCacheRepository ();
- return solution.GetProject (repository, projectProxy);
+ return solution.GetProject (projectProxy);
}
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolutionProjectService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolutionProjectService.cs
new file mode 100644
index 0000000000..b0054728d5
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolutionProjectService.cs
@@ -0,0 +1,72 @@
+//
+// PackageManagementSolutionProjectService.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using MonoDevelop.Projects;
+
+namespace MonoDevelop.PackageManagement
+{
+ class PackageManagementSolutionProjectService : IPackageManagementProjectService
+ {
+ SolutionProxy solution;
+
+ public PackageManagementSolutionProjectService (Solution solution)
+ {
+ this.solution = new SolutionProxy (solution);
+ }
+
+ public IProject CurrentProject {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ISolution OpenSolution {
+ get { return solution; }
+ }
+
+ public IEnumerable<IDotNetProject> GetOpenProjects ()
+ {
+ return solution.GetAllProjects ();
+ }
+
+ public event EventHandler<ProjectReloadedEventArgs> ProjectReloaded;
+ public event EventHandler SolutionLoaded;
+ public event EventHandler SolutionUnloaded;
+
+ public IProjectBrowserUpdater CreateProjectBrowserUpdater ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public string GetDefaultCustomToolForFileName (ProjectFile projectItem)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementTask.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementTask.cs
index 97753656b7..9c890d49e7 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementTask.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementTask.cs
@@ -30,9 +30,9 @@ using System;
using System.Threading;
using System.Threading.Tasks;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageManagementTask<TResult> : ITask<TResult>
+ internal class PackageManagementTask<TResult> : ITask<TResult>
{
Task<TResult> task;
Action<ITask<TResult>> continueWith;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementTaskFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementTaskFactory.cs
index 6189173548..c57ca72e60 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementTaskFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementTaskFactory.cs
@@ -32,9 +32,9 @@ using System.Threading.Tasks;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageManagementTaskFactory : ITaskFactory
+ internal class PackageManagementTaskFactory : ITaskFactory
{
public ITask<TResult> CreateTask<TResult>(
Func<TResult> function,
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementViewModels.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementViewModels.cs
index 8132c0eea9..600165760b 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementViewModels.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementViewModels.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageManagementViewModels
+ internal class PackageManagementViewModels
{
ManagePackagesViewModel managePackagesViewModel;
RegisteredPackageSourcesViewModel registeredPackageSourcesViewModel;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationExceptionEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationExceptionEventArgs.cs
index 74442bc0ed..1e51a75eda 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationExceptionEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationExceptionEventArgs.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageOperationExceptionEventArgs : EventArgs
+ internal class PackageOperationExceptionEventArgs : EventArgs
{
public PackageOperationExceptionEventArgs(Exception ex)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationMessage.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationMessage.cs
index 73f0ffafa3..5bf7a7d2d5 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationMessage.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationMessage.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageOperationMessage
+ internal class PackageOperationMessage
{
string message;
object[] args;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationMessageLoggedEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationMessageLoggedEventArgs.cs
index 0b8c984458..cb06eeb2b1 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationMessageLoggedEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationMessageLoggedEventArgs.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageOperationMessageLoggedEventArgs : EventArgs
+ internal class PackageOperationMessageLoggedEventArgs : EventArgs
{
public PackageOperationMessageLoggedEventArgs(
MessageLevel level,
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationsResolverFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationsResolverFactory.cs
index 323b4e3b54..7615494c4b 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationsResolverFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationsResolverFactory.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageOperationsResolverFactory : IPackageOperationResolverFactory
+ internal class PackageOperationsResolverFactory : IPackageOperationResolverFactory
{
public IPackageOperationResolver CreateInstallPackageOperationResolver(
IPackageRepository localRepository,
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageReferenceExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageReferenceExtensions.cs
index 14ae2402b7..c2fc1b11d8 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageReferenceExtensions.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageReferenceExtensions.cs
@@ -26,13 +26,13 @@
using System;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
using NuGet;
namespace MonoDevelop.PackageManagement
{
- public static class PackageReferenceExtensions
+ internal static class PackageReferenceExtensions
{
public static bool IsPackageInstalled (this PackageReference packageReference, DotNetProject project)
{
@@ -52,6 +52,15 @@ namespace MonoDevelop.PackageManagement
.GetPackageLookupPaths (packageReference.Id, packageReference.Version)
.Any ();
}
+
+ public static bool IsReleaseVersion (this PackageReference packageReference)
+ {
+ if (packageReference.Version == null) {
+ return true;
+ }
+
+ return String.IsNullOrEmpty (packageReference.Version.SpecialVersion);
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageReferenceMonitor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageReferenceMonitor.cs
new file mode 100644
index 0000000000..732940d0df
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageReferenceMonitor.cs
@@ -0,0 +1,71 @@
+//
+// PackageReferenceMonitor.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace MonoDevelop.PackageManagement
+{
+ internal class PackageReferenceMonitor : IDisposable
+ {
+ IMonoDevelopProjectManager projectManager;
+ IMonoDevelopPackageManager packageManager;
+ List<IPackage> packagesRemoved = new List<IPackage>();
+
+ public PackageReferenceMonitor (
+ IMonoDevelopProjectManager projectManager,
+ IMonoDevelopPackageManager packageManager)
+ {
+ this.projectManager = projectManager;
+ this.packageManager = packageManager;
+ projectManager.PackageReferenceRemoved += PackageReferenceRemoved;
+ projectManager.PackageReferenceAdded += PackageReferenceAdded;
+ }
+
+ void PackageReferenceRemoved(object sender, PackageOperationEventArgs e)
+ {
+ packagesRemoved.Add(e.Package);
+ }
+
+ void PackageReferenceAdded (object sender, PackageOperationEventArgs e)
+ {
+ packageManager.InstallPackageIntoSolutionRepository (e.Package);
+ }
+
+ public void Dispose()
+ {
+ projectManager.PackageReferenceRemoved -= PackageReferenceRemoved;
+ projectManager.PackageReferenceAdded -= PackageReferenceAdded;
+ }
+
+ public List<IPackage> PackagesRemoved {
+ get { return packagesRemoved; }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageReinstaller.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageReinstaller.cs
index 7efd25eb1a..bff3dcbf99 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageReinstaller.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageReinstaller.cs
@@ -25,12 +25,11 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
using MonoDevelop.PackageManagement.NodeBuilders;
namespace MonoDevelop.PackageManagement
{
- public class PackageReinstaller
+ internal class PackageReinstaller
{
IPackageManagementSolution solution;
IBackgroundPackageActionRunner runner;
@@ -59,7 +58,7 @@ namespace MonoDevelop.PackageManagement
public void Run (PackageReferenceNode packageReferenceNode, ProgressMonitorStatusMessage progressMessage)
{
try {
- IPackageManagementProject project = solution.GetActiveProject ();
+ IPackageManagementProject project = solution.GetProject (packageReferenceNode.Project);
ReinstallPackageAction action = project.CreateReinstallPackageAction ();
action.PackageId = packageReferenceNode.Id;
action.PackageVersion = packageReferenceNode.Version;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRepositoryCache.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRepositoryCache.cs
index ca1ae8b41d..38c63a275a 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRepositoryCache.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRepositoryCache.cs
@@ -32,11 +32,11 @@ using System.Collections.Generic;
using MonoDevelop.PackageManagement;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageRepositoryCache : IPackageRepositoryCache, IPackageRepositoryFactoryEvents
+ internal class PackageRepositoryCache : IPackageRepositoryCache, IPackageRepositoryFactoryEvents
{
- ISharpDevelopPackageRepositoryFactory factory;
+ IMonoDevelopPackageRepositoryFactory factory;
RegisteredPackageSources packageSources;
PackageManagementOptions options;
IList<RecentPackageInfo> recentPackages;
@@ -48,7 +48,7 @@ namespace ICSharpCode.PackageManagement
public PackageRepositoryCache (
PackageManagementOptions options,
IPackageRepository machineCache,
- ISharpDevelopPackageRepositoryFactory factory)
+ IMonoDevelopPackageRepositoryFactory factory)
{
this.options = options;
this.machineCache = machineCache;
@@ -58,7 +58,7 @@ namespace ICSharpCode.PackageManagement
public PackageRepositoryCache (
PackageManagementOptions options,
- ISharpDevelopPackageRepositoryFactory factory)
+ IMonoDevelopPackageRepositoryFactory factory)
: this (
options,
MachineCache.Default,
@@ -69,7 +69,7 @@ namespace ICSharpCode.PackageManagement
public PackageRepositoryCache (PackageManagementOptions options)
: this(
options,
- new SharpDevelopPackageRepositoryFactory ())
+ new MonoDevelopPackageRepositoryFactory ())
{
}
@@ -77,7 +77,7 @@ namespace ICSharpCode.PackageManagement
RegisteredPackageSources packageSources,
IList<RecentPackageInfo> recentPackages)
{
- this.factory = new SharpDevelopPackageRepositoryFactory ();
+ this.factory = new MonoDevelopPackageRepositoryFactory ();
this.recentPackages = recentPackages;
this.packageSources = packageSources;
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRepositoryFactoryEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRepositoryFactoryEventArgs.cs
index 0415c048e0..995209b05f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRepositoryFactoryEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRepositoryFactoryEventArgs.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageRepositoryFactoryEventArgs : EventArgs
+ internal class PackageRepositoryFactoryEventArgs : EventArgs
{
public PackageRepositoryFactoryEventArgs(IPackageRepository repository)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestoreRunner.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestoreRunner.cs
index 0b905a25cb..3f090d518f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestoreRunner.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestoreRunner.cs
@@ -1,4 +1,4 @@
-//
+//
// PackageRestoreRunner.cs
//
// Author:
@@ -26,7 +26,7 @@
using System;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.Ide;
using MonoDevelop.Ide.TypeSystem;
@@ -35,7 +35,7 @@ using NuGet;
namespace MonoDevelop.PackageManagement
{
- public class PackageRestoreRunner
+ internal class PackageRestoreRunner
{
IPackageManagementSolution solution;
IPackageManagementProgressMonitorFactory progressMonitorFactory;
@@ -52,6 +52,15 @@ namespace MonoDevelop.PackageManagement
{
}
+ internal PackageRestoreRunner (IPackageManagementSolution solution)
+ : this (
+ solution,
+ PackageManagementServices.ProgressMonitorFactory,
+ PackageManagementServices.PackageManagementEvents,
+ PackageManagementServices.ProgressProvider)
+ {
+ }
+
public PackageRestoreRunner(
IPackageManagementSolution solution,
IPackageManagementProgressMonitorFactory progressMonitorFactory,
@@ -77,7 +86,7 @@ namespace MonoDevelop.PackageManagement
public void Run (ProgressMonitorStatusMessage progressMessage)
{
- using (IProgressMonitor progressMonitor = CreateProgressMonitor (progressMessage)) {
+ using (ProgressMonitor progressMonitor = CreateProgressMonitor (progressMessage)) {
using (PackageManagementEventsMonitor eventMonitor = CreateEventMonitor (progressMonitor)) {
try {
RestorePackages (progressMonitor, progressMessage);
@@ -95,17 +104,17 @@ namespace MonoDevelop.PackageManagement
public bool RestoreFailed { get; private set; }
- IProgressMonitor CreateProgressMonitor (ProgressMonitorStatusMessage progressMessage)
+ ProgressMonitor CreateProgressMonitor (ProgressMonitorStatusMessage progressMessage)
{
return progressMonitorFactory.CreateProgressMonitor (progressMessage.Status);
}
- PackageManagementEventsMonitor CreateEventMonitor (IProgressMonitor monitor)
+ PackageManagementEventsMonitor CreateEventMonitor (ProgressMonitor monitor)
{
return new PackageManagementEventsMonitor (monitor, packageManagementEvents, progressProvider);
}
- void RestorePackages (IProgressMonitor progressMonitor, ProgressMonitorStatusMessage progressMessage)
+ void RestorePackages (ProgressMonitor progressMonitor, ProgressMonitorStatusMessage progressMessage)
{
var msbuildTargetsMonitor = new MSBuildTargetsRestoredMonitor (packageManagementEvents);
using (msbuildTargetsMonitor) {
@@ -139,7 +148,7 @@ namespace MonoDevelop.PackageManagement
/// </summary>
void RefreshProjectReferences (bool refreshMSBuildTargets)
{
- DispatchService.GuiDispatch (() => {
+ Runtime.RunInMainThread (() => {
foreach (IDotNetProject projectInSolution in solution.GetDotNetProjects ()) {
if (refreshMSBuildTargets) {
projectInSolution.RefreshProjectBuilder ();
@@ -156,10 +165,11 @@ namespace MonoDevelop.PackageManagement
void ReconnectAssemblyReferences (DotNetProject dotNetProject)
{
- var projectWrapper = TypeSystemService.GetProjectContentWrapper (dotNetProject);
- if (projectWrapper != null) {
- projectWrapper.ReconnectAssemblyReferences ();
- }
+ // TODO: Roslyn port ?
+// var projectWrapper = TypeSystemService.GetProjectContentWrapper (dotNetProject);
+// if (projectWrapper != null) {
+// projectWrapper.ReconnectAssemblyReferences ();
+// }
}
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestoredEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestoredEventArgs.cs
index cf9b9dc141..7858fd88b1 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestoredEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestoredEventArgs.cs
@@ -29,7 +29,7 @@ using NuGet;
namespace MonoDevelop.PackageManagement
{
- public class PackageRestoredEventArgs : EventArgs
+ internal class PackageRestoredEventArgs : EventArgs
{
public PackageRestoredEventArgs (IPackage package)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestorer.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestorer.cs
index f13c9f3fb3..1ea060c154 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestorer.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestorer.cs
@@ -26,33 +26,32 @@
using System;
using System.Linq;
-using ICSharpCode.PackageManagement;
using MonoDevelop.Projects;
using System.Collections.Generic;
using MonoDevelop.Core;
-using NuGet;
-using MonoDevelop.PackageManagement.Commands;
namespace MonoDevelop.PackageManagement
{
- public class PackageRestorer
+ internal class PackageRestorer
{
List<ProjectPackageReferenceFile> packageReferenceFiles;
IDotNetProject singleProject;
+ IPackageManagementSolution solution;
- public PackageRestorer (Solution solution)
- : this (solution.GetAllDotNetProjects ())
+ public PackageRestorer (IPackageManagementSolution solution)
+ : this (solution, solution.GetDotNetProjects ().Select (p => p.DotNetProject))
{
}
- public PackageRestorer (DotNetProject project)
- : this (new [] { project })
+ public PackageRestorer (IPackageManagementSolution solution, DotNetProject project)
+ : this (solution, new [] { project })
{
singleProject = new DotNetProjectProxy (project);
}
- public PackageRestorer (IEnumerable<DotNetProject> projects)
+ public PackageRestorer (IPackageManagementSolution solution, IEnumerable<DotNetProject> projects)
{
+ this.solution = solution;
packageReferenceFiles = FindAllPackageReferenceFiles (projects).ToList ();
}
@@ -89,7 +88,7 @@ namespace MonoDevelop.PackageManagement
void RestoreWithProgressMonitor (ProgressMonitorStatusMessage progressMessage)
{
- var runner = new PackageRestoreRunner ();
+ var runner = new PackageRestoreRunner (solution);
if (singleProject != null) {
runner.Run (singleProject, progressMessage);
} else {
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSearchCriteria.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSearchCriteria.cs
index 476d72222f..cb1cb1afd3 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSearchCriteria.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSearchCriteria.cs
@@ -29,7 +29,7 @@ using NuGet;
namespace MonoDevelop.PackageManagement
{
- public class PackageSearchCriteria
+ internal class PackageSearchCriteria
{
WildcardVersionSpec wildcardVersionSpec;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceConverter.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceConverter.cs
index 26cd738f41..61bf2f4a60 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceConverter.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceConverter.cs
@@ -31,9 +31,9 @@ using System.Collections.Generic;
using System.Linq;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public static class PackageSourceConverter
+ internal static class PackageSourceConverter
{
public static IEnumerable<PackageSource> ConvertFromSettings(IEnumerable<SettingValue> packageSources)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceExtensions.cs
index 565f2fac46..dd169caa3f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceExtensions.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceExtensions.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public static class PackageSourceExtensions
+ internal static class PackageSourceExtensions
{
public static bool IsAggregate(this PackageSource packageSource)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModel.cs
index dab268d647..815b0e7220 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModel.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageSourceViewModel : ViewModelBase<PackageSourceViewModel>
+ internal class PackageSourceViewModel : ViewModelBase<PackageSourceViewModel>
{
RegisteredPackageSource packageSource;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModelChangedEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModelChangedEventArgs.cs
index 1d4e44d3ba..6574148487 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModelChangedEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModelChangedEventArgs.cs
@@ -25,11 +25,11 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement
{
- public class PackageSourceViewModelChangedEventArgs : EventArgs
+ internal class PackageSourceViewModelChangedEventArgs : EventArgs
{
public PackageSourceViewModelChangedEventArgs (PackageSourceViewModel packageSource)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModelCheckedEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModelCheckedEventArgs.cs
index b40ddbafea..2cee563ded 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModelCheckedEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModelCheckedEventArgs.cs
@@ -25,11 +25,11 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement
{
- public class PackageSourceViewModelCheckedEventArgs : EventArgs
+ internal class PackageSourceViewModelCheckedEventArgs : EventArgs
{
public PackageSourceViewModelCheckedEventArgs (PackageSourceViewModel packageSource)
: this (packageSource, "")
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModelChecker.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModelChecker.cs
index dd60e30ca6..90587defb4 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModelChecker.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModelChecker.cs
@@ -29,13 +29,13 @@ using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Threading.Tasks;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using NuGet;
namespace MonoDevelop.PackageManagement
{
- public class PackageSourceViewModelChecker : IDisposable
+ internal class PackageSourceViewModelChecker : IDisposable
{
PackageManagementTaskFactory taskFactory = new PackageManagementTaskFactory ();
List<ITask<PackageSourceViewModelCheckedEventArgs>> tasks = new List<ITask<PackageSourceViewModelCheckedEventArgs>>();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageUpdateChecker.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageUpdateChecker.cs
new file mode 100644
index 0000000000..8850375e3e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageUpdateChecker.cs
@@ -0,0 +1,100 @@
+//
+// PackageUpdateChecker.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using ICSharpCode.PackageManagement;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.PackageManagement
+{
+ public class PackageUpdateChecker
+ {
+ IUpdatedPackagesInSolution updatedPackagesInSolution;
+ IPackageManagementProgressMonitorFactory progressMonitorFactory;
+
+ public PackageUpdateChecker ()
+ : this (
+ PackageManagementServices.UpdatedPackagesInSolution,
+ PackageManagementServices.ProgressMonitorFactory)
+ {
+ }
+
+ public PackageUpdateChecker (
+ IUpdatedPackagesInSolution updatedPackagesInSolution,
+ IPackageManagementProgressMonitorFactory progressMonitorFactory)
+ {
+ this.updatedPackagesInSolution = updatedPackagesInSolution;
+ this.progressMonitorFactory = progressMonitorFactory;
+ }
+
+ public void Run ()
+ {
+ try {
+ CheckForPackageUpdatesWithProgressMonitor ();
+ } catch (Exception ex) {
+ LoggingService.LogInternalError ("PackageUpdateChecker error.", ex);
+ }
+ }
+
+ void CheckForPackageUpdatesWithProgressMonitor ()
+ {
+ ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateCheckingForPackageUpdatesMessage ();
+ using (ProgressMonitor progressMonitor = CreateProgressMonitor (progressMessage)) {
+ try {
+ using (var eventMonitor = new PackageUpdatesEventMonitor (progressMonitor)) {
+ CheckForPackageUpdates (progressMonitor, progressMessage, eventMonitor);
+ }
+ } catch (Exception ex) {
+ LoggingService.LogInternalError (ex);
+ progressMonitor.Log.WriteLine (ex.Message);
+ progressMonitor.ReportError (progressMessage.Error, null);
+ progressMonitor.ShowPackageConsole ();
+ }
+ }
+ }
+
+ ProgressMonitor CreateProgressMonitor (ProgressMonitorStatusMessage progressMessage)
+ {
+ return progressMonitorFactory.CreateProgressMonitor (progressMessage.Status);
+ }
+
+ void CheckForPackageUpdates (
+ ProgressMonitor progressMonitor,
+ ProgressMonitorStatusMessage progressMessage,
+ PackageUpdatesEventMonitor eventMonitor)
+ {
+ updatedPackagesInSolution.CheckForUpdates ();
+ if (updatedPackagesInSolution.AnyUpdates ()) {
+ progressMonitor.ReportSuccess (GettextCatalog.GetString ("Package updates are available."));
+ } else if (eventMonitor.WarningReported) {
+ progressMonitor.ReportWarning (progressMessage.Warning);
+ } else {
+ progressMonitor.ReportSuccess (progressMessage.Success);
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModel.cs
index afd50ed9c8..f99b967fa7 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModel.cs
@@ -34,9 +34,9 @@ using System.Runtime.Versioning;
using MonoDevelop.PackageManagement;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageViewModel : ViewModelBase<PackageViewModel>
+ internal class PackageViewModel : ViewModelBase<PackageViewModel>
{
DelegateCommand addPackageCommand;
DelegateCommand removePackageCommand;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelFactory.cs
index 89c42b6557..cc88824b81 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelFactory.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageViewModelFactory : IPackageViewModelFactory
+ internal class PackageViewModelFactory : IPackageViewModelFactory
{
public PackageViewModelFactory(IPackageViewModelFactory packageViewModelFactory)
: this(
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelOperationLogger.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelOperationLogger.cs
index 40cadd6c90..ff8743c0a1 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelOperationLogger.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelOperationLogger.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackageViewModelOperationLogger : ILogger
+ internal class PackageViewModelOperationLogger : ILogger
{
ILogger logger;
IPackage package;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesForSelectedPageQuery.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesForSelectedPageQuery.cs
index d6177fa592..f3aa8d2b1c 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesForSelectedPageQuery.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesForSelectedPageQuery.cs
@@ -30,9 +30,9 @@ using System.Collections.Generic;
using MonoDevelop.PackageManagement;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackagesForSelectedPageQuery
+ internal class PackagesForSelectedPageQuery
{
public PackagesForSelectedPageQuery (
PackagesViewModel viewModel,
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesForSelectedPageResult.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesForSelectedPageResult.cs
index 90ac1f0a63..56d728a7d3 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesForSelectedPageResult.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesForSelectedPageResult.cs
@@ -32,9 +32,9 @@ using System.Linq;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackagesForSelectedPageResult
+ internal class PackagesForSelectedPageResult
{
public PackagesForSelectedPageResult(IEnumerable<IPackage> packages, PackagesForSelectedPageQuery query)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesRequiringLicenseAcceptance.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesRequiringLicenseAcceptance.cs
index d0c0ea3318..342f05ef09 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesRequiringLicenseAcceptance.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesRequiringLicenseAcceptance.cs
@@ -27,12 +27,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement
{
- public class PackagesRequiringLicenseAcceptance
+ internal class PackagesRequiringLicenseAcceptance
{
IPackageManagementProject project;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesViewModel.cs
index 86b2ed48c8..87115a0be2 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesViewModel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesViewModel.cs
@@ -37,9 +37,9 @@ using MonoDevelop.Core;
using MonoDevelop.PackageManagement;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public abstract class PackagesViewModel : ViewModelBase<PackagesViewModel>, IDisposable, IPackageViewModelParent
+ internal abstract class PackagesViewModel : ViewModelBase<PackagesViewModel>, IDisposable, IPackageViewModelParent
{
Pages pages = new Pages();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesViewModels.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesViewModels.cs
index f93581a5ab..78137341f1 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesViewModels.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesViewModels.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class PackagesViewModels : IDisposable
+ internal class PackagesViewModels : IDisposable
{
public PackagesViewModels(
IPackageManagementSolution solution,
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Page.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Page.cs
index 911f23f6c7..1ac0dad324 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Page.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Page.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class Page
+ internal class Page
{
public int Number { get; set; }
public bool IsSelected { get; set; }
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Pages.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Pages.cs
index 762d8440d0..aa531638e1 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Pages.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Pages.cs
@@ -29,9 +29,9 @@
using System;
using System.Collections.ObjectModel;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class Pages : ObservableCollection<Page>
+ internal class Pages : ObservableCollection<Page>
{
public const int DefaultPageSize = 29;
public const int DefaultMaximumSelectablePages = 5;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ParentPackageOperationEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ParentPackageOperationEventArgs.cs
index 2fdc32c4fc..f48019dfd5 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ParentPackageOperationEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ParentPackageOperationEventArgs.cs
@@ -30,9 +30,9 @@ using System;
using System.Collections.Generic;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class ParentPackageOperationEventArgs : EventArgs
+ internal class ParentPackageOperationEventArgs : EventArgs
{
public ParentPackageOperationEventArgs(IPackage package, IPackageManagementProject project)
: this (package, project, new PackageOperation [0])
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ParentPackagesOperationEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ParentPackagesOperationEventArgs.cs
index 29bb19c506..2fc09a470e 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ParentPackagesOperationEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ParentPackagesOperationEventArgs.cs
@@ -30,9 +30,9 @@ using System;
using System.Collections.Generic;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class ParentPackagesOperationEventArgs : EventArgs
+ internal class ParentPackagesOperationEventArgs : EventArgs
{
public ParentPackagesOperationEventArgs(IEnumerable<IPackage> packages)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PreventPackagesConfigFileBeingRemovedOnUpdateMonitor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PreventPackagesConfigFileBeingRemovedOnUpdateMonitor.cs
index 07345ba0a2..a579030c45 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PreventPackagesConfigFileBeingRemovedOnUpdateMonitor.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PreventPackagesConfigFileBeingRemovedOnUpdateMonitor.cs
@@ -25,7 +25,7 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using System.IO;
using MonoDevelop.Core;
@@ -39,7 +39,7 @@ namespace MonoDevelop.PackageManagement
/// being removed, cancels the standard file deletion call to FileService.RemoveFile, and
/// removes the file itself.
/// </summary>
- public class PreventPackagesConfigFileBeingRemovedOnUpdateMonitor : IDisposable
+ internal class PreventPackagesConfigFileBeingRemovedOnUpdateMonitor : IDisposable
{
IPackageManagementEvents packageManagementEvents;
IFileRemover fileRemover;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Process.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Process.cs
index 1185189f5f..767986eb36 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Process.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Process.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class Process : IProcess
+ internal class Process : IProcess
{
public void Start(string fileName)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageAction.cs
index e7ed10250a..dac4daf34a 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageAction.cs
@@ -34,9 +34,9 @@ using MonoDevelop.Core;
using MonoDevelop.PackageManagement;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public abstract class ProcessPackageAction : IPackageAction
+ internal abstract class ProcessPackageAction : IPackageAction
{
IPackageManagementEvents packageManagementEvents;
bool hasBeforeExecuteBeenRun;
@@ -144,7 +144,7 @@ namespace ICSharpCode.PackageManagement
packageManagementEvents.OnPackageOperationMessageLogged (MessageLevel.Info, message);
}
- void CheckLicenses ()
+ protected virtual void CheckLicenses ()
{
if (!AcceptLicenses ()) {
string message = GettextCatalog.GetString ("Licenses not accepted.");
@@ -158,12 +158,12 @@ namespace ICSharpCode.PackageManagement
var actions = new IPackageAction [] { this };
List<IPackage> packages = packagesWithLicenses.GetPackagesRequiringLicenseAcceptance (actions).ToList ();
if (packages.Any ()) {
- return packageManagementEvents.OnAcceptLicenses (packages);
+ return OnAcceptLicenses (packages);
}
return true;
- }
-
+ }
+
void ExecuteWithScriptRunner()
{
// using (RunPackageScriptsAction runScriptsAction = CreateRunPackageScriptsAction()) {
@@ -265,5 +265,10 @@ namespace ICSharpCode.PackageManagement
{
return new LocalCopyReferenceMaintainer (packageManagementEvents);
}
+
+ protected virtual bool OnAcceptLicenses (IEnumerable<IPackage> packages)
+ {
+ return packageManagementEvents.OnAcceptLicenses (packages);
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageOperationsAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageOperationsAction.cs
index 6cb5f30fb4..8c28780674 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageOperationsAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageOperationsAction.cs
@@ -30,22 +30,34 @@ using System.Collections.Generic;
using System.Linq;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public abstract class ProcessPackageOperationsAction : ProcessPackageAction
+ internal abstract class ProcessPackageOperationsAction : ProcessPackageAction
{
IPackageManagementEvents packageManagementEvents;
+ ILicenseAcceptanceService licenseAcceptanceService;
+
+ protected ProcessPackageOperationsAction (
+ IPackageManagementProject project,
+ IPackageManagementEvents packageManagementEvents,
+ ILicenseAcceptanceService licenseAcceptanceService)
+ : base (project, packageManagementEvents)
+ {
+ this.packageManagementEvents = packageManagementEvents;
+ this.licenseAcceptanceService = licenseAcceptanceService;
+ }
public ProcessPackageOperationsAction(
IPackageManagementProject project,
IPackageManagementEvents packageManagementEvents)
- : base(project, packageManagementEvents)
+ : this (project, packageManagementEvents, new LicenseAcceptanceService ())
{
- this.packageManagementEvents = packageManagementEvents;
}
public IEnumerable<PackageOperation> Operations { get; set; }
+ public bool LicensesMustBeAccepted { get; set; }
+
public override bool HasPackageScriptsToRun()
{
BeforeExecute();
@@ -81,5 +93,14 @@ namespace ICSharpCode.PackageManagement
{
packageManagementEvents.OnParentPackageInstalled (Package, Project, Operations);
}
+
+ protected override bool OnAcceptLicenses (IEnumerable<IPackage> packages)
+ {
+ if (LicensesMustBeAccepted) {
+ return licenseAcceptanceService.AcceptLicenses (packages);
+ } else {
+ return base.OnAcceptLicenses (packages);
+ }
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorExtensions.cs
index 6054ce7cf4..734c915364 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorExtensions.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorExtensions.cs
@@ -32,11 +32,11 @@ using MonoDevelop.Ide.Gui;
namespace MonoDevelop.PackageManagement
{
- public static class ProgressMonitorExtensions
+ internal static class ProgressMonitorExtensions
{
- public static void ShowPackageConsole (this IProgressMonitor monitor)
+ public static void ShowPackageConsole (this ProgressMonitor monitor)
{
- DispatchService.GuiDispatch (() => {
+ Runtime.RunInMainThread (() => {
var aggregatedMonitor = (PackageManagementProgressMonitor)monitor;
Pad pad = IdeApp.Workbench.ProgressMonitors.GetPadForMonitor (aggregatedMonitor.ConsoleMonitor);
if (pad != null) {
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorStatusMessage.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorStatusMessage.cs
index 3a434bf430..e2ceafb7cf 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorStatusMessage.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorStatusMessage.cs
@@ -28,7 +28,7 @@ using System;
namespace MonoDevelop.PackageManagement
{
- public class ProgressMonitorStatusMessage
+ internal class ProgressMonitorStatusMessage
{
string success;
string error;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorStatusMessageFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorStatusMessageFactory.cs
index 6c42dbef5f..045561ac7f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorStatusMessageFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorStatusMessageFactory.cs
@@ -26,12 +26,12 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
namespace MonoDevelop.PackageManagement
{
- public static class ProgressMonitorStatusMessageFactory
+ internal static class ProgressMonitorStatusMessageFactory
{
public static ProgressMonitorStatusMessage CreateInstallingSinglePackageMessage (string packageId)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectBrowserUpdater.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectBrowserUpdater.cs
index 05286f4e49..f68491881d 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectBrowserUpdater.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectBrowserUpdater.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class ProjectBrowserUpdater : IProjectBrowserUpdater
+ internal class ProjectBrowserUpdater : IProjectBrowserUpdater
{
// ProjectBrowserControl projectBrowser;
//
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectExtensions.cs
deleted file mode 100644
index d04a5b35f4..0000000000
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectExtensions.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// ProjectExtensions.cs
-//
-// Author:
-// Matt Ward <ward.matt@gmail.com>
-//
-// Copyright (C) 2012 Matthew Ward
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using MonoDevelop.Core.ProgressMonitoring;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide;
-
-namespace ICSharpCode.PackageManagement
-{
- public static class ProjectExtensions
- {
- public static void Save(this Project project)
- {
- DispatchService.GuiSyncDispatch(() => {
- IdeApp.ProjectOperations.Save(project);
- });
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectModifiedEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectModifiedEventArgs.cs
index 8f887c768b..a9e7a137dc 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectModifiedEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectModifiedEventArgs.cs
@@ -30,7 +30,7 @@ using MonoDevelop.Projects;
namespace MonoDevelop.PackageManagement
{
- public class ProjectModifiedEventArgs : EventArgs
+ internal class ProjectModifiedEventArgs : EventArgs
{
public ProjectModifiedEventArgs (IDotNetProject project, string propertyName)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectPackageReferenceFile.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectPackageReferenceFile.cs
index 09f6ed1c09..1b6d6352de 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectPackageReferenceFile.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectPackageReferenceFile.cs
@@ -28,11 +28,11 @@ using System;
using System.Linq;
using MonoDevelop.Projects;
using NuGet;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement
{
- public class ProjectPackageReferenceFile : PackageReferenceFile
+ internal class ProjectPackageReferenceFile : PackageReferenceFile
{
public ProjectPackageReferenceFile (DotNetProject project)
: base(project.GetPackagesConfigFilePath ())
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectPackagesCompatibilityReport.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectPackagesCompatibilityReport.cs
index 81e5f82e62..eeb8074d9b 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectPackagesCompatibilityReport.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectPackagesCompatibilityReport.cs
@@ -35,7 +35,7 @@ using System.Linq;
namespace MonoDevelop.PackageManagement
{
- public class ProjectPackagesCompatibilityReport
+ internal class ProjectPackagesCompatibilityReport
{
FrameworkName projectTargetFramework;
List<PackageCompatibility> packageCompatibilities = new List<PackageCompatibility> ();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectProxy.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectProxy.cs
index 7aef3277df..7e12939a42 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectProxy.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectProxy.cs
@@ -26,13 +26,16 @@
using System;
using System.Collections;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.Projects;
+using System.Collections.Generic;
+using MonoDevelop.Ide;
+using System.Threading.Tasks;
namespace MonoDevelop.PackageManagement
{
- public class ProjectProxy : IProject
+ internal class ProjectProxy : IProject
{
Project project;
@@ -61,9 +64,15 @@ namespace MonoDevelop.PackageManagement
get { return project.ExtendedProperties; }
}
- public void Save ()
+ public IEnumerable<string> FlavorGuids {
+ get { return project.FlavorGuids; }
+ }
+
+ public async Task SaveAsync ()
{
- project.Save ();
+ using (var monitor = new ProgressMonitor ()) {
+ await project.SaveAsync (monitor);
+ }
}
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectReferenceExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectReferenceExtensions.cs
index 60d2bd1eee..be249f306f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectReferenceExtensions.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectReferenceExtensions.cs
@@ -25,14 +25,14 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.Projects;
using System.IO;
namespace MonoDevelop.PackageManagement
{
- public static class ProjectReferenceExtensions
+ internal static class ProjectReferenceExtensions
{
public static bool IsReferenceFromPackage (this ProjectReference projectReference)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectReloadedEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectReloadedEventArgs.cs
index 9438a2f268..208ddf7b65 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectReloadedEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectReloadedEventArgs.cs
@@ -29,7 +29,7 @@ using MonoDevelop.Projects;
namespace MonoDevelop.PackageManagement
{
- public class ProjectReloadedEventArgs : EventArgs
+ internal class ProjectReloadedEventArgs : EventArgs
{
public static ProjectReloadedEventArgs Create (SolutionItemChangeEventArgs eventArgs)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTargetFramework.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTargetFramework.cs
index 9099f6d4c7..daf302fef2 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTargetFramework.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTargetFramework.cs
@@ -32,9 +32,9 @@ using MonoDevelop.Core.Assemblies;
using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class ProjectTargetFramework
+ internal class ProjectTargetFramework
{
IDotNetProject project;
FrameworkName targetFramework;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTargetFrameworkChangedEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTargetFrameworkChangedEventArgs.cs
index 83f39c4675..38847dffab 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTargetFrameworkChangedEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTargetFrameworkChangedEventArgs.cs
@@ -28,7 +28,7 @@ using System;
namespace MonoDevelop.PackageManagement
{
- public class ProjectTargetFrameworkChangedEventArgs : EventArgs
+ internal class ProjectTargetFrameworkChangedEventArgs : EventArgs
{
public ProjectTargetFrameworkChangedEventArgs (IDotNetProject project)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTargetFrameworkMonitor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTargetFrameworkMonitor.cs
index a0b8528796..b0b65b5c94 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTargetFrameworkMonitor.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTargetFrameworkMonitor.cs
@@ -26,12 +26,12 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using System.Linq;
namespace MonoDevelop.PackageManagement
{
- public class ProjectTargetFrameworkMonitor
+ internal class ProjectTargetFrameworkMonitor
{
IPackageManagementProjectService projectService;
List<MonitoredSolution> monitoredSolutions = new List<MonitoredSolution> ();
@@ -67,6 +67,7 @@ namespace MonoDevelop.PackageManagement
monitoredSolution.Projects.Clear ();
monitoredSolution.Solution.ProjectAdded -= ProjectAdded;
+ monitoredSolution.Solution.ProjectRemoved -= ProjectRemoved;
monitoredSolutions.Remove (monitoredSolution);
}
@@ -88,6 +89,7 @@ namespace MonoDevelop.PackageManagement
var solutionEventArgs = (DotNetSolutionEventArgs)e;
ISolution solution = solutionEventArgs.Solution;
solution.ProjectAdded += ProjectAdded;
+ solution.ProjectRemoved += ProjectRemoved;
List<IDotNetProject> projects = solution.GetAllProjects ().ToList ();
foreach (IDotNetProject project in projects) {
@@ -129,6 +131,16 @@ namespace MonoDevelop.PackageManagement
return false;
}
+ void ProjectRemoved (object sender, DotNetProjectEventArgs e)
+ {
+ MonitoredSolution monitoredSolution = FindMonitoredSolution ((ISolution)sender);
+ IDotNetProject matchedProject = monitoredSolution.Projects.FirstOrDefault (project => project.Equals (e.Project));
+ if (matchedProject != null) {
+ matchedProject.Modified -= ProjectModified;
+ monitoredSolution.Projects.Remove (matchedProject);
+ }
+ }
+
class MonitoredSolution
{
public ISolution Solution { get; set; }
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplateNuGetPackageInstaller.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplateNuGetPackageInstaller.cs
index 7ffe91bb8f..889a88d3bb 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplateNuGetPackageInstaller.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplateNuGetPackageInstaller.cs
@@ -27,14 +27,14 @@
using MonoDevelop.Ide.Templates;
using MonoDevelop.Projects;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Ide;
using NuGet;
using System.Linq;
namespace MonoDevelop.PackageManagement
{
- public class ProjectTemplateNuGetPackageInstaller : ProjectTemplatePackageInstaller
+ internal class ProjectTemplateNuGetPackageInstaller : ProjectTemplatePackageInstaller
{
IPackageManagementSolution packageManagementSolution;
IPackageRepositoryCache packageRepositoryCache;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplatePackageRepositoryCache.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplatePackageRepositoryCache.cs
index 99ffdf1e5f..ddd6790436 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplatePackageRepositoryCache.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplatePackageRepositoryCache.cs
@@ -30,13 +30,13 @@ using System;
using System.Collections.Generic;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
/// <summary>
/// Supports a configurable set of package repositories for project templates that can be
/// different to the registered package repositories used with the Add Package Reference dialog.
/// </summary>
- public class ProjectTemplatePackageRepositoryCache : IPackageRepositoryCache
+ internal class ProjectTemplatePackageRepositoryCache : IPackageRepositoryCache
{
IPackageRepositoryCache packageRepositoryCache;
RegisteredProjectTemplatePackageSources registeredPackageSources;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplatePackageSettingsFileName.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplatePackageSettingsFileName.cs
index ad395570c7..3a28f98b5f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplatePackageSettingsFileName.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplatePackageSettingsFileName.cs
@@ -29,9 +29,9 @@
using System;
using System.IO;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class ProjectTemplatePackagesSettingsFileName
+ internal class ProjectTemplatePackagesSettingsFileName
{
string directory;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackageInfo.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackageInfo.cs
index 415d15f8fc..4698c8f37f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackageInfo.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackageInfo.cs
@@ -29,7 +29,7 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
public class RecentPackageInfo
{
@@ -39,12 +39,12 @@ namespace ICSharpCode.PackageManagement
{
}
- public RecentPackageInfo(IPackage package)
+ internal RecentPackageInfo(IPackage package)
: this(package.Id, package.Version)
{
}
- public RecentPackageInfo(string id, SemanticVersion version)
+ internal RecentPackageInfo(string id, SemanticVersion version)
{
this.Id = id;
this.version = version;
@@ -62,7 +62,7 @@ namespace ICSharpCode.PackageManagement
return String.Format("[RecentPackageInfo Id={0}, Version={1}]", Id, Version);
}
- public bool IsMatch(IPackage package)
+ internal bool IsMatch(IPackage package)
{
return (package.Version.ToString() == Version) && (package.Id == Id);
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackageRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackageRepository.cs
index b8c869ebc1..e833dc3504 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackageRepository.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackageRepository.cs
@@ -31,9 +31,9 @@ using System.Collections.Generic;
using System.Linq;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class RecentPackageRepository : IRecentPackageRepository
+ internal class RecentPackageRepository : IRecentPackageRepository
{
public const int DefaultMaximumPackagesCount = 20;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackagesViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackagesViewModel.cs
index 4f4b6e00fb..352640d48a 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackagesViewModel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackagesViewModel.cs
@@ -30,9 +30,9 @@ using System;
using System.Linq;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class RecentPackagesViewModel : PackagesViewModel
+ internal class RecentPackagesViewModel : PackagesViewModel
{
IPackageManagementEvents packageManagementEvents;
IPackageRepository recentPackageRepository;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReducedPackageOperations.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReducedPackageOperations.cs
index c1e937ef5d..3834b2070b 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReducedPackageOperations.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReducedPackageOperations.cs
@@ -31,9 +31,9 @@ using System.Collections.Generic;
using System.Linq;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class ReducedPackageOperations
+ internal class ReducedPackageOperations
{
IPackageOperationResolver resolver;
IList<PackageOperation> operations;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageRepositories.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageRepositories.cs
index d09316f56a..2740d41ace 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageRepositories.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageRepositories.cs
@@ -31,9 +31,9 @@ using System.Collections.Generic;
using System.Linq;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class RegisteredPackageRepositories : IRegisteredPackageRepositories
+ internal class RegisteredPackageRepositories : IRegisteredPackageRepositories
{
IPackageRepositoryCache repositoryCache;
PackageManagementOptions options;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSource.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSource.cs
index de86b2d95c..cb4bf0f3b7 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSource.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSource.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class RegisteredPackageSource
+ internal class RegisteredPackageSource
{
public string Source { get; set; }
public string Name { get; set; }
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourceSettings.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourceSettings.cs
index 1986fcc729..ac112b3cf3 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourceSettings.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourceSettings.cs
@@ -30,14 +30,14 @@ using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
+using System.Security.Cryptography;
using MonoDevelop.Core;
-using MonoDevelop.PackageManagement;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class RegisteredPackageSourceSettings
+ internal class RegisteredPackageSourceSettings
{
public static readonly string PackageSourcesSectionName = "packageSources";
public static readonly string ActivePackageSourceSectionName = "activePackageSource";
@@ -104,7 +104,7 @@ namespace ICSharpCode.PackageManagement
try {
ReadPackageSources ();
} catch (Exception ex) {
- LoggingService.LogError ("Unable to read NuGet.config file.", ex);
+ ShowReadPackageSourcesError (ex);
// Fallback to using the default package source only (nuget.org)
// and treat NuGet.config as read-only.
@@ -123,6 +123,27 @@ namespace ICSharpCode.PackageManagement
UpdatePackageSourceSettingsWithChanges();
}
}
+
+ static void ShowReadPackageSourcesError (Exception ex)
+ {
+ Ide.MessageService.ShowError (
+ GettextCatalog.GetString ("Unable to read the NuGet.Config file"),
+ String.Format (GetReadPackageSourcesErrorMessage (ex),
+ BrandingService.ApplicationName,
+ ex.Message),
+ ex);
+ }
+
+ static string GetReadPackageSourcesErrorMessage (Exception ex)
+ {
+ if (ex is CryptographicException) {
+ return GettextCatalog.GetString ("Unable to decrypt passwords stored in the NuGet.Config file. " +
+ "{0} will now fallback to using the Official NuGet Gallery and the NuGet.Config file will be treated as read-only.");
+ }
+
+ return GettextCatalog.GetString ("An error occurred when trying to read the NuGet.Config file. " +
+ "{0} will now fallback to using the Official NuGet Gallery and the NuGet.Config file will be treated as read-only.\n\n{1}");
+ }
void PackageSourcesChanged(object sender, NotifyCollectionChangedEventArgs e)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSources.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSources.cs
index 3772a0765c..c73487c121 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSources.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSources.cs
@@ -32,9 +32,9 @@ using System.Collections.ObjectModel;
using System.Linq;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class RegisteredPackageSources : ObservableCollection<PackageSource>
+ internal class RegisteredPackageSources : ObservableCollection<PackageSource>
{
public static readonly string DefaultPackageSourceUrl = "https://www.nuget.org/api/v2/";
public static readonly string DefaultPackageSourceName = "Official NuGet Gallery";
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourcesViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourcesViewModel.cs
index 9dad10f11e..9c35378387 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourcesViewModel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourcesViewModel.cs
@@ -35,9 +35,9 @@ using System.Linq;
using MonoDevelop.PackageManagement;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class RegisteredPackageSourcesViewModel : ViewModelBase<RegisteredPackageSourcesViewModel>, IDisposable, IPackageSourceProvider
+ internal class RegisteredPackageSourcesViewModel : ViewModelBase<RegisteredPackageSourcesViewModel>, IDisposable, IPackageSourceProvider
{
ObservableCollection<PackageSourceViewModel> packageSourceViewModels =
new ObservableCollection<PackageSourceViewModel>();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredProjectTemplatePackageSources.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredProjectTemplatePackageSources.cs
index a26f6088af..a78f93a9ad 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredProjectTemplatePackageSources.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredProjectTemplatePackageSources.cs
@@ -31,9 +31,9 @@ using Mono.Addins;
using MonoDevelop.PackageManagement;
using MonoDevelop.Ide.Templates;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class RegisteredProjectTemplatePackageSources
+ internal class RegisteredProjectTemplatePackageSources
{
RegisteredPackageSources packageSources = new RegisteredPackageSources();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReinstallPackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReinstallPackageAction.cs
index e2b3573b91..62e5792661 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReinstallPackageAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReinstallPackageAction.cs
@@ -31,12 +31,12 @@ using MonoDevelop.Ide.Commands;
using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.PackageManagement.NodeBuilders;
using MonoDevelop.Projects;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement
{
- public class ReinstallPackageAction : ProcessPackageAction
+ internal class ReinstallPackageAction : ProcessPackageAction
{
IFileRemover fileRemover;
@@ -84,6 +84,7 @@ namespace MonoDevelop.PackageManagement
action.Package = Package;
action.OpenReadMeText = false;
action.PreserveLocalCopyReferences = false;
+ action.LicensesMustBeAccepted = false;
action.Execute ();
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReinstallPackageOperations.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReinstallPackageOperations.cs
index 4e5db3cb1a..78c70d29dd 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReinstallPackageOperations.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReinstallPackageOperations.cs
@@ -31,7 +31,7 @@ using NuGet;
namespace MonoDevelop.PackageManagement
{
- public class ReinstallPackageOperations
+ internal class ReinstallPackageOperations
{
List<PackageOperation> operations;
List<IPackage> packagesInDependencyOrder;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReinstallProjectPackagesAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReinstallProjectPackagesAction.cs
index 85d42b791b..93eaa2e337 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReinstallProjectPackagesAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReinstallProjectPackagesAction.cs
@@ -27,13 +27,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using NuGet;
namespace MonoDevelop.PackageManagement
{
- public class ReinstallProjectPackagesAction : IPackageAction
+ internal class ReinstallProjectPackagesAction : IPackageAction
{
IPackageManagementProject project;
IPackageManagementEvents packageManagementEvents;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RemovedPackageReferenceMonitor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RemovedPackageReferenceMonitor.cs
deleted file mode 100644
index b26f68d526..0000000000
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RemovedPackageReferenceMonitor.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// RemovedPackageReferenceMonitor.cs
-//
-// Author:
-// Matt Ward <ward.matt@gmail.com>
-//
-// Copyright (C) 2013 Matthew Ward
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using NuGet;
-
-namespace ICSharpCode.PackageManagement
-{
- public class RemovedPackageReferenceMonitor : IDisposable
- {
- ISharpDevelopProjectManager projectManager;
- List<IPackage> packagesRemoved = new List<IPackage>();
-
- public RemovedPackageReferenceMonitor(ISharpDevelopProjectManager projectManager)
- {
- this.projectManager = projectManager;
- projectManager.PackageReferenceRemoved += PackageReferenceRemoved;
- }
-
- void PackageReferenceRemoved(object sender, PackageOperationEventArgs e)
- {
- packagesRemoved.Add(e.Package);
- }
-
- public void Dispose()
- {
- projectManager.PackageReferenceRemoved -= PackageReferenceRemoved;
- }
-
- public List<IPackage> PackagesRemoved {
- get { return packagesRemoved; }
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ResolveFileConflictEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ResolveFileConflictEventArgs.cs
index 97ebae3b1c..b220db95b5 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ResolveFileConflictEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ResolveFileConflictEventArgs.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class ResolveFileConflictEventArgs : EventArgs
+ internal class ResolveFileConflictEventArgs : EventArgs
{
public ResolveFileConflictEventArgs(string message)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RestoreBeforeUpdateAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RestoreBeforeUpdateAction.cs
index 3d3c5ce64c..55a64da3e3 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RestoreBeforeUpdateAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RestoreBeforeUpdateAction.cs
@@ -27,13 +27,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
-using MonoDevelop.Ide;
using MonoDevelop.Projects;
namespace MonoDevelop.PackageManagement
{
- public class RestoreBeforeUpdateAction
+ internal class RestoreBeforeUpdateAction
{
IPackageManagementProjectService projectService;
IBackgroundPackageActionRunner backgroundRunner;
@@ -54,28 +52,32 @@ namespace MonoDevelop.PackageManagement
}
public static void Restore (
+ IPackageManagementSolution solution,
IPackageManagementProject project,
Action afterRestore)
{
var runner = new RestoreBeforeUpdateAction ();
- runner.RestoreProjectPackages (project.DotNetProject, afterRestore);
+ runner.RestoreProjectPackages (solution, project.DotNetProject, afterRestore);
}
public static void Restore (
+ IPackageManagementSolution solution,
IEnumerable<IPackageManagementProject> projects,
Action afterRestore)
{
var runner = new RestoreBeforeUpdateAction ();
runner.RestoreAllPackagesInSolution (
+ solution,
projects.Select (project => project.DotNetProject),
afterRestore);
}
public void RestoreAllPackagesInSolution (
+ IPackageManagementSolution solution,
IEnumerable<DotNetProject> projects,
Action afterRestore)
{
- var restorer = new PackageRestorer (projects);
+ var restorer = new PackageRestorer (solution, projects);
Restore (restorer, afterRestore);
}
@@ -83,7 +85,7 @@ namespace MonoDevelop.PackageManagement
{
ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateRestoringPackagesBeforeUpdateMessage ();
- DispatchService.BackgroundDispatch (() => {
+ PackageManagementBackgroundDispatcher.Dispatch (() => {
restorer.Restore (progressMessage);
if (!restorer.RestoreFailed) {
afterRestore ();
@@ -91,9 +93,12 @@ namespace MonoDevelop.PackageManagement
});
}
- public void RestoreProjectPackages (DotNetProject project, Action afterRestore)
+ public void RestoreProjectPackages (
+ IPackageManagementSolution solution,
+ DotNetProject project,
+ Action afterRestore)
{
- var restorer = new PackageRestorer (project);
+ var restorer = new PackageRestorer (solution, project);
Restore (restorer, afterRestore);
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RestorePackagesAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RestorePackagesAction.cs
index 8f67b0fd6e..a10aad464a 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RestorePackagesAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RestorePackagesAction.cs
@@ -27,13 +27,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using MonoDevelop.Core;
namespace MonoDevelop.PackageManagement
{
- public class RestorePackagesAction : IPackageAction
+ internal class RestorePackagesAction : IPackageAction
{
IPackageManagementSolution solution;
IPackageManagementEvents packageManagementEvents;
@@ -56,7 +56,7 @@ namespace MonoDevelop.PackageManagement
solution,
packageManagementEvents,
PackageManagementServices.PackageRepositoryCache,
- new SharpDevelopPackageManagerFactory ())
+ new MonoDevelopPackageManagerFactory ())
{
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SearchPackagesDataSource.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SearchPackagesDataSource.cs
deleted file mode 100644
index 3887262942..0000000000
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SearchPackagesDataSource.cs
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// SearchPackagesDataSource.cs
-//
-// Author:
-// Matt Ward <matt.ward@xamarin.com>
-//
-// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Components.MainToolbar;
-using MonoDevelop.Core;
-using MonoDevelop.Ide.CodeCompletion;
-using Xwt.Drawing;
-using ICSharpCode.PackageManagement;
-
-namespace MonoDevelop.PackageManagement
-{
- public class SearchPackagesDataSource : ISearchDataSource
- {
- readonly SearchPopupSearchPattern searchPattern;
-
- public SearchPackagesDataSource (SearchPopupSearchPattern searchPattern)
- {
- this.searchPattern = searchPattern;
- }
-
- Image ISearchDataSource.GetIcon (int item)
- {
- return null;
- }
-
- string ISearchDataSource.GetMarkup (int item, bool isSelected)
- {
- return GettextCatalog.GetString ("Search Packages...");
- }
-
- string ISearchDataSource.GetDescriptionMarkup (int item, bool isSelected)
- {
- return null;
- }
-
- TooltipInformation ISearchDataSource.GetTooltip (int item)
- {
- return null;
- }
-
- double ISearchDataSource.GetWeight (int item)
- {
- return 0;
- }
-
- DomRegion ISearchDataSource.GetRegion (int item)
- {
- return DomRegion.Empty;
- }
-
- bool ISearchDataSource.CanActivate (int item)
- {
- return IsProjectSelected ();
- }
-
- bool IsProjectSelected ()
- {
- return PackageManagementServices.ProjectService.CurrentProject != null;
- }
-
- void ISearchDataSource.Activate (int item)
- {
- var runner = new AddPackagesDialogRunner ();
- runner.Run (searchPattern.UnparsedPattern);
- }
-
- int ISearchDataSource.ItemCount {
- get {
- if (IsProjectSelected ()) {
- return 1;
- }
- return 0;
- }
- }
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SearchPackagesSearchCategory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SearchPackagesSearchCategory.cs
index 9a1bdde9b9..cf35d50a71 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SearchPackagesSearchCategory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SearchPackagesSearchCategory.cs
@@ -27,21 +27,68 @@
using System;
using System.Threading;
using System.Threading.Tasks;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Components.MainToolbar;
using MonoDevelop.Core;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Ide.TypeSystem;
+using Xwt.Drawing;
+using MonoDevelop.Ide;
namespace MonoDevelop.PackageManagement
{
- public class SearchPackagesSearchCategory : SearchCategory
+ internal class SearchPackagesSearchCategory : SearchCategory
{
public SearchPackagesSearchCategory ()
: base (GettextCatalog.GetString("Search"))
{
}
+ public override Task GetResults (ISearchResultCallback searchResultCallback, SearchPopupSearchPattern pattern, CancellationToken token)
+ {
+ if (IsProjectSelected ()) {
+ searchResultCallback.ReportResult (new SearchPackageSearchResult (pattern));
+ }
+ return SpecializedTasks.EmptyTask;
+ }
- public override Task<ISearchDataSource> GetResults (SearchPopupSearchPattern searchPattern, int resultsCount, CancellationToken token)
+ class SearchPackageSearchResult : SearchResult
{
- return Task.Factory.StartNew (() => (ISearchDataSource)new SearchPackagesDataSource (searchPattern));
+ SearchPopupSearchPattern pattern;
+
+ public override bool CanActivate {
+ get {
+ return IsProjectSelected ();
+ }
+ }
+
+ public SearchPackageSearchResult (SearchPopupSearchPattern pattern) : base ("", "", 0)
+ {
+ this.pattern = pattern;
+ }
+
+ public override void Activate ()
+ {
+ var runner = new AddPackagesDialogRunner ();
+ runner.Run (pattern.UnparsedPattern);
+ }
+
+ public override string GetMarkupText (bool selected)
+ {
+ return GettextCatalog.GetString ("Search Packages...");
+ }
+ }
+
+ static bool IsProjectSelected ()
+ {
+ return PackageManagementServices.ProjectService.CurrentProject != null;
+ }
+
+ static readonly string [] tags = { "search" };
+
+ public override string [] Tags {
+ get {
+ return tags;
+ }
}
public override bool IsValidTag (string tag)
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsEventArgs.cs
index 444db4e904..c4a9527c8a 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsEventArgs.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsEventArgs.cs
@@ -29,9 +29,9 @@
using System;
using System.Collections.Generic;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class SelectProjectsEventArgs : EventArgs
+ internal class SelectProjectsEventArgs : EventArgs
{
public SelectProjectsEventArgs(IEnumerable<IPackageManagementSelectedProject> selectedProjects)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsService.cs
index 3042569412..72063554e5 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsService.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsService.cs
@@ -31,9 +31,9 @@ using System.Collections.Generic;
using MonoDevelop.Ide;
using MonoDevelop.PackageManagement;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class SelectProjectsService : ISelectProjectsService
+ internal class SelectProjectsService : ISelectProjectsService
{
public bool SelectProjects(IEnumerable<IPackageManagementSelectedProject> projects)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsViewModel.cs
index ee3e00a080..921e24f5c4 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsViewModel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsViewModel.cs
@@ -30,9 +30,9 @@ using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class SelectProjectsViewModel
+ internal class SelectProjectsViewModel
{
ObservableCollection<IPackageManagementSelectedProject> projects =
new ObservableCollection<IPackageManagementSelectedProject>();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectedProjectsForInstalledPackages.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectedProjectsForInstalledPackages.cs
index 87b968e692..cd839669d2 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectedProjectsForInstalledPackages.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectedProjectsForInstalledPackages.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class SelectedProjectsForInstalledPackages : PackageManagementSelectedProjects
+ internal class SelectedProjectsForInstalledPackages : PackageManagementSelectedProjects
{
public SelectedProjectsForInstalledPackages(IPackageManagementSolution solution)
: base(solution)
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectedProjectsForUpdatedPackages.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectedProjectsForUpdatedPackages.cs
index cbbd91ad0d..82bb39d287 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectedProjectsForUpdatedPackages.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectedProjectsForUpdatedPackages.cs
@@ -30,9 +30,9 @@ using System;
using System.Linq;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class SelectedProjectsForUpdatedPackages : PackageManagementSelectedProjects
+ internal class SelectedProjectsForUpdatedPackages : PackageManagementSelectedProjects
{
public SelectedProjectsForUpdatedPackages(IPackageManagementSolution solution)
: base(solution)
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SettingsFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SettingsFactory.cs
index 9fac0b11d7..8f41306204 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SettingsFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SettingsFactory.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class SettingsFactory : ISettingsFactory
+ internal class SettingsFactory : ISettingsFactory
{
public ISettings CreateSettings(string directory)
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SettingsProvider.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SettingsProvider.cs
index 7f89c7f8bb..febdee98d5 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SettingsProvider.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SettingsProvider.cs
@@ -26,13 +26,13 @@
using System;
using System.IO;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
using MonoDevelop.Core;
namespace MonoDevelop.PackageManagement
{
- public class SettingsProvider : ISettingsProvider
+ internal class SettingsProvider : ISettingsProvider
{
public static Func<IFileSystem, string, IMachineWideSettings, ISettings> LoadDefaultSettings
= Settings.LoadDefaultSettings;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageManager.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageManager.cs
deleted file mode 100644
index 84a9f3d9f1..0000000000
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageManager.cs
+++ /dev/null
@@ -1,230 +0,0 @@
-//
-// SharpDevelopPackageManager.cs
-//
-// Author:
-// Matt Ward <ward.matt@gmail.com>
-//
-// Copyright (C) 2012-2013 Matthew Ward
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using MonoDevelop.PackageManagement;
-using NuGet;
-
-namespace ICSharpCode.PackageManagement
-{
- public class SharpDevelopPackageManager : PackageManager, ISharpDevelopPackageManager
- {
- IProjectSystem projectSystem;
- IPackageOperationResolverFactory packageOperationResolverFactory;
-
- public SharpDevelopPackageManager(
- IPackageRepository sourceRepository,
- IProjectSystem projectSystem,
- ISolutionPackageRepository solutionPackageRepository,
- IPackageOperationResolverFactory packageOperationResolverFactory)
- : base(
- sourceRepository,
- solutionPackageRepository.PackagePathResolver,
- solutionPackageRepository.FileSystem,
- solutionPackageRepository.Repository)
- {
- this.projectSystem = projectSystem;
- this.packageOperationResolverFactory = packageOperationResolverFactory;
- CreateProjectManager();
- }
-
- // <summary>
- /// project manager should be created with:
- /// local repo = PackageReferenceRepository(projectSystem, sharedRepo)
- /// packageRefRepo should have its RegisterIfNecessary() method called before creating the project manager.
- /// source repo = sharedRepository
- /// </summary>
- void CreateProjectManager()
- {
- var packageRefRepository = CreatePackageReferenceRepository();
- ProjectManager = CreateProjectManager(packageRefRepository);
- }
-
- PackageReferenceRepository CreatePackageReferenceRepository()
- {
- var sharedRepository = LocalRepository as ISharedPackageRepository;
- var packageRefRepository = new PackageReferenceRepository(projectSystem, projectSystem.ProjectName, sharedRepository);
- packageRefRepository.RegisterIfNecessary();
- return packageRefRepository;
- }
-
- public ISharpDevelopProjectManager ProjectManager { get; set; }
-
- SharpDevelopProjectManager CreateProjectManager(PackageReferenceRepository packageRefRepository)
- {
- return new SharpDevelopProjectManager(LocalRepository, PathResolver, projectSystem, packageRefRepository);
- }
-
- public void InstallPackage(IPackage package)
- {
- bool ignoreDependencies = false;
- bool allowPreleaseVersions = false;
- InstallPackage(package, ignoreDependencies, allowPreleaseVersions);
- }
-
- public void InstallPackage(IPackage package, InstallPackageAction installAction)
- {
- RunPackageOperations(installAction.Operations);
- AddPackageReference(package, installAction.IgnoreDependencies, installAction.AllowPrereleaseVersions);
- }
-
- public void AddPackageReference (IPackage package, bool ignoreDependencies, bool allowPrereleaseVersions)
- {
- var monitor = new RemovedPackageReferenceMonitor(ProjectManager);
- using (monitor) {
- ProjectManager.AddPackageReference(package.Id, package.Version, ignoreDependencies, allowPrereleaseVersions);
- }
-
- monitor.PackagesRemoved.ForEach(packageRemoved => UninstallPackageFromSolutionRepository(packageRemoved));
- }
-
- public override void InstallPackage(IPackage package, bool ignoreDependencies, bool allowPrereleaseVersions)
- {
- base.InstallPackage(package, ignoreDependencies, allowPrereleaseVersions);
- AddPackageReference(package, ignoreDependencies, allowPrereleaseVersions);
- }
-
- public void UninstallPackage(IPackage package, UninstallPackageAction uninstallAction)
- {
- UninstallPackage(package, uninstallAction.ForceRemove, uninstallAction.RemoveDependencies);
- }
-
- public override void UninstallPackage(IPackage package, bool forceRemove, bool removeDependencies)
- {
- ProjectManager.RemovePackageReference(package.Id, forceRemove, removeDependencies);
- if (!IsPackageReferencedByOtherProjects(package)) {
- base.UninstallPackage(package, forceRemove, removeDependencies);
- }
- }
-
- public void UninstallPackageFromSolutionRepository(IPackage package)
- {
- if (!IsPackageReferencedByOtherProjects(package)) {
- ExecuteUninstall(package);
- }
- }
-
- bool IsPackageReferencedByOtherProjects(IPackage package)
- {
- var sharedRepository = LocalRepository as ISharedPackageRepository;
- return sharedRepository.IsReferenced(package.Id, package.Version);
- }
-
- public IEnumerable<PackageOperation> GetInstallPackageOperations(IPackage package, InstallPackageAction installAction)
- {
- IPackageOperationResolver resolver = CreateInstallPackageOperationResolver(installAction);
- return resolver.ResolveOperations(package);
- }
-
- IPackageOperationResolver CreateInstallPackageOperationResolver(InstallPackageAction installAction)
- {
- return packageOperationResolverFactory.CreateInstallPackageOperationResolver(
- LocalRepository,
- SourceRepository,
- Logger,
- installAction);
- }
-
- public void UpdatePackage(IPackage package, UpdatePackageAction updateAction)
- {
- RunPackageOperations(updateAction.Operations);
- UpdatePackageReference(package, updateAction);
- }
-
- public void UpdatePackageReference(IPackage package, IUpdatePackageSettings settings)
- {
- UpdatePackageReference(package, settings.UpdateDependencies, settings.AllowPrereleaseVersions);
- }
-
- void UpdatePackageReference(IPackage package, bool updateDependencies, bool allowPrereleaseVersions)
- {
- var monitor = new RemovedPackageReferenceMonitor(ProjectManager);
- using (monitor) {
- ProjectManager.UpdatePackageReference(package.Id, package.Version, updateDependencies, allowPrereleaseVersions);
- }
-
- monitor.PackagesRemoved.ForEach(packageRemoved => UninstallPackageFromSolutionRepository(packageRemoved));
- }
-
- public void UpdatePackages(UpdatePackagesAction updateAction)
- {
- RunPackageOperations(updateAction.Operations);
- foreach (IPackage package in updateAction.Packages) {
- UpdatePackageReference(package, updateAction);
- }
- }
-
- public IEnumerable<PackageOperation> GetUpdatePackageOperations(
- IEnumerable<IPackage> packages,
- IUpdatePackageSettings settings)
- {
- IPackageOperationResolver resolver = CreateUpdatePackageOperationResolver(settings);
-
- var reducedOperations = new ReducedPackageOperations(resolver, packages);
- reducedOperations.Reduce();
- return reducedOperations.Operations;
- }
-
- IPackageOperationResolver CreateUpdatePackageOperationResolver(IUpdatePackageSettings settings)
- {
- return packageOperationResolverFactory.CreateUpdatePackageOperationResolver(
- LocalRepository,
- SourceRepository,
- Logger,
- settings);
- }
-
- public void RunPackageOperations(IEnumerable<PackageOperation> operations)
- {
- foreach (PackageOperation operation in operations) {
- Execute(operation);
- }
- }
-
- public ReinstallPackageOperations GetReinstallPackageOperations (IEnumerable<IPackage> packages)
- {
- var installWalker = new InstallWalker (
- LocalRepository,
- SourceRepository,
- ProjectManager.Project.TargetFramework,
- ProjectManager.Logger,
- ignoreDependencies: true,
- allowPrereleaseVersions: false,
- dependencyVersion: DependencyVersion.Lowest);
-
- IList<IPackage> packagesInDependencyOrder;
- IList<PackageOperation> operations = installWalker.ResolveOperations (
- packages,
- out packagesInDependencyOrder,
- allowPrereleaseVersionsBasedOnPackage: true);
-
- return new ReinstallPackageOperations (operations, packagesInDependencyOrder);
- }
- }
-} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageManagerFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageManagerFactory.cs
deleted file mode 100644
index 02626127aa..0000000000
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageManagerFactory.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// SharpDevelopPackageManagerFactory.cs
-//
-// Author:
-// Matt Ward <ward.matt@gmail.com>
-//
-// Copyright (C) 2012 Matthew Ward
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using MonoDevelop.PackageManagement;
-using MonoDevelop.Projects;
-using NuGet;
-
-namespace ICSharpCode.PackageManagement
-{
- public class SharpDevelopPackageManagerFactory : IPackageManagerFactory
- {
- PackageManagementOptions options;
- ISharpDevelopPackageRepositoryFactory packageRepositoryFactory;
- ISharpDevelopProjectSystemFactory projectSystemFactory;
-
- public SharpDevelopPackageManagerFactory()
- : this(
- new SharpDevelopPackageRepositoryFactory(),
- new SharpDevelopProjectSystemFactory(),
- PackageManagementServices.Options)
- {
- }
-
- public SharpDevelopPackageManagerFactory(
- ISharpDevelopPackageRepositoryFactory packageRepositoryFactory,
- ISharpDevelopProjectSystemFactory projectSystemFactory,
- PackageManagementOptions options)
- {
- this.packageRepositoryFactory = packageRepositoryFactory;
- this.projectSystemFactory = projectSystemFactory;
- this.options = options;
- }
-
- public ISharpDevelopPackageManager CreatePackageManager(
- IPackageRepository sourceRepository,
- IDotNetProject project)
- {
- SolutionPackageRepository solutionPackageRepository = CreateSolutionPackageRepository (project.ParentSolution);
- IProjectSystem projectSystem = CreateProjectSystem (project.DotNetProject);
- PackageOperationsResolverFactory packageOperationResolverFactory = new PackageOperationsResolverFactory();
-
- return new SharpDevelopPackageManager(
- sourceRepository,
- projectSystem,
- solutionPackageRepository,
- packageOperationResolverFactory);
- }
-
- SolutionPackageRepository CreateSolutionPackageRepository (ISolution solution)
- {
- return new SolutionPackageRepository (solution, packageRepositoryFactory, options);
- }
-
- IProjectSystem CreateProjectSystem(DotNetProject project)
- {
- return projectSystemFactory.CreateProjectSystem(project);
- }
-
- public IPackageManager CreatePackageManager (
- IPackageRepository sourceRepository,
- ISolutionPackageRepository solutionPackageRepository)
- {
- return new PackageManager (
- sourceRepository,
- solutionPackageRepository.PackagePathResolver,
- solutionPackageRepository.FileSystem,
- solutionPackageRepository.Repository);
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageRepositoryFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageRepositoryFactory.cs
deleted file mode 100644
index afcd7dffb4..0000000000
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageRepositoryFactory.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// SharpDevelopPackageRepositoryFactory.cs
-//
-// Author:
-// Matt Ward <ward.matt@gmail.com>
-//
-// Copyright (C) 2012 Matthew Ward
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using MonoDevelop.PackageManagement;
-using NuGet;
-
-namespace ICSharpCode.PackageManagement
-{
- public class SharpDevelopPackageRepositoryFactory : PackageRepositoryFactory, ISharpDevelopPackageRepositoryFactory
- {
- public ISharedPackageRepository CreateSharedRepository(
- IPackagePathResolver pathResolver,
- IFileSystem fileSystem,
- IFileSystem configSettingsFileSystem)
- {
- return new SharedPackageRepository(pathResolver, fileSystem, configSettingsFileSystem);
- }
-
- public IRecentPackageRepository CreateRecentPackageRepository(
- IList<RecentPackageInfo> recentPackages,
- IPackageRepository aggregateRepository)
- {
- return new RecentPackageRepository(recentPackages, aggregateRepository);
- }
-
- public IPackageRepository CreateAggregateRepository(IEnumerable<IPackageRepository> repositories)
- {
- return new MonoDevelopAggregateRepository (repositories);
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectManager.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectManager.cs
deleted file mode 100644
index 51ac0b51ee..0000000000
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectManager.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// SharpDevelopProjectManager.cs
-//
-// Author:
-// Matt Ward <ward.matt@gmail.com>
-//
-// Copyright (C) 2012 Matthew Ward
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using NuGet;
-
-namespace ICSharpCode.PackageManagement
-{
- public class SharpDevelopProjectManager : ProjectManager, ISharpDevelopProjectManager
- {
- public SharpDevelopProjectManager(
- IPackageRepository sourceRepository,
- IPackagePathResolver pathResolver,
- IProjectSystem project,
- IPackageRepository localRepository)
- : base(sourceRepository, pathResolver, project, localRepository)
- {
- }
-
- public bool IsInstalled(string packageId)
- {
- return LocalRepository.Exists(packageId);
- }
-
- public bool HasOlderPackageInstalled(IPackage package)
- {
- IPackage installedPackage = LocalRepository.FindPackage(package.Id);
- return (installedPackage != null) &&
- (installedPackage.Version < package.Version);
- }
-
- public IEnumerable<PackageReference> GetPackageReferences ()
- {
- var repository = LocalRepository as PackageReferenceRepository;
- return repository.ReferenceFile.GetPackageReferences ();
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectSystem.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectSystem.cs
deleted file mode 100644
index 4684a24b57..0000000000
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectSystem.cs
+++ /dev/null
@@ -1,469 +0,0 @@
-//
-// SharpDevelopProjectSystem.cs
-//
-// Author:
-// Matt Ward <ward.matt@gmail.com>
-//
-// Copyright (C) 2012 Matthew Ward
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Runtime.Versioning;
-
-using MonoDevelop.Core;
-using MonoDevelop.Ide;
-using MonoDevelop.PackageManagement;
-using MonoDevelop.Projects;
-using MonoDevelop.Projects.Formats.MSBuild;
-using NuGet;
-
-namespace ICSharpCode.PackageManagement
-{
- public class SharpDevelopProjectSystem : PhysicalFileSystem, IProjectSystem
- {
- IDotNetProject project;
- ProjectTargetFramework targetFramework;
- IPackageManagementFileService fileService;
- IPackageManagementEvents packageManagementEvents;
- Action<MessageHandler> guiSyncDispatcher;
-
- public SharpDevelopProjectSystem(DotNetProject project)
- : this (
- new DotNetProjectProxy (project),
- new PackageManagementFileService (),
- PackageManagementServices.ProjectService,
- PackageManagementServices.PackageManagementEvents,
- DispatchService.GuiSyncDispatch)
- {
- }
-
- public SharpDevelopProjectSystem (
- IDotNetProject project,
- IPackageManagementFileService fileService,
- IPackageManagementProjectService projectService,
- IPackageManagementEvents packageManagementEvents,
- Action<MessageHandler> guiSyncDispatcher)
- : base (AppendTrailingSlashToDirectory (project.BaseDirectory))
- {
- this.project = project;
- this.fileService = fileService;
- this.packageManagementEvents = packageManagementEvents;
- this.guiSyncDispatcher = guiSyncDispatcher;
- }
-
- static string AppendTrailingSlashToDirectory(string directory)
- {
- return directory + Path.DirectorySeparatorChar.ToString();
- }
-
- public bool IsBindingRedirectSupported { get; set; }
-
- public FrameworkName TargetFramework {
- get {
- return GuiSyncDispatch (() => GetTargetFramework ());
- }
- }
-
- FrameworkName GetTargetFramework()
- {
- if (targetFramework == null) {
- targetFramework = new ProjectTargetFramework(project);
- }
- return targetFramework.TargetFrameworkName;
- }
-
- public string ProjectName {
- get {
- return GuiSyncDispatch (() => project.Name);
- }
- }
-
- public dynamic GetPropertyValue (string propertyName)
- {
- return GuiSyncDispatch (() => {
- if ("RootNamespace".Equals(propertyName, StringComparison.OrdinalIgnoreCase)) {
- return project.DefaultNamespace;
- }
- return String.Empty;
- });
- }
-
- public void AddReference(string referencePath, Stream stream)
- {
- GuiSyncDispatch (() => {
- ProjectReference assemblyReference = CreateReference (referencePath);
- packageManagementEvents.OnReferenceAdding (assemblyReference);
- AddReferenceToProject (assemblyReference);
- });
- }
-
- ProjectReference CreateReference(string referencePath)
- {
- string fullPath = GetFullPath(referencePath);
- return new ProjectReference(ReferenceType.Assembly, fullPath);
- }
-
- void AddReferenceToProject(ProjectReference assemblyReference)
- {
- project.References.Add (assemblyReference);
- project.Save ();
- LogAddedReferenceToProject(assemblyReference);
- }
-
- void LogAddedReferenceToProject(ProjectReference referenceProjectItem)
- {
- LogAddedReferenceToProject(referenceProjectItem.Reference, ProjectName);
- }
-
- protected virtual void LogAddedReferenceToProject(string referenceName, string projectName)
- {
- DebugLogFormat("Added reference '{0}' to project '{1}'.", referenceName, projectName);
- }
-
- void DebugLogFormat(string format, params object[] args)
- {
- Logger.Log(MessageLevel.Debug, format, args);
- }
-
- public bool ReferenceExists(string name)
- {
- return GuiSyncDispatch (() => {
- ProjectReference referenceProjectItem = FindReference (name);
- if (referenceProjectItem != null) {
- return true;
- }
- return false;
- });
- }
-
- ProjectReference FindReference(string name)
- {
- string referenceName = GetReferenceName(name);
- foreach (ProjectReference referenceProjectItem in project.References) {
- string projectReferenceName = GetProjectReferenceName(referenceProjectItem.Reference);
- if (IsMatchIgnoringCase(projectReferenceName, referenceName)) {
- return referenceProjectItem;
- }
- }
- return null;
- }
-
- string GetReferenceName(string name)
- {
- if (HasDllOrExeFileExtension(name)) {
- return Path.GetFileNameWithoutExtension(name);
- }
- return name;
- }
-
- string GetProjectReferenceName(string name)
- {
- string referenceName = GetReferenceName(name);
- return GetAssemblyShortName(referenceName);
- }
-
- string GetAssemblyShortName(string name)
- {
- string[] parts = name.Split(',');
- return parts[0];
- }
-
- bool HasDllOrExeFileExtension(string name)
- {
- string extension = Path.GetExtension(name);
- return
- IsMatchIgnoringCase(extension, ".dll") ||
- IsMatchIgnoringCase(extension, ".exe");
- }
-
- bool IsMatchIgnoringCase(string lhs, string rhs)
- {
- return String.Equals(lhs, rhs, StringComparison.InvariantCultureIgnoreCase);
- }
-
- public void RemoveReference(string name)
- {
- GuiSyncDispatch (() => {
- ProjectReference referenceProjectItem = FindReference (name);
- if (referenceProjectItem != null) {
- packageManagementEvents.OnReferenceRemoving (referenceProjectItem);
- project.References.Remove (referenceProjectItem);
- project.Save ();
- LogRemovedReferenceFromProject (referenceProjectItem);
- }
- });
- }
-
- void LogRemovedReferenceFromProject(ProjectReference referenceProjectItem)
- {
- LogRemovedReferenceFromProject(referenceProjectItem.Reference, ProjectName);
- }
-
- protected virtual void LogRemovedReferenceFromProject(string referenceName, string projectName)
- {
- DebugLogFormat("Removed reference '{0}' from project '{1}'.", referenceName, projectName);
- }
-
- public bool IsSupportedFile(string path)
- {
- return GuiSyncDispatch (() => {
- if (project.IsWebProject ()) {
- return !IsAppConfigFile (path);
- }
- return !IsWebConfigFile (path);
- });
- }
-
- bool IsWebConfigFile(string path)
- {
- return IsFileNameMatchIgnoringPath("web.config", path);
- }
-
- bool IsAppConfigFile(string path)
- {
- return IsFileNameMatchIgnoringPath("app.config", path);
- }
-
- bool IsFileNameMatchIgnoringPath(string fileName1, string path)
- {
- string fileName2 = Path.GetFileName(path);
- return IsMatchIgnoringCase(fileName1, fileName2);
- }
-
- public override void AddFile(string path, Stream stream)
- {
- PhysicalFileSystemAddFile(path, stream);
- GuiSyncDispatch (() => AddFileToProject (path));
- }
-
- protected virtual void PhysicalFileSystemAddFile(string path, Stream stream)
- {
- base.AddFile(path, stream);
- }
-
- public override void AddFile(string path, Action<Stream> writeToStream)
- {
- PhysicalFileSystemAddFile (path, writeToStream);
- GuiSyncDispatch (() => AddFileToProject (path));
- }
-
- protected virtual void PhysicalFileSystemAddFile (string path, Action<Stream> writeToStream)
- {
- base.AddFile(path, writeToStream);
- }
-
- void AddFileToProject(string path)
- {
- if (ShouldAddFileToProject(path)) {
- AddFileProjectItemToProject(path);
- }
- OnFileChanged (path);
- LogAddedFileToProject(path);
- }
-
- bool ShouldAddFileToProject(string path)
- {
- return !IsBinDirectory(path) && !FileExistsInProject(path);
- }
-
- void OnFileChanged (string path)
- {
- GuiSyncDispatch (() => fileService.OnFileChanged (GetFullPath (path)));
- }
-
- bool IsBinDirectory(string path)
- {
- string directoryName = Path.GetDirectoryName(path);
- return IsMatchIgnoringCase(directoryName, "bin");
- }
-
- public bool FileExistsInProject(string path)
- {
- string fullPath = GetFullPath(path);
- return GuiSyncDispatch (() => {
- return project.IsFileInProject (fullPath);
- });
- }
-
- void AddFileProjectItemToProject(string path)
- {
- ProjectFile fileItem = CreateFileProjectItem (path);
- project.AddFile (fileItem);
- project.Save ();
- }
-
- ProjectFile CreateFileProjectItem(string path)
- {
- //TODO custom tool?
- string fullPath = GetFullPath(path);
- string buildAction = project.GetDefaultBuildAction(fullPath);
- return new ProjectFile(fullPath) {
- BuildAction = buildAction
- };
- }
-
- void LogAddedFileToProject(string fileName)
- {
- LogAddedFileToProject(fileName, ProjectName);
- }
-
- protected virtual void LogAddedFileToProject(string fileName, string projectName)
- {
- DebugLogFormat("Added file '{0}' to project '{1}'.", fileName, projectName);
- }
-
- public override void DeleteDirectory(string path, bool recursive)
- {
- GuiSyncDispatch (() => {
- string directory = GetFullPath (path);
- fileService.RemoveDirectory (directory);
- project.Save ();
- LogDeletedDirectory (path);
- });
- }
-
- public override void DeleteFile(string path)
- {
- GuiSyncDispatch (() => {
- string fileName = GetFullPath (path);
- project.Files.Remove (fileName);
- fileService.RemoveFile (fileName);
- project.Save ();
- LogDeletedFileInfo (path);
- });
- }
-
- protected virtual void LogDeletedDirectory(string folder)
- {
- DebugLogFormat("Removed folder '{0}'.", folder);
- }
-
- void LogDeletedFileInfo(string path)
- {
- string fileName = Path.GetFileName(path);
- string directory = Path.GetDirectoryName(path);
- if (String.IsNullOrEmpty(directory)) {
- LogDeletedFile(fileName);
- } else {
- LogDeletedFileFromDirectory(fileName, directory);
- }
- }
-
- protected virtual void LogDeletedFile(string fileName)
- {
- DebugLogFormat("Removed file '{0}'.", fileName);
- }
-
- protected virtual void LogDeletedFileFromDirectory(string fileName, string directory)
- {
- DebugLogFormat("Removed file '{0}' from folder '{1}'.", fileName, directory);
- }
-
- public void AddFrameworkReference(string name)
- {
- GuiSyncDispatch (() => {
- ProjectReference assemblyReference = CreateGacReference (name);
- AddReferenceToProject (assemblyReference);
- });
- }
-
- ProjectReference CreateGacReference(string name)
- {
- return new ProjectReference(ReferenceType.Package, name);
- }
-
- public string ResolvePath(string path)
- {
- return path;
- }
-
- public void AddImport(string targetPath, ProjectImportLocation location)
- {
- GuiSyncDispatch (() => {
- string relativeTargetPath = GetRelativePath (targetPath);
- string condition = GetCondition (relativeTargetPath);
- project.AddImportIfMissing (relativeTargetPath, condition);
- project.Save ();
- });
- }
-
- static string GetCondition (string targetPath)
- {
- return String.Format ("Exists('{0}')", targetPath);
- }
-
- string GetRelativePath(string path)
- {
- return MSBuildProjectService.ToMSBuildPath (project.BaseDirectory, path);
- }
-
- public void RemoveImport(string targetPath)
- {
- GuiSyncDispatch (() => {
- string relativeTargetPath = GetRelativePath (targetPath);
- project.RemoveImport (relativeTargetPath);
- RemoveImportWithForwardSlashes (targetPath);
-
- using (var updater = new EnsureNuGetPackageBuildImportsTargetUpdater ()) {
- updater.RemoveImport (relativeTargetPath);
- project.Save ();
- }
-
- packageManagementEvents.OnImportRemoved (project, relativeTargetPath);
- });
- }
-
- void RemoveImportWithForwardSlashes (string targetPath)
- {
- string relativeTargetPath = FileService.AbsoluteToRelativePath (project.BaseDirectory, targetPath);
- if (Path.DirectorySeparatorChar == '\\') {
- relativeTargetPath = relativeTargetPath.Replace ('\\', '/');
- }
- project.RemoveImport (relativeTargetPath);
- }
-
- /// <summary>
- /// NuGet sometimes uses CreateFile to replace an existing file.
- /// This happens when the XML transformation (web.config.transform) is reverted on
- /// uninstalling a NuGet package. It also happens when an XML document transform
- /// (.install.xdt, .uninstall.xdt) is run.
- /// </summary>
- public override Stream CreateFile (string path)
- {
- OnFileChanged (path);
- return base.CreateFile (path);
- }
-
- T GuiSyncDispatch<T> (Func<T> action)
- {
- T result = default(T);
- guiSyncDispatcher (() => result = action ());
- return result;
- }
-
- void GuiSyncDispatch (Action action)
- {
- guiSyncDispatcher (() => action ());
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectSystemFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectSystemFactory.cs
deleted file mode 100644
index 5faa892bd2..0000000000
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectSystemFactory.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// SharpDevelopProjectSystemFactory.cs
-//
-// Author:
-// Matt Ward <ward.matt@gmail.com>
-//
-// Copyright (C) 2012 Matthew Ward
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using MonoDevelop.Projects;
-using NuGet;
-
-namespace ICSharpCode.PackageManagement
-{
- public class SharpDevelopProjectSystemFactory : ISharpDevelopProjectSystemFactory
- {
- public IProjectSystem CreateProjectSystem(DotNetProject project)
- {
- return new SharpDevelopProjectSystem(project);
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionExtensions.cs
index c77db7ebe2..31c7a400d2 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionExtensions.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionExtensions.cs
@@ -29,18 +29,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using MonoDevelop.Core.ProgressMonitoring;
+using MonoDevelop.Core;
using MonoDevelop.Projects;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public static class SolutionExtensions
+ internal static class SolutionExtensions
{
- public static void Save(this Solution solution)
- {
- solution.Save(new NullProgressMonitor());
- }
-
public static IEnumerable<DotNetProject> GetAllDotNetProjects (this Solution solution)
{
return solution.GetAllProjects ().OfType<DotNetProject> ();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepository.cs
index da361f1f20..0f2d920814 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepository.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepository.cs
@@ -33,12 +33,12 @@ using System.Linq;
using MonoDevelop.PackageManagement;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class SolutionPackageRepository : ISolutionPackageRepository
+ internal class SolutionPackageRepository : ISolutionPackageRepository
{
SolutionPackageRepositoryPath repositoryPath;
- ISharpDevelopPackageRepositoryFactory repositoryFactory;
+ IMonoDevelopPackageRepositoryFactory repositoryFactory;
DefaultPackagePathResolver packagePathResolver;
PhysicalFileSystem fileSystem;
ISharedPackageRepository repository;
@@ -46,14 +46,14 @@ namespace ICSharpCode.PackageManagement
public SolutionPackageRepository (ISolution solution)
: this (
solution,
- new SharpDevelopPackageRepositoryFactory(),
+ new MonoDevelopPackageRepositoryFactory(),
PackageManagementServices.Options)
{
}
public SolutionPackageRepository (
ISolution solution,
- ISharpDevelopPackageRepositoryFactory repositoryFactory,
+ IMonoDevelopPackageRepositoryFactory repositoryFactory,
PackageManagementOptions options)
{
this.repositoryFactory = repositoryFactory;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepositoryFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepositoryFactory.cs
index d08e71d5c7..f33e29a16b 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepositoryFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepositoryFactory.cs
@@ -31,11 +31,11 @@ using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class SolutionPackageRepositoryFactory : ISolutionPackageRepositoryFactory
+ internal class SolutionPackageRepositoryFactory : ISolutionPackageRepositoryFactory
{
- ISharpDevelopPackageRepositoryFactory repositoryFactory;
+ IMonoDevelopPackageRepositoryFactory repositoryFactory;
PackageManagementOptions options;
public SolutionPackageRepositoryFactory()
@@ -44,7 +44,7 @@ namespace ICSharpCode.PackageManagement
}
public SolutionPackageRepositoryFactory(
- ISharpDevelopPackageRepositoryFactory repositoryFactory,
+ IMonoDevelopPackageRepositoryFactory repositoryFactory,
PackageManagementOptions options)
{
this.repositoryFactory = repositoryFactory;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepositoryPath.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepositoryPath.cs
index 60bb5b02a1..2bc36444f7 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepositoryPath.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepositoryPath.cs
@@ -32,9 +32,9 @@ using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class SolutionPackageRepositoryPath
+ internal class SolutionPackageRepositoryPath
{
ISolution solution;
DefaultPackagePathResolver pathResolver;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionProxy.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionProxy.cs
index d97c9579f8..b69b5fc984 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionProxy.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionProxy.cs
@@ -32,10 +32,11 @@ using MonoDevelop.Projects;
namespace MonoDevelop.PackageManagement
{
- public class SolutionProxy : ISolution
+ internal class SolutionProxy : ISolution
{
Solution solution;
EventHandler<DotNetProjectEventArgs> projectAdded;
+ EventHandler<DotNetProjectEventArgs> projectRemoved;
public SolutionProxy (Solution solution)
{
@@ -84,6 +85,29 @@ namespace MonoDevelop.PackageManagement
projectAdded (this, new DotNetProjectEventArgs (project));
}
}
+
+ public event EventHandler<DotNetProjectEventArgs> ProjectRemoved {
+ add {
+ if (projectRemoved == null) {
+ solution.SolutionItemRemoved += SolutionItemRemoved;
+ }
+ projectRemoved += value;
+ }
+ remove {
+ projectRemoved -= value;
+ if (projectRemoved == null) {
+ solution.SolutionItemRemoved -= SolutionItemRemoved;
+ }
+ }
+ }
+
+ void SolutionItemRemoved (object sender, SolutionItemChangeEventArgs e)
+ {
+ var project = e.SolutionItem as DotNetProject;
+ if (project != null) {
+ projectRemoved (this, new DotNetProjectEventArgs (project));
+ }
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ThreadSafePackageManagementEvents.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ThreadSafePackageManagementEvents.cs
index d85e9f4457..bbc5af1241 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ThreadSafePackageManagementEvents.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ThreadSafePackageManagementEvents.cs
@@ -34,23 +34,21 @@ using NuGet;
using MonoDevelop.PackageManagement;
using MonoDevelop.Projects;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class ThreadSafePackageManagementEvents : IThreadSafePackageManagementEvents
+ internal class ThreadSafePackageManagementEvents : IThreadSafePackageManagementEvents
{
- static Action<MessageHandler> defaultGuiSyncDispatcher = DispatchService.GuiSyncDispatch;
-
- Action<MessageHandler> guiSyncDispatcher;
+ Action<Action> guiSyncDispatcher;
IPackageManagementEvents unsafeEvents;
public ThreadSafePackageManagementEvents (IPackageManagementEvents unsafeEvents)
- : this (unsafeEvents, defaultGuiSyncDispatcher)
+ : this (unsafeEvents, MonoDevelopProjectSystem.DefaultGuiSyncDispatcher)
{
}
public ThreadSafePackageManagementEvents (
IPackageManagementEvents unsafeEvents,
- Action<MessageHandler> guiSyncDispatcher)
+ Action<Action> guiSyncDispatcher)
{
this.unsafeEvents = unsafeEvents;
this.guiSyncDispatcher = guiSyncDispatcher;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ThreadSafeProjectBrowserUpdater.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ThreadSafeProjectBrowserUpdater.cs
index 85e6475974..d3b9d94294 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ThreadSafeProjectBrowserUpdater.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ThreadSafeProjectBrowserUpdater.cs
@@ -28,9 +28,9 @@
using System;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class ThreadSafeProjectBrowserUpdater : ProjectBrowserUpdater
+ internal class ThreadSafeProjectBrowserUpdater : ProjectBrowserUpdater
{
// public ThreadSafeProjectBrowserUpdater()
// : base(GetProjectBrowserControl())
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UninstallPackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UninstallPackageAction.cs
index 44296c8438..4015de0434 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UninstallPackageAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UninstallPackageAction.cs
@@ -30,9 +30,9 @@ using System;
using System.IO;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class UninstallPackageAction : ProcessPackageAction
+ internal class UninstallPackageAction : ProcessPackageAction
{
public UninstallPackageAction(
IPackageManagementProject project,
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdateAllPackagesInProject.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdateAllPackagesInProject.cs
index d8bac043c7..31fdb59aa3 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdateAllPackagesInProject.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdateAllPackagesInProject.cs
@@ -25,12 +25,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class UpdateAllPackagesInProject : UpdatePackageActions
+ internal class UpdateAllPackagesInProject : UpdatePackageActions
{
IPackageManagementProject project;
@@ -56,6 +56,9 @@ namespace ICSharpCode.PackageManagement
{
UpdatePackageAction action = CreateDefaultUpdatePackageAction(project);
action.PackageId = package.Id;
+ if (!action.AllowPrereleaseVersions && !package.IsReleaseVersion ()) {
+ action.AllowPrereleaseVersions = true;
+ }
return action;
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdateAllPackagesInSolution.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdateAllPackagesInSolution.cs
index 2b56af8919..73c63afa38 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdateAllPackagesInSolution.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdateAllPackagesInSolution.cs
@@ -27,9 +27,9 @@ using System.Collections.Generic;
using System.Linq;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class UpdateAllPackagesInSolution : UpdatePackageActions
+ internal class UpdateAllPackagesInSolution : UpdatePackageActions
{
IPackageManagementSolution solution;
IPackageRepository sourceRepository;
@@ -73,6 +73,9 @@ namespace ICSharpCode.PackageManagement
{
UpdatePackageAction action = CreateDefaultUpdatePackageAction(project);
action.PackageId = package.Id;
+ if (!action.AllowPrereleaseVersions && !package.IsReleaseVersion ()) {
+ action.AllowPrereleaseVersions = true;
+ }
return action;
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackageAction.cs
index 3be5f36caf..8c6129780f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackageAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackageAction.cs
@@ -28,12 +28,11 @@
using System;
using System.Collections.Generic;
-using MonoDevelop.PackageManagement;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class UpdatePackageAction : ProcessPackageOperationsAction, IUpdatePackageSettings
+ internal class UpdatePackageAction : ProcessPackageOperationsAction, IUpdatePackageSettings
{
IFileRemover fileRemover;
@@ -51,11 +50,21 @@ namespace ICSharpCode.PackageManagement
IPackageManagementProject project,
IPackageManagementEvents packageManagementEvents,
IFileRemover fileRemover)
- : base (project, packageManagementEvents)
+ : this (project, packageManagementEvents, fileRemover, new LicenseAcceptanceService ())
+ {
+ }
+
+ public UpdatePackageAction (
+ IPackageManagementProject project,
+ IPackageManagementEvents packageManagementEvents,
+ IFileRemover fileRemover,
+ ILicenseAcceptanceService licenseAcceptanceService)
+ : base (project, packageManagementEvents, licenseAcceptanceService)
{
this.fileRemover = fileRemover;
UpdateDependencies = true;
UpdateIfPackageDoesNotExistInProject = true;
+ LicensesMustBeAccepted = true;
}
public bool UpdateDependencies { get; set; }
@@ -124,5 +133,12 @@ namespace ICSharpCode.PackageManagement
{
return ShouldUpdatePackage ();
}
+
+ protected override void CheckLicenses ()
+ {
+ if (ShouldUpdatePackage ()) {
+ base.CheckLicenses ();
+ }
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackageActions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackageActions.cs
index bc95a2a0e7..dc5f45b52c 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackageActions.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackageActions.cs
@@ -25,9 +25,9 @@
using System;
using System.Collections.Generic;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public abstract class UpdatePackageActions : IUpdatePackageActions
+ internal abstract class UpdatePackageActions : IUpdatePackageActions
{
public bool UpdateDependencies { get; set; }
public bool AllowPrereleaseVersions { get; set; }
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesAction.cs
index 7827037bfb..a76b2a0ad6 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesAction.cs
@@ -30,9 +30,9 @@ using System;
using System.Collections.Generic;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class UpdatePackagesAction : IUpdatePackagesAction
+ internal class UpdatePackagesAction : IUpdatePackagesAction
{
List<IPackage> packages = new List<IPackage>();
List<PackageOperation> operations = new List<PackageOperation>();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesActionFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesActionFactory.cs
index ab1a290391..4ed823a89d 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesActionFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesActionFactory.cs
@@ -32,9 +32,9 @@ using System.Linq;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class UpdatePackagesActionFactory
+ internal class UpdatePackagesActionFactory
{
ILogger logger;
IPackageManagementEvents packageManagementEvents;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesProgressMonitorStatusMessage.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesProgressMonitorStatusMessage.cs
index aaeb369b15..5b0d15ad19 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesProgressMonitorStatusMessage.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesProgressMonitorStatusMessage.cs
@@ -26,11 +26,11 @@
using System;
using System.Collections.Generic;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
namespace MonoDevelop.PackageManagement
{
- public class UpdatePackagesProgressMonitorStatusMessage : ProgressMonitorStatusMessage
+ internal class UpdatePackagesProgressMonitorStatusMessage : ProgressMonitorStatusMessage
{
UpdatedPackagesMonitor monitor;
string packagesUpToDateMessage;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdateSolutionPackagesAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdateSolutionPackagesAction.cs
index 229156a1ad..c2dc4ccfce 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdateSolutionPackagesAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdateSolutionPackagesAction.cs
@@ -31,9 +31,9 @@ using System.Collections.Generic;
using System.Linq;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class UpdateSolutionPackagesAction : IUpdatePackagesAction
+ internal class UpdateSolutionPackagesAction : IUpdatePackagesAction
{
List<IPackageFromRepository> packages = new List<IPackageFromRepository>();
List<PackageOperation> operations = new List<PackageOperation>();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackageViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackageViewModel.cs
index 4b9985eed9..d26a7ded54 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackageViewModel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackageViewModel.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class UpdatedPackageViewModel : PackageViewModel
+ internal class UpdatedPackageViewModel : PackageViewModel
{
public UpdatedPackageViewModel(
IPackageViewModelParent parent,
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackageViewModelFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackageViewModelFactory.cs
index cd6ca00324..0154ed85e5 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackageViewModelFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackageViewModelFactory.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class UpdatedPackageViewModelFactory : PackageViewModelFactory
+ internal class UpdatedPackageViewModelFactory : PackageViewModelFactory
{
SelectedProjectsForUpdatedPackages selectedProjectsForUpdatedPackages;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackages.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackages.cs
index 3d2984e654..049efda942 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackages.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackages.cs
@@ -32,9 +32,9 @@ using System.Linq;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class UpdatedPackages
+ internal class UpdatedPackages
{
IPackageRepository sourceRepository;
List<IPackageName> installedPackages;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesInProject.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesInProject.cs
index c73b1ccd6d..881a12d206 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesInProject.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesInProject.cs
@@ -31,7 +31,7 @@ using NuGet;
namespace MonoDevelop.PackageManagement
{
- public class UpdatedPackagesInProject
+ internal class UpdatedPackagesInProject
{
List<IPackageName> packages;
@@ -82,6 +82,13 @@ namespace MonoDevelop.PackageManagement
packages.Remove (package);
}
}
+
+ RemoveUninstalledPackages (packageReferences);
+ }
+
+ void RemoveUninstalledPackages (IEnumerable<PackageReference> packageReferences)
+ {
+ packages.RemoveAll (package => !packageReferences.Any (packageReference => packageReference.Id == package.Id));
}
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesInSolution.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesInSolution.cs
index 774271fab0..6ff41bc7dc 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesInSolution.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesInSolution.cs
@@ -28,14 +28,14 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.Ide;
using NuGet;
namespace MonoDevelop.PackageManagement
{
- public class UpdatedPackagesInSolution : IUpdatedPackagesInSolution
+ internal class UpdatedPackagesInSolution : IUpdatedPackagesInSolution
{
IPackageManagementSolution solution;
IRegisteredPackageRepositories registeredPackageRepositories;
@@ -132,9 +132,9 @@ namespace MonoDevelop.PackageManagement
});
}
- public void CheckForUpdatesCompleted (CheckForUpdatesTask task)
+ public void CheckForUpdatesCompleted (IEnumerable<UpdatedPackagesInProject> projects)
{
- projectsWithUpdatedPackages = task.ProjectsWithUpdatedPackages.ToList ();
+ projectsWithUpdatedPackages = projects.ToList ();
RemovePackagesUpdatedDuringCheckForUpdates ();
@@ -172,14 +172,50 @@ namespace MonoDevelop.PackageManagement
LogCheckingForUpdates (project.Name);
project.Logger = new PackageManagementLogger (packageManagementEvents);
- var updatedPackages = new UpdatedPackages (project, project.SourceRepository);
- List<IPackage> packages = updatedPackages.GetUpdatedPackages ().ToList ();
+
+ var packageReferences = project.GetPackageReferences ();
+
+ List<IPackage> packages = GetUpdatedStablePackages (project, packageReferences).ToList ();
+ packages.AddRange (GetUpdatedPrereleasePackages (project, packageReferences));
LogPackagesFound (packages.Count);
return new UpdatedPackagesInProject (project.Project, packages);
}
+ IEnumerable<IPackage> GetUpdatedStablePackages (
+ IPackageManagementProject project,
+ IEnumerable<PackageReference> packageReferences)
+ {
+ return GetUpdatedPackages (project, packageReferences, false, packageRef => packageRef.IsReleaseVersion ());
+ }
+
+ IEnumerable<IPackage> GetUpdatedPrereleasePackages (
+ IPackageManagementProject project,
+ IEnumerable<PackageReference> packageReferences)
+ {
+ return GetUpdatedPackages (project, packageReferences, true, packageRef => !packageRef.IsReleaseVersion ());
+ }
+
+ IEnumerable<IPackage> GetUpdatedPackages (
+ IPackageManagementProject project,
+ IEnumerable<PackageReference> packageReferences,
+ bool includePrerelease,
+ Func<PackageReference, bool> filter)
+ {
+ var filteredPackageReferences = packageReferences.Where (filter).ToList ();
+
+ if (!filteredPackageReferences.Any ())
+ return Enumerable.Empty <IPackage> ();
+
+ var updatedPackages = new UpdatedPackages (
+ filteredPackageReferences,
+ project.SourceRepository,
+ project.ConstraintProvider);
+
+ return updatedPackages.GetUpdatedPackages (includePrerelease);
+ }
+
void LogCheckingForUpdates (string projectName)
{
Log (GettextCatalog.GetString ("Checking {0} for updates...", projectName));
@@ -217,9 +253,9 @@ namespace MonoDevelop.PackageManagement
});
}
- protected virtual void GuiDispatch (MessageHandler handler)
+ protected virtual void GuiDispatch (Action action)
{
- DispatchService.GuiSyncDispatch (handler);
+ Runtime.RunInMainThread (action).Wait ();
}
T GuiSyncDispatch<T> (Func<T> action)
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesMonitor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesMonitor.cs
index 7e2edcbc6c..ff4b92691b 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesMonitor.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesMonitor.cs
@@ -27,12 +27,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.PackageManagement;
+using MonoDevelop.PackageManagement;
using NuGet;
namespace MonoDevelop.PackageManagement
{
- public class UpdatedPackagesMonitor : IDisposable
+ internal class UpdatedPackagesMonitor : IDisposable
{
List<IPackageManagementProject> projects;
bool packagesUpdated;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesViewModel.cs
index e268abcbf4..a808374cb3 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesViewModel.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesViewModel.cs
@@ -32,9 +32,9 @@ using System.Linq;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class UpdatedPackagesViewModel : PackagesViewModel
+ internal class UpdatedPackagesViewModel : PackagesViewModel
{
PackageManagementSelectedProjects selectedProjects;
UpdatedPackages updatedPackages;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UserAgentGeneratorForRepositoryRequests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UserAgentGeneratorForRepositoryRequests.cs
index 8d878cab00..74490b9c25 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UserAgentGeneratorForRepositoryRequests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UserAgentGeneratorForRepositoryRequests.cs
@@ -29,9 +29,9 @@
using System;
using NuGet;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public class UserAgentGeneratorForRepositoryRequests
+ internal class UserAgentGeneratorForRepositoryRequests
{
MonoDevelopHttpUserAgent userAgent = new MonoDevelopHttpUserAgent();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ViewModelBase.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ViewModelBase.cs
index c2f2798e9d..b52b29a0c9 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ViewModelBase.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ViewModelBase.cs
@@ -30,9 +30,9 @@ using System;
using System.ComponentModel;
using System.Linq.Expressions;
-namespace ICSharpCode.PackageManagement
+namespace MonoDevelop.PackageManagement
{
- public abstract class ViewModelBase<TModel> : INotifyPropertyChanged
+ internal abstract class ViewModelBase<TModel> : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/WildcardVersionSpec.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/WildcardVersionSpec.cs
index 6633e6ee45..f3d61c2575 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/WildcardVersionSpec.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/WildcardVersionSpec.cs
@@ -38,7 +38,7 @@ namespace MonoDevelop.PackageManagement
/// 1.2.3 => 1.2.3.*
/// 1.2.3.4 => 1.2.3.4
/// </summary>
- public class WildcardVersionSpec
+ internal class WildcardVersionSpec
{
string[] parts;
int wildcardPart = -1;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.HyperlinkWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.HyperlinkWidget.cs
index 32cdd17bb4..c5680531eb 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.HyperlinkWidget.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.HyperlinkWidget.cs
@@ -2,7 +2,7 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.PackageManagement
{
- public partial class HyperlinkWidget
+ internal partial class HyperlinkWidget
{
protected virtual void Build ()
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.LicenseAcceptanceDialog.cs b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.LicenseAcceptanceDialog.cs
index 2d21dc3734..3ed3189826 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.LicenseAcceptanceDialog.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.LicenseAcceptanceDialog.cs
@@ -2,17 +2,28 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.PackageManagement
{
- public partial class LicenseAcceptanceDialog
+ internal partial class LicenseAcceptanceDialog
{
+ private global::Gtk.VBox topVBox;
+
private global::Gtk.HBox subTitleHBoxForSinglePackage;
+
private global::Gtk.Label subTitleLabelForSinglePackage;
+
private global::Gtk.HBox subTitleHBoxForMultiplePackages;
+
private global::Gtk.Label subTitleLabelForMultiplePackages;
+
private global::Gtk.ScrolledWindow GtkScrolledWindow;
+
private global::Gtk.VBox packagesVBox;
+
private global::Gtk.HBox bottomMessageHBox;
+
private global::Gtk.Label mainMessageLabel;
+
private global::Gtk.Button buttonCancel;
+
private global::Gtk.Button buttonOk;
protected virtual void Build ()
@@ -20,7 +31,7 @@ namespace MonoDevelop.PackageManagement
global::Stetic.Gui.Initialize (this);
// Widget MonoDevelop.PackageManagement.LicenseAcceptanceDialog
this.Name = "MonoDevelop.PackageManagement.LicenseAcceptanceDialog";
- this.Title = global::Mono.Unix.Catalog.GetString ("License Agreements");
+ this.Title = global::Mono.Unix.Catalog.GetString ("License Acceptance");
this.WindowPosition = ((global::Gtk.WindowPosition)(1));
this.Modal = true;
// Internal child MonoDevelop.PackageManagement.LicenseAcceptanceDialog.VBox
@@ -28,42 +39,49 @@ namespace MonoDevelop.PackageManagement
w1.Name = "mainVBox";
w1.BorderWidth = ((uint)(2));
// Container child mainVBox.Gtk.Box+BoxChild
+ this.topVBox = new global::Gtk.VBox ();
+ this.topVBox.Name = "topVBox";
+ this.topVBox.Spacing = 6;
+ this.topVBox.BorderWidth = ((uint)(10));
+ // Container child topVBox.Gtk.Box+BoxChild
this.subTitleHBoxForSinglePackage = new global::Gtk.HBox ();
this.subTitleHBoxForSinglePackage.Name = "subTitleHBoxForSinglePackage";
this.subTitleHBoxForSinglePackage.Spacing = 6;
// Container child subTitleHBoxForSinglePackage.Gtk.Box+BoxChild
this.subTitleLabelForSinglePackage = new global::Gtk.Label ();
this.subTitleLabelForSinglePackage.Name = "subTitleLabelForSinglePackage";
- this.subTitleLabelForSinglePackage.LabelProp = global::Mono.Unix.Catalog.GetString ("The following package requires a click-to-accept license:");
+ this.subTitleLabelForSinglePackage.LabelProp = global::Mono.Unix.Catalog.GetString ("The following package requires that you accept the license terms before installin" +
+ "g.");
this.subTitleHBoxForSinglePackage.Add (this.subTitleLabelForSinglePackage);
global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.subTitleHBoxForSinglePackage [this.subTitleLabelForSinglePackage]));
w2.Position = 0;
w2.Expand = false;
w2.Fill = false;
- w1.Add (this.subTitleHBoxForSinglePackage);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(w1 [this.subTitleHBoxForSinglePackage]));
+ this.topVBox.Add (this.subTitleHBoxForSinglePackage);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.topVBox [this.subTitleHBoxForSinglePackage]));
w3.Position = 0;
w3.Expand = false;
w3.Fill = false;
- // Container child mainVBox.Gtk.Box+BoxChild
+ // Container child topVBox.Gtk.Box+BoxChild
this.subTitleHBoxForMultiplePackages = new global::Gtk.HBox ();
this.subTitleHBoxForMultiplePackages.Name = "subTitleHBoxForMultiplePackages";
this.subTitleHBoxForMultiplePackages.Spacing = 6;
// Container child subTitleHBoxForMultiplePackages.Gtk.Box+BoxChild
this.subTitleLabelForMultiplePackages = new global::Gtk.Label ();
this.subTitleLabelForMultiplePackages.Name = "subTitleLabelForMultiplePackages";
- this.subTitleLabelForMultiplePackages.LabelProp = global::Mono.Unix.Catalog.GetString ("The following packages require a click-to-accept license:");
+ this.subTitleLabelForMultiplePackages.LabelProp = global::Mono.Unix.Catalog.GetString ("The following packages require that you accept their license terms before install" +
+ "ing.");
this.subTitleHBoxForMultiplePackages.Add (this.subTitleLabelForMultiplePackages);
global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.subTitleHBoxForMultiplePackages [this.subTitleLabelForMultiplePackages]));
w4.Position = 0;
w4.Expand = false;
w4.Fill = false;
- w1.Add (this.subTitleHBoxForMultiplePackages);
- global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(w1 [this.subTitleHBoxForMultiplePackages]));
+ this.topVBox.Add (this.subTitleHBoxForMultiplePackages);
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.topVBox [this.subTitleHBoxForMultiplePackages]));
w5.Position = 1;
w5.Expand = false;
w5.Fill = false;
- // Container child mainVBox.Gtk.Box+BoxChild
+ // Container child topVBox.Gtk.Box+BoxChild
this.GtkScrolledWindow = new global::Gtk.ScrolledWindow ();
this.GtkScrolledWindow.Name = "GtkScrolledWindow";
this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
@@ -76,65 +94,65 @@ namespace MonoDevelop.PackageManagement
this.packagesVBox.Spacing = 6;
w6.Add (this.packagesVBox);
this.GtkScrolledWindow.Add (w6);
- w1.Add (this.GtkScrolledWindow);
- global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.GtkScrolledWindow]));
+ this.topVBox.Add (this.GtkScrolledWindow);
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.topVBox [this.GtkScrolledWindow]));
w9.Position = 2;
- w9.Padding = ((uint)(3));
- // Container child mainVBox.Gtk.Box+BoxChild
+ // Container child topVBox.Gtk.Box+BoxChild
this.bottomMessageHBox = new global::Gtk.HBox ();
this.bottomMessageHBox.Name = "bottomMessageHBox";
this.bottomMessageHBox.Spacing = 6;
// Container child bottomMessageHBox.Gtk.Box+BoxChild
this.mainMessageLabel = new global::Gtk.Label ();
this.mainMessageLabel.Name = "mainMessageLabel";
- this.mainMessageLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("By clicking \"OK\" you agree to the license terms for the packages listed above.\nIf" +
- " you do not agree to the license terms click \"Cancel\".");
+ this.mainMessageLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("By clicking Accept you agree to the license terms for the packages listed above.\n" +
+ "If you do not agree to the license terms click Decline.");
this.bottomMessageHBox.Add (this.mainMessageLabel);
global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.bottomMessageHBox [this.mainMessageLabel]));
w10.Position = 0;
w10.Expand = false;
w10.Fill = false;
- w1.Add (this.bottomMessageHBox);
- global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(w1 [this.bottomMessageHBox]));
+ this.topVBox.Add (this.bottomMessageHBox);
+ global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.topVBox [this.bottomMessageHBox]));
w11.Position = 3;
w11.Expand = false;
w11.Fill = false;
+ w1.Add (this.topVBox);
+ global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(w1 [this.topVBox]));
+ w12.Position = 0;
// Internal child MonoDevelop.PackageManagement.LicenseAcceptanceDialog.ActionArea
- global::Gtk.HButtonBox w12 = this.ActionArea;
- w12.Name = "mainButtonArea";
- w12.Spacing = 10;
- w12.BorderWidth = ((uint)(5));
- w12.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
+ global::Gtk.HButtonBox w13 = this.ActionArea;
+ w13.Name = "mainButtonArea";
+ w13.Spacing = 10;
+ w13.BorderWidth = ((uint)(5));
+ w13.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
// Container child mainButtonArea.Gtk.ButtonBox+ButtonBoxChild
this.buttonCancel = new global::Gtk.Button ();
this.buttonCancel.CanDefault = true;
this.buttonCancel.CanFocus = true;
this.buttonCancel.Name = "buttonCancel";
- this.buttonCancel.UseStock = true;
this.buttonCancel.UseUnderline = true;
- this.buttonCancel.Label = "gtk-cancel";
+ this.buttonCancel.Label = global::Mono.Unix.Catalog.GetString ("_Decline");
this.AddActionWidget (this.buttonCancel, -6);
- global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w12 [this.buttonCancel]));
- w13.Expand = false;
- w13.Fill = false;
+ global::Gtk.ButtonBox.ButtonBoxChild w14 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w13 [this.buttonCancel]));
+ w14.Expand = false;
+ w14.Fill = false;
// Container child mainButtonArea.Gtk.ButtonBox+ButtonBoxChild
this.buttonOk = new global::Gtk.Button ();
this.buttonOk.CanDefault = true;
this.buttonOk.CanFocus = true;
this.buttonOk.Name = "buttonOk";
- this.buttonOk.UseStock = true;
this.buttonOk.UseUnderline = true;
- this.buttonOk.Label = "gtk-ok";
+ this.buttonOk.Label = global::Mono.Unix.Catalog.GetString ("_Accept");
this.AddActionWidget (this.buttonOk, -5);
- global::Gtk.ButtonBox.ButtonBoxChild w14 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w12 [this.buttonOk]));
- w14.Position = 1;
- w14.Expand = false;
- w14.Fill = false;
+ global::Gtk.ButtonBox.ButtonBoxChild w15 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w13 [this.buttonOk]));
+ w15.Position = 1;
+ w15.Expand = false;
+ w15.Fill = false;
if ((this.Child != null)) {
this.Child.ShowAll ();
}
- this.DefaultWidth = 447;
- this.DefaultHeight = 300;
+ this.DefaultWidth = 494;
+ this.DefaultHeight = 365;
this.Show ();
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.ManagePackagesDialog.cs b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.ManagePackagesDialog.cs
index ba8f311f1b..828e0600a0 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.ManagePackagesDialog.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.ManagePackagesDialog.cs
@@ -2,7 +2,7 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.PackageManagement
{
- public partial class ManagePackagesDialog
+ internal partial class ManagePackagesDialog
{
private global::Gtk.Notebook notebook;
private global::MonoDevelop.PackageManagement.PackagesWidget availablePackagesWidget;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageLicenseWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageLicenseWidget.cs
index a320196190..eff892805d 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageLicenseWidget.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageLicenseWidget.cs
@@ -2,7 +2,7 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.PackageManagement
{
- public partial class PackageLicenseWidget
+ internal partial class PackageLicenseWidget
{
private global::Gtk.HBox mainHBox;
private global::Gtk.VBox packageIdVBox;
@@ -46,7 +46,10 @@ namespace MonoDevelop.PackageManagement
w2.Expand = false;
w2.Fill = false;
// Container child packageIdVBox.Gtk.Box+BoxChild
- this.licenseHyperlinkWidget = null;
+ this.licenseHyperlinkWidget = new global::MonoDevelop.PackageManagement.HyperlinkWidget ();
+ this.licenseHyperlinkWidget.Events = ((global::Gdk.EventMask)(256));
+ this.licenseHyperlinkWidget.Name = "licenseHyperlinkWidget";
+ this.licenseHyperlinkWidget.Label = global::Mono.Unix.Catalog.GetString ("View License");
this.packageIdVBox.Add (this.licenseHyperlinkWidget);
global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.packageIdVBox [this.licenseHyperlinkWidget]));
w3.Position = 1;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageManagementOptionsWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageManagementOptionsWidget.cs
index c43e0f9c0d..cb5c9dafd5 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageManagementOptionsWidget.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageManagementOptionsWidget.cs
@@ -2,7 +2,7 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.PackageManagement
{
- public partial class PackageManagementOptionsWidget
+ internal partial class PackageManagementOptionsWidget
{
private global::Gtk.VBox mainVBox;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageSourcesWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageSourcesWidget.cs
index 9359f33175..2bfbf2394b 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageSourcesWidget.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageSourcesWidget.cs
@@ -2,7 +2,7 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.PackageManagement
{
- public partial class PackageSourcesWidget
+ internal partial class PackageSourcesWidget
{
private global::Gtk.VBox mainVBox;
private global::Gtk.HBox packageSourceListHBox;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackagesWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackagesWidget.cs
index c2142af5cd..4401840b74 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackagesWidget.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackagesWidget.cs
@@ -2,58 +2,110 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.PackageManagement
{
- public partial class PackagesWidget
+ internal partial class PackagesWidget
{
private global::Gtk.HPaned mainPane;
+
private global::Gtk.VBox packagesListVBox;
+
private global::Gtk.ScrolledWindow packagesTreeScrolledWindow;
+
private global::Gtk.TreeView packagesTreeView;
+
private global::Gtk.HBox pagedResultsHBox;
+
private global::Gtk.Label pagedResultsLeftLabel;
+
private global::MonoDevelop.PackageManagement.PagedResultsWidget pagedResultsWidget;
+
private global::Gtk.Label pagedResultsRightLabel;
+
private global::Gtk.VBox packageInfoVBox;
+
private global::Gtk.ComboBox packageSourceComboBox;
+
private global::Gtk.HBox packageSearchHBox;
+
private global::Gtk.Entry packageSearchEntry;
+
private global::Gtk.Button packageSearchButton;
+
+ private global::MonoDevelop.Components.ImageView imageSearch;
+
private global::Gtk.CheckButton includePrereleaseCheckButton;
+
private global::Gtk.HButtonBox updateAllPackagesButtonBox;
+
private global::Gtk.Button updateAllPackagesButton;
+
private global::Gtk.Frame packageInfoFrame;
+
private global::Gtk.Alignment packageInfoFrameAlignment;
+
private global::Gtk.ScrolledWindow GtkScrolledWindow;
+
private global::Gtk.VBox packageInfoFrameVBox;
+
private global::Gtk.HBox packageCreatedByHBox;
+
private global::Gtk.Label packageCreatedByLabel;
+
private global::Gtk.Label packageCreatedByTextBox;
+
private global::Gtk.HBox packageIdHBox;
+
private global::Gtk.Label packageIdLabel;
+
private global::MonoDevelop.PackageManagement.HyperlinkWidget packageIdButton;
+
private global::Gtk.Label packageIdTextBox;
+
private global::Gtk.HBox packageVersionHBox;
+
private global::Gtk.Label packageVersionLabel;
+
private global::Gtk.Label packageVersionTextBox;
+
private global::Gtk.HBox packageLastUpdatedHBox;
+
private global::Gtk.Label packageLastUpdatedLabel;
+
private global::Gtk.Label packageLastUpdatedTextBox;
+
private global::Gtk.HBox packageDownloadsHBox;
+
private global::Gtk.Label packageDownloadsLabel;
+
private global::Gtk.Label packageDownloadsTextBox;
+
private global::Gtk.HBox viewLicenseTermsHBox;
+
private global::MonoDevelop.PackageManagement.HyperlinkWidget viewLicenseTermsButton;
+
private global::Gtk.HBox moreInformationHBox;
+
private global::MonoDevelop.PackageManagement.HyperlinkWidget moreInformationButton;
+
private global::Gtk.TextView packageDescriptionTextView;
+
private global::Gtk.HBox packageDependenciesHBox;
+
private global::Gtk.Label packageDependenciesLabel;
+
private global::Gtk.Label packageDependenciesNoneLabel;
+
private global::Gtk.HBox packageDependenciesListHBox;
+
private global::Gtk.Label packageDependenciesListLabel;
+
private global::Gtk.Label packageDependenciesListFillerLabel;
+
private global::Gtk.HButtonBox managePackageButtonBox;
+
private global::Gtk.Button addPackageButton;
+
private global::Gtk.Button removePackageButton;
+
private global::Gtk.Button managePackageButton;
protected virtual void Build ()
@@ -145,10 +197,12 @@ namespace MonoDevelop.PackageManagement
this.packageSearchButton = new global::Gtk.Button ();
this.packageSearchButton.CanFocus = true;
this.packageSearchButton.Name = "packageSearchButton";
- this.packageSearchButton.UseUnderline = true;
- global::Gtk.Image w10 = new global::Gtk.Image ();
- w10.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-find", global::Gtk.IconSize.Menu);
- this.packageSearchButton.Image = w10;
+ // Container child packageSearchButton.Gtk.Container+ContainerChild
+ this.imageSearch = new global::MonoDevelop.Components.ImageView ();
+ this.imageSearch.Name = "imageSearch";
+ this.imageSearch.IconId = "gtk-find";
+ this.imageSearch.IconSize = ((global::Gtk.IconSize)(1));
+ this.packageSearchButton.Add (this.imageSearch);
this.packageSearchHBox.Add (this.packageSearchButton);
global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.packageSearchHBox [this.packageSearchButton]));
w11.Position = 1;
@@ -216,7 +270,7 @@ namespace MonoDevelop.PackageManagement
// Container child packageCreatedByHBox.Gtk.Box+BoxChild
this.packageCreatedByLabel = new global::Gtk.Label ();
this.packageCreatedByLabel.Name = "packageCreatedByLabel";
- this.packageCreatedByLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span weight=\'bold\'>Created by:</span>");
+ this.packageCreatedByLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span weight='bold'>Created by:</span>");
this.packageCreatedByLabel.UseMarkup = true;
this.packageCreatedByHBox.Add (this.packageCreatedByLabel);
global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.packageCreatedByHBox [this.packageCreatedByLabel]));
@@ -244,7 +298,7 @@ namespace MonoDevelop.PackageManagement
// Container child packageIdHBox.Gtk.Box+BoxChild
this.packageIdLabel = new global::Gtk.Label ();
this.packageIdLabel.Name = "packageIdLabel";
- this.packageIdLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span weight=\'bold\'>Id:</span>");
+ this.packageIdLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span weight='bold'>Id:</span>");
this.packageIdLabel.UseMarkup = true;
this.packageIdHBox.Add (this.packageIdLabel);
global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.packageIdHBox [this.packageIdLabel]));
@@ -277,7 +331,7 @@ namespace MonoDevelop.PackageManagement
// Container child packageVersionHBox.Gtk.Box+BoxChild
this.packageVersionLabel = new global::Gtk.Label ();
this.packageVersionLabel.Name = "packageVersionLabel";
- this.packageVersionLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span weight=\'bold\'>Version:</span>");
+ this.packageVersionLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span weight='bold'>Version:</span>");
this.packageVersionLabel.UseMarkup = true;
this.packageVersionHBox.Add (this.packageVersionLabel);
global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.packageVersionHBox [this.packageVersionLabel]));
@@ -305,7 +359,7 @@ namespace MonoDevelop.PackageManagement
// Container child packageLastUpdatedHBox.Gtk.Box+BoxChild
this.packageLastUpdatedLabel = new global::Gtk.Label ();
this.packageLastUpdatedLabel.Name = "packageLastUpdatedLabel";
- this.packageLastUpdatedLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span weight=\'bold\'>Last Updated:</span>");
+ this.packageLastUpdatedLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span weight='bold'>Last Updated:</span>");
this.packageLastUpdatedLabel.UseMarkup = true;
this.packageLastUpdatedHBox.Add (this.packageLastUpdatedLabel);
global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.packageLastUpdatedHBox [this.packageLastUpdatedLabel]));
@@ -333,7 +387,7 @@ namespace MonoDevelop.PackageManagement
// Container child packageDownloadsHBox.Gtk.Box+BoxChild
this.packageDownloadsLabel = new global::Gtk.Label ();
this.packageDownloadsLabel.Name = "packageDownloadsLabel";
- this.packageDownloadsLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span weight=\'bold\'>Downloads:</span>");
+ this.packageDownloadsLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span weight='bold'>Downloads:</span>");
this.packageDownloadsLabel.UseMarkup = true;
this.packageDownloadsHBox.Add (this.packageDownloadsLabel);
global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(this.packageDownloadsHBox [this.packageDownloadsLabel]));
@@ -397,7 +451,7 @@ namespace MonoDevelop.PackageManagement
// Container child packageDependenciesHBox.Gtk.Box+BoxChild
this.packageDependenciesLabel = new global::Gtk.Label ();
this.packageDependenciesLabel.Name = "packageDependenciesLabel";
- this.packageDependenciesLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span weight=\'bold\'>Dependencies:</span>");
+ this.packageDependenciesLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span weight='bold'>Dependencies:</span>");
this.packageDependenciesLabel.UseMarkup = true;
this.packageDependenciesHBox.Add (this.packageDependenciesLabel);
global::Gtk.Box.BoxChild w38 = ((global::Gtk.Box.BoxChild)(this.packageDependenciesHBox [this.packageDependenciesLabel]));
diff --git a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PagedResultsWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PagedResultsWidget.cs
index 6b92bee148..620fb8dba1 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PagedResultsWidget.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PagedResultsWidget.cs
@@ -2,16 +2,27 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.PackageManagement
{
- public partial class PagedResultsWidget
+ internal partial class PagedResultsWidget
{
private global::Gtk.HBox mainHBox;
+
private global::Gtk.Button backButton;
+
+ private global::MonoDevelop.Components.ImageView imageBack;
+
private global::Gtk.Button firstButton;
+
private global::Gtk.Button secondButton;
+
private global::Gtk.Button thirdButton;
+
private global::Gtk.Button fourthButton;
+
private global::Gtk.Button fifthButton;
+
private global::Gtk.Button forwardButton;
+
+ private global::MonoDevelop.Components.ImageView imageForward;
protected virtual void Build ()
{
@@ -28,9 +39,12 @@ namespace MonoDevelop.PackageManagement
this.backButton.Name = "backButton";
this.backButton.FocusOnClick = false;
this.backButton.Relief = ((global::Gtk.ReliefStyle)(2));
- global::Gtk.Image w1 = new global::Gtk.Image ();
- w1.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-back", global::Gtk.IconSize.Menu);
- this.backButton.Image = w1;
+ // Container child backButton.Gtk.Container+ContainerChild
+ this.imageBack = new global::MonoDevelop.Components.ImageView ();
+ this.imageBack.Name = "imageBack";
+ this.imageBack.IconId = "gtk-go-back";
+ this.imageBack.IconSize = ((global::Gtk.IconSize)(1));
+ this.backButton.Add (this.imageBack);
this.mainHBox.Add (this.backButton);
global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.mainHBox [this.backButton]));
w2.Position = 0;
@@ -103,9 +117,12 @@ namespace MonoDevelop.PackageManagement
this.forwardButton.Name = "forwardButton";
this.forwardButton.FocusOnClick = false;
this.forwardButton.Relief = ((global::Gtk.ReliefStyle)(2));
- global::Gtk.Image w8 = new global::Gtk.Image ();
- w8.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-forward", global::Gtk.IconSize.Menu);
- this.forwardButton.Image = w8;
+ // Container child forwardButton.Gtk.Container+ContainerChild
+ this.imageForward = new global::MonoDevelop.Components.ImageView ();
+ this.imageForward.Name = "imageForward";
+ this.imageForward.IconId = "gtk-go-forward";
+ this.imageForward.IconSize = ((global::Gtk.IconSize)(1));
+ this.forwardButton.Add (this.imageForward);
this.mainHBox.Add (this.forwardButton);
global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.mainHBox [this.forwardButton]));
w9.Position = 6;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.SelectProjectsDialog.cs b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.SelectProjectsDialog.cs
index 9b20ebd3ce..65295f4e5e 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.SelectProjectsDialog.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.SelectProjectsDialog.cs
@@ -2,7 +2,7 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.PackageManagement
{
- public partial class SelectProjectsDialog
+ internal partial class SelectProjectsDialog
{
private global::Gtk.HBox installLabelHBox;
private global::Gtk.Label installLabel;
diff --git a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/generated.cs b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/generated.cs
index df4abc38da..97249fd82d 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/generated.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/generated.cs
@@ -68,44 +68,6 @@ namespace Stetic
}
}
- internal class IconLoader
- {
- public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size)
- {
- Gdk.Pixbuf res = widget.RenderIcon (name, size, null);
- if ((res != null)) {
- return res;
- } else {
- int sz;
- int sy;
- global::Gtk.Icon.SizeLookup (size, out sz, out sy);
- try {
- return Gtk.IconTheme.Default.LoadIcon (name, sz, 0);
- } catch (System.Exception) {
- if ((name != "gtk-missing-image")) {
- return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size);
- } else {
- Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz);
- Gdk.GC gc = new Gdk.GC (pmap);
- gc.RgbFgColor = new Gdk.Color (255, 255, 255);
- pmap.DrawRectangle (gc, true, 0, 0, sz, sz);
- gc.RgbFgColor = new Gdk.Color (0, 0, 0);
- pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1));
- gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
- gc.RgbFgColor = new Gdk.Color (255, 0, 0);
- pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1)
- - (sz / 4)), ((sz - 1)
- - (sz / 4)));
- pmap.DrawLine (gc, ((sz - 1)
- - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1)
- - (sz / 4)));
- return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
- }
- }
- }
- }
- }
-
internal class ActionGroups
{
public static Gtk.ActionGroup GetActionGroup (System.Type type)
diff --git a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/gui.stetic b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/gui.stetic
index f92e7e0b54..9a7a6284dc 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/gui.stetic
+++ b/main/src/addins/MonoDevelop.PackageManagement/gtk-gui/gui.stetic
@@ -284,11 +284,15 @@
<widget class="Gtk.Button" id="packageSearchButton">
<property name="MemberName" />
<property name="CanFocus">True</property>
- <property name="Type">TextAndIcon</property>
- <property name="Icon">stock:gtk-find Menu</property>
- <property name="Label" translatable="yes" />
- <property name="UseUnderline">True</property>
+ <property name="Type">Custom</property>
<signal name="Clicked" handler="SearchButtonClicked" />
+ <child>
+ <widget class="MonoDevelop.Components.ImageView" id="imageSearch">
+ <property name="MemberName" />
+ <property name="IconId">gtk-find</property>
+ <property name="IconSize">Menu</property>
+ </widget>
+ </child>
</widget>
<packing>
<property name="Position">1</property>
@@ -787,9 +791,9 @@
<placeholder />
</child>
</widget>
- <widget class="Gtk.Dialog" id="MonoDevelop.PackageManagement.LicenseAcceptanceDialog" design-size="447 300">
+ <widget class="Gtk.Dialog" id="MonoDevelop.PackageManagement.LicenseAcceptanceDialog" design-size="494 365">
<property name="MemberName" />
- <property name="Title" translatable="yes">License Agreements</property>
+ <property name="Title" translatable="yes">License Acceptance</property>
<property name="WindowPosition">Center</property>
<property name="Modal">True</property>
<property name="Buttons">2</property>
@@ -799,13 +803,29 @@
<property name="MemberName" />
<property name="BorderWidth">2</property>
<child>
- <widget class="Gtk.HBox" id="subTitleHBoxForSinglePackage">
+ <widget class="Gtk.VBox" id="topVBox">
<property name="MemberName" />
<property name="Spacing">6</property>
+ <property name="BorderWidth">10</property>
<child>
- <widget class="Gtk.Label" id="subTitleLabelForSinglePackage">
+ <widget class="Gtk.HBox" id="subTitleHBoxForSinglePackage">
<property name="MemberName" />
- <property name="LabelProp" translatable="yes">The following package requires a click-to-accept license:</property>
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="subTitleLabelForSinglePackage">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">The following package requires that you accept the license terms before installing.</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder />
+ </child>
</widget>
<packing>
<property name="Position">0</property>
@@ -815,96 +835,90 @@
</packing>
</child>
<child>
- <placeholder />
- </child>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.HBox" id="subTitleHBoxForMultiplePackages">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.Label" id="subTitleLabelForMultiplePackages">
+ <widget class="Gtk.HBox" id="subTitleHBoxForMultiplePackages">
<property name="MemberName" />
- <property name="LabelProp" translatable="yes">The following packages require a click-to-accept license:</property>
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="subTitleLabelForMultiplePackages">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">The following packages require that you accept their license terms before installing.</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder />
+ </child>
</widget>
<packing>
- <property name="Position">0</property>
+ <property name="Position">1</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
- <placeholder />
- </child>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
- <property name="MemberName" />
- <property name="ShadowType">In</property>
- <child>
- <widget class="Gtk.Viewport" id="GtkViewport">
+ <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
<property name="MemberName" />
- <property name="ShadowType">None</property>
+ <property name="ShadowType">In</property>
<child>
- <widget class="Gtk.VBox" id="packagesVBox">
+ <widget class="Gtk.Viewport" id="GtkViewport">
<property name="MemberName" />
- <property name="ShowScrollbars">True</property>
- <property name="Spacing">6</property>
+ <property name="ShadowType">None</property>
<child>
- <placeholder />
+ <widget class="Gtk.VBox" id="packagesVBox">
+ <property name="MemberName" />
+ <property name="ShowScrollbars">True</property>
+ <property name="Spacing">6</property>
+ <child>
+ <placeholder />
+ </child>
+ </widget>
</child>
</widget>
</child>
</widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">True</property>
+ </packing>
</child>
- </widget>
- <packing>
- <property name="Position">2</property>
- <property name="AutoSize">True</property>
- <property name="Padding">3</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.HBox" id="bottomMessageHBox">
- <property name="MemberName" />
- <property name="Spacing">6</property>
<child>
- <widget class="Gtk.Label" id="mainMessageLabel">
+ <widget class="Gtk.HBox" id="bottomMessageHBox">
<property name="MemberName" />
- <property name="LabelProp" translatable="yes">By clicking "OK" you agree to the license terms for the packages listed above.
-If you do not agree to the license terms click "Cancel".</property>
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="mainMessageLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">By clicking Accept you agree to the license terms for the packages listed above.
+If you do not agree to the license terms click Decline.</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder />
+ </child>
</widget>
<packing>
- <property name="Position">0</property>
+ <property name="Position">3</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
- <child>
- <placeholder />
- </child>
</widget>
<packing>
- <property name="Position">3</property>
+ <property name="Position">0</property>
<property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
</packing>
</child>
</widget>
@@ -921,11 +935,10 @@ If you do not agree to the license terms click "Cancel".</property>
<property name="MemberName" />
<property name="CanDefault">True</property>
<property name="CanFocus">True</property>
- <property name="UseStock">True</property>
- <property name="Type">StockItem</property>
- <property name="StockId">gtk-cancel</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">_Decline</property>
+ <property name="UseUnderline">True</property>
<property name="ResponseId">-6</property>
- <property name="label">gtk-cancel</property>
</widget>
<packing>
<property name="Expand">False</property>
@@ -937,11 +950,10 @@ If you do not agree to the license terms click "Cancel".</property>
<property name="MemberName" />
<property name="CanDefault">True</property>
<property name="CanFocus">True</property>
- <property name="UseStock">True</property>
- <property name="Type">StockItem</property>
- <property name="StockId">gtk-ok</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">_Accept</property>
+ <property name="UseUnderline">True</property>
<property name="ResponseId">-5</property>
- <property name="label">gtk-ok</property>
</widget>
<packing>
<property name="Position">1</property>
@@ -1366,12 +1378,17 @@ If you do not agree to the license terms click "Cancel".</property>
<widget class="Gtk.Button" id="backButton">
<property name="MemberName" />
<property name="CanFocus">True</property>
- <property name="Type">TextAndIcon</property>
- <property name="Icon">stock:gtk-go-back Menu</property>
- <property name="Label" translatable="yes" />
+ <property name="Type">Custom</property>
<property name="FocusOnClick">False</property>
<property name="Relief">None</property>
<signal name="Clicked" handler="BackButtonClicked" />
+ <child>
+ <widget class="MonoDevelop.Components.ImageView" id="imageBack">
+ <property name="MemberName" />
+ <property name="IconId">gtk-go-back</property>
+ <property name="IconSize">Menu</property>
+ </widget>
+ </child>
</widget>
<packing>
<property name="Position">0</property>
@@ -1470,12 +1487,17 @@ If you do not agree to the license terms click "Cancel".</property>
<widget class="Gtk.Button" id="forwardButton">
<property name="MemberName" />
<property name="CanFocus">True</property>
- <property name="Type">TextAndIcon</property>
- <property name="Icon">stock:gtk-go-forward Menu</property>
- <property name="Label" translatable="yes" />
+ <property name="Type">Custom</property>
<property name="FocusOnClick">False</property>
<property name="Relief">None</property>
<signal name="Clicked" handler="ForwardButtonClicked" />
+ <child>
+ <widget class="MonoDevelop.Components.ImageView" id="imageForward">
+ <property name="MemberName" />
+ <property name="IconId">gtk-go-forward</property>
+ <property name="IconSize">Menu</property>
+ </widget>
+ </child>
</widget>
<packing>
<property name="Position">6</property>
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/package-48.png b/main/src/addins/MonoDevelop.PackageManagement/icons/package-48.png
new file mode 100644
index 0000000000..6dbcbea034
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/package-48.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/package-48@2x.png b/main/src/addins/MonoDevelop.PackageManagement/icons/package-48@2x.png
new file mode 100644
index 0000000000..0484944163
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/package-48@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/package-48~dark.png b/main/src/addins/MonoDevelop.PackageManagement/icons/package-48~dark.png
new file mode 100644
index 0000000000..2fb74b25c1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/package-48~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/package-48~dark@2x.png b/main/src/addins/MonoDevelop.PackageManagement/icons/package-48~dark@2x.png
new file mode 100644
index 0000000000..07520b847c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/package-48~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/package-48~dark~sel.png b/main/src/addins/MonoDevelop.PackageManagement/icons/package-48~dark~sel.png
new file mode 100644
index 0000000000..7fec138598
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/package-48~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/package-48~dark~sel@2x.png b/main/src/addins/MonoDevelop.PackageManagement/icons/package-48~dark~sel@2x.png
new file mode 100644
index 0000000000..e134ffbf43
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/package-48~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/package-48~sel.png b/main/src/addins/MonoDevelop.PackageManagement/icons/package-48~sel.png
new file mode 100644
index 0000000000..7fec138598
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/package-48~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/package-48~sel@2x.png b/main/src/addins/MonoDevelop.PackageManagement/icons/package-48~sel@2x.png
new file mode 100644
index 0000000000..e134ffbf43
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/package-48~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32.png b/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32.png
index 7e19f0f3b1..7aef0ee9bd 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32.png
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32@2x.png b/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32@2x.png
index 3894330a48..794f6171dd 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32@2x.png
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~dark.png b/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~dark.png
new file mode 100644
index 0000000000..e94c8ac213
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~dark@2x.png b/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~dark@2x.png
new file mode 100644
index 0000000000..152e07daf7
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~dark~sel.png b/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~dark~sel.png
new file mode 100644
index 0000000000..28260cb4c2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~dark~sel@2x.png b/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~dark~sel@2x.png
new file mode 100644
index 0000000000..f2110151b7
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~sel.png b/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~sel.png
new file mode 100644
index 0000000000..28260cb4c2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~sel@2x.png b/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~sel@2x.png
new file mode 100644
index 0000000000..f2110151b7
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/package-source-32~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16.png b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16.png
index b441192270..7db9d7157e 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16.png
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16@2x.png b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16@2x.png
index a59c599aca..43064c4e34 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16@2x.png
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~dark.png b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~dark.png
new file mode 100644
index 0000000000..eed666c26f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~dark@2x.png b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~dark@2x.png
new file mode 100644
index 0000000000..a09bb7df42
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~dark~sel.png b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~dark~sel.png
new file mode 100644
index 0000000000..d61c5c8698
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~dark~sel@2x.png
new file mode 100644
index 0000000000..638b4a730a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~sel.png b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~sel.png
new file mode 100644
index 0000000000..d61c5c8698
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~sel@2x.png b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~sel@2x.png
new file mode 100644
index 0000000000..638b4a730a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16.png b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16.png
index c01c3f5eb0..9850050463 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16.png
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16@2x.png b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16@2x.png
index 7e19f0f3b1..7aef0ee9bd 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16@2x.png
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~dark.png b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~dark.png
new file mode 100644
index 0000000000..593d3a8b96
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~dark@2x.png b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~dark@2x.png
new file mode 100644
index 0000000000..501ead7b45
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~dark~sel.png b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~dark~sel.png
new file mode 100644
index 0000000000..e3aee767a7
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~dark~sel@2x.png
new file mode 100644
index 0000000000..6b8d55dfed
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~sel.png b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~sel.png
new file mode 100644
index 0000000000..e3aee767a7
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~sel@2x.png b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~sel@2x.png
new file mode 100644
index 0000000000..6b8d55dfed
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/icons/prefs-package-source-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/reference-48.png b/main/src/addins/MonoDevelop.PackageManagement/icons/reference-48.png
deleted file mode 100644
index 7301fbb0fe..0000000000
--- a/main/src/addins/MonoDevelop.PackageManagement/icons/reference-48.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/icons/reference-48@2x.png b/main/src/addins/MonoDevelop.PackageManagement/icons/reference-48@2x.png
deleted file mode 100644
index e66a2f6dbc..0000000000
--- a/main/src/addins/MonoDevelop.PackageManagement/icons/reference-48@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/AddinInfo.cs b/main/src/addins/MonoDevelop.Refactoring/AddinInfo.cs
index 1dd2ad8160..7374e7dd61 100644
--- a/main/src/addins/MonoDevelop.Refactoring/AddinInfo.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/AddinInfo.cs
@@ -15,3 +15,5 @@ using Mono.Addins.Description;
[assembly:AddinDependency ("Ide", MonoDevelop.BuildInfo.Version)]
[assembly:AddinDependency ("DesignerSupport", MonoDevelop.BuildInfo.Version)]
[assembly:AddinDependency ("SourceEditor2", MonoDevelop.BuildInfo.Version)]
+[assembly:AddinDependency ("RegexToolkit", MonoDevelop.BuildInfo.Version)]
+ \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.Refactoring/AssemblyInfo.cs b/main/src/addins/MonoDevelop.Refactoring/AssemblyInfo.cs
index c787015813..430de1984b 100644
--- a/main/src/addins/MonoDevelop.Refactoring/AssemblyInfo.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/AssemblyInfo.cs
@@ -7,3 +7,7 @@ using System.Reflection;
[assembly: AssemblyDescription ("Provides refactoring support to MonoDevelop")]
[assembly: AssemblyVersion ("2.6")]
[assembly: AssemblyCopyright ("X11")]
+[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("FSharpBinding")]
+[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("MonoDevelop.CSharpBinding")]
+[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("MonoDevelop.PackageManagement")]
+[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("MonoDevelop.MonoDroid")]
diff --git a/main/src/addins/MonoDevelop.Refactoring/ChangeLog b/main/src/addins/MonoDevelop.Refactoring/ChangeLog
deleted file mode 100644
index 4ca6ea8bd6..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/ChangeLog
+++ /dev/null
@@ -1,1991 +0,0 @@
-2010-07-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeGeneration/CodeGenerationCommands.cs: Use
- delegation methods.
-
-2010-07-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.IntroduceFormatItem/IntroduceFormatItemRefactoring.cs:
- Track API changes.
-
-2010-07-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoringService.cs: Track API
- changes.
-
- * MonoDevelop.Refactoring.ConvertPropery/RemoveBackingStore.cs:
- Remove empty line of the backing store.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/Change.cs:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring/RefactoringOptions.cs:
- * MonoDevelop.Refactoring/ImportSymbolHandler.cs:
- * MonoDevelop.CodeGeneration/PropertyGenerator.cs:
- * MonoDevelop.CodeGeneration/WriteLineGenerator.cs:
- * MonoDevelop.CodeGeneration/CodeGenerationOptions.cs:
- * MonoDevelop.CodeGeneration/AbstractGenerateAction.cs:
- * MonoDevelop.CodeGeneration/CodeGenerationCommands.cs:
- * MonoDevelop.CodeGeneration/OverrideMembersGenerator.cs:
- * MonoDevelop.Refactoring.ConvertPropery/RemoveBackingStore.cs:
- * MonoDevelop.Refactoring.CreateClass/CreateClassCodeGenerator.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- * MonoDevelop.Refactoring.MoveTypeToFile/MoveTypeToFileRefactoring.cs:
- * MonoDevelop.Refactoring.ImplementInterface/ImplementAbstractMembers.cs:
- * MonoDevelop.Refactoring.RefactorImports/RemoveUnusedImportsRefactoring.cs:
- * MonoDevelop.Refactoring.IntroduceFormatItem/IntroduceFormatItemRefactoring.cs:
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable/IntegrateTemporaryVariableRefactoring.cs:
- Track API changes.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring/RefactoringOptions.cs:
- * MonoDevelop.CodeGeneration/WriteLineGenerator.cs:
- * MonoDevelop.CodeGeneration/CodeGenerationOptions.cs:
- * MonoDevelop.CodeGeneration/CodeGenerationCommands.cs:
- * MonoDevelop.Refactoring.ConvertPropery/RemoveBackingStore.cs:
- * MonoDevelop.Refactoring.CreateClass/CreateClassCodeGenerator.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- * MonoDevelop.Refactoring.MoveTypeToFile/MoveTypeToFileRefactoring.cs:
- * MonoDevelop.Refactoring.ImplementInterface/ImplementAbstractMembers.cs:
- * MonoDevelop.Refactoring.RefactorImports/RemoveUnusedImportsRefactoring.cs:
- * MonoDevelop.Refactoring.IntroduceFormatItem/IntroduceFormatItemRefactoring.cs:
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable/IntegrateTemporaryVariableRefactoring.cs:
- Use texteditordata infrastructure.
-
-2010-07-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.IntroduceConstant/IntroduceConstantRefactoring.cs:
- * MonoDevelop.Refactoring.IntroduceFormatItem/IntroduceFormatItemRefactoring.cs:
- Track API changes.
-
-2010-07-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Refactoring/RefactoringOptions.cs:
- * MonoDevelop.CodeGeneration/CodeGenerationOptions.cs: Track
- ProjectDomService/Parser API.
-
-2010-06-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/ImportSymbolHandler.cs: fixed
- cut&paste error.
-
-2010-06-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/ImportSymbolHandler.cs: Fixed 'Bug
- 616653 - "import symbol" does not resolve full typenames'.
-
-2010-06-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodDialog.cs:
- Implemented 'Bug 615701 - Escape should cancel renaming
- refactor action, not accept it'.
-
-2010-06-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/EncapsulateFieldDialog.cs:
- * MonoDevelop.Refactoring/OverridesImplementsDialog.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodDialog.cs:
- * MonoDevelop.Refactoring.ImplementInterface/ImplementImplicit.cs:
- * MonoDevelop.Refactoring.ImplementInterface/ImplementExplicit.cs:
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- Added help windows for refactorings that use the insertion
- point mode.
-
-2010-06-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Refactoring/OverridesImplementsDialog.cs:
- * MonoDevelop.CodeGeneration/OverrideMembersGenerator.cs:
- Track API.
-
-2010-06-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- Improved parameter naming of created methods.
-
-2010-06-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- added null check.
-
-2010-06-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/HelperMethods.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- Create method now uses insertion cursor.
-
-2010-06-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- fixed null reference exception.
-
-2010-06-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/HelperMethods.cs:
- * MonoDevelop.CodeGeneration/ToStringGenerator.cs:
- * MonoDevelop.CodeGeneration/PropertyGenerator.cs:
- * MonoDevelop.CodeGeneration/NullCheckGenerator.cs:
- * MonoDevelop.CodeGeneration/WriteLineGenerator.cs:
- * MonoDevelop.Refactoring/EncapsulateFieldDialog.cs:
- * MonoDevelop.CodeGeneration/AbstractGenerateAction.cs:
- * MonoDevelop.Refactoring/OverridesImplementsDialog.cs:
- * MonoDevelop.CodeGeneration/OverrideMembersGenerator.cs:
- * MonoDevelop.CodeGeneration/EqualityMembersGenerator.cs:
- * MonoDevelop.CodeGeneration/RaiseEventMethodGenerator.cs:
- * MonoDevelop.CodeGeneration/CreateConstructorGenerator.cs:
- * MonoDevelop.Refactoring.ImplementInterface/ImplementImplicit.cs:
- * MonoDevelop.Refactoring.ImplementInterface/ImplementExplicit.cs:
- Code generator get's now used by code completion auto
- generation & insert code feature.
-
-2010-06-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring/EncapsulateFieldDialog.cs:
- * MonoDevelop.Refactoring/OverridesImplementsDialog.cs: Worked
- on code generation.
-
-2010-06-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/HelperMethods.cs:
- * MonoDevelop.Refactoring.ImplementInterface/ImplementImplicit.cs:
- * MonoDevelop.Refactoring.ImplementInterface/ImplementExplicit.cs:
- Extracted indent level calculation.
-
-2010-06-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/HelperMethods.cs:
- * MonoDevelop.Refactoring.ImplementInterface/ImplementImplicit.cs:
- * MonoDevelop.Refactoring.ImplementInterface/ImplementExplicit.cs:
- Worked on refactoring - corrected interface formatting.
-
-2010-06-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/EncapsulateFieldDialog.cs: fixed
- compilation error.
-
-2010-06-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/HelperMethods.cs:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring/EncapsulateFieldDialog.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- Worked on insertioncursor edit mode.
-
-2010-05-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/HelperMethods.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodDialog.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- Worked on new member positioning.
-
-2010-05-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/HelperMethods.cs:
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodDialog.cs:
- * MonoDevelop.Refactoring.ConvertPropery/CreateBackingStore.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Worked on refactoring.
-
-2010-05-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- Fixed 'Bug 609221 - Refactor->"Create Method" does not infer
- type for parameter from LINQ query'.
-
-2010-05-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- handle null obj.
-
-2010-05-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ConvertPropery/CreateBackingStore.cs:
- Fixed 'Bug 609278 - Add backing store doesn't remove
- namespace from backing field'.
-
-2010-05-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- Fixed 'Bug 558372 - Code parser is interpreting classname as
- method name'.
-
-2010-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs: Use
- ShowCustomDialog (which destroys the dialog when done)
- instead of RunCustomDialog (which doesn't).
-
-2010-05-25 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Refactoring.Rename/RenameItemDialog.cs:
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs:
- * gtk-gui/MonoDevelop.Refactoring.EncapsulateFieldDialog.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodDialog.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- * MonoDevelop.Refactoring.IntroduceConstant/IntroduceConstantDialog.cs:
- * MonoDevelop.Refactoring.IntroduceConstant/IntroduceConstantRefactoring.cs:
- Fixed 'Bug 607994 - Cancelling "Extract Method" dialog needs
- Esc to be hit twice' & centered refactoring dialogs on the
- mac.
-
-2010-05-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ExtractMethod/VariableLookupVisitor.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- Fixed 'Bug 607990 - "Extract Method" refactoring sometimes
- tries to pass in unnecessary parameter depending on
- selection'
-
-2010-05-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Fixed 'Bug 607984 - Over-zealous "Declare Local" refactoring
- renames within string'.
-
-2010-05-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- More dialog placing.
-
-2010-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/MonoDevelop.Refactoring.EncapsulateFieldDialog.cs:
- Flush.
-
-2010-05-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.RefactorImports/FindTypeReferencesVisitor.cs:
- Check for valid end position before cutting text.
-
-2010-05-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.RefactorImports/SortImportsRefactoring.cs:
- Implemented 'Bug 606848 - Organize Usings does not order
- System before other elements'.
-
-2010-05-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.CreateClass/CreateClassCodeGenerator.cs:
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- Implemented 'Bug 580806 - Feature request: Show resolve-menu
- (extract method) when calling method with wrong signature'.
-
-2010-05-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.MoveTypeToFile/MoveTypeToFileRefactoring.cs:
- Fixed 'Bug 593525 - Moving a class to a separate file causes
- attributes for that class, in the original source file...'.
-
-2010-05-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- handle invalid regions.
-
-2010-05-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeGeneration/GenerateCodeWindow.cs: Added
- multi monitor support.
-
-2010-05-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs: fixed warning.
-
-2010-05-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/ImportSymbolHandler.cs: Track API
- changes.
-
-2010-05-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable/IntegrateTemporaryVariableRefactoring.cs:
- Track api changes in the command service.
-
-2010-05-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.addin.xml: Changed some mac
- shortcuts.
-
-2010-05-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.Rename/RenameItemDialog.cs: Improved
- the class renaming behaviour. (Bug 603938 - Renaming a Class
- in a file with multiple classes renames the file)
-
-2010-05-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs: Fixed
- 'Bug 604085 - Renaming C# method inserts wrong name.'.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring/ImportSymbolHandler.cs:
- * MonoDevelop.Refactoring/FindReferencesHandler.cs:
- * MonoDevelop.Refactoring/GotoDeclarationHandler.cs:
- * MonoDevelop.CodeGeneration/CodeGenerationOptions.cs:
- * MonoDevelop.Refactoring/FindDerivedClassesHandler.cs:
- * MonoDevelop.Refactoring/AbstractRefactoringCommandHandler.cs:
- Make use of the Document.Dom property.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/ImportSymbolHandler.cs: Check if the
- file has a valid compilation unit.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/ImportSymbolHandler.cs: checked for
- valid dom.
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/ImportSymbolHandler.cs: Fixed 'Bug
- 601738 - Import Type list not sorted'.
-
-2010-04-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/ImportSymbolHandler.cs: Cached
- import symbol handler data.
-
-2010-04-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ConvertPropery/RemoveBackingStore.cs:
- Fixed 'Bug 601136 - Remove backing store refactoring is
- broken'.
-
-2010-04-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Refactoring.addin.xml: Make Mac import symbol
- consistent with Linux/Windows.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/ImportSymbolHandler.cs: Optimized
- performance a bit.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/ImportSymbolHandler.cs: fixed
- 'insertNamespace' feature.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/ImportSymbolHandler.cs: Generate
- descriptions for the types to insert.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs: fixed
- 'Bug 599635 - In-place rename should select name'.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring/ImportSymbolHandler.cs: Implemented
- 'Bug 596515 - Import Symbol completion command'.
-
-2010-04-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/QuickFixHandler.cs: track API
- changes.
-
-2010-04-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable/IntegrateTemporaryVariableRefactoring.cs:
- Fixed unit tests.
-
-2010-04-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.Rename/RenameItemDialog.cs: Fixed
- 'Bug 595604 - Renaming a constructor should rename the
- class'.
-
-2010-04-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/Change.cs:
- * MonoDevelop.Refactoring/RefactoringOptions.cs:
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- Use the new TextEditorData property from Document.
-
-2010-04-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/QuickFixHandler.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- Fixed unit tests
-
-2010-04-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- fixed 'Bug 595597 - "Create Method" refactoring uses full
- namespace'.
-
-2010-04-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs:
- Implemented 'Bug 595585 - Allow in-place variable renaming'.
-
-2010-04-12 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable/IntegrateTemporaryVariableHandler.cs:
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable/IntegrateTemporaryVariableRefactoring.cs:
- Fixed 'Bug 595580 - Add default key-bindings for currently
- unbindable refactoring actions'.
-
-2010-04-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeGeneration/GenerateCodeWindow.cs: Fixed 'Bug
- 595175 - Code generator window displays offscreen'.
-
-2010-04-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.RefactorImports/FindTypeReferencesVisitor.cs:
- * MonoDevelop.Refactoring.RefactorImports/RemoveUnusedImportsRefactoring.cs:
- Fixed 'Bug 595558 - "Remove unused usings" sometimes removes
- usings that aren't unused'.
-
-2010-04-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs: Fixed 'Bug
- 546446 - Find references shows usages of overloads'.
-
-2010-04-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/INRefactoryASTProvider.cs:
- * MonoDevelop.Refactoring.ExtractMethod/VariableLookupVisitor.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- Fixed 'Bug 545634 - Create method goes wrong in situation'.
-
-2010-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.IntroduceFormatItem/IntroduceFormatItemRefactoring.cs:
- Fixed failing unit test.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Refactoring.addin.xml: Bumped MD version.
-
-2010-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs: Don't
- rename partial type files when they've a different name than
- the class name. (Bug 589663 - Rename class doesnt work well
- with partial types)
-
-2010-03-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoringService.cs: fixed bug
- when replace changes overlap.
-
-2010-03-18 Levi Bard <levi@unity3d.com>
-
- * MonoDevelop.Refactoring/Change.cs: Track API changes.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj: Fix build.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring/Change.cs:
- * MonoDevelop.Refactoring/QuickFixHandler.cs:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring/RefactoringOptions.cs:
- * MonoDevelop.Refactoring/RefactoringOperation.cs:
- * MonoDevelop.CodeGeneration/ToStringGenerator.cs:
- * MonoDevelop.CodeGeneration/PropertyGenerator.cs:
- * MonoDevelop.CodeGeneration/GenerateCodeWindow.cs:
- * MonoDevelop.CodeGeneration/WriteLineGenerator.cs:
- * MonoDevelop.Refactoring/FindReferencesHandler.cs:
- * MonoDevelop.Refactoring/GotoDeclarationHandler.cs:
- * MonoDevelop.Refactoring/EncapsulateFieldDialog.cs:
- * MonoDevelop.Refactoring.Rename/RenameItemDialog.cs:
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs:
- * MonoDevelop.Refactoring/RefactoringPreviewDialog.cs:
- * MonoDevelop.CodeGeneration/CodeGenerationOptions.cs:
- * MonoDevelop.Refactoring/FindDerivedClassesHandler.cs:
- * MonoDevelop.Refactoring/OverridesImplementsDialog.cs:
- * MonoDevelop.CodeGeneration/AbstractGenerateAction.cs:
- * MonoDevelop.CodeGeneration/CodeGenerationCommands.cs:
- * MonoDevelop.CodeGeneration/EqualityMembersGenerator.cs:
- * MonoDevelop.CodeGeneration/OverrideMembersGenerator.cs:
- * MonoDevelop.CodeGeneration/RaiseEventMethodGenerator.cs:
- * MonoDevelop.CodeGeneration/CreateConstructorGenerator.cs:
- * gtk-gui/MonoDevelop.Refactoring.EncapsulateFieldDialog.cs:
- * MonoDevelop.Refactoring/AbstractRefactoringCommandHandler.cs:
- * MonoDevelop.Refactoring.ConvertPropery/RemoveBackingStore.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodDialog.cs:
- * gtk-gui/MonoDevelop.Refactoring.OverridesImplementsDialog.cs:
- * MonoDevelop.Refactoring.CreateClass/CreateClassCodeGenerator.cs:
- * MonoDevelop.Refactoring.ImplementInterface/ImplementImplicit.cs:
- * MonoDevelop.Refactoring.ImplementInterface/ImplementExplicit.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- * MonoDevelop.Refactoring.IntroduceConstant/IntroduceConstantDialog.cs:
- * MonoDevelop.Refactoring.ImplementInterface/ImplementAbstractMembers.cs:
- * MonoDevelop.Refactoring.IntroduceConstant/IntroduceConstantRefactoring.cs:
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable/IntegrateTemporaryVariableRefactoring.cs:
- Merged MD.Projects into MD.Core, and MD.Projects.Gui,
- MD.Core.Gui and MD.Components into MD.Ide.
-
-2010-03-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeGeneration/NullCheckGenerator.cs:
- * MonoDevelop.CodeGeneration/EqualityMembersGenerator.cs:
- * MonoDevelop.CodeGeneration/RaiseEventMethodGenerator.cs:
- * MonoDevelop.Refactoring.RefactorImports/RemoveUnusedImportsRefactoring.cs:
- Track API changes.
-
-2010-03-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs: Fixed
- 'Bug 587071 - Find references shows a lot of methods with
- the same name but not from the correct class'.
-
-2010-03-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/QuickFixHandler.cs: Fixed bug in
- quick fix handler.
-
-2010-03-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/QuickFixHandler.cs:
- * MonoDevelop.Refactoring/RefactoryCommands.cs: Implemented
- 'Bug 582410 - Feature request: Resolve using for extension
- methods'.
-
-2010-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Added additional null check.
-
-2010-02-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring/RefactoringPreviewDialog.cs: Track
- moved diff component.
-
-2010-02-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs: Don't explode
- on docs with no compilation unit.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CodeGeneration/GenerateCodeWindow.cs:
- * MonoDevelop.Refactoring/RefactoringPreviewDialog.cs:
- * MonoDevelop.CodeGeneration/AbstractGenerateAction.cs: Fix
- build.
-
-2010-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring/QuickFixHandler.cs:
- * MonoDevelop.Refactoring/RefactoryCommands.cs: Added quick
- fix handler (currently only namespace resolving is
- supported).
-
-2010-02-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/Change.cs: The file rename operation
- now saves the project.
-
-2010-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.CodeGeneration/GenerateCodeWindow.cs:
- * MonoDevelop.Refactoring/RefactoringPreviewDialog.cs:
- * MonoDevelop.CodeGeneration/AbstractGenerateAction.cs:
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodHandler.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodHandler.cs:
- * MonoDevelop.Refactoring.IntroduceConstant/IntroduceConstantHandler.cs:
- Implemented 'Bug 580657 - Feature request: Key-binding to
- frequently used functionality'.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.CodeGeneration/GenerateCodeWindow.cs:
- * MonoDevelop.Refactoring/RefactoringPreviewDialog.cs:
- * MonoDevelop.CodeGeneration/AbstractGenerateAction.cs: Track
- api changes.
-
-2010-02-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs: Re-worked the
- refactoring submenu.
-
-2010-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Refactoring.CreateClass/CreateClassCodeGenerator.cs:
- * MonoDevelop.Refactoring.MoveTypeToFile/MoveTypeToFileRefactoring.cs:
- Track api changes.
-
-2010-02-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoringPreviewDialog.cs: moved
- method.
-
-2010-02-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeGeneration/GenerateCodeWindow.cs:
- * MonoDevelop.Refactoring/RefactoringPreviewDialog.cs:
- * MonoDevelop.CodeGeneration/AbstractGenerateAction.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Track API changes for lazy loading images.
-
-2010-02-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CodeGeneration/CodeGenerationCommands.cs: Only
- enable command when text editor has input focus.
-
- * MonoDevelop.Refactoring.addin.xml: Insert the Code
- Generation command into edit menu and editor context menu.
-
-2010-02-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/Change.cs: TextReplace change is now
- re-usable by the formatting visitor.
-
-2010-02-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- fixed some bugs in the declare local code generator.
-
-2010-01-29 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring/FindDerivedClassesHandler.cs: Added
- FindDerivedClasses command.
-
-2010-01-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs: fixed
- 'Bug 574924 - Find references doesn't work for constructor'.
-
-2010-01-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Refactoring.csproj: Don't use makefiles for
- building.
-
-2010-01-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring/AbstractRefactoringCommandHandler.cs:
- Handle instantiated types in refactorings.
-
-2010-01-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.MoveTypeToFile/TypeFilterTransformer.cs:
- * MonoDevelop.Refactoring.MoveTypeToFile/MoveTypeToFileRefactoring.cs:
- fixed 'Bug 531510 - Refactoring of generic types fails with
- exception'.
-
-2010-01-20 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/generated.cs:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * gtk-gui/MonoDevelop.CodeGeneration.GenerateCodeWindow.cs:
- * gtk-gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs:
- * gtk-gui/MonoDevelop.Refactoring.RefactoringPreviewDialog.cs:
- * gtk-gui/MonoDevelop.Refactoring.ExtractMethod.ExtractMethodDialog.cs:
- * MonoDevelop.Refactoring.ImplementInterface/ImplementAbstractMembers.cs:
- * gtk-gui/MonoDevelop.Refactoring.IntroduceConstant.IntroduceConstantDialog.cs:
- Implemented 'Bug 525257 - Missing "Implement abstract
- members'.
-
-2010-01-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs: Fix NRE
- when key is not bound.
-
-2010-01-11 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.CodeGeneration.GenerateCodeWindow.cs:
- * gtk-gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs:
- * gtk-gui/MonoDevelop.Refactoring.RefactoringPreviewDialog.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- * gtk-gui/MonoDevelop.Refactoring.ExtractMethod.ExtractMethodDialog.cs:
- * gtk-gui/MonoDevelop.Refactoring.IntroduceConstant.IntroduceConstantDialog.cs:
- Normalized extract method indentation - fixing 'Bug 569370 -
- Extract method doesn't fix indentation'.
-
-2010-01-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeGeneration/NullCheckGenerator.cs: added null
- check.
-
-2009-12-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Added some null checks.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs: Name threads
- to make debugging easier.
-
-2009-11-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.IntroduceConstant/IntroduceConstantRefactoring.cs:
- * MonoDevelop.Refactoring.IntroduceFormatItem/IntroduceFormatItemRefactoring.cs:
- Fixed 'Bug 554260 - Introduce Format Item breaks work with
- escaped quotes'.
-
-2009-11-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.MoveTypeToFile/MoveTypeToFileRefactoring.cs:
- Fixed 'Bug 554415 - Exception in Move File To Type
- refactoring'.
-
-2009-11-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoringPreviewDialog.cs: Fixed
- 'Bug 553557 - Refactoring preview dialog has double-spaced
- lines'.
-
-2009-11-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.IntroduceFormatItem/IntroduceFormatItemRefactoring.cs:
- fixed 'Bug 553091 - Extract format item on unfinished string
- pulls in code in following line'.
-
-2009-11-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/Change.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- * MonoDevelop.Refactoring.IntroduceFormatItem/IntroduceFormatItemRefactoring.cs:
- Fixed 'Bug 553122 – Selection has strange offset after
- refactoring commands'.
-
-2009-11-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- Fixed 'Bug 552140 - Exception on refactor to method'.
-
-2009-10-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/Change.cs:
- * MonoDevelop.Refactoring.MoveTypeToFile/MoveTypeToFileRefactoring.cs:
- fixed 'Bug 551554 - interface rename does not sync project
- file'.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Refactoring.addin.xml: Bump MD version.
-
-2009-10-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ExtractMethod/VariableLookupVisitor.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- declare local/extract method is now much faster on large
- files.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * MonoDevelop.Refactoring.csproj:
- * gtk-gui/MonoDevelop.CodeGeneration.GenerateCodeWindow.cs:
- * gtk-gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs:
- * gtk-gui/MonoDevelop.Refactoring.RefactoringPreviewDialog.cs:
- * gtk-gui/MonoDevelop.Refactoring.ExtractMethod.ExtractMethodDialog.cs:
- * gtk-gui/MonoDevelop.Refactoring.IntroduceConstant.IntroduceConstantDialog.cs:
- Flush.
-
-2009-10-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs: Fixed
- issue in CollectMembers.
-
-2009-10-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.Rename/RenameItemDialog.cs:
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs: Added
- support for rename file names of partial classes.
-
-2009-10-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs: Fixed "Bug
- 549130 - "resolve" adds using st. at wrong place when
- namespace and classname conflict".
-
-2009-10-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs: Fixed
- 'Bug 510939 - Find references should report the interface
- method if the method implements the interface'.
-
-2009-10-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Declare local now generates better variable names.
-
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- Extract method now trims the strings itself.
-
-2009-10-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ImplementInterface/ImplementImplicit.cs:
- * MonoDevelop.Refactoring.ImplementInterface/ImplementExplicit.cs:
- Implement interface is now atomic.
-
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- Fixed 'Bug 548367 - Extract method adds an unwanted newline
- at the end'.
-
- * MonoDevelop.Refactoring.MoveTypeToFile/TypeSearchVisitor.cs:
- * MonoDevelop.Refactoring.MoveTypeToFile/TypeFilterTransformer.cs:
- * MonoDevelop.Refactoring.MoveTypeToFile/MoveTypeToFileRefactoring.cs:
- Fixed 'Bug 545270 - Move type to another file'.
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
-
-2009-10-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoringPreviewDialog.cs: Fixed
- 'Bug 547414 - Gtk-Criticals in refactoring dialog'.
-
-2009-10-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/Change.cs:
- * MonoDevelop.Refactoring.RefactorImports/RefactorImportsHandler.cs:
- fixed 'Bug 547985 - Remove & Sort using throws exception
- when when no usings are necessary.'.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/GotoDeclarationHandler.cs: Special
- handling for field types & names (same as properties).
-
-2009-10-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- check extract method on start, not on menu popup (speed!).
-
-2009-10-11 Mike Krüger <mkrueger@novell.com>
-
- * ChangeLog:
-
- * MonoDevelop.Refactoring/Change.cs: Update visible documents
- after refactoring.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/Change.cs: Update visible documents
- after refactoring.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- Fixed 'Bug 545632 - The flag 'generate method comment' in
- refactoring Create method does nothing'.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.Rename/RenameItemDialog.cs:
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs: Fixed
- 'Bug 545671 - Class rename changes wrong filename/classname
- when filenames/classnames are in conflict'.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodDialog.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- Enter accepts now extract method/escape closes dialog.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodDialog.cs:
- Fixed 'Bug 545635 - In refactoring window the enter key does
- not hit OK' (means that the extract method dialog remembers
- the modifier setting).
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Fixed 'Bug 545631 - Extract method gives exception'.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ConvertPropery/RemoveBackingStore.cs:
- * MonoDevelop.Refactoring.CreateClass/CreateClassCodeGenerator.cs:
- Fixed unit test.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeGeneration/GenerateCodeWindow.cs: Call move
- after show.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- Fixed 'Bug 545119 - Refactor -> "Extract Method..." removes
- comments and new lines'.
-
-2009-10-08 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Refactoring.csproj: Mark the *-sharp references
- with SpecificVersion=false.
-
-2009-10-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- fixed naming of new methods.
-
-2009-10-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- declare local now generates a more .NET like name.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Refactoring.addin.xml: Bump MD version.
-
-2009-10-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs: added null
- check.
-
-2009-10-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring/AbstractRefactoringCommandHandler.cs:
- * MonoDevelop.Refactoring.RefactorImports/RemoveUnusedImportsRefactoring.cs:
- Fixed 'Bug 544027 - "Organize Usings" commands should only
- be visible in usings section'.
-
-2009-10-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs: Fixed "Bug
- 543970 - "Goto class part" pad is not focused".
-
-2009-09-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeGeneration/WriteLineGenerator.cs: better
- sort order in writeline code generator: local vars ->
- parameters -> members. (this is the opposite of the old
- one).
-
-2009-09-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- Added support for creating an method in an interface type.
-
-2009-09-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/HelperMethods.cs: Fixed failing unit
- tests.
-
-2009-09-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/HelperMethods.cs:
- InnerClassTypeReferences now get properly converted.
-
-2009-09-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Don't NRE when command is not key-bound.
-
-2009-09-21 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring/RefactoringOptions.cs:
- * MonoDevelop.CodeGeneration/PropertyGenerator.cs:
- * MonoDevelop.CodeGeneration/ToStringGenerator.cs:
- * MonoDevelop.CodeGeneration/NullCheckGenerator.cs:
- * MonoDevelop.CodeGeneration/WriteLineGenerator.cs:
- * MonoDevelop.Refactoring/FindReferencesHandler.cs:
- * MonoDevelop.Refactoring/GotoDeclarationHandler.cs:
- * MonoDevelop.CodeGeneration/AbstractGenerateAction.cs:
- * MonoDevelop.CodeGeneration/EqualityMembersGenerator.cs:
- * MonoDevelop.CodeGeneration/OverrideMembersGenerator.cs:
- * MonoDevelop.CodeGeneration/RaiseEventMethodGenerator.cs:
- * MonoDevelop.CodeGeneration/CreateConstructorGenerator.cs:
- * MonoDevelop.Refactoring/AbstractRefactoringCommandHandler.cs:
- * MonoDevelop.Refactoring.CreateClass/CreateClassCodeGenerator.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- * MonoDevelop.Refactoring.DeclareLocal/GetContainingEmbeddedStatementVisitor.cs:
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable/IntegrateTemporaryVariableRefactoring.cs:
- Renamed IDomVisitable -> INode
-
-2009-09-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.csproj: fixed project file.
-
-2009-09-18 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Fix build.
-
-2009-09-18 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring/Change.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- * MonoDevelop.Refactoring.DeclareLocal/GetContainingEmbeddedStatementVisitor.cs:
- Fixed 'Bug 540055 - refactoring 'create local var' is going
- wrong in for loop'.
-
-2009-09-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- Fixed possible null reference in extract method.
-
-2009-09-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs: Fixed 'Bug
- 539729 - Cannot use refactoring operations over a var used
- in a lock() statement'.
-
-2009-09-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ConvertPropery/RemoveBackingStore.cs:
- Now getting the correct text file provider for remove
- backing store refactoring.
-
-2009-09-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/Change.cs:
- * MonoDevelop.Refactoring/RefactoringOptions.cs:
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- Fixed Bug 537927 - "Create" refactorings on member method
- are broken/enh. create method on called member
-
-2009-09-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs: In
- FindReferencesThread, report exceptions to the monitor
- instead of letting them reach the top of the thread and
- crash MD.
-
-2009-09-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- Made it a bit more strict where code generator is valid.
-
-2009-09-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.CreateClass/CreateClassCodeGenerator.cs:
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- Fixed "Bug 537927 - "Create" refactorings on member method
- are broken".
-
-2009-09-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs: Added shortcut
- key for encapsulate fields command.
-
-2009-09-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable/IntegrateTemporaryVariableRefactoring.cs:
- Added integrate temporary variable to translation.
-
-2009-09-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.RefactorImports/SortImportsRefactoring.cs:
- Fixed bug in sort usings.
-
-2009-09-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.csproj:
-
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Fixed translation of declare local.
-
-2009-09-09 Christian Hergert <chris@dronelabs.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring.IntroduceConstant/IntroduceConstantRefactoring.cs:
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- Make dialogs transient for the root window.
-
-2009-09-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.Rename/RenameHandler.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalHandler.cs:
- * MonoDevelop.Refactoring/AbstractRefactoringCommandHandler.cs:
- * MonoDevelop.Refactoring.RefactorImports/RefactorImportsHandler.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Fixed some issues. Always check with IsValid before calling
- a refactoring.
-
-2009-09-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Improved declare local code generator.
-
-2009-09-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- fixed unassigned variable errors.
-
-2009-09-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ExtractMethod/VariableLookupVisitor.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodAstTransformer.cs:
- worked on extract method.
-
-2009-09-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Refactoring.csproj: Don't require a specific
- version for Mono.Addins.
-
-2009-09-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring/INRefactoryASTProvider.cs: Resolve
- type now works with templates with >=2 type arguments.
-
-2009-09-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Use shorten type name method.
-
-2009-09-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring/RefactoringOptions.cs:
- * MonoDevelop.CodeGeneration/NullCheckGenerator.cs:
- * MonoDevelop.CodeGeneration/CodeGenerationOptions.cs:
- * MonoDevelop.CodeGeneration/OverrideMembersGenerator.cs:
- * MonoDevelop.CodeGeneration/RaiseEventMethodGenerator.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Worked on refactoring/use shorten type name method.
-
-2009-09-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs: ResolvedType
- is no longer used for the resolve namespace feature.
- Therefore replaced the check with an expression check.
-
-2009-08-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoringOptions.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Worked on declare local variable.
-
-2009-08-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoringOptions.cs:
- * MonoDevelop.Refactoring.ConvertPropery/RemoveBackingStore.cs:
- * MonoDevelop.Refactoring.ConvertPropery/CreateBackingStore.cs:
- Worked on unit tests.
-
-2009-08-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ConvertPropery/RemoveBackingStore.cs:
- * MonoDevelop.Refactoring.ConvertPropery/CreateBackingStore.cs:
- Backing store commands did show up in too many context
- menus.
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs: Resolve
- namespace can now resolve conflicts.
-
- * MonoDevelop.Refactoring.Rename/RenameHandler.cs:
- * MonoDevelop.Refactoring.Rename/RenameItemDialog.cs: Fixed
- possible rename exceptions.
-
-2009-08-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/Change.cs:
- * MonoDevelop.Refactoring.ExtractMethod/VariableLookupVisitor.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- Worked on extract method.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ConvertPropery/RemoveBackingStore.cs:
- Fixed possible null reference exception.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs:
- * MonoDevelop.Refactoring.ConvertPropery/RemoveBackingStore.cs:
- Let the code refactorer auto detect the search scope.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/HelperMethods.cs: changed return
- type.
-
-2009-08-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeGeneration/NullCheckGenerator.cs: Only full
- reference ArgumentNullException when System namespace isn't
- imported.
-
-2009-08-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeGeneration/NullCheckGenerator.cs:
- * MonoDevelop.CodeGeneration/AbstractGenerateAction.cs: Fixed
- null check generator & abstract generate action statement
- output.
-
-2009-08-25 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.CodeGeneration/NullCheckGenerator.cs:
- * MonoDevelop.CodeGeneration/AbstractGenerateAction.cs: Added
- NullCheckGenerator from Scott Thomas <scpeterson@novell.com>
-
-2009-08-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ConvertPropery/RemoveBackingStore.cs:
- Not longer possible to remove backing stores when the field
- has attributes.
-
-2009-08-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeGeneration/AbstractGenerateAction.cs: Fixed
- parameter members in the code generation action.
-
-2009-08-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/Change.cs:
- * MonoDevelop.Refactoring/RefactoringService.cs: Refactorings
- are now atomic.
-
-2009-08-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ConvertPropery/RemoveBackingStore.cs:
- * MonoDevelop.Refactoring.ConvertPropery/CreateBackingStore.cs:
- Worked on refactoring.
-
-2009-08-25 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring/RefactoringService.cs:
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs:
- * MonoDevelop.Refactoring.ConvertPropery/PropertyVisitor.cs:
- * MonoDevelop.Refactoring.ConvertPropery/CreateBackingStore.cs:
- * MonoDevelop.Refactoring.ConvertPropery/RemoveBackingStore.cs:
- Improved "remove backing store"/implemented support for
- overlapping changes.
-
-2009-08-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ConvertPropery/CreateBackingStore.cs:
- Improved backing store name creation.
-
-2009-08-25 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring.ConvertPropery:
- * MonoDevelop.Refactoring/HelperMethods.cs:
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs:
- * MonoDevelop.Refactoring.ConvertPropery/CreateBackingStore.cs:
- * MonoDevelop.Refactoring.ConvertPropery/RemoveBackingStore.cs:
- Added create/remove backing store property refactorings.
-
-2009-08-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.MoveTypeToFile/MoveTypeToFileRefactoring.cs:
- Move type to file refactoring now works with generic types.
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeGeneration/ToStringGenerator.cs:
- * MonoDevelop.CodeGeneration/PropertyGenerator.cs:
- * MonoDevelop.CodeGeneration/WriteLineGenerator.cs:
- * MonoDevelop.CodeGeneration/CodeGenerationOptions.cs:
- * MonoDevelop.CodeGeneration/AbstractGenerateAction.cs:
- * MonoDevelop.CodeGeneration/OverrideMembersGenerator.cs:
- * MonoDevelop.CodeGeneration/EqualityMembersGenerator.cs:
- * MonoDevelop.CodeGeneration/RaiseEventMethodGenerator.cs:
- * MonoDevelop.CodeGeneration/CreateConstructorGenerator.cs:
- Fixed "Bug 533330 - Code generator ignores virtual space
- when inserting code in body".
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.CodeGeneration/EventMethodGenerator.cs:
- * MonoDevelop.CodeGeneration/CodeGenerationOptions.cs:
- * MonoDevelop.CodeGeneration/OverrideMembersGenerator.cs:
- * MonoDevelop.CodeGeneration/RaiseEventMethodGenerator.cs:
- Worked on raise event method generator (now it generates a
- thread safe version).
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeGeneration/OverrideMembersGenerator.cs:
- Fixed "Bug 533681 - Method overriding always uses full
- namespaces".
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring.ImplementInterface:
- * MonoDevelop.Refactoring/RefactoringOperation.cs:
- * MonoDevelop.Refactoring.ImplementInterface/ImplementExplicit.cs:
- * MonoDevelop.Refactoring.ImplementInterface/ImplementImplicit.cs:
- Added 'Bug 325224 - Better placing of 'Implement Interface'
- command'.
-
-2009-08-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CodeGeneration/GenerateCodeWindow.cs: Fix NRE
- introduced in last commit.
-
-2009-08-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CodeGeneration/GenerateCodeWindow.cs:
- * MonoDevelop.CodeGeneration/CodeGenerationCommands.cs: Don't
- show the generator window at all if it's not valid.
-
-2009-08-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.CodeGeneration/CodeGenerationOptions.cs: Don't
- explode when ParsedDocument or CompilationUnit is null.
-
-2009-08-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeGeneration/OverrideMembersGenerator.cs:
- Fixed "Bug 531549 - Quick insert menu adds erroneous
- override keyword for interfaces".
-
-2009-08-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- Fix out of bounds error when matching bracket is not found.
-
-2009-08-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Refactoring.csproj: Don't make local copies of
- project references.
-
-2009-08-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs: Made
- refactorer public.
-
-2009-08-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/HelperMethods.cs: Added helper
- method.
-
-2009-08-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.RefactorImports/SortImportsRefactoring.cs:
- * MonoDevelop.Refactoring.RefactorImports/RemoveUnusedImportsRefactoring.cs:
- Fixed bug with namespaces.
-
-2009-08-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.CodeGeneration/ToStringGenerator.cs:
- * MonoDevelop.CodeGeneration/PropertyGenerator.cs:
- * MonoDevelop.CodeGeneration/WriteLineGenerator.cs:
- * MonoDevelop.CodeGeneration/EventMethodGenerator.cs:
- * MonoDevelop.CodeGeneration/OverrideMembersGenerator.cs:
- * MonoDevelop.CodeGeneration/EqualityMembersGenerator.cs:
- * MonoDevelop.CodeGeneration/CreateConstructorGenerator.cs:
- Check IsSpecialName flag.
-
-2009-08-06 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring/HelperMethods.cs:
- * MonoDevelop.CodeGeneration/OverrideMembersGenerator.cs:
- * MonoDevelop.Refactoring.RefactorImports/SortImportsRefactoring.cs:
- * MonoDevelop.Refactoring.RefactorImports/RefactorImportsHandler.cs:
- * MonoDevelop.Refactoring.RefactorImports/FindTypeReferencesVisitor.cs:
- * MonoDevelop.Refactoring.RefactorImports/RemoveUnusedImportsRefactoring.cs:
- Added remove unused usings & sort usings command.
-
-2009-08-06 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring.RefactorImports:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring.Rename/RenameHandler.cs:
- * MonoDevelop.CodeGeneration/GenerateCodeWindow.cs:
- * MonoDevelop.CodeGeneration/AbstractGenerateAction.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalHandler.cs:
- * MonoDevelop.Refactoring/AbstractRefactoringCommandHandler.cs:
- * MonoDevelop.Refactoring.RefactorImports/RefactorImportsHandler.cs:
- * MonoDevelop.Refactoring.RefactorImports/RemoveUnusedImportsRefactoring.cs:
- Worked on code generation/refactoring.
-
-2009-08-06 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.CodeGeneration/OverrideMembersGenerator.cs:
- * MonoDevelop.CodeGeneration/EqualityMembersGenerator.cs:
- * MonoDevelop.CodeGeneration/CreateConstructorGenerator.cs:
- Added override member generator.
-
-2009-08-06 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.CodeGeneration/ToStringGenerator.cs:
- * MonoDevelop.CodeGeneration/PropertyGenerator.cs:
- * MonoDevelop.CodeGeneration/WriteLineGenerator.cs:
- * MonoDevelop.CodeGeneration/EventMethodGenerator.cs:
- * MonoDevelop.CodeGeneration/AbstractGenerateAction.cs:
- * MonoDevelop.CodeGeneration/EqualityMembersGenerator.cs:
- * MonoDevelop.CodeGeneration/CreateConstructorGenerator.cs:
- Worked on quick code generation.
-
-2009-08-05 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.CodeGeneration:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.CodeGeneration/ICodeGenerator.cs:
- * MonoDevelop.Refactoring/RefactoringOptions.cs:
- * MonoDevelop.Refactoring/RefactoringService.cs:
- * MonoDevelop.CodeGeneration/ToStringGenerator.cs:
- * MonoDevelop.CodeGeneration/PropertyGenerator.cs:
- * MonoDevelop.CodeGeneration/WriteLineGenerator.cs:
- * MonoDevelop.CodeGeneration/GenerateCodeWindow.cs:
- * MonoDevelop.CodeGeneration/EventMethodGenerator.cs:
- * MonoDevelop.CodeGeneration/CodeGenerationOptions.cs:
- * MonoDevelop.CodeGeneration/CodeGenerationCommands.cs:
- * MonoDevelop.CodeGeneration/EqualityMembersGenerator.cs:
- * MonoDevelop.CodeGeneration/ReadonlyPropertyGenerator.cs:
- * gtk-gui/MonoDevelop.CodeGeneration.GenerateCodeWindow.cs:
- * MonoDevelop.CodeGeneration/CreateConstructorGenerator.cs:
- Worked on code generation popup feature.
-
-2009-08-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ExtractMethod/VariableLookupVisitor.cs:
- Only look for local variables or parameters when extracting
- a method.
-
-2009-08-04 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring.IntroduceFormatItem:
- * MonoDevelop.Refactoring/RefactoringOptions.cs:
- * MonoDevelop.Refactoring.IntroduceConstant/IntroduceConstantRefactoring.cs:
- * MonoDevelop.Refactoring.IntroduceFormatItem/IntroduceFormatItemRefactoring.cs:
- Added introduce format item refactoring.
-
-2009-08-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.IntroduceConstant/IntroduceConstantRefactoring.cs:
- fixed possible null reference.
-
-2009-07-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Refactoring.MoveTypeToFile/MoveTypeToFileRefactoring.cs:
- Only enable the move type to file refactoring when the type
- has a source project. Prevents offering the refactoring for
- types in dlls.
-
-2009-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs: Rename
- refactoring now takes care of xml docs too.
-
-2009-07-28 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring/HelperMethods.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- * MonoDevelop.Refactoring.IntroduceConstant/IntroduceConstantRefactoring.cs:
- Added conversion helper method.
-
-2009-07-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs: Fixed
- "Bug 524313 - Wrong caret position when exiting local rename
- link mode".
-
-2009-07-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoryCommands.cs: Fixed "Bug
- 523947 - Using key command to go to class with parts should
- offer choice".
-
-2009-07-22 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring/FindReferencesHandler.cs:
- * MonoDevelop.Refactoring/GotoDeclarationHandler.cs:
- * MonoDevelop.Refactoring.ExtractMethod/VariableLookupVisitor.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodAstTransformer.cs:
- Fixed "Bug 523950 - Make Find References keybindable".
-
-2009-07-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable/IntegrateTemporaryVariableRefactoring.cs:
- checked in newest integrate temporary variable.
-
-2009-07-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable/IntegrateTemporaryVariableRefactoring.cs:
- Checked in latest refactoring from andrea.
-
-2009-07-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable/IntegrateTemporaryVariableRefactoring.cs:
- Declare local is now more carefully looking at the
- expression the show up is requested. Removed some debug
- messages.
-
-2009-07-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.IntroduceConstant/IntroduceConstantRefactoring.cs:
- Added insanity check for caret offset (it may be after the
- document).
-
-2009-07-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoringService.cs:
- * MonoDevelop.Refactoring.ExtractMethod/VariableLookupVisitor.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- Worked on unit test support.
-
-2009-07-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.MoveTypeToFile/MoveTypeToFileRefactoring.cs:
- Fixed possible null reference exception.
-
-2009-07-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.IntroduceConstant/IntroduceConstantRefactoring.cs:
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable/IntegrateTemporaryVariableRefactoring.cs:
- Checked in changes from andrea
-
-2009-07-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.IntroduceConstant/IntroduceConstantRefactoring.cs:
- Fixed bug in introduce constant refactoring.
-
-2009-07-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs: Rename
- on parameters/local variables are now done with link edit
- mode instead of a dialog.
-
-2009-07-14 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring.MoveTypeToFile:
- * MonoDevelop.Refactoring/INRefactoryASTProvider.cs:
- * MonoDevelop.Refactoring.MoveTypeToFile/TypeFilterTransformer.cs:
- * MonoDevelop.Refactoring.MoveTypeToFile/MoveTypeToFileRefactoring.cs:
- Added move type to own file/rename file refactoring.
-
-2009-07-13 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodAstTransformer.cs:
- Worked on extract method.
-
-2009-07-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodDialog.cs:
- * MonoDevelop.Refactoring.ExtractMethod/VariableLookupVisitor.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- Worked on extract method.
-
-2009-07-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.IntroduceConstant/IntroduceConstantRefactoring.cs:
- Improved introduce constant.
-
-2009-07-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ExtractMethod/VariableLookupVisitor.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Worked on refactoring.
-
-2009-07-13 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring.Rename/RenameHandler.cs:
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Worked on refactoring/bound rename to F2.
-
-2009-07-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring/RefactoringPreviewDialog.cs: Worked
- on refactoring preview.
-
-2009-07-10 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring.CreateClass/CreateClassCodeGenerator.cs:
- * MonoDevelop.Refactoring.CreateClass/CreateStructCodeGenerator.cs:
- Added create struct generator (based on class generator).
-
-2009-07-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable/IntegrateTemporaryVariableRefactoring.cs:
- Applied new patch from andrea.
-
-2009-07-10 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring/Change.cs:
- * MonoDevelop.Refactoring.CreateClass:
- * MonoDevelop.Refactoring/RefactoringService.cs:
- * MonoDevelop.Refactoring/RefactoringOptions.cs:
- * MonoDevelop.Refactoring/RefactoringPreviewDialog.cs:
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs:
- * MonoDevelop.Refactoring.CreateClass/CreateClassCodeGenerator.cs:
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- * MonoDevelop.Refactoring.IntroduceConstant/IntroduceConstantRefactoring.cs:
- Worked on refactoring.
-
-2009-07-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- Create method code generator now selects the method body.
-
-2009-07-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Fixed declare local code generator.
-
-2009-07-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.IntroduceConstant/IntroduceConstantDialog.cs:
- * MonoDevelop.Refactoring.IntroduceConstant/IntroduceConstantRefactoring.cs:
- Worked on introduce constant refactoring.
-
-2009-07-09 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring.IntroduceConstant:
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- * MonoDevelop.Refactoring.IntroduceConstant/IntroduceConstantDialog.cs:
- * MonoDevelop.Refactoring.IntroduceConstant/IntroduceConstantRefactoring.cs:
- * gtk-gui/MonoDevelop.Refactoring.IntroduceConstant.IntroduceConstantDialog.cs:
- Worked on refactoring.
-
-2009-07-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- Handled the extract method case where only one variable is
- changed (use return instead of ref params).
-
-2009-07-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.ExtractMethod/VariableLookupVisitor.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- Worked on extract method.
-
-2009-07-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Fixing generic type declarations.
-
-2009-07-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- declare local variable no longer shows up in item context
- menu.
-
-2009-07-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Improved local variable code generator.
-
-2009-07-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable/IntegrateTemporaryVariableRefactoring.cs:
- Checked in changes from andrea.
-
-2009-07-09 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring/RefactoringOperation.cs:
- * MonoDevelop.Refactoring/INRefactoryASTProvider.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalHandler.cs:
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Added declare local code generator.
-
-2009-07-09 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.DeclareLocal:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring/RefactoringOperation.cs:
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- * MonoDevelop.Refactoring.DeclareLocal/DeclareLocalCodeGenerator.cs:
- Worked on refactoring.
-
-2009-07-08 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.Rename:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring/Rename.cs:
- * MonoDevelop.Refactoring/RenameItemDialog.cs:
- * MonoDevelop.Refactoring/RefactoringOptions.cs:
- * MonoDevelop.Refactoring.Rename/RenameItemDialog.cs:
- * gtk-gui/MonoDevelop.Refactoring.RenameItemDialog.cs:
- * MonoDevelop.Refactoring.Rename/RenameRefactoring.cs:
- * MonoDevelop.Refactoring.CreateMethod/CreateMethod.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethod.cs:
- * gtk-gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodDialog.cs:
- * MonoDevelop.Refactoring.ExtractMethod/VariableLookupVisitor.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodRefactoring.cs:
- * MonoDevelop.Refactoring.CreateMethod/CreateMethodCodeGenerator.cs:
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable/IntegrateTemporaryVariable.cs:
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable/IntegrateTemporaryVariableRefactoring.cs:
- Worked on refactoring.
-
-2009-07-07 Mike Krüger <mkrueger@novell.com>
-
- * ChangeLog:
- * Makefile.am:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable:
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable/IntegrateTemporaryVariable.cs:
-
-
-2009-07-07 Andrea Krüger <andrea@icsharpcod.net>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable:
- * MonoDevelop.Refactoring.IntegrateTemporaryVariable/IntegrateTemporaryVariable.cs:
- Applied patch from Andrea Krüger: Started
- IntegrateTemporaryVarible refactoring.
-
-2009-07-07 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring/Rename.cs:
- * MonoDevelop.Refactoring/RenameItemDialog.cs:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring/RefactoringOptions.cs:
- * MonoDevelop.Refactoring/RefactoringOperation.cs:
- * MonoDevelop.Refactoring.CreateMethod/CreateMethod.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethod.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodDialog.cs:
- Refactored the refactoring a bit.
-
-2009-07-07 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring.CreateMethod:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring.CreateMethod/CreateMethod.cs:
- Started create method command.
-
-2009-07-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Refactoring.csproj: Don't local-copy MD project
- refs.
-
-2009-07-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Refactoring.ExtractMethod.ExtractMethodDialog.cs:
- Fix expand/fill and sizing.
-
-2009-07-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.addin.xml: Bound go to definition to
- F12
-
-2009-07-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring/RefactoryCommands.cs: Added 'goto
- declaration' command.
-
-2009-07-03 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring/Rename.cs:
- * MonoDevelop.Refactoring/Refactoring.cs:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring/RefactoringService.cs:
- * MonoDevelop.Refactoring/RefactoringOperation.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethod.cs:
- Renamed Refactoring to RefactoringOperation. Fixed command
- item creation.
-
-2009-07-03 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring/Rename.cs:
- * MonoDevelop.Refactoring/Change.cs:
- * MonoDevelop.Refactoring/Refactoring.cs:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring/RefactoringService.cs:
- * MonoDevelop.Refactoring/INRefactoryASTProvider.cs:
- * MonoDevelop.Refactoring/RefactoringPreviewDialog.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethod.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodDialog.cs:
- * MonoDevelop.Refactoring.ExtractMethod/VariableLookupVisitor.cs:
- * gtk-gui/MonoDevelop.Refactoring.ExtractMethod.ExtractMethodDialog.cs:
- Worked on refactoring support.
-
-2009-07-02 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Refactoring.ExtractMethod.ExtractMethodDialog.cs:
- Save changes to extract mehtod dialog to ensure that they're
- not lost due stetic bugs.
-
-2009-07-02 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring.ExtractMethod:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethod.cs:
- * MonoDevelop.Refactoring.ExtractMethod/ExtractMethodDialog.cs:
- * gtk-gui/MonoDevelop.Refactoring.ExtractMethod.ExtractMethodDialog.cs:
- Worked on extract method.
-
-2009-07-01 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring/Rename.cs:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring/Change.cs:
- * MonoDevelop.Refactoring/Refactoring.cs:
- * MonoDevelop.Refactoring/RenameItemDialog.cs:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * MonoDevelop.Refactoring/RefactoringService.cs:
- * MonoDevelop.Refactoring/RefactoringPreviewDialog.cs: Moved
- some refactoring infrastructure from MonoDevlop.Projects.
-
-2009-07-01 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui:
- * Makefile.am:
- * AssemblyInfo.cs:
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * MonoDevelop.Refactoring:
- * MonoDevelop.Refactoring.csproj:
- * MonoDevelop.Refactoring/Rename.cs:
- * MonoDevelop.Refactoring.addin.xml:
- * MonoDevelop.Refactoring/RenameItemDialog.cs:
- * MonoDevelop.Refactoring/RefactoryCommands.cs:
- * gtk-gui/MonoDevelop.Refactoring.RenameItemDialog.cs:
- * MonoDevelop.Refactoring/RefactoringPreviewDialog.cs:
- * gtk-gui/MonoDevelop.Refactoring.RefactoringPreviewDialog.cs:
- Moved refactoring support to an own assembly.
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs
index 619a60fa9e..4bba040f78 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs
@@ -31,20 +31,17 @@ using System.Linq;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using System.Collections.Generic;
-using Gtk;
using MonoDevelop.AnalysisCore.Gui;
-using MonoDevelop.SourceEditor;
-using MonoDevelop.SourceEditor.QuickTasks;
-using ICSharpCode.NRefactory.CSharp;
using MonoDevelop.AnalysisCore.Fixes;
using MonoDevelop.Ide;
using MonoDevelop.CodeIssues;
-using ICSharpCode.NRefactory.Refactoring;
using MonoDevelop.CodeActions;
using System.Threading;
using System.IO;
using MonoDevelop.Refactoring;
using MonoDevelop.Ide.Gui.Dialogs;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Components.Extensions;
namespace MonoDevelop.AnalysisCore
{
@@ -71,32 +68,32 @@ namespace MonoDevelop.AnalysisCore
return;
}
var fixes = codeActionExtension.GetCurrentFixes ();
- info.Enabled = fixes.Any ();
+ info.Enabled = !fixes.IsEmpty;
}
protected override void Run ()
{
- var doc = MonoDevelop.Ide.IdeApp.Workbench.ActiveDocument;
- var view = doc.GetContent<MonoDevelop.SourceEditor.SourceEditorView> ();
- if (view == null) {
- LoggingService.LogWarning ("ShowFixesHandler could not find a SourceEditorView");
- return;
- }
- var widget = view.TextEditor;
- var pt = view.DocumentToScreenLocation (doc.Editor.Caret.Location);
-
- var ces = new CommandEntrySet ();
- ces.AddItem (AnalysisCommands.FixOperations);
- var menu = MonoDevelop.Ide.IdeApp.CommandService.CreateMenu (ces);
-
- menu.Popup (null, null, delegate (Menu mn, out int x, out int y, out bool push_in) {
- x = pt.X;
- y = pt.Y;
- push_in = true;
- //if the menu would be off the bottom of the screen, "drop" it upwards
- if (y + mn.Requisition.Height > widget.Screen.Height)
- y -= mn.Requisition.Height + (int)widget.LineHeight;
- }, 0, Global.CurrentEventTime);
+// var doc = MonoDevelop.Ide.IdeApp.Workbench.ActiveDocument;
+// var view = doc.GetContent<MonoDevelop.SourceEditor.SourceEditorView> ();
+// if (view == null) {
+// LoggingService.LogWarning ("ShowFixesHandler could not find a SourceEditorView");
+// return;
+// }
+// var widget = view.TextEditor;
+// var pt = view.DocumentToScreenLocation (doc.Editor.Caret.Location);
+//
+// var ces = new CommandEntrySet ();
+// ces.AddItem (AnalysisCommands.FixOperations);
+// var menu = MonoDevelop.Ide.IdeApp.CommandService.CreateMenu (ces);
+//
+// menu.Popup (null, null, delegate (Menu mn, out int x, out int y, out bool push_in) {
+// x = pt.X;
+// y = pt.Y;
+// push_in = true;
+// //if the menu would be off the bottom of the screen, "drop" it upwards
+// if (y + mn.Requisition.Height > widget.Screen.Height)
+// y -= mn.Requisition.Height + (int)widget.LineHeight;
+// }, 0, Global.CurrentEventTime);
}
}
@@ -104,11 +101,11 @@ namespace MonoDevelop.AnalysisCore
{
protected override void Update (CommandArrayInfo info)
{
- MonoDevelop.Ide.Gui.Document document;
- IList<FixableResult> results;
- if (!GetFixes (out document, out results))
- return;
- PopulateInfos (info, document, results);
+// MonoDevelop.Ide.Gui.Document document;
+// IList<FixableResult> results;
+// if (!GetFixes (out document, out results))
+// return;
+// PopulateInfos (info, document, results);
}
protected override void Run (object dataItem)
@@ -121,54 +118,52 @@ namespace MonoDevelop.AnalysisCore
((System.Action)dataItem) ();
return;
}
- if (!RefactoringService.CheckUserSettings ())
- return;
var action = dataItem as IAnalysisFixAction;
if (action != null) {
action.Fix ();
return;
}
- var ca = dataItem as CodeAction;
- if (ca != null) {
- var doc = MonoDevelop.Ide.IdeApp.Workbench.ActiveDocument;
-
- var context = doc.ParsedDocument.CreateRefactoringContext != null ? doc.ParsedDocument.CreateRefactoringContext (doc, default(CancellationToken)) : null;
- using (var script = context.CreateScript ()) {
- ca.Run (context, script);
- }
- return;
- }
+// var ca = dataItem as CodeAction;
+// if (ca != null) {
+// var doc = MonoDevelop.Ide.IdeApp.Workbench.ActiveDocument;
+//
+// var context = doc.ParsedDocument.CreateRefactoringContext != null ? doc.ParsedDocument.CreateRefactoringContext (doc, default(CancellationToken)) : null;
+// using (var script = context.CreateScript ()) {
+// ca.Run (context, script);
+// }
+// return;
+// }
}
- public static bool GetFixes (out Document document, out IList<FixableResult> results)
- {
- results = null;
- document = MonoDevelop.Ide.IdeApp.Workbench.ActiveDocument;
- if (document == null)
- return false;
-
- var ext = document.GetContent<ResultsEditorExtension> ();
- if (ext == null)
- return false;
-
- var list = ext.GetResultsAtOffset (document.Editor.Caret.Offset).OfType<FixableResult> ().ToList ();
- list.Sort (ResultCompareImportanceDesc);
- results = list;
-
- if (results.Count > 0)
- return true;
-
- var codeActionExtension = document.GetContent <CodeActionEditorExtension> ();
- if (codeActionExtension != null) {
- var fixes = codeActionExtension.GetCurrentFixes ();
- if (fixes != null)
- return fixes.Any (CodeActionEditorExtension.IsAnalysisOrErrorFix);
- }
- return false;
- }
-
+// public static bool GetFixes (out MonoDevelop.Ide.Gui.Document document, out IList<FixableResult> results)
+// {
+// results = null;
+// document = MonoDevelop.Ide.IdeApp.Workbench.ActiveDocument;
+// if (document == null)
+// return false;
+//
+// var ext = document.GetContent<ResultsEditorExtension> ();
+// if (ext == null)
+// return false;
+//
+// var list = ext.GetResultsAtOffset (document.Editor.CaretOffset).OfType<FixableResult> ().ToList ();
+// list.Sort (ResultCompareImportanceDesc);
+// results = list;
+//
+// if (results.Count > 0)
+// return true;
+//
+// var codeActionExtension = document.GetContent <CodeActionEditorExtension> ();
+// if (codeActionExtension != null) {
+// var fixes = codeActionExtension.GetCurrentFixes ();
+// if (fixes != null)
+// return !fixes.IsEmpty;
+// }
+// return false;
+// }
+//
static int ResultCompareImportanceDesc (Result r1, Result r2)
{
int c = ((int)r1.Level).CompareTo ((int)r2.Level);
@@ -177,113 +172,113 @@ namespace MonoDevelop.AnalysisCore
return string.Compare (r1.Message, r2.Message, StringComparison.Ordinal);
}
- public static void PopulateInfos (CommandArrayInfo infos, Document doc, IEnumerable<FixableResult> results)
- {
- //FIXME: ellipsize long messages
- int mnemonic = 1;
-
- var codeActionExtension = doc.GetContent <CodeActionEditorExtension> ();
- var fixes = codeActionExtension.GetCurrentFixes ();
- if (fixes != null) {
- foreach (var _fix in fixes.Where (CodeActionEditorExtension.IsAnalysisOrErrorFix)) {
- var fix = _fix;
- if (fix is AnalysisContextActionProvider.AnalysisCodeAction)
- continue;
- var escapedLabel = fix.Title.Replace ("_", "__");
- var label = (mnemonic <= 10)
- ? "_" + (mnemonic++ % 10).ToString () + " " + escapedLabel
- : " " + escapedLabel;
- infos.Add (label, fix);
- }
- }
-
- foreach (var result in results) {
- bool firstAction = true;
- foreach (var action in GetActions (doc, result)) {
- if (firstAction) {
- //FIXME: make this header item insensitive but not greyed out
- infos.Add (new CommandInfo (result.Message.Replace ("_", "__"), false, false) {
- Icon = GetIcon (result.Level)
- }, null);
- firstAction = false;
- }
- var escapedLabel = action.Label.Replace ("_", "__");
- var label = (mnemonic <= 10)
- ? "_" + (mnemonic++ % 10).ToString () + " " + escapedLabel
- : " " + escapedLabel;
- infos.Add (label, action);
- }
- if (result.HasOptionsDialog) {
- var declSet = new CommandInfoSet ();
- declSet.Text = GettextCatalog.GetString ("_Options for \"{0}\"", result.OptionsTitle);
-
- bool hasBatchFix = false;
- foreach (var fix in result.Fixes.OfType<IAnalysisFixAction> ().Where (f => f.SupportsBatchFix)) {
- hasBatchFix = true;
- var title = string.Format (GettextCatalog.GetString ("Apply in file: {0}"), fix.Label);
- declSet.CommandInfos.Add (title, new System.Action(fix.BatchFix));
- }
- if (hasBatchFix)
- declSet.CommandInfos.AddSeparator ();
-
- var ir = result as InspectorResults;
- if (ir != null) {
- var inspector = ir.Inspector;
-
- if (inspector.CanSuppressWithAttribute) {
- declSet.CommandInfos.Add (GettextCatalog.GetString ("_Suppress with attribute"), new System.Action(delegate {
- inspector.SuppressWithAttribute (doc, ir.Region);
- }));
- }
-
- if (inspector.CanDisableWithPragma) {
- declSet.CommandInfos.Add (GettextCatalog.GetString ("_Suppress with #pragma"), new System.Action(delegate {
- inspector.DisableWithPragma (doc, ir.Region);
- }));
- }
-
- if (inspector.CanDisableOnce) {
- declSet.CommandInfos.Add (GettextCatalog.GetString ("_Disable Once"), new System.Action(delegate {
- inspector.DisableOnce (doc, ir.Region);
- }));
- }
-
- if (inspector.CanDisableAndRestore) {
- declSet.CommandInfos.Add (GettextCatalog.GetString ("Disable _and Restore"), new System.Action(delegate {
- inspector.DisableAndRestore (doc, ir.Region);
- }));
- }
- }
-
- declSet.CommandInfos.Add (GettextCatalog.GetString ("_Configure Rule"), result);
-
- infos.Add (declSet);
- }
- }
- }
-
- public static IEnumerable<IAnalysisFixAction> GetActions (Document doc, FixableResult result)
- {
- foreach (var fix in result.Fixes)
- foreach (var handler in AnalysisExtensions.GetFixHandlers (fix.FixType))
- foreach (var action in handler.GetFixes (doc, fix))
- yield return action;
-
- }
-
- static string GetIcon (Severity severity)
- {
- switch (severity) {
- case Severity.Error:
- return Ide.Gui.Stock.Error;
- case Severity.Warning:
- return Ide.Gui.Stock.Warning;
- case Severity.Hint:
- return Ide.Gui.Stock.Information;
- default:
- return null;
- }
- }
+// public static void PopulateInfos (CommandArrayInfo infos, MonoDevelop.Ide.Gui.Document doc, IEnumerable<FixableResult> results)
+// {
+//// //FIXME: ellipsize long messages
+//// int mnemonic = 1;
+////
+//// var codeActionExtension = doc.GetContent <CodeActionEditorExtension> ();
+//// var fixes = codeActionExtension.GetCurrentFixes ();
+//// if (fixes != null) {
+//// foreach (var _fix in fixes.Where (CodeActionEditorExtension.IsAnalysisOrErrorFix)) {
+//// var fix = _fix;
+//// if (fix is AnalysisContextActionProvider.AnalysisCodeAction)
+//// continue;
+//// var escapedLabel = fix.Title.Replace ("_", "__");
+//// var label = (mnemonic <= 10)
+//// ? "_" + (mnemonic++ % 10).ToString () + " " + escapedLabel
+//// : " " + escapedLabel;
+//// infos.Add (label, fix);
+//// }
+//// }
+////
+//// foreach (var result in results) {
+//// bool firstAction = true;
+//// foreach (var action in GetActions (doc, result)) {
+//// if (firstAction) {
+//// //FIXME: make this header item insensitive but not greyed out
+//// infos.Add (new CommandInfo (result.Message.Replace ("_", "__"), false, false) {
+//// Icon = GetIcon (result.Level)
+//// }, null);
+//// firstAction = false;
+//// }
+//// var escapedLabel = action.Label.Replace ("_", "__");
+//// var label = (mnemonic <= 10)
+//// ? "_" + (mnemonic++ % 10).ToString () + " " + escapedLabel
+//// : " " + escapedLabel;
+//// infos.Add (label, action);
+//// }
+//// if (result.HasOptionsDialog) {
+//// var declSet = new CommandInfoSet ();
+//// declSet.Text = GettextCatalog.GetString ("_Options for \"{0}\"", result.OptionsTitle);
+////
+//// bool hasBatchFix = false;
+//// foreach (var fix in result.Fixes.OfType<IAnalysisFixAction> ().Where (f => f.SupportsBatchFix)) {
+//// hasBatchFix = true;
+//// var title = string.Format (GettextCatalog.GetString ("Apply in file: {0}"), fix.Label);
+//// declSet.CommandInfos.Add (title, new System.Action(fix.BatchFix));
+//// }
+//// if (hasBatchFix)
+//// declSet.CommandInfos.AddSeparator ();
+////
+//// var ir = result as InspectorResults;
+//// if (ir != null) {
+//// var inspector = ir.Inspector;
+////
+//// if (inspector.CanSuppressWithAttribute) {
+//// declSet.CommandInfos.Add (GettextCatalog.GetString ("_Suppress with attribute"), new System.Action(delegate {
+//// inspector.SuppressWithAttribute (doc, ir.Region);
+//// }));
+//// }
+////
+//// if (inspector.CanDisableWithPragma) {
+//// declSet.CommandInfos.Add (GettextCatalog.GetString ("_Suppress with #pragma"), new System.Action(delegate {
+//// inspector.DisableWithPragma (doc, ir.Region);
+//// }));
+//// }
+////
+//// if (inspector.CanDisableOnce) {
+//// declSet.CommandInfos.Add (GettextCatalog.GetString ("_Disable Once"), new System.Action(delegate {
+//// inspector.DisableOnce (doc, ir.Region);
+//// }));
+//// }
+////
+//// if (inspector.CanDisableAndRestore) {
+//// declSet.CommandInfos.Add (GettextCatalog.GetString ("Disable _and Restore"), new System.Action(delegate {
+//// inspector.DisableAndRestore (doc, ir.Region);
+//// }));
+//// }
+//// }
+////
+//// declSet.CommandInfos.Add (GettextCatalog.GetString ("_Configure Rule"), result);
+////
+//// infos.Add (declSet);
+//// }
+//// }
+// }
+//
+// public static IEnumerable<IAnalysisFixAction> GetActions (MonoDevelop.Ide.Gui.Document doc, FixableResult result)
+// {
+// foreach (var fix in result.Fixes)
+// foreach (var handler in AnalysisExtensions.GetFixHandlers (fix.FixType))
+// foreach (var action in handler.GetFixes (doc.Editor, doc, fix))
+// yield return action;
+//
+// }
+//
+// static string GetIcon (Severity severity)
+// {
+// switch (severity) {
+// case Severity.Error:
+// return Ide.Gui.Stock.Error;
+// case Severity.Warning:
+// return Ide.Gui.Stock.Warning;
+// case Severity.Hint:
+// return Ide.Gui.Stock.Information;
+// default:
+// return null;
+// }
+// }
}
class ExportRulesHandler : CommandHandler
@@ -297,19 +292,19 @@ namespace MonoDevelop.AnalysisCore
if (!dlg.Run ())
return;
- Dictionary<BaseCodeIssueProvider, Severity> severities = new Dictionary<BaseCodeIssueProvider, Severity> ();
+ Dictionary<CodeDiagnosticDescriptor, DiagnosticSeverity?> severities = new Dictionary<CodeDiagnosticDescriptor, DiagnosticSeverity?> ();
- foreach (var node in RefactoringService.GetInspectors (lang)) {
- severities [node] = node.GetSeverity ();
- if (node.HasSubIssues) {
- foreach (var subIssue in node.SubIssues) {
- severities [subIssue] = subIssue.GetSeverity ();
- }
- }
+ foreach (var node in BuiltInCodeDiagnosticProvider.GetBuiltInCodeDiagnosticDecsriptorsAsync (CodeRefactoringService.MimeTypeToLanguage(lang), true).Result) {
+ severities [node] = node.DiagnosticSeverity;
+// if (node.GetProvider ().SupportedDiagnostics.Length > 1) {
+// foreach (var subIssue in node.GetProvider ().SupportedDiagnostics) {
+// severities [subIssue] = node.GetSeverity (subIssue);
+// }
+// }
}
- var grouped = severities.Keys.OfType<CodeIssueProvider> ()
- .GroupBy (node => node.Category)
+ var grouped = severities.Keys.OfType<CodeDiagnosticDescriptor> ()
+ .GroupBy (node => node.GetProvider ().SupportedDiagnostics.First ().Category)
.OrderBy (g => g.Key, StringComparer.Ordinal);
using (var sw = new StreamWriter (dlg.SelectedFile)) {
@@ -318,33 +313,31 @@ namespace MonoDevelop.AnalysisCore
sw.WriteLine ("<h2>" + g.Key + "</h2>");
sw.WriteLine ("<table border='1'>");
- foreach (var node in g.OrderBy (n => n.Title, StringComparer.Ordinal)) {
- var title = node.Title;
- var desc = node.Description != title ? node.Description : "";
- sw.WriteLine ("<tr><td>" + title + "</td><td>" + desc + "</td><td>" + node.GetSeverity () + "</td></tr>");
- if (node.HasSubIssues) {
- foreach (var subIssue in node.SubIssues) {
- title = subIssue.Title;
- desc = subIssue.Description != title ? subIssue.Description : "";
- sw.WriteLine ("<tr><td> - " + title + "</td><td>" + desc + "</td><td>" + subIssue.GetSeverity () + "</td></tr>");
+ foreach (var node in g.OrderBy (n => n.Name, StringComparer.Ordinal)) {
+ var title = node.Name;
+ var desc = node.GetProvider ().SupportedDiagnostics.First ().Description.ToString () != title ? node.GetProvider ().SupportedDiagnostics.First ().Description : "";
+ sw.WriteLine ("<tr><td>" + title + "</td><td>" + desc + "</td><td>" + node.DiagnosticSeverity + "</td></tr>");
+ if (node.GetProvider ().SupportedDiagnostics.Length > 1) {
+ foreach (var subIssue in node.GetProvider ().SupportedDiagnostics) {
+ title = subIssue.Description.ToString ();
+ desc = subIssue.Description.ToString () != title ? subIssue.Description : "";
+ sw.WriteLine ("<tr><td> - " + title + "</td><td>" + desc + "</td><td>" + node.GetSeverity (subIssue) + "</td></tr>");
}
}
}
sw.WriteLine ("</table>");
}
- Dictionary<CodeActionProvider, bool> providerStates = new Dictionary<CodeActionProvider, bool> ();
- string disabledNodes = PropertyService.Get ("ContextActions." + lang, "");
- foreach (var node in RefactoringService.ContextAddinNodes.Where (n => n.MimeType == lang)) {
- providerStates [node] = disabledNodes.IndexOf (node.IdString, StringComparison.Ordinal) < 0;
+ var providerStates = new Dictionary<CodeRefactoringDescriptor, bool> ();
+ foreach (var node in BuiltInCodeDiagnosticProvider.GetBuiltInCodeRefactoringDescriptorsAsync (CodeRefactoringService.MimeTypeToLanguage(lang), true).Result) {
+ providerStates [node] = node.IsEnabled;
}
sw.WriteLine ("<h1>Code Actions</h1>");
sw.WriteLine ("<table border='1'>");
- var sortedAndFiltered = providerStates.Keys.OrderBy (n => n.Title, StringComparer.Ordinal);
+ var sortedAndFiltered = providerStates.Keys.OrderBy (n => n.Name, StringComparer.Ordinal);
foreach (var node in sortedAndFiltered) {
- var desc = node.Title != node.Description ? node.Description : "";
- sw.WriteLine ("<tr><td>" + node.Title + "</td><td>" + desc + "</td></tr>");
+ sw.WriteLine ("<tr><td>" + node.IdString + "</td><td>" + node.Name + "</td></tr>");
}
sw.WriteLine ("</table>");
}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisOptions.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisOptions.cs
index cedc34ccd3..0ffe36ac2a 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisOptions.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisOptions.cs
@@ -26,17 +26,19 @@
using System;
using MonoDevelop.Core;
-using MonoDevelop.SourceEditor.QuickTasks;
+using MonoDevelop.Ide;
namespace MonoDevelop.AnalysisCore
{
public static class AnalysisOptions
{
- public static PropertyWrapper<bool> AnalysisEnabled {
- get { return QuickTaskStrip.EnableFancyFeatures; }
+ public readonly static ConfigurationProperty<bool> EnableFancyFeatures = IdeApp.Preferences.EnableSourceAnalysis;
+
+ public static ConfigurationProperty<bool> AnalysisEnabled {
+ get { return EnableFancyFeatures; }
}
- public readonly static PropertyWrapper<bool> EnableUnitTestEditorIntegration = new PropertyWrapper<bool> ("Testing.EnableUnitTestEditorIntegration", false);
+ public readonly static ConfigurationProperty<bool> EnableUnitTestEditorIntegration = IdeApp.Preferences.EnableUnitTestEditorIntegration;
}
}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/FixableResult.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/FixableResult.cs
index 7aaf76620f..ca3ca05b3e 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/FixableResult.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/FixableResult.cs
@@ -26,26 +26,23 @@
using System;
using System.Collections.Generic;
-using MonoDevelop.SourceEditor;
-using MonoDevelop.SourceEditor.QuickTasks;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.CSharp;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.Refactoring;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Ide.Editor;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.AnalysisCore
{
- public class FixableResult : Result
- {
- public FixableResult (DomRegion region, string message, Severity level,
- IssueMarker mark, params IAnalysisFix[] fixes)
- : base (region, message, level, mark)
- {
- this.Fixes = fixes;
- }
-
- public IAnalysisFix[] Fixes { get; protected set; }
- }
+// public class FixableResult : Result
+// {
+// public FixableResult (TextSpan region, string message, DiagnosticSeverity level,
+// IssueMarker mark, params IAnalysisFix[] fixes)
+// : base (region, message, level, mark)
+// {
+// this.Fixes = fixes;
+// }
+//
+// public IAnalysisFix[] Fixes { get; protected set; }
+// }
//FIXME: should this really use MonoDevelop.Ide.Gui.Document? Fixes could be more generic.
public interface IAnalysisFix
@@ -55,14 +52,14 @@ namespace MonoDevelop.AnalysisCore
public interface IFixHandler
{
- IEnumerable<IAnalysisFixAction> GetFixes (MonoDevelop.Ide.Gui.Document doc, object fix);
+ IEnumerable<IAnalysisFixAction> GetFixes (TextEditor editor, DocumentContext doc, object fix);
}
public interface IAnalysisFixAction
{
string Label { get; }
bool SupportsBatchFix { get; }
- DocumentRegion DocumentRegion { get; }
+ TextSpan DocumentRegion { get; }
string IdString { get; }
void Fix ();
void BatchFix ();
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Fixes/GenericFix.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Fixes/GenericFix.cs
index 021445d57b..ca7bd317f0 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Fixes/GenericFix.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Fixes/GenericFix.cs
@@ -25,63 +25,30 @@
// THE SOFTWARE.
using System;
using System.Collections.Generic;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.CSharp;
using MonoDevelop.CodeIssues;
using MonoDevelop.Ide;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.Refactoring;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Ide.Editor;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.AnalysisCore.Fixes
{
- public class InspectorResults : GenericResults
- {
- public BaseCodeIssueProvider Inspector { get; private set; }
-
- public InspectorResults (BaseCodeIssueProvider inspector, DomRegion region, string message, Severity level, IssueMarker mark, params GenericFix[] fixes)
- : base (region, message, level, mark, fixes)
- {
- this.Inspector = inspector;
- }
-
- public override bool HasOptionsDialog { get { return true; } }
- public override string OptionsTitle { get { return GetTitle (Inspector); } }
- public override void ShowResultOptionsDialog ()
- {
- IdeApp.Workbench.ShowGlobalPreferencesDialog (null, "C#", dialog => {
- var panel = dialog.GetPanel<CodeIssuePanel> ("C#");
- if (panel == null)
- return;
- panel.Widget.SelectCodeIssue (Inspector.IdString);
- });
- }
-
- public static string GetTitle (BaseCodeIssueProvider inspector)
- {
- if (inspector.Parent == null)
- return inspector.Title;
- return inspector.Parent.Title + " -> " + inspector.Title;
- }
-
-
- }
-
- public class GenericResults : FixableResult
- {
- public GenericResults (DomRegion region, string message, Severity level,
- IssueMarker mark, params GenericFix[] fixes)
- : base (region, message, level, mark)
- {
- this.Fixes = fixes;
- }
- }
+// public class GenericResults : FixableResult
+// {
+// public GenericResults (TextSpan region, string message, DiagnosticSeverity level,
+// IssueMarker mark, params GenericFix[] fixes)
+// : base (region, message, level, mark)
+// {
+// this.Fixes = fixes;
+// }
+// }
public class GenericFix : IAnalysisFix, IAnalysisFixAction
{
Action fix;
Action batchFix;
string label;
- public DocumentRegion DocumentRegion { get; set; }
+ public TextSpan DocumentRegion { get; set; }
public string IdString { get; set; }
public GenericFix (string label, Action fix, Action batchFix = null)
@@ -130,7 +97,7 @@ namespace MonoDevelop.AnalysisCore.Fixes
public class GenericFixHandler : IFixHandler
{
#region IFixHandler implementation
- public IEnumerable<IAnalysisFixAction> GetFixes (MonoDevelop.Ide.Gui.Document doc, object fix)
+ public IEnumerable<IAnalysisFixAction> GetFixes (TextEditor editor, DocumentContext context, object fix)
{
yield return (GenericFix)fix;
}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Fixes/RenameMemberFix.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Fixes/RenameMemberFix.cs
index 2624a4fe2d..15471b44fa 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Fixes/RenameMemberFix.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Fixes/RenameMemberFix.cs
@@ -27,13 +27,10 @@
using System;
using System.Collections.Generic;
using MonoDevelop.Core;
-using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Refactoring;
using MonoDevelop.Refactoring.Rename;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using ICSharpCode.NRefactory.Semantics;
-using Mono.TextEditor;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AnalysisCore.Fixes
{
@@ -42,14 +39,14 @@ namespace MonoDevelop.AnalysisCore.Fixes
public string NewName { get; private set; }
public string OldName { get; private set; }
public string IdString { get; set; }
- public IEntity Item { get; private set; }
-
- public RenameMemberFix (IEntity item, string oldName, string newName)
- {
- this.OldName = oldName;
- this.NewName = newName;
- this.Item = item;
- }
+// public IEntity Item { get; private set; }
+//
+// public RenameMemberFix (IEntity item, string oldName, string newName)
+// {
+// this.OldName = oldName;
+// this.NewName = newName;
+// this.Item = item;
+// }
public string FixType { get { return "RenameMember"; } }
}
@@ -58,23 +55,22 @@ namespace MonoDevelop.AnalysisCore.Fixes
{
//FIXME: why is this invalid on the parseddocuments loaded when the doc is first loaded?
//maybe the item's type's SourceProject is null?
- public IEnumerable<IAnalysisFixAction> GetFixes (MonoDevelop.Ide.Gui.Document doc, object fix)
+ public IEnumerable<IAnalysisFixAction> GetFixes (TextEditor editor, DocumentContext doc, object fix)
{
var renameFix = (RenameMemberFix)fix;
var refactoring = new RenameRefactoring ();
- var options = new RefactoringOptions (doc) {
- SelectedItem = renameFix.Item,
+ var options = new RefactoringOptions (editor, doc) {
+ // SelectedItem = renameFix.Item,
};
- if (renameFix.Item == null) {
- ResolveResult resolveResult;
-
- options.SelectedItem = CurrentRefactoryOperationsHandler.GetItem (options.Document, out resolveResult);
- }
-
- if (!refactoring.IsValid (options))
- yield break;
-
+// if (renameFix.Item == null) {
+// ResolveResult resolveResult;
+// options.SelectedItem = CurrentRefactoryOperationsHandler.GetItem (options.Editor, options.DocumentContext, out resolveResult);
+// }
+//
+// if (!refactoring.IsValid (options))
+// yield break;
+//
var prop = new RenameRefactoring.RenameProperties () {
NewName = renameFix.NewName,
};
@@ -113,25 +109,25 @@ namespace MonoDevelop.AnalysisCore.Fixes
public RenameRefactoring.RenameProperties Properties;
public bool Preview;
public string Label { get; set; }
- public DocumentRegion DocumentRegion { get; set; }
+ public TextSpan DocumentRegion { get; set; }
public string IdString { get; set; }
public void Fix ()
{
if (string.IsNullOrEmpty (Properties.NewName)) {
- Refactoring.Run (Options);
+ //Refactoring.RunInplace (Options);
return;
}
-
- //FIXME: performchanges should probably use a monitor too, as it can be slow
- var changes = Refactoring.PerformChanges (Options, Properties);
- if (Preview) {
- using (var dlg = new RefactoringPreviewDialog (changes))
- MessageService.ShowCustomDialog (dlg);
- } else {
- var monitor = IdeApp.Workbench.ProgressMonitors.GetBackgroundProgressMonitor ("Rename", null);
- RefactoringService.AcceptChanges (monitor, changes);
- }
+
+// //FIXME: performchanges should probably use a monitor too, as it can be slow
+// var changes = Refactoring.PerformChanges (Options, Properties);
+// if (Preview) {
+// using (var dlg = new RefactoringPreviewDialog (changes))
+// MessageService.ShowCustomDialog (dlg);
+// } else {
+// var monitor = IdeApp.Workbench.ProgressMonitors.GetBackgroundProgressMonitor ("Rename", null);
+// RefactoringService.AcceptChanges (monitor, changes);
+// }
}
public bool SupportsBatchFix {
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/AnalysisOptionsPanel.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/AnalysisOptionsPanel.cs
index b8ddfd008e..deeaf2b724 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/AnalysisOptionsPanel.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/AnalysisOptionsPanel.cs
@@ -27,6 +27,7 @@
using System;
using MonoDevelop.Ide.Gui.Dialogs;
using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide;
@@ -36,7 +37,7 @@ namespace MonoDevelop.AnalysisCore.Gui
{
AnalysisOptionsWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new AnalysisOptionsWidget () {
AnalysisEnabled = AnalysisOptions.AnalysisEnabled,
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultMarker.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultMarker.cs
index 332f0061cf..43ddf40ef4 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultMarker.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultMarker.cs
@@ -24,15 +24,13 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using Mono.TextEditor;
-using MonoDevelop.SourceEditor;
-using MonoDevelop.SourceEditor.QuickTasks;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.Refactoring;
using System.Collections.Generic;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.AnalysisCore.Gui
{
+/*
class ResultMarker : UnderlineTextSegmentMarker
{
readonly Result result;
@@ -42,17 +40,9 @@ namespace MonoDevelop.AnalysisCore.Gui
this.result = result;
}
- static bool IsOneLine (Result result)
- {
- return result.Region.BeginLine == result.Region.EndLine;
- }
-
public Result Result { get { return result; } }
//utility for debugging
- public int Line { get { return result.Region.BeginLine; } }
- public int ColStart { get { return IsOneLine (result)? (result.Region.BeginColumn) : 0; } }
- public int ColEnd { get { return IsOneLine (result)? (result.Region.EndColumn) : 0; } }
public string Message { get { return result.Message; } }
static Cairo.Color GetColor (TextEditor editor, Result result)
@@ -214,4 +204,5 @@ namespace MonoDevelop.AnalysisCore.Gui
}
#endregion
}
+*/
}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs
index e826f51f45..682e6cfe9d 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultTooltipProvider.cs
@@ -1,95 +1,74 @@
-//
-// ResultTooltipProvider.cs
-//
-// Author:
-// Michael Hutchinson <mhutchinson@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using Mono.TextEditor;
-using MonoDevelop.SourceEditor;
-using System.Text;
-using System.Collections.Generic;
-using MonoDevelop.Ide.TypeSystem;
-
-namespace MonoDevelop.AnalysisCore.Gui
-{
- class ResultTooltipProvider : TooltipProvider
- {
- public ResultTooltipProvider ()
- {
- }
-
- public override TooltipItem GetItem (TextEditor editor, int offset)
- {
- //get the ResultsEditorExtension from the editor
- var ed = editor as ExtensibleTextEditor;
- if (ed == null)
- return null;
- var ext = ed.Extension;
- while (ext != null && !(ext is ResultsEditorExtension))
- ext = ext.Next;
- if (ext == null)
- return null;
- var resExt = (ResultsEditorExtension) ext;
-
- //get the results from the extension
- var results = resExt.GetResultsAtOffset (offset);
- if (results == null || results.Count == 0)
- return null;
-
- return new TooltipItem (results, editor.Document.GetLineByOffset (offset));
- }
-
- protected override Gtk.Window CreateTooltipWindow (TextEditor editor, int offset, Gdk.ModifierType modifierState, TooltipItem item)
- {
- //create a message string from all the results
- var results = (IList<Result>)item.Item;
- var sb = new StringBuilder ();
- bool first = false;
- foreach (var r in results) {
- if (!first)
- first = true;
- else
- sb.AppendLine ();
- sb.Append (r.Level.ToString ());
- sb.Append (": ");
- sb.Append (AmbienceService.EscapeText (r.Message));
- }
-
- //FIXME: use a nicer, more specialized tooltip window, with results formatting and hints about
- // commands and stuff
- var win = new LanguageItemWindow ((ExtensibleTextEditor) editor, modifierState, null, sb.ToString (), null);
- if (win.IsEmpty)
- return null;
- return win;
- }
-
- protected override void GetRequiredPosition (TextEditor editor, Gtk.Window tipWindow, out int requiredWidth, out double xalign)
- {
- var win = (LanguageItemWindow) tipWindow;
- requiredWidth = win.SetMaxWidth (win.Screen.Width);
- xalign = 0.5;
- }
- }
-}
-
+//
+// ResultTooltipProvider.cs
+//
+// Author:
+// Michael Hutchinson <mhutchinson@novell.com>
+//
+// Copyright (c) 2010 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Text;
+using System.Collections.Generic;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.SourceEditor;
+using System.Linq;
+using MonoDevelop.Components;
+using System.Threading.Tasks;
+using System.Threading;
+
+namespace MonoDevelop.AnalysisCore.Gui
+{
+ class ResultTooltipProvider : TooltipProvider
+ {
+ #region ITooltipProvider implementation
+ public override Task<TooltipItem> GetItem (TextEditor editor, DocumentContext ctx, int offset, CancellationToken token = default (CancellationToken))
+ {
+ foreach (var marker in editor.GetTextSegmentMarkersAt (offset)) {
+ var result = marker.Tag as Result;
+ if (result != null)
+ return Task.FromResult(new TooltipItem (result, marker.Offset, marker.Length));
+ }
+ return Task.FromResult<TooltipItem> (null);
+
+ }
+
+ public override Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Xwt.ModifierKeys modifierState)
+ {
+ var result = item.Item as Result;
+
+ var window = new LanguageItemWindow (CompileErrorTooltipProvider.GetExtensibleTextEditor (editor), modifierState, null, result.Message, null);
+ if (window.IsEmpty)
+ return null;
+ return window;
+ }
+
+ public override void GetRequiredPosition (TextEditor editor, Control tipWindow, out int requiredWidth, out double xalign)
+ {
+ var win = (LanguageItemWindow) tipWindow;
+ requiredWidth = win.SetMaxWidth (win.Screen.Width / 4);
+ xalign = 0.5;
+ }
+ #endregion
+
+
+ }
+}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultsEditorExtension.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultsEditorExtension.cs
index 4806feac47..f10459f87a 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultsEditorExtension.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultsEditorExtension.cs
@@ -30,20 +30,36 @@ using MonoDevelop.Ide.Gui.Content;
using System.Threading;
using System.Threading.Tasks;
using System.IO;
-using Mono.TextEditor;
using System.Linq;
-using MonoDevelop.SourceEditor.QuickTasks;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.Refactoring;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Editor.Highlighting;
+using MonoDevelop.Ide.Editor.Extension;
+using Microsoft.CodeAnalysis;
using MonoDevelop.CodeIssues;
+using System.Collections.Immutable;
namespace MonoDevelop.AnalysisCore.Gui
{
+ class AnalysisDocument
+ {
+ public TextEditor Editor { get; private set; }
+ public DocumentLocation CaretLocation { get; private set; }
+ public DocumentContext DocumentContext { get; private set; }
+
+ public AnalysisDocument (TextEditor editor, DocumentContext documentContext)
+ {
+ this.Editor = editor;
+ this.CaretLocation = editor.CaretLocation;
+ this.DocumentContext = documentContext;
+ }
+ }
+
public class ResultsEditorExtension : TextEditorExtension, IQuickTaskProvider
{
bool disposed;
- public override void Initialize ()
+ protected override void Initialize ()
{
base.Initialize ();
@@ -61,13 +77,12 @@ namespace MonoDevelop.AnalysisCore.Gui
if (disposed)
return;
enabled = false;
- Document.DocumentParsed -= OnDocumentParsed;
+ DocumentContext.DocumentParsed -= OnDocumentParsed;
CancelUpdateTimout ();
CancelTask ();
AnalysisOptions.AnalysisEnabled.Changed -= AnalysisOptionsChanged;
while (markers.Count > 0)
- Document.Editor.Document.RemoveMarker (markers.Dequeue ());
- tasks.Clear ();
+ Editor.RemoveMarker (markers.Dequeue ());
disposed = true;
}
@@ -90,20 +105,16 @@ namespace MonoDevelop.AnalysisCore.Gui
if (enabled)
return;
enabled = true;
- Document.DocumentParsed += OnDocumentParsed;
- if (Document.ParsedDocument != null)
+ DocumentContext.DocumentParsed += OnDocumentParsed;
+ if (DocumentContext.ParsedDocument != null)
OnDocumentParsed (null, null);
}
void CancelTask ()
{
- if (src != null) {
- src.Cancel ();
- try {
- oldTask.Wait ();
- } catch (TaskCanceledException) {
- } catch (AggregateException ex) {
- ex.Handle (e => e is TaskCanceledException);
+ lock (updateLock) {
+ if (src != null) {
+ src.Cancel ();
}
}
}
@@ -113,33 +124,39 @@ namespace MonoDevelop.AnalysisCore.Gui
if (!enabled)
return;
enabled = false;
- Document.DocumentParsed -= OnDocumentParsed;
+ DocumentContext.DocumentParsed -= OnDocumentParsed;
CancelTask ();
new ResultsUpdater (this, new Result[0], CancellationToken.None).Update ();
}
- Task oldTask;
CancellationTokenSource src = null;
object updateLock = new object();
uint updateTimeout = 0;
void OnDocumentParsed (object sender, EventArgs args)
{
- if (!QuickTaskStrip.EnableFancyFeatures)
+ if (!AnalysisOptions.EnableFancyFeatures)
return;
CancelUpdateTimout ();
- var doc = Document.ParsedDocument;
- if (doc == null)
+ var doc = DocumentContext.ParsedDocument;
+ if (doc == null || DocumentContext.IsAdHocProject)
return;
updateTimeout = GLib.Timeout.Add (250, delegate {
lock (updateLock) {
CancelTask ();
src = new CancellationTokenSource ();
var token = src.Token;
- oldTask = Task.Run (() => {
- var result = CodeAnalysisRunner.Check (Document, doc, token);
- var updater = new ResultsUpdater (this, result, token);
- updater.Update ();
+ var ad = new AnalysisDocument (Editor, DocumentContext);
+ Task.Run (() => {
+ try {
+ var result = CodeDiagnosticRunner.Check (ad, token).Result;
+ if (token.IsCancellationRequested)
+ return;
+ var updater = new ResultsUpdater (this, result, token);
+ updater.Update ();
+ } catch (OperationCanceledException) {
+ } catch (AggregateException) {
+ }
});
updateTimeout = 0;
return false;
@@ -155,6 +172,7 @@ namespace MonoDevelop.AnalysisCore.Gui
}
}
+
class ResultsUpdater
{
readonly ResultsEditorExtension ext;
@@ -163,6 +181,7 @@ namespace MonoDevelop.AnalysisCore.Gui
//the number of markers at the head of the queue that need tp be removed
int oldMarkers;
IEnumerator<Result> enumerator;
+ ImmutableArray<QuickTask>.Builder builder;
public ResultsUpdater (ResultsEditorExtension ext, IEnumerable<Result> results, CancellationToken cancellationToken)
{
@@ -173,17 +192,34 @@ namespace MonoDevelop.AnalysisCore.Gui
this.ext = ext;
this.cancellationToken = cancellationToken;
this.oldMarkers = ext.markers.Count;
+ builder = ImmutableArray<QuickTask>.Empty.ToBuilder ();
enumerator = ((IEnumerable<Result>)results).GetEnumerator ();
}
public void Update ()
{
- if (!QuickTaskStrip.EnableFancyFeatures || cancellationToken.IsCancellationRequested)
+ if (!AnalysisOptions.EnableFancyFeatures || cancellationToken.IsCancellationRequested)
return;
- ext.tasks.Clear ();
+ ext.tasks = ext.tasks.Clear ();
GLib.Idle.Add (IdleHandler);
}
-
+
+ static Cairo.Color GetColor (TextEditor editor, Result result)
+ {
+ switch (result.Level) {
+ case DiagnosticSeverity.Hidden:
+ return DefaultSourceEditorOptions.Instance.GetColorStyle ().PlainText.Background;
+ case DiagnosticSeverity.Error:
+ return DefaultSourceEditorOptions.Instance.GetColorStyle ().UnderlineError.Color;
+ case DiagnosticSeverity.Warning:
+ return DefaultSourceEditorOptions.Instance.GetColorStyle ().UnderlineWarning.Color;
+ case DiagnosticSeverity.Info:
+ return DefaultSourceEditorOptions.Instance.GetColorStyle ().UnderlineSuggestion.Color;
+ default:
+ throw new System.ArgumentOutOfRangeException ();
+ }
+ }
+
//this runs as a glib idle handler so it can add/remove text editor markers
//in order to to block the GUI thread, we batch them in UPDATE_COUNT
bool IdleHandler ()
@@ -191,45 +227,49 @@ namespace MonoDevelop.AnalysisCore.Gui
if (cancellationToken.IsCancellationRequested)
return false;
var editor = ext.Editor;
- if (editor == null || editor.Document == null)
+ if (editor == null)
return false;
//clear the old results out at the same rate we add in the new ones
for (int i = 0; oldMarkers > 0 && i < UPDATE_COUNT; i++) {
if (cancellationToken.IsCancellationRequested)
return false;
- editor.Document.RemoveMarker (ext.markers.Dequeue ());
+ editor.RemoveMarker (ext.markers.Dequeue ());
oldMarkers--;
}
//add in the new markers
for (int i = 0; i < UPDATE_COUNT; i++) {
if (!enumerator.MoveNext ()) {
+ ext.tasks = builder.ToImmutable ();
ext.OnTasksUpdated (EventArgs.Empty);
return false;
}
if (cancellationToken.IsCancellationRequested)
return false;
var currentResult = (Result)enumerator.Current;
-
if (currentResult.InspectionMark != IssueMarker.None) {
- int start = editor.LocationToOffset (currentResult.Region.Begin);
- int end = editor.LocationToOffset (currentResult.Region.End);
+ int start = currentResult.Region.Start;
+ int end = currentResult.Region.End;
if (start >= end)
continue;
if (currentResult.InspectionMark == IssueMarker.GrayOut) {
- var marker = new GrayOutMarker (currentResult, TextSegment.FromBounds (start, end));
+ var marker = TextMarkerFactory.CreateGenericTextSegmentMarker (editor, TextSegmentMarkerEffect.GrayOut, TextSegment.FromBounds (start, end));
marker.IsVisible = currentResult.Underline;
- editor.Document.AddMarker (marker);
+ marker.Tag = currentResult;
+ editor.AddMarker (marker);
ext.markers.Enqueue (marker);
- editor.Parent.TextViewMargin.RemoveCachedLine (editor.GetLineByOffset (start));
- editor.Parent.QueueDraw ();
+// editor.Parent.TextViewMargin.RemoveCachedLine (editor.GetLineByOffset (start));
+// editor.Parent.QueueDraw ();
} else {
- var marker = new ResultMarker (currentResult, TextSegment.FromBounds (start, end));
+ var effect = currentResult.InspectionMark == IssueMarker.DottedLine ? TextSegmentMarkerEffect.DottedLine : TextSegmentMarkerEffect.WavedLine;
+ var marker = TextMarkerFactory.CreateGenericTextSegmentMarker (editor, effect, TextSegment.FromBounds (start, end));
+ marker.Color = GetColor (editor, currentResult);
marker.IsVisible = currentResult.Underline;
- editor.Document.AddMarker (marker);
+ marker.Tag = currentResult;
+ editor.AddMarker (marker);
ext.markers.Enqueue (marker);
}
}
- ext.tasks.Add (new QuickTask (currentResult.Message, currentResult.Region.Begin, currentResult.Level));
+ builder.Add (new QuickTask (currentResult.Message, currentResult.Region.Start, currentResult.Level));
}
return true;
@@ -237,7 +277,7 @@ namespace MonoDevelop.AnalysisCore.Gui
}
//all markers known to be in the editor
- Queue<ResultMarker> markers = new Queue<ResultMarker> ();
+ Queue<IGenericTextSegmentMarker> markers = new Queue<IGenericTextSegmentMarker> ();
const int UPDATE_COUNT = 20;
@@ -247,23 +287,23 @@ namespace MonoDevelop.AnalysisCore.Gui
// var line = Editor.GetLineByOffset (offset);
var list = new List<Result> ();
- foreach (var marker in Editor.Document.GetTextSegmentMarkersAt (offset)) {
+ foreach (var marker in Editor.GetTextSegmentMarkersAt (offset)) {
if (token.IsCancellationRequested)
break;
- var resultMarker = marker as ResultMarker;
- if (resultMarker != null)
- list.Add (resultMarker.Result);
+ var resultMarker = marker as IGenericTextSegmentMarker;
+ if (resultMarker != null && resultMarker.Tag is Result)
+ list.Add (resultMarker.Tag as Result);
}
return list;
}
public IEnumerable<Result> GetResults ()
{
- return markers.Select (m => m.Result);
+ return markers.Select (m => m.Tag).OfType<Result> ();
}
#region IQuickTaskProvider implementation
- List<QuickTask> tasks = new List<QuickTask> ();
+ ImmutableArray<QuickTask> tasks = ImmutableArray<QuickTask>.Empty;
public event EventHandler TasksUpdated;
@@ -274,7 +314,7 @@ namespace MonoDevelop.AnalysisCore.Gui
handler (this, e);
}
- public IEnumerable<QuickTask> QuickTasks {
+ public ImmutableArray<QuickTask> QuickTasks {
get {
return tasks;
}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/IssueMarker.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/IssueMarker.cs
new file mode 100644
index 0000000000..8713caf62d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/IssueMarker.cs
@@ -0,0 +1,55 @@
+//
+// IssueMarker.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.AnalysisCore
+{
+ /// <summary>
+ /// The issue marker is used to set how an issue should be marked inside the text editor.
+ /// </summary>
+ public enum IssueMarker
+ {
+ /// <summary>
+ /// The issue is not shown inside the text editor. (But in the task bar)
+ /// </summary>
+ None,
+
+ /// <summary>
+ /// The region is marked as underline in the severity color.
+ /// </summary>
+ WavedLine,
+
+ /// <summary>
+ /// The region is marked as dotted line in the severity color.
+ /// </summary>
+ DottedLine,
+
+ /// <summary>
+ /// The text is grayed out.
+ /// </summary>
+ GrayOut
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Result.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Result.cs
index 0e89e12711..7ed4a24101 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Result.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Result.cs
@@ -25,25 +25,22 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.NRefactory.Refactoring;
using MonoDevelop.AnalysisCore.Extensions;
-using MonoDevelop.SourceEditor;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.SourceEditor.QuickTasks;
-using ICSharpCode.NRefactory.CSharp;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.AnalysisCore
{
public class Result
{
- public Result (DomRegion region, string message, bool underLine = true)
+ public Result (TextSpan region, string message, bool underLine = true)
{
this.Region = region;
this.Message = message;
this.Underline = underLine;
}
- public Result (DomRegion region, string message, Severity level, IssueMarker inspectionMark, bool underline = true)
+ public Result (TextSpan region, string message, DiagnosticSeverity level, IssueMarker inspectionMark, bool underline = true)
{
this.Region = region;
this.Message = message;
@@ -52,7 +49,7 @@ namespace MonoDevelop.AnalysisCore
this.Underline = underline;
}
- public void SetSeverity (Severity level, IssueMarker inspectionMark)
+ public void SetSeverity (DiagnosticSeverity level, IssueMarker inspectionMark)
{
this.Level = level;
this.InspectionMark = inspectionMark;
@@ -66,9 +63,9 @@ namespace MonoDevelop.AnalysisCore
}
public string Message { get; private set; }
- public Severity Level { get; private set; }
+ public DiagnosticSeverity Level { get; private set; }
public IssueMarker InspectionMark { get; private set; }
- public DomRegion Region { get; private set; }
+ public TextSpan Region { get; private set; }
public bool Underline { get; private set; }
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Rules/Adaptors.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Rules/Adaptors.cs
deleted file mode 100644
index eaf8c6a3af..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Rules/Adaptors.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// Adaptors.cs
-//
-// Author:
-// Michael Hutchinson <mhutchinson@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-using MonoDevelop.AnalysisCore.Fixes;
-using MonoDevelop.Ide.Gui;
-using ICSharpCode.NRefactory.TypeSystem;
-
-namespace MonoDevelop.AnalysisCore.Rules
-{
- public static class Adapters
- {
- public static IUnresolvedFile GetCompilationUnit (Document input)
- {
- return input.ParsedDocument.ParsedFile;
- }
- }
-} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/AnalysisCodeAction.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/AnalysisCodeAction.cs
deleted file mode 100644
index 5641aecb60..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/AnalysisCodeAction.cs
+++ /dev/null
@@ -1,116 +0,0 @@
-//
-// AnalysisQuickFix.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using MonoDevelop.AnalysisCore;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory;
-using System.Threading;
-using MonoDevelop.Ide;
-using MonoDevelop.CodeIssues;
-using MonoDevelop.AnalysisCore.Fixes;
-using Mono.TextEditor;
-using MonoDevelop.Ide.TypeSystem;
-
-namespace MonoDevelop.CodeActions
-{
- class AnalysisContextActionProvider : CodeActionProvider
- {
- public Result Result {
- get;
- private set;
- }
-
- public IAnalysisFixAction Action {
- get;
- private set;
- }
-
- public AnalysisContextActionProvider (Result result, IAnalysisFixAction action)
- {
- Result = result;
- Action = action;
- Description = result.Message;
- }
-
- public override System.Collections.Generic.IEnumerable<CodeAction> GetActions (MonoDevelop.Ide.Gui.Document document, object refactoringContext, TextLocation loc, CancellationToken cancellationToken)
- {
- yield return new AnalysisCodeAction (Action, Result) {
- DocumentRegion = Action.DocumentRegion
- };
- }
-
- internal class AnalysisCodeAction : CodeAction
- {
- public IAnalysisFixAction Action {
- get;
- private set;
- }
- public Result Result {
- get;
- private set;
- }
-
- public AnalysisCodeAction (IAnalysisFixAction action, Result result)
- {
- Action = action;
- Title = action.Label;
- Result = result;
- IdString = action.IdString;
- }
-
- public override void Run (IRefactoringContext context, object script)
- {
- Action.Fix ();
- }
-
- public override bool SupportsBatchRunning {
- get {
- return Action.SupportsBatchFix;
- }
- }
-
- public override void BatchRun (MonoDevelop.Ide.Gui.Document document, TextLocation loc)
- {
- Action.BatchFix ();
- }
-
- public void ShowOptions (object sender, EventArgs e)
- {
- var inspectorResults = Result as InspectorResults;
- if (inspectorResults != null)
- inspectorResults.ShowResultOptionsDialog ();
- }
-
- public void HideCodeIssue (object sender, EventArgs e)
- {
- var inspectorResults = Result as InspectorResults;
- if (inspectorResults != null)
- inspectorResults.Inspector.SetIsEnabled (false);
- }
- }
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeAction.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeAction.cs
deleted file mode 100644
index 0aef83200c..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeAction.cs
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// Result.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using ICSharpCode.NRefactory;
-using System;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-using ICSharpCode.NRefactory.Refactoring;
-using MonoDevelop.Ide.TypeSystem;
-
-namespace MonoDevelop.CodeActions
-{
- /// <summary>
- /// A code action represents a menu entry that does edit operation in one document.
- /// </summary>
- public abstract class CodeAction
- {
- /// <summary>
- /// Gets or sets the menu item text.
- /// </summary>
- public string Title { get; set; }
-
- /// <summary>
- /// Gets or sets the id string. The id is used to identify a specific code action.
- /// </summary>
- public string IdString { get; set; }
-
- /// <summary>
- /// The region of the code action.
- /// </summary>
- public DocumentRegion DocumentRegion { get; set; }
-
- /// <summary>
- /// Gets or sets the type of the inspector that is the source of this action.
- /// </summary>
- /// <value>The type of the inspector.</value>
- public Type InspectorType { get; set; }
-
- /// <summary>
- /// Gets or sets the sibling key.
- /// </summary>
- /// <value>The sibling key.</value>
- public object SiblingKey { get; set; }
-
- /// <summary>
- /// Gets or sets the severity of the code action.
- /// </summary>
- /// <value>The severity.</value>
- public Severity Severity { get; set; }
-
- protected CodeAction ()
- {
- IdString = GetType ().FullName;
- }
-
- /// <summary>
- /// Performs the specified code action in document at loc.
- /// </summary>
- public abstract void Run (IRefactoringContext context, object script);
-
- /// <summary>
- /// True if <see cref="BatchRun"/> can be used on the current instance.
- /// </summary>
- /// <value><c>true</c> if supports batch running; otherwise, <c>false</c>.</value>
- public virtual bool SupportsBatchRunning {
- get{
- return false;
- }
- }
-
- public virtual void BatchRun (MonoDevelop.Ide.Gui.Document document, TextLocation loc)
- {
- if (!SupportsBatchRunning) {
- throw new InvalidOperationException ("Batch running is not supported.");
- }
- }
- }
-
- public class DefaultCodeAction : CodeAction
- {
- public Action<RefactoringContext, Script> act;
-
- public DefaultCodeAction (string title, Action<RefactoringContext, Script> act)
- {
- Title = title;
- this.act = act;
- }
-
- public override void Run (IRefactoringContext context, object script)
- {
- act ((RefactoringContext)context, (Script)script);
- }
- }
-
-}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionAddinNode.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionAddinNode.cs
deleted file mode 100644
index 11b7701fbd..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionAddinNode.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// ContextActionCodon.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using Mono.Addins;
-
-namespace MonoDevelop.CodeActions
-{
- public class CodeActionAddinNode : TypeExtensionNode
- {
- [NodeAttribute ("mimeType", Required=true, Description="The mime type of this action.")]
- string mimeType = null;
-
- public string MimeType {
- get {
- return mimeType;
- }
- }
-
- [NodeAttribute ("_title", Required=true, Localizable=true, Description="The title of this action.")]
- string title = null;
-
- public string Title {
- get {
- return title;
- }
- }
-
- [NodeAttribute ("_description", Required=true, Localizable=true, Description="The description of this action.")]
- string description = null;
-
- public string Description {
- get {
- return description;
- }
- }
-
- CodeActionProvider action;
- public CodeActionProvider Action {
- get {
- if (action == null) {
- action = (CodeActionProvider)CreateInstance ();
- action.Title = title;
- action.Description = description;
- action.MimeType = MimeType;
- }
-
- return action;
- }
- }
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionContainer.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionContainer.cs
new file mode 100644
index 0000000000..f8522866e1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionContainer.cs
@@ -0,0 +1,119 @@
+//
+// CodeActionContainer.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis.CodeActions;
+using System;
+using MonoDevelop.CodeIssues;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using System.Collections;
+
+namespace MonoDevelop.CodeActions
+{
+ class CodeActionContainer
+ {
+ public static readonly CodeActionContainer Empty = new CodeActionContainer();
+
+ public bool IsEmpty {
+ get {
+ return CodeFixActions.Count + DiagnosticsAtCaret.Count + CodeRefactoringActions.Count == 0;
+ }
+ }
+
+ IReadOnlyList<ValidCodeDiagnosticAction> codeFixActions;
+ public IReadOnlyList<ValidCodeDiagnosticAction> CodeFixActions {
+ get {
+ return codeFixActions ?? new ValidCodeDiagnosticAction[0];
+ }
+ private set {
+ codeFixActions = value;
+ }
+ }
+
+ IReadOnlyList<ValidCodeAction> codeRefactoringActions;
+
+ public IReadOnlyList<ValidCodeAction> CodeRefactoringActions {
+ get {
+ return codeRefactoringActions ?? new ValidCodeAction[0];
+ }
+ private set {
+ codeRefactoringActions = value;
+ }
+ }
+
+ public IEnumerable<ValidCodeAction> AllValidCodeActions {
+ get {
+ return CodeRefactoringActions.Concat (CodeFixActions);
+ }
+ }
+
+ IReadOnlyList<Diagnostic> diagnosticsAtCaret;
+ public IReadOnlyList<Diagnostic> DiagnosticsAtCaret {
+ get {
+ return diagnosticsAtCaret ?? new Diagnostic[0];
+ }
+ private set {
+ diagnosticsAtCaret = value.Distinct (new DiagnosticComparer()).ToList ();
+ }
+ }
+
+ class DiagnosticComparer : IEqualityComparer<Diagnostic>
+ {
+ bool IEqualityComparer<Diagnostic>.Equals (Diagnostic x, Diagnostic y)
+ {
+ if (x.Id != null && y.Id != null)
+ return x.Id == y.Id;
+ return x.Equals (y);
+ }
+
+ int IEqualityComparer<Diagnostic>.GetHashCode (Diagnostic obj)
+ {
+ return obj.Id != null ? obj.Id.GetHashCode () : obj.GetHashCode ();
+ }
+ }
+
+ CodeActionContainer ()
+ {
+ CodeFixActions = new List<ValidCodeDiagnosticAction> ();
+ CodeRefactoringActions = new List<ValidCodeAction> ();
+ DiagnosticsAtCaret = new List<Diagnostic> ();
+ }
+
+ internal CodeActionContainer (List<ValidCodeDiagnosticAction> codeDiagnosticActions, List<ValidCodeAction> codeRefactoringActions, List<Diagnostic> diagnosticsAtCaret)
+ {
+ if (codeDiagnosticActions == null)
+ throw new ArgumentNullException ("codeDiagnosticActions");
+ if (codeRefactoringActions == null)
+ throw new ArgumentNullException ("codeRefactoringActions");
+ if (diagnosticsAtCaret == null)
+ throw new ArgumentNullException ("diagnosticsAtCaret");
+ CodeFixActions = codeDiagnosticActions;
+ CodeRefactoringActions = codeRefactoringActions;
+ DiagnosticsAtCaret = diagnosticsAtCaret;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs
index fc93c8dc00..4b13b80f07 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs
@@ -24,38 +24,39 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using MonoDevelop.Ide.Gui.Content;
using Gtk;
-using Mono.TextEditor;
using System.Collections.Generic;
using MonoDevelop.Components.Commands;
-using MonoDevelop.SourceEditor.QuickTasks;
using System.Linq;
using MonoDevelop.Refactoring;
-using ICSharpCode.NRefactory;
using System.Threading;
using MonoDevelop.Core;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.Semantics;
-using MonoDevelop.AnalysisCore.Fixes;
-using ICSharpCode.NRefactory.Refactoring;
+using Microsoft.CodeAnalysis.CodeFixes;
+using MonoDevelop.CodeIssues;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide;
+using Microsoft.CodeAnalysis.CodeActions;
+using RefactoringEssentials;
+using MonoDevelop.AnalysisCore;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Components;
+using MonoDevelop.Ide.Editor.Extension;
+using System.Collections.Immutable;
+using Microsoft.CodeAnalysis.Formatting;
+using Microsoft.CodeAnalysis;
+using System.Reflection;
using MonoDevelop.Ide.Gui;
+using Microsoft.CodeAnalysis.Diagnostics;
namespace MonoDevelop.CodeActions
{
- class CodeActionEditorExtension : TextEditorExtension
+ class CodeActionEditorExtension : TextEditorExtension
{
- uint quickFixTimeout;
-
const int menuTimeout = 250;
uint smartTagPopupTimeoutId;
uint menuCloseTimeoutId;
- FixMenuDescriptor codeActionMenu;
-
- public IEnumerable<CodeAction> Fixes {
- get;
- private set;
- }
static CodeActionEditorExtension ()
{
@@ -67,6 +68,7 @@ namespace MonoDevelop.CodeActions
void CancelSmartTagPopupTimeout ()
{
+
if (smartTagPopupTimeoutId != 0) {
GLib.Source.Remove (smartTagPopupTimeoutId);
smartTagPopupTimeoutId = 0;
@@ -80,27 +82,31 @@ namespace MonoDevelop.CodeActions
menuCloseTimeoutId = 0;
}
}
-
+
void RemoveWidget ()
{
if (currentSmartTag != null) {
- document.Editor.Document.RemoveMarker (currentSmartTag);
+ Editor.RemoveMarker (currentSmartTag);
+ currentSmartTag.CancelPopup -= CurrentSmartTag_CancelPopup;
+ currentSmartTag.ShowPopup -= CurrentSmartTag_ShowPopup;
+
currentSmartTag = null;
- currentSmartTagBegin = DocumentLocation.Empty;
+ currentSmartTagBegin = -1;
}
CancelSmartTagPopupTimeout ();
-
}
-
+
public override void Dispose ()
{
CancelMenuCloseTimer ();
CancelQuickFixTimer ();
- document.Editor.SelectionChanged -= HandleSelectionChanged;
- document.DocumentParsed -= HandleDocumentDocumentParsed;
- document.Editor.Parent.BeginHover -= HandleBeginHover;
+ Editor.CaretPositionChanged -= HandleCaretPositionChanged;
+ Editor.SelectionChanged -= HandleSelectionChanged;
+ DocumentContext.DocumentParsed -= HandleDocumentDocumentParsed;
+ Editor.MouseMoved -= HandleBeginHover;
+ Editor.TextChanged -= Editor_TextChanged;
+ Editor.EndAtomicUndoOperation -= Editor_EndAtomicUndoOperation;
RemoveWidget ();
- Fixes = null;
base.Dispose ();
}
@@ -108,6 +114,8 @@ namespace MonoDevelop.CodeActions
static void ConfirmUsage (string id)
{
+ if (id == null)
+ return;
if (!CodeActionUsages.ContainsKey (id)) {
CodeActionUsages [id] = 1;
} else {
@@ -120,70 +128,150 @@ namespace MonoDevelop.CodeActions
internal static int GetUsage (string id)
{
int result;
- if (!CodeActionUsages.TryGetValue (id, out result))
+ if (id == null || !CodeActionUsages.TryGetValue (id, out result))
return 0;
return result;
}
public void CancelQuickFixTimer ()
{
- if (quickFixCancellationTokenSource != null)
- quickFixCancellationTokenSource.Cancel ();
- if (quickFixTimeout != 0) {
- GLib.Source.Remove (quickFixTimeout);
- quickFixTimeout = 0;
- }
+ quickFixCancellationTokenSource.Cancel ();
+ quickFixCancellationTokenSource = new CancellationTokenSource ();
+ smartTagTask = null;
}
- CancellationTokenSource quickFixCancellationTokenSource;
+ Task<CodeActionContainer> smartTagTask;
+ CancellationTokenSource quickFixCancellationTokenSource = new CancellationTokenSource ();
+ List<CodeDiagnosticFixDescriptor> codeFixes;
- public override void CursorPositionChanged ()
+ void HandleCaretPositionChanged (object sender, EventArgs e)
{
+ if (Editor.IsInAtomicUndo)
+ return;
CancelQuickFixTimer ();
- if (QuickTaskStrip.EnableFancyFeatures && Document.ParsedDocument != null && !Debugger.DebuggingService.IsDebugging) {
- quickFixCancellationTokenSource = new CancellationTokenSource ();
+ if (AnalysisOptions.EnableFancyFeatures && DocumentContext.ParsedDocument != null) {
var token = quickFixCancellationTokenSource.Token;
- quickFixTimeout = GLib.Timeout.Add (100, delegate {
- var loc = Document.Editor.Caret.Location;
- RefactoringService.QueueQuickFixAnalysis (Document, loc, token, delegate(List<CodeAction> fixes) {
- if (!fixes.Any ()) {
- ICSharpCode.NRefactory.Semantics.ResolveResult resolveResult;
- AstNode node;
- if (ResolveCommandHandler.ResolveAt (document, out resolveResult, out node, token)) {
- var possibleNamespaces = ResolveCommandHandler.GetPossibleNamespaces (document, node, ref resolveResult);
- if (!possibleNamespaces.Any ()) {
- if (currentSmartTag != null)
- Application.Invoke (delegate { RemoveWidget (); });
- return;
+ var curOffset = Editor.CaretOffset;
+ if (HasCurrentFixes) {
+ foreach (var fix in GetCurrentFixes ().AllValidCodeActions) {
+ if (!fix.ValidSegment.Contains (curOffset)) {
+ RemoveWidget ();
+ break;
+ }
+ }
+ }
+
+ var loc = Editor.CaretOffset;
+ var ad = DocumentContext.AnalysisDocument;
+ if (ad == null) {
+ return;
+ }
+
+ TextSpan span;
+
+ if (Editor.IsSomethingSelected) {
+ var selectionRange = Editor.SelectionRange;
+ span = selectionRange.Offset >= 0 ? TextSpan.FromBounds (selectionRange.Offset, selectionRange.EndOffset) : TextSpan.FromBounds (loc, loc);
+ } else {
+ span = TextSpan.FromBounds (loc, loc);
+ }
+
+ var diagnosticsAtCaret =
+ Editor.GetTextSegmentMarkersAt (Editor.CaretOffset)
+ .OfType<IGenericTextSegmentMarker> ()
+ .Select (rm => rm.Tag)
+ .OfType<DiagnosticResult> ()
+ .Select (dr => dr.Diagnostic)
+ .ToList ();
+
+ var errorList = Editor
+ .GetTextSegmentMarkersAt (Editor.CaretOffset)
+ .OfType<IErrorMarker> ()
+ .Where (rm => !string.IsNullOrEmpty (rm.Error.Id)).ToList ();
+ int editorLength = Editor.Length;
+
+ smartTagTask = Task.Run (async delegate {
+ try {
+ var codeIssueFixes = new List<ValidCodeDiagnosticAction> ();
+ var diagnosticIds = diagnosticsAtCaret.Select (diagnostic => diagnostic.Id).Concat (errorList.Select (rm => rm.Error.Id)).ToList ();
+ if (codeFixes == null) {
+ codeFixes = (await CodeRefactoringService.GetCodeFixesAsync (DocumentContext, CodeRefactoringService.MimeTypeToLanguage (Editor.MimeType), token).ConfigureAwait (false)).ToList ();
+ }
+ foreach (var cfp in codeFixes) {
+ if (token.IsCancellationRequested)
+ return CodeActionContainer.Empty;
+ var provider = cfp.GetCodeFixProvider ();
+ if (!provider.FixableDiagnosticIds.Any (diagnosticIds.Contains))
+ continue;
+ try {
+ var groupedDiagnostics = diagnosticsAtCaret
+ .Concat (errorList.Select (em => em.Error.Tag)
+ .OfType<Diagnostic> ())
+ .GroupBy (d => d.Location.SourceSpan);
+ foreach (var g in groupedDiagnostics) {
+ if (token.IsCancellationRequested)
+ return CodeActionContainer.Empty;
+ var diagnosticSpan = g.Key;
+
+ var validDiagnostics = g.Where (d => provider.FixableDiagnosticIds.Contains (d.Id)).ToImmutableArray ();
+ if (validDiagnostics.Length == 0)
+ continue;
+ await provider.RegisterCodeFixesAsync (new CodeFixContext (ad, diagnosticSpan, validDiagnostics, (ca, d) => codeIssueFixes.Add (new ValidCodeDiagnosticAction (cfp, ca, validDiagnostics, diagnosticSpan)), token));
+
+ // TODO: Is that right ? Currently it doesn't really make sense to run one code fix provider on several overlapping diagnostics at the same location
+ // However the generate constructor one has that case and if I run it twice the same code action is generated twice. So there is a dupe check problem there.
+ // Work around for now is to only take the first diagnostic batch.
+ break;
}
- } else {
- if (currentSmartTag != null)
- Application.Invoke (delegate { RemoveWidget (); });
- return;
+ } catch (OperationCanceledException) {
+ return CodeActionContainer.Empty;
+ } catch (AggregateException ae) {
+ ae.Flatten ().Handle (aex => aex is OperationCanceledException);
+ return CodeActionContainer.Empty;
+ } catch (Exception ex) {
+ LoggingService.LogError ("Error while getting refactorings from code fix provider " + cfp.Name, ex);
+ continue;
}
}
+ var codeActions = new List<ValidCodeAction> ();
+ foreach (var action in await CodeRefactoringService.GetValidActionsAsync (Editor, DocumentContext, span, token).ConfigureAwait (false)) {
+ codeActions.Add (action);
+ }
+ var codeActionContainer = new CodeActionContainer (codeIssueFixes, codeActions, diagnosticsAtCaret);
Application.Invoke (delegate {
if (token.IsCancellationRequested)
return;
- CreateSmartTag (fixes, loc);
+ if (codeActionContainer.IsEmpty) {
+ RemoveWidget ();
+ return;
+ }
+ CreateSmartTag (codeActionContainer, loc);
});
- });
- quickFixTimeout = 0;
- return false;
- });
+ return codeActionContainer;
+
+ } catch (AggregateException ae) {
+ ae.Flatten ().Handle (aex => aex is OperationCanceledException);
+ return CodeActionContainer.Empty;
+ } catch (OperationCanceledException) {
+ return CodeActionContainer.Empty;
+ } catch (TargetInvocationException ex) {
+ if (ex.InnerException is OperationCanceledException)
+ return CodeActionContainer.Empty;
+ throw;
+ }
+
+ }, token);
} else {
RemoveWidget ();
}
- base.CursorPositionChanged ();
}
- internal static bool IsAnalysisOrErrorFix (CodeAction act)
+ internal static bool IsAnalysisOrErrorFix (Microsoft.CodeAnalysis.CodeActions.CodeAction act)
{
- return act is AnalysisContextActionProvider.AnalysisCodeAction || act.Severity == Severity.Error;
- }
-
+ return false;
+ }
- class FixMenuEntry
+ internal class FixMenuEntry
{
public static readonly FixMenuEntry Separator = new FixMenuEntry ("-", null);
public readonly string Label;
@@ -197,7 +285,7 @@ namespace MonoDevelop.CodeActions
}
}
- class FixMenuDescriptor : FixMenuEntry
+ internal class FixMenuDescriptor : FixMenuEntry
{
readonly List<FixMenuEntry> items = new List<FixMenuEntry> ();
@@ -217,7 +305,7 @@ namespace MonoDevelop.CodeActions
public void Add (FixMenuEntry entry)
{
- items.Add (entry);
+ items.Add (entry);
}
public object MotionNotifyEvent {
@@ -230,478 +318,506 @@ namespace MonoDevelop.CodeActions
{
FixMenuDescriptor menu = new FixMenuDescriptor ();
var fixMenu = menu;
- ResolveResult resolveResult;
- ICSharpCode.NRefactory.CSharp.AstNode node;
+ //ResolveResult resolveResult;
+ //ICSharpCode.NRefactory.CSharp.AstNode node;
int items = 0;
- if (ResolveCommandHandler.ResolveAt (document, out resolveResult, out node)) {
- var possibleNamespaces = MonoDevelop.Refactoring.ResolveCommandHandler.GetPossibleNamespaces (
- document,
- node,
- ref resolveResult
- );
-
- foreach (var t in possibleNamespaces.Where (tp => tp.OnlyAddReference)) {
- menu.Add (new FixMenuEntry (t.GetImportText (), delegate {
- new ResolveCommandHandler.AddImport (document, resolveResult, null, t.Reference, true, node).Run ();
- }));
- items++;
- }
- bool addUsing = !(resolveResult is AmbiguousTypeResolveResult);
- if (addUsing) {
- foreach (var t in possibleNamespaces.Where (tp => tp.IsAccessibleWithGlobalUsing)) {
- string ns = t.Namespace;
- var reference = t.Reference;
- menu.Add (new FixMenuEntry (t.GetImportText (),
- delegate {
- new ResolveCommandHandler.AddImport (document, resolveResult, ns, reference, true, node).Run ();
- })
- );
- items++;
- }
- }
+ // if (AddPossibleNamespace != null) {
+ // AddPossibleNamespace (Editor, DocumentContext, menu);
+ // items = menu.Items.Count;
+ // }
- bool resolveDirect = !(resolveResult is UnknownMemberResolveResult);
- if (resolveDirect) {
- foreach (var t in possibleNamespaces) {
- string ns = t.Namespace;
- var reference = t.Reference;
- menu.Add (new FixMenuEntry (t.GetInsertNamespaceText (document.Editor.GetTextBetween (node.StartLocation, node.EndLocation)),
- delegate {
- new ResolveCommandHandler.AddImport (document, resolveResult, ns, reference, false, node).Run ();
- }));
- items++;
- }
- }
-
- if (menu.Items.Any () && Fixes.Any ()) {
- fixMenu = new FixMenuDescriptor (GettextCatalog.GetString ("Quick Fixes"));
- menu.Add (fixMenu);
- items++;
- }
- }
PopulateFixes (fixMenu, ref items);
+
if (items == 0) {
return;
}
- document.Editor.SuppressTooltips = true;
- document.Editor.Parent.HideTooltip ();
+ Editor.SuppressTooltips = true;
if (menuAction != null)
menuAction (menu);
- var container = document.Editor.Parent;
- var p = container.LocationToPoint (currentSmartTagBegin);
+ var p = Editor.LocationToPoint (Editor.OffsetToLocation (currentSmartTagBegin));
+ Gtk.Widget widget = Editor;
var rect = new Gdk.Rectangle (
- p.X + container.Allocation.X ,
- p.Y + (int)document.Editor.LineHeight + container.Allocation.Y, 0, 0);
+ (int)p.X + widget.Allocation.X,
+ (int)p.Y + widget.Allocation.Y, 0, 0);
- ShowFixesMenu (document.Editor.Parent, rect, menu);
+ ShowFixesMenu (widget, rect, menu);
}
- #if MAC
- class ClosingMenuDelegate : AppKit.NSMenuDelegate
- {
- readonly TextEditorData data;
-
- public ClosingMenuDelegate (TextEditorData editor_data)
- {
- data = editor_data;
- }
-
- public override void MenuWillHighlightItem (AppKit.NSMenu menu, AppKit.NSMenuItem item)
- {
- }
-
- public override void MenuDidClose (AppKit.NSMenu menu)
- {
- data.SuppressTooltips = false;
- }
- }
- #endif
-
bool ShowFixesMenu (Gtk.Widget parent, Gdk.Rectangle evt, FixMenuDescriptor entrySet)
{
- if (parent == null || parent.GdkWindow == null)
+ if (parent == null || parent.GdkWindow == null) {
+ Editor.SuppressTooltips = false;
return true;
+ }
+
try {
- #if MAC
parent.GrabFocus ();
int x, y;
x = (int)evt.X;
y = (int)evt.Y;
+
// Explicitly release the grab because the menu is shown on the mouse position, and the widget doesn't get the mouse release event
Gdk.Pointer.Ungrab (Gtk.Global.CurrentEventTime);
- var menu = CreateNSMenu (entrySet);
- menu.Delegate = new ClosingMenuDelegate (document.Editor);
- var nsview = MonoDevelop.Components.Mac.GtkMacInterop.GetNSView (parent);
- var toplevel = parent.Toplevel as Gtk.Window;
- int trans_x, trans_y;
- parent.TranslateCoordinates (toplevel, (int)x, (int)y, out trans_x, out trans_y);
-
- // Window coordinates in gtk are the same for cocoa, with the exception of the Y coordinate, that has to be flipped.
- var pt = new CoreGraphics.CGPoint ((float)trans_x, (float)trans_y);
- int w,h;
- toplevel.GetSize (out w, out h);
- pt.Y = h - pt.Y;
-
- var tmp_event = AppKit.NSEvent.MouseEvent (AppKit.NSEventType.LeftMouseDown,
- pt,
- 0, 0,
- MonoDevelop.Components.Mac.GtkMacInterop.GetNSWindow (toplevel).WindowNumber,
- null, 0, 0, 0);
-
- AppKit.NSMenu.PopUpContextMenu (menu, tmp_event, nsview);
- #else
- var menu = CreateGtkMenu (entrySet);
- menu.Events |= Gdk.EventMask.AllEventsMask;
- menu.SelectFirst (true);
-
- menu.Hidden += delegate {
- document.Editor.SuppressTooltips = false;
- };
- menu.ShowAll ();
- menu.SelectFirst (true);
- menu.MotionNotifyEvent += (o, args) => {
- if (args.Event.Window == Editor.Parent.TextArea.GdkWindow) {
- StartMenuCloseTimer ();
- } else {
- CancelMenuCloseTimer ();
- }
- };
- GtkWorkarounds.ShowContextMenu (menu, parent, null, evt);
- #endif
+ var menu = CreateContextMenu (entrySet);
+ menu.Show (parent, x, y, () => Editor.SuppressTooltips = false, true);
} catch (Exception ex) {
LoggingService.LogError ("Error while context menu popup.", ex);
}
return true;
}
- #if MAC
- AppKit.NSMenu CreateNSMenu (FixMenuDescriptor entrySet)
+ ContextMenu CreateContextMenu (FixMenuDescriptor entrySet)
{
- var menu = new AppKit.NSMenu ();
+ var menu = new ContextMenu ();
+
foreach (var item in entrySet.Items) {
if (item == FixMenuEntry.Separator) {
- menu.AddItem (AppKit.NSMenuItem.SeparatorItem);
+ menu.Items.Add (new SeparatorContextMenuItem ());
continue;
}
+
+ var menuItem = new ContextMenuItem (item.Label);
+ menuItem.Context = item.Action;
var subMenu = item as FixMenuDescriptor;
if (subMenu != null) {
- var gtkSubMenu = new AppKit.NSMenuItem (item.Label.Replace ("_", ""));
- gtkSubMenu.Submenu = CreateNSMenu (subMenu);
- menu.AddItem (gtkSubMenu);
- continue;
+ menuItem.SubMenu = CreateContextMenu (subMenu);
+ } else {
+ menuItem.Clicked += (object sender, ContextMenuItemClickedEventArgs e) => ((System.Action)((ContextMenuItem)sender).Context) ();
}
- var menuItem = new AppKit.NSMenuItem (item.Label.Replace ("_", ""));
- menuItem.Activated += delegate {
- item.Action ();
- };
- menu.AddItem (menuItem);
+ menu.Items.Add (menuItem);
}
+
return menu;
}
- #endif
- static Menu CreateGtkMenu (FixMenuDescriptor entrySet)
+ static string CreateLabel (string title, ref int mnemonic)
{
- var menu = new Menu ();
- foreach (var item in entrySet.Items) {
- if (item == FixMenuEntry.Separator) {
- menu.Add (new SeparatorMenuItem ());
- continue;
- }
- var subMenu = item as FixMenuDescriptor;
- if (subMenu != null) {
- var gtkSubMenu = new Gtk.MenuItem (item.Label);
- gtkSubMenu.Submenu = CreateGtkMenu (subMenu);
- menu.Add (gtkSubMenu);
- continue;
- }
- var menuItem = new Gtk.MenuItem (item.Label);
- menuItem.Activated += delegate {
- item.Action ();
- };
- menu.Add (menuItem);
+ var escapedLabel = title.Replace ("_", "__");
+#if MAC
+ return escapedLabel;
+#else
+ return (mnemonic <= 10) ? "_" + mnemonic++ % 10 + " \u2013 " + escapedLabel : " " + escapedLabel;
+#endif
+ }
+
+ internal class FixAllDiagnosticProvider : FixAllContext.DiagnosticProvider
+ {
+ private readonly ImmutableHashSet<string> _diagnosticIds;
+
+ /// <summary>
+ /// Delegate to fetch diagnostics for any given document within the given fix all scope.
+ /// This delegate is invoked by <see cref="GetDocumentDiagnosticsAsync(Document, CancellationToken)"/> with the given <see cref="_diagnosticIds"/> as arguments.
+ /// </summary>
+ private readonly Func<Microsoft.CodeAnalysis.Document, ImmutableHashSet<string>, CancellationToken, Task<IEnumerable<Diagnostic>>> _getDocumentDiagnosticsAsync;
+
+ /// <summary>
+ /// Delegate to fetch diagnostics for any given project within the given fix all scope.
+ /// This delegate is invoked by <see cref="GetProjectDiagnosticsAsync(Project, CancellationToken)"/> and <see cref="GetAllDiagnosticsAsync(Project, CancellationToken)"/>
+ /// with the given <see cref="_diagnosticIds"/> as arguments.
+ /// The boolean argument to the delegate indicates whether or not to return location-based diagnostics, i.e.
+ /// (a) False => Return only diagnostics with <see cref="Location.None"/>.
+ /// (b) True => Return all project diagnostics, regardless of whether or not they have a location.
+ /// </summary>
+ private readonly Func<Project, bool, ImmutableHashSet<string>, CancellationToken, Task<IEnumerable<Diagnostic>>> _getProjectDiagnosticsAsync;
+
+ public FixAllDiagnosticProvider (
+ ImmutableHashSet<string> diagnosticIds,
+ Func<Microsoft.CodeAnalysis.Document, ImmutableHashSet<string>, CancellationToken, Task<IEnumerable<Diagnostic>>> getDocumentDiagnosticsAsync,
+ Func<Project, bool, ImmutableHashSet<string>, CancellationToken, Task<IEnumerable<Diagnostic>>> getProjectDiagnosticsAsync)
+ {
+ _diagnosticIds = diagnosticIds;
+ _getDocumentDiagnosticsAsync = getDocumentDiagnosticsAsync;
+ _getProjectDiagnosticsAsync = getProjectDiagnosticsAsync;
+ }
+
+ public override Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync (Microsoft.CodeAnalysis.Document document, CancellationToken cancellationToken)
+ {
+ return _getDocumentDiagnosticsAsync (document, _diagnosticIds, cancellationToken);
+ }
+
+ public override Task<IEnumerable<Diagnostic>> GetAllDiagnosticsAsync (Project project, CancellationToken cancellationToken)
+ {
+ return _getProjectDiagnosticsAsync (project, true, _diagnosticIds, cancellationToken);
+ }
+
+ public override Task<IEnumerable<Diagnostic>> GetProjectDiagnosticsAsync (Project project, CancellationToken cancellationToken)
+ {
+ return _getProjectDiagnosticsAsync (project, false, _diagnosticIds, cancellationToken);
}
- return menu;
}
void PopulateFixes (FixMenuDescriptor menu, ref int items)
{
- if (!RefactoringService.ShowFixes)
- return;
int mnemonic = 1;
bool gotImportantFix = false, addedSeparator = false;
- var fixesAdded = new List<string> ();
- foreach (var fix_ in Fixes.OrderByDescending (i => Tuple.Create (IsAnalysisOrErrorFix(i), (int)i.Severity, GetUsage (i.IdString)))) {
+ foreach (var fix_ in GetCurrentFixes ().CodeFixActions.OrderByDescending (i => Tuple.Create (IsAnalysisOrErrorFix (i.CodeAction), (int)0, GetUsage (i.CodeAction.EquivalenceKey)))) {
// filter out code actions that are already resolutions of a code issue
- if (fixesAdded.Any (f => fix_.IdString.IndexOf (f, StringComparison.Ordinal) >= 0))
- continue;
- fixesAdded.Add (fix_.IdString);
- if (IsAnalysisOrErrorFix (fix_))
+ if (IsAnalysisOrErrorFix (fix_.CodeAction))
gotImportantFix = true;
- if (!addedSeparator && gotImportantFix && !IsAnalysisOrErrorFix(fix_)) {
+ if (!addedSeparator && gotImportantFix && !IsAnalysisOrErrorFix (fix_.CodeAction)) {
menu.Add (FixMenuEntry.Separator);
addedSeparator = true;
}
var fix = fix_;
- var escapedLabel = fix.Title.Replace ("_", "__");
- var label = (mnemonic <= 10)
- ? "_" + (mnemonic++ % 10).ToString () + " " + escapedLabel
- : " " + escapedLabel;
- var thisInstanceMenuItem = new FixMenuEntry (label, delegate {
- new ContextActionRunner (fix, document, currentSmartTagBegin).Run (null, EventArgs.Empty);
- ConfirmUsage (fix.IdString);
+ var label = CreateLabel (fix.CodeAction.Title, ref mnemonic);
+ var thisInstanceMenuItem = new FixMenuEntry (label,async delegate {
+ await new ContextActionRunner (fix.CodeAction, Editor, DocumentContext).Run ();
+ ConfirmUsage (fix.CodeAction.EquivalenceKey);
});
menu.Add (thisInstanceMenuItem);
items++;
}
bool first = true;
- var settingsMenuFixes = Fixes
- .OfType<AnalysisContextActionProvider.AnalysisCodeAction> ()
- .Where (f => f.Result is InspectorResults)
- .GroupBy (f => ((InspectorResults)f.Result).Inspector);
- foreach (var analysisFixGroup_ in settingsMenuFixes) {
- var analysisFixGroup = analysisFixGroup_;
- var arbitraryFixInGroup = analysisFixGroup.First ();
- var ir = (InspectorResults)arbitraryFixInGroup.Result;
+ foreach (var fix in GetCurrentFixes ().CodeRefactoringActions) {
+ if (first) {
+ if (items > 0)
+ menu.Add (FixMenuEntry.Separator);
+ first = false;
+ }
+
+ var label = CreateLabel (fix.CodeAction.Title, ref mnemonic);
+ var thisInstanceMenuItem = new FixMenuEntry (label, async delegate {
+ await new ContextActionRunner (fix.CodeAction, Editor, DocumentContext).Run ();
+ ConfirmUsage (fix.CodeAction.EquivalenceKey);
+ });
+ menu.Add (thisInstanceMenuItem);
+ items++;
+ }
+
+ first = false;
+ var warningsAtCaret = (DocumentContext.AnalysisDocument.GetSemanticModelAsync ().Result)
+ .GetDiagnostics (new TextSpan (Editor.CaretOffset, 0))
+ .Where (diag => diag.Severity == DiagnosticSeverity.Warning).ToList ();
+
+ foreach (var warning in warningsAtCaret) {
+ var label = GettextCatalog.GetString ("_Options for \"{0}\"", warning.Descriptor.Title);
+ var subMenu = new FixMenuDescriptor (label);
if (first) {
menu.Add (FixMenuEntry.Separator);
first = false;
}
+ var menuItem = new FixMenuEntry (GettextCatalog.GetString ("_Suppress with #pragma"),
+ async delegate {
+ var fixes = await CSharpSuppressionFixProvider.Instance.GetSuppressionsAsync (DocumentContext.AnalysisDocument, new TextSpan (Editor.CaretOffset, 0), new [] { warning }, default (CancellationToken)).ConfigureAwait (false);
+ foreach (var f in fixes) {
+ CodeDiagnosticDescriptor.RunAction (DocumentContext, f.Action, default (CancellationToken));
+ }
+ }
+ );
+ subMenu.Add (menuItem);
+ menu.Add (subMenu);
+ items++;
+ }
- var subMenu = new FixMenuDescriptor ();
- foreach (var analysisFix_ in analysisFixGroup) {
- var analysisFix = analysisFix_;
- if (analysisFix.SupportsBatchRunning) {
- var batchRunMenuItem = new FixMenuEntry (
- string.Format (GettextCatalog.GetString ("Apply in file: {0}"), analysisFix.Title),
- delegate {
- ConfirmUsage (analysisFix.IdString);
- new ContextActionRunner (analysisFix, document, this.currentSmartTagBegin).BatchRun (null, EventArgs.Empty);
- }
- );
- subMenu.Add (batchRunMenuItem);
- subMenu.Add (FixMenuEntry.Separator);
- }
- }
+ foreach (var fix_ in GetCurrentFixes ().DiagnosticsAtCaret) {
+ var fix = fix_;
+ var label = GettextCatalog.GetString ("_Options for \"{0}\"", fix.GetMessage ());
+ var subMenu = new FixMenuDescriptor (label);
- var inspector = ir.Inspector;
- if (inspector.CanSuppressWithAttribute) {
- var menuItem = new FixMenuEntry (GettextCatalog.GetString ("_Suppress with attribute"),
- delegate {
- inspector.SuppressWithAttribute (document, arbitraryFixInGroup.DocumentRegion);
- });
- subMenu.Add (menuItem);
+ CodeDiagnosticDescriptor descriptor = BuiltInCodeDiagnosticProvider.GetCodeDiagnosticDescriptor (fix.Id);
+ if (descriptor == null)
+ continue;
+ if (first) {
+ menu.Add (FixMenuEntry.Separator);
+ first = false;
}
-
- if (inspector.CanDisableWithPragma) {
+ // if (inspector.CanSuppressWithAttribute) {
+ // var menuItem = new FixMenuEntry (GettextCatalog.GetString ("_Suppress with attribute"),
+ // delegate {
+ //
+ // inspector.SuppressWithAttribute (Editor, DocumentContext, GetTextSpan (fix.Item2));
+ // });
+ // subMenu.Add (menuItem);
+ // }
+
+ if (descriptor.CanDisableWithPragma) {
var menuItem = new FixMenuEntry (GettextCatalog.GetString ("_Suppress with #pragma"),
- delegate {
- inspector.DisableWithPragma (document, arbitraryFixInGroup.DocumentRegion);
- });
+ delegate {
+ descriptor.DisableWithPragma (Editor, DocumentContext, fix);
+ });
subMenu.Add (menuItem);
- }
-
- if (inspector.CanDisableOnce) {
- var menuItem = new FixMenuEntry (GettextCatalog.GetString ("_Disable Once"),
+ menuItem = new FixMenuEntry (GettextCatalog.GetString ("_Suppress with file"),
delegate {
- inspector.DisableOnce (document, arbitraryFixInGroup.DocumentRegion);
+ descriptor.DisableWithFile (Editor, DocumentContext, fix);
});
subMenu.Add (menuItem);
}
-
- if (inspector.CanDisableAndRestore) {
- var menuItem = new FixMenuEntry (GettextCatalog.GetString ("Disable _and Restore"),
- delegate {
- inspector.DisableAndRestore (document, arbitraryFixInGroup.DocumentRegion);
- });
- subMenu.Add (menuItem);
- }
- var label = GettextCatalog.GetString ("_Options for \"{0}\"", InspectorResults.GetTitle (ir.Inspector));
- var subMenuItem = new FixMenuDescriptor (label);
-
var optionsMenuItem = new FixMenuEntry (GettextCatalog.GetString ("_Configure Rule"),
delegate {
- arbitraryFixInGroup.ShowOptions (null, EventArgs.Empty);
+ IdeApp.Workbench.ShowGlobalPreferencesDialog (null, "C#", dialog => {
+ var panel = dialog.GetPanel<CodeIssuePanel> ("C#");
+ if (panel == null)
+ return;
+ panel.Widget.SelectCodeIssue (descriptor.IdString);
+ });
});
- subMenuItem.Add (optionsMenuItem);
+ subMenu.Add (optionsMenuItem);
+
+
+ foreach (var fix2 in GetCurrentFixes ().CodeFixActions.OrderByDescending (i => Tuple.Create (IsAnalysisOrErrorFix (i.CodeAction), (int)0, GetUsage (i.CodeAction.EquivalenceKey)))) {
+
+ var provider = fix2.Diagnostic.GetCodeFixProvider ().GetFixAllProvider ();
+ if (provider == null)
+ continue;
+ if (!provider.GetSupportedFixAllScopes ().Contains (FixAllScope.Document))
+ continue;
+ var subMenu2 = new FixMenuDescriptor (GettextCatalog.GetString ("Fix all"));
+ var diagnosticAnalyzer = fix2.Diagnostic.GetCodeDiagnosticDescriptor (LanguageNames.CSharp).GetProvider ();
+ if (!diagnosticAnalyzer.SupportedDiagnostics.Contains (fix.Descriptor))
+ continue;
+
+ var menuItem = new FixMenuEntry (
+ GettextCatalog.GetString ("In _Document"),
+ async delegate {
+ var fixAllDiagnosticProvider = new FixAllDiagnosticProvider (diagnosticAnalyzer.SupportedDiagnostics.Select (d => d.Id).ToImmutableHashSet (), async (Microsoft.CodeAnalysis.Document doc, ImmutableHashSet<string> diagnostics, CancellationToken token) => {
+
+ var model = await doc.GetSemanticModelAsync (token);
+ var compilationWithAnalyzer = model.Compilation.WithAnalyzers (new [] { diagnosticAnalyzer }.ToImmutableArray (), null, token);
+
+ return await compilationWithAnalyzer.GetAnalyzerSemanticDiagnosticsAsync (model, null, token);
+ }, (Project arg1, bool arg2, ImmutableHashSet<string> arg3, CancellationToken arg4) => {
+ return Task.FromResult ((IEnumerable<Diagnostic>)new Diagnostic [] { });
+ });
+ var ctx = new FixAllContext (
+ this.DocumentContext.AnalysisDocument,
+ fix2.Diagnostic.GetCodeFixProvider (),
+ FixAllScope.Document,
+ fix2.CodeAction.EquivalenceKey,
+ diagnosticAnalyzer.SupportedDiagnostics.Select (d => d.Id),
+ fixAllDiagnosticProvider,
+ default (CancellationToken)
+ );
+ var fixAll = await provider.GetFixAsync (ctx);
+ using (var undo = Editor.OpenUndoGroup ()) {
+ CodeDiagnosticDescriptor.RunAction (DocumentContext, fixAll, default (CancellationToken));
+ }
+ });
+ subMenu2.Add (menuItem);
+ subMenu.Add (FixMenuEntry.Separator);
+ subMenu.Add (subMenu2);
+ }
- menu.Add (subMenuItem);
+ menu.Add (subMenu);
items++;
}
}
-
- class ContextActionRunner
+ internal class ContextActionRunner
{
- CodeAction act;
- Document document;
- TextLocation loc;
+ readonly CodeAction act;
+ TextEditor editor;
+ DocumentContext documentContext;
- public ContextActionRunner (MonoDevelop.CodeActions.CodeAction act, MonoDevelop.Ide.Gui.Document document, ICSharpCode.NRefactory.TextLocation loc)
+ public ContextActionRunner (CodeAction act, TextEditor editor, DocumentContext documentContext)
{
+ this.editor = editor;
this.act = act;
- this.document = document;
- this.loc = loc;
+ this.documentContext = documentContext;
}
- public void Run (object sender, EventArgs e)
+ public async Task Run ()
{
- var context = document.ParsedDocument.CreateRefactoringContext (document, CancellationToken.None);
- RefactoringService.ApplyFix (act, context);
- }
-
- public void BatchRun (object sender, EventArgs e)
- {
- act.BatchRun (document, loc);
- }
- }
-
- class SmartTagMarker : TextSegmentMarker, IActionTextLineMarker
- {
- CodeActionEditorExtension codeActionEditorExtension;
- internal List<CodeAction> fixes;
- DocumentLocation loc;
-
- public SmartTagMarker (int offset, CodeActionEditorExtension codeActionEditorExtension, List<CodeAction> fixes, DocumentLocation loc) : base (offset, 0)
- {
- this.codeActionEditorExtension = codeActionEditorExtension;
- this.fixes = fixes;
- this.loc = loc;
- }
-
- public SmartTagMarker (int offset) : base (offset, 0)
- {
- }
- const double tagMarkerWidth = 8;
- const double tagMarkerHeight = 2;
- public override void Draw (TextEditor editor, Cairo.Context cr, Pango.Layout layout, bool selected, int startOffset, int endOffset, double y, double startXPos, double endXPos)
- {
- var line = editor.GetLine (loc.Line);
- var x = editor.ColumnToX (line, loc.Column) - editor.HAdjustment.Value + editor.TextViewMargin.XOffset + editor.TextViewMargin.TextStartPosition;
+ var token = default (CancellationToken);
+ var insertionAction = act as InsertionAction;
+ if (insertionAction != null) {
+ var insertion = await insertionAction.CreateInsertion (token).ConfigureAwait (false);
+
+ var document = await IdeApp.Workbench.OpenDocument (insertion.Location.SourceTree.FilePath, documentContext.Project);
+ var parsedDocument = await document.UpdateParseDocument ();
+ if (parsedDocument != null) {
+ var insertionPoints = InsertionPointService.GetInsertionPoints (
+ document.Editor,
+ parsedDocument,
+ insertion.Type,
+ insertion.Location.SourceSpan.Start
+ );
- cr.Rectangle (Math.Floor (x) + 0.5, Math.Floor (y) + 0.5 + (line == editor.GetLineByOffset (startOffset) ? editor.LineHeight - tagMarkerHeight - 1 : 0), tagMarkerWidth * cr.LineWidth, tagMarkerHeight * cr.LineWidth);
+ var options = new InsertionModeOptions (
+ insertionAction.Title,
+ insertionPoints,
+ point => {
+ if (!point.Success)
+ return;
+ var node = Formatter.Format (insertion.Node, TypeSystemService.Workspace, document.GetOptionSet (), token);
+ point.InsertionPoint.Insert (document.Editor, document, node.ToString ());
+ // document = await Simplifier.ReduceAsync(document.AnalysisDocument, Simplifier.Annotation, cancellationToken: token).ConfigureAwait(false);
+ }
+ );
- if (HslColor.Brightness (editor.ColorStyle.PlainText.Background) < 0.5) {
- cr.SetSourceRGBA (0.8, 0.8, 1, 0.9);
- } else {
- cr.SetSourceRGBA (0.2, 0.2, 1, 0.9);
+ document.Editor.StartInsertionMode (options);
+ return;
+ }
}
- cr.Stroke ();
- }
- #region IActionTextLineMarker implementation
-
- bool IActionTextLineMarker.MousePressed (TextEditor editor, MarginMouseEventArgs args)
- {
- return false;
+ var oldSolution = documentContext.AnalysisDocument.Project.Solution;
+ var updatedSolution = oldSolution;
+ if (RefactoringService.OptionSetCreation != null)
+ documentContext.RoslynWorkspace.Options = RefactoringService.OptionSetCreation (editor, documentContext);
+ using (var undo = editor.OpenUndoGroup ()) {
+ foreach (var operation in act.GetOperationsAsync (token).Result) {
+ var applyChanges = operation as ApplyChangesOperation;
+ if (applyChanges == null) {
+ operation.Apply (documentContext.RoslynWorkspace, token);
+ continue;
+ }
+ if (updatedSolution == oldSolution) {
+ updatedSolution = applyChanges.ChangedSolution;
+ }
+ operation.Apply (documentContext.RoslynWorkspace, token);
+ }
+ }
+ await TryStartRenameSession (documentContext.RoslynWorkspace, oldSolution, updatedSolution, token);
}
- void IActionTextLineMarker.MouseHover (TextEditor editor, MarginMouseEventArgs args, TextLineMarkerHoverResult result)
+ static IEnumerable<DocumentId> GetChangedDocuments (Solution newSolution, Solution oldSolution)
{
- if (args.Button != 0)
- return;
- var line = editor.GetLine (loc.Line);
- if (line == null)
- return;
- var x = editor.ColumnToX (line, loc.Column) - editor.HAdjustment.Value + editor.TextViewMargin.TextStartPosition;
- var y = editor.LineToY (line.LineNumber + 1) - editor.VAdjustment.Value;
- const double xAdditionalSpace = tagMarkerWidth;
- if (args.X - x >= -xAdditionalSpace * editor.Options.Zoom &&
- args.X - x < (tagMarkerWidth + xAdditionalSpace) * editor.Options.Zoom /*&&
- args.Y - y < (editor.LineHeight / 2) * editor.Options.Zoom*/) {
- result.Cursor = null;
- Popup ();
- } else {
- codeActionEditorExtension.CancelSmartTagPopupTimeout ();
+ if (newSolution != null) {
+ var solutionChanges = newSolution.GetChanges (oldSolution);
+ foreach (var projectChanges in solutionChanges.GetProjectChanges ()) {
+ foreach (var documentId in projectChanges.GetChangedDocuments ()) {
+ yield return documentId;
+ }
+ }
}
}
- public void Popup ()
+ async Task TryStartRenameSession (Workspace workspace, Solution oldSolution, Solution newSolution, CancellationToken cancellationToken)
{
- codeActionEditorExtension.smartTagPopupTimeoutId = GLib.Timeout.Add (menuTimeout, delegate {
- codeActionEditorExtension.PopupQuickFixMenu (null, menu => {
- codeActionEditorExtension.codeActionMenu = menu;
- });
- codeActionEditorExtension.smartTagPopupTimeoutId = 0;
- return false;
- });
+ var changedDocuments = GetChangedDocuments (newSolution, oldSolution);
+ foreach (var documentId in changedDocuments) {
+ var document = newSolution.GetDocument (documentId);
+ var root = await document.GetSyntaxRootAsync (cancellationToken).ConfigureAwait (false);
+ SyntaxToken? renameTokenOpt = root.GetAnnotatedNodesAndTokens (RenameAnnotation.Kind)
+ .Where (s => s.IsToken)
+ .Select (s => s.AsToken ())
+ .Cast<SyntaxToken?> ()
+ .FirstOrDefault ();
+ if (renameTokenOpt.HasValue) {
+ var latestDocument = workspace.CurrentSolution.GetDocument (documentId);
+ var latestModel = await latestDocument.GetSemanticModelAsync (cancellationToken).ConfigureAwait (false);
+ var latestRoot = await latestDocument.GetSyntaxRootAsync (cancellationToken).ConfigureAwait (false);
+ await Runtime.RunInMainThread (async delegate {
+ try {
+ var node = latestRoot.FindNode (renameTokenOpt.Value.Parent.Span, false, false);
+ if (node == null)
+ return;
+ var info = latestModel.GetSymbolInfo (node);
+ var sym = info.Symbol ?? latestModel.GetDeclaredSymbol (node);
+ if (sym != null)
+ await new MonoDevelop.Refactoring.Rename.RenameRefactoring ().Rename (sym);
+ } catch (Exception ex) {
+ LoggingService.LogError ("Error while renaming " + renameTokenOpt.Value.Parent, ex);
+ }
+ });
+ return;
+ }
+ }
}
-
-
- #endregion
}
- SmartTagMarker currentSmartTag;
- DocumentLocation currentSmartTagBegin;
- void CreateSmartTag (List<CodeAction> fixes, DocumentLocation loc)
+ ISmartTagMarker currentSmartTag;
+ int currentSmartTagBegin;
+
+ void CreateSmartTag (CodeActionContainer fixes, int offset)
{
- Fixes = fixes;
- if (!QuickTaskStrip.EnableFancyFeatures) {
+ if (!AnalysisOptions.EnableFancyFeatures || fixes.IsEmpty) {
RemoveWidget ();
return;
}
- var editor = document.Editor;
- if (editor == null || editor.Parent == null || !editor.Parent.IsRealized) {
+ var editor = Editor;
+ if (editor == null) {
RemoveWidget ();
return;
}
- if (document.ParsedDocument == null || document.ParsedDocument.IsInvalid) {
+ if (DocumentContext.ParsedDocument == null || DocumentContext.ParsedDocument.IsInvalid) {
RemoveWidget ();
return;
}
- var container = editor.Parent;
- if (container == null) {
- RemoveWidget ();
- return;
- }
+ // var container = editor.Parent;
+ // if (container == null) {
+ // RemoveWidget ();
+ // return;
+ // }
bool first = true;
- DocumentLocation smartTagLocBegin = loc;
- foreach (var fix in fixes) {
- if (fix.DocumentRegion.IsEmpty)
+ var smartTagLocBegin = offset;
+ foreach (var fix in fixes.CodeFixActions.Concat (fixes.CodeRefactoringActions)) {
+ var textSpan = fix.ValidSegment;
+ if (textSpan.IsEmpty)
continue;
- if (first || loc < fix.DocumentRegion.Begin) {
- smartTagLocBegin = fix.DocumentRegion.Begin;
+ if (first || offset < textSpan.Start) {
+ smartTagLocBegin = textSpan.Start;
}
first = false;
}
- if (smartTagLocBegin.Line != loc.Line)
- smartTagLocBegin = new DocumentLocation (loc.Line, 1);
+ // if (smartTagLocBegin.Line != loc.Line)
+ // smartTagLocBegin = new DocumentLocation (loc.Line, 1);
// got no fix location -> try to search word start
- if (first) {
- int offset = document.Editor.LocationToOffset (smartTagLocBegin);
- while (offset > 0) {
- char ch = document.Editor.GetCharAt (offset - 1);
- if (!char.IsLetterOrDigit (ch) && ch != '_')
- break;
- offset--;
- }
- smartTagLocBegin = document.Editor.OffsetToLocation (offset);
- }
+ // if (first) {
+ // int offset = document.Editor.LocationToOffset (smartTagLocBegin);
+ // while (offset > 0) {
+ // char ch = document.Editor.GetCharAt (offset - 1);
+ // if (!char.IsLetterOrDigit (ch) && ch != '_')
+ // break;
+ // offset--;
+ // }
+ // smartTagLocBegin = document.Editor.OffsetToLocation (offset);
+ // }
if (currentSmartTag != null && currentSmartTagBegin == smartTagLocBegin) {
- currentSmartTag.fixes = fixes;
return;
}
RemoveWidget ();
currentSmartTagBegin = smartTagLocBegin;
- var line = document.Editor.GetLine (smartTagLocBegin.Line);
- currentSmartTag = new SmartTagMarker ((line.NextLine ?? line).Offset, this, fixes, smartTagLocBegin);
- document.Editor.Document.AddMarker (currentSmartTag);
+ var realLoc = Editor.OffsetToLocation (smartTagLocBegin);
+
+ currentSmartTag = TextMarkerFactory.CreateSmartTagMarker (Editor, smartTagLocBegin, realLoc);
+ currentSmartTag.CancelPopup += CurrentSmartTag_CancelPopup;
+ currentSmartTag.ShowPopup += CurrentSmartTag_ShowPopup;
+ currentSmartTag.Tag = fixes;
+ currentSmartTag.IsVisible = fixes.CodeFixActions.Count > 0;
+ editor.AddMarker (currentSmartTag);
}
-
- public override void Initialize ()
+
+ void CurrentSmartTag_ShowPopup (object sender, EventArgs e)
+ {
+ CurrentSmartTagPopup ();
+ }
+
+ void CurrentSmartTag_CancelPopup (object sender, EventArgs e)
+ {
+ CancelSmartTagPopupTimeout ();
+ }
+
+ protected override void Initialize ()
{
base.Initialize ();
- document.DocumentParsed += HandleDocumentDocumentParsed;
- document.Editor.SelectionChanged += HandleSelectionChanged;
- document.Editor.Parent.BeginHover += HandleBeginHover;
+ DocumentContext.DocumentParsed += HandleDocumentDocumentParsed;
+ Editor.SelectionChanged += HandleSelectionChanged;
+ Editor.MouseMoved += HandleBeginHover;
+ Editor.CaretPositionChanged += HandleCaretPositionChanged;
+ Editor.TextChanged += Editor_TextChanged;
+ Editor.EndAtomicUndoOperation += Editor_EndAtomicUndoOperation;
+ }
+
+ void Editor_EndAtomicUndoOperation (object sender, EventArgs e)
+ {
+ RemoveWidget ();
+ HandleCaretPositionChanged (null, EventArgs.Empty);
+ }
+
+ void Editor_TextChanged (object sender, MonoDevelop.Core.Text.TextChangeEventArgs e)
+ {
+ if (Editor.IsInAtomicUndo)
+ return;
+ RemoveWidget ();
+ HandleCaretPositionChanged (null, EventArgs.Empty);
}
void HandleBeginHover (object sender, EventArgs e)
@@ -725,43 +841,46 @@ namespace MonoDevelop.CodeActions
void HandleSelectionChanged (object sender, EventArgs e)
{
- CursorPositionChanged ();
+ HandleCaretPositionChanged (null, EventArgs.Empty);
}
-
+
void HandleDocumentDocumentParsed (object sender, EventArgs e)
{
- CursorPositionChanged ();
+ HandleCaretPositionChanged (null, EventArgs.Empty);
}
-
- [CommandUpdateHandler(RefactoryCommands.QuickFix)]
- public void UpdateQuickFixCommand (CommandInfo ci)
+
+ void CurrentSmartTagPopup ()
{
- if (QuickTaskStrip.EnableFancyFeatures) {
- ci.Enabled = currentSmartTag != null;
- } else {
- ci.Enabled = true;
- }
+ CancelSmartTagPopupTimeout ();
+ smartTagPopupTimeoutId = GLib.Timeout.Add (menuTimeout, delegate {
+ PopupQuickFixMenu (null, menu => { });
+ smartTagPopupTimeoutId = 0;
+ return false;
+ });
}
-
- [CommandHandler(RefactoryCommands.QuickFix)]
+
+ [CommandHandler (RefactoryCommands.QuickFix)]
void OnQuickFixCommand ()
{
- if (!QuickTaskStrip.EnableFancyFeatures) {
- Fixes = RefactoringService.GetValidActions (Document, Document.Editor.Caret.Location);
- currentSmartTagBegin = Document.Editor.Caret.Location;
- PopupQuickFixMenu (null, null);
-
+ if (!AnalysisOptions.EnableFancyFeatures || currentSmartTag == null) {
+ //Fixes = RefactoringService.GetValidActions (Editor, DocumentContext, Editor.CaretLocation).Result;
+ currentSmartTagBegin = Editor.CaretOffset;
+ PopupQuickFixMenu (null, null);
return;
}
- if (currentSmartTag == null)
- return;
- currentSmartTag.Popup ();
+
+ CurrentSmartTagPopup ();
+ }
+
+ internal bool HasCurrentFixes {
+ get {
+ return smartTagTask != null && smartTagTask.IsCompleted;
+ }
}
- static readonly List<CodeAction> emptyList = new List<CodeAction> ();
- internal List<CodeAction> GetCurrentFixes ()
+ internal CodeActionContainer GetCurrentFixes ()
{
- return currentSmartTag == null ? emptyList : currentSmartTag.fixes;
+ return smartTagTask == null ? CodeActionContainer.Empty : smartTagTask.Result;
}
}
-} \ No newline at end of file
+}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionPanelWidget.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionPanelWidget.cs
index 66f132a1c5..7e89e64f47 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionPanelWidget.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionPanelWidget.cs
@@ -26,12 +26,14 @@
using System;
using MonoDevelop.Ide.Gui.Dialogs;
using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using System.Linq;
using System.Text;
using MonoDevelop.Refactoring;
using System.Collections.Generic;
using GLib;
+using MonoDevelop.CodeIssues;
namespace MonoDevelop.CodeActions
{
@@ -39,7 +41,7 @@ namespace MonoDevelop.CodeActions
{
ContextActionPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new ContextActionPanelWidget ("text/x-csharp");
}
@@ -54,14 +56,14 @@ namespace MonoDevelop.CodeActions
{
readonly string mimeType;
- readonly TreeStore treeStore = new TreeStore (typeof(string), typeof(bool), typeof(CodeActionProvider), typeof(string));
- readonly Dictionary<CodeActionProvider, bool> providerStates = new Dictionary<CodeActionProvider, bool> ();
+ readonly TreeStore treeStore = new TreeStore (typeof(string), typeof(bool), typeof(CodeRefactoringDescriptor));
+ readonly Dictionary<CodeRefactoringDescriptor, bool> providerStates = new Dictionary<CodeRefactoringDescriptor, bool> ();
void GetAllProviderStates ()
{
- string disabledNodes = PropertyService.Get ("ContextActions." + mimeType, "");
- foreach (var node in RefactoringService.ContextAddinNodes.Where (n => n.MimeType == mimeType)) {
- providerStates [node] = disabledNodes.IndexOf (node.IdString, StringComparison.Ordinal) < 0;
+ var language = CodeRefactoringService.MimeTypeToLanguage (mimeType);
+ foreach (var node in BuiltInCodeDiagnosticProvider.GetBuiltInCodeRefactoringDescriptorsAsync (CodeRefactoringService.MimeTypeToLanguage(language), true).Result) {
+ providerStates [node] = node.IsEnabled;
}
}
@@ -94,7 +96,7 @@ namespace MonoDevelop.CodeActions
TreeIter iter;
if (!treeStore.GetIterFromString (out iter, args.Path))
return;
- var provider = (CodeActionProvider)treeStore.GetValue (iter, 2);
+ var provider = (CodeRefactoringDescriptor)treeStore.GetValue (iter, 2);
providerStates [provider] = !providerStates [provider];
treeStore.SetValue (iter, 1, providerStates [provider]);
};
@@ -125,26 +127,20 @@ namespace MonoDevelop.CodeActions
{
treeStore.Clear ();
var sortedAndFiltered = providerStates.Keys
- .Where (node => string.IsNullOrEmpty (filter) || node.Title.IndexOf (filter, StringComparison.OrdinalIgnoreCase) > 0)
- .OrderBy (n => n.Title, StringComparer.Ordinal);
+ .Where (node => string.IsNullOrEmpty (filter) || node.Name.IndexOf (filter, StringComparison.OrdinalIgnoreCase) > 0)
+ .OrderBy (n => n.Name, StringComparer.Ordinal);
foreach (var node in sortedAndFiltered) {
- var title = node.Title;
+ var title = node.Name;
MonoDevelop.CodeIssues.CodeIssuePanelWidget.MarkupSearchResult (filter, ref title);
- treeStore.AppendValues (title, providerStates [node], node, node.Description);
+ treeStore.AppendValues (title, providerStates [node], node);
}
}
public void ApplyChanges ()
{
- var sb = new StringBuilder ();
foreach (var kv in providerStates) {
- if (kv.Value)
- continue;
- if (sb.Length > 0)
- sb.Append (",");
- sb.Append (kv.Key.IdString);
+ kv.Key.IsEnabled = kv.Value;
}
- PropertyService.Set ("ContextActions." + mimeType, sb.ToString ());
}
}
}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionProvider.cs
deleted file mode 100644
index 32c1c7d1ec..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionProvider.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// ContextActionProvider.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory;
-using System.Threading;
-using System.Collections.Generic;
-using System;
-
-namespace MonoDevelop.CodeActions
-{
- /// <summary>
- /// A code action provider is a factory that creates code actions for a document at a given location.
- /// Note: There is only one code action provider generated therfore providers need to be state less.
- /// </summary>
- public abstract class CodeActionProvider
- {
- /// <summary>
- /// Gets or sets the type of the MIME the provider is attached to.
- /// </summary>
- public string MimeType { get; set; }
-
- /// <summary>
- /// Gets or sets the category of the provider (used in the option panel).
- /// </summary>
- public string Category { get; set; }
-
- /// <summary>
- /// Gets or sets the title of the provider (used in the option panel).
- /// </summary>
- public string Title { get; set; }
-
- /// <summary>
- /// Gets or sets the description of the provider (used in the option panel).
- /// </summary>
- public string Description { get; set; }
-
- /// <summary>
- /// Gets the identifier string used as property ID tag.
- /// </summary>
- public virtual string IdString {
- get {
- return GetType ().FullName;
- }
- }
-
- /// <summary>
- /// Gets all the code actions in document at given location.
- /// </summary>
- public abstract IEnumerable<CodeAction> GetActions (MonoDevelop.Ide.Gui.Document document, object refactoringContext, TextLocation loc, CancellationToken cancellationToken);
- }
-}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeRefactoringDescriptor.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeRefactoringDescriptor.cs
new file mode 100644
index 0000000000..aa46055a1f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeRefactoringDescriptor.cs
@@ -0,0 +1,101 @@
+//
+// CodeActionDescriptor.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Microsoft.CodeAnalysis.CodeRefactorings;
+using MonoDevelop.Core;
+using System.Linq;
+
+namespace MonoDevelop.CodeActions
+{
+ /// <summary>
+ /// This class wraps a roslyn ICodeRefactoringProvider and adds required meta data to it.
+ /// </summary>
+ class CodeRefactoringDescriptor
+ {
+ readonly Type codeActionType;
+ readonly ExportCodeRefactoringProviderAttribute attr;
+
+ CodeRefactoringProvider instance;
+
+ /// <summary>
+ /// Gets the identifier string.
+ /// </summary>
+ internal string IdString {
+ get {
+ return codeActionType.FullName;
+ }
+ }
+
+ /// <summary>
+ /// Gets the display name for this action.
+ /// </summary>
+ public string Name { get { return attr.Name; } }
+
+ /// <summary>
+ /// Gets the language for this action.
+ /// </summary>
+ public string Language { get { return attr.Languages.FirstOrDefault (); } }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this code action is enabled by the user.
+ /// </summary>
+ /// <value><c>true</c> if this code action is enabled; otherwise, <c>false</c>.</value>
+ public bool IsEnabled {
+ get {
+ return PropertyService.Get ("CodeActions." + Language + "." + IdString, true);
+ }
+ set {
+ PropertyService.Set ("CodeActions." + Language + "." + IdString, value);
+ }
+ }
+
+ internal CodeRefactoringDescriptor (Type codeActionType, ExportCodeRefactoringProviderAttribute attr)
+ {
+ if (codeActionType == null)
+ throw new ArgumentNullException ("codeActionType");
+ if (attr == null)
+ throw new ArgumentNullException ("attr");
+ this.codeActionType = codeActionType;
+ this.attr = attr;
+ }
+
+ /// <summary>
+ /// Gets the roslyn code action provider.
+ /// </summary>
+ public CodeRefactoringProvider GetProvider ()
+ {
+ if (instance == null)
+ instance = (CodeRefactoringProvider)Activator.CreateInstance (codeActionType);
+ return instance;
+ }
+
+ public override string ToString ()
+ {
+ return string.Format ("[CodeActionDescriptor: IdString={0}, Name={1}, Language={2}]", IdString, Name, Language);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeRefactoringService.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeRefactoringService.cs
new file mode 100644
index 0000000000..1c546dfc66
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeRefactoringService.cs
@@ -0,0 +1,164 @@
+//
+// CodeActionService.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Microsoft.CodeAnalysis.CodeRefactorings;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using System.Threading;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeActions;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.CodeIssues;
+using Mono.Addins;
+using RefactoringEssentials;
+using MonoDevelop.Core.Text;
+using System.Linq;
+
+namespace MonoDevelop.CodeActions
+{
+ static class CodeRefactoringService
+ {
+ readonly static List<CodeDiagnosticProvider> providers = new List<CodeDiagnosticProvider> ();
+
+ static CodeRefactoringService ()
+ {
+ providers.Add (new BuiltInCodeDiagnosticProvider ());
+
+ AddinManager.AddExtensionNodeHandler ("/MonoDevelop/Refactoring/CodeDiagnosticProvider", delegate(object sender, ExtensionNodeEventArgs args) {
+ var node = (TypeExtensionNode)args.ExtensionNode;
+ switch (args.Change) {
+ case ExtensionChange.Add:
+ providers.Add ((CodeDiagnosticProvider)node.CreateInstance ());
+ break;
+ }
+ });
+ }
+
+ public async static Task<IEnumerable<CodeDiagnosticDescriptor>> GetCodeDiagnosticsAsync (DocumentContext documentContext, string language, CancellationToken cancellationToken = default (CancellationToken))
+ {
+ var result = new List<CodeDiagnosticDescriptor> ();
+
+ foreach (var provider in providers) {
+ if (cancellationToken.IsCancellationRequested)
+ return Enumerable.Empty<CodeDiagnosticDescriptor> ();
+ result.AddRange (await provider.GetCodeDiagnosticDescriptorsAsync (documentContext, language, cancellationToken).ConfigureAwait (false));
+ }
+ return result;
+ }
+
+ public async static Task<IEnumerable<CodeDiagnosticFixDescriptor>> GetCodeFixesAsync (DocumentContext documentContext, string language, CancellationToken cancellationToken = default (CancellationToken))
+ {
+ var result = new List<CodeDiagnosticFixDescriptor> ();
+ foreach (var provider in providers) {
+ result.AddRange (await provider.GetCodeFixDescriptorsAsync (documentContext, language, cancellationToken).ConfigureAwait (false));
+ }
+ return result;
+ }
+
+ public async static Task<IEnumerable<CodeRefactoringDescriptor>> GetCodeRefactoringsAsync (DocumentContext documentContext, string language, CancellationToken cancellationToken = default (CancellationToken))
+ {
+ var result = new List<CodeRefactoringDescriptor> ();
+ foreach (var provider in providers) {
+ result.AddRange (await provider.GetCodeRefactoringDescriptorsAsync (documentContext, language, cancellationToken).ConfigureAwait (false));
+ }
+ return result;
+ }
+
+ static List<CodeRefactoringDescriptor> codeRefactoringCache;
+ public static async Task<IEnumerable<ValidCodeAction>> GetValidActionsAsync (TextEditor editor, DocumentContext doc, TextSpan span, CancellationToken cancellationToken = default (CancellationToken))
+ {
+ if (editor == null)
+ throw new ArgumentNullException ("editor");
+ if (doc == null)
+ throw new ArgumentNullException ("doc");
+ var parsedDocument = doc.ParsedDocument;
+ var actions = new List<ValidCodeAction> ();
+ if (parsedDocument == null)
+ return actions;
+ var model = parsedDocument.GetAst<SemanticModel> ();
+ if (model == null)
+ return actions;
+ var root = await model.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait (false);
+ if (span.End > root.Span.End)
+ return actions;
+ TextSpan tokenSegment = span;
+ var token = root.FindToken (span.Start);
+ if (!token.IsMissing)
+ tokenSegment = token.Span;
+ try {
+ if (codeRefactoringCache == null) {
+ codeRefactoringCache = (await GetCodeRefactoringsAsync (doc, MimeTypeToLanguage(editor.MimeType), cancellationToken).ConfigureAwait (false)).ToList ();
+ }
+ foreach (var descriptor in codeRefactoringCache) {
+ if (!descriptor.IsEnabled)
+ continue;
+ var analysisDocument = doc.AnalysisDocument;
+ if (cancellationToken.IsCancellationRequested || analysisDocument == null)
+ return Enumerable.Empty<ValidCodeAction> ();
+ try {
+ await descriptor.GetProvider ().ComputeRefactoringsAsync (
+ new CodeRefactoringContext (analysisDocument, span, delegate (CodeAction ca) {
+ var nrca = ca as NRefactoryCodeAction;
+ var validSegment = tokenSegment;
+ if (nrca != null)
+ validSegment = nrca.TextSpan;
+ actions.Add (new ValidCodeAction (ca, validSegment));
+ }, cancellationToken)
+ ).ConfigureAwait (false);
+ } catch (OperationCanceledException) {
+ if (cancellationToken.IsCancellationRequested)
+ return Enumerable.Empty<ValidCodeAction> ();
+ } catch (AggregateException) {
+ if (cancellationToken.IsCancellationRequested)
+ return Enumerable.Empty<ValidCodeAction> ();
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while getting refactorings from " + descriptor.IdString, e);
+ continue;
+ }
+ }
+ } catch (OperationCanceledException) {
+ if (cancellationToken.IsCancellationRequested)
+ return Enumerable.Empty<ValidCodeAction> ();
+ } catch (AggregateException) {
+ if (cancellationToken.IsCancellationRequested)
+ return Enumerable.Empty<ValidCodeAction> ();
+ }
+ return actions;
+ }
+
+ public static string MimeTypeToLanguage (string mimeType)
+ {
+ switch (mimeType) {
+ case "text/x-csharp":
+ return LanguageNames.CSharp;
+ }
+ return null;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/ICodeActionProviderSource.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/ICodeActionProviderSource.cs
deleted file mode 100644
index 155c74d767..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/ICodeActionProviderSource.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// ICodeActionProviderSource.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System.Collections.Generic;
-
-namespace MonoDevelop.CodeActions
-{
- /// <summary>
- /// A code action provider source provides a way for language backends to add a set of generated code action providers.
- /// </summary>
- public interface ICodeActionProviderSource
- {
- /// <summary>
- /// Gets the providers.
- /// </summary>
- IEnumerable<CodeActionProvider> GetProviders ();
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/ValidCodeAction.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/ValidCodeAction.cs
new file mode 100644
index 0000000000..803cd429be
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/ValidCodeAction.cs
@@ -0,0 +1,47 @@
+//
+// ValidCodeAction.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.Text;
+
+namespace MonoDevelop.CodeActions
+{
+ /// <summary>
+ /// Represents a code action that's valid at a specific segment.
+ /// </summary>
+ class ValidCodeAction
+ {
+ public CodeAction CodeAction { get; private set; }
+
+ public TextSpan ValidSegment { get; private set; }
+
+ public ValidCodeAction (CodeAction codeAction, TextSpan validSegment)
+ {
+ this.CodeAction = codeAction;
+ this.ValidSegment = validSegment;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/ValidCodeDiagnosticAction.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/ValidCodeDiagnosticAction.cs
new file mode 100644
index 0000000000..5c946ac714
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/ValidCodeDiagnosticAction.cs
@@ -0,0 +1,62 @@
+//
+// ValidCodeDiagnosticAction.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Microsoft.CodeAnalysis.CodeActions;
+using MonoDevelop.Core.Text;
+using MonoDevelop.CodeActions;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.CodeIssues;
+using Microsoft.CodeAnalysis.Text;
+using System.Collections.Immutable;
+
+namespace MonoDevelop.CodeActions
+{
+ /// <summary>
+ /// Represents a code action that's valid at a specific segment that was created as a action for a specific code diagnostic.
+ /// </summary>
+ class ValidCodeDiagnosticAction : ValidCodeAction
+ {
+ ImmutableArray<Diagnostic> validDiagnostics;
+
+ public CodeDiagnosticFixDescriptor Diagnostic {
+ get;
+ private set;
+ }
+
+ public ImmutableArray<Diagnostic> ValidDiagnostics {
+ get {
+ return validDiagnostics;
+ }
+ }
+
+ public ValidCodeDiagnosticAction (CodeDiagnosticFixDescriptor diagnostic, CodeAction codeAction, ImmutableArray<Diagnostic> validDiagnostics, TextSpan validSegment) : base (codeAction, validSegment)
+ {
+ this.Diagnostic = diagnostic;
+ this.validDiagnostics = validDiagnostics;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ActionSummary.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ActionSummary.cs
deleted file mode 100644
index 42eda56ce6..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ActionSummary.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// IGroupingProvider.cs
-//
-// Author:
-// Simon Lindgren <simon.n.lindgren@gmail.com>
-//
-// Copyright (c) 2013 Simon Lindgren
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using Mono.TextEditor;
-
-namespace MonoDevelop.CodeIssues
-{
-
- public class ActionSummary
- {
- /// <summary>
- /// Gets or sets the title.
- /// </summary>
- /// <value>The title.</value>
- public string Title { get; set; }
-
- /// <summary>
- /// Gets or sets the sibling key.
- /// </summary>
- /// <value>The sibling key.</value>
- public object SiblingKey { get; set; }
-
- /// <summary>
- /// Gets a value indicating whether this <see cref="MonoDevelop.CodeIssues.ActionSummary"/> is batchable.
- /// </summary>
- /// <value><c>true</c> if batchable; otherwise, <c>false</c>.</value>
- public bool Batchable { get; set; }
-
- public DocumentRegion Region { get; set; }
-
- /// <summary>
- /// Gets or sets the <see cref="IssueSummary"/> representing the source of this action.
- /// </summary>
- /// <value>The issue summary.</value>
- public IssueSummary IssueSummary { get; set; }
-
- public override string ToString ()
- {
- return string.Format ("[ActionSummary: Title={0}, Batchable={1}, Region={2}]", Title, Batchable, Region);
- }
- }
-
-}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/AnalyzersFromAssembly.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/AnalyzersFromAssembly.cs
new file mode 100644
index 0000000000..76d68b034f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/AnalyzersFromAssembly.cs
@@ -0,0 +1,110 @@
+//
+// AnalyzersFromAssembly.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using System.Threading;
+using MonoDevelop.CodeIssues;
+using Microsoft.CodeAnalysis.Diagnostics;
+using Microsoft.CodeAnalysis.CodeFixes;
+using RefactoringEssentials;
+using MonoDevelop.Core;
+using System.Threading.Tasks;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.CodeActions;
+using Microsoft.CodeAnalysis.CodeRefactorings;
+
+namespace MonoDevelop.CodeIssues
+{
+
+ class AnalyzersFromAssembly
+ {
+ public List<CodeDiagnosticDescriptor> Analyzers;
+ public List<CodeDiagnosticFixDescriptor> Fixes;
+ public List<CodeRefactoringDescriptor> Refactorings;
+
+ public readonly static AnalyzersFromAssembly Empty = new AnalyzersFromAssembly ();
+
+ public AnalyzersFromAssembly ()
+ {
+ Analyzers = new List<CodeDiagnosticDescriptor> ();
+ Fixes = new List<CodeDiagnosticFixDescriptor> ();
+ Refactorings = new List<CodeRefactoringDescriptor> ();
+ }
+
+ internal static AnalyzersFromAssembly CreateFrom (System.Reflection.Assembly asm, bool force = false)
+ {
+ var result = new AnalyzersFromAssembly ();
+ result.AddAssembly (asm, force);
+ return result;
+ }
+
+ internal void AddAssembly (System.Reflection.Assembly asm, bool force = false)
+ {
+ if (!force) {
+ var assemblyName = asm.GetName ().Name;
+ if (assemblyName == "MonoDevelop.AspNet" ||
+ assemblyName == "Microsoft.CodeAnalysis.CSharp" ||
+ assemblyName.Contains ("FSharpBinding") ||
+ assemblyName != "RefactoringEssentials" &&
+ !(asm.GetReferencedAssemblies ().Any (a => a.Name == diagnosticAnalyzerAssembly) && asm.GetReferencedAssemblies ().Any (a => a.Name == "MonoDevelop.Ide")))
+ return;
+ }
+ foreach (var type in asm.GetTypes ()) {
+ var notPortedYetAttribute = (NotPortedYetAttribute)type.GetCustomAttributes (typeof(NotPortedYetAttribute), false).FirstOrDefault ();
+ if (notPortedYetAttribute!= null) {
+ continue;
+ }
+ var analyzerAttr = (DiagnosticAnalyzerAttribute)type.GetCustomAttributes (typeof(DiagnosticAnalyzerAttribute), false).FirstOrDefault ();
+ if (analyzerAttr != null) {
+ var analyzer = (DiagnosticAnalyzer)Activator.CreateInstance (type);
+ foreach (var diag in analyzer.SupportedDiagnostics) {
+ try {
+ Analyzers.Add (new CodeDiagnosticDescriptor (diag, analyzerAttr.Languages, type));
+ } catch (Exception e) {
+ LoggingService.LogError ("error while adding diagnostic analyzer: " + diag.Id + " from assembly " + asm.FullName, e);
+ }
+ }
+ }
+
+ var codeFixAttr = (ExportCodeFixProviderAttribute)type.GetCustomAttributes (typeof(ExportCodeFixProviderAttribute), false).FirstOrDefault ();
+ if (codeFixAttr != null) {
+ Fixes.Add (new CodeDiagnosticFixDescriptor (type, codeFixAttr));
+ }
+
+ var exportAttr = type.GetCustomAttributes (typeof(ExportCodeRefactoringProviderAttribute), false).FirstOrDefault () as ExportCodeRefactoringProviderAttribute;
+ if (exportAttr != null) {
+ Refactorings.Add (new CodeRefactoringDescriptor (type, exportAttr));
+ }
+ }
+ }
+
+ readonly static string diagnosticAnalyzerAssembly = typeof (DiagnosticAnalyzerAttribute).Assembly.GetName ().Name;
+
+ }
+
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/BatchFixer.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/BatchFixer.cs
deleted file mode 100644
index 783b45ff03..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/BatchFixer.cs
+++ /dev/null
@@ -1,143 +0,0 @@
-//
-// BatchFixer.cs
-//
-// Author:
-// Simon Lindgren <simon.n.lindgren@gmail.com>
-//
-// Copyright (c) 2013 Simon Lindgren
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Linq;
-using System.Collections.Generic;
-using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using MonoDevelop.Core;
-using System.Threading.Tasks;
-using MonoDevelop.Refactoring;
-using ICSharpCode.NRefactory.Refactoring;
-using System.Threading;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.CSharp;
-using Mono.TextEditor.Utils;
-using System.Text;
-using Mono.TextEditor;
-
-namespace MonoDevelop.CodeIssues
-{
- public class BatchFixer
- {
- readonly IActionMatcher matcher;
-
- readonly IProgressMonitor monitor;
-
- public BatchFixer (IActionMatcher matcher, IProgressMonitor monitor)
- {
- this.matcher = matcher;
- this.monitor = monitor;
- }
-
- /// <summary>
- /// Tries to apply the actions passed in <paramref name="actions"/>.
- /// </summary>
- /// <param name="actions">The actions to apply.</param>
- /// <returns>The fixed code actions.</returns>
- public IEnumerable<ActionSummary> TryFixIssues (IEnumerable<ActionSummary> actions)
- {
- if (actions == null)
- throw new ArgumentNullException ("actions");
-
- // enumerate once
- var actionSummaries = actions as IList<ActionSummary> ?? actions.ToList ();
- var issueSummaries = actionSummaries.Select (action => action.IssueSummary).ToList ();
- var files = issueSummaries.Select (issue => issue.File).Distinct ().ToList ();
- monitor.BeginTask ("Applying fixes", files.Count);
-
- var appliedActions = new List<ActionSummary> (issueSummaries.Count);
- Parallel.ForEach (files, file => {
- monitor.Step (1);
-
- var fileSummaries = issueSummaries.Where (summary => summary.File == file);
- var inspectorIds = new HashSet<string> (fileSummaries.Select (summary => summary.InspectorIdString));
-
- bool hadBom;
- Encoding encoding;
- bool isOpen;
- var data = TextFileProvider.Instance.GetTextEditorData (file.FilePath, out hadBom, out encoding, out isOpen);
- IRefactoringContext refactoringContext;
- var realActions = GetIssues (data, file, inspectorIds, out refactoringContext).SelectMany (issue => issue.Actions).ToList ();
- if (realActions.Count == 0 || refactoringContext == null)
- return;
-
- var fileActionSummaries = actionSummaries.Where (summary => summary.IssueSummary.File == file).ToList ();
- var matches = matcher.Match (fileActionSummaries, realActions).ToList ();
-
- var appliedFixes = RefactoringService.ApplyFixes (matches.Select (match => match.Action), refactoringContext);
- appliedActions.AddRange (matches.Where (match => appliedFixes.Contains (match.Action)).Select (match => match.Summary));
-
- if (!isOpen) {
- // If the file is open we leave it to the user to explicitly save the file
- TextFileUtility.WriteText (file.Name, data.Text, encoding, hadBom);
- }
- });
- return appliedActions;
- }
-
- static IList<CodeIssue> GetIssues (TextEditorData data, ProjectFile file, ISet<string> inspectorIds, out IRefactoringContext refactoringContext)
- {
- var issues = new List<CodeIssue> ();
-
- var document = TypeSystemService.ParseFile (file.Project, data);
- if (document == null) {
- refactoringContext = null;
- return issues;
- }
-
- var content = TypeSystemService.GetProjectContext (file.Project);
- var compilation = content.AddOrUpdateFiles (document.ParsedFile).CreateCompilation ();
- var resolver = new CSharpAstResolver (compilation, document.GetAst<SyntaxTree> (), document.ParsedFile as ICSharpCode.NRefactory.CSharp.TypeSystem.CSharpUnresolvedFile);
-
- refactoringContext = document.CreateRefactoringContextWithEditor (data, resolver, CancellationToken.None);
- var context = refactoringContext;
- foreach (var provider in GetInspectors (data, inspectorIds)) {
- var severity = provider.GetSeverity ();
- if (severity == Severity.None || !provider.GetIsEnabled ())
- continue;
- try {
- lock (issues) {
- issues.AddRange (provider.GetIssues (context, CancellationToken.None));
- }
- } catch (Exception ex) {
- LoggingService.LogError ("Error while running code issue on: " + data.FileName, ex);
- }
- }
- return issues;
- }
-
- static IList<CodeIssueProvider> GetInspectors (TextEditorData editor, ICollection<string> inspectorIds)
- {
- var inspectors = RefactoringService.GetInspectors (editor.MimeType).ToList ();
- return inspectors
- .Where (inspector => inspectorIds.Contains (inspector.IdString))
- .ToList ();
- }
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/BuiltInCodeDiagnosticProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/BuiltInCodeDiagnosticProvider.cs
new file mode 100644
index 0000000000..bd00becc7c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/BuiltInCodeDiagnosticProvider.cs
@@ -0,0 +1,111 @@
+//
+// BuiltInCodeDiagnosticProvider.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using System.Threading;
+using MonoDevelop.CodeIssues;
+using MonoDevelop.Core;
+using System.Threading.Tasks;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.CodeActions;
+
+namespace MonoDevelop.CodeIssues
+{
+
+ /// <summary>
+ /// Provides all IDE code diagnostics and fix provider.
+ /// (Scans the app domain for providers)
+ /// </summary>
+ class BuiltInCodeDiagnosticProvider : CodeDiagnosticProvider
+ {
+ readonly static Task<AnalyzersFromAssembly> builtInDiagnostics;
+
+ static BuiltInCodeDiagnosticProvider ()
+ {
+ builtInDiagnostics = Task.Run (() => {
+ var result = new AnalyzersFromAssembly ();
+ foreach (var asm in AppDomain.CurrentDomain.GetAssemblies()) {
+ try {
+ result.AddAssembly (asm);
+ } catch (Exception e) {
+ LoggingService.LogError ("error while loading diagnostics in " + asm.FullName, e);
+ }
+ }
+ return result;
+ });
+ }
+
+ internal static CodeDiagnosticDescriptor GetCodeDiagnosticDescriptor (string diagnosticId)
+ {
+ foreach (var builtInDescriptor in BuiltInCodeDiagnosticProvider.GetBuiltInCodeDiagnosticDecsriptorsAsync (null).Result) {
+ if (builtInDescriptor.GetProvider ().SupportedDiagnostics.Any (diagnostic => diagnosticId == diagnostic.Id))
+ return builtInDescriptor;
+ }
+ return null;
+ }
+
+ internal async static Task<IEnumerable<CodeDiagnosticDescriptor>> GetBuiltInCodeDiagnosticDecsriptorsAsync (string language, bool includeDisabledNodes = false, CancellationToken cancellationToken = default (CancellationToken))
+ {
+ builtInDiagnostics.Wait (cancellationToken);
+ var diags = await builtInDiagnostics;
+ var builtInCodeDiagnostics = diags.Analyzers;
+ if (string.IsNullOrEmpty (language))
+ return includeDisabledNodes ? builtInCodeDiagnostics : builtInCodeDiagnostics.Where (act => act.IsEnabled);
+ return includeDisabledNodes ? builtInCodeDiagnostics.Where (ca => ca.Languages.Contains (language)) : builtInCodeDiagnostics.Where (ca => ca.Languages.Contains (language) && ca.IsEnabled);
+ }
+
+ public async static Task<IEnumerable<CodeDiagnosticFixDescriptor>> GetBuiltInCodeFixDescriptorsAsync (string language, CancellationToken cancellationToken = default (CancellationToken))
+ {
+ var diags = await builtInDiagnostics.ConfigureAwait (false);
+ var builtInCodeFixes = diags.Fixes;
+ return string.IsNullOrEmpty (language) ? builtInCodeFixes : builtInCodeFixes.Where (cfp => cfp.Languages.Contains (language));
+ }
+
+ public async static Task<IEnumerable<CodeRefactoringDescriptor>> GetBuiltInCodeRefactoringDescriptorsAsync (string language, bool includeDisabledNodes = false, CancellationToken cancellationToken = default (CancellationToken))
+ {
+ var diags = await builtInDiagnostics.ConfigureAwait (false);
+ var builtInCodeFixes = diags.Refactorings;
+ return string.IsNullOrEmpty (language) ? builtInCodeFixes : builtInCodeFixes.Where (cfp => cfp.Language.Contains (language));
+ }
+
+ public override Task<IEnumerable<CodeDiagnosticFixDescriptor>> GetCodeFixDescriptorsAsync (DocumentContext document, string language, CancellationToken cancellationToken)
+ {
+ return GetBuiltInCodeFixDescriptorsAsync (language, cancellationToken);
+ }
+
+ public override Task<IEnumerable<CodeDiagnosticDescriptor>> GetCodeDiagnosticDescriptorsAsync (DocumentContext document, string language, CancellationToken cancellationToken)
+ {
+ return GetBuiltInCodeDiagnosticDecsriptorsAsync (language, false, cancellationToken);
+ }
+
+ public override Task<IEnumerable<CodeRefactoringDescriptor>> GetCodeRefactoringDescriptorsAsync (DocumentContext document, string language, CancellationToken cancellationToken = default (CancellationToken))
+ {
+ return GetBuiltInCodeRefactoringDescriptorsAsync (language, false, cancellationToken);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CSharpSuppressionFixProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CSharpSuppressionFixProvider.cs
new file mode 100644
index 0000000000..5ec493b3bd
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CSharpSuppressionFixProvider.cs
@@ -0,0 +1,119 @@
+//
+// CSharpSuppressionFixProvider.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.CodeIssues
+{
+ class CSharpSuppressionFixProvider : ISuppressionFixProvider
+ {
+ static readonly Type typeInfo;
+ static readonly MethodInfo canBeSuppressedOrUnsuppressedMethod;
+ static readonly MethodInfo getFixAllProviderMethod;
+ static readonly MethodInfo getSuppressionsAsync1Method;
+ static readonly MethodInfo getSuppressionsAsync2Method;
+
+ object instance;
+
+ public static ISuppressionFixProvider Instance;
+
+ static CSharpSuppressionFixProvider ()
+ {
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.CSharp.CodeFixes.Suppression.CSharpSuppressionCodeFixProvider, Microsoft.CodeAnalysis.CSharp.Features", true);
+
+ if (typeInfo == null)
+ LoggingService.LogError ("CSharpSuppressionCodeFixProvider not found.");
+
+ canBeSuppressedOrUnsuppressedMethod = typeInfo.GetMethod ("CanBeSuppressedOrUnsuppressed");
+ if (canBeSuppressedOrUnsuppressedMethod == null)
+ LoggingService.LogError ("CanBeSuppressedOrUnsuppressed not found.");
+ getFixAllProviderMethod = typeInfo.GetMethod ("GetFixAllProvider");
+ if (getFixAllProviderMethod == null)
+ LoggingService.LogError ("GetFixAllProvider not found.");
+
+ getSuppressionsAsync1Method = typeInfo.GetMethod ("GetSuppressionsAsync", new [] { typeof(Project), typeof(IEnumerable<Diagnostic>), typeof(CancellationToken) });
+ if (getSuppressionsAsync1Method == null)
+ LoggingService.LogError ("GetSuppressionsAsync1 not found.");
+ getSuppressionsAsync2Method = typeInfo.GetMethod ("GetSuppressionsAsync", new [] { typeof(Document), typeof(TextSpan), typeof(IEnumerable<Diagnostic>), typeof(CancellationToken) });
+ if (getSuppressionsAsync2Method == null)
+ LoggingService.LogError ("GetSuppressionsAsync2 not found.");
+ Instance = new CSharpSuppressionFixProvider ();
+ }
+
+ public CSharpSuppressionFixProvider ()
+ {
+ instance = Activator.CreateInstance (typeInfo, true);
+ }
+
+ public bool CanBeSuppressedOrUnsuppressed (Diagnostic diagnostic)
+ {
+ return (bool)canBeSuppressedOrUnsuppressedMethod.Invoke (instance, new [] { diagnostic } );
+ }
+
+ public FixAllProvider GetFixAllProvider ()
+ {
+ return (FixAllProvider)canBeSuppressedOrUnsuppressedMethod.Invoke (instance, null);
+ }
+
+ public Task<IEnumerable<CodeFix>> GetSuppressionsAsync (Project project, IEnumerable<Diagnostic> diagnostics, CancellationToken cancellationToken)
+ {
+ var o2 = getSuppressionsAsync1Method.Invoke (instance, new object[] { project, diagnostics, cancellationToken } );
+ var task = (Task)o2;
+
+ var propertyInfo = task.GetType ().GetProperty ("Result");
+ var result = (IEnumerable)propertyInfo.GetValue (task);
+
+ List<CodeFix> wrappedResult = new List<CodeFix> ();
+ foreach (var o in result)
+ wrappedResult.Add (new CodeFix (o));
+ return Task.FromResult((IEnumerable<CodeFix>)wrappedResult);
+ }
+
+ public Task<IEnumerable<CodeFix>> GetSuppressionsAsync (Document document, TextSpan span, IEnumerable<Diagnostic> diagnostics, CancellationToken cancellationToken)
+ {
+ var o2 = getSuppressionsAsync2Method.Invoke (instance, new object [] { document, span, diagnostics, cancellationToken });
+ var task = (Task)o2;
+
+
+ var propertyInfo = task.GetType ().GetProperty ("Result");
+ var result = (IEnumerable)propertyInfo.GetValue (task);
+
+ List<CodeFix> wrappedResult = new List<CodeFix> ();
+ foreach (var o in result)
+ wrappedResult.Add (new CodeFix (o));
+ return Task.FromResult((IEnumerable<CodeFix>)wrappedResult);
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeAnalysisBatchRunner.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeAnalysisBatchRunner.cs
deleted file mode 100644
index 8463822b85..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeAnalysisBatchRunner.cs
+++ /dev/null
@@ -1,163 +0,0 @@
-//
-// CodeIssueBatchRunner.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-// Simon Lindgren <simon.n.lindgren@gmail.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
-// Copyright (c) 2013 Simon Lindgren
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Linq;
-using System.Threading;
-using MonoDevelop.Ide;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.TypeSystem;
-using System.Threading.Tasks;
-using System.IO;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.Refactoring;
-using MonoDevelop.Core;
-using System.Collections.Concurrent;
-using ICSharpCode.NRefactory.TypeSystem;
-using Mono.TextEditor;
-using MonoDevelop.Core.Instrumentation;
-using MonoDevelop.Refactoring;
-using System.Collections.Generic;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.CodeIssues
-{
- public class CodeAnalysisBatchRunner
- {
- private readonly object _lock = new object ();
-
- private int workerCount;
-
- private readonly AnalysisJobQueue jobQueue = new AnalysisJobQueue ();
-
- public IJobContext QueueJob (IAnalysisJob job)
- {
- jobQueue.Add (job);
- EnsureRunning ();
- return new JobContext (job, jobQueue, this);
- }
-
- private void EnsureRunning ()
- {
- for (; Interlocked.Add (ref workerCount, 1) < Environment.ProcessorCount;) {
- new Thread (() => {
- try {
- ProcessQueue ();
- }
- finally {
- Interlocked.Add (ref workerCount, -1);
- }
- }).Start ();
- }
- }
-
- private void ProcessQueue ()
- {
- while (true) {
- try {
- using (var slice = GetSlice ()) {
- if (slice == null)
- // TODO: Do something smarter if the queue is empty
- return;
- AnalyzeFile (slice, slice.GetJobs ().SelectMany (job => job.GetIssueProviders (slice.File)));
- }
- } catch (Exception e) {
- LoggingService.LogInternalError (e);
- }
- }
- }
-
- private JobSlice GetSlice ()
- {
- lock (_lock) {
- return jobQueue.Dequeue (1).FirstOrDefault ();
- }
- }
-
- void AnalyzeFile (JobSlice item, IEnumerable<BaseCodeIssueProvider> codeIssueProviders)
- {
- var file = item.File;
-
- if (file.BuildAction != BuildAction.Compile)
- return;
-
- if (!(file.Project is DotNetProject))
- return;
-
- TextEditorData editor;
- try {
- editor = TextFileProvider.Instance.GetReadOnlyTextEditorData (file.FilePath);
- } catch (FileNotFoundException) {
- // Swallow exception and ignore this file
- return;
- }
- var document = TypeSystemService.ParseFile (file.Project, editor);
- if (document == null)
- return;
-
- var content = TypeSystemService.GetProjectContext (file.Project);
- var compilation = content.AddOrUpdateFiles (document.ParsedFile).CreateCompilation ();
-
- CSharpAstResolver resolver;
- using (var timer = ExtensionMethods.ResolveCounter.BeginTiming ()) {
- resolver = new CSharpAstResolver (compilation, document.GetAst<SyntaxTree> (), document.ParsedFile as ICSharpCode.NRefactory.CSharp.TypeSystem.CSharpUnresolvedFile);
- try {
- resolver.ApplyNavigator (new ExtensionMethods.ConstantModeResolveVisitorNavigator (ResolveVisitorNavigationMode.Resolve, null));
- } catch (Exception e) {
- LoggingService.LogError ("Error while applying navigator", e);
- }
- }
- var context = document.CreateRefactoringContextWithEditor (editor, resolver, CancellationToken.None);
-
- foreach (var provider in codeIssueProviders) {
- if (item.CancellationToken.IsCancellationRequested)
- break;
- IList<IAnalysisJob> jobs;
- lock (_lock)
- jobs = item.GetJobs ().ToList ();
- var jobsForProvider = jobs.Where (j => j.GetIssueProviders (file).Contains (provider)).ToList();
- try {
- var issues = provider.GetIssues (context, CancellationToken.None).ToList ();
- foreach (var job in jobsForProvider) {
- // Call AddResult even if issues.Count == 0, to enable a job implementation to keep
- // track of progress information.
- job.AddResult (file, provider, issues);
- }
- } catch (OperationCanceledException) {
- // The operation was cancelled, no-op as the user-visible parts are
- // handled elsewhere
- } catch (Exception e) {
- foreach (var job in jobsForProvider) {
- job.AddError (file, provider);
- }
- }
- }
- }
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticDescriptor.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticDescriptor.cs
new file mode 100644
index 0000000000..0a2936b065
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticDescriptor.cs
@@ -0,0 +1,226 @@
+//
+// CodeIssueDescriptor.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis.Diagnostics;
+using MonoDevelop.Core;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Ide.Editor;
+using System.Threading;
+using MonoDevelop.Ide.TypeSystem;
+using System.Reflection;
+using Microsoft.CodeAnalysis.CodeActions;
+using System.Collections.Immutable;
+
+namespace MonoDevelop.CodeIssues
+{
+ class CodeDiagnosticDescriptor
+ {
+ readonly Type diagnosticAnalyzerType;
+ readonly Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor;
+
+ DiagnosticAnalyzer instance;
+
+
+ /// <summary>
+ /// Gets the identifier string.
+ /// </summary>
+ internal string IdString {
+ get {
+ return diagnosticAnalyzerType.FullName;
+ }
+ }
+
+ public Type DiagnosticAnalyzerType {
+ get {
+ return diagnosticAnalyzerType;
+ }
+ }
+
+ /// <summary>
+ /// Gets the display name for this issue.
+ /// </summary>
+ public string Name { get; private set; }
+
+ /// <summary>
+ /// Gets the description of the issue provider (used in the option panel).
+ /// </summary>
+
+ /// <summary>
+ /// Gets the languages for this issue.
+ /// </summary>
+ public string[] Languages { get; private set; }
+
+ public DiagnosticSeverity? DiagnosticSeverity {
+ get {
+ DiagnosticSeverity? result = null;
+
+ foreach (var diagnostic in GetProvider ().SupportedDiagnostics) {
+ if (!result.HasValue)
+ result = GetSeverity(diagnostic);
+ if (result != GetSeverity(diagnostic))
+ return null;
+ }
+ return result;
+ }
+
+ set {
+ if (!value.HasValue)
+ return;
+ foreach (var diagnostic in GetProvider ().SupportedDiagnostics) {
+ SetSeverity (diagnostic, value.Value);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this code action is enabled by the user.
+ /// </summary>
+ /// <value><c>true</c> if this code action is enabled; otherwise, <c>false</c>.</value>
+ public bool IsEnabled {
+ get {
+ foreach (var diagnostic in GetProvider ().SupportedDiagnostics) {
+ if (GetIsEnabled (diagnostic))
+ return true;
+ }
+ return false;
+ }
+ set {
+ foreach (var diagnostic in GetProvider ().SupportedDiagnostics) {
+ SetIsEnabled (diagnostic, value);
+ }
+ }
+ }
+
+ internal DiagnosticSeverity GetSeverity (DiagnosticDescriptor diagnostic)
+ {
+ return PropertyService.Get ("CodeIssues." + Languages + "." + IdString + "." + diagnostic.Id + ".severity", diagnostic.DefaultSeverity);
+ }
+
+ internal void SetSeverity (DiagnosticDescriptor diagnostic, DiagnosticSeverity severity)
+ {
+ PropertyService.Set ("CodeIssues." + Languages + "." + IdString + "." + diagnostic.Id + ".severity", severity);
+ }
+
+ internal bool GetIsEnabled (DiagnosticDescriptor diagnostic)
+ {
+ return PropertyService.Get ("CodeIssues." + Languages + "." + IdString + "." + diagnostic.Id + ".enabled", true);
+ }
+
+ internal void SetIsEnabled (DiagnosticDescriptor diagnostic, bool value)
+ {
+ PropertyService.Set ("CodeIssues." + Languages + "." + IdString + "." + diagnostic.Id + ".enabled", value);
+ }
+
+ static CodeDiagnosticDescriptor ()
+ {
+ getCodeActionsMethod = typeof (CodeAction).GetMethod ("GetCodeActions", BindingFlags.Instance | BindingFlags.NonPublic);
+ hasCodeActionsProperty = typeof (CodeAction).GetProperty ("HasCodeActions", BindingFlags.Instance | BindingFlags.NonPublic);
+
+ }
+
+ internal CodeDiagnosticDescriptor (Microsoft.CodeAnalysis.DiagnosticDescriptor descriptor, string[] languages, Type codeIssueType)
+ {
+ if (descriptor == null)
+ throw new ArgumentNullException ("descriptor");
+ if (languages == null)
+ throw new ArgumentNullException ("languages");
+ if (codeIssueType == null)
+ throw new ArgumentNullException ("codeIssueType");
+ Name = descriptor.Title.ToString () ?? "unnamed";
+ Languages = languages;
+ this.descriptor = descriptor;
+ this.diagnosticAnalyzerType = codeIssueType;
+ }
+
+ /// <summary>
+ /// Gets the roslyn code action provider.
+ /// </summary>
+ public DiagnosticAnalyzer GetProvider ()
+ {
+ if (instance == null)
+ instance = (DiagnosticAnalyzer)Activator.CreateInstance(diagnosticAnalyzerType);
+
+ return instance;
+ }
+
+ public override string ToString ()
+ {
+ return string.Format ("[CodeIssueDescriptor: IdString={0}, Name={1}, Language={2}]", IdString, Name, Languages);
+ }
+
+ public bool CanDisableWithPragma { get { return !string.IsNullOrEmpty (descriptor.Id); } }
+
+ const string analysisDisableTag = "Analysis ";
+ readonly static MethodInfo getCodeActionsMethod;
+ readonly static PropertyInfo hasCodeActionsProperty;
+
+ public async void DisableWithPragma (TextEditor editor, DocumentContext context, Diagnostic fix, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var line = editor.GetLineByOffset (fix.Location.SourceSpan.Start);
+ var span = new TextSpan (line.Offset, line.Length);
+ var fixes = await CSharpSuppressionFixProvider.Instance.GetSuppressionsAsync (context.AnalysisDocument, span, new [] { fix }, cancellationToken).ConfigureAwait (false);
+ foreach (var f in fixes) {
+ RunAction (context, f.Action, cancellationToken);
+ }
+ }
+
+ public async void DisableWithFile (TextEditor editor, DocumentContext context, Diagnostic fix, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var p = context.RoslynWorkspace.CurrentSolution.GetProject (TypeSystemService.GetProjectId (context.Project));
+
+ var fixes = await CSharpSuppressionFixProvider.Instance.GetSuppressionsAsync (p, new [] { fix }, cancellationToken ).ConfigureAwait (false);
+
+ foreach (var f in fixes) {
+ RunAction (context, f.Action, cancellationToken);
+ }
+ }
+
+ internal static async void RunAction (DocumentContext context, CodeAction action, CancellationToken cancellationToken)
+ {
+ var operations = await action.GetOperationsAsync (cancellationToken).ConfigureAwait (false);
+ if (operations == null)
+ return;
+ foreach (var op in operations) {
+ if (op == null)
+ continue;
+ try {
+ op.Apply (context.RoslynWorkspace, cancellationToken);
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while appyling operation : " + op, e);
+ }
+ }
+
+ if ((bool)hasCodeActionsProperty.GetValue (action)) {
+ var result = (ImmutableArray<CodeAction>)getCodeActionsMethod.Invoke (action, null);
+ foreach (var nested in result) {
+ RunAction (context, nested, cancellationToken);
+ }
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticFixDescriptor.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticFixDescriptor.cs
new file mode 100644
index 0000000000..29c0d576c8
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticFixDescriptor.cs
@@ -0,0 +1,89 @@
+//
+// CodeFixDescriptor.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.Diagnostics;
+using System.Linq;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.CodeIssues
+{
+ class CodeDiagnosticFixDescriptor
+ {
+ readonly Type codeFixProviderType;
+ readonly ExportCodeFixProviderAttribute attribute;
+ CodeFixProvider instance;
+
+ public string Name {
+ get {
+ return attribute.Name;
+ }
+ }
+
+ public string[] Languages {
+ get {
+ return attribute.Languages;
+ }
+ }
+
+ internal CodeDiagnosticFixDescriptor (Type codeFixProviderType, ExportCodeFixProviderAttribute attribute)
+ {
+ if (codeFixProviderType == null)
+ throw new ArgumentNullException ("codeFixProviderType");
+ if (attribute == null)
+ throw new ArgumentNullException ("attribute");
+ this.codeFixProviderType = codeFixProviderType;
+ this.attribute = attribute;
+ }
+
+ public CodeFixProvider GetCodeFixProvider ()
+ {
+ if (instance == null) {
+ try {
+ instance = (CodeFixProvider)Activator.CreateInstance (codeFixProviderType);
+ } catch (InvalidCastException) {
+ LoggingService.LogError (codeFixProviderType + " can't be cast to CodeFixProvider.");
+ throw;
+ }
+ }
+
+ return instance;
+ }
+
+ public CodeDiagnosticDescriptor GetCodeDiagnosticDescriptor (string language)
+ {
+ var fixableIds = GetCodeFixProvider ().FixableDiagnosticIds.ToList ();
+
+ foreach (var descriptor in BuiltInCodeDiagnosticProvider.GetBuiltInCodeDiagnosticDecsriptorsAsync (language).Result) {
+ if (descriptor.GetProvider ().SupportedDiagnostics.Any (diagnostic => fixableIds.Contains (diagnostic.Id)))
+ return descriptor;
+
+ }
+ return null;
+
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticProvider.cs
new file mode 100644
index 0000000000..479d24dffb
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticProvider.cs
@@ -0,0 +1,45 @@
+//
+// CodeDiagnosticProvider.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Collections.Generic;
+using System.Threading;
+using MonoDevelop.CodeIssues;
+using System.Threading.Tasks;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.CodeActions;
+
+namespace MonoDevelop.CodeIssues
+{
+ /// <summary>
+ /// The code diagnostic provider gives a list of code diagnostic and fix providers from an arbitrary source.
+ /// </summary>
+ abstract class CodeDiagnosticProvider
+ {
+ public abstract Task<IEnumerable<CodeDiagnosticDescriptor>> GetCodeDiagnosticDescriptorsAsync (DocumentContext document, string language, CancellationToken cancellationToken = default (CancellationToken));
+ public abstract Task<IEnumerable<CodeDiagnosticFixDescriptor>> GetCodeFixDescriptorsAsync (DocumentContext document, string language, CancellationToken cancellationToken = default (CancellationToken));
+ public abstract Task<IEnumerable<CodeRefactoringDescriptor>> GetCodeRefactoringDescriptorsAsync (DocumentContext document, string language, CancellationToken cancellationToken = default (CancellationToken));
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticRunner.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticRunner.cs
new file mode 100644
index 0000000000..3525d66f9e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeDiagnosticRunner.cs
@@ -0,0 +1,140 @@
+//
+// CodeAnalysisRunner.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//#define PROFILE
+using System;
+using System.Linq;
+using MonoDevelop.AnalysisCore;
+using System.Collections.Generic;
+using MonoDevelop.Ide.Gui;
+using System.Threading;
+using MonoDevelop.CodeIssues;
+using Microsoft.CodeAnalysis.Diagnostics;
+using Microsoft.CodeAnalysis.CodeFixes;
+using MonoDevelop.CodeActions;
+using MonoDevelop.Core;
+using MonoDevelop.AnalysisCore.Gui;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis;
+using System.Threading.Tasks;
+using System.Diagnostics;
+
+namespace MonoDevelop.CodeIssues
+{
+ static class CodeDiagnosticRunner
+ {
+ static IEnumerable<CodeDiagnosticDescriptor> diagnostics;
+ static TraceListener consoleTraceListener = new ConsoleTraceListener ();
+
+ public static async Task<IEnumerable<Result>> Check (AnalysisDocument analysisDocument, CancellationToken cancellationToken)
+ {
+ var input = analysisDocument.DocumentContext;
+ if (!AnalysisOptions.EnableFancyFeatures || input.Project == null || !input.IsCompileableInProject || input.AnalysisDocument == null)
+ return Enumerable.Empty<Result> ();
+ try {
+ var model = input.ParsedDocument.GetAst<SemanticModel> ();
+ if (model == null)
+ return Enumerable.Empty<Result> ();
+ var compilation = model.Compilation;
+ var language = CodeRefactoringService.MimeTypeToLanguage (analysisDocument.Editor.MimeType);
+
+ var providers = new List<DiagnosticAnalyzer> ();
+ var alreadyAdded = new HashSet<Type>();
+ if (diagnostics == null) {
+ diagnostics = await CodeRefactoringService.GetCodeDiagnosticsAsync (analysisDocument.DocumentContext, language, cancellationToken);
+ }
+ var diagnosticTable = new Dictionary<string, CodeDiagnosticDescriptor> ();
+ foreach (var diagnostic in diagnostics) {
+ if (alreadyAdded.Contains (diagnostic.DiagnosticAnalyzerType))
+ continue;
+ if (!diagnostic.IsEnabled)
+ continue;
+ alreadyAdded.Add (diagnostic.DiagnosticAnalyzerType);
+ var provider = diagnostic.GetProvider ();
+ if (provider == null)
+ continue;
+ foreach (var diag in provider.SupportedDiagnostics)
+ diagnosticTable [diag.Id] = diagnostic;
+ providers.Add (provider);
+ }
+
+ if (providers.Count == 0 || cancellationToken.IsCancellationRequested)
+ return Enumerable.Empty<Result> ();
+ #if DEBUG
+ Debug.Listeners.Add (consoleTraceListener);
+ #endif
+
+ CompilationWithAnalyzers compilationWithAnalyzer;
+ var analyzers = System.Collections.Immutable.ImmutableArray<DiagnosticAnalyzer>.Empty.AddRange (providers);
+ var diagnosticList = new List<Diagnostic> ();
+ try {
+ var options = new CompilationWithAnalyzersOptions (
+ null,
+ delegate (Exception exception, DiagnosticAnalyzer analyzer, Diagnostic diag) {
+ LoggingService.LogError ("Exception in diagnostic analyzer " + diag.Id + ":" + diag.GetMessage (), exception);
+ },
+ null,
+ false,
+ false
+ );
+
+ compilationWithAnalyzer = compilation.WithAnalyzers (analyzers, options);
+ if (input.ParsedDocument == null || cancellationToken.IsCancellationRequested)
+ return Enumerable.Empty<Result> ();
+
+ diagnosticList.AddRange (await compilationWithAnalyzer.GetAnalyzerSemanticDiagnosticsAsync (model, null, cancellationToken).ConfigureAwait (false));
+ diagnosticList.AddRange (await compilationWithAnalyzer.GetAnalyzerSyntaxDiagnosticsAsync (model.SyntaxTree, cancellationToken).ConfigureAwait (false));
+ } catch (Exception) {
+ return Enumerable.Empty<Result> ();
+ } finally {
+ #if DEBUG
+ Debug.Listeners.Remove (consoleTraceListener);
+ #endif
+ CompilationWithAnalyzers.ClearAnalyzerState (analyzers);
+ }
+
+ return diagnosticList
+ .Where (d => !d.Id.StartsWith("CS", StringComparison.Ordinal))
+ .Where (d => diagnosticTable[d.Id].GetIsEnabled (d.Descriptor))
+ .Select (diagnostic => {
+ var res = new DiagnosticResult(diagnostic);
+ // var line = analysisDocument.Editor.GetLineByOffset (res.Region.Start);
+ // Console.WriteLine (diagnostic.Id + "/" + res.Region +"/" + analysisDocument.Editor.GetTextAt (line));
+ return res;
+ });
+ } catch (OperationCanceledException) {
+ return Enumerable.Empty<Result> ();
+ } catch (AggregateException ae) {
+ ae.Flatten ().Handle (ix => ix is OperationCanceledException);
+ return Enumerable.Empty<Result> ();
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while running diagnostics.", e);
+ return Enumerable.Empty<Result> ();
+ }
+ }
+
+
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeFix.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeFix.cs
new file mode 100644
index 0000000000..5af069950c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeFix.cs
@@ -0,0 +1,93 @@
+//
+// CodeFix.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Diagnostics;
+using System.Reflection;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeActions;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.CodeIssues
+{
+ public class CodeFix
+ {
+ readonly static Type typeInfo;
+ readonly static FieldInfo projectField;
+ readonly static FieldInfo actionField;
+ readonly static FieldInfo diagnosticsField;
+
+ object codeFixInstance;
+
+ static CodeFix ()
+ {
+ typeInfo = Type.GetType ("Microsoft.CodeAnalysis.CodeFixes.CodeFix, Microsoft.CodeAnalysis.Workspaces", true);
+ if (typeInfo == null)
+ LoggingService.LogError ("CodeFix not found.");
+
+ projectField = typeInfo.GetField ("Project", BindingFlags.NonPublic | BindingFlags.Instance);
+ if (projectField == null)
+ LoggingService.LogError ("Project field not found.");
+
+ actionField = typeInfo.GetField ("Action", BindingFlags.NonPublic | BindingFlags.Instance);
+ if (actionField == null)
+ LoggingService.LogError ("Action field not found.");
+
+ diagnosticsField = typeInfo.GetField ("Diagnostics", BindingFlags.NonPublic | BindingFlags.Instance);
+ if (diagnosticsField == null)
+ LoggingService.LogError ("Diagnostics field not found.");
+
+
+ }
+
+ public Diagnostic PrimaryDiagnostic {
+ get {
+ return Diagnostics [0];
+ }
+ }
+
+ public Project Project { get { return (Project)projectField.GetValue (codeFixInstance); } }
+ public CodeAction Action { get { return (CodeAction)actionField.GetValue (codeFixInstance); } }
+ public ImmutableArray<Diagnostic> Diagnostics { get { return (ImmutableArray<Diagnostic>)diagnosticsField.GetValue (codeFixInstance); } }
+
+ public CodeFix (object codeFixInstance)
+ {
+ this.codeFixInstance = codeFixInstance;
+ }
+
+ public CodeFix (Project project, CodeAction action, Diagnostic diagnostic)
+ {
+ codeFixInstance = Activator.CreateInstance (typeInfo, project, action, diagnostic);
+ }
+
+ public CodeFix (Project project, CodeAction action, ImmutableArray<Diagnostic> diagnostics)
+ {
+ codeFixInstance = Activator.CreateInstance (typeInfo, project, action, diagnostics);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssue.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssue.cs
deleted file mode 100644
index 846f4dc678..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssue.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// CodeIssue.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using Mono.TextEditor;
-using System.Collections.Generic;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.Refactoring;
-
-namespace MonoDevelop.CodeIssues
-{
- /// <summary>
- /// A code issue marks an issue inside a text editor. An issue is a description shown in the tooltip and
- /// (optionally) a set of code actions to solve the issue.
- /// </summary>
- public class CodeIssue
- {
- /// <summary>
- /// Gets or sets the description shown in the tooltip.
- /// </summary>
- public string Description {
- get;
- private set;
- }
-
- /// <summary>
- /// Gets or sets the region of the issue.
- /// </summary>
- public DomRegion Region {
- get;
- private set;
- }
-
-
-
- /// <summary>
- /// Gets or sets a value indicating how this issue should be marked inside the text editor.
- /// Note: There is only one code issue provider generated therfore providers need to be state less.
- /// </summary>
- public IssueMarker IssueMarker { get; private set; }
-
-
- /// <summary>
- /// Gets or sets the code actions to solve the issue.
- /// </summary>
- public IEnumerable<MonoDevelop.CodeActions.CodeAction> Actions {
- get;
- private set;
- }
-
- public string InspectorIdString {
- get;
- private set;
- }
-
- /// <summary>
- /// Gets or sets the code action providers for this issue.
- /// </summary>
- public IList<Type> ActionProvider {
- get;
- set;
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="MonoDevelop.CodeIssues.CodeIssue"/> class.
- /// </summary>
- public CodeIssue (IssueMarker issueMarker, string description, string fileName, DocumentLocation start, DocumentLocation end, string inspectorIdString, IEnumerable<MonoDevelop.CodeActions.CodeAction> actions = null) : this (issueMarker, description, new DomRegion (fileName, start, end), inspectorIdString, actions)
- {
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="MonoDevelop.CodeIssues.CodeIssue"/> class.
- /// </summary>
- public CodeIssue (IssueMarker issueMarker, string description, DomRegion region, string inspectorIdString, IEnumerable<MonoDevelop.CodeActions.CodeAction> actions = null)
- {
- IssueMarker = issueMarker;
- Description = description;
- Region = region;
- Actions = actions;
- InspectorIdString = inspectorIdString;
- }
-
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssueAddinNode.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssueAddinNode.cs
deleted file mode 100644
index d8aee4e498..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssueAddinNode.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// InspectorAddinNode.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using MonoDevelop.SourceEditor;
-using Mono.Addins;
-using MonoDevelop.Core;
-using MonoDevelop.SourceEditor.QuickTasks;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.Refactoring;
-
-namespace MonoDevelop.CodeIssues
-{
- public class CodeIssueAddinNode : TypeExtensionNode
- {
- [NodeAttribute ("mimeType", Required=true, Description="The mime type of this action.")]
- string mimeType = null;
- public string MimeType {
- get {
- return mimeType;
- }
- }
-
- [NodeAttribute ("severity", Required=true, Localizable=false, Description="The severity of this action.")]
- Severity severity;
- public Severity Severity {
- get {
- return severity;
- }
- }
-
- CodeIssueProvider inspector;
- public CodeIssueProvider Inspector {
- get {
- if (inspector == null) {
- inspector = (CodeIssueProvider)CreateInstance ();
- inspector.DefaultSeverity = severity;
- inspector.SetMimeType (MimeType);
- }
- return inspector;
- }
- }
-
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePanelWidget.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePanelWidget.cs
index 241f9281f6..7533c2d604 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePanelWidget.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePanelWidget.cs
@@ -28,15 +28,17 @@ using MonoDevelop.Ide.Gui.Dialogs;
using Gtk;
using MonoDevelop.Core;
using System.Linq;
-using MonoDevelop.SourceEditor;
using MonoDevelop.Refactoring;
using System.Collections.Generic;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.Refactoring;
using GLib;
using MonoDevelop.Components;
using Gdk;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.CodeActions;
+using Microsoft.CodeAnalysis;
using MonoDevelop.SourceEditor.QuickTasks;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide;
namespace MonoDevelop.CodeIssues
{
@@ -58,7 +60,7 @@ namespace MonoDevelop.CodeIssues
widget = new CodeIssuePanelWidget ("text/x-csharp");
}
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
EnsureWidget ();
return widget;
@@ -73,19 +75,21 @@ namespace MonoDevelop.CodeIssues
partial class CodeIssuePanelWidget : Bin
{
readonly string mimeType;
- readonly TreeStore treeStore = new TreeStore (typeof(string), typeof(BaseCodeIssueProvider), typeof (string));
- readonly Dictionary<BaseCodeIssueProvider, Severity> severities = new Dictionary<BaseCodeIssueProvider, Severity> ();
- readonly Dictionary<BaseCodeIssueProvider, bool> enableState = new Dictionary<BaseCodeIssueProvider, bool> ();
+ readonly TreeStore treeStore = new TreeStore (typeof(string), typeof(Tuple<CodeDiagnosticDescriptor, DiagnosticDescriptor>), typeof (string));
+ readonly Dictionary<Tuple<CodeDiagnosticDescriptor, DiagnosticDescriptor>, DiagnosticSeverity?> severities = new Dictionary<Tuple<CodeDiagnosticDescriptor, DiagnosticDescriptor>, DiagnosticSeverity?> ();
+ readonly Dictionary<Tuple<CodeDiagnosticDescriptor, DiagnosticDescriptor>, bool> enableState = new Dictionary<Tuple<CodeDiagnosticDescriptor, DiagnosticDescriptor>, bool> ();
void GetAllSeverities ()
{
- foreach (var node in RefactoringService.GetInspectors (mimeType)) {
- severities [node] = node.GetSeverity ();
- enableState [node] = node.GetIsEnabled ();
- if (node.HasSubIssues) {
- foreach (var subIssue in node.SubIssues) {
- severities [subIssue] = subIssue.GetSeverity ();
- enableState [subIssue] = subIssue.GetIsEnabled ();
+ foreach (var node in BuiltInCodeDiagnosticProvider.GetBuiltInCodeDiagnosticDecsriptorsAsync (CodeRefactoringService.MimeTypeToLanguage (mimeType), true).Result) {
+ var root = new Tuple<CodeDiagnosticDescriptor, DiagnosticDescriptor> (node, null);
+ severities [root] = node.DiagnosticSeverity;
+ enableState [root] = node.IsEnabled;
+ if (node.GetProvider ().SupportedDiagnostics.Length > 1) {
+ foreach (var subIssue in node.GetProvider ().SupportedDiagnostics) {
+ var sub = new Tuple<CodeDiagnosticDescriptor, DiagnosticDescriptor> (node, subIssue);
+ severities [sub] = node.GetSeverity (subIssue);
+ enableState [sub] = node.GetIsEnabled (subIssue);
}
}
}
@@ -102,8 +106,8 @@ namespace MonoDevelop.CodeIssues
bool SelectCodeIssue (string idString, TreeIter iter)
{
do {
- var provider = treeStore.GetValue (iter, 1) as BaseCodeIssueProvider;
- if (provider != null && provider.IdString == idString) {
+ var provider = (Tuple<CodeDiagnosticDescriptor, DiagnosticDescriptor>)treeStore.GetValue (iter, 1);
+ if (provider != null && idString == provider.Item1.IdString) {
treeviewInspections.ExpandToPath (treeStore.GetPath (iter));
treeviewInspections.Selection.SelectIter (iter);
return true;
@@ -120,33 +124,30 @@ namespace MonoDevelop.CodeIssues
return false;
}
- static string GetDescription (Severity severity)
+ static string GetDescription (DiagnosticSeverity severity)
{
switch (severity) {
- case Severity.None:
+ case DiagnosticSeverity.Hidden:
return GettextCatalog.GetString ("Do not show");
- case Severity.Error:
+ case DiagnosticSeverity.Error:
return GettextCatalog.GetString ("Error");
- case Severity.Warning:
+ case DiagnosticSeverity.Warning:
return GettextCatalog.GetString ("Warning");
- case Severity.Hint:
- return GettextCatalog.GetString ("Hint");
- case Severity.Suggestion:
- return GettextCatalog.GetString ("Suggestion");
+ case DiagnosticSeverity.Info:
+ return GettextCatalog.GetString ("Info");
default:
throw new ArgumentOutOfRangeException ();
}
}
- Xwt.Drawing.Image GetIcon (Severity severity)
+ Xwt.Drawing.Image GetIcon (DiagnosticSeverity severity)
{
switch (severity) {
- case Severity.Error:
+ case DiagnosticSeverity.Error:
return QuickTaskOverviewMode.ErrorImage;
- case Severity.Warning:
+ case DiagnosticSeverity.Warning:
return QuickTaskOverviewMode.WarningImage;
- case Severity.Hint:
- case Severity.Suggestion:
+ case DiagnosticSeverity.Info:
return QuickTaskOverviewMode.SuggestionImage;
default:
return QuickTaskOverviewMode.OkImage;
@@ -157,25 +158,24 @@ namespace MonoDevelop.CodeIssues
{
categories.Clear ();
treeStore.Clear ();
-
- var grouped = severities.Keys.OfType<CodeIssueProvider> ()
- .Where (node => string.IsNullOrEmpty (filter) || node.Title.IndexOf (filter, StringComparison.OrdinalIgnoreCase) > 0)
- .GroupBy (node => node.Category)
+ var grouped = severities.Keys
+ .Where (node => node.Item2 == null && (string.IsNullOrEmpty (filter) || node.Item1.Name.IndexOf (filter, StringComparison.OrdinalIgnoreCase) > 0))
+ .GroupBy (node => node.Item1.GetProvider ().SupportedDiagnostics.First ().Category)
.OrderBy (g => g.Key, StringComparer.Ordinal);
foreach (var g in grouped) {
TreeIter categoryIter = treeStore.AppendValues ("<b>" + g.Key + "</b>", null, null);
categories [g.Key] = categoryIter;
- foreach (var node in g.OrderBy (n => n.Title, StringComparer.Ordinal)) {
- var title = node.Title;
+ foreach (var node in g.OrderBy (n => n.Item1.Name, StringComparer.Ordinal)) {
+ var title = node.Item1.Name;
MarkupSearchResult (filter, ref title);
- var nodeIter = treeStore.AppendValues (categoryIter, title, node, node.Description);
- if (node.HasSubIssues) {
- foreach (var subIssue in node.SubIssues) {
- title = subIssue.Title;
+ var nodeIter = treeStore.AppendValues (categoryIter, title, node, Ambience.EscapeText (node.Item1.Name));
+ if (node.Item1.GetProvider ().SupportedDiagnostics.Length > 1) {
+ foreach (var subIssue in node.Item1.GetProvider ().SupportedDiagnostics) {
+ title = subIssue.Title.ToString ();
MarkupSearchResult (filter, ref title);
- treeStore.AppendValues (nodeIter, title, subIssue, subIssue.Description);
+ treeStore.AppendValues (nodeIter, title, new Tuple<CodeDiagnosticDescriptor, DiagnosticDescriptor>(node.Item1, subIssue), Ambience.EscapeText (node.Item1.Name));
}
}
}
@@ -212,8 +212,11 @@ namespace MonoDevelop.CodeIssues
{
int w = 10;
var newCellArea = new Gdk.Rectangle (cell_area.X + w, cell_area.Y, cell_area.Width - w, cell_area.Height);
+ var icon = Icon;
+ if ((flags & Gtk.CellRendererState.Selected) != 0)
+ icon = icon.WithStyles ("sel");
using (var ctx = CairoHelper.Create (window)) {
- ctx.DrawImage (widget, Icon, cell_area.X - 4, cell_area.Y + Math.Round ((cell_area.Height - Icon.Height) / 2));
+ ctx.DrawImage (widget, icon, cell_area.X - 4, cell_area.Y + Math.Round ((cell_area.Height - Icon.Height) / 2));
}
base.Render (window, widget, background_area, newCellArea, expose_area, flags);
@@ -241,7 +244,7 @@ namespace MonoDevelop.CodeIssues
toggleRenderer.Toggled += delegate(object o, ToggledArgs args) {
TreeIter iter;
if (treeStore.GetIterFromString (out iter, args.Path)) {
- var provider = (BaseCodeIssueProvider)treeStore.GetValue (iter, 1);
+ var provider = (Tuple<CodeDiagnosticDescriptor, DiagnosticDescriptor>)treeStore.GetValue (iter, 1);
enableState[provider] = !enableState[provider];
}
};
@@ -251,7 +254,7 @@ namespace MonoDevelop.CodeIssues
titleCol.PackStart (toggleRenderer, false);
titleCol.Sizing = TreeViewColumnSizing.Autosize;
titleCol.SetCellDataFunc (toggleRenderer, delegate (TreeViewColumn treeColumn, CellRenderer cell, TreeModel model, TreeIter iter) {
- var provider = (BaseCodeIssueProvider)model.GetValue (iter, 1);
+ var provider = (Tuple<CodeDiagnosticDescriptor, DiagnosticDescriptor>)treeStore.GetValue (iter, 1);
if (provider == null) {
toggleRenderer.Visible = false;
return;
@@ -284,12 +287,11 @@ namespace MonoDevelop.CodeIssues
col.MinWidth = 100;
col.Expand = false;
- var comboBoxStore = new ListStore (typeof(string), typeof(Severity));
-// comboBoxStore.AppendValues (GetDescription (Severity.None), Severity.None);
- comboBoxStore.AppendValues (GetDescription (Severity.Error), Severity.Error);
- comboBoxStore.AppendValues (GetDescription (Severity.Warning), Severity.Warning);
- comboBoxStore.AppendValues (GetDescription (Severity.Hint), Severity.Hint);
- comboBoxStore.AppendValues (GetDescription (Severity.Suggestion), Severity.Suggestion);
+ var comboBoxStore = new ListStore (typeof(string), typeof(DiagnosticSeverity));
+ comboBoxStore.AppendValues (GetDescription (DiagnosticSeverity.Hidden), DiagnosticSeverity.Hidden);
+ comboBoxStore.AppendValues (GetDescription (DiagnosticSeverity.Error), DiagnosticSeverity.Error);
+ comboBoxStore.AppendValues (GetDescription (DiagnosticSeverity.Warning), DiagnosticSeverity.Warning);
+ comboBoxStore.AppendValues (GetDescription (DiagnosticSeverity.Info), DiagnosticSeverity.Info);
comboRenderer.Model = comboBoxStore;
comboRenderer.Mode = CellRendererMode.Activatable;
comboRenderer.TextColumn = 0;
@@ -307,8 +309,8 @@ namespace MonoDevelop.CodeIssues
return;
do {
if ((string)comboBoxStore.GetValue (storeIter, 0) == args.NewText) {
- var provider = (BaseCodeIssueProvider)treeStore.GetValue (iter, 1);
- var severity = (Severity)comboBoxStore.GetValue (storeIter, 1);
+ var provider = (Tuple<CodeDiagnosticDescriptor, DiagnosticDescriptor>)treeStore.GetValue (iter, 1);
+ var severity = (DiagnosticSeverity)comboBoxStore.GetValue (storeIter, 1);
severities[provider] = severity;
return;
}
@@ -316,15 +318,19 @@ namespace MonoDevelop.CodeIssues
};
col.SetCellDataFunc (comboRenderer, delegate (TreeViewColumn treeColumn, CellRenderer cell, TreeModel model, TreeIter iter) {
- var provider = (BaseCodeIssueProvider)model.GetValue (iter, 1);
+ var provider = (Tuple<CodeDiagnosticDescriptor, DiagnosticDescriptor>)treeStore.GetValue (iter, 1);
if (provider == null) {
comboRenderer.Visible = false;
return;
}
var severity = severities[provider];
+ if (!severity.HasValue) {
+ comboRenderer.Visible = false;
+ return;
+ }
comboRenderer.Visible = true;
- comboRenderer.Text = GetDescription (severity);
- comboRenderer.Icon = GetIcon (severity);
+ comboRenderer.Text = GetDescription (severity.Value);
+ comboRenderer.Icon = GetIcon (severity.Value);
});
treeviewInspections.HeadersVisible = false;
treeviewInspections.Model = treeStore;
@@ -342,10 +348,27 @@ namespace MonoDevelop.CodeIssues
public void ApplyChanges ()
{
- foreach (var kv in severities)
- kv.Key.SetSeverity (kv.Value);
- foreach (var kv in enableState)
- kv.Key.SetIsEnabled (kv.Value);
+ foreach (var kv in severities) {
+ var userSeverity = kv.Value;
+ if (!userSeverity.HasValue)
+ continue;
+ if (kv.Key.Item2 == null) {
+ kv.Key.Item1.DiagnosticSeverity = userSeverity;
+ continue;
+ }
+ kv.Key.Item1.SetSeverity (kv.Key.Item2, userSeverity.Value);
+ }
+
+ foreach (var kv in enableState) {
+ var userIsEnabled = kv.Value;
+ if (kv.Key.Item2 == null) {
+ kv.Key.Item1.IsEnabled = userIsEnabled;
+ continue;
+ }
+ kv.Key.Item1.SetIsEnabled (kv.Key.Item2, userIsEnabled);
+ }
+ foreach (var doc in IdeApp.Workbench.Documents)
+ doc.StartReparseThread ();
}
}
-} \ No newline at end of file
+}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssueProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssueProvider.cs
deleted file mode 100644
index d9a2abe2ef..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssueProvider.cs
+++ /dev/null
@@ -1,207 +0,0 @@
-//
-// IInspector.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin <http://xamarin.com>
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System.Collections.Generic;
-using System.Threading;
-using MonoDevelop.Core;
-using ICSharpCode.NRefactory.Refactoring;
-using Mono.TextEditor;
-using System;
-
-namespace MonoDevelop.CodeIssues
-{
- public abstract class BaseCodeIssueProvider
- {
- public virtual CodeIssueProvider Parent {
- get {
- return null;
- }
- }
- /// <summary>
- /// Gets or sets the type of the MIME the provider is attached to.
- /// </summary>
- public abstract string MimeType {
- get;
- }
-
- /// <summary>
- /// Gets or sets the title of the issue provider (used in the option panel).
- /// </summary>
- public string Title { get; set; }
-
- /// <summary>
- /// Gets or sets the description of the issue provider (used in the option panel).
- /// </summary>
- public string Description { get; set; }
-
-
- /// <summary>
- /// Gets the identifier string used as property ID tag.
- /// </summary>
- public virtual string IdString {
- get {
- return "refactoring.codeissues." + MimeType + "." + GetType ().FullName;
- }
- }
-
- /// <summary>
- /// Gets or sets the default severity. Note that GetSeverity () should be called to get the valid value inside the IDE.
- /// </summary>
- public Severity DefaultSeverity { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether this issue is enabled. Note that GetIsEnabled () should be called to get the valid value inside the IDE.
- /// </summary>
- /// <value><c>true</c> if this instance is enabled; otherwise, <c>false</c>.</value>
- public bool IsEnabledByDefault { get; set; }
-
- /// <summary>
- /// Gets the current (user defined) severity.
- /// </summary>
- protected Severity severity;
-
- public Severity GetSeverity ()
- {
- return severity;
- }
-
- /// <summary>
- /// Sets the user defined severity.
- /// </summary>
- public void SetSeverity (Severity severity)
- {
- if (this.severity == severity)
- return;
- this.severity = severity;
- PropertyService.Set (IdString, severity);
- }
-
-
- protected bool isEnabled;
-
- public bool GetIsEnabled ()
- {
- return isEnabled;
- }
-
- /// <summary>
- /// Sets the user defined severity.
- /// </summary>
- public void SetIsEnabled (bool isEnabled)
- {
- if (this.isEnabled == isEnabled)
- return;
- this.isEnabled = isEnabled;
- PropertyService.Set (IdString + ".isEnabled", isEnabled);
- }
-
- protected void UpdateSeverity ()
- {
- severity = PropertyService.Get<Severity> (IdString, DefaultSeverity);
- isEnabled = PropertyService.Get<bool> (IdString+ ".isEnabled", IsEnabledByDefault);
- }
-
- /// <summary>
- /// Gets all the code issues inside a document.
- /// </summary>
- public abstract IEnumerable<CodeIssue> GetIssues (object refactoringContext, CancellationToken cancellationToken);
-
- public virtual bool CanDisableOnce { get { return false; } }
-
- public virtual bool CanDisableAndRestore { get { return false; } }
-
- public virtual bool CanDisableWithPragma { get { return false; } }
-
- public virtual bool CanSuppressWithAttribute { get { return false; } }
-
- public virtual void DisableOnce (MonoDevelop.Ide.Gui.Document document, DocumentRegion loc)
- {
- throw new NotSupportedException ();
- }
-
- public virtual void DisableAndRestore (MonoDevelop.Ide.Gui.Document document, DocumentRegion loc)
- {
- throw new NotSupportedException ();
- }
-
- public virtual void DisableWithPragma (MonoDevelop.Ide.Gui.Document document, DocumentRegion loc)
- {
- throw new NotSupportedException ();
- }
-
- public virtual void SuppressWithAttribute (MonoDevelop.Ide.Gui.Document document, DocumentRegion loc)
- {
- throw new NotSupportedException ();
- }
- }
-
-
- /// <summary>
- /// A code issue provider is a factory that creates code issues of a given document.
- /// </summary>
- public abstract class CodeIssueProvider : BaseCodeIssueProvider
- {
- string mimeType;
- public override string MimeType {
- get {
- return mimeType;
- }
- }
-
- public void SetMimeType (string mimeType)
- {
- this.mimeType = mimeType;
- UpdateSeverity ();
- }
-
- /// <summary>
- /// Gets or sets the category of the issue provider (used in the option panel).
- /// </summary>
- public string Category { get; set; }
-
- /// <summary>
- /// If true this issue has sub issues.
- /// </summary>
- public abstract bool HasSubIssues { get; }
-
- /// <summary>
- /// Gets the sub issues of this issue. If HasSubIssus == false an InvalidOperationException is thrown.
- /// </summary>
- public virtual IEnumerable<BaseCodeIssueProvider> SubIssues { get { throw new InvalidOperationException (); } }
-
- /// <summary>
- /// Gets the effective set of providers. The effective set of providers
- /// is either the sub issues (if it has sub issues) or simply itself (otherwise).
- /// </summary>
- /// <returns>The effective provider set.</returns>
- public IEnumerable<BaseCodeIssueProvider> GetEffectiveProviderSet()
- {
- if (HasSubIssues)
- return SubIssues;
- return new[] { this };
- }
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/DefaultCodeIssueCategories.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/DefaultCodeIssueCategories.cs
deleted file mode 100644
index 68f473ed32..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/DefaultCodeIssueCategories.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// DefaultInspectionCategories.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin <http://xamarin.com>
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.CodeIssues
-{
- /// <summary>
- /// Default code issue categories provide strings to common categories used in the code issue options panel.
- /// </summary>
- public static class DefaultCodeIssueCategories
- {
- public readonly static string Improvements = GettextCatalog.GetString ("Code Improvements");
- public readonly static string CodeQualityIssues = GettextCatalog.GetString ("Code Quality Issues");
- public readonly static string ConstraintViolations = GettextCatalog.GetString ("Constraint Violations");
- public readonly static string Redundancies = GettextCatalog.GetString ("Redundancies");
- public readonly static string Opportunities = GettextCatalog.GetString ("Language Usage Opportunities");
- public readonly static string Notifications = GettextCatalog.GetString ("Code Notifications");
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/DiagnosticResult.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/DiagnosticResult.cs
new file mode 100644
index 0000000000..830d8483bb
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/DiagnosticResult.cs
@@ -0,0 +1,77 @@
+//
+// CodeAnalysisRunner.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//#define PROFILE
+using System;
+using MonoDevelop.AnalysisCore;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
+using RefactoringEssentials;
+
+namespace MonoDevelop.CodeIssues
+{
+ class DiagnosticResult : Result
+ {
+ readonly Diagnostic diagnostic;
+
+ public Diagnostic Diagnostic {
+ get {
+ return diagnostic;
+ }
+ }
+
+ public DiagnosticResult (Diagnostic diagnostic) : base (GetSpan (diagnostic), diagnostic.GetMessage ())
+ {
+ if (diagnostic == null)
+ throw new ArgumentNullException ("diagnostic");
+ this.diagnostic = diagnostic;
+
+ SetSeverity (diagnostic.Severity, GetIssueMarker ());
+ }
+
+ static TextSpan GetSpan (Diagnostic diagnostic)
+ {
+ int start = diagnostic.Location.SourceSpan.Start;
+ int end = diagnostic.Location.SourceSpan.End;
+
+ foreach (var loc in diagnostic.AdditionalLocations) {
+ start = Math.Min (start, loc.SourceSpan.Start);
+ end = Math.Max (start, loc.SourceSpan.End);
+ }
+
+ return TextSpan.FromBounds (start, end);
+ }
+
+ IssueMarker GetIssueMarker ()
+ {
+ if (diagnostic.Descriptor.Category == DiagnosticAnalyzerCategories.RedundanciesInCode || diagnostic.Descriptor.Category == DiagnosticAnalyzerCategories.RedundanciesInDeclarations)
+ return IssueMarker.GrayOut;
+ if (diagnostic.Severity == DiagnosticSeverity.Info)
+ return IssueMarker.DottedLine;
+ return IssueMarker.WavedLine;
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/FileGroupingProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/FileGroupingProvider.cs
deleted file mode 100644
index a92561d2d6..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/FileGroupingProvider.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// FileGroupingProvider.cs
-//
-// Author:
-// Marius Ungureanu <marius.ungureanu@xamarin.com>
-//
-// Copyright (c) 2013 Marius Ungureanu
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using MonoDevelop.Projects;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.CodeIssues
-{
- [GroupingDescription("File")]
- public class FileGroupingProvider : AbstractGroupingProvider<ProjectFile>
- {
- #region implemented abstract members of AbstractGroupingProvider
- protected override ProjectFile GetGroupingKey (IssueSummary issue)
- {
- return issue.File;
- }
- protected override string GetGroupName (IssueSummary issue)
- {
- return issue.File.FilePath.ToRelative (issue.Project.BaseDirectory);
- }
- #endregion
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ICodeIssueProviderSource.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ICodeIssueProviderSource.cs
deleted file mode 100644
index 39ddd1a037..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ICodeIssueProviderSource.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// ICodeIssueProviderSource.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System.Collections.Generic;
-using System.Threading;
-using MonoDevelop.Ide.TypeSystem;
-using MonoDevelop.Projects;
-using Mono.TextEditor;
-
-namespace MonoDevelop.CodeIssues
-{
- /// <summary>
- /// A code issue provider source provides a way for language backends to add a set of generated code issue providers.
- /// </summary>
- public interface ICodeIssueProviderSource
- {
- /// <summary>
- /// Gets the providers.
- /// </summary>
- IEnumerable<CodeIssueProvider> GetProviders ();
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ISuppressionFixProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ISuppressionFixProvider.cs
new file mode 100644
index 0000000000..9343139e81
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ISuppressionFixProvider.cs
@@ -0,0 +1,63 @@
+//
+// ISuppressionFixProvider.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.CodeFixes;
+using Microsoft.CodeAnalysis.Text;
+
+namespace MonoDevelop.CodeIssues
+{
+ interface ISuppressionFixProvider
+ {
+ /// <summary>
+ /// Returns true if the given diagnostic can be suppressed or unsuppressed.
+ /// </summary>
+ bool CanBeSuppressedOrUnsuppressed(Diagnostic diagnostic);
+
+ /// <summary>
+ /// Gets one or more add suppression or remove suppression fixes for the specified diagnostics represented as a list of <see cref="CodeAction"/>'s.
+ /// </summary>
+ /// <returns>A list of zero or more potential <see cref="CodeFix"/>'es. It is also safe to return null if there are none.</returns>
+ Task<IEnumerable<CodeFix>> GetSuppressionsAsync(Document document, TextSpan span, IEnumerable<Diagnostic> diagnostics, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Gets one or more add suppression or remove suppression fixes for the specified no-location diagnostics represented as a list of <see cref="CodeAction"/>'s.
+ /// </summary>
+ /// <returns>A list of zero or more potential <see cref="CodeFix"/>'es. It is also safe to return null if there are none.</returns>
+ Task<IEnumerable<CodeFix>> GetSuppressionsAsync(Project project, IEnumerable<Diagnostic> diagnostics, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Gets an optional <see cref="FixAllProvider"/> that can fix all/multiple occurrences of diagnostics fixed by this fix provider.
+ /// Return null if the provider doesn't support fix all/multiple occurrences.
+ /// Otherwise, you can return any of the well known fix all providers from <see cref="WellKnownFixAllProviders"/> or implement your own fix all provider.
+ /// </summary>
+ FixAllProvider GetFixAllProvider();
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IssueSummary.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IssueSummary.cs
deleted file mode 100644
index bb022e92a8..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IssueSummary.cs
+++ /dev/null
@@ -1,236 +0,0 @@
-//
-// IGroupingProvider.cs
-//
-// Author:
-// Simon Lindgren <simon.n.lindgren@gmail.com>
-//
-// Copyright (c) 2013 Simon Lindgren
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.Refactoring;
-using MonoDevelop.Projects;
-using System.Collections.Generic;
-using System.IO;
-using System;
-using System.Linq;
-
-namespace MonoDevelop.CodeIssues
-{
- public class IssueSummary: IIssueTreeNode
- {
- public static IssueSummary FromCodeIssue(ProjectFile file, BaseCodeIssueProvider provider, CodeIssue codeIssue)
- {
- var topLevelProvider = (provider as CodeIssueProvider) ?? provider.Parent;
- if (topLevelProvider == null)
- throw new ArgumentException ("must be a CodeIssueProvider or a BaseCodeIssueProvider with Parent != null", "provider");
- var issueSummary = new IssueSummary {
- IssueDescription = codeIssue.Description,
- Region = codeIssue.Region,
- ProviderTitle = topLevelProvider.Title,
- ProviderDescription = topLevelProvider.Description,
- ProviderCategory = topLevelProvider.Category,
- Severity = topLevelProvider.GetSeverity (),
- IssueMarker = codeIssue.IssueMarker,
- File = file,
- Project = file.Project,
- InspectorIdString = codeIssue.InspectorIdString
- };
- issueSummary.Actions = codeIssue.Actions.Select (a => new ActionSummary {
- Batchable = a.SupportsBatchRunning,
- SiblingKey = a.SiblingKey,
- Title = a.Title,
- Region = a.DocumentRegion,
- IssueSummary = issueSummary
- }).ToList ();
- return issueSummary;
- }
-
- #region IIssueTreeNode implementation
-
- string IIssueTreeNode.Text {
- get {
- string lineDescription;
- if (Region.BeginLine == Region.EndLine) {
- lineDescription = Region.BeginLine.ToString ();
- } else {
- lineDescription = string.Format ("{0}-{1}", Region.BeginLine, Region.EndLine);
- }
- var fileName = Path.GetFileName (File.Name);
- return string.Format ("{0} [{1}:{2}]", IssueDescription, fileName, lineDescription);
- }
- }
-
- static readonly ICollection<IIssueTreeNode> emptyCollection = new IIssueTreeNode[0];
-
- ICollection<IIssueTreeNode> IIssueTreeNode.Children {
- get {
- return emptyCollection;
- }
- }
-
- bool IIssueTreeNode.HasVisibleChildren {
- get {
- return false;
- }
- }
-
- bool visible = true;
- bool IIssueTreeNode.Visible {
- get {
- return visible;
- }
-
- set {
- if (visible != value) {
- visible = value;
- OnVisibleChanged (new IssueGroupEventArgs (this));
- }
- }
- }
-
- ICollection<IIssueTreeNode> IIssueTreeNode.AllChildren {
- get {
- return emptyCollection;
- }
- }
-
- event EventHandler<IssueGroupEventArgs> visibleChanged;
- event EventHandler<IssueGroupEventArgs> IIssueTreeNode.VisibleChanged {
- add {
- visibleChanged += value;
- }
- remove {
- visibleChanged -= value;
- }
- }
-
- protected virtual void OnVisibleChanged (IssueGroupEventArgs eventArgs)
- {
- var handler = visibleChanged;
- if (handler != null) {
- handler (this, eventArgs);
- }
- }
-
- // no-op events, these never happen in this implementation
- event EventHandler<IssueGroupEventArgs> IIssueTreeNode.ChildrenInvalidated {
- add {
- }
- remove {
- }
- }
-
- event EventHandler<IssueTreeNodeEventArgs> IIssueTreeNode.ChildAdded {
- add {
- }
- remove {
- }
- }
-
- event EventHandler<IssueGroupEventArgs> IIssueTreeNode.TextChanged {
- add {
- }
- remove {
- }
- }
-
- #endregion
-
- /// <summary>
- /// The description of the issue.
- /// </summary>
- public string IssueDescription { get; set; }
-
- /// <summary>
- /// The region.
- /// </summary>
- public DomRegion Region { get; set; }
-
- /// <summary>
- /// Gets or sets the category of the issue provider.
- /// </summary>
- public string ProviderCategory { get; set; }
-
- /// <summary>
- /// Gets or sets the title of the issue provider.
- /// </summary>
- public string ProviderTitle { get; set; }
-
- /// <summary>
- /// Gets or sets the description of the issue provider.
- /// </summary>
- public string ProviderDescription { get; set; }
-
- /// <summary>
- /// Gets or sets the severity.
- /// </summary>
- public Severity Severity { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating how this issue should be marked inside the text editor.
- /// Note: There is only one code issue provider generated therfore providers need to be state less.
- /// </summary>
- public IssueMarker IssueMarker { get; set; }
-
- /// <summary>
- /// Gets or sets the file that this issue was found in.
- /// </summary>
- /// <value>The file.</value>
- public ProjectFile File { get; set; }
-
- /// <summary>
- /// Gets or sets the project this issue was found in.
- /// </summary>
- /// <value>The project.</value>
- public Project Project { get; set; }
-
- /// <summary>
- /// Gets or sets the type of the inspector that was the source of this issue.
- /// </summary>
- /// <value>The type of the inspector.</value>
- public string InspectorIdString { get; set; }
-
- IList<ActionSummary> actions;
-
- /// <summary>
- /// Gets or sets the actions available to fix this issue.
- /// </summary>
- /// <value>The actions.</value>
- public IList<ActionSummary> Actions {
- get {
- if (actions == null) {
- Actions = new List<ActionSummary> ();
- }
- return actions;
- }
- set {
- if (value == null)
- throw new ArgumentNullException ("value");
- actions = value;
- }
- }
-
- public override string ToString ()
- {
- return string.Format ("[IssueSummary: ProviderTitle={2}, Region={0}, ProviderCategory={1}]", Region, ProviderCategory, ProviderTitle);
- }
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/AbstractGroupingProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/AbstractGroupingProvider.cs
index 3f7cd390c7..3f7cd390c7 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/AbstractGroupingProvider.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/AbstractGroupingProvider.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/ActionSummary.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/ActionSummary.cs
new file mode 100644
index 0000000000..7a560e69fd
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/ActionSummary.cs
@@ -0,0 +1,65 @@
+//
+// IGroupingProvider.cs
+//
+// Author:
+// Simon Lindgren <simon.n.lindgren@gmail.com>
+//
+// Copyright (c) 2013 Simon Lindgren
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using MonoDevelop.Ide.Editor;
+
+namespace MonoDevelop.CodeIssues
+{
+ public class ActionSummary
+ {
+ /// <summary>
+ /// Gets or sets the title.
+ /// </summary>
+ /// <value>The title.</value>
+ public string Title { get; set; }
+
+ /// <summary>
+ /// Gets or sets the sibling key.
+ /// </summary>
+ /// <value>The sibling key.</value>
+ public object SiblingKey { get; set; }
+
+ /// <summary>
+ /// Gets a value indicating whether this <see cref="MonoDevelop.CodeIssues.ActionSummary"/> is batchable.
+ /// </summary>
+ /// <value><c>true</c> if batchable; otherwise, <c>false</c>.</value>
+ public bool Batchable { get; set; }
+
+ public DocumentRegion Region { get; set; }
+
+ /// <summary>
+ /// Gets or sets the <see cref="IssueSummary"/> representing the source of this action.
+ /// </summary>
+ /// <value>The issue summary.</value>
+ public IssueSummary IssueSummary { get; set; }
+
+ public override string ToString ()
+ {
+ return string.Format ("[ActionSummary: Title={0}, Batchable={1}, Region={2}]", Title, Batchable, Region);
+ }
+ }
+
+}
+
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/AnalysisState.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/AnalysisState.cs
index 221e11d819..221e11d819 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/AnalysisState.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/AnalysisState.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/AnalysisStateChangeEventArgs.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/AnalysisStateChangeEventArgs.cs
index 7531189f08..7531189f08 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/AnalysisStateChangeEventArgs.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/AnalysisStateChangeEventArgs.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/BatchFixer.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/BatchFixer.cs
new file mode 100644
index 0000000000..c4c6491f05
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/BatchFixer.cs
@@ -0,0 +1,141 @@
+//
+// BatchFixer.cs
+//
+// Author:
+// Simon Lindgren <simon.n.lindgren@gmail.com>
+//
+// Copyright (c) 2013 Simon Lindgren
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using MonoDevelop.Ide;
+using ICSharpCode.NRefactory.CSharp.Resolver;
+using MonoDevelop.Core;
+using System.Threading.Tasks;
+using MonoDevelop.Refactoring;
+using ICSharpCode.NRefactory.Refactoring;
+using System.Threading;
+using MonoDevelop.Projects;
+using MonoDevelop.Ide.TypeSystem;
+using ICSharpCode.NRefactory.CSharp;
+using System.Text;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
+
+namespace MonoDevelop.CodeIssues
+{
+ public class BatchFixer
+ {
+ readonly IActionMatcher matcher;
+
+ readonly ProgressMonitor monitor;
+
+ public BatchFixer (IActionMatcher matcher, ProgressMonitor monitor)
+ {
+ this.matcher = matcher;
+ this.monitor = monitor;
+ }
+
+ /// <summary>
+ /// Tries to apply the actions passed in <paramref name="actions"/>.
+ /// </summary>
+ /// <param name="actions">The actions to apply.</param>
+ /// <returns>The fixed code actions.</returns>
+ public IEnumerable<ActionSummary> TryFixIssues (IEnumerable<ActionSummary> actions)
+ {
+ if (actions == null)
+ throw new ArgumentNullException ("actions");
+
+ // enumerate once
+ var actionSummaries = actions as IList<ActionSummary> ?? actions.ToList ();
+ var issueSummaries = actionSummaries.Select (action => action.IssueSummary).ToList ();
+ var files = issueSummaries.Select (issue => issue.File).Distinct ().ToList ();
+ monitor.BeginTask ("Applying fixes", files.Count);
+
+ var appliedActions = new List<ActionSummary> (issueSummaries.Count);
+ Parallel.ForEach (files, file => {
+ monitor.Step (1);
+
+ var fileSummaries = issueSummaries.Where (summary => summary.File == file);
+ var inspectorIds = new HashSet<string> (fileSummaries.Select (summary => summary.InspectorIdString));
+
+ bool isOpen;
+ var data = TextFileProvider.Instance.GetTextEditorData (file.FilePath, out isOpen);
+ IRefactoringContext refactoringContext;
+ var realActions = GetIssues (data, file, inspectorIds, out refactoringContext).SelectMany (issue => issue.Actions).ToList ();
+ if (realActions.Count == 0 || refactoringContext == null)
+ return;
+
+ var fileActionSummaries = actionSummaries.Where (summary => summary.IssueSummary.File == file).ToList ();
+ var matches = matcher.Match (fileActionSummaries, realActions).ToList ();
+
+ var appliedFixes = RefactoringService.ApplyFixes (matches.Select (match => match.Action), refactoringContext);
+ appliedActions.AddRange (matches.Where (match => appliedFixes.Contains (match.Action)).Select (match => match.Summary));
+
+ if (!isOpen) {
+ // If the file is open we leave it to the user to explicitly save the file
+ data.Save ();
+ }
+ });
+ return appliedActions;
+ }
+
+ static IList<CodeIssue> GetIssues (ITextDocument data, ProjectFile file, ISet<string> inspectorIds, out IRefactoringContext refactoringContext)
+ {
+ var issues = new List<CodeIssue> ();
+//
+// var document = TypeSystemService.ParseFile (file.Project, data);
+// if (document == null) {
+ refactoringContext = null;
+// return issues;
+// }
+//
+// var content = TypeSystemService.GetProjectContext (file.Project);
+// var compilation = content.AddOrUpdateFiles (document.ParsedFile).CreateCompilation ();
+// var resolver = new CSharpAstResolver (compilation, document.GetAst<SyntaxTree> (), document.ParsedFile as ICSharpCode.NRefactory.CSharp.TypeSystem.CSharpUnresolvedFile);
+//
+// refactoringContext = document.CreateRefactoringContextWithEditor (data, resolver, CancellationToken.None);
+// var context = refactoringContext;
+// foreach (var provider in GetInspectors (data, inspectorIds)) {
+// var severity = provider.GetSeverity ();
+// if (severity == Severity.None || !provider.GetIsEnabled ())
+// continue;
+// try {
+// lock (issues) {
+// issues.AddRange (provider.GetIssues (context, CancellationToken.None));
+// }
+// } catch (Exception ex) {
+// LoggingService.LogError ("Error while running code issue on: " + data.FileName, ex);
+// }
+// }
+ return issues;
+ }
+
+ static IList<CodeIssueProvider> GetInspectors (IReadonlyTextDocument editor, ICollection<string> inspectorIds)
+ {
+ var inspectors = RefactoringService.GetInspectors (editor.MimeType).ToList ();
+ return inspectors
+ .Where (inspector => inspectorIds.Contains (inspector.IdString))
+ .ToList ();
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CategoryGroupingProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/CategoryGroupingProvider.cs
index bb7094f20d..bb7094f20d 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CategoryGroupingProvider.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/CategoryGroupingProvider.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/CodeAnalysisBatchRunner.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/CodeAnalysisBatchRunner.cs
new file mode 100644
index 0000000000..8306a6ab3c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/CodeAnalysisBatchRunner.cs
@@ -0,0 +1,162 @@
+//
+// CodeIssueBatchRunner.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+// Simon Lindgren <simon.n.lindgren@gmail.com>
+//
+// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
+// Copyright (c) 2013 Simon Lindgren
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using System.Threading;
+using MonoDevelop.Ide;
+using MonoDevelop.Projects;
+using MonoDevelop.Ide.TypeSystem;
+using System.Threading.Tasks;
+using System.IO;
+using ICSharpCode.NRefactory.CSharp.Resolver;
+using ICSharpCode.NRefactory.CSharp;
+using ICSharpCode.NRefactory.Refactoring;
+using MonoDevelop.Core;
+using System.Collections.Concurrent;
+using ICSharpCode.NRefactory.TypeSystem;
+using MonoDevelop.Core.Instrumentation;
+using MonoDevelop.Refactoring;
+using System.Collections.Generic;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.CodeIssues
+{
+ public class CodeAnalysisBatchRunner
+ {
+ private readonly object _lock = new object ();
+
+ private int workerCount;
+
+ private readonly AnalysisJobQueue jobQueue = new AnalysisJobQueue ();
+
+ public IJobContext QueueJob (IAnalysisJob job)
+ {
+ jobQueue.Add (job);
+ EnsureRunning ();
+ return new JobContext (job, jobQueue, this);
+ }
+
+ private void EnsureRunning ()
+ {
+ for (; Interlocked.Add (ref workerCount, 1) < Environment.ProcessorCount;) {
+ new Thread (() => {
+ try {
+ ProcessQueue ();
+ }
+ finally {
+ Interlocked.Add (ref workerCount, -1);
+ }
+ }).Start ();
+ }
+ }
+
+ private void ProcessQueue ()
+ {
+ while (true) {
+ try {
+ using (var slice = GetSlice ()) {
+ if (slice == null)
+ // TODO: Do something smarter if the queue is empty
+ return;
+ AnalyzeFile (slice, slice.GetJobs ().SelectMany (job => job.GetIssueProviders (slice.File)));
+ }
+ } catch (Exception e) {
+ LoggingService.LogError ("Unhandled exception", e);
+ }
+ }
+ }
+
+ private JobSlice GetSlice ()
+ {
+ lock (_lock) {
+ return jobQueue.Dequeue (1).FirstOrDefault ();
+ }
+ }
+
+ void AnalyzeFile (JobSlice item, IEnumerable<BaseCodeIssueProvider> codeIssueProviders)
+ {
+// var file = item.File;
+//
+// if (file.BuildAction != BuildAction.Compile)
+// return;
+//
+// if (!(file.Project is DotNetProject))
+// return;
+//
+// TextEditorData editor;
+// try {
+// editor = TextFileProvider.Instance.GetReadOnlyTextEditorData (file.FilePath);
+// } catch (FileNotFoundException) {
+// // Swallow exception and ignore this file
+// return;
+// }
+// var document = TypeSystemService.ParseFile (file.Project, editor);
+// if (document == null)
+// return;
+//
+// var content = TypeSystemService.GetProjectContext (file.Project);
+// var compilation = content.AddOrUpdateFiles (document.ParsedFile).CreateCompilation ();
+//
+// CSharpAstResolver resolver;
+// using (var timer = ExtensionMethods.ResolveCounter.BeginTiming ()) {
+// resolver = new CSharpAstResolver (compilation, document.GetAst<SyntaxTree> (), document.ParsedFile as ICSharpCode.NRefactory.CSharp.TypeSystem.CSharpUnresolvedFile);
+// try {
+// resolver.ApplyNavigator (new ExtensionMethods.ConstantModeResolveVisitorNavigator (ResolveVisitorNavigationMode.Resolve, null));
+// } catch (Exception e) {
+// LoggingService.LogError ("Error while applying navigator", e);
+// }
+// }
+// var context = document.CreateRefactoringContextWithEditor (editor, resolver, CancellationToken.None);
+//
+// foreach (var provider in codeIssueProviders) {
+// if (item.CancellationToken.IsCancellationRequested)
+// break;
+// IList<IAnalysisJob> jobs;
+// lock (_lock)
+// jobs = item.GetJobs ().ToList ();
+// var jobsForProvider = jobs.Where (j => j.GetIssueProviders (file).Contains (provider)).ToList();
+// try {
+// var issues = provider.GetIssues (context, CancellationToken.None).ToList ();
+// foreach (var job in jobsForProvider) {
+// // Call AddResult even if issues.Count == 0, to enable a job implementation to keep
+// // track of progress information.
+// job.AddResult (file, provider, issues);
+// }
+// } catch (OperationCanceledException) {
+// // The operation was cancelled, no-op as the user-visible parts are
+// // handled elsewhere
+// } catch (Exception e) {
+// foreach (var job in jobsForProvider) {
+// job.AddError (file, provider);
+// }
+// }
+// }
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePad.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/CodeIssuePad.cs
index c875894512..c875894512 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/CodeIssuePad.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/CodeIssuePad.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ExactIssueMatcher.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/ExactIssueMatcher.cs
index 3f1db8df72..3f1db8df72 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ExactIssueMatcher.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/ExactIssueMatcher.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/FileGroupingProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/FileGroupingProvider.cs
new file mode 100644
index 0000000000..aa1d64d7cf
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/FileGroupingProvider.cs
@@ -0,0 +1,46 @@
+//
+// FileGroupingProvider.cs
+//
+// Author:
+// Marius Ungureanu <marius.ungureanu@xamarin.com>
+//
+// Copyright (c) 2013 Marius Ungureanu
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using MonoDevelop.Projects;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.CodeIssues
+{
+ [GroupingDescription("File")]
+ public class FileGroupingProvider : AbstractGroupingProvider<ProjectFile>
+ {
+ #region implemented abstract members of AbstractGroupingProvider
+ protected override ProjectFile GetGroupingKey (IssueSummary issue)
+ {
+ return issue.File;
+ }
+ protected override string GetGroupName (IssueSummary issue)
+ {
+ return issue.File.FilePath.ToRelative (issue.Project.BaseDirectory);
+ }
+ #endregion
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/GroupingDescriptionAttribute.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/GroupingDescriptionAttribute.cs
index 720084149e..720084149e 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/GroupingDescriptionAttribute.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/GroupingDescriptionAttribute.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/GroupingProviderChainControl.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/GroupingProviderChainControl.cs
index 3449d7b24b..3449d7b24b 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/GroupingProviderChainControl.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/GroupingProviderChainControl.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/GroupingProviderEventArgs.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/GroupingProviderEventArgs.cs
index f9eee0fc87..f9eee0fc87 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/GroupingProviderEventArgs.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/GroupingProviderEventArgs.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IActionMatcher.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IActionMatcher.cs
index 8e732f596a..8e732f596a 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IActionMatcher.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IActionMatcher.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IGroupingProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IGroupingProvider.cs
index 19b0001bf4..19b0001bf4 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IGroupingProvider.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IGroupingProvider.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IIssueSummarySink.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IIssueSummarySink.cs
index af1cb51c0c..af1cb51c0c 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IIssueSummarySink.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IIssueSummarySink.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IIssueTreeNode.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IIssueTreeNode.cs
index 68cf43ef50..68cf43ef50 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IIssueTreeNode.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IIssueTreeNode.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IssueGroup.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IssueGroup.cs
index 10e261b7fc..10e261b7fc 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IssueGroup.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IssueGroup.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IssueGroupEventArgs.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IssueGroupEventArgs.cs
index 42787d4560..42787d4560 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IssueGroupEventArgs.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IssueGroupEventArgs.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IssueMatch.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IssueMatch.cs
index fbdaafcd57..fbdaafcd57 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IssueMatch.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IssueMatch.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IssueSummary.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IssueSummary.cs
new file mode 100644
index 0000000000..5e7c4d201c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IssueSummary.cs
@@ -0,0 +1,236 @@
+//
+// IGroupingProvider.cs
+//
+// Author:
+// Simon Lindgren <simon.n.lindgren@gmail.com>
+//
+// Copyright (c) 2013 Simon Lindgren
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using ICSharpCode.NRefactory.TypeSystem;
+using ICSharpCode.NRefactory.Refactoring;
+using MonoDevelop.Projects;
+using System.Collections.Generic;
+using System.IO;
+using System;
+using System.Linq;
+
+namespace MonoDevelop.CodeIssues
+{
+ public class IssueSummary: IIssueTreeNode
+ {
+ public static IssueSummary FromCodeIssue(ProjectFile file, BaseCodeIssueProvider provider, CodeIssue codeIssue)
+ {
+ var topLevelProvider = (provider as CodeIssueProvider) ?? provider.Parent;
+ if (topLevelProvider == null)
+ throw new ArgumentException ("must be a CodeIssueProvider or a BaseCodeIssueProvider with Parent != null", "provider");
+ var issueSummary = new IssueSummary {
+ IssueDescription = codeIssue.Description,
+ Region = codeIssue.Region,
+ ProviderTitle = topLevelProvider.Title,
+ ProviderDescription = topLevelProvider.Description,
+ ProviderCategory = topLevelProvider.Category,
+ Severity = topLevelProvider.GetSeverity (),
+ IssueMarker = codeIssue.IssueMarker,
+ File = file,
+ Project = file.Project,
+ InspectorIdString = codeIssue.InspectorIdString
+ };
+ issueSummary.Actions = codeIssue.Actions.Select (a => new ActionSummary {
+// Batchable = a.SupportsBatchRunning,
+// SiblingKey = a.SiblingKey,
+// Title = a.,
+// Region = a.DocumentRegion,
+ IssueSummary = issueSummary
+ }).ToList ();
+ return issueSummary;
+ }
+
+ #region IIssueTreeNode implementation
+
+ string IIssueTreeNode.Text {
+ get {
+ string lineDescription;
+ if (Region.BeginLine == Region.EndLine) {
+ lineDescription = Region.BeginLine.ToString ();
+ } else {
+ lineDescription = string.Format ("{0}-{1}", Region.BeginLine, Region.EndLine);
+ }
+ var fileName = Path.GetFileName (File.Name);
+ return string.Format ("{0} [{1}:{2}]", IssueDescription, fileName, lineDescription);
+ }
+ }
+
+ static readonly ICollection<IIssueTreeNode> emptyCollection = new IIssueTreeNode[0];
+
+ ICollection<IIssueTreeNode> IIssueTreeNode.Children {
+ get {
+ return emptyCollection;
+ }
+ }
+
+ bool IIssueTreeNode.HasVisibleChildren {
+ get {
+ return false;
+ }
+ }
+
+ bool visible = true;
+ bool IIssueTreeNode.Visible {
+ get {
+ return visible;
+ }
+
+ set {
+ if (visible != value) {
+ visible = value;
+ OnVisibleChanged (new IssueGroupEventArgs (this));
+ }
+ }
+ }
+
+ ICollection<IIssueTreeNode> IIssueTreeNode.AllChildren {
+ get {
+ return emptyCollection;
+ }
+ }
+
+ event EventHandler<IssueGroupEventArgs> visibleChanged;
+ event EventHandler<IssueGroupEventArgs> IIssueTreeNode.VisibleChanged {
+ add {
+ visibleChanged += value;
+ }
+ remove {
+ visibleChanged -= value;
+ }
+ }
+
+ protected virtual void OnVisibleChanged (IssueGroupEventArgs eventArgs)
+ {
+ var handler = visibleChanged;
+ if (handler != null) {
+ handler (this, eventArgs);
+ }
+ }
+
+ // no-op events, these never happen in this implementation
+ event EventHandler<IssueGroupEventArgs> IIssueTreeNode.ChildrenInvalidated {
+ add {
+ }
+ remove {
+ }
+ }
+
+ event EventHandler<IssueTreeNodeEventArgs> IIssueTreeNode.ChildAdded {
+ add {
+ }
+ remove {
+ }
+ }
+
+ event EventHandler<IssueGroupEventArgs> IIssueTreeNode.TextChanged {
+ add {
+ }
+ remove {
+ }
+ }
+
+ #endregion
+
+ /// <summary>
+ /// The description of the issue.
+ /// </summary>
+ public string IssueDescription { get; set; }
+
+ /// <summary>
+ /// The region.
+ /// </summary>
+ public DomRegion Region { get; set; }
+
+ /// <summary>
+ /// Gets or sets the category of the issue provider.
+ /// </summary>
+ public string ProviderCategory { get; set; }
+
+ /// <summary>
+ /// Gets or sets the title of the issue provider.
+ /// </summary>
+ public string ProviderTitle { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description of the issue provider.
+ /// </summary>
+ public string ProviderDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets the severity.
+ /// </summary>
+ public Severity Severity { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating how this issue should be marked inside the text editor.
+ /// Note: There is only one code issue provider generated therfore providers need to be state less.
+ /// </summary>
+ public IssueMarker IssueMarker { get; set; }
+
+ /// <summary>
+ /// Gets or sets the file that this issue was found in.
+ /// </summary>
+ /// <value>The file.</value>
+ public ProjectFile File { get; set; }
+
+ /// <summary>
+ /// Gets or sets the project this issue was found in.
+ /// </summary>
+ /// <value>The project.</value>
+ public Project Project { get; set; }
+
+ /// <summary>
+ /// Gets or sets the type of the inspector that was the source of this issue.
+ /// </summary>
+ /// <value>The type of the inspector.</value>
+ public string InspectorIdString { get; set; }
+
+ IList<ActionSummary> actions;
+
+ /// <summary>
+ /// Gets or sets the actions available to fix this issue.
+ /// </summary>
+ /// <value>The actions.</value>
+ public IList<ActionSummary> Actions {
+ get {
+ if (actions == null) {
+ Actions = new List<ActionSummary> ();
+ }
+ return actions;
+ }
+ set {
+ if (value == null)
+ throw new ArgumentNullException ("value");
+ actions = value;
+ }
+ }
+
+ public override string ToString ()
+ {
+ return string.Format ("[IssueSummary: ProviderTitle={2}, Region={0}, ProviderCategory={1}]", Region, ProviderCategory, ProviderTitle);
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IssueTreeNodeEventArgs.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IssueTreeNodeEventArgs.cs
index 37d663f252..37d663f252 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/IssueTreeNodeEventArgs.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/IssueTreeNodeEventArgs.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/NullGroupingProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/NullGroupingProvider.cs
index 677d9989c6..677d9989c6 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/NullGroupingProvider.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/NullGroupingProvider.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ProjectGroupingProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/ProjectGroupingProvider.cs
index 7ca19ba063..7ca19ba063 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ProjectGroupingProvider.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/ProjectGroupingProvider.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ProviderGroupingProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/ProviderGroupingProvider.cs
index 7cdf46e461..7cdf46e461 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/ProviderGroupingProvider.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/ProviderGroupingProvider.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/AnalysisJobQueue.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/AnalysisJobQueue.cs
index cdb3182fbb..cdb3182fbb 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/AnalysisJobQueue.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/AnalysisJobQueue.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/CodeIssueEventArgs.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/CodeIssueEventArgs.cs
index 53e3a29f8b..53e3a29f8b 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/CodeIssueEventArgs.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/CodeIssueEventArgs.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/IAnalysisJob.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/IAnalysisJob.cs
index 0ab2553b4f..0ab2553b4f 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/IAnalysisJob.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/IAnalysisJob.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/IJobContext.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/IJobContext.cs
index 4027081b81..4027081b81 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/IJobContext.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/IJobContext.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/JobContext.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/JobContext.cs
index e15c83c88e..e15c83c88e 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/JobContext.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/JobContext.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/JobSlice.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/JobSlice.cs
index 7802e21ada..7802e21ada 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/JobSlice.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/JobSlice.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/JobStatus.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/JobStatus.cs
index 02ca3eb1fd..02ca3eb1fd 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/JobStatus.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/JobStatus.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/ProgressMonitorWrapperJob.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/ProgressMonitorWrapperJob.cs
new file mode 100644
index 0000000000..b1eea307cf
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/ProgressMonitorWrapperJob.cs
@@ -0,0 +1,126 @@
+//
+// ProgressReportingWrapperJob.cs
+//
+// Author:
+// Simon Lindgren <simon.n.lindgren@gmail.com>
+//
+// Copyright (c) 2013 Simon Lindgren
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System.Linq;
+using MonoDevelop.Ide;
+using MonoDevelop.Core;
+using MonoDevelop.Projects;
+using System.Collections.Generic;
+using System;
+
+namespace MonoDevelop.CodeIssues
+{
+ public class ProgressMonitorWrapperJob : IAnalysisJob
+ {
+ readonly IAnalysisJob wrappedJob;
+
+ ProgressMonitor monitor;
+
+ int reportingThinningFactor = 100;
+
+ int completedWork;
+
+ public ProgressMonitorWrapperJob (IAnalysisJob wrappedJob, string message)
+ {
+ this.wrappedJob = wrappedJob;
+ monitor = IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor (message, null, false);
+ var work = wrappedJob.GetFiles ().Sum (f => wrappedJob.GetIssueProviders (f).Count ());
+
+ monitor.BeginTask (message, work);
+ }
+
+ #region IAnalysisJob implementation
+
+ public event EventHandler<CodeIssueEventArgs> CodeIssueAdded {
+ add {
+ wrappedJob.CodeIssueAdded += value;
+ }
+ remove {
+ wrappedJob.CodeIssueAdded -= value;
+ }
+ }
+
+ public IEnumerable<ProjectFile> GetFiles ()
+ {
+ return wrappedJob.GetFiles ();
+ }
+
+ public IEnumerable<BaseCodeIssueProvider> GetIssueProviders (ProjectFile file)
+ {
+ return wrappedJob.GetIssueProviders (file);
+ }
+
+ public void AddResult (ProjectFile file, BaseCodeIssueProvider provider, IEnumerable<CodeIssue> issues)
+ {
+ Step ();
+ wrappedJob.AddResult (file, provider, issues);
+ }
+
+ public void AddError (ProjectFile file, BaseCodeIssueProvider provider)
+ {
+ Step ();
+ wrappedJob.AddError (file, provider);
+ }
+
+ public event EventHandler<EventArgs> Completed {
+ add {
+ wrappedJob.Completed += value;
+ }
+ remove {
+ wrappedJob.Completed -= value;
+ }
+ }
+
+ public void SetCompleted ()
+ {
+ StopReporting ();
+ wrappedJob.SetCompleted ();
+ }
+
+ void Step ()
+ {
+ completedWork++;
+ if (monitor != null && completedWork % reportingThinningFactor == 0) {
+ monitor.Step (reportingThinningFactor);
+ }
+ }
+
+ void StopReporting ()
+ {
+ if (monitor != null) {
+ monitor.Dispose ();
+ monitor = null;
+ }
+ }
+
+ public void NotifyCancelled ()
+ {
+ StopReporting ();
+ }
+
+ #endregion
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/SimpleAnalysisJob.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/SimpleAnalysisJob.cs
index 15878be01b..15878be01b 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/SimpleAnalysisJob.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/Runner/SimpleAnalysisJob.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/SeverityGroupingProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/SeverityGroupingProvider.cs
index dc129bb35e..dc129bb35e 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/SeverityGroupingProvider.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/SeverityGroupingProvider.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/SolutionAnalysisJob.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/SolutionAnalysisJob.cs
index 785c037dcd..785c037dcd 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/SolutionAnalysisJob.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Pad/SolutionAnalysisJob.cs
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/ProgressMonitorWrapperJob.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/ProgressMonitorWrapperJob.cs
deleted file mode 100644
index 6557a3c04e..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeIssues/Runner/ProgressMonitorWrapperJob.cs
+++ /dev/null
@@ -1,126 +0,0 @@
-//
-// ProgressReportingWrapperJob.cs
-//
-// Author:
-// Simon Lindgren <simon.n.lindgren@gmail.com>
-//
-// Copyright (c) 2013 Simon Lindgren
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System.Linq;
-using MonoDevelop.Ide;
-using MonoDevelop.Core;
-using MonoDevelop.Projects;
-using System.Collections.Generic;
-using System;
-
-namespace MonoDevelop.CodeIssues
-{
- public class ProgressMonitorWrapperJob : IAnalysisJob
- {
- readonly IAnalysisJob wrappedJob;
-
- IProgressMonitor monitor;
-
- int reportingThinningFactor = 100;
-
- int completedWork;
-
- public ProgressMonitorWrapperJob (IAnalysisJob wrappedJob, string message)
- {
- this.wrappedJob = wrappedJob;
- monitor = IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor (message, null, false);
- var work = wrappedJob.GetFiles ().Sum (f => wrappedJob.GetIssueProviders (f).Count ());
-
- monitor.BeginTask (message, work);
- }
-
- #region IAnalysisJob implementation
-
- public event EventHandler<CodeIssueEventArgs> CodeIssueAdded {
- add {
- wrappedJob.CodeIssueAdded += value;
- }
- remove {
- wrappedJob.CodeIssueAdded -= value;
- }
- }
-
- public IEnumerable<ProjectFile> GetFiles ()
- {
- return wrappedJob.GetFiles ();
- }
-
- public IEnumerable<BaseCodeIssueProvider> GetIssueProviders (ProjectFile file)
- {
- return wrappedJob.GetIssueProviders (file);
- }
-
- public void AddResult (ProjectFile file, BaseCodeIssueProvider provider, IEnumerable<CodeIssue> issues)
- {
- Step ();
- wrappedJob.AddResult (file, provider, issues);
- }
-
- public void AddError (ProjectFile file, BaseCodeIssueProvider provider)
- {
- Step ();
- wrappedJob.AddError (file, provider);
- }
-
- public event EventHandler<EventArgs> Completed {
- add {
- wrappedJob.Completed += value;
- }
- remove {
- wrappedJob.Completed -= value;
- }
- }
-
- public void SetCompleted ()
- {
- StopReporting ();
- wrappedJob.SetCompleted ();
- }
-
- void Step ()
- {
- completedWork++;
- if (monitor != null && completedWork % reportingThinningFactor == 0) {
- monitor.Step (reportingThinningFactor);
- }
- }
-
- void StopReporting ()
- {
- if (monitor != null) {
- monitor.Dispose ();
- monitor = null;
- }
- }
-
- public void NotifyCancelled ()
- {
- StopReporting ();
- }
-
- #endregion
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameHandler.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameHandler.cs
deleted file mode 100644
index 1b965f684d..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameHandler.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// RenameHandler.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Content;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-
-namespace MonoDevelop.Refactoring.Rename
-{
- public class RenameHandler : AbstractRefactoringCommandHandler
- {
- protected override void Update (RefactoringOptions options, CommandInfo info)
- {
- var renameRefactoring = new RenameRefactoring ();
- if (!renameRefactoring.IsValid (options))
- info.Bypass = true;
- }
-
- protected override void Run (RefactoringOptions options)
- {
- var renameRefactoring = new RenameRefactoring ();
- if (renameRefactoring.IsValid (options))
- renameRefactoring.Run (options);
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameItemDialog.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameItemDialog.cs
index 69852183a5..6682c5ab01 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameItemDialog.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameItemDialog.cs
@@ -32,110 +32,105 @@ using MonoDevelop.Core;
using System.Collections.Generic;
using MonoDevelop.Ide;
using MonoDevelop.Ide.ProgressMonitoring;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-using ICSharpCode.NRefactory.TypeSystem;
using System.Linq;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis;
+using System.Threading.Tasks;
namespace MonoDevelop.Refactoring.Rename
{
public partial class RenameItemDialog : Gtk.Dialog
{
- RenameRefactoring rename;
- RefactoringOptions options;
-
- public RenameItemDialog (RefactoringOptions options, RenameRefactoring rename)
+ Func<RenameRefactoring.RenameProperties, Task<IList<Change>>> rename;
+
+ public RenameItemDialog (string title, string currentName, Func<RenameRefactoring.RenameProperties, Task<IList<Change>>> renameOperation)
{
- this.options = options;
- this.rename = rename;
- if (options.SelectedItem is IMethod && ((IMethod)options.SelectedItem).IsConstructor) {
- options.SelectedItem = ((IMethod)options.SelectedItem).DeclaringType;
- }
this.Build ();
- includeOverloadsCheckbox.Active = true;
- includeOverloadsCheckbox.Visible = false;
- if (options.SelectedItem is IType) {
+ Init (title, currentName, renameOperation);
+ }
- var t = (IType)options.SelectedItem;
- if (t.Kind == TypeKind.TypeParameter) {
- this.Title = GettextCatalog.GetString ("Rename Type Parameter");
+ public RenameItemDialog (ISymbol symbol, RenameRefactoring rename)
+ {
+ this.Build ();
+
+ string title;
+ if (symbol is ITypeSymbol) {
+
+ var t = (ITypeSymbol)symbol;
+ if (t.TypeKind == TypeKind.TypeParameter) {
+ title = GettextCatalog.GetString ("Rename Type Parameter");
entry.Text = t.Name;
} else {
- var typeDefinition = (t).GetDefinition ();
- if (typeDefinition.DeclaringType == null) {
+ var typeDefinition = t;
+ if (typeDefinition.ContainingType == null) {
// not supported for inner types
this.renameFileFlag.Visible = true;
- this.renameFileFlag.Active = options.Document != null ? options.Document.FileName.FileNameWithoutExtension.Contains (typeDefinition.Name) : false;
+ this.renameFileFlag.Active = t.Locations.First ().SourceTree.FilePath.Contains (typeDefinition.Name);
} else {
this.renameFileFlag.Active = false;
}
- if (typeDefinition.Kind == TypeKind.Interface)
- this.Title = GettextCatalog.GetString ("Rename Interface");
+ if (typeDefinition.TypeKind == TypeKind.Interface)
+ title = GettextCatalog.GetString ("Rename Interface");
+ else if (typeDefinition.TypeKind == TypeKind.Delegate)
+ title = GettextCatalog.GetString ("Rename Delegate");
+ else if (typeDefinition.TypeKind == TypeKind.Enum)
+ title = GettextCatalog.GetString ("Rename Enum");
+ else if (typeDefinition.TypeKind == TypeKind.Struct)
+ title = GettextCatalog.GetString ("Rename Struct");
else
- this.Title = GettextCatalog.GetString ("Rename Class");
+ title = GettextCatalog.GetString ("Rename Class");
}
// this.fileName = type.GetDefinition ().Region.FileName;
- } else if (options.SelectedItem is IField) {
- this.Title = GettextCatalog.GetString ("Rename Field");
- } else if (options.SelectedItem is IProperty) {
- if (((IProperty)options.SelectedItem).IsIndexer) {
- this.Title = GettextCatalog.GetString ("Rename Indexer");
+ } else if (symbol.Kind == SymbolKind.Field) {
+ title = GettextCatalog.GetString ("Rename Field");
+ } else if (symbol.Kind == SymbolKind.Property) {
+ title = GettextCatalog.GetString ("Rename Property");
+ } else if (symbol.Kind == SymbolKind.Event) {
+ title = GettextCatalog.GetString ("Rename Event");
+ } else if (symbol.Kind == SymbolKind.Method) {
+ var m = (IMethodSymbol)symbol;
+ if (m.MethodKind == MethodKind.Constructor ||
+ m.MethodKind == MethodKind.StaticConstructor ||
+ m.MethodKind == MethodKind.Destructor) {
+ title = GettextCatalog.GetString ("Rename Class");
} else {
- this.Title = GettextCatalog.GetString ("Rename Property");
+ title = GettextCatalog.GetString ("Rename Method");
+ includeOverloadsCheckbox.Visible = m.ContainingType.GetMembers (m.Name).Length > 1;
}
- } else if (options.SelectedItem is IEvent) {
- this.Title = GettextCatalog.GetString ("Rename Event");
- } else if (options.SelectedItem is IMethod) {
- var m = (IMethod)options.SelectedItem;
- if (m.IsConstructor || m.IsDestructor) {
- this.Title = GettextCatalog.GetString ("Rename Class");
- } else {
- this.Title = GettextCatalog.GetString ("Rename Method");
- includeOverloadsCheckbox.Visible = m.DeclaringType.GetMethods (x => x.Name == m.Name).Count () > 1;
- }
- } else if (options.SelectedItem is IParameter) {
- this.Title = GettextCatalog.GetString ("Rename Parameter");
- } else if (options.SelectedItem is IVariable) {
- this.Title = GettextCatalog.GetString ("Rename Variable");
- } else if (options.SelectedItem is ITypeParameter) {
- this.Title = GettextCatalog.GetString ("Rename Type Parameter");
- } else if (options.SelectedItem is INamespace) {
- this.Title = GettextCatalog.GetString ("Rename namespace");
+ } else if (symbol.Kind == SymbolKind.Parameter) {
+ title = GettextCatalog.GetString ("Rename Parameter");
+ } else if (symbol.Kind == SymbolKind.Local) {
+ title = GettextCatalog.GetString ("Rename Variable");
+ } else if (symbol.Kind == SymbolKind.TypeParameter) {
+ title = GettextCatalog.GetString ("Rename Type Parameter");
+ } else if (symbol.Kind == SymbolKind.Namespace) {
+ title = GettextCatalog.GetString ("Rename Namespace");
+ } else if (symbol.Kind == SymbolKind.Label) {
+ title = GettextCatalog.GetString ("Rename Label");
} else {
- this.Title = GettextCatalog.GetString ("Rename Item");
- }
-
- if (options.SelectedItem is IEntity) {
- var member = (IEntity)options.SelectedItem;
- if (member.SymbolKind == SymbolKind.Constructor || member.SymbolKind == SymbolKind.Destructor) {
- entry.Text = member.DeclaringType.Name;
- } else {
- entry.Text = member.Name;
- }
- // fileName = member.Region.FileName;
- } else if (options.SelectedItem is IType) {
- var lvar = (IType)options.SelectedItem;
- entry.Text = lvar.Name;
- // this.fileName = lvar.Region.FileName;
- } else if (options.SelectedItem is ITypeParameter) {
- var lvar = (ITypeParameter)options.SelectedItem;
- entry.Text = lvar.Name;
- // this.fileName = lvar.Region.FileName;
- } else if (options.SelectedItem is IVariable) {
- var lvar = (IVariable)options.SelectedItem;
- entry.Text = lvar.Name;
- // this.fileName = lvar.Region.FileName;
- } else if (options.SelectedItem is INamespace) {
- var lvar = (INamespace)options.SelectedItem;
- entry.Text = lvar.FullName;
- // this.fileName = lvar.Region.FileName;
+ title = GettextCatalog.GetString ("Rename Item");
}
+
+
+ Init (title, symbol.Name, async prop => { return await rename.PerformChangesAsync (symbol, prop); });
+
+ }
+
+ void Init (string title, string currenName, Func<RenameRefactoring.RenameProperties, Task<IList<Change>>> rename)
+ {
+ this.Title = title;
+ this.rename = rename;
+
+ includeOverloadsCheckbox.Active = true;
+ includeOverloadsCheckbox.Visible = false;
+ entry.Text = currenName;
entry.SelectRegion (0, -1);
-
+
buttonPreview.Sensitive = buttonOk.Sensitive = false;
entry.Changed += OnEntryChanged;
entry.Activated += OnEntryActivated;
-
+
buttonOk.Clicked += OnOKClicked;
buttonPreview.Clicked += OnPreviewClicked;
entry.Changed += delegate { buttonPreview.Sensitive = buttonOk.Sensitive = ValidateName (); };
@@ -143,6 +138,7 @@ namespace MonoDevelop.Refactoring.Rename
this.hbox1.HideAll ();
}
+
bool ValidateName ()
{
return true; // TODO: Name validation.
@@ -183,20 +179,20 @@ namespace MonoDevelop.Refactoring.Rename
}
}
- void OnOKClicked (object sender, EventArgs e)
+ async void OnOKClicked (object sender, EventArgs e)
{
var properties = Properties;
((Widget)this).Destroy ();
- List<Change> changes = rename.PerformChanges (options, properties);
- IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetBackgroundProgressMonitor (this.Title, null);
+ var changes = await this.rename (properties);
+ ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetBackgroundProgressMonitor (Title, null);
RefactoringService.AcceptChanges (monitor, changes);
}
- void OnPreviewClicked (object sender, EventArgs e)
+ async void OnPreviewClicked (object sender, EventArgs e)
{
var properties = Properties;
((Widget)this).Destroy ();
- List<Change> changes = rename.PerformChanges (options, properties);
+ var changes = await this.rename (properties);
using (var dlg = new RefactoringPreviewDialog (changes))
MessageService.ShowCustomDialog (dlg);
}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameRefactoring.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameRefactoring.cs
index bedc666cc3..44eb9d4af7 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameRefactoring.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameRefactoring.cs
@@ -27,226 +27,112 @@
using System;
using System.Collections.Generic;
using MonoDevelop.Core;
-using Mono.TextEditor;
using System.Text;
using MonoDevelop.Ide;
using System.Linq;
-using Mono.TextEditor.PopupWindow;
using MonoDevelop.Ide.FindInFiles;
using MonoDevelop.Ide.ProgressMonitoring;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem.Implementation;
using MonoDevelop.Core.ProgressMonitoring;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis.FindSymbols;
+using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Ide.Gui;
-
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Editor;
+using Microsoft.CodeAnalysis.Rename;
+using System.Threading.Tasks;
+using System.Threading;
namespace MonoDevelop.Refactoring.Rename
{
- public class RenameRefactoring : RefactoringOperation
+ public class RenameRefactoring
{
- public override string AccelKey {
- get {
- var key = IdeApp.CommandService.GetCommandInfo (MonoDevelop.Ide.Commands.EditCommands.Rename).AccelKey;
- return key == null ? null : key.Replace ("dead_circumflex", "^");
- }
- }
-
- public RenameRefactoring ()
- {
- Name = "Rename";
- }
-
- public override bool IsValid (RefactoringOptions options)
+ public static async Task<bool> Rename (ISymbol symbol, string newName)
{
- if (options.SelectedItem is IVariable || options.SelectedItem is IParameter)
+ if (symbol == null)
+ throw new ArgumentNullException ("symbol");
+ if (newName == null)
+ throw new ArgumentNullException ("newName");
+ try {
+ await new RenameRefactoring ().PerformChangesAsync (symbol, new RenameProperties () { NewName = newName });
return true;
- if (options.SelectedItem is INamespace) {
- var ns = (INamespace)options.SelectedItem;
- return ns.Types.Any (type => !string.IsNullOrEmpty (type.Region.FileName));
+ } catch (AggregateException ae) {
+ foreach (var inner in ae.Flatten ().InnerExceptions)
+ LoggingService.LogError ("Exception while rename.", inner);
+ return false;
+ } catch (Exception e) {
+ LoggingService.LogError ("Exception while rename.", e);
+ return false;
}
- if (options.SelectedItem is ITypeDefinition)
- return !string.IsNullOrEmpty (((ITypeDefinition)options.SelectedItem).Region.FileName);
- if (options.SelectedItem is IType && ((IType)options.SelectedItem).Kind == TypeKind.TypeParameter)
- return !string.IsNullOrEmpty (((ITypeParameter)options.SelectedItem).Region.FileName);
-
- var member = options.SelectedItem as IMember;
- if (member != null) {
- if (member.SymbolKind == SymbolKind.Operator)
- return false;
- var cls = member.DeclaringTypeDefinition;
- return cls != null;
- }
- return false;
}
- public static void Rename (IEntity entity, string newName)
+ static void Rollback (TextEditor editor, List<MonoDevelop.Core.Text.TextChangeEventArgs> textChanges)
{
- if (newName == null) {
- var options = new RefactoringOptions () {
- SelectedItem = entity
- };
- new RenameRefactoring ().Run (options);
- return;
- }
- using (var monitor = new NullProgressMonitor ()) {
- var col = ReferenceFinder.FindReferences (entity, true, monitor);
-
- List<Change> result = new List<Change> ();
- foreach (var memberRef in col) {
- var change = new TextReplaceChange ();
- change.FileName = memberRef.FileName;
- change.Offset = memberRef.Offset;
- change.RemovedChars = memberRef.Length;
- change.InsertedText = newName;
- change.Description = string.Format (GettextCatalog.GetString ("Replace '{0}' with '{1}'"), memberRef.GetName (), newName);
- result.Add (change);
- }
- if (result.Count > 0) {
- RefactoringService.AcceptChanges (monitor, result);
- }
+ for (int i = textChanges.Count - 1; i >= 0; i--) {
+ var v = textChanges [i];
+ editor.ReplaceText (v.Offset, v.InsertionLength, v.RemovedText);
}
}
- public static void RenameVariable (IVariable variable, string newName)
+ public async Task Rename (ISymbol symbol)
{
- using (var monitor = new NullProgressMonitor ()) {
- var col = ReferenceFinder.FindReferences (variable, true, monitor);
-
- List<Change> result = new List<Change> ();
- foreach (var memberRef in col) {
- var change = new TextReplaceChange ();
- change.FileName = memberRef.FileName;
- change.Offset = memberRef.Offset;
- change.RemovedChars = memberRef.Length;
- change.InsertedText = newName;
- change.Description = string.Format (GettextCatalog.GetString ("Replace '{0}' with '{1}'"), memberRef.GetName (), newName);
- result.Add (change);
- }
- if (result.Count > 0) {
- RefactoringService.AcceptChanges (monitor, result);
+ var solution = IdeApp.ProjectOperations.CurrentSelectedSolution;
+ var ws = TypeSystemService.GetWorkspace (solution);
+
+ var currentSolution = ws.CurrentSolution;
+ var cts = new CancellationTokenSource ();
+ var newSolution = await MessageService.ExecuteTaskAndShowWaitDialog (Task.Run (() => Renamer.RenameSymbolAsync (currentSolution, symbol, "_" + symbol.Name + "_", ws.Options, cts.Token)), GettextCatalog.GetString ("Looking for all references"), cts);
+ var projectChanges = currentSolution.GetChanges (newSolution).GetProjectChanges ().ToList ();
+ var changedDocuments = new HashSet<string> ();
+ foreach (var change in projectChanges) {
+ foreach (var changedDoc in change.GetChangedDocuments ()) {
+ changedDocuments.Add (ws.CurrentSolution.GetDocument (changedDoc).FilePath);
}
}
- }
- public static void RenameTypeParameter (ITypeParameter typeParameter, string newName)
- {
- if (newName == null) {
- var options = new RefactoringOptions () {
- SelectedItem = typeParameter
- };
- new RenameRefactoring ().Run (options);
+ if (changedDocuments.Count > 1) {
+ using (var dlg = new RenameItemDialog (symbol, this))
+ MessageService.ShowCustomDialog (dlg);
return;
}
- using (var monitor = new NullProgressMonitor ()) {
- var col = ReferenceFinder.FindReferences (typeParameter, true, monitor);
-
- List<Change> result = new List<Change> ();
- foreach (var memberRef in col) {
- var change = new TextReplaceChange ();
- change.FileName = memberRef.FileName;
- change.Offset = memberRef.Offset;
- change.RemovedChars = memberRef.Length;
- change.InsertedText = newName;
- change.Description = string.Format (GettextCatalog.GetString ("Replace '{0}' with '{1}'"), memberRef.GetName (), newName);
- result.Add (change);
- }
- if (result.Count > 0) {
- RefactoringService.AcceptChanges (monitor, result);
- }
+ var projectChange = projectChanges [0];
+ var changes = projectChange.GetChangedDocuments ().ToList ();
+ if (changes.Count != 1 || symbol.Kind == SymbolKind.NamedType) {
+ using (var dlg = new RenameItemDialog (symbol, this))
+ MessageService.ShowCustomDialog (dlg);
+ return;
}
- }
-
- public static void RenameNamespace (INamespace ns, string newName)
- {
- using (var monitor = new NullProgressMonitor ()) {
- var col = ReferenceFinder.FindReferences (ns, true, monitor);
+ var doc = IdeApp.Workbench.ActiveDocument;
+ var editor = doc.Editor;
+
+ var links = new List<TextLink> ();
+ var link = new TextLink ("name");
- List<Change> result = new List<Change> ();
- foreach (var memberRef in col) {
- var change = new TextReplaceChange ();
- change.FileName = memberRef.FileName;
- change.Offset = memberRef.Offset;
- change.RemovedChars = memberRef.Length;
- change.InsertedText = newName;
- change.Description = string.Format (GettextCatalog.GetString ("Replace '{0}' with '{1}'"), memberRef.GetName (), newName);
- result.Add (change);
- }
- if (result.Count > 0) {
- RefactoringService.AcceptChanges (monitor, result);
+ var cd = changes [0];
+ var oldDoc = projectChange.OldProject.GetDocument (cd);
+ var newDoc = projectChange.NewProject.GetDocument (cd);
+ var oldVersion = editor.Version;
+ foreach (var textChange in await oldDoc.GetTextChangesAsync (newDoc)) {
+ var segment = new TextSegment (textChange.Span.Start, textChange.Span.Length);
+ if (segment.Offset <= editor.CaretOffset && editor.CaretOffset <= segment.EndOffset) {
+ link.Links.Insert (0, segment);
+ } else {
+ link.AddLink (segment);
}
}
- }
-
- public override string GetMenuDescription (RefactoringOptions options)
- {
- return IdeApp.CommandService.GetCommandInfo (MonoDevelop.Ide.Commands.EditCommands.Rename).Text;
- }
-
- public override void Run (RefactoringOptions options)
- {
- if (options.SelectedItem is IVariable) {
- var field = options.SelectedItem as IField;
- if (field != null && (field.Accessibility != Accessibility.Private || field.DeclaringTypeDefinition != null && field.DeclaringTypeDefinition.Parts.Count > 1)) {
- using (var dlg = new RenameItemDialog (options, this))
- MessageService.ShowCustomDialog (dlg);
- return;
- }
-
- var par = options.SelectedItem as IParameter;
- if (par != null && par.Owner != null && (par.Owner.Accessibility != Accessibility.Private || par.Owner.DeclaringTypeDefinition != null && par.Owner.DeclaringTypeDefinition.Parts.Count > 1)) {
- using (var dlg = new RenameItemDialog (options, this))
- MessageService.ShowCustomDialog (dlg);
- return;
- }
-
- var col = ReferenceFinder.FindReferences (options.SelectedItem, true);
- if (col == null)
- return;
- var data = options.Document != null ? options.GetTextEditorData () : IdeApp.Workbench.ActiveDocument.Editor;
- var editor = data.Parent;
- if (editor == null) {
- using (var dlg = new RenameItemDialog (options, this))
- MessageService.ShowCustomDialog (dlg);
- return;
- }
-
- var links = new List<TextLink> ();
- var link = new TextLink ("name");
- int baseOffset = Int32.MaxValue;
- foreach (var r in col) {
- baseOffset = Math.Min (baseOffset, r.Offset);
- }
- foreach (MemberReference r in col) {
- var segment = new TextSegment (r.Offset - baseOffset, r.Length);
- if (segment.Offset <= data.Caret.Offset - baseOffset && data.Caret.Offset - baseOffset <= segment.EndOffset) {
- link.Links.Insert (0, segment);
- } else {
- link.AddLink (segment);
+ links.Add (link);
+ editor.StartTextLinkMode (new TextLinkModeOptions (links, (arg) => {
+ //If user cancel renaming revert changes
+ if (!arg.Success) {
+ var textChanges = editor.Version.GetChangesTo (oldVersion).ToList ();
+ foreach (var v in textChanges) {
+ editor.ReplaceText (v.Offset, v.RemovalLength, v.InsertedText);
}
}
-
- links.Add (link);
- if (editor.CurrentMode is TextLinkEditMode)
- ((TextLinkEditMode)editor.CurrentMode).ExitTextLinkMode ();
- TextLinkEditMode tle = new TextLinkEditMode (editor, baseOffset, links);
- tle.SetCaretPosition = false;
- tle.SelectPrimaryLink = true;
- if (tle.ShouldStartTextLinkMode) {
- tle.Cancel += delegate {
- if (tle.HasChangedText)
- editor.Document.Undo ();
- };
- tle.OldMode = data.CurrentMode;
- tle.StartMode ();
- data.CurrentMode = tle;
- }
- } else {
- using (var dlg = new RenameItemDialog (options, this))
- MessageService.ShowCustomDialog (dlg);
- }
+ }));
}
public class RenameProperties
@@ -267,64 +153,68 @@ namespace MonoDevelop.Refactoring.Rename
}
}
- public override List<Change> PerformChanges (RefactoringOptions options, object prop)
+ public async Task<List<Change>> PerformChangesAsync (ISymbol symbol, RenameProperties properties)
{
- RenameProperties properties = (RenameProperties)prop;
- List<Change> result = new List<Change> ();
- IEnumerable<MemberReference> col = null;
- using (var monitor = new MessageDialogProgressMonitor (true, false, false, true)) {
- col = ReferenceFinder.FindReferences (options.SelectedItem, properties.IncludeOverloads, monitor);
- if (col == null)
- return result;
-
- if (properties.RenameFile && options.SelectedItem is IType) {
- var cls = ((IType)options.SelectedItem).GetDefinition ();
- int currentPart = 1;
- var alreadyRenamed = new HashSet<string> ();
- foreach (var part in cls.Parts) {
- if (alreadyRenamed.Contains (part.Region.FileName))
- continue;
- alreadyRenamed.Add (part.Region.FileName);
-
- string oldFileName = System.IO.Path.GetFileNameWithoutExtension (part.Region.FileName);
- string newFileName;
- var newName = properties.NewName;
- if (string.IsNullOrEmpty (oldFileName) || string.IsNullOrEmpty (newName))
- continue;
- if (oldFileName.ToUpper () == newName.ToUpper () || oldFileName.ToUpper ().EndsWith ("." + newName.ToUpper (), StringComparison.Ordinal))
- continue;
- int idx = oldFileName.IndexOf (cls.Name, StringComparison.Ordinal);
- if (idx >= 0) {
- newFileName = oldFileName.Substring (0, idx) + newName + oldFileName.Substring (idx + cls.Name.Length);
- } else {
- newFileName = currentPart != 1 ? newName + currentPart : newName;
- currentPart++;
- }
-
- int t = 0;
- while (System.IO.File.Exists (GetFullFileName (newFileName, part.Region.FileName, t))) {
- t++;
- }
- result.Add (new RenameFileChange (part.Region.FileName, GetFullFileName (newFileName, part.Region.FileName, t)));
+ var solution = IdeApp.ProjectOperations.CurrentSelectedSolution;
+ var ws = TypeSystemService.GetWorkspace (solution);
+
+ var newSolution = await Renamer.RenameSymbolAsync (ws.CurrentSolution, symbol, properties.NewName, ws.Options);
+ var changes = new List<Change> ();
+
+ foreach (var projectChange in newSolution.GetChanges (ws.CurrentSolution).GetProjectChanges ()) {
+ foreach (var changedDoc in projectChange.GetChangedDocuments ()) {
+ var newDoc = newSolution.GetDocument (changedDoc);
+ foreach (var textChange in await newDoc.GetTextChangesAsync (ws.CurrentSolution.GetDocument (changedDoc))) {
+ changes.Add (new TextReplaceChange () {
+ FileName = newDoc.FilePath,
+ Offset = textChange.Span.Start,
+ RemovedChars = textChange.Span.Length,
+ InsertedText = textChange.NewText
+ });
}
}
-
- foreach (var memberRef in col) {
- TextReplaceChange change = new TextReplaceChange ();
- change.FileName = memberRef.FileName;
- change.Offset = memberRef.Offset;
- change.RemovedChars = memberRef.Length;
- change.InsertedText = properties.NewName;
- change.Description = string.Format (GettextCatalog.GetString ("Replace '{0}' with '{1}'"), memberRef.GetName (), properties.NewName);
- result.Add (change);
+ }
+
+ if (properties.RenameFile && symbol is INamedTypeSymbol) {
+ var type = (INamedTypeSymbol)symbol;
+ int currentPart = 1;
+ var alreadyRenamed = new HashSet<string> ();
+ foreach (var part in type.Locations) {
+ if (!part.IsInSource)
+ continue;
+ var fileName = part?.SourceTree?.FilePath;
+ if (fileName == null || alreadyRenamed.Contains (fileName))
+ continue;
+ alreadyRenamed.Add (fileName);
+
+ string oldFileName = System.IO.Path.GetFileNameWithoutExtension (fileName);
+ string newFileName;
+ var newName = properties.NewName;
+ if (string.IsNullOrEmpty (oldFileName) || string.IsNullOrEmpty (newName))
+ continue;
+ if (oldFileName.ToUpper () == newName.ToUpper () || oldFileName.ToUpper ().EndsWith ("." + newName.ToUpper (), StringComparison.Ordinal))
+ continue;
+ int idx = oldFileName.IndexOf (type.Name, StringComparison.Ordinal);
+ if (idx >= 0) {
+ newFileName = oldFileName.Substring (0, idx) + newName + oldFileName.Substring (idx + type.Name.Length);
+ } else {
+ newFileName = currentPart != 1 ? newName + currentPart : newName;
+ currentPart++;
+ }
+
+ int t = 0;
+ while (System.IO.File.Exists (GetFullFileName (newFileName, fileName, t))) {
+ t++;
+ }
+ changes.Add (new RenameFileChange (fileName, GetFullFileName (newFileName, fileName, t)));
}
}
- return result;
+ return changes;
}
static string GetFullFileName (string fileName, string oldFullFileName, int tryCount)
{
- StringBuilder name = new StringBuilder (fileName);
+ var name = new StringBuilder (fileName);
if (tryCount > 0) {
name.Append ("_");
name.Append (tryCount.ToString ());
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameTextEditorExtension.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameTextEditorExtension.cs
deleted file mode 100644
index c2e6e44360..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameTextEditorExtension.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// RenameTextEditorExtension.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using MonoDevelop.Ide.Commands;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.Ide.Gui.Content;
-using MonoDevelop.Ide;
-
-namespace MonoDevelop.Refactoring.Rename
-{
- public class RenameTextEditorExtension : TextEditorExtension
- {
- [CommandUpdateHandler(EditCommands.Rename)]
- public void RenameCommand_Update(CommandInfo ci)
- {
- new RenameHandler ().UpdateCommandInfo (ci);
- }
-
- [CommandHandler (EditCommands.Rename)]
- public void RenameCommand ()
- {
- new RenameHandler ().Start (base.Editor);
- }
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml
index ed0ba0695c..80dfdf8a69 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml
@@ -8,25 +8,21 @@
<ExtensionPoint path = "/MonoDevelop/Refactoring/CodeGenerators" name = "Code Generators">
<ExtensionNode name="Class"/>
</ExtensionPoint>
-
+
<ExtensionPoint path = "/MonoDevelop/Refactoring/ASTProvider" name = "ASTProviders">
<ExtensionNode name="Class"/>
</ExtensionPoint>
-
- <ExtensionPoint path = "/MonoDevelop/Refactoring/CodeActions" name = "CodeAction">
- <ExtensionNode name="Action" type ="MonoDevelop.CodeActions.CodeActionAddinNode"/>
- </ExtensionPoint>
-
- <ExtensionPoint path = "/MonoDevelop/Refactoring/CodeActionSource" name = "CodeActionSource">
- <ExtensionNode name="Source"/>
+
+ <ExtensionPoint path = "/MonoDevelop/Refactoring/CodeDiagnosticProvider" name = "Code Diagnostic Provider">
+ <ExtensionNode name="Class"/>
</ExtensionPoint>
-
- <ExtensionPoint path = "/MonoDevelop/Refactoring/CodeIssues" name = "CodeIssue">
- <ExtensionNode name="CodeIssue" type ="MonoDevelop.CodeIssues.CodeIssueAddinNode"/>
+
+ <ExtensionPoint path = "/MonoDevelop/Refactoring/FindReferencesProvider">
+ <ExtensionNode name="Class"/>
</ExtensionPoint>
-
- <ExtensionPoint path = "/MonoDevelop/Refactoring/CodeIssueSource" name = "CodeIssueSource">
- <ExtensionNode name="Source"/>
+
+ <ExtensionPoint path = "/MonoDevelop/Refactoring/JumpToDeclarationHandler" defaultInsertAfter = "MidStep">
+ <ExtensionNode name="Class"/>
</ExtensionPoint>
<ExtensionNodeSet id="MonoDevelop.AnalysisCore.Rules">
@@ -41,7 +37,7 @@
<Description>Analysis rules.</Description>
<ExtensionNodeSet id="MonoDevelop.AnalysisCore.Rules" />
</ExtensionPoint>
-
+
<ExtensionPoint path = "/MonoDevelop/AnalysisCore/Types" name = "Analysis rule input/output types">
<Description>Analysis rule input/output types.</Description>
<ExtensionNode name="Type" type="MonoDevelop.AnalysisCore.Extensions.AnalysisTypeExtensionNode" />
@@ -70,44 +66,26 @@
<!-- RefactoryCommands -->
<Extension path = "/MonoDevelop/Ide/Commands">
-
+
<Category _name = "Code Navigation" id = "CodeNavigation">
- <Command id = "MonoDevelop.Refactoring.RefactoryCommands.GotoDeclaration"
- defaultHandler = "MonoDevelop.Refactoring.GotoDeclarationHandler"
- _label = "_Go to Declaration"
- shortcut = "F12"
- macShortcut = "Meta|D"/>
<Command id = "MonoDevelop.Refactoring.RefactoryCommands.FindReferences"
- defaultHandler = "MonoDevelop.Refactoring.FindReferencesHandler"
_label = "_Find References"
shortcut = "Shift|F12"
macShortcut = "Shift|Meta|R"/>
<Command id = "MonoDevelop.Refactoring.RefactoryCommands.FindAllReferences"
- defaultHandler = "MonoDevelop.Refactoring.FindAllReferencesHandler"
_label = "_Find References of All Overloads" />
<Command id = "MonoDevelop.Refactoring.RefactoryCommands.FindDerivedClasses"
- defaultHandler = "MonoDevelop.Refactoring.FindDerivedClassesHandler"
_label = "Find _Derived Symbols" />
</Category>
<Category _name = "Refactoring" id = "Refactoring">
- <Command id = "MonoDevelop.Refactoring.RefactoryCommands.Resolve"
- defaultHandler = "MonoDevelop.Refactoring.ResolveCommandHandler"
- type="array"
- _label = "Resolve"/>
- <Command id = "MonoDevelop.Refactoring.RefactoryCommands.CurrentRefactoryOperations"
- defaultHandler = "MonoDevelop.Refactoring.CurrentRefactoryOperationsHandler"
- type="array"
- _label = "Refactory Operations" />
-
<Command id = "MonoDevelop.Refactoring.RefactoryCommands.QuickFix"
_label = "Quick Fix..."
shortcut = "Alt|Return"
macShortcut = "Alt|Return" />
<Command id = "MonoDevelop.Refactoring.RefactoryCommands.ImportSymbol"
- defaultHandler = "MonoDevelop.Refactoring.ImportSymbolHandler"
_label = "Import Symbol..."
shortcut = "Control|Alt|space"
macShortcut = "Control|Alt|space" />
@@ -120,20 +98,7 @@
</Category>
</Extension>
- <Extension path = "/MonoDevelop/SourceEditor2/ContextMenu/Editor">
- <CommandItem id = "MonoDevelop.Refactoring.RefactoryCommands.Resolve" insertbefore="MonoDevelop.SourceEditor.SourceEditorCommands.MarkerOperations"/>
-
- <ItemSet id = "Fix" _label = "Fix" autohide="true"
- insertafter="MonoDevelop.SourceEditor.SourceEditorCommands.MarkerOperations" insertbefore="MonoDevelop.Debugger.DebugCommands.ExpressionEvaluator">
- <CommandItem id = "MonoDevelop.AnalysisCore.AnalysisCommands.FixOperations" />
- </ItemSet>
-
-
- <CommandItem id = "MonoDevelop.Refactoring.RefactoryCommands.CurrentRefactoryOperations" insertafter="MonoDevelop.SourceEditor.SourceEditorCommands.MarkerOperations" insertbefore="MonoDevelop.Debugger.DebugCommands.ExpressionEvaluator"/>
- </Extension>
-
<Extension path = "/MonoDevelop/Ide/TextEditorExtensions">
- <Class class = "MonoDevelop.Refactoring.Rename.RenameTextEditorExtension" />
<Class class = "MonoDevelop.CodeActions.CodeActionEditorExtension" />
</Extension>
@@ -145,9 +110,6 @@
<!-- Quick fix commands -->
<Extension path = "/MonoDevelop/Ide/Commands/Refactoring">
- <Command id = "MonoDevelop.AnalysisCore.AnalysisCommands.FixOperations" type="array"
- defaultHandler="MonoDevelop.AnalysisCore.FixOperationsHandler"
- _label = "Fixes" />
<Command id = "MonoDevelop.AnalysisCore.AnalysisCommands.ShowFixes"
defaultHandler="MonoDevelop.AnalysisCore.ShowFixesHandler"
_label = "Show Fixes"
@@ -160,7 +122,7 @@
<Extension path = "/MonoDevelop/Ide/GlobalOptionsDialog/TextEditor">
<Section id="Analysis" _label="Source Analysis" fill="true" class="MonoDevelop.AnalysisCore.Gui.AnalysisOptionsPanel" icon="md-prefs-code-analysis" >
- <Section id="C#" _label="C#" icon="md-prefs-csharp">
+ <Section id="C#" _label="C#" icon="md-prefs-source">
<Panel id="CodeIssuePanel" _label="Code Rules" fill="true" class="MonoDevelop.CodeIssues.CodeIssuePanel" grouping="Tab" icon="md-prefs-code-rules" />
<Panel id="CodeActions" _label="Code Actions" fill="true" class="MonoDevelop.CodeActions.CodeActionPanel" grouping="Tab" icon="md-prefs-code-actions" />
</Section>
@@ -170,13 +132,13 @@
<!-- Extensions to the addin points defined by this addin -->
<Extension path = "/MonoDevelop/AnalysisCore/Types">
- <Type name="Document" class="MonoDevelop.Ide.Gui.Document" />
+ <Type name="AnalysisDocument" class="MonoDevelop.AnalysisCore.Gui.AnalysisDocument" />
<Type name="CompilationUnit" class="MonoDevelop.Projects.Dom.ICompilationUnit" />
</Extension>
<Extension path = "/MonoDevelop/AnalysisCore/Rules">
<Adaptor func="MonoDevelop.AnalysisCore.Rules.Adapters.GetCompilationUnit"
- input="Document" output="CompilationUnit" />
+ input="AnalysisDocument" output="CompilationUnit" />
<Category _name="Design Guidelines" id="Design">
<!-- <Rule _name="Naming Conventions" input="CompilationUnit"
func="MonoDevelop.AnalysisCore.Rules.NamingConventions.ClassNaming" />-->
@@ -193,4 +155,8 @@
<StockIcon stockid="md-prefs-code-rules" resource="prefs-code-rules-16.png" size="Menu" />
<StockIcon stockid="md-prefs-code-analysis" resource="prefs-code-analysis-16.png" size="Menu" />
</Extension>
+
+ <Extension path = "/MonoDevelop/Refactoring/JumpToDeclarationHandler">
+ <Class id="MidStep" class="MonoDevelop.Refactoring.DummyJumpToDeclarationHandler" />
+ </Extension>
</ExtensionModel>
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj
index 6fe3d47b41..36cac0ba56 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj
@@ -75,10 +75,43 @@
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
<Reference Include="Mono.Cairo" />
+ <Reference Include="System.ComponentModel.Composition" />
<Reference Include="Xamarin.Mac" Condition=" '$(Configuration)' == 'DebugMac' Or '$(Configuration)' == 'ReleaseMac' ">
<HintPath>..\..\..\external\Xamarin.Mac.dll</HintPath>
<Private>False</Private>
</Reference>
+ <Reference Include="System.Composition.AttributedModel">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Composition.AttributedModel.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Collections.Immutable">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Collections.Immutable.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.Workspaces">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.Workspaces.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.CSharp.Workspaces">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.CSharp.Workspaces.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.CSharp">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.CSharp.Features">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.CSharp.Features.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.Features">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.Features.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
@@ -96,86 +129,45 @@
<Compile Include="MonoDevelop.AnalysisCore\AnalysisOptions.cs" />
<Compile Include="MonoDevelop.AnalysisCore\AnalysisService.cs" />
<Compile Include="MonoDevelop.AnalysisCore\FixableResult.cs" />
- <Compile Include="MonoDevelop.AnalysisCore\Rules\Adaptors.cs" />
<Compile Include="MonoDevelop.AnalysisCore\Result.cs" />
<Compile Include="MonoDevelop.AnalysisCore\RuleTree.cs" />
<Compile Include="MonoDevelop.AnalysisCore\RuleTreeType.cs" />
<Compile Include="MonoDevelop.AnalysisCore\Fixes\GenericFix.cs" />
<Compile Include="MonoDevelop.Refactoring\RefactoringService.cs" />
- <Compile Include="MonoDevelop.Refactoring\RefactoryCommands.cs" />
- <Compile Include="MonoDevelop.Refactoring\RefactoringOperation.cs" />
<Compile Include="MonoDevelop.Refactoring\Change.cs" />
- <Compile Include="MonoDevelop.Refactoring\GotoDeclarationHandler.cs" />
- <Compile Include="MonoDevelop.Refactoring\FindReferencesHandler.cs" />
- <Compile Include="MonoDevelop.Refactoring.Rename\RenameTextEditorExtension.cs" />
<Compile Include="MonoDevelop.Refactoring.Rename\RenameRefactoring.cs" />
<Compile Include="MonoDevelop.Refactoring.Rename\RenameItemDialog.cs" />
- <Compile Include="MonoDevelop.Refactoring.Rename\RenameHandler.cs" />
<Compile Include="gtk-gui\MonoDevelop.Refactoring.Rename.RenameItemDialog.cs" />
- <Compile Include="MonoDevelop.Refactoring\AbstractRefactoringCommandHandler.cs" />
<Compile Include="MonoDevelop.Refactoring\RefactoringOptions.cs" />
<Compile Include="MonoDevelop.Refactoring\RefactoringPreviewDialog.cs" />
<Compile Include="gtk-gui\MonoDevelop.Refactoring.RefactoringPreviewDialog.cs" />
- <Compile Include="MonoDevelop.Refactoring\FindDerivedClassesHandler.cs" />
- <Compile Include="MonoDevelop.Refactoring\ImportSymbolHandler.cs" />
- <Compile Include="MonoDevelop.CodeIssues\CodeIssueProvider.cs" />
- <Compile Include="MonoDevelop.CodeIssues\CodeIssue.cs" />
<Compile Include="MonoDevelop.CodeActions\CodeActionEditorExtension.cs" />
- <Compile Include="MonoDevelop.CodeActions\CodeAction.cs" />
- <Compile Include="MonoDevelop.CodeActions\CodeActionProvider.cs" />
- <Compile Include="MonoDevelop.CodeActions\CodeActionAddinNode.cs" />
<Compile Include="MonoDevelop.CodeActions\CodeActionPanelWidget.cs" />
- <Compile Include="MonoDevelop.CodeActions\AnalysisCodeAction.cs" />
<Compile Include="gtk-gui\MonoDevelop.CodeActions.ContextActionPanelWidget.cs" />
<Compile Include="MonoDevelop.CodeIssues\CodeIssuePanelWidget.cs" />
<Compile Include="gtk-gui\MonoDevelop.CodeIssues.CodeIssuePanelWidget.cs" />
- <Compile Include="MonoDevelop.CodeActions\ICodeActionProviderSource.cs" />
- <Compile Include="MonoDevelop.CodeIssues\ICodeIssueProviderSource.cs" />
- <Compile Include="MonoDevelop.CodeIssues\CodeAnalysisRunner.cs" />
- <Compile Include="MonoDevelop.CodeIssues\DefaultCodeIssueCategories.cs" />
- <Compile Include="MonoDevelop.CodeIssues\CodeIssueAddinNode.cs" />
- <Compile Include="MonoDevelop.Refactoring\ResolveCommandHandler.cs" />
- <Compile Include="MonoDevelop.Refactoring\ExtensionMethods.cs" />
- <Compile Include="MonoDevelop.CodeIssues\CodeIssuePad.cs" />
- <Compile Include="MonoDevelop.CodeIssues\IGroupingProvider.cs" />
- <Compile Include="MonoDevelop.CodeIssues\IssueSummary.cs" />
- <Compile Include="MonoDevelop.CodeIssues\IssueGroup.cs" />
- <Compile Include="MonoDevelop.CodeIssues\CategoryGroupingProvider.cs" />
- <Compile Include="MonoDevelop.CodeIssues\GroupingProviderChainControl.cs" />
- <Compile Include="MonoDevelop.CodeIssues\GroupingDescriptionAttribute.cs" />
- <Compile Include="MonoDevelop.CodeIssues\NullGroupingProvider.cs" />
- <Compile Include="MonoDevelop.CodeIssues\IssueGroupEventArgs.cs" />
- <Compile Include="MonoDevelop.CodeIssues\GroupingProviderEventArgs.cs" />
- <Compile Include="MonoDevelop.CodeIssues\AbstractGroupingProvider.cs" />
- <Compile Include="MonoDevelop.CodeIssues\ProviderGroupingProvider.cs" />
- <Compile Include="MonoDevelop.CodeIssues\SeverityGroupingProvider.cs" />
- <Compile Include="MonoDevelop.CodeIssues\AnalysisState.cs" />
- <Compile Include="MonoDevelop.CodeIssues\AnalysisStateChangeEventArgs.cs" />
- <Compile Include="MonoDevelop.CodeIssues\CodeAnalysisBatchRunner.cs" />
- <Compile Include="MonoDevelop.CodeIssues\IIssueTreeNode.cs" />
- <Compile Include="MonoDevelop.CodeIssues\IIssueSummarySink.cs" />
- <Compile Include="MonoDevelop.CodeIssues\IssueTreeNodeEventArgs.cs" />
- <Compile Include="MonoDevelop.CodeIssues\ActionSummary.cs" />
- <Compile Include="MonoDevelop.CodeIssues\BatchFixer.cs" />
- <Compile Include="MonoDevelop.CodeIssues\IssueMatch.cs" />
- <Compile Include="MonoDevelop.CodeIssues\ExactIssueMatcher.cs" />
- <Compile Include="MonoDevelop.CodeIssues\IActionMatcher.cs" />
<Compile Include="AddinInfo.cs" />
- <Compile Include="MonoDevelop.Refactoring\FindDerivedSymbolsHandler.cs" />
- <Compile Include="MonoDevelop.Refactoring\FindMemberOverloadsHandler.cs" />
- <Compile Include="MonoDevelop.Refactoring\FindExtensionMethodHandler.cs" />
- <Compile Include="MonoDevelop.CodeIssues\Runner\IAnalysisJob.cs" />
- <Compile Include="MonoDevelop.CodeIssues\Runner\AnalysisJobQueue.cs" />
- <Compile Include="MonoDevelop.CodeIssues\Runner\CodeIssueEventArgs.cs" />
- <Compile Include="MonoDevelop.CodeIssues\SolutionAnalysisJob.cs" />
- <Compile Include="MonoDevelop.CodeIssues\Runner\SimpleAnalysisJob.cs" />
- <Compile Include="MonoDevelop.CodeIssues\Runner\ProgressMonitorWrapperJob.cs" />
- <Compile Include="MonoDevelop.CodeIssues\Runner\JobContext.cs" />
- <Compile Include="MonoDevelop.CodeIssues\Runner\IJobContext.cs" />
- <Compile Include="MonoDevelop.CodeIssues\Runner\JobSlice.cs" />
- <Compile Include="MonoDevelop.CodeIssues\Runner\JobStatus.cs" />
- <Compile Include="MonoDevelop.CodeIssues\ProjectGroupingProvider.cs" />
- <Compile Include="MonoDevelop.CodeIssues\FileGroupingProvider.cs" />
+ <Compile Include="MonoDevelop.CodeIssues\DiagnosticResult.cs" />
+ <Compile Include="MonoDevelop.CodeActions\CodeRefactoringDescriptor.cs" />
+ <Compile Include="MonoDevelop.CodeActions\CodeRefactoringService.cs" />
+ <Compile Include="MonoDevelop.CodeIssues\CodeDiagnosticDescriptor.cs" />
+ <Compile Include="MonoDevelop.CodeIssues\CodeDiagnosticRunner.cs" />
+ <Compile Include="MonoDevelop.CodeActions\CodeActionContainer.cs" />
+ <Compile Include="MonoDevelop.AnalysisCore\IssueMarker.cs" />
+ <Compile Include="MonoDevelop.CodeIssues\CodeDiagnosticProvider.cs" />
+ <Compile Include="MonoDevelop.CodeIssues\BuiltInCodeDiagnosticProvider.cs" />
+ <Compile Include="MonoDevelop.CodeIssues\AnalyzersFromAssembly.cs" />
+ <Compile Include="MonoDevelop.CodeActions\ValidCodeAction.cs" />
+ <Compile Include="MonoDevelop.CodeActions\ValidCodeDiagnosticAction.cs" />
+ <Compile Include="MonoDevelop.CodeIssues\CodeDiagnosticFixDescriptor.cs" />
+ <Compile Include="MonoDevelop.Refactoring\Commands.cs" />
+ <Compile Include="MonoDevelop.Refactoring\RefactoringSymbolInfo.cs" />
+ <Compile Include="MonoDevelop.CodeIssues\ISuppressionFixProvider.cs" />
+ <Compile Include="MonoDevelop.CodeIssues\CodeFix.cs" />
+ <Compile Include="MonoDevelop.CodeIssues\CSharpSuppressionFixProvider.cs" />
+ <Compile Include="MonoDevelop.Refactoring\FindReferencesProvider.cs" />
+ <Compile Include="MonoDevelop.Refactoring\JumpToDeclarationHandler.cs" />
+ <Compile Include="MonoDevelop.Refactoring\InsertionPointService.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="MonoDevelop.Refactoring\" />
@@ -183,7 +175,8 @@
<Folder Include="MonoDevelop.AnalysisCore\" />
<Folder Include="MonoDevelop.CodeIssues\" />
<Folder Include="MonoDevelop.CodeActions\" />
- <Folder Include="MonoDevelop.CodeIssues\Runner\" />
+ <Folder Include="MonoDevelop.AnalysisCore\Rules\" />
+ <Folder Include="MonoDevelop.CodeIssues\Pad\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="MonoDevelop.Refactoring.addin.xml">
@@ -200,18 +193,72 @@
<EmbeddedResource Include="icons\prefs-code-actions-16%402x.png">
<LogicalName>prefs-code-actions-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-actions-16~dark.png">
+ <LogicalName>prefs-code-actions-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-actions-16~dark%402x.png">
+ <LogicalName>prefs-code-actions-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-actions-16~sel.png">
+ <LogicalName>prefs-code-actions-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-actions-16~sel%402x.png">
+ <LogicalName>prefs-code-actions-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-actions-16~dark~sel.png">
+ <LogicalName>prefs-code-actions-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-actions-16~dark~sel%402x.png">
+ <LogicalName>prefs-code-actions-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-code-rules-16.png">
<LogicalName>prefs-code-rules-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-code-rules-16%402x.png">
<LogicalName>prefs-code-rules-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-rules-16~dark.png">
+ <LogicalName>prefs-code-rules-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-rules-16~dark%402x.png">
+ <LogicalName>prefs-code-rules-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-rules-16~sel.png">
+ <LogicalName>prefs-code-rules-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-rules-16~sel%402x.png">
+ <LogicalName>prefs-code-rules-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-rules-16~dark~sel.png">
+ <LogicalName>prefs-code-rules-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-rules-16~dark~sel%402x.png">
+ <LogicalName>prefs-code-rules-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-code-analysis-16.png">
<LogicalName>prefs-code-analysis-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-code-analysis-16%402x.png">
<LogicalName>prefs-code-analysis-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-analysis-16~dark.png">
+ <LogicalName>prefs-code-analysis-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-analysis-16~dark%402x.png">
+ <LogicalName>prefs-code-analysis-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-analysis-16~sel.png">
+ <LogicalName>prefs-code-analysis-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-analysis-16~sel%402x.png">
+ <LogicalName>prefs-code-analysis-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-analysis-16~dark~sel.png">
+ <LogicalName>prefs-code-analysis-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-analysis-16~dark~sel%402x.png">
+ <LogicalName>prefs-code-analysis-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\core\MonoDevelop.Ide\MonoDevelop.Ide.csproj">
@@ -224,31 +271,11 @@
<Name>MonoDevelop.Core</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
- <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
- <Name>Mono.TextEditor</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\MonoDevelop.DesignerSupport\MonoDevelop.DesignerSupport.csproj">
<Project>{2C24D515-4A2C-445C-8419-C09231913CFA}</Project>
<Name>MonoDevelop.DesignerSupport</Name>
<Private>False</Private>
</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="..\..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
- <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
- <Name>ICSharpCode.NRefactory</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory.CSharp\ICSharpCode.NRefactory.CSharp.csproj">
- <Project>{53DCA265-3C3C-42F9-B647-F72BA678122B}</Project>
- <Name>ICSharpCode.NRefactory.CSharp</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\MonoDevelop.Debugger\MonoDevelop.Debugger.csproj">
<Project>{2357AABD-08C7-4808-A495-8FF2D3CDFDB0}</Project>
<Name>MonoDevelop.Debugger</Name>
@@ -269,15 +296,69 @@
<Name>Mono.Debugging</Name>
<Private>False</Private>
</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="..\..\..\external\RefactoringEssentials\RefactoringEssentials\RefactoringEssentials.csproj">
+ <Project>{C465A5DC-AD28-49A2-89C0-F81838814A7E}</Project>
+ <Name>RefactoringEssentials</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
+ <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
+ <Name>Mono.TextEditor</Name>
+ <Private>False</Private>
+ </ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<None Include="MonoDevelop.AnalysisCore\README.txt" />
<None Include="MonoDevelop.AnalysisCore\TODO.txt" />
<None Include="MonoDevelop.Refactoring\QuickFixHandler.cs" />
- <None Include="MonoDevelop.Refactoring\EncapsulateFieldDialog.cs" />
- <None Include="MonoDevelop.Refactoring\OverridesImplementsDialog.cs" />
<None Include="gtk-gui\MonoDevelop.Refactoring.OverridesImplementsDialog.cs" />
<None Include="gtk-gui\MonoDevelop.Refactoring.EncapsulateFieldDialog.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\Runner\AnalysisJobQueue.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\Runner\CodeIssueEventArgs.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\Runner\IAnalysisJob.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\Runner\IJobContext.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\Runner\JobContext.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\Runner\JobSlice.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\Runner\JobStatus.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\Runner\ProgressMonitorWrapperJob.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\Runner\SimpleAnalysisJob.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\CodeIssuePad.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\ExactIssueMatcher.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\IActionMatcher.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\IssueMatch.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\SolutionAnalysisJob.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\CodeAnalysisBatchRunner.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\BatchFixer.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\AbstractGroupingProvider.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\FileGroupingProvider.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\GroupingDescriptionAttribute.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\GroupingProviderChainControl.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\GroupingProviderEventArgs.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\IGroupingProvider.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\IIssueSummarySink.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\IIssueTreeNode.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\IssueGroup.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\IssueGroupEventArgs.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\IssueSummary.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\IssueTreeNodeEventArgs.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\NullGroupingProvider.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\ProjectGroupingProvider.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\ProviderGroupingProvider.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\SeverityGroupingProvider.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\ActionSummary.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\AnalysisState.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\AnalysisStateChangeEventArgs.cs" />
+ <None Include="MonoDevelop.CodeIssues\Pad\CategoryGroupingProvider.cs" />
</ItemGroup>
-</Project>
+
+ <Target Name="AfterBuild">
+ <Copy SourceFiles="..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.CSharp.Features.dll" DestinationFolder="..\..\..\build\bin" ContinueOnError="true" />
+ <Copy SourceFiles="..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.Features.dll" DestinationFolder="..\..\..\build\bin" ContinueOnError="true" />
+ </Target>
+ </Project>
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/AbstractRefactoringCommandHandler.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/AbstractRefactoringCommandHandler.cs
deleted file mode 100644
index cf29ac7626..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/AbstractRefactoringCommandHandler.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// AbstractRefactoringCommandHandler.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using MonoDevelop.Components.Commands;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Content;
-using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using ICSharpCode.NRefactory.Semantics;
-
-namespace MonoDevelop.Refactoring
-{
- public abstract class AbstractRefactoringCommandHandler : CommandHandler
- {
- protected abstract void Run (RefactoringOptions options);
-
- protected virtual void Update (RefactoringOptions options, CommandInfo info)
- {
- }
-
- public void UpdateCommandInfo (CommandInfo info)
- {
- Update (info);
- }
-
- public void Start (object data)
- {
- Run (data);
- }
-
- RefactoringOptions CreateOptions ()
- {
- Document doc = IdeApp.Workbench.ActiveDocument;
- if (doc == null)
- return null;
-
- ResolveResult result;
- var item = CurrentRefactoryOperationsHandler.GetItem (doc, out result);
-
- return new RefactoringOptions (doc) {
- ResolveResult = result,
- SelectedItem = item
- };
- }
-
- protected override void Update (CommandInfo info)
- {
- base.Update (info);
-
- var options = CreateOptions ();
- if (options != null) {
- Update (options, info);
- } else {
- info.Bypass = true;
- }
- }
-
- protected override void Run (object data)
- {
- var options = CreateOptions ();
- if (options != null)
- Run (options);
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/Change.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/Change.cs
index 0f3805e639..c43f81e299 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/Change.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/Change.cs
@@ -28,11 +28,10 @@ using System;
using System.IO;
using System.Collections.Generic;
using MonoDevelop.Core;
-using MonoDevelop.Projects.Text;
-using Mono.TextEditor;
using MonoDevelop.Projects;
using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
namespace MonoDevelop.Refactoring
{
@@ -47,7 +46,7 @@ namespace MonoDevelop.Refactoring
{
}
- public abstract void PerformChange (IProgressMonitor monitor, RefactoringOptions rctx);
+ public abstract void PerformChange (ProgressMonitor monitor, RefactoringOptions rctx);
}
public class TextReplaceChange : Change
@@ -84,26 +83,23 @@ namespace MonoDevelop.Refactoring
set;
}
- static List<TextEditorData> textEditorDatas = new List<TextEditorData> ();
+ static List<TextEditor> textEditorDatas = new List<TextEditor> ();
static List<IDisposable> undoGroups = new List<IDisposable> ();
public static void FinishRefactoringOperation ()
{
- foreach (TextEditorData data in textEditorDatas) {
- data.Document.CommitUpdateAll ();
- }
textEditorDatas.Clear ();
undoGroups.ForEach (grp => grp.Dispose ());
undoGroups.Clear ();
}
- internal static TextEditorData GetTextEditorData (string fileName)
+ internal static TextEditor GetTextEditorData (string fileName)
{
if (IdeApp.Workbench == null)
return null;
foreach (var doc in IdeApp.Workbench.Documents) {
if (doc.FileName == fileName) {
- TextEditorData result = doc.Editor;
+ var result = doc.Editor;
if (result != null) {
textEditorDatas.Add (result);
undoGroups.Add (result.OpenUndoGroup ());
@@ -113,43 +109,26 @@ namespace MonoDevelop.Refactoring
}
return null;
}
- protected virtual TextEditorData TextEditorData {
+ protected virtual TextEditor TextEditorData {
get {
return GetTextEditorData (FileName);
}
}
- public override void PerformChange (IProgressMonitor monitor, RefactoringOptions rctx)
+ public override void PerformChange (ProgressMonitor monitor, RefactoringOptions rctx)
{
if (rctx == null)
throw new InvalidOperationException ("Refactory context not available.");
- TextEditorData textEditorData = this.TextEditorData;
- bool saveEditor = false;
- bool hadBom = true;
- System.Text.Encoding encoding = System.Text.Encoding.UTF8;
+ var textEditorData = this.TextEditorData;
if (textEditorData == null) {
bool open;
- textEditorData = TextFileProvider.Instance.GetTextEditorData (FileName, out hadBom, out encoding, out open);
- saveEditor = true;
- }
-
-
- int offset = textEditorData.Caret.Offset;
- int charsInserted = textEditorData.Replace (Offset, RemovedChars, InsertedText);
- if (MoveCaretToReplace) {
- textEditorData.Caret.Offset = Offset + charsInserted;
+ var data = TextFileProvider.Instance.GetTextEditorData (FileName, out open);
+ data.ReplaceText (Offset, RemovedChars, InsertedText);
+ data.Save ();
} else {
- if (Offset < offset) {
- int rem = RemovedChars;
- if (Offset + rem > offset)
- rem = offset - Offset;
- textEditorData.Caret.Offset = offset - rem + charsInserted;
- }
+ textEditorData.ReplaceText (Offset, RemovedChars, InsertedText);
}
-
- if (saveEditor)
- Mono.TextEditor.Utils.TextFileUtility.WriteText (FileName, textEditorData.Text, encoding, hadBom);
}
public override string ToString ()
@@ -177,33 +156,14 @@ namespace MonoDevelop.Refactoring
this.Description = string.Format (GettextCatalog.GetString ("Create file '{0}'"), Path.GetFileName (fileName));
}
- public override void PerformChange (IProgressMonitor monitor, RefactoringOptions rctx)
+ public override void PerformChange (ProgressMonitor monitor, RefactoringOptions rctx)
{
File.WriteAllText (FileName, Content);
- rctx.Document.Project.AddFile (FileName);
- IdeApp.ProjectOperations.Save (rctx.Document.Project);
- }
- }
-
- public class OpenFileChange : Change
- {
- public string FileName {
- get;
- set;
- }
-
- public OpenFileChange (string fileName)
- {
- this.FileName = fileName;
- this.Description = string.Format (GettextCatalog.GetString ("Open file '{0}'"), Path.GetFileName (fileName));
- }
-
- public override void PerformChange (IProgressMonitor monitor, RefactoringOptions rctx)
- {
- IdeApp.Workbench.OpenDocument (FileName);
+ rctx.DocumentContext.Project.AddFile (FileName);
+ IdeApp.ProjectOperations.SaveAsync (rctx.DocumentContext.Project);
}
}
-
+
public class RenameFileChange : Change
{
public string OldName {
@@ -219,25 +179,20 @@ namespace MonoDevelop.Refactoring
public RenameFileChange (string oldName, string newName)
{
if (oldName == null)
- throw new ArgumentNullException ("oldName");
+ throw new ArgumentNullException (nameof (oldName));
if (newName == null)
- throw new ArgumentNullException ("newName");
+ throw new ArgumentNullException (nameof (newName));
this.OldName = oldName;
this.NewName = newName;
this.Description = string.Format (GettextCatalog.GetString ("Rename file '{0}' to '{1}'"), Path.GetFileName (oldName), Path.GetFileName (newName));
}
- public override void PerformChange (IProgressMonitor monitor, RefactoringOptions rctx)
+ public override void PerformChange (ProgressMonitor monitor, RefactoringOptions rctx)
{
if (rctx == null)
- throw new ArgumentNullException ("rctx");
+ throw new ArgumentNullException (nameof (rctx));
FileService.RenameFile (OldName, NewName);
- if (IdeApp.ProjectOperations.CurrentSelectedSolution != null) {
- foreach (var p in IdeApp.ProjectOperations.CurrentSelectedSolution.GetAllProjects ()) {
- if (p.GetProjectFile (NewName) != null)
- IdeApp.ProjectOperations.Save (p);
- }
- }
+ IdeApp.ProjectOperations.CurrentSelectedSolution?.SaveAsync (new ProgressMonitor ());
}
}
@@ -254,9 +209,9 @@ namespace MonoDevelop.Refactoring
this.Description = string.Format (GettextCatalog.GetString ("Save project {0}"), project.Name);
}
- public override void PerformChange (IProgressMonitor monitor, RefactoringOptions rctx)
+ public override void PerformChange (ProgressMonitor monitor, RefactoringOptions rctx)
{
- IdeApp.ProjectOperations.Save (this.Project);
+ IdeApp.ProjectOperations.SaveAsync (this.Project);
}
}
}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/Commands.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/Commands.cs
new file mode 100644
index 0000000000..856fcc63cd
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/Commands.cs
@@ -0,0 +1,44 @@
+//
+// Commands.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Refactoring
+{
+
+ public enum RefactoryCommands
+ {
+ CurrentRefactoryOperations,
+ GotoDeclaration, // in 'referenced' in IdeViMode.cs as string
+ FindReferences,
+ FindAllReferences,
+ FindDerivedClasses,
+ DeclareLocal,
+ ImportSymbol,
+ QuickFix
+ }
+
+}
+
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/EncapsulateFieldDialog.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/EncapsulateFieldDialog.cs
deleted file mode 100644
index 7c806bbfcc..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/EncapsulateFieldDialog.cs
+++ /dev/null
@@ -1,469 +0,0 @@
-// EncapsulateFieldDialog.cs
-//
-// Author:
-// Jeffrey Stedfast <fejj@novell.com>
-// Ankit Jain <jankit@novell.com>
-//
-// Copyright (c) 2007 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-
-using System;
-using System.Text;
-using System.CodeDom;
-
-using Gtk;
-
-using MonoDevelop.Core;
-using MonoDevelop.Projects.Dom;
-using MonoDevelop.Projects.Dom.Parser;
-using MonoDevelop.Projects.CodeGeneration;
-using MonoDevelop.Ide;
-using Mono.TextEditor;
-using System.Linq;
-using System.Collections.Generic;
-using Mono.TextEditor.PopupWindow;
-
-namespace MonoDevelop.Refactoring {
-
- public partial class EncapsulateFieldDialog : Gtk.Dialog
- {
- IType declaringType;
- ListStore store;
- ListStore visibilityStore;
- MonoDevelop.Ide.Gui.Document editor;
-
- private const int colCheckedIndex = 0;
- private const int colFieldNameIndex = 1;
- private const int colPropertyNameIndex = 2;
- private const int colVisibilityIndex = 3;
- private const int colReadOnlyIndex = 4;
- private const int colFieldIndex = 5;
-
- public EncapsulateFieldDialog (MonoDevelop.Ide.Gui.Document editor, ITypeResolveContext ctx, IType declaringType)
- : this (editor, declaringType, null)
- {}
-
- public EncapsulateFieldDialog (MonoDevelop.Ide.Gui.Document editor, ITypeResolveContext ctx, IField field)
- : this (editor, field.DeclaringType, field)
- {}
-
- private EncapsulateFieldDialog (MonoDevelop.Ide.Gui.Document editor, IType declaringType, IField field)
- {
- this.editor = editor;
- this.declaringType = declaringType;
- this.Build ();
-
- Title = GettextCatalog.GetString ("Encapsulate Fields");
- buttonOk.Sensitive = true;
- store = new ListStore (typeof (bool), typeof(string), typeof (string), typeof (string), typeof (bool), typeof (IField));
- visibilityStore = new ListStore (typeof (string));
-
- // Column #1
- CellRendererToggle cbRenderer = new CellRendererToggle ();
- cbRenderer.Activatable = true;
- cbRenderer.Toggled += OnSelectedToggled;
- TreeViewColumn cbCol = new TreeViewColumn ();
- cbCol.Title = "";
- cbCol.PackStart (cbRenderer, false);
- cbCol.AddAttribute (cbRenderer, "active", colCheckedIndex);
- treeview.AppendColumn (cbCol);
-
- // Column #2
- CellRendererText fieldRenderer = new CellRendererText ();
- fieldRenderer.Weight = (int) Pango.Weight.Bold;
- TreeViewColumn fieldCol = new TreeViewColumn ();
- fieldCol.Title = GettextCatalog.GetString ("Field");
- fieldCol.Expand = true;
- fieldCol.PackStart (fieldRenderer, true);
- fieldCol.AddAttribute (fieldRenderer, "text", colFieldNameIndex);
- treeview.AppendColumn (fieldCol);
-
- // Column #3
- CellRendererText propertyRenderer = new CellRendererText ();
- propertyRenderer.Editable = true;
- propertyRenderer.Edited += new EditedHandler (OnPropertyEdited);
- TreeViewColumn propertyCol = new TreeViewColumn ();
- propertyCol.Title = GettextCatalog.GetString ("Property");
- propertyCol.Expand = true;
- propertyCol.PackStart (propertyRenderer, true);
- propertyCol.AddAttribute (propertyRenderer, "text", colPropertyNameIndex);
- propertyCol.SetCellDataFunc (propertyRenderer, new TreeCellDataFunc (RenderPropertyName));
- treeview.AppendColumn (propertyCol);
-
- // Column #4
- CellRendererCombo visiComboRenderer = new CellRendererCombo ();
- visiComboRenderer.Model = visibilityStore;
- visiComboRenderer.Editable = true;
- visiComboRenderer.Edited += new EditedHandler (OnVisibilityEdited);
- visiComboRenderer.HasEntry = false;
- visiComboRenderer.TextColumn = 0;
-
- TreeViewColumn visiCol = new TreeViewColumn ();
- visiCol.Title = GettextCatalog.GetString ("Visibility");
- visiCol.PackStart (visiComboRenderer, false);
- visiCol.AddAttribute (visiComboRenderer, "text", colVisibilityIndex);
- treeview.AppendColumn (visiCol);
-
- // Column #5
- CellRendererToggle roRenderer = new CellRendererToggle ();
- roRenderer.Activatable = true;
- roRenderer.Xalign = 0.0f;
- roRenderer.Toggled += new ToggledHandler (OnReadOnlyToggled);
- TreeViewColumn roCol = new TreeViewColumn ();
- roCol.Title = GettextCatalog.GetString ("Read only");
- roCol.PackStart (roRenderer, false);
- roCol.AddAttribute (roRenderer, "active", colReadOnlyIndex);
- treeview.AppendColumn (roCol);
-
- visibilityStore.AppendValues ("Public");
- visibilityStore.AppendValues ("Private");
- visibilityStore.AppendValues ("Protected");
- visibilityStore.AppendValues ("Internal");
-
- treeview.Model = store;
-
- foreach (IField ifield in declaringType.Fields) {
- bool enabled = field != null && (field.Name == ifield.Name);
- string propertyName = GeneratePropertyName (ifield.Name);
- store.AppendValues (enabled, ifield.Name, propertyName,
- "Public", ifield.IsReadonly || ifield.IsLiteral, ifield);
-
- if (enabled)
- CheckAndUpdateConflictMessage (propertyName, false);
- }
-
- store.SetSortColumnId (colFieldNameIndex, SortType.Ascending);
- buttonSelectAll.Clicked += OnSelectAllClicked;
- buttonUnselectAll.Clicked += OnUnselectAllClicked;
- buttonOk.Clicked += OnOKClicked;
- buttonCancel.Clicked += OnCancelClicked;
-
- UpdateOKButton ();
- }
-
- string GeneratePropertyName (string fieldName)
- {
- StringBuilder builder = new StringBuilder (fieldName.Length);
- bool upper = true;
- int i = 0;
-
- // Field names are commonly prefixed with "m" or "m_" by devs from c++ land.
- if (fieldName[0] == 'm' && fieldName.Length > 1 &&
- (fieldName[1] == '_' || Char.IsUpper (fieldName[1])))
- i++;
-
- while (i < fieldName.Length) {
- if (fieldName[i] == '_') {
- // strip _'s and uppercase the next letter
- upper = true;
- } else if (Char.IsLetter (fieldName[i])) {
- builder.Append (upper ? Char.ToUpper (fieldName[i]) : fieldName[i]);
- upper = false;
- } else {
- builder.Append (fieldName[i]);
- }
-
- i++;
- }
-
- return builder.ToString ();
- }
-
- void OnPropertyEdited (object sender, EditedArgs args)
- {
- TreeIter iter;
- if (!store.GetIterFromString (out iter, args.Path))
- return;
-
- store.SetValue (iter, colPropertyNameIndex, args.NewText);
- if (!CheckAndUpdateConflictMessage (iter, true))
- // unselect this field
- store.SetValue (iter, colCheckedIndex, false);
-
- UpdateOKButton ();
- }
-
- void RenderPropertyName (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
- {
- bool selected = (bool) store.GetValue (iter, colCheckedIndex);
- string propertyName = (string) store.GetValue (iter, colPropertyNameIndex);
- string error;
-
- CellRendererText cellRendererText = (CellRendererText) cell;
- if (!selected || IsValidPropertyName (propertyName, out error))
- cellRendererText.Foreground = "black";
- else
- cellRendererText.Foreground = "red";
-
- cellRendererText.Text = propertyName;
- }
-
- // @clearOnValid: clear the message label if propertyName is valid
- bool CheckAndUpdateConflictMessage (TreeIter iter, bool clearOnValid)
- {
- return CheckAndUpdateConflictMessage ((string) store.GetValue (iter, colPropertyNameIndex),
- clearOnValid);
- }
-
- // @clearOnValid: clear the message label if propertyName is valid
- bool CheckAndUpdateConflictMessage (string name, bool clearOnValid)
- {
- string error;
- if (IsValidPropertyName (name, out error)) {
- if (clearOnValid)
- SetErrorMessage (null);
- return true;
- } else {
- SetErrorMessage (error);
- return false;
- }
- }
-
- void SetErrorMessage (string message)
- {
- if (String.IsNullOrEmpty (message)) {
- labelError.Text = String.Empty;
- imageError.Clear ();
- } else {
- labelError.Text = message;
- imageError.SetFromStock (MonoDevelop.Ide.Gui.Stock.Error, IconSize.Menu);
- }
- }
-
- bool IsValidPropertyName (string name, out string error_msg)
- {
- // Don't allow the user to click OK unless there is a new name
- if (name.Length == 0) {
- error_msg = GettextCatalog.GetString ("Property name must be non-empty.");
- return false;
- }
- foreach (IMember member in declaringType.Members) {
- if (member.Name == name) {
- error_msg = GettextCatalog.GetString ("Property name conflicts with an existing member name.");
- return false;
- }
- }
- error_msg = String.Empty;
- return true;
- }
-
- private void OnVisibilityEdited (object sender, EditedArgs args)
- {
- TreeIter iter;
- if (store.GetIterFromString (out iter, args.Path))
- store.SetValue (iter, colVisibilityIndex, args.NewText);
- }
-
- private void OnSelectedToggled (object o, ToggledArgs args)
- {
- TreeIter iter;
- if (!store.GetIterFromString (out iter, args.Path))
- return;
-
- bool old_value = (bool) store.GetValue (iter, colCheckedIndex);
- store.SetValue (iter, colCheckedIndex, !old_value);
-
- if (old_value)
- SetErrorMessage (null);
- else
- CheckAndUpdateConflictMessage (iter, true);
- UpdateOKButton ();
- }
-
- void UpdateOKButton ()
- {
- TreeIter iter;
- if (!store.GetIterFirst (out iter))
- return;
-
- bool atleast_one_selected = false;
- do {
- bool selected = (bool) store.GetValue (iter, colCheckedIndex);
- if (!selected)
- continue;
-
- atleast_one_selected = true;
-
- string propertyName = (string) store.GetValue (iter, colPropertyNameIndex);
- string error;
- if (!IsValidPropertyName (propertyName, out error)) {
- buttonOk.Sensitive = false;
- return;
- }
- } while (store.IterNext (ref iter));
-
- buttonOk.Sensitive = atleast_one_selected;
- }
-
- private void OnReadOnlyToggled (object o, ToggledArgs args)
- {
- TreeIter iter;
- if (store.GetIterFromString (out iter, args.Path)) {
- IField ifield = (IField) store.GetValue (iter, colFieldIndex);
- if (ifield.IsReadonly || ifield.IsLiteral)
- return;
-
- bool value = (bool) store.GetValue (iter, colReadOnlyIndex);
- store.SetValue (iter, colReadOnlyIndex, !value);
- }
- }
-
- void OnSelectAllClicked (object sender, EventArgs e)
- {
- SelectAll (true);
- }
-
- void OnUnselectAllClicked (object sender, EventArgs e)
- {
- SelectAll (false);
- SetErrorMessage (null);
- }
-
- void SelectAll (bool select)
- {
- TreeIter iter;
- if (!store.GetIterFirst (out iter))
- return;
-
- // clear any old error message
- SetErrorMessage (null);
-
- bool has_error = false;
- do {
- if (select && !CheckAndUpdateConflictMessage (iter, false))
- has_error = true;
- store.SetValue (iter, colCheckedIndex, select);
- } while (store.IterNext (ref iter));
-
- if (has_error)
- SetErrorMessage (GettextCatalog.GetString ("One or more property names conflict with existing members of the class"));
- UpdateOKButton ();
- }
-
- void OnCancelClicked (object sender, EventArgs e)
- {
- ((Widget) this).Destroy ();
- }
- class FieldData {
- public IField Field { get; set; }
- public string PropertyName { get; set; }
- public bool ReadOnly { get; set; }
- public Modifiers Modifiers { get; set; }
-
- public FieldData (IField field, string propertyName, bool readOnly, Modifiers modifiers)
- {
- this.Field = field;
- this.PropertyName = propertyName;
- this.ReadOnly = readOnly;
- this.Modifiers = modifiers;
- }
- }
-
- void OnOKClicked (object sender, EventArgs e)
- {
- TreeIter iter;
- if (!store.GetIterFirst (out iter))
- return;
-
- List<FieldData> data = new List<FieldData> ();
-
- do {
- bool selected = (bool) store.GetValue (iter, colCheckedIndex);
- if (!selected)
- continue;
-
- string propertyName = (string) store.GetValue (iter, colPropertyNameIndex);
- string visibility = (string) store.GetValue (iter, colVisibilityIndex);
- bool read_only = (bool) store.GetValue (iter, colReadOnlyIndex);
- IField field = (IField) store.GetValue (iter, colFieldIndex);
- Modifiers mod = Modifiers.None;
- if (visibility.ToUpper () == "PUBLIC")
- mod = Modifiers.Public;
- if (visibility.ToUpper () == "PRIVATE")
- mod = Modifiers.Private;
- if (visibility.ToUpper () == "PROTECTED")
- mod = Modifiers.Protected;
- if (visibility.ToUpper () == "INTERNAL")
- mod = Modifiers.Internal;
- data.Add (new FieldData (field, propertyName, read_only, mod));
- } while (store.IterNext (ref iter));
-
- var mode = new InsertionCursorEditMode (editor.Editor.Parent, CodeGenerationService.GetInsertionPoints (editor, declaringType));
- var helpWindow = new ModeHelpWindow ();
- helpWindow.Shown += (s, a) => DesktopService.RemoveWindowShadow (helpWindow);
- helpWindow.TransientFor = IdeApp.Workbench.RootWindow;
- helpWindow.TitleText = GettextCatalog.GetString ("<b>Encapsulate Field -- Targeting</b>");
- helpWindow.Items.Add (new KeyValuePair<string, string> (GettextCatalog.GetString ("<b>Key</b>"), GettextCatalog.GetString ("<b>Behavior</b>")));
- helpWindow.Items.Add (new KeyValuePair<string, string> (GettextCatalog.GetString ("<b>Up</b>"), GettextCatalog.GetString ("Move to <b>previous</b> target point.")));
- helpWindow.Items.Add (new KeyValuePair<string, string> (GettextCatalog.GetString ("<b>Down</b>"), GettextCatalog.GetString ("Move to <b>next</b> target point.")));
- helpWindow.Items.Add (new KeyValuePair<string, string> (GettextCatalog.GetString ("<b>Enter</b>"), GettextCatalog.GetString ("<b>Declare new property</b> at target point.")));
- helpWindow.Items.Add (new KeyValuePair<string, string> (GettextCatalog.GetString ("<b>Esc</b>"), GettextCatalog.GetString ("<b>Cancel</b> this refactoring.")));
- mode.HelpWindow = helpWindow;
- mode.CurIndex = mode.InsertionPoints.Count - 1;
- int idx = -1, i = 0;
- TextLocation lTextLocation = TextLocation.Empty;
- foreach (IMember member in declaringType.Members) {
- if (lTextLocation != member.Location && data.Any (d => d.Field.Location == member.Location))
- idx = i;
- lTextLocation = member.Location;
- i++;
- }
- if (idx >= 0)
- mode.CurIndex = idx + 1;
- mode.StartMode ();
- mode.Exited += delegate(object s, InsertionCursorEventArgs args) {
- if (args.Success) {
- CodeGenerator generator = CodeGenerator.CreateGenerator (editor.Editor.Document.MimeType, editor.Editor.TabsToSpaces, editor.Editor.Options.TabSize, editor.Editor.EolMarker);
- StringBuilder code = new StringBuilder ();
- for (int j = 0; j < data.Count; j++) {
- if (j > 0) {
- code.AppendLine ();
- code.AppendLine ();
- }
- var f = data[j];
- code.Append (generator.CreateFieldEncapsulation (declaringType, f.Field, f.PropertyName, f.Modifiers, f.ReadOnly));
- }
- args.InsertionPoint.Insert (editor.Editor, code.ToString ());
- }
- };
- ((Widget) this).Destroy ();
- }
-
- static MemberAttributes StringToMemberAttributes (string visibility)
- {
- switch (visibility) {
- case "Public":
- return MemberAttributes.Public;
- case "Private":
- return MemberAttributes.Private;
- case "Protected":
- return MemberAttributes.Family;
- case "Internal":
- return MemberAttributes.Assembly;
- default:
- throw new ArgumentException ("Unknown visibility : " + visibility);
- }
- }
-
- }
-}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ExtensionMethods.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ExtensionMethods.cs
deleted file mode 100644
index cb52d45e37..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ExtensionMethods.cs
+++ /dev/null
@@ -1,148 +0,0 @@
-//
-// ExtensionMethods.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using MonoDevelop.Ide.Gui;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.Semantics;
-using System.Threading.Tasks;
-using MonoDevelop.Core;
-using System.Threading;
-using MonoDevelop.Core.Instrumentation;
-using MonoDevelop.Projects;
-
-namespace MonoDevelop.Refactoring
-{
- public static class ExtensionMethods
- {
- class ResolverAnnotation
- {
- public CancellationTokenSource SharedTokenSource;
- public Task<CSharpAstResolver> Task;
- public CSharpUnresolvedFile ParsedFile;
- }
-
- public static TimerCounter ResolveCounter = InstrumentationService.CreateTimerCounter("Resolve document", "Parsing");
-
- /// <summary>
- /// Returns a full C# syntax tree resolver which is shared between semantic highlighting, source analysis and refactoring.
- /// For code analysis tasks this should be used instead of generating an own resolver. Only exception is if a local resolving is done using a
- /// resolve navigator.
- /// Note: The shared resolver is fully resolved.
- /// </summary>
- public static Task<CSharpAstResolver> GetSharedResolver (this Document document)
- {
- var parsedDocument = document.ParsedDocument;
- if (parsedDocument == null || document.IsProjectContextInUpdate || document.Project != null && !(document.Project is DotNetProject))
- return null;
-
- var unit = parsedDocument.GetAst<SyntaxTree> ();
- var parsedFile = parsedDocument.ParsedFile as CSharpUnresolvedFile;
- if (unit == null || parsedFile == null)
- return null;
- var compilation = document.Compilation;
-
- var resolverAnnotation = document.Annotation<ResolverAnnotation> ();
-
- if (resolverAnnotation != null) {
- if (resolverAnnotation.ParsedFile == parsedFile)
- return resolverAnnotation.Task;
- if (resolverAnnotation.SharedTokenSource != null)
- resolverAnnotation.SharedTokenSource.Cancel ();
- document.RemoveAnnotations<ResolverAnnotation> ();
- }
-
- var tokenSource = new CancellationTokenSource ();
- var token = tokenSource.Token;
- var resolveTask = Task.Factory.StartNew (delegate {
- try {
- using (var timer = ResolveCounter.BeginTiming ()) {
- var result = new CSharpAstResolver (compilation, unit, parsedFile);
- result.ApplyNavigator (new ConstantModeResolveVisitorNavigator (ResolveVisitorNavigationMode.Resolve, null), token);
- return result;
- }
- } catch (OperationCanceledException) {
- return null;
- } catch (Exception e) {
- LoggingService.LogError ("Error while creating the resolver.", e);
- return null;
- }
- }, token);
-
- var wrapper = resolveTask.ContinueWith (t => {
- if (t.IsCanceled)
- return null;
- if (t.IsFaulted) {
- var ex = t.Exception.Flatten ().InnerException;
- if (!(ex is TaskCanceledException))
- LoggingService.LogWarning ("Exception while getting shared AST resolver.", ex);
- return null;
- }
- return t.Result;
- }, TaskContinuationOptions.ExecuteSynchronously);
-
- document.AddAnnotation (new ResolverAnnotation {
- Task = wrapper,
- ParsedFile = parsedFile,
- SharedTokenSource = tokenSource
- });
-
- return wrapper;
- }
-
- public sealed class ConstantModeResolveVisitorNavigator : IResolveVisitorNavigator
- {
- readonly ResolveVisitorNavigationMode mode;
- readonly IResolveVisitorNavigator targetForResolveCalls;
-
- public ConstantModeResolveVisitorNavigator(ResolveVisitorNavigationMode mode, IResolveVisitorNavigator targetForResolveCalls)
- {
- this.mode = mode;
- this.targetForResolveCalls = targetForResolveCalls;
- }
-
- ResolveVisitorNavigationMode IResolveVisitorNavigator.Scan(AstNode node)
- {
- return mode;
- }
-
- void IResolveVisitorNavigator.Resolved(AstNode node, ResolveResult result)
- {
- if (targetForResolveCalls != null)
- targetForResolveCalls.Resolved(node, result);
- }
-
- void IResolveVisitorNavigator.ProcessConversion(Expression expression, ResolveResult result, Conversion conversion, IType targetType)
- {
- if (targetForResolveCalls != null)
- targetForResolveCalls.ProcessConversion(expression, result, conversion, targetType);
- }
- }
-
- }
-} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindDerivedClassesHandler.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindDerivedClassesHandler.cs
deleted file mode 100644
index da9a514bbb..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindDerivedClassesHandler.cs
+++ /dev/null
@@ -1,182 +0,0 @@
-//
-// FindDerivedClassesHandler.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.Refactoring;
-using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Ide.TypeSystem;
-using System.Collections.Generic;
-using System.Threading;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.FindInFiles;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.Semantics;
-using System.Threading.Tasks;
-using System.Linq;
-using System.Collections.Concurrent;
-
-namespace MonoDevelop.Refactoring
-{
- public class FindDerivedClassesHandler : CommandHandler
- {
- public static void FindDerivedClasses (ITypeDefinition cls)
- {
- FindDerivedSymbols (cls, null);
- }
-
- public static void FindDerivedMembers (IMember member)
- {
- var cls = member.DeclaringTypeDefinition;
- if (cls == null)
- return;
- FindDerivedSymbols (cls, member);
- }
-
- static void FindDerivedSymbols (ITypeDefinition cls, IMember member)
- {
- var solution = IdeApp.ProjectOperations.CurrentSelectedSolution;
- if (solution == null)
- return;
-
- var sourceProject = TypeSystemService.GetProject (cls);
- if (sourceProject == null)
- return;
-
- var compilations = ReferenceFinder.GetAllReferencingProjects (solution, sourceProject)
- .Select (TypeSystemService.GetCompilation).Where (c => c != null).ToList ();
-
- using (var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true)) {
- var label = member == null
- ? GettextCatalog.GetString ("Searching for derived classes in solution...")
- : GettextCatalog.GetString ("Searching for derived members in solution...");
- monitor.BeginTask (label, compilations.Count);
-
- Parallel.ForEach (compilations, comp => {
- try {
- SearchCompilation (monitor, comp, cls, member);
- } catch (Exception ex) {
- LoggingService.LogInternalError (ex);
- monitor.ReportError ("Unhandled error while searching", ex);
- }
- monitor.Step (1);
- });
-
- monitor.EndTask ();
- };
- }
-
- static void SearchCompilation (ISearchProgressMonitor monitor, ICompilation comp, ITypeDefinition cls, IMember member)
- {
- var importedType = comp.Import (cls);
- if (importedType == null) {
- return;
- }
-
- IMember impMember = null;
- if (member != null) {
- impMember = comp.Import (member);
- if (impMember == null) {
- return;
- }
- }
-
- foreach (var derivedType in comp.MainAssembly.GetAllTypeDefinitions ()) {
- if (!derivedType.IsDerivedFrom (importedType))
- continue;
- IEntity result;
- if (member != null) {
- result = FindDerivedMember (impMember, derivedType);
- if (result == null)
- continue;
- }
- else {
- result = derivedType;
- }
- ReportResult (monitor, result);
- }
- }
-
- static IMember FindDerivedMember (IMember importedMember, ITypeDefinition derivedType)
- {
- IMember derivedMember;
- if (importedMember.DeclaringTypeDefinition.Kind == TypeKind.Interface) {
- derivedMember = derivedType.GetMembers (null, GetMemberOptions.IgnoreInheritedMembers)
- .FirstOrDefault (m => m.ImplementedInterfaceMembers.Any (im => im.Region == importedMember.Region));
- }
- else {
- derivedMember = InheritanceHelper.GetDerivedMember (importedMember, derivedType);
- }
- return derivedMember;
- }
-
- static void ReportResult (ISearchProgressMonitor monitor, IEntity result)
- {
- string filename = result.Region.FileName;
- if (string.IsNullOrEmpty (filename))
- return;
-
- var textFile = TextFileProvider.Instance.GetTextEditorData (filename);
- var start = textFile.LocationToOffset (result.Region.Begin);
- textFile.SearchRequest.SearchPattern = result.Name;
- var sr = textFile.SearchForward (start);
- if (sr != null)
- start = sr.Offset;
-
- if (textFile.Parent == null)
- textFile.Dispose ();
-
- monitor.ReportResult (new MemberReference (result, result.Region, start, result.Name.Length));
- }
-
- protected override void Run (object data)
- {
- var doc = IdeApp.Workbench.ActiveDocument;
- if (doc == null || doc.FileName == FilePath.Null)
- return;
-
- ResolveResult resolveResult;
- var item = CurrentRefactoryOperationsHandler.GetItem (doc, out resolveResult);
-
- var typeDef = item as ITypeDefinition;
- if (typeDef != null && ((typeDef.Kind == TypeKind.Class && !typeDef.IsSealed) || typeDef.Kind == TypeKind.Interface)) {
- FindDerivedClasses (typeDef);
- return;
- }
-
- var member = item as IMember;
- var handler = new FindDerivedSymbolsHandler (member);
- if (handler.IsValid) {
- handler.Run ();
- return;
- }
- }
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindDerivedSymbolsHandler.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindDerivedSymbolsHandler.cs
deleted file mode 100644
index 50c204a767..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindDerivedSymbolsHandler.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// FindDerivedSymbolsHandler.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Ide.FindInFiles;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.Analysis;
-using MonoDevelop.Ide.TypeSystem;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using MonoDevelop.Projects;
-using System.Threading;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Refactoring
-{
- class FindDerivedSymbolsHandler
- {
- readonly IMember member;
-
- public FindDerivedSymbolsHandler (IMember member)
- {
- this.member = member;
- }
-
- public bool IsValid {
- get {
- if (IdeApp.ProjectOperations.CurrentSelectedSolution == null)
- return false;
- if (TypeSystemService.GetProject (member) == null)
- return false;
- return member.IsVirtual || member.IsAbstract || member.DeclaringType.Kind == TypeKind.Interface;
- }
- }
-
- public void Run ()
- {
- FindDerivedClassesHandler.FindDerivedMembers (member);
- }
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindExtensionMethodHandler.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindExtensionMethodHandler.cs
deleted file mode 100644
index 97e5441889..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindExtensionMethodHandler.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// FindExtensionMethodHandler.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Ide.FindInFiles;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.Analysis;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using MonoDevelop.Ide.TypeSystem;
-
-namespace MonoDevelop.Refactoring
-{
- class FindExtensionMethodHandler
- {
- //Ide.Gui.Document doc;
- ITypeDefinition entity;
-
- public FindExtensionMethodHandler (Ide.Gui.Document doc, ITypeDefinition entity)
- {
- //this.doc = doc;
- this.entity = entity;
- }
-
- public void Run ()
- {
- using (var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true)) {
- foreach (var project in IdeApp.ProjectOperations.CurrentSelectedSolution.GetAllProjects ()) {
- var comp = TypeSystemService.GetCompilation (project);
- foreach (var type in comp.MainAssembly.GetAllTypeDefinitions ()) {
- if (!type.IsStatic)
- continue;
- foreach (var method in type.GetMethods (m => m.IsStatic)) {
- if (!method.IsExtensionMethod)
- continue;
- IType[] ifTypes;
- var typeDef = comp.Import (entity);
- if (typeDef == null)
- continue;
- if (!CSharpResolver.IsEligibleExtensionMethod (typeDef, method, true, out ifTypes))
- continue;
-
- var tf = TextFileProvider.Instance.GetReadOnlyTextEditorData (method.Region.FileName);
- var start = tf.LocationToOffset (method.Region.Begin);
- tf.SearchRequest.SearchPattern = method.Name;
- var sr = tf.SearchForward (start);
- if (sr != null)
- start = sr.Offset;
- monitor.ReportResult (new MemberReference (method, method.Region, start, method.Name.Length));
- }
- }
- }
- }
- }
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindMemberOverloadsHandler.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindMemberOverloadsHandler.cs
deleted file mode 100644
index db0f154683..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindMemberOverloadsHandler.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// FindMemberOverloadsHandler.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Ide.FindInFiles;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.Analysis;
-
-namespace MonoDevelop.Refactoring
-{
- class FindMemberOverloadsHandler
- {
- //Ide.Gui.Document doc;
- IMember entity;
-
- public FindMemberOverloadsHandler (Ide.Gui.Document doc, IMember entity)
- {
- //this.doc = doc;
- this.entity = entity;
- }
-
- public bool IsValid {
- get {
- foreach (var overloadedMember in entity.DeclaringType.GetMembers (m => m.Name == entity.Name && m.SymbolKind == entity.SymbolKind)) {
- var fileName = overloadedMember.Region.FileName;
- if (string.IsNullOrEmpty (fileName))
- continue;
- return true;
- }
- return false;
- }
- }
-
- public void Run ()
- {
- using (var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true)) {
- foreach (var overloadedMember in entity.DeclaringType.GetMembers (m => m.Name == entity.Name && m.SymbolKind == entity.SymbolKind)) {
- var fileName = overloadedMember.Region.FileName;
- if (string.IsNullOrEmpty (fileName))
- continue;
- var tf = TextFileProvider.Instance.GetReadOnlyTextEditorData (fileName);
- var start = tf.LocationToOffset (overloadedMember.Region.Begin);
- tf.SearchRequest.SearchPattern = overloadedMember.Name;
- var sr = tf.SearchForward (start);
- if (sr != null)
- start = sr.Offset;
- monitor.ReportResult (new MemberReference (overloadedMember, overloadedMember.Region, start, overloadedMember.Name.Length));
- }
- }
- }
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindReferencesHandler.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindReferencesHandler.cs
deleted file mode 100644
index 8e219e7e35..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindReferencesHandler.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-// FindReferencesHandler.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Threading;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.Core;
-using MonoDevelop.Ide;
-using MonoDevelop.Ide.FindInFiles;
-using MonoDevelop.Refactoring;
-using ICSharpCode.NRefactory.Semantics;
-
-namespace MonoDevelop.Refactoring
-{
- public class FindReferencesHandler : CommandHandler
- {
- public static void FindRefs (object obj)
- {
- var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true);
- var solution = IdeApp.ProjectOperations.CurrentSelectedSolution;
- ThreadPool.QueueUserWorkItem (delegate {
- try {
- foreach (var mref in ReferenceFinder.FindReferences (solution, obj, false, ReferenceFinder.RefactoryScope.Unknown, monitor)) {
- monitor.ReportResult (mref);
- }
- } catch (Exception ex) {
- if (monitor != null)
- monitor.ReportError ("Error finding references", ex);
- else
- LoggingService.LogError ("Error finding references", ex);
- } finally {
- if (monitor != null)
- monitor.Dispose ();
- }
- });
- }
- protected override void Run (object data)
- {
- var doc = IdeApp.Workbench.ActiveDocument;
- if (doc == null || doc.FileName == FilePath.Null)
- return;
- ResolveResult resolveResoult;
- object item = CurrentRefactoryOperationsHandler.GetItem (doc, out resolveResoult);
- if (item != null)
- FindRefs (item);
- }
- }
-
- public class FindAllReferencesHandler : CommandHandler
- {
- public static void FindRefs (object obj)
- {
- var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true);
- var solution = IdeApp.ProjectOperations.CurrentSelectedSolution;
- ThreadPool.QueueUserWorkItem (delegate {
- try {
- foreach (var mref in ReferenceFinder.FindReferences (solution, obj, true, ReferenceFinder.RefactoryScope.Unknown, monitor)) {
- monitor.ReportResult (mref);
- }
- } catch (Exception ex) {
- if (monitor != null)
- monitor.ReportError ("Error finding references", ex);
- else
- LoggingService.LogError ("Error finding references", ex);
- } finally {
- if (monitor != null)
- monitor.Dispose ();
- }
- });
- }
- protected override void Run (object data)
- {
- var doc = IdeApp.Workbench.ActiveDocument;
- if (doc == null || doc.FileName == FilePath.Null)
- return;
- ResolveResult resolveResoult;
- object item = CurrentRefactoryOperationsHandler.GetItem (doc, out resolveResoult);
- if (item != null)
- FindRefs (item);
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindReferencesProvider.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindReferencesProvider.cs
new file mode 100644
index 0000000000..9e8d17fb4d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/FindReferencesProvider.cs
@@ -0,0 +1,42 @@
+//
+// FindReferencesProvider.cs
+//
+// Author:
+// mkrueger <>
+//
+// Copyright (c) 2016
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections;
+using System.Collections.Generic;
+using MonoDevelop.Ide.FindInFiles;
+using MonoDevelop.Projects;
+
+namespace MonoDevelop.Refactoring
+{
+ abstract class FindReferencesProvider
+ {
+ public abstract Task<IEnumerable<SearchResult>> FindReferences (string documentationCommentId, Project hintProject, CancellationToken token = default(CancellationToken));
+ public abstract Task<IEnumerable<SearchResult>> FindAllReferences (string documentationCommentId, Project hintProject, CancellationToken token = default(CancellationToken));
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/GotoDeclarationHandler.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/GotoDeclarationHandler.cs
deleted file mode 100644
index 58bb8a4dd0..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/GotoDeclarationHandler.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// GotoDeclarationHandler.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.Ide.Gui.Content;
-using MonoDevelop.Refactoring;
-using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.Semantics;
-
-namespace MonoDevelop.Refactoring
-{
- public class GotoDeclarationHandler : CommandHandler
- {
- protected override void Run (object data)
- {
- var doc = IdeApp.Workbench.ActiveDocument;
- if (doc == null || doc.FileName == FilePath.Null)
- return;
-
- ResolveResult resolveResoult;
- object item = CurrentRefactoryOperationsHandler.GetItem (doc, out resolveResoult);
- var entity = item as INamedElement;
- if (entity != null) {
- IdeApp.ProjectOperations.JumpToDeclaration (entity);
- } else {
- var v = item as IVariable;
- if (v != null)
- IdeApp.ProjectOperations.JumpToDeclaration (v);
- }
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ImportSymbolHandler.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ImportSymbolHandler.cs
deleted file mode 100644
index 1a2960a688..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ImportSymbolHandler.cs
+++ /dev/null
@@ -1,519 +0,0 @@
-//
-// RefactoryCommands.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Threading;
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.Projects;
-using MonoDevelop.Projects.Text;
-using MonoDevelop.Ide.Gui.Content;
-using MonoDevelop.Ide.Gui.Dialogs;
-using MonoDevelop.Ide.FindInFiles;
-using MonoDevelop.Refactoring;
-using MonoDevelop.Ide;
-using System.Linq;
-using MonoDevelop.Ide.CodeCompletion;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-
-namespace MonoDevelop.Refactoring
-{
- class GenerateNamespaceImport
- {
- public bool GenerateUsing { get; set; }
- public bool InsertNamespace { get; set; }
- }
-
- class ImportSymbolCache
- {
- Dictionary<string, GenerateNamespaceImport> cache = new Dictionary<string, GenerateNamespaceImport> ();
-
- public GenerateNamespaceImport GetResult (IUnresolvedFile unit, IType type, MonoDevelop.Ide.Gui.Document doc)
- {
- GenerateNamespaceImport result;
- if (cache.TryGetValue (type.Namespace, out result))
- return result;
- result = new GenerateNamespaceImport ();
- cache[type.Namespace] = result;
- TextEditorData data = doc.Editor;
-
- result.InsertNamespace = false;
- var loc = new TextLocation (data.Caret.Line, data.Caret.Column);
- foreach (var ns in RefactoringOptions.GetUsedNamespaces (doc, loc)) {
- if (type.Namespace == ns) {
- result.GenerateUsing = false;
- return result;
- }
- }
-
- result.GenerateUsing = true;
- string name = type.Name;
-
- foreach (string ns in RefactoringOptions.GetUsedNamespaces (doc, loc)) {
- if (doc.Compilation.MainAssembly.GetTypeDefinition (ns, name, type.TypeParameterCount) != null) {
- result.GenerateUsing = false;
- result.InsertNamespace = true;
- return result;
- }
- }
- return result;
- }
- }
-
- class ImportSymbolCompletionData : CompletionData
- {
- IType type;
- Ambience ambience;
- ParsedDocument unit;
- MonoDevelop.Ide.Gui.Document doc;
- ImportSymbolCache cache;
-
- public IType Type {
- get { return this.type; }
- }
-
- public ImportSymbolCompletionData (MonoDevelop.Ide.Gui.Document doc, ImportSymbolCache cache, IType type)
- {
- this.doc = doc;
- this.cache = cache;
-// this.data = doc.Editor;
- this.ambience = AmbienceService.GetAmbience (doc.Editor.MimeType);
- this.type = type;
- this.unit = doc.ParsedDocument;
- this.DisplayFlags |= ICSharpCode.NRefactory.Completion.DisplayFlags.IsImportCompletion;
- }
-
- bool initialized = false;
- bool generateUsing, insertNamespace;
-
- void Initialize ()
- {
- if (initialized)
- return;
- initialized = true;
- if (string.IsNullOrEmpty (type.Namespace))
- return;
- var result = cache.GetResult (unit.ParsedFile, type, doc);
- generateUsing = result.GenerateUsing;
- insertNamespace = result.InsertNamespace;
- }
-
- #region IActionCompletionData implementation
- public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
- {
- Initialize ();
- using (var undo = doc.Editor.OpenUndoGroup ()) {
- string text = insertNamespace ? type.Namespace + "." + type.Name : type.Name;
- if (text != GetCurrentWord (window)) {
- if (window.WasShiftPressed && generateUsing)
- text = type.Namespace + "." + text;
- window.CompletionWidget.SetCompletionText (window.CodeCompletionContext, GetCurrentWord (window), text);
- }
-
- if (!window.WasShiftPressed && generateUsing) {
- var generator = CodeGenerator.CreateGenerator (doc);
- if (generator != null) {
- generator.AddGlobalNamespaceImport (doc, type.Namespace);
- // reparse
- doc.UpdateParseDocument ();
- }
- }
- }
- ka |= KeyActions.Ignore;
- }
- #endregion
-
- #region ICompletionData implementation
- public override IconId Icon {
- get {
- return type.GetStockIcon ();
- }
- }
- string displayText = null;
- public override string DisplayText {
- get {
- if (displayText == null)
- displayText = ambience.GetString (type, OutputFlags.IncludeGenerics);
- return displayText;
- }
- }
-
- static string GetDefaultDisplaySelection (string description, bool isSelected)
- {
- if (!isSelected)
- return "<span foreground=\"darkgray\">" + description + "</span>";
- return description;
- }
-
- string displayDescription = null;
- public override string GetDisplayDescription (bool isSelected)
- {
- if (displayDescription == null) {
- Initialize ();
- if (generateUsing || insertNamespace) {
- displayDescription = string.Format (GettextCatalog.GetString ("(from '{0}')"), type.Namespace);
- } else {
- displayDescription = "";
- }
- }
- return GetDefaultDisplaySelection (displayDescription, isSelected);
- }
-
-
- public override string Description {
- get {
- Initialize ();
- if (generateUsing)
- return string.Format (GettextCatalog.GetString ("Add namespace import '{0}'"), type.Namespace);
- return null;
- }
- }
-
- public override string CompletionText {
- get {
- return type.Name;
- }
- }
- #endregion
- }
-
- public class ImportSymbolHandler: CommandHandler
- {
- protected override void Run ()
- {
- var doc = IdeApp.Workbench.ActiveDocument;
- if (doc == null || doc.FileName == FilePath.Null || doc.ParsedDocument == null)
- return;
- ITextEditorExtension ext = doc.EditorExtension;
- while (ext != null && !(ext is CompletionTextEditorExtension))
- ext = ext.Next;
- if (ext == null)
- return;
-
- var dom = doc.Compilation;
- ImportSymbolCache cache = new ImportSymbolCache ();
- var lookup = new MemberLookup (null, doc.Compilation.MainAssembly);
-
- List<ImportSymbolCompletionData> typeList = new List<ImportSymbolCompletionData> ();
- foreach (var type in dom.GetTopLevelTypeDefinitons ()) {
- if (!lookup.IsAccessible (type, false))
- continue;
- typeList.Add (new ImportSymbolCompletionData (doc, cache, type));
- }
-
- typeList.Sort (delegate (ImportSymbolCompletionData left, ImportSymbolCompletionData right) {
- return left.Type.Name.CompareTo (right.Type.Name);
- });
-
-
- CompletionDataList completionList = new CompletionDataList ();
- completionList.IsSorted = true;
- typeList.ForEach (cd => completionList.Add (cd));
-
- ((CompletionTextEditorExtension)ext).ShowCompletion (completionList);
- }
- }
-}
-
-/*
-//
-// RefactoryCommands.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Threading;
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.Projects;
-using MonoDevelop.Projects.Text;
-using MonoDevelop.Ide.Gui.Content;
-using MonoDevelop.Ide.Gui.Dialogs;
-using MonoDevelop.Ide.FindInFiles;
-using MonoDevelop.Refactoring;
-using MonoDevelop.Ide;
-using System.Linq;
-using MonoDevelop.Ide.CodeCompletion;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using MonoDevelop.Ide.TypeSystem;
-
-namespace MonoDevelop.Refactoring
-{
- class GenerateNamespaceImport
- {
- public bool GenerateUsing { get; set; }
- public bool InsertNamespace { get; set; }
- }
-
- class ImportSymbolCache
- {
- Dictionary<string, GenerateNamespaceImport> cache = new Dictionary<string, GenerateNamespaceImport> ();
-
- public GenerateNamespaceImport GetResult (IUnresolvedFile unit, string typeNamespace, string typeName, MonoDevelop.Ide.Gui.Document doc)
- {
- GenerateNamespaceImport result;
- if (cache.TryGetValue (typeNamespace, out result))
- return result;
- result = new GenerateNamespaceImport ();
- cache[typeNamespace] = result;
- TextEditorData data = doc.Editor;
-
- result.InsertNamespace = false;
- var loc = new TextLocation (data.Caret.Line, data.Caret.Column);
- foreach (var ns in RefactoringOptions.GetUsedNamespaces (doc, loc)) {
- if (typeNamespace == ns) {
- result.GenerateUsing = false;
- return result;
- }
- }
-
- result.GenerateUsing = true;
- string name = typeName;
-
- foreach (string ns in RefactoringOptions.GetUsedNamespaces (doc, loc)) {
- if (doc.Compilation.MainAssembly.GetTypeDefinition (ns, name, 0) != null) {
- result.GenerateUsing = false;
- result.InsertNamespace = true;
- return result;
- }
- }
- return result;
- }
- }
-
- class ImportSymbolCompletionData : CompletionData
- {
- internal readonly string typeName;
- ParsedDocument unit;
- MonoDevelop.Ide.Gui.Document doc;
- ImportSymbolCache cache;
- TypeKind kind;
- Lazy<FrameworkLookup.AssemblyLookup> lookup;
- MonoDevelop.Projects.ProjectReference reference;
- public ImportSymbolCompletionData (MonoDevelop.Ide.Gui.Document doc, ImportSymbolCache cache, string typeName, TypeKind kind, Lazy<FrameworkLookup.AssemblyLookup> lookup, MonoDevelop.Projects.ProjectReference reference)
- {
- this.doc = doc;
- this.cache = cache;
- this.unit = doc.ParsedDocument;
- this.kind = kind;
- this.typeName = typeName;
- this.lookup = lookup;
- this.reference = reference;
- }
-
- bool initialized = false;
- bool generateReference;
- bool generateUsing;
- bool insertNamespace;
-
- void Initialize ()
- {
- if (initialized)
- return;
- initialized = true;
- var netProject = (DotNetProject)doc.Project;
- generateReference = true;
- foreach (var r in netProject.References) {
- if (r.Equals (reference)) {
- generateReference = false;
- break;
- }
- }
- var result = cache.GetResult (unit.ParsedFile, lookup.Value.Namespace, typeName, doc);
- generateUsing = result.GenerateUsing;
- insertNamespace = result.InsertNamespace;
- }
-
- #region IActionCompletionData implementation
- public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
- {
- Initialize ();
- string text = insertNamespace ? lookup.Value.Namespace + "." + typeName : typeName;
- if (text != GetCurrentWord (window)) {
- if (window.WasShiftPressed && generateReference)
- text = lookup.Value.Namespace + "." + text;
- window.CompletionWidget.SetCompletionText (window.CodeCompletionContext, GetCurrentWord (window), text);
- }
-
- if (generateReference) {
- var project = doc.Project;
- project.Items.Add (reference);
- IdeApp.ProjectOperations.Save (project);
- }
-
- if (!window.WasShiftPressed && generateUsing) {
- var generator = CodeGenerator.CreateGenerator (doc);
- if (generator != null) {
- generator.AddGlobalNamespaceImport (doc, lookup.Value.Namespace);
- // reparse
- doc.UpdateParseDocument ();
- }
- }
- }
- #endregion
-
- #region ICompletionData implementation
- public override IconId Icon {
- get {
- switch (kind) {
- case TypeKind.Delegate:
- return MonoDevelop.Ide.Gui.Stock.Delegate;
- case TypeKind.Struct:
- return MonoDevelop.Ide.Gui.Stock.Struct;
- case TypeKind.Interface:
- return MonoDevelop.Ide.Gui.Stock.Interface;
- case TypeKind.Enum:
- return MonoDevelop.Ide.Gui.Stock.Enum;
- default:
- return MonoDevelop.Ide.Gui.Stock.Class;
- }
- }
- }
-
- public override string DisplayText {
- get {
- return typeName;
- }
- }
-
- string displayDescription = null;
- public override string DisplayDescription {
- get {
- if (displayDescription == null) {
- Initialize ();
- if (generateReference) {
- displayDescription = string.Format (GettextCatalog.GetString ("(reference '{0}')"), reference.Reference);
- } else if (generateUsing) {
- displayDescription = string.Format (GettextCatalog.GetString ("(from '{0}')"), lookup.Value.Namespace);
- } else {
- displayDescription = "";
- }
- }
- return displayDescription;
- }
- }
-
- public override string Description {
- get {
- return DisplayDescription;
- }
- }
-
- public override string CompletionText {
- get {
- return typeName;
- }
- }
- #endregion
- }
-
- public class ImportSymbolHandler: CommandHandler
- {
- protected override void Run ()
- {
- var doc = IdeApp.Workbench.ActiveDocument;
- if (doc == null || doc.FileName == FilePath.Null || doc.ParsedDocument == null)
- return;
- ITextEditorExtension ext = doc.EditorExtension;
- while (ext != null && !(ext is CompletionTextEditorExtension))
- ext = ext.Next;
- if (ext == null)
- return;
-
- var dom = doc.Compilation;
- ImportSymbolCache cache = new ImportSymbolCache ();
- List<ImportSymbolCompletionData> typeList = new List<ImportSymbolCompletionData> ();
- Dictionary<string, MonoDevelop.Projects.ProjectReference> referenceCache = new Dictionary<string, MonoDevelop.Projects.ProjectReference> ();
- var netProject = (DotNetProject)doc.Project;
- foreach (var type in TypeSystemService.GetFrameworkLookup (netProject).GetAllTypes ()) {
- var r = type.Item3.Value;
- MonoDevelop.Projects.ProjectReference reference;
- if (!referenceCache.TryGetValue (r.FullName, out reference)) {
- var systemAssembly = netProject.AssemblyContext.GetAssemblyFromFullName (r.FullName, r.Package, netProject.TargetFramework);
- if (systemAssembly == null) {
- reference = null;
- } else {
- reference = new MonoDevelop.Projects.ProjectReference (systemAssembly);
- }
- referenceCache [r.FullName] = reference;
- }
- if (reference == null)
- continue;
- typeList.Add (new ImportSymbolCompletionData (doc, cache, type.Item2, type.Item1, type.Item3, reference));
- }
-
- typeList.Sort (delegate (ImportSymbolCompletionData left, ImportSymbolCompletionData right) {
- return left.typeName.CompareTo (right.typeName);
- });
-
-
- var completionList = new CompletionDataList ();
- completionList.IsSorted = true;
-
- typeList.ForEach (cd => completionList.Add (cd));
-
- ((CompletionTextEditorExtension)ext).ShowCompletion (completionList);
- }
- }
-}
- * */
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/InsertionPointService.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/InsertionPointService.cs
new file mode 100644
index 0000000000..5f60bf1ec2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/InsertionPointService.cs
@@ -0,0 +1,270 @@
+//
+// InsertionPointService.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using MonoDevelop.Ide.Editor;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.Threading;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace MonoDevelop.Refactoring
+{
+ public static class InsertionPointService
+ {
+ public static List<InsertionPoint> GetInsertionPoints (IReadonlyTextDocument data, MonoDevelop.Ide.TypeSystem.ParsedDocument parsedDocument, ITypeSymbol type, int part)
+ {
+ if (data == null)
+ throw new ArgumentNullException (nameof (data));
+ if (parsedDocument == null)
+ throw new ArgumentNullException (nameof (parsedDocument));
+ if (type == null)
+ throw new ArgumentNullException (nameof (type));
+ if (!type.IsDefinedInSource ())
+ throw new ArgumentException ("The given type needs to be defined in source code.", nameof (type));
+
+ // update type from parsed document, since this is always newer.
+ //type = parsedDocument.GetInnermostTypeDefinition (type.GetLocation ()) ?? type;
+ //var realStartLocation = data.OffsetToLocation (offset);
+ var model = parsedDocument.GetAst<SemanticModel> ();
+ return GetInsertionPoints (data, model, type, part);
+ }
+
+ internal static List<InsertionPoint> GetInsertionPoints (IReadonlyTextDocument data, SemanticModel model, ITypeSymbol type, int part)
+ {
+ List<InsertionPoint> result = new List<InsertionPoint> ();
+
+ type = model.GetEnclosingNamedType (part, default (CancellationToken)) as ITypeSymbol ?? type;
+ var sourceSpan = new TextSpan (part, 0);
+
+ var filePath = data.FileName;
+ var declaringType = type.DeclaringSyntaxReferences.FirstOrDefault (dsr => dsr.SyntaxTree.FilePath == filePath && dsr.Span.Contains (sourceSpan)) ?? type.DeclaringSyntaxReferences.FirstOrDefault ();
+ if (declaringType == null)
+ return result;
+ return GetInsertionPoints (data, type, result, sourceSpan, declaringType);
+ }
+
+ static List<InsertionPoint> GetInsertionPoints (IReadonlyTextDocument data, ITypeSymbol type, List<InsertionPoint> result, TextSpan sourceSpan, SyntaxReference declaringType)
+ {
+ var openBraceToken = declaringType.GetSyntax ().ChildTokens ().FirstOrDefault (t => t.IsKind (SyntaxKind.OpenBraceToken));
+ if (!openBraceToken.IsMissing) {
+ var domLocation = data.OffsetToLocation (openBraceToken.SpanStart);
+ result.Add (GetInsertionPosition (data, domLocation.Line, domLocation.Column));
+ // result.Add (GetInsertionPosition (data, realStartLocation.Line, realStartLocation.Column));
+ result [0].LineBefore = NewLineInsertion.None;
+ }
+ foreach (var member in type.GetMembers ()) {
+ if (member.IsImplicitlyDeclared || !member.IsDefinedInSource ())
+ continue;
+ //var domLocation = member.BodyRegion.End;
+ foreach (var loc in member.DeclaringSyntaxReferences) {
+ if (loc.SyntaxTree.FilePath != declaringType.SyntaxTree.FilePath || !declaringType.Span.Contains (sourceSpan))
+ continue;
+ var domLocation = data.OffsetToLocation (loc.Span.End);
+
+ if (domLocation.Line <= 0) {
+ var lineSegment = data.GetLineByOffset (loc.Span.Start);
+ if (lineSegment == null)
+ continue;
+ domLocation = new DocumentLocation (lineSegment.LineNumber, lineSegment.Length + 1);
+ }
+ result.Add (GetInsertionPosition (data, domLocation.Line, domLocation.Column));
+ break;
+ }
+ }
+
+ result [result.Count - 1].LineAfter = NewLineInsertion.None;
+ CheckStartPoint (data, result [0], result.Count == 1);
+ if (result.Count > 1) {
+ result.RemoveAt (result.Count - 1);
+ NewLineInsertion insertLine;
+ var typeSyntaxReference = type.DeclaringSyntaxReferences.FirstOrDefault (r => r.Span.Contains (sourceSpan));
+
+ var lineBefore = data.GetLineByOffset (typeSyntaxReference.Span.End).PreviousLine;
+ if (lineBefore != null && lineBefore.Length == lineBefore.GetIndentation (data).Length) {
+ insertLine = NewLineInsertion.None;
+ } else {
+ insertLine = NewLineInsertion.Eol;
+ }
+ // search for line start
+ var line = data.GetLineByOffset (typeSyntaxReference.Span.End);
+ int col = typeSyntaxReference.Span.End - line.Offset;
+ if (line != null) {
+ var lineOffset = line.Offset;
+ col = Math.Min (line.Length, col);
+ while (lineOffset + col - 2 >= 0 && col > 1 && char.IsWhiteSpace (data.GetCharAt (lineOffset + col - 2)))
+ col--;
+ }
+ result.Add (new InsertionPoint (new DocumentLocation (line.LineNumber, col), insertLine, NewLineInsertion.Eol));
+ CheckEndPoint (data, result [result.Count - 1], result.Count == 1);
+ }
+
+// foreach (var region in parsedDocument.UserRegions.Where (r => type.BodyRegion.IsInside (r.Region.Begin))) {
+// result.Add (new InsertionPoint (new DocumentLocation (region.Region.BeginLine + 1, 1), NewLineInsertion.Eol, NewLineInsertion.Eol));
+// result.Add (new InsertionPoint (new DocumentLocation (region.Region.EndLine, 1), NewLineInsertion.Eol, NewLineInsertion.Eol));
+// result.Add (new InsertionPoint (new DocumentLocation (region.Region.EndLine + 1, 1), NewLineInsertion.Eol, NewLineInsertion.Eol));
+// }
+ result.Sort ((left, right) => left.Location.CompareTo (right.Location));
+ //foreach (var res in result)
+ // Console.WriteLine (res);
+ return result;
+ }
+
+ public static List<InsertionPoint> GetInsertionPoints (IReadonlyTextDocument data, MonoDevelop.Ide.TypeSystem.ParsedDocument parsedDocument, ITypeSymbol type, Location location)
+ {
+ return GetInsertionPoints (data, parsedDocument, type, location.SourceSpan.Start);
+ }
+
+ static void CheckEndPoint (IReadonlyTextDocument doc, InsertionPoint point, bool isStartPoint)
+ {
+ var line = doc.GetLine (point.Location.Line);
+ if (line == null)
+ return;
+
+ if (doc.GetLineIndent (line).Length + 1 < point.Location.Column)
+ point.LineBefore = NewLineInsertion.BlankLine;
+ if (point.Location.Column < line.Length + 1)
+ point.LineAfter = NewLineInsertion.Eol;
+ }
+
+ static void CheckStartPoint (IReadonlyTextDocument doc, InsertionPoint point, bool isEndPoint)
+ {
+ var line = doc.GetLine (point.Location.Line);
+ if (line == null)
+ return;
+ if (doc.GetLineIndent (line).Length + 1 == point.Location.Column) {
+ int lineNr = point.Location.Line;
+ while (lineNr > 1 && doc.GetLineIndent (lineNr - 1).Length == doc.GetLine (lineNr - 1).Length) {
+ lineNr--;
+ }
+ line = doc.GetLine (lineNr);
+ point.Location = new DocumentLocation (lineNr, doc.GetLineIndent (line).Length + 1);
+ }
+
+ if (doc.GetLineIndent (line).Length + 1 < point.Location.Column)
+ point.LineBefore = NewLineInsertion.Eol;
+ if (point.Location.Column < line.Length + 1)
+ point.LineAfter = isEndPoint ? NewLineInsertion.Eol : NewLineInsertion.BlankLine;
+ }
+
+ static InsertionPoint GetInsertionPosition (IReadonlyTextDocument doc, int line, int column)
+ {
+ int bodyEndOffset = doc.LocationToOffset (line, column) + 1;
+ var curLine = doc.GetLine (line);
+ if (curLine != null) {
+ if (bodyEndOffset < curLine.Offset + curLine.Length) {
+ // case1: positition is somewhere inside the start line
+ return new InsertionPoint (new DocumentLocation (line, column + 1), NewLineInsertion.Eol, NewLineInsertion.BlankLine);
+ }
+ }
+
+ // -> if position is at line end check next line
+ var nextLine = doc.GetLine (line + 1);
+ if (nextLine == null) // check for 1 line case.
+ return new InsertionPoint (new DocumentLocation (line, column + 1), NewLineInsertion.BlankLine, NewLineInsertion.BlankLine);
+
+ for (int i = nextLine.Offset; i < nextLine.EndOffset; i++) {
+ char ch = doc.GetCharAt (i);
+ if (!char.IsWhiteSpace (ch)) {
+ // case2: next line contains non ws chars.
+ return new InsertionPoint (new DocumentLocation (line + 1, 1), NewLineInsertion.Eol, NewLineInsertion.BlankLine);
+ }
+ }
+
+ var nextLine2 = doc.GetLine (line + 2);
+ if (nextLine2 != null) {
+ for (int i = nextLine2.Offset; i < nextLine2.EndOffset; i++) {
+ char ch = doc.GetCharAt (i);
+ if (!char.IsWhiteSpace (ch)) {
+ // case3: one blank line
+ return new InsertionPoint (new DocumentLocation (line + 1, 1), NewLineInsertion.Eol, NewLineInsertion.Eol);
+ }
+ }
+ }
+ // case4: more than 1 blank line
+ return new InsertionPoint (new DocumentLocation (line + 1, 1), NewLineInsertion.Eol, NewLineInsertion.None);
+ }
+
+ internal static InsertionPoint GetSuitableInsertionPoint (IReadonlyTextDocument data, IEnumerable<InsertionPoint> points, ITypeSymbol cls, Location part, SyntaxNode member)
+ {
+ switch (member.Kind ()) {
+ case SyntaxKind.FieldDeclaration:
+ return GetNewFieldPosition (data, points, cls, part);
+ case SyntaxKind.MethodDeclaration:
+ case SyntaxKind.ConstructorDeclaration:
+ case SyntaxKind.DestructorDeclaration:
+ case SyntaxKind.OperatorDeclaration:
+ return GetNewMethodPosition (data, points, cls, part);
+ case SyntaxKind.EventDeclaration:
+ return GetNewEventPosition (data, points, cls, part);
+ case SyntaxKind.PropertyDeclaration:
+ return GetNewPropertyPosition (data, points, cls, part);
+ }
+ throw new InvalidOperationException ("Invalid member type: " + member.Kind ());
+ }
+
+ static InsertionPoint GetNewFieldPosition (IReadonlyTextDocument data, IEnumerable<InsertionPoint> points, ITypeSymbol cls, Location part)
+ {
+ if (!cls.GetMembers ().OfType<IFieldSymbol> ().Any ())
+ return points.FirstOrDefault ();
+ var lastField = cls.GetMembers ().OfType<IFieldSymbol> ().Last ();
+ var begin = data.OffsetToLocation (lastField.Locations.First ().SourceSpan.Start);
+ return points.FirstOrDefault (p => p.Location > begin);
+ }
+
+ static InsertionPoint GetNewMethodPosition (IReadonlyTextDocument data, IEnumerable<InsertionPoint> points, ITypeSymbol cls, Location part)
+ {
+ if (!cls.GetMembers ().OfType<IMethodSymbol> ().Any ())
+ return GetNewPropertyPosition (data, points, cls, part);
+ var lastMethod = cls.GetMembers ().OfType<IMethodSymbol> ().Last ();
+ var begin = data.OffsetToLocation (lastMethod.Locations.First ().SourceSpan.Start);
+ return points.FirstOrDefault (p => p.Location > begin);
+ }
+
+ static InsertionPoint GetNewPropertyPosition (IReadonlyTextDocument data, IEnumerable<InsertionPoint> points, ITypeSymbol cls, Location part)
+ {
+ if (!cls.GetMembers ().OfType<IPropertySymbol> ().Any ())
+ return GetNewFieldPosition (data, points, cls, part);
+ var lastProperty = cls.GetMembers ().OfType<IPropertySymbol> ().Last ();
+ var begin = data.OffsetToLocation (lastProperty.Locations.First ().SourceSpan.Start);
+ return points.FirstOrDefault (p => p.Location > begin);
+ }
+
+ static InsertionPoint GetNewEventPosition (IReadonlyTextDocument data, IEnumerable<InsertionPoint> points, ITypeSymbol cls, Location part)
+ {
+ if (!cls.GetMembers ().OfType<IEventSymbol> ().Any ())
+ return GetNewMethodPosition (data, points, cls, part);
+ var lastEvent = cls.GetMembers ().OfType<IEventSymbol> ().Last ();
+ var begin = data.OffsetToLocation (lastEvent.Locations.First ().SourceSpan.Start);
+ return points.FirstOrDefault (p => p.Location > begin);
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/JumpToDeclarationHandler.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/JumpToDeclarationHandler.cs
new file mode 100644
index 0000000000..297cc379ee
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/JumpToDeclarationHandler.cs
@@ -0,0 +1,45 @@
+//
+// JumpToDeclarationHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Refactoring
+{
+ abstract class JumpToDeclarationHandler
+ {
+ public abstract Task<bool> TryJumpToDeclarationAsync (string documentIdString, Projects.Project hintProject, CancellationToken token = default(CancellationToken));
+ }
+
+ class DummyJumpToDeclarationHandler : JumpToDeclarationHandler
+ {
+ public override Task<bool> TryJumpToDeclarationAsync (string documentIdString, Projects.Project hintProject, CancellationToken token = default (CancellationToken))
+ {
+ return Task.FromResult (false);
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/OverridesImplementsDialog.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/OverridesImplementsDialog.cs
deleted file mode 100644
index bc8541afc5..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/OverridesImplementsDialog.cs
+++ /dev/null
@@ -1,400 +0,0 @@
-// OverridesImplementsDialog.cs
-//
-//Author:
-// Ankit Jain <jankit@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.Collections.Generic;
-
-using Gtk;
-
-using MonoDevelop.Core;
-using MonoDevelop.Projects.CodeGeneration;
-using MonoDevelop.Projects.Dom;
-using MonoDevelop.Projects.Dom.Output;
-using Ambience_ = MonoDevelop.Projects.Dom.Output.Ambience;
-using MonoDevelop.Ide;
-using System.Text;
-using Mono.TextEditor;
-using Mono.TextEditor.PopupWindow;
-
-
-namespace MonoDevelop.Refactoring
-{
- partial class OverridesImplementsDialog : Gtk.Dialog
- {
- IType cls;
- TreeStore store;
- CodeRefactorer refactorer;
- Ambience ambience;
- MonoDevelop.Ide.Gui.Document editor;
-
- private const int colCheckedIndex = 0;
- private const int colIconIndex = 1;
- private const int colNameIndex = 2;
- private const int colExplicitIndex = 3;
- private const int colItemIndex = 4;
-
-/* private const OutputFlags default_conversion_flags =
- OutputFlags.ShowParameterNames |
- OutputFlags.ShowGenericParameters |
- OutputFlags.ShowReturnType |
- OutputFlags.ShowParameters |
- OutputFlags.UseIntrinsicTypeNames;*/
- private const OutputFlags default_conversion_flags =
- OutputFlags.IncludeParameters |
- OutputFlags.IncludeParameterName |
- OutputFlags.IncludeReturnType;
-
- public OverridesImplementsDialog (MonoDevelop.Ide.Gui.Document editor, IType cls)
- {
- this.Build();
- this.editor = editor;
- this.cls = cls;
-
- // FIXME: title
- Title = GettextCatalog.GetString ("Override and/or implement members");
-
- store = new TreeStore (typeof (bool), typeof (Gdk.Pixbuf), typeof (string), typeof (bool), typeof (IMember));
-
- // Column #1
- TreeViewColumn nameCol = new TreeViewColumn ();
- nameCol.Title = GettextCatalog.GetString ("Name");
- nameCol.Expand = true;
- nameCol.Resizable = true;
-
- CellRendererToggle cbRenderer = new CellRendererToggle ();
- cbRenderer.Activatable = true;
- cbRenderer.Toggled += OnSelectToggled;
- nameCol.PackStart (cbRenderer, false);
- nameCol.AddAttribute (cbRenderer, "active", colCheckedIndex);
-
- CellRendererPixbuf iconRenderer = new CellRendererPixbuf ();
- nameCol.PackStart (iconRenderer, false);
- nameCol.AddAttribute (iconRenderer, "pixbuf", colIconIndex);
-
- CellRendererText nameRenderer = new CellRendererText ();
- nameRenderer.Ellipsize = Pango.EllipsizeMode.End;
- nameCol.PackStart (nameRenderer, true);
- nameCol.AddAttribute (nameRenderer, "text", colNameIndex);
-
- treeview.AppendColumn (nameCol);
-
- // Column #2
- CellRendererToggle explicitRenderer = new CellRendererToggle ();
- explicitRenderer.Activatable = true;
- explicitRenderer.Xalign = 0.0f;
- explicitRenderer.Toggled += OnExplicitToggled;
- TreeViewColumn explicitCol = new TreeViewColumn ();
- explicitCol.Title = GettextCatalog.GetString ("Explicit");
- explicitCol.PackStart (explicitRenderer, true);
- explicitCol.SetCellDataFunc (explicitRenderer, new TreeCellDataFunc (RenderExplicitCheckbox));
- explicitCol.AddAttribute (explicitRenderer, "active", colExplicitIndex);
- treeview.AppendColumn (explicitCol);
-
- store.SetSortColumnId (colNameIndex, SortType.Ascending);
- treeview.Model = store;
-
- buttonCancel.Clicked += OnCancelClicked;
- buttonOk.Clicked += OnOKClicked;
- buttonSelectAll.Clicked += delegate { SelectAll (true); };
- buttonUnselectAll.Clicked += delegate { SelectAll (false); };
-
- refactorer = IdeApp.Workspace.GetCodeRefactorer (IdeApp.ProjectOperations.CurrentSelectedSolution);
- ambience = AmbienceService.GetAmbienceForFile (cls.GetDefinition ().Region.FileName);
- PopulateTreeView ();
- UpdateOKButton ();
- }
-
- void PopulateTreeView ()
- {
- List<IMember> class_members = new List<IMember> ();
- List<IMember> interface_members = new List<IMember> ();
-
- refactorer.FindOverridables (cls, class_members, interface_members, false, true);
-
- Dictionary<string, TreeIter> iter_cache = new Dictionary<string,TreeIter> ();
- PopulateTreeView (class_members, iter_cache,
- ImageService.GetPixbuf (MonoDevelop.Ide.Gui.Stock.Class, IconSize.Menu));
- PopulateTreeView (interface_members, iter_cache,
- ImageService.GetPixbuf (MonoDevelop.Ide.Gui.Stock.Interface, IconSize.Menu));
- }
-
- void PopulateTreeView (List<IMember> members, Dictionary<string, TreeIter> iter_cache, Gdk.Pixbuf parent_icon)
- {
- foreach (IMember member in members) {
- TreeIter iter;
- if (!iter_cache.TryGetValue (member.DeclaringType.FullName, out iter)) {
- iter = store.AppendValues (false, parent_icon,
- GetDescriptionString (member.DeclaringType), false, member.DeclaringType);
- iter_cache [member.DeclaringType.FullName] = iter;
- }
-
- store.AppendValues (iter, false,
- ImageService.GetPixbuf (member.StockIcon, IconSize.Menu),
- GetDescriptionString (member), false, member);
- }
- }
-
-#region Event handlers
- void RenderExplicitCheckbox (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
- {
- CellRendererToggle cellToggle = (CellRendererToggle) cell;
- IMember item = (IMember) store.GetValue (iter, colItemIndex);
- bool parent_is_class = false;
-
- // Don't show 'explicit' checkbox for Class/interface rows or class methods
- TreeIter parentIter;
- if (item is IMember && store.IterParent (out parentIter, iter)) {
- IType parentClass = store.GetValue (parentIter, colItemIndex) as IType;
- if (parentClass != null && parentClass.ClassType != ClassType.Interface)
- parent_is_class = true;
- }
-
- if (parent_is_class || item is IType) {
- cellToggle.Visible = false;
- } else {
- cellToggle.Visible = true;
- cellToggle.Active = GetExplicit (iter);
- }
- }
-
- void OnSelectToggled (object o, ToggledArgs args)
- {
- TreeIter iter;
- if (!store.GetIterFromString (out iter, args.Path))
- return;
-
- bool old_value = GetChecked (iter);
- store.SetValue (iter, colCheckedIndex, !old_value);
-
- TreeIter parent;
- if (store.IterParent (out parent, iter)) {
- // Member(method/property/etc) row clicked
- // Set the parent's 'checked' state according to the children's state
- bool all_children_checked = true;
- foreach (TreeIter child in GetAllNodes (parent, false)) {
- if (!GetChecked (child)) {
- all_children_checked = false;
- break;
- }
- }
-
- store.SetValue (parent, colCheckedIndex, all_children_checked);
- } else {
- // Mark children's state to match parent's checked state
- foreach (TreeIter child in GetAllNodes (iter, false))
- store.SetValue (child, colCheckedIndex, !old_value);
- }
- UpdateOKButton ();
- }
-
- void OnExplicitToggled (object o, ToggledArgs args)
- {
- TreeIter iter;
- if (!store.GetIterFromString (out iter, args.Path))
- return;
-
- store.SetValue (iter, colExplicitIndex, !GetExplicit (iter));
- }
-
- void OnCancelClicked (object sender, EventArgs e)
- {
- ((Widget) this).Destroy ();
- }
-
- void UpdateOKButton ()
- {
- bool atleast_one_checked = false;
- foreach (TreeIter iter in GetAllNodes (TreeIter.Zero, true)) {
- if (GetChecked (iter)) {
- atleast_one_checked = true;
- break;
- }
- }
- buttonOk.Sensitive = atleast_one_checked;
- }
-
- void OnOKClicked (object sender, EventArgs e)
- {
- try {
- StringBuilder code = new StringBuilder ();
- CodeGenerator generator = CodeGenerator.CreateGenerator (editor.Editor.Document.MimeType, editor.Editor.TabsToSpaces, editor.Editor.Options.TabSize, editor.Editor.EolMarker);
- IType declaringType = editor.GetType (cls.Location.Line, cls.Location.Column) ?? cls;
-
- foreach (KeyValuePair<IType, IEnumerable<TreeIter>> kvp in GetAllClasses ()) {
- if (code.Length > 0) {
- code.AppendLine ();
- code.AppendLine ();
- }
-
- //update the target class so that new members don't get inserted in weird locations
- StringBuilder curImpl = new StringBuilder ();
- foreach (var pair in YieldImpls (kvp)) {
- if (curImpl.Length > 0) {
- curImpl.AppendLine ();
- curImpl.AppendLine ();
- }
- curImpl.Append (generator.CreateMemberImplementation (declaringType, pair.Key, pair.Value != null).Code);
- }
- if (kvp.Key.ClassType == ClassType.Interface) {
- code.Append (generator.WrapInRegions (kvp.Key.Name + " implementation", curImpl.ToString ()));
- } else {
- code.Append (curImpl.ToString ());
- }
- }
-
- var mode = new InsertionCursorEditMode (editor.Editor.Parent, CodeGenerationService.GetInsertionPoints (editor, this.cls));
- var helpWindow = new ModeHelpWindow ();
- helpWindow.Shown += (s, a) => DesktopService.RemoveWindowShadow (helpWindow);
- helpWindow.TransientFor = IdeApp.Workbench.RootWindow;
- helpWindow.TitleText = GettextCatalog.GetString ("<b>Override -- Targeting</b>");
- helpWindow.Items.Add (new KeyValuePair<string, string> (GettextCatalog.GetString ("<b>Key</b>"), GettextCatalog.GetString ("<b>Behavior</b>")));
- helpWindow.Items.Add (new KeyValuePair<string, string> (GettextCatalog.GetString ("<b>Up</b>"), GettextCatalog.GetString ("Move to <b>previous</b> target point.")));
- helpWindow.Items.Add (new KeyValuePair<string, string> (GettextCatalog.GetString ("<b>Down</b>"), GettextCatalog.GetString ("Move to <b>next</b> target point.")));
- helpWindow.Items.Add (new KeyValuePair<string, string> (GettextCatalog.GetString ("<b>Enter</b>"), GettextCatalog.GetString ("<b>Declare overrides</b> at target point.")));
- helpWindow.Items.Add (new KeyValuePair<string, string> (GettextCatalog.GetString ("<b>Esc</b>"), GettextCatalog.GetString ("<b>Cancel</b> this refactoring.")));
- mode.HelpWindow = helpWindow;
- mode.CurIndex = mode.InsertionPoints.Count - 1;
- mode.StartMode ();
- mode.Exited += delegate(object s, InsertionCursorEventArgs args) {
- if (args.Success)
- args.InsertionPoint.Insert (editor.Editor, code.ToString ());
- };
-
- } finally {
- ((Widget) this).Destroy ();
- }
- }
-#endregion
-
-#region Helper methods
-
- IEnumerable<KeyValuePair<IType, IEnumerable<TreeIter>>> GetAllClasses ()
- {
- TreeIter iter;
- if (!store.GetIterFirst (out iter))
- yield break;
- do {
- TreeIter firstMember;
- if (store.IterChildren (out firstMember, iter)) {
- List<TreeIter> children = new List<TreeIter> (GetCheckedSiblings (firstMember));
- if (children.Count > 0)
- yield return new KeyValuePair<IType, IEnumerable<TreeIter>> (
- (IType) store.GetValue (iter, colItemIndex),
- children);
- }
- } while (store.IterNext (ref iter));
- }
-
- IEnumerable<TreeIter> GetCheckedSiblings (TreeIter firstMember)
- {
- TreeIter iter = firstMember;
- do {
- if (GetChecked (iter)) {
- yield return iter;
- }
- } while (store.IterNext (ref iter));
- }
-
- IEnumerable<KeyValuePair<IMember, IReturnType>> YieldImpls (KeyValuePair<IType, IEnumerable<TreeIter>> kvp)
- {
- bool is_interface = kvp.Key.ClassType == ClassType.Interface;
- IReturnType privateImplementationType = new DomReturnType (kvp.Key.FullName);
- foreach (TreeIter memberIter in kvp.Value) {
- yield return new KeyValuePair<IMember, IReturnType> (
- GetIMember (memberIter),
- (is_interface && GetExplicit (memberIter)) ? privateImplementationType : null);
- }
- }
-
- void SelectAll (bool select)
- {
- foreach (TreeIter iter in GetAllNodes (TreeIter.Zero, true))
- store.SetValue (iter, colCheckedIndex, select);
- UpdateOKButton ();
- }
-
- bool GetChecked (TreeIter iter)
- {
- return (bool) store.GetValue (iter, colCheckedIndex);
- }
-
- IMember GetIMember (TreeIter iter)
- {
- return (IMember) store.GetValue (iter, colItemIndex);
- }
-
- bool GetExplicit (TreeIter iter)
- {
- return (bool) store.GetValue (iter, colExplicitIndex);
- }
-
- IEnumerable<TreeIter> GetAllNodes (TreeIter parent, bool iter_children)
- {
- TreeIter child;
- if (parent.Equals (TreeIter.Zero)) {
- if (!store.IterChildren (out child))
- yield break;
- } else if (!store.IterChildren (out child, parent)) {
- yield break;
- }
-
- do {
- yield return child;
- if (iter_children && store.IterHasChild (child)) {
- TreeIter iter;
- if (store.IterChildren (out iter, child)) {
- do {
- yield return iter;
- } while (store.IterNext (ref iter));
- }
- }
- } while (store.IterNext (ref child));
- }
-
- string GetDescriptionString (IType klass)
- {
- return String.Format ("{0} ({1})", ambience.GetString (klass, default_conversion_flags), klass.Namespace);
- }
-
- string GetDescriptionString (IMember member)
- {
- string sig = null;
- OutputFlags flags = default_conversion_flags & ~OutputFlags.IncludeReturnType;
-
- sig = ambience.GetString (member, flags);
-
- if (sig == null)
- throw new InvalidOperationException (String.Format ("Unsupported language member type: {0}", member.GetType ()));
-
- return sig + " : " + ambience.GetString (member.ReturnType, default_conversion_flags);
- }
-
-#endregion
-
- }
-
-}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringOperation.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringOperation.cs
deleted file mode 100644
index 444970df71..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringOperation.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// RefactoringOperation.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-using MonoDevelop.Core;
-using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-
-namespace MonoDevelop.Refactoring
-{
- public abstract class RefactoringOperation
- {
- public string Name {
- get;
- set;
- }
-
- public bool IsBreakingAPI {
- get;
- set;
- }
-
- public virtual string AccelKey {
- get {
- return "";
- }
- }
- public virtual string GetMenuDescription (RefactoringOptions options)
- {
- return Name;
- }
-
- public virtual bool IsValid (RefactoringOptions options)
- {
- return true;
- }
-
- public virtual List<Change> PerformChanges (RefactoringOptions options, object properties)
- {
- throw new System.NotImplementedException ();
- }
-
- public virtual void Run (RefactoringOptions options)
- {
- var changes = PerformChanges (options, null);
- var monitor = IdeApp.Workbench.ProgressMonitors.GetBackgroundProgressMonitor (Name, null);
- RefactoringService.AcceptChanges (monitor, changes);
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringOptions.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringOptions.cs
index f0f9af2e6b..2684ff57f9 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringOptions.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringOptions.cs
@@ -28,36 +28,32 @@ using MonoDevelop.Ide.Gui;
using System.Text;
using MonoDevelop.Projects.Text;
-using ICSharpCode.NRefactory.CSharp;
using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.CSharp.Resolver;
using MonoDevelop.Core;
using MonoDevelop.Ide.TypeSystem;
-using System.Collections.Generic;
-using System.Linq;
-using ICSharpCode.NRefactory.Semantics;
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
+using MonoDevelop.Ide.Editor;
using System.Threading.Tasks;
+using System.Collections.Immutable;
+using System.Threading;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.Refactoring
{
public class RefactoringOptions
{
- readonly Task<CSharpAstResolver> resolver;
-
- public Document Document {
+ public TextEditor Editor {
get;
private set;
}
-
- public object SelectedItem {
+
+ public DocumentContext DocumentContext {
get;
- set;
+ private set;
}
-
- public ResolveResult ResolveResult {
+
+ public object SelectedItem {
get;
set;
}
@@ -70,43 +66,48 @@ namespace MonoDevelop.Refactoring
public string MimeType {
get {
- return DesktopService.GetMimeTypeForUri (Document.FileName);
+ return DesktopService.GetMimeTypeForUri (DocumentContext.Name);
}
}
- public TextLocation Location {
+ public DocumentLocation Location {
get {
- return new TextLocation (Document.Editor.Caret.Line, Document.Editor.Caret.Column);
+ return Editor.CaretLocation;
}
}
- //public readonly SyntaxTree Unit;
+
public RefactoringOptions ()
{
}
- public RefactoringOptions (Document doc)
+ public RefactoringOptions (MonoDevelop.Ide.Gui.Document doc) : this(doc.Editor, doc)
{
- this.Document = doc;
- if (doc != null && doc.ParsedDocument != null) {
+ }
+
+ public RefactoringOptions (TextEditor editor, DocumentContext doc)
+ {
+ this.DocumentContext = doc;
+ this.Editor = editor;
+ /*if (doc != null && doc.ParsedDocument != null) {
var sharedResolver = doc.GetSharedResolver ();
if (sharedResolver == null)
return;
resolver = sharedResolver;
//Unit = resolver != null ? resolver.RootNode as SyntaxTree : null;
- }
+ }*/
}
- public Mono.TextEditor.TextEditorData GetTextEditorData ()
+ public TextEditor GetTextEditorData ()
{
- return Document.Editor;
+ return Editor;
}
- public static string GetWhitespaces (Document document, int insertionOffset)
+ public static string GetWhitespaces (TextEditor editor, int insertionOffset)
{
StringBuilder result = new StringBuilder ();
- for (int i = insertionOffset; i < document.Editor.Length; i++) {
- char ch = document.Editor.GetCharAt (i);
+ for (int i = insertionOffset; i < editor.Length; i++) {
+ char ch = editor.GetCharAt (i);
if (ch == ' ' || ch == '\t') {
result.Append (ch);
} else {
@@ -115,96 +116,56 @@ namespace MonoDevelop.Refactoring
}
return result.ToString ();
}
-
- public string OutputNode (AstNode node)
- {
- using (var stringWriter = new System.IO.StringWriter ()) {
- var formatter = new TextWriterTokenWriter (stringWriter);
-// formatter.Indentation = indentLevel;
- stringWriter.NewLine = Document.Editor.EolMarker;
-
- var visitor = new CSharpOutputVisitor (formatter, FormattingOptionsFactory.CreateMono ());
- node.AcceptVisitor (visitor);
- return stringWriter.ToString ();
- }
- }
-
- public CodeGenerator CreateCodeGenerator ()
- {
- var result = CodeGenerator.CreateGenerator (Document);
- if (result == null)
- LoggingService.LogError ("Generator can't be generated for : " + Document.Editor.MimeType);
- return result;
- }
-
- public static string GetIndent (Document document, IEntity member)
+
+ public static string GetIndent (TextEditor editor, Microsoft.CodeAnalysis.SyntaxNode member)
{
- return GetWhitespaces (document, document.Editor.Document.LocationToOffset (member.Region.BeginLine, 1));
+ return GetWhitespaces (editor, member.SpanStart);
}
public string GetWhitespaces (int insertionOffset)
{
- return GetWhitespaces (Document, insertionOffset);
- }
-
- public string GetIndent (IEntity member)
- {
- return GetIndent (Document, member);
- }
-//
-// public IReturnType ShortenTypeName (IReturnType fullyQualifiedTypeName)
-// {
-// return Document.ParsedDocument.CompilationUnit.ShortenTypeName (fullyQualifiedTypeName, Document.Editor.Caret.Line, Document.Editor.Caret.Column);
-// }
-//
-// public ParsedDocument ParseDocument ()
-// {
-// return ProjectDomService.Parse (Dom.Project, Document.FileName, Document.Editor.Text);
-// }
-
- public List<string> GetUsedNamespaces ()
- {
- return GetUsedNamespaces (Document, Location);
- }
-
- public static List<string> GetUsedNamespaces (Document doc, TextLocation loc)
- {
- var result = new List<string> ();
- var pf = doc.ParsedDocument.ParsedFile as CSharpUnresolvedFile;
- if (pf == null)
- return result;
- var scope = pf.GetUsingScope (loc);
- if (scope == null)
- return result;
- var resolver = pf.GetResolver (doc.Compilation, loc);
- for (var n = scope; n != null; n = n.Parent) {
- result.Add (n.NamespaceName);
- result.AddRange (n.Usings.Select (u => u.ResolveNamespace (resolver))
- .Where (nr => nr != null)
- .Select (nr => nr.FullName));
- }
- return result;
+ return GetWhitespaces (Editor, insertionOffset);
}
- public ResolveResult Resolve (AstNode node)
+ public Task<ImmutableArray<string>> GetUsedNamespacesAsync (CancellationToken cancellationToken = default (CancellationToken))
{
- if (!resolver.IsCompleted)
- resolver.Wait (2000);
- if (!resolver.IsCompleted)
- return null;
- return resolver.Result.Resolve (node);
+ return GetUsedNamespacesAsync (Editor, DocumentContext, Editor.LocationToOffset (Location));
}
- public AstType CreateShortType (IType fullType)
+ public static async Task<ImmutableArray<string>> GetUsedNamespacesAsync (TextEditor editor, DocumentContext doc, int offset, CancellationToken cancellationToken = default (CancellationToken))
{
- var parsedFile = Document.ParsedDocument.ParsedFile as CSharpUnresolvedFile;
+ if (editor == null)
+ throw new System.ArgumentNullException (nameof (editor));
+ var parsedDocument = doc.ParsedDocument;
+ if (parsedDocument == null)
+ return ImmutableArray<string>.Empty;
+ var result = ImmutableArray<string>.Empty.ToBuilder ();
+ var sm = parsedDocument.GetAst<SemanticModel> ();
+ var node = (await sm.SyntaxTree.GetRootAsync (cancellationToken).ConfigureAwait (false)).FindNode (TextSpan.FromBounds (offset, offset));
- var csResolver = parsedFile.GetResolver (Document.Compilation, Document.Editor.Caret.Location);
+ while (node != null) {
+ var cu = node as CompilationUnitSyntax;
+ if (cu != null) {
+ foreach (var u in cu.Usings) {
+ if (u.Kind () == Microsoft.CodeAnalysis.CSharp.SyntaxKind.UsingDirective)
+ result.Add (u.Name.ToString ());
+ }
+ }
+ var ns = node as NamespaceDeclarationSyntax;
+ if (ns != null) {
+ var name = ns.Name.ToString ();
+ result.Add (name);
+ foreach (var u in ns.Usings) {
+ if (u.Kind () == Microsoft.CodeAnalysis.CSharp.SyntaxKind.UsingDirective)
+ result.Add (u.Name.ToString ());
+ }
+ }
+
+ node = node.Parent;
+ }
- var builder = new ICSharpCode.NRefactory.CSharp.Refactoring.TypeSystemAstBuilder (csResolver);
- return builder.ConvertType (fullType);
+ return result.ToImmutable ();
}
-
// public List<string> GetResolveableNamespaces (RefactoringOptions options, out bool resolveDirect)
// {
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs
index ecfbf2e593..fe722b16b4 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewDialog.cs
@@ -30,10 +30,10 @@ using Gtk;
using Gdk;
using MonoDevelop.Core;
-using Mono.TextEditor;
using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Components;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
using MonoDevelop.Ide.Fonts;
@@ -48,9 +48,9 @@ namespace MonoDevelop.Refactoring
const int objColumn = 2;
const int statusVisibleColumn = 3;
- List<Change> changes;
+ IList<Change> changes;
- public RefactoringPreviewDialog (List<Change> changes)
+ public RefactoringPreviewDialog (IList<Change> changes)
{
this.Build ();
this.changes = changes;
@@ -87,7 +87,7 @@ namespace MonoDevelop.Refactoring
};
buttonOk.Clicked += delegate {
- IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetBackgroundProgressMonitor (this.Title, null);
+ ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetBackgroundProgressMonitor (this.Title, null);
RefactoringService.AcceptChanges (monitor, changes);
Destroy ();
@@ -107,9 +107,9 @@ namespace MonoDevelop.Refactoring
return;
}
- Mono.TextEditor.TextDocument doc = new Mono.TextEditor.TextDocument ();
- doc.Text = Mono.TextEditor.Utils.TextFileUtility.ReadAllText (replaceChange.FileName);
- DocumentLocation loc = doc.OffsetToLocation (replaceChange.Offset);
+ var doc = TextEditorFactory.CreateNewDocument ();
+ doc.Text = TextFileUtility.ReadAllText (replaceChange.FileName);
+ var loc = doc.OffsetToLocation (replaceChange.Offset);
string text = string.Format (GettextCatalog.GetString ("(Line:{0}, Column:{1})"), loc.Line, loc.Column);
if (treeviewPreview.Selection.IterIsSelected (iter)) {
@@ -136,21 +136,21 @@ namespace MonoDevelop.Refactoring
return;
var openDocument = IdeApp.Workbench.GetDocument (replaceChange.FileName);
- Mono.TextEditor.TextDocument originalDocument = new Mono.TextEditor.TextDocument ();
+ var originalDocument = TextEditorFactory.CreateNewDocument ();
originalDocument.FileName = replaceChange.FileName;
if (openDocument == null) {
- originalDocument.Text = Mono.TextEditor.Utils.TextFileUtility.ReadAllText (replaceChange.FileName);
+ originalDocument.Text = TextFileUtility.ReadAllText (replaceChange.FileName);
} else {
- originalDocument.Text = openDocument.Editor.Document.Text;
+ originalDocument.Text = openDocument.Editor.Text;
}
- Mono.TextEditor.TextDocument changedDocument = new Mono.TextEditor.TextDocument ();
+ var changedDocument = TextEditorFactory.CreateNewDocument ();
changedDocument.FileName = replaceChange.FileName;
changedDocument.Text = originalDocument.Text;
- changedDocument.Replace (replaceChange.Offset, replaceChange.RemovedChars, replaceChange.InsertedText);
-
- string diffString = Mono.TextEditor.Utils.Diff.GetDiffString (originalDocument, changedDocument);
+ changedDocument.ReplaceText (replaceChange.Offset, replaceChange.RemovedChars, replaceChange.InsertedText);
+
+ string diffString = originalDocument.GetDiffAsString (changedDocument);
cellRendererDiff.InitCell (treeviewPreview, true, diffString, replaceChange.FileName);
} catch (Exception e) {
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs
index 9e18efff67..5204352316 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs
@@ -33,107 +33,53 @@ using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using System.Linq;
using MonoDevelop.AnalysisCore;
-using ICSharpCode.NRefactory;
using System.Threading.Tasks;
using System.Threading;
using MonoDevelop.CodeActions;
using MonoDevelop.CodeIssues;
-using Mono.TextEditor;
using MonoDevelop.Ide.TypeSystem;
using System.Diagnostics;
using MonoDevelop.Core.Instrumentation;
+using MonoDevelop.Ide.Editor;
+using Microsoft.CodeAnalysis.Options;
using MonoDevelop.Ide;
+using MonoDevelop.Projects;
+using Microsoft.CodeAnalysis;
+using System.Collections.Immutable;
namespace MonoDevelop.Refactoring
-{
+{
public static class RefactoringService
{
- static readonly List<RefactoringOperation> refactorings = new List<RefactoringOperation>();
- static readonly List<CodeActionProvider> contextActions = new List<CodeActionProvider> ();
- static readonly List<CodeIssueProvider> inspectors = new List<CodeIssueProvider> ();
-
- public static IEnumerable<CodeActionProvider> ContextAddinNodes {
- get {
- return contextActions;
- }
- }
-
- public static void AddProvider (CodeActionProvider provider)
- {
- contextActions.Add (provider);
- }
-
- public static void AddProvider (CodeIssueProvider provider)
- {
- inspectors.Add (provider);
- }
-
- public static List<CodeIssueProvider> Inspectors {
- get {
- return inspectors;
- }
- }
+ internal static Func<TextEditor, DocumentContext, OptionSet> OptionSetCreation;
+ static ImmutableList<FindReferencesProvider> findReferencesProvider = ImmutableList<FindReferencesProvider>.Empty;
+ static List<JumpToDeclarationHandler> jumpToDeclarationHandler = new List<JumpToDeclarationHandler> ();
static RefactoringService ()
{
- AddinManager.AddExtensionNodeHandler ("/MonoDevelop/Refactoring/Refactorings", delegate(object sender, ExtensionNodeEventArgs args) {
+ AddinManager.AddExtensionNodeHandler ("/MonoDevelop/Refactoring/FindReferencesProvider", delegate(object sender, ExtensionNodeEventArgs args) {
+ var provider = (FindReferencesProvider) args.ExtensionObject;
switch (args.Change) {
- case ExtensionChange.Add:
- refactorings.Add ((RefactoringOperation)args.ExtensionObject);
+ case ExtensionChange.Add:
+ findReferencesProvider.Add (provider);
break;
- case ExtensionChange.Remove:
- refactorings.Remove ((RefactoringOperation)args.ExtensionObject);
+ case ExtensionChange.Remove:
+ findReferencesProvider.Remove (provider);
break;
}
});
-
- AddinManager.AddExtensionNodeHandler ("/MonoDevelop/Refactoring/CodeActions", delegate(object sender, ExtensionNodeEventArgs args) {
+ AddinManager.AddExtensionNodeHandler ("/MonoDevelop/Refactoring/JumpToDeclarationHandler", delegate(object sender, ExtensionNodeEventArgs args) {
+ var provider = (JumpToDeclarationHandler) args.ExtensionObject;
switch (args.Change) {
- case ExtensionChange.Add:
- contextActions.Add (((CodeActionAddinNode)args.ExtensionNode).Action);
+ case ExtensionChange.Add:
+ jumpToDeclarationHandler.Add (provider);
break;
- case ExtensionChange.Remove:
- contextActions.Remove (((CodeActionAddinNode)args.ExtensionNode).Action);
+ case ExtensionChange.Remove:
+ jumpToDeclarationHandler.Remove (provider);
break;
}
});
-
- AddinManager.AddExtensionNodeHandler ("/MonoDevelop/Refactoring/CodeActionSource", delegate(object sender, ExtensionNodeEventArgs args) {
- switch (args.Change) {
- case ExtensionChange.Add:
- contextActions.AddRange (((ICodeActionProviderSource)args.ExtensionObject).GetProviders ());
- break;
- }
- });
-
- AddinManager.AddExtensionNodeHandler ("/MonoDevelop/Refactoring/CodeIssues", delegate(object sender, ExtensionNodeEventArgs args) {
- switch (args.Change) {
- case ExtensionChange.Add:
- inspectors.Add (((CodeIssueAddinNode)args.ExtensionNode).Inspector);
- break;
- case ExtensionChange.Remove:
- inspectors.Remove (((CodeIssueAddinNode)args.ExtensionNode).Inspector);
- break;
- }
- });
-
- AddinManager.AddExtensionNodeHandler ("/MonoDevelop/Refactoring/CodeIssueSource", delegate(object sender, ExtensionNodeEventArgs args) {
- switch (args.Change) {
- case ExtensionChange.Add:
- var source = (ICodeIssueProviderSource)args.ExtensionObject;
- var providers = source.GetProviders ();
- inspectors.AddRange (providers);
- break;
- }
- });
-
- }
-
- public static IEnumerable<RefactoringOperation> Refactorings {
- get {
- return refactorings;
- }
}
class RenameHandler
@@ -157,238 +103,207 @@ namespace MonoDevelop.Refactoring
}
}
- public static void AcceptChanges (IProgressMonitor monitor, List<Change> changes)
+ public static void AcceptChanges (ProgressMonitor monitor, IList<Change> changes)
{
AcceptChanges (monitor, changes, MonoDevelop.Ide.TextFileProvider.Instance);
}
-
- public static void AcceptChanges (IProgressMonitor monitor, List<Change> changes, MonoDevelop.Projects.Text.ITextFileProvider fileProvider)
+
+ public static async Task RoslynJumpToDeclaration (ISymbol symbol, Projects.Project hintProject = null, CancellationToken token = default(CancellationToken))
{
- var rctx = new RefactoringOptions (null);
+ var result = await TryJumpToDeclarationAsync (symbol.GetDocumentationCommentId (), hintProject, token).ConfigureAwait (false);
+ if (!result) {
+ await Runtime.RunInMainThread (delegate {
+ IdeApp.ProjectOperations.JumpToDeclaration (symbol, hintProject);
+ });
+ }
+ }
+
+ public static void AcceptChanges (ProgressMonitor monitor, IList<Change> changes, MonoDevelop.Ide.ITextFileProvider fileProvider)
+ {
+ var rctx = new RefactoringOptions (null, null);
var handler = new RenameHandler (changes);
FileService.FileRenamed += handler.FileRename;
var fileNames = new HashSet<FilePath> ();
- for (int i = 0; i < changes.Count; i++) {
- changes[i].PerformChange (monitor, rctx);
- var replaceChange = changes[i] as TextReplaceChange;
- if (replaceChange == null)
- continue;
- for (int j = i + 1; j < changes.Count; j++) {
- var change = changes[j] as TextReplaceChange;
+ var ws = TypeSystemService.Workspace as MonoDevelopWorkspace;
+ string originalName;
+ int originalOffset;
+ try {
+ for (int i = 0; i < changes.Count; i++) {
+ var change = changes [i] as TextReplaceChange;
if (change == null)
continue;
- fileNames.Add (change.FileName);
- if (replaceChange.Offset >= 0 && change.Offset >= 0 && replaceChange.FileName == change.FileName) {
- if (replaceChange.Offset < change.Offset) {
- change.Offset -= replaceChange.RemovedChars;
- if (!string.IsNullOrEmpty (replaceChange.InsertedText))
- change.Offset += replaceChange.InsertedText.Length;
- } else if (replaceChange.Offset < change.Offset + change.RemovedChars) {
- change.RemovedChars = Math.Max (0, change.RemovedChars - replaceChange.RemovedChars);
- change.Offset = replaceChange.Offset + (!string.IsNullOrEmpty (replaceChange.InsertedText) ? replaceChange.InsertedText.Length : 0);
- }
+
+ if (ws.TryGetOriginalFileFromProjection (change.FileName, change.Offset, out originalName, out originalOffset)) {
+ fileNames.Add (change.FileName);
+ change.FileName = originalName;
+ change.Offset = originalOffset;
}
}
- }
- FileService.NotifyFilesChanged (fileNames);
- FileService.FileRenamed -= handler.FileRename;
- TextReplaceChange.FinishRefactoringOperation ();
- }
-
- public static IEnumerable<CodeIssueProvider> GetInspectors (string mimeType)
- {
- return inspectors.Where (i => i.MimeType == mimeType);
- }
+ if (changes.All (x => x is TextReplaceChange)) {
+ List<Change> newChanges = new List<Change> (changes);
+ newChanges.Sort ((Change x, Change y) => ((TextReplaceChange)x).Offset.CompareTo (((TextReplaceChange)y).Offset));
+ changes = newChanges;
+ }
- static Stopwatch validActionsWatch = new Stopwatch ();
- static Stopwatch actionWatch = new Stopwatch ();
- public static IEnumerable<CodeAction> GetValidActions (Document doc, TextLocation loc, CancellationToken cancellationToken = default (CancellationToken))
- {
- var editor = doc.Editor;
- string disabledNodes = editor != null ? PropertyService.Get ("ContextActions." + editor.MimeType, "") ?? "" : "";
- var result = new List<CodeAction> ();
- var timer = InstrumentationService.CreateTimerCounter ("Source analysis background task", "Source analysis");
- timer.BeginTiming ();
- validActionsWatch.Restart ();
- var timeTable = new Dictionary<CodeActionProvider, long> ();
- try {
- var parsedDocument = doc.ParsedDocument;
- if (editor != null && parsedDocument != null && parsedDocument.CreateRefactoringContext != null) {
- var ctx = parsedDocument.CreateRefactoringContext (doc, cancellationToken);
- if (ctx != null) {
- foreach (var provider in contextActions.Where (fix =>
- fix.MimeType == editor.MimeType &&
- disabledNodes.IndexOf (fix.IdString, StringComparison.Ordinal) < 0))
- {
- try {
- actionWatch.Restart ();
- result.AddRange (provider.GetActions (doc, ctx, loc, cancellationToken));
- actionWatch.Stop ();
- timeTable[provider] = actionWatch.ElapsedMilliseconds;
- } catch (Exception ex) {
- LoggingService.LogError ("Error in context action provider " + provider.Title, ex);
+ for (int i = 0; i < changes.Count; i++) {
+ changes [i].PerformChange (monitor, rctx);
+ var replaceChange = changes [i] as TextReplaceChange;
+ if (replaceChange == null)
+ continue;
+
+ for (int j = i + 1; j < changes.Count; j++) {
+ var change = changes [j] as TextReplaceChange;
+ if (change == null)
+ continue;
+
+ fileNames.Add (change.FileName);
+
+ if (replaceChange.Offset >= 0 && change.Offset >= 0 && replaceChange.FileName == change.FileName) {
+ if (replaceChange.Offset < change.Offset) {
+ change.Offset -= replaceChange.RemovedChars;
+ if (!string.IsNullOrEmpty (replaceChange.InsertedText))
+ change.Offset += replaceChange.InsertedText.Length;
+ } else if (replaceChange.Offset < change.Offset + change.RemovedChars) {
+ change.RemovedChars = Math.Max (0, change.RemovedChars - replaceChange.RemovedChars);
+ change.Offset = replaceChange.Offset + (!string.IsNullOrEmpty (replaceChange.InsertedText) ? replaceChange.InsertedText.Length : 0);
}
}
}
}
- } catch (Exception ex) {
- LoggingService.LogError ("Error in analysis service", ex);
- } finally {
- timer.EndTiming ();
- validActionsWatch.Stop ();
- if (validActionsWatch.ElapsedMilliseconds > 1000) {
- LoggingService.LogWarning ("Warning slow edit action update.");
- foreach (var pair in timeTable) {
- if (pair.Value > 50)
- LoggingService.LogInfo ("ACTION '" + pair.Key.Title + "' took " + pair.Value +"ms");
+
+ foreach (var renameChange in changes.OfType<RenameFileChange> ()) {
+ if (fileNames.Contains (renameChange.OldName)) {
+ fileNames.Remove (renameChange.OldName);
+ fileNames.Add (renameChange.NewName);
}
}
- }
- return (IEnumerable<CodeAction>)result;
- }
- public static void QueueQuickFixAnalysis (Document doc, TextLocation loc, CancellationToken token, Action<List<CodeAction>> callback)
- {
- var ext = doc.GetContent<MonoDevelop.AnalysisCore.Gui.ResultsEditorExtension> ();
- var issues = ext != null ? ext.GetResultsAtOffset (doc.Editor.LocationToOffset (loc), token).OrderBy (r => r.Level).ToList () : new List<Result> ();
-
- ThreadPool.QueueUserWorkItem (delegate {
- try {
- var result = new List<CodeAction> ();
- foreach (var r in issues) {
- if (token.IsCancellationRequested)
- return;
- var fresult = r as FixableResult;
- if (fresult == null)
- continue;
- foreach (var action in FixOperationsHandler.GetActions (doc, fresult)) {
- result.Add (new AnalysisContextActionProvider.AnalysisCodeAction (action, r) {
- DocumentRegion = action.DocumentRegion
- });
- }
- }
- result.AddRange (GetValidActions (doc, loc));
- callback (result);
- } catch (Exception ex) {
- LoggingService.LogError ("Error in analysis service", ex);
+ foreach (var doc in IdeApp.Workbench.Documents) {
+ fileNames.Remove (doc.FileName);
}
- });
- }
- public static IList<CodeAction> ApplyFixes (IEnumerable<CodeAction> fixes, IRefactoringContext refactoringContext)
- {
- if (fixes == null)
- throw new ArgumentNullException ("fixes");
- if (refactoringContext == null)
- throw new ArgumentNullException ("refactoringContext");
- var allFixes = fixes as IList<CodeAction> ?? fixes.ToArray ();
- if (allFixes.Count == 0)
- return new List<CodeAction> ();
-
- var scriptProvider = refactoringContext as IRefactoringContext;
- if (scriptProvider == null) {
- return RunAll (allFixes, refactoringContext, null);
- }
- using (var script = scriptProvider.CreateScript ()) {
- return RunAll (allFixes, refactoringContext, script);
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while applying refactoring changes", e);
+ } finally {
+ FileService.NotifyFilesChanged (fileNames);
+ FileService.FileRenamed -= handler.FileRename;
+ TextReplaceChange.FinishRefactoringOperation ();
}
}
- const string EnableRefactorings = "RefactoringSettings.EnableRefactorings";
+ // public static void QueueQuickFixAnalysis (Document doc, TextLocation loc, CancellationToken token, Action<List<CodeAction>> callback)
+ // {
+ // var ext = doc.GetContent<MonoDevelop.AnalysisCore.Gui.ResultsEditorExtension> ();
+ // var issues = ext != null ? ext.GetResultsAtOffset (doc.Editor.LocationToOffset (loc), token).OrderBy (r => r.Level).ToList () : new List<Result> ();
+ //
+ // ThreadPool.QueueUserWorkItem (delegate {
+ // try {
+ // var result = new List<CodeAction> ();
+ // foreach (var r in issues) {
+ // if (token.IsCancellationRequested)
+ // return;
+ // var fresult = r as FixableResult;
+ // if (fresult == null)
+ // continue;
+ //// foreach (var action in FixOperationsHandler.GetActions (doc, fresult)) {
+ //// result.Add (new AnalysisContextActionProvider.AnalysisCodeAction (action, r) {
+ //// DocumentRegion = action.DocumentRegion
+ //// });
+ //// }
+ // }
+ // result.AddRange (GetValidActions (doc, loc).Result);
+ // callback (result);
+ // } catch (Exception ex) {
+ // LoggingService.LogError ("Error in analysis service", ex);
+ // }
+ // });
+ // }
- internal static bool CheckUserSettings()
+ public static MonoDevelop.Ide.Editor.DocumentLocation GetCorrectResolveLocation (IReadonlyTextDocument editor, MonoDevelop.Ide.Editor.DocumentLocation location)
{
- var hasRefactoringSettings = IdeApp.ProjectOperations.CurrentSelectedSolution == null ||
- IdeApp.ProjectOperations.CurrentSelectedSolution.UserProperties.HasValue (EnableRefactorings);
- if (!hasRefactoringSettings) {
- var useRefactoringsButton = new AlertButton (GettextCatalog.GetString("Use refactorings on this solution"));
- var text = GettextCatalog.GetString (
-@"WARNING: The Xamarin Studio refactoring operations do not yet support C# 6.
-
-You may continue to use refactoring operations with C# 6, however you should check the results carefully to make sure that they have not made incorrect changes to your code. In particular, the ""?."" null propagating dereference will be changed to ""."", a simple dereference, which can cause unexpected NullReferenceExceptions at runtime.");
- var message = new QuestionMessage (text);
- message.Buttons.Add (useRefactoringsButton);
- message.Buttons.Add (AlertButton.Cancel);
- message.Icon = Gtk.Stock.DialogWarning;
- message.DefaultButton = 1;
+ if (editor == null || location.Column == 1)
+ return location;
- var result = MessageService.AskQuestion (message);
- if (result == AlertButton.Cancel)
- return false;
- ShowFixes = result == useRefactoringsButton;
- }
- return ShowFixes;
+ /*if (editor is TextEditor) {
+ if (((TextEditor)editor).IsSomethingSelected)
+ return ((TextEditor)editor).SelectionRegion.Begin;
+ }*/
+ var line = editor.GetLine (location.Line);
+ if (line == null || location.Column > line.LengthIncludingDelimiter)
+ return location;
+ int offset = editor.LocationToOffset (location);
+ if (offset > 0 && !char.IsLetterOrDigit (editor.GetCharAt (offset)) && char.IsLetterOrDigit (editor.GetCharAt (offset - 1)))
+ return new MonoDevelop.Ide.Editor.DocumentLocation (location.Line, location.Column - 1);
+ return location;
}
- internal static bool ShowFixes {
- get {
- if (Ide.IdeApp.ProjectOperations.CurrentSelectedSolution != null) {
- var hasRefactoringSettings = IdeApp.ProjectOperations.CurrentSelectedSolution.UserProperties.HasValue (EnableRefactorings);
- return !hasRefactoringSettings || IdeApp.ProjectOperations.CurrentSelectedSolution.UserProperties.GetValue<bool> (EnableRefactorings);
+ public static async Task FindReferencesAsync (string documentIdString, Projects.Project hintProject = null)
+ {
+ if (hintProject == null)
+ hintProject = IdeApp.Workbench.ActiveDocument?.Project;
+ var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true);
+ try {
+ foreach (var provider in findReferencesProvider) {
+ try {
+ foreach (var result in await provider.FindReferences (documentIdString, hintProject, monitor.CancellationToken)) {
+ monitor.ReportResult (result);
+ }
+ } catch (Exception ex) {
+ if (monitor != null)
+ monitor.ReportError ("Error finding references", ex);
+ LoggingService.LogError ("Error finding references", ex);
+ findReferencesProvider = findReferencesProvider.Remove (provider);
+ }
}
- return true;
- }
- set {
- IdeApp.ProjectOperations.CurrentSelectedSolution.UserProperties.SetValue (EnableRefactorings, value);
- IdeApp.ProjectOperations.CurrentSelectedSolution.SaveUserProperties ();
+ } finally {
+ if (monitor != null)
+ monitor.Dispose ();
}
}
-
- public static void ApplyFix (CodeAction action, IRefactoringContext context)
+ public static async Task FindAllReferencesAsync (string documentIdString, Projects.Project hintProject = null)
{
- if (!CheckUserSettings ())
- return;
- using (var script = context.CreateScript ()) {
- action.Run (context, script);
- }
- }
+ if (hintProject == null)
+ hintProject = IdeApp.Workbench.ActiveDocument?.Project;
+ var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true);
+ try {
+ foreach (var provider in findReferencesProvider) {
+ try {
+ foreach (var result in await provider.FindAllReferences (documentIdString, hintProject, monitor.CancellationToken)) {
+ monitor.ReportResult (result);
+ }
+ } catch (OperationCanceledException) {
- static List<CodeAction> RunAll (IEnumerable<CodeAction> allFixes, IRefactoringContext refactoringContext, object script)
- {
- var appliedFixes = new List<CodeAction> ();
- foreach (var fix in allFixes) {
- fix.Run (refactoringContext, script);
- appliedFixes.Add (fix);
+ } catch (Exception ex) {
+ if (monitor != null)
+ monitor.ReportError ("Error finding references", ex);
+ LoggingService.LogError ("Error finding references", ex);
+ findReferencesProvider = findReferencesProvider.Remove (provider);
+ }
+ }
+ } finally {
+ if (monitor != null)
+ monitor.Dispose ();
}
- return appliedFixes;
}
- public static DocumentLocation GetCorrectResolveLocation (Document doc, DocumentLocation location)
+ public static async Task<bool> TryJumpToDeclarationAsync (string documentIdString, Projects.Project hintProject = null, CancellationToken token = default(CancellationToken))
{
- if (doc == null)
- return location;
- var editor = doc.Editor;
- if (editor == null || location.Column == 1)
- return location;
-
- if (editor.IsSomethingSelected)
- return editor.MainSelection.Start;
-
- var line = editor.GetLine (location.Line);
- if (line == null || location.Column > line.LengthIncludingDelimiter)
- return location;
- int offset = editor.LocationToOffset (location);
- if (offset > 0 && !char.IsLetterOrDigit (doc.Editor.GetCharAt (offset)) && char.IsLetterOrDigit (doc.Editor.GetCharAt (offset - 1)))
- return new DocumentLocation (location.Line, location.Column - 1);
- return location;
- }
-
- static readonly CodeAnalysisBatchRunner runner = new CodeAnalysisBatchRunner();
+ if (hintProject == null)
+ hintProject = IdeApp.Workbench.ActiveDocument?.Project;
+ for (int i = 0; i < jumpToDeclarationHandler.Count; i++) {
+ var handler = jumpToDeclarationHandler [i];
+ try {
+ if (await handler.TryJumpToDeclarationAsync (documentIdString, hintProject, token))
+ return true;
+ } catch (OperationCanceledException) {
+ } catch (Exception ex) {
+ LoggingService.LogError ("Error jumping to declaration", ex);
+ }
+ }
- /// <summary>
- /// Queues a code analysis job.
- /// </summary>
- /// <param name="job">The job to queue.</param>
- /// <param name="progressMessage">
- /// The message used for a progress monitor, or null if no progress monitor should be used.
- /// </param>
- public static IJobContext QueueCodeIssueAnalysis(IAnalysisJob job, string progressMessage = null)
- {
- if (progressMessage != null)
- job = new ProgressMonitorWrapperJob (job, progressMessage);
- return runner.QueueJob (job);
+ return false;
}
}
-}
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringSymbolInfo.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringSymbolInfo.cs
new file mode 100644
index 0000000000..918e9e7713
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringSymbolInfo.cs
@@ -0,0 +1,129 @@
+//
+// RefactoringSymbolInfo.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Refactoring;
+using MonoDevelop.Ide;
+using Microsoft.CodeAnalysis;
+using System.Collections.Immutable;
+using System.Threading.Tasks;
+using MonoDevelop.Ide.Editor;
+using System.Threading;
+using System;
+using System.Linq;
+using Microsoft.CodeAnalysis.CSharp;
+
+namespace MonoDevelop.Refactoring
+{
+
+ class RefactoringSymbolInfo
+ {
+ public readonly static RefactoringSymbolInfo Empty = new RefactoringSymbolInfo (new SymbolInfo ());
+
+ SymbolInfo symbolInfo;
+
+ public ISymbol Symbol
+ {
+ get
+ {
+ return symbolInfo.Symbol;
+ }
+ }
+
+ public ImmutableArray<ISymbol> CandidateSymbols
+ {
+ get
+ {
+ return symbolInfo.CandidateSymbols;
+ }
+ }
+
+ public ISymbol DeclaredSymbol
+ {
+ get;
+ internal set;
+ }
+
+ public SyntaxNode Node { get; private set; }
+ public SemanticModel Model { get; private set; }
+
+ public RefactoringSymbolInfo (SymbolInfo symbolInfo)
+ {
+ this.symbolInfo = symbolInfo;
+ }
+
+ public static Task<RefactoringSymbolInfo> GetSymbolInfoAsync (DocumentContext document, int offset, CancellationToken cancellationToken = default (CancellationToken))
+ {
+ if (document == null)
+ throw new ArgumentNullException (nameof (document));
+ if (document.AnalysisDocument == null)
+ return Task.FromResult (RefactoringSymbolInfo.Empty);
+
+ if (Runtime.IsMainThread) {//InternalGetSymbolInfoAsync can be CPU heavy, go to ThreadPool if we are on UI thread
+ return Task.Run (() => InternalGetSymbolInfoAsync (document.AnalysisDocument, offset, cancellationToken));
+ } else {
+ return InternalGetSymbolInfoAsync (document.AnalysisDocument, offset, cancellationToken);
+ }
+ }
+
+ public static Task<RefactoringSymbolInfo> GetSymbolInfoAsync (DocumentContext document, TextEditor editor, CancellationToken cancellationToken = default (CancellationToken))
+ {
+ if (editor.IsSomethingSelected) {
+ var selectionRange = editor.SelectionRange;
+ if (editor.GetTextAt (selectionRange).Any (ch => !char.IsLetterOrDigit (ch) && ch !='_')) {
+ return Task.FromResult (RefactoringSymbolInfo.Empty);
+ }
+ return GetSymbolInfoAsync (document, selectionRange.Offset, cancellationToken);
+ }
+ return GetSymbolInfoAsync (document, editor.CaretOffset, cancellationToken);
+ }
+
+ static async Task<RefactoringSymbolInfo> InternalGetSymbolInfoAsync (Microsoft.CodeAnalysis.Document document, int offset, CancellationToken cancellationToken = default (CancellationToken))
+ {
+ var unit = await document.GetSemanticModelAsync (cancellationToken).ConfigureAwait (false);
+ if (unit != null) {
+ var root = await unit.SyntaxTree.GetRootAsync (cancellationToken).ConfigureAwait (false);
+ try {
+ var token = root.FindToken (offset);
+ if (!token.Span.IntersectsWith (offset))
+ return RefactoringSymbolInfo.Empty;
+ var symbol = unit.GetSymbolInfo (token.Parent, cancellationToken);
+ return new RefactoringSymbolInfo (symbol) {
+ DeclaredSymbol = token.IsKind (SyntaxKind.IdentifierToken) ? unit.GetDeclaredSymbol (token.Parent, cancellationToken) : null,
+ Node = token.Parent,
+ Model = unit
+ };
+ } catch (Exception) {
+ return RefactoringSymbolInfo.Empty;
+ }
+ }
+ return RefactoringSymbolInfo.Empty;
+ }
+ }
+
+}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs
deleted file mode 100644
index d89a7c4081..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs
+++ /dev/null
@@ -1,441 +0,0 @@
-//
-// RefactoryCommands.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.Ide.Gui.Content;
-using MonoDevelop.Ide.FindInFiles;
-using MonoDevelop.Ide;
-using System.Linq;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using ICSharpCode.NRefactory.TypeSystem;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.Semantics;
-using MonoDevelop.CodeActions;
-using MonoDevelop.SourceEditor.QuickTasks;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui.Components;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace MonoDevelop.Refactoring
-{
- public enum RefactoryCommands
- {
- CurrentRefactoryOperations,
- GotoDeclaration, // in 'referenced' in IdeViMode.cs as string
- FindReferences,
- FindAllReferences,
- FindDerivedClasses,
- DeclareLocal,
- RemoveUnusedImports,
- SortImports,
- RemoveSortImports,
- ExtractMethod,
- CreateMethod,
- IntroduceConstant,
- IntegrateTemporaryVariable,
- ImportSymbol,
- QuickFix,
- Resolve
- }
-
- public class CurrentRefactoryOperationsHandler : CommandHandler
- {
- protected override void Run (object data)
- {
- var del = (System.Action) data;
- if (del != null)
- del ();
- }
-
- public static ResolveResult GetResolveResult (MonoDevelop.Ide.Gui.Document doc)
- {
- ITextEditorResolver textEditorResolver = doc.GetContent<ITextEditorResolver> ();
- if (textEditorResolver != null)
- return textEditorResolver.GetLanguageItem (doc.Editor.IsSomethingSelected ? doc.Editor.SelectionRange.Offset : doc.Editor.Caret.Offset);
- return null;
- }
-
- public static object GetItem (MonoDevelop.Ide.Gui.Document doc, out ResolveResult resolveResult)
- {
- resolveResult = GetResolveResult (doc);
- if (resolveResult is LocalResolveResult)
- return ((LocalResolveResult)resolveResult).Variable;
- if (resolveResult is MemberResolveResult)
- return ((MemberResolveResult)resolveResult).Member;
- if (resolveResult is MethodGroupResolveResult) {
- var mg = ((MethodGroupResolveResult)resolveResult);
- var method = mg.Methods.FirstOrDefault ();
- if (method == null && mg.GetExtensionMethods ().Any ())
- method = mg.GetExtensionMethods ().First ().FirstOrDefault ();
- return method;
- }
- if (resolveResult is TypeResolveResult)
- return resolveResult.Type;
- if (resolveResult is NamespaceResolveResult)
- return ((NamespaceResolveResult)resolveResult).Namespace;
- if (resolveResult is OperatorResolveResult)
- return ((OperatorResolveResult)resolveResult).UserDefinedOperatorMethod;
- return null;
- }
-
- class JumpTo
- {
- object el;
-
- public JumpTo (object el)
- {
- this.el = el;
- }
-
- public void Run ()
- {
- if (el is IUnresolvedEntity) {
- var e = (IUnresolvedEntity)el;
- IdeApp.Workbench.OpenDocument (e.Region.FileName, e.Region.BeginLine, e.Region.BeginColumn);
- return;
- }
- if (el is IVariable)
- IdeApp.ProjectOperations.JumpToDeclaration ((IVariable)el);
- if (el is INamedElement)
- IdeApp.ProjectOperations.JumpToDeclaration ((INamedElement)el);
- }
- }
-
-
- class GotoBase
- {
- IEntity item;
-
- public GotoBase (IEntity item)
- {
- this.item = item;
- }
-
- public void Run ()
- {
- var cls = item as ITypeDefinition;
- if (cls != null && cls.DirectBaseTypes != null) {
- foreach (var bt in cls.DirectBaseTypes) {
- var def = bt.GetDefinition ();
- if (def != null && def.Kind != TypeKind.Interface) {
- IdeApp.ProjectOperations.JumpToDeclaration (def);
- return;
- }
- }
- }
-
- var method = item as IMember;
- if (method != null) {
- var baseMethod = InheritanceHelper.GetBaseMember (method);
- if (baseMethod != null) {
- IdeApp.ProjectOperations.JumpToDeclaration (baseMethod);
- }
- return;
- }
- }
- }
-
- class FindRefs
- {
- object obj;
- bool allOverloads;
- public FindRefs (object obj, bool all)
- {
- this.obj = obj;
- this.allOverloads = all;
- }
-
- public void Run ()
- {
- if (allOverloads) {
- FindAllReferencesHandler.FindRefs (obj);
- } else {
- FindReferencesHandler.FindRefs (obj);
- }
- }
- }
-
- class FindDerivedClasses
- {
- ITypeDefinition type;
-
- public FindDerivedClasses (ITypeDefinition type)
- {
- this.type = type;
- }
-
- public void Run ()
- {
- FindDerivedClassesHandler.FindDerivedClasses (type);
- }
- }
-
- class RefactoringDocumentInfo
- {
- public IEnumerable<CodeAction> validActions;
- public MonoDevelop.Ide.TypeSystem.ParsedDocument lastDocument;
-
- public override string ToString ()
- {
- return string.Format ("[RefactoringDocumentInfo: #validActions={0}, lastDocument={1}]", validActions != null ? validActions.Count ().ToString () : "null", lastDocument);
- }
- }
-
-
- DocumentLocation lastLocation;
-
- static bool HasOverloads (Solution solution, object item)
- {
- var member = item as IMember;
- if (member != null && member.ImplementedInterfaceMembers.Any ())
- return true;
- var method = item as IMethod;
- if (method == null)
- return false;
- return method.DeclaringType.GetMethods (m => m.Name == method.Name).Count () > 1;
- }
-
-
- protected override void Update (CommandArrayInfo ainfo)
- {
- var doc = IdeApp.Workbench.ActiveDocument;
- if (doc == null || doc.FileName == FilePath.Null)
- return;
-
- var parsedDocument = doc.ParsedDocument;
- if (parsedDocument == null || parsedDocument.IsInvalid)
- return;
-
- ResolveResult resolveResult;
- object item = GetItem (doc, out resolveResult);
- bool added = false;
-
- var options = new RefactoringOptions (doc) {
- ResolveResult = resolveResult,
- SelectedItem = item
- };
-
- var ciset = new CommandInfoSet ();
- ciset.Text = GettextCatalog.GetString ("Refactor");
-
- bool canRename;
- if (item is IVariable || item is IParameter) {
- canRename = true;
- } else if (item is ITypeDefinition) {
- canRename = !((ITypeDefinition)item).Region.IsEmpty;
- } else if (item is IType) {
- canRename = ((IType)item).Kind == TypeKind.TypeParameter;
- } else if (item is IMember) {
- canRename = !((IMember)item).Region.IsEmpty;
- } else if (item is INamespace) {
- canRename = true;
- } else {
- canRename = false;
- }
- if (canRename) {
- ciset.CommandInfos.Add (IdeApp.CommandService.GetCommandInfo (MonoDevelop.Ide.Commands.EditCommands.Rename), new Action (delegate {
- new MonoDevelop.Refactoring.Rename.RenameHandler ().Start (null);
- }));
- added = true;
- }
- if (RefactoringService.ShowFixes) {
- foreach (var refactoring in RefactoringService.Refactorings) {
- if (refactoring.IsValid (options)) {
- CommandInfo info = new CommandInfo (refactoring.GetMenuDescription (options));
- info.AccelKey = refactoring.AccelKey;
- ciset.CommandInfos.Add (info, new Action (new RefactoringOperationWrapper (refactoring, options).Operation));
- }
- }
- var refactoringInfo = doc.Annotation<RefactoringDocumentInfo> ();
- if (refactoringInfo == null) {
- refactoringInfo = new RefactoringDocumentInfo ();
- doc.AddAnnotation (refactoringInfo);
- }
- var loc = doc.Editor.Caret.Location;
- bool first = true;
- if (refactoringInfo.lastDocument != doc.ParsedDocument || loc != lastLocation) {
- try {
- refactoringInfo.validActions = RefactoringService.GetValidActions (doc, loc, new CancellationTokenSource (500).Token);
- } catch (TaskCanceledException) {
- } catch (AggregateException ae) {
- ae.Flatten ().Handle (x => x is TaskCanceledException);
- }
-
- lastLocation = loc;
- refactoringInfo.lastDocument = doc.ParsedDocument;
- }
- if (refactoringInfo.validActions != null && refactoringInfo.lastDocument != null && refactoringInfo.lastDocument.CreateRefactoringContext != null) {
- var context = refactoringInfo.lastDocument.CreateRefactoringContext (doc, CancellationToken.None);
-
- foreach (var fix_ in refactoringInfo.validActions.OrderByDescending (i => Tuple.Create (CodeActionEditorExtension.IsAnalysisOrErrorFix(i), (int)i.Severity, CodeActionEditorExtension.GetUsage (i.IdString)))) {
- if (CodeActionEditorExtension.IsAnalysisOrErrorFix (fix_))
- continue;
- var fix = fix_;
- if (first) {
- first = false;
- if (ciset.CommandInfos.Count > 0)
- ciset.CommandInfos.AddSeparator ();
- }
-
- ciset.CommandInfos.Add (fix.Title, new Action (() => RefactoringService.ApplyFix (fix, context)));
- }
- }
- }
- if (ciset.CommandInfos.Count > 0) {
- ainfo.Add (ciset, null);
- added = true;
- }
-
- if (IdeApp.ProjectOperations.CanJumpToDeclaration (item)) {
- var type = item as IType;
- if (type != null && type.GetDefinition ().Parts.Count > 1) {
- var declSet = new CommandInfoSet ();
- declSet.Text = GettextCatalog.GetString ("_Go to Declaration");
- var ct = type.GetDefinition ();
- foreach (var part in ct.Parts)
- declSet.CommandInfos.Add (string.Format (GettextCatalog.GetString ("{0}, Line {1}"), FormatFileName (part.Region.FileName), part.Region.BeginLine), new System.Action (new JumpTo (part).Run));
- ainfo.Add (declSet);
- } else {
- ainfo.Add (IdeApp.CommandService.GetCommandInfo (RefactoryCommands.GotoDeclaration), new System.Action (new JumpTo (item).Run));
- }
- added = true;
- }
-
- if (item is IMember) {
- var member = (IMember)item;
- if (member.IsOverride || member.ImplementedInterfaceMembers.Any ()) {
- ainfo.Add (GettextCatalog.GetString ("Go to _Base Symbol"), new System.Action (new GotoBase (member).Run));
- added = true;
- }
- }
-
- if (!(item is IMethod && ((IMethod)item).SymbolKind == SymbolKind.Operator) && (item is IEntity || item is ITypeParameter || item is IVariable || item is INamespace)) {
-
- ainfo.Add (IdeApp.CommandService.GetCommandInfo (RefactoryCommands.FindReferences), new System.Action (new FindRefs (item, false).Run));
- if (doc.HasProject && HasOverloads (doc.Project.ParentSolution, item))
- ainfo.Add (IdeApp.CommandService.GetCommandInfo (RefactoryCommands.FindAllReferences), new System.Action (new FindRefs (item, true).Run));
- added = true;
- }
-
- if (item is IMember) {
- var member = (IMember)item;
- var handler = new FindDerivedSymbolsHandler (member);
- if (handler.IsValid) {
- var a = ainfo.Add (GettextCatalog.GetString ("Find Derived Symbols"), new Action (handler.Run));
- a.AccelKey = IdeApp.CommandService.GetCommandInfo (RefactoryCommands.FindDerivedClasses).AccelKey;
- added = true;
- }
- }
- if (item is IMember) {
- var member = (IMember)item;
- if (member.SymbolKind == SymbolKind.Method || member.SymbolKind == SymbolKind.Indexer) {
- var findMemberOverloadsHandler = new FindMemberOverloadsHandler (doc, member);
- if (findMemberOverloadsHandler.IsValid) {
- ainfo.Add (GettextCatalog.GetString ("Find Member Overloads"), new System.Action (findMemberOverloadsHandler.Run));
- added = true;
- }
- }
- }
-
- if (item is ITypeDefinition) {
- ITypeDefinition cls = (ITypeDefinition)item;
- foreach (var bc in cls.DirectBaseTypes) {
- if (bc != null && bc.GetDefinition () != null && bc.GetDefinition ().Kind != TypeKind.Interface/* TODO: && IdeApp.ProjectOperations.CanJumpToDeclaration (bc)*/) {
- ainfo.Add (GettextCatalog.GetString ("Go to _Base"), new System.Action (new GotoBase ((ITypeDefinition)item).Run));
- break;
- }
- }
- if ((cls.Kind == TypeKind.Class && !cls.IsSealed) || cls.Kind == TypeKind.Interface) {
- var label = cls.Kind != TypeKind.Interface ? GettextCatalog.GetString ("Find _derived classes") : GettextCatalog.GetString ("Find _implementor classes");
- var a = ainfo.Add (label, new System.Action (new FindDerivedClasses (cls).Run));
- a.AccelKey = IdeApp.CommandService.GetCommandInfo (RefactoryCommands.FindDerivedClasses).AccelKey;
- }
- ainfo.Add (GettextCatalog.GetString ("Find Extension Methods"), new System.Action (new FindExtensionMethodHandler (doc, cls).Run));
- added = true;
-
- }
-
- if (added)
- ainfo.AddSeparator ();
- }
-
-
- class RefactoringOperationWrapper
- {
- RefactoringOperation refactoring;
- RefactoringOptions options;
-
- public RefactoringOperationWrapper (RefactoringOperation refactoring, RefactoringOptions options)
- {
- this.refactoring = refactoring;
- this.options = options;
- }
-
- public void Operation ()
- {
- refactoring.Run (options);
- }
- }
-
- bool IsModifiable (object member)
- {
- IType t = member as IType;
- if (t != null)
- return t.GetDefinition ().Region.FileName == IdeApp.Workbench.ActiveDocument.FileName;
- if (member is IMember)
- return ((IMember)member).DeclaringTypeDefinition.Region.FileName == IdeApp.Workbench.ActiveDocument.FileName;
- return false;
- }
-
- static string FormatFileName (string fileName)
- {
- if (fileName == null)
- return null;
- char[] seperators = { System.IO.Path.DirectorySeparatorChar, System.IO.Path.AltDirectorySeparatorChar };
- int idx = fileName.LastIndexOfAny (seperators);
- if (idx > 0)
- idx = fileName.LastIndexOfAny (seperators, idx - 1);
- if (idx > 0)
- return "..." + fileName.Substring (idx);
- return fileName;
- }
-
- public static bool ContainsAbstractMembers (IType cls)
- {
- if (cls == null)
- return false;
- return cls.GetMembers ().Any (m => m.IsAbstract);
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ResolveCommandHandler.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ResolveCommandHandler.cs
deleted file mode 100644
index b71ab8ca03..0000000000
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ResolveCommandHandler.cs
+++ /dev/null
@@ -1,578 +0,0 @@
-//
-// ResolveCommand.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.Ide;
-using System.Linq;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using ICSharpCode.NRefactory.TypeSystem;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.Semantics;
-using ICSharpCode.NRefactory.CSharp.Completion;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
-using MonoDevelop.Ide.Gui.Content;
-using MonoDevelop.Ide.TypeSystem;
-using System.Threading;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-using MonoDevelop.Core.Assemblies;
-using MonoDevelop.Projects;
-using ICSharpCode.NRefactory.TypeSystem.Implementation;
-using MonoDevelop.Core.ProgressMonitoring;
-using ICSharpCode.NRefactory.Completion;
-
-namespace MonoDevelop.Refactoring
-{
- public class ResolveCommandHandler : CommandHandler
- {
- public static bool ResolveAt (Document doc, out ResolveResult resolveResult, out AstNode node, CancellationToken token = default (CancellationToken))
- {
- if (doc == null)
- throw new ArgumentNullException ("doc");
- var editor = doc.Editor;
- if (editor == null || editor.MimeType != "text/x-csharp") {
- node = null;
- resolveResult = null;
- return false;
- }
- if (!InternalResolveAt (doc, out resolveResult, out node)) {
- var location = RefactoringService.GetCorrectResolveLocation (doc, editor.Caret.Location);
- resolveResult = GetHeuristicResult (doc, location, ref node);
- if (resolveResult == null)
- return false;
- }
- var oce = node as ObjectCreateExpression;
- if (oce != null)
- node = oce.Type;
- return true;
- }
-
- static bool InternalResolveAt (Document doc, out ResolveResult resolveResult, out AstNode node, CancellationToken token = default (CancellationToken))
- {
- var parsedDocument = doc.ParsedDocument;
- resolveResult = null;
- node = null;
- if (parsedDocument == null)
- return false;
- var unit = parsedDocument.GetAst<SyntaxTree> ();
- var parsedFile = parsedDocument.ParsedFile as CSharpUnresolvedFile;
- if (unit == null || parsedFile == null)
- return false;
- try {
- var location = RefactoringService.GetCorrectResolveLocation (doc, doc.Editor.Caret.Location);
- resolveResult = ResolveAtLocation.Resolve (doc.Compilation, parsedFile, unit, location, out node, token);
- if (resolveResult == null || node is Statement)
- return false;
- } catch (OperationCanceledException) {
- return false;
- } catch (Exception e) {
- Console.WriteLine ("Got resolver exception:" + e);
- return false;
- }
- return true;
- }
-
- protected override void Update (CommandArrayInfo ainfo)
- {
- var doc = IdeApp.Workbench.ActiveDocument;
- if (doc == null || doc.FileName == FilePath.Null || doc.ParsedDocument == null)
- return;
-
- ResolveResult resolveResult;
- AstNode node;
- if (!ResolveAt (doc, out resolveResult, out node))
- return;
- var resolveMenu = new CommandInfoSet ();
- resolveMenu.Text = GettextCatalog.GetString ("Resolve");
-
- var possibleNamespaces = GetPossibleNamespaces (doc, node, ref resolveResult);
-
- foreach (var t in possibleNamespaces.Where (tp => tp.OnlyAddReference)) {
- var reference = t.Reference;
- var info = resolveMenu.CommandInfos.Add (
- t.GetImportText (),
- new System.Action (new AddImport (doc, resolveResult, null, reference, true, node).Run)
- );
- info.Icon = MonoDevelop.Ide.Gui.Stock.AddNamespace;
-
- }
-
-
- bool addUsing = !(resolveResult is AmbiguousTypeResolveResult);
- if (addUsing) {
- foreach (var t in possibleNamespaces.Where (tp => tp.IsAccessibleWithGlobalUsing)) {
- string ns = t.Namespace;
- var reference = t.Reference;
- var info = resolveMenu.CommandInfos.Add (
- t.GetImportText (),
- new System.Action (new AddImport (doc, resolveResult, ns, reference, true, node).Run)
- );
- info.Icon = MonoDevelop.Ide.Gui.Stock.AddNamespace;
- }
- }
-
- bool resolveDirect = !(resolveResult is UnknownMemberResolveResult);
- if (resolveDirect) {
- if (resolveMenu.CommandInfos.Count > 0)
- resolveMenu.CommandInfos.AddSeparator ();
- foreach (var t in possibleNamespaces) {
- string ns = t.Namespace;
- var reference = t.Reference;
- resolveMenu.CommandInfos.Add (t.GetInsertNamespaceText (doc.Editor.GetTextBetween (node.StartLocation, node.EndLocation)), new System.Action (new AddImport (doc, resolveResult, ns, reference, false, node).Run));
- }
- }
-
- if (resolveMenu.CommandInfos.Count > 0)
- ainfo.Insert (0, resolveMenu);
- }
-
- static string CreateStub (Document doc, int offset)
- {
- if (offset <= 0)
- return "";
- string text = doc.Editor.GetTextAt (0, Math.Min (doc.Editor.Length, offset));
- var stub = new StringBuilder (text);
- CSharpCompletionEngine.AppendMissingClosingBrackets (stub, false);
- return stub.ToString ();
- }
-
- static ResolveResult GetHeuristicResult (Document doc, DocumentLocation location, ref AstNode node)
- {
- var editor = doc.Editor;
- if (editor == null || editor.Caret == null)
- return null;
- int offset = editor.Caret.Offset;
- bool wasLetter = false, wasWhitespaceAfterLetter = false;
- while (offset < editor.Length) {
- char ch = editor.GetCharAt (offset);
- bool isLetter = char.IsLetterOrDigit (ch) || ch == '_';
- bool isWhiteSpace = char.IsWhiteSpace (ch);
- bool isValidPunc = ch == '.' || ch == '<' || ch == '>';
-
- if (!(wasLetter && wasWhitespaceAfterLetter) && (isLetter || isWhiteSpace || isValidPunc)) {
- if (isValidPunc) {
- wasWhitespaceAfterLetter = false;
- wasLetter = false;
- }
- offset++;
- } else {
- offset--;
- while (offset > 1) {
- ch = editor.GetCharAt (offset - 1);
- if (!(ch == '.' || char.IsWhiteSpace (ch)))
- break;
- offset--;
- }
- break;
- }
-
- wasLetter |= isLetter;
- if (wasLetter)
- wasWhitespaceAfterLetter |= isWhiteSpace;
- }
-
- var unit = SyntaxTree.Parse (CreateStub (doc, offset), doc.FileName);
-
- var parsedDocument = doc.ParsedDocument;
- if (parsedDocument == null)
- return null;
- return ResolveAtLocation.Resolve (
- doc.Compilation,
- parsedDocument.ParsedFile as CSharpUnresolvedFile,
- unit,
- location,
- out node);
- }
-
- public static List<PossibleNamespace> GetPossibleNamespaces (Document doc, AstNode node, ref ResolveResult resolveResult)
- {
- if (doc == null)
- throw new ArgumentNullException ("doc");
- if (node == null)
- throw new ArgumentNullException ("node");
- var location = RefactoringService.GetCorrectResolveLocation (doc, doc.Editor.Caret.Location);
-
- if (resolveResult == null || resolveResult.Type.FullName == "System.Void")
- resolveResult = GetHeuristicResult (doc, location, ref node) ?? resolveResult;
- var foundNamespaces = GetPossibleNamespaces (doc, node, resolveResult, location);
-
- if (!(resolveResult is AmbiguousTypeResolveResult)) {
- var usedNamespaces = RefactoringOptions.GetUsedNamespaces (doc, location);
- foundNamespaces = foundNamespaces.Where (n => !usedNamespaces.Contains (n.Namespace));
- }
- var result = new List<PossibleNamespace> ();
- foreach (var ns in foundNamespaces) {
- if (result.Any (n => n.Namespace == ns.Namespace))
- continue;
- result.Add (ns);
- }
- return result;
- }
-
- static int GetTypeParameterCount (AstNode node)
- {
- if (node is ObjectCreateExpression)
- node = ((ObjectCreateExpression)node).Type;
- if (node is SimpleType)
- return ((SimpleType)node).TypeArguments.Count;
- if (node is MemberType)
- return ((MemberType)node).TypeArguments.Count;
- if (node is IdentifierExpression)
- return ((IdentifierExpression)node).TypeArguments.Count;
- return 0;
- }
-
- public class PossibleNamespace
- {
- public string Namespace { get; private set; }
- public bool IsAccessibleWithGlobalUsing { get; private set; }
- public bool OnlyAddReference { get { return !IsAccessibleWithGlobalUsing && Reference != null; } }
- public MonoDevelop.Projects.ProjectReference Reference { get; private set; }
-
- public PossibleNamespace (string @namespace, bool isAccessibleWithGlobalUsing, MonoDevelop.Projects.ProjectReference reference = null)
- {
- this.Namespace = @namespace;
- this.IsAccessibleWithGlobalUsing = isAccessibleWithGlobalUsing;
- this.Reference = reference;
- }
-
- string GetLibraryName ()
- {
- var txt = Reference.Reference;
- int idx = txt.IndexOf (',');
- if (idx >= 0)
- return txt.Substring (0, idx);
- return txt;
- }
-
- public string GetImportText ()
- {
- if (OnlyAddReference)
- return GettextCatalog.GetString (
- "Reference '{0}'",
- GetLibraryName ().Replace ("_", "__"));
- if (Reference != null)
- return GettextCatalog.GetString (
- "Reference '{0}' and use '{1}'",
- GetLibraryName (),
- string.Format ("using {0};", Namespace.Replace ("_", "__")));
-
- return string.Format ("using {0};", Namespace.Replace ("_", "__"));
- }
-
- public string GetInsertNamespaceText (string member)
- {
- if (Reference != null)
- return GettextCatalog.GetString (
- "Reference '{0}' and use '{1}'",
- GetLibraryName ().Replace ("_", "__"),
- (Namespace + "." + member).Replace ("_", "__")
- );
- return (Namespace + "." + member).Replace ("_", "__");
- }
- }
-
- internal static bool CanBeReferenced (Project project, SystemAssembly systemAssembly)
- {
- var netProject = project as DotNetProject;
- if (netProject == null)
- return false;
- var result = netProject.TargetRuntime.AssemblyContext.GetAssemblyNameForVersion(systemAssembly.FullName, netProject.TargetFramework);
- return !string.IsNullOrEmpty (result);
- }
-
- static bool CanReference (Document doc, MonoDevelop.Projects.ProjectReference projectReference)
- {
- var project = doc.Project as DotNetProject;
- if (project == null || projectReference == null || project.ParentSolution == null)
- return true;
- switch (projectReference.ReferenceType) {
- case ReferenceType.Project:
- var referenceProject = projectReference.ResolveProject (project.ParentSolution) as DotNetProject;
- if (referenceProject == null)
- return true;
- string reason;
- return project.CanReferenceProject (referenceProject, out reason);
- }
- return true;
-
- }
-
- static IEnumerable<PossibleNamespace> GetPossibleNamespaces (Document doc, AstNode node, ResolveResult resolveResult, DocumentLocation location)
- {
- var unit = doc.ParsedDocument.GetAst<SyntaxTree> ();
- if (unit == null)
- yield break;
- var project = doc.Project;
- if (project == null)
- yield break;
- int tc = GetTypeParameterCount (node);
- var attribute = unit.GetNodeAt<ICSharpCode.NRefactory.CSharp.Attribute> (location);
- bool isInsideAttributeType = attribute != null && attribute.Type.Contains (location);
-
- var compilations = new List<Tuple<ICompilation, MonoDevelop.Projects.ProjectReference>> ();
- compilations.Add (Tuple.Create (doc.Compilation, (MonoDevelop.Projects.ProjectReference)null));
- var referencedItems = IdeApp.Workspace != null ? project.GetReferencedItems (IdeApp.Workspace.ActiveConfiguration).ToList () : (IEnumerable<SolutionItem>) new SolutionItem[0];
- var solution = project != null ? project.ParentSolution : null;
- if (solution != null) {
- foreach (var curProject in solution.GetAllProjects ()) {
- if (curProject == project || referencedItems.Contains (curProject))
- continue;
-
- var otherRefes = IdeApp.Workspace != null ? curProject.GetReferencedItems (IdeApp.Workspace.ActiveConfiguration).ToList () : (IEnumerable<SolutionItem>) new SolutionItem[0];
- if (otherRefes.Contains (project))
- continue;
-
- var comp = TypeSystemService.GetCompilation (curProject);
- if (comp == null)
- continue;
- compilations.Add (Tuple.Create (comp, new MonoDevelop.Projects.ProjectReference (curProject)));
- }
- }
-
- var netProject = project as DotNetProject;
- if (netProject == null)
- yield break;
- FrameworkLookup frameworkLookup;
- if (!TypeSystemService.TryGetFrameworkLookup (netProject, out frameworkLookup))
- frameworkLookup = null;
- if (frameworkLookup != null && resolveResult is UnknownMemberResolveResult) {
- var umResult = (UnknownMemberResolveResult)resolveResult;
- try {
- foreach (var r in frameworkLookup.GetExtensionMethodLookups (umResult)) {
- var systemAssembly = netProject.AssemblyContext.GetAssemblyFromFullName (r.FullName, r.Package, netProject.TargetFramework);
- if (systemAssembly == null)
- continue;
- if (CanBeReferenced (doc.Project, systemAssembly))
- compilations.Add (Tuple.Create (TypeSystemService.GetCompilation (systemAssembly, doc.Compilation), new MonoDevelop.Projects.ProjectReference (systemAssembly)));
- }
- } catch (Exception e) {
- if (!TypeSystemService.RecreateFrameworkLookup (netProject))
- LoggingService.LogError (string.Format ("Error while looking up extension method {0}", umResult.MemberName), e);
- }
- }
- bool foundIdentifier = false;
- var lookup = new MemberLookup (null, doc.Compilation.MainAssembly);
- foreach (var comp in compilations) {
- var compilation = comp.Item1;
- var requiredReference = comp.Item2;
- if (resolveResult is AmbiguousTypeResolveResult) {
- if (compilation != doc.Compilation)
- continue;
- var aResult = resolveResult as AmbiguousTypeResolveResult;
- var file = doc.ParsedDocument.ParsedFile as CSharpUnresolvedFile;
- var scope = file.GetUsingScope (location).Resolve (compilation);
- while (scope != null) {
- foreach (var u in scope.Usings) {
- foreach (var typeDefinition in u.Types) {
- if (typeDefinition.Name == aResult.Type.Name &&
- typeDefinition.TypeParameterCount == tc &&
- lookup.IsAccessible (typeDefinition, false)) {
- if (CanReference(doc, requiredReference))
- yield return new PossibleNamespace (typeDefinition.Namespace, true, requiredReference);
- }
- }
- }
- scope = scope.Parent;
- }
- }
- var allTypes = compilation == doc.Compilation ? compilation.GetAllTypeDefinitions () : compilation.MainAssembly.GetAllTypeDefinitions ();
- if (resolveResult is UnknownIdentifierResolveResult) {
- var uiResult = resolveResult as UnknownIdentifierResolveResult;
- string possibleAttributeName = isInsideAttributeType ? uiResult.Identifier + "Attribute" : uiResult.Identifier;
- foreach (var typeDefinition in allTypes) {
- if ((typeDefinition.Name == possibleAttributeName || typeDefinition.Name == uiResult.Identifier) && typeDefinition.TypeParameterCount == tc &&
- lookup.IsAccessible (typeDefinition, false)) {
- if (CanReference (doc, requiredReference)) {
- if (typeDefinition.DeclaringTypeDefinition != null) {
- var builder = new TypeSystemAstBuilder (new CSharpResolver (doc.Compilation));
- foundIdentifier = true;
- yield return new PossibleNamespace (builder.ConvertType (typeDefinition.DeclaringTypeDefinition).ToString (), false, requiredReference);
- } else {
- foundIdentifier = true;
- yield return new PossibleNamespace (typeDefinition.Namespace, true, requiredReference);
- }
- }
- }
- }
- }
-
- if (resolveResult is UnknownMemberResolveResult) {
- var umResult = (UnknownMemberResolveResult)resolveResult;
- string possibleAttributeName = isInsideAttributeType ? umResult.MemberName + "Attribute" : umResult.MemberName;
- foreach (var typeDefinition in allTypes.Where (t => t.HasExtensionMethods)) {
- if (!lookup.IsAccessible (typeDefinition, false))
- continue;
- foreach (var method in typeDefinition.Methods.Where (m => m.IsExtensionMethod && (m.Name == possibleAttributeName || m.Name == umResult.MemberName))) {
- if (!lookup.IsAccessible (method, false))
- continue;
- IType[] inferredTypes;
- if (CSharpResolver.IsEligibleExtensionMethod (
- compilation.Import (umResult.TargetType),
- method,
- true,
- out inferredTypes
- )) {
- if (CanReference(doc, requiredReference))
- yield return new PossibleNamespace (typeDefinition.Namespace, true, requiredReference);
- goto skipType;
- }
- }
- skipType:
- ;
- }
- }
-
- if (resolveResult is ErrorResolveResult) {
- var identifier = unit != null ? unit.GetNodeAt<Identifier> (location) : null;
- if (identifier != null) {
- var uiResult = resolveResult as UnknownIdentifierResolveResult;
- if (uiResult != null) {
- string possibleAttributeName = isInsideAttributeType ? uiResult.Identifier + "Attribute" : uiResult.Identifier;
- foreach (var typeDefinition in allTypes) {
- if ((identifier.Name == possibleAttributeName || identifier.Name == uiResult.Identifier) &&
- typeDefinition.TypeParameterCount == tc &&
- lookup.IsAccessible (typeDefinition, false))
- if (CanReference(doc, requiredReference))
- yield return new PossibleNamespace (typeDefinition.Namespace, true, requiredReference);
- }
- }
- }
- }
- }
-
- // Try to search framework types
- if (!foundIdentifier && frameworkLookup != null && resolveResult is UnknownIdentifierResolveResult && node is AstType) {
- var uiResult = resolveResult as UnknownIdentifierResolveResult;
- if (uiResult != null) {
- var lookups = new List<Tuple<FrameworkLookup.AssemblyLookup, SystemAssembly>> ();
- try {
- foreach (var r in frameworkLookup.GetLookups (uiResult, tc, isInsideAttributeType)) {
- var systemAssembly = netProject.AssemblyContext.GetAssemblyFromFullName (r.FullName, r.Package, netProject.TargetFramework);
- if (systemAssembly == null)
- continue;
- if (CanBeReferenced (doc.Project, systemAssembly))
- lookups.Add (Tuple.Create (r, systemAssembly));
- }
- } catch (Exception e) {
- if (!TypeSystemService.RecreateFrameworkLookup (netProject))
- LoggingService.LogError (string.Format ("Error while looking up identifier {0}", uiResult.Identifier), e);
- }
- foreach(var kv in lookups)
- if (CanReference(doc, new MonoDevelop.Projects.ProjectReference (kv.Item2)))
- yield return new PossibleNamespace (kv.Item1.Namespace, true, new MonoDevelop.Projects.ProjectReference (kv.Item2));
-
- }
- }
- if (!foundIdentifier && frameworkLookup != null && resolveResult is UnknownMemberResolveResult) {
- var uiResult = resolveResult as UnknownMemberResolveResult;
- if (uiResult != null) {
- var lookups = new List<Tuple<FrameworkLookup.AssemblyLookup, SystemAssembly>> ();
- try {
- foreach (var r in frameworkLookup.GetLookups (uiResult, node.ToString (), tc, isInsideAttributeType)) {
- var systemAssembly = netProject.AssemblyContext.GetAssemblyFromFullName (r.FullName, r.Package, netProject.TargetFramework);
- if (systemAssembly == null)
- continue;
- if (CanBeReferenced (doc.Project, systemAssembly))
- lookups.Add (Tuple.Create (r, systemAssembly));
- }
- } catch (Exception e) {
- if (!TypeSystemService.RecreateFrameworkLookup (netProject))
- LoggingService.LogError (string.Format ("Error while looking up member resolve result {0}", node), e);
- }
- foreach(var kv in lookups)
- if (CanReference(doc, new MonoDevelop.Projects.ProjectReference (kv.Item2)))
- yield return new PossibleNamespace (kv.Item1.Namespace, true, new MonoDevelop.Projects.ProjectReference (kv.Item2));
- }
- }
-
- }
-
- internal class AddImport
- {
- readonly Document doc;
- readonly ResolveResult resolveResult;
- readonly string ns;
- readonly bool addUsing;
- readonly AstNode node;
- readonly MonoDevelop.Projects.ProjectReference reference;
-
- public AddImport (Document doc, ResolveResult resolveResult, string ns, MonoDevelop.Projects.ProjectReference reference, bool addUsing, AstNode node)
- {
- this.doc = doc;
- this.resolveResult = resolveResult;
- this.ns = ns;
- this.reference = reference;
- this.addUsing = addUsing;
- this.node = node;
- }
-
- public void Run ()
- {
- var loc = doc.Editor.Caret.Location;
-
- if (reference != null) {
- var project = doc.Project;
- project.Items.Add (reference);
- IdeApp.ProjectOperations.Save (project);
- }
-
- if (string.IsNullOrEmpty (ns))
- return;
-
- if (!addUsing) {
-// var unit = doc.ParsedDocument.GetAst<SyntaxTree> ();
- int offset = doc.Editor.LocationToOffset (node.StartLocation);
- doc.Editor.Insert (offset, ns + ".");
- doc.Editor.Document.CommitLineUpdate (loc.Line);
- return;
- }
-
- var generator = doc.CreateCodeGenerator ();
-
- if (resolveResult is NamespaceResolveResult) {
- generator.AddLocalNamespaceImport (doc, ns, loc);
- } else {
- generator.AddGlobalNamespaceImport (doc, ns);
- }
- }
- }
-
- protected override void Run (object data)
- {
- var del = (System.Action)data;
- if (del != null)
- del ();
- }
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.Refactoring/gtk-gui/MonoDevelop.Refactoring.EncapsulateFieldDialog.cs b/main/src/addins/MonoDevelop.Refactoring/gtk-gui/MonoDevelop.Refactoring.EncapsulateFieldDialog.cs
index 2364f13514..49fef05e69 100644
--- a/main/src/addins/MonoDevelop.Refactoring/gtk-gui/MonoDevelop.Refactoring.EncapsulateFieldDialog.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/gtk-gui/MonoDevelop.Refactoring.EncapsulateFieldDialog.cs
@@ -32,7 +32,7 @@ namespace MonoDevelop.Refactoring
private global::Gtk.HBox hbox2;
- private global::Gtk.Image imageError;
+ private global::MonoDevelop.Components.ImageView imageError;
private global::Gtk.Label labelError;
@@ -176,8 +176,10 @@ namespace MonoDevelop.Refactoring
this.hbox2.Name = "hbox2";
this.hbox2.Spacing = 6;
// Container child hbox2.Gtk.Box+BoxChild
- this.imageError = new global::Gtk.Image ();
+ this.imageError = new global::MonoDevelop.Components.ImageView ();
this.imageError.Name = "imageError";
+ this.imageError.IconId = "md-error";
+ this.imageError.IconSize = ((global::Gtk.IconSize)(1));
this.hbox2.Add (this.imageError);
global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.imageError]));
w14.Position = 0;
diff --git a/main/src/addins/MonoDevelop.Refactoring/gtk-gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs b/main/src/addins/MonoDevelop.Refactoring/gtk-gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs
index 37013c6e31..ae107ee523 100644
--- a/main/src/addins/MonoDevelop.Refactoring/gtk-gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/gtk-gui/MonoDevelop.Refactoring.Rename.RenameItemDialog.cs
@@ -18,7 +18,7 @@ namespace MonoDevelop.Refactoring.Rename
private global::Gtk.HBox hbox1;
- private global::Gtk.Image imageWarning;
+ private global::MonoDevelop.Components.ImageView imageWarning;
private global::Gtk.Label labelWarning;
@@ -104,9 +104,10 @@ namespace MonoDevelop.Refactoring.Rename
this.hbox1.Name = "hbox1";
this.hbox1.Spacing = 6;
// Container child hbox1.Gtk.Box+BoxChild
- this.imageWarning = new global::Gtk.Image ();
+ this.imageWarning = new global::MonoDevelop.Components.ImageView ();
this.imageWarning.Name = "imageWarning";
- this.imageWarning.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-apply", global::Gtk.IconSize.Button);
+ this.imageWarning.IconId = "md-warning";
+ this.imageWarning.IconSize = ((global::Gtk.IconSize)(4));
this.hbox1.Add (this.imageWarning);
global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.imageWarning]));
w7.Position = 0;
diff --git a/main/src/addins/MonoDevelop.Refactoring/gtk-gui/generated.cs b/main/src/addins/MonoDevelop.Refactoring/gtk-gui/generated.cs
index 03fa31124a..9b81ae2955 100644
--- a/main/src/addins/MonoDevelop.Refactoring/gtk-gui/generated.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/gtk-gui/generated.cs
@@ -1,4 +1,4 @@
-
+#pragma warning disable 436
// This file has been generated by the GUI designer. Do not modify.
namespace Stetic
{
@@ -14,40 +14,6 @@ namespace Stetic
}
}
- internal class IconLoader
- {
- public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size)
- {
- Gdk.Pixbuf res = widget.RenderIcon (name, size, null);
- if ((res != null)) {
- return res;
- } else {
- int sz;
- int sy;
- global::Gtk.Icon.SizeLookup (size, out sz, out sy);
- try {
- return Gtk.IconTheme.Default.LoadIcon (name, sz, 0);
- } catch (System.Exception) {
- if ((name != "gtk-missing-image")) {
- return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size);
- } else {
- Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz);
- Gdk.GC gc = new Gdk.GC (pmap);
- gc.RgbFgColor = new Gdk.Color (255, 255, 255);
- pmap.DrawRectangle (gc, true, 0, 0, sz, sz);
- gc.RgbFgColor = new Gdk.Color (0, 0, 0);
- pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1));
- gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
- gc.RgbFgColor = new Gdk.Color (255, 0, 0);
- pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4)));
- pmap.DrawLine (gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)));
- return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
- }
- }
- }
- }
- }
-
internal class BinContainer
{
private Gtk.Widget child;
diff --git a/main/src/addins/MonoDevelop.Refactoring/gtk-gui/gui.stetic b/main/src/addins/MonoDevelop.Refactoring/gtk-gui/gui.stetic
index 11b6e6c4d6..a86aee9313 100644
--- a/main/src/addins/MonoDevelop.Refactoring/gtk-gui/gui.stetic
+++ b/main/src/addins/MonoDevelop.Refactoring/gtk-gui/gui.stetic
@@ -6,9 +6,7 @@
</configuration>
<import>
<widget-library name="../../../../build/bin/MonoDevelop.Ide.dll" />
- <widget-library name="../../../../build/bin/Mono.TextEditor.dll" />
<widget-library name="../../../../build/AddIns/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.dll" />
- <widget-library name="../../../../build/AddIns/DisplayBindings/SourceEditor/MonoDevelop.SourceEditor2.dll" />
<widget-library name="../../../../build/AddIns/MonoDevelop.Refactoring/MonoDevelop.Refactoring.dll" internal="true" />
</import>
<widget class="Gtk.Dialog" id="MonoDevelop.Refactoring.RefactoringPreviewDialog" design-size="400 300">
@@ -205,10 +203,11 @@
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
- <widget class="Gtk.Image" id="imageWarning">
- <property name="MemberName" />
- <property name="Pixbuf">stock:gtk-apply Button</property>
- </widget>
+ <widget class="MonoDevelop.Components.ImageView" id="imageWarning">
+ <property name="MemberName" />
+ <property name="IconSize">Button</property>
+ <property name="IconId">md-warning</property>
+ </widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">True</property>
@@ -483,9 +482,11 @@
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
- <widget class="Gtk.Image" id="imageError">
- <property name="MemberName" />
- </widget>
+ <widget class="MonoDevelop.Components.ImageView" id="imageError">
+ <property name="MemberName" />
+ <property name="IconSize">Menu</property>
+ <property name="IconId">md-error</property>
+ </widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">True</property>
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16.png
index 3bfcaaa4a0..d97495cb13 100644
--- a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16.png
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16@2x.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16@2x.png
index d3843fa488..55ef68a9c6 100644
--- a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16@2x.png
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~dark.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~dark.png
new file mode 100644
index 0000000000..b9d01a9dc2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~dark@2x.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~dark@2x.png
new file mode 100644
index 0000000000..5ef17f66c0
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~dark~sel.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~dark~sel.png
new file mode 100644
index 0000000000..92487c7153
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~dark~sel@2x.png
new file mode 100644
index 0000000000..9ffc6a0967
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~sel.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~sel.png
new file mode 100644
index 0000000000..6557f93395
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~sel@2x.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~sel@2x.png
new file mode 100644
index 0000000000..5698b2a9bd
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-actions-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16.png
index d332c8658f..07f2ebe88b 100644
--- a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16.png
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16@2x.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16@2x.png
index ae2a84b99b..f5f9e8e084 100644
--- a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16@2x.png
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~dark.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~dark.png
new file mode 100644
index 0000000000..0b45e6e9cf
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~dark@2x.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~dark@2x.png
new file mode 100644
index 0000000000..6f3c4357f6
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~dark~sel.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~dark~sel.png
new file mode 100644
index 0000000000..e2771512bf
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~dark~sel@2x.png
new file mode 100644
index 0000000000..9593c410ba
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~sel.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~sel.png
new file mode 100644
index 0000000000..e2771512bf
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~sel@2x.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~sel@2x.png
new file mode 100644
index 0000000000..9593c410ba
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-analysis-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16.png
index 7bd0114b4f..ef893c57bb 100644
--- a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16.png
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16@2x.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16@2x.png
index 7e0f57994c..1d986f2fa1 100644
--- a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16@2x.png
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~dark.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~dark.png
new file mode 100644
index 0000000000..d689e9361f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~dark@2x.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~dark@2x.png
new file mode 100644
index 0000000000..90282fec96
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~dark~sel.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~dark~sel.png
new file mode 100644
index 0000000000..b0f3ea7cfe
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~dark~sel@2x.png
new file mode 100644
index 0000000000..fa6a41cc8e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~sel.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~sel.png
new file mode 100644
index 0000000000..b0f3ea7cfe
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~sel@2x.png b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~sel@2x.png
new file mode 100644
index 0000000000..fa6a41cc8e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/icons/prefs-code-rules-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Refactoring/packages.config b/main/src/addins/MonoDevelop.Refactoring/packages.config
new file mode 100644
index 0000000000..3299dfcf07
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Refactoring/packages.config
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages /> \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.RegexToolkit/ChangeLog b/main/src/addins/MonoDevelop.RegexToolkit/ChangeLog
deleted file mode 100644
index c0476d13eb..0000000000
--- a/main/src/addins/MonoDevelop.RegexToolkit/ChangeLog
+++ /dev/null
@@ -1,466 +0,0 @@
-2010-05-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.RegexToolkit/Commands.cs: Dialog placement.
-
-2010-05-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexToolkitWindow.cs: Added multi
- monitor support.
-
-2010-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.RegexToolkit.addin.xml: On Windows, show the
- global options command in the Tools menu.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.RegexToolkit.addin.xml: Bumped MD version.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.RegexToolkit.csproj:
- * MonoDevelop.RegexToolkit.addin.xml:
- * MonoDevelop.RegexToolkit/RegexLibraryWindow.cs:
- * MonoDevelop.RegexToolkit/RegexToolkitWindow.cs: Merged
- MD.Projects into MD.Core, and MD.Projects.Gui, MD.Core.Gui
- and MD.Components into MD.Ide.
-
-2010-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexToolkitWindow.cs: disabled
- elements list.
-
-2010-02-05 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.RegexToolkit/RegexToolkitWindow.cs:
- * gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWindow.cs:
- Avoid unhandled exception on invalid expression.
-
-2010-01-24 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * MonoDevelop.RegexToolkit.csproj:
- * MonoDevelop.RegexToolkit/RegexLibraryWindow.cs:
- * MonoDevelop.RegexToolkit/RegexToolkitWindow.cs:
- * MonoDevelop.RegexToolkit/UpdateInProgressDialog.cs:
- * gtk-gui/MonoDevelop.RegexToolkit.RegexLibraryWindow.cs:
- * gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWindow.cs:
- * gtk-gui/MonoDevelop.RegexToolkit.UpdateInProgressDialog.cs:
- Made the regex toolkit a bit nicer.
-
-2009-12-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexToolkitWindow.cs: Set button
- sensitivity depending on whether entries are full. Pack
- icons into same columns as text.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.RegexToolkit/UpdateInProgressDialog.cs: Name
- threads to make debugging easier.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.RegexToolkit.addin.xml: Bump MD version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * MonoDevelop.RegexToolkit.csproj:
- * gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWindow.cs:
- * gtk-gui/MonoDevelop.RegexToolkit.RegexLibraryWindow.cs:
- * gtk-gui/MonoDevelop.RegexToolkit.UpdateInProgressDialog.cs:
- Flush.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.RegexToolkit.addin.xml: Bump MD version.
-
-2009-09-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit.addin.xml: Added missing "..." to
- menu item.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.RegexToolkit.csproj: Updated dependencies. We
- now depend on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-06-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexLibraryWindow.cs: In .NET,
- settings as read-only after the creation of an
- XmlTextWriter.
-
-2009-06-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.RegexToolkit/UpdateInProgressDialog.cs: Limit
- the number of expressions when querying. Beyond 1230 there
- is an expression which makes the web service reply to fail.
-
-2009-06-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.RegexToolkit/UpdateInProgressDialog.cs: Properly
- show error messages while updating.
-
-2009-06-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.RegexToolkit.csproj:
- * MonoDevelop.RegexToolkit/RegexToolkitWindow.cs:
- * MonoDevelop.RegexToolkit/RegexLibraryWindow.cs:
- * gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWindow.cs:
- * gtk-gui/MonoDevelop.RegexToolkit.RegexLibraryWindow.cs:
- * gtk-gui/MonoDevelop.RegexToolkit.UpdateInProgressDialog.cs:
- Cosmetic GUI fixes.
-
- * MonoDevelop.RegexToolkit/UpdateInProgressDialog.cs: Properly
- handle cancellation of the web service call.
-
-2009-06-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexLibraryWindow.cs: On MS.NET
- XmlWritter.Settings is not initialized by default. Path by
- Carlo Kok.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.RegexToolkit.csproj: don't require specific
- gtk-sharp version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.RegexToolkit.addin.xml: Bump MD version.
-
-2009-03-02 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.RegexToolkit/RegexToolkitWindow.cs: make strings
- translatable
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexLibraryWindow.cs: Changed
- override Destroy --> override OnDestroyed.
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * RegexElements.xml: Reverted changes (we came to the
- conclusion that the old ones were more correct).
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * RegexElements.xml: Changed some problematic strings found by
- eno.
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexToolkitWindow.cs:
- * MonoDevelop.RegexToolkit/RegexLibraryWindow.cs: Worked on
- ressource de-allocation.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.RegexToolkit.mdp:
- * MonoDevelop.RegexToolkit.csproj: Migrated to MSBuild file
- format.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.RegexToolkit.addin.xml: Bump MD version.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.RegexToolkit.mdp: Flush project format changes.
-
-2008-12-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * MonoDevelop.RegexToolkit/RegexToolkitWindow.cs:
- * gtk-gui/MonoDevelop.RegexToolkit.RegexLibraryWindow.cs:
- * gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWindow.cs:
- * gtk-gui/MonoDevelop.RegexToolkit.UpdateInProgressDialog.cs:
- TooltipWindow has been moved to MD.Components.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.RegexToolkit.mdp: All projects now require fx 3.5.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.RegexToolkit.mdp: Don't require a specific version of
- Mono.Addins.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Make it work for parallel build.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * AssemblyInfo.cs: Add AssemblyInfo.cs files that are autogenerated from
- the addin manifests.
-
-2008-12-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic: Manually remove unnecessary viewports. They were
- preventing automatic scrolling when the selection was changed with
- the keyboard.
-
- * MonoDevelop.RegexToolkit/RegexToolkitWindow.cs: Tidied. Remove
- unnecessary destructions. Work around GTK event handler marshalling
- issues by using a method instead of a delegate -- prevents error
- message when using Regex Toolkit on GTK# 2.12.6.
-
- * gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWindow.cs: Updated.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.RegexToolkit.addin.xml: Bump MD version.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.RegexToolkit.RegexLibraryWindow.cs,
- gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWindow.cs,
- gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.RegexToolkit.UpdateInProgressDialog.cs: Updated
- generated code.
-
-2008-06-18 Ankit Jain <jankit@novell.com>
-
- * gtk-gui/MonoDevelop.RegexToolkit.RegexLibraryWindow.cs:
- * gtk-gui/gui.stetic: Fix window title, and set WrapMode on the
- description textview.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.RegexToolkit.addin.xml: Bump MD version.
-
-2008-06-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexLibraryWindow.cs,
- MonoDevelop.RegexToolkit/RegexToolkitWindow.cs: Use the OnDestroyed
- event instead of Dispose, since with the latest changes in gtk#,
- Dispose is not called anymore when a widget is destroyed.
-
-2008-05-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexToolkitWindow.cs: Use base tooltip
- window.
- * gtk-gui/gui.stetic: Set target GTK version to 2.8.
-
-2008-04-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexToolkitWindow.cs: fixed Bug 379472 -
- GTK warnings caused by regex toolkit window.
-
-2008-03-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexToolkitWindow.cs,
- gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWindow.cs: Set type wink
-
-2008-03-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexToolkitWindow.cs,
- gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWindow.cs,
- gtk-gui/gui.stetic: Changed start position.
-
-2008-03-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexToolkitWindow.cs,
- gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWindow.cs,
- gtk-gui/generated.cs, gtk-gui/gui.stetic: Overworked regex toolkit
- window.
-
-2008-02-28 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWindow.cs: Fixed "Bug 365624
- - Widget toolbox are shown unsorted".
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.RegexToolkit.RegexLibraryWindow.cs,
- gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWindow.cs: Moved some
- buttons.
-
-2008-02-09 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am: Managed texteditor is now standard - the gtksourceview1&2 are
- now optional.
-
-2008-01-29 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * MonoDevelop.RegexToolkit/RegexToolkitWindow.cs: Small workaround to be
- able to build in mono 1.2.4 (mono 1.2.4 ignores usings in anon
- delegates).
-
-2008-01-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexToolkitWindow.cs: Fixed Bug 355842 - Tootips
- in regex toolkit are excessively persistent.
-
-2008-01-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexToolkitWindow.cs: Fixed Bug 355842 - Tootips
- in regex toolkit are excessively persistent.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.RegexToolkit.addin.xml: Update MD version.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * RegexElements.xml: Improve formatting of translatable strings.
- * MonoDevelop.RegexToolkit/RegexToolkitWindow.cs: Actually feed translatable
- strings from xml file through Gettext.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.RegexToolkit.mdp: Updated project files. The order of extended
- properties won't change anymore.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWindow.cs,
- gtk-gui/gui.stetic: Updated.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.RegexToolkit.addin.xml: Bump add-in versions.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.RegexToolkit.mdp, Makefile.am: Directory reorganization.
-
-2007-12-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs: Sync assembly and add-in versions.
-
-2007-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexLibraryWindow.cs: Track LoggingService API
- changes.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.RegexToolkit.addin.xml: Bump MD version.
-
-2007-10-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexLibraryWindow.cs,
- MonoDevelop.RegexToolkit/RegexToolkitWindow.cs: Regex library behaves
- more nicely when scrolling.
-
-2007-10-24 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWindow.cs,
- gtk-gui/gui.stetic: Made the replacement regex label clearer.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.RegexToolkit.mdp: Project file names updated by change in MD
- path functions.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.RegexToolkit.addin.xml: Bump MD version.
-
-2007-09-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.RegexToolkit.RegexLibraryWindow.cs,
- gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWindow.cs,
- gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.RegexToolkit.UpdateInProgressDialog.cs: Regenerated
- GUI files.
-
-2007-08-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexLibraryWindow.cs,
- gtk-gui/MonoDevelop.RegexToolkit.RegexLibraryWindow.cs,
- gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWindow.cs: Changes due to
- new property infrastructure.
-
-2007-08-15 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.RegexToolkit/UpdateInProgressDialog.cs: Use fully
- qualified type names inside anonymous delegates as a workaround
- for gmcs 1.2.4 bug.
-
-2007-08-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit/UpdateInProgressDialog.cs,
- MonoDevelop.RegexToolkit/RegexLibraryWindow.cs,
- MonoDevelop.RegexToolkit/RegexToolkitWindow.cs: Made the dialogs
- more HID compliant.
-
-2007-08-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit.mdp: Added prefixes for makefile support.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.RegexToolkit.addin.xml, MonoDevelop.RegexToolkit.mdp,
- Makefile.am: Reorganized the extension point hierarchy. Embedded all
- add-in manifests as resources.
-
-2007-08-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexLibrary.cs,
- MonoDevelop.RegexToolkit/RegexToolkit.cs: Regex library closing
- behavior now is connected with the regex toolkit.
-
-2007-08-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexLibrary.cs,
- MonoDevelop.RegexToolkit/RegexToolkit.cs,
- MonoDevelop.RegexToolkit/Commands.cs,
- MonoDevelop.RegexToolkit/Webservices.cs,
- gtk-gui/MonoDevelop.RegexToolkit.RegexLibrary.cs,
- gtk-gui/MonoDevelop.RegexToolkit.RegexToolkit.cs: Added regular
- expression library to the regex toolkit.
-
-2007-08-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexToolkit.cs,
- gtk-gui/MonoDevelop.RegexToolkit.RegexToolkit.cs: Regex toolkit now
- supports replacement expressions.
-
-2007-07-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexToolkit.cs, RegexElements.xml: Worked
- on tooltips.
-
-2007-07-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexToolkit.cs: worked on regex toolkit.
-
-2007-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexToolkit.cs,
- gtk-gui/MonoDevelop.RegexToolkit.RegexToolkit.cs: Worked on regex
- toolkit.
-
-2007-07-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit/RegexToolkit.cs, RegexElements.xml,
- gtk-gui/MonoDevelop.RegexToolkit.RegexToolkit.cs: Worked on regex
- toolkit.
-
-2007-07-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.RegexToolkit.addin.xml,
- MonoDevelop.RegexToolkit/RegexToolkit.cs,
- MonoDevelop.RegexToolkit/Commands.cs: Initial checkin.
-
diff --git a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj
index 707c2c6c9a..693ad315a0 100644
--- a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj
+++ b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit.csproj
@@ -62,6 +62,30 @@
<Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<SpecificVersion>False</SpecificVersion>
</Reference>
+ <Reference Include="Microsoft.CodeAnalysis.CSharp">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.CSharp.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.CSharp.Workspaces">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.CSharp.Workspaces.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis">
+ <HintPath>..\..\..\build\bin\Microsoft.CodeAnalysis.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.Workspaces">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.Workspaces.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Composition.AttributedModel">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Composition.AttributedModel.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Collections.Immutable">
+ <HintPath>..\..\..\build\bin\System.Collections.Immutable.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
@@ -79,16 +103,6 @@
<Name>MonoDevelop.Ide</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
- <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
- <Name>ICSharpCode.NRefactory</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
- <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
- <Name>Mono.TextEditor</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\..\..\external\mono-addins\Mono.Addins\Mono.Addins.csproj">
<Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
<Name>Mono.Addins</Name>
@@ -104,6 +118,7 @@
<Compile Include="MonoDevelop.RegexToolkit\ElementHelpWidget.cs" />
<Compile Include="gtk-gui\MonoDevelop.RegexToolkit.ElementHelpWidget.cs" />
<Compile Include="AddinInfo.cs" />
+ <Compile Include="MonoDevelop.RegexToolkit\ValidateActionCodeRefactoringProvider.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="gtk-gui\gui.stetic">
diff --git a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/Commands.cs b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/Commands.cs
index 044f2705aa..0889c8ddcb 100644
--- a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/Commands.cs
+++ b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/Commands.cs
@@ -27,11 +27,13 @@
//
using System;
+using MonoDevelop.Components;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide;
using Gtk;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Core;
+using System.Threading.Tasks;
namespace MonoDevelop.RegexToolkit
{
@@ -40,11 +42,11 @@ namespace MonoDevelop.RegexToolkit
ShowRegexToolkit
}
- class ViewOnlyContent : AbstractViewContent
+ class ViewOnlyContent : ViewContent
{
Widget widget;
-
- public override Widget Control {
+
+ public override Control Control {
get {
return widget;
}
@@ -54,21 +56,20 @@ namespace MonoDevelop.RegexToolkit
{
this.widget = widget;
this.ContentName = contentName;
- IsViewOnly = true;
}
-
- public override void Load (string fileName)
- {
- throw new System.NotImplementedException ();
+
+ public override bool IsViewOnly {
+ get {
+ return true;
+ }
}
-
}
- class DefaultAttachableViewContent : AbstractAttachableViewContent
+ class DefaultAttachableViewContent : BaseViewContent
{
Widget widget;
-
- public override Widget Control {
+
+ public override Control Control {
get {
return widget;
}
@@ -91,18 +92,24 @@ namespace MonoDevelop.RegexToolkit
{
protected override void Run ()
{
+ RunRegexWindow ();
+ }
+
+ public static RegexToolkitWidget RunRegexWindow ()
+ {
foreach (var document in IdeApp.Workbench.Documents) {
- if (document.Window.ViewContent.Control is RegexToolkitWidget) {
+ if (document.Window.ViewContent.Control.GetNativeWidget<Gtk.Widget> () is RegexToolkitWidget) {
document.Window.SelectWindow ();
- return;
+ return (RegexToolkitWidget)document.Window.ViewContent.Control;
}
}
var regexToolkit = new RegexToolkitWidget ();
var newDocument = IdeApp.Workbench.OpenDocument (new ViewOnlyContent (regexToolkit, GettextCatalog.GetString ("Regex Toolkit")), true);
-
+
var elementHelp = new ElementHelpWidget (newDocument.Window, regexToolkit);
-
+
newDocument.Window.AttachViewContent (new DefaultAttachableViewContent (elementHelp, GettextCatalog.GetString ("Elements")));
+ return regexToolkit;
}
}
diff --git a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/ElementHelpWidget.cs b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/ElementHelpWidget.cs
index c9e7b682f5..fc0e540066 100644
--- a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/ElementHelpWidget.cs
+++ b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/ElementHelpWidget.cs
@@ -36,7 +36,7 @@ using MonoDevelop.Components;
namespace MonoDevelop.RegexToolkit
{
[System.ComponentModel.ToolboxItem(true)]
- partial class ElementHelpWidget : Gtk.Bin
+ internal partial class ElementHelpWidget : Gtk.Bin
{
TreeStore elementsStore;
// IWorkbenchWindow workbenchWindow;
diff --git a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/RegexToolkitWidget.cs b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/RegexToolkitWidget.cs
index ecd1defcba..2cf57d534b 100644
--- a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/RegexToolkitWidget.cs
+++ b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/RegexToolkitWidget.cs
@@ -42,7 +42,14 @@ namespace MonoDevelop.RegexToolkit
TreeStore resultStore;
Thread regexThread;
-
+ public string Regex {
+ get {
+ return entryRegEx.Text;
+ }
+ set {
+ entryRegEx.Text = value;
+ }
+ }
public RegexToolkitWidget ()
{
this.Build ();
@@ -59,7 +66,7 @@ namespace MonoDevelop.RegexToolkit
if (regexThread != null && regexThread.IsAlive) {
regexThread.Abort ();
regexThread.Join ();
- SetButtonStart (GettextCatalog.GetString ("Start Regular E_xpression"), "gtk-media-play");
+ SetButtonStart (GettextCatalog.GetString ("Start Regular E_xpression"), "gtk-execute");
regexThread = null;
return;
}
@@ -171,16 +178,16 @@ namespace MonoDevelop.RegexToolkit
} finally {
regexThread = null;
Application.Invoke (delegate {
- SetButtonStart (GettextCatalog.GetString ("Start Regular E_xpression"), "gtk-media-play");
+ SetButtonStart (GettextCatalog.GetString ("Start Regular E_xpression"), "gtk-execute");
});
}
}
void SetButtonStart (string text, string icon)
{
- ((Gtk.Label)((Gtk.HBox)((Gtk.Alignment)this.buttonStart.Child).Child).Children [1]).Text = text;
- ((Gtk.Label)((Gtk.HBox)((Gtk.Alignment)this.buttonStart.Child).Child).Children [1]).UseUnderline = true;
- ((Gtk.Image)((Gtk.HBox)((Gtk.Alignment)this.buttonStart.Child).Child).Children [0]).Pixbuf = global::Stetic.IconLoader.LoadIcon (this, icon, global::Gtk.IconSize.Menu);
+ buttonStartLabel.Text = text;
+ buttonStartLabel.UseUnderline = true;
+ buttonStartIcon.SetIcon (icon, IconSize.Menu);
}
diff --git a/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/ValidateActionCodeRefactoringProvider.cs b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/ValidateActionCodeRefactoringProvider.cs
new file mode 100644
index 0000000000..8b7bd5a146
--- /dev/null
+++ b/main/src/addins/MonoDevelop.RegexToolkit/MonoDevelop.RegexToolkit/ValidateActionCodeRefactoringProvider.cs
@@ -0,0 +1,117 @@
+//
+// ValidateActionCodeRefactoringProvider.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Threading;
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis.CodeRefactorings;
+using Microsoft.CodeAnalysis;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.CodeActions;
+using Microsoft.CodeAnalysis.Text;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.Formatting;
+using MonoDevelop.Core;
+using MonoDevelop.RegexToolkit;
+
+namespace RefactoringEssentials.CSharp.CodeRefactorings
+{
+ [ExportCodeRefactoringProvider(LanguageNames.CSharp, Name = "Validate regular expression")]
+ public class ValidateActionCodeRefactoringProvider : CodeRefactoringProvider
+ {
+ public sealed override async Task ComputeRefactoringsAsync(CodeRefactoringContext context)
+ {
+ var document = context.Document;
+ if (document.Project.Solution.Workspace.Kind == WorkspaceKind.MiscellaneousFiles)
+ return;
+ var span = context.Span;
+ if (!span.IsEmpty)
+ return;
+ var cancellationToken = context.CancellationToken;
+ if (cancellationToken.IsCancellationRequested)
+ return;
+
+ var model = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
+ //if (model.IsFromGeneratedCode(cancellationToken))
+ // return;
+ var root = await model.SyntaxTree.GetRootAsync(cancellationToken).ConfigureAwait(false);
+ if (!root.Span.Contains (span))
+ return;
+ var node = root.FindNode(span, false, true);
+ if (!node.IsKind(SyntaxKind.StringLiteralExpression))
+ return;
+ var argument = node.Parent as ArgumentSyntax;
+ if (argument == null)
+ return;
+ var list = argument.Parent as ArgumentListSyntax;
+
+ var invocation = argument.Parent?.Parent as InvocationExpressionSyntax;
+ if (invocation != null) {
+ var info = model.GetSymbolInfo (invocation);
+ if (!IsRegexMatchMethod (info) || list.Arguments [1] != argument)
+ return;
+ }
+
+ var oce = argument.Parent?.Parent as ObjectCreationExpressionSyntax;
+ if (oce != null) {
+ var info = model.GetSymbolInfo (oce);
+ if (info.Symbol == null || !IsRegexType (info.Symbol.ContainingType) || list.Arguments [0] != argument)
+ return;
+ }
+
+ var regex = model.GetConstantValue (node);
+ if (!regex.HasValue)
+ return;
+
+ context.RegisterRefactoring (CodeAction.Create(
+ GettextCatalog.GetString("Validate regular expression"),
+ t2 => {
+ ShowRegexToolkitHandler.RunRegexWindow ().Regex = regex.Value.ToString ();
+ return Task.FromResult(document);
+ }
+ ));
+ }
+
+ internal static bool IsRegexMatchMethod (SymbolInfo symbolInfo)
+ {
+ var symbol = symbolInfo.Symbol;
+ if (symbol == null)
+ return false;
+ return IsRegexType (symbol.ContainingType) && symbol.IsStatic && (symbol.Name == "IsMatch" || symbol.Name == "Match" || symbol.Name == "Matches");
+ }
+
+ internal static bool IsRegexConstructor (SymbolInfo symbolInfo)
+ {
+ return symbolInfo.Symbol?.ContainingType is INamedTypeSymbol && IsRegexType (symbolInfo.Symbol.ContainingType);
+ }
+
+ internal static bool IsRegexType (INamedTypeSymbol containingType)
+ {
+ return containingType != null && containingType.Name == "Regex" && containingType.ContainingNamespace.ToDisplayString () == "System.Text.RegularExpressions";
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.RegexToolkit/gtk-gui/MonoDevelop.RegexToolkit.ElementHelpWidget.cs b/main/src/addins/MonoDevelop.RegexToolkit/gtk-gui/MonoDevelop.RegexToolkit.ElementHelpWidget.cs
index 0caf4e91ee..c49c20c8c0 100644
--- a/main/src/addins/MonoDevelop.RegexToolkit/gtk-gui/MonoDevelop.RegexToolkit.ElementHelpWidget.cs
+++ b/main/src/addins/MonoDevelop.RegexToolkit/gtk-gui/MonoDevelop.RegexToolkit.ElementHelpWidget.cs
@@ -2,11 +2,14 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.RegexToolkit
{
- partial class ElementHelpWidget
+ internal partial class ElementHelpWidget
{
private global::Gtk.VBox vbox4;
+
private global::Gtk.Label label11;
+
private global::Gtk.ScrolledWindow elementsscrolledwindow;
+
private global::Gtk.TreeView elementsTreeview;
protected virtual void Build ()
diff --git a/main/src/addins/MonoDevelop.RegexToolkit/gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWidget.cs b/main/src/addins/MonoDevelop.RegexToolkit/gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWidget.cs
index ececd80c33..8145fc8684 100644
--- a/main/src/addins/MonoDevelop.RegexToolkit/gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWidget.cs
+++ b/main/src/addins/MonoDevelop.RegexToolkit/gtk-gui/MonoDevelop.RegexToolkit.RegexToolkitWidget.cs
@@ -5,34 +5,69 @@ namespace MonoDevelop.RegexToolkit
internal partial class RegexToolkitWidget
{
private global::Gtk.VBox vbox2;
+
private global::Gtk.VPaned vpaned1;
+
private global::Gtk.VBox vbox1;
+
private global::Gtk.HBox hbox1;
+
private global::Gtk.VBox vbox6;
+
private global::Gtk.Label label8;
+
private global::Gtk.Entry entryRegEx;
+
private global::Gtk.VBox vbox3;
+
private global::Gtk.CheckButton checkbuttonReplace;
+
private global::Gtk.Entry entryReplace;
+
private global::Gtk.HBox hbox7;
+
private global::Gtk.Button buttonStart;
+
+ private global::Gtk.HBox buttonStartHbox;
+
+ private global::MonoDevelop.Components.ImageView buttonStartIcon;
+
+ private global::Gtk.Label buttonStartLabel;
+
private global::Gtk.CheckButton expandMatches;
+
private global::Gtk.VBox vbox4;
+
private global::Gtk.Label label10;
+
private global::Gtk.ScrolledWindow scrolledwindow5;
+
private global::Gtk.TreeView optionsTreeview;
+
private global::Gtk.VBox HelpWidget;
+
private global::Gtk.Label label9;
+
private global::Gtk.HBox hbox5;
+
private global::Gtk.ScrolledWindow scrolledwindow1;
+
private global::Gtk.TextView inputTextview;
+
private global::Gtk.HBox hbox4;
+
private global::Gtk.Notebook notebook2;
+
private global::Gtk.ScrolledWindow scrolledwindow2;
+
private global::Gtk.TreeView resultsTreeview;
+
private global::Gtk.Label label3;
+
private global::Gtk.ScrolledWindow scrolledwindow4;
+
private global::Gtk.TextView replaceResultTextview;
+
private global::Gtk.Label label4;
protected virtual void Build ()
@@ -123,17 +158,37 @@ namespace MonoDevelop.RegexToolkit
this.buttonStart.CanDefault = true;
this.buttonStart.CanFocus = true;
this.buttonStart.Name = "buttonStart";
- this.buttonStart.UseUnderline = true;
- this.buttonStart.Label = global::Mono.Unix.Catalog.GetString ("Start Regular E_xpression");
- global::Gtk.Image w5 = new global::Gtk.Image ();
- w5.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-media-play", global::Gtk.IconSize.Menu);
- this.buttonStart.Image = w5;
- this.hbox7.Add (this.buttonStart);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox7 [this.buttonStart]));
- w6.PackType = ((global::Gtk.PackType)(1));
- w6.Position = 0;
+ // Container child buttonStart.Gtk.Container+ContainerChild
+ this.buttonStartHbox = new global::Gtk.HBox ();
+ this.buttonStartHbox.Name = "buttonStartHbox";
+ this.buttonStartHbox.Spacing = 2;
+ // Container child buttonStartHbox.Gtk.Box+BoxChild
+ this.buttonStartIcon = new global::MonoDevelop.Components.ImageView ();
+ this.buttonStartIcon.Name = "buttonStartIcon";
+ this.buttonStartIcon.IconId = "gtk-execute";
+ this.buttonStartIcon.IconSize = ((global::Gtk.IconSize)(1));
+ this.buttonStartHbox.Add (this.buttonStartIcon);
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.buttonStartHbox [this.buttonStartIcon]));
+ w5.Position = 0;
+ w5.Expand = false;
+ w5.Fill = false;
+ // Container child buttonStartHbox.Gtk.Box+BoxChild
+ this.buttonStartLabel = new global::Gtk.Label ();
+ this.buttonStartLabel.Name = "buttonStartLabel";
+ this.buttonStartLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Start Regular E_xpression");
+ this.buttonStartLabel.UseUnderline = true;
+ this.buttonStartHbox.Add (this.buttonStartLabel);
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.buttonStartHbox [this.buttonStartLabel]));
+ w6.Position = 1;
w6.Expand = false;
w6.Fill = false;
+ this.buttonStart.Add (this.buttonStartHbox);
+ this.hbox7.Add (this.buttonStart);
+ global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox7 [this.buttonStart]));
+ w8.PackType = ((global::Gtk.PackType)(1));
+ w8.Position = 0;
+ w8.Expand = false;
+ w8.Fill = false;
// Container child hbox7.Gtk.Box+BoxChild
this.expandMatches = new global::Gtk.CheckButton ();
this.expandMatches.CanFocus = true;
@@ -144,23 +199,23 @@ namespace MonoDevelop.RegexToolkit
this.expandMatches.UseUnderline = true;
this.expandMatches.BorderWidth = ((uint)(3));
this.hbox7.Add (this.expandMatches);
- global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox7 [this.expandMatches]));
- w7.Position = 1;
- w7.Expand = false;
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox7 [this.expandMatches]));
+ w9.Position = 1;
+ w9.Expand = false;
this.vbox3.Add (this.hbox7);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox7]));
- w8.PackType = ((global::Gtk.PackType)(1));
- w8.Position = 2;
- w8.Expand = false;
- w8.Fill = false;
+ global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox7]));
+ w10.PackType = ((global::Gtk.PackType)(1));
+ w10.Position = 2;
+ w10.Expand = false;
+ w10.Fill = false;
this.vbox6.Add (this.vbox3);
- global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.vbox3]));
- w9.Position = 2;
- w9.Expand = false;
- w9.Fill = false;
+ global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.vbox3]));
+ w11.Position = 2;
+ w11.Expand = false;
+ w11.Fill = false;
this.hbox1.Add (this.vbox6);
- global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox6]));
- w10.Position = 0;
+ global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox6]));
+ w12.Position = 0;
// Container child hbox1.Gtk.Box+BoxChild
this.vbox4 = new global::Gtk.VBox ();
this.vbox4.Name = "vbox4";
@@ -173,10 +228,10 @@ namespace MonoDevelop.RegexToolkit
this.label10.UseMarkup = true;
this.label10.UseUnderline = true;
this.vbox4.Add (this.label10);
- global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.label10]));
- w11.Position = 0;
- w11.Expand = false;
- w11.Fill = false;
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.label10]));
+ w13.Position = 0;
+ w13.Expand = false;
+ w13.Fill = false;
// Container child vbox4.Gtk.Box+BoxChild
this.scrolledwindow5 = new global::Gtk.ScrolledWindow ();
this.scrolledwindow5.CanFocus = true;
@@ -188,18 +243,18 @@ namespace MonoDevelop.RegexToolkit
this.optionsTreeview.Name = "optionsTreeview";
this.scrolledwindow5.Add (this.optionsTreeview);
this.vbox4.Add (this.scrolledwindow5);
- global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.scrolledwindow5]));
- w13.Position = 1;
+ global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.scrolledwindow5]));
+ w15.Position = 1;
this.hbox1.Add (this.vbox4);
- global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox4]));
- w14.Position = 1;
- w14.Expand = false;
- w14.Fill = false;
+ global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox4]));
+ w16.Position = 1;
+ w16.Expand = false;
+ w16.Fill = false;
this.vbox1.Add (this.hbox1);
- global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox1]));
- w15.Position = 0;
- w15.Expand = false;
- w15.Fill = false;
+ global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox1]));
+ w17.Position = 0;
+ w17.Expand = false;
+ w17.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
this.HelpWidget = new global::Gtk.VBox ();
this.HelpWidget.Name = "HelpWidget";
@@ -213,10 +268,10 @@ namespace MonoDevelop.RegexToolkit
this.label9.UseMarkup = true;
this.label9.UseUnderline = true;
this.HelpWidget.Add (this.label9);
- global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.HelpWidget [this.label9]));
- w16.Position = 0;
- w16.Expand = false;
- w16.Fill = false;
+ global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.HelpWidget [this.label9]));
+ w18.Position = 0;
+ w18.Expand = false;
+ w18.Fill = false;
// Container child HelpWidget.Gtk.Box+BoxChild
this.hbox5 = new global::Gtk.HBox ();
this.hbox5.Name = "hbox5";
@@ -232,21 +287,21 @@ namespace MonoDevelop.RegexToolkit
this.inputTextview.Name = "inputTextview";
this.scrolledwindow1.Add (this.inputTextview);
this.hbox5.Add (this.scrolledwindow1);
- global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.hbox5 [this.scrolledwindow1]));
- w18.Position = 0;
+ global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox5 [this.scrolledwindow1]));
+ w20.Position = 0;
this.HelpWidget.Add (this.hbox5);
- global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.HelpWidget [this.hbox5]));
- w19.Position = 1;
+ global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.HelpWidget [this.hbox5]));
+ w21.Position = 1;
this.vbox1.Add (this.HelpWidget);
- global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.HelpWidget]));
- w20.Position = 1;
+ global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.HelpWidget]));
+ w22.Position = 1;
this.vpaned1.Add (this.vbox1);
- global::Gtk.Paned.PanedChild w21 = ((global::Gtk.Paned.PanedChild)(this.vpaned1 [this.vbox1]));
- w21.Resize = false;
+ global::Gtk.Paned.PanedChild w23 = ((global::Gtk.Paned.PanedChild)(this.vpaned1 [this.vbox1]));
+ w23.Resize = false;
// Container child vpaned1.Gtk.Paned+PanedChild
this.hbox4 = new global::Gtk.HBox ();
this.hbox4.Name = "hbox4";
- this.hbox4.Spacing = 6;
+ this.hbox4.Spacing = 6;
this.hbox4.BorderWidth = ((uint)(6));
// Container child hbox4.Gtk.Box+BoxChild
this.notebook2 = new global::Gtk.Notebook ();
@@ -283,8 +338,8 @@ namespace MonoDevelop.RegexToolkit
this.replaceResultTextview.CursorVisible = false;
this.scrolledwindow4.Add (this.replaceResultTextview);
this.notebook2.Add (this.scrolledwindow4);
- global::Gtk.Notebook.NotebookChild w25 = ((global::Gtk.Notebook.NotebookChild)(this.notebook2 [this.scrolledwindow4]));
- w25.Position = 1;
+ global::Gtk.Notebook.NotebookChild w27 = ((global::Gtk.Notebook.NotebookChild)(this.notebook2 [this.scrolledwindow4]));
+ w27.Position = 1;
// Notebook tab
this.label4 = new global::Gtk.Label ();
this.label4.Name = "label4";
@@ -292,12 +347,12 @@ namespace MonoDevelop.RegexToolkit
this.notebook2.SetTabLabel (this.scrolledwindow4, this.label4);
this.label4.ShowAll ();
this.hbox4.Add (this.notebook2);
- global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.notebook2]));
- w26.Position = 0;
+ global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.notebook2]));
+ w28.Position = 0;
this.vpaned1.Add (this.hbox4);
this.vbox2.Add (this.vpaned1);
- global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.vpaned1]));
- w28.Position = 0;
+ global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.vpaned1]));
+ w30.Position = 0;
this.Add (this.vbox2);
if ((this.Child != null)) {
this.Child.ShowAll ();
diff --git a/main/src/addins/MonoDevelop.RegexToolkit/gtk-gui/generated.cs b/main/src/addins/MonoDevelop.RegexToolkit/gtk-gui/generated.cs
index 0ada9fc5f0..75935e2e55 100644
--- a/main/src/addins/MonoDevelop.RegexToolkit/gtk-gui/generated.cs
+++ b/main/src/addins/MonoDevelop.RegexToolkit/gtk-gui/generated.cs
@@ -66,40 +66,6 @@ namespace Stetic
}
}
- internal class IconLoader
- {
- public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size)
- {
- Gdk.Pixbuf res = widget.RenderIcon (name, size, null);
- if ((res != null)) {
- return res;
- } else {
- int sz;
- int sy;
- global::Gtk.Icon.SizeLookup (size, out sz, out sy);
- try {
- return Gtk.IconTheme.Default.LoadIcon (name, sz, 0);
- } catch (System.Exception) {
- if ((name != "gtk-missing-image")) {
- return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size);
- } else {
- Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz);
- Gdk.GC gc = new Gdk.GC (pmap);
- gc.RgbFgColor = new Gdk.Color (255, 255, 255);
- pmap.DrawRectangle (gc, true, 0, 0, sz, sz);
- gc.RgbFgColor = new Gdk.Color (0, 0, 0);
- pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1));
- gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
- gc.RgbFgColor = new Gdk.Color (255, 0, 0);
- pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4)));
- pmap.DrawLine (gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)));
- return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
- }
- }
- }
- }
- }
-
internal class ActionGroups
{
public static Gtk.ActionGroup GetActionGroup (System.Type type)
diff --git a/main/src/addins/MonoDevelop.RegexToolkit/gtk-gui/gui.stetic b/main/src/addins/MonoDevelop.RegexToolkit/gtk-gui/gui.stetic
index 426ce9fe4f..e34438ae6d 100644
--- a/main/src/addins/MonoDevelop.RegexToolkit/gtk-gui/gui.stetic
+++ b/main/src/addins/MonoDevelop.RegexToolkit/gtk-gui/gui.stetic
@@ -110,10 +110,39 @@
<property name="MemberName" />
<property name="CanDefault">True</property>
<property name="CanFocus">True</property>
- <property name="Type">TextAndIcon</property>
- <property name="Icon">stock:gtk-media-play Menu</property>
- <property name="Label" translatable="yes">Start Regular E_xpression</property>
- <property name="UseUnderline">True</property>
+ <property name="Type">Custom</property>
+ <child>
+ <widget class="Gtk.HBox" id="buttonStartHbox">
+ <property name="MemberName" />
+ <property name="Spacing">2</property>
+ <child>
+ <widget class="MonoDevelop.Components.ImageView" id="buttonStartIcon">
+ <property name="MemberName" />
+ <property name="IconId">gtk-execute</property>
+ <property name="IconSize">Menu</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="buttonStartLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">Start Regular E_xpression</property>
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
</widget>
<packing>
<property name="PackType">End</property>
@@ -356,6 +385,7 @@
<widget class="Gtk.Bin" id="MonoDevelop.RegexToolkit.ElementHelpWidget" design-size="300 300">
<property name="MemberName" />
<property name="Visible">False</property>
+ <property name="GeneratePublic">False</property>
<child>
<widget class="Gtk.VBox" id="vbox4">
<property name="MemberName" />
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/AssemblyInfo.cs b/main/src/addins/MonoDevelop.SourceEditor2/AssemblyInfo.cs
index f9f893a74a..f4bee85833 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/AssemblyInfo.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/AssemblyInfo.cs
@@ -8,3 +8,5 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyDescription ("Provides a text editor for the MonoDevelop based on Mono.TextEditor")]
[assembly: AssemblyVersion ("2.6")]
[assembly: InternalsVisibleTo("UnitTests")]
+[assembly: InternalsVisibleTo("MonoDevelop.VersionControl")]
+[assembly: InternalsVisibleTo("MonoDevelop.Refactoring")]
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/ChangeLog b/main/src/addins/MonoDevelop.SourceEditor2/ChangeLog
deleted file mode 100644
index a409adf06e..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/ChangeLog
+++ /dev/null
@@ -1,5017 +0,0 @@
-2010-07-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Optimized
- document loading.
-
-2010-07-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/AutoSave.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Auto save
- thread is now shared.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Moved the
- SetCaretTo to the mono.texteditor.
-
-2010-07-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Track API
- changes.
-
-2010-07-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Track API
- changes.
-
-2010-07-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: added null
- check.-
-
-2010-07-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed 'Bug
- 622214 - NullReferenceException when closing file tab'.
-
-2010-07-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Unsubscribe
- the recently added file change events, check if the widget's
- disposed to avoid NRE, and avoid an unnecessary closure
- creation.
-
-2010-07-13 Levi Bard <levi@unity3d.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- Also respond to FileService events.
-
-2010-07-13 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * gtk-gui/objects.xml:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor/NavigationBar.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs:
- * MonoDevelop.SourceEditor/ISourceEditorOptions.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:
- * MonoDevelop.SourceEditor/DropDownBoxListWindow.cs:
- * MonoDevelop.SourceEditor/NavigationBarCommands.cs:
- * MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs:
- * MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- Removed old unused quick finder code/moved dropdownbox to
- components.
-
-2010-07-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Replaced
- custom workerthread with
- system.compontentmodel.backgroundworker.
-
-2010-07-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Track
- ProjectDomService/Parser API.
-
-2010-07-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Handled some
- potential threading issues.-
-
-2010-07-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Track API
- changes.
-
-2010-07-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Simplified
- call.
-
-2010-07-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: added null
- check.
-
-2010-07-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Disabled the
- navigation bar subsystem - it got replaced by the pathed
- document subsystem.
-
-2010-06-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs: Fixed
- 'Bug 616949 - Message bubbles prevents the background color
- of selected text to change'.
-
-2010-06-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs: Fixed
- 'Bug 616001 - Inline errors don't completely vanish after
- build'.
-
-2010-06-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed 'Bug
- 613825 - Auto-complete on highlighted text overwrites
- following characters'.
-
-2010-06-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed
- breakpoint text markers.
-
-2010-06-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fixed 'Bug
- 613114 - NRE in editor means error marker never goes away'.
-
-2010-06-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs: Use a
- system font for bubbles.
-
-2010-06-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed 'Bug
- 611202 - Move line up/down command fails in aspx files'.
-
-
-2010-06-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: check if
- search&replace widget is open.
-
-2010-06-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fixed 'Bug
- 610204 - Find-as-you-type-bar with Chrome style broke a good
- use case of the find-bar with Firefox style'.
-
-2010-05-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs: Fixed
- 'Bug 610099 - Typing in lines with bubbles very slow'.
-
-
-2010-05-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:
- Generalized method.
-
-2010-05-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:
- Generalized method.
-
-2010-05-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs: Worked
- on message bubbles.
-
-2010-05-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs: Removed
- the message bubble focus inactive toggle (it's still
- inactive, if the line has changed).
-
-2010-05-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs: Removed
- debug message.
-
-2010-05-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Removed
- message box which informs of undo past save point.
-
-2010-05-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs: fixed
- little selection drawing issue.
-
-2010-05-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/MessageBubbleHighlightPopupWindow.cs:
- Fix text alignment.
-
-2010-05-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/MessageBubbleHighlightPopupWindow.cs:
- Track API.
-
-2010-05-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/MessageBubbleHighlightPopupWindow.cs:
- Use new BounceFadePopupWindow class.
-
-2010-05-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs: Fixed
- some drawing issues.
-
-2010-05-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs:
- * MonoDevelop.SourceEditor/MessageBubbleHighlightPopupWindow.cs:
- Worked on message bubble popups
-
-2010-05-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs:
- Corrected some minor drawing issues.
-
-2010-05-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs: Clip
- selection region.
-
-2010-05-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs:
- * MonoDevelop.SourceEditor/MessageBubbleHighlightPopupWindow.cs:
- The message bubbles can now draw selected regions.
-
-2010-05-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Removed debug
- code.
-
-2010-05-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs: Ensures
- that the layout is created.
-
-2010-05-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs: Fixed
- some issues with message bubbles.
-
-2010-05-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs:
- * MonoDevelop.SourceEditor/MessageBubbleHighlightPopupWindow.cs:
- Worked on text editor styling.
-
-2010-05-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- Used smartscrolledwindow.
-
-2010-05-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Used the
- standard scrolled window again.
-
-2010-05-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Added
- border around the text editor & fixed some splitting issues.
-
-2010-05-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Used compact
- scrolled window.
-
-2010-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs: Clea
- up path API.
-
- * MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs:
- Clean up dialog placement.
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- Flush.
-
-2010-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Disable the
- search result animation as it looks rather ugly right now.
-
- * MonoDevelop.SourceEditor/MessageBubbleHighlightPopupWindow.cs:
- Tweak.
-
-2010-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Unsubscribe
- options change event.
-
- * MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs:
- Subscribe the options changed event only once.
-
-2010-05-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/MessageBubbleHighlightPopupWindow.cs:
- Speed up animation & made it a bit smaller.
-
-2010-05-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs:
- * MonoDevelop.SourceEditor/MessageBubbleHighlightPopupWindow.cs:
- Tweaked error bubble popup drawing a bit.
-
-2010-05-21 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs:
- * MonoDevelop.SourceEditor/MessageBubbleHighlightPopupWindow.cs:
- Added message bubble popup animation/fixed bug in message
- bubble calculation.
-
-2010-05-21 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs: Worked
- on message bubbles.
-
-2010-05-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs: Fixed 'Bug
- 607311 - MouseOver cause MD to crash'.
-
-2010-05-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed 'Bug
- 533918 - Scroll position "jumps" first time editor tab is
- shown'.
-
-2010-05-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml: Fix keybindings.
-
-2010-05-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Escape in a
- 'do you want to continue' dialog should cancel.
-
-2010-05-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs: Provide
- tooltips for message bubbles.
-
-2010-05-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Improved the
- error bubble drawing.
-
-2010-05-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Expanded
- message bubbles now overdraw lines instead of inserting
- virtual space.
-
-2010-05-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Implemented
- 'Bug 606978 - Warning message when undoing past save point'.
-
-2010-05-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Track code
- template API.
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Track code
- template API and toolbox API.
-
-2010-05-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DropDownBox.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:
- * MonoDevelop.SourceEditor/DropDownBoxListWindow.cs: Improved
- multi monitor support.
-
-2010-05-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Use
- ViActions.Join as EditorCommands.JoinWithNextLine, since
- it's more efficient and supports joining multiple lines.
-
-2010-05-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Removed debug
- message.
-
-2010-05-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: Display
- resolve errors in the tooltip.
-
-2010-05-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs: Fixed selection
- drawing error.
-
-2010-05-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Optimized
- speed of message bubbles.
-
-2010-05-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Fixed
- 'Bug 605000 - Search history does not include recent
- searches in current editor'.
-
-2010-05-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorPrintOperation.cs: Use
- PangoUtil to create the PangoLayout to avoid a leak.
-
-2010-05-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/StatusBox.cs: Nullify editor
- reference to help tracking leaks.
-
-2010-05-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemTooltipProvider.cs:
- Removed debug message/handled null case.
-
-2010-05-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs:
- * MonoDevelop.SourceEditor/LanguageItemTooltipProvider.cs:
- * MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs:
- Track API changes.
-
-2010-05-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: implemented
- 'Bug 603984 - Control-f with selection while search open
- should use selection'.
-
-2010-05-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Check for
- empty and null.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Make use
- of the new Document.Dom property.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Fix auto
- insert bracket issue.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed
- possible null ref.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Auto expand
- multiple error bubbles when the caret is in a line that
- contains a multi error bubble.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Fixed 'Bug
- 603113 - Automatic window scrolling hides completion
- window'.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed
- breakpoint update.
-
-2010-05-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Added bounds
- check.
-
-2010-05-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed update
- breakpoint slowness problem.
-
-2010-05-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml: Removed some duplicate
- entries/put toggle code focus command into the text editor
- context menu.
-
-2010-05-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs: free
- delegate reference.
-
-2010-05-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Track
- API changes.
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: Ensure that
- created font description is destroyed.
-
-2010-04-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Moved the
- command handlers to the view.
-
-2010-04-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/GotoLineNumberWidget.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Fixed
- IntPtr exception.
-
-2010-04-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Always fire
- the CaretPositionSet event when the caret position changes.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Widgets from
- views are now destroyed by the workspace window.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed 'Bug
- 600671 - Text painting gets into a weird state'.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml: added the toggle message
- bubble command to the main menu message bubble submenu.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml:
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/SourceEditorCommands.cs: Fixed 'Bug
- 600622 – Can't set a breakpoint on line with inline
- error/warning'.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Fixed 'Bug
- 600609 - Parameter tooltips should hide when scrolling
- editor'.
-
-2010-04-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/DebugValueWindow.cs: Accept getting
- the focus only when the mouse is moved inside the window.
-
-2010-04-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemTooltipProvider.cs:
- Added some null checks.
-
-2010-04-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/GotoLineNumberWidget.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Added
- some HACK comments.
-
-2010-04-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/GotoLineNumberWidget.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Worked
- on mac bugfix.
-
-2010-04-22 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * MonoDevelop.SourceEditor/GotoLineNumberWidget.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.GotoLineNumberWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs:
- Take back last commit.
-
-2010-04-22 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * MonoDevelop.SourceEditor/GotoLineNumberWidget.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.GotoLineNumberWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs:
- Found other solution to mac drawing problem.
-
-2010-04-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemTooltipProvider.cs:
- Fixed 'Bug 598203 - Tooltip shows too fast, follows mouse,
- and flickers'.
-
-2010-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Removed
- intptr constructor.
-
-2010-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed find
- issue.
-
-2010-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: provided int
- ptr constructor.
-
-2010-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/GotoLineNumberWidget.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Worked
- on mac disappearing buttons work around.
-
-2010-04-20 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.SourceEditor.GotoLineNumberWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs:
- Fixed 'Bug 597672 - Search bar icons vanish when moving
- across them mouse right to left'.
-
-2010-04-19 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor.addin.xml:
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/MessageBubbleCommands.cs: Worked on
- message bubbles/Added some bubble commands to the view menu.
-
-2010-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Unregister
- pinned watch control when the watch is removed.
-
- * MonoDevelop.SourceEditor/PinnedWatchWidget.cs: Embed an
- ObjectValueTreeView instance instead of a custom value
- viewer.
-
-2010-04-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: fixed warning.
-
-2010-04-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Optimized
- error bubbles.
-
-2010-04-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: checked
- document == null.
-
-2010-04-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Levi Bard
- <levi@unity3d.com> Cache selection mode.
-
-2010-04-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed 'Bug
- 596511 - Code completion removes block selection and only
- affects 1 line'
-
-2010-04-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: ContentName
- can be null if the file is not saved.
-
-2010-04-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Added some
- checks to avoid updating breakpoints when the editor has
- been disposed.
-
-2010-04-13 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs:
- * MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs:
- Implemented 'Bug 595598 - Intelligent placing of
- semi-colons'.
-
-2010-04-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Implemented
- 'Bug 595587 - Move code block to correct depth when
- Alt+arrow moving'.
-
-2010-04-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed 'Bug
- 595584 - Code completion leaves the cursor in the wrong
- place'.
-
-2010-04-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Fixed 'Bug
- 595601 - Make "add matching quote" aware of whether or not
- it is within a string already'.
-
-2010-04-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Text
- editor extension is disposed in Document.
-
-2010-04-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Dispose
- text editor extensions.
-
-2010-04-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Implemented
- command for 'Bug 595228 - Block selection should be usable
- from keyboard'
-
-2010-04-09 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor/DebugValueMarker.cs: Removed
- debugvaluemarker (it's now done by pinnedquickwatch).
-
-2010-04-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/DebugValueWindow.cs: Removed
- unnecessary unselection code.
-
-2010-04-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/DebugValueWindow.cs: Converted to a
- TopLevel window, so that it can get proper focus and the
- value entry works as expected.
-
-2010-04-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed 'Bug
- 594370 - NRE in source editor crashed MD'.
-
-2010-04-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs:
- Implemented use selection for find/replace commands.
-
-2010-04-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed auto
- save creation.
-
-2010-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fix bug 569417
- - Exception in SourceEditorView.CheckFrameIsInFile.
-
-2010-03-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/PinnedWatchWidget.cs: Improve
- visual style.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.SourceEditor.addin.xml: Bumped MD version.
-
-2010-03-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/StatusBox.cs:
- * MonoDevelop.SourceEditor/DropDownBox.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Optimized
- text editor caret movement/selection speed.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor.addin.xml:
- * MonoDevelop.SourceEditor/StatusBox.cs:
- * MonoDevelop.SourceEditor/IdeViMode.cs:
- * MonoDevelop.SourceEditor/NavigationBar.cs:
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs:
- * MonoDevelop.SourceEditor/DebugValueMarker.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/DebugValueWindow.cs:
- * MonoDevelop.SourceEditor/DefaultFormatter.cs:
- * MonoDevelop.SourceEditor/PinnedWatchWidget.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs:
- * MonoDevelop.SourceEditor/DynamicAbbrevHandler.cs:
- * MonoDevelop.SourceEditor/ISourceEditorOptions.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:
- * MonoDevelop.SourceEditor/NavigationBarCommands.cs:
- * MonoDevelop.SourceEditor/DropDownBoxListWindow.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs:
- * MonoDevelop.SourceEditor/MarkerOperationsHandler.cs:
- * MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs:
- * MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs:
- * MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs:
- * MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs:
- * MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs:
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs:
- * MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs:
- * MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs:
- Merged MD.Projects into MD.Core, and MD.Projects.Gui,
- MD.Core.Gui and MD.Components into MD.Ide.
-
-2010-03-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: Don't modify
- the style's default font, because that affects other parts
- of the MD GUI. Make a copy instead, and track style updates.
-
-2010-03-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DropDownBox.cs:
- * MonoDevelop.SourceEditor/DropDownBoxListWindow.cs: Fixed
- 'Bug 586479 - GTK and GLib criticals from
- DropDownBox.PositionListWindow'.
-
-2010-03-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DropDownBoxListWindow.cs: fixed
- scrolling bar bug.
-
-2010-03-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Added repaint
- after task update.
-
-2010-03-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Optimized
- error bubble speed.
-
-2010-03-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/NavigationBarCommands.cs: When the
- caret panel is shown the toggle command is renamed to 'hide
- caret panel'.
-
-2010-03-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/StatusBox.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Optimized
- caret state box.
-
-2010-03-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs: Fixed
- the show column ruler option.
-
-2010-03-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: fixed 'Bug
- 585770 - Matching brace should not be inserted in comments'.
-
-2010-03-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Don't add
- tasks to invalid lines. May happen when the file is reloaded
- and changed from outside or when the task is invalid.
-
-2010-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: Fixed 'Bug
- 585305 - NRE in text editor when hiding annotations'.
-
-2010-03-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DropDownBoxListWindow.cs: Fixed
- 'Bug 584883 - Layout issue in quick finder dropdowns'.
-
-2010-03-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/NavigationBar.cs: Navigation bar
- now controls the visibility of the containing panels.
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
-
-2010-03-03 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor.addin.xml:
- * MonoDevelop.SourceEditor/StatusBox.cs:
- * MonoDevelop.SourceEditor/DropDownBox.cs:
- * MonoDevelop.SourceEditor/NavigationBar.cs:
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/NavigationBarCommands.cs: Worked on
- navigation panel (it's now possible to show the caret
- position there).
-
-2010-03-03 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor/StatusBox.cs:
- * MonoDevelop.SourceEditor/DropDownBox.cs:
- * MonoDevelop.SourceEditor/TinyDropDownBox.cs:
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:
- * MonoDevelop.SourceEditor/LanguageItemTooltipProvider.cs:
- * MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs:
- Refactored text editor resolve providers. Language bindings
- now can provide own providers.
-
-2010-03-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: fix build
-
-2010-03-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Moved find
- expression code into the language binding.
-
-2010-03-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: up/down
- only reacts when search entry has the focus.
-
-2010-03-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs:
- Implemented 'Bug 584244 - key binding (up/down arrow) to
- cycle through recent searches'.
-
-2010-03-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Fixed
- 'Bug 584235 - New search widget causes text to be
- overrwritten when it shouldn't'.
-
-2010-03-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: Handled
- unresolved member resolve result.
-
-2010-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Fixed
- 'Bug 583495 - Clicking on search result briefly selects
- result'.
-
-2010-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed 'Bug
- 583461 - Fold preview scrolling is strange'.
-
-2010-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/PinnedWatchWidget.cs: setting
- minimum height to 18.
-
-2010-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/PinnedWatchWidget.cs: Fixed 'Bug
- 583026 - Font and aligning issues with the
- PinnedWatchWidget'/Applied patch from Alexander Cherniuk
- <ts33kr@gmail.com>
-
-2010-02-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: added
- selection check.
-
-2010-02-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Fixed
- 'Bug 582050 - Cannot see selection while search box is
- visible, even if editor has focus'
-
-2010-02-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: BOM is now
- remembered.
-
-2010-02-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Add
- command handlers for RecenterEditor and TransposeCharacters.
-
-2010-02-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/IdeViMode.cs: Missed file in
- previous commit.
-
-2010-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Track API
- changes.
-
-2010-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Improved
- keyboard navigation in search & replace widget.
-
-2010-02-22 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs:
- Fixed 'Bug 581629 - Search and replace should not trim the
- search/replace term'.
-
-2010-02-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Worked
- on search & replace.
-
-2010-02-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Worked
- on search & replace.
-
-2010-02-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs:
- Fixed search update bug.
-
-2010-02-16 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/GotoLineNumberWidget.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.GotoLineNumberWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs:
- Worked on the search box/goto line number box.
-
-2010-02-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Fixed
- search & replace widget flickering problem.
-
-2010-02-15 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor/searchoptions.png:
- * MonoDevelop.SourceEditor/searchoptions.svg:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Added
- search options icon.
-
-2010-02-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/PinnedWatchWidget.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Worked
- on search & replace widget.
-
-2010-02-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor/DropDownBox.cs:
- * MonoDevelop.SourceEditor/DropDownBoxListWindow.cs: Remove
- dead code.
-
-2010-02-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: fixed
- flickering in inform label update.
-
-2010-02-12 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/GotoLineNumberWidget.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs:
- Overworked the search & replace widget.
-
-2010-02-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:
- re-implemented intptr constructor.
-
-2010-02-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: fixed 'Bug
- 577848 - MissingIntPtrCtorException appears randomly'.
-
-2010-02-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Added scroll
- to caret call for all folding commands to fix "Bug 577933 -
- Text editor cannot be scrolled and no text is in view".
-
-2010-02-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Track print
- API.
-
-2010-02-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor/PrintSettingsWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.PrintSettingsWidget.cs:
- Stub out a widget for editing custom print settings.
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorPrintOperation.cs:
- Unify and expand the custom print settings in a settings
- class. Fix warnings.
-
- * MonoDevelop.SourceEditor/TinyDropDownBox.cs: Fix warning.
-
-2010-02-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorPrintOperation.cs: Use
- mm units instead of px.
-
-2010-02-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorPrintOperation.cs:
- Replace the Gnome printing code with a new GTK 2.10
- implementation.
-
-2010-02-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Added method
- to check whether text editor has input focus.
-
-2010-02-04 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/DebugValueMarker.cs:
- * MonoDevelop.SourceEditor/PinnedWatchWidget.cs: Added first
- version of widget based pinned watches.
-
-2010-02-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/DebugValueWindow.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/DebugValueMarker.cs:
- * MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs: Use
- the new pinned watch infrastructure.
-
-2010-01-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DebugValueWindow.cs:
- * MonoDevelop.SourceEditor/DebugValueMarker.cs:
- * MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs:
- Display mouse over widget for pin watches.
-
-2010-01-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: fixed 'Bug
- 574362 - Matching brace shouldn't be added inside comments'.
-
-2010-01-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DebugValueWindow.cs: fixed 'Bug
- 574994 - Pinned quick watch issues'.
-
-2010-01-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DebugValueMarker.cs: handles h
- scrolling & clipping.
-
-2010-01-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/DropDownBoxListWindow.cs: Don't
- show the window in the ctor. This means the creator can move
- it before showing it, and we don't get a flicker. Also means
- we have to grab/ungrab in map/unmap.
-
-2010-01-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DebugValueMarker.cs: hide close
- pins, when mouse is not in the right line.
-
-2010-01-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DebugValueWindow.cs:
- * MonoDevelop.SourceEditor/DebugValueMarker.cs: Worked on
- pinnable watches.
-
-2010-01-26 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor/DebugValueWindow.cs:
- * MonoDevelop.SourceEditor/DebugValueMarker.cs:
- * MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs:
- * MonoDevelop.SourceEditor/LanguageItemTooltipProvider.cs:
- * MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs:
- Implemented 'quick watches'.
-
-2010-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs:
- Track DisplayBinding API.
-
-2010-01-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Track
- HelpService API.
-
-2010-01-21 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/generated.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * gtk-gui/MonoDevelop.SourceEditor.GotoLineNumberWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- Added support for custom key actions in completion list.
-
-2010-01-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: fixed 'Bug
- 366110 - Accessibility issue regarding tooltips font'.
-
-2010-01-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Implemented
- 'Bug 433318 - Allow scrolling the text boxes that appear
- when hovering over a folded region'.
-
-2010-01-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/DefaultFormatter.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Track api
- changes.
-
-2010-01-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/TinyDropDownBox.cs:
- * MonoDevelop.SourceEditor/DropDownBoxListWindow.cs:
- implemented 'Bug 571252 - Quick finder dropdowns should take
- mouse grab'.
-
-2010-01-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs:
- fixed bug with on the fly formatting check button.
-
-2010-01-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs: icon is no
- longer drawn over the left margins.
-
-2010-01-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs: fixed bug in
- error text marker collapsing sign.
-
-2010-01-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs: fixed 'Bug
- 569665 - Moving entire lines of code with Alt + Up/Down
- causes the editor to behave erratically.'.
-
-2010-01-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/DropDownBoxListWindow.cs: Track
- selection during mouse scroll events. Fix page size.
-
-2010-01-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs: Use the eol
- marker from the policy.
-
-2010-01-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs: Worked on
- collapsible error bubbles.
-
-2010-01-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: added case
- check.
-
-2010-01-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed auto
- set pattern casing for selection.
-
-2010-01-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs: fixed 'Bug
- 568979 - Hruler paints over error text'.
-
-2010-01-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs: Fixed 'Bug
- 568966 - Error bubbles wrapped lines have wrong bg in ruler
- area'.
-
-2010-01-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs: fixed selection
- drawing bug.
-
-2010-01-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Added support
- for multiple errors/warnings in one line.
-
-2010-01-05 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs:
- * MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs:
- fixed "Bug 561572 - Search keeps defaulting to case
- sensitive" & "Bug 564384 - Can't turn off case sensitivity".
-
-2010-01-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: fixed Bug
- 564855 - Pressing Enter at the end of a line with a breakpoint
- on it causes the line to be drawn as a not "breakpointed" line.
-
-2010-01-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed 'Bug
- 567335 - Split Horizontal View Jumps Both Panes to the Start
- of the File instead of displaying the same place'.
-
-2010-01-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/TinyDropDownBox.cs: Constrain the
- text layout so it doesn't ever render under the dropdown
- arrows.
-
-2010-01-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs: fixed/added
- debug messages for 'Bug 566249 - InvalidCastException when
- deleting some text in the text editor'.
-
-2010-01-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed 'Bug
- 560510 - Preprocessor enabled code shows as comment anyway'.
-
-2010-01-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/TinyDropDownBox.cs: Render as the
- inside of a button, so it matches button styling. Use
- depressed state when popup active.
-
-2009-12-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs: Use proper
- enums for values instead of letting them get cached as
- strings and having to reparse them every time.
-
-2009-12-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml: Use some of the new
- icons.
-
-2009-12-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Re-enable
- syntax error underlining. No idea why Mike disabled it, but
- it's far more useful than error bubbles.
-
-2009-12-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Check that
- file exists before getting its old attributes.
-
-2009-12-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/TinyDropDownBox.cs: Escape now
- closes drop down.
-
-2009-12-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/TinyDropDownBox.cs: Improved the
- drawing of the tiny drop down box.
-
-2009-12-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/TinyDropDownBox.cs: Keyboard now
- works in tiny drop down.
-
-2009-12-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/TinyDropDownBox.cs: Added spacing
- for the right arrows.
-
-2009-12-03 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/objects.xml:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor/DropDownBox.cs:
- * MonoDevelop.SourceEditor/TinyDropDownBox.cs:
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Added tiny
- drop down box.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/AutoSave.cs: Name threads to make
- debugging easier.
-
-2009-12-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fixed 'Bug
- 559822 - comments are folded with incorrect match'.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs:
- * MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs:
- Track API.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs: Only update
- individual properties on property service events, instead of
- wholesale refreshing them all on any (unrelated) property
- service event. Prevents firing lots of change events that
- could cause lots of unnecessary work and slowdowns
- elsewhere.
-
-2009-11-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Fixed
- search & replace speed issue.
-
-2009-11-26 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs:
- Worked on search & replace popup.
-
-2009-11-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Cleanly take
- out event handler.
-
-2009-11-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs: only set the
- color styles, when an editor color style is available.
-
-2009-11-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Try to display
- the current non-external frame only if the current frame
- isn't in the current file. This means we also show a
- stack/execution marker in external code files, if they're
- somehow opened.
-
-2009-11-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Use FilePath
- when comparing files, since it is case insensitive in
- windows.
-
-2009-11-25 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/generated.cs:
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * gtk-gui/MonoDevelop.SourceEditor.GotoLineNumberWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- Worked on message bubbles.
-
-2009-11-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: When debugging
- stops, clear the stack marker as well as the execution marker.
-
-2009-11-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Use the new
- tracepoint markers.
-
-2009-11-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Disabled error
- bubbles by request from lluis.
-
-2009-11-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/DropDownBoxListWindow.cs: Used the
- correct screen for the screen height.
-
-2009-11-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DropDownBoxListWindow.cs: Increased
- the number of maximum items in the quick class browser
- dropdown.
-
-2009-11-24 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor/ErrorTextMarker.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Worked on
- error markers
-
-2009-11-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Implement
- markers for current stack frame.
-
-2009-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Use correct cairo lib.
-
-2009-11-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml:
- * MonoDevelop.SourceEditor/SourceEditorCommands.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:
- Implemented 'Code focus toggle and follow-cursor'.
-
-2009-11-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs: Source
- editor options are now public.
-
-2009-11-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Move common
- infobar code to new widget in MonoDevelop.Components.
- Attempt to make messages clearer and more usable.
-
-2009-11-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/AutoSave.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed 'Bug
- 552173 - Good file for testing texteditor performance'.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.SourceEditor.addin.xml: Bump MD version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- Flush.
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj: Reference mono-cairo
- package.
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Add null
- check.
-
-2009-10-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed 'Bug
- 550882 - ArgumentNull Exception when removing a breakpoint'.
-
-2009-10-22 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- Fixed the dialog.
-
-2009-10-22 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs:
- * MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- Added option to turn off parameter insight.
-
-2009-10-21 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.SourceEditor.GotoLineNumberWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- Added missing check button.
-
-2009-10-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs:
- * MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs:
- * MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs: Added
- enable animations option.
-
-2009-10-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml: Fix Mac keybinding.
-
-2009-10-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml:
- * MonoDevelop.SourceEditor/SourceEditorCommands.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Add a
- command to pulse the caret.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Added caret
- pulse.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Fixed bug
- with constructor initializers.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Added caret
- line highlighting.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Search
- pattern is now set when search widget is first opened/added
- animated search results.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Fixed
- method overloading when no space is used before '('.
-
-2009-10-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed C/Vala
- bindings.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: Fixed xml
- documentation summary markup.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml: Merged code template
- windows.
-
-2009-10-08 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.SourceEditor.csproj: Use \ instead of '/'
- in the Import.
-
-2009-10-08 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.SourceEditor.csproj: Add md.targets .
-
-2009-10-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/AutoSave.cs: fixed 'Bug 541726 -
- using nant beside monodevelop gives errors because of backup
- files'.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.SourceEditor.addin.xml: Bump MD version.
-
-2009-10-05 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs:
- Enable vi word breaking.
-
-2009-10-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fixed caret
- mode update at the end of the document.
-
-2009-10-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Clear caret
- state when closing a source editor/update caret state when
- activating a source editor.
-
-2009-10-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fixed class
- quick finder flicker on file open.
-
-2009-10-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fixed 'Bug
- 543195 New: GTK-Critical errors in split/unsplit text
- editor'.
-
-2009-10-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs:
- Fixed 'Bug 543200 - Files with hscrollbar open scrolled one
- character to the right'/optimized file opening.
-
-2009-09-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Corrected
- quick class browser column.
-
-2009-09-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DropDownBox.cs:
- * MonoDevelop.SourceEditor/DropDownBoxListWindow.cs: Drop down
- box now handles the screen borders.
-
-2009-09-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Delete command
- now doesn't delete the whole line when nothing is selected.
-
-2009-09-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs: Optimized &
- improved the behavior of the class quick finder.
-
-2009-09-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed 'Bug
- 533918 - Scroll position "jumps" first time editor tab is
- shown'.
-
-2009-09-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj: Fix build.
-
-2009-09-24 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj: Removed nrefactory
- reference.
-
-2009-09-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Fixed menu
- positioning.
-
-2009-09-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Semantic
- highlighting requires to purge the layout cache, when the
- parser updates to reflect semantic changes.
-
-2009-09-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed 'Bug
- 537761 - Keystrokes not working on texteditor like "CTRL +
- X|Y to trigger Foo action...'.
-
-2009-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Check that
- help is supported before trying to show it.
-
-2009-09-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed 'Bug
- 540487 - Event handler anon delegate completion puts caret
- in wrong place'.
-
-2009-09-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Removed code
- duplication/fixed folding commands.
-
-2009-09-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: Renamed
- IDomVisitable -> INode
-
-2009-09-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs: fixed inner
- type sorting.
-
-2009-09-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs: quick class
- browser now shows full inner type name.
-
-2009-09-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Only set the
- search engine, when the option is changed.
-
-2009-09-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Added some
- error handling code.
-
-2009-09-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Corrected
- caret position after format.
-
-2009-09-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Worked on
- formatting.
-
-2009-09-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Worked on
- on the fly format for code template insertion.
-
-2009-09-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Track API
- changes.
-
-2009-09-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Fixed code
- completion + auto insert braces bug.
-
-2009-09-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Worked on
- template formatting.
-
-2009-09-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs:
- Fixed syntax style verification.
-
-2009-09-09 Christian Hergert <chris@dronelabs.com>
-
- * MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs:
- Set the dialog transient to our widgets toplevel.
-
-2009-09-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed 'Bug
- 537375 - Completed text not immediately updated'.
-
-2009-09-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed build.
-
-2009-09-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fold actions
- now re calculate the vertical scrollbar.
-
-2009-08-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml: Insert the text editor
- extension node in the default display binding group.
-
-2009-08-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed "Bug
- 534735 - Write-permission cleared on save".
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/IdeViMode.cs:
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs:
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Fixed
- compiler warnings.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor.csproj: Updated dependencies. We
- now depend on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs: Track
- API changes.
-
-2009-08-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Auto save is
- only created after atomic undos.
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs:
- Fixed Bug 529544 - Source editor should validate styles when
- adding them & Bug 531014 - Syntax Highlighting: Style sheet
- file has to be called [something]Style.xml.
-
-2009-08-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Implement
- ISupportsProjectReload.
-
-2009-08-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor/AutoSave.cs:
- * MonoDevelop.SourceEditor/Counters.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Add some
- counters.
-
-2009-08-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DropDownBoxListWindow.cs: drop down
- box (in quick navigation) now recognizes leave event and
- deselects the selected item.
-
-2009-08-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DynamicAbbrevHandler.cs: Added
- abbrev word to the foundWords list.
-
-2009-08-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DynamicAbbrevHandler.cs: fixed bug
- in getwordbeforecaret
-
-2009-08-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DynamicAbbrevHandler.cs: Replaced
- the GetWordBeforeCaret with an own implementation.
-
-2009-08-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DynamicAbbrevHandler.cs: fixed typo
- in dynamic abbrev that caused a bug.
-
-2009-08-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml: Changed dynamic abbrev
- key to alt+/
-
-2009-08-07 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor.addin.xml:
- * MonoDevelop.SourceEditor/DynamicAbbrevHandler.cs:
- * MonoDevelop.SourceEditor/SourceEditorCommands.cs: Added
- dynamic abbrev command (default: alt+space).
-
-2009-08-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed "Bug
- 529009 - When open documents are restored, scroll
- positioning is bad".
-
-2009-08-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj: Use Mono.Cairo 2.0.
-
-2009-08-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: bracket
- auto insertion no longer closes parameter help window.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Flush.
-
-2009-07-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed Bug
- 526721 - When splitting window vertically, the slider under
- left split is not shown unitl window is resized.
-
-2009-07-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: Worked on
- xml documentation.
-
-2009-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: Using custom
- documentation, if any.
-
-2009-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed "Bug
- 525256 - Mouse Cursor jumps to random position after resolve
- type name.".
-
-2009-07-28 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj: Fixing build.
-
-2009-07-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Implemented
- "Bug 523920 - Comment command not using tags defined in
- syntax mode".
-
-2009-07-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Fixed "Bug
- 523853 - Delegate not recognised by refactoring tools
- (doesn't offer Go To Declaration)".
-
-2009-07-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed "Bug
- 518391 - Exception when save a file into vfat partition".
-
-2009-07-21 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.SourceEditor/IdeViMode.cs:
- Add goto definition, goto next/previous error.
-
-2009-07-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: On first
- load parse info is updated before showing the document (to
- prevent folding update flicker).
-
-2009-07-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Auto
- insert bracket feature no longer closes code completion
- window too early (which caused that the code completion
- window didn't complete).
-
-2009-07-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SyntaxModeService.cs: Removed debug
- messages.
-
-2009-07-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Fixed some
- automatic bracket issues.
-
-2009-07-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Made the
- automatic bracket insertion behavior more nicely (thanks go
- to marlun for suggesting this) .
-
-2009-07-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Improved
- automatic " insertion behaivour.
-
-2009-07-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml:
-
-2009-06-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs: Track
- api changes.
-
-2009-06-25 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.SourceEditor/IdeViMode.cs:
- Save files via the Gui.Document.
-
-2009-06-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed "Bug
- 515825 - Toggle fold does not work if cursor sent to the end
- of folded line".
-
-2009-06-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/DefaultFormatter.cs:
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs:
- * MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs:
- * MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs: Use
- the new DesktopService instead of PlatformService.
-
-2009-06-22 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.SourceEditor/DropDownBox.cs:
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs:
- Reduce unnecessary whitespace.
-
-2009-06-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs: The
- editor should only open files which are known to be text.
- Fixes bug #514761.
-
-2009-06-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/EditActions.cs: Fixed "Bug 514284 -
- Tab key doesn't work for plain text files (with tab as
- reindent option set)".
-
-2009-06-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor\SourceEditorView.cs: Fix nullref.
-
-2009-06-18 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs:
- * MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs:
- Worked on on the fly formatting. DO NOT USE THIS OPTION (it
- may break code. But for testing it may be ok)
-
-2009-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/DefaultFormatter.cs:
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:
- * MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs:
- Implement support for per mime-type formatting policies.
-
-2009-06-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed "Bug
- 510226 - Edit / Folding commands seem to be currently
- broken".
-
-2009-06-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/AutoSave.cs: Fixed "Bug 504605 -
- Crash after removing a project".
-
-2009-06-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: When setting
- the mime type for the file, try to find one for which there
- is a syntax mode.
-
-2009-05-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/EditActions.cs: Fixed Bug 506245 -
- Block indent doesn't work.
-
-2009-05-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: fixed
- 'Bug 506246 - Search command doesn't copy the selected
- string if find widget is visible'.
-
-2009-05-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor\SourceEditorView.cs: Use FilePath
- for representing paths.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor\SourceEditorView.cs: Use the new
- FilePath class for handling file and directory paths.
-
-2009-05-14 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs:
- * MonoDevelop.SourceEditor/HighlightPropertiesSemanticRule.cs:
- Moved highlight properties semantic rule to c# backend.
-
-2009-05-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed "Bug
- 502586 - Edit / Format / Join Lines does not join blank
- lines".
-
-2009-05-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/EditActions.cs: Fixed "Bug 501996 -
- Tab interpreted as reindent sometimes also inserts tabs".
-
-2009-05-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Fixed
- "Bug 501993 - Find and replace: Pressing Tab never gets to
- Replace field".
-
-2009-05-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs: Save
- no longer centers the caret.
-
-2009-05-07 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor.addin.xml:
- * MonoDevelop.SourceEditor/SyntaxModeCodon.cs:
- * MonoDevelop.SourceEditor/SyntaxModeService.cs:
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:
- * MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs:
- * MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs:
- * MonoDevelop.SourceEditor.Extension/TemplateExtensionNodeLoader.cs:
- Added support for custom syntax highlighting.
-
-2009-05-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fixed "Bug
- 499981 - "File Changed" notification panel is unreadable
- when a dark theme is used".
-
-2009-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Added
- missing empty region check.
-
-2009-05-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs: Changed
- default for completewithpunctuation
-
-2009-04-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Handle
- subword commands.
-
-2009-04-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- Fixed 'Bug 499151 - Some text style policies are not
- respected'.
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs: the
- content may be == null now.
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs:
- Track API changes.
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs:
- Track API changes.
-
-2009-04-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Use
- UntitledName when view.IsUntitled.
-
-2009-04-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- Reimplemented language binding service.
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fixed "Bug
- 497118 - Code folding makes debugging annoying".
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: track api
- changes.
-
-2009-04-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Implement
- handlers for ScrollPageDown and ScrollPageUp.
-
-2009-04-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- Jumping with search & replace panel to files may no longer
- fold the jump destination.
-
-2009-04-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Track
- comment tag API.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Renamed
- PixbufService to ImageService.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed "Bug
- 489963 - Files loose execution bit when saved".
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- Track api changes.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.Extension/TemplateCodon.cs: (Revert
- revision 132136)
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.Extension/TemplateCodon.cs: Fixed
- possible bug in template codons.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Track API
- changes.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.SourceEditor.csproj: don't require specific
- gtk-sharp version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.SourceEditor.addin.xml: Bump MD version.
-
-2009-04-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Added patch
- from Levi Bard
- <taktaktaktaktaktaktaktaktaktak@gmail.com>:Make sure GUI
- operations are performed in the GUI thread.
-
-
-2009-04-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs:
- fixed error.
-
-2009-04-14 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- Fixed compilation error.
-
-2009-04-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs: changed
- default value for 'CompleteWithSpaceOrPunctuation'
-
-2009-04-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs:
- * MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs:
- fixed "Bug 494565 - New auto-complete behavior is improperly
- labeled.".
-
-2009-04-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Hitting
- search repeatedly does search next
-
-2009-04-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Made the
- 'undo' of code completion operations more intelligent.
-
-2009-04-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Track api
- changes.
-
-2009-04-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Added some
- virtual leading whitespace fixes.
-
-2009-04-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Added some
- fixes for virtual leading whitespace feature/removed some
- old code.
-
-2009-04-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/AutoSave.cs:
- * MonoDevelop.SourceEditor/EditActions.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Worked on "Bug
- 492923 - MD hangs while editing text".
-
-2009-04-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:
- Implemented "Bug 492675 - New line & ; at end of line".
-
-2009-04-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Added
- ctrl+return/shift+return commands.
-
-2009-04-06 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj:
-
- * MonoDevelop.SourceEditor/AutoSave.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Implemented
- auto save feature ("Bug 409717 - No automatic save").
-
-2009-04-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Fixed "Bug
- 487215 - No type is displayed when hovering over "var"
- keyword".
-
-2009-03-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed "Bug
- 487736 - Clipboard ring and code snippets not shown anymore
- in the toolbox".
-
-2009-03-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:
- Implemented "Bug 487422 - Ctrl+C/V/X should copy/paste/cut
- the whole line if no selection is made like in VS".
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Fixed auto
- insert matching bracket bug.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Added
- support for contextual templates.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DefaultFormatter.cs: Fixed Header.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml: Added the template
- commands to the editor context menu.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: removed
- caching of results for custom expressions.
-
-2009-03-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DebugValueWindow.cs:
- * MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs:
- * MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs:
- * MonoDevelop.SourceEditor/LanguageItemTooltipProvider.cs:
- Fixed compilation error.
-
-2009-03-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:
- Implemented template function callbacks.
-
-2009-03-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Implemented
- ICodeTemplateWidget interface.
-
-2009-03-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Worked on
- text link edit mode.
-
-2009-03-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fix possible
- NRE.
-
-2009-03-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Track API
- changes.
-
-2009-03-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemTooltipProvider.cs:
- Track API changes.
-
-2009-03-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor.csproj: Don't local-copy project
- refs.
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.csproj: Added text editor
- reference.
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: fixed "Bug
- 484574 - Setting SourceEditorView.Text doesn't mark the
- document as dirty".
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.csproj: Moved text editor to core
-
-2009-03-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml:
- * MonoDevelop.SourceEditor/DefaultFormatter.cs: Worked on code
- formatter.
-
-2009-03-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DefaultFormatter.cs: Changed
- interface.
-
-2009-03-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor.Extension/TemplateCodon.cs: Fix
- resource disposal issues that prevented addins adding syntax
- modes and colour schemes, and probably caused resource
- stream leaks.
-
-2009-03-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed "Bug
- 482806 - #region auto folding doesn't work.".
-
-2009-03-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Remove old
- code that could intefere with previous fix.
-
-2009-03-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Only show
- the class & method bar when there's a parsed
- CompilationUnit.
-
-2009-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Properly
- implement IEncodedTextContent.
-
-2009-03-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: fixed "Bug
- 480556 - MonoDevelop can't handle UTF-16 source files".
-
-2009-02-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs:
- Translation fixes. Patch from Kriván Bálint.
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor.csproj: Flush.
-
-2009-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DropDownBox.cs:
- * MonoDevelop.SourceEditor/DropDownBoxListWindow.cs: drop down
- box popup now selects always the current selected item as
- first item.
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: Changed the
- key for small tooltips (without full names) to shift instead
- of control. This should now work on all window managers.
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DropDownBox.cs:
- * MonoDevelop.SourceEditor/DropDownBoxListWindow.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs:
- * MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs:
- Changed override Destroy --> override OnDestroyed.
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DropDownBox.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/DropDownBoxListWindow.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs:
- * MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs:
- Worked on clean ressource de-allocation.
-
-2009-02-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml: Assigned ids to tooltip
- providers.
-
-2009-02-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Don't use
- the TextEditor from a non-gui thread since this property
- needs to query some gtk# properties.
-
-2009-02-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/DropDownBox.cs:
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs: Set a minimum
- icon height and width on the drop down boxes. Fixes size
- jumping with small UI font (there'll still be an issue with
- large fonts).
-
-2009-02-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: Language
- tooltips now shrink namespaces when control is pressed.
-
-2009-02-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs:
- * MonoDevelop.SourceEditor/LanguageItemTooltipProvider.cs:
- * MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs:
- Track api changes.
-
-2009-02-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: fixed "Bug
- 477513 - Tooltips should show full namespace when names
- clash".
-
-2009-02-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Changed
- message.
-
-2009-02-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: fixed "Bug
- 475990 - Code navigation not working in a ctor call inside a
- property".
-
-2009-02-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Handle
- UTF32 code points from IMContext. Don't pass most recent
- keypress through with IMContext multi-press commits, so that
- it doesn't append the space/enter that was used to terminate
- the multi-press input.
-
-2009-02-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fix nullref.
-
-2009-02-16 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fixed "Bug
- 395576 - If a file changes outside monodevelop environment,
- notification is hard to see".
-
-2009-02-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs:
- * MonoDevelop.SourceEditor/LanguageItemTooltipProvider.cs:
- * MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs:
- fixed "Bug 364198 - Tooltips should be reduced if there are
- proper "using statements"".
-
-2009-02-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: error
- underlining & folding now works on untitled files.
-
-2009-02-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: Improved
- language item tooltip formatting.
-
-2009-02-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Implement F1
- member help. Looks like it was never implemented for
- SourceEditor2.
-
-2009-02-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/DefaultFormatter.cs: Fix NRE when
- there is no policy parent. Fixes creation of files not
- attached to projects.
-
-2009-02-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: added
- tooltip support for aggregated resolve results.
-
-2009-02-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: fixed "Bug
- 474149 - Context menu shows incorrect overload".
-
-2009-02-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DefaultFormatter.cs: default
- formatter now accounts eol policies.
-
-2009-02-11 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.csproj:
- * MonoDevelop.SourceEditor.addin.xml:
- * MonoDevelop.SourceEditor/DefaultFormatter.cs: Added default
- formatter that uses text policy settings.
-
-2009-02-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: fixed "Bug
- 474055 - no parameters hints on first parameter when "Insert
- Matching Brace" is enabled".
-
-2009-02-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs: Fix
- null ref.
-
-2009-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor.csproj: Remove more inadvertent
- local copying of references.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor.csproj: Don't local-copy other
- addins' dlls.
-
-2009-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs:
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs:
- * MonoDevelop.SourceEditor/HighlightPropertiesSemanticRule.cs:
- Fixed compiler warnings.
-
-2009-02-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Remove
- unnecessary completion context event filtering.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor.mdp:
- * MonoDevelop.SourceEditor.csproj: Migrated to MSBuild file
- format.
-
-2009-02-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fire
- CompletionContextChanged when buffer changed by anything
- other than one character inserted at the cursor position.
- Fixes "Bug 448911 - Typing '#region<SPC>foo' results in
- 'region<SPC>fooon' and "Bug 435770 - Code completion window
- should handle document changing under it". Fix typo that
- caused OnTextReplaced to be subscribed to TextReplacing
- instead of TextReplaced; this should fix line number
- updating in error pad. Also combine duplicate event
- handlers.
-
-2009-02-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/IdeViMode.cs: Add the tab and
- AdvancedBackspace actions that the SourceEditor usually adds
- to the edit mode. Restores deletion of matching brackets and
- tab-triggering of template insertion.
-
-2009-02-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed 'Bug
- 470859 - GLib-criticals in text editor'.
-
-2009-02-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs:
- implement missing members.
-
-2009-02-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/EditActions.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: fixed
- "Bug 472714 - MonoDevelop automatic indentation does not
- follow "Convert tabs to spaces" option".
-
-2009-02-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: fixed
- "Bug 469910 - Incorrect type resolution on attributes".
-
-2009-02-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/IdeViMode.cs: Remove unnecessary
- markup escaping.
-
-2009-02-03 Mike Krüger <mkrueger@novell.com>
-
- *
- MonoDevelop.SourceEditor/HighlightPropertiesSemanticRule.cs:
- Commented out some non functional code.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.SourceEditor.addin.xml: Bump MD version.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs:
- *
- gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- Flush.
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.mdp: Fixed assembly references.
-
-2009-02-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Set caret
- position correctly after a completion insertion.
-
-2009-02-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs:
- * MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs:
- * MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs:
- *
- MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs:
- Remove proeprties that have been moved to text style
- policies. Track SourceEditorOptions API changes.
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs:
- *
- gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- Remove proeprties that have been moved to text style
- policies.
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.mdp: Updated.
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Track
- SourceEditorOptions API changes. Make the split editor use
- same StyledSourceEditorOptions object as its companion.
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Track
- SourceEditorOptions API changes. Use
- StyledSourceEditorOptions options object.
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs: Use
- settings from default TextStylePolicy.
-
- * MonoDevelop.SourceEditor/EditActions.cs:
- * MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs:
- Track SourceEditorOptions API changes.
-
- * MonoDevelop.SourceEditor/ISourceEditorOptions.cs: Extract
- ISourceEditorOptions interface from ISourceEditorOptions.
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Track
- SourceEditorOptions API changes. Propagate project change
- events to the child editor's StyledSourceEditorOptions.
-
- * MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs:
- Implement an ISourceEditorOptions for ExtensibleTextEditor
- to use, which merges the default SourceEditorOptions and an
- attached Project's TextStylePolicy.
-
-2009-02-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Track changes in MD's assembly handling.
- Mono.Cairo is no longer considered to be a "system"
- assembly.
-
-2009-01-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Implemented
- texteditordataprovider.
-
-2009-01-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: handled possible
- null reference exception.
-
-2009-01-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.mdp: removed treat warnings as errors
-
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs: (Revert revision 124646)
-
-2009-01-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DropDownBoxListWindow.cs: Changed the
- behavior of the quick class browser dropdown.
-
-2009-01-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.mdp:
- * MonoDevelop.SourceEditor/IdeViMode.cs:
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs:
- * MonoDevelop.SourceEditor.Extension/TemplateCodon.cs:
- * MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs:
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs:
- * MonoDevelop.SourceEditor/HighlightPropertiesSemanticRule.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs: Fixed
- compiler warnings.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Use MD's TextFile API
- for loading and saving files, because it handles encodings, and does
- "safer" writes.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs: Use a faster sort - the
- one used in the completion list.
-
-2009-01-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs: Type & member list is
- now sorted.
-
-2009-01-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs: Don't crash when
- showing the quick finder for files with a parsed document but a
- no compilation unit. Fixes "Bug 468925 - MD crashes when opening /
- clicking in web.config file".
-
- In such cases, also hide the quick finder to save space.
-
-2009-01-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/DropDownBox.cs:
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/DropDownBoxListWindow.cs: Optimized the quick
- class browser, update was too expensive speed wise. The quick class
- browser dropdown is now a custom control.
-
-2009-01-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.SourceEditor.GotoLineNumberWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- Updated.
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Implemented SearchNext
- in the document interator. Fixes a performance issue (the default
- implementations makes multiple calls to MoveAhead, which go through
- all the remoting chaing).
-
-2009-01-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: In DocumentTextIterator,
- the first call to MoveAhead must initialize the offset. Fixes bug
- #460627 - Find In Files doesn't find all matches.
-
-2009-01-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed issue with 0
- length documents.
-
-2009-01-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: fixed possible array
- index out of bound exception.
-
-2009-01-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: handled unlikly null
- ref.
-
-2009-01-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: fixed "Bug 465222 -
- "Insert matching brace" - no newlines please!".
-
-2009-01-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed possible null
- reference.
-
-2009-01-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml: Track changes in command names.
- Patch by Vadim Chekan.
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Add/remove breakpoints
- when clicking on the icon bar.
-
-2009-01-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Fixed possible null
- ref. exception.
-
-2009-01-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: fixed 'Bug 463881 -
- Type navigator does not work with attributes'.
-
-2009-01-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Worked on on the fly
- type resolving.
-
-2009-01-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: fixed 'Bug 456429 -
- Search and replace broken again'.
-
-2008-12-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/DebugValueWindow.cs:
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: TooltipWindow has been
- moved to MD.Components.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor.mdp: All projects now require fx 3.5.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor.mdp: Don't require a specific version of
- Mono.Addins.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * AssemblyInfo.cs: Add AssemblyInfo.cs files that are autogenerated from
- the addin manifests.
-
-2008-12-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml:
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Added command for
- showing the expression evaluator.
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:
- * MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs: Factorized
- expression finder code.
-
-2008-11-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: Refactored
- ambiences/domoutputvisitor.
-
-2008-11-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Moved command handlers
- to witget. Fixing Bug 448915 - Toggle Line Comment(s) not available
- in Alpha 2.
-
-2008-11-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs: Track api
- changes.
-
-2008-11-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs: Removed return type from
- class quick finder.
-
-2008-11-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Track search APIs.
-
-2008-11-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Use more precise error
- underline positioning when available.
-
-2008-11-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Use named colours in
- error/warning markers.
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Escape markup in
- error message tooltips.
-
-2008-11-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Rename Error to
- ErrorMarker to reduce ambiguity. Track Error API. Use different
- colour for warnings. Tidy up API. Remove unnecessary field from
- ErrorMarker class.
-
-2008-11-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Don't add
- TriggerWordLength to the partial_word's length; the latter is all we
- need. Fixes Bug 445388 - Ctrl-space in middle of word sometimes
- overwrites too far.
-
-2008-11-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: fixed 'Bug 444922 -
- Buggy tooltips'.
-
-2008-11-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: fixed code completion
- bug.
-
-2008-11-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:
- * MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- removed auto templates.
-
-2008-11-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: removed space
- template completion.
-
-2008-11-12 Mike Krüger <mike@icsharpcode.net>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: fixed some slight
- issues with templates and code completion insertion.
-
-2008-11-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fix line/col indexing on
- the CodeCompletionContext. It should be one-indexed for compatibility
- with the rest of MD.
-
-2008-11-11 Mike Krüger <mike@icsharpcode.net>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: made brace auto
- insertion more intelligent (doesn't insert closing brace when it
- exists).
-
-2008-11-11 Mike Krüger <mike@icsharpcode.net>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: fixed 'Bug 442768 -
- Should show fully qualified name in tooltip when namespaces clash'.
-
-2008-11-10 Mike Krüger <mike@icsharpcode.net>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs:
- * MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- Added enable auto completion option.
-
-2008-11-07 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.SourceEditor/IdeViMode.cs: Escape status bar text.
-
-2008-11-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Add submenu on
- context menu for selecting input method. Seems be be the standard
- thing to do in GTK.
-
-2008-11-06 Mike Krüger <mike@icsharpcode.net>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Worked on code
- templates.
-
-2008-11-06 Mike Krüger <mike@icsharpcode.net>
-
- * MonoDevelop.SourceEditor/EditActions.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: fixes some bugs with
- code templates and auto insert brackets.
-
-2008-11-06 Mike Krüger <mike@icsharpcode.net>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs:
- * MonoDevelop.SourceEditor/LanguageItemTooltipProvider.cs:
- * MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs: fixed 'Bug
- 442099 - Empty code info tooltips should not be shown'.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml: Bump MD version.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml: Removed options which are not
- really contextual.
-
-2008-11-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Add border around text
- editor to give it definition when UI and colours schemes are both
- light or dark.
-
-2008-11-05 Mike Krüger <mike@icsharpcode.net>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs:
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Fixed some
- warnings/cosmetic changes.
-
-2008-11-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Implement
- Indent/Unindent/ToggleComment commands directly on the editor instead
- of implementing removed ICodeStyleOperations interface. Rename some
- methods. Disable comment toggling command if language binding has
- null single line comment value, so it no longer breaks on
- XML/HTML/ASP.NET etc. Workaround for enhancement bugs "433644 -
- 'toggle line comment(s)' within script tags in aspx file fails" and
- "440592 - 'toggle line comment(s)' in xml file should add comment
- tags ('<!--', '-->')".
-
-2008-10-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: fixed 'Bug 439552
- - Search in document doesn't work properly'.
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Handled the
- resetTimerId differently.
-
-2008-10-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Made the case a.Count ==
- 0 a bit more efficient in the OnTextReplacing event.
-
-2008-10-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Make sure find/replace
- changes to the editor are done in the gui thread. Should fix bug
- #434159.
-
-2008-10-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: added lock for
- possible threading issue.
-
-2008-10-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Remove unneeded
- field and parameter. Rename SetCurrentMode to UpdateEditMode.
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs: Fire an OnChanged
- event when the UseViModes setting changes, so that the setting is
- applied by open editors.
-
-2008-10-15 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.SourceEditor/IdeViMode.cs: Refactor.
-
-2008-10-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/IdeViMode.cs: Add :make command.
-
-2008-10-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/IdeViMode.cs: Track API.
-
-2008-10-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor.mdp: Updated.
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Add an option for
- enabling vi modes.
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs:
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs: Add UI
- for enabling vi modes.
-
-2008-10-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Allow enabling the
- vi mode without recompilation.
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.mdp: Updated.
-
- * MonoDevelop.SourceEditor/IdeViMode.cs: Add support for simple vi
- commands.
-
-2008-10-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Restore
- functionality to pop up context menu at caret if activated by key
- press.
-
-2008-10-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: fixed 'Bug 434165 - Page
- UP/Down Key on top/bottom of a code folded make the region Unfolded'.
-
-2008-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: fixed 'Bug 433271 -
- Problems with code completion while creating #regions'.
-
-2008-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed 'Bug 433401 -
- Static methods don't show in the Methods dropdown'.
-
-2008-10-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.SourceEditor.mdp: Updated.
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs:
- * MonoDevelop.SourceEditor/ExtensibleTextEditor.cs: Change file name to
- match class name.
-
-2008-10-08 Andreia Gaita <avidigal@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Don't run the
- autocorrect/underline error timer if the UnderlineErrors options is
- false (fixes #433288)
-
-2008-10-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/EditActions.cs: Track API.
-
-2008-10-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: fixed 'Bug 432856 -
- Creation and editing broken for unsaved files'.
-
-2008-10-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor.mdp: Updated.
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Add a way to enable
- vi mode.
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Call the text editor
- widget even if the escape key is pressed.
-
-2008-10-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs: Fixed bug with on
- the fly edit options changing.
-
-2008-09-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs: Exposed the
- control left/right option to the user.
-
-2008-09-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs: Exposet
- ControlLeftRightMode option in the options class == made a real
- monodevelop property (default value taken from platform service).
-
-2008-09-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed 'Bug 430509 -
- Comment folding is too aggresive'.
-
-2008-09-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Track API. Move
- folding logic out of the editor. Reduce file width to 132 cols,
- assuming 8-wide tabs.
-
-2008-09-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/objects.xml: Updated.
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fix threading problem
- in ParseInformationUpdaterWorkerThread. This thread was getting the
- TextEditor property which runs gtk code, and this is only allowed
- in the GUI thread.
-
-2008-09-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs: Track API.
-
-2008-09-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: improved comment
- folding update.
-
-2008-09-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: fixed 'Bug 427511 -
- Code Completion not working for files not belonging to a project'.
-
-2008-09-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: fixed 'Bug 397930 -
- Navigation to generic method not working correctly'.
-
-2008-09-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/objects.xml,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Flush.
-
-2008-09-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fixed update issue in
- quick class finder.
-
-2008-09-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed bug in source
- editor caused by an change in the parser service update behavior.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel.cs,
- gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs,
- gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs,
- gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs,
- gtk-gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs,
- gtk-gui/MonoDevelop.SourceEditor.GotoLineNumberWidget.cs: Updated
- generated code.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/EditActions.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/HighlightPropertiesSemanticRule.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Track api changes.
-
-2008-09-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Worked on fold
- information update.
-
-2008-09-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fixed crash with
- search/replace widgets.
-
-2008-09-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: recognizing
- using/namespace import differences
-
-2008-09-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/ClassQuickFinder.cs: Changed compilation
- unit/document meta information interface.
-
-2008-09-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fix packing on reload
- bar.
-
-2008-09-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/ClassQuickFinder.cs: Restore region combo
- functionality.
-
-2008-09-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/LanguageItemTooltipProvider.cs,
- MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs,
- MonoDevelop.SourceEditor/EditActions.cs,
- MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs: Fix spelling
- (extendible->extensible) while we can.
-
-2008-09-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic: Updated.
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Tidy up replace
- mode switching logic. Fixes buglets where shortcuts couldn't be
- used to switch between modes, and the first click on the
- search/replace toggle was ignored.
-
-2008-09-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Optimized language
- item tooltip.
-
-2008-09-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs,
- gtk-gui/MonoDevelop.SourceEditor.GotoLineNumberWidget.cs,
- MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs,
- MonoDevelop.SourceEditor/ClassQuickFinder.cs,
- MonoDevelop.SourceEditor/GotoLineNumberWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Make non-reusable
- widgets internal.
- * gtk-gui/objects.xml, Makefile.am, MonoDevelop.SourceEditor.mdp:
- Updated.
- * gtk-gui/MonoDevelop.SourceEditor.SourceEditorWidget.cs,
- gtk-gui/gui.stetic: Replace stetic widget by manual code.
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Slim down unnecessary
- spacing around the edge of the text editor. Tidy up padding for
- child widgets.
-
-2008-09-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs,
- gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- Fix build.
- * gtk-gui/MonoDevelop.SourceEditor.SourceEditorWidget.cs,
- gtk-gui/gui.stetic, MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- Reduce wasted screen space.
-
-2008-09-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Some folding location
- fixes.
-
-2008-09-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed "[Bug 422095]
- New: NRE in the console when opening file ( seems related to
- folding regions)".
-
-2008-08-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: made some changes
- caused by text editor changes.
-
-2008-08-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fix some memory
- leaks.
-
-2008-08-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fix for backward
- search.
-
-2008-08-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml,
- MonoDevelop.SourceEditor/SourceEditorView.cs,
- MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs: Added
- context menu for the editor margin.
-
-2008-08-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs: fixed
- bug in general options panel.
- * gtk-gui/objects.xml: Fixed options button.
-
-2008-08-13 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs,
- MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs,
- MonoDevelop.SourceEditor/SourceEditorOptions.cs: fixed "Bug 416847
- - Cannot use Tab Button".
-
-2008-08-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed bug.
-
-2008-08-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.Extension,
- MonoDevelop.SourceEditor.Extension/TemplateCodon.cs,
- MonoDevelop.SourceEditor.Extension/TemplateExtensionNodeLoader.cs,
- MonoDevelop.SourceEditor.addin.xml,
- MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs: fixed "Bug
- 405926 - Addins cannot add syntax schemes or colour schemes to the
- text editor".
-
-2008-08-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs,
- gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs,
- gtk-gui/MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel.cs,
- gtk-gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs,
- gtk-gui/objects.xml: Tidy up the text editor options panels.
- * MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs,
- MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs: Removed
- unnecessary toolbox item attributes.
- * MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs,
- MonoDevelop.SourceEditor/SourceEditorOptions.cs: Fix spelling,
- sheme -> scheme.
-
-2008-08-11 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs,
- MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs,
- MonoDevelop.SourceEditor/SourceEditorOptions.cs: fixed Bug 416088 -
- Remove Whitespace From Newlines
-
-2008-08-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fixed "Bug 415737 -
- Crash with split window".
-
-2008-08-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: Worked on dom.
-
-2008-08-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/objects.xml, gtk-gui/gui.stetic,
- MonoDevelop.SourceEditor.mdp: Updated.
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Request file edit
- permission when the user tries to modify the document.
- * MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs: Fix possible
- index out of range exception.
-
-2008-08-04 Aaron Bockover <abock@gnome.org>
-
- This commit refactors the search/replace widget to unify the code into
- a single common widget/class; it additionally adds extensive keybinding
- support for navigating results and improves the GTK UI/layout of the widget
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fixes in place to use
- the new merged search/replace widget
-
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Merged
- Search and Replace functionality into a single widget; implemented
- extensive and intuitive keybinding support for navigating search results
-
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs:
- * gtk-gui/gui.stetic: Redesigned search/replace widget to be easier to
- maintain, use proper GTK layout techniques, and icons instead of arrows
- for better semantic and consistent meaning
-
- * gtk-gui/MonoDevelop.SourceEditor.SearchWidget.cs:
- * MonoDevelop.SourceEditor/SearchWidget.cs: Removed, merged above
-
-2008-08-04 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/LanguageItemTooltipProvider.cs,
- MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs,
- MonoDevelop.SourceEditor/LanguageItemWindow.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/EditActions.cs: Worked on language window
- tooltips
-
-2008-08-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.SourceEditorWidget.cs,
- gtk-gui/gui.stetic, Makefile.am, MonoDevelop.SourceEditor.mdp,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/ClassQuickFinder.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Refactored class
- browser into a separate widget. Improved efficiency -- it's no
- longer just hidden, but is now not created unless needed. Also
- fixed a bug where the class browser would be shown for certain
- files even when disabled.
-
-2008-07-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: changed getparser
- call.
-
-2008-07-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: fixed "Bug 408899 -
- Code templates expanded in comments".
-
-2008-07-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Restore error
- underlining functionality.
-
-2008-07-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Use folding regions
- from the CompilationUnit. Restores folding for ASP.NET documents
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs,
- MonoDevelop.SourceEditor/HighlightPropertiesSemanticRule.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs,
- MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs: Translated
- old code to new dom.
-
-2008-07-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Don't escape file names
- for VFS here. It is done in the platform service.
-
-2008-07-27 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs,
- MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorOptions.cs,
- MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs,
- MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs,
- MonoDevelop.SourceEditor/LanguageItemTooltipProvider.cs,
- MonoDevelop.SourceEditor/LanguageItemWindow.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Worked on code
- completion/new dom.
-
-=======
-2008-07-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Don't escape file names
- for VFS here. It is done in the platform service.
-
->>>>>>> .merge-right.r109767
-2008-07-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/DebugValueWindow.cs: Make sure no rows are
- selected the first time the value tree is shown.
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Track api changes.
-
-2008-07-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/DebugValueWindow.cs,
- MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs: Track api
- changes.
-
-2008-07-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/DebugValueWindow.cs: Show and hide
- scrollbars when needed. Set the window to modal mode when the user
- starts editing a value. In this way keyboard events will be
- directed to this popup window instead of the editor.
- * MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs,
- MonoDevelop.SourceEditor/LanguageItemTooltipProvider.cs: Set
- tooltip alignment.
- * MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs: Implemented
- basic expression scanner. Use the selection as debug expression if
- there is something selected.
-
-2008-07-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am, MonoDevelop.SourceEditor.addin.xml,
- MonoDevelop.SourceEditor.mdp,
- MonoDevelop.SourceEditor/DebugValueWindow.cs,
- MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs,
- MonoDevelop.SourceEditor/LanguageItemTooltipProvider.cs,
- MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs: Initial
- implementation of debug tooltips. It still has some window sizing
- and editing issues.
-
-2008-07-06 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel.cs,
- MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs,
- MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs: Added
- support for custom styles and modes.
-
-2008-07-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed 'Bug 402202 -
- The line number at the bottom of MD is wrong when code is folded'.
-
-2008-07-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: fixed Bug 405930 -
- FoldingRegions in compilation units are all folded by default
-
-2008-07-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic, Makefile.am, MonoDevelop.SourceEditor.addin.xml,
- MonoDevelop.SourceEditor.mdp,
- MonoDevelop.SourceEditor/DebugValueWindow.cs,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs,
- MonoDevelop.SourceEditor/LanguageItemTooltipProvider.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Moved tooltip
- support to Mono.TextEditor. Implemented tooltip providers for
- language item documentation and compilation errors.
-
-2008-07-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Track api changes.
-
-2008-07-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml: Add add-in dependency.
-
-2008-07-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs,
- Makefile.am, MonoDevelop.SourceEditor.mdp,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Use new text markers
- defined in MD.Debugger. Properly fire LineCountChanged event.
-
-2008-06-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Don't add folding
- regions for one-line classes, properties and methods.
-
-2008-06-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed 'Bug 402368 -
- SourceEditorWidget+Error.RemoveFromLine throws uncaught exception'
-
-2008-06-23 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs,
- gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs,
- MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs,
- MonoDevelop.SourceEditor/SourceEditorOptions.cs: Added tab to
- reindent option.
-
-2008-06-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs: Moved logic for
- getting the system font from Font to FontName. In this way it is
- possible to make copies of options objects and get the name copied.
-
-2008-06-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorOptions.cs: Track api changes.
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Moved initial
- options loading to TextEditor.
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Remove debug code.
-
-2008-06-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs: fixed font name
- resolving.
-
-2008-06-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed 'Bug 393408 -
- Exception in ParseInformationUpdaterWorkerThread'.
-
-2008-06-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs,
- MonoDevelop.SourceEditor/SearchWidget.cs: fixed 'Bug 382403 - Find
- moves current position in all files'.
-
-2008-06-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Another
- workaround for gtk# bug #398929.
-
-2008-06-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SearchWidget.cs: Workaround for gtk# bug
- #398929.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic, MonoDevelop.SourceEditor.addin.xml: Bump MD
- version.
-
-2008-06-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs,
- MonoDevelop.SourceEditor/SearchWidget.cs,
- gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- Use the OnDestroyed event instead of Dispose, since with the latest
- changes in gtk#, Dispose is not called anymore when a widget is
- destroyed.
-
-2008-05-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fix search issue with
- the ITextIterator implementation. The iterator should wrap around
- the end of the document if the initial position is not 0.
-
-2008-05-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fixed dispose source
- editor widget bug.
-
-2008-05-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Added new dom & new
- class browser.
-
-2008-05-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Dispose() is called
- after the widget is destroyed. There is no need to explicitely
- destroy child widgets since destroying the parent widgets destroys
- all children.
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Don't explicitelly call
- widget.Dispose, since Destroy already calls it.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor.mdp,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/HighlightPropertiesSemanticRule.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: New project model
- changes.
-
-2008-05-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Name the editor's
- ViewContent.
-
-2008-05-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed 'Bug 384665 -
- Gtk-critical showed in console'.
-
-2008-05-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed 'Bug 385457 -
- Folding in the middle of a method'.
-
-2008-05-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Change ITextToolboxNode
- API so that nodes have more control over when they're shown.
-
-2008-05-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Track API.
-
-2008-05-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am, MonoDevelop.SourceEditor.mdp,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Show the current
- execution location when debugging. Show breakpoints.
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Use the new
- UnderlineMarker.
-
-2008-05-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs: Use platform
- service to determine whether a mimetype is text.
-
-2008-05-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fixed 'Bug 387448 -
- New text editor always show same value for "col" and "ch"'
-
-2008-05-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Enable support for
- ITextToolboxNodes.
-
-2008-05-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Trap and report
- errors from the text editor extension chain.
-
-2008-05-06 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs,
- MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs,
- MonoDevelop.SourceEditor/SearchWidget.cs: implemented Bug 383067 -
- Find/Replace Bar in managed editor should support regular
- expression find/replace
-
-2008-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SearchWidget.cs: Worked on regex search.
-
-2008-05-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/EditActions.cs: fixed Bug 383946 – Text
- editor deletes "matching" braces
-
-2008-04-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Fixed null
- reference when typing.
-
-2008-04-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Wrap info comments
- if they are wider than the screen, and move them inwards if they
- extend offscreen.
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: Use TooltipWindow and
- FixedWidthWrapLabel.
-
-2008-04-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs: Attempt to fix
- major "Bug 382141 - ALL keypresses are intepreted as newlines" by
- reworking input method context handling.
-
-2008-04-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: fixed keyboard
- input.
-
-2008-04-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Track API change.
- Remove char code translation hack.
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Break up overly long
- line.
-
-2008-04-16 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Removed work
- around.
-
-2008-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs: Handle mime
- types with xml subtype.
-
-2008-04-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: Track API.
-
-2008-04-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs:
- Use a fontbutton instead of a fontselection. Makes UI more compact
- and gets rid of a failed GTK critical assert.
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs,
- gtk-gui/MonoDevelop.SourceEditor.SearchWidget.cs,
- MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs,
- MonoDevelop.SourceEditor/SearchWidget.cs: Fix the pop up menu
- position relative to the button rather than the mouse pointer.
- * gtk-gui/gui.stetic, MonoDevelop.SourceEditor.mdp: Updated.
-
-2008-04-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic: Set GTK version to 2.8.3.
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Catch and log errors
- in worker thread to avoid crashing whole app.
- * MonoDevelop.SourceEditor/LanguageItemWindow.cs: Make tooltips
- semi-transparent when Ctrl key is held down.
-
-2008-04-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Added missing null
- check.
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Track api changes.
-
-2008-04-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs:
- CanCreateContentForMimeType should return only true for text files.
-
-2008-04-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Worked on issue
- "Bug 376142 - Issue with rightclick menu".
-
-2008-04-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed bug in using
- folding.
-
-2008-03-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Added using folding
- regions.
-
-2008-03-27 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fixed resource
- deallocation (the real source of the ParseInformation update bug).
-
-2008-03-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed Bug 373709 - 2
- Gtk-Criticals when closing source editor.
-
-2008-03-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed Bug 373056 -
- Random MD crash.
-
-2008-03-27 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs,
- gtk-gui/gui.stetic, MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- Fixed Bug 373702 - Null reference errors in source editor.
-
-2008-03-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic: Set target GTK# version to 2.8.
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Ignore multiple
- Dispose calls. Don't try to alter focus while widget is being
- disposed. Fixes two Gtk-Criticals.
-
-2008-03-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs,
- MonoDevelop.SourceEditor/SearchWidget.cs: Fixed "Bug 372817 - With
- windows split, search always jumps to match in first window
- regardless of focus".
-
-2008-03-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Don't try to comment
- line if language binding is null. Fixes NRE.
-
-2008-03-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Fixed 'Bug 372256
- - Region wrapped when Code Folding is disabled'
-
-2008-03-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic: Spelling fix.
-
-2008-03-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/EditActions.cs: Fixed Bug 371703 - Unable to
- delete {.
-
-2008-03-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed Bug 370134 -
- Replace box: can't navigate through controls using the Tab key.
-
-2008-03-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs,
- MonoDevelop.SourceEditor/SearchWidget.cs: Search is now more
- interactive.
-
-2008-03-13 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs,
- MonoDevelop.SourceEditor/GotoLineNumberWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed Bug 370133 -
- When jumping to a line, caret should be placed in the middle of the
- window
-
-2008-03-13 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs,
- MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs,
- MonoDevelop.SourceEditor/SearchWidget.cs: Fixed Bug 370139 - Search
- entry shown in red backround even if there is a match.
-
-2008-03-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fixed Bug 363634 -
- Quick class navigator does not work for abstract methods
-
-2008-03-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed warning.
-
-2008-03-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: added emacs find
- next/prev
-
-2008-03-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/objects.xml,
- MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs,
- MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs,
- MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs,
- MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs,
- MonoDevelop.SourceEditor.addin.xml: Use new options dialog
- infrastructure.
-
-2008-03-05 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs: Window split now removes
- the split that doesn't have the focus. (intelligent split)
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs,
- gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs,
- gtk-gui/MonoDevelop.SourceEditor.SearchWidget.cs: Fixed some dialogs for
- hig compliance.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs,
- gtk-gui/gui.stetic,
- MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs,
- MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs,
- MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs,
- MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs,
- MonoDevelop.SourceEditor/MarkerOperationsHandler.cs: Worked on gnome hig
- compliant alerts.
-
-2008-03-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Improved threading.
-
-2008-03-03 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs: Added some worker
- threads.
-
-2008-03-03 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs,
- MonoDevelop.SourceEditor/SearchWidget.cs: Added code metrics start.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Refactored content
- interfaces
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Added command for
- switching between splits.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Worked on quick finder
- tooltips.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Added zoom commands to
- main menu.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/MarkerOperationsHandler.cs: Text editor now
- reacts on context sensitive menus display (Shift+F10) and Ctrl+F1 shows
- the tooltip.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs,
- gtk-gui/MonoDevelop.SourceEditor.SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed "Bug 365840 -
- Editor should have the focus after switching documents".
-
-2008-02-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed "Bug 365453 -
- Exception when attempting to save newly created file (not as part of a
- project)".
-
-2008-02-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed "Bug 365624 - Widget
- toolbox are shown unsorted".
-
-2008-02-28 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs,
- gtk-gui/MonoDevelop.SourceEditor.SourceEditorWidget.cs,
- gtk-gui/gui.stetic, MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs: Worked on
- search&replace. (Bug 365439 - Replace usability issues)
-
-2008-02-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Fixed Bug 365570 - Crash
- in the editor
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Worked on category support
- for the toolbox service.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Automatically unfold
- regions when you jump to them.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs,
- gtk-gui/gui.stetic, MonoDevelop.SourceEditor/SourceEditorWidget.cs:
- Refactored status bar.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Worked on undo.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: No longer setting caret
- position on right click on selection.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs: Changed combobox sizing
- a bit.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Fixed Bug 364192 - Right
- click should place the caret before showing context menu.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Some changes for slight
- change in the text editor interface.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Added some safety checks.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fixed status bar - worked
- on region combo.
-
-2008-02-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Cosmetic fix.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs,
- MonoDevelop.SourceEditor/SearchWidget.cs: Search error removed, when
- pattern is empty
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: swapped search wrap
- messages.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/GotoLineNumberWidget.cs,
- MonoDevelop.SourceEditor/SearchWidget.cs: Improved search (user
- recognizes if pattern is not found). Set some status bar messages.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Fixed Bug 363983 -
- Tooltip does not hide when goto dialog shows.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: toolbox drag from now works.
-
-2008-02-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Properly check if the
- editor was the last focused widget.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Changed clipboard ring
- handling of duplicate items.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/objects.xml, gtk-gui/gui.stetic, Makefile.am,
- MonoDevelop.SourceEditor.mdp,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Worked on clipboard ring
- and completion window now closes when switching the desktop.
-
-2008-02-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Fixed Bug 363327 - Too
- many undo steps needed to remove a new line.
-
-2008-02-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Enable clipboard and
- undo commands only when the editor window has the focus.
-
-2008-02-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Add binding for delete
- command, so the delete action will work even if the the delete command
- is bound to the delete key.
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: fixed little comment issue.
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixing file changed bug
- (with new files).
-
-2008-02-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs,
- gtk-gui/MonoDevelop.SourceEditor.SearchWidget.cs,
- gtk-gui/MonoDevelop.SourceEditor.GotoLineNumberWidget.cs,
- gtk-gui/gui.stetic: Use buttons without relief for the search/replace
- widgets.
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed toggle code comment
- bug.
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed comment/uncomment
- code.
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed Bug 362889 - Error
- underlining not properly redrawn.
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: fixed some gdk criticals
- caused by an too early OptionsChanged event.
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs,
- MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs,
- MonoDevelop.SourceEditor/SearchWidget.cs: Worked on selection.
-
-2008-02-18 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs,
- MonoDevelop.SourceEditor/SearchWidget.cs: Small workaround to be able to
- build in mono 1.2.4 (mono 1.2.4 ignores usings in anon delegates).
-
-2008-02-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed Bug 362692 - Undoing
- all changes should clear the modified flag of the editor.
-
-2008-02-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs: Implemented mouse wheel
- zoom.
-
-2008-02-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Fixed find next selection
- update.
-
-2008-02-18 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs,
- gtk-gui/MonoDevelop.SourceEditor.SearchWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs,
- MonoDevelop.SourceEditor/SearchWidget.cs: replace/search patterns are
- now static.
-
-2008-02-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed file system watcher.
-
-2008-02-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/GotoLineNumberWidget.cs: Fixed goto line number
- relative jump.
-
-2008-02-17 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs,
- MonoDevelop.SourceEditor/SearchWidget.cs: Worked on search options.
-
-2008-02-17 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs,
- gtk-gui/MonoDevelop.SourceEditor.SearchWidget.cs,
- gtk-gui/MonoDevelop.SourceEditor.GotoLineNumberWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/GotoLineNumberWidget.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs,
- MonoDevelop.SourceEditor/EditActions.cs,
- MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs,
- MonoDevelop.SourceEditor/SearchWidget.cs: Worked on search and replace.
-
-2008-02-15 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs: Ruler can
- now be set up to column 1024.
-
-2008-02-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs,
- MonoDevelop.SourceEditor/MarkerOperationsHandler.cs: Refactored text
- editor.
-
-2008-02-15 Geoff Norton <gnorton@novell.com>
-
- * MonoDevelop.SourceEditor.mdp: Remove the gnome-sharp dependecny.
- * Makefile.am: Remove the gnome-sharp dependecny.
-
-2008-02-15 Geoff Norton <gnorton@novell.com>:
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Disable GnomePrint so that
- we can work on systems that dont have it. TODO: Rewrite in GtkPrint.
-
-2008-02-15 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/HighlightPropertiesSemanticRule.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs,
- MonoDevelop.SourceEditor/SourceEditorOptions.cs,
- MonoDevelop.SourceEditor/MarkerOperationsHandler.cs,
- MonoDevelop.SourceEditor/EditActions.cs,
- MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs: Refactored text
- editor.
-
-2008-02-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * SourceEditorWidget.cs: Add workaround for gmcs 1.2.4 bug.
-
-2008-02-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.SourceEditor.mdp: Fix dist.
-
-2008-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Use new RunAction method
- to execute editor actions. Added missing commands.
-
-2008-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Bind MonoDevelop
- shortcuts to editor actions.
-
-2008-02-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs,
- MonoDevelop.SourceEditor/SourceEditorOptions.cs,
- MonoDevelop.SourceEditor/MarkerOperationsHandler.cs,
- MonoDevelop.SourceEditor/SourceEditorCommands.cs: Urls inside the text
- editor can now be opened using the context menu.
-
-2008-02-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Fixed warning.
-
-2008-02-14 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic, MonoDevelop.SourceEditor/SourceEditorView.cs: Changed
- delete call.
-
-2008-02-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Changed delete action.
-
-2008-02-12 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel.cs,
- gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs,
- gtk-gui/gui.stetic,
- MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs, Makefile.am,
- MonoDevelop.SourceEditor.mdp,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/HighlightPropertiesSemanticRule.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs,
- MonoDevelop.SourceEditor/SourceEditorOptions.cs: Worked on semantic
- highlighting - properties can now be shown as italic. (Enable it in the
- syntax highlighting panel)
-
-2008-02-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Improved auto insert
- bracket.
-
-2008-02-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs,
- MonoDevelop.SourceEditor/SourceEditorOptions.cs: Some changes for the
- text editor.
-
-2008-02-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Optimized/Refactored the
- text editor.
-
-2008-02-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed a bug caused by
- performance optimization.
-
-2008-02-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed Bug 360411 - Problems
- in Code Completion.
-
-2008-02-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Changes for overwrite
- mode.
-
-2008-02-08 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel.cs:
- Changed the highlighting panel.
-
-2008-02-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: TextChange is now fired.
-
-2008-02-08 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed highlighting
- bug/code navigator combos.
-
-2008-02-08 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed sizing bug.
-
-2008-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorOptions.cs: Color styles are now in
- options.
-
-2008-02-06 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs,
- Makefile.am, MonoDevelop.SourceEditor.mdp,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Worked on printing
-
-2008-02-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Added some folding
- commands.
-
-2008-02-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Improved folding behavior.
-
-2008-02-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml: Worked on text editor context menu.
-
-2008-02-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Converted
- comment/uncomment to the more common toggle comment logic.
-
-2008-02-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: #region ... #endregion is
- now folded per default.
-
-2008-02-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs: Fixed
- highlighting panel.
-
-2008-02-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorOptions.cs: Implemented bracket
- matching.
-
-2008-02-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/EditActions.cs: Bug 354129 - Auto add second
- brackets, quotation mark
-
-2008-02-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Implemented Bug 323946 -
- Undo/Redo functionality are not context sensitive.
-
-2008-02-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed reload bug.
-
-2008-02-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Filtered out body less
- methods in folding (abstract methods, methods declared in interfaces).
-
-2008-02-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Comment/Uncomment and
- Indent/Unindent commands should now work as expected.
-
-2008-02-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Implemented ISplittable.
-
-2008-02-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed code completion bug.
-
-2008-02-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Added some safety checks.
-
-2008-02-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs: Added bounds check for
- error underlining.
-
-2008-02-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorView.cs: Fixed insert/delete text
- caret offsets.
-
-2008-02-01 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/objects.xml, gtk-gui/gui.stetic, Makefile.am,
- MonoDevelop.SourceEditor.mdp: Added makefile.
-
-2008-02-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Worked on folding.
-
-2008-01-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs: Some changes
- due to lazy loading.
-
-2008-01-31 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel.cs,
- MonoDevelop.SourceEditor.addin.xml,
- MonoDevelop.SourceEditor/SourceEditorView.cs,
- MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs: Worked on
- context menu.
-
-2008-01-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs: Worked on bookmark
- commands.
-
-2008-01-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorOptions.cs: AutoInsert template
- option now works.
-
-2008-01-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorOptions.cs: AutoInsert template
- option now works.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.SourceEditor.addin.xml: Update MD version.
-
-2008-01-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorOptions.cs: AutoInsert template
- option now works.
-
-2008-01-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs,
- MonoDevelop.SourceEditor/SourceEditorOptions.cs: Added auto insert
- bracket option.
-
-2008-01-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs,
- MonoDevelop.SourceEditor/SourceEditorOptions.cs: Added auto insert
- bracket option.
-
-2008-01-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorOptions.cs: Added property change
- event.
-
-2008-01-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorOptions.cs: Added property change
- event.
-
-2008-01-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs: Worked on error
- underlining.
-
-2008-01-23 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs,
- gtk-gui/gui.stetic, MonoDevelop.SourceEditor.mdp,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs,
- MonoDevelop.SourceEditor/EditActions.cs: Worked on code templates.
-
-2008-01-22 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel.cs,
- gtk-gui/gui.stetic, ChangeLog,
- MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs,
- MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorOptions.cs: Worked on style panel.
-
-2008-01-22 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel.cs,
- gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs,
- gtk-gui/objects.xml,
- gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs,
- gtk-gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs,
- gtk-gui/gui.stetic,
- MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs,
- MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs,
- MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs,
- MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs,
- MonoDevelop.SourceEditor.addin.xml, MonoDevelop.SourceEditor.mdp,
- MonoDevelop.SourceEditor/SourceEditorWidget.cs,
- MonoDevelop.SourceEditor/ExtendibleTextEditor.cs,
- MonoDevelop.SourceEditor/SourceEditorView.cs,
- MonoDevelop.SourceEditor/SourceEditorOptions.cs,
- MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs,
- MonoDevelop.SourceEditor/LanguageItemWindow.cs: Worked on text editor
- option panels.
-
-2008-01-21 Mike Krüger <mkrueger@novell.com>
-
- * ExtendibleTextEditor.cs, SourceEditorView.cs,
- MonoDevelop.SourceEditor.addin.xml, MonoDevelop.SourceEditor.mdp: Worked
- on context menu.
-
-2008-01-21 Geoff Norton <gnorton@novell.com>
-
- * MonoDevelop.SourceEditor.mdp: Remove hard dependency on Gnome#
- * SourceEditorView.cs: Get the MimeType from the PlatformService rather
- than directly from Gnome.Vfs.
-
-2008-01-21 Mike Krüger <mkrueger@novell.com>
-
- * SourceEditorWidget.cs, ExtendibleTextEditor.cs, SourceEditorView.cs:
- Worked on search commands.
-
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Extension/TemplateCodon.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Extension/TemplateCodon.cs
deleted file mode 100644
index c9a574ac82..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Extension/TemplateCodon.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-// TemplateCodon.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-using System.IO;
-using System;
-using System.Xml;
-
-using Mono.Addins;
-using Mono.TextEditor.Highlighting;
-
-namespace MonoDevelop.SourceEditor.Extension
-{
- [ExtensionNode (Description="A template for color and syntax shemes.")]
- public class TemplateCodon : ExtensionNode, Mono.TextEditor.Highlighting.IStreamProvider
- {
- [NodeAttribute("resource", "Name of the resource where the template is stored.")]
- string resource;
-
- [NodeAttribute("file", "Name of the file where the template is stored.")]
- string file;
-
- public TemplateCodon ()
- {
- resource = file = null;
- }
-
- public Stream Open ()
- {
- Stream stream;
- if (!string.IsNullOrEmpty (file)) {
- stream = File.OpenRead (Addin.GetFilePath (file));
- } else if (!string.IsNullOrEmpty (resource)) {
- stream = Addin.GetResource (resource);
- if (stream == null)
- throw new ApplicationException ("Template " + resource + " not found");
- } else {
- throw new InvalidOperationException ("Template file or resource not provided");
- }
-
- return stream;
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Extension/TemplateExtensionNodeLoader.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Extension/TemplateExtensionNodeLoader.cs
deleted file mode 100644
index 8989591d6f..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Extension/TemplateExtensionNodeLoader.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-// TemplateExtensionNodeLoader.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using Mono.TextEditor.Highlighting;
-using Mono.Addins;
-
-namespace MonoDevelop.SourceEditor.Extension
-{
- public static class TemplateExtensionNodeLoader
- {
- static bool initialized = false;
-
- public static void Init ()
- {
- if (initialized)
- return;
- initialized = true;
- AddinManager.AddExtensionNodeHandler ("/MonoDevelop/SourceEditor2/SyntaxModes", OnSyntaxModeExtensionChanged);
- AddinManager.AddExtensionNodeHandler ("/MonoDevelop/SourceEditor2/Styles", OnStylesExtensionChanged);
- }
-
- static void OnSyntaxModeExtensionChanged (object s, ExtensionNodeEventArgs args)
- {
- TemplateCodon codon = (TemplateCodon)args.ExtensionNode;
- if (args.Change == ExtensionChange.Add) {
- Mono.TextEditor.Highlighting.SyntaxModeService.AddSyntaxMode (codon);
- } else {
- Mono.TextEditor.Highlighting.SyntaxModeService.RemoveSyntaxMode (codon);
- }
- }
-
- static void OnStylesExtensionChanged (object s, ExtensionNodeEventArgs args)
- {
- TemplateCodon codon = (TemplateCodon)args.ExtensionNode;
- if (args.Change == ExtensionChange.Add) {
- Mono.TextEditor.Highlighting.SyntaxModeService.AddStyle (codon);
- } else {
- Mono.TextEditor.Highlighting.SyntaxModeService.RemoveStyle (codon);
- }
- }
-
- }
-}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.JSon/JSonIndentEngine.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.JSon/JSonIndentEngine.cs
deleted file mode 100644
index 18be36da2b..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.JSon/JSonIndentEngine.cs
+++ /dev/null
@@ -1,295 +0,0 @@
-//
-// JSonTextEditorExtension.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using ICSharpCode.NRefactory.CSharp;
-using Mono.TextEditor;
-using System.Text;
-using ICSharpCode.NRefactory;
-
-namespace MonoDevelop.SourceEditor.JSon
-{
- class JSonIndentEngine : IStateMachineIndentEngine
- {
- TextEditorData data;
- int offset, line, column;
- internal Indent thisLineIndent, nextLineIndent;
- StringBuilder currentIndent;
- char previousNewline = '\0';
- char previousChar = '\0';
- bool isLineStart;
- bool isInString;
-
- public JSonIndentEngine (TextEditorData data)
- {
- this.data = data;
- Reset ();
- }
-
- #region IStateMachineIndentEngine implementation
-
- public IStateMachineIndentEngine Clone ()
- {
- return (IStateMachineIndentEngine)MemberwiseClone ();
- }
-
- public bool IsInsidePreprocessorDirective {
- get {
- return false;
- }
- }
-
- public bool IsInsidePreprocessorComment {
- get {
- return false;
- }
- }
-
- public bool IsInsideStringLiteral {
- get {
- return false;
- }
- }
-
- public bool IsInsideVerbatimString {
- get {
- return false;
- }
- }
-
- public bool IsInsideCharacter {
- get {
- return false;
- }
- }
-
- public bool IsInsideString {
- get {
- return isInString;
- }
- }
-
- public bool IsInsideLineComment {
- get {
- return false;
- }
- }
-
- public bool IsInsideMultiLineComment {
- get {
- return false;
- }
- }
-
- public bool IsInsideDocLineComment {
- get {
- return false;
- }
- }
-
- public bool IsInsideComment {
- get {
- return false;
- }
- }
-
- public bool IsInsideOrdinaryComment {
- get {
- return false;
- }
- }
-
- public bool IsInsideOrdinaryCommentOrString {
- get {
- return false;
- }
- }
-
- public bool LineBeganInsideVerbatimString {
- get {
- return false;
- }
- }
-
- public bool LineBeganInsideMultiLineComment {
- get {
- return false;
- }
- }
-
- #endregion
-
- public static ICSharpCode.NRefactory.CSharp.TextEditorOptions CreateNRefactoryTextEditorOptions (TextEditorData doc)
- {
- return new ICSharpCode.NRefactory.CSharp.TextEditorOptions {
- TabsToSpaces = doc.TabsToSpaces,
- TabSize = doc.Options.TabSize,
- IndentSize = doc.Options.IndentationSize,
- ContinuationIndent = doc.Options.IndentationSize,
- LabelIndent = -doc.Options.IndentationSize,
- EolMarker = doc.EolMarker,
- IndentBlankLines = doc.Options.IndentStyle != IndentStyle.Virtual,
- WrapLineLength = doc.Options.RulerColumn
- };
- }
-
- #region IDocumentIndentEngine implementation
-
- public void Push (char ch)
- {
- var isNewLine = NewLine.IsNewLine (ch);
- if (!isNewLine) {
- if (ch == '"')
- isInString = !IsInsideString;
- if (ch == '{' || ch == '[') {
- nextLineIndent.Push (IndentType.Block);
- } else if (ch == '}' || ch == ']') {
- if (thisLineIndent.Count > 0)
- thisLineIndent.Pop ();
- if (nextLineIndent.Count > 0)
- nextLineIndent.Pop ();
- }
- } else {
- if (ch == NewLine.LF && previousChar == NewLine.CR) {
- offset++;
- previousChar = ch;
- return;
- }
- }
-
- offset++;
- if (!isNewLine) {
- previousNewline = '\0';
-
- isLineStart &= char.IsWhiteSpace (ch);
-
- if (isLineStart)
- currentIndent.Append (ch);
-
- if (ch == '\t') {
- var nextTabStop = (column - 1 + data.Options.IndentationSize) / data.Options.IndentationSize;
- column = 1 + nextTabStop * data.Options.IndentationSize;
- } else {
- column++;
- }
- } else {
- previousNewline = ch;
- currentIndent.Length = 0;
- isLineStart = true;
- column = 1;
- line++;
- thisLineIndent = nextLineIndent.Clone ();
- }
- previousChar = ch;
- }
-
- public void Reset ()
- {
- offset = 0;
- line = column = 1;
- thisLineIndent = new Indent (CreateNRefactoryTextEditorOptions (data));
- nextLineIndent = new Indent (CreateNRefactoryTextEditorOptions (data));
- currentIndent = new StringBuilder ();
- previousNewline = '\0';
- previousChar = '\0';
- isLineStart = true;
- isInString = false;
- }
-
- public void Update (int offset)
- {
- if (Offset > offset)
- Reset ();
-
- while (Offset < offset) {
- Push (Document.GetCharAt (Offset));
- }
- }
-
- IDocumentIndentEngine IDocumentIndentEngine.Clone ()
- {
- return Clone ();
- }
-
- public ICSharpCode.NRefactory.Editor.IDocument Document {
- get {
- return data.Document;
- }
- }
-
- public string ThisLineIndent {
- get {
- return thisLineIndent.IndentString;
- }
- }
-
- public string NextLineIndent {
- get {
- return nextLineIndent.IndentString;
- }
- }
-
- public string CurrentIndent {
- get {
- return currentIndent.ToString ();
- }
- }
-
- public bool NeedsReindent {
- get {
- return ThisLineIndent != CurrentIndent;
- }
- }
-
- public int Offset {
- get {
- return offset;
- }
- }
-
- public TextLocation Location {
- get {
- return new TextLocation (line, column);
- }
- }
-
- public bool EnableCustomIndentLevels {
- get;
- set;
- }
-
- #endregion
-
- #region ICloneable implementation
-
- object ICloneable.Clone ()
- {
- return Clone ();
- }
-
- #endregion
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.JSon/JSonIndentationTracker.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.JSon/JSonIndentationTracker.cs
deleted file mode 100644
index 7ebfbe34fb..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.JSon/JSonIndentationTracker.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// JSonTextEditorExtension.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.CSharp;
-using System;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.SourceEditor.JSon
-{
- class JSonIndentationTracker : IIndentationTracker
- {
- readonly TextEditorData data;
- readonly CacheIndentEngine stateTracker;
-
- public JSonIndentationTracker(TextEditorData data, CacheIndentEngine stateTracker)
- {
- this.data = data;
- this.stateTracker = stateTracker;
- }
-
- string GetIndentationString (DocumentLocation loc)
- {
- var line = data.Document.GetLine (loc.Line);
- if (line == null)
- return "";
- // Get context to the end of the line w/o changing the main engine's state
- var offset = line.Offset;
- string curIndent = line.GetIndentation (data.Document);
- try {
- stateTracker.Update (Math.Min (data.Length, offset + Math.Min (line.Length, loc.Column - 1)));
- int nlwsp = curIndent.Length;
- if (!stateTracker.LineBeganInsideMultiLineComment || (nlwsp < line.LengthIncludingDelimiter && data.Document.GetCharAt (offset + nlwsp) == '*'))
- return stateTracker.ThisLineIndent;
- } catch (Exception e) {
- LoggingService.LogError ("Error while indenting at "+ loc, e);
- }
- return curIndent;
- }
-
- #region IIndentationTracker implementation
- public string GetIndentationString (int offset)
- {
- return GetIndentationString (data.OffsetToLocation (offset));
- }
-
- public string GetIndentationString (int lineNumber, int column)
- {
- return GetIndentationString (new DocumentLocation (lineNumber, column));
- }
-
- public int GetVirtualIndentationColumn (int offset)
- {
- return 1 + GetIndentationString (offset).Length;
- }
-
- public int GetVirtualIndentationColumn (int lineNumber, int column)
- {
- return 1 + GetIndentationString (lineNumber, column).Length;
- }
- #endregion
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.JSon/JSonTextEditorExtension.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.JSon/JSonTextEditorExtension.cs
deleted file mode 100644
index 5ae84fa44a..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.JSon/JSonTextEditorExtension.cs
+++ /dev/null
@@ -1,131 +0,0 @@
-//
-// JSonTextEditorExtension.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using MonoDevelop.Ide.Gui.Content;
-using ICSharpCode.NRefactory.CSharp;
-using Gdk;
-using Mono.TextEditor;
-using System;
-using MonoDevelop.Core;
-using MonoDevelop.Ide.CodeCompletion;
-
-namespace MonoDevelop.SourceEditor.JSon
-{
- class JSonTextEditorExtension : TextEditorExtension
- {
- CacheIndentEngine stateTracker;
-
- TextEditorData textEditorData {
- get {
- return document.Editor;
- }
- }
-
- public override void Initialize ()
- {
- base.Initialize ();
- IStateMachineIndentEngine indentEngine;
- indentEngine = new JSonIndentEngine (document.Editor);
- stateTracker = new CacheIndentEngine (indentEngine);
- document.Editor.IndentationTracker = new JSonIndentationTracker (document.Editor, stateTracker);
- }
-
-
- public override bool KeyPress (Key key, char keyChar, ModifierType modifier)
- {
- var result = base.KeyPress (key, keyChar, modifier);
-
- if (key == Key.Return) {
- if (textEditorData.Options.IndentStyle == IndentStyle.Virtual) {
- if (textEditorData.GetLine (textEditorData.Caret.Line).Length == 0)
- textEditorData.Caret.Column = textEditorData.IndentationTracker.GetVirtualIndentationColumn (textEditorData.Caret.Location);
- } else {
- DoReSmartIndent ();
- }
- }
-
- return result;
- }
-
- void DoReSmartIndent ()
- {
- DoReSmartIndent (textEditorData.Caret.Offset);
- }
-
- void DoReSmartIndent (int cursor)
- {
- SafeUpdateIndentEngine (cursor);
- if (stateTracker.LineBeganInsideVerbatimString || stateTracker.LineBeganInsideMultiLineComment)
- return;
- var line = textEditorData.Document.GetLineByOffset (cursor);
-
- // Get context to the end of the line w/o changing the main engine's state
- var curTracker = stateTracker.Clone ();
- try {
- for (int max = cursor; max < line.EndOffset; max++) {
- curTracker.Push (textEditorData.Document.GetCharAt (max));
- }
- } catch (Exception e) {
- LoggingService.LogError ("Exception during indentation", e);
- }
-
- int pos = line.Offset;
- string curIndent = line.GetIndentation (textEditorData.Document);
- int nlwsp = curIndent.Length;
- int offset = cursor > pos + nlwsp ? cursor - (pos + nlwsp) : 0;
- if (!stateTracker.LineBeganInsideMultiLineComment || (nlwsp < line.LengthIncludingDelimiter && textEditorData.Document.GetCharAt (line.Offset + nlwsp) == '*')) {
- // Possibly replace the indent
- string newIndent = curTracker.ThisLineIndent;
- int newIndentLength = newIndent.Length;
- if (newIndent != curIndent) {
- if (CompletionWindowManager.IsVisible) {
- if (pos < CompletionWindowManager.CodeCompletionContext.TriggerOffset)
- CompletionWindowManager.CodeCompletionContext.TriggerOffset -= nlwsp;
- }
-
- newIndentLength = textEditorData.Replace (pos, nlwsp, newIndent);
- textEditorData.Document.CommitLineUpdate (textEditorData.Caret.Line);
- CompletionWindowManager.HideWindow ();
- }
- pos += newIndentLength;
- } else {
- pos += curIndent.Length;
- }
-
- pos += offset;
-
- textEditorData.FixVirtualIndentation ();
- }
- internal void SafeUpdateIndentEngine (int offset)
- {
- try {
- stateTracker.Update (offset);
- } catch (Exception e) {
- LoggingService.LogError ("Error while updating the indentation engine", e);
- }
- }
-
- }
-} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs
index ccf1be8f63..3a49025ecf 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs
@@ -24,9 +24,11 @@
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using Mono.TextEditor;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.SourceEditor.OptionPanels
{
@@ -46,22 +48,22 @@ namespace MonoDevelop.SourceEditor.OptionPanels
autoInsertBraceCheckbutton.Toggled += HandleAutoInsertBraceCheckbuttonToggled;
}
- public virtual Gtk.Widget CreatePanelWidget ()
+ public virtual Control CreatePanelWidget ()
{
// this.autoInsertTemplateCheckbutton.Active = DefaultSourceEditorOptions.Options.AutoInsertTemplates;
autoInsertBraceCheckbutton.Active = DefaultSourceEditorOptions.Instance.AutoInsertMatchingBracket;
smartSemicolonPlaceCheckbutton.Active = DefaultSourceEditorOptions.Instance.SmartSemicolonPlacement;
tabAsReindentCheckbutton.Active = DefaultSourceEditorOptions.Instance.TabIsReindent;
- indentationCombobox.Active = (int)DefaultSourceEditorOptions.Instance.IndentStyle;
+ indentationCombobox.Active = Math.Min (2, (int)DefaultSourceEditorOptions.Instance.IndentStyle);
controlLeftRightCombobox.Active = (int)DefaultSourceEditorOptions.Instance.WordNavigationStyle;
- useViModesCheck.Active = DefaultSourceEditorOptions.Instance.UseViModes;
checkbuttonOnTheFlyFormatting.Active = DefaultSourceEditorOptions.Instance.OnTheFlyFormatting;
checkbuttonGenerateFormattingUndoStep.Active = DefaultSourceEditorOptions.Instance.GenerateFormattingUndoStep;
checkbuttonFormatOnSave.Active = PropertyService.Get ("AutoFormatDocumentOnSave", false);
checkbuttonAutoSetSearchPatternCasing.Active = PropertyService.Get ("AutoSetPatternCasing", false);
+ checkbuttonEnableSelectionSurrounding.Active = DefaultSourceEditorOptions.Instance.EnableSelectionWrappingKeys;
HandleAutoInsertBraceCheckbuttonToggled (null, null);
return this;
}
@@ -76,14 +78,14 @@ namespace MonoDevelop.SourceEditor.OptionPanels
//DefaultSourceEditorOptions.Options.AutoInsertTemplates = this.autoInsertTemplateCheckbutton.Active;
DefaultSourceEditorOptions.Instance.AutoInsertMatchingBracket = autoInsertBraceCheckbutton.Active;
DefaultSourceEditorOptions.Instance.SmartSemicolonPlacement = smartSemicolonPlaceCheckbutton.Active;
- DefaultSourceEditorOptions.Instance.IndentStyle = (IndentStyle)indentationCombobox.Active;
+ DefaultSourceEditorOptions.Instance.IndentStyle = (MonoDevelop.Ide.Editor.IndentStyle)indentationCombobox.Active;
DefaultSourceEditorOptions.Instance.TabIsReindent = tabAsReindentCheckbutton.Active;
DefaultSourceEditorOptions.Instance.WordNavigationStyle = (WordNavigationStyle)controlLeftRightCombobox.Active;
- DefaultSourceEditorOptions.Instance.UseViModes = useViModesCheck.Active;
DefaultSourceEditorOptions.Instance.OnTheFlyFormatting = checkbuttonOnTheFlyFormatting.Active;
DefaultSourceEditorOptions.Instance.GenerateFormattingUndoStep = checkbuttonGenerateFormattingUndoStep.Active;
PropertyService.Set ("AutoSetPatternCasing", checkbuttonAutoSetSearchPatternCasing.Active);
PropertyService.Set ("AutoFormatDocumentOnSave", checkbuttonFormatOnSave.Active);
+ DefaultSourceEditorOptions.Instance.EnableSelectionWrappingKeys = checkbuttonEnableSelectionSurrounding.Active;
}
public void Initialize (OptionsDialog dialog, object dataObject)
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/ColorShemeEditor.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/ColorShemeEditor.cs
index 85830f504d..f88decd359 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/ColorShemeEditor.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/ColorShemeEditor.cs
@@ -29,14 +29,15 @@ using Mono.TextEditor.Highlighting;
using MonoDevelop.Core;
using MonoDevelop.Ide;
using Gtk;
+using MonoDevelop.Components;
namespace MonoDevelop.SourceEditor.OptionPanels
{
public partial class ColorShemeEditor : Gtk.Dialog
{
- TextEditor textEditor;
+ MonoTextEditor textEditor;
ColorScheme colorSheme;
- TreeStore colorStore = new Gtk.TreeStore (typeof (string), typeof(ColorScheme.PropertyDecsription), typeof(object));
+ TreeStore colorStore = new Gtk.TreeStore (typeof (string), typeof(ColorScheme.PropertyDescription), typeof(object));
string fileName;
HighlightingPanel panel;
@@ -44,8 +45,8 @@ namespace MonoDevelop.SourceEditor.OptionPanels
{
this.panel = panel;
this.Build ();
- textEditor = new TextEditor ();
- textEditor.Options = DefaultSourceEditorOptions.Instance;
+ textEditor = new MonoTextEditor ();
+ textEditor.Options = new StyledSourceEditorOptions (MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance);
this.scrolledwindowTextEditor.Child = textEditor;
textEditor.ShowAll ();
@@ -73,7 +74,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
void SyntaxCellRenderer (Gtk.CellLayout cell_layout, Gtk.CellRenderer cell, Gtk.TreeModel tree_model, Gtk.TreeIter iter)
{
var renderer = (Gtk.CellRendererText)cell;
- var data = (ColorScheme.PropertyDecsription)colorStore.GetValue (iter, 1);
+ var data = (ColorScheme.PropertyDescription)colorStore.GetValue (iter, 1);
string markup = GLib.Markup.EscapeText (data.Attribute.Name);
renderer.Markup = markup;
}
@@ -86,7 +87,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
Gtk.TreeIter iter;
if (colorStore.GetIterFirst (out iter)) {
do {
- var data = (ColorScheme.PropertyDecsription)colorStore.GetValue (iter, 1);
+ var data = (ColorScheme.PropertyDescription)colorStore.GetValue (iter, 1);
var style = colorStore.GetValue (iter, 2);
data.Info.SetValue (sheme, style, null);
} while (colorStore.IterNext (ref iter));
@@ -100,8 +101,8 @@ namespace MonoDevelop.SourceEditor.OptionPanels
if (editor == null)
continue;
doc.UpdateParseDocument ();
- editor.Parent.TextViewMargin.PurgeLayoutCache ();
- editor.Document.CommitUpdateAll ();
+// editor.Parent.TextViewMargin.PurgeLayoutCache ();
+// editor.Document.CommitUpdateAll ();
}
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionAppearancePanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionAppearancePanel.cs
index c51e0406d2..46e5157abb 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionAppearancePanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionAppearancePanel.cs
@@ -24,8 +24,11 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Ide.Editor.Extension;
+using MonoDevelop.Ide;
namespace MonoDevelop.SourceEditor.OptionPanels
{
@@ -50,12 +53,11 @@ namespace MonoDevelop.SourceEditor.OptionPanels
{
}
- Gtk.Widget IOptionsPanel.CreatePanelWidget ()
+ Control IOptionsPanel.CreatePanelWidget ()
{
- spinbutton1.Value = CompletionTextEditorExtension.CompletionListRows;
- filterByBrowsableCheckbutton.Active = CompletionTextEditorExtension.FilterCompletionListByEditorBrowsable;
- normalOnlyRadiobutton.Active = !CompletionTextEditorExtension.IncludeEditorBrowsableAdvancedMembers;
- includeAdvancedRadiobutton.Active = CompletionTextEditorExtension.IncludeEditorBrowsableAdvancedMembers;
+ filterByBrowsableCheckbutton.Active = IdeApp.Preferences.FilterCompletionListByEditorBrowsable;
+ normalOnlyRadiobutton.Active = !IdeApp.Preferences.IncludeEditorBrowsableAdvancedMembers;
+ includeAdvancedRadiobutton.Active = IdeApp.Preferences.IncludeEditorBrowsableAdvancedMembers;
FilterToggled (this, EventArgs.Empty);
return this;
}
@@ -72,9 +74,8 @@ namespace MonoDevelop.SourceEditor.OptionPanels
void IOptionsPanel.ApplyChanges ()
{
- CompletionTextEditorExtension.CompletionListRows.Value = spinbutton1.ValueAsInt;
- CompletionTextEditorExtension.FilterCompletionListByEditorBrowsable.Value = filterByBrowsableCheckbutton.Active;
- CompletionTextEditorExtension.IncludeEditorBrowsableAdvancedMembers.Value = includeAdvancedRadiobutton.Active;
+ IdeApp.Preferences.FilterCompletionListByEditorBrowsable.Value = filterByBrowsableCheckbutton.Active;
+ IdeApp.Preferences.IncludeEditorBrowsableAdvancedMembers.Value = includeAdvancedRadiobutton.Active;
}
#endregion
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionCharactersPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionCharactersPanel.cs
index 175d8528ed..7ee88faaa1 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionCharactersPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionCharactersPanel.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System;
using Xwt;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Ide.CodeCompletion;
@@ -32,7 +33,7 @@ using System.Collections.Generic;
namespace MonoDevelop.SourceEditor.OptionPanels
{
- public class CompletionCharactersPanel : VBox, IOptionsPanel
+ class CompletionCharactersPanel : VBox, IOptionsPanel
{
ListView list;
ListStore store;
@@ -87,7 +88,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
}
}
- Gtk.Widget IOptionsPanel.CreatePanelWidget ()
+ Control IOptionsPanel.CreatePanelWidget ()
{
return (Gtk.Widget)Xwt.Toolkit.CurrentEngine.GetNativeWidget (this);
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionOptionsPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionOptionsPanel.cs
index 5586c8edf8..86d2a271bc 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionOptionsPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionOptionsPanel.cs
@@ -24,8 +24,12 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Ide.Editor.Extension;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide;
namespace MonoDevelop.SourceEditor.OptionPanels
{
@@ -53,16 +57,16 @@ namespace MonoDevelop.SourceEditor.OptionPanels
{
}
- Gtk.Widget IOptionsPanel.CreatePanelWidget ()
+ Control IOptionsPanel.CreatePanelWidget ()
{
autoCodeCompletionCheckbutton.Active = DefaultSourceEditorOptions.Instance.EnableAutoCodeCompletion;
- showImportsCheckbutton.Active = CompletionTextEditorExtension.AddImportedItemsToCompletionList;
- includeKeywordsCheckbutton.Active = CompletionTextEditorExtension.IncludeKeywordsInCompletionList;
- includeCodeSnippetsCheckbutton.Active = CompletionTextEditorExtension.IncludeCodeSnippetsInCompletionList;
+ showImportsCheckbutton.Active = IdeApp.Preferences.AddImportedItemsToCompletionList;
+ includeKeywordsCheckbutton.Active = IdeApp.Preferences.IncludeKeywordsInCompletionList;
+ includeCodeSnippetsCheckbutton.Active = IdeApp.Preferences.IncludeCodeSnippetsInCompletionList;
- insertParenthesesCheckbutton.Active = CompletionTextEditorExtension.AddParenthesesAfterCompletion;
- openingRadiobutton.Active = CompletionTextEditorExtension.AddOpeningOnly;
- bothRadiobutton.Active = !CompletionTextEditorExtension.AddOpeningOnly;
+ insertParenthesesCheckbutton.Active = IdeApp.Preferences.AddParenthesesAfterCompletion;
+ openingRadiobutton.Active = IdeApp.Preferences.AddOpeningOnly;
+ bothRadiobutton.Active = !IdeApp.Preferences.AddOpeningOnly;
InsertParensToggled (this, EventArgs.Empty);
AutomaticCompletionToggled (this, EventArgs.Empty);
@@ -87,12 +91,12 @@ namespace MonoDevelop.SourceEditor.OptionPanels
void IOptionsPanel.ApplyChanges ()
{
DefaultSourceEditorOptions.Instance.EnableAutoCodeCompletion = autoCodeCompletionCheckbutton.Active;
- CompletionTextEditorExtension.AddImportedItemsToCompletionList.Value = showImportsCheckbutton.Active;
- CompletionTextEditorExtension.IncludeKeywordsInCompletionList.Value = includeKeywordsCheckbutton.Active;
- CompletionTextEditorExtension.IncludeCodeSnippetsInCompletionList.Value = includeCodeSnippetsCheckbutton.Active;
+ IdeApp.Preferences.AddImportedItemsToCompletionList.Value = showImportsCheckbutton.Active;
+ IdeApp.Preferences.IncludeKeywordsInCompletionList.Value = includeKeywordsCheckbutton.Active;
+ IdeApp.Preferences.IncludeCodeSnippetsInCompletionList.Value = includeCodeSnippetsCheckbutton.Active;
- CompletionTextEditorExtension.AddParenthesesAfterCompletion.Value = insertParenthesesCheckbutton.Active;
- CompletionTextEditorExtension.AddOpeningOnly.Value = openingRadiobutton.Active;
+ IdeApp.Preferences.AddParenthesesAfterCompletion.Value = insertParenthesesCheckbutton.Active;
+ IdeApp.Preferences.AddOpeningOnly.Value = openingRadiobutton.Active;
}
#endregion
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs
index 17a3c6a6cc..ef53e55e75 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/GeneralOptionsPanel.cs
@@ -25,8 +25,10 @@
using System;
using MonoDevelop.Ide.Gui.Dialogs;
+using MonoDevelop.Components;
using MonoDevelop.Core;
-using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.SourceEditor.OptionPanels
{
@@ -42,7 +44,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
this.comboboxLineEndings.Active = (int)DefaultSourceEditorOptions.Instance.LineEndingConversion;
}
- public virtual Gtk.Widget CreatePanelWidget ()
+ public virtual Control CreatePanelWidget ()
{
this.foldingCheckbutton.Active = DefaultSourceEditorOptions.Instance.ShowFoldMargin;
this.foldregionsCheckbutton.Active = DefaultSourceEditorOptions.Instance.DefaultRegionsFolding;
@@ -58,7 +60,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
{
DefaultSourceEditorOptions.Instance.DefaultRegionsFolding = this.foldregionsCheckbutton.Active;
DefaultSourceEditorOptions.Instance.DefaultCommentFolding = this.foldCommentsCheckbutton.Active;
- DefaultSourceEditorOptions.Instance.LineEndingConversion = (LineEndingConversion)this.comboboxLineEndings.Active;
+ DefaultSourceEditorOptions.Instance.LineEndingConversion = (MonoDevelop.Ide.Editor.LineEndingConversion)this.comboboxLineEndings.Active;
if (DefaultSourceEditorOptions.Instance.ShowFoldMargin != this.foldingCheckbutton.Active) {
DefaultSourceEditorOptions.Instance.ShowFoldMargin = this.foldingCheckbutton.Active;
HighlightingPanel.UpdateActiveDocument ();
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs
index 013f184cb4..26aa51f03f 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs
@@ -32,6 +32,8 @@ using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui.Dialogs;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Components.Extensions;
namespace MonoDevelop.SourceEditor.OptionPanels
{
@@ -57,9 +59,13 @@ namespace MonoDevelop.SourceEditor.OptionPanels
col.SetAttributes (crtext, "markup", 0);
styleTreeview.AppendColumn (col);
styleTreeview.Model = styleStore;
- // ensure that custom styles are loaded.
- new SourceEditorDisplayBinding ();
schemeName = DefaultSourceEditorOptions.Instance.ColorScheme;
+ MonoDevelop.Ide.Gui.Styles.Changed += HandleSkinChanged;
+ }
+
+ void HandleSkinChanged (object sender, EventArgs e)
+ {
+ ShowStyles ();
}
protected override void OnDestroyed ()
@@ -70,6 +76,8 @@ namespace MonoDevelop.SourceEditor.OptionPanels
styleStore.Dispose ();
styleStore = null;
}
+
+ MonoDevelop.Ide.Gui.Styles.Changed -= HandleSkinChanged;
base.OnDestroyed ();
}
@@ -78,7 +86,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
return String.Format ("<b>{0}</b> - {1}", GLib.Markup.EscapeText (name), GLib.Markup.EscapeText (description));
}
- public virtual Gtk.Widget CreatePanelWidget ()
+ public virtual Control CreatePanelWidget ()
{
this.addButton.Clicked += AddColorScheme;
this.removeButton.Clicked += RemoveColorScheme;
@@ -142,6 +150,21 @@ namespace MonoDevelop.SourceEditor.OptionPanels
try {
error = false;
return Mono.TextEditor.Highlighting.SyntaxModeService.GetColorStyle (styleName);
+ } catch (StyleImportException e) {
+ error = true;
+
+ var style = Mono.TextEditor.Highlighting.SyntaxModeService.DefaultColorStyle.Clone ();
+ style.Name = styleName;
+ switch (e.Reason) {
+ case StyleImportException.ImportFailReason.NoValidColorsFound:
+ style.Description = GettextCatalog.GetString ("No valid colors found inside the settings. (Maybe only theme is defined - check <FontsAndColors> node?)");
+ break;
+ default:
+ style.Description = GettextCatalog.GetString ("Loading error");
+ break;
+ }
+ style.FileName = Mono.TextEditor.Highlighting.SyntaxModeService.GetFileName (styleName);
+ return style;
} catch (Exception e) {
LoggingService.LogError ("Error while loading color style " + styleName, e);
error = true;
@@ -158,9 +181,10 @@ namespace MonoDevelop.SourceEditor.OptionPanels
{
styleStore.Clear ();
bool error;
- TreeIter selectedIter = styleStore.AppendValues (GetMarkup (GettextCatalog.GetString ("Default"), GettextCatalog.GetString ("The default color scheme.")), LoadStyle ("Default", out error));
+ var defaultStyle = LoadStyle (MonoDevelop.Ide.Editor.Highlighting.ColorScheme.DefaultColorStyle, out error);
+ TreeIter selectedIter = styleStore.AppendValues (GetMarkup (defaultStyle.Name, defaultStyle.Description), defaultStyle);
foreach (string styleName in Mono.TextEditor.Highlighting.SyntaxModeService.Styles) {
- if (styleName == "Default")
+ if (styleName == MonoDevelop.Ide.Editor.Highlighting.ColorScheme.DefaultColorStyle)
continue;
var style = LoadStyle (styleName, out error);
string name = style.Name ?? "";
@@ -178,7 +202,8 @@ namespace MonoDevelop.SourceEditor.OptionPanels
if (style.Name == DefaultSourceEditorOptions.Instance.ColorScheme)
selectedIter = iter;
}
- styleTreeview.Selection.SelectIter (selectedIter);
+ if (styleTreeview.Selection != null)
+ styleTreeview.Selection.SelectIter (selectedIter);
}
void RemoveColorScheme (object sender, EventArgs args)
@@ -189,8 +214,8 @@ namespace MonoDevelop.SourceEditor.OptionPanels
var sheme = (ColorScheme)this.styleStore.GetValue (selectedIter, 1);
string fileName = sheme.FileName;
-
- if (fileName != null && fileName.StartsWith (SourceEditorDisplayBinding.SyntaxModePath, StringComparison.Ordinal)) {
+
+ if (fileName != null && fileName.StartsWith (MonoDevelop.Ide.Editor.TextEditorDisplayBinding.SyntaxModePath, StringComparison.Ordinal)) {
Mono.TextEditor.Highlighting.SyntaxModeService.Remove (sheme);
File.Delete (fileName);
ShowStyles ();
@@ -226,17 +251,24 @@ namespace MonoDevelop.SourceEditor.OptionPanels
if (!dialog.Run ())
return;
- string newFileName = SourceEditorDisplayBinding.SyntaxModePath.Combine (dialog.SelectedFile.FileName);
+ string newFileName = MonoDevelop.Ide.Editor.TextEditorDisplayBinding.SyntaxModePath.Combine (dialog.SelectedFile.FileName);
bool success = true;
try {
+ if (File.Exists (newFileName)) {
+ MessageService.ShowError (string.Format (GettextCatalog.GetString ("Highlighting with the same name already exists. Remove {0} first."), System.IO.Path.GetFileNameWithoutExtension (newFileName)));
+ return;
+ }
+
File.Copy (dialog.SelectedFile.FullPath, newFileName);
} catch (Exception e) {
success = false;
LoggingService.LogError ("Can't copy syntax mode file.", e);
}
if (success) {
- SourceEditorDisplayBinding.LoadCustomStylesAndModes ();
+ Mono.TextEditor.Highlighting.SyntaxModeService.LoadStylesAndModes (TextEditorDisplayBinding.SyntaxModePath);
+ MonoDevelop.Ide.Editor.Highlighting.SyntaxModeService.LoadStylesAndModes (TextEditorDisplayBinding.SyntaxModePath);
+ MonoDevelop.Ide.Editor.TextEditorDisplayBinding.LoadCustomStylesAndModes ();
ShowStyles ();
}
}
@@ -249,11 +281,11 @@ namespace MonoDevelop.SourceEditor.OptionPanels
{
if (IdeApp.Workbench.ActiveDocument != null) {
IdeApp.Workbench.ActiveDocument.UpdateParseDocument ();
- var editor = IdeApp.Workbench.ActiveDocument.Editor;
- if (editor != null) {
- editor.Parent.TextViewMargin.PurgeLayoutCache ();
- editor.Parent.QueueDraw ();
- }
+// var editor = IdeApp.Workbench.ActiveDocument.Editor;
+// if (editor != null) {
+// editor.Parent.TextViewMargin.PurgeLayoutCache ();
+// editor.Parent.QueueDraw ();
+// }
}
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs
index f983b9f003..3307f2c390 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/MarkerPanel.cs
@@ -25,8 +25,9 @@
using System;
using MonoDevelop.Ide.Gui.Dialogs;
+using MonoDevelop.Components;
using MonoDevelop.Core;
-using Mono.TextEditor;
+using MonoDevelop.Ide.Editor;
using MonoDevelop.Ide;
namespace MonoDevelop.SourceEditor.OptionPanels
@@ -60,9 +61,20 @@ namespace MonoDevelop.SourceEditor.OptionPanels
public MarkerPanel()
{
this.Build();
+ showLineNumbers = DefaultSourceEditorOptions.Instance.ShowLineNumberMargin;
+ underlineErrors = DefaultSourceEditorOptions.Instance.UnderlineErrors;
+ highlightMatchingBracket = DefaultSourceEditorOptions.Instance.HighlightMatchingBracket;
+ highlightCurrentLine = DefaultSourceEditorOptions.Instance.HighlightCaretLine;
+ showRuler = DefaultSourceEditorOptions.Instance.ShowRuler;
+ enableAnimation = DefaultSourceEditorOptions.Instance.EnableAnimations;
+ enableHighlightUsages = DefaultSourceEditorOptions.Instance.EnableHighlightUsages;
+ drawIndentMarkers = DefaultSourceEditorOptions.Instance.DrawIndentationMarkers;
+ showWhitespaces = DefaultSourceEditorOptions.Instance.ShowWhitespaces;
+ includeWhitespaces = DefaultSourceEditorOptions.Instance.IncludeWhitespaces;
+ enableQuickDiff = DefaultSourceEditorOptions.Instance.EnableQuickDiff;
}
- public virtual Gtk.Widget CreatePanelWidget ()
+ public virtual Control CreatePanelWidget ()
{
this.showLineNumbersCheckbutton.Active = showLineNumbers = DefaultSourceEditorOptions.Instance.ShowLineNumberMargin;
this.showLineNumbersCheckbutton.Toggled += delegate {
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/NewColorShemeDialog.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/NewColorShemeDialog.cs
index f4b3975f73..defcb3df86 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/NewColorShemeDialog.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/NewColorShemeDialog.cs
@@ -68,7 +68,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
style.Name = this.entryName.Text;
style.Description = this.entryDescription.Text;
style.BaseScheme = name;
- string path = SourceEditorDisplayBinding.SyntaxModePath;
+ string path = MonoDevelop.Ide.Editor.TextEditorDisplayBinding.SyntaxModePath;
string baseName = style.Name.Replace (" ", "_");
while (File.Exists (System.IO.Path.Combine (path, baseName + "Style.json"))) {
@@ -79,6 +79,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
style.Save (fileName);
style.FileName = fileName;
Mono.TextEditor.Highlighting.SyntaxModeService.AddStyle (style);
+ MonoDevelop.Ide.Editor.Highlighting.SyntaxModeService.LoadStylesAndModes (Ide.Editor.TextEditorDisplayBinding.SyntaxModePath);
} catch (Exception ex) {
LoggingService.LogInternalError (ex);
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/IQuickTaskProvider.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/IQuickTaskProvider.cs
deleted file mode 100644
index 0350a92b3b..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/IQuickTaskProvider.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// IQuickTaskProvider.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-
-namespace MonoDevelop.SourceEditor.QuickTasks
-{
- public interface IQuickTaskProvider
- {
- IEnumerable<QuickTask> QuickTasks {
- get;
- }
-
- event EventHandler TasksUpdated;
- }
-}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/IUsageProvider.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/IUsageProvider.cs
deleted file mode 100644
index b3d38082fd..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/IUsageProvider.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// IUsageProvider.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-using Mono.TextEditor;
-using MonoDevelop.Ide.FindInFiles;
-
-namespace MonoDevelop.SourceEditor.QuickTasks
-{
-
- public struct Usage
- {
- public DocumentLocation Location;
- public ReferenceUsageType UsageType;
-
- public Usage (DocumentLocation location, ReferenceUsageType usageType)
- {
- this.Location = location;
- this.UsageType = usageType;
- }
- }
-
- public interface IUsageProvider
- {
- IEnumerable<Usage> Usages {
- get;
- }
-
- event EventHandler UsagesUpdated;
- }
-}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTask.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTask.cs
deleted file mode 100644
index 15bd3982ad..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTask.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// QuickTask.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using Gtk;
-using Mono.TextEditor;
-using System.Collections.Generic;
-using Gdk;
-using MonoDevelop.Core;
-using MonoDevelop.Ide;
-using MonoDevelop.Components.Commands;
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.Refactoring;
-
-namespace MonoDevelop.SourceEditor.QuickTasks
-{
-
- public class QuickTask
- {
- Lazy<string> description;
- public string Description {
- get {
- return description.Value;
- }
- }
-
- public TextLocation Location {
- get;
- private set;
- }
-
- public Severity Severity {
- get;
- private set;
- }
-
- public QuickTask (Func<string> descriptionFunc, TextLocation location, Severity severity)
- {
- this.description = new Lazy<string> (descriptionFunc);
- this.Location = location;
- this.Severity = severity;
- }
-
- public QuickTask (string description, TextLocation location, Severity severity)
- {
- this.description = new Lazy<string> (() => description);
- this.Location = location;
- this.Severity = severity;
- }
-
- public override string ToString ()
- {
- return string.Format ("[QuickTask: Description={0}, Location={1}, Severity={2}]", Description, Location, Severity);
- }
- }
-
-}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskMiniMapMode.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskMiniMapMode.cs
index c089b13afe..79fab2b7a6 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskMiniMapMode.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskMiniMapMode.cs
@@ -33,23 +33,48 @@ using MonoDevelop.Core;
using MonoDevelop.Ide;
using MonoDevelop.Components.Commands;
using ICSharpCode.NRefactory;
+using MonoDevelop.Components;
namespace MonoDevelop.SourceEditor.QuickTasks
{
- public class QuickTaskMiniMapMode : HBox
+ class QuickTaskMiniMapMode : HBox, IMapMode
{
+ Minimpap minimap;
QuickTaskOverviewMode rightMap;
+ Adjustment vadjustment;
public QuickTaskMiniMapMode (QuickTaskStrip parent)
{
- var minimap = new Minimpap (parent);
+ minimap = new Minimpap (parent);
PackStart (minimap, true, true, 0);
rightMap = new QuickTaskOverviewMode (parent);
PackStart (rightMap, true, true, 0);
+ vadjustment = parent.VAdjustment;
+
+ vadjustment.ValueChanged += RedrawOnVAdjustmentChange;
+
+ }
+
+
+ protected override void OnDestroyed ()
+ {
+ vadjustment.ValueChanged -= RedrawOnVAdjustmentChange;
+
+ base.OnDestroyed ();
+ }
+
+ void RedrawOnVAdjustmentChange (object sender, EventArgs e)
+ {
+ QueueDraw ();
+ }
+
+ public void ForceDraw ()
+ {
+ minimap.RequestRedraw ();
}
- public class Minimpap : QuickTaskOverviewMode
+ class Minimpap : QuickTaskOverviewMode
{
const double lineHeight = 2;
@@ -82,7 +107,7 @@ namespace MonoDevelop.SourceEditor.QuickTasks
}
}
- void RequestRedraw ()
+ public void RequestRedraw ()
{
RemoveRedrawTimer ();
redrawTimeout = GLib.Timeout.Add (450, delegate {
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs
index c423ff5fae..f95a7c7403 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs
@@ -26,21 +26,24 @@
using System;
using Gtk;
-using Mono.TextEditor;
using System.Collections.Generic;
using Gdk;
using MonoDevelop.Core;
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.Refactoring;
using MonoDevelop.Ide;
using System.Linq;
using MonoDevelop.Components;
using Mono.TextEditor.Theatrics;
+using MonoDevelop.Ide.Editor;
using Xwt.Drawing;
+using MonoDevelop.Ide.Editor.Extension;
+using Microsoft.CodeAnalysis;
+using Mono.TextEditor;
+using System.Threading.Tasks;
+using System.Threading;
namespace MonoDevelop.SourceEditor.QuickTasks
{
- public class QuickTaskOverviewMode : DrawingArea
+ class QuickTaskOverviewMode : DrawingArea, IMapMode
{
static Xwt.Drawing.Image searchImage = Xwt.Drawing.Image.FromResource ("issues-busy-16.png");
static Xwt.Drawing.Image okImage = Xwt.Drawing.Image.FromResource ("issues-ok-16.png");
@@ -70,26 +73,39 @@ namespace MonoDevelop.SourceEditor.QuickTasks
get {
return okImage;
}
+ }
+
+ Cairo.Color win81Slider;
+ Cairo.Color win81SliderPrelight;
+ int win81ScrollbarWidth;
+
+ protected override void OnStyleSet (Style previous_style)
+ {
+ base.OnStyleSet (previous_style);
+ if (Core.Platform.IsWindows) {
+ using (var scrollstyle = Rc.GetStyleByPaths (Settings, null, null, VScrollbar.GType)) {
+ var scrl = new VScrollbar (null);
+ scrl.Style = scrollstyle;
+ win81Slider = scrollstyle.Background (StateType.Normal).ToCairoColor ();
+ win81SliderPrelight = scrollstyle.Background (StateType.Prelight).ToCairoColor ();
+ win81ScrollbarWidth = (int)scrl.StyleGetProperty ("slider-width");
+ scrl.Destroy ();
+ }
+ }
}
- //TODO: find a way to look these up from the theme
- static readonly Cairo.Color win81Background = new Cairo.Color (240/255d, 240/255d, 240/255d);
- static readonly Cairo.Color win81Slider = new Cairo.Color (205/255d, 205/255d, 205/255d);
- static readonly Cairo.Color win81SliderPrelight = new Cairo.Color (166/255d, 166/255d, 166/255d);
- static readonly Cairo.Color win81SliderActive = new Cairo.Color (96/255d, 96/255d, 96/255d);
-
- readonly int barPadding = Platform.IsWindows? 1 : 3;
+ readonly int barPadding = MonoDevelop.Core.Platform.IsWindows ? 1 : 3;
readonly QuickTaskStrip parentStrip;
protected readonly Adjustment vadjustment;
-
+ TextViewMargin textViewMargin;
int caretLine = -1;
-
- public TextEditor TextEditor {
+
+ public Mono.TextEditor.MonoTextEditor TextEditor {
get;
private set;
}
-
+
public IEnumerable<QuickTask> AllTasks {
get {
return parentStrip.AllTasks;
@@ -101,7 +117,7 @@ namespace MonoDevelop.SourceEditor.QuickTasks
return parentStrip.AllUsages;
}
}
-
+
public QuickTaskOverviewMode (QuickTaskStrip parent)
{
this.parentStrip = parent;
@@ -113,21 +129,24 @@ namespace MonoDevelop.SourceEditor.QuickTasks
vadjustment.Changed += RedrawOnVAdjustmentChange;
parentStrip.TaskProviderUpdated += RedrawOnUpdate;
TextEditor = parent.TextEditor;
-// TextEditor.Caret.PositionChanged += CaretPositionChanged;
+ caret = TextEditor.Caret;
+ // caret.PositionChanged += CaretPositionChanged;
TextEditor.HighlightSearchPatternChanged += RedrawOnUpdate;
- TextEditor.TextViewMargin.SearchRegionsUpdated += RedrawOnUpdate;
- TextEditor.TextViewMargin.MainSearchResultChanged += RedrawOnUpdate;
- TextEditor.GetTextEditorData ().HeightTree.LineUpdateFrom += HandleLineUpdateFrom;
+ textViewMargin = TextEditor.TextViewMargin;
+ textViewMargin.SearchRegionsUpdated += RedrawOnUpdate;
+ textViewMargin.MainSearchResultChanged += RedrawOnUpdate;
+ heightTree = TextEditor.GetTextEditorData ().HeightTree;
+ heightTree.LineUpdateFrom += HandleLineUpdateFrom;
TextEditor.HighlightSearchPatternChanged += HandleHighlightSearchPatternChanged;
HasTooltip = true;
- fadeInStage.ActorStep += delegate(Actor<QuickTaskOverviewMode> actor) {
+ fadeInStage.ActorStep += delegate (Actor<QuickTaskOverviewMode> actor) {
barColorValue = actor.Percent;
return true;
};
fadeInStage.Iteration += (sender, e) => QueueDraw ();
- fadeOutStage.ActorStep += delegate(Actor<QuickTaskOverviewMode> actor) {
+ fadeOutStage.ActorStep += delegate (Actor<QuickTaskOverviewMode> actor) {
barColorValue = 1 - actor.Percent;
return true;
};
@@ -141,42 +160,76 @@ namespace MonoDevelop.SourceEditor.QuickTasks
yPositionCache.Clear ();
}
- void HandleLineUpdateFrom (object sender, HeightTree.HeightChangedEventArgs e)
+ void HandleLineUpdateFrom (object sender, Mono.TextEditor.HeightTree.HeightChangedEventArgs e)
{
yPositionCache.Clear ();
}
-
+
void CaretPositionChanged (object sender, EventArgs e)
{
- var line = TextEditor.Caret.Line;
+ var line = caret.Line;
if (caretLine != line) {
caretLine = line;
QueueDraw ();
}
}
-
+
protected override void OnDestroyed ()
{
- base.OnDestroyed ();
+ DestroyBackgroundSurface ();
+ RemoveIndicatorIdleHandler ();
+ DestroyIndicatorSwapSurface ();
+ DestroyIndicatorSurface ();
CancelFadeInTimeout ();
RemovePreviewPopupTimeout ();
DestroyPreviewWindow ();
- TextEditor.Caret.PositionChanged -= CaretPositionChanged;
+ if (caret != null) {
+ caret.PositionChanged -= CaretPositionChanged;
+ caret = null;
+ }
TextEditor.HighlightSearchPatternChanged -= HandleHighlightSearchPatternChanged;
- TextEditor.GetTextEditorData ().HeightTree.LineUpdateFrom -= HandleLineUpdateFrom;
+ if (heightTree != null) {
+ heightTree.LineUpdateFrom -= HandleLineUpdateFrom;
+ heightTree = null;
+ }
TextEditor.HighlightSearchPatternChanged -= RedrawOnUpdate;
- TextEditor.TextViewMargin.SearchRegionsUpdated -= RedrawOnUpdate;
- TextEditor.TextViewMargin.MainSearchResultChanged -= RedrawOnUpdate;
-
+ textViewMargin.SearchRegionsUpdated -= RedrawOnUpdate;
+ textViewMargin.MainSearchResultChanged -= RedrawOnUpdate;
+ textViewMargin = null;
parentStrip.TaskProviderUpdated -= RedrawOnUpdate;
-
+
vadjustment.ValueChanged -= RedrawOnVAdjustmentChange;
vadjustment.Changed -= RedrawOnVAdjustmentChange;
+ base.OnDestroyed ();
+ }
+
+ void DestroyBackgroundSurface ()
+ {
+ if (backgroundSurface != null) {
+ backgroundSurface.Dispose ();
+ backgroundSurface = null;
+ }
+ }
+
+ void DestroyIndicatorSurface ()
+ {
+ if (indicatorSurface != null) {
+ indicatorSurface.Dispose ();
+ indicatorSurface = null;
+ }
+ }
+
+ void DestroyIndicatorSwapSurface ()
+ {
+ if (swapIndicatorSurface != null) {
+ swapIndicatorSurface.Dispose ();
+ swapIndicatorSurface = null;
+ }
}
-
+
void RedrawOnUpdate (object sender, EventArgs e)
{
- QueueDraw ();
+ DrawIndicatorSurface ();
}
void RedrawOnVAdjustmentChange (object sender, EventArgs e)
@@ -190,8 +243,8 @@ namespace MonoDevelop.SourceEditor.QuickTasks
{
return y < IndicatorHeight;
}
-
- internal CodeSegmentPreviewWindow previewWindow;
+
+ internal Mono.TextEditor.CodeSegmentPreviewWindow previewWindow;
protected override bool OnMotionNotifyEvent (EventMotion evnt)
{
@@ -206,10 +259,9 @@ namespace MonoDevelop.SourceEditor.QuickTasks
const ModifierType buttonMask = ModifierType.Button1Mask | ModifierType.Button2Mask |
ModifierType.Button3Mask | ModifierType.Button4Mask | ModifierType.Button5Mask;
-
- if ((evnt.State & buttonMask & ModifierType.ShiftMask) == ModifierType.ShiftMask) {
+ if ((evnt.State & ModifierType.ShiftMask) == ModifierType.ShiftMask) {
int line = YToLine (evnt.Y);
-
+
line = Math.Max (1, line - 2);
int lastLine = Math.Min (TextEditor.LineCount, line + 5);
var start = TextEditor.GetLine (line);
@@ -217,8 +269,8 @@ namespace MonoDevelop.SourceEditor.QuickTasks
if (start == null || end == null) {
return base.OnMotionNotifyEvent (evnt);
}
- var showSegment = new TextSegment (start.Offset, end.Offset + end.Length - start.Offset);
-
+ var showSegment = new Mono.TextEditor.TextSegment (start.Offset, end.Offset + end.Length - start.Offset);
+
if (previewWindow != null) {
previewWindow.SetSegment (showSegment, false);
PositionPreviewWindow ((int)evnt.Y);
@@ -303,22 +355,22 @@ namespace MonoDevelop.SourceEditor.QuickTasks
return false;
}
- void CountTasks (out int errors, out int warnings, out int hints, out int suggestions)
+ void CountTasks (out int errors, out int warnings, out int infos, out int hidden)
{
- errors = warnings = hints = suggestions = 0;
+ errors = warnings = infos = hidden = 0;
foreach (var task in AllTasks) {
switch (task.Severity) {
- case Severity.Error:
+ case DiagnosticSeverity.Error:
errors++;
break;
- case Severity.Warning:
+ case DiagnosticSeverity.Warning:
warnings++;
break;
- case Severity.Hint:
- hints++;
+ case DiagnosticSeverity.Info:
+ infos++;
break;
- case Severity.Suggestion:
- suggestions++;
+ case DiagnosticSeverity.Hidden:
+ hidden++;
break;
}
}
@@ -328,7 +380,7 @@ namespace MonoDevelop.SourceEditor.QuickTasks
{
QuickTask hoverTask = null;
foreach (var task in AllTasks) {
- double ty = GetYPosition (task.Location.Line);
+ double ty = GetYPosition (TextEditor.OffsetToLineNumber (task.Location));
if (Math.Abs (ty - y) < 3) {
hoverTask = task;
}
@@ -343,52 +395,53 @@ namespace MonoDevelop.SourceEditor.QuickTasks
QueueDraw ();
}
}
-
- class PreviewPopup {
-
+
+ class PreviewPopup
+ {
+
QuickTaskOverviewMode strip;
- TextSegment segment;
+ Mono.TextEditor.TextSegment segment;
int w, y;
-
- public PreviewPopup (QuickTaskOverviewMode strip, TextSegment segment, int w, int y)
+
+ public PreviewPopup (QuickTaskOverviewMode strip, Mono.TextEditor.TextSegment segment, int w, int y)
{
this.strip = strip;
this.segment = segment;
this.w = w;
this.y = y;
}
-
+
public bool Run ()
{
- strip.previewWindow = new CodeSegmentPreviewWindow (strip.TextEditor, true, segment, w, -1, false);
+ strip.previewWindow = new Mono.TextEditor.CodeSegmentPreviewWindow (strip.TextEditor, true, segment, w, -1, false);
strip.previewWindow.WidthRequest = w;
strip.previewWindow.Show ();
strip.PositionPreviewWindow (y);
return false;
}
-
+
}
-
+
uint previewPopupTimeout = 0;
-
+
void PositionPreviewWindow (int my)
{
int ox, oy;
GdkWindow.GetOrigin (out ox, out oy);
-
+
Gdk.Rectangle geometry = Screen.GetMonitorGeometry (Screen.GetMonitorAtPoint (ox, oy));
-
+
var alloc = previewWindow.Allocation;
int x = ox - 4 - alloc.Width;
if (x < geometry.Left)
x = ox + parentStrip.Allocation.Width + 4;
-
+
int y = oy + my - alloc.Height / 2;
y = Math.Max (geometry.Top, Math.Min (y, geometry.Bottom));
-
+
previewWindow.Move (x, y);
}
-
+
void RemovePreviewPopupTimeout ()
{
if (previewPopupTimeout != 0) {
@@ -396,7 +449,7 @@ namespace MonoDevelop.SourceEditor.QuickTasks
previewPopupTimeout = 0;
}
}
-
+
void DestroyPreviewWindow ()
{
if (previewWindow != null) {
@@ -412,7 +465,7 @@ namespace MonoDevelop.SourceEditor.QuickTasks
{
if (fadeTimeOutHandler == 0)
return;
- GLib.Source.Remove (fadeTimeOutHandler);
+ GLib.Source.Remove (fadeTimeOutHandler);
fadeTimeOutHandler = 0;
}
@@ -451,41 +504,39 @@ namespace MonoDevelop.SourceEditor.QuickTasks
protected override bool OnLeaveNotifyEvent (EventCrossing evnt)
{
isPointerInside = false;
- if (!IsInGrab ())
+ if (!IsInGrab ())
StartFadeOutAnimation ();
RemovePreviewPopupTimeout ();
DestroyPreviewWindow ();
return base.OnLeaveNotifyEvent (evnt);
}
-
- Cairo.Color GetBarColor (Severity severity)
+
+ Cairo.Color GetBarColor (DiagnosticSeverity severity)
{
var style = this.TextEditor.ColorStyle;
if (style == null)
return new Cairo.Color (0, 0, 0);
switch (severity) {
- case Severity.Error:
+ case DiagnosticSeverity.Error:
return style.UnderlineError.Color;
- case Severity.Warning:
+ case DiagnosticSeverity.Warning:
return style.UnderlineWarning.Color;
- case Severity.Suggestion:
+ case DiagnosticSeverity.Info:
return style.UnderlineSuggestion.Color;
- case Severity.Hint:
- return style.UnderlineHint.Color;
- case Severity.None:
+ case DiagnosticSeverity.Hidden:
return style.PlainText.Background;
default:
throw new ArgumentOutOfRangeException ();
}
}
- protected virtual double IndicatorHeight {
+ protected virtual double IndicatorHeight {
get {
- return Platform.IsWindows ? Allocation.Width : 3 + 8 + 3;
+ return MonoDevelop.Core.Platform.IsWindows ? Allocation.Width : 3 + 8 + 3;
}
}
-
+
protected virtual void MovePosition (double y)
{
double position = ((y - IndicatorHeight) / (Allocation.Height - IndicatorHeight)) * vadjustment.Upper - vadjustment.PageSize / 2;
@@ -551,14 +602,11 @@ namespace MonoDevelop.SourceEditor.QuickTasks
void MoveToTask (QuickTask task)
{
- if (task.Location.IsEmpty) {
- Console.WriteLine ("empty:" + task.Description);
- }
- var loc = new DocumentLocation (
- Math.Max (DocumentLocation.MinLine, task.Location.Line),
- Math.Max (DocumentLocation.MinColumn, task.Location.Column)
- );
- TextEditor.Caret.Location = loc;
+ // var loc = new DocumentLocation (
+ // Math.Max (DocumentLocation.MinLine, task.Location.Line),
+ // Math.Max (DocumentLocation.MinColumn, task.Location.Column)
+ // );
+ caret.Offset = task.Location;
TextEditor.CenterToCaret ();
TextEditor.StartCaretPulseAnimation ();
TextEditor.GrabFocus ();
@@ -575,18 +623,17 @@ namespace MonoDevelop.SourceEditor.QuickTasks
return QuickTaskStrip.HoverMode.NextMessage;
}
- protected void DrawIndicator (Cairo.Context cr, Severity severity)
+ protected void DrawIndicator (Cairo.Context cr, DiagnosticSeverity severity)
{
Xwt.Drawing.Image image;
switch (severity) {
- case Severity.Error:
+ case DiagnosticSeverity.Error:
image = errorImage;
break;
- case Severity.Warning:
+ case DiagnosticSeverity.Warning:
image = warningImage;
break;
- case Severity.Suggestion:
- case Severity.Hint:
+ case DiagnosticSeverity.Info:
image = suggestionImage;
break;
default:
@@ -610,26 +657,26 @@ namespace MonoDevelop.SourceEditor.QuickTasks
protected override void OnSizeRequested (ref Requisition requisition)
{
base.OnSizeRequested (ref requisition);
- requisition.Width = Platform.IsWindows? 17 : 15;
+ requisition.Width = MonoDevelop.Core.Platform.IsWindows ? win81ScrollbarWidth : 15;
}
-
+
double LineToY (int logicalLine)
{
var h = Allocation.Height - IndicatorHeight;
var p = TextEditor.LocationToPoint (logicalLine, 1, true).Y;
- var q = Math.Max (TextEditor.GetTextEditorData ().TotalHeight, TextEditor.Allocation.Height)
+ var q = Math.Max (TextEditor.GetTextEditorData ().TotalHeight, TextEditor.Allocation.Height)
+ TextEditor.Allocation.Height
- TextEditor.LineHeight;
- return IndicatorHeight + h * p / q;
+ return IndicatorHeight + h * p / q;
}
-
+
int YToLine (double y)
{
var line = 0.5 + (y - IndicatorHeight) / (Allocation.Height - IndicatorHeight) * (double)(TextEditor.GetTextEditorData ().VisibleLineCount);
return TextEditor.GetTextEditorData ().VisualToLogicalLine ((int)line);
}
-
+
protected void DrawCaret (Cairo.Context cr)
{
if (TextEditor.ColorStyle == null || caretLine < 0)
@@ -653,60 +700,64 @@ namespace MonoDevelop.SourceEditor.QuickTasks
return y;
}
- protected Severity DrawQuickTasks (Cairo.Context cr)
+ protected void DrawQuickTasks (Cairo.Context cr, IEnumerator<Usage> allUsages, IEnumerator<QuickTask> allTasks, ref bool nextStep, ref DiagnosticSeverity severity, List<HashSet<int>> lineCache)
{
- Severity severity = Severity.None;
-
- foreach (var usage in AllUsages) {
- double y = GetYPosition (usage.Location.Line);
+ if (allUsages.MoveNext ()) {
+ var usage = allUsages.Current;
+ int y = (int)GetYPosition (TextEditor.OffsetToLineNumber (usage.Offset));
+ if (lineCache[0].Contains (y))
+ return;
+ lineCache[0].Add (y);
var usageColor = TextEditor.ColorStyle.PlainText.Foreground;
usageColor.A = 0.4;
HslColor color;
- if ((usage.UsageType & MonoDevelop.Ide.FindInFiles.ReferenceUsageType.Write) != 0) {
+ if ((usage.UsageType & MonoDevelop.Ide.FindInFiles.ReferenceUsageType.Declariton) != 0) {
+ color = TextEditor.ColorStyle.ChangingUsagesRectangle.Color;
+ if (color.Alpha == 0.0)
+ color = TextEditor.ColorStyle.UsagesRectangle.Color;
+ } else if ((usage.UsageType & MonoDevelop.Ide.FindInFiles.ReferenceUsageType.Write) != 0) {
color = TextEditor.ColorStyle.ChangingUsagesRectangle.Color;
- } else if ((usage.UsageType & MonoDevelop.Ide.FindInFiles.ReferenceUsageType.Read) != 0) {
+ if (color.Alpha == 0.0)
+ color = TextEditor.ColorStyle.UsagesRectangle.Color;
+ } else if ((usage.UsageType & MonoDevelop.Ide.FindInFiles.ReferenceUsageType.Read) != 0 || (usage.UsageType & MonoDevelop.Ide.FindInFiles.ReferenceUsageType.Keyword) != 0) {
color = TextEditor.ColorStyle.UsagesRectangle.Color;
} else {
color = usageColor;
}
color.L = 0.5;
- cr.Color = color;
+ cr.SetSourceColor (color);
cr.MoveTo (0, y - 3);
cr.LineTo (5, y);
cr.LineTo (0, y + 3);
cr.LineTo (0, y - 3);
cr.ClosePath ();
cr.Fill ();
- }
-
- foreach (var task in AllTasks) {
- double y = GetYPosition (task.Location.Line);
-
- cr.SetSourceColor (GetBarColor (task.Severity));
- cr.Rectangle (0, Math.Round (y) - 1, Allocation.Width, 2);
- cr.Fill ();
-
- switch (task.Severity) {
- case Severity.Error:
- severity = Severity.Error;
- break;
- case Severity.Warning:
- if (severity == Severity.None)
- severity = Severity.Warning;
- break;
+ } else if (allTasks.MoveNext ()) {
+ var task = allTasks.Current;
+ int y = (int)GetYPosition (TextEditor.OffsetToLineNumber (task.Location));
+ if (!lineCache[1].Contains (y)) {
+ lineCache[1].Add (y);
+ cr.SetSourceColor (GetBarColor (task.Severity));
+ cr.Rectangle (1, y - 1, Allocation.Width - 1, 2);
+ cr.Fill ();
}
+ if (task.Severity == DiagnosticSeverity.Error)
+ severity = DiagnosticSeverity.Error;
+ else if (task.Severity == DiagnosticSeverity.Warning && severity != DiagnosticSeverity.Error)
+ severity = DiagnosticSeverity.Warning;
+ } else {
+ nextStep = true;
}
- return severity;
}
-
+
protected void DrawLeftBorder (Cairo.Context cr)
{
cr.MoveTo (0.5, 0);
cr.LineTo (0.5, Allocation.Height);
if (TextEditor.ColorStyle != null) {
var col = TextEditor.ColorStyle.PlainText.Background.ToXwtColor ();
- if (!Platform.IsWindows) {
- col.Light *= 0.88;
+ if (!MonoDevelop.Core.Platform.IsWindows) {
+ col.Light *= 0.95;
}
cr.SetSourceColor (col.ToCairoColor ());
}
@@ -717,34 +768,36 @@ namespace MonoDevelop.SourceEditor.QuickTasks
{
yPositionCache.Clear ();
base.OnSizeAllocated (allocation);
+ DrawIndicatorSurface (0);
}
void GetBarDimensions (out double x, out double y, out double w, out double h)
{
var alloc = Allocation;
- x = Platform.IsWindows ? 0 : 1 + barPadding;
+ x = MonoDevelop.Core.Platform.IsWindows ? 0 : 1 + barPadding;
var adjUpper = vadjustment.Upper;
- var allocH = alloc.Height - (int) IndicatorHeight;
+ var allocH = alloc.Height - (int)IndicatorHeight;
y = IndicatorHeight + Math.Round (allocH * vadjustment.Value / adjUpper);
- w = Platform.IsWindows ? alloc.Width : 8;
+ w = MonoDevelop.Core.Platform.IsWindows ? alloc.Width : 8;
const int minBarHeight = 16;
h = Math.Max (minBarHeight, Math.Round (allocH * (vadjustment.PageSize / adjUpper)) - barPadding - barPadding);
}
double barColorValue = 0.0;
const double barAlphaMax = 0.5;
const double barAlphaMin = 0.22;
-
+ Caret caret;
+ HeightTree heightTree;
protected virtual void DrawBar (Cairo.Context cr)
{
- if (vadjustment == null || vadjustment.Upper <= vadjustment.PageSize)
+ if (vadjustment == null || vadjustment.Upper <= vadjustment.PageSize)
return;
double x, y, w, h;
GetBarDimensions (out x, out y, out w, out h);
- if (Platform.IsWindows) {
+ if (MonoDevelop.Core.Platform.IsWindows) {
cr.Rectangle (x, y, w, h);
} else {
MonoDevelop.Components.CairoExtensions.RoundedRectangle (cr, x, y, w, h, 4);
@@ -753,12 +806,12 @@ namespace MonoDevelop.SourceEditor.QuickTasks
bool prelight = State == StateType.Prelight;
Cairo.Color c;
- if (Platform.IsWindows) {
+ if (MonoDevelop.Core.Platform.IsWindows) {
c = prelight ? win81SliderPrelight : win81Slider;
//compute new color such that it will produce same color when blended with bg
- c = AddAlpha (win81Background, c, 0.5d);
+ c = AddAlpha (TextEditor.ColorStyle.PlainText.Background, c, 0.5d);
} else {
- var brightness = HslColor.Brightness (TextEditor.ColorStyle.PlainText.Background);
+ var brightness = HslColor.Brightness (TextEditor.ColorStyle.PlainText.Background);
c = new Cairo.Color (1 - brightness, 1 - brightness, 1 - brightness, barColorValue * (barAlphaMax - barAlphaMin) + barAlphaMin);
}
cr.SetSourceColor (c);
@@ -780,75 +833,241 @@ namespace MonoDevelop.SourceEditor.QuickTasks
return (c0 * a0 - cb * ab * (1 - aa)) / aa;
}
- protected void DrawSearchResults (Cairo.Context cr)
+
+ protected void DrawSearchResults (Cairo.Context cr, IEnumerator<TextSegment> searchResults, ref bool nextStep)
{
- foreach (var region in TextEditor.TextViewMargin.SearchResults) {
- int line = TextEditor.OffsetToLineNumber (region.Offset);
- double y = GetYPosition (line);
- bool isMainSelection = false;
- if (!TextEditor.TextViewMargin.MainSearchResult.IsInvalid)
- isMainSelection = region.Offset == TextEditor.TextViewMargin.MainSearchResult.Offset;
- cr.SetSourceColor (isMainSelection ? TextEditor.ColorStyle.SearchResultMain.Color : TextEditor.ColorStyle.SearchResult.Color);
- cr.Rectangle (barPadding, Math.Round (y) - 1, Allocation.Width - barPadding * 2, 2);
- cr.Fill ();
+ if (!searchResults.MoveNext ()) {
+ nextStep = true;
+ return;
}
+ var region = searchResults.Current;
+ int line = TextEditor.OffsetToLineNumber (region.Offset);
+ double y = GetYPosition (line);
+ bool isMainSelection = false;
+ if (!TextEditor.TextViewMargin.MainSearchResult.IsInvalid)
+ isMainSelection = region.Offset == TextEditor.TextViewMargin.MainSearchResult.Offset;
+ cr.SetSourceColor (isMainSelection ? TextEditor.ColorStyle.SearchResultMain.Color : TextEditor.ColorStyle.SearchResult.Color);
+ cr.Rectangle (barPadding, Math.Round (y) - 1, Allocation.Width - barPadding * 2, 2);
+ cr.Fill ();
}
-
+
+ SurfaceWrapper backgroundSurface, indicatorSurface, swapIndicatorSurface;
protected override bool OnExposeEvent (Gdk.EventExpose e)
{
if (TextEditor == null)
return true;
+
using (Cairo.Context cr = Gdk.CairoHelper.Create (e.Window)) {
- cr.LineWidth = 1;
- cr.Rectangle (0, 0, Allocation.Width, Allocation.Height);
-
- if (TextEditor.ColorStyle != null) {
- if (Platform.IsWindows) {
- using (var pattern = new Cairo.SolidPattern (win81Background)) {
- cr.SetSource (pattern);
- }
- } else {
- var col = TextEditor.ColorStyle.PlainText.Background.ToXwtColor();
- col.Light *= 0.948;
- using (var grad = new Cairo.LinearGradient (0, 0, Allocation.Width, 0)) {
- grad.AddColorStop (0, col.ToCairoColor ());
- grad.AddColorStop (0.7, TextEditor.ColorStyle.PlainText.Background);
- grad.AddColorStop (1, col.ToCairoColor ());
- cr.SetSource (grad);
- }
- /*
- var col = new Cairo.Color (229 / 255.0, 229 / 255.0, 229 / 255.0);
- using (var grad = new Cairo.LinearGradient (0, 0, Allocation.Width, 0)) {
- grad.AddColorStop (0, col);
- grad.AddColorStop (0.5, new Cairo.Color (1, 1, 1));
- grad.AddColorStop (1, col);
- cr.SetSource (grad);
- }*/
- }
+ var allocation = Allocation;
+ if (indicatorSurface != null) {
+ cr.SetSourceSurface (indicatorSurface.Surface, 0, 0);
+ cr.Paint ();
+ } else {
+ CachedDraw (cr,
+ ref backgroundSurface,
+ allocation,
+ draw: (c, o) => DrawBackground (c, allocation));
}
- cr.Fill ();
-
if (TextEditor == null)
return true;
-
- if (TextEditor.HighlightSearchPattern) {
- DrawSearchResults (cr);
- DrawSearchIndicator (cr);
- } else {
- if (!Debugger.DebuggingService.IsDebugging) {
- var severity = DrawQuickTasks (cr);
- DrawIndicator (cr, severity);
- }
- }
+
DrawCaret (cr);
if (QuickTaskStrip.MergeScrollBarAndQuickTasks)
DrawBar (cr);
- DrawLeftBorder (cr);
}
-
+
return true;
}
+
+ CancellationTokenSource src = new CancellationTokenSource ();
+
+ class IdleUpdater
+ {
+ readonly QuickTaskOverviewMode mode;
+ readonly CancellationToken token;
+ SurfaceWrapper surface;
+ Cairo.Context cr;
+ Gdk.Rectangle allocation;
+
+ public IdleUpdater (QuickTaskOverviewMode mode, System.Threading.CancellationToken token)
+ {
+ this.mode = mode;
+ this.token = token;
+ }
+
+ public void Start ()
+ {
+ allocation = mode.Allocation;
+ var swapSurface = mode.swapIndicatorSurface;
+ if (swapSurface != null) {
+ if (swapSurface.Width == allocation.Width && swapSurface.Height == allocation.Height) {
+ surface = swapSurface;
+ } else {
+ mode.DestroyIndicatorSwapSurface ();
+ }
+ }
+
+ if (surface == null) {
+ using (var similiar = CairoHelper.Create (IdeApp.Workbench.RootWindow.GdkWindow))
+ surface = new SurfaceWrapper (similiar, allocation.Width, allocation.Height);
+ }
+
+ searchResults = mode.TextEditor.TextViewMargin.SearchResults.ToList().GetEnumerator ();
+ allUsages = mode.AllUsages.GetEnumerator ();
+ allTasks = mode.AllTasks.GetEnumerator ();
+ cr = new Cairo.Context (surface.Surface);
+ GLib.Idle.Add (RunHandler);
+ }
+
+ int drawingStep;
+ DiagnosticSeverity severity = DiagnosticSeverity.Hidden;
+ IEnumerator<TextSegment> searchResults;
+ IEnumerator<Usage> allUsages;
+ IEnumerator<QuickTask> allTasks;
+
+ bool RunHandler ()
+ {
+ tokenExit:
+ if (token.IsCancellationRequested || mode.TextEditor.GetTextEditorData () == null) {
+ cr.Dispose ();
+ // if the surface was newly created dispose it otherwise it'll leak.
+ if (surface != mode.swapIndicatorSurface)
+ surface.Dispose ();
+ return false;
+ }
+ var lineCache = new List<HashSet<int>> ();
+ lineCache.Add (new HashSet<int> ());
+ lineCache.Add (new HashSet<int> ());
+ bool nextStep = false;
+ switch (drawingStep) {
+ case 0:
+ CachedDraw (cr, ref mode.backgroundSurface, allocation, draw: (c, o) => mode.DrawBackground (c, allocation));
+ drawingStep++;
+ return true;
+ case 1:
+ for (int i = 0; i < 10 && !nextStep; i++) {
+ if (token.IsCancellationRequested)
+ goto tokenExit;
+ if (mode.TextEditor.HighlightSearchPattern) {
+ mode.DrawSearchResults (cr, searchResults, ref nextStep);
+ } else {
+ if (!Debugger.DebuggingService.IsDebugging) {
+ mode.DrawQuickTasks (cr, allUsages, allTasks, ref nextStep, ref severity, lineCache);
+ } else {
+ nextStep = true;
+ }
+ }
+ }
+ if (nextStep)
+ drawingStep++;
+ return true;
+ case 2:
+ if (mode.TextEditor.HighlightSearchPattern) {
+ mode.DrawSearchIndicator (cr);
+ } else {
+ if (!Debugger.DebuggingService.IsDebugging) {
+ mode.DrawIndicator (cr, severity);
+ }
+ }
+ drawingStep++;
+ return true;
+ default:
+ cr.Dispose ();
+ var tmp = mode.indicatorSurface;
+ mode.indicatorSurface = surface;
+ mode.swapIndicatorSurface = tmp;
+ mode.QueueDraw ();
+
+ return false;
+ }
+ }
+ }
+
+ uint indicatorIdleTimout;
+ void DrawIndicatorSurface(uint timeout = 250)
+ {
+ RemoveIndicatorIdleHandler ();
+ GLib.TimeoutHandler timeoutHandler = delegate {
+ indicatorIdleTimout = 0;
+ if (!IsRealized)
+ return false;
+ var allocation = Allocation;
+ src.Cancel ();
+ src = new CancellationTokenSource ();
+ new IdleUpdater (this, src.Token).Start ();
+ return false;
+ };
+ if (timeout == 0) {
+ timeoutHandler ();
+ } else {
+ indicatorIdleTimout = GLib.Timeout.Add (timeout, timeoutHandler);
+ }
+ }
+
+ void RemoveIndicatorIdleHandler ()
+ {
+ if (indicatorIdleTimout > 0) {
+ GLib.Source.Remove (indicatorIdleTimout);
+ indicatorIdleTimout = 0;
+ }
+ }
+
+ /// TODO: CairoExtensions.CachedDraw seems not to work correctly for me.
+ public static void CachedDraw (Cairo.Context self, ref SurfaceWrapper surface, Gdk.Rectangle region, object parameters = null, float opacity = 1.0f, Action<Cairo.Context, float> draw = null, double? forceScale = null)
+ {
+ double displayScale = forceScale.HasValue ? forceScale.Value : QuartzSurface.GetRetinaScale (self);
+ int targetWidth = (int) (region.Width * displayScale);
+ int targetHeight = (int) (region.Height * displayScale);
+
+ bool redraw = false;
+ if (surface == null || surface.Width != targetWidth || surface.Height != targetHeight) {
+ if (surface != null)
+ surface.Dispose ();
+ surface = new SurfaceWrapper (self, targetWidth, targetHeight);
+ redraw = true;
+ } else if ((surface.Data == null && parameters != null) || (surface.Data != null && !surface.Data.Equals (parameters))) {
+ redraw = true;
+ }
+
+
+ if (redraw) {
+ surface.Data = parameters;
+ using (var context = new Cairo.Context (surface.Surface)) {
+ draw(context, 1.0f);
+ }
+ }
+
+ self.SetSourceSurface (surface.Surface, 0, 0);
+ self.Paint ();
+ }
+
+ void DrawBackground (Cairo.Context cr, Gdk.Rectangle allocation)
+ {
+ cr.LineWidth = 1;
+ cr.Rectangle (0, 0, allocation.Width, allocation.Height);
+
+ if (TextEditor.ColorStyle != null) {
+ if (MonoDevelop.Core.Platform.IsWindows) {
+ using (var pattern = new Cairo.SolidPattern (TextEditor.ColorStyle.PlainText.Background)) {
+ cr.SetSource (pattern);
+ cr.Fill ();
+ }
+ } else {
+ cr.SetSourceColor (TextEditor.ColorStyle.PlainText.Background);
+ cr.Fill ();
+ }
+ }
+ DrawLeftBorder (cr);
+ }
+
+ public void ForceDraw ()
+ {
+ DestroyBackgroundSurface ();
+ DestroyIndicatorSwapSurface ();
+ DestroyIndicatorSurface ();
+
+ DrawIndicatorSurface (0);
+ }
}
-
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskStrip.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskStrip.cs
index 052f69f046..c750bf49d0 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskStrip.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskStrip.cs
@@ -35,14 +35,21 @@ using MonoDevelop.Components.Commands;
using ICSharpCode.NRefactory;
using System.Linq;
using ICSharpCode.NRefactory.Refactoring;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Extension;
+using Microsoft.CodeAnalysis;
+using System.Collections.Immutable;
namespace MonoDevelop.SourceEditor.QuickTasks
{
- public class QuickTaskStrip : VBox
+ interface IMapMode
{
- // move that one to AnalysisOptions when the new features are enabled by default.
- public readonly static PropertyWrapper<bool> EnableFancyFeatures = new PropertyWrapper<bool> ("MonoDevelop.AnalysisCore.AnalysisEnabled", false);
- public readonly static bool MergeScrollBarAndQuickTasks = !Platform.IsMac;
+ void ForceDraw ();
+ }
+ class QuickTaskStrip : VBox
+ {
+ public readonly static ConfigurationProperty<bool> EnableFancyFeatures = IdeApp.Preferences.EnableSourceAnalysis;
+ public readonly static bool MergeScrollBarAndQuickTasks = !MonoDevelop.Core.Platform.IsMac;
static QuickTaskStrip ()
{
@@ -61,15 +68,18 @@ namespace MonoDevelop.SourceEditor.QuickTasks
}
}
- Mono.TextEditor.TextEditor textEditor;
- public TextEditor TextEditor {
+ Mono.TextEditor.MonoTextEditor textEditor;
+ public Mono.TextEditor.MonoTextEditor TextEditor {
get {
return textEditor;
}
set {
if (value == null)
throw new ArgumentNullException ();
+ if (textEditor != null)
+ textEditor.EditorOptionsChanged -= TextEditor_EditorOptionsChanged;
textEditor = value;
+ textEditor.EditorOptionsChanged += TextEditor_EditorOptionsChanged;
SetupMode ();
}
}
@@ -86,8 +96,8 @@ namespace MonoDevelop.SourceEditor.QuickTasks
}
}
- Dictionary<IQuickTaskProvider, List<QuickTask>> providerTasks = new Dictionary<IQuickTaskProvider, List<QuickTask>> ();
- Dictionary<IUsageProvider, List<Usage>> providerUsages = new Dictionary<IUsageProvider, List<Usage>> ();
+ ImmutableDictionary<IQuickTaskProvider, ImmutableArray<QuickTask>> providerTasks = ImmutableDictionary<IQuickTaskProvider, ImmutableArray<QuickTask>>.Empty;
+ ImmutableDictionary<UsageProviderEditorExtension, ImmutableArray<Usage>> providerUsages = ImmutableDictionary<UsageProviderEditorExtension, ImmutableArray<Usage>>.Empty;
public IEnumerable<QuickTask> AllTasks {
get {
@@ -154,12 +164,14 @@ namespace MonoDevelop.SourceEditor.QuickTasks
protected override void OnDestroyed ()
{
- base.OnDestroyed ();
adj = null;
+ if (textEditor != null)
+ textEditor.EditorOptionsChanged -= TextEditor_EditorOptionsChanged;
textEditor = null;
providerTasks = null;
PropertyService.RemovePropertyHandler ("ScrollBar.Mode", ScrollBarModeChanged);
EnableFancyFeatures.Changed -= HandleChanged;
+ base.OnDestroyed ();
}
void ScrollBarModeChanged (object sender, PropertyChangedEventArgs args)
@@ -172,15 +184,15 @@ namespace MonoDevelop.SourceEditor.QuickTasks
{
if (providerTasks == null)
return;
- providerTasks [provider] = new List<QuickTask> (provider.QuickTasks);
+ providerTasks = providerTasks.SetItem (provider, provider.QuickTasks);
OnTaskProviderUpdated (EventArgs.Empty);
}
- public void Update (IUsageProvider provider)
+ public void Update (UsageProviderEditorExtension provider)
{
if (providerTasks == null)
return;
- providerUsages [provider] = new List<Usage> (provider.Usages);
+ providerUsages = providerUsages.SetItem (provider, provider.Usages);
OnTaskProviderUpdated (EventArgs.Empty);
}
@@ -196,11 +208,17 @@ namespace MonoDevelop.SourceEditor.QuickTasks
protected override bool OnButtonPressEvent (EventButton evnt)
{
if (evnt.Button == 3) {
- IdeApp.CommandService.ShowContextMenu (this, evnt, "/MonoDevelop/SourceEditor2/ContextMenu/Scrollbar");
+ IdeApp.CommandService.ShowContextMenu (this, evnt, IdeApp.CommandService.CreateCommandEntrySet ("/MonoDevelop/SourceEditor2/ContextMenu/Scrollbar"), this);
}
return base.OnButtonPressEvent (evnt);
}
-
+
+ void TextEditor_EditorOptionsChanged (object sender, EventArgs e)
+ {
+ (mapMode as IMapMode)?.ForceDraw ();
+ QueueDraw ();
+ }
+
#region Command handlers
[CommandHandler (ScrollbarCommand.Top)]
internal void GotoTop ()
@@ -255,13 +273,13 @@ namespace MonoDevelop.SourceEditor.QuickTasks
internal enum HoverMode { NextMessage, NextWarning, NextError }
internal QuickTask SearchNextTask (HoverMode mode)
{
- var curLoc = (TextLocation)TextEditor.Caret.Location;
+ var curLoc = TextEditor.Caret.Offset;
QuickTask firstTask = null;
foreach (var task in AllTasks.OrderBy (t => t.Location) ) {
bool isNextTask = task.Location > curLoc;
if (mode == HoverMode.NextMessage ||
- mode == HoverMode.NextWarning && task.Severity == Severity.Warning ||
- mode == HoverMode.NextError && task.Severity == Severity.Error) {
+ mode == HoverMode.NextWarning && task.Severity == DiagnosticSeverity.Warning ||
+ mode == HoverMode.NextError && task.Severity == DiagnosticSeverity.Error) {
if (isNextTask)
return task;
if (firstTask == null)
@@ -273,13 +291,13 @@ namespace MonoDevelop.SourceEditor.QuickTasks
internal QuickTask SearchPrevTask (HoverMode mode)
{
- var curLoc = (TextLocation)TextEditor.Caret.Location;
+ var curLoc = TextEditor.Caret.Offset;
QuickTask firstTask = null;
foreach (var task in AllTasks.OrderByDescending (t => t.Location) ) {
bool isNextTask = task.Location < curLoc;
if (mode == HoverMode.NextMessage ||
- mode == HoverMode.NextWarning && task.Severity == Severity.Warning ||
- mode == HoverMode.NextError && task.Severity == Severity.Error) {
+ mode == HoverMode.NextWarning && task.Severity == DiagnosticSeverity.Warning ||
+ mode == HoverMode.NextError && task.Severity == DiagnosticSeverity.Error) {
if (isNextTask)
return task;
if (firstTask == null)
@@ -293,10 +311,7 @@ namespace MonoDevelop.SourceEditor.QuickTasks
{
if (quickTask == null)
return;
- var line = quickTask.Location.Line;
- if (line < 1 || line >= TextEditor.LineCount)
- return;
- TextEditor.Caret.Location = new TextLocation (line, Math.Max (1, quickTask.Location.Column));
+ TextEditor.Caret.Offset = quickTask.Location;
TextEditor.CenterToCaret ();
TextEditor.StartCaretPulseAnimation ();
TextEditor.GrabFocus ();
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/DocumentLineWrapper.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/DocumentLineWrapper.cs
new file mode 100644
index 0000000000..d3b7c7e3b2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/DocumentLineWrapper.cs
@@ -0,0 +1,131 @@
+//
+// DocumentLineWrapper.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.SourceEditor.Wrappers
+{
+ class DocumentLineWrapper : MonoDevelop.Ide.Editor.IDocumentLine
+ {
+ public Mono.TextEditor.DocumentLine Line {
+ get;
+ private set;
+ }
+
+ public DocumentLineWrapper (Mono.TextEditor.DocumentLine line)
+ {
+ if (line == null)
+ throw new ArgumentNullException ("line");
+ this.Line = line;
+ }
+
+ #region IDocumentLine implementation
+ int MonoDevelop.Ide.Editor.IDocumentLine.LengthIncludingDelimiter {
+ get {
+ return Line.LengthIncludingDelimiter;
+ }
+ }
+
+ int MonoDevelop.Ide.Editor.IDocumentLine.EndOffsetIncludingDelimiter {
+ get {
+ return Line.EndOffsetIncludingDelimiter;
+ }
+ }
+
+ MonoDevelop.Core.Text.ISegment MonoDevelop.Ide.Editor.IDocumentLine.SegmentIncludingDelimiter {
+ get {
+ return MonoDevelop.Core.Text.TextSegment.FromBounds (Line.Offset, Line.EndOffsetIncludingDelimiter);
+ }
+ }
+
+ MonoDevelop.Core.Text.UnicodeNewline MonoDevelop.Ide.Editor.IDocumentLine.UnicodeNewline {
+ get {
+ return (MonoDevelop.Core.Text.UnicodeNewline)Line.UnicodeNewline;
+ }
+ }
+
+ int MonoDevelop.Ide.Editor.IDocumentLine.DelimiterLength {
+ get {
+ return Line.DelimiterLength;
+ }
+ }
+
+ int MonoDevelop.Ide.Editor.IDocumentLine.LineNumber {
+ get {
+ return Line.LineNumber;
+ }
+ }
+
+ MonoDevelop.Ide.Editor.IDocumentLine MonoDevelop.Ide.Editor.IDocumentLine.PreviousLine {
+ get {
+ var prev = Line.PreviousLine;
+ return prev != null ? new DocumentLineWrapper (prev) : null;
+ }
+ }
+
+ MonoDevelop.Ide.Editor.IDocumentLine MonoDevelop.Ide.Editor.IDocumentLine.NextLine {
+ get {
+ var next = Line.NextLine;
+ return next != null ? new DocumentLineWrapper (next) : null;
+ }
+ }
+ #endregion
+
+ #region ISegment implementation
+ int MonoDevelop.Core.Text.ISegment.Offset {
+ get {
+ return Line.Offset;
+ }
+ }
+
+ int MonoDevelop.Core.Text.ISegment.Length {
+ get {
+ return Line.Length;
+ }
+ }
+
+ int MonoDevelop.Core.Text.ISegment.EndOffset {
+ get {
+ return Line.EndOffset;
+ }
+ }
+ #endregion
+
+ public override int GetHashCode ()
+ {
+ return Line.GetHashCode () ^ 991;
+ }
+
+ public override bool Equals (object obj)
+ {
+ if (ReferenceEquals (obj, this))
+ return true;
+ var other = obj as MonoDevelop.Ide.Editor.IDocumentLine;
+ if (other == null)
+ return false;
+ return Line.Offset == other.Offset && Line.Length == other.Length;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/FoldSegmentWrapper.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/FoldSegmentWrapper.cs
new file mode 100644
index 0000000000..8d1ba6cf48
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/FoldSegmentWrapper.cs
@@ -0,0 +1,66 @@
+//
+// FoldSegmentWrapper.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Mono.TextEditor;
+using MonoDevelop.Ide.Editor;
+
+namespace MonoDevelop.SourceEditor.Wrappers
+{
+ class FoldSegmentWrapper : Mono.TextEditor.FoldSegment, IFoldSegment
+ {
+ bool IFoldSegment.IsCollapsed {
+ get {
+ return IsFolded;
+ }
+ set {
+ IsFolded = value;
+ }
+ }
+
+ string IFoldSegment.CollapsedText {
+ get {
+ return Description;
+ }
+ set {
+ Description = value;
+ }
+ }
+
+ MonoDevelop.Ide.Editor.FoldingType IFoldSegment.FoldingType {
+ get {
+ return (MonoDevelop.Ide.Editor.FoldingType)base.FoldingType;
+ }
+ set {
+ base.FoldingType = (Mono.TextEditor.FoldingType)value;
+ }
+ }
+
+ public FoldSegmentWrapper (TextDocument doc, string description, int offset, int length, Mono.TextEditor.FoldingType foldingType) : base (doc, description, offset, length, foldingType)
+ {
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/ITextDocumentWrapper.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/ITextDocumentWrapper.cs
new file mode 100644
index 0000000000..4186bc48cc
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/ITextDocumentWrapper.cs
@@ -0,0 +1,396 @@
+//
+// ITextDocumentWrapper.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide.Editor;
+using Mono.TextEditor;
+using System.IO;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Text;
+using Atk;
+
+namespace MonoDevelop.SourceEditor.Wrappers
+{
+ class TextDocumentWrapper : ITextDocument, IDisposable
+ {
+ readonly TextDocument document;
+
+ public TextDocument Document {
+ get {
+ return document;
+ }
+ }
+
+ public TextDocumentWrapper (TextDocument document)
+ {
+ if (document == null)
+ throw new ArgumentNullException (nameof (document));
+ this.document = document;
+ this.document.TextReplaced += HandleTextReplaced;
+ this.document.TextReplacing += HandleTextReplacing;
+ this.document.LineChanged += Document_LineChanged;
+ this.document.LineInserted += Document_LineInserted;
+ this.document.LineRemoved += Document_LineRemoved;
+ }
+
+ public void Dispose ()
+ {
+ document.TextReplaced -= HandleTextReplaced;
+ document.TextReplacing -= HandleTextReplacing;
+ document.LineChanged -= Document_LineChanged;
+ document.LineInserted -= Document_LineInserted;
+ document.LineRemoved -= Document_LineRemoved;
+ }
+
+ void Document_LineRemoved (object sender, Mono.TextEditor.LineEventArgs e)
+ {
+ var handler = LineRemoved;
+ if (handler != null)
+ handler (this, new MonoDevelop.Ide.Editor.LineEventArgs (new DocumentLineWrapper (e.Line)));
+ }
+
+ void Document_LineInserted (object sender, Mono.TextEditor.LineEventArgs e)
+ {
+ var handler = LineInserted;
+ if (handler != null)
+ handler (this, new MonoDevelop.Ide.Editor.LineEventArgs (new DocumentLineWrapper (e.Line)));
+ }
+
+ void Document_LineChanged (object sender, Mono.TextEditor.LineEventArgs e)
+ {
+ var handler = LineChanged;
+ if (handler != null)
+ handler (this, new MonoDevelop.Ide.Editor.LineEventArgs (new DocumentLineWrapper (e.Line)));
+ }
+
+ void HandleTextReplacing (object sender, DocumentChangeEventArgs e)
+ {
+ var handler = textChanging;
+ if (handler != null)
+ handler (this, new MonoDevelop.Core.Text.TextChangeEventArgs (e.Offset, e.RemovedText.Text, e.InsertedText.Text));
+ }
+
+ void HandleTextReplaced (object sender, DocumentChangeEventArgs e)
+ {
+ var handler = textChanged;
+ if (handler != null)
+ handler (this, new MonoDevelop.Core.Text.TextChangeEventArgs (e.Offset, e.RemovedText.Text, e.InsertedText.Text));
+ }
+
+ #region ITextDocument implementation
+ event EventHandler<MonoDevelop.Core.Text.TextChangeEventArgs> textChanging;
+ event EventHandler<MonoDevelop.Core.Text.TextChangeEventArgs> ITextDocument.TextChanging {
+ add {
+ textChanging += value;
+ }
+ remove {
+ textChanging -= value;
+ }
+ }
+
+ event EventHandler<MonoDevelop.Core.Text.TextChangeEventArgs> textChanged;
+ event EventHandler<MonoDevelop.Core.Text.TextChangeEventArgs> ITextDocument.TextChanged {
+ add {
+ textChanged += value;
+ }
+ remove {
+ textChanged -= value;
+ }
+ }
+
+ void ITextDocument.InsertText (int offset, string text)
+ {
+ document.Insert (offset, text);
+ }
+
+ void ITextDocument.InsertText (int offset, MonoDevelop.Core.Text.ITextSource text)
+ {
+ document.Insert (offset, text.Text);
+ }
+
+ void ITextDocument.RemoveText (int offset, int length)
+ {
+ document.Remove (offset, length);
+ }
+
+ void ITextDocument.ReplaceText (int offset, int length, string value)
+ {
+ document.Replace (offset, length, value);
+ }
+
+ void ITextDocument.ReplaceText (int offset, int length, MonoDevelop.Core.Text.ITextSource value)
+ {
+ document.Replace (offset, length, value.Text);
+ }
+
+ IDisposable ITextDocument.OpenUndoGroup ()
+ {
+ return document.OpenUndoGroup ();
+ }
+
+ IReadonlyTextDocument ITextDocument.CreateDocumentSnapshot ()
+ {
+ return new ReadonlyDocumentSnapshot (document);
+ }
+
+ string ITextDocument.Text {
+ get {
+ return document.Text;
+ }
+ set {
+ document.Text = value;
+ }
+ }
+
+ bool ITextDocument.IsReadOnly {
+ get {
+ return document.ReadOnly;
+ }
+ set {
+ document.ReadOnly = value;
+ }
+ }
+
+ FilePath ITextDocument.FileName {
+ get {
+ return document.FileName;
+ }
+ set {
+ document.FileName = value;
+ }
+ }
+
+ event EventHandler ITextDocument.FileNameChanged {
+ add {
+ document.FileNameChanged += value;
+ }
+ remove {
+ document.FileNameChanged -= value;
+ }
+ }
+
+ string ITextDocument.MimeType {
+ get {
+ return document.MimeType;
+ }
+ set {
+ document.MimeType = value;
+ }
+ }
+
+ event EventHandler ITextDocument.MimeTypeChanged {
+ add {
+ document.MimeTypeChanged += value;
+ }
+ remove {
+ document.MimeTypeChanged -= value;
+ }
+ }
+
+
+
+ bool ITextDocument.UseBOM {
+ get {
+ return document.UseBom;
+ }
+ set {
+ document.UseBom = value;
+ }
+ }
+
+ System.Text.Encoding ITextDocument.Encoding {
+ get {
+ return document.Encoding;
+ }
+ set {
+ document.Encoding = value;
+ }
+ }
+
+ bool ITextDocument.IsInAtomicUndo {
+ get {
+ return document.IsInAtomicUndo;
+ }
+ }
+
+ char ITextDocument.this [int offset] {
+ get {
+ return document.GetCharAt (offset);
+ }
+ set {
+ document.Replace (offset, 1, value.ToString ());
+ }
+ }
+
+ char MonoDevelop.Core.Text.ITextSource.this [int offset] {
+ get {
+ return document.GetCharAt (offset);
+ }
+ }
+
+ public event EventHandler<MonoDevelop.Ide.Editor.LineEventArgs> LineChanged;
+ public event EventHandler<MonoDevelop.Ide.Editor.LineEventArgs> LineInserted;
+ public event EventHandler<MonoDevelop.Ide.Editor.LineEventArgs> LineRemoved;
+
+ #endregion
+
+ #region IReadonlyTextDocument implementation
+
+ int IReadonlyTextDocument.LocationToOffset (int line, int column)
+ {
+ return document.LocationToOffset (line, column);
+ }
+
+ MonoDevelop.Ide.Editor.DocumentLocation IReadonlyTextDocument.OffsetToLocation (int offset)
+ {
+ var loc = document.OffsetToLocation (offset);
+ return new MonoDevelop.Ide.Editor.DocumentLocation (loc.Line, loc.Column);
+ }
+
+ IDocumentLine IReadonlyTextDocument.GetLine (int lineNumber)
+ {
+ var line = document.GetLine (lineNumber);
+ return line != null ? new DocumentLineWrapper (line) : null;
+ }
+
+ IDocumentLine IReadonlyTextDocument.GetLineByOffset (int offset)
+ {
+ var line = document.GetLineByOffset (offset);
+ return line != null ? new DocumentLineWrapper (line) : null;
+ }
+
+ bool IReadonlyTextDocument.IsReadOnly {
+ get {
+ return document.ReadOnly;
+ }
+ }
+
+ FilePath IReadonlyTextDocument.FileName {
+ get {
+ return document.FileName;
+ }
+ }
+
+ string IReadonlyTextDocument.MimeType {
+ get {
+ return document.MimeType;
+ }
+ }
+
+ int IReadonlyTextDocument.LineCount {
+ get {
+ return document.LineCount;
+ }
+ }
+
+ #endregion
+
+ #region ITextSource implementation
+
+ string MonoDevelop.Core.Text.ITextSource.GetTextAt (int offset, int length)
+ {
+ return document.GetTextAt (offset, length);
+ }
+
+ MonoDevelop.Core.Text.ITextSourceVersion MonoDevelop.Core.Text.ITextSource.Version {
+ get {
+ return new TextSourceVersionWrapper (document.Version);
+ }
+ }
+
+ bool MonoDevelop.Core.Text.ITextSource.UseBOM {
+ get {
+ return document.UseBom;
+ }
+ }
+
+ System.Text.Encoding MonoDevelop.Core.Text.ITextSource.Encoding {
+ get {
+ return document.Encoding;
+ }
+ }
+
+ int MonoDevelop.Core.Text.ITextSource.Length {
+ get {
+ return document.TextLength;
+ }
+ }
+
+ string MonoDevelop.Core.Text.ITextSource.Text {
+ get {
+ return document.Text;
+ }
+ }
+
+ char MonoDevelop.Core.Text.ITextSource.GetCharAt (int offset)
+ {
+ return document.GetCharAt (offset);
+ }
+
+
+ TextReader MonoDevelop.Core.Text.ITextSource.CreateReader ()
+ {
+ return document.CreateReader ();
+ }
+
+ TextReader MonoDevelop.Core.Text.ITextSource.CreateReader (int offset, int length)
+ {
+ return document.CreateReader (offset, length);
+ }
+
+ void MonoDevelop.Core.Text.ITextSource.WriteTextTo (TextWriter writer)
+ {
+ if (writer == null)
+ throw new ArgumentNullException ("writer");
+ writer.Write (document.Text);
+ }
+
+ void MonoDevelop.Core.Text.ITextSource.WriteTextTo (TextWriter writer, int offset, int length)
+ {
+ if (writer == null)
+ throw new ArgumentNullException ("writer");
+ writer.Write (document.GetTextAt (offset, length));
+ }
+
+ ITextSource ITextSource.CreateSnapshot ()
+ {
+ return new ImmutableTextTextSource (document.GetImmutableText (), document.Encoding, document.UseBom, new TextSourceVersionWrapper (document.Version));
+ }
+
+ ITextSource ITextSource.CreateSnapshot (int offset, int length)
+ {
+ return new ImmutableTextTextSource (document.GetImmutableText (offset, length), document.Encoding, document.UseBom);
+ }
+
+ /// <inheritdoc/>
+ public void CopyTo (int sourceIndex, char [] destination, int destinationIndex, int count)
+ {
+ document.CopyTo (sourceIndex, destination, destinationIndex, count);
+ }
+
+ #endregion
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/ImmutableTextTextSource.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/ImmutableTextTextSource.cs
new file mode 100644
index 0000000000..92778ef40b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/ImmutableTextTextSource.cs
@@ -0,0 +1,131 @@
+//
+// RopeTextSource.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+using Mono.TextEditor.Utils;
+
+namespace MonoDevelop.SourceEditor.Wrappers
+{
+ class ImmutableTextTextSource : ITextSource
+ {
+ readonly ImmutableText immutableText;
+ readonly ITextSourceVersion version;
+
+ public ImmutableTextTextSource (ImmutableText immutableText, System.Text.Encoding encoding, bool useBom, ITextSourceVersion version = null)
+ {
+ if (immutableText == null)
+ throw new ArgumentNullException (nameof (immutableText));
+ this.immutableText = immutableText;
+ this.encoding = encoding;
+ UseBOM = useBom;
+ this.version = version;
+ }
+
+ #region ITextSource implementation
+ char ITextSource.GetCharAt (int offset)
+ {
+ return immutableText [offset];
+ }
+
+ char ITextSource.this [int offset] {
+ get {
+ return immutableText [offset];
+ }
+ }
+
+ string ITextSource.GetTextAt (int offset, int length)
+ {
+ return immutableText.ToString (offset, length);
+ }
+
+ System.IO.TextReader ITextSource.CreateReader ()
+ {
+ return new ImmutableTextTextReader (immutableText);
+ }
+
+ System.IO.TextReader ITextSource.CreateReader (int offset, int length)
+ {
+ return new ImmutableTextTextReader (immutableText.GetText (offset, length));
+ }
+
+ void ITextSource.WriteTextTo (System.IO.TextWriter writer)
+ {
+ immutableText.WriteTo (writer, 0, immutableText.Length);
+ }
+
+ void ITextSource.WriteTextTo (System.IO.TextWriter writer, int offset, int length)
+ {
+ immutableText.WriteTo (writer, offset, length);
+ }
+
+ ITextSource ITextSource.CreateSnapshot ()
+ {
+ return this;
+ }
+
+ ITextSource ITextSource.CreateSnapshot (int offset, int length)
+ {
+ return new ImmutableTextTextSource (immutableText.GetText (offset, length), Encoding, UseBOM);
+ }
+
+ ITextSourceVersion ITextSource.Version {
+ get {
+ return version;
+ }
+ }
+
+ public bool UseBOM {
+ get;
+ private set;
+ }
+
+ System.Text.Encoding encoding;
+ public System.Text.Encoding Encoding {
+ get {
+ return encoding ?? System.Text.Encoding.UTF8;
+ }
+ }
+
+ int ITextSource.Length {
+ get {
+ return immutableText.Length;
+ }
+ }
+
+ string ITextSource.Text {
+ get {
+ return immutableText.ToString ();
+ }
+ }
+
+ /// <inheritdoc/>
+ void ITextSource.CopyTo (int sourceIndex, char [] destination, int destinationIndex, int count)
+ {
+ immutableText.CopyTo (sourceIndex, destination, destinationIndex, count);
+ }
+ #endregion
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/IndentationTrackerWrapper.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/IndentationTrackerWrapper.cs
new file mode 100644
index 0000000000..a88ecf421c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/IndentationTrackerWrapper.cs
@@ -0,0 +1,83 @@
+// IndentationTrackerWrapper.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Mono.TextEditor;
+using MonoDevelop.Ide.Editor;
+
+namespace MonoDevelop.SourceEditor.Wrappers
+{
+ class IndentationTrackerWrapper : Mono.TextEditor.IIndentationTracker
+ {
+ readonly IReadonlyTextDocument document;
+ readonly MonoDevelop.Ide.Editor.Extension.IndentationTracker indentationTracker;
+
+ public IndentationTrackerWrapper (Mono.TextEditor.TextEditorData textEditorData, IReadonlyTextDocument document, MonoDevelop.Ide.Editor.Extension.IndentationTracker indentationTracker)
+ {
+ if (textEditorData == null)
+ throw new System.ArgumentNullException ("textEditorData");
+ if (document == null)
+ throw new System.ArgumentNullException ("document");
+ if (indentationTracker == null)
+ throw new System.ArgumentNullException ("indentationTracker");
+ this.document = document;
+ this.indentationTracker = indentationTracker;
+ }
+
+ #region IIndentationTracker implementation
+
+ IndentatitonTrackerFeatures IIndentationTracker.SupportedFeatures {
+ get {
+ return (IndentatitonTrackerFeatures)indentationTracker.SupportedFeatures;
+ }
+ }
+
+ string Mono.TextEditor.IIndentationTracker.GetIndentationString (int offset)
+ {
+ return indentationTracker.GetIndentationString (document.OffsetToLineNumber (offset));
+ }
+
+ string Mono.TextEditor.IIndentationTracker.GetIndentationString (int lineNumber, int column)
+ {
+ return indentationTracker.GetIndentationString (lineNumber);
+ }
+
+ static int CountIndent (string str)
+ {
+ // '\t' == 1 - virtual indent is here the character indent not the visual one.
+ return str.Length;
+ }
+
+ int Mono.TextEditor.IIndentationTracker.GetVirtualIndentationColumn (int offset)
+ {
+ return 1 + CountIndent(((Mono.TextEditor.IIndentationTracker)this).GetIndentationString (offset));
+ }
+
+ int Mono.TextEditor.IIndentationTracker.GetVirtualIndentationColumn (int lineNumber, int column)
+ {
+ return 1 + CountIndent(((Mono.TextEditor.IIndentationTracker)this).GetIndentationString (lineNumber, column));
+ }
+ #endregion
+ }
+}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/ReadonlyDocumentSnapshot.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/ReadonlyDocumentSnapshot.cs
new file mode 100644
index 0000000000..b35d08b6a0
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/ReadonlyDocumentSnapshot.cs
@@ -0,0 +1,184 @@
+//
+// ReadonlyDocumentSnapshot.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide.Editor;
+using Mono.TextEditor.Utils;
+
+namespace MonoDevelop.SourceEditor.Wrappers
+{
+ class ReadonlyDocumentSnapshot : IReadonlyTextDocument
+ {
+ readonly Mono.TextEditor.TextDocument snapshot;
+ readonly MonoDevelop.Core.Text.ITextSourceVersion version;
+
+ public ReadonlyDocumentSnapshot (Mono.TextEditor.TextDocument textDocument)
+ {
+ snapshot = textDocument.CreateDocumentSnapshot ();
+ version = new TextSourceVersionWrapper (textDocument.Version);
+ }
+
+ #region IReadonlyTextDocument implementation
+
+ int IReadonlyTextDocument.LocationToOffset (int line, int column)
+ {
+ return snapshot.LocationToOffset (line, column);
+ }
+
+ DocumentLocation IReadonlyTextDocument.OffsetToLocation (int offset)
+ {
+ var loc = snapshot.OffsetToLocation (offset);
+ return new MonoDevelop.Ide.Editor.DocumentLocation (loc.Line, loc.Column);
+ }
+
+ IDocumentLine IReadonlyTextDocument.GetLine (int lineNumber)
+ {
+ var line = snapshot.GetLine (lineNumber);
+ return line != null ? new DocumentLineWrapper (line) : null;
+ }
+
+ IDocumentLine IReadonlyTextDocument.GetLineByOffset (int offset)
+ {
+ var line = snapshot.GetLineByOffset (offset);
+ return line != null ? new DocumentLineWrapper (line) : null;
+ }
+
+ bool IReadonlyTextDocument.IsReadOnly {
+ get {
+ return true;
+ }
+ }
+
+ MonoDevelop.Core.FilePath IReadonlyTextDocument.FileName {
+ get {
+ return snapshot.FileName;
+ }
+ }
+
+ string IReadonlyTextDocument.MimeType {
+ get {
+ return snapshot.MimeType;
+ }
+ }
+
+ int IReadonlyTextDocument.LineCount {
+ get {
+ return snapshot.LineCount;
+ }
+ }
+
+ #endregion
+
+ #region ITextSource implementation
+
+ char MonoDevelop.Core.Text.ITextSource.GetCharAt (int offset)
+ {
+ return snapshot.GetCharAt (offset);
+ }
+
+ char MonoDevelop.Core.Text.ITextSource.this [int offset] {
+ get {
+ return snapshot.GetCharAt (offset);
+ }
+ }
+
+ string MonoDevelop.Core.Text.ITextSource.GetTextAt (int offset, int length)
+ {
+ return snapshot.GetTextAt (offset, length);
+ }
+
+ System.IO.TextReader MonoDevelop.Core.Text.ITextSource.CreateReader ()
+ {
+ return snapshot.CreateReader ();
+ }
+
+ System.IO.TextReader MonoDevelop.Core.Text.ITextSource.CreateReader (int offset, int length)
+ {
+ return snapshot.CreateReader (offset, length);
+ }
+
+ void MonoDevelop.Core.Text.ITextSource.WriteTextTo (System.IO.TextWriter writer)
+ {
+ if (writer == null)
+ throw new ArgumentNullException ("writer");
+ writer.Write (snapshot.Text);
+ }
+
+ void MonoDevelop.Core.Text.ITextSource.WriteTextTo (System.IO.TextWriter writer, int offset, int length)
+ {
+ if (writer == null)
+ throw new ArgumentNullException ("writer");
+ writer.Write (snapshot.GetTextAt (offset, length));
+ }
+
+ MonoDevelop.Core.Text.ITextSource MonoDevelop.Core.Text.ITextSource.CreateSnapshot ()
+ {
+ return this;
+ }
+
+ MonoDevelop.Core.Text.ITextSource MonoDevelop.Core.Text.ITextSource.CreateSnapshot (int offset, int length)
+ {
+ return new ImmutableTextTextSource (snapshot.GetImmutableText (offset, length), snapshot.Encoding, snapshot.UseBom);
+ }
+
+ MonoDevelop.Core.Text.ITextSourceVersion MonoDevelop.Core.Text.ITextSource.Version {
+ get {
+ return version;
+ }
+ }
+
+ bool MonoDevelop.Core.Text.ITextSource.UseBOM {
+ get {
+ return snapshot.UseBom;
+ }
+ }
+
+ System.Text.Encoding MonoDevelop.Core.Text.ITextSource.Encoding {
+ get {
+ return snapshot.Encoding;
+ }
+ }
+
+ int MonoDevelop.Core.Text.ITextSource.Length {
+ get {
+ return snapshot.TextLength;
+ }
+ }
+
+ string MonoDevelop.Core.Text.ITextSource.Text {
+ get {
+ return snapshot.Text;
+ }
+ }
+
+ /// <inheritdoc/>
+ public void CopyTo (int sourceIndex, char [] destination, int destinationIndex, int count)
+ {
+ snapshot.CopyTo (sourceIndex, destination, destinationIndex, count);
+ }
+ #endregion
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/SelectionSurroundingProviderWrapper.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/SelectionSurroundingProviderWrapper.cs
new file mode 100644
index 0000000000..516a662f6b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/SelectionSurroundingProviderWrapper.cs
@@ -0,0 +1,58 @@
+//
+// SelectionSurroundingProviderWrapper.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Mono.TextEditor;
+using MonoDevelop.SourceEditor.Wrappers;
+
+namespace MonoDevelop.SourceEditor.Wrappers
+{
+ class SelectionSurroundingProviderWrapper : ISelectionSurroundingProvider
+ {
+ readonly MonoDevelop.Ide.Editor.Extension.SelectionSurroundingProvider surroundingProvider;
+
+ public SelectionSurroundingProviderWrapper (MonoDevelop.Ide.Editor.Extension.SelectionSurroundingProvider surroundingProvider)
+ {
+ if (surroundingProvider == null)
+ throw new ArgumentNullException ("surroundingProvider");
+ this.surroundingProvider = surroundingProvider;
+ }
+
+ #region ISelectionSurroundingProvider implementation
+
+ bool ISelectionSurroundingProvider.GetSelectionSurroundings (TextEditorData textEditorData, uint unicodeKey, out string start, out string end)
+ {
+ return surroundingProvider.GetSelectionSurroundings (unicodeKey, out start, out end);
+ }
+
+ void ISelectionSurroundingProvider.HandleSpecialSelectionKey (TextEditorData textEditorData, uint unicodeKey)
+ {
+ surroundingProvider.HandleSpecialSelectionKey (unicodeKey);
+ }
+
+ #endregion
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/SemanticHighlightingSyntaxMode.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/SemanticHighlightingSyntaxMode.cs
new file mode 100644
index 0000000000..47ec20530c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/SemanticHighlightingSyntaxMode.cs
@@ -0,0 +1,236 @@
+//
+// SemanticHighlightingSyntaxMode.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Mono.TextEditor.Highlighting;
+using MonoDevelop.Ide.Editor.Highlighting;
+using Mono.TextEditor;
+using System.Collections.Generic;
+using MonoDevelop.Ide.Editor;
+using System.Linq;
+using Gtk;
+
+namespace MonoDevelop.SourceEditor.Wrappers
+{
+ sealed class SemanticHighlightingSyntaxMode : SyntaxMode, IDisposable
+ {
+ readonly ExtensibleTextEditor editor;
+ readonly SyntaxMode syntaxMode;
+ SemanticHighlighting semanticHighlighting;
+
+ public override TextDocument Document {
+ get {
+ return syntaxMode.Document;
+ }
+ set {
+ syntaxMode.Document = value;
+ }
+ }
+
+ public Mono.TextEditor.Highlighting.SyntaxMode UnderlyingSyntaxMode {
+ get {
+ return this.syntaxMode;
+ }
+ }
+
+ internal class StyledTreeSegment : Mono.TextEditor.TreeSegment
+ {
+ public string Style {
+ get;
+ private set;
+ }
+
+ public StyledTreeSegment (int offset, int length, string style) : base (offset, length)
+ {
+ Style = style;
+ }
+ }
+
+ class HighlightingSegmentTree : Mono.TextEditor.SegmentTree<StyledTreeSegment>
+ {
+ public bool GetStyle (Chunk chunk, ref int endOffset, out string style)
+ {
+ var segment = GetSegmentsAt (chunk.Offset).FirstOrDefault (s => s.EndOffset > chunk.Offset);
+ if (segment == null) {
+ style = null;
+ return false;
+ }
+ endOffset = segment.EndOffset;
+ style = segment.Style;
+ return true;
+ }
+
+ public void AddStyle (MonoDevelop.Core.Text.ISegment segment, string style)
+ {
+ if (IsDirty)
+ return;
+ Add (new StyledTreeSegment (segment.Offset, segment.Length, style));
+ }
+ }
+
+ bool isDisposed;
+ Queue<Tuple<DocumentLine, HighlightingSegmentTree>> lineSegments = new Queue<Tuple<DocumentLine, HighlightingSegmentTree>> ();
+
+ public SemanticHighlightingSyntaxMode (ExtensibleTextEditor editor, ISyntaxMode syntaxMode, SemanticHighlighting semanticHighlighting)
+ {
+ if (editor == null)
+ throw new ArgumentNullException ("editor");
+ if (syntaxMode == null)
+ throw new ArgumentNullException ("syntaxMode");
+ if (semanticHighlighting == null)
+ throw new ArgumentNullException ("semanticHighlighting");
+ this.editor = editor;
+ this.semanticHighlighting = semanticHighlighting;
+ this.syntaxMode = syntaxMode as SyntaxMode;
+ semanticHighlighting.SemanticHighlightingUpdated += SemanticHighlighting_SemanticHighlightingUpdated;
+ }
+
+ public void UpdateSemanticHighlighting (SemanticHighlighting newHighlighting)
+ {
+ if (isDisposed)
+ return;
+ if (semanticHighlighting !=null)
+ semanticHighlighting.SemanticHighlightingUpdated -= SemanticHighlighting_SemanticHighlightingUpdated;
+ semanticHighlighting = newHighlighting;
+ if (semanticHighlighting !=null)
+ semanticHighlighting.SemanticHighlightingUpdated += SemanticHighlighting_SemanticHighlightingUpdated;
+ }
+
+ void SemanticHighlighting_SemanticHighlightingUpdated (object sender, EventArgs e)
+ {
+ Application.Invoke (delegate {
+ if (isDisposed)
+ return;
+ UnregisterLineSegmentTrees ();
+ lineSegments.Clear ();
+
+ var margin = editor.TextViewMargin;
+ if (margin == null)
+ return;
+ margin.PurgeLayoutCache ();
+ editor.QueueDraw ();
+ });
+ }
+
+ void UnregisterLineSegmentTrees ()
+ {
+ if (isDisposed)
+ return;
+ foreach (var kv in lineSegments) {
+ try {
+ kv.Item2.RemoveListener ();
+ } catch (Exception) {
+ }
+ }
+ }
+
+ public void Dispose()
+ {
+ if (isDisposed)
+ return;
+ isDisposed = true;
+ UnregisterLineSegmentTrees ();
+ lineSegments = null;
+ semanticHighlighting.SemanticHighlightingUpdated -= SemanticHighlighting_SemanticHighlightingUpdated;
+ }
+
+ public override SpanParser CreateSpanParser (Mono.TextEditor.DocumentLine line, CloneableStack<Span> spanStack)
+ {
+ return syntaxMode.CreateSpanParser (line, spanStack);
+ }
+
+ public override ChunkParser CreateChunkParser (SpanParser spanParser, Mono.TextEditor.Highlighting.ColorScheme style, DocumentLine line)
+ {
+ return new CSharpChunkParser (this, spanParser, style, line);
+ }
+
+ class CSharpChunkParser : ChunkParser
+ {
+ const int MaximumCachedLineSegments = 200;
+ SemanticHighlightingSyntaxMode semanticMode;
+
+ public CSharpChunkParser (SemanticHighlightingSyntaxMode semanticMode, SpanParser spanParser, Mono.TextEditor.Highlighting.ColorScheme style, DocumentLine line) : base (semanticMode, spanParser, style, line)
+ {
+ this.semanticMode = semanticMode;
+ }
+
+ protected override void AddRealChunk (Chunk chunk)
+ {
+ if (!DefaultSourceEditorOptions.Instance.EnableSemanticHighlighting) {
+ base.AddRealChunk (chunk);
+ return;
+ }
+ StyledTreeSegment treeseg = null;
+
+ try {
+ var tree = semanticMode.lineSegments.FirstOrDefault (t => t.Item1 == line);
+ if (tree == null) {
+ tree = Tuple.Create (line, new HighlightingSegmentTree ());
+ tree.Item2.InstallListener (semanticMode.Document);
+ int lineOffset = line.Offset;
+ foreach (var seg in semanticMode.semanticHighlighting.GetColoredSegments (new MonoDevelop.Core.Text.TextSegment (lineOffset, line.Length))) {
+ tree.Item2.AddStyle (seg, seg.ColorStyleKey);
+ }
+ while (semanticMode.lineSegments.Count > MaximumCachedLineSegments) {
+ var removed = semanticMode.lineSegments.Dequeue ();
+ try {
+ removed.Item2.RemoveListener ();
+ } catch (Exception) { }
+ }
+ semanticMode.lineSegments.Enqueue (tree);
+ }
+ treeseg = tree.Item2.GetSegmentsOverlapping (chunk).FirstOrDefault (s => s.Offset < chunk.EndOffset && s.EndOffset > chunk.Offset);
+ } catch (Exception e) {
+ Console.WriteLine ("Error in semantic highlighting: " + e);
+ }
+
+ if (treeseg != null) {
+ if (treeseg.Offset - chunk.Offset > 0)
+ AddRealChunk (new Chunk (chunk.Offset, treeseg.Offset - chunk.Offset, chunk.Style));
+
+ var startOffset = Math.Max (chunk.Offset, treeseg.Offset);
+ var endOffset = Math.Min (treeseg.EndOffset, chunk.EndOffset);
+
+ base.AddRealChunk (new Chunk (startOffset, endOffset - startOffset, treeseg.Style));
+
+ if (endOffset < chunk.EndOffset)
+ AddRealChunk (new Chunk (treeseg.EndOffset, chunk.EndOffset - endOffset, chunk.Style));
+ return;
+ }
+
+ base.AddRealChunk (chunk);
+ }
+
+ protected override string GetStyle (Chunk chunk)
+ {
+ /*if (spanParser.CurRule.Name == "Comment") {
+ if (tags.Contains (doc.GetTextAt (chunk)))
+ return "Comment Tag";
+ }*/
+ return base.GetStyle (chunk);
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TextChangeEventArgsWrapper.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TextChangeEventArgsWrapper.cs
new file mode 100644
index 0000000000..754bb26cad
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TextChangeEventArgsWrapper.cs
@@ -0,0 +1,37 @@
+//
+// TextSourceVersionWrapper.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+
+namespace MonoDevelop.SourceEditor.Wrappers
+{
+ class TextChangeEventArgsWrapper : TextChangeEventArgs
+ {
+ public TextChangeEventArgsWrapper (ICSharpCode.NRefactory.Editor.TextChangeEventArgs change) : base (change.Offset, change.RemovedText.Text, change.InsertedText.Text)
+ {
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TextPasteHandlerWrapper.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TextPasteHandlerWrapper.cs
new file mode 100644
index 0000000000..765e39f7a2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TextPasteHandlerWrapper.cs
@@ -0,0 +1,68 @@
+// SourceEditorView.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.SourceEditor.Wrappers
+{
+ class TextPasteHandlerWrapper : ICSharpCode.NRefactory.Editor.ITextPasteHandler, IDisposable
+ {
+ readonly MonoDevelop.Ide.Editor.Extension.TextPasteHandler textPasteHandler;
+ readonly Mono.TextEditor.TextEditorData data;
+
+ public TextPasteHandlerWrapper (Mono.TextEditor.TextEditorData data, MonoDevelop.Ide.Editor.Extension.TextPasteHandler textPasteHandler)
+ {
+ this.data = data;
+ this.textPasteHandler = textPasteHandler;
+ data.Paste += HandlePaste;
+ }
+
+ void HandlePaste (int insertionOffset, string text, int insertedChars)
+ {
+ textPasteHandler.PostFomatPastedText (insertionOffset, insertedChars);
+ }
+
+ #region IDisposable implementation
+
+ public void Dispose ()
+ {
+ data.Paste -= HandlePaste;
+ }
+
+ #endregion
+
+ #region ITextPasteHandler implementation
+
+ string ICSharpCode.NRefactory.Editor.ITextPasteHandler.FormatPlainText (int offset, string text, byte[] copyData)
+ {
+ return textPasteHandler.FormatPlainText (offset, text, copyData);
+ }
+
+ byte[] ICSharpCode.NRefactory.Editor.ITextPasteHandler.GetCopyData (ICSharpCode.NRefactory.Editor.ISegment segment)
+ {
+ return textPasteHandler.GetCopyData (segment.Offset, segment.Length);
+ }
+ #endregion
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TextSourceVersionWrapper.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TextSourceVersionWrapper.cs
new file mode 100644
index 0000000000..f185268b4d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TextSourceVersionWrapper.cs
@@ -0,0 +1,71 @@
+//
+// TextSourceVersionWrapper.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+
+namespace MonoDevelop.SourceEditor.Wrappers
+{
+ class TextSourceVersionWrapper : ITextSourceVersion
+ {
+ readonly ICSharpCode.NRefactory.Editor.ITextSourceVersion version;
+
+ public TextSourceVersionWrapper (ICSharpCode.NRefactory.Editor.ITextSourceVersion version)
+ {
+ if (version == null)
+ throw new ArgumentNullException ("version");
+ this.version = version;
+ }
+
+ #region ITextSourceVersion implementation
+
+ bool ITextSourceVersion.BelongsToSameDocumentAs (ITextSourceVersion other)
+ {
+ var otherWrapper = other as TextSourceVersionWrapper;
+ return otherWrapper != null && version.BelongsToSameDocumentAs (otherWrapper.version);
+ }
+
+ int ITextSourceVersion.CompareAge (ITextSourceVersion other)
+ {
+ var otherWrapper = (TextSourceVersionWrapper)other;
+ return version.CompareAge (otherWrapper.version);
+ }
+
+ System.Collections.Generic.IEnumerable<TextChangeEventArgs> ITextSourceVersion.GetChangesTo (ITextSourceVersion other)
+ {
+ var otherWrapper = (TextSourceVersionWrapper)other;
+ foreach (var change in version.GetChangesTo (otherWrapper.version))
+ yield return new TextChangeEventArgsWrapper (change);
+ }
+
+ int ITextSourceVersion.MoveOffsetTo (ITextSourceVersion other, int oldOffset)
+ {
+ var otherWrapper = (TextSourceVersionWrapper)other;
+ return version.MoveOffsetTo (otherWrapper.version, oldOffset);
+ }
+ #endregion
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs
new file mode 100644
index 0000000000..148b925256
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.Wrappers/TooltipProviderWrapper.cs
@@ -0,0 +1,144 @@
+//
+// TooltipProviderWrapper.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Mono.TextEditor;
+using MonoDevelop.Ide;
+using Xwt.GtkBackend;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.SourceEditor.Wrappers
+{
+ class TooltipProviderWrapper : TooltipProvider, IDisposable
+ {
+ readonly MonoDevelop.Ide.Editor.TooltipProvider provider;
+ TooltipItem lastWrappedItem;
+ Ide.Editor.TooltipItem lastUnwrappedItem;
+
+ public MonoDevelop.Ide.Editor.TooltipProvider OriginalProvider {
+ get {
+ return provider;
+ }
+ }
+
+ public TooltipProviderWrapper (MonoDevelop.Ide.Editor.TooltipProvider provider)
+ {
+ if (provider == null)
+ throw new ArgumentNullException (nameof (provider));
+ this.provider = provider;
+ }
+
+ #region implemented abstract members of TooltipProvider
+
+ static MonoDevelop.Ide.Editor.TextEditor WrapEditor (MonoTextEditor editor)
+ {
+ foreach (var doc in IdeApp.Workbench.Documents) {
+ if (doc.FileName == editor.FileName)
+ return doc.Editor;
+ }
+ return null;
+ }
+
+ public override async Task<TooltipItem> GetItem (MonoTextEditor editor, int offset, CancellationToken token = default(CancellationToken))
+ {
+ var wrappedEditor = WrapEditor (editor);
+ if (wrappedEditor == null)
+ return null;
+ var doc = IdeApp.Workbench.ActiveDocument;
+ if (doc == null)
+ return null;
+ var task = provider.GetItem (wrappedEditor, doc, offset, token);
+ if (task == null) {
+ LoggingService.LogWarning ("Tooltip provider " + provider + " gave back null on GetItem (should always return a non null task).");
+ return null;
+ }
+ var item = await task;
+ if (item == null)
+ return null;
+ if (lastUnwrappedItem != null) {
+ if (lastUnwrappedItem.Offset == item.Offset &&
+ lastUnwrappedItem.Length == item.Length &&
+ lastUnwrappedItem.Item.Equals (item.Item)) {
+ return lastWrappedItem;
+ }
+ }
+ lastUnwrappedItem = item;
+ return lastWrappedItem = new TooltipItem (item.Item, item.Offset, item.Length);
+ }
+
+ public override bool IsInteractive (MonoTextEditor editor, Gtk.Window tipWindow)
+ {
+ var wrappedEditor = WrapEditor (editor);
+ if (wrappedEditor == null)
+ return false;
+ return provider.IsInteractive (wrappedEditor, tipWindow);
+ }
+
+ public override Gtk.Window CreateTooltipWindow (MonoTextEditor editor, int offset, Gdk.ModifierType modifierState, TooltipItem item)
+ {
+ var wrappedEditor = WrapEditor (editor);
+ if (wrappedEditor == null)
+ return null;
+ var control = provider.CreateTooltipWindow (wrappedEditor, IdeApp.Workbench.ActiveDocument, new MonoDevelop.Ide.Editor.TooltipItem (item.Item, item.ItemSegment.Offset, item.ItemSegment.Length), offset, modifierState.ToXwtValue ());
+ if (control == null)
+ return null;
+ return (Gtk.Window)control;
+ }
+
+ protected override void GetRequiredPosition (MonoTextEditor editor, Gtk.Window tipWindow, out int requiredWidth, out double xalign)
+ {
+ var wrappedEditor = WrapEditor (editor);
+ if (wrappedEditor == null) {
+ requiredWidth = 0;
+ xalign = 0;
+ return;
+ }
+ provider.GetRequiredPosition (wrappedEditor, tipWindow, out requiredWidth, out xalign);
+ }
+
+ public override Gtk.Window ShowTooltipWindow (MonoTextEditor editor, Gtk.Window tipWindow, int offset, Gdk.ModifierType modifierState, int mouseX, int mouseY, TooltipItem item)
+ {
+ var wrappedEditor = WrapEditor (editor);
+ if (wrappedEditor == null) {
+ return tipWindow;
+ }
+ provider.ShowTooltipWindow (wrappedEditor, tipWindow, new MonoDevelop.Ide.Editor.TooltipItem (item.Item, item.ItemSegment.Offset, item.ItemSegment.Length), modifierState.ToXwtValue (), mouseX, mouseY);
+ return tipWindow;
+ }
+
+ public void Dispose ()
+ {
+ var disposableProvider = provider as IDisposable;
+ if (disposableProvider != null) {
+ disposableProvider.Dispose ();
+ }
+ lastWrappedItem = null;
+ lastUnwrappedItem = null;
+ }
+ #endregion
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.addin.xml b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.addin.xml
index 2bae84f1f8..112f02c8fb 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.addin.xml
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.addin.xml
@@ -38,29 +38,6 @@
<ExtensionNode name="Class" />
</ExtensionPoint>
- <ExtensionPoint path = "/MonoDevelop/SourceEditor2/TooltipProviders" name = "Tooltip providers">
- <Description>Tooltip providers. Classes must implement ITooltipProvider.</Description>
- <ExtensionNode name="Class" />
- <ConditionType id="FileType" type="MonoDevelop.Ide.Extensions.FileTypeCondition">
- <Description>Type of the file being edited.</Description>
- </ConditionType>
- </ExtensionPoint>
-
- <ExtensionPoint path = "/MonoDevelop/SourceEditor2/SyntaxModes" name = "Text editor syntax modes">
- <Description>Syntax modes</Description>
- <ExtensionNode name="Templates" type="MonoDevelop.SourceEditor.Extension.TemplateCodon"/>
- </ExtensionPoint>
-
- <ExtensionPoint path = "/MonoDevelop/SourceEditor2/Styles" name = "Text editor styles">
- <Description>Styles</Description>
- <ExtensionNode name="Templates" type="MonoDevelop.SourceEditor.Extension.TemplateCodon"/>
- </ExtensionPoint>
-
- <ExtensionPoint path = "/MonoDevelop/SourceEditor2/CustomModes" name = "Text editor custom syntax modes">
- <Description>Styles</Description>
- <ExtensionNode name="SyntaxMode" type="MonoDevelop.SourceEditor.SyntaxModeCodon"/>
- </ExtensionPoint>
-
<!-- Extensions -->
<Extension path = "/MonoDevelop/SourceEditor2/TooltipProviders">
<Class id="Debug" class="MonoDevelop.SourceEditor.DebugValueTooltipProvider" />
@@ -97,30 +74,6 @@
</Extension>
<Extension path = "/MonoDevelop/Ide/Commands/TextEditor">
- <Command id = "MonoDevelop.SourceEditor.SourceEditorCommands.DynamicAbbrev"
- defaultHandler = "MonoDevelop.SourceEditor.DynamicAbbrevHandler"
- _label = "Dynamic abbrev"
- _description = "Cycles completing the current word from matching words in all open files"
- macShortcut = "Ctrl|/"
- shortcut = "Alt|/" />
- <Command id = "MonoDevelop.SourceEditor.SourceEditorCommands.PulseCaret"
- _label = "Find caret"
- _description = "Animates the text editor caret to help find it"
- shortcut = "Ctrl||"
- macShortcut = "Meta||" />
- <Command id = "MonoDevelop.SourceEditor.SourceEditorCommands.ToggleErrorTextMarker"
- _label = "Toggle message bubble"
- _description = "Toggles message bubble on/off"/>
-
- <Command id = "MonoDevelop.SourceEditor.MessageBubbleCommands.HideIssues"
- defaultHandler = "MonoDevelop.SourceEditor.HideIssuesHandler"
- _label = "_Hide Issues"/>
-
- <Command id = "MonoDevelop.SourceEditor.MessageBubbleCommands.ToggleIssues"
- defaultHandler = "MonoDevelop.SourceEditor.ToggleIssuesHandler"
- _label = "Toggle Issues"
- type="array"/>
-
<Command id = "MonoDevelop.SourceEditor.QuickTasks.ScrollbarCommand.Top"
_label = "_Top"/>
<Command id = "MonoDevelop.SourceEditor.QuickTasks.ScrollbarCommand.Bottom"
@@ -137,13 +90,6 @@
type="radio"/>
</Extension>
- <Extension path = "/MonoDevelop/Ide/DisplayBindings">
- <DisplayBinding
- id = "TextEditor"
- insertafter ="DefaultDisplayBinding"
- class = "MonoDevelop.SourceEditor.SourceEditorDisplayBinding" />
- </Extension>
-
<Extension path = "/MonoDevelop/SourceEditor2/ContextMenu/Editor">
<CommandItem id = "MonoDevelop.SourceEditor.SourceEditorCommands.MarkerOperations" />
<CommandItem id = "MonoDevelop.Debugger.DebugCommands.ExpressionEvaluator" />
@@ -189,30 +135,21 @@
<CommandItem id = "MonoDevelop.Debugger.DebugCommands.DisableAllBreakpoints" />
<CommandItem id = "MonoDevelop.Debugger.DebugCommands.ClearAllBreakpoints" />
<CommandItem id = "MonoDevelop.Debugger.DebugCommands.ShowBreakpointProperties" />
- <CommandItem id = "MonoDevelop.SourceEditor.SourceEditorCommands.ToggleErrorTextMarker" />
+ <CommandItem id = "MonoDevelop.Ide.Editor.MessageBubbleCommands.Toggle" />
</Extension>
<Extension path="/MonoDevelop/Ide/GlobalOptionsDialog/TextEditor">
<Section id="General" insertbefore="Formatting" _label="General" fill="true" class="MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel" icon="md-prefs-text-editor-general" />
<Section id="Markers" _label="Markers and Rulers" class="MonoDevelop.SourceEditor.OptionPanels.MarkerPanel" icon="md-prefs-markers-rulers" />
<Section id="Behavior" _label="Behavior" class="MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel" icon="md-prefs-text-editor-behavior" />
- <Section id="CodeCompletion" _label="Code Completion" icon="md-prefs-completion-behavior">
- <Panel id="CompletionBehavior" _label="Behavior" class="MonoDevelop.SourceEditor.OptionPanels.CompletionOptionsPanel" icon="md-prefs-completion-behavior" />
+ <Section id="CodeCompletion" _label="Code Completion" icon="md-prefs-completion">
+ <Panel id="CompletionBehavior" _label="Behavior" class="MonoDevelop.SourceEditor.OptionPanels.CompletionOptionsPanel" icon="md-prefs-completion" />
<!-- <Section id="CompletionCharacters" _label="Completion Characters" class="MonoDevelop.SourceEditor.OptionPanels.CompletionCharactersPanel" /> -->
- <Panel id="CompletionAppearance" _label="Appearance" class="MonoDevelop.SourceEditor.OptionPanels.CompletionAppearancePanel" icon="md-prefs-completion-appearance" />
+ <Panel id="CompletionAppearance" _label="Appearance" class="MonoDevelop.SourceEditor.OptionPanels.CompletionAppearancePanel" icon="md-prefs-completion" />
</Section>
<Section id="SyntaxHighlighting" _label="Syntax Highlighting" fill="true" class="MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel" icon="md-prefs-syntax-highlighting" />
</Extension>
- <Extension path = "/MonoDevelop/Ide/MainMenu/View">
- <ItemSet id = "MessageBubbles" _label = "_Message Bubbles" insertafter="MonoDevelop.Ide.Commands.ViewCommands.ViewList" insertbefore="ViewSeparator3">
- <CommandItem id = "MonoDevelop.SourceEditor.SourceEditorCommands.ToggleErrorTextMarker" />
- <CommandItem id = "MonoDevelop.SourceEditor.MessageBubbleCommands.HideIssues" />
- <SeparatorItem id = "Separator1" />
- <CommandItem id = "MonoDevelop.SourceEditor.MessageBubbleCommands.ToggleIssues" />
- </ItemSet>
- </Extension>
-
<Extension path = "/MonoDevelop/Ide/MainMenu/Search">
<ItemSet id = "Inspect" _label = "Inspect" insertafter="MonoDevelop.Ide.Commands.ViewCommands.ShowNext" insertbefore="Separator3">
<CommandItem id = "MonoDevelop.SourceEditor.SourceEditorCommands.NextIssue" />
@@ -222,8 +159,12 @@
</ItemSet>
</Extension>
- <Extension path = "/MonoDevelop/Ide/TextEditorExtensions">
- <Class fileExtensions = ".json" class = "MonoDevelop.SourceEditor.JSon.JSonTextEditorExtension" />
+ <Extension path = "/MonoDevelop/SourceEditor2/EditorFactory">
+ <Class id = "SourceEditor" class="MonoDevelop.SourceEditor.EditorFactory" />
+ </Extension>
+
+ <Extension path = "/MonoDevelop/Ide/AutoInsertBracketHandler">
+ <Class id = "Default" class="MonoDevelop.SourceEditor.DefaultAutoInsertBracketHandler" />
</Extension>
<Extension path = "/MonoDevelop/Core/UserDataMigration">
@@ -238,8 +179,7 @@
<StockIcon stockid="md-prefs-syntax-highlighting" resource="prefs-syntax-highlighting-16.png" size="Menu" />
<StockIcon stockid="md-prefs-text-editor-general" resource="prefs-text-editor-general-16.png" size="Menu" />
<StockIcon stockid="md-prefs-text-editor-behavior" resource="prefs-text-editor-behavior-16.png" size="Menu" />
- <StockIcon stockid="md-prefs-completion-appearance" resource="prefs-completion-appearance-16.png" size="Menu" />
- <StockIcon stockid="md-prefs-completion-behavior" resource="prefs-completion-behavior-16.png" size="Menu" />
+ <StockIcon stockid="md-prefs-completion" resource="prefs-completion-16.png" size="Menu" />
</Extension>
</ExtensionModel>
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj
index 9c6b608723..c300831fcc 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj
@@ -9,8 +9,9 @@
<OutputType>Library</OutputType>
<RootNamespace>MonoDevelop.SourceEditor</RootNamespace>
<AssemblyOriginatorKeyFile>.</AssemblyOriginatorKeyFile>
+ <AssemblyName>MonoDevelop.SourceEditor</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
- <AssemblyName>MonoDevelop.SourceEditor2</AssemblyName>
+ <AssemblyName>MonoDevelop.SourceEditor</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
@@ -67,11 +68,6 @@
<Name>MonoDevelop.Debugger</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
- <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
- <Name>Mono.TextEditor</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
<Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
<Name>ICSharpCode.NRefactory</Name>
@@ -97,6 +93,16 @@
<Name>ICSharpCode.NRefactory.CSharp</Name>
<Private>False</Private>
</ProjectReference>
+ <ProjectReference Include="..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
+ <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
+ <Name>Mono.TextEditor</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\external\xwt\Xwt.Gtk\Xwt.Gtk.csproj">
+ <Project>{C3887A93-B2BD-4097-8E2F-3A063EFF32FD}</Project>
+ <Name>Xwt.Gtk</Name>
+ <Private>False</Private>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
@@ -119,6 +125,18 @@
</Reference>
<Reference Include="System.Core" />
<Reference Include="Mono.Cairo" />
+ <Reference Include="System.Reflection.Metadata">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Reflection.Metadata.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Collections.Immutable">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Collections.Immutable.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
@@ -126,8 +144,6 @@
<Compile Include="MonoDevelop.SourceEditor\EditActions.cs" />
<Compile Include="MonoDevelop.SourceEditor\ExtensibleTextEditor.cs" />
<Compile Include="MonoDevelop.SourceEditor\LanguageItemWindow.cs" />
- <Compile Include="MonoDevelop.SourceEditor\SourceEditorDisplayBinding.cs" />
- <Compile Include="MonoDevelop.SourceEditor\SourceEditorOptions.cs" />
<Compile Include="MonoDevelop.SourceEditor\SourceEditorView.cs" />
<Compile Include="MonoDevelop.SourceEditor\SourceEditorWidget.cs" />
<Compile Include="MonoDevelop.SourceEditor.OptionPanels\BehaviorPanel.cs" />
@@ -141,27 +157,17 @@
<Compile Include="MonoDevelop.SourceEditor\CompileErrorTooltipProvider.cs" />
<Compile Include="MonoDevelop.SourceEditor\DebugValueWindow.cs" />
<Compile Include="MonoDevelop.SourceEditor\DebugValueTooltipProvider.cs" />
- <Compile Include="MonoDevelop.SourceEditor.Extension\TemplateCodon.cs" />
- <Compile Include="MonoDevelop.SourceEditor.Extension\TemplateExtensionNodeLoader.cs" />
- <Compile Include="MonoDevelop.SourceEditor\IdeViMode.cs" />
<Compile Include="gtk-gui\MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs" />
<Compile Include="gtk-gui\MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs" />
<Compile Include="gtk-gui\MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs" />
<Compile Include="gtk-gui\MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel.cs" />
<Compile Include="gtk-gui\MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs" />
<Compile Include="gtk-gui\MonoDevelop.SourceEditor.GotoLineNumberWidget.cs" />
- <Compile Include="MonoDevelop.SourceEditor\StyledSourceEditorOptions.cs" />
- <Compile Include="MonoDevelop.SourceEditor\ISourceEditorOptions.cs" />
- <Compile Include="MonoDevelop.SourceEditor\AutoSave.cs" />
- <Compile Include="MonoDevelop.SourceEditor\SyntaxModeCodon.cs" />
- <Compile Include="MonoDevelop.SourceEditor\SyntaxModeService.cs" />
<Compile Include="MonoDevelop.SourceEditor\Counters.cs" />
- <Compile Include="MonoDevelop.SourceEditor\DynamicAbbrevHandler.cs" />
<Compile Include="MonoDevelop.SourceEditor\PinnedWatchWidget.cs" />
<Compile Include="MonoDevelop.SourceEditor\SourceEditorPrintOperation.cs" />
<Compile Include="MonoDevelop.SourceEditor\PrintSettingsWidget.cs" />
<Compile Include="gtk-gui\MonoDevelop.SourceEditor.PrintSettingsWidget.cs" />
- <Compile Include="MonoDevelop.SourceEditor\MessageBubbleCommands.cs" />
<Compile Include="MonoDevelop.SourceEditor\MessageBubbleTextMarker.cs" />
<Compile Include="MonoDevelop.SourceEditor\MessageBubbleCache.cs" />
<Compile Include="MonoDevelop.SourceEditor.OptionPanels\ColorShemeEditor.cs" />
@@ -171,11 +177,8 @@
<Compile Include="MonoDevelop.SourceEditor.QuickTasks\QuickTaskStrip.cs" />
<Compile Include="MonoDevelop.SourceEditor.QuickTasks\ScrollbarCommand.cs" />
<Compile Include="MonoDevelop.SourceEditor.QuickTasks\ScrollBarMode.cs" />
- <Compile Include="MonoDevelop.SourceEditor.QuickTasks\IQuickTaskProvider.cs" />
- <Compile Include="MonoDevelop.SourceEditor.QuickTasks\QuickTask.cs" />
<Compile Include="MonoDevelop.SourceEditor.QuickTasks\QuickTaskMiniMapMode.cs" />
<Compile Include="MonoDevelop.SourceEditor.QuickTasks\QuickTaskOverviewMode.cs" />
- <Compile Include="MonoDevelop.SourceEditor.QuickTasks\IUsageProvider.cs" />
<Compile Include="MonoDevelop.SourceEditor\FileRegistry.cs" />
<Compile Include="MonoDevelop.SourceEditor\SearchAndReplaceOptions.cs" />
<Compile Include="MonoDevelop.SourceEditor\ErrorText.cs" />
@@ -187,10 +190,34 @@
<Compile Include="MonoDevelop.SourceEditor.OptionPanels\CompletionCharactersPanel.cs" />
<Compile Include="MonoDevelop.SourceEditor\OverlayMessageWindow.cs" />
<Compile Include="MonoDevelop.SourceEditor\HoverCloseButton.cs" />
- <Compile Include="MonoDevelop.SourceEditor.JSon\JSonIndentationTracker.cs" />
- <Compile Include="MonoDevelop.SourceEditor.JSon\JSonIndentEngine.cs" />
- <Compile Include="MonoDevelop.SourceEditor.JSon\JSonTextEditorExtension.cs" />
- <Compile Include="MonoDevelop.SourceEditor\AbstractUsagesExtension.cs" />
+ <Compile Include="MonoDevelop.SourceEditor.Wrappers\DocumentLineWrapper.cs" />
+ <Compile Include="MonoDevelop.SourceEditor.Wrappers\ITextDocumentWrapper.cs" />
+ <Compile Include="MonoDevelop.SourceEditor\TextMarker\UsageSegmentMarker.cs" />
+ <Compile Include="MonoDevelop.SourceEditor\TextMarker\DebugTextMarker.cs" />
+ <Compile Include="MonoDevelop.SourceEditor\EditorFactory.cs" />
+ <Compile Include="MonoDevelop.SourceEditor.Wrappers\TextSourceVersionWrapper.cs" />
+ <Compile Include="MonoDevelop.SourceEditor.Wrappers\TextChangeEventArgsWrapper.cs" />
+ <Compile Include="MonoDevelop.SourceEditor.Wrappers\TextPasteHandlerWrapper.cs" />
+ <Compile Include="MonoDevelop.SourceEditor.Wrappers\SelectionSurroundingProviderWrapper.cs" />
+ <Compile Include="MonoDevelop.SourceEditor.Wrappers\IndentationTrackerWrapper.cs" />
+ <Compile Include="MonoDevelop.SourceEditor\TextMarker\WavedLineMarker.cs" />
+ <Compile Include="MonoDevelop.SourceEditor\TextMarker\GrayOutMarker.cs" />
+ <Compile Include="MonoDevelop.SourceEditor\TextMarker\SmartTagMarker.cs" />
+ <Compile Include="MonoDevelop.SourceEditor\TextMarker\UrlTextLineMarker.cs" />
+ <Compile Include="MonoDevelop.SourceEditor\TextMarker\AsmLineMarker.cs" />
+ <Compile Include="MonoDevelop.SourceEditor\TextMarker\LinkMarker.cs" />
+ <Compile Include="MonoDevelop.SourceEditor\ListDataProviderWrapper.cs" />
+ <Compile Include="MonoDevelop.SourceEditor.Wrappers\TooltipProviderWrapper.cs" />
+ <Compile Include="MonoDevelop.SourceEditor\TextMarker\UnitTestMarker.cs" />
+ <Compile Include="MonoDevelop.SourceEditor.Wrappers\FoldSegmentWrapper.cs" />
+ <Compile Include="MonoDevelop.SourceEditor\StyledSourceEditorOptions.cs" />
+ <Compile Include="MonoDevelop.SourceEditor.Wrappers\SemanticHighlightingSyntaxMode.cs" />
+ <Compile Include="MonoDevelop.SourceEditor.Wrappers\ReadonlyDocumentSnapshot.cs" />
+ <Compile Include="MonoDevelop.SourceEditor\TextMarker\ErrorMarker.cs" />
+ <Compile Include="MonoDevelop.SourceEditor\SyntaxModeLoader.cs" />
+ <Compile Include="MonoDevelop.SourceEditor.Wrappers\ImmutableTextTextSource.cs" />
+ <Compile Include="MonoDevelop.SourceEditor\SearchInSelectionMarker.cs" />
+ <Compile Include="MonoDevelop.SourceEditor\DefaultAutoInsertBracketHandler.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="gtk-gui\gui.stetic">
@@ -199,45 +226,90 @@
<EmbeddedResource Include="MonoDevelop.SourceEditor.addin.xml">
<LogicalName>MonoDevelop.SourceEditor.addin.xml</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="MonoDevelop.SourceEditor\searchoptions.png">
- <LogicalName>searchoptions.png</LogicalName>
- </EmbeddedResource>
<EmbeddedResource Include="icons\issues-busy-16.png">
<LogicalName>issues-busy-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\issues-busy-16%402x.png">
<LogicalName>issues-busy-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\issues-busy-16~dark.png">
+ <LogicalName>issues-busy-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\issues-busy-16~dark%402x.png">
+ <LogicalName>issues-busy-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\issues-error-16.png">
<LogicalName>issues-error-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\issues-error-16%402x.png">
<LogicalName>issues-error-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\issues-error-16~dark.png">
+ <LogicalName>issues-error-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\issues-error-16~dark%402x.png">
+ <LogicalName>issues-error-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\issues-ok-16.png">
<LogicalName>issues-ok-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\issues-ok-16%402x.png">
<LogicalName>issues-ok-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\issues-ok-16~dark.png">
+ <LogicalName>issues-ok-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\issues-ok-16~dark%402x.png">
+ <LogicalName>issues-ok-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\issues-suggestion-16.png">
<LogicalName>issues-suggestion-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\issues-suggestion-16%402x.png">
<LogicalName>issues-suggestion-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\issues-suggestion-16~dark.png">
+ <LogicalName>issues-suggestion-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\issues-suggestion-16~dark%402x.png">
+ <LogicalName>issues-suggestion-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\issues-warning-16.png">
<LogicalName>issues-warning-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\issues-warning-16%402x.png">
<LogicalName>issues-warning-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\issues-warning-16~dark.png">
+ <LogicalName>issues-warning-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\issues-warning-16~dark%402x.png">
+ <LogicalName>issues-warning-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-options-22x32.png">
+ <LogicalName>find-options-22x32.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-options-22x32%402x.png">
+ <LogicalName>find-options-22x32@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-options-22x32~dark.png">
+ <LogicalName>find-options-22x32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-options-22x32~dark%402x.png">
+ <LogicalName>find-options-22x32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\gutter-bookmark-15.png">
<LogicalName>gutter-bookmark-15.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\gutter-bookmark-15%402x.png">
<LogicalName>gutter-bookmark-15@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-bookmark-15~dark.png">
+ <LogicalName>gutter-bookmark-15~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-bookmark-15~dark%402x.png">
+ <LogicalName>gutter-bookmark-15~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\gutter-error-15.png">
<LogicalName>gutter-error-15.png</LogicalName>
</EmbeddedResource>
@@ -256,40 +328,126 @@
<EmbeddedResource Include="icons\prefs-markers-rulers-16%402x.png">
<LogicalName>prefs-markers-rulers-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-markers-rulers-16~dark.png">
+ <LogicalName>prefs-markers-rulers-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-markers-rulers-16~dark%402x.png">
+ <LogicalName>prefs-markers-rulers-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-markers-rulers-16~sel.png">
+ <LogicalName>prefs-markers-rulers-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-markers-rulers-16~sel%402x.png">
+ <LogicalName>prefs-markers-rulers-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-markers-rulers-16~dark~sel.png">
+ <LogicalName>prefs-markers-rulers-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-markers-rulers-16~dark~sel%402x.png">
+ <LogicalName>prefs-markers-rulers-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-syntax-highlighting-16.png">
<LogicalName>prefs-syntax-highlighting-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-syntax-highlighting-16%402x.png">
<LogicalName>prefs-syntax-highlighting-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-syntax-highlighting-16~dark.png">
+ <LogicalName>prefs-syntax-highlighting-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-syntax-highlighting-16~dark%402x.png">
+ <LogicalName>prefs-syntax-highlighting-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-syntax-highlighting-16~sel.png">
+ <LogicalName>prefs-syntax-highlighting-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-syntax-highlighting-16~sel%402x.png">
+ <LogicalName>prefs-syntax-highlighting-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-syntax-highlighting-16~dark~sel.png">
+ <LogicalName>prefs-syntax-highlighting-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-syntax-highlighting-16~dark~sel%402x.png">
+ <LogicalName>prefs-syntax-highlighting-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-text-editor-general-16.png">
<LogicalName>prefs-text-editor-general-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-text-editor-general-16%402x.png">
<LogicalName>prefs-text-editor-general-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-text-editor-general-16~dark.png">
+ <LogicalName>prefs-text-editor-general-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-text-editor-general-16~dark%402x.png">
+ <LogicalName>prefs-text-editor-general-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-text-editor-general-16~sel.png">
+ <LogicalName>prefs-text-editor-general-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-text-editor-general-16~sel%402x.png">
+ <LogicalName>prefs-text-editor-general-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-text-editor-general-16~dark~sel.png">
+ <LogicalName>prefs-text-editor-general-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-text-editor-general-16~dark~sel%402x.png">
+ <LogicalName>prefs-text-editor-general-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-text-editor-behavior-16.png">
<LogicalName>prefs-text-editor-behavior-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-text-editor-behavior-16%402x.png">
<LogicalName>prefs-text-editor-behavior-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\prefs-completion-appearance-16.png">
- <LogicalName>prefs-completion-appearance-16.png</LogicalName>
+ <EmbeddedResource Include="icons\prefs-text-editor-behavior-16~dark.png">
+ <LogicalName>prefs-text-editor-behavior-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-text-editor-behavior-16~dark%402x.png">
+ <LogicalName>prefs-text-editor-behavior-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-text-editor-behavior-16~sel.png">
+ <LogicalName>prefs-text-editor-behavior-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-text-editor-behavior-16~sel%402x.png">
+ <LogicalName>prefs-text-editor-behavior-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-text-editor-behavior-16~dark~sel.png">
+ <LogicalName>prefs-text-editor-behavior-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-text-editor-behavior-16~dark~sel%402x.png">
+ <LogicalName>prefs-text-editor-behavior-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-completion-16.png">
+ <LogicalName>prefs-completion-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-completion-16%402x.png">
+ <LogicalName>prefs-completion-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-completion-16~dark.png">
+ <LogicalName>prefs-completion-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-completion-16~dark%402x.png">
+ <LogicalName>prefs-completion-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-completion-16~sel.png">
+ <LogicalName>prefs-completion-16~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\prefs-completion-appearance-16%402x.png">
- <LogicalName>prefs-completion-appearance-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\prefs-completion-16~sel%402x.png">
+ <LogicalName>prefs-completion-16~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\prefs-completion-behavior-16.png">
- <LogicalName>prefs-completion-behavior-16.png</LogicalName>
+ <EmbeddedResource Include="icons\prefs-completion-16~dark~sel.png">
+ <LogicalName>prefs-completion-16~dark~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\prefs-completion-behavior-16%402x.png">
- <LogicalName>prefs-completion-behavior-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\prefs-completion-16~dark~sel%402x.png">
+ <LogicalName>prefs-completion-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Folder Include="MonoDevelop.SourceEditor\" />
<Folder Include="MonoDevelop.SourceEditor.QuickTasks\" />
+ <Folder Include="MonoDevelop.SourceEditor.Wrappers\" />
+ <Folder Include="MonoDevelop.SourceEditor\TextMarker\" />
</ItemGroup>
</Project>
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/AbstractUsagesExtension.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/AbstractUsagesExtension.cs
index b2e4e24551..45ec1def05 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/AbstractUsagesExtension.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/AbstractUsagesExtension.cs
@@ -138,7 +138,7 @@ namespace MonoDevelop.SourceEditor
CancelTooltip ();
var token = tooltipCancelSrc.Token;
- Task.Factory.StartNew (delegate {
+ Task.Run (delegate {
var list = GetReferences (result, token).ToList ();
if (!token.IsCancellationRequested) {
Gtk.Application.Invoke (delegate {
@@ -251,7 +251,7 @@ namespace MonoDevelop.SourceEditor
OnUsagesUpdated (EventArgs.Empty);
}
- public class UsageMarker : TextLineMarker
+ class UsageMarker : TextLineMarker
{
List<UsageSegment> usages = new List<UsageSegment> ();
@@ -312,7 +312,7 @@ namespace MonoDevelop.SourceEditor
lg.AddColorStop (0, colorStyle.Color);
lg.AddColorStop (1, colorStyle.SecondColor);
cr.SetSource (lg);
- cr.RoundedRectangle (@from + 0.5, y + 1.5, to - @from - 1, editor.LineHeight - 2, editor.LineHeight / 4);
+ cr.RoundedRectangle (@from - 0.5, y + 0.5, to - @from + 1, editor.LineHeight - 1, 2);
cr.FillPreserve ();
}
@@ -324,7 +324,7 @@ namespace MonoDevelop.SourceEditor
}
}
- public class UsageSegment
+ class UsageSegment
{
public readonly ReferenceUsageType UsageType;
public readonly TextSegment TextSegment;
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/AutoSave.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/AutoSave.cs
deleted file mode 100644
index c96c5161bb..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/AutoSave.cs
+++ /dev/null
@@ -1,220 +0,0 @@
-//
-// AutoSave.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Threading;
-using MonoDevelop.Core;
-using Gtk;
-
-namespace MonoDevelop.SourceEditor
-{
- static class AutoSave
- {
- //FIXME: is this path a good one? wouldn't it be better to put autosaves beside the files anyway?
- static string autoSavePath = UserProfile.Current.CacheDir.Combine ("AutoSave");
- static bool autoSaveEnabled;
-
- static AutoSave ()
- {
- try {
- if (!Directory.Exists (autoSavePath))
- Directory.CreateDirectory (autoSavePath);
- } catch (Exception e) {
- LoggingService.LogError ("Can't create auto save path:" + autoSavePath +". Auto save is disabled.", e);
- autoSaveEnabled = false;
- return;
- }
- autoSaveEnabled = true;
- StartAutoSaveThread ();
- }
-
- static string GetAutoSaveFileName (string fileName)
- {
- if (fileName == null)
- return null;
- string newFileName = Path.Combine (Path.GetDirectoryName (fileName), Path.GetFileNameWithoutExtension (fileName) + Path.GetExtension (fileName) + "~");
- newFileName = Path.Combine (autoSavePath, newFileName.Replace(',','_').Replace(" ","").Replace (":","").Replace (Path.DirectorySeparatorChar, '_').Replace (Path.AltDirectorySeparatorChar, '_'));
- return newFileName;
- }
-
- public static bool AutoSaveExists (string fileName)
- {
- if (!autoSaveEnabled)
- return false;
- try {
- var autoSaveFilename = GetAutoSaveFileName (fileName);
- bool autoSaveExists = File.Exists (autoSaveFilename);
- if (autoSaveExists) {
- if (File.GetLastWriteTimeUtc (autoSaveFilename) < File.GetLastWriteTimeUtc (fileName)) {
- File.Delete (autoSaveFilename);
- return false;
- }
- }
- return autoSaveExists;
- } catch (Exception e) {
- LoggingService.LogError ("Error in auto save - disableing.", e);
- DisableAutoSave ();
- return false;
- }
- }
-
- static void CreateAutoSave (string fileName, string content)
- {
- if (!autoSaveEnabled)
- return;
- try {
- // Directory may have removed/unmounted. Therefore this operation is not guaranteed to work.
- string tmpFile = Path.GetTempFileName ();
- File.WriteAllText (tmpFile, content);
-
- var autosaveFileName = GetAutoSaveFileName (fileName);
- if (File.Exists (autosaveFileName))
- File.Delete (autosaveFileName);
- File.Move (tmpFile, autosaveFileName);
- Counters.AutoSavedFiles++;
- } catch (Exception e) {
- LoggingService.LogError ("Error in auto save while creating: " + fileName +". Disableing auto save.", e);
- DisableAutoSave ();
- }
- }
-
-#region AutoSave
- class FileContent
- {
- public string FileName;
- public Mono.TextEditor.TextDocument Content;
-
- public FileContent (string fileName, Mono.TextEditor.TextDocument content)
- {
- this.FileName = fileName;
- this.Content = content;
- }
- }
-
- public static bool Running {
- get {
- return autoSaveThreadRunning;
- }
- }
-
- static readonly AutoResetEvent resetEvent = new AutoResetEvent (false);
- static readonly AutoResetEvent saveEvent = new AutoResetEvent (false);
- static bool autoSaveThreadRunning = false;
- static Thread autoSaveThread;
- static Queue<FileContent> queue = new Queue<FileContent> ();
- static object contentLock = new object ();
-
- static void StartAutoSaveThread ()
- {
- autoSaveThreadRunning = true;
- if (autoSaveThread == null) {
- autoSaveThread = new Thread (AutoSaveThread);
- autoSaveThread.Name = "Autosave";
- autoSaveThread.IsBackground = true;
- autoSaveThread.Start ();
- }
- }
-
- static void AutoSaveThread ()
- {
- while (autoSaveThreadRunning) {
- resetEvent.WaitOne ();
- while (queue.Count > 0) {
- var content = queue.Dequeue ();
- // Don't create an auto save for unsaved files.
- if (string.IsNullOrEmpty (content.FileName))
- continue;
- string text = null;
- bool set = false;
- Application.Invoke (delegate {
- try {
- text = content.Content.Text;
- set = true;
- } catch (Exception e) {
- LoggingService.LogError ("Exception in auto save thread.", e);
- return;
- } finally {
- saveEvent.Set();
- }
- }
- );
- saveEvent.WaitOne ();
- if (set)
- CreateAutoSave (content.FileName, text);
- }
- }
- }
-
- public static string LoadAutoSave (string fileName)
- {
- string autoSaveFileName = GetAutoSaveFileName (fileName);
- return Mono.TextEditor.Utils.TextFileUtility.ReadAllText (autoSaveFileName);
- }
-
- public static void RemoveAutoSaveFile (string fileName)
- {
- if (!autoSaveEnabled)
- return;
- if (AutoSaveExists (fileName)) {
- string autoSaveFileName = GetAutoSaveFileName (fileName);
- try {
- lock (contentLock) {
- File.Delete (autoSaveFileName);
- }
- } catch (Exception e) {
- LoggingService.LogError ("Can't delete auto save file: " + autoSaveFileName +". Disableing auto save.", e);
- DisableAutoSave ();
- }
- }
- }
-
- public static void InformAutoSaveThread (Mono.TextEditor.TextDocument content)
- {
- if (content == null || !autoSaveEnabled)
- return;
- if (content.IsDirty) {
- queue.Enqueue (new FileContent (content.FileName, content));
- resetEvent.Set ();
- } else {
- RemoveAutoSaveFile (content.FileName);
- }
- }
-
- public static void DisableAutoSave ()
- {
- autoSaveThreadRunning = false;
- if (autoSaveThread != null) {
- resetEvent.Set ();
- autoSaveThread.Join ();
- autoSaveThread = null;
- }
- autoSaveEnabled = false;
- }
-#endregion
- }
-}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs
index 45dc49b306..203b0280f3 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/CompileErrorTooltipProvider.cs
@@ -26,50 +26,51 @@
//
using System;
-using Mono.TextEditor;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Components;
+using System.Threading.Tasks;
+using System.Threading;
namespace MonoDevelop.SourceEditor
{
-
-
- public class CompileErrorTooltipProvider: TooltipProvider
+ class CompileErrorTooltipProvider: TooltipProvider
{
-
- public CompileErrorTooltipProvider()
+ internal static ExtensibleTextEditor GetExtensibleTextEditor (TextEditor editor)
{
+ var view = editor.GetContent<SourceEditorView> ();
+ if (view == null)
+ return null;
+ return view.TextEditor;
}
#region ITooltipProvider implementation
-
- public override TooltipItem GetItem (Mono.TextEditor.TextEditor editor, int offset)
+ public override Task<TooltipItem> GetItem (TextEditor editor, DocumentContext ctx, int offset, CancellationToken token = default(CancellationToken))
{
- var ed = editor as ExtensibleTextEditor;
+ var ed = GetExtensibleTextEditor (editor);
if (ed == null)
- return null;
+ return Task.FromResult<TooltipItem> (null);
string errorInformation = ed.GetErrorInformationAt (offset);
if (string.IsNullOrEmpty (errorInformation))
- return null;
+ return Task.FromResult<TooltipItem> (null);
- return new TooltipItem (errorInformation, editor.Document.GetLineByOffset (offset));
+ return Task.FromResult (new TooltipItem (errorInformation, editor.GetLineByOffset (offset)));
}
-
- protected override Gtk.Window CreateTooltipWindow (Mono.TextEditor.TextEditor editor, int offset, Gdk.ModifierType modifierState, TooltipItem item)
+
+ public override Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Xwt.ModifierKeys modifierState)
{
- LanguageItemWindow result = new LanguageItemWindow ((ExtensibleTextEditor) editor, modifierState, null, (string)item.Item, null);
+ var result = new LanguageItemWindow (GetExtensibleTextEditor (editor), modifierState, null, (string)item.Item, null);
if (result.IsEmpty)
return null;
return result;
}
- protected override void GetRequiredPosition (Mono.TextEditor.TextEditor editor, Gtk.Window tipWindow, out int requiredWidth, out double xalign)
+ public override void GetRequiredPosition (TextEditor editor, Control tipWindow, out int requiredWidth, out double xalign)
{
- LanguageItemWindow win = (LanguageItemWindow) tipWindow;
- requiredWidth = win.SetMaxWidth (win.Screen.Width);
+ var win = (LanguageItemWindow) tipWindow;
+ requiredWidth = win.SetMaxWidth (win.Screen.Width / 4);
xalign = 0.5;
}
-
#endregion
-
}
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/Counters.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/Counters.cs
index 5d26f8797e..e55ef141ff 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/Counters.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/Counters.cs
@@ -34,6 +34,5 @@ namespace MonoDevelop.SourceEditor
public static Counter EditorsInMemory = InstrumentationService.CreateCounter ("Editors in Memory", "Text Editor");
public static Counter SourceViewsInMemory = InstrumentationService.CreateCounter ("Source Views in Memory", "Text Editor");
public static Counter LoadedEditors = InstrumentationService.CreateCounter ("Loaded Editors", "Text Editor");
- public static Counter AutoSavedFiles = InstrumentationService.CreateCounter ("Autosaved Files", "Text Editor");
}
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs
index 0445b5c58c..efd7a03a36 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueTooltipProvider.cs
@@ -29,29 +29,31 @@
using System;
using System.Collections.Generic;
-using Mono.TextEditor;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Debugger;
using MonoDevelop.Components;
using Mono.Debugging.Client;
-using TextEditor = Mono.TextEditor.TextEditor;
+
+using ICSharpCode.NRefactory.TypeSystem;
+using ICSharpCode.NRefactory.Semantics;
+using ICSharpCode.NRefactory.CSharp;
+using ICSharpCode.NRefactory.CSharp.TypeSystem;
+using ICSharpCode.NRefactory.CSharp.Resolver;
+using MonoDevelop.Ide.Editor;
+using System.Threading.Tasks;
+using System.Threading;
namespace MonoDevelop.SourceEditor
{
- public class DebugValueTooltipProvider: TooltipProvider, IDisposable
+ class DebugValueTooltipProvider: TooltipProvider
{
DebugValueWindow tooltip;
public DebugValueTooltipProvider ()
{
DebuggingService.CurrentFrameChanged += CurrentFrameChanged;
- DebuggingService.DebugSessionStarted += DebugSessionStarted;
- }
-
- void DebugSessionStarted (object sender, EventArgs e)
- {
- DebuggingService.DebuggerSession.TargetExited += TargetProcessExited;
+ DebuggingService.StoppedEvent += TargetProcessExited;
}
void CurrentFrameChanged (object sender, EventArgs e)
@@ -70,9 +72,10 @@ namespace MonoDevelop.SourceEditor
#region ITooltipProvider implementation
- public override TooltipItem GetItem (TextEditor editor, int offset)
+
+ public override async Task<TooltipItem> GetItem (TextEditor editor, DocumentContext ctx, int offset, CancellationToken token = default(CancellationToken))
{
- if (offset >= editor.Document.TextLength)
+ if (offset >= editor.Length)
return null;
if (!DebuggingService.IsDebugging || DebuggingService.IsRunning)
@@ -82,7 +85,9 @@ namespace MonoDevelop.SourceEditor
if (frame == null)
return null;
- var ed = (ExtensibleTextEditor) editor;
+ var ed = CompileErrorTooltipProvider.GetExtensibleTextEditor (editor);
+ if (ed == null)
+ return null;
string expression = null;
int startOffset;
@@ -90,20 +95,22 @@ namespace MonoDevelop.SourceEditor
startOffset = ed.SelectionRange.Offset;
expression = ed.SelectedText;
} else {
- var doc = IdeApp.Workbench.ActiveDocument;
+ var doc = ctx;
if (doc == null || doc.ParsedDocument == null)
return null;
var resolver = doc.GetContent<IDebuggerExpressionResolver> ();
- var data = editor.GetTextEditorData ();
+ var data = doc.GetContent<SourceEditorView> ();
if (resolver != null) {
- expression = resolver.ResolveExpression (data, doc, offset, out startOffset);
+ var result = await resolver.ResolveExpressionAsync (editor, doc, offset, token);
+ expression = result.Text;
+ startOffset = result.Span.Start;
} else {
- int endOffset = data.FindCurrentWordEnd (offset);
- startOffset = data.FindCurrentWordStart (offset);
+ int endOffset = data.GetTextEditorData ().FindCurrentWordEnd (offset);
+ startOffset = data.GetTextEditorData ().FindCurrentWordStart (offset);
- expression = data.GetTextAt (startOffset, endOffset - startOffset);
+ expression = editor.GetTextAt (startOffset, endOffset - startOffset);
}
}
@@ -123,40 +130,42 @@ namespace MonoDevelop.SourceEditor
return new TooltipItem (val, startOffset, expression.Length);
}
-
- public override Gtk.Window ShowTooltipWindow (TextEditor editor, int offset, Gdk.ModifierType modifierState, int mouseX, int mouseY, TooltipItem item)
+
+ public override Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Xwt.ModifierKeys modifierState)
+ {
+ return new DebugValueWindow (editor, offset, DebuggingService.CurrentFrame, (ObjectValue) item.Item, null);
+ }
+
+ public override void ShowTooltipWindow (TextEditor editor, Control tipWindow, TooltipItem item, Xwt.ModifierKeys modifierState, int mouseX, int mouseY)
{
- var location = editor.OffsetToLocation (item.ItemSegment.Offset);
+ var location = editor.OffsetToLocation (item.Offset);
var point = editor.LocationToPoint (location);
int lineHeight = (int) editor.LineHeight;
- int y = point.Y;
+ int y = (int)point.Y;
// find the top of the line that the mouse is hovering over
while (y + lineHeight < mouseY)
y += lineHeight;
var caret = new Gdk.Rectangle (mouseX, y, 1, lineHeight);
- tooltip = new DebugValueWindow (editor, offset, DebuggingService.CurrentFrame, (ObjectValue) item.Item, null);
+ tooltip = (DebugValueWindow)tipWindow;
tooltip.ShowPopup (editor, caret, PopupPosition.TopLeft);
-
- return tooltip;
}
- public override bool IsInteractive (TextEditor editor, Gtk.Window tipWindow)
+ public override bool IsInteractive (TextEditor editor, Control tipWindow)
{
return DebuggingService.IsDebugging;
}
#endregion
- #region IDisposable implementation
- public void Dispose ()
+ public override void Dispose ()
{
+ if (IsDisposed)
+ return;
DebuggingService.CurrentFrameChanged -= CurrentFrameChanged;
- DebuggingService.DebugSessionStarted -= DebugSessionStarted;
- if (DebuggingService.DebuggerSession != null)
- DebuggingService.DebuggerSession.TargetExited -= TargetProcessExited;
+ DebuggingService.StoppedEvent -= TargetProcessExited;
+ base.Dispose ();
}
- #endregion
}
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs
index 0c50ed2d0b..211578084c 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DebugValueWindow.cs
@@ -34,10 +34,11 @@ using Gtk;
using Mono.TextEditor;
using Gdk;
using MonoDevelop.Ide;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.SourceEditor
{
- public class BaseWindow : Gtk.Window
+ class BaseWindow : Gtk.Window
{
public BaseWindow () : base (Gtk.WindowType.Toplevel)
{
@@ -64,20 +65,51 @@ namespace MonoDevelop.SourceEditor
}
}
- public class DebugValueWindow : PopoverWindow
+ class DebugValueWindow : PopoverWindow
{
ObjectValueTreeView tree;
ScrolledWindow sw;
- public DebugValueWindow (Mono.TextEditor.TextEditor editor, int offset, StackFrame frame, ObjectValue value, PinnedWatch watch) : base (Gtk.WindowType.Toplevel)
+ static readonly string innerTreeName = "MonoDevelop.SourceEditor.DebugValueWindow.ObjectValueTreeView";
+ static string currentBgColor;
+
+ static DebugValueWindow ()
+ {
+ UpdateTreeStyle (Ide.Gui.Styles.PopoverWindow.DefaultBackgroundColor.ToCairoColor ());
+ Ide.Gui.Styles.Changed += (sender, e) => UpdateTreeStyle (Ide.Gui.Styles.PopoverWindow.DefaultBackgroundColor.ToCairoColor ());
+ }
+
+ static void UpdateTreeStyle (Cairo.Color newBgColor)
+ {
+ string oddRowColor, bgColor;
+
+ bgColor = CairoExtensions.ColorGetHex (newBgColor);
+ if (bgColor == currentBgColor)
+ return;
+
+ if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light)
+ oddRowColor = CairoExtensions.ColorGetHex (newBgColor.AddLight (-0.02));
+ else
+ oddRowColor = CairoExtensions.ColorGetHex (newBgColor.AddLight (-0.02));
+
+ string rc = "style \"" + innerTreeName + "\" = \"treeview\" {\n";
+ rc += string.Format ("GtkTreeView::odd-row-color = \"{0}\"\n", oddRowColor);
+ rc += string.Format ("base[NORMAL] = \"{0}\"\n", bgColor);
+ rc += "\n}\n";
+ rc += string.Format ("widget \"*.{0}\" style \"{0}\" ", innerTreeName);
+
+ Rc.ParseString (rc);
+ currentBgColor = bgColor;
+ }
+
+ public DebugValueWindow (TextEditor editor, int offset, StackFrame frame, ObjectValue value, PinnedWatch watch) : base (Gtk.WindowType.Toplevel)
{
this.TypeHint = WindowTypeHint.PopupMenu;
this.AllowShrink = false;
this.AllowGrow = false;
this.Decorated = false;
- TransientFor = (Gtk.Window)editor.Toplevel;
-
+ TransientFor = (Gtk.Window) (editor.GetNativeWidget <Gtk.Widget> ()).Toplevel;
// Avoid getting the focus when the window is shown. We'll get it when the mouse enters the window
AcceptFocus = false;
@@ -85,7 +117,10 @@ namespace MonoDevelop.SourceEditor
sw.HscrollbarPolicy = PolicyType.Never;
sw.VscrollbarPolicy = PolicyType.Never;
+ UpdateTreeStyle (Theme.BackgroundColor);
tree = new ObjectValueTreeView ();
+ tree.Name = innerTreeName;
+
sw.Add (tree);
ContentBox.Add (sw);
@@ -97,31 +132,49 @@ namespace MonoDevelop.SourceEditor
tree.AllowPinning = true;
tree.RootPinAlwaysVisible = true;
tree.PinnedWatch = watch;
- DocumentLocation location = editor.Document.OffsetToLocation (offset);
+ var location = editor.OffsetToLocation (offset);
tree.PinnedWatchLine = location.Line;
- tree.PinnedWatchFile = ((ExtensibleTextEditor)editor).View.ContentName;
+ tree.PinnedWatchFile = editor.FileName;
tree.AddValue (value);
tree.Selection.UnselectAll ();
tree.SizeAllocated += OnTreeSizeChanged;
- tree.PinStatusChanged += delegate {
- Destroy ();
- };
+ tree.PinStatusChanged += OnPinStatusChanged;
sw.ShowAll ();
- tree.StartEditing += delegate {
- Modal = true;
- };
-
- tree.EndEditing += delegate {
- Modal = false;
- };
+ tree.StartEditing += OnStartEditing;
+ tree.EndEditing += OnEndEditing;
ShowArrow = true;
Theme.CornerRadius = 3;
}
+ void OnStartEditing (object sender, EventArgs args)
+ {
+ Modal = true;
+ }
+
+ void OnEndEditing (object sender, EventArgs args)
+ {
+ Modal = false;
+ }
+
+ void OnPinStatusChanged (object sender, EventArgs args)
+ {
+ Destroy ();
+ }
+
+ protected override void OnDestroyed ()
+ {
+ tree.StartEditing -= OnStartEditing;
+ tree.EndEditing -= OnEndEditing;
+ tree.PinStatusChanged -= OnPinStatusChanged;
+ tree.SizeAllocated -= OnTreeSizeChanged;
+
+ base.OnDestroyed ();
+ }
+
protected override bool OnEnterNotifyEvent (EventCrossing evnt)
{
if (!AcceptFocus)
@@ -167,11 +220,12 @@ namespace MonoDevelop.SourceEditor
this.GetPosition (out x, out y);
oldY = y;
- Gdk.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtPoint (x, y));
+ Xwt.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen.Number, Screen.GetMonitorAtPoint (x, y));
+ int top = (int)geometry.Top;
if (allocation.Height <= geometry.Height && y + allocation.Height >= geometry.Y + geometry.Height - edgeGap)
- y = geometry.Top + (geometry.Height - allocation.Height - edgeGap);
- if (y < geometry.Top + edgeGap)
- y = geometry.Top + edgeGap;
+ y = top + ((int)geometry.Height - allocation.Height - edgeGap);
+ if (y < top + edgeGap)
+ y = top + edgeGap;
if (y != oldY) {
Move (x, y);
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DefaultAutoInsertBracketHandler.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DefaultAutoInsertBracketHandler.cs
new file mode 100644
index 0000000000..6298c61340
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DefaultAutoInsertBracketHandler.cs
@@ -0,0 +1,108 @@
+//
+// DefaultAutoInsertBracketHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Mono.TextEditor.Highlighting;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Extension;
+
+namespace MonoDevelop.SourceEditor
+{
+ class DefaultAutoInsertBracketHandler : AutoInsertBracketHandler
+ {
+ const string openBrackets = "{[('\"";
+ const string closingBrackets = "}])'\"";
+
+ public override bool CanHandle (TextEditor editor)
+ {
+ return true;
+ }
+
+ public override bool Handle (TextEditor editor, DocumentContext ctx, KeyDescriptor descriptor)
+ {
+ int braceIndex = openBrackets.IndexOf (descriptor.KeyChar);
+ if (braceIndex < 0)
+ return false;
+
+ var extEditor = ((SourceEditorView)editor.Implementation).SourceEditorWidget.TextEditor;
+
+ var line = extEditor.Document.GetLine (extEditor.Caret.Line);
+ if (line == null)
+ return false;
+
+ bool inStringOrComment = false;
+
+ var stack = line.StartSpan.Clone ();
+ var sm = extEditor.Document.SyntaxMode as SyntaxMode;
+ if (sm != null)
+ // extEditor.Caret.Offset - 1 means we care if we were inside string
+ // before typing current char
+ Mono.TextEditor.Highlighting.SyntaxModeService.ScanSpans (extEditor.Document, sm, sm, stack, line.Offset, extEditor.Caret.Offset - 1);
+ foreach (var span in stack) {
+ if (string.IsNullOrEmpty (span.Color))
+ continue;
+ if (span.Color.StartsWith ("String", StringComparison.Ordinal) ||
+ span.Color.StartsWith ("Comment", StringComparison.Ordinal) ||
+ span.Color.StartsWith ("Xml Attribute Value", StringComparison.Ordinal)) {
+ inStringOrComment = true;
+ break;
+ }
+ }
+ char insertionChar = '\0';
+ bool insertMatchingBracket = false;
+ if (!inStringOrComment) {
+ char closingBrace = closingBrackets [braceIndex];
+ char openingBrace = openBrackets [braceIndex];
+
+ int count = 0;
+ foreach (char curCh in ExtensibleTextEditor.GetTextWithoutCommentsAndStrings(extEditor.Document, 0, extEditor.Document.TextLength)) {
+ if (curCh == openingBrace) {
+ count++;
+ } else if (curCh == closingBrace) {
+ count--;
+ }
+ }
+
+ if (count >= 0) {
+ insertMatchingBracket = true;
+ insertionChar = closingBrace;
+ }
+ }
+
+ if (insertMatchingBracket) {
+ using (var undo = editor.OpenUndoGroup ()) {
+ editor.EnsureCaretIsNotVirtual ();
+ editor.InsertAtCaret (insertionChar.ToString ());
+ editor.CaretOffset--;
+ editor.StartSession (new SkipCharSession (insertionChar));
+ }
+ return true;
+ }
+
+ return false;
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DynamicAbbrevHandler.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DynamicAbbrevHandler.cs
deleted file mode 100644
index db50031bb3..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/DynamicAbbrevHandler.cs
+++ /dev/null
@@ -1,195 +0,0 @@
-//
-// DynamicAbbrevHandler.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System.Linq;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.Ide.Gui;
-using System.Collections.Generic;
-using MonoDevelop.Ide;
-
-namespace MonoDevelop.SourceEditor
-{
- public class DynamicAbbrevHandler : CommandHandler
- {
- enum AbbrevState {
- SearchBackward,
- SearchForward,
- SearchOtherBuffers,
- CycleThroughFoundWords
- }
-
- static SourceEditorView lastView = null;
- static string lastAbbrev = null;
- static int lastTriggerOffset = 0;
- static int lastInsertPos = 0;
- static List<string> foundWords = new List<string> ();
- static int lastStartOffset = 0;
- static AbbrevState curState;
-
- protected override void Run (object data)
- {
- MonoDevelop.Ide.Gui.Document doc = IdeApp.Workbench.ActiveDocument;
- if (doc == null)
- return;
- SourceEditorView view = IdeApp.Workbench.ActiveDocument.GetContent<SourceEditorView> ();
- if (view == null)
- return;
-
- string abbrevWord;
- int offset;
- int startOffset;
-
- if (lastView == view && view.TextEditor.Caret.Offset == lastTriggerOffset) {
- abbrevWord = lastAbbrev;
- offset = lastStartOffset;
- } else {
- abbrevWord = GetWordBeforeCaret (view.TextEditor);
- lastAbbrev = abbrevWord;
- offset = view.TextEditor.Caret.Offset - abbrevWord.Length - 1;
- lastInsertPos = lastTriggerOffset = offset + 1;
- foundWords.Clear ();
- foundWords.Add (abbrevWord);
- curState = AbbrevState.SearchBackward;
- }
-
- lastView = view;
- switch (curState) {
- case AbbrevState.SearchBackward:
- while (offset > 0) {
- if (IsMatchAt (view, offset, abbrevWord)) {
- int endOffset = SearchEndPos (offset, view);
- string curWord = view.TextEditor.Document.GetTextBetween (offset, endOffset);
- if (foundWords.Contains (curWord)) {
- offset--;
- continue;
- }
- foundWords.Add (curWord);
- ReplaceWord (view, curWord);
- lastStartOffset = offset - 1;
- return;
- }
- offset--;
- }
- offset = view.TextEditor.Caret.Offset;
- curState = AbbrevState.SearchForward;
- goto case AbbrevState.SearchForward;
- case AbbrevState.SearchForward:
- while (offset < view.TextEditor.Document.TextLength) {
- if (IsMatchAt (view, offset, abbrevWord)) {
- int endOffset = SearchEndPos (offset, view);
- string curWord = view.TextEditor.Document.GetTextBetween (offset, endOffset);
- if (foundWords.Contains (curWord)) {
- offset++;
- continue;
- }
- foundWords.Add (curWord);
- ReplaceWord (view, curWord);
- lastStartOffset = offset + 1;
- return;
- }
- offset++;
- }
- curState = AbbrevState.SearchOtherBuffers;
- goto case AbbrevState.SearchOtherBuffers;
- case AbbrevState.SearchOtherBuffers:
- foreach (Document curDoc in IdeApp.Workbench.Documents) {
- SourceEditorView otherView = curDoc.GetContent<SourceEditorView> ();
- if (curDoc == doc || otherView == null || otherView.Document == null)
- continue;
- for (int i = 0; i < otherView.Document.TextLength; i++) {
- if (IsMatchAt (otherView, i, abbrevWord)) {
- int endOffset = SearchEndPos (i, otherView);
- string curWord = otherView.TextEditor.Document.GetTextBetween (i, endOffset);
- if (foundWords.Contains (curWord))
- continue;
- foundWords.Add (curWord);
- }
- }
- }
- curState = AbbrevState.CycleThroughFoundWords;
- goto case AbbrevState.CycleThroughFoundWords;
- case AbbrevState.CycleThroughFoundWords:
- int index = foundWords.IndexOf (view.TextEditor.Document.GetTextAt (lastInsertPos, view.TextEditor.Caret.Offset - lastInsertPos));
- if (index < 0)
- break;
- startOffset = offset;
- offset = startOffset + foundWords[index].Length;
- index = (index + foundWords.Count + 1) % foundWords.Count;
- ReplaceWord (view, foundWords[index]);
- break;
- }
- }
-
- public static bool IsIdentifierPart (char ch)
- {
- return char.IsLetterOrDigit (ch) || ch == '_';
- }
-
- static string GetWordBeforeCaret (MonoDevelop.SourceEditor.ExtensibleTextEditor editor)
- {
- int startOffset = editor.Caret.Offset;
- int offset = startOffset - 1;
- while (offset > 0) {
- char ch = editor.Document.GetCharAt (offset);
- if (!IsIdentifierPart (ch)) {
- offset++;
- break;
- }
- offset--;
- }
- if (offset >= startOffset)
- return "";
- return editor.Document.GetTextBetween (offset, startOffset);
- }
-
- static void ReplaceWord (MonoDevelop.SourceEditor.SourceEditorView view, string curWord)
- {
- view.TextEditor.Replace (lastInsertPos, view.TextEditor.Caret.Offset - lastInsertPos, curWord);
- view.TextEditor.Document.CommitLineUpdate (view.TextEditor.Caret.Line);
- lastTriggerOffset = view.TextEditor.Caret.Offset;
- }
-
- static int SearchEndPos (int offset, MonoDevelop.SourceEditor.SourceEditorView view)
- {
- while (offset < view.TextEditor.Document.TextLength && IsIdentifierPart (view.TextEditor.Document.GetCharAt (offset))) {
- offset++;
- }
- return offset;
- }
-
- static bool IsMatchAt (MonoDevelop.SourceEditor.SourceEditorView view, int offset, string abbrevWord)
- {
- if (offset + abbrevWord.Length >= view.TextEditor.Document.TextLength)
- return false;
- if (offset > 0 && IsIdentifierPart (view.TextEditor.Document.GetCharAt (offset - 1)))
- return false;
- if (offset + abbrevWord.Length < view.TextEditor.Document.TextLength && !IsIdentifierPart (view.TextEditor.Document.GetCharAt (offset + abbrevWord.Length)))
- return false;
- return view.TextEditor.Document.GetTextAt (offset, abbrevWord.Length) == abbrevWord;
- }
- }
-}
- \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/EditActions.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/EditActions.cs
index f126440083..bda75e6a0a 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/EditActions.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/EditActions.cs
@@ -29,7 +29,7 @@ using System.Linq;
namespace MonoDevelop.SourceEditor
{
- public class TabAction
+ class TabAction
{
ExtensibleTextEditor editor;
@@ -72,7 +72,7 @@ namespace MonoDevelop.SourceEditor
static void RemoveCharBeforCaret (TextEditorData data)
{
- if (!data.IsSomethingSelected && ((ISourceEditorOptions)data.Options).AutoInsertMatchingBracket) {
+ if (!data.IsSomethingSelected && MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.AutoInsertMatchingBracket) {
if (data.Caret.Offset > 0) {
var line = data.GetLine (data.Caret.Line);
var stack = line.StartSpan.Clone();
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/EditorFactory.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/EditorFactory.cs
new file mode 100644
index 0000000000..eba8185a7d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/EditorFactory.cs
@@ -0,0 +1,87 @@
+//
+// EditorFactory.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.SourceEditor.Wrappers;
+using Mono.TextEditor;
+using Mono.TextEditor.Highlighting;
+
+namespace MonoDevelop.SourceEditor
+{
+ sealed class EditorFactory : ITextEditorFactory
+ {
+
+ #region ITextEditorFactory implementation
+
+ ITextDocument ITextEditorFactory.CreateNewDocument ()
+ {
+ return new TextDocumentWrapper (new TextDocument ());
+ }
+
+ ITextDocument ITextEditorFactory.CreateNewDocument (MonoDevelop.Core.Text.ITextSource textSource, string fileName, string mimeType)
+ {
+ return new TextDocumentWrapper (new TextDocument (textSource.Text) {
+ Encoding = textSource.Encoding,
+ UseBom = textSource.UseBOM,
+ MimeType = mimeType,
+ FileName = fileName
+ });
+ }
+
+ IReadonlyTextDocument ITextEditorFactory.CreateNewReadonlyDocument (MonoDevelop.Core.Text.ITextSource textSource, string fileName, string mimeType)
+ {
+ return new TextDocumentWrapper (new TextDocument (textSource.Text) {
+ Encoding = textSource.Encoding,
+ UseBom = textSource.UseBOM,
+ ReadOnly = true,
+ MimeType = mimeType,
+ FileName = fileName
+ });
+ }
+
+ ITextEditorImpl ITextEditorFactory.CreateNewEditor ()
+ {
+ return new SourceEditorView ();
+ }
+
+ ITextEditorImpl ITextEditorFactory.CreateNewEditor (IReadonlyTextDocument document)
+ {
+ return new SourceEditorView (document);
+ }
+
+ string[] ITextEditorFactory.GetSyntaxProperties (string mimeType, string name)
+ {
+ var mode = SyntaxModeService.GetSyntaxMode (null, mimeType);
+ if (mode == null)
+ return null;
+ System.Collections.Generic.List<string> value;
+ if (!mode.Properties.TryGetValue (name, out value))
+ return null;
+ return value.ToArray ();
+ }
+ #endregion
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ErrorText.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ErrorText.cs
index dadd156bd5..53219debb7 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ErrorText.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ErrorText.cs
@@ -38,13 +38,13 @@ using MonoDevelop.Components;
namespace MonoDevelop.SourceEditor
{
- public class ErrorText
+ class ErrorText
{
- public Task Task { get; set; }
+ public TaskListEntry Task { get; set; }
public bool IsError { get; set; }
public string ErrorMessage { get; set; }
- public ErrorText (Task task, bool isError, string errorMessage)
+ public ErrorText (TaskListEntry task, bool isError, string errorMessage)
{
this.Task = task;
this.IsError = isError;
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs
index 84b2484b64..5d0098dd5f 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs
@@ -1,4 +1,4 @@
-// ExtendibleTextEditor.cs
+// ExtendibleTextEditor.cs
//
// Author:
// Mike Krüger <mkrueger@novell.com>
@@ -41,36 +41,89 @@ using Mono.Addins;
using MonoDevelop.Projects.Text;
using MonoDevelop.Ide;
using MonoDevelop.Ide.CodeFormatting;
-using MonoDevelop.SourceEditor.Extension;
using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
using ICSharpCode.NRefactory.Semantics;
using MonoDevelop.Components;
+using MonoDevelop.Ide.Editor.Extension;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Highlighting;
+using MonoDevelop.SourceEditor.Wrappers;
namespace MonoDevelop.SourceEditor
{
- public class ExtensibleTextEditor : Mono.TextEditor.TextEditor
+ class ExtensibleTextEditor : Mono.TextEditor.MonoTextEditor
{
internal object MemoryProbe = Counters.EditorsInMemory.CreateMemoryProbe ();
SourceEditorView view;
- ExtensionContext extensionContext;
Adjustment cachedHAdjustment, cachedVAdjustment;
- public ITextEditorExtension Extension {
- get;
- set;
+ TextEditorExtension editorExtension;
+ bool needToAddLastExtension;
+
+ public TextEditorExtension EditorExtension {
+ get {
+ return editorExtension;
+ }
+ set {
+ editorExtension = value;
+ needToAddLastExtension = true;
+ }
}
-
- public new ISourceEditorOptions Options {
- get { return (ISourceEditorOptions)base.Options; }
+
+ SemanticHighlighting semanticHighlighting;
+ public SemanticHighlighting SemanticHighlighting {
+ get {
+ return semanticHighlighting;
+ }
+ set {
+ semanticHighlighting = value;
+ UpdateSemanticHighlighting ();
+ }
+ }
+
+ void UpdateSemanticHighlighting ()
+ {
+ var oldSemanticHighighting = Document.SyntaxMode as SemanticHighlightingSyntaxMode;
+
+ if (semanticHighlighting == null) {
+ if (oldSemanticHighighting != null)
+ Document.MimeType = Document.MimeType;
+ } else {
+ if (oldSemanticHighighting == null) {
+ Document.SyntaxMode = new SemanticHighlightingSyntaxMode (this, Document.SyntaxMode, semanticHighlighting);
+ } else {
+ oldSemanticHighighting.UpdateSemanticHighlighting (semanticHighlighting);
+ }
+ }
+ }
+
+ class LastEditorExtension : TextEditorExtension
+ {
+ readonly ExtensibleTextEditor ext;
+ public LastEditorExtension (ExtensibleTextEditor ext)
+ {
+ if (ext == null)
+ throw new ArgumentNullException ("ext");
+ this.ext = ext;
+ }
+
+ public override bool KeyPress (KeyDescriptor descriptor)
+ {
+ var native =(Tuple<Gdk.Key, Gdk.ModifierType>)descriptor.NativeKeyChar;
+ ext.SimulateKeyPress (native.Item1, (uint)descriptor.KeyChar, native.Item2);
+ if (descriptor.SpecialKey == SpecialKey.Escape)
+ return true;
+ return false;
+ }
}
static ExtensibleTextEditor ()
{
var icon = Xwt.Drawing.Image.FromResource ("gutter-bookmark-15.png");
- BookmarkMarker.DrawBookmarkFunc = delegate(TextEditor editor, Cairo.Context cr, DocumentLine lineSegment, double x, double y, double width, double height) {
+ BookmarkMarker.DrawBookmarkFunc = delegate(Mono.TextEditor.MonoTextEditor editor, Cairo.Context cr, DocumentLine lineSegment, double x, double y, double width, double height) {
if (!lineSegment.IsBookmarked)
return;
cr.DrawImage (
@@ -83,14 +136,14 @@ namespace MonoDevelop.SourceEditor
}
- public ExtensibleTextEditor (SourceEditorView view, ISourceEditorOptions options, Mono.TextEditor.TextDocument doc) : base(doc, options)
+ public ExtensibleTextEditor (SourceEditorView view, Mono.TextEditor.ITextEditorOptions options, Mono.TextEditor.TextDocument doc) : base(doc, options)
{
Initialize (view);
}
public ExtensibleTextEditor (SourceEditorView view)
{
- base.Options = new StyledSourceEditorOptions (view.Project, null);
+ base.Options = new StyledSourceEditorOptions (DefaultSourceEditorOptions.Instance);
Initialize (view);
}
@@ -101,53 +154,15 @@ namespace MonoDevelop.SourceEditor
void Initialize (SourceEditorView view)
{
this.view = view;
- Caret.PositionChanged += delegate {
- if (Extension != null) {
- try {
- Extension.CursorPositionChanged ();
- } catch (Exception ex) {
- ReportExtensionError (ex);
- }
- }
+
+ Document.SyntaxModeChanged += delegate {
+ UpdateSemanticHighlighting ();
};
-
- Document.TextReplaced += HandleSkipCharsOnReplace;
UpdateEditMode ();
this.DoPopupMenu = ShowPopup;
}
-
- void HandleSkipCharsOnReplace (object sender, DocumentChangeEventArgs args)
- {
- var skipChars = GetTextEditorData ().SkipChars;
- for (int i = 0; i < skipChars.Count; i++) {
- var sc = skipChars [i];
- if (args.Offset > sc.Offset) {
- skipChars.RemoveAt (i);
- i--;
- continue;
- }
- if (args.Offset <= sc.Offset) {
- sc.Offset += args.ChangeDelta;
- }
- }
- }
-
- public ExtensionContext ExtensionContext {
- get {
- return extensionContext;
- }
- set {
- if (extensionContext != null) {
- extensionContext.RemoveExtensionNodeHandler ("MonoDevelop/SourceEditor2/TooltipProviders", OnTooltipProviderChanged);
- ClearTooltipProviders ();
- }
- extensionContext = value;
- if (extensionContext != null)
- extensionContext.AddExtensionNodeHandler ("MonoDevelop/SourceEditor2/TooltipProviders", OnTooltipProviderChanged);
- }
- }
-
+
static bool? testNewViMode = null;
static bool TestNewViMode {
get {
@@ -159,22 +174,12 @@ namespace MonoDevelop.SourceEditor
void UpdateEditMode ()
{
- if (Options.UseViModes) {
- if (TestNewViMode) {
- if (!(CurrentMode is NewIdeViMode))
- CurrentMode = new NewIdeViMode (this);
- } else {
- if (!(CurrentMode is IdeViMode))
- CurrentMode = new IdeViMode (this);
- }
- } else {
- // if (!(CurrentMode is SimpleEditMode)){
- SimpleEditMode simpleMode = new SimpleEditMode ();
- simpleMode.KeyBindings [EditMode.GetKeyCode (Gdk.Key.Tab)] = new TabAction (this).Action;
- simpleMode.KeyBindings [EditMode.GetKeyCode (Gdk.Key.BackSpace)] = EditActions.AdvancedBackspace;
- CurrentMode = simpleMode;
- // }
- }
+ // if (!(CurrentMode is SimpleEditMode)){
+ SimpleEditMode simpleMode = new SimpleEditMode ();
+ simpleMode.KeyBindings [Mono.TextEditor.EditMode.GetKeyCode (Gdk.Key.Tab)] = new TabAction (this).Action;
+ simpleMode.KeyBindings [Mono.TextEditor.EditMode.GetKeyCode (Gdk.Key.BackSpace)] = EditActions.AdvancedBackspace;
+ CurrentMode = simpleMode;
+ // }
}
void UnregisterAdjustments ()
@@ -187,35 +192,25 @@ namespace MonoDevelop.SourceEditor
cachedVAdjustment = null;
}
+ internal bool IsDestroyed { get; private set; }
+
protected override void OnDestroyed ()
{
+ IsDestroyed = true;
UnregisterAdjustments ();
- Extension = null;
- ExtensionContext = null;
view = null;
+ var disposableSyntaxMode = Document.SyntaxMode as IDisposable;
+ if (disposableSyntaxMode != null) {
+ disposableSyntaxMode.Dispose ();
+ Document.SyntaxMode = null;
+ }
base.OnDestroyed ();
if (Options != null) {
Options.Dispose ();
base.Options = null;
}
}
-
- void OnTooltipProviderChanged (object s, ExtensionNodeEventArgs a)
- {
- TooltipProvider provider;
- try {
- provider = (TooltipProvider) a.ExtensionObject;
- } catch (Exception e) {
- LoggingService.LogError ("Can't create tooltip provider:"+ a.ExtensionNode, e);
- return;
- }
- if (a.Change == ExtensionChange.Add) {
- AddTooltipProvider (provider);
- } else {
- RemoveTooltipProvider (provider);
- }
- }
-
+
public void FireOptionsChange ()
{
this.OptionsChanged (null, null);
@@ -230,6 +225,14 @@ namespace MonoDevelop.SourceEditor
UpdateEditMode ();
base.OptionsChanged (sender, args);
}
+
+ protected override string GetIdeColorStyleName ()
+ {
+ var scheme = Ide.Editor.Highlighting.SyntaxModeService.GetColorStyle (IdeApp.Preferences.ColorScheme);
+ if (!scheme.FitsIdeSkin (IdeApp.Preferences.UserInterfaceSkin))
+ scheme = Ide.Editor.Highlighting.SyntaxModeService.GetDefaultColorStyle (IdeApp.Preferences.UserInterfaceSkin);
+ return scheme.Name;
+ }
bool isInKeyStroke = false;
protected override bool OnKeyPressEvent (Gdk.EventKey evnt)
@@ -255,7 +258,14 @@ namespace MonoDevelop.SourceEditor
{
isInKeyStroke = true;
try {
- return Extension.KeyPress (key, (char)ch, state);
+ if (needToAddLastExtension) {
+ var ext = EditorExtension;
+ while (ext.Next != null)
+ ext = ext.Next;
+ ext.Next = new LastEditorExtension (this);
+ needToAddLastExtension = false;
+ }
+ return EditorExtension.KeyPress (KeyDescriptor.FromGtk (key, (char)ch, state));
} catch (Exception ex) {
ReportExtensionError (ex);
} finally {
@@ -268,17 +278,12 @@ namespace MonoDevelop.SourceEditor
{
LoggingService.LogInternalError ("Error in text editor extension chain", ex);
}
-
- IEnumerable<char> TextWithoutCommentsAndStrings {
- get {
- return from p in GetTextWithoutCommentsAndStrings (Document, 0, Document.TextLength) select p.Key;
- }
- }
-
- static IEnumerable<KeyValuePair <char, int>> GetTextWithoutCommentsAndStrings (Mono.TextEditor.TextDocument doc, int start, int end)
+
+ internal static IEnumerable<char> GetTextWithoutCommentsAndStrings (Mono.TextEditor.TextDocument doc, int start, int end)
{
bool isInString = false, isInChar = false;
bool isInLineComment = false, isInBlockComment = false;
+ int escaping = 0;
for (int pos = start; pos < end; pos++) {
char ch = doc.GetCharAt (pos);
@@ -300,196 +305,121 @@ namespace MonoDevelop.SourceEditor
}
break;
case '"':
- if (!(isInChar || isInLineComment || isInBlockComment))
- isInString = !isInString;
+ if (!(isInChar || isInLineComment || isInBlockComment))
+ if (!isInString || escaping != 1)
+ isInString = !isInString;
break;
case '\'':
- if (!(isInString || isInLineComment || isInBlockComment))
- isInChar = !isInChar;
+ if (!(isInString || isInLineComment || isInBlockComment))
+ if (!isInChar || escaping != 1)
+ isInChar = !isInChar;
+ break;
+ case '\\':
+ if (escaping != 1)
+ escaping = 2;
break;
default :
if (!(isInString || isInChar || isInLineComment || isInBlockComment))
- yield return new KeyValuePair<char, int> (ch, pos);
+ yield return ch;
break;
}
+ escaping--;
}
}
-
-
+
+
protected override bool OnIMProcessedKeyPressEvent (Gdk.Key key, uint ch, Gdk.ModifierType state)
{
bool result = true;
if (key == Gdk.Key.Escape) {
- bool b = Extension != null ? ExtensionKeyPress (key, ch, state) : base.OnIMProcessedKeyPressEvent (key, ch, state);
+ bool b = EditorExtension != null ? ExtensionKeyPress (key, ch, state) : base.OnIMProcessedKeyPressEvent (key, ch, state);
if (b) {
view.SourceEditorWidget.RemoveSearchWidget ();
return true;
}
- return false;
+ return false;
}
if (Document == null)
return true;
- bool inStringOrComment = false;
- bool isString = false;
- DocumentLine line = Document.GetLine (Caret.Line);
- if (line == null)
- return true;
- // string escape = "\"";
- var stack = line.StartSpan.Clone ();
- var sm = Document.SyntaxMode as SyntaxMode;
- if (sm != null)
- Mono.TextEditor.Highlighting.SyntaxModeService.ScanSpans (Document, sm, sm, stack, line.Offset, Caret.Offset);
-
- foreach (Span span in stack) {
- if (string.IsNullOrEmpty (span.Color))
- continue;
- if (span.Color.StartsWith ("String", StringComparison.Ordinal) ||
- span.Color.StartsWith ("Comment", StringComparison.Ordinal) ||
- span.Color.StartsWith ("Xml Attribute Value", StringComparison.Ordinal)) {
- //Treat "Xml Attribute Value" as "String" so quotes in SkipChars works in Xml
- if (span.Color.StartsWith ("Comment", StringComparison.Ordinal)) {
- isString = false;
- } else {
- isString = true;
- }
- inStringOrComment = true;
+
+ var oldMode = Caret.IsInInsertMode;
+ bool wasHandled = false;
+ var currentSession = this.view.CurrentSession;
+ if (currentSession != null) {
+ switch (key) {
+ case Gdk.Key.Return:
+ currentSession.BeforeReturn (out wasHandled);
+ break;
+ case Gdk.Key.BackSpace:
+ currentSession.BeforeBackspace (out wasHandled);
+ break;
+ case Gdk.Key.Delete:
+ case Gdk.Key.KP_Delete:
+ currentSession.BeforeDelete (out wasHandled);
+ break;
+ default:
+ currentSession.BeforeType ((char)ch, out wasHandled);
break;
}
}
- // insert template when space is typed (currently disabled - it's annoying).
- bool templateInserted = false;
- //!inStringOrComment && (key == Gdk.Key.space) && DoInsertTemplate ();
- bool returnBetweenBraces = key == Gdk.Key.Return && (state & (Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask)) == Gdk.ModifierType.None && Caret.Offset > 0 && Caret.Offset < Document.TextLength && Document.GetCharAt (Caret.Offset - 1) == '{' && Document.GetCharAt (Caret.Offset) == '}' && !inStringOrComment;
-// int initialOffset = Caret.Offset;
- const string openBrackets = "{[('\"";
- const string closingBrackets = "}])'\"";
- int braceIndex = openBrackets.IndexOf ((char)ch);
- var skipChars = GetTextEditorData ().SkipChars;
- var skipChar = skipChars.Find (sc => sc.Char == (char)ch && sc.Offset == Caret.Offset);
-// bool startedAtomicOperation = false;
-
- // special handling for escape chars inside ' and "
- if (Caret.Offset > 0) {
- char charBefore = Document.GetCharAt (Caret.Offset - 1);
- if (ch == '"') {
- if (!inStringOrComment && charBefore == '"' ||
- isString && charBefore == '\\' ) {
- skipChar = null;
- braceIndex = -1;
- }
- }
- }
- char insertionChar = '\0';
- bool insertMatchingBracket = false;
- IDisposable undoGroup = null;
- if (skipChar == null && Options.AutoInsertMatchingBracket && braceIndex >= 0 && !IsSomethingSelected) {
- if (!inStringOrComment) {
- char closingBrace = closingBrackets [braceIndex];
- char openingBrace = openBrackets [braceIndex];
-
- int count = 0;
- foreach (char curCh in TextWithoutCommentsAndStrings) {
- if (curCh == openingBrace) {
- count++;
- } else if (curCh == closingBrace) {
- count--;
+ if (!wasHandled) {
+ if (EditorExtension != null) {
+ if (!DefaultSourceEditorOptions.Instance.GenerateFormattingUndoStep) {
+ using (var undo = Document.OpenUndoGroup ()) {
+ if (ExtensionKeyPress (key, ch, state))
+ result = base.OnIMProcessedKeyPressEvent (key, ch, state);
}
- }
-
- if (count >= 0) {
- insertMatchingBracket = true;
- insertionChar = closingBrace;
- }
- } else {
- char charBefore = Document.GetCharAt (Caret.Offset - 1);
- if (!inStringOrComment && ch == '"' && charBefore != '\\') {
- insertMatchingBracket = true;
- insertionChar = '"';
- }
- }
- }
-
- //Console.WriteLine (Caret.Offset + "/" + insOff);
- if (insertMatchingBracket)
- undoGroup = Document.OpenUndoGroup ();
-
- var oldMode = Caret.IsInInsertMode;
- if (skipChar != null) {
- Caret.IsInInsertMode = false;
- skipChars.Remove (skipChar);
- }
- if (Extension != null) {
- if (!DefaultSourceEditorOptions.Instance.GenerateFormattingUndoStep) {
- using (var undo = Document.OpenUndoGroup ()) {
+ } else {
if (ExtensionKeyPress (key, ch, state))
result = base.OnIMProcessedKeyPressEvent (key, ch, state);
}
} else {
- if (ExtensionKeyPress (key, ch, state))
- result = base.OnIMProcessedKeyPressEvent (key, ch, state);
+ result = base.OnIMProcessedKeyPressEvent (key, ch, state);
}
- if (returnBetweenBraces)
- HitReturn ();
- } else {
- result = base.OnIMProcessedKeyPressEvent (key, ch, state);
- if (returnBetweenBraces)
- HitReturn ();
- }
- if (skipChar != null) {
- Caret.IsInInsertMode = oldMode;
- }
- if (insertMatchingBracket) {
- GetTextEditorData ().EnsureCaretIsNotVirtual ();
- int offset = Caret.Offset;
- Caret.AutoUpdatePosition = false;
- Insert (offset, insertionChar.ToString ());
- Caret.AutoUpdatePosition = true;
- GetTextEditorData ().SetSkipChar (offset, insertionChar);
- undoGroup.Dispose ();
+ if (currentSession != null) {
+ switch (key) {
+ case Gdk.Key.Return:
+ currentSession.AfterReturn ();
+ break;
+ case Gdk.Key.BackSpace:
+ currentSession.AfterBackspace ();
+ break;
+ case Gdk.Key.Delete:
+ case Gdk.Key.KP_Delete:
+ currentSession.AfterDelete ();
+ break;
+ default:
+ currentSession.AfterType ((char)ch);
+ break;
+ }
+ }
}
- return templateInserted || result;
- }
-
- void HitReturn ()
- {
- int o = Caret.Offset - 1;
- while (o > 0 && char.IsWhiteSpace (GetCharAt (o - 1)))
- o--;
- Caret.Offset = o;
- ExtensionKeyPress (Gdk.Key.Return, (char)0, Gdk.ModifierType.None);
+ return result;
}
-
+
internal string GetErrorInformationAt (int offset)
{
- DocumentLocation location = Document.OffsetToLocation (offset);
+ var location = Document.OffsetToLocation (offset);
DocumentLine line = Document.GetLine (location.Line);
if (line == null)
return null;
- var error = line.Markers.FirstOrDefault (m => m is ErrorMarker) as ErrorMarker;
+
+ var error = Document.GetTextSegmentMarkersAt (offset).OfType<ErrorMarker> ().FirstOrDefault ();
if (error != null) {
- if (error.Info.ErrorType == ErrorType.Warning)
- return GettextCatalog.GetString ("<b>Parser Warning</b>: {0}",
- GLib.Markup.EscapeText (error.Info.Message));
- return GettextCatalog.GetString ("<b>Parser Error</b>: {0}",
- GLib.Markup.EscapeText (error.Info.Message));
+ if (error.Error.ErrorType == MonoDevelop.Ide.TypeSystem.ErrorType.Warning)
+ return GettextCatalog.GetString ("<b>Warning</b>: {0}",
+ GLib.Markup.EscapeText (error.Error.Message));
+ return GettextCatalog.GetString ("<b>Error</b>: {0}",
+ GLib.Markup.EscapeText (error.Error.Message));
}
return null;
}
- internal ParsedDocument ParsedDocument {
- get {
- var doc = IdeApp.Workbench.ActiveDocument;
- if (doc != null)
- return doc.ParsedDocument;
- return null;
- }
- }
-
public MonoDevelop.Projects.Project Project {
get {
var doc = IdeApp.Workbench.ActiveDocument;
@@ -499,12 +429,9 @@ namespace MonoDevelop.SourceEditor
}
}
- int oldOffset = -1;
-
- public ResolveResult GetLanguageItem (int offset, out DomRegion region)
+ public Microsoft.CodeAnalysis.ISymbol GetLanguageItem (int offset, out MonoDevelop.Ide.Editor.DocumentRegion region)
{
- oldOffset = offset;
- region = DomRegion.Empty;
+ region = MonoDevelop.Ide.Editor.DocumentRegion.Empty;
if (textEditorResolverProvider != null) {
return textEditorResolverProvider.GetLanguageItem (view.WorkbenchWindow.Document, offset, out region);
@@ -516,7 +443,7 @@ namespace MonoDevelop.SourceEditor
{
if (IsSomethingSelected) {
var result = GetLanguageItem (Caret.Offset, Document.GetTextAt (SelectionRange));
- if (result != null && !result.IsError)
+ if (result != null)
return CodeTemplateContext.InExpression;
}
return CodeTemplateContext.Standard;
@@ -529,10 +456,8 @@ namespace MonoDevelop.SourceEditor
internal set { this.textEditorResolverProvider = value; }
}
- public ResolveResult GetLanguageItem (int offset, string expression)
+ public Microsoft.CodeAnalysis.ISymbol GetLanguageItem (int offset, string expression)
{
- oldOffset = offset;
-
if (textEditorResolverProvider != null) {
return textEditorResolverProvider.GetLanguageItem (view.WorkbenchWindow.Document, offset, expression);
}
@@ -572,16 +497,29 @@ namespace MonoDevelop.SourceEditor
ParameterInformationWindowManager.HideWindow (null, view);
return base.OnFocusOutEvent (evnt);
}
-
+
+ string menuPath = "/MonoDevelop/SourceEditor2/ContextMenu/Editor";
+
+ internal string ContextMenuPath {
+ get {
+ return menuPath;
+ }
+
+ set {
+ menuPath = value;
+ }
+ }
+
+
void ShowPopup (Gdk.EventButton evt)
{
view.FireCompletionContextChanged ();
CompletionWindowManager.HideWindow ();
ParameterInformationWindowManager.HideWindow (null, view);
HideTooltip ();
- const string menuPath = "/MonoDevelop/SourceEditor2/ContextMenu/Editor";
- var ctx = ExtensionContext ?? AddinManager.AddinEngine;
-
+ if (string.IsNullOrEmpty (menuPath))
+ return;
+ var ctx = view.WorkbenchWindow?.ExtensionContext ?? AddinManager.AddinEngine;
CommandEntrySet cset = IdeApp.CommandService.CreateCommandEntrySet (ctx, menuPath);
if (Platform.IsMac) {
@@ -624,28 +562,15 @@ namespace MonoDevelop.SourceEditor
}
#region Templates
- int FindPrevWordStart (int offset)
- {
- while (--offset >= 0 && !Char.IsWhiteSpace (Document.GetCharAt (offset)))
- ;
- return ++offset;
- }
- public string GetWordBeforeCaret ()
- {
- int offset = this.Caret.Offset;
- int start = FindPrevWordStart (offset);
- return Document.GetTextAt (start, offset - start);
- }
-
public bool IsTemplateKnown ()
{
- string word = GetWordBeforeCaret ();
+ string shortcut = CodeTemplate.GetTemplateShortcutBeforeCaret (EditorExtension.Editor);
bool result = false;
foreach (CodeTemplate template in CodeTemplateService.GetCodeTemplates (Document.MimeType)) {
- if (template.Shortcut == word) {
+ if (template.Shortcut == shortcut) {
result = true;
- } else if (template.Shortcut.StartsWith (word)) {
+ } else if (template.Shortcut.StartsWith (shortcut)) {
result = false;
break;
}
@@ -655,10 +580,10 @@ namespace MonoDevelop.SourceEditor
public bool DoInsertTemplate ()
{
- string word = GetWordBeforeCaret ();
+ string shortcut = CodeTemplate.GetTemplateShortcutBeforeCaret (EditorExtension.Editor);
foreach (CodeTemplate template in CodeTemplateService.GetCodeTemplates (Document.MimeType)) {
- if (template.Shortcut == word) {
- InsertTemplate (template, view.WorkbenchWindow.Document);
+ if (template.Shortcut == shortcut) {
+ InsertTemplate (template, view.WorkbenchWindow.Document.Editor, view.WorkbenchWindow.Document);
return true;
}
}
@@ -666,13 +591,16 @@ namespace MonoDevelop.SourceEditor
}
- internal void InsertTemplate (CodeTemplate template, MonoDevelop.Ide.Gui.Document document)
+ internal void InsertTemplate (CodeTemplate template, MonoDevelop.Ide.Editor.TextEditor editor, MonoDevelop.Ide.Editor.DocumentContext context)
{
- using (var undo = Document.OpenUndoGroup ()) {
- var result = template.InsertTemplateContents (document);
-
- var links = result.TextLinks;
+ using (var undo = editor.OpenUndoGroup ()) {
+ var result = template.InsertTemplateContents (editor, context);
+ var links = result.TextLinks.Select (l => new Mono.TextEditor.TextLink (l.Name) {
+ Links = l.Links.Select (s => new TextSegment (s.Offset, s.Length)).ToList (),
+ IsEditable = l.IsEditable,
+ IsIdentifier = l.IsIdentifier
+ }).ToList ();
var tle = new TextLinkEditMode (this, result.InsertPosition, links);
tle.TextLinkMode = TextLinkMode.General;
if (tle.ShouldStartTextLinkMode) {
@@ -1021,7 +949,7 @@ namespace MonoDevelop.SourceEditor
RunAction (SelectionActions.MovePageUp);
}
- [CommandHandler (MonoDevelop.SourceEditor.SourceEditorCommands.PulseCaret)]
+ [CommandHandler (MonoDevelop.Ide.Commands.TextEditorCommands.PulseCaret)]
internal void OnPulseCaretCommand ()
{
StartCaretPulseAnimation ();
@@ -1052,18 +980,6 @@ namespace MonoDevelop.SourceEditor
RunAction (Mono.TextEditor.Vi.ViActions.Join);
}
}
-
- [CommandHandler (MonoDevelop.Ide.Commands.EditCommands.SortSelectedLines)]
- void SortSelectedLines ()
- {
- RunAction (MiscActions.SortSelectedLines);
- }
-
- [CommandUpdateHandler (MonoDevelop.Ide.Commands.EditCommands.SortSelectedLines)]
- void UpdateSortSelectedLines (CommandInfo ci)
- {
- ci.Enabled = GetTextEditorData ().IsMultiLineSelection;
- }
#endregion
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/FileRegistry.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/FileRegistry.cs
index c7703d4fad..71daa0ec75 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/FileRegistry.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/FileRegistry.cs
@@ -31,6 +31,7 @@ using MonoDevelop.Core;
using Services = MonoDevelop.Projects.Services;
using MonoDevelop.Ide;
using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.SourceEditor
{
@@ -42,22 +43,15 @@ namespace MonoDevelop.SourceEditor
{
readonly static List<SourceEditorView> openFiles = new List<SourceEditorView> ();
readonly static FileSystemWatcher fileSystemWatcher;
- readonly static StringComparison fileNameComparer = Platform.IsWindows ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
-
- public static bool SuspendFileWatch {
- get;
- set;
- }
static FileRegistry ()
{
fileSystemWatcher = new FileSystemWatcher ();
- fileSystemWatcher.Created += (FileSystemEventHandler)DispatchService.GuiDispatch (new FileSystemEventHandler (OnFileChanged));
- fileSystemWatcher.Changed += (FileSystemEventHandler)DispatchService.GuiDispatch (new FileSystemEventHandler (OnFileChanged));
+ fileSystemWatcher.Created += (s, e) => Runtime.RunInMainThread (() => OnFileChanged (s, e));
+ fileSystemWatcher.Changed += (s, e) => Runtime.RunInMainThread (() => OnFileChanged (s, e));
- var fileChanged = DispatchService.GuiDispatch (new EventHandler<FileEventArgs> (HandleFileServiceChange));
- FileService.FileCreated += fileChanged;
- FileService.FileChanged += fileChanged;
+ FileService.FileCreated += HandleFileServiceChange;
+ FileService.FileChanged += HandleFileServiceChange;
}
@@ -79,13 +73,14 @@ namespace MonoDevelop.SourceEditor
static void HandleFileServiceChange (object sender, FileEventArgs e)
{
- // The Ide.Document generates a file service changed event this needs to be skipped.
- if (!TypeSystemService.TrackFileChanges)
- return;
bool foundOneChange = false;
foreach (var file in e) {
+ if (skipFiles.Contains (file.FileName)) {
+ skipFiles.Remove (file.FileName);
+ continue;
+ }
foreach (var view in openFiles) {
- if (SkipView (view) || !string.Equals (view.ContentName, file.FileName, fileNameComparer))
+ if (SkipView (view) || !string.Equals (view.ContentName, file.FileName, FilePath.PathComparison))
continue;
if (!view.IsDirty/* && (IdeApp.Workbench.AutoReloadDocuments || file.AutoReload)*/)
view.SourceEditorWidget.Reload ();
@@ -117,20 +112,22 @@ namespace MonoDevelop.SourceEditor
static void OnFileChanged (object sender, FileSystemEventArgs e)
{
- if (e.ChangeType == WatcherChangeTypes.Changed || e.ChangeType == WatcherChangeTypes.Created)
+ if (e.ChangeType == WatcherChangeTypes.Changed || e.ChangeType == WatcherChangeTypes.Created)
CheckFileChange (e.FullPath);
}
static void CheckFileChange (string fileName)
{
- if (SuspendFileWatch)
+ if (skipFiles.Contains (fileName)) {
+ skipFiles.Remove (fileName);
return;
+ }
var changedViews = new List<SourceEditorView> ();
foreach (var view in openFiles) {
if (SkipView (view))
continue;
- if (string.Equals (view.ContentName, fileName, fileNameComparer)) {
+ if (string.Equals (view.ContentName, fileName, FilePath.PathComparison)) {
if (view.LastSaveTimeUtc == File.GetLastWriteTimeUtc (fileName))
continue;
if (!view.IsDirty/* && IdeApp.Workbench.AutoReloadDocuments*/)
@@ -196,7 +193,7 @@ namespace MonoDevelop.SourceEditor
foreach (var view in openFiles) {
if (SkipView (view) || !view.SourceEditorWidget.HasIncorrectEolMarker)
continue;
-
+
view.SourceEditorWidget.ConvertLineEndings ();
view.SourceEditorWidget.RemoveMessageBar ();
view.WorkbenchWindow.ShowNotification = false;
@@ -225,9 +222,16 @@ namespace MonoDevelop.SourceEditor
foreach (var view in openFiles) {
if (SkipView (view) || !view.SourceEditorWidget.HasIncorrectEolMarker)
continue;
- view.SourceEditorWidget.UpdateEolMarkerMessage(multiple);
+ view.SourceEditorWidget.UpdateEolMarkerMessage (multiple);
}
}
+
+ static List<string> skipFiles = new List<string> ();
+ internal static void SkipNextChange (string fileName)
+ {
+ if (!skipFiles.Contains (fileName))
+ skipFiles.Add (fileName);
+ }
#endregion
}
-}
+}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/GotoLineNumberWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/GotoLineNumberWidget.cs
index b19f1e26ad..ecdf017ea7 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/GotoLineNumberWidget.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/GotoLineNumberWidget.cs
@@ -30,12 +30,13 @@ using System;
using Gtk;
using Mono.TextEditor;
+using MonoDevelop.Components;
namespace MonoDevelop.SourceEditor
{
public partial class GotoLineNumberWidget : Gtk.Bin
{
- readonly TextEditor textEditor;
+ readonly MonoTextEditor textEditor;
readonly Widget frame;
double vSave, hSave;
@@ -45,7 +46,7 @@ namespace MonoDevelop.SourceEditor
void HandleViewTextEditorhandleSizeAllocated (object o, SizeAllocatedArgs args)
{
int newX = textEditor.Allocation.Width - this.Allocation.Width - 8;
- var containerChild = ((TextEditor.EditorContainerChild)textEditor [frame]);
+ var containerChild = ((MonoTextEditor.EditorContainerChild)textEditor [frame]);
if (newX != containerChild.X) {
this.entryLineNumber.WidthRequest = textEditor.Allocation.Width / 4;
containerChild.X = newX;
@@ -58,7 +59,7 @@ namespace MonoDevelop.SourceEditor
Destroy ();
}
- public GotoLineNumberWidget (TextEditor textEditor, Widget frame)
+ public GotoLineNumberWidget (MonoTextEditor textEditor, Widget frame)
{
this.textEditor = textEditor;
this.frame = frame;
@@ -66,14 +67,7 @@ namespace MonoDevelop.SourceEditor
StoreWidgetState ();
textEditor.Parent.SizeAllocated += HandleViewTextEditorhandleSizeAllocated;
-
- //HACK: GTK rendering issue on Mac, images don't repaint unless we put them in visible eventboxes
- if (MonoDevelop.Core.Platform.IsMac) {
- foreach (var eb in new [] { eventbox1, eventbox2 }) {
- eb.VisibleWindow = true;
- eb.ModifyBg (StateType.Normal, new Gdk.Color (230, 230, 230));
- }
- }
+
this.closeButton.Clicked += delegate {
RestoreWidgetState ();
CloseWidget ();
@@ -175,17 +169,15 @@ namespace MonoDevelop.SourceEditor
if (col > 0)
textEditor.Caret.Column = col;
textEditor.CenterToCaret ();
- } catch (System.Exception) { 
+ } catch (System.Exception) {
}
}
-
- internal static readonly Gdk.Color warningColor = new Gdk.Color (210, 210, 32);
- internal static readonly Gdk.Color errorColor = new Gdk.Color (255, 102, 102);
-
+
void PreviewLine ()
{
if (String.IsNullOrEmpty (entryLineNumber.Text) || entryLineNumber.Text == "+" || entryLineNumber.Text == "-") {
this.entryLineNumber.ModifyBase (Gtk.StateType.Normal, Style.Base (Gtk.StateType.Normal));
+ this.entryLineNumber.ModifyText (Gtk.StateType.Normal, Style.Foreground (Gtk.StateType.Normal));
RestoreWidgetState ();
return;
}
@@ -196,11 +188,12 @@ namespace MonoDevelop.SourceEditor
} else {
this.entryLineNumber.ModifyBase (Gtk.StateType.Normal, Style.Base (Gtk.StateType.Normal));
+ this.entryLineNumber.ModifyText (Gtk.StateType.Normal, Style.Foreground (Gtk.StateType.Normal));
}
textEditor.Caret.Line = targetLine;
textEditor.CenterToCaret ();
- } catch (System.Exception) { 
- this.entryLineNumber.ModifyBase (Gtk.StateType.Normal, errorColor);
+ } catch (System.Exception) {
+ this.entryLineNumber.ModifyText (Gtk.StateType.Normal, Ide.Gui.Styles.Editor.SearchErrorForegroundColor.ToGdkColor ());
}
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/HoverCloseButton.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/HoverCloseButton.cs
index 0284769bc6..74da4193b8 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/HoverCloseButton.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/HoverCloseButton.cs
@@ -29,7 +29,7 @@ using Gdk;
namespace MonoDevelop.SourceEditor
{
- public class HoverCloseButton : EventBox
+ class HoverCloseButton : EventBox
{
bool hovered;
@@ -140,6 +140,7 @@ namespace MonoDevelop.SourceEditor
context.Fill ();
// Inset shadow
+ // FIXME: VV: Remove gradient features
using (var lg = new Cairo.LinearGradient (0, center.Y - 5, 0, center.Y)) {
context.Arc (center.X, center.Y + 1, radius, 0, Math.PI * 2);
lg.AddColorStop (0, new Cairo.Color (0, 0, 0, 0.2 * opacity));
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ISourceEditorOptions.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ISourceEditorOptions.cs
deleted file mode 100644
index db013b102d..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ISourceEditorOptions.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// ISourceEditorOptions.cs
-//
-// Author:
-// Michael Hutchinson <mhutchinson@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc. (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-
-using Pango;
-
-using Mono.TextEditor;
-using Mono.TextEditor.Highlighting;
-
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Content;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.CodeCompletion;
-
-namespace MonoDevelop.SourceEditor
-{
- public enum EditorFontType {
- // Default Monospace font as set in the user's GNOME font properties
- DefaultMonospace,
-
- // Default Sans font as set in the user's GNOME font properties
- DefaultSans,
-
- // Custom font, will need to get the FontName property for more specifics
- UserSpecified
- }
-
- public interface ISourceEditorOptions : Mono.TextEditor.ITextEditorOptions
- {
-
- bool EnableAutoCodeCompletion {get; }
- bool DefaultRegionsFolding {get; }
- bool DefaultCommentFolding {get; }
- bool EnableSemanticHighlighting {get; }
- //public bool AutoInsertTemplates {get; }
- bool TabIsReindent {get; }
- bool AutoInsertMatchingBracket {get; }
- bool UnderlineErrors {get; }
- EditorFontType EditorFontType {get; }
- bool UseViModes {get; }
- }
-}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/IdeViMode.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/IdeViMode.cs
deleted file mode 100644
index d7dcbada63..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/IdeViMode.cs
+++ /dev/null
@@ -1,168 +0,0 @@
-//
-// IdeViMode.cs
-//
-// Author:
-// Michael Hutchinson <mhutchinson@novell.com>
-//
-// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Text.RegularExpressions;
-using Mono.TextEditor;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide;
-
-namespace MonoDevelop.SourceEditor
-{
- public class NewIdeViMode : Mono.TextEditor.Vi.NewViEditMode
- {
- public NewIdeViMode (ExtensibleTextEditor editor)
- {
- this.editor = editor;
- }
-
- protected override void HandleKeypress (Gdk.Key key, uint unicodeKey, Gdk.ModifierType modifier)
- {
- base.HandleKeypress (key, unicodeKey, modifier);
- IdeApp.Workbench.StatusBar.ShowMessage (ViEditor.Message);
- }
- }
-
- public class IdeViMode : Mono.TextEditor.Vi.ViEditMode
- {
- new ExtensibleTextEditor editor;
- TabAction tabAction;
-
- public IdeViMode (ExtensibleTextEditor editor)
- {
- this.editor = editor;
- tabAction = new TabAction (editor);
- }
-
- protected override Action<TextEditorData> GetInsertAction (Gdk.Key key, Gdk.ModifierType modifier)
- {
- if (modifier == Gdk.ModifierType.None) {
- switch (key) {
- case Gdk.Key.BackSpace:
- return EditActions.AdvancedBackspace;
- case Gdk.Key.Tab:
- return tabAction.Action;
- }
- }
- return base.GetInsertAction (key, modifier);
- }
-
- protected override string RunExCommand (string command)
- {
- if (':' != command[0] || 2 > command.Length)
- return base.RunExCommand (command);
-
- switch (command[1]) {
- case 'w':
- if (2 < command.Length) {
- switch (command[2]) {
- case 'q': // :wq
- var workbenchWindow = editor.View.WorkbenchWindow;
- workbenchWindow.Document.Save ();
- Gtk.Application.Invoke (delegate {
- workbenchWindow.CloseWindow (false/*, true, -1*/);
- });
- return "Saved and closed file.";
- case '!': // :w!
- editor.View.Save ();
- break;
- default:
- return base.RunExCommand (command);
- }
- }
- else editor.View.WorkbenchWindow.Document.Save ();
- return "Saved file.";
-
- case 'q':
- bool force = false;
- if (2 < command.Length) {
- switch (command[2]) {
- case '!': // :q!
- force = true;
- break;
- default:
- return base.RunExCommand (command);
- }
- }
-
- if (!force && editor.View.IsDirty)
- return "Document has not been saved!";
-
- var window = editor.View.WorkbenchWindow;
- Gtk.Application.Invoke (delegate {
- window.CloseWindow (force);
- });
- return force? "Closed file without saving.": "Closed file.";
-
-
- case 'm':
- if (!Regex.IsMatch (command, "^:mak[e!]", RegexOptions.Compiled))
- break;
- MonoDevelop.Projects.Project proj = editor.View.Project;
- if (proj != null) {
- IdeApp.ProjectOperations.Build (proj);
- return string.Format ("Building project {0}", proj.Name);
- }
- return "File is not part of a project";
- case 'c':
- // Error manipulation
- if (3 == command.Length) {
- switch (command[2]) {
- case 'n':
- // :cn - jump to next error
- IdeApp.CommandService.DispatchCommand (MonoDevelop.Ide.Commands.ViewCommands.ShowNext);
- return string.Empty;
- case 'N':
- case 'p':
- // :c[pN] - jump to previous error
- IdeApp.CommandService.DispatchCommand (MonoDevelop.Ide.Commands.ViewCommands.ShowPrevious);
- return string.Empty;
- }
- }
- break;
- }
-
- return base.RunExCommand (command);
- }
-
- protected override void HandleKeypress (Gdk.Key key, uint unicodeKey, Gdk.ModifierType modifier)
- {
- if (0 != (Gdk.ModifierType.ControlMask & modifier)) {
- switch (key) {
- case Gdk.Key.bracketright:
- // ctrl-] => Go to declaration
- // HACK: since the SourceEditor can't link the Refactoring addin the command is provided as string.
- IdeApp.CommandService.DispatchCommand ("MonoDevelop.Refactoring.RefactoryCommands.GotoDeclaration", MonoDevelop.Components.Commands.CommandSource.Keybinding);
- return;
- }
- }// ctrl+key
-
- base.HandleKeypress (key, unicodeKey, modifier);
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/LanguageItemWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/LanguageItemWindow.cs
index 10172f1446..252786d652 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/LanguageItemWindow.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/LanguageItemWindow.cs
@@ -39,11 +39,11 @@ using ICSharpCode.NRefactory.Semantics;
namespace MonoDevelop.SourceEditor
{
- public class LanguageItemWindow: MonoDevelop.Components.TooltipWindow
+ class LanguageItemWindow: MonoDevelop.Components.TooltipWindow
{
public bool IsEmpty { get; set; }
- public LanguageItemWindow (ExtensibleTextEditor ed, Gdk.ModifierType modifierState, ResolveResult result, string errorInformations, IUnresolvedFile unit)
+ public LanguageItemWindow (ExtensibleTextEditor ed, Xwt.ModifierKeys modifierState, object result, string errorInformations, object unit)
{
string tooltip = null;
if (result is UnknownIdentifierResolveResult) {
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ListDataProviderWrapper.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ListDataProviderWrapper.cs
new file mode 100644
index 0000000000..34d0b8fa5f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ListDataProviderWrapper.cs
@@ -0,0 +1,63 @@
+// SourceEditorView.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using Mono.TextEditor.PopupWindow;
+
+namespace MonoDevelop.SourceEditor
+{
+ class ListDataProviderWrapper : IListDataProvider<string>
+ {
+ MonoDevelop.Ide.CodeTemplates.IListDataProvider<string> dataProvider;
+
+ public ListDataProviderWrapper (MonoDevelop.Ide.CodeTemplates.IListDataProvider<string> dataProvider)
+ {
+ this.dataProvider = dataProvider;
+ }
+
+ #region IListDataProvider implementation
+ Xwt.Drawing.Image IListDataProvider<string>.GetIcon (int index)
+ {
+ return dataProvider.GetIcon (index);
+ }
+
+ string IListDataProvider<string>.GetText (int index)
+ {
+ return dataProvider.GetText (index);
+ }
+
+ int IListDataProvider<string>.Count {
+ get {
+ return dataProvider.Count;
+ }
+ }
+
+ string IListDataProvider<string>.this [int index] {
+ get {
+ return dataProvider[index];
+ }
+ }
+ #endregion
+ }
+
+}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MarkerOperationsHandler.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MarkerOperationsHandler.cs
index 1aab3dd990..ef80c7e016 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MarkerOperationsHandler.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MarkerOperationsHandler.cs
@@ -35,12 +35,12 @@ using MonoDevelop.Ide;
namespace MonoDevelop.SourceEditor
{
- public class MarkerOperationsHandler : CommandHandler
+ class MarkerOperationsHandler : CommandHandler
{
protected override void Run (object data)
{
UrlMarker urlMarker = data as UrlMarker;
- if (data == null)
+ if (urlMarker == null)
return;
try {
if (urlMarker.UrlType == UrlType.Email) {
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs
index c7f1464e68..14ecc77bad 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs
@@ -43,7 +43,7 @@ namespace MonoDevelop.SourceEditor
internal Dictionary<string, LayoutDescriptor> textWidthDictionary = new Dictionary<string, LayoutDescriptor> ();
internal Dictionary<DocumentLine, double> lineWidthDictionary = new Dictionary<DocumentLine, double> ();
- internal TextEditor editor;
+ internal MonoTextEditor editor;
internal Pango.FontDescription fontDescription;
internal Pango.FontDescription tooltipFontDescription;
@@ -51,7 +51,7 @@ namespace MonoDevelop.SourceEditor
public MessageBubbleTextMarker CurrentSelectedTextMarker;
- public MessageBubbleCache (TextEditor editor)
+ public MessageBubbleCache (MonoTextEditor editor)
{
this.editor = editor;
errorPixbuf = Xwt.Drawing.Image.FromResource ("gutter-error-15.png");
@@ -132,7 +132,7 @@ namespace MonoDevelop.SourceEditor
w += (int)cache.warningPixbuf.Width + iconTextSpacing;
requisition.Width = Math.Max (w + textBorder * 2, requisition.Width);
- y += h + verticalTextSpace;
+ y += h + verticalTextSpace - 3;
}
}
@@ -147,7 +147,6 @@ namespace MonoDevelop.SourceEditor
protected override void OnDrawContent (Gdk.EventExpose evnt, Cairo.Context g)
{
- Theme.BorderColor = marker.TooltipColor.Color;
g.Rectangle (0, 0, Allocation.Width, Allocation.Height);
g.SetSourceColor (marker.TooltipColor.Color);
g.Fill ();
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCommands.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCommands.cs
deleted file mode 100644
index 2f28478563..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCommands.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// MessageBubbleCommands.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using MonoDevelop.Ide;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.SourceEditor
-{
- public enum MessageBubbleCommands
- {
- HideIssues,
- ToggleIssues
- }
-
- class HideIssuesHandler : CommandHandler
- {
- protected override void Update (CommandInfo info)
- {
- base.Update (info);
- info.Text = IdeApp.Preferences.DefaultHideMessageBubbles ? GettextCatalog.GetString ("_Show Message Bubbles") : GettextCatalog.GetString ("_Hide Message Bubbles");
- }
-
- protected override void Run (object data)
- {
- IdeApp.Preferences.DefaultHideMessageBubbles = !IdeApp.Preferences.DefaultHideMessageBubbles;
- }
- }
-
- class ToggleIssuesHandler : CommandHandler
- {
- protected override void Run (object data)
- {
- Action action = data as Action;
- if (action != null)
- action ();
- }
-
- protected override void Update (CommandArrayInfo ainfo)
- {
- CommandInfo info = ainfo.Add (GettextCatalog.GetString ("_Errors & Warnings"), new Action (delegate {
- MonoDevelop.Ide.IdeApp.Preferences.ShowMessageBubbles = MonoDevelop.Ide.ShowMessageBubbles.ForErrorsAndWarnings;
- }));
- info.Checked = MonoDevelop.Ide.IdeApp.Preferences.ShowMessageBubbles == MonoDevelop.Ide.ShowMessageBubbles.ForErrorsAndWarnings;
-
- info = ainfo.Add (GettextCatalog.GetString ("E_rrors only"), new Action (delegate {
- MonoDevelop.Ide.IdeApp.Preferences.ShowMessageBubbles = MonoDevelop.Ide.ShowMessageBubbles.ForErrors;
- }));
- info.Checked = MonoDevelop.Ide.IdeApp.Preferences.ShowMessageBubbles == MonoDevelop.Ide.ShowMessageBubbles.ForErrors;
- }
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs
index 7484634970..a6e90c738e 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs
@@ -34,24 +34,26 @@ using MonoDevelop.Ide;
using System.Text.RegularExpressions;
using Mono.TextEditor.Highlighting;
using MonoDevelop.Ide.Fonts;
-using MonoDevelop.Components;
using Gtk;
+using MonoDevelop.Components;
+using MonoDevelop.SourceEditor.Wrappers;
+using MonoDevelop.Core;
namespace MonoDevelop.SourceEditor
{
- class MessageBubbleTextMarker : MarginMarker, IDisposable, IActionTextLineMarker
+ class MessageBubbleTextMarker : MarginMarker, IDisposable, IActionTextLineMarker, MonoDevelop.Ide.Editor.IMessageBubbleLineMarker
{
readonly MessageBubbleCache cache;
internal const int border = 4;
- TextEditor editor {
+ MonoTextEditor editor {
get { return cache.editor;}
}
public override bool IsVisible {
get { return !task.Completed; }
- set { task.Completed = !value; }
+ set { task.Completed = !value; editor.QueueDraw (); }
}
public bool UseVirtualLines { get; set; }
@@ -61,13 +63,20 @@ namespace MonoDevelop.SourceEditor
get { return errors; }
}
- Task task;
- DocumentLine lineSegment;
+ TaskListEntry task;
+ internal TaskListEntry Task {
+ get {
+ return this.task;
+ }
+ }
+
+ TaskListEntry primaryTask;
+
// int editorAllocHeight = -1;
// int lastLineLength = -1;
internal double lastHeight = 0;
- public double GetLineHeight (TextEditor editor)
+ public double GetLineHeight (MonoTextEditor editor)
{
return editor.LineHeight;
/*
@@ -96,8 +105,10 @@ namespace MonoDevelop.SourceEditor
return height;*/
}
- public void SetPrimaryError (string text)
+ public void SetPrimaryError (TaskListEntry task)
{
+ this.primaryTask = task;
+ var text = task.Description;
EnsureLayoutCreated (editor);
var match = mcsErrorFormat.Match (text);
@@ -134,39 +145,47 @@ namespace MonoDevelop.SourceEditor
public override TextLineMarkerFlags Flags {
get {
- if (lineSegment != null && lineSegment.Markers.Any (m => m is DebugTextMarker))
+ if (LineSegment != null && editor.Document.GetTextSegmentMarkersAt (LineSegment).Any (m => m is DebugTextMarker))
return TextLineMarkerFlags.None;
return TextLineMarkerFlags.DrawsSelection;
}
}
- string initialText;
bool isError;
- internal MessageBubbleTextMarker (MessageBubbleCache cache, Task task, DocumentLine lineSegment, bool isError, string errorMessage)
+
+ public MessageBubbleTextMarker (MessageBubbleCache cache)
{
if (cache == null)
throw new ArgumentNullException ("cache");
this.cache = cache;
- this.task = task;
this.IsVisible = true;
- this.lineSegment = lineSegment;
- this.initialText = editor.Document.GetTextAt (lineSegment);
+ }
+
+ internal MessageBubbleTextMarker (MessageBubbleCache cache, TaskListEntry task, bool isError, string errorMessage)
+ {
+ if (cache == null)
+ throw new ArgumentNullException ("cache");
+ this.cache = cache;
+ this.task = task;
this.isError = isError;
AddError (task, isError, errorMessage);
// cache.Changed += (sender, e) => CalculateLineFit (editor, lineSegment);
}
static System.Text.RegularExpressions.Regex mcsErrorFormat = new System.Text.RegularExpressions.Regex ("(.+)\\(CS\\d+\\)\\Z");
- public void AddError (Task task, bool isError, string errorMessage)
+ public void AddError (TaskListEntry task, bool isError, string errorMessage)
{
+ if (this.task == null) {
+ this.task = task;
+ }
var match = mcsErrorFormat.Match (errorMessage);
if (match.Success)
errorMessage = match.Groups [1].Value;
errors.Add (new ErrorText (task, isError, errorMessage));
DisposeLayout ();
}
-
+
public void DisposeLayout ()
{
layouts = null;
@@ -271,7 +290,7 @@ namespace MonoDevelop.SourceEditor
get { return layouts; }
}
- internal void EnsureLayoutCreated (TextEditor editor)
+ internal void EnsureLayoutCreated (MonoTextEditor editor)
{
if (layouts != null)
return;
@@ -332,16 +351,27 @@ namespace MonoDevelop.SourceEditor
}
#region IActionTextMarker implementation
- public bool MousePressed (TextEditor editor, MarginMouseEventArgs args)
+ int curError = 0;
+ public bool MousePressed (MonoTextEditor editor, MarginMouseEventArgs args)
+ {
+ if (bubbleDrawX < args.X && args.X < bubbleDrawX + bubbleWidth) {
+ errors [curError].Task.SelectInPad ();
+ curError = (curError + 1) % errors.Count;
+ return true;
+ }
+ return false;
+ }
+
+ bool IActionTextLineMarker.MouseReleased (MonoTextEditor editor, MarginMouseEventArgs args)
{
return false;
}
- public void MouseHover (TextEditor editor, MarginMouseEventArgs args, TextLineMarkerHoverResult result)
+ public void MouseHover (MonoTextEditor editor, MarginMouseEventArgs args, TextLineMarkerHoverResult result)
{
if (!IsVisible)
return;
- if (LineSegment == null)
+ if (base.LineSegment == null)
return;
if (bubbleDrawX < args.X && args.X < bubbleDrawX + bubbleWidth) {
editor.HideTooltip ();
@@ -355,12 +385,12 @@ namespace MonoDevelop.SourceEditor
double bubbleWidth;
bool bubbleIsReduced;
- public override void Draw (TextEditor editor, Cairo.Context g, double y, LineMetrics metrics)
+ public override void Draw (MonoTextEditor editor, Cairo.Context g, LineMetrics metrics)
{
}
- public override void DrawAfterEol (TextEditor textEditor, Cairo.Context g, double y, EndOfLineMetrics metrics)
+ public override void DrawAfterEol (MonoTextEditor textEditor, Cairo.Context g, EndOfLineMetrics metrics)
{
if (!IsVisible)
return;
@@ -374,6 +404,7 @@ namespace MonoDevelop.SourceEditor
var sx = metrics.TextRenderEndPosition;
var width = LayoutWidth + errorCounterWidth + editor.LineHeight;
var drawLayout = layouts[0].Layout;
+ var y = metrics.LineYRenderStartPosition;
bool customLayout = true; //sx + width > editor.Allocation.Width;
bool hideText = false;
bubbleIsReduced = customLayout;
@@ -427,6 +458,7 @@ namespace MonoDevelop.SourceEditor
editor.LineHeight / 2 - 2
);
+ // FIXME: VV: Remove gradient features
using (var lg = new Cairo.LinearGradient (errorCounterX, errorCounterY, errorCounterX, errorCounterY + errorCounterHeight)) {
lg.AddColorStop (0, CounterColor.Color);
lg.AddColorStop (1, CounterColor.Color.AddLight (-0.1));
@@ -494,7 +526,7 @@ namespace MonoDevelop.SourceEditor
return margin is IconMargin;
}
- void DrawIconMarginBackground (TextEditor ed, Cairo.Context cr, MarginDrawMetrics metrics)
+ void DrawIconMarginBackground (MonoTextEditor ed, Cairo.Context cr, MarginDrawMetrics metrics)
{
cr.Rectangle (metrics.X, metrics.Y, metrics.Width, metrics.Height);
cr.SetSourceColor (IconMarginColor.Color);
@@ -510,7 +542,7 @@ namespace MonoDevelop.SourceEditor
}
}
- public override void DrawForeground (TextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
+ public override void DrawForeground (MonoTextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
{
var tx = Math.Round (metrics.X + (metrics.Width - cache.errorPixbuf.Width) / 2) - 1;
var ty = Math.Floor (metrics.Y + (metrics.Height - cache.errorPixbuf.Height) / 2);
@@ -521,10 +553,10 @@ namespace MonoDevelop.SourceEditor
cr.Restore ();
}
- public override bool DrawBackground (TextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
+ public override bool DrawBackground (MonoTextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
{
if (metrics.Margin is FoldMarkerMargin || metrics.Margin is GutterMargin || metrics.Margin is ActionMargin)
- return DrawMarginBackground (editor, metrics.Margin, cr, metrics.Area, lineSegment, metrics.LineNumber, metrics.X, metrics.Y, metrics.Height);
+ return DrawMarginBackground (editor, metrics.Margin, cr, metrics.Area, LineSegment, metrics.LineNumber, metrics.X, metrics.Y, metrics.Height);
if (metrics.Margin is IconMargin) {
DrawIconMarginBackground (editor, cr, metrics);
return true;
@@ -532,7 +564,7 @@ namespace MonoDevelop.SourceEditor
return false;
}
- bool DrawMarginBackground (TextEditor e, Margin margin, Cairo.Context cr, Cairo.Rectangle area, DocumentLine documentLine, long line, double x, double y, double lineHeight)
+ bool DrawMarginBackground (MonoTextEditor e, Margin margin, Cairo.Context cr, Cairo.Rectangle area, DocumentLine documentLine, long line, double x, double y, double lineHeight)
{
if (cache.CurrentSelectedTextMarker != null && cache.CurrentSelectedTextMarker != this)
return false;
@@ -547,12 +579,12 @@ namespace MonoDevelop.SourceEditor
#region text background
- public override bool DrawBackground (TextEditor editor, Cairo.Context g, double y, LineMetrics metrics)
+ public override bool DrawBackground (MonoTextEditor editor, Cairo.Context g, LineMetrics metrics)
{
if (!IsVisible)
return false;
bool markerShouldDrawnAsHidden = cache.CurrentSelectedTextMarker != null && cache.CurrentSelectedTextMarker != this;
- if (metrics.LineSegment.Markers.Any (m => m is DebugTextMarker))
+ if (editor.Document.GetTextSegmentMarkersAt (metrics.LineSegment).Any (m => m is DebugTextMarker))
return false;
EnsureLayoutCreated (editor);
@@ -565,11 +597,11 @@ namespace MonoDevelop.SourceEditor
var max = Math.Round (editor.TextViewMargin.XOffset + editor.LineHeight / 2);
double x2 = Math.Max (min, max);
- bool isEolSelected = editor.IsSomethingSelected && editor.SelectionMode != Mono.TextEditor.SelectionMode.Block ? editor.SelectionRange.Contains (lineSegment.Offset + lineSegment.Length) : false;
+ bool isEolSelected = editor.IsSomethingSelected && editor.SelectionMode != Mono.TextEditor.SelectionMode.Block ? editor.SelectionRange.Contains (LineSegment.Offset + LineSegment.Length) : false;
- int active = editor.Document.GetTextAt (lineSegment) == initialText ? 0 : 1;
+ int active = 0;
bool highlighted = active == 0 && isCaretInLine;
-
+ var y = metrics.LineYRenderStartPosition;
// draw background
if (!markerShouldDrawnAsHidden) {
DrawRectangle (g, x, y, right, editor.LineHeight);
@@ -627,30 +659,74 @@ namespace MonoDevelop.SourceEditor
return true;
}
- void DrawErrorMarkers (TextEditor editor, Cairo.Context g, LineMetrics metrics, double y)
+ void DrawErrorMarkers (MonoTextEditor editor, Cairo.Context g, LineMetrics metrics, double y)
{
uint curIndex = 0, byteIndex = 0;
var o = metrics.LineSegment.Offset;
foreach (var task in errors.Select (t => t.Task)) {
- var column = (uint)(Math.Min (Math.Max (0, task.Column - 1), metrics.Layout.LineChars.Length));
- int index = (int)metrics.Layout.TranslateToUTF8Index (column, ref curIndex, ref byteIndex);
- var pos = metrics.Layout.Layout.IndexToPos (index);
- var co = o + task.Column - 1;
- g.SetSourceColor (GetMarkerColor (false, metrics.SelectionStart <= co && co < metrics.SelectionEnd));
- g.MoveTo (
- metrics.TextRenderStartPosition + editor.TextViewMargin.TextStartPosition + pos.X / Pango.Scale.PangoScale,
- y + editor.LineHeight - 3
- );
- g.RelLineTo (3, 3);
- g.RelLineTo (-6, 0);
- g.ClosePath ();
+ try {
+ var column = (uint)(Math.Min (Math.Max (0, task.Column - 1), metrics.Layout.LineChars.Length));
+ var line = editor.GetLine (task.Line);
+ // skip possible white space locations
+ while (column < line.Length && char.IsWhiteSpace (editor.GetCharAt (line.Offset + (int)column))) {
+ column++;
+ }
+ if (column >= metrics.Layout.LineChars.Length)
+ continue;
+ int index = (int)metrics.Layout.TranslateToUTF8Index (column, ref curIndex, ref byteIndex);
+ var pos = metrics.Layout.Layout.IndexToPos (index);
+ var co = o + task.Column - 1;
+ g.SetSourceColor (GetMarkerColor (false, metrics.SelectionStart <= co && co < metrics.SelectionEnd));
+ g.MoveTo (
+ metrics.TextRenderStartPosition + editor.TextViewMargin.TextStartPosition + pos.X / Pango.Scale.PangoScale,
+ y + editor.LineHeight - 3
+ );
+ g.RelLineTo (3, 3);
+ g.RelLineTo (-6, 0);
+ g.ClosePath ();
- g.Fill ();
+ g.Fill ();
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while drawing task marker " + task, e);
+ }
}
}
#endregion
+
+ MonoDevelop.Ide.Editor.IDocumentLine MonoDevelop.Ide.Editor.ITextLineMarker.Line {
+ get {
+ return new DocumentLineWrapper (base.LineSegment);
+ }
+ }
+
+ void MonoDevelop.Ide.Editor.IMessageBubbleLineMarker.AddTask (TaskListEntry task)
+ {
+ AddError (task, task.Severity == TaskSeverity.Error, task.Description);
+ }
+
+ TaskListEntry MonoDevelop.Ide.Editor.IMessageBubbleLineMarker.PrimaryTask {
+ get {
+ return primaryTask;
+ }
+ set {
+ SetPrimaryError (task);
+ }
+ }
+
+ int MonoDevelop.Ide.Editor.IMessageBubbleLineMarker.TaskCount {
+ get {
+ return errors.Count;
+ }
+ }
+
+ IEnumerable<TaskListEntry> MonoDevelop.Ide.Editor.IMessageBubbleLineMarker.Tasks {
+ get {
+ return errors.Select (e => e.Task);
+ }
+ }
+
}
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs
index 0d9afdeea5..85d6545eb9 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs
@@ -31,14 +31,25 @@ using Gdk;
namespace MonoDevelop.SourceEditor
{
- public class OverlayMessageWindow : Gtk.EventBox
+ class OverlayMessageWindow : Gtk.EventBox
{
const int border = 8;
- public Func<int> SizeFunc;
+ private Func<int> sizeFunc;
ExtensibleTextEditor textEditor;
+ public Func<int> SizeFunc {
+ get {
+ return sizeFunc;
+ }
+
+ set {
+ sizeFunc = value;
+ QueueResize ();
+ }
+ }
+
public OverlayMessageWindow ()
{
AppPaintable = true;
@@ -50,7 +61,7 @@ namespace MonoDevelop.SourceEditor
this.ShowAll ();
textEditor.AddTopLevelWidget (this, 0, 0);
textEditor.SizeAllocated += HandleSizeAllocated;
- var child = (TextEditor.EditorContainerChild)textEditor [this];
+ var child = (MonoTextEditor.EditorContainerChild)textEditor [this];
child.FixedPosition = true;
}
@@ -67,36 +78,24 @@ namespace MonoDevelop.SourceEditor
{
base.OnSizeRequested (ref requisition);
- if (wRequest > 0) {
- requisition.Width = wRequest;
+ if (SizeFunc != null) {
+ requisition.Width = Math.Min (SizeFunc (), textEditor.Allocation.Width - border * 2);
}
+
}
protected override void OnSizeAllocated (Gdk.Rectangle allocation)
{
base.OnSizeAllocated (allocation);
- Resize (allocation);
+ AdjustPositionInEditor (allocation);
}
- int wRequest = -1;
+
void HandleSizeAllocated (object o, Gtk.SizeAllocatedArgs args)
{
- if (SizeFunc != null) {
- var req = Math.Min (SizeFunc (), textEditor.Allocation.Width - border * 2);
- if (req != wRequest) {
- wRequest = req;
- QueueResize ();
- }
- } else {
- if (Allocation.Width > textEditor.Allocation.Width - border * 2) {
- if (textEditor.Allocation.Width - border * 2 > 0) {
- QueueResize ();
- }
- }
- }
- Resize (Allocation);
+ AdjustPositionInEditor (Allocation);
}
- void Resize (Gdk.Rectangle alloc)
+ void AdjustPositionInEditor (Gdk.Rectangle alloc)
{
textEditor.MoveTopLevelWidget (this, (textEditor.Allocation.Width - alloc.Width) / 2, textEditor.Allocation.Height - alloc.Height - 8);
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/PinnedWatchWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/PinnedWatchWidget.cs
index ae953190d9..1c2d9779d2 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/PinnedWatchWidget.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/PinnedWatchWidget.cs
@@ -32,13 +32,13 @@ using Gtk;
namespace MonoDevelop.SourceEditor
{
- public class PinnedWatchWidget : EventBox
+ class PinnedWatchWidget : EventBox
{
readonly ObjectValueTreeView valueTree;
ScrolledWindow sw;
ObjectValue objectValue;
- TextEditor Editor {
+ MonoTextEditor Editor {
get; set;
}
@@ -66,7 +66,7 @@ namespace MonoDevelop.SourceEditor
}
}
- public PinnedWatchWidget (TextEditor editor, PinnedWatch watch)
+ public PinnedWatchWidget (MonoTextEditor editor, PinnedWatch watch)
{
objectValue = watch.Value;
Editor = editor;
@@ -158,7 +158,7 @@ namespace MonoDevelop.SourceEditor
TreeViewColumn col;
int cx, cy;
valueTree.GetPathAtPos ((int)args.Event.X, (int)args.Event.Y, out path, out col, out cx, out cy);
- Gdk.Rectangle rect = valueTree.GetCellArea (path, col);
+ //Gdk.Rectangle rect = valueTree.GetCellArea (path, col);
if (!mousePressed && valueTree.Columns[0] == col) {
mousePressed = true;
Editor.TextArea.MoveToTop (this);
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs
index cb6cedc56f..0007142983 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SearchAndReplaceWidget.cs
@@ -35,6 +35,7 @@ using MonoDevelop.Core;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Commands;
using MonoDevelop.Components.Commands;
+using MonoDevelop.Components;
namespace MonoDevelop.SourceEditor
{
@@ -48,13 +49,35 @@ namespace MonoDevelop.SourceEditor
get;
set;
}
+ bool isInSelectionSearchMode;
+ TextSegmentMarker selectionMarker;
public bool IsInSelectionSearchMode {
- get;
- set;
+ get {
+ return isInSelectionSearchMode;
+ }
+
+ set {
+ if (value) {
+ Console.WriteLine ("add marker");
+ selectionMarker = new SearchInSelectionMarker (SelectionSegment);
+ this.textEditor.Document.AddMarker (selectionMarker);
+ } else {
+ RemoveSelectionMarker ();
+ }
+ isInSelectionSearchMode = value;
+ }
}
- readonly TextEditor textEditor;
+ void RemoveSelectionMarker ()
+ {
+ if (selectionMarker == null)
+ return;
+ this.textEditor.Document.RemoveMarker (selectionMarker);
+ selectionMarker = null;
+ }
+
+ readonly MonoTextEditor textEditor;
readonly Widget frame;
bool isReplaceMode = true;
Widget[] replaceWidgets;
@@ -101,7 +124,7 @@ namespace MonoDevelop.SourceEditor
if (frame == null || textEditor == null)
return;
int newX = textEditor.Allocation.Width - Allocation.Width - 8;
- TextEditor.EditorContainerChild containerChild = ((TextEditor.EditorContainerChild)textEditor [frame]);
+ MonoTextEditor.EditorContainerChild containerChild = ((MonoTextEditor.EditorContainerChild)textEditor [frame]);
if (newX != containerChild.X) {
searchEntry.WidthRequest = textEditor.Allocation.Width / 3;
containerChild.X = newX;
@@ -118,7 +141,7 @@ namespace MonoDevelop.SourceEditor
return "(" + nextShortcut + ")";
}
- public SearchAndReplaceWidget (TextEditor textEditor, Widget frame)
+ public SearchAndReplaceWidget (MonoTextEditor textEditor, Widget frame)
{
if (textEditor == null)
throw new ArgumentNullException ("textEditor");
@@ -157,13 +180,6 @@ namespace MonoDevelop.SourceEditor
};
FilterHistory (seachHistoryProperty);
FilterHistory (replaceHistoryProperty);
- //HACK: GTK rendering issue on Mac, images don't repaint unless we put them in visible eventboxes
- if (Platform.IsMac) {
- foreach (var eb in new [] { eventbox2, eventbox3, eventbox4, eventbox5, eventbox6 }) {
- eb.VisibleWindow = true;
- eb.ModifyBg (StateType.Normal, new Gdk.Color (245, 245, 245));
- }
- }
if (String.IsNullOrEmpty (textEditor.SearchPattern)) {
textEditor.SearchPattern = SearchAndReplaceOptions.SearchPattern;
@@ -190,8 +206,17 @@ namespace MonoDevelop.SourceEditor
if (oldPattern != SearchAndReplaceOptions.SearchPattern)
UpdateSearchEntry ();
var history = GetHistory (seachHistoryProperty);
+
+ // Don't do anything to the history if we have a blank search
+ if (string.IsNullOrWhiteSpace (SearchPattern)) {
+ return;
+ }
+
if (history.Count > 0 && history [0] == oldPattern) {
- ChangeHistory (seachHistoryProperty, SearchAndReplaceOptions.SearchPattern);
+ // Only update the current history item if we're adding to the search string
+ if (!oldPattern.StartsWith (SearchPattern)) {
+ ChangeHistory (seachHistoryProperty, SearchAndReplaceOptions.SearchPattern);
+ }
} else {
UpdateSearchHistory (SearchAndReplaceOptions.SearchPattern);
}
@@ -281,14 +306,14 @@ namespace MonoDevelop.SourceEditor
resultInformLabelEventBox.BorderWidth = 2;
resultInformLabel.Xpad = 2;
resultInformLabel.Show ();
- searchEntry.FilterButtonPixbuf = Xwt.Drawing.Image.FromResource ("searchoptions.png");
+ searchEntry.FilterButtonPixbuf = Xwt.Drawing.Image.FromResource ("find-options-22x32.png");
if (textEditor.IsSomethingSelected) {
- if (textEditor.MainSelection.MinLine == textEditor.MainSelection.MaxLine) {
+ if (textEditor.MainSelection.MinLine == textEditor.MainSelection.MaxLine || ClipboardContainsSelection()) {
SetSearchPattern ();
} else {
- IsInSelectionSearchMode = true;
SelectionSegment = textEditor.SelectionRange;
+ IsInSelectionSearchMode = true;
SetSearchOptions ();
}
}
@@ -304,6 +329,11 @@ namespace MonoDevelop.SourceEditor
SearchAndReplaceOptions.ReplacePatternChanged += HandleReplacePatternChanged;
}
+ bool ClipboardContainsSelection ()
+ {
+ return textEditor.SelectedText == ClipboardActions.GetClipboardContent ();
+ }
+
void HandleReplacePatternChanged (object sender, EventArgs e)
{
ReplacePattern = SearchAndReplaceOptions.ReplacePattern;
@@ -611,6 +641,7 @@ But I leave it in in the case I've missed something. Mike
protected override void OnDestroyed ()
{
+ RemoveSelectionMarker ();
SearchAndReplaceOptions.SearchPatternChanged -= HandleSearchPatternChanged;
SearchAndReplaceOptions.ReplacePatternChanged -= HandleReplacePatternChanged;
@@ -773,8 +804,7 @@ But I leave it in in the case I've missed something. Mike
if (!valid || textEditor.TextViewMargin.SearchResultMatchCount == 0) {
//resultInformLabel.Markup = "<span foreground=\"#000000\" background=\"" + MonoDevelop.Components.PangoCairoHelper.GetColorString (GotoLineNumberWidget.errorColor) + "\">" + GettextCatalog.GetString ("Not found") + "</span>";
resultInformLabel.Text = GettextCatalog.GetString ("Not found");
- resultInformLabelEventBox.ModifyBg (StateType.Normal, GotoLineNumberWidget.errorColor);
- resultInformLabel.ModifyFg (StateType.Normal, searchEntry.Entry.Style.Foreground (StateType.Normal));
+ resultInformLabel.ModifyFg (StateType.Normal, Ide.Gui.Styles.Editor.SearchErrorForegroundColor.ToGdkColor ());
} else {
int resultIndex = 0;
int foundIndex = -1;
@@ -827,7 +857,7 @@ But I leave it in in the case I've missed something. Mike
textEditor.SearchPattern = searchPattern;
}
- public static SearchResult FindNext (TextEditor textEditor)
+ public static SearchResult FindNext (MonoTextEditor textEditor)
{
textEditor.SearchPattern = SearchAndReplaceOptions.SearchPattern;
SearchResult result = textEditor.FindNext (true);
@@ -835,9 +865,7 @@ But I leave it in in the case I've missed something. Mike
return null;
textEditor.CenterToCaret ();
- if (result == null) {
- IdeApp.Workbench.StatusBar.ShowError (GettextCatalog.GetString ("Search pattern not found"));
- } else if (result.SearchWrapped) {
+ if (result.SearchWrapped) {
IdeApp.Workbench.StatusBar.ShowMessage (
Stock.Find,
GettextCatalog.GetString ("Reached bottom, continued from top")
@@ -848,16 +876,14 @@ But I leave it in in the case I've missed something. Mike
return result;
}
- public static SearchResult FindPrevious (TextEditor textEditor)
+ public static SearchResult FindPrevious (MonoTextEditor textEditor)
{
textEditor.SearchPattern = SearchAndReplaceOptions.SearchPattern;
SearchResult result = textEditor.FindPrevious (true);
if (result == null)
return null;
textEditor.CenterToCaret ();
- if (result == null) {
- IdeApp.Workbench.StatusBar.ShowError (GettextCatalog.GetString ("Search pattern not found"));
- } else if (result.SearchWrapped) {
+ if (result.SearchWrapped) {
IdeApp.Workbench.StatusBar.ShowMessage (
Stock.Find,
GettextCatalog.GetString ("Reached top, continued from bottom")
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SearchInSelectionMarker.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SearchInSelectionMarker.cs
new file mode 100644
index 0000000000..695ff657df
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SearchInSelectionMarker.cs
@@ -0,0 +1,56 @@
+using Mono.TextEditor;
+using System;
+
+namespace MonoDevelop.SourceEditor
+{
+ class SearchInSelectionMarker : TextSegmentMarker
+ {
+
+ public SearchInSelectionMarker (TextSegment textSegment) : base (textSegment)
+ {
+ }
+
+ public override void DrawBackground (MonoTextEditor editor, Cairo.Context cr, LineMetrics metrics, int startOffset, int endOffset)
+ {
+ int markerStart = Offset;
+ int markerEnd = EndOffset;
+
+ double @from;
+ double to;
+ var startXPos = metrics.TextRenderStartPosition;
+ var endXPos = metrics.TextRenderEndPosition;
+ var y = metrics.LineYRenderStartPosition;
+ if (markerStart < startOffset && endOffset < markerEnd) {
+ @from = startXPos;
+ to = endXPos;
+ } else {
+ int start = startOffset < markerStart ? markerStart : startOffset;
+ int end = endOffset < markerEnd ? endOffset : markerEnd;
+
+ uint curIndex = 0, byteIndex = 0;
+ TextViewMargin.TranslateToUTF8Index (metrics.Layout.LineChars, (uint)(start - startOffset), ref curIndex, ref byteIndex);
+
+ int x_pos = metrics.Layout.Layout.IndexToPos ((int)byteIndex).X;
+
+ @from = startXPos + (int)(x_pos / Pango.Scale.PangoScale);
+
+ TextViewMargin.TranslateToUTF8Index (metrics.Layout.LineChars, (uint)(end - startOffset), ref curIndex, ref byteIndex);
+ x_pos = metrics.Layout.Layout.IndexToPos ((int)byteIndex).X;
+
+ to = startXPos + (int)(x_pos / Pango.Scale.PangoScale);
+ }
+
+ @from = Math.Max (@from, editor.TextViewMargin.XOffset);
+ to = Math.Max (to, editor.TextViewMargin.XOffset);
+ if (@from <= to) {
+ if (metrics.TextEndOffset < markerEnd)
+ to = metrics.WholeLineWidth + metrics.TextRenderStartPosition;
+ var c1 = editor.Options.GetColorStyle ().PlainText.Background;
+ var c2 = editor.Options.GetColorStyle ().SelectedText.Background;
+ cr.SetSourceRGB ((c1.R + c2.R) / 2, (c1.G + c2.G) / 2, (c1.B + c2.B) / 2);
+ cr.Rectangle (@from, y, to - @from, metrics.LineHeight);
+ cr.Fill ();
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorCommands.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorCommands.cs
index 847f0e93a1..53776a244b 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorCommands.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorCommands.cs
@@ -33,9 +33,6 @@ namespace MonoDevelop.SourceEditor
public enum SourceEditorCommands
{
MarkerOperations,
- DynamicAbbrev,
- PulseCaret,
- ToggleErrorTextMarker,
NextIssue,
PrevIssue,
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs
deleted file mode 100644
index 704ca02a68..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorDisplayBinding.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-// SourceEditorDisplayBinding.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.IO;
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide;
-using MonoDevelop.Ide.Codons;
-using MonoDevelop.Projects;
-
-namespace MonoDevelop.SourceEditor
-{
- public class SourceEditorDisplayBinding : IViewDisplayBinding
- {
- static bool IsInitialized = false;
-
- public static FilePath SyntaxModePath {
- get {
- return UserProfile.Current.UserDataRoot.Combine ("HighlightingSchemes");
- }
- }
-
- static SourceEditorDisplayBinding ()
- {
- InitSourceEditor ();
- }
-
- public static void InitSourceEditor ()
- {
- if (IsInitialized)
- return;
- IsInitialized = true;
-
- MonoDevelop.SourceEditor.Extension.TemplateExtensionNodeLoader.Init ();
- DefaultSourceEditorOptions.Init ();
- SyntaxModeService.EnsureLoad ();
- LoadCustomStylesAndModes ();
- }
-
- internal static void LoadCustomStylesAndModes ()
- {
- bool success = true;
- if (!Directory.Exists (SyntaxModePath)) {
- try {
- Directory.CreateDirectory (SyntaxModePath);
- } catch (Exception e) {
- success = false;
- LoggingService.LogError ("Can't create syntax mode directory", e);
- }
- }
- if (success)
- Mono.TextEditor.Highlighting.SyntaxModeService.LoadStylesAndModes (SyntaxModePath);
- }
-
- public string Name {
- get {
- return GettextCatalog.GetString ("Source Code Editor");
- }
- }
-
- public bool CanHandle (FilePath fileName, string mimeType, Project ownerProject)
- {
- if (fileName != null)
- return DesktopService.GetFileIsText (fileName, mimeType);
-
- if (!string.IsNullOrEmpty (mimeType))
- return DesktopService.GetMimeTypeIsText (mimeType);
-
- return false;
- }
-
- public IViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
- {
- return new SourceEditorView ();
- }
-
- public bool CanHandleFile (string fileName)
- {
- return DesktopService.GetFileIsText (fileName);
- }
-
- public bool CanUseAsDefault {
- get { return true; }
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorOptions.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorOptions.cs
deleted file mode 100644
index 67208ec589..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorOptions.cs
+++ /dev/null
@@ -1,682 +0,0 @@
-// SourceEditorOptions.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-
-using Mono.TextEditor;
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Gui.Content;
-using MonoDevelop.Ide;
-using MonoDevelop.Ide.Fonts;
-
-namespace MonoDevelop.SourceEditor
-{
- [Obsolete ("Use WordNavigationStyle")]
- public enum ControlLeftRightMode
- {
- MonoDevelop,
- Emacs,
- SharpDevelop
- }
-
- public enum WordNavigationStyle
- {
- Unix,
- Windows
- }
-
- public enum LineEndingConversion {
- Ask,
- LeaveAsIs,
- ConvertAlways
- }
-
- public class DefaultSourceEditorOptions : TextEditorOptions, ISourceEditorOptions
- {
- static DefaultSourceEditorOptions instance;
- //static TextStylePolicy defaultPolicy;
- static bool inited;
-
- public static DefaultSourceEditorOptions Instance {
- get { return instance; }
- }
-
- static DefaultSourceEditorOptions ()
- {
- Init ();
- }
-
- public static void Init ()
- {
- if (inited)
- return;
- inited = true;
-
- TextStylePolicy policy = MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<TextStylePolicy> ("text/plain");
- instance = new DefaultSourceEditorOptions (policy);
- MonoDevelop.Projects.Policies.PolicyService.DefaultPolicies.PolicyChanged += instance.HandlePolicyChanged;
- }
-
- void HandlePolicyChanged (object sender, MonoDevelop.Projects.Policies.PolicyChangedEventArgs args)
- {
- TextStylePolicy pol = MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<TextStylePolicy> ("text/plain");
- UpdateStylePolicy (pol);
- }
-
- DefaultSourceEditorOptions (MonoDevelop.Ide.Gui.Content.TextStylePolicy currentPolicy)
- {
- LoadAllPrefs ();
- UpdateStylePolicy (currentPolicy);
- PropertyService.PropertyChanged += UpdatePreferences;
- FontService.RegisterFontChangedCallback ("Editor", UpdateFont);
- FontService.RegisterFontChangedCallback ("Pad", UpdateFont);
-
- }
-
- public override void Dispose()
- {
- PropertyService.PropertyChanged -= UpdatePreferences;
- FontService.RemoveCallback (UpdateFont);
- }
-
- void UpdateFont ()
- {
- base.FontName = FontName;
- base.GutterFontName = GutterFontName;
- this.OnChanged (EventArgs.Empty);
-
- }
-
- void UpdateStylePolicy (MonoDevelop.Ide.Gui.Content.TextStylePolicy currentPolicy)
- {
- this.defaultEolMarker = TextStylePolicy.GetEolMarker (currentPolicy.EolMarker);
-
- base.TabsToSpaces = currentPolicy.TabsToSpaces; // PropertyService.Get ("TabsToSpaces", false);
- base.IndentationSize = currentPolicy.TabWidth; //PropertyService.Get ("TabIndent", 4);
- base.RulerColumn = currentPolicy.FileWidth; //PropertyService.Get ("RulerColumn", 80);
- base.AllowTabsAfterNonTabs = !currentPolicy.NoTabsAfterNonTabs; //PropertyService.Get ("AllowTabsAfterNonTabs", true);
- base.RemoveTrailingWhitespaces = currentPolicy.RemoveTrailingWhitespace; //PropertyService.Get ("RemoveTrailingWhitespaces", true);
- }
-
- // Need to be picky about only updating individual properties when they change.
- // The old approach called LoadAllPrefs on any prefs event, which sometimes caused
- // massive change event storms.
- void UpdatePreferences (object sender, PropertyChangedEventArgs args)
- {
- try {
- switch (args.Key) {
- case "TabIsReindent":
- this.TabIsReindent = (bool)args.NewValue;
- break;
- case "AutoInsertMatchingBracket":
- this.AutoInsertMatchingBracket = (bool)args.NewValue;
- break;
- case "UnderlineErrors":
- this.UnderlineErrors = (bool)args.NewValue;
- break;
- case "IndentStyle":
- if (args.NewValue == null) {
- LoggingService.LogWarning ("tried to set indent style == null");
- } else if (!(args.NewValue is IndentStyle)) {
- LoggingService.LogWarning ("tried to set indent style to " + args.NewValue + " which isn't from type IndentStyle instead it is from:" + args.NewValue.GetType ());
- this.IndentStyle = (IndentStyle)Enum.Parse (typeof(IndentStyle), args.NewValue.ToString ());
- } else
- this.IndentStyle = (IndentStyle)args.NewValue;
- break;
- case "ShowLineNumberMargin":
- base.ShowLineNumberMargin = (bool)args.NewValue;
- break;
- case "ShowFoldMargin":
- base.ShowFoldMargin = (bool)args.NewValue;
- break;
- case "HighlightCaretLine":
- base.HighlightCaretLine = (bool)args.NewValue;
- break;
- case "HighlightMatchingBracket":
- base.HighlightMatchingBracket = (bool)args.NewValue;
- break;
- case "ShowRuler":
- base.ShowRuler = (bool)args.NewValue;
- break;
- case "FontName":
- base.FontName = (string)args.NewValue;
- break;
- case "GutterFontName":
- base.GutterFontName = (string)args.NewValue;
- break;
- case "ColorScheme":
- base.ColorScheme = (string)args.NewValue;
- break;
- case "DefaultRegionsFolding":
- this.DefaultRegionsFolding = (bool)args.NewValue;
- break;
- case "DefaultCommentFolding":
- this.DefaultCommentFolding = (bool)args.NewValue;
- break;
- case "UseViModes":
- this.UseViModes = (bool)args.NewValue;
- break;
- case "OnTheFlyFormatting":
- this.OnTheFlyFormatting = (bool)args.NewValue;
- break;
- case "WordNavigationStyle":
- this.WordNavigationStyle = (WordNavigationStyle)args.NewValue;
- break;
- case "EnableAnimations":
- base.EnableAnimations = (bool)args.NewValue;
- break;
- case "DrawIndentationMarkers":
- base.DrawIndentationMarkers = (bool)args.NewValue;
- break;
- case "EnableQuickDiff":
- base.EnableQuickDiff = (bool)args.NewValue;
- break;
- case "GenerateFormattingUndoStep":
- base.GenerateFormattingUndoStep = (bool)args.NewValue;
- break;
- }
- } catch (Exception ex) {
- LoggingService.LogError ("SourceEditorOptions error with property value for '" + (args.Key ?? "") + "'", ex);
- }
- }
-
- void LoadAllPrefs ()
- {
- this.tabIsReindent = PropertyService.Get ("TabIsReindent", false);
- // this.autoInsertTemplates = PropertyService.Get ("AutoInsertTemplates", false);
- this.autoInsertMatchingBracket = PropertyService.Get ("AutoInsertMatchingBracket", false);
- this.smartSemicolonPlacement = PropertyService.Get ("SmartSemicolonPlacement", false);
- this.underlineErrors = PropertyService.Get ("UnderlineErrors", true);
- this.indentStyle = PropertyService.Get ("IndentStyle", IndentStyle.Smart);
- base.ShowLineNumberMargin = PropertyService.Get ("ShowLineNumberMargin", true);
- base.ShowFoldMargin = PropertyService.Get ("ShowFoldMargin", false);
- base.HighlightCaretLine = PropertyService.Get ("HighlightCaretLine", false);
- base.HighlightMatchingBracket = PropertyService.Get ("HighlightMatchingBracket", true);
- base.ShowRuler = PropertyService.Get ("ShowRuler", false);
- base.FontName = PropertyService.Get ("FontName", "Mono 10");
- base.GutterFontName = PropertyService.Get ("GutterFontName", "");
- base.ColorScheme = PropertyService.Get ("ColorScheme", "Default");
- this.defaultRegionsFolding = PropertyService.Get ("DefaultRegionsFolding", false);
- this.defaultCommentFolding = PropertyService.Get ("DefaultCommentFolding", true);
- this.useViModes = PropertyService.Get ("UseViModes", false);
- this.onTheFlyFormatting = PropertyService.Get ("OnTheFlyFormatting", true);
-
- WordNavigationStyle defaultWordNavigation = WordNavigationStyle.Unix;
- if (Platform.IsWindows || PropertyService.Get ("ControlLeftRightMode", (string)null) == "SharpDevelop") {
- defaultWordNavigation = WordNavigationStyle.Windows;
- }
- this.WordNavigationStyle = PropertyService.Get ("WordNavigationStyle", defaultWordNavigation);
-
- base.EnableAnimations = PropertyService.Get ("EnableAnimations", true);
- this.EnableHighlightUsages = PropertyService.Get ("EnableHighlightUsages", false);
- base.DrawIndentationMarkers = PropertyService.Get ("DrawIndentationMarkers", false);
- this.lineEndingConversion = PropertyService.Get ("LineEndingConversion", LineEndingConversion.Ask);
- base.GenerateFormattingUndoStep = PropertyService.Get ("GenerateFormattingUndoStep", false);
- base.ShowWhitespaces = PropertyService.Get ("ShowWhitespaces", Mono.TextEditor.ShowWhitespaces.Never);
- base.IncludeWhitespaces = PropertyService.Get ("IncludeWhitespaces", Mono.TextEditor.IncludeWhitespaces.All);
- base.WrapLines = PropertyService.Get ("WrapLines", false);
- base.EnableQuickDiff = PropertyService.Get ("EnableQuickDiff", false);
- }
-
- #region new options
-
- public bool EnableAutoCodeCompletion {
- get { return CompletionTextEditorExtension.EnableAutoCodeCompletion; }
- set { CompletionTextEditorExtension.EnableAutoCodeCompletion.Set (value); }
- }
-
- bool defaultRegionsFolding;
- public bool DefaultRegionsFolding {
- get {
- return defaultRegionsFolding;
- }
- set {
- if (value != this.defaultRegionsFolding) {
- this.defaultRegionsFolding = value;
- PropertyService.Set ("DefaultRegionsFolding", value);
- OnChanged (EventArgs.Empty);
- }
- }
- }
-
- bool defaultCommentFolding;
- public bool DefaultCommentFolding {
- get {
- return defaultCommentFolding;
- }
- set {
- if (value != this.defaultCommentFolding) {
- this.defaultCommentFolding = value;
- PropertyService.Set ("DefaultCommentFolding", value);
- OnChanged (EventArgs.Empty);
- }
- }
- }
-
- public bool EnableSemanticHighlighting {
- get {
- return true;
- }
- }
- /*
- bool autoInsertTemplates;
- public bool AutoInsertTemplates {
- get {
- return autoInsertTemplates;
- }
- set {
- if (value != this.autoInsertTemplates) {
- this.autoInsertTemplates = value;
- PropertyService.Set ("AutoInsertTemplates", value);
- OnChanged (EventArgs.Empty);
- }
- }
- }*/
-
- bool tabIsReindent;
- public bool TabIsReindent {
- get {
- return tabIsReindent;
- }
- set {
- if (value != this.tabIsReindent) {
- this.tabIsReindent = value;
- PropertyService.Set ("TabIsReindent", value);
- OnChanged (EventArgs.Empty);
- }
- }
- }
-
- bool autoInsertMatchingBracket;
- public bool AutoInsertMatchingBracket {
- get {
- return autoInsertMatchingBracket;
- }
- set {
- if (value != this.autoInsertMatchingBracket) {
- this.autoInsertMatchingBracket = value;
- PropertyService.Set ("AutoInsertMatchingBracket", value);
- OnChanged (EventArgs.Empty);
- }
- }
- }
-
- bool smartSemicolonPlacement;
- public bool SmartSemicolonPlacement {
- get {
- return smartSemicolonPlacement;
- }
- set {
- if (value != this.smartSemicolonPlacement) {
- this.smartSemicolonPlacement= value;
- PropertyService.Set ("SmartSemicolonPlacement", value);
- OnChanged (EventArgs.Empty);
- }
- }
- }
-
- bool underlineErrors;
- public bool UnderlineErrors {
- get {
- return underlineErrors;
- }
- set {
- if (value != this.underlineErrors) {
- this.underlineErrors = value;
- PropertyService.Set ("UnderlineErrors", value);
- OnChanged (EventArgs.Empty);
- }
- }
- }
-
- IndentStyle indentStyle;
- public override IndentStyle IndentStyle {
- get {
- return indentStyle;
- }
- set {
- if (value != this.indentStyle) {
- this.indentStyle = value;
- PropertyService.Set ("IndentStyle", value);
- OnChanged (EventArgs.Empty);
- }
- }
- }
-
- EditorFontType editorFontType;
- public EditorFontType EditorFontType {
- get {
- return editorFontType;
- }
- set {
- if (value != this.editorFontType) {
- this.editorFontType = value;
- PropertyService.Set ("EditorFontType", value);
- OnChanged (EventArgs.Empty);
- }
- }
- }
-
- bool enableHighlightUsages;
- public bool EnableHighlightUsages {
- get {
- return enableHighlightUsages;
- }
- set {
- if (value != this.enableHighlightUsages) {
- this.enableHighlightUsages = value;
- PropertyService.Set ("EnableHighlightUsages", value);
- OnChanged (EventArgs.Empty);
- }
- }
- }
-
- LineEndingConversion lineEndingConversion;
- public LineEndingConversion LineEndingConversion {
- get {
- return lineEndingConversion;
- }
- set {
- if (value != this.lineEndingConversion) {
- this.lineEndingConversion = value;
- PropertyService.Set ("LineEndingConversion", value);
- OnChanged (EventArgs.Empty);
- }
- }
- }
-
-
- #endregion
-
- bool useViModes = false;
- public bool UseViModes {
- get {
- return useViModes;
- }
- set {
- if (useViModes == value)
- return;
- useViModes = value;
- PropertyService.Set ("UseViModes", value);
- OnChanged (EventArgs.Empty);
- }
- }
-
- bool onTheFlyFormatting = false;
- public bool OnTheFlyFormatting {
- get {
- return onTheFlyFormatting;
- }
- set {
- if (onTheFlyFormatting == value)
- return;
- onTheFlyFormatting = value;
- PropertyService.Set ("OnTheFlyFormatting", value);
- OnChanged (EventArgs.Empty);
- }
- }
-
- #region old options
- string defaultEolMarker;
- public override string DefaultEolMarker {
- get { return defaultEolMarker; }
- }
-
- WordNavigationStyle wordNavigationStyle = Platform.IsWindows
- ? WordNavigationStyle.Windows
- : WordNavigationStyle.Unix;
-
- [Obsolete("Use WordNavigationStyle")]
- public ControlLeftRightMode ControlLeftRightMode {
- get {
- return WordNavigationStyle == WordNavigationStyle.Unix
- ? ControlLeftRightMode.MonoDevelop
- : ControlLeftRightMode.SharpDevelop;
- }
- set {
- switch (value) {
- case ControlLeftRightMode.Emacs:
- case ControlLeftRightMode.MonoDevelop:
- WordNavigationStyle = WordNavigationStyle.Unix;
- return;
- default:
- WordNavigationStyle = WordNavigationStyle.Windows;
- return;
- }
- }
- }
-
- public WordNavigationStyle WordNavigationStyle {
- get {
- return wordNavigationStyle;
- }
- set {
- if (wordNavigationStyle != value) {
- wordNavigationStyle = value;
- PropertyService.Set ("WordNavigationStyle", value);
- SetWordFindStrategy ();
- OnChanged (EventArgs.Empty);
- }
- }
- }
-
- IWordFindStrategy wordFindStrategy = null;
- public override IWordFindStrategy WordFindStrategy {
- get {
- if (wordFindStrategy == null)
- SetWordFindStrategy ();
- return this.wordFindStrategy;
- }
- set {
- throw new System.NotImplementedException ();
- }
- }
-
- void SetWordFindStrategy ()
- {
- if (useViModes) {
- wordFindStrategy = new Mono.TextEditor.Vi.ViWordFindStrategy ();
- return;
- }
-
- switch (WordNavigationStyle) {
- case WordNavigationStyle.Windows:
- wordFindStrategy = new SharpDevelopWordFindStrategy ();
- break;
- default:
- wordFindStrategy = new EmacsWordFindStrategy ();
- break;
- }
- }
-
- public override bool AllowTabsAfterNonTabs {
- set {
- if (value != AllowTabsAfterNonTabs) {
- PropertyService.Set ("AllowTabsAfterNonTabs", value);
- base.AllowTabsAfterNonTabs = value;
- }
- }
- }
-
- public override bool TabsToSpaces {
- set {
- PropertyService.Set ("TabsToSpaces", value);
- base.TabsToSpaces = value;
- }
- }
-
- public override int IndentationSize {
- set {
- PropertyService.Set ("TabIndent", value);
- base.IndentationSize = value;
- }
- }
-
- public override int TabSize {
- get {
- return IndentationSize;
- }
- set {
- IndentationSize = value;
- }
- }
-
- public override bool RemoveTrailingWhitespaces {
- set {
- PropertyService.Set ("RemoveTrailingWhitespaces", value);
- base.RemoveTrailingWhitespaces = value;
- }
- }
-
-
- public override bool ShowLineNumberMargin {
- set {
- PropertyService.Set ("ShowLineNumberMargin", value);
- base.ShowLineNumberMargin = value;
- }
- }
-
- public override bool ShowFoldMargin {
- set {
- PropertyService.Set ("ShowFoldMargin", value);
- base.ShowFoldMargin = value;
- }
- }
-
- public override bool HighlightCaretLine {
- set {
- PropertyService.Set ("HighlightCaretLine", value);
- base.HighlightCaretLine = value;
- }
- }
-
- public override bool EnableSyntaxHighlighting {
- get {
- return true;
- }
- set {
- // nothing
- }
- }
-
- public override bool HighlightMatchingBracket {
- set {
- PropertyService.Set ("HighlightMatchingBracket", value);
- base.HighlightMatchingBracket = value;
- }
- }
-
- public override int RulerColumn {
- set {
- PropertyService.Set ("RulerColumn", value);
- base.RulerColumn = value;
- }
- }
-
- public override bool ShowRuler {
- set {
- PropertyService.Set ("ShowRuler", value);
- base.ShowRuler = value;
- }
- }
-
- public override bool EnableAnimations {
- set {
- PropertyService.Set ("EnableAnimations", value);
- base.EnableAnimations = value;
- }
- }
-
- public override bool DrawIndentationMarkers {
- set {
- PropertyService.Set ("DrawIndentationMarkers", value);
- base.DrawIndentationMarkers = value;
- }
- }
-
- public override ShowWhitespaces ShowWhitespaces {
- set {
- PropertyService.Set ("ShowWhitespaces", value);
- base.ShowWhitespaces = value;
- }
- }
-
- public override IncludeWhitespaces IncludeWhitespaces {
- set {
- PropertyService.Set ("IncludeWhitespaces", value);
- base.IncludeWhitespaces = value;
- }
- }
-
- public override bool WrapLines {
- set {
- PropertyService.Set ("WrapLines", value);
- base.WrapLines = value;
- }
- }
-
- public override bool EnableQuickDiff {
- set {
- PropertyService.Set ("EnableQuickDiff", value);
- base.EnableQuickDiff = value;
- }
- }
-
- public override string FontName {
- get {
- return FontService.FilterFontName (FontService.GetUnderlyingFontName ("Editor"));
- }
- set {
- throw new InvalidOperationException ("Set font through font service");
- }
- }
-
- public override string GutterFontName {
- get {
- return FontService.FilterFontName (FontService.GetUnderlyingFontName ("Editor"));
- }
- set {
- throw new InvalidOperationException ("Set font through font service");
- }
- }
-
- public override string ColorScheme {
- set {
- string newColorScheme = !String.IsNullOrEmpty (value) ? value : "Default";
- PropertyService.Set ("ColorScheme", newColorScheme);
- base.ColorScheme = newColorScheme;
- }
- }
-
- public override bool GenerateFormattingUndoStep {
- set {
- PropertyService.Set ("GenerateFormattingUndoStep", value);
- base.GenerateFormattingUndoStep = value;
- }
- }
-
- #endregion
- }
-}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorPrintOperation.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorPrintOperation.cs
index 2aeda98637..79ae4bcf25 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorPrintOperation.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorPrintOperation.cs
@@ -28,6 +28,7 @@ using Gtk;
using Mono.TextEditor;
using System.Text;
using MonoDevelop.Core;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.SourceEditor
{
@@ -284,11 +285,19 @@ namespace MonoDevelop.SourceEditor
private SourceEditorPrintSettings ()
{
- Font = DefaultSourceEditorOptions.Instance.Font;
+ try {
+ Font = Pango.FontDescription.FromString (DefaultSourceEditorOptions.Instance.FontName);
+ } catch {
+ Console.WriteLine ("Could not load font: {0}", DefaultSourceEditorOptions.Instance.FontName);
+ }
+ if (Font == null || String.IsNullOrEmpty (Font.Family))
+ Font = Pango.FontDescription.FromString (TextEditorOptions.DEFAULT_FONT);
+ //if (Font != null)
+ // Font.Size = (int)(Font.Size * DefaultSourceEditorOptions.Instance.Zoom);
TabSize = DefaultSourceEditorOptions.Instance.TabSize;
HeaderFormat = "%F";
FooterFormat = GettextCatalog.GetString ("Page %N of %Q");
- ColorScheme = "default";
+ ColorScheme = MonoDevelop.Ide.Editor.Highlighting.ColorScheme.DefaultColorStyle;
HeaderSeparatorWeight = FooterSeparatorWeight = 0.5;
HeaderPadding = FooterPadding = 6;
UseHighlighting = true;
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs
index 5cfd2f7cb7..561ddbc78a 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs
@@ -55,39 +55,47 @@ using System.Text;
using Mono.Addins;
using MonoDevelop.Components;
using Mono.TextEditor.Utils;
-using MonoDevelop.Projects.Policies;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Projects.Policies;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.SourceEditor.Wrappers;
+using MonoDevelop.Ide.Editor.Extension;
+using MonoDevelop.Ide.Editor.Highlighting;
+using System.Threading.Tasks;
+using System.Threading;
namespace MonoDevelop.SourceEditor
{
- public class SourceEditorView : AbstractViewContent, IExtensibleTextEditor, IBookmarkBuffer, IClipboardHandler,
- ICompletionWidget, ISplittable, IFoldable, IToolboxDynamicProvider, IEncodedTextContent,
- ICustomFilteringToolboxConsumer, IZoomable, ITextEditorResolver, Mono.TextEditor.ITextEditorDataProvider,
- ICodeTemplateHandler, ICodeTemplateContextProvider, ISupportsProjectReload, IPrintable
+ partial class SourceEditorView : ViewContent, IBookmarkBuffer, IClipboardHandler, ITextFile,
+ ICompletionWidget, ISplittable, IFoldable, IToolboxDynamicProvider,
+ ICustomFilteringToolboxConsumer, IZoomable, ITextEditorResolver, ITextEditorDataProvider,
+ ICodeTemplateHandler, ICodeTemplateContextProvider, IPrintable,
+ ITextEditorImpl, IEditorActionHost, ITextMarkerFactory, IUndoHandler
{
readonly SourceEditorWidget widget;
bool isDisposed = false;
DateTime lastSaveTimeUtc;
- string loadedMimeType;
internal object MemoryProbe = Counters.SourceViewsInMemory.CreateMemoryProbe ();
- TextLineMarker currentDebugLineMarker;
- TextLineMarker debugStackLineMarker;
- int lastDebugLine = -1;
+ DebugMarkerPair currentDebugLineMarker;
+ DebugMarkerPair debugStackLineMarker;
BreakpointStore breakpoints;
- EventHandler currentFrameChanged;
- EventHandler executionLocationChanged;
- EventHandler<BreakpointEventArgs> breakpointAdded;
- EventHandler<BreakpointEventArgs> breakpointRemoved;
- EventHandler<BreakpointEventArgs> breakpointStatusChanged;
- List<DocumentLine> breakpointSegments = new List<DocumentLine> ();
- DocumentLine debugStackSegment;
- DocumentLine currentLineSegment;
+ List<DebugMarkerPair> breakpointSegments = new List<DebugMarkerPair> ();
List<PinnedWatchInfo> pinnedWatches = new List<PinnedWatchInfo> ();
bool writeAllowed;
bool writeAccessChecked;
+
+ public ViewContent ViewContent {
+ get {
+ return this;
+ }
+ }
- public Mono.TextEditor.TextDocument Document {
+ public TextDocument Document {
get {
- return widget.TextEditor.Document;
+ return widget?.TextEditor?.Document;
+ }
+ set {
+ widget.TextEditor.Document = value;
}
}
@@ -99,7 +107,8 @@ namespace MonoDevelop.SourceEditor
lastSaveTimeUtc = value;
}
}
- public ExtensibleTextEditor TextEditor {
+
+ internal ExtensibleTextEditor TextEditor {
get {
return widget.TextEditor;
}
@@ -111,7 +120,7 @@ namespace MonoDevelop.SourceEditor
}
}
- public override Gtk.Widget Control {
+ public override Control Control {
get {
return widget != null ? widget.Vbox : null;
}
@@ -122,43 +131,18 @@ namespace MonoDevelop.SourceEditor
return Document.LineCount;
}
}
-
- public override Project Project {
- get {
- return base.Project;
- }
- set {
- if (value != base.Project)
- ((StyledSourceEditorOptions)SourceEditorWidget.TextEditor.Options).UpdateStyleParent (value, loadedMimeType);
- base.Project = value;
- }
+
+
+ string ITextEditorImpl.ContextMenuPath {
+ get { return TextEditor.ContextMenuPath; }
+ set { TextEditor.ContextMenuPath = value; }
}
public override string TabPageLabel {
get { return GettextCatalog.GetString ("Source"); }
}
- uint autoSaveTimer = 0;
- void InformAutoSave ()
- {
- RemoveAutoSaveTimer ();
- autoSaveTimer = GLib.Timeout.Add (500, delegate {
- AutoSave.InformAutoSaveThread (Document);
- autoSaveTimer = 0;
- return false;
- });
- }
-
- void RemoveAutoSaveTimer ()
- {
- if (autoSaveTimer == 0)
- return;
- GLib.Source.Remove (autoSaveTimer);
- autoSaveTimer = 0;
- }
-
- bool wasEdited = false;
uint removeMarkerTimeout;
Queue<MessageBubbleTextMarker> markersToRemove = new Queue<MessageBubbleTextMarker> ();
@@ -176,54 +160,50 @@ namespace MonoDevelop.SourceEditor
while (markersToRemove.Count > 0) {
var _m = markersToRemove.Dequeue ();
currentErrorMarkers.Remove (_m);
- widget.TextEditor.Document.RemoveMarker (_m);
+ if (_m.LineSegment != null)
+ widget.TextEditor.Document.RemoveMarker (_m);
}
removeMarkerTimeout = 0;
return false;
});
}
- public SourceEditorView ()
+ public SourceEditorView (IReadonlyTextDocument document = null)
{
Counters.LoadedEditors++;
- currentFrameChanged = (EventHandler)DispatchService.GuiDispatch (new EventHandler (OnCurrentFrameChanged));
- executionLocationChanged = (EventHandler)DispatchService.GuiDispatch (new EventHandler (OnExecutionLocationChanged));
- breakpointAdded = (EventHandler<BreakpointEventArgs>)DispatchService.GuiDispatch (new EventHandler<BreakpointEventArgs> (OnBreakpointAdded));
- breakpointRemoved = (EventHandler<BreakpointEventArgs>)DispatchService.GuiDispatch (new EventHandler<BreakpointEventArgs> (OnBreakpointRemoved));
- breakpointStatusChanged = (EventHandler<BreakpointEventArgs>)DispatchService.GuiDispatch (new EventHandler<BreakpointEventArgs> (OnBreakpointStatusChanged));
widget = new SourceEditorWidget (this);
- widget.TextEditor.Document.SyntaxModeChanged += HandleSyntaxModeChanged;
+ if (document != null) {
+ var textDocument = document as TextDocument;
+ if (textDocument != null) {
+ widget.TextEditor.Document = textDocument;
+ } else {
+ widget.TextEditor.Document.Text = document.Text;
+ }
+ }
+
widget.TextEditor.Document.TextReplaced += HandleTextReplaced;
widget.TextEditor.Document.LineChanged += HandleLineChanged;
+ widget.TextEditor.Document.LineInserted += HandleLineChanged;
+ widget.TextEditor.Document.LineRemoved += HandleLineChanged;
widget.TextEditor.Document.BeginUndo += HandleBeginUndo;
widget.TextEditor.Document.EndUndo += HandleEndUndo;
- widget.TextEditor.Document.Undone += HandleUndone;
- widget.TextEditor.Document.Redone += HandleUndone;
widget.TextEditor.Document.TextReplacing += OnTextReplacing;
widget.TextEditor.Document.TextReplaced += OnTextReplaced;
widget.TextEditor.Document.ReadOnlyCheckDelegate = CheckReadOnly;
-
+ widget.TextEditor.Document.TextSet += HandleDocumentTextSet;
+
+
+ widget.TextEditor.TextViewMargin.LineShown += TextViewMargin_LineShown;
// widget.TextEditor.Document.DocumentUpdated += delegate {
// this.IsDirty = Document.IsDirty;
// };
widget.TextEditor.Caret.PositionChanged += HandlePositionChanged;
widget.TextEditor.IconMargin.ButtonPressed += OnIconButtonPress;
-
- debugStackLineMarker = new DebugStackLineTextMarker (widget.TextEditor);
- currentDebugLineMarker = new CurrentDebugLineTextMarker (widget.TextEditor);
-
- this.WorkbenchWindowChanged += HandleWorkbenchWindowChanged;
- this.ContentNameChanged += delegate {
- this.Document.FileName = this.ContentName;
- if (String.IsNullOrEmpty (ContentName) || !File.Exists (ContentName))
- return;
-
- lastSaveTimeUtc = File.GetLastWriteTimeUtc (ContentName);
- };
+ widget.TextEditor.TextArea.FocusOutEvent += TextArea_FocusOutEvent;
ClipbardRingUpdated += UpdateClipboardRing;
TextEditorService.FileExtensionAdded += HandleFileExtensionAdded;
@@ -231,14 +211,15 @@ namespace MonoDevelop.SourceEditor
breakpoints = DebuggingService.Breakpoints;
DebuggingService.DebugSessionStarted += OnDebugSessionStarted;
- DebuggingService.ExecutionLocationChanged += executionLocationChanged;
- DebuggingService.CurrentFrameChanged += currentFrameChanged;
- DebuggingService.StoppedEvent += currentFrameChanged;
- DebuggingService.ResumedEvent += currentFrameChanged;
- breakpoints.BreakpointAdded += breakpointAdded;
- breakpoints.BreakpointRemoved += breakpointRemoved;
- breakpoints.BreakpointStatusChanged += breakpointStatusChanged;
- breakpoints.BreakpointModified += breakpointStatusChanged;
+ DebuggingService.StoppedEvent += HandleTargetExited;
+ DebuggingService.ExecutionLocationChanged += OnExecutionLocationChanged;
+ DebuggingService.CurrentFrameChanged += OnCurrentFrameChanged;
+ DebuggingService.StoppedEvent += OnCurrentFrameChanged;
+ DebuggingService.ResumedEvent += OnCurrentFrameChanged;
+ breakpoints.BreakpointAdded += OnBreakpointAdded;
+ breakpoints.BreakpointRemoved += OnBreakpointRemoved;
+ breakpoints.BreakpointStatusChanged += OnBreakpointStatusChanged;
+ breakpoints.BreakpointModified += OnBreakpointStatusChanged;
DebuggingService.PinnedWatches.WatchAdded += OnWatchAdded;
DebuggingService.PinnedWatches.WatchRemoved += OnWatchRemoved;
DebuggingService.PinnedWatches.WatchChanged += OnWatchChanged;
@@ -246,15 +227,34 @@ namespace MonoDevelop.SourceEditor
TaskService.Errors.TasksAdded += UpdateTasks;
TaskService.Errors.TasksRemoved += UpdateTasks;
TaskService.JumpedToTask += HandleTaskServiceJumpedToTask;
- IdeApp.Preferences.ShowMessageBubblesChanged += HandleIdeAppPreferencesShowMessageBubblesChanged;
+ IdeApp.Preferences.ShowMessageBubbles.Changed += HandleIdeAppPreferencesShowMessageBubblesChanged;
TaskService.TaskToggled += HandleErrorListPadTaskToggled;
widget.TextEditor.Options.Changed += HandleWidgetTextEditorOptionsChanged;
- IdeApp.Preferences.DefaultHideMessageBubblesChanged += HandleIdeAppPreferencesDefaultHideMessageBubblesChanged;
+ IdeApp.Preferences.DefaultHideMessageBubbles.Changed += HandleIdeAppPreferencesDefaultHideMessageBubblesChanged;
Document.AddAnnotation (this);
+ if (document != null) {
+ Document.MimeType = document.MimeType;
+ Document.FileName = document.FileName;
+ }
FileRegistry.Add (this);
}
- void HandleLineChanged (object sender, LineEventArgs e)
+ void HandleDocumentTextSet (object sender, EventArgs e)
+ {
+ while (editSessions.Count > 0) {
+ EndSession ();
+ }
+ }
+
+ protected override void OnContentNameChanged ()
+ {
+ Document.FileName = ContentName;
+ if (!String.IsNullOrEmpty (ContentName) && File.Exists (ContentName))
+ lastSaveTimeUtc = File.GetLastWriteTimeUtc (ContentName);
+ base.OnContentNameChanged ();
+ }
+
+ void HandleLineChanged (object sender, Mono.TextEditor.LineEventArgs e)
{
UpdateBreakpoints ();
UpdateWidgetPositions ();
@@ -266,61 +266,42 @@ namespace MonoDevelop.SourceEditor
marker.GetLineHeight (widget.TextEditor);
}
}
+ var handler = LineChanged;
+ if (handler != null)
+ handler (this, new MonoDevelop.Ide.Editor.LineEventArgs (new DocumentLineWrapper (e.Line)));
}
void HandleTextReplaced (object sender, DocumentChangeEventArgs args)
{
if (Document.CurrentAtomicUndoOperationType == OperationType.Format)
return;
- if (!inLoad) {
- if (widget.TextEditor.Document.IsInAtomicUndo) {
- wasEdited = true;
- }
- else {
- InformAutoSave ();
- }
- }
int startIndex = args.Offset;
foreach (var marker in currentErrorMarkers) {
- if (marker.LineSegment.Contains (args.Offset) || marker.LineSegment.Contains (args.Offset + args.InsertionLength) || args.Offset < marker.LineSegment.Offset && marker.LineSegment.Offset < args.Offset + args.InsertionLength) {
+ var line = marker.LineSegment;
+ if (line == null || line.Contains (args.Offset) || line.Contains (args.Offset + args.InsertionLength) || args.Offset < line.Offset && line.Offset < args.Offset + args.InsertionLength) {
markersToRemove.Enqueue (marker);
}
}
ResetRemoveMarker ();
}
- void HandleSyntaxModeChanged (object sender, SyntaxModeChangeEventArgs e)
- {
- var oldProvider = e.OldMode as IQuickTaskProvider;
- if (oldProvider != null)
- widget.RemoveQuickTaskProvider (oldProvider);
- var newProvider = e.NewMode as IQuickTaskProvider;
- if (newProvider != null)
- widget.AddQuickTaskProvider (newProvider);
- }
-
-
void HandleEndUndo (object sender, TextDocument.UndoOperationEventArgs e)
{
- if (wasEdited)
- InformAutoSave ();
+ OnEndUndo (EventArgs.Empty);
}
void HandleBeginUndo (object sender, EventArgs e)
{
- wasEdited = false;
+ OnBeginUndo (EventArgs.Empty);
}
- void HandleUndone (object sender, TextDocument.UndoOperationEventArgs e)
- {
- AutoSave.InformAutoSaveThread (Document);
- }
void HandlePositionChanged (object sender, DocumentLocationEventArgs e)
{
OnCaretPositionSet (EventArgs.Empty);
FireCompletionContextChanged ();
+ OnCaretPositionChanged (EventArgs.Empty);
}
void HandleFileExtensionRemoved (object sender, FileExtensionEventArgs args)
@@ -337,7 +318,7 @@ namespace MonoDevelop.SourceEditor
AddFileExtension (args.Extension);
}
- Dictionary<TopLevelWidgetExtension,Gtk.Widget> widgetExtensions = new Dictionary<TopLevelWidgetExtension, Widget> ();
+ Dictionary<TopLevelWidgetExtension,Widget> widgetExtensions = new Dictionary<TopLevelWidgetExtension, Widget> ();
Dictionary<FileExtension,Tuple<TextLineMarker,DocumentLine>> markerExtensions = new Dictionary<FileExtension, Tuple<TextLineMarker,DocumentLine>> ();
void LoadExtensions ()
@@ -353,7 +334,7 @@ namespace MonoDevelop.SourceEditor
{
if (extension is TopLevelWidgetExtension) {
var widgetExtension = (TopLevelWidgetExtension)extension;
- var w = widgetExtension.CreateWidget ();
+ Widget w = widgetExtension.CreateWidget ();
int x, y;
if (!CalcWidgetPosition (widgetExtension, w, out x, out y)) {
w.Destroy ();
@@ -371,22 +352,22 @@ namespace MonoDevelop.SourceEditor
if (line == null)
return;
- var marker = lineExt.CreateMarker ();
+ var marker = (TextLineMarker)lineExt.CreateMarker ();
widget.TextEditor.Document.AddMarker (line, marker);
widget.TextEditor.QueueDraw ();
- markerExtensions [extension] = new Tuple<TextLineMarker,DocumentLine> (marker, line);
+ markerExtensions [extension] = new Tuple<TextLineMarker, DocumentLine> (marker, line);
}
}
void HandleScrollToViewRequested (object sender, EventArgs e)
{
var widgetExtension = (TopLevelWidgetExtension)sender;
- Gtk.Widget w;
+ Widget w;
if (widgetExtensions.TryGetValue (widgetExtension, out w)) {
int x, y;
widget.TextEditor.TextArea.GetTopLevelWidgetPosition (w, out x, out y);
var size = w.SizeRequest ();
- Gtk.Application.Invoke (delegate {
+ Application.Invoke (delegate {
widget.TextEditor.ScrollTo (new Gdk.Rectangle (x, y, size.Width, size.Height));
});
}
@@ -396,7 +377,7 @@ namespace MonoDevelop.SourceEditor
{
if (extension is TopLevelWidgetExtension) {
var widgetExtension = (TopLevelWidgetExtension)extension;
- Gtk.Widget w;
+ Widget w;
if (!widgetExtensions.TryGetValue (widgetExtension, out w))
return;
widgetExtensions.Remove (widgetExtension);
@@ -428,7 +409,7 @@ namespace MonoDevelop.SourceEditor
}
}
- bool CalcWidgetPosition (TopLevelWidgetExtension widgetExtension, Gtk.Widget w, out int x, out int y)
+ bool CalcWidgetPosition (TopLevelWidgetExtension widgetExtension, Widget w, out int x, out int y)
{
DocumentLine line = widget.TextEditor.Document.GetLine (widgetExtension.Line);
if (line == null) {
@@ -437,10 +418,10 @@ namespace MonoDevelop.SourceEditor
}
int lw, lh;
- var wrapper = widget.TextEditor.TextViewMargin.GetLayout (line);
- wrapper.Layout.GetPixelSize (out lw, out lh);
- if (wrapper.IsUncached)
- wrapper.Dispose ();
+ var tmpWrapper = widget.TextEditor.TextViewMargin.GetLayout (line);
+ tmpWrapper.Layout.GetPixelSize (out lw, out lh);
+ if (tmpWrapper.IsUncached)
+ tmpWrapper.Dispose ();
lh = (int) TextEditor.TextViewMargin.GetLineHeight (widgetExtension.Line);
x = (int)widget.TextEditor.TextViewMargin.XOffset + lw + 4;
y = (int)widget.TextEditor.LineToY (widgetExtension.Line);
@@ -492,16 +473,18 @@ namespace MonoDevelop.SourceEditor
}
x += widgetExtension.OffsetX;
y += widgetExtension.OffsetY;
+
+ //We don't want Widget to appear outside TextArea(cut off)...
+ x = Math.Max (0, x);
+ y = Math.Max (0, y);
return true;
}
- void HandleWorkbenchWindowChanged (object sender, EventArgs e)
+ protected override void OnWorkbenchWindowChanged ()
{
- if (WorkbenchWindow != null) {
- widget.TextEditor.ExtensionContext = WorkbenchWindow.ExtensionContext;
+ base.OnWorkbenchWindowChanged ();
+ if (WorkbenchWindow != null)
WorkbenchWindow.ActiveViewContentChanged += HandleActiveViewContentChanged;
- this.WorkbenchWindowChanged -= HandleWorkbenchWindowChanged;
- }
}
void HandleActiveViewContentChanged (object o, ActiveViewContentEventArgs e)
@@ -520,7 +503,7 @@ namespace MonoDevelop.SourceEditor
{
var task = e.Tasks != null ? e.Tasks.FirstOrDefault () : null;
var doc = Document;
- if (task == null || doc == null || task.FileName != doc.FileName || this.TextEditor == null)
+ if (task == null || doc == null || task.FileName != doc.FileName || TextEditor == null)
return;
var lineSegment = doc.GetLine (task.Line);
if (lineSegment == null)
@@ -529,12 +512,12 @@ namespace MonoDevelop.SourceEditor
if (marker == null)
return;
- marker.SetPrimaryError (task.Description);
+ marker.SetPrimaryError (task);
if (TextEditor != null && TextEditor.IsComposited) {
/*if (messageBubbleHighlightPopupWindow != null)
messageBubbleHighlightPopupWindow.Destroy ();*/
- /* messageBubbleHighlightPopupWindow = new MessageBubbleHighlightPopupWindow (this, marker);
+ /* messageBherbbleHighlightPopupWindow = new MessageBubbleHighlightPopupWindow (this, marker);
messageBubbleHighlightPopupWindow.Destroyed += delegate {
messageBubbleHighlightPopupWindow = null;
};
@@ -542,61 +525,86 @@ namespace MonoDevelop.SourceEditor
}
}
- void HandleIdeAppPreferencesDefaultHideMessageBubblesChanged (object sender, PropertyChangedEventArgs e)
+ void HandleIdeAppPreferencesDefaultHideMessageBubblesChanged (object sender, EventArgs e)
{
currentErrorMarkers.ForEach (marker => marker.IsVisible =  !IdeApp.Preferences.DefaultHideMessageBubbles);
- this.TextEditor.QueueDraw ();
+ TextEditor.QueueDraw ();
}
- void HandleIdeAppPreferencesShowMessageBubblesChanged (object sender, PropertyChangedEventArgs e)
+ void HandleIdeAppPreferencesShowMessageBubblesChanged (object sender, EventArgs e)
{
UpdateTasks (null, null);
}
void HandleErrorListPadTaskToggled (object sender, TaskEventArgs e)
{
- this.TextEditor.QueueDraw ();
+ TextEditor.QueueDraw ();
}
MessageBubbleCache messageBubbleCache;
- List<MessageBubbleTextMarker> currentErrorMarkers = new List<MessageBubbleTextMarker> ();
-
- void UpdateTasks (object sender, TaskEventArgs e)
- {
- Task[] tasks = TaskService.Errors.GetFileTasks (ContentName);
- if (tasks == null)
- return;
- DisposeErrorMarkers (); // disposes messageBubbleCache as well.
- if (IdeApp.Preferences.ShowMessageBubbles == ShowMessageBubbles.Never)
- return;
- using (var undo = Document.OpenUndoGroup ()) {
- if (messageBubbleCache != null)
- messageBubbleCache.Dispose ();
- messageBubbleCache = new MessageBubbleCache (widget.TextEditor);
-
- foreach (Task task in tasks) {
- if (task.Severity == TaskSeverity.Error || task.Severity == TaskSeverity.Warning) {
- if (IdeApp.Preferences.ShowMessageBubbles == ShowMessageBubbles.ForErrors && task.Severity == TaskSeverity.Warning)
- continue;
- DocumentLine lineSegment = widget.Document.GetLine (task.Line);
- if (lineSegment == null)
- continue;
- var marker = currentErrorMarkers.FirstOrDefault (m => m.LineSegment == lineSegment);
- if (marker != null) {
- marker.AddError (task, task.Severity == TaskSeverity.Error, task.Description);
+ List<MessageBubbleTextMarker> currentErrorMarkers = new List<MessageBubbleTextMarker> ();
+ CancellationTokenSource messageBubbleUpdateSource = new CancellationTokenSource ();
+
+ void UpdateTasks (object sender, TaskEventArgs e)
+ {
+ TaskListEntry [] tasks = TaskService.Errors.GetFileTasks (ContentName);
+ if (tasks == null)
+ return;
+ DisposeErrorMarkers (); // disposes messageBubbleCache as well.
+ if (IdeApp.Preferences.ShowMessageBubbles == ShowMessageBubbles.Never)
+ return;
+ messageBubbleCache = new MessageBubbleCache (widget.TextEditor);
+ CancelMessageBubbleUpdate ();
+ var token = messageBubbleUpdateSource;
+
+ Task.Run (delegate {
+ var errorMarkers = new List<MessageBubbleTextMarker> ();
+ foreach (TaskListEntry task in tasks) {
+ if (token.IsCancellationRequested)
+ return null;
+ if (task.Severity == TaskSeverity.Error || task.Severity == TaskSeverity.Warning) {
+ if (IdeApp.Preferences.ShowMessageBubbles == ShowMessageBubbles.ForErrors && task.Severity == TaskSeverity.Warning)
+ continue;
+ var errorTextMarker = new MessageBubbleTextMarker (messageBubbleCache, task, task.Severity == TaskSeverity.Error, task.Description);
+ errorMarkers.Add (errorTextMarker);
+
+ errorTextMarker.IsVisible = !IdeApp.Preferences.DefaultHideMessageBubbles;
+ }
+ }
+ return errorMarkers;
+ }).ContinueWith (t => {
+ if (token.IsCancellationRequested)
+ return;
+ Application.Invoke (delegate {
+ if (token.IsCancellationRequested)
+ return;
+ var newErrorMarkers = new List<MessageBubbleTextMarker> ();
+ foreach (var marker in t.Result) {
+ if (token.IsCancellationRequested)
+ return;
+ var lineSegment = widget.Document.GetLine (marker.Task.Line);
+ if (lineSegment == null)
continue;
- }
- MessageBubbleTextMarker errorTextMarker = new MessageBubbleTextMarker (messageBubbleCache, task, lineSegment, task.Severity == TaskSeverity.Error, task.Description);
- currentErrorMarkers.Add (errorTextMarker);
-
- errorTextMarker.IsVisible =  !IdeApp.Preferences.DefaultHideMessageBubbles;
- widget.Document.AddMarker (lineSegment, errorTextMarker, false);
+ var oldMarker = lineSegment.Markers.OfType<MessageBubbleTextMarker> ().FirstOrDefault ();
+ if (oldMarker != null) {
+ oldMarker.AddError (marker.Task, marker.Task.Severity == TaskSeverity.Error, marker.Task.Description);
+ } else {
+ marker.LineSegment = lineSegment;
+ widget.Document.AddMarker (lineSegment, marker, false, 0);
+ newErrorMarkers.Add (marker);
+ }
}
- }
- }
- widget.TextEditor.QueueDraw ();
- }
-
+ this.currentErrorMarkers = newErrorMarkers;
+ });
+ });
+ }
+
+ void CancelMessageBubbleUpdate ()
+ {
+ messageBubbleUpdateSource.Cancel ();
+ messageBubbleUpdateSource = new CancellationTokenSource ();
+ }
+
void DisposeErrorMarkers ()
{
//the window has a reference to the markers we're destroying
@@ -604,7 +612,7 @@ namespace MonoDevelop.SourceEditor
//NRE and bring down MD
/*if (messageBubbleHighlightPopupWindow != null)
messageBubbleHighlightPopupWindow.Destroy ();*/
-
+
currentErrorMarkers.ForEach (em => {
widget.Document.RemoveMarker (em);
em.Dispose ();
@@ -621,19 +629,19 @@ namespace MonoDevelop.SourceEditor
return text;
}
- public override void Save (string fileName)
+ public override Task Save (FileSaveInformation fileSaveInformation)
{
- Save (fileName, this.encoding);
+ return Save (fileSaveInformation.FileName, fileSaveInformation.Encoding ?? encoding);
}
- public void Save (string fileName, Encoding encoding)
+ public async Task Save (string fileName, Encoding encoding)
{
if (widget.HasMessageBar)
return;
-
- if (!string.IsNullOrEmpty (ContentName))
- AutoSave.RemoveAutoSaveFile (ContentName);
-
+ if (encoding != null) {
+ this.encoding = encoding;
+ UpdateTextDocumentEncoding ();
+ }
if (ContentName != fileName) {
FileService.RequestFileEdit ((FilePath) fileName);
writeAllowed = true;
@@ -641,7 +649,7 @@ namespace MonoDevelop.SourceEditor
}
if (warnOverwrite) {
- if (fileName == ContentName) {
+ if (string.Equals (fileName, ContentName, FilePath.PathComparison)) {
string question = GettextCatalog.GetString (
"This file {0} has been changed outside of {1}. Are you sure you want to overwrite the file?",
fileName, BrandingService.ApplicationName
@@ -661,15 +669,14 @@ namespace MonoDevelop.SourceEditor
var document = WorkbenchWindow.Document;
if (formatter.SupportsOnTheFlyFormatting) {
using (var undo = TextEditor.OpenUndoGroup ()) {
- formatter.OnTheFlyFormat (document, 0, Document.TextLength);
- wasEdited = false;
+ formatter.OnTheFlyFormat (WorkbenchWindow.Document.Editor, WorkbenchWindow.Document);
}
} else {
var text = document.Editor.Text;
var policies = document.Project != null ? document.Project.Policies : PolicyService.DefaultPolicies;
string formattedText = formatter.FormatText (policies, text);
if (formattedText != null && formattedText != text) {
- document.Editor.Replace (0, text.Length, formattedText);
+ document.Editor.ReplaceText (0, text.Length, formattedText);
}
}
}
@@ -678,7 +685,7 @@ namespace MonoDevelop.SourceEditor
}
}
- FileRegistry.SuspendFileWatch = true;
+ FileRegistry.SkipNextChange (fileName);
try {
object attributes = null;
if (File.Exists (fileName)) {
@@ -722,7 +729,8 @@ namespace MonoDevelop.SourceEditor
// writeBom =!Mono.TextEditor.Utils.TextFileUtility.IsASCII (writeText);
}
}
- Mono.TextEditor.Utils.TextFileUtility.WriteText (fileName, writeText, writeEncoding, writeBom);
+ await MonoDevelop.Core.Text.TextFileUtility.WriteTextAsync (fileName, writeText, writeEncoding, writeBom);
+ this.encoding = writeEncoding;
} catch (InvalidEncodingException) {
var result = MessageService.AskQuestion (GettextCatalog.GetString ("Can't save file with current codepage."),
GettextCatalog.GetString ("Some unicode characters in this file could not be saved with the current encoding.\nDo you want to resave this file as Unicode ?\nYou can choose another encoding in the 'save as' dialog."),
@@ -730,9 +738,9 @@ namespace MonoDevelop.SourceEditor
AlertButton.Cancel,
new AlertButton (GettextCatalog.GetString ("Save as Unicode")));
if (result != AlertButton.Cancel) {
- this.hadBom = true;
+ hadBom = true;
this.encoding = Encoding.UTF8;
- Mono.TextEditor.Utils.TextFileUtility.WriteText (fileName, Document.Text, encoding, hadBom);
+ MonoDevelop.Core.Text.TextFileUtility.WriteText (fileName, Document.Text, encoding, hadBom);
} else {
return;
}
@@ -747,10 +755,8 @@ namespace MonoDevelop.SourceEditor
} catch (UnauthorizedAccessException e) {
LoggingService.LogError ("Error while saving file", e);
MessageService.ShowError (GettextCatalog.GetString ("Can't save file - access denied"), e.Message);
- } finally {
- FileRegistry.SuspendFileWatch = false;
}
-
+
// if (encoding != null)
// se.Buffer.SourceEncoding = encoding;
// TextFileService.FireCommitCountChanges (this);
@@ -758,17 +764,12 @@ namespace MonoDevelop.SourceEditor
ContentName = fileName;
UpdateMimeType (fileName);
Document.SetNotDirtyState ();
- this.IsDirty = false;
- }
-
- public override void DiscardChanges ()
- {
- if (!string.IsNullOrEmpty (ContentName))
- AutoSave.RemoveAutoSaveFile (ContentName);
+ IsDirty = false;
}
- public override void LoadNew (Stream content, string mimeType)
+ public void InformLoadComplete ()
{
+ /*
Document.MimeType = mimeType;
string text = null;
if (content != null) {
@@ -778,79 +779,40 @@ namespace MonoDevelop.SourceEditor
}
this.CreateDocumentParsedHandler ();
RunFirstTimeFoldUpdate (text);
+ */
Document.InformLoadComplete ();
}
- public override void Load (string fileName)
+ public override Task LoadNew (Stream content, string mimeType)
{
- Load (fileName, null);
+ throw new NotSupportedException ("Moved to TextEditorViewContent.LoadNew.");
}
-
- void RunFirstTimeFoldUpdate (string text)
+
+ public override Task Load (FileOpenInformation fileOpenInformation)
{
- if (string.IsNullOrEmpty (text))
- return;
- ParsedDocument parsedDocument = null;
-
- var foldingParser = TypeSystemService.GetFoldingParser (Document.MimeType);
- if (foldingParser != null) {
- parsedDocument = foldingParser.Parse (Document.FileName, text);
- } else {
- var normalParser = TypeSystemService.GetParser (Document.MimeType);
- if (normalParser != null) {
- using (var sr = new StringReader (text))
- parsedDocument = normalParser.Parse (true, Document.FileName, sr, null);
- }
- }
- if (parsedDocument != null)
- widget.UpdateParsedDocument (parsedDocument);
+ return Load (fileOpenInformation.FileName, fileOpenInformation.Encoding, fileOpenInformation.IsReloadOperation);
}
- void CreateDocumentParsedHandler ()
- {
- this.WorkbenchWindowChanged += delegate {
- if (WorkbenchWindow == null)
- return;
- WorkbenchWindow.DocumentChanged += delegate {
- if (WorkbenchWindow.Document == null)
- return;
- foreach (var provider in WorkbenchWindow.Document.GetContents<IQuickTaskProvider> ()) {
- widget.AddQuickTaskProvider (provider);
- }
- foreach (var provider in WorkbenchWindow.Document.GetContents<IUsageProvider> ()) {
- widget.AddUsageTaskProvider (provider);
- }
- ownerDocument = WorkbenchWindow.Document;
- ownerDocument.DocumentParsed += HandleDocumentParsed;
- };
- };
- }
-
- MonoDevelop.Ide.Gui.Document ownerDocument;
- protected MonoDevelop.Ide.Gui.Document OwnerDocument {
- get { return ownerDocument; }
- }
-
- protected virtual void HandleDocumentParsed (object sender, EventArgs e)
- {
- widget.UpdateParsedDocument (ownerDocument.ParsedDocument);
- }
-
- void IEncodedTextContent.Load (string fileName, Encoding loadEncoding)
+ protected virtual string ProcessLoadText (string text)
{
- Load (fileName, loadEncoding);
+ return text;
}
- protected virtual string ProcessLoadText (string text)
+ void UpdateTextDocumentEncoding ()
{
- return text;
+ if (wrapper != null) {
+ wrapper.Document.Encoding = encoding;
+ wrapper.Document.UseBom = hadBom;
+ }
}
- public void Load (string fileName, Encoding loadEncoding, bool reload = false)
+ public Task Load (string fileName, Encoding loadEncoding, bool reload = false)
{
- // Handle the "reload" case.
- if (ContentName == fileName)
- AutoSave.RemoveAutoSaveFile (fileName);
+ var document = Document;
+ if (document == null)
+ return TaskUtil.Default<object> ();
+ document.TextReplaced -= OnTextReplaced;
+
if (warnOverwrite) {
warnOverwrite = false;
widget.RemoveMessageBar ();
@@ -860,47 +822,45 @@ namespace MonoDevelop.SourceEditor
UpdateMimeType (fileName);
string text = null;
bool didLoadCleanly;
- if (AutoSave.AutoSaveExists (fileName)) {
+ if (!reload && AutoSave.AutoSaveExists (fileName)) {
widget.ShowAutoSaveWarning (fileName);
- this.encoding = loadEncoding;
+ encoding = loadEncoding;
didLoadCleanly = false;
}
else {
- inLoad = true;
if (loadEncoding == null) {
- text = TextFileUtility.ReadAllText (fileName, out hadBom, out encoding);
+ text = MonoDevelop.Core.Text.TextFileUtility.ReadAllText (fileName, out hadBom, out encoding);
} else {
encoding = loadEncoding;
- text = TextFileUtility.ReadAllText (fileName, loadEncoding, out hadBom);
+ text = MonoDevelop.Core.Text.TextFileUtility.ReadAllText (fileName, loadEncoding, out hadBom);
}
text = ProcessLoadText (text);
if (reload) {
- Document.Replace (0, Document.TextLength, text);
- Document.DiffTracker.Reset ();
+ document.Replace (0, Document.TextLength, text);
+ document.DiffTracker.Reset ();
} else {
- Document.Text = text;
- Document.DiffTracker.SetBaseDocument (Document.CreateDocumentSnapshot ());
+ document.Text = text;
+ document.DiffTracker.SetBaseDocument (Document.CreateDocumentSnapshot ());
}
- inLoad = false;
didLoadCleanly = true;
}
// TODO: Would be much easier if the view would be created after the containers.
- CreateDocumentParsedHandler ();
ContentName = fileName;
lastSaveTimeUtc = File.GetLastWriteTimeUtc (ContentName);
- RunFirstTimeFoldUpdate (text);
widget.TextEditor.Caret.Offset = 0;
UpdateExecutionLocation ();
UpdateBreakpoints ();
UpdatePinnedWatches ();
LoadExtensions ();
- this.IsDirty = !didLoadCleanly;
+ IsDirty = !didLoadCleanly;
UpdateTasks (null, null);
widget.TextEditor.TextArea.SizeAllocated += HandleTextEditorVAdjustmentChanged;
if (didLoadCleanly) {
- Document.InformLoadComplete ();
widget.EnsureCorrectEolMarker (fileName);
}
+ UpdateTextDocumentEncoding ();
+ document.TextReplaced += OnTextReplaced;
+ return TaskUtil.Default<object> ();
}
void HandleTextEditorVAdjustmentChanged (object sender, EventArgs e)
@@ -911,8 +871,8 @@ namespace MonoDevelop.SourceEditor
internal void LoadSettings ()
{
- FileSettingsStore.Settings settings;
- if (widget == null || string.IsNullOrEmpty (ContentName) || !FileSettingsStore.TryGetValue (ContentName, out settings))
+ MonoDevelop.Ide.Editor.FileSettingsStore.Settings settings;
+ if (widget == null || string.IsNullOrEmpty (ContentName) || !MonoDevelop.Ide.Editor.FileSettingsStore.TryGetValue (ContentName, out settings))
return;
widget.TextEditor.Caret.Offset = settings.CaretOffset;
@@ -934,7 +894,7 @@ namespace MonoDevelop.SourceEditor
// }
if (string.IsNullOrEmpty (ContentName))
return;
- FileSettingsStore.Store (ContentName, new FileSettingsStore.Settings () {
+ MonoDevelop.Ide.Editor.FileSettingsStore.Store (ContentName, new MonoDevelop.Ide.Editor.FileSettingsStore.Settings {
CaretOffset = widget.TextEditor.Caret.Offset,
vAdjustment = widget.TextEditor.VAdjustment.Value,
hAdjustment = widget.TextEditor.HAdjustment.Value//,
@@ -943,11 +903,10 @@ namespace MonoDevelop.SourceEditor
}
bool warnOverwrite = false;
- bool inLoad = false;
Encoding encoding;
bool hadBom = false;
- internal void ReplaceContent (string fileName, string content, Encoding encoding)
+ internal void ReplaceContent (string fileName, string content, Encoding enc)
{
if (warnOverwrite) {
warnOverwrite = false;
@@ -956,38 +915,36 @@ namespace MonoDevelop.SourceEditor
}
UpdateMimeType (fileName);
- inLoad = true;
Document.Replace (0, Document.TextLength, content);
Document.DiffTracker.Reset ();
- inLoad = false;
- this.encoding = encoding;
+ encoding = enc;
ContentName = fileName;
- RunFirstTimeFoldUpdate (content);
- CreateDocumentParsedHandler ();
UpdateExecutionLocation ();
UpdateBreakpoints ();
UpdatePinnedWatches ();
LoadExtensions ();
IsDirty = false;
- Document.InformLoadComplete ();
+ UpdateTextDocumentEncoding ();
+ InformLoadComplete ();
}
-
+
void UpdateMimeType (string fileName)
{
- // Look for a mime type for which there is a syntax mode
- string mimeType = DesktopService.GetMimeTypeForUri (fileName);
- if (loadedMimeType != mimeType) {
- loadedMimeType = mimeType;
- if (mimeType != null) {
- foreach (string mt in DesktopService.GetMimeTypeInheritanceChain (loadedMimeType)) {
- if (Mono.TextEditor.Highlighting.SyntaxModeService.GetSyntaxMode (null, mt) != null) {
- Document.MimeType = mt;
- widget.TextEditor.TextEditorResolverProvider = TextEditorResolverService.GetProvider (mt);
- break;
- }
+ Document.MimeType = DesktopService.GetMimeTypeForUri (fileName);
+
+ //if the mimetype doesn't have a syntax mode, try to load one for its base mimetypes
+ var sm = Document.SyntaxMode as Mono.TextEditor.Highlighting.SyntaxMode;
+ if (sm != null && sm.MimeType == null) {
+ foreach (string mt in DesktopService.GetMimeTypeInheritanceChain (Document.MimeType)) {
+ var syntaxMode = Mono.TextEditor.Highlighting.SyntaxModeService.GetSyntaxMode (null, mt);
+ if (syntaxMode != null) {
+ Document.SyntaxMode = syntaxMode;
+ break;
}
}
- ((StyledSourceEditorOptions)SourceEditorWidget.TextEditor.Options).UpdateStyleParent (Project, loadedMimeType);
+ }
+ if (Document.MimeType != null) {
+ widget.TextEditor.TextEditorResolverProvider = TextEditorResolverService.GetProvider (Document.MimeType);
}
}
@@ -997,52 +954,56 @@ namespace MonoDevelop.SourceEditor
public override void Dispose ()
{
+ if (isDisposed)
+ return;
+ isDisposed = true;
+
+ CancelMessageBubbleUpdate ();
ClearExtensions ();
FileRegistry.Remove (this);
- RemoveAutoSaveTimer ();
-
+
StoreSettings ();
- this.isDisposed = true;
Counters.LoadedEditors--;
/* if (messageBubbleHighlightPopupWindow != null)
messageBubbleHighlightPopupWindow.Destroy ();*/
- IdeApp.Preferences.DefaultHideMessageBubblesChanged -= HandleIdeAppPreferencesDefaultHideMessageBubblesChanged;
- IdeApp.Preferences.ShowMessageBubblesChanged -= HandleIdeAppPreferencesShowMessageBubblesChanged;
+ IdeApp.Preferences.DefaultHideMessageBubbles.Changed -= HandleIdeAppPreferencesDefaultHideMessageBubblesChanged;
+ IdeApp.Preferences.ShowMessageBubbles.Changed -= HandleIdeAppPreferencesShowMessageBubblesChanged;
TaskService.TaskToggled -= HandleErrorListPadTaskToggled;
DisposeErrorMarkers ();
ClipbardRingUpdated -= UpdateClipboardRing;
- widget.TextEditor.Document.SyntaxModeChanged -= HandleSyntaxModeChanged;
widget.TextEditor.Document.TextReplaced -= HandleTextReplaced;
widget.TextEditor.Document.LineChanged -= HandleLineChanged;
widget.TextEditor.Document.BeginUndo -= HandleBeginUndo;
widget.TextEditor.Document.EndUndo -= HandleEndUndo;
- widget.TextEditor.Document.Undone -= HandleUndone;
- widget.TextEditor.Document.Redone -= HandleUndone;
widget.TextEditor.Caret.PositionChanged -= HandlePositionChanged;
widget.TextEditor.IconMargin.ButtonPressed -= OnIconButtonPress;
widget.TextEditor.Document.TextReplacing -= OnTextReplacing;
widget.TextEditor.Document.TextReplaced -= OnTextReplaced;
widget.TextEditor.Document.ReadOnlyCheckDelegate = null;
widget.TextEditor.Options.Changed -= HandleWidgetTextEditorOptionsChanged;
+ widget.TextEditor.TextViewMargin.LineShown -= TextViewMargin_LineShown;
+ widget.TextEditor.TextArea.FocusOutEvent -= TextArea_FocusOutEvent;
+ widget.TextEditor.Document.TextSet -= HandleDocumentTextSet;
TextEditorService.FileExtensionAdded -= HandleFileExtensionAdded;
TextEditorService.FileExtensionRemoved -= HandleFileExtensionRemoved;
- DebuggingService.ExecutionLocationChanged -= executionLocationChanged;
+ DebuggingService.ExecutionLocationChanged -= OnExecutionLocationChanged;
DebuggingService.DebugSessionStarted -= OnDebugSessionStarted;
- DebuggingService.CurrentFrameChanged -= currentFrameChanged;
- DebuggingService.StoppedEvent -= currentFrameChanged;
- DebuggingService.ResumedEvent -= currentFrameChanged;
- breakpoints.BreakpointAdded -= breakpointAdded;
- breakpoints.BreakpointRemoved -= breakpointRemoved;
- breakpoints.BreakpointStatusChanged -= breakpointStatusChanged;
- breakpoints.BreakpointModified -= breakpointStatusChanged;
+ DebuggingService.StoppedEvent -= HandleTargetExited;
+ DebuggingService.CurrentFrameChanged -= OnCurrentFrameChanged;
+ DebuggingService.StoppedEvent -= OnCurrentFrameChanged;
+ DebuggingService.ResumedEvent -= OnCurrentFrameChanged;
+ breakpoints.BreakpointAdded -= OnBreakpointAdded;
+ breakpoints.BreakpointRemoved -= OnBreakpointRemoved;
+ breakpoints.BreakpointStatusChanged -= OnBreakpointStatusChanged;
+ breakpoints.BreakpointModified -= OnBreakpointStatusChanged;
DebuggingService.PinnedWatches.WatchAdded -= OnWatchAdded;
DebuggingService.PinnedWatches.WatchRemoved -= OnWatchRemoved;
DebuggingService.PinnedWatches.WatchChanged -= OnWatchChanged;
@@ -1057,32 +1018,25 @@ namespace MonoDevelop.SourceEditor
debugStackLineMarker = null;
currentDebugLineMarker = null;
- executionLocationChanged = null;
- currentFrameChanged = null;
- breakpointAdded = null;
- breakpointRemoved = null;
- breakpointStatusChanged = null;
-
- if (ownerDocument != null) {
- ownerDocument.DocumentParsed -= HandleDocumentParsed;
- ownerDocument = null;
- }
-
RemoveMarkerQueue ();
+ widget.Dispose ();
+ if (wrapper != null) {
+ wrapper.Dispose ();
+ wrapper = null;
+ }
+ this.Project = null;
}
-
- public Ambience GetAmbience ()
- {
- string file = this.IsUntitled ? this.UntitledName : this.ContentName;
- return AmbienceService.GetAmbienceForFile (file);
- }
-
bool CheckReadOnly (int line)
{
if (!writeAccessChecked && !IsUntitled) {
writeAccessChecked = true;
- writeAllowed = FileService.RequestFileEdit (ContentName, false);
+ try {
+ writeAllowed = FileService.RequestFileEdit (ContentName);
+ } catch (Exception e) {
+ IdeApp.Workbench.StatusBar.ShowError (e.Message);
+ writeAllowed = false;
+ }
}
return IsUntitled || writeAllowed;
}
@@ -1096,9 +1050,9 @@ namespace MonoDevelop.SourceEditor
void OnTextReplaced (object s, DocumentChangeEventArgs a)
{
- this.IsDirty = Document.IsDirty;
+ IsDirty = Document.IsDirty;
- DocumentLocation location = Document.OffsetToLocation (a.Offset);
+ var location = Document.OffsetToLocation (a.Offset);
int i = 0, lines = 0;
while (i != -1 && i < oldReplaceText.Length) {
@@ -1136,35 +1090,38 @@ namespace MonoDevelop.SourceEditor
void UpdateExecutionLocation ()
{
+ if (currentDebugLineMarker != null || debugStackLineMarker != null) {
+ RemoveDebugMarkers ();
+ widget.TextEditor.QueueDraw ();
+ }
if (DebuggingService.IsPaused) {
var location = CheckLocationIsInFile (DebuggingService.NextStatementLocation)
?? CheckFrameIsInFile (DebuggingService.CurrentFrame)
?? CheckFrameIsInFile (DebuggingService.GetCurrentVisibleFrame ());
if (location != null) {
- if (lastDebugLine == location.Line)
- return;
RemoveDebugMarkers ();
- lastDebugLine = location.Line;
- var segment = widget.TextEditor.Document.GetLine (lastDebugLine);
+ var segment = widget.TextEditor.Document.GetLine (location.Line);
if (segment != null) {
+ int offset, length;
+ if (location.Line > 0 && location.Column > 0 && location.EndLine > 0 && location.EndColumn > 0) {
+ offset = widget.TextEditor.LocationToOffset (location.Line, location.Column);
+ length = widget.TextEditor.LocationToOffset (location.EndLine, location.EndColumn) - offset;
+ } else {
+ offset = segment.Offset;
+ length = segment.Length;
+ }
if (DebuggingService.CurrentFrameIndex == 0) {
- currentLineSegment = segment;
- widget.TextEditor.Document.AddMarker (segment, currentDebugLineMarker);
+ currentDebugLineMarker = new CurrentDebugLineTextMarker (widget.TextEditor, offset, length);
+ currentDebugLineMarker.AddTo (widget.TextEditor.Document, segment);
} else {
- debugStackSegment = segment;
- widget.TextEditor.Document.AddMarker (segment, debugStackLineMarker);
+ debugStackLineMarker = new DebugStackLineTextMarker (widget.TextEditor, offset, length);
+ debugStackLineMarker.AddTo (widget.TextEditor.Document, segment);
}
widget.TextEditor.QueueDraw ();
}
return;
}
}
-
- if (currentLineSegment != null || debugStackSegment != null) {
- RemoveDebugMarkers ();
- lastDebugLine = -1;
- widget.TextEditor.QueueDraw ();
- }
}
SourceLocation CheckLocationIsInFile (SourceLocation location)
@@ -1182,13 +1139,13 @@ namespace MonoDevelop.SourceEditor
void RemoveDebugMarkers ()
{
- if (currentLineSegment != null) {
- widget.TextEditor.Document.RemoveMarker (currentDebugLineMarker);
- currentLineSegment = null;
+ if (currentDebugLineMarker != null) {
+ currentDebugLineMarker.Remove ();
+ currentDebugLineMarker = null;
}
- if (debugStackSegment != null) {
- widget.TextEditor.Document.RemoveMarker (debugStackLineMarker);
- debugStackSegment = null;
+ if (debugStackLineMarker != null) {
+ debugStackLineMarker.Remove ();
+ debugStackLineMarker = null;
}
}
@@ -1225,10 +1182,10 @@ namespace MonoDevelop.SourceEditor
if (w.OffsetX < 0) {
w.OffsetY = (int)widget.TextEditor.LineToY (w.Line);
int lw, lh;
- var wrapper = widget.TextEditor.TextViewMargin.GetLayout (line);
- wrapper.Layout.GetPixelSize (out lw, out lh);
- if (wrapper.IsUncached)
- wrapper.Dispose ();
+ var tmpWrapper = widget.TextEditor.TextViewMargin.GetLayout (line);
+ tmpWrapper.Layout.GetPixelSize (out lw, out lh);
+ if (tmpWrapper.IsUncached)
+ tmpWrapper.Dispose ();
w.OffsetX = (int)widget.TextEditor.TextViewMargin.XOffset + lw + 4;
}
wi.Widget = new PinnedWatchWidget (widget.TextEditor, w);
@@ -1250,7 +1207,6 @@ namespace MonoDevelop.SourceEditor
foreach (var marker in currentErrorMarkers) {
marker.IsVisible = false;
}
- DebuggingService.DebuggerSession.TargetExited += HandleTargetExited;
}
void HandleTargetExited (object sender, EventArgs e)
@@ -1304,7 +1260,7 @@ namespace MonoDevelop.SourceEditor
foreach (var bp in breakpoints.GetBreakpointsAtFile (fp.FullPath)) {
count++;
if (i < breakpointSegments.Count) {
- int lineNumber = document.OffsetToLineNumber (breakpointSegments [i].Offset);
+ int lineNumber = document.OffsetToLineNumber (breakpointSegments [i].TextMarker.Offset);
if (lineNumber != bp.Line) {
mismatch = true;
break;
@@ -1325,10 +1281,12 @@ namespace MonoDevelop.SourceEditor
foreach (var line in breakpointSegments) {
if (line == null)
continue;
- lineNumbers.Add (document.OffsetToLineNumber (line.Offset));
- document.RemoveMarker (line, typeof(BreakpointTextMarker));
- document.RemoveMarker (line, typeof(DisabledBreakpointTextMarker));
- document.RemoveMarker (line, typeof(InvalidBreakpointTextMarker));
+ var endLine = document.OffsetToLineNumber (line.TextMarker.EndOffset);
+ for (int i = document.OffsetToLineNumber (line.TextMarker.Offset); i <= endLine; i++) {
+ lineNumbers.Add (i);
+ }
+ document.RemoveMarker (line.TextMarker);
+ document.RemoveMarker (line.IconMarker);
}
breakpointSegments.Clear ();
@@ -1347,7 +1305,6 @@ namespace MonoDevelop.SourceEditor
document.CommitDocumentUpdate ();
// Ensure the current line marker is drawn at the top
- lastDebugLine = -1;
UpdateExecutionLocation ();
}
@@ -1365,7 +1322,7 @@ namespace MonoDevelop.SourceEditor
FilePath fp = Name;
if (fp.FullPath == bp.FileName) {
if (bp.Line <= 0 || bp.Line > textEditor.Document.LineCount) {
- LoggingService.LogWarning ("Invalid breakpoint :" + bp +" in line " + bp.Line);
+ LoggingService.LogWarning ("Invalid breakpoint :" + bp + " in line " + bp.Line);
return;
}
DocumentLine line = document.GetLine (bp.Line);
@@ -1375,16 +1332,22 @@ namespace MonoDevelop.SourceEditor
if (line == null)
return;
+ //TODO: 1. When not in debug mode use Microsoft.CodeAnalysis.CSharp.EditAndContinue.BreakpointSpans.TryGetBreakpointSpan
+ //TODO: 2. When in debug mode extend Breakpoint class to have endLine and endColumn set if .mdb/.pdb has endLine/endColumn
+ var offset = line.Offset;
+ var lenght = line.Length;
+ DebugMarkerPair marker;
if (!bp.Enabled) {
- document.AddMarker (line, new DisabledBreakpointTextMarker (textEditor, tracepoint));
+ marker = new DisabledBreakpointTextMarker (textEditor, offset, lenght, tracepoint);
} else if (status == BreakEventStatus.Bound || status == BreakEventStatus.Disconnected) {
- document.AddMarker (line, new BreakpointTextMarker (textEditor, tracepoint));
+ marker = new BreakpointTextMarker (textEditor, offset, lenght, tracepoint);
} else {
- document.AddMarker (line, new InvalidBreakpointTextMarker (textEditor, tracepoint));
+ marker = new InvalidBreakpointTextMarker (textEditor, offset, lenght, tracepoint);
}
textEditor.QueueDraw ();
- breakpointSegments.Add (line);
+ breakpointSegments.Add (marker);
+ marker.AddTo (document, line);
}
}
@@ -1395,6 +1358,7 @@ namespace MonoDevelop.SourceEditor
// Updated with a delay, to make sure it works when called as a
// result of inserting/removing lines before a breakpoint position
GLib.Timeout.Add (10, delegate {
+ // Make sure this runs in the UI thread.
if (!isDisposed)
UpdateBreakpoints ();
return false;
@@ -1408,6 +1372,7 @@ namespace MonoDevelop.SourceEditor
// Updated with a delay, to make sure it works when called as a
// result of inserting/removing lines before a breakpoint position
GLib.Timeout.Add (10, delegate {
+ // Make sure this runs in the UI thread.
if (!isDisposed)
UpdateBreakpoints ();
return false;
@@ -1421,6 +1386,7 @@ namespace MonoDevelop.SourceEditor
// Updated with a delay, to make sure it works when called as a
// result of inserting/removing lines before a breakpoint position
GLib.Timeout.Add (10, delegate {
+ // Make sure this runs in the UI thread.
if (!isDisposed)
UpdateBreakpoints (true);
return false;
@@ -1429,7 +1395,7 @@ namespace MonoDevelop.SourceEditor
void OnIconButtonPress (object s, MarginMouseEventArgs args)
{
- if (args.LineNumber < DocumentLocation.MinLine)
+ if (args.LineNumber < Mono.TextEditor.DocumentLocation.MinLine)
return;
if (args.TriggersContextMenu ()) {
@@ -1444,51 +1410,23 @@ namespace MonoDevelop.SourceEditor
WorkbenchWindow.ExtensionContext ?? AddinManager.AddinEngine,
"/MonoDevelop/SourceEditor2/IconContextMenu/Editor");
} else if (args.Button == 1) {
- if (!string.IsNullOrEmpty (this.Document.FileName)) {
+ if (!string.IsNullOrEmpty (Document.FileName)) {
if (args.LineSegment != null) {
int column = TextEditor.Caret.Line == args.LineNumber ? TextEditor.Caret.Column : 1;
lock (breakpoints)
- breakpoints.Toggle (this.Document.FileName, args.LineNumber, column);
+ breakpoints.Toggle (Document.FileName, args.LineNumber, column);
}
}
}
}
-
- #region IExtensibleTextEditor
- public ITextEditorExtension Extension {
- get;
- set;
- }
-
- ITextEditorExtension IExtensibleTextEditor.AttachExtension (ITextEditorExtension extension)
- {
- Extension = extension;
- this.widget.TextEditor.Extension = extension;
- return this.widget;
- }
-
-// protected override void OnMoveCursor (MovementStep step, int count, bool extend_selection)
-// {
-// base.OnMoveCursor (step, count, extend_selection);
-// if (extension != null)
-// extension.CursorPositionChanged ();
-// }
-
-// protected override bool OnKeyPressEvent (Gdk.EventKey evnt)
-// {
-// if (extension != null)
-// return extension.KeyPress (evnt.Key, evnt.State);
-// return this.KeyPress (evnt.Key, evnt.State);
-// }
- #endregion
-
+
#region IEditableTextBuffer
public bool EnableUndo {
get {
if (widget == null)
return false;
- return /*this.TextEditor.PreeditOffset < 0 &&*/ this.Document.CanUndo && widget.EditorHasFocus;
+ return /*this.TextEditor.PreeditOffset < 0 &&*/ Document.CanUndo && widget.EditorHasFocus;
}
}
@@ -1506,14 +1444,14 @@ namespace MonoDevelop.SourceEditor
}*/
if (MiscActions.CancelPreEditMode (TextEditor.GetTextEditorData ()))
return;
- MiscActions.Undo (this.TextEditor.GetTextEditorData ());
+ MiscActions.Undo (TextEditor.GetTextEditorData ());
}
public bool EnableRedo {
get {
if (widget == null)
return false;
- return /*this.TextEditor.PreeditOffset < 0 && */ this.Document.CanRedo && widget.EditorHasFocus;
+ return /*this.TextEditor.PreeditOffset < 0 && */ Document.CanRedo && widget.EditorHasFocus;
}
}
@@ -1550,7 +1488,7 @@ namespace MonoDevelop.SourceEditor
{
if (MiscActions.CancelPreEditMode (TextEditor.GetTextEditorData ()))
return;
- MiscActions.Redo (this.TextEditor.GetTextEditorData ());
+ MiscActions.Redo (TextEditor.GetTextEditorData ());
}
public IDisposable OpenUndoGroup ()
@@ -1566,7 +1504,7 @@ namespace MonoDevelop.SourceEditor
TextEditor.DeleteSelectedText ();
var offset = TextEditor.Caret.Offset;
int length = TextEditor.Insert (offset, value);
- TextEditor.SelectionRange = new TextSegment (offset, length);
+ TextEditor.SelectionRange = new Mono.TextEditor.TextSegment (offset, length);
}
}
@@ -1577,8 +1515,7 @@ namespace MonoDevelop.SourceEditor
}
public event EventHandler CaretPositionSet;
- public event EventHandler<TextChangedEventArgs> TextChanged;
-
+
public bool HasInputFocus {
get { return TextEditor.HasFocus; }
}
@@ -1589,7 +1526,6 @@ namespace MonoDevelop.SourceEditor
}
#endregion
- #region ITextBuffer
public int CursorPosition {
get {
return TextEditor.Caret.Offset;
@@ -1598,56 +1534,28 @@ namespace MonoDevelop.SourceEditor
TextEditor.Caret.Offset = value;
}
}
-
- public int SelectionStartPosition {
- get {
- if (!TextEditor.IsSomethingSelected)
- return TextEditor.Caret.Offset;
- return TextEditor.SelectionRange.Offset;
- }
- }
-
- public int SelectionEndPosition {
- get {
- if (!TextEditor.IsSomethingSelected)
- return TextEditor.Caret.Offset;
- return TextEditor.SelectionRange.EndOffset;
- }
- }
-
- public void Select (int startPosition, int endPosition)
- {
- TextEditor.SelectionRange = new TextSegment (startPosition, endPosition - startPosition);
- TextEditor.ScrollToCaret ();
- }
-
- public void ShowPosition (int position)
- {
- // TODO
- }
- #endregion
#region ITextFile
public FilePath Name {
get {
- return this.ContentName ?? this.UntitledName;
+ return ContentName ?? UntitledName;
}
}
public string Text {
get {
- return this.widget.TextEditor.Document.Text;
+ return widget.TextEditor.Document.Text;
}
set {
this.IsDirty = true;
- TextDocument document = this.widget.TextEditor.Document;
+ var document = this.widget.TextEditor.Document;
document.Replace (0, document.TextLength, value);
}
}
public int Length {
get {
- return this.widget.TextEditor.Document.TextLength;
+ return widget.TextEditor.Document.TextLength;
}
}
@@ -1671,17 +1579,17 @@ namespace MonoDevelop.SourceEditor
public char GetCharAt (int position)
{
- return this.widget.TextEditor.Document.GetCharAt (position);
+ return widget.TextEditor.Document.GetCharAt (position);
}
public int GetPositionFromLineColumn (int line, int column)
{
- return this.widget.TextEditor.Document.LocationToOffset (new DocumentLocation (line, column));
+ return widget.TextEditor.Document.LocationToOffset (new Mono.TextEditor.DocumentLocation (line, column));
}
public void GetLineColumnFromPosition (int position, out int line, out int column)
{
- DocumentLocation location = this.widget.TextEditor.Document.OffsetToLocation (position);
+ var location = widget.TextEditor.Document.OffsetToLocation (position);
line = location.Line;
column = location.Column;
}
@@ -1690,25 +1598,25 @@ namespace MonoDevelop.SourceEditor
#region IEditableTextFile
public int InsertText (int position, string text)
{
- return this.widget.TextEditor.Insert (position, text);
+ return widget.TextEditor.Insert (position, text);
}
public void DeleteText (int position, int length)
{
- this.widget.TextEditor.TextArea.Remove (position, length);
+ widget.TextEditor.TextArea.Remove (position, length);
}
#endregion
#region IBookmarkBuffer
DocumentLine GetLine (int position)
{
- DocumentLocation location = Document.OffsetToLocation (position);
+ var location = Document.OffsetToLocation (position);
return Document.GetLine (location.Line);
}
public void SetBookmarked (int position, bool mark)
{
- DocumentLine line = GetLine (position);
+ var line = GetLine (position);
if (line != null && line.IsBookmarked != mark) {
int lineNumber = widget.TextEditor.Document.OffsetToLineNumber (line.Offset);
line.IsBookmarked = mark;
@@ -1719,8 +1627,8 @@ namespace MonoDevelop.SourceEditor
public bool IsBookmarked (int position)
{
- DocumentLine line = GetLine (position);
- return line != null ? line.IsBookmarked : false;
+ var line = GetLine (position);
+ return line != null && line.IsBookmarked;
}
public void PrevBookmark ()
@@ -1818,7 +1726,7 @@ namespace MonoDevelop.SourceEditor
get {
if (TextEditor.IsSomethingSelected) {
if (TextEditor.MainSelection.SelectionMode == Mono.TextEditor.SelectionMode.Block)
- return System.Math.Abs (TextEditor.MainSelection.Anchor.Column - TextEditor.MainSelection.Lead.Column);
+ return Math.Abs (TextEditor.MainSelection.Anchor.Column - TextEditor.MainSelection.Lead.Column);
return TextEditor.SelectionRange.Length;
}
return 0;
@@ -1837,11 +1745,15 @@ namespace MonoDevelop.SourceEditor
get {
return TextEditor.Caret.Offset;
}
+ set {
+ TextEditor.Caret.Offset = value;
+ TextEditor.ScrollToCaret ();
+ }
}
- public Gtk.Style GtkStyle {
+ public Style GtkStyle {
get {
- return widget.Vbox.Style.Copy ();
+ return widget.Vbox.Style;
}
}
@@ -1862,9 +1774,14 @@ namespace MonoDevelop.SourceEditor
var loc = editor.Caret.Location;
result.TriggerLine = loc.Line;
result.TriggerLineOffset = loc.Column - 1;
- var p = this.widget.TextEditor.LocationToPoint (loc);
+ var p = widget.TextEditor.LocationToPoint (loc);
int tx, ty;
- editor.ParentWindow.GetOrigin (out tx, out ty);
+ var parentWindow = editor.ParentWindow;
+ if (parentWindow != null) {
+ parentWindow.GetOrigin (out tx, out ty);
+ } else {
+ tx = ty = 0;
+ }
tx += editor.Allocation.X + p.X;
ty += editor.Allocation.Y + p.Y + (int)editor.LineHeight;
@@ -1874,7 +1791,7 @@ namespace MonoDevelop.SourceEditor
return result;
}
- public Gdk.Point DocumentToScreenLocation (DocumentLocation location)
+ public Gdk.Point DocumentToScreenLocation (Mono.TextEditor.DocumentLocation location)
{
var p = widget.TextEditor.LocationToPoint (location);
int tx, ty;
@@ -1898,21 +1815,25 @@ namespace MonoDevelop.SourceEditor
return Document.GetTextBetween (min, max);
}
- public void SetCompletionText (CodeCompletionContext ctx, string partial_word, string complete_word)
+ public void SetCompletionText (CodeCompletionContext ctx, string partialWord, string completeWord)
{
- SetCompletionText (ctx, partial_word, complete_word, complete_word.Length);
+ if (ctx == null)
+ throw new ArgumentNullException ("ctx");
+ if (completeWord == null)
+ throw new ArgumentNullException ("completeWord");
+ SetCompletionText (ctx, partialWord, completeWord, completeWord.Length);
}
- public static void SetCompletionText (TextEditorData data, CodeCompletionContext ctx, string partial_word, string complete_word, int wordOffset)
+ public static void SetCompletionText (TextEditorData data, CodeCompletionContext ctx, string partialWord, string completeWord, int wordOffset)
{
if (data == null || data.Document == null)
return;
int triggerOffset = ctx.TriggerOffset;
- int length = String.IsNullOrEmpty (partial_word) ? 0 : partial_word.Length;
+ int length = String.IsNullOrEmpty (partialWord) ? 0 : partialWord.Length;
// for named arguments invoke(arg:<Expr>);
- if (complete_word.EndsWith (":", StringComparison.Ordinal)) {
+ if (completeWord.EndsWith (":", StringComparison.Ordinal)) {
if (data.GetCharAt (triggerOffset + length) == ':')
length++;
}
@@ -1932,9 +1853,9 @@ namespace MonoDevelop.SourceEditor
}
// | in the completion text now marks the caret position
- int idx = complete_word.IndexOf ('|');
+ int idx = completeWord.IndexOf ('|');
if (idx >= 0) {
- complete_word = complete_word.Remove (idx, 1);
+ completeWord = completeWord.Remove (idx, 1);
}
triggerOffset += data.EnsureCaretIsNotVirtual ();
@@ -1949,11 +1870,11 @@ namespace MonoDevelop.SourceEditor
if (lineSegment == null)
continue;
int offset = lineSegment.Offset + column;
- data.Replace (offset, length, complete_word);
+ data.Replace (offset, length, completeWord);
}
- int minColumn = System.Math.Min (data.MainSelection.Anchor.Column, data.MainSelection.Lead.Column);
+ int minColumn = Math.Min (data.MainSelection.Anchor.Column, data.MainSelection.Lead.Column);
data.MainSelection = data.MainSelection.WithRange (
- new DocumentLocation (data.Caret.Line == minLine ? maxLine : minLine, minColumn),
+ new Mono.TextEditor.DocumentLocation (data.Caret.Line == minLine ? maxLine : minLine, minColumn),
data.Caret.Location
);
@@ -1961,7 +1882,7 @@ namespace MonoDevelop.SourceEditor
data.Caret.PreserveSelection = false;
}
} else {
- data.Replace (triggerOffset, length, complete_word);
+ data.Replace (triggerOffset, length, completeWord);
}
data.Document.CommitLineUpdate (data.Caret.Line);
@@ -1970,17 +1891,13 @@ namespace MonoDevelop.SourceEditor
}
- public void SetCompletionText (CodeCompletionContext ctx, string partial_word, string complete_word, int wordOffset)
+ public void SetCompletionText (CodeCompletionContext ctx, string partialWord, string completeWord, int wordOffset)
{
var data = GetTextEditorData ();
if (data == null)
return;
using (var undo = data.OpenUndoGroup ()) {
- SetCompletionText (data, ctx, partial_word, complete_word, wordOffset);
- var formatter = CodeFormatterService.GetFormatter (data.MimeType);
- if (formatter != null && complete_word.IndexOfAny (new [] {' ', '\t', '{', '}'}) > 0 && formatter.SupportsOnTheFlyFormatting) {
- formatter.OnTheFlyFormat (WorkbenchWindow.Document, ctx.TriggerOffset, ctx.TriggerOffset + complete_word.Length);
- }
+ SetCompletionText (data, ctx, partialWord, completeWord, wordOffset);
}
}
@@ -2003,10 +1920,12 @@ namespace MonoDevelop.SourceEditor
if (TextEditor.IsSomethingSelected) {
expression = TextEditor.SelectedText;
} else {
- DomRegion region;
+ MonoDevelop.Ide.Editor.DocumentRegion region;
var rr = TextEditor.GetLanguageItem (TextEditor.Caret.Offset, out region);
- if (rr != null && !rr.IsError)
- expression = TextEditor.GetTextBetween (region.Begin, region.End);
+ if (rr != null)
+ expression = TextEditor.GetTextBetween (
+ region.BeginLine, region.BeginColumn,
+ region.EndLine, region.EndColumn);
}
DebuggingService.ShowExpressionEvaluator (expression);
@@ -2075,18 +1994,18 @@ namespace MonoDevelop.SourceEditor
{
bool toggle = true;
- foreach (FoldSegment segment in Document.FoldSegments) {
- if (segment.FoldingType == FoldingType.TypeMember || segment.FoldingType == FoldingType.Comment)
+ foreach (var segment in Document.FoldSegments) {
+ if (segment.FoldingType == Mono.TextEditor.FoldingType.TypeMember || segment.FoldingType == Mono.TextEditor.FoldingType.Comment)
if (segment.IsFolded)
toggle = false;
}
- foreach (FoldSegment segment in Document.FoldSegments) {
- if (segment.FoldingType == FoldingType.TypeDefinition) {
+ foreach (var segment in Document.FoldSegments) {
+ if (segment.FoldingType == Mono.TextEditor.FoldingType.TypeDefinition) {
segment.IsFolded = false;
}
- if (segment.FoldingType == FoldingType.TypeMember || segment.FoldingType == FoldingType.Comment)
+ if (segment.FoldingType == Mono.TextEditor.FoldingType.TypeMember || segment.FoldingType == Mono.TextEditor.FoldingType.Comment)
segment.IsFolded = toggle;
}
@@ -2151,7 +2070,7 @@ namespace MonoDevelop.SourceEditor
static SourceEditorView ()
{
- CodeSegmentPreviewWindow.CodeSegmentPreviewInformString = GettextCatalog.GetString ("Press 'F2' for focus");
+ CodeSegmentPreviewWindow.CodeSegmentPreviewInformString = GettextCatalog.GetString ("Press F2 to focus");
ClipboardActions.CopyOperation.Copy += delegate (string text) {
if (String.IsNullOrEmpty (text))
return;
@@ -2172,7 +2091,7 @@ namespace MonoDevelop.SourceEditor
item.Description += line;
}
item.Category = GettextCatalog.GetString ("Clipboard ring");
- item.Icon = DesktopService.GetIconForFile ("a.txt", Gtk.IconSize.Menu);
+ item.Icon = DesktopService.GetIconForFile ("a.txt", IconSize.Menu);
item.Name = text.Length > 16 ? text.Substring (0, 16) + "..." : text;
item.Name = item.Name.Replace ("\t", "\\t");
item.Name = item.Name.Replace ("\n", "\\n");
@@ -2183,6 +2102,8 @@ namespace MonoDevelop.SourceEditor
if (ClipbardRingUpdated != null)
ClipbardRingUpdated (null, EventArgs.Empty);
};
+ SyntaxModeLoader.Init ();
+ Mono.TextEditor.Highlighting.SyntaxModeService.LoadStylesAndModes (TextEditorDisplayBinding.SyntaxModePath);
}
public void UpdateClipboardRing (object sender, EventArgs e)
@@ -2219,16 +2140,16 @@ namespace MonoDevelop.SourceEditor
{
var tn = item as ITextToolboxNode;
if (tn != null) {
- tn.InsertAtCaret (base.WorkbenchWindow.Document);
+ tn.InsertAtCaret (WorkbenchWindow.Document);
TextEditor.GrabFocus ();
}
}
#region dnd
- Gtk.Widget customSource;
+ Widget customSource;
ItemToolboxNode dragItem;
- void IToolboxConsumer.DragItem (ItemToolboxNode item, Gtk.Widget source, Gdk.DragContext ctx)
+ void IToolboxConsumer.DragItem (ItemToolboxNode item, Widget source, Gdk.DragContext ctx)
{
//FIXME: use the preview text
string text = GetDragPreviewText (item);
@@ -2266,7 +2187,7 @@ namespace MonoDevelop.SourceEditor
LoggingService.LogWarning ("Cannot use non-ITextToolboxNode toolbox items in the text editor.");
return null;
}
- return tn.GetDragPreview (base.WorkbenchWindow.Document);
+ return tn.GetDragPreview (WorkbenchWindow.Document);
}
System.ComponentModel.ToolboxItemFilterAttribute[] IToolboxConsumer.ToolboxFilterAttributes {
@@ -2285,10 +2206,10 @@ namespace MonoDevelop.SourceEditor
//int i = filename.LastIndexOf ('.');
//string ext = i < 0? null : filename.Substring (i + 1);
- return textNode.IsCompatibleWith (base.WorkbenchWindow.Document);
+ return textNode.IsCompatibleWith (WorkbenchWindow.Document);
}
- public Gtk.TargetEntry[] DragTargets {
+ public TargetEntry[] DragTargets {
get {
return ClipboardActions.CopyOperation.TargetEntries;
}
@@ -2309,88 +2230,80 @@ namespace MonoDevelop.SourceEditor
#region IZoomable
bool IZoomable.EnableZoomIn {
get {
- return this.TextEditor.Options.CanZoomIn;
+ return TextEditor.Options.CanZoomIn;
}
}
bool IZoomable.EnableZoomOut {
get {
- return this.TextEditor.Options.CanZoomOut;
+ return TextEditor.Options.CanZoomOut;
}
}
bool IZoomable.EnableZoomReset {
get {
- return this.TextEditor.Options.CanResetZoom;
+ return TextEditor.Options.CanResetZoom;
}
}
void IZoomable.ZoomIn ()
{
- this.TextEditor.Options.ZoomIn ();
+ TextEditor.Options.ZoomIn ();
}
void IZoomable.ZoomOut ()
{
- this.TextEditor.Options.ZoomOut ();
+ TextEditor.Options.ZoomOut ();
}
void IZoomable.ZoomReset ()
{
- this.TextEditor.Options.ZoomReset ();
+ TextEditor.Options.ZoomReset ();
}
#region ITextEditorResolver implementation
- public ResolveResult GetLanguageItem (int offset)
+ public Microsoft.CodeAnalysis.ISymbol GetLanguageItem (int offset)
{
- DomRegion region;
- return this.SourceEditorWidget.TextEditor.GetLanguageItem (offset, out region);
+ MonoDevelop.Ide.Editor.DocumentRegion region;
+ return SourceEditorWidget.TextEditor.GetLanguageItem (offset, out region);
}
- public ResolveResult GetLanguageItem (int offset, string expression)
+ public Microsoft.CodeAnalysis.ISymbol GetLanguageItem (int offset, string expression)
{
- return this.SourceEditorWidget.TextEditor.GetLanguageItem (offset, expression);
+ return SourceEditorWidget.TextEditor.GetLanguageItem (offset, expression);
}
#endregion
#region ISupportsProjectReload implementaion
- ProjectReloadCapability ISupportsProjectReload.ProjectReloadCapability {
+ public override ProjectReloadCapability ProjectReloadCapability {
get {
return ProjectReloadCapability.Full;
}
}
-
- void ISupportsProjectReload.Update (Project project)
- {
- // The project will be assigned to the view. Nothing else to do.
- }
-
+
#endregion
#endregion
- public Mono.TextEditor.TextEditorData GetTextEditorData ()
+ public TextEditorData GetTextEditorData ()
{
var editor = TextEditor;
if (editor == null)
return null;
return editor.GetTextEditorData ();
}
-
- public void InsertTemplate (CodeTemplate template, MonoDevelop.Ide.Gui.Document doc)
- {
- TextEditor.InsertTemplate (template, doc);
- }
-
- [CommandHandler (TextEditorCommands.GotoMatchingBrace)]
- protected void OnGotoMatchingBrace ()
+
+ public void InsertTemplate (CodeTemplate template, MonoDevelop.Ide.Editor.TextEditor editor, DocumentContext context)
{
- TextEditor.RunAction (MiscActions.GotoMatchingBracket);
+ TextEditor.InsertTemplate (template, editor, context);
}
-
+
void CorrectIndenting ()
{
+ var doc = IdeApp.Workbench.ActiveDocument?.Editor;
+ if (doc == null)
+ return;
var formatter = CodeFormatterService.GetFormatter (Document.MimeType);
if (formatter == null || !formatter.SupportsCorrectingIndent)
return;
@@ -2404,53 +2317,22 @@ namespace MonoDevelop.SourceEditor
var version = TextEditor.Document.Version;
int max = selection.MaxLine;
for (int i = TextEditor.MainSelection.MinLine; i <= max; i++) {
- formatter.CorrectIndenting (policies, editorData, i);
+ formatter.CorrectIndenting (policies, doc, i);
}
editorData.SetSelection (version.MoveOffsetTo (editorData.Document.Version, anchor), version.MoveOffsetTo (editorData.Document.Version, lead));
}
} else {
- formatter.CorrectIndenting (policies, editorData, TextEditor.Caret.Line);
+ formatter.CorrectIndenting (policies, doc, TextEditor.Caret.Line);
}
}
- [CommandUpdateHandler (TextEditorCommands.MoveBlockUp)]
- [CommandUpdateHandler (TextEditorCommands.MoveBlockDown)]
- void MoveBlockUpdateHandler (CommandInfo cinfo)
+ protected override object OnGetContent (Type type)
{
- cinfo.Enabled = widget.EditorHasFocus;
+ if (type.Equals (typeof(TextEditorData)))
+ return TextEditor.GetTextEditorData ();
+ return base.OnGetContent (type);
}
- [CommandHandler (TextEditorCommands.MoveBlockUp)]
- protected void OnMoveBlockUp ()
- {
- using (var undo = TextEditor.OpenUndoGroup ()) {
- TextEditor.RunAction (MiscActions.MoveBlockUp);
- CorrectIndenting ();
- }
- }
-
- [CommandHandler (TextEditorCommands.MoveBlockDown)]
- protected void OnMoveBlockDown ()
- {
- using (var undo = TextEditor.OpenUndoGroup ()) {
- TextEditor.RunAction (MiscActions.MoveBlockDown);
- CorrectIndenting ();
- }
- }
-
- [CommandUpdateHandler (TextEditorCommands.ToggleBlockSelectionMode)]
- protected void UpdateToggleBlockSelectionMode (CommandInfo cinfo)
- {
- cinfo.Enabled = TextEditor.IsSomethingSelected;
- }
-
- [CommandHandler (TextEditorCommands.ToggleBlockSelectionMode)]
- protected void OnToggleBlockSelectionMode ()
- {
- TextEditor.SelectionMode = TextEditor.SelectionMode == Mono.TextEditor.SelectionMode.Normal ? Mono.TextEditor.SelectionMode.Block : Mono.TextEditor.SelectionMode.Normal;
- TextEditor.QueueDraw ();
- }
-
#region widget command handlers
[CommandHandler (SearchCommands.EmacsFindNext)]
public void EmacsFindNext ()
@@ -2548,57 +2430,939 @@ namespace MonoDevelop.SourceEditor
{
widget.MonodocResolverUpdate (cinfo);
}
-
- [CommandUpdateHandler (EditCommands.ToggleCodeComment)]
- internal void OnUpdateToggleComment (MonoDevelop.Components.Commands.CommandInfo info)
+
+ [CommandHandler (SourceEditorCommands.NextIssue)]
+ void NextIssue ()
+ {
+ widget.NextIssue ();
+ }
+
+ [CommandHandler (SourceEditorCommands.PrevIssue)]
+ void PrevIssue ()
+ {
+ widget.PrevIssue ();
+ }
+
+ [CommandHandler (SourceEditorCommands.NextIssueError)]
+ void NextIssueError ()
+ {
+ widget.NextIssueError ();
+ }
+
+ [CommandHandler (SourceEditorCommands.PrevIssueError)]
+ void PrevIssueError ()
+ {
+ widget.PrevIssueError ();
+ }
+ #endregion
+
+ TextDocumentWrapper wrapper;
+ IReadonlyTextDocument ITextEditorImpl.Document {
+ get {
+ if (wrapper == null) {
+ wrapper = new TextDocumentWrapper (widget.TextEditor.Document);
+ if (encoding != null) {
+ wrapper.Document.Encoding = encoding;
+ wrapper.Document.UseBom = hadBom;
+ } else {
+ wrapper.Document.Encoding = Encoding.UTF8;
+ wrapper.Document.UseBom = true;
+ }
+ }
+ return wrapper;
+ }
+ }
+
+ event EventHandler ITextEditorImpl.SelectionChanged {
+ add {
+ TextEditor.SelectionChanged += value;
+ }
+ remove {
+ TextEditor.SelectionChanged -= value;
+ }
+ }
+
+ event EventHandler<Xwt.MouseMovedEventArgs> ITextEditorImpl.MouseMoved {
+ add {
+ TextEditor.BeginHover += value;
+ }
+ remove {
+ TextEditor.BeginHover -= value;
+ }
+ }
+
+ event EventHandler ITextEditorImpl.VAdjustmentChanged {
+ add {
+ TextEditor.VAdjustment.ValueChanged += value;
+ }
+ remove {
+ TextEditor.VAdjustment.ValueChanged -= value;
+ }
+ }
+
+ event EventHandler ITextEditorImpl.HAdjustmentChanged {
+ add {
+ TextEditor.HAdjustment.ValueChanged += value;
+ }
+ remove {
+ TextEditor.HAdjustment.ValueChanged -= value;
+ }
+ }
+
+ public event EventHandler CaretPositionChanged;
+ bool hasCaretPositionChanged;
+ protected virtual void OnCaretPositionChanged (EventArgs e)
+ {
+ if (widget.TextEditor.Document.IsInAtomicUndo) {
+ hasCaretPositionChanged = true;
+ return;
+ }
+ var handler = CaretPositionChanged;
+ if (handler != null)
+ handler (this, e);
+ }
+
+ public event EventHandler BeginAtomicUndoOperation;
+
+ protected virtual void OnBeginUndo (EventArgs e)
+ {
+ hasCaretPositionChanged = false;
+ var handler = BeginAtomicUndoOperation;
+ if (handler != null)
+ handler (this, e);
+ }
+
+ public event EventHandler EndAtomicUndoOperation;
+
+ protected virtual void OnEndUndo (EventArgs e)
+ {
+ var handler = EndAtomicUndoOperation;
+ if (handler != null)
+ handler (this, e);
+ if (hasCaretPositionChanged) {
+ OnCaretPositionChanged (e);
+ hasCaretPositionChanged = false;
+ }
+ }
+
+ void ITextEditorImpl.SetSelection (int anchorOffset, int leadOffset)
+ {
+ TextEditor.SetSelection (anchorOffset, leadOffset);
+ }
+
+ void ITextEditorImpl.ClearSelection ()
+ {
+ TextEditor.ClearSelection ();
+ }
+
+ void ITextEditorImpl.CenterToCaret ()
+ {
+ TextEditor.CenterToCaret ();
+ }
+
+ void ITextEditorImpl.StartCaretPulseAnimation ()
+ {
+ TextEditor.StartCaretPulseAnimation ();
+ }
+
+ int ITextEditorImpl.EnsureCaretIsNotVirtual ()
+ {
+ return TextEditor.GetTextEditorData ().EnsureCaretIsNotVirtual ();
+ }
+
+ void ITextEditorImpl.FixVirtualIndentation ()
+ {
+ TextEditor.GetTextEditorData ().FixVirtualIndentation ();
+ }
+
+ object ITextEditorImpl.CreateNativeControl ()
+ {
+ return widget != null ? widget.Vbox : null;
+ }
+
+ string ITextEditorImpl.FormatString (int offset, string code)
+ {
+ return TextEditor.GetTextEditorData ().FormatString (offset, code);
+ }
+
+ void ITextEditorImpl.StartInsertionMode (InsertionModeOptions insertionModeOptions)
+ {
+ var mode = new InsertionCursorEditMode (TextEditor, insertionModeOptions.InsertionPoints.Select (ip => new Mono.TextEditor.InsertionPoint (
+ new Mono.TextEditor.DocumentLocation (ip.Location.Line, ip.Location.Column),
+ (Mono.TextEditor.NewLineInsertion)ip.LineBefore,
+ (Mono.TextEditor.NewLineInsertion)ip.LineAfter
+ )).ToList ());
+ if (mode.InsertionPoints.Count == 0) {
+ return;
+ }
+ var helpWindow = new Mono.TextEditor.PopupWindow.InsertionCursorLayoutModeHelpWindow ();
+ helpWindow.TitleText = insertionModeOptions.Operation;
+ mode.HelpWindow = helpWindow;
+ mode.CurIndex = insertionModeOptions.FirstSelectedInsertionPoint;
+ mode.StartMode ();
+ mode.Exited += delegate(object s, Mono.TextEditor.InsertionCursorEventArgs iCArgs) {
+ if (insertionModeOptions.ModeExitedAction != null) {
+ insertionModeOptions.ModeExitedAction (new MonoDevelop.Ide.Editor.InsertionCursorEventArgs (iCArgs.Success,
+ iCArgs.Success ?
+ new MonoDevelop.Ide.Editor.InsertionPoint (
+ new MonoDevelop.Ide.Editor.DocumentLocation (iCArgs.InsertionPoint.Location.Line, iCArgs.InsertionPoint.Location.Column),
+ (MonoDevelop.Ide.Editor.NewLineInsertion)iCArgs.InsertionPoint.LineBefore,
+ (MonoDevelop.Ide.Editor.NewLineInsertion)iCArgs.InsertionPoint.LineAfter)
+ : null
+ ));
+ }
+ };
+ }
+
+ void ITextEditorImpl.StartTextLinkMode (TextLinkModeOptions textLinkModeOptions)
{
- widget.OnUpdateToggleComment (info);
+ var convertedLinks = new List<Mono.TextEditor.TextLink> ();
+ foreach (var link in textLinkModeOptions.Links) {
+ var convertedLink = new Mono.TextEditor.TextLink (link.Name);
+ convertedLink.IsEditable = link.IsEditable;
+ convertedLink.IsIdentifier = link.IsIdentifier;
+ var func = link.GetStringFunc;
+ if (func != null) {
+ convertedLink.GetStringFunc = delegate(Func<string, string> arg) {
+ return new ListDataProviderWrapper (func (arg));
+ };
+ }
+ foreach (var segment in link.Links) {
+ convertedLink.AddLink (new Mono.TextEditor.TextSegment (segment.Offset, segment.Length));
+ }
+ convertedLinks.Add (convertedLink);
+ }
+
+ var tle = new TextLinkEditMode (TextEditor, 0, convertedLinks);
+ tle.SetCaretPosition = false;
+ if (tle.ShouldStartTextLinkMode) {
+ tle.OldMode = TextEditor.CurrentMode;
+ if (textLinkModeOptions.ModeExitedAction != null) {
+ tle.Cancel += (sender, e) => textLinkModeOptions.ModeExitedAction (new TextLinkModeEventArgs (false));
+ tle.Exited += (sender, e) => {
+ for (int i = 0; i < convertedLinks.Count; i++) {
+ textLinkModeOptions.Links[i].CurrentText = convertedLinks[i].CurrentText;
+ }
+ textLinkModeOptions.ModeExitedAction (new TextLinkModeEventArgs (true));
+
+ };
+ }
+ var undoOperation = TextEditor.OpenUndoGroup ();
+ tle.Exited += (object sender, EventArgs e) => undoOperation.Dispose ();
+ tle.StartMode ();
+ TextEditor.CurrentMode = tle;
+ }
+ }
+
+ MonoDevelop.Ide.Editor.DocumentLocation ITextEditorImpl.PointToLocation (double xp, double yp, bool endAtEol)
+ {
+ var pt = TextEditor.PointToLocation (xp, yp);
+ return new MonoDevelop.Ide.Editor.DocumentLocation (pt.Line, pt.Column);
+ }
+
+ Xwt.Point ITextEditorImpl.LocationToPoint (int line, int column)
+ {
+ var p = TextEditor.LocationToPoint (line, column);
+ return new Xwt.Point (p.X, p.Y);
+ }
+
+ void ITextEditorImpl.AddMarker (IDocumentLine line, ITextLineMarker lineMarker)
+ {
+ var debugPair = lineMarker as DebugMarkerPair;
+ if (debugPair != null) {
+ debugPair.AddTo (TextEditor.Document, ((DocumentLineWrapper)line).Line);
+ return;
+ }
+ var textLineMarker = lineMarker as TextLineMarker;
+ if (textLineMarker == null)
+ throw new InvalidOperationException ("Tried to add an incompatible text marker. Use the MarkerHost to create compatible ones.");
+
+ if (lineMarker is IUnitTestMarker) {
+ var actionMargin = TextEditor.ActionMargin;
+ if (actionMargin != null) {
+ actionMargin.IsVisible = true;
+ }
+ }
+
+ TextEditor.Document.AddMarker (((DocumentLineWrapper)line).Line, textLineMarker);
+ }
+
+ void ITextEditorImpl.RemoveMarker (ITextLineMarker lineMarker)
+ {
+ var debugPair = lineMarker as DebugMarkerPair;
+ if (debugPair != null) {
+ debugPair.Remove ();
+ return;
+ }
+ var textLineMarker = lineMarker as TextLineMarker;
+ if (textLineMarker == null)
+ throw new InvalidOperationException ("Tried to add an incompatible text marker.");
+ TextEditor.Document.RemoveMarker (textLineMarker);
+ }
+
+ IEnumerable<ITextLineMarker> ITextEditorImpl.GetLineMarkers (IDocumentLine line)
+ {
+ return ((DocumentLineWrapper)line).Line.Markers.OfType<ITextLineMarker> ();
+ }
+
+ IEnumerable<ITextSegmentMarker> ITextEditorImpl.GetTextSegmentMarkersAt (MonoDevelop.Core.Text.ISegment segment)
+ {
+ return TextEditor.Document.GetTextSegmentMarkersAt (new Mono.TextEditor.TextSegment (segment.Offset, segment.Length)).OfType<ITextSegmentMarker> ();
+ }
+
+ IEnumerable<ITextSegmentMarker> ITextEditorImpl.GetTextSegmentMarkersAt (int offset)
+ {
+ return TextEditor.Document.GetTextSegmentMarkersAt (offset).OfType<ITextSegmentMarker> ();
}
- [CommandHandler (EditCommands.ToggleCodeComment)]
- public void ToggleCodeComment ()
+ void ITextEditorImpl.AddMarker (ITextSegmentMarker marker)
{
- widget.ToggleCodeComment ();
+ var textSegmentMarker = marker as TextSegmentMarker;
+ if (textSegmentMarker == null)
+ throw new InvalidOperationException ("Tried to add an incompatible text marker. Use the MarkerHost to create compatible ones.");
+ TextEditor.Document.AddMarker (textSegmentMarker);
}
- [CommandUpdateHandler (EditCommands.AddCodeComment)]
- internal void OnUpdateAddCodeComment (MonoDevelop.Components.Commands.CommandInfo info)
+ bool ITextEditorImpl.RemoveMarker (ITextSegmentMarker marker)
{
- widget.OnUpdateToggleComment (info);
+ var textSegmentMarker = marker as TextSegmentMarker;
+ if (textSegmentMarker == null)
+ throw new InvalidOperationException ("Tried to remove an incompatible text marker.");
+ return TextEditor.Document.RemoveMarker (textSegmentMarker);
}
- [CommandHandler (EditCommands.AddCodeComment)]
- public void AddCodeComment ()
+ IFoldSegment ITextEditorImpl.CreateFoldSegment (int offset, int length, bool isFolded)
{
- widget.AddCodeComment ();
+ return new FoldSegmentWrapper (TextEditor.Document, "...", offset, length, Mono.TextEditor.FoldingType.None) { IsFolded = isFolded };
+ }
+
+ void ITextEditorImpl.SetFoldings (IEnumerable<IFoldSegment> foldings)
+ {
+ if (this.isDisposed || !TextEditor.Options.ShowFoldMargin)
+ return;
+ TextEditor.Document.UpdateFoldSegments (foldings.Cast<FoldSegment> ().ToList (), true);
+ }
+
+ IEnumerable<IFoldSegment> ITextEditorImpl.GetFoldingsContaining (int offset)
+ {
+ return TextEditor.Document.GetFoldingsFromOffset (offset).Cast<IFoldSegment> ();
+ }
+
+ IEnumerable<IFoldSegment> ITextEditorImpl.GetFoldingsIn (int offset, int length)
+ {
+ return TextEditor.Document.GetFoldingContaining (offset, length).Cast<IFoldSegment> ();
+ }
+
+ MonoDevelop.Ide.Editor.ITextEditorOptions ITextEditorImpl.Options {
+ get {
+ return((StyledSourceEditorOptions)TextEditor.Options).OptionsCore;
+ }
+ set {
+ ((StyledSourceEditorOptions)TextEditor.Options).OptionsCore = value;
+ }
+ }
+
+ MonoDevelop.Ide.Editor.DocumentLocation ITextEditorImpl.CaretLocation {
+ get {
+ var loc = TextEditor.Caret.Location;
+ return new MonoDevelop.Ide.Editor.DocumentLocation (loc.Line, loc.Column);
+ }
+ set {
+ TextEditor.Caret.Location = new Mono.TextEditor.DocumentLocation (value.Line, value.Column);
+ TextEditor.ScrollToCaret ();
+ }
+ }
+
+ bool ITextEditorImpl.IsSomethingSelected {
+ get {
+ return TextEditor.IsSomethingSelected;
+ }
+ }
+
+ MonoDevelop.Ide.Editor.SelectionMode ITextEditorImpl.SelectionMode {
+ get {
+ return (MonoDevelop.Ide.Editor.SelectionMode)TextEditor.SelectionMode;
+ }
}
- [CommandUpdateHandler (EditCommands.RemoveCodeComment)]
- internal void OnUpdateRemoveCodeComment (MonoDevelop.Components.Commands.CommandInfo info)
+ MonoDevelop.Core.Text.ISegment ITextEditorImpl.SelectionRange {
+ get {
+ var range = TextEditor.SelectionRange;
+ return MonoDevelop.Core.Text.TextSegment.FromBounds (range.Offset, range.EndOffset);
+ }
+ set {
+ TextEditor.SelectionRange = new Mono.TextEditor.TextSegment (value.Offset, value.Length);
+ }
+ }
+
+ int ITextEditorImpl.SelectionAnchorOffset {
+ get {
+ return TextEditor.SelectionAnchor;
+ }
+ set {
+ TextEditor.SelectionAnchor = value;
+ }
+ }
+
+ int ITextEditorImpl.SelectionLeadOffset {
+ get {
+ return TextEditor.SelectionLead;
+ }
+ set {
+ TextEditor.SelectionLead = value;
+ }
+ }
+
+ bool ITextEditorImpl.SuppressTooltips {
+ get {
+ return TextEditor.GetTextEditorData ().SuppressTooltips;
+ }
+ set {
+ if (value)
+ TextEditor.HideTooltip ();
+ TextEditor.GetTextEditorData ().SuppressTooltips = value;
+ }
+ }
+
+ MonoDevelop.Ide.Editor.DocumentRegion ITextEditorImpl.SelectionRegion {
+ get {
+ return new MonoDevelop.Ide.Editor.DocumentRegion (
+ TextEditor.MainSelection.Start.Line,
+ TextEditor.MainSelection.Start.Column,
+ TextEditor.MainSelection.End.Line,
+ TextEditor.MainSelection.End.Column
+ );
+ }
+ set {
+ TextEditor.MainSelection = new Mono.TextEditor.Selection (
+ value.BeginLine,
+ value.BeginColumn,
+ value.EndLine,
+ value.EndColumn
+ );
+ }
+ }
+
+ IEditorActionHost ITextEditorImpl.Actions {
+ get {
+ return this;
+ }
+ }
+
+ double ITextEditorImpl.LineHeight {
+ get {
+ return TextEditor.GetTextEditorData ().LineHeight;
+ }
+ }
+
+ ITextMarkerFactory ITextEditorImpl.TextMarkerFactory {
+ get {
+ return this;
+ }
+ }
+
+ MonoDevelop.Ide.Editor.EditMode ITextEditorImpl.EditMode {
+ get {
+ if (TextEditor.CurrentMode is TextLinkEditMode)
+ return MonoDevelop.Ide.Editor.EditMode.TextLink;
+ if (TextEditor.CurrentMode is InsertionCursorEditMode)
+ return MonoDevelop.Ide.Editor.EditMode.CursorInsertion;
+ return MonoDevelop.Ide.Editor.EditMode.Edit;
+ }
+ }
+
+ string ITextEditorImpl.GetVirtualIndentationString (int lineNumber)
{
- widget.OnUpdateToggleComment (info);
+ if (!TextEditor.GetTextEditorData ().HasIndentationTracker)
+ return TextEditor.GetLineIndent (lineNumber);
+ return TextEditor.GetTextEditorData ().IndentationTracker.GetIndentationString (lineNumber, 1);
}
- [CommandHandler (EditCommands.RemoveCodeComment)]
- public void RemoveCodeComment ()
+ void ITextEditorImpl.SetIndentationTracker (IndentationTracker indentationTracker)
{
- widget.RemoveCodeComment ();
+ TextEditor.GetTextEditorData ().IndentationTracker = indentationTracker != null ? new IndentationTrackerWrapper (TextEditor.GetTextEditorData (), wrapper, indentationTracker) : null;
}
- [CommandUpdateHandler (SourceEditorCommands.ToggleErrorTextMarker)]
- public void OnUpdateToggleErrorTextMarker (CommandInfo info)
+ void ITextEditorImpl.SetSelectionSurroundingProvider (SelectionSurroundingProvider surroundingProvider)
{
- widget.OnUpdateToggleErrorTextMarker (info);
+ TextEditor.GetTextEditorData ().SelectionSurroundingProvider = surroundingProvider != null ? new SelectionSurroundingProviderWrapper (surroundingProvider) : null;
}
- [CommandHandler (SourceEditorCommands.ToggleErrorTextMarker)]
- public void OnToggleErrorTextMarker ()
+ void ITextEditorImpl.SetTextPasteHandler (TextPasteHandler textPasteHandler)
+ {
+ var data = TextEditor.GetTextEditorData ();
+ if (data.TextPasteHandler != null)
+ ((TextPasteHandlerWrapper)data.TextPasteHandler).Dispose ();
+ if (textPasteHandler == null) {
+ data.TextPasteHandler = null;
+ return;
+ }
+ data.TextPasteHandler = new TextPasteHandlerWrapper (data, textPasteHandler);
+ }
+
+ internal Stack<EditSession> editSessions = new Stack<EditSession> ();
+
+ public EditSession CurrentSession {
+ get {
+ return editSessions.Count () > 0 ? editSessions.Peek () : null;
+ }
+ }
+
+ public void StartSession (EditSession session)
+ {
+ if (session == null)
+ throw new ArgumentNullException (nameof (session));
+ editSessions.Push (session);
+ session.SessionStarted ();
+ }
+
+ public void EndSession ()
+ {
+ if (editSessions.Count == 0)
+ throw new InvalidOperationException ("No edit session was started.");
+ var session = editSessions.Pop ();
+ session.Dispose ();
+ }
+
+ void ITextEditorImpl.ScrollTo (int offset)
{
- widget.OnToggleErrorTextMarker ();
+ TextEditor.ScrollTo (offset);
}
- [CommandHandler (EditCommands.IndentSelection)]
- public void IndentSelection ()
+ void ITextEditorImpl.CenterTo (int offset)
+ {
+ TextEditor.CenterTo (offset);
+ }
+
+ void ITextEditorImpl.ClearTooltipProviders ()
+ {
+ TextEditor.ClearTooltipProviders ();
+ }
+
+ IEnumerable<MonoDevelop.Ide.Editor.TooltipProvider> ITextEditorImpl.TooltipProvider {
+ get {
+ foreach (var p in GetTextEditorData ().TooltipProviders) {
+ var wrapper = p as TooltipProviderWrapper;
+ if (wrapper == null)
+ continue;
+ yield return wrapper.OriginalProvider;
+ }
+ }
+ }
+
+ void ITextEditorImpl.AddTooltipProvider (MonoDevelop.Ide.Editor.TooltipProvider provider)
+ {
+ TextEditor.AddTooltipProvider (new TooltipProviderWrapper (provider));
+ }
+
+ void ITextEditorImpl.RemoveTooltipProvider (MonoDevelop.Ide.Editor.TooltipProvider provider)
+ {
+ foreach (var p in GetTextEditorData ().TooltipProviders) {
+ var wrapper = p as TooltipProviderWrapper;
+ if (wrapper == null)
+ continue;
+ if (wrapper.OriginalProvider == provider) {
+ TextEditor.RemoveTooltipProvider (p);
+ return;
+ }
+ }
+ }
+
+ Xwt.Point ITextEditorImpl.GetEditorWindowOrigin ()
+ {
+ int ox, oy;
+ TextEditor.GdkWindow.GetOrigin (out ox, out oy);
+ return new Xwt.Point (ox, oy);
+ }
+
+ Xwt.Rectangle ITextEditorImpl.GetEditorAllocation ()
+ {
+ var alloc = TextEditor.Allocation;
+ return new Xwt.Rectangle (alloc.X, alloc.Y, alloc.Width, alloc.Height);
+ }
+
+
+ TextEditorExtension ITextEditorImpl.EditorExtension {
+ get {
+ return TextEditor.EditorExtension;
+ }
+ set {
+ TextEditor.EditorExtension = value;
+ }
+ }
+
+
+ SemanticHighlighting ITextEditorImpl.SemanticHighlighting {
+ get {
+ return TextEditor.SemanticHighlighting;
+ }
+ set {
+ TextEditor.SemanticHighlighting = value;
+ }
+ }
+
+ string ITextEditorImpl.GetPangoMarkup (int offset, int length, bool fitIdeStyle)
+ {
+ return TextEditor.GetTextEditorData ().GetMarkup (offset, length, false, replaceTabs:false, fitIdeStyle:fitIdeStyle);
+ }
+
+ void ITextEditorImpl.SetUsageTaskProviders (IEnumerable<UsageProviderEditorExtension> providers)
+ {
+ widget.ClearUsageTaskProvider ();
+ foreach (var p in providers) {
+ widget.AddUsageTaskProvider (p);
+ }
+ }
+
+ void ITextEditorImpl.SetQuickTaskProviders (IEnumerable<IQuickTaskProvider> providers)
+ {
+ widget.ClearQuickTaskProvider ();
+ foreach (var p in providers) {
+ widget.AddQuickTaskProvider (p);
+ }
+ }
+
+
+ class BracketMatcherTextMarker : TextSegmentMarker
+ {
+ public BracketMatcherTextMarker (int offset, int length) : base (offset, length)
+ {
+ }
+
+ public override void DrawBackground (MonoTextEditor editor, Cairo.Context cr, LineMetrics metrics, int startOffset, int endOffset)
+ {
+ try {
+ double fromX, toX;
+ GetLineDrawingPosition (metrics, startOffset, out fromX, out toX);
+
+ fromX = Math.Max (fromX, editor.TextViewMargin.XOffset);
+ toX = Math.Max (toX, editor.TextViewMargin.XOffset);
+ if (fromX < toX) {
+ var bracketMatch = new Cairo.Rectangle (fromX + 0.5, metrics.LineYRenderStartPosition + 0.5, toX - fromX - 1, editor.LineHeight - 2);
+ if (editor.TextViewMargin.BackgroundRenderer == null) {
+ cr.SetSourceColor (editor.ColorStyle.BraceMatchingRectangle.Color);
+ cr.Rectangle (bracketMatch);
+ cr.FillPreserve ();
+ cr.SetSourceColor (editor.ColorStyle.BraceMatchingRectangle.SecondColor);
+ cr.Stroke ();
+ }
+ }
+ } catch (Exception e) {
+ LoggingService.LogError ($"Error while drawing bracket matcher ({this}) startOffset={startOffset} lineCharLength={metrics.Layout.LineChars.Length}", e);
+ }
+ }
+
+ void GetLineDrawingPosition (LineMetrics metrics, int startOffset, out double fromX, out double toX)
+ {
+ var startXPos = metrics.TextRenderStartPosition;
+ var endXPos = metrics.TextRenderEndPosition;
+ int start = this.Offset;
+ int end = this.EndOffset;
+
+ uint curIndex = 0, byteIndex = 0;
+ TextViewMargin.TranslateToUTF8Index (metrics.Layout.LineChars, (uint)(start - startOffset), ref curIndex, ref byteIndex);
+
+ int x_pos = metrics.Layout.Layout.IndexToPos ((int)byteIndex).X;
+
+ fromX = startXPos + (int)(x_pos / Pango.Scale.PangoScale);
+
+ TextViewMargin.TranslateToUTF8Index (metrics.Layout.LineChars, (uint)(end - startOffset), ref curIndex, ref byteIndex);
+ x_pos = metrics.Layout.Layout.IndexToPos ((int)byteIndex).X;
+
+ toX = startXPos + (int)(x_pos / Pango.Scale.PangoScale);
+ }
+ }
+
+ List<BracketMatcherTextMarker> bracketMarkers = new List<BracketMatcherTextMarker> ();
+
+ void ITextEditorImpl.UpdateBraceMatchingResult (BraceMatchingResult? result)
+ {
+ if (result.HasValue) {
+ if (bracketMarkers.Count > 0 && result.Value.LeftSegment.Offset == bracketMarkers [0].Offset)
+ return;
+ ClearBracketMarkers ();
+ bracketMarkers.Add (new BracketMatcherTextMarker (result.Value.LeftSegment.Offset, result.Value.LeftSegment.Length));
+ bracketMarkers.Add (new BracketMatcherTextMarker (result.Value.RightSegment.Offset, result.Value.RightSegment.Length));
+ bracketMarkers.ForEach (marker => widget.TextEditor.Document.AddMarker (marker));
+ } else {
+ ClearBracketMarkers ();
+ }
+ }
+
+ void ClearBracketMarkers ()
+ {
+ bracketMarkers.ForEach (marker => widget.TextEditor.Document.RemoveMarker (marker));
+ bracketMarkers.Clear ();
+ }
+
+ public event EventHandler<MonoDevelop.Ide.Editor.LineEventArgs> LineChanged;
+
+ public event EventHandler<MonoDevelop.Ide.Editor.LineEventArgs> LineInserted;
+
+ void HandleLineInserted (object sender, Mono.TextEditor.LineEventArgs e)
+ {
+ var handler = LineInserted;
+ if (handler != null)
+ handler (this, new MonoDevelop.Ide.Editor.LineEventArgs (new DocumentLineWrapper (e.Line)));
+ }
+
+ public event EventHandler<MonoDevelop.Ide.Editor.LineEventArgs> LineRemoved;
+
+ void HandleLineRemoved (object sender, Mono.TextEditor.LineEventArgs e)
+ {
+ var handler = LineRemoved;
+ if (handler != null)
+ handler (this, new MonoDevelop.Ide.Editor.LineEventArgs (new DocumentLineWrapper (e.Line)));
+ }
+
+ public double ZoomLevel {
+ get { return TextEditor != null && TextEditor.Options != null ? TextEditor.Options.Zoom : 1d; }
+ set { if (TextEditor != null && TextEditor.Options != null) TextEditor.Options.Zoom = value; }
+ }
+ event EventHandler ITextEditorImpl.ZoomLevelChanged {
+ add {
+ TextEditor.Options.ZoomChanged += value;
+ }
+ remove {
+ TextEditor.Options.ZoomChanged += value;
+ }
+ }
+
+ public void AddOverlay (Control messageOverlayContent, Func<int> sizeFunc)
+ {
+ widget.AddOverlay (messageOverlayContent.GetNativeWidget<Widget> (), sizeFunc);
+ }
+
+ public void RemoveOverlay (Control messageOverlayContent)
+ {
+ widget.RemoveOverlay (messageOverlayContent.GetNativeWidget<Widget> ());
+ }
+
+ void TextViewMargin_LineShown (object sender, Mono.TextEditor.LineEventArgs e)
+ {
+ LineShown?.Invoke (this, new Ide.Editor.LineEventArgs (new DocumentLineWrapper (e.Line)));
+ }
+
+ public IEnumerable<IDocumentLine> VisibleLines {
+ get {
+ foreach (var v in TextEditor.TextViewMargin.CachedLine) {
+ yield return new DocumentLineWrapper (v);
+ }
+ }
+ }
+
+ public event EventHandler<Ide.Editor.LineEventArgs> LineShown;
+
+
+
+
+ #region IEditorActionHost implementation
+
+ void IEditorActionHost.MoveCaretDown ()
+ {
+ CaretMoveActions.Down (TextEditor.GetTextEditorData ());
+ }
+
+ void IEditorActionHost.MoveCaretUp ()
+ {
+ CaretMoveActions.Up (TextEditor.GetTextEditorData ());
+ }
+
+ void IEditorActionHost.MoveCaretRight ()
+ {
+ CaretMoveActions.Right (TextEditor.GetTextEditorData ());
+ }
+
+ void IEditorActionHost.MoveCaretLeft ()
+ {
+ CaretMoveActions.Left (TextEditor.GetTextEditorData ());
+ }
+
+ void IEditorActionHost.MoveCaretToLineEnd ()
+ {
+ CaretMoveActions.LineEnd (TextEditor.GetTextEditorData ());
+ }
+
+ void IEditorActionHost.MoveCaretToLineStart ()
+ {
+ CaretMoveActions.LineHome (TextEditor.GetTextEditorData ());
+ }
+
+ void IEditorActionHost.MoveCaretToDocumentStart ()
+ {
+ CaretMoveActions.ToDocumentStart (TextEditor.GetTextEditorData ());
+ }
+
+ void IEditorActionHost.MoveCaretToDocumentEnd ()
+ {
+ CaretMoveActions.ToDocumentEnd (TextEditor.GetTextEditorData ());
+ }
+
+ void IEditorActionHost.Backspace ()
+ {
+ DeleteActions.Backspace (TextEditor.GetTextEditorData ());
+ }
+
+ void IEditorActionHost.ClipboardCopy ()
+ {
+ ClipboardActions.Copy (TextEditor.GetTextEditorData ());
+ }
+
+ void IEditorActionHost.ClipboardCut ()
+ {
+ ClipboardActions.Cut (TextEditor.GetTextEditorData ());
+ }
+
+ void IEditorActionHost.ClipboardPaste ()
+ {
+ ClipboardActions.Paste (TextEditor.GetTextEditorData ());
+ }
+
+ void IEditorActionHost.NewLine ()
+ {
+ MiscActions.InsertNewLine (TextEditor.GetTextEditorData ());
+ }
+
+ void IEditorActionHost.SwitchCaretMode ()
+ {
+ TextEditor.RunAction (MiscActions.SwitchCaretMode);
+ }
+
+ void IEditorActionHost.InsertTab ()
+ {
+ TextEditor.RunAction (MiscActions.InsertTab);
+ }
+
+ void IEditorActionHost.RemoveTab ()
+ {
+ TextEditor.RunAction (MiscActions.RemoveTab);
+ }
+
+ void IEditorActionHost.InsertNewLine ()
+ {
+ TextEditor.RunAction (MiscActions.InsertNewLine);
+ }
+
+ void IEditorActionHost.DeletePreviousWord ()
+ {
+ TextEditor.RunAction (DeleteActions.PreviousWord);
+ }
+
+ void IEditorActionHost.DeleteNextWord ()
+ {
+ TextEditor.RunAction (DeleteActions.NextWord);
+ }
+
+ void IEditorActionHost.DeletePreviousSubword ()
+ {
+ TextEditor.RunAction (DeleteActions.PreviousSubword);
+ }
+
+ void IEditorActionHost.DeleteNextSubword ()
+ {
+ TextEditor.RunAction (DeleteActions.NextSubword);
+ }
+
+ void IEditorActionHost.StartCaretPulseAnimation ()
+ {
+ TextEditor.StartCaretPulseAnimation ();
+ }
+
+ void IEditorActionHost.RecenterEditor ()
+ {
+ TextEditor.RunAction (MiscActions.RecenterEditor);
+ }
+
+ void IEditorActionHost.JoinLines ()
+ {
+ using (var undo = Document.OpenUndoGroup ()) {
+ TextEditor.RunAction (Mono.TextEditor.Vi.ViActions.Join);
+ }
+ }
+
+ void IEditorActionHost.MoveNextSubWord ()
+ {
+ TextEditor.RunAction (SelectionActions.MoveNextSubword);
+ }
+
+ void IEditorActionHost.MovePrevSubWord ()
+ {
+ TextEditor.RunAction (SelectionActions.MovePreviousSubword);
+ }
+
+ void IEditorActionHost.MoveNextWord ()
+ {
+ TextEditor.RunAction (CaretMoveActions.NextWord);
+ }
+
+ void IEditorActionHost.MovePrevWord ()
+ {
+ TextEditor.RunAction (CaretMoveActions.PreviousWord);
+ }
+
+ void IEditorActionHost.PageUp ()
+ {
+ TextEditor.RunAction (CaretMoveActions.PageUp);
+ }
+
+ void IEditorActionHost.PageDown ()
+ {
+ TextEditor.RunAction (CaretMoveActions.PageDown);
+ }
+
+ void IEditorActionHost.DeleteCurrentLine ()
+ {
+ TextEditor.RunAction (DeleteActions.CaretLine);
+ }
+
+ void IEditorActionHost.DeleteCurrentLineToEnd ()
+ {
+ TextEditor.RunAction (DeleteActions.CaretLineToEnd);
+ }
+
+ void IEditorActionHost.ScrollLineUp ()
+ {
+ TextEditor.RunAction (ScrollActions.Up);
+ }
+
+ void IEditorActionHost.ScrollLineDown ()
+ {
+ TextEditor.RunAction (ScrollActions.Down);
+ }
+
+ void IEditorActionHost.ScrollPageUp ()
+ {
+ TextEditor.RunAction (ScrollActions.PageUp);
+ }
+
+ void IEditorActionHost.ScrollPageDown ()
+ {
+ TextEditor.RunAction (ScrollActions.PageDown);
+ }
+
+ void IEditorActionHost.MoveBlockUp ()
+ {
+ using (var undo = TextEditor.OpenUndoGroup ()) {
+ TextEditor.RunAction (MiscActions.MoveBlockUp);
+ CorrectIndenting ();
+ }
+ }
+
+ void IEditorActionHost.MoveBlockDown ()
+ {
+ using (var undo = TextEditor.OpenUndoGroup ()) {
+ TextEditor.RunAction (MiscActions.MoveBlockDown);
+ CorrectIndenting ();
+ }
+ }
+
+ void IEditorActionHost.ToggleBlockSelectionMode ()
+ {
+ TextEditor.SelectionMode = TextEditor.SelectionMode == Mono.TextEditor.SelectionMode.Normal ? Mono.TextEditor.SelectionMode.Block : Mono.TextEditor.SelectionMode.Normal;
+ TextEditor.QueueDraw ();
+ }
+
+ void IEditorActionHost.IndentSelection ()
{
if (widget.TextEditor.IsSomethingSelected) {
MiscActions.IndentSelection (widget.TextEditor.GetTextEditorData ());
@@ -2607,45 +3371,74 @@ namespace MonoDevelop.SourceEditor
widget.TextEditor.Insert (offset, widget.TextEditor.Options.IndentationString);
}
}
-
- [CommandHandler (EditCommands.UnIndentSelection)]
- public void UnIndentSelection ()
+
+ void IEditorActionHost.UnIndentSelection ()
{
- Mono.TextEditor.MiscActions.RemoveTab (widget.TextEditor.GetTextEditorData ());
+ MiscActions.RemoveTab (widget.TextEditor.GetTextEditorData ());
}
-
- [CommandHandler (EditCommands.InsertGuid)]
- public void InsertGuid ()
+
+ #endregion
+
+
+ #region ISegmentMarkerHost implementation
+
+ ITextSegmentMarker ITextMarkerFactory.CreateUsageMarker (MonoDevelop.Ide.Editor.TextEditor editor, Usage usage)
{
- TextEditor.InsertAtCaret (Guid.NewGuid ().ToString ());
+ return new UsageSegmentMarker (usage);
}
- [CommandHandler (SourceEditorCommands.NextIssue)]
- void NextIssue ()
+ IUrlTextLineMarker ITextMarkerFactory.CreateUrlTextMarker (MonoDevelop.Ide.Editor.TextEditor editor, IDocumentLine line, string value, MonoDevelop.Ide.Editor.UrlType url, string syntax, int startCol, int endCol)
{
- widget.NextIssue ();
- }
+ return new UrlTextLineMarker (TextEditor.Document, line, value, (Mono.TextEditor.UrlType)url, syntax, startCol, endCol);
+ }
- [CommandHandler (SourceEditorCommands.PrevIssue)]
- void PrevIssue ()
+ ICurrentDebugLineTextMarker ITextMarkerFactory.CreateCurrentDebugLineTextMarker (MonoDevelop.Ide.Editor.TextEditor editor, int offset, int length)
{
- widget.PrevIssue ();
+ return new CurrentDebugLineTextMarker (TextEditor, offset, length);
}
- [CommandHandler (SourceEditorCommands.NextIssueError)]
- void NextIssueError ()
+ ITextLineMarker ITextMarkerFactory.CreateAsmLineMarker (MonoDevelop.Ide.Editor.TextEditor editor)
{
- widget.NextIssueError ();
- }
+ return new AsmLineMarker ();
+ }
- [CommandHandler (SourceEditorCommands.PrevIssueError)]
- void PrevIssueError ()
+ IUnitTestMarker ITextMarkerFactory.CreateUnitTestMarker (MonoDevelop.Ide.Editor.TextEditor editor, UnitTestMarkerHost host, UnitTestLocation unitTestLocation)
{
- widget.PrevIssueError ();
+ return new UnitTestMarker (TextEditor, host, unitTestLocation);
+ }
+
+ IMessageBubbleLineMarker ITextMarkerFactory.CreateMessageBubbleLineMarker (MonoDevelop.Ide.Editor.TextEditor editor)
+ {
+ return new MessageBubbleTextMarker (messageBubbleCache);
}
+ IGenericTextSegmentMarker ITextMarkerFactory.CreateGenericTextSegmentMarker (MonoDevelop.Ide.Editor.TextEditor editor, TextSegmentMarkerEffect effect, int offset, int length)
+ {
+ switch (effect) {
+ case TextSegmentMarkerEffect.DottedLine:
+ case TextSegmentMarkerEffect.WavedLine:
+ return new GenericUnderlineMarker (new Mono.TextEditor.TextSegment (offset, length), effect);
+ case TextSegmentMarkerEffect.GrayOut:
+ return new GrayOutMarker (new Mono.TextEditor.TextSegment (offset, length));
+ default:
+ throw new ArgumentOutOfRangeException ();
+ }
+ }
+ public ILinkTextMarker CreateLinkMarker (MonoDevelop.Ide.Editor.TextEditor editor, int offset, int length, Action<LinkRequest> activateLink)
+ {
+ return new LinkMarker (offset, length, activateLink);
+ }
+ ISmartTagMarker ITextMarkerFactory.CreateSmartTagMarker (MonoDevelop.Ide.Editor.TextEditor editor, int offset, MonoDevelop.Ide.Editor.DocumentLocation realLocation)
+ {
+ return new SmartTagMarker (offset, realLocation);
+ }
+
+ IErrorMarker ITextMarkerFactory.CreateErrorMarker (MonoDevelop.Ide.Editor.TextEditor editor, MonoDevelop.Ide.TypeSystem.Error info, int offset, int length)
+ {
+ return new ErrorMarker (info, offset, length);
+ }
#endregion
@@ -2672,7 +3465,7 @@ namespace MonoDevelop.SourceEditor
void GotoPgDown ()
{
widget.QuickTaskStrip.GotoPgDown ();
- }
+ }
[CommandUpdateHandler (ScrollbarCommand.ShowTasks)]
void UpdateShowMap (CommandInfo info)
@@ -2699,5 +3492,14 @@ namespace MonoDevelop.SourceEditor
}
#endregion
+
+
+
+ public event EventHandler FocusLost;
+
+ void TextArea_FocusOutEvent (object o, FocusOutEventArgs args)
+ {
+ FocusLost?.Invoke (this, EventArgs.Empty);
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs
index 7062444ed2..9dfe1d2b70 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs
@@ -45,12 +45,14 @@ using MonoDevelop.Ide.TypeSystem;
using Mono.TextEditor.Highlighting;
using MonoDevelop.SourceEditor.QuickTasks;
using ICSharpCode.NRefactory.Semantics;
-using ICSharpCode.NRefactory.Refactoring;
using MonoDevelop.Ide.Tasks;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Extension;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.SourceEditor
{
- class SourceEditorWidget : ITextEditorExtension, IQuickTaskProvider
+ class SourceEditorWidget : IServiceProvider
{
SourceEditorView view;
DecoratedScrolledWindow mainsw;
@@ -62,11 +64,16 @@ namespace MonoDevelop.SourceEditor
TextEditorData textEditorData;
const uint CHILD_PADDING = 0;
+
+ // VV: I removed the animation since it was very slow especially on @2x
+ // TODO: Maybe the AddAnimationWidget () shouldn't be used at all
+ const uint ANIMATION_DURATION = 0; // 300
// bool shouldShowclassBrowser;
// bool canShowClassBrowser;
- ISourceEditorOptions options {
+ Mono.TextEditor.ITextEditorOptions options {
get {
+
return textEditor.Options;
}
}
@@ -82,7 +89,7 @@ namespace MonoDevelop.SourceEditor
ParsedDocument parsedDocument;
- readonly ExtensibleTextEditor textEditor;
+ ExtensibleTextEditor textEditor;
ExtensibleTextEditor splittedTextEditor;
ExtensibleTextEditor lastActiveEditor;
@@ -92,13 +99,6 @@ namespace MonoDevelop.SourceEditor
}
}
- public Ambience Ambience {
- get {
- string fileName = view.IsUntitled ? view.UntitledName : view.ContentName;
- return AmbienceService.GetAmbienceForFile (fileName);
- }
- }
-
List<IQuickTaskProvider> quickTaskProvider = new List<IQuickTaskProvider> ();
public void AddQuickTaskProvider (IQuickTaskProvider provider)
{
@@ -108,6 +108,14 @@ namespace MonoDevelop.SourceEditor
secondsw.AddQuickTaskProvider (provider);
}
+ internal void ClearQuickTaskProvider ()
+ {
+ foreach (var provider in quickTaskProvider.ToArray ()) {
+ RemoveQuickTaskProvider (provider);
+ }
+ quickTaskProvider = new List<IQuickTaskProvider> ();
+ }
+
public void RemoveQuickTaskProvider (IQuickTaskProvider provider)
{
quickTaskProvider.Remove (provider);
@@ -117,44 +125,32 @@ namespace MonoDevelop.SourceEditor
}
- List<IUsageProvider> usageProvider = new List<IUsageProvider> ();
- public void AddUsageTaskProvider (IUsageProvider provider)
+ List<UsageProviderEditorExtension> usageProvider = new List<UsageProviderEditorExtension> ();
+
+ internal void ClearUsageTaskProvider()
{
- usageProvider.Add (provider);
- mainsw.AddUsageProvider (provider);
- if (secondsw != null)
- secondsw.AddUsageProvider (provider);
- }
-
- #region ITextEditorExtension
-
- ITextEditorExtension ITextEditorExtension.Next {
- get {
- return null;
+ foreach (var provider in usageProvider.ToArray ()) {
+ RemoveUsageTaskProvider (provider);
}
- }
-
- object ITextEditorExtension.GetExtensionCommandTarget ()
- {
- return null;
- }
+ usageProvider = new List<UsageProviderEditorExtension> ();
- void ITextEditorExtension.TextChanged (int startIndex, int endIndex)
- {
}
- void ITextEditorExtension.CursorPositionChanged ()
+ public void AddUsageTaskProvider (UsageProviderEditorExtension provider)
{
+ usageProvider.Add (provider);
+ mainsw.AddUsageProvider (provider);
+ if (secondsw != null)
+ secondsw.AddUsageProvider (provider);
}
- bool ITextEditorExtension.KeyPress (Gdk.Key key, char keyChar, Gdk.ModifierType modifier)
+ void RemoveUsageTaskProvider (UsageProviderEditorExtension provider)
{
- this.TextEditor.SimulateKeyPress (key, (uint)keyChar, modifier);
- if (key == Gdk.Key.Escape)
- return true;
- return false;
+ usageProvider.Remove (provider);
+ mainsw.RemoveUsageProvider (provider);
+ if (secondsw != null)
+ secondsw.RemoveUsageProvider (provider);
}
- #endregion
public bool HasMessageBar {
get { return messageBar != null; }
@@ -195,7 +191,7 @@ namespace MonoDevelop.SourceEditor
return false;
}
- public class Border : Gtk.DrawingArea
+ class Border : Gtk.DrawingArea
{
protected override bool OnExposeEvent (Gdk.EventExpose evnt)
{
@@ -209,6 +205,7 @@ namespace MonoDevelop.SourceEditor
{
SourceEditorWidget parent;
ScrolledWindow scrolledWindow;
+ EventBox scrolledBackground;
QuickTaskStrip strip;
@@ -235,9 +232,11 @@ namespace MonoDevelop.SourceEditor
this.parent = parent;
this.strip = new QuickTaskStrip ();
+ scrolledBackground = new EventBox ();
scrolledWindow = new CompactScrolledWindow ();
scrolledWindow.ButtonPressEvent += PrepareEvent;
- PackStart (scrolledWindow, true, true, 0);
+ scrolledBackground.Add (scrolledWindow);
+ PackStart (scrolledBackground, true, true, 0);
strip.VAdjustment = scrolledWindow.Vadjustment;
PackEnd (strip, false, true, 0);
@@ -307,20 +306,36 @@ namespace MonoDevelop.SourceEditor
provider.TasksUpdated -= HandleTasksUpdated;
}
+ public void AddUsageProvider (UsageProviderEditorExtension p)
+ {
+ p.UsagesUpdated += HandleUsagesUpdated;
+ }
+
+ public void RemoveUsageProvider (UsageProviderEditorExtension p)
+ {
+ p.UsagesUpdated -= HandleUsagesUpdated;
+ }
- public void AddUsageProvider (IUsageProvider p)
+ void HandleUsagesUpdated (object sender, EventArgs e)
{
- p.UsagesUpdated += (sender, e) => strip.Update (p);
+ strip.Update ((UsageProviderEditorExtension)sender);
}
-
+
protected override void OnDestroyed ()
{
+ if (scrolledWindow == null)
+ return;
if (scrolledWindow.Child != null)
RemoveEvents ();
-
SetSuppressScrollbar (false);
QuickTaskStrip.EnableFancyFeatures.Changed -= FancyFeaturesChanged;
scrolledWindow.ButtonPressEvent -= PrepareEvent;
+ scrolledWindow.Vadjustment.Destroy ();
+ scrolledWindow.Hadjustment.Destroy ();
+ scrolledWindow.Destroy ();
+ scrolledWindow = null;
+ strip.Destroy ();
+ strip = null;
base.OnDestroyed ();
}
@@ -329,11 +344,11 @@ namespace MonoDevelop.SourceEditor
args.RetVal = true;
}
- public void SetTextEditor (TextEditor container)
+ public void SetTextEditor (Mono.TextEditor.MonoTextEditor container)
{
scrolledWindow.Child = container;
this.strip.TextEditor = container;
-// container.TextEditorWidget.EditorOptionsChanged += OptionsChanged;
+ container.EditorOptionsChanged += OptionsChanged;
container.Caret.ModeChanged += parent.UpdateLineColOnEventHandler;
container.Caret.PositionChanged += parent.CaretPositionChanged;
container.SelectionChanged += parent.UpdateLineColOnEventHandler;
@@ -341,26 +356,27 @@ namespace MonoDevelop.SourceEditor
void OptionsChanged (object sender, EventArgs e)
{
- TextEditor editor = (TextEditor)sender;
- scrolledWindow.ModifyBg (StateType.Normal, (Mono.TextEditor.HslColor)editor.ColorStyle.PlainText.Background);
+ var editor = (Mono.TextEditor.MonoTextEditor)scrolledWindow.Child;
+ scrolledBackground.ModifyBg (StateType.Normal, (HslColor)editor.ColorStyle.PlainText.Background);
}
void RemoveEvents ()
{
- var container = scrolledWindow.Child as TextEditor;
+ var container = scrolledWindow.Child as Mono.TextEditor.MonoTextEditor;
if (container == null) {
+
LoggingService.LogError ("can't remove events from text editor container.");
return;
}
-// container.TextEditorWidget.EditorOptionsChanged -= OptionsChanged;
+ container.EditorOptionsChanged -= OptionsChanged;
container.Caret.ModeChanged -= parent.UpdateLineColOnEventHandler;
container.Caret.PositionChanged -= parent.CaretPositionChanged;
container.SelectionChanged -= parent.UpdateLineColOnEventHandler;
}
- public TextEditor RemoveTextEditor ()
+ public Mono.TextEditor.MonoTextEditor RemoveTextEditor ()
{
- var child = scrolledWindow.Child as TextEditor;
+ var child = scrolledWindow.Child as Mono.TextEditor.MonoTextEditor;
if (child == null)
return null;
RemoveEvents ();
@@ -383,16 +399,15 @@ namespace MonoDevelop.SourceEditor
if (this.splittedTextEditor == null || !splittedTextEditor.TextArea.HasFocus)
OnLostFocus ();
};
- IdeApp.FocusOut += (sender, e) => textEditor.TextArea.HideTooltip (false);
+ if (IdeApp.CommandService != null)
+ IdeApp.FocusOut += IdeApp_FocusOut;
mainsw = new DecoratedScrolledWindow (this);
mainsw.SetTextEditor (textEditor);
vbox.PackStart (mainsw, true, true, 0);
textEditorData = textEditor.GetTextEditorData ();
- textEditorData.EditModeChanged += delegate {
- KillWidgets ();
- };
+ textEditorData.EditModeChanged += TextEditorData_EditModeChanged;
ResetFocusChain ();
@@ -404,23 +419,43 @@ namespace MonoDevelop.SourceEditor
UpdateLineCol ();
};
vbox.Destroyed += delegate {
+ if (isDisposed)
+ return;
isDisposed = true;
- RemoveErrorUndelinesResetTimerId ();
StopParseInfoThread ();
KillWidgets ();
- foreach (var provider in quickTaskProvider.ToArray ()) {
- RemoveQuickTaskProvider (provider);
- }
+ ClearQuickTaskProvider ();
+ ClearUsageTaskProvider ();
+ if (textEditor != null && !textEditor.IsDestroyed)
+ textEditor.Destroy ();
+
+ if (splittedTextEditor != null && !splittedTextEditor.IsDestroyed)
+ splittedTextEditor.Destroy ();
+
this.lastActiveEditor = null;
this.splittedTextEditor = null;
+ this.textEditor = null;
+ textEditorData.EditModeChanged -= TextEditorData_EditModeChanged;
+ textEditorData = null;
view = null;
parsedDocument = null;
// IdeApp.Workbench.StatusBar.ClearCaretState ();
};
vbox.ShowAll ();
+
+ }
+
+ void TextEditorData_EditModeChanged (object sender, EditModeChangedEventArgs e)
+ {
+ KillWidgets ();
+ }
+
+ void IdeApp_FocusOut (object sender, EventArgs e)
+ {
+ textEditor.TextArea.HideTooltip (false);
}
void OnLostFocus ()
@@ -447,10 +482,16 @@ namespace MonoDevelop.SourceEditor
public void Dispose ()
{
- RemoveErrorUndelinesResetTimerId ();
+ if (IdeApp.CommandService != null)
+ IdeApp.FocusOut -= IdeApp_FocusOut;
+
+ if (!isDisposed) {
+ vbox.Destroy ();
+ isDisposed = true;
+ }
}
- FoldSegment AddMarker (List<FoldSegment> foldSegments, string text, DomRegion region, FoldingType type)
+ Mono.TextEditor.FoldSegment AddMarker (List<Mono.TextEditor.FoldSegment> foldSegments, string text, DomRegion region, Mono.TextEditor.FoldingType type)
{
Document document = textEditorData.Document;
if (document == null || region.BeginLine <= 0 || region.EndLine <= 0 || region.BeginLine > document.LineCount || region.EndLine > document.LineCount)
@@ -459,110 +500,27 @@ namespace MonoDevelop.SourceEditor
int startOffset = document.LocationToOffset (region.BeginLine, region.BeginColumn);
int endOffset = document.LocationToOffset (region.EndLine, region.EndColumn );
- FoldSegment result = new FoldSegment (document, text, startOffset, endOffset - startOffset, type);
+ var result = new Mono.TextEditor.FoldSegment (document, text, startOffset, endOffset - startOffset, type);
foldSegments.Add (result);
return result;
}
- HashSet<string> symbols = new HashSet<string> ();
bool reloadSettings;
void HandleParseInformationUpdaterWorkerThreadDoWork (bool firstTime, ParsedDocument parsedDocument, CancellationToken token = default(CancellationToken))
{
- var doc = Document;
- if (doc == null || parsedDocument == null)
- return;
- UpdateErrorUndelines (parsedDocument);
- if (!options.ShowFoldMargin)
- return;
- // don't update parsed documents that contain errors - the foldings from there may be invalid.
- if (parsedDocument.HasErrors)
- return;
- try {
- List<FoldSegment > foldSegments = new List<FoldSegment> ();
- bool updateSymbols = parsedDocument.Defines.Count != symbols.Count;
- if (!updateSymbols) {
- foreach (PreProcessorDefine define in parsedDocument.Defines) {
- if (token.IsCancellationRequested)
- return;
- if (!symbols.Contains (define.Define)) {
- updateSymbols = true;
- break;
- }
- }
- }
-
- if (updateSymbols) {
- symbols.Clear ();
- foreach (PreProcessorDefine define in parsedDocument.Defines) {
- symbols.Add (define.Define);
- }
- }
-
- foreach (FoldingRegion region in parsedDocument.Foldings) {
- if (token.IsCancellationRequested)
+
+
+ if (reloadSettings) {
+ reloadSettings = false;
+ Application.Invoke (delegate {
+ if (isDisposed)
return;
- FoldingType type = FoldingType.None;
- bool setFolded = false;
- bool folded = false;
-
- //decide whether the regions should be folded by default
- switch (region.Type) {
- case FoldType.Member:
- type = FoldingType.TypeMember;
- break;
- case FoldType.Type:
- type = FoldingType.TypeDefinition;
- break;
- case FoldType.UserRegion:
- type = FoldingType.Region;
- setFolded = options.DefaultRegionsFolding;
- folded = true;
- break;
- case FoldType.Comment:
- type = FoldingType.Comment;
- setFolded = options.DefaultCommentFolding;
- folded = true;
- break;
- case FoldType.CommentInsideMember:
- type = FoldingType.Comment;
- setFolded = options.DefaultCommentFolding;
- folded = false;
- break;
- case FoldType.Undefined:
- setFolded = true;
- folded = region.IsFoldedByDefault;
- break;
- }
-
- //add the region
- FoldSegment marker = AddMarker (foldSegments, region.Name,
- region.Region, type);
-
- //and, if necessary, set its fold state
- if (marker != null && setFolded && firstTime) {
- // only fold on document open, later added folds are NOT folded by default.
- marker.IsFolded = folded;
- continue;
- }
- if (marker != null && region.Region.IsInside (textEditorData.Caret.Line, textEditorData.Caret.Column))
- marker.IsFolded = false;
-
- }
- doc.UpdateFoldSegments (foldSegments, false, true, token);
-
- if (reloadSettings) {
- reloadSettings = false;
- Application.Invoke (delegate {
- if (isDisposed)
- return;
- view.LoadSettings ();
- mainsw.QueueDraw ();
- });
- }
- } catch (Exception ex) {
- LoggingService.LogError ("Unhandled exception in ParseInformationUpdaterWorkerThread", ex);
+ view.LoadSettings ();
+ mainsw.QueueDraw ();
+ });
}
+
}
internal void UpdateParsedDocument (ParsedDocument document)
@@ -590,7 +548,7 @@ namespace MonoDevelop.SourceEditor
StopParseInfoThread ();
if (runInThread) {
var token = parserInformationUpdateSrc.Token;
- System.Threading.Tasks.Task.Factory.StartNew (delegate {
+ System.Threading.Tasks.Task.Run (delegate {
HandleParseInformationUpdaterWorkerThreadDoWork (false, parsedDocument, token);
});
} else {
@@ -608,77 +566,9 @@ namespace MonoDevelop.SourceEditor
{
this.lastActiveEditor = editor;
}
-
- #region Error underlining
- List<ErrorMarker> errors = new List<ErrorMarker> ();
- uint resetTimerId;
-
- void RemoveErrorUndelinesResetTimerId ()
- {
- if (resetTimerId > 0) {
- GLib.Source.Remove (resetTimerId);
- resetTimerId = 0;
- }
- }
-
- void UpdateErrorUndelines (ParsedDocument parsedDocument)
- {
- if (!options.UnderlineErrors || parsedDocument == null) {
- Application.Invoke (delegate {
- var doc = this.TextEditor != null ? this.TextEditor.Document : null;
- if (doc == null)
- return;
- RemoveErrorUnderlines (doc);
- UpdateQuickTasks (parsedDocument);
- });
- return;
- }
-
- Application.Invoke (delegate {
- if (!quickTaskProvider.Contains (this))
- AddQuickTaskProvider (this);
- RemoveErrorUndelinesResetTimerId ();
- const uint timeout = 500;
- resetTimerId = GLib.Timeout.Add (timeout, delegate {
- if (!this.isDisposed) {
- Document doc = this.TextEditor != null ? this.TextEditor.Document : null;
- if (doc != null) {
- RemoveErrorUnderlines (doc);
-
- // Else we underline the error
- if (parsedDocument.Errors != null) {
- foreach (var error in parsedDocument.Errors)
- UnderLineError (doc, error);
- }
- }
- }
- resetTimerId = 0;
- return false;
- });
- UpdateQuickTasks (parsedDocument);
- });
- }
-
- void RemoveErrorUnderlines (Document doc)
- {
- errors.ForEach (err => doc.RemoveMarker (err));
- errors.Clear ();
- }
-
- void UnderLineError (Document doc, Error info)
- {
- var line = doc.GetLine (info.Region.BeginLine);
- // If the line is already underlined
- if (errors.Any (em => em.LineSegment == line))
- return;
- ErrorMarker error = new ErrorMarker (textEditor.Document, info, line);
- errors.Add (error);
- doc.AddMarker (line, error);
- }
- #endregion
-
-
- Gtk.Paned splitContainer = null;
+
+ Gtk.Paned splitContainer;
+
public bool IsSplitted {
get {
return splitContainer != null;
@@ -763,7 +653,7 @@ namespace MonoDevelop.SourceEditor
if (!textEditor.TextArea.HasFocus)
OnLostFocus ();
};
- splittedTextEditor.Extension = textEditor.Extension;
+ splittedTextEditor.EditorExtension = textEditor.EditorExtension;
if (textEditor.GetTextEditorData ().HasIndentationTracker)
splittedTextEditor.GetTextEditorData ().IndentationTracker = textEditor.GetTextEditorData ().IndentationTracker;
splittedTextEditor.Document.BracketMatcher = textEditor.Document.BracketMatcher;
@@ -831,7 +721,7 @@ namespace MonoDevelop.SourceEditor
EllipsizeMiddle (Document.FileName, 50), BrandingService.ApplicationName));
var b1 = new Button (GettextCatalog.GetString ("_Reload from disk"));
- b1.Image = ImageService.GetImage (Gtk.Stock.Refresh, IconSize.Button);
+ b1.Image = new ImageView (Gtk.Stock.Refresh, IconSize.Button);
b1.Clicked += delegate {
Reload ();
view.TextEditor.GrabFocus ();
@@ -839,7 +729,7 @@ namespace MonoDevelop.SourceEditor
messageBar.ActionArea.Add (b1);
var b2 = new Button (GettextCatalog.GetString ("_Keep changes"));
- b2.Image = ImageService.GetImage (Gtk.Stock.Cancel, IconSize.Button);
+ b2.Image = new ImageView (Gtk.Stock.Cancel, IconSize.Button);
b2.Clicked += delegate {
RemoveMessageBar ();
view.LastSaveTimeUtc = System.IO.File.GetLastWriteTimeUtc (view.ContentName);
@@ -849,14 +739,14 @@ namespace MonoDevelop.SourceEditor
if (multiple) {
var b3 = new Button (GettextCatalog.GetString ("_Reload all"));
- b3.Image = ImageService.GetImage (Gtk.Stock.Cancel, IconSize.Button);
+ b3.Image = new ImageView (Gtk.Stock.Cancel, IconSize.Button);
b3.Clicked += delegate {
FileRegistry.ReloadAllChangedFiles ();
};
messageBar.ActionArea.Add (b3);
var b4 = new Button (GettextCatalog.GetString ("_Ignore all"));
- b4.Image = ImageService.GetImage (Gtk.Stock.Cancel, IconSize.Button);
+ b4.Image = new ImageView (Gtk.Stock.Cancel, IconSize.Button);
b4.Clicked += delegate {
FileRegistry.IgnoreAllChangedFiles ();
};
@@ -969,20 +859,38 @@ namespace MonoDevelop.SourceEditor
return "Unknown";
}
- OverlayMessageWindow messageOverlayWindow;
+ //TODO: Support multiple Overlays at once to display above each other
+ internal void AddOverlay (Widget messageOverlayContent, Func<int> sizeFunc = null)
+ {
+ var messageOverlayWindow = new OverlayMessageWindow ();
+ messageOverlayWindow.Child = messageOverlayContent;
+ messageOverlayWindow.SizeFunc = sizeFunc;
+ messageOverlayWindow.ShowOverlay (TextEditor);
+ messageOverlayWindows.Add (messageOverlayWindow);
+ }
+
+ internal void RemoveOverlay (Widget messageOverlayContent)
+ {
+ var window = messageOverlayWindows.FirstOrDefault (w => w.Child == messageOverlayContent);
+ if (window == null)
+ return;
+ messageOverlayWindows.Remove (window);
+ window.Destroy ();
+ }
+
+ List<OverlayMessageWindow> messageOverlayWindows = new List<OverlayMessageWindow> ();
+ HBox incorrectEolMessage;
void ShowIncorrectEolMarkers (string fileName, bool multiple)
{
RemoveMessageBar ();
- messageOverlayWindow = new OverlayMessageWindow ();
-
var hbox = new HBox ();
hbox.Spacing = 8;
var image = new HoverCloseButton ();
hbox.PackStart (image, false, false, 0);
var label = new Label (string.Format ("This file has line endings ({0}) which differ from the policy settings ({1}).", GetEolString (DetectedEolMarker), GetEolString (textEditor.Options.DefaultEolMarker)));
- var color = (Mono.TextEditor.HslColor)textEditor.ColorStyle.NotificationText.Foreground;
+ var color = (HslColor)textEditor.ColorStyle.NotificationText.Foreground;
label.ModifyFg (StateType.Normal, color);
int w, h;
@@ -1007,11 +915,9 @@ namespace MonoDevelop.SourceEditor
var combo = new ComboBox (list.ToArray ());
combo.Active = 0;
hbox.PackEnd (combo, false, false, 0);
- var container = new HBox ();
+ incorrectEolMessage = new HBox ();
const int containerPadding = 8;
- container.PackStart (hbox, true, true, containerPadding);
- messageOverlayWindow.Child = container;
- messageOverlayWindow.ShowOverlay (this.TextEditor);
+ incorrectEolMessage.PackStart (hbox, true, true, containerPadding);
// This is hacky, but it will ensure that our combo appears with with the correct size.
GLib.Timeout.Add (100, delegate {
@@ -1019,25 +925,26 @@ namespace MonoDevelop.SourceEditor
return false;
});
- messageOverlayWindow.SizeFunc = () => {
+ AddOverlay (incorrectEolMessage, () => {
return okButton.SizeRequest ().Width +
- combo.SizeRequest ().Width +
- image.SizeRequest ().Width +
- w +
- hbox.Spacing * 4 +
- containerPadding * 2;
- };
+ combo.SizeRequest ().Width +
+ image.SizeRequest ().Width +
+ w +
+ hbox.Spacing * 4 +
+ containerPadding * 2;
+ });
+
image.Clicked += delegate {
UseIncorrectMarkers = true;
view.WorkbenchWindow.ShowNotification = false;
RemoveMessageBar ();
};
- okButton.Clicked += delegate {
+ okButton.Clicked += async delegate {
switch (combo.Active) {
case 0:
ConvertLineEndings ();
view.WorkbenchWindow.ShowNotification = false;
- view.Save (fileName, view.SourceEncoding);
+ await view.Save (fileName, view.SourceEncoding);
break;
case 1:
FileRegistry.ConvertLineEndingsInAllFiles ();
@@ -1067,7 +974,7 @@ namespace MonoDevelop.SourceEditor
"Do you want to use the original file, or load from the autosave file?")));
Button b1 = new Button (GettextCatalog.GetString("_Use original file"));
- b1.Image = ImageService.GetImage (Gtk.Stock.Refresh, IconSize.Button);
+ b1.Image = new ImageView (Gtk.Stock.Refresh, IconSize.Button);
b1.Clicked += delegate {
try {
AutoSave.RemoveAutoSaveFile (fileName);
@@ -1083,14 +990,13 @@ namespace MonoDevelop.SourceEditor
messageBar.ActionArea.Add (b1);
Button b2 = new Button (GettextCatalog.GetString("_Load from autosave"));
- b2.Image = ImageService.GetImage (Gtk.Stock.RevertToSaved, IconSize.Button);
+ b2.Image = new ImageView (Gtk.Stock.RevertToSaved, IconSize.Button);
b2.Clicked += delegate {
try {
- string content = AutoSave.LoadAutoSave (fileName);
- AutoSave.RemoveAutoSaveFile (fileName);
+ var content = AutoSave.LoadAndRemoveAutoSave (fileName);
TextEditor.GrabFocus ();
view.Load (fileName);
- view.ReplaceContent (fileName, content, view.SourceEncoding);
+ view.ReplaceContent (fileName, content.Text, view.SourceEncoding);
view.WorkbenchWindow.Document.ReparseDocument ();
view.IsDirty = true;
} catch (Exception ex) {
@@ -1125,21 +1031,21 @@ namespace MonoDevelop.SourceEditor
}
if (!TextEditor.Visible)
TextEditor.Visible = true;
- if (messageOverlayWindow != null) {
- messageOverlayWindow.Destroy ();
- messageOverlayWindow = null;
+ if (incorrectEolMessage != null) {
+ RemoveOverlay (incorrectEolMessage);
+ incorrectEolMessage = null;
}
}
- public void Reload ()
+ public async void Reload ()
{
try {
- if (!System.IO.File.Exists (view.ContentName))
+ if (!System.IO.File.Exists (view.ContentName) || this.isDisposed)
return;
view.StoreSettings ();
reloadSettings = true;
- view.Load (view.ContentName, view.SourceEncoding, true);
+ await view.Load (view.ContentName, view.SourceEncoding, true);
view.WorkbenchWindow.ShowNotification = false;
} catch (Exception ex) {
MessageService.ShowError ("Could not reload the file.", ex);
@@ -1278,7 +1184,7 @@ namespace MonoDevelop.SourceEditor
SetReplacePatternToSelection ();
}
- void ShowSearchReplaceWidget (bool replace)
+ void ShowSearchReplaceWidget (bool replace, bool switchFocus = true)
{
if (searchAndReplaceWidget == null) {
KillWidgets ();
@@ -1289,7 +1195,7 @@ namespace MonoDevelop.SourceEditor
searchAndReplaceWidgetFrame.Child = searchAndReplaceWidget = new SearchAndReplaceWidget (TextEditor, searchAndReplaceWidgetFrame);
searchAndReplaceWidget.Destroyed += (sender, e) => RemoveSearchWidget ();
searchAndReplaceWidgetFrame.ShowAll ();
- this.TextEditor.AddAnimatedWidget (searchAndReplaceWidgetFrame, 300, Mono.TextEditor.Theatrics.Easing.ExponentialInOut, Blocking.Downstage, TextEditor.Allocation.Width - 400, -searchAndReplaceWidget.Allocation.Height);
+ this.TextEditor.AddAnimatedWidget (searchAndReplaceWidgetFrame, ANIMATION_DURATION, Mono.TextEditor.Theatrics.Easing.ExponentialInOut, Blocking.Downstage, TextEditor.Allocation.Width - 400, -searchAndReplaceWidget.Allocation.Height);
// this.PackEnd (searchAndReplaceWidget);
// this.SetChildPacking (searchAndReplaceWidget, false, false, CHILD_PADDING, PackType.End);
// searchAndReplaceWidget.ShowAll ();
@@ -1313,7 +1219,8 @@ namespace MonoDevelop.SourceEditor
this.FindNext ();
}
}
- searchAndReplaceWidget.Focus ();
+ if (switchFocus)
+ searchAndReplaceWidget.Focus ();
}
public void ShowGotoLineNumberWidget ()
@@ -1329,7 +1236,7 @@ namespace MonoDevelop.SourceEditor
gotoLineNumberWidgetFrame.Child = gotoLineNumberWidget = new GotoLineNumberWidget (textEditor, gotoLineNumberWidgetFrame);
gotoLineNumberWidget.Destroyed += (sender, e) => RemoveSearchWidget ();
gotoLineNumberWidgetFrame.ShowAll ();
- TextEditor.AddAnimatedWidget (gotoLineNumberWidgetFrame, 300, Mono.TextEditor.Theatrics.Easing.ExponentialInOut, Mono.TextEditor.Theatrics.Blocking.Downstage, this.TextEditor.Allocation.Width - 400, -gotoLineNumberWidget.Allocation.Height);
+ TextEditor.AddAnimatedWidget (gotoLineNumberWidgetFrame, ANIMATION_DURATION, Mono.TextEditor.Theatrics.Easing.ExponentialInOut, Mono.TextEditor.Theatrics.Blocking.Downstage, this.TextEditor.Allocation.Width - 400, -gotoLineNumberWidget.Allocation.Height);
ResetFocusChain ();
}
@@ -1345,6 +1252,8 @@ namespace MonoDevelop.SourceEditor
public SearchResult FindNext (bool focus)
{
+ if (searchAndReplaceWidget == null)
+ ShowSearchReplaceWidget (false, false);
return SearchAndReplaceWidget.FindNext (TextEditor);
}
@@ -1355,6 +1264,8 @@ namespace MonoDevelop.SourceEditor
public SearchResult FindPrevious (bool focus)
{
+ if (searchAndReplaceWidget == null)
+ ShowSearchReplaceWidget (false, false);
return SearchAndReplaceWidget.FindPrevious (TextEditor);
}
@@ -1420,20 +1331,8 @@ namespace MonoDevelop.SourceEditor
#region Help
internal void MonodocResolver ()
{
- DomRegion region;
+ MonoDevelop.Ide.Editor.DocumentRegion region;
var res = TextEditor.GetLanguageItem (TextEditor.Caret.Offset, out region);
- if (res is UnknownIdentifierResolveResult) {
- var uir = (UnknownIdentifierResolveResult)res;
- IdeApp.HelpOperations.SearchHelpFor (uir.Identifier);
- return;
- }
-
- if (res is UnknownMemberResolveResult) {
- var uir = (UnknownMemberResolveResult)res;
- IdeApp.HelpOperations.SearchHelpFor (uir.MemberName);
- return;
- }
-
string url = HelpService.GetMonoDocHelpUrl (res);
if (url != null)
IdeApp.HelpOperations.ShowHelp (url);
@@ -1441,140 +1340,16 @@ namespace MonoDevelop.SourceEditor
internal void MonodocResolverUpdate (CommandInfo cinfo)
{
- DomRegion region;
+ MonoDevelop.Ide.Editor.DocumentRegion region;
var res = TextEditor.GetLanguageItem (TextEditor.Caret.Offset, out region);
- if (res == null || !IdeApp.HelpOperations.CanShowHelp (res) && !(res is UnknownIdentifierResolveResult || res is UnknownMemberResolveResult))
+ if (HelpService.GetMonoDocHelpUrl (res) == null)
cinfo.Bypass = true;
}
#endregion
#region commenting and indentation
- internal void OnUpdateToggleComment (MonoDevelop.Components.Commands.CommandInfo info)
- {
- var mode = Document.SyntaxMode as SyntaxMode;
- if (mode == null) {
- info.Visible = false;
- return;
- }
- List<string> lineComments;
- if (mode.Properties.TryGetValue ("LineComment", out lineComments)) {
- info.Visible = lineComments.Count > 0;
- } else {
- List<string> blockStarts;
- List<string> blockEnds;
- if (mode.Properties.TryGetValue ("BlockCommentStart", out blockStarts) && mode.Properties.TryGetValue ("BlockCommentEnd", out blockEnds)) {
- info.Visible = blockStarts.Count > 0 && blockEnds.Count > 0;
- }
- }
- }
-
- void ToggleCodeCommentWithBlockComments ()
- {
- var mode = Document.SyntaxMode as SyntaxMode;
- if (mode == null)
- return;
-
- List<string> blockStarts;
- if (!mode.Properties.TryGetValue ("BlockCommentStart", out blockStarts) || blockStarts.Count == 0)
- return;
-
- List<string> blockEnds;
- if (!mode.Properties.TryGetValue ("BlockCommentEnd", out blockEnds) || blockEnds.Count == 0)
- return;
-
- string blockStart = blockStarts[0];
- string blockEnd = blockEnds[0];
-
- using (var undo = Document.OpenUndoGroup ()) {
- DocumentLine startLine;
- DocumentLine endLine;
- if (TextEditor.IsSomethingSelected) {
- startLine = Document.GetLineByOffset (textEditor.SelectionRange.Offset);
- endLine = Document.GetLineByOffset (textEditor.SelectionRange.EndOffset);
-
- // If selection ends at begining of line... This is visible as previous line
- // is selected, hence we want to select previous line Bug 26287
- if (endLine.Offset == textEditor.SelectionRange.EndOffset)
- endLine = endLine.PreviousLine;
- } else {
- startLine = endLine = Document.GetLine (textEditor.Caret.Line);
- }
- string startLineText = Document.GetTextAt (startLine.Offset, startLine.Length);
- string endLineText = Document.GetTextAt (endLine.Offset, endLine.Length);
- if (startLineText.StartsWith (blockStart) && endLineText.EndsWith (blockEnd, StringComparison.Ordinal)) {
- textEditor.Remove (endLine.Offset + endLine.Length - blockEnd.Length, blockEnd.Length);
- textEditor.Remove (startLine.Offset, blockStart.Length);
- if (TextEditor.IsSomethingSelected) {
- TextEditor.SelectionAnchor -= blockEnd.Length;
- }
- } else {
- textEditor.Insert (endLine.Offset + endLine.Length, blockEnd);
- textEditor.Insert (startLine.Offset, blockStart);
- if (TextEditor.IsSomethingSelected) {
- TextEditor.SelectionAnchor += blockEnd.Length;
- }
-
- }
- }
- }
-
- bool TryGetLineCommentTag (out string commentTag)
- {
- var mode = Document.SyntaxMode as SyntaxMode;
- List<string> lineComments;
- if (mode == null || !mode.Properties.TryGetValue ("LineComment", out lineComments) || lineComments.Count == 0) {
- commentTag = null;
- return false;
- }
- commentTag = lineComments [0];
- return true;
- }
-
- public void ToggleCodeComment ()
- {
- string commentTag;
- if (!TryGetLineCommentTag (out commentTag)) {
- ToggleCodeCommentWithBlockComments ();
- return;
- }
-
- bool comment = false;
- foreach (var line in textEditor.SelectedLines) {
- if (line.GetIndentation (TextEditor.Document).Length == line.Length)
- continue;
- string text = Document.GetTextAt (line);
- string trimmedText = text.TrimStart ();
- if (!trimmedText.StartsWith (commentTag, StringComparison.Ordinal)) {
- comment = true;
- break;
- }
- }
-
- if (comment) {
- CommentSelectedLines (commentTag);
- } else {
- UncommentSelectedLines (commentTag);
- }
- }
-
- public void AddCodeComment ()
- {
- string commentTag;
- if (!TryGetLineCommentTag (out commentTag))
- return;
- CommentSelectedLines (commentTag);
- }
-
- public void RemoveCodeComment ()
- {
- string commentTag;
- if (!TryGetLineCommentTag (out commentTag))
- return;
- UncommentSelectedLines (commentTag);
- }
-
public void OnUpdateToggleErrorTextMarker (CommandInfo info)
{
DocumentLine line = TextEditor.Document.GetLine (TextEditor.Caret.Line);
@@ -1597,117 +1372,7 @@ namespace MonoDevelop.SourceEditor
TextEditor.QueueDraw ();
}
}
-
- void CommentSelectedLines (string commentTag)
- {
- int startLineNr = TextEditor.IsSomethingSelected ? Document.OffsetToLineNumber (TextEditor.SelectionRange.Offset) : TextEditor.Caret.Line;
- int endLineNr = TextEditor.IsSomethingSelected ? Document.OffsetToLineNumber (TextEditor.SelectionRange.EndOffset) : TextEditor.Caret.Line;
- if (endLineNr < 0)
- endLineNr = Document.LineCount;
-
- DocumentLine anchorLine = TextEditor.IsSomethingSelected ? TextEditor.Document.GetLineByOffset (TextEditor.SelectionAnchor) : null;
- int anchorColumn = TextEditor.IsSomethingSelected ? TextEditor.SelectionAnchor - anchorLine.Offset : -1;
-
- using (var undo = Document.OpenUndoGroup ()) {
- foreach (DocumentLine line in TextEditor.SelectedLines) {
-// if (line.GetIndentation (TextEditor.Document).Length == line.EditableLength)
-// continue;
- TextEditor.Insert (line.Offset, commentTag);
- }
- if (TextEditor.IsSomethingSelected) {
- if (TextEditor.SelectionAnchor < TextEditor.Caret.Offset) {
- if (anchorColumn != 0)
- TextEditor.SelectionAnchor = System.Math.Min (anchorLine.Offset + anchorLine.Length, System.Math.Max (anchorLine.Offset, TextEditor.SelectionAnchor + commentTag.Length));
- } else {
- if (anchorColumn != 0) {
- TextEditor.SelectionAnchor = System.Math.Min (anchorLine.Offset + anchorLine.Length, System.Math.Max (anchorLine.Offset, anchorLine.Offset + anchorColumn + commentTag.Length));
- } else {
- // TextEditor.SelectionAnchor = anchorLine.Offset;
- }
- }
- }
-
- if (TextEditor.IsSomethingSelected)
- TextEditor.ExtendSelectionTo (TextEditor.Caret.Offset);
- }
- Document.CommitMultipleLineUpdate (startLineNr, endLineNr);
- }
-
- void UncommentSelectedLines (string commentTag)
- {
- int startLineNr = TextEditor.IsSomethingSelected ? Document.OffsetToLineNumber (TextEditor.SelectionRange.Offset) : TextEditor.Caret.Line;
- int endLineNr = TextEditor.IsSomethingSelected ? Document.OffsetToLineNumber (TextEditor.SelectionRange.EndOffset) : TextEditor.Caret.Line;
- if (endLineNr < 0)
- endLineNr = Document.LineCount;
- DocumentLine anchorLine = TextEditor.IsSomethingSelected ? TextEditor.Document.GetLineByOffset (TextEditor.SelectionAnchor) : null;
- int anchorColumn = TextEditor.IsSomethingSelected ? TextEditor.SelectionAnchor - anchorLine.Offset : -1;
-
- using (var undo = Document.OpenUndoGroup ()) {
- int first = -1;
- int last = 0;
- foreach (DocumentLine line in TextEditor.SelectedLines) {
- string text = Document.GetTextAt (line);
- string trimmedText = text.TrimStart ();
- int length = 0;
- if (trimmedText.StartsWith (commentTag)) {
- TextEditor.Remove (line.Offset + (text.Length - trimmedText.Length), commentTag.Length);
- length = commentTag.Length;
- }
- last = length;
- if (first < 0)
- first = last;
- }
-
- if (TextEditor.IsSomethingSelected) {
- if (TextEditor.SelectionAnchor < TextEditor.Caret.Offset) {
- TextEditor.SelectionAnchor = System.Math.Min (anchorLine.Offset + anchorLine.Length, System.Math.Max (anchorLine.Offset, TextEditor.SelectionAnchor - first));
- } else {
- TextEditor.SelectionAnchor = System.Math.Min (anchorLine.Offset + anchorLine.Length, System.Math.Max (anchorLine.Offset, anchorLine.Offset + anchorColumn - last));
- }
- }
-
- if (TextEditor.IsSomethingSelected)
- TextEditor.ExtendSelectionTo (TextEditor.Caret.Offset);
- }
- Document.CommitMultipleLineUpdate (startLineNr, endLineNr);
- }
-
- #endregion
-
- #region IQuickTaskProvider implementation
- List<QuickTask> tasks = new List<QuickTask> ();
-
- public event EventHandler TasksUpdated;
-
- protected virtual void OnTasksUpdated (EventArgs e)
- {
- EventHandler handler = this.TasksUpdated;
- if (handler != null)
- handler (this, e);
- }
-
- public IEnumerable<QuickTask> QuickTasks {
- get {
- return tasks;
- }
- }
-
- void UpdateQuickTasks (ParsedDocument doc)
- {
- tasks.Clear ();
- if (doc != null) {
- foreach (var cmt in doc.TagComments) {
- var newTask = new QuickTask (cmt.Text, cmt.Region.Begin, Severity.Hint);
- tasks.Add (newTask);
- }
-
- foreach (var error in doc.Errors) {
- var newTask = new QuickTask (error.Message, error.Region.Begin, error.ErrorType == ErrorType.Error ? Severity.Error : Severity.Warning);
- tasks.Add (newTask);
- }
- }
- OnTasksUpdated (EventArgs.Empty);
- }
+
#endregion
internal void NextIssue ()
@@ -1739,56 +1404,12 @@ namespace MonoDevelop.SourceEditor
}
- }
-
- class ErrorMarker : UnderlineMarker
- {
- public Error Info { get; private set; }
-
- public ErrorMarker (TextDocument doc, Error info, DocumentLine line)
- {
- Info = info;
- LineSegment = line;
- // may be null if no line is assigned to the error.
- Wave = true;
-
- StartCol = Info.Region.BeginColumn;
- if (line != null) {
- var startOffset = line.Offset;
- if (startOffset + StartCol - 1 >= 0) {
- while (StartCol < line.Length) {
- char ch = doc.GetCharAt (startOffset + StartCol - 1);
- if (!char.IsWhiteSpace (ch))
- break;
- StartCol++;
- }
- }
- }
-
- if (Info.Region.EndColumn > StartCol) {
- EndCol = Info.Region.EndColumn;
- } else {
- if (line == null) {
- EndCol = StartCol + 1;
- return;
- }
- var start = line.Offset + StartCol - 1;
- int o = start + 1;
- while (o < line.EndOffset) {
- char ch = doc.GetCharAt (o);
- if (!(char.IsLetterOrDigit (ch) || ch == '_'))
- break;
- o++;
- }
- EndCol = Info.Region.BeginColumn + o - start + 1;
- }
- }
-
- public override void Draw (TextEditor editor, Cairo.Context cr, double y, LineMetrics metrics)
+ #region IServiceProvider implementation
+ object IServiceProvider.GetService (Type serviceType)
{
- Color = Info.ErrorType == ErrorType.Warning ? editor.ColorStyle.UnderlineWarning.Color : editor.ColorStyle.UnderlineError.Color;
-
- base.Draw (editor, cr, y, metrics);
+ return view.GetContent (serviceType);
}
+ #endregion
}
+
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs
index 01d4f54f65..a4a333c89f 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/StyledSourceEditorOptions.cs
@@ -25,350 +25,308 @@
// THE SOFTWARE.
using System;
-using System.Collections.Generic;
-using MonoDevelop.Projects;
-using MonoDevelop.Projects.Policies;
-using MonoDevelop.Ide.Gui.Content;
-using MonoDevelop.Ide;
using Mono.TextEditor;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.SourceEditor
{
-
- internal class StyledSourceEditorOptions : ISourceEditorOptions
+ class StyledSourceEditorOptions : TextEditorOptions
{
- PolicyContainer policyContainer;
- EventHandler changed;
- IEnumerable<string> mimeTypes;
- TextStylePolicy currentPolicy;
- string lastMimeType;
+ MonoDevelop.Ide.Editor.ITextEditorOptions optionsCore;
- public StyledSourceEditorOptions (Project styleParent, string mimeType)
- {
- UpdateStyleParent (styleParent, mimeType);
+ public MonoDevelop.Ide.Editor.ITextEditorOptions OptionsCore {
+ get {
+ return optionsCore;
+ }
+ set {
+ optionsCore = value;
+ OnChanged (EventArgs.Empty);
+ }
}
-
- TextStylePolicy CurrentPolicy {
- get { return currentPolicy; }
+
+ public StyledSourceEditorOptions (MonoDevelop.Ide.Editor.ITextEditorOptions optionsCore)
+ {
+ if (optionsCore == null)
+ throw new ArgumentNullException ("optionsCore");
+ this.optionsCore = optionsCore;
+ DefaultSourceEditorOptions.Instance.Changed += HandleChanged;
}
-
- public void UpdateStyleParent (Project styleParent, string mimeType)
+ public override void Dispose ()
{
- if (styleParent != null && policyContainer == styleParent.Policies && mimeType == lastMimeType)
- return;
- lastMimeType = mimeType;
-
- if (policyContainer != null)
- policyContainer.PolicyChanged -= HandlePolicyChanged;
-
- if (string.IsNullOrEmpty (mimeType))
- mimeType = "text/plain";
- this.mimeTypes = DesktopService.GetMimeTypeInheritanceChain (mimeType);
-
- if (styleParent != null)
- policyContainer = styleParent.Policies;
- else
- policyContainer = MonoDevelop.Projects.Policies.PolicyService.DefaultPolicies;
- currentPolicy = policyContainer.Get<TextStylePolicy> (mimeTypes);
-
- policyContainer.PolicyChanged += HandlePolicyChanged;
- if (changed != null)
- this.changed (this, EventArgs.Empty);
+ DefaultSourceEditorOptions.Instance.Changed -= HandleChanged;
+
+ base.Dispose ();
}
- void HandlePolicyChanged (object sender, MonoDevelop.Projects.Policies.PolicyChangedEventArgs args)
+ void HandleChanged (object sender, EventArgs e)
{
- currentPolicy = policyContainer.Get<TextStylePolicy> (mimeTypes);
- if (changed != null)
- this.changed (this, EventArgs.Empty);
+ DisposeFont ();
+ OnChanged (EventArgs.Empty);
}
- public bool OverrideDocumentEolMarker {
- get { return DefaultSourceEditorOptions.Instance.OverrideDocumentEolMarker; }
+ #region ITextEditorOptions implementation
+ static IWordFindStrategy monoDevelopWordFindStrategy = new EmacsWordFindStrategy (false);
+ static IWordFindStrategy emacsWordFindStrategy = new EmacsWordFindStrategy (true);
+ static IWordFindStrategy sharpDevelopWordFindStrategy = new SharpDevelopWordFindStrategy ();
+
+ public override IWordFindStrategy WordFindStrategy {
+ get {
+ switch (DefaultSourceEditorOptions.Instance.WordFindStrategy) {
+ case MonoDevelop.Ide.Editor.WordFindStrategy.MonoDevelop:
+ return monoDevelopWordFindStrategy;
+ case MonoDevelop.Ide.Editor.WordFindStrategy.Emacs:
+ return emacsWordFindStrategy;
+ case MonoDevelop.Ide.Editor.WordFindStrategy.SharpDevelop:
+ return sharpDevelopWordFindStrategy;
+ default:
+ throw new ArgumentOutOfRangeException ();
+ }
+ }
set {
- throw new NotSupportedException ();
+ throw new NotImplementedException ();
}
}
-
- public string DefaultEolMarker {
- get { return TextStylePolicy.GetEolMarker (CurrentPolicy.EolMarker); }
+
+ public override bool AllowTabsAfterNonTabs {
+ get {
+ return DefaultSourceEditorOptions.Instance.AllowTabsAfterNonTabs;
+ }
set {
throw new NotSupportedException ();
}
}
- public int RulerColumn {
- get { return CurrentPolicy.FileWidth; }
+ public override bool HighlightMatchingBracket {
+ get {
+ return DefaultSourceEditorOptions.Instance.HighlightMatchingBracket;
+ }
set {
throw new NotSupportedException ();
}
}
- public int TabSize {
- get { return CurrentPolicy.TabWidth; }
+ public override bool TabsToSpaces {
+ get {
+ return optionsCore.TabsToSpaces;
+ }
set {
throw new NotSupportedException ();
}
}
- public bool TabsToSpaces {
- get { return CurrentPolicy.TabsToSpaces; }
+ public override int IndentationSize {
+ get {
+ return optionsCore.IndentationSize;
+ }
set {
throw new NotSupportedException ();
}
}
- public bool RemoveTrailingWhitespaces {
- get { return CurrentPolicy.RemoveTrailingWhitespace; }
+ public override int TabSize {
+ get {
+ return optionsCore.TabSize;
+ }
set {
throw new NotSupportedException ();
}
}
- public bool AllowTabsAfterNonTabs {
- get { return !CurrentPolicy.NoTabsAfterNonTabs; }
+
+ public override bool ShowIconMargin {
+ get {
+ return optionsCore.ShowIconMargin;
+ }
set {
throw new NotSupportedException ();
}
}
- public int IndentationSize {
- get { return CurrentPolicy.IndentWidth; }
+ public override bool ShowLineNumberMargin {
+ get {
+ return optionsCore.ShowLineNumberMargin;
+ }
set {
throw new NotSupportedException ();
}
}
- public string IndentationString {
- get { return this.TabsToSpaces ? new string (' ', this.TabSize) : "\t"; }
- }
-
- #region ITextEditorOptions implementation
-
- public bool CanResetZoom {
- get { return DefaultSourceEditorOptions.Instance.CanResetZoom; }
- }
-
- public bool CanZoomIn {
- get { return DefaultSourceEditorOptions.Instance.CanZoomIn; }
- }
-
- public bool CanZoomOut {
- get { return DefaultSourceEditorOptions.Instance.CanZoomOut; }
- }
-
- public event EventHandler Changed {
- add {
- if (changed == null)
- DefaultSourceEditorOptions.Instance.Changed += HandleDefaultsChanged;
- changed += value;
+ public override bool ShowFoldMargin {
+ get {
+ return optionsCore.ShowFoldMargin;
}
- remove {
- changed -= value;
- if (changed == null)
- DefaultSourceEditorOptions.Instance.Changed -= HandleDefaultsChanged;
+ set {
+ throw new NotSupportedException ();
}
}
- void HandleDefaultsChanged (object sender, EventArgs e)
- {
- if (changed != null)
- changed (this, EventArgs.Empty);
- }
-
- public string ColorScheme {
- get { return DefaultSourceEditorOptions.Instance.ColorScheme; }
- set { throw new NotSupportedException (); }
- }
-
- public bool EnableSyntaxHighlighting {
- get { return DefaultSourceEditorOptions.Instance.EnableSyntaxHighlighting; }
- set { throw new NotSupportedException (); }
- }
-
- public Pango.FontDescription Font {
- get { return DefaultSourceEditorOptions.Instance.Font; }
- }
-
- public string FontName {
- get { return DefaultSourceEditorOptions.Instance.FontName; }
- set { throw new NotSupportedException (); }
- }
-
- public Pango.FontDescription GutterFont {
- get { return DefaultSourceEditorOptions.Instance.GutterFont; }
- }
-
- public string GutterFontName {
- get { return DefaultSourceEditorOptions.Instance.GutterFontName; }
- set { throw new NotSupportedException (); }
- }
-
- public Mono.TextEditor.Highlighting.ColorScheme GetColorStyle ()
- {
- return DefaultSourceEditorOptions.Instance.GetColorStyle ();
- }
-
- public bool HighlightCaretLine {
- get { return DefaultSourceEditorOptions.Instance.HighlightCaretLine; }
- set { throw new NotSupportedException (); }
- }
-
- public bool HighlightMatchingBracket {
- get { return DefaultSourceEditorOptions.Instance.HighlightMatchingBracket; }
- set { throw new NotSupportedException (); }
- }
-
- public bool ShowFoldMargin {
- get { return DefaultSourceEditorOptions.Instance.ShowFoldMargin; }
- set { throw new NotSupportedException (); }
- }
-
- public bool ShowIconMargin {
- get { return DefaultSourceEditorOptions.Instance.ShowIconMargin; }
- set { throw new NotSupportedException (); }
- }
-
- public bool ShowLineNumberMargin {
- get { return DefaultSourceEditorOptions.Instance.ShowLineNumberMargin; }
- set { throw new NotSupportedException (); }
- }
-
- public bool ShowRuler {
- get { return DefaultSourceEditorOptions.Instance.ShowRuler; }
- set { throw new NotSupportedException (); }
- }
-
- public bool EnableAnimations {
- get { return DefaultSourceEditorOptions.Instance.EnableAnimations; }
- set { throw new NotSupportedException (); }
- }
-
- public Mono.TextEditor.IWordFindStrategy WordFindStrategy {
- get { return DefaultSourceEditorOptions.Instance.WordFindStrategy; }
- set { throw new NotSupportedException (); }
- }
-
- public double Zoom {
- get { return DefaultSourceEditorOptions.Instance.Zoom; }
- set { DefaultSourceEditorOptions.Instance.Zoom = value; }
- }
-
- public bool DrawIndentationMarkers {
- get { return DefaultSourceEditorOptions.Instance.DrawIndentationMarkers; }
- set { DefaultSourceEditorOptions.Instance.DrawIndentationMarkers = value; }
- }
-
- public ShowWhitespaces ShowWhitespaces {
- get { return DefaultSourceEditorOptions.Instance.ShowWhitespaces; }
- set { DefaultSourceEditorOptions.Instance.ShowWhitespaces = value; }
- }
-
- public IncludeWhitespaces IncludeWhitespaces {
- get { return DefaultSourceEditorOptions.Instance.IncludeWhitespaces; }
- set { DefaultSourceEditorOptions.Instance.IncludeWhitespaces = value; }
+ public override bool HighlightCaretLine {
+ get {
+ return optionsCore.HighlightCaretLine;
+ }
+ set {
+ throw new NotSupportedException ();
+ }
}
- public bool WrapLines {
- get { return DefaultSourceEditorOptions.Instance.WrapLines; }
- set { DefaultSourceEditorOptions.Instance.WrapLines = value; }
+ public override int RulerColumn {
+ get {
+ return optionsCore.RulerColumn;
+ }
+ set {
+ throw new NotSupportedException ();
+ }
}
- public bool EnableQuickDiff {
- get { return DefaultSourceEditorOptions.Instance.EnableQuickDiff; }
- set { DefaultSourceEditorOptions.Instance.EnableQuickDiff = value; }
+ public override bool ShowRuler {
+ get {
+ return optionsCore.ShowRuler;
+ }
+ set {
+ throw new NotSupportedException ();
+ }
}
- public bool GenerateFormattingUndoStep {
- get { return DefaultSourceEditorOptions.Instance.GenerateFormattingUndoStep; }
- set { DefaultSourceEditorOptions.Instance.GenerateFormattingUndoStep = value; }
+ public override Mono.TextEditor.IndentStyle IndentStyle {
+ get {
+ if (optionsCore.IndentStyle == MonoDevelop.Ide.Editor.IndentStyle.Smart && optionsCore.RemoveTrailingWhitespaces)
+ return Mono.TextEditor.IndentStyle.Virtual;
+ return (Mono.TextEditor.IndentStyle)optionsCore.IndentStyle;
+ }
+ set {
+ throw new NotSupportedException ();
+ }
}
- public void ZoomIn ()
- {
- DefaultSourceEditorOptions.Instance.ZoomIn ();
+ public override bool OverrideDocumentEolMarker {
+ get {
+ return optionsCore.OverrideDocumentEolMarker;
+ }
+ set {
+ throw new NotSupportedException ();
+ }
}
- public void ZoomOut ()
- {
- DefaultSourceEditorOptions.Instance.ZoomOut ();
+ public override bool EnableSyntaxHighlighting {
+ get {
+ return optionsCore.EnableSyntaxHighlighting;
+ }
+ set {
+ throw new NotSupportedException ();
+ }
}
- public void ZoomReset ()
- {
- DefaultSourceEditorOptions.Instance.ZoomReset ();
+ public override bool EnableAnimations {
+ get {
+ return DefaultSourceEditorOptions.Instance.HighlightMatchingBracket;
+ }
+ set {
+ throw new NotSupportedException ();
+ }
}
- #endregion
-
-
- #region ISourceEditorOptions implementation
-
- public bool AutoInsertMatchingBracket {
- get { return DefaultSourceEditorOptions.Instance.AutoInsertMatchingBracket; }
+ public override bool EnableQuickDiff {
+ get {
+ return DefaultSourceEditorOptions.Instance.EnableQuickDiff;
+ }
+ set {
+ throw new NotSupportedException ();
+ }
}
- public bool DefaultCommentFolding {
- get { return DefaultSourceEditorOptions.Instance.DefaultCommentFolding; }
+ public override bool DrawIndentationMarkers {
+ get {
+ return DefaultSourceEditorOptions.Instance.DrawIndentationMarkers;
+ }
+ set {
+ throw new NotSupportedException ();
+ }
}
- public bool DefaultRegionsFolding {
- get { return DefaultSourceEditorOptions.Instance.DefaultRegionsFolding; }
+ public override bool WrapLines {
+ get {
+ return optionsCore.WrapLines;
+ }
+ set {
+ throw new NotSupportedException ();
+ }
}
- public EditorFontType EditorFontType {
- get { return DefaultSourceEditorOptions.Instance.EditorFontType; }
+ public override string FontName {
+ get {
+ return optionsCore.FontName;
+ }
+ set {
+ throw new NotSupportedException ();
+ }
}
- public bool EnableAutoCodeCompletion {
- get { return DefaultSourceEditorOptions.Instance.EnableAutoCodeCompletion; }
+ public override string GutterFontName {
+ get {
+ return optionsCore.GutterFontName;
+ }
+ set {
+ throw new NotSupportedException ();
+ }
}
- public bool EnableSemanticHighlighting {
- get { return DefaultSourceEditorOptions.Instance.EnableSemanticHighlighting; }
+ public override string ColorScheme {
+ get {
+ return optionsCore.ColorScheme;
+ }
+ set {
+ throw new NotSupportedException ();
+ }
}
- public IndentStyle IndentStyle {
+ public override string DefaultEolMarker {
get {
- if ((DefaultSourceEditorOptions.Instance.IndentStyle == Mono.TextEditor.IndentStyle.Smart ||
- DefaultSourceEditorOptions.Instance.IndentStyle == Mono.TextEditor.IndentStyle.Auto) && CurrentPolicy.RemoveTrailingWhitespace)
- return IndentStyle.Virtual;
- return DefaultSourceEditorOptions.Instance.IndentStyle;
+ return optionsCore.DefaultEolMarker;
}
set {
- throw new NotSupportedException ("Use property 'IndentStyle' instead.");
+ throw new NotSupportedException ();
}
}
- public bool TabIsReindent {
- get { return DefaultSourceEditorOptions.Instance.TabIsReindent; }
+ public override Mono.TextEditor.ShowWhitespaces ShowWhitespaces {
+ get {
+ return (Mono.TextEditor.ShowWhitespaces)optionsCore.ShowWhitespaces;
+ }
+ set {
+ throw new NotSupportedException ();
+ }
}
- public bool UnderlineErrors {
- get { return DefaultSourceEditorOptions.Instance.UnderlineErrors; }
+ public override Mono.TextEditor.IncludeWhitespaces IncludeWhitespaces {
+ get {
+ return (Mono.TextEditor.IncludeWhitespaces)optionsCore.IncludeWhitespaces;
+ }
+ set {
+ throw new NotSupportedException ();
+ }
}
- public bool UseViModes {
- get { return DefaultSourceEditorOptions.Instance.UseViModes; }
+ public override bool GenerateFormattingUndoStep {
+ get {
+ return optionsCore.GenerateFormattingUndoStep;
+ }
+ set {
+ throw new NotSupportedException ();
+ }
}
- public bool EnableSelectionWrappingKeys {
- get { return DefaultSourceEditorOptions.Instance.AutoInsertMatchingBracket; }
+ public override bool EnableSelectionWrappingKeys {
+ get {
+ return optionsCore.EnableSelectionWrappingKeys;
+ }
+ set {
+ throw new NotSupportedException ();
+ }
}
-
#endregion
- public void Dispose ()
- {
- mimeTypes = null;
- if (policyContainer != null)
- policyContainer.PolicyChanged -= HandlePolicyChanged;
- if (changed != null) {
- DefaultSourceEditorOptions.Instance.Changed -= HandleDefaultsChanged;
- changed = null;
- }
- }
+
}
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SyntaxModeCodon.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SyntaxModeCodon.cs
deleted file mode 100644
index f7339614c3..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SyntaxModeCodon.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// SyntaxModeCodon.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using Mono.TextEditor.Highlighting;
-using Mono.Addins;
-
-
-namespace MonoDevelop.SourceEditor
-{
- [ExtensionNode (Description="A syntax mode. The specified class must be a valid syntax mode.")]
- class SyntaxModeCodon : TypeExtensionNode
- {
- [NodeAttribute ("mimeTypes", true, "Mime types of the syntax mode.")]
- string mimeTypes = null;
-
- public SyntaxMode SyntaxMode {
- get {
- return CreateInstance () as SyntaxMode;
- }
- }
-
- public string MimeTypes {
- get {
- return mimeTypes;
- }
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SyntaxModeLoader.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SyntaxModeLoader.cs
new file mode 100644
index 0000000000..2f2e1c8f73
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SyntaxModeLoader.cs
@@ -0,0 +1,68 @@
+//
+// SyntaxModeLoader.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.IO;
+using Mono.Addins;
+using MonoDevelop.Ide.Editor.Highlighting;
+
+namespace MonoDevelop.SourceEditor
+{
+ static class SyntaxModeLoader
+ {
+ static bool initialized = false;
+
+ public static void Init ()
+ {
+ if (initialized)
+ return;
+ initialized = true;
+ AddinManager.AddExtensionNodeHandler ("/MonoDevelop/SourceEditor2/SyntaxModes", OnSyntaxModeExtensionChanged);
+ }
+
+ static void OnSyntaxModeExtensionChanged (object s, ExtensionNodeEventArgs args)
+ {
+ TemplateCodon codon = (TemplateCodon)args.ExtensionNode;
+ if (args.Change == ExtensionChange.Add) {
+ Mono.TextEditor.Highlighting.SyntaxModeService.AddSyntaxMode (new StreamProviderWrapper(codon));
+ }
+ }
+
+ class StreamProviderWrapper : Mono.TextEditor.Highlighting.IStreamProvider
+ {
+ readonly TemplateCodon codon;
+
+ public StreamProviderWrapper (TemplateCodon codon)
+ {
+ this.codon = codon;
+ }
+
+ Stream Mono.TextEditor.Highlighting.IStreamProvider.Open ()
+ {
+ return codon.Open ();
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SyntaxModeService.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SyntaxModeService.cs
deleted file mode 100644
index 1f57d22a7e..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SyntaxModeService.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// SyntaxModeService.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using Mono.TextEditor.Highlighting;
-using Mono.Addins;
-
-
-namespace MonoDevelop.SourceEditor
-{
- public static class SyntaxModeService
- {
- static SyntaxModeService ()
- {
-// Console.WriteLine ("SETUP SMS");
- AddinManager.AddExtensionNodeHandler ("/MonoDevelop/SourceEditor2/CustomModes", delegate(object sender, ExtensionNodeEventArgs args) {
- SyntaxModeCodon syntaxModeCodon = (SyntaxModeCodon)args.ExtensionNode;
- switch (args.Change) {
- case ExtensionChange.Add:
-// Console.WriteLine ("INstall:" + syntaxModeCodon.MimeTypes);
- Mono.TextEditor.Highlighting.SyntaxModeService.InstallSyntaxMode (syntaxModeCodon.MimeTypes, new SyntaxModeProvider (d => {
- var result = syntaxModeCodon.SyntaxMode;
- result.Document = d;
- return result;
- }));
- break;
- }
- });
- }
-
- public static void EnsureLoad ()
- {
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/AsmLineMarker.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/AsmLineMarker.cs
new file mode 100644
index 0000000000..cd743619e6
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/AsmLineMarker.cs
@@ -0,0 +1,48 @@
+//
+// AsmLineMarker.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using Mono.TextEditor;
+using MonoDevelop.SourceEditor.Wrappers;
+using Mono.TextEditor.Highlighting;
+
+namespace MonoDevelop.SourceEditor
+{
+ class AsmLineMarker: TextLineMarker, MonoDevelop.Ide.Editor.ITextLineMarker
+ {
+ public override ChunkStyle GetStyle (ChunkStyle baseStyle)
+ {
+ var st = new ChunkStyle (baseStyle);
+ st.Foreground = new Cairo.Color (125, 125, 125);
+ return st;
+ }
+
+ MonoDevelop.Ide.Editor.IDocumentLine MonoDevelop.Ide.Editor.ITextLineMarker.Line {
+ get {
+ return new DocumentLineWrapper (LineSegment);
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/DebugTextMarker.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/DebugTextMarker.cs
new file mode 100644
index 0000000000..5fdd3251bc
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/DebugTextMarker.cs
@@ -0,0 +1,273 @@
+// DebugTextMarker.cs
+//
+// Authors: Lluis Sanchez Gual <lluis@novell.com>
+// Jeffrey Stedfast <jeff@xamarin.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+using System;
+using System.Linq;
+using Mono.TextEditor;
+using Mono.TextEditor.Highlighting;
+using MonoDevelop.SourceEditor.Wrappers;
+using MonoDevelop.Components;
+using MonoDevelop.Debugger;
+using MonoDevelop.Ide.Editor;
+using Xwt.Drawing;
+using System.Collections.Generic;
+
+namespace MonoDevelop.SourceEditor
+{
+ class DebugIconMarker : MarginMarker
+ {
+ Image DebugIcon { get; }
+
+ public DebugIconMarker (Image debugIcon)
+ {
+ DebugIcon = debugIcon;
+ }
+
+ public override bool CanDrawForeground (Margin margin)
+ {
+ return margin is IconMargin;
+ }
+
+ public override void DrawForeground (MonoTextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
+ {
+ double size = metrics.Margin.Width;
+ double borderLineWidth = cr.LineWidth;
+
+ double x = Math.Floor (metrics.Margin.XOffset - borderLineWidth / 2);
+ double y = Math.Floor (metrics.Y + (metrics.Height - size) / 2);
+
+ var deltaX = size / 2 - DebugIcon.Width / 2 + 0.5f;
+ var deltaY = size / 2 - DebugIcon.Height / 2 + 0.5f;
+
+ cr.DrawImage (editor, DebugIcon, Math.Round (x + deltaX), Math.Round (y + deltaY));
+ }
+ }
+
+ class DebugTextMarker : TextSegmentMarker, IChunkMarker
+ {
+ readonly Func<MonoTextEditor, AmbientColor> background;
+ readonly Func<MonoTextEditor, ChunkStyle> forground;
+ MonoTextEditor editor;
+
+ public DebugTextMarker (int offset, int length, Func<MonoTextEditor, AmbientColor> background, Func<MonoTextEditor, ChunkStyle> forground = null)
+ : base (offset, length)
+ {
+ this.forground = forground;
+ this.background = background;
+ }
+
+ public override void DrawBackground (MonoTextEditor editor, Cairo.Context cr, LineMetrics metrics, int startOffset, int endOffset)
+ {
+ this.editor = editor;
+ int markerStart = base.Offset;
+ int markerEnd = base.EndOffset;
+
+ if (markerEnd < startOffset || markerStart > endOffset)
+ return;
+
+ double @from;
+ double to;
+ var startXPos = metrics.TextRenderStartPosition;
+ var endXPos = metrics.TextRenderEndPosition;
+ var y = metrics.LineYRenderStartPosition;
+ if (markerStart < startOffset && endOffset < markerEnd) {
+ @from = startXPos;
+ to = endXPos;
+ } else {
+ int start = startOffset < markerStart ? markerStart : startOffset;
+ int end = endOffset < markerEnd ? endOffset : markerEnd;
+
+ uint curIndex = 0, byteIndex = 0;
+ TextViewMargin.TranslateToUTF8Index (metrics.Layout.LineChars, (uint)(start - startOffset), ref curIndex, ref byteIndex);
+
+ int x_pos = metrics.Layout.Layout.IndexToPos ((int)byteIndex).X;
+
+ @from = startXPos + (int)(x_pos / Pango.Scale.PangoScale);
+
+ TextViewMargin.TranslateToUTF8Index (metrics.Layout.LineChars, (uint)(end - startOffset), ref curIndex, ref byteIndex);
+ x_pos = metrics.Layout.Layout.IndexToPos ((int)byteIndex).X;
+
+ to = startXPos + (int)(x_pos / Pango.Scale.PangoScale);
+ }
+
+ @from = Math.Max (@from, editor.TextViewMargin.XOffset);
+ to = Math.Max (to, editor.TextViewMargin.XOffset);
+ if (@from < to) {
+ cr.SetSourceColor (background(editor).Color);
+ cr.RoundedRectangle (@from + 2.5, y + 0.5, to - @from, editor.LineHeight - 1, 2); // 2.5 to make space for the column guideline
+
+ if (background(editor).HasBorderColor) {
+ cr.FillPreserve ();
+
+ cr.SetSourceColor (background(editor).BorderColor);
+ cr.Stroke ();
+ } else {
+ cr.Fill ();
+ }
+ }
+ }
+
+ public override ChunkStyle GetStyle (ChunkStyle baseStyle)
+ {
+ if (baseStyle == null)
+ return null;
+
+ var style = new ChunkStyle (baseStyle);
+ if (forground != null && editor != null) {
+ style.Foreground = forground(editor).Foreground;
+ }
+ return style;
+ }
+
+ #region IChunkMarker implementation
+
+ void IChunkMarker.TransformChunks (List<Chunk> chunks)
+ {
+ if (forground == null) {
+ return;
+ }
+ int markerStart = Segment.Offset;
+ int markerEnd = Segment.EndOffset;
+ for (int i = 0; i < chunks.Count; i++) {
+ var chunk = chunks [i];
+ if (chunk.EndOffset < markerStart || markerEnd <= chunk.Offset)
+ continue;
+ if (chunk.Offset == markerStart && chunk.EndOffset == markerEnd)
+ return;
+ if (chunk.Offset < markerStart && chunk.EndOffset > markerEnd) {
+ var newChunk = new Chunk (chunk.Offset, markerStart - chunk.Offset, chunk.Style);
+ chunks.Insert (i, newChunk);
+ chunk.Offset += newChunk.Length;
+ chunk.Length -= newChunk.Length;
+ continue;
+ }
+ }
+ }
+
+ void IChunkMarker.ChangeForeColor (MonoTextEditor editor, Chunk chunk, ref Cairo.Color color)
+ {
+ if (forground == null || editor == null) {
+ return;
+ }
+ int markerStart = Segment.Offset;
+ int markerEnd = Segment.EndOffset;
+ if (chunk.EndOffset <= markerStart || markerEnd <= chunk.Offset)
+ return;
+ color = forground(editor).Foreground;
+ }
+
+ #endregion
+ }
+
+ abstract class DebugMarkerPair
+ {
+ public DebugIconMarker IconMarker { get; protected set; }
+ public DebugTextMarker TextMarker { get; protected set; }
+ private TextDocument document;
+
+ internal void AddTo (TextDocument document, DocumentLine line)
+ {
+ this.document = document;
+ document.AddMarker (line, IconMarker);
+ document.AddMarker (TextMarker);
+ }
+
+ internal void Remove ()
+ {
+ if (document != null) {
+ document.RemoveMarker (IconMarker);
+ document.RemoveMarker (TextMarker);
+ }
+ }
+ }
+
+ class BreakpointTextMarker : DebugMarkerPair
+ {
+ static readonly Image breakpoint = Image.FromResource (typeof (BreakpointPad), "gutter-breakpoint-15.png");
+ static readonly Image tracepoint = Image.FromResource (typeof (BreakpointPad), "gutter-tracepoint-15.png");
+
+ public BreakpointTextMarker (MonoTextEditor editor, int offset, int length, bool isTracepoint)
+ {
+ IconMarker = new DebugIconMarker (isTracepoint ? tracepoint : breakpoint);
+ TextMarker = new DebugTextMarker (offset, length, e => e.ColorStyle.BreakpointMarker, e => e.ColorStyle.BreakpointText);
+ }
+ }
+
+ class DisabledBreakpointTextMarker : DebugMarkerPair
+ {
+ static readonly Image breakpoint = Image.FromResource (typeof (BreakpointPad), "gutter-breakpoint-disabled-15.png");
+ static readonly Image tracepoint = Image.FromResource (typeof (BreakpointPad), "gutter-tracepoint-disabled-15.png");
+
+ public DisabledBreakpointTextMarker (MonoTextEditor editor, int offset, int length, bool isTracepoint)
+ {
+ IconMarker = new DebugIconMarker (isTracepoint ? tracepoint : breakpoint);
+ TextMarker = new DebugTextMarker (offset, length, e => e.ColorStyle.BreakpointMarkerDisabled);
+ }
+ }
+
+ class InvalidBreakpointTextMarker : DebugMarkerPair
+ {
+ static readonly Image breakpoint = Image.FromResource (typeof (BreakpointPad), "gutter-breakpoint-invalid-15.png");
+ static readonly Image tracepoint = Image.FromResource (typeof (BreakpointPad), "gutter-tracepoint-invalid-15.png");
+
+ public InvalidBreakpointTextMarker (MonoTextEditor editor, int offset, int length, bool isTracepoint)
+ {
+ IconMarker = new DebugIconMarker (isTracepoint ? tracepoint : breakpoint);
+ TextMarker = new DebugTextMarker (offset, length, e => e.ColorStyle.BreakpointMarkerInvalid);
+ }
+ }
+
+ class DebugStackLineTextMarker : DebugMarkerPair
+ {
+ static readonly Image stackLine = Image.FromResource (typeof (BreakpointPad), "gutter-stack-15.png");
+
+ public DebugStackLineTextMarker (MonoTextEditor editor, int offset, int length)
+ {
+ IconMarker = new DebugIconMarker (stackLine);
+ TextMarker = new DebugTextMarker (offset, length, e => e.ColorStyle.DebuggerStackLineMarker, e => e.ColorStyle.DebuggerStackLine);
+ }
+ }
+
+ class CurrentDebugLineTextMarker : DebugMarkerPair, ICurrentDebugLineTextMarker
+ {
+ static readonly Image currentLine = Image.FromResource (typeof (BreakpointPad), "gutter-execution-15.png");
+
+ public CurrentDebugLineTextMarker (MonoTextEditor editor, int offset, int length)
+ {
+ IconMarker = new DebugIconMarker (currentLine);
+ TextMarker = new DebugTextMarker (offset, length, e => e.ColorStyle.DebuggerCurrentLineMarker, e => e.ColorStyle.DebuggerCurrentLine);
+ }
+
+ public bool IsVisible { get { return IconMarker.IsVisible; } set { IconMarker.IsVisible = value; } }
+
+ IDocumentLine ITextLineMarker.Line { get { return new DocumentLineWrapper (IconMarker.LineSegment); } }
+
+ public object Tag { get { return IconMarker.Tag; } set { IconMarker.Tag = value; } }
+ }
+
+}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/ErrorMarker.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/ErrorMarker.cs
new file mode 100644
index 0000000000..19067b2026
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/ErrorMarker.cs
@@ -0,0 +1,81 @@
+//
+// ErrorMarker.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Mono.TextEditor;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace MonoDevelop.SourceEditor
+{
+ class ErrorMarker : UnderlineTextSegmentMarker, IErrorMarker
+ {
+ readonly static Cairo.Color defaultColor = new Cairo.Color(0, 0, 0);
+
+ readonly Error info;
+
+ public ErrorMarker (Error info, int offset, int length) : base (defaultColor, new TextSegment (offset, length))
+ {
+ this.info = info;
+ this.Wave = true;
+ }
+
+ public override void Draw (Mono.TextEditor.MonoTextEditor editor, Cairo.Context cr, LineMetrics metrics, int startOffset, int endOffset)
+ {
+ Color = info.ErrorType == ErrorType.Warning ? editor.ColorStyle.UnderlineWarning.Color : editor.ColorStyle.UnderlineError.Color;
+ base.Draw (editor, cr, metrics, startOffset, endOffset);
+ }
+
+ event EventHandler<TextMarkerMouseEventArgs> ITextSegmentMarker.MousePressed {
+ add {
+ throw new NotImplementedException ();
+ }
+ remove {
+ throw new NotImplementedException ();
+ }
+ }
+
+ event EventHandler<TextMarkerMouseEventArgs> ITextSegmentMarker.MouseHover {
+ add {
+ throw new NotImplementedException ();
+ }
+ remove {
+ throw new NotImplementedException ();
+ }
+ }
+
+ object ITextSegmentMarker.Tag {
+ get;
+ set;
+ }
+
+ public Error Error {
+ get {
+ return info;
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/GrayOutMarker.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/GrayOutMarker.cs
new file mode 100644
index 0000000000..4e5dcd4d56
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/GrayOutMarker.cs
@@ -0,0 +1,123 @@
+//
+// GrayOutMarker.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Mono.TextEditor;
+using System.Collections.Generic;
+using MonoDevelop.Components;
+
+namespace MonoDevelop.SourceEditor
+{
+ class GrayOutMarker : UnderlineTextSegmentMarker, IChunkMarker, MonoDevelop.Ide.Editor.IGenericTextSegmentMarker
+ {
+ public GrayOutMarker (TextSegment segment) : base ("", segment)
+ {
+ }
+
+ public override void Draw (MonoTextEditor editor, Cairo.Context cr, LineMetrics metrics, int startOffset, int endOffset)
+ {
+ // nothing (is drawn using chunk marker)
+ }
+
+ #region IChunkMarker implementation
+
+ void IChunkMarker.TransformChunks (List<Chunk> chunks)
+ {
+ int markerStart = Segment.Offset;
+ int markerEnd = Segment.EndOffset;
+ for (int i = 0; i < chunks.Count; i++) {
+ var chunk = chunks [i];
+ if (chunk.EndOffset < markerStart || markerEnd <= chunk.Offset)
+ continue;
+ if (chunk.Offset == markerStart && chunk.EndOffset == markerEnd)
+ return;
+ if (chunk.Offset < markerStart && chunk.EndOffset > markerEnd) {
+ var newChunk = new Chunk (chunk.Offset, markerStart - chunk.Offset, chunk.Style);
+ chunks.Insert (i, newChunk);
+ chunk.Offset += newChunk.Length;
+ chunk.Length -= newChunk.Length;
+ continue;
+ }
+ }
+ }
+
+ void IChunkMarker.ChangeForeColor (MonoTextEditor editor, Chunk chunk, ref Cairo.Color color)
+ {
+ if (Debugger.DebuggingService.IsDebugging)
+ return;
+ int markerStart = Segment.Offset;
+ int markerEnd = Segment.EndOffset;
+ if (chunk.EndOffset <= markerStart || markerEnd <= chunk.Offset)
+ return;
+ var bgc = editor.ColorStyle.PlainText.Background;
+ double alpha = 0.6;
+ color = new Cairo.Color (
+ color.R * alpha + bgc.R * (1.0 - alpha),
+ color.G * alpha + bgc.G * (1.0 - alpha),
+ color.B * alpha + bgc.B * (1.0 - alpha)
+ );
+ }
+ #endregion
+
+ event EventHandler<MonoDevelop.Ide.Editor.TextMarkerMouseEventArgs> MonoDevelop.Ide.Editor.ITextSegmentMarker.MousePressed {
+ add {
+ throw new NotSupportedException ();
+ }
+ remove {
+ throw new NotSupportedException ();
+ }
+ }
+
+ event EventHandler<MonoDevelop.Ide.Editor.TextMarkerMouseEventArgs> MonoDevelop.Ide.Editor.ITextSegmentMarker.MouseHover {
+ add {
+ throw new NotSupportedException ();
+ }
+ remove {
+ throw new NotSupportedException ();
+ }
+ }
+
+ object MonoDevelop.Ide.Editor.ITextSegmentMarker.Tag {
+ get;
+ set;
+ }
+
+ MonoDevelop.Ide.Editor.TextSegmentMarkerEffect MonoDevelop.Ide.Editor.IGenericTextSegmentMarker.Effect {
+ get {
+ return MonoDevelop.Ide.Editor.TextSegmentMarkerEffect.GrayOut;
+ }
+ }
+
+ HslColor MonoDevelop.Ide.Editor.IGenericTextSegmentMarker.Color {
+ get {
+ throw new NotSupportedException ();
+ }
+ set {
+ throw new NotSupportedException ();
+ }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/LinkMarker.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/LinkMarker.cs
new file mode 100644
index 0000000000..c884720dd2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/LinkMarker.cs
@@ -0,0 +1,130 @@
+//
+// LinkMarker.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide.Editor;
+using Mono.TextEditor;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.SourceEditor
+{
+ class LinkMarker : UnderlineTextSegmentMarker, ILinkTextMarker, IActionTextLineMarker
+ {
+ static readonly Gdk.Cursor textLinkCursor = new Gdk.Cursor (Gdk.CursorType.Hand1);
+
+ Action<LinkRequest> activateLink;
+
+ public bool OnlyShowLinkOnHover {
+ get;
+ set;
+ }
+
+
+ public LinkMarker (int offset, int length, Action<LinkRequest> activateLink) : base (DefaultSourceEditorOptions.Instance.GetColorStyle ().LinkColor.Color, new TextSegment (offset, length))
+ {
+ this.activateLink = activateLink;
+ this.Wave = false;
+ }
+
+ public event EventHandler<TextMarkerMouseEventArgs> MousePressed;
+ public event EventHandler<TextMarkerMouseEventArgs> MouseHover;
+
+ object ITextSegmentMarker.Tag {
+ get;
+ set;
+ }
+
+ bool IActionTextLineMarker.MousePressed (MonoTextEditor editor, MarginMouseEventArgs args)
+ {
+ MousePressed?.Invoke (this, new TextEventArgsWrapper (args));
+ return false;
+ }
+
+ bool IActionTextLineMarker.MouseReleased (MonoTextEditor editor, MarginMouseEventArgs args)
+ {
+ if ((Platform.IsMac && (args.ModifierState & Gdk.ModifierType.Mod2Mask) == Gdk.ModifierType.Mod2Mask) ||
+ (!Platform.IsMac && (args.ModifierState & Gdk.ModifierType.ControlMask) == Gdk.ModifierType.ControlMask))
+ activateLink?.Invoke (LinkRequest.RequestNewView);
+ else
+ activateLink?.Invoke (LinkRequest.SameView);
+
+ return false;
+ }
+
+
+ void IActionTextLineMarker.MouseHover (MonoTextEditor editor, MarginMouseEventArgs args, TextLineMarkerHoverResult result)
+ {
+ MouseHover?.Invoke (this, new TextEventArgsWrapper (args));
+ result.Cursor = textLinkCursor;
+ if (OnlyShowLinkOnHover) {
+ editor.GetTextEditorData ().Document.CommitLineUpdate (args.LineSegment);
+ editor.TextViewMargin.HoveredLineChanged += new UpdateOldLine (editor, args.LineSegment).TextViewMargin_HoveredLineChanged;
+ }
+ }
+
+ class UpdateOldLine
+ {
+ MonoTextEditor editor;
+ DocumentLine lineSegment;
+
+ public UpdateOldLine (MonoTextEditor editor, DocumentLine lineSegment)
+ {
+ this.editor = editor;
+ this.lineSegment = lineSegment;
+ }
+
+ public void TextViewMargin_HoveredLineChanged (object sender, Mono.TextEditor.LineEventArgs e)
+ {
+ editor.GetTextEditorData ().Document.CommitLineUpdate (lineSegment);
+ editor.TextViewMargin.HoveredLineChanged -= TextViewMargin_HoveredLineChanged;
+ }
+ }
+
+ public override void Draw (MonoTextEditor editor, Cairo.Context cr, LineMetrics metrics, int startOffset, int endOffset)
+ {
+ if (OnlyShowLinkOnHover) {
+ if (editor.TextViewMargin.MarginCursor != textLinkCursor)
+ return;
+ if (editor.TextViewMargin.HoveredLine == null)
+ return;
+ var hoverOffset = editor.LocationToOffset (editor.TextViewMargin.HoveredLocation);
+ if (!Segment.Contains (hoverOffset))
+ return;
+ }
+ this.Color = editor.ColorStyle.LinkColor.Color;
+
+ if (!OnlyShowLinkOnHover) {
+ if (editor.TextViewMargin.MarginCursor == textLinkCursor && editor.TextViewMargin.HoveredLine != null) {
+ var hoverOffset = editor.LocationToOffset (editor.TextViewMargin.HoveredLocation);
+ if (Segment.Contains (hoverOffset))
+ this.Color = editor.ColorStyle.ActiveLinkColor.Color;
+ }
+ }
+
+ base.Draw (editor, cr, metrics, startOffset, endOffset);
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/SmartTagMarker.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/SmartTagMarker.cs
new file mode 100644
index 0000000000..c9711c7948
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/SmartTagMarker.cs
@@ -0,0 +1,162 @@
+//
+// SmartTagMarker.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Mono.TextEditor;
+using MonoDevelop.Components;
+using MonoDevelop.Ide.Editor;
+
+namespace MonoDevelop.SourceEditor
+{
+ class SmartTagMarker : TextSegmentMarker, IActionTextLineMarker, ISmartTagMarker
+ {
+ const double tagMarkerWidth = 8;
+ const double tagMarkerHeight = 2;
+ MonoDevelop.Ide.Editor.DocumentLocation loc;
+ Mono.TextEditor.MonoTextEditor editor;
+
+ public SmartTagMarker (int offset, MonoDevelop.Ide.Editor.DocumentLocation realLocation) : base (offset, 0)
+ {
+ this.loc = realLocation;
+ }
+
+ public override void Draw (Mono.TextEditor.MonoTextEditor editor, Cairo.Context cr, LineMetrics metrics, int startOffset, int endOffset)
+ {
+ this.editor = editor;
+ var line = editor.GetLine (loc.Line);
+ if (line == null)
+ return;
+ var x = editor.ColumnToX (line, loc.Column) - editor.HAdjustment.Value + editor.TextViewMargin.XOffset + editor.TextViewMargin.TextStartPosition;
+
+ cr.Rectangle (Math.Floor (x), Math.Floor (metrics.LineYRenderStartPosition) + (line == editor.GetLineByOffset (startOffset) ? editor.LineHeight - tagMarkerHeight : 0), tagMarkerWidth, tagMarkerHeight);
+ cr.SetSourceColor ((HslColor.Brightness (editor.ColorStyle.PlainText.Background) < 0.5 ? Ide.Gui.Styles.Editor.SmartTagMarkerColorDark : Ide.Gui.Styles.Editor.SmartTagMarkerColorLight).ToCairoColor ());
+ cr.Fill ();
+ }
+
+ #region IActionTextLineMarker implementation
+
+ bool IActionTextLineMarker.MousePressed (Mono.TextEditor.MonoTextEditor editor, MarginMouseEventArgs args)
+ {
+ var handler = MousePressed;
+ if (handler != null)
+ handler (this, new TextEventArgsWrapper (args));
+ return false;
+ }
+
+ bool IActionTextLineMarker.MouseReleased (MonoTextEditor editor, MarginMouseEventArgs args)
+ {
+ return false;
+ }
+
+
+ void IActionTextLineMarker.MouseHover (Mono.TextEditor.MonoTextEditor editor, MarginMouseEventArgs args, TextLineMarkerHoverResult result)
+ {
+ if (args.Button != 0)
+ return;
+ var line = editor.GetLine (loc.Line);
+ if (line == null)
+ return;
+ var x = editor.ColumnToX (line, loc.Column) - editor.HAdjustment.Value + editor.TextViewMargin.TextStartPosition;
+ //var y = editor.LineToY (line.LineNumber + 1) - editor.VAdjustment.Value;
+ const double xAdditionalSpace = tagMarkerWidth;
+ if (args.X - x >= -xAdditionalSpace * editor.Options.Zoom &&
+ args.X - x < (tagMarkerWidth + xAdditionalSpace) * editor.Options.Zoom /*&&
+ args.Y - y < (editor.LineHeight / 2) * editor.Options.Zoom*/) {
+ result.Cursor = null;
+ ShowPopup?.Invoke (null, null);
+ } else {
+ CancelPopup?.Invoke (null, null);
+ }
+ }
+
+
+ #endregion
+
+ bool ISmartTagMarker.IsInsideSmartTag (double x, double y)
+ {
+ if (editor == null)
+ return false;
+ var lin2 = editor.GetLine (loc.Line);
+ var x2 = editor.ColumnToX (lin2, loc.Column) - editor.HAdjustment.Value + editor.TextViewMargin.TextStartPosition;
+ var y2 = editor.LineToY (loc.Line + 1) - editor.VAdjustment.Value;
+ return x - x2 >= 0 * editor.Options.Zoom &&
+ x - x2 < tagMarkerWidth * editor.Options.Zoom &&
+ y - y2 < (editor.LineHeight / 2) * editor.Options.Zoom;
+ }
+
+ public event EventHandler<TextMarkerMouseEventArgs> MousePressed;
+ #pragma warning disable 0067
+ public event EventHandler<TextMarkerMouseEventArgs> MouseHover;
+ #pragma warning restore 0067
+ public event EventHandler ShowPopup;
+ public event EventHandler CancelPopup;
+
+ object ITextSegmentMarker.Tag {
+ get;
+ set;
+ }
+ }
+
+ class TextEventArgsWrapper : TextMarkerMouseEventArgs
+ {
+ readonly MarginMouseEventArgs args;
+
+ public override double X {
+ get {
+ return args.X;
+ }
+ }
+
+ public override double Y {
+ get {
+ return args.Y;
+ }
+ }
+
+ public override object OverwriteCursor {
+ get;
+ set;
+ }
+
+ public override string TooltipMarkup {
+ get;
+ set;
+ }
+
+ public TextEventArgsWrapper (MarginMouseEventArgs args)
+ {
+ if (args == null)
+ throw new ArgumentNullException ("args");
+ this.args = args;
+ }
+
+ public override bool TriggersContextMenu ()
+ {
+ return args.TriggersContextMenu ();
+ }
+ }
+
+}
+
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/UnitTestMarker.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/UnitTestMarker.cs
new file mode 100644
index 0000000000..7eb72901ff
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/UnitTestMarker.cs
@@ -0,0 +1,136 @@
+using System;
+using MonoDevelop.Ide.Editor;
+using Mono.TextEditor;
+using MonoDevelop.Core;
+using MonoDevelop.Components;
+using MonoDevelop.SourceEditor.Wrappers;
+
+namespace MonoDevelop.SourceEditor
+{
+ class UnitTestMarker : MarginMarker, IUnitTestMarker
+ {
+ IDocumentLine ITextLineMarker.Line {
+ get {
+ return new DocumentLineWrapper (LineSegment);
+ }
+ }
+
+ readonly UnitTestMarkerHost host;
+ readonly UnitTestLocation unitTest;
+ readonly ExtensibleTextEditor textEditor;
+
+ UnitTestLocation IUnitTestMarker.UnitTest {
+ get {
+ return unitTest;
+ }
+ }
+
+ void IUnitTestMarker.UpdateState ()
+ {
+ var line = LineSegment;
+ if (line == null)
+ return;
+ textEditor.RedrawMarginLine (textEditor.ActionMargin, line.LineNumber);
+ }
+
+ public UnitTestMarker (ExtensibleTextEditor textEditor, UnitTestMarkerHost host, UnitTestLocation unitTest)
+ {
+ if (textEditor == null)
+ throw new ArgumentNullException ("textEditor");
+ if (host == null)
+ throw new ArgumentNullException ("host");
+ this.textEditor = textEditor;
+ this.host = host;
+ this.unitTest = unitTest;
+ }
+
+ public override bool CanDrawForeground (Margin margin)
+ {
+ return margin is ActionMargin;
+ }
+
+ public override void InformMouseHover (Mono.TextEditor.MonoTextEditor editor, Margin margin, MarginMouseEventArgs args)
+ {
+ if (!(margin is ActionMargin))
+ return;
+ string toolTip;
+ if (unitTest.IsFixture) {
+ if (isFailed) {
+ toolTip = GettextCatalog.GetString ("NUnit Fixture failed (click to run)");
+ if (!string.IsNullOrEmpty (failMessage))
+ toolTip += Environment.NewLine + failMessage.TrimEnd ();
+ } else {
+ toolTip = GettextCatalog.GetString ("NUnit Fixture (click to run)");
+ }
+ } else {
+ if (isFailed) {
+ toolTip = GettextCatalog.GetString ("NUnit Test failed (click to run)");
+ if (!string.IsNullOrEmpty (failMessage))
+ toolTip += Environment.NewLine + failMessage.TrimEnd ();
+ foreach (var id in unitTest.TestCases) {
+ if (host.IsFailure (unitTest.UnitTestIdentifier, id)) {
+ var msg = host.GetMessage (unitTest.UnitTestIdentifier, id);
+ if (!string.IsNullOrEmpty (msg)) {
+ toolTip += Environment.NewLine + "Test" + id + ":";
+ toolTip += Environment.NewLine + msg.TrimEnd ();
+ }
+ }
+ }
+ } else {
+ toolTip = GettextCatalog.GetString ("NUnit Test (click to run)");
+ }
+
+ }
+ editor.TooltipText = toolTip;
+ }
+
+// static Menu menu;
+
+ public override void InformMousePress (Mono.TextEditor.MonoTextEditor editor, Margin margin, MarginMouseEventArgs args)
+ {
+ if (!(margin is ActionMargin))
+ return;
+ host.PopupContextMenu (unitTest, (int)(args.X + margin.XOffset), (int)args.Y);
+ editor.TextArea.ResetMouseState ();
+ }
+
+ bool isFailed;
+ string failMessage;
+
+ public override void DrawForeground (Mono.TextEditor.MonoTextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
+ {
+ isFailed = false;
+ bool searchCases = false;
+
+ Xwt.Drawing.Image icon = host.GetStatusIcon (unitTest.UnitTestIdentifier);
+ if (icon != null) {
+ if (host.HasResult (unitTest.UnitTestIdentifier)) {
+ searchCases = true;
+ } else if (host.IsFailure (unitTest.UnitTestIdentifier)) {
+ failMessage = host.GetMessage (unitTest.UnitTestIdentifier);
+ isFailed = true;
+ }
+ } else {
+ searchCases = true;
+ }
+
+ if (searchCases) {
+ foreach (var caseId in unitTest.TestCases) {
+ icon = host.GetStatusIcon (unitTest.UnitTestIdentifier, caseId);
+ if (host.IsFailure (unitTest.UnitTestIdentifier, caseId)) {
+ failMessage = host.GetMessage (unitTest.UnitTestIdentifier, caseId);
+ isFailed = true;
+ break;
+ }
+ }
+ }
+
+ if (icon != null) {
+ if (icon.Width > metrics.Width || icon.Height > metrics.Height)
+ icon = icon.WithBoxSize (metrics.Width, metrics.Height);
+ cr.DrawImage (editor, icon, Math.Truncate (metrics.X + metrics.Width / 2 - icon.Width / 2), Math.Truncate (metrics.Y + metrics.Height / 2 - icon.Height / 2));
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/UrlTextLineMarker.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/UrlTextLineMarker.cs
new file mode 100644
index 0000000000..00e8ccfed0
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/UrlTextLineMarker.cs
@@ -0,0 +1,56 @@
+//
+// UrlTextLineMarker.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Mono.TextEditor;
+using MonoDevelop.Ide.Editor;
+
+namespace MonoDevelop.SourceEditor
+{
+ class UrlTextLineMarker : UrlMarker, IUrlTextLineMarker
+ {
+ readonly IDocumentLine line;
+
+ public UrlTextLineMarker (TextDocument doc, IDocumentLine line, string url, Mono.TextEditor.UrlType urlType, string style, int startColumn, int endColumn) : base (doc, doc.GetLine (line.LineNumber), url, urlType, style, startColumn, endColumn)
+ {
+ if (doc == null)
+ throw new ArgumentNullException ("doc");
+ this.line = line;
+ }
+
+ MonoDevelop.Ide.Editor.UrlType IUrlTextLineMarker.UrlType {
+ get {
+ return (MonoDevelop.Ide.Editor.UrlType)UrlType;
+ }
+ }
+
+ IDocumentLine ITextLineMarker.Line {
+ get {
+ return line;
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/UsageSegmentMarker.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/UsageSegmentMarker.cs
new file mode 100644
index 0000000000..234ac4d6d4
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/UsageSegmentMarker.cs
@@ -0,0 +1,104 @@
+using System;
+using Mono.TextEditor;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.FindInFiles;
+using Cairo;
+using MonoDevelop.Components;
+using MonoDevelop.Ide.Editor.Extension;
+
+namespace MonoDevelop.SourceEditor
+{
+ class UsageSegmentMarker : TextSegmentMarker, ITextSegmentMarker
+ {
+ readonly Usage usage;
+
+ public Usage Usage {
+ get {
+ return usage;
+ }
+ }
+
+ public UsageSegmentMarker (Usage usage) : base (usage.Offset, usage.Length)
+ {
+ this.usage = usage;
+ }
+
+ event EventHandler<TextMarkerMouseEventArgs> ITextSegmentMarker.MousePressed {
+ add {
+ }
+ remove {
+ }
+ }
+
+ event EventHandler<TextMarkerMouseEventArgs> ITextSegmentMarker.MouseHover {
+ add {
+ }
+ remove {
+ }
+ }
+
+ object ITextSegmentMarker.Tag {
+ get;
+ set;
+ }
+
+ public override void DrawBackground (Mono.TextEditor.MonoTextEditor editor, Context cr, LineMetrics metrics, int startOffset, int endOffset)
+ {
+ int markerStart = usage.Offset;
+ int markerEnd = usage.EndOffset;
+
+ if (markerEnd < startOffset || markerStart > endOffset)
+ return;
+
+ double @from;
+ double to;
+ var startXPos = metrics.TextRenderStartPosition;
+ var endXPos = metrics.TextRenderEndPosition;
+ var y = metrics.LineYRenderStartPosition;
+ if (markerStart < startOffset && endOffset < markerEnd) {
+ @from = startXPos;
+ to = endXPos;
+ } else {
+ int start = startOffset < markerStart ? markerStart : startOffset;
+ int end = endOffset < markerEnd ? endOffset : markerEnd;
+
+ uint curIndex = 0, byteIndex = 0;
+ TextViewMargin.TranslateToUTF8Index (metrics.Layout.LineChars, (uint)(start - startOffset), ref curIndex, ref byteIndex);
+
+ int x_pos = metrics.Layout.Layout.IndexToPos ((int)byteIndex).X;
+
+ @from = startXPos + (int)(x_pos / Pango.Scale.PangoScale);
+
+ TextViewMargin.TranslateToUTF8Index (metrics.Layout.LineChars, (uint)(end - startOffset), ref curIndex, ref byteIndex);
+ x_pos = metrics.Layout.Layout.IndexToPos ((int)byteIndex).X;
+
+ to = startXPos + (int)(x_pos / Pango.Scale.PangoScale);
+ }
+
+ @from = Math.Max (@from, editor.TextViewMargin.XOffset);
+ to = Math.Max (to, editor.TextViewMargin.XOffset);
+ if (@from < to) {
+ Mono.TextEditor.Highlighting.AmbientColor colorStyle;
+ if ((usage.UsageType & ReferenceUsageType.Write) == ReferenceUsageType.Write ||
+ (usage.UsageType & ReferenceUsageType.Declariton) == ReferenceUsageType.Declariton) {
+ colorStyle = editor.ColorStyle.ChangingUsagesRectangle;
+ if (colorStyle.Color.A == 0.0)
+ colorStyle = editor.ColorStyle.UsagesRectangle;
+ } else {
+ colorStyle = editor.ColorStyle.UsagesRectangle;
+ }
+
+ using (var lg = new LinearGradient (@from + 1, y + 1.5, to , y + editor.LineHeight - 1)) {
+ lg.AddColorStop (0, colorStyle.Color);
+ lg.AddColorStop (1, colorStyle.SecondColor);
+ cr.SetSource (lg);
+ cr.RoundedRectangle (@from - 0.5, y + 0.5, to - @from + 1, editor.LineHeight - 1, 2);
+ cr.FillPreserve ();
+ }
+
+ cr.SetSourceColor (colorStyle.BorderColor);
+ cr.Stroke ();
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/WavedLineMarker.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/WavedLineMarker.cs
new file mode 100644
index 0000000000..7953dac2b5
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/WavedLineMarker.cs
@@ -0,0 +1,135 @@
+//
+// WavedLineMarker.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Mono.TextEditor;
+using MonoDevelop.Components;
+using MonoDevelop.Debugger;
+using Pango;
+
+namespace MonoDevelop.SourceEditor
+{
+ class GenericUnderlineMarker : UnderlineTextSegmentMarker, MonoDevelop.Ide.Editor.IGenericTextSegmentMarker
+ {
+ HslColor color;
+
+ HslColor MonoDevelop.Ide.Editor.IGenericTextSegmentMarker.Color {
+ get {
+ return color;
+ }
+ set {
+ color = value;
+ }
+ }
+
+ public GenericUnderlineMarker (TextSegment segment, MonoDevelop.Ide.Editor.TextSegmentMarkerEffect effect) : base ("", segment)
+ {
+ this.effect = effect;
+ }
+
+ public override void Draw (MonoTextEditor editor, Cairo.Context cr, LineMetrics layout, int startOffset, int endOffset)
+ {
+ if (DebuggingService.IsDebugging)
+ return;
+ int markerStart = Segment.Offset;
+ int markerEnd = Segment.EndOffset;
+ if (markerEnd < startOffset || markerStart > endOffset)
+ return;
+
+ double drawFrom;
+ double drawTo;
+ double y = layout.LineYRenderStartPosition;
+ double startXPos = layout.TextRenderStartPosition;
+ double endXPos = layout.TextRenderEndPosition;
+
+ if (markerStart < startOffset && endOffset < markerEnd) {
+ drawTo = endXPos;
+ var line = editor.GetLineByOffset (startOffset);
+ int offset = line.GetIndentation (editor.Document).Length;
+ drawFrom = startXPos + (layout.Layout.Layout.IndexToPos (offset).X / Pango.Scale.PangoScale);
+ } else {
+ int start;
+ if (startOffset < markerStart) {
+ start = markerStart;
+ } else {
+ var line = editor.GetLineByOffset (startOffset);
+ int offset = line.GetIndentation (editor.Document).Length;
+ start = startOffset + offset;
+ }
+ int end = endOffset < markerEnd ? endOffset : markerEnd;
+ int x_pos;
+
+ x_pos = layout.Layout.Layout.IndexToPos (start - startOffset).X;
+ drawFrom = startXPos + (int)(x_pos / Pango.Scale.PangoScale);
+ x_pos = layout.Layout.Layout.IndexToPos (end - startOffset).X;
+
+ drawTo = startXPos + (int)(x_pos / Pango.Scale.PangoScale);
+ }
+
+ drawFrom = Math.Max (drawFrom, editor.TextViewMargin.XOffset);
+ drawTo = Math.Max (drawTo, editor.TextViewMargin.XOffset);
+ if (drawFrom >= drawTo)
+ return;
+
+ double height = editor.LineHeight / 5;
+ cr.SetSourceColor (color);
+ if (effect == MonoDevelop.Ide.Editor.TextSegmentMarkerEffect.WavedLine) {
+ Pango.CairoHelper.ShowErrorUnderline (cr, drawFrom, y + editor.LineHeight - height, drawTo - drawFrom, height);
+ } else if (effect == MonoDevelop.Ide.Editor.TextSegmentMarkerEffect.DottedLine) {
+ cr.Save ();
+ cr.LineWidth = 1;
+ cr.MoveTo (drawFrom + 1, y + editor.LineHeight - 1 + 0.5);
+ cr.RelLineTo (Math.Min (drawTo - drawFrom, 4 * 3), 0);
+ cr.SetDash (new double[] { 2, 2 }, 0);
+ cr.Stroke ();
+ cr.Restore ();
+ } else {
+ cr.MoveTo (drawFrom, y + editor.LineHeight - 1);
+ cr.LineTo (drawTo, y + editor.LineHeight - 1);
+ cr.Stroke ();
+ }
+ }
+
+ #pragma warning disable 0067
+ public event EventHandler<MonoDevelop.Ide.Editor.TextMarkerMouseEventArgs> MousePressed;
+
+ public event EventHandler<MonoDevelop.Ide.Editor.TextMarkerMouseEventArgs> MouseHover;
+ #pragma warning restore 0067
+
+ object MonoDevelop.Ide.Editor.ITextSegmentMarker.Tag {
+ get;
+ set;
+ }
+
+ MonoDevelop.Ide.Editor.TextSegmentMarkerEffect effect;
+ MonoDevelop.Ide.Editor.TextSegmentMarkerEffect MonoDevelop.Ide.Editor.IGenericTextSegmentMarker.Effect {
+ get {
+ return effect;
+ }
+ }
+
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/searchoptions.png b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/searchoptions.png
deleted file mode 100644
index 0be6338cb3..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/searchoptions.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/searchoptions.svg b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/searchoptions.svg
deleted file mode 100644
index 209df7dfd1..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/searchoptions.svg
+++ /dev/null
@@ -1,151 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.0"
- x="0"
- y="0"
- width="60"
- height="60"
- id="svg1"
- sodipodi:version="0.32"
- inkscape:version="0.47pre4 r22446"
- sodipodi:docname="stock_search.svg"
- inkscape:export-filename="/home/mkrueger/Desktop/search.png"
- inkscape:export-xdpi="30.584652"
- inkscape:export-ydpi="30.584652">
- <metadata
- id="metadata22">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="11.020833"
- inkscape:cx="30.556057"
- inkscape:cy="28.957974"
- inkscape:window-width="1920"
- inkscape:window-height="1150"
- inkscape:window-x="0"
- inkscape:window-y="0"
- inkscape:current-layer="svg1"
- showgrid="false"
- inkscape:window-maximized="1" />
- <defs
- id="defs3">
- <inkscape:perspective
- sodipodi:type="inkscape:persp3d"
- inkscape:vp_x="0 : 30 : 1"
- inkscape:vp_y="0 : 1000 : 0"
- inkscape:vp_z="60 : 30 : 1"
- inkscape:persp3d-origin="30 : 20 : 1"
- id="perspective27" />
- <linearGradient
- id="linearGradient900">
- <stop
- style="stop-color:#000000;stop-opacity:1;"
- offset="0"
- id="stop901" />
- <stop
- style="stop-color:#ffffff;stop-opacity:1;"
- offset="1"
- id="stop902" />
- </linearGradient>
- <linearGradient
- id="linearGradient903"
- xlink:href="#linearGradient900" />
- <linearGradient
- id="linearGradient904"
- xlink:href="#linearGradient900" />
- <linearGradient
- id="linearGradient905"
- xlink:href="#linearGradient900" />
- <linearGradient
- id="linearGradient906"
- xlink:href="#linearGradient900" />
- <linearGradient
- id="linearGradient907"
- xlink:href="#linearGradient900" />
- <linearGradient
- id="linearGradient1163"
- xlink:href="#linearGradient1160" />
- <linearGradient
- id="linearGradient1160">
- <stop
- style="stop-color:#000000;stop-opacity:1;"
- offset="0"
- id="stop1161" />
- <stop
- style="stop-color:#ffffff;stop-opacity:1;"
- offset="1"
- id="stop1162" />
- </linearGradient>
- <inkscape:perspective
- id="perspective2825"
- inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
- inkscape:vp_z="1 : 0.5 : 1"
- inkscape:vp_y="0 : 1000 : 0"
- inkscape:vp_x="0 : 0.5 : 1"
- sodipodi:type="inkscape:persp3d" />
- </defs>
- <path
- id="path1187"
- style="font-size:12px;fill:#ececec;fill-rule:evenodd;stroke:#666666;stroke-width:2.69768906000000008;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
- d="M 22.02672,24.498927 C 33.829117,39.594897 40.992998,49.676163 41.774708,46.334461 44.926753,45.774828 36.273157,36.703552 24.541555,22.750956 L 22.02672,24.498927 z"
- sodipodi:nodetypes="cccc" />
- <ellipse
- d="m 47.865601,28.05961 c 0,11.379166 -9.224637,20.603802 -20.603802,20.603802 -11.379166,0 -20.6038019,-9.224636 -20.6038019,-20.603802 0,-11.379165 9.2246359,-20.6038014 20.6038019,-20.6038014 11.379165,0 20.603802,9.2246364 20.603802,20.6038014 z"
- sodipodi:ry="20.603802"
- sodipodi:rx="20.603802"
- sodipodi:cy="28.05961"
- sodipodi:cx="27.261799"
- id="path1174"
- style="font-size:12px;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:#666666;stroke-width:3.12500000000000000;stroke-opacity:1"
- transform="matrix(0.80118022,0,0,0.74680016,-3.6563689,-3.1173228)"
- ry="20.603802"
- rx="20.603802"
- cy="28.05961"
- cx="27.261799" />
- <ellipse
- d="m 47.865601,28.05961 c 0,11.379166 -9.224637,20.603802 -20.603802,20.603802 -11.379166,0 -20.6038019,-9.224636 -20.6038019,-20.603802 0,-11.379165 9.2246359,-20.6038014 20.6038019,-20.6038014 11.379165,0 20.603802,9.2246364 20.603802,20.6038014 z"
- sodipodi:ry="20.603802"
- sodipodi:rx="20.603802"
- sodipodi:cy="28.05961"
- sodipodi:cx="27.261799"
- id="path1175"
- style="font-size:12px;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#666666;stroke-width:3.70790005000000011;stroke-opacity:1"
- transform="matrix(0.65257038,0,0,0.59740916,0.42439363,1.1215815)"
- ry="20.603802"
- rx="20.603802"
- cy="28.05961"
- cx="27.261799"
- inkscape:export-xdpi="32"
- inkscape:export-ydpi="32" />
- <path
- sodipodi:nodetypes="cccccccc"
- id="rect812"
- d="m 59.124514,25.370475 c -0.01119,0.592816 -0.21095,1.16795 -0.618473,1.612191 l -9.044962,9.876788 c -0.815044,0.888485 -2.089709,0.845211 -2.870461,-0.08329 l -8.2694,-9.787908 c -0.736904,-0.876357 -0.696351,-2.231158 -0.01059,-3.127324 l 20.3094,-0.06794 c 0.354504,0.454282 0.515189,1.012071 0.504518,1.577474 z"
- style="font-size:12px;fill:#666666;fill-opacity:1;fill-rule:nonzero;stroke:none"
- inkscape:export-xdpi="32"
- inkscape:export-ydpi="32" />
-</svg>
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.GotoLineNumberWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.GotoLineNumberWidget.cs
index 1b7c8e870b..40e716faff 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.GotoLineNumberWidget.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.GotoLineNumberWidget.cs
@@ -2,17 +2,18 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.SourceEditor
{
- partial class GotoLineNumberWidget
+ public partial class GotoLineNumberWidget
{
private global::Gtk.HBox hbox1;
private global::Gtk.Entry entryLineNumber;
private global::Gtk.Button buttonGoToLine;
- private global::Gtk.EventBox eventbox2;
- private global::Gtk.Image image2;
+
+ private global::MonoDevelop.Components.ImageView image2;
+
private global::Gtk.Button closeButton;
- private global::Gtk.EventBox eventbox1;
- private global::Gtk.Image image1;
+ private global::MonoDevelop.Components.ImageView image1;
+
protected virtual void Build ()
{
global::Stetic.Gui.Initialize (this);
@@ -39,44 +40,32 @@ namespace MonoDevelop.SourceEditor
this.buttonGoToLine.Name = "buttonGoToLine";
this.buttonGoToLine.Relief = ((global::Gtk.ReliefStyle)(2));
// Container child buttonGoToLine.Gtk.Container+ContainerChild
- this.eventbox2 = new global::Gtk.EventBox ();
- this.eventbox2.Name = "eventbox2";
- this.eventbox2.AboveChild = true;
- this.eventbox2.VisibleWindow = false;
- // Container child eventbox2.Gtk.Container+ContainerChild
- this.image2 = new global::Gtk.Image ();
+ this.image2 = new global::MonoDevelop.Components.ImageView ();
this.image2.Name = "image2";
- this.image2.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-jump-to", global::Gtk.IconSize.Menu);
- this.eventbox2.Add (this.image2);
- this.buttonGoToLine.Add (this.eventbox2);
- this.buttonGoToLine.Label = null;
+ this.image2.IconId = "gtk-jump-to";
+ this.image2.IconSize = ((global::Gtk.IconSize)(1));
+ this.buttonGoToLine.Add (this.image2);
this.hbox1.Add (this.buttonGoToLine);
- global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.buttonGoToLine]));
- w4.Position = 1;
- w4.Expand = false;
- w4.Fill = false;
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.buttonGoToLine]));
+ w3.Position = 1;
+ w3.Expand = false;
+ w3.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
this.closeButton = new global::Gtk.Button ();
this.closeButton.CanFocus = true;
this.closeButton.Name = "closeButton";
this.closeButton.Relief = ((global::Gtk.ReliefStyle)(2));
// Container child closeButton.Gtk.Container+ContainerChild
- this.eventbox1 = new global::Gtk.EventBox ();
- this.eventbox1.Name = "eventbox1";
- this.eventbox1.AboveChild = true;
- this.eventbox1.VisibleWindow = false;
- // Container child eventbox1.Gtk.Container+ContainerChild
- this.image1 = new global::Gtk.Image ();
+ this.image1 = new global::MonoDevelop.Components.ImageView ();
this.image1.Name = "image1";
- this.image1.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-close", global::Gtk.IconSize.Menu);
- this.eventbox1.Add (this.image1);
- this.closeButton.Add (this.eventbox1);
- this.closeButton.Label = null;
+ this.image1.IconId = "gtk-close";
+ this.image1.IconSize = ((global::Gtk.IconSize)(1));
+ this.closeButton.Add (this.image1);
this.hbox1.Add (this.closeButton);
- global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.closeButton]));
- w7.Position = 2;
- w7.Expand = false;
- w7.Fill = false;
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.closeButton]));
+ w5.Position = 2;
+ w5.Expand = false;
+ w5.Fill = false;
this.Add (this.hbox1);
if ((this.Child != null)) {
this.Child.ShowAll ();
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs
index 0fab32c065..58b57721bb 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs
@@ -5,289 +5,315 @@ namespace MonoDevelop.SourceEditor.OptionPanels
public partial class BehaviorPanel
{
private global::Gtk.VBox vbox1;
+
private global::Gtk.Label GtkLabel5;
+
private global::Gtk.Alignment alignment3;
+
private global::Gtk.VBox vbox4;
+
private global::Gtk.CheckButton autoInsertBraceCheckbutton;
+
private global::Gtk.HBox hbox2;
+
private global::Gtk.Label fixed1;
+
private global::Gtk.CheckButton smartSemicolonPlaceCheckbutton;
+
private global::Gtk.CheckButton checkbuttonOnTheFlyFormatting;
+
private global::Gtk.CheckButton checkbuttonFormatOnSave;
+
private global::Gtk.CheckButton checkbuttonAutoSetSearchPatternCasing;
+
private global::Gtk.CheckButton checkbuttonGenerateFormattingUndoStep;
- private global::Gtk.Label GtkLabel6;
+
+ private global::Gtk.CheckButton checkbuttonEnableSelectionSurrounding;
+
+ private global::Gtk.Label GtkLabel7;
+
private global::Gtk.Alignment GtkAlignment;
+
private global::Gtk.VBox vbox2;
+
private global::Gtk.HBox hbox1;
+
private global::Gtk.Label label1;
+
private global::Gtk.ComboBox indentationCombobox;
+
private global::Gtk.CheckButton tabAsReindentCheckbutton;
- private global::Gtk.Label GtkLabel8;
+
+ private global::Gtk.Label GtkLabel9;
+
private global::Gtk.Alignment alignment4;
+
private global::Gtk.VBox vbox5;
- private global::Gtk.CheckButton useViModesCheck;
+
private global::Gtk.HBox hbox3;
+
private global::Gtk.Label label2;
+
private global::Gtk.ComboBox controlLeftRightCombobox;
- protected virtual void Build ()
+ protected virtual void Build()
{
- global::Stetic.Gui.Initialize (this);
+ global::Stetic.Gui.Initialize(this);
// Widget MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel
- global::Stetic.BinContainer.Attach (this);
+ global::Stetic.BinContainer.Attach(this);
this.Name = "MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel";
// Container child MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.Gtk.Container+ContainerChild
- this.vbox1 = new global::Gtk.VBox ();
+ this.vbox1 = new global::Gtk.VBox();
this.vbox1.Name = "vbox1";
this.vbox1.Spacing = 6;
// Container child vbox1.Gtk.Box+BoxChild
- this.GtkLabel5 = new global::Gtk.Label ();
+ this.GtkLabel5 = new global::Gtk.Label();
this.GtkLabel5.Name = "GtkLabel5";
this.GtkLabel5.Xalign = 0F;
- this.GtkLabel5.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Automatic behaviors</b>");
+ this.GtkLabel5.LabelProp = global::Mono.Unix.Catalog.GetString("<b>Automatic behaviors</b>");
this.GtkLabel5.UseMarkup = true;
- this.vbox1.Add (this.GtkLabel5);
- global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkLabel5]));
+ this.vbox1.Add(this.GtkLabel5);
+ global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.GtkLabel5]));
w1.Position = 0;
w1.Expand = false;
w1.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
- this.alignment3 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
+ this.alignment3 = new global::Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
this.alignment3.Name = "alignment3";
this.alignment3.LeftPadding = ((uint)(12));
// Container child alignment3.Gtk.Container+ContainerChild
- this.vbox4 = new global::Gtk.VBox ();
+ this.vbox4 = new global::Gtk.VBox();
this.vbox4.Name = "vbox4";
this.vbox4.Spacing = 6;
// Container child vbox4.Gtk.Box+BoxChild
- this.autoInsertBraceCheckbutton = new global::Gtk.CheckButton ();
+ this.autoInsertBraceCheckbutton = new global::Gtk.CheckButton();
this.autoInsertBraceCheckbutton.CanFocus = true;
this.autoInsertBraceCheckbutton.Name = "autoInsertBraceCheckbutton";
- this.autoInsertBraceCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Insert matching brace");
+ this.autoInsertBraceCheckbutton.Label = global::Mono.Unix.Catalog.GetString("_Insert matching brace");
this.autoInsertBraceCheckbutton.DrawIndicator = true;
this.autoInsertBraceCheckbutton.UseUnderline = true;
- this.vbox4.Add (this.autoInsertBraceCheckbutton);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.autoInsertBraceCheckbutton]));
+ this.vbox4.Add(this.autoInsertBraceCheckbutton);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.autoInsertBraceCheckbutton]));
w2.Position = 0;
w2.Expand = false;
w2.Fill = false;
// Container child vbox4.Gtk.Box+BoxChild
- this.hbox2 = new global::Gtk.HBox ();
+ this.hbox2 = new global::Gtk.HBox();
this.hbox2.Name = "hbox2";
this.hbox2.Spacing = 6;
// Container child hbox2.Gtk.Box+BoxChild
- this.fixed1 = new global::Gtk.Label ();
+ this.fixed1 = new global::Gtk.Label();
this.fixed1.Name = "fixed1";
- this.hbox2.Add (this.fixed1);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.fixed1]));
+ this.hbox2.Add(this.fixed1);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.fixed1]));
w3.Position = 0;
w3.Expand = false;
w3.Fill = false;
w3.Padding = ((uint)(6));
// Container child hbox2.Gtk.Box+BoxChild
- this.smartSemicolonPlaceCheckbutton = new global::Gtk.CheckButton ();
+ this.smartSemicolonPlaceCheckbutton = new global::Gtk.CheckButton();
this.smartSemicolonPlaceCheckbutton.CanFocus = true;
this.smartSemicolonPlaceCheckbutton.Name = "smartSemicolonPlaceCheckbutton";
- this.smartSemicolonPlaceCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Smart semicolon placement");
+ this.smartSemicolonPlaceCheckbutton.Label = global::Mono.Unix.Catalog.GetString("_Smart semicolon placement");
this.smartSemicolonPlaceCheckbutton.Active = true;
this.smartSemicolonPlaceCheckbutton.DrawIndicator = true;
this.smartSemicolonPlaceCheckbutton.UseUnderline = true;
- this.hbox2.Add (this.smartSemicolonPlaceCheckbutton);
- global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.smartSemicolonPlaceCheckbutton]));
+ this.hbox2.Add(this.smartSemicolonPlaceCheckbutton);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.smartSemicolonPlaceCheckbutton]));
w4.Position = 1;
- this.vbox4.Add (this.hbox2);
- global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.hbox2]));
+ this.vbox4.Add(this.hbox2);
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.hbox2]));
w5.Position = 1;
w5.Expand = false;
w5.Fill = false;
// Container child vbox4.Gtk.Box+BoxChild
- this.checkbuttonOnTheFlyFormatting = new global::Gtk.CheckButton ();
+ this.checkbuttonOnTheFlyFormatting = new global::Gtk.CheckButton();
this.checkbuttonOnTheFlyFormatting.CanFocus = true;
this.checkbuttonOnTheFlyFormatting.Name = "checkbuttonOnTheFlyFormatting";
- this.checkbuttonOnTheFlyFormatting.Label = global::Mono.Unix.Catalog.GetString ("_Enable on the fly code formatting");
+ this.checkbuttonOnTheFlyFormatting.Label = global::Mono.Unix.Catalog.GetString("_Enable on the fly code formatting");
this.checkbuttonOnTheFlyFormatting.DrawIndicator = true;
this.checkbuttonOnTheFlyFormatting.UseUnderline = true;
- this.vbox4.Add (this.checkbuttonOnTheFlyFormatting);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.checkbuttonOnTheFlyFormatting]));
+ this.vbox4.Add(this.checkbuttonOnTheFlyFormatting);
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.checkbuttonOnTheFlyFormatting]));
w6.Position = 2;
w6.Expand = false;
w6.Fill = false;
// Container child vbox4.Gtk.Box+BoxChild
- this.checkbuttonFormatOnSave = new global::Gtk.CheckButton ();
+ this.checkbuttonFormatOnSave = new global::Gtk.CheckButton();
this.checkbuttonFormatOnSave.CanFocus = true;
this.checkbuttonFormatOnSave.Name = "checkbuttonFormatOnSave";
- this.checkbuttonFormatOnSave.Label = global::Mono.Unix.Catalog.GetString ("_Format document on save");
+ this.checkbuttonFormatOnSave.Label = global::Mono.Unix.Catalog.GetString("_Format document on save");
this.checkbuttonFormatOnSave.DrawIndicator = true;
this.checkbuttonFormatOnSave.UseUnderline = true;
- this.vbox4.Add (this.checkbuttonFormatOnSave);
- global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.checkbuttonFormatOnSave]));
+ this.vbox4.Add(this.checkbuttonFormatOnSave);
+ global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.checkbuttonFormatOnSave]));
w7.Position = 3;
w7.Expand = false;
w7.Fill = false;
// Container child vbox4.Gtk.Box+BoxChild
- this.checkbuttonAutoSetSearchPatternCasing = new global::Gtk.CheckButton ();
+ this.checkbuttonAutoSetSearchPatternCasing = new global::Gtk.CheckButton();
this.checkbuttonAutoSetSearchPatternCasing.CanFocus = true;
this.checkbuttonAutoSetSearchPatternCasing.Name = "checkbuttonAutoSetSearchPatternCasing";
- this.checkbuttonAutoSetSearchPatternCasing.Label = global::Mono.Unix.Catalog.GetString ("_Automatically set search pattern case sensitivity");
+ this.checkbuttonAutoSetSearchPatternCasing.Label = global::Mono.Unix.Catalog.GetString("_Automatically set search pattern case sensitivity");
this.checkbuttonAutoSetSearchPatternCasing.DrawIndicator = true;
this.checkbuttonAutoSetSearchPatternCasing.UseUnderline = true;
- this.vbox4.Add (this.checkbuttonAutoSetSearchPatternCasing);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.checkbuttonAutoSetSearchPatternCasing]));
+ this.vbox4.Add(this.checkbuttonAutoSetSearchPatternCasing);
+ global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.checkbuttonAutoSetSearchPatternCasing]));
w8.Position = 4;
w8.Expand = false;
w8.Fill = false;
// Container child vbox4.Gtk.Box+BoxChild
- this.checkbuttonGenerateFormattingUndoStep = new global::Gtk.CheckButton ();
+ this.checkbuttonGenerateFormattingUndoStep = new global::Gtk.CheckButton();
this.checkbuttonGenerateFormattingUndoStep.CanFocus = true;
this.checkbuttonGenerateFormattingUndoStep.Name = "checkbuttonGenerateFormattingUndoStep";
- this.checkbuttonGenerateFormattingUndoStep.Label = global::Mono.Unix.Catalog.GetString ("_Generate additional undo steps for formatting");
+ this.checkbuttonGenerateFormattingUndoStep.Label = global::Mono.Unix.Catalog.GetString("_Generate additional undo steps for formatting");
this.checkbuttonGenerateFormattingUndoStep.DrawIndicator = true;
this.checkbuttonGenerateFormattingUndoStep.UseUnderline = true;
- this.vbox4.Add (this.checkbuttonGenerateFormattingUndoStep);
- global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.checkbuttonGenerateFormattingUndoStep]));
+ this.vbox4.Add(this.checkbuttonGenerateFormattingUndoStep);
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.checkbuttonGenerateFormattingUndoStep]));
w9.Position = 5;
w9.Expand = false;
w9.Fill = false;
- this.alignment3.Add (this.vbox4);
- this.vbox1.Add (this.alignment3);
- global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.alignment3]));
- w11.Position = 1;
- w11.Expand = false;
- w11.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.GtkLabel6 = new global::Gtk.Label ();
- this.GtkLabel6.Name = "GtkLabel6";
- this.GtkLabel6.Xalign = 0F;
- this.GtkLabel6.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Indentation</b>");
- this.GtkLabel6.UseMarkup = true;
- this.vbox1.Add (this.GtkLabel6);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkLabel6]));
- w12.Position = 2;
+ // Container child vbox4.Gtk.Box+BoxChild
+ this.checkbuttonEnableSelectionSurrounding = new global::Gtk.CheckButton();
+ this.checkbuttonEnableSelectionSurrounding.CanFocus = true;
+ this.checkbuttonEnableSelectionSurrounding.Name = "checkbuttonEnableSelectionSurrounding";
+ this.checkbuttonEnableSelectionSurrounding.Label = global::Mono.Unix.Catalog.GetString("Enable _selection surrounding keys");
+ this.checkbuttonEnableSelectionSurrounding.DrawIndicator = true;
+ this.checkbuttonEnableSelectionSurrounding.UseUnderline = true;
+ this.vbox4.Add(this.checkbuttonEnableSelectionSurrounding);
+ global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.checkbuttonEnableSelectionSurrounding]));
+ w10.Position = 6;
+ w10.Expand = false;
+ w10.Fill = false;
+ this.alignment3.Add(this.vbox4);
+ this.vbox1.Add(this.alignment3);
+ global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.alignment3]));
+ w12.Position = 1;
w12.Expand = false;
w12.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
- this.GtkAlignment = new global::Gtk.Alignment (0F, 0F, 1F, 1F);
+ this.GtkLabel7 = new global::Gtk.Label();
+ this.GtkLabel7.Name = "GtkLabel7";
+ this.GtkLabel7.Xalign = 0F;
+ this.GtkLabel7.LabelProp = global::Mono.Unix.Catalog.GetString("<b>Indentation</b>");
+ this.GtkLabel7.UseMarkup = true;
+ this.vbox1.Add(this.GtkLabel7);
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.GtkLabel7]));
+ w13.Position = 2;
+ w13.Expand = false;
+ w13.Fill = false;
+ // Container child vbox1.Gtk.Box+BoxChild
+ this.GtkAlignment = new global::Gtk.Alignment(0F, 0F, 1F, 1F);
this.GtkAlignment.Name = "GtkAlignment";
this.GtkAlignment.LeftPadding = ((uint)(12));
// Container child GtkAlignment.Gtk.Container+ContainerChild
- this.vbox2 = new global::Gtk.VBox ();
+ this.vbox2 = new global::Gtk.VBox();
this.vbox2.Name = "vbox2";
this.vbox2.Spacing = 6;
// Container child vbox2.Gtk.Box+BoxChild
- this.hbox1 = new global::Gtk.HBox ();
+ this.hbox1 = new global::Gtk.HBox();
this.hbox1.Name = "hbox1";
this.hbox1.Spacing = 6;
// Container child hbox1.Gtk.Box+BoxChild
- this.label1 = new global::Gtk.Label ();
+ this.label1 = new global::Gtk.Label();
this.label1.Name = "label1";
- this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("_Indentation mode:");
+ this.label1.LabelProp = global::Mono.Unix.Catalog.GetString("_Indentation mode:");
this.label1.UseUnderline = true;
- this.hbox1.Add (this.label1);
- global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label1]));
- w13.Position = 0;
- w13.Expand = false;
- w13.Fill = false;
- // Container child hbox1.Gtk.Box+BoxChild
- this.indentationCombobox = global::Gtk.ComboBox.NewText ();
- this.indentationCombobox.Name = "indentationCombobox";
- this.hbox1.Add (this.indentationCombobox);
- global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.indentationCombobox]));
- w14.Position = 1;
+ this.hbox1.Add(this.label1);
+ global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.label1]));
+ w14.Position = 0;
w14.Expand = false;
w14.Fill = false;
- this.vbox2.Add (this.hbox1);
- global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1]));
- w15.Position = 0;
+ // Container child hbox1.Gtk.Box+BoxChild
+ this.indentationCombobox = global::Gtk.ComboBox.NewText();
+ this.indentationCombobox.Name = "indentationCombobox";
+ this.hbox1.Add(this.indentationCombobox);
+ global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.indentationCombobox]));
+ w15.Position = 1;
w15.Expand = false;
w15.Fill = false;
+ this.vbox2.Add(this.hbox1);
+ global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox1]));
+ w16.Position = 0;
+ w16.Expand = false;
+ w16.Fill = false;
// Container child vbox2.Gtk.Box+BoxChild
- this.tabAsReindentCheckbutton = new global::Gtk.CheckButton ();
+ this.tabAsReindentCheckbutton = new global::Gtk.CheckButton();
this.tabAsReindentCheckbutton.CanFocus = true;
this.tabAsReindentCheckbutton.Name = "tabAsReindentCheckbutton";
- this.tabAsReindentCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("Interpret tab _keystroke as reindent command");
+ this.tabAsReindentCheckbutton.Label = global::Mono.Unix.Catalog.GetString("Interpret tab _keystroke as reindent command");
this.tabAsReindentCheckbutton.DrawIndicator = true;
this.tabAsReindentCheckbutton.UseUnderline = true;
- this.vbox2.Add (this.tabAsReindentCheckbutton);
- global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.tabAsReindentCheckbutton]));
- w16.Position = 1;
- w16.Expand = false;
- w16.Fill = false;
- this.GtkAlignment.Add (this.vbox2);
- this.vbox1.Add (this.GtkAlignment);
- global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkAlignment]));
- w18.Position = 3;
- w18.Expand = false;
- w18.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.GtkLabel8 = new global::Gtk.Label ();
- this.GtkLabel8.Name = "GtkLabel8";
- this.GtkLabel8.Xalign = 0F;
- this.GtkLabel8.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Navigation</b>");
- this.GtkLabel8.UseMarkup = true;
- this.vbox1.Add (this.GtkLabel8);
- global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkLabel8]));
- w19.Position = 4;
+ this.vbox2.Add(this.tabAsReindentCheckbutton);
+ global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.tabAsReindentCheckbutton]));
+ w17.Position = 1;
+ w17.Expand = false;
+ w17.Fill = false;
+ this.GtkAlignment.Add(this.vbox2);
+ this.vbox1.Add(this.GtkAlignment);
+ global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.GtkAlignment]));
+ w19.Position = 3;
w19.Expand = false;
w19.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
- this.alignment4 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
+ this.GtkLabel9 = new global::Gtk.Label();
+ this.GtkLabel9.Name = "GtkLabel9";
+ this.GtkLabel9.Xalign = 0F;
+ this.GtkLabel9.LabelProp = global::Mono.Unix.Catalog.GetString("<b>Navigation</b>");
+ this.GtkLabel9.UseMarkup = true;
+ this.vbox1.Add(this.GtkLabel9);
+ global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.GtkLabel9]));
+ w20.Position = 4;
+ w20.Expand = false;
+ w20.Fill = false;
+ // Container child vbox1.Gtk.Box+BoxChild
+ this.alignment4 = new global::Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
this.alignment4.Name = "alignment4";
this.alignment4.LeftPadding = ((uint)(12));
// Container child alignment4.Gtk.Container+ContainerChild
- this.vbox5 = new global::Gtk.VBox ();
+ this.vbox5 = new global::Gtk.VBox();
this.vbox5.Name = "vbox5";
this.vbox5.Spacing = 6;
// Container child vbox5.Gtk.Box+BoxChild
- this.useViModesCheck = new global::Gtk.CheckButton ();
- this.useViModesCheck.CanFocus = true;
- this.useViModesCheck.Name = "useViModesCheck";
- this.useViModesCheck.Label = global::Mono.Unix.Catalog.GetString ("Use _Vi modes");
- this.useViModesCheck.DrawIndicator = true;
- this.useViModesCheck.UseUnderline = true;
- this.vbox5.Add (this.useViModesCheck);
- global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.useViModesCheck]));
- w20.Position = 0;
- w20.Expand = false;
- w20.Fill = false;
- // Container child vbox5.Gtk.Box+BoxChild
- this.hbox3 = new global::Gtk.HBox ();
+ this.hbox3 = new global::Gtk.HBox();
this.hbox3.Name = "hbox3";
this.hbox3.Spacing = 6;
// Container child hbox3.Gtk.Box+BoxChild
- this.label2 = new global::Gtk.Label ();
+ this.label2 = new global::Gtk.Label();
this.label2.Name = "label2";
- this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Word _break mode:");
+ this.label2.LabelProp = global::Mono.Unix.Catalog.GetString("Word _break mode:");
this.label2.UseUnderline = true;
- this.hbox3.Add (this.label2);
- global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.label2]));
+ this.hbox3.Add(this.label2);
+ global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.label2]));
w21.Position = 0;
w21.Expand = false;
w21.Fill = false;
// Container child hbox3.Gtk.Box+BoxChild
- this.controlLeftRightCombobox = global::Gtk.ComboBox.NewText ();
+ this.controlLeftRightCombobox = global::Gtk.ComboBox.NewText();
this.controlLeftRightCombobox.Name = "controlLeftRightCombobox";
- this.hbox3.Add (this.controlLeftRightCombobox);
- global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.controlLeftRightCombobox]));
+ this.hbox3.Add(this.controlLeftRightCombobox);
+ global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.controlLeftRightCombobox]));
w22.Position = 1;
w22.Expand = false;
w22.Fill = false;
- this.vbox5.Add (this.hbox3);
- global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hbox3]));
- w23.Position = 1;
+ this.vbox5.Add(this.hbox3);
+ global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.hbox3]));
+ w23.Position = 0;
w23.Expand = false;
w23.Fill = false;
- this.alignment4.Add (this.vbox5);
- this.vbox1.Add (this.alignment4);
- global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.alignment4]));
+ this.alignment4.Add(this.vbox5);
+ this.vbox1.Add(this.alignment4);
+ global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.alignment4]));
w25.Position = 5;
w25.Expand = false;
w25.Fill = false;
- this.Add (this.vbox1);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
+ this.Add(this.vbox1);
+ if ((this.Child != null))
+ {
+ this.Child.ShowAll();
}
- this.Show ();
+ this.Show();
}
}
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.ColorShemeEditor.cs b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.ColorShemeEditor.cs
index 4b433ec225..4809dfe38e 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.ColorShemeEditor.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.ColorShemeEditor.cs
@@ -5,46 +5,79 @@ namespace MonoDevelop.SourceEditor.OptionPanels
public partial class ColorShemeEditor
{
private global::Gtk.HBox hbox1;
+
private global::Gtk.Label label2;
+
private global::Gtk.Entry entryName;
+
private global::Gtk.Label label3;
+
private global::Gtk.Entry entryDescription;
+
private global::Gtk.HPaned hpaned1;
+
private global::Gtk.VBox vbox2;
+
private global::Gtk.Label label1;
+
private global::Gtk.ScrolledWindow GtkScrolledWindow;
+
private global::Gtk.TreeView treeviewColors;
+
private global::Gtk.VBox vbox3;
+
private global::Gtk.Notebook notebookColorChooser;
+
private global::Gtk.VBox vbox4;
+
private global::Gtk.Table table1;
+
private global::Gtk.ColorButton colorbuttonBg;
+
private global::Gtk.ColorButton colorbuttonFg;
+
private global::Gtk.Label label5;
+
private global::Gtk.Label label7;
+
private global::Gtk.CheckButton checkbuttonBold;
+
private global::Gtk.CheckButton checkbuttonItalic;
+
private global::Gtk.Label label4;
+
private global::Gtk.VBox vbox5;
+
private global::Gtk.Table table2;
+
private global::Gtk.ColorButton colorbuttonBorder;
+
private global::Gtk.ColorButton colorbuttonPrimary;
+
private global::Gtk.ColorButton colorbuttonSecondary;
+
private global::Gtk.Label label10;
+
private global::Gtk.Label label11;
+
private global::Gtk.Label label9;
+
private global::Gtk.Label label6;
+
private global::Gtk.Label label8;
+
private global::Gtk.ScrolledWindow scrolledwindowTextEditor;
+
private global::Gtk.Button buttonCancel;
+
private global::Gtk.Button buttonOk;
-
- protected virtual void Build ()
+
+ protected virtual void Build()
{
- global::Stetic.Gui.Initialize (this);
+ global::Stetic.Gui.Initialize(this);
// Widget MonoDevelop.SourceEditor.OptionPanels.ColorShemeEditor
this.Name = "MonoDevelop.SourceEditor.OptionPanels.ColorShemeEditor";
- this.Title = global::Mono.Unix.Catalog.GetString ("Edit color sheme");
+ this.Title = global::Mono.Unix.Catalog.GetString("Edit Color Scheme");
this.WindowPosition = ((global::Gtk.WindowPosition)(4));
this.BorderWidth = ((uint)(6));
// Internal child MonoDevelop.SourceEditor.OptionPanels.ColorShemeEditor.VBox
@@ -52,115 +85,116 @@ namespace MonoDevelop.SourceEditor.OptionPanels
w1.Name = "dialog1_VBox";
w1.BorderWidth = ((uint)(2));
// Container child dialog1_VBox.Gtk.Box+BoxChild
- this.hbox1 = new global::Gtk.HBox ();
+ this.hbox1 = new global::Gtk.HBox();
this.hbox1.Name = "hbox1";
this.hbox1.Spacing = 6;
this.hbox1.BorderWidth = ((uint)(6));
// Container child hbox1.Gtk.Box+BoxChild
- this.label2 = new global::Gtk.Label ();
+ this.label2 = new global::Gtk.Label();
this.label2.Name = "label2";
this.label2.Xalign = 0F;
- this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("_Name:");
+ this.label2.LabelProp = global::Mono.Unix.Catalog.GetString("_Name:");
this.label2.UseUnderline = true;
- this.hbox1.Add (this.label2);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label2]));
+ this.hbox1.Add(this.label2);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.label2]));
w2.Position = 0;
w2.Expand = false;
w2.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
- this.entryName = new global::Gtk.Entry ();
+ this.entryName = new global::Gtk.Entry();
this.entryName.CanFocus = true;
this.entryName.Name = "entryName";
this.entryName.IsEditable = true;
this.entryName.InvisibleChar = '●';
- this.hbox1.Add (this.entryName);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.entryName]));
+ this.hbox1.Add(this.entryName);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.entryName]));
w3.Position = 1;
// Container child hbox1.Gtk.Box+BoxChild
- this.label3 = new global::Gtk.Label ();
+ this.label3 = new global::Gtk.Label();
this.label3.Name = "label3";
- this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("_Description:");
+ this.label3.LabelProp = global::Mono.Unix.Catalog.GetString("_Description:");
this.label3.UseUnderline = true;
- this.hbox1.Add (this.label3);
- global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label3]));
+ this.hbox1.Add(this.label3);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.label3]));
w4.Position = 2;
w4.Expand = false;
w4.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
- this.entryDescription = new global::Gtk.Entry ();
+ this.entryDescription = new global::Gtk.Entry();
this.entryDescription.CanFocus = true;
this.entryDescription.Name = "entryDescription";
this.entryDescription.IsEditable = true;
this.entryDescription.InvisibleChar = '●';
- this.hbox1.Add (this.entryDescription);
- global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.entryDescription]));
+ this.hbox1.Add(this.entryDescription);
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.entryDescription]));
w5.Position = 3;
- w1.Add (this.hbox1);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox1]));
+ w1.Add(this.hbox1);
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1[this.hbox1]));
w6.Position = 0;
w6.Expand = false;
w6.Fill = false;
// Container child dialog1_VBox.Gtk.Box+BoxChild
- this.hpaned1 = new global::Gtk.HPaned ();
+ this.hpaned1 = new global::Gtk.HPaned();
this.hpaned1.CanFocus = true;
this.hpaned1.Name = "hpaned1";
this.hpaned1.Position = 415;
// Container child hpaned1.Gtk.Paned+PanedChild
- this.vbox2 = new global::Gtk.VBox ();
+ this.vbox2 = new global::Gtk.VBox();
this.vbox2.Name = "vbox2";
this.vbox2.Spacing = 6;
// Container child vbox2.Gtk.Box+BoxChild
- this.label1 = new global::Gtk.Label ();
+ this.label1 = new global::Gtk.Label();
this.label1.Name = "label1";
this.label1.Xalign = 0F;
- this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("_Colors");
+ this.label1.LabelProp = global::Mono.Unix.Catalog.GetString("_Colors");
this.label1.UseUnderline = true;
- this.vbox2.Add (this.label1);
- global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.label1]));
+ this.vbox2.Add(this.label1);
+ global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.label1]));
w7.Position = 0;
w7.Expand = false;
w7.Fill = false;
// Container child vbox2.Gtk.Box+BoxChild
- this.GtkScrolledWindow = new global::Gtk.ScrolledWindow ();
+ this.GtkScrolledWindow = new global::Gtk.ScrolledWindow();
this.GtkScrolledWindow.Name = "GtkScrolledWindow";
this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
// Container child GtkScrolledWindow.Gtk.Container+ContainerChild
- this.treeviewColors = new global::Gtk.TreeView ();
+ this.treeviewColors = new global::Gtk.TreeView();
this.treeviewColors.CanFocus = true;
this.treeviewColors.Name = "treeviewColors";
- this.GtkScrolledWindow.Add (this.treeviewColors);
- this.vbox2.Add (this.GtkScrolledWindow);
- global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.GtkScrolledWindow]));
+ this.GtkScrolledWindow.Add(this.treeviewColors);
+ this.vbox2.Add(this.GtkScrolledWindow);
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.GtkScrolledWindow]));
w9.Position = 1;
- this.hpaned1.Add (this.vbox2);
- global::Gtk.Paned.PanedChild w10 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.vbox2]));
+ this.hpaned1.Add(this.vbox2);
+ global::Gtk.Paned.PanedChild w10 = ((global::Gtk.Paned.PanedChild)(this.hpaned1[this.vbox2]));
w10.Resize = false;
// Container child hpaned1.Gtk.Paned+PanedChild
- this.vbox3 = new global::Gtk.VBox ();
+ this.vbox3 = new global::Gtk.VBox();
this.vbox3.Name = "vbox3";
this.vbox3.Spacing = 6;
// Container child vbox3.Gtk.Box+BoxChild
- this.notebookColorChooser = new global::Gtk.Notebook ();
+ this.notebookColorChooser = new global::Gtk.Notebook();
this.notebookColorChooser.CanFocus = true;
this.notebookColorChooser.Name = "notebookColorChooser";
this.notebookColorChooser.CurrentPage = 1;
this.notebookColorChooser.ShowBorder = false;
this.notebookColorChooser.BorderWidth = ((uint)(8));
// Container child notebookColorChooser.Gtk.Notebook+NotebookChild
- this.vbox4 = new global::Gtk.VBox ();
+ this.vbox4 = new global::Gtk.VBox();
this.vbox4.Name = "vbox4";
this.vbox4.Spacing = 6;
// Container child vbox4.Gtk.Box+BoxChild
- this.table1 = new global::Gtk.Table (((uint)(2)), ((uint)(2)), false);
+ this.table1 = new global::Gtk.Table(((uint)(2)), ((uint)(2)), false);
+ this.table1.Name = "table1";
this.table1.RowSpacing = ((uint)(6));
this.table1.ColumnSpacing = ((uint)(6));
// Container child table1.Gtk.Table+TableChild
- this.colorbuttonBg = new global::Gtk.ColorButton ();
+ this.colorbuttonBg = new global::Gtk.ColorButton();
this.colorbuttonBg.CanFocus = true;
this.colorbuttonBg.Events = ((global::Gdk.EventMask)(784));
this.colorbuttonBg.Name = "colorbuttonBg";
- this.table1.Add (this.colorbuttonBg);
- global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table1 [this.colorbuttonBg]));
+ this.table1.Add(this.colorbuttonBg);
+ global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table1[this.colorbuttonBg]));
w11.TopAttach = ((uint)(1));
w11.BottomAttach = ((uint)(2));
w11.LeftAttach = ((uint)(1));
@@ -168,90 +202,90 @@ namespace MonoDevelop.SourceEditor.OptionPanels
w11.XOptions = ((global::Gtk.AttachOptions)(4));
w11.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
- this.colorbuttonFg = new global::Gtk.ColorButton ();
+ this.colorbuttonFg = new global::Gtk.ColorButton();
this.colorbuttonFg.CanFocus = true;
this.colorbuttonFg.Events = ((global::Gdk.EventMask)(784));
this.colorbuttonFg.Name = "colorbuttonFg";
- this.table1.Add (this.colorbuttonFg);
- global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table1 [this.colorbuttonFg]));
+ this.table1.Add(this.colorbuttonFg);
+ global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table1[this.colorbuttonFg]));
w12.LeftAttach = ((uint)(1));
w12.RightAttach = ((uint)(2));
w12.XOptions = ((global::Gtk.AttachOptions)(4));
w12.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
- this.label5 = new global::Gtk.Label ();
+ this.label5 = new global::Gtk.Label();
this.label5.Name = "label5";
this.label5.Xalign = 1F;
- this.label5.LabelProp = global::Mono.Unix.Catalog.GetString ("_Background:");
+ this.label5.LabelProp = global::Mono.Unix.Catalog.GetString("_Background:");
this.label5.UseUnderline = true;
- this.table1.Add (this.label5);
- global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table1 [this.label5]));
+ this.table1.Add(this.label5);
+ global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table1[this.label5]));
w13.TopAttach = ((uint)(1));
w13.BottomAttach = ((uint)(2));
w13.XOptions = ((global::Gtk.AttachOptions)(4));
w13.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
- this.label7 = new global::Gtk.Label ();
+ this.label7 = new global::Gtk.Label();
this.label7.Name = "label7";
this.label7.Xalign = 1F;
- this.label7.LabelProp = global::Mono.Unix.Catalog.GetString ("_Foreground:");
+ this.label7.LabelProp = global::Mono.Unix.Catalog.GetString("_Foreground:");
this.label7.UseUnderline = true;
- this.table1.Add (this.label7);
- global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table1 [this.label7]));
+ this.table1.Add(this.label7);
+ global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table1[this.label7]));
w14.XOptions = ((global::Gtk.AttachOptions)(4));
w14.YOptions = ((global::Gtk.AttachOptions)(4));
- this.vbox4.Add (this.table1);
- global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.table1]));
+ this.vbox4.Add(this.table1);
+ global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.table1]));
w15.Position = 0;
w15.Expand = false;
w15.Fill = false;
// Container child vbox4.Gtk.Box+BoxChild
- this.checkbuttonBold = new global::Gtk.CheckButton ();
+ this.checkbuttonBold = new global::Gtk.CheckButton();
this.checkbuttonBold.CanFocus = true;
this.checkbuttonBold.Name = "checkbuttonBold";
- this.checkbuttonBold.Label = global::Mono.Unix.Catalog.GetString ("B_old");
+ this.checkbuttonBold.Label = global::Mono.Unix.Catalog.GetString("B_old");
this.checkbuttonBold.DrawIndicator = true;
this.checkbuttonBold.UseUnderline = true;
- this.vbox4.Add (this.checkbuttonBold);
- global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.checkbuttonBold]));
+ this.vbox4.Add(this.checkbuttonBold);
+ global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.checkbuttonBold]));
w16.Position = 1;
w16.Expand = false;
w16.Fill = false;
// Container child vbox4.Gtk.Box+BoxChild
- this.checkbuttonItalic = new global::Gtk.CheckButton ();
+ this.checkbuttonItalic = new global::Gtk.CheckButton();
this.checkbuttonItalic.CanFocus = true;
this.checkbuttonItalic.Name = "checkbuttonItalic";
- this.checkbuttonItalic.Label = global::Mono.Unix.Catalog.GetString ("Italic");
+ this.checkbuttonItalic.Label = global::Mono.Unix.Catalog.GetString("Italic");
this.checkbuttonItalic.DrawIndicator = true;
this.checkbuttonItalic.UseUnderline = true;
- this.vbox4.Add (this.checkbuttonItalic);
- global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.checkbuttonItalic]));
+ this.vbox4.Add(this.checkbuttonItalic);
+ global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.checkbuttonItalic]));
w17.Position = 2;
w17.Expand = false;
w17.Fill = false;
- this.notebookColorChooser.Add (this.vbox4);
+ this.notebookColorChooser.Add(this.vbox4);
// Notebook tab
- this.label4 = new global::Gtk.Label ();
+ this.label4 = new global::Gtk.Label();
this.label4.Name = "label4";
- this.label4.LabelProp = global::Mono.Unix.Catalog.GetString ("page1");
- this.notebookColorChooser.SetTabLabel (this.vbox4, this.label4);
- this.label4.ShowAll ();
+ this.label4.LabelProp = global::Mono.Unix.Catalog.GetString("page1");
+ this.notebookColorChooser.SetTabLabel(this.vbox4, this.label4);
+ this.label4.ShowAll();
// Container child notebookColorChooser.Gtk.Notebook+NotebookChild
- this.vbox5 = new global::Gtk.VBox ();
+ this.vbox5 = new global::Gtk.VBox();
this.vbox5.Name = "vbox5";
this.vbox5.Spacing = 6;
// Container child vbox5.Gtk.Box+BoxChild
- this.table2 = new global::Gtk.Table (((uint)(3)), ((uint)(2)), false);
+ this.table2 = new global::Gtk.Table(((uint)(3)), ((uint)(2)), false);
this.table2.Name = "table2";
this.table2.RowSpacing = ((uint)(6));
this.table2.ColumnSpacing = ((uint)(6));
// Container child table2.Gtk.Table+TableChild
- this.colorbuttonBorder = new global::Gtk.ColorButton ();
+ this.colorbuttonBorder = new global::Gtk.ColorButton();
this.colorbuttonBorder.CanFocus = true;
this.colorbuttonBorder.Events = ((global::Gdk.EventMask)(784));
this.colorbuttonBorder.Name = "colorbuttonBorder";
- this.table2.Add (this.colorbuttonBorder);
- global::Gtk.Table.TableChild w19 = ((global::Gtk.Table.TableChild)(this.table2 [this.colorbuttonBorder]));
+ this.table2.Add(this.colorbuttonBorder);
+ global::Gtk.Table.TableChild w19 = ((global::Gtk.Table.TableChild)(this.table2[this.colorbuttonBorder]));
w19.TopAttach = ((uint)(2));
w19.BottomAttach = ((uint)(3));
w19.LeftAttach = ((uint)(1));
@@ -259,23 +293,23 @@ namespace MonoDevelop.SourceEditor.OptionPanels
w19.XOptions = ((global::Gtk.AttachOptions)(4));
w19.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table2.Gtk.Table+TableChild
- this.colorbuttonPrimary = new global::Gtk.ColorButton ();
+ this.colorbuttonPrimary = new global::Gtk.ColorButton();
this.colorbuttonPrimary.CanFocus = true;
this.colorbuttonPrimary.Events = ((global::Gdk.EventMask)(784));
this.colorbuttonPrimary.Name = "colorbuttonPrimary";
- this.table2.Add (this.colorbuttonPrimary);
- global::Gtk.Table.TableChild w20 = ((global::Gtk.Table.TableChild)(this.table2 [this.colorbuttonPrimary]));
+ this.table2.Add(this.colorbuttonPrimary);
+ global::Gtk.Table.TableChild w20 = ((global::Gtk.Table.TableChild)(this.table2[this.colorbuttonPrimary]));
w20.LeftAttach = ((uint)(1));
w20.RightAttach = ((uint)(2));
w20.XOptions = ((global::Gtk.AttachOptions)(4));
w20.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table2.Gtk.Table+TableChild
- this.colorbuttonSecondary = new global::Gtk.ColorButton ();
+ this.colorbuttonSecondary = new global::Gtk.ColorButton();
this.colorbuttonSecondary.CanFocus = true;
this.colorbuttonSecondary.Events = ((global::Gdk.EventMask)(784));
this.colorbuttonSecondary.Name = "colorbuttonSecondary";
- this.table2.Add (this.colorbuttonSecondary);
- global::Gtk.Table.TableChild w21 = ((global::Gtk.Table.TableChild)(this.table2 [this.colorbuttonSecondary]));
+ this.table2.Add(this.colorbuttonSecondary);
+ global::Gtk.Table.TableChild w21 = ((global::Gtk.Table.TableChild)(this.table2[this.colorbuttonSecondary]));
w21.TopAttach = ((uint)(1));
w21.BottomAttach = ((uint)(2));
w21.LeftAttach = ((uint)(1));
@@ -283,80 +317,80 @@ namespace MonoDevelop.SourceEditor.OptionPanels
w21.XOptions = ((global::Gtk.AttachOptions)(4));
w21.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table2.Gtk.Table+TableChild
- this.label10 = new global::Gtk.Label ();
+ this.label10 = new global::Gtk.Label();
this.label10.Name = "label10";
this.label10.Xalign = 1F;
- this.label10.LabelProp = global::Mono.Unix.Catalog.GetString ("_Secondary Color:");
+ this.label10.LabelProp = global::Mono.Unix.Catalog.GetString("_Secondary Color:");
this.label10.UseUnderline = true;
- this.table2.Add (this.label10);
- global::Gtk.Table.TableChild w22 = ((global::Gtk.Table.TableChild)(this.table2 [this.label10]));
+ this.table2.Add(this.label10);
+ global::Gtk.Table.TableChild w22 = ((global::Gtk.Table.TableChild)(this.table2[this.label10]));
w22.TopAttach = ((uint)(1));
w22.BottomAttach = ((uint)(2));
w22.XOptions = ((global::Gtk.AttachOptions)(4));
w22.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table2.Gtk.Table+TableChild
- this.label11 = new global::Gtk.Label ();
+ this.label11 = new global::Gtk.Label();
this.label11.Name = "label11";
this.label11.Xalign = 1F;
- this.label11.LabelProp = global::Mono.Unix.Catalog.GetString ("_Border Color:");
+ this.label11.LabelProp = global::Mono.Unix.Catalog.GetString("_Border Color:");
this.label11.UseUnderline = true;
- this.table2.Add (this.label11);
- global::Gtk.Table.TableChild w23 = ((global::Gtk.Table.TableChild)(this.table2 [this.label11]));
+ this.table2.Add(this.label11);
+ global::Gtk.Table.TableChild w23 = ((global::Gtk.Table.TableChild)(this.table2[this.label11]));
w23.TopAttach = ((uint)(2));
w23.BottomAttach = ((uint)(3));
w23.XOptions = ((global::Gtk.AttachOptions)(4));
w23.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table2.Gtk.Table+TableChild
- this.label9 = new global::Gtk.Label ();
+ this.label9 = new global::Gtk.Label();
this.label9.Name = "label9";
this.label9.Xalign = 1F;
- this.label9.LabelProp = global::Mono.Unix.Catalog.GetString ("_Primary Color:");
+ this.label9.LabelProp = global::Mono.Unix.Catalog.GetString("_Primary Color:");
this.label9.UseUnderline = true;
- this.table2.Add (this.label9);
- global::Gtk.Table.TableChild w24 = ((global::Gtk.Table.TableChild)(this.table2 [this.label9]));
+ this.table2.Add(this.label9);
+ global::Gtk.Table.TableChild w24 = ((global::Gtk.Table.TableChild)(this.table2[this.label9]));
w24.XOptions = ((global::Gtk.AttachOptions)(4));
w24.YOptions = ((global::Gtk.AttachOptions)(4));
- this.vbox5.Add (this.table2);
- global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.table2]));
+ this.vbox5.Add(this.table2);
+ global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.table2]));
w25.Position = 0;
w25.Expand = false;
w25.Fill = false;
- this.notebookColorChooser.Add (this.vbox5);
- global::Gtk.Notebook.NotebookChild w26 = ((global::Gtk.Notebook.NotebookChild)(this.notebookColorChooser [this.vbox5]));
+ this.notebookColorChooser.Add(this.vbox5);
+ global::Gtk.Notebook.NotebookChild w26 = ((global::Gtk.Notebook.NotebookChild)(this.notebookColorChooser[this.vbox5]));
w26.Position = 1;
// Notebook tab
- this.label6 = new global::Gtk.Label ();
+ this.label6 = new global::Gtk.Label();
this.label6.Name = "label6";
- this.label6.LabelProp = global::Mono.Unix.Catalog.GetString ("page2");
- this.notebookColorChooser.SetTabLabel (this.vbox5, this.label6);
- this.label6.ShowAll ();
- this.vbox3.Add (this.notebookColorChooser);
- global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.notebookColorChooser]));
+ this.label6.LabelProp = global::Mono.Unix.Catalog.GetString("page2");
+ this.notebookColorChooser.SetTabLabel(this.vbox5, this.label6);
+ this.label6.ShowAll();
+ this.vbox3.Add(this.notebookColorChooser);
+ global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.notebookColorChooser]));
w27.Position = 0;
w27.Expand = false;
w27.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
- this.label8 = new global::Gtk.Label ();
+ this.label8 = new global::Gtk.Label();
this.label8.Name = "label8";
this.label8.Xalign = 0F;
- this.label8.LabelProp = global::Mono.Unix.Catalog.GetString ("_Preview:");
+ this.label8.LabelProp = global::Mono.Unix.Catalog.GetString("_Preview:");
this.label8.UseUnderline = true;
- this.vbox3.Add (this.label8);
- global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.label8]));
+ this.vbox3.Add(this.label8);
+ global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.label8]));
w28.Position = 1;
w28.Expand = false;
w28.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
- this.scrolledwindowTextEditor = new global::Gtk.ScrolledWindow ();
+ this.scrolledwindowTextEditor = new global::Gtk.ScrolledWindow();
this.scrolledwindowTextEditor.CanFocus = true;
this.scrolledwindowTextEditor.Name = "scrolledwindowTextEditor";
this.scrolledwindowTextEditor.ShadowType = ((global::Gtk.ShadowType)(1));
- this.vbox3.Add (this.scrolledwindowTextEditor);
- global::Gtk.Box.BoxChild w29 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.scrolledwindowTextEditor]));
+ this.vbox3.Add(this.scrolledwindowTextEditor);
+ global::Gtk.Box.BoxChild w29 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.scrolledwindowTextEditor]));
w29.Position = 2;
- this.hpaned1.Add (this.vbox3);
- w1.Add (this.hpaned1);
- global::Gtk.Box.BoxChild w31 = ((global::Gtk.Box.BoxChild)(w1 [this.hpaned1]));
+ this.hpaned1.Add(this.vbox3);
+ w1.Add(this.hpaned1);
+ global::Gtk.Box.BoxChild w31 = ((global::Gtk.Box.BoxChild)(w1[this.hpaned1]));
w31.Position = 1;
// Internal child MonoDevelop.SourceEditor.OptionPanels.ColorShemeEditor.ActionArea
global::Gtk.HButtonBox w32 = this.ActionArea;
@@ -365,38 +399,39 @@ namespace MonoDevelop.SourceEditor.OptionPanels
w32.BorderWidth = ((uint)(5));
w32.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
- this.buttonCancel = new global::Gtk.Button ();
+ this.buttonCancel = new global::Gtk.Button();
this.buttonCancel.CanDefault = true;
this.buttonCancel.CanFocus = true;
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.UseStock = true;
this.buttonCancel.UseUnderline = true;
this.buttonCancel.Label = "gtk-cancel";
- this.AddActionWidget (this.buttonCancel, -6);
- global::Gtk.ButtonBox.ButtonBoxChild w33 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w32 [this.buttonCancel]));
+ this.AddActionWidget(this.buttonCancel, -6);
+ global::Gtk.ButtonBox.ButtonBoxChild w33 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w32[this.buttonCancel]));
w33.Expand = false;
w33.Fill = false;
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
- this.buttonOk = new global::Gtk.Button ();
+ this.buttonOk = new global::Gtk.Button();
this.buttonOk.CanDefault = true;
this.buttonOk.CanFocus = true;
this.buttonOk.Name = "buttonOk";
this.buttonOk.UseStock = true;
this.buttonOk.UseUnderline = true;
this.buttonOk.Label = "gtk-ok";
- this.AddActionWidget (this.buttonOk, -5);
- global::Gtk.ButtonBox.ButtonBoxChild w34 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w32 [this.buttonOk]));
+ this.AddActionWidget(this.buttonOk, -5);
+ global::Gtk.ButtonBox.ButtonBoxChild w34 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w32[this.buttonOk]));
w34.Position = 1;
w34.Expand = false;
w34.Fill = false;
- if ((this.Child != null)) {
- this.Child.ShowAll ();
+ if ((this.Child != null))
+ {
+ this.Child.ShowAll();
}
this.DefaultWidth = 760;
this.DefaultHeight = 458;
this.label2.MnemonicWidget = this.entryName;
this.label3.MnemonicWidget = this.entryDescription;
- this.Show ();
+ this.Show();
}
}
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.CompletionAppearancePanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.CompletionAppearancePanel.cs
index 2ec1f37faa..5bce3c3b27 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.CompletionAppearancePanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.CompletionAppearancePanel.cs
@@ -2,196 +2,167 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.SourceEditor.OptionPanels
{
- internal partial class CompletionAppearancePanel
+ public partial class CompletionAppearancePanel
{
private global::Gtk.VBox vbox1;
- private global::Gtk.HBox hbox1;
- private global::Gtk.Label label2;
- private global::Gtk.SpinButton spinbutton1;
- private global::Gtk.Label label3;
+
private global::Gtk.Alignment alignment3;
+
private global::Gtk.VBox vbox5;
+
private global::Gtk.CheckButton filterByBrowsableCheckbutton;
+
private global::Gtk.HBox hbox2;
+
private global::Gtk.Fixed fixed1;
+
private global::Gtk.RadioButton normalOnlyRadiobutton;
+
private global::Gtk.Alignment alignment1;
+
private global::Gtk.Label label4;
+
private global::Gtk.HBox hbox3;
+
private global::Gtk.Fixed fixed2;
+
private global::Gtk.RadioButton includeAdvancedRadiobutton;
+
private global::Gtk.Alignment alignment2;
+
private global::Gtk.Label label5;
- protected virtual void Build ()
+ protected virtual void Build()
{
- global::Stetic.Gui.Initialize (this);
+ global::Stetic.Gui.Initialize(this);
// Widget MonoDevelop.SourceEditor.OptionPanels.CompletionAppearancePanel
- global::Stetic.BinContainer.Attach (this);
+ global::Stetic.BinContainer.Attach(this);
this.Name = "MonoDevelop.SourceEditor.OptionPanels.CompletionAppearancePanel";
// Container child MonoDevelop.SourceEditor.OptionPanels.CompletionAppearancePanel.Gtk.Container+ContainerChild
- this.vbox1 = new global::Gtk.VBox ();
+ this.vbox1 = new global::Gtk.VBox();
this.vbox1.Name = "vbox1";
this.vbox1.Spacing = 6;
// Container child vbox1.Gtk.Box+BoxChild
- this.hbox1 = new global::Gtk.HBox ();
- this.hbox1.Name = "hbox1";
- this.hbox1.Spacing = 6;
- // Container child hbox1.Gtk.Box+BoxChild
- this.label2 = new global::Gtk.Label ();
- this.label2.Name = "label2";
- this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Completion list has");
- this.hbox1.Add (this.label2);
- global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label2]));
- w1.Position = 0;
- w1.Expand = false;
- w1.Fill = false;
- // Container child hbox1.Gtk.Box+BoxChild
- this.spinbutton1 = new global::Gtk.SpinButton (0, 100, 1);
- this.spinbutton1.CanFocus = true;
- this.spinbutton1.Name = "spinbutton1";
- this.spinbutton1.Adjustment.PageIncrement = 10;
- this.spinbutton1.ClimbRate = 1;
- this.spinbutton1.Numeric = true;
- this.hbox1.Add (this.spinbutton1);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.spinbutton1]));
- w2.Position = 1;
- w2.Expand = false;
- w2.Fill = false;
- // Container child hbox1.Gtk.Box+BoxChild
- this.label3 = new global::Gtk.Label ();
- this.label3.Name = "label3";
- this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("rows");
- this.hbox1.Add (this.label3);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label3]));
- w3.Position = 2;
- w3.Expand = false;
- w3.Fill = false;
- this.vbox1.Add (this.hbox1);
- global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox1]));
- w4.Position = 0;
- w4.Expand = false;
- w4.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.alignment3 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
+ this.alignment3 = new global::Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
this.alignment3.Name = "alignment3";
this.alignment3.LeftPadding = ((uint)(12));
// Container child alignment3.Gtk.Container+ContainerChild
- this.vbox5 = new global::Gtk.VBox ();
+ this.vbox5 = new global::Gtk.VBox();
this.vbox5.Name = "vbox5";
this.vbox5.Spacing = 6;
// Container child vbox5.Gtk.Box+BoxChild
- this.filterByBrowsableCheckbutton = new global::Gtk.CheckButton ();
+ this.filterByBrowsableCheckbutton = new global::Gtk.CheckButton();
this.filterByBrowsableCheckbutton.CanFocus = true;
this.filterByBrowsableCheckbutton.Name = "filterByBrowsableCheckbutton";
- this.filterByBrowsableCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Filter members by [EditorBrowsable] attribute");
+ this.filterByBrowsableCheckbutton.Label = global::Mono.Unix.Catalog.GetString("_Filter members by [EditorBrowsable] attribute");
this.filterByBrowsableCheckbutton.Active = true;
this.filterByBrowsableCheckbutton.DrawIndicator = true;
this.filterByBrowsableCheckbutton.UseUnderline = true;
- this.vbox5.Add (this.filterByBrowsableCheckbutton);
- global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.filterByBrowsableCheckbutton]));
- w5.Position = 0;
- w5.Expand = false;
- w5.Fill = false;
+ this.vbox5.Add(this.filterByBrowsableCheckbutton);
+ global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.filterByBrowsableCheckbutton]));
+ w1.Position = 0;
+ w1.Expand = false;
+ w1.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
- this.hbox2 = new global::Gtk.HBox ();
+ this.hbox2 = new global::Gtk.HBox();
this.hbox2.Name = "hbox2";
this.hbox2.Spacing = 6;
// Container child hbox2.Gtk.Box+BoxChild
- this.fixed1 = new global::Gtk.Fixed ();
+ this.fixed1 = new global::Gtk.Fixed();
this.fixed1.Name = "fixed1";
this.fixed1.HasWindow = false;
- this.hbox2.Add (this.fixed1);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.fixed1]));
- w6.Position = 0;
- w6.Expand = false;
- w6.Padding = ((uint)(6));
+ this.hbox2.Add(this.fixed1);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.fixed1]));
+ w2.Position = 0;
+ w2.Expand = false;
+ w2.Padding = ((uint)(6));
// Container child hbox2.Gtk.Box+BoxChild
- this.normalOnlyRadiobutton = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("_Show Normal members only"));
+ this.normalOnlyRadiobutton = new global::Gtk.RadioButton(global::Mono.Unix.Catalog.GetString("_Show Normal members only"));
this.normalOnlyRadiobutton.CanFocus = true;
this.normalOnlyRadiobutton.Name = "normalOnlyRadiobutton";
this.normalOnlyRadiobutton.DrawIndicator = true;
this.normalOnlyRadiobutton.UseUnderline = true;
- this.normalOnlyRadiobutton.Group = new global::GLib.SList (global::System.IntPtr.Zero);
- this.hbox2.Add (this.normalOnlyRadiobutton);
- global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.normalOnlyRadiobutton]));
- w7.Position = 1;
- this.vbox5.Add (this.hbox2);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hbox2]));
- w8.Position = 1;
- w8.Expand = false;
- w8.Fill = false;
+ this.normalOnlyRadiobutton.Group = new global::GLib.SList(global::System.IntPtr.Zero);
+ this.hbox2.Add(this.normalOnlyRadiobutton);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.normalOnlyRadiobutton]));
+ w3.Position = 1;
+ this.vbox5.Add(this.hbox2);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.hbox2]));
+ w4.Position = 1;
+ w4.Expand = false;
+ w4.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
- this.alignment1 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
+ this.alignment1 = new global::Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
this.alignment1.Name = "alignment1";
this.alignment1.LeftPadding = ((uint)(38));
// Container child alignment1.Gtk.Container+ContainerChild
- this.label4 = new global::Gtk.Label ();
+ this.label4 = new global::Gtk.Label();
this.label4.Name = "label4";
this.label4.Xalign = 0F;
- this.label4.LabelProp = global::Mono.Unix.Catalog.GetString ("<i>EditorBrowsableState.Always</i>");
+ this.label4.LabelProp = global::Mono.Unix.Catalog.GetString("<i>EditorBrowsableState.Always</i>");
this.label4.UseMarkup = true;
- this.alignment1.Add (this.label4);
- this.vbox5.Add (this.alignment1);
- global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.alignment1]));
- w10.Position = 2;
- w10.Expand = false;
- w10.Fill = false;
+ this.alignment1.Add(this.label4);
+ this.vbox5.Add(this.alignment1);
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.alignment1]));
+ w6.Position = 2;
+ w6.Expand = false;
+ w6.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
- this.hbox3 = new global::Gtk.HBox ();
+ this.hbox3 = new global::Gtk.HBox();
this.hbox3.Name = "hbox3";
this.hbox3.Spacing = 6;
// Container child hbox3.Gtk.Box+BoxChild
- this.fixed2 = new global::Gtk.Fixed ();
+ this.fixed2 = new global::Gtk.Fixed();
this.fixed2.Name = "fixed2";
this.fixed2.HasWindow = false;
- this.hbox3.Add (this.fixed2);
- global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.fixed2]));
- w11.Position = 0;
- w11.Expand = false;
- w11.Padding = ((uint)(6));
+ this.hbox3.Add(this.fixed2);
+ global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.fixed2]));
+ w7.Position = 0;
+ w7.Expand = false;
+ w7.Padding = ((uint)(6));
// Container child hbox3.Gtk.Box+BoxChild
- this.includeAdvancedRadiobutton = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("Show Normal and _Advanced members"));
+ this.includeAdvancedRadiobutton = new global::Gtk.RadioButton(global::Mono.Unix.Catalog.GetString("Show Normal and _Advanced members"));
this.includeAdvancedRadiobutton.CanFocus = true;
this.includeAdvancedRadiobutton.Name = "includeAdvancedRadiobutton";
this.includeAdvancedRadiobutton.DrawIndicator = true;
this.includeAdvancedRadiobutton.UseUnderline = true;
this.includeAdvancedRadiobutton.Group = this.normalOnlyRadiobutton.Group;
- this.hbox3.Add (this.includeAdvancedRadiobutton);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.includeAdvancedRadiobutton]));
- w12.Position = 1;
- this.vbox5.Add (this.hbox3);
- global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hbox3]));
- w13.Position = 3;
- w13.Expand = false;
- w13.Fill = false;
+ this.hbox3.Add(this.includeAdvancedRadiobutton);
+ global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.includeAdvancedRadiobutton]));
+ w8.Position = 1;
+ this.vbox5.Add(this.hbox3);
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.hbox3]));
+ w9.Position = 3;
+ w9.Expand = false;
+ w9.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
- this.alignment2 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
+ this.alignment2 = new global::Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
this.alignment2.Name = "alignment2";
this.alignment2.LeftPadding = ((uint)(38));
// Container child alignment2.Gtk.Container+ContainerChild
- this.label5 = new global::Gtk.Label ();
+ this.label5 = new global::Gtk.Label();
this.label5.Name = "label5";
this.label5.Xalign = 0F;
- this.label5.LabelProp = global::Mono.Unix.Catalog.GetString ("<i>EditorBrowsableState.Always and EditorBrowsableState.Advanced</i>");
+ this.label5.LabelProp = global::Mono.Unix.Catalog.GetString("<i>EditorBrowsableState.Always and EditorBrowsableState.Advanced</i>");
this.label5.UseMarkup = true;
- this.alignment2.Add (this.label5);
- this.vbox5.Add (this.alignment2);
- global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.alignment2]));
- w15.Position = 4;
- w15.Expand = false;
- w15.Fill = false;
- this.alignment3.Add (this.vbox5);
- this.vbox1.Add (this.alignment3);
- global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.alignment3]));
- w17.Position = 1;
- w17.Expand = false;
- w17.Fill = false;
- this.Add (this.vbox1);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
+ this.alignment2.Add(this.label5);
+ this.vbox5.Add(this.alignment2);
+ global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.alignment2]));
+ w11.Position = 4;
+ w11.Expand = false;
+ w11.Fill = false;
+ this.alignment3.Add(this.vbox5);
+ this.vbox1.Add(this.alignment3);
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.alignment3]));
+ w13.Position = 0;
+ w13.Expand = false;
+ w13.Fill = false;
+ this.Add(this.vbox1);
+ if ((this.Child != null))
+ {
+ this.Child.ShowAll();
}
- this.Hide ();
+ this.Hide();
}
}
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.CompletionOptionsPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.CompletionOptionsPanel.cs
index 7b6d6bd809..2676db7750 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.CompletionOptionsPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.CompletionOptionsPanel.cs
@@ -5,201 +5,220 @@ namespace MonoDevelop.SourceEditor.OptionPanels
internal partial class CompletionOptionsPanel
{
private global::Gtk.VBox vbox1;
+
private global::Gtk.Alignment alignment3;
+
private global::Gtk.VBox vbox5;
+
private global::Gtk.CheckButton autoCodeCompletionCheckbutton;
+
private global::Gtk.HBox hbox4;
+
private global::Gtk.Fixed fixed3;
+
private global::Gtk.CheckButton includeKeywordsCheckbutton;
+
private global::Gtk.HBox hbox5;
+
private global::Gtk.Fixed fixed4;
+
private global::Gtk.CheckButton includeCodeSnippetsCheckbutton;
+
private global::Gtk.CheckButton showImportsCheckbutton;
+
private global::Gtk.CheckButton insertParenthesesCheckbutton;
+
private global::Gtk.HBox hbox2;
+
private global::Gtk.Fixed fixed1;
+
private global::Gtk.RadioButton openingRadiobutton;
+
private global::Gtk.HBox hbox3;
+
private global::Gtk.Fixed fixed2;
+
private global::Gtk.RadioButton bothRadiobutton;
- protected virtual void Build ()
+ protected virtual void Build()
{
- global::Stetic.Gui.Initialize (this);
+ global::Stetic.Gui.Initialize(this);
// Widget MonoDevelop.SourceEditor.OptionPanels.CompletionOptionsPanel
- global::Stetic.BinContainer.Attach (this);
+ global::Stetic.BinContainer.Attach(this);
this.Name = "MonoDevelop.SourceEditor.OptionPanels.CompletionOptionsPanel";
// Container child MonoDevelop.SourceEditor.OptionPanels.CompletionOptionsPanel.Gtk.Container+ContainerChild
- this.vbox1 = new global::Gtk.VBox ();
+ this.vbox1 = new global::Gtk.VBox();
this.vbox1.Name = "vbox1";
this.vbox1.Spacing = 6;
// Container child vbox1.Gtk.Box+BoxChild
- this.alignment3 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
+ this.alignment3 = new global::Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
this.alignment3.Name = "alignment3";
this.alignment3.LeftPadding = ((uint)(12));
// Container child alignment3.Gtk.Container+ContainerChild
- this.vbox5 = new global::Gtk.VBox ();
+ this.vbox5 = new global::Gtk.VBox();
this.vbox5.Name = "vbox5";
this.vbox5.Spacing = 6;
// Container child vbox5.Gtk.Box+BoxChild
- this.autoCodeCompletionCheckbutton = new global::Gtk.CheckButton ();
+ this.autoCodeCompletionCheckbutton = new global::Gtk.CheckButton();
this.autoCodeCompletionCheckbutton.CanFocus = true;
this.autoCodeCompletionCheckbutton.Name = "autoCodeCompletionCheckbutton";
- this.autoCodeCompletionCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Show completion list after a character is typed");
+ this.autoCodeCompletionCheckbutton.Label = global::Mono.Unix.Catalog.GetString("_Show completion list after a character is typed");
this.autoCodeCompletionCheckbutton.DrawIndicator = true;
this.autoCodeCompletionCheckbutton.UseUnderline = true;
- this.vbox5.Add (this.autoCodeCompletionCheckbutton);
- global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.autoCodeCompletionCheckbutton]));
+ this.vbox5.Add(this.autoCodeCompletionCheckbutton);
+ global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.autoCodeCompletionCheckbutton]));
w1.Position = 0;
w1.Expand = false;
w1.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
- this.hbox4 = new global::Gtk.HBox ();
+ this.hbox4 = new global::Gtk.HBox();
this.hbox4.Name = "hbox4";
this.hbox4.Spacing = 6;
// Container child hbox4.Gtk.Box+BoxChild
- this.fixed3 = new global::Gtk.Fixed ();
+ this.fixed3 = new global::Gtk.Fixed();
this.fixed3.Name = "fixed3";
this.fixed3.HasWindow = false;
- this.hbox4.Add (this.fixed3);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.fixed3]));
+ this.hbox4.Add(this.fixed3);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox4[this.fixed3]));
w2.Position = 0;
w2.Expand = false;
w2.Padding = ((uint)(6));
// Container child hbox4.Gtk.Box+BoxChild
- this.includeKeywordsCheckbutton = new global::Gtk.CheckButton ();
+ this.includeKeywordsCheckbutton = new global::Gtk.CheckButton();
this.includeKeywordsCheckbutton.CanFocus = true;
this.includeKeywordsCheckbutton.Name = "includeKeywordsCheckbutton";
- this.includeKeywordsCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("Include _keywords in completion list");
+ this.includeKeywordsCheckbutton.Label = global::Mono.Unix.Catalog.GetString("Include _keywords in completion list");
this.includeKeywordsCheckbutton.DrawIndicator = true;
this.includeKeywordsCheckbutton.UseUnderline = true;
- this.hbox4.Add (this.includeKeywordsCheckbutton);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.includeKeywordsCheckbutton]));
+ this.hbox4.Add(this.includeKeywordsCheckbutton);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox4[this.includeKeywordsCheckbutton]));
w3.Position = 1;
- this.vbox5.Add (this.hbox4);
- global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hbox4]));
+ this.vbox5.Add(this.hbox4);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.hbox4]));
w4.Position = 1;
w4.Expand = false;
w4.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
- this.hbox5 = new global::Gtk.HBox ();
+ this.hbox5 = new global::Gtk.HBox();
this.hbox5.Name = "hbox5";
this.hbox5.Spacing = 6;
// Container child hbox5.Gtk.Box+BoxChild
- this.fixed4 = new global::Gtk.Fixed ();
+ this.fixed4 = new global::Gtk.Fixed();
this.fixed4.Name = "fixed4";
this.fixed4.HasWindow = false;
- this.hbox5.Add (this.fixed4);
- global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox5 [this.fixed4]));
+ this.hbox5.Add(this.fixed4);
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox5[this.fixed4]));
w5.Position = 0;
w5.Expand = false;
w5.Padding = ((uint)(6));
// Container child hbox5.Gtk.Box+BoxChild
- this.includeCodeSnippetsCheckbutton = new global::Gtk.CheckButton ();
+ this.includeCodeSnippetsCheckbutton = new global::Gtk.CheckButton();
this.includeCodeSnippetsCheckbutton.CanFocus = true;
this.includeCodeSnippetsCheckbutton.Name = "includeCodeSnippetsCheckbutton";
- this.includeCodeSnippetsCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("Include _code snippets in completion list");
+ this.includeCodeSnippetsCheckbutton.Label = global::Mono.Unix.Catalog.GetString("Include _code snippets in completion list");
this.includeCodeSnippetsCheckbutton.DrawIndicator = true;
this.includeCodeSnippetsCheckbutton.UseUnderline = true;
- this.hbox5.Add (this.includeCodeSnippetsCheckbutton);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox5 [this.includeCodeSnippetsCheckbutton]));
+ this.hbox5.Add(this.includeCodeSnippetsCheckbutton);
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox5[this.includeCodeSnippetsCheckbutton]));
w6.Position = 1;
- this.vbox5.Add (this.hbox5);
- global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hbox5]));
+ this.vbox5.Add(this.hbox5);
+ global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.hbox5]));
w7.Position = 2;
w7.Expand = false;
w7.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
- this.showImportsCheckbutton = new global::Gtk.CheckButton ();
+ this.showImportsCheckbutton = new global::Gtk.CheckButton();
this.showImportsCheckbutton.CanFocus = true;
this.showImportsCheckbutton.Name = "showImportsCheckbutton";
- this.showImportsCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Show import items");
+ this.showImportsCheckbutton.Label = global::Mono.Unix.Catalog.GetString("_Show import items");
this.showImportsCheckbutton.DrawIndicator = true;
this.showImportsCheckbutton.UseUnderline = true;
- this.vbox5.Add (this.showImportsCheckbutton);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.showImportsCheckbutton]));
+ this.vbox5.Add(this.showImportsCheckbutton);
+ global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.showImportsCheckbutton]));
w8.Position = 3;
w8.Expand = false;
w8.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
- this.insertParenthesesCheckbutton = new global::Gtk.CheckButton ();
+ this.insertParenthesesCheckbutton = new global::Gtk.CheckButton();
this.insertParenthesesCheckbutton.CanFocus = true;
this.insertParenthesesCheckbutton.Name = "insertParenthesesCheckbutton";
- this.insertParenthesesCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("A_utomatically insert parentheses after completion:");
+ this.insertParenthesesCheckbutton.Label = global::Mono.Unix.Catalog.GetString("A_utomatically insert parentheses after completion:");
this.insertParenthesesCheckbutton.DrawIndicator = true;
this.insertParenthesesCheckbutton.UseUnderline = true;
- this.vbox5.Add (this.insertParenthesesCheckbutton);
- global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.insertParenthesesCheckbutton]));
+ this.vbox5.Add(this.insertParenthesesCheckbutton);
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.insertParenthesesCheckbutton]));
w9.Position = 4;
w9.Expand = false;
w9.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
- this.hbox2 = new global::Gtk.HBox ();
+ this.hbox2 = new global::Gtk.HBox();
this.hbox2.Name = "hbox2";
this.hbox2.Spacing = 6;
// Container child hbox2.Gtk.Box+BoxChild
- this.fixed1 = new global::Gtk.Fixed ();
+ this.fixed1 = new global::Gtk.Fixed();
this.fixed1.Name = "fixed1";
this.fixed1.HasWindow = false;
- this.hbox2.Add (this.fixed1);
- global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.fixed1]));
+ this.hbox2.Add(this.fixed1);
+ global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.fixed1]));
w10.Position = 0;
w10.Expand = false;
w10.Padding = ((uint)(6));
// Container child hbox2.Gtk.Box+BoxChild
- this.openingRadiobutton = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("_Opening only"));
+ this.openingRadiobutton = new global::Gtk.RadioButton(global::Mono.Unix.Catalog.GetString("_Opening only"));
this.openingRadiobutton.CanFocus = true;
this.openingRadiobutton.Name = "openingRadiobutton";
+ this.openingRadiobutton.Active = true;
this.openingRadiobutton.DrawIndicator = true;
this.openingRadiobutton.UseUnderline = true;
- this.openingRadiobutton.Group = new global::GLib.SList (global::System.IntPtr.Zero);
- this.hbox2.Add (this.openingRadiobutton);
- global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.openingRadiobutton]));
+ this.openingRadiobutton.Group = new global::GLib.SList(global::System.IntPtr.Zero);
+ this.hbox2.Add(this.openingRadiobutton);
+ global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.openingRadiobutton]));
w11.Position = 1;
- this.vbox5.Add (this.hbox2);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hbox2]));
+ this.vbox5.Add(this.hbox2);
+ global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.hbox2]));
w12.Position = 5;
w12.Expand = false;
w12.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
- this.hbox3 = new global::Gtk.HBox ();
+ this.hbox3 = new global::Gtk.HBox();
this.hbox3.Name = "hbox3";
this.hbox3.Spacing = 6;
// Container child hbox3.Gtk.Box+BoxChild
- this.fixed2 = new global::Gtk.Fixed ();
+ this.fixed2 = new global::Gtk.Fixed();
this.fixed2.Name = "fixed2";
this.fixed2.HasWindow = false;
- this.hbox3.Add (this.fixed2);
- global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.fixed2]));
+ this.hbox3.Add(this.fixed2);
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.fixed2]));
w13.Position = 0;
w13.Expand = false;
w13.Padding = ((uint)(6));
// Container child hbox3.Gtk.Box+BoxChild
- this.bothRadiobutton = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("_Both opening and closing"));
+ this.bothRadiobutton = new global::Gtk.RadioButton(global::Mono.Unix.Catalog.GetString("_Both opening and closing"));
this.bothRadiobutton.CanFocus = true;
this.bothRadiobutton.Name = "bothRadiobutton";
this.bothRadiobutton.DrawIndicator = true;
this.bothRadiobutton.UseUnderline = true;
this.bothRadiobutton.Group = this.openingRadiobutton.Group;
- this.hbox3.Add (this.bothRadiobutton);
- global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.bothRadiobutton]));
+ this.hbox3.Add(this.bothRadiobutton);
+ global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.bothRadiobutton]));
w14.Position = 1;
- this.vbox5.Add (this.hbox3);
- global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hbox3]));
+ this.vbox5.Add(this.hbox3);
+ global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.hbox3]));
w15.Position = 6;
w15.Expand = false;
w15.Fill = false;
- this.alignment3.Add (this.vbox5);
- this.vbox1.Add (this.alignment3);
- global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.alignment3]));
+ this.alignment3.Add(this.vbox5);
+ this.vbox1.Add(this.alignment3);
+ global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.alignment3]));
w17.Position = 0;
w17.Expand = false;
w17.Fill = false;
- this.Add (this.vbox1);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
+ this.Add(this.vbox1);
+ if ((this.Child != null))
+ {
+ this.Child.ShowAll();
}
- this.Hide ();
+ this.Hide();
}
}
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs
index 27fc99c53f..73a12ec8ea 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.cs
@@ -5,222 +5,242 @@ namespace MonoDevelop.SourceEditor.OptionPanels
internal partial class GeneralOptionsPanel
{
private global::Gtk.VBox vbox1;
+
private global::Gtk.Label GtkLabel13;
+
private global::Gtk.Alignment alignment2;
+
private global::Gtk.VBox vbox4;
+
private global::Gtk.HBox hbox3;
+
private global::Gtk.Fixed fixed2;
+
private global::Gtk.HBox hbox1;
+
private global::Gtk.Label label1;
+
private global::Gtk.ComboBox comboboxLineEndings;
+
private global::Gtk.Label GtkLabel14;
+
private global::Gtk.Alignment alignment3;
+
private global::Gtk.VBox vbox5;
+
private global::Gtk.CheckButton foldingCheckbutton;
+
private global::Gtk.CheckButton foldregionsCheckbutton;
+
private global::Gtk.CheckButton foldCommentsCheckbutton;
+
private global::Gtk.Label GtkLabel15;
+
private global::Gtk.Alignment alignment4;
+
private global::Gtk.VBox vbox6;
+
private global::Gtk.CheckButton wordWrapCheckbutton;
+
private global::Gtk.CheckButton antiAliasingCheckbutton;
- protected virtual void Build ()
+ protected virtual void Build()
{
- global::Stetic.Gui.Initialize (this);
+ global::Stetic.Gui.Initialize(this);
// Widget MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel
- global::Stetic.BinContainer.Attach (this);
+ global::Stetic.BinContainer.Attach(this);
this.Name = "MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel";
// Container child MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel.Gtk.Container+ContainerChild
- this.vbox1 = new global::Gtk.VBox ();
+ this.vbox1 = new global::Gtk.VBox();
this.vbox1.Name = "vbox1";
this.vbox1.Spacing = 6;
// Container child vbox1.Gtk.Box+BoxChild
- this.GtkLabel13 = new global::Gtk.Label ();
+ this.GtkLabel13 = new global::Gtk.Label();
this.GtkLabel13.Name = "GtkLabel13";
this.GtkLabel13.Xalign = 0F;
- this.GtkLabel13.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Coding</b>");
+ this.GtkLabel13.LabelProp = global::Mono.Unix.Catalog.GetString("<b>Coding</b>");
this.GtkLabel13.UseMarkup = true;
- this.vbox1.Add (this.GtkLabel13);
- global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkLabel13]));
+ this.vbox1.Add(this.GtkLabel13);
+ global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.GtkLabel13]));
w1.Position = 0;
w1.Expand = false;
w1.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
- this.alignment2 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
+ this.alignment2 = new global::Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
this.alignment2.Name = "alignment2";
this.alignment2.LeftPadding = ((uint)(12));
// Container child alignment2.Gtk.Container+ContainerChild
- this.vbox4 = new global::Gtk.VBox ();
+ this.vbox4 = new global::Gtk.VBox();
this.vbox4.Name = "vbox4";
this.vbox4.Spacing = 6;
// Container child vbox4.Gtk.Box+BoxChild
- this.hbox3 = new global::Gtk.HBox ();
+ this.hbox3 = new global::Gtk.HBox();
this.hbox3.Name = "hbox3";
this.hbox3.Spacing = 6;
// Container child hbox3.Gtk.Box+BoxChild
- this.fixed2 = new global::Gtk.Fixed ();
+ this.fixed2 = new global::Gtk.Fixed();
this.fixed2.Name = "fixed2";
this.fixed2.HasWindow = false;
- this.hbox3.Add (this.fixed2);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.fixed2]));
+ this.hbox3.Add(this.fixed2);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.fixed2]));
w2.Position = 0;
w2.Expand = false;
w2.Padding = ((uint)(6));
- this.vbox4.Add (this.hbox3);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.hbox3]));
+ this.vbox4.Add(this.hbox3);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.hbox3]));
w3.Position = 0;
w3.Expand = false;
w3.Fill = false;
// Container child vbox4.Gtk.Box+BoxChild
- this.hbox1 = new global::Gtk.HBox ();
+ this.hbox1 = new global::Gtk.HBox();
this.hbox1.Name = "hbox1";
this.hbox1.Spacing = 6;
// Container child hbox1.Gtk.Box+BoxChild
- this.label1 = new global::Gtk.Label ();
+ this.label1 = new global::Gtk.Label();
this.label1.Name = "label1";
- this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("_Line ending conversion:");
+ this.label1.LabelProp = global::Mono.Unix.Catalog.GetString("_Line ending conversion:");
this.label1.UseUnderline = true;
- this.hbox1.Add (this.label1);
- global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label1]));
+ this.hbox1.Add(this.label1);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.label1]));
w4.Position = 0;
w4.Expand = false;
w4.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
- this.comboboxLineEndings = global::Gtk.ComboBox.NewText ();
+ this.comboboxLineEndings = global::Gtk.ComboBox.NewText();
this.comboboxLineEndings.Name = "comboboxLineEndings";
- this.hbox1.Add (this.comboboxLineEndings);
- global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.comboboxLineEndings]));
+ this.hbox1.Add(this.comboboxLineEndings);
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.comboboxLineEndings]));
w5.Position = 1;
w5.Expand = false;
w5.Fill = false;
- this.vbox4.Add (this.hbox1);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.hbox1]));
+ this.vbox4.Add(this.hbox1);
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.hbox1]));
w6.Position = 1;
w6.Expand = false;
w6.Fill = false;
- this.alignment2.Add (this.vbox4);
- this.vbox1.Add (this.alignment2);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.alignment2]));
+ this.alignment2.Add(this.vbox4);
+ this.vbox1.Add(this.alignment2);
+ global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.alignment2]));
w8.Position = 1;
w8.Expand = false;
w8.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
- this.GtkLabel14 = new global::Gtk.Label ();
+ this.GtkLabel14 = new global::Gtk.Label();
this.GtkLabel14.Name = "GtkLabel14";
this.GtkLabel14.Xalign = 0F;
- this.GtkLabel14.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Code Folding</b>");
+ this.GtkLabel14.LabelProp = global::Mono.Unix.Catalog.GetString("<b>Code Folding</b>");
this.GtkLabel14.UseMarkup = true;
- this.vbox1.Add (this.GtkLabel14);
- global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkLabel14]));
+ this.vbox1.Add(this.GtkLabel14);
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.GtkLabel14]));
w9.Position = 2;
w9.Expand = false;
w9.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
- this.alignment3 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
+ this.alignment3 = new global::Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
this.alignment3.Name = "alignment3";
this.alignment3.LeftPadding = ((uint)(12));
// Container child alignment3.Gtk.Container+ContainerChild
- this.vbox5 = new global::Gtk.VBox ();
+ this.vbox5 = new global::Gtk.VBox();
this.vbox5.Name = "vbox5";
this.vbox5.Spacing = 6;
// Container child vbox5.Gtk.Box+BoxChild
- this.foldingCheckbutton = new global::Gtk.CheckButton ();
+ this.foldingCheckbutton = new global::Gtk.CheckButton();
this.foldingCheckbutton.CanFocus = true;
this.foldingCheckbutton.Name = "foldingCheckbutton";
- this.foldingCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("Enable code _folding");
+ this.foldingCheckbutton.Label = global::Mono.Unix.Catalog.GetString("Enable code _folding");
this.foldingCheckbutton.DrawIndicator = true;
this.foldingCheckbutton.UseUnderline = true;
- this.vbox5.Add (this.foldingCheckbutton);
- global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.foldingCheckbutton]));
+ this.vbox5.Add(this.foldingCheckbutton);
+ global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.foldingCheckbutton]));
w10.Position = 0;
w10.Expand = false;
w10.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
- this.foldregionsCheckbutton = new global::Gtk.CheckButton ();
+ this.foldregionsCheckbutton = new global::Gtk.CheckButton();
this.foldregionsCheckbutton.CanFocus = true;
this.foldregionsCheckbutton.Name = "foldregionsCheckbutton";
- this.foldregionsCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("Fold #_regions by default");
+ this.foldregionsCheckbutton.Label = global::Mono.Unix.Catalog.GetString("Fold #_regions by default");
this.foldregionsCheckbutton.DrawIndicator = true;
this.foldregionsCheckbutton.UseUnderline = true;
- this.vbox5.Add (this.foldregionsCheckbutton);
- global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.foldregionsCheckbutton]));
+ this.vbox5.Add(this.foldregionsCheckbutton);
+ global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.foldregionsCheckbutton]));
w11.Position = 1;
w11.Expand = false;
w11.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
- this.foldCommentsCheckbutton = new global::Gtk.CheckButton ();
+ this.foldCommentsCheckbutton = new global::Gtk.CheckButton();
this.foldCommentsCheckbutton.CanFocus = true;
this.foldCommentsCheckbutton.Name = "foldCommentsCheckbutton";
- this.foldCommentsCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("Fold _comments by default");
+ this.foldCommentsCheckbutton.Label = global::Mono.Unix.Catalog.GetString("Fold _comments by default");
this.foldCommentsCheckbutton.DrawIndicator = true;
this.foldCommentsCheckbutton.UseUnderline = true;
- this.vbox5.Add (this.foldCommentsCheckbutton);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.foldCommentsCheckbutton]));
+ this.vbox5.Add(this.foldCommentsCheckbutton);
+ global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.foldCommentsCheckbutton]));
w12.Position = 2;
w12.Expand = false;
w12.Fill = false;
- this.alignment3.Add (this.vbox5);
- this.vbox1.Add (this.alignment3);
- global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.alignment3]));
+ this.alignment3.Add(this.vbox5);
+ this.vbox1.Add(this.alignment3);
+ global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.alignment3]));
w14.Position = 3;
w14.Expand = false;
w14.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
- this.GtkLabel15 = new global::Gtk.Label ();
+ this.GtkLabel15 = new global::Gtk.Label();
this.GtkLabel15.Name = "GtkLabel15";
this.GtkLabel15.Xalign = 0F;
- this.GtkLabel15.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Appearance</b>");
+ this.GtkLabel15.LabelProp = global::Mono.Unix.Catalog.GetString("<b>Appearance</b>");
this.GtkLabel15.UseMarkup = true;
- this.vbox1.Add (this.GtkLabel15);
- global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkLabel15]));
+ this.vbox1.Add(this.GtkLabel15);
+ global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.GtkLabel15]));
w15.Position = 4;
w15.Expand = false;
w15.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
- this.alignment4 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
+ this.alignment4 = new global::Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
this.alignment4.Name = "alignment4";
this.alignment4.LeftPadding = ((uint)(12));
// Container child alignment4.Gtk.Container+ContainerChild
- this.vbox6 = new global::Gtk.VBox ();
+ this.vbox6 = new global::Gtk.VBox();
this.vbox6.Name = "vbox6";
this.vbox6.Spacing = 6;
// Container child vbox6.Gtk.Box+BoxChild
- this.wordWrapCheckbutton = new global::Gtk.CheckButton ();
+ this.wordWrapCheckbutton = new global::Gtk.CheckButton();
this.wordWrapCheckbutton.CanFocus = true;
this.wordWrapCheckbutton.Name = "wordWrapCheckbutton";
- this.wordWrapCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Word wrap");
+ this.wordWrapCheckbutton.Label = global::Mono.Unix.Catalog.GetString("_Word wrap");
this.wordWrapCheckbutton.DrawIndicator = true;
this.wordWrapCheckbutton.UseUnderline = true;
- this.vbox6.Add (this.wordWrapCheckbutton);
- global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.wordWrapCheckbutton]));
+ this.vbox6.Add(this.wordWrapCheckbutton);
+ global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox6[this.wordWrapCheckbutton]));
w16.Position = 0;
w16.Expand = false;
w16.Fill = false;
// Container child vbox6.Gtk.Box+BoxChild
- this.antiAliasingCheckbutton = new global::Gtk.CheckButton ();
+ this.antiAliasingCheckbutton = new global::Gtk.CheckButton();
this.antiAliasingCheckbutton.CanFocus = true;
this.antiAliasingCheckbutton.Name = "antiAliasingCheckbutton";
- this.antiAliasingCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Use anti aliasing");
+ this.antiAliasingCheckbutton.Label = global::Mono.Unix.Catalog.GetString("_Use anti aliasing");
this.antiAliasingCheckbutton.DrawIndicator = true;
this.antiAliasingCheckbutton.UseUnderline = true;
- this.vbox6.Add (this.antiAliasingCheckbutton);
- global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.antiAliasingCheckbutton]));
+ this.vbox6.Add(this.antiAliasingCheckbutton);
+ global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox6[this.antiAliasingCheckbutton]));
w17.Position = 1;
w17.Expand = false;
w17.Fill = false;
- this.alignment4.Add (this.vbox6);
- this.vbox1.Add (this.alignment4);
- global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.alignment4]));
+ this.alignment4.Add(this.vbox6);
+ this.vbox1.Add(this.alignment4);
+ global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.alignment4]));
w19.Position = 5;
w19.Expand = false;
w19.Fill = false;
- this.Add (this.vbox1);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
+ this.Add(this.vbox1);
+ if ((this.Child != null))
+ {
+ this.Child.ShowAll();
}
this.label1.MnemonicWidget = this.comboboxLineEndings;
- this.Show ();
+ this.Show();
}
}
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel.cs
index b3e59c99f9..28afed11c1 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel.cs
@@ -5,176 +5,177 @@ namespace MonoDevelop.SourceEditor.OptionPanels
public partial class HighlightingPanel
{
private global::Gtk.VBox vbox4;
-
+
private global::Gtk.Label GtkLabel5;
-
+
private global::Gtk.Alignment GtkAlignment;
-
+
private global::Gtk.VBox vbox5;
-
+
private global::Gtk.HBox hbox1;
-
+
private global::Gtk.ScrolledWindow scrolledwindow1;
-
+
private global::Gtk.TreeView styleTreeview;
-
+
private global::Gtk.VBox vbox1;
-
+
private global::Gtk.Button buttonNew;
-
+
private global::Gtk.Button buttonEdit;
-
+
private global::Gtk.HBox hbox2;
-
+
private global::Gtk.Button addButton;
-
+
private global::Gtk.Button removeButton;
-
+
private global::Gtk.Button buttonExport;
- protected virtual void Build ()
+ protected virtual void Build()
{
- global::Stetic.Gui.Initialize (this);
+ global::Stetic.Gui.Initialize(this);
// Widget MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel
- global::Stetic.BinContainer.Attach (this);
+ global::Stetic.BinContainer.Attach(this);
this.Name = "MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel";
// Container child MonoDevelop.SourceEditor.OptionPanels.HighlightingPanel.Gtk.Container+ContainerChild
- this.vbox4 = new global::Gtk.VBox ();
+ this.vbox4 = new global::Gtk.VBox();
this.vbox4.Name = "vbox4";
this.vbox4.Spacing = 6;
// Container child vbox4.Gtk.Box+BoxChild
- this.GtkLabel5 = new global::Gtk.Label ();
+ this.GtkLabel5 = new global::Gtk.Label();
this.GtkLabel5.Name = "GtkLabel5";
this.GtkLabel5.Xalign = 0F;
- this.GtkLabel5.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Color scheme</b>");
+ this.GtkLabel5.LabelProp = global::Mono.Unix.Catalog.GetString("<b>Color scheme</b>");
this.GtkLabel5.UseMarkup = true;
- this.vbox4.Add (this.GtkLabel5);
- global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.GtkLabel5]));
+ this.vbox4.Add(this.GtkLabel5);
+ global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.GtkLabel5]));
w1.Position = 0;
w1.Expand = false;
w1.Fill = false;
// Container child vbox4.Gtk.Box+BoxChild
- this.GtkAlignment = new global::Gtk.Alignment (0F, 0F, 1F, 1F);
+ this.GtkAlignment = new global::Gtk.Alignment(0F, 0F, 1F, 1F);
this.GtkAlignment.Name = "GtkAlignment";
this.GtkAlignment.LeftPadding = ((uint)(12));
// Container child GtkAlignment.Gtk.Container+ContainerChild
- this.vbox5 = new global::Gtk.VBox ();
+ this.vbox5 = new global::Gtk.VBox();
this.vbox5.Name = "vbox5";
this.vbox5.Spacing = 6;
// Container child vbox5.Gtk.Box+BoxChild
- this.hbox1 = new global::Gtk.HBox ();
+ this.hbox1 = new global::Gtk.HBox();
this.hbox1.Name = "hbox1";
this.hbox1.Spacing = 6;
// Container child hbox1.Gtk.Box+BoxChild
- this.scrolledwindow1 = new global::Gtk.ScrolledWindow ();
+ this.scrolledwindow1 = new global::Gtk.ScrolledWindow();
this.scrolledwindow1.CanFocus = true;
this.scrolledwindow1.Name = "scrolledwindow1";
this.scrolledwindow1.ShadowType = ((global::Gtk.ShadowType)(1));
// Container child scrolledwindow1.Gtk.Container+ContainerChild
- global::Gtk.Viewport w2 = new global::Gtk.Viewport ();
+ global::Gtk.Viewport w2 = new global::Gtk.Viewport();
w2.ShadowType = ((global::Gtk.ShadowType)(0));
// Container child GtkViewport.Gtk.Container+ContainerChild
- this.styleTreeview = new global::Gtk.TreeView ();
+ this.styleTreeview = new global::Gtk.TreeView();
this.styleTreeview.CanFocus = true;
this.styleTreeview.Name = "styleTreeview";
this.styleTreeview.HeadersVisible = false;
- w2.Add (this.styleTreeview);
- this.scrolledwindow1.Add (w2);
- this.hbox1.Add (this.scrolledwindow1);
- global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.scrolledwindow1]));
+ w2.Add(this.styleTreeview);
+ this.scrolledwindow1.Add(w2);
+ this.hbox1.Add(this.scrolledwindow1);
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.scrolledwindow1]));
w5.Position = 0;
// Container child hbox1.Gtk.Box+BoxChild
- this.vbox1 = new global::Gtk.VBox ();
+ this.vbox1 = new global::Gtk.VBox();
this.vbox1.Name = "vbox1";
this.vbox1.Spacing = 6;
// Container child vbox1.Gtk.Box+BoxChild
- this.buttonNew = new global::Gtk.Button ();
+ this.buttonNew = new global::Gtk.Button();
this.buttonNew.CanFocus = true;
this.buttonNew.Name = "buttonNew";
this.buttonNew.UseStock = true;
this.buttonNew.UseUnderline = true;
this.buttonNew.Label = "gtk-new";
- this.vbox1.Add (this.buttonNew);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.buttonNew]));
+ this.vbox1.Add(this.buttonNew);
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.buttonNew]));
w6.Position = 0;
w6.Expand = false;
w6.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
- this.buttonEdit = new global::Gtk.Button ();
+ this.buttonEdit = new global::Gtk.Button();
this.buttonEdit.CanFocus = true;
this.buttonEdit.Name = "buttonEdit";
this.buttonEdit.UseUnderline = true;
- this.buttonEdit.Label = global::Mono.Unix.Catalog.GetString ("_Edit");
- this.vbox1.Add (this.buttonEdit);
- global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.buttonEdit]));
+ this.buttonEdit.Label = global::Mono.Unix.Catalog.GetString("_Edit");
+ this.vbox1.Add(this.buttonEdit);
+ global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.buttonEdit]));
w7.Position = 1;
w7.Expand = false;
w7.Fill = false;
- this.hbox1.Add (this.vbox1);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox1]));
+ this.hbox1.Add(this.vbox1);
+ global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.vbox1]));
w8.Position = 1;
w8.Expand = false;
w8.Fill = false;
- this.vbox5.Add (this.hbox1);
- global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hbox1]));
+ this.vbox5.Add(this.hbox1);
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.hbox1]));
w9.Position = 0;
// Container child vbox5.Gtk.Box+BoxChild
- this.hbox2 = new global::Gtk.HBox ();
+ this.hbox2 = new global::Gtk.HBox();
this.hbox2.Name = "hbox2";
this.hbox2.Spacing = 6;
// Container child hbox2.Gtk.Box+BoxChild
- this.addButton = new global::Gtk.Button ();
+ this.addButton = new global::Gtk.Button();
this.addButton.CanFocus = true;
this.addButton.Name = "addButton";
this.addButton.UseStock = true;
this.addButton.UseUnderline = true;
this.addButton.Label = "gtk-add";
- this.hbox2.Add (this.addButton);
- global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.addButton]));
+ this.hbox2.Add(this.addButton);
+ global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.addButton]));
w10.PackType = ((global::Gtk.PackType)(1));
w10.Position = 0;
w10.Expand = false;
w10.Fill = false;
// Container child hbox2.Gtk.Box+BoxChild
- this.removeButton = new global::Gtk.Button ();
+ this.removeButton = new global::Gtk.Button();
this.removeButton.CanFocus = true;
this.removeButton.Name = "removeButton";
this.removeButton.UseStock = true;
this.removeButton.UseUnderline = true;
this.removeButton.Label = "gtk-remove";
- this.hbox2.Add (this.removeButton);
- global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.removeButton]));
+ this.hbox2.Add(this.removeButton);
+ global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.removeButton]));
w11.PackType = ((global::Gtk.PackType)(1));
w11.Position = 1;
w11.Expand = false;
w11.Fill = false;
// Container child hbox2.Gtk.Box+BoxChild
- this.buttonExport = new global::Gtk.Button ();
+ this.buttonExport = new global::Gtk.Button();
this.buttonExport.CanFocus = true;
this.buttonExport.Name = "buttonExport";
this.buttonExport.UseUnderline = true;
- this.buttonExport.Label = global::Mono.Unix.Catalog.GetString ("Export");
- this.hbox2.Add (this.buttonExport);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.buttonExport]));
+ this.buttonExport.Label = global::Mono.Unix.Catalog.GetString("Export");
+ this.hbox2.Add(this.buttonExport);
+ global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.buttonExport]));
w12.PackType = ((global::Gtk.PackType)(1));
w12.Position = 2;
w12.Expand = false;
w12.Fill = false;
- this.vbox5.Add (this.hbox2);
- global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hbox2]));
+ this.vbox5.Add(this.hbox2);
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.hbox2]));
w13.PackType = ((global::Gtk.PackType)(1));
w13.Position = 1;
w13.Expand = false;
w13.Fill = false;
- this.GtkAlignment.Add (this.vbox5);
- this.vbox4.Add (this.GtkAlignment);
- global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.GtkAlignment]));
+ this.GtkAlignment.Add(this.vbox5);
+ this.vbox4.Add(this.GtkAlignment);
+ global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.GtkAlignment]));
w15.Position = 1;
- this.Add (this.vbox4);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
+ this.Add(this.vbox4);
+ if ((this.Child != null))
+ {
+ this.Child.ShowAll();
}
- this.Show ();
+ this.Show();
}
}
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs
index e186e1dc05..7da2e57e69 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.cs
@@ -5,176 +5,194 @@ namespace MonoDevelop.SourceEditor.OptionPanels
public partial class MarkerPanel
{
private global::Gtk.VBox vbox1;
+
private global::Gtk.Label GtkLabel9;
+
private global::Gtk.Alignment alignment1;
+
private global::Gtk.VBox vbox3;
+
private global::Gtk.CheckButton showLineNumbersCheckbutton;
+
private global::Gtk.CheckButton underlineErrorsCheckbutton;
+
private global::Gtk.CheckButton highlightMatchingBracketCheckbutton;
+
private global::Gtk.CheckButton highlightCurrentLineCheckbutton;
+
private global::Gtk.CheckButton showRulerCheckbutton;
+
private global::Gtk.CheckButton enableAnimationCheckbutton1;
+
private global::Gtk.CheckButton enableHighlightUsagesCheckbutton;
+
private global::Gtk.CheckButton drawIndentMarkersCheckbutton;
+
private global::Gtk.CheckButton enableQuickDiffCheckbutton;
+
private global::Gtk.Table table1;
+
private global::Gtk.CheckButton checkbuttonLineEndings;
+
private global::Gtk.CheckButton checkbuttonSpaces;
+
private global::Gtk.CheckButton checkbuttonTabs;
+
private global::Gtk.Label label1;
+
private global::Gtk.ComboBox showWhitespacesCombobox;
-
- protected virtual void Build ()
+
+ protected virtual void Build()
{
- global::Stetic.Gui.Initialize (this);
+ global::Stetic.Gui.Initialize(this);
// Widget MonoDevelop.SourceEditor.OptionPanels.MarkerPanel
- global::Stetic.BinContainer.Attach (this);
+ global::Stetic.BinContainer.Attach(this);
this.Name = "MonoDevelop.SourceEditor.OptionPanels.MarkerPanel";
// Container child MonoDevelop.SourceEditor.OptionPanels.MarkerPanel.Gtk.Container+ContainerChild
- this.vbox1 = new global::Gtk.VBox ();
+ this.vbox1 = new global::Gtk.VBox();
this.vbox1.Name = "vbox1";
this.vbox1.Spacing = 6;
// Container child vbox1.Gtk.Box+BoxChild
- this.GtkLabel9 = new global::Gtk.Label ();
+ this.GtkLabel9 = new global::Gtk.Label();
this.GtkLabel9.Name = "GtkLabel9";
this.GtkLabel9.Xalign = 0F;
- this.GtkLabel9.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>General</b>");
+ this.GtkLabel9.LabelProp = global::Mono.Unix.Catalog.GetString("<b>General</b>");
this.GtkLabel9.UseMarkup = true;
- this.vbox1.Add (this.GtkLabel9);
- global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkLabel9]));
+ this.vbox1.Add(this.GtkLabel9);
+ global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.GtkLabel9]));
w1.Position = 0;
w1.Expand = false;
w1.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
- this.alignment1 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
+ this.alignment1 = new global::Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
this.alignment1.Name = "alignment1";
this.alignment1.LeftPadding = ((uint)(12));
// Container child alignment1.Gtk.Container+ContainerChild
- this.vbox3 = new global::Gtk.VBox ();
+ this.vbox3 = new global::Gtk.VBox();
this.vbox3.Name = "vbox3";
this.vbox3.Spacing = 6;
// Container child vbox3.Gtk.Box+BoxChild
- this.showLineNumbersCheckbutton = new global::Gtk.CheckButton ();
+ this.showLineNumbersCheckbutton = new global::Gtk.CheckButton();
this.showLineNumbersCheckbutton.CanFocus = true;
this.showLineNumbersCheckbutton.Name = "showLineNumbersCheckbutton";
- this.showLineNumbersCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Show line numbers");
+ this.showLineNumbersCheckbutton.Label = global::Mono.Unix.Catalog.GetString("_Show line numbers");
this.showLineNumbersCheckbutton.DrawIndicator = true;
this.showLineNumbersCheckbutton.UseUnderline = true;
- this.vbox3.Add (this.showLineNumbersCheckbutton);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.showLineNumbersCheckbutton]));
+ this.vbox3.Add(this.showLineNumbersCheckbutton);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.showLineNumbersCheckbutton]));
w2.Position = 0;
w2.Expand = false;
w2.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
- this.underlineErrorsCheckbutton = new global::Gtk.CheckButton ();
+ this.underlineErrorsCheckbutton = new global::Gtk.CheckButton();
this.underlineErrorsCheckbutton.CanFocus = true;
this.underlineErrorsCheckbutton.Name = "underlineErrorsCheckbutton";
- this.underlineErrorsCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Underline errors");
+ this.underlineErrorsCheckbutton.Label = global::Mono.Unix.Catalog.GetString("_Underline errors");
this.underlineErrorsCheckbutton.DrawIndicator = true;
this.underlineErrorsCheckbutton.UseUnderline = true;
- this.vbox3.Add (this.underlineErrorsCheckbutton);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.underlineErrorsCheckbutton]));
+ this.vbox3.Add(this.underlineErrorsCheckbutton);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.underlineErrorsCheckbutton]));
w3.Position = 1;
w3.Expand = false;
w3.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
- this.highlightMatchingBracketCheckbutton = new global::Gtk.CheckButton ();
+ this.highlightMatchingBracketCheckbutton = new global::Gtk.CheckButton();
this.highlightMatchingBracketCheckbutton.CanFocus = true;
this.highlightMatchingBracketCheckbutton.Name = "highlightMatchingBracketCheckbutton";
- this.highlightMatchingBracketCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Highlight matching braces");
+ this.highlightMatchingBracketCheckbutton.Label = global::Mono.Unix.Catalog.GetString("_Highlight matching braces");
this.highlightMatchingBracketCheckbutton.DrawIndicator = true;
this.highlightMatchingBracketCheckbutton.UseUnderline = true;
- this.vbox3.Add (this.highlightMatchingBracketCheckbutton);
- global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.highlightMatchingBracketCheckbutton]));
+ this.vbox3.Add(this.highlightMatchingBracketCheckbutton);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.highlightMatchingBracketCheckbutton]));
w4.Position = 2;
w4.Expand = false;
w4.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
- this.highlightCurrentLineCheckbutton = new global::Gtk.CheckButton ();
+ this.highlightCurrentLineCheckbutton = new global::Gtk.CheckButton();
this.highlightCurrentLineCheckbutton.CanFocus = true;
this.highlightCurrentLineCheckbutton.Name = "highlightCurrentLineCheckbutton";
- this.highlightCurrentLineCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("Highlight _current line");
+ this.highlightCurrentLineCheckbutton.Label = global::Mono.Unix.Catalog.GetString("Highlight _current line");
this.highlightCurrentLineCheckbutton.DrawIndicator = true;
this.highlightCurrentLineCheckbutton.UseUnderline = true;
- this.vbox3.Add (this.highlightCurrentLineCheckbutton);
- global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.highlightCurrentLineCheckbutton]));
+ this.vbox3.Add(this.highlightCurrentLineCheckbutton);
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.highlightCurrentLineCheckbutton]));
w5.Position = 3;
w5.Expand = false;
w5.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
- this.showRulerCheckbutton = new global::Gtk.CheckButton ();
+ this.showRulerCheckbutton = new global::Gtk.CheckButton();
this.showRulerCheckbutton.CanFocus = true;
this.showRulerCheckbutton.Name = "showRulerCheckbutton";
- this.showRulerCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("Show _column ruler");
+ this.showRulerCheckbutton.Label = global::Mono.Unix.Catalog.GetString("Show _column ruler");
this.showRulerCheckbutton.DrawIndicator = true;
this.showRulerCheckbutton.UseUnderline = true;
- this.vbox3.Add (this.showRulerCheckbutton);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.showRulerCheckbutton]));
+ this.vbox3.Add(this.showRulerCheckbutton);
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.showRulerCheckbutton]));
w6.Position = 4;
w6.Expand = false;
w6.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
- this.enableAnimationCheckbutton1 = new global::Gtk.CheckButton ();
+ this.enableAnimationCheckbutton1 = new global::Gtk.CheckButton();
this.enableAnimationCheckbutton1.CanFocus = true;
this.enableAnimationCheckbutton1.Name = "enableAnimationCheckbutton1";
- this.enableAnimationCheckbutton1.Label = global::Mono.Unix.Catalog.GetString ("_Enable animations");
+ this.enableAnimationCheckbutton1.Label = global::Mono.Unix.Catalog.GetString("_Enable animations");
this.enableAnimationCheckbutton1.DrawIndicator = true;
this.enableAnimationCheckbutton1.UseUnderline = true;
- this.vbox3.Add (this.enableAnimationCheckbutton1);
- global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.enableAnimationCheckbutton1]));
+ this.vbox3.Add(this.enableAnimationCheckbutton1);
+ global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.enableAnimationCheckbutton1]));
w7.Position = 5;
w7.Expand = false;
w7.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
- this.enableHighlightUsagesCheckbutton = new global::Gtk.CheckButton ();
+ this.enableHighlightUsagesCheckbutton = new global::Gtk.CheckButton();
this.enableHighlightUsagesCheckbutton.CanFocus = true;
this.enableHighlightUsagesCheckbutton.Name = "enableHighlightUsagesCheckbutton";
- this.enableHighlightUsagesCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("Highlight _identifier references");
+ this.enableHighlightUsagesCheckbutton.Label = global::Mono.Unix.Catalog.GetString("Highlight _identifier references");
this.enableHighlightUsagesCheckbutton.DrawIndicator = true;
this.enableHighlightUsagesCheckbutton.UseUnderline = true;
- this.vbox3.Add (this.enableHighlightUsagesCheckbutton);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.enableHighlightUsagesCheckbutton]));
+ this.vbox3.Add(this.enableHighlightUsagesCheckbutton);
+ global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.enableHighlightUsagesCheckbutton]));
w8.Position = 6;
w8.Expand = false;
w8.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
- this.drawIndentMarkersCheckbutton = new global::Gtk.CheckButton ();
+ this.drawIndentMarkersCheckbutton = new global::Gtk.CheckButton();
this.drawIndentMarkersCheckbutton.CanFocus = true;
this.drawIndentMarkersCheckbutton.Name = "drawIndentMarkersCheckbutton";
- this.drawIndentMarkersCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Show indentation guides");
+ this.drawIndentMarkersCheckbutton.Label = global::Mono.Unix.Catalog.GetString("_Show indentation guides");
this.drawIndentMarkersCheckbutton.DrawIndicator = true;
this.drawIndentMarkersCheckbutton.UseUnderline = true;
- this.vbox3.Add (this.drawIndentMarkersCheckbutton);
- global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.drawIndentMarkersCheckbutton]));
+ this.vbox3.Add(this.drawIndentMarkersCheckbutton);
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.drawIndentMarkersCheckbutton]));
w9.Position = 7;
w9.Expand = false;
w9.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
- this.enableQuickDiffCheckbutton = new global::Gtk.CheckButton ();
+ this.enableQuickDiffCheckbutton = new global::Gtk.CheckButton();
this.enableQuickDiffCheckbutton.CanFocus = true;
this.enableQuickDiffCheckbutton.Name = "enableQuickDiffCheckbutton";
- this.enableQuickDiffCheckbutton.Label = global::Mono.Unix.Catalog.GetString ("_Visualize changed lines");
+ this.enableQuickDiffCheckbutton.Label = global::Mono.Unix.Catalog.GetString("_Visualize changed lines");
this.enableQuickDiffCheckbutton.DrawIndicator = true;
this.enableQuickDiffCheckbutton.UseUnderline = true;
- this.vbox3.Add (this.enableQuickDiffCheckbutton);
- global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.enableQuickDiffCheckbutton]));
+ this.vbox3.Add(this.enableQuickDiffCheckbutton);
+ global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.enableQuickDiffCheckbutton]));
w10.Position = 8;
w10.Expand = false;
w10.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
- this.table1 = new global::Gtk.Table (((uint)(4)), ((uint)(4)), false);
+ this.table1 = new global::Gtk.Table(((uint)(4)), ((uint)(4)), false);
this.table1.Name = "table1";
this.table1.RowSpacing = ((uint)(6));
this.table1.ColumnSpacing = ((uint)(6));
// Container child table1.Gtk.Table+TableChild
- this.checkbuttonLineEndings = new global::Gtk.CheckButton ();
+ this.checkbuttonLineEndings = new global::Gtk.CheckButton();
this.checkbuttonLineEndings.CanFocus = true;
this.checkbuttonLineEndings.Name = "checkbuttonLineEndings";
- this.checkbuttonLineEndings.Label = global::Mono.Unix.Catalog.GetString ("Include Line Endings");
+ this.checkbuttonLineEndings.Label = global::Mono.Unix.Catalog.GetString("Include Line Endings");
this.checkbuttonLineEndings.DrawIndicator = true;
this.checkbuttonLineEndings.UseUnderline = true;
- this.table1.Add (this.checkbuttonLineEndings);
- global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table1 [this.checkbuttonLineEndings]));
+ this.table1.Add(this.checkbuttonLineEndings);
+ global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table1[this.checkbuttonLineEndings]));
w11.TopAttach = ((uint)(3));
w11.BottomAttach = ((uint)(4));
w11.LeftAttach = ((uint)(1));
@@ -182,14 +200,14 @@ namespace MonoDevelop.SourceEditor.OptionPanels
w11.XOptions = ((global::Gtk.AttachOptions)(4));
w11.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
- this.checkbuttonSpaces = new global::Gtk.CheckButton ();
+ this.checkbuttonSpaces = new global::Gtk.CheckButton();
this.checkbuttonSpaces.CanFocus = true;
this.checkbuttonSpaces.Name = "checkbuttonSpaces";
- this.checkbuttonSpaces.Label = global::Mono.Unix.Catalog.GetString ("Include _Spaces");
+ this.checkbuttonSpaces.Label = global::Mono.Unix.Catalog.GetString("Include _Spaces");
this.checkbuttonSpaces.DrawIndicator = true;
this.checkbuttonSpaces.UseUnderline = true;
- this.table1.Add (this.checkbuttonSpaces);
- global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table1 [this.checkbuttonSpaces]));
+ this.table1.Add(this.checkbuttonSpaces);
+ global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table1[this.checkbuttonSpaces]));
w12.TopAttach = ((uint)(1));
w12.BottomAttach = ((uint)(2));
w12.LeftAttach = ((uint)(1));
@@ -197,14 +215,14 @@ namespace MonoDevelop.SourceEditor.OptionPanels
w12.XOptions = ((global::Gtk.AttachOptions)(4));
w12.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
- this.checkbuttonTabs = new global::Gtk.CheckButton ();
+ this.checkbuttonTabs = new global::Gtk.CheckButton();
this.checkbuttonTabs.CanFocus = true;
this.checkbuttonTabs.Name = "checkbuttonTabs";
- this.checkbuttonTabs.Label = global::Mono.Unix.Catalog.GetString ("Include Tabs");
+ this.checkbuttonTabs.Label = global::Mono.Unix.Catalog.GetString("Include Tabs");
this.checkbuttonTabs.DrawIndicator = true;
this.checkbuttonTabs.UseUnderline = true;
- this.table1.Add (this.checkbuttonTabs);
- global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table1 [this.checkbuttonTabs]));
+ this.table1.Add(this.checkbuttonTabs);
+ global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table1[this.checkbuttonTabs]));
w13.TopAttach = ((uint)(2));
w13.BottomAttach = ((uint)(3));
w13.LeftAttach = ((uint)(1));
@@ -212,38 +230,39 @@ namespace MonoDevelop.SourceEditor.OptionPanels
w13.XOptions = ((global::Gtk.AttachOptions)(4));
w13.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
- this.label1 = new global::Gtk.Label ();
+ this.label1 = new global::Gtk.Label();
this.label1.Name = "label1";
- this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("_Show invisible characters:");
+ this.label1.LabelProp = global::Mono.Unix.Catalog.GetString("_Show invisible characters:");
this.label1.UseUnderline = true;
- this.table1.Add (this.label1);
- global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table1 [this.label1]));
+ this.table1.Add(this.label1);
+ global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table1[this.label1]));
w14.XOptions = ((global::Gtk.AttachOptions)(4));
w14.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
- this.showWhitespacesCombobox = global::Gtk.ComboBox.NewText ();
+ this.showWhitespacesCombobox = global::Gtk.ComboBox.NewText();
this.showWhitespacesCombobox.Name = "showWhitespacesCombobox";
- this.table1.Add (this.showWhitespacesCombobox);
- global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table1 [this.showWhitespacesCombobox]));
+ this.table1.Add(this.showWhitespacesCombobox);
+ global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table1[this.showWhitespacesCombobox]));
w15.LeftAttach = ((uint)(1));
w15.RightAttach = ((uint)(4));
w15.XOptions = ((global::Gtk.AttachOptions)(4));
w15.YOptions = ((global::Gtk.AttachOptions)(4));
- this.vbox3.Add (this.table1);
- global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.table1]));
+ this.vbox3.Add(this.table1);
+ global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.table1]));
w16.Position = 9;
w16.Fill = false;
- this.alignment1.Add (this.vbox3);
- this.vbox1.Add (this.alignment1);
- global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.alignment1]));
+ this.alignment1.Add(this.vbox3);
+ this.vbox1.Add(this.alignment1);
+ global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.alignment1]));
w18.Position = 1;
w18.Expand = false;
w18.Fill = false;
- this.Add (this.vbox1);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
+ this.Add(this.vbox1);
+ if ((this.Child != null))
+ {
+ this.Child.ShowAll();
}
- this.Show ();
+ this.Show();
}
}
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog.cs b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog.cs
index 8d919b5500..efa3323b30 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog.cs
@@ -5,21 +5,29 @@ namespace MonoDevelop.SourceEditor.OptionPanels
public partial class NewColorShemeDialog
{
private global::Gtk.Table table1;
+
private global::Gtk.ComboBox comboboxBaseStyle;
+
private global::Gtk.Entry entryDescription;
+
private global::Gtk.Entry entryName;
+
private global::Gtk.Label label1;
+
private global::Gtk.Label label2;
+
private global::Gtk.Label label3;
+
private global::Gtk.Button buttonCancel;
+
private global::Gtk.Button buttonOk;
-
- protected virtual void Build ()
+
+ protected virtual void Build()
{
- global::Stetic.Gui.Initialize (this);
+ global::Stetic.Gui.Initialize(this);
// Widget MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog
this.Name = "MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog";
- this.Title = global::Mono.Unix.Catalog.GetString ("Create new color sheme");
+ this.Title = global::Mono.Unix.Catalog.GetString("Create new color sheme");
this.WindowPosition = ((global::Gtk.WindowPosition)(4));
this.BorderWidth = ((uint)(6));
// Internal child MonoDevelop.SourceEditor.OptionPanels.NewColorShemeDialog.VBox
@@ -27,26 +35,26 @@ namespace MonoDevelop.SourceEditor.OptionPanels
w1.Name = "dialog1_VBox";
w1.BorderWidth = ((uint)(2));
// Container child dialog1_VBox.Gtk.Box+BoxChild
- this.table1 = new global::Gtk.Table (((uint)(3)), ((uint)(2)), false);
+ this.table1 = new global::Gtk.Table(((uint)(3)), ((uint)(2)), false);
this.table1.Name = "table1";
this.table1.RowSpacing = ((uint)(6));
this.table1.ColumnSpacing = ((uint)(6));
// Container child table1.Gtk.Table+TableChild
- this.comboboxBaseStyle = global::Gtk.ComboBox.NewText ();
+ this.comboboxBaseStyle = global::Gtk.ComboBox.NewText();
this.comboboxBaseStyle.Name = "comboboxBaseStyle";
- this.table1.Add (this.comboboxBaseStyle);
- global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1 [this.comboboxBaseStyle]));
+ this.table1.Add(this.comboboxBaseStyle);
+ global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1[this.comboboxBaseStyle]));
w2.LeftAttach = ((uint)(1));
w2.RightAttach = ((uint)(2));
w2.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
- this.entryDescription = new global::Gtk.Entry ();
+ this.entryDescription = new global::Gtk.Entry();
this.entryDescription.CanFocus = true;
this.entryDescription.Name = "entryDescription";
this.entryDescription.IsEditable = true;
this.entryDescription.InvisibleChar = '●';
- this.table1.Add (this.entryDescription);
- global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1 [this.entryDescription]));
+ this.table1.Add(this.entryDescription);
+ global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1[this.entryDescription]));
w3.TopAttach = ((uint)(2));
w3.BottomAttach = ((uint)(3));
w3.LeftAttach = ((uint)(1));
@@ -54,13 +62,13 @@ namespace MonoDevelop.SourceEditor.OptionPanels
w3.XOptions = ((global::Gtk.AttachOptions)(4));
w3.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
- this.entryName = new global::Gtk.Entry ();
+ this.entryName = new global::Gtk.Entry();
this.entryName.CanFocus = true;
this.entryName.Name = "entryName";
this.entryName.IsEditable = true;
this.entryName.InvisibleChar = '●';
- this.table1.Add (this.entryName);
- global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1 [this.entryName]));
+ this.table1.Add(this.entryName);
+ global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1[this.entryName]));
w4.TopAttach = ((uint)(1));
w4.BottomAttach = ((uint)(2));
w4.LeftAttach = ((uint)(1));
@@ -68,41 +76,41 @@ namespace MonoDevelop.SourceEditor.OptionPanels
w4.XOptions = ((global::Gtk.AttachOptions)(4));
w4.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
- this.label1 = new global::Gtk.Label ();
+ this.label1 = new global::Gtk.Label();
this.label1.Name = "label1";
this.label1.Xalign = 0F;
- this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("_Based on:");
+ this.label1.LabelProp = global::Mono.Unix.Catalog.GetString("_Based on:");
this.label1.UseMarkup = true;
this.label1.UseUnderline = true;
- this.table1.Add (this.label1);
- global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1 [this.label1]));
+ this.table1.Add(this.label1);
+ global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1[this.label1]));
w5.XOptions = ((global::Gtk.AttachOptions)(4));
w5.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
- this.label2 = new global::Gtk.Label ();
+ this.label2 = new global::Gtk.Label();
this.label2.Name = "label2";
this.label2.Xalign = 0F;
- this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("_Name:");
+ this.label2.LabelProp = global::Mono.Unix.Catalog.GetString("_Name:");
this.label2.UseUnderline = true;
- this.table1.Add (this.label2);
- global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1 [this.label2]));
+ this.table1.Add(this.label2);
+ global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1[this.label2]));
w6.TopAttach = ((uint)(1));
w6.BottomAttach = ((uint)(2));
w6.XOptions = ((global::Gtk.AttachOptions)(4));
w6.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table1.Gtk.Table+TableChild
- this.label3 = new global::Gtk.Label ();
+ this.label3 = new global::Gtk.Label();
this.label3.Name = "label3";
- this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("_Description:");
+ this.label3.LabelProp = global::Mono.Unix.Catalog.GetString("_Description:");
this.label3.UseUnderline = true;
- this.table1.Add (this.label3);
- global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1 [this.label3]));
+ this.table1.Add(this.label3);
+ global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1[this.label3]));
w7.TopAttach = ((uint)(2));
w7.BottomAttach = ((uint)(3));
w7.XOptions = ((global::Gtk.AttachOptions)(4));
w7.YOptions = ((global::Gtk.AttachOptions)(4));
- w1.Add (this.table1);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(w1 [this.table1]));
+ w1.Add(this.table1);
+ global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(w1[this.table1]));
w8.Position = 0;
w8.Expand = false;
w8.Fill = false;
@@ -113,38 +121,39 @@ namespace MonoDevelop.SourceEditor.OptionPanels
w9.BorderWidth = ((uint)(5));
w9.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
- this.buttonCancel = new global::Gtk.Button ();
+ this.buttonCancel = new global::Gtk.Button();
this.buttonCancel.CanDefault = true;
this.buttonCancel.CanFocus = true;
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.UseStock = true;
this.buttonCancel.UseUnderline = true;
this.buttonCancel.Label = "gtk-cancel";
- this.AddActionWidget (this.buttonCancel, -6);
- global::Gtk.ButtonBox.ButtonBoxChild w10 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w9 [this.buttonCancel]));
+ this.AddActionWidget(this.buttonCancel, -6);
+ global::Gtk.ButtonBox.ButtonBoxChild w10 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w9[this.buttonCancel]));
w10.Expand = false;
w10.Fill = false;
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
- this.buttonOk = new global::Gtk.Button ();
+ this.buttonOk = new global::Gtk.Button();
this.buttonOk.CanDefault = true;
this.buttonOk.CanFocus = true;
this.buttonOk.Name = "buttonOk";
this.buttonOk.UseStock = true;
this.buttonOk.UseUnderline = true;
this.buttonOk.Label = "gtk-ok";
- this.AddActionWidget (this.buttonOk, -5);
- global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w9 [this.buttonOk]));
+ this.AddActionWidget(this.buttonOk, -5);
+ global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w9[this.buttonOk]));
w11.Position = 1;
w11.Expand = false;
w11.Fill = false;
- if ((this.Child != null)) {
- this.Child.ShowAll ();
+ if ((this.Child != null))
+ {
+ this.Child.ShowAll();
}
this.DefaultWidth = 393;
this.DefaultHeight = 148;
this.label2.MnemonicWidget = this.entryName;
this.label3.MnemonicWidget = this.entryDescription;
- this.Show ();
+ this.Show();
}
}
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.PrintSettingsWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.PrintSettingsWidget.cs
index 397cff6550..a4f72fc66a 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.PrintSettingsWidget.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.PrintSettingsWidget.cs
@@ -4,16 +4,17 @@ namespace MonoDevelop.SourceEditor
{
internal partial class PrintSettingsWidget
{
- protected virtual void Build ()
+ protected virtual void Build()
{
- global::Stetic.Gui.Initialize (this);
+ global::Stetic.Gui.Initialize(this);
// Widget MonoDevelop.SourceEditor.PrintSettingsWidget
- global::Stetic.BinContainer.Attach (this);
+ global::Stetic.BinContainer.Attach(this);
this.Name = "MonoDevelop.SourceEditor.PrintSettingsWidget";
- if ((this.Child != null)) {
- this.Child.ShowAll ();
+ if ((this.Child != null))
+ {
+ this.Child.ShowAll();
}
- this.Hide ();
+ this.Hide();
}
}
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs
index 1768c2468d..747ee9c089 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.SearchAndReplaceWidget.cs
@@ -5,30 +5,43 @@ namespace MonoDevelop.SourceEditor
public partial class SearchAndReplaceWidget
{
private global::Gtk.Table table;
+
private global::Gtk.Button buttonSearchMode;
+
private global::Gtk.Arrow searchButtonModeArrow;
+
private global::Gtk.HBox hbox1;
+
private global::MonoDevelop.Components.SearchEntry searchEntry;
+
private global::Gtk.Button buttonSearchBackward;
- private global::Gtk.EventBox eventbox2;
- private global::Gtk.Image image2;
+
+ private global::MonoDevelop.Components.ImageView image2;
+
private global::Gtk.Button buttonSearchForward;
- private global::Gtk.EventBox eventbox3;
- private global::Gtk.Image image3;
+
+ private global::MonoDevelop.Components.ImageView image3;
+
private global::Gtk.Button closeButton;
- private global::Gtk.EventBox eventbox4;
- private global::Gtk.Image image4;
+
+ private global::MonoDevelop.Components.ImageView image4;
+
private global::Gtk.HBox hbox2;
+
private global::Gtk.Entry entryReplace;
+
private global::Gtk.Button buttonReplace;
- private global::Gtk.EventBox eventbox5;
- private global::Gtk.Image image5;
+
+ private global::MonoDevelop.Components.ImageView image5;
+
private global::Gtk.Button buttonReplaceAll;
+
private global::Gtk.HBox hbox3;
- private global::Gtk.EventBox eventbox6;
- private global::Gtk.Image image6;
- private global::Gtk.Label label1;
+ private global::MonoDevelop.Components.ImageView image6;
+
+ private global::Gtk.Label label1;
+
protected virtual void Build ()
{
global::Stetic.Gui.Initialize (this);
@@ -47,7 +60,6 @@ namespace MonoDevelop.SourceEditor
this.searchButtonModeArrow = new global::Gtk.Arrow (((global::Gtk.ArrowType)(0)), ((global::Gtk.ShadowType)(0)));
this.searchButtonModeArrow.Name = "searchButtonModeArrow";
this.buttonSearchMode.Add (this.searchButtonModeArrow);
- this.buttonSearchMode.Label = null;
this.table.Add (this.buttonSearchMode);
global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table [this.buttonSearchMode]));
w2.XOptions = ((global::Gtk.AttachOptions)(4));
@@ -74,71 +86,53 @@ namespace MonoDevelop.SourceEditor
this.buttonSearchBackward.Name = "buttonSearchBackward";
this.buttonSearchBackward.Relief = ((global::Gtk.ReliefStyle)(2));
// Container child buttonSearchBackward.Gtk.Container+ContainerChild
- this.eventbox2 = new global::Gtk.EventBox ();
- this.eventbox2.Name = "eventbox2";
- this.eventbox2.AboveChild = true;
- this.eventbox2.VisibleWindow = false;
- // Container child eventbox2.Gtk.Container+ContainerChild
- this.image2 = new global::Gtk.Image ();
+ this.image2 = new global::MonoDevelop.Components.ImageView ();
this.image2.Name = "image2";
- this.image2.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-up", global::Gtk.IconSize.Menu);
- this.eventbox2.Add (this.image2);
- this.buttonSearchBackward.Add (this.eventbox2);
- this.buttonSearchBackward.Label = null;
+ this.image2.IconId = "gtk-go-up";
+ this.image2.IconSize = ((global::Gtk.IconSize)(1));
+ this.buttonSearchBackward.Add (this.image2);
this.hbox1.Add (this.buttonSearchBackward);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.buttonSearchBackward]));
- w6.Position = 1;
- w6.Expand = false;
- w6.Fill = false;
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.buttonSearchBackward]));
+ w5.Position = 1;
+ w5.Expand = false;
+ w5.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
this.buttonSearchForward = new global::Gtk.Button ();
this.buttonSearchForward.CanFocus = true;
this.buttonSearchForward.Name = "buttonSearchForward";
this.buttonSearchForward.Relief = ((global::Gtk.ReliefStyle)(2));
// Container child buttonSearchForward.Gtk.Container+ContainerChild
- this.eventbox3 = new global::Gtk.EventBox ();
- this.eventbox3.Name = "eventbox3";
- this.eventbox3.AboveChild = true;
- this.eventbox3.VisibleWindow = false;
- // Container child eventbox3.Gtk.Container+ContainerChild
- this.image3 = new global::Gtk.Image ();
+ this.image3 = new global::MonoDevelop.Components.ImageView ();
this.image3.Name = "image3";
- this.image3.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-down", global::Gtk.IconSize.Menu);
- this.eventbox3.Add (this.image3);
- this.buttonSearchForward.Add (this.eventbox3);
- this.buttonSearchForward.Label = null;
+ this.image3.IconId = "gtk-go-down";
+ this.image3.IconSize = ((global::Gtk.IconSize)(1));
+ this.buttonSearchForward.Add (this.image3);
this.hbox1.Add (this.buttonSearchForward);
- global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.buttonSearchForward]));
- w9.Position = 2;
- w9.Expand = false;
- w9.Fill = false;
+ global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.buttonSearchForward]));
+ w7.Position = 2;
+ w7.Expand = false;
+ w7.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
this.closeButton = new global::Gtk.Button ();
this.closeButton.CanFocus = true;
this.closeButton.Name = "closeButton";
this.closeButton.Relief = ((global::Gtk.ReliefStyle)(2));
// Container child closeButton.Gtk.Container+ContainerChild
- this.eventbox4 = new global::Gtk.EventBox ();
- this.eventbox4.Name = "eventbox4";
- this.eventbox4.AboveChild = true;
- this.eventbox4.VisibleWindow = false;
- // Container child eventbox4.Gtk.Container+ContainerChild
- this.image4 = new global::Gtk.Image ();
+ this.image4 = new global::MonoDevelop.Components.ImageView ();
this.image4.Name = "image4";
- this.image4.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-close", global::Gtk.IconSize.Menu);
- this.eventbox4.Add (this.image4);
- this.closeButton.Add (this.eventbox4);
- this.closeButton.Label = null;
+ this.image4.IconId = "gtk-close";
+ this.image4.IconSize = ((global::Gtk.IconSize)(1));
+ this.closeButton.Add (this.image4);
this.hbox1.Add (this.closeButton);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.closeButton]));
- w12.Position = 3;
- w12.Expand = false;
- w12.Fill = false;
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.closeButton]));
+ w9.Position = 3;
+ w9.Expand = false;
+ w9.Fill = false;
this.table.Add (this.hbox1);
- global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table [this.hbox1]));
- w13.LeftAttach = ((uint)(1));
- w13.RightAttach = ((uint)(2));
- w13.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table [this.hbox1]));
+ w10.LeftAttach = ((uint)(1));
+ w10.RightAttach = ((uint)(2));
+ w10.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child table.Gtk.Table+TableChild
this.hbox2 = new global::Gtk.HBox ();
this.hbox2.Name = "hbox2";
@@ -149,30 +143,24 @@ namespace MonoDevelop.SourceEditor
this.entryReplace.IsEditable = true;
this.entryReplace.InvisibleChar = '●';
this.hbox2.Add (this.entryReplace);
- global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.entryReplace]));
- w14.Position = 0;
+ global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.entryReplace]));
+ w11.Position = 0;
// Container child hbox2.Gtk.Box+BoxChild
this.buttonReplace = new global::Gtk.Button ();
this.buttonReplace.CanFocus = true;
this.buttonReplace.Name = "buttonReplace";
this.buttonReplace.Relief = ((global::Gtk.ReliefStyle)(2));
// Container child buttonReplace.Gtk.Container+ContainerChild
- this.eventbox5 = new global::Gtk.EventBox ();
- this.eventbox5.Name = "eventbox5";
- this.eventbox5.AboveChild = true;
- this.eventbox5.VisibleWindow = false;
- // Container child eventbox5.Gtk.Container+ContainerChild
- this.image5 = new global::Gtk.Image ();
+ this.image5 = new global::MonoDevelop.Components.ImageView ();
this.image5.Name = "image5";
- this.image5.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-find-and-replace", global::Gtk.IconSize.Menu);
- this.eventbox5.Add (this.image5);
- this.buttonReplace.Add (this.eventbox5);
- this.buttonReplace.Label = null;
+ this.image5.IconId = "gtk-find-and-replace";
+ this.image5.IconSize = ((global::Gtk.IconSize)(1));
+ this.buttonReplace.Add (this.image5);
this.hbox2.Add (this.buttonReplace);
- global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.buttonReplace]));
- w17.Position = 1;
- w17.Expand = false;
- w17.Fill = false;
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.buttonReplace]));
+ w13.Position = 1;
+ w13.Expand = false;
+ w13.Fill = false;
// Container child hbox2.Gtk.Box+BoxChild
this.buttonReplaceAll = new global::Gtk.Button ();
this.buttonReplaceAll.CanFocus = true;
@@ -183,43 +171,37 @@ namespace MonoDevelop.SourceEditor
this.hbox3.Name = "hbox3";
this.hbox3.Spacing = 6;
// Container child hbox3.Gtk.Box+BoxChild
- this.eventbox6 = new global::Gtk.EventBox ();
- this.eventbox6.Name = "eventbox6";
- this.eventbox6.AboveChild = true;
- this.eventbox6.VisibleWindow = false;
- // Container child eventbox6.Gtk.Container+ContainerChild
- this.image6 = new global::Gtk.Image ();
+ this.image6 = new global::MonoDevelop.Components.ImageView ();
this.image6.Name = "image6";
- this.image6.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-find-and-replace", global::Gtk.IconSize.Menu);
- this.eventbox6.Add (this.image6);
- this.hbox3.Add (this.eventbox6);
- global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.eventbox6]));
- w19.Position = 0;
- w19.Expand = false;
- w19.Fill = false;
+ this.image6.IconId = "gtk-find-and-replace";
+ this.image6.IconSize = ((global::Gtk.IconSize)(1));
+ this.hbox3.Add (this.image6);
+ global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.image6]));
+ w14.Position = 0;
+ w14.Expand = false;
+ w14.Fill = false;
// Container child hbox3.Gtk.Box+BoxChild
this.label1 = new global::Gtk.Label ();
this.label1.Name = "label1";
this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("All");
this.hbox3.Add (this.label1);
- global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.label1]));
- w20.Position = 1;
- w20.Expand = false;
- w20.Fill = false;
+ global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.label1]));
+ w15.Position = 1;
+ w15.Expand = false;
+ w15.Fill = false;
this.buttonReplaceAll.Add (this.hbox3);
- this.buttonReplaceAll.Label = null;
this.hbox2.Add (this.buttonReplaceAll);
- global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.buttonReplaceAll]));
- w22.Position = 2;
- w22.Expand = false;
- w22.Fill = false;
+ global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.buttonReplaceAll]));
+ w17.Position = 2;
+ w17.Expand = false;
+ w17.Fill = false;
this.table.Add (this.hbox2);
- global::Gtk.Table.TableChild w23 = ((global::Gtk.Table.TableChild)(this.table [this.hbox2]));
- w23.TopAttach = ((uint)(1));
- w23.BottomAttach = ((uint)(2));
- w23.LeftAttach = ((uint)(1));
- w23.RightAttach = ((uint)(2));
- w23.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w18 = ((global::Gtk.Table.TableChild)(this.table [this.hbox2]));
+ w18.TopAttach = ((uint)(1));
+ w18.BottomAttach = ((uint)(2));
+ w18.LeftAttach = ((uint)(1));
+ w18.RightAttach = ((uint)(2));
+ w18.YOptions = ((global::Gtk.AttachOptions)(4));
this.Add (this.table);
if ((this.Child != null)) {
this.Child.ShowAll ();
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/generated.cs b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/generated.cs
index 5cdc11900b..8bc1a8b869 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/generated.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/generated.cs
@@ -1,3 +1,4 @@
+#pragma warning disable 436
// This file has been generated by the GUI designer. Do not modify.
namespace Stetic
@@ -6,9 +7,10 @@ namespace Stetic
{
private static bool initialized;
- internal static void Initialize (Gtk.Widget iconRenderer)
+ internal static void Initialize(Gtk.Widget iconRenderer)
{
- if ((Stetic.Gui.initialized == false)) {
+ if ((Stetic.Gui.initialized == false))
+ {
Stetic.Gui.initialized = true;
}
}
@@ -17,98 +19,69 @@ namespace Stetic
internal class BinContainer
{
private Gtk.Widget child;
-
+
private Gtk.UIManager uimanager;
- public static BinContainer Attach (Gtk.Bin bin)
+ public static BinContainer Attach(Gtk.Bin bin)
{
- BinContainer bc = new BinContainer ();
- bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested);
- bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated);
- bin.Added += new Gtk.AddedHandler (bc.OnAdded);
+ BinContainer bc = new BinContainer();
+ bin.SizeRequested += new Gtk.SizeRequestedHandler(bc.OnSizeRequested);
+ bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated);
+ bin.Added += new Gtk.AddedHandler(bc.OnAdded);
return bc;
}
- private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args)
+ private void OnSizeRequested(object sender, Gtk.SizeRequestedArgs args)
{
- if ((this.child != null)) {
- args.Requisition = this.child.SizeRequest ();
+ if ((this.child != null))
+ {
+ args.Requisition = this.child.SizeRequest();
}
}
- private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args)
+ private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args)
{
- if ((this.child != null)) {
+ if ((this.child != null))
+ {
this.child.Allocation = args.Allocation;
}
}
- private void OnAdded (object sender, Gtk.AddedArgs args)
+ private void OnAdded(object sender, Gtk.AddedArgs args)
{
this.child = args.Widget;
}
- public void SetUiManager (Gtk.UIManager uim)
+ public void SetUiManager(Gtk.UIManager uim)
{
this.uimanager = uim;
- this.child.Realized += new System.EventHandler (this.OnRealized);
+ this.child.Realized += new System.EventHandler(this.OnRealized);
}
- private void OnRealized (object sender, System.EventArgs args)
+ private void OnRealized(object sender, System.EventArgs args)
{
- if ((this.uimanager != null)) {
+ if ((this.uimanager != null))
+ {
Gtk.Widget w;
w = this.child.Toplevel;
- if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) {
- ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup);
+ if (((w != null)
+ && typeof(Gtk.Window).IsInstanceOfType(w)))
+ {
+ ((Gtk.Window)(w)).AddAccelGroup(this.uimanager.AccelGroup);
this.uimanager = null;
}
}
}
}
- internal class IconLoader
- {
- public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size)
- {
- Gdk.Pixbuf res = widget.RenderIcon (name, size, null);
- if ((res != null)) {
- return res;
- } else {
- int sz;
- int sy;
- global::Gtk.Icon.SizeLookup (size, out sz, out sy);
- try {
- return Gtk.IconTheme.Default.LoadIcon (name, sz, 0);
- } catch (System.Exception) {
- if ((name != "gtk-missing-image")) {
- return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size);
- } else {
- Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz);
- Gdk.GC gc = new Gdk.GC (pmap);
- gc.RgbFgColor = new Gdk.Color (255, 255, 255);
- pmap.DrawRectangle (gc, true, 0, 0, sz, sz);
- gc.RgbFgColor = new Gdk.Color (0, 0, 0);
- pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1));
- gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
- gc.RgbFgColor = new Gdk.Color (255, 0, 0);
- pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4)));
- pmap.DrawLine (gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)));
- return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
- }
- }
- }
- }
- }
-
internal class ActionGroups
{
- public static Gtk.ActionGroup GetActionGroup (System.Type type)
+ public static Gtk.ActionGroup GetActionGroup(System.Type type)
{
- return Stetic.ActionGroups.GetActionGroup (type.FullName);
+ return Stetic.ActionGroups.GetActionGroup(type.FullName);
}
- public static Gtk.ActionGroup GetActionGroup (string name)
+ public static Gtk.ActionGroup GetActionGroup(string name)
{
return null;
}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/gui.stetic b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/gui.stetic
index 1f2e5837de..19f98120aa 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/gui.stetic
+++ b/main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/gui.stetic
@@ -7,9 +7,9 @@
<import>
<widget-library name="../../../../build/bin/MonoDevelop.Ide.dll" />
<widget-library name="../../../../build/AddIns/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.dll" />
- <widget-library name="../../../../build/AddIns/MonoDevelop.Debugger/MonoDevelop.Debugger.dll" />
<widget-library name="../../../../build/bin/Mono.TextEditor.dll" />
- <widget-library name="../../../../build/AddIns/DisplayBindings/SourceEditor/MonoDevelop.SourceEditor2.dll" internal="true" />
+ <widget-library name="../../../../external/xwt/Xwt.Gtk/bin/Debug/Xwt.Gtk.dll" />
+ <widget-library name="../../../../build/AddIns/DisplayBindings/SourceEditor/MonoDevelop.SourceEditor.dll" internal="true" />
</import>
<widget class="Gtk.Bin" id="MonoDevelop.SourceEditor.OptionPanels.GeneralOptionsPanel" design-size="454 364">
<property name="MemberName" />
@@ -734,6 +734,22 @@
<property name="Fill">False</property>
</packing>
</child>
+ <child>
+ <widget class="Gtk.CheckButton" id="checkbuttonEnableSelectionSurrounding">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Label" translatable="yes">Enable _selection surrounding keys</property>
+ <property name="DrawIndicator">True</property>
+ <property name="HasLabel">True</property>
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="Position">6</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
</widget>
</child>
</widget>
@@ -745,7 +761,7 @@
</packing>
</child>
<child>
- <widget class="Gtk.Label" id="GtkLabel6">
+ <widget class="Gtk.Label" id="GtkLabel7">
<property name="MemberName" />
<property name="Xalign">0</property>
<property name="LabelProp" translatable="yes">&lt;b&gt;Indentation&lt;/b&gt;</property>
@@ -833,7 +849,7 @@
</packing>
</child>
<child>
- <widget class="Gtk.Label" id="GtkLabel8">
+ <widget class="Gtk.Label" id="GtkLabel9">
<property name="MemberName" />
<property name="Xalign">0</property>
<property name="LabelProp" translatable="yes">&lt;b&gt;Navigation&lt;/b&gt;</property>
@@ -855,22 +871,6 @@
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
- <widget class="Gtk.CheckButton" id="useViModesCheck">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Label" translatable="yes">Use _Vi modes</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
<widget class="Gtk.HBox" id="hbox3">
<property name="MemberName" />
<property name="Spacing">6</property>
@@ -902,7 +902,7 @@
</child>
</widget>
<packing>
- <property name="Position">1</property>
+ <property name="Position">0</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
@@ -1171,16 +1171,10 @@
<property name="Type">Custom</property>
<property name="Relief">None</property>
<child>
- <widget class="Gtk.EventBox" id="eventbox2">
+ <widget class="MonoDevelop.Components.ImageView" id="image2">
<property name="MemberName" />
- <property name="AboveChild">True</property>
- <property name="VisibleWindow">False</property>
- <child>
- <widget class="Gtk.Image" id="image2">
- <property name="MemberName" />
- <property name="Pixbuf">stock:gtk-go-up Menu</property>
- </widget>
- </child>
+ <property name="IconId">gtk-go-up</property>
+ <property name="IconSize">Menu</property>
</widget>
</child>
</widget>
@@ -1198,16 +1192,10 @@
<property name="Type">Custom</property>
<property name="Relief">None</property>
<child>
- <widget class="Gtk.EventBox" id="eventbox3">
+ <widget class="MonoDevelop.Components.ImageView" id="image3">
<property name="MemberName" />
- <property name="AboveChild">True</property>
- <property name="VisibleWindow">False</property>
- <child>
- <widget class="Gtk.Image" id="image3">
- <property name="MemberName" />
- <property name="Pixbuf">stock:gtk-go-down Menu</property>
- </widget>
- </child>
+ <property name="IconId">gtk-go-down</property>
+ <property name="IconSize">Menu</property>
</widget>
</child>
</widget>
@@ -1225,16 +1213,10 @@
<property name="Type">Custom</property>
<property name="Relief">None</property>
<child>
- <widget class="Gtk.EventBox" id="eventbox4">
+ <widget class="MonoDevelop.Components.ImageView" id="image4">
<property name="MemberName" />
- <property name="AboveChild">True</property>
- <property name="VisibleWindow">False</property>
- <child>
- <widget class="Gtk.Image" id="image4">
- <property name="MemberName" />
- <property name="Pixbuf">stock:gtk-close Menu</property>
- </widget>
- </child>
+ <property name="IconId">gtk-close</property>
+ <property name="IconSize">Menu</property>
</widget>
</child>
</widget>
@@ -1281,16 +1263,10 @@
<property name="Type">Custom</property>
<property name="Relief">None</property>
<child>
- <widget class="Gtk.EventBox" id="eventbox5">
+ <widget class="MonoDevelop.Components.ImageView" id="image5">
<property name="MemberName" />
- <property name="AboveChild">True</property>
- <property name="VisibleWindow">False</property>
- <child>
- <widget class="Gtk.Image" id="image5">
- <property name="MemberName" />
- <property name="Pixbuf">stock:gtk-find-and-replace Menu</property>
- </widget>
- </child>
+ <property name="IconId">gtk-find-and-replace</property>
+ <property name="IconSize">Menu</property>
</widget>
</child>
</widget>
@@ -1312,16 +1288,10 @@
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
- <widget class="Gtk.EventBox" id="eventbox6">
+ <widget class="MonoDevelop.Components.ImageView" id="image6">
<property name="MemberName" />
- <property name="AboveChild">True</property>
- <property name="VisibleWindow">False</property>
- <child>
- <widget class="Gtk.Image" id="image6">
- <property name="MemberName" />
- <property name="Pixbuf">stock:gtk-find-and-replace Menu</property>
- </widget>
- </child>
+ <property name="IconId">gtk-find-and-replace</property>
+ <property name="IconSize">Menu</property>
</widget>
<packing>
<property name="Position">0</property>
@@ -1397,16 +1367,10 @@
<property name="Type">Custom</property>
<property name="Relief">None</property>
<child>
- <widget class="Gtk.EventBox" id="eventbox2">
+ <widget class="MonoDevelop.Components.ImageView" id="image2">
<property name="MemberName" />
- <property name="AboveChild">True</property>
- <property name="VisibleWindow">False</property>
- <child>
- <widget class="Gtk.Image" id="image2">
- <property name="MemberName" />
- <property name="Pixbuf">stock:gtk-jump-to Menu</property>
- </widget>
- </child>
+ <property name="IconId">gtk-jump-to</property>
+ <property name="IconSize">Menu</property>
</widget>
</child>
</widget>
@@ -1424,16 +1388,10 @@
<property name="Type">Custom</property>
<property name="Relief">None</property>
<child>
- <widget class="Gtk.EventBox" id="eventbox1">
+ <widget class="MonoDevelop.Components.ImageView" id="image1">
<property name="MemberName" />
- <property name="AboveChild">True</property>
- <property name="VisibleWindow">False</property>
- <child>
- <widget class="Gtk.Image" id="image1">
- <property name="MemberName" />
- <property name="Pixbuf">stock:gtk-close Menu</property>
- </widget>
- </child>
+ <property name="IconId">gtk-close</property>
+ <property name="IconSize">Menu</property>
</widget>
</child>
</widget>
@@ -2436,59 +2394,6 @@
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
- <widget class="Gtk.HBox" id="hbox1">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.Label" id="label2">
- <property name="MemberName" />
- <property name="LabelProp" translatable="yes">Completion list has</property>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.SpinButton" id="spinbutton1">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Upper">100</property>
- <property name="PageIncrement">10</property>
- <property name="StepIncrement">1</property>
- <property name="ClimbRate">1</property>
- <property name="Numeric">True</property>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label3">
- <property name="MemberName" />
- <property name="LabelProp" translatable="yes">rows</property>
- </widget>
- <packing>
- <property name="Position">2</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
<widget class="Gtk.Alignment" id="alignment3">
<property name="MemberName" />
<property name="LeftPadding">12</property>
@@ -2635,7 +2540,7 @@
</child>
</widget>
<packing>
- <property name="Position">1</property>
+ <property name="Position">0</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/find-options-22x32.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/find-options-22x32.png
new file mode 100644
index 0000000000..242c7f399d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/find-options-22x32.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/find-options-22x32@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/find-options-22x32@2x.png
new file mode 100644
index 0000000000..2ac79e1dea
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/find-options-22x32@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/find-options-22x32~dark.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/find-options-22x32~dark.png
new file mode 100644
index 0000000000..a34279810d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/find-options-22x32~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/find-options-22x32~dark@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/find-options-22x32~dark@2x.png
new file mode 100644
index 0000000000..f9dafa0b2f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/find-options-22x32~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-bookmark-15.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-bookmark-15.png
index 50b75050d0..9d85bdc169 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-bookmark-15.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-bookmark-15.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-bookmark-15@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-bookmark-15@2x.png
index 6e2df33c1b..a392c6d782 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-bookmark-15@2x.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-bookmark-15@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-bookmark-15~dark.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-bookmark-15~dark.png
new file mode 100644
index 0000000000..1d9477df8d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-bookmark-15~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-bookmark-15~dark@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-bookmark-15~dark@2x.png
new file mode 100644
index 0000000000..e60e88b61b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-bookmark-15~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-error-15.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-error-15.png
index 7cfe2604d9..dafe2f346f 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-error-15.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-error-15.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-error-15@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-error-15@2x.png
index b30b504b07..83afe23e8d 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-error-15@2x.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-error-15@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-warning-15.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-warning-15.png
index 9539699270..f7e2edb3ca 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-warning-15.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-warning-15.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-warning-15@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-warning-15@2x.png
index f72f42331c..0eef55b3d9 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-warning-15@2x.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/gutter-warning-15@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-busy-16.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-busy-16.png
index c350248a23..1dd9519c21 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-busy-16.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-busy-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-busy-16@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-busy-16@2x.png
index 6e7b4a077d..222c272b13 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-busy-16@2x.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-busy-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-busy-16~dark.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-busy-16~dark.png
new file mode 100644
index 0000000000..021435da5a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-busy-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-busy-16~dark@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-busy-16~dark@2x.png
new file mode 100644
index 0000000000..cdcf00008a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-busy-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-error-16.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-error-16.png
index 06185a2a51..b4e3e10680 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-error-16.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-error-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-error-16@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-error-16@2x.png
index 7a466198a2..5bd225090f 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-error-16@2x.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-error-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-error-16~dark.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-error-16~dark.png
new file mode 100644
index 0000000000..aa5754907f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-error-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-error-16~dark@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-error-16~dark@2x.png
new file mode 100644
index 0000000000..f39161e6cb
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-error-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-ok-16.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-ok-16.png
index d5824843a9..b220283313 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-ok-16.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-ok-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-ok-16@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-ok-16@2x.png
index 8674aebbf8..83d47c0537 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-ok-16@2x.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-ok-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-ok-16~dark.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-ok-16~dark.png
new file mode 100644
index 0000000000..a9292b0b4a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-ok-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-ok-16~dark@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-ok-16~dark@2x.png
new file mode 100644
index 0000000000..06d984df89
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-ok-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-suggestion-16.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-suggestion-16.png
index 7bd0114b4f..1fdf2bf0e6 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-suggestion-16.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-suggestion-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-suggestion-16@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-suggestion-16@2x.png
index 7e0f57994c..fa0ca940ac 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-suggestion-16@2x.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-suggestion-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-suggestion-16~dark.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-suggestion-16~dark.png
new file mode 100644
index 0000000000..4417225d40
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-suggestion-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-suggestion-16~dark@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-suggestion-16~dark@2x.png
new file mode 100644
index 0000000000..85f875ab31
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-suggestion-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-warning-16.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-warning-16.png
index d332c8658f..7314d71c29 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-warning-16.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-warning-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-warning-16@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-warning-16@2x.png
index ae2a84b99b..bdffb6d700 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-warning-16@2x.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-warning-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-warning-16~dark.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-warning-16~dark.png
new file mode 100644
index 0000000000..0ed4f689ac
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-warning-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-warning-16~dark@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-warning-16~dark@2x.png
new file mode 100644
index 0000000000..4bc5bec07f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/issues-warning-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16.png
new file mode 100644
index 0000000000..8cc3c5844a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16@2x.png
new file mode 100644
index 0000000000..7415b28288
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~dark.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~dark.png
new file mode 100644
index 0000000000..8915de07e5
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~dark@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~dark@2x.png
new file mode 100644
index 0000000000..f82447e0dc
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~dark~sel.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~dark~sel.png
new file mode 100644
index 0000000000..2fc1948ac2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~dark~sel@2x.png
new file mode 100644
index 0000000000..045e2802c4
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~sel.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~sel.png
new file mode 100644
index 0000000000..2fc1948ac2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~sel@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~sel@2x.png
new file mode 100644
index 0000000000..045e2802c4
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-appearance-16.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-appearance-16.png
deleted file mode 100644
index 536c7bdb27..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-appearance-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-appearance-16@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-appearance-16@2x.png
deleted file mode 100644
index 8883b8b5ec..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-appearance-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-behavior-16.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-behavior-16.png
deleted file mode 100644
index 536c7bdb27..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-behavior-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-behavior-16@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-behavior-16@2x.png
deleted file mode 100644
index 8883b8b5ec..0000000000
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-completion-behavior-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16.png
index 2272d20f00..bcc63b30ec 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16@2x.png
index be480ee9b7..9c9c38748c 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16@2x.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~dark.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~dark.png
new file mode 100644
index 0000000000..31eccd3bbe
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~dark@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~dark@2x.png
new file mode 100644
index 0000000000..239afa7929
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~dark~sel.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~dark~sel.png
new file mode 100644
index 0000000000..e66be7813b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~dark~sel@2x.png
new file mode 100644
index 0000000000..af9ca1824e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~sel.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~sel.png
new file mode 100644
index 0000000000..e66be7813b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~sel@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~sel@2x.png
new file mode 100644
index 0000000000..af9ca1824e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-markers-rulers-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16.png
index 878fd038b1..58c4976e67 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16@2x.png
index f5e72e78dc..0d30b0bf95 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16@2x.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~dark.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~dark.png
new file mode 100644
index 0000000000..b4c872be39
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~dark@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~dark@2x.png
new file mode 100644
index 0000000000..38eb036705
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~dark~sel.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~dark~sel.png
new file mode 100644
index 0000000000..f42642f5b2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~dark~sel@2x.png
new file mode 100644
index 0000000000..7562d51fe9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~sel.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~sel.png
new file mode 100644
index 0000000000..f42642f5b2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~sel@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~sel@2x.png
new file mode 100644
index 0000000000..7562d51fe9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-syntax-highlighting-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16.png
index bf175ec49a..9df636c7fd 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16@2x.png
index e4a86d4fd8..592c731b19 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16@2x.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~dark.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~dark.png
new file mode 100644
index 0000000000..1ea6159ced
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~dark@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~dark@2x.png
new file mode 100644
index 0000000000..1e7cac36f4
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~dark~sel.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~dark~sel.png
new file mode 100644
index 0000000000..27e58ecddb
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~dark~sel@2x.png
new file mode 100644
index 0000000000..734609deb7
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~sel.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~sel.png
new file mode 100644
index 0000000000..27e58ecddb
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~sel@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~sel@2x.png
new file mode 100644
index 0000000000..734609deb7
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-behavior-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16.png
index 3dee46575c..9e06aadb07 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16@2x.png
index e0e6d11f70..fb30076fd1 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16@2x.png
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~dark.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~dark.png
new file mode 100644
index 0000000000..6dd4e516ed
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~dark@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~dark@2x.png
new file mode 100644
index 0000000000..6ec43f0b00
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~dark~sel.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~dark~sel.png
new file mode 100644
index 0000000000..f275acd398
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~dark~sel@2x.png
new file mode 100644
index 0000000000..ba68c2b249
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~sel.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~sel.png
new file mode 100644
index 0000000000..f275acd398
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~sel@2x.png b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~sel@2x.png
new file mode 100644
index 0000000000..ba68c2b249
--- /dev/null
+++ b/main/src/addins/MonoDevelop.SourceEditor2/icons/prefs-text-editor-general-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit.Runners/MonoDevelop.UnitTesting.NUnit.Runners.csproj b/main/src/addins/MonoDevelop.UnitTesting.NUnit.Runners/MonoDevelop.UnitTesting.NUnit.Runners.csproj
new file mode 100644
index 0000000000..b652356828
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit.Runners/MonoDevelop.UnitTesting.NUnit.Runners.csproj
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{F4100131-BA38-4E16-B29D-9B404A22B7F8}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <RootNamespace>MonoDevelop.UnitTesting.NUnit.Runners</RootNamespace>
+ <AssemblyName>MonoDevelop.UnitTesting.NUnit.Runners</AssemblyName>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug</OutputPath>
+ <DefineConstants>DEBUG;</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>false</ConsolePause>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>false</ConsolePause>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="MyClass.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+</Project> \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit.Runners/MyClass.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit.Runners/MyClass.cs
new file mode 100644
index 0000000000..caaeb163d7
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit.Runners/MyClass.cs
@@ -0,0 +1,36 @@
+//
+// MyClass.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+namespace MonoDevelop.UnitTesting.NUnit.Runners
+{
+ public class MyClass
+ {
+ public MyClass ()
+ {
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit.Runners/Properties/AssemblyInfo.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit.Runners/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000..5b3c31357b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit.Runners/Properties/AssemblyInfo.cs
@@ -0,0 +1,52 @@
+//
+// AssemblyInfo.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+// Information about this assembly is defined by the following attributes.
+// Change them to the values specific to your project.
+
+[assembly: AssemblyTitle ("MonoDevelop.UnitTesting.NUnit.Runners")]
+[assembly: AssemblyDescription ("")]
+[assembly: AssemblyConfiguration ("")]
+[assembly: AssemblyCompany ("Xamarin")]
+[assembly: AssemblyProduct ("")]
+[assembly: AssemblyCopyright ("Xamarin, Inc (http://www.xamarin.com)")]
+[assembly: AssemblyTrademark ("")]
+[assembly: AssemblyCulture ("")]
+
+// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
+// The form "{Major}.{Minor}.*" will automatically update the build and revision,
+// and "{Major}.{Minor}.{Build}.*" will update just the revision.
+
+[assembly: AssemblyVersion ("1.0.*")]
+
+// The following attributes are used to specify the signing key for the assembly,
+// if desired. See the Mono documentation for more information about signing.
+
+//[assembly: AssemblyDelaySign(false)]
+//[assembly: AssemblyKeyFile("")]
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/AddinInfo.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit/AddinInfo.cs
new file mode 100644
index 0000000000..6a99bf020a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/AddinInfo.cs
@@ -0,0 +1,16 @@
+
+using System;
+using Mono.Addins;
+using Mono.Addins.Description;
+
+[assembly:Addin ("UnitTesting.NUnit",
+ Namespace = "MonoDevelop",
+ Version = MonoDevelop.BuildInfo.Version,
+ Category = "Testing")]
+
+[assembly:AddinName ("NUnit support")]
+[assembly:AddinDescription ("Integrates NUnit into the MonoDevelop IDE")]
+
+[assembly:AddinDependency ("Core", MonoDevelop.BuildInfo.Version)]
+[assembly:AddinDependency ("Ide", MonoDevelop.BuildInfo.Version)]
+[assembly:AddinDependency ("UnitTesting", MonoDevelop.BuildInfo.Version)]
diff --git a/main/src/addins/NUnit/AssemblyInfo.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit/AssemblyInfo.cs
index 7b21277467..7b21277467 100644
--- a/main/src/addins/NUnit/AssemblyInfo.cs
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/AssemblyInfo.cs
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/Makefile.am b/main/src/addins/MonoDevelop.UnitTesting.NUnit/Makefile.am
new file mode 100644
index 0000000000..313b99438e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS = NUnitRunner NUnit3Runner .
+
+include $(top_srcdir)/xbuild.include
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit.csproj b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit.csproj
new file mode 100644
index 0000000000..0d5a440146
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit.csproj
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{6224D87E-2AC1-4D9F-91ED-714F797297BF}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AssemblyName>MonoDevelop.UnitTesting.NUnit</AssemblyName>
+ <RootNamespace>MonoDevelop.UnitTesting.NUnit</RootNamespace>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>True</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>False</Optimize>
+ <OutputPath>..\..\..\build\AddIns\MonoDevelop.UnitTesting</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>3</WarningLevel>
+ <Execution>
+ <Execution clr-version="Net_2_0" />
+ </Execution>
+ <DefineConstants>DEBUG</DefineConstants>
+ <NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\build\AddIns\MonoDevelop.UnitTesting\MonoDevelop.NUnit.xml</DocumentationFile>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>True</Optimize>
+ <OutputPath>..\..\..\build\AddIns\MonoDevelop.UnitTesting</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>3</WarningLevel>
+ <Execution>
+ <Execution clr-version="Net_2_0" />
+ </Execution>
+ <DebugSymbols>true</DebugSymbols>
+ <NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\build\AddIns\MonoDevelop.UnitTesting\MonoDevelop.NUnit.xml</DocumentationFile>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Core" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
+ <Project>{7525BB88-6142-4A26-93B9-A30C6983390A}</Project>
+ <Name>MonoDevelop.Core</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\..\core\MonoDevelop.Ide\MonoDevelop.Ide.csproj">
+ <Project>{27096E7F-C91C-4AC6-B289-6897A701DF21}</Project>
+ <Name>MonoDevelop.Ide</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\external\mono-addins\Mono.Addins\Mono.Addins.csproj">
+ <Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
+ <Name>Mono.Addins</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\MonoDevelop.UnitTesting\MonoDevelop.UnitTesting.csproj">
+ <Project>{A7A4246D-CEC4-42DF-A3C1-C31B9F51C4EC}</Project>
+ <Name>MonoDevelop.UnitTesting</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="MonoDevelopNUnit.addin.xml">
+ <LogicalName>MonoDevelopNUnit.addin.xml</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="templates\images\nunit-library-project.png">
+ <LogicalName>nunit-library-project.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="templates\images\nunit-library-project%402x.png">
+ <LogicalName>nunit-library-project@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="templates\images\nunit-library-project~dark.png">
+ <LogicalName>nunit-library-project~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="templates\images\nunit-library-project~dark%402x.png">
+ <LogicalName>nunit-library-project~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="templates\NUnitAssemblyGroup.xpt.xml">
+ <LogicalName>NUnitAssemblyGroup.xpt.xml</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="templates\NUnitProject.xpt.xml">
+ <LogicalName>NUnitProject.xpt.xml</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="templates\NUnitProjectVBNet.xpt.xml">
+ <LogicalName>NUnitProjectVBNet.xpt.xml</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="templates\NUnitTestClass.xft.xml">
+ <LogicalName>NUnitTestClass.xft.xml</LogicalName>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="MonoDevelop.UnitTesting.NUnit\ExternalTestRunner.cs" />
+ <Compile Include="MonoDevelop.UnitTesting.NUnit\NUnitAssemblyTestSuite.cs" />
+ <Compile Include="MonoDevelop.UnitTesting.NUnit\NUnitProjectTestSuite.cs" />
+ <Compile Include="MonoDevelop.UnitTesting.NUnit\NUnitTestCase.cs" />
+ <Compile Include="MonoDevelop.UnitTesting.NUnit\NUnitTestSuite.cs" />
+ <Compile Include="MonoDevelop.UnitTesting.NUnit\SystemTestProvider.cs" />
+ <Compile Include="MonoDevelop.UnitTesting.NUnit\TcpTestListener.cs" />
+ <Compile Include="AddinInfo.cs" />
+ <Compile Include="AssemblyInfo.cs" />
+ <Compile Include="MonoDevelop.UnitTesting.NUnit\RemoteTestResult.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="templates\" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+</Project>
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/ExternalTestRunner.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/ExternalTestRunner.cs
new file mode 100644
index 0000000000..93b5eefb6a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/ExternalTestRunner.cs
@@ -0,0 +1,319 @@
+//
+// ExternalTestRunner.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.Reflection;
+using System.IO;
+using System.Collections;
+using System.Collections.Generic;
+using System.Threading;
+using System.Text;
+
+using MonoDevelop.Core;
+using MonoDevelop.Core.Execution;
+using MonoDevelop.Core.Assemblies;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.UnitTesting.NUnit.External
+{
+ class ExternalTestRunner: IDisposable
+ {
+ RemoteProcessConnection connection;
+ IRemoteEventListener listener;
+
+ public ExternalTestRunner ()
+ {
+ }
+
+ public Task Connect (NUnitVersion version, IExecutionHandler executionHandler = null, OperationConsole console = null)
+ {
+ var exePath = Path.Combine (Path.GetDirectoryName (GetType ().Assembly.Location), version.ToString (), "NUnitRunner.exe");
+ connection = new RemoteProcessConnection (exePath, executionHandler, console, Runtime.MainSynchronizationContext);
+ connection.AddListener (this);
+ return connection.Connect ();
+ }
+
+ public async Task<UnitTestResult> Run (IRemoteEventListener listener, string[] nameFilter, string path, string suiteName, List<string> supportAssemblies, string testRunnerType, string testRunnerAssembly, string crashLogFile)
+ {
+ this.listener = listener;
+
+ var msg = new RunRequest {
+ NameFilter = nameFilter,
+ Path = path,
+ SuiteName = suiteName,
+ SupportAssemblies = supportAssemblies.ToArray (),
+ TestRunnerType = testRunnerType,
+ TestRunnerAssembly = testRunnerAssembly,
+ CrashLogFile = crashLogFile
+ };
+
+ var r = (await connection.SendMessage (msg)).Result;
+
+ await connection.ProcessPendingMessages ();
+
+ return ToUnitTestResult (r);
+ }
+
+ UnitTestResult ToUnitTestResult (RemoteTestResult r)
+ {
+ if (r == null)
+ return null;
+
+ return new UnitTestResult {
+ TestDate = r.TestDate,
+ Status = (ResultStatus) (int)r.Status,
+ Passed = r.Passed,
+ Errors = r.Errors,
+ Failures = r.Failures,
+ Inconclusive = r.Inconclusive,
+ NotRunnable = r.NotRunnable,
+ Skipped = r.Skipped,
+ Ignored = r.Ignored,
+ Time = r.Time,
+ Message = r.Message,
+ StackTrace = r.StackTrace,
+ ConsoleOutput = r.ConsoleOutput,
+ ConsoleError = r.ConsoleError
+ };
+ }
+
+ public async Task<NunitTestInfo> GetTestInfo (string path, List<string> supportAssemblies)
+ {
+ var msg = new GetTestInfoRequest {
+ Path = path,
+ SupportAssemblies = supportAssemblies.ToArray ()
+ };
+
+ return (await connection.SendMessage (msg)).Result;
+ }
+
+ [MessageHandler]
+ public void OnTestStarted (TestStartedMessage msg)
+ {
+ listener.TestStarted (msg.TestCase);
+ }
+
+ [MessageHandler]
+ public void OnTestFinished (TestFinishedMessage msg)
+ {
+ listener.TestFinished (msg.TestCase, ToUnitTestResult (msg.Result));
+ }
+
+ [MessageHandler]
+ public void OnSuiteStarted (SuiteStartedMessage msg)
+ {
+ listener.SuiteStarted (msg.Suite);
+ }
+
+ [MessageHandler]
+ public void OnSuiteFinished (SuiteFinishedMessage msg)
+ {
+ listener.SuiteFinished (msg.Suite, ToUnitTestResult (msg.Result));
+ }
+
+ public void Dispose ()
+ {
+ connection.Dispose ();
+ }
+ }
+
+ class LocalTestMonitor: MarshalByRefObject, IRemoteEventListener
+ {
+ TestContext context;
+ UnitTest rootTest;
+// string rootFullName;
+ UnitTest runningTest;
+ bool singleTestRun;
+ UnitTestResult singleTestResult;
+ public bool Canceled;
+
+ public LocalTestMonitor (TestContext context, UnitTest rootTest, string rootFullName, bool singleTestRun)
+ {
+// this.rootFullName = rootFullName;
+ this.rootTest = rootTest;
+ this.context = context;
+ this.singleTestRun = singleTestRun;
+ }
+
+ public UnitTest RunningTest {
+ get { return runningTest; }
+ }
+
+ internal UnitTestResult SingleTestResult {
+ get {
+ if (singleTestResult == null)
+ singleTestResult = new UnitTestResult ();
+ return singleTestResult;
+ }
+ set {
+ singleTestResult = value;
+ }
+ }
+
+ void IRemoteEventListener.TestStarted (string testCase)
+ {
+ if (singleTestRun || Canceled)
+ return;
+
+ UnitTest t = GetLocalTest (testCase);
+ if (t == null)
+ return;
+
+ runningTest = t;
+ context.Monitor.BeginTest (t);
+ t.Status = TestStatus.Running;
+ }
+
+ void ProcessResult (UnitTestResult res)
+ {
+ if (string.IsNullOrEmpty (res.Message)) {
+ if (res.IsFailure)
+ res.Message = GettextCatalog.GetString ("Test failed");
+ else if (res.IsNotRun)
+ res.Message = GettextCatalog.GetString ("Test ignored");
+ else {
+ res.Message = GettextCatalog.GetString ("Test successful") + "\n\n";
+ res.Message += GettextCatalog.GetString ("Execution time: {0:0.00}ms", res.Time.TotalMilliseconds);
+ }
+ }
+ }
+
+ void IRemoteEventListener.TestFinished (string test, UnitTestResult result)
+ {
+ if (Canceled)
+ return;
+
+ ProcessResult (result);
+
+ if (singleTestRun) {
+ SingleTestResult = result;
+ return;
+ }
+
+ UnitTest t = GetLocalTest (test);
+ if (t == null)
+ return;
+
+ t.RegisterResult (context, result);
+ context.Monitor.EndTest (t, result);
+ t.Status = TestStatus.Ready;
+ runningTest = null;
+ }
+
+ void IRemoteEventListener.SuiteStarted (string suite)
+ {
+ if (singleTestRun || Canceled)
+ return;
+
+ UnitTest t = GetLocalTest (suite);
+ if (t == null)
+ return;
+
+ t.Status = TestStatus.Running;
+ context.Monitor.BeginTest (t);
+ }
+
+ void IRemoteEventListener.SuiteFinished (string suite, UnitTestResult result)
+ {
+ if (singleTestRun || Canceled)
+ return;
+
+ ProcessResult (result);
+
+ UnitTest t = GetLocalTest (suite);
+ if (t == null)
+ return;
+
+ t.RegisterResult (context, result);
+ t.Status = TestStatus.Ready;
+ context.Monitor.EndTest (t, result);
+ }
+
+ UnitTest GetLocalTest (string sname)
+ {
+ if (sname == null)
+ return null;
+ if (sname == "<root>")
+ return rootTest;
+ /*
+ if (sname.StartsWith (rootFullName)) {
+ sname = sname.Substring (rootFullName.Length);
+ }
+ if (sname.StartsWith ("."))
+ sname = sname.Substring (1);*/
+ UnitTest tt = FindTest (rootTest, sname);
+ return tt;
+ }
+
+ UnitTest FindTest (UnitTest t, string testPath)
+ {
+ var group = t as UnitTestGroup;
+ if (group == null)
+ return null;
+ return SearchRecursive (group, testPath);
+ }
+
+ UnitTest SearchRecursive (UnitTestGroup group, string testPath)
+ {
+ UnitTest result;
+ foreach (var t in group.Tests) {
+ if (t.TestId == testPath)
+ return t;
+ var childGroup = t as UnitTestGroup;
+ if (childGroup != null) {
+ result = SearchRecursive (childGroup, testPath);
+ if (result != null)
+ return result;
+ }
+ }
+ return null;
+ }
+
+ public override object InitializeLifetimeService ()
+ {
+ return null;
+ }
+ }
+
+ public interface IRemoteEventListener
+ {
+ void TestStarted (string testCase);
+ void TestFinished (string test, UnitTestResult result);
+ void SuiteStarted (string suite);
+ void SuiteFinished (string suite, UnitTestResult result);
+ }
+
+ public enum NUnitVersion
+ {
+ Unknown,
+ NUnit2,
+ NUnit3
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitAssemblyTestSuite.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitAssemblyTestSuite.cs
new file mode 100644
index 0000000000..8d08a3ab21
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitAssemblyTestSuite.cs
@@ -0,0 +1,763 @@
+//
+// NUnitAssemblyTestSuite.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.Reflection;
+using System.IO;
+using System.Collections;
+using System.Collections.Generic;
+using System.Threading;
+using System.Runtime.Serialization.Formatters.Binary;
+
+using MonoDevelop.Projects;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Execution;
+using MonoDevelop.UnitTesting.NUnit.External;
+using MonoDevelop.Ide;
+using System.Xml.Linq;
+using System.Linq;
+using System.Globalization;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.UnitTesting.NUnit
+{
+ public abstract class NUnitAssemblyTestSuite: UnitTestGroup
+ {
+ object locker = new object ();
+ UnitTest[] oldList;
+ TestInfoCache testInfoCache = new TestInfoCache ();
+ bool cacheLoaded;
+ DateTime lastAssemblyTime;
+
+ static Queue<LoadData> loadQueue = new Queue<LoadData> ();
+ static bool loaderRunning;
+
+ public virtual IList<string> UserAssemblyPaths {
+ get {
+ return null;
+ }
+ }
+
+ public NUnitAssemblyTestSuite (string name): base (name)
+ {
+ }
+
+ public NUnitAssemblyTestSuite (string name, WorkspaceObject ownerSolutionItem): base (name, ownerSolutionItem)
+ {
+ }
+
+ public override void Dispose ()
+ {
+ try {
+ if (TestInfoCachePath != null) {
+ testInfoCache.Write (TestInfoCachePath);
+ }
+ } catch {
+ }
+ base.Dispose ();
+ }
+
+ public NUnitVersion NUnitVersion { get; set; }
+
+ public override bool HasTests {
+ get {
+ return true;
+ }
+ }
+
+ public virtual void GetCustomTestRunner (out string assembly, out string type)
+ {
+ assembly = type = null;
+ }
+
+ public virtual void GetCustomConsoleRunner (out string command, out string args)
+ {
+ command = args = null;
+ }
+
+ ProcessExecutionCommand GetCustomConsoleRunnerCommand ()
+ {
+ string file, args;
+
+ GetCustomConsoleRunner (out file, out args);
+ file = file != null ? file.Trim () : null;
+ if (string.IsNullOrEmpty (file))
+ return null;
+
+ var cmd = Runtime.ProcessService.CreateCommand (file);
+ cmd.Arguments = args;
+ return cmd;
+ }
+
+ protected override void OnActiveConfigurationChanged ()
+ {
+ UpdateTests ();
+ base.OnActiveConfigurationChanged ();
+ }
+
+ internal SourceCodeLocation GetSourceCodeLocation (UnitTest test)
+ {
+ return GetSourceCodeLocation (test.FixtureTypeNamespace, test.FixtureTypeName, test.Name);
+ }
+
+ protected virtual SourceCodeLocation GetSourceCodeLocation (string fixtureTypeNamespace, string fixtureTypeName, string testName)
+ {
+ return null;
+ }
+
+ public override int CountTestCases ()
+ {
+ lock (locker) {
+ if (Status == TestStatus.Loading)
+ Monitor.Wait (locker, 10000);
+ }
+ return base.CountTestCases ();
+ }
+
+ protected bool RefreshRequired {
+ get {
+ return lastAssemblyTime != GetAssemblyTime ();
+ }
+ }
+
+ public override Task Refresh (CancellationToken ct)
+ {
+ return Task.Run (delegate {
+ lock (locker) {
+ try {
+ while (Status == TestStatus.Loading) {
+ Monitor.Wait (locker);
+ }
+ if (RefreshRequired) {
+ lastAssemblyTime = GetAssemblyTime ();
+ UpdateTests ();
+ OnCreateTests (); // Force loading
+ while (Status == TestStatus.Loading) {
+ Monitor.Wait (locker);
+ }
+ }
+ } catch {
+ }
+ }
+ });
+ }
+
+ DateTime GetAssemblyTime ()
+ {
+ string path = AssemblyPath;
+ if (File.Exists (path))
+ return File.GetLastWriteTime (path);
+ else
+ return DateTime.MinValue;
+ }
+
+
+ protected override void OnCreateTests ()
+ {
+ lock (locker) {
+ if (Status == TestStatus.Loading)
+ return;
+
+ NunitTestInfo ti = testInfoCache.GetInfo (AssemblyPath);
+ if (ti != null) {
+ FillTests (ti);
+ return;
+ }
+
+ Status = TestStatus.Loading;
+ }
+
+ lastAssemblyTime = GetAssemblyTime ();
+
+ if (oldList != null) {
+ foreach (UnitTest t in oldList)
+ Tests.Add (t);
+ }
+
+ OnTestStatusChanged ();
+
+ LoadData ld = new LoadData ();
+ ld.Path = AssemblyPath;
+ ld.TestInfoCachePath = cacheLoaded ? null : TestInfoCachePath;
+ ld.Callback = delegate {
+ Runtime.RunInMainThread (delegate {
+ AsyncCreateTests (ld);
+ });
+ };
+ ld.SupportAssemblies = new List<string> (SupportAssemblies);
+ ld.NUnitVersion = NUnitVersion;
+
+ AsyncLoadTest (ld);
+
+ // Read the cache from disk only once
+ cacheLoaded = true;
+ }
+
+ void AsyncCreateTests (object ob)
+ {
+ TestStatus newStatus = TestStatus.Ready;
+
+ try {
+ LoadData loadData = (LoadData) ob;
+
+ if (loadData.Error != null) {
+ newStatus = TestStatus.LoadError;
+ return;
+ }
+
+ Tests.Clear ();
+
+ if (loadData.Info == null) {
+ oldList = new UnitTest [0];
+ return;
+ }
+
+ FillTests (loadData.Info);
+
+ // If the async loader has loaded a cache, reuse it.
+ if (loadData.InfoCache != null)
+ testInfoCache = loadData.InfoCache;
+
+ testInfoCache.SetInfo (AssemblyPath, loadData.Info);
+ }
+ catch (Exception ex) {
+ LoggingService.LogError (ex.ToString ());
+ newStatus = TestStatus.LoadError;
+ }
+ finally {
+ lock (locker) {
+ Status = newStatus;
+ Monitor.PulseAll (locker);
+ }
+ OnTestChanged ();
+ }
+ }
+
+ void FillTests (NunitTestInfo ti)
+ {
+ if (ti.Tests == null)
+ return;
+ foreach (NunitTestInfo test in ti.Tests) {
+ UnitTest newTest;
+ if (test.Tests != null)
+ newTest = new NUnitTestSuite (this, test);
+ else
+ newTest = new NUnitTestCase (this, test, test.PathName);
+ newTest.FixtureTypeName = test.FixtureTypeName;
+ newTest.FixtureTypeNamespace = test.FixtureTypeNamespace;
+ Tests.Add (newTest);
+
+ }
+ oldList = new UnitTest [Tests.Count];
+ Tests.CopyTo (oldList, 0);
+ }
+
+ static void AsyncLoadTest (LoadData ld)
+ {
+ lock (loadQueue) {
+ if (!loaderRunning) {
+ Thread t = new Thread (new ThreadStart (RunAsyncLoadTest));
+ t.Name = "NUnit test loader";
+ t.IsBackground = true;
+ t.Start ();
+ loaderRunning = true;
+ }
+ loadQueue.Enqueue (ld);
+ Monitor.Pulse (loadQueue);
+ }
+ }
+
+ static void RunAsyncLoadTest ()
+ {
+ while (true) {
+ LoadData ld;
+ lock (loadQueue) {
+ if (loadQueue.Count == 0) {
+ if (!Monitor.Wait (loadQueue, 5000, true)) {
+ loaderRunning = false;
+ return;
+ }
+ }
+ ld = (LoadData)loadQueue.Dequeue ();
+ }
+
+ try {
+ // If the information is cached in a file and it is up to date information,
+ // there is no need to parse again the assembly.
+
+ if (ld.TestInfoCachePath != null && File.Exists (ld.TestInfoCachePath)) {
+ ld.InfoCache = TestInfoCache.Read (ld.TestInfoCachePath);
+ NunitTestInfo info = ld.InfoCache.GetInfo (ld.Path);
+ if (info != null) {
+ ld.Info = info;
+ ld.Callback (ld);
+ continue;
+ }
+ }
+ } catch (Exception ex) {
+ LoggingService.LogError (ex.ToString ());
+ }
+
+ ExternalTestRunner runner = null;
+
+ try {
+ if (File.Exists (ld.Path)) {
+ runner = new ExternalTestRunner ();
+ runner.Connect (ld.NUnitVersion).Wait ();
+ ld.Info = runner.GetTestInfo (ld.Path, ld.SupportAssemblies).Result;
+ }
+ } catch (Exception ex) {
+ Console.WriteLine (ex);
+ ld.Error = ex;
+ }
+ finally {
+ try {
+ if (runner != null)
+ runner.Dispose ();
+ } catch {}
+ }
+
+ try {
+ ld.Callback (ld);
+ } catch {
+ }
+ }
+ }
+
+ protected override UnitTestResult OnRun (TestContext testContext)
+ {
+ return RunUnitTest (this, "", "", null, testContext);
+ }
+
+ protected override bool OnCanRun (MonoDevelop.Core.Execution.IExecutionHandler executionContext)
+ {
+ var runnerCmd = GetCustomConsoleRunnerCommand ();
+ if (runnerCmd != null) {
+ return executionContext.CanExecute (runnerCmd);
+ }
+ return Runtime.ProcessService.IsValidForRemoteHosting (executionContext);
+ }
+
+ public string[] CollectTests (UnitTestGroup group)
+ {
+ List<string> result = new List<string> ();
+ foreach (var t in group.Tests) {
+ if (t.IsExplicit)
+ continue;
+ if (t is UnitTestGroup) {
+ result.AddRange (CollectTests ((UnitTestGroup)t));
+ } else {
+ result.Add (t.TestId);
+ }
+ }
+ return result.ToArray ();
+ }
+
+ internal UnitTestResult RunUnitTest (UnitTest test, string suiteName, string pathName, string testName, TestContext testContext)
+ {
+ var runnerExe = GetCustomConsoleRunnerCommand ();
+ if (runnerExe != null)
+ return RunWithConsoleRunner (runnerExe, test, suiteName, pathName, testName, testContext);
+
+ var console = testContext.ExecutionContext.ConsoleFactory.CreateConsole ();
+
+ ExternalTestRunner runner = new ExternalTestRunner ();
+ runner.Connect (NUnitVersion, testContext.ExecutionContext.ExecutionHandler, console).Wait ();
+ LocalTestMonitor localMonitor = new LocalTestMonitor (testContext, test, suiteName, testName != null);
+
+ string[] filter = null;
+ if (test != null) {
+ if (test is UnitTestGroup && NUnitVersion == NUnitVersion.NUnit2) {
+ filter = CollectTests ((UnitTestGroup)test);
+ } else if (test.TestId != null) {
+ filter = new string [] { test.TestId };
+ }
+ }
+
+ RunData rd = new RunData ();
+ rd.Runner = runner;
+ rd.Test = this;
+ rd.LocalMonitor = localMonitor;
+
+ var cancelReg = testContext.Monitor.CancellationToken.Register (rd.Cancel);
+
+ UnitTestResult result;
+ var crashLogFile = Path.GetTempFileName ();
+
+ try {
+ if (string.IsNullOrEmpty (AssemblyPath)) {
+ string msg = GettextCatalog.GetString ("Could not get a valid path to the assembly. There may be a conflict in the project configurations.");
+ throw new Exception (msg);
+ }
+
+ string testRunnerAssembly, testRunnerType;
+ GetCustomTestRunner (out testRunnerAssembly, out testRunnerType);
+
+ testContext.Monitor.CancellationToken.ThrowIfCancellationRequested ();
+
+ result = runner.Run (localMonitor, filter, AssemblyPath, "", new List<string> (SupportAssemblies), testRunnerType, testRunnerAssembly, crashLogFile).Result;
+ if (testName != null)
+ result = localMonitor.SingleTestResult;
+
+ ReportCrash (testContext, crashLogFile);
+
+ } catch (Exception ex) {
+ if (ReportCrash (testContext, crashLogFile)) {
+ result = UnitTestResult.CreateFailure (GettextCatalog.GetString ("Unhandled exception"), null);
+ }
+ else if (!localMonitor.Canceled) {
+ LoggingService.LogError (ex.ToString ());
+ if (localMonitor.RunningTest != null) {
+ RuntimeErrorCleanup (testContext, localMonitor.RunningTest, ex);
+ } else {
+ testContext.Monitor.ReportRuntimeError (null, ex);
+ throw;
+ }
+ result = UnitTestResult.CreateFailure (ex);
+ } else {
+ result = UnitTestResult.CreateFailure (GettextCatalog.GetString ("Canceled"), null);
+ }
+ } finally {
+ if (console != null)
+ console.Dispose ();
+ cancelReg.Dispose ();
+ runner.Dispose ();
+ File.Delete (crashLogFile);
+ }
+
+ return result;
+ }
+
+ bool ReportCrash (TestContext testContext, string crashLogFile)
+ {
+ var crash = File.ReadAllText (crashLogFile);
+ if (crash.Length == 0)
+ return false;
+
+ var ex = RemoteUnhandledException.Parse (crash);
+ testContext.Monitor.ReportRuntimeError (GettextCatalog.GetString ("Unhandled exception"), ex);
+ return true;
+ }
+
+ void RuntimeErrorCleanup (TestContext testContext, UnitTest t, Exception ex)
+ {
+ UnitTestResult result = UnitTestResult.CreateFailure (ex);
+ t.RegisterResult (testContext, result);
+ while (t != null && t != this) {
+ testContext.Monitor.EndTest (t, result);
+ t.Status = TestStatus.Ready;
+ t = t.Parent;
+ }
+ }
+
+ UnitTestResult RunWithConsoleRunner (ProcessExecutionCommand cmd, UnitTest test, string suiteName, string pathName, string testName, TestContext testContext)
+ {
+ var outFile = Path.GetTempFileName ();
+ var xmlOutputConsole = new LocalConsole ();
+ var appDebugOutputConsole = testContext.ExecutionContext.ConsoleFactory.CreateConsole ();
+ OperationConsole cons;
+ if (appDebugOutputConsole != null) {
+ cons = new MultipleOperationConsoles (appDebugOutputConsole, xmlOutputConsole);
+ } else {
+ cons = xmlOutputConsole;
+ }
+ try {
+ MonoDevelop.UnitTesting.NUnit.External.TcpTestListener tcpListener = null;
+ LocalTestMonitor localMonitor = new LocalTestMonitor (testContext, test, suiteName, testName != null);
+
+ if (!string.IsNullOrEmpty (cmd.Arguments))
+ cmd.Arguments += " ";
+ cmd.Arguments += "\"-xml=" + outFile + "\" " + AssemblyPath;
+
+ bool automaticUpdates = cmd.Command != null && (cmd.Command.Contains ("GuiUnit") || (cmd.Command.Contains ("mdtool.exe") && cmd.Arguments.Contains ("run-md-tests")));
+ if (!string.IsNullOrEmpty(pathName))
+ cmd.Arguments += " -run=\"" + test.TestId.Replace("\"", "\\\"") + "\"";
+ if (automaticUpdates) {
+ tcpListener = new MonoDevelop.UnitTesting.NUnit.External.TcpTestListener (localMonitor, suiteName);
+ cmd.Arguments += " -port=" + tcpListener.Port;
+ }
+
+ // Note that we always dispose the tcp listener as we don't want it listening
+ // forever if the test runner does not try to connect to it
+ using (tcpListener) {
+ var handler = testContext.ExecutionContext.ExecutionHandler;
+
+ if (handler == null)
+ handler = Runtime.ProcessService.DefaultExecutionHandler;
+
+ var p = handler.Execute (cmd, cons);
+ using (testContext.Monitor.CancellationToken.Register (p.Cancel))
+ p.Task.Wait ();
+
+ if (new FileInfo (outFile).Length == 0)
+ throw new Exception ("Command failed");
+ }
+
+ // mdtool.exe does not necessarily guarantee we get automatic updates. It just guarantees
+ // that if guiunit is being used then it will give us updates. If you have a regular test
+ // assembly compiled against nunit.framework.dll
+ if (automaticUpdates && tcpListener.HasReceivedConnection) {
+ if (testName != null)
+ return localMonitor.SingleTestResult;
+ return test.GetLastResult ();
+ }
+
+ XDocument doc = XDocument.Load (outFile);
+
+ if (doc.Root != null) {
+ var root = doc.Root.Elements ("test-suite").FirstOrDefault ();
+ if (root != null) {
+ xmlOutputConsole.SetDone ();
+ var ot = xmlOutputConsole.OutReader.ReadToEnd ();
+ var et = xmlOutputConsole.ErrorReader.ReadToEnd ();
+ testContext.Monitor.WriteGlobalLog (ot);
+ if (!string.IsNullOrEmpty (et)) {
+ testContext.Monitor.WriteGlobalLog ("ERROR:\n");
+ testContext.Monitor.WriteGlobalLog (et);
+ }
+
+ bool macunitStyle = doc.Root.Element ("environment") != null && doc.Root.Element ("environment").Attribute ("macunit-version") != null;
+ var result = ReportXmlResult (localMonitor, root, "", macunitStyle);
+ if (testName != null)
+ result = localMonitor.SingleTestResult;
+ return result;
+ }
+ }
+ throw new Exception ("Test results could not be parsed.");
+ } catch (Exception ex) {
+ xmlOutputConsole.SetDone ();
+ var ot = xmlOutputConsole.OutReader.ReadToEnd ();
+ var et = xmlOutputConsole.ErrorReader.ReadToEnd ();
+ testContext.Monitor.WriteGlobalLog (ot);
+ if (!string.IsNullOrEmpty (et)) {
+ testContext.Monitor.WriteGlobalLog ("ERROR:\n");
+ testContext.Monitor.WriteGlobalLog (et);
+ }
+ testContext.Monitor.ReportRuntimeError ("Test execution failed.\n" + ot + "\n" + et, ex);
+ return UnitTestResult.CreateIgnored ("Test execution failed");
+ } finally {
+ File.Delete (outFile);
+ cons.Dispose ();
+ }
+ }
+
+ UnitTestResult ReportXmlResult (IRemoteEventListener listener, XElement elem, string testPrefix, bool macunitStyle)
+ {
+ UnitTestResult result = new UnitTestResult ();
+ var time = (string)elem.Attribute ("time");
+ if (time != null)
+ result.Time = TimeSpan.FromSeconds (double.Parse (time, CultureInfo.InvariantCulture));
+ result.TestDate = DateTime.Now;
+
+ var reason = elem.Element ("reason");
+ if (reason != null)
+ result.Message = (string) reason;
+
+ var failure = elem.Element ("failure");
+ if (failure != null) {
+ var msg = failure.Element ("message");
+ if (msg != null)
+ result.Message = (string)msg;
+ var stack = failure.Element ("stack-trace");
+ if (stack != null)
+ result.StackTrace = (string)stack;
+ }
+
+ switch ((string)elem.Attribute ("result")) {
+ case "Error":
+ case "Failure":
+ result.Status = ResultStatus.Failure;
+ break;
+ case "Success":
+ result.Status = ResultStatus.Success;
+ break;
+ case "Ignored":
+ result.Status = ResultStatus.Ignored;
+ break;
+ default:
+ result.Status = ResultStatus.Inconclusive;
+ break;
+ }
+
+ if (elem.Name == "test-suite") {
+ // nunitlite does not emit <test-suite type="Namespace" elements so we need to fake
+ // them by deconstructing the full type name and emitting the suite started events manually
+ var names = new List<string> ();
+ if (!macunitStyle || (string)elem.Attribute ("type") == "Assembly")
+ names.Add ("<root>");
+ else
+ names.AddRange (elem.Attribute ("name").Value.Split ('.'));
+
+ for (int i = 0; i < names.Count; i ++)
+ listener.SuiteStarted (testPrefix + string.Join (".", names.Take (i + 1)));
+
+ var name = (string)elem.Attribute ("type") == "Assembly" ? "<root>" : (string) elem.Attribute ("name");
+ var cts = elem.Element ("results");
+ if (cts != null) {
+ foreach (var ct in cts.Elements ()) {
+ var r = ReportXmlResult (listener, ct, name != "<root>" ? testPrefix + name + "." : "", macunitStyle);
+ result.Add (r);
+ }
+ }
+ for (int i = 0; i < names.Count; i ++)
+ listener.SuiteFinished (testPrefix + string.Join (".", names.Take (i + 1)), result);
+ } else {
+ string name = (string)elem.Attribute ("name");
+ switch (result.Status) {
+ case ResultStatus.Success:
+ result.Passed++;
+ break;
+ case ResultStatus.Failure:
+ result.Failures++;
+ break;
+ case ResultStatus.Ignored:
+ result.Ignored++;
+ break;
+ case ResultStatus.Inconclusive:
+ result.Inconclusive++;
+ break;
+ }
+
+ listener.TestStarted (name);
+ listener.TestFinished (name, result);
+ }
+ return result;
+ }
+
+ protected abstract string AssemblyPath {
+ get;
+ }
+
+ protected virtual IEnumerable<string> SupportAssemblies {
+ get { yield break; }
+ }
+
+ // File where cached test info for this test suite will be saved
+ // Returns null by default which means that test info will not be saved.
+ protected virtual string TestInfoCachePath {
+ get { return null; }
+ }
+
+ class LoadData
+ {
+ public string Path;
+ public string TestInfoCachePath;
+ public Exception Error;
+ public NunitTestInfo Info;
+ public TestInfoCache InfoCache;
+ public WaitCallback Callback;
+ public List<string> SupportAssemblies;
+ public NUnitVersion NUnitVersion;
+ }
+
+ class RunData
+ {
+ public ExternalTestRunner Runner;
+ public UnitTest Test;
+ public LocalTestMonitor LocalMonitor;
+
+ public void Cancel ()
+ {
+ LocalMonitor.Canceled = true;
+ Runner.Dispose ();
+ ClearRunningStatus (Test);
+ }
+
+ void ClearRunningStatus (UnitTest t)
+ {
+ t.Status = TestStatus.Ready;
+ UnitTestGroup group = t as UnitTestGroup;
+ if (group == null) return;
+ foreach (UnitTest ct in group.Tests)
+ ClearRunningStatus (ct);
+ }
+ }
+
+ [Serializable]
+ class TestInfoCache
+ {
+ Hashtable table = new Hashtable ();
+
+ [NonSerialized]
+ bool modified;
+
+ public void SetInfo (string path, NunitTestInfo info)
+ {
+ if (File.Exists (path)) {
+ CachedTestInfo cti = new CachedTestInfo ();
+ cti.LastWriteTime = File.GetLastWriteTime (path);
+ cti.Info = info;
+ table [path] = cti;
+ modified = true;
+ }
+ }
+
+ public NunitTestInfo GetInfo (string path)
+ {
+ CachedTestInfo cti = (CachedTestInfo) table [path];
+ if (cti != null && File.Exists (path) && File.GetLastWriteTime (path) == cti.LastWriteTime)
+ return cti.Info;
+ else
+ return null;
+ }
+
+ public static TestInfoCache Read (string file)
+ {
+ BinaryFormatter bf = new BinaryFormatter ();
+ Stream s = new FileStream (file, FileMode.Open, FileAccess.Read);
+ try {
+ return (TestInfoCache) bf.Deserialize (s);
+ } finally {
+ s.Close ();
+ }
+ }
+
+ public void Write (string file)
+ {
+ if (modified) {
+ BinaryFormatter bf = new BinaryFormatter ();
+ Stream s = new FileStream (file, FileMode.Create, FileAccess.Write);
+ try {
+ bf.Serialize (s, this);
+ } finally {
+ s.Close ();
+ }
+ }
+ }
+ }
+
+ [Serializable]
+ class CachedTestInfo
+ {
+ public DateTime LastWriteTime;
+ public NunitTestInfo Info;
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitProjectTestSuite.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitProjectTestSuite.cs
new file mode 100644
index 0000000000..a14d2e4088
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitProjectTestSuite.cs
@@ -0,0 +1,203 @@
+//
+// NUnitProjectTestSuite.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System.IO;
+using System.Linq;
+using System.Collections.Generic;
+
+using MonoDevelop.Projects;
+using MonoDevelop.Ide;
+using MonoDevelop.Ide.TypeSystem;
+using System;
+using System.Threading;
+using ProjectReference = MonoDevelop.Projects.ProjectReference;
+using System.Threading.Tasks;
+using MonoDevelop.UnitTesting.NUnit.External;
+using System.Reflection;
+using MonoDevelop.Ide.Gui.Components;
+using MonoDevelop.Core.Assemblies;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.UnitTesting.NUnit
+{
+ public class NUnitProjectTestSuite: NUnitAssemblyTestSuite
+ {
+ DotNetProject project;
+ string resultsPath;
+ string storeId;
+
+ public override IList<string> UserAssemblyPaths {
+ get {
+ return project.GetUserAssemblyPaths (IdeApp.Workspace.ActiveConfiguration);
+ }
+ }
+
+ public NUnitProjectTestSuite (DotNetProject project, NUnitVersion version): base (project.Name, project)
+ {
+ NUnitVersion = version;
+ storeId = Path.GetFileName (project.FileName);
+ resultsPath = UnitTestService.GetTestResultsDirectory (project.BaseDirectory);
+ ResultsStore = new BinaryResultsStore (resultsPath, storeId);
+ this.project = project;
+ project.NameChanged += OnProjectRenamed;
+ IdeApp.ProjectOperations.EndBuild += OnProjectBuilt;
+ }
+
+ protected override async Task OnBuild ()
+ {
+ await IdeApp.ProjectOperations.Build (project).Task;
+ OnProjectBuilt (null, null);
+ }
+
+ public static NUnitProjectTestSuite CreateTest (DotNetProject project)
+ {
+ if (!project.ParentSolution.GetConfiguration (IdeApp.Workspace.ActiveConfiguration).BuildEnabledForItem (project))
+ return null;
+
+ foreach (var p in project.References) {
+ var nv = GetNUnitVersion (p);
+ if (nv != null)
+ return new NUnitProjectTestSuite (project, nv.Value);
+ }
+ return null;
+ }
+
+ public static bool IsNUnitReference (ProjectReference p)
+ {
+ return GetNUnitVersion (p).HasValue;
+ }
+
+ public static NUnitVersion? GetNUnitVersion (ProjectReference p)
+ {
+ if (p.Reference.IndexOf ("GuiUnit", StringComparison.OrdinalIgnoreCase) != -1 || p.Reference.IndexOf ("nunitlite", StringComparison.OrdinalIgnoreCase) != -1)
+ return NUnitVersion.NUnit2;
+ if (p.Reference.IndexOf ("nunit.framework", StringComparison.OrdinalIgnoreCase) != -1) {
+ var selector = p.Project?.DefaultConfiguration.Selector;
+ if (selector == null)
+ return NUnitVersion.Unknown;
+
+ var f = p.GetReferencedFileNames (selector).FirstOrDefault ();
+ if (f != null && File.Exists (f)) {
+ try {
+ var aname = new AssemblyName (SystemAssemblyService.GetAssemblyName (f));
+ if (aname.Version.Major == 2)
+ return NUnitVersion.NUnit2;
+ else
+ return NUnitVersion.NUnit3;
+ } catch (Exception ex) {
+ LoggingService.LogError ("Could not get assembly version", ex);
+ }
+ }
+ }
+ return null;
+ }
+
+ protected override SourceCodeLocation GetSourceCodeLocation (string fixtureTypeNamespace, string fixtureTypeName, string testName)
+ {
+ if (string.IsNullOrEmpty (fixtureTypeName) || string.IsNullOrEmpty (fixtureTypeName))
+ return null;
+ var task = NUnitSourceCodeLocationFinder.TryGetSourceCodeLocationAsync (project, fixtureTypeNamespace, fixtureTypeName, testName);
+ if (!task.Wait (2000))
+ return null;
+ return task.Result;
+
+ }
+
+ public override void Dispose ()
+ {
+ project.NameChanged -= OnProjectRenamed;
+ IdeApp.ProjectOperations.EndBuild -= OnProjectBuilt;
+ base.Dispose ();
+ }
+
+ void OnProjectRenamed (object sender, SolutionItemRenamedEventArgs e)
+ {
+ UnitTestGroup parent = Parent as UnitTestGroup;
+ if (parent != null)
+ parent.UpdateTests ();
+ }
+
+ void OnProjectBuilt (object s, BuildEventArgs args)
+ {
+ if (RefreshRequired)
+ UpdateTests ();
+ }
+
+ public override void GetCustomTestRunner (out string assembly, out string type)
+ {
+ type = project.ProjectProperties.GetValue ("TestRunnerType");
+ var asm = project.ProjectProperties.GetValue ("TestRunnerAssembly");
+ assembly = asm != null ? project.BaseDirectory.Combine (asm.ToString ()).ToString () : null;
+ }
+
+ public override void GetCustomConsoleRunner (out string command, out string args)
+ {
+ var r = project.ProjectProperties.GetPathValue ("TestRunnerCommand");
+ command = !string.IsNullOrEmpty (r) ? project.BaseDirectory.Combine (r).ToString () : null;
+ args = project.ProjectProperties.GetValue ("TestRunnerArgs");
+ if (command == null && args == null) {
+ var guiUnit = project.References.FirstOrDefault (pref => pref.ReferenceType == ReferenceType.Assembly && StringComparer.OrdinalIgnoreCase.Equals (Path.GetFileName (pref.Reference), "GuiUnit.exe"));
+ if (guiUnit != null) {
+ command = guiUnit.Reference;
+ }
+
+ var projectReference = project.References.FirstOrDefault (pref => pref.ReferenceType == ReferenceType.Project && pref.Reference.StartsWith ("GuiUnit", StringComparison.OrdinalIgnoreCase));
+ if (IdeApp.IsInitialized && command == null && projectReference != null) {
+ var guiUnitProject = IdeApp.Workspace.GetAllProjects ().First (f => f.Name == projectReference.Reference);
+ if (guiUnitProject != null)
+ command = guiUnitProject.GetOutputFileName (IdeApp.Workspace.ActiveConfiguration);
+ }
+ }
+ }
+
+ protected override string AssemblyPath {
+ get { return project.GetOutputFileName (IdeApp.Workspace.ActiveConfiguration); }
+ }
+
+ protected override string TestInfoCachePath {
+ get { return Path.Combine (resultsPath, storeId + ".test-cache"); }
+ }
+
+ protected override IEnumerable<string> SupportAssemblies {
+ get {
+ // Referenced assemblies which are not in the gac and which are not localy copied have to be preloaded
+ DotNetProject project = base.OwnerSolutionItem as DotNetProject;
+ if (project != null) {
+ foreach (var pr in project.References) {
+ if (pr.ReferenceType != ReferenceType.Package && !pr.LocalCopy && pr.ReferenceOutputAssembly) {
+ foreach (string file in pr.GetReferencedFileNames (IdeApp.Workspace.ActiveConfiguration))
+ yield return file;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitTestCase.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitTestCase.cs
new file mode 100644
index 0000000000..968d750e07
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitTestCase.cs
@@ -0,0 +1,75 @@
+//
+// NUnitTestCase.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+
+using MonoDevelop.UnitTesting.NUnit.External;
+
+namespace MonoDevelop.UnitTesting.NUnit
+{
+ class NUnitTestCase: UnitTest
+ {
+ NUnitAssemblyTestSuite rootSuite;
+ string className;
+ string pathName;
+
+ public NUnitTestCase (NUnitAssemblyTestSuite rootSuite, NunitTestInfo tinfo, string className) : base (tinfo.Name)
+ {
+ this.className = className;
+ this.pathName = tinfo.PathName;
+ this.rootSuite = rootSuite;
+ this.TestId = tinfo.TestId;
+ this.IsExplicit = tinfo.IsExplicit;
+ }
+
+ protected override UnitTestResult OnRun (TestContext testContext)
+ {
+ return rootSuite.RunUnitTest (this, className, pathName, Name, testContext);
+ }
+
+ protected override bool OnCanRun (MonoDevelop.Core.Execution.IExecutionHandler executionContext)
+ {
+ return rootSuite.CanRun (executionContext);
+ }
+
+
+ public override SourceCodeLocation SourceCodeLocation {
+ get {
+ UnitTest p = Parent;
+ while (p != null) {
+ NUnitAssemblyTestSuite root = p as NUnitAssemblyTestSuite;
+ if (root != null)
+ return root.GetSourceCodeLocation (this);
+ p = p.Parent;
+ }
+ return null;
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitTestSuite.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitTestSuite.cs
new file mode 100644
index 0000000000..77d6629e88
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitTestSuite.cs
@@ -0,0 +1,100 @@
+//
+// NUnitTestSuite.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using MonoDevelop.UnitTesting.NUnit.External;
+
+namespace MonoDevelop.UnitTesting.NUnit
+{
+ class NUnitTestSuite: UnitTestGroup
+ {
+ NunitTestInfo testInfo;
+ NUnitAssemblyTestSuite rootSuite;
+ string fullName;
+
+ public NUnitTestSuite (NUnitAssemblyTestSuite rootSuite, NunitTestInfo tinfo): base (tinfo.Name)
+ {
+ fullName = !string.IsNullOrEmpty (tinfo.PathName) ? tinfo.PathName + "." + tinfo.Name : tinfo.Name;
+ this.testInfo = tinfo;
+ this.rootSuite = rootSuite;
+ this.TestId = tinfo.TestId;
+ }
+
+ public override bool HasTests {
+ get {
+ return true;
+ }
+ }
+
+ public string ClassName {
+ get { return fullName; }
+ }
+
+ protected override UnitTestResult OnRun (TestContext testContext)
+ {
+ return rootSuite.RunUnitTest (this, fullName, fullName, null, testContext);
+ }
+
+ protected override bool OnCanRun (MonoDevelop.Core.Execution.IExecutionHandler executionContext)
+ {
+ return rootSuite.CanRun (executionContext);
+ }
+
+
+ protected override void OnCreateTests ()
+ {
+ if (testInfo.Tests == null)
+ return;
+
+ foreach (NunitTestInfo test in testInfo.Tests) {
+ UnitTest newTest;
+ if (test.Tests != null)
+ newTest = new NUnitTestSuite (rootSuite, test);
+ else
+ newTest = new NUnitTestCase (rootSuite, test, ClassName);
+ newTest.FixtureTypeName = test.FixtureTypeName;
+ newTest.FixtureTypeNamespace = test.FixtureTypeNamespace;
+ Tests.Add (newTest);
+ }
+ }
+
+ public override SourceCodeLocation SourceCodeLocation {
+ get {
+ UnitTest p = Parent;
+ while (p != null) {
+ NUnitAssemblyTestSuite root = p as NUnitAssemblyTestSuite;
+ if (root != null)
+ return root.GetSourceCodeLocation (this);
+ p = p.Parent;
+ }
+ return null;
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/RemoteTestResult.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/RemoteTestResult.cs
new file mode 100644
index 0000000000..7b9280e8b1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/RemoteTestResult.cs
@@ -0,0 +1,197 @@
+//
+// RemoteTestResult.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using MonoDevelop.Core.Execution;
+
+namespace MonoDevelop.UnitTesting.NUnit
+{
+ [MessageDataType]
+ public class RunRequest: BinaryMessage<RunResponse>
+ {
+ [MessageDataProperty]
+ public string[] NameFilter { get; set; }
+
+ [MessageDataProperty]
+ public string Path { get; set; }
+
+ [MessageDataProperty]
+ public string SuiteName { get; set; }
+
+ [MessageDataProperty]
+ public string[] SupportAssemblies { get; set; }
+
+ [MessageDataProperty]
+ public string TestRunnerType { get; set; }
+
+ [MessageDataProperty]
+ public string TestRunnerAssembly { get; set; }
+
+ [MessageDataProperty]
+ public string CrashLogFile { get; set; }
+ }
+
+ [MessageDataType]
+ public class RunResponse : BinaryMessage
+ {
+ [MessageDataProperty]
+ public RemoteTestResult Result { get; set; }
+ }
+
+ [MessageDataType]
+ public class GetTestInfoRequest: BinaryMessage<GetTestInfoResponse>
+ {
+ [MessageDataProperty]
+ public string Path { get; set; }
+
+ [MessageDataProperty]
+ public string[] SupportAssemblies { get; set; }
+ }
+
+ [MessageDataType]
+ public class GetTestInfoResponse: BinaryMessage
+ {
+ [MessageDataProperty]
+ public NunitTestInfo Result { get; set; }
+ }
+
+ [MessageDataType]
+ public class TestStartedMessage: BinaryMessage
+ {
+ [MessageDataProperty]
+ public string TestCase { get; set; }
+ }
+
+ [MessageDataType]
+ public class TestFinishedMessage: BinaryMessage
+ {
+ [MessageDataProperty]
+ public string TestCase { get; set; }
+
+ [MessageDataProperty]
+ public RemoteTestResult Result;
+ }
+
+ [MessageDataType]
+ public class SuiteStartedMessage: BinaryMessage
+ {
+ [MessageDataProperty]
+ public string Suite { get; set; }
+ }
+
+ [MessageDataType]
+ public class SuiteFinishedMessage: BinaryMessage
+ {
+ [MessageDataProperty]
+ public string Suite { get; set; }
+
+ [MessageDataProperty]
+ public RemoteTestResult Result;
+ }
+
+
+ [MessageDataType]
+ public class RemoteTestResult
+ {
+ [MessageDataProperty]
+ public DateTime TestDate { get; set; }
+
+ [MessageDataProperty]
+ public RemoteResultStatus Status { get; set; }
+
+ [MessageDataProperty]
+ public int Passed { get; set; }
+
+ [MessageDataProperty]
+ public int Errors { get; set; }
+
+ [MessageDataProperty]
+ public int Failures { get; set; }
+
+ [MessageDataProperty]
+ public int Inconclusive { get; set; }
+
+ [MessageDataProperty]
+ public int NotRunnable { get; set; }
+
+ [MessageDataProperty]
+ public int Skipped { get; set; }
+
+ [MessageDataProperty]
+ public int Ignored { get; set; }
+
+ [MessageDataProperty]
+ public TimeSpan Time { get; set; }
+
+ [MessageDataProperty]
+ public string Message { get; set; }
+
+ [MessageDataProperty]
+ public string StackTrace { get; set; }
+
+ [MessageDataProperty]
+ public string ConsoleOutput { get; set; }
+
+ [MessageDataProperty]
+ public string ConsoleError { get; set; }
+ }
+
+ [MessageDataType]
+ [Serializable]
+ public class NunitTestInfo
+ {
+ [MessageDataProperty]
+ public string Name { get; set; }
+
+ [MessageDataProperty]
+ public string PathName { get; set; }
+
+ [MessageDataProperty]
+ public string TestId { get; set; }
+
+ [MessageDataProperty]
+ public string FixtureTypeName { get; set; }
+
+ [MessageDataProperty]
+ public string FixtureTypeNamespace { get; set; }
+
+ [MessageDataProperty]
+ public bool IsExplicit { get; set; }
+
+ [MessageDataProperty]
+ public NunitTestInfo[] Tests { get; set; }
+ }
+
+ [Flags]
+ public enum RemoteResultStatus
+ {
+ Success = 1,
+ Failure = 2,
+ Ignored = 4,
+ Inconclusive = 8
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/SystemTestProvider.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/SystemTestProvider.cs
new file mode 100644
index 0000000000..12076b4bf7
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/SystemTestProvider.cs
@@ -0,0 +1,72 @@
+//
+// SystemTestProvider.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Ide;
+using MonoDevelop.Projects;
+
+namespace MonoDevelop.UnitTesting.NUnit
+{
+ public class SystemTestProvider: ITestProvider
+ {
+ public SystemTestProvider ()
+ {
+ IdeApp.Workspace.ReferenceAddedToProject += OnReferenceChanged;
+ IdeApp.Workspace.ReferenceRemovedFromProject += OnReferenceChanged;
+ }
+
+ public UnitTest CreateUnitTest (WorkspaceObject entry)
+ {
+ UnitTest test = null;
+
+ if (entry is DotNetProject)
+ test = NUnitProjectTestSuite.CreateTest ((DotNetProject)entry);
+
+ UnitTestGroup grp = test as UnitTestGroup;
+ if (grp != null && !grp.HasTests) {
+ test.Dispose ();
+ return null;
+ }
+
+ return test;
+ }
+
+ void OnReferenceChanged (object s, ProjectReferenceEventArgs args)
+ {
+ if (NUnitProjectTestSuite.IsNUnitReference (args.ProjectReference))
+ UnitTestService.ReloadTests ();
+ }
+
+ public void Dispose ()
+ {
+ IdeApp.Workspace.ReferenceAddedToProject -= OnReferenceChanged;
+ IdeApp.Workspace.ReferenceRemovedFromProject -= OnReferenceChanged;
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/TcpTestListener.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/TcpTestListener.cs
new file mode 100644
index 0000000000..9795cbcff6
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/TcpTestListener.cs
@@ -0,0 +1,219 @@
+//
+// TcpTestListener.cs
+//
+// Author:
+// Alan McGovern <alan.mcgovern@gmail.com>
+//
+// Copyright (c) 2013 Alan McGovern
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Net;
+using System.Net.Sockets;
+using MonoDevelop.UnitTesting.NUnit.External;
+using System.IO;
+using System.Text;
+using System.Threading.Tasks;
+using System.Xml.Linq;
+using System.Collections.Generic;
+using System.Linq;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.UnitTesting.NUnit.External
+{
+ class TcpTestListener : IDisposable
+ {
+ string testSuiteName;
+ string rootTestName;
+
+ public bool HasReceivedConnection {
+ get; private set;
+ }
+
+ List<Tuple<string,UnitTestResult>> suiteStack = new List<Tuple<string, UnitTestResult>> ();
+ IRemoteEventListener listener;
+
+ TcpListener TcpListener {
+ get; set;
+ }
+
+ public int Port {
+ get { return ((IPEndPoint) TcpListener.LocalEndpoint).Port; }
+ }
+
+
+ public TcpTestListener (IRemoteEventListener listener, string suiteName)
+ {
+ this.testSuiteName = suiteName;
+ this.listener = listener;
+ bool rootSuiteStarted = false;
+
+ TcpListener = new TcpListener (new IPEndPoint (IPAddress.Loopback, 0));
+ TcpListener.Start ();
+ Task.Run (() => {
+ try {
+ using (var client = TcpListener.AcceptTcpClient ())
+ using (var socketStream = client.GetStream ())
+ using (var reader = new StreamReader (socketStream, Encoding.UTF8)) {
+
+ HasReceivedConnection = true;
+ string line = null;
+ while ((line = reader.ReadLine ()) != null) {
+ var element = XElement.Parse (line);
+ string testName = element.Attribute ("name").Value;
+ var action = element.Name.LocalName;
+
+ if (testSuiteName.Length == 0 && !rootSuiteStarted) {
+ // Running the whole assembly
+ rootTestName = testName;
+ rootSuiteStarted = true;
+ continue;
+ }
+ if (testSuiteName == testName && !rootSuiteStarted) {
+ // Running a test suite
+ rootTestName = testName;
+ rootSuiteStarted = true;
+ listener.SuiteStarted ("<root>");
+ continue;
+ }
+
+ if (!rootSuiteStarted)
+ continue;
+
+ switch (action) {
+ case "suite-started":
+ UpdateTestSuiteStatus (testName, false); break;
+ case "test-started":
+ UpdateTestSuiteStatus (testName, true);
+ listener.TestStarted (testName); break;
+ case "test-finished":
+ var res = CreateResult (element);
+ AddTestResult (res);
+ listener.TestFinished (testName, res); break;
+ case "suite-finished":
+ if (testName == rootTestName) {
+ FinishSuites (0);
+ listener.SuiteFinished ("<root>", CreateResult (element));
+ rootSuiteStarted = false;
+ }
+ break;
+ }
+ }
+ }
+ } catch (Exception ex) {
+ LoggingService.LogError ("Exception in test listener", ex);
+ } finally {
+ TcpListener.Stop ();
+ }
+ });
+ }
+
+ public void Dispose ()
+ {
+ TcpListener.Stop ();
+ }
+
+ void UpdateTestSuiteStatus (string name, bool isTest)
+ {
+ if (testSuiteName.Length > 0)
+ name = name.Substring (testSuiteName.Length + 1);
+ string[] parts = name.Split ('.');
+ int len = isTest ? parts.Length - 1 : parts.Length;
+ for (int n = 0; n < len; n++) {
+ if (n >= suiteStack.Count) {
+ StartSuite (parts[n]);
+ } else if (parts [n] != suiteStack [n].Item1) {
+ FinishSuites (n);
+ StartSuite (parts[n]);
+ }
+ }
+ }
+
+ void FinishSuites (int stackLevel)
+ {
+ if (stackLevel + 1 < suiteStack.Count)
+ FinishSuites (stackLevel + 1);
+
+ if (stackLevel >= suiteStack.Count)
+ return;
+
+ var tname = GetTestSuiteName (stackLevel);
+ var res = suiteStack [stackLevel].Item2;
+
+ suiteStack.RemoveAt (stackLevel);
+
+ listener.SuiteFinished (tname, res);
+ }
+
+ void StartSuite (string name)
+ {
+ suiteStack.Add (new Tuple<string, UnitTestResult> (name, new UnitTestResult ()));
+ name = GetTestSuiteName (suiteStack.Count - 1);
+ listener.SuiteStarted (name);
+ }
+
+ void AddTestResult (UnitTestResult res)
+ {
+ foreach (var r in suiteStack)
+ r.Item2.Add (res);
+ }
+
+ string GetTestSuiteName (int stackLevel)
+ {
+ var info = suiteStack [stackLevel];
+
+ string name;
+ if (stackLevel > 0) {
+ var prefix = string.Join (".", suiteStack.Select (s => s.Item1).Take (stackLevel));
+ name = prefix + "." + info.Item1;
+ } else
+ name = info.Item1;
+
+ if (testSuiteName.Length > 0)
+ name = testSuiteName + "." + name;
+ return name;
+ }
+
+ UnitTestResult CreateResult (XElement element)
+ {
+ var result = (ResultStatus)Enum.Parse (typeof(ResultStatus), element.Attribute ("result").Value);
+ var passed = int.Parse (element.Attribute ("passed").Value);
+ var failures = int.Parse (element.Attribute ("failures").Value);
+ var ignored = int.Parse (element.Attribute ("ignored").Value);
+ var inconclusive = int.Parse (element.Attribute ("inconclusive").Value);
+
+ var message = (string)element.Attribute ("message");
+ var stackTrace = (string)element.Attribute ("stack-trace");
+ var output = (string)element.Attribute ("output");
+
+ return new UnitTestResult {
+ Status = result,
+ Passed = passed,
+ Failures = failures,
+ Ignored = ignored,
+ Inconclusive = inconclusive,
+ Message = message,
+ StackTrace = stackTrace,
+ ConsoleOutput = output
+ };
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelopNUnit.addin.xml b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelopNUnit.addin.xml
new file mode 100644
index 0000000000..5b90817b8e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelopNUnit.addin.xml
@@ -0,0 +1,31 @@
+<ExtensionModel>
+
+ <!-- Extensions -->
+
+ <Extension path = "/MonoDevelop/UnitTesting/TestProviders">
+ <Class id="SystemTestProvider" class="MonoDevelop.UnitTesting.NUnit.SystemTestProvider" />
+ </Extension>
+
+ <Extension path = "/MonoDevelop/Ide/ProjectTemplates">
+ <ProjectTemplate id = "MonoDevelop.CSharp.NUnitLibraryProject" resource = "NUnitProject.xpt.xml"/>
+ <ProjectTemplate id = "MonoDevelop.VBNet.NUnitLibraryProject" resource = "NUnitProjectVBNet.xpt.xml"/>
+ </Extension>
+
+ <Extension path = "/MonoDevelop/Ide/FileTemplates">
+ <FileTemplate id = "NUnitTestClass" resource = "NUnitTestClass.xft.xml"/>
+ </Extension>
+
+ <Extension path="/MonoDevelop/Ide/TemplateImages">
+ <Image id="md-nunit-library-project" resource="nunit-library-project.png" />
+ </Extension>
+
+ <Extension path = "/MonoDevelop/UnitTesting/UnitTestMarkers">
+ <TestMarkers
+ testMethodAttributeMarker="NUnit.Framework.TestAttribute"
+ testCaseMethodAttributeMarker="NUnit.Framework.TestCaseAttribute"
+ ignoreTestMethodAttributeMarker="NUnit.Framework.IgnoreAttribute"
+ ignoreTestClassAttributeMarker="NUnit.Framework.IgnoreAttribute"
+ />
+ </Extension>
+
+</ExtensionModel>
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/EventListenerWrapper.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/EventListenerWrapper.cs
new file mode 100644
index 0000000000..2472998471
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/EventListenerWrapper.cs
@@ -0,0 +1,187 @@
+//
+// EventListenerWrapper.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Reflection;
+using System.IO;
+using System.Collections;
+using System.Collections.Generic;
+using System.Threading;
+using System.Text;
+
+using MonoDevelop.Core.Execution;
+using NUnit.Engine;
+using NUnit.Common;
+using System.Diagnostics.Contracts;
+using NUnit.Framework.Interfaces;
+using NUnit.Framework.Internal;
+using System.Xml;
+using System.Net.Configuration;
+using System.Globalization;
+using MonoDevelop.UnitTesting.NUnit;
+
+namespace NUnit3Runner
+{
+
+ class EventListenerWrapper: MarshalByRefObject, ITestEventListener
+ {
+ RemoteProcessServer server;
+
+ public EventListenerWrapper (RemoteProcessServer server)
+ {
+ this.server = server;
+ }
+
+ public void RunFinished (Exception exception)
+ {
+ }
+
+ public void RunFinished (TestResult results)
+ {
+ }
+
+ public void RunStarted (string name, int testCount)
+ {
+ }
+
+ public void SuiteFinished (XmlNode testResult)
+ {
+ var testName = testResult.Attributes["fullname"].Value;
+ server.SendMessage (new SuiteFinishedMessage {
+ Suite = testName,
+ Result = GetLocalTestResult (testResult)
+ });
+ }
+
+ public void SuiteStarted (XmlNode testResult)
+ {
+ var testName = testResult.Attributes["fullname"].Value;
+ server.SendMessage (new SuiteStartedMessage {
+ Suite = testName
+ });
+ }
+
+ public void TestFinished (XmlNode testResult)
+ {
+ var testName = testResult.Attributes["fullname"].Value;
+ server.SendMessage (new TestFinishedMessage {
+ TestCase = testName,
+ Result = GetLocalTestResult (testResult)
+ });
+ }
+
+ public void TestStarted (XmlNode data)
+ {
+ var testName = data.Attributes["fullname"].Value;
+ server.SendMessage (new TestStartedMessage {
+ TestCase = testName
+ });
+ }
+
+ public override object InitializeLifetimeService ()
+ {
+ return null;
+ }
+
+ string GetTestName (XmlNode data)
+ {
+ return data.Attributes["fullname"].Value;
+ }
+
+ public RemoteTestResult GetLocalTestResult (XmlNode t)
+ {
+ var e = (XmlElement)t;
+
+ RemoteTestResult res = new RemoteTestResult ();
+
+ if (e.LocalName == "test-suite") {
+ res.Failures = int.Parse (e.GetAttribute ("failed"));
+ res.Errors = 0;
+ res.Ignored = int.Parse (e.GetAttribute ("skipped"));
+ res.Inconclusive = int.Parse (e.GetAttribute ("inconclusive"));
+ res.NotRunnable = 0;
+ res.Passed = int.Parse (e.GetAttribute ("passed"));
+ } else if (e.LocalName == "test-case") {
+ var runResult = e.GetAttribute ("result");
+ if (runResult == "Passed")
+ res.Passed = 1;
+ else if (runResult == "Failed") {
+ res.Failures = 1;
+ var msg = e.SelectSingleNode ("failure/message");
+ if (msg != null)
+ res.Message = msg.InnerText;
+ var stack = e.SelectSingleNode ("failure/stack-trace");
+ if (stack != null)
+ res.StackTrace = stack.InnerText;
+ }
+ else if (runResult == "Skipped") {
+ res.Skipped = 1;
+ var msg = e.SelectSingleNode ("reason/message");
+ if (msg != null)
+ res.Message = msg.InnerText;
+ } else if (runResult == "Inconclusive") {
+ res.Inconclusive = 1;
+ var msg = e.SelectSingleNode ("reason/message");
+ if (msg != null)
+ res.Message = msg.InnerText;
+ }
+ }
+
+ res.Time = TimeSpan.FromSeconds (double.Parse (e.GetAttribute ("duration"), CultureInfo.InvariantCulture));
+
+ var output = e.SelectSingleNode ("output");
+ if (output != null) {
+ Console.WriteLine (output.InnerText);
+ res.ConsoleOutput = output.InnerText;
+ }
+
+ return res;
+ }
+
+ public void UnhandledException (Exception exception)
+ {
+ }
+
+ void ITestEventListener.OnTestEvent (string report)
+ {
+ var doc = new XmlDocument();
+ doc.LoadXml (report);
+
+ var testEvent = doc.FirstChild;
+ switch (testEvent.Name)
+ {
+ case "test-case":
+ TestFinished (testEvent);
+ break;
+
+ case "test-suite":
+ SuiteFinished (testEvent);
+ break;
+ }
+ }
+ }
+
+}
diff --git a/main/src/addins/CBinding/Makefile.am b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/Makefile.am
index c9cc87438f..c9cc87438f 100644
--- a/main/src/addins/CBinding/Makefile.am
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/Makefile.am
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/NUnit3Runner.csproj b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/NUnit3Runner.csproj
new file mode 100644
index 0000000000..c04f9da8c4
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/NUnit3Runner.csproj
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{D2A4E99E-FC2D-45A9-8BE7-1AB7DF95BA2A}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <RootNamespace>NUnit3Runner</RootNamespace>
+ <AssemblyName>NUnitRunner</AssemblyName>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\..\..\..\build\AddIns\MonoDevelop.UnitTesting\NUnit3</OutputPath>
+ <DefineConstants>DEBUG;</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ExternalConsole>true</ExternalConsole>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <Optimize>true</Optimize>
+ <OutputPath>..\..\..\..\build\AddIns\MonoDevelop.UnitTesting\NUnit3</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ExternalConsole>true</ExternalConsole>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="nunit.framework">
+ <HintPath>..\..\..\..\packages\NUnit.3.0.1\lib\net45\nunit.framework.dll</HintPath>
+ </Reference>
+ <Reference Include="nunit.engine">
+ <HintPath>..\..\..\..\packages\NUnit.Engine.3.0.1\lib\nunit.engine.dll</HintPath>
+ </Reference>
+ <Reference Include="nunit.engine.api">
+ <HintPath>..\..\..\..\packages\NUnit.Engine.3.0.1\lib\nunit.engine.api.dll</HintPath>
+ </Reference>
+ <Reference Include="Mono.Cecil">
+ <HintPath>..\..\..\..\packages\NUnit.Engine.3.0.1\lib\Mono.Cecil.dll</HintPath>
+ </Reference>
+ <Reference Include="nunit-agent">
+ <HintPath>..\..\..\..\packages\NUnit.Engine.3.0.1\lib\nunit-agent.exe</HintPath>
+ </Reference>
+ <Reference Include="nunit-agent-x86">
+ <HintPath>..\..\..\..\packages\NUnit.Engine.3.0.1\lib\nunit-agent-x86.exe</HintPath>
+ </Reference>
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Program.cs" />
+ <Compile Include="..\..\..\core\MonoDevelop.Core\MonoDevelop.Core.Execution\BinaryMessage.cs">
+ <Link>BinaryMessage.cs</Link>
+ </Compile>
+ <Compile Include="..\..\..\core\MonoDevelop.Core\MonoDevelop.Core.Execution\RemoteProcessServer.cs">
+ <Link>RemoteProcessServer.cs</Link>
+ </Compile>
+ <Compile Include="..\MonoDevelop.UnitTesting.NUnit\RemoteTestResult.cs">
+ <Link>RemoteTestResult.cs</Link>
+ </Compile>
+ <Compile Include="NUnitTestRunner.cs" />
+ <Compile Include="EventListenerWrapper.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+</Project> \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/NUnitTestRunner.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/NUnitTestRunner.cs
new file mode 100644
index 0000000000..b085795abe
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/NUnitTestRunner.cs
@@ -0,0 +1,210 @@
+//
+// ExternalTestRunner.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.Linq;
+using System.Reflection;
+using System.IO;
+using System.Collections;
+using System.Collections.Generic;
+using System.Threading;
+
+using NUnit.Framework;
+using NUnit.Framework.Interfaces;
+using NUnit.Engine;
+using System.Xml;
+using NUnit.Common;
+using NUnit.Engine.Internal;
+using MonoDevelop.Core.Execution;
+using MonoDevelop.UnitTesting.NUnit;
+
+namespace NUnit3Runner
+{
+ public class NUnitTestRunner: MessageListener
+ {
+ RemoteProcessServer server;
+ ITestEngine engine;
+ ITestFilterService filterService;
+
+ public NUnitTestRunner (RemoteProcessServer server)
+ {
+ this.server = server;
+
+ // Note: We need to load all nunit.*.dll assemblies before we do *anything* else in this class
+ // This is to ensure that we always load the assemblies from the monodevelop directory and not
+ // from the directory of the assembly under test. For example we wnat to load
+ // /Applications/MonoDevelop/lib/Addins/nunit.framework.dll and not /user/app/foo/bin/debug/nunit.framework.dll
+ var path = Path.GetDirectoryName (GetType ().Assembly.Location);
+ string nunitPath = Path.Combine (path, "nunit.framework.dll");
+ Assembly.LoadFrom (nunitPath);
+
+ Initialize ();
+ }
+
+ public void Initialize ()
+ {
+ engine = TestEngineActivator.CreateInstance ();
+ filterService = engine.Services.GetService<ITestFilterService>();
+ }
+
+ [MessageHandler]
+ public RunResponse Run (RunRequest r)
+ {
+ EventListenerWrapper listenerWrapper = new EventListenerWrapper (server);
+
+ UnhandledExceptionEventHandler exceptionHandler = (object sender, UnhandledExceptionEventArgs e) => {
+ var ex = e.ExceptionObject;
+ File.WriteAllText (r.CrashLogFile, e.ToString ());
+ };
+
+ AppDomain.CurrentDomain.UnhandledException += exceptionHandler;
+ try {
+ var res = Run (listenerWrapper, r.NameFilter, r.Path, r.SuiteName, r.SupportAssemblies, r.TestRunnerType, r.TestRunnerAssembly);
+ res = res.SelectSingleNode ("test-suite");
+ return new RunResponse () { Result = listenerWrapper.GetLocalTestResult (res) };
+ } finally {
+ AppDomain.CurrentDomain.UnhandledException -= exceptionHandler;
+ }
+ }
+
+ [MessageHandler]
+ public GetTestInfoResponse GetTestInfo (GetTestInfoRequest req)
+ {
+ var r = GetTestInfo (req.Path, req.SupportAssemblies);
+ return new GetTestInfoResponse { Result = r };
+ }
+
+ TestPackage CreatePackage (string path)
+ {
+ TestPackage package = new TestPackage (path);
+ package.AddSetting ("ShadowCopyFiles", false);
+ package.AddSetting ("ProcessModel", "InProcess");
+ package.AddSetting ("DomainUsage", "Single");
+ return package;
+ }
+
+ public XmlNode Run (ITestEventListener listener, string[] nameFilter, string path, string suiteName, string[] supportAssemblies, string testRunnerType, string testRunnerAssembly)
+ {
+ InitSupportAssemblies (supportAssemblies);
+
+ TestFilter filter = TestFilter.Empty;
+ if (nameFilter != null && nameFilter.Length > 0)
+ filter = CreateTestFilter (nameFilter);
+
+ ITestRunner tr = null;
+ if (!string.IsNullOrEmpty (testRunnerType)) {
+ Type runnerType;
+ if (string.IsNullOrEmpty (testRunnerAssembly))
+ runnerType = Type.GetType (testRunnerType, true);
+ else {
+ var asm = Assembly.LoadFrom (testRunnerAssembly);
+ runnerType = asm.GetType (testRunnerType);
+ }
+ tr = (ITestRunner)Activator.CreateInstance (runnerType);
+ }
+
+ TestPackage package = CreatePackage (path);
+
+ if (tr == null)
+ tr = engine.GetRunner (package);
+
+ return tr.Run (listener, filter);
+ }
+
+ public NunitTestInfo GetTestInfo (string path, string[] supportAssemblies)
+ {
+ InitSupportAssemblies (supportAssemblies);
+ TestPackage package = CreatePackage (path);
+ var tr = engine.GetRunner (package);
+ var r = tr.Explore (TestFilter.Empty);
+ var root = r.SelectSingleNode ("test-suite") as XmlElement;
+ if (root != null)
+ return BuildTestInfo (root);
+ else
+ return null;
+ }
+
+ internal NunitTestInfo BuildTestInfo (XmlElement test)
+ {
+ NunitTestInfo ti = new NunitTestInfo ();
+ // The name of inherited tests include the base class name as prefix.
+ // That prefix has to be removed
+ string tname = test.GetAttribute ("name");
+ string fullName = test.GetAttribute ("fullname");
+
+ var tn = test.GetAttribute ("classname");
+ if (tn != null) {
+ var i = tn.LastIndexOf ('.');
+ if (i != -1) {
+ ti.FixtureTypeName = tn.Substring (i + 1);
+ ti.FixtureTypeNamespace = tn.Substring (0, i);
+ } else {
+ ti.FixtureTypeName = tn;
+ ti.FixtureTypeNamespace = "";
+ }
+ }
+ ti.Name = tname;
+ ti.TestId = fullName;
+ // Trim short name from end of full name to get the path
+ string testNameWithDelimiter = "." + tname;
+ if (fullName.EndsWith (testNameWithDelimiter)) {
+ int pathLength = fullName.Length - testNameWithDelimiter.Length;
+ ti.PathName = fullName.Substring (0, pathLength);
+ }
+ else
+ ti.PathName = null;
+
+ ti.IsExplicit = test.GetAttribute ("classname") == "Explicit";
+
+ var children = test.ChildNodes.OfType<XmlElement> ().Where (e => e.LocalName == "test-suite" || e.LocalName == "test-case").ToArray ();
+ if (children.Length > 0) {
+ ti.Tests = new NunitTestInfo [children.Length];
+ for (int n=0; n<children.Length; n++)
+ ti.Tests [n] = BuildTestInfo (children [n]);
+ }
+ return ti;
+ }
+
+ void InitSupportAssemblies (string[] supportAssemblies)
+ {
+ // Preload support assemblies (they may not be in the test assembly directory nor in the gac)
+ foreach (string asm in supportAssemblies)
+ Assembly.LoadFrom (asm);
+ }
+
+ private TestFilter CreateTestFilter (string[] nameFilter)
+ {
+ ITestFilterBuilder builder = filterService.GetTestFilterBuilder();
+ foreach (var testName in nameFilter)
+ builder.AddTest(testName);
+ return builder.GetFilter();
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/Program.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/Program.cs
new file mode 100644
index 0000000000..5ed87b6e4b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/Program.cs
@@ -0,0 +1,42 @@
+//
+// Program.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Execution;
+
+namespace NUnit3Runner
+{
+ public class Application
+ {
+ static RemoteProcessServer server;
+
+ public static void Main (string [] args)
+ {
+ server = new RemoteProcessServer ();
+ server.Connect (args, new NUnitTestRunner (server));
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/packages.config b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/packages.config
new file mode 100644
index 0000000000..c2833088b1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnit3Runner/packages.config
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="NUnit" version="3.0.1" targetFramework="net45" />
+ <package id="NUnit.Engine" version="3.0.1" targetFramework="net45" />
+</packages> \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/Application.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/Application.cs
new file mode 100644
index 0000000000..359570c678
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/Application.cs
@@ -0,0 +1,45 @@
+//
+// Application.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Execution;
+using MonoDevelop.UnitTesting.NUnit.External;
+using MonoDevelop.UnitTesting.NUnit;
+
+namespace NUnitRunner
+{
+ public class Application
+ {
+ static RemoteProcessServer server;
+
+ public static void Main (string [] args)
+ {
+ NUnitTestRunner.PreloadAssemblies ();
+ server = new RemoteProcessServer ();
+ server.Connect (args, new RemoteNUnitTestRunner (server));
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/ExternalTestRunner.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/ExternalTestRunner.cs
new file mode 100644
index 0000000000..dd42c9e545
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/ExternalTestRunner.cs
@@ -0,0 +1,236 @@
+//
+// ExternalTestRunner.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.Reflection;
+using System.IO;
+using System.Collections;
+using System.Collections.Generic;
+using System.Threading;
+using System.Text;
+
+using NUnit.Core;
+using NUnit.Util;
+using MonoDevelop.Core.Execution;
+
+namespace MonoDevelop.UnitTesting.NUnit.External
+{
+ public class RemoteNUnitTestRunner: MessageListener
+ {
+ NUnitTestRunner runner;
+ RemoteProcessServer server;
+
+ public RemoteNUnitTestRunner (RemoteProcessServer server)
+ {
+ this.server = server;
+
+ // Add standard services to ServiceManager
+ ServiceManager.Services.AddService (new DomainManager ());
+ ServiceManager.Services.AddService (new ProjectService ());
+ ServiceManager.Services.AddService (new AddinRegistry ());
+ ServiceManager.Services.AddService (new AddinManager ());
+ ServiceManager.Services.AddService (new TestAgency ());
+
+ // Initialize services
+ ServiceManager.Services.InitializeServices ();
+ }
+
+ [MessageHandler]
+ public RunResponse Run (RunRequest r)
+ {
+ var res = Run (r.NameFilter, r.Path, r.SuiteName, r.SupportAssemblies, r.TestRunnerType, r.TestRunnerAssembly, r.CrashLogFile);
+ return new RunResponse () { Result = res };
+ }
+
+ public RemoteTestResult Run (string[] nameFilter, string path, string suiteName, string[] supportAssemblies, string testRunnerType, string testRunnerAssembly, string crashLogFile)
+ {
+ NUnitTestRunner runner = GetRunner (path);
+ EventListenerWrapper listenerWrapper = new EventListenerWrapper (server);
+
+ UnhandledExceptionEventHandler exceptionHandler = (object sender, UnhandledExceptionEventArgs e) => {
+ var ex = e.ExceptionObject;
+ File.WriteAllText (crashLogFile, e.ToString ());
+ };
+
+ AppDomain.CurrentDomain.UnhandledException += exceptionHandler;
+ try {
+ TestResult res = runner.Run (listenerWrapper, nameFilter, path, suiteName, supportAssemblies, testRunnerType, testRunnerAssembly);
+ return listenerWrapper.GetLocalTestResult (res);
+ } finally {
+ AppDomain.CurrentDomain.UnhandledException -= exceptionHandler;
+ }
+ }
+
+ [MessageHandler]
+ public GetTestInfoResponse GetTestInfo (GetTestInfoRequest req)
+ {
+ NUnitTestRunner runner = GetRunner (req.Path);
+ var r = runner.GetTestInfo (req.Path, req.SupportAssemblies);
+ return new GetTestInfoResponse { Result = r };
+ }
+
+ NUnitTestRunner GetRunner (string assemblyPath)
+ {
+ string basePath = Path.GetDirectoryName (GetType ().Assembly.Location);
+
+ TestPackage package = new TestPackage (assemblyPath);
+ package.Settings ["ShadowCopyFiles"] = false;
+ package.BasePath = basePath;
+
+ AppDomain domain = Services.DomainManager.CreateDomain (package);
+ string asm = Path.Combine (basePath, "NUnitRunner.exe");
+ runner = (NUnitTestRunner)domain.CreateInstanceFromAndUnwrap (asm, "MonoDevelop.UnitTesting.NUnit.External.NUnitTestRunner");
+ runner.Initialize ();
+ return runner;
+ }
+ }
+
+ class EventListenerWrapper: MarshalByRefObject, EventListener
+ {
+ RemoteProcessServer server;
+ StringBuilder consoleOutput;
+ StringBuilder consoleError;
+
+ public EventListenerWrapper (RemoteProcessServer server)
+ {
+ this.server = server;
+ }
+
+ public void RunFinished (Exception exception)
+ {
+ }
+
+ public void RunFinished (TestResult results)
+ {
+ }
+
+ public void RunStarted (string name, int testCount)
+ {
+ }
+
+ public void SuiteFinished (TestResult result)
+ {
+ server.SendMessage (new SuiteFinishedMessage {
+ Suite = GetTestName (result.Test),
+ Result = GetLocalTestResult (result)
+ });
+ }
+
+ public void SuiteStarted (TestName suite)
+ {
+ server.SendMessage (new SuiteStartedMessage {
+ Suite = GetTestName (suite)
+ });
+ }
+
+ public void TestFinished (TestResult result)
+ {
+ server.SendMessage (new TestFinishedMessage {
+ TestCase = GetTestName (result.Test),
+ Result = GetLocalTestResult (result)
+ });
+ }
+
+ public void TestOutput (TestOutput testOutput)
+ {
+ Console.WriteLine (testOutput.Text);
+ if (consoleOutput == null)
+ return;
+ else if (testOutput.Type == TestOutputType.Out)
+ consoleOutput.Append (testOutput.Text);
+ else
+ consoleError.Append (testOutput.Text);
+ }
+
+ public void TestStarted (TestName testCase)
+ {
+ server.SendMessage (new TestStartedMessage {
+ TestCase = GetTestName (testCase)
+ });
+ consoleOutput = new StringBuilder ();
+ consoleError = new StringBuilder ();
+ }
+
+ public override object InitializeLifetimeService ()
+ {
+ return null;
+ }
+
+ string GetTestName (ITest t)
+ {
+ if (t == null)
+ return null;
+ return t.TestName.FullName;
+ }
+
+ public string GetTestName (TestName t)
+ {
+ if (t == null)
+ return null;
+ return t.FullName;
+ }
+
+ public RemoteTestResult GetLocalTestResult (TestResult t)
+ {
+ RemoteTestResult res = new RemoteTestResult ();
+ var summary = new ResultSummarizer (t);
+ res.Failures = summary.Failures;
+ res.Errors = summary.Errors;
+ res.Ignored = summary.Ignored;
+ res.Inconclusive = summary.Inconclusive;
+ res.NotRunnable = summary.NotRunnable;
+ res.Passed = summary.Passed;
+ res.StackTrace = t.StackTrace;
+ res.Time = TimeSpan.FromSeconds (t.Time);
+ res.Message = t.Message;
+
+ if (consoleOutput != null) {
+ res.ConsoleOutput = consoleOutput.ToString ();
+ res.ConsoleError = consoleError.ToString ();
+ consoleOutput = null;
+ consoleError = null;
+ }
+
+ return res;
+ }
+
+ public void UnhandledException (Exception exception)
+ {
+ }
+ }
+
+ public interface IRemoteEventListener
+ {
+ void TestStarted (string testCase);
+ void TestFinished (string test, RemoteTestResult result);
+ void SuiteStarted (string suite);
+ void SuiteFinished (string suite, RemoteTestResult result);
+ }
+}
+
diff --git a/main/src/addins/NUnit/NUnitRunner/Makefile.am b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/Makefile.am
index c9cc87438f..c9cc87438f 100644
--- a/main/src/addins/NUnit/NUnitRunner/Makefile.am
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/Makefile.am
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/NUnitRunner.csproj b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/NUnitRunner.csproj
new file mode 100644
index 0000000000..e798c370bf
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/NUnitRunner.csproj
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{0AF16AF1-0876-413E-9803-08BD33C19E00}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AssemblyName>NUnitRunner</AssemblyName>
+ <RootNamespace>NUnitRunner</RootNamespace>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>True</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>False</Optimize>
+ <OutputPath>..\..\..\..\build\AddIns\MonoDevelop.UnitTesting\NUnit2</OutputPath>
+ <DefineConstants>DEBUG</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>False</ConsolePause>
+ <NoWarn>1591;1573</NoWarn>
+ <DocumentationFile></DocumentationFile>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>..\..\..\..\build\AddIns\MonoDevelop.UnitTesting\NUnit2</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>False</ConsolePause>
+ <DebugSymbols>true</DebugSymbols>
+ <NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\..\build\AddIns\NUnit\NUnitRunner.xml</DocumentationFile>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Xml" />
+ <Reference Include="nunit.framework">
+ <HintPath>..\..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
+ </Reference>
+ <Reference Include="nunit.core">
+ <HintPath>..\..\..\..\packages\NUnit.Runners.2.6.4\tools\lib\nunit.core.dll</HintPath>
+ </Reference>
+ <Reference Include="nunit.core.interfaces">
+ <HintPath>..\..\..\..\packages\NUnit.Runners.2.6.4\tools\lib\nunit.core.interfaces.dll</HintPath>
+ </Reference>
+ <Reference Include="nunit.util">
+ <HintPath>..\..\..\..\packages\NUnit.Runners.2.6.4\tools\lib\nunit.util.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="NUnitTestRunner.cs" />
+ <Compile Include="ExternalTestRunner.cs" />
+ <Compile Include="Application.cs" />
+ <Compile Include="..\..\..\core\MonoDevelop.Core\MonoDevelop.Core.Execution\BinaryMessage.cs">
+ <Link>BinaryMessage.cs</Link>
+ </Compile>
+ <Compile Include="..\..\..\core\MonoDevelop.Core\MonoDevelop.Core.Execution\RemoteProcessServer.cs">
+ <Link>RemoteProcessServer.cs</Link>
+ </Compile>
+ <Compile Include="..\MonoDevelop.UnitTesting.NUnit\RemoteTestResult.cs">
+ <Link>RemoteTestResult.cs</Link>
+ </Compile>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+</Project>
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/NUnitTestRunner.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/NUnitTestRunner.cs
new file mode 100644
index 0000000000..8059c6d934
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/NUnitTestRunner.cs
@@ -0,0 +1,207 @@
+//
+// ExternalTestRunner.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.Linq;
+using System.Reflection;
+using System.IO;
+using System.Collections;
+using System.Collections.Generic;
+using System.Threading;
+
+using NUnit.Core;
+using NUnit.Framework;
+using NUnit.Core.Filters;
+
+namespace MonoDevelop.UnitTesting.NUnit.External
+{
+ public class NUnitTestRunner: MarshalByRefObject
+ {
+ public NUnitTestRunner ()
+ {
+ PreloadAssemblies ();
+ }
+
+ public static void PreloadAssemblies ()
+ {
+ // Note: We need to load all nunit.*.dll assemblies before we do *anything* else in this class
+ // This is to ensure that we always load the assemblies from the monodevelop directory and not
+ // from the directory of the assembly under test. For example we wnat to load
+ // /Applications/MonoDevelop/lib/Addins/nunit.framework.dll and not /user/app/foo/bin/debug/nunit.framework.dll
+
+ // Force the loading of the NUnit.Framework assembly.
+ // It's needed since that dll is not located in the test dll directory.
+ var path = Path.GetDirectoryName (typeof(NUnitTestRunner).Assembly.Location);
+ string nunitPath = Path.Combine (path, "nunit.framework.dll");
+ string nunitCorePath = Path.Combine (path, "nunit.core.dll");
+ string nunitCoreInterfacesPath = Path.Combine (path, "nunit.core.interfaces.dll");
+
+ Assembly.LoadFrom (nunitCoreInterfacesPath);
+ Assembly.LoadFrom (nunitCorePath);
+ Assembly.LoadFrom (nunitPath);
+ }
+
+ public void Initialize ()
+ {
+ // Initialize ExtensionHost if not already done
+ if ( !CoreExtensions.Host.Initialized )
+ CoreExtensions.Host.InitializeService();
+ }
+
+ public TestResult Run (EventListener listener, string[] nameFilter, string path, string suiteName, string[] supportAssemblies, string testRunnerType, string testRunnerAssembly)
+ {
+ InitSupportAssemblies (supportAssemblies);
+
+ ITestFilter filter = TestFilter.Empty;
+ if (nameFilter != null && nameFilter.Length > 0)
+ filter = new TestNameFilter (nameFilter);
+
+ TestRunner tr;
+ if (!string.IsNullOrEmpty (testRunnerType)) {
+ Type runnerType;
+ if (string.IsNullOrEmpty (testRunnerAssembly))
+ runnerType = Type.GetType (testRunnerType, true);
+ else {
+ var asm = Assembly.LoadFrom (testRunnerAssembly);
+ runnerType = asm.GetType (testRunnerType);
+ }
+ tr = (TestRunner)Activator.CreateInstance (runnerType);
+ } else
+ tr = new RemoteTestRunner ();
+
+ TestPackage package = new TestPackage (path);
+ if (!string.IsNullOrEmpty (suiteName))
+ package.TestName = suiteName;
+ tr.Load (package);
+ return tr.Run (listener, filter, false, LoggingThreshold.All);
+ }
+
+ public NunitTestInfo GetTestInfo (string path, string[] supportAssemblies)
+ {
+ InitSupportAssemblies (supportAssemblies);
+ TestSuite rootTS = new TestSuiteBuilder ().Build (new TestPackage (path));
+ return BuildTestInfo (rootTS);
+ }
+
+ internal NunitTestInfo BuildTestInfo (Test test)
+ {
+ NunitTestInfo ti = new NunitTestInfo ();
+ // The name of inherited tests include the base class name as prefix.
+ // That prefix has to be removed
+ string tname = test.TestName.Name;
+ // Find the last index of the dot character that is not a part of the test parameters
+ // Parameterized methods can contain '.' as class name & they don't seem to prefix base class name, so it's safe to skip them
+ if (!(test.Parent is ParameterizedMethodSuite)) {
+ int j = tname.IndexOf ('(');
+ int i = tname.LastIndexOf ('.', (j == -1) ? (tname.Length - 1) : j);
+ if (i != -1)
+ tname = tname.Substring (i + 1);
+ }
+
+ if (test.FixtureType != null) {
+ ti.FixtureTypeName = test.FixtureType.Name;
+ ti.FixtureTypeNamespace = test.FixtureType.Namespace;
+ } else if (test.TestType == "ParameterizedTest") {
+ ti.FixtureTypeName = test.Parent.FixtureType.Name;
+ ti.FixtureTypeNamespace = test.Parent.FixtureType.Namespace;
+ }
+ ti.Name = tname;
+ ti.TestId = test.TestName.FullName;
+
+ // Trim short name from end of full name to get the path
+ string testNameWithDelimiter = "." + tname;
+ if (test.TestName.FullName.EndsWith (testNameWithDelimiter)) {
+ int pathLength = test.TestName.FullName.Length - testNameWithDelimiter.Length;
+ ti.PathName = test.TestName.FullName.Substring(0, pathLength );
+ }
+ else
+ ti.PathName = null;
+
+ if (test.Tests != null && test.Tests.Count > 0) {
+ ti.Tests = new NunitTestInfo [test.Tests.Count];
+ for (int n=0; n<test.Tests.Count; n++)
+ ti.Tests [n] = BuildTestInfo ((Test)test.Tests [n]);
+ }
+ ti.IsExplicit = test.RunState == RunState.Explicit;
+ return ti;
+ }
+
+ void InitSupportAssemblies (string[] supportAssemblies)
+ {
+ // Preload support assemblies (they may not be in the test assembly directory nor in the gac)
+ foreach (string asm in supportAssemblies)
+ Assembly.LoadFrom (asm);
+ }
+
+ public override object InitializeLifetimeService ()
+ {
+ return null;
+ }
+ }
+
+ [Serializable]
+ public class TestNameFilter: ITestFilter
+ {
+ string[] names;
+
+ public TestNameFilter (params string[] names)
+ {
+ this.names = names;
+ }
+
+ #region ITestFilter implementation
+
+ public bool Pass (ITest test)
+ {
+ if (!test.IsSuite && names.Any (n => test.TestName.FullName == n))
+ return true;
+ if (test.Tests != null) {
+ foreach (ITest ct in test.Tests) {
+ if (Pass (ct))
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public bool Match (ITest test)
+ {
+ return Pass (test);
+ }
+
+ public bool IsEmpty {
+ get {
+ return false;
+ }
+ }
+
+ #endregion
+ }
+}
+
diff --git a/main/src/addins/NUnit/NUnitRunner/packages.config b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/packages.config
index b815516599..b815516599 100644
--- a/main/src/addins/NUnit/NUnitRunner/packages.config
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/NUnitRunner/packages.config
diff --git a/main/src/addins/NUnit/templates/NUnitAssemblyGroup.xpt.xml b/main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/NUnitAssemblyGroup.xpt.xml
index ab95772034..ab95772034 100644
--- a/main/src/addins/NUnit/templates/NUnitAssemblyGroup.xpt.xml
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/NUnitAssemblyGroup.xpt.xml
diff --git a/main/src/addins/NUnit/templates/NUnitProject.xpt.xml b/main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/NUnitProject.xpt.xml
index 7b364a57c3..7b364a57c3 100644
--- a/main/src/addins/NUnit/templates/NUnitProject.xpt.xml
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/NUnitProject.xpt.xml
diff --git a/main/src/addins/NUnit/templates/NUnitProjectVBNet.xpt.xml b/main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/NUnitProjectVBNet.xpt.xml
index 12ec5b3dae..12ec5b3dae 100644
--- a/main/src/addins/NUnit/templates/NUnitProjectVBNet.xpt.xml
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/NUnitProjectVBNet.xpt.xml
diff --git a/main/src/addins/NUnit/templates/NUnitTestClass.xft.xml b/main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/NUnitTestClass.xft.xml
index aaebb07b4e..aaebb07b4e 100644
--- a/main/src/addins/NUnit/templates/NUnitTestClass.xft.xml
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/NUnitTestClass.xft.xml
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/images/nunit-library-project.png b/main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/images/nunit-library-project.png
new file mode 100644
index 0000000000..c0e3797eaf
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/images/nunit-library-project.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/images/nunit-library-project@2x.png b/main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/images/nunit-library-project@2x.png
new file mode 100644
index 0000000000..c995eb9128
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/images/nunit-library-project@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/images/nunit-library-project~dark.png b/main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/images/nunit-library-project~dark.png
new file mode 100644
index 0000000000..ed1a8d0d5a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/images/nunit-library-project~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/images/nunit-library-project~dark@2x.png b/main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/images/nunit-library-project~dark@2x.png
new file mode 100644
index 0000000000..62ef7ff47e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/templates/images/nunit-library-project~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/AddinInfo.cs b/main/src/addins/MonoDevelop.UnitTesting/AddinInfo.cs
new file mode 100644
index 0000000000..c9be9da936
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/AddinInfo.cs
@@ -0,0 +1,15 @@
+
+using System;
+using Mono.Addins;
+using Mono.Addins.Description;
+
+[assembly:Addin ("UnitTesting",
+ Namespace = "MonoDevelop",
+ Version = MonoDevelop.BuildInfo.Version,
+ Category = "Testing")]
+
+[assembly:AddinName ("Unit Testing core support")]
+[assembly:AddinDescription ("Unit Testing core support")]
+
+[assembly:AddinDependency ("Core", MonoDevelop.BuildInfo.Version)]
+[assembly:AddinDependency ("Ide", MonoDevelop.BuildInfo.Version)]
diff --git a/main/src/addins/MonoDevelop.UnitTesting/AssemblyInfo.cs b/main/src/addins/MonoDevelop.UnitTesting/AssemblyInfo.cs
new file mode 100644
index 0000000000..7b21277467
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/AssemblyInfo.cs
@@ -0,0 +1,9 @@
+// Autogenerated from MonoDevelopNUnit.addin.xml
+
+using System.Reflection;
+
+[assembly: AssemblyProduct ("MonoDevelop")]
+[assembly: AssemblyTitle ("NUnit support")]
+[assembly: AssemblyDescription ("Integrates NUnit into the MonoDevelop IDE.")]
+[assembly: AssemblyVersion ("2.6")]
+[assembly: AssemblyCopyright ("MIT X11")]
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Commands/NUnitCommands.cs b/main/src/addins/MonoDevelop.UnitTesting/Commands/NUnitCommands.cs
new file mode 100644
index 0000000000..5f776ccc60
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Commands/NUnitCommands.cs
@@ -0,0 +1,86 @@
+//
+// TestChart.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Projects;
+using MonoDevelop.Ide;
+
+namespace MonoDevelop.UnitTesting.Commands
+{
+ public enum TestCommands
+ {
+ RunAllTests,
+ RunTest,
+ DebugTest,
+ RunTestWith,
+ ShowTestCode,
+ SelectTestInTree,
+ ShowTestDetails,
+ GoToFailure,
+ RerunTest,
+ }
+
+ public enum TestChartCommands
+ {
+ ShowResults,
+ ShowTime,
+ UseTimeScale,
+ SingleDayResult,
+ ShowSuccessfulTests,
+ ShowFailedTests,
+ ShowIgnoredTests
+ }
+
+ public enum NUnitProjectCommands
+ {
+ AddAssembly
+ }
+
+ class RunAllTestsHandler: CommandHandler
+ {
+ protected override void Run ()
+ {
+ WorkspaceObject ob = IdeApp.ProjectOperations.CurrentSelectedObject;
+ if (ob != null) {
+ UnitTest test = UnitTestService.FindRootTest (ob);
+ if (test != null)
+ UnitTestService.RunTest (test, null);
+ }
+ }
+
+ protected override void Update (CommandInfo info)
+ {
+ WorkspaceObject ob = IdeApp.ProjectOperations.CurrentSelectedObject;
+ if (ob != null) {
+ UnitTest test = UnitTestService.FindRootTest (ob);
+ info.Enabled = (test != null);
+ } else
+ info.Enabled = false;
+ }
+ }
+}
diff --git a/main/src/addins/NUnit/Gui/NUnitOptionsPanel.cs b/main/src/addins/MonoDevelop.UnitTesting/Gui/NUnitOptionsPanel.cs
index b4cecde926..b4cecde926 100644
--- a/main/src/addins/NUnit/Gui/NUnitOptionsPanel.cs
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/NUnitOptionsPanel.cs
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestChart.cs b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestChart.cs
new file mode 100644
index 0000000000..13e923934d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestChart.cs
@@ -0,0 +1,407 @@
+//
+// TestChart.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections;
+using Gtk;
+using Gdk;
+using MonoDevelop.Components.Chart;
+
+namespace MonoDevelop.UnitTesting
+{
+ enum TestChartType {
+ Results,
+ Time
+ }
+
+ class TestRunAxis: IntegerAxis
+ {
+ public UnitTestResult[] CurrentResults;
+
+ public TestRunAxis (bool showLabel): base (showLabel)
+ {
+ }
+
+ public override string GetValueLabel (double value)
+ {
+ if (CurrentResults == null)
+ return "";
+
+ int val = (int) value;
+ if (val >= CurrentResults.Length)
+ return "";
+
+ UnitTestResult res = CurrentResults [CurrentResults.Length - val - 1];
+ return string.Format ("{0}/{1}", res.TestDate.Day, res.TestDate.Month);
+ }
+ }
+
+ class TestChart: BasicChart
+ {
+ Serie serieFailed;
+ Serie serieSuccess;
+ Serie serieIgnored;
+
+ Serie serieTime;
+
+ bool timeScale = false;
+ bool singleDayResult = false;
+ TestChartType type;
+
+ TimeSpan currentSpan = TimeSpan.FromDays (5);
+ int testCount = 20;
+ UnitTest test;
+ bool showLastTest = true;
+ bool resetCursors = true;
+ double lastDateValue;
+ double lastTestNumber;
+ UnitTestResult[] currentResults;
+ TestRunAxis testRunAxis;
+
+ public TestChart ()
+ {
+ AllowSelection = true;
+ SetAutoScale (AxisDimension.Y, false, true);
+ StartY = 0;
+
+ serieFailed = new Serie ("Failed tests");
+ serieFailed.Color = new Cairo.Color (1, 0, 0);
+ serieSuccess = new Serie ("Successful tests");
+ serieSuccess.Color = new Cairo.Color (0, 0.65, 0);
+ serieIgnored = new Serie ("Ignored tests");
+ serieIgnored.Color = new Cairo.Color (0.8, 0.8, 0);
+
+ serieTime = new Serie ("Time");
+ serieTime.Color = new Cairo.Color (0, 0, 1);
+
+ UpdateMode ();
+
+/* EndX = DateTime.Now.Ticks;
+ StartX = EndX - currentSpan.Ticks;
+ */
+ EndX = 5;
+ StartX = 0;
+ }
+
+ public bool ShowSuccessfulTests {
+ get { return serieSuccess.Visible; }
+ set { serieSuccess.Visible = value; }
+ }
+
+ public bool ShowFailedTests {
+ get { return serieFailed.Visible; }
+ set { serieFailed.Visible = value; }
+ }
+
+ public bool ShowIgnoredTests {
+ get { return serieIgnored.Visible; }
+ set { serieIgnored.Visible = value; }
+ }
+
+ public bool UseTimeScale {
+ get { return timeScale; }
+ set { timeScale = value; UpdateMode (); }
+ }
+
+ public bool SingleDayResult {
+ get { return singleDayResult; }
+ set { singleDayResult = value; UpdateMode (); }
+ }
+
+ public TestChartType Type {
+ get { return type; }
+ set { type = value; UpdateMode (); }
+ }
+
+ public DateTime CurrentDate {
+ get {
+ if (timeScale)
+ return new DateTime ((long) SelectionEnd.Value);
+ else {
+ int n = (int) SelectionStart.Value;
+ if (currentResults != null && n >= 0 && n < currentResults.Length)
+ return currentResults [currentResults.Length - n - 1].TestDate;
+ else
+ return DateTime.MinValue;
+ }
+ }
+ }
+
+ public DateTime ReferenceDate {
+ get {
+ if (timeScale)
+ return new DateTime ((long) SelectionStart.Value);
+ else {
+ int n = (int) SelectionEnd.Value;
+ if (currentResults != null && n >= 0 && n < currentResults.Length)
+ return currentResults [currentResults.Length - n - 1].TestDate;
+ else
+ return DateTime.MinValue;
+ }
+ }
+ }
+
+ void UpdateMode ()
+ {
+ AllowSelection = false;
+
+ Reset ();
+
+ if (type == TestChartType.Results) {
+ AddSerie (serieIgnored);
+ AddSerie (serieFailed);
+ AddSerie (serieSuccess);
+ } else {
+ AddSerie (serieTime);
+ }
+
+ if (timeScale) {
+ ReverseXAxis = false;
+ Axis ax = new DateTimeAxis (true);
+ AddAxis (new DateTimeAxis (false), AxisPosition.Top);
+ AddAxis (ax, AxisPosition.Bottom);
+ SelectionEnd.Value = SelectionStart.Value = DateTime.Now.Ticks;
+ SelectionStart.LabelAxis = ax;
+ SelectionEnd.LabelAxis = ax;
+ } else {
+ ReverseXAxis = true;
+ AddAxis (new TestRunAxis (false), AxisPosition.Top);
+ testRunAxis = new TestRunAxis (true);
+ AddAxis (testRunAxis, AxisPosition.Bottom);
+ SelectionEnd.Value = SelectionStart.Value = 0;
+ SelectionStart.LabelAxis = testRunAxis;
+ SelectionEnd.LabelAxis = testRunAxis;
+ }
+ showLastTest = true;
+ resetCursors = true;
+
+ AddAxis (new IntegerAxis (true), AxisPosition.Left);
+ AddAxis (new IntegerAxis (true), AxisPosition.Right);
+
+ if (test != null)
+ Fill (test);
+
+ AllowSelection = true;
+ }
+
+ public new void Clear ()
+ {
+ base.Clear ();
+ test = null;
+ }
+
+ public void ZoomIn ()
+ {
+ if (test == null)
+ return;
+ if (timeScale) {
+ currentSpan = new TimeSpan (currentSpan.Ticks / 2);
+ if (currentSpan.TotalSeconds < 60)
+ currentSpan = TimeSpan.FromSeconds (60);
+ } else {
+ testCount = testCount / 2;
+ if (testCount < 5)
+ testCount = 5;
+ }
+ Fill (test);
+ }
+
+ public void ZoomOut ()
+ {
+ if (test == null)
+ return;
+ if (timeScale) {
+ currentSpan = new TimeSpan (currentSpan.Ticks * 2);
+ if (currentSpan.TotalDays > 50 * 365)
+ currentSpan = TimeSpan.FromDays (50 * 365);
+ } else {
+ testCount *= 2;
+ if (testCount > 100000)
+ testCount = 100000;
+ }
+ Fill (test);
+ }
+
+ public void GoNext ()
+ {
+ if (showLastTest)
+ return;
+
+ if (timeScale) {
+ lastDateValue += (EndX - StartX) / 3;
+ UnitTestResult lastResult = test.Results.GetLastResult (DateTime.Now);
+ if (lastResult != null && new DateTime ((long)lastDateValue) > lastResult.TestDate)
+ showLastTest = true;
+ } else {
+ lastTestNumber -= (EndX - StartX) / 3;
+ if (lastTestNumber < 0)
+ showLastTest = true;
+ }
+ Fill (test);
+ }
+
+ public void GoPrevious ()
+ {
+ if (timeScale) {
+ lastDateValue -= (EndX - StartX) / 3;
+ } else {
+ lastTestNumber += (EndX - StartX) / 3;
+ }
+ showLastTest = false;
+ Fill (test);
+ }
+
+ public void GoLast ()
+ {
+ showLastTest = true;
+ resetCursors = true;
+ Fill (test);
+ }
+
+ public void Fill (UnitTest test)
+ {
+ serieFailed.Clear ();
+ serieSuccess.Clear ();
+ serieIgnored.Clear ();
+ serieTime.Clear ();
+
+ this.test = test;
+
+ if (showLastTest) {
+ if (timeScale)
+ lastDateValue = DateTime.Now.Ticks;
+ else
+ lastTestNumber = 0;
+ }
+
+ UnitTestResult first = null;
+ UnitTestResult[] results;
+ UnitTestResult lastResult = test.Results.GetLastResult (DateTime.Now);
+ if (lastResult == null)
+ return;
+
+ if (timeScale) {
+ DateTime startDate;
+ if (showLastTest) {
+ startDate = lastResult.TestDate - currentSpan;
+ StartX = startDate.Ticks;
+ EndX = lastResult.TestDate.Ticks;
+ first = test.Results.GetLastResult (startDate);
+ results = test.Results.GetResults (startDate, lastResult.TestDate);
+ } else {
+ DateTime endDate = new DateTime ((long)lastDateValue);
+ startDate = endDate - currentSpan;
+ StartX = (double)startDate.Ticks;
+ EndX = (double)endDate.Ticks;
+ first = test.Results.GetLastResult (startDate);
+ results = test.Results.GetResults (startDate, lastResult.TestDate);
+ }
+ if (singleDayResult) {
+ first = test.Results.GetPreviousResult (new DateTime (startDate.Year, startDate.Month, startDate.Day));
+ ArrayList list = new ArrayList ();
+ if (first != null)
+ list.Add (first);
+ for (int n=0; n<results.Length - 1; n++) {
+ DateTime d1 = results [n].TestDate;
+ DateTime d2 = results [n + 1].TestDate;
+ if (d1.Day != d2.Day || d1.Month != d2.Month || d1.Year != d2.Year)
+ list.Add (results [n]);
+ }
+ list.Add (results [results.Length - 1]);
+ results = (UnitTestResult[])list.ToArray (typeof(UnitTestResult));
+ }
+
+ if (resetCursors) {
+ SelectionEnd.Value = EndX;
+ if (results.Length > 1)
+ SelectionStart.Value = results [results.Length - 2].TestDate.Ticks;
+ else
+ SelectionStart.Value = EndX;
+ resetCursors = false;
+ }
+ } else {
+ if (singleDayResult) {
+ ArrayList list = new ArrayList ();
+ list.Add (lastResult);
+ while (list.Count < testCount + (int)lastTestNumber + 1) {
+ UnitTestResult res = test.Results.GetPreviousResult (lastResult.TestDate);
+ if (res == null)
+ break;
+ if (res.TestDate.Day != lastResult.TestDate.Day || res.TestDate.Month != lastResult.TestDate.Month || res.TestDate.Year != lastResult.TestDate.Year)
+ list.Add (res);
+ lastResult = res;
+ }
+ results = (UnitTestResult[])list.ToArray (typeof(UnitTestResult));
+ Array.Reverse (results);
+ } else {
+ results = test.Results.GetResultsToDate (DateTime.Now, testCount + (int)lastTestNumber + 1);
+ }
+ EndX = lastTestNumber + testCount;
+ StartX = lastTestNumber;
+
+ if (resetCursors) {
+ SelectionStart.Value = StartX;
+ SelectionEnd.Value = StartX + 1;
+ resetCursors = false;
+ }
+ }
+
+
+ currentResults = results;
+ if (testRunAxis != null)
+ testRunAxis.CurrentResults = currentResults;
+
+ if (Type == TestChartType.Results) {
+ if (first != null) {
+ double x = timeScale ? first.TestDate.Ticks : results.Length;
+ serieFailed.AddData (x, first.ErrorsAndFailures);
+ serieSuccess.AddData (x, first.Passed);
+ serieIgnored.AddData (x, first.TestsNotRun);
+ }
+
+ for (int n=0; n < results.Length; n++) {
+ UnitTestResult res = results [n];
+ double x = timeScale ? res.TestDate.Ticks : results.Length - n - 1;
+ serieFailed.AddData (x, res.ErrorsAndFailures);
+ serieSuccess.AddData (x, res.Passed);
+ serieIgnored.AddData (x, res.TestsNotRun);
+ }
+ } else {
+ if (first != null) {
+ double x = timeScale ? first.TestDate.Ticks : results.Length;
+ serieTime.AddData (x, first.Time.TotalMilliseconds);
+ }
+ for (int n=0; n < results.Length; n++) {
+ UnitTestResult res = results [n];
+ double x = timeScale ? res.TestDate.Ticks : results.Length - n - 1;
+ serieTime.AddData (x, results [n].Time.TotalMilliseconds);
+ }
+ }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestNodeBuilder.cs b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestNodeBuilder.cs
new file mode 100644
index 0000000000..e09a748a95
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestNodeBuilder.cs
@@ -0,0 +1,197 @@
+//
+// TestNodeBuilder.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Globalization;
+using System.Text;
+
+using MonoDevelop.Core;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.UnitTesting.Commands;
+using MonoDevelop.Ide.Commands;
+using MonoDevelop.Ide.Gui.Components;
+using MonoDevelop.Ide;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace MonoDevelop.UnitTesting
+{
+ class TestNodeBuilder: TypeNodeBuilder
+ {
+ public override Type CommandHandlerType {
+ get { return typeof(TestNodeCommandHandler); }
+ }
+
+ public override string ContextMenuAddinPath {
+ get { return "/MonoDevelop/UnitTesting/ContextMenu/TestPad"; }
+ }
+
+ public override Type NodeDataType {
+ get { return typeof(UnitTest); }
+ }
+
+ public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
+ {
+ return ((UnitTest)dataObject).Name;
+ }
+
+/* public override void GetNodeAttributes (ITreeNavigator parentNode, object dataObject, ref NodeAttributes attributes)
+ {
+ attributes |= NodeAttributes.UseMarkup;
+ }
+*/
+ public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
+ {
+ UnitTest test = dataObject as UnitTest;
+ nodeInfo.Icon = test.StatusIcon;
+
+ var title = RemoveGenericArgument (test.Title);
+ title = test.Title;
+ if (test.Status == TestStatus.Running) {
+ nodeInfo.Label = Ambience.EscapeText (title);
+ return;
+ } else if (test.Status == TestStatus.Loading) {
+ nodeInfo.Label = Ambience.EscapeText (title) + GettextCatalog.GetString (" (Loading)");
+ return;
+ } else if (test.Status == TestStatus.LoadError) {
+ nodeInfo.Label = Ambience.EscapeText (title) + GettextCatalog.GetString (" (Load failed)");
+ return;
+ } else {
+ nodeInfo.Label = Ambience.EscapeText (title);
+
+ UnitTestResult res = test.GetLastResult ();
+ if (res != null && treeBuilder.Options ["ShowTestCounters"] && (test is UnitTestGroup)) {
+ nodeInfo.Label += string.Format (GettextCatalog.GetString (" ({0} passed, {1} failed, {2} not run)"), res.Passed, res.ErrorsAndFailures, res.TestsNotRun);
+ }
+
+ if (treeBuilder.Options ["ShowTestTime"]) {
+ nodeInfo.Label += string.Format (" Time: {0}ms", res.Time.TotalMilliseconds);
+ }
+ }
+ }
+
+ public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
+ {
+ UnitTestGroup test = dataObject as UnitTestGroup;
+ if (test == null)
+ return;
+
+ builder.AddChildren (test.Tests);
+ }
+
+ public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
+ {
+ UnitTestGroup test = dataObject as UnitTestGroup;
+ return test != null && test.Tests.Count > 0;
+ }
+
+ public override void OnNodeAdded (object dataObject)
+ {
+ UnitTest test = (UnitTest) dataObject;
+ test.TestChanged += OnTestChanged;
+ test.TestStatusChanged += OnTestStatusChanged;
+ }
+
+ public override void OnNodeRemoved (object dataObject)
+ {
+ UnitTest test = (UnitTest) dataObject;
+ test.TestChanged -= OnTestChanged;
+ test.TestStatusChanged -= OnTestStatusChanged;
+ }
+
+ public void OnTestChanged (object sender, EventArgs args)
+ {
+ ITreeBuilder tb = Context.GetTreeBuilder (sender);
+ if (tb != null) tb.UpdateAll ();
+ }
+
+ public void OnTestStatusChanged (object sender, EventArgs args)
+ {
+ ITreeBuilder tb = Context.GetTreeBuilder (sender);
+ if (tb != null) tb.Update ();
+ }
+
+ static string RemoveGenericArgument (string title)
+ {
+ var leftParen = title.LastIndexOf ('(', title.Length - 1);
+ if (leftParen > -1) {
+ var leftAngleIndex = title.LastIndexOf ('<', leftParen);
+ if (leftAngleIndex > -1) {
+ var rightAngleIndex = title.IndexOf ('>', leftAngleIndex);
+ if (rightAngleIndex > -1) {
+ title = title.Substring (0, leftAngleIndex) + title.Substring (rightAngleIndex + 1);
+ }
+ }
+ }
+ return title;
+ }
+ }
+
+ class TestNodeCommandHandler: NodeCommandHandler
+ {
+ [CommandHandler (TestCommands.ShowTestCode)]
+ protected async void OnShowTest ()
+ {
+ UnitTest test = CurrentNode.DataItem as UnitTest;
+ SourceCodeLocation loc = null;
+// UnitTestResult res = test.GetLastResult ();
+ loc = test.SourceCodeLocation;
+ if (loc != null)
+ await IdeApp.Workbench.OpenDocument (loc.FileName, loc.Line, loc.Column);
+ }
+
+ [CommandHandler (TestCommands.GoToFailure)]
+ protected async void OnShowFailure ()
+ {
+ UnitTest test = CurrentNode.DataItem as UnitTest;
+ SourceCodeLocation loc = null;
+ UnitTestResult res = test.GetLastResult ();
+ if (res != null && res.IsFailure)
+ loc = res.GetFailureLocation ();
+ if (loc == null)
+ loc = test.SourceCodeLocation;
+ if (loc != null)
+ await IdeApp.Workbench.OpenDocument (loc.FileName, loc.Line, loc.Column);
+ }
+
+ [CommandUpdateHandler (TestCommands.GoToFailure)]
+ protected void OnUpdateGoToFailure (CommandInfo info)
+ {
+ UnitTest test = CurrentNode.DataItem as UnitTest;
+ info.Enabled = IsGoToFailureEnabled (test);
+ }
+
+ bool IsGoToFailureEnabled (UnitTest test)
+ {
+ if (/*test.SourceCodeLocation == null ||*/ test is UnitTestGroup)
+ return false;
+
+ UnitTestResult res = test.GetLastResult ();
+ return res != null && res.IsFailure;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestPad.cs b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestPad.cs
new file mode 100644
index 0000000000..f7e55d7743
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestPad.cs
@@ -0,0 +1,926 @@
+//
+// TestPad.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections;
+using Gtk;
+using Gdk;
+
+using MonoDevelop.Core;
+using MonoDevelop.Core.Execution;
+using MonoDevelop.Ide.Gui.Pads;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.UnitTesting.Commands;
+using MonoDevelop.Ide.Gui.Components;
+using MonoDevelop.Ide.Execution;
+using MonoDevelop.Components.Docking;
+using MonoDevelop.Ide;
+using MonoDevelop.Projects;
+using System.Linq;
+using MonoDevelop.Components;
+using MonoDevelop.Ide.Commands;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.UnitTesting
+{
+ class TestPad : TreeViewPad
+ {
+ AsyncOperation runningTestOperation;
+ VPaned paned;
+ TreeView detailsTree;
+ ListStore detailsStore;
+ HeaderLabel detailLabel;
+ TestChart chart;
+ UnitTest detailsTest;
+ DateTime detailsDate;
+ DateTime detailsReferenceDate;
+ ButtonNotebook infoBook;
+ TextView outputView;
+ TextView resultView;
+ TreeView regressionTree;
+ ListStore regressionStore;
+ TreeView failedTree;
+ ListStore failedStore;
+
+ int TestSummaryPage;
+ int TestRegressionsPage;
+ int TestFailuresPage;
+ int TestResultPage;
+ int TestOutputPage;
+
+ VBox detailsPad;
+
+ ArrayList testNavigationHistory = new ArrayList ();
+
+ Button buttonRunAll, buttonStop;
+
+ public override void Initialize (NodeBuilder[] builders, TreePadOption[] options, string menuPath)
+ {
+ base.Initialize (builders, options, menuPath);
+
+ UnitTestService.TestSuiteChanged += OnTestSuiteChanged;
+ paned = new VPaned ();
+
+ VBox vbox = new VBox ();
+ DockItemToolbar topToolbar = Window.GetToolbar (DockPositionType.Top);
+
+ var hbox = new HBox { Spacing = 6 };
+ hbox.PackStart (new ImageView (ImageService.GetIcon ("md-execute-all", IconSize.Menu)), false, false, 0);
+ hbox.PackStart (new Label (GettextCatalog.GetString ("Run All")), false, false, 0);
+ buttonRunAll = new Button (hbox);
+ buttonRunAll.Clicked += new EventHandler (OnRunAllClicked);
+ buttonRunAll.Sensitive = true;
+ buttonRunAll.TooltipText = GettextCatalog.GetString ("Run all tests");
+ topToolbar.Add (buttonRunAll);
+
+ buttonStop = new Button (new ImageView (Ide.Gui.Stock.Stop, IconSize.Menu));
+ buttonStop.Clicked += new EventHandler (OnStopClicked);
+ buttonStop.Sensitive = false;
+ buttonStop.TooltipText = GettextCatalog.GetString ("Cancel running test");
+ topToolbar.Add (buttonStop);
+ topToolbar.ShowAll ();
+
+ vbox.PackEnd (base.Control, true, true, 0);
+ vbox.FocusChain = new Gtk.Widget [] { base.Control };
+
+ paned.Pack1 (vbox, true, true);
+
+ detailsPad = new VBox ();
+
+ EventBox eb = new EventBox ();
+ HBox header = new HBox ();
+ eb.Add (header);
+
+ detailLabel = new HeaderLabel ();
+ detailLabel.Padding = 6;
+
+ Button hb = new Button (new ImageView ("gtk-close", IconSize.SmallToolbar));
+ hb.Relief = ReliefStyle.None;
+ hb.Clicked += new EventHandler (OnCloseDetails);
+ header.PackEnd (hb, false, false, 0);
+
+ hb = new Button (new ImageView ("gtk-go-back", IconSize.SmallToolbar));
+ hb.Relief = ReliefStyle.None;
+ hb.Clicked += new EventHandler (OnGoBackTest);
+ header.PackEnd (hb, false, false, 0);
+
+ header.Add (detailLabel);
+ Gdk.Color hcol = eb.Style.Background (StateType.Normal);
+ hcol.Red = (ushort) (((double)hcol.Red) * 0.9);
+ hcol.Green = (ushort) (((double)hcol.Green) * 0.9);
+ hcol.Blue = (ushort) (((double)hcol.Blue) * 0.9);
+ // eb.ModifyBg (StateType.Normal, hcol);
+
+ detailsPad.PackStart (eb, false, false, 0);
+
+ VPaned panedDetails = new VPaned ();
+ panedDetails.BorderWidth = 3;
+ VBox boxPaned1 = new VBox ();
+
+ chart = new TestChart ();
+ chart.SelectionChanged += new EventHandler (OnChartDateChanged);
+
+ var chartWidget = chart.GetNativeWidget<Widget> ();
+ chartWidget.ButtonPressEvent += OnChartButtonPress;
+ chartWidget.HeightRequest = 50;
+
+ Toolbar toolbar = new Toolbar ();
+ toolbar.IconSize = IconSize.SmallToolbar;
+ toolbar.ToolbarStyle = ToolbarStyle.Icons;
+ toolbar.ShowArrow = false;
+ ToolButton but = new ToolButton ("gtk-zoom-in");
+ but.Clicked += new EventHandler (OnZoomIn);
+ toolbar.Insert (but, -1);
+
+ but = new ToolButton ("gtk-zoom-out");
+ but.Clicked += new EventHandler (OnZoomOut);
+ toolbar.Insert (but, -1);
+
+ but = new ToolButton ("gtk-go-back");
+ but.Clicked += new EventHandler (OnChartBack);
+ toolbar.Insert (but, -1);
+
+ but = new ToolButton ("gtk-go-forward");
+ but.Clicked += new EventHandler (OnChartForward);
+ toolbar.Insert (but, -1);
+
+ but = new ToolButton ("gtk-goto-last");
+ but.Clicked += new EventHandler (OnChartLast);
+ toolbar.Insert (but, -1);
+
+ boxPaned1.PackStart (toolbar, false, false, 0);
+ boxPaned1.PackStart (chart, true, true, 0);
+
+ panedDetails.Pack1 (boxPaned1, false, false);
+
+ // Detailed test information --------
+
+ infoBook = new ButtonNotebook ();
+ infoBook.PageLoadRequired += new EventHandler (OnPageLoadRequired);
+
+ // Info - Group summary
+
+ Frame tf = new Frame ();
+ ScrolledWindow sw = new ScrolledWindow ();
+ detailsTree = new TreeView ();
+
+ detailsTree.HeadersVisible = true;
+ detailsTree.RulesHint = true;
+ detailsStore = new ListStore (typeof(object), typeof(string), typeof (string), typeof (string), typeof (string));
+
+ CellRendererText trtest = new CellRendererText ();
+ CellRendererText tr;
+
+ TreeViewColumn col3 = new TreeViewColumn ();
+ col3.Expand = false;
+// col3.Alignment = 0.5f;
+ col3.Widget = new ImageView (TestStatusIcon.Success);
+ col3.Widget.Show ();
+ tr = new CellRendererText ();
+// tr.Xalign = 0.5f;
+ col3.PackStart (tr, false);
+ col3.AddAttribute (tr, "markup", 2);
+ detailsTree.AppendColumn (col3);
+
+ TreeViewColumn col4 = new TreeViewColumn ();
+ col4.Expand = false;
+// col4.Alignment = 0.5f;
+ col4.Widget = new ImageView (TestStatusIcon.Failure);
+ col4.Widget.Show ();
+ tr = new CellRendererText ();
+// tr.Xalign = 0.5f;
+ col4.PackStart (tr, false);
+ col4.AddAttribute (tr, "markup", 3);
+ detailsTree.AppendColumn (col4);
+
+ TreeViewColumn col5 = new TreeViewColumn ();
+ col5.Expand = false;
+// col5.Alignment = 0.5f;
+ col5.Widget = new ImageView (TestStatusIcon.NotRun);
+ col5.Widget.Show ();
+ tr = new CellRendererText ();
+// tr.Xalign = 0.5f;
+ col5.PackStart (tr, false);
+ col5.AddAttribute (tr, "markup", 4);
+ detailsTree.AppendColumn (col5);
+
+ TreeViewColumn col1 = new TreeViewColumn ();
+// col1.Resizable = true;
+// col1.Expand = true;
+ col1.Title = "Test";
+ col1.PackStart (trtest, true);
+ col1.AddAttribute (trtest, "markup", 1);
+ detailsTree.AppendColumn (col1);
+
+ detailsTree.Model = detailsStore;
+
+ sw.Add (detailsTree);
+ tf.Add (sw);
+ tf.ShowAll ();
+
+ TestSummaryPage = infoBook.AddPage (GettextCatalog.GetString ("Summary"), tf);
+
+ // Info - Regressions list
+
+ tf = new Frame ();
+ sw = new ScrolledWindow ();
+ tf.Add (sw);
+ regressionTree = new TreeView ();
+ regressionTree.HeadersVisible = false;
+ regressionTree.RulesHint = true;
+ regressionStore = new ListStore (typeof(object), typeof(string), typeof (Xwt.Drawing.Image));
+
+ CellRendererText trtest2 = new CellRendererText ();
+ var pr = new CellRendererImage ();
+
+ TreeViewColumn col = new TreeViewColumn ();
+ col.PackStart (pr, false);
+ col.AddAttribute (pr, "image", 2);
+ col.PackStart (trtest2, false);
+ col.AddAttribute (trtest2, "markup", 1);
+ regressionTree.AppendColumn (col);
+ regressionTree.Model = regressionStore;
+ sw.Add (regressionTree);
+ tf.ShowAll ();
+
+ TestRegressionsPage = infoBook.AddPage (GettextCatalog.GetString ("Regressions"), tf);
+
+ // Info - Failed tests list
+
+ tf = new Frame ();
+ sw = new ScrolledWindow ();
+ tf.Add (sw);
+ failedTree = new TreeView ();
+ failedTree.HeadersVisible = false;
+ failedTree.RulesHint = true;
+ failedStore = new ListStore (typeof(object), typeof(string), typeof (Xwt.Drawing.Image));
+
+ trtest2 = new CellRendererText ();
+ pr = new CellRendererImage ();
+
+ col = new TreeViewColumn ();
+ col.PackStart (pr, false);
+ col.AddAttribute (pr, "image", 2);
+ col.PackStart (trtest2, false);
+ col.AddAttribute (trtest2, "markup", 1);
+ failedTree.AppendColumn (col);
+ failedTree.Model = failedStore;
+ sw.Add (failedTree);
+ tf.ShowAll ();
+
+ TestFailuresPage = infoBook.AddPage (GettextCatalog.GetString ("Failed tests"), tf);
+
+ // Info - results
+
+ tf = new Frame ();
+ sw = new ScrolledWindow ();
+ tf.Add (sw);
+ resultView = new TextView ();
+ resultView.Editable = false;
+ sw.Add (resultView);
+ tf.ShowAll ();
+ TestResultPage = infoBook.AddPage (GettextCatalog.GetString ("Result"), tf);
+
+ // Info - Output
+
+ tf = new Frame ();
+ sw = new ScrolledWindow ();
+ tf.Add (sw);
+ outputView = new TextView ();
+ outputView.Editable = false;
+ sw.Add (outputView);
+ tf.ShowAll ();
+ TestOutputPage = infoBook.AddPage (GettextCatalog.GetString ("Output"), tf);
+
+ panedDetails.Pack2 (infoBook, true, true);
+ detailsPad.PackStart (panedDetails, true, true, 0);
+ paned.Pack2 (detailsPad, true, true);
+
+ paned.ShowAll ();
+
+ infoBook.HidePage (TestResultPage);
+ infoBook.HidePage (TestOutputPage);
+ infoBook.HidePage (TestSummaryPage);
+ infoBook.HidePage (TestRegressionsPage);
+ infoBook.HidePage (TestFailuresPage);
+
+ detailsPad.Sensitive = false;
+ detailsPad.Hide ();
+
+ detailsTree.RowActivated += new Gtk.RowActivatedHandler (OnTestActivated);
+ regressionTree.RowActivated += new Gtk.RowActivatedHandler (OnRegressionTestActivated);
+ failedTree.RowActivated += new Gtk.RowActivatedHandler (OnFailedTestActivated);
+
+ foreach (UnitTest t in UnitTestService.RootTests)
+ TreeView.AddChild (t);
+ }
+
+ void OnTestSuiteChanged (object sender, EventArgs e)
+ {
+ if (UnitTestService.RootTests.Length > 0) {
+ var s = TreeView.SaveTreeState ();
+ TreeView.Clear ();
+ foreach (UnitTest t in UnitTestService.RootTests)
+ TreeView.AddChild (t);
+ TreeView.RestoreTreeState (s);
+ }
+ else {
+ TreeView.Clear ();
+ ClearDetails ();
+ }
+ }
+
+ public void SelectTest (UnitTest t)
+ {
+ ITreeNavigator node = FindTestNode (t);
+ if (node != null) {
+ node.ExpandToNode ();
+ node.Selected = true;
+ }
+ }
+
+ ITreeNavigator FindTestNode (UnitTest t)
+ {
+ ITreeNavigator nav = TreeView.GetNodeAtObject (t);
+ if (nav != null)
+ return nav;
+ if (t.Parent == null)
+ return null;
+
+ nav = FindTestNode (t.Parent);
+
+ if (nav == null)
+ return null;
+
+ nav.MoveToFirstChild (); // Make sure the children are created
+ return TreeView.GetNodeAtObject (t);
+ }
+
+ public override Control Control {
+ get {
+ return paned;
+ }
+ }
+
+ [CommandHandler (TestCommands.RunTest)]
+ protected void OnRunTest ()
+ {
+ RunSelectedTest (null);
+ }
+
+ [CommandUpdateHandler (TestCommands.RunTest)]
+ protected void OnUpdateRunTest (CommandInfo info)
+ {
+ info.Enabled = runningTestOperation == null;
+ }
+
+ [CommandHandler (TestCommands.RunTestWith)]
+ protected void OnRunTest (object data)
+ {
+ IExecutionHandler h = ExecutionModeCommandService.GetExecutionModeForCommand (data);
+ if (h != null)
+ RunSelectedTest (h);
+ }
+
+ [CommandUpdateHandler (TestCommands.RunTestWith)]
+ protected void OnUpdateRunTest (CommandArrayInfo info)
+ {
+ UnitTest test = GetSelectedTest ();
+ if (test != null) {
+ SolutionItem item = test.OwnerObject as SolutionItem;
+ ExecutionModeCommandService.GenerateExecutionModeCommands (
+ item,
+ test.CanRun,
+ info);
+
+ foreach (var ci in info)
+ ci.Enabled = runningTestOperation == null;
+ }
+ }
+
+ [CommandHandler (TestCommands.DebugTest)]
+ protected void OnDebugTest (object data)
+ {
+ var debugModeSet = Runtime.ProcessService.GetDebugExecutionMode ();
+ var mode = debugModeSet.ExecutionModes.First (m => m.Id == (string)data);
+ RunSelectedTest (mode.ExecutionHandler);
+ }
+
+ [CommandUpdateHandler (TestCommands.DebugTest)]
+ protected void OnUpdateDebugTest (CommandArrayInfo info)
+ {
+ var debugModeSet = Runtime.ProcessService.GetDebugExecutionMode ();
+ if (debugModeSet == null)
+ return;
+
+ UnitTest test = GetSelectedTest ();
+ if (test == null)
+ return;
+
+ foreach (var mode in debugModeSet.ExecutionModes) {
+ if (test.CanRun (mode.ExecutionHandler)) {
+ var ci = info.Add (GettextCatalog.GetString ("Debug Test ({0})", mode.Name), mode.Id);
+ ci.Enabled = runningTestOperation == null;
+ }
+ }
+
+ if (info.Count == 1)
+ info [0].Text = GettextCatalog.GetString ("Debug Test");
+ }
+
+ public TestPad ()
+ {
+ base.TreeView.CurrentItemActivated += delegate {
+ RunSelectedTest (null);
+ };
+ }
+
+ void OnStopClicked (object sender, EventArgs args)
+ {
+ if (runningTestOperation != null)
+ runningTestOperation.Cancel ();
+ }
+
+ UnitTest GetSelectedTest ()
+ {
+ ITreeNavigator nav = TreeView.GetSelectedNode ();
+ if (nav == null)
+ return null;
+ return nav.DataItem as UnitTest;
+ }
+
+ public AsyncOperation RunTest (UnitTest test, IExecutionHandler mode)
+ {
+ return RunTest (FindTestNode (test), mode, false);
+ }
+
+ AsyncOperation RunTest (ITreeNavigator nav, IExecutionHandler mode, bool bringToFront = true)
+ {
+ if (nav == null)
+ return null;
+ UnitTest test = nav.DataItem as UnitTest;
+ if (test == null)
+ return null;
+ UnitTestService.ResetResult (test.RootTest);
+
+ this.buttonRunAll.Sensitive = false;
+ this.buttonStop.Sensitive = true;
+
+ ExecutionContext context = new ExecutionContext (mode, IdeApp.Workbench.ProgressMonitors.ConsoleFactory, null);
+
+ if (bringToFront)
+ IdeApp.Workbench.GetPad<TestPad> ().BringToFront ();
+ runningTestOperation = UnitTestService.RunTest (test, context);
+ runningTestOperation.Task.ContinueWith (t => OnTestSessionCompleted (), TaskScheduler.FromCurrentSynchronizationContext ());
+ return runningTestOperation;
+ }
+
+ void OnRunAllClicked (object sender, EventArgs args)
+ {
+ RunTest (TreeView.GetRootNode (), null);
+ }
+
+ void RunSelectedTest (IExecutionHandler mode)
+ {
+ RunTest (TreeView.GetSelectedNode (), mode);
+ }
+
+ void OnTestSessionCompleted ()
+ {
+ RefreshDetails ();
+ runningTestOperation = null;
+ this.buttonRunAll.Sensitive = true;
+ this.buttonStop.Sensitive = false;
+
+ }
+
+
+ protected override void OnSelectionChanged (object sender, EventArgs args)
+ {
+ base.OnSelectionChanged (sender, args);
+ ITreeNavigator nav = TreeView.GetSelectedNode ();
+ if (nav != null) {
+ UnitTest test = nav.DataItem as UnitTest;
+ if (test != null)
+ FillDetails (test, false);
+ }
+ }
+
+ void OnGoBackTest (object sender, EventArgs args)
+ {
+ int c = testNavigationHistory.Count;
+ if (c > 1) {
+ UnitTest t = (UnitTest) testNavigationHistory [c - 2];
+ testNavigationHistory.RemoveAt (c - 1);
+ testNavigationHistory.RemoveAt (c - 2);
+ FillDetails (t, true);
+ }
+ }
+
+ void OnCloseDetails (object sender, EventArgs args)
+ {
+ detailsPad.Hide ();
+ }
+
+ [CommandHandler (TestCommands.ShowTestDetails)]
+ protected void OnShowDetails ()
+ {
+ if (!detailsPad.Visible) {
+ detailsPad.Show ();
+
+ ITreeNavigator nav = TreeView.GetSelectedNode ();
+ if (nav != null) {
+ UnitTest test = (UnitTest) nav.DataItem;
+ FillDetails (test, false);
+ } else
+ ClearDetails ();
+ }
+ }
+
+ void ClearDetails ()
+ {
+ chart.Clear ();
+ detailLabel.Markup = "";
+ detailsStore.Clear ();
+ if (detailsTest != null)
+ detailsTest.TestChanged -= OnDetailsTestChanged;
+ detailsTest = null;
+ detailsDate = DateTime.MinValue;
+ detailsReferenceDate = DateTime.MinValue;
+ detailsPad.Sensitive = false;
+ }
+
+ void RefreshDetails ()
+ {
+ if (detailsTest != null)
+ FillDetails (detailsTest, false);
+ }
+
+ void FillDetails (UnitTest test, bool selectInTree)
+ {
+ if (!detailsPad.Visible)
+ return;
+
+ detailsPad.Sensitive = true;
+
+ if (detailsTest != null)
+ detailsTest.TestChanged -= OnDetailsTestChanged;
+
+ if (detailsTest != test) {
+ detailsTest = test;
+ if (selectInTree)
+ SelectTest (test);
+ testNavigationHistory.Add (test);
+ if (testNavigationHistory.Count > 50)
+ testNavigationHistory.RemoveAt (0);
+ }
+ detailsTest.TestChanged += OnDetailsTestChanged;
+
+ if (test is UnitTestGroup) {
+ infoBook.HidePage (TestResultPage);
+ infoBook.HidePage (TestOutputPage);
+ infoBook.ShowPage (TestSummaryPage);
+ infoBook.ShowPage (TestRegressionsPage);
+ infoBook.ShowPage (TestFailuresPage);
+ } else {
+ infoBook.HidePage (TestSummaryPage);
+ infoBook.HidePage (TestRegressionsPage);
+ infoBook.HidePage (TestFailuresPage);
+ infoBook.ShowPage (TestResultPage);
+ infoBook.ShowPage (TestOutputPage);
+ }
+ detailLabel.Markup = "<b>" + test.Name + "</b>";
+ detailsDate = DateTime.MinValue;
+ detailsReferenceDate = DateTime.MinValue;
+ chart.Fill (test);
+ infoBook.Reset ();
+ }
+
+ void FillTestInformation ()
+ {
+ if (!detailsPad.Visible)
+ return;
+
+ if (detailsTest is UnitTestGroup) {
+ UnitTestGroup group = detailsTest as UnitTestGroup;
+ if (infoBook.Page == TestSummaryPage) {
+ detailsStore.Clear ();
+ foreach (UnitTest t in group.Tests) {
+ UnitTestResult res = t.Results.GetLastResult (chart.CurrentDate);
+ if (res != null)
+ detailsStore.AppendValues (t, t.Name, res.Passed.ToString (), res.ErrorsAndFailures.ToString (), res.Ignored.ToString());
+ else
+ detailsStore.AppendValues (t, t.Name, "", "", "");
+ }
+ }
+ else if (infoBook.Page == TestRegressionsPage) {
+ regressionStore.Clear ();
+ UnitTestCollection regs = detailsTest.GetRegressions (chart.ReferenceDate, chart.CurrentDate);
+ if (regs.Count > 0) {
+ foreach (UnitTest t in regs)
+ regressionStore.AppendValues (t, t.Name, TestStatusIcon.Failure);
+ } else
+ regressionStore.AppendValues (null, GettextCatalog.GetString ("No regressions found."));
+ }
+ else if (infoBook.Page == TestFailuresPage) {
+ failedStore.Clear ();
+ UnitTestCollection regs = group.GetFailedTests (chart.CurrentDate);
+ if (regs.Count > 0) {
+ foreach (UnitTest t in regs)
+ failedStore.AppendValues (t, t.Name, TestStatusIcon.Failure);
+ } else
+ failedStore.AppendValues (null, GettextCatalog.GetString ("No failed tests found."));
+ }
+ } else {
+ UnitTestResult res = detailsTest.Results.GetLastResult (chart.CurrentDate);
+ if (infoBook.Page == TestOutputPage) {
+ outputView.Buffer.Clear ();
+ if (res != null)
+ outputView.Buffer.InsertAtCursor (res.ConsoleOutput);
+ } else if (infoBook.Page == TestResultPage) {
+ resultView.Buffer.Clear ();
+ if (res != null) {
+ string msg = res.Message + "\n\n" + res.StackTrace;
+ resultView.Buffer.InsertAtCursor (msg);
+ }
+ }
+ }
+ }
+
+ void OnDetailsTestChanged (object sender, EventArgs e)
+ {
+ RefreshDetails ();
+ }
+
+ void OnChartDateChanged (object sender, EventArgs e)
+ {
+ if (detailsTest != null && (detailsDate != chart.CurrentDate || detailsReferenceDate != chart.ReferenceDate)) {
+ detailsDate = chart.CurrentDate;
+ detailsReferenceDate = chart.ReferenceDate;
+ FillTestInformation ();
+ }
+ }
+
+ void OnPageLoadRequired (object o, EventArgs args)
+ {
+ if (detailsTest != null)
+ FillTestInformation ();
+ }
+
+ protected virtual void OnTestActivated (object sender, Gtk.RowActivatedArgs args)
+ {
+ TreeIter it;
+ detailsStore.GetIter (out it, args.Path);
+ UnitTest t = (UnitTest) detailsStore.GetValue (it, 0);
+ if (t != null)
+ FillDetails (t, true);
+ }
+
+ protected virtual void OnRegressionTestActivated (object sender, Gtk.RowActivatedArgs args)
+ {
+ TreeIter it;
+ regressionStore.GetIter (out it, args.Path);
+ UnitTest t = (UnitTest) regressionStore.GetValue (it, 0);
+ if (t != null)
+ FillDetails (t, true);
+ }
+
+ protected virtual void OnFailedTestActivated (object sender, Gtk.RowActivatedArgs args)
+ {
+ TreeIter it;
+ failedStore.GetIter (out it, args.Path);
+ UnitTest t = (UnitTest) failedStore.GetValue (it, 0);
+ if (t != null)
+ FillDetails (t, true);
+ }
+
+ void OnZoomIn (object sender, EventArgs a)
+ {
+ if (detailsTest != null)
+ chart.ZoomIn ();
+ }
+
+ void OnZoomOut (object sender, EventArgs a)
+ {
+ if (detailsTest != null)
+ chart.ZoomOut ();
+ }
+
+ void OnChartBack (object sender, EventArgs a)
+ {
+ if (detailsTest != null)
+ chart.GoPrevious ();
+ }
+
+ void OnChartForward (object sender, EventArgs a)
+ {
+ if (detailsTest != null)
+ chart.GoNext ();
+ }
+
+ void OnChartLast (object sender, EventArgs a)
+ {
+ if (detailsTest != null)
+ chart.GoLast ();
+ }
+
+ void OnChartButtonPress (object o, Gtk.ButtonPressEventArgs args)
+ {
+ if (args.Event.TriggersContextMenu ()) {
+ IdeApp.CommandService.ShowContextMenu (Control, args.Event, "/MonoDevelop/UnitTesting/ContextMenu/TestChart");
+ args.RetVal = true;
+ }
+ }
+
+ [CommandHandler (TestChartCommands.ShowResults)]
+ protected void OnShowResults ()
+ {
+ chart.Type = TestChartType.Results;
+ }
+
+ [CommandUpdateHandler (TestChartCommands.ShowResults)]
+ protected void OnUpdateShowResults (CommandInfo info)
+ {
+ info.Checked = chart.Type == TestChartType.Results;
+ }
+
+ [CommandHandler (TestChartCommands.ShowTime)]
+ protected void OnShowTime ()
+ {
+ chart.Type = TestChartType.Time;
+ }
+
+ [CommandUpdateHandler (TestChartCommands.ShowTime)]
+ protected void OnUpdateShowTime (CommandInfo info)
+ {
+ info.Checked = chart.Type == TestChartType.Time;
+ }
+
+ [CommandHandler (TestChartCommands.UseTimeScale)]
+ protected void OnUseTimeScale ()
+ {
+ chart.UseTimeScale = !chart.UseTimeScale;
+ }
+
+ [CommandUpdateHandler (TestChartCommands.UseTimeScale)]
+ protected void OnUpdateUseTimeScale (CommandInfo info)
+ {
+ info.Checked = chart.UseTimeScale;
+ }
+
+ [CommandHandler (TestChartCommands.SingleDayResult)]
+ protected void OnSingleDayResult ()
+ {
+ chart.SingleDayResult = !chart.SingleDayResult;
+ }
+
+ [CommandUpdateHandler (TestChartCommands.SingleDayResult)]
+ protected void OnUpdateSingleDayResult (CommandInfo info)
+ {
+ info.Checked = chart.SingleDayResult;
+ }
+
+ [CommandHandler (TestChartCommands.ShowSuccessfulTests)]
+ protected void OnShowSuccessfulTests ()
+ {
+ chart.ShowSuccessfulTests = !chart.ShowSuccessfulTests;
+ }
+
+ [CommandUpdateHandler (TestChartCommands.ShowSuccessfulTests)]
+ protected void OnUpdateShowSuccessfulTests (CommandInfo info)
+ {
+ info.Enabled = chart.Type == TestChartType.Results;
+ info.Checked = chart.ShowSuccessfulTests;
+ }
+
+ [CommandHandler (TestChartCommands.ShowFailedTests)]
+ protected void OnShowFailedTests ()
+ {
+ chart.ShowFailedTests = !chart.ShowFailedTests;
+ }
+
+ [CommandUpdateHandler (TestChartCommands.ShowFailedTests)]
+ protected void OnUpdateShowFailedTests (CommandInfo info)
+ {
+ info.Enabled = chart.Type == TestChartType.Results;
+ info.Checked = chart.ShowFailedTests;
+ }
+
+ [CommandHandler (TestChartCommands.ShowIgnoredTests)]
+ protected void OnShowIgnoredTests ()
+ {
+ chart.ShowIgnoredTests = !chart.ShowIgnoredTests;
+ }
+
+ [CommandUpdateHandler (TestChartCommands.ShowIgnoredTests)]
+ protected void OnUpdateShowIgnoredTests (CommandInfo info)
+ {
+ info.Enabled = chart.Type == TestChartType.Results;
+ info.Checked = chart.ShowIgnoredTests;
+ }
+ }
+
+ class ButtonNotebook: Notebook
+ {
+ ArrayList loadedPages = new ArrayList ();
+
+ public void Reset ()
+ {
+ loadedPages.Clear ();
+ OnPageLoadRequired ();
+ }
+
+ public int AddPage (string text, Widget widget)
+ {
+ return AppendPage (widget, new Label (text));
+ }
+
+ public void ShowPage (int n)
+ {
+ GetNthPage (n).Show ();
+ }
+
+ public void HidePage (int n)
+ {
+ GetNthPage (n).Hide ();
+ }
+
+ protected override void OnSwitchPage (NotebookPage page, uint n)
+ {
+ base.OnSwitchPage (page, n);
+ if (!loadedPages.Contains (Page))
+ OnPageLoadRequired ();
+ }
+
+ void OnPageLoadRequired ()
+ {
+ loadedPages.Add (Page);
+ if (PageLoadRequired != null)
+ PageLoadRequired (this, EventArgs.Empty);
+ }
+
+ public EventHandler PageLoadRequired;
+ }
+
+ class HeaderLabel: Widget
+ {
+ string text;
+ Pango.Layout layout;
+ int padding;
+
+ public HeaderLabel ()
+ {
+ WidgetFlags |= WidgetFlags.NoWindow;
+ layout = new Pango.Layout (this.PangoContext);
+ }
+
+ public string Markup {
+ get { return text; }
+ set {
+ text = value;
+ layout.SetMarkup (text);
+ QueueDraw ();
+ }
+ }
+
+ public int Padding {
+ get { return padding; }
+ set { padding = value; }
+ }
+
+ protected override bool OnExposeEvent (Gdk.EventExpose args)
+ {
+ Gdk.GC gc = new Gdk.GC (GdkWindow);
+ gc.ClipRectangle = Allocation;
+ GdkWindow.DrawLayout (gc, padding, padding, layout);
+ return true;
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestResultsPad.cs b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestResultsPad.cs
new file mode 100644
index 0000000000..c207a05218
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestResultsPad.cs
@@ -0,0 +1,862 @@
+//
+// TestResultsPad.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+using System.Text;
+using System.Collections;
+using System.Collections.Generic;
+using Gtk;
+using Gdk;
+
+using MonoDevelop.Core;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.UnitTesting.Commands;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Components.Docking;
+using MonoDevelop.Ide;
+using System.Text.RegularExpressions;
+using MonoDevelop.Components;
+using System.Threading;
+using MonoDevelop.Ide.Commands;
+using MonoDevelop.Ide.Fonts;
+
+namespace MonoDevelop.UnitTesting
+{
+ class TestResultsPad: PadContent, ITestProgressMonitor
+ {
+ IPadWindow window;
+ VBox panel;
+ HPaned book;
+
+ Label infoLabel = new Label ();
+ Label infoCurrent = new Label ();
+ HBox labels;
+
+ Label resultLabel = new Label ();
+
+ ProgressBar progressBar = new ProgressBar ();
+ MonoDevelop.Ide.Gui.Components.PadTreeView failuresTreeView;
+ TreeStore failuresStore;
+ TextView outputView;
+ TextTag bold;
+ Dictionary<UnitTest,int> outIters = new Dictionary<UnitTest,int> ();
+ Widget outputViewScrolled;
+ VSeparator infoSep;
+ Gtk.TreeIter startMessageIter;
+
+ Button buttonStop;
+ Button buttonRun;
+
+ ToggleButton buttonSuccess;
+ ToggleButton buttonFailures;
+ ToggleButton buttonIgnored;
+ ToggleButton buttonInconclusive;
+ ToggleButton buttonOutput;
+
+ bool running;
+ int testsToRun;
+ int testsRun;
+
+ UnitTestResult resultSummary;
+
+ UnitTest rootTest;
+ CancellationTokenSource cancellationSource;
+ string configuration;
+ ArrayList results = new ArrayList ();
+
+ Exception error;
+ string errorMessage;
+
+ bool cancel;
+
+ public class ResultRecord
+ {
+ public UnitTest Test;
+ public UnitTestResult Result;
+ }
+
+ public TestResultsPad ()
+ {
+ UnitTestService.TestSuiteChanged += new EventHandler (OnTestSuiteChanged);
+ IdeApp.Workspace.WorkspaceItemClosed += OnWorkspaceItemClosed;
+
+ panel = new VBox ();
+
+ // Results notebook
+
+ book = new HPaned ();
+ panel.PackStart (book, true, true, 0);
+ panel.FocusChain = new Gtk.Widget [] { book };
+
+ // Failures tree
+ failuresTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView ();
+ failuresTreeView.HeadersVisible = false;
+ failuresStore = new TreeStore (typeof(Xwt.Drawing.Image), typeof(string), typeof(object), typeof(string), typeof(int), typeof(int));
+ var pr = new CellRendererImage ();
+ CellRendererText tr = new CellRendererText ();
+ TreeViewColumn col = new TreeViewColumn ();
+ col.PackStart (pr, false);
+ col.AddAttribute (pr, "image", 0);
+ col.PackStart (tr, false);
+ col.AddAttribute (tr, "markup", 1);
+ failuresTreeView.AppendColumn (col);
+ failuresTreeView.Model = failuresStore;
+
+ var sw = new MonoDevelop.Components.CompactScrolledWindow ();
+ sw.ShadowType = ShadowType.None;
+ sw.Add (failuresTreeView);
+ book.Pack1 (sw, true, true);
+
+ outputView = new MonoDevelop.Ide.Gui.Components.LogView.LogTextView ();
+ outputView.ModifyFont (FontService.MonospaceFont);
+ outputView.Editable = false;
+ bold = new TextTag ("bold");
+ bold.Weight = Pango.Weight.Bold;
+ outputView.Buffer.TagTable.Add (bold);
+ sw = new MonoDevelop.Components.CompactScrolledWindow ();
+ sw.ShadowType = ShadowType.None;
+ sw.Add (outputView);
+ book.Pack2 (sw, true, true);
+ outputViewScrolled = sw;
+
+ failuresTreeView.RowActivated += OnRowActivated;
+ failuresTreeView.Selection.Changed += OnRowSelected;
+ failuresTreeView.DoPopupMenu = delegate (EventButton evt) {
+ IdeApp.CommandService.ShowContextMenu (failuresTreeView, evt,
+ "/MonoDevelop/UnitTesting/ContextMenu/TestResultsPad");
+ };
+
+ panel.ShowAll ();
+
+ outputViewScrolled.Hide ();
+ }
+
+ protected override void Initialize (IPadWindow window)
+ {
+ this.window = window;
+
+ DockItemToolbar toolbar = window.GetToolbar (DockPositionType.Top);
+
+ buttonSuccess = new ToggleButton ();
+ buttonSuccess.Label = GettextCatalog.GetString ("Successful Tests");
+ buttonSuccess.Active = false;
+ buttonSuccess.Image = new ImageView (TestStatusIcon.Success);
+ buttonSuccess.Image.Show ();
+ buttonSuccess.Toggled += new EventHandler (OnShowSuccessfulToggled);
+ buttonSuccess.TooltipText = GettextCatalog.GetString ("Show Successful Tests");
+ toolbar.Add (buttonSuccess);
+
+ buttonInconclusive = new ToggleButton ();
+ buttonInconclusive.Label = GettextCatalog.GetString ("Inconclusive Tests");
+ buttonInconclusive.Active = true;
+ buttonInconclusive.Image = new ImageView (TestStatusIcon.Inconclusive);
+ buttonInconclusive.Image.Show ();
+ buttonInconclusive.Toggled += new EventHandler (OnShowInconclusiveToggled);
+ buttonInconclusive.TooltipText = GettextCatalog.GetString ("Show Inconclusive Tests");
+ toolbar.Add (buttonInconclusive);
+
+ buttonFailures = new ToggleButton ();
+ buttonFailures.Label = GettextCatalog.GetString ("Failed Tests");
+ buttonFailures.Active = true;
+ buttonFailures.Image = new ImageView (TestStatusIcon.Failure);
+ buttonFailures.Image.Show ();
+ buttonFailures.Toggled += new EventHandler (OnShowFailuresToggled);
+ buttonFailures.TooltipText = GettextCatalog.GetString ("Show Failed Tests");
+ toolbar.Add (buttonFailures);
+
+ buttonIgnored = new ToggleButton ();
+ buttonIgnored.Label = GettextCatalog.GetString ("Ignored Tests");
+ buttonIgnored.Active = true;
+ buttonIgnored.Image = new ImageView (TestStatusIcon.NotRun);
+ buttonIgnored.Image.Show ();
+ buttonIgnored.Toggled += new EventHandler (OnShowIgnoredToggled);
+ buttonIgnored.TooltipText = GettextCatalog.GetString ("Show Ignored Tests");
+ toolbar.Add (buttonIgnored);
+
+ buttonOutput = new ToggleButton ();
+ buttonOutput.Label = GettextCatalog.GetString ("Output");
+ buttonOutput.Active = false;
+ buttonOutput.Image = new ImageView (MonoDevelop.Ide.Gui.Stock.OutputIcon, IconSize.Menu);
+ buttonOutput.Image.Show ();
+ buttonOutput.Toggled += new EventHandler (OnShowOutputToggled);
+ buttonOutput.TooltipText = GettextCatalog.GetString ("Show Output");
+ toolbar.Add (buttonOutput);
+
+ toolbar.Add (new SeparatorToolItem ());
+
+ buttonRun = new Button ();
+ buttonRun.Label = GettextCatalog.GetString ("Rerun Tests");
+ buttonRun.Image = new ImageView ("md-execute-all", IconSize.Menu);
+ buttonRun.Image.Show ();
+ buttonRun.Sensitive = false;
+ toolbar.Add (buttonRun);
+
+ buttonStop = new Button (new ImageView (Ide.Gui.Stock.Stop, Gtk.IconSize.Menu));
+ toolbar.Add (buttonStop);
+ toolbar.ShowAll ();
+
+ buttonStop.Clicked += new EventHandler (OnStopClicked);
+ buttonRun.Clicked += new EventHandler (OnRunClicked);
+
+ // Run panel
+
+ DockItemToolbar runPanel = window.GetToolbar (DockPositionType.Bottom);
+
+ infoSep = new VSeparator ();
+
+ resultLabel.UseMarkup = true;
+ infoCurrent.Ellipsize = Pango.EllipsizeMode.Start;
+ infoCurrent.WidthRequest = 0;
+ runPanel.Add (resultLabel);
+ runPanel.Add (progressBar);
+ runPanel.Add (infoCurrent, true, 10);
+
+ labels = new HBox (false, 10);
+
+ infoLabel.UseMarkup = true;
+
+ labels.PackStart (infoLabel, true, false, 0);
+
+ runPanel.Add (new Gtk.Label (), true);
+ runPanel.Add (labels);
+ runPanel.Add (infoSep, false, 10);
+
+ progressBar.HeightRequest = infoLabel.SizeRequest ().Height;
+ runPanel.ShowAll ();
+ progressBar.Hide ();
+ infoSep.Hide ();
+ resultSummary = new UnitTestResult ();
+ UpdateCounters ();
+ }
+
+ public void OnTestSuiteChanged (object sender, EventArgs e)
+ {
+ if (rootTest != null) {
+ rootTest = UnitTestService.SearchTest (rootTest.FullName);
+ if (rootTest == null)
+ buttonRun.Sensitive = false;
+ }
+ }
+
+ void OnWorkspaceItemClosed (object sender, EventArgs e)
+ {
+ ClearResults ();
+ }
+
+ void ClearResults ()
+ {
+ if (failuresTreeView.IsRealized)
+ failuresTreeView.ScrollToPoint (0, 0);
+
+ results.Clear ();
+
+ error = null;
+ errorMessage = null;
+
+ failuresStore.Clear ();
+ outputView.Buffer.Clear ();
+ outIters.Clear ();
+ progressBar.Fraction = 0;
+ progressBar.Text = "";
+ testsRun = 0;
+ resultSummary = new UnitTestResult ();
+ resultLabel.Markup = "";
+ resultLabel.Hide ();
+ labels.Show ();
+ UpdateCounters ();
+ }
+
+ bool Running {
+ get { return running; }
+ set {
+ running = value;
+ window.IsWorking = value;
+ }
+ }
+
+ public override Control Control {
+ get {
+ return panel;
+ }
+ }
+
+ string GetResultsMarkup ()
+ {
+ return string.Format (GettextCatalog.GetString ("<b>Passed</b>: {0} <b>Failed</b>: {1} <b>Errors</b>: {2} <b>Inconclusive</b>: {3} <b>Invalid</b>: {4} <b>Ignored</b>: {5} <b>Skipped</b>: {6} <b>Time</b>: {7}"),
+ resultSummary.Passed, resultSummary.Failures, resultSummary.Errors, resultSummary.Inconclusive, resultSummary.NotRunnable, resultSummary.Ignored, resultSummary.Skipped, resultSummary.Time);
+ }
+ void UpdateCounters ()
+ {
+ infoLabel.Markup = GetResultsMarkup ();
+ }
+
+ public void InitializeTestRun (UnitTest test, CancellationTokenSource cs)
+ {
+ rootTest = test;
+ cancellationSource = cs;
+ cs.Token.Register (OnCancel);
+ results.Clear ();
+
+ testsToRun = test.CountTestCases ();
+ error = null;
+ errorMessage = null;
+
+ progressBar.Fraction = 0;
+ progressBar.Text = "";
+ progressBar.Text = "0 / " + testsToRun;
+ testsRun = 0;
+ resultSummary = new UnitTestResult ();
+ UpdateCounters ();
+
+ infoSep.Show ();
+ infoCurrent.Show ();
+ progressBar.Show ();
+ resultLabel.Hide ();
+ labels.Show ();
+ buttonStop.Sensitive = true;
+ buttonRun.Sensitive = false;
+
+ if (failuresTreeView.IsRealized)
+ failuresTreeView.ScrollToPoint (0, 0);
+
+ failuresStore.Clear ();
+ outputView.Buffer.Clear ();
+ outIters.Clear ();
+ cancel = false;
+ Running = true;
+
+ configuration = IdeApp.Workspace.ActiveConfigurationId;
+
+ AddStartMessage ();
+ }
+
+ public void AddStartMessage (bool isRunning = true)
+ {
+ if (rootTest != null) {
+ var infoIcon = ImageService.GetIcon (MonoDevelop.Ide.Gui.Stock.Information, Gtk.IconSize.Menu);
+ string msg = string.Format (isRunning ? GettextCatalog.GetString ("Running tests for <b>{0}</b> configuration <b>{1}</b>") : GettextCatalog.GetString ("Test results for <b>{0}</b> configuration <b>{1}</b>"), rootTest.Name, configuration);
+ startMessageIter = failuresStore.AppendValues (infoIcon, msg, rootTest, null, 0);
+ } else {
+ startMessageIter = Gtk.TreeIter.Zero;
+ }
+ }
+
+ public void ReportRuntimeError (string message, Exception exception)
+ {
+ error = exception;
+ errorMessage = message;
+ AddErrorMessage ();
+ }
+ const int ErrorMessage = 1;
+ const int StackTrace = 2;
+
+ public void AddErrorMessage ()
+ {
+ string msg;
+ if (error is RemoteUnhandledException)
+ msg = Escape (errorMessage);
+ else {
+ msg = GettextCatalog.GetString ("Internal error");
+ if (errorMessage != null)
+ msg += ": " + Escape (errorMessage);
+ }
+
+ var stock = ImageService.GetIcon (Ide.Gui.Stock.Error, Gtk.IconSize.Menu);
+ TreeIter testRow = failuresStore.AppendValues (stock, msg, null, null, 0);
+ string name = error is RemoteUnhandledException ? ((RemoteUnhandledException)error).RemoteExceptionName : error.GetType ().Name;
+ failuresStore.AppendValues (testRow, null, Escape (name + ": " + error.Message), null);
+ TreeIter row = failuresStore.AppendValues (testRow, null, GettextCatalog.GetString ("Stack Trace"), null, null, 0);
+ AddStackTrace (row, error.StackTrace, null);
+ }
+
+ readonly static Regex stackTraceLineRegex = new Regex (@".*\s(?<file>.*)\:\D*\s?(?<line>\d+)", RegexOptions.Compiled);
+
+ public static bool TryParseLocationFromStackTrace (string stackTraceLine, out string fileName, out int lineNumber)
+ {
+ var match = stackTraceLineRegex.Match (stackTraceLine);
+
+ if (!match.Success) {
+ fileName = null;
+ lineNumber = -1;
+ return false;
+ }
+ try {
+ fileName = match.Groups ["file"].Value;
+ lineNumber = int.Parse (match.Groups ["line"].Value);
+ } catch (Exception) {
+ fileName = null;
+ lineNumber = -1;
+ return false;
+ }
+ return true;
+ }
+
+ void AddStackTrace (TreeIter row, string stackTrace, UnitTest test)
+ {
+ string[] stackLines = stackTrace.Replace ("\r", "").Split ('\n');
+ foreach (string line in stackLines) {
+ string fileName;
+ int lineNumber;
+ TryParseLocationFromStackTrace (line, out fileName, out lineNumber);
+ failuresStore.AppendValues (row, null, Escape (line), test, fileName, lineNumber, StackTrace);
+ }
+ }
+
+ public void FinishTestRun ()
+ {
+ if (!Gtk.TreeIter.Zero.Equals (startMessageIter)) {
+ string msg = string.Format (GettextCatalog.GetString ("Test results for <b>{0}</b> configuration <b>{1}</b>"), rootTest != null ? rootTest.Name : "null", configuration);
+ failuresStore.SetValue (startMessageIter, 1, msg);
+ startMessageIter = Gtk.TreeIter.Zero;
+ }
+ infoCurrent.Text = "";
+ progressBar.Fraction = 1;
+ progressBar.Text = "";
+
+ infoSep.Hide ();
+ infoCurrent.Hide ();
+ progressBar.Hide ();
+ resultLabel.Show ();
+ labels.Hide ();
+ buttonStop.Sensitive = false;
+ buttonRun.Sensitive = true;
+
+ resultLabel.Markup = GetResultsMarkup ();
+
+ Running = false;
+ }
+
+ void OnStopClicked (object sender, EventArgs args)
+ {
+ if (running)
+ Cancel ();
+ }
+
+ void OnRunClicked (object sender, EventArgs args)
+ {
+ if (rootTest == null)
+ return;
+ UnitTestService.RunTest (rootTest, null);
+ }
+
+ void OnRowActivated (object s, EventArgs a)
+ {
+ Gtk.TreeIter iter;
+ if (failuresTreeView.Selection.GetSelected (out iter)) {
+ string file = (string)failuresStore.GetValue (iter, 3);
+ int line = (int)failuresStore.GetValue (iter, 4);
+ try {
+ if (file != null && File.Exists (file)) {
+ IdeApp.Workbench.OpenDocument (file, line, -1);
+ return;
+ }
+ } catch (Exception) {
+ }
+ }
+ OnShowTest ();
+ }
+
+ void OnRowSelected (object s, EventArgs a)
+ {
+ UnitTest test = GetSelectedTest ();
+ if (test != null) {
+ int offset;
+ if (outIters.TryGetValue (test, out offset)) {
+ TextIter it = outputView.Buffer.GetIterAtOffset (offset);
+ outputView.Buffer.MoveMark (outputView.Buffer.InsertMark, it);
+ outputView.Buffer.MoveMark (outputView.Buffer.SelectionBound, it);
+ outputView.ScrollToMark (outputView.Buffer.InsertMark, 0.0, true, 0.0, 0.0);
+ }
+ }
+ }
+
+ [CommandHandler (EditCommands.Copy)]
+ protected void OnCopy ()
+ {
+ UnitTest test = GetSelectedTest ();
+ if (test != null) {
+ var last = test.GetLastResult ();
+ if (last == null)
+ return;
+
+ Gtk.TreeModel foo;
+ Gtk.TreeIter iter;
+ if (!failuresTreeView.Selection.GetSelected (out foo, out iter))
+ return;
+
+ int type = (int)failuresStore.GetValue (iter, 5);
+
+ var clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
+ switch (type) {
+ case ErrorMessage:
+ clipboard.Text = last.Message;
+ break;
+ case StackTrace:
+ clipboard.Text = last.StackTrace;
+ break;
+ default:
+ clipboard.Text = last.Message + Environment.NewLine + "Stack trace:" + Environment.NewLine + last.StackTrace;
+ break;
+ }
+ } else {
+ if (error == null)
+ return;
+ var clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
+
+ Gtk.TreeModel foo;
+ Gtk.TreeIter iter;
+ if (!failuresTreeView.Selection.GetSelected (out foo, out iter))
+ return;
+
+ int type = (int)failuresStore.GetValue (iter, 5);
+
+ switch (type) {
+ case ErrorMessage:
+ clipboard.Text = error.Message;
+ break;
+ case StackTrace:
+ clipboard.Text = error.StackTrace;
+ break;
+ default:
+ clipboard.Text = error.Message + Environment.NewLine + "Stack trace:" + Environment.NewLine + error.StackTrace;
+ break;
+ }
+ }
+ }
+
+ [CommandUpdateHandler (EditCommands.Copy)]
+ protected void OnUpdateCopy (CommandInfo info)
+ {
+ UnitTest test = GetSelectedTest ();
+ if (test != null) {
+ var last = test.GetLastResult ();
+
+ Gtk.TreeModel foo;
+ Gtk.TreeIter iter;
+ if (!failuresTreeView.Selection.GetSelected (out foo, out iter)) {
+ info.Enabled = false;
+ return;
+ }
+
+ int type = (int)failuresStore.GetValue (iter, 5);
+ switch (type) {
+ case ErrorMessage:
+ info.Enabled = !string.IsNullOrEmpty (last.Message);
+ return;
+ case StackTrace:
+ default:
+ info.Enabled = !string.IsNullOrEmpty (last.StackTrace);
+ return;
+ }
+ }
+ info.Enabled = error != null;
+ }
+
+ [CommandHandler (TestCommands.SelectTestInTree)]
+ protected void OnSelectTestInTree ()
+ {
+ Pad pad = IdeApp.Workbench.GetPad<TestPad> ();
+ pad.BringToFront ();
+ TestPad content = (TestPad)pad.Content;
+ content.SelectTest (GetSelectedTest ());
+ }
+
+ [CommandUpdateHandler (TestCommands.SelectTestInTree)]
+ protected void OnUpdateSelectTestInTree (CommandInfo info)
+ {
+ UnitTest test = GetSelectedTest ();
+ info.Enabled = test != null;
+ }
+
+ [CommandHandler (TestCommands.GoToFailure)]
+ protected void OnShowTest ()
+ {
+ UnitTest test = GetSelectedTest ();
+ if (test == null)
+ return;
+ SourceCodeLocation loc = null;
+ UnitTestResult res = test.GetLastResult ();
+ if (res != null && res.IsFailure)
+ loc = res.GetFailureLocation ();
+ if (loc == null)
+ loc = test.SourceCodeLocation;
+ if (loc != null) {
+ IdeApp.Workbench.OpenDocument (loc.FileName, loc.Line, loc.Column);
+ } else {
+ LoggingService.LogError ("Can't get source code location for test : "+ test);
+ MessageService.ShowError (GettextCatalog.GetString ("Can't get source code location for :" + test.Name));
+ }
+ }
+
+ [CommandHandler (TestCommands.ShowTestCode)]
+ protected void OnShowTestCode ()
+ {
+ UnitTest test = GetSelectedTest ();
+ if (test == null)
+ return;
+ SourceCodeLocation loc = test.SourceCodeLocation;
+ if (loc != null) {
+ IdeApp.Workbench.OpenDocument (loc.FileName, loc.Line, loc.Column);
+ } else {
+ LoggingService.LogError ("Can't get source code location for test : "+ test);
+ MessageService.ShowError (GettextCatalog.GetString ("Can't get source code location for :" + test.Name));
+ }
+ }
+
+ [CommandHandler (TestCommands.RerunTest)]
+ protected void OnRerunTest ()
+ {
+ UnitTest test = GetSelectedTest ();
+ if (test == null)
+ return;
+ UnitTestService.RunTest (test, null);
+ }
+
+ UnitTest GetSelectedTest ()
+ {
+ Gtk.TreeModel foo;
+ Gtk.TreeIter iter;
+ if (!failuresTreeView.Selection.GetSelected (out foo, out iter))
+ return null;
+
+ UnitTest t = (UnitTest)failuresStore.GetValue (iter, 2);
+ return t;
+ }
+
+ void OnShowSuccessfulToggled (object sender, EventArgs args)
+ {
+ RefreshList ();
+ }
+
+ void OnShowFailuresToggled (object sender, EventArgs args)
+ {
+ RefreshList ();
+ }
+
+ void OnShowInconclusiveToggled (object sender, EventArgs args)
+ {
+ RefreshList ();
+ }
+
+ void OnShowIgnoredToggled (object sender, EventArgs args)
+ {
+ RefreshList ();
+ }
+
+ void OnShowOutputToggled (object sender, EventArgs args)
+ {
+ outputViewScrolled.Visible = buttonOutput.Active;
+ }
+
+ void RefreshList ()
+ {
+ if (failuresTreeView.IsRealized)
+ failuresTreeView.ScrollToPoint (0, 0);
+
+ failuresStore.Clear ();
+ outputView.Buffer.Clear ();
+ outIters.Clear ();
+ AddStartMessage (running);
+
+ foreach (ResultRecord res in results) {
+ ShowTestResult (res.Test, res.Result);
+ }
+
+ if (error != null)
+ AddErrorMessage ();
+ }
+
+ void ShowTestResult (UnitTest test, UnitTestResult result)
+ {
+ if (result.IsSuccess) {
+ if (!buttonSuccess.Active)
+ return;
+ TreeIter testRow = failuresStore.AppendValues (TestStatusIcon.Success, Escape (test.FullName), test);
+ failuresTreeView.ScrollToCell (failuresStore.GetPath (testRow), null, false, 0, 0);
+ }
+ if (result.IsFailure) {
+ if (!buttonFailures.Active)
+ return;
+ string file = test.SourceCodeLocation != null ? test.SourceCodeLocation.FileName + ":" + test.SourceCodeLocation.Line : null;
+ TreeIter testRow = failuresStore.AppendValues (TestStatusIcon.Failure, Escape (test.FullName), test, file);
+ bool hasMessage = !string.IsNullOrEmpty (result.Message);
+
+ if (hasMessage)
+ failuresStore.AppendValues (testRow, null, "<span font='" + FontService.MonospaceFontName + "'>"+Escape (result.Message) + "</span>", test, null, 0, ErrorMessage);
+ if (!string.IsNullOrEmpty (result.StackTrace)) {
+ TreeIter row = testRow;
+ if (hasMessage)
+ row = failuresStore.AppendValues (testRow, null, GettextCatalog.GetString ("Stack Trace"), test, null, 0, StackTrace);
+ AddStackTrace (row, result.StackTrace, test);
+ }
+ failuresTreeView.ScrollToCell (failuresStore.GetPath (testRow), null, false, 0, 0);
+ }
+ if (result.IsNotRun) {
+ if (!buttonIgnored.Active)
+ return;
+ TreeIter testRow = failuresStore.AppendValues (TestStatusIcon.NotRun, Escape (test.FullName), test);
+ if (result.Message != null)
+ failuresStore.AppendValues (testRow, null, Escape (result.Message), test);
+ failuresTreeView.ScrollToCell (failuresStore.GetPath (testRow), null, false, 0, 0);
+ }
+ if (result.IsInconclusive) {
+ if (!buttonInconclusive.Active)
+ return;
+ TreeIter testRow = failuresStore.AppendValues (TestStatusIcon.Inconclusive, Escape (test.FullName), test);
+ if (result.Message != null)
+ failuresStore.AppendValues (testRow, null, Escape (result.Message), test);
+ failuresTreeView.ScrollToCell (failuresStore.GetPath (testRow), null, false, 0, 0);
+ }
+
+ string msg = GettextCatalog.GetString ("Running {0} ...", test.FullName);
+ TextIter it = outputView.Buffer.EndIter;
+ outIters [test] = it.Offset;
+ outputView.Buffer.InsertWithTags (ref it, msg, bold);
+ outputView.Buffer.Insert (ref it, "\n");
+ if (result.ConsoleOutput != null)
+ outputView.Buffer.Insert (ref it, result.ConsoleOutput);
+ if (result.ConsoleError != null)
+ outputView.Buffer.Insert (ref it, result.ConsoleError);
+ outputView.ScrollMarkOnscreen (outputView.Buffer.InsertMark);
+ }
+
+ void ITestProgressMonitor.WriteGlobalLog (string message)
+ {
+ TextIter it = outputView.Buffer.EndIter;
+ outputView.Buffer.Insert (ref it, message);
+ outputView.ScrollMarkOnscreen (outputView.Buffer.InsertMark);
+ }
+
+ string Escape (string s)
+ {
+ return GLib.Markup.EscapeText (s);
+ }
+
+ void ITestProgressMonitor.EndTest (UnitTest test, UnitTestResult result)
+ {
+ if (test is UnitTestGroup)
+ return;
+
+ testsRun++;
+ ResultRecord rec = new ResultRecord ();
+ rec.Test = test;
+ rec.Result = result;
+
+ resultSummary.Add (result);
+ results.Add (rec);
+
+ ShowTestResult (test, result);
+
+ UpdateCounters ();
+
+ double frac;
+ if (testsToRun != 0)
+ frac = ((double)testsRun / (double)testsToRun);
+ else
+ frac = 1;
+
+ frac = Math.Min (1, Math.Max (0, frac));
+
+ progressBar.Fraction = frac;
+ progressBar.Text = testsRun + " / " + testsToRun;
+ }
+
+ void ITestProgressMonitor.BeginTest (UnitTest test)
+ {
+ infoCurrent.Text = GettextCatalog.GetString ("Running ") + test.FullName;
+ infoCurrent.Xalign = 0;
+ }
+
+ public void Cancel ()
+ {
+ if (cancel)
+ return;
+ cancel = true;
+ cancellationSource.Cancel ();
+ }
+
+ void OnCancel ()
+ {
+ Gtk.Application.Invoke (delegate {
+ failuresStore.AppendValues (TestStatusIcon.Failure, GettextCatalog.GetString ("Test execution cancelled."), null);
+ });
+ }
+
+ CancellationToken ITestProgressMonitor.CancellationToken {
+ get { return cancellationSource.Token; }
+ }
+ }
+
+ class TestMonitor: ITestProgressMonitor
+ {
+ ITestProgressMonitor monitor;
+ TestResultsPad pad;
+
+ public TestMonitor (TestResultsPad pad, CancellationTokenSource cs)
+ {
+ this.pad = pad;
+ this.monitor = pad;
+ }
+ public void FinishTestRun ()
+ {
+ Runtime.RunInMainThread (delegate {
+ pad.FinishTestRun ();
+ });
+ }
+ public void BeginTest (UnitTest test)
+ {
+ Runtime.RunInMainThread (delegate {
+ monitor.BeginTest (test);
+ });
+ }
+ public void EndTest (UnitTest test, UnitTestResult result)
+ {
+ Runtime.RunInMainThread (delegate {
+ monitor.EndTest (test, result);
+ });
+ }
+ public void ReportRuntimeError (string message, Exception exception)
+ {
+ Runtime.RunInMainThread (delegate {
+ monitor.ReportRuntimeError (message, exception);
+ });
+ }
+ public void WriteGlobalLog (string message)
+ {
+ Runtime.RunInMainThread (delegate {
+ monitor.WriteGlobalLog (message);
+ });
+ }
+
+ public CancellationToken CancellationToken {
+ get { return monitor.CancellationToken; }
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/TestStatusIcon.cs b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestStatusIcon.cs
new file mode 100644
index 0000000000..05d428b698
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/TestStatusIcon.cs
@@ -0,0 +1,74 @@
+//
+// CircleImage.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Gdk;
+using MonoDevelop.Core;
+using MonoDevelop.Ide;
+
+namespace MonoDevelop.UnitTesting
+{
+ static class TestStatusIcon
+ {
+ public static readonly Xwt.Drawing.Image Running;
+ public static readonly Xwt.Drawing.Image None;
+ public static readonly Xwt.Drawing.Image NotRun;
+ public static readonly Xwt.Drawing.Image Loading;
+
+ public static readonly Xwt.Drawing.Image Failure;
+ public static readonly Xwt.Drawing.Image Success;
+ public static readonly Xwt.Drawing.Image SuccessAndFailure;
+ public static readonly Xwt.Drawing.Image Inconclusive;
+
+ public static readonly Xwt.Drawing.Image OldFailure;
+ public static readonly Xwt.Drawing.Image OldSuccess;
+ public static readonly Xwt.Drawing.Image OldSuccessAndFailure;
+ public static readonly Xwt.Drawing.Image OldInconclusive;
+
+ static TestStatusIcon ()
+ {
+ try {
+ Running = Xwt.Drawing.Image.FromResource ("unit-running-16.png");
+ Failure = Xwt.Drawing.Image.FromResource ("unit-failed-16.png");
+ None = Xwt.Drawing.Image.FromResource ("unit-not-yet-run-16.png");
+ NotRun = Xwt.Drawing.Image.FromResource ("unit-skipped-16.png");
+ Success = Xwt.Drawing.Image.FromResource ("unit-success-16.png");
+ SuccessAndFailure = Xwt.Drawing.Image.FromResource ("unit-mixed-results-16.png");
+ Loading = Xwt.Drawing.Image.FromResource ("unit-loading-16.png");
+ Inconclusive = Xwt.Drawing.Image.FromResource ("unit-inconclusive-16.png");
+ OldFailure = Failure.WithAlpha (0.4);
+ OldSuccess = Success.WithAlpha (0.4);
+ OldSuccessAndFailure = SuccessAndFailure.WithAlpha (0.4);
+ OldInconclusive = Inconclusive.WithAlpha (0.4);
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while loading icons.", e);
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16.png
new file mode 100644
index 0000000000..08156925bf
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16@2x.png
new file mode 100644
index 0000000000..a626c128b9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~dark.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~dark.png
new file mode 100644
index 0000000000..c73c3e92fd
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~dark@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~dark@2x.png
new file mode 100644
index 0000000000..392713f95a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~dark~sel.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~dark~sel.png
new file mode 100644
index 0000000000..390f9d1e34
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~dark~sel@2x.png
new file mode 100644
index 0000000000..0724d75161
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~sel.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~sel.png
new file mode 100644
index 0000000000..390f9d1e34
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~sel@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~sel@2x.png
new file mode 100644
index 0000000000..0724d75161
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/pad-unit-test-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32.png
new file mode 100644
index 0000000000..94cd21390d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32@2x.png
new file mode 100644
index 0000000000..05e84865e9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~dark.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~dark.png
new file mode 100644
index 0000000000..b67ac9d2e7
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~dark@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~dark@2x.png
new file mode 100644
index 0000000000..0a0c74b70b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~dark~sel.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~dark~sel.png
new file mode 100644
index 0000000000..5de67db489
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~dark~sel@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~dark~sel@2x.png
new file mode 100644
index 0000000000..e5dde885d9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~sel.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~sel.png
new file mode 100644
index 0000000000..5de67db489
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~sel@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~sel@2x.png
new file mode 100644
index 0000000000..e5dde885d9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/project-nunit-overlay-32~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-failed-16.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-failed-16.png
new file mode 100644
index 0000000000..0b434fcc3a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-failed-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-failed-16@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-failed-16@2x.png
new file mode 100644
index 0000000000..652cf7c6dd
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-failed-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-failed-16~dark.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-failed-16~dark.png
new file mode 100644
index 0000000000..bfe3e1c59a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-failed-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-failed-16~dark@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-failed-16~dark@2x.png
new file mode 100644
index 0000000000..8c66142ce0
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-failed-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-inconclusive-16.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-inconclusive-16.png
new file mode 100644
index 0000000000..e1767bea57
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-inconclusive-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-inconclusive-16@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-inconclusive-16@2x.png
new file mode 100644
index 0000000000..7bfee6e8ef
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-inconclusive-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-inconclusive-16~dark.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-inconclusive-16~dark.png
new file mode 100644
index 0000000000..683d1ae1d7
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-inconclusive-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-inconclusive-16~dark@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-inconclusive-16~dark@2x.png
new file mode 100644
index 0000000000..2dac729015
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-inconclusive-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-loading-16.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-loading-16.png
new file mode 100644
index 0000000000..80adae4315
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-loading-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-loading-16@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-loading-16@2x.png
new file mode 100644
index 0000000000..de27f28d8a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-loading-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-loading-16~dark.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-loading-16~dark.png
new file mode 100644
index 0000000000..7506a641b1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-loading-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-loading-16~dark@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-loading-16~dark@2x.png
new file mode 100644
index 0000000000..d4fb6f3aae
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-loading-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-mixed-results-16.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-mixed-results-16.png
new file mode 100644
index 0000000000..5d5d0b99f4
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-mixed-results-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-mixed-results-16@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-mixed-results-16@2x.png
new file mode 100644
index 0000000000..1a3a7be90e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-mixed-results-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-mixed-results-16~dark.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-mixed-results-16~dark.png
new file mode 100644
index 0000000000..ea24dc5244
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-mixed-results-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-mixed-results-16~dark@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-mixed-results-16~dark@2x.png
new file mode 100644
index 0000000000..19908b7a58
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-mixed-results-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-not-yet-run-16.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-not-yet-run-16.png
new file mode 100644
index 0000000000..0918265bd5
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-not-yet-run-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-not-yet-run-16@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-not-yet-run-16@2x.png
new file mode 100644
index 0000000000..f690bc4ca6
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-not-yet-run-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-not-yet-run-16~dark.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-not-yet-run-16~dark.png
new file mode 100644
index 0000000000..9567eba24d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-not-yet-run-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-not-yet-run-16~dark@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-not-yet-run-16~dark@2x.png
new file mode 100644
index 0000000000..7a72559000
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-not-yet-run-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-running-16.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-running-16.png
new file mode 100644
index 0000000000..3f26d8a8de
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-running-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-running-16@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-running-16@2x.png
new file mode 100644
index 0000000000..483d39776f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-running-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-running-16~dark.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-running-16~dark.png
new file mode 100644
index 0000000000..4cf4973b3c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-running-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-running-16~dark@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-running-16~dark@2x.png
new file mode 100644
index 0000000000..507066be18
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-running-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-skipped-16.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-skipped-16.png
new file mode 100644
index 0000000000..486f84499f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-skipped-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-skipped-16@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-skipped-16@2x.png
new file mode 100644
index 0000000000..7769944638
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-skipped-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-skipped-16~dark.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-skipped-16~dark.png
new file mode 100644
index 0000000000..fad4fdf159
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-skipped-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-skipped-16~dark@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-skipped-16~dark@2x.png
new file mode 100644
index 0000000000..f0fcadf3fc
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-skipped-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-success-16.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-success-16.png
new file mode 100644
index 0000000000..67dec0fab1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-success-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-success-16@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-success-16@2x.png
new file mode 100644
index 0000000000..fc3ce92d32
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-success-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-success-16~dark.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-success-16~dark.png
new file mode 100644
index 0000000000..d8f17aaa61
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-success-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-success-16~dark@2x.png b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-success-16~dark@2x.png
new file mode 100644
index 0000000000..07673c4707
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Gui/icons/unit-success-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Makefile.am b/main/src/addins/MonoDevelop.UnitTesting/Makefile.am
new file mode 100644
index 0000000000..c9cc87438f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Makefile.am
@@ -0,0 +1 @@
+include $(top_srcdir)/xbuild.include
diff --git a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj
new file mode 100644
index 0000000000..d6236f6466
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.csproj
@@ -0,0 +1,289 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{A7A4246D-CEC4-42DF-A3C1-C31B9F51C4EC}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AssemblyName>MonoDevelop.UnitTesting</AssemblyName>
+ <RootNamespace>MonoDevelop.UnitTesting</RootNamespace>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>True</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>False</Optimize>
+ <OutputPath>..\..\..\build\AddIns\MonoDevelop.UnitTesting</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>3</WarningLevel>
+ <Execution>
+ <Execution clr-version="Net_2_0" />
+ </Execution>
+ <DefineConstants>DEBUG</DefineConstants>
+ <NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\build\AddIns\MonoDevelop.UnitTesting\MonoDevelop.NUnit.xml</DocumentationFile>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>True</Optimize>
+ <OutputPath>..\..\..\build\AddIns\MonoDevelop.UnitTesting</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>3</WarningLevel>
+ <Execution>
+ <Execution clr-version="Net_2_0" />
+ </Execution>
+ <DebugSymbols>true</DebugSymbols>
+ <NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\build\AddIns\MonoDevelop.UnitTesting\MonoDevelop.NUnit.xml</DocumentationFile>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Xml" />
+ <Reference Include="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
+ <SpecificVersion>False</SpecificVersion>
+ </Reference>
+ <Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
+ <SpecificVersion>False</SpecificVersion>
+ </Reference>
+ <Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
+ <SpecificVersion>False</SpecificVersion>
+ </Reference>
+ <Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
+ <SpecificVersion>False</SpecificVersion>
+ </Reference>
+ <Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
+ <SpecificVersion>False</SpecificVersion>
+ </Reference>
+ <Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
+ <SpecificVersion>False</SpecificVersion>
+ </Reference>
+ <Reference Include="Mono.Posix" />
+ <Reference Include="Mono.Cairo" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Reflection.Metadata">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Reflection.Metadata.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Collections.Immutable">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Collections.Immutable.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
+ <Project>{7525BB88-6142-4A26-93B9-A30C6983390A}</Project>
+ <Name>MonoDevelop.Core</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\..\core\MonoDevelop.Ide\MonoDevelop.Ide.csproj">
+ <Project>{27096E7F-C91C-4AC6-B289-6897A701DF21}</Project>
+ <Name>MonoDevelop.Ide</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\external\mono-addins\Mono.Addins\Mono.Addins.csproj">
+ <Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
+ <Name>Mono.Addins</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\external\xwt\Xwt\Xwt.csproj">
+ <Project>{92494904-35FA-4DC9-BDE9-3A3E87AC49D3}</Project>
+ <Name>Xwt</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
+ <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
+ <Name>ICSharpCode.NRefactory</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Gui\icons\unit-running-16.png">
+ <LogicalName>unit-running-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-running-16%402x.png">
+ <LogicalName>unit-running-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-running-16~dark.png">
+ <LogicalName>unit-running-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-running-16~dark%402x.png">
+ <LogicalName>unit-running-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-failed-16.png">
+ <LogicalName>unit-failed-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-failed-16%402x.png">
+ <LogicalName>unit-failed-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-failed-16~dark.png">
+ <LogicalName>unit-failed-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-failed-16~dark%402x.png">
+ <LogicalName>unit-failed-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-mixed-results-16.png">
+ <LogicalName>unit-mixed-results-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-mixed-results-16%402x.png">
+ <LogicalName>unit-mixed-results-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-mixed-results-16~dark.png">
+ <LogicalName>unit-mixed-results-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-mixed-results-16~dark%402x.png">
+ <LogicalName>unit-mixed-results-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-not-yet-run-16.png">
+ <LogicalName>unit-not-yet-run-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-not-yet-run-16%402x.png">
+ <LogicalName>unit-not-yet-run-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-not-yet-run-16~dark.png">
+ <LogicalName>unit-not-yet-run-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-not-yet-run-16~dark%402x.png">
+ <LogicalName>unit-not-yet-run-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-skipped-16.png">
+ <LogicalName>unit-skipped-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-skipped-16%402x.png">
+ <LogicalName>unit-skipped-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-skipped-16~dark.png">
+ <LogicalName>unit-skipped-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-skipped-16~dark%402x.png">
+ <LogicalName>unit-skipped-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-loading-16.png">
+ <LogicalName>unit-loading-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-loading-16%402x.png">
+ <LogicalName>unit-loading-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-loading-16~dark.png">
+ <LogicalName>unit-loading-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-loading-16~dark%402x.png">
+ <LogicalName>unit-loading-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-success-16.png">
+ <LogicalName>unit-success-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-success-16%402x.png">
+ <LogicalName>unit-success-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelopNUnit.addin.xml">
+ <LogicalName>MonoDevelopNUnit.addin.xml</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\project-nunit-overlay-32.png">
+ <LogicalName>project-nunit-overlay-32.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\project-nunit-overlay-32%402x.png">
+ <LogicalName>project-nunit-overlay-32@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\project-nunit-overlay-32~dark.png">
+ <LogicalName>project-nunit-overlay-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\project-nunit-overlay-32~dark%402x.png">
+ <LogicalName>project-nunit-overlay-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\project-nunit-overlay-32~sel.png">
+ <LogicalName>project-nunit-overlay-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\project-nunit-overlay-32~sel%402x.png">
+ <LogicalName>project-nunit-overlay-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\project-nunit-overlay-32~dark~sel.png">
+ <LogicalName>project-nunit-overlay-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\project-nunit-overlay-32~dark~sel%402x.png">
+ <LogicalName>project-nunit-overlay-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="gtk-gui\gui.stetic">
+ <LogicalName>gui.stetic</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\pad-unit-test-16.png">
+ <LogicalName>pad-unit-test-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\pad-unit-test-16%402x.png">
+ <LogicalName>pad-unit-test-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\pad-unit-test-16~dark.png">
+ <LogicalName>pad-unit-test-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\pad-unit-test-16~dark%402x.png">
+ <LogicalName>pad-unit-test-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\pad-unit-test-16~sel.png">
+ <LogicalName>pad-unit-test-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\pad-unit-test-16~sel%402x.png">
+ <LogicalName>pad-unit-test-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\pad-unit-test-16~dark~sel.png">
+ <LogicalName>pad-unit-test-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\pad-unit-test-16~dark~sel%402x.png">
+ <LogicalName>pad-unit-test-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-inconclusive-16.png">
+ <LogicalName>unit-inconclusive-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-inconclusive-16%402x.png">
+ <LogicalName>unit-inconclusive-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-inconclusive-16~dark.png">
+ <LogicalName>unit-inconclusive-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Gui\icons\unit-inconclusive-16~dark%402x.png">
+ <LogicalName>unit-inconclusive-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AssemblyInfo.cs" />
+ <Compile Include="Commands\NUnitCommands.cs" />
+ <Compile Include="Gui\TestPad.cs" />
+ <Compile Include="Gui\TestResultsPad.cs" />
+ <Compile Include="Gui\TestNodeBuilder.cs" />
+ <Compile Include="Gui\TestChart.cs" />
+ <Compile Include="Services\SolutionFolderTestGroup.cs" />
+ <Compile Include="Services\ITestProvider.cs" />
+ <Compile Include="Services\UnitTestService.cs" />
+ <Compile Include="Services\SystemTestProvider.cs" />
+ <Compile Include="Services\ITestProgressMonitor.cs" />
+ <Compile Include="Services\TestContext.cs" />
+ <Compile Include="Services\UnitTestCollection.cs" />
+ <Compile Include="Services\UnitTest.cs" />
+ <Compile Include="Services\UnitTestGroup.cs" />
+ <Compile Include="Services\GeneralTestOptions.cs" />
+ <Compile Include="Services\IResultsStore.cs" />
+ <Compile Include="Services\UnitTestResultsStore.cs" />
+ <Compile Include="Services\WorkspaceTestGroup.cs" />
+ <Compile Include="gtk-gui\generated.cs" />
+ <Compile Include="Services\UnitTestResult.cs" />
+ <Compile Include="Services\UnitTestStatus.cs" />
+ <Compile Include="Services\UnitTestProjectServiceExtension.cs" />
+ <Compile Include="Gui\TestStatusIcon.cs" />
+ <Compile Include="AddinInfo.cs" />
+ <Compile Include="Services\AbstractResultsStore.cs" />
+ <Compile Include="Services\BinaryResultsStore.cs" />
+ <Compile Include="Services\NUnitSourceCodeLocationFinder.cs" />
+ <Compile Include="Services\RemoteUnhandledException.cs" />
+ <Compile Include="Services\AbstractUnitTestEditorExtension.cs" />
+ <Compile Include="Services\UnitTestMarkersExtension.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="Makefile.am" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+</Project>
diff --git a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelopNUnit.addin.xml b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelopNUnit.addin.xml
new file mode 100644
index 0000000000..2e4df980c8
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelopNUnit.addin.xml
@@ -0,0 +1,129 @@
+<ExtensionModel>
+
+ <!-- Extension Points -->
+
+ <ExtensionPoint path = "/MonoDevelop/UnitTesting/TestProviders" name = "Test providers">
+ <Description>Test providers. Specified classes must implement ITestProvider.</Description>
+ <ExtensionNode name ="Class" />
+ </ExtensionPoint>
+
+ <ExtensionPoint path = "/MonoDevelop/UnitTesting/ContextMenu/TestChart">
+ <ExtensionNodeSet id="MonoDevelop.Components.Commands.ItemSet"/>
+ </ExtensionPoint>
+
+ <ExtensionPoint path = "/MonoDevelop/UnitTesting/ContextMenu/TestPad">
+ <ExtensionNodeSet id="MonoDevelop.Components.Commands.ItemSet"/>
+ </ExtensionPoint>
+
+ <ExtensionPoint path = "/MonoDevelop/UnitTesting/ContextMenu/TestResultsPad">
+ <ExtensionNodeSet id="MonoDevelop.Components.Commands.ItemSet"/>
+ </ExtensionPoint>
+
+ <ExtensionPoint path = "/MonoDevelop/UnitTesting/NUnitSourceCodeLocationFinder">
+ <ExtensionNode name="Class"/>
+ </ExtensionPoint>
+
+ <ExtensionPoint path = "/MonoDevelop/UnitTesting/UnitTestMarkers" name = "Unit Test Markers">
+ <Description>Unit test markers are used to identify test methods in soure code.</Description>
+ <ExtensionNode name ="TestMarkers" type="MonoDevelop.UnitTesting.UnitTestMarkersExtension"/>
+ </ExtensionPoint>
+
+ <!-- Extensions -->
+
+ <Extension path = "/MonoDevelop/Ide/Pads">
+ <SolutionPad id = "MonoDevelop.UnitTesting.TestPad" defaultLayout="*" defaultPlacement = "Right" defaultStatus="AutoHide" _label = "Unit Tests" icon = "nunit-pad-icon" class = "MonoDevelop.UnitTesting.TestPad">
+ <PadOption id = "ShowTestTime" _label = "Show Test Time" defaultValue = "False" />
+ <PadOption id = "ShowTestCounters" _label = "Show Test Counters" defaultValue = "False" />
+ <NodeBuilder id = "TestNode" class = "MonoDevelop.UnitTesting.TestNodeBuilder"/>
+ </SolutionPad>
+ <Pad id="MonoDevelop.UnitTesting.TestResultsPad" _label="Test Results" icon="nunit-pad-icon" class="MonoDevelop.UnitTesting.TestResultsPad" defaultPlacement = "Bottom" defaultLayout="UnitTesting" defaultStatus="AutoHide"/>
+ </Extension>
+
+ <Extension path="/MonoDevelop/Ide/WorkbenchLayouts">
+ <Layout id="UnitTesting" _name="Unit Testing">
+ <LayoutPad id="MonoDevelop.UnitTesting.TestPad" status="Dockable" />
+ <LayoutPad id="MonoDevelop.UnitTesting.TestResultsPad" status="Dockable" />
+ </Layout>
+ </Extension>
+
+ <Extension path = "/MonoDevelop/Ide/Commands">
+ <Category _name = "Unit Testing" id = "UnitTesting">
+ <Command id = "MonoDevelop.UnitTesting.Commands.TestCommands.RunAllTests"
+ _label = "Run Unit Tests"
+ icon = "md-run-unit-tests"
+ _description="Runs all tests of the current selected project."
+ shortcut="Control|T"
+ defaultHandler="MonoDevelop.UnitTesting.Commands.RunAllTestsHandler"/>
+ <Command id = "MonoDevelop.UnitTesting.Commands.TestCommands.RunTestWith"
+ _label = "Run With"
+ type="array"
+ _description="Runs tests using a special execution mode."/>
+ <Command id = "MonoDevelop.UnitTesting.Commands.TestCommands.DebugTest"
+ _label = "Debug Test"
+ type="array" />
+ <Command id = "MonoDevelop.UnitTesting.Commands.TestCommands.RunTest" _label = "Run Test" />
+ <Command id = "MonoDevelop.UnitTesting.Commands.TestCommands.ShowTestCode" _label = "Show test source code" />
+ <Command id = "MonoDevelop.UnitTesting.Commands.TestCommands.GoToFailure" _label = "Go to failure" />
+ <Command id = "MonoDevelop.UnitTesting.Commands.TestCommands.SelectTestInTree" _label = "Select test in tree" />
+ <Command id = "MonoDevelop.UnitTesting.Commands.TestCommands.ShowTestDetails" _label = "Show results pad" />
+ <Command id = "MonoDevelop.UnitTesting.Commands.TestCommands.RerunTest" _label = "Rerun test" />
+ <Command id = "MonoDevelop.UnitTesting.Commands.TestChartCommands.UseTimeScale" _label = "Proportional time scale" type="check"/>
+ <Command id = "MonoDevelop.UnitTesting.Commands.TestChartCommands.SingleDayResult" _label = "Show one result per day" type="check"/>
+ <Command id = "MonoDevelop.UnitTesting.Commands.TestChartCommands.ShowResults" _label = "Results chart" type="radio"/>
+ <Command id = "MonoDevelop.UnitTesting.Commands.TestChartCommands.ShowTime" _label = "Time chart" type="radio"/>
+ <Command id = "MonoDevelop.UnitTesting.Commands.TestChartCommands.ShowSuccessfulTests" _label = "Show successful tests" type="check"/>
+ <Command id = "MonoDevelop.UnitTesting.Commands.TestChartCommands.ShowFailedTests" _label = "Show failed tests" type="check"/>
+ <Command id = "MonoDevelop.UnitTesting.Commands.TestChartCommands.ShowIgnoredTests" _label = "Show ignored tests" type="check"/>
+ </Category>
+ </Extension>
+
+ <Extension path = "/MonoDevelop/Ide/MainMenu/Run">
+ <CommandItem id = "MonoDevelop.UnitTesting.Commands.TestCommands.RunAllTests" />
+ </Extension>
+
+ <Extension path = "/MonoDevelop/UnitTesting/ContextMenu/TestPad">
+ <CommandItem id = "MonoDevelop.UnitTesting.Commands.TestCommands.RunTest" />
+ <CommandItem id = "MonoDevelop.UnitTesting.Commands.TestCommands.DebugTest" />
+ <ItemSet id = "RunTestWith" _label = "Run Test With">
+ <CommandItem id = "MonoDevelop.UnitTesting.Commands.TestCommands.RunTestWith" />
+ </ItemSet>
+ <SeparatorItem id = "s0" />
+ <CommandItem id = "MonoDevelop.UnitTesting.Commands.TestCommands.GoToFailure" />
+ <CommandItem id = "MonoDevelop.UnitTesting.Commands.TestCommands.ShowTestCode" />
+ <CommandItem id = "MonoDevelop.UnitTesting.Commands.TestCommands.ShowTestDetails" />
+ </Extension>
+
+ <Extension path = "/MonoDevelop/UnitTesting/ContextMenu/TestResultsPad">
+ <CommandItem id = "MonoDevelop.UnitTesting.Commands.TestCommands.GoToFailure" />
+ <CommandItem id = "MonoDevelop.UnitTesting.Commands.TestCommands.ShowTestCode" />
+ <CommandItem id = "MonoDevelop.UnitTesting.Commands.TestCommands.SelectTestInTree" />
+ <CommandItem id = "MonoDevelop.UnitTesting.Commands.TestCommands.RerunTest" />
+ <SeparatorItem id = "s1" />
+ <CommandItem id = "MonoDevelop.Ide.Commands.EditCommands.Copy" />
+ </Extension>
+
+ <Extension path = "/MonoDevelop/UnitTesting/ContextMenu/TestChart">
+ <CommandItem id = "MonoDevelop.UnitTesting.Commands.TestChartCommands.ShowResults" />
+ <CommandItem id = "MonoDevelop.UnitTesting.Commands.TestChartCommands.ShowTime" />
+ <SeparatorItem id = "s1" />
+ <CommandItem id = "MonoDevelop.UnitTesting.Commands.TestChartCommands.ShowSuccessfulTests" />
+ <CommandItem id = "MonoDevelop.UnitTesting.Commands.TestChartCommands.ShowFailedTests" />
+ <CommandItem id = "MonoDevelop.UnitTesting.Commands.TestChartCommands.ShowIgnoredTests" />
+ <SeparatorItem id = "s2" />
+ <CommandItem id = "MonoDevelop.UnitTesting.Commands.TestChartCommands.UseTimeScale" />
+ <CommandItem id = "MonoDevelop.UnitTesting.Commands.TestChartCommands.SingleDayResult" />
+ </Extension>
+
+ <Extension path = "/MonoDevelop/UnitTesting/TestProviders">
+ <Class id="SystemTestProvider" class="MonoDevelop.UnitTesting.SystemTestProvider" />
+ </Extension>
+
+ <Extension path = "/MonoDevelop/Core/StockIcons">
+ <StockIcon stockid = "nunit-pad-icon" resource = "pad-unit-test-16.png" size="Menu" />
+ </Extension>
+
+ <Extension path = "/MonoDevelop/ProjectModel/ProjectModelExtensions">
+ <Class class = "MonoDevelop.UnitTesting.UnitTestProjectServiceExtension" />
+ </Extension>
+
+</ExtensionModel>
diff --git a/main/src/addins/NUnit/README b/main/src/addins/MonoDevelop.UnitTesting/README
index 091d68920f..091d68920f 100644
--- a/main/src/addins/NUnit/README
+++ b/main/src/addins/MonoDevelop.UnitTesting/README
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/AbstractResultsStore.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/AbstractResultsStore.cs
new file mode 100644
index 0000000000..6885470811
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/AbstractResultsStore.cs
@@ -0,0 +1,407 @@
+//
+// AbstractResultsStore.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Xml.Serialization;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.UnitTesting
+{
+ public abstract class AbstractResultsStore: IResultsStore
+ {
+ Hashtable fileCache = new Hashtable ();
+ string basePath;
+ string storeId;
+ Hashtable cachedRootList = new Hashtable ();
+
+ IResultsStoreSerializer serializer;
+
+ public AbstractResultsStore (IResultsStoreSerializer serializer, string directory, string storeId)
+ {
+ this.serializer = serializer;
+ this.basePath = directory;
+ this.storeId = storeId;
+ }
+
+ public void RegisterResult (string configuration, UnitTest test, UnitTestResult result)
+ {
+ string aname = test.StoreRelativeName;
+
+ TestRecord root = GetRootRecord (configuration, result.TestDate);
+ if (root == null) {
+ root = new TestRecord ();
+ fileCache [GetRootFileName (configuration, result.TestDate)] = root;
+ }
+ root.Modified = true;
+ TestRecord record = root;
+
+ if (aname.Length > 0) {
+ string[] path = test.StoreRelativeName.Split ('.');
+ foreach (string p in path) {
+ TestRecord ctr = record.Tests != null ? record.Tests [p] : null;
+ if (ctr == null) {
+ ctr = new TestRecord ();
+ ctr.Name = p;
+ if (record.Tests == null)
+ record.Tests = new TestRecordCollection ();
+ record.Tests.Add (ctr);
+ }
+ record = ctr;
+ }
+ }
+
+ if (record.Results == null)
+ record.Results = new UnitTestResultCollection ();
+ record.Results.Add (result);
+ }
+
+ public UnitTestResult GetNextResult (string configuration, UnitTest test, DateTime date)
+ {
+ DateTime currentDate = date;
+ TestRecord root = GetRootRecord (configuration, currentDate);
+ if (root == null)
+ root = GetNextRootRecord (configuration, ref currentDate);
+
+ while (root != null) {
+ TestRecord tr = FindRecord (root, test.StoreRelativeName);
+ if (tr != null && tr.Results != null) {
+ foreach (UnitTestResult res in tr.Results) {
+ if (res.TestDate > date)
+ return res;
+ }
+ }
+ root = GetNextRootRecord (configuration, ref currentDate);
+ }
+ return null;
+ }
+
+ public UnitTestResult GetPreviousResult (string configuration, UnitTest test, DateTime date)
+ {
+ DateTime currentDate = date;
+ TestRecord root = GetRootRecord (configuration, currentDate);
+ if (root == null)
+ root = GetPreviousRootRecord (configuration, ref currentDate);
+
+ while (root != null) {
+ TestRecord tr = FindRecord (root, test.StoreRelativeName);
+ if (tr != null && tr.Results != null) {
+ for (int n = tr.Results.Count - 1; n >= 0; n--) {
+ UnitTestResult res = (UnitTestResult) tr.Results [n];
+ if (res.TestDate < date)
+ return res;
+ }
+ }
+ root = GetPreviousRootRecord (configuration, ref currentDate);
+ }
+ return null;
+ }
+
+ public UnitTestResult GetLastResult (string configuration, UnitTest test, DateTime date)
+ {
+ return GetPreviousResult (configuration, test, date.AddTicks (1));
+ }
+
+ public UnitTestResult[] GetResults (string configuration, UnitTest test, DateTime startDate, DateTime endDate)
+ {
+ ArrayList list = new ArrayList ();
+ DateTime firstDay = new DateTime (startDate.Year, startDate.Month, startDate.Day);
+
+ DateTime[] dates = GetStoreDates (configuration);
+
+ foreach (DateTime date in dates) {
+ if (date < firstDay)
+ continue;
+ if (date > endDate)
+ break;
+
+ TestRecord root = GetRootRecord (configuration, date);
+ if (root == null) continue;
+
+ TestRecord tr = FindRecord (root, test.StoreRelativeName);
+ if (tr != null && tr.Results != null) {
+ foreach (UnitTestResult res in tr.Results) {
+ if (res.TestDate >= startDate && res.TestDate <= endDate)
+ list.Add (res);
+ }
+ }
+ }
+
+ return (UnitTestResult[]) list.ToArray (typeof(UnitTestResult));
+ }
+
+ public UnitTestResult[] GetResultsToDate (string configuration, UnitTest test, DateTime endDate, int count)
+ {
+ ArrayList list = new ArrayList ();
+ DateTime[] dates = GetStoreDates (configuration);
+
+ for (int n = dates.Length - 1; n >= 0 && list.Count < count; n--) {
+ if (dates [n] > endDate)
+ continue;
+
+ TestRecord root = GetRootRecord (configuration, dates [n]);
+ if (root == null) continue;
+
+ TestRecord tr = FindRecord (root, test.StoreRelativeName);
+ if (tr != null && tr.Results != null) {
+ for (int m = tr.Results.Count - 1; m >= 0 && list.Count < count; m--) {
+ UnitTestResult res = (UnitTestResult) tr.Results [m];
+ if (res.TestDate <= endDate)
+ list.Add (res);
+ }
+ }
+ }
+
+ UnitTestResult[] array = (UnitTestResult[]) list.ToArray (typeof(UnitTestResult));
+ Array.Reverse (array);
+ return array;
+ }
+
+ public void Save ()
+ {
+ if (!Directory.Exists (basePath))
+ Directory.CreateDirectory (basePath);
+
+ foreach (DictionaryEntry entry in fileCache) {
+ TestRecord record = (TestRecord) entry.Value;
+ if (!record.Modified)
+ continue;
+
+ string filePath = Path.Combine (basePath, (string)entry.Key);
+ try {
+ serializer.Serialize (filePath, record);
+ record.Modified = false;
+ } catch (Exception ex) {
+ LoggingService.LogError (ex.ToString ());
+ }
+ }
+ cachedRootList.Clear ();
+ }
+
+ TestRecord FindRecord (TestRecord root, string aname)
+ {
+ if (aname.Length == 0)
+ return root;
+ else {
+ string[] path = aname.Split ('.');
+ TestRecord tr = root;
+ foreach (string p in path) {
+ if (tr.Tests == null)
+ return null;
+ tr = tr.Tests [p];
+ if (tr == null)
+ return null;
+ }
+ return tr;
+ }
+ }
+
+ TestRecord GetRootRecord (string configuration, DateTime date)
+ {
+ string file = GetRootFileName (configuration, date);
+ TestRecord res = (TestRecord) fileCache [file];
+ if (res != null)
+ return res;
+ string filePath;
+ try {
+ filePath = Path.Combine (basePath, file);
+ } catch (Exception) {
+ return null;
+ }
+
+ try {
+ res = (TestRecord) serializer.Deserialize (filePath);
+ } catch (Exception ex) {
+ LoggingService.LogError (ex.ToString ());
+ return null;
+ }
+
+ if (res != null) {
+ fileCache [file] = res;
+ }
+ return res;
+ }
+
+ TestRecord GetNextRootRecord (string configuration, ref DateTime date)
+ {
+ DateTime[] dates = GetStoreDates (configuration);
+ foreach (DateTime d in dates) {
+ if (d > date) {
+ date = d;
+ return GetRootRecord (configuration, d);
+ }
+ }
+ return null;
+ }
+
+ TestRecord GetPreviousRootRecord (string configuration, ref DateTime date)
+ {
+ date = new DateTime (date.Year, date.Month, date.Day);
+ DateTime[] dates = GetStoreDates (configuration);
+ for (int n = dates.Length - 1; n >= 0; n--) {
+ if (dates [n] < date) {
+ date = dates [n];
+ return GetRootRecord (configuration, dates [n]);
+ }
+ }
+ return null;
+ }
+
+ // Filter out all invalid path characters in the file name
+ // Bug 3023 - Running NUnit tests throws ArgumentException: Illegal Characters in path
+ static string EscapeFilename (string str)
+ {
+ var pc = FilePath.GetInvalidPathChars ();
+ char[] specialCharacters = new char[pc.Length + 1];
+ pc.CopyTo (specialCharacters, 0);
+ specialCharacters [specialCharacters.Length - 1] = '%';
+
+ int i = str.IndexOfAny (specialCharacters);
+ while (i != -1) {
+ str = str.Substring (0, i) + '%' + ((int) str [i]).ToString ("X") + str.Substring (i + 1);
+ i = str.IndexOfAny (specialCharacters, i + 3);
+ }
+ return str;
+ }
+
+ string GetRootFileName (string configuration, DateTime date)
+ {
+ var filteredConfiguration = EscapeFilename (configuration);
+ return storeId + "-" + filteredConfiguration + "-" + date.ToString ("yyyy-MM-dd", CultureInfo.InvariantCulture) + ".xml";
+ }
+
+ DateTime ParseFileNameDate (string configuration, string fileName)
+ {
+ fileName = Path.GetFileNameWithoutExtension (fileName);
+ fileName = fileName.Substring (storeId.Length + configuration.Length + 2);
+ return DateTime.ParseExact (fileName, "yyyy-MM-dd", CultureInfo.InvariantCulture);
+ }
+
+ DateTime[] GetStoreDates (string configuration)
+ {
+ if (!Directory.Exists (basePath))
+ return new DateTime [0];
+
+ DateTime[] res = (DateTime[]) cachedRootList [configuration];
+ if (res != null)
+ return res;
+
+ var dates = new List<DateTime> ();
+ var escapedConfiguration = EscapeFilename (configuration);
+ foreach (string file in Directory.GetFiles (basePath, storeId + "-" + escapedConfiguration + "-*")) {
+ try {
+ DateTime t = ParseFileNameDate (escapedConfiguration, Path.GetFileName (file));
+ dates.Add (t);
+ } catch { }
+ }
+ res = dates.ToArray ();
+ cachedRootList [configuration] = res;
+ return res;
+ }
+ }
+
+ /// <summary>
+ /// Encapsulates serialization/deserialization logic
+ /// </summary>
+ public interface IResultsStoreSerializer
+ {
+ /// <summary>
+ /// Serialize the record into the specified path.
+ /// </summary>
+ void Serialize(string filePath, TestRecord testRecord);
+
+ /// <summary>
+ /// Deserialize the TestRecord from the sepcified path if possible.
+ /// Return null if deserialization is impossible.
+ /// </summary>
+ TestRecord Deserialize(string filePath);
+ }
+
+ [Serializable]
+ public class TestRecord
+ {
+ string name;
+ UnitTestResultCollection results;
+ TestRecordCollection tests;
+ internal bool Modified;
+
+ [XmlAttribute]
+ public string Name {
+ get { return name; }
+ set { name = value; }
+ }
+
+ public UnitTestResultCollection Results {
+ get { return results; }
+ set { results = value; }
+ }
+
+ public TestRecordCollection Tests {
+ get { return tests; }
+ set { tests = value; }
+ }
+ }
+
+ [Serializable]
+ public class TestRecordCollection: CollectionBase
+ {
+ public new TestRecord this [int n] {
+ get { return (TestRecord) ((IList)this) [n]; }
+ }
+
+ public new TestRecord this [string name] {
+ get {
+ for (int n=0; n<List.Count; n++)
+ if (((TestRecord)List [n]).Name == name)
+ return (TestRecord) List [n];
+ return null;
+ }
+ }
+
+ public void Add (TestRecord test)
+ {
+ ((IList)this).Add (test);
+ }
+ }
+
+ [Serializable]
+ public class UnitTestResultCollection: CollectionBase
+ {
+ public new UnitTestResult this [int n] {
+ get { return (UnitTestResult) ((IList)this) [n]; }
+ }
+
+ public void Add (UnitTestResult test)
+ {
+ ((IList)this).Add (test);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/AbstractUnitTestEditorExtension.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/AbstractUnitTestEditorExtension.cs
new file mode 100644
index 0000000000..1831e69db4
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/AbstractUnitTestEditorExtension.cs
@@ -0,0 +1,373 @@
+//
+// AbstractUnitTestTextEditorExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using System.Threading;
+using MonoDevelop.Core;
+using MonoDevelop.Ide;
+using Gtk;
+using MonoDevelop.Components;
+using System.Threading.Tasks;
+using MonoDevelop.Ide.Editor.Extension;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Projects;
+using Mono.Addins;
+
+namespace MonoDevelop.UnitTesting
+{
+ public abstract class AbstractUnitTestTextEditorExtension : TextEditorExtension
+ {
+ const string TestMarkersPath = "/MonoDevelop/UnitTesting/UnitTestMarkers";
+ static IUnitTestMarkers [] unitTestMarkers;
+
+ static AbstractUnitTestTextEditorExtension ()
+ {
+ AddinManager.AddExtensionNodeHandler (TestMarkersPath, HandleExtensionNodeEventHandler);
+ }
+
+ static void HandleExtensionNodeEventHandler (object sender, ExtensionNodeEventArgs args)
+ {
+ unitTestMarkers = AddinManager.GetExtensionNodes (TestMarkersPath).OfType<IUnitTestMarkers> ().ToArray ();
+ }
+
+ protected override void Initialize ()
+ {
+ base.Initialize ();
+ DocumentContext.DocumentParsed += HandleDocumentParsed;
+ if (IdeApp.Workbench == null)
+ return;
+ UnitTestService.TestSessionCompleted += HandleTestSessionCompleted;
+ }
+
+ void HandleTestSessionCompleted (object sender, EventArgs e)
+ {
+ foreach (var marker in currentMarker)
+ marker.UpdateState ();
+ }
+
+ public override void Dispose ()
+ {
+ src.Cancel ();
+ UnitTestService.TestSessionCompleted -= HandleTestSessionCompleted;
+ RemoveHandler ();
+ DocumentContext.DocumentParsed -= HandleDocumentParsed;
+ base.Dispose ();
+ }
+
+ CancellationTokenSource src = new CancellationTokenSource ();
+
+ public abstract Task<IList<UnitTestLocation>> GatherUnitTests (IUnitTestMarkers[] unitTestMarkers, CancellationToken token);
+
+ void HandleDocumentParsed (object sender, EventArgs e)
+ {
+ if (!IdeApp.Preferences.EnableUnitTestEditorIntegration)
+ return;
+ src.Cancel ();
+ src = new CancellationTokenSource ();
+ var token = src.Token;
+ ThreadPool.QueueUserWorkItem (delegate {
+ if (token.IsCancellationRequested || DocumentContext == null)
+ return;
+ try {
+ GatherUnitTests (unitTestMarkers, token).ContinueWith (task => {
+ var foundTests = task.Result;
+ if (foundTests == null || DocumentContext == null)
+ return;
+ Application.Invoke (delegate {
+ if (token.IsCancellationRequested || DocumentContext == null)
+ return;
+ foreach (var oldMarker in currentMarker)
+ Editor.RemoveMarker (oldMarker);
+ var newMarkers = new List<IUnitTestMarker> ();
+ foreach (var foundTest in foundTests) {
+ if (foundTest == null)
+ continue;
+ var unitTestMarker = TextMarkerFactory.CreateUnitTestMarker (Editor, new UnitTestMarkerHostImpl (this), foundTest);
+ newMarkers.Add (unitTestMarker);
+ var line = Editor.GetLineByOffset (foundTest.Offset);
+ if (line != null) {
+ Editor.AddMarker (line, unitTestMarker);
+ }
+ }
+ currentMarker = newMarkers;
+ });
+
+ }, TaskContinuationOptions.ExecuteSynchronously |
+ TaskContinuationOptions.NotOnCanceled |
+ TaskContinuationOptions.NotOnFaulted);
+ } catch (OperationCanceledException) {
+ }
+ });
+ }
+
+ static uint timeoutHandler;
+
+ static void RemoveHandler ()
+ {
+ if (timeoutHandler != 0) {
+ GLib.Source.Remove (timeoutHandler);
+ timeoutHandler = 0;
+ }
+ }
+
+ List<IUnitTestMarker> currentMarker = new List<IUnitTestMarker>();
+
+ class UnitTestMarkerHostImpl : UnitTestMarkerHost
+ {
+ readonly AbstractUnitTestTextEditorExtension ext;
+
+ public UnitTestMarkerHostImpl (AbstractUnitTestTextEditorExtension ext)
+ {
+ if (ext == null)
+ throw new ArgumentNullException (nameof (ext));
+ this.ext = ext;
+ }
+
+ #region implemented abstract members of UnitTestMarkerHost
+
+ public override Xwt.Drawing.Image GetStatusIcon (string unitTestIdentifier, string caseId = null)
+ {
+ var test = UnitTestService.SearchTestById (unitTestIdentifier + caseId);
+ if (test != null)
+ return test.StatusIcon;
+ return TestStatusIcon.None;
+ }
+
+ public override bool IsFailure (string unitTestIdentifier, string caseId = null)
+ {
+ var test = UnitTestService.SearchTestById (unitTestIdentifier + caseId);
+ if (test != null) {
+ var result = test.GetLastResult ();
+ if (result != null)
+ return result.IsFailure;
+ }
+ return false;
+ }
+
+ public override string GetMessage (string unitTestIdentifier, string caseId = null)
+ {
+ var test = UnitTestService.SearchTestById (unitTestIdentifier + caseId);
+ if (test != null) {
+ var result = test.GetLastResult ();
+ if (result != null)
+ return result.Message;
+ }
+ return null;
+ }
+
+ public override bool HasResult (string unitTestIdentifier, string caseId = null)
+ {
+ return UnitTestService.SearchTestById (unitTestIdentifier + caseId) != null;
+ }
+
+ public override void PopupContextMenu (UnitTestLocation unitTest, int x, int y)
+ {
+ var debugModeSet = Runtime.ProcessService.GetDebugExecutionMode ();
+ var project = ext?.DocumentContext?.Project;
+ if (project == null)
+ return;
+ var menu = new ContextMenu ();
+ if (unitTest.IsFixture) {
+ var menuItem = new ContextMenuItem ("_Run All");
+ menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier, project, false).Run;
+ menu.Add (menuItem);
+ if (debugModeSet != null) {
+ menuItem = new ContextMenuItem ("_Debug All");
+ menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier, project, true).Run;
+ menu.Add (menuItem);
+ }
+ menuItem = new ContextMenuItem ("_Select in Test Pad");
+ menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier, project, true).Select;
+ menu.Add (menuItem);
+ } else {
+ if (unitTest.TestCases.Count == 0) {
+ var menuItem = new ContextMenuItem ("_Run");
+ menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier, project, false).Run;
+ menu.Add (menuItem);
+ if (debugModeSet != null) {
+ menuItem = new ContextMenuItem ("_Debug");
+ menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier, project, true).Run;
+ menu.Add (menuItem);
+ }
+ menuItem = new ContextMenuItem ("_Select in Test Pad");
+ menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier, project, true).Select;
+ menu.Add (menuItem);
+ } else {
+ var menuItem = new ContextMenuItem ("_Run All");
+ menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier, project, false).Run;
+ menu.Add (menuItem);
+ if (debugModeSet != null) {
+ menuItem = new ContextMenuItem ("_Debug All");
+ menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier, project, true).Run;
+ menu.Add (menuItem);
+ }
+ menu.Add (new SeparatorContextMenuItem ());
+ foreach (var id in unitTest.TestCases) {
+ var submenu = new ContextMenu ();
+ menuItem = new ContextMenuItem ("_Run");
+ menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier + id, project, false).Run;
+ submenu.Add (menuItem);
+ if (debugModeSet != null) {
+ menuItem = new ContextMenuItem ("_Debug");
+ menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier + id, project, true).Run;
+ submenu.Add (menuItem);
+ }
+
+ var label = "Test" + id;
+ string tooltip = null;
+ var test = UnitTestService.SearchTestById (unitTest.UnitTestIdentifier + id);
+ if (test != null) {
+ var result = test.GetLastResult ();
+ if (result != null && result.IsFailure) {
+ tooltip = result.Message;
+ label += "!";
+ }
+ }
+
+ menuItem = new ContextMenuItem ("_Select in Test Pad");
+ menuItem.Clicked += new TestRunner (unitTest.UnitTestIdentifier + id, project, true).Select;
+ submenu.Add (menuItem);
+
+ var subMenuItem = new ContextMenuItem (label);
+ // if (!string.IsNullOrEmpty (tooltip))
+ // subMenuItem.TooltipText = tooltip;
+ subMenuItem.SubMenu = submenu;
+ menu.Add (subMenuItem);
+ }
+ }
+ }
+ menu.Show (ext.Editor, x, y);
+ }
+
+ #endregion
+
+ class TestRunner
+ {
+ readonly string testCase;
+ readonly bool debug;
+ IBuildTarget project;
+
+ public TestRunner (string testCase, IBuildTarget project, bool debug)
+ {
+ this.testCase = testCase;
+ this.debug = debug;
+ this.project = project;
+ }
+
+ bool TimeoutHandler ()
+ {
+ var test = UnitTestService.SearchTestById (testCase);
+ if (test != null) {
+ RunTest (test);
+ timeoutHandler = 0;
+ } else {
+ return true;
+ }
+ return false;
+ }
+
+ internal async void Run (object sender, EventArgs e)
+ {
+ if (IdeApp.ProjectOperations.IsBuilding (IdeApp.ProjectOperations.CurrentSelectedSolution) ||
+ IdeApp.ProjectOperations.IsRunning (IdeApp.ProjectOperations.CurrentSelectedSolution))
+ return;
+
+ var foundTest = UnitTestService.SearchTestById (testCase);
+ if (foundTest != null) {
+ RunTest (foundTest);
+ return;
+ }
+
+ await IdeApp.ProjectOperations.Build (project).Task;
+ await UnitTestService.RefreshTests (CancellationToken.None);
+
+ foundTest = UnitTestService.SearchTestById (testCase);
+ if (foundTest != null)
+ RunTest (foundTest);
+ }
+
+ internal void Select (object sender, EventArgs e)
+ {
+ var test = UnitTestService.SearchTestById (testCase);
+ if (test == null)
+ return;
+ UnitTestService.CurrentSelectedTest = test;
+ }
+
+ void RunTest (UnitTest test)
+ {
+ var debugModeSet = Runtime.ProcessService.GetDebugExecutionMode ();
+ Core.Execution.IExecutionHandler ctx = null;
+ if (debug && debugModeSet != null) {
+ foreach (var executionMode in debugModeSet.ExecutionModes) {
+ if (test.CanRun (executionMode.ExecutionHandler)) {
+ ctx = executionMode.ExecutionHandler;
+ break;
+ }
+ }
+ }
+ // NUnitService.Instance.RunTest (test, ctx);
+ var pad = IdeApp.Workbench.GetPad<TestPad> ();
+ var content = (TestPad)pad.Content;
+ content.RunTest (test, ctx);
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Markers that can be used to identify a method as a unit test
+ /// </summary>
+ public interface IUnitTestMarkers
+ {
+ /// <summary>
+ /// Type of attribute that a method needs to have to be considered to be a test method
+ /// </summary>
+ /// <value>The test method attribute marker.</value>
+ string TestMethodAttributeMarker { get; }
+
+ /// <summary>
+ /// Type of attribute that describes a test case for a test method. It has to be applied to a test method.
+ /// </summary>
+ /// <value>The test method attribute marker.</value>
+ string TestCaseMethodAttributeMarker { get; }
+
+ /// <summary>
+ /// Type of attribute used to mark a test method to be ignored
+ /// </summary>
+ /// <value>The ignore test method attribute marker.</value>
+ string IgnoreTestMethodAttributeMarker { get; }
+
+ /// <summary>
+ /// Type of attribute used to mark a test class to be ignored
+ /// </summary>
+ /// <value>The ignore test method attribute marker.</value>
+ string IgnoreTestClassAttributeMarker { get; }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/BinaryResultsStore.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/BinaryResultsStore.cs
new file mode 100644
index 0000000000..292ad8d687
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/BinaryResultsStore.cs
@@ -0,0 +1,98 @@
+//
+// BinaryResultsStore.cs
+//
+// Author:
+// Sergey Khabibullin <sergey@khabibullin.com>
+//
+// Copyright (c) 2014 Sergey Khabibullin
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Xml.Serialization;
+using System.IO;
+using ICSharpCode.NRefactory.Utils;
+
+namespace MonoDevelop.UnitTesting
+{
+ /// <summary>
+ /// ResultsStore implementation that uses binary serializer
+ /// </summary>
+ public class BinaryResultsStore : AbstractResultsStore
+ {
+ static BinaryResultsStoreSerializer serializer = new BinaryResultsStoreSerializer();
+
+ public BinaryResultsStore (string directory, string storeId)
+ : base(serializer, directory, storeId)
+ {
+ }
+ }
+
+ /// <summary>
+ /// Serializer implementation that uses ICSharpCode.NRefactory.Utils.FastSerializer
+ /// as it's main method to serialize test records. The serializer is backward compatible
+ /// with the old xml-based serialization and will deserialize test record from xml
+ /// if the binary form is not yet present.
+ /// </summary>
+ public class BinaryResultsStoreSerializer : IResultsStoreSerializer
+ {
+ const string binaryExtension = ".test-result";
+ const string xmlExtension = ".xml";
+
+ FastSerializer fastSerializer = new FastSerializer();
+ XmlSerializer xmlSerializer = new XmlSerializer(typeof(TestRecord));
+
+ public void Serialize (string xmlFilePath, TestRecord testRecord)
+ {
+ // no need for xml serialization because next time it will be
+ // deserialized from the binary format
+ string binaryFilePath = GetBinaryFilePath (xmlFilePath);
+ using (var stream = File.OpenWrite(binaryFilePath)) {
+ fastSerializer.Serialize (stream, testRecord);
+ }
+ }
+
+ public TestRecord Deserialize (string xmlFilePath)
+ {
+ string binaryFilePath = GetBinaryFilePath (xmlFilePath);
+
+ // deserialize from the binary format if the file exists
+ if (File.Exists(binaryFilePath)) {
+ using (var stream = File.OpenRead (binaryFilePath)) {
+ return (TestRecord) fastSerializer.Deserialize (stream);
+ }
+ }
+
+ // deserialize from xml if the file exists
+ if (File.Exists(xmlFilePath)) {
+ using (var reader = new StreamReader (xmlFilePath)) {
+ return (TestRecord) xmlSerializer.Deserialize (reader);
+ }
+ }
+
+ return null;
+ }
+
+ string GetBinaryFilePath(string xmlFilePath)
+ {
+ // filename with the binary extension
+ return xmlFilePath.Substring (0, xmlFilePath.Length - xmlExtension.Length) + binaryExtension;
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/GeneralTestOptions.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/GeneralTestOptions.cs
new file mode 100644
index 0000000000..97b6171714
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/GeneralTestOptions.cs
@@ -0,0 +1,43 @@
+//
+// GeneralTestOptions.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.Collections;
+
+namespace MonoDevelop.UnitTesting
+{
+ public class GeneralTestOptions: ICloneable
+ {
+ public object Clone ()
+ {
+ return new GeneralTestOptions ();
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/IResultsStore.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/IResultsStore.cs
new file mode 100644
index 0000000000..6afb5c4d53
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/IResultsStore.cs
@@ -0,0 +1,46 @@
+//
+// IResultsStore.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace MonoDevelop.UnitTesting
+{
+ public interface IResultsStore
+ {
+ void RegisterResult (string configuration, UnitTest test, UnitTestResult result);
+
+ UnitTestResult GetLastResult (string configuration, UnitTest test, DateTime date);
+ UnitTestResult GetNextResult (string configuration, UnitTest test, DateTime date);
+ UnitTestResult GetPreviousResult (string configuration, UnitTest test, DateTime date);
+ UnitTestResult[] GetResults (string configuration, UnitTest test, DateTime startDate, DateTime endDate);
+ UnitTestResult[] GetResultsToDate (string configuration, UnitTest test, DateTime endDate, int count);
+
+ void Save ();
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/ITestProgressMonitor.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/ITestProgressMonitor.cs
new file mode 100644
index 0000000000..653461811d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/ITestProgressMonitor.cs
@@ -0,0 +1,45 @@
+//
+// ITestProgressMonitor.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Threading;
+
+namespace MonoDevelop.UnitTesting
+{
+ public interface ITestProgressMonitor
+ {
+ void BeginTest (UnitTest test);
+ void EndTest (UnitTest test, UnitTestResult result);
+ void ReportRuntimeError (string message, Exception exception);
+ void WriteGlobalLog (string message);
+ CancellationToken CancellationToken { get; }
+ }
+
+ public delegate void TestHandler ();
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/ITestProvider.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/ITestProvider.cs
new file mode 100644
index 0000000000..c503f70ca5
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/ITestProvider.cs
@@ -0,0 +1,40 @@
+//
+// ITestProvider.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using MonoDevelop.Projects;
+
+namespace MonoDevelop.UnitTesting
+{
+ public interface ITestProvider: IDisposable
+ {
+ UnitTest CreateUnitTest (WorkspaceObject entry);
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/NUnitSourceCodeLocationFinder.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/NUnitSourceCodeLocationFinder.cs
new file mode 100644
index 0000000000..02dc515ce3
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/NUnitSourceCodeLocationFinder.cs
@@ -0,0 +1,70 @@
+//
+// NUnitSourceCodeLocationFinder.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Threading.Tasks;
+using System.Threading;
+using Mono.Addins;
+using System.Collections.Generic;
+using MonoDevelop.Projects;
+
+namespace MonoDevelop.UnitTesting
+{
+ public abstract class NUnitSourceCodeLocationFinder
+ {
+ static List<NUnitSourceCodeLocationFinder> locationFinder = new List<NUnitSourceCodeLocationFinder> ();
+
+ static NUnitSourceCodeLocationFinder ()
+ {
+ AddinManager.AddExtensionNodeHandler ("/MonoDevelop/UnitTesting/NUnitSourceCodeLocationFinder", delegate(object sender, ExtensionNodeEventArgs args) {
+ var provider = (NUnitSourceCodeLocationFinder) args.ExtensionObject;
+ switch (args.Change) {
+ case ExtensionChange.Add:
+ locationFinder.Add (provider);
+ break;
+ case ExtensionChange.Remove:
+ locationFinder.Remove (provider);
+ break;
+ }
+ });
+ }
+
+ public static async Task<SourceCodeLocation> TryGetSourceCodeLocationAsync (Project project, string fixtureTypeNamespace, string fixtureTypeName, string testName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ foreach (var finder in locationFinder) {
+ var result = await finder.GetSourceCodeLocationAsync (project, fixtureTypeNamespace, fixtureTypeName, testName, cancellationToken).ConfigureAwait (false);
+ if (result != null)
+ return result;
+ }
+ return null;
+ }
+
+
+ public abstract Task<SourceCodeLocation> GetSourceCodeLocationAsync (Project project, string fixtureTypeNamespace, string fixtureTypeName, string testName, CancellationToken cancellationToken = default(CancellationToken));
+
+
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/RemoteUnhandledException.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/RemoteUnhandledException.cs
new file mode 100644
index 0000000000..64a4accb5a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/RemoteUnhandledException.cs
@@ -0,0 +1,81 @@
+//
+// RemoteUnhandledException.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Reflection;
+using System.IO;
+using System.Collections;
+using System.Collections.Generic;
+using System.Threading;
+using System.Text;
+
+using MonoDevelop.Core;
+using MonoDevelop.Core.Execution;
+
+namespace MonoDevelop.UnitTesting
+{
+
+ /// <summary>
+ /// Exception class that can be serialized
+ /// </summary>
+ public class RemoteUnhandledException: Exception
+ {
+ string stack;
+
+ public RemoteUnhandledException (string exceptionName, string message, string stack): base (message)
+ {
+ RemoteExceptionName = exceptionName;
+ this.stack = stack;
+ }
+
+ public RemoteUnhandledException (Exception ex): base (ex.Message)
+ {
+ RemoteExceptionName = ex.GetType().Name;
+ this.stack = ex.StackTrace;
+ }
+
+ public string Serialize ()
+ {
+ return RemoteExceptionName + "\n" + Message.Replace ('\r',' ').Replace ('\n',' ') + "\n" + StackTrace;
+ }
+
+ public static RemoteUnhandledException Parse (string s)
+ {
+ int i = s.IndexOf ('\n');
+ string name = s.Substring (0, i++);
+ int i2 = s.IndexOf ('\n', i);
+ return new RemoteUnhandledException (name, s.Substring (i, i2 - i), s.Substring (i2 + 1));
+ }
+
+ public string RemoteExceptionName { get; set; }
+
+ public override string StackTrace {
+ get {
+ return stack;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/SolutionFolderTestGroup.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/SolutionFolderTestGroup.cs
new file mode 100644
index 0000000000..5346301540
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/SolutionFolderTestGroup.cs
@@ -0,0 +1,96 @@
+//
+// CombineTestGroup.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+using System.Collections;
+using MonoDevelop.Core;
+using MonoDevelop.Projects;
+
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide;
+
+namespace MonoDevelop.UnitTesting
+{
+ public class SolutionFolderTestGroup: UnitTestGroup
+ {
+ SolutionFolder folder;
+
+ public SolutionFolderTestGroup (SolutionFolder c): base (c.Name, c)
+ {
+ string storeId = c.ItemId;
+ string resultsPath = UnitTestService.GetTestResultsDirectory (c.BaseDirectory);
+ ResultsStore = new BinaryResultsStore (resultsPath, storeId);
+
+ folder = c;
+ folder.NameChanged += OnCombineRenamed;
+
+ if (c.IsRoot) {
+ folder.ParentSolution.SolutionItemAdded += OnEntryChanged;
+ folder.ParentSolution.SolutionItemRemoved += OnEntryChanged;
+ }
+ }
+
+ public static SolutionFolderTestGroup CreateTest (SolutionFolder c)
+ {
+ return new SolutionFolderTestGroup (c);
+ }
+
+ public override void Dispose ()
+ {
+ folder.NameChanged -= OnCombineRenamed;
+ if (folder.IsRoot) {
+ folder.ParentSolution.SolutionItemAdded -= OnEntryChanged;
+ folder.ParentSolution.SolutionItemRemoved -= OnEntryChanged;
+ }
+ base.Dispose ();
+ }
+
+ void OnEntryChanged (object sender, SolutionItemEventArgs e)
+ {
+ UpdateTests ();
+ }
+
+ void OnCombineRenamed (object sender, SolutionItemRenamedEventArgs e)
+ {
+ UnitTestGroup parent = Parent as UnitTestGroup;
+ if (parent != null)
+ parent.UpdateTests ();
+ }
+
+ protected override void OnCreateTests ()
+ {
+ foreach (SolutionFolderItem e in folder.Items) {
+ UnitTest t = UnitTestService.BuildTest (e);
+ if (t != null)
+ Tests.Add (t);
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/SystemTestProvider.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/SystemTestProvider.cs
new file mode 100644
index 0000000000..d59e90f281
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/SystemTestProvider.cs
@@ -0,0 +1,61 @@
+//
+// SystemTestProvider.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Projects;
+
+namespace MonoDevelop.UnitTesting
+{
+ class SystemTestProvider: ITestProvider
+ {
+ public UnitTest CreateUnitTest (WorkspaceObject entry)
+ {
+ UnitTest test = null;
+
+ if (entry is SolutionFolder)
+ test = SolutionFolderTestGroup.CreateTest ((SolutionFolder)entry);
+ if (entry is Solution)
+ test = SolutionFolderTestGroup.CreateTest (((Solution)entry).RootFolder);
+ if (entry is Workspace)
+ test = WorkspaceTestGroup.CreateTest ((Workspace)entry);
+
+ UnitTestGroup grp = test as UnitTestGroup;
+ if (grp != null && !grp.HasTests) {
+ test.Dispose ();
+ return null;
+ }
+
+ return test;
+ }
+
+ public void Dispose ()
+ {
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/TestContext.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/TestContext.cs
new file mode 100644
index 0000000000..2f6dfadaff
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/TestContext.cs
@@ -0,0 +1,73 @@
+//
+// TestContext.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Execution;
+using MonoDevelop.Ide;
+using MonoDevelop.Projects;
+
+namespace MonoDevelop.UnitTesting
+{
+ public class TestContext
+ {
+ ITestProgressMonitor monitor;
+ DateTime testDate;
+ object contextData;
+ MonoDevelop.Projects.ExecutionContext executionContext;
+
+ internal TestContext (ITestProgressMonitor monitor, TestResultsPad resultsPad, MonoDevelop.Projects.ExecutionContext executionContext, DateTime testDate)
+ {
+ this.monitor = monitor;
+ if (executionContext == null)
+ executionContext = new ExecutionContext (Runtime.ProcessService.DefaultExecutionHandler, IdeApp.Workbench.ProgressMonitors.ConsoleFactory, null);
+ this.executionContext = executionContext;
+ // Round to seconds
+ this.testDate = new DateTime ((testDate.Ticks / TimeSpan.TicksPerSecond) * TimeSpan.TicksPerSecond);
+ }
+
+ public ITestProgressMonitor Monitor {
+ get { return monitor; }
+ }
+
+ public DateTime TestDate {
+ get { return testDate; }
+ }
+
+ public object ContextData {
+ get { return contextData; }
+ set { contextData = value; }
+ }
+
+ public ExecutionContext ExecutionContext {
+ get { return executionContext; }
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTest.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTest.cs
new file mode 100644
index 0000000000..c19796d5cb
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTest.cs
@@ -0,0 +1,453 @@
+//
+// UnitTest.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.Collections;
+using MonoDevelop.Core;
+using MonoDevelop.Core.ProgressMonitoring;
+using MonoDevelop.Projects;
+using MonoDevelop.Core.Serialization;
+using MonoDevelop.Core.Execution;
+using MonoDevelop.Ide;
+using System.Threading.Tasks;
+using System.Threading;
+
+namespace MonoDevelop.UnitTesting
+{
+ public abstract class UnitTest: IDisposable
+ {
+ string name;
+ IResultsStore resultsStore;
+ UnitTestResult lastResult;
+ UnitTest parent;
+ TestStatus status;
+ WorkspaceObject ownerSolutionItem;
+ SolutionItem ownerSolutionEntityItem;
+ UnitTestResultsStore results;
+ bool historicResult;
+ bool resultLoaded;
+
+ public string FixtureTypeNamespace {
+ get;
+ set;
+ }
+
+ public string FixtureTypeName {
+ get;
+ set;
+ }
+
+ public bool IsExplicit {
+ get;
+ set;
+ }
+
+ protected UnitTest (string name)
+ {
+ this.name = name;
+ }
+
+ protected UnitTest (string name, WorkspaceObject ownerSolutionItem)
+ {
+ this.name = name;
+ this.ownerSolutionItem = ownerSolutionItem;
+ ownerSolutionEntityItem = ownerSolutionItem as SolutionItem;
+ if (ownerSolutionEntityItem != null)
+ ownerSolutionEntityItem.DefaultConfigurationChanged += OnConfugurationChanged;
+ }
+
+ public virtual void Dispose ()
+ {
+ if (ownerSolutionEntityItem != null)
+ ownerSolutionEntityItem.DefaultConfigurationChanged -= OnConfugurationChanged;
+ }
+
+ internal void SetParent (UnitTest t)
+ {
+ parent = t;
+ }
+
+ public virtual string ActiveConfiguration {
+ get {
+ if (ownerSolutionEntityItem != null) {
+ if (ownerSolutionEntityItem.DefaultConfiguration == null)
+ return "";
+ return ownerSolutionEntityItem.DefaultConfiguration.Id;
+ } else if (Parent != null) {
+ return Parent.ActiveConfiguration;
+ } else {
+ return "default";
+ }
+ }
+ }
+
+ public virtual string[] GetConfigurations ()
+ {
+ if (ownerSolutionEntityItem != null) {
+ string[] res = new string [ownerSolutionEntityItem.Configurations.Count];
+ for (int n=0; n<ownerSolutionEntityItem.Configurations.Count; n++)
+ res [n] = ownerSolutionEntityItem.Configurations [n].Id;
+ return res;
+ } else if (Parent != null) {
+ return Parent.GetConfigurations ();
+ } else {
+ return new string [] { "default" };
+ }
+ }
+
+ public UnitTestResultsStore Results {
+ get {
+ if (results == null) {
+ results = new UnitTestResultsStore (this, GetResultsStore ());
+ }
+ return results;
+ }
+ }
+
+ public UnitTestResult GetLastResult ()
+ {
+ if (!resultLoaded) {
+ resultLoaded = true;
+ lastResult = Results.GetLastResult (DateTime.Now);
+ if (lastResult != null)
+ historicResult = true;
+ }
+ return lastResult;
+ }
+
+ public void ResetLastResult ()
+ {
+ historicResult = true;
+ OnTestStatusChanged ();
+ }
+
+ public bool IsHistoricResult {
+ get { return historicResult; }
+ }
+
+ public UnitTestCollection GetRegressions (DateTime fromDate, DateTime toDate)
+ {
+ UnitTestCollection list = new UnitTestCollection ();
+ FindRegressions (list, fromDate, toDate);
+ return list;
+ }
+
+ public virtual int CountTestCases ()
+ {
+ return 1;
+ }
+
+ public virtual SourceCodeLocation SourceCodeLocation {
+ get { return null; }
+ }
+
+ public UnitTest Parent {
+ get { return parent; }
+ }
+
+ public UnitTest RootTest {
+ get {
+ if (parent != null)
+ return parent.RootTest;
+ else
+ return this;
+ }
+ }
+
+ public virtual string Name {
+ get { return name; }
+ }
+
+ public virtual string Title {
+ get { return Name; }
+ }
+
+ public TestStatus Status {
+ get { return status; }
+ set {
+ status = value;
+ OnTestStatusChanged ();
+ }
+ }
+
+ public Xwt.Drawing.Image StatusIcon {
+ get {
+ if (Status == TestStatus.Running) {
+ return TestStatusIcon.Running;
+ } else if (Status == TestStatus.Loading) {
+ return TestStatusIcon.Loading;
+ } else if (Status == TestStatus.LoadError) {
+ return TestStatusIcon.Failure;
+ } else {
+ UnitTestResult res = GetLastResult ();
+ if (res == null)
+ return TestStatusIcon.None;
+ else if (res.Status == ResultStatus.Ignored)
+ return TestStatusIcon.NotRun;
+ else if (res.ErrorsAndFailures > 0 && res.Passed > 0)
+ return IsHistoricResult ? TestStatusIcon.OldSuccessAndFailure : TestStatusIcon.SuccessAndFailure;
+ else if (res.IsInconclusive)
+ return IsHistoricResult ? TestStatusIcon.OldInconclusive : TestStatusIcon.Inconclusive;
+ else if (res.IsFailure)
+ return IsHistoricResult ? TestStatusIcon.OldFailure : TestStatusIcon.Failure;
+ else if (res.IsSuccess)
+ return IsHistoricResult ? TestStatusIcon.OldSuccess : TestStatusIcon.Success;
+ else if (res.IsNotRun || res.Ignored > 0)
+ return TestStatusIcon.NotRun;
+ else
+ return TestStatusIcon.None;
+ }
+ }
+ }
+
+ public string TestId {
+ get;
+ protected set;
+ }
+
+ public string FullName {
+ get {
+ if (parent != null)
+ return parent.FullName + "." + Name;
+ else
+ return Name;
+ }
+ }
+
+ protected WorkspaceObject OwnerSolutionItem {
+ get { return ownerSolutionItem; }
+ }
+
+ public WorkspaceObject OwnerObject {
+ get {
+ if (ownerSolutionItem != null)
+ return ownerSolutionItem;
+ else if (parent != null)
+ return parent.OwnerObject;
+ else
+ return null;
+ }
+ }
+
+ internal string StoreRelativeName {
+ get {
+ if (resultsStore != null || Parent == null)
+ return "";
+ else if (Parent.resultsStore != null)
+ return Name;
+ else
+ return Parent.StoreRelativeName + "." + Name;
+ }
+ }
+
+ // Forces the reloading of tests, if they have changed
+ public virtual Task Refresh (CancellationToken ct)
+ {
+ return Task.FromResult (0);
+ }
+
+ public UnitTestResult Run (TestContext testContext)
+ {
+ testContext.Monitor.BeginTest (this);
+ UnitTestResult res = null;
+ object ctx = testContext.ContextData;
+
+ try {
+ Status = TestStatus.Running;
+ res = OnRun (testContext);
+ } catch (Exception ex) {
+ res = UnitTestResult.CreateFailure (ex);
+ } finally {
+ Status = TestStatus.Ready;
+ testContext.Monitor.EndTest (this, res);
+ }
+ RegisterResult (testContext, res);
+ testContext.ContextData = ctx;
+ return res;
+ }
+
+ public bool CanRun (IExecutionHandler executionContext)
+ {
+ if (executionContext == null)
+ executionContext = Runtime.ProcessService.DefaultExecutionHandler;
+ return OnCanRun (executionContext);
+ }
+
+ protected abstract UnitTestResult OnRun (TestContext testContext);
+
+ protected virtual bool OnCanRun (IExecutionHandler executionContext)
+ {
+ return true;
+ }
+
+ bool building;
+
+ /// <summary>
+ /// Builds the project that contains this unit test or group of unit tests.
+ /// It returns when the project has been built and the tests have been updated.
+ /// </summary>
+ public Task Build ()
+ {
+ return OnBuild ();
+ }
+
+ protected virtual Task OnBuild ()
+ {
+ if (parent != null)
+ return parent.Build ();
+ return Task.FromResult (true);
+ }
+
+ public void RegisterResult (TestContext context, UnitTestResult result)
+ {
+ // Avoid registering results twice
+ if (lastResult != null && lastResult.TestDate == context.TestDate)
+ return;
+
+ result.TestDate = context.TestDate;
+// if ((int)result.Status == 0)
+// result.Status = ResultStatus.Ignored;
+
+ lastResult = result;
+ historicResult = false;
+ resultLoaded = true;
+
+ IResultsStore store = GetResultsStore ();
+ if (store != null)
+ store.RegisterResult (ActiveConfiguration, this, result);
+ OnTestStatusChanged ();
+ }
+
+ IResultsStore GetResultsStore ()
+ {
+ if (resultsStore != null)
+ return resultsStore;
+ if (Parent != null)
+ return Parent.GetResultsStore ();
+ else
+ return null;
+ }
+
+ protected IResultsStore ResultsStore {
+ get { return resultsStore; }
+ set { resultsStore = value; }
+ }
+
+ public virtual void SaveResults ()
+ {
+ IResultsStore store = GetResultsStore ();
+ if (store != null)
+ store.Save ();
+ }
+
+ internal virtual void FindRegressions (UnitTestCollection list, DateTime fromDate, DateTime toDate)
+ {
+ UnitTestResult res1 = Results.GetLastResult (fromDate);
+ UnitTestResult res2 = Results.GetLastResult (toDate);
+ if ((res1 == null || res1.IsSuccess) && (res2 != null && !res2.IsSuccess))
+ list.Add (this);
+ }
+
+ void GetOwnerSolutionItem (UnitTest t, out IConfigurationTarget c, out string path)
+ {
+ if (OwnerSolutionItem is SolutionItem) {
+ c = OwnerSolutionItem as SolutionItem;
+ path = "";
+ } else if (parent != null) {
+ parent.GetOwnerSolutionItem (t, out c, out path);
+ if (c == null) return;
+ if (path.Length > 0)
+ path += "/" + t.Name;
+ else
+ path = t.Name;
+ } else {
+ c = null;
+ path = null;
+ }
+ }
+
+ void OnConfugurationChanged (object ob, ConfigurationEventArgs args)
+ {
+ OnActiveConfigurationChanged ();
+ }
+
+ protected virtual void OnActiveConfigurationChanged ()
+ {
+ OnTestChanged ();
+ }
+
+ protected virtual void OnTestChanged ()
+ {
+ Gtk.Application.Invoke (delegate {
+ // Run asynchronously in the UI thread
+ if (TestChanged != null)
+ TestChanged (this, EventArgs.Empty);
+ });
+ }
+
+ protected virtual void OnTestStatusChanged ()
+ {
+ Gtk.Application.Invoke (delegate {
+ // Run asynchronously in the UI thread
+ if (TestStatusChanged != null)
+ TestStatusChanged (this, EventArgs.Empty);
+ });
+ }
+
+ public event EventHandler TestChanged;
+ public event EventHandler TestStatusChanged;
+ }
+
+ public class SourceCodeLocation
+ {
+ string fileName;
+ int line;
+ int column;
+
+ public SourceCodeLocation (string fileName, int line, int column)
+ {
+ this.fileName = fileName;
+ this.line = line;
+ this.column = column;
+ }
+
+ public string FileName {
+ get { return fileName; }
+ }
+
+ public int Line {
+ get { return line; }
+ }
+
+ public int Column {
+ get { return column; }
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestCollection.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestCollection.cs
new file mode 100644
index 0000000000..8a004ad81d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestCollection.cs
@@ -0,0 +1,91 @@
+//
+// UnitTestCollection.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+
+namespace MonoDevelop.UnitTesting
+{
+ public class UnitTestCollection: Collection<UnitTest>
+ {
+ UnitTest owner;
+
+ internal UnitTestCollection (UnitTest owner)
+ {
+ this.owner = owner;
+ }
+
+ public UnitTestCollection ()
+ {
+ }
+
+ public UnitTest this [string name] {
+ get {
+ for (int n=0; n<Items.Count; n++)
+ if (Items [n].Name == name)
+ return Items [n];
+ return null;
+ }
+ }
+
+ protected override void SetItem (int index, UnitTest item)
+ {
+ if (owner != null)
+ this[index].SetParent (null);
+ base.SetItem (index, item);
+ if (owner != null)
+ item.SetParent (owner);
+ }
+
+ protected override void RemoveItem (int index)
+ {
+ if (owner != null)
+ this [index].SetParent (null);
+ base.RemoveItem(index);
+ }
+
+ protected override void InsertItem (int index, UnitTest item)
+ {
+ base.InsertItem(index, item);
+ if (owner != null)
+ item.SetParent (owner);
+ }
+
+ protected override void ClearItems ()
+ {
+ if (owner != null) {
+ foreach (UnitTest t in this)
+ t.SetParent (null);
+ }
+ base.ClearItems();
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestGroup.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestGroup.cs
new file mode 100644
index 0000000000..037499cfdc
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestGroup.cs
@@ -0,0 +1,197 @@
+//
+// UnitTestGroup.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Core;
+using MonoDevelop.Core.ProgressMonitoring;
+using System.Collections;
+using MonoDevelop.Projects;
+using System.Threading.Tasks;
+using System.Threading;
+
+namespace MonoDevelop.UnitTesting
+{
+ public class UnitTestGroup: UnitTest
+ {
+ UnitTestCollection tests;
+
+ public UnitTestGroup (string name): base (name)
+ {
+ }
+
+ protected UnitTestGroup (string name, WorkspaceObject ownerSolutionItem): base (name, ownerSolutionItem)
+ {
+ }
+
+ public virtual bool HasTests {
+ get {
+ foreach (UnitTest t in Tests) {
+ if (t is UnitTestGroup) {
+ if (((UnitTestGroup)t).HasTests)
+ return true;
+ } else
+ return true;
+ }
+ return false;
+ }
+ }
+
+ public UnitTestCollection Tests {
+ get {
+ if (tests == null) {
+ tests = new UnitTestCollection (this);
+ OnCreateTests ();
+ }
+ return tests;
+ }
+ }
+
+ public UnitTestCollection GetFailedTests (DateTime date)
+ {
+ UnitTestCollection col = new UnitTestCollection ();
+ CollectFailedTests (col, date);
+ return col;
+ }
+
+ void CollectFailedTests (UnitTestCollection col, DateTime date)
+ {
+ foreach (UnitTest t in Tests) {
+ if (t is UnitTestGroup)
+ ((UnitTestGroup)t).CollectFailedTests (col, date);
+ else {
+ UnitTestResult res = t.Results.GetLastResult (date);
+ if (res != null && res.IsFailure)
+ col.Add (t);
+ }
+ }
+ }
+
+ public void UpdateTests ()
+ {
+ if (tests != null) {
+ foreach (UnitTest t in tests)
+ t.Dispose ();
+ tests = null;
+ OnTestChanged ();
+ }
+ }
+
+ public override void SaveResults ()
+ {
+ base.SaveResults ();
+ if (tests != null) {
+ foreach (UnitTest t in tests)
+ t.SaveResults ();
+ }
+ }
+
+
+ public override int CountTestCases ()
+ {
+ int total = 0;
+ foreach (UnitTest t in Tests)
+ total += t.CountTestCases ();
+ return total;
+ }
+
+ protected virtual void OnCreateTests ()
+ {
+ }
+
+ public async override Task Refresh (CancellationToken ct)
+ {
+ foreach (UnitTest t in Tests)
+ await t.Refresh (ct);
+ }
+
+ protected override UnitTestResult OnRun (TestContext testContext)
+ {
+ UnitTestResult tres = new UnitTestResult ();
+ OnBeginTest (testContext);
+
+ try {
+ foreach (UnitTest t in Tests) {
+ if (t.IsExplicit)
+ continue;
+ UnitTestResult res;
+ try {
+ res = OnRunChildTest (t, testContext);
+ if (testContext.Monitor.CancellationToken.IsCancellationRequested)
+ break;
+ } catch (Exception ex) {
+ res = UnitTestResult.CreateFailure (ex);
+ }
+ tres.Add (res);
+ }
+ } finally {
+ OnEndTest (testContext);
+ }
+ return tres;
+ }
+
+ protected override bool OnCanRun (MonoDevelop.Core.Execution.IExecutionHandler executionContext)
+ {
+ foreach (UnitTest t in Tests)
+ if (!t.CanRun (executionContext))
+ return false;
+ return true;
+ }
+
+
+ protected virtual void OnBeginTest (TestContext testContext)
+ {
+ }
+
+ protected virtual UnitTestResult OnRunChildTest (UnitTest test, TestContext testContext)
+ {
+ return test.Run (testContext);
+ }
+
+ protected virtual void OnEndTest (TestContext testContext)
+ {
+ }
+
+ internal override void FindRegressions (UnitTestCollection list, DateTime fromDate, DateTime toDate)
+ {
+ foreach (UnitTest test in Tests)
+ test.FindRegressions (list, fromDate, toDate);
+ }
+
+ public override void Dispose ()
+ {
+ base.Dispose ();
+
+ if (tests != null) {
+ foreach (UnitTest t in tests)
+ t.Dispose ();
+ }
+ }
+
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestMarkersExtension.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestMarkersExtension.cs
new file mode 100644
index 0000000000..530bc19deb
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestMarkersExtension.cs
@@ -0,0 +1,50 @@
+//
+// UnitTestMarkersExtension.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Mono.Addins;
+
+namespace MonoDevelop.UnitTesting
+{
+ class UnitTestMarkersExtension: ExtensionNode, IUnitTestMarkers
+ {
+ [NodeAttribute ("testMethodAttributeMarker")]
+ public string TestMethodAttributeMarker { get; set; }
+
+ [NodeAttribute ("testCaseMethodAttributeMarker")]
+ public string TestCaseMethodAttributeMarker { get; set; }
+
+ [NodeAttribute ("ignoreTestMethodAttributeMarker")]
+ public string IgnoreTestMethodAttributeMarker { get; set; }
+
+ [NodeAttribute ("ignoreTestClassAttributeMarker")]
+ public string IgnoreTestClassAttributeMarker { get; set; }
+
+ public UnitTestMarkersExtension ()
+ {
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestProjectServiceExtension.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestProjectServiceExtension.cs
new file mode 100644
index 0000000000..ed258d9b9a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestProjectServiceExtension.cs
@@ -0,0 +1,131 @@
+// NUnitProjectServiceExtension.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+using MonoDevelop.Core;
+using MonoDevelop.Projects;
+using MonoDevelop.Ide;
+using System.Threading.Tasks;
+using System.Threading;
+using System.Runtime.InteropServices;
+
+namespace MonoDevelop.UnitTesting
+{
+ public class UnitTestProjectServiceExtension: ProjectExtension
+ {
+ bool checkingCanExecute;
+ object canExecuteCheckLock = new object ();
+
+ bool unitTestChecked;
+ UnitTest unitTestFound;
+
+ protected override bool SupportsObject (WorkspaceObject item)
+ {
+ return IdeApp.IsInitialized && base.SupportsObject (item);
+ }
+
+ protected override void Initialize ()
+ {
+ base.Initialize ();
+ if (IdeApp.IsInitialized)
+ UnitTestService.TestSuiteChanged += TestSuiteChanged;
+ }
+
+ public override void Dispose ()
+ {
+ base.Dispose ();
+ if (IdeApp.IsInitialized)
+ UnitTestService.TestSuiteChanged -= TestSuiteChanged;
+ }
+
+ void TestSuiteChanged (object sender, System.EventArgs e)
+ {
+ unitTestChecked = false;
+ unitTestFound = null;
+ }
+
+ UnitTest FindRootTest ()
+ {
+ if (!unitTestChecked) {
+ unitTestFound = UnitTestService.FindRootTest (Project);
+ unitTestChecked = true;
+ }
+ return unitTestFound;
+ }
+
+ protected override async Task OnExecute (MonoDevelop.Core.ProgressMonitor monitor, MonoDevelop.Projects.ExecutionContext context, ConfigurationSelector configuration)
+ {
+ bool defaultCanExecute;
+
+ lock (canExecuteCheckLock) {
+ try {
+ checkingCanExecute = true;
+ defaultCanExecute = Project.CanExecute (context, configuration);
+ } finally {
+ checkingCanExecute = false;
+ }
+ }
+ if (defaultCanExecute) {
+ // It is executable by default
+ await base.OnExecute (monitor, context, configuration);
+ return;
+ }
+ UnitTest test = FindRootTest ();
+ if (test != null) {
+ var cs = new CancellationTokenSource ();
+ using (monitor.CancellationToken.Register (cs.Cancel))
+ await UnitTestService.RunTest (test, context, false, false, cs);
+ }
+ }
+
+ protected override ProjectFeatures OnGetSupportedFeatures ()
+ {
+ var sf = base.OnGetSupportedFeatures ();
+ if (!sf.HasFlag (ProjectFeatures.Execute)) {
+ // Unit test projects support execution
+ UnitTest test = FindRootTest ();
+ if (test != null)
+ sf |= ProjectFeatures.Execute;
+ }
+ return sf;
+ }
+
+ protected override bool OnGetCanExecute (MonoDevelop.Projects.ExecutionContext context, ConfigurationSelector configuration)
+ {
+ // We check for DefaultExecutionHandlerFactory because the tests can't run using any other execution mode
+
+ var res = base.OnGetCanExecute (context, configuration);
+ lock (canExecuteCheckLock) {
+ if (checkingCanExecute)
+ return res;
+ }
+ if (res)
+ return true;
+ UnitTest test = FindRootTest ();
+ return (test != null) && test.CanRun (context.ExecutionHandler);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestResult.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestResult.cs
new file mode 100644
index 0000000000..f20f1e19fc
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestResult.cs
@@ -0,0 +1,226 @@
+//
+// UnitTestResult.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+using System.Collections;
+using System.Xml.Serialization;
+using System.Globalization;
+using System.Text.RegularExpressions;
+
+namespace MonoDevelop.UnitTesting
+{
+ [Serializable]
+ public class UnitTestResult
+ {
+ DateTime testDate;
+ ResultStatus status;
+ TimeSpan time;
+ string message;
+ string output;
+ string stackTrace;
+ string cerror;
+
+ public UnitTestResult ()
+ {
+ }
+
+ public static UnitTestResult CreateFailure (Exception ex)
+ {
+ UnitTestResult res = new UnitTestResult ();
+ res.status = ResultStatus.Failure;
+ res.Message = ex.Message;
+ res.stackTrace = ex.StackTrace;
+ return res;
+ }
+
+ public static UnitTestResult CreateFailure (string message, Exception ex)
+ {
+ UnitTestResult res = new UnitTestResult ();
+ res.status = ResultStatus.Failure;
+ res.Message = message;
+ if (ex != null)
+ res.stackTrace = ex.Message + "\n" + ex.StackTrace;
+ return res;
+ }
+
+ public static UnitTestResult CreateIgnored (string message)
+ {
+ UnitTestResult res = new UnitTestResult ();
+ res.status = ResultStatus.Ignored;
+ res.Message = message;
+ return res;
+ }
+
+ public static UnitTestResult CreateInconclusive (string message)
+ {
+ UnitTestResult res = new UnitTestResult ();
+ res.status = ResultStatus.Inconclusive;
+ res.Message = message;
+ return res;
+ }
+
+ public static UnitTestResult CreateSuccess ()
+ {
+ UnitTestResult res = new UnitTestResult ();
+ res.status = ResultStatus.Success;
+ return res;
+ }
+
+ public DateTime TestDate {
+ get { return testDate; }
+ set { testDate = value; }
+ }
+
+ public ResultStatus Status {
+ get { return status; }
+ set { status = value; }
+ }
+
+ public bool IsFailure {
+ get { return ErrorsAndFailures > 0; }
+ }
+
+ public bool IsSuccess {
+ get { return ErrorsAndFailures == 0 && Passed > 0; }
+ }
+
+ public bool IsInconclusive {
+ get { return Passed == 0 && ErrorsAndFailures == 0 && Inconclusive > 0; }
+ }
+
+ public bool IsNotRun {
+ get {
+ return Passed == 0 && ErrorsAndFailures == 0 && TestsNotRun > 0;
+ }
+ }
+
+ public int Passed {
+ get;
+ set;
+ }
+
+ public int Errors {
+ get;
+ set;
+ }
+
+ public int Failures {
+ get;
+ set;
+ }
+
+ public int ErrorsAndFailures {
+ get {
+ return Errors + Failures;
+ }
+ }
+
+ public int TestsNotRun {
+ get {
+ return Ignored + NotRunnable + Skipped;
+ }
+ }
+
+ public int Inconclusive {
+ get;
+ set;
+ }
+
+ public int NotRunnable {
+ get;
+ set;
+ }
+
+ public int Skipped {
+ get;
+ set;
+ }
+
+ public int Ignored {
+ get;
+ set;
+ }
+
+ public TimeSpan Time {
+ get { return time; }
+ set { time = value; }
+ }
+
+ public string Message {
+ get { return message; }
+ set { message = value; }
+ }
+
+ public string StackTrace {
+ get { return stackTrace; }
+ set { stackTrace = value; }
+ }
+
+ public string ConsoleOutput {
+ get { return output; }
+ set { output = value; }
+ }
+
+ public string ConsoleError {
+ get { return cerror; }
+ set { cerror = value; }
+ }
+
+ public SourceCodeLocation GetFailureLocation ()
+ {
+ if (string.IsNullOrEmpty (stackTrace))
+ return null;
+ string[] stackLines = stackTrace.Replace ("\r", "").Split ('\n');
+ foreach (string line in stackLines) {
+ if (line.IndexOf ("NUnit.Framework") != -1)
+ continue;
+ Regex r = new Regex (@".*?\(.*?\)\s\[.*?\]\s.*?\s(?<file>.*)\:(?<line>\d*)");
+ Match m = r.Match (line);
+ if (m.Groups ["file"] != null && m.Groups ["line"] != null && File.Exists (m.Groups ["file"].Value)) {
+ int lin;
+ if (int.TryParse (m.Groups ["line"].Value, out lin))
+ return new SourceCodeLocation (m.Groups ["file"].Value, lin, -1);
+ }
+ }
+ return null;
+ }
+
+ public void Add (UnitTestResult res)
+ {
+ Time += res.Time;
+ Passed += res.Passed;
+ Errors += res.Errors;
+ Failures += res.Failures;
+ Ignored += res.Ignored;
+ Inconclusive += res.Inconclusive;
+ Skipped += res.Skipped;
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestResultsStore.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestResultsStore.cs
new file mode 100644
index 0000000000..5cadb15f39
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestResultsStore.cs
@@ -0,0 +1,76 @@
+//
+// TestNodeBuilder.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+using System;
+
+namespace MonoDevelop.UnitTesting
+{
+ public class UnitTestResultsStore
+ {
+ UnitTest test;
+ IResultsStore store;
+
+ internal UnitTestResultsStore (UnitTest test, IResultsStore store)
+ {
+ this.test = test;
+ this.store = store;
+ }
+
+ public UnitTestResult GetLastResult (DateTime date)
+ {
+ if (store == null) return null;
+ return store.GetLastResult (test.ActiveConfiguration, test, date);
+ }
+
+ public UnitTestResult GetNextResult (DateTime date)
+ {
+ if (store == null) return null;
+ return store.GetNextResult (test.ActiveConfiguration, test, date);
+ }
+
+ public UnitTestResult GetPreviousResult (DateTime date)
+ {
+ if (store == null) return null;
+ return store.GetPreviousResult (test.ActiveConfiguration, test, date);
+ }
+
+ public UnitTestResult[] GetResults (DateTime startDate, DateTime endDate)
+ {
+ if (store == null) return new UnitTestResult [0];
+ return store.GetResults (test.ActiveConfiguration, test, startDate, endDate);
+ }
+
+ public UnitTestResult[] GetResultsToDate (DateTime endDate, int count)
+ {
+ if (store == null) return new UnitTestResult [0];
+ return store.GetResultsToDate (test.ActiveConfiguration, test, endDate, count);
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestService.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestService.cs
new file mode 100644
index 0000000000..5816721bcf
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestService.cs
@@ -0,0 +1,459 @@
+//
+// NUnitService.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Threading;
+
+using MonoDevelop.Core;
+using MonoDevelop.Core.Execution;
+using Mono.Addins;
+using MonoDevelop.Projects;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide;
+using System.Threading.Tasks;
+using System.Linq;
+using MonoDevelop.Ide.TypeSystem;
+using System.IO;
+using MonoDevelop.Ide.Gui.Components;
+
+namespace MonoDevelop.UnitTesting
+{
+ public static class UnitTestService
+ {
+ static ArrayList providers = new ArrayList ();
+ static UnitTest[] rootTests;
+
+ static UnitTestService ()
+ {
+ IdeApp.Workspace.WorkspaceItemOpened += OnWorkspaceChanged;
+ IdeApp.Workspace.WorkspaceItemClosed += OnWorkspaceChanged;
+ IdeApp.Workspace.ActiveConfigurationChanged += OnWorkspaceChanged;
+
+ IdeApp.Workspace.ItemAddedToSolution += OnItemsChangedInSolution;;
+ IdeApp.Workspace.ItemRemovedFromSolution += OnItemsChangedInSolution;
+ IdeApp.Workspace.ReferenceAddedToProject += OnReferenceChangedInProject;;
+ IdeApp.Workspace.ReferenceRemovedFromProject += OnReferenceChangedInProject;
+
+ Mono.Addins.AddinManager.AddExtensionNodeHandler ("/MonoDevelop/UnitTesting/TestProviders", OnExtensionChange);
+
+ RebuildTests ();
+ }
+
+ static void OnExtensionChange (object s, ExtensionNodeEventArgs args)
+ {
+ if (args.Change == ExtensionChange.Add) {
+ ProjectService ps = MonoDevelop.Projects.Services.ProjectService;
+ ITestProvider provider = args.ExtensionObject as ITestProvider;
+ providers.Add (provider);
+ }
+ else {
+ ITestProvider provider = args.ExtensionObject as ITestProvider;
+ providers.Remove (provider);
+ provider.Dispose ();
+ }
+ }
+
+ public static UnitTest CurrentSelectedTest {
+ get {
+ var pad = IdeApp.Workbench.GetPad<TestPad> ();
+ pad.BringToFront ();
+ TestPad testPad = (TestPad)pad.Content;
+ ITreeNavigator nav = testPad.TreeView.GetSelectedNode ();
+ if (nav != null)
+ return nav.DataItem as UnitTest;
+ return null;
+ }
+ set {
+ var pad = IdeApp.Workbench.GetPad<TestPad> ();
+ pad.BringToFront ();
+ var content = (TestPad)pad.Content;
+ content.SelectTest (value);
+ }
+ }
+
+ public static AsyncOperation RunTest (UnitTest test, MonoDevelop.Projects.ExecutionContext context)
+ {
+ var result = RunTest (test, context, IdeApp.Preferences.BuildBeforeRunningTests);
+ result.Task.ContinueWith (t => OnTestSessionCompleted (), TaskScheduler.FromCurrentSynchronizationContext ());
+ return result;
+ }
+
+ public static AsyncOperation RunTest (UnitTest test, MonoDevelop.Projects.ExecutionContext context, bool buildOwnerObject)
+ {
+ var cs = new CancellationTokenSource ();
+ return new AsyncOperation (RunTest (test, context, buildOwnerObject, true, cs), cs);
+ }
+
+ internal static async Task RunTest (UnitTest test, MonoDevelop.Projects.ExecutionContext context, bool buildOwnerObject, bool checkCurrentRunOperation, CancellationTokenSource cs)
+ {
+ string testName = test.FullName;
+
+ if (buildOwnerObject) {
+ IBuildTarget bt = test.OwnerObject as IBuildTarget;
+ if (bt != null) {
+ if (!IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted) {
+ MonoDevelop.Ide.Commands.StopHandler.StopBuildOperations ();
+ await IdeApp.ProjectOperations.CurrentRunOperation.Task;
+ }
+
+ var res = await IdeApp.ProjectOperations.Build (bt, cs.Token).Task;
+ if (res.HasErrors)
+ return;
+
+ await RefreshTests (cs.Token);
+ test = SearchTest (testName);
+ if (test != null)
+ await RunTest (test, context, false, checkCurrentRunOperation, cs);
+ return;
+ }
+ }
+
+ if (checkCurrentRunOperation && !IdeApp.ProjectOperations.ConfirmExecutionOperation ())
+ return;
+
+ Pad resultsPad = IdeApp.Workbench.GetPad <TestResultsPad>();
+ if (resultsPad == null) {
+ resultsPad = IdeApp.Workbench.ShowPad (new TestResultsPad (), "MonoDevelop.UnitTesting.TestResultsPad", GettextCatalog.GetString ("Test results"), "Bottom", "md-solution");
+ }
+
+ // Make the pad sticky while the tests are runnig, so the results pad is always visible (even if minimized)
+ // That's required since when running in debug mode, the layout is automatically switched to debug.
+
+ resultsPad.Sticky = true;
+ resultsPad.BringToFront ();
+
+ TestSession session = new TestSession (test, context, (TestResultsPad) resultsPad.Content, cs);
+
+ OnTestSessionStarting (new TestSessionEventArgs { Session = session, Test = test });
+
+ if (checkCurrentRunOperation)
+ IdeApp.ProjectOperations.CurrentRunOperation = session;
+
+ try {
+ await session.Start ();
+ } finally {
+ resultsPad.Sticky = false;
+ }
+ }
+
+ /// <summary>
+ /// For each node already in the test tree, it checks if there is any change. If there is, it reloads the test.
+ /// </summary>
+ public static Task RefreshTests (CancellationToken ct)
+ {
+ return Task.WhenAll (RootTests.Select (t => t.Refresh (ct)));
+ }
+
+ /// <summary>
+ /// Reloads the test tree, creating new test branches if necessary
+ /// </summary>
+ public static void ReloadTests ()
+ {
+ foreach (var t in RootTests.OfType<UnitTestGroup> ())
+ t.UpdateTests ();
+ }
+
+ public static UnitTest SearchTest (string fullName)
+ {
+ foreach (UnitTest t in RootTests) {
+ UnitTest r = SearchTest (t, fullName);
+ if (r != null)
+ return r;
+ }
+ return null;
+ }
+
+ public static UnitTest SearchTestById (string id)
+ {
+ foreach (UnitTest t in RootTests) {
+ UnitTest r = SearchTestById (t, id);
+ if (r != null)
+ return r;
+ }
+ return null;
+ }
+
+
+ static UnitTest SearchTest (UnitTest test, string fullName)
+ {
+ if (test == null)
+ return null;
+ if (test.FullName == fullName)
+ return test;
+
+ UnitTestGroup group = test as UnitTestGroup;
+ if (group != null) {
+ foreach (UnitTest t in group.Tests) {
+ UnitTest result = SearchTest (t, fullName);
+ if (result != null)
+ return result;
+ }
+ }
+ return null;
+ }
+
+ static UnitTest SearchTestById (UnitTest test, string id)
+ {
+ if (test == null)
+ return null;
+ if (test.TestId == id)
+ return test;
+
+ UnitTestGroup group = test as UnitTestGroup;
+ if (group != null) {
+ foreach (UnitTest t in group.Tests) {
+ UnitTest result = SearchTestById (t, id);
+ if (result != null)
+ return result;
+ }
+ }
+ return null;
+ }
+
+ public static UnitTest FindRootTest (WorkspaceObject item)
+ {
+ return FindRootTest (RootTests, item);
+ }
+
+ public static UnitTest FindRootTest (IEnumerable<UnitTest> tests, WorkspaceObject item)
+ {
+ foreach (UnitTest t in tests) {
+ if (t.OwnerObject == item)
+ return t;
+ UnitTestGroup tg = t as UnitTestGroup;
+ if (tg != null) {
+ UnitTest ct = FindRootTest (tg.Tests, item);
+ if (ct != null)
+ return ct;
+ }
+ }
+ return null;
+ }
+
+ static void OnWorkspaceChanged (object sender, EventArgs e)
+ {
+ RebuildTests ();
+ }
+
+ static void OnReferenceChangedInProject (object sender, ProjectReferenceEventArgs e)
+ {
+ if (!IsSolutionGroupPresent (e.Project.ParentSolution, rootTests))
+ RebuildTests ();
+ }
+
+ static void OnItemsChangedInSolution (object sender, SolutionItemChangeEventArgs e)
+ {
+ if (!IsSolutionGroupPresent (e.Solution, rootTests))
+ RebuildTests ();
+ }
+
+ static bool IsSolutionGroupPresent (Solution sol, IEnumerable<UnitTest> tests)
+ {
+ foreach (var t in tests) {
+ var tg = t as SolutionFolderTestGroup;
+ if (tg != null && ((SolutionFolder)tg.OwnerObject).ParentSolution == sol)
+ return true;
+ var g = t as UnitTestGroup;
+ if (g != null && g.HasTests) {
+ if (IsSolutionGroupPresent (sol, g.Tests))
+ return true;
+ }
+ }
+ return false;
+ }
+
+ static void RebuildTests ()
+ {
+ if (rootTests != null) {
+ foreach (IDisposable t in rootTests)
+ t.Dispose ();
+ }
+
+ List<UnitTest> list = new List<UnitTest> ();
+ foreach (WorkspaceItem it in IdeApp.Workspace.Items) {
+ UnitTest t = BuildTest (it);
+ if (t != null)
+ list.Add (t);
+ }
+
+ rootTests = list.ToArray ();
+ NotifyTestSuiteChanged ();
+ }
+
+ public static UnitTest BuildTest (WorkspaceObject entry)
+ {
+ foreach (ITestProvider p in providers) {
+ try {
+ UnitTest t = p.CreateUnitTest (entry);
+ if (t != null)
+ return t;
+ } catch {
+ }
+ }
+ return null;
+ }
+
+ public static string GetTestResultsDirectory (string baseDirectory)
+ {
+ var newCache = TypeSystemService.GetCacheDirectory (baseDirectory, false);
+ if (newCache == null) {
+ newCache = TypeSystemService.GetCacheDirectory (baseDirectory, true);
+ var oldDirectory = Path.Combine (baseDirectory, "test-results");
+ var newDirectory = Path.Combine (newCache, "test-results");
+ try {
+ Directory.CreateDirectory (newDirectory);
+ if (Directory.Exists (oldDirectory)) {
+ foreach (string file in Directory.GetFiles(oldDirectory, "*.*"))
+ File.Copy (file, file.Replace (oldDirectory, newDirectory));
+ }
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while copying old test-results", e);
+ }
+ return newDirectory;
+ }
+
+ return Path.Combine (newCache, "test-results");
+ }
+
+
+ public static UnitTest[] RootTests {
+ get { return rootTests; }
+ }
+
+ static void NotifyTestSuiteChanged ()
+ {
+ Runtime.RunInMainThread (() => {
+ if (TestSuiteChanged != null)
+ TestSuiteChanged (null, EventArgs.Empty);
+ });
+ }
+
+ public static void ResetResult (UnitTest test)
+ {
+ if (test == null)
+ return;
+ test.ResetLastResult ();
+ UnitTestGroup group = test as UnitTestGroup;
+ if (group == null)
+ return;
+ foreach (UnitTest t in new List<UnitTest> (group.Tests))
+ ResetResult (t);
+ }
+
+ public static event EventHandler TestSuiteChanged;
+
+ static void OnTestSessionCompleted ()
+ {
+ var handler = TestSessionCompleted;
+ if (handler != null)
+ handler (null, EventArgs.Empty);
+ }
+
+ public static event EventHandler TestSessionCompleted;
+
+ static void OnTestSessionStarting (TestSessionEventArgs args)
+ {
+ if (TestSessionStarting != null)
+ TestSessionStarting (null, args);
+ }
+
+ /// <summary>
+ /// Occurs just before a test session is started
+ /// </summary>
+ public static event EventHandler<TestSessionEventArgs> TestSessionStarting;
+ }
+
+
+
+ class TestSession: AsyncOperation
+ {
+ UnitTest test;
+ TestMonitor monitor;
+ MonoDevelop.Projects.ExecutionContext context;
+ TestResultsPad resultsPad;
+
+ public TestSession (UnitTest test, MonoDevelop.Projects.ExecutionContext context, TestResultsPad resultsPad, CancellationTokenSource cs)
+ {
+ this.test = test;
+ this.context = new Projects.ExecutionContext (context.ExecutionHandler, new CustomConsoleFactory (context.ConsoleFactory, cs), context.ExecutionTarget);
+ CancellationTokenSource = cs;
+ this.monitor = new TestMonitor (resultsPad, CancellationTokenSource);
+ this.resultsPad = resultsPad;
+ resultsPad.InitializeTestRun (test, cs);
+ Task = new Task ((Action)RunTests);
+ }
+
+ public Task Start ()
+ {
+ Task.Start ();
+ return Task;
+ }
+
+ void RunTests ()
+ {
+ try {
+ UnitTestService.ResetResult (test);
+
+ TestContext ctx = new TestContext (monitor, resultsPad, context, DateTime.Now);
+ test.Run (ctx);
+ test.SaveResults ();
+ } catch (Exception ex) {
+ LoggingService.LogError (ex.ToString ());
+ monitor.ReportRuntimeError (null, ex);
+ } finally {
+ monitor.FinishTestRun ();
+ }
+ }
+ }
+
+ public class TestSessionEventArgs: EventArgs
+ {
+ public AsyncOperation Session { get; set; }
+ public UnitTest Test { get; set; }
+ }
+
+ class CustomConsoleFactory : OperationConsoleFactory
+ {
+ OperationConsoleFactory factory;
+ CancellationTokenSource cancelSource;
+
+ public CustomConsoleFactory (OperationConsoleFactory factory, CancellationTokenSource cs)
+ {
+ this.factory = factory;
+ cancelSource = cs;
+ }
+
+ protected override OperationConsole OnCreateConsole (CreateConsoleOptions options)
+ {
+ return factory.CreateConsole (options.WithBringToFront (false)).WithCancelCallback (cancelSource.Cancel);
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestStatus.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestStatus.cs
new file mode 100644
index 0000000000..b3cea6e526
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestStatus.cs
@@ -0,0 +1,50 @@
+//
+// TestStatus.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace MonoDevelop.UnitTesting
+{
+ public enum TestStatus
+ {
+ Ready,
+ Loading,
+ LoadError,
+ Running
+ }
+
+ [Flags]
+ public enum ResultStatus
+ {
+ Success = 1,
+ Failure = 2,
+ Ignored = 4,
+ Inconclusive = 8
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/WorkspaceTestGroup.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/WorkspaceTestGroup.cs
new file mode 100644
index 0000000000..1b41f224ab
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/Services/WorkspaceTestGroup.cs
@@ -0,0 +1,85 @@
+//
+// WorkspaceTestGroup.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using MonoDevelop.Projects;
+
+
+namespace MonoDevelop.UnitTesting
+{
+ public class WorkspaceTestGroup: UnitTestGroup
+ {
+ Workspace workspace;
+
+ public WorkspaceTestGroup (Workspace ws): base (ws.Name, ws)
+ {
+ string storeId = ws.Name;
+ string resultsPath = UnitTestService.GetTestResultsDirectory (ws.BaseDirectory);
+ ResultsStore = new BinaryResultsStore (resultsPath, storeId);
+
+ workspace = ws;
+ workspace.ItemAdded += OnEntryChanged;
+ workspace.ItemRemoved += OnEntryChanged;
+ workspace.NameChanged += OnCombineRenamed;
+ }
+
+ public static WorkspaceTestGroup CreateTest (Workspace ws)
+ {
+ return new WorkspaceTestGroup (ws);
+ }
+
+ public override void Dispose ()
+ {
+ workspace.ItemAdded -= OnEntryChanged;
+ workspace.ItemRemoved -= OnEntryChanged;
+ workspace.NameChanged -= OnCombineRenamed;
+ base.Dispose ();
+ }
+
+ void OnEntryChanged (object sender, WorkspaceItemEventArgs e)
+ {
+ UpdateTests ();
+ }
+
+ void OnCombineRenamed (object sender, WorkspaceItemRenamedEventArgs e)
+ {
+ UnitTestGroup parent = Parent as UnitTestGroup;
+ if (parent != null)
+ parent.UpdateTests ();
+ }
+
+ protected override void OnCreateTests ()
+ {
+ foreach (WorkspaceItem e in workspace.Items) {
+ UnitTest t = UnitTestService.BuildTest (e);
+ if (t != null)
+ Tests.Add (t);
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/NUnit/TODO b/main/src/addins/MonoDevelop.UnitTesting/TODO
index c33f3d3595..c33f3d3595 100644
--- a/main/src/addins/NUnit/TODO
+++ b/main/src/addins/MonoDevelop.UnitTesting/TODO
diff --git a/main/src/addins/MonoDevelop.UnitTesting/gtk-gui/generated.cs b/main/src/addins/MonoDevelop.UnitTesting/gtk-gui/generated.cs
new file mode 100644
index 0000000000..9ef3363981
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/gtk-gui/generated.cs
@@ -0,0 +1,29 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace Stetic
+{
+ internal class Gui
+ {
+ private static bool initialized;
+
+ internal static void Initialize (Gtk.Widget iconRenderer)
+ {
+ if ((Stetic.Gui.initialized == false)) {
+ Stetic.Gui.initialized = true;
+ }
+ }
+ }
+
+ internal class ActionGroups
+ {
+ public static Gtk.ActionGroup GetActionGroup (System.Type type)
+ {
+ return Stetic.ActionGroups.GetActionGroup (type.FullName);
+ }
+
+ public static Gtk.ActionGroup GetActionGroup (string name)
+ {
+ return null;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.UnitTesting/gtk-gui/gui.stetic b/main/src/addins/MonoDevelop.UnitTesting/gtk-gui/gui.stetic
new file mode 100644
index 0000000000..53835b10dd
--- /dev/null
+++ b/main/src/addins/MonoDevelop.UnitTesting/gtk-gui/gui.stetic
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<stetic-interface>
+ <configuration>
+ <images-root-path>..</images-root-path>
+ <target-gtk-version>2.12</target-gtk-version>
+ </configuration>
+ <import>
+ <widget-library name="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <widget-library name="../../../../build/bin/MonoDevelop.Ide.dll" />
+ <widget-library name="../../../../build/bin/Mono.TextEditor.dll" />
+ <widget-library name="../../../../build/AddIns/NUnit/MonoDevelop.NUnit.dll" internal="true" />
+ </import>
+</stetic-interface> \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.WebReferences/ChangeLog b/main/src/addins/MonoDevelop.WebReferences/ChangeLog
deleted file mode 100644
index 7f2e5ec7cf..0000000000
--- a/main/src/addins/MonoDevelop.WebReferences/ChangeLog
+++ /dev/null
@@ -1,655 +0,0 @@
-2010-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs: Fix
- incorrect use of ShowCustomDialog/RunCustomDialog.
-
-2010-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs:
- Fix build.
-
-2010-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs:
- Properly destroy the web reference dialog.
-
-2010-05-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs:
- * MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs:
- More dialog placing.
-
-2010-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Flush.
-
-2010-05-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.WS/WebServiceDiscoveryResultWS.cs:
- * MonoDevelop.WebReferences.WCF/WebServiceDiscoveryResultWCF.cs:
- Use correct namespace when updating a web reference. Fixes
- bug #605942 - Refreshing .NET 2.0 Web Service causes
- additional class nesting.
-
-2010-04-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.WCF/WebServiceDiscoveryResultWCF.cs:
- Fix build.
-
-2010-04-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.WebReferences.WS:
- * MonoDevelop.WebReferences.WCF:
- * MonoDevelop.WebReferences.csproj:
- * MonoDevelop.WebReferences.addin.xml:
- * MonoDevelop.WebReferences.WCF/WCFMetadata.cs:
- * MonoDevelop.WebReferences/WebReferenceItem.cs:
- * MonoDevelop.WebReferences/WebServiceEngine.cs:
- * MonoDevelop.WebReferences.WS/WebReferences.cs:
- * MonoDevelop.WebReferences.WCF/MetadataFile.cs:
- * MonoDevelop.WebReferences.WCF/ExtensionFile.cs:
- * MonoDevelop.WebReferences.WCF/ClientOptions.cs:
- * MonoDevelop.WebReferences/WebServiceEngineWS.cs:
- * MonoDevelop.WebReferences.WS/WebReferenceUrl.cs:
- * MonoDevelop.WebReferences/WebReferenceFolder.cs:
- * MonoDevelop.WebReferences.WCF/ReferenceGroup.cs:
- * MonoDevelop.WebReferences.WCF/MetadataSource.cs:
- * MonoDevelop.WebReferences/WebServiceEngineWCF.cs:
- * MonoDevelop.WebReferences/WebReferencesService.cs:
- * MonoDevelop.WebReferences.WCF/CollectionMapping.cs:
- * MonoDevelop.WebReferences.WS/WebServiceEngineWS.cs:
- * MonoDevelop.WebReferences.WCF/WCFMetadataStorage.cs:
- * MonoDevelop.WebReferences.WCF/ReferencedAssembly.cs:
- * MonoDevelop.WebReferences.WCF/WebServiceEngineWCF.cs:
- * MonoDevelop.WebReferences/WebServiceDiscoveryResult.cs:
- * MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs:
- * MonoDevelop.WebReferences/WebReferenceItemCollection.cs:
- * MonoDevelop.WebReferences.WS/WebServiceDiscoveryResultWS.cs:
- * MonoDevelop.WebReferences.NodeBuilders/ProjectNodeBuilder.cs:
- * MonoDevelop.WebReferences.WCF/WebServiceDiscoveryResultWCF.cs:
- * MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs:
- * MonoDevelop.WebReferences.NodeBuilders/WebReferenceFolderNodeBuilder.cs:
- * MonoDevelop.WebReferences.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- Improved compatibility. VS can now properly open projects
- with web references created with MD, and vice-versa.
- Reorganized a bit the code.
-
-2010-04-23 Carlo Kok <ck@remobjects.com>
- * Makefile.am:
- * MonoDevelop.WebReferences.csproj:
- Add missing System.Configuration reference.
-
-2010-04-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.WebReferences.csproj:
- * MonoDevelop.WebReferences.Resources/WebReference.png:
- * MonoDevelop.WebReferences.Resources/WebReferenceItem.VS.png:
- * MonoDevelop.WebReferences.Resources/WebReference.Service.png:
- * MonoDevelop.WebReferences.Resources/WebReference.File.Wsdl.png:
- * MonoDevelop.WebReferences.Resources/WebReference.File.Disco.png:
- * MonoDevelop.WebReferences.Resources/WebReferenceFolder.Open.png:
- * gtk-gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs:
- * MonoDevelop.WebReferences.Resources/WebReferenceFolder.Closed.png:
- Remove unused icons.
-
- * MonoDevelop.WebReferences/WebServiceEngineWCF.cs:
- * MonoDevelop.WebReferences/MoonlightChannelBaseExtension.cs:
- Add support for moonlight and monotouch proxies.
-
-2010-04-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.WebReferences.csproj:
- * MonoDevelop.WebReferences/CodeGenerator.cs:
- * MonoDevelop.WebReferences/WebServiceEngine.cs:
- * MonoDevelop.WebReferences/WebReferenceItem.cs:
- * MonoDevelop.WebReferences/WebServiceEngineWS.cs:
- * MonoDevelop.WebReferences/WebServiceEngineWCF.cs:
- * MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs:
- * MonoDevelop.WebReferences/WebReferenceItemCollection.cs:
- * gtk-gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs:
- * MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs:
- * MonoDevelop.WebReferences.NodeBuilders/WebReferenceFolderNodeBuilder.cs:
- Add support for WCF references.
-
-2010-04-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs: Log
- the error.
-
-2010-04-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs:
- Show an error message if DiscoverAny fails. Fixes bug
- #590375 - Add Web Reference dialog silently swallows errors.
-
-2010-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences/WebReferenceItem.cs: Fix warning.
-
- * MonoDevelop.WebReferences/WebReferenceItemCollection.cs:
- Simplify.
-
- * MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs:
- Ask for confirmation before deleting a web reference.
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs:
- Don't allow duplicate reference names.
-
- * gtk-gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs:
- Don't allow duplicate reference names. Fixes bug #582487 -
- Web reference cannot be deleted.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.WebReferences.addin.xml: Bumped MD version.
-
-2010-03-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs:
- Use the correct reference name for comparing. Fixes bug
- #583009 - WebReferenceCommandHandler duplicates references.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.WebReferences.csproj:
- * MonoDevelop.WebReferences.addin.xml:
- * MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs:
- * MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs:
- * MonoDevelop.WebReferences.NodeBuilders/WebReferenceNodeBuilder.cs:
- * MonoDevelop.WebReferences.NodeBuilders/WebReferenceFolderNodeBuilder.cs:
- Merged MD.Projects into MD.Core, and MD.Projects.Gui,
- MD.Core.Gui and MD.Components into MD.Ide.
-
-2010-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.WebReferences.csproj:
- * MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs:
- * MonoDevelop.WebReferences.Dialogs/UserPasswordDialog.cs:
- * gtk-gui/MonoDevelop.WebReferences.Dialogs.UserPasswordDialog.cs:
- Add support for basic authentication.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs:
- Flush.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.WebReferences/CodeGenerator.cs: Fix spelling
- typo.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.WebReferences.addin.xml: Bump MD version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * MonoDevelop.WebReferences.csproj:
- * gtk-gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs:
- Flush.
-
-2009-10-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs:
- Don't generate invalid namespace names. Hide the navigation
- toolbar if we have no browser.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.WebReferences.addin.xml: Bump MD version.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.csproj: Updated dependencies. We
- now depend on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences\Library.cs: Fix cast exception on
- MS.NET.
-
-2009-08-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs:
- Before adding refs, resolve them against the target
- framework.
-
-2009-08-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences/Library.cs: VS uses "Web
- References" instead of "WebReferences"
-
- * MonoDevelop.WebReferences/DiscoveryProtocol.cs: Ignore
- unknown discovery results.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs:
- Flush.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences\Library.cs:
- * MonoDevelop.WebReferences\WebReferenceItemCollection.cs:
- * MonoDevelop.WebReferences.NodeBuilders\WebReferenceFolderNodeBuilder.cs:
- Use the new FilePath class for handling file and directory
- paths.
-
-2009-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.WebReferences/WebReferenceItem.cs: fixed
- compilation error.
-
-2009-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.WebReferences/WebReferenceItem.cs: Applied patch
- from Luciano N. Callero <lnc19@hotmail.com> : "Fix Web
- Reference Update bug that prevent a web reference from being
- update."
-
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.WebReferences.csproj: don't require specific
- gtk-sharp version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.WebReferences.addin.xml: Bump MD version.
-
-2009-03-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs:
- Fix framework IDs.
-
-2009-02-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.addin.xml: Track merge of the
- project pad context menu.
-
-2009-02-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs: Flush.
-
-2009-02-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences/CodeGenerator.cs: Properly fix
- warning.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.WebReferences.csproj: Make implicit references
- explicit. Csc is much pickier about these.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.WebReferences.csproj: Remove invalid
- ApplicationIcon value that broke the build in VS.
-
-2009-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.WebReferences/CodeGenerator.cs:
- * MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs:
- * gtk-gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs:
- Fixed compiler warnings
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.mds:
- * MonoDevelop.WebReferences.mdp:
- * MonoDevelop.WebReferences.csproj: Migrated to MSBuild file
- format.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.WebReferences.addin.xml: Bump MD version.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.WebReferences.mdp: Flush project format changes.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.mdp: All projects now require fx 3.5.
-
-2008-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs:
- Track API changes.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.mdp: Don't require a specific version of
- Mono.Addins.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * AssemblyInfo.cs: Add AssemblyInfo.cs files that are autogenerated from
- the addin manifests.
-
-2008-11-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.NodeBuilders/WebReferenceNodeBuilder.cs:
- * MonoDevelop.WebReferences.NodeBuilders/WebReferenceFolderNodeBuilder.cs:
- Fix comments.
-
- * MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs: Make
- sure no files are added to the project if the web reference proxy
- can't be generated.
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs:
- Flush.
-
- * Makefile.am: Fix parallel build.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.addin.xml: Bump MD version.
-
-2008-11-05 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.WebReferences.mdp: update the UsePartialTypes attribute.
- Not sure how or why it got set to False, but it should be true.
- [Fixes #440796]
-
-2008-10-22 Luciano N. Callero <lnc19@hotmail.com>
-
- * MonoDevelop.WebReferences/CodeGenerator.cs: Add a new Constructor
- to the proxy class with Url as a parameter.
-
-2008-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs:
- Track API.
-
-2008-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.mdp: Updated projects.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs,
- gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs:
- Updated generated code.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.NodeBuilders/ProjectFolderNodeBuilderExtension.cs,
- MonoDevelop.WebReferences.NodeBuilders/ProjectNodeBuilder.cs,
- MonoDevelop.WebReferences.NodeBuilders/WebReferenceFolderNodeBuilder.cs,
- MonoDevelop.WebReferences.NodeBuilders/WebReferenceNodeBuilder.cs,
- MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs:
- Moved the extensible tree view to its own directory.
-
-2008-06-18 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.WebReferences/WebReferenceItem.cs: Update web reference
- over the network.
-
-2008-06-17 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs:
- Auto-add necessary references.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.addin.xml: Bump MD version.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.NodeBuilders/WebReferenceFolderNodeBuilder.cs,
- MonoDevelop.WebReferences/WebReferenceItem.cs,
- MonoDevelop.WebReferences/Library.cs,
- MonoDevelop.WebReferences/WebReferenceItemCollection.cs,
- MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs,
- gtk-gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs:
- New project model changes.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs,
- MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs: Worked on gnome
- hig compliant alerts.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs:
- Refactored status bar.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.addin.xml: Update MD version.
-
-2008-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.addin.xml: Updated add-in category and
- description.
-
-2008-01-02 Geoff Norton <gnorton@novell.com>
-
- * MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs:
- The using System.Net;\rusing System.Text;\n pattern was causing a
- CS8025 on SVN trunk. Replace the \r with a \n.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences/Library.cs,
- MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs,
- gtk-gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs,
- gtk-gui/gui.stetic: Make it work when a browser is not installed.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.mdp: Updated project files. The order of
- extended properties won't change anymore.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.addin.xml: Bump add-in versions.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.mdp, Makefile.am: Directory reorganization.
-
-2007-11-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.WebReferences.mdp,
- MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs,
- gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs,
- gtk-gui/gui.stetic: Use WebBrowserService instead of MozillaControl.
-
-2007-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.WebReferences.mdp: Don't try to use partial types in stetic
- code generation.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.addin.xml: Bump MD version.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.mdp: Project file names updated by change in MD
- path functions.
-
-2007-10-01 Raja R Harinath <rharinath@novell.com>
-
- * Makefile.am (FILES, REFS): Remove $(srcdir) prefix. It's added
- automatically by Makefile.include.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.addin.xml: Bump MD version.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.addin.xml: Removed the CommandService class.
- Everything is done directly with CommandManager. Moved all extension
- node types to MD.Components.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.addin.xml,
- MonoDevelop.WebReferences.NodeBuilders/WebReferenceFolderNodeBuilder.cs,
- MonoDevelop.WebReferences.NodeBuilders/WebReferenceNodeBuilder.cs,
- MonoDevelop.WebReferences.mdp, Makefile.am: Reorganized the extension
- point hierarchy. Embedded all add-in manifests as resources.
-
-2007-08-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs: API
- cleanup. Converted core services into regular classes.
-
-2007-08-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.NodeBuilders/WebReferenceFolderNodeBuilder.cs:
- Converted DispatchService to a static class.
-
-2007-07-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.addin.xml,
- MonoDevelop.WebReferences.NodeBuilders/WebReferenceNodeBuilder.cs:
- Declared missing extension point.
-
-2007-06-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic,
- MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs: Made the
- dialog internal.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.mdp: Copy the .addins.xml file to the
- output dir.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Updated.
-
-2007-05-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.mdp, Makefile.am: Reference shared
- assemblies from the correct location.
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.addin.xml, MonoDevelop.WebReferences.mdp,
- gtk-gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs,
- gtk-gui/gui.stetic, Makefile.am: Migration to Mono.Addins.
-
-2007-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs: Avoid version auto-increment.
- * MonoDevelop.WebReferences.mdp: Don't copy referenced assemblies.
- * Makefile.am: Flush.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.addin.xml: Change add-in versions to 0.13.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.mdp, Makefile.am: Synchronized the MD
- project and the Makefile
- * gtk-gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs,
- gtk-gui/gui.stetic: Updated.
-
-2007-02-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.WebReferences.mdp, gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs,
- gtk-gui/gui.stetic, Makefile.am: i18n fixes and split stetic
- generated code in several files.
-
-2006-11-29 Gideon de Swardt <gdeswardt@gmail.com>
- * Makefile.in:
- Remove the Makefile.in from source, should not have been committed in the first place.
-
-2006-11-28 Gideon de Swardt <gdeswardt@gmail.com>
- * MonoDevelop.WebReferences:
- Move the source code from Google Code project.
-
-2006-08-31 Gideon de Swardt <gdeswardt@gmail.com>
- * MonoDevelop.WebReferences/CodeGenerator:
- Changed the class to use the LanguageBinding from the DotNetProject.
-
-2006-08-26 Gideon de Swardt <gdeswardt@gmail.com>
- * MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs:
- Moved the UI code to stetic
- * svnci:
- Added the svn commit change log script from monodevelop
-
-2006-08-25 Gideon de Swardt <gdeswardt@gmail.com>
- * MonoDevelop.WebReferences.NodeBuilders/WebReferenceFolderNodeBuilder.cs:
- Added an event handler to refresh the web reference folder node when a *.map project
- file has been removed from a project
-
-2006-08-15 Gideon de Swardt <gdeswardt@gmail.com>
-
- * MonoDevelop.WebReferences.addin.xml:
- Removed the Delete All menu option on the Web Reference folder
- Changed the version number
-
- * MonoDevelop.WebReferences/CodeGenerator.cs:
- Added support for generating the code in VB.NET
-
- * MonoDevelop.WebReferences/Library.cs:
- Added a method that checks if the project contains any web references
-
- * MonoDevelop.WebReferences/WebReferenceItemCollection.cs:
- Optimized the WebReferenceItemCollection construct method by only looping through the
- project files collection once instead of previously seeking for the specific map file
- after it found the reference file. This will also sort the problem with VB reference files
- not being loaded.
-
- * MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs:
- Check that the project options for the Runtime Version is set to
- "2.0", if it is set to "1.1" ask the user whether or not to
- switch to "2.0" automatically. The project build will fail if
- the Runtime is set to 1.1. Do not add the web reference if the
- user chooses to keep the runtime version 1.1.
-
- Added functionality to add a ProjectReference for System.Web.Services to the project if
- it does not currently contain a reference. This is required to successfully compile
- the project.
-
- * MonoDevelop.WebReferences.NodeBuilders/ProjectNodeBuilder.cs:
- Check if the project contains any web references before it adds the WebReferenceFolder
-
- * MonoDevelop.WebReferences.NodeBuilders/ProjectFolderNodeBuilderExtension.cs:
- Add a check not to hide the web reference folder if the project options is set to show all
-
- * MonoDevelop.WebReferences.NodeBuilders/WebReferenceFolderNodeBuilder.cs:
- Changed the HasChildNodes method to use the new method to check if a project contains any
- web references rather than parsing and loading the collection of all web references in a project.
- Changed the BuildChildNodes to parse the project every time the method is called.
-
-2006-08-11 Gideon de Swardt <gdeswardt@gmail.com>
-
- Initial setup of the AddIn
diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs
index 9b7f5c314f..c45f4968fe 100644
--- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs
+++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Commands/WebReferenceCommandHandler.cs
@@ -8,19 +8,18 @@ using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.Ide;
using System.Collections.Generic;
using MonoDevelop.Core.Assemblies;
+using System.Threading.Tasks;
namespace MonoDevelop.WebReferences.Commands
{
/// <summary>Defines the properties and methods for the WebReferenceCommandHandler class.</summary>
public class WebReferenceCommandHandler : NodeCommandHandler
{
- StatusBarContext UpdateReferenceContext {
- get; set;
- }
-
+ bool updatingReferences;
+
/// <summary>Execute the command for adding a new web reference to a project.</summary>
[CommandHandler (WebReferenceCommands.Add)]
- public void NewWebReference()
+ public async void NewWebReference()
{
// Get the project and project folder
var project = CurrentNode.GetParentDataItem (typeof(DotNetProject), true) as DotNetProject;
@@ -46,8 +45,8 @@ namespace MonoDevelop.WebReferences.Commands
if (MessageService.RunCustomDialog (dialog) != (int)Gtk.ResponseType.Ok)
return;
- dialog.SelectedService.GenerateFiles (project, dialog.Namespace, dialog.ReferenceName);
- IdeApp.ProjectOperations.Save(project);
+ await dialog.SelectedService.GenerateFiles (project, dialog.Namespace, dialog.ReferenceName);
+ await IdeApp.ProjectOperations.SaveAsync(project);
} catch (Exception exception) {
MessageService.ShowError ("The web reference could not be added", exception);
} finally {
@@ -60,72 +59,57 @@ namespace MonoDevelop.WebReferences.Commands
[CommandUpdateHandler (WebReferenceCommands.UpdateAll)]
void CanUpdateWebReferences (CommandInfo ci)
{
- // This does not appear to work.
- ci.Enabled = UpdateReferenceContext == null;
+ ci.Enabled = !updatingReferences;
}
/// <summary>Execute the command for updating a web reference in a project.</summary>
[CommandHandler (WebReferenceCommands.Update)]
- public void Update()
+ public async void Update()
{
- UpdateReferences (new [] { (WebReferenceItem) CurrentNode.DataItem });
+ await UpdateReferences (new [] { (WebReferenceItem) CurrentNode.DataItem });
}
/// <summary>Execute the command for updating all web reference in a project.</summary>
[CommandHandler (WebReferenceCommands.UpdateAll)]
- public void UpdateAll()
+ public async void UpdateAll()
{
var folder = (WebReferenceFolder)CurrentNode.DataItem;
DotNetProject project = folder.Project;
if (folder.IsWCF)
- UpdateReferences (WebReferencesService.GetWebReferenceItemsWCF (project).ToArray ());
+ await UpdateReferences (WebReferencesService.GetWebReferenceItemsWCF (project).ToArray ());
else
- UpdateReferences (WebReferencesService.GetWebReferenceItemsWS (project).ToArray ());
+ await UpdateReferences (WebReferencesService.GetWebReferenceItemsWS (project).ToArray ());
}
- void UpdateReferences (IList<WebReferenceItem> items)
+ async Task UpdateReferences (IList<WebReferenceItem> items)
{
+ if (updatingReferences)
+ return;
try {
- UpdateReferenceContext = IdeApp.Workbench.StatusBar.CreateContext ();
- UpdateReferenceContext.BeginProgress (GettextCatalog.GetPluralString ("Updating web reference", "Updating web references", items.Count));
-
- DispatchService.ThreadDispatch (() => {
- for (int i = 0; i < items.Count; i ++) {
- DispatchService.GuiDispatch (() => UpdateReferenceContext.SetProgressFraction (Math.Max (0.1, (double)i / items.Count)));
+ updatingReferences = true;
+ using (var monitor = IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor (GettextCatalog.GetPluralString ("Updating web reference", "Updating web references", items.Count), MonoDevelop.Ide.Gui.Stock.StatusDownload, true)) {
+ monitor.BeginTask (GettextCatalog.GetPluralString ("Updating web reference", "Updating web references", items.Count), items.Count);
+
+ for (int i = 0; i < items.Count; i++) {
try {
- items [i].Update();
+ await items [i].Update ();
} catch (Exception ex) {
- DispatchService.GuiSyncDispatch (() => {
- MessageService.ShowError (GettextCatalog.GetString ("Failed to update Web Reference '{0}'", items [i].Name), ex);
- DisposeUpdateContext ();
- });
+ MessageService.ShowError (GettextCatalog.GetString ("Failed to update Web Reference '{0}'", items [i].Name), ex);
return;
}
+ monitor.Step ();
}
-
- DispatchService.GuiDispatch (() => {
- // Make sure that we save all relevant projects, there should only be 1 though
- foreach (var project in items.Select (i =>i.Project).Distinct ())
- IdeApp.ProjectOperations.Save (project);
-
- IdeApp.Workbench.StatusBar.ShowMessage(GettextCatalog.GetPluralString ("Updated Web Reference {0}", "Updated Web References", items.Count, items[0].Name));
- DisposeUpdateContext ();
- });
- });
- } catch {
- DisposeUpdateContext ();
- throw;
+
+ // Make sure that we save all relevant projects, there should only be 1 though
+ foreach (var project in items.Select (i => i.Project).Distinct ())
+ await IdeApp.ProjectOperations.SaveAsync (project);
+ }
+ IdeApp.Workbench.StatusBar.ShowMessage (GettextCatalog.GetPluralString ("Updated Web Reference {0}", "Updated Web References", items.Count, items [0].Name));
+ } finally {
+ updatingReferences = false;
}
}
- void DisposeUpdateContext ()
- {
- if (UpdateReferenceContext != null) {
- UpdateReferenceContext.Dispose ();
- UpdateReferenceContext = null;
- }
- }
-
/// <summary>Execute the command for removing a web reference from a project.</summary>
[CommandHandler (WebReferenceCommands.Delete)]
public void Delete()
@@ -134,7 +118,7 @@ namespace MonoDevelop.WebReferences.Commands
if (!MessageService.Confirm (GettextCatalog.GetString ("Are you sure you want to delete the web service reference '{0}'?", item.Name), AlertButton.Delete))
return;
item.Delete();
- IdeApp.ProjectOperations.Save (item.Project);
+ IdeApp.ProjectOperations.SaveAsync (item.Project);
IdeApp.Workbench.StatusBar.ShowMessage("Deleted Web Reference " + item.Name);
}
@@ -154,7 +138,7 @@ namespace MonoDevelop.WebReferences.Commands
foreach (var item in items.ToList ())
item.Delete();
- IdeApp.ProjectOperations.Save(project);
+ IdeApp.ProjectOperations.SaveAsync(project);
IdeApp.Workbench.StatusBar.ShowMessage("Deleted all Web References");
}
@@ -167,7 +151,7 @@ namespace MonoDevelop.WebReferences.Commands
/// <summary>Execute the command for configuring a web reference in a project.</summary>
[CommandHandler (WebReferenceCommands.Configure)]
- public void Configure ()
+ public async void Configure ()
{
var item = (WebReferenceItem) CurrentNode.DataItem;
@@ -195,7 +179,7 @@ namespace MonoDevelop.WebReferences.Commands
return;
refgroup.Save (item.MapFile.FilePath);
- UpdateReferences (new [] { item });
+ await UpdateReferences (new [] { item });
} catch (Exception exception) {
LoggingService.LogInternalError (exception);
} finally {
diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Dialogs/WCFConfigWidget.cs b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Dialogs/WCFConfigWidget.cs
index d69ba80256..cfbea29412 100644
--- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Dialogs/WCFConfigWidget.cs
+++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Dialogs/WCFConfigWidget.cs
@@ -53,7 +53,7 @@ namespace MonoDevelop.WebReferences.Dialogs
listAccess.Active = options.GenerateInternalTypes ? 1 : 0;
listAsync.Active = AsyncOptionToIndex;
- if (project is PortableDotNetProject) {
+ if (project.IsPortableLibrary) {
listAccess.Sensitive = false;
listAsync.Sensitive = false;
}
diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs
index 28d9c0bd1a..89e60acb6c 100644
--- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs
+++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Dialogs/WebReferenceDialog.cs
@@ -149,7 +149,7 @@ namespace MonoDevelop.WebReferences.Dialogs
#endregion
#region Member Variables
- const string homeUrl = "http://www.w3schools.com/WebServices/TempConvert.asmx";
+ const string homeUrl = "http://www.w3schools.com/xml/tempconvert.asmx";
WebServiceDiscoveryResult selectedService;
// protected Gtk.Alignment frmBrowserAlign;
#endregion
@@ -169,7 +169,7 @@ namespace MonoDevelop.WebReferences.Dialogs
tbxReferenceURL.Text = homeUrl;
wcfOptions = WebReferencesService.WcfEngine.DefaultClientOptions;
- if (project is PortableDotNetProject) {
+ if (project.IsPortableLibrary) {
wcfOptions.GenerateAsynchronousMethods = false;
wcfOptions.GenerateEventBasedAsynchronousMethods = true;
}
@@ -209,7 +209,7 @@ namespace MonoDevelop.WebReferences.Dialogs
}
/// <summary>Execute the event when any of the buttons on the action panel has been clicked</summary>
- /// <param name="sender">An object that contains the sender data.</param>
+ /// <param name="sender">An object that contains the sender data.</param>
/// <param name="e">An EventArgs object that contains the event data.</param>
// private void Browser_URLKeyReleased (object sender, EventArgs e)
// {
@@ -251,7 +251,7 @@ namespace MonoDevelop.WebReferences.Dialogs
}
/// <summary>Execute the event when the Enter key has been pressed on the Url Entry</summary>
- /// <param name="sender">An object that contains the sender data.</param>
+ /// <param name="sender">An object that contains the sender data.</param>
/// <param name="e">An EventArgs object that contains the event data.</param>
void Browser_URLKeyReleased (object sender, KeyReleaseEventArgs e)
{
@@ -263,7 +263,7 @@ namespace MonoDevelop.WebReferences.Dialogs
}
/// <summary>Execute the event when the Location of the Browser has changed</summary>
- /// <param name="sender">An object that contains the sender data.</param>
+ /// <param name="sender">An object that contains the sender data.</param>
/// <param name="e">An EventArgs object that contains the event data.</param>
void Browser_LocationChanged (object sender, EventArgs e)
{
@@ -283,7 +283,7 @@ namespace MonoDevelop.WebReferences.Dialogs
/// <summary>Execute when the browser starts loading a document</summary>
- /// <param name="sender">An object that contains the sender data.</param>
+ /// <param name="sender">An object that contains the sender data.</param>
/// <param name="e">An EventArgs object that contains the event data.</param>
void Browser_StartLoading (object sender, EventArgs e)
{
@@ -291,7 +291,7 @@ namespace MonoDevelop.WebReferences.Dialogs
}
/// <summary>Execute the browser stop loading a document</summary>
- /// <param name="sender">An object that contains the sender data.</param>
+ /// <param name="sender">An object that contains the sender data.</param>
/// <param name="e">An EventArgs object that contains the event data.</param>
void Browser_StopLoading (object sender, EventArgs e)
{
@@ -299,7 +299,7 @@ namespace MonoDevelop.WebReferences.Dialogs
}
/// <summary>Execute when the Back button has been clicked</summary>
- /// <param name="sender">An object that contains the sender data.</param>
+ /// <param name="sender">An object that contains the sender data.</param>
/// <param name="e">An EventArgs object that contains the event data.</param>
void Browser_BackButtonClicked (object sender, EventArgs e)
{
@@ -308,7 +308,7 @@ namespace MonoDevelop.WebReferences.Dialogs
}
/// <summary>Execute when the Next button has been clicked</summary>
- /// <param name="sender">An object that contains the sender data.</param>
+ /// <param name="sender">An object that contains the sender data.</param>
/// <param name="e">An EventArgs object that contains the event data.</param>
void Browser_NextButtonClicked (object sender, EventArgs e)
{
@@ -317,7 +317,7 @@ namespace MonoDevelop.WebReferences.Dialogs
}
/// <summary>Execute when the Refresh button has been clicked</summary>
- /// <param name="sender">An object that contains the sender data.</param>
+ /// <param name="sender">An object that contains the sender data.</param>
/// <param name="e">An EventArgs object that contains the event data.</param>
void Browser_RefreshButtonClicked (object sender, EventArgs e)
{
@@ -326,7 +326,7 @@ namespace MonoDevelop.WebReferences.Dialogs
}
/// <summary>Execute when the Stop button has been clicked</summary>
- /// <param name="sender">An object that contains the sender data.</param>
+ /// <param name="sender">An object that contains the sender data.</param>
/// <param name="e">An EventArgs object that contains the event data.</param>
void Browser_StopButtonClicked (object sender, EventArgs e)
{
@@ -335,7 +335,7 @@ namespace MonoDevelop.WebReferences.Dialogs
}
/// <summary>Execute when the Home button has been clicked</summary>
- /// <param name="sender">An object that contains the sender data.</param>
+ /// <param name="sender">An object that contains the sender data.</param>
/// <param name="e">An EventArgs object that contains the event data.</param>
void Browser_HomeButtonClicked (object sender, EventArgs e)
{
@@ -491,7 +491,7 @@ namespace MonoDevelop.WebReferences.Dialogs
btnOK.Sensitive = isWebService;
tlbNavigate.Visible = WebBrowserService.CanGetWebBrowser;
tbxReferenceName.Sensitive = isWebService;
- comboModel.Sensitive = !(project is PortableDotNetProject);
+ comboModel.Sensitive = !project.IsPortableLibrary;
break;
case DialogState.CreateConfig:
@@ -609,6 +609,17 @@ namespace MonoDevelop.WebReferences.Dialogs
}
}
+
+ protected override void OnDestroyed ()
+ {
+ btnNavBack.Activated -= Browser_BackButtonClicked;
+ btnNavNext.Activated -= Browser_NextButtonClicked;
+ btnRefresh.Activated -= Browser_RefreshButtonClicked;
+ btnStop.Activated -= Browser_StopButtonClicked;
+ btnHome.Activated -= Browser_HomeButtonClicked;
+
+ base.OnDestroyed ();
+ }
}
class AskCredentials: GuiSyncObject, ICredentials
diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.NodeBuilders/WebReferenceFolderNodeBuilder.cs b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.NodeBuilders/WebReferenceFolderNodeBuilder.cs
index 65ab2ef5af..87869b8874 100644
--- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.NodeBuilders/WebReferenceFolderNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.NodeBuilders/WebReferenceFolderNodeBuilder.cs
@@ -41,18 +41,12 @@ namespace MonoDevelop.WebReferences.NodeBuilders
return "WebReferences";
}
- /// <summary>Build the node in the project tree.</summary>
- /// <param name="treeBuilder">An ITreeBuilder containing the project tree builder.</param>
- /// <param name="dataObject">An object containing the current builder child.</param>
- /// <param name="label">A string containing the label of the node.</param>
- /// <param name="icon">A Pixbif containing the icon for the node.</param>
- /// <param name="closedIcon">A Pixbif containing the closed icon for the node.</param>
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
{
var folder = (WebReferenceFolder) dataObject;
nodeInfo.Label = folder.IsWCF ? GettextCatalog.GetString ("Web Services") : GettextCatalog.GetString ("Web References");
- nodeInfo.Icon = Context.GetIcon (Stock.OpenReferenceFolder);
- nodeInfo.ClosedIcon = Context.GetIcon (Stock.ClosedReferenceFolder);
+ nodeInfo.Icon = Context.GetIcon ("md-webreference-folder");
+ nodeInfo.ClosedIcon = Context.GetIcon ("md-webreference-folder");
}
@@ -71,11 +65,9 @@ namespace MonoDevelop.WebReferences.NodeBuilders
{
var folder = (WebReferenceFolder) dataObject;
if (folder.IsWCF)
- foreach (WebReferenceItem item in WebReferencesService.GetWebReferenceItemsWCF (folder.Project))
- treeBuilder.AddChild(item);
+ treeBuilder.AddChildren (WebReferencesService.GetWebReferenceItemsWCF (folder.Project));
else
- foreach (WebReferenceItem item in WebReferencesService.GetWebReferenceItemsWS (folder.Project))
- treeBuilder.AddChild(item);
+ treeBuilder.AddChildren (WebReferencesService.GetWebReferenceItemsWS (folder.Project));
}
/// <summary>Compare two object with one another and returns a number based on their sort order.</summary>
diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.NodeBuilders/WebReferenceNodeBuilder.cs b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.NodeBuilders/WebReferenceNodeBuilder.cs
index f4f7115fe7..9e7ed5efe0 100644
--- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.NodeBuilders/WebReferenceNodeBuilder.cs
+++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.NodeBuilders/WebReferenceNodeBuilder.cs
@@ -39,12 +39,6 @@ namespace MonoDevelop.WebReferences.NodeBuilders
return "WebReferenceItem";
}
- /// <summary>Build the node in the project tree.</summary>
- /// <param name="treeBuilder">An ITreeBuilder containing the project tree builder.</param>
- /// <param name="dataObject">An object containing the current builder child.</param>
- /// <param name="label">A string containing the label of the node.</param>
- /// <param name="icon">A Pixbif containing the icon for the node.</param>
- /// <param name="closedIcon">A Pixbif containing the closed icon for the node.</param>
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
{
nodeInfo.Label = ((WebReferenceItem) dataObject).Name;
diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Resources/WebReferenceItem.png b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Resources/WebReferenceItem.png
deleted file mode 100644
index e6939b38c2..0000000000
--- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.Resources/WebReferenceItem.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WCF/WCFMetadata.cs b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WCF/WCFMetadata.cs
index ccc0ebe932..422fbf91fa 100644
--- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WCF/WCFMetadata.cs
+++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WCF/WCFMetadata.cs
@@ -26,12 +26,20 @@
using MonoDevelop.Projects;
using MonoDevelop.Core;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.WebReferences.WCF
{
- public class WCFMetadata: ProjectItem
+ [ExportProjectItemType ("WCFMetadata")]
+ public class WCFMetadata: PathBasedProjectItem
{
- [ProjectPathItemProperty ("Include")]
- public FilePath Path { get; set; }
+ WCFMetadata ()
+ {
+ }
+
+ public WCFMetadata (FilePath path)
+ {
+ Path = path;
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WCF/WCFMetadataStorage.cs b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WCF/WCFMetadataStorage.cs
index 4aaffcf3a6..435f76d8e6 100644
--- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WCF/WCFMetadataStorage.cs
+++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WCF/WCFMetadataStorage.cs
@@ -26,12 +26,20 @@
using MonoDevelop.Projects;
using MonoDevelop.Core;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.WebReferences.WCF
{
- public class WCFMetadataStorage: ProjectItem
+ [ExportProjectItemType ("WCFMetadataStorage")]
+ public class WCFMetadataStorage: PathBasedProjectItem
{
- [ProjectPathItemProperty ("Include")]
- public FilePath Path { get; set; }
+ WCFMetadataStorage ()
+ {
+ }
+
+ public WCFMetadataStorage (FilePath path)
+ {
+ Path = path;
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WCF/WebServiceDiscoveryResultWCF.cs b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WCF/WebServiceDiscoveryResultWCF.cs
index a278dc0a7f..383470d741 100644
--- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WCF/WebServiceDiscoveryResultWCF.cs
+++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WCF/WebServiceDiscoveryResultWCF.cs
@@ -40,6 +40,7 @@ using System.Xml.Schema;
using System.Text;
using Mono.ServiceContractTool;
using MonoDevelop.Core;
+using System.Threading.Tasks;
namespace MonoDevelop.WebReferences.WCF
{
@@ -94,38 +95,41 @@ namespace MonoDevelop.WebReferences.WCF
}
}
- protected override string GenerateDescriptionFiles (DotNetProject dotNetProject, FilePath basePath)
+ protected override async Task<string> GenerateDescriptionFiles (DotNetProject dotNetProject, FilePath basePath)
{
if (!dotNetProject.Items.GetAll<WCFMetadata> ().Any ()) {
- var met = new WCFMetadata ();
- met.Path = basePath.ParentDirectory;
+ var met = new WCFMetadata (basePath.ParentDirectory);
dotNetProject.Items.Add (met);
}
WCFMetadataStorage metStor = dotNetProject.Items.GetAll<WCFMetadataStorage> ().FirstOrDefault (m => m.Path.CanonicalPath == basePath);
if (metStor == null)
- dotNetProject.Items.Add (new WCFMetadataStorage { Path = basePath });
-
+ dotNetProject.Items.Add (new WCFMetadataStorage (basePath));
+
string file = Path.Combine (basePath, "Reference.svcmap");
- if (protocol != null) {
- protocol.ResolveAll ();
- protocol.WriteAll (basePath, "Reference.svcmap");
- refGroup = ConvertMapFile (file);
- } else {
- // TODO
- var map = new ReferenceGroup ();
- map.ClientOptions = defaultOptions;
- map.Save (file);
- map.ID = Guid.NewGuid ().ToString ();
- refGroup = map;
- }
+
+ await Task.Run (() => {
+ if (protocol != null) {
+ protocol.ResolveAll ();
+ protocol.WriteAll (basePath, "Reference.svcmap");
+ refGroup = ConvertMapFile (file);
+ } else {
+ // TODO
+ var map = new ReferenceGroup ();
+ map.ClientOptions = defaultOptions;
+ map.Save (file);
+ map.ID = Guid.NewGuid ().ToString ();
+ refGroup = map;
+ }
+ });
+
foreach (MetadataFile mfile in refGroup.Metadata)
dotNetProject.AddFile (new FilePath (mfile.FileName).ToAbsolute (basePath), BuildAction.None);
return file;
}
- public override void Update ()
+ public override async Task Update ()
{
ReferenceGroup resfile = ReferenceGroup.Read (Item.MapFile.FilePath);
if (resfile.MetadataSources.Count == 0)
@@ -137,7 +141,7 @@ namespace MonoDevelop.WebReferences.WCF
metadata = wref.metadata;
protocol = wref.protocol;
- GenerateFiles (Item.Project, Item.Project.DefaultNamespace, Item.Name);
+ await GenerateFiles (Item.Project, Item.Project.DefaultNamespace, Item.Name);
}
public override IEnumerable<string> GetAssemblyReferences ()
@@ -148,72 +152,73 @@ namespace MonoDevelop.WebReferences.WCF
yield return "System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
}
- protected override string CreateProxyFile (DotNetProject dotNetProject, FilePath basePath, string proxyNamespace, string referenceName)
+ protected override Task<string> CreateProxyFile (DotNetProject dotNetProject, FilePath basePath, string proxyNamespace, string referenceName)
{
- var ccu = new CodeCompileUnit ();
- var cns = new CodeNamespace (proxyNamespace);
- ccu.Namespaces.Add (cns);
-
+ CodeDomProvider code_provider = GetProvider (dotNetProject);
+
bool targetMoonlight = dotNetProject.TargetFramework.Id.Identifier == ("Silverlight");
bool targetMonoTouch = dotNetProject.TargetFramework.Id.Identifier == ("MonoTouch");
bool targetMonoDroid = dotNetProject.TargetFramework.Id.Identifier == ("MonoDroid");
-
- bool targetCoreClr = targetMoonlight || targetMonoDroid || targetMonoTouch;
- bool generateSyncMethods = targetMonoDroid | targetMonoTouch;
-
- var generator = new ServiceContractGenerator (ccu);
- generator.Options = ServiceContractGenerationOptions.ChannelInterface | ServiceContractGenerationOptions.ClientClass;
- if (refGroup.ClientOptions.GenerateAsynchronousMethods || targetCoreClr)
- generator.Options |= ServiceContractGenerationOptions.AsynchronousMethods;
- if (refGroup.ClientOptions.GenerateEventBasedAsynchronousMethods)
- generator.Options |= ServiceContractGenerationOptions.EventBasedAsynchronousMethods;
+
+ return Task.Run (() => {
+ var ccu = new CodeCompileUnit ();
+ var cns = new CodeNamespace (proxyNamespace);
+ ccu.Namespaces.Add (cns);
+
+ bool targetCoreClr = targetMoonlight || targetMonoDroid || targetMonoTouch;
+ bool generateSyncMethods = targetMonoDroid | targetMonoTouch;
+
+ var generator = new ServiceContractGenerator (ccu);
+ generator.Options = ServiceContractGenerationOptions.ChannelInterface | ServiceContractGenerationOptions.ClientClass;
+ if (refGroup.ClientOptions.GenerateAsynchronousMethods || targetCoreClr)
+ generator.Options |= ServiceContractGenerationOptions.AsynchronousMethods;
+ if (refGroup.ClientOptions.GenerateEventBasedAsynchronousMethods)
+ generator.Options |= ServiceContractGenerationOptions.EventBasedAsynchronousMethods;
#if NET_4_5
if (refGroup.ClientOptions.GenerateTaskBasedAsynchronousMethod)
generator.Options |= ServiceContractGenerationOptions.TaskBasedAsynchronousMethod;
#endif
- if (refGroup.ClientOptions.GenerateInternalTypes)
- generator.Options |= ServiceContractGenerationOptions.InternalTypes;
- if (refGroup.ClientOptions.GenerateMessageContracts)
- generator.Options |= ServiceContractGenerationOptions.TypedMessages;
-// if (targetMoonlight || targetMonoTouch)
-// generator.Options |= ServiceContractGenerationOptions.EventBasedAsynchronousMethods;
-
- MetadataSet mset;
- mset = protocol != null ? ToMetadataSet (protocol) : metadata;
+ if (refGroup.ClientOptions.GenerateInternalTypes)
+ generator.Options |= ServiceContractGenerationOptions.InternalTypes;
+ if (refGroup.ClientOptions.GenerateMessageContracts)
+ generator.Options |= ServiceContractGenerationOptions.TypedMessages;
+ // if (targetMoonlight || targetMonoTouch)
+ // generator.Options |= ServiceContractGenerationOptions.EventBasedAsynchronousMethods;
- CodeDomProvider code_provider = GetProvider (dotNetProject);
-
- var list = new List<IWsdlImportExtension> ();
- list.Add (new TransportBindingElementImporter ());
- list.Add (new XmlSerializerMessageContractImporter ());
-
- var importer = new WsdlImporter (mset);
- try {
- ConfigureImporter (importer);
- } catch {
- }
+ MetadataSet mset;
+ mset = protocol != null ? ToMetadataSet (protocol) : metadata;
- Collection<ContractDescription> contracts = importer.ImportAllContracts ();
-
- foreach (ContractDescription cd in contracts) {
- cd.Namespace = proxyNamespace;
- if (targetCoreClr) {
- var moonctx = new MoonlightChannelBaseContext ();
- cd.Behaviors.Add (new MoonlightChannelBaseContractExtension (moonctx, generateSyncMethods));
- foreach (var od in cd.Operations)
- od.Behaviors.Add (new MoonlightChannelBaseOperationExtension (moonctx, generateSyncMethods));
- generator.GenerateServiceContractType (cd);
- moonctx.Fixup ();
+ var list = new List<IWsdlImportExtension> ();
+ list.Add (new TransportBindingElementImporter ());
+ list.Add (new XmlSerializerMessageContractImporter ());
+
+ var importer = new WsdlImporter (mset);
+ try {
+ ConfigureImporter (importer);
+ } catch {
}
- else
- generator.GenerateServiceContractType (cd);
- }
-
- string fileSpec = Path.Combine (basePath, referenceName + "." + code_provider.FileExtension);
- using (TextWriter w = File.CreateText (fileSpec)) {
- code_provider.GenerateCodeFromCompileUnit (ccu, w, null);
- }
- return fileSpec;
+
+ Collection<ContractDescription> contracts = importer.ImportAllContracts ();
+
+ foreach (ContractDescription cd in contracts) {
+ cd.Namespace = proxyNamespace;
+ if (targetCoreClr) {
+ var moonctx = new MoonlightChannelBaseContext ();
+ cd.Behaviors.Add (new MoonlightChannelBaseContractExtension (moonctx, generateSyncMethods));
+ foreach (var od in cd.Operations)
+ od.Behaviors.Add (new MoonlightChannelBaseOperationExtension (moonctx, generateSyncMethods));
+ generator.GenerateServiceContractType (cd);
+ moonctx.Fixup ();
+ } else
+ generator.GenerateServiceContractType (cd);
+ }
+
+ string fileSpec = Path.Combine (basePath, referenceName + "." + code_provider.FileExtension);
+ using (TextWriter w = File.CreateText (fileSpec)) {
+ code_provider.GenerateCodeFromCompileUnit (ccu, w, null);
+ }
+ return fileSpec;
+ });
}
void ConfigureImporter (WsdlImporter importer)
diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WS/WebReferenceUrl.cs b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WS/WebReferenceUrl.cs
index 2a920da2d5..bd5d77331e 100644
--- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WS/WebReferenceUrl.cs
+++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WS/WebReferenceUrl.cs
@@ -30,6 +30,7 @@ using MonoDevelop.Core;
namespace MonoDevelop.WebReferences.WS
{
+ [ExportProjectItemType ("WebReferenceUrl")]
public class WebReferenceUrl: ProjectItem
{
public WebReferenceUrl ()
@@ -42,9 +43,11 @@ namespace MonoDevelop.WebReferences.WS
Include = url;
UpdateFromURL = url;
}
-
- [ItemProperty]
- public string Include { get; private set; }
+
+ protected override void Read (Project project, MonoDevelop.Projects.MSBuild.IMSBuildItemEvaluated buildItem)
+ {
+ base.Read (project, buildItem);
+ }
[ItemProperty]
public string UrlBehavior { get; set; }
diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WS/WebReferences.cs b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WS/WebReferences.cs
index 96de170e6c..cddaf99f5a 100644
--- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WS/WebReferences.cs
+++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WS/WebReferences.cs
@@ -29,9 +29,16 @@ using MonoDevelop.Core;
namespace MonoDevelop.WebReferences.WS
{
- public class WebReferences: ProjectItem
+ [ExportProjectItemType ("WebReferences")]
+ public class WebReferences: PathBasedProjectItem
{
- [ProjectPathItemProperty ("Include")]
- public FilePath Path;
+ WebReferences ()
+ {
+ }
+
+ public WebReferences (FilePath path)
+ {
+ Path = path;
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WS/WebServiceDiscoveryResultWS.cs b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WS/WebServiceDiscoveryResultWS.cs
index f6db9a47df..178a85908a 100644
--- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WS/WebServiceDiscoveryResultWS.cs
+++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.WS/WebServiceDiscoveryResultWS.cs
@@ -27,6 +27,7 @@
using System.Web.Services.Discovery;
using System.Linq;
using System.Text;
+using System.Xml.Serialization;
using MonoDevelop.Projects;
using System.Web.Services.Description;
using System.IO;
@@ -34,6 +35,7 @@ using System.CodeDom.Compiler;
using System.CodeDom;
using MonoDevelop.Core;
using WebReferencesDir = MonoDevelop.WebReferences.WS.WebReferences;
+using System.Threading.Tasks;
namespace MonoDevelop.WebReferences.WS
{
@@ -77,44 +79,45 @@ namespace MonoDevelop.WebReferences.WS
}
}
- protected override string GenerateDescriptionFiles (DotNetProject dotNetProject, FilePath basePath)
+ protected override async Task<string> GenerateDescriptionFiles (DotNetProject dotNetProject, FilePath basePath)
{
if (!dotNetProject.Items.GetAll<WebReferencesDir> ().Any ()) {
- var met = new WebReferencesDir ();
- met.Path = basePath.ParentDirectory;
+ var met = new WebReferencesDir (basePath.ParentDirectory);
dotNetProject.Items.Add (met);
}
-
- WebReferenceUrl wru = dotNetProject.Items.GetAll<WebReferenceUrl> ().FirstOrDefault (m => m.RelPath.CanonicalPath == basePath);
- if (wru == null) {
- wru = new WebReferenceUrl (protocol.Url);
- wru.RelPath = basePath;
- dotNetProject.Items.Add (wru);
- }
-
- protocol.ResolveAll ();
- DiscoveryClientResultCollection files = protocol.WriteAll (basePath, "Reference.map");
+
+ DiscoveryClientResultCollection files = await Task.Run (() => {
+ WebReferenceUrl wru = dotNetProject.Items.GetAll<WebReferenceUrl> ().FirstOrDefault (m => m.RelPath.CanonicalPath == basePath);
+ if (wru == null) {
+ wru = new WebReferenceUrl (protocol.Url);
+ wru.RelPath = basePath;
+ dotNetProject.Items.Add (wru);
+ }
+
+ protocol.ResolveAll ();
+ return protocol.WriteAll (basePath, "Reference.map");
+ });
foreach (DiscoveryClientResult dr in files)
- dotNetProject.AddFile (new FilePath (dr.Filename).ToAbsolute (basePath), BuildAction.None);
+ dotNetProject.AddFile (new FilePath (Path.GetFileName (dr.Filename)).ToAbsolute (basePath), BuildAction.None);
return Path.Combine (basePath, "Reference.map");
}
- public override void Update ()
+ public override async Task Update ()
{
WebReferenceUrl wru = Item.Project.Items.GetAll<WebReferenceUrl> ().FirstOrDefault (m => m.RelPath.CanonicalPath == Item.BasePath);
if (wru == null)
return;
-
- var wref = (WebServiceDiscoveryResultWS) WebReferencesService.WsEngine.Discover (wru.UpdateFromURL);
+
+ var wref = await Task.Run (() => (WebServiceDiscoveryResultWS)WebReferencesService.WsEngine.Discover (wru.UpdateFromURL));
if (wref == null)
return;
protocol = wref.protocol;
// Re-generate the proxy and map files
- GenerateFiles (Item.Project, Item.Project.DefaultNamespace, Item.Name);
+ await GenerateFiles (Item.Project, Item.Project.DefaultNamespace, Item.Name);
}
public override System.Collections.Generic.IEnumerable<string> GetAssemblyReferences ()
@@ -124,44 +127,48 @@ namespace MonoDevelop.WebReferences.WS
yield return "System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
}
- protected override string CreateProxyFile (DotNetProject dotNetProject, FilePath basePath, string proxyNamespace, string referenceName)
+ protected override Task<string> CreateProxyFile (DotNetProject dotNetProject, FilePath basePath, string proxyNamespace, string referenceName)
{
// Setup the proxy namespace and compile unit
CodeDomProvider codeProv = GetProvider (dotNetProject);
- var codeNamespace = new CodeNamespace (proxyNamespace);
- var urlConstructor = new CodeConstructor ();
- var codeUnit = new CodeCompileUnit ();
- codeUnit.Namespaces.Add (codeNamespace);
-
- // Setup the importer and import the service description into the code unit
- ServiceDescriptionImporter importer = Library.ReadServiceDescriptionImporter (protocol);
- importer.Import (codeNamespace, codeUnit);
-
- // Add the new Constructor with Url as a paremeter
- // Search for the class which inherit SoapHttpClientProtocol (Which is the Service Class)
- foreach (CodeTypeDeclaration declarationType in codeUnit.Namespaces[0].Types)
- if (declarationType.IsClass)
- if (declarationType.BaseTypes.Count > 0)
- // Is a Service Class
- if (declarationType.BaseTypes [0].BaseType.IndexOf ("SoapHttpClientProtocol", System.StringComparison.Ordinal) > -1) {
- // Create new public constructor with the Url as parameter
- urlConstructor.Attributes = MemberAttributes.Public;
- urlConstructor.Parameters.Add (new CodeParameterDeclarationExpression ("System.String", "url"));
- urlConstructor.Statements.Add (new CodeAssignStatement (
- new CodePropertyReferenceExpression (new CodeThisReferenceExpression(),
- "Url"),
- new CodeVariableReferenceExpression ("url")));
- declarationType.Members.Add (urlConstructor);
- }
-
- // Generate the code and save the file
- string fileSpec = Path.Combine (basePath, dotNetProject.LanguageBinding.GetFileName (referenceName));
- var writer = new StreamWriter (fileSpec);
- codeProv.GenerateCodeFromCompileUnit (codeUnit, writer, new CodeGeneratorOptions ());
-
- writer.Close ();
-
- return fileSpec;
+
+ return Task.Run (() => {
+ var codeNamespace = new CodeNamespace (proxyNamespace);
+ var urlConstructor = new CodeConstructor ();
+ var codeUnit = new CodeCompileUnit ();
+ codeUnit.Namespaces.Add (codeNamespace);
+
+ // Setup the importer and import the service description into the code unit
+ ServiceDescriptionImporter importer = Library.ReadServiceDescriptionImporter (protocol);
+ importer.CodeGenerationOptions = CodeGenerationOptions.GenerateNewAsync;
+ importer.Import (codeNamespace, codeUnit);
+
+ // Add the new Constructor with Url as a paremeter
+ // Search for the class which inherit SoapHttpClientProtocol (Which is the Service Class)
+ foreach (CodeTypeDeclaration declarationType in codeUnit.Namespaces [0].Types)
+ if (declarationType.IsClass)
+ if (declarationType.BaseTypes.Count > 0)
+ // Is a Service Class
+ if (declarationType.BaseTypes [0].BaseType.IndexOf ("SoapHttpClientProtocol", System.StringComparison.Ordinal) > -1) {
+ // Create new public constructor with the Url as parameter
+ urlConstructor.Attributes = MemberAttributes.Public;
+ urlConstructor.Parameters.Add (new CodeParameterDeclarationExpression ("System.String", "url"));
+ urlConstructor.Statements.Add (new CodeAssignStatement (
+ new CodePropertyReferenceExpression (new CodeThisReferenceExpression (),
+ "Url"),
+ new CodeVariableReferenceExpression ("url")));
+ declarationType.Members.Add (urlConstructor);
+ }
+
+ // Generate the code and save the file
+ string fileSpec = Path.Combine (basePath, dotNetProject.LanguageBinding.GetFileName (referenceName));
+ var writer = new StreamWriter (fileSpec);
+ codeProv.GenerateCodeFromCompileUnit (codeUnit, writer, new CodeGeneratorOptions ());
+
+ writer.Close ();
+
+ return fileSpec;
+ });
}
public override string GetServiceURL ()
diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.addin.xml b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.addin.xml
index 4db5d43fe3..796c2541f2 100644
--- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.addin.xml
+++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.addin.xml
@@ -56,7 +56,8 @@
</Extension>
<Extension path = "/MonoDevelop/Core/StockIcons">
- <StockIcon stockid = "md-webreference-item" resource = "WebReferenceItem.png" />
+ <StockIcon stockid = "md-webreference-item" resource = "web-reference-16.png" />
+ <StockIcon stockid = "md-webreference-folder" resource = "folder-web-16.png" />
</Extension>
<Extension path = "/MonoDevelop/ProjectModel/SerializableClasses">
diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj
index 3cb39b9ec1..b519acf43c 100644
--- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj
+++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences.csproj
@@ -139,8 +139,53 @@
<EmbeddedResource Include="MonoDevelop.WebReferences.Resources\wsdl.html">
<LogicalName>wsdl.html</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="MonoDevelop.WebReferences.Resources\WebReferenceItem.png">
- <LogicalName>WebReferenceItem.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-web-16.png">
+ <LogicalName>folder-web-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-web-16%402x.png">
+ <LogicalName>folder-web-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-web-16~dark.png">
+ <LogicalName>folder-web-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-web-16~dark%402x.png">
+ <LogicalName>folder-web-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-web-16~dark~sel.png">
+ <LogicalName>folder-web-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-web-16~dark~sel%402x.png">
+ <LogicalName>folder-web-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-web-16~sel.png">
+ <LogicalName>folder-web-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-web-16~sel%402x.png">
+ <LogicalName>folder-web-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\web-reference-16.png">
+ <LogicalName>web-reference-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\web-reference-16%402x.png">
+ <LogicalName>web-reference-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\web-reference-16~dark.png">
+ <LogicalName>web-reference-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\web-reference-16~dark%402x.png">
+ <LogicalName>web-reference-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\web-reference-16~dark~sel.png">
+ <LogicalName>web-reference-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\web-reference-16~dark~sel%402x.png">
+ <LogicalName>web-reference-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\web-reference-16~sel.png">
+ <LogicalName>web-reference-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\web-reference-16~sel%402x.png">
+ <LogicalName>web-reference-16~sel@2x.png</LogicalName>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
@@ -154,5 +199,6 @@
<Folder Include="MonoDevelop.WebReferences.WCF\" />
<Folder Include="MonoDevelop.WebReferences\" />
<Folder Include="MonoDevelop.WebReferences.WS\" />
+ <Folder Include="icons\" />
</ItemGroup>
</Project>
diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/DiscoveryProtocol.cs b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/DiscoveryProtocol.cs
index bfa1ad18de..7d557d34fb 100644
--- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/DiscoveryProtocol.cs
+++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/DiscoveryProtocol.cs
@@ -45,7 +45,7 @@ namespace MonoDevelop.WebReferences
var dr = (DiscoveryReference) Activator.CreateInstance(type);
dr.Url = dcr.Url;
- var fs = new FileStream (Path.Combine(basePath, dcr.Filename), FileMode.Open, FileAccess.Read);
+ var fs = new FileStream (Path.Combine(basePath, Path.GetFileName (dcr.Filename)), FileMode.Open, FileAccess.Read);
Documents.Add (dr.Url, dr.ReadDocument (fs));
fs.Close ();
References.Add (dr.Url, dr);
diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/WebReferenceItem.cs b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/WebReferenceItem.cs
index 175ceec2a0..2c71248e96 100644
--- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/WebReferenceItem.cs
+++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/WebReferenceItem.cs
@@ -1,6 +1,6 @@
using MonoDevelop.Projects;
using MonoDevelop.Core;
-
+using System.Threading.Tasks;
namespace MonoDevelop.WebReferences
{
@@ -38,10 +38,10 @@ namespace MonoDevelop.WebReferences
}
/// <summary>Update the web reference item by using the map file.</summary>
- public void Update()
+ public Task Update()
{
WebServiceDiscoveryResult service = engine.Load (this);
- service.Update ();
+ return service.Update ();
}
/// <summary>Delete the web reference from the project.</summary>
diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/WebReferencesService.cs b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/WebReferencesService.cs
index 00aa735380..d8b367469c 100644
--- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/WebReferencesService.cs
+++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/WebReferencesService.cs
@@ -29,6 +29,7 @@ using MonoDevelop.Projects;
using System.Collections.Generic;
using MonoDevelop.WebReferences.WCF;
using MonoDevelop.WebReferences.WS;
+using MonoDevelop.Core;
namespace MonoDevelop.WebReferences
{
@@ -62,11 +63,11 @@ namespace MonoDevelop.WebReferences
// This is called from a background thread when webreferences are being
// updated asynchronously, so lets keep things simple for the users of
// this event and just ensure we proxy it to the main thread.
- if (MonoDevelop.Ide.DispatchService.IsGuiThread) {
+ if (Runtime.IsMainThread) {
if (WebReferencesChanged != null)
WebReferencesChanged (null, new WebReferencesChangedEventArgs (project));
} else {
- MonoDevelop.Ide.DispatchService.GuiDispatch (() => {
+ Runtime.RunInMainThread (() => {
if (WebReferencesChanged != null)
WebReferencesChanged (null, new WebReferencesChangedEventArgs (project));
});
diff --git a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/WebServiceDiscoveryResult.cs b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/WebServiceDiscoveryResult.cs
index 62d4395fc4..2e8bfe4398 100644
--- a/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/WebServiceDiscoveryResult.cs
+++ b/main/src/addins/MonoDevelop.WebReferences/MonoDevelop.WebReferences/WebServiceDiscoveryResult.cs
@@ -30,6 +30,7 @@ using MonoDevelop.Core;
using System.Collections.Generic;
using System.IO;
using System.CodeDom.Compiler;
+using System.Threading.Tasks;
namespace MonoDevelop.WebReferences
{
@@ -72,7 +73,7 @@ namespace MonoDevelop.WebReferences
public abstract string ProxyGenerator { get; }
- public virtual void GenerateFiles (DotNetProject project, string namspace, string referenceName)
+ public virtual async Task GenerateFiles (DotNetProject project, string namspace, string referenceName)
{
//make sure we have a valid value for the namespace
if (string.IsNullOrEmpty (namspace)) {
@@ -90,10 +91,10 @@ namespace MonoDevelop.WebReferences
project.Files.Remove (f);
// Generate the wsdl, disco and map files
- string mapSpec = GenerateDescriptionFiles (project, basePath);
+ string mapSpec = await GenerateDescriptionFiles (project, basePath);
// Generate the proxy class
- string proxySpec = CreateProxyFile (project, basePath, namspace + "." + referenceName, "Reference");
+ string proxySpec = await CreateProxyFile (project, basePath, namspace + "." + referenceName, "Reference");
ProjectFile mapFile = project.Files.GetFile (mapSpec);
if (mapFile == null) {
@@ -128,7 +129,7 @@ namespace MonoDevelop.WebReferences
string targetName = project.TargetRuntime.AssemblyContext.GetAssemblyNameForVersion (refName, null, project.TargetFramework);
//FIXME: warn when we could not find a matching target assembly
if (targetName != null) {
- packageRef = new ProjectReference (ReferenceType.Package, targetName);
+ packageRef = ProjectReference.CreateAssemblyReference (targetName);
if (!project.References.Contains (packageRef))
project.References.Add (packageRef);
}
@@ -136,10 +137,10 @@ namespace MonoDevelop.WebReferences
WebReferencesService.NotifyWebReferencesChanged (project);
}
- protected abstract string GenerateDescriptionFiles (DotNetProject dotNetProject, FilePath basePath);
+ protected abstract Task<string> GenerateDescriptionFiles (DotNetProject dotNetProject, FilePath basePath);
- protected abstract string CreateProxyFile (DotNetProject dotNetProject, FilePath basePath, string proxyNamespace, string referenceName);
+ protected abstract Task<string> CreateProxyFile (DotNetProject dotNetProject, FilePath basePath, string proxyNamespace, string referenceName);
- public abstract void Update ();
+ public abstract Task Update ();
}
}
diff --git a/main/src/addins/MonoDevelop.WebReferences/gtk-gui/MonoDevelop.WebReferences.Dialogs.WCFConfigWidget.cs b/main/src/addins/MonoDevelop.WebReferences/gtk-gui/MonoDevelop.WebReferences.Dialogs.WCFConfigWidget.cs
index 26c8b48195..3788b1590a 100644
--- a/main/src/addins/MonoDevelop.WebReferences/gtk-gui/MonoDevelop.WebReferences.Dialogs.WCFConfigWidget.cs
+++ b/main/src/addins/MonoDevelop.WebReferences/gtk-gui/MonoDevelop.WebReferences.Dialogs.WCFConfigWidget.cs
@@ -5,14 +5,23 @@ namespace MonoDevelop.WebReferences.Dialogs
public partial class WCFConfigWidget
{
private global::Gtk.VBox dialog1_VBox;
+
private global::Gtk.Table wcfOptions;
+
private global::Gtk.ComboBox dictionaryCollection;
+
private global::Gtk.Label label1;
+
private global::Gtk.Label label2;
+
private global::Gtk.Label label3;
+
private global::Gtk.Label label4;
+
private global::Gtk.ComboBox listAccess;
+
private global::Gtk.ComboBox listAsync;
+
private global::Gtk.ComboBox listCollection;
protected virtual void Build ()
diff --git a/main/src/addins/MonoDevelop.WebReferences/gtk-gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs b/main/src/addins/MonoDevelop.WebReferences/gtk-gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs
index 9a240c227b..b103b95f2a 100644
--- a/main/src/addins/MonoDevelop.WebReferences/gtk-gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs
+++ b/main/src/addins/MonoDevelop.WebReferences/gtk-gui/MonoDevelop.WebReferences.Dialogs.WebReferenceDialog.cs
@@ -5,29 +5,53 @@ namespace MonoDevelop.WebReferences.Dialogs
internal partial class WebReferenceDialog
{
private global::Gtk.UIManager UIManager;
+
private global::Gtk.Action btnNavBack;
+
private global::Gtk.Action btnNavNext;
+
private global::Gtk.Action btnRefresh;
+
private global::Gtk.Action btnStop;
+
private global::Gtk.Action btnHome;
+
private global::Gtk.VBox vbxContainer;
+
private global::Gtk.Toolbar tlbNavigate;
+
private global::Gtk.Table tblWebReferenceUrl;
+
private global::Gtk.Button btnGO;
+
private global::Gtk.Label lblWebServiceUrl;
+
private global::Gtk.Entry tbxReferenceURL;
+
private global::Gtk.Frame frmBrowser;
+
private global::Gtk.Table tblReferenceName;
+
private global::Gtk.HBox hbox1;
+
private global::Gtk.ComboBox comboModel;
+
private global::Gtk.Label label1;
+
private global::Gtk.Label lblNamespace;
+
private global::Gtk.Label lblReference;
+
private global::Gtk.Entry tbxNamespace;
+
private global::Gtk.Entry tbxReferenceName;
+
private global::Gtk.Button btnCancel;
+
private global::Gtk.Button btnBack;
+
private global::Gtk.Button btnOK;
+
private global::Gtk.Button btnConfig;
protected virtual void Build ()
@@ -61,7 +85,7 @@ namespace MonoDevelop.WebReferences.Dialogs
this.vbxContainer = new global::Gtk.VBox ();
this.vbxContainer.Name = "vbxContainer";
// Container child vbxContainer.Gtk.Box+BoxChild
- this.UIManager.AddUiFromString (@"<ui><toolbar name='tlbNavigate'><toolitem name='btnNavBack' action='btnNavBack'/><toolitem name='btnNavNext' action='btnNavNext'/><toolitem name='btnRefresh' action='btnRefresh'/><toolitem name='btnStop' action='btnStop'/><toolitem name='btnHome' action='btnHome'/></toolbar></ui>");
+ this.UIManager.AddUiFromString ("<ui><toolbar name='tlbNavigate'><toolitem name='btnNavBack' action='btnNavBack'/><toolitem name='btnNavNext' action='btnNavNext'/><toolitem name='btnRefresh' action='btnRefresh'/><toolitem name='btnStop' action='btnStop'/><toolitem name='btnHome' action='btnHome'/></toolbar></ui>");
this.tlbNavigate = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/tlbNavigate")));
this.tlbNavigate.Name = "tlbNavigate";
this.tlbNavigate.ShowArrow = false;
diff --git a/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16.png b/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16.png
new file mode 100644
index 0000000000..a86f7c7217
--- /dev/null
+++ b/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16@2x.png b/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16@2x.png
new file mode 100644
index 0000000000..a4bd682242
--- /dev/null
+++ b/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~dark.png b/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~dark.png
new file mode 100644
index 0000000000..c07eb02834
--- /dev/null
+++ b/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~dark@2x.png b/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~dark@2x.png
new file mode 100644
index 0000000000..29a92d0e19
--- /dev/null
+++ b/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~dark~sel.png b/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~dark~sel.png
new file mode 100644
index 0000000000..ca426c05ad
--- /dev/null
+++ b/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~dark~sel@2x.png
new file mode 100644
index 0000000000..4274f200a6
--- /dev/null
+++ b/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~sel.png b/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~sel.png
new file mode 100644
index 0000000000..ca426c05ad
--- /dev/null
+++ b/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~sel@2x.png b/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~sel@2x.png
new file mode 100644
index 0000000000..4274f200a6
--- /dev/null
+++ b/main/src/addins/MonoDevelop.WebReferences/icons/folder-web-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16.png b/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16.png
new file mode 100644
index 0000000000..c69492cf42
--- /dev/null
+++ b/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16@2x.png b/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16@2x.png
new file mode 100644
index 0000000000..d7266a7ff2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~dark.png b/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~dark.png
new file mode 100644
index 0000000000..cb0cf67908
--- /dev/null
+++ b/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~dark.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~dark@2x.png b/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~dark@2x.png
new file mode 100644
index 0000000000..c1e8eb8720
--- /dev/null
+++ b/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~dark~sel.png b/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~dark~sel.png
new file mode 100644
index 0000000000..88b20a94f2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~dark~sel@2x.png b/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~dark~sel@2x.png
new file mode 100644
index 0000000000..c94e07680d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~sel.png b/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~sel.png
new file mode 100644
index 0000000000..88b20a94f2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~sel.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~sel@2x.png b/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~sel@2x.png
new file mode 100644
index 0000000000..c94e07680d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.WebReferences/icons/web-reference-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDeveloperExtensions/ChangeLog b/main/src/addins/MonoDeveloperExtensions/ChangeLog
deleted file mode 100644
index a4f1db7c01..0000000000
--- a/main/src/addins/MonoDeveloperExtensions/ChangeLog
+++ /dev/null
@@ -1,466 +0,0 @@
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDeveloperExtensions.addin.xml: Bumped MD version.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * Commands.cs:
- * MonoSolutionItemHandler.cs:
- * MonoDeveloperExtensions.csproj:
- * MonoDeveloperExtensions.addin.xml: Merged MD.Projects into
- MD.Core, and MD.Projects.Gui, MD.Core.Gui and MD.Components
- into MD.Ide.
-
-2010-01-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.csproj: Flush.
-
-2009-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoSolutionItemHandler.cs: Introduced the
- ConfigurationSelector class to all methods that previously
- took a configuration name as string. This eliminates the
- ambiguity between solution configuration names and project
- configuration names.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDeveloperExtensions.addin.xml: Bump MD version.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDeveloperExtensions.addin.xml: Bump MD version.
-
-2009-09-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoMakefileFormat.cs: Use the new DotNetAssemblyProject
- class instead of DotNetProject, which is now abstract.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.csproj: Updated dependencies. We now
- depend on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoMakefileFormat.cs: Use the new FilePath class for
- handling file and directory paths.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * MonoDeveloperExtensions.csproj: don't require specific
- gtk-sharp version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDeveloperExtensions.addin.xml: Bump MD version.
-
-2009-02-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.addin.xml: Track merge of the
- project pad context menu.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDeveloperExtensions.csproj: Make implicit references
- explicit. Csc is much pickier about these.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.csproj: Flush.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.mds:
- * MonoDeveloperExtensions.mdp:
- * MonoDeveloperExtensions.csproj: Migrated to MSBuild file
- format.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDeveloperExtensions.addin.xml: Bump MD version.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDeveloperExtensions.mdp: Flush project format changes.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * NUnit/NUnit.mdp:
- * MonoDeveloperExtensions.mdp: All projects now require fx 3.5.
-
-2008-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoMakefileFormat.cs: Track API changes.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.mdp: Don't require a specific version of
- Mono.Addins.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * NUnit/Makefile.am: Make it work for parallel build.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * AssemblyInfo.cs: Add AssemblyInfo.cs files that are autogenerated from
- the addin manifests.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.addin.xml: Bump MD version.
-
-2008-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoSolutionItemHandler.cs: Track API.
-
-2008-09-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoSolutionItemHandler.cs: Ignore compiler messages which are not
- errors or warnings. Fixes bug #393621.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * NUnit/NUnit.mdp, MonoDeveloperExtensions.mdp: Updated generated code.
-
-2008-06-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoMakefileFormat.cs: Track api changes.
-
-2008-06-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoMakefileFormat.cs: Avoid re-initializing the project handler for
- projects already created with the Mono format.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.addin.xml: Bump MD version.
-
-2008-05-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoSolutionItemHandler.cs: Fix warning.
-
-2008-05-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoMakefileFormat.cs: Track api changes.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.addin.xml: Merged the extension points for
- project and solution option panels into a single extension point. A
- single extension point will now be used for all kinds of items.
- Extension conditions can be used to make panels visible only for
- some specific item types.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoSolutionItemHandler.cs: Replaced
- ICompilerResult/DefaultCompilerResult/CompilerResults by a new
- BuildResult class, which has owner information at error level, so
- it is possible to know which project generated an error when
- building a solution. Updated Task and TaskService to use the new
- owner information.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.mds, MonoMakefileFormat.cs, Commands.cs,
- MonoSolutionItemHandler.cs, Makefile.am,
- MonoDeveloperExtensions.addin.xml, NUnit/MonoTestProvider.cs,
- MonoDeveloperExtensions.mdp: New project model changes.
-
-2008-03-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.mdp: Removed unneeded dependencies.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am, MonoDeveloperExtensions.mdp: Removed some unused glade and
- gnome-sharp references (only the unused). But I'll continue to remove
- glade, we need to lower the dependency tree a bit.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.addin.xml: Update MD version.
-
-2008-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.addin.xml: Updated add-in category and
- description.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.addin.xml: Bump add-in versions.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am, NUnit/NUnit.mdp, MonoDeveloperExtensions.mdp: Directory
- reorganization.
-
-2007-11-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoProject.cs: Use RootCombine instead of CurrentOpenCombine when
- possible.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.addin.xml: Bump MD version.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.mds, MonoDeveloperExtensions.mdp, NUnit/NUnit.mdp:
- Project file names updated by change in MD path functions.
-
-2007-10-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoProject.cs, MonoProjectConfiguration.cs: MonoProject now is a subclass
- of DotNetProject. Project export to VS format now works.
-
-2007-10-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoMakefileFormat.cs, MonoProject.cs: Make sure the .sources file is
- included when exporting the project.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.addin.xml: Bump MD version.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am, MonoDeveloperExtensions.addin.xml,
- MonoDeveloperExtensions.mdp, NUnit/Makefile.am: Reorganized the
- extension point hierarchy. Embedded all add-in manifests as resources.
-
-2007-08-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Commands.cs: Converted DispatchService to a static class.
-
-2007-06-19 Ankit Jain <jankit@novell.com>
-
- Fix bug#81901.
- * MonoProject.cs (AddSourceFile): Use File.* for file operations
- instead of FileService.
- (RemoveSourceFile): Likewise.
-
-2007-05-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.addin.xml: Removed MS namespace from add-in
- dependency.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.mdp: Copy the .addins.xml file to the output
- dir.
-
-2007-05-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am, MonoDeveloperExtensions.mdp: Reference shared assemblies
- from the correct location.
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am, MonoDeveloperExtensions.addin.xml,
- MonoDeveloperExtensions.mdp: Migration to Mono.Addins.
-
-2007-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoMakefileFormat.cs: Track api changes.
- * MonoDeveloperExtensions.mdp: Updated.
-
-2007-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoMakefileFormat.cs: Save MonoProject and MonoCombine objects only.
- * MonoDeveloperExtensions.mdp, NUnit/NUnit.mdp: Disable local-copy
- references.
-
-2007-03-08 Marek Sieradzki <marek.sieradzki@gmail.com>
-
- * MonoTestProvider.cs: Removing as it was already moved to separate
- assembly.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * NUnit/NUnit.mdp: Set target runtime to 2.0.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.addin.xml: Change add-in versions to 0.13.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am, MonoDeveloperExtensions.mdp, NUnit/Makefile.am,
- NUnit/NUnit.mdp: Synchronized MD project and makefile.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs: Removed version auto-increment.
-
-2007-02-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.mds, MonoDeveloperExtensions.mdp,
- NUnit/NUnit.mdp: Updated.
- * MonoProject.cs: Track api changes.
-
-2007-02-06 Ankit Jain <jankit@novell.com>
-
- * Commands.cs: Remove all svn commands. We have svn integrated now.
- * MonoDeveloperExtensions.addin.xml: Likewise.
-
-2007-02-06 Ankit Jain <jankit@novell.com>
-
- * MonoProject.cs (OnClean): Override.
-
-2006-02-02 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDeveloperExtensions.addin.xml: replaced icon for install command by gtk+ 2.4 stock icon
-
-2006-12-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoProject.cs: Use the FileService for copying and deleting files.
-
-2006-12-07 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDeveloperExtensions.mdp: Updated so it can
- be built from MonoDevelop.
-
-2006-09-19 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * NUnit: Added svn:ignore for MonoDeveloperExtensions_nunit.pidb
-
-2006-08-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoCombine.cs:
- * MonoProject.cs: Track api changes.
-
-2006-07-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.addin.xml: Updated versions.
- * MonoDeveloperExtensions.mdp: Updated.
-
-2006-06-29 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoProject.cs: Implement SupportedLanguages, to filter file templates.
-
-2006-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoProject.cs: Removed dependency to NUnit add-in.
- * Makefile.am: Removed dependency to NUnit add-in. Added the
- new nunit module to the build.
-
- * MonoDeveloperExtensions.addin.xml: Added optional module which
- extends the nunit add-in.
-
- * NUnit/MonoTestProvider.cs:
- * NUnit/Makefile.am:
- * NUnit/NUnit.mdp: Created a new assembly which implements the nunit
- extension for Mono projects.
-
-2006-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.addin.xml: Updated versions.
- * MonoDeveloperExtensions.mdp: Updated.
-
-2006-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.addin.xml: Updated references.
-
-2006-03-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions/MonoMakefileFormat.cs: Include 2.0
- directories in the solution. Patch by Marek Sieradzki.
-
-2006-03-29 Grzegorz Sobanski <silk@boktor.net>
-
- * Makefile.am: removed unneeded references to nunit.
-
-2006-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.mdp: Updated.
- * Makefile.am: Use an unified format. Patch by Matze Braun.
- * MonoDeveloperExtensions.addin.xml: Updated add-in versions.
-
-2006-02-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoMakefileFormat.cs: Track changes in Makefile format, again.
-
-2006-01-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoMakefileFormat.cs: Track changes in Makefile format.
-
-2005-10-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Commands.cs: Always open documents in the GUI thread.
-
-2005-10-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.addin.xml: Fixed addin header information.
- Use "id" attribuet instead of "name" to identify addins.
-
-2005-10-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.addin.xml: Added addin dependencies.
-
-2005-09-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoProject.cs: Use the new regex for parsing error messages.
- * Commands.cs: Use an external console for the ci command.
-
-2005-08-10 Ben Motmans <ben.motmans@gmail.com>
-
- * MonoDeveloperExtensions.mdp: references update
-
-2005-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions/Commands.cs:
- * MonoDeveloperExtensions/MonoProject.cs: Track api changes.
-
-2005-07-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoMakefileFormat.cs: Avoid adding projects twice.
- * MonoProject.cs:
- * MonoTestProvider.cs: Generate a unit test tree for assemblies that
- have a Test directory.
- * Makefile.am: Added conditional build.
- * MonoDeveloperExtensions.addin.xml: This addin depends on the nunit addin.
-
-2005-07-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoProject.cs: Implemented CreateConfiguration method.
- * MonoDeveloperExtensions.addin.xml: Added install command
- to the correct toolbar.
-
-2005-04-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDeveloperExtensions.addin.xml:
- * Commands.cs: Use the new command service. Added hacky support for
- basic svn operations.
-
-2005-04-17 John Luke <john.luke@gmail.com>
-
- * Makefile.am: fix distcheck
-
-2005-04-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoProject.cs: Look for ChangeLog files in a more rational
- (and faster) way.
-
-2005-05-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoProject.cs: Update the sources file when files are renamed.
- Don't add the ChangeLog file to the project for now, it's too slow
- to look for it.
-
-2005-02-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoProject.cs: Don't try to parse errors from the stdout, only
- from stderr.
- * MonoMakefileFormat.cs: In GetValidFormatName, keep the file path.
-
diff --git a/main/src/addins/MonoDeveloperExtensions/Commands.cs b/main/src/addins/MonoDeveloperExtensions/Commands.cs
index 9c0477378e..9601cd5eb0 100644
--- a/main/src/addins/MonoDeveloperExtensions/Commands.cs
+++ b/main/src/addins/MonoDeveloperExtensions/Commands.cs
@@ -30,7 +30,7 @@ using MonoDevelop.Projects;
using MonoDevelop.Core;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide;
-
+using System.Threading.Tasks;
namespace MonoDeveloper
{
@@ -45,19 +45,19 @@ namespace MonoDeveloper
{
DotNetProject p = IdeApp.ProjectOperations.CurrentSelectedProject as DotNetProject;
if (p != null)
- DispatchService.BackgroundDispatch (new StatefulMessageHandler (Install), p);
+ Task.Run (() => Install (p));
}
protected override void Update (CommandInfo info)
{
- info.Visible = MonoMakefileFormat.IsMonoProject (IdeApp.ProjectOperations.CurrentSelectedProject);
+ info.Visible = IdeApp.ProjectOperations.CurrentSelectedItem is MonoMakefileProjectExtension;
}
- void Install (object prj)
+ async void Install (object prj)
{
DotNetProject p = prj as DotNetProject;
- using (IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetBuildProgressMonitor ()) {
- p.RunTarget (monitor, "install", IdeApp.Workspace.ActiveConfiguration);
+ using (ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetBuildProgressMonitor ()) {
+ await p.RunTarget (monitor, "install", IdeApp.Workspace.ActiveConfiguration);
}
}
diff --git a/main/src/addins/MonoDeveloperExtensions/MonoDeveloperExtensions.addin.xml b/main/src/addins/MonoDeveloperExtensions/MonoDeveloperExtensions.addin.xml
index f8288a171a..96813bd4dc 100644
--- a/main/src/addins/MonoDeveloperExtensions/MonoDeveloperExtensions.addin.xml
+++ b/main/src/addins/MonoDeveloperExtensions/MonoDeveloperExtensions.addin.xml
@@ -1,8 +1,7 @@
<ExtensionModel>
- <Extension path = "/MonoDevelop/ProjectModel/FileFormats">
- <FileFormat id = "MonoMakefile" name="Mono Makefile"
- class = "MonoDeveloper.MonoMakefileFormat" />
+ <Extension path = "/MonoDevelop/ProjectModel/WorkspaceObjectReaders">
+ <Class class = "MonoDeveloper.MonoMakefileProjectReader" />
</Extension>
<Extension path = "/MonoDevelop/ProjectModel/Gui/ItemOptionPanels">
diff --git a/main/src/addins/MonoDeveloperExtensions/MonoDeveloperExtensions.csproj b/main/src/addins/MonoDeveloperExtensions/MonoDeveloperExtensions.csproj
index a994b138b5..92f57f4f76 100644
--- a/main/src/addins/MonoDeveloperExtensions/MonoDeveloperExtensions.csproj
+++ b/main/src/addins/MonoDeveloperExtensions/MonoDeveloperExtensions.csproj
@@ -75,10 +75,11 @@
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="MonoMakefile.cs" />
- <Compile Include="MonoMakefileFormat.cs" />
<Compile Include="Commands.cs" />
- <Compile Include="MonoSolutionItemHandler.cs" />
<Compile Include="AddinInfo.cs" />
+ <Compile Include="MonoMakefileSolutionExtension.cs" />
+ <Compile Include="MonoMakefileProjectExtension.cs" />
+ <Compile Include="MonoMakefileProjectReader.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="MonoDeveloperExtensions.addin.xml">
diff --git a/main/src/addins/MonoDeveloperExtensions/MonoMakefile.cs b/main/src/addins/MonoDeveloperExtensions/MonoMakefile.cs
index 8168d90acb..672a5ef378 100644
--- a/main/src/addins/MonoDeveloperExtensions/MonoMakefile.cs
+++ b/main/src/addins/MonoDeveloperExtensions/MonoMakefile.cs
@@ -41,6 +41,8 @@ namespace MonoDeveloper
string multilineMatch = @"(((?<content>.*)(?<!\\)\n)|((?<content>.*?)\\\n(\t(?<content>.*?)\\\n)*\t(?<content>.*?)(?<!\\)\n))";
string fileName;
+ public static string[] MonoConfigurations = { "default", "net_4_0" };
+
public MonoMakefile (string file)
{
this.fileName = file;
diff --git a/main/src/addins/MonoDeveloperExtensions/MonoMakefileFormat.cs b/main/src/addins/MonoDeveloperExtensions/MonoMakefileFormat.cs
deleted file mode 100644
index ce6dd41f4a..0000000000
--- a/main/src/addins/MonoDeveloperExtensions/MonoMakefileFormat.cs
+++ /dev/null
@@ -1,204 +0,0 @@
-//
-// MonoMakefileFormat.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-using MonoDevelop.Core;
-using System.Text.RegularExpressions;
-using MonoDevelop.Projects;
-using MonoDevelop.Projects.Extensions;
-
-namespace MonoDeveloper
-{
- public class MonoMakefileFormat: IFileFormat
- {
- public static readonly string[] Configurations = new string [] {
- "default", "net_2_0"
- };
-
- public string Name {
- get { return "Mono Makefile"; }
- }
-
- public FilePath GetValidFormatName (object obj, FilePath fileName)
- {
- return fileName.ParentDirectory.Combine ("Makefile");
- }
-
- public bool CanReadFile (FilePath file, Type expectedType)
- {
- if (file.FileName != "Makefile") return false;
- MonoMakefile mkfile = new MonoMakefile (file);
- if (mkfile.Content.IndexOf ("build/rules.make") == -1) return false;
-
- if (mkfile.GetVariable ("LIBRARY") != null) return expectedType.IsAssignableFrom (typeof(DotNetProject));
- if (mkfile.GetVariable ("PROGRAM") != null) return expectedType.IsAssignableFrom (typeof(DotNetProject));
- string subdirs = mkfile.GetVariable ("SUBDIRS");
- if (subdirs != null && subdirs.Trim (' ','\t') != "")
- return expectedType.IsAssignableFrom (typeof(Solution)) || expectedType.IsAssignableFrom (typeof(SolutionFolder));
-
- return false;
- }
-
- public bool CanWriteFile (object obj)
- {
- return (obj is SolutionFolder) || IsMonoProject (obj);
- }
-
- public void WriteFile (FilePath file, object node, IProgressMonitor monitor)
- {
- }
-
- public List<FilePath> GetItemFiles (object obj)
- {
- List<FilePath> col = new List<FilePath> ();
- DotNetProject mp = obj as DotNetProject;
- if (mp != null) {
- MonoSolutionItemHandler handler = ProjectExtensionUtil.GetItemHandler (mp) as MonoSolutionItemHandler;
- if (handler != null && File.Exists (handler.SourcesFile)) {
- col.Add (mp.FileName);
- col.Add (handler.SourcesFile);
- }
- }
- return col;
- }
-
- public object ReadFile (FilePath fileName, Type expectedType, IProgressMonitor monitor)
- {
- return ReadFile (fileName, false, monitor);
- }
-
- public object ReadFile (FilePath fileName, bool hasParentSolution, IProgressMonitor monitor)
- {
- FilePath basePath = fileName.ParentDirectory;
- MonoMakefile mkfile = new MonoMakefile (fileName);
- string aname = mkfile.GetVariable ("LIBRARY");
- if (aname == null) aname = mkfile.GetVariable ("PROGRAM");
-
- try {
- ProjectExtensionUtil.BeginLoadOperation ();
- if (aname != null) {
- // It is a project
- monitor.BeginTask ("Loading '" + fileName + "'", 0);
- DotNetAssemblyProject project = new DotNetAssemblyProject ("C#");
- MonoSolutionItemHandler handler = new MonoSolutionItemHandler (project);
- ProjectExtensionUtil.InstallHandler (handler, project);
- project.Name = Path.GetFileName (basePath);
- handler.Read (mkfile);
- monitor.EndTask ();
- return project;
- } else {
- string subdirs;
- StringBuilder subdirsBuilder = new StringBuilder ();
- subdirsBuilder.Append (mkfile.GetVariable ("common_dirs"));
- if (subdirsBuilder.Length != 0) {
- subdirsBuilder.Append ("\t");
- subdirsBuilder.Append (mkfile.GetVariable ("net_2_0_dirs"));
- }
- if (subdirsBuilder.Length == 0)
- subdirsBuilder.Append (mkfile.GetVariable ("SUBDIRS"));
-
- subdirs = subdirsBuilder.ToString ();
- if (subdirs != null && (subdirs = subdirs.Trim (' ','\t')) != "")
- {
- object retObject;
- SolutionFolder folder;
- if (!hasParentSolution) {
- Solution sol = new Solution ();
- sol.ConvertToFormat (Services.ProjectService.FileFormats.GetFileFormat ("MonoMakefile"), false);
- sol.FileName = fileName;
- folder = sol.RootFolder;
- retObject = sol;
-
- foreach (string conf in MonoMakefileFormat.Configurations) {
- SolutionConfiguration sc = new SolutionConfiguration (conf);
- sol.Configurations.Add (sc);
- }
- } else {
- folder = new SolutionFolder ();
- folder.Name = Path.GetFileName (Path.GetDirectoryName (fileName));
- retObject = folder;
- }
-
- subdirs = subdirs.Replace ('\t',' ');
- string[] dirs = subdirs.Split (' ');
-
- monitor.BeginTask ("Loading '" + fileName + "'", dirs.Length);
- Hashtable added = new Hashtable ();
- foreach (string dir in dirs) {
- if (added.Contains (dir)) continue;
- added.Add (dir, dir);
- monitor.Step (1);
- if (dir == null) continue;
- string tdir = dir.Trim ();
- if (tdir == "") continue;
- string mfile = Path.Combine (Path.Combine (basePath, tdir), "Makefile");
- if (File.Exists (mfile) && CanReadFile (mfile, typeof(SolutionItem))) {
- SolutionItem it = (SolutionItem) ReadFile (mfile, true, monitor);
- folder.Items.Add (it);
- }
- }
- monitor.EndTask ();
- return retObject;
- }
- }
- } finally {
- ProjectExtensionUtil.EndLoadOperation ();
- }
- return null;
- }
-
- public static bool IsMonoProject (object obj)
- {
- DotNetProject p = obj as DotNetProject;
- return p != null && (ProjectExtensionUtil.GetItemHandler (p) is MonoSolutionItemHandler);
- }
-
- public void ConvertToFormat (object obj)
- {
- // Nothing can be converted to this format.
- }
-
- public bool SupportsMixedFormats {
- get { return false; }
- }
-
- public IEnumerable<string> GetCompatibilityWarnings (object obj)
- {
- yield break;
- }
-
- public bool SupportsFramework (MonoDevelop.Core.Assemblies.TargetFramework framework)
- {
- return true;
- }
- }
-}
diff --git a/main/src/addins/MonoDeveloperExtensions/MonoMakefileProjectExtension.cs b/main/src/addins/MonoDeveloperExtensions/MonoMakefileProjectExtension.cs
new file mode 100644
index 0000000000..3bdd1a1c54
--- /dev/null
+++ b/main/src/addins/MonoDeveloperExtensions/MonoMakefileProjectExtension.cs
@@ -0,0 +1,350 @@
+//
+// MakefileProject.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Projects;
+using MonoDevelop.Core;
+using System.Collections;
+using System.Threading.Tasks;
+using System.IO;
+using System.Text.RegularExpressions;
+using MonoDevelop.Ide;
+using MonoDevelop.Core.ProgressMonitoring;
+using MonoDevelop.Core.Execution;
+using System.CodeDom.Compiler;
+
+namespace MonoDeveloper
+{
+ public class MonoMakefileProjectExtension: DotNetProjectExtension
+ {
+ string outFile;
+ ArrayList refNames = new ArrayList ();
+ bool loading;
+ string testFileBase;
+ object unitTest;
+
+ public MonoMakefileProjectExtension ()
+ {
+ }
+
+ protected override void Initialize ()
+ {
+ base.Initialize ();
+ Project.FileAddedToProject += OnFileAddedToProject;
+ Project.FileRemovedFromProject += OnFileRemovedFromProject;
+ Project.FileRenamedInProject += OnFileRenamedInProject;
+ }
+
+ public string SourcesFile {
+ get { return outFile + ".sources"; }
+ }
+
+ protected override Task OnSave (ProgressMonitor monitor)
+ {
+ // Nothing to do, changes are saved directly to the backing file
+ return Task.FromResult (0);
+ }
+
+ internal void Read (MonoMakefile mkfile)
+ {
+ loading = true;
+
+ string basePath = Path.GetDirectoryName (mkfile.FileName);
+ string aname;
+
+ string targetAssembly = mkfile.GetVariable ("LIBRARY");
+ if (targetAssembly == null) {
+ targetAssembly = mkfile.GetVariable ("PROGRAM");
+ if (Path.GetDirectoryName (targetAssembly) == "")
+ targetAssembly = Path.Combine (basePath, targetAssembly);
+ aname = Path.GetFileName (targetAssembly);
+ } else {
+ aname = Path.GetFileName (targetAssembly);
+ string targetName = mkfile.GetVariable ("LIBRARY_NAME");
+ if (targetName != null) targetAssembly = targetName;
+ targetAssembly = "$(topdir)/class/lib/$(PROFILE)/" + targetAssembly;
+ }
+
+ outFile = Path.Combine (basePath, aname);
+ Project.FileName = mkfile.FileName;
+
+ ArrayList checkedFolders = new ArrayList ();
+
+ // Parse projects
+ string sources = outFile + ".sources";
+ StreamReader sr = new StreamReader (sources);
+ string line;
+ while ((line = sr.ReadLine ()) != null) {
+ line = line.Trim (' ','\t');
+ if (line != "") {
+ string fname = Path.Combine (basePath, line);
+ Project.Files.Add (new ProjectFile (fname));
+
+ string dir = Path.GetDirectoryName (fname);
+ if (!checkedFolders.Contains (dir)) {
+ checkedFolders.Add (dir);
+ fname = Path.Combine (dir, "ChangeLog");
+ if (File.Exists (fname))
+ Project.Files.Add (new ProjectFile (fname, BuildAction.Content));
+ }
+ }
+ }
+
+ sr.Close ();
+
+ // Project references
+ string refs = mkfile.GetVariable ("LIB_MCS_FLAGS");
+ if (refs == null || refs == "") refs = mkfile.GetVariable ("LOCAL_MCS_FLAGS");
+
+ if (refs != null && refs != "") {
+ Regex var = new Regex(@"(.*?/r:(?<ref>.*?)(( |\t)|$).*?)*");
+ Match match = var.Match (refs);
+ if (match.Success) {
+ foreach (Capture c in match.Groups["ref"].Captures)
+ refNames.Add (Path.GetFileNameWithoutExtension (c.Value));
+ }
+ }
+
+ int i = basePath.LastIndexOf ("/mcs/", basePath.Length - 2);
+ string topdir = basePath.Substring (0, i + 4);
+ targetAssembly = targetAssembly.Replace ("$(topdir)", topdir);
+
+ if (mkfile.GetVariable ("NO_TEST") != "yes") {
+ string tname = Path.GetFileNameWithoutExtension (aname) + "_test_";
+ testFileBase = Path.Combine (basePath, tname);
+ }
+
+ foreach (string sconf in MonoMakefile.MonoConfigurations) {
+ var conf = (DotNetProjectConfiguration) Project.CreateConfiguration (sconf);
+ conf.OutputDirectory = basePath;
+ conf.OutputAssembly = Path.GetFileName (targetAssembly);
+ Project.Configurations.Add (conf);
+ }
+
+ loading = false;
+ IdeApp.Workspace.SolutionLoaded += CombineOpened;
+ }
+
+ void CombineOpened (object sender, SolutionEventArgs args)
+ {
+ if (args.Solution == Project.ParentSolution) {
+ foreach (string pref in refNames) {
+ Project p = Project.ParentSolution.FindProjectByName (pref);
+ if (p != null) Project.References.Add (ProjectReference.CreateProjectReference (p));
+ }
+ }
+ }
+
+ static Regex regexError = new Regex (@"^(\s*(?<file>.*)\((?<line>\d*)(,(?<column>\d*[\+]*))?\)(:|)\s+)*(?<level>\w+)\s*(?<number>.*):\s(?<message>.*)",
+ RegexOptions.Compiled | RegexOptions.ExplicitCapture);
+
+ protected override Task<TargetEvaluationResult> OnRunTarget (ProgressMonitor monitor, string target, ConfigurationSelector configuration, TargetEvaluationContext context)
+ {
+ if (target == ProjectService.BuildTarget)
+ target = "all";
+ else if (target == ProjectService.CleanTarget)
+ target = "clean";
+
+ DotNetProjectConfiguration conf = (DotNetProjectConfiguration) Project.GetConfiguration (configuration);
+
+ return Task<TargetEvaluationResult>.Factory.StartNew (delegate {
+ using (var output = new StringWriter ()) {
+ using (var tw = new LogTextWriter ()) {
+ tw.ChainWriter (output);
+ tw.ChainWriter (monitor.Log);
+
+ using (ProcessWrapper proc = Runtime.ProcessService.StartProcess ("make", "PROFILE=" + conf.Id + " " + target, conf.OutputDirectory, monitor.Log, tw, null))
+ proc.WaitForOutput ();
+
+ tw.UnchainWriter (output);
+ tw.UnchainWriter (monitor.Log);
+
+ CompilerResults cr = new CompilerResults (null);
+ string[] lines = output.ToString ().Split ('\n');
+ foreach (string line in lines) {
+ CompilerError err = CreateErrorFromString (line);
+ if (err != null)
+ cr.Errors.Add (err);
+ }
+
+ return new TargetEvaluationResult (new BuildResult (cr, output.ToString ()));
+ }
+ }
+ });
+ }
+
+ private CompilerError CreateErrorFromString (string error_string)
+ {
+ // When IncludeDebugInformation is true, prevents the debug symbols stats from braeking this.
+ if (error_string.StartsWith ("WROTE SYMFILE") ||
+ error_string.StartsWith ("make[") ||
+ error_string.StartsWith ("OffsetTable") ||
+ error_string.StartsWith ("Compilation succeeded") ||
+ error_string.StartsWith ("Compilation failed"))
+ return null;
+
+ CompilerError error = new CompilerError();
+
+ Match match=regexError.Match(error_string);
+ if (!match.Success)
+ return null;
+
+ string level = match.Result("${level}");
+ if (level == "warning")
+ error.IsWarning = true;
+ else if (level != "error")
+ return null;
+
+ if (String.Empty != match.Result("${file}"))
+ error.FileName = Path.Combine (Project.BaseDirectory, match.Result("${file}"));
+ if (String.Empty != match.Result("${line}"))
+ error.Line=Int32.Parse(match.Result("${line}"));
+ if (String.Empty != match.Result("${column}"))
+ error.Column = Int32.Parse(match.Result("${column}"));
+ error.ErrorNumber = match.Result ("${number}");
+ error.ErrorText = match.Result ("${message}");
+ return error;
+ }
+
+ void OnFileAddedToProject (object s, ProjectFileEventArgs args)
+ {
+ if (loading) return;
+
+ foreach (ProjectFileEventInfo e in args) {
+ if (e.ProjectFile.BuildAction != BuildAction.Compile)
+ continue;
+ AddSourceFile (e.ProjectFile.Name);
+ }
+ }
+
+ void OnFileRemovedFromProject (object s, ProjectFileEventArgs args)
+ {
+ if (loading) return;
+
+ foreach (ProjectFileEventInfo e in args) {
+ if (e.ProjectFile.BuildAction != BuildAction.Compile)
+ continue;
+
+ RemoveSourceFile (e.ProjectFile.Name);
+ }
+ }
+
+ void OnFileRenamedInProject (object s, ProjectFileRenamedEventArgs args)
+ {
+ if (loading) return;
+
+ foreach (ProjectFileRenamedEventInfo e in args) {
+ if (e.ProjectFile.BuildAction != BuildAction.Compile)
+ continue;
+
+ if (RemoveSourceFile (e.OldName))
+ AddSourceFile (e.NewName);
+ }
+ }
+
+ void AddSourceFile (string sourceFile)
+ {
+ StreamReader sr = null;
+ StreamWriter sw = null;
+
+ try {
+ sr = new StreamReader (outFile + ".sources");
+ sw = new StreamWriter (outFile + ".sources.new");
+
+ string newFile = Project.GetRelativeChildPath (sourceFile);
+ if (newFile.StartsWith ("./")) newFile = newFile.Substring (2);
+
+ string line;
+ while ((line = sr.ReadLine ()) != null) {
+ string file = line.Trim (' ','\t');
+ if (newFile != null && (file == "" || string.Compare (file, newFile) > 0)) {
+ sw.WriteLine (newFile);
+ newFile = null;
+ }
+ sw.WriteLine (line);
+ }
+ if (newFile != null)
+ sw.WriteLine (newFile);
+ } finally {
+ if (sr != null) sr.Close ();
+ if (sw != null) sw.Close ();
+ }
+ File.Delete (outFile + ".sources");
+ File.Move (outFile + ".sources.new", outFile + ".sources");
+ }
+
+ bool RemoveSourceFile (string sourceFile)
+ {
+ StreamReader sr = null;
+ StreamWriter sw = null;
+ bool found = false;
+
+ try {
+ sr = new StreamReader (outFile + ".sources");
+ sw = new StreamWriter (outFile + ".sources.new");
+
+ string oldFile = Project.GetRelativeChildPath (sourceFile);
+ if (oldFile.StartsWith ("./")) oldFile = oldFile.Substring (2);
+
+ string line;
+ while ((line = sr.ReadLine ()) != null) {
+ string file = line.Trim (' ','\t');
+ if (oldFile != file)
+ sw.WriteLine (line);
+ else
+ found = true;
+ }
+ } finally {
+ if (sr != null) sr.Close ();
+ if (sw != null) sw.Close ();
+ }
+ if (found) {
+ File.Delete (outFile + ".sources");
+ File.Move (outFile + ".sources.new", outFile + ".sources");
+ }
+ return found;
+ }
+
+ public override void Dispose ()
+ {
+ Project.FileAddedToProject -= OnFileAddedToProject;
+ Project.FileRemovedFromProject -= OnFileRemovedFromProject;
+ Project.FileRenamedInProject -= OnFileRenamedInProject;
+ IdeApp.Workspace.SolutionLoaded -= CombineOpened;
+ base.Dispose ();
+ }
+
+ public string GetTestFileBase ()
+ {
+ return testFileBase;
+ }
+
+ public object UnitTest {
+ get { return unitTest; }
+ set { unitTest = value; }
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDeveloperExtensions/MonoMakefileProjectReader.cs b/main/src/addins/MonoDeveloperExtensions/MonoMakefileProjectReader.cs
new file mode 100644
index 0000000000..317e5d1840
--- /dev/null
+++ b/main/src/addins/MonoDeveloperExtensions/MonoMakefileProjectReader.cs
@@ -0,0 +1,143 @@
+//
+// MonoMakeFileProjectServiceExtension.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Projects;
+using MonoDevelop.Core;
+using System.Threading.Tasks;
+using MonoDevelop.Projects.MSBuild;
+using System.IO;
+using System.Text;
+using System.Collections.Generic;
+
+namespace MonoDeveloper
+{
+ public class MonoMakefileProjectReader: WorkspaceObjectReader
+ {
+ public override bool CanRead (FilePath file, Type expectedType)
+ {
+ if (file.FileName != "Makefile") return false;
+ MonoMakefile mkfile = new MonoMakefile (file);
+ if (mkfile.Content.IndexOf ("build/rules.make") == -1) return false;
+
+ if (mkfile.GetVariable ("LIBRARY") != null) return expectedType.IsAssignableFrom (typeof(DotNetProject));
+ if (mkfile.GetVariable ("PROGRAM") != null) return expectedType.IsAssignableFrom (typeof(DotNetProject));
+ string subdirs = mkfile.GetVariable ("SUBDIRS");
+ if (subdirs != null && subdirs.Trim (' ','\t') != "")
+ return expectedType.IsAssignableFrom (typeof(Solution)) || expectedType.IsAssignableFrom (typeof(SolutionFolder));
+
+ return false;
+ }
+
+ public override Task<SolutionItem> LoadSolutionItem (ProgressMonitor monitor, SolutionLoadContext ctx, string fileName, MSBuildFileFormat expectedFormat, string typeGuid, string itemGuid)
+ {
+ return Task.Run (() => (SolutionItem) ReadFile (fileName, false, monitor));
+ }
+
+ public override Task<WorkspaceItem> LoadWorkspaceItem (ProgressMonitor monitor, string fileName)
+ {
+ return Task.Run (() => (WorkspaceItem) ReadFile (fileName, false, monitor));
+ }
+
+ public object ReadFile (FilePath fileName, bool hasParentSolution, ProgressMonitor monitor)
+ {
+ FilePath basePath = fileName.ParentDirectory;
+ MonoMakefile mkfile = new MonoMakefile (fileName);
+ string aname = mkfile.GetVariable ("LIBRARY");
+ if (aname == null)
+ aname = mkfile.GetVariable ("PROGRAM");
+
+ if (!string.IsNullOrEmpty (aname)) {
+ monitor.BeginTask ("Loading '" + fileName + "'", 0);
+ var project = Services.ProjectService.CreateProject ("C#");
+ project.FileName = fileName;
+
+ var ext = new MonoMakefileProjectExtension ();
+ project.AttachExtension (ext);
+ ext.Read (mkfile);
+
+ monitor.EndTask ();
+ return project;
+ }
+
+ string subdirs;
+ StringBuilder subdirsBuilder = new StringBuilder ();
+ subdirsBuilder.Append (mkfile.GetVariable ("common_dirs"));
+ if (subdirsBuilder.Length != 0) {
+ subdirsBuilder.Append ("\t");
+ subdirsBuilder.Append (mkfile.GetVariable ("net_2_0_dirs"));
+ }
+ if (subdirsBuilder.Length == 0)
+ subdirsBuilder.Append (mkfile.GetVariable ("SUBDIRS"));
+
+ subdirs = subdirsBuilder.ToString ();
+ if (subdirs != null && (subdirs = subdirs.Trim (' ', '\t')) != "") {
+ object retObject;
+ SolutionFolder folder;
+ if (!hasParentSolution) {
+ Solution sol = new Solution ();
+ sol.AttachExtension (new MonoMakefileSolutionExtension ());
+ sol.FileName = fileName;
+ folder = sol.RootFolder;
+ retObject = sol;
+
+ foreach (string conf in MonoMakefile.MonoConfigurations) {
+ SolutionConfiguration sc = new SolutionConfiguration (conf);
+ sol.Configurations.Add (sc);
+ }
+ } else {
+ folder = new SolutionFolder ();
+ folder.Name = Path.GetFileName (Path.GetDirectoryName (fileName));
+ retObject = folder;
+ }
+
+ subdirs = subdirs.Replace ('\t', ' ');
+ string[] dirs = subdirs.Split (' ');
+
+ monitor.BeginTask ("Loading '" + fileName + "'", dirs.Length);
+ HashSet<string> added = new HashSet<string> ();
+ foreach (string dir in dirs) {
+ if (!added.Add (dir))
+ continue;
+ monitor.Step (1);
+ if (dir == null)
+ continue;
+ string tdir = dir.Trim ();
+ if (tdir == "")
+ continue;
+ string mfile = Path.Combine (Path.Combine (basePath, tdir), "Makefile");
+ if (File.Exists (mfile) && CanRead (mfile, typeof(SolutionItem))) {
+ SolutionFolderItem it = (SolutionFolderItem) ReadFile (mfile, true, monitor);
+ folder.Items.Add (it);
+ }
+ }
+ monitor.EndTask ();
+ return retObject;
+ }
+ return null;
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDeveloperExtensions/MonoMakefileSolutionExtension.cs b/main/src/addins/MonoDeveloperExtensions/MonoMakefileSolutionExtension.cs
new file mode 100644
index 0000000000..a09cd12563
--- /dev/null
+++ b/main/src/addins/MonoDeveloperExtensions/MonoMakefileSolutionExtension.cs
@@ -0,0 +1,41 @@
+//
+// MonoMakefileSolutionExtension.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Projects;
+using System.Threading.Tasks;
+
+namespace MonoDeveloper
+{
+ public class MonoMakefileSolutionExtension: SolutionExtension
+ {
+ protected override Task Save (MonoDevelop.Core.ProgressMonitor monitor)
+ {
+ // Saving is not supported, don't do anything.
+ return Task.FromResult (0);
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDeveloperExtensions/MonoSolutionItemHandler.cs b/main/src/addins/MonoDeveloperExtensions/MonoSolutionItemHandler.cs
deleted file mode 100644
index e9feae9213..0000000000
--- a/main/src/addins/MonoDeveloperExtensions/MonoSolutionItemHandler.cs
+++ /dev/null
@@ -1,345 +0,0 @@
-// MonoSolutionItemHandler.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.CodeDom.Compiler;
-using System.Collections;
-using System.IO;
-using System.Text.RegularExpressions;
-using MonoDevelop.Core;
-using MonoDevelop.Core.Execution;
-using MonoDevelop.Core.ProgressMonitoring;
-using MonoDevelop.Ide;
-using MonoDevelop.Projects;
-using MonoDevelop.Projects.Extensions;
-
-namespace MonoDeveloper
-{
- public class MonoSolutionItemHandler: ISolutionItemHandler
- {
- DotNetProject project;
- string outFile;
- ArrayList refNames = new ArrayList ();
- bool loading;
- string testFileBase;
- object unitTest;
-
- public MonoSolutionItemHandler (DotNetProject project)
- {
- this.project = project;
- project.FileAddedToProject += OnFileAddedToProject;
- project.FileRemovedFromProject += OnFileRemovedFromProject;
- project.FileRenamedInProject += OnFileRenamedInProject;
- }
-
- public string SourcesFile {
- get { return outFile + ".sources"; }
- }
-
- public bool SyncFileName {
- get { return false; }
- }
-
- public string ItemId {
- get {
- if (project.ParentSolution != null)
- return project.ParentSolution.GetRelativeChildPath (project.FileName);
- else
- return project.Name;
- }
- }
-
- public void Save (MonoDevelop.Core.IProgressMonitor monitor)
- {
- }
-
- internal void Read (MonoMakefile mkfile)
- {
- loading = true;
-
- string basePath = Path.GetDirectoryName (mkfile.FileName);
- string aname;
-
- string targetAssembly = mkfile.GetVariable ("LIBRARY");
- if (targetAssembly == null) {
- targetAssembly = mkfile.GetVariable ("PROGRAM");
- if (Path.GetDirectoryName (targetAssembly) == "")
- targetAssembly = Path.Combine (basePath, targetAssembly);
- aname = Path.GetFileName (targetAssembly);
- } else {
- aname = Path.GetFileName (targetAssembly);
- string targetName = mkfile.GetVariable ("LIBRARY_NAME");
- if (targetName != null) targetAssembly = targetName;
- targetAssembly = "$(topdir)/class/lib/$(PROFILE)/" + targetAssembly;
- }
-
- outFile = Path.Combine (basePath, aname);
- project.FileName = mkfile.FileName;
-
- ArrayList checkedFolders = new ArrayList ();
-
- // Parse projects
- string sources = outFile + ".sources";
- StreamReader sr = new StreamReader (sources);
- string line;
- while ((line = sr.ReadLine ()) != null) {
- line = line.Trim (' ','\t');
- if (line != "") {
- string fname = Path.Combine (basePath, line);
- project.Files.Add (new ProjectFile (fname));
-
- string dir = Path.GetDirectoryName (fname);
- if (!checkedFolders.Contains (dir)) {
- checkedFolders.Add (dir);
- fname = Path.Combine (dir, "ChangeLog");
- if (File.Exists (fname))
- project.Files.Add (new ProjectFile (fname, BuildAction.Content));
- }
- }
- }
-
- sr.Close ();
-
- // Project references
- string refs = mkfile.GetVariable ("LIB_MCS_FLAGS");
- if (refs == null || refs == "") refs = mkfile.GetVariable ("LOCAL_MCS_FLAGS");
-
- if (refs != null && refs != "") {
- Regex var = new Regex(@"(.*?/r:(?<ref>.*?)(( |\t)|$).*?)*");
- Match match = var.Match (refs);
- if (match.Success) {
- foreach (Capture c in match.Groups["ref"].Captures)
- refNames.Add (Path.GetFileNameWithoutExtension (c.Value));
- }
- }
-
- int i = basePath.LastIndexOf ("/mcs/", basePath.Length - 2);
- string topdir = basePath.Substring (0, i + 4);
- targetAssembly = targetAssembly.Replace ("$(topdir)", topdir);
-
- if (mkfile.GetVariable ("NO_TEST") != "yes") {
- string tname = Path.GetFileNameWithoutExtension (aname) + "_test_";
- testFileBase = Path.Combine (basePath, tname);
- }
-
- foreach (string sconf in MonoMakefileFormat.Configurations) {
- DotNetProjectConfiguration conf = new DotNetProjectConfiguration (sconf);
- conf.CompilationParameters = project.LanguageBinding.CreateCompilationParameters (null);
- conf.OutputDirectory = basePath;
- conf.OutputAssembly = Path.GetFileName (targetAssembly);
- project.Configurations.Add (conf);
- }
-
- loading = false;
- IdeApp.Workspace.SolutionLoaded += CombineOpened;
- }
-
- public void CombineOpened (object sender, SolutionEventArgs args)
- {
- if (args.Solution == project.ParentSolution) {
- foreach (string pref in refNames) {
- Project p = project.ParentSolution.FindProjectByName (pref);
- if (p != null) project.References.Add (new ProjectReference (p));
- }
- }
- }
-
- public BuildResult RunTarget (MonoDevelop.Core.IProgressMonitor monitor, string target, ConfigurationSelector configuration)
- {
- if (target == ProjectService.BuildTarget)
- target = "all";
- else if (target == ProjectService.CleanTarget)
- target = "clean";
-
- DotNetProjectConfiguration conf = (DotNetProjectConfiguration) project.GetConfiguration (configuration);
-
- using (var output = new StringWriter ()) {
- using (var tw = new LogTextWriter ()) {
- tw.ChainWriter (output);
- tw.ChainWriter (monitor.Log);
-
- using (ProcessWrapper proc = Runtime.ProcessService.StartProcess ("make", "PROFILE=" + conf.Id + " " + target, conf.OutputDirectory, monitor.Log, tw, null))
- proc.WaitForOutput ();
-
- tw.UnchainWriter (output);
- tw.UnchainWriter (monitor.Log);
-
- var result = new BuildResult (output.ToString (), 1, 0);
-
- string[] lines = result.CompilerOutput.Split ('\n');
- foreach (string line in lines) {
- var err = CreateErrorFromString (line);
- if (err != null)
- result.Append (err);
- }
-
- return result;
- }
- }
-
- }
-
- private BuildError CreateErrorFromString (string error_string)
- {
- // When IncludeDebugInformation is true, prevents the debug symbols stats from braeking this.
- if (error_string.StartsWith ("WROTE SYMFILE") ||
- error_string.StartsWith ("make[") ||
- error_string.StartsWith ("OffsetTable") ||
- error_string.StartsWith ("Compilation succeeded") ||
- error_string.StartsWith ("Compilation failed"))
- return null;
-
- return BuildError.FromMSBuildErrorFormat (error_string);
- }
-
- void OnFileAddedToProject (object s, ProjectFileEventArgs args)
- {
- if (loading) return;
-
- foreach (ProjectFileEventInfo e in args) {
- if (e.ProjectFile.BuildAction != BuildAction.Compile)
- continue;
- AddSourceFile (e.ProjectFile.Name);
- }
- }
-
- void OnFileRemovedFromProject (object s, ProjectFileEventArgs args)
- {
- if (loading) return;
-
- foreach (ProjectFileEventInfo e in args) {
- if (e.ProjectFile.BuildAction != BuildAction.Compile)
- continue;
-
- RemoveSourceFile (e.ProjectFile.Name);
- }
- }
-
- void OnFileRenamedInProject (object s, ProjectFileRenamedEventArgs args)
- {
- if (loading) return;
-
- foreach (ProjectFileRenamedEventInfo e in args) {
- if (e.ProjectFile.BuildAction != BuildAction.Compile)
- continue;
-
- if (RemoveSourceFile (e.OldName))
- AddSourceFile (e.NewName);
- }
- }
-
- void AddSourceFile (string sourceFile)
- {
- StreamReader sr = null;
- StreamWriter sw = null;
-
- try {
- sr = new StreamReader (outFile + ".sources");
- sw = new StreamWriter (outFile + ".sources.new");
-
- string newFile = project.GetRelativeChildPath (sourceFile);
- if (newFile.StartsWith ("./")) newFile = newFile.Substring (2);
-
- string line;
- while ((line = sr.ReadLine ()) != null) {
- string file = line.Trim (' ','\t');
- if (newFile != null && (file == "" || string.Compare (file, newFile) > 0)) {
- sw.WriteLine (newFile);
- newFile = null;
- }
- sw.WriteLine (line);
- }
- if (newFile != null)
- sw.WriteLine (newFile);
- } finally {
- if (sr != null) sr.Close ();
- if (sw != null) sw.Close ();
- }
- File.Delete (outFile + ".sources");
- File.Move (outFile + ".sources.new", outFile + ".sources");
- }
-
- bool RemoveSourceFile (string sourceFile)
- {
- StreamReader sr = null;
- StreamWriter sw = null;
- bool found = false;
-
- try {
- sr = new StreamReader (outFile + ".sources");
- sw = new StreamWriter (outFile + ".sources.new");
-
- string oldFile = project.GetRelativeChildPath (sourceFile);
- if (oldFile.StartsWith ("./")) oldFile = oldFile.Substring (2);
-
- string line;
- while ((line = sr.ReadLine ()) != null) {
- string file = line.Trim (' ','\t');
- if (oldFile != file)
- sw.WriteLine (line);
- else
- found = true;
- }
- } finally {
- if (sr != null) sr.Close ();
- if (sw != null) sw.Close ();
- }
- if (found) {
- File.Delete (outFile + ".sources");
- File.Move (outFile + ".sources.new", outFile + ".sources");
- }
- return found;
- }
-
- public void Dispose ()
- {
- project.FileAddedToProject -= OnFileAddedToProject;
- project.FileRemovedFromProject -= OnFileRemovedFromProject;
- project.FileRenamedInProject -= OnFileRenamedInProject;
- IdeApp.Workspace.SolutionLoaded -= CombineOpened;
- }
-
- public void OnModified (string hint)
- {
- }
-
- public string GetTestFileBase ()
- {
- return testFileBase;
- }
-
- public object UnitTest {
- get { return unitTest; }
- set { unitTest = value; }
- }
-
- public object GetService (Type t)
- {
- return null;
- }
- }
-}
diff --git a/main/src/addins/MonoDeveloperExtensions/NUnit/AddinInfo.cs b/main/src/addins/MonoDeveloperExtensions/NUnit/AddinInfo.cs
index 14d9f61a8c..9774d2f6f6 100644
--- a/main/src/addins/MonoDeveloperExtensions/NUnit/AddinInfo.cs
+++ b/main/src/addins/MonoDeveloperExtensions/NUnit/AddinInfo.cs
@@ -3,4 +3,4 @@ using System;
using Mono.Addins;
using Mono.Addins.Description;
-[assembly:AddinDependency ("NUnit", MonoDevelop.BuildInfo.Version)]
+[assembly:AddinDependency ("UnitTesting", MonoDevelop.BuildInfo.Version)]
diff --git a/main/src/addins/MonoDeveloperExtensions/NUnit/ChangeLog b/main/src/addins/MonoDeveloperExtensions/NUnit/ChangeLog
deleted file mode 100644
index d463fc5278..0000000000
--- a/main/src/addins/MonoDeveloperExtensions/NUnit/ChangeLog
+++ /dev/null
@@ -1,19 +0,0 @@
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * NUnit.csproj: Merged MD.Projects into MD.Core, and
- MD.Projects.Gui, MD.Core.Gui and MD.Components into MD.Ide.
-
-2010-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * NUnit.csproj: Flush.
-
-2009-10-13 Ankit Jain <jankit@novell.com>
-
- * NUnit.csproj: Import md.targets .
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * NUnit.mdp:
- * NUnit.csproj: Migrated to MSBuild file format.
-
diff --git a/main/src/addins/MonoDeveloperExtensions/NUnit/ExtensionModel.addin.xml b/main/src/addins/MonoDeveloperExtensions/NUnit/ExtensionModel.addin.xml
index 1bef6a70fc..3be216d8dc 100644
--- a/main/src/addins/MonoDeveloperExtensions/NUnit/ExtensionModel.addin.xml
+++ b/main/src/addins/MonoDeveloperExtensions/NUnit/ExtensionModel.addin.xml
@@ -1,6 +1,6 @@
<ExtensionModel>
- <Extension path = "/MonoDevelop/NUnit/TestProviders">
+ <Extension path = "/MonoDevelop/UnitTesting/TestProviders">
<Class id = "MonoTestProvider" class = "MonoDeveloper.MonoTestProvider"/>
</Extension>
diff --git a/main/src/addins/MonoDeveloperExtensions/NUnit/MonoTestProvider.cs b/main/src/addins/MonoDeveloperExtensions/NUnit/MonoTestProvider.cs
index 026631b786..7605e6302f 100644
--- a/main/src/addins/MonoDeveloperExtensions/NUnit/MonoTestProvider.cs
+++ b/main/src/addins/MonoDeveloperExtensions/NUnit/MonoTestProvider.cs
@@ -30,25 +30,24 @@ using System;
using System.IO;
using MonoDevelop.Projects;
using MonoDevelop.Projects.Extensions;
-using MonoDevelop.NUnit;
+using MonoDevelop.UnitTesting;
+using MonoDevelop.UnitTesting.NUnit;
namespace MonoDeveloper
{
class MonoTestProvider: ITestProvider
{
- public UnitTest CreateUnitTest (IWorkspaceObject entry)
+ public UnitTest CreateUnitTest (WorkspaceObject entry)
{
- if (entry is DotNetProject) {
- DotNetProject project = (DotNetProject) entry;
- MonoSolutionItemHandler handler = ProjectExtensionUtil.GetItemHandler (project) as MonoSolutionItemHandler;
- if (handler != null) {
- if (handler.UnitTest != null)
- return (UnitTest) handler.UnitTest;
- string testFileBase = handler.GetTestFileBase ();
- UnitTest testSuite = new MonoTestSuite (project, project.Name, testFileBase);
- handler.UnitTest = testSuite;
- return testSuite;
- }
+ var ext = entry.GetService<MonoMakefileProjectExtension> ();
+ if (ext != null) {
+ var project = (DotNetProject) entry;
+ if (ext.UnitTest != null)
+ return (UnitTest) ext.UnitTest;
+ string testFileBase = ext.GetTestFileBase ();
+ UnitTest testSuite = new MonoTestSuite (project, project.Name, testFileBase);
+ ext.UnitTest = testSuite;
+ return testSuite;
}
return null;
}
@@ -57,13 +56,17 @@ namespace MonoDeveloper
{
return null;
}
+
+ public void Dispose ()
+ {
+ }
}
class MonoTestSuite: NUnitAssemblyTestSuite
{
string basePath;
- public MonoTestSuite (Project p, string name, string basePath): base (name, p)
+ public MonoTestSuite (DotNetProject p, string name, string basePath): base (name, p)
{
this.basePath = basePath;
}
diff --git a/main/src/addins/MonoDeveloperExtensions/NUnit/NUnit.csproj b/main/src/addins/MonoDeveloperExtensions/NUnit/NUnit.csproj
index 2074526569..1fac44d9d1 100644
--- a/main/src/addins/MonoDeveloperExtensions/NUnit/NUnit.csproj
+++ b/main/src/addins/MonoDeveloperExtensions/NUnit/NUnit.csproj
@@ -51,16 +51,21 @@
<Name>MonoDevelop.Core</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\NUnit\MonoDevelop.NUnit.csproj">
- <Project>{A7A4246D-CEC4-42DF-A3C1-C31B9F51C4EC}</Project>
- <Name>MonoDevelop.NUnit</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\..\..\..\external\mono-addins\Mono.Addins\Mono.Addins.csproj">
<Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
<Name>Mono.Addins</Name>
<Private>False</Private>
</ProjectReference>
+ <ProjectReference Include="..\..\MonoDevelop.UnitTesting\MonoDevelop.UnitTesting.csproj">
+ <Project>{A7A4246D-CEC4-42DF-A3C1-C31B9F51C4EC}</Project>
+ <Name>MonoDevelop.UnitTesting</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\..\MonoDevelop.UnitTesting.NUnit\MonoDevelop.UnitTesting.NUnit.csproj">
+ <Project>{6224D87E-2AC1-4D9F-91ED-714F797297BF}</Project>
+ <Name>MonoDevelop.UnitTesting.NUnit</Name>
+ <Private>False</Private>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
diff --git a/main/src/addins/NUnit/AddinInfo.cs b/main/src/addins/NUnit/AddinInfo.cs
deleted file mode 100644
index b7a7b115b1..0000000000
--- a/main/src/addins/NUnit/AddinInfo.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-
-using System;
-using Mono.Addins;
-using Mono.Addins.Description;
-
-[assembly:Addin ("NUnit",
- Namespace = "MonoDevelop",
- Version = MonoDevelop.BuildInfo.Version,
- Category = "Testing")]
-
-[assembly:AddinName ("NUnit support")]
-[assembly:AddinDescription ("Integrates NUnit into the MonoDevelop IDE")]
-
-[assembly:AddinDependency ("Core", MonoDevelop.BuildInfo.Version)]
-[assembly:AddinDependency ("Ide", MonoDevelop.BuildInfo.Version)]
diff --git a/main/src/addins/NUnit/ChangeLog b/main/src/addins/NUnit/ChangeLog
deleted file mode 100644
index 2dda19f864..0000000000
--- a/main/src/addins/NUnit/ChangeLog
+++ /dev/null
@@ -1,1117 +0,0 @@
-2010-06-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/NUnitAssemblyGroup.xpt.xml: Don't include the
- assembly name in the project type name since it doesn't work
- well when running on .NET
-
-2010-06-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/TestNodeBuilder.cs:
- * MonoDevelopNUnit.addin.xml: Added go-to-failure command to
- the test pad context menu. Fixes bug #610358 - Go to source
- code in unit test pad doesn't work as expected.
-
-2010-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitService.cs: Use ShowCustomDialog (which
- destroys the dialog when done) instead of RunCustomDialog
- (which doesn't).
-
-2010-05-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * Services/NUnitService.cs: More dialog placing.
-
-2010-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/NUnitAssemblyGroupConfigurationNodeBuilder.cs: Clean up
- dialog placement.
-
-2010-05-05 Mike Krüger <mkrueger@novell.com>
-
- * Services/UnitTestResult.cs: handled possible null ref.
-
-2010-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml: Register nunit project as
- serializable.
-
- * Services/NUnitService.cs:
- * Project/NUnitAssemblyGroupProject.cs: Ensure that tests are
- always shown for nunit assembly projects, when created and
- when added. Fixes bug #602143 - Unit tests don't show up in
- the Unit Tests pane.
-
-2010-04-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/TestResultsPad.cs: Free up wasted space between
- scrollbars and treeview contents.
-
-2010-04-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/TestResultsPad.cs:
- * Commands/NUnitCommands.cs:
- * MonoDevelopNUnit.addin.xml:
- * Services/UnitTestResult.cs: In the results pad, allow
- jumping to a specific line of the call stack. When
- double-clicking in a test failure, jump to the location of
- the failure, if available.
-
- * gtk-gui/MonoDevelop.NUnit.NUnitOptionsWidget.cs: Flush.
-
-2010-04-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml: Fixed node set name.
-
- * nunit.glade:
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * MonoDevelop.NUnit.csproj:
- * Gui/NUnitOptionsPanel.cs:
- * gtk-gui/MonoDevelop.NUnit.NUnitOptionsWidget.cs: Ported some
- old glade code to stetic.
-
- * Services/ExternalTestRunner.cs:
- * Services/NUnitAssemblyTestSuite.cs: Make sure the remote
- monitor is not disconnected too early.
-
- * Gui/TestPad.cs:
- * Gui/TestResultsPad.cs: Fix warnings.
-
-2010-04-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/UnitTestGroup.cs:
- * Services/NUnitTestSuite.cs:
- * Services/SystemTestProvider.cs:
- * Services/NUnitAssemblyTestSuite.cs: Don't show projects and
- solutions which don't contain unit tests.
-
-2010-04-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services\ExternalTestRunner.cs: Preload the NUnitRunner
- assembly.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelopNUnit.addin.xml: Bumped MD version.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitAssemblyTestSuite.cs: Fill the tests in the
- gui thread. Fixes bug #585286 - Collection modified while
- iterating.
-
-2010-03-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml: Set the default location for
- unit tests pads. Register a new Unit Testing layout.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * Gui/TestPad.cs:
- * Gui/CircleImage.cs:
- * Gui/TestResultsPad.cs:
- * Gui/TestNodeBuilder.cs:
- * MonoDevelop.NUnit.csproj:
- * Services/NUnitService.cs:
- * Commands/NUnitCommands.cs:
- * MonoDevelopNUnit.addin.xml:
- * Gui/UnitTestOptionsDialog.cs:
- * Gui/TestAssemblyNodeBuilder.cs:
- * Services/NUnitProjectTestSuite.cs:
- * Gui/NUnitAssemblyGroupNodeBuilder.cs:
- * Services/NUnitProjectServiceExtension.cs:
- * Gui/NUnitAssemblyGroupConfigurationNodeBuilder.cs: Merged
- MD.Projects into MD.Core, and MD.Projects.Gui, MD.Core.Gui
- and MD.Components into MD.Ide.
-
-2010-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * Gui/TestPad.cs:
- * Gui/TestResultsPad.cs:
- * MonoDevelop.NUnit.csproj: Use the new DockItemToolbar class
- for showing toolbar commands.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/TestPad.cs:
- * Gui/TestResultsPad.cs: Track api changes.
-
-2010-02-09 Mike Krüger <mkrueger@novell.com>
-
- * Gui/TestPad.cs:
- * Gui/TestResultsPad.cs: Track API changes for lazy loading
- images.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs: Flush.
-
-2009-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * Gui/unit-test-16.png:
- * Gui/unit-test-24.png:
- * MonoDevelop.NUnit.csproj:
- * MonoDevelopNUnit.addin.xml: Added new icon.
-
-2009-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitService.cs: Don't try to build tests until the
- service has been fully initialized.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Services/NUnitService.cs:
- * Services/NUnitAssemblyTestSuite.cs: Name threads to make
- debugging easier.
-
-2009-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/TestResultsPad.cs:
- * Project/NUnitAssemblyGroupProject.cs:
- * Services/NUnitProjectServiceExtension.cs: Introduced the
- ConfigurationSelector class to all methods that previously
- took a configuration name as string. This eliminates the
- ambiguity between solution configuration names and project
- configuration names.
-
-2009-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Use correct cairo lib.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelopNUnit.addin.xml: Bump MD version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/TestPad.cs:
- * Gui/TestResultsPad.cs: Fix warnings.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.NUnit.csproj: Reference the mono-cairo package.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs: Flush.
-
-2009-10-16 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CircleImage.cs: Handled icon loading error.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * md1format.xml: Track namespace changes.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelopNUnit.addin.xml: Bump MD version.
-
-2009-10-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitService.cs: After a build operation, and
- before running the tests, ensure that the tests are up to
- date by calling Refresh.
-
- * Services/UnitTest.cs: Added refresh operation. Fire test
- events in the gui thread.
-
- * Services/UnitTestGroup.cs:
- * Services/NUnitProjectTestSuite.cs:
- * Services/NUnitAssemblyTestSuite.cs: Implemented the Refresh
- operation. This operation updates any test that needs to be
- updated. It is an async operation. All this fixes bug
- #540257 - Unit test pad not updated correctly when "run
- tests" implies a build operation.
-
-2009-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/TestPad.cs: Add support for custom execution modes.
-
-2009-09-09 Christian Hergert <chris@dronelabs.com>
-
- * Services/NUnitService.cs: Make dialog transient for the
- root window.
-
-2009-08-28 Mike Krüger <mkrueger@novell.com>
-
- * templates/NUnitTestClass.xft.xml: Fixed "Bug 479196 - "add
- test fixture" adds refs to nunit.core and nunit.framework
- from "Package"".
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.csproj: Updated dependencies. We now
- depend on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * Gui/TestChart.cs:
- * MonoDevelop.NUnit.csproj: Track api changes in the chart
- widget.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitAssemblyTestSuite.cs: Track api changes.
-
-2009-06-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitService.cs:
- * Gui/NUnitAssemblyGroupNodeBuilder.cs:
- * Gui/NUnitAssemblyGroupConfigurationNodeBuilder.cs: Use the
- new DesktopService instead of PlatformService.
-
-2009-06-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services\ExternalTestRunner.cs:
- * Services\NUnitAssemblyTestSuite.cs: In some cases MS.NET
- can't properly resolve assemblies even if they are already
- loaded. For example, when deserializing objects from
- remoting. Added a handler for AssemblyResolve that handle
- this case.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project\NUnitAssemblyGroupFileFormat.cs: Use the new
- FilePath class for handling file and directory paths.
-
-2009-05-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitTestCase.cs:
- * Services/NUnitTestSuite.cs: Implement OnCanRun for NUnit
- tests and test suites.
-
- * Services/UnitTestGroup.cs: A test suite can be run using a
- specific mode if all child tests can.
-
- * Gui/TestPad.cs: Improve support for using a custom execution
- mode.
-
-2009-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml: Added Run Test With submenu,
- with support for all registered modes.
-
- * Gui/TestPad.cs:
- * Services/UnitTest.cs:
- * Services/TestContext.cs: Track api changes.
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelopNUnit.addin.xml: Changed copyright tag.
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * AssemblyInfo.cs: Changed assembly info.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * Gui/TestResultsPad.cs: Renamed PixbufService to
- ImageService.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * Gui/TestResultsPad.cs: Track API changes.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.NUnit.csproj: don't require specific
- gtk-sharp version.
-
-2009-04-17 Mike Krüger <mkrueger@novell.com>
-
- * Gui/NUnitOptionsPanel.cs:
- * Services/NUnitService.cs:
- * MonoDevelopNUnit.addin.xml:
- * Gui/UnitTestOptionsDialog.cs: translated the option panels
- to the new option structure.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelopNUnit.addin.xml: Bump MD version.
-
-2009-03-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/NUnitProject.xpt.xml: Reference the version of
- NUnit that we ship with MD.
-
-2009-03-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitAssemblyTestSuite.cs: Improved error message.
-
-2009-03-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/TestPad.cs:
- * Services/UnitTest.cs:
- * Services/TestContext.cs:
- * Services/NUnitService.cs:
- * Services/NUnitAssemblyTestSuite.cs:
- * Services/NUnitProjectServiceExtension.cs: Changed the way
- execution handlers work. We are not using platform ids
- anymore. Instead, we use command strings when looking for
- execution handlers. IExecutionHandlerFactory has been
- removed and now everything is handled by IExecutionHandler,
- which has a new CanExecute method. This model is more simple
- and more generic.
-
-2009-02-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitProjectTestSuite.cs: Check for nunit.core as
- well as nunit.framework when looking for nunit test
- projects. Should fix bug #477523.
-
-2009-02-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/TestPad.cs: Track merge of the project pad context menu.
-
-2009-02-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitAssemblyTestSuite.cs: Modify the test
- collection in the gui thread, to avoid concurrent access.
- Fixes bug #469131 - Random IOE exception.
-
-2009-02-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/TestPad.cs:
- * Services/UnitTest.cs:
- * Gui/TestResultsPad.cs:
- * Services/TestContext.cs:
- * Services/NUnitService.cs:
- * Commands/NUnitCommands.cs:
- * MonoDevelopNUnit.addin.xml:
- * Services/ExternalTestRunner.cs:
- * Services/NUnitAssemblyTestSuite.cs:
- * Services/NUnitProjectServiceExtension.cs: Added support for
- running unit tests using a special execution mode (for
- example, using the debugger).
-
-2009-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelopNUnit.addin.xml: Don't partially assembly-qualify
- type name, as it makes .NET unhappy, and doesn't seem to be
- necessary for Mono.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mds:
- * MonoDevelop.NUnit.mdp:
- * MonoDevelop.NUnit.csproj: Migrated to MSBuild file format.
-
-2009-02-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml: Don't register the nunit package
- if mono-nunit is installed and has the same version.
-
- * gtk-gui/generated.cs: Flush.
-
-2009-02-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/UnitTestResult.cs: Getting the failure location
- doesn't work very well. Disable for now.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelopNUnit.addin.xml: Bump MD version.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp: Flush.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.NUnit.mds:
- * MonoDevelop.NUnit.mdp:
- * NUnitRunner/NUnitRunner.mdp: Flush project format changes.
-
-2009-01-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * NUnitRunner/NUnitTestRunner.cs: Make sure that only the provided test
- suite is executed.
-
-2009-01-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/ExternalTestRunner.cs: Add a default test result message when
- none is provided.
-
- * Gui/TestResultsPad.cs:
- * Gui/TestNodeBuilder.cs:
- * Services/UnitTestResult.cs: When jumping to the test source code, if
- the test failed, jump to the line of the failure.
-
- * templates/NUnitTestClass.xft.xml: Add references to NUnit when adding
- a test fixture to a project.
-
-2009-01-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/TestPad.cs:
- * Services/NUnitService.cs:
- * Commands/NUnitCommands.cs:
- * MonoDevelopNUnit.addin.xml:
- * Services/UnitTestCollection.cs: Added command for running the tests.
-
- * Makefile.am:
- * MonoDevelop.NUnit.mdp:
- * Services/NUnitProjectServiceExtension.cs: When the project is a nunit
- library and there are no custom execution commands, run the tests
- when clicking on the Run option.
-
-2009-01-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mds: Added new NUnitRunner project.
-
-2009-01-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * lib/nunit.util.dll:
- * lib/nunit.core.dll:
- * lib/nunit.framework.dll:
- * MonoDevelopNUnit.addin.xml:
- * lib/nunit.core.interfaces.dll: Update to latest NUnit.
-
- * NUnitRunner:
- * Services/UnitTest.cs:
- * NUnitRunner/Makefile.am:
- * Services/NUnitTestCase.cs:
- * Services/NUnitTestSuite.cs:
- * Services/UnitTestResult.cs:
- * NUnitRunner/NUnitRunner.mdp:
- * Services/ExternalTestRunner.cs:
- * NUnitRunner/NUnitTestRunner.cs:
- * Services/NUnitProjectTestSuite.cs:
- * Services/NUnitAssemblyTestSuite.cs: Changed the way tests are run.
- Tests are now run in a separate appdomain to avoid conflicts of the
- tested assembly with MD.
-
- * Gui/TestResultsPad.cs: Ignore NUnit stack frames when looking for the
- source of a test failure. Fix some issues with the output pad.
-
- * Makefile.am:
- * MonoDevelop.NUnit.mdp: Updated.
-
-2009-01-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/TestPad.cs:
- * Gui/TestResultsPad.cs: Make sure the tree view is the first widget to
- be focused when presenting the pad.
-
-2009-01-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/ExternalTestRunner.cs: Fix bug #461415 - NUnit addin's path
- handling does not account for inherited tests. Patch by Brian
- Anderson.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp: All projects now require fx 3.5.
-
-2008-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/NUnitAssemblyGroupFileFormat.cs: Track API changes.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp: Don't require a specific version of
- Mono.Addins.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitService.cs: Track api changes.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * AssemblyInfo.cs: Add AssemblyInfo.cs files that are autogenerated from
- the addin manifests.
-
-2008-11-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui:
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs: Add missing files.
-
-2008-11-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/ExternalTestRunner.cs: Fix bug #440929 - Exception when
- running single test fixture that contains no tests.
-
- * MonoDevelop.NUnit.mdp: Added stetic file.
-
- * Makefile.am: Fix support for makefile parallel build.
-
-2008-11-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Fix build dependencies.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml: Bump MD version.
-
-2008-10-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelopNUnit.addin.xml, Services/WorkspaceTestGroup.cs,
- Services/NUnitService.cs, Services/SolutionFolderTestGroup.cs,
- Gui/TestResultsPad.cs, Gui/TestPad.cs: Use a simple lazy singleton
- instead of an IService.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp: Updated generated code.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitProjectTestSuite.cs: Track api changes.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/NUnitAssemblyGroupConfigurationNodeBuilder.cs,
- Gui/NUnitAssemblyGroupNodeBuilder.cs, Gui/TestNodeBuilder.cs,
- Gui/TestAssemblyNodeBuilder.cs, Gui/TestPad.cs: Moved the
- extensible tree view to its own directory.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * Services/NUnitProjectTestSuite.cs: Translated old code to new dom.
-
-2008-07-25 Peter Johanson <peter@peterjohanson.com>
-
- * Services/ExternalTestRunner.cs: Prevent an ArgumentOutOfRange
- exception if we are running a UnitTestGroup node.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/NUnitAssemblyGroupFileFormat.cs,
- Project/NUnitAssemblyGroupProject.cs, Project/TestAssembly.cs,
- Services/NUnitOptions.cs, Services/UnitTest.cs: Moved serialization
- engine to MonoDevelop.Core. Use new syntax for specifying attribute
- scope.
-
-2008-06-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitAssemblyTestSuite.cs: When counting test cases, ensure
- the test suite is fully loaded. Fixes bug #400106.
- * Gui/TestResultsPad.cs: Some protection against division by 0.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml: Bump MD version.
-
-2008-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/TestResultsPad.cs: Fix bug 387453 - Buttons in NUnit Test Results
- throw exception.
-
-2008-05-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitService.cs, Gui/TestPad.cs: Moved SearchTest to
- NUnitService.
- * Gui/TestResultsPad.cs: Fixed bug 366047 - Exceptions in "Test
- results" pad.
-
-2008-05-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/NUnitAssemblyGroupFileFormat.cs: Track api changes.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/NUnitAssemblyGroupProject.cs: Replaced
- ICompilerResult/DefaultCompilerResult/CompilerResults by a new
- BuildResult class, which has owner information at error level, so
- it is possible to know which project generated an error when
- building a solution. Updated Task and TaskService to use the new
- owner information.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * md1format.xml: Added missing file.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml, MonoDevelop.NUnit.mdp,
- Services/WorkspaceTestGroup.cs, Services/NUnitService.cs,
- Services/UnitTest.cs, Services/SolutionFolderTestGroup.cs,
- Services/UnitTestGroup.cs, Services/NUnitProjectTestSuite.cs,
- Services/SystemTestProvider.cs, Services/ITestProvider.cs,
- Services/NUnitAssemblyTestSuite.cs,
- Gui/NUnitAssemblyGroupConfigurationNodeBuilder.cs,
- Gui/TestResultsPad.cs, Gui/NUnitAssemblyGroupNodeBuilder.cs,
- Gui/TestPad.cs, Project/NUnitAssemblyGroupProject.cs,
- Project/NUnitAssemblyGroupFileFormat.cs, Makefile.am: New project
- model changes.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * Services/TestProgressMonitor.cs: Refactored status bar.
-
-2008-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml, Services/NUnitService.cs: Put back the
- old results pad.
- * Gui/TestResultsPad.cs: When double clicking a test, jump to the exact
- line that failed. When selecting a test, scroll the output view so
- it shows the test's output.
- * Gui/TestPad.cs: Use a toolbar without labels.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * Services/TestProgressMonitor.cs: Added tests finished message.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * Gui/TestPad.cs: Fixed threading bug.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelopNUnit.addin.xml, Services/TestProgressMonitor.cs,
- Services/NUnitService.cs, Gui/TestResultsPad.cs, Gui/TestPad.cs,
- Gui/CircleImage.cs: Worked on nunit pad
-
-2008-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp, Makefile.am: Fix references.
- * MonoDevelopNUnit.addin.xml, Services/NUnitService.cs: Register nunit
- packages using the extension point, instead of doing it by conde in the
- nunit service (since that code won't be run unless the service is
- explicitely loaded). Fixes bug #
-
-2008-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/NUnitAssemblyGroupNodeBuilder.cs, Gui/TestAssemblyNodeBuilder.cs:
- Handle the delete key in TreeViewPad, so it will work event if the
- shortcut is not defined.
-
-2008-02-06 Mike Krüger <mkrueger@novell.com>
-
- * Gui/TestPad.cs: Some changes for the new TreeViePiye
-
-2008-02-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/NUnitProject.xpt.xml: Fix nunit versions referenced in the
- project.
-
-2008-02-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/NUnitProject.xpt.xml: Don't try to open Test.cs, since it wont
- work for languages other than c#. Fixes bug #358359.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml: Update MD version.
-
-2008-01-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/NUnitOptionsPanel.cs: Ensure we don't create subclasses of classes
- with private fields bound by glade#. It would not work due to bug
- 355228.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/NUnitTestClass.xft.xml, templates/NUnitAssemblyGroup.xpt.xml,
- templates/NUnitProject.xpt.xml: Make template categories translatable.
-
-2008-01-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/TestPad.cs: Add null check when filling data for selected node. Should
- fix bug #350518.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml: Bump add-in versions.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp, Makefile.am: Directory reorganization.
-
-2007-11-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml, Services/NUnitService.cs: Reuse the results
- pad. Don't create it at every session. Fixes bug #338960.
- * Gui/TestResultsPad.cs: Icon and title is now set in the manifest.
-
-2007-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Services/NUnitService.cs, Services/XmlResultsStore.cs,
- Services/NUnitAssemblyTestSuite.cs: Track LoggingService API changes.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml: Bump MD version.
-
-2007-10-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/NUnitAssemblyGroupNodeBuilder.cs, templates/NUnitTestClass.xft.xml:
- Use tango file icons. Removed obsolete icons.
-
-2007-10-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp, Services/NUnitService.cs, Gui/nunit-overlay-32.png,
- Gui/TestResultsPad.cs, Makefile.am,
- templates/NUnitAssemblyGroup.xpt.xml, templates/NUnitProject.xpt.xml:
- Updated project icons. Use the base project icon with an overlay to show
- the type.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp: Project file names updated by change in MD path
- functions.
-
-2007-10-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp: Fix warning level.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml: Bump MD version.
-
-2007-09-04 Michael Hutchinson <MHutchinson@novell.com>
-
- * Gui/UnitTestOptionsDialog.cs,
- Gui/NUnitOptionsPanel.cs: Fix compiler warnings.
-
-2007-08-31 Mike Krüger <mkrueger@novell.com>
-
- * Gui/UnitTestOptionsDialog.cs, Gui/NUnitOptionsPanel.cs: Changes due to new
- property infrastructure.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml: Removed the CommandService class. Everything
- is done directly with CommandManager. Moved all extension node types to
- MD.Components.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp, MonoDevelopNUnit.addin.xml,
- Services/NUnitService.cs, Gui/UnitTestOptionsDialog.cs,
- Gui/NUnitAssemblyGroupConfigurationNodeBuilder.cs,
- Gui/TestResultsPad.cs, Gui/NUnitAssemblyGroupNodeBuilder.cs,
- Gui/TestAssemblyNodeBuilder.cs, Gui/TestNodeBuilder.cs, Gui/TestPad.cs,
- Makefile.am: Reorganized the extension point hierarchy. Embedded all
- add-in manifests as resources.
-
-2007-08-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitService.cs,
- Gui/NUnitAssemblyGroupConfigurationNodeBuilder.cs,
- Gui/NUnitAssemblyGroupNodeBuilder.cs, Gui/TestNodeBuilder.cs,
- Gui/TestPad.cs: Converted DispatchService to a static class.
-
-2007-07-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp, MonoDevelopNUnit.addin.xml, Gui/nunit.png,
- Makefile.am: Added icon for the nunit pad.
-
-2007-07-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitService.cs, Services/XmlResultsStore.cs,
- Services/NUnitAssemblyTestSuite.cs: Use the log service for logging
- errors.
-
-2007-07-03 Mike Krüger <mkrueger@novell.com>
-
- * Gui/TestResultsPad.cs: Changed a bit because of the removal of custom
- collections in the Ide project.
-
-2007-06-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitService.cs: Track api changes.
-
-2007-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitService.cs: If a solution is already open when
- initializing the nunit service, load the test tree.
-
-2007-05-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/TestResultsPad.cs: Fixed some status messages. Make sure the
- progress label does not grow beyond the available space.
-
-2007-05-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitService.cs: Unregister tests providers of unloaded
- add-ins.
-
-2007-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/TestPad.cs: Added missing null check. Fixes bug #81097.
-
-2007-05-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/TestPad.cs: Fill the tree if there is some RootTest defined just
- after the pad initialization.
-
-2007-05-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp: Copy nunit dlls to target dir.
- * Services/NUnitService.cs, Gui/TestResultsPad.cs: Track api changes.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp: Copy the .addins.xml file to the output dir.
-
-2007-05-10 Mike Krüger <mkrueger@novell.com>
-
- * Services/NUnitService.cs:
- Fixed bug in pad loading.
-2007-05-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp, Makefile.am: Reference shared assemblies from
- the correct location.
-
-2007-05-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml: Restore extension deleted during the M.A
- migration.
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp, MonoDevelopNUnit.addin.xml,
- Services/NUnitService.cs, Gui/UnitTestOptionsDialog.cs,
- Makefile.am: Migration to Mono.Addins.
-
-2007-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects/Combine.cs,
- MonoDevelop.Projects/CombineEntryEventArgs.cs,
- MonoDevelop.Projects.Parser/DefaultParserService.cs: Added a
- Reloading property to the argument of the entry add/remove events
- of Combine, which is set to true if the entry is being only
- reloaded, not actually removed/added to the combine.
-
-2007-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp: Updated.
- * Project/NUnitAssemblyGroupFileFormat.cs: Track api changes.
-
-2007-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp: Don't local copy references.
- * Services/NUnitService.cs, Gui/TestResultsPad.cs: Added button for
- running the tests. Fixed context menu. Don't make the TestResultPad
- a subclass of GuiSyncObject because there are some identity issue
- with GetHashCode and the proxy. Using TestMonitor instead.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml: Change add-in versions to 0.13.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp: Set target runtime to 2.0.
-
-2007-02-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Remove nunit references, since nunit is now included in
- the add-in.
-
-2007-02-11 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- *Makefile.am: install also nunit.framework.dll, otherwise addin will not start on some systems
-
-2007-02-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp: Synchronized the MD project and the Makefile
- * MonoDevelopNUnit.addin.xml: Removed nunit dependency. Added new
- project template.
- * Services/ExternalTestRunner.cs, Services/NUnitAssemblyTestSuite.cs:
- Track api changes in NUnit.
- * Services/NUnitService.cs: Register the nunit package is none is
- installed.
- * Gui/TestResultsPad.cs: Make the toolbar smaller. Added null check for
- empty result messages when a test is ignored.
- * lib, lib/nunit.framework.dll, lib/nunit.core.dll: Bundle nunit
- together with the add-in.
- * Makefile.am: Synchronized the MD project and the Makefile. Bundle
- nunit together with the add-in.
- * templates/NUnitTestClass.xft.xml: Latest NUnit versions require the
- Test attribute to be applied to test methods.
- * templates/NUnitProject.xpt.xml: New project template.
-
-2007-02-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp: Updated.
- * Gui/NUnitAssemblyGroupNodeBuilder.cs: Dispose the project after
- removing it.
- * Project/NUnitAssemblyGroupProject.cs: Track api changes.
-
-2006-12-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/NUnitAssemblyGroupProject.cs: Track api changes.
-
-2006-11-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitService.cs: Use global events to keep track of
- reference changes (simplified the code).
-
-2006-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/NUnitAssemblyGroupNodeBuilder.cs:
- * MonoDevelopNUnit.addin.xml: Added delete command to the nunit
- assembly group context menu.
-
- * Services/NUnitProjectTestSuite.cs: Track API changes.
-
-2006-09-07 Andrés G. Aragoneses <knocte@gmail.com>
-
- * MonoDevelopNUnit.addin.xml: Improved string.
-
-2006-09-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/ExternalTestRunner.cs: Make sure the MonoDevelop.Projects
- add-in is loaded in the remote process.
-
-2006-07-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp:
- * Makefile.am:
- * templates/NUnitTestClass.xft.xml: Added new file template for
- unit tests.
-
- * Services/UnitTest.cs: Removed DataItem attributes, since they
- are not ignored anymore.
- * MonoDevelopNUnit.addin.xml: Updated versions.
-
-2006-06-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitService.cs: Use the new extension listeners to
- read extensions.
-
-2006-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml:
- * Services/NUnitService.cs: Added an extension point for registering
- test providers. It replaces the RegisterTestProvider api call.
-
-2006-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml: Updated versions.
- * MonoDevelop.NUnit.mdp: Updated.
-
-2006-04-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CircleImage.cs: Added static constructor to get
- strict "beforefieldinit" semantics, so that the images
- are loaded after GTK is initialized.
-
-2006-04-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Reference nunit libraries using $(NUNIT_LIBS).
- Patch by Christian Hergert.
-
-2006-04-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * NUnit/Services/NUnitService.cs: Use a GUI thread safe
- subscription to CombineOpened event.
-
-2006-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.addin.xml: Added info about the
- nunit dependency.
-
-2006-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.addin.xml: Updated references.
-
-2006-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.NUnit.mdp: Updated.
- * Makefile.am: Use an unified format. Patch by Matze Braun.
- * MonoDevelopNUnit.addin.xml: Updated add-in versions.
-
-2006-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * NUnit/MonoDevelopNUnit.addin.xml: Declared nunit.framework
- dependency.
-
-2005-12-22 David Makovský <yakeen@sannyas-on.net>
-
- * Gui/TestResultsPad.cs:
- * Gui/NUnitOptionsPanel.cs:
- * Gui/TestNodeBuilder.cs:
- * Gui/TestPad.cs: Make some strings translatable.
-
-
-2005-11-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitTestCase.cs:
- * Services/NUnitTestSuite.cs:
- * Services/NUnitAssemblyTestSuite.cs:
- * Services/ExternalTestRunner.cs: Properly handle the case when it's
- running a single test case.
-
- * Services/UnitTest.cs: Save the inherited store if needed.
- * Services/XmlResultsStore.cs: Reset the modified flag once the
- store is saved.
- * Gui/TestResultsPad.cs: Clear the output buffer when refreshing the
- results list.
- * MonoDevelopNUnit.addin.xml: Added dependency.
-
-2005-10-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml: Fixed addin header information.
- Use "id" attribuet instead of "name" to identify addins.
-
-2005-10-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopNUnit.addin.xml: Added addin dependencies.
- * Gui/UnitTestOptionsDialog.cs: Use the new addin API.
-
-2005-09-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitService.cs:
- * Services/CombineTestGroup.cs:
- * Services/NUnitProjectTestSuite.cs:
- * Services/SystemTestProvider.cs: Only generate a test suite for
- projects that reference the nunit.framework assembly.
-
-2005-08-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/*:
- * MonoDevelopNUnit.addin.xml: Properly reference resource icons and
- templates.
- * Makefile.am: Embed icon and templates as resources.
- * Gui/NUnitAssemblyGroupConfigurationNodeBuilder.cs: Track changes in
- the Stock class.
-
-2005-08-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitService.cs:
- * Gui/UnitTestOptionsDialog.cs: Track changes in TreeViewOptions.
-
-2005-08-10 Ben Motmans <ben.motmans@gmail.com>
-
- * MonoDevelop.NUnit.mdp: references update
-
-2005-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/NUnitProjectTestSuite.cs: Use the new IParserContext API.
-
-2005-08-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/TestPad.cs:
- * Gui/TestResultsPad.cs: Use the new command service to show
- context menus.
-
-2005-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/NUnitAssemblyGroupProject.cs: Track api changes.
-
-2005-07-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * New addin implementation.
-
-2005-03-16 John Luke <john.luke@gmail.com>
-
- * Redo the nunit addin based on gnunit
diff --git a/main/src/addins/NUnit/Commands/NUnitCommands.cs b/main/src/addins/NUnit/Commands/NUnitCommands.cs
deleted file mode 100644
index 0a581fdb81..0000000000
--- a/main/src/addins/NUnit/Commands/NUnitCommands.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// TestChart.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using MonoDevelop.Components.Commands;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide;
-
-namespace MonoDevelop.NUnit.Commands
-{
- public enum TestCommands
- {
- RunAllTests,
- RunTest,
- DebugTest,
- RunTestWith,
- ShowTestCode,
- SelectTestInTree,
- ShowTestDetails,
- GoToFailure,
- RerunTest,
- }
-
- public enum TestChartCommands
- {
- ShowResults,
- ShowTime,
- UseTimeScale,
- SingleDayResult,
- ShowSuccessfulTests,
- ShowFailedTests,
- ShowIgnoredTests
- }
-
- public enum NUnitProjectCommands
- {
- AddAssembly
- }
-
- class RunAllTestsHandler: CommandHandler
- {
- protected override void Run ()
- {
- IWorkspaceObject ob = IdeApp.ProjectOperations.CurrentSelectedBuildTarget;
- if (ob != null) {
- UnitTest test = NUnitService.Instance.FindRootTest (ob);
- if (test != null)
- NUnitService.Instance.RunTest (test, null);
- }
- }
-
- protected override void Update (CommandInfo info)
- {
- IWorkspaceObject ob = IdeApp.ProjectOperations.CurrentSelectedBuildTarget;
- if (ob != null) {
- UnitTest test = NUnitService.Instance.FindRootTest (ob);
- info.Enabled = (test != null);
- } else
- info.Enabled = false;
- }
- }
-}
diff --git a/main/src/addins/NUnit/Gui/AbstractUnitTestEditorExtension.cs b/main/src/addins/NUnit/Gui/AbstractUnitTestEditorExtension.cs
deleted file mode 100644
index 3b3114af61..0000000000
--- a/main/src/addins/NUnit/Gui/AbstractUnitTestEditorExtension.cs
+++ /dev/null
@@ -1,440 +0,0 @@
-//
-// AbstractUnitTestTextEditorExtension.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using MonoDevelop.Ide.Gui.Content;
-using System.Collections.Generic;
-using System.Threading;
-using Mono.TextEditor;
-using MonoDevelop.NUnit;
-using MonoDevelop.Core;
-using MonoDevelop.Ide;
-using Gtk;
-using MonoDevelop.Components;
-
-namespace MonoDevelop.NUnit
-{
- public abstract class AbstractUnitTestTextEditorExtension : TextEditorExtension
- {
- public override void Initialize ()
- {
- base.Initialize ();
- Document.DocumentParsed += HandleDocumentParsed;
- if (IdeApp.Workbench == null)
- return;
- NUnitService.Instance.TestSessionCompleted += HandleTestSessionCompleted;
- }
-
- void HandleTestSessionCompleted (object sender, EventArgs e)
- {
- if (document.Editor == null)
- return;
- document.Editor.Parent.TextArea.RedrawMargin (document.Editor.Parent.TextArea.ActionMargin);
- }
-
- public override void Dispose ()
- {
- NUnitService.Instance.TestSessionCompleted -= HandleTestSessionCompleted;
- RemoveHandler ();
- Document.DocumentParsed -= HandleDocumentParsed;
- base.Dispose ();
- }
-
- CancellationTokenSource src = new CancellationTokenSource ();
-
- public abstract IList<UnitTestLocation> GatherUnitTests ();
-
- readonly static PropertyWrapper<bool> EnableUnitTestEditorIntegration = new PropertyWrapper<bool> ("Testing.EnableUnitTestEditorIntegration", false);
-
- void HandleDocumentParsed (object sender, EventArgs e)
- {
- if (!EnableUnitTestEditorIntegration)
- return;
- src.Cancel ();
- src = new CancellationTokenSource ();
- var token = src.Token;
- ThreadPool.QueueUserWorkItem (delegate {
- if (token.IsCancellationRequested)
- return;
- var foundTests = GatherUnitTests ();
- if (foundTests == null)
- return;
- Application.Invoke (delegate {
- var editor = document.Editor;
- if (editor == null)
- return;
- var textEditor = editor.Parent;
- if (textEditor == null)
- return;
- var actionMargin = textEditor.ActionMargin;
- if (actionMargin == null)
- return;
- if (actionMargin.IsVisible ^ (foundTests.Count > 0))
- textEditor.QueueDraw ();
- actionMargin.IsVisible |= foundTests.Count > 0;
- foreach (var oldMarker in currentMarker)
- editor.Document.RemoveMarker (oldMarker);
-
- foreach (var foundTest in foundTests) {
- if (token.IsCancellationRequested)
- return;
- var unitTestMarker = new UnitTestMarker (foundTest, document);
- currentMarker.Add (unitTestMarker);
- editor.Document.AddMarker (foundTest.LineNumber, unitTestMarker);
- }
- });
- });
- }
-
- static uint timeoutHandler;
-
- static void RemoveHandler ()
- {
- if (timeoutHandler != 0) {
- GLib.Source.Remove (timeoutHandler);
- timeoutHandler = 0;
- }
- }
-
- List<UnitTestMarker> currentMarker = new List<UnitTestMarker>();
-
- class UnitTestMarker : MarginMarker
- {
- readonly UnitTestLocation unitTest;
- readonly MonoDevelop.Ide.Gui.Document doc;
-
- public UnitTestMarker(UnitTestLocation unitTest, MonoDevelop.Ide.Gui.Document doc)
- {
- this.unitTest = unitTest;
- this.doc = doc;
- }
-
- public override bool CanDrawForeground (Margin margin)
- {
- return margin is ActionMargin;
- }
-
- public override void InformMouseHover (TextEditor editor, Margin margin, MarginMouseEventArgs args)
- {
- if (!(margin is ActionMargin))
- return;
- string toolTip;
- if (unitTest.IsFixture) {
- if (isFailed) {
- toolTip = GettextCatalog.GetString ("NUnit Fixture failed (click to run)");
- if (!string.IsNullOrEmpty (failMessage))
- toolTip += Environment.NewLine + failMessage.TrimEnd ();
- } else {
- toolTip = GettextCatalog.GetString ("NUnit Fixture (click to run)");
- }
- } else {
- if (isFailed) {
- toolTip = GettextCatalog.GetString ("NUnit Test failed (click to run)");
- if (!string.IsNullOrEmpty (failMessage))
- toolTip += Environment.NewLine + failMessage.TrimEnd ();
- foreach (var id in unitTest.TestCases) {
- var test = NUnitService.Instance.SearchTestById (unitTest.UnitTestIdentifier + id);
- if (test != null) {
- var result = test.GetLastResult ();
- if (result != null && result.IsFailure) {
- if (!string.IsNullOrEmpty (result.Message)) {
- toolTip += Environment.NewLine + "Test" + id +":";
- toolTip += Environment.NewLine + result.Message.TrimEnd ();
- }
- }
- }
-
- }
- } else {
- toolTip = GettextCatalog.GetString ("NUnit Test (click to run)");
- }
-
- }
- editor.TooltipText = toolTip;
- }
-
- static Menu menu;
-
- public override void InformMousePress (TextEditor editor, Margin margin, MarginMouseEventArgs args)
- {
- if (!(margin is ActionMargin))
- return;
- if (menu != null) {
- menu.Destroy ();
- }
- var debugModeSet = Runtime.ProcessService.GetDebugExecutionMode ();
-
- menu = new Menu ();
- if (unitTest.IsFixture) {
- var menuItem = new MenuItem ("_Run All");
- menuItem.Activated += new TestRunner (doc, unitTest.UnitTestIdentifier, false).Run;
- menu.Add (menuItem);
- if (debugModeSet != null) {
- menuItem = new MenuItem ("_Debug All");
- menuItem.Activated += new TestRunner (doc, unitTest.UnitTestIdentifier, true).Run;
- menu.Add (menuItem);
- }
- menuItem = new MenuItem ("_Select in Test Pad");
- menuItem.Activated += new TestRunner (doc, unitTest.UnitTestIdentifier, true).Select;
- menu.Add (menuItem);
- } else {
- if (unitTest.TestCases.Count == 0) {
- var menuItem = new MenuItem ("_Run");
- menuItem.Activated += new TestRunner (doc, unitTest.UnitTestIdentifier, false).Run;
- menu.Add (menuItem);
- if (debugModeSet != null) {
- menuItem = new MenuItem ("_Debug");
- menuItem.Activated += new TestRunner (doc, unitTest.UnitTestIdentifier, true).Run;
- menu.Add (menuItem);
- }
- menuItem = new MenuItem ("_Select in Test Pad");
- menuItem.Activated += new TestRunner (doc, unitTest.UnitTestIdentifier, true).Select;
- menu.Add (menuItem);
- } else {
- var menuItem = new MenuItem ("_Run All");
- menuItem.Activated += new TestRunner (doc, unitTest.UnitTestIdentifier, false).Run;
- menu.Add (menuItem);
- if (debugModeSet != null) {
- menuItem = new MenuItem ("_Debug All");
- menuItem.Activated += new TestRunner (doc, unitTest.UnitTestIdentifier, true).Run;
- menu.Add (menuItem);
- }
- menu.Add (new SeparatorMenuItem ());
- foreach (var id in unitTest.TestCases) {
- var submenu = new Menu ();
- menuItem = new MenuItem ("_Run");
- menuItem.Activated += new TestRunner (doc, unitTest.UnitTestIdentifier + id, false).Run;
- submenu.Add (menuItem);
- if (debugModeSet != null) {
- menuItem = new MenuItem ("_Debug");
- menuItem.Activated += new TestRunner (doc, unitTest.UnitTestIdentifier + id, true).Run;
- submenu.Add (menuItem);
- }
-
- var label = "Test" + id;
- string tooltip = null;
- var test = NUnitService.Instance.SearchTestById (unitTest.UnitTestIdentifier + id);
- if (test != null) {
- var result = test.GetLastResult ();
- if (result != null && result.IsFailure) {
- tooltip = result.Message;
- label += "!";
- }
- }
-
- menuItem = new MenuItem ("_Select in Test Pad");
- menuItem.Activated += new TestRunner (doc, unitTest.UnitTestIdentifier + id, true).Select;
- submenu.Add (menuItem);
-
-
- var subMenuItem = new MenuItem (label);
- if (!string.IsNullOrEmpty (tooltip))
- subMenuItem.TooltipText = tooltip;
- subMenuItem.Submenu = submenu;
- menu.Add (subMenuItem);
- }
- }
- }
- menu.ShowAll ();
- editor.TextArea.ResetMouseState ();
- GtkWorkarounds.ShowContextMenu (menu, editor, new Gdk.Rectangle ((int)args.X, (int)args.Y, 1, 1));
- }
-
- class TestRunner
- {
- // readonly MonoDevelop.Ide.Gui.Document doc;
- readonly string testCase;
- readonly bool debug;
-
- public TestRunner (MonoDevelop.Ide.Gui.Document doc, string testCase, bool debug)
- {
- // this.doc = doc;
- this.testCase = testCase;
- this.debug = debug;
- }
-
- bool TimeoutHandler ()
- {
- var test = NUnitService.Instance.SearchTestById (testCase);
- if (test != null) {
- RunTest (test);
- timeoutHandler = 0;
- } else {
- return true;
- }
- return false;
- }
-
- List<NUnitProjectTestSuite> testSuites = new List<NUnitProjectTestSuite>();
- internal void Run (object sender, EventArgs e)
- {
- menu.Destroy ();
- menu = null;
- if (IdeApp.ProjectOperations.IsBuilding (IdeApp.ProjectOperations.CurrentSelectedSolution) ||
- IdeApp.ProjectOperations.IsRunning (IdeApp.ProjectOperations.CurrentSelectedSolution))
- return;
-
- var foundTest = NUnitService.Instance.SearchTestById (testCase);
- if (foundTest != null) {
- RunTest (foundTest);
- return;
- }
-
- var tests = new Stack<UnitTest> ();
- foreach (var test in NUnitService.Instance.RootTests) {
- tests.Push (test);
- }
- while (tests.Count > 0) {
- var test = tests.Pop ();
-
- var solutionFolderTestGroup = test as SolutionFolderTestGroup;
- if (solutionFolderTestGroup != null) {
- foreach (var test2 in solutionFolderTestGroup.Tests) {
- tests.Push (test2);
- }
- continue;
- }
- var nUnitProjectTestSuite = test as NUnitProjectTestSuite;
- if (nUnitProjectTestSuite != null)
- testSuites.Add (nUnitProjectTestSuite);
- }
-
- foreach (var test in testSuites) {
- test.TestChanged += HandleTestChanged;
- test.ProjectBuiltWithoutTestChange += HandleTestChanged;
- }
-
- IdeApp.ProjectOperations.Build (IdeApp.ProjectOperations.CurrentSelectedSolution);
- }
-
- void HandleTestChanged (object sender, EventArgs e)
- {
- var foundTest = NUnitService.Instance.SearchTestById (testCase);
- if (foundTest != null) {
- foreach (var test in testSuites) {
- test.TestChanged -= HandleTestChanged;
- test.ProjectBuiltWithoutTestChange -= HandleTestChanged;
- }
- testSuites.Clear ();
-
- RunTest (foundTest);
- }
- }
-
- internal void Select (object sender, EventArgs e)
- {
- menu.Destroy ();
- menu = null;
- var test = NUnitService.Instance.SearchTestById (testCase);
- if (test == null)
- return;
- var pad = IdeApp.Workbench.GetPad<TestPad> ();
- pad.BringToFront ();
- var content = (TestPad)pad.Content;
- content.SelectTest (test);
- }
-
- void RunTest (UnitTest test)
- {
- var debugModeSet = Runtime.ProcessService.GetDebugExecutionMode ();
- MonoDevelop.Core.Execution.IExecutionHandler ctx = null;
- if (debug && debugModeSet != null) {
- foreach (var executionMode in debugModeSet.ExecutionModes) {
- if (test.CanRun (executionMode.ExecutionHandler)) {
- ctx = executionMode.ExecutionHandler;
- break;
- }
- }
- }
- // NUnitService.Instance.RunTest (test, ctx);
- var pad = IdeApp.Workbench.GetPad<TestPad> ();
- var content = (TestPad)pad.Content;
- content.RunTest (test, ctx);
- }
- }
-
- bool isFailed;
- string failMessage;
- public override void DrawForeground (TextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
- {
- isFailed = false;
- var test = NUnitService.Instance.SearchTestById (unitTest.UnitTestIdentifier);
- bool searchCases = false;
-
- Xwt.Drawing.Image icon = null;
-
- if (test != null) {
- icon = test.StatusIcon;
- var result = test.GetLastResult ();
- if (result == null) {
- searchCases = true;
- } else if (result.IsFailure) {
- failMessage = result.Message;
- isFailed = true;
- }
- } else {
- searchCases = true;
- }
-
- if (searchCases) {
- foreach (var caseId in unitTest.TestCases) {
- test = NUnitService.Instance.SearchTestById (unitTest.UnitTestIdentifier + caseId);
- if (test != null) {
- icon = test.StatusIcon;
- var result = test.GetLastResult ();
- if (result != null && result.IsFailure) {
- failMessage = result.Message;
- isFailed = true;
- break;
- }
- }
- }
- }
-
- if (icon != null) {
- if (icon.Width > metrics.Width || icon.Height > metrics.Height)
- icon = icon.WithBoxSize (metrics.Width, metrics.Height);
- cr.DrawImage (editor, icon, Math.Truncate (metrics.X + metrics.Width / 2 - icon.Width / 2), Math.Truncate (metrics.Y + metrics.Height / 2 - icon.Height / 2));
- }
- }
- }
- public class UnitTestLocation
- {
- public int LineNumber { get; set; }
- public bool IsFixture { get; set; }
- public string UnitTestIdentifier { get; set; }
- public bool IsIgnored { get; set; }
-
- public List<string> TestCases = new List<string> ();
-
- public UnitTestLocation (int lineNumber)
- {
- LineNumber = lineNumber;
- }
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Gui/NUnitAssemblyGroupConfigurationNodeBuilder.cs b/main/src/addins/NUnit/Gui/NUnitAssemblyGroupConfigurationNodeBuilder.cs
deleted file mode 100644
index 1d7c6e5a4e..0000000000
--- a/main/src/addins/NUnit/Gui/NUnitAssemblyGroupConfigurationNodeBuilder.cs
+++ /dev/null
@@ -1,128 +0,0 @@
-//
-// NUnitAssemblyGroupConfigurationNodeBuilder.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Core;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.NUnit.Commands;
-using MonoDevelop.Components;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Components;
-using MonoDevelop.Ide;
-
-namespace MonoDevelop.NUnit
-{
- public class NUnitAssemblyGroupConfigurationNodeBuilder: TypeNodeBuilder
- {
- EventHandler assembliesChanged;
-
- public NUnitAssemblyGroupConfigurationNodeBuilder ()
- {
- assembliesChanged = (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnAssembliesChanged));
- }
-
- public override Type CommandHandlerType {
- get { return typeof(NUnitAssemblyGroupConfigurationNodeCommandHandler); }
- }
-
- public override string ContextMenuAddinPath {
- get { return "/MonoDevelop/NUnit/ContextMenu/ProjectPad/NUnitAssemblyGroupConfiguration"; }
- }
-
- public override Type NodeDataType {
- get { return typeof(NUnitAssemblyGroupProjectConfiguration); }
- }
-
- public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
- {
- return ((SolutionItemConfiguration)dataObject).Id;
- }
-
- public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
- {
- var conf = (SolutionItemConfiguration) dataObject;
- nodeInfo.Label = conf.Id;
- nodeInfo.Icon = Context.GetIcon (Stock.ClosedFolder);
- }
-
- public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
- {
- var config = (NUnitAssemblyGroupProjectConfiguration) dataObject;
-
- foreach (TestAssembly ta in config.Assemblies)
- builder.AddChild (ta);
- }
-
- public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
- {
- var config = (NUnitAssemblyGroupProjectConfiguration) dataObject;
- return config.Assemblies.Count > 0;
- }
-
- public override void OnNodeAdded (object dataObject)
- {
- var config = (NUnitAssemblyGroupProjectConfiguration) dataObject;
- config.AssembliesChanged += assembliesChanged;
- }
-
- public override void OnNodeRemoved (object dataObject)
- {
- var config = (NUnitAssemblyGroupProjectConfiguration) dataObject;
- config.AssembliesChanged -= assembliesChanged;
- }
-
- public void OnAssembliesChanged (object sender, EventArgs args)
- {
- ITreeBuilder tb = Context.GetTreeBuilder (sender);
- if (tb != null) tb.UpdateAll ();
- }
- }
-
- class NUnitAssemblyGroupConfigurationNodeCommandHandler: NodeCommandHandler
- {
- [CommandHandler (NUnitProjectCommands.AddAssembly)]
- protected void OnAddAssembly ()
- {
- var config = (NUnitAssemblyGroupProjectConfiguration) CurrentNode.DataItem;
-
- var dlg = new SelectFileDialog (GettextCatalog.GetString ("Add files")) {
- TransientFor = IdeApp.Workbench.RootWindow,
- SelectMultiple = true,
- };
- if (!dlg.Run ())
- return;
-
- foreach (string file in dlg.SelectedFiles)
- config.Assemblies.Add (new TestAssembly (file));
-
- IdeApp.Workspace.Save();
- }
- }
-}
diff --git a/main/src/addins/NUnit/Gui/NUnitAssemblyGroupNodeBuilder.cs b/main/src/addins/NUnit/Gui/NUnitAssemblyGroupNodeBuilder.cs
deleted file mode 100644
index 490a355404..0000000000
--- a/main/src/addins/NUnit/Gui/NUnitAssemblyGroupNodeBuilder.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-//
-// NUnitAssemblyGroupNodeBuilder.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.NUnit.Commands;
-using MonoDevelop.Ide.Gui.Components;
-using MonoDevelop.Ide;
-
-namespace MonoDevelop.NUnit
-{
- public class NUnitAssemblyGroupNodeBuilder: TypeNodeBuilder
- {
- ConfigurationEventHandler configsChanged;
-
- public NUnitAssemblyGroupNodeBuilder ()
- {
- configsChanged = (ConfigurationEventHandler) DispatchService.GuiDispatch (new ConfigurationEventHandler (OnConfigurationsChanged));
- }
-
- public override Type CommandHandlerType {
- get { return typeof(NUnitAssemblyGroupNodeCommandHandler); }
- }
-
- public override string ContextMenuAddinPath {
- get { return "/MonoDevelop/NUnit/ContextMenu/ProjectPad/NUnitAssemblyGroup"; }
- }
-
- public override Type NodeDataType {
- get { return typeof(NUnitAssemblyGroupProject); }
- }
-
- public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
- {
- return ((NUnitAssemblyGroupProject)dataObject).Name;
- }
-
- public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
- {
- NUnitAssemblyGroupProject project = dataObject as NUnitAssemblyGroupProject;
- nodeInfo.Label = project.Name;
- nodeInfo.Icon = Context.GetIcon (Stock.Project);
- }
-
- public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
- {
- NUnitAssemblyGroupProject project = dataObject as NUnitAssemblyGroupProject;
-
- foreach (NUnitAssemblyGroupProjectConfiguration c in project.Configurations)
- builder.AddChild (c);
- }
-
- public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
- {
- NUnitAssemblyGroupProject project = dataObject as NUnitAssemblyGroupProject;
- return project.Configurations.Count > 0;
- }
-
- public override void OnNodeAdded (object dataObject)
- {
- NUnitAssemblyGroupProject project = dataObject as NUnitAssemblyGroupProject;
- project.ConfigurationAdded += configsChanged;
- project.ConfigurationRemoved += configsChanged;
- }
-
- public override void OnNodeRemoved (object dataObject)
- {
- NUnitAssemblyGroupProject project = dataObject as NUnitAssemblyGroupProject;
- project.ConfigurationAdded -= configsChanged;
- project.ConfigurationRemoved -= configsChanged;
- }
-
- public void OnConfigurationsChanged (object sender, ConfigurationEventArgs args)
- {
- ITreeBuilder tb = Context.GetTreeBuilder (sender);
- if (tb != null) tb.UpdateAll ();
- }
- }
-
- class NUnitAssemblyGroupNodeCommandHandler: NodeCommandHandler
- {
- [CommandHandler (NUnitProjectCommands.AddAssembly)]
- protected void OnShowTest ()
- {
- }
-
- public override void DeleteItem ()
- {
- NUnitAssemblyGroupProject project = CurrentNode.DataItem as NUnitAssemblyGroupProject;
- project.ParentFolder.Items.Remove (project);
- project.Dispose ();
- IdeApp.Workspace.Save ();
- }
- }
-}
diff --git a/main/src/addins/NUnit/Gui/TestAssemblyNodeBuilder.cs b/main/src/addins/NUnit/Gui/TestAssemblyNodeBuilder.cs
deleted file mode 100644
index 0bf065550c..0000000000
--- a/main/src/addins/NUnit/Gui/TestAssemblyNodeBuilder.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// TestAssemblyNodeBuilder.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Collections;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Gui.Pads;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.NUnit.Commands;
-using MonoDevelop.Ide.Commands;
-using MonoDevelop.Ide.Gui.Components;
-
-namespace MonoDevelop.NUnit
-{
- public class TestAssemblyNodeBuilder: TypeNodeBuilder
- {
- public override Type CommandHandlerType {
- get { return typeof(TestAssemblyNodeCommandHandler); }
- }
-
- public override string ContextMenuAddinPath {
- get { return "/MonoDevelop/NUnit/ContextMenu/ProjectPad/TestAssembly"; }
- }
-
- public override Type NodeDataType {
- get { return typeof(TestAssembly); }
- }
-
- public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
- {
- return Path.GetFileName (((TestAssembly)dataObject).Path);
- }
-
- public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
- {
- TestAssembly asm = dataObject as TestAssembly;
- nodeInfo.Label = Path.GetFileName (asm.Path);
- nodeInfo.Icon = Context.GetIcon (MonoDevelop.Ide.Gui.Stock.Reference);
- }
- }
-
- class TestAssemblyNodeCommandHandler: NodeCommandHandler
- {
- public override void DeleteItem ()
- {
- TestAssembly asm = CurrentNode.DataItem as TestAssembly;
- NUnitAssemblyGroupProjectConfiguration config = (NUnitAssemblyGroupProjectConfiguration) CurrentNode.GetParentDataItem (typeof(NUnitAssemblyGroupProjectConfiguration), false);
- config.Assemblies.Remove (asm);
- }
- }
-}
diff --git a/main/src/addins/NUnit/Gui/TestChart.cs b/main/src/addins/NUnit/Gui/TestChart.cs
deleted file mode 100644
index fa379bbdf4..0000000000
--- a/main/src/addins/NUnit/Gui/TestChart.cs
+++ /dev/null
@@ -1,407 +0,0 @@
-//
-// TestChart.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using Gtk;
-using Gdk;
-using MonoDevelop.Components.Chart;
-
-namespace MonoDevelop.NUnit
-{
- public enum TestChartType {
- Results,
- Time
- }
-
- class TestRunAxis: IntegerAxis
- {
- public UnitTestResult[] CurrentResults;
-
- public TestRunAxis (bool showLabel): base (showLabel)
- {
- }
-
- public override string GetValueLabel (double value)
- {
- if (CurrentResults == null)
- return "";
-
- int val = (int) value;
- if (val >= CurrentResults.Length)
- return "";
-
- UnitTestResult res = CurrentResults [CurrentResults.Length - val - 1];
- return string.Format ("{0}/{1}", res.TestDate.Day, res.TestDate.Month);
- }
- }
-
- public class TestChart: BasicChart
- {
- Serie serieFailed;
- Serie serieSuccess;
- Serie serieIgnored;
-
- Serie serieTime;
-
- bool timeScale = false;
- bool singleDayResult = false;
- TestChartType type;
-
- TimeSpan currentSpan = TimeSpan.FromDays (5);
- int testCount = 20;
- UnitTest test;
- bool showLastTest = true;
- bool resetCursors = true;
- double lastDateValue;
- double lastTestNumber;
- UnitTestResult[] currentResults;
- TestRunAxis testRunAxis;
-
- public TestChart ()
- {
- AllowSelection = true;
- SetAutoScale (AxisDimension.Y, false, true);
- StartY = 0;
-
- serieFailed = new Serie ("Failed tests");
- serieFailed.Color = new Cairo.Color (1, 0, 0);
- serieSuccess = new Serie ("Successful tests");
- serieSuccess.Color = new Cairo.Color (0, 0.65, 0);
- serieIgnored = new Serie ("Ignored tests");
- serieIgnored.Color = new Cairo.Color (0.8, 0.8, 0);
-
- serieTime = new Serie ("Time");
- serieTime.Color = new Cairo.Color (0, 0, 1);
-
- UpdateMode ();
-
-/* EndX = DateTime.Now.Ticks;
- StartX = EndX - currentSpan.Ticks;
- */
- EndX = 5;
- StartX = 0;
- }
-
- public bool ShowSuccessfulTests {
- get { return serieSuccess.Visible; }
- set { serieSuccess.Visible = value; }
- }
-
- public bool ShowFailedTests {
- get { return serieFailed.Visible; }
- set { serieFailed.Visible = value; }
- }
-
- public bool ShowIgnoredTests {
- get { return serieIgnored.Visible; }
- set { serieIgnored.Visible = value; }
- }
-
- public bool UseTimeScale {
- get { return timeScale; }
- set { timeScale = value; UpdateMode (); }
- }
-
- public bool SingleDayResult {
- get { return singleDayResult; }
- set { singleDayResult = value; UpdateMode (); }
- }
-
- public TestChartType Type {
- get { return type; }
- set { type = value; UpdateMode (); }
- }
-
- public DateTime CurrentDate {
- get {
- if (timeScale)
- return new DateTime ((long) SelectionEnd.Value);
- else {
- int n = (int) SelectionStart.Value;
- if (currentResults != null && n >= 0 && n < currentResults.Length)
- return currentResults [currentResults.Length - n - 1].TestDate;
- else
- return DateTime.MinValue;
- }
- }
- }
-
- public DateTime ReferenceDate {
- get {
- if (timeScale)
- return new DateTime ((long) SelectionStart.Value);
- else {
- int n = (int) SelectionEnd.Value;
- if (currentResults != null && n >= 0 && n < currentResults.Length)
- return currentResults [currentResults.Length - n - 1].TestDate;
- else
- return DateTime.MinValue;
- }
- }
- }
-
- void UpdateMode ()
- {
- AllowSelection = false;
-
- Reset ();
-
- if (type == TestChartType.Results) {
- AddSerie (serieIgnored);
- AddSerie (serieFailed);
- AddSerie (serieSuccess);
- } else {
- AddSerie (serieTime);
- }
-
- if (timeScale) {
- ReverseXAxis = false;
- Axis ax = new DateTimeAxis (true);
- AddAxis (new DateTimeAxis (false), AxisPosition.Top);
- AddAxis (ax, AxisPosition.Bottom);
- SelectionEnd.Value = SelectionStart.Value = DateTime.Now.Ticks;
- SelectionStart.LabelAxis = ax;
- SelectionEnd.LabelAxis = ax;
- } else {
- ReverseXAxis = true;
- AddAxis (new TestRunAxis (false), AxisPosition.Top);
- testRunAxis = new TestRunAxis (true);
- AddAxis (testRunAxis, AxisPosition.Bottom);
- SelectionEnd.Value = SelectionStart.Value = 0;
- SelectionStart.LabelAxis = testRunAxis;
- SelectionEnd.LabelAxis = testRunAxis;
- }
- showLastTest = true;
- resetCursors = true;
-
- AddAxis (new IntegerAxis (true), AxisPosition.Left);
- AddAxis (new IntegerAxis (true), AxisPosition.Right);
-
- if (test != null)
- Fill (test);
-
- AllowSelection = true;
- }
-
- public new void Clear ()
- {
- base.Clear ();
- test = null;
- }
-
- public void ZoomIn ()
- {
- if (test == null)
- return;
- if (timeScale) {
- currentSpan = new TimeSpan (currentSpan.Ticks / 2);
- if (currentSpan.TotalSeconds < 60)
- currentSpan = TimeSpan.FromSeconds (60);
- } else {
- testCount = testCount / 2;
- if (testCount < 5)
- testCount = 5;
- }
- Fill (test);
- }
-
- public void ZoomOut ()
- {
- if (test == null)
- return;
- if (timeScale) {
- currentSpan = new TimeSpan (currentSpan.Ticks * 2);
- if (currentSpan.TotalDays > 50 * 365)
- currentSpan = TimeSpan.FromDays (50 * 365);
- } else {
- testCount *= 2;
- if (testCount > 100000)
- testCount = 100000;
- }
- Fill (test);
- }
-
- public void GoNext ()
- {
- if (showLastTest)
- return;
-
- if (timeScale) {
- lastDateValue += (EndX - StartX) / 3;
- UnitTestResult lastResult = test.Results.GetLastResult (DateTime.Now);
- if (lastResult != null && new DateTime ((long)lastDateValue) > lastResult.TestDate)
- showLastTest = true;
- } else {
- lastTestNumber -= (EndX - StartX) / 3;
- if (lastTestNumber < 0)
- showLastTest = true;
- }
- Fill (test);
- }
-
- public void GoPrevious ()
- {
- if (timeScale) {
- lastDateValue -= (EndX - StartX) / 3;
- } else {
- lastTestNumber += (EndX - StartX) / 3;
- }
- showLastTest = false;
- Fill (test);
- }
-
- public void GoLast ()
- {
- showLastTest = true;
- resetCursors = true;
- Fill (test);
- }
-
- public void Fill (UnitTest test)
- {
- serieFailed.Clear ();
- serieSuccess.Clear ();
- serieIgnored.Clear ();
- serieTime.Clear ();
-
- this.test = test;
-
- if (showLastTest) {
- if (timeScale)
- lastDateValue = DateTime.Now.Ticks;
- else
- lastTestNumber = 0;
- }
-
- UnitTestResult first = null;
- UnitTestResult[] results;
- UnitTestResult lastResult = test.Results.GetLastResult (DateTime.Now);
- if (lastResult == null)
- return;
-
- if (timeScale) {
- DateTime startDate;
- if (showLastTest) {
- startDate = lastResult.TestDate - currentSpan;
- StartX = startDate.Ticks;
- EndX = lastResult.TestDate.Ticks;
- first = test.Results.GetLastResult (startDate);
- results = test.Results.GetResults (startDate, lastResult.TestDate);
- } else {
- DateTime endDate = new DateTime ((long)lastDateValue);
- startDate = endDate - currentSpan;
- StartX = (double)startDate.Ticks;
- EndX = (double)endDate.Ticks;
- first = test.Results.GetLastResult (startDate);
- results = test.Results.GetResults (startDate, lastResult.TestDate);
- }
- if (singleDayResult) {
- first = test.Results.GetPreviousResult (new DateTime (startDate.Year, startDate.Month, startDate.Day));
- ArrayList list = new ArrayList ();
- if (first != null)
- list.Add (first);
- for (int n=0; n<results.Length - 1; n++) {
- DateTime d1 = results [n].TestDate;
- DateTime d2 = results [n + 1].TestDate;
- if (d1.Day != d2.Day || d1.Month != d2.Month || d1.Year != d2.Year)
- list.Add (results [n]);
- }
- list.Add (results [results.Length - 1]);
- results = (UnitTestResult[])list.ToArray (typeof(UnitTestResult));
- }
-
- if (resetCursors) {
- SelectionEnd.Value = EndX;
- if (results.Length > 1)
- SelectionStart.Value = results [results.Length - 2].TestDate.Ticks;
- else
- SelectionStart.Value = EndX;
- resetCursors = false;
- }
- } else {
- if (singleDayResult) {
- ArrayList list = new ArrayList ();
- list.Add (lastResult);
- while (list.Count < testCount + (int)lastTestNumber + 1) {
- UnitTestResult res = test.Results.GetPreviousResult (lastResult.TestDate);
- if (res == null)
- break;
- if (res.TestDate.Day != lastResult.TestDate.Day || res.TestDate.Month != lastResult.TestDate.Month || res.TestDate.Year != lastResult.TestDate.Year)
- list.Add (res);
- lastResult = res;
- }
- results = (UnitTestResult[])list.ToArray (typeof(UnitTestResult));
- Array.Reverse (results);
- } else {
- results = test.Results.GetResultsToDate (DateTime.Now, testCount + (int)lastTestNumber + 1);
- }
- EndX = lastTestNumber + testCount;
- StartX = lastTestNumber;
-
- if (resetCursors) {
- SelectionStart.Value = StartX;
- SelectionEnd.Value = StartX + 1;
- resetCursors = false;
- }
- }
-
-
- currentResults = results;
- if (testRunAxis != null)
- testRunAxis.CurrentResults = currentResults;
-
- if (Type == TestChartType.Results) {
- if (first != null) {
- double x = timeScale ? first.TestDate.Ticks : results.Length;
- serieFailed.AddData (x, first.ErrorsAndFailures);
- serieSuccess.AddData (x, first.Passed);
- serieIgnored.AddData (x, first.TestsNotRun);
- }
-
- for (int n=0; n < results.Length; n++) {
- UnitTestResult res = results [n];
- double x = timeScale ? res.TestDate.Ticks : results.Length - n - 1;
- serieFailed.AddData (x, res.ErrorsAndFailures);
- serieSuccess.AddData (x, res.Passed);
- serieIgnored.AddData (x, res.TestsNotRun);
- }
- } else {
- if (first != null) {
- double x = timeScale ? first.TestDate.Ticks : results.Length;
- serieTime.AddData (x, first.Time.TotalMilliseconds);
- }
- for (int n=0; n < results.Length; n++) {
- UnitTestResult res = results [n];
- double x = timeScale ? res.TestDate.Ticks : results.Length - n - 1;
- serieTime.AddData (x, results [n].Time.TotalMilliseconds);
- }
- }
- }
- }
-}
diff --git a/main/src/addins/NUnit/Gui/TestNodeBuilder.cs b/main/src/addins/NUnit/Gui/TestNodeBuilder.cs
deleted file mode 100644
index 7166e6b610..0000000000
--- a/main/src/addins/NUnit/Gui/TestNodeBuilder.cs
+++ /dev/null
@@ -1,207 +0,0 @@
-//
-// TestNodeBuilder.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-using MonoDevelop.Core;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.NUnit.Commands;
-using MonoDevelop.Ide.Commands;
-using MonoDevelop.Ide.Gui.Components;
-using MonoDevelop.Ide;
-
-namespace MonoDevelop.NUnit
-{
- public class TestNodeBuilder: TypeNodeBuilder
- {
- EventHandler testChanged;
- EventHandler testStatusChanged;
-
- public TestNodeBuilder ()
- {
- testChanged = (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnTestChanged));
- testStatusChanged = (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnTestStatusChanged));
- }
-
- public override Type CommandHandlerType {
- get { return typeof(TestNodeCommandHandler); }
- }
-
- public override string ContextMenuAddinPath {
- get { return "/MonoDevelop/NUnit/ContextMenu/TestPad"; }
- }
-
- public override Type NodeDataType {
- get { return typeof(UnitTest); }
- }
-
- public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
- {
- return ((UnitTest)dataObject).Name;
- }
-
-/* public override void GetNodeAttributes (ITreeNavigator parentNode, object dataObject, ref NodeAttributes attributes)
- {
- attributes |= NodeAttributes.UseMarkup;
- }
-*/
- public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
- {
- UnitTest test = dataObject as UnitTest;
- nodeInfo.Icon = test.StatusIcon;
-
- if (test.Status == TestStatus.Running) {
- nodeInfo.Label = test.Title;
- return;
- } else if (test.Status == TestStatus.Loading) {
- nodeInfo.Label = test.Title + GettextCatalog.GetString (" (Loading)");
- return;
- } else if (test.Status == TestStatus.LoadError) {
- nodeInfo.Label = test.Title + GettextCatalog.GetString (" (Load failed)");
- return;
- } else {
- nodeInfo.Label = test.Title;
-
- UnitTestResult res = test.GetLastResult ();
- if (res != null && treeBuilder.Options ["ShowTestCounters"] && (test is UnitTestGroup)) {
- nodeInfo.Label += string.Format (GettextCatalog.GetString (" ({0} passed, {1} failed, {2} not run)"), res.Passed, res.ErrorsAndFailures, res.TestsNotRun);
- }
-
- if (treeBuilder.Options ["ShowTestTime"]) {
- nodeInfo.Label += string.Format (" Time: {0}ms", res.Time.TotalMilliseconds);
- }
- }
- }
-
- public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
- {
- UnitTestGroup test = dataObject as UnitTestGroup;
- if (test == null)
- return;
-
- foreach (UnitTest t in test.Tests)
- builder.AddChild (t);
- }
-
- public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
- {
- UnitTestGroup test = dataObject as UnitTestGroup;
- return test != null && test.Tests.Count > 0;
- }
-
- public override void OnNodeAdded (object dataObject)
- {
- UnitTest test = (UnitTest) dataObject;
- test.TestChanged += testChanged;
- test.TestStatusChanged += testStatusChanged;
- }
-
- public override void OnNodeRemoved (object dataObject)
- {
- UnitTest test = (UnitTest) dataObject;
- test.TestChanged -= testChanged;
- test.TestStatusChanged -= testStatusChanged;
- }
-
- public void OnTestChanged (object sender, EventArgs args)
- {
- ITreeBuilder tb = Context.GetTreeBuilder (sender);
- if (tb != null) tb.UpdateAll ();
- }
-
- public void OnTestStatusChanged (object sender, EventArgs args)
- {
- ITreeBuilder tb = Context.GetTreeBuilder (sender);
- if (tb != null) tb.Update ();
- }
- }
-
- class TestNodeCommandHandler: NodeCommandHandler
- {
- [CommandHandler (TestCommands.ShowTestCode)]
- protected void OnShowTest ()
- {
- UnitTest test = CurrentNode.DataItem as UnitTest;
- SourceCodeLocation loc = null;
-// UnitTestResult res = test.GetLastResult ();
- loc = test.SourceCodeLocation;
- if (loc != null)
- IdeApp.Workbench.OpenDocument (loc.FileName, loc.Line, loc.Column);
- }
-
- [CommandHandler (TestCommands.GoToFailure)]
- protected void OnShowFailure ()
- {
- UnitTest test = CurrentNode.DataItem as UnitTest;
- SourceCodeLocation loc = null;
- UnitTestResult res = test.GetLastResult ();
- if (res != null && res.IsFailure)
- loc = res.GetFailureLocation ();
- if (loc == null)
- loc = test.SourceCodeLocation;
- if (loc != null)
- IdeApp.Workbench.OpenDocument (loc.FileName, loc.Line, loc.Column);
- }
-
- [CommandUpdateHandler (TestCommands.ShowTestCode)]
- protected void OnUpdateRunTest (CommandInfo info)
- {
- UnitTest test = CurrentNode.DataItem as UnitTest;
- info.Enabled = test.SourceCodeLocation != null;
- }
-
- [CommandUpdateHandler (TestCommands.GoToFailure)]
- protected void OnUpdateGoToFailure (CommandInfo info)
- {
- UnitTest test = CurrentNode.DataItem as UnitTest;
- info.Enabled = IsGoToFailureEnabled (test);
- }
-
- bool IsGoToFailureEnabled (UnitTest test)
- {
- if (test.SourceCodeLocation == null || test is UnitTestGroup)
- return false;
-
- UnitTestResult res = test.GetLastResult ();
- return res != null && res.IsFailure;
- }
-
- [CommandUpdateHandler (ProjectCommands.Options)]
- protected void OnUpdateShowOptions (CommandInfo info)
- {
- info.Visible = !(CurrentNode.DataItem is SolutionFolderTestGroup);
- }
-
- [CommandHandler (ProjectCommands.Options)]
- protected void OnShowOptions ()
- {
- UnitTest test = CurrentNode.DataItem as UnitTest;
- NUnitService.ShowOptionsDialog (test);
- }
- }
-}
diff --git a/main/src/addins/NUnit/Gui/TestPad.cs b/main/src/addins/NUnit/Gui/TestPad.cs
deleted file mode 100644
index 3e46d3c8bb..0000000000
--- a/main/src/addins/NUnit/Gui/TestPad.cs
+++ /dev/null
@@ -1,927 +0,0 @@
-//
-// TestPad.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using Gtk;
-using Gdk;
-
-using MonoDevelop.Core;
-using MonoDevelop.Core.Execution;
-using MonoDevelop.Ide.Gui.Pads;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.NUnit.Commands;
-using MonoDevelop.Ide.Gui.Components;
-using MonoDevelop.Ide.Execution;
-using MonoDevelop.Components.Docking;
-using MonoDevelop.Ide;
-using MonoDevelop.Projects;
-using Mono.TextEditor;
-using System.Linq;
-using MonoDevelop.Components;
-using MonoDevelop.Ide.Commands;
-using System.Collections.Generic;
-
-namespace MonoDevelop.NUnit
-{
- public class TestPad : TreeViewPad
- {
- NUnitService testService = NUnitService.Instance;
-
- IAsyncOperation runningTestOperation;
- VPaned paned;
- TreeView detailsTree;
- ListStore detailsStore;
- HeaderLabel detailLabel;
- TestChart chart;
- UnitTest detailsTest;
- DateTime detailsDate;
- DateTime detailsReferenceDate;
- ButtonNotebook infoBook;
- TextView outputView;
- TextView resultView;
- TreeView regressionTree;
- ListStore regressionStore;
- TreeView failedTree;
- ListStore failedStore;
-
- int TestSummaryPage;
- int TestRegressionsPage;
- int TestFailuresPage;
- int TestResultPage;
- int TestOutputPage;
-
- EventHandler testChangedHandler;
- VBox detailsPad;
-
- ArrayList testNavigationHistory = new ArrayList ();
-
- Button buttonRunAll, buttonStop;
-
- public override void Initialize (NodeBuilder[] builders, TreePadOption[] options, string menuPath)
- {
- base.Initialize (builders, options, menuPath);
-
- testChangedHandler = (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnDetailsTestChanged));
- testService.TestSuiteChanged += (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnTestSuiteChanged));
- paned = new VPaned ();
-
- VBox vbox = new VBox ();
- DockItemToolbar topToolbar = Window.GetToolbar (PositionType.Top);
-
- var hbox = new HBox { Spacing = 6 };
- hbox.PackStart (new ImageView (ImageService.GetIcon ("nunit-run", IconSize.Menu)), false, false, 0);
- hbox.PackStart (new Label (GettextCatalog.GetString ("Run All")), false, false, 0);
- buttonRunAll = new Button (hbox);
- buttonRunAll.Clicked += new EventHandler (OnRunAllClicked);
- buttonRunAll.Sensitive = true;
- buttonRunAll.TooltipText = GettextCatalog.GetString ("Run all tests");
- topToolbar.Add (buttonRunAll);
-
- buttonStop = new Button (new Gtk.Image (Ide.Gui.Stock.Stop, IconSize.Menu));
- buttonStop.Clicked += new EventHandler (OnStopClicked);
- buttonStop.Sensitive = false;
- buttonStop.TooltipText = GettextCatalog.GetString ("Cancel running test");
- topToolbar.Add (buttonStop);
- topToolbar.ShowAll ();
-
- vbox.PackEnd (base.Control, true, true, 0);
- vbox.FocusChain = new Gtk.Widget [] { base.Control };
-
- paned.Pack1 (vbox, true, true);
-
- detailsPad = new VBox ();
-
- EventBox eb = new EventBox ();
- HBox header = new HBox ();
- eb.Add (header);
-
- detailLabel = new HeaderLabel ();
- detailLabel.Padding = 6;
-
- Button hb = new Button (new Gtk.Image ("gtk-close", IconSize.SmallToolbar));
- hb.Relief = ReliefStyle.None;
- hb.Clicked += new EventHandler (OnCloseDetails);
- header.PackEnd (hb, false, false, 0);
-
- hb = new Button (new Gtk.Image ("gtk-go-back", IconSize.SmallToolbar));
- hb.Relief = ReliefStyle.None;
- hb.Clicked += new EventHandler (OnGoBackTest);
- header.PackEnd (hb, false, false, 0);
-
- header.Add (detailLabel);
- Gdk.Color hcol = eb.Style.Background (StateType.Normal);
- hcol.Red = (ushort) (((double)hcol.Red) * 0.9);
- hcol.Green = (ushort) (((double)hcol.Green) * 0.9);
- hcol.Blue = (ushort) (((double)hcol.Blue) * 0.9);
- // eb.ModifyBg (StateType.Normal, hcol);
-
- detailsPad.PackStart (eb, false, false, 0);
-
- VPaned panedDetails = new VPaned ();
- panedDetails.BorderWidth = 3;
- VBox boxPaned1 = new VBox ();
-
- chart = new TestChart ();
- chart.ButtonPressEvent += OnChartButtonPress;
- chart.SelectionChanged += new EventHandler (OnChartDateChanged);
- chart.HeightRequest = 50;
-
- Toolbar toolbar = new Toolbar ();
- toolbar.IconSize = IconSize.SmallToolbar;
- toolbar.ToolbarStyle = ToolbarStyle.Icons;
- toolbar.ShowArrow = false;
- ToolButton but = new ToolButton ("gtk-zoom-in");
- but.Clicked += new EventHandler (OnZoomIn);
- toolbar.Insert (but, -1);
-
- but = new ToolButton ("gtk-zoom-out");
- but.Clicked += new EventHandler (OnZoomOut);
- toolbar.Insert (but, -1);
-
- but = new ToolButton ("gtk-go-back");
- but.Clicked += new EventHandler (OnChartBack);
- toolbar.Insert (but, -1);
-
- but = new ToolButton ("gtk-go-forward");
- but.Clicked += new EventHandler (OnChartForward);
- toolbar.Insert (but, -1);
-
- but = new ToolButton ("gtk-goto-last");
- but.Clicked += new EventHandler (OnChartLast);
- toolbar.Insert (but, -1);
-
- boxPaned1.PackStart (toolbar, false, false, 0);
- boxPaned1.PackStart (chart, true, true, 0);
-
- panedDetails.Pack1 (boxPaned1, false, false);
-
- // Detailed test information --------
-
- infoBook = new ButtonNotebook ();
- infoBook.PageLoadRequired += new EventHandler (OnPageLoadRequired);
-
- // Info - Group summary
-
- Frame tf = new Frame ();
- ScrolledWindow sw = new ScrolledWindow ();
- detailsTree = new TreeView ();
-
- detailsTree.HeadersVisible = true;
- detailsTree.RulesHint = true;
- detailsStore = new ListStore (typeof(object), typeof(string), typeof (string), typeof (string), typeof (string));
-
- CellRendererText trtest = new CellRendererText ();
- CellRendererText tr;
-
- TreeViewColumn col3 = new TreeViewColumn ();
- col3.Expand = false;
-// col3.Alignment = 0.5f;
- col3.Widget = new ImageView (TestStatusIcon.Success);
- col3.Widget.Show ();
- tr = new CellRendererText ();
-// tr.Xalign = 0.5f;
- col3.PackStart (tr, false);
- col3.AddAttribute (tr, "markup", 2);
- detailsTree.AppendColumn (col3);
-
- TreeViewColumn col4 = new TreeViewColumn ();
- col4.Expand = false;
-// col4.Alignment = 0.5f;
- col4.Widget = new ImageView (TestStatusIcon.Failure);
- col4.Widget.Show ();
- tr = new CellRendererText ();
-// tr.Xalign = 0.5f;
- col4.PackStart (tr, false);
- col4.AddAttribute (tr, "markup", 3);
- detailsTree.AppendColumn (col4);
-
- TreeViewColumn col5 = new TreeViewColumn ();
- col5.Expand = false;
-// col5.Alignment = 0.5f;
- col5.Widget = new ImageView (TestStatusIcon.NotRun);
- col5.Widget.Show ();
- tr = new CellRendererText ();
-// tr.Xalign = 0.5f;
- col5.PackStart (tr, false);
- col5.AddAttribute (tr, "markup", 4);
- detailsTree.AppendColumn (col5);
-
- TreeViewColumn col1 = new TreeViewColumn ();
-// col1.Resizable = true;
-// col1.Expand = true;
- col1.Title = "Test";
- col1.PackStart (trtest, true);
- col1.AddAttribute (trtest, "markup", 1);
- detailsTree.AppendColumn (col1);
-
- detailsTree.Model = detailsStore;
-
- sw.Add (detailsTree);
- tf.Add (sw);
- tf.ShowAll ();
-
- TestSummaryPage = infoBook.AddPage (GettextCatalog.GetString ("Summary"), tf);
-
- // Info - Regressions list
-
- tf = new Frame ();
- sw = new ScrolledWindow ();
- tf.Add (sw);
- regressionTree = new TreeView ();
- regressionTree.HeadersVisible = false;
- regressionTree.RulesHint = true;
- regressionStore = new ListStore (typeof(object), typeof(string), typeof (Xwt.Drawing.Image));
-
- CellRendererText trtest2 = new CellRendererText ();
- var pr = new CellRendererImage ();
-
- TreeViewColumn col = new TreeViewColumn ();
- col.PackStart (pr, false);
- col.AddAttribute (pr, "image", 2);
- col.PackStart (trtest2, false);
- col.AddAttribute (trtest2, "markup", 1);
- regressionTree.AppendColumn (col);
- regressionTree.Model = regressionStore;
- sw.Add (regressionTree);
- tf.ShowAll ();
-
- TestRegressionsPage = infoBook.AddPage (GettextCatalog.GetString ("Regressions"), tf);
-
- // Info - Failed tests list
-
- tf = new Frame ();
- sw = new ScrolledWindow ();
- tf.Add (sw);
- failedTree = new TreeView ();
- failedTree.HeadersVisible = false;
- failedTree.RulesHint = true;
- failedStore = new ListStore (typeof(object), typeof(string), typeof (Xwt.Drawing.Image));
-
- trtest2 = new CellRendererText ();
- pr = new CellRendererImage ();
-
- col = new TreeViewColumn ();
- col.PackStart (pr, false);
- col.AddAttribute (pr, "image", 2);
- col.PackStart (trtest2, false);
- col.AddAttribute (trtest2, "markup", 1);
- failedTree.AppendColumn (col);
- failedTree.Model = failedStore;
- sw.Add (failedTree);
- tf.ShowAll ();
-
- TestFailuresPage = infoBook.AddPage (GettextCatalog.GetString ("Failed tests"), tf);
-
- // Info - results
-
- tf = new Frame ();
- sw = new ScrolledWindow ();
- tf.Add (sw);
- resultView = new TextView ();
- resultView.Editable = false;
- sw.Add (resultView);
- tf.ShowAll ();
- TestResultPage = infoBook.AddPage (GettextCatalog.GetString ("Result"), tf);
-
- // Info - Output
-
- tf = new Frame ();
- sw = new ScrolledWindow ();
- tf.Add (sw);
- outputView = new TextView ();
- outputView.Editable = false;
- sw.Add (outputView);
- tf.ShowAll ();
- TestOutputPage = infoBook.AddPage (GettextCatalog.GetString ("Output"), tf);
-
- panedDetails.Pack2 (infoBook, true, true);
- detailsPad.PackStart (panedDetails, true, true, 0);
- paned.Pack2 (detailsPad, true, true);
-
- paned.ShowAll ();
-
- infoBook.HidePage (TestResultPage);
- infoBook.HidePage (TestOutputPage);
- infoBook.HidePage (TestSummaryPage);
- infoBook.HidePage (TestRegressionsPage);
- infoBook.HidePage (TestFailuresPage);
-
- detailsPad.Sensitive = false;
- detailsPad.Hide ();
-
- detailsTree.RowActivated += new Gtk.RowActivatedHandler (OnTestActivated);
- regressionTree.RowActivated += new Gtk.RowActivatedHandler (OnRegressionTestActivated);
- failedTree.RowActivated += new Gtk.RowActivatedHandler (OnFailedTestActivated);
-
- foreach (UnitTest t in testService.RootTests)
- TreeView.AddChild (t);
- }
-
- void OnTestSuiteChanged (object sender, EventArgs e)
- {
- if (testService.RootTests.Length > 0) {
- var s = TreeView.SaveTreeState ();
- TreeView.Clear ();
- foreach (UnitTest t in testService.RootTests)
- TreeView.AddChild (t);
- TreeView.RestoreTreeState (s);
- }
- else {
- TreeView.Clear ();
- ClearDetails ();
- }
- }
-
- public void SelectTest (UnitTest t)
- {
- ITreeNavigator node = FindTestNode (t);
- if (node != null) {
- node.ExpandToNode ();
- node.Selected = true;
- }
- }
-
- ITreeNavigator FindTestNode (UnitTest t)
- {
- ITreeNavigator nav = TreeView.GetNodeAtObject (t);
- if (nav != null)
- return nav;
- if (t.Parent == null)
- return null;
-
- nav = FindTestNode (t.Parent);
-
- if (nav == null)
- return null;
-
- nav.MoveToFirstChild (); // Make sure the children are created
- return TreeView.GetNodeAtObject (t);
- }
-
- public override Gtk.Widget Control {
- get {
- return paned;
- }
- }
-
- [CommandHandler (TestCommands.RunTest)]
- protected void OnRunTest ()
- {
- RunSelectedTest (null);
- }
-
- [CommandUpdateHandler (TestCommands.RunTest)]
- protected void OnUpdateRunTest (CommandInfo info)
- {
- info.Enabled = runningTestOperation == null;
- }
-
- [CommandHandler (TestCommands.RunTestWith)]
- protected void OnRunTest (object data)
- {
- IExecutionHandler h = ExecutionModeCommandService.GetExecutionModeForCommand (data);
- if (h != null)
- RunSelectedTest (h);
- }
-
- [CommandUpdateHandler (TestCommands.RunTestWith)]
- protected void OnUpdateRunTest (CommandArrayInfo info)
- {
- UnitTest test = GetSelectedTest ();
- if (test != null) {
- SolutionEntityItem item = test.OwnerObject as SolutionEntityItem;
- ExecutionModeCommandService.GenerateExecutionModeCommands (
- item,
- test.CanRun,
- info);
-
- foreach (var ci in info)
- ci.Enabled = runningTestOperation == null;
- }
- }
-
- [CommandHandler (TestCommands.DebugTest)]
- protected void OnDebugTest (object data)
- {
- var debugModeSet = Runtime.ProcessService.GetDebugExecutionMode ();
- var mode = debugModeSet.ExecutionModes.First (m => m.Id == (string)data);
- RunSelectedTest (mode.ExecutionHandler);
- }
-
- [CommandUpdateHandler (TestCommands.DebugTest)]
- protected void OnUpdateDebugTest (CommandArrayInfo info)
- {
- var debugModeSet = Runtime.ProcessService.GetDebugExecutionMode ();
- if (debugModeSet == null)
- return;
-
- UnitTest test = GetSelectedTest ();
- if (test == null)
- return;
-
- foreach (var mode in debugModeSet.ExecutionModes) {
- if (test.CanRun (mode.ExecutionHandler)) {
- var ci = info.Add (GettextCatalog.GetString ("Debug Test ({0})", mode.Name), mode.Id);
- ci.Enabled = runningTestOperation == null;
- }
- }
-
- if (info.Count == 1)
- info [0].Text = GettextCatalog.GetString ("Debug Test");
- }
-
- public TestPad ()
- {
- base.TreeView.CurrentItemActivated += delegate {
- RunSelectedTest (null);
- };
- }
-
- void OnStopClicked (object sender, EventArgs args)
- {
- if (runningTestOperation != null)
- runningTestOperation.Cancel ();
- }
-
- UnitTest GetSelectedTest ()
- {
- ITreeNavigator nav = TreeView.GetSelectedNode ();
- if (nav == null)
- return null;
- return nav.DataItem as UnitTest;
- }
-
- public IAsyncOperation RunTest (UnitTest test, IExecutionHandler mode)
- {
- return RunTest (FindTestNode (test), mode, false);
- }
-
- IAsyncOperation RunTest (ITreeNavigator nav, IExecutionHandler mode, bool bringToFront = true)
- {
- if (nav == null)
- return null;
- UnitTest test = nav.DataItem as UnitTest;
- if (test == null)
- return null;
- NUnitService.ResetResult (test.RootTest);
-
- this.buttonRunAll.Sensitive = false;
- this.buttonStop.Sensitive = true;
-
- if (bringToFront)
- IdeApp.Workbench.GetPad<TestPad> ().BringToFront ();
- runningTestOperation = testService.RunTest (test, mode);
- runningTestOperation.Completed += (OperationHandler) DispatchService.GuiDispatch (new OperationHandler (OnTestSessionCompleted));
- return runningTestOperation;
- }
-
- void OnRunAllClicked (object sender, EventArgs args)
- {
- RunTest (TreeView.GetRootNode (), null);
- }
-
- void RunSelectedTest (IExecutionHandler mode)
- {
- RunTest (TreeView.GetSelectedNode (), mode);
- }
-
- void OnTestSessionCompleted (IAsyncOperation op)
- {
- if (op.Success)
- RefreshDetails ();
- runningTestOperation = null;
- this.buttonRunAll.Sensitive = true;
- this.buttonStop.Sensitive = false;
-
- }
-
-
- protected override void OnSelectionChanged (object sender, EventArgs args)
- {
- base.OnSelectionChanged (sender, args);
- ITreeNavigator nav = TreeView.GetSelectedNode ();
- if (nav != null) {
- UnitTest test = nav.DataItem as UnitTest;
- if (test != null)
- FillDetails (test, false);
- }
- }
-
- void OnGoBackTest (object sender, EventArgs args)
- {
- int c = testNavigationHistory.Count;
- if (c > 1) {
- UnitTest t = (UnitTest) testNavigationHistory [c - 2];
- testNavigationHistory.RemoveAt (c - 1);
- testNavigationHistory.RemoveAt (c - 2);
- FillDetails (t, true);
- }
- }
-
- void OnCloseDetails (object sender, EventArgs args)
- {
- detailsPad.Hide ();
- }
-
- [CommandHandler (TestCommands.ShowTestDetails)]
- protected void OnShowDetails ()
- {
- if (!detailsPad.Visible) {
- detailsPad.Show ();
-
- ITreeNavigator nav = TreeView.GetSelectedNode ();
- if (nav != null) {
- UnitTest test = (UnitTest) nav.DataItem;
- FillDetails (test, false);
- } else
- ClearDetails ();
- }
- }
-
- void ClearDetails ()
- {
- chart.Clear ();
- detailLabel.Markup = "";
- detailsStore.Clear ();
- if (detailsTest != null)
- detailsTest.TestChanged -= testChangedHandler;
- detailsTest = null;
- detailsDate = DateTime.MinValue;
- detailsReferenceDate = DateTime.MinValue;
- detailsPad.Sensitive = false;
- }
-
- void RefreshDetails ()
- {
- if (detailsTest != null)
- FillDetails (detailsTest, false);
- }
-
- void FillDetails (UnitTest test, bool selectInTree)
- {
- if (!detailsPad.Visible)
- return;
-
- detailsPad.Sensitive = true;
-
- if (detailsTest != null)
- detailsTest.TestChanged -= testChangedHandler;
-
- if (detailsTest != test) {
- detailsTest = test;
- if (selectInTree)
- SelectTest (test);
- testNavigationHistory.Add (test);
- if (testNavigationHistory.Count > 50)
- testNavigationHistory.RemoveAt (0);
- }
- detailsTest.TestChanged += testChangedHandler;
-
- if (test is UnitTestGroup) {
- infoBook.HidePage (TestResultPage);
- infoBook.HidePage (TestOutputPage);
- infoBook.ShowPage (TestSummaryPage);
- infoBook.ShowPage (TestRegressionsPage);
- infoBook.ShowPage (TestFailuresPage);
- } else {
- infoBook.HidePage (TestSummaryPage);
- infoBook.HidePage (TestRegressionsPage);
- infoBook.HidePage (TestFailuresPage);
- infoBook.ShowPage (TestResultPage);
- infoBook.ShowPage (TestOutputPage);
- }
- detailLabel.Markup = "<b>" + test.Name + "</b>";
- detailsDate = DateTime.MinValue;
- detailsReferenceDate = DateTime.MinValue;
- chart.Fill (test);
- infoBook.Reset ();
- }
-
- void FillTestInformation ()
- {
- if (!detailsPad.Visible)
- return;
-
- if (detailsTest is UnitTestGroup) {
- UnitTestGroup group = detailsTest as UnitTestGroup;
- if (infoBook.Page == TestSummaryPage) {
- detailsStore.Clear ();
- foreach (UnitTest t in group.Tests) {
- UnitTestResult res = t.Results.GetLastResult (chart.CurrentDate);
- if (res != null)
- detailsStore.AppendValues (t, t.Name, res.Passed.ToString (), res.ErrorsAndFailures.ToString (), res.Ignored.ToString());
- else
- detailsStore.AppendValues (t, t.Name, "", "", "");
- }
- }
- else if (infoBook.Page == TestRegressionsPage) {
- regressionStore.Clear ();
- UnitTestCollection regs = detailsTest.GetRegressions (chart.ReferenceDate, chart.CurrentDate);
- if (regs.Count > 0) {
- foreach (UnitTest t in regs)
- regressionStore.AppendValues (t, t.Name, TestStatusIcon.Failure);
- } else
- regressionStore.AppendValues (null, GettextCatalog.GetString ("No regressions found."));
- }
- else if (infoBook.Page == TestFailuresPage) {
- failedStore.Clear ();
- UnitTestCollection regs = group.GetFailedTests (chart.CurrentDate);
- if (regs.Count > 0) {
- foreach (UnitTest t in regs)
- failedStore.AppendValues (t, t.Name, TestStatusIcon.Failure);
- } else
- failedStore.AppendValues (null, GettextCatalog.GetString ("No failed tests found."));
- }
- } else {
- UnitTestResult res = detailsTest.Results.GetLastResult (chart.CurrentDate);
- if (infoBook.Page == TestOutputPage) {
- outputView.Buffer.Clear ();
- if (res != null)
- outputView.Buffer.InsertAtCursor (res.ConsoleOutput);
- } else if (infoBook.Page == TestResultPage) {
- resultView.Buffer.Clear ();
- if (res != null) {
- string msg = res.Message + "\n\n" + res.StackTrace;
- resultView.Buffer.InsertAtCursor (msg);
- }
- }
- }
- }
-
- void OnDetailsTestChanged (object sender, EventArgs e)
- {
- RefreshDetails ();
- }
-
- void OnChartDateChanged (object sender, EventArgs e)
- {
- if (detailsTest != null && (detailsDate != chart.CurrentDate || detailsReferenceDate != chart.ReferenceDate)) {
- detailsDate = chart.CurrentDate;
- detailsReferenceDate = chart.ReferenceDate;
- FillTestInformation ();
- }
- }
-
- void OnPageLoadRequired (object o, EventArgs args)
- {
- if (detailsTest != null)
- FillTestInformation ();
- }
-
- protected virtual void OnTestActivated (object sender, Gtk.RowActivatedArgs args)
- {
- TreeIter it;
- detailsStore.GetIter (out it, args.Path);
- UnitTest t = (UnitTest) detailsStore.GetValue (it, 0);
- if (t != null)
- FillDetails (t, true);
- }
-
- protected virtual void OnRegressionTestActivated (object sender, Gtk.RowActivatedArgs args)
- {
- TreeIter it;
- regressionStore.GetIter (out it, args.Path);
- UnitTest t = (UnitTest) regressionStore.GetValue (it, 0);
- if (t != null)
- FillDetails (t, true);
- }
-
- protected virtual void OnFailedTestActivated (object sender, Gtk.RowActivatedArgs args)
- {
- TreeIter it;
- failedStore.GetIter (out it, args.Path);
- UnitTest t = (UnitTest) failedStore.GetValue (it, 0);
- if (t != null)
- FillDetails (t, true);
- }
-
- void OnZoomIn (object sender, EventArgs a)
- {
- if (detailsTest != null)
- chart.ZoomIn ();
- }
-
- void OnZoomOut (object sender, EventArgs a)
- {
- if (detailsTest != null)
- chart.ZoomOut ();
- }
-
- void OnChartBack (object sender, EventArgs a)
- {
- if (detailsTest != null)
- chart.GoPrevious ();
- }
-
- void OnChartForward (object sender, EventArgs a)
- {
- if (detailsTest != null)
- chart.GoNext ();
- }
-
- void OnChartLast (object sender, EventArgs a)
- {
- if (detailsTest != null)
- chart.GoLast ();
- }
-
- void OnChartButtonPress (object o, Gtk.ButtonPressEventArgs args)
- {
- if (args.Event.TriggersContextMenu ()) {
- IdeApp.CommandService.ShowContextMenu (Control, args.Event, "/MonoDevelop/NUnit/ContextMenu/TestChart");
- args.RetVal = true;
- }
- }
-
- [CommandHandler (TestChartCommands.ShowResults)]
- protected void OnShowResults ()
- {
- chart.Type = TestChartType.Results;
- }
-
- [CommandUpdateHandler (TestChartCommands.ShowResults)]
- protected void OnUpdateShowResults (CommandInfo info)
- {
- info.Checked = chart.Type == TestChartType.Results;
- }
-
- [CommandHandler (TestChartCommands.ShowTime)]
- protected void OnShowTime ()
- {
- chart.Type = TestChartType.Time;
- }
-
- [CommandUpdateHandler (TestChartCommands.ShowTime)]
- protected void OnUpdateShowTime (CommandInfo info)
- {
- info.Checked = chart.Type == TestChartType.Time;
- }
-
- [CommandHandler (TestChartCommands.UseTimeScale)]
- protected void OnUseTimeScale ()
- {
- chart.UseTimeScale = !chart.UseTimeScale;
- }
-
- [CommandUpdateHandler (TestChartCommands.UseTimeScale)]
- protected void OnUpdateUseTimeScale (CommandInfo info)
- {
- info.Checked = chart.UseTimeScale;
- }
-
- [CommandHandler (TestChartCommands.SingleDayResult)]
- protected void OnSingleDayResult ()
- {
- chart.SingleDayResult = !chart.SingleDayResult;
- }
-
- [CommandUpdateHandler (TestChartCommands.SingleDayResult)]
- protected void OnUpdateSingleDayResult (CommandInfo info)
- {
- info.Checked = chart.SingleDayResult;
- }
-
- [CommandHandler (TestChartCommands.ShowSuccessfulTests)]
- protected void OnShowSuccessfulTests ()
- {
- chart.ShowSuccessfulTests = !chart.ShowSuccessfulTests;
- }
-
- [CommandUpdateHandler (TestChartCommands.ShowSuccessfulTests)]
- protected void OnUpdateShowSuccessfulTests (CommandInfo info)
- {
- info.Enabled = chart.Type == TestChartType.Results;
- info.Checked = chart.ShowSuccessfulTests;
- }
-
- [CommandHandler (TestChartCommands.ShowFailedTests)]
- protected void OnShowFailedTests ()
- {
- chart.ShowFailedTests = !chart.ShowFailedTests;
- }
-
- [CommandUpdateHandler (TestChartCommands.ShowFailedTests)]
- protected void OnUpdateShowFailedTests (CommandInfo info)
- {
- info.Enabled = chart.Type == TestChartType.Results;
- info.Checked = chart.ShowFailedTests;
- }
-
- [CommandHandler (TestChartCommands.ShowIgnoredTests)]
- protected void OnShowIgnoredTests ()
- {
- chart.ShowIgnoredTests = !chart.ShowIgnoredTests;
- }
-
- [CommandUpdateHandler (TestChartCommands.ShowIgnoredTests)]
- protected void OnUpdateShowIgnoredTests (CommandInfo info)
- {
- info.Enabled = chart.Type == TestChartType.Results;
- info.Checked = chart.ShowIgnoredTests;
- }
- }
-
- class ButtonNotebook: Notebook
- {
- ArrayList loadedPages = new ArrayList ();
-
- public void Reset ()
- {
- loadedPages.Clear ();
- OnPageLoadRequired ();
- }
-
- public int AddPage (string text, Widget widget)
- {
- return AppendPage (widget, new Label (text));
- }
-
- public void ShowPage (int n)
- {
- GetNthPage (n).Show ();
- }
-
- public void HidePage (int n)
- {
- GetNthPage (n).Hide ();
- }
-
- protected override void OnSwitchPage (NotebookPage page, uint n)
- {
- base.OnSwitchPage (page, n);
- if (!loadedPages.Contains (Page))
- OnPageLoadRequired ();
- }
-
- void OnPageLoadRequired ()
- {
- loadedPages.Add (Page);
- if (PageLoadRequired != null)
- PageLoadRequired (this, EventArgs.Empty);
- }
-
- public EventHandler PageLoadRequired;
- }
-
- class HeaderLabel: Widget
- {
- string text;
- Pango.Layout layout;
- int padding;
-
- public HeaderLabel ()
- {
- WidgetFlags |= WidgetFlags.NoWindow;
- layout = new Pango.Layout (this.PangoContext);
- }
-
- public string Markup {
- get { return text; }
- set {
- text = value;
- layout.SetMarkup (text);
- QueueDraw ();
- }
- }
-
- public int Padding {
- get { return padding; }
- set { padding = value; }
- }
-
- protected override bool OnExposeEvent (Gdk.EventExpose args)
- {
- Gdk.GC gc = new Gdk.GC (GdkWindow);
- gc.ClipRectangle = Allocation;
- GdkWindow.DrawLayout (gc, padding, padding, layout);
- return true;
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Gui/TestResultsPad.cs b/main/src/addins/NUnit/Gui/TestResultsPad.cs
deleted file mode 100644
index 5110f4de4d..0000000000
--- a/main/src/addins/NUnit/Gui/TestResultsPad.cs
+++ /dev/null
@@ -1,861 +0,0 @@
-//
-// TestResultsPad.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Text;
-using System.Collections;
-using System.Collections.Generic;
-using Gtk;
-using Gdk;
-
-using MonoDevelop.Core;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.NUnit.Commands;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Components.Docking;
-using MonoDevelop.Ide;
-using System.Text.RegularExpressions;
-using MonoDevelop.Components;
-using MonoDevelop.Ide.Commands;
-using MonoDevelop.Ide.Fonts;
-using MonoDevelop.NUnit.External;
-
-namespace MonoDevelop.NUnit
-{
- public class TestResultsPad: IPadContent, ITestProgressMonitor
- {
- NUnitService testService = NUnitService.Instance;
-
- IPadWindow window;
- VBox panel;
- HPaned book;
-
- Label infoLabel = new Label ();
- Label infoCurrent = new Label ();
- HBox labels;
-
- Label resultLabel = new Label ();
-
- ProgressBar progressBar = new ProgressBar ();
- MonoDevelop.Ide.Gui.Components.PadTreeView failuresTreeView;
- TreeStore failuresStore;
- TextView outputView;
- TextTag bold;
- Dictionary<UnitTest,int> outIters = new Dictionary<UnitTest,int> ();
- Widget outputViewScrolled;
- VSeparator infoSep;
- Gtk.TreeIter startMessageIter;
-
- Button buttonStop;
- Button buttonRun;
-
- ToggleButton buttonSuccess;
- ToggleButton buttonFailures;
- ToggleButton buttonIgnored;
- ToggleButton buttonInconclusive;
- ToggleButton buttonOutput;
-
- bool running;
- int testsToRun;
- int testsRun;
-
- UnitTestResult resultSummary;
-
- UnitTest rootTest;
- string configuration;
- ArrayList results = new ArrayList ();
-
- Exception error;
- string errorMessage;
-
- bool cancel;
-
- public class ResultRecord
- {
- public UnitTest Test;
- public UnitTestResult Result;
- }
-
- public TestResultsPad ()
- {
- testService.TestSuiteChanged += new EventHandler (OnTestSuiteChanged);
- IdeApp.Workspace.WorkspaceItemClosed += OnWorkspaceItemClosed;
-
- panel = new VBox ();
-
- // Results notebook
-
- book = new HPaned ();
- panel.PackStart (book, true, true, 0);
- panel.FocusChain = new Gtk.Widget [] { book };
-
- // Failures tree
- failuresTreeView = new MonoDevelop.Ide.Gui.Components.PadTreeView ();
- failuresTreeView.HeadersVisible = false;
- failuresStore = new TreeStore (typeof(Xwt.Drawing.Image), typeof(string), typeof(object), typeof(string), typeof(int), typeof(int));
- var pr = new CellRendererImage ();
- CellRendererText tr = new CellRendererText ();
- TreeViewColumn col = new TreeViewColumn ();
- col.PackStart (pr, false);
- col.AddAttribute (pr, "image", 0);
- col.PackStart (tr, false);
- col.AddAttribute (tr, "markup", 1);
- failuresTreeView.AppendColumn (col);
- failuresTreeView.Model = failuresStore;
-
- var sw = new MonoDevelop.Components.CompactScrolledWindow ();
- sw.ShadowType = ShadowType.None;
- sw.Add (failuresTreeView);
- book.Pack1 (sw, true, true);
-
- outputView = new MonoDevelop.Ide.Gui.Components.LogView.LogTextView ();
- outputView.ModifyFont (FontService.MonospaceFont);
- outputView.Editable = false;
- bold = new TextTag ("bold");
- bold.Weight = Pango.Weight.Bold;
- outputView.Buffer.TagTable.Add (bold);
- sw = new MonoDevelop.Components.CompactScrolledWindow ();
- sw.ShadowType = ShadowType.None;
- sw.Add (outputView);
- book.Pack2 (sw, true, true);
- outputViewScrolled = sw;
-
- failuresTreeView.RowActivated += OnRowActivated;
- failuresTreeView.Selection.Changed += OnRowSelected;
- failuresTreeView.DoPopupMenu = delegate (EventButton evt) {
- IdeApp.CommandService.ShowContextMenu (failuresTreeView, evt,
- "/MonoDevelop/NUnit/ContextMenu/TestResultsPad");
- };
-
- Control.ShowAll ();
-
- outputViewScrolled.Hide ();
- }
-
- void IPadContent.Initialize (IPadWindow window)
- {
- this.window = window;
-
- DockItemToolbar toolbar = window.GetToolbar (PositionType.Top);
-
- buttonSuccess = new ToggleButton ();
- buttonSuccess.Label = GettextCatalog.GetString ("Successful Tests");
- buttonSuccess.Active = false;
- buttonSuccess.Image = new ImageView (TestStatusIcon.Success);
- buttonSuccess.Image.Show ();
- buttonSuccess.Toggled += new EventHandler (OnShowSuccessfulToggled);
- buttonSuccess.TooltipText = GettextCatalog.GetString ("Show Successful Tests");
- toolbar.Add (buttonSuccess);
-
- buttonInconclusive = new ToggleButton ();
- buttonInconclusive.Label = GettextCatalog.GetString ("Inconclusive Tests");
- buttonInconclusive.Active = true;
- buttonInconclusive.Image = new ImageView (TestStatusIcon.Inconclusive);
- buttonInconclusive.Image.Show ();
- buttonInconclusive.Toggled += new EventHandler (OnShowInconclusiveToggled);
- buttonInconclusive.TooltipText = GettextCatalog.GetString ("Show Inconclusive Tests");
- toolbar.Add (buttonInconclusive);
-
- buttonFailures = new ToggleButton ();
- buttonFailures.Label = GettextCatalog.GetString ("Failed Tests");
- buttonFailures.Active = true;
- buttonFailures.Image = new ImageView (TestStatusIcon.Failure);
- buttonFailures.Image.Show ();
- buttonFailures.Toggled += new EventHandler (OnShowFailuresToggled);
- buttonFailures.TooltipText = GettextCatalog.GetString ("Show Failed Tests");
- toolbar.Add (buttonFailures);
-
- buttonIgnored = new ToggleButton ();
- buttonIgnored.Label = GettextCatalog.GetString ("Ignored Tests");
- buttonIgnored.Active = true;
- buttonIgnored.Image = new ImageView (TestStatusIcon.NotRun);
- buttonIgnored.Image.Show ();
- buttonIgnored.Toggled += new EventHandler (OnShowIgnoredToggled);
- buttonIgnored.TooltipText = GettextCatalog.GetString ("Show Ignored Tests");
- toolbar.Add (buttonIgnored);
-
- buttonOutput = new ToggleButton ();
- buttonOutput.Label = GettextCatalog.GetString ("Output");
- buttonOutput.Active = false;
- buttonOutput.Image = ImageService.GetImage (MonoDevelop.Ide.Gui.Stock.OutputIcon, IconSize.Menu);
- buttonOutput.Image.Show ();
- buttonOutput.Toggled += new EventHandler (OnShowOutputToggled);
- buttonOutput.TooltipText = GettextCatalog.GetString ("Show Output");
- toolbar.Add (buttonOutput);
-
- toolbar.Add (new SeparatorToolItem ());
-
- buttonRun = new Button ();
- buttonRun.Label = GettextCatalog.GetString ("Rerun Tests");
- buttonRun.Image = new ImageView (ImageService.GetIcon ("nunit-run", IconSize.Menu));
- buttonRun.Image.Show ();
- buttonRun.Sensitive = false;
- toolbar.Add (buttonRun);
-
- buttonStop = new Button (new Gtk.Image (Ide.Gui.Stock.Stop, Gtk.IconSize.Menu));
- toolbar.Add (buttonStop);
- toolbar.ShowAll ();
-
- buttonStop.Clicked += new EventHandler (OnStopClicked);
- buttonRun.Clicked += new EventHandler (OnRunClicked);
-
- // Run panel
-
- DockItemToolbar runPanel = window.GetToolbar (PositionType.Bottom);
-
- infoSep = new VSeparator ();
-
- resultLabel.UseMarkup = true;
- infoCurrent.Ellipsize = Pango.EllipsizeMode.Start;
- infoCurrent.WidthRequest = 0;
- runPanel.Add (resultLabel);
- runPanel.Add (progressBar);
- runPanel.Add (infoCurrent, true, 10);
-
- labels = new HBox (false, 10);
-
- infoLabel.UseMarkup = true;
-
- labels.PackStart (infoLabel, true, false, 0);
-
- runPanel.Add (new Gtk.Label (), true);
- runPanel.Add (labels);
- runPanel.Add (infoSep, false, 10);
-
- progressBar.HeightRequest = infoLabel.SizeRequest ().Height;
- runPanel.ShowAll ();
- progressBar.Hide ();
- infoSep.Hide ();
- resultSummary = new UnitTestResult ();
- UpdateCounters ();
- }
-
- public void Dispose ()
- {
- }
-
- public void OnTestSuiteChanged (object sender, EventArgs e)
- {
- if (rootTest != null) {
- rootTest = testService.SearchTest (rootTest.FullName);
- if (rootTest == null)
- buttonRun.Sensitive = false;
- }
- }
-
- void OnWorkspaceItemClosed (object sender, EventArgs e)
- {
- ClearResults ();
- }
-
- void ClearResults ()
- {
- if (failuresTreeView.IsRealized)
- failuresTreeView.ScrollToPoint (0, 0);
-
- results.Clear ();
-
- error = null;
- errorMessage = null;
-
- failuresStore.Clear ();
- outputView.Buffer.Clear ();
- outIters.Clear ();
- progressBar.Fraction = 0;
- progressBar.Text = "";
- testsRun = 0;
- resultSummary = new UnitTestResult ();
- resultLabel.Markup = "";
- resultLabel.Hide ();
- labels.Show ();
- UpdateCounters ();
- }
-
- bool Running {
- get { return running; }
- set {
- running = value;
- window.IsWorking = value;
- }
- }
-
- public Gtk.Widget Control {
- get {
- return panel;
- }
- }
-
- public void RedrawContent ()
- {
- }
-
- string GetResultsMarkup ()
- {
- return string.Format (GettextCatalog.GetString ("<b>Passed</b>: {0} <b>Failed</b>: {1} <b>Errors</b>: {2} <b>Inconclusive</b>: {3} <b>Invalid</b>: {4} <b>Ignored</b>: {5} <b>Skipped</b>: {6} <b>Time</b>: {7}"),
- resultSummary.Passed, resultSummary.Failures, resultSummary.Errors, resultSummary.Inconclusive, resultSummary.NotRunnable, resultSummary.Ignored, resultSummary.Skipped, resultSummary.Time);
- }
- void UpdateCounters ()
- {
- infoLabel.Markup = GetResultsMarkup ();
- }
-
- public void InitializeTestRun (UnitTest test)
- {
- rootTest = test;
- results.Clear ();
-
- testsToRun = test.CountTestCases ();
- error = null;
- errorMessage = null;
-
- progressBar.Fraction = 0;
- progressBar.Text = "";
- progressBar.Text = "0 / " + testsToRun;
- testsRun = 0;
- resultSummary = new UnitTestResult ();
- UpdateCounters ();
-
- infoSep.Show ();
- infoCurrent.Show ();
- progressBar.Show ();
- resultLabel.Hide ();
- labels.Show ();
- buttonStop.Sensitive = true;
- buttonRun.Sensitive = false;
-
- if (failuresTreeView.IsRealized)
- failuresTreeView.ScrollToPoint (0, 0);
-
- failuresStore.Clear ();
- outputView.Buffer.Clear ();
- outIters.Clear ();
- cancel = false;
- Running = true;
-
- configuration = IdeApp.Workspace.ActiveConfigurationId;
-
- AddStartMessage ();
- }
-
- public void AddStartMessage (bool isRunning = true)
- {
- if (rootTest != null) {
- var infoIcon = ImageService.GetIcon (MonoDevelop.Ide.Gui.Stock.Information, Gtk.IconSize.Menu);
- string msg = string.Format (isRunning ? GettextCatalog.GetString ("Running tests for <b>{0}</b> configuration <b>{1}</b>") : GettextCatalog.GetString ("Test results for <b>{0}</b> configuration <b>{1}</b>"), rootTest.Name, configuration);
- startMessageIter = failuresStore.AppendValues (infoIcon, msg, rootTest, null, 0);
- } else {
- startMessageIter = Gtk.TreeIter.Zero;
- }
- }
-
- public void ReportRuntimeError (string message, Exception exception)
- {
- error = exception;
- errorMessage = message;
- AddErrorMessage ();
- }
- const int ErrorMessage = 1;
- const int StackTrace = 2;
-
- public void AddErrorMessage ()
- {
- string msg;
- if (error is RemoteUnhandledException)
- msg = Escape (errorMessage);
- else {
- msg = GettextCatalog.GetString ("Internal error");
- if (errorMessage != null)
- msg += ": " + Escape (errorMessage);
- }
-
- var stock = ImageService.GetIcon (Ide.Gui.Stock.Error, Gtk.IconSize.Menu);
- TreeIter testRow = failuresStore.AppendValues (stock, msg, null, null, 0);
- string name = error is RemoteUnhandledException ? ((RemoteUnhandledException)error).RemoteExceptionName : error.GetType ().Name;
- failuresStore.AppendValues (testRow, null, Escape (name + ": " + error.Message), null);
- TreeIter row = failuresStore.AppendValues (testRow, null, GettextCatalog.GetString ("Stack Trace"), null, null, 0);
- AddStackTrace (row, error.StackTrace, null);
- }
-
- readonly static Regex stackTraceLineRegex = new Regex (@".*\s(?<file>.*)\:\D*\s?(?<line>\d+)", RegexOptions.Compiled);
-
- public static bool TryParseLocationFromStackTrace (string stackTraceLine, out string fileName, out int lineNumber)
- {
- var match = stackTraceLineRegex.Match (stackTraceLine);
-
- if (!match.Success) {
- fileName = null;
- lineNumber = -1;
- return false;
- }
- try {
- fileName = match.Groups ["file"].Value;
- lineNumber = int.Parse (match.Groups ["line"].Value);
- } catch (Exception) {
- fileName = null;
- lineNumber = -1;
- return false;
- }
- return true;
- }
-
- void AddStackTrace (TreeIter row, string stackTrace, UnitTest test)
- {
- string[] stackLines = stackTrace.Replace ("\r", "").Split ('\n');
- foreach (string line in stackLines) {
- string fileName;
- int lineNumber;
- TryParseLocationFromStackTrace (line, out fileName, out lineNumber);
- failuresStore.AppendValues (row, null, Escape (line), test, fileName, lineNumber, StackTrace);
- }
- }
-
- public void FinishTestRun ()
- {
- if (!Gtk.TreeIter.Zero.Equals (startMessageIter)) {
- string msg = string.Format (GettextCatalog.GetString ("Test results for <b>{0}</b> configuration <b>{1}</b>"), rootTest != null ? rootTest.Name : "null", configuration);
- failuresStore.SetValue (startMessageIter, 1, msg);
- startMessageIter = Gtk.TreeIter.Zero;
- }
- infoCurrent.Text = "";
- progressBar.Fraction = 1;
- progressBar.Text = "";
-
- infoSep.Hide ();
- infoCurrent.Hide ();
- progressBar.Hide ();
- resultLabel.Show ();
- labels.Hide ();
- buttonStop.Sensitive = false;
- buttonRun.Sensitive = true;
-
- resultLabel.Markup = GetResultsMarkup ();
-
- Running = false;
- }
-
- void OnStopClicked (object sender, EventArgs args)
- {
- if (running)
- Cancel ();
- }
-
- void OnRunClicked (object sender, EventArgs args)
- {
- if (rootTest == null)
- return;
- NUnitService.Instance.RunTest (rootTest, null);
- }
-
- void OnRowActivated (object s, EventArgs a)
- {
- Gtk.TreeIter iter;
- if (failuresTreeView.Selection.GetSelected (out iter)) {
- string file = (string)failuresStore.GetValue (iter, 3);
- int line = (int)failuresStore.GetValue (iter, 4);
- try {
- if (file != null && File.Exists (file)) {
- IdeApp.Workbench.OpenDocument (file, line, -1);
- return;
- }
- } catch (Exception) {
- }
- }
- OnShowTest ();
- }
-
- void OnRowSelected (object s, EventArgs a)
- {
- UnitTest test = GetSelectedTest ();
- if (test != null) {
- int offset;
- if (outIters.TryGetValue (test, out offset)) {
- TextIter it = outputView.Buffer.GetIterAtOffset (offset);
- outputView.Buffer.MoveMark (outputView.Buffer.InsertMark, it);
- outputView.Buffer.MoveMark (outputView.Buffer.SelectionBound, it);
- outputView.ScrollToMark (outputView.Buffer.InsertMark, 0.0, true, 0.0, 0.0);
- }
- }
- }
-
- [CommandHandler (EditCommands.Copy)]
- protected void OnCopy ()
- {
- UnitTest test = GetSelectedTest ();
- if (test != null) {
- var last = test.GetLastResult ();
- if (last == null)
- return;
-
- Gtk.TreeModel foo;
- Gtk.TreeIter iter;
- if (!failuresTreeView.Selection.GetSelected (out foo, out iter))
- return;
-
- int type = (int)failuresStore.GetValue (iter, 5);
-
- var clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
- switch (type) {
- case ErrorMessage:
- clipboard.Text = last.Message;
- break;
- case StackTrace:
- clipboard.Text = last.StackTrace;
- break;
- default:
- clipboard.Text = last.Message + Environment.NewLine + "Stack trace:" + Environment.NewLine + last.StackTrace;
- break;
- }
- }
- }
-
- [CommandUpdateHandler (EditCommands.Copy)]
- protected void OnUpdateCopy (CommandInfo info)
- {
- UnitTest test = GetSelectedTest ();
- if (test != null) {
- var last = test.GetLastResult ();
-
- Gtk.TreeModel foo;
- Gtk.TreeIter iter;
- if (!failuresTreeView.Selection.GetSelected (out foo, out iter)) {
- info.Enabled = false;
- return;
- }
-
- int type = (int)failuresStore.GetValue (iter, 5);
- switch (type) {
- case ErrorMessage:
- info.Enabled = !string.IsNullOrEmpty (last.Message);
- return;
- case StackTrace:
- default:
- info.Enabled = !string.IsNullOrEmpty (last.StackTrace);
- return;
- }
- }
- info.Enabled = false;
- }
-
- [CommandHandler (TestCommands.SelectTestInTree)]
- protected void OnSelectTestInTree ()
- {
- Pad pad = IdeApp.Workbench.GetPad<TestPad> ();
- pad.BringToFront ();
- TestPad content = (TestPad)pad.Content;
- content.SelectTest (GetSelectedTest ());
- }
-
- [CommandUpdateHandler (TestCommands.SelectTestInTree)]
- protected void OnUpdateSelectTestInTree (CommandInfo info)
- {
- UnitTest test = GetSelectedTest ();
- info.Enabled = test != null;
- }
-
- [CommandHandler (TestCommands.GoToFailure)]
- protected void OnShowTest ()
- {
- UnitTest test = GetSelectedTest ();
- if (test == null)
- return;
- SourceCodeLocation loc = null;
- UnitTestResult res = test.GetLastResult ();
- if (res != null && res.IsFailure)
- loc = res.GetFailureLocation ();
- if (loc == null)
- loc = test.SourceCodeLocation;
- if (loc != null)
- IdeApp.Workbench.OpenDocument (loc.FileName, loc.Line, loc.Column);
- }
-
- [CommandHandler (TestCommands.ShowTestCode)]
- protected void OnShowTestCode ()
- {
- UnitTest test = GetSelectedTest ();
- if (test == null)
- return;
- SourceCodeLocation loc = test.SourceCodeLocation;
- if (loc != null)
- IdeApp.Workbench.OpenDocument (loc.FileName, loc.Line, loc.Column);
- }
-
- [CommandHandler (TestCommands.RerunTest)]
- protected void OnRerunTest ()
- {
- UnitTest test = GetSelectedTest ();
- if (test == null)
- return;
- NUnitService.Instance.RunTest (test, null);
- }
-
- [CommandUpdateHandler (TestCommands.ShowTestCode)]
- [CommandUpdateHandler (TestCommands.GoToFailure)]
- [CommandUpdateHandler (TestCommands.RerunTest)]
- protected void OnUpdateRunTest (CommandInfo info)
- {
- UnitTest test = GetSelectedTest ();
- info.Enabled = test != null && test.SourceCodeLocation != null;
- }
-
- UnitTest GetSelectedTest ()
- {
- Gtk.TreeModel foo;
- Gtk.TreeIter iter;
- if (!failuresTreeView.Selection.GetSelected (out foo, out iter))
- return null;
-
- UnitTest t = (UnitTest)failuresStore.GetValue (iter, 2);
- return t;
- }
-
- void OnShowSuccessfulToggled (object sender, EventArgs args)
- {
- RefreshList ();
- }
-
- void OnShowFailuresToggled (object sender, EventArgs args)
- {
- RefreshList ();
- }
-
- void OnShowInconclusiveToggled (object sender, EventArgs args)
- {
- RefreshList ();
- }
-
- void OnShowIgnoredToggled (object sender, EventArgs args)
- {
- RefreshList ();
- }
-
- void OnShowOutputToggled (object sender, EventArgs args)
- {
- outputViewScrolled.Visible = buttonOutput.Active;
- }
-
- void RefreshList ()
- {
- if (failuresTreeView.IsRealized)
- failuresTreeView.ScrollToPoint (0, 0);
-
- failuresStore.Clear ();
- outputView.Buffer.Clear ();
- outIters.Clear ();
- AddStartMessage (running);
-
- foreach (ResultRecord res in results) {
- ShowTestResult (res.Test, res.Result);
- }
-
- if (error != null)
- AddErrorMessage ();
- }
-
- void ShowTestResult (UnitTest test, UnitTestResult result)
- {
- if (result.IsSuccess) {
- if (!buttonSuccess.Active)
- return;
- TreeIter testRow = failuresStore.AppendValues (TestStatusIcon.Success, Escape (test.FullName), test);
- failuresTreeView.ScrollToCell (failuresStore.GetPath (testRow), null, false, 0, 0);
- }
- if (result.IsFailure) {
- if (!buttonFailures.Active)
- return;
- string file = test.SourceCodeLocation != null ? test.SourceCodeLocation.FileName + ":" + test.SourceCodeLocation.Line : null;
- TreeIter testRow = failuresStore.AppendValues (TestStatusIcon.Failure, Escape (test.FullName), test, file);
- bool hasMessage = !string.IsNullOrEmpty (result.Message);
-
- if (hasMessage)
- failuresStore.AppendValues (testRow, null, "<span font='" + FontService.MonospaceFontName + "'>"+Escape (result.Message) + "</span>", test, null, 0, ErrorMessage);
- if (!string.IsNullOrEmpty (result.StackTrace)) {
- TreeIter row = testRow;
- if (hasMessage)
- row = failuresStore.AppendValues (testRow, null, GettextCatalog.GetString ("Stack Trace"), test, null, 0, StackTrace);
- AddStackTrace (row, result.StackTrace, test);
- }
- failuresTreeView.ScrollToCell (failuresStore.GetPath (testRow), null, false, 0, 0);
- }
- if (result.IsNotRun) {
- if (!buttonIgnored.Active)
- return;
- TreeIter testRow = failuresStore.AppendValues (TestStatusIcon.NotRun, Escape (test.FullName), test);
- if (result.Message != null)
- failuresStore.AppendValues (testRow, null, Escape (result.Message), test);
- failuresTreeView.ScrollToCell (failuresStore.GetPath (testRow), null, false, 0, 0);
- }
- if (result.IsInconclusive) {
- if (!buttonInconclusive.Active)
- return;
- TreeIter testRow = failuresStore.AppendValues (TestStatusIcon.Inconclusive, Escape (test.FullName), test);
- if (result.Message != null)
- failuresStore.AppendValues (testRow, null, Escape (result.Message), test);
- failuresTreeView.ScrollToCell (failuresStore.GetPath (testRow), null, false, 0, 0);
- }
-
- string msg = GettextCatalog.GetString ("Running {0} ...", test.FullName);
- TextIter it = outputView.Buffer.EndIter;
- outIters [test] = it.Offset;
- outputView.Buffer.InsertWithTags (ref it, msg, bold);
- outputView.Buffer.Insert (ref it, "\n");
- if (result.ConsoleOutput != null)
- outputView.Buffer.Insert (ref it, result.ConsoleOutput);
- if (result.ConsoleError != null)
- outputView.Buffer.Insert (ref it, result.ConsoleError);
- outputView.ScrollMarkOnscreen (outputView.Buffer.InsertMark);
- }
-
- void ITestProgressMonitor.WriteGlobalLog (string message)
- {
- TextIter it = outputView.Buffer.EndIter;
- outputView.Buffer.Insert (ref it, message);
- outputView.ScrollMarkOnscreen (outputView.Buffer.InsertMark);
- }
-
- string Escape (string s)
- {
- return GLib.Markup.EscapeText (s);
- }
-
- void ITestProgressMonitor.EndTest (UnitTest test, UnitTestResult result)
- {
- if (test is UnitTestGroup)
- return;
-
- testsRun++;
- ResultRecord rec = new ResultRecord ();
- rec.Test = test;
- rec.Result = result;
-
- resultSummary.Add (result);
- results.Add (rec);
-
- ShowTestResult (test, result);
-
- UpdateCounters ();
-
- double frac;
- if (testsToRun != 0)
- frac = ((double)testsRun / (double)testsToRun);
- else
- frac = 1;
-
- frac = Math.Min (1, Math.Max (0, frac));
-
- progressBar.Fraction = frac;
- progressBar.Text = testsRun + " / " + testsToRun;
- }
-
- void ITestProgressMonitor.BeginTest (UnitTest test)
- {
- infoCurrent.Text = GettextCatalog.GetString ("Running ") + test.FullName;
- infoCurrent.Xalign = 0;
- }
-
- public void Cancel ()
- {
- if (cancel)
- return;
- cancel = true;
- Gtk.Application.Invoke (delegate {
- failuresStore.AppendValues (TestStatusIcon.Failure, GettextCatalog.GetString ("Test execution cancelled."), null);
- });
- if (CancelRequested != null)
- CancelRequested ();
- }
-
- bool ITestProgressMonitor.IsCancelRequested {
- get { return cancel; }
- }
-
- public event TestHandler CancelRequested;
- }
-
- class TestMonitor: ITestProgressMonitor
- {
- ITestProgressMonitor monitor;
- TestResultsPad pad;
-
- public TestMonitor (TestResultsPad pad)
- {
- this.pad = pad;
- this.monitor = pad;
- }
- public void InitializeTestRun (UnitTest test)
- {
- DispatchService.GuiDispatch (delegate {
- pad.InitializeTestRun (test);
- });
- }
- public void FinishTestRun ()
- {
- DispatchService.GuiDispatch (delegate {
- pad.FinishTestRun ();
- });
- }
- public void Cancel ()
- {
- DispatchService.GuiDispatch (delegate {
- pad.Cancel ();
- });
- }
- public void BeginTest (UnitTest test)
- {
- DispatchService.GuiDispatch (delegate {
- monitor.BeginTest (test);
- });
- }
- public void EndTest (UnitTest test, UnitTestResult result)
- {
- DispatchService.GuiDispatch (delegate {
- monitor.EndTest (test, result);
- });
- }
- public void ReportRuntimeError (string message, Exception exception)
- {
- DispatchService.GuiDispatch (delegate {
- monitor.ReportRuntimeError (message, exception);
- });
- }
- public void WriteGlobalLog (string message)
- {
- DispatchService.GuiDispatch (delegate {
- monitor.WriteGlobalLog (message);
- });
- }
- public bool IsCancelRequested {
- get { return monitor.IsCancelRequested; }
- }
- public event TestHandler CancelRequested {
- add { monitor.CancelRequested += value; }
- remove { monitor.CancelRequested -= value; }
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Gui/TestStatusIcon.cs b/main/src/addins/NUnit/Gui/TestStatusIcon.cs
deleted file mode 100644
index 4dbb85f498..0000000000
--- a/main/src/addins/NUnit/Gui/TestStatusIcon.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// CircleImage.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using Gdk;
-using MonoDevelop.Core;
-using MonoDevelop.Ide;
-
-namespace MonoDevelop.NUnit
-{
- static class TestStatusIcon
- {
- public static readonly Xwt.Drawing.Image Running;
- public static readonly Xwt.Drawing.Image None;
- public static readonly Xwt.Drawing.Image NotRun;
- public static readonly Xwt.Drawing.Image Loading;
-
- public static readonly Xwt.Drawing.Image Failure;
- public static readonly Xwt.Drawing.Image Success;
- public static readonly Xwt.Drawing.Image SuccessAndFailure;
- public static readonly Xwt.Drawing.Image Inconclusive;
-
- public static readonly Xwt.Drawing.Image OldFailure;
- public static readonly Xwt.Drawing.Image OldSuccess;
- public static readonly Xwt.Drawing.Image OldSuccessAndFailure;
- public static readonly Xwt.Drawing.Image OldInconclusive;
-
- static TestStatusIcon ()
- {
- try {
- Running = Xwt.Drawing.Image.FromResource ("unit-running-16.png");
- Failure = Xwt.Drawing.Image.FromResource ("unit-failed-16.png");
- None = Xwt.Drawing.Image.FromResource ("unit-not-yet-run-16.png");
- NotRun = Xwt.Drawing.Image.FromResource ("unit-skipped-16.png");
- Success = Xwt.Drawing.Image.FromResource ("unit-success-16.png");
- SuccessAndFailure = Xwt.Drawing.Image.FromResource ("unit-mixed-results-16.png");
- Loading = Xwt.Drawing.Image.FromResource ("unit-loading-16.png");
- Inconclusive = Xwt.Drawing.Image.FromResource ("unit-inconclusive-16.png");
- OldFailure = Failure.WithAlpha (0.4);
- OldSuccess = Success.WithAlpha (0.4);
- OldSuccessAndFailure = SuccessAndFailure.WithAlpha (0.4);
- OldInconclusive = Inconclusive.WithAlpha (0.4);
- } catch (Exception e) {
- LoggingService.LogError ("Error while loading icons.", e);
- }
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Gui/UnitTestOptionsDialog.cs b/main/src/addins/NUnit/Gui/UnitTestOptionsDialog.cs
deleted file mode 100644
index 8ab7f6c393..0000000000
--- a/main/src/addins/NUnit/Gui/UnitTestOptionsDialog.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// UnitTestOptionsDialog.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-
-using Mono.Addins;
-using MonoDevelop.Core;
-using Gtk;
-using MonoDevelop.Ide.Gui.Dialogs;
-using MonoDevelop.Ide.Extensions;
-
-namespace MonoDevelop.NUnit {
-
- public class UnitTestOptionsDialog : OptionsDialog
- {
- ExtensionNode configurationNode;
- UnitTest test;
-
- public UnitTestOptionsDialog (Gtk.Window parent, Properties properties) : base (parent, properties, "/MonoDevelop/NUnit/UnitTestOptions/GeneralOptions", false)
- {
- this.Title = GettextCatalog.GetString ("Unit Test Options");
-
- test = properties.Get<UnitTest>("UnitTest");
- configurationNode = AddinManager.GetExtensionNode("/MonoDevelop/NUnit/UnitTestOptions/ConfigurationOptions");
-
- TreeIter iter;
- if (store.GetIterFirst (out iter)) {
- OptionsDialogSection section = store.GetValue (iter, 0) as OptionsDialogSection;
-
- if (section != null && section.Id == "Configurations") {
- FillConfigurations (iter);
- }
- }
- ExpandCategories ();
- if (firstSection != null)
- ShowPage (firstSection);
- }
- protected override void OnResponse (Gtk.ResponseType response_id)
- {
- base.OnResponse (response_id);
- Destroy ();
- }
-
- OptionsDialogSection firstSection = null;
- void FillConfigurations (Gtk.TreeIter configIter)
- {
- foreach (string name in test.GetConfigurations ()) {
- Properties configNodeProperties = new Properties();
- configNodeProperties.Set ("UnitTest", test);
- configNodeProperties.Set ("Config", name);
- foreach (OptionsDialogSection section in configurationNode.ChildNodes) {
- OptionsDialogSection s = (OptionsDialogSection)section.Clone ();
- if (firstSection == null)
- firstSection = s;
- s.Label = StringParserService.Parse (section.Label, new string[,] { { "Configuration", name } });
- AddSection (configIter, s, configNodeProperties);
- }
- }
- }
- }
-}
diff --git a/main/src/addins/NUnit/Gui/icons/pad-unit-test-16.png b/main/src/addins/NUnit/Gui/icons/pad-unit-test-16.png
deleted file mode 100644
index 1c0ac5a7c5..0000000000
--- a/main/src/addins/NUnit/Gui/icons/pad-unit-test-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/pad-unit-test-16@2x.png b/main/src/addins/NUnit/Gui/icons/pad-unit-test-16@2x.png
deleted file mode 100644
index 973f82c591..0000000000
--- a/main/src/addins/NUnit/Gui/icons/pad-unit-test-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/pad-unit-test-results-16.png b/main/src/addins/NUnit/Gui/icons/pad-unit-test-results-16.png
deleted file mode 100644
index 4be65aa981..0000000000
--- a/main/src/addins/NUnit/Gui/icons/pad-unit-test-results-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/pad-unit-test-results-16@2x.png b/main/src/addins/NUnit/Gui/icons/pad-unit-test-results-16@2x.png
deleted file mode 100644
index a4aa276ed3..0000000000
--- a/main/src/addins/NUnit/Gui/icons/pad-unit-test-results-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/project-nunit-overlay-32.png b/main/src/addins/NUnit/Gui/icons/project-nunit-overlay-32.png
deleted file mode 100644
index daa6d0d2a5..0000000000
--- a/main/src/addins/NUnit/Gui/icons/project-nunit-overlay-32.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/project-nunit-overlay-32@2x.png b/main/src/addins/NUnit/Gui/icons/project-nunit-overlay-32@2x.png
deleted file mode 100644
index 664f413a7a..0000000000
--- a/main/src/addins/NUnit/Gui/icons/project-nunit-overlay-32@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/unit-failed-16.png b/main/src/addins/NUnit/Gui/icons/unit-failed-16.png
deleted file mode 100644
index ab1367642d..0000000000
--- a/main/src/addins/NUnit/Gui/icons/unit-failed-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/unit-failed-16@2x.png b/main/src/addins/NUnit/Gui/icons/unit-failed-16@2x.png
deleted file mode 100644
index fc9fa4445b..0000000000
--- a/main/src/addins/NUnit/Gui/icons/unit-failed-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/unit-inconclusive-16.png b/main/src/addins/NUnit/Gui/icons/unit-inconclusive-16.png
deleted file mode 100644
index 0b58080a9b..0000000000
--- a/main/src/addins/NUnit/Gui/icons/unit-inconclusive-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/unit-inconclusive-16@2x.png b/main/src/addins/NUnit/Gui/icons/unit-inconclusive-16@2x.png
deleted file mode 100644
index 970c207555..0000000000
--- a/main/src/addins/NUnit/Gui/icons/unit-inconclusive-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/unit-loading-16.png b/main/src/addins/NUnit/Gui/icons/unit-loading-16.png
deleted file mode 100644
index 7863245aba..0000000000
--- a/main/src/addins/NUnit/Gui/icons/unit-loading-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/unit-loading-16@2x.png b/main/src/addins/NUnit/Gui/icons/unit-loading-16@2x.png
deleted file mode 100644
index 5c7b89a6b2..0000000000
--- a/main/src/addins/NUnit/Gui/icons/unit-loading-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/unit-mixed-results-16.png b/main/src/addins/NUnit/Gui/icons/unit-mixed-results-16.png
deleted file mode 100644
index ef419bb561..0000000000
--- a/main/src/addins/NUnit/Gui/icons/unit-mixed-results-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/unit-mixed-results-16@2x.png b/main/src/addins/NUnit/Gui/icons/unit-mixed-results-16@2x.png
deleted file mode 100644
index 03afb04a77..0000000000
--- a/main/src/addins/NUnit/Gui/icons/unit-mixed-results-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/unit-not-yet-run-16.png b/main/src/addins/NUnit/Gui/icons/unit-not-yet-run-16.png
deleted file mode 100644
index 6c3109b84c..0000000000
--- a/main/src/addins/NUnit/Gui/icons/unit-not-yet-run-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/unit-not-yet-run-16@2x.png b/main/src/addins/NUnit/Gui/icons/unit-not-yet-run-16@2x.png
deleted file mode 100644
index e9c6f0085d..0000000000
--- a/main/src/addins/NUnit/Gui/icons/unit-not-yet-run-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/unit-run-16.png b/main/src/addins/NUnit/Gui/icons/unit-run-16.png
deleted file mode 100644
index 6f911a1600..0000000000
--- a/main/src/addins/NUnit/Gui/icons/unit-run-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/unit-run-16@2x.png b/main/src/addins/NUnit/Gui/icons/unit-run-16@2x.png
deleted file mode 100644
index 59ea4fa20a..0000000000
--- a/main/src/addins/NUnit/Gui/icons/unit-run-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/unit-running-16.png b/main/src/addins/NUnit/Gui/icons/unit-running-16.png
deleted file mode 100644
index 587de48d85..0000000000
--- a/main/src/addins/NUnit/Gui/icons/unit-running-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/unit-running-16@2x.png b/main/src/addins/NUnit/Gui/icons/unit-running-16@2x.png
deleted file mode 100644
index e61f579a0c..0000000000
--- a/main/src/addins/NUnit/Gui/icons/unit-running-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/unit-skipped-16.png b/main/src/addins/NUnit/Gui/icons/unit-skipped-16.png
deleted file mode 100644
index 7b245ca9ee..0000000000
--- a/main/src/addins/NUnit/Gui/icons/unit-skipped-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/unit-skipped-16@2x.png b/main/src/addins/NUnit/Gui/icons/unit-skipped-16@2x.png
deleted file mode 100644
index 12500e3c5c..0000000000
--- a/main/src/addins/NUnit/Gui/icons/unit-skipped-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/unit-success-16.png b/main/src/addins/NUnit/Gui/icons/unit-success-16.png
deleted file mode 100644
index b167c97951..0000000000
--- a/main/src/addins/NUnit/Gui/icons/unit-success-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Gui/icons/unit-success-16@2x.png b/main/src/addins/NUnit/Gui/icons/unit-success-16@2x.png
deleted file mode 100644
index 7abbc8ec46..0000000000
--- a/main/src/addins/NUnit/Gui/icons/unit-success-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/Makefile.am b/main/src/addins/NUnit/Makefile.am
deleted file mode 100644
index 3ae131ae68..0000000000
--- a/main/src/addins/NUnit/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-SUBDIRS = NUnitRunner .
-
-include $(top_srcdir)/xbuild.include
diff --git a/main/src/addins/NUnit/MonoDevelop.NUnit.csproj b/main/src/addins/NUnit/MonoDevelop.NUnit.csproj
deleted file mode 100644
index 40f784226e..0000000000
--- a/main/src/addins/NUnit/MonoDevelop.NUnit.csproj
+++ /dev/null
@@ -1,278 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{A7A4246D-CEC4-42DF-A3C1-C31B9F51C4EC}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AssemblyName>MonoDevelop.NUnit</AssemblyName>
- <RootNamespace>MonoDevelop.NUnit</RootNamespace>
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>True</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>False</Optimize>
- <OutputPath>..\..\..\build\AddIns\NUnit\</OutputPath>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>3</WarningLevel>
- <Execution>
- <Execution clr-version="Net_2_0" />
- </Execution>
- <DefineConstants>DEBUG</DefineConstants>
- <NoWarn>1591;1573</NoWarn>
- <DocumentationFile>..\..\..\build\AddIns\NUnit\MonoDevelop.NUnit.xml</DocumentationFile>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>True</Optimize>
- <OutputPath>..\..\..\build\AddIns\NUnit\</OutputPath>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>3</WarningLevel>
- <Execution>
- <Execution clr-version="Net_2_0" />
- </Execution>
- <DebugSymbols>true</DebugSymbols>
- <NoWarn>1591;1573</NoWarn>
- <DocumentationFile>..\..\..\build\AddIns\NUnit\MonoDevelop.NUnit.xml</DocumentationFile>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Xml" />
- <Reference Include="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
- <SpecificVersion>False</SpecificVersion>
- </Reference>
- <Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
- <SpecificVersion>False</SpecificVersion>
- </Reference>
- <Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
- <SpecificVersion>False</SpecificVersion>
- </Reference>
- <Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
- <SpecificVersion>False</SpecificVersion>
- </Reference>
- <Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
- <SpecificVersion>False</SpecificVersion>
- </Reference>
- <Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
- <SpecificVersion>False</SpecificVersion>
- </Reference>
- <Reference Include="Mono.Posix" />
- <Reference Include="Mono.Cairo" />
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Core" />
- <Reference Include="nunit.framework">
- <HintPath>..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
- </Reference>
- <Reference Include="nunit.core">
- <HintPath>..\..\..\packages\NUnit.Runners.2.6.4\tools\lib\nunit.core.dll</HintPath>
- </Reference>
- <Reference Include="nunit.core.interfaces">
- <HintPath>..\..\..\packages\NUnit.Runners.2.6.4\tools\lib\nunit.core.interfaces.dll</HintPath>
- </Reference>
- <Reference Include="nunit.util">
- <HintPath>..\..\..\packages\NUnit.Runners.2.6.4\tools\lib\nunit.util.dll</HintPath>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
- <Project>{7525BB88-6142-4A26-93B9-A30C6983390A}</Project>
- <Name>MonoDevelop.Core</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\core\MonoDevelop.Ide\MonoDevelop.Ide.csproj">
- <Project>{27096E7F-C91C-4AC6-B289-6897A701DF21}</Project>
- <Name>MonoDevelop.Ide</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="NUnitRunner\NUnitRunner.csproj">
- <Project>{0AF16AF1-0876-413E-9803-08BD33C19E00}</Project>
- <Name>NUnitRunner</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
- <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
- <Name>Mono.TextEditor</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
- <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
- <Name>ICSharpCode.NRefactory</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\..\external\mono-addins\Mono.Addins\Mono.Addins.csproj">
- <Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
- <Name>Mono.Addins</Name>
- <Private>False</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\..\external\xwt\Xwt\Xwt.csproj">
- <Project>{92494904-35FA-4DC9-BDE9-3A3E87AC49D3}</Project>
- <Name>Xwt</Name>
- <Private>False</Private>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <EmbeddedResource Include="templates\NUnitAssemblyGroup.xpt.xml">
- <LogicalName>NUnitAssemblyGroup.xpt.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\unit-running-16.png">
- <LogicalName>unit-running-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\unit-running-16%402x.png">
- <LogicalName>unit-running-16@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\unit-failed-16.png">
- <LogicalName>unit-failed-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\unit-failed-16%402x.png">
- <LogicalName>unit-failed-16@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\unit-mixed-results-16.png">
- <LogicalName>unit-mixed-results-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\unit-mixed-results-16%402x.png">
- <LogicalName>unit-mixed-results-16@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\unit-not-yet-run-16.png">
- <LogicalName>unit-not-yet-run-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\unit-not-yet-run-16%402x.png">
- <LogicalName>unit-not-yet-run-16@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\unit-skipped-16.png">
- <LogicalName>unit-skipped-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\unit-skipped-16%402x.png">
- <LogicalName>unit-skipped-16@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\unit-loading-16.png">
- <LogicalName>unit-loading-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\unit-success-16.png">
- <LogicalName>unit-success-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\unit-success-16%402x.png">
- <LogicalName>unit-success-16@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="templates\NUnitTestClass.xft.xml">
- <LogicalName>NUnitTestClass.xft.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="MonoDevelopNUnit.addin.xml">
- <LogicalName>MonoDevelopNUnit.addin.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="templates\NUnitProject.xpt.xml">
- <LogicalName>NUnitProject.xpt.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\project-nunit-overlay-32.png">
- <LogicalName>project-nunit-overlay-32.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\project-nunit-overlay-32%402x.png">
- <LogicalName>project-nunit-overlay-32@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\project-nunit-overlay-32.png">
- <LogicalName>project-nunit-overlay-light-32.png</LogicalName>
- </EmbeddedResource><!-- TODO: VV: Duped definition to not break fsharpbinding (https://github.com/fsharp/fsharpbinding/blob/master/monodevelop/MonoDevelop.FSharpBinding/Templates/FSharpNUnitLibraryProject.xpt.xml#L8) -->
- <EmbeddedResource Include="Gui\icons\project-nunit-overlay-32@2x.png">
- <LogicalName>project-nunit-overlay-light-32@2x.png</LogicalName>
- </EmbeddedResource><!-- TODO: VV: Duped definition to not break fsharpbinding (https://github.com/fsharp/fsharpbinding/blob/master/monodevelop/MonoDevelop.FSharpBinding/Templates/FSharpNUnitLibraryProject.xpt.xml#L8) -->
- <EmbeddedResource Include="gtk-gui\gui.stetic">
- <LogicalName>gui.stetic</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\pad-unit-test-16.png">
- <LogicalName>pad-unit-test-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\pad-unit-test-16%402x.png">
- <LogicalName>pad-unit-test-16@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\pad-unit-test-results-16.png">
- <LogicalName>pad-unit-test-results-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\pad-unit-test-results-16%402x.png">
- <LogicalName>pad-unit-test-results-16@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\unit-inconclusive-16.png">
- <LogicalName>unit-inconclusive-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\unit-inconclusive-16%402x.png">
- <LogicalName>unit-inconclusive-16@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\unit-run-16.png">
- <LogicalName>unit-run-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="Gui\icons\unit-run-16%402x.png">
- <LogicalName>unit-run-16@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="templates\NUnitProjectVBNet.xpt.xml">
- <LogicalName>NUnitProjectVBNet.xpt.xml</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="templates\images\nunit-library-project.png">
- <LogicalName>nunit-library-project.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="templates\images\nunit-library-project%402x.png">
- <LogicalName>nunit-library-project@2x.png</LogicalName>
- </EmbeddedResource>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="AssemblyInfo.cs" />
- <Compile Include="Commands\NUnitCommands.cs" />
- <Compile Include="Gui\TestPad.cs" />
- <Compile Include="Gui\TestResultsPad.cs" />
- <Compile Include="Gui\TestNodeBuilder.cs" />
- <Compile Include="Gui\TestChart.cs" />
- <Compile Include="Gui\UnitTestOptionsDialog.cs" />
- <Compile Include="Gui\NUnitAssemblyGroupNodeBuilder.cs" />
- <Compile Include="Gui\NUnitAssemblyGroupConfigurationNodeBuilder.cs" />
- <Compile Include="Gui\TestAssemblyNodeBuilder.cs" />
- <Compile Include="Project\NUnitAssemblyGroupProject.cs" />
- <Compile Include="Project\TestAssembly.cs" />
- <Compile Include="Project\TestAssemblyCollection.cs" />
- <Compile Include="Services\SolutionFolderTestGroup.cs" />
- <Compile Include="Services\ITestProvider.cs" />
- <Compile Include="Services\NUnitService.cs" />
- <Compile Include="Services\SystemTestProvider.cs" />
- <Compile Include="Services\ITestProgressMonitor.cs" />
- <Compile Include="Services\TestContext.cs" />
- <Compile Include="Services\UnitTestCollection.cs" />
- <Compile Include="Services\UnitTest.cs" />
- <Compile Include="Services\UnitTestGroup.cs" />
- <Compile Include="Services\ExternalTestRunner.cs" />
- <Compile Include="Services\NUnitAssemblyTestSuite.cs" />
- <Compile Include="Services\NUnitProjectTestSuite.cs" />
- <Compile Include="Services\NUnitTestCase.cs" />
- <Compile Include="Services\NUnitTestSuite.cs" />
- <Compile Include="Services\GeneralTestOptions.cs" />
- <Compile Include="Services\NUnitOptions.cs" />
- <Compile Include="Services\IResultsStore.cs" />
- <Compile Include="Services\UnitTestResultsStore.cs" />
- <Compile Include="Services\WorkspaceTestGroup.cs" />
- <Compile Include="gtk-gui\generated.cs" />
- <Compile Include="Services\UnitTestResult.cs" />
- <Compile Include="Services\UnitTestStatus.cs" />
- <Compile Include="Services\NUnitProjectServiceExtension.cs" />
- <Compile Include="Gui\NUnitOptionsPanel.cs" />
- <Compile Include="gtk-gui\MonoDevelop.NUnit.NUnitOptionsWidget.cs" />
- <Compile Include="Services\TcpTestListener.cs" />
- <Compile Include="Gui\TestStatusIcon.cs" />
- <Compile Include="AddinInfo.cs" />
- <Compile Include="Gui\AbstractUnitTestEditorExtension.cs" />
- <Compile Include="Services\AbstractResultsStore.cs" />
- <Compile Include="Services\BinaryResultsStore.cs" />
- </ItemGroup>
- <ItemGroup>
- <None Include="Makefile.am" />
- <None Include="packages.config" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <Target Name="BeforeBuild">
- <PropertyGroup>
- <NuGet>$(SolutionDir)\external\nuget-binary\NuGet.exe</NuGet>
- <NuGet Condition="$(OS)=='Unix'">mono $(NuGet)</NuGet>
- </PropertyGroup>
- <Exec Condition="Exists('$(SolutionDir)\..\.git')" Command="$(NuGet) restore -SolutionDirectory $(SolutionDir)" />
- </Target>
- <ItemGroup>
- <Folder Include="templates\images\" />
- </ItemGroup>
-</Project>
diff --git a/main/src/addins/NUnit/MonoDevelopNUnit.addin.xml b/main/src/addins/NUnit/MonoDevelopNUnit.addin.xml
deleted file mode 100644
index 25aef50656..0000000000
--- a/main/src/addins/NUnit/MonoDevelopNUnit.addin.xml
+++ /dev/null
@@ -1,213 +0,0 @@
-<ExtensionModel>
-
- <Runtime>
- <Import assembly="MonoDevelop.NUnit.dll" />
- <Import assembly="nunit.core.dll" />
- <Import assembly="nunit.core.interfaces.dll" />
- <Import assembly="nunit.framework.dll" />
- <Import assembly="nunit.util.dll" />
- </Runtime>
-
- <!-- Extension Points -->
-
- <ExtensionPoint path = "/MonoDevelop/NUnit/TestProviders" name = "Test providers">
- <Description>Test providers. Specified classes must implement ITestProvider.</Description>
- <ExtensionNode name ="Class" />
- </ExtensionPoint>
-
- <ExtensionPoint path = "/MonoDevelop/NUnit/ContextMenu/TestChart">
- <ExtensionNodeSet id="MonoDevelop.Components.Commands.ItemSet"/>
- </ExtensionPoint>
-
- <ExtensionPoint path = "/MonoDevelop/NUnit/ContextMenu/TestPad">
- <ExtensionNodeSet id="MonoDevelop.Components.Commands.ItemSet"/>
- </ExtensionPoint>
-
- <ExtensionPoint path = "/MonoDevelop/NUnit/ContextMenu/TestResultsPad">
- <ExtensionNodeSet id="MonoDevelop.Components.Commands.ItemSet"/>
- </ExtensionPoint>
-
- <ExtensionPoint path = "/MonoDevelop/NUnit/ContextMenu/ProjectPad/NUnitAssemblyGroup">
- <ExtensionNodeSet id="MonoDevelop.Components.Commands.ItemSet"/>
- </ExtensionPoint>
-
- <ExtensionPoint path = "/MonoDevelop/NUnit/ContextMenu/ProjectPad/TestAssembly">
- <ExtensionNodeSet id="MonoDevelop.Components.Commands.ItemSet"/>
- </ExtensionPoint>
-
- <ExtensionPoint path = "/MonoDevelop/NUnit/ContextMenu/ProjectPad/NUnitAssemblyGroupConfiguration">
- <ExtensionNodeSet id="MonoDevelop.Components.Commands.ItemSet"/>
- </ExtensionPoint>
-
- <ExtensionPoint path = "/MonoDevelop/NUnit/UnitTestOptions/GeneralOptions">
- <ExtensionNodeSet id="MonoDevelop.Ide.OptionsDialogSection"/>
- </ExtensionPoint>
-
- <ExtensionPoint path = "/MonoDevelop/NUnit/UnitTestOptions/ConfigurationOptions">
- <ExtensionNodeSet id="MonoDevelop.Ide.OptionsDialogSection"/>
- </ExtensionPoint>
-
-
- <!-- Extensions -->
-
- <Extension path = "/MonoDevelop/Ide/Pads">
- <SolutionPad id = "MonoDevelop.NUnit.TestPad" defaultLayout="*" defaultPlacement = "Right" defaultStatus="AutoHide" _label = "Unit Tests" icon = "nunit-pad-icon" class = "MonoDevelop.NUnit.TestPad">
- <PadOption id = "ShowTestTime" _label = "Show Test Time" defaultValue = "False" />
- <PadOption id = "ShowTestCounters" _label = "Show Test Counters" defaultValue = "False" />
- <NodeBuilder id = "TestNode" class = "MonoDevelop.NUnit.TestNodeBuilder"/>
- </SolutionPad>
- <Pad id="MonoDevelop.NUnit.TestResultsPad" _label="Test Results" icon="nunit-results-pad-icon" class="MonoDevelop.NUnit.TestResultsPad" defaultPlacement = "Bottom" defaultLayout="UnitTesting" defaultStatus="AutoHide"/>
- </Extension>
-
- <Extension path="/MonoDevelop/Ide/WorkbenchLayouts">
- <Layout id="UnitTesting" _name="Unit Testing">
- <LayoutPad id="MonoDevelop.NUnit.TestPad" status="Dockable" />
- <LayoutPad id="MonoDevelop.NUnit.TestResultsPad" status="Dockable" />
- </Layout>
- </Extension>
-
- <Extension path = "/MonoDevelop/Ide/Pads/ProjectPad">
- <NodeBuilder id = "NUnitAssemblyGroupNodeBuilder" class = "MonoDevelop.NUnit.NUnitAssemblyGroupNodeBuilder"/>
- <NodeBuilder id = "NUnitAssemblyGroupConfigurationNodeBuilder" class = "MonoDevelop.NUnit.NUnitAssemblyGroupConfigurationNodeBuilder"/>
- <NodeBuilder id = "TestAssemblyNodeBuilder" class = "MonoDevelop.NUnit.TestAssemblyNodeBuilder"/>
- </Extension>
-
- <Extension path = "/MonoDevelop/Ide/Commands">
- <Category _name = "NUnit" id = "NUnit">
- <Command id = "MonoDevelop.NUnit.Commands.TestCommands.RunAllTests"
- _label = "Run Unit Tests"
- _description="Runs all tests of the current selected project."
- shortcut="Control|T"
- defaultHandler="MonoDevelop.NUnit.Commands.RunAllTestsHandler"/>
- <Command id = "MonoDevelop.NUnit.Commands.TestCommands.RunTestWith"
- _label = "Run With"
- type="array"
- _description="Runs tests using a special execution mode."/>
- <Command id = "MonoDevelop.NUnit.Commands.TestCommands.DebugTest"
- _label = "Debug Test"
- type="array" />
- <Command id = "MonoDevelop.NUnit.Commands.TestCommands.RunTest" _label = "Run Test" />
- <Command id = "MonoDevelop.NUnit.Commands.TestCommands.ShowTestCode" _label = "Show test source code" />
- <Command id = "MonoDevelop.NUnit.Commands.TestCommands.GoToFailure" _label = "Go to failure" />
- <Command id = "MonoDevelop.NUnit.Commands.TestCommands.SelectTestInTree" _label = "Select test in tree" />
- <Command id = "MonoDevelop.NUnit.Commands.TestCommands.ShowTestDetails" _label = "Show results pad" />
- <Command id = "MonoDevelop.NUnit.Commands.TestCommands.RerunTest" _label = "Rerun test" />
- <Command id = "MonoDevelop.NUnit.Commands.TestChartCommands.UseTimeScale" _label = "Proportional time scale" type="check"/>
- <Command id = "MonoDevelop.NUnit.Commands.TestChartCommands.SingleDayResult" _label = "Show one result per day" type="check"/>
- <Command id = "MonoDevelop.NUnit.Commands.TestChartCommands.ShowResults" _label = "Results chart" type="radio"/>
- <Command id = "MonoDevelop.NUnit.Commands.TestChartCommands.ShowTime" _label = "Time chart" type="radio"/>
- <Command id = "MonoDevelop.NUnit.Commands.TestChartCommands.ShowSuccessfulTests" _label = "Show successful tests" type="check"/>
- <Command id = "MonoDevelop.NUnit.Commands.TestChartCommands.ShowFailedTests" _label = "Show failed tests" type="check"/>
- <Command id = "MonoDevelop.NUnit.Commands.TestChartCommands.ShowIgnoredTests" _label = "Show ignored tests" type="check"/>
- <Command id = "MonoDevelop.NUnit.Commands.NUnitProjectCommands.AddAssembly" _label = "Add assembly..."/>
- </Category>
- </Extension>
-
- <Extension path = "/MonoDevelop/Ide/MainMenu/Run">
- <CommandItem id = "MonoDevelop.NUnit.Commands.TestCommands.RunAllTests" />
- </Extension>
-
- <Extension path = "/MonoDevelop/NUnit/ContextMenu/ProjectPad/NUnitAssemblyGroup">
- <CommandItem id = "MonoDevelop.Ide.Commands.EditCommands.Delete" />
- </Extension>
-
- <Extension path = "/MonoDevelop/NUnit/ContextMenu/ProjectPad/NUnitAssemblyGroupConfiguration">
- <CommandItem id = "MonoDevelop.NUnit.Commands.NUnitProjectCommands.AddAssembly" />
- </Extension>
-
- <Extension path = "/MonoDevelop/NUnit/ContextMenu/ProjectPad/TestAssembly">
- <CommandItem id = "MonoDevelop.Ide.Commands.EditCommands.Delete" />
- </Extension>
-
- <Extension path = "/MonoDevelop/NUnit/ContextMenu/TestPad">
- <CommandItem id = "MonoDevelop.NUnit.Commands.TestCommands.RunTest" />
- <CommandItem id = "MonoDevelop.NUnit.Commands.TestCommands.DebugTest" />
- <ItemSet id = "RunTestWith" _label = "Run Test With">
- <CommandItem id = "MonoDevelop.NUnit.Commands.TestCommands.RunTestWith" />
- </ItemSet>
- <SeparatorItem id = "s0" />
- <CommandItem id = "MonoDevelop.NUnit.Commands.TestCommands.GoToFailure" />
- <CommandItem id = "MonoDevelop.NUnit.Commands.TestCommands.ShowTestCode" />
- <CommandItem id = "MonoDevelop.NUnit.Commands.TestCommands.ShowTestDetails" />
- <SeparatorItem id = "s1" />
- <CommandItem id = "MonoDevelop.Ide.Commands.ProjectCommands.Options" />
- </Extension>
-
- <Extension path = "/MonoDevelop/NUnit/ContextMenu/TestResultsPad">
- <CommandItem id = "MonoDevelop.NUnit.Commands.TestCommands.GoToFailure" />
- <CommandItem id = "MonoDevelop.NUnit.Commands.TestCommands.ShowTestCode" />
- <CommandItem id = "MonoDevelop.NUnit.Commands.TestCommands.SelectTestInTree" />
- <CommandItem id = "MonoDevelop.NUnit.Commands.TestCommands.RerunTest" />
- <SeparatorItem id = "s1" />
- <CommandItem id = "MonoDevelop.Ide.Commands.EditCommands.Copy" />
- </Extension>
-
- <Extension path = "/MonoDevelop/NUnit/ContextMenu/TestChart">
- <CommandItem id = "MonoDevelop.NUnit.Commands.TestChartCommands.ShowResults" />
- <CommandItem id = "MonoDevelop.NUnit.Commands.TestChartCommands.ShowTime" />
- <SeparatorItem id = "s1" />
- <CommandItem id = "MonoDevelop.NUnit.Commands.TestChartCommands.ShowSuccessfulTests" />
- <CommandItem id = "MonoDevelop.NUnit.Commands.TestChartCommands.ShowFailedTests" />
- <CommandItem id = "MonoDevelop.NUnit.Commands.TestChartCommands.ShowIgnoredTests" />
- <SeparatorItem id = "s2" />
- <CommandItem id = "MonoDevelop.NUnit.Commands.TestChartCommands.UseTimeScale" />
- <CommandItem id = "MonoDevelop.NUnit.Commands.TestChartCommands.SingleDayResult" />
- </Extension>
-
- <Extension path = "/MonoDevelop/NUnit/UnitTestOptions/GeneralOptions">
- <Section id = "Configurations"
- _label = "Configurations" />
- </Extension>
-
- <Extension path = "/MonoDevelop/NUnit/UnitTestOptions/ConfigurationOptions">
- <Section id = "NUnitOptionsPanel"
- _label = "${Configuration}"
- class = "MonoDevelop.NUnit.NUnitOptionsPanel"/>
- </Extension>
-
- <Extension path = "/MonoDevelop/Ide/ProjectTemplates">
-<!-- <ProjectTemplate id = "NUnitAssemblyGroup" resource = "NUnitAssemblyGroup.xpt.xml"/>-->
- <ProjectTemplate id = "NUnitProject" resource = "NUnitProject.xpt.xml"/>
- <ProjectTemplate id = "NUnitProjectVBNet" resource = "NUnitProjectVBNet.xpt.xml"/>
- </Extension>
-
- <Extension path = "/MonoDevelop/Ide/FileTemplates">
- <FileTemplate id = "NUnitTestClass" resource = "NUnitTestClass.xft.xml"/>
- </Extension>
-
- <Extension path = "/MonoDevelop/NUnit/TestProviders">
- <Class id="SystemTestProvider" class="MonoDevelop.NUnit.SystemTestProvider" />
- </Extension>
-
- <Extension path = "/MonoDevelop/Core/StockIcons">
- <StockIcon stockid = "nunit-pad-icon" resource = "pad-unit-test-16.png" size="Menu" />
- <StockIcon stockid = "nunit-results-pad-icon" resource = "pad-unit-test-results-16.png" size="Menu" />
- <StockIcon stockid = "nunit-run" resource = "unit-run-16.png" size="Menu" />
- </Extension>
-
- <Extension path = "/MonoDevelop/ProjectModel/ProjectServiceExtensions">
- <Class class = "MonoDevelop.NUnit.NUnitProjectServiceExtension" />
- </Extension>
-
- <Extension path = "/MonoDevelop/ProjectModel/SerializableClasses">
- <DataType class = "MonoDevelop.NUnit.NUnitAssemblyGroupProject" />
- <DataType class = "MonoDevelop.NUnit.NUnitCategoryOptions" />
- </Extension>
-
- <Extension path = "/MonoDevelop/ProjectModel/ExtendedProperties">
- <ItemProperty class = "MonoDevelop.Projects.SolutionItemConfiguration"
- name = "UnitTestInformation" type = "MonoDevelop.NUnit.UnitTestOptionsSet" />
- <ItemProperty class = "MonoDevelop.Projects.DotNetProject"
- name = "TestRunnerType" type = "System.String" external="false" />
- <ItemProperty class = "MonoDevelop.Projects.DotNetProject"
- name = "TestRunnerAssembly" type = "MonoDevelop.Core.FilePath" external="false" />
- <ItemProperty class = "MonoDevelop.Projects.DotNetProject"
- name = "TestRunnerCommand" type = "MonoDevelop.Core.FilePath" external="false" />
- <ItemProperty class = "MonoDevelop.Projects.DotNetProject"
- name = "TestRunnerArgs" type = "System.String" external="false" />
- </Extension>
-
- <Extension path="/MonoDevelop/Ide/TemplateImages">
- <Image id="md-nunit-library-project" resource="nunit-library-project.png" />
- </Extension>
-</ExtensionModel>
diff --git a/main/src/addins/NUnit/NUnitRunner/ChangeLog b/main/src/addins/NUnit/NUnitRunner/ChangeLog
deleted file mode 100644
index 05e2ede495..0000000000
--- a/main/src/addins/NUnit/NUnitRunner/ChangeLog
+++ /dev/null
@@ -1,32 +0,0 @@
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * NUnitRunner.csproj: Flush.
-
-2009-10-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * NUnitTestRunner.cs: The name of inherited tests include the
- base class name as prefix. That prefix has to be removed.
- Fixes bug #543772 - derived TestFixtures are visible but not
- being run.
-
-2009-06-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * NUnitTestRunner.cs: In some cases MS.NET can't properly
- resolve assemblies even if they are already loaded. For
- example, when deserializing objects from remoting. Added a
- handler for AssemblyResolve that handle this case.
-
-2009-02-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Added support for running unit tests using a
- special execution mode (for example, using the debugger).
-
-2009-02-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Fix distcheck.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * NUnitRunner.mdp:
- * NUnitRunner.csproj: Migrated to MSBuild file format.
-
diff --git a/main/src/addins/NUnit/NUnitRunner/NUnitRunner.csproj b/main/src/addins/NUnit/NUnitRunner/NUnitRunner.csproj
deleted file mode 100644
index 5822b21843..0000000000
--- a/main/src/addins/NUnit/NUnitRunner/NUnitRunner.csproj
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{0AF16AF1-0876-413E-9803-08BD33C19E00}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AssemblyName>NUnitRunner</AssemblyName>
- <RootNamespace>NUnitRunner</RootNamespace>
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>True</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>False</Optimize>
- <OutputPath>..\..\..\..\build\AddIns\NUnit</OutputPath>
- <DefineConstants>DEBUG</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <ConsolePause>False</ConsolePause>
- <NoWarn>1591;1573</NoWarn>
- <DocumentationFile>..\..\..\..\build\AddIns\NUnit\NUnitRunner.xml</DocumentationFile>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>..\..\..\..\build\AddIns\NUnit</OutputPath>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <ConsolePause>False</ConsolePause>
- <DebugSymbols>true</DebugSymbols>
- <NoWarn>1591;1573</NoWarn>
- <DocumentationFile>..\..\..\..\build\AddIns\NUnit\NUnitRunner.xml</DocumentationFile>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Xml" />
- <Reference Include="nunit.framework">
- <HintPath>..\..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
- </Reference>
- <Reference Include="nunit.core">
- <HintPath>..\..\..\..\packages\NUnit.Runners.2.6.4\tools\lib\nunit.core.dll</HintPath>
- </Reference>
- <Reference Include="nunit.core.interfaces">
- <HintPath>..\..\..\..\packages\NUnit.Runners.2.6.4\tools\lib\nunit.core.interfaces.dll</HintPath>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="NUnitTestRunner.cs" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <ItemGroup>
- <None Include="packages.config" />
- </ItemGroup>
- <Target Name="BeforeBuild">
- <PropertyGroup>
- <NuGet>$(SolutionDir)\external\nuget-binary\NuGet.exe</NuGet>
- <NuGet Condition="$(OS)=='Unix'">mono $(NuGet)</NuGet>
- </PropertyGroup>
- <Exec Condition="Exists('$(SolutionDir)\..\.git')" Command="$(NuGet) restore -SolutionDirectory $(SolutionDir)" />
- </Target>
-</Project>
diff --git a/main/src/addins/NUnit/NUnitRunner/NUnitTestRunner.cs b/main/src/addins/NUnit/NUnitRunner/NUnitTestRunner.cs
deleted file mode 100644
index 8602b52b56..0000000000
--- a/main/src/addins/NUnit/NUnitRunner/NUnitTestRunner.cs
+++ /dev/null
@@ -1,219 +0,0 @@
-//
-// ExternalTestRunner.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Linq;
-using System.Reflection;
-using System.IO;
-using System.Collections;
-using System.Collections.Generic;
-using System.Threading;
-
-using NUnit.Core;
-using NUnit.Framework;
-using NUnit.Core.Filters;
-
-namespace MonoDevelop.NUnit.External
-{
- public class NUnitTestRunner: MarshalByRefObject
- {
- public NUnitTestRunner ()
- {
- }
-
- public void PreloadAssemblies (string nunitPath, string nunitCorePath, string nunitCoreInterfacesPath)
- {
- // Note: We need to load all nunit.*.dll assemblies before we do *anything* else in this class
- // This is to ensure that we always load the assemblies from the monodevelop directory and not
- // from the directory of the assembly under test. For example we wnat to load
- // /Applications/MonoDevelop/lib/Addins/nunit.framework.dll and not /user/app/foo/bin/debug/nunit.framework.dll
-
- // In some cases MS.NET can't properly resolve assemblies even if they
- // are already loaded. For example, when deserializing objects from remoting.
- AppDomain.CurrentDomain.AssemblyResolve += delegate (object s, ResolveEventArgs args) {
- foreach (Assembly am in AppDomain.CurrentDomain.GetAssemblies ()) {
- if (am.GetName ().FullName == args.Name)
- return am;
- }
- return null;
- };
-
- // Force the loading of the NUnit.Framework assembly.
- // It's needed since that dll is not located in the test dll directory.
- Assembly.LoadFrom (nunitCoreInterfacesPath);
- Assembly.LoadFrom (nunitCorePath);
- Assembly.LoadFrom (nunitPath);
- }
-
- public void Initialize ()
- {
- // Initialize ExtensionHost if not already done
- if ( !CoreExtensions.Host.Initialized )
- CoreExtensions.Host.InitializeService();
- }
-
- public TestResult Run (EventListener listener, ITestFilter filter, string path, string suiteName, List<string> supportAssemblies, string testRunnerType, string testRunnerAssembly)
- {
- InitSupportAssemblies (supportAssemblies);
-
- if (filter == null)
- filter = TestFilter.Empty;
-
- TestRunner tr;
- if (!string.IsNullOrEmpty (testRunnerType)) {
- Type runnerType;
- if (string.IsNullOrEmpty (testRunnerAssembly))
- runnerType = Type.GetType (testRunnerType, true);
- else {
- var asm = Assembly.LoadFrom (testRunnerAssembly);
- runnerType = asm.GetType (testRunnerType);
- }
- tr = (TestRunner)Activator.CreateInstance (runnerType);
- } else
- tr = new RemoteTestRunner ();
-
- TestPackage package = new TestPackage (path);
- if (!string.IsNullOrEmpty (suiteName))
- package.TestName = suiteName;
- tr.Load (package);
- return tr.Run (listener, filter, false, LoggingThreshold.All);
- }
-
- public NunitTestInfo GetTestInfo (string path, List<string> supportAssemblies)
- {
- InitSupportAssemblies (supportAssemblies);
-
- TestSuite rootTS = new TestSuiteBuilder ().Build (new TestPackage (path));
- return BuildTestInfo (rootTS);
- }
-
- NunitTestInfo BuildTestInfo (Test test)
- {
- NunitTestInfo ti = new NunitTestInfo ();
- // The name of inherited tests include the base class name as prefix.
- // That prefix has to be removed
- string tname = test.TestName.Name;
- // Find the last index of the dot character that is not a part of the test parameters
- int j = tname.IndexOf ('(');
- int i = tname.LastIndexOf ('.', (j == -1) ? (tname.Length - 1) : j);
- if (i != -1)
- tname = tname.Substring (i + 1);
- if (test.FixtureType != null) {
- ti.FixtureTypeName = test.FixtureType.Name;
- ti.FixtureTypeNamespace = test.FixtureType.Namespace;
- } else if (test.TestType == "ParameterizedTest") {
- ti.FixtureTypeName = test.Parent.FixtureType.Name;
- ti.FixtureTypeNamespace = test.Parent.FixtureType.Namespace;
- }
- ti.Name = tname;
- ti.TestId = test.TestName.FullName;
-
- // Trim short name from end of full name to get the path
- string testNameWithDelimiter = "." + tname;
- if (test.TestName.FullName.EndsWith (testNameWithDelimiter)) {
- int pathLength = test.TestName.FullName.Length - testNameWithDelimiter.Length;
- ti.PathName = test.TestName.FullName.Substring(0, pathLength );
- }
- else
- ti.PathName = null;
-
- if (test.Tests != null && test.Tests.Count > 0) {
- ti.Tests = new NunitTestInfo [test.Tests.Count];
- for (int n=0; n<test.Tests.Count; n++)
- ti.Tests [n] = BuildTestInfo ((Test)test.Tests [n]);
- }
- ti.IsExplicit = test.RunState == RunState.Explicit;
- return ti;
- }
-
- void InitSupportAssemblies (List<string> supportAssemblies)
- {
- // Preload support assemblies (they may not be in the test assembly directory nor in the gac)
- foreach (string asm in supportAssemblies)
- Assembly.LoadFrom (asm);
- }
-
- public override object InitializeLifetimeService ()
- {
- return null;
- }
- }
-
- [Serializable]
- public class NunitTestInfo
- {
- public string Name;
- public string PathName;
- public string TestId;
- public string FixtureTypeName;
- public string FixtureTypeNamespace;
- public bool IsExplicit;
- public NunitTestInfo[] Tests;
- }
-
- [Serializable]
- public class TestNameFilter: ITestFilter
- {
- string[] names;
-
- public TestNameFilter (params string[] names)
- {
- this.names = names;
- }
-
- #region ITestFilter implementation
-
- public bool Pass (ITest test)
- {
- if (!test.IsSuite && names.Any (n => test.TestName.FullName == n))
- return true;
- if (test.Tests != null) {
- foreach (ITest ct in test.Tests) {
- if (Pass (ct))
- return true;
- }
- }
- return false;
- }
-
- public bool Match (ITest test)
- {
- return Pass (test);
- }
-
- public bool IsEmpty {
- get {
- return false;
- }
- }
-
- #endregion
- }
-}
-
diff --git a/main/src/addins/NUnit/Project/NUnitAssemblyGroupProject.cs b/main/src/addins/NUnit/Project/NUnitAssemblyGroupProject.cs
deleted file mode 100644
index 0a67aac29d..0000000000
--- a/main/src/addins/NUnit/Project/NUnitAssemblyGroupProject.cs
+++ /dev/null
@@ -1,223 +0,0 @@
-//
-// NUnitAssemblyGroupProject.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.IO;
-using System.Xml;
-using MonoDevelop.Projects;
-using MonoDevelop.Core;
-using MonoDevelop.Core.Serialization;
-using MonoDevelop.Ide.TypeSystem;
-
-namespace MonoDevelop.NUnit
-{
- [DataInclude (typeof(NUnitAssemblyGroupProjectConfiguration))]
- public class NUnitAssemblyGroupProject: SolutionEntityItem
- {
- RootTest rootTest;
-
- public NUnitAssemblyGroupProject ()
- {
- }
-
- protected override void OnEndLoad ()
- {
- base.OnEndLoad ();
- if (Configurations.Count == 0)
- Configurations.Add (CreateConfiguration ("Default"));
- }
-
- public override void InitializeFromTemplate (XmlElement element)
- {
- Configurations.Add (CreateConfiguration ("Default"));
- }
-
- public UnitTest RootTest {
- get {
- if (rootTest == null) {
- rootTest = new RootTest (this);
- }
- return rootTest;
- }
- }
-
- public override SolutionItemConfiguration CreateConfiguration (string name)
- {
- NUnitAssemblyGroupProjectConfiguration conf = new NUnitAssemblyGroupProjectConfiguration ();
- conf.Name = name;
- return conf;
- }
-
- protected override void OnClean (IProgressMonitor monitor, ConfigurationSelector configuration)
- {
- }
-
- protected override BuildResult OnBuild (IProgressMonitor monitor, ConfigurationSelector configuration)
- {
- return null;
- }
-
- protected override void OnExecute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
- {
- }
-
- protected override bool OnGetNeedsBuilding (ConfigurationSelector configuration)
- {
- return false;
- }
-
- protected override void OnSetNeedsBuilding (bool value, ConfigurationSelector configuration)
- {
- }
- }
-
- public class NUnitAssemblyGroupProjectConfiguration: SolutionItemConfiguration
- {
- TestAssemblyCollection assemblies;
-
- public NUnitAssemblyGroupProjectConfiguration ()
- {
- assemblies = new TestAssemblyCollection (this);
- }
-
- public override void CopyFrom (ItemConfiguration other)
- {
- base.CopyFrom (other);
-
- NUnitAssemblyGroupProjectConfiguration conf = other as NUnitAssemblyGroupProjectConfiguration;
- if (conf != null) {
- assemblies.Clear ();
- foreach (TestAssembly ta in conf.Assemblies) {
- TestAssembly copy = new TestAssembly (ta.Path);
- assemblies.Add (copy);
- }
- }
- }
-
- [ItemProperty ("Assemblies")]
- [ItemProperty ("Assembly", ValueType=typeof(TestAssembly), Scope="*")]
- public TestAssemblyCollection Assemblies {
- get { return assemblies; }
- }
-
- internal void OnAssembliesChanged ()
- {
- if (AssembliesChanged != null)
- AssembliesChanged (this, EventArgs.Empty);
- }
-
- public event EventHandler AssembliesChanged;
- }
-
- class RootTest: UnitTestGroup
- {
- NUnitAssemblyGroupProject project;
- string resultsPath;
- NUnitAssemblyGroupProjectConfiguration lastConfig;
-
-
- internal static string GetTestResultsDirectory (string baseDirectory)
- {
- var newCache = TypeSystemService.GetCacheDirectory (baseDirectory, false);
- if (newCache == null) {
- newCache = TypeSystemService.GetCacheDirectory (baseDirectory, true);
- var oldDirectory = Path.Combine (baseDirectory, "test-results");
- var newDirectory = Path.Combine (newCache, "test-results");
- try {
- Directory.CreateDirectory (newDirectory);
- if (Directory.Exists (oldDirectory)) {
- foreach (string file in Directory.GetFiles(oldDirectory, "*.*"))
- File.Copy (file, file.Replace (oldDirectory, newDirectory));
- }
- } catch (Exception e) {
- LoggingService.LogError ("Error while copying old test-results", e);
- }
- return newDirectory;
- }
-
- return Path.Combine (newCache, "test-results");
- }
-
- public RootTest (NUnitAssemblyGroupProject project): base (project.Name, project)
- {
- this.project = project;
- resultsPath = GetTestResultsDirectory (project.BaseDirectory);
- ResultsStore = new BinaryResultsStore (resultsPath, Path.GetFileName (project.FileName));
-
- lastConfig = (NUnitAssemblyGroupProjectConfiguration) project.DefaultConfiguration;
- if (lastConfig != null)
- lastConfig.AssembliesChanged += new EventHandler (OnAssembliesChanged);
- }
-
- public override void Dispose ()
- {
- if (lastConfig != null)
- lastConfig.AssembliesChanged -= new EventHandler (OnAssembliesChanged);
- }
-
- internal string ResultsPath {
- get { return resultsPath; }
- }
-
- void OnAssembliesChanged (object sender, EventArgs args)
- {
- UpdateTests ();
- }
-
- public override bool HasTests {
- get {
- return true;
- }
- }
-
-
- protected override void OnActiveConfigurationChanged ()
- {
- if (lastConfig != null)
- lastConfig.AssembliesChanged -= new EventHandler (OnAssembliesChanged);
-
- lastConfig = (NUnitAssemblyGroupProjectConfiguration) project.DefaultConfiguration;
- if (lastConfig != null)
- lastConfig.AssembliesChanged += new EventHandler (OnAssembliesChanged);
-
- UpdateTests ();
- base.OnActiveConfigurationChanged ();
- }
-
- protected override void OnCreateTests ()
- {
- NUnitAssemblyGroupProjectConfiguration conf = (NUnitAssemblyGroupProjectConfiguration) project.GetConfiguration ((ItemConfigurationSelector) ActiveConfiguration);
- if (conf != null) {
- foreach (TestAssembly t in conf.Assemblies)
- Tests.Add (t);
- }
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Project/TestAssembly.cs b/main/src/addins/NUnit/Project/TestAssembly.cs
deleted file mode 100644
index 3beb664b6c..0000000000
--- a/main/src/addins/NUnit/Project/TestAssembly.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// TestAssembly.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.IO;
-using MonoDevelop.Projects;
-using MonoDevelop.Core.Serialization;
-
-namespace MonoDevelop.NUnit
-{
- public class TestAssembly: NUnitAssemblyTestSuite
- {
- [ItemProperty ("Path")]
- string path;
-
- public TestAssembly (): base (null)
- {
- }
-
- public TestAssembly (string path): base (null)
- {
- this.path = path;
- }
-
- public override string Name {
- get { return System.IO.Path.GetFileNameWithoutExtension (path); }
- }
-
- public string Path {
- get { return path; }
- set { path = value; }
- }
-
- protected override string AssemblyPath {
- get { return path; }
- }
-
- protected override string TestInfoCachePath {
- get {
- if (Parent != null)
- return System.IO.Path.Combine (((RootTest)Parent).ResultsPath, System.IO.Path.GetFileName (path) + ".test-cache");
- else
- return null;
- }
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Project/TestAssemblyCollection.cs b/main/src/addins/NUnit/Project/TestAssemblyCollection.cs
deleted file mode 100644
index 64e1ea75eb..0000000000
--- a/main/src/addins/NUnit/Project/TestAssemblyCollection.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// TestAssemblyCollection.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections;
-
-namespace MonoDevelop.NUnit
-{
- public class TestAssemblyCollection: CollectionBase
- {
- NUnitAssemblyGroupProjectConfiguration owner;
-
- internal TestAssemblyCollection (NUnitAssemblyGroupProjectConfiguration owner)
- {
- this.owner = owner;
- }
-
- public new TestAssembly this [int n] {
- get { return (TestAssembly) List [n]; }
- }
-
- public void Add (TestAssembly asm)
- {
- List.Add (asm);
- }
-
- public void Remove (TestAssembly asm)
- {
- List.Remove (asm);
- }
-
- protected override void OnInsertComplete (int index, object value)
- {
- owner.OnAssembliesChanged ();
- }
-
- protected override void OnRemoveComplete (int index, object value)
- {
- owner.OnAssembliesChanged ();
- }
-
- protected override void OnSetComplete (int index, object oldValue, object newValue)
- {
- owner.OnAssembliesChanged ();
- }
-
- protected override void OnClearComplete ()
- {
- owner.OnAssembliesChanged ();
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/AbstractResultsStore.cs b/main/src/addins/NUnit/Services/AbstractResultsStore.cs
deleted file mode 100644
index 10500c7ab2..0000000000
--- a/main/src/addins/NUnit/Services/AbstractResultsStore.cs
+++ /dev/null
@@ -1,407 +0,0 @@
-//
-// AbstractResultsStore.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Xml.Serialization;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.NUnit
-{
- public abstract class AbstractResultsStore: IResultsStore
- {
- Hashtable fileCache = new Hashtable ();
- string basePath;
- string storeId;
- Hashtable cachedRootList = new Hashtable ();
-
- IResultsStoreSerializer serializer;
-
- public AbstractResultsStore (IResultsStoreSerializer serializer, string directory, string storeId)
- {
- this.serializer = serializer;
- this.basePath = directory;
- this.storeId = storeId;
- }
-
- public void RegisterResult (string configuration, UnitTest test, UnitTestResult result)
- {
- string aname = test.StoreRelativeName;
-
- TestRecord root = GetRootRecord (configuration, result.TestDate);
- if (root == null) {
- root = new TestRecord ();
- fileCache [GetRootFileName (configuration, result.TestDate)] = root;
- }
- root.Modified = true;
- TestRecord record = root;
-
- if (aname.Length > 0) {
- string[] path = test.StoreRelativeName.Split ('.');
- foreach (string p in path) {
- TestRecord ctr = record.Tests != null ? record.Tests [p] : null;
- if (ctr == null) {
- ctr = new TestRecord ();
- ctr.Name = p;
- if (record.Tests == null)
- record.Tests = new TestRecordCollection ();
- record.Tests.Add (ctr);
- }
- record = ctr;
- }
- }
-
- if (record.Results == null)
- record.Results = new UnitTestResultCollection ();
- record.Results.Add (result);
- }
-
- public UnitTestResult GetNextResult (string configuration, UnitTest test, DateTime date)
- {
- DateTime currentDate = date;
- TestRecord root = GetRootRecord (configuration, currentDate);
- if (root == null)
- root = GetNextRootRecord (configuration, ref currentDate);
-
- while (root != null) {
- TestRecord tr = FindRecord (root, test.StoreRelativeName);
- if (tr != null && tr.Results != null) {
- foreach (UnitTestResult res in tr.Results) {
- if (res.TestDate > date)
- return res;
- }
- }
- root = GetNextRootRecord (configuration, ref currentDate);
- }
- return null;
- }
-
- public UnitTestResult GetPreviousResult (string configuration, UnitTest test, DateTime date)
- {
- DateTime currentDate = date;
- TestRecord root = GetRootRecord (configuration, currentDate);
- if (root == null)
- root = GetPreviousRootRecord (configuration, ref currentDate);
-
- while (root != null) {
- TestRecord tr = FindRecord (root, test.StoreRelativeName);
- if (tr != null && tr.Results != null) {
- for (int n = tr.Results.Count - 1; n >= 0; n--) {
- UnitTestResult res = (UnitTestResult) tr.Results [n];
- if (res.TestDate < date)
- return res;
- }
- }
- root = GetPreviousRootRecord (configuration, ref currentDate);
- }
- return null;
- }
-
- public UnitTestResult GetLastResult (string configuration, UnitTest test, DateTime date)
- {
- return GetPreviousResult (configuration, test, date.AddTicks (1));
- }
-
- public UnitTestResult[] GetResults (string configuration, UnitTest test, DateTime startDate, DateTime endDate)
- {
- ArrayList list = new ArrayList ();
- DateTime firstDay = new DateTime (startDate.Year, startDate.Month, startDate.Day);
-
- DateTime[] dates = GetStoreDates (configuration);
-
- foreach (DateTime date in dates) {
- if (date < firstDay)
- continue;
- if (date > endDate)
- break;
-
- TestRecord root = GetRootRecord (configuration, date);
- if (root == null) continue;
-
- TestRecord tr = FindRecord (root, test.StoreRelativeName);
- if (tr != null && tr.Results != null) {
- foreach (UnitTestResult res in tr.Results) {
- if (res.TestDate >= startDate && res.TestDate <= endDate)
- list.Add (res);
- }
- }
- }
-
- return (UnitTestResult[]) list.ToArray (typeof(UnitTestResult));
- }
-
- public UnitTestResult[] GetResultsToDate (string configuration, UnitTest test, DateTime endDate, int count)
- {
- ArrayList list = new ArrayList ();
- DateTime[] dates = GetStoreDates (configuration);
-
- for (int n = dates.Length - 1; n >= 0 && list.Count < count; n--) {
- if (dates [n] > endDate)
- continue;
-
- TestRecord root = GetRootRecord (configuration, dates [n]);
- if (root == null) continue;
-
- TestRecord tr = FindRecord (root, test.StoreRelativeName);
- if (tr != null && tr.Results != null) {
- for (int m = tr.Results.Count - 1; m >= 0 && list.Count < count; m--) {
- UnitTestResult res = (UnitTestResult) tr.Results [m];
- if (res.TestDate <= endDate)
- list.Add (res);
- }
- }
- }
-
- UnitTestResult[] array = (UnitTestResult[]) list.ToArray (typeof(UnitTestResult));
- Array.Reverse (array);
- return array;
- }
-
- public void Save ()
- {
- if (!Directory.Exists (basePath))
- Directory.CreateDirectory (basePath);
-
- foreach (DictionaryEntry entry in fileCache) {
- TestRecord record = (TestRecord) entry.Value;
- if (!record.Modified)
- continue;
-
- string filePath = Path.Combine (basePath, (string)entry.Key);
- try {
- serializer.Serialize (filePath, record);
- record.Modified = false;
- } catch (Exception ex) {
- LoggingService.LogError (ex.ToString ());
- }
- }
- cachedRootList.Clear ();
- }
-
- TestRecord FindRecord (TestRecord root, string aname)
- {
- if (aname.Length == 0)
- return root;
- else {
- string[] path = aname.Split ('.');
- TestRecord tr = root;
- foreach (string p in path) {
- if (tr.Tests == null)
- return null;
- tr = tr.Tests [p];
- if (tr == null)
- return null;
- }
- return tr;
- }
- }
-
- TestRecord GetRootRecord (string configuration, DateTime date)
- {
- string file = GetRootFileName (configuration, date);
- TestRecord res = (TestRecord) fileCache [file];
- if (res != null)
- return res;
- string filePath;
- try {
- filePath = Path.Combine (basePath, file);
- } catch (Exception) {
- return null;
- }
-
- try {
- res = (TestRecord) serializer.Deserialize (filePath);
- } catch (Exception ex) {
- LoggingService.LogError (ex.ToString ());
- return null;
- }
-
- if (res != null) {
- fileCache [file] = res;
- }
- return res;
- }
-
- TestRecord GetNextRootRecord (string configuration, ref DateTime date)
- {
- DateTime[] dates = GetStoreDates (configuration);
- foreach (DateTime d in dates) {
- if (d > date) {
- date = d;
- return GetRootRecord (configuration, d);
- }
- }
- return null;
- }
-
- TestRecord GetPreviousRootRecord (string configuration, ref DateTime date)
- {
- date = new DateTime (date.Year, date.Month, date.Day);
- DateTime[] dates = GetStoreDates (configuration);
- for (int n = dates.Length - 1; n >= 0; n--) {
- if (dates [n] < date) {
- date = dates [n];
- return GetRootRecord (configuration, dates [n]);
- }
- }
- return null;
- }
-
- // Filter out all invalid path characters in the file name
- // Bug 3023 - Running NUnit tests throws ArgumentException: Illegal Characters in path
- static string EscapeFilename (string str)
- {
- var pc = FilePath.GetInvalidPathChars ();
- char[] specialCharacters = new char[pc.Length + 1];
- pc.CopyTo (specialCharacters, 0);
- specialCharacters [specialCharacters.Length - 1] = '%';
-
- int i = str.IndexOfAny (specialCharacters);
- while (i != -1) {
- str = str.Substring (0, i) + '%' + ((int) str [i]).ToString ("X") + str.Substring (i + 1);
- i = str.IndexOfAny (specialCharacters, i + 3);
- }
- return str;
- }
-
- string GetRootFileName (string configuration, DateTime date)
- {
- var filteredConfiguration = EscapeFilename (configuration);
- return storeId + "-" + filteredConfiguration + "-" + date.ToString ("yyyy-MM-dd", CultureInfo.InvariantCulture) + ".xml";
- }
-
- DateTime ParseFileNameDate (string configuration, string fileName)
- {
- fileName = Path.GetFileNameWithoutExtension (fileName);
- fileName = fileName.Substring (storeId.Length + configuration.Length + 2);
- return DateTime.ParseExact (fileName, "yyyy-MM-dd", CultureInfo.InvariantCulture);
- }
-
- DateTime[] GetStoreDates (string configuration)
- {
- if (!Directory.Exists (basePath))
- return new DateTime [0];
-
- DateTime[] res = (DateTime[]) cachedRootList [configuration];
- if (res != null)
- return res;
-
- var dates = new List<DateTime> ();
- var escapedConfiguration = EscapeFilename (configuration);
- foreach (string file in Directory.GetFiles (basePath, storeId + "-" + escapedConfiguration + "-*")) {
- try {
- DateTime t = ParseFileNameDate (escapedConfiguration, Path.GetFileName (file));
- dates.Add (t);
- } catch { }
- }
- res = dates.ToArray ();
- cachedRootList [configuration] = res;
- return res;
- }
- }
-
- /// <summary>
- /// Encapsulates serialization/deserialization logic
- /// </summary>
- public interface IResultsStoreSerializer
- {
- /// <summary>
- /// Serialize the record into the specified path.
- /// </summary>
- void Serialize(string filePath, TestRecord testRecord);
-
- /// <summary>
- /// Deserialize the TestRecord from the sepcified path if possible.
- /// Return null if deserialization is impossible.
- /// </summary>
- TestRecord Deserialize(string filePath);
- }
-
- [Serializable]
- public class TestRecord
- {
- string name;
- UnitTestResultCollection results;
- TestRecordCollection tests;
- internal bool Modified;
-
- [XmlAttribute]
- public string Name {
- get { return name; }
- set { name = value; }
- }
-
- public UnitTestResultCollection Results {
- get { return results; }
- set { results = value; }
- }
-
- public TestRecordCollection Tests {
- get { return tests; }
- set { tests = value; }
- }
- }
-
- [Serializable]
- public class TestRecordCollection: CollectionBase
- {
- public new TestRecord this [int n] {
- get { return (TestRecord) ((IList)this) [n]; }
- }
-
- public new TestRecord this [string name] {
- get {
- for (int n=0; n<List.Count; n++)
- if (((TestRecord)List [n]).Name == name)
- return (TestRecord) List [n];
- return null;
- }
- }
-
- public void Add (TestRecord test)
- {
- ((IList)this).Add (test);
- }
- }
-
- [Serializable]
- public class UnitTestResultCollection: CollectionBase
- {
- public new UnitTestResult this [int n] {
- get { return (UnitTestResult) ((IList)this) [n]; }
- }
-
- public void Add (UnitTestResult test)
- {
- ((IList)this).Add (test);
- }
- }
-}
diff --git a/main/src/addins/NUnit/Services/BinaryResultsStore.cs b/main/src/addins/NUnit/Services/BinaryResultsStore.cs
deleted file mode 100644
index c6d0eca036..0000000000
--- a/main/src/addins/NUnit/Services/BinaryResultsStore.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-//
-// BinaryResultsStore.cs
-//
-// Author:
-// Sergey Khabibullin <sergey@khabibullin.com>
-//
-// Copyright (c) 2014 Sergey Khabibullin
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using ICSharpCode.NRefactory.Utils;
-using System.Xml.Serialization;
-using System.IO;
-
-namespace MonoDevelop.NUnit
-{
- /// <summary>
- /// ResultsStore implementation that uses binary serializer
- /// </summary>
- public class BinaryResultsStore : AbstractResultsStore
- {
- static BinaryResultsStoreSerializer serializer = new BinaryResultsStoreSerializer();
-
- public BinaryResultsStore (string directory, string storeId)
- : base(serializer, directory, storeId)
- {
- }
- }
-
- /// <summary>
- /// Serializer implementation that uses ICSharpCode.NRefactory.Utils.FastSerializer
- /// as it's main method to serialize test records. The serializer is backward compatible
- /// with the old xml-based serialization and will deserialize test record from xml
- /// if the binary form is not yet present.
- /// </summary>
- public class BinaryResultsStoreSerializer : IResultsStoreSerializer
- {
- const string binaryExtension = ".test-result";
- const string xmlExtension = ".xml";
-
- FastSerializer fastSerializer = new FastSerializer();
- XmlSerializer xmlSerializer = new XmlSerializer(typeof(TestRecord));
-
- public void Serialize (string xmlFilePath, TestRecord testRecord)
- {
- // no need for xml serialization because next time it will be
- // deserialized from the binary format
- string binaryFilePath = GetBinaryFilePath (xmlFilePath);
- using (var stream = File.OpenWrite(binaryFilePath)) {
- fastSerializer.Serialize (stream, testRecord);
- }
- }
-
- public TestRecord Deserialize (string xmlFilePath)
- {
- string binaryFilePath = GetBinaryFilePath (xmlFilePath);
-
- // deserialize from the binary format if the file exists
- if (File.Exists(binaryFilePath)) {
- using (var stream = File.OpenRead (binaryFilePath)) {
- return (TestRecord) fastSerializer.Deserialize (stream);
- }
- }
-
- // deserialize from xml if the file exists
- if (File.Exists(xmlFilePath)) {
- using (var reader = new StreamReader (xmlFilePath)) {
- return (TestRecord) xmlSerializer.Deserialize (reader);
- }
- }
-
- return null;
- }
-
- string GetBinaryFilePath(string xmlFilePath)
- {
- // filename with the binary extension
- return xmlFilePath.Substring (0, xmlFilePath.Length - xmlExtension.Length) + binaryExtension;
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/ExternalTestRunner.cs b/main/src/addins/NUnit/Services/ExternalTestRunner.cs
deleted file mode 100644
index ea9f51d972..0000000000
--- a/main/src/addins/NUnit/Services/ExternalTestRunner.cs
+++ /dev/null
@@ -1,423 +0,0 @@
-//
-// ExternalTestRunner.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Reflection;
-using System.IO;
-using System.Collections;
-using System.Collections.Generic;
-using System.Threading;
-using System.Text;
-
-using MonoDevelop.Core;
-using MonoDevelop.Core.Execution;
-using NUnit.Core;
-using NUnit.Util;
-using NF = NUnit.Framework;
-using NC = NUnit.Core;
-
-namespace MonoDevelop.NUnit.External
-{
- class ExternalTestRunner: RemoteProcessObject
- {
- NUnitTestRunner runner;
-
- public ExternalTestRunner ()
- {
- // In some cases MS.NET can't properly resolve assemblies even if they
- // are already loaded. For example, when deserializing objects from remoting.
- AppDomain.CurrentDomain.AssemblyResolve += delegate (object s, ResolveEventArgs args) {
- foreach (Assembly am in AppDomain.CurrentDomain.GetAssemblies ()) {
- if (am.GetName ().FullName == args.Name)
- return am;
- }
- return null;
- };
-
- // Add standard services to ServiceManager
- ServiceManager.Services.AddService (new DomainManager ());
- ServiceManager.Services.AddService (new ProjectService ());
- ServiceManager.Services.AddService (new AddinRegistry ());
- ServiceManager.Services.AddService (new AddinManager ());
- ServiceManager.Services.AddService (new TestAgency ());
-
- // Initialize services
- ServiceManager.Services.InitializeServices ();
-
- // Preload the runner assembly. Required because TestNameFilter is implemented there
- string asm = Path.Combine (Path.GetDirectoryName (GetType ().Assembly.Location), "NUnitRunner.dll");
- Assembly.LoadFrom (asm);
- }
-
- public UnitTestResult Run (IRemoteEventListener listener, ITestFilter filter, string path, string suiteName, List<string> supportAssemblies, string testRunnerType, string testRunnerAssembly, string crashLogFile)
- {
- NUnitTestRunner runner = GetRunner (path);
- EventListenerWrapper listenerWrapper = listener != null ? new EventListenerWrapper (listener) : null;
-
- UnhandledExceptionEventHandler exceptionHandler = (object sender, UnhandledExceptionEventArgs e) => {
-
- var ex = new RemoteUnhandledException ((Exception) e.ExceptionObject);
- File.WriteAllText (crashLogFile, ex.Serialize ());
- };
-
- AppDomain.CurrentDomain.UnhandledException += exceptionHandler;
- try {
- TestResult res = runner.Run (listenerWrapper, filter, path, suiteName, supportAssemblies, testRunnerType, testRunnerAssembly);
- return listenerWrapper.GetLocalTestResult (res);
- } finally {
- AppDomain.CurrentDomain.UnhandledException -= exceptionHandler;
- }
- }
-
- public NunitTestInfo GetTestInfo (string path, List<string> supportAssemblies)
- {
- NUnitTestRunner runner = GetRunner (path);
- return runner.GetTestInfo (path, supportAssemblies);
- }
-
- NUnitTestRunner GetRunner (string assemblyPath)
- {
- TestPackage package = new TestPackage (assemblyPath);
- package.Settings ["ShadowCopyFiles"] = false;
-
- AppDomain domain = Services.DomainManager.CreateDomain (package);
- string asm = Path.Combine (Path.GetDirectoryName (GetType ().Assembly.Location), "NUnitRunner.dll");
- runner = (NUnitTestRunner)domain.CreateInstanceFromAndUnwrap (asm, "MonoDevelop.NUnit.External.NUnitTestRunner");
- runner.PreloadAssemblies (typeof(NF.Assert).Assembly.Location, typeof (NC.TestSuiteBuilder).Assembly.Location, typeof(NC.Test).Assembly.Location);
- runner.Initialize ();
- return runner;
- }
- }
-
- class EventListenerWrapper: MarshalByRefObject, EventListener
- {
- IRemoteEventListener wrapped;
- StringBuilder consoleOutput;
- StringBuilder consoleError;
-
- public EventListenerWrapper (IRemoteEventListener wrapped)
- {
- this.wrapped = wrapped;
- }
-
- public void RunFinished (Exception exception)
- {
- }
-
- public void RunFinished (TestResult results)
- {
- }
-
- public void RunStarted (string name, int testCount)
- {
- }
-
- public void SuiteFinished (TestResult result)
- {
- wrapped.SuiteFinished (GetTestName (result.Test), GetLocalTestResult (result));
- }
-
- public void SuiteStarted (TestName suite)
- {
- wrapped.SuiteStarted (GetTestName (suite));
- }
-
- public void TestFinished (TestResult result)
- {
- wrapped.TestFinished (GetTestName (result.Test), GetLocalTestResult (result));
- }
-
- public void TestOutput (TestOutput testOutput)
- {
- if (consoleOutput == null) {
- Console.WriteLine (testOutput.Text);
- return;
- }
- else if (testOutput.Type == TestOutputType.Out)
- consoleOutput.Append (testOutput.Text);
- else
- consoleError.Append (testOutput.Text);
- }
-
- public void TestStarted (TestName testCase)
- {
- wrapped.TestStarted (GetTestName (testCase));
- consoleOutput = new StringBuilder ();
- consoleError = new StringBuilder ();
- }
-
- public override object InitializeLifetimeService ()
- {
- return null;
- }
-
- string GetTestName (ITest t)
- {
- if (t == null)
- return null;
- return t.TestName.FullName;
- }
-
- public string GetTestName (TestName t)
- {
- if (t == null)
- return null;
- return t.FullName;
- }
-
- public UnitTestResult GetLocalTestResult (TestResult t)
- {
-
- UnitTestResult res = new UnitTestResult ();
- var summary = new ResultSummarizer (t);
- res.Failures = summary.Failures;
- res.Errors = summary.Errors;
- res.Ignored = summary.Ignored;
- res.Inconclusive = summary.Inconclusive;
- res.NotRunnable = summary.NotRunnable;
- res.Passed = summary.Passed;
- res.StackTrace = t.StackTrace;
- res.Time = TimeSpan.FromSeconds (t.Time);
-
- res.Message = t.Message;
- if (string.IsNullOrEmpty (res.Message)) {
- if (res.IsFailure)
- res.Message = GettextCatalog.GetString ("Test failed");
- else if (!t.Executed)
- res.Message = GettextCatalog.GetString ("Test ignored");
- else {
- res.Message = GettextCatalog.GetString ("Test successful") + "\n\n";
- res.Message += GettextCatalog.GetString ("Execution time: {0:0.00}ms", t.Time);
- }
- }
-
- if (consoleOutput != null) {
- res.ConsoleOutput = consoleOutput.ToString ();
- res.ConsoleError = consoleError.ToString ();
- consoleOutput = null;
- consoleError = null;
- }
-
- return res;
- }
-
- public void UnhandledException (Exception exception)
- {
- }
- }
-
- interface IRemoteEventListener
- {
- void TestStarted (string testCase);
- void TestFinished (string test, UnitTestResult result);
- void SuiteStarted (string suite);
- void SuiteFinished (string suite, UnitTestResult result);
- }
-
- class LocalTestMonitor: MarshalByRefObject, IRemoteEventListener
- {
- TestContext context;
- UnitTest rootTest;
-// string rootFullName;
- UnitTest runningTest;
- bool singleTestRun;
- UnitTestResult singleTestResult;
- public bool Canceled;
-
- public LocalTestMonitor (TestContext context, UnitTest rootTest, string rootFullName, bool singleTestRun)
- {
-// this.rootFullName = rootFullName;
- this.rootTest = rootTest;
- this.context = context;
- this.singleTestRun = singleTestRun;
- }
-
- public UnitTest RunningTest {
- get { return runningTest; }
- }
-
- internal UnitTestResult SingleTestResult {
- get {
- if (singleTestResult == null)
- singleTestResult = new UnitTestResult ();
- return singleTestResult;
- }
- set {
- singleTestResult = value;
- }
- }
-
- void IRemoteEventListener.TestStarted (string testCase)
- {
- if (singleTestRun || Canceled)
- return;
-
- UnitTest t = GetLocalTest (testCase);
- if (t == null)
- return;
-
- runningTest = t;
- context.Monitor.BeginTest (t);
- t.Status = TestStatus.Running;
- }
-
- void IRemoteEventListener.TestFinished (string test, UnitTestResult result)
- {
- if (Canceled)
- return;
- if (singleTestRun) {
- SingleTestResult = result;
- return;
- }
-
- UnitTest t = GetLocalTest (test);
- if (t == null)
- return;
-
- t.RegisterResult (context, result);
- context.Monitor.EndTest (t, result);
- t.Status = TestStatus.Ready;
- runningTest = null;
- }
-
- void IRemoteEventListener.SuiteStarted (string suite)
- {
- if (singleTestRun || Canceled)
- return;
-
- UnitTest t = GetLocalTest (suite);
- if (t == null)
- return;
-
- t.Status = TestStatus.Running;
- context.Monitor.BeginTest (t);
- }
-
- void IRemoteEventListener.SuiteFinished (string suite, UnitTestResult result)
- {
- if (singleTestRun || Canceled)
- return;
-
- UnitTest t = GetLocalTest (suite);
- if (t == null)
- return;
-
- t.RegisterResult (context, result);
- t.Status = TestStatus.Ready;
- context.Monitor.EndTest (t, result);
- }
-
- UnitTest GetLocalTest (string sname)
- {
- if (sname == null)
- return null;
- if (sname == "<root>")
- return rootTest;
- /*
- if (sname.StartsWith (rootFullName)) {
- sname = sname.Substring (rootFullName.Length);
- }
- if (sname.StartsWith ("."))
- sname = sname.Substring (1);*/
- UnitTest tt = FindTest (rootTest, sname);
- return tt;
- }
-
- UnitTest FindTest (UnitTest t, string testPath)
- {
- var group = t as UnitTestGroup;
- if (group == null)
- return null;
- return SearchRecursive (group, testPath);
- }
-
- UnitTest SearchRecursive (UnitTestGroup group, string testPath)
- {
- UnitTest result;
- foreach (var t in group.Tests) {
- if (t.TestId == testPath)
- return t;
- var childGroup = t as UnitTestGroup;
- if (childGroup != null) {
- result = SearchRecursive (childGroup, testPath);
- if (result != null)
- return result;
- }
- }
- return null;
- }
-
- public override object InitializeLifetimeService ()
- {
- return null;
- }
- }
-
- /// <summary>
- /// Exception class that can be serialized
- /// </summary>
- class RemoteUnhandledException: Exception
- {
- string stack;
-
- public RemoteUnhandledException (string exceptionName, string message, string stack): base (message)
- {
- RemoteExceptionName = exceptionName;
- this.stack = stack;
- }
-
- public RemoteUnhandledException (Exception ex): base (ex.Message)
- {
- RemoteExceptionName = ex.GetType().Name;
- this.stack = ex.StackTrace;
- }
-
- public string Serialize ()
- {
- return RemoteExceptionName + "\n" + Message.Replace ('\r',' ').Replace ('\n',' ') + "\n" + StackTrace;
- }
-
- public static RemoteUnhandledException Parse (string s)
- {
- int i = s.IndexOf ('\n');
- string name = s.Substring (0, i++);
- int i2 = s.IndexOf ('\n', i);
- return new RemoteUnhandledException (name, s.Substring (i, i2 - i), s.Substring (i2 + 1));
- }
-
- public string RemoteExceptionName { get; set; }
-
- public override string StackTrace {
- get {
- return stack;
- }
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/GeneralTestOptions.cs b/main/src/addins/NUnit/Services/GeneralTestOptions.cs
deleted file mode 100644
index 59b9e1fb39..0000000000
--- a/main/src/addins/NUnit/Services/GeneralTestOptions.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// GeneralTestOptions.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections;
-
-namespace MonoDevelop.NUnit
-{
- public class GeneralTestOptions: ICloneable
- {
- public object Clone ()
- {
- return new GeneralTestOptions ();
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/IResultsStore.cs b/main/src/addins/NUnit/Services/IResultsStore.cs
deleted file mode 100644
index 4d6e69846e..0000000000
--- a/main/src/addins/NUnit/Services/IResultsStore.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// IResultsStore.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace MonoDevelop.NUnit
-{
- public interface IResultsStore
- {
- void RegisterResult (string configuration, UnitTest test, UnitTestResult result);
-
- UnitTestResult GetLastResult (string configuration, UnitTest test, DateTime date);
- UnitTestResult GetNextResult (string configuration, UnitTest test, DateTime date);
- UnitTestResult GetPreviousResult (string configuration, UnitTest test, DateTime date);
- UnitTestResult[] GetResults (string configuration, UnitTest test, DateTime startDate, DateTime endDate);
- UnitTestResult[] GetResultsToDate (string configuration, UnitTest test, DateTime endDate, int count);
-
- void Save ();
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/ITestProgressMonitor.cs b/main/src/addins/NUnit/Services/ITestProgressMonitor.cs
deleted file mode 100644
index 96fbc51e5f..0000000000
--- a/main/src/addins/NUnit/Services/ITestProgressMonitor.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// ITestProgressMonitor.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace MonoDevelop.NUnit
-{
- public interface ITestProgressMonitor
- {
- void BeginTest (UnitTest test);
- void EndTest (UnitTest test, UnitTestResult result);
- void ReportRuntimeError (string message, Exception exception);
- void WriteGlobalLog (string message);
-
- bool IsCancelRequested { get; }
- event TestHandler CancelRequested;
- }
-
- public delegate void TestHandler ();
-}
-
diff --git a/main/src/addins/NUnit/Services/ITestProvider.cs b/main/src/addins/NUnit/Services/ITestProvider.cs
deleted file mode 100644
index d02a417fb6..0000000000
--- a/main/src/addins/NUnit/Services/ITestProvider.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// ITestProvider.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using MonoDevelop.Projects;
-
-namespace MonoDevelop.NUnit
-{
- public interface ITestProvider
- {
- UnitTest CreateUnitTest (IWorkspaceObject entry);
- Type[] GetOptionTypes ();
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/NUnitAssemblyTestSuite.cs b/main/src/addins/NUnit/Services/NUnitAssemblyTestSuite.cs
deleted file mode 100644
index 2cff607204..0000000000
--- a/main/src/addins/NUnit/Services/NUnitAssemblyTestSuite.cs
+++ /dev/null
@@ -1,759 +0,0 @@
-//
-// NUnitAssemblyTestSuite.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Reflection;
-using System.IO;
-using System.Collections;
-using System.Collections.Generic;
-using System.Threading;
-using System.Runtime.Serialization.Formatters.Binary;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Core;
-using MonoDevelop.Core.Execution;
-using NUnit.Core;
-using NUnit.Core.Filters;
-using MonoDevelop.NUnit.External;
-using MonoDevelop.Ide;
-using System.Xml.Linq;
-using System.Linq;
-using System.Globalization;
-
-namespace MonoDevelop.NUnit
-{
- public abstract class NUnitAssemblyTestSuite: UnitTestGroup
- {
- object locker = new object ();
- UnitTest[] oldList;
- TestInfoCache testInfoCache = new TestInfoCache ();
- bool cacheLoaded;
- DateTime lastAssemblyTime;
-
- static Queue<LoadData> loadQueue = new Queue<LoadData> ();
- static bool loaderRunning;
-
- public virtual IList<string> UserAssemblyPaths {
- get {
- return null;
- }
- }
-
- public NUnitAssemblyTestSuite (string name): base (name)
- {
- }
-
- public NUnitAssemblyTestSuite (string name, SolutionItem ownerSolutionItem): base (name, ownerSolutionItem)
- {
- }
-
- public override void Dispose ()
- {
- try {
- if (TestInfoCachePath != null) {
- testInfoCache.Write (TestInfoCachePath);
- }
- } catch {
- }
- base.Dispose ();
- }
-
- public override bool HasTests {
- get {
- return true;
- }
- }
-
- public virtual void GetCustomTestRunner (out string assembly, out string type)
- {
- assembly = type = null;
- }
-
- public virtual void GetCustomConsoleRunner (out string command, out string args)
- {
- command = args = null;
- }
-
- ProcessExecutionCommand GetCustomConsoleRunnerCommand ()
- {
- string file, args;
-
- GetCustomConsoleRunner (out file, out args);
- file = file != null ? file.Trim () : null;
- if (string.IsNullOrEmpty (file))
- return null;
-
- var cmd = Runtime.ProcessService.CreateCommand (file);
- cmd.Arguments = args;
- return cmd;
- }
-
- protected override void OnActiveConfigurationChanged ()
- {
- UpdateTests ();
- base.OnActiveConfigurationChanged ();
- }
-
- internal SourceCodeLocation GetSourceCodeLocation (UnitTest test)
- {
- return GetSourceCodeLocation (test.FixtureTypeNamespace, test.FixtureTypeName, test.Name);
- }
-
- protected virtual SourceCodeLocation GetSourceCodeLocation (string fixtureTypeNamespace, string fixtureTypeName, string methodName)
- {
- return null;
- }
-
- public override int CountTestCases ()
- {
- lock (locker) {
- if (Status == TestStatus.Loading)
- Monitor.Wait (locker, 10000);
- }
- return base.CountTestCases ();
- }
-
- protected bool RefreshRequired {
- get {
- return lastAssemblyTime != GetAssemblyTime ();
- }
- }
-
- public override IAsyncOperation Refresh ()
- {
- AsyncOperation oper = new AsyncOperation ();
- System.Threading.ThreadPool.QueueUserWorkItem (delegate {
- lock (locker) {
- try {
- while (Status == TestStatus.Loading) {
- Monitor.Wait (locker);
- }
- if (RefreshRequired) {
- lastAssemblyTime = GetAssemblyTime ();
- UpdateTests ();
- OnCreateTests (); // Force loading
- while (Status == TestStatus.Loading) {
- Monitor.Wait (locker);
- }
- }
- oper.SetCompleted (true);
- } catch {
- oper.SetCompleted (false);
- }
- }
- });
- return oper;
- }
-
- DateTime GetAssemblyTime ()
- {
- string path = AssemblyPath;
- if (File.Exists (path))
- return File.GetLastWriteTime (path);
- else
- return DateTime.MinValue;
- }
-
-
- protected override void OnCreateTests ()
- {
- lock (locker) {
- if (Status == TestStatus.Loading)
- return;
-
- NunitTestInfo ti = testInfoCache.GetInfo (AssemblyPath);
- if (ti != null) {
- FillTests (ti);
- return;
- }
-
- Status = TestStatus.Loading;
- }
-
- lastAssemblyTime = GetAssemblyTime ();
-
- if (oldList != null) {
- foreach (UnitTest t in oldList)
- Tests.Add (t);
- }
-
- OnTestStatusChanged ();
-
- LoadData ld = new LoadData ();
- ld.Path = AssemblyPath;
- ld.TestInfoCachePath = cacheLoaded ? null : TestInfoCachePath;
- ld.Callback = delegate {
- DispatchService.GuiDispatch (delegate {
- AsyncCreateTests (ld);
- });
- };
- ld.SupportAssemblies = new List<string> (SupportAssemblies);
-
- AsyncLoadTest (ld);
-
- // Read the cache from disk only once
- cacheLoaded = true;
- }
-
- void AsyncCreateTests (object ob)
- {
- TestStatus newStatus = TestStatus.Ready;
-
- try {
- LoadData loadData = (LoadData) ob;
-
- if (loadData.Error != null) {
- newStatus = TestStatus.LoadError;
- return;
- }
-
- Tests.Clear ();
-
- if (loadData.Info == null) {
- oldList = new UnitTest [0];
- return;
- }
-
- FillTests (loadData.Info);
-
- // If the async loader has loaded a cache, reuse it.
- if (loadData.InfoCache != null)
- testInfoCache = loadData.InfoCache;
-
- testInfoCache.SetInfo (AssemblyPath, loadData.Info);
- }
- catch (Exception ex) {
- LoggingService.LogError (ex.ToString ());
- newStatus = TestStatus.LoadError;
- }
- finally {
- lock (locker) {
- Status = newStatus;
- Monitor.PulseAll (locker);
- }
- OnTestChanged ();
- }
- }
-
- void FillTests (NunitTestInfo ti)
- {
- if (ti.Tests == null)
- return;
- foreach (NunitTestInfo test in ti.Tests) {
- UnitTest newTest;
- if (test.Tests != null)
- newTest = new NUnitTestSuite (this, test);
- else
- newTest = new NUnitTestCase (this, test, test.PathName);
- newTest.FixtureTypeName = test.FixtureTypeName;
- newTest.FixtureTypeNamespace = test.FixtureTypeNamespace;
- Tests.Add (newTest);
-
- }
- oldList = new UnitTest [Tests.Count];
- Tests.CopyTo (oldList, 0);
- }
-
- static void AsyncLoadTest (LoadData ld)
- {
- lock (loadQueue) {
- if (!loaderRunning) {
- Thread t = new Thread (new ThreadStart (RunAsyncLoadTest));
- t.Name = "NUnit test loader";
- t.IsBackground = true;
- t.Start ();
- loaderRunning = true;
- }
- loadQueue.Enqueue (ld);
- Monitor.Pulse (loadQueue);
- }
- }
-
- static void RunAsyncLoadTest ()
- {
- while (true) {
- LoadData ld;
- lock (loadQueue) {
- if (loadQueue.Count == 0) {
- if (!Monitor.Wait (loadQueue, 5000, true)) {
- loaderRunning = false;
- return;
- }
- }
- ld = (LoadData)loadQueue.Dequeue ();
- }
-
- try {
- // If the information is cached in a file and it is up to date information,
- // there is no need to parse again the assembly.
-
- if (ld.TestInfoCachePath != null && File.Exists (ld.TestInfoCachePath)) {
- ld.InfoCache = TestInfoCache.Read (ld.TestInfoCachePath);
- NunitTestInfo info = ld.InfoCache.GetInfo (ld.Path);
- if (info != null) {
- ld.Info = info;
- ld.Callback (ld);
- continue;
- }
- }
- } catch (Exception ex) {
- LoggingService.LogError (ex.ToString ());
- }
-
- ExternalTestRunner runner = null;
-
- try {
- if (File.Exists (ld.Path)) {
- runner = (ExternalTestRunner)Runtime.ProcessService.CreateExternalProcessObject (typeof(ExternalTestRunner), false);
- ld.Info = runner.GetTestInfo (ld.Path, ld.SupportAssemblies);
- }
- } catch (Exception ex) {
- Console.WriteLine (ex);
- ld.Error = ex;
- }
- finally {
- try {
- if (runner != null)
- runner.Dispose ();
- } catch {}
- }
-
- try {
- ld.Callback (ld);
- } catch {
- }
- }
- }
-
- protected override UnitTestResult OnRun (TestContext testContext)
- {
- return RunUnitTest (this, "", "", null, testContext);
- }
-
- protected override bool OnCanRun (MonoDevelop.Core.Execution.IExecutionHandler executionContext)
- {
- var runnerCmd = GetCustomConsoleRunnerCommand ();
- if (runnerCmd != null) {
- return executionContext.CanExecute (runnerCmd);
- }
- return Runtime.ProcessService.IsValidForRemoteHosting (executionContext);
- }
-
- public string[] CollectTests (UnitTestGroup group)
- {
- List<string> result = new List<string> ();
- foreach (var t in group.Tests) {
- if (t.IsExplicit)
- continue;
- if (t is UnitTestGroup) {
- result.AddRange (CollectTests ((UnitTestGroup)t));
- } else {
- result.Add (t.TestId);
- }
- }
- return result.ToArray ();
- }
-
- internal UnitTestResult RunUnitTest (UnitTest test, string suiteName, string pathName, string testName, TestContext testContext)
- {
- var runnerExe = GetCustomConsoleRunnerCommand ();
- if (runnerExe != null)
- return RunWithConsoleRunner (runnerExe, test, suiteName, pathName, testName, testContext);
-
- ExternalTestRunner runner = (ExternalTestRunner)Runtime.ProcessService.CreateExternalProcessObject (typeof(ExternalTestRunner), testContext.ExecutionContext, UserAssemblyPaths);
- LocalTestMonitor localMonitor = new LocalTestMonitor (testContext, test, suiteName, testName != null);
-
- ITestFilter filter = null;
- if (test != null) {
- if (test is UnitTestGroup) {
- var categoryOptions = (NUnitCategoryOptions) test.GetOptions (typeof(NUnitCategoryOptions));
- if (categoryOptions.EnableFilter && categoryOptions.Categories.Count > 0) {
- string[] cats = new string [categoryOptions.Categories.Count];
- categoryOptions.Categories.CopyTo (cats, 0);
- filter = new CategoryFilter (cats);
- if (categoryOptions.Exclude)
- filter = new NotFilter (filter);
- } else {
- filter = new TestNameFilter (CollectTests ((UnitTestGroup)test));
- }
- } else {
- filter = new TestNameFilter (test.TestId);
- }
- }
-
- RunData rd = new RunData ();
- rd.Runner = runner;
- rd.Test = this;
- rd.LocalMonitor = localMonitor;
- testContext.Monitor.CancelRequested += new TestHandler (rd.Cancel);
-
- UnitTestResult result;
- var crashLogFile = Path.GetTempFileName ();
-
- try {
- if (string.IsNullOrEmpty (AssemblyPath)) {
- string msg = GettextCatalog.GetString ("Could not get a valid path to the assembly. There may be a conflict in the project configurations.");
- throw new Exception (msg);
- }
- System.Runtime.Remoting.RemotingServices.Marshal (localMonitor, null, typeof (IRemoteEventListener));
-
- string testRunnerAssembly, testRunnerType;
- GetCustomTestRunner (out testRunnerAssembly, out testRunnerType);
-
- result = runner.Run (localMonitor, filter, AssemblyPath, "", new List<string> (SupportAssemblies), testRunnerType, testRunnerAssembly, crashLogFile);
- if (testName != null)
- result = localMonitor.SingleTestResult;
-
- ReportCrash (testContext, crashLogFile);
-
- } catch (Exception ex) {
- if (ReportCrash (testContext, crashLogFile)) {
- result = UnitTestResult.CreateFailure (GettextCatalog.GetString ("Unhandled exception"), null);
- }
- else if (!localMonitor.Canceled) {
- LoggingService.LogError (ex.ToString ());
- if (localMonitor.RunningTest != null) {
- RuntimeErrorCleanup (testContext, localMonitor.RunningTest, ex);
- } else {
- testContext.Monitor.ReportRuntimeError (null, ex);
- throw;
- }
- result = UnitTestResult.CreateFailure (ex);
- } else {
- result = UnitTestResult.CreateFailure (GettextCatalog.GetString ("Canceled"), null);
- }
- } finally {
- File.Delete (crashLogFile);
- testContext.Monitor.CancelRequested -= new TestHandler (rd.Cancel);
- runner.Dispose ();
- System.Runtime.Remoting.RemotingServices.Disconnect (localMonitor);
- }
-
- return result;
- }
-
- bool ReportCrash (TestContext testContext, string crashLogFile)
- {
- var crash = File.ReadAllText (crashLogFile);
- if (crash.Length == 0)
- return false;
-
- var ex = RemoteUnhandledException.Parse (crash);
- testContext.Monitor.ReportRuntimeError (GettextCatalog.GetString ("Unhandled exception"), ex);
- return true;
- }
-
- void RuntimeErrorCleanup (TestContext testContext, UnitTest t, Exception ex)
- {
- UnitTestResult result = UnitTestResult.CreateFailure (ex);
- t.RegisterResult (testContext, result);
- while (t != null && t != this) {
- testContext.Monitor.EndTest (t, result);
- t.Status = TestStatus.Ready;
- t = t.Parent;
- }
- }
-
- UnitTestResult RunWithConsoleRunner (ProcessExecutionCommand cmd, UnitTest test, string suiteName, string pathName, string testName, TestContext testContext)
- {
- var outFile = Path.GetTempFileName ();
- LocalConsole cons = new LocalConsole ();
-
- try {
- MonoDevelop.NUnit.External.TcpTestListener tcpListener = null;
- LocalTestMonitor localMonitor = new LocalTestMonitor (testContext, test, suiteName, testName != null);
-
- if (!string.IsNullOrEmpty (cmd.Arguments))
- cmd.Arguments += " ";
- cmd.Arguments += "\"-xml=" + outFile + "\" " + AssemblyPath;
-
- bool automaticUpdates = cmd.Command != null && (cmd.Command.Contains ("GuiUnit") || (cmd.Command.Contains ("mdtool.exe") && cmd.Arguments.Contains ("run-md-tests")));
- if (!string.IsNullOrEmpty(pathName))
- cmd.Arguments += " -run=" + test.TestId;
- if (automaticUpdates) {
- tcpListener = new MonoDevelop.NUnit.External.TcpTestListener (localMonitor, suiteName);
- cmd.Arguments += " -port=" + tcpListener.Port;
- }
-
- // Note that we always dispose the tcp listener as we don't want it listening
- // forever if the test runner does not try to connect to it
- using (tcpListener) {
- using (var p = testContext.ExecutionContext.Execute (cmd, cons)) {
- testContext.Monitor.CancelRequested += p.Cancel;
- if (testContext.Monitor.IsCancelRequested)
- p.Cancel ();
- p.WaitForCompleted ();
- testContext.Monitor.CancelRequested -= p.Cancel;
- }
-
- if (new FileInfo (outFile).Length == 0)
- throw new Exception ("Command failed");
- }
-
- // mdtool.exe does not necessarily guarantee we get automatic updates. It just guarantees
- // that if guiunit is being used then it will give us updates. If you have a regular test
- // assembly compiled against nunit.framework.dll
- if (automaticUpdates && tcpListener.HasReceivedConnection) {
- if (testName != null)
- return localMonitor.SingleTestResult;
- return test.GetLastResult ();
- }
-
- XDocument doc = XDocument.Load (outFile);
-
- if (doc.Root != null) {
- var root = doc.Root.Elements ("test-suite").FirstOrDefault ();
- if (root != null) {
- cons.SetDone ();
- var ot = cons.Out.ReadToEnd ();
- var et = cons.Error.ReadToEnd ();
- testContext.Monitor.WriteGlobalLog (ot);
- if (!string.IsNullOrEmpty (et)) {
- testContext.Monitor.WriteGlobalLog ("ERROR:\n");
- testContext.Monitor.WriteGlobalLog (et);
- }
-
- bool macunitStyle = doc.Root.Element ("environment") != null && doc.Root.Element ("environment").Attribute ("macunit-version") != null;
- var result = ReportXmlResult (localMonitor, root, "", macunitStyle);
- if (testName != null)
- result = localMonitor.SingleTestResult;
- return result;
- }
- }
- throw new Exception ("Test results could not be parsed.");
- } catch (Exception ex) {
- cons.SetDone ();
- var ot = cons.Out.ReadToEnd ();
- var et = cons.Error.ReadToEnd ();
- testContext.Monitor.WriteGlobalLog (ot);
- if (!string.IsNullOrEmpty (et)) {
- testContext.Monitor.WriteGlobalLog ("ERROR:\n");
- testContext.Monitor.WriteGlobalLog (et);
- }
- testContext.Monitor.ReportRuntimeError ("Test execution failed.\n" + ot + "\n" + et, ex);
- return UnitTestResult.CreateIgnored ("Test execution failed");
- } finally {
- File.Delete (outFile);
- cons.Dispose ();
- }
- }
-
- UnitTestResult ReportXmlResult (IRemoteEventListener listener, XElement elem, string testPrefix, bool macunitStyle)
- {
- UnitTestResult result = new UnitTestResult ();
- var time = (string)elem.Attribute ("time");
- if (time != null)
- result.Time = TimeSpan.FromSeconds (double.Parse (time, CultureInfo.InvariantCulture));
- result.TestDate = DateTime.Now;
-
- var reason = elem.Element ("reason");
- if (reason != null)
- result.Message = (string) reason;
-
- var failure = elem.Element ("failure");
- if (failure != null) {
- var msg = failure.Element ("message");
- if (msg != null)
- result.Message = (string)msg;
- var stack = failure.Element ("stack-trace");
- if (stack != null)
- result.StackTrace = (string)stack;
- }
-
- switch ((string)elem.Attribute ("result")) {
- case "Error":
- case "Failure":
- result.Status = ResultStatus.Failure;
- break;
- case "Success":
- result.Status = ResultStatus.Success;
- break;
- case "Ignored":
- result.Status = ResultStatus.Ignored;
- break;
- default:
- result.Status = ResultStatus.Inconclusive;
- break;
- }
-
- if (elem.Name == "test-suite") {
- // nunitlite does not emit <test-suite type="Namespace" elements so we need to fake
- // them by deconstructing the full type name and emitting the suite started events manually
- var names = new List<string> ();
- if (!macunitStyle || (string)elem.Attribute ("type") == "Assembly")
- names.Add ("<root>");
- else
- names.AddRange (elem.Attribute ("name").Value.Split ('.'));
-
- for (int i = 0; i < names.Count; i ++)
- listener.SuiteStarted (testPrefix + string.Join (".", names.Take (i + 1)));
-
- var name = (string)elem.Attribute ("type") == "Assembly" ? "<root>" : (string) elem.Attribute ("name");
- var cts = elem.Element ("results");
- if (cts != null) {
- foreach (var ct in cts.Elements ()) {
- var r = ReportXmlResult (listener, ct, name != "<root>" ? testPrefix + name + "." : "", macunitStyle);
- result.Add (r);
- }
- }
- for (int i = 0; i < names.Count; i ++)
- listener.SuiteFinished (testPrefix + string.Join (".", names.Take (i + 1)), result);
- } else {
- string name = (string)elem.Attribute ("name");
- switch (result.Status) {
- case ResultStatus.Success:
- result.Passed++;
- break;
- case ResultStatus.Failure:
- result.Failures++;
- break;
- case ResultStatus.Ignored:
- result.Ignored++;
- break;
- case ResultStatus.Inconclusive:
- result.Inconclusive++;
- break;
- }
-
- listener.TestStarted (name);
- listener.TestFinished (name, result);
- }
- return result;
- }
-
- protected abstract string AssemblyPath {
- get;
- }
-
- protected virtual IEnumerable<string> SupportAssemblies {
- get { yield break; }
- }
-
- // File where cached test info for this test suite will be saved
- // Returns null by default which means that test info will not be saved.
- protected virtual string TestInfoCachePath {
- get { return null; }
- }
-
- class LoadData
- {
- public string Path;
- public string TestInfoCachePath;
- public Exception Error;
- public NunitTestInfo Info;
- public TestInfoCache InfoCache;
- public WaitCallback Callback;
- public List<string> SupportAssemblies;
- }
-
- class RunData
- {
- public ExternalTestRunner Runner;
- public UnitTest Test;
- public LocalTestMonitor LocalMonitor;
-
- public void Cancel ()
- {
- LocalMonitor.Canceled = true;
- Runner.Shutdown ();
- ClearRunningStatus (Test);
- }
-
- void ClearRunningStatus (UnitTest t)
- {
- t.Status = TestStatus.Ready;
- UnitTestGroup group = t as UnitTestGroup;
- if (group == null) return;
- foreach (UnitTest ct in group.Tests)
- ClearRunningStatus (ct);
- }
- }
-
- [Serializable]
- class TestInfoCache
- {
- Hashtable table = new Hashtable ();
-
- [NonSerialized]
- bool modified;
-
- public void SetInfo (string path, NunitTestInfo info)
- {
- if (File.Exists (path)) {
- CachedTestInfo cti = new CachedTestInfo ();
- cti.LastWriteTime = File.GetLastWriteTime (path);
- cti.Info = info;
- table [path] = cti;
- modified = true;
- }
- }
-
- public NunitTestInfo GetInfo (string path)
- {
- CachedTestInfo cti = (CachedTestInfo) table [path];
- if (cti != null && File.Exists (path) && File.GetLastWriteTime (path) == cti.LastWriteTime)
- return cti.Info;
- else
- return null;
- }
-
- public static TestInfoCache Read (string file)
- {
- BinaryFormatter bf = new BinaryFormatter ();
- Stream s = new FileStream (file, FileMode.Open, FileAccess.Read);
- try {
- return (TestInfoCache) bf.Deserialize (s);
- } finally {
- s.Close ();
- }
- }
-
- public void Write (string file)
- {
- if (modified) {
- BinaryFormatter bf = new BinaryFormatter ();
- Stream s = new FileStream (file, FileMode.Create, FileAccess.Write);
- try {
- bf.Serialize (s, this);
- } finally {
- s.Close ();
- }
- }
- }
- }
-
- [Serializable]
- class CachedTestInfo
- {
- public DateTime LastWriteTime;
- public NunitTestInfo Info;
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/NUnitOptions.cs b/main/src/addins/NUnit/Services/NUnitOptions.cs
deleted file mode 100644
index 277392bc17..0000000000
--- a/main/src/addins/NUnit/Services/NUnitOptions.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// NUnitCategoryOptions.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Text;
-using System.Collections;
-using System.Collections.Specialized;
-using MonoDevelop.Core.Serialization;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.NUnit
-{
- public class NUnitCategoryOptions: ICloneable
- {
- [ItemProperty ("Categories")]
- [ItemProperty ("Category", ValueType=typeof(string), Scope="*")]
- StringCollection categories = new StringCollection ();
-
- bool enableFilter;
- bool exclude;
-
- public StringCollection Categories {
- get { return categories; }
- }
-
- [ItemProperty]
- public bool EnableFilter {
- get { return enableFilter; }
- set { enableFilter = value; }
- }
-
- [ItemProperty]
- public bool Exclude {
- get { return exclude; }
- set { exclude = value; }
- }
-
- public object Clone ()
- {
- NUnitCategoryOptions op = new NUnitCategoryOptions ();
- op.enableFilter = enableFilter;
- op.exclude = exclude;
- op.categories = new StringCollection ();
- foreach (string s in categories)
- op.categories.Add (s);
- return op;
- }
-
- public override string ToString ()
- {
- if (EnableFilter && Categories.Count > 0) {
- StringBuilder s = new StringBuilder ();
- if (Exclude)
- s.Append (GettextCatalog.GetString ("Exclude the following categories: "));
- else
- s.Append (GettextCatalog.GetString ("Include the following categories: "));
- for (int n=0; n<Categories.Count; n++) {
- if (n > 0) s.Append (", ");
- s.Append (Categories [n]);
- }
- return s.ToString ();
- } else
- return "";
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/NUnitProjectServiceExtension.cs b/main/src/addins/NUnit/Services/NUnitProjectServiceExtension.cs
deleted file mode 100644
index d868a0fb66..0000000000
--- a/main/src/addins/NUnit/Services/NUnitProjectServiceExtension.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-// NUnitProjectServiceExtension.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using MonoDevelop.Core;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide;
-
-namespace MonoDevelop.NUnit
-{
- public class NUnitProjectServiceExtension: ProjectServiceExtension
- {
- public override void Execute (MonoDevelop.Core.IProgressMonitor monitor, IBuildTarget item, ExecutionContext context, ConfigurationSelector configuration)
- {
- if (base.CanExecute (item, context, configuration)) {
- // It is executable by default
- base.Execute(monitor, item, context, configuration);
- return;
- } else if (item is IWorkspaceObject) {
- UnitTest test = NUnitService.Instance.FindRootTest ((IWorkspaceObject)item);
- if (test != null) {
- IAsyncOperation oper = null;
- DispatchService.GuiSyncDispatch (delegate {
- oper = NUnitService.Instance.RunTest (test, context.ExecutionHandler, false, false);
- });
- if (oper != null) {
- monitor.CancelRequested += delegate {
- oper.Cancel ();
- };
- oper.WaitForCompleted ();
- }
- }
- }
- }
-
- public override bool CanExecute (IBuildTarget item, ExecutionContext context, ConfigurationSelector configuration)
- {
- // We check for DefaultExecutionHandlerFactory because the tests can't run using any other execution mode
-
- bool res = base.CanExecute (item, context, configuration);
- if (!res && (item is IWorkspaceObject)) {
- UnitTest test = NUnitService.Instance.FindRootTest ((IWorkspaceObject)item);
- return (test != null) && test.CanRun (context.ExecutionHandler);
- } else
- return res;
- }
- }
-}
diff --git a/main/src/addins/NUnit/Services/NUnitProjectTestSuite.cs b/main/src/addins/NUnit/Services/NUnitProjectTestSuite.cs
deleted file mode 100644
index db55aebcac..0000000000
--- a/main/src/addins/NUnit/Services/NUnitProjectTestSuite.cs
+++ /dev/null
@@ -1,193 +0,0 @@
-//
-// NUnitProjectTestSuite.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System.IO;
-using System.Linq;
-using System.Collections.Generic;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Ide;
-using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem;
-using System;
-using ProjectReference = MonoDevelop.Projects.ProjectReference;
-
-namespace MonoDevelop.NUnit
-{
- public class NUnitProjectTestSuite: NUnitAssemblyTestSuite
- {
- DotNetProject project;
- string resultsPath;
- string storeId;
-
- public override IList<string> UserAssemblyPaths {
- get {
- return project.GetUserAssemblyPaths (IdeApp.Workspace.ActiveConfiguration);
- }
- }
-
- public NUnitProjectTestSuite (DotNetProject project): base (project.Name, project)
- {
- storeId = Path.GetFileName (project.FileName);
- resultsPath = MonoDevelop.NUnit.RootTest.GetTestResultsDirectory (project.BaseDirectory);
- ResultsStore = new BinaryResultsStore (resultsPath, storeId);
- this.project = project;
- project.NameChanged += new SolutionItemRenamedEventHandler (OnProjectRenamed);
- IdeApp.ProjectOperations.EndBuild += new BuildEventHandler (OnProjectBuilt);
- }
-
- public static NUnitProjectTestSuite CreateTest (DotNetProject project)
- {
- if (!project.ParentSolution.GetConfiguration (IdeApp.Workspace.ActiveConfiguration).BuildEnabledForItem (project))
- return null;
-
- foreach (var p in project.References)
- if (IsNUnitReference (p))
- return new NUnitProjectTestSuite (project);
- return null;
- }
-
- public static bool IsNUnitReference (ProjectReference p)
- {
- return p.Reference.IndexOf ("GuiUnit", StringComparison.OrdinalIgnoreCase) != -1 || p.Reference.IndexOf ("nunit.framework") != -1 || p.Reference.IndexOf ("nunit.core") != -1 || p.Reference.IndexOf ("nunitlite") != -1;
- }
-
- protected override SourceCodeLocation GetSourceCodeLocation (string fixtureTypeNamespace, string fixtureTypeName, string methodName)
- {
- if (string.IsNullOrEmpty (fixtureTypeName) || string.IsNullOrEmpty (fixtureTypeName))
- return null;
- var ctx = TypeSystemService.GetCompilation (project);
- var cls = ctx.MainAssembly.GetTypeDefinition (fixtureTypeNamespace ?? "", fixtureTypeName, 0);
- if (cls == null)
- return null;
-
- if (cls.Name != methodName) {
- foreach (var met in cls.GetMethods ()) {
- if (met.Name == methodName)
- return new SourceCodeLocation (met.Region.FileName, met.Region.BeginLine, met.Region.BeginColumn);
- }
-
- int idx = methodName != null ? methodName.IndexOf ('(') : -1;
- if (idx > 0) {
- methodName = methodName.Substring (0, idx);
- foreach (var met in cls.GetMethods ()) {
- if (met.Name == methodName)
- return new SourceCodeLocation (met.Region.FileName, met.Region.BeginLine, met.Region.BeginColumn);
- }
- }
- }
- return new SourceCodeLocation (cls.Region.FileName, cls.Region.BeginLine, cls.Region.BeginColumn);
- }
-
- public override void Dispose ()
- {
- project.NameChanged -= new SolutionItemRenamedEventHandler (OnProjectRenamed);
- IdeApp.ProjectOperations.EndBuild -= new BuildEventHandler (OnProjectBuilt);
- base.Dispose ();
- }
-
- void OnProjectRenamed (object sender, SolutionItemRenamedEventArgs e)
- {
- UnitTestGroup parent = Parent as UnitTestGroup;
- if (parent != null)
- parent.UpdateTests ();
- }
-
- void OnProjectBuilt (object s, BuildEventArgs args)
- {
- if (RefreshRequired) {
- UpdateTests ();
- } else {
- Gtk.Application.Invoke (delegate {
- OnProjectBuiltWithoutTestChange (EventArgs.Empty);
- });
- }
- }
-
- public override void GetCustomTestRunner (out string assembly, out string type)
- {
- type = (string) project.ExtendedProperties ["TestRunnerType"];
- var asm = project.ExtendedProperties ["TestRunnerAssembly"];
- assembly = asm != null ? project.BaseDirectory.Combine (asm.ToString ()).ToString () : null;
- }
-
- public override void GetCustomConsoleRunner (out string command, out string args)
- {
- var r = project.ExtendedProperties ["TestRunnerCommand"];
- command = r != null ? project.BaseDirectory.Combine (r.ToString ()).ToString () : null;
- args = (string)project.ExtendedProperties ["TestRunnerArgs"];
- if (command == null && args == null) {
- var guiUnit = project.References.FirstOrDefault (pref => pref.ReferenceType == ReferenceType.Assembly && StringComparer.OrdinalIgnoreCase.Equals (Path.GetFileName (pref.Reference), "GuiUnit.exe"));
- if (guiUnit != null) {
- command = guiUnit.Reference;
- }
-
- var projectReference = project.References.FirstOrDefault (pref => pref.ReferenceType == ReferenceType.Project && pref.Reference.StartsWith ("GuiUnit", StringComparison.OrdinalIgnoreCase));
- if (IdeApp.IsInitialized && command == null && projectReference != null) {
- var guiUnitProject = IdeApp.Workspace.GetAllProjects ().First (f => f.Name == projectReference.Reference);
- if (guiUnitProject != null)
- command = guiUnitProject.GetOutputFileName (IdeApp.Workspace.ActiveConfiguration);
- }
- }
- }
-
- protected override string AssemblyPath {
- get { return project.GetOutputFileName (IdeApp.Workspace.ActiveConfiguration); }
- }
-
- protected override string TestInfoCachePath {
- get { return Path.Combine (resultsPath, storeId + ".test-cache"); }
- }
-
- protected override IEnumerable<string> SupportAssemblies {
- get {
- // Referenced assemblies which are not in the gac and which are not localy copied have to be preloaded
- DotNetProject project = base.OwnerSolutionItem as DotNetProject;
- if (project != null) {
- foreach (var pr in project.References) {
- if (pr.ReferenceType != ReferenceType.Package && !pr.LocalCopy && pr.ReferenceOutputAssembly) {
- foreach (string file in pr.GetReferencedFileNames (IdeApp.Workspace.ActiveConfiguration))
- yield return file;
- }
- }
- }
- }
- }
-
- public event EventHandler ProjectBuiltWithoutTestChange;
-
- protected virtual void OnProjectBuiltWithoutTestChange (EventArgs e)
- {
- var handler = ProjectBuiltWithoutTestChange;
- if (handler != null)
- handler (this, e);
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/NUnitService.cs b/main/src/addins/NUnit/Services/NUnitService.cs
deleted file mode 100644
index 0e6503fb8a..0000000000
--- a/main/src/addins/NUnit/Services/NUnitService.cs
+++ /dev/null
@@ -1,513 +0,0 @@
-//
-// NUnitService.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Threading;
-
-using MonoDevelop.Core;
-using MonoDevelop.Core.Execution;
-using Mono.Addins;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide;
-
-namespace MonoDevelop.NUnit
-{
- public class NUnitService
- {
- static NUnitService instance;
-
- ArrayList providers = new ArrayList ();
- UnitTest[] rootTests;
-
- private NUnitService ()
- {
- IdeApp.Workspace.WorkspaceItemOpened += OnWorkspaceChanged;
- IdeApp.Workspace.WorkspaceItemClosed += OnWorkspaceChanged;
- IdeApp.Workspace.ActiveConfigurationChanged += OnWorkspaceChanged;
-
- IdeApp.Workspace.ItemAddedToSolution += OnItemsChangedInSolution;;
- IdeApp.Workspace.ItemRemovedFromSolution += OnItemsChangedInSolution;
- IdeApp.Workspace.ReferenceAddedToProject += OnReferenceChangedInProject;;
- IdeApp.Workspace.ReferenceRemovedFromProject += OnReferenceChangedInProject;
-
- Mono.Addins.AddinManager.AddExtensionNodeHandler ("/MonoDevelop/NUnit/TestProviders", OnExtensionChange);
- }
-
- public static NUnitService Instance {
- get {
- if (instance == null) {
- instance = new NUnitService ();
- instance.RebuildTests ();
- }
- return instance;
- }
- }
-
- void OnExtensionChange (object s, ExtensionNodeEventArgs args)
- {
- if (args.Change == ExtensionChange.Add) {
- ProjectService ps = MonoDevelop.Projects.Services.ProjectService;
- ITestProvider provider = args.ExtensionObject as ITestProvider;
- providers.Add (provider);
-
- Type[] types = provider.GetOptionTypes ();
- if (types != null) {
- foreach (Type t in types) {
- if (!typeof(ICloneable).IsAssignableFrom (t)) {
- LoggingService.LogError ("Option types must implement ICloneable: " + t);
- continue;
- }
- ps.DataContext.IncludeType (t);
- }
- }
- }
- else {
- ITestProvider provider = args.ExtensionObject as ITestProvider;
- providers.Remove (provider);
-
- // The types returned by provider.GetOptionTypes should probably be unregistered
- // from the DataContext, but DataContext does not allow unregisterig.
- // This is not a big issue anyway.
- }
- }
-
- public IAsyncOperation RunTest (UnitTest test, IExecutionHandler context)
- {
- var result = RunTest (test, context, IdeApp.Preferences.BuildBeforeRunningTests);
- result.Completed += (OperationHandler) DispatchService.GuiDispatch (new OperationHandler (OnTestSessionCompleted));
- return result;
- }
-
- public IAsyncOperation RunTest (UnitTest test, IExecutionHandler context, bool buildOwnerObject)
- {
- return RunTest (test, context, buildOwnerObject, true);
- }
-
- internal IAsyncOperation RunTest (UnitTest test, IExecutionHandler context, bool buildOwnerObject, bool checkCurrentRunOperation)
- {
- string testName = test.FullName;
-
- if (buildOwnerObject) {
- IBuildTarget bt = test.OwnerObject as IBuildTarget;
- if (bt != null && bt.NeedsBuilding (IdeApp.Workspace.ActiveConfiguration)) {
- if (!IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted) {
- MonoDevelop.Ide.Commands.StopHandler.StopBuildOperations ();
- IdeApp.ProjectOperations.CurrentRunOperation.WaitForCompleted ();
- }
-
- AsyncOperation retOper = new AsyncOperation ();
-
- IAsyncOperation op = IdeApp.ProjectOperations.Build (bt);
- retOper.TrackOperation (op, false);
-
- op.Completed += delegate {
- // The completed event of the build operation is run in the gui thread,
- // so we need a new thread, because refreshing must be async
- System.Threading.ThreadPool.QueueUserWorkItem (delegate {
- if (op.Success) {
- RefreshTests ();
- test = SearchTest (testName);
- if (test != null) {
- Gtk.Application.Invoke (delegate {
- // RunTest must run in the gui thread
- retOper.TrackOperation (RunTest (test, context, false), true);
- });
- }
- else
- retOper.SetCompleted (false);
- }
- });
- };
-
- return retOper;
- }
- }
-
- if (checkCurrentRunOperation && !IdeApp.ProjectOperations.ConfirmExecutionOperation ())
- return NullProcessAsyncOperation.Failure;
-
- Pad resultsPad = IdeApp.Workbench.GetPad <TestResultsPad>();
- if (resultsPad == null) {
- resultsPad = IdeApp.Workbench.ShowPad (new TestResultsPad (), "MonoDevelop.NUnit.TestResultsPad", GettextCatalog.GetString ("Test results"), "Bottom", "md-solution");
- }
-
- // Make the pad sticky while the tests are runnig, so the results pad is always visible (even if minimized)
- // That's required since when running in debug mode, the layout is automatically switched to debug.
-
- resultsPad.Sticky = true;
- resultsPad.BringToFront ();
-
- TestSession session = new TestSession (test, context, (TestResultsPad) resultsPad.Content);
-
- session.Completed += delegate {
- Gtk.Application.Invoke (delegate {
- resultsPad.Sticky = false;
- });
- };
-
- OnTestSessionStarting (new TestSessionEventArgs { Session = session, Test = test });
-
- session.Start ();
-
- if (checkCurrentRunOperation)
- IdeApp.ProjectOperations.CurrentRunOperation = session;
-
- return session;
- }
-
- public void RefreshTests ()
- {
- foreach (UnitTest t in RootTests)
- t.Refresh ().WaitForCompleted ();
- }
-
- public UnitTest SearchTest (string fullName)
- {
- foreach (UnitTest t in RootTests) {
- UnitTest r = SearchTest (t, fullName);
- if (r != null)
- return r;
- }
- return null;
- }
-
- public UnitTest SearchTestById (string id)
- {
- foreach (UnitTest t in RootTests) {
- UnitTest r = SearchTestById (t, id);
- if (r != null)
- return r;
- }
- return null;
- }
-
-
- UnitTest SearchTest (UnitTest test, string fullName)
- {
- if (test == null)
- return null;
- if (test.FullName == fullName)
- return test;
-
- UnitTestGroup group = test as UnitTestGroup;
- if (group != null) {
- foreach (UnitTest t in group.Tests) {
- UnitTest result = SearchTest (t, fullName);
- if (result != null)
- return result;
- }
- }
- return null;
- }
-
- UnitTest SearchTestById (UnitTest test, string id)
- {
- if (test == null)
- return null;
- if (test.TestId == id)
- return test;
-
- UnitTestGroup group = test as UnitTestGroup;
- if (group != null) {
- foreach (UnitTest t in group.Tests) {
- UnitTest result = SearchTestById (t, id);
- if (result != null)
- return result;
- }
- }
- return null;
- }
-
- public UnitTest FindRootTest (IWorkspaceObject item)
- {
- return FindRootTest (RootTests, item);
- }
-
- public UnitTest FindRootTest (IEnumerable<UnitTest> tests, IWorkspaceObject item)
- {
- foreach (UnitTest t in tests) {
- if (t.OwnerObject == item)
- return t;
- UnitTestGroup tg = t as UnitTestGroup;
- if (tg != null) {
- UnitTest ct = FindRootTest (tg.Tests, item);
- if (ct != null)
- return ct;
- }
- }
- return null;
- }
-
- void OnWorkspaceChanged (object sender, EventArgs e)
- {
- RebuildTests ();
- }
-
- void OnReferenceChangedInProject (object sender, ProjectReferenceEventArgs e)
- {
- if (!IsSolutionGroupPresent (e.Project.ParentSolution, rootTests))
- RebuildTests ();
- }
-
- void OnItemsChangedInSolution (object sender, SolutionItemChangeEventArgs e)
- {
- if (!IsSolutionGroupPresent (e.Solution, rootTests))
- RebuildTests ();
- }
-
- bool IsSolutionGroupPresent (Solution sol, IEnumerable<UnitTest> tests)
- {
- foreach (var t in tests) {
- var tg = t as SolutionFolderTestGroup;
- if (tg != null && ((SolutionFolder)tg.OwnerObject).ParentSolution == sol)
- return true;
- var g = t as UnitTestGroup;
- if (g != null && g.HasTests) {
- if (IsSolutionGroupPresent (sol, g.Tests))
- return true;
- }
- }
- return false;
- }
-
- void RebuildTests ()
- {
- if (rootTests != null) {
- foreach (IDisposable t in rootTests)
- t.Dispose ();
- }
-
- List<UnitTest> list = new List<UnitTest> ();
- foreach (WorkspaceItem it in IdeApp.Workspace.Items) {
- UnitTest t = BuildTest (it);
- if (t != null)
- list.Add (t);
- }
-
- rootTests = list.ToArray ();
- NotifyTestSuiteChanged ();
- }
-
- public UnitTest BuildTest (IWorkspaceObject entry)
- {
- foreach (ITestProvider p in providers) {
- try {
- UnitTest t = p.CreateUnitTest (entry);
- if (t != null)
- return t;
- } catch {
- }
- }
- return null;
- }
-
- public UnitTest[] RootTests {
- get { return rootTests; }
- }
-
- public static void ShowOptionsDialog (UnitTest test)
- {
- Properties properties = new Properties ();
- properties.Set ("UnitTest", test);
- using (var dlg = new UnitTestOptionsDialog (IdeApp.Workbench.RootWindow, properties))
- MessageService.ShowCustomDialog (dlg);
- }
-
- void NotifyTestSuiteChanged ()
- {
- if (TestSuiteChanged != null)
- TestSuiteChanged (this, EventArgs.Empty);
- }
-
- public static void ResetResult (UnitTest test)
- {
- if (test == null)
- return;
- test.ResetLastResult ();
- UnitTestGroup group = test as UnitTestGroup;
- if (group == null)
- return;
- foreach (UnitTest t in new List<UnitTest> (group.Tests))
- ResetResult (t);
- }
-
- public event EventHandler TestSuiteChanged;
-
- void OnTestSessionCompleted (IAsyncOperation op)
- {
- var handler = TestSessionCompleted;
- if (handler != null)
- handler (this, EventArgs.Empty);
- }
-
- public event EventHandler TestSessionCompleted;
-
- void OnTestSessionStarting (TestSessionEventArgs args)
- {
- if (TestSessionStarting != null)
- TestSessionStarting (this, args);
- }
-
- /// <summary>
- /// Occurs just before a test session is started
- /// </summary>
- public event EventHandler<TestSessionEventArgs> TestSessionStarting;
- }
-
-
-
- class TestSession: IAsyncOperation, ITestProgressMonitor
- {
- UnitTest test;
- TestMonitor monitor;
- Thread runThread;
- bool success;
- ManualResetEvent waitEvent;
- IExecutionHandler context;
- TestResultsPad resultsPad;
-
- public TestSession (UnitTest test, IExecutionHandler context, TestResultsPad resultsPad)
- {
- this.test = test;
- this.context = context;
- this.monitor = new TestMonitor (resultsPad);
- this.resultsPad = resultsPad;
- resultsPad.InitializeTestRun (test);
- }
-
- public void Start ()
- {
- runThread = new Thread (new ThreadStart (RunTests));
- runThread.Name = "NUnit test runner";
- runThread.IsBackground = true;
- runThread.Start ();
- }
-
- void RunTests ()
- {
- try {
- NUnitService.ResetResult (test);
-
- TestContext ctx = new TestContext (monitor, resultsPad, context, DateTime.Now);
- test.Run (ctx);
- test.SaveResults ();
- success = true;
- } catch (Exception ex) {
- LoggingService.LogError (ex.ToString ());
- monitor.ReportRuntimeError (null, ex);
- success = false;
- } finally {
- monitor.FinishTestRun ();
- runThread = null;
- }
- lock (this) {
- if (waitEvent != null)
- waitEvent.Set ();
- }
- if (Completed != null)
- Completed (this);
- }
-
- void ITestProgressMonitor.BeginTest (UnitTest test)
- {
- monitor.BeginTest (test);
- }
-
- void ITestProgressMonitor.EndTest (UnitTest test, UnitTestResult result)
- {
- monitor.EndTest (test, result);
- }
-
- void ITestProgressMonitor.ReportRuntimeError (string message, Exception exception)
- {
- monitor.ReportRuntimeError (message, exception);
- }
-
- void ITestProgressMonitor.WriteGlobalLog (string message)
- {
- monitor.WriteGlobalLog (message);
- }
-
- bool ITestProgressMonitor.IsCancelRequested {
- get { return monitor.IsCancelRequested; }
- }
-
- void IAsyncOperation.Cancel ()
- {
- monitor.Cancel ();
- }
-
- public void WaitForCompleted ()
- {
- if (IsCompleted) return;
-
- if (DispatchService.IsGuiThread) {
- while (!IsCompleted) {
- while (Gtk.Application.EventsPending ())
- Gtk.Application.RunIteration ();
- Thread.Sleep (100);
- }
- } else {
- lock (this) {
- if (waitEvent == null)
- waitEvent = new ManualResetEvent (false);
- }
- waitEvent.WaitOne ();
- }
- }
-
- public bool IsCompleted {
- get { return runThread == null; }
- }
-
- public bool Success {
- get { return success; }
- }
-
- public bool SuccessWithWarnings {
- get { return false; }
- }
-
- public event OperationHandler Completed;
-
- public event TestHandler CancelRequested {
- add { monitor.CancelRequested += value; }
- remove { monitor.CancelRequested -= value; }
- }
- }
-
- public class TestSessionEventArgs: EventArgs
- {
- public IAsyncOperation Session { get; set; }
- public UnitTest Test { get; set; }
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/NUnitTestCase.cs b/main/src/addins/NUnit/Services/NUnitTestCase.cs
deleted file mode 100644
index 1a774892fc..0000000000
--- a/main/src/addins/NUnit/Services/NUnitTestCase.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// NUnitTestCase.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-
-using MonoDevelop.NUnit.External;
-
-namespace MonoDevelop.NUnit
-{
- class NUnitTestCase: UnitTest
- {
- NUnitAssemblyTestSuite rootSuite;
- string className;
- string pathName;
-
- public NUnitTestCase (NUnitAssemblyTestSuite rootSuite, NunitTestInfo tinfo, string className) : base (tinfo.Name)
- {
- this.className = className;
- this.pathName = tinfo.PathName;
- this.rootSuite = rootSuite;
- this.TestId = tinfo.TestId;
- this.IsExplicit = tinfo.IsExplicit;
- }
-
- protected override UnitTestResult OnRun (TestContext testContext)
- {
- return rootSuite.RunUnitTest (this, className, pathName, Name, testContext);
- }
-
- protected override bool OnCanRun (MonoDevelop.Core.Execution.IExecutionHandler executionContext)
- {
- return rootSuite.CanRun (executionContext);
- }
-
-
- public override SourceCodeLocation SourceCodeLocation {
- get {
- UnitTest p = Parent;
- while (p != null) {
- NUnitAssemblyTestSuite root = p as NUnitAssemblyTestSuite;
- if (root != null)
- return root.GetSourceCodeLocation (this);
- p = p.Parent;
- }
- return null;
- }
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/NUnitTestSuite.cs b/main/src/addins/NUnit/Services/NUnitTestSuite.cs
deleted file mode 100644
index 74d3a26e4b..0000000000
--- a/main/src/addins/NUnit/Services/NUnitTestSuite.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// NUnitTestSuite.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using MonoDevelop.NUnit.External;
-
-namespace MonoDevelop.NUnit
-{
- class NUnitTestSuite: UnitTestGroup
- {
- NunitTestInfo testInfo;
- NUnitAssemblyTestSuite rootSuite;
- string fullName;
-
- public NUnitTestSuite (NUnitAssemblyTestSuite rootSuite, NunitTestInfo tinfo): base (tinfo.Name)
- {
- fullName = !string.IsNullOrEmpty (tinfo.PathName) ? tinfo.PathName + "." + tinfo.Name : tinfo.Name;
- this.testInfo = tinfo;
- this.rootSuite = rootSuite;
- this.TestId = tinfo.TestId;
- }
-
- public override bool HasTests {
- get {
- return true;
- }
- }
-
- public string ClassName {
- get { return fullName; }
- }
-
- protected override UnitTestResult OnRun (TestContext testContext)
- {
- return rootSuite.RunUnitTest (this, fullName, fullName, null, testContext);
- }
-
- protected override bool OnCanRun (MonoDevelop.Core.Execution.IExecutionHandler executionContext)
- {
- return rootSuite.CanRun (executionContext);
- }
-
-
- protected override void OnCreateTests ()
- {
- if (testInfo.Tests == null)
- return;
-
- foreach (NunitTestInfo test in testInfo.Tests) {
- UnitTest newTest;
- if (test.Tests != null)
- newTest = new NUnitTestSuite (rootSuite, test);
- else
- newTest = new NUnitTestCase (rootSuite, test, ClassName);
- newTest.FixtureTypeName = test.FixtureTypeName;
- newTest.FixtureTypeNamespace = test.FixtureTypeNamespace;
- Tests.Add (newTest);
- }
- }
-
- public override SourceCodeLocation SourceCodeLocation {
- get {
- UnitTest p = Parent;
- while (p != null) {
- NUnitAssemblyTestSuite root = p as NUnitAssemblyTestSuite;
- if (root != null)
- return root.GetSourceCodeLocation (this);
- p = p.Parent;
- }
- return null;
- }
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/SolutionFolderTestGroup.cs b/main/src/addins/NUnit/Services/SolutionFolderTestGroup.cs
deleted file mode 100644
index 25f8370524..0000000000
--- a/main/src/addins/NUnit/Services/SolutionFolderTestGroup.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-// CombineTestGroup.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Collections;
-using MonoDevelop.Core;
-using MonoDevelop.Projects;
-
-using MonoDevelop.Ide.TypeSystem;
-using MonoDevelop.Ide;
-
-namespace MonoDevelop.NUnit
-{
- public class SolutionFolderTestGroup: UnitTestGroup
- {
- SolutionFolder folder;
-
- public SolutionFolderTestGroup (SolutionFolder c): base (c.Name, c)
- {
- string storeId = c.ItemId;
- string resultsPath = MonoDevelop.NUnit.RootTest.GetTestResultsDirectory (c.BaseDirectory);
- ResultsStore = new BinaryResultsStore (resultsPath, storeId);
-
- folder = c;
- folder.NameChanged += OnCombineRenamed;
-
- if (c.IsRoot) {
- folder.ParentSolution.SolutionItemAdded += OnEntryChanged;
- folder.ParentSolution.SolutionItemRemoved += OnEntryChanged;
- IdeApp.Workspace.ReferenceAddedToProject += OnReferenceChanged;
- IdeApp.Workspace.ReferenceRemovedFromProject += OnReferenceChanged;
- }
- }
-
- public static SolutionFolderTestGroup CreateTest (SolutionFolder c)
- {
- return new SolutionFolderTestGroup (c);
- }
-
- public override void Dispose ()
- {
- folder.NameChanged -= OnCombineRenamed;
- if (folder.IsRoot) {
- folder.ParentSolution.SolutionItemAdded -= OnEntryChanged;
- folder.ParentSolution.SolutionItemRemoved -= OnEntryChanged;
- IdeApp.Workspace.ReferenceAddedToProject -= OnReferenceChanged;
- IdeApp.Workspace.ReferenceRemovedFromProject -= OnReferenceChanged;
- }
- base.Dispose ();
- }
-
- void OnReferenceChanged (object s, ProjectReferenceEventArgs args)
- {
- if (args.Project.ParentSolution == folder.ParentSolution && NUnitProjectTestSuite.IsNUnitReference (args.ProjectReference))
- UpdateTests ();
- }
-
- void OnEntryChanged (object sender, SolutionItemEventArgs e)
- {
- UpdateTests ();
- }
-
- void OnCombineRenamed (object sender, SolutionItemRenamedEventArgs e)
- {
- UnitTestGroup parent = Parent as UnitTestGroup;
- if (parent != null)
- parent.UpdateTests ();
- }
-
- protected override void OnCreateTests ()
- {
- NUnitService testService = NUnitService.Instance;
- foreach (SolutionItem e in folder.Items) {
- UnitTest t = testService.BuildTest (e);
- if (t != null)
- Tests.Add (t);
- }
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/SystemTestProvider.cs b/main/src/addins/NUnit/Services/SystemTestProvider.cs
deleted file mode 100644
index 311926ae21..0000000000
--- a/main/src/addins/NUnit/Services/SystemTestProvider.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// SystemTestProvider.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using MonoDevelop.Projects;
-
-namespace MonoDevelop.NUnit
-{
- public class SystemTestProvider: ITestProvider
- {
- public UnitTest CreateUnitTest (IWorkspaceObject entry)
- {
- UnitTest test = null;
-
- if (entry is SolutionFolder)
- test = SolutionFolderTestGroup.CreateTest ((SolutionFolder)entry);
- if (entry is Solution)
- test = SolutionFolderTestGroup.CreateTest (((Solution)entry).RootFolder);
- if (entry is Workspace)
- test = WorkspaceTestGroup.CreateTest ((Workspace)entry);
- if (entry is DotNetProject)
- test = NUnitProjectTestSuite.CreateTest ((DotNetProject)entry);
- if (entry is NUnitAssemblyGroupProject)
- test = ((NUnitAssemblyGroupProject)entry).RootTest;
-
- UnitTestGroup grp = test as UnitTestGroup;
- if (grp != null && !grp.HasTests)
- return null;
-
- return test;
- }
-
- public Type[] GetOptionTypes ()
- {
- return new Type[] {
- typeof(GeneralTestOptions),
- typeof(NUnitCategoryOptions)
- };
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/TcpTestListener.cs b/main/src/addins/NUnit/Services/TcpTestListener.cs
deleted file mode 100644
index cf2f57ffd5..0000000000
--- a/main/src/addins/NUnit/Services/TcpTestListener.cs
+++ /dev/null
@@ -1,217 +0,0 @@
-//
-// TcpTestListener.cs
-//
-// Author:
-// Alan McGovern <alan.mcgovern@gmail.com>
-//
-// Copyright (c) 2013 Alan McGovern
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Net;
-using System.Net.Sockets;
-using MonoDevelop.NUnit.External;
-using System.IO;
-using System.Text;
-using System.Threading.Tasks;
-using System.Xml.Linq;
-using System.Collections.Generic;
-using System.Linq;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.NUnit.External
-{
- class TcpTestListener : IDisposable
- {
- string testSuiteName;
- string rootTestName;
-
- public bool HasReceivedConnection {
- get; private set;
- }
-
- List<Tuple<string,UnitTestResult>> suiteStack = new List<Tuple<string, UnitTestResult>> ();
- IRemoteEventListener listener;
-
- TcpListener TcpListener {
- get; set;
- }
-
- public int Port {
- get { return ((IPEndPoint) TcpListener.LocalEndpoint).Port; }
- }
-
-
- public TcpTestListener (IRemoteEventListener listener, string suiteName)
- {
- this.testSuiteName = suiteName;
- this.listener = listener;
- bool rootSuiteStarted = false;
-
- TcpListener = new TcpListener (new IPEndPoint (IPAddress.Loopback, 0));
- TcpListener.Start ();
- Task.Factory.StartNew (() => {
- try {
- using (var client = TcpListener.AcceptTcpClient ())
- using (var socketStream = client.GetStream ())
- using (var reader = new StreamReader (socketStream, Encoding.UTF8)) {
-
- HasReceivedConnection = true;
- string line = null;
- while ((line = reader.ReadLine ()) != null) {
- var element = XElement.Parse (line);
- string testName = element.Attribute ("name").Value;
- var action = element.Name.LocalName;
-
- if (testSuiteName.Length == 0 && !rootSuiteStarted) {
- // Running the whole assembly
- rootTestName = testName;
- rootSuiteStarted = true;
- continue;
- }
- if (testSuiteName == testName && !rootSuiteStarted) {
- // Running a test suite
- rootTestName = testName;
- rootSuiteStarted = true;
- listener.SuiteStarted ("<root>");
- continue;
- }
-
- if (!rootSuiteStarted)
- continue;
-
- switch (action) {
- case "suite-started":
- UpdateTestSuiteStatus (testName, false); break;
- case "test-started":
- UpdateTestSuiteStatus (testName, true);
- listener.TestStarted (testName); break;
- case "test-finished":
- var res = CreateResult (element);
- AddTestResult (res);
- listener.TestFinished (testName, res); break;
- case "suite-finished":
- if (testName == rootTestName) {
- FinishSuites (0);
- listener.SuiteFinished ("<root>", CreateResult (element));
- rootSuiteStarted = false;
- }
- break;
- }
- }
- }
- } catch (Exception ex) {
- LoggingService.LogError ("Exception in test listener", ex);
- } finally {
- TcpListener.Stop ();
- }
- });
- }
-
- public void Dispose ()
- {
- TcpListener.Stop ();
- }
-
- void UpdateTestSuiteStatus (string name, bool isTest)
- {
- if (testSuiteName.Length > 0)
- name = name.Substring (testSuiteName.Length + 1);
- string[] parts = name.Split ('.');
- int len = isTest ? parts.Length - 1 : parts.Length;
- for (int n = 0; n < len; n++) {
- if (n >= suiteStack.Count) {
- StartSuite (parts[n]);
- } else if (parts [n] != suiteStack [n].Item1) {
- FinishSuites (n);
- StartSuite (parts[n]);
- }
- }
- }
-
- void FinishSuites (int stackLevel)
- {
- if (stackLevel + 1 < suiteStack.Count)
- FinishSuites (stackLevel + 1);
-
- if (stackLevel >= suiteStack.Count)
- return;
-
- var tname = GetTestSuiteName (stackLevel);
- var res = suiteStack [stackLevel].Item2;
-
- suiteStack.RemoveAt (stackLevel);
-
- listener.SuiteFinished (tname, res);
- }
-
- void StartSuite (string name)
- {
- suiteStack.Add (new Tuple<string, UnitTestResult> (name, new UnitTestResult ()));
- name = GetTestSuiteName (suiteStack.Count - 1);
- listener.SuiteStarted (name);
- }
-
- void AddTestResult (UnitTestResult res)
- {
- foreach (var r in suiteStack)
- r.Item2.Add (res);
- }
-
- string GetTestSuiteName (int stackLevel)
- {
- var info = suiteStack [stackLevel];
-
- string name;
- if (stackLevel > 0) {
- var prefix = string.Join (".", suiteStack.Select (s => s.Item1).Take (stackLevel));
- name = prefix + "." + info.Item1;
- } else
- name = info.Item1;
-
- if (testSuiteName.Length > 0)
- name = testSuiteName + "." + name;
- return name;
- }
-
- UnitTestResult CreateResult (XElement element)
- {
- var result = (ResultStatus)Enum.Parse (typeof(ResultStatus), element.Attribute ("result").Value);
- var passed = int.Parse (element.Attribute ("passed").Value);
- var failures = int.Parse (element.Attribute ("failures").Value);
- var ignored = int.Parse (element.Attribute ("ignored").Value);
- var inconclusive = int.Parse (element.Attribute ("inconclusive").Value);
-
- var message = (string)element.Attribute ("message");
- var stackTrace = (string)element.Attribute ("stack-trace");
-
- return new UnitTestResult {
- Status = result,
- Passed = passed,
- Failures = failures,
- Ignored = ignored,
- Inconclusive = inconclusive,
- Message = message,
- StackTrace = stackTrace
- };
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/TestContext.cs b/main/src/addins/NUnit/Services/TestContext.cs
deleted file mode 100644
index 0955714d6c..0000000000
--- a/main/src/addins/NUnit/Services/TestContext.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// TestContext.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using MonoDevelop.Core;
-using MonoDevelop.Core.Execution;
-using MonoDevelop.Projects;
-
-namespace MonoDevelop.NUnit
-{
- public class TestContext
- {
- ITestProgressMonitor monitor;
- DateTime testDate;
- object contextData;
- IExecutionHandler executionContext;
-
- public TestContext (ITestProgressMonitor monitor, TestResultsPad resultsPad, IExecutionHandler executionContext, DateTime testDate)
- {
- this.monitor = monitor;
- if (executionContext == null)
- executionContext = Runtime.ProcessService.DefaultExecutionHandler;
- this.executionContext = executionContext;
- // Round to seconds
- this.testDate = new DateTime ((testDate.Ticks / TimeSpan.TicksPerSecond) * TimeSpan.TicksPerSecond);
- }
-
- public ITestProgressMonitor Monitor {
- get { return monitor; }
- }
-
- public DateTime TestDate {
- get { return testDate; }
- }
-
- public object ContextData {
- get { return contextData; }
- set { contextData = value; }
- }
-
- public IExecutionHandler ExecutionContext {
- get { return executionContext; }
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/UnitTest.cs b/main/src/addins/NUnit/Services/UnitTest.cs
deleted file mode 100644
index d1739df74e..0000000000
--- a/main/src/addins/NUnit/Services/UnitTest.cs
+++ /dev/null
@@ -1,672 +0,0 @@
-//
-// UnitTest.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections;
-using MonoDevelop.Core;
-using MonoDevelop.Core.ProgressMonitoring;
-using MonoDevelop.Projects;
-using MonoDevelop.Core.Serialization;
-using MonoDevelop.Core.Execution;
-
-namespace MonoDevelop.NUnit
-{
- public abstract class UnitTest: IDisposable
- {
- string name;
- IResultsStore resultsStore;
- UnitTestResult lastResult;
- UnitTest parent;
- TestStatus status;
- Hashtable options;
- IWorkspaceObject ownerSolutionItem;
- SolutionEntityItem ownerSolutionEntityItem;
- UnitTestResultsStore results;
- bool historicResult;
- bool resultLoaded;
-
- public string FixtureTypeNamespace {
- get;
- set;
- }
-
- public string FixtureTypeName {
- get;
- set;
- }
-
- public bool IsExplicit {
- get;
- set;
- }
-
- protected UnitTest (string name)
- {
- this.name = name;
- }
-
- protected UnitTest (string name, IWorkspaceObject ownerSolutionItem)
- {
- this.name = name;
- this.ownerSolutionItem = ownerSolutionItem;
- ownerSolutionEntityItem = ownerSolutionItem as SolutionEntityItem;
- if (ownerSolutionEntityItem != null)
- ownerSolutionEntityItem.DefaultConfigurationChanged += OnConfugurationChanged;
- }
-
- public virtual void Dispose ()
- {
- if (ownerSolutionEntityItem != null)
- ownerSolutionEntityItem.DefaultConfigurationChanged -= OnConfugurationChanged;
- }
-
- internal void SetParent (UnitTest t)
- {
- parent = t;
- }
-
- public virtual string ActiveConfiguration {
- get {
- if (ownerSolutionEntityItem != null) {
- if (ownerSolutionEntityItem.DefaultConfiguration == null)
- return "";
- return ownerSolutionEntityItem.DefaultConfiguration.Id;
- } else if (Parent != null) {
- return Parent.ActiveConfiguration;
- } else {
- return "default";
- }
- }
- }
-
- public virtual string[] GetConfigurations ()
- {
- if (ownerSolutionEntityItem != null) {
- string[] res = new string [ownerSolutionEntityItem.Configurations.Count];
- for (int n=0; n<ownerSolutionEntityItem.Configurations.Count; n++)
- res [n] = ownerSolutionEntityItem.Configurations [n].Id;
- return res;
- } else if (Parent != null) {
- return Parent.GetConfigurations ();
- } else {
- return new string [] { "default" };
- }
- }
-
- public ICloneable GetOptions (Type optionsType)
- {
- return GetOptions (optionsType, ActiveConfiguration);
- }
-
- public bool HasOptions (Type optionsType, string configuration)
- {
- return GetOptions (optionsType, configuration, false) != null;
- }
-
- public void ResetOptions (Type optionsType, string configuration)
- {
- if (GetOptions (optionsType, configuration, false) == null)
- return;
-
- if (options == null || !options.ContainsKey (configuration))
- return;
-
- Hashtable configOptions = (Hashtable) options [configuration];
- if (configOptions != null)
- configOptions.Remove (optionsType);
- SaveOptions ();
- }
-
- public ICloneable GetOptions (Type optionsType, string configuration)
- {
- return GetOptions (optionsType, configuration, true);
- }
-
- public ICollection GetAllOptions (string configuration)
- {
- Hashtable localOptions = GetOptionsTable (configuration);
- if (localOptions == null || localOptions.Count == 0) {
- if (Parent != null)
- return Parent.GetAllOptions (configuration);
- else
- return new object[0];
- }
- if (Parent == null)
- return localOptions.Values;
-
- ICollection parentOptions = Parent.GetAllOptions (configuration);
- if (parentOptions.Count == 0)
- return localOptions.Values;
-
- Hashtable t = new Hashtable ();
- foreach (object ob in parentOptions)
- t [ob.GetType()] = ob;
-
- foreach (ICloneable ob in localOptions.Values)
- t [ob.GetType()] = ob.Clone ();
-
- return t.Values;
- }
-
- ICloneable GetOptions (Type optionsType, string configuration, bool createDefault)
- {
- Hashtable configOptions = GetOptionsTable (configuration);
-
- if (configOptions != null) {
- ICloneable ob = (ICloneable) configOptions [optionsType];
- if (ob != null)
- return (ICloneable) ob.Clone ();
- }
- if (!createDefault)
- return null;
- if (parent != null)
- return parent.GetOptions (optionsType, configuration);
- else
- return (ICloneable) Activator.CreateInstance (optionsType);
- }
-
- Hashtable GetOptionsTable (string configuration)
- {
- Hashtable configOptions = null;
-
- if (options == null || !options.ContainsKey (configuration)) {
- ICollection col = OnLoadOptions (configuration);
- if (col != null && col.Count > 0) {
- if (options == null)
- options = new Hashtable ();
- configOptions = (Hashtable) options [configuration];
- if (configOptions == null) {
- configOptions = new Hashtable ();
- options [configuration] = configOptions;
- }
- foreach (object op in col)
- configOptions [op.GetType ()] = op;
- }
- } else
- configOptions = (Hashtable) options [configuration];
- return configOptions;
- }
-
- public virtual void SetOptions (ICloneable ops, string configuration)
- {
- if (options == null)
- options = new Hashtable ();
-
- Hashtable configOptions = (Hashtable) options [configuration];
- if (configOptions == null) {
- configOptions = new Hashtable ();
- options [configuration] = configOptions;
- }
-
- configOptions [ops.GetType ()] = ops.Clone ();
- SaveOptions ();
- }
-
- void SaveOptions ()
- {
- if (options == null) {
- OnSaveOptions (new OptionsData[0]);
- return;
- }
-
- ArrayList list = new ArrayList ();
- foreach (DictionaryEntry e in options) {
- OptionsData d = new OptionsData ((string) e.Key, ((Hashtable) e.Value).Values);
- list.Add (d);
- }
-
- OnSaveOptions ((OptionsData[]) list.ToArray (typeof(OptionsData)));
- }
-
- public UnitTestResultsStore Results {
- get {
- if (results == null) {
- results = new UnitTestResultsStore (this, GetResultsStore ());
- }
- return results;
- }
- }
-
- public UnitTestResult GetLastResult ()
- {
- if (!resultLoaded) {
- resultLoaded = true;
- lastResult = Results.GetLastResult (DateTime.Now);
- if (lastResult != null)
- historicResult = true;
- }
- return lastResult;
- }
-
- public void ResetLastResult ()
- {
- historicResult = true;
- OnTestStatusChanged ();
- }
-
- public bool IsHistoricResult {
- get { return historicResult; }
- }
-
- public UnitTestCollection GetRegressions (DateTime fromDate, DateTime toDate)
- {
- UnitTestCollection list = new UnitTestCollection ();
- FindRegressions (list, fromDate, toDate);
- return list;
- }
-
- public virtual int CountTestCases ()
- {
- return 1;
- }
-
- public virtual SourceCodeLocation SourceCodeLocation {
- get { return null; }
- }
-
- public UnitTest Parent {
- get { return parent; }
- }
-
- public UnitTest RootTest {
- get {
- if (parent != null)
- return parent.RootTest;
- else
- return this;
- }
- }
-
- public virtual string Name {
- get { return name; }
- }
-
- public virtual string Title {
- get { return Name; }
- }
-
- public TestStatus Status {
- get { return status; }
- set {
- status = value;
- OnTestStatusChanged ();
- }
- }
-
- public Xwt.Drawing.Image StatusIcon {
- get {
- if (Status == TestStatus.Running) {
- return TestStatusIcon.Running;
- } else if (Status == TestStatus.Loading) {
- return TestStatusIcon.Loading;
- } else if (Status == TestStatus.LoadError) {
- return TestStatusIcon.Failure;
- } else {
- UnitTestResult res = GetLastResult ();
- if (res == null)
- return TestStatusIcon.None;
- else if (res.Status == ResultStatus.Ignored)
- return TestStatusIcon.NotRun;
- else if (res.ErrorsAndFailures > 0 && res.Passed > 0)
- return IsHistoricResult ? TestStatusIcon.OldSuccessAndFailure : TestStatusIcon.SuccessAndFailure;
- else if (res.IsInconclusive)
- return IsHistoricResult ? TestStatusIcon.OldInconclusive : TestStatusIcon.Inconclusive;
- else if (res.IsFailure)
- return IsHistoricResult ? TestStatusIcon.OldFailure : TestStatusIcon.Failure;
- else if (res.IsSuccess)
- return IsHistoricResult ? TestStatusIcon.OldSuccess : TestStatusIcon.Success;
- else if (res.IsNotRun || res.Ignored > 0)
- return TestStatusIcon.NotRun;
- else
- return TestStatusIcon.None;
- }
- }
- }
-
- public string TestId {
- get;
- protected set;
- }
-
- public string FullName {
- get {
- if (parent != null)
- return parent.FullName + "." + Name;
- else
- return Name;
- }
- }
-
- protected IWorkspaceObject OwnerSolutionItem {
- get { return ownerSolutionItem; }
- }
-
- public IWorkspaceObject OwnerObject {
- get {
- if (ownerSolutionItem != null)
- return ownerSolutionItem;
- else if (parent != null)
- return parent.OwnerObject;
- else
- return null;
- }
- }
-
- internal string StoreRelativeName {
- get {
- if (resultsStore != null || Parent == null)
- return "";
- else if (Parent.resultsStore != null)
- return Name;
- else
- return Parent.StoreRelativeName + "." + Name;
- }
- }
-
- // Forces the reloading of tests, if they have changed
- public virtual IAsyncOperation Refresh ()
- {
- AsyncOperation op = new AsyncOperation ();
- op.SetCompleted (true);
- return op;
- }
-
- public UnitTestResult Run (TestContext testContext)
- {
- testContext.Monitor.BeginTest (this);
- UnitTestResult res = null;
- object ctx = testContext.ContextData;
-
- try {
- Status = TestStatus.Running;
- res = OnRun (testContext);
- } catch (global::NUnit.Framework.SuccessException) {
- res = UnitTestResult.CreateSuccess();
- } catch (global::NUnit.Framework.IgnoreException ex) {
- res = UnitTestResult.CreateIgnored(ex.Message);
- } catch (global::NUnit.Framework.InconclusiveException ex) {
- res = UnitTestResult.CreateInconclusive(ex.Message);
- } catch (Exception ex) {
- res = UnitTestResult.CreateFailure (ex);
- } finally {
- Status = TestStatus.Ready;
- testContext.Monitor.EndTest (this, res);
- }
- RegisterResult (testContext, res);
- testContext.ContextData = ctx;
- return res;
- }
-
- public bool CanRun (IExecutionHandler executionContext)
- {
- if (executionContext == null)
- executionContext = Runtime.ProcessService.DefaultExecutionHandler;
- return OnCanRun (executionContext);
- }
-
- protected abstract UnitTestResult OnRun (TestContext testContext);
-
- protected virtual bool OnCanRun (IExecutionHandler executionContext)
- {
- return true;
- }
-
- public void RegisterResult (TestContext context, UnitTestResult result)
- {
- // Avoid registering results twice
- if (lastResult != null && lastResult.TestDate == context.TestDate)
- return;
-
- result.TestDate = context.TestDate;
-// if ((int)result.Status == 0)
-// result.Status = ResultStatus.Ignored;
-
- lastResult = result;
- historicResult = false;
- resultLoaded = true;
-
- IResultsStore store = GetResultsStore ();
- if (store != null)
- store.RegisterResult (ActiveConfiguration, this, result);
- OnTestStatusChanged ();
- }
-
- IResultsStore GetResultsStore ()
- {
- if (resultsStore != null)
- return resultsStore;
- if (Parent != null)
- return Parent.GetResultsStore ();
- else
- return null;
- }
-
- protected IResultsStore ResultsStore {
- get { return resultsStore; }
- set { resultsStore = value; }
- }
-
- public virtual void SaveResults ()
- {
- IResultsStore store = GetResultsStore ();
- if (store != null)
- store.Save ();
- }
-
- internal virtual void FindRegressions (UnitTestCollection list, DateTime fromDate, DateTime toDate)
- {
- UnitTestResult res1 = Results.GetLastResult (fromDate);
- UnitTestResult res2 = Results.GetLastResult (toDate);
- if ((res1 == null || res1.IsSuccess) && (res2 != null && !res2.IsSuccess))
- list.Add (this);
- }
-
- protected virtual void OnSaveOptions (OptionsData[] data)
- {
- IConfigurationTarget ce;
- string path;
-
- GetOwnerSolutionItem (this, out ce, out path);
-
- if (ce == null)
- throw new InvalidOperationException ("Options can't be saved.");
-
- foreach (OptionsData d in data) {
- IExtendedDataItem edi = (IExtendedDataItem) ce.Configurations [d.Configuration];
- if (edi == null)
- continue;
- UnitTestOptionsSet oset = (UnitTestOptionsSet) edi.ExtendedProperties ["UnitTestInformation"];
- if (oset == null) {
- oset = new UnitTestOptionsSet ();
- edi.ExtendedProperties ["UnitTestInformation"] = oset;
- }
-
- UnitTestOptionsEntry te = oset.FindEntry (path);
-
- if (d.Options.Count > 0) {
- if (te == null) {
- te = new UnitTestOptionsEntry ();
- te.Path = path;
- oset.Tests.Add (te);
- }
- te.Options.Clear ();
- te.Options.AddRange (d.Options);
- } else if (te != null) {
- oset.Tests.Remove (te);
- }
- }
-
- ce.Save (new NullProgressMonitor ());
- }
-
- protected virtual ICollection OnLoadOptions (string configuration)
- {
- IConfigurationTarget ce;
- string path;
-
- GetOwnerSolutionItem (this, out ce, out path);
-
- if (ce == null)
- return null;
-
- IExtendedDataItem edi = (IExtendedDataItem) ce.Configurations [configuration];
- if (edi == null)
- return null;
-
- UnitTestOptionsSet oset = (UnitTestOptionsSet) edi.ExtendedProperties ["UnitTestInformation"];
- if (oset == null)
- return null;
-
- UnitTestOptionsEntry te = oset.FindEntry (path);
- if (te != null)
- return te.Options;
- else
- return null;
- }
-
- void GetOwnerSolutionItem (UnitTest t, out IConfigurationTarget c, out string path)
- {
- if (OwnerSolutionItem is SolutionEntityItem) {
- c = OwnerSolutionItem as SolutionEntityItem;
- path = "";
- } else if (parent != null) {
- parent.GetOwnerSolutionItem (t, out c, out path);
- if (c == null) return;
- if (path.Length > 0)
- path += "/" + t.Name;
- else
- path = t.Name;
- } else {
- c = null;
- path = null;
- }
- }
-
- void OnConfugurationChanged (object ob, ConfigurationEventArgs args)
- {
- OnActiveConfigurationChanged ();
- }
-
- protected virtual void OnActiveConfigurationChanged ()
- {
- OnTestChanged ();
- }
-
- protected virtual void OnTestChanged ()
- {
- Gtk.Application.Invoke (delegate {
- if (TestChanged != null)
- TestChanged (this, EventArgs.Empty);
- });
- }
-
- protected virtual void OnTestStatusChanged ()
- {
- Gtk.Application.Invoke (delegate {
- if (TestStatusChanged != null)
- TestStatusChanged (this, EventArgs.Empty);
- });
- }
-
- public event EventHandler TestChanged;
- public event EventHandler TestStatusChanged;
- }
-
- public class SourceCodeLocation
- {
- string fileName;
- int line;
- int column;
-
- public SourceCodeLocation (string fileName, int line, int column)
- {
- this.fileName = fileName;
- this.line = line;
- this.column = column;
- }
-
- public string FileName {
- get { return fileName; }
- }
-
- public int Line {
- get { return line; }
- }
-
- public int Column {
- get { return column; }
- }
- }
-
- public class OptionsData
- {
- string configuration;
- ICollection options;
-
- public OptionsData (string configuration, ICollection options)
- {
- this.configuration = configuration;
- this.options = options;
- }
-
- public string Configuration {
- get { return configuration; }
- }
-
- public ICollection Options {
- get { return options; }
- }
- }
-
-
- class UnitTestOptionsSet
- {
- [ExpandedCollection]
- [ItemProperty ("Test", ValueType = typeof(UnitTestOptionsEntry))]
- public ArrayList Tests = new ArrayList ();
-
- public UnitTestOptionsEntry FindEntry (string testPath)
- {
- foreach (UnitTestOptionsEntry t in Tests)
- if (t.Path == testPath) return t;
- return null;
- }
- }
-
- class UnitTestOptionsEntry
- {
- [ItemProperty ("Path")]
- public string Path;
-
- [ItemProperty ("Options")]
- [ExpandedCollection]
- public ArrayList Options = new ArrayList ();
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/UnitTestCollection.cs b/main/src/addins/NUnit/Services/UnitTestCollection.cs
deleted file mode 100644
index a7a8638854..0000000000
--- a/main/src/addins/NUnit/Services/UnitTestCollection.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// UnitTestCollection.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-
-namespace MonoDevelop.NUnit
-{
- public class UnitTestCollection: Collection<UnitTest>
- {
- UnitTest owner;
-
- internal UnitTestCollection (UnitTest owner)
- {
- this.owner = owner;
- }
-
- public UnitTestCollection ()
- {
- }
-
- public UnitTest this [string name] {
- get {
- for (int n=0; n<Items.Count; n++)
- if (Items [n].Name == name)
- return Items [n];
- return null;
- }
- }
-
- protected override void SetItem (int index, UnitTest item)
- {
- if (owner != null)
- this[index].SetParent (null);
- base.SetItem (index, item);
- if (owner != null)
- item.SetParent (owner);
- }
-
- protected override void RemoveItem (int index)
- {
- if (owner != null)
- this [index].SetParent (null);
- base.RemoveItem(index);
- }
-
- protected override void InsertItem (int index, UnitTest item)
- {
- base.InsertItem(index, item);
- if (owner != null)
- item.SetParent (owner);
- }
-
- protected override void ClearItems ()
- {
- if (owner != null) {
- foreach (UnitTest t in this)
- t.SetParent (null);
- }
- base.ClearItems();
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/UnitTestGroup.cs b/main/src/addins/NUnit/Services/UnitTestGroup.cs
deleted file mode 100644
index f478e1f00b..0000000000
--- a/main/src/addins/NUnit/Services/UnitTestGroup.cs
+++ /dev/null
@@ -1,198 +0,0 @@
-//
-// UnitTestGroup.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using MonoDevelop.Core;
-using MonoDevelop.Core.ProgressMonitoring;
-using System.Collections;
-using MonoDevelop.Projects;
-
-namespace MonoDevelop.NUnit
-{
- public class UnitTestGroup: UnitTest
- {
- UnitTestCollection tests;
-
- public UnitTestGroup (string name): base (name)
- {
- }
-
- protected UnitTestGroup (string name, IWorkspaceObject ownerSolutionItem): base (name, ownerSolutionItem)
- {
- }
-
- public virtual bool HasTests {
- get {
- foreach (UnitTest t in Tests) {
- if (t is UnitTestGroup) {
- if (((UnitTestGroup)t).HasTests)
- return true;
- } else
- return true;
- }
- return false;
- }
- }
-
- public UnitTestCollection Tests {
- get {
- if (tests == null) {
- tests = new UnitTestCollection (this);
- OnCreateTests ();
- }
- return tests;
- }
- }
-
- public UnitTestCollection GetFailedTests (DateTime date)
- {
- UnitTestCollection col = new UnitTestCollection ();
- CollectFailedTests (col, date);
- return col;
- }
-
- void CollectFailedTests (UnitTestCollection col, DateTime date)
- {
- foreach (UnitTest t in Tests) {
- if (t is UnitTestGroup)
- ((UnitTestGroup)t).CollectFailedTests (col, date);
- else {
- UnitTestResult res = t.Results.GetLastResult (date);
- if (res != null && res.IsFailure)
- col.Add (t);
- }
- }
- }
-
- public void UpdateTests ()
- {
- if (tests != null) {
- foreach (UnitTest t in tests)
- t.Dispose ();
- tests = null;
- OnTestChanged ();
- }
- }
-
- public override void SaveResults ()
- {
- base.SaveResults ();
- if (tests != null) {
- foreach (UnitTest t in tests)
- t.SaveResults ();
- }
- }
-
-
- public override int CountTestCases ()
- {
- int total = 0;
- foreach (UnitTest t in Tests)
- total += t.CountTestCases ();
- return total;
- }
-
- protected virtual void OnCreateTests ()
- {
- }
-
- public override IAsyncOperation Refresh ()
- {
- AggregatedAsyncOperation oper = new AggregatedAsyncOperation ();
- foreach (UnitTest t in Tests)
- oper.Add (t.Refresh ());
- oper.StartMonitoring ();
- return oper;
- }
-
- protected override UnitTestResult OnRun (TestContext testContext)
- {
- UnitTestResult tres = new UnitTestResult ();
- OnBeginTest (testContext);
-
- try {
- foreach (UnitTest t in Tests) {
- if (t.IsExplicit)
- continue;
- UnitTestResult res;
- try {
- res = OnRunChildTest (t, testContext);
- if (testContext.Monitor.IsCancelRequested)
- break;
- } catch (Exception ex) {
- res = UnitTestResult.CreateFailure (ex);
- }
- tres.Add (res);
- }
- } finally {
- OnEndTest (testContext);
- }
- return tres;
- }
-
- protected override bool OnCanRun (MonoDevelop.Core.Execution.IExecutionHandler executionContext)
- {
- foreach (UnitTest t in Tests)
- if (!t.CanRun (executionContext))
- return false;
- return true;
- }
-
-
- protected virtual void OnBeginTest (TestContext testContext)
- {
- }
-
- protected virtual UnitTestResult OnRunChildTest (UnitTest test, TestContext testContext)
- {
- return test.Run (testContext);
- }
-
- protected virtual void OnEndTest (TestContext testContext)
- {
- }
-
- internal override void FindRegressions (UnitTestCollection list, DateTime fromDate, DateTime toDate)
- {
- foreach (UnitTest test in Tests)
- test.FindRegressions (list, fromDate, toDate);
- }
-
- public override void Dispose ()
- {
- base.Dispose ();
-
- if (tests != null) {
- foreach (UnitTest t in tests)
- t.Dispose ();
- }
- }
-
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/UnitTestResult.cs b/main/src/addins/NUnit/Services/UnitTestResult.cs
deleted file mode 100644
index 25d6e4227f..0000000000
--- a/main/src/addins/NUnit/Services/UnitTestResult.cs
+++ /dev/null
@@ -1,226 +0,0 @@
-//
-// UnitTestResult.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Collections;
-using System.Xml.Serialization;
-using System.Globalization;
-using System.Text.RegularExpressions;
-
-namespace MonoDevelop.NUnit
-{
- [Serializable]
- public class UnitTestResult
- {
- DateTime testDate;
- ResultStatus status;
- TimeSpan time;
- string message;
- string output;
- string stackTrace;
- string cerror;
-
- public UnitTestResult ()
- {
- }
-
- public static UnitTestResult CreateFailure (Exception ex)
- {
- UnitTestResult res = new UnitTestResult ();
- res.status = ResultStatus.Failure;
- res.Message = ex.Message;
- res.stackTrace = ex.StackTrace;
- return res;
- }
-
- public static UnitTestResult CreateFailure (string message, Exception ex)
- {
- UnitTestResult res = new UnitTestResult ();
- res.status = ResultStatus.Failure;
- res.Message = message;
- if (ex != null)
- res.stackTrace = ex.Message + "\n" + ex.StackTrace;
- return res;
- }
-
- public static UnitTestResult CreateIgnored (string message)
- {
- UnitTestResult res = new UnitTestResult ();
- res.status = ResultStatus.Ignored;
- res.Message = message;
- return res;
- }
-
- public static UnitTestResult CreateInconclusive (string message)
- {
- UnitTestResult res = new UnitTestResult ();
- res.status = ResultStatus.Inconclusive;
- res.Message = message;
- return res;
- }
-
- public static UnitTestResult CreateSuccess ()
- {
- UnitTestResult res = new UnitTestResult ();
- res.status = ResultStatus.Success;
- return res;
- }
-
- public DateTime TestDate {
- get { return testDate; }
- set { testDate = value; }
- }
-
- public ResultStatus Status {
- get { return status; }
- set { status = value; }
- }
-
- public bool IsFailure {
- get { return ErrorsAndFailures > 0; }
- }
-
- public bool IsSuccess {
- get { return ErrorsAndFailures == 0 && Passed > 0; }
- }
-
- public bool IsInconclusive {
- get { return Passed == 0 && ErrorsAndFailures == 0 && Inconclusive > 0; }
- }
-
- public bool IsNotRun {
- get {
- return Passed == 0 && ErrorsAndFailures == 0 && TestsNotRun > 0;
- }
- }
-
- public int Passed {
- get;
- set;
- }
-
- public int Errors {
- get;
- set;
- }
-
- public int Failures {
- get;
- set;
- }
-
- public int ErrorsAndFailures {
- get {
- return Errors + Failures;
- }
- }
-
- public int TestsNotRun {
- get {
- return Ignored + NotRunnable + Skipped;
- }
- }
-
- public int Inconclusive {
- get;
- set;
- }
-
- public int NotRunnable {
- get;
- set;
- }
-
- public int Skipped {
- get;
- set;
- }
-
- public int Ignored {
- get;
- set;
- }
-
- public TimeSpan Time {
- get { return time; }
- set { time = value; }
- }
-
- public string Message {
- get { return message; }
- set { message = value; }
- }
-
- public string StackTrace {
- get { return stackTrace; }
- set { stackTrace = value; }
- }
-
- public string ConsoleOutput {
- get { return output; }
- set { output = value; }
- }
-
- public string ConsoleError {
- get { return cerror; }
- set { cerror = value; }
- }
-
- public SourceCodeLocation GetFailureLocation ()
- {
- if (string.IsNullOrEmpty (stackTrace))
- return null;
- string[] stackLines = stackTrace.Replace ("\r", "").Split ('\n');
- foreach (string line in stackLines) {
- if (line.IndexOf ("NUnit.Framework") != -1)
- continue;
- Regex r = new Regex (@".*?\(.*?\)\s\[.*?\]\s.*?\s(?<file>.*)\:(?<line>\d*)");
- Match m = r.Match (line);
- if (m.Groups ["file"] != null && m.Groups ["line"] != null && File.Exists (m.Groups ["file"].Value)) {
- int lin;
- if (int.TryParse (m.Groups ["line"].Value, out lin))
- return new MonoDevelop.NUnit.SourceCodeLocation (m.Groups ["file"].Value, lin, -1);
- }
- }
- return null;
- }
-
- public void Add (UnitTestResult res)
- {
- Time += res.Time;
- Passed += res.Passed;
- Errors += res.Errors;
- Failures += res.Failures;
- Ignored += res.Ignored;
- Inconclusive += res.Inconclusive;
- Skipped += res.Skipped;
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/UnitTestResultsStore.cs b/main/src/addins/NUnit/Services/UnitTestResultsStore.cs
deleted file mode 100644
index 37bbe7edc3..0000000000
--- a/main/src/addins/NUnit/Services/UnitTestResultsStore.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// TestNodeBuilder.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-
-namespace MonoDevelop.NUnit
-{
- public class UnitTestResultsStore
- {
- UnitTest test;
- IResultsStore store;
-
- internal UnitTestResultsStore (UnitTest test, IResultsStore store)
- {
- this.test = test;
- this.store = store;
- }
-
- public UnitTestResult GetLastResult (DateTime date)
- {
- if (store == null) return null;
- return store.GetLastResult (test.ActiveConfiguration, test, date);
- }
-
- public UnitTestResult GetNextResult (DateTime date)
- {
- if (store == null) return null;
- return store.GetNextResult (test.ActiveConfiguration, test, date);
- }
-
- public UnitTestResult GetPreviousResult (DateTime date)
- {
- if (store == null) return null;
- return store.GetPreviousResult (test.ActiveConfiguration, test, date);
- }
-
- public UnitTestResult[] GetResults (DateTime startDate, DateTime endDate)
- {
- if (store == null) return new UnitTestResult [0];
- return store.GetResults (test.ActiveConfiguration, test, startDate, endDate);
- }
-
- public UnitTestResult[] GetResultsToDate (DateTime endDate, int count)
- {
- if (store == null) return new UnitTestResult [0];
- return store.GetResultsToDate (test.ActiveConfiguration, test, endDate, count);
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/UnitTestStatus.cs b/main/src/addins/NUnit/Services/UnitTestStatus.cs
deleted file mode 100644
index 272c2ede4f..0000000000
--- a/main/src/addins/NUnit/Services/UnitTestStatus.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// TestStatus.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace MonoDevelop.NUnit
-{
- public enum TestStatus
- {
- Ready,
- Loading,
- LoadError,
- Running
- }
-
- [Flags]
- public enum ResultStatus
- {
- Success = 1,
- Failure = 2,
- Ignored = 4,
- Inconclusive = 8
- }
-}
-
diff --git a/main/src/addins/NUnit/Services/WorkspaceTestGroup.cs b/main/src/addins/NUnit/Services/WorkspaceTestGroup.cs
deleted file mode 100644
index 0c7713f524..0000000000
--- a/main/src/addins/NUnit/Services/WorkspaceTestGroup.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// WorkspaceTestGroup.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using MonoDevelop.Projects;
-
-
-namespace MonoDevelop.NUnit
-{
- public class WorkspaceTestGroup: UnitTestGroup
- {
- Workspace workspace;
-
- public WorkspaceTestGroup (Workspace ws): base (ws.Name, ws)
- {
- string storeId = ws.Name;
- string resultsPath = MonoDevelop.NUnit.RootTest.GetTestResultsDirectory (ws.BaseDirectory);
- ResultsStore = new BinaryResultsStore (resultsPath, storeId);
-
- workspace = ws;
- workspace.ItemAdded += OnEntryChanged;
- workspace.ItemRemoved += OnEntryChanged;
- workspace.NameChanged += OnCombineRenamed;
- }
-
- public static WorkspaceTestGroup CreateTest (Workspace ws)
- {
- return new WorkspaceTestGroup (ws);
- }
-
- public override void Dispose ()
- {
- workspace.ItemAdded -= OnEntryChanged;
- workspace.ItemRemoved -= OnEntryChanged;
- workspace.NameChanged -= OnCombineRenamed;
- base.Dispose ();
- }
-
- void OnEntryChanged (object sender, WorkspaceItemEventArgs e)
- {
- UpdateTests ();
- }
-
- void OnCombineRenamed (object sender, WorkspaceItemRenamedEventArgs e)
- {
- UnitTestGroup parent = Parent as UnitTestGroup;
- if (parent != null)
- parent.UpdateTests ();
- }
-
- protected override void OnCreateTests ()
- {
- NUnitService testService = NUnitService.Instance;
- foreach (WorkspaceItem e in workspace.Items) {
- UnitTest t = testService.BuildTest (e);
- if (t != null)
- Tests.Add (t);
- }
- }
- }
-}
-
diff --git a/main/src/addins/NUnit/gtk-gui/MonoDevelop.NUnit.NUnitOptionsWidget.cs b/main/src/addins/NUnit/gtk-gui/MonoDevelop.NUnit.NUnitOptionsWidget.cs
deleted file mode 100644
index 81b4cad14b..0000000000
--- a/main/src/addins/NUnit/gtk-gui/MonoDevelop.NUnit.NUnitOptionsWidget.cs
+++ /dev/null
@@ -1,206 +0,0 @@
-
-// This file has been generated by the GUI designer. Do not modify.
-namespace MonoDevelop.NUnit
-{
- internal partial class NUnitOptionsWidget
- {
- private global::Gtk.VBox vbox1;
- private global::Gtk.CheckButton useParentCheck;
- private global::Gtk.HSeparator hseparator1;
- private global::Gtk.VBox vbox3;
- private global::Gtk.Label label1;
- private global::Gtk.HBox hbox2;
- private global::Gtk.Label label2;
- private global::Gtk.VBox vbox4;
- private global::Gtk.RadioButton noFilterRadio;
- private global::Gtk.RadioButton includeRadio;
- private global::Gtk.RadioButton excludeRadio;
- private global::Gtk.Label label3;
- private global::Gtk.HBox hbox1;
- private global::Gtk.Label label4;
- private global::Gtk.ScrolledWindow scrolledwindow1;
- private global::Gtk.TreeView categoryTree;
- private global::Gtk.VBox vbox2;
- private global::Gtk.Button addButton;
- private global::Gtk.Button removeButton;
-
- protected virtual void Build ()
- {
- global::Stetic.Gui.Initialize (this);
- // Widget MonoDevelop.NUnit.NUnitOptionsWidget
- global::Stetic.BinContainer.Attach (this);
- this.Name = "MonoDevelop.NUnit.NUnitOptionsWidget";
- // Container child MonoDevelop.NUnit.NUnitOptionsWidget.Gtk.Container+ContainerChild
- this.vbox1 = new global::Gtk.VBox ();
- this.vbox1.Name = "vbox1";
- this.vbox1.Spacing = 6;
- // Container child vbox1.Gtk.Box+BoxChild
- this.useParentCheck = new global::Gtk.CheckButton ();
- this.useParentCheck.Name = "useParentCheck";
- this.useParentCheck.Label = global::Mono.Unix.Catalog.GetString ("Use parent test settings");
- this.useParentCheck.DrawIndicator = true;
- this.useParentCheck.UseUnderline = true;
- this.vbox1.Add (this.useParentCheck);
- global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.useParentCheck]));
- w1.Position = 0;
- w1.Expand = false;
- w1.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.hseparator1 = new global::Gtk.HSeparator ();
- this.hseparator1.Name = "hseparator1";
- this.vbox1.Add (this.hseparator1);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hseparator1]));
- w2.Position = 1;
- w2.Expand = false;
- w2.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.vbox3 = new global::Gtk.VBox ();
- this.vbox3.Name = "vbox3";
- this.vbox3.Spacing = 6;
- // Container child vbox3.Gtk.Box+BoxChild
- this.label1 = new global::Gtk.Label ();
- this.label1.Name = "label1";
- this.label1.Xalign = 0F;
- this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("The following filter will be applied when running the tests:");
- this.vbox3.Add (this.label1);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.label1]));
- w3.Position = 0;
- w3.Expand = false;
- w3.Fill = false;
- // Container child vbox3.Gtk.Box+BoxChild
- this.hbox2 = new global::Gtk.HBox ();
- this.hbox2.Name = "hbox2";
- // Container child hbox2.Gtk.Box+BoxChild
- this.label2 = new global::Gtk.Label ();
- this.label2.WidthRequest = 18;
- this.label2.Name = "label2";
- this.hbox2.Add (this.label2);
- global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.label2]));
- w4.Position = 0;
- w4.Expand = false;
- w4.Fill = false;
- // Container child hbox2.Gtk.Box+BoxChild
- this.vbox4 = new global::Gtk.VBox ();
- this.vbox4.Name = "vbox4";
- this.vbox4.Spacing = 6;
- // Container child vbox4.Gtk.Box+BoxChild
- this.noFilterRadio = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("Don't apply any filter"));
- this.noFilterRadio.Name = "noFilterRadio";
- this.noFilterRadio.Active = true;
- this.noFilterRadio.DrawIndicator = true;
- this.noFilterRadio.UseUnderline = true;
- this.noFilterRadio.Group = new global::GLib.SList (global::System.IntPtr.Zero);
- this.vbox4.Add (this.noFilterRadio);
- global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.noFilterRadio]));
- w5.Position = 0;
- w5.Expand = false;
- w5.Fill = false;
- // Container child vbox4.Gtk.Box+BoxChild
- this.includeRadio = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("Include the following categories"));
- this.includeRadio.Name = "includeRadio";
- this.includeRadio.DrawIndicator = true;
- this.includeRadio.UseUnderline = true;
- this.includeRadio.Group = this.noFilterRadio.Group;
- this.vbox4.Add (this.includeRadio);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.includeRadio]));
- w6.Position = 1;
- w6.Expand = false;
- w6.Fill = false;
- // Container child vbox4.Gtk.Box+BoxChild
- this.excludeRadio = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("Exclude the following categories"));
- this.excludeRadio.Name = "excludeRadio";
- this.excludeRadio.DrawIndicator = true;
- this.excludeRadio.UseUnderline = true;
- this.excludeRadio.Group = this.noFilterRadio.Group;
- this.vbox4.Add (this.excludeRadio);
- global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.excludeRadio]));
- w7.Position = 2;
- w7.Expand = false;
- w7.Fill = false;
- this.hbox2.Add (this.vbox4);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.vbox4]));
- w8.Position = 1;
- this.vbox3.Add (this.hbox2);
- global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox2]));
- w9.Position = 1;
- this.vbox1.Add (this.vbox3);
- global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.vbox3]));
- w10.Position = 2;
- w10.Expand = false;
- w10.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.label3 = new global::Gtk.Label ();
- this.label3.Name = "label3";
- this.label3.Xalign = 0F;
- this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("Categories:");
- this.vbox1.Add (this.label3);
- global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.label3]));
- w11.Position = 3;
- w11.Expand = false;
- w11.Fill = false;
- // Container child vbox1.Gtk.Box+BoxChild
- this.hbox1 = new global::Gtk.HBox ();
- this.hbox1.Name = "hbox1";
- this.hbox1.Spacing = 6;
- // Container child hbox1.Gtk.Box+BoxChild
- this.label4 = new global::Gtk.Label ();
- this.label4.WidthRequest = 18;
- this.label4.Name = "label4";
- this.hbox1.Add (this.label4);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label4]));
- w12.Position = 0;
- w12.Expand = false;
- w12.Fill = false;
- // Container child hbox1.Gtk.Box+BoxChild
- this.scrolledwindow1 = new global::Gtk.ScrolledWindow ();
- this.scrolledwindow1.Name = "scrolledwindow1";
- this.scrolledwindow1.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child scrolledwindow1.Gtk.Container+ContainerChild
- this.categoryTree = new global::Gtk.TreeView ();
- this.categoryTree.Name = "categoryTree";
- this.scrolledwindow1.Add (this.categoryTree);
- this.hbox1.Add (this.scrolledwindow1);
- global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.scrolledwindow1]));
- w14.Position = 1;
- // Container child hbox1.Gtk.Box+BoxChild
- this.vbox2 = new global::Gtk.VBox ();
- this.vbox2.Name = "vbox2";
- this.vbox2.Spacing = 6;
- // Container child vbox2.Gtk.Box+BoxChild
- this.addButton = new global::Gtk.Button ();
- this.addButton.Name = "addButton";
- this.addButton.UseStock = true;
- this.addButton.UseUnderline = true;
- this.addButton.Label = "gtk-add";
- this.vbox2.Add (this.addButton);
- global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.addButton]));
- w15.Position = 0;
- w15.Expand = false;
- w15.Fill = false;
- // Container child vbox2.Gtk.Box+BoxChild
- this.removeButton = new global::Gtk.Button ();
- this.removeButton.Name = "removeButton";
- this.removeButton.UseStock = true;
- this.removeButton.UseUnderline = true;
- this.removeButton.Label = "gtk-remove";
- this.vbox2.Add (this.removeButton);
- global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.removeButton]));
- w16.Position = 1;
- w16.Expand = false;
- w16.Fill = false;
- this.hbox1.Add (this.vbox2);
- global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox2]));
- w17.Position = 2;
- w17.Expand = false;
- w17.Fill = false;
- this.vbox1.Add (this.hbox1);
- global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox1]));
- w18.Position = 4;
- this.Add (this.vbox1);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
- }
- this.Show ();
- }
- }
-}
diff --git a/main/src/addins/NUnit/gtk-gui/generated.cs b/main/src/addins/NUnit/gtk-gui/generated.cs
deleted file mode 100644
index 75935e2e55..0000000000
--- a/main/src/addins/NUnit/gtk-gui/generated.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-
-// This file has been generated by the GUI designer. Do not modify.
-namespace Stetic
-{
- internal class Gui
- {
- private static bool initialized;
-
- internal static void Initialize (Gtk.Widget iconRenderer)
- {
- if ((Stetic.Gui.initialized == false)) {
- Stetic.Gui.initialized = true;
- }
- }
- }
-
- internal class BinContainer
- {
- private Gtk.Widget child;
- private Gtk.UIManager uimanager;
-
- public static BinContainer Attach (Gtk.Bin bin)
- {
- BinContainer bc = new BinContainer ();
- bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested);
- bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated);
- bin.Added += new Gtk.AddedHandler (bc.OnAdded);
- return bc;
- }
-
- private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args)
- {
- if ((this.child != null)) {
- args.Requisition = this.child.SizeRequest ();
- }
- }
-
- private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args)
- {
- if ((this.child != null)) {
- this.child.Allocation = args.Allocation;
- }
- }
-
- private void OnAdded (object sender, Gtk.AddedArgs args)
- {
- this.child = args.Widget;
- }
-
- public void SetUiManager (Gtk.UIManager uim)
- {
- this.uimanager = uim;
- this.child.Realized += new System.EventHandler (this.OnRealized);
- }
-
- private void OnRealized (object sender, System.EventArgs args)
- {
- if ((this.uimanager != null)) {
- Gtk.Widget w;
- w = this.child.Toplevel;
- if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) {
- ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup);
- this.uimanager = null;
- }
- }
- }
- }
-
- internal class ActionGroups
- {
- public static Gtk.ActionGroup GetActionGroup (System.Type type)
- {
- return Stetic.ActionGroups.GetActionGroup (type.FullName);
- }
-
- public static Gtk.ActionGroup GetActionGroup (string name)
- {
- return null;
- }
- }
-}
diff --git a/main/src/addins/NUnit/gtk-gui/gui.stetic b/main/src/addins/NUnit/gtk-gui/gui.stetic
deleted file mode 100644
index b198c1bf51..0000000000
--- a/main/src/addins/NUnit/gtk-gui/gui.stetic
+++ /dev/null
@@ -1,245 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<stetic-interface>
- <configuration>
- <images-root-path>..</images-root-path>
- <target-gtk-version>2.12</target-gtk-version>
- </configuration>
- <import>
- <widget-library name="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
- <widget-library name="../../../../build/bin/MonoDevelop.Ide.dll" />
- <widget-library name="../../../../build/AddIns/NUnit/MonoDevelop.NUnit.dll" internal="true" />
- </import>
- <widget class="Gtk.Bin" id="MonoDevelop.NUnit.NUnitOptionsWidget" design-size="450 380">
- <property name="MemberName" />
- <property name="GeneratePublic">False</property>
- <child>
- <widget class="Gtk.VBox" id="vbox1">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.CheckButton" id="useParentCheck">
- <property name="MemberName" />
- <property name="Label" translatable="yes">Use parent test settings</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">False</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.HSeparator" id="hseparator1">
- <property name="MemberName" />
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">False</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.VBox" id="vbox3">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.Label" id="label1">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">The following filter will be applied when running the tests:</property>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">False</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.HBox" id="hbox2">
- <property name="MemberName" />
- <child>
- <widget class="Gtk.Label" id="label2">
- <property name="MemberName" />
- <property name="WidthRequest">18</property>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">False</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.VBox" id="vbox4">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.RadioButton" id="noFilterRadio">
- <property name="MemberName" />
- <property name="Label" translatable="yes">Don't apply any filter</property>
- <property name="Active">True</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- <property name="Group">noFilterRadio</property>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">False</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.RadioButton" id="includeRadio">
- <property name="MemberName" />
- <property name="Label" translatable="yes">Include the following categories</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- <property name="Group">noFilterRadio</property>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">False</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.RadioButton" id="excludeRadio">
- <property name="MemberName" />
- <property name="Label" translatable="yes">Exclude the following categories</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- <property name="Group">noFilterRadio</property>
- </widget>
- <packing>
- <property name="Position">2</property>
- <property name="AutoSize">False</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="Position">2</property>
- <property name="AutoSize">False</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="label3">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">Categories:</property>
- </widget>
- <packing>
- <property name="Position">3</property>
- <property name="AutoSize">False</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.HBox" id="hbox1">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.Label" id="label4">
- <property name="MemberName" />
- <property name="WidthRequest">18</property>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">False</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.ScrolledWindow" id="scrolledwindow1">
- <property name="MemberName" />
- <property name="ShadowType">In</property>
- <child>
- <widget class="Gtk.TreeView" id="categoryTree">
- <property name="MemberName" />
- </widget>
- </child>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.VBox" id="vbox2">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.Button" id="addButton">
- <property name="MemberName" />
- <property name="UseStock">True</property>
- <property name="Type">StockItem</property>
- <property name="StockId">gtk-add</property>
- <property name="label">gtk-add</property>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">False</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Button" id="removeButton">
- <property name="MemberName" />
- <property name="UseStock">True</property>
- <property name="Type">StockItem</property>
- <property name="StockId">gtk-remove</property>
- <property name="label">gtk-remove</property>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">False</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="Position">2</property>
- <property name="AutoSize">False</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="Position">4</property>
- <property name="AutoSize">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
-</stetic-interface> \ No newline at end of file
diff --git a/main/src/addins/NUnit/packages.config b/main/src/addins/NUnit/packages.config
deleted file mode 100644
index b815516599..0000000000
--- a/main/src/addins/NUnit/packages.config
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="NUnit" version="2.6.4" targetFramework="net40" />
- <package id="NUnit.Runners" version="2.6.4" targetFramework="net40" />
-</packages>
diff --git a/main/src/addins/NUnit/templates/images/nunit-library-project.png b/main/src/addins/NUnit/templates/images/nunit-library-project.png
deleted file mode 100644
index 99f50eb029..0000000000
--- a/main/src/addins/NUnit/templates/images/nunit-library-project.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/NUnit/templates/images/nunit-library-project@2x.png b/main/src/addins/NUnit/templates/images/nunit-library-project@2x.png
deleted file mode 100644
index 86fcbe0866..0000000000
--- a/main/src/addins/NUnit/templates/images/nunit-library-project@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/TextTemplating/ChangeLog b/main/src/addins/TextTemplating/ChangeLog
deleted file mode 100644
index b50bf1355a..0000000000
--- a/main/src/addins/TextTemplating/ChangeLog
+++ /dev/null
@@ -1,9 +0,0 @@
-2009-08-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * TextTransform:
- * Mono.TextTemplating:
- * Mono.TextTemplating.Tests:
- * MonoDevelop.TextTemplating: Include the ASP.NET MVC and
- TextTemplating addins in the main solution and build.
-
diff --git a/main/src/addins/TextTemplating/Mono.TextTemplating.Tests/ChangeLog b/main/src/addins/TextTemplating/Mono.TextTemplating.Tests/ChangeLog
deleted file mode 100644
index 061fc503b5..0000000000
--- a/main/src/addins/TextTemplating/Mono.TextTemplating.Tests/ChangeLog
+++ /dev/null
@@ -1,65 +0,0 @@
-2009-12-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating.Tests.csproj: Don't local-copy nunit.
-
-2009-11-27 Olivier Dagenais <olivier.dagenais@gmail.com>
-
- * GenerationTests.cs: Make tests independent of the runtime
- they are running under by stripping the "autogenerated"
- comment (i.e. the first 9 lines).
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextTemplating.Tests.csproj: Flush.
-
-2009-08-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * DummyHost.cs: Fix windows build.
-
-2009-08-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating.Tests.csproj: Use assembly refs for
- nunit.
-
-2009-08-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating.Tests.csproj: Include the ASP.NET MVC
- and TextTemplating addins in the main solution and build.
-
-2009-04-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * GenerationTests.cs: Add tests for Windows/Mac newlines.
-
-2009-04-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating.Tests.csproj: Updated.
-
- * GenerationTests.cs: Add test for C# output.
-
- * ParsingTests.cs: Track dummy host name change.
-
- * DummyHost.cs: Add more functionality to dummy host.
-
-2009-03-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating.Tests.csproj: Move output dir from
- ../bin to ../build.
-
-2009-03-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating.Tests.csproj: Fix output directory.
-
-2009-03-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating.Tests.csproj: Updated.
-
- * ParsingTests.cs: Add parser test.
-
- * DummyHost.cs: Dummy templating host.
-
-2009-03-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating.Tests.csproj: Add tests.
-
- * ParsingTests.cs: Tokeniser state/value/location test.
-
diff --git a/main/src/addins/TextTemplating/Mono.TextTemplating.Tests/EngineTests.cs b/main/src/addins/TextTemplating/Mono.TextTemplating.Tests/EngineTests.cs
new file mode 100644
index 0000000000..e81aee6164
--- /dev/null
+++ b/main/src/addins/TextTemplating/Mono.TextTemplating.Tests/EngineTests.cs
@@ -0,0 +1,72 @@
+//
+// EngineTests.cs
+//
+// Author:
+// Mikayla Hutchinson <m.j.hutchinson@gmail.com>
+//
+// Copyright (c) 2016 Xamarin Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using NUnit.Framework;
+
+namespace Mono.TextTemplating.Tests
+{
+ [TestFixture]
+ public class EngineTests
+ {
+ #pragma warning disable 414
+ static object [] ParameterParsingCases = {
+ new object [] { "foo=bar", true, "", "", "foo", "bar" },
+ new object [] { "a=b", true, "", "", "a", "b" },
+ new object [] { "a=b=c", true, "", "", "a", "b=c" },
+ new object [] { "!!c!d", true, "", "", "c", "d" },
+ new object [] { "!!!", false, "", "", "", "" },
+ new object [] { "a=", true, "", "", "a", "" },
+ new object [] { "=", false, "", "", "", "" },
+ new object [] { "", false, "", "", "", "" },
+ new object [] { "!", false, "", "", "", "" },
+ new object [] { "a!", true, "", "", "a", "" },
+ new object [] { "!b!c!d", true, "", "b", "c", "d" },
+ new object [] { "a!b!c!d", true, "a", "b", "c", "d" },
+ new object [] { "a=b!c!d!e", true, "", "", "a", "b!c!d!e" },
+ new object [] { "a!b!c!d!e", true, "a", "b", "c", "d!e" },
+ new object [] { "foo!bar!baz!wibb!le", true, "foo", "bar", "baz", "wibb!le" },
+ };
+ #pragma warning restore 414
+
+ [Test]
+ [TestCaseSource(nameof (ParameterParsingCases))]
+ public void ParameterParsing (
+ string parameter, bool valid,
+ string expectedProcessor, string expectedDirective,
+ string expectedName, string expectedValue)
+ {
+ string processor, directive, name, value;
+ var success = TemplateGenerator.TryParseParameter (parameter, out processor, out directive, out name, out value);
+
+ Assert.AreEqual (valid, success);
+ Assert.AreEqual (expectedProcessor, processor);
+ Assert.AreEqual (expectedDirective, directive);
+ Assert.AreEqual (expectedName, name);
+ Assert.AreEqual (expectedValue, value);
+ }
+ }
+}
diff --git a/main/src/addins/TextTemplating/Mono.TextTemplating.Tests/Mono.TextTemplating.Tests.csproj b/main/src/addins/TextTemplating/Mono.TextTemplating.Tests/Mono.TextTemplating.Tests.csproj
index fec16c1aac..ed523be4cf 100644
--- a/main/src/addins/TextTemplating/Mono.TextTemplating.Tests/Mono.TextTemplating.Tests.csproj
+++ b/main/src/addins/TextTemplating/Mono.TextTemplating.Tests/Mono.TextTemplating.Tests.csproj
@@ -42,6 +42,8 @@
<Compile Include="TemplatingEngineHelper.cs" />
<Compile Include="TemplateEnginePreprocessTemplateTests.cs" />
<Compile Include="GenerateIndentedClassCodeTests.cs" />
+ <Compile Include="TextTemplatingSessionTests.cs" />
+ <Compile Include="EngineTests.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Mono.TextTemplating\Mono.TextTemplating.csproj">
diff --git a/main/src/addins/TextTemplating/Mono.TextTemplating.Tests/TextTemplatingSessionTests.cs b/main/src/addins/TextTemplating/Mono.TextTemplating.Tests/TextTemplatingSessionTests.cs
new file mode 100644
index 0000000000..c5b0606394
--- /dev/null
+++ b/main/src/addins/TextTemplating/Mono.TextTemplating.Tests/TextTemplatingSessionTests.cs
@@ -0,0 +1,57 @@
+//
+// TextTemplatingSessionTests.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Reflection;
+using Microsoft.VisualStudio.TextTemplating;
+using NUnit.Framework;
+
+namespace Mono.TextTemplating.Tests
+{
+ [TestFixture]
+ public class TextTemplatingSessionTests
+ {
+ [Test]
+ public void AppDomainSerializationTest ()
+ {
+ var guid = Guid.NewGuid ();
+ var appDomain = AppDomain.CreateDomain ("TextTemplatingSessionSerializationTestAppDomain");
+
+ var session = (TextTemplatingSession)appDomain.CreateInstanceFromAndUnwrap (
+ typeof(TextTemplatingSession).Assembly.Location,
+ typeof(TextTemplatingSession).FullName,
+ false,
+ BindingFlags.Public | BindingFlags.Instance,
+ null,
+ new object[] { guid },
+ null,
+ null);
+
+ Assert.AreEqual (guid, session.Id);
+ }
+ }
+}
+
diff --git a/main/src/addins/TextTemplating/Mono.TextTemplating/AssemblyInfo.cs b/main/src/addins/TextTemplating/Mono.TextTemplating/AssemblyInfo.cs
index 13849716d3..9747297d18 100644
--- a/main/src/addins/TextTemplating/Mono.TextTemplating/AssemblyInfo.cs
+++ b/main/src/addins/TextTemplating/Mono.TextTemplating/AssemblyInfo.cs
@@ -34,4 +34,6 @@ using System;
[assembly: AssemblyCopyright("MIT/X11")]
[assembly: CLSCompliant (true)]
+[assembly: InternalsVisibleTo("Mono.TextTemplating.Tests")]
+
//[assembly: AssemblyVersion("1.0.0.0")]
diff --git a/main/src/addins/TextTemplating/Mono.TextTemplating/ChangeLog b/main/src/addins/TextTemplating/Mono.TextTemplating/ChangeLog
deleted file mode 100644
index 513777600d..0000000000
--- a/main/src/addins/TextTemplating/Mono.TextTemplating/ChangeLog
+++ /dev/null
@@ -1,212 +0,0 @@
-2010-03-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating/TemplateGenerator.cs: Expose OutputFile
- for custom tool to access.
-
-2010-03-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating/CrossAppDomainAssemblyResolver.cs: A
- handler for AssemblyResolve events that looks them up in the
- domain that created the resolver.
-
- * Makefile.am:
- * Mono.TextTemplating.csproj: Added file.
-
-2009-11-27 Olivier Dagenais <olivier.dagenais@gmail.com>
- * Mono.TextTemplating/ParsedTemplate.cs: Fixed a bug where the
- location of an error was being ignored.
-
-2009-11-27 Olivier Dagenais <olivier.dagenais@gmail.com>
-
- * Mono.TextTemplating/TemplatingEngine.cs: Mark the generated
- type as partial.
-
-2009-11-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating/ParsedTemplate.cs: Don't check if
- included file exists before trying to resolve it from the
- host, because host may use include paths. Patch from Aaron
- Bockover.
-
-2009-08-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating/TemplatingEngine.cs: Fix NRE when
- template fails to compile.
-
-2009-08-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * Mono.TextTemplating.csproj: Include the ASP.NET MVC and
- TextTemplating addins in the main solution and build.
-
-2009-08-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating.csproj:
- * Mono.TextTemplating/ParsedTemplate.cs:
- * Mono.TextTemplating/CompiledTemplate.cs:
- * Mono.TextTemplating/TemplatingEngine.cs:
- * Mono.TextTemplating/TemplateGenerator.cs:
- * Mono.TextTemplating/IExtendedTextTemplatingEngineHost.cs:
- Add support for caching compiled templates, and a couple of
- bugfixes. Patch from Nathan Baulch
- (nathan.baulch@gmail.com).
-
-2009-06-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating/TemplatingEngine.cs: Handle expressions
- and content in helpers, based on patch from Nathan Baulch.
- Liberally add C# 3 sugar to neaten up CodeDOM usage.
-
-2009-06-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating/TemplateGenerator.cs: Added overload for
- Process template that uses input/output strings directly,
- avoiding file read/write. Expose engine to subclasses.
-
- * Mono.TextTemplating/Tokeniser.cs: Remove outdated TODO.
-
-2009-04-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Microsoft.VisualStudio.TextTemplating/ToStringHelper.cs: Use
- IConvertible.ToString (formatProvider) when possible.
-
- Thanks to Stuart Carnie for this patch.
-
-2009-04-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating/Tokeniser.cs: Add support for Mac and
- Windows newlines.
-
- * Mono.TextTemplating/TemplatingEngine.cs: Keep temp files
- when in debug mode, so that the generated code can be
- debugged.
-
- * Mono.TextTemplating/ParsedTemplate.cs: Fixes for csc
- compilation.
-
- Thanks to Stuart Carnie for this patch.
-
-2009-04-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating.csproj:
- * Mono.TextTemplating/TemplatingEngine.cs:
- * Mono.TextTemplating/TemplateSettings.cs:
- * Microsoft.VisualStudio.TextTemplating/Engine.cs: Move the
- real engine into the Mono.TextTemplating namespace and
- expose helper methods so that they can be tested.
-
-2009-03-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating.csproj: Move output dir from ../bin to
- ../build.
-
-2009-03-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating/Tokeniser.cs: Tweaked location of next
- state after directive.
-
-2009-03-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating/Tokeniser.cs: Location tweaks within
- directives.
-
- * Mono.TextTemplating/ParsedTemplate.cs: Make Location
- equatable.
-
-2009-03-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating/Tokeniser.cs:
- * Mono.TextTemplating/ParsedTemplate.cs: Fix end location
- capture after newline handling changes.
-
-2009-03-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating/Tokeniser.cs:
- * Microsoft.VisualStudio.TextTemplating/Engine.cs: Match T4's
- newline handling.
-
-2009-03-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating/ParsedTemplate.cs: Fix logic that
- prevented adding directives.
-
-2009-03-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating/Tokeniser.cs:
- * Mono.TextTemplating/ParsedTemplate.cs: More accurate
- location captures. Capture start of tags as well as start of
- content.
-
-2009-03-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating/TemplateGenerator.cs: Report exceptions
- in errors.
-
- * Mono.TextTemplating/Tokeniser.cs: Make API public.
-
- * Mono.TextTemplating/ParsedTemplate.cs: Unify segment types.
- Track end locations. Make API public. Allow parsing without
- includes.
-
- * Microsoft.VisualStudio.TextTemplating/Engine.cs: Track
- location API.
-
-2009-03-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating/TemplateGenerator.cs: Fix
- SetFileExtension.
-
- * Microsoft.VisualStudio.TextTemplating/Engine.cs: Capture
- hostspecific attribute from template directive.
-
-2009-03-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating/TemplateGenerator.cs: Fix output
- extension changing.
-
- * Mono.TextTemplating/Tokeniser.cs: Fix helper regions.
-
-2009-03-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextTemplating.csproj: Updated.
-
- * Mono.TextTemplating/TemplateGenerator.cs: Simple template
- host implementation. Doesn't handle everything yet.
-
- * Mono.TextTemplating/Tokeniser.cs: Fix a number of offset
- issues that broke most captures. Only allow EOF in content
- regions, and in this case capture the last content. Track
- current column, for error reporting.
-
- * Mono.TextTemplating/ParsedTemplate.cs: Overhaul location
- tracking for error reporting. Don't record empty segments.
-
- * Microsoft.VisualStudio.TextTemplating/Engine.cs: Use run
- method instead of runner, since the whole thing's done in
- the appdomain now. Catch errors from the runner. Use host's
- default assemblies and imports. Track ParsedTemplate error
- reporting changes. Filter out content regions with only a
- single newline.
-
- * Microsoft.VisualStudio.TextTemplating/ToStringHelper.cs:
- Don't cache delegates; this won't work for instances. Maybe
- IL generation is called for.
-
-2009-03-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * AssemblyInfo.cs:
- * Mono.TextTemplating:
- * Mono.TextTemplating.csproj:
- * Mono.TextTemplating/Tokeniser.cs:
- * Microsoft.VisualStudio.TextTemplating:
- * Mono.TextTemplating/ParsedTemplate.cs:
- * Microsoft.VisualStudio.TextTemplating/Engine.cs:
- * Microsoft.VisualStudio.TextTemplating/ToStringHelper.cs:
- * Microsoft.VisualStudio.TextTemplating/DirectiveProcessor.cs:
- * Microsoft.VisualStudio.TextTemplating/TextTransformation.cs:
- * Microsoft.VisualStudio.TextTemplating/ITextTemplatingEngineHost.cs:
- * Microsoft.VisualStudio.TextTemplating/DirectiveProcessorException.cs:
- * Microsoft.VisualStudio.TextTemplating/RequiresProvidesDirectiveProcessor.cs:
- Move T4 implementation to its own assembly. Tweak some
- appdomain stuff.
-
diff --git a/main/src/addins/TextTemplating/Mono.TextTemplating/Microsoft.VisualStudio.TextTemplating/TextTemplatingSession.cs b/main/src/addins/TextTemplating/Mono.TextTemplating/Microsoft.VisualStudio.TextTemplating/TextTemplatingSession.cs
index ce362d10c6..cf1fc83b20 100644
--- a/main/src/addins/TextTemplating/Mono.TextTemplating/Microsoft.VisualStudio.TextTemplating/TextTemplatingSession.cs
+++ b/main/src/addins/TextTemplating/Mono.TextTemplating/Microsoft.VisualStudio.TextTemplating/TextTemplatingSession.cs
@@ -31,12 +31,18 @@ using System.Runtime.Serialization;
namespace Microsoft.VisualStudio.TextTemplating
{
[Serializable]
- public sealed class TextTemplatingSession : Dictionary<string, Object>, ITextTemplatingSession
+ public sealed class TextTemplatingSession : Dictionary<string, Object>, ITextTemplatingSession, ISerializable
{
public TextTemplatingSession () : this (Guid.NewGuid ())
{
}
-
+
+ TextTemplatingSession (SerializationInfo info, StreamingContext context)
+ : base (info, context)
+ {
+ Id = (Guid)info.GetValue ("Id", typeof (Guid));
+ }
+
public TextTemplatingSession (Guid id)
{
this.Id = id;
@@ -66,6 +72,12 @@ namespace Microsoft.VisualStudio.TextTemplating
{
return other != null && other.Id == this.Id;
}
+
+ void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
+ {
+ base.GetObjectData (info, context);
+ info.AddValue ("Id", Id);
+ }
}
}
diff --git a/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating.nuspec b/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating.nuspec
index dc7ba85255..9b294cf88e 100644
--- a/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating.nuspec
+++ b/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating.nuspec
@@ -2,18 +2,20 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>Mono.TextTemplating</id>
- <version>1.0.0</version>
+ <version>1.1.0</version>
<title>Mono.TextTemplating</title>
- <authors>Michael Hutchinson</authors>
+ <authors>Mikayla Hutchinson</authors>
<licenseUrl>http://opensource.org/licenses/MIT</licenseUrl>
<projectUrl>https://github.com/mono/monodevelop/tree/master/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Open-source implementation of the T4 templating engine.</description>
- <releaseNotes>Built from MonoDevelop git repository, commit 94b807b84f7e9d164e44a57fc594039738e4a920</releaseNotes>
- <copyright>2009-2011 Novell, Inc. 2011-2014 Xamarin Inc.</copyright>
+ <releaseNotes>Built from MonoDevelop git repository, commit ad93842159363eaaebcb36701ac95a4eaef23c87</releaseNotes>
+ <copyright>2009-2011 Novell, Inc. 2011-2016 Xamarin Inc.</copyright>
<tags>T4, templating</tags>
</metadata>
<files>
- <file src="..\..\..\..\build\AddIns\MonoDevelop.TextTemplating\Mono.TextTemplating.dll" target="lib\Mono.TextTemplating.dll" />
+ <file src="../../../../build/AddIns/MonoDevelop.TextTemplating/Mono.TextTemplating.dll" target="lib/net45/Mono.TextTemplating.dll" />
+ <file src="../../../../build/AddIns/MonoDevelop.TextTemplating/TextTransform.exe" target="tools/TextTransform.exe" />
+ <file src="../../../../build/AddIns/MonoDevelop.TextTemplating/Mono.TextTemplating.dll" target="tools/Mono.TextTemplating.dll" />
</files>
-</package> \ No newline at end of file
+</package>
diff --git a/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/CompiledTemplate.cs b/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/CompiledTemplate.cs
index 1506211283..3679b6f860 100644
--- a/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/CompiledTemplate.cs
+++ b/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/CompiledTemplate.cs
@@ -121,13 +121,17 @@ namespace Mono.TextTemplating
Assembly ResolveReferencedAssemblies (object sender, ResolveEventArgs args)
{
- Assembly asm = null;
+ AssemblyName asmName = new AssemblyName (args.Name);
foreach (var asmFile in assemblyFiles) {
- var name = System.IO.Path.GetFileNameWithoutExtension (asmFile);
- if (args.Name.StartsWith (name, StringComparison.Ordinal))
- asm = Assembly.LoadFrom (asmFile);
+ if (asmName.Name == System.IO.Path.GetFileNameWithoutExtension (asmFile))
+ return Assembly.LoadFrom (asmFile);
}
- return asm;
+
+ var path = host.ResolveAssemblyReference (asmName.Name + ".dll");
+ if (System.IO.File.Exists (path))
+ return Assembly.LoadFrom (path);
+
+ return null;
}
public void Dispose ()
diff --git a/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/TemplateGenerator.cs b/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/TemplateGenerator.cs
index ebb5568c06..5c661ed7bb 100644
--- a/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/TemplateGenerator.cs
+++ b/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/TemplateGenerator.cs
@@ -264,6 +264,70 @@ namespace Mono.TextTemplating
{
parameters.Add (new ParameterKey (processorName, directiveName, parameterName), value);
}
+
+ /// <summary>
+ /// Parses a parameter and adds it.
+ /// </summary>
+ /// <returns>Whether the parameter was parsed successfully.</returns>
+ /// <param name="unparsedParameter">Parameter in name=value or processor!directive!name!value format.</param>
+ public bool TryAddParameter (string unparsedParameter)
+ {
+ string processor, directive, name, value;
+ if (TryParseParameter (unparsedParameter, out processor, out directive, out name, out value)) {
+ AddParameter (processor, directive, name, value);
+ return true;
+ }
+ return false;
+ }
+
+ internal static bool TryParseParameter (string parameter, out string processor, out string directive, out string name, out string value)
+ {
+ processor = directive = name = value = "";
+
+ int start = 0;
+ int end = parameter.IndexOfAny (new [] { '=', '!' });
+ if (end < 0)
+ return false;
+
+ //simple format n=v
+ if (parameter [end] == '=') {
+ name = parameter.Substring (start, end);
+ value = parameter.Substring (end + 1);
+ return !string.IsNullOrEmpty (name);
+ }
+
+ //official format, p!d!n!v
+ processor = parameter.Substring (start, end);
+
+ start = end + 1;
+ end = parameter.IndexOf ('!', start);
+ if (end < 0) {
+ //unlike official version, we allow you to omit processor/directive
+ name = processor;
+ value = parameter.Substring (start);
+ processor = "";
+ return !string.IsNullOrEmpty (name);
+ }
+
+ directive = parameter.Substring (start, end - start);
+
+
+ start = end + 1;
+ end = parameter.IndexOf ('!', start);
+ if (end < 0) {
+ //we also allow you just omit the processor
+ name = directive;
+ directive = processor;
+ value = parameter.Substring (start);
+ processor = "";
+ return !string.IsNullOrEmpty (name);
+ }
+
+ name = parameter.Substring (start, end - start);
+ value = parameter.Substring (end + 1);
+
+ return !string.IsNullOrEmpty (name);
+ }
protected virtual bool LoadIncludeText (string requestFileName, out string content, out string location)
{
diff --git a/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/TemplatingEngine.cs b/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/TemplatingEngine.cs
index 9425f6dae8..69a6f6a5c7 100644
--- a/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/TemplatingEngine.cs
+++ b/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/TemplatingEngine.cs
@@ -1094,6 +1094,7 @@ namespace Mono.TextTemplating
var initializeCodeGenerator = GetInitializeCodeGeneratorAction (cgType);
var cgFieldGen = cgType.GetMethod ("GenerateField", BindingFlags.NonPublic | BindingFlags.Instance);
var cgPropGen = cgType.GetMethod ("GenerateProperty", BindingFlags.NonPublic | BindingFlags.Instance);
+ var cgMethGen = cgType.GetMethod ("GenerateMethod", BindingFlags.NonPublic | BindingFlags.Instance);
#pragma warning disable 0618
var generator = (CodeGenerator) provider.CreateGenerator ();
@@ -1113,6 +1114,12 @@ namespace Mono.TextTemplating
cgPropGen.Invoke (generator, new object[] { p, dummy });
continue;
}
+ var m = member as CodeMemberMethod;
+ if (m != null) {
+ initializeCodeGenerator (generator, sw, options);
+ cgMethGen.Invoke (generator, new object[] { m, dummy });
+ continue;
+ }
}
}
diff --git a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/ChangeLog b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/ChangeLog
deleted file mode 100644
index 64bfcdfeac..0000000000
--- a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/ChangeLog
+++ /dev/null
@@ -1,191 +0,0 @@
-2010-07-20 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.TextTemplating.csproj: Added reference to
- mono.texteditor to allows windows builds.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * Gui/T4EditorExtension.cs: Track API changes.
-
-2010-07-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * T4SyntaxMode.xml: Added styles for templated regions in
- files, e.g. ASP.NET and T4.
-
-2010-07-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Parser/T4Parser.cs:
- * MonoDevelop.TextTemplating.addin.xml: Track
- ProjectDomService/Parser API.
-
-2010-06-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * TextTemplatingTool.cs: Make ThreadAsyncOperation public.
-
-2010-05-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * TextTemplatingService.cs: Allow RecyclableAppDomain to
- resolve assemblies from MD appdomain. Should fix issues
- running ASP.NET MVC templates.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.TextTemplating.csproj: Added missing core
- reference (required for System.Action).
-
-2010-05-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * TextTemplatingTool.cs: Make cancellable, so bad user code
- can be aborted.
-
-2010-04-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/T4EditorExtension.cs: Free up wasted space between
- scrollbars and treeview contents.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.TextTemplating.addin.xml: Bumped MD version.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * Gui/T4EditorExtension.cs:
- * MonoDevelop.TextTemplating.csproj:
- * MonoDevelop.TextTemplating.addin.xml: Merged MD.Projects
- into MD.Core, and MD.Projects.Gui, MD.Core.Gui and
- MD.Components into MD.Ide.
-
-2010-03-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * TextTemplatingTool.cs: Remove dead code.
-
-2010-03-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * TextTemplatingService.cs: Added shared templating appdomain.
-
- * TextTemplatingTool.cs: Added text templating tool.
-
- * Templates:
- * Templates/T4TemplateCSharp.xft.xml:
- * MonoDevelop.TextTemplating.addin.xml: Added T4 template.
-
- * Makefile.am:
- * MonoDevelop.TextTemplating.csproj: Updated.
-
-2010-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/T4EditorExtension.cs: File extensions are now declared
- in the node metadata.
-
- * MonoDevelop.TextTemplating.addin.xml: Added some conditions
- to avoid early loading of extensions.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.TextTemplating.addin.xml: Bump MD version.
-
-2009-10-08 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.TextTemplating.csproj: Mark *-sharp references
- with SpecificVersion=false. Import md.targets .
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.TextTemplating.addin.xml: Bump MD version.
-
-2009-09-12 Mike Krüger <mkrueger@novell.com>
-
- * Gui/T4EditorExtension.cs: Track API changes.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.TextTemplating.csproj: Updated dependencies. We
- now depend on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * AssemblyInfo.cs: Update assembly info.
-
- * MonoDevelop.TextTemplating.addin.xml: Typo.
-
-2009-08-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.TextTemplating.csproj: Don't local copy
- MD.Components.
-
-2009-08-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.TextTemplating.csproj: Fix build on windows.
-
-2009-08-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.TextTemplating.csproj: Don't local-copy project
- refs.
-
-2009-08-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.TextTemplating.csproj: Include the ASP.NET MVC
- and TextTemplating addins in the main solution and build.
-
-2009-08-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * TextTemplatingService.cs: Track task service API.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.TextTemplating.addin.xml: Bump MD version.
-
-2009-04-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Parser/T4Parser.cs: Track parser API.
-
-2009-04-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.TextTemplating.addin.xml: Fix refs.
-
-2009-03-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.TextTemplating.csproj: Move output dir from
- ../bin to ../build.
-
-2009-03-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/T4EditorExtension.cs: Fix warning.
-
- * TextTemplatingService.cs:
- * MonoDevelop.TextTemplating.csproj: Added new
- TextTemplatingService.
-
-2009-03-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui:
- * Gui/T4EditorExtension.cs:
- * MonoDevelop.TextTemplating.csproj:
- * MonoDevelop.TextTemplating.addin.xml: Add T4 editor
- extension with outlining.
-
-2009-03-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Parser/T4ParsedDocument.cs: More concise fold markers. Use
- new tag start position info.
-
-2009-03-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * .:
- * Parser:
- * AssemblyInfo.cs:
- * T4SyntaxMode.xml:
- * Parser/T4Parser.cs:
- * Parser/T4ParsedDocument.cs:
- * MonoDevelop.TextTemplating.csproj:
- * MonoDevelop.TextTemplating.addin.xml: Added new
- TextTemplating addin.
-
diff --git a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/Gui/T4EditorExtension.cs b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/Gui/T4EditorExtension.cs
index 260518ee9d..091402071e 100644
--- a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/Gui/T4EditorExtension.cs
+++ b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/Gui/T4EditorExtension.cs
@@ -32,6 +32,11 @@ using MonoDevelop.DesignerSupport;
using MonoDevelop.TextTemplating.Parser;
using MonoDevelop.Ide;
using ICSharpCode.NRefactory.TypeSystem;
+using MonoDevelop.Ide.Editor.Extension;
+using MonoDevelop.Ide.Editor;
+using System.Threading.Tasks;
+using System.Threading;
+using MonoDevelop.Core;
namespace MonoDevelop.TextTemplating.Gui
{
@@ -44,16 +49,16 @@ namespace MonoDevelop.TextTemplating.Gui
{
}
- public override void Initialize ()
+ protected override void Initialize ()
{
base.Initialize ();
- Document.DocumentParsed += HandleDocumentDocumentParsed;
+ DocumentContext.DocumentParsed += HandleDocumentDocumentParsed;
HandleDocumentDocumentParsed (this, EventArgs.Empty);
}
void HandleDocumentDocumentParsed (object sender, EventArgs e)
{
- parsedDoc = (T4ParsedDocument)Document.ParsedDocument;
+ parsedDoc = (T4ParsedDocument)DocumentContext.ParsedDocument;
if (parsedDoc != null)
RefreshOutline ();
}
@@ -71,30 +76,21 @@ namespace MonoDevelop.TextTemplating.Gui
protected T4ParsedDocument ParsedDoc {
get { return parsedDoc; }
}
-
- protected ITextBuffer Buffer {
- get {
- if (Document == null)
- throw new InvalidOperationException ("Editor extension not yet initialized");
- return Document.GetContent<ITextBuffer> ();
- }
- }
-
- protected IEditableTextBuffer EditableBuffer {
+
+ protected TextEditor EditableBuffer {
get {
- if (Document == null)
+ if (DocumentContext == null)
throw new InvalidOperationException ("Editor extension not yet initialized");
- return Document.GetContent<IEditableTextBuffer> ();
+ return DocumentContext.GetContent<TextEditor> ();
}
}
protected string GetBufferText (DomRegion region)
{
- MonoDevelop.Ide.Gui.Content.ITextBuffer buf = Buffer;
- int start = buf.GetPositionFromLineColumn (region.BeginLine, region.BeginColumn);
- int end = buf.GetPositionFromLineColumn (region.EndLine, region.EndColumn);
+ int start = Editor.LocationToOffset (region.BeginLine, region.BeginColumn);
+ int end = Editor.LocationToOffset (region.EndLine, region.EndColumn);
if (end > start && start >= 0)
- return buf.GetText (start, end);
+ return Editor.GetTextBetween (start, end);
else
return null;
}
@@ -103,31 +99,28 @@ namespace MonoDevelop.TextTemplating.Gui
#region Code completion
- public override ICompletionDataList CodeCompletionCommand (CodeCompletionContext completionContext)
+ public override Task<ICompletionDataList> CodeCompletionCommand (CodeCompletionContext completionContext)
{
int pos = completionContext.TriggerOffset;
if (pos <= 0)
return null;
- int triggerWordLength = 0;
- return HandleCodeCompletion ((CodeCompletionContext) completionContext, true, ref triggerWordLength);
+ return HandleCodeCompletion ((CodeCompletionContext) completionContext, true);
}
- public override ICompletionDataList HandleCodeCompletion (
- CodeCompletionContext completionContext, char completionChar, ref int triggerWordLength)
+ public override Task<ICompletionDataList> HandleCodeCompletionAsync (CodeCompletionContext completionContext, char completionChar, CancellationToken token = default(CancellationToken))
{
int pos = completionContext.TriggerOffset;
if (pos > 0 && Editor.GetCharAt (pos - 1) == completionChar) {
- return HandleCodeCompletion ((CodeCompletionContext) completionContext,
- false, ref triggerWordLength);
+ return HandleCodeCompletion (completionContext, false);
}
return null;
}
- protected virtual ICompletionDataList HandleCodeCompletion (
- CodeCompletionContext completionContext, bool forced, ref int triggerWordLength)
+ protected virtual Task<ICompletionDataList> HandleCodeCompletion (
+ CodeCompletionContext completionContext, bool forced)
{
//IEditableTextBuffer buf = this.EditableBuffer;
- return null;
+ return Task.FromResult<ICompletionDataList> (null);
}
#endregion
@@ -239,7 +232,7 @@ namespace MonoDevelop.TextTemplating.Gui
void RefillOutlineStore ()
{
- DispatchService.AssertGuiThread ();
+ Runtime.AssertMainThread ();
Gdk.Threads.Enter ();
refreshingOutline = false;
if (outlineTreeStore == null || !outlineTreeView.IsRealized)
@@ -272,9 +265,9 @@ namespace MonoDevelop.TextTemplating.Gui
void SelectSegment (Mono.TextTemplating.ISegment seg)
{
- int s = Editor.Document.LocationToOffset (seg.TagStartLocation.Line, seg.TagStartLocation.Column);
+ int s = Editor.LocationToOffset (seg.TagStartLocation.Line, seg.TagStartLocation.Column);
if (s > -1) {
- Editor.Caret.Offset = s;
+ Editor.CaretOffset = s;
Editor.CenterTo (s);
}
}
diff --git a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/MonoDevelop.TextTemplating.csproj b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/MonoDevelop.TextTemplating.csproj
index 91b0d65c0a..f7725166a1 100644
--- a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/MonoDevelop.TextTemplating.csproj
+++ b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/MonoDevelop.TextTemplating.csproj
@@ -77,6 +77,10 @@
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
+ <Reference Include="Microsoft.CodeAnalysis">
+ <HintPath>..\..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Folder Include="Parser\" />
@@ -104,16 +108,6 @@
<Name>MonoDevelop.Ide</Name>
<Private>False</Private>
</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="..\..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
- <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
- <Name>Mono.TextEditor</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\..\..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
<Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
<Name>ICSharpCode.NRefactory</Name>
diff --git a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/Parser/T4ParsedDocument.cs b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/Parser/T4ParsedDocument.cs
index 6c3e152a43..1d6036c153 100644
--- a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/Parser/T4ParsedDocument.cs
+++ b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/Parser/T4ParsedDocument.cs
@@ -29,35 +29,28 @@ using System.Collections.Generic;
using Mono.TextTemplating;
using MonoDevelop.Ide.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem;
+using MonoDevelop.Ide.Editor;
+using System.Linq;
namespace MonoDevelop.TextTemplating.Parser
{
- public class T4ParsedDocument : ParsedDocument
+ public class T4ParsedDocument : DefaultParsedDocument
{
- string fileName;
- IList<Error> errors;
+ IList<MonoDevelop.Ide.TypeSystem.Error> errors;
- public override string FileName {
- get {
- return fileName;
- }
- }
-
- public T4ParsedDocument (string fileName, List<ISegment> segments, IList<Error> errors)
+ public T4ParsedDocument (string fileName, List<ISegment> segments, IList<MonoDevelop.Ide.TypeSystem.Error> errors) : base(fileName)
{
- this.fileName = fileName;
this.errors = errors;
TemplateSegments = segments;
}
- public override IList<Error> Errors {
- get {
- return errors;
- }
+ public override System.Threading.Tasks.Task<IReadOnlyList<MonoDevelop.Ide.TypeSystem.Error>> GetErrorsAsync (System.Threading.CancellationToken cancellationToken)
+ {
+ return System.Threading.Tasks.Task.FromResult((IReadOnlyList<MonoDevelop.Ide.TypeSystem.Error>)errors);
}
-
+
public List<ISegment> TemplateSegments { get; private set; }
public IEnumerable<Directive> TemplateDirectives {
@@ -79,10 +72,15 @@ namespace MonoDevelop.TextTemplating.Parser
}
}
}
+
+ public override System.Threading.Tasks.Task<IReadOnlyList<FoldingRegion>> GetFoldingsAsync (System.Threading.CancellationToken cancellationToken)
+ {
+ return System.Threading.Tasks.Task.FromResult((IReadOnlyList<FoldingRegion>)Foldings.ToList ());
+ }
- public override IEnumerable<FoldingRegion> Foldings {
+ public IEnumerable<FoldingRegion> Foldings {
get {
- foreach (var region in Comments.ToFolds ())
+ foreach (var region in GetCommentsAsync().Result.ToFolds ())
yield return region;
foreach (ISegment seg in TemplateSegments) {
if (seg.EndLocation.Line - seg.TagStartLocation.Line < 1)
@@ -105,7 +103,7 @@ namespace MonoDevelop.TextTemplating.Parser
name = "<#@" + dir.Name + "...#>";
}
- DomRegion region = new DomRegion (seg.TagStartLocation.Line, seg.TagStartLocation.Column,
+ var region = new DocumentRegion (seg.TagStartLocation.Line, seg.TagStartLocation.Column,
seg.EndLocation.Line, seg.EndLocation.Column);
yield return new FoldingRegion (name, region, false);
diff --git a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/Parser/T4Parser.cs b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/Parser/T4Parser.cs
index a18ebdbc6a..d348e6340e 100644
--- a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/Parser/T4Parser.cs
+++ b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/Parser/T4Parser.cs
@@ -28,32 +28,35 @@ using System;
using System.IO;
using Mono.TextTemplating;
using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Projects;
using System.Collections.Generic;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
namespace MonoDevelop.TextTemplating.Parser
{
public class T4Parser : TypeSystemParser
{
- public override ParsedDocument Parse (bool storeAst, string fileName, TextReader content, Project project = null)
+ public override System.Threading.Tasks.Task<ParsedDocument> Parse (ParseOptions parseOptions, System.Threading.CancellationToken cancellationToken)
{
+ var fileName = parseOptions.FileName;
ParsedTemplate template = new ParsedTemplate (fileName);
+ var readOnlyDoc = TextEditorFactory.CreateNewReadonlyDocument (parseOptions.Content, fileName);
+
try {
- var tk = new Tokeniser (fileName, content.ReadToEnd ());
+ var tk = new Tokeniser (fileName, readOnlyDoc.Text);
template.ParseWithoutIncludes (tk);
} catch (ParserException ex) {
template.LogError (ex.Message, ex.Location);
}
-
var errors = new List<Error> ();
foreach (System.CodeDom.Compiler.CompilerError err in template.Errors) {
- errors.Add (new Error (err.IsWarning ? ErrorType.Warning : ErrorType.Error, err.ErrorText, err.Line, err.Column));
+ errors.Add (new Error (err.IsWarning ? ErrorType.Warning : ErrorType.Error, err.ErrorText, new DocumentLocation (err.Line, err.Column)));
}
var doc = new T4ParsedDocument (fileName, template.RawSegments, errors);
doc.Flags |= ParsedDocumentFlags.NonSerializable;
- return doc;
+ return System.Threading.Tasks.Task.FromResult((ParsedDocument)doc);
}
}
}
diff --git a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/T4FileTemplate.cs b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/T4FileTemplate.cs
index 7d0c9eb9c8..df1bb81309 100644
--- a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/T4FileTemplate.cs
+++ b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/T4FileTemplate.cs
@@ -25,13 +25,13 @@
// THE SOFTWARE.
using System;
-using System.Collections.Generic;
+using System.CodeDom.Compiler;
using System.IO;
+using System.Linq;
using System.Xml;
using MonoDevelop.Core;
-using MonoDevelop.Ide.Templates;
using MonoDevelop.Core.StringParsing;
-using Microsoft.VisualStudio.TextTemplating;
+using MonoDevelop.Ide.Templates;
namespace MonoDevelop.TextTemplating
{
@@ -66,11 +66,11 @@ namespace MonoDevelop.TextTemplating
if (host.Errors.HasErrors) {
foreach (var err in host.Errors)
LoggingService.LogError ("Error in template generator: {0}", err.ToString());
- throw new Exception ("Failed to generate file");
+ var firstError = host.Errors.OfType<CompilerError> ().First (f => !f.IsWarning);
+ throw new Exception ("Failed to generate file: " + firstError.ErrorText);
}
return output;
}
}
}
}
-
diff --git a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingFileGenerator.cs b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingFileGenerator.cs
index 44dd8582e3..e00280fc72 100644
--- a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingFileGenerator.cs
+++ b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingFileGenerator.cs
@@ -28,15 +28,16 @@ using System;
using MonoDevelop.Ide.CustomTools;
using MonoDevelop.Projects;
using MonoDevelop.Core;
+using System.Threading.Tasks;
using MonoDevelop.Ide;
namespace MonoDevelop.TextTemplating
{
public class TextTemplatingFileGenerator : ISingleFileCustomTool
{
- public IAsyncOperation Generate (IProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
+ public Task Generate (ProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
{
- return new ThreadAsyncOperation (delegate {
+ return Task.Run (delegate {
using (var host = new ProjectFileTemplatingHost (file, IdeApp.Workspace.ActiveConfiguration)) {
host.AddMonoDevelopHostImport ();
var defaultOutputName = file.FilePath.ChangeExtension (".cs"); //cs extension for VS compat
@@ -51,7 +52,7 @@ namespace MonoDevelop.TextTemplating
foreach (var err in host.Errors)
monitor.Log.WriteLine (err);
}
- }, result);
+ });
}
static bool warningLogged;
diff --git a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingFilePreprocessor.cs b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingFilePreprocessor.cs
index 358f7de463..4387d8d872 100644
--- a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingFilePreprocessor.cs
+++ b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingFilePreprocessor.cs
@@ -32,14 +32,15 @@ using MonoDevelop.Core;
using MonoDevelop.Ide;
using MonoDevelop.Ide.CustomTools;
using MonoDevelop.Projects;
+using System.Threading.Tasks;
namespace MonoDevelop.TextTemplating
{
public class TextTemplatingFilePreprocessor : ISingleFileCustomTool
{
- public IAsyncOperation Generate (IProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
+ public Task Generate (ProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
{
- return new ThreadAsyncOperation (delegate {
+ return Task.Run (delegate {
using (var host = new ProjectFileTemplatingHost (file, IdeApp.Workspace.ActiveConfiguration)) {
string outputFile;
@@ -51,7 +52,7 @@ namespace MonoDevelop.TextTemplating
foreach (var err in host.Errors)
monitor.Log.WriteLine (err);
}
- }, result);
+ });
}
static void Generate (TemplateGenerator host, ProjectFile file, out string outputFile)
@@ -106,4 +107,3 @@ namespace MonoDevelop.TextTemplating
}
}
}
-
diff --git a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingService.cs b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingService.cs
index e434450482..78a26818aa 100644
--- a/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingService.cs
+++ b/main/src/addins/TextTemplating/MonoDevelop.TextTemplating/TextTemplatingService.cs
@@ -39,7 +39,7 @@ namespace MonoDevelop.TextTemplating
TaskService.Errors.Clear ();
foreach (CompilerError err in errors) {
- TaskService.Errors.Add (new Task (err.FileName, err.ErrorText, err.Column, err.Line,
+ TaskService.Errors.Add (new TaskListEntry (err.FileName, err.ErrorText, err.Column, err.Line,
err.IsWarning? TaskSeverity.Warning : TaskSeverity.Error));
}
TaskService.ShowErrors ();
diff --git a/main/src/addins/TextTemplating/TextTransform/ChangeLog b/main/src/addins/TextTemplating/TextTransform/ChangeLog
deleted file mode 100644
index 08db48eca0..0000000000
--- a/main/src/addins/TextTemplating/TextTransform/ChangeLog
+++ /dev/null
@@ -1,25 +0,0 @@
-2009-08-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * TextTransform.csproj: Include the ASP.NET MVC and
- TextTemplating addins in the main solution and build.
-
-2009-03-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * TextTransform.csproj: Move output dir from ../bin to
- ../build.
-
-2009-03-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * TextTransform.csproj: Updated.
-
- * TextTransform.cs: Complete the runner implementation.
-
-2009-03-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * Options.cs:
- * AssemblyInfo.cs:
- * TextTransform.cs:
- * TextTransform.csproj: Stub out the command-line
- TextTransform tool.
-
diff --git a/main/src/addins/TextTemplating/TextTransform/TextTransform.cs b/main/src/addins/TextTemplating/TextTransform/TextTransform.cs
index e4f239e320..914b739fe9 100644
--- a/main/src/addins/TextTemplating/TextTransform/TextTransform.cs
+++ b/main/src/addins/TextTemplating/TextTransform/TextTransform.cs
@@ -67,7 +67,7 @@ namespace Mono.TextTemplating
{ "I=", "Paths to search for included files", s => generator.IncludePaths.Add (s) },
{ "P=", "Paths to search for referenced assemblies", s => generator.ReferencePaths.Add (s) },
{ "dp=", "Directive processor (name!class!assembly)", s => directives.Add (s) },
- { "a=", "Parameters ([processorName]![directiveName]!name!value)", s => parameters.Add (s) },
+ { "a=", "Parameters (name=value) or ([processorName!][directiveName!]name!value)", s => parameters.Add (s) },
{ "h|?|help", "Show help", s => ShowHelp (false) },
// { "k=,", "Session {key},{value} pairs", (s, t) => session.Add (s, t) },
{ "c=", "Preprocess the template into {0:class}", (s) => preprocess = s },
@@ -82,7 +82,7 @@ namespace Mono.TextTemplating
inputFile = remainingArgs [0];
if (!File.Exists (inputFile)) {
- Console.Error.WriteLine ("Input file '{0}' does not exist.");
+ Console.Error.WriteLine ("Input file '{0}' does not exist.", inputFile);
return -1;
}
@@ -97,38 +97,30 @@ namespace Mono.TextTemplating
}
}
- //FIXME: implement quoting and escaping for values
foreach (var par in parameters) {
- var split = par.Split ('!');
- if (split.Length < 2) {
- Console.Error.WriteLine ("Parameter does not have enough values: {0}", par);
+ if (!generator.TryAddParameter (par)) {
+ Console.Error.WriteLine ("Parameter has incorrect format: {0}", par);
return -1;
}
- if (split.Length > 2) {
- Console.Error.WriteLine ("Parameter has too many values: {0}", par);
- return -1;
- }
- string name = split[split.Length-2];
- string val = split[split.Length-1];
- if (string.IsNullOrEmpty (name)) {
- Console.Error.WriteLine ("Parameter has no name: {0}", par);
- return -1;
- }
- generator.AddParameter (split.Length > 3? split[0] : null, split.Length > 2? split[split.Length-3] : null, name, val);
}
foreach (var dir in directives) {
var split = dir.Split ('!');
+
if (split.Length != 3) {
- Console.Error.WriteLine ("Directive does not have correct number of values: {0}", dir);
+ Console.Error.WriteLine ("Directive must have 3 values: {0}", dir);
return -1;
}
- foreach (var s in split) {
+
+ for (int i = 0; i < 3; i++) {
+ string s = split [i];
if (string.IsNullOrEmpty (s)) {
- Console.Error.WriteLine ("Directive has missing value: {0}", dir);
+ string kind = i == 0? "name" : (i == 1 ? "class" : "assembly");
+ Console.Error.WriteLine ("Directive has missing {0} value: {1}", kind, dir);
return -1;
}
}
+
generator.AddDirectiveProcessor (split[0], split[1], split[2]);
}
diff --git a/main/src/addins/VBNetBinding/ChangeLog b/main/src/addins/VBNetBinding/ChangeLog
deleted file mode 100644
index 23c009ae4f..0000000000
--- a/main/src/addins/VBNetBinding/ChangeLog
+++ /dev/null
@@ -1,1306 +0,0 @@
-2010-07-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Parser/DomParser.cs:
- * VBNetBinding.addin.xml: Track ProjectDomService/Parser API.
-
-2010-06-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBBindingCompilerServices.cs: Track api changes.
-
-2010-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/VBConsoleApplicationProject.xpt.xml: Set the
- external console flag for console projects.
-
-2010-05-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.addin.xml: Remove duplicated options section.
-
-2010-05-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.addin.xml: Fix type reference. Fixes bug
- #602452 - VB project options fail.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * VBNetBinding.addin.xml: Bumped MD version.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * VBNetBinding.csproj:
- * VBNetBinding.addin.xml:
- * Gui/ImportsOptionsPanel.cs:
- * Gui/ProjectOptionsPanel.cs:
- * VBBindingCompilerServices.cs:
- * Gui/ImportsOptionsPanelWidget.cs:
- * Gui/ConfigurationOptionsPanel.cs:
- * Gui/ProjectOptionsPanelWidget.cs:
- * Gui/ConfigurationOptionsPanelWidget.cs: Merged MD.Projects
- into MD.Core, and MD.Projects.Gui, MD.Core.Gui and
- MD.Components into MD.Ide.
-
-2010-03-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * Project/VBNetResourceIdBuilder.cs: Track ProjectFile Link
- API.
-
-2010-03-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Parser/DomParser.cs: Use getter and setter modifiers.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.csproj: Flush.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/objects.xml:
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.VBNetBinding.ProjectOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.VBNetBinding.ImportsOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.VBNetBinding.ConfigurationOptionsPanelWidget.cs:
- Flush.
-
-2009-12-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/VBGtkSharp2Project.xpt.xml: Set correct assembly
- target for gui projects.
-
-2009-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBLanguageBinding.cs:
- * VBBindingCompilerServices.cs: Introduced the
- ConfigurationSelector class to all methods that previously
- took a configuration name as string. This eliminates the
- ambiguity between solution configuration names and project
- configuration names.
-
-2009-11-24 Rolf Bjarne Kvinge <RKvinge@novell.com>
-
- * VBBindingCompilerServices.cs: When setting the doc file, use quotes
- in case the filename has spaces.
-
-2009-11-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/VBProjectParameters.cs: Use the new
- DotNetProjectParameters base class, and inform that in VB,
- the default namespace is implicit.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * VBNetBinding.addin.xml: Bump MD version.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBBindingCompilerServices.cs: Trim file name.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates\VBGtkSharp2Project.xpt.xml: Add missing reference
- (vbc requires it).
-
- * VBBindingCompilerServices.cs: Fixed error parsing regex so
- that it works for MS's vbc. Added -quiet parameter to remove
- unrequired output messages.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/AssemblyInfo.xft.xml: Fix template so that it
- works with MS.NET.
-
- * VBBindingCompilerServices.cs: Improve error message when the
- compiler is not found.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBBindingCompilerServices.cs: Locate the correct compiler
- and set the required env vars for the target runtime object.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/objects.xml:
- * VBNetBinding.csproj:
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.VBNetBinding.ImportsOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.VBNetBinding.ProjectOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.VBNetBinding.ConfigurationOptionsPanelWidget.cs:
- Flush.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * VBNetBinding.addin.xml: Update license.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * VBNetBinding.addin.xml: Bump MD version.
-
-2009-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/DomParser.cs:
- * VBLanguageBinding.cs:
- * VBBindingCompilerServices.cs:
- * Project/VBCompilerParameters.cs: Updated license. Markus
- Palme has relicensed to MIT/X11.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.csproj: Updated dependencies. We now depend on
- gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * VBNetBinding.csproj: Flush.
-
-2009-06-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/VBConsoleApplicationProject.xpt.xml: Add a
- reference to system.dll.
-
-2009-04-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * VBLanguageBinding.cs: Track comment tag API.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * VBNetBinding.csproj: don't require specific gtk-sharp version.
-
-2009-04-17 Mike Krüger <mkrueger@novell.com>
-
- * VBLanguageBinding.cs:
- * VBNetBinding.addin.xml: Removed icon service.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * VBNetBinding.addin.xml: Bump MD version.
-
-2009-03-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/VBGtkSharp2Project.xpt.xml: Don't require specific
- GTK# versions.
-
-2009-03-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBBindingCompilerServices.cs: Added workaround for bug
- 484351 - VB projects compile with warning "optioninfer was
- not recognized.
-
-2009-03-17 Mike Krüger <mkrueger@novell.com>
-
- * Parser/DomParser.cs: Track API changes.
-
-2009-03-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * VBNetBinding.csproj: Don't local-copy project refs.
-
-2009-03-10 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * VBNetBinding.csproj: Monodevelop changed the reference a
- bit.
-
-2009-03-10 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * VBNetBinding.csproj: Updated nrefactory reference.
-
-2009-02-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * VBNetBinding.csproj:
- * gtk-gui/objects.xml:
- * ProjectExtensions.cs:
- * VBLanguageBinding.cs:
- * VBNetBinding.addin.xml:
- * Gui/ProjectOptionsPanel.cs:
- * Gui/ImportsOptionsPanel.cs:
- * VBBindingCompilerServices.cs:
- * Project/VBProjectParameters.cs:
- * Project/VBCompilerParameters.cs:
- * Gui/ProjectOptionsPanelWidget.cs:
- * Gui/ImportsOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.VBNetBinding.ProjectOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.VBNetBinding.ImportsOptionsPanelWidget.cs:
- Use the new ProjectParameters class and property to store
- global project settings that were previously stored as
- custom properties. Split the compiler options in two panels,
- one with the basic options and one with the imports.
-
-2009-02-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * Project/Import.cs:
- * gtk-gui/gui.stetic:
- * VBNetBinding.csproj:
- * VBLanguageBinding.cs:
- * VBNetBinding.addin.xml:
- * VBBindingCompilerServices.cs:
- * Gui/ProjectOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.VBNetBinding.ProjectOptionsPanelWidget.cs:
- Use the new API to properly implement support for Import
- items.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Parser/DomParser.cs: Remove unused (but invalid) namespace,
- as csc doesn't like it.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.csproj: Flush.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * VBNetBinding.mdp:
- * VBNetBinding.mds:
- * VBNetBinding.csproj: Migrated to MSBuild file format.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * VBNetBinding.addin.xml: Bump MD version.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.mdp: Flush.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.mdp:
- * gtk-gui/gui.stetic: Set correct gtk# version.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Flush.
-
-2009-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/VBNetResourceIdBuilder.cs: Track api changes.
-
-2009-01-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.mdp:
- * gtk-gui/objects.xml:
- * gtk-gui/MonoDevelop.VBNetBinding.ProjectOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.VBNetBinding.ConfigurationOptionsPanelWidget.cs:
- Flush.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * VBNetBinding.mdp: Flush project format changes.
-
-2008-12-30 Rolf Bjarne Kvinge <RKvinge@novell.com>
-
- * VBAmbience.cs: Deleted (unused).
-
- * Gui/CodeGenerationPanel.cs:
- * Gui/CodeGenerationPanelWidget.cs:
- * gtk-gui/MonoDevelop.VBNetBinding.CodeGenerationPanelWidget.cs:
- Deleted, replaced with new widgets.
-
- * Gui/VBCompilerPanel.cs:
- * Gui/ChooseRuntimePanel.cs:
- * Gui/GuiMessageRecipient.cs:
- * Gui/TextEditorOptionsPanel.cs:
- * Gui/VBDocConfigurationPanel.cs: Delete unused dialogs.
-
- * Makefile.am:
- * md1format.xml:
- * VBNetBinding.mdp: Updated.
-
- * gtk-gui/gui.stetic:
- * VBCodeGenerator.cs:
- * gtk-gui/objects.xml:
- * gtk-gui/generated.cs:
- * ProjectExtensions.cs:
- * VBLanguageBinding.cs:
- * VBNetBinding.addin.xml:
- * Gui/ProjectOptionsPanel.cs:
- * VBBindingCompilerServices.cs:
- * Project/VBCompilerParameters.cs:
- * Gui/ConfigurationOptionsPanel.cs:
- * Gui/ProjectOptionsPanelWidget.cs:
- * Project/VBNetResourceIdBuilder.cs:
- * Gui/ConfigurationOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.VBNetBinding.ProjectOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.VBNetBinding.ConfigurationOptionsPanelWidget.cs:
-
- Major overhaul:
- - Added two new dialogs, one for project-specific options and one
- for configuration-specific options. All other dialogs have been
- removed.
- - Fixed (de)serialization of project-specific options, they are now
- correctly passed to the compiler (optionstrict|explicit|compare|
- infer + a few more).
- - We're passing a lot more options to the compiler (-define:_MyType,
- -optimize, -optioninfer, -optionstrict, -codepage , -rootnamespace,
- -define:DEBUG/TRACE, -doc, -removeintchecks, -imports).
- - Warnings emitted by the compiler are correctly detected as warnings
- instead of errors.
- - Unified namespace to MonoDevelop.VBNetBinding (there was a mix
- between VBBInding, MonoDevelop.VBBinding and MonoDevelop.VBNetBinding).
-
-2008-12-29 Rolf Bjarne Kvinge <RKvinge@novell.com>
-
- * FormattingStrategy:
- * Parser/SharpDevelopTree:
- * Parser/SharpDevelopTree/Class.cs:
- * Parser/SharpDevelopTree/ReturnType.cs:
- * Parser/SharpDevelopTree/Constructor.cs:
- * FormattingStrategy/VBFormattingStrategy.cs:
- * Parser/SharpDevelopTree/CompilationUnit.cs: Deleted unused/empty
- files.
-
-2008-12-29 Rolf Bjarne Kvinge <RKvinge@novell.com>
-
- * VBNetBinding.mdp: Updated.
-
-2008-12-29 Rolf Bjarne Kvinge <RKvinge@novell.com>
-
- * Makefile.am:
- * Parser/Parser.cs:
- * Parser/Resolver.cs:
- * Parser/TypeVisitor.cs:
- * Parser/VBNetVisitor.cs:
- * Parser/ExpressionFinder.cs: Delete unused/commented out files.
-
-2008-12-29 Rolf Bjarne Kvinge <RKvinge@novell.com>
-
- * SharpRefactoryVB:
- * SharpRefactoryVB/src:
- * SharpRefactoryVB/src/Lexer:
- * SharpRefactoryVB/src/Parser:
- * SharpRefactoryVB/src/CodeDom:
- * SharpRefactoryVB/src/Main.cs:
- * SharpRefactoryVB/Makefile.am:
- * SharpRefactoryVB/src/Parser/AST:
- * SharpRefactoryVB/src/Lexer/Reader:
- * SharpRefactoryVB/src/Lexer/Specials:
- * SharpRefactoryVB/src/Lexer/Lexer.cs:
- * SharpRefactoryVB/src/AssemblyInfo.cs:
- * SharpRefactoryVB/src/CSharpConverter:
- * SharpRefactoryVB/src/Parser/generated:
- * SharpRefactoryVB/src/Parser/AST/INode.cs:
- * SharpRefactoryVB/src/Parser/AST/Enums.cs:
- * SharpRefactoryVB/src/Parser/AST/TypeLevel:
- * SharpRefactoryVB/src/Parser/AST/Statements:
- * SharpRefactoryVB/src/Parser/AST/GlobalScope:
- * SharpRefactoryVB/src/Parser/AST/Expressions:
- * SharpRefactoryVB/src/Parser/AST/Modifier.cs:
- * SharpRefactoryVB/src/Lexer/Reader/IReader.cs:
- * SharpRefactoryVB/src/CodeDom/CodeDOMVisitor.cs:
- * SharpRefactoryVB/src/Parser/generated/Makefile:
- * SharpRefactoryVB/src/Parser/AST/IASTVisitor.cs:
- * SharpRefactoryVB/src/Lexer/Specials/Comment.cs:
- * SharpRefactoryVB/src/Lexer/Specials/NewLine.cs:
- * SharpRefactoryVB/src/Parser/generated/Parser.cs:
- * SharpRefactoryVB/src/Parser/generated/Errors.cs:
- * SharpRefactoryVB/src/Parser/generated/VBNET.ATG:
- * SharpRefactoryVB/src/Lexer/Reader/FileReader.cs:
- * SharpRefactoryVB/src/Parser/AST/AbstractNode.cs:
- * SharpRefactoryVB/src/Lexer/Specials/TagComment.cs:
- * SharpRefactoryVB/src/Parser/generated/keywordlist:
- * SharpRefactoryVB/src/Lexer/Reader/StringReader.cs:
- * SharpRefactoryVB/src/Parser/generated/Parser.frame:
- * SharpRefactoryVB/src/Lexer/Specials/CommentType.cs:
- * SharpRefactoryVB/src/Parser/AST/CompilationUnit.cs:
- * SharpRefactoryVB/src/Parser/generated/Modifiers.cs:
- * SharpRefactoryVB/src/Parser/generated/Scanner.frame:
- * SharpRefactoryVB/src/Parser/AST/LookupTableVisitor.cs:
- * SharpRefactoryVB/src/Parser/generated/buildparser.cmd:
- * SharpRefactoryVB/src/Parser/AST/AbstractASTVisitor.cs:
- * SharpRefactoryVB/src/Lexer/Specials/SpecialTracker.cs:
- * SharpRefactoryVB/src/CSharpConverter/CSharpVisitor.cs:
- * SharpRefactoryVB/src/Parser/generated/ParamModifiers.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/Statement.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/IfStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/Expression.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/ForStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/EndStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/TypeLevel/HandlesClause.cs:
- * SharpRefactoryVB/src/Parser/AST/TypeLevel/TypeReference.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/LockStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/StopStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/WithStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/ExitStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/GoToStatement.cs:
- * SharpRefactoryVB/src/Parser/generated/keywordlist/Tokens.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/LabelStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/ReDimStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/BlockStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/ErrorStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/WhileStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/ThrowStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/EraseStatements.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/DoLoopStatement.cs:
- * SharpRefactoryVB/src/Parser/generated/keywordlist/Keywords.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/ResumeStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/ReturnStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/SelectStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/TypeLevel/ImplementsClause.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/CastExpression.cs:
- * SharpRefactoryVB/src/Lexer/Specials/PreProcessingDirective.cs:
- * SharpRefactoryVB/src/Parser/AST/TypeLevel/FieldDeclaration.cs:
- * SharpRefactoryVB/src/Parser/AST/TypeLevel/EventDeclaration.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/OnErrorStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/GlobalScope/TypeDeclaration.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/ForeachStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/TypeLevel/PropertyGetRegion.cs:
- * SharpRefactoryVB/src/Parser/AST/TypeLevel/MethodDeclaration.cs:
- * SharpRefactoryVB/src/Parser/AST/TypeLevel/PropertySetRegion.cs:
- * SharpRefactoryVB/src/Parser/AST/GlobalScope/ImportsStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/TypeOfExpression.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/TryCatchStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/TypeLevel/DeclareDeclaration.cs:
- * SharpRefactoryVB/src/Parser/AST/TypeLevel/PropertyDeclaration.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/GetTypeExpression.cs:
- * SharpRefactoryVB/src/Parser/AST/TypeLevel/VariableDeclaration.cs:
- * SharpRefactoryVB/src/Parser/AST/GlobalScope/ImportsDeclaration.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/AddHandlerStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/RaiseEventStatement.cs:
- * SharpRefactoryVB/src/Parser/generated/keywordlist/KeywordList.txt:
- * SharpRefactoryVB/src/Parser/AST/Expressions/PrimitiveExpression.cs:
- * SharpRefactoryVB/src/Parser/generated/keywordlist/BuildKeywords.pl:
- * SharpRefactoryVB/src/Parser/AST/Expressions/AddressOfExpression.cs:
- * SharpRefactoryVB/src/Parser/AST/GlobalScope/DelegateDeclaration.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/StatementExpression.cs:
- * SharpRefactoryVB/src/Parser/AST/TypeLevel/ConstructorDeclaration.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/InvocationExpression.cs:
- * SharpRefactoryVB/src/Parser/AST/GlobalScope/NamespaceDeclaration.cs:
- * SharpRefactoryVB/src/Parser/AST/GlobalScope/AttributeDeclaration.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/IdentifierExpression.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/AssignmentExpression.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/RemoveHandlerStatement.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/ArrayCreateExpression.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/ObjectCreateExpression.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/ParenthesizedExpression.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/BaseReferenceExpression.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/NamedArgumentExpression.cs:
- * SharpRefactoryVB/src/Parser/AST/GlobalScope/ImportsAliasDeclaration.cs:
- * SharpRefactoryVB/src/Parser/AST/Statements/LocalVariableDeclaration.cs:
- * SharpRefactoryVB/src/Parser/AST/GlobalScope/OptionStrictDeclaration.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/ThisReferenceExpression.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/TypeReferenceExpression.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/UnaryOperatorExpression.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/ClassReferenceExpression.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/BinaryOperatorExpression.cs:
- * SharpRefactoryVB/src/Parser/AST/GlobalScope/OptionCompareDeclaration.cs:
- * SharpRefactoryVB/src/Parser/AST/GlobalScope/OptionExplicitDeclaration.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/ArrayInitializerExpression.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/LoopControlVariableExpression.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/ParameterDeclarationExpression.cs:
- * SharpRefactoryVB/src/Parser/AST/Expressions/FieldReferenceOrInvocationExpression.cs:
- Delete a lot of unused/empty files.
-
- * ProjectNodeBuilder.cs: Delete unused file.
-
-2008-12-29 Rolf Bjarne Kvinge <RKvinge@novell.com>
-
- * md1format.xml: Sync with VBCompilerParameters.
-
-2008-12-29 Rolf Bjarne Kvinge <RKvinge@novell.com>
-
- * Project/VBCompilerParameters.cs:
- * Gui/CodeGenerationPanelWidget.cs: Remove compiler parameters which
- aren't applicable to any vb compiler. Added MyType compiler
- parameter.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.mdp: All projects now require fx 3.5.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.mdp: Don't require a specific version of Mono.Addins.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Make it work for parallel build.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * AssemblyInfo.cs: Add AssemblyInfo.cs files that are autogenerated from
- the addin manifests.
-
-2008-11-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * VBBindingCompilerServices.cs: Skip the space after the end of
- filenames when capturing error locations. Fixes Bug 444089 - File not
- found when going to source of error.
-
-2008-11-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CodeGenerationPanelWidget.cs: Fix NRE.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.addin.xml: Bump MD version.
-
-2008-11-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * Gui/CodeGenerationPanelWidget.cs: Disable CompileTarget and MainClass
- setting when project.IsLibraryBasedProjectType. Prevents messing up
- ASP.NET and Moonlight projects.
-
-2008-10-28 Mike Krüger <mkrueger@novell.com>
-
- * VBNetBinding.addin.xml: Removed vb ambience.
-
-2008-10-28 Mike Krüger <mkrueger@novell.com>
-
- * VBNetBinding.addin.xml: fixed 'Bug 399737 - Code completion busted for
- referenced assemblies that are not in GAC, are outside of the
- solution, and which are referenced by other non-GAC outside
- referenced assemblies'.
-
-2008-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * VBBindingCompilerServices.cs: Track API.
-
-2008-10-01 Rolf Bjarne Kvinge <RKvinge@novell.com>
-
- * VBBindingCompilerServices.cs: GenerateOptions: Output the actual
- additional parameters to the compiler command, not the length of
- the additional parameters.
-
-2008-09-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * Parser/DomParser.cs: Track API.
-
-2008-09-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.mdp, md1format.xml, Makefile.am: Add missing file.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.mdp, gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.VBNetBinding.CodeGenerationPanelWidget.cs:
- Updated generated code.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CodeGenerationPanelWidget.cs: Track api changes.
-
-2008-09-10 Mike Krüger <mkrueger@novell.com>
-
- * Parser/DomParser.cs: Changed compilation unit/document meta
- information interface.
-
-2008-09-09 Mike Krüger <mkrueger@novell.com>
-
- * Parser/DomParser.cs: Some changes caused by interface changes.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CodeGenerationPanelWidget.cs, Parser/Parser.cs,
- Parser/DomParser.cs, Parser/VBNetVisitor.cs, Parser/Resolver.cs,
- Parser/TypeVisitor.cs, Parser/ExpressionFinder.cs,
- Parser/SharpDevelopTree/CompilationUnit.cs,
- Parser/SharpDevelopTree/ReturnType.cs,
- Parser/SharpDevelopTree/Class.cs,
- Parser/SharpDevelopTree/Constructor.cs, VBAmbience.cs,
- VBLanguageBinding.cs: Translated old code to new dom.
-
-2008-07-28 Mike Krüger <mkrueger@novell.com>
-
- * Parser/TypeVisitor.cs: Some changes for the new nrefactory.
-
-2008-07-27 Mike Krüger <mkrueger@novell.com>
-
- * Parser/DomParser.cs: Worked on code completion/new dom.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/VBCompilerParameters.cs: Moved serialization engine to
- MonoDevelop.Core. Use new syntax for specifying attribute scope.
-
-2008-07-15 Mike Krüger <mkrueger@novell.com>
-
- * Parser/DomParser.cs: Added missing method (interface changed).
-
-2008-07-14 Mike Krüger <mkrueger@novell.com>
-
- * Parser/DomParser.cs: Added missing method (interface changed).
-
-2008-06-14 Ankit Jain <jankit@novell.com>
-
- Fix bug #400300.
- * VBBindingCompilerServices.cs (ParseOutput): Returns BuildResult now.
- Move construction of BuildResult to here.
-
-2008-06-14 Ankit Jain <jankit@novell.com>
-
- * VBBindingCompilerServices.cs (GenerateOptions): Emit -debug option.
-
-2008-06-13 Mike Krüger <mkrueger@novell.com>
-
- * Parser/DomParser.cs: worked on dom parser.
-
-2008-06-13 Mike Krüger <mkrueger@novell.com>
-
- * Parser/DomParser.cs: Some changes in the vb.net dom parser.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.addin.xml: Bump MD version.
-
-2008-05-28 Mike Krüger <mkrueger@novell.com>
-
- * VBNetBinding.addin.xml, Parser/DomParser.cs: Worked on vb.net dom
- parser.
-
-2008-05-27 Mike Krüger <mkrueger@novell.com>
-
- * VBNetBinding.mdp, Parser/DomParser.cs, Makefile.am: Added new dom
- parser for vb.net.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.addin.xml: Merged the extension points for project and
- solution option panels into a single extension point. A single
- extension point will now be used for all kinds of items. Extension
- conditions can be used to make panels visible only for some
- specific item types.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBBindingCompilerServices.cs, VBLanguageBinding.cs: Replaced
- ICompilerResult/DefaultCompilerResult/CompilerResults by a new
- BuildResult class, which has owner information at error level, so
- it is possible to know which project generated an error when
- building a solution. Updated Task and TaskService to use the new
- owner information.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CodeGenerationPanel.cs, Gui/CodeGenerationPanelWidget.cs,
- VBNetBinding.addin.xml, VBNetBinding.mdp, VBNetBinding.mds,
- VBBindingCompilerServices.cs, Project/VBCompilerParameters.cs,
- Project/VBNetResourceIdBuilder.cs, gtk-gui/objects.xml,
- gtk-gui/gui.stetic, Makefile.am: New project model changes.
-
-2008-05-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * VBNetBinding.addin.xml: Set "isText" attribute on the mimetype
- definitions.
-
-2008-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Don't check using's region, since it is the
- region of the using declaration only.
-
-2008-04-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.addin.xml: Use the new mime type extension to register
- new file types.
- * gtk-gui/MonoDevelop.VBNetBinding.CodeGenerationPanelWidget.cs:
- Updated.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CodeGenerationPanelWidget.cs,
- gtk-gui/MonoDevelop.VBNetBinding.CodeGenerationPanelWidget.cs: Worked on
- gnome hig compliant alerts.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * VB.glade, Gui/CodeGenerationPanel.cs, Gui/CodeGenerationPanelWidget.cs,
- VBNetBinding.addin.xml, VBNetBinding.mdp, VBBindingCompilerServices.cs,
- Project/VBCompilerParameters.cs, Makefile.am: Removed old glade widget,
- improved option panel a bit.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.addin.xml: Update MD version.
-
-2008-01-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CodeGenerationPanel.cs: Ensure we don't create subclasses of classes
- with private fields bound by glade#. It would not work due to bug
- 355228.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/EmptyVBFile.xft.xml, templates/EmptyVBProject.xpt.xml,
- templates/AssemblyInfo.xft.xml, templates/VBGtkSharp2Project.xpt.xml,
- templates/VBConsoleApplicationProject.xpt.xml: Make template categories
- translatable.
-
-2008-01-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * VBBindingCompilerServices.cs: Update the compiler output parsing regex to
- handle all vbnc errors and correctly extract file and position info when
- present.
-
-2008-01-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Parser/Parser.cs: Merge some code from C# binding so that VB parser
- actually tags classes with the filename in which they're defined. Fixes
- CodeBehind grouping and double-clicking on items in the class pad.
-
-2008-01-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * VBNetBinding.mdp, Makefile.am, VBLanguageBinding.cs, VBCodeGenerator.cs:
- Import VB.NET CodeDOM generator from Mono to get partial class support
- and keyword escaping support.
-
-2007-12-31 Michael Hutchinson <mhutchinson@novell.com>
-
- * VBNetBinding.addin.xml, VBNetBinding.mdp, templates/AssemblyInfo.xft.xml,
- Makefile.am: Add AssemblyInfo template.
- * templates/EmptyVBFile.xft.xml: Use standard header.
- * templates/VBGtkSharp2Project.xpt.xml,
- templates/VBConsoleApplicationProject.xpt.xml: Use standard headers and
- AssemblyInfo template.
-
-2007-12-31 Michael Hutchinson <mhutchinson@novell.com>
-
- * VBBindingCompilerServices.cs: Use WaitForOutput instead of WaitForExit to
- make sure we get all of the output, or the output-collecting thread can
- sometimes try to write to the StringWriter after it's disposed, and
- crash the IDE. Also tidy up code.
- * Makefile.am: Updated.
- * VBLanguageBinding.cs: We don't support the 1.1 profile for VB, so remove
- it.
-
-2007-12-26 Rolf Bjarne Kvinge <RKvinge@novell.com>
-
- * VBNetBinding.addin.xml: Remove Gtk# 1.0 template. Add the
- RuntimeOptionsPanel so that projects can change their clr version.
- * templates/VBGtkSharpProject.xpt.xml, Makefile.am: Remove Gtk# 1.0
- template.
- * VBLanguageBinding.cs: Add support for 2.0 clr versions.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/CodeGenerationPanel.cs: Fix warning.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.addin.xml: Bump add-in versions.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.addin.xml, VBNetBinding.mdp, VBNetBinding.mds, Makefile.am:
- Directory reorganization.
-
-2007-11-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/VBCompilerParameters.cs: Removed some obsolete attributes.
-
-2007-10-29 Rolf Bjarne Kvinge <RKvinge@novell.com>
-
- * VBBindingCompilerServices.cs: A few changes to cope with vbnc''s issues:
- Use the compiler's exit code to determine whether the compile failed,
- and not the presence or not of errors parsed from the compiler output.
- If the compile failed (exit code != 0) and no errors were correctly
- parsed, show the entire output, since it's probable that the compiler
- crashed somehow. Also show the commandline used to compile in MD's
- output window, as well as any compiler output. Use in-memory storage
- instead of temporary files for compiler output.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.addin.xml: Bump MD version.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.addin.xml: Track changes in the Icon extension node.
-
-2007-10-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * icons/VB.File.EmptyFile, icons/VB.File.Form, icons/VB.File.FullFile,
- icons/VB.File.NewClass, icons/VB.File.WebFile,
- icons/VB.Project.ServiceProject, icons/VB.Project.UserControl,
- icons/VB.Project.WebProject, Makefile.am, templates/EmptyVBFile.xft.xml,
- VBNetBinding.mdp: Use tango file icons. Removed obsolete icons.
-
-2007-10-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.mdp, templates/EmptyVBProject.xpt.xml,
- templates/VBGtkSharpProject.xpt.xml,
- templates/VBGtkSharp2Project.xpt.xml,
- templates/VBConsoleApplicationProject.xpt.xml, Makefile.am,
- icons/VB.Project.Library, icons/VB.ProjectIcon,
- icons/VB.Project.DOSProject, icons/VB.Project.EmptyProject,
- icons/vb-icon-32.png, icons/VB.Project.FullProject,
- icons/VB.Project.Form: Updated project icons. Use the base project icon
- with an overlay to show the type.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.mdp, VBNetBinding.mds: Project file names updated by change
- in MD path functions.
-
-2007-10-12 Mike Krüger <mkrueger@novell.com>
-
- * VBBindingCompilerServices.cs: Applied changes that were neccassary for to
- the new FileService.
-
-2007-10-11 Mike Krüger <mkrueger@novell.com>
-
-
-
-2007-10-09 Ankit Jain <jankit@novell.com>
-
- * VBBindingCompilerServices.cs: Removed code for building resources. Its
- done by DotNetProject now.
-
-2007-10-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.mdp: Fix warning level.
- * Parser/VBNetVisitor.cs, Parser/Resolver.cs: Track api changes.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.addin.xml: Bump MD version.
-
-2007-09-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBAmbience.cs: Track API changes.
-
-2007-09-04 Michael Hutchinson <MHutchinson@novell.com>
-
- * Gui/CodeGenerationPanel.cs, VBAmbience.cs: Fix some compiler warnings.
-
-2007-08-31 Mike Krüger <mkrueger@novell.com>
-
- * Gui/CodeGenerationPanel.cs, Parser/Resolver.cs, VBAmbience.cs,
- VBBindingCompilerServices.cs: Changes due to new property
- infrastructure.
-
-2007-08-23 Mike Krüger <mkrueger@novell.com>
-
- * Parser/Parser.cs, Parser/VBNetVisitor.cs, Parser/Resolver.cs,
- Parser/TypeVisitor.cs, Parser/SharpDevelopTree/ReturnType.cs,
- Parser/SharpDevelopTree/Class.cs,
- Parser/SharpDevelopTree/Constructor.cs: Changed to the latest NRefactory
- version.
-
-2007-08-23 Ankit Jain <jankit@novell.com>
-
- * VBBindingCompilerServices.cs (GetResourceId): Generate .resources
- with resgen only if required. Set resource id even if resgen is not required.
-
-2007-08-23 Ankit Jain <jankit@novell.com>
- Andrés G. Aragoneses <knocte@gmail.com>
-
- * VBBindingCompilerServices.cs (GetResourceId): Use MONO_IOMAP=drive and
- only on unix.
-
-2007-08-14 Ankit Jain <jankit@novell.com>
-
- * VBBindingCompilerServices.cs (GetResourceId): Run resgen with
- MONO_IOMAP=all. See bug #82398.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.addin.xml, VBNetBinding.mdp, Makefile.am: Reorganized the
- extension point hierarchy. Embedded all add-in manifests as resources.
-
-2007-07-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBBindingCompilerServices.cs: Make sure all output generated by the
- compiler process is read.
-
-2007-07-03 Mike Krüger <mkrueger@novell.com>
-
- * VBBindingCompilerServices.cs: added signing support.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.mdp: Added missing file.
-
-2007-05-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.mdp, Makefile.am: Reference shared assemblies from the
- correct location.
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/ChooseRuntimePanel.cs, Gui/CodeGenerationPanel.cs,
- VBNetBinding.addin.xml, VBNetBinding.mdp, Makefile.am: Migration to
- Mono.Addins.
-
-2007-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.mdp: Don't copy referenced assemblies.
- * VBNetBinding.mds: Updated.
-
-2007-03-20 Ankit Jain <jankit@novell.com>
-
- * templates/VBGtkSharp2Project.xpt.xml: Rename AssemblyInfo.cs to .vb
- Fix Main.vb . Patch by Yasser Mekled (yassermekled@gmail.com), fixes
- bug#81114.
- * templates/VBGtkSharpProject.xpt.xml: Likewise.
- * templates/VBConsoleApplicationProject.xpt.xml: Make comments
- consistent.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.addin.xml: Change add-in versions to 0.13.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.mdp, VBNetBinding.mds, Makefile.am: Synchronized the MD
- project and the Makefile
-
-2007-02-02 Ankit Jain <jankit@novell.com>
-
- * VBBindingCompilerServices.cs (Compile): Move resource compiling code
- to ..
- (GetResourceId): .. here. Improve error messages.
-
-2007-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/VBNetVisitor.cs, Parser/SharpDevelopTree/Constructor.cs: Track
- api changes.
-
-2007-01-11 Ankit Jain <jankit@novell.com>
-
- * VBBindingCompilerServices.cs (Compile): Echo resgen command line
- for debugging purpose.
-
-2007-01-11 Ankit Jain <jankit@novell.com>
-
- * VBBindingCompilerServices.cs (Compile): .resx file has paths
- relative to the .resx file itself.
-
-2006-12-21 Ankit Jain <jankit@novell.com>
-
- * VBBindingCompilerServices.cs (Compile): Use project's base
- directory as the working directory when invoking the compiler.
- (DoCompilation): Add param 'working_dir'.
-
-2006-12-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/VBCompilerPanel.cs, ProjectNodeBuilder.cs,
- VBBindingCompilerServices.cs: Track changes in the FileService
- class.
- * Gui/VBDocConfigurationPanel.cs: Use the FileService for deleting
- files.
- * Gui/CodeGenerationPanel.cs: Removed unused var.
-
-2006-12-15 Ankit Jain <jankit@novell.com>
-
- * VBBindingCompilerServices.cs (Compile): Filename arg to resgen should
- be quoted.
-
-2006-12-15 Ankit Jain <jankit@novell.com>
-
- * VBBindingCompilerServices.cs (Compile): Use resgen to convert .resx
- to embeddable resource format (.resources). Handle 'null' resourceId.
-
-2006-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.mdp, Parser/SharpDevelopTree/Indexer.cs,
- Parser/SharpDevelopTree/Method.cs,
- Parser/SharpDevelopTree/Parameter.cs,
- Parser/SharpDevelopTree/Event.cs, Parser/SharpDevelopTree/Field.cs,
- Parser/SharpDevelopTree/Property.cs,
- Parser/SharpDevelopTree/AttributeSection.cs, Makefile.am: Removed
- some unnecessary Default* subclasses.
- * Parser/VBNetVisitor.cs, Parser/Resolver.cs,
- Parser/SharpDevelopTree/CompilationUnit.cs,
- Parser/SharpDevelopTree/ReturnType.cs,
- Parser/SharpDevelopTree/Class.cs,
- Parser/SharpDevelopTree/Constructor.cs: Renamed Abstract* classes
- to Default*. Removed some unnecessary Default* subclasses.
-
-2006-12-13 Ankit Jain <jankit@novell.com>
-
- * Project/VBCompilerParameters.cs (Win32Resource): New.
- * VBBindingCompilerServices.cs (GenerateOptions): Generate
- option for Win32Resource. Don't generate option for win32icon
- if win32resource is defined.
-
-2006-12-12 Ankit Jain <jankit@novell.com>
-
- * VBBindingCompilerServices.cs (Compile): Use ProjectFile.ResourceId for
- embedded resources.
-
-2006-11-14 Ankit Jain <jankit@novell.com>
-
- * Gui/CodeGenerationPanel.cs (CodeGenerationPanelWidget.SetValues): Fix
- the order of the CompileTarget options.
-
-2006-09-18 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * VBNetBinding.mdp:
- * VBNetBinding.mds:
- Updated.
-
- * .: Added svn:ignore for VBNetBinding.pidb.
-
-2006-09-12 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * VBBindingCompilerServices.cs: Fixed win32 pathing/compilation issues, removed /bin/sh dependence, removed \r.
-
-2006-09-12 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * VBAmbience.cs: Track changes in Ambience.
-
-2006-07-11 Philip Turnbull <philip.turnbull@gmail.com>
-
- * VBNetBinding/VBNetBinding.addin.xml:
- Added VB Ambience.
-
- * VBNetBinding/VBAmbience.cs:
- Track API changes in Ambience.
-
-2006-07-05 Matej Urbas <matej.urbas@gmail.com>
-
- * Parser/VBNetVisitor.cs:
- * Parser/Resolver.cs: Updated to use ReturnType as BaseTypes in IClass
- instances.
-
-2006-07-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBLanguageBinding.cs:
- * VBBindingCompilerServices.cs: Track changes in ProjectReference.
- Removed obsolete GenerateMakefile method.
- * VBNetBinding.addin.xml: Updated versions.
-
-2006-06-24 John Luke <john.luke@gmail.com>
-
- * Makefile.am: reference NRefactory not SharpRefactory.VB
- * SharpRefactoryVB: remove old VB parser
- * VBNetBinding.addin.xml: remove SharpRefactory.VB
- * Parser/*.cs: port to NRefactory
-
-2006-06-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.addin.xml: Use the DataType element instead fof Class
- to declare serializable types.
-
-2006-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.addin.xml: Updated versions.
- * VBNetBinding.mdp: Updated.
-
-2006-04-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBLanguageBinding.cs: Implement GetSupportedClrVersions.
-
-2006-04-07 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * VBNetBinding.addin.xml: renamed attribute in FileFilter Extension
-
-2006-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * VBNetBinding.addin.xml: Updated references.
-
-2006-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.mdp:
- * MonoQuery/MonoQuery.mdp: Updated.
- * Makefile.am:
- * SharpRefactoryVB/Makefile.am: Use an unified format.
- Patch by Matze Braun.
-
- * VBNetBinding.addin.xml: Updated add-in versions.
-
-2006-03-17 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * Parser/Parser.cs:
- * Parser/Resolver.cs:
- Removed unused MonodocResolver.
-
-2006-03-12 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * VB.glade: Marking some strings not to be translated. Not include balast in pot file.
-
-2006-01-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBBindingCompilerServices.cs:
- * Parser/Resolver.cs:
- * Parser/Parser.cs: Track changes in parser api.
-
-2006-01-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/VBNetVisitor.cs:
- * Parser/SharpDevelopTree/AttributeSection.cs:
- * Parser/Parser.cs: Track api changes.
-
- * Parser/ExpressionFinder.cs: Updated from SharpDevelop.
-
-2005-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Parser.cs: Track changes in the api.
- * VBLanguageBinding.cs: Implemented the new methods in
- IDotNetLanguageBinding.
-
-2005-10-11 John Luke <john.luke@gmail.com>
-
- * Makefile.am: remove SharpAssembly reference
- * VBAmbience.cs: comment out SharpAssembly stuff
-
-2005-10-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.addin.xml: Fixed incorrect class name.
-
-2005-10-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.addin.xml: Fixed addin header information.
- Use "id" attribuet instead of "name" to identify addins.
-
-2005-10-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.addin.xml:
- * VBLanguageBinding.cs: Register serializable types in the addin
- configuration file.
-
-2005-10-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Fix reference to ICSharpCode.SharpRefactory.VB.dll.
-
-2005-10-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBNetBinding.addin.xml: Added addin dependencies.
- * Makefile.am: Fix location of ICSharpCode.SharpRefactory.VB.dll.
-
-2005-08-20 John Luke <john.luke@gmail.com>
-
- * Parser/Resolver.cs:
- * Parser/ExpressionFinder.cs: fix 2 warnings of assigning
- a variable to itself
-
-2005-08-20 Peter Johanson <latexer@gentoo.org>
-
- * templates/VBGtkSharp2Project.xpt.xml: Fix gtk-sharp references to
- match new assembly versions.
-
-2005-08-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/*:
- * VBNetBinding.addin.xml: Properly reference resource icons and
- templates.
- * Makefile.am: Embed icon and templates as resources.
-
-2005-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs:
- * Gui/CodeGenerationPanel.cs:
- * Parser/Parser.cs: Use the new IParserContext API.
-
-2005-07-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Project/VBCompilerParameters.cs: Implement ICloneable.
- * VBLanguageBinding.cs: CreateCompilationParameters now returns an
- ICloneable.
-
-2005-07-01 John Luke <john.luke@gmail.com>
-
- * SharpRefeactoryVB/Makefile.am:
- build to MonoDevelop/build/bin so .mdb file goes to the right place
- remove stray CSC definition
-
-2005-05-06 John Luke <john.luke@gmail.com>
-
- * Makefile.am: replace 'make' with $(MAKE)
- This fixes it on FreeBSD, should work everywhere.
- by cnehren@gmail.com (Christopher Nehren)
-
-2005-04-17 John Luke <john.luke@gmail.com>
-
- * Makefile.am: fix distcheck
-
-2005-03-30 John Luke <john.luke@gmail.com>
-
- * Parser/Parser.cs: stop printing 'Entering VB parser'
-
-2005-03-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Parser/Resolver.cs: Track api changes.
-
-2005-02-16 Ben Motmans <ben.motmans@gmail.com>
-
- * EmptyVBFile.xpt.xml:
- * EmptyVBProject.xpt.xml:
- * VBConsoleApplicationProject.xpt.xml:
- Consistent naming
-
- * VBGtkSharpProject.xpt.xml:
- * VBGtkSharp2Project.xpt.xml:
- * VBNetBinding.addin.xml:
- * Makefile.am:
- Added templates
-
-2005-01-28 John Luke <john.luke@gmail.com>
-
- * SharpRefactoryVB/src/Lexer/Lexer.cs:
- * SharpRefactoryVB/src/Parser/generated/Parser.cs:
- * SharpRefactoryVB/src/Parser/generated/VBNET.ATG:
- warning fixes for unused code
- * SharpRefactoryVB/src/Parser/generated/Makefile:
- add makefile to regen parser
-
-2005-01-28 John Luke <john.luke@gmail.com>
-
- * Parser/Parser.cs: update to CanParse
-
-2005-01-27 John Luke <john.luke@gmail.com>
-
- * VB.glade: update to new glade format
-
- * VB.glade:
- * Gui/CodeGenerationPanel.cs:
- * Parser/VBNetVisitor.cs:
- * Parser/Resolver.cs:
- * VBBindingCompilerServices.cs: fix some warnings,
- use ComboBox instead of OptionMenu
-
-2005-01-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBBindingCompilerServices.cs:
- * VBLanguageBinding.cs: Use the new progress monitor API.
-
-2005-01-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBCompilerPanel.cs:
- * Gui/ChooseRuntimePanel.cs:
- * Gui/VBDocConfigurationPanel.cs:
- * Gui/CodeGenerationPanel.cs:
- * VBNetBinding.addin.xml:
- * ProjectNodeBuilder.cs:
- * Parser/Parser.cs:
- * Parser/Resolver.cs:
- * VBBindingCompilerServices.cs:
- * VBLanguageBinding.cs: Follow architecture changes.
-
- * Gui/OutputOptionsPanel.cs:
- * VB.glade: Removed dialog now implemented in Monodevelop.Base.
-
- * Project/VBCompilerParameters.cs: Moved some parameters and enum
- definitions to DotNetProjectConfiguration.
-
- * Project/VBProject.cs:
- * VBBindingExecutionServices.cs: Removed. Not needed any more.
- * Makefile.am: Updated.
-
-2004-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * VBBindingCompilerServices.cs: StatusBarService.ProgressMonitor is not a
- StatusBar widget any more.
-
-2004-12-07 Alexandre Gomes <alexmipego@hotmail.com>
-
- * VBLanguageBinding.cs: Added CommentTag to be used by (Un)CommentCode
-
-2004-11-05 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Imported from #D and made to work with MD tools and namespaces
diff --git a/main/src/addins/VBNetBinding/Gui/ConfigurationOptionsPanel.cs b/main/src/addins/VBNetBinding/Gui/ConfigurationOptionsPanel.cs
index 71148c8a1b..80c602a526 100644
--- a/main/src/addins/VBNetBinding/Gui/ConfigurationOptionsPanel.cs
+++ b/main/src/addins/VBNetBinding/Gui/ConfigurationOptionsPanel.cs
@@ -28,6 +28,7 @@
using System;
+using MonoDevelop.Components;
using MonoDevelop.Projects;
using MonoDevelop.Ide.Gui.Dialogs;
@@ -41,7 +42,7 @@ namespace MonoDevelop.VBNetBinding
{
}
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
Console.WriteLine ("ConfigurationOptionsPanel.CreatePanelWidget");
return (widget = new ConfigurationOptionsPanelWidget (ConfiguredProject));
diff --git a/main/src/addins/VBNetBinding/Gui/ImportsOptionsPanel.cs b/main/src/addins/VBNetBinding/Gui/ImportsOptionsPanel.cs
index 76fb8745fa..ea3eb9fe18 100644
--- a/main/src/addins/VBNetBinding/Gui/ImportsOptionsPanel.cs
+++ b/main/src/addins/VBNetBinding/Gui/ImportsOptionsPanel.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.VBNetBinding
@@ -36,7 +37,7 @@ namespace MonoDevelop.VBNetBinding
{
}
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return (widget = new ImportsOptionsPanelWidget (ConfiguredProject));
}
diff --git a/main/src/addins/VBNetBinding/Gui/ProjectOptionsPanel.cs b/main/src/addins/VBNetBinding/Gui/ProjectOptionsPanel.cs
index a456dc913b..9217e09362 100644
--- a/main/src/addins/VBNetBinding/Gui/ProjectOptionsPanel.cs
+++ b/main/src/addins/VBNetBinding/Gui/ProjectOptionsPanel.cs
@@ -26,7 +26,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.VBNetBinding
@@ -39,7 +39,7 @@ namespace MonoDevelop.VBNetBinding
{
}
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return (widget = new ProjectOptionsPanelWidget (ConfiguredProject));
}
diff --git a/main/src/addins/VBNetBinding/Gui/ProjectOptionsPanelWidget.cs b/main/src/addins/VBNetBinding/Gui/ProjectOptionsPanelWidget.cs
index 211b6a8f7a..bb130ea23c 100644
--- a/main/src/addins/VBNetBinding/Gui/ProjectOptionsPanelWidget.cs
+++ b/main/src/addins/VBNetBinding/Gui/ProjectOptionsPanelWidget.cs
@@ -38,9 +38,8 @@ namespace MonoDevelop.VBNetBinding
[System.ComponentModel.ToolboxItem(true)]
public partial class ProjectOptionsPanelWidget : Gtk.Bin
{
- DotNetProject project;
- VBProjectParameters parameters;
-
+ VBProject project;
+
public ProjectOptionsPanelWidget (MonoDevelop.Projects.Project project)
{
Gtk.ListStore store;
@@ -48,9 +47,8 @@ namespace MonoDevelop.VBNetBinding
this.Build();
- this.project = (DotNetProject) project;
- parameters = (VBProjectParameters) this.project.LanguageParameters;
-
+ this.project = (VBProject) project;
+
cr = new Gtk.CellRendererText ();
store = new Gtk.ListStore (typeof (string));
store.AppendValues (GettextCatalog.GetString ("Executable"));
@@ -71,7 +69,7 @@ namespace MonoDevelop.VBNetBinding
store.AppendValues ("Console");
txtMyType.Model = store;
txtMyType.TextColumn = 0;
- switch (parameters.MyType) {
+ switch (this.project.MyType) {
case "WindowsForms":
txtMyType.Active = 0;
break;
@@ -85,7 +83,7 @@ namespace MonoDevelop.VBNetBinding
case "":
break;
default:
- txtMyType.AppendText (parameters.MyType);
+ txtMyType.AppendText (this.project.MyType);
txtMyType.Active = 3;
break;
}
@@ -97,7 +95,7 @@ namespace MonoDevelop.VBNetBinding
cmbOptionCompare.Model = store;
cmbOptionCompare.PackStart (cr, true);
cmbOptionCompare.AddAttribute (cr, "text", 0);
- cmbOptionCompare.Active = parameters.BinaryOptionCompare ? 0 : 1;
+ cmbOptionCompare.Active = this.project.BinaryOptionCompare ? 0 : 1;
cr = new Gtk.CellRendererText ();
store = new Gtk.ListStore (typeof (string));
@@ -106,7 +104,7 @@ namespace MonoDevelop.VBNetBinding
cmbOptionExplicit.Model = store;
cmbOptionExplicit.PackStart (cr, true);
cmbOptionExplicit.AddAttribute (cr, "text", 0);
- cmbOptionExplicit.Active = parameters.OptionExplicit ? 0 : 1;
+ cmbOptionExplicit.Active = this.project.OptionExplicit ? 0 : 1;
cr = new Gtk.CellRendererText ();
store = new Gtk.ListStore (typeof (string));
@@ -115,7 +113,7 @@ namespace MonoDevelop.VBNetBinding
cmbOptionInfer.Model = store;
cmbOptionInfer.PackStart (cr, true);
cmbOptionInfer.AddAttribute (cr, "text", 0);
- cmbOptionInfer.Active = parameters.OptionInfer ? 0 : 1;
+ cmbOptionInfer.Active = this.project.OptionInfer ? 0 : 1;
cr = new Gtk.CellRendererText ();
store = new Gtk.ListStore (typeof (string));
@@ -124,11 +122,11 @@ namespace MonoDevelop.VBNetBinding
cmbOptionStrict.Model = store;
cmbOptionStrict.PackStart (cr, true);
cmbOptionStrict.AddAttribute (cr, "text", 0);
- cmbOptionStrict.Active = parameters.OptionStrict ? 0 : 1;
+ cmbOptionStrict.Active = this.project.OptionStrict ? 0 : 1;
// Codepage
string foundEncoding = null;
- string currentCodepage = parameters.CodePage;
+ string currentCodepage = this.project.CodePage;
foreach (TextEncoding e in TextEncoding.SupportedEncodings) {
if (e.CodePage == -1)
continue;
@@ -141,21 +139,21 @@ namespace MonoDevelop.VBNetBinding
else if (!string.IsNullOrEmpty (currentCodepage))
cmbCodePage.Entry.Text = currentCodepage;
- entryMainClass.Entry.Text = parameters.StartupObject;
- iconEntry.Path = parameters.ApplicationIcon;
+ entryMainClass.Entry.Text = this.project.StartupObject;
+ iconEntry.Path = this.project.ApplicationIcon;
}
public void StorePanelContents ()
{
- parameters.BinaryOptionCompare = cmbOptionCompare.ActiveText == "Binary";
- parameters.OptionExplicit = cmbOptionExplicit.ActiveText == "On";
- parameters.OptionInfer = cmbOptionInfer.ActiveText == "On";
- parameters.OptionStrict = cmbOptionStrict.ActiveText == "On";
- parameters.MyType = txtMyType.ActiveText;
- parameters.StartupObject = entryMainClass.ActiveText;
- parameters.CodePage = cmbCodePage.Entry.Text;
- parameters.ApplicationIcon = iconEntry.Path;
- this.project.CompileTarget = (CompileTarget) compileTargetCombo.Active;
+ project.BinaryOptionCompare = cmbOptionCompare.ActiveText == "Binary";
+ project.OptionExplicit = cmbOptionExplicit.ActiveText == "On";
+ project.OptionInfer = cmbOptionInfer.ActiveText == "On";
+ project.OptionStrict = cmbOptionStrict.ActiveText == "On";
+ project.MyType = txtMyType.ActiveText;
+ project.StartupObject = entryMainClass.ActiveText;
+ project.CodePage = cmbCodePage.Entry.Text;
+ project.ApplicationIcon = iconEntry.Path;
+ project.CompileTarget = (CompileTarget) compileTargetCombo.Active;
}
}
}
diff --git a/main/src/addins/VBNetBinding/Project/Import.cs b/main/src/addins/VBNetBinding/Project/Import.cs
index f8685402fa..227b7a27a1 100644
--- a/main/src/addins/VBNetBinding/Project/Import.cs
+++ b/main/src/addins/VBNetBinding/Project/Import.cs
@@ -30,14 +30,14 @@ using MonoDevelop.Projects;
namespace MonoDevelop.VBNetBinding
{
- [DataItem ("Import")]
- public class Import: SimpleProjectItem
+ public class Import: ProjectItem
{
public Import ()
{
+ ItemName = "Import";
}
- public Import (string include)
+ public Import (string include): this ()
{
Include = include;
}
diff --git a/main/src/addins/VBNetBinding/Project/ImprovedCodeDomProvider.cs b/main/src/addins/VBNetBinding/Project/ImprovedCodeDomProvider.cs
new file mode 100644
index 0000000000..b958a72628
--- /dev/null
+++ b/main/src/addins/VBNetBinding/Project/ImprovedCodeDomProvider.cs
@@ -0,0 +1,40 @@
+//
+// ImprovedCodeDomProvider.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.CodeDom.Compiler;
+
+namespace MonoDevelop.VBNetBinding
+{
+ public class ImprovedCodeDomProvider : Microsoft.VisualBasic.VBCodeProvider
+ {
+ [Obsolete ("Use CodeDomProvider class")]
+ public override ICodeGenerator CreateGenerator ()
+ {
+ return new VBCodeGenerator ();
+ }
+ }
+}
+
diff --git a/main/src/addins/VBNetBinding/Project/VBCompilerParameters.cs b/main/src/addins/VBNetBinding/Project/VBCompilerParameters.cs
index 386f8cab79..87a3ee16eb 100644
--- a/main/src/addins/VBNetBinding/Project/VBCompilerParameters.cs
+++ b/main/src/addins/VBNetBinding/Project/VBCompilerParameters.cs
@@ -36,7 +36,7 @@ using MonoDevelop.Core.Serialization;
namespace MonoDevelop.VBNetBinding
{
- public class VBCompilerParameters: ConfigurationParameters
+ public class VBCompilerParameters: DotNetCompilerParameters
{
//
// Project level properties:
@@ -104,7 +104,6 @@ namespace MonoDevelop.VBNetBinding
[ItemProperty ("AdditionalParameters")]
string additionalParameters = String.Empty;
- [Obsolete]
public override void AddDefineSymbol (string symbol)
{
var symbols = new List<string> (GetDefineSymbols ());
@@ -112,7 +111,6 @@ namespace MonoDevelop.VBNetBinding
definesymbols = string.Join (";", symbols) + ";";
}
- [Obsolete]
public override void RemoveDefineSymbol (string symbol)
{
var symbols = new List<string> (GetDefineSymbols ());
diff --git a/main/src/addins/VBNetBinding/Project/VBNetResourceIdBuilder.cs b/main/src/addins/VBNetBinding/Project/VBNetResourceIdBuilder.cs
index c6bcf8008f..c1bef2c519 100644
--- a/main/src/addins/VBNetBinding/Project/VBNetResourceIdBuilder.cs
+++ b/main/src/addins/VBNetBinding/Project/VBNetResourceIdBuilder.cs
@@ -31,16 +31,16 @@ using System;
using System.IO;
using System.Text;
using MonoDevelop.Projects.Extensions;
-using MonoDevelop.Projects.Formats.MSBuild;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.VBNetBinding
{
- class VBNetResourceIdBuilder : MSBuildResourceHandler
+ class VBNetResourceIdBuilder
{
- public override string GetDefaultResourceId (ProjectFile pf)
+ public static string GetDefaultResourceId (ProjectFile pf)
{
if (String.IsNullOrEmpty (pf.DependsOn))
- return base.GetDefaultResourceId (pf);
+ return null;
string ns = null;
string classname = null;
@@ -70,7 +70,7 @@ namespace MonoDevelop.VBNetBinding
}
if (classname == null)
- return base.GetDefaultResourceId (pf);
+ return null;
string culture, extn, only_filename;
if (MSBuildProjectService.TrySplitResourceName (pf.ProjectVirtualPath, out only_filename, out culture, out extn))
@@ -99,7 +99,7 @@ namespace MonoDevelop.VBNetBinding
* skips comments,
* skips strings "foo"
*/
- string GetNextToken (StreamReader sr)
+ static string GetNextToken (StreamReader sr)
{
StringBuilder sb = new StringBuilder ();
diff --git a/main/src/addins/VBNetBinding/Project/VBProjectExtension.cs b/main/src/addins/VBNetBinding/Project/VBProjectExtension.cs
new file mode 100644
index 0000000000..94db4dd019
--- /dev/null
+++ b/main/src/addins/VBNetBinding/Project/VBProjectExtension.cs
@@ -0,0 +1,145 @@
+//
+// VBProjectExtension.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Projects;
+using MonoDevelop.Projects.MSBuild;
+using MonoDevelop.Core.Serialization;
+using System.Diagnostics;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.VBNetBinding
+{
+ class VBProject: DotNetProject
+ {
+ [ItemProperty ("OptionInfer", DefaultValue="Off")]
+ string optionInfer = "Off";
+
+ [ItemProperty ("OptionExplicit", DefaultValue="On")]
+ string optionExplicit = "On";
+
+ [ItemProperty ("OptionCompare", DefaultValue="Binary")]
+ string optionCompare = "Binary";
+
+ [ItemProperty ("OptionStrict", DefaultValue="Off")]
+ string optionStrict = "Off";
+
+ [ItemProperty ("MyType", DefaultValue="")]
+ string myType = string.Empty;
+
+ [ItemProperty ("StartupObject", DefaultValue="")]
+ string startupObject = string.Empty;
+
+ [ProjectPathItemProperty ("ApplicationIcon", DefaultValue="")]
+ string applicationIcon = string.Empty;
+
+ [ItemProperty ("CodePage", DefaultValue="")]
+ string codePage = string.Empty;
+
+ public bool OptionInfer {
+ get { return optionInfer == "On"; }
+ set { optionInfer = value ? "On" : "Off"; }
+ }
+
+ public bool OptionExplicit {
+ get { return optionExplicit == "On"; }
+ set { optionExplicit = value ? "On" : "Off"; }
+ }
+
+ public bool BinaryOptionCompare {
+ get { return optionCompare == "Binary"; }
+ set { optionCompare = value ? "Binary" : "Text"; }
+ }
+
+ public bool OptionStrict {
+ get { return optionStrict == "On"; }
+ set { optionStrict = value ? "On" : "Off"; }
+ }
+
+ public string MyType {
+ get { return myType; }
+ set { myType = value ?? string.Empty; }
+ }
+
+ public string StartupObject {
+ get { return startupObject; }
+ set { startupObject = value ?? string.Empty; }
+ }
+
+ public string ApplicationIcon {
+ get { return applicationIcon; }
+ set { applicationIcon = value ?? string.Empty; }
+ }
+
+ public string CodePage {
+ get { return codePage; }
+ set { codePage = value ?? string.Empty; }
+ }
+
+ protected override void OnInitialize ()
+ {
+ base.OnInitialize ();
+ DefaultNamespaceIsImplicit = true;
+ SupportsRoslyn = true;
+ StockIcon = "md-project";
+ }
+
+ VBBindingCompilerServices compilerServices = new VBBindingCompilerServices();
+
+ protected override BuildResult OnCompileSources (ProjectItemCollection items, DotNetProjectConfiguration configuration, ConfigurationSelector configSelector, MonoDevelop.Core.ProgressMonitor monitor)
+ {
+ Debug.Assert(compilerServices != null);
+ return compilerServices.Compile (items, configuration, configSelector, monitor);
+ }
+
+ protected override DotNetCompilerParameters OnCreateCompilationParameters (DotNetProjectConfiguration config, ConfigurationKind kind)
+ {
+ var pars = new VBCompilerParameters ();
+ if (kind == ConfigurationKind.Debug)
+ pars.AddDefineSymbol ("DEBUG");
+ else if (kind == ConfigurationKind.Release)
+ pars.Optimize = true;
+ return pars;
+ }
+
+ protected override ClrVersion[] OnGetSupportedClrVersions ()
+ {
+ return new ClrVersion[] { ClrVersion.Net_2_0, ClrVersion.Net_4_0, ClrVersion.Net_4_5 };
+ }
+
+ protected override string OnGetDefaultResourceId (ProjectFile projectFile)
+ {
+ return VBNetResourceIdBuilder.GetDefaultResourceId (projectFile) ?? base.OnGetDefaultResourceId (projectFile);
+ }
+
+ protected override ProjectItem OnCreateProjectItem (IMSBuildItemEvaluated item)
+ {
+ if (item.Name == "Import")
+ return new Import ();
+ return base.OnCreateProjectItem (item);
+ }
+ }
+}
+
diff --git a/main/src/addins/VBNetBinding/Project/VBProjectParameters.cs b/main/src/addins/VBNetBinding/Project/VBProjectParameters.cs
deleted file mode 100644
index f3e8dd95ff..0000000000
--- a/main/src/addins/VBNetBinding/Project/VBProjectParameters.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-// VBProjectParameters.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using MonoDevelop.Core.Serialization;
-using MonoDevelop.Projects;
-
-namespace MonoDevelop.VBNetBinding
-{
- public class VBProjectParameters: DotNetProjectParameters
- {
- public override bool DefaultNamespaceIsImplicit {
- get {
- return true;
- }
- }
-
- [ItemProperty ("OptionInfer", DefaultValue="Off")]
- string optionInfer = "Off";
-
- [ItemProperty ("OptionExplicit", DefaultValue="On")]
- string optionExplicit = "On";
-
- [ItemProperty ("OptionCompare", DefaultValue="Binary")]
- string optionCompare = "Binary";
-
- [ItemProperty ("OptionStrict", DefaultValue="Off")]
- string optionStrict = "Off";
-
- [ItemProperty ("MyType", DefaultValue="")]
- string myType = string.Empty;
-
- [ItemProperty ("StartupObject", DefaultValue="")]
- string startupObject = string.Empty;
-
- [ProjectPathItemProperty ("ApplicationIcon", DefaultValue="")]
- string applicationIcon = string.Empty;
-
- [ItemProperty ("CodePage", DefaultValue="")]
- string codePage = string.Empty;
-
- public VBProjectParameters()
- {
- }
-
- public bool OptionInfer {
- get { return optionInfer == "On"; }
- set { optionInfer = value ? "On" : "Off"; }
- }
-
- public bool OptionExplicit {
- get { return optionExplicit == "On"; }
- set { optionExplicit = value ? "On" : "Off"; }
- }
-
- public bool BinaryOptionCompare {
- get { return optionCompare == "Binary"; }
- set { optionCompare = value ? "Binary" : "Text"; }
- }
-
- public bool OptionStrict {
- get { return optionStrict == "On"; }
- set { optionStrict = value ? "On" : "Off"; }
- }
-
- public string MyType {
- get { return myType; }
- set { myType = value ?? string.Empty; }
- }
-
- public string StartupObject {
- get { return startupObject; }
- set { startupObject = value ?? string.Empty; }
- }
-
- public string ApplicationIcon {
- get { return applicationIcon; }
- set { applicationIcon = value ?? string.Empty; }
- }
-
- public string CodePage {
- get { return codePage; }
- set { codePage = value ?? string.Empty; }
- }
- }
-}
diff --git a/main/src/addins/VBNetBinding/VBBindingCompilerServices.cs b/main/src/addins/VBNetBinding/VBBindingCompilerServices.cs
index 518777a678..464b82c151 100644
--- a/main/src/addins/VBNetBinding/VBBindingCompilerServices.cs
+++ b/main/src/addins/VBNetBinding/VBBindingCompilerServices.cs
@@ -49,7 +49,7 @@ namespace MonoDevelop.VBNetBinding {
/// </summary>
public class VBBindingCompilerServices
{
- string GenerateOptions (DotNetProjectConfiguration configuration, VBCompilerParameters compilerparameters, VBProjectParameters projectparameters, string outputFileName)
+ string GenerateOptions (DotNetProjectConfiguration configuration, VBCompilerParameters compilerparameters, VBProject projectparameters, string outputFileName)
{
var project = configuration.ParentItem;
StringBuilder sb = new StringBuilder ();
@@ -183,16 +183,14 @@ namespace MonoDevelop.VBNetBinding {
return sb.ToString();
}
- public BuildResult Compile (ProjectItemCollection items, DotNetProjectConfiguration configuration, ConfigurationSelector configSelector, IProgressMonitor monitor)
+ public BuildResult Compile (ProjectItemCollection items, DotNetProjectConfiguration configuration, ConfigurationSelector configSelector, ProgressMonitor monitor)
{
VBCompilerParameters compilerparameters = (VBCompilerParameters) configuration.CompilationParameters;
if (compilerparameters == null)
compilerparameters = new VBCompilerParameters ();
- VBProjectParameters projectparameters = (VBProjectParameters) configuration.ProjectParameters;
- if (projectparameters == null)
- projectparameters = new VBProjectParameters ();
-
+ var projectparameters = (VBProject) configuration.ParentItem;
+
string exe = configuration.CompiledOutputName;
string responseFileName = Path.GetTempFileName();
StreamWriter writer = new StreamWriter (responseFileName);
diff --git a/main/src/addins/VBNetBinding/VBLanguageBinding.cs b/main/src/addins/VBNetBinding/VBLanguageBinding.cs
deleted file mode 100644
index 0fbca6123c..0000000000
--- a/main/src/addins/VBNetBinding/VBLanguageBinding.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-// VBLanguageBinding.cs
-//
-// This file was derived from a file from #Develop, and relicensed
-// by Markus Palme to MIT/X11
-//
-// Copyright (C) 2001-2007 Markus Palme <MarkusPalme@gmx.de>
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-using System;
-using System.IO;
-using System.Collections;
-using System.Diagnostics;
-using System.Xml;
-using Microsoft.VisualBasic;
-using System.CodeDom.Compiler;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.VBNetBinding
-{
- public class VBLanguageBinding : IDotNetLanguageBinding
- {
- public const string LanguageName = "VBNet";
-
- VBBindingCompilerServices compilerServices = new VBBindingCompilerServices();
- VBCodeProvider provider;
- //TParser parser = new TParser ();
-
- public string Language {
- get {
- return LanguageName;
- }
- }
-
- public string ProjectStockIcon {
- get {
- return "md-project";
- }
- }
-
- public bool IsSourceCodeFile (FilePath fileName)
- {
- return Path.GetExtension(fileName) == ".vb";
- }
-
- public BuildResult Compile (ProjectItemCollection items, DotNetProjectConfiguration configuration, ConfigurationSelector configSelector, IProgressMonitor monitor)
- {
- Debug.Assert(compilerServices != null);
- return compilerServices.Compile (items, configuration, configSelector, monitor);
- }
-
- public ConfigurationParameters CreateCompilationParameters (XmlElement projectOptions)
- {
- return new VBCompilerParameters ();
- }
-
- public string SingleLineCommentTag { get { return "'"; } }
- public string BlockCommentStartTag { get { return null; } }
- public string BlockCommentEndTag { get { return null; } }
-
- public CodeDomProvider GetCodeDomProvider ()
- {
- if (provider == null)
- provider = new ImprovedCodeDomProvider ();
- return provider;
- }
-
- public FilePath GetFileName (FilePath baseName)
- {
- return baseName + ".vb";
- }
-
- public ClrVersion[] GetSupportedClrVersions ()
- {
- return new ClrVersion[] { ClrVersion.Net_2_0, ClrVersion.Net_4_0 };
- }
-
- public ProjectParameters CreateProjectParameters (XmlElement projectOptions)
- {
- return new VBProjectParameters ();
- }
-
- class ImprovedCodeDomProvider : Microsoft.VisualBasic.VBCodeProvider
- {
- [Obsolete ("Use CodeDomProvider class")]
- public override ICodeGenerator CreateGenerator ()
- {
- return new VBCodeGenerator ();
- }
- }
- }
-}
diff --git a/main/src/addins/VBNetBinding/VBNetBinding.addin.xml b/main/src/addins/VBNetBinding/VBNetBinding.addin.xml
index 0db637b68d..fd4b3c11dc 100644
--- a/main/src/addins/VBNetBinding/VBNetBinding.addin.xml
+++ b/main/src/addins/VBNetBinding/VBNetBinding.addin.xml
@@ -1,11 +1,12 @@
<ExtensionModel>
<Extension path = "/MonoDevelop/ProjectModel/MSBuildItemTypes">
- <DotNetProject
+ <DotNetProjectType
language="VBNet"
extension="vbproj"
guid="{F184B08F-C81C-45F6-A57F-5ABD9991F28F}"
import="$(MSBuildBinPath)\Microsoft.VisualBasic.targets"
+ type="MonoDevelop.VBNetBinding.VBProject"
resourceHandler="MonoDevelop.VBNetBinding.VBNetResourceIdBuilder"/>
</Extension>
@@ -22,13 +23,13 @@
</Extension>
<Extension path = "/MonoDevelop/Ide/ProjectTemplates">
- <ProjectTemplate id = "EmptyVBProject" resource = "EmptyVBProject.xpt.xml"/>
- <ProjectTemplate id = "VBConsoleApplicationProject" resource = "VBConsoleApplicationProject.xpt.xml"/>
- <ProjectTemplate id = "VBGtkSharp2Project" resource = "VBGtkSharp2Project.xpt.xml"/>
+ <ProjectTemplate id = "MonoDevelop.VBNet.EmptyProject" resource = "EmptyVBProject.xpt.xml"/>
+ <ProjectTemplate id = "MonoDevelop.VBNet.ConsoleProject" resource = "VBConsoleApplicationProject.xpt.xml"/>
+ <ProjectTemplate id = "MonoDevelop.VBNet.GtkSharp2Project" resource = "VBGtkSharp2Project.xpt.xml"/>
</Extension>
<Extension path = "/MonoDevelop/ProjectModel/Gui/ItemOptionPanels/Build/General">
- <Condition id="ActiveLanguage" value="VBNet">
+ <Condition id="ProjectTypeId" value="VBNet">
<Panel id = "VBNetProjectOptionsPanel"
_label = "General Options"
class = "MonoDevelop.VBNetBinding.ProjectOptionsPanel"/>
@@ -39,7 +40,7 @@
</Extension>
<Extension path = "/MonoDevelop/ProjectModel/Gui/ItemOptionPanels/Build/Compiler">
- <Condition id="ActiveLanguage" value="VBNet">
+ <Condition id="ProjectTypeId" value="VBNet">
<Panel id = "VBNetConfigurationOptionsPanel"
_label = "Compiler Options"
class = "MonoDevelop.VBNetBinding.ConfigurationOptionsPanel"/>
@@ -58,8 +59,9 @@
<Extension path = "/MonoDevelop/ProjectModel/LanguageBindings">
<LanguageBinding id = "VBNet"
- supportedextensions = ".vb"
- class = "MonoDevelop.VBNetBinding.VBLanguageBinding" />
+ extensions = ".vb"
+ singleLineCommentTag = "'"
+ codeDomType = "MonoDevelop.VBNetBinding.ImprovedCodeDomProvider" />
</Extension>
<Extension path = "/MonoDevelop/ProjectModel/SerializableClasses">
diff --git a/main/src/addins/VBNetBinding/VBNetBinding.csproj b/main/src/addins/VBNetBinding/VBNetBinding.csproj
index 8fb1dca2f8..c9a9280711 100644
--- a/main/src/addins/VBNetBinding/VBNetBinding.csproj
+++ b/main/src/addins/VBNetBinding/VBNetBinding.csproj
@@ -80,7 +80,6 @@
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="VBBindingCompilerServices.cs" />
- <Compile Include="VBLanguageBinding.cs" />
<Compile Include="Project\VBCompilerParameters.cs" />
<Compile Include="VBCodeGenerator.cs" />
<Compile Include="gtk-gui\generated.cs" />
@@ -95,8 +94,9 @@
<Compile Include="Gui\ImportsOptionsPanelWidget.cs" />
<Compile Include="Gui\ImportsOptionsPanel.cs" />
<Compile Include="gtk-gui\MonoDevelop.VBNetBinding.ImportsOptionsPanelWidget.cs" />
- <Compile Include="Project\VBProjectParameters.cs" />
<Compile Include="AddinInfo.cs" />
+ <Compile Include="Project\VBProjectExtension.cs" />
+ <Compile Include="Project\ImprovedCodeDomProvider.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="templates\EmptyVBFile.xft.xml">
diff --git a/main/src/addins/VBNetBinding/templates/AssemblyInfo.xft.xml b/main/src/addins/VBNetBinding/templates/AssemblyInfo.xft.xml
index defbdd67c2..b9627d89fb 100644
--- a/main/src/addins/VBNetBinding/templates/AssemblyInfo.xft.xml
+++ b/main/src/addins/VBNetBinding/templates/AssemblyInfo.xft.xml
@@ -8,7 +8,7 @@
<TemplateConfiguration>
<_Name>Assembly Information</_Name>
<_Category>Misc</_Category>
- <Icon>md-file-source</Icon>
+ <Icon>md-file-information</Icon>
<LanguageName>VBNet</LanguageName>
<DefaultFilename IsFixed="True">AssemblyInfo.vb</DefaultFilename>
<_Description>A file defining assembly information attributes.</_Description>
diff --git a/main/src/addins/VersionControl/ChangeLog b/main/src/addins/VersionControl/ChangeLog
deleted file mode 100644
index f2cf60dcbf..0000000000
--- a/main/src/addins/VersionControl/ChangeLog
+++ /dev/null
@@ -1,1323 +0,0 @@
-2010-06-28 Dale Ragan <dale.ragan@sinesignal.com>
-
- * Makefile.am: Adding MonoDevelop.VersionControl.Git to the solution/build
- system. It is disabled by default, to enable pass --enable-git=yes.
-
-2010-02-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Diff:
- * DiffWidget:
- * Diff/README:
- * Makefile.am:
- * Diff/Diff.cs:
- * Diff/Patch.cs:
- * Diff/Merge.cs:
- * Diff/ChangeLog:
- * Diff/TextDiff.cs:
- * Diff/Diff.csproj:
- * Diff/Makefile.am:
- * DiffWidget/README:
- * Diff/UnifiedDiff.cs:
- * DiffWidget/widget.cs:
- * DiffWidget/ChangeLog:
- * Diff/StructuredDiff.cs:
- * DiffWidget/Makefile.am:
- * DiffWidget/DiffWidget.csproj: Moved diff widget and
- algorithm to MonoDevelop.Components.
-
-2009-06-23 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/Repository.cs:
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- Move patch header tagging into svn addin.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * *.csproj: don't require specific gtk-sharp version.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * VersionControl.mds: Migrated to MSBuild file format.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.mdp:
- Flush project format changes.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Diff/Diff.mdp:
- * DiffWidget/DiffWidget.mdp:
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.mdp:
- All projects now require fx 3.5.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Diff/Makefile.am:
- * DiffWidget/Makefile.am:
- * MonoDevelop.VersionControl.Subversion/Makefile.am: Make it work for
- parallel build.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/Makefile.am:
- * MonoDevelop.VersionControl.Subversion/AssemblyInfo.cs:
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.mdp:
- Add AssemblyInfo.cs files that are autogenerated from the addin
- manifests.
-
-2008-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- Avoid adding duplicate trailing slash. Fixes bug #425338 - crash when
- trying to publish project to svn. Patch by Scott Ellington.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.addin.xml:
- Bump MD version.
-
-2008-10-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- Use CanMoveFiles to check if a directory can be moved from one SVN
- dir to another SVN dir. Fixes bug #436289.
-
-2008-10-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/Makefile.am:
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.mdp:
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.addin.xml:
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/Commands.cs:
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/LibSvnClient.cs:
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionNodeExtension.cs:
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs:
- Implemented Resolve command and tracked some api changes.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/generated.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs:
- Updated generated code.
-
-2008-08-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/LibSvnClient.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs:
- Properly show the remote status in the status view. Include remote
- additions and removals. Show diff between working copy and repo
- when remote status is requested. All this fixes bug #395284 - SVN
- plugin: Show Remote Status does not work.
-
-2008-08-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/Makefile.am,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.mdp:
- Add Ide reference, MD.Version control needs it.
-
-2008-08-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * Diff/Diff.cs: Add missing accessor.
-
-2008-08-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/gtk-gui/objects.xml,
- MonoDevelop.VersionControl.Subversion/Makefile.am,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.mdp,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/LibSvnClient.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs:
- Add support for locking/unlocking, and for on-demand unlocking
- (RequestFileEdit event).
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- Moved serialization engine to MonoDevelop.Core. Use new syntax for
- specifying attribute scope.
-
-2008-07-06 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- Implement feature in bug#394434: "Revert [to] revision".
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/LibSvnClient.cs:
- New P/Invokes for merge command.
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- Overriding implementations for RevertRevision and RevertToRevision.
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- Connection between the P/Invoke library (for the merge command) and
- the Revert[To]Revision methods.
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs:
- RevertRevision and RevertToRevision helper methods implemented.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * VersionControl.mds,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.addin.xml:
- Bump MD version.
-
-2008-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/LibSvnClient.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- Load system and user svn configuration when initializing a context.
- Fixes bug #378835.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
-
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- Added some getstring calls
-
-2008-02-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- Added missing null check.
-
-2008-01-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/LibSvnClient.cs:
- Add a workaround for [MarshalAs (UnmanagedType.SysInt)] not working.
- Fixes "Bug 325391 - Crash when attempting to browse registered repo" but
- related issues remain in the binding.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.addin.xml:
- Update MD version.
-
-2008-01-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs:
- In GetRepostoryReference, properly check if the provided directory is
- versioned. Fixes bug #355770.
-
-2008-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.addin.xml:
- Updated add-in category and description.
-
-2008-01-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- Notify file changes through the FileService.
-
-2008-01-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/LibSvnClient.cs:
- More marshalling fixes.
-
-2008-01-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/LibSvnClient.cs:
- Fix marshalling issues.
-
-2008-01-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs:
- In GetHistory(), There is no need to query the working revision, since
- we can use the constant Rev.Working as start revision. It also fixes bug
- #324571.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.mdp:
- Updated project files. The order of extended properties won't change
- anymore.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.addin.xml:
- Bump add-in versions.
-
-2007-12-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/Makefile.am: Fix trivial warning.
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- Use lazy initialisation rather than a static constructor. Log a message
- to tell the user if the SVN add is disabled. Implement IDisposable in
- addition to finaliser. Minor optimisation to release the LibSvnClient if
- LibApr can't be loaded.
-
-2007-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/gtk-gui/gui.stetic: Updated.
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/LibSvnClient.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/LibApr.cs:
- Check if Subversion is installed in a nicer way. Fixes bug #342507.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Diff/Diff.mdp, MonoDevelop.VersionControl.Subversion/Makefile.am,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.mdp,
- DiffWidget/DiffWidget.mdp: Directory reorganization.
-
-2007-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- In some cases it may be possible to natively move files between two
- repositories (e.g. if they are in the same server). Added a virtual
- method to check that and implemented it for SVN.
-
-2007-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs:
- Track LoggingService API changes.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.addin.xml,
- MonoDevelop.VersionControl/VersionControl.addin.xml: Bump MD version.
-
-2007-10-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl/Repository.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepository.cs:
- Make a copy of the repository before editing, and only update the
- original copy if the user clicks on OK. Fixes bug #336155.
- * MonoDevelop.VersionControl/gtk-gui/gui.stetic: Flush
-
-2007-10-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/overlay_added.png,
- MonoDevelop.VersionControl/overlay_conflicted.png,
- MonoDevelop.VersionControl/overlay_controled.png,
- MonoDevelop.VersionControl/overlay_locked.png,
- MonoDevelop.VersionControl/overlay_modified.png,
- MonoDevelop.VersionControl/overlay_removed.png: Use tango file icons.
- Removed obsolete icons.
-
-2007-10-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Diffs.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Logs.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Statuses.cs:
- Destroy the view when disposing.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- Updated comment.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl/Repository.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs:
- Set a default repo name if none is specified. Fixes bug #335114.
-
-2007-10-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/Makefile.am,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.mdp:
- Added reference to System.
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/LibApr.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- libsvn_client may be linked to libapr-0 or libapr-1, and we need to bind
- the LibApr class the the same library. Added code that detects the
- required libapr version and loads it. Fixes bug #325391.
-
-2007-10-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Diff/Diff.mdp, DiffWidget/DiffWidget.mdp,
- MonoDevelop.VersionControl.Subversion/gtk-gui/gui.stetic,
- MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl.mdp,
- VersionControl.mds: Flush
-
-2007-10-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/LibSvnClient.cs:
- Added some new pinvokes.
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.Gui/SslServerTrustDialog.cs:
- Call config_ensure when initializing the svn client to make sure all
- config directories are properly created, and that authentication data
- can be saved. Handle the case when the user cancels the server
- certificate validation. Based on a patch by Grzegorz Sobanski. Fixes bug
- #324640.
-
-2007-10-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/LibSvnClient.cs:
- Fix formatting.
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- Error objects returned by authentification handlers must be allocated in
- its own memory pool. Fixes bug #328035.
-
-2007-10-03 Grzegorz Sobański <silk@boktor.net>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- Changed the order of password and certs providers to first use the
- subversion ones - to use the same credentials that command line client
- (from ~/.subversion directory). It fixes bug #325538 too.
-
-2007-10-03 Zach Lute <zach.lute@gmail.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Diffs.cs: Only dispose of
- FileSystemWatchers if they were actually created. (Bug #330505)
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.addin.xml,
- MonoDevelop.VersionControl/VersionControl.addin.xml: Bump MD version.
-
-2007-09-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/generated.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs:
- Regenerated GUI files.
-
-2007-09-15 Andrés G. Aragoneses <knocte@gmail.com>
-
- * MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.cs:
- * MonoDevelop.VersionControl.Subversion/gtk-gui/gui.stetic:
- Use a normal title for the window.
-
-2007-09-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs,
- MonoDevelop.VersionControl/gtk-gui/generated.cs,
- MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs,
- MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs,
- MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs,
- MonoDevelop.VersionControl/gtk-gui/gui.stetic: Increase range of port
- selector in the repository information widget.
-
-2007-09-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Diffs.cs:
- Dispose the file watchers when disposing the view. Fixes bug #82721.
-
-2007-09-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/Publish.cs: Notify a
- directory status change after publishing a project. Fixes bug #82275.
-
-2007-09-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs:
- In GetVersionInfo, check for directory before checking for file, since
- directory links may appear as files.
-
-2007-09-04 Michael Hutchinson <MHutchinson@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/Publish.cs: Fix a
- compiler warning.
-
-2007-09-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Statuses.cs:
- Changed location of revert button, to avoid confusion with the commit
- button (see bug #82542).
-
-2007-08-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertCommand.cs:
- Reload reverted files. Fixes bug #82338.
-
-2007-08-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Statuses.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl/ChangeSet.cs: When
- going to commit, clone the changeset since commit extensions may change
- it (e.g. changelog extension). Allow setting messages to files not
- marked for commit. Should fix bug #82172.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/Makefile.am,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.mdp,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl.mdp,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs,
- MonoDevelop.VersionControl/VersionControl.addin.xml,
- MonoDevelop.VersionControl/gtk-gui/gui.stetic,
- MonoDevelop.VersionControl/Makefile.am: Reorganized the extension point
- hierarchy. Embedded all add-in manifests as resources.
-
-2007-08-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/Task.cs: API
- cleanup. Converted core services into regular classes.
-
-2007-08-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/ChangeSet.cs: New
- GeneratePathComment method which allows generating comments for a
- specific set of files.
-
-2007-08-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.mdp,
- MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs,
- MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs,
- MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs,
- MonoDevelop.VersionControl/gtk-gui/gui.stetic: Fix dialog spacing.
-
-2007-07-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Statuses.cs:
- Made some strings translatable. Update commit button after changing
- selection.
-
-2007-07-29 Zach Lute <zach.lute@gmail.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Statuses.cs:
- Added Select All and Select None buttons to the commit/status view. (Bug #82146)
-
-2007-07-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Statuses.cs:
- Reset the global comment of the changeset before committing. Fixes
- bug #82172.
-
-2007-07-25 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.Gui/UserPasswordDialog.cs:
- Close the dialog when the user hits Enter in the Password field (or User field if no passwd is needed).
-
-2007-07-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs:
- Load repository info in a background thread.
-
-2007-07-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/LibSvnClient.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- The result_rev parameter of svn_client_checkout is not a
- svn_opt_revision_t, but a svn_revnum_t. Might fix bug #81870.
-
-2007-07-19 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlProjectService.cs:
- Lluis' previous change is not actually needed.
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlFileSystemExtension.cs
- (NotifyFileChanged): Implemented. Fixes bug #81910.
-
-2007-07-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlProjectService.cs:
- Notify file changes as version control status changes. Fixes bug
- #81910.
-
-2007-07-19 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.VersionControl/VersionControl.addin.xml: Set the
- category for the version-control commands so they look all nice
- and pretty in the key-binding manager :)
-
-2007-07-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs:
- Use the log service for logging errors.
- * MonoDevelop.VersionControl/gtk-gui/gui.stetic: Updated.
-
-2007-07-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- If a file is deleted and it is scheduled to Add, revert the Add
- operation. Fixes bug #81953.
-
-2007-07-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs,
- MonoDevelop.VersionControl/gtk-gui/gui.stetic: Updated.
-
-2007-06-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/generated.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.mdp:
- Updated.
-
-2007-06-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlNodeExtension.cs:
- Move the overlay icon one pixel up, to reduce spacing.
-
-2007-05-31 Rafael 'fumasa' Giorgetti <fumasa@gmail.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/LibSvnClient.cs:
- Add struct svn_client_commit_info_t.
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- Show revision number when Commit.
-
-2007-05-31 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/LibSvnClient.cs:
- Call a function in the .ctor to cause an exception if the library doesn't exist.
-
-2007-05-31 Jeffrey Stedfast <fejj@novell.com>
-
- Fix for bug #81766.
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- Updated to reflect changes to SvnClient nested classes/structs (which have been moved to LibSvnClient).
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.Gui/ClientCertificateDialog.cs: Same.
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.Gui/ClientCertificatePasswordDialog.cs: Same.
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.Gui/SslServerTrustDialog.cs: Same.
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.Gui/UserPasswordDialog.cs: Same.
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs:
- Same.
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/LibApr.cs:
- Moved some constants here.
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- Use a LibSvnClient object.
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/LibSvnClient.cs:
- New source file that wraps libsvn_client-1.so.[0,1]
-
-2007-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- Directly call Svn.Commit when publishing a project, since the
- regular Commit method has problems importing new folders.
-
-2007-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/CommitCommand.cs:
- Fix the build.
-
-2007-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/CommitCommand.cs:
- Properly destroy the commit dialog. Fixes bug #81751.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/ChangeSet.cs:
- Fix crash when committing new directory additions.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlService.cs:
- Properly unregister VersionControlSystem objects on add-in
- unloading.
-
-2007-05-22 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs
- (OnButtonEditClicked): Null check.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/Checkout.cs
- (CheckOutCommand.Run): Likewise.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/Publish.cs
- (PublishCommand.Publish): Likewise.
-
-2007-05-21 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs:
- (Dispose): Remove.
- Ensure that dialogs are Destroy()'ed.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs:
- (Dispose): Remove.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/Checkout.cs (Run):
- Destroy dialog.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/Publish.cs
- (PublishCommand.Publish): Destroy dialog.
-
-2007-05-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.mdp: Don't copy
- assemly references.
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.addin.xml,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl.mdp,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitDialog.cs,
- MonoDevelop.VersionControl/VersionControl.addin.xml,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Diffs.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Statuses.cs,
- MonoDevelop.VersionControl/Makefile.am,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl/BaseView.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlService.cs:
- Migration to Mono.Addins.
-
-2007-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.mdp,
- DiffWidget/DiffWidget.mdp: Updated.
-
-2007-04-11 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- Use svn_client_add3() so that we can pass 'force' as true. (We
- already required 1.3+ as mkdir2() is only 1.3+)
-
-2007-04-10 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/BaseView.cs:
- Removed BuildNavPoint().
-
-2007-03-29 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/BaseView.cs: Implement
- BuildNavPoint().
-
-2007-03-21 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlProjectService.cs
- (OnEntryAdded): Instead of calling repo.Add() with the recursive
- arg set to true, do our own "recursive" adding requesting the list
- of files from the CombineEntry and sub-CombineEntry nodes. This
- would prevent addition of files/folders that are not part of the
- project but existed in the project directory at the time ti was added.
-
- Fix for bug #81184
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlFileSystemExtension.cs:
- Updated to not pass a path argument to GetRepository().
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlNodeExtension.cs:
- Updated to not pass a path argument to GetRepository().
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlProjectService.cs
- (GetRepository): No longer takes a path argument as it never uses
- it anyway.
- (OnEntryAdded): New callback to handle when a project or combine gets added.
- (VersionControlProjectService): Bind OnEntryAdded.
-
-2007-03-19 Jeffrey Stedfast <fejj@novell.com>
-
- Fixes bug #81185 and then delves a bit deeper.
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs
- (IsInstalled): Implemented.
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/Checkout.cs
- (Update): Added. Disable the menu item if no version control
- systems are installed.
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlSystem.cs:
- Add a virtual IsInstalled property.
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs
- (SelectionRepositoryDialog): Only add VCS's that are installed.
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs
- (EditRepositoryDialog): Only add VCS's that are installed.
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlNodeExtension.cs
- (RunCommand): Test that the vcs.IsInstalled, if not - then return
- TestResult.Disable
-
-2007-03-09 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs:
- (OnButtonAddClicked): Add entry for the new repository only instead of
- reloading the full list.
- (OnButtonRemoveClicked): Avoid reloading the full list of repositories.
- Also, save configuration.
- (OnButtonEditClicked): Update the corresponding row in the treeview.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs:
- (.ctor): Don't reset comboProtocol's value.
-
-2007-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/Makefile.am: Fix build.
-
-2007-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/UserPasswordDialog.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.SslServerTrustDialog.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.UserPasswordDialog.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.Gui,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.Gui/UserPasswordDialog.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.Gui/SslServerTrustDialog.cs,
- MonoDevelop.VersionControl.Subversion/SslServerTrustDialog.cs:
- Moved to .Gui namespace and directory.
- * MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/gui.stetic,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.Gui/ClientCertificateDialog.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.Gui/ClientCertificatePasswordDialog.cs:
- Implemented dialogs for asking for client certificates.
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.mdp,
- MonoDevelop.VersionControl.Subversion/Makefile.am: Updated.
-
-2007-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * Diff/Diff.mdp, DiffWidget/DiffWidget.mdp,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl.mdp: Don't
- local-copy references.
- * MonoDevelop.VersionControl.Subversion/UserPasswordDialog.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/generated.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.SslServerTrustDialog.cs,
- MonoDevelop.VersionControl.Subversion/gtk-gui/gui.stetic,
- MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.UserPasswordDialog.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.mdp,
- MonoDevelop.VersionControl.Subversion/Makefile.am,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/LibApr.cs,
- MonoDevelop.VersionControl.Subversion/SslServerTrustDialog.cs:
- Implemented dialogs for entering user and password, and for
- accepting an invalid ssl certificate. Plugged those dialogs into
- the corresponding subversion callbacks.
-
-2007-02-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Statuses.cs:
- Unsubscribe file status change on dispose.
-
-2007-02-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/Publish.cs: Ask
- for confirmation before publishing a project into a repository.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.addin.xml,
- MonoDevelop.VersionControl/VersionControl.addin.xml: Change add-in
- versions to 0.13.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Diff/Diff.mdp, Diff/Makefile.am,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.mdp,
- MonoDevelop.VersionControl.Subversion/Makefile.am,
- DiffWidget/Makefile.am, DiffWidget/DiffWidget.mdp,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl.mdp,
- MonoDevelop.VersionControl/gtk-gui/gui.stetic,
- MonoDevelop.VersionControl/Makefile.am: Synchronize MD project and
- makefile.
- * MonoDevelop.VersionControl.Subversion/gtk-gui/generated.cs: Updated.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs:
- Added debug message.
-
-2007-02-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlProjectService.cs:
- Allow re-adding a file which has been deleted, but the delete has
- not yet been committed.
-
-2007-02-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- Use the svn_client_cat2 instead of svn_client_cat. This version of
- the method can get old revisions of a file even when the file was
- moved from another directory. Fixes bug #80318.
-
-2007-02-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Diff/Diff.mdp, VersionControl.mds,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.mdp,
- DiffWidget/DiffWidget.mdp: Flush.
- * MonoDevelop.VersionControl.Subversion/Makefile.am,
- MonoDevelop.VersionControl/Makefile.am: distcheck fixes.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.mdp,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Diffs.cs,
- MonoDevelop.VersionControl/VersionControl.addin.xml,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.addin.xml:
- Removed dependency to editor add-in.
- * MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs,
- MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs,
- MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs:
- Minor fixes.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Statuses.cs:
- Added File Open button to the toolbar.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Logs.cs:
- Show the content of revisions using the MD text editor, and with
- the correct mime type.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/Publish.cs: Fix
- spelling.
-
-2007-02-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs,
- MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs,
- MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs,
- MonoDevelop.VersionControl/gtk-gui/gui.stetic: i18N fixes.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Statuses.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Logs.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl/CommitCommand.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlNodeExtension.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertCommand.cs:
- Improved protection against unknown exceptions.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.mdp,
- MonoDevelop.VersionControl.Subversion/Makefile.am,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- Fix potential issue when reading the output from svn.
-
-2007-02-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/VersionControl.addin.xml: Allow updating
- individual files.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlNodeExtension.cs:
- If there is no version control for a project or folder, instead of
- an empty version control menu, show a disabled command saying so.
-
-2007-01-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- Fix 64 bit issues.
-
-2007-01-29 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * Diff/Diff.cs: chaned to use generics, platform independent newlines
- * Diff/Merge.cs: platform independent newlines
-
-2007-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs,
- MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Logs.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl/Revision.cs:
- Improved the log view. Use a toolbar instead of regular buttons.
- Provide more information about files comitted in a revision.
-
-2007-01-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.mdp,
- MonoDevelop.VersionControl/gtk-gui/generated.cs,
- MonoDevelop.VersionControl/gtk-gui/gui.stetic: Updated.
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- Provide auth_baton for subversion authentication (patch by Duncan
- Mackay <duncan.mackay@provenco.com>). In CheckError, get error
- messages from all all nested error objects.
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs:
- PathDiff now returns differences between the base and the working
- versions.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.mdp,
- MonoDevelop.VersionControl/Makefile.am: Added new files.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitDialog.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs:
- Use the new partial class model.
- * MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs,
- MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs,
- MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs,
- MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs:
- New partial files for the dialogs.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Statuses.cs:
- When the view is refreshed, discard the diffs already loaded. Track
- changes in diff cell renderer.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CellRendererDiff.cs:
- Cache Layout objects for diff content, since they may be very big
- and take too much time to construct. The cell renderer is now must
- faster for big files.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/AddRemoveMoveCommand.cs:
- Fix warning.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlProjectService.cs:
- Fix warnings.
-
-2007-01-15 Lluis Sanchez Gual <lluis@novell.com>
-
- Put under version control new files added to a project.
-
-2006-12-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- Fixed some marshalling isues when calling svn methods. Should fix
- bug #80312.
-
-2006-12-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlFileSystemExtension.cs:
- Added null check. Should fix bug #80311.
-
-2006-12-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- Improved implementation of Move.
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- Removed debug code.
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs:
- Minor fixes.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.mdp,
- MonoDevelop.VersionControl/Makefile.am: Added new file.
- * MonoDevelop.VersionControl/VersionControl.addin.xml: Registered new
- file system extension.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/Repository.cs:
- Split Move method into MoveFile and MoveDirectory. The same for
- Delete. Added some other useful overridable methods.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlFileSystemExtension.cs:
- New file system extension which supports version control systems.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlNodeExtension.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl/AddRemoveMoveCommand.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlProjectService.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl/UnknownRepository.cs:
- Track api changes.
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/ChangeSet.cs:
- Removed unused field.
-
-2006-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlProjectService.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl/ChangeSet.cs,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl/Checkout.cs:
- Save commit comments in a file, so they won't be lost if the status
- view is closed.
-
-2006-12-07 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Logs.cs:
- Fixed compile warning.
-
-2006-11-28 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.VersionControl.Subversion:
- * MonoDevelop.VersionControl: Added svn:ignores for the .pidb files.
-
-2006-11-26 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.VersionControl.Subversion:
- * MonoDevelop.VersionControl:
- Added svn:ignores for Makefile and Makefile.in.
-
-2006-11-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.mdp,
- MonoDevelop.VersionControl/MonoDevelop.VersionControl.mdp: Added
- missing reference.
- * MonoDevelop.VersionControl/gtk-gui/generated.cs,
- MonoDevelop.VersionControl/gtk-gui/objects.xml: Updated.
-
-2006-11-23 Lluis Sanchez Gual <lluis@novell.com>
-
- Split the version control add-in in two add-ins: one that implements
- the version control core, and one that implements the support for
- Subversion. The VCS core is now built by default. The subversion add-in
- is optional.
-
-2006-11-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn/VersionControl.AddIn/VersionControlNodeExtension.cs: Don't show
- folder overlays if they are disabled. Cache overlay compositions.
- * AddIn/gtk-gui/generated.cs, AddIn/gtk-gui/gui.stetic: Updated.
- * VersionControl/VersionControl.Service.Subversion/SubversionRepository.cs,
- VersionControl/VersionControl.Service.Subversion/SubversionVersionControl.cs:
- Allow commiting directories that contain versioned files (even if
- the directory itself is not versioned).
- * VersionControl/VersionControl.Service.Subversion/SvnClient.cs: Fix
- some memory leaks.
- * VersionControl/VersionControl.Service/ChangeSet.cs: Added getter for
- the repository.
-
-2006-11-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn/VersionControl.AddIn/VersionControlProjectService.cs: Added
- missing nullref check.
-
-2006-11-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn/VersionControl.AddIn.Views/Statuses.cs: Properly enable/disable
- toolbar buttons.
- * AddIn/VersionControl.AddIn/RevertCommand.cs: Minor fix in log
- message.
-
-2006-11-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn/VersionControl.AddIn/VersionControlProjectService.cs:
- Automatically add/remove files from the repository when
- added/removed from the project.
- * AddIn/VersionControl.AddIn/VersionControlNodeExtension.cs: Fix
- nullref exception.
- * AddIn/gtk-gui/generated.cs, AddIn/gtk-gui/gui.stetic: Updated.
-
-2006-11-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn/VersionControl.AddIn.Dialogs/CommitDialog.cs: Hide the commit
- dialog before starting the commit operation.
-
-2006-11-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn/VersionControl.AddIn.Dialogs/CommitDialog.cs,
- AddIn/VersionControl.AddIn/CommitDialogExtension.cs: Added support
- for commit dialog extensions.
- * AddIn/VersionControl.AddIn.Views/Statuses.cs: Add support for
- sorting.
- * AddIn/VersionControl.addin.xml: Changed add-in id. Added new
- extension point.
- * AddIn/VersionControl.AddIn/VersionControlProjectService.cs,
- AddIn/VersionControl.AddIn/CommitEventHandler.cs: Improved commit
- events.
- * AddIn/VersionControl.AddIn/CommitCommand.cs: Moved some of the commit
- functionality to the commit dialog, since commit extensions now
- participate in the operation.
- * AddIn/VersionControlAddIn.mdp, AddIn/gtk-gui/generated.cs,
- AddIn/gtk-gui/gui.stetic, AddIn/Makefile.am: Updated.
- * VersionControl/VersionControl.Service/VersionInfo.cs: Added
- NeedsCommit property.
- * VersionControl/VersionControl.Service/ChangeSet.cs: If a file does
- not have a comment, don't include it in the generated global
- message.
-
-2006-11-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn/overlay_unversioned.png, AddIn/overlay_locked.png,
- AddIn/overlay_added.png, AddIn/overlay_conflicted.png,
- AddIn/overlay_modified.png, AddIn/overlay_normal.png,
- AddIn/overlay_controled.png:
- Updated icons.
- * AddIn/VersionControl.AddIn.Dialogs/CommitDialog.cs: Use the new
- ChangeSet class.
- * AddIn/VersionControl.AddIn.Views/Statuses.cs: Update the view when
- file status change. Added Revert command. Use the new ChangeSet class.
- * AddIn/VersionControl.AddIn.Views/Logs.cs: Minor fix.
- * AddIn/VersionControl.AddIn/VersionControlProjectService.cs: Added
- event for notifying changes in file status.
- * AddIn/VersionControl.AddIn/Task.cs: Added some exception protection.
- * AddIn/VersionControl.AddIn/VersionControlNodeExtension.cs: Simplified
- the code that keeps track of file status changes, but using the new
- version control service events. Implemented Revert.
- * AddIn/VersionControl.AddIn/FileUpdateEventHandler.cs: new handlers
- for notifying version control events.
- * AddIn/gtk-gui/generated.cs, AddIn/gtk-gui/gui.stetic: Updated the gui.
- * VersionControl/VersionControl.Service/ChangeSet.cs: New class that holds
- all needed information for a commit.
-
- * VersionControl/VersionControl.Service/UnknownRepository.cs:
- * VersionControl/VersionControl.Service.Cvs/CvsRepository.cs: Track api
- changes.
-
- * VersionControl/VersionControl.Service/Repository.cs:
- * VersionControl/VersionControl.Service.Subversion/SvnClient.cs:
- * VersionControl/VersionControl.Service.Subversion/SubversionVersionControl.cs:
- * VersionControl/VersionControl.Service.Subversion/SubversionRepository.cs:
- Implemented Revert. Use the new ChangeSet class. Fixes in several status
- check methods.
-
- * AddIn/VersionControl.AddIn/Commands.cs:
- * AddIn/VersionControl.AddIn/RevertCommand.cs:
- * AddIn/VersionControl.addin.xml: Added Revert command.
-
- * AddIn/VersionControl.AddIn/Update.cs:
- * AddIn/VersionControl.AddIn/CommitCommand.cs:
- * AddIn/VersionControl.AddIn/AddRemoveMoveCommand.cs: Notify changes
- in the status of files.
-
- * VersionControl/VersionControl.Service/VersionStatus.cs:
- * VersionControl/VersionControl.Service/VersionInfo.cs:
- Removed Unknown status.
-
- * AddIn/Makefile.am:
- * VersionControl/VersionControl.mdp:
- * AddIn/VersionControlAddIn.mdp: Updated.
-
-2006-11-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn/comment.png: New icon.
- * AddIn/VersionControl.AddIn.Dialogs/CommitDialog.cs: Added setter for
- Message.
- * AddIn/VersionControl.AddIn.Views/Statuses.cs, AddIn/gtk-gui/generated.cs,
- AddIn/gtk-gui/gui.stetic: Added an text view which allows entering
- commit comments for every file, with support for multiple selection.
- * AddIn/VersionControl.addin.xml: Registered new icon.
- * AddIn/VersionControl.AddIn/CommitCommand.cs: Added parameter for
- providing the commit message.
- * AddIn/VersionControl.AddIn/VersionControlNodeExtension.cs: Dispatch file
- change events in the GUI thread.
- * AddIn/VersionControlAddIn.mdp, AddIn/Makefile.am: Updated
- * VersionControl/VersionControl.Service/Repository.cs: Minor fix.
-
-
-2006-11-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn/VersionControl.AddIn.Dialogs/SelectRepositoryDialog.cs:
- Some minor UI fixes.
- * AddIn/VersionControl.AddIn/Checkout.cs: Added null check.
- * AddIn/VersionControlAddIn.mdp: Removed unused resource.
-
- * AddIn/gtk-gui/gui.stetic:
- * AddIn/gtk-gui/generated.cs: Regenerated.
-
- * VersionControl/VersionControl.Service.Subversion/LibApr.cs:
- * VersionControl/VersionControl.Service.Subversion/SvnClient.cs:
- Moved apr pinvokes to the LibApr class, which can now support
- libapr0 and libapr1.
-
- * DiffWidget/DiffWidget.mdp:
- * VersionControl/Makefile.am:
- * VersionControl/VersionControl.mdp: Updated.
-
-2006-11-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn/VersionControl.addin.xml: Fix checkout command icon.
- * AddIn/Makefile.am: Remove unused files.
-
-2006-11-04 Lluis Sanchez Gual <lluis@novell.com>
-
- Big reorganization of the add-in. Implemented support for saving
- repository configuration. Implemented publish and checkout
- commands. Made the add-in pluggable, so it can support other
- repositories. Some of this work was started by Thiago Becker and
- Rafael Giorgetti as part of a Google SoC project.
-
-2006-09-19 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * AddIn/VersionControlAddIn.mdp:
- * VersionControl/VersionControl.mdp:
- * Diff/Diff.mdp:
- * VersionControl.mds:
- * DiffWidget/DiffWidget.mdp:
- Updated.
-
-2006-08-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn/Addin.cs: Fix the build.
-
-2006-07-28 Wade Berrier <wberrier@novell.com>
-
- * AddIn/Addin.cs: Update from refactoring change on IViewContent (svn r62840)
-
-2006-07-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn/VersionControl.addin.xml: Updated versions.
-
-2006-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn/VersionControl.addin.xml: Updated versions.
- * AddIn/VersionControlAddIn.mdp: Updated.
- * VersionControl/VersionControl.mdp: Updated.
- * Diff/Diff.mdp: Updated.
- * VersionControl/VersionControl.mds: Updated.
- * DiffWidget/DiffWidget.mdp: Updated.
-
-2006-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn/Makefile.am:
- * AddIn/VersionControl.addin.xml: Updated references.
-
-2006-03-26 Joshua Tauberer <tauberer@for.net>
-
- * AddIn/Task.cs, Statuses.cs, Logs.cs: Prevent unhandled
- exceptions if a library couldn't be found.
-
-2006-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * VersionControl.mds:
- * DiffWidget/DiffWidget.mdp:
- * VersionControl/VersionControl.mdp:
- * Diff/Diff.mdp: Updated.
- * Makefile.am:
- * Diff/Makefile.am:
- * DiffWidget/Makefile.am:
- * VersionControl/Makefile.am: Use an unified format.
- Patch by Matze Braun.
-
- * VersionControl.addin.xml: Updated add-in versions.
-
-2006-03-21 Wade Berrier <wberrier@novell.com>
-
- * AddIn/Makefile.am: Fix 'make dist' to include missing png files
-
-2006-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn/Addin.cs: Track api changes.
-
-2006-02-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * VersionControl/AddIn/AddIn.mdp: Updated project references.
-
-2005-12-04 Joshua Tauberer <tauberer@for.net>
-
- * AddIn: Added icons to menus. The icons again come
- from the TortoiseSVN project (with a presumption of
- license compatibility).
-
-2005-11-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn/VersionControl.addin.xml: Moved version control commands to
- its own submenu.
-
-2005-11-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn/Addin.cs: It should also work for Project, not only DotNetProject.
- * VersionControl/Subversion.cs: Fix build.
-
-2005-10-22 Joshua Tauberer <tauberer@for.net>
-
- * Minor VersionControl API changes (use a RepositoryPath
- class to represent an abstract path in a repository).
- * Improved the history/log view and the status/commit view
- using the TreeView widget.
-
-2005-10-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn/VersionControl.addin.xml: Fixed addin header information.
- Use "id" attribuet instead of "name" to identify addins.
-
-2005-10-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn/VersionControl.addin.xml: Added addin dependencies.
-
-2005-09-20 Josh Tauberer <tauberer@for.net>
-
- * AddIn/Statuses.cs,Logs.cs: Some widgets needed
- to be shown since MD is calling Show() less.
- * VersionControl/Subversion.cs: Not all entries
- returned by svn have a URL, e.g. obstructed entries.
- So don't rely on that to get the local path.
-
-2005-09-04 Josh Tauberer <tauberer@for.net>
-
- * AddIn/Makefile.am: Was broken since last time
- it was changed.
-
-2005-08-10 Ben Motmans <ben.motmans@gmail.com>
-
- * AddIn/AddIn.mdp
- * VersionControl/VersionControl.mdp
- * Diff/Diff.mdp
- * DiffWidget/DiffWidget.mdp: references update
-
-2005-08-08 John Luke <john.luke@gmail.com>
-
- * AddIn/Makefile.am:
- * Diff/Makefile.am:
- * DiffWidget/Makefile.am:
- * VersionControl/Makefile.am: fix distcheck,
- make it conditional on ENABLE_VERSIONCONTROL,
- and install it when enabled
-
-2005-07-01 Joshua Tauberer <tauberer@for.net>
-
- * Added MD solution files for VersionControl.
- * Project pad overlays now update when files
- are modified.
- * Project pad context menus enabled for
- folders and combines.
- * Subversion: Don't report diffs available
- for unchanged files.
- * This was committed with the addin!
-
-2005-06-22 Joshua Tauberer <tauberer@for.net>
-
- * Added VersionControl into repo (but sadly the addin
- cannot add itself into the repo yet!).
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseGitRepositoryTests.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseGitRepositoryTests.cs
index e1767c556a..e7a6795dab 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseGitRepositoryTests.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseGitRepositoryTests.cs
@@ -121,7 +121,7 @@ namespace MonoDevelop.VersionControl.Git.Tests
protected override void PostCommit (Repository repo)
{
var repo2 = (GitRepository)repo;
- repo2.Push (new NullProgressMonitor (), repo2.GetCurrentRemote (), repo2.GetCurrentBranch ());
+ repo2.Push (new ProgressMonitor (), repo2.GetCurrentRemote (), repo2.GetCurrentBranch ());
}
protected override void BlameExtraInternals (Annotation [] annotations)
@@ -131,7 +131,7 @@ namespace MonoDevelop.VersionControl.Git.Tests
Assert.AreEqual (Author, annotations [i].Author);
Assert.AreEqual (String.Format ("<{0}>", Email), annotations [i].Email);
}
- Assert.IsTrue (annotations [2].HasDate);
+ Assert.IsFalse (annotations [2].HasDate);
}
[Test]
@@ -143,10 +143,10 @@ namespace MonoDevelop.VersionControl.Git.Tests
AddFile ("file1", "text", true, false);
AddFile ("file3", "unstaged", false, false);
AddFile ("file4", "noconflict", true, false);
- repo2.TryCreateStash (new NullProgressMonitor (), "meh", out stash);
+ repo2.TryCreateStash (new ProgressMonitor (), "meh", out stash);
Assert.IsTrue (!File.Exists (LocalPath + "file1"), "Stash creation failure");
AddFile ("file4", "conflict", true, true);
- repo2.PopStash (new NullProgressMonitor (), 0);
+ repo2.PopStash (new ProgressMonitor (), 0);
VersionInfo vi = repo2.GetVersionInfo (LocalPath + "file1", VersionInfoQueryFlags.IgnoreCache);
Assert.IsTrue (File.Exists (LocalPath + "file1"), "Stash pop staged failure");
@@ -171,16 +171,16 @@ namespace MonoDevelop.VersionControl.Git.Tests
AddFile ("file3", null, false, false);
int commitCount = repo2.GetHistory (repo2.RootPath, null).Length;
- repo2.TryCreateStash (new NullProgressMonitor (), "stash1", out stash);
- repo2.PopStash (new NullProgressMonitor (), 0);
+ repo2.TryCreateStash (new ProgressMonitor (), "stash1", out stash);
+ repo2.PopStash (new ProgressMonitor (), 0);
Assert.AreEqual (commitCount, repo2.GetHistory (repo2.RootPath, null).Length, "stash1 added extra commit.");
- repo2.TryCreateStash (new NullProgressMonitor (), "stash2", out stash);
+ repo2.TryCreateStash (new ProgressMonitor (), "stash2", out stash);
AddFile ("file4", null, true, true);
commitCount = repo2.GetHistory (repo2.RootPath, null).Length;
- repo2.PopStash (new NullProgressMonitor (), 0);
+ repo2.PopStash (new ProgressMonitor (), 0);
Assert.AreEqual (commitCount, repo2.GetHistory (repo2.RootPath, null).Length, "stash2 added extra commit.");
}
@@ -196,7 +196,7 @@ namespace MonoDevelop.VersionControl.Git.Tests
AddFile ("file1", "text", true, true);
repo2.CreateBranch ("branch1", null, null);
- repo2.SwitchToBranch (new NullProgressMonitor (), "branch1");
+ repo2.SwitchToBranch (new ProgressMonitor (), "branch1");
// Nothing could be stashed for master. Branch1 should be popped in any case if it exists.
Assert.IsFalse (repo2.GetStashes ().Any (s => s.Message == GetStashMessageForBranch ("master")));
Assert.IsFalse (repo2.GetStashes ().Any (s => s.Message == GetStashMessageForBranch ("branch1")));
@@ -207,20 +207,20 @@ namespace MonoDevelop.VersionControl.Git.Tests
AddFile ("file2", "text", true, false);
repo2.CreateBranch ("branch2", null, null);
- repo2.SwitchToBranch (new NullProgressMonitor (), "branch2");
+ repo2.SwitchToBranch (new ProgressMonitor (), "branch2");
// Branch1 has a stash created and assert clean workdir. Branch2 should be popped in any case.
Assert.IsTrue (repo2.GetStashes ().Any (s => s.Message == GetStashMessageForBranch ("branch1")));
Assert.IsFalse (repo2.GetStashes ().Any (s => s.Message == GetStashMessageForBranch ("branch2")));
Assert.IsTrue (!File.Exists (LocalPath + "file2"), "Uncommitted changes were not stashed");
AddFile ("file2", "text", true, false);
- repo2.SwitchToBranch (new NullProgressMonitor (), "branch1");
+ repo2.SwitchToBranch (new ProgressMonitor (), "branch1");
// Branch2 has a stash created. Branch1 should be popped with file2 reinstated.
Assert.True (repo2.GetStashes ().Any (s => s.Message == GetStashMessageForBranch ("branch2")));
Assert.IsFalse (repo2.GetStashes ().Any (s => s.Message == GetStashMessageForBranch ("branch1")));
Assert.IsTrue (File.Exists (LocalPath + "file2"), "Uncommitted changes were not stashed correctly");
- repo2.SwitchToBranch (new NullProgressMonitor (), "master");
+ repo2.SwitchToBranch (new ProgressMonitor (), "master");
repo2.RemoveBranch ("branch1");
Assert.IsFalse (repo2.GetBranches ().Any (b => b.FriendlyName == "branch1"), "Failed to delete branch");
@@ -238,14 +238,14 @@ namespace MonoDevelop.VersionControl.Git.Tests
PostCommit (repo2);
repo2.CreateBranch ("branch3", null, null);
- repo2.SwitchToBranch (new NullProgressMonitor (), "branch3");
+ repo2.SwitchToBranch (new ProgressMonitor (), "branch3");
AddFile ("file2", "asdf", true, true);
- repo2.Push (new NullProgressMonitor (), "origin", "branch3");
+ repo2.Push (new ProgressMonitor (), "origin", "branch3");
- repo2.SwitchToBranch (new NullProgressMonitor (), "master");
+ repo2.SwitchToBranch (new ProgressMonitor (), "master");
repo2.CreateBranch ("branch4", "origin/branch3", "refs/remotes/origin/branch3");
- repo2.SwitchToBranch (new NullProgressMonitor (), "branch4");
+ repo2.SwitchToBranch (new ProgressMonitor (), "branch4");
Assert.IsTrue (File.Exists (LocalPath + "file2"), "Tracking remote is not grabbing correct commits");
}
@@ -287,9 +287,7 @@ namespace MonoDevelop.VersionControl.Git.Tests
DiffInfo item = diff [0];
Assert.IsNotNull (item);
Assert.AreEqual ("file1", item.FileName.FileName);
- string text = @"diff --git a/file1 b/file1
-new file mode 100644
-index 0000000..f3a3485
+ string text = @"index 0000000..f3a3485
--- /dev/null
+++ b/file1
@@ -0,0 +1 @@
@@ -304,9 +302,7 @@ index 0000000..f3a3485
item = diff [1];
Assert.IsNotNull (item);
Assert.AreEqual ("file2", item.FileName.FileName);
- text = @"diff --git a/file2 b/file2
-new file mode 100644
-index 0000000..009b64b
+ text = @"index 0000000..009b64b
--- /dev/null
+++ b/file2
@@ -0,0 +1 @@
@@ -329,6 +325,8 @@ index 0000000..009b64b
//Assert.IsTrue (repo2.IsUrlValid ("ftp://github.com:80/mono/monodevelop.git"));
//Assert.IsTrue (repo2.IsUrlValid ("ftps://github.com:80/mono/monodevelop.git"));
Assert.IsTrue (repo2.IsUrlValid ("file:///mono/monodevelop.git"));
+ Assert.IsTrue (repo2.IsUrlValid ("git@172.31.118.100:/home/git/my-app.git"));
+ Assert.IsTrue (repo2.IsUrlValid ("git@172.31.118.100:home/git/my-app.git"));
//Assert.IsTrue (repo2.IsUrlValid ("rsync://github.com/mono/monodevelpo.git"));
}
@@ -342,7 +340,7 @@ index 0000000..009b64b
AddFile ("file1", "text", true, true);
PostCommit (repo2);
repo2.CreateBranch ("branch1", null, null);
- repo2.SwitchToBranch (new NullProgressMonitor (), "branch1");
+ repo2.SwitchToBranch (new ProgressMonitor (), "branch1");
AddFile ("file2", "text", true, true);
PostCommit (repo2);
Assert.AreEqual (2, repo2.GetBranches ().Count ());
@@ -364,12 +362,12 @@ index 0000000..009b64b
Assert.IsTrue (repo2.IsBranchMerged ("master"));
repo2.CreateBranch ("branch1", null, null);
- repo2.SwitchToBranch (new NullProgressMonitor (), "branch1");
+ repo2.SwitchToBranch (new ProgressMonitor (), "branch1");
AddFile ("file2", "text", true, true);
- repo2.SwitchToBranch (new NullProgressMonitor (), "master");
+ repo2.SwitchToBranch (new ProgressMonitor (), "master");
Assert.IsFalse (repo2.IsBranchMerged ("branch1"));
- repo2.Merge ("branch1", GitUpdateOptions.NormalUpdate, new NullProgressMonitor ());
+ repo2.Merge ("branch1", GitUpdateOptions.NormalUpdate, new ProgressMonitor ());
Assert.IsTrue (repo2.IsBranchMerged ("branch1"));
}
@@ -435,17 +433,17 @@ index 0000000..009b64b
// Test with VCS Remove.
File.WriteAllText ("testfile", "t");
- Repo.Add (added, false, new NullProgressMonitor ());
- Repo.DeleteFile (added, false, new NullProgressMonitor (), true);
+ Repo.Add (added, false, new ProgressMonitor ());
+ Repo.DeleteFile (added, false, new ProgressMonitor (), true);
Assert.AreEqual (VersionStatus.Versioned | VersionStatus.ScheduledDelete, Repo.GetVersionInfo (added, VersionInfoQueryFlags.IgnoreCache).Status);
// Reset state.
- Repo.Revert (added, false, new NullProgressMonitor ());
+ Repo.Revert (added, false, new ProgressMonitor ());
// Test with Project Remove.
File.WriteAllText ("testfile", "t");
- Repo.Add (added, false, new NullProgressMonitor ());
- Repo.DeleteFile (added, false, new NullProgressMonitor (), false);
+ Repo.Add (added, false, new ProgressMonitor ());
+ Repo.DeleteFile (added, false, new ProgressMonitor (), false);
Assert.AreEqual (VersionStatus.Versioned | VersionStatus.ScheduledDelete, Repo.GetVersionInfo (added, VersionInfoQueryFlags.IgnoreCache).Status);
}
@@ -458,7 +456,7 @@ index 0000000..009b64b
{
var repo2 = (GitRepository)Repo;
AddFile ("init", "init", true, true);
- repo2.Push (new NullProgressMonitor (), "origin", "master");
+ repo2.Push (new ProgressMonitor (), "origin", "master");
repo2.CreateBranch ("testBranch", "origin/master", "refs/remotes/origin/master");
if (exceptionType != null)
@@ -473,7 +471,7 @@ index 0000000..009b64b
{
var repo2 = (GitRepository)Repo;
AddFile ("init", "init", true, true);
- repo2.Push (new NullProgressMonitor (), "origin", "master");
+ repo2.Push (new ProgressMonitor (), "origin", "master");
repo2.SetBranchTrackRef ("testBranch", "origin/master", "refs/remotes/origin/master");
Assert.True (repo2.GetBranches ().Any (
@@ -498,7 +496,7 @@ index 0000000..009b64b
AddFile ("init", "init", toVcs, commit);
Assert.AreEqual (string.Empty, Repo.GetBaseText (added));
- var revisions = Repo.GetAnnotations (added).Select (a => a.Revision);
+ var revisions = Repo.GetAnnotations (added, null).Select (a => a.Revision);
foreach (var rev in revisions)
Assert.AreEqual (GettextCatalog.GetString ("working copy"), rev);
}
@@ -518,11 +516,11 @@ index 0000000..009b64b
AddFile ("init3", "init", toVcs: true, commit: true);
// Create two commits in test.
- gitRepo.SwitchToBranch (new NullProgressMonitor (), "test");
+ gitRepo.SwitchToBranch (new ProgressMonitor (), "test");
AddFile ("init4", "init", toVcs: true, commit: true);
AddFile ("init5", "init", toVcs: true, commit: true);
- gitRepo.Rebase ("master", GitUpdateOptions.None, new NullProgressMonitor ());
+ gitRepo.Rebase ("master", GitUpdateOptions.None, new ProgressMonitor ());
// Commits come in reverse (recent to old).
var history = gitRepo.GetHistory (LocalPath, null).Reverse ().ToArray ();
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseRepositoryTests.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseRepositoryTests.cs
index 46b64db071..fb87ce7cf4 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseRepositoryTests.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseRepositoryTests.cs
@@ -248,15 +248,15 @@ namespace MonoDevelop.VersionControl.Tests
ModifyPath (Repo2, ref second);
string added = second + "testfile2";
File.Create (added).Close ();
- Repo2.Add (added, false, new NullProgressMonitor ());
+ Repo2.Add (added, false, new ProgressMonitor ());
ChangeSet changes = Repo2.CreateChangeSet (Repo2.RootPath);
changes.AddFile (Repo2.GetVersionInfo (added, VersionInfoQueryFlags.IgnoreCache));
changes.GlobalComment = "test2";
- Repo2.Commit (changes, new NullProgressMonitor ());
+ Repo2.Commit (changes, new ProgressMonitor ());
PostCommit (Repo2);
- Repo.Update (Repo.RootPath, true, new NullProgressMonitor ());
+ Repo.Update (Repo.RootPath, true, new ProgressMonitor ());
Assert.True (File.Exists (LocalPath + "testfile2"));
Repo2.Dispose ();
@@ -326,7 +326,7 @@ namespace MonoDevelop.VersionControl.Tests
// Revert to head.
File.WriteAllText (added, content);
- Repo.Revert (added, false, new NullProgressMonitor ());
+ Repo.Revert (added, false, new ProgressMonitor ());
Assert.AreEqual (Repo.GetBaseText (added), File.ReadAllText (added));
}
@@ -343,7 +343,7 @@ namespace MonoDevelop.VersionControl.Tests
// Force cache evaluation.
Repo.GetVersionInfo (added, VersionInfoQueryFlags.IgnoreCache);
- Repo.Revert (added, false, new NullProgressMonitor ());
+ Repo.Revert (added, false, new ProgressMonitor ());
Assert.AreEqual (VersionStatus.Unversioned, Repo.GetVersionInfo (added, VersionInfoQueryFlags.IgnoreCache).Status);
}
@@ -370,7 +370,7 @@ namespace MonoDevelop.VersionControl.Tests
string added = LocalPath + "testfile2";
AddFile ("testfile", "text", true, true);
AddFile ("testfile2", "text2", true, true);
- Repo.RevertRevision (added, GetHeadRevision (), new NullProgressMonitor ());
+ Repo.RevertRevision (added, GetHeadRevision (), new ProgressMonitor ());
Assert.IsFalse (File.Exists (added));
}
@@ -387,7 +387,7 @@ namespace MonoDevelop.VersionControl.Tests
AddFile ("testfile", null, true, true);
src = LocalPath + "testfile";
dst = src + "2";
- Repo.MoveFile (src, dst, false, new NullProgressMonitor ());
+ Repo.MoveFile (src, dst, false, new ProgressMonitor ());
srcVi = Repo.GetVersionInfo (src, VersionInfoQueryFlags.IgnoreCache);
dstVi = Repo.GetVersionInfo (dst, VersionInfoQueryFlags.IgnoreCache);
const VersionStatus versionedStatus = VersionStatus.ScheduledDelete | VersionStatus.ScheduledReplace;
@@ -398,7 +398,7 @@ namespace MonoDevelop.VersionControl.Tests
AddFile ("addedfile", null, true, false);
src = LocalPath + "addedfile";
dst = src + "2";
- Repo.MoveFile (src, dst, false, new NullProgressMonitor ());
+ Repo.MoveFile (src, dst, false, new ProgressMonitor ());
srcVi = Repo.GetVersionInfo (src, VersionInfoQueryFlags.IgnoreCache);
dstVi = Repo.GetVersionInfo (dst, VersionInfoQueryFlags.IgnoreCache);
Assert.AreEqual (VersionStatus.Unversioned, srcVi.Status);
@@ -408,7 +408,7 @@ namespace MonoDevelop.VersionControl.Tests
AddFile ("unversionedfile", null, false, false);
src = LocalPath + "unversionedfile";
dst = src + "2";
- Repo.MoveFile (src, dst, false, new NullProgressMonitor ());
+ Repo.MoveFile (src, dst, false, new ProgressMonitor ());
srcVi = Repo.GetVersionInfo (src, VersionInfoQueryFlags.IgnoreCache);
dstVi = Repo.GetVersionInfo (dst, VersionInfoQueryFlags.IgnoreCache);
Assert.AreEqual (VersionStatus.Unversioned, srcVi.Status);
@@ -427,7 +427,7 @@ namespace MonoDevelop.VersionControl.Tests
AddDirectory ("test", true, false);
AddFile (Path.Combine ("test", "testfile"), null, true, true);
- Repo.MoveDirectory (srcDir, dstDir, false, new NullProgressMonitor ());
+ Repo.MoveDirectory (srcDir, dstDir, false, new ProgressMonitor ());
VersionInfo srcVi = Repo.GetVersionInfo (src, VersionInfoQueryFlags.IgnoreCache);
VersionInfo dstVi = Repo.GetVersionInfo (dst, VersionInfoQueryFlags.IgnoreCache);
const VersionStatus expectedStatus = VersionStatus.ScheduledDelete | VersionStatus.ScheduledReplace;
@@ -443,7 +443,7 @@ namespace MonoDevelop.VersionControl.Tests
// Versioned file.
added = LocalPath.Combine ("testfile1") + postFix;
AddFile ("testfile1" + postFix, null, true, true);
- Repo.DeleteFile (added, true, new NullProgressMonitor (), keepLocal);
+ Repo.DeleteFile (added, true, new ProgressMonitor (), keepLocal);
vi = Repo.GetVersionInfo (added, VersionInfoQueryFlags.IgnoreCache);
Assert.AreEqual (VersionStatus.ScheduledDelete, vi.Status & VersionStatus.ScheduledDelete);
Assert.AreEqual (keepLocal, File.Exists (added));
@@ -451,7 +451,7 @@ namespace MonoDevelop.VersionControl.Tests
// Just added file.
added = LocalPath.Combine ("testfile2") + postFix;
AddFile ("testfile2" + postFix, null, true, false);
- Repo.DeleteFile (added, true, new NullProgressMonitor (), keepLocal);
+ Repo.DeleteFile (added, true, new ProgressMonitor (), keepLocal);
vi = Repo.GetVersionInfo (added, VersionInfoQueryFlags.IgnoreCache);
Assert.AreEqual (VersionStatus.Unversioned, vi.Status);
Assert.AreEqual (keepLocal, File.Exists (added));
@@ -459,7 +459,7 @@ namespace MonoDevelop.VersionControl.Tests
// Non versioned file.
added = LocalPath.Combine ("testfile3") + postFix;
AddFile ("testfile3" + postFix, null, false, false);
- Repo.DeleteFile (added, true, new NullProgressMonitor (), keepLocal);
+ Repo.DeleteFile (added, true, new ProgressMonitor (), keepLocal);
vi = Repo.GetVersionInfo (added, VersionInfoQueryFlags.IgnoreCache);
Assert.AreEqual (VersionStatus.Unversioned, vi.Status);
Assert.AreEqual (keepLocal, File.Exists (added));
@@ -486,7 +486,7 @@ namespace MonoDevelop.VersionControl.Tests
AddDirectory ("test1" + postFix, true, false);
AddFile (Path.Combine ("test1" + postFix, "testfile"), null, true, true);
- Repo.DeleteDirectory (addedDir, true, new NullProgressMonitor (), keepLocal);
+ Repo.DeleteDirectory (addedDir, true, new ProgressMonitor (), keepLocal);
vi = Repo.GetVersionInfo (added, VersionInfoQueryFlags.IgnoreCache);
Assert.AreEqual (VersionStatus.ScheduledDelete, vi.Status & VersionStatus.ScheduledDelete);
Assert.AreEqual (keepLocal, File.Exists (added));
@@ -497,7 +497,7 @@ namespace MonoDevelop.VersionControl.Tests
AddDirectory ("test2" + postFix, true, false);
AddFile (Path.Combine ("test2" + postFix, "testfile"), null, true, false);
- Repo.DeleteDirectory (addedDir, true, new NullProgressMonitor (), keepLocal);
+ Repo.DeleteDirectory (addedDir, true, new ProgressMonitor (), keepLocal);
vi = Repo.GetVersionInfo (added, VersionInfoQueryFlags.IgnoreCache);
Assert.AreEqual (VersionStatus.Unversioned, vi.Status);
Assert.AreEqual (keepLocal, File.Exists (added));
@@ -508,7 +508,7 @@ namespace MonoDevelop.VersionControl.Tests
AddDirectory ("test3" + postFix, true, false);
AddFile (Path.Combine ("test3" + postFix, "testfile"), null, false, false);
- Repo.DeleteDirectory (addedDir, true, new NullProgressMonitor (), keepLocal);
+ Repo.DeleteDirectory (addedDir, true, new ProgressMonitor (), keepLocal);
vi = Repo.GetVersionInfo (added, VersionInfoQueryFlags.IgnoreCache);
Assert.AreEqual (VersionStatus.Unversioned, vi.Status);
Assert.AreEqual (keepLocal, File.Exists (added));
@@ -528,7 +528,7 @@ namespace MonoDevelop.VersionControl.Tests
{
string added = LocalPath + "testfile";
AddFile ("testfile", null, true, true);
- Repo.Lock (new NullProgressMonitor (), added);
+ Repo.Lock (new ProgressMonitor (), added);
PostLock ();
}
@@ -543,8 +543,8 @@ namespace MonoDevelop.VersionControl.Tests
{
string added = LocalPath + "testfile";
AddFile ("testfile", null, true, true);
- Repo.Lock (new NullProgressMonitor (), "testfile");
- Repo.Unlock (new NullProgressMonitor (), added);
+ Repo.Lock (new ProgressMonitor (), "testfile");
+ Repo.Unlock (new ProgressMonitor (), added);
PostLock ();
}
@@ -602,7 +602,7 @@ namespace MonoDevelop.VersionControl.Tests
// Working copy.
File.AppendAllText (added, "wut2" + Environment.NewLine);
- var annotations = Repo.GetAnnotations (added);
+ var annotations = Repo.GetAnnotations (added, null);
for (int i = 0; i < 2; i++) {
var annotation = annotations [i];
Assert.IsTrue (annotation.HasDate);
@@ -614,7 +614,8 @@ namespace MonoDevelop.VersionControl.Tests
Assert.False (annotations [2].HasEmail);
Assert.IsNotNull (annotations [2].Author);
Assert.IsNull (annotations [2].Email);
- Assert.AreEqual (annotations [2].Revision, GettextCatalog.GetString ("working copy"));
+ Assert.IsNull (annotations [2].Revision);
+ Assert.AreEqual (annotations [2].Text, GettextCatalog.GetString ("working copy"));
Assert.AreEqual (annotations [2].Author, "<uncommitted>");
}
@@ -629,8 +630,8 @@ namespace MonoDevelop.VersionControl.Tests
string dirFile = Path.Combine (dir, "testfile");
AddFile ("testfile", "test", true, true);
AddDirectory ("testdir", true, false);
- Repo.MoveFile (added, dirFile, true, new NullProgressMonitor ());
- Repo.MoveFile (dirFile, added, true, new NullProgressMonitor ());
+ Repo.MoveFile (added, dirFile, true, new ProgressMonitor ());
+ Repo.MoveFile (dirFile, added, true, new ProgressMonitor ());
Assert.AreEqual (VersionStatus.Unversioned, Repo.GetVersionInfo (dirFile, VersionInfoQueryFlags.IgnoreCache).Status);
Assert.AreEqual (VersionStatus.Versioned, Repo.GetVersionInfo (added, VersionInfoQueryFlags.IgnoreCache).Status);
@@ -645,8 +646,8 @@ namespace MonoDevelop.VersionControl.Tests
// Force cache update.
Repo.GetVersionInfo (added, VersionInfoQueryFlags.IgnoreCache);
- Repo.DeleteFile (added, true, new NullProgressMonitor (), false);
- Repo.Revert (added, false, new NullProgressMonitor ());
+ Repo.DeleteFile (added, true, new ProgressMonitor (), false);
+ Repo.Revert (added, false, new ProgressMonitor ());
Assert.AreEqual (VersionStatus.Versioned, Repo.GetVersionInfo (added, VersionInfoQueryFlags.IgnoreCache).Status);
}
@@ -656,7 +657,7 @@ namespace MonoDevelop.VersionControl.Tests
{
var mockRepo = (UrlBasedRepository)GetRepo ();
mockRepo.Url = url;
- mockRepo.Checkout (path, true, new NullProgressMonitor ());
+ mockRepo.Checkout (path, true, new ProgressMonitor ());
var _repo = GetRepo (path, url);
if (Repo == null)
@@ -672,7 +673,7 @@ namespace MonoDevelop.VersionControl.Tests
changes.AddFile (Repo.GetVersionInfo (item, VersionInfoQueryFlags.IgnoreCache));
}
changes.GlobalComment = String.Format ("Commit #{0}", CommitNumber);
- Repo.Commit (changes, new NullProgressMonitor ());
+ Repo.Commit (changes, new ProgressMonitor ());
CommitNumber++;
}
@@ -686,7 +687,7 @@ namespace MonoDevelop.VersionControl.Tests
changes.AddFile (Repo.GetVersionInfo (path, VersionInfoQueryFlags.IgnoreCache));
changes.GlobalComment = String.Format ("Commit #{0}", CommitNumber);
- Repo.Commit (changes, new NullProgressMonitor ());
+ Repo.Commit (changes, new ProgressMonitor ());
CommitNumber++;
}
@@ -709,7 +710,7 @@ namespace MonoDevelop.VersionControl.Tests
File.WriteAllText (added, contents);
if (toVcs)
- Repo.Add (added, false, new NullProgressMonitor ());
+ Repo.Add (added, false, new ProgressMonitor ());
if (commit)
CommitFile (added);
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj
index 1fc7c56620..2d2b01fe3b 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj
@@ -19,20 +19,17 @@
<Optimize>false</Optimize>
<OutputPath>..\..\..\..\build\tests</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<NoWarn>1591;1573</NoWarn>
- <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\..\build\tests</OutputPath>
- <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
- <DebugSymbols>true</DebugSymbols>
<NoWarn>1591;1573</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
@@ -42,7 +39,6 @@
<Optimize>false</Optimize>
<OutputPath>..\..\..\..\build\tests</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<NoWarn>1591;1573</NoWarn>
@@ -54,7 +50,6 @@
<Optimize>false</Optimize>
<OutputPath>..\..\..\..\build\tests</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<NoWarn>1591;1573</NoWarn>
@@ -66,39 +61,38 @@
<Optimize>false</Optimize>
<OutputPath>..\..\..\..\build\tests</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<NoWarn>1591;1573</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseWin32|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\..\build\tests</OutputPath>
<WarningLevel>4</WarningLevel>
- <DebugSymbols>true</DebugSymbols>
<NoWarn>1591;1573</NoWarn>
- <DebugType>pdbonly</DebugType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseMac|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\..\build\tests</OutputPath>
<WarningLevel>4</WarningLevel>
- <DebugSymbols>true</DebugSymbols>
<NoWarn>1591;1573</NoWarn>
- <DebugType>pdbonly</DebugType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseGnome|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\..\build\tests</OutputPath>
<WarningLevel>4</WarningLevel>
- <DebugSymbols>true</DebugSymbols>
<NoWarn>1591;1573</NoWarn>
- <DebugType>pdbonly</DebugType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/ChangeLog b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/ChangeLog
deleted file mode 100644
index 3556096ce1..0000000000
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/ChangeLog
+++ /dev/null
@@ -1,133 +0,0 @@
-2010-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.VersionControl.Git.csproj:
- * MonoDevelop.VersionControl.Git/GitRepository.cs:
- * MonoDevelop.VersionControl.Git/UserInfoConflictDialog.cs:
- * MonoDevelop.VersionControl.Git/CommitDialogExtensionWidget.cs:
- * gtk-gui/MonoDevelop.VersionControl.Git.UserInfoConflictDialog.cs:
- Check conflicts between user information configured in MD
- and Git. In case of conflict, allow the user to choose which
- information to use.
-
-2010-07-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Git/GitRepository.cs: Use
- relative paths in the git command invocations. Old git
- versions have problems with absolute paths.
-
-2010-07-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Git/GitRepository.cs: Don't use
- the --porcelain option for the status command, since it is
- not available in old git versions.
-
-2010-07-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Git/GitRepository.cs: Implement
- Blame command.
-
-2010-07-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Git/GitRepository.cs: Trim empty
- lines from commit messages.
-
-2010-07-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Git/GitRepository.cs: Improve
- handling of git moves and deletes.
-
-2010-07-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Git/GitRepository.cs: Stash local
- changes before doing a pull or branch switch.
-
-2010-07-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Git.addin.xml: Don't show the
- Switch to Branch command if there are no branches.
-
- * Makefile.am:
- * MonoDevelop.VersionControl.Git.csproj: Updated.
-
- * MonoDevelop.VersionControl.Git/Commands.cs:
- * MonoDevelop.VersionControl.Git/GitService.cs: Moved Push
- command to the new GitService class.
-
- * MonoDevelop.VersionControl.Git/CommitDialogExtensionWidget.cs:
- Added extension which allows pushing changes after
- committing.
-
-2010-07-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.VersionControl.Git.csproj:
- * MonoDevelop.VersionControl.Git.addin.xml:
- * MonoDevelop.VersionControl.Git/GitNodeBuilderExtension.cs:
- Show the current branch next to the solution name.
-
-2010-07-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Git/GitRepository.cs: Notify file
- changes after pulling.
-
-2010-07-28 Dale Ragan <dale.ragan@sinesignal.com>
-
- * MonoDevelop.VersionControl.Git.addin.xml: Fixed
- typo and issue with add-in not loading due to bad
- extension for adding the Switch to Branch label.
-
- * MonoDevelop.VersionControl.Git/Commands.cs: Fixed
- a small typo.
-
-2010-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Git/GitRepository.cs: Remove
- debug output.
-
- * MonoDevelop.VersionControl.Git/GitVersionControl.cs: Added
- missing null check.
-
-2010-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * MonoDevelop.VersionControl.Git.csproj:
- * MonoDevelop.VersionControl.Git.addin.xml:
- * MonoDevelop.VersionControl.Git/Commands.cs:
- * MonoDevelop.VersionControl.Git/PushDialog.cs:
- * MonoDevelop.VersionControl.Git/GitRepository.cs:
- * gtk-gui/MonoDevelop.VersionControl.Git.PushDialog.cs:
- Implement push command.
-
-2010-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Git.csproj:
- * MonoDevelop.VersionControl.Git.addin.xml:
- * MonoDevelop.VersionControl.Git/GitRepository.cs:
- * MonoDevelop.VersionControl.Git/GitVersionControl.cs: Add
- basic support for git.
-
-2010-06-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl.Git.csproj: Make MD refs private.
- Should fix running on .NET.
-
-2010-06-28 Dale Ragan <dale.ragan@sinesignal.com>
-
- * Makefile.am:
- * MonoDevelop.VersionControl.Git.csproj:
- * AssemblyInfo.cs:
- * MonoDevelop.VersionControl.Git.addin.xml:
- * MonoDevelop.VersionControl.Git/GitClient.cs:
- * MonoDevelop.VersionControl.Git/GitVersionControl.cs:
- * MonoDevelop.VersionControl.Git/GitRepository.cs:
- Official kickoff of the 'Support for Git' task. This
- is mainly a skeleton and no functionality. The add-in
- is recognized by MonoDevelop and the Version Control add-in
- sees the new Git Version Control System. Of course it
- doesn't show up in the drop down, due to the
- NotImplementedException's.
-
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/Commands.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/Commands.cs
index 340a6134fe..bbf092f617 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/Commands.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/Commands.cs
@@ -52,7 +52,7 @@ namespace MonoDevelop.VersionControl.Git
{
public GitRepository Repository {
get {
- IWorkspaceObject wob = IdeApp.ProjectOperations.CurrentSelectedSolutionItem;
+ WorkspaceObject wob = IdeApp.ProjectOperations.CurrentSelectedSolutionItem;
if (wob == null)
wob = IdeApp.ProjectOperations.CurrentSelectedWorkspaceItem;
if (wob != null)
@@ -64,7 +64,7 @@ namespace MonoDevelop.VersionControl.Git
protected GitRepository UpdateVisibility (CommandInfo info)
{
var repo = Repository;
- info.Visible = Repository != null;
+ info.Visible = repo != null;
return repo;
}
@@ -91,9 +91,9 @@ namespace MonoDevelop.VersionControl.Git
class SwitchToBranchHandler: GitCommandHandler
{
- protected override void Run (object dataItem)
+ protected async override void Run (object dataItem)
{
- GitService.SwitchToBranch (Repository, (string)dataItem);
+ await GitService.SwitchToBranch (Repository, (string)dataItem).ConfigureAwait (false);
}
protected override void Update (CommandArrayInfo info)
@@ -102,7 +102,7 @@ namespace MonoDevelop.VersionControl.Git
if (repo == null)
return;
- var wob = IdeApp.ProjectOperations.CurrentSelectedItem as IWorkspaceObject;
+ var wob = IdeApp.ProjectOperations.CurrentSelectedItem as WorkspaceObject;
if (wob == null)
return;
if (((wob is WorkspaceItem) && ((WorkspaceItem)wob).ParentWorkspace == null) ||
@@ -163,7 +163,7 @@ namespace MonoDevelop.VersionControl.Git
msg = GettextCatalog.GetString ("No changes were available to stash");
}
- DispatchService.GuiDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
IdeApp.Workbench.StatusBar.ShowMessage (msg);
});
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/CredentialsDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/CredentialsDialog.cs
index aee2f14d98..e8652e774a 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/CredentialsDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/CredentialsDialog.cs
@@ -1,37 +1,38 @@
-//
-// CredentialsDialog.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
+//
+// CredentialsDialog.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
using Gtk;
using System;
using LibGit2Sharp;
using MonoDevelop.Components;
-
+using MonoDevelop.Core;
+
namespace MonoDevelop.VersionControl.Git
{
- partial class CredentialsDialog : Dialog
+ partial class CredentialsDialog : Gtk.Dialog
{
uint r;
public CredentialsDialog (string uri, SupportedCredentialTypes type, Credentials cred)
@@ -40,7 +41,7 @@ namespace MonoDevelop.VersionControl.Git
this.UseNativeContextMenus ();
- labelTop.Text = string.Format (labelTop.Text, uri);
+ labelTop1.Text = string.Format (labelTop1.Text, uri);
var table = new Table (0, 0, false);
table.ColumnSpacing = 6;
@@ -50,12 +51,12 @@ namespace MonoDevelop.VersionControl.Git
switch (type) {
case SupportedCredentialTypes.UsernamePassword:
upcred = (UsernamePasswordCredentials)cred;
- firstEditor = CreateEntry (table, "Username:", false);
- CreateEntry (table, "Password:", true);
+ firstEditor = CreateEntry (table, GettextCatalog.GetString ("Username:"), false);
+ CreateEntry (table, GettextCatalog.GetString ("Password:"), true);
break;
case SupportedCredentialTypes.Ssh:
sshcred = (SshUserKeyCredentials)cred;
- firstEditor = CreateEntry (table, "Passphrase:", true);
+ firstEditor = CreateEntry (table, GettextCatalog.GetString ("Passphrase:"), true);
break;
}
table.ShowAll ();
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditBranchDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditBranchDialog.cs
index a41d5fc3e6..80fb850069 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditBranchDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditBranchDialog.cs
@@ -35,7 +35,7 @@ using System.ComponentModel;
namespace MonoDevelop.VersionControl.Git
{
- partial class EditBranchDialog : Dialog
+ partial class EditBranchDialog : Gtk.Dialog
{
readonly ListStore comboStore;
readonly string currentTracking;
@@ -124,7 +124,7 @@ namespace MonoDevelop.VersionControl.Git
labelError.Show ();
buttonOk.Sensitive = false;
} else if (!Reference.IsValidName ("refs/" + entryName.Text)) {
- labelError.Markup = "<span color='red'>" + GettextCatalog.GetString (@"A branch name can not:
+ labelError.Markup = "<span color='" + Ide.Gui.Styles.ErrorForegroundColor.ToHexString (false) + "'>" + GettextCatalog.GetString (@"A branch name can not:
Start with '.' or end with '/' or '.lock'
Contain a ' ', '..', '~', '^', ':', '\', '?', '['") + "</span>";
labelError.Show ();
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCommitDialogExtension.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCommitDialogExtension.cs
index e058292500..2c0cff0a13 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCommitDialogExtension.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCommitDialogExtension.cs
@@ -42,8 +42,9 @@ namespace MonoDevelop.VersionControl.Git
public override bool Initialize (ChangeSet changeSet)
{
- if (changeSet.Repository is GitRepository) {
- widget = new GitCommitDialogExtensionWidget ();
+ var repo = changeSet.Repository as GitRepository;
+ if (repo != null) {
+ widget = new GitCommitDialogExtensionWidget (repo);
Add (widget);
widget.Show ();
Show ();
@@ -144,11 +145,11 @@ namespace MonoDevelop.VersionControl.Git
static string GetDesc (string name, string email)
{
if (string.IsNullOrEmpty (name) && string.IsNullOrEmpty (email))
- return "Not configured";
+ return GettextCatalog.GetString ("Not configured");
if (string.IsNullOrEmpty (name))
name = GettextCatalog.GetString ("Name not configured");
if (string.IsNullOrEmpty (email))
- email = GettextCatalog.GetString ("e-mail not configured");
+ email = GettextCatalog.GetString ("Email not configured");
return name + ", " + email;
}
@@ -162,7 +163,7 @@ namespace MonoDevelop.VersionControl.Git
{
this.textView = textView;
overflowTextTag = new Gtk.TextTag ("overflow");
- overflowTextTag.Foreground = "red";
+ overflowTextTag.Foreground = Ide.Gui.Styles.ErrorForegroundColor.ToHexString (false);
overflowTextTag.ForegroundSet = true;
textView.Buffer.TagTable.Add (overflowTextTag);
textView.Buffer.Changed += OnTextChanged;
@@ -185,8 +186,8 @@ namespace MonoDevelop.VersionControl.Git
var lines = text.Split ('\n');
if (lines.Length > 0 && lines [0].Length > maxLengthConventionForFirstLineOfCommitMessage) {
if (!textView.HasTooltip) {
- textView.TooltipText = String.Format (GettextCatalog.GetString (
- "When using Git, it is not recommended to surpass the character count of {0} in the first line of the commit message"),
+ textView.TooltipText = GettextCatalog.GetString (
+ "When using Git, it is not recommended to surpass the character count of {0} in the first line of the commit message",
maxLengthConventionForFirstLineOfCommitMessage);
textView.HasTooltip = true;
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCommitDialogExtensionWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCommitDialogExtensionWidget.cs
index 700a73fbbc..5e4f68a689 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCommitDialogExtensionWidget.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCommitDialogExtensionWidget.cs
@@ -24,15 +24,22 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using MonoDevelop.Core;
namespace MonoDevelop.VersionControl.Git
{
[System.ComponentModel.ToolboxItem(true)]
partial class GitCommitDialogExtensionWidget : Gtk.Bin
{
- public GitCommitDialogExtensionWidget ()
+ public GitCommitDialogExtensionWidget (GitRepository repo)
{
this.Build ();
+
+ bool hasRemote = repo.GetCurrentRemote () != null;
+ if (!hasRemote) {
+ checkPush.Sensitive = false;
+ checkPush.TooltipText = GettextCatalog.GetString ("Pushing is only available for repositories with configured remotes.");
+ }
}
public bool PushAfterCommit {
@@ -59,8 +66,7 @@ namespace MonoDevelop.VersionControl.Git
void OnChanged (object sender, EventArgs e)
{
- if (Changed != null)
- Changed (this, EventArgs.Empty);
+ Changed?.Invoke (this, EventArgs.Empty);
}
public event EventHandler Changed;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitConfigurationDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitConfigurationDialog.cs
index 2aca50c4b4..031ecde20c 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitConfigurationDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitConfigurationDialog.cs
@@ -35,7 +35,7 @@ using System.ComponentModel;
namespace MonoDevelop.VersionControl.Git
{
- partial class GitConfigurationDialog : Dialog
+ partial class GitConfigurationDialog : Gtk.Dialog
{
readonly GitRepository repo;
readonly ListStore storeBranches;
@@ -85,8 +85,8 @@ namespace MonoDevelop.VersionControl.Git
SemanticModelAttribute remotesModelAttr = new SemanticModelAttribute ("storeRemotes__Remote", "storeRemotes__Name", "storeRemotes__Url", "storeRemotes__BranchName", "storeRemotes__FullName");
TypeDescriptor.AddAttributes (storeRemotes, remotesModelAttr);
- treeRemotes.AppendColumn ("Remote Source / Branch", new CellRendererText (), "markup", 1);
- treeRemotes.AppendColumn ("Url", new CellRendererText (), "text", 2);
+ treeRemotes.AppendColumn (GettextCatalog.GetString ("Remote Source / Branch"), new CellRendererText (), "markup", 1);
+ treeRemotes.AppendColumn (GettextCatalog.GetString ("Url"), new CellRendererText (), "text", 2);
treeRemotes.Selection.Changed += delegate {
TreeIter it;
@@ -221,14 +221,14 @@ namespace MonoDevelop.VersionControl.Git
}
}
- protected virtual void OnButtonSetDefaultBranchClicked (object sender, EventArgs e)
+ protected virtual async void OnButtonSetDefaultBranchClicked (object sender, EventArgs e)
{
TreeIter it;
if (!listBranches.Selection.GetSelected (out it))
return;
var b = (Branch) storeBranches.GetValue (it, 0);
- GitService.SwitchToBranch (repo, b.FriendlyName);
- FillBranches ();
+ if (await GitService.SwitchToBranch (repo, b.FriendlyName))
+ FillBranches ();
}
protected virtual void OnButtonAddRemoteClicked (object sender, EventArgs e)
@@ -369,7 +369,7 @@ namespace MonoDevelop.VersionControl.Git
if (remoteName == null)
return;
- repo.Fetch (VersionControlService.GetProgressMonitor ("Fetching remote..."), remoteName);
+ repo.Fetch (VersionControlService.GetProgressMonitor (GettextCatalog.GetString ("Fetching remote...")), remoteName);
FillRemotes ();
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCredentials.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCredentials.cs
index f6aaa17013..787d96bc0b 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCredentials.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCredentials.cs
@@ -91,15 +91,16 @@ namespace MonoDevelop.VersionControl.Git
// We always need to run the TryGet* methods as we need the passphraseItem/passwordItem populated even
// if the password store contains an invalid password/no password
if ((types & SupportedCredentialTypes.UsernamePassword) != 0) {
- uri = new Uri (url);
- string username;
- string password;
- if (!state.NativePasswordUsed && TryGetUsernamePassword (uri, out username, out password)) {
- state.NativePasswordUsed = true;
- return new UsernamePasswordCredentials {
- Username = username,
- Password = password
- };
+ if (Uri.TryCreate (url, UriKind.RelativeOrAbsolute, out uri)) {
+ string username;
+ string password;
+ if (!state.NativePasswordUsed && TryGetUsernamePassword (uri, out username, out password)) {
+ state.NativePasswordUsed = true;
+ return new UsernamePasswordCredentials {
+ Username = username,
+ Password = password
+ };
+ }
}
}
@@ -127,14 +128,12 @@ namespace MonoDevelop.VersionControl.Git
state.KeyUsed++;
else {
SelectFileDialog dlg = null;
- bool success = false;
-
- DispatchService.GuiSyncDispatch (() => {
+ bool success = Runtime.RunInMainThread (() => {
dlg = new SelectFileDialog (GettextCatalog.GetString ("Select a private SSH key to use."));
dlg.ShowHidden = true;
dlg.CurrentFolder = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
- success = dlg.Run ();
- });
+ return dlg.Run ();
+ }).Result;
if (!success || !File.Exists (dlg.SelectedFile + ".pub"))
throw new VersionControlException (GettextCatalog.GetString ("Invalid credentials were supplied. Aborting operation."));
@@ -146,10 +145,10 @@ namespace MonoDevelop.VersionControl.Git
};
if (KeyHasPassphrase (dlg.SelectedFile)) {
- DispatchService.GuiSyncDispatch (delegate {
+ result = Runtime.RunInMainThread (delegate {
using (var credDlg = new CredentialsDialog (url, types, cred))
- result = MessageService.ShowCustomDialog (credDlg) == (int)Gtk.ResponseType.Ok;
- });
+ return MessageService.ShowCustomDialog (credDlg) == (int)Gtk.ResponseType.Ok;
+ }).Result;
}
if (result)
@@ -168,15 +167,15 @@ namespace MonoDevelop.VersionControl.Git
return cred;
}
- DispatchService.GuiSyncDispatch (delegate {
+ result = Runtime.RunInMainThread (delegate {
using (var credDlg = new CredentialsDialog (url, types, cred))
- result = MessageService.ShowCustomDialog (credDlg) == (int)Gtk.ResponseType.Ok;
- });
+ return MessageService.ShowCustomDialog (credDlg) == (int)Gtk.ResponseType.Ok;
+ }).Result;
if (result) {
if ((types & SupportedCredentialTypes.UsernamePassword) != 0) {
var upcred = (UsernamePasswordCredentials)cred;
- if (!string.IsNullOrEmpty (upcred.Password)) {
+ if (!string.IsNullOrEmpty (upcred.Password) && uri != null) {
PasswordService.AddWebUserNameAndPassword (uri, upcred.Username, upcred.Password);
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitNodeBuilderExtension.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitNodeBuilderExtension.cs
index 865c94a1ee..2dddbbb23e 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitNodeBuilderExtension.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitNodeBuilderExtension.cs
@@ -35,7 +35,7 @@ namespace MonoDevelop.VersionControl.Git
{
sealed class GitNodeBuilderExtension: NodeBuilderExtension
{
- readonly Dictionary<FilePath,IWorkspaceObject> repos = new Dictionary<FilePath, IWorkspaceObject> ();
+ readonly Dictionary<FilePath,WorkspaceObject> repos = new Dictionary<FilePath, WorkspaceObject> ();
protected override void Initialize ()
{
@@ -53,25 +53,29 @@ namespace MonoDevelop.VersionControl.Git
public override bool CanBuildNode (Type dataType)
{
- return typeof(IWorkspaceObject).IsAssignableFrom (dataType);
+ return typeof(WorkspaceObject).IsAssignableFrom (dataType);
}
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
{
- var ob = (IWorkspaceObject) dataObject;
+ var ob = (WorkspaceObject) dataObject;
var rep = VersionControlService.GetRepository (ob) as GitRepository;
if (rep != null) {
- IWorkspaceObject rob;
+ WorkspaceObject rob;
if (repos.TryGetValue (rep.RootPath, out rob)) {
- if (ob == rob)
- nodeInfo.Label += " (" + rep.GetCurrentBranch () + ")";
+ if (ob == rob) {
+ string branch = rep.GetCurrentBranch ();
+ if (branch == "(no branch)")
+ branch = rep.RootRepository.ObjectDatabase.ShortenObjectId (rep.RootRepository.Head.Tip);
+ nodeInfo.Label += " (" + branch + ")";
+ }
}
}
}
public override void OnNodeAdded (object dataObject)
{
- var ob = (IWorkspaceObject) dataObject;
+ var ob = (WorkspaceObject) dataObject;
var rep = VersionControlService.GetRepository (ob) as GitRepository;
if (rep != null && !repos.ContainsKey (rep.RootPath)) {
repos [rep.RootPath] = ob;
@@ -80,9 +84,9 @@ namespace MonoDevelop.VersionControl.Git
public override void OnNodeRemoved (object dataObject)
{
- var ob = (IWorkspaceObject) dataObject;
+ var ob = (WorkspaceObject) dataObject;
var rep = VersionControlService.GetRepository (ob) as GitRepository;
- IWorkspaceObject rob;
+ WorkspaceObject rob;
if (rep != null && repos.TryGetValue (rep.RootPath, out rob)) {
if (ob == rob)
repos.Remove (rep.RootPath);
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitOptionsPanel.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitOptionsPanel.cs
index 5a09a60d17..640a44142c 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitOptionsPanel.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitOptionsPanel.cs
@@ -23,6 +23,7 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.VersionControl.Git
@@ -31,7 +32,7 @@ namespace MonoDevelop.VersionControl.Git
{
GitOptionsPanelWidget widget;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new GitOptionsPanelWidget ();
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitOptionsPanelWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitOptionsPanelWidget.cs
index fb2c8d024a..6dfc4554f5 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitOptionsPanelWidget.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitOptionsPanelWidget.cs
@@ -39,9 +39,9 @@ namespace MonoDevelop.VersionControl.Git
public void ApplyChanges ()
{
- GitService.UseRebaseOptionWhenPulling = checkRebase.Active;
- GitService.StashUnstashWhenUpdating = checkStashUpdate.Active;
- GitService.StashUnstashWhenSwitchingBranches = checkStashBranch.Active;
+ GitService.UseRebaseOptionWhenPulling.Value = checkRebase.Active;
+ GitService.StashUnstashWhenUpdating.Value = checkStashUpdate.Active;
+ GitService.StashUnstashWhenSwitchingBranches.Value = checkStashBranch.Active;
}
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs
index a91ff501a2..01e1c89b1d 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs
@@ -33,6 +33,7 @@ using MonoDevelop.Core;
using System.Collections.Generic;
using System.Text;
using MonoDevelop.Ide;
+using ProgressMonitor = MonoDevelop.Core.ProgressMonitor;
using LibGit2Sharp;
namespace MonoDevelop.VersionControl.Git
@@ -61,13 +62,15 @@ namespace MonoDevelop.VersionControl.Git
public GitRepository (VersionControlSystem vcs, FilePath path, string url) : base (vcs)
{
- RootPath = path;
RootRepository = new LibGit2Sharp.Repository (path);
+ RootPath = RootRepository.Info.WorkingDirectory;
Url = url;
}
+ internal bool Disposed { get; private set; }
public override void Dispose ()
{
+ Disposed = true;
base.Dispose ();
if (VersionControlSystem != null)
@@ -164,10 +167,10 @@ namespace MonoDevelop.VersionControl.Git
const int progressThrottle = 200;
static System.Diagnostics.Stopwatch throttleWatch = new System.Diagnostics.Stopwatch ();
- static bool OnTransferProgress (TransferProgress tp, IProgressMonitor monitor, ref int progress)
+ static bool OnTransferProgress (TransferProgress tp, ProgressMonitor monitor, ref int progress)
{
if (progress == 0 && tp.ReceivedObjects == 0) {
- monitor.BeginTask ("Receiving and indexing objects", 2 * tp.TotalObjects);
+ monitor.BeginTask (GettextCatalog.GetString ("Receiving and indexing objects"), 2 * tp.TotalObjects);
throttleWatch.Restart ();
}
@@ -184,13 +187,13 @@ namespace MonoDevelop.VersionControl.Git
throttleWatch.Stop ();
}
- return !monitor.IsCancelRequested;
+ return !monitor.CancellationToken.IsCancellationRequested;
}
- static void OnCheckoutProgress (int completedSteps, int totalSteps, IProgressMonitor monitor, ref int progress)
+ static void OnCheckoutProgress (int completedSteps, int totalSteps, ProgressMonitor monitor, ref int progress)
{
if (progress == 0 && completedSteps == 0) {
- monitor.BeginTask ("Checking out files", totalSteps);
+ monitor.BeginTask (GettextCatalog.GetString ("Checking out files"), totalSteps);
throttleWatch.Restart ();
}
@@ -219,10 +222,10 @@ namespace MonoDevelop.VersionControl.Git
}
}
- public StashApplyStatus ApplyStash (IProgressMonitor monitor, int stashIndex)
+ public StashApplyStatus ApplyStash (ProgressMonitor monitor, int stashIndex)
{
if (monitor != null)
- monitor.BeginTask ("Applying stash", 1);
+ monitor.BeginTask (GettextCatalog.GetString ("Applying stash"), 1);
int progress = 0;
StashApplyStatus res = RootRepository.Stashes.Apply (stashIndex, new StashApplyOptions {
@@ -240,10 +243,10 @@ namespace MonoDevelop.VersionControl.Git
return res;
}
- public StashApplyStatus PopStash (IProgressMonitor monitor, int stashIndex)
+ public StashApplyStatus PopStash (ProgressMonitor monitor, int stashIndex)
{
if (monitor != null)
- monitor.BeginTask ("Applying stash", 1);
+ monitor.BeginTask (GettextCatalog.GetString ("Popping stash"), 1);
var stash = RootRepository.Stashes [stashIndex];
int progress = 0;
@@ -261,7 +264,7 @@ namespace MonoDevelop.VersionControl.Git
return res;
}
- public bool TryCreateStash (IProgressMonitor monitor, string message, out Stash stash)
+ public bool TryCreateStash (ProgressMonitor monitor, string message, out Stash stash)
{
Signature sig = GetSignature ();
stash = null;
@@ -269,7 +272,7 @@ namespace MonoDevelop.VersionControl.Git
return false;
if (monitor != null)
- monitor.BeginTask ("Stashing changes", 1);
+ monitor.BeginTask (GettextCatalog.GetString ("Stashing changes"), 1);
stash = RootRepository.Stashes.Add (sig, message, StashModifiers.Default | StashModifiers.IncludeUntracked);
@@ -323,8 +326,6 @@ namespace MonoDevelop.VersionControl.Git
protected override Revision[] OnGetHistory (FilePath localFile, Revision since)
{
- var revs = new List<Revision> ();
-
var repository = GetRepository (localFile);
var hc = GetHeadCommit (repository);
if (hc == null)
@@ -334,22 +335,37 @@ namespace MonoDevelop.VersionControl.Git
IEnumerable<Commit> commits = repository.Commits;
if (localFile.CanonicalPath != RootPath.CanonicalPath.ResolveLinks ()) {
var localPath = repository.ToGitPath (localFile);
- commits = commits.Where (c => c.Parents.Count () == 1 && c.Tree [localPath] != null &&
- (c.Parents.FirstOrDefault ().Tree [localPath] == null ||
- c.Tree [localPath].Target.Id != c.Parents.FirstOrDefault ().Tree [localPath].Target.Id));
+ commits = commits.Where (c => {
+ int count = c.Parents.Count ();
+ if (count > 1)
+ return false;
+
+ var localTreeEntry = c.Tree [localPath];
+ if (localTreeEntry == null)
+ return false;
+
+ if (count == 0)
+ return true;
+
+ var parentTreeEntry = c.Parents.Single ().Tree [localPath];
+ return parentTreeEntry == null || localTreeEntry.Target.Id != parentTreeEntry.Target.Id;
+ });
}
- foreach (var commit in commits.TakeWhile (c => c != sinceRev)) {
+ return commits.TakeWhile (c => c != sinceRev).Select (commit => {
var author = commit.Author;
+ var shortMessage = commit.MessageShort;
+ if (shortMessage.Length > 50) {
+ shortMessage = shortMessage.Substring (0, 50) + "…";
+ }
+
var rev = new GitRevision (this, repository, commit, author.When.LocalDateTime, author.Name, commit.Message) {
Email = author.Email,
- ShortMessage = commit.MessageShort,
+ ShortMessage = shortMessage,
FileForChanges = localFile,
};
- revs.Add (rev);
- }
-
- return revs.ToArray ();
+ return rev;
+ }).ToArray ();
}
protected override RevisionPath[] OnGetRevisionChanges (Revision revision)
@@ -369,7 +385,7 @@ namespace MonoDevelop.VersionControl.Git
foreach (var entry in changes.Deleted)
paths.Add (new RevisionPath (rev.GitRepository.FromGitPath (entry.OldPath), RevisionAction.Delete, null));
foreach (var entry in changes.Renamed)
- paths.Add (new RevisionPath (rev.GitRepository.FromGitPath (entry.Path), RevisionAction.Replace, null));
+ paths.Add (new RevisionPath (rev.GitRepository.FromGitPath (entry.Path), rev.GitRepository.FromGitPath (entry.OldPath), RevisionAction.Replace, null));
foreach (var entry in changes.Modified)
paths.Add (new RevisionPath (rev.GitRepository.FromGitPath (entry.Path), RevisionAction.Modify, null));
foreach (var entry in changes.TypeChanged)
@@ -554,7 +570,7 @@ namespace MonoDevelop.VersionControl.Git
.Select (f => new FilePath (f)));
}
- protected override Repository OnPublish (string serverPath, FilePath localPath, FilePath[] files, string message, IProgressMonitor monitor)
+ protected override Repository OnPublish (string serverPath, FilePath localPath, FilePath[] files, string message, ProgressMonitor monitor)
{
// Initialize the repository
RootRepository = new LibGit2Sharp.Repository (LibGit2Sharp.Repository.Init (localPath));
@@ -588,10 +604,10 @@ namespace MonoDevelop.VersionControl.Git
return this;
}
- protected override void OnUpdate (FilePath[] localPaths, bool recurse, IProgressMonitor monitor)
+ protected override void OnUpdate (FilePath[] localPaths, bool recurse, ProgressMonitor monitor)
{
// TODO: Make it work differently for submodules.
- monitor.BeginTask (GettextCatalog.GetString ("Updating"), 5);
+ monitor.BeginTask (GettextCatalog.GetString (GettextCatalog.GetString ("Updating")), 5);
if (RootRepository.Head.IsTracking) {
Fetch (monitor, RootRepository.Head.Remote.Name);
@@ -608,7 +624,7 @@ namespace MonoDevelop.VersionControl.Git
monitor.EndTask ();
}
- static void RetryUntilSuccess (IProgressMonitor monitor, Action<GitCredentialsType> func)
+ static void RetryUntilSuccess (ProgressMonitor monitor, Action<GitCredentialsType> func)
{
bool retry;
using (var tfsSession = new TfsSmartSession ()) {
@@ -641,9 +657,9 @@ namespace MonoDevelop.VersionControl.Git
string message;
// TODO: Remove me once https://github.com/libgit2/libgit2/pull/3137 goes in.
if (string.Equals (e.Message, "early EOF", StringComparison.OrdinalIgnoreCase))
- message = "Unable to authorize credentials for the repository.";
+ message = GettextCatalog.GetString ("Unable to authorize credentials for the repository.");
else if (string.Equals (e.Message, "Received unexpected content-type", StringComparison.OrdinalIgnoreCase))
- message = "Not a valid git repository.";
+ message = GettextCatalog.GetString ("Not a valid git repository.");
else
message = e.Message;
@@ -655,7 +671,7 @@ namespace MonoDevelop.VersionControl.Git
}
}
- public void Fetch (IProgressMonitor monitor, string remote)
+ public void Fetch (ProgressMonitor monitor, string remote)
{
monitor.Log.WriteLine (GettextCatalog.GetString ("Fetching from '{0}'", remote));
int progress = 0;
@@ -666,7 +682,7 @@ namespace MonoDevelop.VersionControl.Git
monitor.Step (1);
}
- bool CommonPreMergeRebase (GitUpdateOptions options, IProgressMonitor monitor, out int stashIndex)
+ bool CommonPreMergeRebase (GitUpdateOptions options, ProgressMonitor monitor, out int stashIndex)
{
stashIndex = -1;
monitor.Step (1);
@@ -683,7 +699,7 @@ namespace MonoDevelop.VersionControl.Git
GettextCatalog.GetString ("You have uncommitted changes"),
GettextCatalog.GetString ("What do you want to do?"),
AlertButton.Cancel,
- new AlertButton ("Stash")) == AlertButton.Cancel)
+ new AlertButton (GettextCatalog.GetString ("Stash"))) == AlertButton.Cancel)
return false;
options |= GitUpdateOptions.SaveLocalChanges;
@@ -702,7 +718,7 @@ namespace MonoDevelop.VersionControl.Git
return true;
}
- bool ConflictResolver(IProgressMonitor monitor, Commit resetToIfFail, string message)
+ bool ConflictResolver(ProgressMonitor monitor, Commit resetToIfFail, string message)
{
foreach (var conflictFile in RootRepository.Index.Conflicts) {
ConflictResult res = ResolveConflict (RootRepository.FromGitPath (conflictFile.Ancestor.Path));
@@ -714,6 +730,9 @@ namespace MonoDevelop.VersionControl.Git
Revert (RootRepository.FromGitPath (conflictFile.Ancestor.Path), false, monitor);
break;
}
+ if (res == Git.ConflictResult.Continue) {
+ Add (RootRepository.FromGitPath (conflictFile.Ancestor.Path), false, monitor);
+ }
}
if (!string.IsNullOrEmpty (message)) {
var sig = GetSignature ();
@@ -722,7 +741,7 @@ namespace MonoDevelop.VersionControl.Git
return true;
}
- void CommonPostMergeRebase(int stashIndex, GitUpdateOptions options, IProgressMonitor monitor, Commit oldHead)
+ void CommonPostMergeRebase(int stashIndex, GitUpdateOptions options, ProgressMonitor monitor, Commit oldHead)
{
if ((options & GitUpdateOptions.SaveLocalChanges) == GitUpdateOptions.SaveLocalChanges) {
monitor.Step (1);
@@ -743,7 +762,7 @@ namespace MonoDevelop.VersionControl.Git
monitor.EndTask ();
}
- public void Rebase (string branch, GitUpdateOptions options, IProgressMonitor monitor)
+ public void Rebase (string branch, GitUpdateOptions options, ProgressMonitor monitor)
{
int stashIndex = -1;
var oldHead = RootRepository.Head.Tip;
@@ -766,7 +785,7 @@ namespace MonoDevelop.VersionControl.Git
int count = toApply.Length;
int i = 1;
foreach (var com in toApply) {
- monitor.Log.WriteLine ("Cherry-picking {0} - {1}/{2}", com.Id, i, count);
+ monitor.Log.WriteLine (GettextCatalog.GetString ("Cherry-picking {0} - {1}/{2}", com.Id, i, count));
CherryPickResult cherryRes = RootRepository.CherryPick (com, com.Author, new CherryPickOptions {
CheckoutNotifyFlags = refreshFlags,
OnCheckoutNotify = RefreshFile,
@@ -780,7 +799,7 @@ namespace MonoDevelop.VersionControl.Git
}
}
- public void Merge (string branch, GitUpdateOptions options, IProgressMonitor monitor)
+ public void Merge (string branch, GitUpdateOptions options, ProgressMonitor monitor, FastForwardStrategy strategy = FastForwardStrategy.Default)
{
int stashIndex = -1;
var oldHead = RootRepository.Head.Tip;
@@ -809,7 +828,7 @@ namespace MonoDevelop.VersionControl.Git
static ConflictResult ResolveConflict (string file)
{
ConflictResult res = ConflictResult.Abort;
- DispatchService.GuiSyncDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
var dlg = new ConflictResolutionDialog ();
try {
dlg.Load (file);
@@ -831,11 +850,11 @@ namespace MonoDevelop.VersionControl.Git
dlg.Destroy ();
dlg.Dispose ();
}
- });
+ }).Wait ();
return res;
}
- protected override void OnCommit (ChangeSet changeSet, IProgressMonitor monitor)
+ protected override void OnCommit (ChangeSet changeSet, ProgressMonitor monitor)
{
string message = changeSet.GlobalComment;
if (string.IsNullOrEmpty (message))
@@ -878,7 +897,7 @@ namespace MonoDevelop.VersionControl.Git
} catch {
string dlgName = null, dlgEmail = null;
- DispatchService.GuiSyncDispatch (() => {
+ Runtime.RunInMainThread (() => {
var dlg = new UserGitConfigDialog ();
try {
if ((Gtk.ResponseType)MessageService.RunCustomDialog (dlg) == Gtk.ResponseType.Ok) {
@@ -890,7 +909,7 @@ namespace MonoDevelop.VersionControl.Git
dlg.Destroy ();
dlg.Dispose ();
}
- });
+ }).Wait ();
name = dlgName;
email = dlgEmail;
@@ -903,7 +922,7 @@ namespace MonoDevelop.VersionControl.Git
RootRepository.Config.Set ("user.email", email);
}
- protected override void OnCheckout (FilePath targetLocalPath, Revision rev, bool recurse, IProgressMonitor monitor)
+ protected override void OnCheckout (FilePath targetLocalPath, Revision rev, bool recurse, ProgressMonitor monitor)
{
int transferProgress = 0;
int checkoutProgress = 0;
@@ -917,14 +936,14 @@ namespace MonoDevelop.VersionControl.Git
});
});
- if (monitor.IsCancelRequested || RootPath.IsNull)
+ if (monitor.CancellationToken.IsCancellationRequested || RootPath.IsNull)
return;
RootPath = RootPath.ParentDirectory;
RootRepository = new LibGit2Sharp.Repository (RootPath);
}
- protected override void OnRevert (FilePath[] localPaths, bool recurse, IProgressMonitor monitor)
+ protected override void OnRevert (FilePath[] localPaths, bool recurse, ProgressMonitor monitor)
{
foreach (var group in GroupByRepository (localPaths)) {
var repository = group.Key;
@@ -980,17 +999,17 @@ namespace MonoDevelop.VersionControl.Git
}
}
- protected override void OnRevertRevision (FilePath localPath, Revision revision, IProgressMonitor monitor)
+ protected override void OnRevertRevision (FilePath localPath, Revision revision, ProgressMonitor monitor)
{
throw new NotSupportedException ();
}
- protected override void OnRevertToRevision (FilePath localPath, Revision revision, IProgressMonitor monitor)
+ protected override void OnRevertToRevision (FilePath localPath, Revision revision, ProgressMonitor monitor)
{
throw new NotSupportedException ();
}
- protected override void OnAdd (FilePath[] localPaths, bool recurse, IProgressMonitor monitor)
+ protected override void OnAdd (FilePath[] localPaths, bool recurse, ProgressMonitor monitor)
{
foreach (var group in GroupByRepository (localPaths)) {
var repository = group.Key;
@@ -1000,7 +1019,7 @@ namespace MonoDevelop.VersionControl.Git
}
}
- protected override void OnDeleteFiles (FilePath[] localPaths, bool force, IProgressMonitor monitor, bool keepLocal)
+ protected override void OnDeleteFiles (FilePath[] localPaths, bool force, ProgressMonitor monitor, bool keepLocal)
{
DeleteCore (localPaths, keepLocal);
@@ -1020,7 +1039,7 @@ namespace MonoDevelop.VersionControl.Git
}
}
- protected override void OnDeleteDirectories (FilePath[] localPaths, bool force, IProgressMonitor monitor, bool keepLocal)
+ protected override void OnDeleteDirectories (FilePath[] localPaths, bool force, ProgressMonitor monitor, bool keepLocal)
{
DeleteCore (localPaths, keepLocal);
@@ -1116,7 +1135,7 @@ namespace MonoDevelop.VersionControl.Git
return remotes.Contains ("origin") ? "origin" : remotes [0];
}
- public void Push (IProgressMonitor monitor, string remote, string remoteBranch)
+ public void Push (ProgressMonitor monitor, string remote, string remoteBranch)
{
bool success = true;
@@ -1264,13 +1283,13 @@ namespace MonoDevelop.VersionControl.Git
return RootRepository.Head.FriendlyName;
}
- public void SwitchToBranch (IProgressMonitor monitor, string branch)
+ public bool SwitchToBranch (ProgressMonitor monitor, string branch)
{
Signature sig = GetSignature ();
Stash stash;
int stashIndex = -1;
if (sig == null)
- return;
+ return false;
monitor.BeginTask (GettextCatalog.GetString ("Switching to branch {0}", branch), GitService.StashUnstashWhenSwitchingBranches ? 4 : 2);
@@ -1285,7 +1304,7 @@ namespace MonoDevelop.VersionControl.Git
RootRepository.Stashes.Remove (stashIndex);
if (!TryCreateStash (monitor, GetStashName (currentBranch), out stash))
- return;
+ return false;
monitor.Step (1);
}
@@ -1309,13 +1328,13 @@ namespace MonoDevelop.VersionControl.Git
// Notify file changes
NotifyFileChanges (monitor, statusList);
- if (BranchSelectionChanged != null)
- BranchSelectionChanged (this, EventArgs.Empty);
+ BranchSelectionChanged?.Invoke (this, EventArgs.Empty);
monitor.EndTask ();
+ return true;
}
- void NotifyFileChanges (IProgressMonitor monitor, TreeChanges statusList)
+ void NotifyFileChanges (ProgressMonitor monitor, TreeChanges statusList)
{
// Files added to source branch not present to target branch.
var removed = statusList.Where (c => c.Status == ChangeKind.Added).Select (c => GetRepository (c.Path).FromGitPath (c.Path)).ToList ();
@@ -1401,12 +1420,15 @@ namespace MonoDevelop.VersionControl.Git
path = change.Path;
break;
}
- diffs.Add (new DiffInfo (RootPath, RootRepository.FromGitPath (path), patch[path].Patch));
+
+ // Trim the header by taking out the first 2 lines.
+ int diffStart = patch[path].Patch.IndexOf ('\n', patch [path].Patch.IndexOf ('\n') + 1);
+ diffs.Add (new DiffInfo (RootPath, RootRepository.FromGitPath (path), patch[path].Patch.Substring (diffStart + 1)));
}
return diffs.ToArray ();
}
- protected override void OnMoveFile (FilePath localSrcPath, FilePath localDestPath, bool force, IProgressMonitor monitor)
+ protected override void OnMoveFile (FilePath localSrcPath, FilePath localDestPath, bool force, ProgressMonitor monitor)
{
var srcRepo = GetRepository (localSrcPath);
var dstRepo = GetRepository (localDestPath);
@@ -1431,11 +1453,11 @@ namespace MonoDevelop.VersionControl.Git
}
}
- protected override void OnMoveDirectory (FilePath localSrcPath, FilePath localDestPath, bool force, IProgressMonitor monitor)
+ protected override void OnMoveDirectory (FilePath localSrcPath, FilePath localDestPath, bool force, ProgressMonitor monitor)
{
VersionInfo[] versionedFiles = GetDirectoryVersionInfo (localSrcPath, false, true);
base.OnMoveDirectory (localSrcPath, localDestPath, force, monitor);
- monitor.BeginTask ("Moving files", versionedFiles.Length);
+ monitor.BeginTask (GettextCatalog.GetString ("Moving files"), versionedFiles.Length);
foreach (VersionInfo vif in versionedFiles) {
if (vif.IsDirectory)
continue;
@@ -1446,28 +1468,41 @@ namespace MonoDevelop.VersionControl.Git
monitor.EndTask ();
}
- public override Annotation[] GetAnnotations (FilePath repositoryPath)
+ public override Annotation [] GetAnnotations (FilePath repositoryPath, Revision since)
{
var repository = GetRepository (repositoryPath);
Commit hc = GetHeadCommit (repository);
+ Commit sinceCommit = since != null ? ((GitRevision)since).Commit : null;
if (hc == null)
return new Annotation [0];
- int lines = File.ReadAllLines (repositoryPath).Length;
- var list = new List<Annotation> (lines);
- var working = new Annotation (GettextCatalog.GetString ("working copy"), "<uncommitted>", DateTime.Now);
- for (int i = 0; i < lines; ++i)
- list.Add (working);
+ var list = new List<Annotation> ();
+
+ var baseDocument = Mono.TextEditor.TextDocument.CreateImmutableDocument (GetBaseText (repositoryPath));
+ var workingDocument = Mono.TextEditor.TextDocument.CreateImmutableDocument (File.ReadAllText (repositoryPath));
repositoryPath = repository.ToGitPath (repositoryPath);
var status = repository.RetrieveStatus (repositoryPath);
if (status != FileStatus.NewInIndex && status != FileStatus.NewInWorkdir) {
- foreach (var hunk in repository.Blame (repositoryPath, new BlameOptions { FindExactRenames = true, })) {
+ foreach (var hunk in repository.Blame (repositoryPath, new BlameOptions { FindExactRenames = true, StartingAt = sinceCommit })) {
var commit = hunk.FinalCommit;
var author = hunk.FinalSignature;
- working = new Annotation (commit.Sha, author.Name, author.When.LocalDateTime, String.Format ("<{0}>", author.Email));
+ var working = new Annotation (new GitRevision (this, repository, commit), author.Name, author.When.LocalDateTime, String.Format ("<{0}>", author.Email));
for (int i = 0; i < hunk.LineCount; ++i)
- list [hunk.FinalStartLineNumber + i] = working;
+ list.Add (working);
+ }
+ }
+
+ if (sinceCommit == null) {
+ Annotation nextRev = new Annotation (null, GettextCatalog.GetString ("<uncommitted>"), DateTime.MinValue, null, GettextCatalog.GetString ("working copy"));
+ foreach (var hunk in baseDocument.Diff (workingDocument, includeEol: false)) {
+ list.RemoveRange (hunk.RemoveStart - 1, hunk.Removed);
+ for (int i = 0; i < hunk.Inserted; ++i) {
+ if (hunk.InsertStart + i >= list.Count)
+ list.Add (nextRev);
+ else
+ list.Insert (hunk.InsertStart - 1, nextRev);
+ }
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitSelectRevisionDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitSelectRevisionDialog.cs
index 977e69704c..3947f48909 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitSelectRevisionDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitSelectRevisionDialog.cs
@@ -26,7 +26,9 @@
using System;
using MonoDevelop.Core;
using System.Text;
-using LibGit2Sharp;
+using LibGit2Sharp;
+using System.Threading;
+using System.Threading.Tasks;
namespace MonoDevelop.VersionControl.Git
{
@@ -48,6 +50,7 @@ namespace MonoDevelop.VersionControl.Git
readonly Xwt.ListViewColumn shaColumn;
readonly Xwt.DataField<Revision> revisionField;
readonly Xwt.DialogButton buttonOk;
+ CancellationTokenSource cts = new CancellationTokenSource ();
public GitSelectRevisionDialog (GitRepository repo)
{
@@ -102,19 +105,30 @@ namespace MonoDevelop.VersionControl.Git
};
revisionList.Columns.Add (shaColumn);
- var history = repo.GetHistory (repo.RootPath, null);
- var min = Math.Min (history.Length, 150);
- for (int i = 0; i < min; ++i) {
- var rev = history [i];
-
- // Convert to foreach and use i = AddRow ();
- revisionStore.AddRow ();
- revisionStore.SetValue (i, messageField, rev.ShortMessage);
- revisionStore.SetValue (i, dateField, ParseDate (rev.Time));
- revisionStore.SetValue (i, authorField, rev.Author);
- revisionStore.SetValue (i, shaField, ((GitRevision)rev).ShortName);
- revisionStore.SetValue (i, revisionField, rev);
- }
+ Task.Factory.StartNew (async () => {
+ const int sliceSize = 150;
+
+ var history = repo.GetHistory (repo.RootPath, null);
+
+ int slices = history.Length / sliceSize;
+ for (int i = 0; i < slices; ++i) {
+ await Runtime.RunInMainThread (() => {
+ for (int n = 0; n < sliceSize; ++n) {
+ if (cts.IsCancellationRequested)
+ return;
+
+ int row = revisionStore.AddRow ();
+ var rev = history [row];
+
+ revisionStore.SetValue (row, messageField, rev.ShortMessage);
+ revisionStore.SetValue (row, dateField, ParseDate (rev.Time));
+ revisionStore.SetValue (row, authorField, rev.Author);
+ revisionStore.SetValue (row, shaField, ((GitRevision)rev).ShortName);
+ revisionStore.SetValue (row, revisionField, rev);
+ }
+ });
+ }
+ }, cts.Token);
revisionList.SelectionChanged += delegate {
CheckSensitive ();
@@ -131,6 +145,16 @@ namespace MonoDevelop.VersionControl.Git
Buttons.Add (new Xwt.DialogButton (Xwt.Command.Cancel));
}
+ protected override void Dispose (bool disposing)
+ {
+ if (cts != null) {
+ cts.Cancel ();
+ cts.Dispose ();
+ cts = null;
+ }
+ base.Dispose (disposing);
+ }
+
void CheckSensitive ()
{
if (!String.IsNullOrWhiteSpace (tagNameEntry.Text) && Reference.IsValidName ("refs/tags/" + tagNameEntry.Text) &&
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitService.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitService.cs
index 786d2acdf5..b36b67eb2a 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitService.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitService.cs
@@ -29,29 +29,16 @@ using MonoDevelop.Core;
using MonoDevelop.Ide;
using MonoDevelop.Ide.ProgressMonitoring;
using System.Threading;
+using System.Threading.Tasks;
using LibGit2Sharp;
namespace MonoDevelop.VersionControl.Git
{
public static class GitService
{
- public static bool UseRebaseOptionWhenPulling
- {
- get { return PropertyService.Get ("MonoDevelop.VersionControl.Git.UseRebaseOptionWhenPulling", true); }
- set { PropertyService.Set ("MonoDevelop.VersionControl.Git.UseRebaseOptionWhenPulling", value); }
- }
-
- public static bool StashUnstashWhenUpdating
- {
- get { return PropertyService.Get ("MonoDevelop.VersionControl.Git.StashUnstashWhenUpdating", true); }
- set { PropertyService.Set ("MonoDevelop.VersionControl.Git.StashUnstashWhenUpdating", value); }
- }
-
- public static bool StashUnstashWhenSwitchingBranches
- {
- get { return PropertyService.Get ("MonoDevelop.VersionControl.Git.StashUnstashWhenSwitchingBranches", true); }
- set { PropertyService.Set ("MonoDevelop.VersionControl.Git.StashUnstashWhenSwitchingBranches", value); }
- }
+ public static ConfigurationProperty<bool> UseRebaseOptionWhenPulling = ConfigurationProperty.Create ("MonoDevelop.VersionControl.Git.UseRebaseOptionWhenPulling", true);
+ public static ConfigurationProperty<bool> StashUnstashWhenUpdating = ConfigurationProperty.Create ("MonoDevelop.VersionControl.Git.StashUnstashWhenUpdating", true);
+ public static ConfigurationProperty<bool> StashUnstashWhenSwitchingBranches = ConfigurationProperty.Create ("MonoDevelop.VersionControl.Git.StashUnstashWhenSwitchingBranches", true);
public static void Push (GitRepository repo)
{
@@ -63,7 +50,7 @@ namespace MonoDevelop.VersionControl.Git
string remote = dlg.SelectedRemote;
string branch = dlg.SelectedRemoteBranch ?? repo.GetCurrentBranch ();
- IProgressMonitor monitor = VersionControlService.GetProgressMonitor (GettextCatalog.GetString ("Pushing changes..."), VersionControlOperationType.Push);
+ ProgressMonitor monitor = VersionControlService.GetProgressMonitor (GettextCatalog.GetString ("Pushing changes..."), VersionControlOperationType.Push);
ThreadPool.QueueUserWorkItem (delegate {
try {
repo.Push (monitor, remote, branch);
@@ -92,16 +79,16 @@ namespace MonoDevelop.VersionControl.Git
if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) {
dlg.Hide ();
if (rebasing) {
- using (IProgressMonitor monitor = VersionControlService.GetProgressMonitor (GettextCatalog.GetString ("Rebasing branch '{0}'...", dlg.SelectedBranch))) {
+ using (ProgressMonitor monitor = VersionControlService.GetProgressMonitor (GettextCatalog.GetString ("Rebasing branch '{0}'...", dlg.SelectedBranch))) {
if (dlg.IsRemote)
repo.Fetch (monitor, dlg.RemoteName);
repo.Rebase (dlg.SelectedBranch, dlg.StageChanges ? GitUpdateOptions.SaveLocalChanges : GitUpdateOptions.None, monitor);
}
} else {
- using (IProgressMonitor monitor = VersionControlService.GetProgressMonitor (GettextCatalog.GetString ("Merging branch '{0}'...", dlg.SelectedBranch))) {
+ using (ProgressMonitor monitor = VersionControlService.GetProgressMonitor (GettextCatalog.GetString ("Merging branch '{0}'...", dlg.SelectedBranch))) {
if (dlg.IsRemote)
repo.Fetch (monitor, dlg.RemoteName);
- repo.Merge (dlg.SelectedBranch, dlg.StageChanges ? GitUpdateOptions.SaveLocalChanges : GitUpdateOptions.None, monitor);
+ repo.Merge (dlg.SelectedBranch, dlg.StageChanges ? GitUpdateOptions.SaveLocalChanges : GitUpdateOptions.None, monitor, FastForwardStrategy.NoFastForward);
}
}
}
@@ -117,58 +104,62 @@ namespace MonoDevelop.VersionControl.Git
MessageService.ShowCustomDialog (dlg);
}
- public static void SwitchToBranch (GitRepository repo, string branch)
+ public async static Task<bool> SwitchToBranch (GitRepository repo, string branch)
{
var monitor = new MessageDialogProgressMonitor (true, false, false, true);
try {
IdeApp.Workbench.AutoReloadDocuments = true;
IdeApp.Workbench.LockGui ();
- ThreadPool.QueueUserWorkItem (delegate {
+ var t = await Task.Run (delegate {
try {
- repo.SwitchToBranch (monitor, branch);
+ return repo.SwitchToBranch (monitor, branch);
} catch (Exception ex) {
- monitor.ReportError ("Branch switch failed", ex);
+ monitor.ReportError (GettextCatalog.GetString ("Branch switch failed"), ex);
+ return false;
} finally {
monitor.Dispose ();
}
});
- monitor.AsyncOperation.WaitForCompleted ();
+ return t;
} finally {
IdeApp.Workbench.AutoReloadDocuments = false;
IdeApp.Workbench.UnlockGui ();
}
}
- public static IAsyncOperation ApplyStash (GitRepository repo, int s)
+ public static Task<bool> ApplyStash (GitRepository repo, int s)
{
var monitor = new MessageDialogProgressMonitor (true, false, false, true);
var statusTracker = IdeApp.Workspace.GetFileStatusTracker ();
- ThreadPool.QueueUserWorkItem (delegate {
+ var t = Task.Run (delegate {
try {
- ReportStashResult (repo.ApplyStash (monitor, s));
+ var res = repo.ApplyStash (monitor, s);
+ ReportStashResult (res);
+ return true;
} catch (Exception ex) {
string msg = GettextCatalog.GetString ("Stash operation failed.");
monitor.ReportError (msg, ex);
+ return false;
}
finally {
monitor.Dispose ();
statusTracker.Dispose ();
}
});
- return monitor.AsyncOperation;
+ return t;
}
public static void ReportStashResult (StashApplyStatus status)
{
if (status == StashApplyStatus.Conflicts) {
string msg = GettextCatalog.GetString ("Stash applied with conflicts");
- DispatchService.GuiDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
IdeApp.Workbench.StatusBar.ShowWarning (msg);
});
}
else {
string msg = GettextCatalog.GetString ("Stash successfully applied");
- DispatchService.GuiDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
IdeApp.Workbench.StatusBar.ShowMessage (msg);
});
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitUtil.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitUtil.cs
index 44776dafe0..443eb6b62c 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitUtil.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitUtil.cs
@@ -27,6 +27,7 @@ using System.IO;
using System.Collections.Generic;
using MonoDevelop.Core;
using System;
+using ProgressMonitor = MonoDevelop.Core.ProgressMonitor;
using LibGit2Sharp;
namespace MonoDevelop.VersionControl.Git
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitVersionControl.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitVersionControl.cs
index 96bc74e8fc..d8ab20a384 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitVersionControl.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitVersionControl.cs
@@ -1,32 +1,33 @@
-//
-// GitVersionControl.cs
-//
-// Author:
-// Dale Ragan <dale.ragan@sinesignal.com>
-//
-// Copyright (c) 2010 SineSignal, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
+//
+// GitVersionControl.cs
+//
+// Author:
+// Dale Ragan <dale.ragan@sinesignal.com>
+//
+// Copyright (c) 2010 SineSignal, LLC
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
using MonoDevelop.Core;
using System.Collections.Generic;
-
+using System.IO;
+
namespace MonoDevelop.VersionControl.Git
{
abstract class GitVersionControl : VersionControlSystem
@@ -46,8 +47,10 @@ namespace MonoDevelop.VersionControl.Git
public override Repository GetRepositoryReference (FilePath path, string id)
{
GitRepository repo;
- if (!repositories.TryGetValue (path.CanonicalPath, out repo))
- repositories [path.CanonicalPath] = repo = new GitRepository (this, path, null);
+ if (!repositories.TryGetValue (path.CanonicalPath, out repo) || repo.Disposed) {
+ repo = new GitRepository (this, path, null);
+ repositories [repo.RootPath.CanonicalPath] = repo;
+ }
return repo;
}
@@ -63,7 +66,13 @@ namespace MonoDevelop.VersionControl.Git
protected override FilePath OnGetRepositoryPath (FilePath path, string id)
{
- return LibGit2Sharp.Repository.Discover (path.ResolveLinks ());
+ string repo = LibGit2Sharp.Repository.Discover (path.ResolveLinks ());
+ if (!string.IsNullOrEmpty (repo)) {
+ repo = repo.TrimEnd ('\\', '/');
+ if (repo.EndsWith (".git", System.StringComparison.OrdinalIgnoreCase))
+ repo = Path.GetDirectoryName (repo);
+ }
+ return repo;
}
internal void UnregisterRepo (GitRepository repo)
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/MergeDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/MergeDialog.cs
index 98c2115e7a..57d82ff2d6 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/MergeDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/MergeDialog.cs
@@ -33,7 +33,7 @@ using LibGit2Sharp;
namespace MonoDevelop.VersionControl.Git
{
- partial class MergeDialog : Dialog
+ partial class MergeDialog : Gtk.Dialog
{
readonly TreeStore store;
readonly GitRepository repo;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/ProjectTemplateHandler.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/ProjectTemplateHandler.cs
index 7ae80056c7..f180732d1f 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/ProjectTemplateHandler.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/ProjectTemplateHandler.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System.IO;
+using LibGit2Sharp;
using MonoDevelop.Ide.Projects;
using MonoDevelop.Ide.Templates;
using MonoDevelop.Core;
@@ -56,13 +57,13 @@ namespace MonoDevelop.VersionControl.Git
FilePath GetSourceGitIgnoreFilePath ()
{
string directory = Path.GetDirectoryName (typeof(ProjectTemplateHandler).Assembly.Location);
- return new FilePath (directory).Combine ("GitIgnore.txt");
+ return FilePath.Build (directory, "GitIgnore.txt");
}
void CreateGitRepository (FilePath solutionPath)
{
using (var repo = GitUtil.Init (solutionPath, null))
- repo.Stage ("*", new LibGit2Sharp.StageOptions ());
+ repo.Stage ("*");
}
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/StashManagerDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/StashManagerDialog.cs
index 510a6ecbff..40830f57e2 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/StashManagerDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/StashManagerDialog.cs
@@ -28,10 +28,11 @@ using MonoDevelop.Core;
using MonoDevelop.Components;
using MonoDevelop.Ide;
using LibGit2Sharp;
+using System.Threading.Tasks;
namespace MonoDevelop.VersionControl.Git
{
- partial class StashManagerDialog : Dialog
+ partial class StashManagerDialog : Gtk.Dialog
{
readonly GitRepository repository;
readonly ListStore store;
@@ -103,26 +104,24 @@ namespace MonoDevelop.VersionControl.Git
return (Stash) store.GetValue (it, 0);
}
- void ApplyStashAndRemove(int s)
+ async Task ApplyStashAndRemove(int s)
{
using (IdeApp.Workspace.GetFileStatusTracker ()) {
- GitService.ApplyStash (repository, s).Completed += delegate(IAsyncOperation op) {
- if (op.Success)
- stashes.Remove (s);
- };
+ if (await GitService.ApplyStash (repository, s))
+ stashes.Remove (s);
}
}
- protected void OnButtonApplyClicked (object sender, System.EventArgs e)
+ protected async void OnButtonApplyClicked (object sender, System.EventArgs e)
{
int s = GetSelectedIndex ();
if (s != -1) {
- GitService.ApplyStash (repository, s);
+ await GitService.ApplyStash (repository, s);
Respond (ResponseType.Ok);
}
}
- protected void OnButtonBranchClicked (object sender, System.EventArgs e)
+ protected async void OnButtonBranchClicked (object sender, System.EventArgs e)
{
Stash s = GetSelected ();
int stashIndex = GetSelectedIndex ();
@@ -131,8 +130,8 @@ namespace MonoDevelop.VersionControl.Git
try {
if (MessageService.RunCustomDialog (dlg) == (int) ResponseType.Ok) {
repository.CreateBranchFromCommit (dlg.BranchName, s.Base);
- GitService.SwitchToBranch (repository, dlg.BranchName);
- ApplyStashAndRemove (stashIndex);
+ if (await GitService.SwitchToBranch (repository, dlg.BranchName))
+ await ApplyStashAndRemove (stashIndex);
}
} finally {
dlg.Destroy ();
@@ -152,11 +151,11 @@ namespace MonoDevelop.VersionControl.Git
}
}
- protected void OnButtonApplyRemoveClicked (object sender, System.EventArgs e)
+ protected async void OnButtonApplyRemoveClicked (object sender, System.EventArgs e)
{
int s = GetSelectedIndex ();
if (s != -1) {
- ApplyStashAndRemove (s);
+ await ApplyStashAndRemove (s);
Respond (ResponseType.Ok);
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/TfsSmartSubtransport.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/TfsSmartSubtransport.cs
index a9b1485780..d95cae284f 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/TfsSmartSubtransport.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/TfsSmartSubtransport.cs
@@ -90,6 +90,10 @@ namespace MonoDevelop.VersionControl.Git
httpClient = new HttpClient (new HttpClientHandler { Credentials = new System.Net.NetworkCredential (cred.Username, cred.Password) }) {
Timeout = TimeSpan.FromMinutes (1.0),
};
+ res = httpClient.GetAsync (serviceUri).Result;
+ if (res.StatusCode == System.Net.HttpStatusCode.OK) {
+ GitCredentials.StoreCredentials (GitCredentialsType.Tfs);
+ }
}
return new TfsSmartSubtransportStream(this) {
@@ -134,12 +138,18 @@ namespace MonoDevelop.VersionControl.Git
return result.EnsureSuccessStatusCode().Content.ReadAsStreamAsync().Result;
}
+ bool stuck;
public override int Read(Stream dataStream, long length, out long bytesRead)
{
bytesRead = 0L;
var buffer = new byte[64 * 1024];
int count;
+ if (responseStream.Value.Length <= 0) {
+ if (stuck)
+ throw new Exception ("Stuck while trying to read TFS response");
+ stuck = true;
+ }
while (length > 0 && (count = responseStream.Value.Read(buffer, 0, (int)Math.Min(buffer.Length, length))) > 0) {
dataStream.Write(buffer, 0, count);
bytesRead += (long)count;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.CredentialsDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.CredentialsDialog.cs
index b250286a69..eb1cad0268 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.CredentialsDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.CredentialsDialog.cs
@@ -8,6 +8,8 @@ namespace MonoDevelop.VersionControl.Git
private global::Gtk.Label labelTop;
+ private global::Gtk.Label labelTop1;
+
private global::Gtk.Button buttonCancel;
private global::Gtk.Button buttonOk;
@@ -38,15 +40,28 @@ namespace MonoDevelop.VersionControl.Git
w2.Position = 0;
w2.Expand = false;
w2.Fill = false;
- w1.Add (this.vbox);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox]));
- w3.Position = 0;
+ // Container child vbox.Gtk.Box+BoxChild
+ this.labelTop1 = new global::Gtk.Label();
+ this.labelTop1.Name = "labelTop1";
+ this.labelTop1.Xalign = 0F;
+ this.labelTop1.LabelProp = global::Mono.Unix.Catalog.GetString("<b>{0}</b>");
+ this.labelTop1.UseMarkup = true;
+ this.vbox.Add(this.labelTop1);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox[this.labelTop1]));
+ w3.Position = 1;
+ w3.Expand = false;
+ w3.Fill = false;
+ w1.Add(this.vbox);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1[this.vbox]));
+ w4.Position = 0;
+ w4.Expand = false;
+ w4.Fill = false;
// Internal child MonoDevelop.VersionControl.Git.CredentialsDialog.ActionArea
- global::Gtk.HButtonBox w4 = this.ActionArea;
- w4.Name = "dialog1_ActionArea";
- w4.Spacing = 10;
- w4.BorderWidth = ((uint)(5));
- w4.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
+ global::Gtk.HButtonBox w5 = this.ActionArea;
+ w5.Name = "dialog1_ActionArea";
+ w5.Spacing = 10;
+ w5.BorderWidth = ((uint)(5));
+ w5.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.buttonCancel = new global::Gtk.Button ();
this.buttonCancel.CanDefault = true;
@@ -55,10 +70,10 @@ namespace MonoDevelop.VersionControl.Git
this.buttonCancel.UseStock = true;
this.buttonCancel.UseUnderline = true;
this.buttonCancel.Label = "gtk-cancel";
- this.AddActionWidget (this.buttonCancel, -6);
- global::Gtk.ButtonBox.ButtonBoxChild w5 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w4 [this.buttonCancel]));
- w5.Expand = false;
- w5.Fill = false;
+ this.AddActionWidget(this.buttonCancel, -6);
+ global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5[this.buttonCancel]));
+ w6.Expand = false;
+ w6.Fill = false;
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.buttonOk = new global::Gtk.Button ();
this.buttonOk.CanDefault = true;
@@ -67,13 +82,14 @@ namespace MonoDevelop.VersionControl.Git
this.buttonOk.UseStock = true;
this.buttonOk.UseUnderline = true;
this.buttonOk.Label = "gtk-ok";
- this.AddActionWidget (this.buttonOk, -5);
- global::Gtk.ButtonBox.ButtonBoxChild w6 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w4 [this.buttonOk]));
- w6.Position = 1;
- w6.Expand = false;
- w6.Fill = false;
- if ((this.Child != null)) {
- this.Child.ShowAll ();
+ this.AddActionWidget(this.buttonOk, -5);
+ global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w5[this.buttonOk]));
+ w7.Position = 1;
+ w7.Expand = false;
+ w7.Fill = false;
+ if ((this.Child != null))
+ {
+ this.Child.ShowAll();
}
this.DefaultWidth = 500;
this.DefaultHeight = 132;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/generated.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/generated.cs
index 3285e87c05..453751b36a 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/generated.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/generated.cs
@@ -6,9 +6,10 @@ namespace Stetic
{
private static bool initialized;
- internal static void Initialize (Gtk.Widget iconRenderer)
+ internal static void Initialize(Gtk.Widget iconRenderer)
{
- if ((Stetic.Gui.initialized == false)) {
+ if ((Stetic.Gui.initialized == false))
+ {
Stetic.Gui.initialized = true;
}
}
@@ -17,50 +18,55 @@ namespace Stetic
internal class BinContainer
{
private Gtk.Widget child;
-
+
private Gtk.UIManager uimanager;
- public static BinContainer Attach (Gtk.Bin bin)
+ public static BinContainer Attach(Gtk.Bin bin)
{
- BinContainer bc = new BinContainer ();
- bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested);
- bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated);
- bin.Added += new Gtk.AddedHandler (bc.OnAdded);
+ BinContainer bc = new BinContainer();
+ bin.SizeRequested += new Gtk.SizeRequestedHandler(bc.OnSizeRequested);
+ bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated);
+ bin.Added += new Gtk.AddedHandler(bc.OnAdded);
return bc;
}
- private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args)
+ private void OnSizeRequested(object sender, Gtk.SizeRequestedArgs args)
{
- if ((this.child != null)) {
- args.Requisition = this.child.SizeRequest ();
+ if ((this.child != null))
+ {
+ args.Requisition = this.child.SizeRequest();
}
}
- private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args)
+ private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args)
{
- if ((this.child != null)) {
+ if ((this.child != null))
+ {
this.child.Allocation = args.Allocation;
}
}
- private void OnAdded (object sender, Gtk.AddedArgs args)
+ private void OnAdded(object sender, Gtk.AddedArgs args)
{
this.child = args.Widget;
}
- public void SetUiManager (Gtk.UIManager uim)
+ public void SetUiManager(Gtk.UIManager uim)
{
this.uimanager = uim;
- this.child.Realized += new System.EventHandler (this.OnRealized);
+ this.child.Realized += new System.EventHandler(this.OnRealized);
}
- private void OnRealized (object sender, System.EventArgs args)
+ private void OnRealized(object sender, System.EventArgs args)
{
- if ((this.uimanager != null)) {
+ if ((this.uimanager != null))
+ {
Gtk.Widget w;
w = this.child.Toplevel;
- if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) {
- ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup);
+ if (((w != null)
+ && typeof(Gtk.Window).IsInstanceOfType(w)))
+ {
+ ((Gtk.Window)(w)).AddAccelGroup(this.uimanager.AccelGroup);
this.uimanager = null;
}
}
@@ -69,12 +75,12 @@ namespace Stetic
internal class ActionGroups
{
- public static Gtk.ActionGroup GetActionGroup (System.Type type)
+ public static Gtk.ActionGroup GetActionGroup(System.Type type)
{
- return Stetic.ActionGroups.GetActionGroup (type.FullName);
+ return Stetic.ActionGroups.GetActionGroup(type.FullName);
}
- public static Gtk.ActionGroup GetActionGroup (string name)
+ public static Gtk.ActionGroup GetActionGroup(string name)
{
return null;
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/gui.stetic b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/gui.stetic
index 7822214958..68cebdc794 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/gui.stetic
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/gui.stetic
@@ -1425,7 +1425,7 @@
<widget class="Gtk.Label" id="labelTop">
<property name="MemberName" />
<property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">Credentials required for the repository: {0}</property>
+ <property name="LabelProp" translatable="yes">Credentials required for the repository:</property>
</widget>
<packing>
<property name="Position">0</property>
@@ -1435,12 +1435,25 @@
</packing>
</child>
<child>
- <placeholder />
+ <widget class="Gtk.Label" id="labelTop1">
+ <property name="MemberName" />
+ <property name="Xalign">0</property>
+ <property name="LabelProp" translatable="yes">&lt;b&gt;{0}&lt;/b&gt;</property>
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
</child>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
</packing>
</child>
</widget>
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix/SvnClient.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix/SvnClient.cs
index 5cb10c30d1..45e98677d8 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix/SvnClient.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix/SvnClient.cs
@@ -136,7 +136,12 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
public override string Version {
get {
- return GetVersion ();
+ try {
+ return GetVersion ();
+ } catch (Exception e) {
+ LoggingService.LogError ("Failed to query Subversion version info", e);
+ return base.Version;
+ }
}
}
@@ -195,6 +200,9 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
public override string GetDirectoryDotSvn (FilePath path)
{
+ if (path.IsNullOrEmpty)
+ return string.Empty;
+
if (Pre_1_7)
return base.GetDirectoryDotSvn (path);
@@ -250,7 +258,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
readonly IntPtr pool;
readonly IntPtr ctx;
- IProgressMonitor updatemonitor;
+ ProgressMonitor updatemonitor;
ArrayList updateFileList;
string commitmessage;
@@ -398,7 +406,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
IntPtr localpool = newpool (IntPtr.Zero);
var error = new LibSvnClient.svn_error_t {
apr_err = LibApr.APR_OS_START_USEERR,
- message = "Operation cancelled.",
+ message = GettextCatalog.GetString ("Operation cancelled."),
pool = localpool,
};
@@ -662,7 +670,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
}
Annotation[] annotations = new Annotation [numAnnotations];
- AnnotationCollector collector = new AnnotationCollector (annotations);
+ AnnotationCollector collector = new AnnotationCollector (annotations, repo);
IntPtr localpool = IntPtr.Zero;
try {
@@ -725,7 +733,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
}
}
- public override void Update (FilePath path, bool recurse, IProgressMonitor monitor)
+ public override void Update (FilePath path, bool recurse, ProgressMonitor monitor)
{
if (path == FilePath.Null || monitor == null)
throw new ArgumentNullException();
@@ -750,7 +758,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
}
}
- public override void Revert (FilePath[] paths, bool recurse, IProgressMonitor monitor)
+ public override void Revert (FilePath[] paths, bool recurse, ProgressMonitor monitor)
{
if (paths == null || monitor == null)
throw new ArgumentNullException();
@@ -765,7 +773,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
}
}
- public override void Add (FilePath path, bool recurse, IProgressMonitor monitor)
+ public override void Add (FilePath path, bool recurse, ProgressMonitor monitor)
{
if (path == FilePath.Null || monitor == null)
throw new ArgumentNullException ();
@@ -781,7 +789,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
}
}
- public override void Checkout (string url, FilePath path, Revision revision, bool recurse, IProgressMonitor monitor)
+ public override void Checkout (string url, FilePath path, Revision revision, bool recurse, ProgressMonitor monitor)
{
if (url == null || monitor == null)
throw new ArgumentNullException ();
@@ -809,7 +817,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
}
}
- public override void Commit (FilePath[] paths, string message, IProgressMonitor monitor)
+ public override void Commit (FilePath[] paths, string message, ProgressMonitor monitor)
{
if (paths == null || message == null || monitor == null)
throw new ArgumentNullException();
@@ -835,7 +843,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
}
}
- public override void Mkdir (string[] paths, string message, IProgressMonitor monitor)
+ public override void Mkdir (string[] paths, string message, ProgressMonitor monitor)
{
if (paths == null || monitor == null)
throw new ArgumentNullException ();
@@ -856,7 +864,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
}
}
- public override void Delete (FilePath path, bool force, IProgressMonitor monitor)
+ public override void Delete (FilePath path, bool force, ProgressMonitor monitor)
{
if (path == FilePath.Null || monitor == null)
throw new ArgumentNullException ();
@@ -874,7 +882,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
}
}
- public override void Move (FilePath srcPath, FilePath destPath, SvnRevision rev, bool force, IProgressMonitor monitor)
+ public override void Move (FilePath srcPath, FilePath destPath, SvnRevision rev, bool force, ProgressMonitor monitor)
{
if (srcPath == FilePath.Null || destPath == FilePath.Null || monitor == null)
throw new ArgumentNullException ();
@@ -895,7 +903,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
}
}
- public override void Lock (IProgressMonitor monitor, string comment, bool stealLock, params FilePath[] paths)
+ public override void Lock (ProgressMonitor monitor, string comment, bool stealLock, params FilePath[] paths)
{
nb = new notify_baton ();
IntPtr localpool = IntPtr.Zero;
@@ -914,7 +922,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
}
}
- public override void Unlock (IProgressMonitor monitor, bool breakLock, params FilePath[] paths)
+ public override void Unlock (ProgressMonitor monitor, bool breakLock, params FilePath[] paths)
{
nb = new notify_baton ();
IntPtr localpool = IntPtr.Zero;
@@ -926,7 +934,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
CheckError (svn.client_unlock (array, breakLock, ctx, localpool));
if (paths.Length != lockFileList.Count)
- throw new SubversionException ("Lock operation failed.");
+ throw new SubversionException ("Unlock operation failed.");
} finally {
lockFileList = null;
TryEndOperation (localpool);
@@ -986,12 +994,12 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
}
}
- public override void RevertToRevision (FilePath path, Revision revision, IProgressMonitor monitor)
+ public override void RevertToRevision (FilePath path, Revision revision, ProgressMonitor monitor)
{
Merge (path, LibSvnClient.Rev.Head, (LibSvnClient.Rev) revision);
}
- public override void RevertRevision (FilePath path, Revision revision, IProgressMonitor monitor)
+ public override void RevertRevision (FilePath path, Revision revision, ProgressMonitor monitor)
{
SvnRevision srev = (SvnRevision) revision;
Merge (path, (LibSvnClient.Rev) srev, LibSvnClient.Rev.Number (srev.Rev - 1));
@@ -1136,7 +1144,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
return IntPtr.Zero;
}
- IntPtr TryStartOperation (IProgressMonitor monitor)
+ IntPtr TryStartOperation (ProgressMonitor monitor)
{
Monitor.Enter (svn);
updatemonitor = monitor;
@@ -1161,7 +1169,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
if (ent.RemoteTextStatus != LibSvnClient.svn_wc_status_kind.EMPTY) {
rs = ConvertStatus (LibSvnClient.NodeSchedule.Normal, ent.RemoteTextStatus);
rr = new SvnRevision (repo, ent.LastCommitRevision, ent.LastCommitDate,
- ent.LastCommitAuthor, "(unavailable)", null);
+ ent.LastCommitAuthor, GettextCatalog.GetString ("(unavailable)"), null);
}
VersionStatus status = ConvertStatus (ent.Schedule, ent.TextStatus);
@@ -1219,13 +1227,13 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
IntPtr svn_cancel_func_t_impl (IntPtr baton)
{
- if (updatemonitor == null || !updatemonitor.IsCancelRequested)
+ if (updatemonitor == null || !updatemonitor.CancellationToken.IsCancellationRequested)
return IntPtr.Zero;
IntPtr localpool = newpool (IntPtr.Zero);
var err = new LibSvnClient.svn_error_t {
apr_err = 200015,
- message = "The operation was interrupted",
+ message = GettextCatalog.GetString ("The operation was interrupted"),
pool = localpool
};
@@ -1283,7 +1291,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
progressData.LogTimer.Interval = 1000;
progressData.LogTimer.Elapsed += delegate {
progressData.Seconds += 1;
- updatemonitor.Log.WriteLine ("Transferred {0} in {1} seconds.", BytesToSize (progressData.KBytes), progressData.Seconds);
+ updatemonitor.Log.WriteLine (GettextCatalog.GetString ("Transferred {0} in {1} seconds.", BytesToSize (progressData.KBytes), progressData.Seconds));
};
progressData.LogTimer.Start ();
}
@@ -1446,7 +1454,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
// actiondesc = string.Format (GettextCatalog.GetString ("Path '{0}' is no longer a member of a changelist."), file);
// break;
default:
- System.Console.WriteLine("untranslated action:" + data.action);
+ LoggingService.LogDebug ("untranslated action:" + data.action);
actiondesc = data.action.ToString () + " " + file;
break;
/*
@@ -1456,11 +1464,13 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
}
if (updatemonitor != null && !string.IsNullOrEmpty (actiondesc)) {
- if (skipEol) {
- updatemonitor.Log.Write (actiondesc);
- } else {
- updatemonitor.Log.WriteLine (actiondesc);
- }
+ Runtime.RunInMainThread (() => {
+ if (skipEol) {
+ updatemonitor.Log.Write (actiondesc);
+ } else {
+ updatemonitor.Log.WriteLine (actiondesc);
+ }
+ });
}
if (updateFileList != null && notifyChange && File.Exists (file))
updateFileList.Add (file);
@@ -1663,6 +1673,7 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
/// </summary>
private class AnnotationCollector
{
+ readonly Repository repo;
readonly Annotation[] annotations;
public LibSvnClient.svn_client_blame_receiver_t Func {
get; private set;
@@ -1680,14 +1691,15 @@ namespace MonoDevelop.VersionControl.Subversion.Unix
} catch {
tdate = DateTime.MinValue;
}
- annotations[(int)line_no] = new Annotation (revision.ToString (), author, tdate);
+ annotations[(int)line_no] = new Annotation (new SvnRevision(repo, (int)revision), author, tdate);
}
return IntPtr.Zero;
}
- public AnnotationCollector (Annotation[] annotations)
+ public AnnotationCollector (Annotation[] annotations, Repository repo)
{
+ this.repo = repo;
this.annotations = annotations;
Func = CollectorFunc;
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/ChangeLog b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/ChangeLog
deleted file mode 100644
index cb0d92a595..0000000000
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/ChangeLog
+++ /dev/null
@@ -1,365 +0,0 @@
-2010-07-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- * MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- Track api changes.
-
-2010-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- * MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- Add basic support for git.
-
-2010-06-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- * MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- * MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs:
- Track API changes (annotations are now given back as class
- instead of a custom string).
-
-2010-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion.Gui/UserPasswordDialog.cs:
- * MonoDevelop.VersionControl.Subversion.Gui/SslServerTrustDialog.cs:
- * MonoDevelop.VersionControl.Subversion.Gui/ClientCertificateDialog.cs:
- * MonoDevelop.VersionControl.Subversion.Gui/ClientCertificatePasswordDialog.cs:
- Fix incorrect use of ShowCustomDialog/RunCustomDialog.
-
-2010-05-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl.Subversion.Gui/UserPasswordDialog.cs:
- * MonoDevelop.VersionControl.Subversion.Gui/SslServerTrustDialog.cs:
- * MonoDevelop.VersionControl.Subversion.Gui/ClientCertificateDialog.cs:
- * MonoDevelop.VersionControl.Subversion.Gui/ClientCertificatePasswordDialog.cs:
- More dialog placing.
-
-2010-05-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- * MonoDevelop.VersionControl.Subversion/LibSvnClient.cs: Get
- the description of errors reported using an error code.
- Fixes bug #602762 - No details supplied when svn connection
- fails.
-
-2010-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- * MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- * MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs:
- Split List method into List and ListUrl.
-
-2010-03-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/SvnClient.cs: Add
- description for BlameRevision.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.VersionControl.Subversion.addin.xml: Bumped MD
- version.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.VersionControl.Subversion.csproj:
- * MonoDevelop.VersionControl.Subversion.addin.xml:
- * MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- * MonoDevelop.VersionControl.Subversion.Gui/UserPasswordDialog.cs:
- * MonoDevelop.VersionControl.Subversion/SubversionNodeExtension.cs:
- * MonoDevelop.VersionControl.Subversion.Gui/SslServerTrustDialog.cs:
- * MonoDevelop.VersionControl.Subversion.Gui/ClientCertificateDialog.cs:
- * MonoDevelop.VersionControl.Subversion.Gui/ClientCertificatePasswordDialog.cs:
- Merged MD.Projects into MD.Core, and MD.Projects.Gui,
- MD.Core.Gui and MD.Components into MD.Ide.
-
-2010-02-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- Fix build.
-
-2010-02-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.VersionControl.Subversion.csproj: Moved diff
- widget and algorithm to MonoDevelop.Components.
-
-2010-02-04 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- Add support for revision-range-based recursive diffing.
-
-2010-02-04 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.VersionControl.Subversion/SvnClient.cs: Prevent
- occasional NRE.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.cs:
- * gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs:
- * gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.cs:
- * gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.cs:
- Flush.
-
-2009-11-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion.addin.xml: Don't
- include the linux svn client on windows.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.VersionControl.Subversion.addin.xml: Bump MD
- version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * MonoDevelop.VersionControl.Subversion.csproj:
- * gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.cs:
- * gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs:
- * gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.cs:
- * gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.cs:
- Flush.
-
-2009-10-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion.dll.config: Add
- correct dll mapping for freebsd.
-
-2009-10-13 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.VersionControl.Subversion.csproj: Import md.targets
-
-2009-10-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs: Updated license.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion.addin.xml: Update
- license.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.VersionControl.Subversion.addin.xml: Bump MD
- version.
-
-2009-10-06 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- * MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- Fix #544054: Exception in svn addin.
-
-2009-10-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/SvnClient.cs: Added
- missing string to translation.
-
-2009-09-09 Christian Hergert <chris@dronelabs.com>
-
- * MonoDevelop.VersionControl.Subversion.Gui/UserPasswordDialog.cs:
- * MonoDevelop.VersionControl.Subversion.Gui/SslServerTrustDialog.cs:
- Fix build.
-
-2009-09-09 Christian Hergert <chris@dronelabs.com>
-
- * MonoDevelop.VersionControl.Subversion.Gui/ClientCertificateDialog.cs:
- * MonoDevelop.VersionControl.Subversion.Gui/UserPasswordDialog.cs:
- * MonoDevelop.VersionControl.Subversion.Gui/ClientCertificatePasswordDialog.cs:
- * MonoDevelop.VersionControl.Subversion.Gui/SslServerTrustDialog.cs: Set
- dialogs transient for the root window.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion.csproj: Updated
- dependencies. We now depend on gtk# 2.12.8, Mono 2.4, and
- Mono.Addins 0.4.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic: Flush.
-
-2009-06-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs:
- Properly detect versioned directories. Allow reverting whole
- directories. All this fixes bug #436282 -
- solution/project/folders should have 'Revert All' option.
-
-2009-06-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- Use correct base path when generating diffs.
-
-2009-06-05 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs:
- Unbreak SharpSvn addin build.
-
-2009-06-05 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- * MonoDevelop.VersionControl.Subversion/LibSvnClient.cs:
- * MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- * MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs:
- Implement annotate.
-
-2009-06-01 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- Track API.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- Workaround for what seems to be a mcs bug. Looks like it
- can't properly resolve the implicit conversion of null to
- string.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion\SvnClient.cs:
- * MonoDevelop.VersionControl.Subversion\SubversionRepository.cs:
- * MonoDevelop.VersionControl.Subversion\SubversionNodeExtension.cs:
- * MonoDevelop.VersionControl.Subversion\SubversionVersionControl.cs:
- Use the new FilePath class for handling file and directory
- paths.
-
-2009-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion\SvnClient.cs: Added
- missing null check.
-
-2009-05-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.VersionControl.Subversion.csproj:
- * MonoDevelop.VersionControl.Subversion/LibApr.cs:
- * MonoDevelop.VersionControl.Subversion.addin.xml:
- * MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- * MonoDevelop.VersionControl.Subversion/ISvnClient.cs:
- * MonoDevelop.VersionControl.Subversion/SvnRevision.cs:
- * MonoDevelop.VersionControl.Subversion/LibSvnClient.cs:
- * MonoDevelop.VersionControl.Subversion/SubversionRepository.cs:
- * MonoDevelop.VersionControl.Subversion.Gui/UserPasswordDialog.cs:
- * MonoDevelop.VersionControl.Subversion.Gui/SslServerTrustDialog.cs:
- * MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs:
- * MonoDevelop.VersionControl.Subversion.Gui/ClientCertificateDialog.cs:
- * MonoDevelop.VersionControl.Subversion.Gui/ClientCertificatePasswordDialog.cs:
- Refactored the subversion add-in to make it easier to
- implement support for svn using other subversion backends.
-
-2009-04-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.VersionControl.Subversion/SvnClient.cs:
- * MonoDevelop.VersionControl.Subversion/ISvnClient.cs:
- * MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs:
- Created ISvnClient. May be required to implement other svn
- client backends.
-
- * MonoDevelop.VersionControl.Subversion.csproj: Don't require
- a specific gtk# version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.VersionControl.Subversion.addin.xml: Bump MD
- version.
-
-2009-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/SvnClient.cs: fixed
- typo.
-
-2009-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/SvnClient.cs: Added
- newline before revision message.
-
-2009-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/SvnClient.cs: worked
- on messages.
-
-2009-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/SvnClient.cs: Handled
- commit delta message.
-
-2009-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Subversion/SvnClient.cs: Improved
- subversion notify messages (taken some logic out of the
- subversion implementation).
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion.addin.xml: Restore
- accidentally removed menu extension.
-
-2009-02-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Flush.
-
-2009-02-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion.addin.xml: Track merge
- of the project pad context menu.
-
-2009-02-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.VersionControl.Subversion.csproj:
- * MonoDevelop.VersionControl.Subversion.dll.config: Add a
- dllmap for the Mac. Config patch from Kris Ray.
-
-2009-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl.Subversion.csproj: Don't
- local-copy other addins' dlls.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl.Subversion.csproj: Flush MD's
- removal of newline at end of file that was introduced by
- manually editing with gedit.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl.Subversion.csproj: Remove invalid
- ApplicationIcon value that broke the build in VS.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Subversion.mdp:
- * MonoDevelop.VersionControl.Subversion.csproj: Migrated to
- MSBuild file format.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.VersionControl.Subversion.addin.xml: Bump MD
- version.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.UserPasswordDialog.cs:
- * gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs:
- * gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificateDialog.cs:
- *
- gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.ClientCertificatePasswordDialog.cs:
- Flush.
-
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.Gui/WorkingCopyFormatDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.Gui/WorkingCopyFormatDialog.cs
index 8fd15737fc..540252ad43 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.Gui/WorkingCopyFormatDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.Gui/WorkingCopyFormatDialog.cs
@@ -61,12 +61,12 @@ namespace MonoDevelop.VersionControl.Subversion.Gui
action();
};
- if (DispatchService.IsGuiThread) {
+ if (Runtime.IsMainThread) {
// Already in GUI thread
del ();
}
else
- DispatchService.GuiDispatch (del);
+ Runtime.RunInMainThread (del);
}
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs
index 54dae06291..b130d7937f 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs
@@ -132,7 +132,7 @@ namespace MonoDevelop.VersionControl.Subversion
if (toLock.Count == 0)
return true;
- AlertButton but = new AlertButton ("Lock File");
+ AlertButton but = new AlertButton (GettextCatalog.GetString ("Lock File"));
if (!MessageService.Confirm (GettextCatalog.GetString ("The following files must be locked before editing."),
String.Join ("\n", toLock.Select (u => u.ToString ())), but))
return false;
@@ -148,17 +148,17 @@ namespace MonoDevelop.VersionControl.Subversion
return true;
}
- protected override void OnLock (IProgressMonitor monitor, params FilePath[] localPaths)
+ protected override void OnLock (ProgressMonitor monitor, params FilePath[] localPaths)
{
Svn.Lock (monitor, "", false, localPaths);
}
- protected override void OnUnlock (IProgressMonitor monitor, params FilePath[] localPaths)
+ protected override void OnUnlock (ProgressMonitor monitor, params FilePath[] localPaths)
{
Svn.Unlock (monitor, false, localPaths);
}
- protected override Repository OnPublish (string serverPath, FilePath localPath, FilePath[] files, string message, IProgressMonitor monitor)
+ protected override Repository OnPublish (string serverPath, FilePath localPath, FilePath[] files, string message, ProgressMonitor monitor)
{
string url = Url;
if (!serverPath.StartsWith ("/", StringComparison.Ordinal) && !url.EndsWith ("/", StringComparison.Ordinal))
@@ -184,7 +184,7 @@ namespace MonoDevelop.VersionControl.Subversion
return new SubversionRepository (VersionControlSystem, paths[0], localPath);
}
- void PublishDir (Set<FilePath> dirs, FilePath dir, bool rec, IProgressMonitor monitor)
+ void PublishDir (Set<FilePath> dirs, FilePath dir, bool rec, ProgressMonitor monitor)
{
if (dirs.Add (dir.CanonicalPath)) {
if (rec) {
@@ -194,28 +194,28 @@ namespace MonoDevelop.VersionControl.Subversion
}
}
- protected override void OnUpdate (FilePath[] localPaths, bool recurse, IProgressMonitor monitor)
+ protected override void OnUpdate (FilePath[] localPaths, bool recurse, ProgressMonitor monitor)
{
foreach (string path in localPaths)
Svn.Update (path, recurse, monitor);
}
- protected override void OnCommit (ChangeSet changeSet, IProgressMonitor monitor)
+ protected override void OnCommit (ChangeSet changeSet, ProgressMonitor monitor)
{
Svn.Commit (changeSet.Items.Select (it => it.LocalPath).ToArray (), changeSet.GlobalComment, monitor);
}
- void CreateDirectory (string[] paths, string message, IProgressMonitor monitor)
+ void CreateDirectory (string[] paths, string message, ProgressMonitor monitor)
{
Svn.Mkdir (paths, message, monitor);
}
- protected override void OnCheckout (FilePath targetLocalPath, Revision rev, bool recurse, IProgressMonitor monitor)
+ protected override void OnCheckout (FilePath targetLocalPath, Revision rev, bool recurse, ProgressMonitor monitor)
{
Svn.Checkout (this.Url, targetLocalPath, rev, recurse, monitor);
}
- protected override void OnRevert (FilePath[] localPaths, bool recurse, IProgressMonitor monitor)
+ protected override void OnRevert (FilePath[] localPaths, bool recurse, ProgressMonitor monitor)
{
// If we have an array of paths such as: new [] { "/Foo/Directory", "/Foo/Directory/File1", "/Foo/Directory/File2" }
// svn will successfully revert the first entry (the directory) and then throw an error when trying to revert the
@@ -225,17 +225,17 @@ namespace MonoDevelop.VersionControl.Subversion
Svn.Revert (localPaths, recurse, monitor);
}
- protected override void OnRevertRevision (FilePath localPath, Revision revision, IProgressMonitor monitor)
+ protected override void OnRevertRevision (FilePath localPath, Revision revision, ProgressMonitor monitor)
{
Svn.RevertRevision (localPath, revision, monitor);
}
- protected override void OnRevertToRevision (FilePath localPath, Revision revision, IProgressMonitor monitor)
+ protected override void OnRevertToRevision (FilePath localPath, Revision revision, ProgressMonitor monitor)
{
Svn.RevertToRevision (localPath, revision, monitor);
}
- protected override void OnAdd (FilePath[] localPaths, bool recurse, IProgressMonitor monitor)
+ protected override void OnAdd (FilePath[] localPaths, bool recurse, ProgressMonitor monitor)
{
foreach (FilePath path in localPaths) {
if (IsVersioned (path) && File.Exists (path) && !Directory.Exists (path)) {
@@ -308,7 +308,7 @@ namespace MonoDevelop.VersionControl.Subversion
return (srcRepository is SubversionRepository) && ((SubversionRepository)srcRepository).Root == Root;
}
- protected override void OnMoveFile (FilePath localSrcPath, FilePath localDestPath, bool force, IProgressMonitor monitor)
+ protected override void OnMoveFile (FilePath localSrcPath, FilePath localDestPath, bool force, ProgressMonitor monitor)
{
bool destIsVersioned = false;
@@ -344,7 +344,7 @@ namespace MonoDevelop.VersionControl.Subversion
ClearCachedVersionInfo (localSrcPath, localDestPath);
}
- protected override void OnMoveDirectory (FilePath localSrcPath, FilePath localDestPath, bool force, IProgressMonitor monitor)
+ protected override void OnMoveDirectory (FilePath localSrcPath, FilePath localDestPath, bool force, ProgressMonitor monitor)
{
if (IsVersioned (localDestPath))
{
@@ -435,7 +435,7 @@ namespace MonoDevelop.VersionControl.Subversion
}
}
- void MakeDirVersioned (string dir, IProgressMonitor monitor)
+ void MakeDirVersioned (string dir, ProgressMonitor monitor)
{
if (Directory.Exists (SubversionBackend.GetDirectoryDotSvn (VersionControlSystem, dir)))
return;
@@ -462,7 +462,7 @@ namespace MonoDevelop.VersionControl.Subversion
collection.Add(f);
}
- protected override void OnDeleteFiles (FilePath[] localPaths, bool force, IProgressMonitor monitor, bool keepLocal)
+ protected override void OnDeleteFiles (FilePath[] localPaths, bool force, ProgressMonitor monitor, bool keepLocal)
{
foreach (string path in localPaths) {
if (IsVersioned (path)) {
@@ -490,7 +490,7 @@ namespace MonoDevelop.VersionControl.Subversion
}
}
- protected override void OnDeleteDirectories (FilePath[] localPaths, bool force, IProgressMonitor monitor, bool keepLocal)
+ protected override void OnDeleteDirectories (FilePath[] localPaths, bool force, ProgressMonitor monitor, bool keepLocal)
{
foreach (string path in localPaths) {
if (IsVersioned (path)) {
@@ -550,21 +550,24 @@ namespace MonoDevelop.VersionControl.Subversion
}
}
- public override Annotation[] GetAnnotations (FilePath repositoryPath)
+ public override Annotation[] GetAnnotations (FilePath repositoryPath, Revision since)
{
- List<Annotation> annotations = new List<Annotation> (Svn.GetAnnotations (this, repositoryPath, SvnRevision.First, SvnRevision.Base));
- Annotation nextRev = new Annotation (GettextCatalog.GetString ("working copy"), "<uncommitted>", DateTime.MinValue);
+ SvnRevision sinceRev = since != null ? (SvnRevision)since : null;
+ List<Annotation> annotations = new List<Annotation> (Svn.GetAnnotations (this, repositoryPath, SvnRevision.First, sinceRev ?? SvnRevision.Base));
+ Annotation nextRev = new Annotation (null, GettextCatalog.GetString ("<uncommitted>"), DateTime.MinValue, null, GettextCatalog.GetString ("working copy"));
var baseDocument = Mono.TextEditor.TextDocument.CreateImmutableDocument (GetBaseText (repositoryPath));
- var workingDocument = Mono.TextEditor.TextDocument.CreateImmutableDocument (File.ReadAllText (repositoryPath));
-
- // "SubversionException: blame of the WORKING revision is not supported"
- foreach (var hunk in baseDocument.Diff (workingDocument)) {
- annotations.RemoveRange (hunk.RemoveStart - 1, hunk.Removed);
- for (int i = 0; i < hunk.Inserted; ++i) {
- if (hunk.InsertStart + i >= annotations.Count)
- annotations.Add (nextRev);
- else
- annotations.Insert (hunk.InsertStart - 1, nextRev);
+ var workingDocument = Mono.TextEditor.TextDocument.CreateImmutableDocument (File.ReadAllText (repositoryPath));
+
+ // "SubversionException: blame of the WORKING revision is not supported"
+ if (sinceRev == null) {
+ foreach (var hunk in baseDocument.Diff (workingDocument, includeEol: false)) {
+ annotations.RemoveRange (hunk.RemoveStart - 1, hunk.Removed);
+ for (int i = 0; i < hunk.Inserted; ++i) {
+ if (hunk.InsertStart + i >= annotations.Count)
+ annotations.Add (nextRev);
+ else
+ annotations.Insert (hunk.InsertStart - 1, nextRev);
+ }
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs
index b18cc66435..b33e289d63 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionVersionControl.cs
@@ -91,9 +91,15 @@ namespace MonoDevelop.VersionControl.Subversion
public VersionInfo GetVersionInfo (Repository repo, FilePath localPath, bool getRemoteStatus)
{
// Check for directory before checking for file, since directory links may appear as files
- if (Directory.Exists (localPath))
- return GetDirStatus (repo, localPath, getRemoteStatus);
- return GetFileStatus (repo, localPath, getRemoteStatus);
+ var isDir = Directory.Exists (localPath);
+ try {
+ if (isDir)
+ return GetDirStatus (repo, localPath, getRemoteStatus);
+ return GetFileStatus (repo, localPath, getRemoteStatus);
+ } catch (Exception e) {
+ LoggingService.LogError ("Failed to query subversion status", e);
+ return VersionInfo.CreateUnversioned (localPath, isDir);
+ }
}
private VersionInfo GetFileStatus (Repository repo, FilePath sourcefile, bool getRemoteStatus)
@@ -137,28 +143,33 @@ namespace MonoDevelop.VersionControl.Subversion
public VersionInfo[] GetDirectoryVersionInfo (Repository repo, FilePath sourcepath, bool getRemoteStatus, bool recursive)
{
- return Status (repo, sourcepath, SvnRevision.Head, recursive, true, getRemoteStatus).ToArray ();
+ try {
+ return Status (repo, sourcepath, SvnRevision.Head, recursive, true, getRemoteStatus).ToArray ();
+ } catch (Exception e) {
+ LoggingService.LogError ("Failed to get subversion directory status", e);
+ return new VersionInfo [0];
+ }
}
public abstract IEnumerable<VersionInfo> Status (Repository repo, FilePath path, SvnRevision revision, bool descendDirs, bool changedItemsOnly, bool remoteStatus);
- public abstract void Update (FilePath path, bool recurse, IProgressMonitor monitor);
+ public abstract void Update (FilePath path, bool recurse, ProgressMonitor monitor);
- public abstract void Commit (FilePath[] paths, string message, IProgressMonitor monitor);
+ public abstract void Commit (FilePath[] paths, string message, ProgressMonitor monitor);
- public abstract void Mkdir (string[] paths, string message, IProgressMonitor monitor);
+ public abstract void Mkdir (string[] paths, string message, ProgressMonitor monitor);
- public abstract void Checkout (string url, FilePath path, Revision rev, bool recurse, IProgressMonitor monitor);
+ public abstract void Checkout (string url, FilePath path, Revision rev, bool recurse, ProgressMonitor monitor);
- public abstract void Revert (FilePath[] paths, bool recurse, IProgressMonitor monitor);
+ public abstract void Revert (FilePath[] paths, bool recurse, ProgressMonitor monitor);
- public abstract void RevertRevision (FilePath path, Revision revision, IProgressMonitor monitor);
+ public abstract void RevertRevision (FilePath path, Revision revision, ProgressMonitor monitor);
- public abstract void RevertToRevision (FilePath path, Revision revision, IProgressMonitor monitor);
+ public abstract void RevertToRevision (FilePath path, Revision revision, ProgressMonitor monitor);
- public abstract void Add (FilePath path, bool recurse, IProgressMonitor monitor);
+ public abstract void Add (FilePath path, bool recurse, ProgressMonitor monitor);
- public abstract void Delete (FilePath path, bool force, IProgressMonitor monitor);
+ public abstract void Delete (FilePath path, bool force, ProgressMonitor monitor);
public abstract void Ignore (FilePath[] paths);
@@ -178,16 +189,16 @@ namespace MonoDevelop.VersionControl.Subversion
public abstract IEnumerable<DirectoryEntry> ListUrl (string url, bool recurse, SvnRevision rev);
- public void Move (FilePath srcPath, FilePath destPath, bool force, IProgressMonitor monitor)
+ public void Move (FilePath srcPath, FilePath destPath, bool force, ProgressMonitor monitor)
{
Move (srcPath, destPath, SvnRevision.Head, force, monitor);
}
- public abstract void Move (FilePath srcPath, FilePath destPath, SvnRevision rev, bool force, IProgressMonitor monitor);
+ public abstract void Move (FilePath srcPath, FilePath destPath, SvnRevision rev, bool force, ProgressMonitor monitor);
- public abstract void Lock (IProgressMonitor monitor, string comment, bool stealLock, params FilePath[] paths);
+ public abstract void Lock (ProgressMonitor monitor, string comment, bool stealLock, params FilePath[] paths);
- public abstract void Unlock (IProgressMonitor monitor, bool breakLock, params FilePath[] paths);
+ public abstract void Unlock (ProgressMonitor monitor, bool breakLock, params FilePath[] paths);
public string GetUnifiedDiff (FilePath path, bool recursive, bool remoteDiff)
{
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnRevision.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnRevision.cs
index 98b103bf00..1551e36181 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnRevision.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SvnRevision.cs
@@ -54,6 +54,12 @@ namespace MonoDevelop.VersionControl.Subversion
Kind = 1;
}
+ public override bool Equals(object o)
+ {
+ var other = (SvnRevision)o;
+ return Rev == other.Rev && Kind == other.Kind;
+ }
+
public override string ToString()
{
return Rev.ToString();
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs
index 2b340b8d09..67bfa64504 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/gtk-gui/MonoDevelop.VersionControl.Subversion.Gui.SslServerTrustDialog.cs
@@ -5,33 +5,59 @@ namespace MonoDevelop.VersionControl.Subversion.Gui
internal partial class SslServerTrustDialog
{
private global::Gtk.HBox hbox1;
+
private global::Gtk.VBox vbox2;
- private global::Gtk.Image image1;
+
+ private global::MonoDevelop.Components.ImageView image1;
+
private global::Gtk.VBox vbox3;
+
private global::Gtk.Label label2;
+
private global::Gtk.Label labelReason;
+
private global::Gtk.HSeparator hseparator2;
+
private global::Gtk.Table table1;
+
private global::Gtk.Label label3;
+
private global::Gtk.Label label4;
+
private global::Gtk.Label label5;
+
private global::Gtk.Label label6;
+
private global::Gtk.Label label7;
+
private global::Gtk.Label label8;
+
private global::Gtk.Label labelFprint;
+
private global::Gtk.Label labelFrom;
+
private global::Gtk.Label labelHost;
+
private global::Gtk.Label labelIssuer;
+
private global::Gtk.Label labelRealm;
+
private global::Gtk.Label labelUntil;
+
private global::Gtk.HSeparator hseparator1;
+
private global::Gtk.Label label15;
+
private global::Gtk.RadioButton radioAccept;
+
private global::Gtk.RadioButton radioAcceptSession;
+
private global::Gtk.RadioButton radioNotAccept;
+
private global::Gtk.Button button98;
- private global::Gtk.Button button104;
+ private global::Gtk.Button button104;
+
protected virtual void Build ()
{
global::Stetic.Gui.Initialize (this);
@@ -54,9 +80,10 @@ namespace MonoDevelop.VersionControl.Subversion.Gui
this.vbox2 = new global::Gtk.VBox ();
this.vbox2.Name = "vbox2";
// Container child vbox2.Gtk.Box+BoxChild
- this.image1 = new global::Gtk.Image ();
+ this.image1 = new global::MonoDevelop.Components.ImageView ();
this.image1.Name = "image1";
- this.image1.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-dialog-warning", global::Gtk.IconSize.Dialog);
+ this.image1.IconId = "gtk-dialog-warning";
+ this.image1.IconSize = ((global::Gtk.IconSize)(6));
this.vbox2.Add (this.image1);
global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.image1]));
w2.Position = 0;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/gtk-gui/generated.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/gtk-gui/generated.cs
index 75697d1663..b453919401 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/gtk-gui/generated.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/gtk-gui/generated.cs
@@ -14,44 +14,6 @@ namespace Stetic
}
}
- internal class IconLoader
- {
- public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size)
- {
- Gdk.Pixbuf res = widget.RenderIcon (name, size, null);
- if ((res != null)) {
- return res;
- } else {
- int sz;
- int sy;
- global::Gtk.Icon.SizeLookup (size, out sz, out sy);
- try {
- return Gtk.IconTheme.Default.LoadIcon (name, sz, 0);
- } catch (System.Exception) {
- if ((name != "gtk-missing-image")) {
- return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size);
- } else {
- Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz);
- Gdk.GC gc = new Gdk.GC (pmap);
- gc.RgbFgColor = new Gdk.Color (255, 255, 255);
- pmap.DrawRectangle (gc, true, 0, 0, sz, sz);
- gc.RgbFgColor = new Gdk.Color (0, 0, 0);
- pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1));
- gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
- gc.RgbFgColor = new Gdk.Color (255, 0, 0);
- pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1)
- - (sz / 4)), ((sz - 1)
- - (sz / 4)));
- pmap.DrawLine (gc, ((sz - 1)
- - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1)
- - (sz / 4)));
- return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
- }
- }
- }
- }
- }
-
internal class ActionGroups
{
public static Gtk.ActionGroup GetActionGroup (System.Type type)
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/gtk-gui/gui.stetic b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/gtk-gui/gui.stetic
index ae41c2e8f3..8d0ac6267e 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/gtk-gui/gui.stetic
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/gtk-gui/gui.stetic
@@ -244,9 +244,10 @@
<widget class="Gtk.VBox" id="vbox2">
<property name="MemberName" />
<child>
- <widget class="Gtk.Image" id="image1">
+ <widget class="MonoDevelop.Components.ImageView" id="image1">
<property name="MemberName" />
- <property name="Pixbuf">stock:gtk-dialog-warning Dialog</property>
+ <property name="IconId">gtk-dialog-warning</property>
+ <property name="IconSize">Dialog</property>
</widget>
<packing>
<property name="Position">0</property>
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/ChangeLog b/main/src/addins/VersionControl/MonoDevelop.VersionControl/ChangeLog
deleted file mode 100644
index 58b576f11d..0000000000
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/ChangeLog
+++ /dev/null
@@ -1,1483 +0,0 @@
-2010-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/ChangeSet.cs:
- * MonoDevelop.VersionControl/ChangeLogWriter.cs:
- * MonoDevelop.VersionControl.Dialogs/CommitDialog.cs:
- * MonoDevelop.VersionControl/VersionControlService.cs:
- * MonoDevelop.VersionControl.Dialogs/VersionControlPolicyPanel.cs:
- * MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs:
- Track api changes.
-
- * MonoDevelop.VersionControl/CreatePatchCommand.cs: Ignore
- extensions which failed to initialize.
-
-2010-07-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/Repository.cs:
- * MonoDevelop.VersionControl.Views/BlameWidget.cs: Annotations
- now use a DateTime instead of a String to represent the
- commit date.
-
- * MonoDevelop.VersionControl.Views/ComparisonWidget.cs:
- Provide the correct path to GetTextAtRevision.
-
-2010-07-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.VersionControl.Dialogs/CommitDialog.cs:
- * gtk-gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs:
- Improved look. Show separators between extension widgets.
-
- * MonoDevelop.VersionControl/CommitDialogExtension.cs: The
- Initialize method now can return a boolean indicating
- whether the extension is enabled or not. Added some
- comments.
-
-2010-07-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Dialogs/CommitDialog.cs: Focus
- the text view and move the insert point to the begining.
- Makes it easier to insert a comment header.
-
- * MonoDevelop.VersionControl/ChangeLogWriter.cs:
- * MonoDevelop.VersionControl/CommitMessageFormat.cs:
- * MonoDevelop.VersionControl/VersionControlService.cs: Added
- option which allows omiting the file list in the commit
- message when all files have the same comment.
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs:
- Add some mnemonics.
-
-2010-07-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/Repository.cs: Remove debug code.
-
-2010-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Views/ChangeSetView.cs: Add
- missing file.
-
-2010-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/VersionControlNodeExtension.cs:
- Remove debug output.
-
-2010-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.VersionControl.csproj:
- * MonoDevelop.VersionControl/ChangeSet.cs: New reusable widget
- for showing change sets.
-
-2010-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/Repository.cs:
- * MonoDevelop.VersionControl.Views/DiffView.cs:
- * MonoDevelop.VersionControl/UnknownRepository.cs:
- * MonoDevelop.VersionControl.Views/ComparisonView.cs:
- * MonoDevelop.VersionControl.Views/ComparisonWidget.cs:
- * MonoDevelop.VersionControl/VersionControlNodeExtension.cs:
- Add basic support for git.
-
-2010-07-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/BlameView.cs:
- * MonoDevelop.VersionControl.Views/ComparisonView.cs: Use
- delegation methods.
-
-2010-07-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/LogView.cs:
- * MonoDevelop.VersionControl.Views/BlameWidget.cs:
- * MonoDevelop.VersionControl.Views/ComparisonWidget.cs: Worked
- on version control views.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/BlameView.cs:
- * MonoDevelop.VersionControl.Views/BlameWidget.cs:
- * MonoDevelop.VersionControl.Views/PatchWidget.cs:
- * MonoDevelop.VersionControl.Views/ComparisonView.cs:
- * MonoDevelop.VersionControl.Views/ComparisonWidget.cs: Track
- API changes.
-
-2010-07-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/ComparisonWidget.cs: Worked
- on adjustments. (text editors no longer share a common
- adjustment - instead they communicate)
-
-2010-07-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/ComparisonWidget.cs: Fixed
- the overview renderer click position.
-
-2010-07-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/BlameWidget.cs:
- * MonoDevelop.VersionControl.Views/ComparisonWidget.cs: Caret
- state is now shown.
-
-2010-07-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * VersionControl.addin.xml:
- * MonoDevelop.VersionControl.Views/DiffParser.cs: Track
- ProjectDomService/Parser API.
-
-2010-07-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/DropDownBox.cs: fixed some
- drop down box issues.
-
-2010-07-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/DropDownBox.cs:
- * MonoDevelop.VersionControl.Views/BlameWidget.cs:
- * MonoDevelop.VersionControl.Views/ComparisonView.cs:
- * MonoDevelop.VersionControl.Views/ComparisonWidget.cs: Worked
- on version control gui.
-
-2010-07-07 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.VersionControl.csproj:
- * MonoDevelop.VersionControl.Views/DropDownBox.cs:
- * MonoDevelop.VersionControl.Views/ComparisonWidget.cs: Added
- drop down box for the version control views (TODO:
- Selector).
-
-2010-07-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/ComparisonWidget.cs: Fixed
- error in calculation.
-
-2010-07-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/BlameWidget.cs:
- * MonoDevelop.VersionControl.Views/ComparisonWidget.cs:
- Improved the visualization of the change-diff - it's now
- easier to see what has changed when only a part of the line
- changed.
-
-2010-07-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/ComparisonView.cs:
- * MonoDevelop.VersionControl.Views/ComparisonWidget.cs:
- Undo/Redo now works in comparison view.
-
-2010-07-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/BlameWidget.cs: Added
- bounds check.
-
-2010-07-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/BlameWidget.cs: set correct
- bounds.
-
-2010-07-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/BlameWidget.cs: Added range
- check.
-
-2010-07-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/BlameView.cs:
- * MonoDevelop.VersionControl.Views/ComparisonView.cs:
- * MonoDevelop.VersionControl.Views/ComparisonWidget.cs: Worked
- on version control views.
-
-2010-06-30 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.VersionControl.csproj:
- * MonoDevelop.VersionControl.Views/LogView.cs:
- * MonoDevelop.VersionControl.Views/PatchView.cs:
- * MonoDevelop.VersionControl.Views/BlameView.cs:
- * MonoDevelop.VersionControl.Views/PatchWidget.cs:
- * MonoDevelop.VersionControl.Views/BlameWidget.cs:
- * MonoDevelop.VersionControl.Views/ComparisonView.cs:
- * MonoDevelop.VersionControl.Views/ComparisonWidget.cs:
- * gtk-gui/MonoDevelop.VersionControl.Views.PatchWidget.cs:
- * MonoDevelop.VersionControl.Views/ComparisonWidgetContainer.cs:
- * gtk-gui/MonoDevelop.VersionControl.Views.ComparisonWidgetContainer.cs:
- Worked on version control gui.
-
-2010-06-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/BlameWidget.cs: Worked on
- blame widget.
-
-2010-06-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/BlameWidget.cs: Worked on
- blame widget.
-
-2010-06-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/LogView.cs:
- * MonoDevelop.VersionControl.Views/BlameView.cs:
- * MonoDevelop.VersionControl.Views/ComparisonView.cs:
- * MonoDevelop.VersionControl/VersionControlNodeExtension.cs:
- Worked on version control GUI.
-
-2010-06-29 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * VersionControl.addin.xml:
- * MonoDevelop.VersionControl.csproj:
- * MonoDevelop.VersionControl/Repository.cs:
- * MonoDevelop.VersionControl.Views/LogView.cs:
- * MonoDevelop.VersionControl/AnnotateCommand.cs:
- * MonoDevelop.VersionControl.Views/BlameView.cs:
- * MonoDevelop.VersionControl/UnknownRepository.cs:
- * MonoDevelop.VersionControl.Views/BlameWidget.cs:
- * MonoDevelop.VersionControl.Views/AnnotateView.cs:
- * MonoDevelop.VersionControl.Views/ComparisonView.cs:
- * MonoDevelop.VersionControl/VersionControlService.cs:
- * MonoDevelop.VersionControl.Views/ComparisonWidget.cs:
- * MonoDevelop.VersionControl/VersionControlNodeExtension.cs:
- * MonoDevelop.VersionControl.Views/ComparisonWidgetContainer.cs:
- * gtk-gui/MonoDevelop.VersionControl.Views.ComparisonWidgetContainer.cs:
- Worked on version control gui.
-
-2010-06-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl/Task.cs: Don't bring the VCS
- monitor to the front.
-
-2010-06-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/AnnotateView.cs: Fixed 'Bug
- 610257 - Text editor does not redraw after toggling
- annotations'.
-
-2010-06-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Views/AnnotateView.cs: Fix bug
- #610262 - After hiding annotations they still refresh on
- save.
-
-2010-05-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/AnnotateView.cs: Added
- missing string to translation.
-
-2010-05-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/AnnotateView.cs: Fixed 'Bug
- 610257 - Text editor does not redraw after toggling
- annotations'.
-
-2010-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/CommitCommand.cs:
- * MonoDevelop.VersionControl/PublishCommand.cs:
- * MonoDevelop.VersionControl/CheckoutCommand.cs:
- * MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs:
- Fix incorrect use of ShowCustomDialog/RunCustomDialog.
-
-2010-05-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl/CommitCommand.cs:
- * MonoDevelop.VersionControl/PublishCommand.cs:
- * MonoDevelop.VersionControl/CheckoutCommand.cs:
- * MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs:
- More dialog placing.
-
-2010-05-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Views/AnnotateView.cs: Show a
- status message while getting annotations.
-
-2010-05-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/AnnotateView.cs: Track API
- changes.
-
-2010-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * Policies.xml: Added attribute to explicitly allow
- differential serialization for a policy (which is disabled
- by default).
-
-2010-04-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl/BaseView.cs:
- * MonoDevelop.VersionControl.Views/StatusView.cs: Use icon.
-
-2010-04-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/ChangeSet.cs:
- * MonoDevelop.VersionControl.Views/StatusView.cs: After
- updating status, remove from the changeset the files/folders
- which have been deleted. Fixes bug #582514 - VCS status view
- sometimes has hidden invalid items that obstruct commit.
-
-2010-04-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Views/StatusView.cs: Don't show
- an output pad when updating the status view.
-
- * MonoDevelop.VersionControl/Task.cs:
- * MonoDevelop.VersionControl/LockCommand.cs:
- * MonoDevelop.VersionControl/UnlockCommand.cs:
- * MonoDevelop.VersionControl/UpdateCommand.cs:
- * MonoDevelop.VersionControl/CommitCommand.cs:
- * MonoDevelop.VersionControl/RevertCommand.cs:
- * MonoDevelop.VersionControl/PublishCommand.cs:
- * MonoDevelop.VersionControl/CheckoutCommand.cs:
- * MonoDevelop.VersionControl/AddRemoveMoveCommand.cs:
- * MonoDevelop.VersionControl/RevertRevisionsCommands.cs:
- Improve success message. Small api simplification.
-
-2010-03-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * VersionControl.addin.xml: Register data files.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * VersionControl.addin.xml: Bumped MD version.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * VersionControl.addin.xml:
- * MonoDevelop.VersionControl.csproj:
- * MonoDevelop.VersionControl/Task.cs:
- * MonoDevelop.VersionControl/BaseView.cs:
- * MonoDevelop.VersionControl/UpdateCommand.cs:
- * MonoDevelop.VersionControl/CommitCommand.cs:
- * MonoDevelop.VersionControl/RevertCommand.cs:
- * MonoDevelop.VersionControl.Views/LogView.cs:
- * MonoDevelop.VersionControl/PublishCommand.cs:
- * MonoDevelop.VersionControl.Views/DiffView.cs:
- * MonoDevelop.VersionControl/AnnotateCommand.cs:
- * MonoDevelop.VersionControl/CheckoutCommand.cs:
- * MonoDevelop.VersionControl.Views/StatusView.cs:
- * MonoDevelop.VersionControl/CreatePatchCommand.cs:
- * MonoDevelop.VersionControl.Views/AnnotateView.cs:
- * MonoDevelop.VersionControl/AddRemoveMoveCommand.cs:
- * MonoDevelop.VersionControl.Dialogs/CommitDialog.cs:
- * MonoDevelop.VersionControl/VersionControlService.cs:
- * MonoDevelop.VersionControl.Views/CellRendererDiff.cs:
- * MonoDevelop.VersionControl/RevertRevisionsCommands.cs:
- * MonoDevelop.VersionControl/VersionControlNodeExtension.cs:
- * MonoDevelop.VersionControl.Dialogs/VersionControlPolicyPanel.cs:
- * MonoDevelop.VersionControl/VersionControlFileSystemExtension.cs:
- * MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs:
- Merged MD.Projects into MD.Core, and MD.Projects.Gui,
- MD.Core.Gui and MD.Components into MD.Ide.
-
-2010-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * version-control-16.png:
- * VersionControl.addin.xml:
- * MonoDevelop.VersionControl.csproj:
- * MonoDevelop.VersionControl/Task.cs: Added version control
- icon.
-
- * MonoDevelop.VersionControl/VersionControlNodeExtension.cs:
- Fix type reference ambiguity.
-
-2010-03-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/AnnotateView.cs: fix build.
-
-2010-02-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * VersionControl.addin.xml:
- * MonoDevelop.VersionControl.csproj:
- * MonoDevelop.VersionControl.Views/DiffView.cs: Track moved
- diff component.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Views/LogView.cs:
- * MonoDevelop.VersionControl.Views/StatusView.cs:
- * MonoDevelop.VersionControl.Dialogs/CommitDialog.cs: Track
- api changes.
-
-2010-02-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Views/StatusView.cs: Fix parsing
- of command id. We are not using enums as ids anymore.
-
-2010-02-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * VersionControl.addin.xml:
- * MonoDevelop.VersionControl.csproj: Move the icon resources
- into files, which can be loaded without loading the whole
- add-in.
-
-2010-02-10 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Makefile.am:
- * VersionControl.addin.xml:
- * MonoDevelop.VersionControl.csproj:
- * MonoDevelop.VersionControl.Views/DiffParser.cs: Add
- quickfinder and folding support for unified diffs.
-
-2010-02-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/LogView.cs:
- * MonoDevelop.VersionControl.Views/StatusView.cs:
- * MonoDevelop.VersionControl.Dialogs/CommitDialog.cs: Track
- API changes for lazy loading images.
-
-2010-02-04 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.VersionControl.Views/LogView.cs: Allow viewing
- of historical, recursive directory diffs.
-
- * MonoDevelop.VersionControl/Repository.cs: Add support for
- revision-range-based recursive diffing.
-
-2010-02-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.VersionControl.csproj: Add indirect reference.
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs:
- * gtk-gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs:
- * gtk-gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs:
- * gtk-gui/MonoDevelop.VersionControl.CommitMessageStylePanelWidget.cs:
- * gtk-gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs:
- Flush.
-
-2009-12-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl.Views/StatusView.cs: Track the
- last mouse cursor position on a child cell in the widget,
- and clear when the cursor leaves. The cellrenderer can use
- this an an accurate source of information whether the
- pointer is still on this widget and where it is.
-
- * MonoDevelop.VersionControl.Views/CellRendererDiff.cs: Don't
- pick up the global cursor position, since it may just be an
- expose from a window being dragged over. Instead, use the
- cursor position from the parent FileTreeView.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl/Task.cs:
- * MonoDevelop.VersionControl.Views/StatusView.cs:
- * MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs:
- Name threads to make debugging easier.
-
-2009-11-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/AnnotateView.cs: Track API
- changes.
-
-2009-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * VersionControl.addin.xml: Move the annotate command to a
- more convenient location in the context menu.
-
-2009-11-19 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.VersionControl.Views/AnnotateView.cs: Show
- commit message on mouseover. Implements #545521.
-
-2009-11-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Views/StatusView.cs: Fix sort by
- file name.
-
-2009-11-11 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.VersionControl/CreatePatchCommand.cs: Allow
- patches for multiselected items in the solution pad.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * VersionControl.addin.xml: Bump MD version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * MonoDevelop.VersionControl.csproj:
- * gtk-gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs:
- * gtk-gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs:
- * gtk-gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs:
- * gtk-gui/MonoDevelop.VersionControl.CommitMessageStylePanelWidget.cs:
- * gtk-gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs:
- Flush.
-
-2009-10-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl/VersionControlService.cs: Handled
- icon loading errors.
-
-2009-10-08 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.VersionControl.csproj: Use \ instead of '/'
- in the Import.
-
-2009-10-08 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.VersionControl.csproj: Add md.targets .
-
-2009-10-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl.Views/StatusView.cs: Construct
- Refresh and Open buttons explicitly to work around Mac GTK+
- issue with stock buttons.
-
-2009-10-07 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.VersionControl.Views/AnnotateView.cs: Only
- update width in the GUI thread.
-
-2009-10-07 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.VersionControl.Views/AnnotateView.cs: Do
- whole-file updates asynchronously.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * VersionControl.addin.xml: Update license.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * VersionControl.addin.xml: Bump MD version.
-
-2009-10-06 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.VersionControl.Views/AnnotateView.cs: Update
- annotations on revert.
-
-2009-10-06 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.VersionControl.Views/AnnotateView.cs: Update
- annotation margin while editing.
-
-2009-10-06 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.VersionControl.Views/AnnotateView.cs: Fix
- exception when reverting with annotations visible.
-
-2009-09-09 Christian Hergert <chris@dronelabs.com>
-
- * MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs:
- * MonoDevelop.VersionControl/CommitCommand.cs:
- * MonoDevelop.VersionControl/PublishCommand.cs:
- * MonoDevelop.VersionControl/CheckoutCommand.cs: Set dialogs
- transient for the root window.
-
-2009-09-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/CommitCommand.cs: Show an error
- message when trying to commit a directory which has no
- changes. Fixes bug #517699 - Monodevelop crash when
- submitting to SVN.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/StatusView.cs: fixed
- warning.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.csproj: Updated dependencies. We
- now depend on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.csproj: Don't make local copies
- of project references.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.VersionControl.csproj: Flush.
-
-2009-07-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Views/StatusView.cs:
- * MonoDevelop.VersionControl.Views/CellRendererDiff.cs: The
- status view now supports double clicking on a line of a diff
- to jump to that line in the modified file.
-
-2009-07-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/StatusView.cs:
- * MonoDevelop.VersionControl.Views/CellRendererDiff.cs: Fixed
- "Bug 470436 - Crash when using the mouse wheel to scroll
- very fast on the diff viewer".
-
-2009-06-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/Repository.cs: Properly detect
- versioned directories. Allow reverting whole directories.
- All this fixes bug #436282 - solution/project/folders should
- have 'Revert All' option.
-
-2009-06-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Views/StatusView.cs: When
- double-clicking on a file, open it. Fixes bug #402108 -
- Double-click on item in the Review changes dialog should
- open the file or show the differences.
-
-2009-06-25 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.VersionControl/CreatePatchCommand.cs:
- Generate better initial names for created patches.
-
-2009-06-23 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * VersionControl.addin.xml:
- Add "Create Patch" to status view context menu.
-
-2009-06-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Views/LogView.cs:
- * MonoDevelop.VersionControl.Views/DiffView.cs:
- * MonoDevelop.VersionControl.Views/StatusView.cs:
- * MonoDevelop.VersionControl.Views/CellRendererDiff.cs:
- * MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs:
- Use the new DesktopService instead of PlatformService.
-
-2009-06-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Views/StatusView.cs: Use
- CreatePatchCommand to create the patch.
-
- * MonoDevelop.VersionControl/CreatePatchCommand.cs: Include
- commit extensions in the generation of the patch, so
- generated changelog entries are included.
-
- * MonoDevelop.VersionControl/Repository.cs: Convert absolute
- paths to relative paths when a base path for the diff is
- specified. Include patch index info when generating a patch.
-
-2009-06-15 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Makefile.am:
- * VersionControl.addin.xml:
- * MonoDevelop.VersionControl.csproj:
- * MonoDevelop.VersionControl/Commands.cs:
- * MonoDevelop.VersionControl/Repository.cs:
- * MonoDevelop.VersionControl/CreatePatchCommand.cs:
- * MonoDevelop.VersionControl/VersionControlNodeExtension.cs:
- * MonoDevelop.VersionControl.Views/StatusView.cs:
- Added "CreatePatch" command.
-
-2009-06-05 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.VersionControl/Repository.cs:
- Unbreak SharpSvn addin build.
-
-2009-06-05 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.VersionControl.Views/AnnotateView.cs:
- Draw background for area after end of annotations.
-
-2009-06-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Fix build by adding reference to Mono.Debugging.
-
-2009-06-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.VersionControl.csproj: Add reference to
- DesignerSupport addin.
-
-2009-06-01 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Makefile.am:
- * MonoDevelop.VersionControl.csproj:
- * MonoDevelop.VersionControl/Commands.cs:
- * MonoDevelop.VersionControl/Repository.cs:
- * MonoDevelop.VersionControl/UnknownRepository.cs:
- * MonoDevelop.VersionControl/VersionControlNodeExtension.cs:
- * MonoDevelop.VersionControl/AnnotateCommand.cs:
- * MonoDevelop.VersionControl.Views/AnnotateView.cs:
- * VersionControl.addin.xml: Added "Annotate" command.
-
-2009-05-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/VersionControlNodeExtension.cs:
- Use the new FilePath class.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl\CommitCommand.cs:
- * MonoDevelop.VersionControl\FileUpdateEventHandler.cs: Track
- api changes.
-
- * MonoDevelop.VersionControl\VersionControlService.cs: Looks
- like when deserializing, MS.NET can't resolve assemblies
- which are not in the main assembly dir, even if those
- assemblies are already loaded. Added a resolver which
- handles this case.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl\ChangeSet.cs:
- * MonoDevelop.VersionControl\Repository.cs:
- * MonoDevelop.VersionControl\VersionInfo.cs:
- * MonoDevelop.VersionControl\PublishCommand.cs:
- * MonoDevelop.VersionControl.Views\StatusView.cs:
- * MonoDevelop.VersionControl\UnknownRepository.cs:
- * MonoDevelop.VersionControl\VersionControlItem.cs:
- * MonoDevelop.VersionControl.Dialogs\CommitDialog.cs:
- * MonoDevelop.VersionControl\VersionControlSystem.cs:
- * MonoDevelop.VersionControl\VersionControlItemList.cs: Use
- the new FilePath class for handling file and directory
- paths.
-
-2009-04-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/VersionControlNodeExtension.cs:
- * MonoDevelop.VersionControl/VersionControlCommandHandler.cs:
- Added ParentWorkspaceObject to SystemFile and ProjectFolder,
- which replaces the old Project property. It is required
- because now it is possible to show hiddem folders and files
- as children of a solution.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/LogView.cs:
- * MonoDevelop.VersionControl.Views/StatusView.cs:
- * MonoDevelop.VersionControl/VersionControlService.cs: Renamed
- PixbufService to ImageService.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/LogView.cs:
- * MonoDevelop.VersionControl.Views/StatusView.cs:
- * MonoDevelop.VersionControl/VersionControlService.cs: Track
- API changes.
-
-2009-04-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/LogView.cs:
- * MonoDevelop.VersionControl.Views/StatusView.cs: Removed icon
- service.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * VersionControl.addin.xml: Bump MD version.
-
-2009-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/StatusView.cs: Added
- missing translation string.
-
-2009-02-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl.csproj: Flush.
-
-2009-02-27 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * menu_resolve.png:
- * Makefile.am:
- * MonoDevelop.VersionControl.csproj:
- * VersionControl.addin.xml: Add "Resolve" menu icon.
-
-2009-02-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs:
- Translation fixes. Patch from Kriván Bálint.
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/VersionControlNodeExtension.cs:
- Add missing null check.
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/CellRendererDiff.cs:
- Changed override Destroy --> override OnDestroyed.
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/LogView.cs:
- * MonoDevelop.VersionControl.Views/DiffView.cs:
- * MonoDevelop.VersionControl.Views/StatusView.cs:
- * MonoDevelop.VersionControl.Views/CellRendererDiff.cs: Worked
- on ressource de-allocation.
-
-2009-02-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * VersionControl.addin.xml: Track merge of the project pad
- context menu.
-
-2009-02-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/CellRendererDiff.cs:
- Correcty override member.
-
-2009-02-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/DiffView.cs: diff widget
- now gets disposed.
-
-2009-02-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/StatusView.cs:
- * MonoDevelop.VersionControl.Views/CellRendererDiff.cs: Fixed
- "Bug 455892 - Crash when closing tabs".
-
-2009-02-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/StatusView.cs: Added some
- strings to translation.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl.csproj: Don't local-copy other
- addins' dlls.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.mdp:
- * MonoDevelop.VersionControl.csproj: Migrated to MSBuild file
- format.
-
-2009-02-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/ChangeLogWriter.cs: Use the new
- TextFormatter class.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * VersionControl.addin.xml: Bump MD version.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs:
- * gtk-gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs:
- * gtk-gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs:
- *
- gtk-gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs:
- Flush.
-
-2009-02-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl/ChangeSet.cs: Fix for Bug 469828
- - SVN: the local path of the checkout directory get into
- the log message.
-
-2009-02-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl/ChangeSet.cs:
- * MonoDevelop.VersionControl/CommitMessageStyle.cs:
- * MonoDevelop.VersionControl.Dialogs/CommitDialog.cs:
- * MonoDevelop.VersionControl/VersionControlService.cs: Fix
- author info and commit message style defaults.
-
-2009-02-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl/ChangeLogWriter.cs:
- * MonoDevelop.VersionControl/CommitMessageFormat.cs: Add
- mechanism for appending newlines to the message.
-
-2009-01-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * VersionControl.addin.xml: Register policy panel as a default policy
- panel.
-
-2009-01-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl/ChangeSet.cs:
- * MonoDevelop.VersionControl/ChangeLogWriter.cs:
- * MonoDevelop.VersionControl.Dialogs/VersionControlPolicyPanel.cs:
- * MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs:
- Rename UserInformation to AuthorInformation, and change other strings
- correspondingly.
-
- * MonoDevelop.VersionControl.mdp: Updated.
-
-2009-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * Policies.xml:
- * gtk-gui/gui.stetic:
- * gtk-gui/objects.xml:
- * gtk-gui/generated.cs:
- * VersionControl.addin.xml:
- * MonoDevelop.VersionControl.mdp:
- * MonoDevelop.VersionControl/ChangeSet.cs:
- * MonoDevelop.VersionControl/ChangeLogWriter.cs:
- * MonoDevelop.VersionControl/CommitMessageStyle.cs:
- * MonoDevelop.VersionControl/CommitMessageFormat.cs:
- * MonoDevelop.VersionControl/VersionControlPolicy.cs:
- * MonoDevelop.VersionControl.Dialogs/CommitDialog.cs:
- * MonoDevelop.VersionControl/VersionControlService.cs:
- * MonoDevelop.VersionControl.Dialogs/VersionControlPolicyPanel.cs:
- * MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs:
- * gtk-gui/MonoDevelop.VersionControl.CommitMessageStylePanelWidget.cs:
- Added version control policy, which allows setting the commit message
- style.
-
-2009-01-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl.Dialogs/CommitDialog.cs:
- * MonoDevelop.VersionControl/CommitDialogExtension.cs: Add a property
- for CommitDialogExtensions to disallow committing.
-
- * gtk-gui/gui.stetic: Updated.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl.mdp: Flush project format changes.
-
-2009-01-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl/ChangeSet.cs: Use UserInformation API.
-
-2009-01-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/ChangeLogWriter.cs: If there are no
- changelog entries, generate an empty message (don't include the
- headers). Fixes bug #375668 - If no text is entered for any changed
- file, an entry with only name and e-mail is added to the ChangeLog.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.mdp: All projects now require fx 3.5.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.mdp: Don't require a specific version of
- Mono.Addins.
-
-2008-12-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * VersionControl.addin.xml: Hide/protect add-ins.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Make it work for parallel build.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * AssemblyInfo.cs:
- * MonoDevelop.VersionControl.mdp: Add AssemblyInfo.cs files that are
- autogenerated from the addin manifests.
-
-2008-11-14 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * MonoDevelop.VersionControl.Views/LogView.cs: Corrected strings.
-
- * MonoDevelop.VersionControl/RevertCommand.cs: Unset commit messages
- after reverting.
-
-2008-11-14 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * MonoDevelop.VersionControl.Views/LogView.cs: Prevent commit message
- creation when user cancels.
-
-2008-11-13 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * MonoDevelop.VersionControl.Views/LogView.cs: Improve
- Revert[to]revision feature, adding commit messages.
-
-2008-11-13 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * MonoDevelop.VersionControl.Views/LogView.cs: Coding guidelines.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * VersionControl.addin.xml: Bump MD version.
-
-2008-11-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Views/StatusView.cs: Don't crash when
- updating the status of deleted files (there isn't a VersionInfo for
- them after comitting). Fixes bug #437988 - NREs in version control
- addin after commit.
-
-2008-10-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/Repository.cs:
- * MonoDevelop.VersionControl/VersionControlFileSystemExtension.cs: Use
- CanMoveFiles to check if a directory can be moved from one SVN dir to
- another SVN dir. Fixes bug #436289.
-
-2008-10-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * VersionControl.addin.xml:
- * MonoDevelop.VersionControl.mdp:
- * MonoDevelop.VersionControl/Repository.cs:
- * MonoDevelop.VersionControl/LockCommand.cs:
- * MonoDevelop.VersionControl/CommitCommand.cs:
- * MonoDevelop.VersionControl/RevertCommand.cs:
- * MonoDevelop.VersionControl/UnlockCommand.cs:
- * MonoDevelop.VersionControl.Views/LogView.cs:
- * MonoDevelop.VersionControl/UpdateCommand.cs:
- * MonoDevelop.VersionControl.Views/DiffView.cs:
- * MonoDevelop.VersionControl.Views/StatusView.cs:
- * MonoDevelop.VersionControl/UnknownRepository.cs:
- * MonoDevelop.VersionControl/VersionControlItem.cs:
- * MonoDevelop.VersionControl/AddRemoveMoveCommand.cs:
- * MonoDevelop.VersionControl/VersionControlItemList.cs:
- * MonoDevelop.VersionControl/VersionControlNodeExtension.cs:
- * MonoDevelop.VersionControl/VersionControlCommandHandler.cs: Improved
- support for multiple selection in the project pad. Added new
- extension point for the status view context menu.
-
-2008-10-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl/ChangeSet.cs: Commited patch from alan, to
- fix compilation issues with the public mono version.
-
-2008-10-12 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs: Correct a
- string (mhutch agrees).
-
-2008-10-12 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * Makefile.am:
- * MonoDevelop.VersionControl.mdp:
- * MonoDevelop.VersionControl/ChangeSet.cs:
- * MonoDevelop.VersionControl.Views/StatusView.cs: Warn about very
- probable accidental commit situation.
-
-2008-10-12 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * MonoDevelop.VersionControl/ChangeSet.cs:
- * MonoDevelop.VersionControl.Views/StatusView.cs:
- * MonoDevelop.VersionControl/VersionControlService.cs: Coding
- guidelines.
-
-2008-10-12 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * MonoDevelop.VersionControl.Views/LogView.cs: Improve the control of
- what is selected: no sense to revert to *current* rev.
-
-2008-10-12 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * MonoDevelop.VersionControl.Views/LogView.cs: Coding guidelines.
-
-2008-10-07 Aaron Bockover <abockover@novell.com>
-
- * MonoDevelop.VersionControl/ChangeLogWriter.cs: Remove the space
- alignment from the tab indent on the ChangeLog message, preserve it
- for the commit message
-
-2008-10-07 Aaron Bockover <abockover@novell.com>
-
- * MonoDevelop.VersionControl/ChangeSet.cs: Updated to use
- ChangeLogMessageStyle instead of the WriteHeader bool
-
- * MonoDevelop.VersionControl/ChangeLogWriter.cs: Omit files with
- empty/unset messages from the ChangeLog by default; when the GUI
- builder is working again I'll add a preference for this; if the
- ChangeLog is empty, also insert some extra whitespace for easily
- entering commit messages without applying to files; opted for
- ChangeLogMessageStyle enum instead of a bool WriteHeader
-
-2008-10-07 Aaron Bockover <abockover@novell.com>
-
- * MonoDevelop.VersionControl/ChangeSet.cs: Use ChangeLogWriter to
- generate messages instead of the old formatting
-
- * MonoDevelop.VersionControl/ChangeLogWriter.cs: Writes a standard
- ChangeLog file with proper grouping, alignment, word wrapping, and
- spacing; it can produce a commit message without indentation or
- header as well
-
-2008-09-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs,
- gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs,
- gtk-gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs,
- gtk-gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs,
- gtk-gui/gui.stetic: Updated.
- * MonoDevelop.VersionControl/PublishCommand.cs: When publishing a
- solution, use GetItemFiles to get all files to include in the
- commit. Fixes bug #425339 - 'Publish' command should also check in
- the .sln file.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/VersionControlNodeExtension.cs: Moved the
- extensible tree view to its own directory.
-
-2008-08-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Views/StatusView.cs,
- MonoDevelop.VersionControl/Repository.cs,
- MonoDevelop.VersionControl/VersionInfo.cs: Properly show the remote
- status in the status view. Include remote additions and removals.
- Show diff between working copy and repo when remote status is
- requested. All this fixes bug #395284 - SVN plugin: Show Remote
- Status does not work.
-
-2008-08-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs,
- gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs,
- gtk-gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs,
- gtk-gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs,
- gtk-gui/gui.stetic,
- MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs: Fix bug
- #395563 - SVN plugin: Repository Configuration dialog only fills in
- port if arrow buttons pressed.
-
-2008-08-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Views/StatusView.cs: Fix bug #401846 -
- Caught exception closing VersionControl tab before it's done with
- remote operation.
-
-2008-08-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.mdp,
- MonoDevelop.VersionControl.Views/Diffs.cs,
- MonoDevelop.VersionControl.Views/Statuses.cs,
- MonoDevelop.VersionControl.Views/LogView.cs,
- MonoDevelop.VersionControl.Views/StatusView.cs,
- MonoDevelop.VersionControl.Views/DiffView.cs,
- MonoDevelop.VersionControl.Views/Logs.cs, Makefile.am,
- MonoDevelop.VersionControl/UpdateCommand.cs,
- MonoDevelop.VersionControl/Update.cs,
- MonoDevelop.VersionControl/Checkout.cs,
- MonoDevelop.VersionControl/PublishCommand.cs,
- MonoDevelop.VersionControl/Publish.cs,
- MonoDevelop.VersionControl/CheckoutCommand.cs: Renamed some files.
- * gtk-gui/gui.stetic: Updated.
-
-2008-08-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * overlay_locked.png, overlay_unlocked.png,
- MonoDevelop.VersionControl.mdp, VersionControl.addin.xml,
- gtk-gui/objects.xml, gtk-gui/gui.stetic,
- MonoDevelop.VersionControl.Views/Statuses.cs, Makefile.am,
- MonoDevelop.VersionControl/Repository.cs,
- MonoDevelop.VersionControl/CommitCommand.cs,
- MonoDevelop.VersionControl/LockCommand.cs,
- MonoDevelop.VersionControl/VersionStatus.cs,
- MonoDevelop.VersionControl/VersionControlNodeExtension.cs,
- MonoDevelop.VersionControl/UnlockCommand.cs,
- MonoDevelop.VersionControl/Commands.cs,
- MonoDevelop.VersionControl/VersionInfo.cs,
- MonoDevelop.VersionControl/Task.cs,
- MonoDevelop.VersionControl/VersionControlService.cs,
- overlay_lock_required.png: Add support for locking/unlocking, and
- for on-demand unlocking (RequestFileEdit event).
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl/Update.cs,
- MonoDevelop.VersionControl/RevertRevisionsCommands.cs,
- MonoDevelop.VersionControl/AddRemoveMoveCommand.cs,
- MonoDevelop.VersionControl/RevertCommand.cs: Translated old code to
- new dom.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/Repository.cs,
- MonoDevelop.VersionControl/UnknownRepository.cs,
- MonoDevelop.VersionControl/UrlBasedRepository.cs,
- MonoDevelop.VersionControl/VersionControlConfiguration.cs,
- MonoDevelop.VersionControl/VersionControlService.cs: Moved
- serialization engine to MonoDevelop.Core. Use new syntax for
- specifying attribute scope.
-
-2008-07-06 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- Implement feature in bug#394434: "Revert [to] revision".
- * MonoDevelop.VersionControl.mdp, Makefile.am: Add the new file
- RevertRevisionsCommands.
- * MonoDevelop.VersionControl.Views/Logs.cs: Adding the new buttons to
- the Log view.
- * MonoDevelop.VersionControl/Repository.cs: New abstract methods
- Revert[To]Revision.
- * MonoDevelop.VersionControl/RevertRevisionsCommands.cs: Add new file.
- * MonoDevelop.VersionControl/UnknownRepository.cs: Empty
- implementations for Revert[To]Revision.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * VersionControl.addin.xml: Bump MD version.
-
-2008-06-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Dialogs/CommitDialog.cs: Use the
- OnDestroyed event instead of Dispose, since with the latest changes
- in gtk#, Dispose is not called anymore when a widget is destroyed.
-
-2008-05-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * VersionControl.addin.xml: Set a better label for the Status/Commit
- command.
- * MonoDevelop.VersionControl/VersionControlService.cs: When adding the
- files of a project, add subfolders when needed. Fixes bug 393190 -
- Exception when creating new Gtk#/Stetic project if under version
- control.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * VersionControl.addin.xml: Added version control menu to workspace
- context menu.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.mdp, VersionControl.addin.xml,
- Makefile.am,
- MonoDevelop.VersionControl/VersionControlFileSystemExtension.cs,
- MonoDevelop.VersionControl/VersionControlNodeExtension.cs,
- MonoDevelop.VersionControl/Checkout.cs,
- MonoDevelop.VersionControl/Publish.cs,
- MonoDevelop.VersionControl/VersionControlService.cs: New project
- model changes.
-
-2008-05-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Set correct target version.
-
-2008-04-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.mdp: Removed unneeded reference.
-
-2008-03-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs,
- gtk-gui/gui.stetic: Use commit icon in the ok button of the commit
- dialog.
- * MonoDevelop.VersionControl/Publish.cs: Improved message dialog.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
-
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl/Update.cs,
- MonoDevelop.VersionControl/CommitCommand.cs,
- MonoDevelop.VersionControl/AddRemoveMoveCommand.cs,
- MonoDevelop.VersionControl/Task.cs,
- MonoDevelop.VersionControl/Checkout.cs,
- MonoDevelop.VersionControl/Publish.cs: Added some getstring calls
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl/RevertCommand.cs: Added secondary text to the
- revert dialog.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * VersionControl.addin.xml: Changed file menu for hig.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Dialogs/CommitDialog.cs,
- MonoDevelop.VersionControl.Views/Statuses.cs,
- MonoDevelop.VersionControl.Views/Logs.cs,
- MonoDevelop.VersionControl/CommitCommand.cs,
- MonoDevelop.VersionControl/VersionControlNodeExtension.cs,
- MonoDevelop.VersionControl/RevertCommand.cs,
- MonoDevelop.VersionControl/Publish.cs,
- MonoDevelop.VersionControl/VersionControlService.cs: Worked on gnome hig
- compliant alerts.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * VersionControl.addin.xml: Added many shortcuts.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.VersionControl.Views/Statuses.cs: Added some gettext calls.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic: Refactored status bar.
-
-2008-02-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs: Don't
- disable the name entry when creating a new repo. Fixes bug #363858.
-
-2008-02-05 Mike Krüger <mkrueger@novell.com>
-
- * VersionControl.addin.xml: Changed main menu items.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * VersionControl.addin.xml: Update MD version.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs:
- Flush.
-
-2008-01-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/AddRemoveMoveCommand.cs:
- NotifyFileStatusChanged is now gui thread safe, so no need to invoke it
- through Gtk.Application.Invoke.
-
-2008-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * VersionControl.addin.xml: Updated add-in category and description.
-
-2008-01-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/VersionControlService.cs: Make sure file status
- change events are always fired in the gui thread.
-
-2008-01-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/RevertCommand.cs: Notify file changes through
- the FileService.
-
-2008-01-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Views/Statuses.cs: Removed colorize method. Not
- needed anymore.
- * MonoDevelop.VersionControl.Views/CellRendererDiff.cs: Changed the way
- diffs are rendered. Instead of having a big pango layout with all text,
- now we render text line by line, skipping lines which are not visible.
- Coloring is done changing the GC, instead of using markup. Fixes bug
- #353705 and improves performance.
-
-2008-01-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/Checkout.cs,
- MonoDevelop.VersionControl/Publish.cs,
- MonoDevelop.VersionControl/VersionControlService.cs: If there isn't any
- supported version control system installed, show a message saying that,
- instead of showing a Select Repository dialog with an empty combo. Fixes
- bug #344841.
- * MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs: Select the
- first vcs type by default.
-
-2008-01-07 Andreia Gaita <avidigal@novell.com>
-
- * MonoDevelop.VersionControl.Views/Diffs.cs: Change the diff algorithm
- call to have case-sensitive diffs.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.mdp: Updated project files. The order of
- extended properties won't change anymore.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Views/Diffs.cs,
- MonoDevelop.VersionControl.Views/CellRendererDiff.cs,
- MonoDevelop.VersionControl.Views/Logs.cs: Moved PlatformService to
- MD.Core.Gui. Removed old FileIconService class, which is now implemented
- in PlatformService.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.mdp,
- MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs,
- MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs,
- MonoDevelop.VersionControl.Dialogs/CommitDialog.cs,
- gtk-gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs,
- gtk-gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs,
- gtk-gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs,
- gtk-gui/gui.stetic, MonoDevelop.VersionControl.Views/Diffs.cs,
- MonoDevelop.VersionControl.Views/Statuses.cs,
- MonoDevelop.VersionControl.Views/Logs.cs, Makefile.am,
- MonoDevelop.VersionControl/Update.cs,
- MonoDevelop.VersionControl/CommitCommand.cs,
- MonoDevelop.VersionControl/VersionControlFileSystemExtension.cs,
- MonoDevelop.VersionControl/VersionControlNodeExtension.cs,
- MonoDevelop.VersionControl/VersionControlSystem.cs,
- MonoDevelop.VersionControl/AddRemoveMoveCommand.cs,
- MonoDevelop.VersionControl/VersionControlProjectService.cs,
- MonoDevelop.VersionControl/ChangeSet.cs,
- MonoDevelop.VersionControl/Task.cs,
- MonoDevelop.VersionControl/Checkout.cs,
- MonoDevelop.VersionControl/BaseView.cs,
- MonoDevelop.VersionControl/RevertCommand.cs,
- MonoDevelop.VersionControl/Publish.cs,
- MonoDevelop.VersionControl/VersionControlService.cs: API cleanup.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * VersionControl.addin.xml: Bump add-in versions.
-
-2007-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/VersionControlService.cs: Check if Subversion
- is installed in a nicer way. Fixes bug #342507.
-
-2007-12-06 Geoff Norton <gnorton@novell.com>
-
- * MonoDevelop.VersionControl.Views/CellRendererDiff.cs:
- * MonoDevelop.VersionControl.Views/Diffs.cs:
- * MonoDevelop.VersionControl.Views/Logs.cs: Use the PlatformService to get
- font and mime information instead of GConf / Gnome.Vfs directly
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.mdp, VersionControl.addin.xml, Makefile.am:
- Directory reorganization.
-
-2007-12-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/VersionControlProjectService.cs: Save comments
- in a background thread and only after a small delay (avoids saving too
- often). Should fix bug #324986.
-
-2007-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/Repository.cs,
- MonoDevelop.VersionControl/VersionControlFileSystemExtension.cs,
- MonoDevelop.VersionControl/UrlBasedRepository.cs: In some cases it may
- be possible to natively move files between two repositories (e.g. if
- they are in the same server). Added a virtual method to check that and
- implemented it for SVN.
- * MonoDevelop.VersionControl/VersionControlNodeExtension.cs: Add support for
- version control commands for all kinds of combine entries, not only
- Project and Combine.
-
-2007-11-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl.Views/Logs.cs: Don't disable the view if
- version info is not found for the file/folder. Just hide the buttons.
- Fixes bug #324953.
-
-2007-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs,
- MonoDevelop.VersionControl.Views/Statuses.cs,
- MonoDevelop.VersionControl/CommitCommand.cs,
- MonoDevelop.VersionControl/VersionControlNodeExtension.cs,
- MonoDevelop.VersionControl/VersionControlProjectService.cs,
- MonoDevelop.VersionControl/RevertCommand.cs: Track LoggingService API
- changes.
-
-2007-11-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.VersionControl/Publish.cs: Use RootCombine instead of
- CurrentOpenCombine when possible.
-
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitDialog.cs
index 437ef02106..81ed7aaef2 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitDialog.cs
@@ -88,7 +88,7 @@ namespace MonoDevelop.VersionControl.Dialogs
foreach (object ob in exts) {
CommitDialogExtension ext = ob as CommitDialogExtension;
if (ext == null) {
- MessageService.ShowError ("Commit extension type " + ob.GetType() + " must be a subclass of CommitDialogExtension");
+ LoggingService.LogError ("Commit extension type " + ob.GetType() + " must be a subclass of CommitDialogExtension");
continue;
}
if (ext.Initialize (changeSet)) {
@@ -196,7 +196,7 @@ namespace MonoDevelop.VersionControl.Dialogs
GettextCatalog.GetString ("Do you want to save the changes before committing?"),
new AlertButton[] {
AlertButton.Cancel,
- new AlertButton ("Don't Save"),
+ new AlertButton (GettextCatalog.GetString ("Don't Save")),
AlertButton.Save
}
);
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs
index 79a73b6d11..63c8b5dbcf 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs
@@ -136,8 +136,7 @@ namespace MonoDevelop.VersionControl
void OnChanged ()
{
UpdatePreview ();
- if (Changed != null)
- Changed (this, EventArgs.Empty);
+ Changed?.Invoke (this, EventArgs.Empty);
}
protected virtual void OnCheckUseBulletsToggled (object sender, System.EventArgs e)
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs
index 091af96b7b..5f99489b62 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs
@@ -22,7 +22,7 @@ namespace MonoDevelop.VersionControl.Dialogs
editor = repo.VersionControlSystem.CreateRepositoryEditor (repo);
repoEditorContainer.Add (editor.Widget);
- editor.Widget.Show ();
+ editor.Show ();
}
else {
foreach (VersionControlSystem vcs in VersionControlService.GetVersionControlSystems ()) {
@@ -65,7 +65,7 @@ namespace MonoDevelop.VersionControl.Dialogs
repo.NameChanged += OnNameChanged;
editor = vcs.CreateRepositoryEditor (repo);
repoEditorContainer.Add (editor.Widget);
- editor.Widget.Show ();
+ editor.Show ();
entryName.Sensitive = true;
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs
index a514938b0e..e5644ec15e 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs
@@ -25,7 +25,8 @@ namespace MonoDevelop.VersionControl.Dialogs
List<Repository> loadingRepos = new List<Repository> ();
IRepositoryEditor currentEditor;
string defaultPath;
-
+ public readonly ConfigurationProperty<string> VersionControlDefaultPath = ConfigurationProperty.Create ("MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.DefaultPath", System.IO.Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), "Projects"));
+
const int RepositoryCol = 0;
const int RepoNameCol = 1;
const int VcsName = 2;
@@ -59,14 +60,15 @@ namespace MonoDevelop.VersionControl.Dialogs
repoTree.AppendColumn (GettextCatalog.GetString ("Type"), new CellRendererText (), "text", VcsName);
repoTree.TestExpandRow += new Gtk.TestExpandRowHandler (OnTestExpandRow);
LoadRepositories ();
-
+
if (mode == SelectRepositoryMode.Checkout) {
labelName.Visible = false;
entryName.Visible = false;
boxMessage.Visible = false;
labelMessage.Visible = false;
- defaultPath = PropertyService.Get ("MonoDevelop.Core.Gui.Dialogs.NewProjectDialog.DefaultPath", Environment.GetFolderPath (Environment.SpecialFolder.Personal));
+ defaultPath = VersionControlDefaultPath;
entryFolder.Text = defaultPath;
+ buttonOk.Label = GettextCatalog.GetString ("_Checkout");
} else {
labelTargetDir.Visible = false;
boxFolder.Visible = false;
@@ -121,7 +123,7 @@ namespace MonoDevelop.VersionControl.Dialogs
repo = vcs.CreateRepositoryInstance ();
currentEditor = vcs.CreateRepositoryEditor (repo);
repoContainer.Add (currentEditor.Widget);
- currentEditor.Widget.Show ();
+ currentEditor.Show ();
UrlBasedRepositoryEditor edit = currentEditor as UrlBasedRepositoryEditor;
if (edit != null)
edit.PathChanged += OnPathChanged;
@@ -322,6 +324,7 @@ namespace MonoDevelop.VersionControl.Dialogs
var dlg = new MonoDevelop.Components.SelectFolderDialog (GettextCatalog.GetString ("Select target directory"));
if (dlg.Run ()) {
defaultPath = dlg.SelectedFile;
+ VersionControlDefaultPath.Value = defaultPath;
AppendRelativePath ();
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlGeneralOptionsPanel.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlGeneralOptionsPanel.cs
index 7fd5e9adf6..52c06c78d8 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlGeneralOptionsPanel.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlGeneralOptionsPanel.cs
@@ -34,7 +34,7 @@ namespace MonoDevelop.VersionControl
{
Xwt.CheckBox disableVersionControl;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
Xwt.VBox box = new Xwt.VBox ();
box.Spacing = 6;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlPolicyPanel.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlPolicyPanel.cs
index aeb604d3e7..3ff75dc197 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlPolicyPanel.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlPolicyPanel.cs
@@ -25,7 +25,7 @@
//
//
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
@@ -37,7 +37,7 @@ namespace MonoDevelop.VersionControl
CommitMessageStylePanelWidget widget;
CommitMessageFormat format;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
format = new CommitMessageFormat ();
widget = new CommitMessageStylePanelWidget ();
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlSolutionOptionsPanel.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlSolutionOptionsPanel.cs
index f97e1570c6..709c490693 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlSolutionOptionsPanel.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/VersionControlSolutionOptionsPanel.cs
@@ -35,7 +35,7 @@ namespace MonoDevelop.VersionControl
{
Xwt.CheckBox disableVersionControl;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
Xwt.VBox box = new Xwt.VBox ();
box.Spacing = 6;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BaseView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BaseView.cs
index 26462b2335..94b15ee525 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BaseView.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BaseView.cs
@@ -1,97 +1,18 @@
-using System;
-using System.IO;
using MonoDevelop.Ide.Gui;
-
+
namespace MonoDevelop.VersionControl
{
- public abstract class BaseView : AbstractBaseViewContent, IViewContent
+ public abstract class BaseView : ViewContent
{
- string name;
-
- protected BaseView (string name)
- {
- this.name = name;
- }
-
- protected virtual void SaveAs (string fileName)
- {
- }
+ readonly string name;
- void IViewContent.Load (string fileName)
- {
- throw new InvalidOperationException();
- }
-
- void IViewContent.LoadNew (Stream stream, string mimeType)
- {
- throw new InvalidOperationException ();
- }
-
- void IViewContent.Save ()
- {
- throw new InvalidOperationException ();
- }
-
- void IViewContent.DiscardChanges ()
- {
- }
-
- void IViewContent.Save (string fileName)
+ protected BaseView (string name)
{
- SaveAs (fileName);
- }
-
- string IViewContent.ContentName {
- get { return name; }
- set { }
- }
-
- bool IViewContent.IsDirty {
- get { return false; }
- set { }
- }
-
- bool IViewContent.IsReadOnly {
- get { return true; }
- }
-
- bool IViewContent.IsUntitled {
- get { return false; }
- }
-
- bool IViewContent.IsViewOnly {
- get { return false; }
+ ContentName = this.name = name;
}
-
- bool IViewContent.IsFile {
- get { return false; }
- }
-
- string IViewContent.PathRelativeToProject {
- get { return ""; }
- }
-
- MonoDevelop.Projects.Project IViewContent.Project {
- get { return null; }
- set { }
- }
-
+
public override string TabPageLabel {
get { return name; }
}
-
- public virtual string StockIconId {
- get { return null; }
- }
-
- string IViewContent.UntitledName {
- get { return ""; }
- set { }
- }
-
- event EventHandler IViewContent.BeforeSave { add { } remove { } }
- event EventHandler IViewContent.ContentChanged { add { } remove { } }
- event EventHandler IViewContent.ContentNameChanged { add { } remove { } }
- event EventHandler IViewContent.DirtyChanged { add { } remove { } }
}
} \ No newline at end of file
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameView.cs
index ee6571fb78..cc5c598cc8 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameView.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameView.cs
@@ -1,21 +1,21 @@
-//
+//
// BlameView.cs
-//
+//
// Author:
// Mike Krüger <mkrueger@novell.com>
-//
+//
// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
-//
+//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
-//
+//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
-//
+//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -23,23 +23,23 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using System;
-using MonoDevelop.Ide.Gui;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Content;
using Mono.TextEditor;
+
namespace MonoDevelop.VersionControl.Views
{
- public interface IBlameView : IAttachableViewContent
+ public interface IBlameView
{
}
- internal class BlameView : BaseView, IBlameView, IUndoHandler, IClipboardHandler
+ internal class BlameView : BaseView, IBlameView, IClipboardHandler
{
BlameWidget widget;
VersionControlDocumentInfo info;
- public override Gtk.Widget Control {
+ public override Control Control {
get {
if (widget == null)
widget = new BlameWidget (info);
@@ -53,67 +53,36 @@ namespace MonoDevelop.VersionControl.Views
}
#region IAttachableViewContent implementation
- public void Selected ()
+ protected override void OnSelected ()
{
info.Start ();
- var sourceEditor = info.Document.GetContent <MonoDevelop.SourceEditor.SourceEditorView> ();
- if (sourceEditor != null) {
- widget.Editor.Caret.Location = sourceEditor.TextEditor.Caret.Location;
- widget.Editor.VAdjustment.Value = sourceEditor.TextEditor.VAdjustment.Value;
+ BlameWidget widget = Control.GetNativeWidget<BlameWidget> ();
+ widget.Reset ();
+
+ var buffer = info.Document.GetContent<MonoDevelop.Ide.Editor.TextEditor> ();
+ if (buffer != null) {
+ var loc = buffer.CaretLocation;
+ int line = loc.Line < 1 ? 1 : loc.Line;
+ int column = loc.Column < 1 ? 1 : loc.Column;
+ widget.Editor.SetCaretTo (line, column, highlight: false, centerCaret: false);
}
}
- public void Deselected ()
- {
- var sourceEditor = info.Document.GetContent <MonoDevelop.SourceEditor.SourceEditorView> ();
- if (sourceEditor != null) {
- sourceEditor.TextEditor.Caret.Location = widget.Editor.Caret.Location;
- sourceEditor.TextEditor.VAdjustment.Value = widget.Editor.VAdjustment.Value;
- }
- }
-
- public void BeforeSave ()
- {
- }
-
- public void BaseContentChanged ()
- {
- }
- #endregion
-
- #region IUndoHandler implementation
- void IUndoHandler.Undo ()
- {
- this.widget.Editor.Document.Undo ();
- }
-
- void IUndoHandler.Redo ()
- {
- this.widget.Editor.Document.Redo ();
- }
-
- IDisposable IUndoHandler.OpenUndoGroup ()
+ protected override void OnDeselected ()
{
- return this.widget.Editor.OpenUndoGroup ();
- }
-
- bool IUndoHandler.EnableUndo {
- get {
- return this.widget.Editor.Document.CanUndo;
+ var buffer = info.Document.GetContent<MonoDevelop.Ide.Editor.TextEditor> ();
+ if (buffer != null) {
+ BlameWidget widget = Control.GetNativeWidget<BlameWidget> ();
+ buffer.SetCaretLocation (widget.Editor.Caret.Line, widget.Editor.Caret.Column, usePulseAnimation: false, centerCaret: false);
+ buffer.ScrollTo (new Ide.Editor.DocumentLocation (widget.Editor.YToLine (widget.Editor.VAdjustment.Value), 1));
}
}
- bool IUndoHandler.EnableRedo {
- get {
- return this.widget.Editor.Document.CanRedo;
- }
- }
#endregion
#region IClipboardHandler implementation
void IClipboardHandler.Cut ()
{
- this.widget.Editor.RunAction (ClipboardActions.Cut);
}
void IClipboardHandler.Copy ()
@@ -123,16 +92,10 @@ namespace MonoDevelop.VersionControl.Views
void IClipboardHandler.Paste ()
{
- this.widget.Editor.RunAction (ClipboardActions.Paste);
}
void IClipboardHandler.Delete ()
{
- if (this.widget.Editor.IsSomethingSelected) {
- this.widget.Editor.DeleteSelectedText ();
- } else {
- this.widget.Editor.RunAction (DeleteActions.Delete);
- }
}
void IClipboardHandler.SelectAll ()
@@ -142,7 +105,7 @@ namespace MonoDevelop.VersionControl.Views
bool IClipboardHandler.EnableCut {
get {
- return this.widget.Editor.IsSomethingSelected;
+ return false;
}
}
@@ -154,13 +117,13 @@ namespace MonoDevelop.VersionControl.Views
bool IClipboardHandler.EnablePaste {
get {
- return true;
+ return false;
}
}
bool IClipboardHandler.EnableDelete {
get {
- return true;
+ return false;
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs
index ef94cc2166..ce3798cbda 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs
@@ -1,21 +1,21 @@
-//
+//
// BlameWidget.cs
-//
+//
// Author:
// Mike Krüger <mkrueger@novell.com>
-//
+//
// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
-//
+//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
-//
+//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
-//
+//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -33,18 +33,22 @@ using Mono.TextEditor;
using MonoDevelop.Ide;
using System.Threading;
using MonoDevelop.Core;
+using MonoDevelop.Components;
using MonoDevelop.Components.Commands;
+using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.VersionControl.Views
{
public enum BlameCommands {
CopyRevision,
ShowDiff,
- ShowLog
+ ShowLog,
+ ShowBlameBefore
}
public class BlameWidget : Bin
{
+ Revision revision;
Adjustment vAdjustment;
Gtk.VScrollbar vScrollBar;
@@ -53,7 +57,7 @@ namespace MonoDevelop.VersionControl.Views
BlameRenderer overview;
- TextEditor editor;
+ MonoTextEditor editor;
List<ContainerChild> children = new List<ContainerChild> ();
public Adjustment Vadjustment {
@@ -74,7 +78,7 @@ namespace MonoDevelop.VersionControl.Views
}
}
- public TextEditor Editor {
+ public MonoTextEditor Editor {
get {
return this.editor;
}
@@ -122,8 +126,12 @@ namespace MonoDevelop.VersionControl.Views
hScrollBar = new HScrollbar (hAdjustment);
AddChild (hScrollBar);
-
- editor = new TextEditor (sourceEditor.TextEditor.Document, sourceEditor.TextEditor.Options);
+
+ var doc = new TextDocument (sourceEditor.TextEditor.Document.Text) {
+ ReadOnly = true,
+ MimeType = sourceEditor.TextEditor.Document.MimeType,
+ };
+ editor = new MonoTextEditor (doc, sourceEditor.TextEditor.Options);
AddChild (editor);
editor.SetScrollAdjustments (hAdjustment, vAdjustment);
@@ -146,6 +154,12 @@ namespace MonoDevelop.VersionControl.Views
editor.DoPopupMenu = ShowPopup;
Show ();
}
+
+ internal void Reset ()
+ {
+ revision = null;
+ overview.UpdateAnnotations ();
+ }
void ShowPopup (EventButton evt)
{
@@ -277,7 +291,6 @@ namespace MonoDevelop.VersionControl.Views
double startY = Editor.LineToY (startLine);
double curY = startY - Editor.VAdjustment.Value;
int line = startLine;
- var color = Style.Dark (State);
while (curY < editor.Allocation.Bottom && line <= editor.LineCount) {
Annotation ann = line <= overview.annotations.Count ? overview.annotations[line - 1] : null;
@@ -292,10 +305,7 @@ namespace MonoDevelop.VersionControl.Views
if (ann != null && overview.highlightAnnotation.Revision == ann.Revision && curStart <= overview.highlightPositon && overview.highlightPositon < curY) {
} else {
cr.Rectangle (Editor.TextViewMargin.XOffset, curStart + cr.LineWidth, Editor.Allocation.Width - Editor.TextViewMargin.XOffset, curY - curStart - cr.LineWidth);
- cr.SetSourceRGBA (color.Red / (double)ushort.MaxValue,
- color.Green / (double)ushort.MaxValue,
- color.Blue / (double)ushort.MaxValue,
- 0.1);
+ cr.SetSourceColor (Styles.BlameView.RangeHazeColor.ToCairoColor ());
cr.Fill ();
}
@@ -304,10 +314,7 @@ namespace MonoDevelop.VersionControl.Views
cr.MoveTo (Editor.TextViewMargin.XOffset, curY + 0.5);
cr.LineTo (Editor.Allocation.Width, curY + 0.5);
- cr.SetSourceRGBA (color.Red / (double)ushort.MaxValue,
- color.Green / (double)ushort.MaxValue,
- color.Blue / (double)ushort.MaxValue,
- 0.2);
+ cr.SetSourceColor (Styles.BlameView.RangeSplitterColor.ToCairoColor ());
cr.Stroke ();
}
}
@@ -338,8 +345,6 @@ namespace MonoDevelop.VersionControl.Views
class BlameRenderer : DrawingArea
{
- static readonly Annotation locallyModified = new Annotation ("", "?", DateTime.MinValue);
-
BlameWidget widget;
internal List<Annotation> annotations;
Pango.Layout layout;
@@ -356,8 +361,6 @@ namespace MonoDevelop.VersionControl.Views
UpdateAnnotations ();
// widget.Document.Saved += UpdateAnnotations;
document = widget.Editor.Document;
- document.TextReplacing += EditorDocumentTextReplacing;
- document.LineChanged += EditorDocumentLineChanged;
widget.vScrollBar.ValueChanged += OnWidgetChanged;
layout = new Pango.Layout (PangoContext);
@@ -373,8 +376,7 @@ namespace MonoDevelop.VersionControl.Views
public void OptionsChanged ()
{
- var description = Pango.FontDescription.FromString ("Tahoma " + (int)(10 * widget.Editor.Options.Zoom));
- layout.FontDescription = description;
+ layout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11);
UpdateWidth ();
}
@@ -383,8 +385,6 @@ namespace MonoDevelop.VersionControl.Views
base.OnDestroyed ();
// widget.Document.Saved -= UpdateAnnotations;
if (document != null) {
- document.TextReplacing -= EditorDocumentTextReplacing;
- document.LineChanged -= EditorDocumentLineChanged;
document = null;
}
if (layout != null) {
@@ -444,6 +444,7 @@ namespace MonoDevelop.VersionControl.Views
CommandEntrySet opset = new CommandEntrySet ();
opset.AddItem (BlameCommands.ShowDiff);
opset.AddItem (BlameCommands.ShowLog);
+ opset.AddItem (BlameCommands.ShowBlameBefore);
opset.AddItem (Command.Separator);
opset.AddItem (BlameCommands.CopyRevision);
IdeApp.CommandService.ShowContextMenu (this, evnt, opset, this);
@@ -480,7 +481,9 @@ namespace MonoDevelop.VersionControl.Views
DiffView diffView = view.GetContent<DiffView> ();
if (diffView != null) {
view.Select ();
- var rev = widget.info.History.FirstOrDefault (h => h.ToString () == menuAnnotation.Revision);
+ if (menuAnnotation.Revision == null)
+ return;
+ var rev = widget.info.History.FirstOrDefault (h => h == menuAnnotation.Revision);
if (rev == null)
return;
diffView.ComparisonWidget.SetRevision (diffView.ComparisonWidget.DiffEditor, rev.GetPrevious ());
@@ -499,7 +502,9 @@ namespace MonoDevelop.VersionControl.Views
LogView logView = view.GetContent<LogView> ();
if (logView != null) {
view.Select ();
- var rev = widget.info.History.FirstOrDefault (h => h.ToString () == menuAnnotation.Revision);
+ if (menuAnnotation.Revision == null)
+ return;
+ var rev = widget.info.History.FirstOrDefault (h => h == menuAnnotation.Revision);
if (rev == null)
return;
logView.LogWidget.SelectedRevision = rev;
@@ -507,7 +512,33 @@ namespace MonoDevelop.VersionControl.Views
}
}
}
-
+
+ [CommandHandler (BlameCommands.ShowBlameBefore)]
+ protected void OnShowBlameBefore ()
+ {
+ var current = menuAnnotation?.Revision;
+ Revision rev;
+
+ if (current == null) {
+ rev = widget.info.History.FirstOrDefault ();
+ } else {
+ rev = current?.GetPrevious ();
+ }
+
+ if (rev == null)
+ return;
+
+ widget.revision = rev;
+ UpdateAnnotations ();
+ }
+
+ [CommandUpdateHandler (BlameCommands.ShowBlameBefore)]
+ protected void OnUpdateShowBlameBefore (CommandInfo cinfo)
+ {
+ var current = menuAnnotation?.Revision;
+ // If we have a working copy segment or we have a parent commit.
+ cinfo.Enabled = current == null || current.GetPrevious () != null;
+ }
protected override bool OnButtonReleaseEvent (EventButton evnt)
{
@@ -526,10 +557,10 @@ namespace MonoDevelop.VersionControl.Views
StatusBarContext ctx = IdeApp.Workbench.StatusBar.CreateContext ();
ctx.AutoPulse = true;
ctx.ShowMessage ("md-version-control", GettextCatalog.GetString ("Retrieving history"));
-
+
ThreadPool.QueueUserWorkItem (delegate {
- try {
- annotations = new List<Annotation> (widget.VersionControlItem.Repository.GetAnnotations (widget.Document.FileName));
+ try {
+ annotations = new List<Annotation> (widget.VersionControlItem.Repository.GetAnnotations (widget.Document.FileName, widget.revision));
// for (int i = 0; i < annotations.Count; i++) {
// Annotation varname = annotations[i];
@@ -541,7 +572,18 @@ namespace MonoDevelop.VersionControl.Views
LoggingService.LogError ("Error retrieving history", ex);
}
- DispatchService.GuiDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
+ var location = widget.Editor.Caret.Location;
+ var adj = widget.editor.VAdjustment.Value;
+ if (widget.revision != null) {
+ document.Text = widget.VersionControlItem.Repository.GetTextAtRevision (widget.Document.FileName, widget.revision);
+ } else {
+ document.Text = widget.Document.Editor.Text;
+ }
+ widget.editor.Caret.Location = location;
+ widget.editor.VAdjustment.Value = adj;
+
+ ctx.AutoPulse = false;
ctx.Dispose ();
UpdateWidth ();
QueueDraw ();
@@ -550,63 +592,6 @@ namespace MonoDevelop.VersionControl.Views
}
/// <summary>
- /// Marks a line as locally modified
- /// </summary>
- private void EditorDocumentLineChanged (object sender, LineEventArgs e)
- {
- int startLine = widget.Editor.Document.OffsetToLineNumber (e.Line.Offset);
- SetAnnotation (startLine, locallyModified);
- }
-
- /// <summary>
- /// Marks necessary lines modified when text is replaced
- /// </summary>
- private void EditorDocumentTextReplacing (object sender, DocumentChangeEventArgs e)
- {
- int startLine = widget.Editor.Document.OffsetToLineNumber (e.Offset),
- endLine = widget.Editor.Document.OffsetToLineNumber (e.Offset + Math.Max (e.RemovalLength, e.InsertionLength)),
- lineCount = 0;
- string[] tokens = null;
-
- if (startLine < endLine) {
- // change crosses line boundary
-
- lineCount = endLine - startLine;
- lineCount = Math.Min (lineCount, annotations.Count - startLine);
-
- if (lineCount > 0)
- annotations.RemoveRange (startLine - 1, lineCount);
- if (!string.IsNullOrEmpty (e.InsertedText.Text)) {
- for (int i=0; i<lineCount; ++i)
- annotations.Insert (startLine - 1, locallyModified);
- }
- return;
- } else if (0 == e.RemovalLength) {
- // insert
- tokens = e.InsertedText.Text.Split (new string[]{Environment.NewLine}, StringSplitOptions.None);
- lineCount = tokens.Length - 1;
- for (int i=0; i<lineCount; ++i) {
- annotations.Insert (Math.Min (startLine, annotations.Count), locallyModified);
- }
- } else if (startLine > endLine) {
- // revert
- UpdateAnnotations ();
- return;
- }
-
- SetAnnotation (startLine, locallyModified);
- }
-
- void SetAnnotation (int index, Annotation text)
- {
- if (index < 0)
- return;
- for (int i = annotations.Count; i <= index; ++i)
- annotations.Add (locallyModified);
- annotations[index] = text;
- }
-
- /// <summary>
/// Gets the commit message matching a given annotation index.
/// </summary>
internal string GetCommitMessage (int index, bool tooltip)
@@ -615,7 +600,7 @@ namespace MonoDevelop.VersionControl.Views
var history = widget.info.History;
if (null != history && annotation != null) {
foreach (Revision rev in history) {
- if (rev.ToString () == annotation.Revision) {
+ if (rev == annotation.Revision) {
if (tooltip && annotation.HasEmail)
return String.Format ("Email: {0}{1}{2}", annotation.Email, Environment.NewLine, rev.Message);
return rev.Message;
@@ -666,7 +651,7 @@ namespace MonoDevelop.VersionControl.Views
layout.SetText (note.Date.ToShortDateString ());
layout.GetPixelSize (out dateTimeLength, out height);
}
- layout.SetText (note.Author + TruncRevision (note.Revision));
+ layout.SetText (note.Author + TruncRevision (note.Text));
layout.GetPixelSize (out tmpwidth, out height);
width = Math.Max (width, tmpwidth);
}
@@ -685,7 +670,7 @@ namespace MonoDevelop.VersionControl.Views
cr.LineWidth = Math.Max (1.0, widget.Editor.Options.Zoom);
cr.Rectangle (leftSpacer, 0, Allocation.Width, Allocation.Height);
- cr.SetSourceRGB (0.95, 0.95, 0.95);
+ cr.SetSourceColor (Styles.BlameView.AnnotationBackgroundColor.ToCairoColor ());
cr.Fill ();
int startLine = widget.Editor.YToLine ((int)widget.Editor.VAdjustment.Value);
@@ -711,29 +696,34 @@ namespace MonoDevelop.VersionControl.Views
double nextY = widget.editor.LineToY (line) - widget.editor.VAdjustment.Value;
if (highlightAnnotation != null && highlightAnnotation.Revision == ann.Revision && curStart <= highlightPositon && highlightPositon < nextY) {
cr.Rectangle (leftSpacer, curStart + cr.LineWidth, Allocation.Width - leftSpacer, nextY - curStart - cr.LineWidth);
- cr.SetSourceRGB (1, 1, 1);
+ cr.SetSourceColor (Styles.BlameView.AnnotationHighlightColor.ToCairoColor ());
cr.Fill ();
}
// use a fixed size revision to get a approx. revision width
layout.SetText ("88888888");
layout.GetPixelSize (out revisionWidth, out h);
- layout.SetText (TruncRevision (ann.Revision));
- e.Window.DrawLayout (Style.BlackGC, Allocation.Width - revisionWidth - margin, (int)(curY + (widget.Editor.LineHeight - h) / 2), layout);
+ layout.SetText (TruncRevision (ann.Text));
const int dateRevisionSpacing = 16;
- if (ann.HasDate) {
- string dateTime = ann.Date.ToShortDateString ();
- // use a fixed size date to get a approx. date width
- layout.SetText (new DateTime (1999, 10, 10).ToShortDateString ());
- layout.GetPixelSize (out dateWidth, out h);
- layout.SetText (dateTime);
- e.Window.DrawLayout (Style.BlackGC, Allocation.Width - revisionWidth - margin - revisionWidth - dateRevisionSpacing, (int)(curY + (widget.Editor.LineHeight - h) / 2), layout);
+
+ using (var gc = new Gdk.GC (e.Window)) {
+ gc.RgbFgColor = Styles.BlameView.AnnotationTextColor.ToGdkColor ();
+ e.Window.DrawLayout (gc, Allocation.Width - revisionWidth - margin, (int)(curY + (widget.Editor.LineHeight - h) / 2), layout);
+
+ if (ann.HasDate) {
+ string dateTime = ann.Date.ToShortDateString ();
+ // use a fixed size date to get a approx. date width
+ layout.SetText (new DateTime (1999, 10, 10).ToShortDateString ());
+ layout.GetPixelSize (out dateWidth, out h);
+ layout.SetText (dateTime);
+
+ e.Window.DrawLayout (gc, Allocation.Width - revisionWidth - margin - revisionWidth - dateRevisionSpacing, (int)(curY + (widget.Editor.LineHeight - h) / 2), layout);
+ }
}
- using (var authorLayout = PangoUtil.CreateLayout (this)) {
- var description = Pango.FontDescription.FromString ("Tahoma " + (int)(10 * widget.Editor.Options.Zoom));
- authorLayout.FontDescription = description;
+ using (var authorLayout = MonoDevelop.Components.PangoUtil.CreateLayout (this)) {
+ authorLayout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11);
authorLayout.SetText (ann.Author);
authorLayout.GetPixelSize (out authorWidth, out h);
@@ -749,7 +739,7 @@ namespace MonoDevelop.VersionControl.Views
cr.Rectangle (0, 0, maxWidth, Allocation.Height);
cr.Clip ();
cr.Translate (leftSpacer + margin, (int)(curY + (widget.Editor.LineHeight - h) / 2));
- cr.SetSourceRGB (0, 0, 0);
+ cr.SetSourceColor (Styles.BlameView.AnnotationTextColor.ToCairoColor ());
cr.ShowLayout (authorLayout);
cr.ResetClip ();
cr.Restore ();
@@ -770,7 +760,7 @@ namespace MonoDevelop.VersionControl.Views
layout.SetText (msg);
layout.Width = (int)(Allocation.Width * Pango.Scale.PangoScale);
using (var gc = new Gdk.GC (e.Window)) {
- gc.RgbFgColor = Style.Dark (State);
+ gc.RgbFgColor = Styles.BlameView.AnnotationSummaryTextColor.ToGdkColor ();
gc.ClipRectangle = new Rectangle (0, (int)curStart, Allocation.Width, (int)(curY - curStart));
e.Window.DrawLayout (gc, (int)(leftSpacer + margin), (int)(curStart + h), layout);
}
@@ -779,7 +769,7 @@ namespace MonoDevelop.VersionControl.Views
cr.Rectangle (0, curStart, leftSpacer, curY - curStart);
- if (ann != null && ann != locallyModified && !string.IsNullOrEmpty (ann.Author)) {
+ if (ann != null && !string.IsNullOrEmpty (ann.Author)) {
double a;
if (ann != null && (maxDate - minDate).TotalHours > 0) {
@@ -787,19 +777,19 @@ namespace MonoDevelop.VersionControl.Views
} else {
a = 1;
}
- HslColor color = new Cairo.Color (0.90, 0.90, 1);
- color.L = 0.4 + a / 2;
- color.S = 1 - a / 2;
- cr.SetSourceColor (color);
+ var color = Styles.BlameView.AnnotationMarkColor;
+ color.Light = 0.4 + a / 2;
+ color.Saturation = 1 - a / 2;
+ cr.SetSourceColor (color.ToCairoColor ());
} else {
- cr.SetSourceColor (ann != null ? new Cairo.Color (1, 1, 0) : new Cairo.Color (0.95, 0.95, 0.95));
+ cr.SetSourceColor ((ann != null ? Styles.BlameView.AnnotationMarkModifiedColor : Styles.BlameView.AnnotationBackgroundColor).ToCairoColor ());
}
cr.Fill ();
if (ann != null) {
cr.MoveTo (0, curY + 0.5);
cr.LineTo (Allocation.Width, curY + 0.5);
- cr.SetSourceRGB (0.6, 0.6, 0.6);
+ cr.SetSourceColor (Styles.BlameView.AnnotationSplitterColor.ToCairoColor ());
cr.Stroke ();
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CellRendererDiff.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CellRendererDiff.cs
index 94eb7a2fab..188d7864aa 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CellRendererDiff.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CellRendererDiff.cs
@@ -22,11 +22,6 @@ namespace MonoDevelop.VersionControl.Views
TreePath path;
int RightPadding = 4;
-// Gdk.Color baseAddColor = new Gdk.Color (133, 168, 133);
-// Gdk.Color baseRemoveColor = new Gdk.Color (178, 140, 140);
- Gdk.Color baseAddColor = new Gdk.Color (123, 200, 123).AddLight (0.1);
- Gdk.Color baseRemoveColor = new Gdk.Color (200, 140, 140).AddLight (0.1);
-
int RoundedSectionRadius = 4;
int LeftPaddingBlock = 19;
@@ -143,10 +138,10 @@ namespace MonoDevelop.VersionControl.Views
Gdk.GC normalGC = widget.Style.TextGC (StateType.Normal);
Gdk.GC removedGC = new Gdk.GC (window);
removedGC.Copy (normalGC);
- removedGC.RgbFgColor = baseRemoveColor.AddLight (-0.3);
+ removedGC.RgbFgColor = Styles.LogView.DiffRemoveBackgroundColor.AddLight (-0.3).ToGdkColor ();
Gdk.GC addedGC = new Gdk.GC (window);
addedGC.Copy (normalGC);
- addedGC.RgbFgColor = baseAddColor.AddLight (-0.3);
+ addedGC.RgbFgColor = Styles.LogView.DiffAddBackgroundColor.AddLight (-0.3).ToGdkColor ();
Gdk.GC infoGC = new Gdk.GC (window);
infoGC.Copy (normalGC);
infoGC.RgbFgColor = widget.Style.Text (StateType.Normal).AddLight (0.2);
@@ -266,11 +261,11 @@ namespace MonoDevelop.VersionControl.Views
double xrow = cell_area.X + LeftPaddingBlock;
int wrow = cell_area.Width - 1 - LeftPaddingBlock;
if (block.Type == BlockType.Added)
- ctx.SetSourceColor (baseAddColor.AddLight (0.1).ToCairoColor ());
+ ctx.SetSourceColor (Styles.LogView.DiffAddBackgroundColor.AddLight (0.1).ToCairoColor ());
else if (block.Type == BlockType.Removed)
- ctx.SetSourceColor (baseRemoveColor.AddLight (0.1).ToCairoColor ());
+ ctx.SetSourceColor (Styles.LogView.DiffRemoveBackgroundColor.AddLight (0.1).ToCairoColor ());
else {
- ctx.SetSourceColor (widget.Style.Base (Gtk.StateType.Prelight).AddLight (0.1).ToCairoColor ());
+ ctx.SetSourceColor (Styles.LogView.DiffHighlightColor.ToCairoColor ());
xrow -= LeftPaddingBlock;
wrow += LeftPaddingBlock;
}
@@ -298,7 +293,7 @@ namespace MonoDevelop.VersionControl.Views
// Finally draw the change symbol at the left margin
- DrawChangeSymbol (ctx, cell_area.X + 1, cell_area.Width - 2, block);
+ DrawChangeSymbol (ctx, widget, cell_area.X + 1, cell_area.Width - 2, block);
}
// Finish the drawing of the code segment
@@ -353,16 +348,16 @@ namespace MonoDevelop.VersionControl.Views
int bottomSpacing = (lineHeight - spacing) / 2;
ctx.Rectangle (x + shadowSize + 0.5, firstBlock.YStart + bottomSpacing + spacing - shadowSize + 0.5, width - shadowSize*2, shadowSize);
- ctx.SetSourceRGB (0.9, 0.9, 0.9);
+ ctx.SetSourceColor (Styles.LogView.DiffBoxSplitterColor.ToCairoColor ());
ctx.LineWidth = 1;
ctx.Fill ();
ctx.Rectangle (x + shadowSize + 0.5, lastBlock.YEnd + bottomSpacing + 0.5, width - shadowSize*2, shadowSize);
- ctx.SetSourceRGB (0.9, 0.9, 0.9);
+ ctx.SetSourceColor (Styles.LogView.DiffBoxSplitterColor.ToCairoColor ());
ctx.Fill ();
ctx.Rectangle (x + 0.5, firstBlock.YStart + bottomSpacing + spacing + 0.5, width, lastBlock.YEnd - firstBlock.YStart - spacing);
- ctx.SetSourceRGB (0.7,0.7,0.7);
+ ctx.SetSourceColor (Styles.LogView.DiffBoxBorderColor.ToCairoColor ());
ctx.Stroke ();
string text = lines[firstBlock.FirstLine].Replace ("@","").Replace ("-","");
@@ -380,7 +375,7 @@ namespace MonoDevelop.VersionControl.Views
ctx.LineWidth = 1;
ctx.SetSourceColor (widget.Style.Base (StateType.Normal).ToCairoColor ());
ctx.FillPreserve ();
- ctx.SetSourceRGB (0.7, 0.7, 0.7);
+ ctx.SetSourceColor (Styles.LogView.DiffBoxBorderColor.ToCairoColor ());
ctx.Stroke ();
window.DrawLayout (gc, (int)(x + 2 + LeftPaddingBlock), firstBlock.YStart + dy, layout);
@@ -400,7 +395,7 @@ namespace MonoDevelop.VersionControl.Views
ctx.LineWidth = 1;
ctx.SetSourceColor (widget.Style.Base (Gtk.StateType.Normal).ToCairoColor ());
ctx.FillPreserve ();
- ctx.SetSourceRGB (0.7, 0.7, 0.7);
+ ctx.SetSourceColor (Styles.LogView.DiffBoxBorderColor.ToCairoColor ());
ctx.Stroke ();
window.DrawLayout (gc, right - tw - 1, top + dy, layout);
@@ -411,7 +406,7 @@ namespace MonoDevelop.VersionControl.Views
if (!IsChangeBlock (block.Type))
return;
- Gdk.Color color = block.Type == BlockType.Added ? baseAddColor : baseRemoveColor;
+ var color = block.Type == BlockType.Added ? Styles.LogView.DiffAddBackgroundColor : Styles.LogView.DiffRemoveBackgroundColor;
double y = block.YStart;
int height = block.YEnd - block.YStart;
@@ -441,6 +436,8 @@ namespace MonoDevelop.VersionControl.Views
ctx.Fill ();
ctx.Rectangle (markerx, y, width - markerx, height);
+
+ // FIXME: VV: Remove gradient features
using (Cairo.Gradient pat = new Cairo.LinearGradient (x, y, x + width, y)) {
pat.AddColorStop (0, color.AddLight (0.21).ToCairoColor ());
pat.AddColorStop (1, color.AddLight (0.3).ToCairoColor ());
@@ -448,55 +445,24 @@ namespace MonoDevelop.VersionControl.Views
ctx.Fill ();
}
}
+
+ static Xwt.Drawing.Image gutterAdded = Xwt.Drawing.Image.FromResource ("gutter-added-15.png");
+ static Xwt.Drawing.Image gutterRemoved = Xwt.Drawing.Image.FromResource ("gutter-removed-15.png");
- void DrawChangeSymbol (Cairo.Context ctx, double x, int width, BlockInfo block)
+ void DrawChangeSymbol (Cairo.Context ctx, Widget widget, double x, int width, BlockInfo block)
{
if (!IsChangeBlock (block.Type))
return;
-
- Gdk.Color color = block.Type == BlockType.Added ? baseAddColor : baseRemoveColor;
-
- int ssize = 8;
- int barSize = 3;
-
- if (ssize - 2 > lineHeight)
- ssize = lineHeight - 2;
- if (ssize <= 0)
- return;
- double inSize = (ssize / 2) - (barSize / 2);
- double py = block.YStart + ((block.YEnd - block.YStart) / 2 - ssize / 2) + 0.5;
- double px = x + (LeftPaddingBlock/2) - (ssize / 2) + 0.5;
-
if (block.Type == BlockType.Added) {
- ctx.MoveTo (px + inSize, py);
- ctx.RelLineTo (barSize, 0);
- ctx.RelLineTo (0, inSize);
- ctx.RelLineTo (inSize, 0);
- ctx.RelLineTo (0, barSize);
- ctx.RelLineTo (-inSize, 0);
- ctx.RelLineTo (0, inSize);
- ctx.RelLineTo (-barSize, 0);
- ctx.RelLineTo (0, -inSize);
- ctx.RelLineTo (-inSize, 0);
- ctx.RelLineTo (0, -barSize);
- ctx.RelLineTo (inSize, 0);
- ctx.RelLineTo (0, -inSize);
- ctx.ClosePath ();
+ var ix = x + (LeftPaddingBlock/2) - (gutterAdded.Width / 2);
+ var iy = block.YStart + ((block.YEnd - block.YStart) / 2 - gutterAdded.Height / 2);
+ ctx.DrawImage (widget, gutterAdded, ix, iy);
} else {
- ctx.MoveTo (px, py + inSize);
- ctx.RelLineTo (ssize, 0);
- ctx.RelLineTo (0, barSize);
- ctx.RelLineTo (-ssize, 0);
- ctx.RelLineTo (0, -barSize);
- ctx.ClosePath ();
+ var ix = x + (LeftPaddingBlock/2) - (gutterRemoved.Width / 2);
+ var iy = block.YStart + ((block.YEnd - block.YStart) / 2 - gutterRemoved.Height / 2);
+ ctx.DrawImage (widget, gutterRemoved, ix, iy);
}
-
- ctx.SetSourceColor (color.ToCairoColor ());
- ctx.FillPreserve ();
- ctx.SetSourceColor (color.AddLight (-0.2).ToCairoColor ());
- ctx.LineWidth = 1;
- ctx.Stroke ();
}
public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int c_width, out int c_height)
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ChangeSetView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ChangeSetView.cs
index 5d49bde9a0..a4177e851d 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ChangeSetView.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ChangeSetView.cs
@@ -8,6 +8,7 @@ using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Components;
+using System.Linq;
namespace MonoDevelop.VersionControl.Views
{
@@ -300,13 +301,16 @@ namespace MonoDevelop.VersionControl.Views
if (line == -1)
line = 1;
}
- IdeApp.Workbench.OpenDocument (files [0], line, 0);
+ var proj = IdeApp.Workspace.GetProjectsContainingFile (files [0]).FirstOrDefault ();
+ IdeApp.Workbench.OpenDocument (files [0], proj, line, 0);
}
else {
AlertButton openAll = new AlertButton (GettextCatalog.GetString ("_Open All"));
if (MessageService.AskQuestion (GettextCatalog.GetString ("Do you want to open all {0} files?", files.Length), AlertButton.Cancel, openAll) == openAll) {
- for (int n=0; n<files.Length; n++)
- IdeApp.Workbench.OpenDocument (files[n], n==0);
+ for (int n=0; n<files.Length; n++) {
+ var proj = IdeApp.Workspace.GetProjectsContainingFile (files [n]).FirstOrDefault ();
+ IdeApp.Workbench.OpenDocument (files [n], proj, n == 0);
+ }
}
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CommonTextEditorOptions.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CommonTextEditorOptions.cs
new file mode 100644
index 0000000000..822dc26a77
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/CommonTextEditorOptions.cs
@@ -0,0 +1,383 @@
+
+//
+// ComparisonWidget.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Gtk;
+using Gdk;
+using System.Collections.Generic;
+using Mono.TextEditor;
+using MonoDevelop.Ide;
+using MonoDevelop.Components;
+using System.ComponentModel;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Ide.Fonts;
+using MonoDevelop.Ide.Editor.Extension;
+
+namespace MonoDevelop.VersionControl.Views
+{
+ // Code snatched from SourceEditor
+ class CommonTextEditorOptions : TextEditorOptions, Mono.TextEditor.ITextEditorOptions
+ {
+ static CommonTextEditorOptions instance;
+ //static TextStylePolicy defaultPolicy;
+ static bool inited;
+
+ public static CommonTextEditorOptions Instance {
+ get { return instance; }
+ }
+
+ static CommonTextEditorOptions ()
+ {
+ Init ();
+ }
+
+ public static void Init ()
+ {
+ if (inited)
+ return;
+ inited = true;
+
+ TextStylePolicy policy = MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<TextStylePolicy> ("text/plain");
+ instance = new CommonTextEditorOptions (policy);
+ MonoDevelop.Projects.Policies.PolicyService.DefaultPolicies.PolicyChanged += instance.HandlePolicyChanged;
+ }
+
+ void HandlePolicyChanged (object sender, MonoDevelop.Projects.Policies.PolicyChangedEventArgs args)
+ {
+ TextStylePolicy pol = MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<TextStylePolicy> ("text/plain");
+ UpdateStylePolicy (pol);
+ }
+
+ CommonTextEditorOptions (MonoDevelop.Ide.Gui.Content.TextStylePolicy currentPolicy)
+ {
+ UpdateStylePolicy (currentPolicy);
+ MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.Changed += delegate(object sender, EventArgs e) {
+ OnChanged (e);
+ };
+ }
+
+ public override void Dispose()
+ {
+ FontService.RemoveCallback (UpdateFont);
+ }
+
+ void UpdateFont ()
+ {
+ base.FontName = FontName;
+ base.GutterFontName = GutterFontName;
+ this.OnChanged (EventArgs.Empty);
+
+ }
+
+ void UpdateStylePolicy (MonoDevelop.Ide.Gui.Content.TextStylePolicy currentPolicy)
+ {
+ this.defaultEolMarker = TextStylePolicy.GetEolMarker (currentPolicy.EolMarker);
+ base.TabsToSpaces = currentPolicy.TabsToSpaces; // PropertyService.Get ("TabsToSpaces", false);
+ base.IndentationSize = currentPolicy.TabWidth; //PropertyService.Get ("TabIndent", 4);
+ base.RulerColumn = currentPolicy.FileWidth; //PropertyService.Get ("RulerColumn", 80);
+ base.AllowTabsAfterNonTabs = !currentPolicy.NoTabsAfterNonTabs; //PropertyService.Get ("AllowTabsAfterNonTabs", true);
+ base.RemoveTrailingWhitespaces = currentPolicy.RemoveTrailingWhitespace; //PropertyService.Get ("RemoveTrailingWhitespaces", true);
+ }
+
+ #region new options
+
+ public bool EnableAutoCodeCompletion {
+ get { return IdeApp.Preferences.EnableAutoCodeCompletion; }
+ set { IdeApp.Preferences.EnableAutoCodeCompletion.Set (value); }
+ }
+
+ public bool DefaultRegionsFolding {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.DefaultRegionsFolding;
+ }
+ set {
+ }
+ }
+
+ public bool DefaultCommentFolding {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.DefaultCommentFolding;
+ }
+ set {
+ }
+ }
+
+ public bool EnableSemanticHighlighting {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.EnableSemanticHighlighting;
+ }
+ set {
+ }
+ }
+
+ public bool TabIsReindent {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.TabIsReindent;
+ }
+ set {
+ }
+ }
+
+ public bool AutoInsertMatchingBracket {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.AutoInsertMatchingBracket;
+ }
+ set {
+ }
+ }
+
+ public bool SmartSemicolonPlacement {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.SmartSemicolonPlacement;
+ }
+ set {
+ }
+ }
+
+ public bool UnderlineErrors {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.UnderlineErrors;
+ }
+ set {
+ }
+ }
+
+ public override IndentStyle IndentStyle {
+ get {
+ return (IndentStyle)MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.IndentStyle;
+ }
+ set {
+ }
+ }
+
+ public bool EnableHighlightUsages {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.EnableHighlightUsages;
+ }
+ set {
+ }
+ }
+
+ public MonoDevelop.Ide.Editor.LineEndingConversion LineEndingConversion {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.LineEndingConversion;
+ }
+ set {
+ }
+ }
+
+
+ #endregion
+
+ public bool OnTheFlyFormatting {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.OnTheFlyFormatting;
+ }
+ set {
+ }
+ }
+
+ #region old options
+ string defaultEolMarker;
+ public override string DefaultEolMarker {
+ get { return defaultEolMarker; }
+ }
+
+ public MonoDevelop.Ide.Editor.WordNavigationStyle WordNavigationStyle {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.WordNavigationStyle;
+ }
+ set {
+ }
+ }
+
+ IWordFindStrategy wordFindStrategy = null;
+ public override IWordFindStrategy WordFindStrategy {
+ get {
+ if (wordFindStrategy == null)
+ SetWordFindStrategy ();
+ return this.wordFindStrategy;
+ }
+ set {
+ throw new System.NotImplementedException ();
+ }
+ }
+
+ void SetWordFindStrategy ()
+ {
+ switch (WordNavigationStyle) {
+ case MonoDevelop.Ide.Editor.WordNavigationStyle.Unix:
+ this.wordFindStrategy = new EmacsWordFindStrategy (true);
+ break;
+ case MonoDevelop.Ide.Editor.WordNavigationStyle.Windows:
+ this.wordFindStrategy = new SharpDevelopWordFindStrategy ();
+ break;
+ }
+ }
+
+ public override bool ShowLineNumberMargin {
+ get {
+ return true;
+ }
+ set {
+ }
+ }
+
+ public override bool ShowFoldMargin {
+ get {
+ return false;
+ }
+ set {
+ }
+ }
+
+ public override bool HighlightCaretLine {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.HighlightCaretLine;
+ }
+ set {
+ }
+ }
+
+ public override bool EnableSyntaxHighlighting {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.EnableSyntaxHighlighting;
+ }
+ set {
+ }
+ }
+
+ public override bool HighlightMatchingBracket {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.HighlightMatchingBracket;
+ }
+ set {
+ }
+ }
+
+ public override bool ShowRuler {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.ShowRuler;
+ }
+ set {
+ }
+ }
+
+ public override bool EnableAnimations {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.EnableAnimations;
+ }
+ set {
+ }
+ }
+
+ public override bool DrawIndentationMarkers {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.DrawIndentationMarkers;
+ }
+ set {
+ }
+ }
+
+ ConfigurationProperty<ShowWhitespaces> showWhitespaces = ConfigurationProperty.Create ("ShowWhitespaces", ShowWhitespaces.Never);
+ public override ShowWhitespaces ShowWhitespaces {
+ get {
+ return showWhitespaces;
+ }
+ set {
+ if (showWhitespaces.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ ConfigurationProperty<IncludeWhitespaces> includeWhitespaces = ConfigurationProperty.Create ("IncludeWhitespaces", IncludeWhitespaces.All);
+ public override IncludeWhitespaces IncludeWhitespaces {
+ get {
+ return includeWhitespaces;
+ }
+ set {
+ if (includeWhitespaces.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ public override bool WrapLines {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.WrapLines;
+ }
+ set {
+ }
+ }
+
+ public override bool EnableQuickDiff {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.EnableQuickDiff;
+ }
+ set {
+ }
+ }
+
+ public override string FontName {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.FontName;
+ }
+ set {
+ throw new InvalidOperationException ("Set font through font service");
+ }
+ }
+
+ public override string GutterFontName {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.GutterFontName;
+ }
+ set {
+ throw new InvalidOperationException ("Set font through font service");
+ }
+ }
+
+ public override string ColorScheme {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.ColorScheme;
+ }
+ set {
+ }
+ }
+
+ public override bool GenerateFormattingUndoStep {
+ get {
+ return MonoDevelop.Ide.Editor.DefaultSourceEditorOptions.Instance.GenerateFormattingUndoStep;
+ }
+ set {
+ }
+ }
+
+ #endregion
+ }
+}
+
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ComparisonWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ComparisonWidget.cs
index 6ceebf533d..10eaf89c6a 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ComparisonWidget.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/ComparisonWidget.cs
@@ -43,19 +43,19 @@ namespace MonoDevelop.VersionControl.Views
{
internal DropDownBox originalComboBox, diffComboBox;
- public TextEditor OriginalEditor {
+ public MonoTextEditor OriginalEditor {
get {
return editors[1];
}
}
- public TextEditor DiffEditor {
+ public MonoTextEditor DiffEditor {
get {
return editors[0];
}
}
- protected override TextEditor MainEditor {
+ protected internal override MonoTextEditor MainEditor {
get {
return editors[1];
}
@@ -69,25 +69,47 @@ namespace MonoDevelop.VersionControl.Views
protected override void CreateComponents ()
{
this.editors = new [] {
- new TextEditor (new TextDocument (), new CommonTextEditorOptions ()),
- new TextEditor (new TextDocument (), new CommonTextEditorOptions ()),
+ new MonoTextEditor (new TextDocument (), CommonTextEditorOptions.Instance),
+ new MonoTextEditor (new TextDocument (), CommonTextEditorOptions.Instance),
};
if (!viewOnly) {
originalComboBox = new DropDownBox ();
originalComboBox.WindowRequestFunc = CreateComboBoxSelector;
- originalComboBox.Text = "Local";
+ originalComboBox.Text = GettextCatalog.GetString ("Loading…");
+ originalComboBox.Sensitive = false;
originalComboBox.Tag = editors[1];
diffComboBox = new DropDownBox ();
diffComboBox.WindowRequestFunc = CreateComboBoxSelector;
- diffComboBox.Text = "Base";
+ diffComboBox.Text = GettextCatalog.GetString ("Loading…");
+ diffComboBox.Sensitive = false;
diffComboBox.Tag = editors[0];
this.headerWidgets = new [] { diffComboBox, originalComboBox };
}
}
-
+
+ protected override void OnSetVersionControlInfo (VersionControlDocumentInfo info)
+ {
+ info.Updated += OnInfoUpdated;
+ MainEditor.Document.ReadOnly = false;
+ base.OnSetVersionControlInfo (info);
+ }
+
+ void OnInfoUpdated (object sender, EventArgs args)
+ {
+ originalComboBox.Text = GettextCatalog.GetString ("Local");
+ diffComboBox.Text = GettextCatalog.GetString ("Base");
+ originalComboBox.Sensitive = diffComboBox.Sensitive = true;
+ }
+
+ protected override void OnDestroyed ()
+ {
+ info.Updated -= OnInfoUpdated;
+ base.OnDestroyed ();
+ }
+
public ComparisonWidget ()
{
}
@@ -143,19 +165,19 @@ namespace MonoDevelop.VersionControl.Views
public override void CreateDiff ()
{
- Diff = new List<Mono.TextEditor.Utils.Hunk> (DiffEditor.Document.Diff (OriginalEditor.Document));
+ Diff = new List<Mono.TextEditor.Utils.Hunk> (DiffEditor.Document.Diff (OriginalEditor.Document, includeEol: false));
ClearDiffCache ();
QueueDraw ();
}
- public void SetRevision (TextEditor toEditor, Revision rev)
+ public void SetRevision (MonoTextEditor toEditor, Revision rev)
{
BackgroundWorker worker = new BackgroundWorker ();
worker.DoWork += delegate(object sender, DoWorkEventArgs e) {
Revision workingRevision = (Revision)e.Argument;
string text = null;
try {
- text = info.Item.Repository.GetTextAtRevision (info.VersionInfo.LocalPath, workingRevision);
+ text = info.Item.Repository.GetTextAtRevision (info.Item.VersionInfo.LocalPath, workingRevision);
} catch (Exception ex) {
text = string.Format (GettextCatalog.GetString ("Error while getting the text of revision {0}:\n{1}"), workingRevision, ex.ToString ());
MessageService.ShowError (text);
@@ -214,9 +236,9 @@ namespace MonoDevelop.VersionControl.Views
public string GetMarkup (int n)
{
if (n == 0)
- return "Local";
+ return GettextCatalog.GetString ("Local");
if (n == 1)
- return "Base";
+ return GettextCatalog.GetString ("Base");
Revision rev = widget.info.History[n - 2];
return GLib.Markup.EscapeText (string.Format ("{0}\t{1}\t{2}", rev, rev.Time, rev.Author));
}
@@ -236,15 +258,15 @@ namespace MonoDevelop.VersionControl.Views
public void ActivateItem (int n)
{
if (n == 0) {
- box.SetItem ("Local", null, new object());
- widget.SetLocal (((TextEditor)box.Tag).GetTextEditorData ());
+ box.SetItem (GettextCatalog.GetString ("Local"), null, new object());
+ widget.SetLocal (((MonoTextEditor)box.Tag).GetTextEditorData ());
return;
}
- widget.RemoveLocal (((TextEditor)box.Tag).GetTextEditorData ());
- ((TextEditor)box.Tag).Document.ReadOnly = true;
+ widget.RemoveLocal (((MonoTextEditor)box.Tag).GetTextEditorData ());
+ ((MonoTextEditor)box.Tag).Document.ReadOnly = true;
if (n == 1) {
- box.SetItem ("Base", null, new object());
- if (((TextEditor)box.Tag) == widget.editors[0]) {
+ box.SetItem (GettextCatalog.GetString ("Base"), null, new object());
+ if (((MonoTextEditor)box.Tag) == widget.editors[0]) {
widget.diffRevision = null;
} else {
widget.originalRevision = null;
@@ -257,13 +279,13 @@ namespace MonoDevelop.VersionControl.Views
MessageService.ShowError (text);
}
- ((TextEditor)box.Tag).Document.Text = text;
+ ((MonoTextEditor)box.Tag).Document.Text = text;
widget.CreateDiff ();
return;
}
Revision rev = widget.info.History[n - 2];
- widget.SetRevision ((TextEditor)box.Tag, rev);
+ widget.SetRevision ((MonoTextEditor)box.Tag, rev);
}
public int IconCount {
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffParser.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffParser.cs
index 9d92426ff6..715d6f4e26 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffParser.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffParser.cs
@@ -32,6 +32,7 @@ using MonoDevelop.Ide.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem.Implementation;
using MonoDevelop.Projects;
+using MonoDevelop.Core.Text;
namespace MonoDevelop.VersionControl.Views
{
@@ -50,16 +51,16 @@ namespace MonoDevelop.VersionControl.Views
static Regex eolExpression = new Regex (@"(?<eol>\r\n|\n|\r)", RegexOptions.Compiled);
#region AbstractParser overrides
-
- public override ParsedDocument Parse (bool storeAst, string fileName, TextReader textReader, Project project = null)
+
+ public override System.Threading.Tasks.Task<ParsedDocument> Parse (ParseOptions parseOptions, System.Threading.CancellationToken cancellationToken)
{
- var doc = new DefaultParsedDocument (fileName);
+ ParsedDocument doc = new DefaultParsedDocument (parseOptions.FileName);
DefaultUnresolvedTypeDefinition currentFile = null;
DefaultUnresolvedProperty currentRegion = null;
string eol = Environment.NewLine;
- string content = textReader.ReadToEnd ();
+ string content = parseOptions.Content.Text;
Match eolMatch = eolExpression.Match (content);
if (eolMatch != null && eolMatch.Success)
eol = eolMatch.Groups ["eol"].Value;
@@ -82,7 +83,7 @@ namespace MonoDevelop.VersionControl.Views
// Create new file region
currentFile = new DefaultUnresolvedTypeDefinition (string.Empty, string.Empty);
currentFile.Region = currentFile.BodyRegion = new DomRegion (lastToken (lineMatch.Groups ["filepath"].Value), linenum, line.Length + 1, linenum, int.MaxValue);
- doc.TopLevelTypeDefinitions.Add (currentFile);
+ // doc.TopLevelTypeDefinitions.Add (currentFile);
} else {
lineMatch = chunkExpression.Match (line);
if (lineMatch != null && lineMatch.Success && currentFile != null) {
@@ -110,7 +111,7 @@ namespace MonoDevelop.VersionControl.Views
currentRegion.BodyRegion.BeginColumn,
Math.Max (1, linenum - 2), int.MaxValue);
- return doc;
+ return System.Threading.Tasks.Task.FromResult (doc);
}
#endregion
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffView.cs
index 4d3521553b..2b79bee464 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffView.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffView.cs
@@ -26,12 +26,13 @@
using System;
using MonoDevelop.Ide.Gui;
using System.Collections.Generic;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Content;
namespace MonoDevelop.VersionControl.Views
{
- public interface IDiffView : IAttachableViewContent
+ public interface IDiffView
{
}
@@ -39,7 +40,7 @@ namespace MonoDevelop.VersionControl.Views
{
DiffWidget widget;
- public override Gtk.Widget Control {
+ public override Control Control {
get {
if (widget == null) {
widget = new DiffWidget (info);
@@ -83,21 +84,22 @@ namespace MonoDevelop.VersionControl.Views
#region IAttachableViewContent implementation
- public int GetLineInCenter (Mono.TextEditor.TextEditor editor)
+ public int GetLineInCenter (Mono.TextEditor.MonoTextEditor editor)
{
double midY = editor.VAdjustment.Value + editor.Allocation.Height / 2;
return editor.YToLine (midY);
}
- public void Selected ()
+ protected override void OnSelected ()
{
info.Start ();
ComparisonWidget.UpdateLocalText ();
- var buffer = info.Document.GetContent<ITextBuffer> ();
+ var buffer = info.Document.GetContent<MonoDevelop.Ide.Editor.TextEditor> ();
if (buffer != null) {
- int line, col;
- buffer.GetLineColumnFromPosition (buffer.CursorPosition, out line, out col);
- ComparisonWidget.OriginalEditor.SetCaretTo (line, col);
+ var loc = buffer.CaretLocation;
+ int line = loc.Line < 1 ? 1 : loc.Line;
+ int column = loc.Column < 1 ? 1 : loc.Column;
+ ComparisonWidget.OriginalEditor.SetCaretTo (line, column);
}
if (ComparisonWidget.Allocation.Height == 1 && ComparisonWidget.Allocation.Width == 1) {
@@ -120,7 +122,7 @@ namespace MonoDevelop.VersionControl.Views
}
}
- public void Deselected ()
+ protected override void OnDeselected ()
{
var sourceEditor = info.Document.GetContent <MonoDevelop.SourceEditor.SourceEditorView> ();
if (sourceEditor != null) {
@@ -132,14 +134,6 @@ namespace MonoDevelop.VersionControl.Views
}
}
- public void BeforeSave ()
- {
- }
-
- public void BaseContentChanged ()
- {
- }
-
#endregion
#region IUndoHandler implementation
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffWidget.cs
index fc7089a08b..d90c3c3a45 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffWidget.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DiffWidget.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using System.Linq;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
@@ -33,10 +34,10 @@ namespace MonoDevelop.VersionControl.Views
public partial class DiffWidget : Gtk.Bin
{
VersionControlDocumentInfo info;
- Mono.TextEditor.TextEditor diffTextEditor;
+ Mono.TextEditor.MonoTextEditor diffTextEditor;
ComparisonWidget comparisonWidget;
- Gtk.Button buttonNext;
- Gtk.Button buttonPrev;
+ DocumentToolButton buttonNext;
+ DocumentToolButton buttonPrev;
Gtk.Button buttonDiff;
Gtk.Label labelOverview;
@@ -48,7 +49,7 @@ namespace MonoDevelop.VersionControl.Views
string LabelText {
get {
- if (comparisonWidget.Diff.Count == 0)
+ if (!comparisonWidget.Diff.Any ())
return GettextCatalog.GetString ("Both files are equal");
int added=0, removed=0;
foreach (var h in comparisonWidget.Diff) {
@@ -63,7 +64,7 @@ namespace MonoDevelop.VersionControl.Views
}
}
- public Mono.TextEditor.TextEditor FocusedEditor {
+ public Mono.TextEditor.MonoTextEditor FocusedEditor {
get {
return comparisonWidget.FocusedEditor;
}
@@ -91,7 +92,7 @@ namespace MonoDevelop.VersionControl.Views
};
comparisonWidget.SetVersionControlInfo (info);
this.buttonDiff.Clicked += HandleButtonDiffhandleClicked;
- diffTextEditor = new global::Mono.TextEditor.TextEditor (new Mono.TextEditor.TextDocument (), new CommonTextEditorOptions ());
+ diffTextEditor = new global::Mono.TextEditor.MonoTextEditor (new Mono.TextEditor.TextDocument (), CommonTextEditorOptions.Instance);
diffTextEditor.Document.MimeType = "text/x-diff";
diffTextEditor.Options.ShowFoldMargin = false;
@@ -114,7 +115,8 @@ namespace MonoDevelop.VersionControl.Views
void SetButtonSensitivity ()
{
- this.buttonNext.Sensitive = this.buttonPrev.Sensitive = notebook1.Page == 0 && comparisonWidget.Diff != null && comparisonWidget.Diff.Count > 0;
+ this.buttonNext.GetNativeWidget<Gtk.Widget> ().Sensitive = this.buttonPrev.GetNativeWidget<Gtk.Widget> ().Sensitive =
+ notebook1.Page == 0 && comparisonWidget.Diff != null && comparisonWidget.Diff.Count > 0;
}
void HandleButtonDiffhandleClicked (object sender, EventArgs e)
@@ -143,7 +145,7 @@ namespace MonoDevelop.VersionControl.Views
}
}
- static string GetRevisionText (Mono.TextEditor.TextEditor editor, Revision rev)
+ static string GetRevisionText (Mono.TextEditor.MonoTextEditor editor, Revision rev)
{
if (!editor.Document.ReadOnly)
return GettextCatalog.GetString ("(working copy)");
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DropDownBox.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DropDownBox.cs
index 066ad679b2..17cfb0693e 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DropDownBox.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/DropDownBox.cs
@@ -29,6 +29,7 @@ using System.ComponentModel;
using MonoDevelop.Ide;
using Gtk;
using Mono.TextEditor;
+using MonoDevelop.Components;
namespace MonoDevelop.VersionControl.Views
{
@@ -86,8 +87,8 @@ namespace MonoDevelop.VersionControl.Views
set;
}
- Window window = null;
- public Func<DropDownBox, Window> WindowRequestFunc = null;
+ Gtk.Window window = null;
+ public Func<DropDownBox, Gtk.Window> WindowRequestFunc = null;
public DropDownBox ()
@@ -109,12 +110,12 @@ namespace MonoDevelop.VersionControl.Views
window.WidthRequest = Allocation.Width;
int width, height;
window.GetSizeRequest (out width, out height);
- Gdk.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtPoint (dx, dy));
+ Xwt.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen.Number, Screen.GetMonitorAtPoint (dx, dy));
if (dy + height > geometry.Bottom)
dy = oy + this.Allocation.Y - height;
if (dx + width > geometry.Right)
- dx = geometry.Right - width;
+ dx = (int)geometry.Right - width;
window.Move (dx, dy);
window.GetSizeRequest (out width, out height);
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.cs
index ea883f870e..552708b2d4 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/EditorCompareWidgetBase.cs
@@ -34,6 +34,7 @@ using Mono.TextEditor;
using Mono.TextEditor.Utils;
using MonoDevelop.Ide;
using MonoDevelop.Core;
+using MonoDevelop.Components;
using MonoDevelop.Components.Commands;
using MonoDevelop.Projects.Text;
@@ -54,7 +55,7 @@ namespace MonoDevelop.VersionControl.Views
DiffScrollbar rightDiffScrollBar, leftDiffScrollBar;
MiddleArea[] middleAreas;
- protected TextEditor[] editors;
+ protected MonoTextEditor[] editors;
protected Widget[] headerWidgets;
@@ -75,23 +76,14 @@ namespace MonoDevelop.VersionControl.Views
OnDiffChanged (EventArgs.Empty);
}
}
-
- static readonly Cairo.Color lightRed = new Cairo.Color (255 / 255.0, 200 / 255.0, 200 / 255.0);
- static readonly Cairo.Color darkRed = new Cairo.Color (178 / 255.0, 140 / 255.0, 140 / 255.0);
-
- static readonly Cairo.Color lightGreen = new Cairo.Color (190 / 255.0, 240 / 255.0, 190 / 255.0);
- static readonly Cairo.Color darkGreen = new Cairo.Color (133 / 255.0, 168 / 255.0, 133 / 255.0);
-
- static readonly Cairo.Color lightBlue = new Cairo.Color (190 / 255.0, 190 / 255.0, 240 / 255.0);
- static readonly Cairo.Color darkBlue = new Cairo.Color (133 / 255.0, 133 / 255.0, 168 / 255.0);
- protected abstract TextEditor MainEditor {
+ protected internal abstract MonoTextEditor MainEditor {
get;
}
- public TextEditor FocusedEditor {
+ public MonoTextEditor FocusedEditor {
get {
- foreach (TextEditor editor in editors) {
+ foreach (MonoTextEditor editor in editors) {
if (editor.HasFocus)
return editor;
@@ -203,7 +195,7 @@ namespace MonoDevelop.VersionControl.Views
this.MainEditor.EditorOptionsChanged += HandleMainEditorhandleEditorOptionsChanged;
}
- void ShowPopup (TextEditor editor, EventButton evt)
+ void ShowPopup (MonoTextEditor editor, EventButton evt)
{
CommandEntrySet cset = IdeApp.CommandService.CreateCommandEntrySet ("/MonoDevelop/VersionControl/DiffView/ContextMenu");
Gtk.Menu menu = IdeApp.CommandService.CreateMenu (cset);
@@ -249,11 +241,17 @@ namespace MonoDevelop.VersionControl.Views
editor.Options.ShowIconMargin = false;
editor.Options.DrawIndentationMarkers = PropertyService.Get ("DrawIndentationMarkers", false);
}
+
+ OnSetVersionControlInfo (info);
+ }
+
+ protected virtual void OnSetVersionControlInfo (VersionControlDocumentInfo info)
+ {
}
protected abstract void CreateComponents ();
- public static ICollection<Cairo.Rectangle> GetDiffRectangles (TextEditor editor, int startOffset, int endOffset)
+ public static ICollection<Cairo.Rectangle> GetDiffRectangles (MonoTextEditor editor, int startOffset, int endOffset)
{
ICollection<Cairo.Rectangle> rectangles = new List<Cairo.Rectangle> ();
var startLine = editor.GetLineByOffset (startOffset);
@@ -276,12 +274,12 @@ namespace MonoDevelop.VersionControl.Views
diffCache.Clear ();
}
- static List<TextSegment> BreakTextInWords (TextEditor editor, int start, int count)
+ static List<TextSegment> BreakTextInWords (MonoTextEditor editor, int start, int count)
{
return TextBreaker.BreakLinesIntoWords(editor, start, count);
}
- static List<Cairo.Rectangle> CalculateChunkPath (TextEditor editor, List<Hunk> diff, List<TextSegment> words, bool useRemove)
+ static List<Cairo.Rectangle> CalculateChunkPath (MonoTextEditor editor, List<Hunk> diff, List<TextSegment> words, bool useRemove)
{
List<Cairo.Rectangle> result = new List<Cairo.Rectangle> ();
int startOffset = -1;
@@ -304,7 +302,7 @@ namespace MonoDevelop.VersionControl.Views
return result;
}
- Tuple<List<Cairo.Rectangle>, List<Cairo.Rectangle>> GetDiffPaths (List<Hunk> diff, TextEditor editor, Hunk hunk)
+ Tuple<List<Cairo.Rectangle>, List<Cairo.Rectangle>> GetDiffPaths (List<Hunk> diff, MonoTextEditor editor, Hunk hunk)
{
if (!diffCache.ContainsKey (diff))
diffCache[diff] = new Dictionary<Hunk, Tuple<List<Cairo.Rectangle>, List<Cairo.Rectangle>>> ();
@@ -375,7 +373,7 @@ namespace MonoDevelop.VersionControl.Views
internal static void EditorFocusIn (object sender, FocusInEventArgs args)
{
- TextEditor editor = (TextEditor)sender;
+ MonoTextEditor editor = (MonoTextEditor)sender;
UpdateCaretPosition (editor.Caret);
}
@@ -521,26 +519,26 @@ namespace MonoDevelop.VersionControl.Views
children.ForEach (child => child.Child.SizeRequest ());
}
- public static Cairo.Color GetColor (Hunk hunk, bool removeSide, bool dark, double alpha)
+ public static Cairo.Color GetColor (Hunk hunk, bool removeSide, bool border, double alpha)
{
- Cairo.Color result;
+ Xwt.Drawing.Color result;
if (hunk.Removed > 0 && hunk.Inserted > 0) {
- result = dark ? darkBlue : lightBlue;
+ result = border ? Styles.DiffView.MergeBackgroundColor : Styles.DiffView.MergeBorderColor;
} else if (removeSide) {
if (hunk.Removed > 0) {
- result = dark ? darkRed : lightRed;
+ result = border ? Styles.DiffView.RemoveBackgroundColor : Styles.DiffView.RemoveBorderColor;
} else {
- result = dark ? darkGreen : lightGreen;
+ result = border ? Styles.DiffView.AddBackgroundColor : Styles.DiffView.AddBorderColor;
}
} else {
if (hunk.Inserted > 0) {
- result = dark ? darkGreen : lightGreen;
+ result = border ? Styles.DiffView.AddBackgroundColor : Styles.DiffView.AddBorderColor;
} else {
- result = dark ? darkRed : lightRed;
+ result = border ? Styles.DiffView.RemoveBackgroundColor : Styles.DiffView.RemoveBorderColor;
}
}
- result.A = alpha;
- return result;
+ result.Alpha = alpha;
+ return result.ToCairoColor ();
}
void PaintEditorOverlay (TextArea editor, PaintEventArgs args, List<Hunk> diff, bool paintRemoveSide)
@@ -611,10 +609,11 @@ namespace MonoDevelop.VersionControl.Views
throw new InvalidOperationException ("Version control info must be set before attaching the merge view to an editor.");
dict[data.Document] = data;
- var editor = info.Document.GetContent <ITextFile> ();
- if (editor != null)
+ var editor = info.Document.ParentDocument.Editor;
+ if (editor != null) {
data.Document.Text = editor.Text;
- data.Document.ReadOnly = info.Document.GetContent<IEditableTextFile> () == null;
+ data.Document.ReadOnly = editor.IsReadOnly;
+ }
CreateDiff ();
data.Document.TextReplaced += HandleDataDocumentTextReplaced;
@@ -624,9 +623,8 @@ namespace MonoDevelop.VersionControl.Views
{
var data = dict [(TextDocument)sender];
localUpdate.Remove (data);
- var editor = info.Document.GetContent<IEditableTextFile> ();
- editor.DeleteText (e.Offset, e.RemovalLength);
- editor.InsertText (e.Offset, e.InsertedText.Text);
+ var editor = info.Document.ParentDocument.Editor;
+ editor.ReplaceText (e.Offset, e.RemovalLength, e.InsertedText.Text);
localUpdate.Add (data);
UpdateDiff ();
}
@@ -637,7 +635,7 @@ namespace MonoDevelop.VersionControl.Views
data.Document.TextReplaced -= HandleDataDocumentTextReplaced;
}
- protected virtual void UndoChange (TextEditor fromEditor, TextEditor toEditor, Hunk hunk)
+ protected virtual void UndoChange (MonoTextEditor fromEditor, MonoTextEditor toEditor, Hunk hunk)
{
using (var undo = toEditor.OpenUndoGroup ()) {
var start = toEditor.Document.GetLine (hunk.InsertStart);
@@ -668,7 +666,7 @@ namespace MonoDevelop.VersionControl.Views
class MiddleArea : DrawingArea
{
EditorCompareWidgetBase widget;
- TextEditor fromEditor, toEditor;
+ MonoTextEditor fromEditor, toEditor;
bool useLeft;
IEnumerable<Hunk> Diff {
@@ -677,7 +675,7 @@ namespace MonoDevelop.VersionControl.Views
}
}
- public MiddleArea (EditorCompareWidgetBase widget, TextEditor fromEditor, TextEditor toEditor, bool useLeft)
+ public MiddleArea (EditorCompareWidgetBase widget, MonoTextEditor fromEditor, MonoTextEditor toEditor, bool useLeft)
{
this.widget = widget;
this.Events |= EventMask.PointerMotionMask | EventMask.ButtonPressMask;
@@ -888,7 +886,7 @@ namespace MonoDevelop.VersionControl.Views
// mx -= (int)x;
// my -= (int)y;
using (var gradient = new Cairo.RadialGradient (mx, my, h, mx, my, 2)) {
- var color = (HslColor)Style.Mid (StateType.Normal);
+ var color = (MonoDevelop.Components.HslColor)Style.Mid (StateType.Normal);
color.L *= 1.05;
gradient.AddColorStop (0, color);
color.L *= 1.07;
@@ -896,14 +894,14 @@ namespace MonoDevelop.VersionControl.Views
cr.SetSource (gradient);
}
} else {
- cr.SetSourceColor ((HslColor)Style.Mid (StateType.Normal));
+ cr.SetSourceColor ((MonoDevelop.Components.HslColor)Style.Mid (StateType.Normal));
}
cr.FillPreserve ();
- cr.SetSourceColor ((HslColor)Style.Dark (StateType.Normal));
+ cr.SetSourceColor ((MonoDevelop.Components.HslColor)Style.Dark (StateType.Normal));
cr.Stroke ();
cr.LineWidth = 1;
- cr.SetSourceRGB (0, 0, 0);
+ cr.SetSourceColor (MonoDevelop.Ide.Gui.Styles.BaseForegroundColor.ToCairoColor ());
if (drawArrow) {
DrawArrow (cr, x + w / 1.5, y + h / 2);
DrawArrow (cr, x + w / 2.5, y + h / 2);
@@ -930,13 +928,13 @@ namespace MonoDevelop.VersionControl.Views
class DiffScrollbar : DrawingArea
{
- TextEditor editor;
+ MonoTextEditor editor;
EditorCompareWidgetBase widget;
bool useLeftDiff;
bool paintInsert;
Adjustment vAdjustment;
- public DiffScrollbar (EditorCompareWidgetBase widget, TextEditor editor, bool useLeftDiff, bool paintInsert)
+ public DiffScrollbar (EditorCompareWidgetBase widget, MonoTextEditor editor, bool useLeftDiff, bool paintInsert)
{
this.editor = editor;
this.useLeftDiff = useLeftDiff;
@@ -1047,6 +1045,8 @@ namespace MonoDevelop.VersionControl.Views
void FillGradient (Cairo.Context cr, double y, double h)
{
cr.Rectangle (0.5, y, Allocation.Width, h);
+
+ // FIXME: VV: Remove gradient features
using (var grad = new Cairo.LinearGradient (0, y, Allocation.Width, y)) {
var col = (HslColor)Style.Base (StateType.Normal);
col.L *= 0.95;
@@ -1070,11 +1070,9 @@ namespace MonoDevelop.VersionControl.Views
h,
barWidth / 2);
- var color = (HslColor)Style.Mid (StateType.Normal);
- color.L = 0.5;
- var c = (Cairo.Color)color;
- c.A = 0.6;
- cr.SetSourceColor (c);
+ var color = Ide.Gui.Styles.BaseBackgroundColor;
+ color.Light = 0.5;
+ cr.SetSourceColor (color.WithAlpha (0.6).ToCairoColor ());
cr.Fill ();
}
@@ -1086,9 +1084,7 @@ namespace MonoDevelop.VersionControl.Views
protected virtual void OnDiffChanged (EventArgs e)
{
- EventHandler handler = this.DiffChanged;
- if (handler != null)
- handler (this, e);
+ DiffChanged?.Invoke (this, e);
}
public event EventHandler DiffChanged;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogView.cs
index d25f151308..df56bc1e7b 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogView.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogView.cs
@@ -2,18 +2,18 @@ using System;
using System.IO;
using Gtk;
using MonoDevelop.Core;
+using MonoDevelop.Components;
using MonoDevelop.Components.Commands;
-using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide;
using System.Linq;
namespace MonoDevelop.VersionControl.Views
{
- public interface ILogView : IAttachableViewContent
+ public interface ILogView
{
}
- public class LogView : BaseView, ILogView
+ class LogView : BaseView, ILogView
{
LogWidget widget;
VersionInfo vinfo;
@@ -44,7 +44,7 @@ namespace MonoDevelop.VersionControl.Views
widget = lw;
info.Updated += OnInfoUpdated;
lw.History = this.info.History;
- vinfo = this.info.VersionInfo;
+ vinfo = this.info.Item.VersionInfo;
if (WorkbenchWindow != null)
widget.SetToolbar (WorkbenchWindow.GetToolbar (this));
@@ -53,7 +53,7 @@ namespace MonoDevelop.VersionControl.Views
void OnInfoUpdated (object sender, EventArgs e)
{
widget.History = this.info.History;
- vinfo = this.info.VersionInfo;
+ vinfo = this.info.Item.VersionInfo;
}
[Obsolete]
@@ -70,7 +70,7 @@ namespace MonoDevelop.VersionControl.Views
// Widget setup
VersionControlDocumentInfo info =new VersionControlDocumentInfo (null, null, vc);
info.History = history;
- info.VersionInfo = vinfo;
+ info.Item.VersionInfo = vinfo;
var lw = new LogWidget (info);
widget = lw;
@@ -78,7 +78,7 @@ namespace MonoDevelop.VersionControl.Views
}
- public override Gtk.Widget Control {
+ public override Control Control {
get {
if (widget == null)
CreateControlFromInfo ();
@@ -86,9 +86,9 @@ namespace MonoDevelop.VersionControl.Views
}
}
- protected override void OnWorkbenchWindowChanged (EventArgs e)
+ protected override void OnWorkbenchWindowChanged ()
{
- base.OnWorkbenchWindowChanged (e);
+ base.OnWorkbenchWindowChanged ();
if (WorkbenchWindow != null && widget != null)
widget.SetToolbar (WorkbenchWindow.GetToolbar (this));
}
@@ -110,8 +110,7 @@ namespace MonoDevelop.VersionControl.Views
base.Dispose ();
}
- #region IAttachableViewContent implementation
- public void Selected ()
+ public void Init ()
{
if (info != null && !info.Started) {
widget.ShowLoading ();
@@ -119,19 +118,11 @@ namespace MonoDevelop.VersionControl.Views
}
}
- public void Deselected ()
+ protected override void OnSelected ()
{
+ Init ();
}
- public void BeforeSave ()
- {
- }
-
- public void BaseContentChanged ()
- {
- }
- #endregion
-
[CommandHandler (MonoDevelop.Ide.Commands.EditCommands.Copy)]
protected void OnCopy ()
{
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs
index 32905950ad..af0744795b 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs
@@ -1,21 +1,21 @@
-//
+//
// LogWidget.cs
-//
+//
// Author:
// Mike Krüger <mkrueger@novell.com>
-//
+//
// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
-//
+//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
-//
+//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
-//
+//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -32,6 +32,8 @@ using MonoDevelop.Ide;
using System.Text;
using System.Threading;
using MonoDevelop.Components;
+using Mono.TextEditor;
+using System.Linq;
namespace MonoDevelop.VersionControl.Views
{
@@ -49,10 +51,10 @@ namespace MonoDevelop.VersionControl.Views
}
}
- ListStore logstore = new ListStore (typeof (Revision));
+ ListStore logstore = new ListStore (typeof (Revision), typeof(string));
FileTreeView treeviewFiles;
TreeStore changedpathstore;
- Gtk.Button revertButton, revertToButton, refreshButton;
+ DocumentToolButton revertButton, revertToButton, refreshButton;
SearchEntry searchEntry;
string currentFilter;
@@ -91,7 +93,21 @@ namespace MonoDevelop.VersionControl.Views
double center_x = cell_area.X + Math.Round ((double) (cell_area.Width / 2d));
double center_y = cell_area.Y + Math.Round ((double) (cell_area.Height / 2d));
cr.Arc (center_x, center_y, 5, 0, 2 * Math.PI);
- cr.SetSourceRGBA (0, 0, 0, 1);
+ var state = StateType.Normal;
+ if (!base.Sensitive)
+ state = StateType.Insensitive;
+ else if (flags.HasFlag (CellRendererState.Selected)) {
+ if (widget.HasFocus)
+ state = StateType.Selected;
+ else
+ state = StateType.Active;
+ }
+ else if (flags.HasFlag (CellRendererState.Prelit))
+ state = StateType.Prelight;
+ else if (widget.State == StateType.Insensitive)
+ state = StateType.Insensitive;
+
+ cr.SetSourceColor (widget.Style.Text (state).ToCairoColor ());
cr.Stroke ();
if (!FirstNode) {
cr.MoveTo (center_x, cell_area.Y - 2);
@@ -124,11 +140,11 @@ namespace MonoDevelop.VersionControl.Views
vpaned1 = vpaned1.ReplaceWithWidget (new VPanedThin () { HandleWidget = separator }, true);
revertButton = new DocumentToolButton ("vc-revert-command", GettextCatalog.GetString ("Revert changes from this revision"));
- revertButton.Sensitive = false;
+ revertButton.GetNativeWidget<Gtk.Widget> ().Sensitive = false;
revertButton.Clicked += new EventHandler (RevertRevisionClicked);
revertToButton = new DocumentToolButton ("vc-revert-command", GettextCatalog.GetString ("Revert to this revision"));
- revertToButton.Sensitive = false;
+ revertToButton.GetNativeWidget<Gtk.Widget> ().Sensitive = false;
revertToButton.Clicked += new EventHandler (RevertToRevisionClicked);
refreshButton = new DocumentToolButton (Gtk.Stock.Refresh, GettextCatalog.GetString ("Refresh"));
@@ -237,16 +253,29 @@ namespace MonoDevelop.VersionControl.Views
tb.UseChildBackgroundColor = true;
tb.Add (scrolledwindow1);
vbox2.PackStart (tb, true, true, 0);
+
+ UpdateStyle ();
+ Ide.Gui.Styles.Changed += HandleStylesChanged;
}
protected override void OnRealized ()
{
base.OnRealized ();
+ UpdateStyle ();
+ }
+
+ void HandleStylesChanged (object sender, EventArgs e)
+ {
+ UpdateStyle ();
+ }
+
+ void UpdateStyle ()
+ {
var c = Style.Base (StateType.Normal).ToXwtColor ();
c.Light *= 0.8;
commitBox.ModifyBg (StateType.Normal, c.ToGdkColor ());
- var tcol = new Gdk.Color (255, 251, 242);
+ var tcol = Styles.LogView.CommitDescBackgroundColor.ToGdkColor ();
textviewDetails.ModifyBase (StateType.Normal, tcol);
scrolledwindow1.ModifyBase (StateType.Normal, tcol);
}
@@ -266,6 +295,13 @@ namespace MonoDevelop.VersionControl.Views
toolbar.ShowAll ();
}
+
+ static void SetLogSearchFilter (ListStore store, string filter)
+ {
+ TreeIter iter;
+ if (store.GetIterFirst (out iter))
+ store.SetValue (iter, 1, filter);
+ }
bool filtering;
void HandleSearchEntryFilterChanged (object sender, EventArgs e)
@@ -276,6 +312,7 @@ namespace MonoDevelop.VersionControl.Views
GLib.Timeout.Add (100, delegate {
filtering = false;
currentFilter = searchEntry.Entry.Text;
+ SetLogSearchFilter (logstore, currentFilter);
UpdateHistory ();
return false;
});
@@ -292,7 +329,7 @@ namespace MonoDevelop.VersionControl.Views
Revision d = SelectedRevision;
if (RevertRevisionsCommands.RevertToRevision (info.Repository, info.Item.Path, d, false))
VersionControlService.SetCommitComment (info.Item.Path,
- string.Format ("(Revert to revision {0})", d.ToString ()), true);
+ GettextCatalog.GetString ("(Revert to revision {0})", d.ToString ()), true);
}
void RevertRevisionClicked (object src, EventArgs args)
@@ -300,17 +337,17 @@ namespace MonoDevelop.VersionControl.Views
Revision d = SelectedRevision;
if (RevertRevisionsCommands.RevertRevision (info.Repository, info.Item.Path, d, false))
VersionControlService.SetCommitComment (info.Item.Path,
- string.Format ("(Revert revision {0})", d.ToString ()), true);
+ GettextCatalog.GetString ("(Revert revision {0})", d.ToString ()), true);
}
void RefreshClicked (object src, EventArgs args)
{
ShowLoading ();
info.Start (true);
- revertButton.Sensitive = revertToButton.Sensitive = false;
+ revertButton.GetNativeWidget<Gtk.Widget> ().Sensitive = revertToButton.GetNativeWidget<Gtk.Widget> ().Sensitive = false;
}
- void HandleTreeviewFilesDiffLineActivated (object sender, EventArgs e)
+ async void HandleTreeviewFilesDiffLineActivated (object sender, EventArgs e)
{
TreePath[] paths = treeviewFiles.Selection.GetSelectedRows ();
@@ -324,7 +361,9 @@ namespace MonoDevelop.VersionControl.Views
int line = diffRenderer.GetSelectedLine (paths[0]);
if (line == -1)
line = 1;
- var doc = IdeApp.Workbench.OpenDocument (fileName, line, 0, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
+
+ var proj = IdeApp.Workspace.GetProjectsContainingFile (fileName).FirstOrDefault ();
+ var doc = await IdeApp.Workbench.OpenDocument (fileName, proj, line, 0, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
int i = 1;
foreach (var content in doc.Window.SubViewContents) {
DiffView diffView = content as DiffView;
@@ -366,7 +405,10 @@ namespace MonoDevelop.VersionControl.Views
} catch (Exception e) {
Application.Invoke (delegate {
LoggingService.LogError ("Error while getting revision text", e);
- MessageService.ShowError ("Error while getting revision text.", "The file may not be part of the working copy.");
+ MessageService.ShowError (
+ GettextCatalog.GetString ("Error while getting revision text."),
+ GettextCatalog.GetString ("The file may not be part of the working copy.")
+ );
});
return;
}
@@ -375,14 +417,14 @@ namespace MonoDevelop.VersionControl.Views
prevRev = rev.GetPrevious ();
} catch (Exception e) {
Application.Invoke (delegate {
- MessageService.ShowError ("Error while getting previous revision.", e);
+ MessageService.ShowError (GettextCatalog.GetString ("Error while getting previous revision."), e);
});
return;
}
string[] lines;
// Indicator that the file was binary
if (text == null) {
- lines = new [] { " Binary files differ" };
+ lines = new [] { GettextCatalog.GetString (" Binary files differ") };
} else {
var changedDocument = Mono.TextEditor.TextDocument.CreateImmutableDocument (text);
if (prevRev == null) {
@@ -395,9 +437,12 @@ namespace MonoDevelop.VersionControl.Views
try {
prevRevisionText = info.Repository.GetTextAtRevision (path, prevRev);
} catch (Exception e) {
- Application.Invoke (delegate {
- LoggingService.LogError ("Error while getting revision text", e);
- MessageService.ShowError ("Error while getting revision text.", "The file may not be part of the working copy.");
+ Application.Invoke (delegate {
+ LoggingService.LogError ("Error while getting revision text", e);
+ MessageService.ShowError (
+ GettextCatalog.GetString ("Error while getting revision text."),
+ GettextCatalog.GetString ("The file may not be part of the working copy.")
+ );
});
return;
}
@@ -412,8 +457,8 @@ namespace MonoDevelop.VersionControl.Views
}
var originalDocument = Mono.TextEditor.TextDocument.CreateImmutableDocument (prevRevisionText);
- originalDocument.FileName = "Revision " + prevRev;
- changedDocument.FileName = "Revision " + rev;
+ originalDocument.FileName = GettextCatalog.GetString ("Revision {0}", prevRev);
+ changedDocument.FileName = GettextCatalog.GetString ("Revision {0}", rev);
lines = Mono.TextEditor.Utils.Diff.GetDiffString (originalDocument, changedDocument).Split ('\n');
}
}
@@ -448,17 +493,23 @@ namespace MonoDevelop.VersionControl.Views
});
});
}*/
-
- public override void Destroy ()
+
+ protected override void OnDestroyed ()
{
- base.Destroy ();
+ revertButton.Clicked -= RevertRevisionClicked;
+ revertToButton.Clicked -= RevertToRevisionClicked;
+ refreshButton.Clicked -= RefreshClicked;
+ Ide.Gui.Styles.Changed -= HandleStylesChanged;
+
logstore.Dispose ();
changedpathstore.Dispose ();
-
+
diffRenderer.Dispose ();
messageRenderer.Dispose ();
textRenderer.Dispose ();
treeviewFiles.Dispose ();
+
+ base.OnDestroyed ();
}
static void DateFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
@@ -490,9 +541,21 @@ namespace MonoDevelop.VersionControl.Views
model.IterNthChild (out node, model.IterNChildren () - 1);
renderer.LastNode = node.Equals (iter);
}
+
+ static string GetCurrentFilter (Gtk.TreeModel model)
+ {
+ TreeIter filterIter;
+ string filter = string.Empty;
+ if (model.GetIterFirst (out filterIter))
+ filter = (string)model.GetValue (filterIter, 1);
+
+ return filter;
+ }
- void MessageFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
+ static void MessageFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
+ string filter = GetCurrentFilter (model);
+
CellRendererText renderer = (CellRendererText)cell;
var rev = (Revision)model.GetValue (iter, 0);
if (string.IsNullOrEmpty (rev.Message)) {
@@ -502,15 +565,17 @@ namespace MonoDevelop.VersionControl.Views
int idx = message.IndexOf ('\n');
if (idx > 0)
message = message.Substring (0, idx);
- if (string.IsNullOrEmpty (currentFilter))
+ if (string.IsNullOrEmpty (filter))
renderer.Text = message;
else
- renderer.Markup = EscapeWithFilterMarker (message);
+ renderer.Markup = EscapeWithFilterMarker (message, filter);
}
}
- void AuthorFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
+ static void AuthorFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
+ string filter = GetCurrentFilter (model);
+
CellRendererText renderer = (CellRendererText)cell;
var rev = (Revision)model.GetValue (iter, 0);
string author = rev.Author;
@@ -519,13 +584,13 @@ namespace MonoDevelop.VersionControl.Views
int idx = author.IndexOf ("<", StringComparison.Ordinal);
if (idx >= 0 && idx < author.IndexOf (">", StringComparison.Ordinal))
author = author.Substring (0, idx).Trim ();
- if (string.IsNullOrEmpty (currentFilter))
+ if (string.IsNullOrEmpty (filter))
renderer.Text = author;
else
- renderer.Markup = EscapeWithFilterMarker (author);
+ renderer.Markup = EscapeWithFilterMarker (author, filter);
}
- void AuthorIconFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
+ static void AuthorIconFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
CellRendererImage renderer = (CellRendererImage)cell;
var rev = (Revision)model.GetValue (iter, 0);
@@ -537,29 +602,32 @@ namespace MonoDevelop.VersionControl.Views
if (img.Downloading) {
img.Completed += (sender, e) => {
renderer.Image = img.Image;
- if (logstore.IterIsValid (iter))
+ if (((ListStore)model).IterIsValid (iter))
model.EmitRowChanged (model.GetPath (iter), iter);
};
}
}
- void RevisionFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
+ static void RevisionFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
+ string filter = GetCurrentFilter (model);
+
CellRendererText renderer = (CellRendererText)cell;
var rev = model.GetValue (iter, 0).ToString ();
- if (string.IsNullOrEmpty (currentFilter))
+ if (string.IsNullOrEmpty (filter))
renderer.Text = rev;
else
- renderer.Markup = EscapeWithFilterMarker (rev);
+ renderer.Markup = EscapeWithFilterMarker (rev, filter);
}
- void SetDiffCellData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
+ static void SetDiffCellData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
CellRendererDiff rc = (CellRendererDiff)cell;
- string[] lines = (string[])changedpathstore.GetValue (iter, colDiff);
+ string[] lines = (string[])model.GetValue (iter, colDiff);
if (lines == null)
- lines = new string[] { (string)changedpathstore.GetValue (iter, colOperation) };
- rc.InitCell (treeviewFiles, changedpathstore.IterDepth (iter) != 0, lines, changedpathstore.GetPath (iter));
+ lines = new string[] { (string)model.GetValue (iter, colOperation) };
+
+ rc.InitCell (tree_column.TreeView, ((TreeStore)model).IterDepth (iter) != 0, lines, model.GetPath (iter));
}
protected override void OnSizeAllocated (Gdk.Rectangle allocation)
@@ -605,7 +673,7 @@ namespace MonoDevelop.VersionControl.Views
if (d == null)
return;
- revertButton.Sensitive = revertToButton.Sensitive = true;
+ revertButton.GetNativeWidget<Gtk.Widget> ().Sensitive = revertToButton.GetNativeWidget<Gtk.Widget> ().Sensitive = true;
Gtk.TreeIter selectIter = Gtk.TreeIter.Zero;
bool select = false;
foreach (RevisionPath rp in info.Repository.GetRevisionChanges (d)) {
@@ -664,14 +732,17 @@ namespace MonoDevelop.VersionControl.Views
{
scrolledLoading.Hide ();
scrolledLog.Show ();
+ treeviewLog.FreezeChildNotify ();
logstore.Clear ();
var h = History;
if (h == null)
return;
foreach (var rev in h) {
if (MatchesFilter (rev))
- logstore.AppendValues (rev);
+ logstore.InsertWithValues (-1, rev, string.Empty);
}
+ SetLogSearchFilter (logstore, currentFilter);
+ treeviewLog.ThawChildNotify ();
}
bool MatchesFilter (Revision rev)
@@ -691,12 +762,12 @@ namespace MonoDevelop.VersionControl.Views
return false;
}
- string EscapeWithFilterMarker (string txt)
+ static string EscapeWithFilterMarker (string txt, string filter)
{
- if (string.IsNullOrEmpty (currentFilter))
+ if (string.IsNullOrEmpty (filter))
return GLib.Markup.EscapeText (txt);
- int i = txt.IndexOf (currentFilter, StringComparison.CurrentCultureIgnoreCase);
+ int i = txt.IndexOf (filter, StringComparison.CurrentCultureIgnoreCase);
if (i == -1)
return GLib.Markup.EscapeText (txt);
@@ -704,9 +775,9 @@ namespace MonoDevelop.VersionControl.Views
int last = 0;
while (i != -1) {
sb.Append (GLib.Markup.EscapeText (txt.Substring (last, i - last)));
- sb.Append ("<span color='blue'>").Append (txt.Substring (i, currentFilter.Length)).Append ("</span>");
- last = i + currentFilter.Length;
- i = txt.IndexOf (currentFilter, last, StringComparison.CurrentCultureIgnoreCase);
+ sb.Append ("<span color='" + Styles.LogView.SearchSnippetTextColor + "'>").Append (txt.Substring (i, filter.Length)).Append ("</span>");
+ last = i + filter.Length;
+ i = txt.IndexOf (filter, last, StringComparison.CurrentCultureIgnoreCase);
}
if (last < txt.Length)
sb.Append (GLib.Markup.EscapeText (txt.Substring (last, txt.Length - last)));
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeView.cs
index 8cb107fa2d..5aca9300d7 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeView.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeView.cs
@@ -1,21 +1,21 @@
-//
+//
// MergeView.cs
-//
+//
// Author:
// Mike Krüger <mkrueger@novell.com>
-//
+//
// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
-//
+//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
-//
+//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
-//
+//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -23,12 +23,12 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using MonoDevelop.Ide.Gui;
+using MonoDevelop.Components;
using MonoDevelop.Core;
namespace MonoDevelop.VersionControl.Views
{
- public interface IMergeView : IAttachableViewContent
+ public interface IMergeView
{
}
@@ -37,7 +37,7 @@ namespace MonoDevelop.VersionControl.Views
VersionControlDocumentInfo info;
MergeWidget widget;
- public override Gtk.Widget Control {
+ public override Control Control {
get {
if (widget == null) {
widget = new MergeWidget ();
@@ -53,22 +53,18 @@ namespace MonoDevelop.VersionControl.Views
this.info = info;
}
- public void Selected ()
+ protected override void OnSelected ()
{
widget.UpdateLocalText ();
widget.info.Start ();
- }
-
- public void Deselected ()
- {
- }
-
- public void BeforeSave ()
- {
- }
- public void BaseContentChanged ()
- {
+ var buffer = info.Document.GetContent<MonoDevelop.Ide.Editor.TextEditor> ();
+ if (buffer != null) {
+ var loc = buffer.CaretLocation;
+ int line = loc.Line < 1 ? 1 : loc.Line;
+ int column = loc.Column < 1 ? 1 : loc.Column;
+ widget.MainEditor.SetCaretTo (line, column);
+ }
}
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeWidget.cs
index ab9c7898d6..2c7e09f2e0 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeWidget.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/MergeWidget.cs
@@ -38,7 +38,7 @@ namespace MonoDevelop.VersionControl.Views
{
public class MergeWidget : EditorCompareWidgetBase
{
- protected override TextEditor MainEditor {
+ protected internal override MonoTextEditor MainEditor {
get {
return editors != null && editors.Length >= 2 ? editors[1] : null;
}
@@ -49,7 +49,7 @@ namespace MonoDevelop.VersionControl.Views
MainEditor.Document.TextReplaced += UpdateConflictsOnTextReplace;
}
- protected override void UndoChange (TextEditor fromEditor, TextEditor toEditor, Hunk hunk)
+ protected override void UndoChange (MonoTextEditor fromEditor, MonoTextEditor toEditor, Hunk hunk)
{
base.UndoChange (fromEditor, toEditor, hunk);
int i = leftConflicts.IndexOf (hunk);
@@ -100,9 +100,9 @@ namespace MonoDevelop.VersionControl.Views
protected override void CreateComponents ()
{
this.editors = new [] {
- new TextEditor (new TextDocument (), new CommonTextEditorOptions ()),
- new TextEditor (new TextDocument (), new CommonTextEditorOptions ()),
- new TextEditor (new TextDocument (), new CommonTextEditorOptions ()),
+ new MonoTextEditor (new TextDocument (), CommonTextEditorOptions.Instance),
+ new MonoTextEditor (new TextDocument (), CommonTextEditorOptions.Instance),
+ new MonoTextEditor (new TextDocument (), CommonTextEditorOptions.Instance),
};
this.editors[0].Document.ReadOnly = true;
@@ -173,8 +173,8 @@ namespace MonoDevelop.VersionControl.Views
public override void UpdateDiff ()
{
- LeftDiff = new List<Hunk> (editors[0].Document.Diff (MainEditor.Document));
- RightDiff = new List<Hunk> (editors[2].Document.Diff (MainEditor.Document));
+ LeftDiff = new List<Hunk> (editors[0].Document.Diff (MainEditor.Document, includeEol: false));
+ RightDiff = new List<Hunk> (editors[2].Document.Diff (MainEditor.Document, includeEol: false));
DocumentLine line;
LeftDiff.RemoveAll (item => null != (line = MainEditor.Document.GetLine (item.InsertStart)) &&
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs
index 7fa5424919..68592fd2b0 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/StatusView.cs
@@ -8,13 +8,11 @@ using Mono.Addins;
using Gtk;
using MonoDevelop.Core;
+using MonoDevelop.Components;
using MonoDevelop.Components.Commands;
using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.Ide;
-using MonoDevelop.Ide.Gui;
using Mono.TextEditor;
-using MonoDevelop.Components;
using System.Text;
namespace MonoDevelop.VersionControl.Views
@@ -46,7 +44,8 @@ namespace MonoDevelop.VersionControl.Views
List<VersionInfo> statuses;
bool remoteStatus = false;
- class DiffData {
+ class DiffData
+ {
public Exception Exception {
get; private set;
}
@@ -277,7 +276,7 @@ namespace MonoDevelop.VersionControl.Views
}
public StatusView (string filepath, Repository vc, VersionControlItemList list)
- : base (Path.GetFileName (filepath) + " Status")
+ : base (GettextCatalog.GetString ("{0} Status", Path.GetFileName (filepath)))
{
this.vc = vc;
this.filepath = Directory.Exists (filepath) ? filepath : Path.GetDirectoryName (filepath);
@@ -290,9 +289,9 @@ namespace MonoDevelop.VersionControl.Views
Init ();
}
- protected override void OnWorkbenchWindowChanged (EventArgs e)
+ protected override void OnWorkbenchWindowChanged ()
{
- base.OnWorkbenchWindowChanged (e);
+ base.OnWorkbenchWindowChanged ();
if (WorkbenchWindow == null)
return;
@@ -357,10 +356,6 @@ namespace MonoDevelop.VersionControl.Views
toolbar.ShowAll ();
}
- public override string StockIconId {
- get { return "vc-status"; }
- }
-
int CompareNodes (Gtk.TreeModel model, Gtk.TreeIter a, Gtk.TreeIter b)
{
int col, val=0;
@@ -436,7 +431,7 @@ namespace MonoDevelop.VersionControl.Views
base.Dispose ();
}
- public override Gtk.Widget Control {
+ public override Control Control {
get {
return widget;
}
@@ -458,7 +453,7 @@ namespace MonoDevelop.VersionControl.Views
ThreadPool.QueueUserWorkItem (delegate {
if (fileList != null) {
- var group = fileList.GroupBy (v => v.IsDirectory || v.WorkspaceObject is SolutionItem);
+ var group = fileList.GroupBy (v => v.IsDirectory || v.WorkspaceObject is SolutionFolderItem);
foreach (var item in group) {
// Is directory.
if (item.Key) {
@@ -472,7 +467,7 @@ namespace MonoDevelop.VersionControl.Views
}
List<VersionInfo> newList = new List<VersionInfo> ();
newList.AddRange (vc.GetDirectoryVersionInfo (filepath, remoteStatus, true));
- DispatchService.GuiDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
if (!disposed)
LoadStatus (newList);
});
@@ -579,7 +574,7 @@ namespace MonoDevelop.VersionControl.Views
}
}
- TreeIter AppendFileInfo (VersionInfo n)
+ TreeIter AppendFileInfo (VersionInfo n, bool expanded)
{
Xwt.Drawing.Image statusicon = VersionControlService.LoadIconForStatus(n.Status);
string lstatus = VersionControlService.GetStatusLabel (n.Status);
@@ -604,10 +599,18 @@ namespace MonoDevelop.VersionControl.Views
TreeIter it = filestore.AppendValues (statusicon, lstatus, GLib.Markup.EscapeText (localpath).Split ('\n'), rstatus, commit, false, n.LocalPath.ToString (), true, hasComment, fileIcon, n.HasLocalChanges, rstatusicon, scolor, n.HasRemoteChange (VersionStatus.Modified));
if (!n.IsDirectory)
- filestore.AppendValues (it, statusicon, "", new string[0], "", false, true, n.LocalPath.ToString (), false, false, fileIcon, false, null, null, false);
+ filestore.AppendValues (it, statusicon, "", new string[0], "", false, true, n.LocalPath.ToString (), false, false, fileIcon, false, null, null, false);
+ if (expanded)
+ filelist.ExpandRow (filestore.GetPath (it), open_all: false);
+
return it;
}
+ TreeIter AppendFileInfo (VersionInfo n)
+ {
+ return AppendFileInfo (n, expanded: false);
+ }
+
string[] GetCurrentFiles ()
{
TreePath[] paths = filelist.Selection.GetSelectedRows ();
@@ -776,12 +779,17 @@ namespace MonoDevelop.VersionControl.Views
void OnTestExpandRow (object sender, Gtk.TestExpandRowArgs args)
{
- bool filled = (bool) filestore.GetValue (args.Iter, ColFilled);
+ OnRowExpanded (args.Iter);
+ }
+
+ void OnRowExpanded (TreeIter it)
+ {
+ bool filled = (bool) filestore.GetValue (it, ColFilled);
if (!filled) {
- filestore.SetValue (args.Iter, ColFilled, true);
+ filestore.SetValue (it, ColFilled, true);
TreeIter iter;
- filestore.IterChildren (out iter, args.Iter);
- string fileName = (string) filestore.GetValue (args.Iter, ColFullPath);
+ filestore.IterChildren (out iter, it);
+ string fileName = (string) filestore.GetValue (it, ColFullPath);
FillDiffInfo (iter, fileName, GetDiffData (remoteStatus));
}
}
@@ -816,7 +824,7 @@ namespace MonoDevelop.VersionControl.Views
string[] files = GetCurrentFiles ();
VersionControlItemList items = new VersionControlItemList ();
foreach (string file in files) {
- Project prj = IdeApp.Workspace.GetProjectContainingFile (file);
+ Project prj = IdeApp.Workspace.GetProjectsContainingFile (file).FirstOrDefault ();
items.Add (new VersionControlItem (vc, prj, file, Directory.Exists (file), null));
}
return items;
@@ -924,13 +932,16 @@ namespace MonoDevelop.VersionControl.Views
if (line == -1)
line = 1;
}
- IdeApp.Workbench.OpenDocument (files [0], line, 0);
+ var proj = IdeApp.Workspace.GetProjectsContainingFile (files [0]).FirstOrDefault ();
+ IdeApp.Workbench.OpenDocument (files [0], proj, line, 0);
}
else {
AlertButton openAll = new AlertButton (GettextCatalog.GetString ("_Open All"));
if (MessageService.AskQuestion (GettextCatalog.GetString ("Do you want to open all {0} files?", files.Length), AlertButton.Cancel, openAll) == openAll) {
- for (int n=0; n<files.Length; n++)
- IdeApp.Workbench.OpenDocument (files[n], n==0);
+ for (int n = 0; n < files.Length; n++) {
+ var proj = IdeApp.Workspace.GetProjectsContainingFile (files [n]).FirstOrDefault ();
+ IdeApp.Workbench.OpenDocument (files [n], proj, n == 0);
+ }
}
}
}
@@ -959,6 +970,7 @@ namespace MonoDevelop.VersionControl.Views
}
bool found = false;
+ bool wasExpanded = false;
int oldStatusIndex;
TreeIter oldStatusIter = TreeIter.Zero;
@@ -979,6 +991,7 @@ namespace MonoDevelop.VersionControl.Views
if (filestore.GetIterFirst (out oldStatusIter)) {
do {
if (args.FilePath == (string) filestore.GetValue (oldStatusIter, ColFullPath)) {
+ wasExpanded = filelist.GetRowExpanded (filestore.GetPath (oldStatusIter));
found = true;
break;
}
@@ -1013,21 +1026,34 @@ namespace MonoDevelop.VersionControl.Views
}
statuses [oldStatusIndex] = newInfo;
+ InvalidateDiffData (args.FilePath, false, newInfo);
+ InvalidateDiffData (args.FilePath, true, newInfo);
// Update the tree
- AppendFileInfo (newInfo);
+ AppendFileInfo (newInfo, wasExpanded);
filestore.Remove (ref oldStatusIter);
}
else {
if (FileVisible (newInfo)) {
statuses.Add (newInfo);
changeSet.AddFile (newInfo);
- AppendFileInfo (newInfo);
+ AppendFileInfo (newInfo, wasExpanded);
}
}
return true;
}
+ void InvalidateDiffData (FilePath path, bool remote, VersionInfo info)
+ {
+ var ddata = GetDiffData (remote);
+ var index = ddata.FindIndex (dobj => dobj.VersionInfo.LocalPath == path);
+ if (index != -1) {
+ ddata.RemoveAt (index);
+ }
+
+ ddata.Add (new DiffData (vc, filepath, info, remote));
+ }
+
static bool FileVisible (VersionInfo vinfo)
{
return vinfo != null && (vinfo.HasLocalChanges || vinfo.HasRemoteChanges);
@@ -1167,14 +1193,13 @@ namespace MonoDevelop.VersionControl.Views
return true;
}
- if (evnt.Key == Gdk.Key.space && CommitSelectionToggled != null) {
- CommitSelectionToggled (this, EventArgs.Empty);
+ if (evnt.Key == Gdk.Key.space) {
+ CommitSelectionToggled?.Invoke (this, EventArgs.Empty);
return true;
}
if (evnt.Key == Gdk.Key.Return || evnt.Key == Gdk.Key.KP_Enter) {
- if (DiffLineActivated != null)
- DiffLineActivated (this, EventArgs.Empty);
+ DiffLineActivated?.Invoke (this, EventArgs.Empty);
return true;
}
@@ -1196,8 +1221,8 @@ namespace MonoDevelop.VersionControl.Views
vpos = Vadjustment.Value;
keepPos = true;
if (Selection.PathIsSelected (path) && Selection.GetSelectedRows ().Length == 1 && evnt.Button == 1) {
- if (evnt.Type == Gdk.EventType.TwoButtonPress && DiffLineActivated != null)
- DiffLineActivated (this, EventArgs.Empty);
+ if (evnt.Type == Gdk.EventType.TwoButtonPress)
+ DiffLineActivated?.Invoke (this, EventArgs.Empty);
handled = true;
}
}
@@ -1233,8 +1258,7 @@ namespace MonoDevelop.VersionControl.Views
protected override bool OnPopupMenu()
{
- if (DoPopupMenu != null)
- DoPopupMenu (null);
+ DoPopupMenu?.Invoke (null);
return true;
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Styles.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Styles.cs
new file mode 100644
index 0000000000..ab82ba054d
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Styles.cs
@@ -0,0 +1,145 @@
+//
+// Styles.cs
+//
+// Author:
+// Vsevolod Kukol <sevo@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide;
+using MonoDevelop.Components;
+using Xwt.Drawing;
+
+namespace MonoDevelop.VersionControl
+{
+ public static class Styles
+ {
+ public static BlameViewStyle BlameView { get; internal set; }
+ public static LogViewStyle LogView { get; internal set; }
+ public static DiffViewStyle DiffView { get; internal set; }
+
+ public class BlameViewStyle
+ {
+ public Color AnnotationBackgroundColor { get; internal set; }
+ public Color AnnotationHighlightColor { get; internal set; }
+ public Color AnnotationTextColor { get; internal set; }
+ public Color AnnotationSummaryTextColor { get; internal set; }
+ public Color AnnotationSplitterColor { get; internal set; }
+ public Color AnnotationMarkColor { get; internal set; }
+ public Color AnnotationMarkModifiedColor { get; internal set; }
+ public Color RangeSplitterColor { get; internal set; }
+ public Color RangeHazeColor { get; internal set; }
+ }
+
+ public class LogViewStyle
+ {
+ public Color CommitDescBackgroundColor { get; internal set; }
+ public Color DiffAddBackgroundColor { get; internal set; }
+ public Color DiffRemoveBackgroundColor { get; internal set; }
+ public Color DiffHighlightColor { get; internal set; }
+ public Color DiffBoxBorderColor { get; internal set; }
+ public Color DiffBoxSplitterColor { get; internal set; }
+ // TODO: End up having this as Color at some point or cache the string in Xwt.Color.
+ public string SearchSnippetTextColor { get; internal set; }
+ }
+
+ public class DiffViewStyle
+ {
+ public Color AddBorderColor { get; internal set; }
+ public Color AddBackgroundColor { get; internal set; }
+ public Color RemoveBorderColor { get; internal set; }
+ public Color RemoveBackgroundColor { get; internal set; }
+ public Color MergeBorderColor { get; internal set; }
+ public Color MergeBackgroundColor { get; internal set; }
+ }
+
+ static Styles ()
+ {
+ LoadStyles ();
+ MonoDevelop.Ide.Gui.Styles.Changed += (o, e) => LoadStyles ();
+ }
+
+ public static void LoadStyles ()
+ {
+ if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light) {
+ BlameView = new BlameViewStyle {
+ AnnotationMarkColor = Color.FromName ("#e5f1ff"),
+ AnnotationMarkModifiedColor = Color.FromName ("#ffff00"),
+ RangeHazeColor = Color.FromName ("#ababab").WithAlpha (.1),
+ RangeSplitterColor = Color.FromName ("#ababab").WithAlpha (.2),
+ };
+
+ LogView = new LogViewStyle {
+ DiffAddBackgroundColor = Color.FromName ("#7bc87b").AddLight (0.1),
+ DiffRemoveBackgroundColor = Color.FromName ("#c88c8c").AddLight (0.1),
+ DiffHighlightColor = Color.FromName ("#000000").WithAlpha (0.05),
+ DiffBoxBorderColor = Color.FromName ("#eaeaea"),
+ SearchSnippetTextColor = "#f1c40f",
+ };
+
+ DiffView = new DiffViewStyle {
+ AddBackgroundColor = Color.FromName ("#85a885"),
+ AddBorderColor = Color.FromName ("#85a885"),
+ RemoveBackgroundColor = Color.FromName ("#b28c8c"),
+ RemoveBorderColor = Color.FromName ("#b28c8c"),
+ MergeBackgroundColor = Color.FromName ("#8585a8"),
+ MergeBorderColor = Color.FromName ("#8585a8"),
+ };
+ } else {
+ BlameView = new BlameViewStyle {
+ AnnotationMarkColor = Color.FromName ("#e5f1ff"),
+ AnnotationMarkModifiedColor = Color.FromName ("#ffff00"),
+ RangeHazeColor = Color.FromName ("#111111").WithAlpha (.4),
+ RangeSplitterColor = Color.FromName ("#5b5f68").WithAlpha (.6),
+ };
+
+ LogView = new LogViewStyle () {
+ DiffAddBackgroundColor = Color.FromName ("#7bc87b").AddLight (-0.1),
+ DiffRemoveBackgroundColor = Color.FromName ("#c88c8c").AddLight (-0.1),
+ DiffHighlightColor = MonoDevelop.Ide.Gui.Styles.BackgroundColor.AddLight (0.1),
+ DiffBoxBorderColor = Color.FromName ("#4c4c4c"),
+ SearchSnippetTextColor = "#f9d33c",
+ };
+
+ DiffView = new DiffViewStyle {
+ AddBackgroundColor = Color.FromName ("#85a885"),
+ AddBorderColor = Color.FromName ("#bef0be"),
+ RemoveBackgroundColor = Color.FromName ("#b28c8c"),
+ RemoveBorderColor = Color.FromName ("#ffffc8"),
+ MergeBackgroundColor = Color.FromName ("#8585a8"),
+ MergeBorderColor = Color.FromName ("#bebef0"),
+ };
+ }
+
+ // Shared
+
+ BlameView.AnnotationTextColor = MonoDevelop.Ide.Gui.Styles.BaseForegroundColor;
+ BlameView.AnnotationHighlightColor = MonoDevelop.Ide.Gui.Styles.SecondaryBackgroundLighterColor;
+ BlameView.AnnotationBackgroundColor = MonoDevelop.Ide.Gui.Styles.SecondaryBackgroundDarkerColor;
+ BlameView.AnnotationSplitterColor = MonoDevelop.Ide.Gui.Styles.SeparatorColor;
+ BlameView.AnnotationSummaryTextColor = MonoDevelop.Ide.Gui.Styles.DimTextColor;
+
+ LogView.CommitDescBackgroundColor = MonoDevelop.Ide.Gui.Styles.SecondaryBackgroundDarkerColor;
+ LogView.DiffBoxSplitterColor = MonoDevelop.Ide.Gui.Styles.PrimaryBackgroundColor;
+ }
+ }
+}
+
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/SubviewAttachmentHandler.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/SubviewAttachmentHandler.cs
index 9808922e3d..649b930411 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/SubviewAttachmentHandler.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/SubviewAttachmentHandler.cs
@@ -45,13 +45,13 @@ namespace MonoDevelop.VersionControl.Views
{
var document = Ide.IdeApp.Workbench.ActiveDocument;
try {
- if (document == null || !document.IsFile || document.Window.FindView<IDiffView> () >= 0)
+ if (document == null || !document.IsFile || document.Window.FindView<ILogView> () >= 0)
return;
- IWorkspaceObject project = document.Project;
+ WorkspaceObject project = document.Project;
if (project == null) {
// Fix for broken .csproj and .sln files not being seen as having a project.
- foreach (var projItem in Ide.IdeApp.Workspace.GetAllSolutionItems<UnknownSolutionItem> ()) {
+ foreach (var projItem in Ide.IdeApp.Workspace.GetAllItems<UnknownSolutionItem> ()) {
if (projItem.FileName == document.FileName) {
project = projItem;
}
@@ -71,10 +71,10 @@ namespace MonoDevelop.VersionControl.Views
var item = new VersionControlItem (repo, project, document.FileName, false, null);
var vcInfo = new VersionControlDocumentInfo (document.PrimaryView, item, item.Repository);
- TryAttachView <IDiffView> (document, vcInfo, DiffCommand.DiffViewHandlers);
- TryAttachView <IBlameView> (document, vcInfo, BlameCommand.BlameViewHandlers);
- TryAttachView <ILogView> (document, vcInfo, LogCommand.LogViewHandlers);
- TryAttachView <IMergeView> (document, vcInfo, MergeCommand.MergeViewHandlers);
+ TryAttachView (document, vcInfo, DiffCommand.DiffViewHandlers);
+ TryAttachView (document, vcInfo, BlameCommand.BlameViewHandlers);
+ TryAttachView (document, vcInfo, LogCommand.LogViewHandlers);
+ TryAttachView (document, vcInfo, MergeCommand.MergeViewHandlers);
} catch (Exception ex) {
// If a user is hitting this, it will show a dialog box every time they
// switch to a document or open a document, so suppress the crash dialog
@@ -83,10 +83,9 @@ namespace MonoDevelop.VersionControl.Views
}
}
- static void TryAttachView <T>(Document document, VersionControlDocumentInfo info, string type)
- where T : IAttachableViewContent
+ static void TryAttachView (Document document, VersionControlDocumentInfo info, string type)
{
- var handler = AddinManager.GetExtensionObjects<IVersionControlViewHandler<T>> (type)
+ var handler = AddinManager.GetExtensionObjects<IVersionControlViewHandler> (type)
.FirstOrDefault (h => h.CanHandle (info.Item, info.Document));
if (handler != null)
document.Window.AttachViewContent (handler.CreateView (info));
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/VersionControlDocumentInfo.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/VersionControlDocumentInfo.cs
index a002693010..9600b45fd7 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/VersionControlDocumentInfo.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/VersionControlDocumentInfo.cs
@@ -50,12 +50,6 @@ namespace MonoDevelop.VersionControl.Views
get;
set;
}
-
- [Obsolete ("Use Item.VersionInfo instead of this.")]
- public VersionInfo VersionInfo {
- get;
- set;
- }
public Repository Repository {
get { return Item.Repository; }
@@ -82,12 +76,12 @@ namespace MonoDevelop.VersionControl.Views
lock (updateLock) {
try {
History = Item.Repository.GetHistory (Item.Path, null);
- VersionInfo = Item.Repository.GetVersionInfo (Item.Path, VersionInfoQueryFlags.IgnoreCache);
+ Item.VersionInfo = Item.Repository.GetVersionInfo (Item.Path, VersionInfoQueryFlags.IgnoreCache);
} catch (Exception ex) {
LoggingService.LogError ("Error retrieving history", ex);
}
- DispatchService.GuiDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
OnUpdated (EventArgs.Empty);
});
mre.Set ();
@@ -110,7 +104,7 @@ namespace MonoDevelop.VersionControl.Views
mre.WaitOne ();
mre.Dispose ();
mre = null;
- DispatchService.GuiDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
act ();
});
});
@@ -118,9 +112,7 @@ namespace MonoDevelop.VersionControl.Views
protected virtual void OnUpdated (EventArgs e)
{
- EventHandler handler = this.Updated;
- if (handler != null)
- handler (this, e);
+ Updated?.Invoke (this, e);
}
public event EventHandler Updated;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj
index 409f07e00f..af01aa4c91 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.csproj
@@ -18,6 +18,7 @@
<OutputPath>..\..\..\..\build\AddIns\VersionControl\</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Execution>
<Execution clr-version="Net_2_0" />
</Execution>
@@ -112,6 +113,18 @@
</Reference>
<Reference Include="System.Core" />
<Reference Include="Mono.Cairo" />
+ <Reference Include="System.Reflection.Metadata">
+ <HintPath>..\..\..\..\external\roslyn\Binaries\Release\System.Reflection.Metadata.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Collections.Immutable">
+ <HintPath>..\..\..\..\external\roslyn\Binaries\Release\System.Collections.Immutable.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis">
+ <HintPath>..\..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="icons\added-overlay-16.png">
@@ -120,24 +133,96 @@
<EmbeddedResource Include="icons\added-overlay-16%402x.png">
<LogicalName>added-overlay-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\added-overlay-16~dark.png">
+ <LogicalName>added-overlay-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\added-overlay-16~dark%402x.png">
+ <LogicalName>added-overlay-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\added-overlay-16~sel.png">
+ <LogicalName>added-overlay-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\added-overlay-16~sel%402x.png">
+ <LogicalName>added-overlay-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\added-overlay-16~dark~sel.png">
+ <LogicalName>added-overlay-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\added-overlay-16~dark~sel%402x.png">
+ <LogicalName>added-overlay-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\modified-overlay-16.png">
<LogicalName>modified-overlay-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\modified-overlay-16%402x.png">
<LogicalName>modified-overlay-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\modified-overlay-16~dark.png">
+ <LogicalName>modified-overlay-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\modified-overlay-16~dark%402x.png">
+ <LogicalName>modified-overlay-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\modified-overlay-16~sel.png">
+ <LogicalName>modified-overlay-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\modified-overlay-16~sel%402x.png">
+ <LogicalName>modified-overlay-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\modified-overlay-16~dark~sel.png">
+ <LogicalName>modified-overlay-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\modified-overlay-16~dark~sel%402x.png">
+ <LogicalName>modified-overlay-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\conflict-overlay-16.png">
<LogicalName>conflict-overlay-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\conflict-overlay-16%402x.png">
<LogicalName>conflict-overlay-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\conflict-overlay-16~dark.png">
+ <LogicalName>conflict-overlay-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\conflict-overlay-16~dark%402x.png">
+ <LogicalName>conflict-overlay-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\conflict-overlay-16~sel.png">
+ <LogicalName>conflict-overlay-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\conflict-overlay-16~sel%402x.png">
+ <LogicalName>conflict-overlay-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\conflict-overlay-16~dark~sel.png">
+ <LogicalName>conflict-overlay-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\conflict-overlay-16~dark~sel%402x.png">
+ <LogicalName>conflict-overlay-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\locked-overlay-16.png">
<LogicalName>locked-overlay-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\locked-overlay-16%402x.png">
<LogicalName>locked-overlay-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\locked-overlay-16~dark.png">
+ <LogicalName>locked-overlay-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\locked-overlay-16~dark%402x.png">
+ <LogicalName>locked-overlay-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\locked-overlay-16~sel.png">
+ <LogicalName>locked-overlay-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\locked-overlay-16~sel%402x.png">
+ <LogicalName>locked-overlay-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\locked-overlay-16~dark~sel.png">
+ <LogicalName>locked-overlay-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\locked-overlay-16~dark~sel%402x.png">
+ <LogicalName>locked-overlay-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="VersionControl.addin.xml">
<LogicalName>VersionControl.addin.xml</LogicalName>
</EmbeddedResource>
@@ -147,48 +232,180 @@
<EmbeddedResource Include="icons\removed-overlay-16%402x.png">
<LogicalName>removed-overlay-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\removed-overlay-16~dark.png">
+ <LogicalName>removed-overlay-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\removed-overlay-16~dark%402x.png">
+ <LogicalName>removed-overlay-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\removed-overlay-16~sel.png">
+ <LogicalName>removed-overlay-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\removed-overlay-16~sel%402x.png">
+ <LogicalName>removed-overlay-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\removed-overlay-16~dark~sel.png">
+ <LogicalName>removed-overlay-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\removed-overlay-16~dark~sel%402x.png">
+ <LogicalName>removed-overlay-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\renamed-overlay-16.png">
<LogicalName>renamed-overlay-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\renamed-overlay-16%402x.png">
<LogicalName>renamed-overlay-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\renamed-overlay-16~dark.png">
+ <LogicalName>renamed-overlay-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\renamed-overlay-16~dark%402x.png">
+ <LogicalName>renamed-overlay-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\renamed-overlay-16~sel.png">
+ <LogicalName>renamed-overlay-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\renamed-overlay-16~sel%402x.png">
+ <LogicalName>renamed-overlay-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\renamed-overlay-16~dark~sel.png">
+ <LogicalName>renamed-overlay-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\renamed-overlay-16~dark~sel%402x.png">
+ <LogicalName>renamed-overlay-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\ignored-overlay-16.png">
<LogicalName>ignored-overlay-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\ignored-overlay-16%402x.png">
<LogicalName>ignored-overlay-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\ignored-overlay-16~dark.png">
+ <LogicalName>ignored-overlay-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\ignored-overlay-16~dark%402x.png">
+ <LogicalName>ignored-overlay-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\ignored-overlay-16~sel.png">
+ <LogicalName>ignored-overlay-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\ignored-overlay-16~sel%402x.png">
+ <LogicalName>ignored-overlay-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\ignored-overlay-16~dark~sel.png">
+ <LogicalName>ignored-overlay-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\ignored-overlay-16~dark~sel%402x.png">
+ <LogicalName>ignored-overlay-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\repository-16.png">
<LogicalName>repository-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\repository-16%402x.png">
<LogicalName>repository-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\repository-16~dark.png">
+ <LogicalName>repository-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\repository-16~dark%402x.png">
+ <LogicalName>repository-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\versioned-overlay-16.png">
<LogicalName>versioned-overlay-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\versioned-overlay-16%402x.png">
<LogicalName>versioned-overlay-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\versioned-overlay-16~dark.png">
+ <LogicalName>versioned-overlay-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\versioned-overlay-16~dark%402x.png">
+ <LogicalName>versioned-overlay-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\versioned-overlay-16~sel.png">
+ <LogicalName>versioned-overlay-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\versioned-overlay-16~sel%402x.png">
+ <LogicalName>versioned-overlay-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\versioned-overlay-16~dark~sel.png">
+ <LogicalName>versioned-overlay-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\versioned-overlay-16~dark~sel%402x.png">
+ <LogicalName>versioned-overlay-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\unversioned-overlay-16.png">
<LogicalName>unversioned-overlay-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\unversioned-overlay-16%402x.png">
<LogicalName>unversioned-overlay-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\unversioned-overlay-16~dark.png">
+ <LogicalName>unversioned-overlay-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\unversioned-overlay-16~dark%402x.png">
+ <LogicalName>unversioned-overlay-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\unversioned-overlay-16~sel.png">
+ <LogicalName>unversioned-overlay-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\unversioned-overlay-16~sel%402x.png">
+ <LogicalName>unversioned-overlay-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\unversioned-overlay-16~dark~sel.png">
+ <LogicalName>unversioned-overlay-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\unversioned-overlay-16~dark~sel%402x.png">
+ <LogicalName>unversioned-overlay-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\lock-required-overlay-16.png">
<LogicalName>lock-required-overlay-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\lock-required-overlay-16%402x.png">
<LogicalName>lock-required-overlay-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\lock-required-overlay-16~dark.png">
+ <LogicalName>lock-required-overlay-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\lock-required-overlay-16~dark%402x.png">
+ <LogicalName>lock-required-overlay-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\lock-required-overlay-16~sel.png">
+ <LogicalName>lock-required-overlay-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\lock-required-overlay-16~sel%402x.png">
+ <LogicalName>lock-required-overlay-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\lock-required-overlay-16~dark~sel.png">
+ <LogicalName>lock-required-overlay-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\lock-required-overlay-16~dark~sel%402x.png">
+ <LogicalName>lock-required-overlay-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\unlocked-overlay-16.png">
<LogicalName>unlocked-overlay-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\unlocked-overlay-16%402x.png">
<LogicalName>unlocked-overlay-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\unlocked-overlay-16~dark.png">
+ <LogicalName>unlocked-overlay-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\unlocked-overlay-16~dark%402x.png">
+ <LogicalName>unlocked-overlay-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\unlocked-overlay-16~sel.png">
+ <LogicalName>unlocked-overlay-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\unlocked-overlay-16~sel%402x.png">
+ <LogicalName>unlocked-overlay-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\unlocked-overlay-16~dark~sel.png">
+ <LogicalName>unlocked-overlay-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\unlocked-overlay-16~dark~sel%402x.png">
+ <LogicalName>unlocked-overlay-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="Policies.xml">
<LogicalName>Policies.xml</LogicalName>
</EmbeddedResource>
@@ -201,125 +418,479 @@
<EmbeddedResource Include="icons\version-control-16%402x.png">
<LogicalName>version-control-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\version-control-16~dark.png">
+ <LogicalName>version-control-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\version-control-16~dark%402x.png">
+ <LogicalName>version-control-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\log-16.png">
<LogicalName>log-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\log-16%402x.png">
<LogicalName>log-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\log-16~dark.png">
+ <LogicalName>log-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\log-16~dark%402x.png">
+ <LogicalName>log-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\diff-16.png">
<LogicalName>diff-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\diff-16%402x.png">
<LogicalName>diff-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\diff-16~dark.png">
+ <LogicalName>diff-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\diff-16~dark%402x.png">
+ <LogicalName>diff-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\diff-16~disabled.png">
+ <LogicalName>diff-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\diff-16~disabled%402x.png">
+ <LogicalName>diff-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\diff-16~dark~disabled.png">
+ <LogicalName>diff-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\diff-16~dark~disabled%402x.png">
+ <LogicalName>diff-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-added-15.png">
+ <LogicalName>gutter-added-15.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-added-15%402x.png">
+ <LogicalName>gutter-added-15@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-removed-15.png">
+ <LogicalName>gutter-removed-15.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\gutter-removed-15%402x.png">
+ <LogicalName>gutter-removed-15@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\pull-16.png">
<LogicalName>pull-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\pull-16%402x.png">
<LogicalName>pull-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\pull-16~dark.png">
+ <LogicalName>pull-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pull-16~dark%402x.png">
+ <LogicalName>pull-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pull-16~disabled.png">
+ <LogicalName>pull-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pull-16~disabled%402x.png">
+ <LogicalName>pull-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pull-16~dark~disabled.png">
+ <LogicalName>pull-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pull-16~dark~disabled%402x.png">
+ <LogicalName>pull-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\push-16.png">
<LogicalName>push-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\push-16%402x.png">
<LogicalName>push-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\push-16~dark.png">
+ <LogicalName>push-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\push-16~dark%402x.png">
+ <LogicalName>push-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\push-16~disabled.png">
+ <LogicalName>push-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\push-16~disabled%402x.png">
+ <LogicalName>push-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\push-16~dark~disabled.png">
+ <LogicalName>push-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\push-16~dark~disabled%402x.png">
+ <LogicalName>push-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\refresh-16.png">
<LogicalName>refresh-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\refresh-16%402x.png">
<LogicalName>refresh-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\refresh-16~dark.png">
+ <LogicalName>refresh-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\refresh-16~dark%402x.png">
+ <LogicalName>refresh-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\refresh-16~disabled.png">
+ <LogicalName>refresh-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\refresh-16~disabled%402x.png">
+ <LogicalName>refresh-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\refresh-16~dark~disabled.png">
+ <LogicalName>refresh-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\refresh-16~dark~disabled%402x.png">
+ <LogicalName>refresh-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\local-status-16.png">
<LogicalName>local-status-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\local-status-16%402x.png">
<LogicalName>local-status-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\local-status-16~dark.png">
+ <LogicalName>local-status-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\local-status-16~dark%402x.png">
+ <LogicalName>local-status-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\commit-16.png">
<LogicalName>commit-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\commit-16%402x.png">
<LogicalName>commit-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\commit-16~dark.png">
+ <LogicalName>commit-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\commit-16~dark%402x.png">
+ <LogicalName>commit-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\commit-16~disabled.png">
+ <LogicalName>commit-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\commit-16~disabled%402x.png">
+ <LogicalName>commit-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\commit-16~dark~disabled.png">
+ <LogicalName>commit-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\commit-16~dark~disabled%402x.png">
+ <LogicalName>commit-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\remote-status-16.png">
<LogicalName>remote-status-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\remote-status-16%402x.png">
<LogicalName>remote-status-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\remote-status-16~dark.png">
+ <LogicalName>remote-status-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\remote-status-16~dark%402x.png">
+ <LogicalName>remote-status-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\remote-status-16~disabled.png">
+ <LogicalName>remote-status-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\remote-status-16~disabled%402x.png">
+ <LogicalName>remote-status-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\remote-status-16~dark~disabled.png">
+ <LogicalName>remote-status-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\remote-status-16~dark~disabled%402x.png">
+ <LogicalName>remote-status-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\vcs-added-16.png">
<LogicalName>vcs-added-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\vcs-added-16%402x.png">
<LogicalName>vcs-added-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-added-16~dark.png">
+ <LogicalName>vcs-added-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-added-16~dark%402x.png">
+ <LogicalName>vcs-added-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-added-16~disabled.png">
+ <LogicalName>vcs-added-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-added-16~disabled%402x.png">
+ <LogicalName>vcs-added-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-added-16~dark~disabled.png">
+ <LogicalName>vcs-added-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-added-16~dark~disabled%402x.png">
+ <LogicalName>vcs-added-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\vcs-removed-16.png">
<LogicalName>vcs-removed-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\vcs-removed-16%402x.png">
<LogicalName>vcs-removed-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-removed-16~dark.png">
+ <LogicalName>vcs-removed-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-removed-16~dark%402x.png">
+ <LogicalName>vcs-removed-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-removed-16~disabled.png">
+ <LogicalName>vcs-removed-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-removed-16~disabled%402x.png">
+ <LogicalName>vcs-removed-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-removed-16~dark~disabled.png">
+ <LogicalName>vcs-removed-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-removed-16~dark~disabled%402x.png">
+ <LogicalName>vcs-removed-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\vcs-renamed-16.png">
<LogicalName>vcs-renamed-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\vcs-renamed-16%402x.png">
<LogicalName>vcs-renamed-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-renamed-16~dark.png">
+ <LogicalName>vcs-renamed-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-renamed-16~dark%402x.png">
+ <LogicalName>vcs-renamed-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-renamed-16~disabled.png">
+ <LogicalName>vcs-renamed-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-renamed-16~disabled%402x.png">
+ <LogicalName>vcs-renamed-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-renamed-16~dark~disabled.png">
+ <LogicalName>vcs-renamed-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-renamed-16~dark~disabled%402x.png">
+ <LogicalName>vcs-renamed-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\vcs-conflicted-16.png">
<LogicalName>vcs-conflicted-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\vcs-conflicted-16%402x.png">
<LogicalName>vcs-conflicted-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-conflicted-16~dark.png">
+ <LogicalName>vcs-conflicted-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-conflicted-16~dark%402x.png">
+ <LogicalName>vcs-conflicted-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-conflicted-16~disabled.png">
+ <LogicalName>vcs-conflicted-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-conflicted-16~disabled%402x.png">
+ <LogicalName>vcs-conflicted-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-conflicted-16~dark~disabled.png">
+ <LogicalName>vcs-conflicted-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-conflicted-16~dark~disabled%402x.png">
+ <LogicalName>vcs-conflicted-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\vcs-modified-16.png">
<LogicalName>vcs-modified-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\vcs-modified-16%402x.png">
<LogicalName>vcs-modified-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-modified-16~dark.png">
+ <LogicalName>vcs-modified-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-modified-16~dark%402x.png">
+ <LogicalName>vcs-modified-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-modified-16~disabled.png">
+ <LogicalName>vcs-modified-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-modified-16~disabled%402x.png">
+ <LogicalName>vcs-modified-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-modified-16~dark~disabled.png">
+ <LogicalName>vcs-modified-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\vcs-modified-16~dark~disabled%402x.png">
+ <LogicalName>vcs-modified-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\comment-16.png">
<LogicalName>comment-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\comment-16%402x.png">
<LogicalName>comment-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\comment-16~dark.png">
+ <LogicalName>comment-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\comment-16~dark%402x.png">
+ <LogicalName>comment-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\comment-16~disabled.png">
+ <LogicalName>comment-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\comment-16~disabled%402x.png">
+ <LogicalName>comment-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\comment-16~dark~disabled.png">
+ <LogicalName>comment-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\comment-16~dark~disabled%402x.png">
+ <LogicalName>comment-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\revert-16.png">
<LogicalName>revert-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\revert-16%402x.png">
<LogicalName>revert-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\revert-16~dark.png">
+ <LogicalName>revert-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\revert-16~dark%402x.png">
+ <LogicalName>revert-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\revert-16~disabled.png">
+ <LogicalName>revert-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\revert-16~disabled%402x.png">
+ <LogicalName>revert-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\revert-16~dark~disabled.png">
+ <LogicalName>revert-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\revert-16~dark~disabled%402x.png">
+ <LogicalName>revert-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\branch-16.png">
<LogicalName>branch-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\branch-16%402x.png">
<LogicalName>branch-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\branch-16~dark.png">
+ <LogicalName>branch-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\branch-16~dark%402x.png">
+ <LogicalName>branch-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\branch-16~disabled.png">
+ <LogicalName>branch-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\branch-16~disabled%402x.png">
+ <LogicalName>branch-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\branch-16~dark~disabled.png">
+ <LogicalName>branch-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\branch-16~dark~disabled%402x.png">
+ <LogicalName>branch-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\tag-16.png">
<LogicalName>tag-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\tag-16%402x.png">
<LogicalName>tag-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\tag-16~dark.png">
+ <LogicalName>tag-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tag-16~dark%402x.png">
+ <LogicalName>tag-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tag-16~disabled.png">
+ <LogicalName>tag-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tag-16~disabled%402x.png">
+ <LogicalName>tag-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tag-16~dark~disabled.png">
+ <LogicalName>tag-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tag-16~dark~disabled%402x.png">
+ <LogicalName>tag-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-git-16.png">
<LogicalName>prefs-git-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-git-16%402x.png">
<LogicalName>prefs-git-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-git-16~dark.png">
+ <LogicalName>prefs-git-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-git-16~dark%402x.png">
+ <LogicalName>prefs-git-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-git-16~sel.png">
+ <LogicalName>prefs-git-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-git-16~sel%402x.png">
+ <LogicalName>prefs-git-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-git-16~dark~sel.png">
+ <LogicalName>prefs-git-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-git-16~dark~sel%402x.png">
+ <LogicalName>prefs-git-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-commit-message-style-16.png">
<LogicalName>prefs-commit-message-style-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-commit-message-style-16%402x.png">
<LogicalName>prefs-commit-message-style-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\prefs-version-control-general-16.png">
- <LogicalName>prefs-version-control-general-16.png</LogicalName>
+ <EmbeddedResource Include="icons\prefs-commit-message-style-16~dark.png">
+ <LogicalName>prefs-commit-message-style-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-commit-message-style-16~dark%402x.png">
+ <LogicalName>prefs-commit-message-style-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-commit-message-style-16~sel.png">
+ <LogicalName>prefs-commit-message-style-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-commit-message-style-16~sel%402x.png">
+ <LogicalName>prefs-commit-message-style-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-commit-message-style-16~dark~sel.png">
+ <LogicalName>prefs-commit-message-style-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-commit-message-style-16~dark~sel%402x.png">
+ <LogicalName>prefs-commit-message-style-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-version-control-16.png">
+ <LogicalName>prefs-version-control-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-version-control-16%402x.png">
+ <LogicalName>prefs-version-control-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-version-control-16~dark.png">
+ <LogicalName>prefs-version-control-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-version-control-16~dark%402x.png">
+ <LogicalName>prefs-version-control-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-version-control-16~sel.png">
+ <LogicalName>prefs-version-control-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-version-control-16~sel%402x.png">
+ <LogicalName>prefs-version-control-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-version-control-16~dark~sel.png">
+ <LogicalName>prefs-version-control-16~dark~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\prefs-version-control-general-16%402x.png">
- <LogicalName>prefs-version-control-general-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\prefs-version-control-16~dark~sel%402x.png">
+ <LogicalName>prefs-version-control-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
@@ -341,7 +912,6 @@
<Compile Include="MonoDevelop.VersionControl\Repository.cs" />
<Compile Include="MonoDevelop.VersionControl\RevertCommand.cs" />
<Compile Include="MonoDevelop.VersionControl\Revision.cs" />
- <Compile Include="MonoDevelop.VersionControl\Task.cs" />
<Compile Include="MonoDevelop.VersionControl\UnknownRepository.cs" />
<Compile Include="MonoDevelop.VersionControl\UpdateCommand.cs" />
<Compile Include="MonoDevelop.VersionControl\UrlBasedRepository.cs" />
@@ -407,7 +977,10 @@
<Compile Include="MonoDevelop.VersionControl.Dialogs\VersionControlSolutionOptionsPanel.cs" />
<Compile Include="AddinInfo.cs" />
<Compile Include="MonoDevelop.VersionControl\VersionControlException.cs" />
+ <Compile Include="MonoDevelop.VersionControl\VersionControlTask.cs" />
+ <Compile Include="MonoDevelop.VersionControl.Views\CommonTextEditorOptions.cs" />
<Compile Include="MonoDevelop.VersionControl.Views\BaseView.cs" />
+ <Compile Include="MonoDevelop.VersionControl.Views\Styles.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Makefile.am" />
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/AddRemoveMoveCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/AddRemoveMoveCommand.cs
index 7a164f686a..be9da672f5 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/AddRemoveMoveCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/AddRemoveMoveCommand.cs
@@ -17,7 +17,7 @@ namespace MonoDevelop.VersionControl
return true;
}
- private class AddWorker : Task {
+ private class AddWorker : VersionControlTask {
VersionControlItemList items;
public AddWorker (VersionControlItemList items)
@@ -32,7 +32,7 @@ namespace MonoDevelop.VersionControl
protected override void Run ()
{
- IProgressMonitor monitor = Monitor;
+ ProgressMonitor monitor = Monitor;
foreach (VersionControlItemList list in items.SplitByRepository ())
list[0].Repository.Add (list.Paths, true, monitor);
@@ -109,7 +109,7 @@ namespace MonoDevelop.VersionControl
return true;
}
- private class RemoveWorker : Task {
+ private class RemoveWorker : VersionControlTask {
VersionControlItemList items;
public RemoveWorker (VersionControlItemList items) {
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/BlameCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/BlameCommand.cs
index 26504cf950..aaf261fb93 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/BlameCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/BlameCommand.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System.Linq;
+using System.Threading.Tasks;
using Mono.Addins;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui;
@@ -41,16 +42,16 @@ namespace MonoDevelop.VersionControl
return !item.IsDirectory
// FIXME: Review appending of Annotate support and use it.
&& item.VersionInfo.IsVersioned
- && AddinManager.GetExtensionObjects<IBlameViewHandler> (BlameViewHandlers).Any (h => h.CanHandle (item, null));
+ && AddinManager.GetExtensionObjects<IVersionControlViewHandler> (BlameViewHandlers).Any (h => h.CanHandle (item, null));
}
- public static bool Show (VersionControlItemList items, bool test)
+ public static async Task<bool> Show (VersionControlItemList items, bool test)
{
if (test)
return items.All (CanShow);
foreach (var item in items) {
- var document = IdeApp.Workbench.OpenDocument (item.Path, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
+ var document = await IdeApp.Workbench.OpenDocument (item.Path, item.ContainerProject, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
if (document != null)
document.Window.SwitchView (document.Window.FindView<IBlameView> ());
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CheckoutCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CheckoutCommand.cs
index 140d94f1b0..33763dd9de 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CheckoutCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CheckoutCommand.cs
@@ -26,83 +26,74 @@ namespace MonoDevelop.VersionControl
del.Destroy ();
del.Dispose ();
}
- }
- }
-
- class CheckoutWorker : Task
- {
- Repository vc;
- string path;
-
- public CheckoutWorker (Repository vc, string path)
- {
- this.vc = vc;
- this.path = path;
- OperationType = VersionControlOperationType.Pull;
- }
-
- protected override string GetDescription ()
- {
- return GettextCatalog.GetString ("Checking out {0}...", path);
- }
-
- protected override IProgressMonitor CreateProgressMonitor ()
- {
- return new MonoDevelop.Core.ProgressMonitoring.AggregatedProgressMonitor (
- base.CreateProgressMonitor (),
- new MonoDevelop.Ide.ProgressMonitoring.MessageDialogProgressMonitor (true, true, true, true)
- );
- }
-
- protected override void Run ()
- {
- if (System.IO.Directory.Exists (path) && System.IO.Directory.EnumerateFileSystemEntries (path).Any ()) {
- if (MessageService.AskQuestion (GettextCatalog.GetString (
- "Checkout path is not empty. Do you want to delete its contents?"),
- path,
- AlertButton.Cancel,
- AlertButton.Ok) == AlertButton.Cancel)
- return;
- FileService.DeleteDirectory (path);
- FileService.CreateDirectory (path);
- }
-
- try {
- vc.Checkout (path, null, true, Monitor);
- } catch (VersionControlException e) {
- Monitor.ReportError (e.Message, null);
- return;
- }
-
- if (Monitor.IsCancelRequested) {
- Monitor.ReportSuccess (GettextCatalog.GetString ("Checkout operation cancelled"));
- return;
- }
-
- if (!System.IO.Directory.Exists (path)) {
- Monitor.ReportError (GettextCatalog.GetString ("Checkout folder does not exist"), null);
- return;
- }
-
- string projectFn = null;
-
- string[] list = System.IO.Directory.GetFiles (path);
- if (projectFn == null) {
- foreach (string str in list) {
- if (MonoDevelop.Projects.Services.ProjectService.IsWorkspaceItemFile (str)) {
- projectFn = str;
- break;
- }
- }
- }
-
- if (projectFn != null) {
- DispatchService.GuiDispatch (delegate {
- IdeApp.Workspace.OpenWorkspaceItem (projectFn);
- });
- }
-
- Monitor.ReportSuccess (GettextCatalog.GetString ("Solution checked out"));
+ }
+
+ class CheckoutWorker : VersionControlTask
+ {
+ Repository vc;
+ string path;
+
+ public CheckoutWorker (Repository vc, string path)
+ {
+ this.vc = vc;
+ this.path = path;
+ OperationType = VersionControlOperationType.Pull;
+ }
+
+ protected override string GetDescription ()
+ {
+ return GettextCatalog.GetString ("Checking out {0}...", path);
+ }
+
+ protected override ProgressMonitor CreateProgressMonitor ()
+ {
+ return new MonoDevelop.Core.ProgressMonitoring.AggregatedProgressMonitor (
+ base.CreateProgressMonitor (),
+ new MonoDevelop.Ide.ProgressMonitoring.MessageDialogProgressMonitor (true, true, true, true)
+ );
+ }
+
+ protected override void Run ()
+ {
+ if (System.IO.Directory.Exists (path) && System.IO.Directory.EnumerateFileSystemEntries (path).Any ()) {
+ if (MessageService.AskQuestion (GettextCatalog.GetString (
+ "Checkout path is not empty. Do you want to delete its contents?"),
+ path,
+ AlertButton.Cancel,
+ AlertButton.Ok) == AlertButton.Cancel)
+ return;
+ FileService.DeleteDirectory (path);
+ FileService.CreateDirectory (path);
+ }
+
+ try {
+ vc.Checkout (path, null, true, Monitor);
+ } catch (VersionControlException e) {
+ Monitor.ReportError (e.Message, null);
+ return;
+ }
+
+ if (Monitor.CancellationToken.IsCancellationRequested) {
+ Monitor.ReportSuccess (GettextCatalog.GetString ("Checkout operation cancelled"));
+ return;
+ }
+
+ if (!System.IO.Directory.Exists (path)) {
+ Monitor.ReportError (GettextCatalog.GetString ("Checkout folder does not exist"), null);
+ return;
+ }
+
+ foreach (string str in System.IO.Directory.EnumerateFiles (path, "*", System.IO.SearchOption.AllDirectories)) {
+ if (MonoDevelop.Projects.Services.ProjectService.IsWorkspaceItemFile (str)) {
+ Runtime.RunInMainThread (delegate {
+ IdeApp.Workspace.OpenWorkspaceItem (str);
+ });
+ break;
+ }
+ }
+
+ Monitor.ReportSuccess (GettextCatalog.GetString ("Solution checked out"));
+ }
}
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Commands.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Commands.cs
index 64dd18ff92..be79ed4eff 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Commands.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Commands.cs
@@ -37,7 +37,7 @@ namespace MonoDevelop.VersionControl
{
VersionControlItemList list = new VersionControlItemList ();
- IWorkspaceObject wob;
+ WorkspaceObject wob;
Repository repo = null;
wob = IdeApp.ProjectOperations.CurrentSelectedWorkspaceItem;
if (wob != null)
@@ -243,7 +243,7 @@ namespace MonoDevelop.VersionControl
}
}
- class CurrentFileViewHandler<T> : FileVersionControlCommandHandler where T:IAttachableViewContent
+ class CurrentFileViewHandler<T> : FileVersionControlCommandHandler
{
protected override bool RunCommand (VersionControlItemList items, bool test)
{
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CommitCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CommitCommand.cs
index a26d612fd8..b26ac01403 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CommitCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CommitCommand.cs
@@ -33,7 +33,7 @@ namespace MonoDevelop.VersionControl
}
}
- private class CommitWorker : Task
+ private class CommitWorker : VersionControlTask
{
Repository vc;
ChangeSet changeSet;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CommitDialogExtension.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CommitDialogExtension.cs
index eb2d119063..59f9fe1025 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CommitDialogExtension.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CommitDialogExtension.cs
@@ -79,8 +79,7 @@ namespace MonoDevelop.VersionControl
if (value == allowCommit)
return;
allowCommit = value;
- if (AllowCommitChanged != null)
- AllowCommitChanged (this, EventArgs.Empty);
+ AllowCommitChanged?.Invoke (this, EventArgs.Empty);
}
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CreatePatchCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CreatePatchCommand.cs
index 196bc9ebc6..6cd2baf611 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CreatePatchCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CreatePatchCommand.cs
@@ -108,7 +108,7 @@ namespace MonoDevelop.VersionControl
/// Determines whether a patch can be created
/// from a ChangeSet.
/// </summary>
- public static bool CanCreatePatch (ChangeSet items)
+ static bool CanCreatePatch (ChangeSet items)
{
if (null == items || 0 == items.Count){ return false; }
@@ -120,7 +120,7 @@ namespace MonoDevelop.VersionControl
/// Determines whether a patch can be created
/// from a VersionControlItemList.
/// </summary>
- public static bool CanCreatePatch (VersionControlItemList items)
+ static bool CanCreatePatch (VersionControlItemList items)
{
if (null == items || 0 == items.Count){ return false; }
return items.All (i => i.VersionInfo.CanRevert);
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultBlameViewHandler.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultBlameViewHandler.cs
index 1259363f52..01d1846ea1 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultBlameViewHandler.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultBlameViewHandler.cs
@@ -31,7 +31,7 @@ using MonoDevelop.Projects.Text;
namespace MonoDevelop.VersionControl
{
- public class DefaultBlameViewHandler : IBlameViewHandler
+ public class DefaultBlameViewHandler : IVersionControlViewHandler
{
public bool CanHandle (VersionControlItem item, DocumentView primaryView)
{
@@ -39,7 +39,7 @@ namespace MonoDevelop.VersionControl
&& item.Repository.GetFileIsText (item.Path);
}
- public IBlameView CreateView (VersionControlDocumentInfo info)
+ public BaseViewContent CreateView (VersionControlDocumentInfo info)
{
return new BlameView (info);
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultDiffViewHandler.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultDiffViewHandler.cs
index 4a2e775386..40ac9fa5ea 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultDiffViewHandler.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultDiffViewHandler.cs
@@ -31,7 +31,7 @@ using MonoDevelop.Projects.Text;
namespace MonoDevelop.VersionControl
{
- public class DefaultDiffViewHandler : IDiffViewHandler
+ public class DefaultDiffViewHandler : IVersionControlViewHandler
{
public bool CanHandle (VersionControlItem item, DocumentView primaryView)
{
@@ -39,7 +39,7 @@ namespace MonoDevelop.VersionControl
&& item.Repository.GetFileIsText (item.Path);
}
- public IDiffView CreateView (VersionControlDocumentInfo info)
+ public BaseViewContent CreateView (VersionControlDocumentInfo info)
{
return new DiffView (info);
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultLogViewHandler.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultLogViewHandler.cs
index 9537bb7dfa..51b8c6b613 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultLogViewHandler.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultLogViewHandler.cs
@@ -29,14 +29,14 @@ using MonoDevelop.VersionControl.Views;
namespace MonoDevelop.VersionControl
{
- public class DefaultLogViewHandler : ILogViewHandler
+ public class DefaultLogViewHandler : IVersionControlViewHandler
{
public bool CanHandle (VersionControlItem item, DocumentView primaryView)
{
return true;
}
- public ILogView CreateView (VersionControlDocumentInfo info)
+ public BaseViewContent CreateView (VersionControlDocumentInfo info)
{
return new LogView (info);
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultMergeViewHandler.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultMergeViewHandler.cs
index aba6756b08..ae646cd4b8 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultMergeViewHandler.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DefaultMergeViewHandler.cs
@@ -31,7 +31,7 @@ using MonoDevelop.Projects.Text;
namespace MonoDevelop.VersionControl
{
- public class DefaultMergeViewHandler : IMergeViewHandler
+ public class DefaultMergeViewHandler : IVersionControlViewHandler
{
public bool CanHandle (VersionControlItem item, DocumentView primaryView)
{
@@ -39,7 +39,7 @@ namespace MonoDevelop.VersionControl
&& item.Repository.GetFileIsText (item.Path);
}
- public IMergeView CreateView (VersionControlDocumentInfo info)
+ public BaseViewContent CreateView (VersionControlDocumentInfo info)
{
return new MergeView (info);
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DiffCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DiffCommand.cs
index 9791860917..46ee00b80d 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DiffCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/DiffCommand.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System.Linq;
+using System.Threading.Tasks;
using Mono.Addins;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui;
@@ -40,16 +41,16 @@ namespace MonoDevelop.VersionControl
{
return !item.IsDirectory
&& item.VersionInfo.IsVersioned
- && AddinManager.GetExtensionObjects<IDiffViewHandler> (DiffViewHandlers).Any (h => h.CanHandle (item, null));
+ && AddinManager.GetExtensionObjects<IVersionControlViewHandler> (DiffViewHandlers).Any (h => h.CanHandle (item, null));
}
- public static bool Show (VersionControlItemList items, bool test)
+ public static async Task<bool> Show (VersionControlItemList items, bool test)
{
if (test)
return items.All (CanShow);
foreach (var item in items) {
- var document = IdeApp.Workbench.OpenDocument (item.Path, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
+ var document = await IdeApp.Workbench.OpenDocument (item.Path, item.ContainerProject, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
if (document != null)
document.Window.SwitchView (document.Window.FindView<IDiffView> ());
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IRepositoryEditor.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IRepositoryEditor.cs
index e1ecd5957d..ffd5a697a7 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IRepositoryEditor.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IRepositoryEditor.cs
@@ -1,34 +1,37 @@
-//
-// IRepositoryEditor.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
+//
+// IRepositoryEditor.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using MonoDevelop.Components;
+
namespace MonoDevelop.VersionControl
{
public interface IRepositoryEditor
{
- Gtk.Widget Widget { get; }
+ Control Widget { get; }
+ void Show ();
bool Validate ();
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IVersionControlViewHandler.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IVersionControlViewHandler.cs
index da8611f941..2620d3c664 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IVersionControlViewHandler.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IVersionControlViewHandler.cs
@@ -29,31 +29,10 @@ using MonoDevelop.Ide.Gui;
namespace MonoDevelop.VersionControl {
- public interface IVersionControlViewHandler<T>
- where T : IAttachableViewContent
+ public interface IVersionControlViewHandler
{
bool CanHandle (VersionControlItem item, DocumentView primaryView);
- T CreateView (VersionControlDocumentInfo info);
- }
-
- public interface IDiffViewHandler : IVersionControlViewHandler<IDiffView>
- {
-
- }
-
- public interface IBlameViewHandler : IVersionControlViewHandler<IBlameView>
- {
-
- }
-
- public interface ILogViewHandler : IVersionControlViewHandler<ILogView>
- {
-
- }
-
- public interface IMergeViewHandler : IVersionControlViewHandler<IMergeView>
- {
-
+ BaseViewContent CreateView (VersionControlDocumentInfo info);
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IgnoreCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IgnoreCommand.cs
index b39bfb8af4..2e035e90ce 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IgnoreCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IgnoreCommand.cs
@@ -62,7 +62,7 @@ namespace MonoDevelop.VersionControl
}
}
- private class IgnoreWorker : Task
+ private class IgnoreWorker : VersionControlTask
{
VersionControlItemList items;
@@ -125,7 +125,7 @@ namespace MonoDevelop.VersionControl
}
}
- private class UnignoreWorker : Task
+ private class UnignoreWorker : VersionControlTask
{
VersionControlItemList items;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/LockCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/LockCommand.cs
index 2e318afdd6..684ded981b 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/LockCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/LockCommand.cs
@@ -43,7 +43,7 @@ namespace MonoDevelop.VersionControl
return true;
}
- private class LockWorker : Task
+ private class LockWorker : VersionControlTask
{
VersionControlItemList items;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/LogCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/LogCommand.cs
index ec00f7670c..5ccdc31213 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/LogCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/LogCommand.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System.Linq;
+using System.Threading.Tasks;
using Mono.Addins;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui;
@@ -40,28 +41,26 @@ namespace MonoDevelop.VersionControl
{
// We want directories to be able to view the log for an entire directory
// by selecting it from the solution pane
- return item.VersionInfo.IsVersioned
- && AddinManager.GetExtensionObjects<ILogViewHandler> (LogViewHandlers).Any (h => h.CanHandle (item, null));
+ return item.VersionInfo.IsVersioned &&
+ AddinManager.GetExtensionObjects<IVersionControlViewHandler> (LogViewHandlers).Any (h => h.CanHandle (item, null));
}
- public static bool Show (VersionControlItemList items, bool test)
+ public static async Task<bool> Show (VersionControlItemList items, bool test)
{
if (test)
return items.All (CanShow);
foreach (var item in items) {
- Document document = null;
- if (!item.IsDirectory)
- document = IdeApp.Workbench.OpenDocument (item.Path, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
-
- if (document != null) {
+ if (!item.IsDirectory) {
+ Document document = await IdeApp.Workbench.OpenDocument (item.Path, item.ContainerProject, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
document.Window.SwitchView (document.Window.FindView<ILogView> ());
- } else {
- VersionControlDocumentInfo info = new VersionControlDocumentInfo (null, item, item.Repository);
- LogView logView = new LogView (info);
- info.Document = IdeApp.Workbench.OpenDocument (logView, true).PrimaryView;
- logView.Selected ();
+ continue;
}
+
+ var info = new VersionControlDocumentInfo (null, item, item.Repository);
+ var logView = new LogView (info);
+ info.Document = IdeApp.Workbench.OpenDocument (logView, true).PrimaryView;
+ logView.Init ();
}
return true;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/MergeCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/MergeCommand.cs
index 43f5d86499..766a32d95a 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/MergeCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/MergeCommand.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System.Linq;
+using System.Threading.Tasks;
using Mono.Addins;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui;
@@ -40,16 +41,16 @@ namespace MonoDevelop.VersionControl
{
return !item.IsDirectory
&& item.VersionInfo.IsVersioned
- && AddinManager.GetExtensionObjects<IMergeViewHandler> (MergeViewHandlers).Any (h => h.CanHandle (item, null));
+ && AddinManager.GetExtensionObjects<IVersionControlViewHandler> (MergeViewHandlers).Any (h => h.CanHandle (item, null));
}
- public static bool Show (VersionControlItemList items, bool test)
+ public static async Task<bool> Show (VersionControlItemList items, bool test)
{
if (test)
return items.All (CanShow);
foreach (var item in items) {
- var document = IdeApp.Workbench.OpenDocument (item.Path, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
+ var document = await IdeApp.Workbench.OpenDocument (item.Path, item.ContainerProject, OpenDocumentOptions.Default | OpenDocumentOptions.OnlyInternalViewer);
if (document != null)
document.Window.SwitchView (document.Window.FindView<IMergeView> ());
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/PublishCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/PublishCommand.cs
index 7f0f78f8d1..b7a27f5535 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/PublishCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/PublishCommand.cs
@@ -10,7 +10,7 @@ namespace MonoDevelop.VersionControl
{
internal class PublishCommand
{
- public static bool Publish (IWorkspaceObject entry, FilePath localPath, bool test)
+ public static bool Publish (WorkspaceObject entry, FilePath localPath, bool test)
{
if (test)
return VersionControlService.CheckVersionControlInstalled () && VersionControlService.GetRepository (entry) == null;
@@ -37,7 +37,7 @@ namespace MonoDevelop.VersionControl
dlg.Message = GettextCatalog.GetString ("Initial check-in of module {0}", moduleName);
do {
if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok && dlg.Repository != null) {
- AlertButton publishButton = new AlertButton ("_Publish");
+ AlertButton publishButton = new AlertButton (GettextCatalog.GetString ("_Publish"));
if (MessageService.AskQuestion (GettextCatalog.GetString ("Are you sure you want to publish the project?"), GettextCatalog.GetString ("The project will be published to the repository '{0}', module '{1}'.", dlg.Repository.Name, dlg.ModuleName), AlertButton.Cancel, publishButton) == publishButton) {
PublishWorker w = new PublishWorker (dlg.Repository, dlg.ModuleName, localPath, files.ToArray (), dlg.Message);
w.Start ();
@@ -53,7 +53,7 @@ namespace MonoDevelop.VersionControl
return true;
}
- static void GetFiles (List<FilePath> files, IWorkspaceObject entry)
+ static void GetFiles (List<FilePath> files, WorkspaceObject entry)
{
// Ensure that we strip out all linked files from outside of the solution/projects path.
if (entry is IWorkspaceFileObject)
@@ -67,44 +67,45 @@ namespace MonoDevelop.VersionControl
if (!vc.GetVersionInfo (path).IsVersioned && isDir)
return true;
return false;
- }
- }
-
- internal class PublishWorker : Task {
- Repository vc;
- FilePath path;
- string moduleName;
- FilePath[] files;
- string message;
+ }
- public PublishWorker (Repository vc, string moduleName, FilePath localPath, FilePath[] files, string message)
- {
- this.vc = vc;
- this.path = localPath;
- this.moduleName = moduleName;
- this.files = files;
- this.message = message;
- OperationType = VersionControlOperationType.Push;
- }
-
- protected override string GetDescription ()
- {
- return GettextCatalog.GetString ("Publishing \"{0}\" Project...", moduleName);
- }
-
- protected override void Run ()
- {
- try {
- vc.Publish (moduleName, path, files, message, Monitor);
- } catch (VersionControlException e) {
- Monitor.ReportError (e.Message, null);
- return;
- }
-
- Gtk.Application.Invoke (delegate {
- VersionControlService.NotifyFileStatusChanged (new FileUpdateEventArgs (vc, path, true));
- });
- Monitor.ReportSuccess (GettextCatalog.GetString ("Publish operation completed."));
+ class PublishWorker : VersionControlTask
+ {
+ Repository vc;
+ FilePath path;
+ string moduleName;
+ FilePath [] files;
+ string message;
+
+ public PublishWorker (Repository vc, string moduleName, FilePath localPath, FilePath [] files, string message)
+ {
+ this.vc = vc;
+ this.path = localPath;
+ this.moduleName = moduleName;
+ this.files = files;
+ this.message = message;
+ OperationType = VersionControlOperationType.Push;
+ }
+
+ protected override string GetDescription ()
+ {
+ return GettextCatalog.GetString ("Publishing \"{0}\" Project...", moduleName);
+ }
+
+ protected override void Run ()
+ {
+ try {
+ vc.Publish (moduleName, path, files, message, Monitor);
+ } catch (VersionControlException e) {
+ Monitor.ReportError (e.Message, null);
+ return;
+ }
+
+ Gtk.Application.Invoke (delegate {
+ VersionControlService.NotifyFileStatusChanged (new FileUpdateEventArgs (vc, path, true));
+ });
+ Monitor.ReportSuccess (GettextCatalog.GetString ("Publish operation completed."));
+ }
}
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Repository.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Repository.cs
index 205c00e128..495dfdfe98 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Repository.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Repository.cs
@@ -115,8 +115,7 @@ namespace MonoDevelop.VersionControl
get { return name ?? string.Empty; }
set {
name = value;
- if (NameChanged != null)
- NameChanged (this, EventArgs.Empty);
+ NameChanged?.Invoke (this, EventArgs.Empty);
}
}
@@ -416,17 +415,23 @@ namespace MonoDevelop.VersionControl
// new queries to the queue while long-running VCS operations are being performed
var groups = fileQueryQueueClone.GroupBy (q => (q.QueryFlags & VersionInfoQueryFlags.IncludeRemoteStatus) != 0);
foreach (var group in groups) {
+ if (Disposed)
+ break;
var status = OnGetVersionInfo (group.SelectMany (q => q.Paths), group.Key);
infoCache.SetStatus (status);
}
foreach (var item in directoryQueryQueueClone) {
+ if (Disposed)
+ break;
var status = OnGetDirectoryVersionInfo (item.Directory, item.GetRemoteStatus, false);
infoCache.SetDirectoryStatus (item.Directory, status, item.GetRemoteStatus);
}
foreach (var item in recursiveDirectoryQueryQueueClone) {
try {
+ if (Disposed)
+ continue;
item.Result = OnGetDirectoryVersionInfo (item.Directory, item.GetRemoteStatus, true);
} finally {
item.ResetEvent.Set ();
@@ -504,29 +509,29 @@ namespace MonoDevelop.VersionControl
// Imports a directory into the repository. 'serverPath' is the relative path in the repository.
// 'localPath' is the local directory to publish. 'files' is the list of files to add to the new
// repository directory (must use absolute local paths).
- public Repository Publish (string serverPath, FilePath localPath, FilePath[] files, string message, IProgressMonitor monitor)
+ public Repository Publish (string serverPath, FilePath localPath, FilePath[] files, string message, ProgressMonitor monitor)
{
var res = OnPublish (serverPath, localPath, files, message, monitor);
ClearCachedVersionInfo (localPath);
return res;
}
- protected abstract Repository OnPublish (string serverPath, FilePath localPath, FilePath[] files, string message, IProgressMonitor monitor);
+ protected abstract Repository OnPublish (string serverPath, FilePath localPath, FilePath[] files, string message, ProgressMonitor monitor);
// Updates a local file or directory from the repository
// Returns a list of updated files
- public void Update (FilePath localPath, bool recurse, IProgressMonitor monitor)
+ public void Update (FilePath localPath, bool recurse, ProgressMonitor monitor)
{
Update (new FilePath[] { localPath }, recurse, monitor);
}
- public void Update (FilePath[] localPaths, bool recurse, IProgressMonitor monitor)
+ public void Update (FilePath[] localPaths, bool recurse, ProgressMonitor monitor)
{
OnUpdate (localPaths, recurse, monitor);
ClearCachedVersionInfo (localPaths);
}
- protected abstract void OnUpdate (FilePath[] localPaths, bool recurse, IProgressMonitor monitor);
+ protected abstract void OnUpdate (FilePath[] localPaths, bool recurse, ProgressMonitor monitor);
// Called to create a ChangeSet to be used for a commit operation
public virtual ChangeSet CreateChangeSet (FilePath basePath)
@@ -543,7 +548,8 @@ namespace MonoDevelop.VersionControl
if (null != diffs) {
foreach (DiffInfo diff in diffs) {
- patch.AppendLine (diff.Content);
+ if (!string.IsNullOrWhiteSpace (diff.Content))
+ patch.AppendLine (diff.Content);
}
}
@@ -551,70 +557,74 @@ namespace MonoDevelop.VersionControl
}
// Commits changes in a set of files or directories into the repository
- public void Commit (ChangeSet changeSet, IProgressMonitor monitor)
+ public void Commit (ChangeSet changeSet, ProgressMonitor monitor)
{
ClearCachedVersionInfo (changeSet.BaseLocalPath);
OnCommit (changeSet, monitor);
}
- protected abstract void OnCommit (ChangeSet changeSet, IProgressMonitor monitor);
+ protected abstract void OnCommit (ChangeSet changeSet, ProgressMonitor monitor);
// Gets the contents of this repositories into the specified local path
- public void Checkout (FilePath targetLocalPath, bool recurse, IProgressMonitor monitor)
+ public void Checkout (FilePath targetLocalPath, bool recurse, ProgressMonitor monitor)
{
Checkout (targetLocalPath, null, recurse, monitor);
}
- public void Checkout (FilePath targetLocalPath, Revision rev, bool recurse, IProgressMonitor monitor)
+ public void Checkout (FilePath targetLocalPath, Revision rev, bool recurse, ProgressMonitor monitor)
{
ClearCachedVersionInfo (targetLocalPath);
OnCheckout (targetLocalPath, rev, recurse, monitor);
}
- protected abstract void OnCheckout (FilePath targetLocalPath, Revision rev, bool recurse, IProgressMonitor monitor);
+ protected abstract void OnCheckout (FilePath targetLocalPath, Revision rev, bool recurse, ProgressMonitor monitor);
- public void Revert (FilePath[] localPaths, bool recurse, IProgressMonitor monitor)
+ public void Revert (FilePath[] localPaths, bool recurse, ProgressMonitor monitor)
{
ClearCachedVersionInfo (localPaths);
OnRevert (localPaths, recurse, monitor);
}
- public void Revert (FilePath localPath, bool recurse, IProgressMonitor monitor)
+ public void Revert (FilePath localPath, bool recurse, ProgressMonitor monitor)
{
Revert (new FilePath[] { localPath }, recurse, monitor);
}
- protected abstract void OnRevert (FilePath[] localPaths, bool recurse, IProgressMonitor monitor);
+ protected abstract void OnRevert (FilePath[] localPaths, bool recurse, ProgressMonitor monitor);
- public void RevertRevision (FilePath localPath, Revision revision, IProgressMonitor monitor)
+ public void RevertRevision (FilePath localPath, Revision revision, ProgressMonitor monitor)
{
ClearCachedVersionInfo (localPath);
OnRevertRevision (localPath, revision, monitor);
}
- protected abstract void OnRevertRevision (FilePath localPath, Revision revision, IProgressMonitor monitor);
+ protected abstract void OnRevertRevision (FilePath localPath, Revision revision, ProgressMonitor monitor);
- public void RevertToRevision (FilePath localPath, Revision revision, IProgressMonitor monitor)
+ public void RevertToRevision (FilePath localPath, Revision revision, ProgressMonitor monitor)
{
ClearCachedVersionInfo (localPath);
OnRevertToRevision (localPath, revision, monitor);
}
- protected abstract void OnRevertToRevision (FilePath localPath, Revision revision, IProgressMonitor monitor);
+ protected abstract void OnRevertToRevision (FilePath localPath, Revision revision, ProgressMonitor monitor);
// Adds a file or directory to the repository
- public void Add (FilePath localPath, bool recurse, IProgressMonitor monitor)
+ public void Add (FilePath localPath, bool recurse, ProgressMonitor monitor)
{
Add (new FilePath[] { localPath }, recurse, monitor);
}
- public void Add (FilePath[] localPaths, bool recurse, IProgressMonitor monitor)
+ public void Add (FilePath[] localPaths, bool recurse, ProgressMonitor monitor)
{
- OnAdd (localPaths, recurse, monitor);
+ try {
+ OnAdd (localPaths, recurse, monitor);
+ } catch (Exception e) {
+ LoggingService.LogError ("Failed to add file", e);
+ }
ClearCachedVersionInfo (localPaths);
}
- protected abstract void OnAdd (FilePath[] localPaths, bool recurse, IProgressMonitor monitor);
+ protected abstract void OnAdd (FilePath[] localPaths, bool recurse, ProgressMonitor monitor);
// Returns true if the file can be moved from source location (and repository) to this repository
public virtual bool CanMoveFilesFrom (Repository srcRepository, FilePath localSrcPath, FilePath localDestPath)
@@ -628,57 +638,81 @@ namespace MonoDevelop.VersionControl
// For example, when moving a file to an unversioned directory, the implementation
// might just throw an exception, or it could version the directory, or it could
// ask the user what to do.
- public void MoveFile (FilePath localSrcPath, FilePath localDestPath, bool force, IProgressMonitor monitor)
+ public void MoveFile (FilePath localSrcPath, FilePath localDestPath, bool force, ProgressMonitor monitor)
{
ClearCachedVersionInfo (localSrcPath, localDestPath);
- OnMoveFile (localSrcPath, localDestPath, force, monitor);
+ try {
+ OnMoveFile (localSrcPath, localDestPath, force, monitor);
+ } catch (Exception e) {
+ LoggingService.LogError ("Failed to move file", e);
+ File.Move (localSrcPath, localDestPath);
+ }
}
- protected virtual void OnMoveFile (FilePath localSrcPath, FilePath localDestPath, bool force, IProgressMonitor monitor)
+ protected virtual void OnMoveFile (FilePath localSrcPath, FilePath localDestPath, bool force, ProgressMonitor monitor)
{
File.Move (localSrcPath, localDestPath);
}
// Moves a directory. This method may be called for versioned and unversioned
// files. The default implementetions performs a system file move.
- public void MoveDirectory (FilePath localSrcPath, FilePath localDestPath, bool force, IProgressMonitor monitor)
+ public void MoveDirectory (FilePath localSrcPath, FilePath localDestPath, bool force, ProgressMonitor monitor)
{
ClearCachedVersionInfo (localSrcPath, localDestPath);
- OnMoveDirectory (localSrcPath, localDestPath, force, monitor);
+ try {
+ OnMoveDirectory (localSrcPath, localDestPath, force, monitor);
+ } catch (Exception e) {
+ LoggingService.LogError ("Failed to move directory", e);
+ FileService.SystemDirectoryRename (localSrcPath, localDestPath);
+ }
}
- protected virtual void OnMoveDirectory (FilePath localSrcPath, FilePath localDestPath, bool force, IProgressMonitor monitor)
+ protected virtual void OnMoveDirectory (FilePath localSrcPath, FilePath localDestPath, bool force, ProgressMonitor monitor)
{
FileService.SystemDirectoryRename (localSrcPath, localDestPath);
}
// Deletes a file or directory. This method may be called for versioned and unversioned
// files. The default implementetions performs a system file delete.
- public void DeleteFile (FilePath localPath, bool force, IProgressMonitor monitor, bool keepLocal = true)
+ public void DeleteFile (FilePath localPath, bool force, ProgressMonitor monitor, bool keepLocal = true)
{
DeleteFiles (new FilePath[] { localPath }, force, monitor, keepLocal);
}
- public void DeleteFiles (FilePath[] localPaths, bool force, IProgressMonitor monitor, bool keepLocal = true)
+ public void DeleteFiles (FilePath[] localPaths, bool force, ProgressMonitor monitor, bool keepLocal = true)
{
- OnDeleteFiles (localPaths, force, monitor, keepLocal);
+ try {
+ OnDeleteFiles (localPaths, force, monitor, keepLocal);
+ } catch (Exception e) {
+ LoggingService.LogError ("Failed to delete file", e);
+ if (!keepLocal)
+ foreach (var path in localPaths)
+ File.Delete (path);
+ }
ClearCachedVersionInfo (localPaths);
}
- protected abstract void OnDeleteFiles (FilePath[] localPaths, bool force, IProgressMonitor monitor, bool keepLocal);
+ protected abstract void OnDeleteFiles (FilePath[] localPaths, bool force, ProgressMonitor monitor, bool keepLocal);
- public void DeleteDirectory (FilePath localPath, bool force, IProgressMonitor monitor, bool keepLocal = true)
+ public void DeleteDirectory (FilePath localPath, bool force, ProgressMonitor monitor, bool keepLocal = true)
{
DeleteDirectories (new FilePath[] { localPath }, force, monitor, keepLocal);
}
- public void DeleteDirectories (FilePath[] localPaths, bool force, IProgressMonitor monitor, bool keepLocal = true)
+ public void DeleteDirectories (FilePath[] localPaths, bool force, ProgressMonitor monitor, bool keepLocal = true)
{
- OnDeleteDirectories (localPaths, force, monitor, keepLocal);
+ try {
+ OnDeleteDirectories (localPaths, force, monitor, keepLocal);
+ } catch (Exception e) {
+ LoggingService.LogError ("Failed to delete directory", e);
+ if (!keepLocal)
+ foreach (var path in localPaths)
+ Directory.Delete (path, true);
+ }
ClearCachedVersionInfo (localPaths);
}
- protected abstract void OnDeleteDirectories (FilePath[] localPaths, bool force, IProgressMonitor monitor, bool keepLocal);
+ protected abstract void OnDeleteDirectories (FilePath[] localPaths, bool force, ProgressMonitor monitor, bool keepLocal);
// Called to request write permission for a file. The file may not yet exist.
// After the file is modified or created, NotifyFileChanged is called.
@@ -703,26 +737,26 @@ namespace MonoDevelop.VersionControl
}
// Locks a file in the repository so no other users can change it
- public void Lock (IProgressMonitor monitor, params FilePath[] localPaths)
+ public void Lock (ProgressMonitor monitor, params FilePath[] localPaths)
{
ClearCachedVersionInfo (localPaths);
OnLock (monitor, localPaths);
}
// Locks a file in the repository so no other users can change it
- protected virtual void OnLock (IProgressMonitor monitor, params FilePath[] localPaths)
+ protected virtual void OnLock (ProgressMonitor monitor, params FilePath[] localPaths)
{
throw new System.NotSupportedException ();
}
// Unlocks a file in the repository so other users can change it
- public void Unlock (IProgressMonitor monitor, params FilePath[] localPaths)
+ public void Unlock (ProgressMonitor monitor, params FilePath[] localPaths)
{
ClearCachedVersionInfo (localPaths);
OnUnlock (monitor, localPaths);
}
- protected virtual void OnUnlock (IProgressMonitor monitor, params FilePath[] localPaths)
+ protected virtual void OnUnlock (ProgressMonitor monitor, params FilePath[] localPaths)
{
throw new System.NotSupportedException ();
}
@@ -824,18 +858,21 @@ namespace MonoDevelop.VersionControl
}
return list.ToArray ();
}
-
+
/// <summary>
/// Retrieves annotations for a given path in the repository.
/// </summary>
/// <param name="repositoryPath">
/// A <see cref="FilePath"/>
/// </param>
+ /// <param name="since">
+ /// A <see cref="Revision"/>
+ /// </param>
/// <returns>
- /// A <see cref="System.String"/> corresponding to each line
+ /// A <see cref="Annotation"/> corresponding to each line
/// of the file to which repositoryPath points.
/// </returns>
- public virtual Annotation[] GetAnnotations (FilePath repositoryPath)
+ public virtual Annotation [] GetAnnotations (FilePath repositoryPath, Revision since)
{
return new Annotation[0];
}
@@ -874,11 +911,16 @@ namespace MonoDevelop.VersionControl
public class Annotation
{
- public string Revision {
+ public Revision Revision {
get;
private set;
}
+ string text;
+ public string Text {
+ get { return text ?? Revision?.ToString (); }
+ }
+
public string Author {
get;
private set;
@@ -902,24 +944,26 @@ namespace MonoDevelop.VersionControl
get { return Date != DateTime.MinValue; }
}
- public Annotation (string revision, string author, DateTime date)
+ public Annotation (Revision revision, string author, DateTime date) : this (revision, author, date, null)
+ {
+ }
+
+ public Annotation (Revision revision, string author, DateTime date, string email) : this (revision, author, date, email, null)
{
- this.Revision = revision;
- this.Author = author;
- this.Date = date;
}
- public Annotation (string revision, string author, DateTime date, string email)
+ public Annotation (Revision revision, string author, DateTime date, string email, string text)
{
- this.Revision = revision;
- this.Author = author;
- this.Date = date;
- this.Email = email;
+ Revision = revision;
+ Author = author;
+ Date = date;
+ Email = email;
+ this.text = text;
}
public override string ToString ()
{
- return String.Format ("[Annotation: Revision={0}, Author={1}, Date={2}, HasDate={3}, Email={4}, HasEmail={5}]",
+ return string.Format ("[Annotation: Revision={0}, Author={1}, Date={2}, HasDate={3}, Email={4}, HasEmail={5}]",
Revision, Author, Date, HasDate, Email, HasEmail);
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/ResolveConflictsCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/ResolveConflictsCommand.cs
index 6ae8460365..dd599cfaea 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/ResolveConflictsCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/ResolveConflictsCommand.cs
@@ -1,45 +1,47 @@
-//
-// ResolveConflictsCommands.cs
-//
-// Author:
-// Therzok <teromario@yahoo.com>
-//
-// Copyright (c) 2013 Therzok
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
+//
+// ResolveConflictsCommands.cs
+//
+// Author:
+// Therzok <teromario@yahoo.com>
+//
+// Copyright (c) 2013 Therzok
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
using System.Linq;
using MonoDevelop.Ide;
using MonoDevelop.VersionControl.Views;
using MonoDevelop.Ide.Gui;
-
+using MonoDevelop.Projects;
+using System.Threading.Tasks;
+
namespace MonoDevelop.VersionControl
{
public class ResolveConflictsCommand
{
- public static bool ResolveConflicts (VersionControlItemList list, bool test)
+ public static async Task<bool> ResolveConflicts (VersionControlItemList list, bool test)
{
if (test)
return list.All (s => (s.VersionInfo.Status & VersionStatus.Conflicted) == VersionStatus.Conflicted);
foreach (var item in list.Where (s => (s.VersionInfo.Status & VersionStatus.Conflicted) == VersionStatus.Conflicted)) {
- Document doc = IdeApp.Workbench.OpenDocument (item.Path, true);
+ Document doc = await IdeApp.Workbench.OpenDocument (item.Path, item.ContainerProject, true);
foreach (var view in doc.Views) {
if (view.GetContent <MergeView> () != null)
view.Select ();
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertCommand.cs
index 600af23154..2e053bb10b 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertCommand.cs
@@ -43,7 +43,7 @@ namespace MonoDevelop.VersionControl
}
}
- private class RevertWorker : Task {
+ private class RevertWorker : VersionControlTask {
VersionControlItemList items;
public RevertWorker (VersionControlItemList items) {
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertRevisionsCommands.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertRevisionsCommands.cs
index dea73b39bf..293d5b7295 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertRevisionsCommands.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertRevisionsCommands.cs
@@ -75,7 +75,7 @@ namespace MonoDevelop.VersionControl
}
}
- private class RevertWorker : Task {
+ private class RevertWorker : VersionControlTask {
Repository vc;
string path;
Revision revision;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Revision.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Revision.cs
index 2ce8628112..107c4693bc 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Revision.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Revision.cs
@@ -97,31 +97,60 @@ namespace MonoDevelop.VersionControl
}
return msg.TrimStart (' ', '\t');
}
+
+ public static bool operator ==(Revision a, Revision b)
+ {
+ if (System.Object.ReferenceEquals(a, b))
+ {
+ return true;
+ }
+
+ if (((object)a == null) || ((object)b == null))
+ {
+ return false;
+ }
+ return a.Equals(b);
+ }
+
+ public static bool operator !=(Revision a, Revision b)
+ {
+ return !(a == b);
+ }
}
public class RevisionPath
{
- public RevisionPath (string path, RevisionAction action, string actionDescription)
+ public RevisionPath (string path, string oldPath, RevisionAction action, string actionDescription)
{
this.Path = path;
+ this.OldPath = oldPath;
this.Action = action;
this.ActionDescription = actionDescription;
}
+
+ public RevisionPath (string path, RevisionAction action, string actionDescription) : this (path, path, action, actionDescription)
+ {
+ }
+
+ public string OldPath {
+ get;
+ private set;
+ }
public string Path {
get;
- set;
+ private set;
}
public RevisionAction Action {
get;
- set;
+ private set;
}
// To use when Action == RevisionAction.Other
public string ActionDescription {
get;
- set;
+ private set;
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Task.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Task.cs
deleted file mode 100644
index 92aaac31c3..0000000000
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Task.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-using System;
-using System.Threading;
-using Gtk;
-
-using MonoDevelop.Core;
-
-namespace MonoDevelop.VersionControl
-{
- internal abstract class Task
- {
- IProgressMonitor tracker;
- ThreadNotify threadnotify;
-
- protected VersionControlOperationType OperationType { get; set; }
-
- protected abstract string GetDescription();
-
- // This occurs in the background.
- protected abstract void Run();
-
- // This occurs on the main thread when the background
- // task is complete.
- protected virtual void Finished()
- {
- }
-
- protected Task()
- {
- OperationType = VersionControlOperationType.Other;
- threadnotify = new ThreadNotify(new ReadyEvent(Wakeup));
- }
-
- protected IProgressMonitor Monitor {
- get { return tracker; }
- }
-
- protected virtual IProgressMonitor CreateProgressMonitor ()
- {
- return VersionControlService.GetProgressMonitor (GetDescription (), OperationType);
- }
-
- public void Start() {
- tracker = CreateProgressMonitor ();
- tracker.BeginTask(GetDescription(), 1);
- ThreadPool.QueueUserWorkItem (BackgroundWorker);
- }
-
- void BackgroundWorker (object state)
- {
- try {
- Run();
- } catch (DllNotFoundException e) {
- tracker.ReportError("The operation could not be completed because a shared library is missing: " + e.Message, null);
- } catch (Exception e) {
- string msg = GettextCatalog.GetString ("Version control operation failed: ");
- tracker.ReportError (msg, e);
- } finally {
- threadnotify.WakeupMain();
- }
- }
-
- public void Wakeup() {
- try {
- tracker.EndTask();
- tracker.Dispose();
- } finally {
- Finished();
- }
- }
-
- protected void Log(string logtext) {
- tracker.Log.WriteLine(logtext);
- }
-
- protected void Warn(string logtext) {
- tracker.ReportWarning(logtext);
- }
- }
-}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UnknownRepository.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UnknownRepository.cs
index 030583d3ce..43ced37847 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UnknownRepository.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UnknownRepository.cs
@@ -45,52 +45,52 @@ namespace MonoDevelop.VersionControl
}
- protected override Repository OnPublish (string serverPath, FilePath localPath, FilePath[] FilePath, string message, IProgressMonitor monitor)
+ protected override Repository OnPublish (string serverPath, FilePath localPath, FilePath[] FilePath, string message, ProgressMonitor monitor)
{
return null;
}
- protected override void OnUpdate (FilePath[] paths, bool recurse, IProgressMonitor monitor)
+ protected override void OnUpdate (FilePath[] paths, bool recurse, ProgressMonitor monitor)
{
}
- protected override void OnCommit (ChangeSet changeSet, IProgressMonitor monitor)
+ protected override void OnCommit (ChangeSet changeSet, ProgressMonitor monitor)
{
}
- protected override void OnCheckout (FilePath path, Revision rev, bool recurse, IProgressMonitor monitor)
+ protected override void OnCheckout (FilePath path, Revision rev, bool recurse, ProgressMonitor monitor)
{
}
- protected override void OnRevert (FilePath[] localPaths, bool recurse, IProgressMonitor monitor)
+ protected override void OnRevert (FilePath[] localPaths, bool recurse, ProgressMonitor monitor)
{
}
- protected override void OnRevertRevision (FilePath localPath, Revision revision, IProgressMonitor monitor)
+ protected override void OnRevertRevision (FilePath localPath, Revision revision, ProgressMonitor monitor)
{
}
- protected override void OnRevertToRevision (FilePath localPath, Revision revision, IProgressMonitor monitor)
+ protected override void OnRevertToRevision (FilePath localPath, Revision revision, ProgressMonitor monitor)
{
}
- protected override void OnAdd (FilePath[] paths, bool recurse, IProgressMonitor monitor)
+ protected override void OnAdd (FilePath[] paths, bool recurse, ProgressMonitor monitor)
{
}
- protected override void OnMoveFile (FilePath srcPath, FilePath destPath, bool force, IProgressMonitor monitor)
+ protected override void OnMoveFile (FilePath srcPath, FilePath destPath, bool force, ProgressMonitor monitor)
{
}
- protected override void OnMoveDirectory (FilePath srcPath, FilePath destPath, bool force, IProgressMonitor monitor)
+ protected override void OnMoveDirectory (FilePath srcPath, FilePath destPath, bool force, ProgressMonitor monitor)
{
}
- protected override void OnDeleteFiles (FilePath[] path, bool force, IProgressMonitor monitor, bool keepLocal)
+ protected override void OnDeleteFiles (FilePath[] path, bool force, ProgressMonitor monitor, bool keepLocal)
{
}
- protected override void OnDeleteDirectories (FilePath[] path, bool force, IProgressMonitor monitor, bool keepLocal)
+ protected override void OnDeleteDirectories (FilePath[] path, bool force, ProgressMonitor monitor, bool keepLocal)
{
}
@@ -102,7 +102,7 @@ namespace MonoDevelop.VersionControl
{
}
- public override Annotation[] GetAnnotations (FilePath repositoryPath)
+ public override Annotation[] GetAnnotations (FilePath repositoryPath, Revision since)
{
return new Annotation[0];
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UnlockCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UnlockCommand.cs
index 52b57bec2f..0fb3740224 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UnlockCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UnlockCommand.cs
@@ -45,7 +45,7 @@ namespace MonoDevelop.VersionControl
return true;
}
- private class UnlockWorker : Task
+ private class UnlockWorker : VersionControlTask
{
VersionControlItemList items;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UpdateCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UpdateCommand.cs
index 5c4c641fc3..18ab6a7713 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UpdateCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UpdateCommand.cs
@@ -16,7 +16,7 @@ namespace MonoDevelop.VersionControl
return true;
}
- private class UpdateWorker : Task {
+ private class UpdateWorker : VersionControlTask {
VersionControlItemList items;
public UpdateWorker (VersionControlItemList items) {
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs
index cc7637cc45..b918d0707e 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepositoryEditor.cs
@@ -1,8 +1,9 @@
using System;
+using System.Collections.Generic;
using System.Linq;
-using System.Collections.Generic;
-
+using MonoDevelop.Components;
+
namespace MonoDevelop.VersionControl
{
public partial class UrlBasedRepositoryEditor : Gtk.Bin, IRepositoryEditor
@@ -29,7 +30,7 @@ namespace MonoDevelop.VersionControl
updating = false;
}
- Gtk.Widget IRepositoryEditor.Widget {
+ Control IRepositoryEditor.Widget {
get { return this; }
}
@@ -46,9 +47,35 @@ namespace MonoDevelop.VersionControl
public string RelativePath {
get { return repositoryPathEntry.Text; }
}
+
+ bool ParseSSHUrl (string url)
+ {
+ if (!url.Contains (':'))
+ return false;
+
+ var tokens = url.Split (new [] { ':' }, 2);
+ if (!Uri.IsWellFormedUriString (tokens [0], UriKind.RelativeOrAbsolute) ||
+ !Uri.IsWellFormedUriString (tokens [1], UriKind.RelativeOrAbsolute))
+ return false;
+
+ var userAndHost = tokens [0].Split ('@');
+ repositoryUserEntry.Text = userAndHost [0];
+ repositoryServerEntry.Text = userAndHost [1];
+ repositoryPortSpin.Value = 22;
+ string path = tokens [1];
+ if (!path.StartsWith ("/", StringComparison.Ordinal)) {
+ path = "/" + path;
+ }
+ repositoryPathEntry.Text = path;
+ comboProtocol.Active = protocols.IndexOf ("ssh");
+ comboProtocol.Sensitive = false;
+ PathChanged?.Invoke (this, EventArgs.Empty);
+ return true;
+ }
void Fill ()
{
+ comboProtocol.Sensitive = true;
if (repo.Uri != null && repo.Uri.IsAbsoluteUri) {
if (repo.Name == repositoryServerEntry.Text)
repo.Name = repo.Uri.Host;
@@ -57,9 +84,8 @@ namespace MonoDevelop.VersionControl
repositoryPathEntry.Text = repo.Uri.PathAndQuery;
repositoryUserEntry.Text = repo.Uri.UserInfo;
comboProtocol.Active = protocols.IndexOf (repo.Uri.Scheme);
- if (PathChanged != null)
- PathChanged (this, new EventArgs ());
- } else {
+ PathChanged?.Invoke (this, EventArgs.Empty);
+ } else if (!ParseSSHUrl (repo.Url)) {
// The url may have a scheme, but it may be an incomplete or incorrect url. Do the best to select
// the correct value in the protocol combo
string prot = repo.SupportedProtocols.FirstOrDefault (p => repo.Url.StartsWith (p + "://", StringComparison.Ordinal));
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlCommandHandler.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlCommandHandler.cs
index 4cd1055a56..5d2acf4cbf 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlCommandHandler.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlCommandHandler.cs
@@ -70,7 +70,7 @@ namespace MonoDevelop.VersionControl
{
string path;
bool isDir;
- IWorkspaceObject pentry;
+ WorkspaceObject pentry;
VersionInfo versionInfo = null;
if (obj is ProjectFile) {
@@ -103,8 +103,8 @@ namespace MonoDevelop.VersionControl
path = item.FileName;
isDir = false;
pentry = item;
- } else if (obj is IWorkspaceObject) {
- pentry = ((IWorkspaceObject)obj);
+ } else if (obj is WorkspaceObject) {
+ pentry = ((WorkspaceObject)obj);
path = pentry.BaseDirectory;
isDir = true;
} else
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlException.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlException.cs
index dd2402cbad..da032ef9c6 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlException.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlException.cs
@@ -27,11 +27,15 @@ using System;
namespace MonoDevelop.VersionControl
{
- public class VersionControlException : ApplicationException
+ public class VersionControlException : Exception
{
public VersionControlException (string message) : base (message)
{
}
+
+ public VersionControlException (string message, Exception native) : base (message, native)
+ {
+ }
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlFileSystemExtension.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlFileSystemExtension.cs
index 84a12e5935..1a9fe48891 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlFileSystemExtension.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlFileSystemExtension.cs
@@ -25,7 +25,7 @@ namespace MonoDevelop.VersionControl
{
path = path.FullPath;
- Project p = IdeApp.Workspace.GetProjectContainingFile (path);
+ Project p = IdeApp.Workspace.GetProjectsContainingFile (path).FirstOrDefault ();
if (p != null)
return VersionControlService.GetRepository (p);
@@ -52,7 +52,7 @@ namespace MonoDevelop.VersionControl
public override void MoveFile (FilePath source, FilePath dest)
{
- IProgressMonitor monitor = new NullProgressMonitor ();
+ ProgressMonitor monitor = new ProgressMonitor ();
Repository srcRepo = GetRepository (source);
Repository dstRepo = GetRepository (dest);
@@ -78,7 +78,7 @@ namespace MonoDevelop.VersionControl
public override void DeleteFile (FilePath file)
{
Repository repo = GetRepository (file);
- repo.DeleteFile (file, true, new NullProgressMonitor (), false);
+ repo.DeleteFile (file, true, new ProgressMonitor (), false);
}
public override void CreateDirectory (FilePath path)
@@ -86,12 +86,12 @@ namespace MonoDevelop.VersionControl
Repository repo = GetRepository (path);
repo.ClearCachedVersionInfo (path);
System.IO.Directory.CreateDirectory (path);
- repo.Add (path, false, new NullProgressMonitor ());
+ repo.Add (path, false, new ProgressMonitor ());
}
public override void MoveDirectory (FilePath sourcePath, FilePath destPath)
{
- IProgressMonitor monitor = new NullProgressMonitor ();
+ ProgressMonitor monitor = new ProgressMonitor ();
Repository srcRepo = GetRepository (sourcePath);
Repository dstRepo = GetRepository (destPath);
@@ -107,13 +107,13 @@ namespace MonoDevelop.VersionControl
public override void DeleteDirectory (FilePath path)
{
Repository repo = GetRepository (path);
- repo.DeleteDirectory (path, true, new NullProgressMonitor (), false);
+ repo.DeleteDirectory (path, true, new ProgressMonitor (), false);
}
- public override void RequestFileEdit (IEnumerable<FilePath> files)
+ public override void RequestFileEdit (FilePath file)
{
- Repository repo = GetRepository (FilePath.GetCommonRootPath (files));
- repo.RequestFileWritePermission (files.ToArray ());
+ Repository repo = GetRepository (file.FullPath);
+ repo.RequestFileWritePermission (file);
}
public override void NotifyFilesChanged (IEnumerable<FilePath> files)
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlItem.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlItem.cs
index 9ee8889509..54e61f4144 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlItem.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlItem.cs
@@ -35,16 +35,30 @@ namespace MonoDevelop.VersionControl
{
VersionInfo versionInfo;
- public VersionControlItem (Repository repository, IWorkspaceObject workspaceObject, FilePath path, bool isDirectory, VersionInfo versionInfo)
+ public VersionControlItem (Repository repository, WorkspaceObject workspaceObject, FilePath path, bool isDirectory, VersionInfo versionInfo)
{
Path = path;
Repository = repository;
WorkspaceObject = workspaceObject;
IsDirectory = isDirectory;
- this.versionInfo = versionInfo;
+ this.versionInfo = versionInfo;
+
+ var obj = workspaceObject;
+ while (obj != null) {
+ var p = obj as Project;
+ if (p != null)
+ ContainerProject = p;
+
+ obj = obj.ParentObject;
+ }
}
- public IWorkspaceObject WorkspaceObject {
+ public WorkspaceObject WorkspaceObject {
+ get;
+ private set;
+ }
+
+ internal Project ContainerProject {
get;
private set;
}
@@ -85,6 +99,9 @@ namespace MonoDevelop.VersionControl
}
return versionInfo;
}
+ internal set {
+ versionInfo = value;
+ }
}
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlNodeExtension.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlNodeExtension.cs
index e3dab911e5..a7af49ecd8 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlNodeExtension.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlNodeExtension.cs
@@ -10,7 +10,7 @@ using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.VersionControl.Views;
using MonoDevelop.Ide;
-
+using System.Threading.Tasks;
namespace MonoDevelop.VersionControl
{
@@ -24,19 +24,26 @@ namespace MonoDevelop.VersionControl
return typeof(ProjectFile).IsAssignableFrom (dataType)
|| typeof(SystemFile).IsAssignableFrom (dataType)
|| typeof(ProjectFolder).IsAssignableFrom (dataType)
- || typeof(IWorkspaceObject).IsAssignableFrom (dataType);
+ || typeof(WorkspaceObject).IsAssignableFrom (dataType);
}
protected override void Initialize ()
{
base.Initialize ();
- VersionControlService.FileStatusChanged += Monitor;
+ VersionControlService.FileStatusChanged += Monitor;
+ IdeApp.Workspace.LastWorkspaceItemClosed += OnWorkspaceRefresh;
}
public override void Dispose ()
{
- VersionControlService.FileStatusChanged -= Monitor;
+ VersionControlService.FileStatusChanged -= Monitor;
+ IdeApp.Workspace.LastWorkspaceItemClosed -= OnWorkspaceRefresh;
base.Dispose ();
+ }
+
+ void OnWorkspaceRefresh (object sender, EventArgs args)
+ {
+ pathToObject.Clear ();
}
public override void BuildNode (ITreeBuilder builder, object dataObject, NodeInfo nodeInfo)
@@ -46,8 +53,8 @@ namespace MonoDevelop.VersionControl
// Add status overlays
- if (dataObject is IWorkspaceObject) {
- IWorkspaceObject ce = (IWorkspaceObject) dataObject;
+ if (dataObject is WorkspaceObject) {
+ WorkspaceObject ce = (WorkspaceObject) dataObject;
Repository rep = VersionControlService.GetRepository (ce);
if (rep != null) {
rep.GetDirectoryVersionInfo (ce.BaseDirectory, false, false);
@@ -66,7 +73,7 @@ namespace MonoDevelop.VersionControl
return;
}
- IWorkspaceObject prj;
+ WorkspaceObject prj;
FilePath file;
if (dataObject is ProjectFile) {
@@ -202,8 +209,8 @@ namespace MonoDevelop.VersionControl
return ((ProjectFile) dataObject).FilePath;
} else if (dataObject is SystemFile) {
return ((SystemFile) dataObject).Path;
- } else if (dataObject is IWorkspaceObject) {
- return ((IWorkspaceObject)dataObject).BaseDirectory;
+ } else if (dataObject is WorkspaceObject) {
+ return ((WorkspaceObject)dataObject).BaseDirectory;
} else if (dataObject is ProjectFolder) {
return ((ProjectFolder)dataObject).Path;
}
@@ -222,177 +229,177 @@ namespace MonoDevelop.VersionControl
{
[AllowMultiSelection]
[CommandHandler (Commands.Update)]
- protected void OnUpdate() {
- RunCommand(Commands.Update, false);
+ protected async void OnUpdate() {
+ await RunCommand(Commands.Update, false);
}
[CommandUpdateHandler (Commands.Update)]
- protected void UpdateUpdate(CommandInfo item) {
- TestCommand(Commands.Update, item);
+ protected async void UpdateUpdate(CommandInfo item) {
+ await TestCommand(Commands.Update, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.Diff)]
- protected void OnDiff() {
- RunCommand(Commands.Diff, false);
+ protected async void OnDiff() {
+ await RunCommand(Commands.Diff, false);
}
[CommandUpdateHandler (Commands.Diff)]
- protected void UpdateDiff(CommandInfo item) {
- TestCommand(Commands.Diff, item);
+ protected async void UpdateDiff(CommandInfo item) {
+ await TestCommand(Commands.Diff, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.Log)]
- protected void OnLog() {
- RunCommand(Commands.Log, false);
+ protected async void OnLog() {
+ await RunCommand(Commands.Log, false);
}
[CommandUpdateHandler (Commands.Log)]
- protected void UpdateLog(CommandInfo item) {
- TestCommand(Commands.Log, item);
+ protected async void UpdateLog(CommandInfo item) {
+ await TestCommand(Commands.Log, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.Status)]
- protected void OnStatus() {
- RunCommand(Commands.Status, false);
+ protected async void OnStatus() {
+ await RunCommand(Commands.Status, false);
}
[CommandUpdateHandler (Commands.Status)]
- protected void UpdateStatus(CommandInfo item) {
- TestCommand(Commands.Status, item);
+ protected async void UpdateStatus(CommandInfo item) {
+ await TestCommand(Commands.Status, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.Add)]
- protected void OnAdd() {
- RunCommand(Commands.Add, false);
+ protected async void OnAdd() {
+ await RunCommand(Commands.Add, false);
}
[CommandUpdateHandler (Commands.Add)]
- protected void UpdateAdd(CommandInfo item) {
- TestCommand(Commands.Add, item);
+ protected async void UpdateAdd(CommandInfo item) {
+ await TestCommand(Commands.Add, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.Remove)]
- protected void OnRemove() {
- RunCommand(Commands.Remove, false);
+ protected async void OnRemove() {
+ await RunCommand(Commands.Remove, false);
}
[CommandUpdateHandler (Commands.Remove)]
- protected void UpdateRemove(CommandInfo item) {
- TestCommand(Commands.Remove, item);
+ protected async void UpdateRemove(CommandInfo item) {
+ await TestCommand(Commands.Remove, item);
}
[CommandHandler (Commands.Publish)]
- protected void OnPublish()
+ protected async void OnPublish()
{
- RunCommand(Commands.Publish, false);
+ await RunCommand(Commands.Publish, false);
}
[CommandUpdateHandler (Commands.Publish)]
- protected void UpdatePublish(CommandInfo item) {
- TestCommand(Commands.Publish, item);
+ protected async void UpdatePublish(CommandInfo item) {
+ await TestCommand(Commands.Publish, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.Revert)]
- protected void OnRevert() {
- RunCommand(Commands.Revert, false, false);
+ protected async void OnRevert() {
+ await RunCommand(Commands.Revert, false, false);
}
[CommandUpdateHandler (Commands.Revert)]
- protected void UpdateRevert(CommandInfo item) {
- TestCommand(Commands.Revert, item, false);
+ protected async void UpdateRevert(CommandInfo item) {
+ await TestCommand(Commands.Revert, item, false);
}
[AllowMultiSelection]
[CommandHandler (Commands.Lock)]
- protected void OnLock() {
- RunCommand(Commands.Lock, false);
+ protected async void OnLock() {
+ await RunCommand(Commands.Lock, false);
}
[CommandUpdateHandler (Commands.Lock)]
- protected void UpdateLock(CommandInfo item) {
- TestCommand(Commands.Lock, item);
+ protected async void UpdateLock(CommandInfo item) {
+ await TestCommand(Commands.Lock, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.Unlock)]
- protected void OnUnlock() {
- RunCommand(Commands.Unlock, false);
+ protected async void OnUnlock() {
+ await RunCommand(Commands.Unlock, false);
}
[CommandUpdateHandler (Commands.Unlock)]
- protected void UpdateUnlock(CommandInfo item) {
- TestCommand(Commands.Unlock, item);
+ protected async void UpdateUnlock(CommandInfo item) {
+ await TestCommand(Commands.Unlock, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.Annotate)]
- protected void OnAnnotate() {
- RunCommand(Commands.Annotate, false);
+ protected async void OnAnnotate() {
+ await RunCommand(Commands.Annotate, false);
}
[CommandUpdateHandler (Commands.Annotate)]
- protected void UpdateAnnotate(CommandInfo item) {
- TestCommand(Commands.Annotate, item);
+ protected async void UpdateAnnotate(CommandInfo item) {
+ await TestCommand(Commands.Annotate, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.CreatePatch)]
- protected void OnCreatePatch() {
- RunCommand(Commands.CreatePatch, false);
+ protected async void OnCreatePatch() {
+ await RunCommand(Commands.CreatePatch, false);
}
[CommandUpdateHandler (Commands.CreatePatch)]
- protected void UpdateCreatePatch(CommandInfo item) {
- TestCommand(Commands.CreatePatch, item);
+ protected async void UpdateCreatePatch(CommandInfo item) {
+ await TestCommand(Commands.CreatePatch, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.Ignore)]
- protected void OnIgnore ()
+ protected async void OnIgnore ()
{
- RunCommand(Commands.Ignore, false);
+ await RunCommand(Commands.Ignore, false);
}
[CommandUpdateHandler (Commands.Ignore)]
- protected void UpdateIgnore (CommandInfo item)
+ protected async void UpdateIgnore (CommandInfo item)
{
- TestCommand(Commands.Ignore, item);
+ await TestCommand(Commands.Ignore, item);
}
[AllowMultiSelection]
[CommandHandler (Commands.Unignore)]
- protected void OnUnignore ()
+ protected async void OnUnignore ()
{
- RunCommand(Commands.Unignore, false);
+ await RunCommand(Commands.Unignore, false);
}
[CommandUpdateHandler (Commands.Unignore)]
- protected void UpdateUnignore (CommandInfo item)
+ protected async void UpdateUnignore (CommandInfo item)
{
- TestCommand(Commands.Unignore, item);
+ await TestCommand(Commands.Unignore, item);
}
[CommandHandler (Commands.ResolveConflicts)]
- protected void OnResolveConflicts ()
+ protected async void OnResolveConflicts ()
{
- RunCommand (Commands.ResolveConflicts, false, false);
+ await RunCommand (Commands.ResolveConflicts, false, false);
}
[CommandUpdateHandler (Commands.ResolveConflicts)]
- protected void UpdateResolveConflicts (CommandInfo item)
+ protected async void UpdateResolveConflicts (CommandInfo item)
{
- TestCommand (Commands.ResolveConflicts, item, false);
+ await TestCommand (Commands.ResolveConflicts, item, false);
}
- private void TestCommand(Commands cmd, CommandInfo item, bool projRecurse = true)
+ private async Task<TestResult> TestCommand(Commands cmd, CommandInfo item, bool projRecurse = true)
{
- TestResult res = RunCommand(cmd, true, projRecurse);
+ TestResult res = await RunCommand(cmd, true, projRecurse);
if (res == TestResult.NoVersionControl && cmd == Commands.Log) {
// Use the update command to show the "not available" message
item.Icon = null;
@@ -402,10 +409,12 @@ namespace MonoDevelop.VersionControl
else
item.Text = GettextCatalog.GetString ("This project or folder is not under version control");
} else
- item.Visible = res == TestResult.Enable;
+ item.Visible = res == TestResult.Enable;
+
+ return res;
}
- private TestResult RunCommand (Commands cmd, bool test, bool projRecurse = true)
+ private async Task<TestResult> RunCommand (Commands cmd, bool test, bool projRecurse = true)
{
VersionControlItemList items = GetItems (projRecurse);
@@ -426,10 +435,10 @@ namespace MonoDevelop.VersionControl
res = UpdateCommand.Update (items, test);
break;
case Commands.Diff:
- res = DiffCommand.Show (items, test);
+ res = await DiffCommand.Show (items, test);
break;
case Commands.Log:
- res = LogCommand.Show (items, test);
+ res = await LogCommand.Show (items, test);
break;
case Commands.Status:
res = StatusView.Show (items, test, false);
@@ -455,7 +464,7 @@ namespace MonoDevelop.VersionControl
res = PublishCommand.Publish (it.WorkspaceObject, it.Path, test);
break;
case Commands.Annotate:
- res = BlameCommand.Show (items, test);
+ res = await BlameCommand.Show (items, test);
break;
case Commands.CreatePatch:
res = CreatePatchCommand.CreatePatch (items, test);
@@ -467,7 +476,7 @@ namespace MonoDevelop.VersionControl
res = UnignoreCommand.Unignore (items, test);
break;
case Commands.ResolveConflicts:
- res = ResolveConflictsCommand.ResolveConflicts (items, test);
+ res = await ResolveConflictsCommand.ResolveConflicts (items, test);
break;
}
}
@@ -500,7 +509,7 @@ namespace MonoDevelop.VersionControl
{
foreach (VersionControlItem it in GetItems ()) {
if (!it.IsDirectory)
- IdeApp.Workbench.OpenDocument (it.Path);
+ IdeApp.Workbench.OpenDocument (it.Path, it.ContainerProject);
}
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlService.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlService.cs
index 1b305bdee5..0c1fb6bdc4 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlService.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlService.cs
@@ -46,7 +46,7 @@ namespace MonoDevelop.VersionControl
static List<VersionControlSystem> handlers = new List<VersionControlSystem> ();
static VersionControlConfiguration configuration;
static DataContext dataContext = new DataContext ();
-
+
public static event FileUpdateEventHandler FileStatusChanged;
public static event CommitEventHandler PrepareCommit;
public static event CommitEventHandler BeginCommit;
@@ -196,16 +196,16 @@ namespace MonoDevelop.VersionControl
}
internal static Dictionary<Repository, InternalRepositoryReference> referenceCache = new Dictionary<Repository, InternalRepositoryReference> ();
- public static Repository GetRepository (IWorkspaceObject entry)
+ public static Repository GetRepository (WorkspaceObject entry)
{
if (IsGloballyDisabled)
return null;
InternalRepositoryReference repoRef = (InternalRepositoryReference) entry.ExtendedProperties [typeof(InternalRepositoryReference)];
- if (repoRef != null)
+ if (repoRef != null && !repoRef.Repo.Disposed)
return repoRef.Repo;
- Repository repo = VersionControlService.GetRepositoryReference (entry.BaseDirectory, entry.Name);
+ Repository repo = GetRepositoryReference (entry.BaseDirectory, entry.Name);
InternalRepositoryReference rref = null;
if (repo != null) {
repo.AddRef ();
@@ -380,57 +380,52 @@ namespace MonoDevelop.VersionControl
internal static void NotifyPrepareCommit (Repository repo, ChangeSet changeSet)
{
- if (!DispatchService.IsGuiThread) {
+ if (!Runtime.IsMainThread) {
Gtk.Application.Invoke (delegate {
NotifyPrepareCommit (repo, changeSet);
});
return;
}
- if (PrepareCommit != null) {
- try {
- PrepareCommit (null, new CommitEventArgs (repo, changeSet, false));
- } catch (Exception ex) {
- LoggingService.LogInternalError (ex);
- }
+ try {
+ PrepareCommit?.Invoke (null, new CommitEventArgs (repo, changeSet, false));
+ } catch (Exception ex) {
+ LoggingService.LogInternalError (ex);
}
}
internal static void NotifyBeforeCommit (Repository repo, ChangeSet changeSet)
{
- if (!DispatchService.IsGuiThread) {
+ if (!Runtime.IsMainThread) {
Gtk.Application.Invoke (delegate {
NotifyBeforeCommit (repo, changeSet);
});
return;
}
- if (BeginCommit != null) {
- try {
- BeginCommit (null, new CommitEventArgs (repo, changeSet, false));
- } catch (Exception ex) {
- LoggingService.LogInternalError (ex);
- }
+ try {
+ BeginCommit?.Invoke (null, new CommitEventArgs (repo, changeSet, false));
+ } catch (Exception ex) {
+ LoggingService.LogInternalError (ex);
}
}
internal static void NotifyAfterCommit (Repository repo, ChangeSet changeSet, bool success)
{
- if (!DispatchService.IsGuiThread) {
+ if (!Runtime.IsMainThread) {
Gtk.Application.Invoke (delegate {
NotifyAfterCommit (repo, changeSet, success);
});
return;
}
- if (EndCommit != null) {
- try {
- EndCommit (null, new CommitEventArgs (repo, changeSet, success));
- } catch (Exception ex) {
- LoggingService.LogInternalError (ex);
- return;
- }
+ try {
+ EndCommit?.Invoke (null, new CommitEventArgs (repo, changeSet, success));
+ } catch (Exception ex) {
+ LoggingService.LogInternalError (ex);
+ return;
}
+
if (success) {
foreach (ChangeSetItem it in changeSet.Items)
SetCommitComment (it.LocalPath, null, false);
@@ -447,13 +442,12 @@ namespace MonoDevelop.VersionControl
public static void NotifyFileStatusChanged (FileUpdateEventArgs args)
{
- if (!DispatchService.IsGuiThread)
+ if (!Runtime.IsMainThread)
Gtk.Application.Invoke (delegate {
NotifyFileStatusChanged (args);
});
else {
- if (FileStatusChanged != null)
- FileStatusChanged (null, args);
+ FileStatusChanged?.Invoke (null, args);
}
}
@@ -473,7 +467,7 @@ namespace MonoDevelop.VersionControl
static void OnFileAdded (object s, ProjectFileEventArgs e)
{
FileUpdateEventArgs vargs = new FileUpdateEventArgs ();
- IProgressMonitor monitor = null;
+ ProgressMonitor monitor = null;
try {
foreach (var repoFiles in e.GroupBy (i => i.Project)) {
Repository repo = GetRepository (repoFiles.Key);
@@ -520,10 +514,10 @@ namespace MonoDevelop.VersionControl
}
}
*/
- static void SolutionItemAddFiles (string rootPath, SolutionItem entry, HashSet<string> files)
+ static void SolutionItemAddFiles (string rootPath, SolutionFolderItem entry, HashSet<string> files)
{
- if (entry is SolutionEntityItem) {
- foreach (var file in ((SolutionEntityItem)entry).GetItemFiles (false))
+ if (entry is SolutionItem) {
+ foreach (var file in ((SolutionItem)entry).GetItemFiles (false))
SolutionItemAddFile (rootPath, files, file);
}
@@ -533,7 +527,7 @@ namespace MonoDevelop.VersionControl
SolutionItemAddFile (rootPath, files, file.FilePath);
}
} else if (entry is SolutionFolder) {
- foreach (SolutionItem ent in ((SolutionFolder) entry).Items)
+ foreach (SolutionFolderItem ent in ((SolutionFolder) entry).Items)
SolutionItemAddFiles (rootPath, ent, files);
}
}
@@ -557,7 +551,7 @@ namespace MonoDevelop.VersionControl
return;
// handles addition of solutions and projects
- SolutionItem parent = (SolutionItem) args.SolutionItem.ParentFolder;
+ SolutionFolderItem parent = (SolutionFolderItem) args.SolutionItem.ParentFolder;
if (parent == null)
return;
@@ -567,7 +561,7 @@ namespace MonoDevelop.VersionControl
if (repo == null)
return;
- SolutionItem entry = args.SolutionItem;
+ SolutionFolderItem entry = args.SolutionItem;
Repository currentRepo = GetRepository (entry);
if (currentRepo != null && currentRepo.VersionControlSystem != repo.VersionControlSystem) {
// If the item is already under version control using a different version control system
@@ -584,7 +578,7 @@ namespace MonoDevelop.VersionControl
var files = new HashSet<string> { path };
SolutionItemAddFiles (path, entry, files);
- using (IProgressMonitor monitor = GetStatusMonitor ()) {
+ using (ProgressMonitor monitor = GetStatusMonitor ()) {
var status = repo.GetDirectoryVersionInfo (path, false, true);
foreach (var v in status) {
if (!v.IsVersioned && files.Contains (v.LocalPath))
@@ -598,12 +592,12 @@ namespace MonoDevelop.VersionControl
NotifyFileStatusChanged (new FileUpdateEventArgs (repo, parent.BaseDirectory, true));
}
- public static IProgressMonitor GetProgressMonitor (string operation)
+ public static ProgressMonitor GetProgressMonitor (string operation)
{
return GetProgressMonitor (operation, VersionControlOperationType.Other);
}
- public static IProgressMonitor GetProgressMonitor (string operation, VersionControlOperationType op)
+ public static ProgressMonitor GetProgressMonitor (string operation, VersionControlOperationType op)
{
IconId icon;
switch (op) {
@@ -612,15 +606,15 @@ namespace MonoDevelop.VersionControl
default: icon = "md-version-control"; break;
}
- IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetOutputProgressMonitor ("MonoDevelop.VersionControlOutput", "Version Control", "md-version-control", false, true);
+ ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetOutputProgressMonitor ("MonoDevelop.VersionControlOutput", GettextCatalog.GetString ("Version Control"), "md-version-control", false, true);
Pad outPad = IdeApp.Workbench.ProgressMonitors.GetPadForMonitor (monitor);
AggregatedProgressMonitor mon = new AggregatedProgressMonitor (monitor);
- mon.AddSlaveMonitor (IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor (operation, icon, true, true, false, outPad));
+ mon.AddFollowerMonitor (IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor (operation, icon, true, true, false, outPad));
return mon;
}
- static IProgressMonitor GetStatusMonitor ()
+ static ProgressMonitor GetStatusMonitor ()
{
return IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor (GettextCatalog.GetString ("Updating version control repository"), "vc-remote-status", true);
}
@@ -715,12 +709,7 @@ namespace MonoDevelop.VersionControl
{
configuration = null;
}
-
- public static void StoreRepositoryReference (Repository repo, string path, string id)
- {
- repo.VersionControlSystem.StoreRepositoryReference (repo, path, id);
- }
-
+
public static bool CheckVersionControlInstalled ()
{
if (IsGloballyDisabled)
@@ -729,44 +718,7 @@ namespace MonoDevelop.VersionControl
return GetVersionControlSystems ().Any (vcs => vcs.IsInstalled);
}
- internal static Repository InternalGetRepositoryReference (string path, string id)
- {
- string file = InternalGetRepositoryPath (path, id);
- if (file == null)
- return null;
-
- XmlDataSerializer ser = new XmlDataSerializer (dataContext);
- XmlTextReader reader = new XmlTextReader (new StreamReader (file));
- try {
- return (Repository) ser.Deserialize (reader, typeof(Repository));
- } finally {
- reader.Close ();
- }
- }
-
- internal static string InternalGetRepositoryPath (string path, string id)
- {
- string file = Path.Combine (path, id) + ".mdvcs";
- if (!File.Exists (file))
- return null;
-
- return file;
- }
-
- internal static void InternalStoreRepositoryReference (Repository repo, string path, string id)
- {
- string file = Path.Combine (path, id) + ".mdvcs";
-
- XmlDataSerializer ser = new XmlDataSerializer (dataContext);
- XmlTextWriter tw = new XmlTextWriter (new StreamWriter (file));
- try {
- ser.Serialize (tw, repo, typeof(Repository));
- } finally {
- tw.Close ();
- }
- }
-
- public static CommitMessageFormat GetCommitMessageFormat (SolutionItem item)
+ public static CommitMessageFormat GetCommitMessageFormat (SolutionFolderItem item)
{
CommitMessageFormat format = new CommitMessageFormat ();
format.Style = item.Policies.Get<VersionControlPolicy> ().CommitMessageStyle;
@@ -787,7 +739,7 @@ namespace MonoDevelop.VersionControl
break;
}
} else {
- project = IdeApp.Workspace.GetProjectContainingFile (item.LocalPath);
+ project = IdeApp.Workspace.GetProjectsContainingFile (item.LocalPath).FirstOrDefault ();
}
}
CommitMessageStyle style;
@@ -822,9 +774,8 @@ namespace MonoDevelop.VersionControl
}
class InternalRepositoryReference: IDisposable
- {
- Repository repo;
-
+ {
+ readonly Repository repo;
public InternalRepositoryReference (Repository repo)
{
this.repo = repo;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlSystem.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlSystem.cs
index 715ae193cb..43a54eb653 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlSystem.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlSystem.cs
@@ -69,8 +69,8 @@ namespace MonoDevelop.VersionControl
/// <param name='repo'>
/// A repository
/// </param>
- public abstract IRepositoryEditor CreateRepositoryEditor (Repository repo);
-
+ public abstract IRepositoryEditor CreateRepositoryEditor (Repository repo);
+
/// <summary>
/// Gets a repository for a given local path and identifier
/// </summary>
@@ -91,10 +91,7 @@ namespace MonoDevelop.VersionControl
/// repository references and will Dispose the repository only when
/// the last reference to the repo is freed.
/// </remarks>
- public virtual Repository GetRepositoryReference (FilePath path, string id)
- {
- return VersionControlService.InternalGetRepositoryReference (path, id);
- }
+ public abstract Repository GetRepositoryReference (FilePath path, string id);
/// <summary>
/// Gets the repository path root under this version control system.
@@ -113,14 +110,6 @@ namespace MonoDevelop.VersionControl
/// <returns>The repository path.</returns>
/// <param name="path">The path to start the repository detection from.</param>
/// <param name="id">An identifier. This identifier is generated by MD and normally identifiers a project.</param>
- protected abstract FilePath OnGetRepositoryPath (FilePath path, string id);
-
- /// <summary>
- /// Currently unused
- /// </summary>
- public virtual void StoreRepositoryReference (Repository repo, FilePath path, string id)
- {
- VersionControlService.InternalStoreRepositoryReference (repo, path, id);
- }
+ protected abstract FilePath OnGetRepositoryPath (FilePath path, string id);
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlTask.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlTask.cs
new file mode 100644
index 0000000000..1f0f56c7c5
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlTask.cs
@@ -0,0 +1,80 @@
+using System;
+using System.Threading;
+using Gtk;
+
+using MonoDevelop.Core;
+
+namespace MonoDevelop.VersionControl
+{
+ internal abstract class VersionControlTask
+ {
+ ProgressMonitor tracker;
+ ThreadNotify threadnotify;
+
+ protected VersionControlOperationType OperationType { get; set; }
+
+ protected abstract string GetDescription();
+
+ // This occurs in the background.
+ protected abstract void Run();
+
+ // This occurs on the main thread when the background
+ // task is complete.
+ protected virtual void Finished()
+ {
+ }
+
+ protected VersionControlTask()
+ {
+ OperationType = VersionControlOperationType.Other;
+ threadnotify = new ThreadNotify(new ReadyEvent(Wakeup));
+ }
+
+ protected ProgressMonitor Monitor {
+ get { return tracker; }
+ }
+
+ protected virtual ProgressMonitor CreateProgressMonitor ()
+ {
+ return VersionControlService.GetProgressMonitor (GetDescription (), OperationType);
+ }
+
+ public void Start() {
+ tracker = CreateProgressMonitor ();
+ tracker.BeginTask(GetDescription(), 1);
+ ThreadPool.QueueUserWorkItem (BackgroundWorker);
+ }
+
+ void BackgroundWorker (object state)
+ {
+ try {
+ Run();
+ } catch (DllNotFoundException e) {
+ string msg = GettextCatalog.GetString ("The operation could not be completed because a shared library is missing: ");
+ tracker.ReportError(msg + e.Message, null);
+ } catch (Exception e) {
+ string msg = GettextCatalog.GetString ("Version control operation failed: ");
+ tracker.ReportError (msg, e);
+ } finally {
+ threadnotify.WakeupMain();
+ }
+ }
+
+ public void Wakeup() {
+ try {
+ tracker.EndTask();
+ tracker.Dispose();
+ } finally {
+ Finished();
+ }
+ }
+
+ protected void Log(string logtext) {
+ tracker.Log.WriteLine(logtext);
+ }
+
+ protected void Warn(string logtext) {
+ tracker.ReportWarning(logtext);
+ }
+ }
+}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionInfoCache.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionInfoCache.cs
index 92fc30ab22..414e6350d4 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionInfoCache.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionInfoCache.cs
@@ -26,12 +26,15 @@
using MonoDevelop.Core;
using System.Collections.Generic;
using System.Linq;
-
+using System.Threading;
+
namespace MonoDevelop.VersionControl
{
class VersionInfoCache
{
- Dictionary<FilePath,VersionInfo> fileStatus = new Dictionary<FilePath, VersionInfo> ();
+ ReaderWriterLockSlim fileLock = new ReaderWriterLockSlim();
+ Dictionary<FilePath,VersionInfo> fileStatus = new Dictionary<FilePath, VersionInfo> ();
+ ReaderWriterLockSlim directoryLock = new ReaderWriterLockSlim ();
Dictionary<FilePath,DirectoryStatus> directoryStatus = new Dictionary<FilePath, DirectoryStatus> ();
Repository repo;
@@ -42,69 +45,94 @@ namespace MonoDevelop.VersionControl
public void ClearCachedVersionInfo (FilePath rootPath)
{
- var canonicalPath = rootPath.CanonicalPath;
- lock (fileStatus) {
- foreach (var p in fileStatus.Where (e => e.Key.IsChildPathOf (rootPath) || e.Key == canonicalPath))
- p.Value.RequiresRefresh = true;
+ var canonicalPath = rootPath.CanonicalPath;
+
+ try {
+ fileLock.EnterWriteLock ();
+ foreach (var p in fileStatus.Where (e => e.Key.IsChildPathOf (rootPath) || e.Key == canonicalPath))
+ p.Value.RequiresRefresh = true;
+ } finally {
+ fileLock.ExitWriteLock ();
}
- lock (directoryStatus) {
- foreach (var p in directoryStatus.Where (e => e.Key.IsChildPathOf (rootPath) || e.Key == canonicalPath))
- p.Value.RequiresRefresh = true;
+
+ try {
+ directoryLock.EnterWriteLock ();
+ foreach (var p in directoryStatus.Where (e => e.Key.IsChildPathOf (rootPath) || e.Key == canonicalPath))
+ p.Value.RequiresRefresh = true;
+ } finally {
+ directoryLock.ExitWriteLock ();
}
}
public VersionInfo GetStatus (FilePath localPath)
- {
- lock (fileStatus) {
- VersionInfo vi;
- fileStatus.TryGetValue (localPath, out vi);
- return vi;
- }
+ {
+ try {
+ fileLock.EnterReadLock ();
+
+ VersionInfo vi;
+ fileStatus.TryGetValue (localPath, out vi);
+ return vi;
+ } finally {
+ fileLock.ExitReadLock ();
+ }
}
public DirectoryStatus GetDirectoryStatus (FilePath localPath)
- {
- lock (directoryStatus) {
+ {
+ try {
+ directoryLock.EnterReadLock ();
+
DirectoryStatus vis;
- if (directoryStatus.TryGetValue (localPath.CanonicalPath, out vis))
+ if (directoryStatus.TryGetValue (localPath.CanonicalPath, out vis))
return vis;
- return null;
+ return null;
+ } finally {
+ directoryLock.ExitReadLock ();
}
}
public void SetStatus (VersionInfo versionInfo, bool notify = true)
- {
- lock (fileStatus) {
- VersionInfo vi;
- if (fileStatus.TryGetValue (versionInfo.LocalPath, out vi) && vi.Equals (versionInfo)) {
- vi.RequiresRefresh = false;
- return;
- }
- versionInfo.Init (repo);
- fileStatus [versionInfo.LocalPath] = versionInfo;
- }
+ {
+ try {
+ fileLock.EnterWriteLock ();
+
+ VersionInfo vi;
+ if (fileStatus.TryGetValue (versionInfo.LocalPath, out vi) && vi.Equals (versionInfo)) {
+ vi.RequiresRefresh = false;
+ return;
+ }
+ versionInfo.Init (repo);
+ fileStatus [versionInfo.LocalPath] = versionInfo;
+ } finally {
+ fileLock.ExitWriteLock ();
+ }
+
if (notify)
VersionControlService.NotifyFileStatusChanged (new FileUpdateEventArgs (repo, versionInfo.LocalPath, versionInfo.IsDirectory));
}
public void SetStatus (IEnumerable<VersionInfo> versionInfos)
{
- FileUpdateEventArgs args = null;
- lock (fileStatus) {
- foreach (var versionInfo in versionInfos) {
- VersionInfo vi;
- if (fileStatus.TryGetValue (versionInfo.LocalPath, out vi) && vi.Equals (versionInfo)) {
- vi.RequiresRefresh = false;
- continue;
- }
- versionInfo.Init (repo);
- fileStatus [versionInfo.LocalPath] = versionInfo;
- var a = new FileUpdateEventArgs (repo, versionInfo.LocalPath, versionInfo.IsDirectory);
- if (args == null)
- args = a;
- else
- args.MergeWith (a);
- }
+ FileUpdateEventArgs args = null;
+
+ try {
+ fileLock.EnterWriteLock ();
+ foreach (var versionInfo in versionInfos) {
+ VersionInfo vi;
+ if (fileStatus.TryGetValue (versionInfo.LocalPath, out vi) && vi.Equals (versionInfo)) {
+ vi.RequiresRefresh = false;
+ continue;
+ }
+ versionInfo.Init (repo);
+ fileStatus [versionInfo.LocalPath] = versionInfo;
+ var a = new FileUpdateEventArgs (repo, versionInfo.LocalPath, versionInfo.IsDirectory);
+ if (args == null)
+ args = a;
+ else
+ args.MergeWith (a);
+ }
+ } finally {
+ fileLock.ExitWriteLock ();
}
if (args != null) {
// Console.WriteLine ("Notifying Status " + string.Join (", ", args.Select (p => p.FilePath.FullPath)));
@@ -113,14 +141,16 @@ namespace MonoDevelop.VersionControl
}
public void SetDirectoryStatus (FilePath localDirectory, VersionInfo[] versionInfos, bool hasRemoteStatus)
- {
- lock (directoryStatus) {
+ {
+ try {
+ directoryLock.EnterWriteLock ();
+
DirectoryStatus vis;
if (directoryStatus.TryGetValue (localDirectory.CanonicalPath, out vis)) {
if (versionInfos.Length == vis.FileInfo.Length && (hasRemoteStatus == vis.HasRemoteStatus)) {
bool allEqual = true;
- for (int n=0; n<versionInfos.Length; n++) {
- if (!versionInfos[n].Equals (vis.FileInfo[n])) {
+ for (int n = 0; n < versionInfos.Length; n++) {
+ if (!versionInfos [n].Equals (vis.FileInfo [n])) {
allEqual = false;
break;
}
@@ -133,6 +163,8 @@ namespace MonoDevelop.VersionControl
}
directoryStatus [localDirectory.CanonicalPath] = new DirectoryStatus { FileInfo = versionInfos, HasRemoteStatus = hasRemoteStatus };
SetStatus (versionInfos);
+ } finally {
+ directoryLock.ExitWriteLock ();
}
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionStatus.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionStatus.cs
index 51194745dc..0ce9b6e497 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionStatus.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionStatus.cs
@@ -13,14 +13,14 @@ namespace MonoDevelop.VersionControl
LockOwned = 0x00000008, // File locked by the current user
Locked = 0x00000010, // File locked by another user
- Modified = 0x00000100,
- ScheduledAdd = 0x00000200,
- ScheduledDelete = 0x00000400,
- ScheduledReplace = 0x00000800,
- ScheduledIgnore = 0x00001000,
- Missing = 0x00002000,
- Conflicted = 0x00004000,
+ Modified = 0x00010000,
+ ScheduledAdd = 0x00020000,
+ ScheduledDelete = 0x00040000,
+ ScheduledReplace = 0x00080000,
+ ScheduledIgnore = 0x00100000,
+ Missing = 0x00200000,
+ Conflicted = 0x00400000,
- LocalChangesMask = 0x0000ff00,
+ LocalChangesMask = 0x3fff0000,
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/VersionControl.addin.xml b/main/src/addins/VersionControl/MonoDevelop.VersionControl/VersionControl.addin.xml
index e27a55f751..f366187d73 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/VersionControl.addin.xml
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/VersionControl.addin.xml
@@ -27,7 +27,7 @@
<ExtensionPoint path = "/MonoDevelop/VersionControl/DiffViewHandler" name = "Diff view handler">
<Description>Handler used to create the a diff view which can display the current file.</Description>
- <ExtensionNode name="Handler" objectType="MonoDevelop.VersionControl.IDiffViewHandler" />
+ <ExtensionNode name="Handler" objectType="MonoDevelop.VersionControl.IVersionControlViewHandler" />
</ExtensionPoint>
<Extension path = "/MonoDevelop/VersionControl/DiffViewHandler">
@@ -36,7 +36,7 @@
<ExtensionPoint path = "/MonoDevelop/VersionControl/BlameViewHandler" name = "Blame view handler">
<Description>Handler used to create the a blame view which can display the current file.</Description>
- <ExtensionNode name="Handler" objectType="MonoDevelop.VersionControl.IBlameViewHandler" />
+ <ExtensionNode name="Handler" objectType="MonoDevelop.VersionControl.IVersionControlViewHandler" />
</ExtensionPoint>
<Extension path = "/MonoDevelop/VersionControl/BlameViewHandler">
@@ -45,7 +45,7 @@
<ExtensionPoint path = "/MonoDevelop/VersionControl/LogViewHandler" name = "Log view handler">
<Description>Handler used to create the a log view which can display the current file.</Description>
- <ExtensionNode name="Handler" objectType="MonoDevelop.VersionControl.ILogViewHandler" />
+ <ExtensionNode name="Handler" objectType="MonoDevelop.VersionControl.IVersionControlViewHandler" />
</ExtensionPoint>
<Extension path = "/MonoDevelop/VersionControl/LogViewHandler">
@@ -54,7 +54,7 @@
<ExtensionPoint path = "/MonoDevelop/VersionControl/MergeViewHandler" name = "Merge view handler">
<Description>Handler used to create the a merge view which can display the current file.</Description>
- <ExtensionNode name="Handler" objectType="MonoDevelop.VersionControl.IMergeViewHandler" />
+ <ExtensionNode name="Handler" objectType="MonoDevelop.VersionControl.IVersionControlViewHandler" />
</ExtensionPoint>
<Extension path = "/MonoDevelop/VersionControl/MergeViewHandler">
@@ -101,7 +101,7 @@
<StockIcon stockid = "vc-branch" resource = "branch-16.png" size="Menu" />
<StockIcon stockid = "md-prefs-git" resource="prefs-git-16.png" size="Menu" />
<StockIcon stockid = "md-prefs-commit-message-style" resource="prefs-commit-message-style-16.png" size="Menu" />
- <StockIcon stockid = "md-prefs-version-control-general" resource="prefs-version-control-general-16.png" size="Menu" />
+ <StockIcon stockid = "md-prefs-version-control" resource="prefs-version-control-16.png" size="Menu" />
</Extension>
<Extension path = "/MonoDevelop/Ide/Commands">
@@ -142,15 +142,16 @@
description = "Shows the status of files in the solution."/>
<Command id = "MonoDevelop.VersionControl.Commands.Update"
_label = "_Update"
- icon = "vc-update"
+ icon = "gtk-refresh"
description = "Updates the local copy with remote changes."/>
<Command id = "MonoDevelop.VersionControl.Commands.UpdateSolution"
_label = "_Update Solution"
- icon = "vc-update"
+ icon = "gtk-refresh"
defaultHandler="MonoDevelop.VersionControl.UpdateCommandHandler"
description = "Updates the local copy with remote changes."/>
<Command id = "MonoDevelop.VersionControl.Commands.Publish"
- _label = "_Publish..."
+ _label = "_Publish in Version Control..."
+ icon = "vc-push"
description = "Publish actual project into repository."/>
<Command id = "MonoDevelop.VersionControl.Commands.Checkout"
defaultHandler = "MonoDevelop.VersionControl.CheckoutCommand"
@@ -189,6 +190,8 @@
_label = "_Show diff"/>
<Command id = "MonoDevelop.VersionControl.Views.BlameCommands.ShowLog"
_label = "S_how log"/>
+ <Command id = "MonoDevelop.VersionControl.Views.BlameCommands.ShowBlameBefore"
+ _label = "Show _blame before"/>
</Category>
</Extension>
@@ -283,13 +286,13 @@
</Extension> -->
<Extension path = "/MonoDevelop/ProjectModel/Gui/ItemOptionPanels">
- <Section id="VersionControl" _label="Version Control" icon="md-prefs-version-control-general">
+ <Section id="VersionControl" _label="Version Control" icon="md-prefs-version-control">
<Condition id="ItemType" value="Solution">
- <Section id="VersionControlGeneral" _label="General" fill="true" class="MonoDevelop.VersionControl.VersionControlSolutionOptionsPanel" icon="md-prefs-version-control-general" />
+ <Section id="VersionControlGeneral" _label="General" fill="true" class="MonoDevelop.VersionControl.VersionControlSolutionOptionsPanel" icon="md-prefs-version-control" />
</Condition>
<ComplexCondition>
<Or>
- <Condition id="ItemType" value="SolutionItem" />
+ <Condition id="ItemType" value="SolutionFolderItem" />
<Condition id="ItemType" value="Solution" />
</Or>
<Section id="VersionControlGeneral" _label="Commit Message Style" fill="true" class="MonoDevelop.VersionControl.VersionControlPolicyPanel" icon="md-prefs-commit-message-style" />
@@ -302,7 +305,7 @@
</Extension>
<Extension path = "/MonoDevelop/Ide/GlobalOptionsDialog/VersionControl">
- <Section id = "VersionControlGeneral" _label = "General" fill="true" class="MonoDevelop.VersionControl.VersionControlGeneralOptionsPanel" icon="md-prefs-version-control-general" />
+ <Section id = "VersionControlGeneral" _label = "General" fill="true" class="MonoDevelop.VersionControl.VersionControlGeneralOptionsPanel" icon="md-prefs-version-control" />
<Section id = "VersionControlGeneral" _label = "Commit Message Style" fill="true" class="MonoDevelop.VersionControl.VersionControlPolicyPanel" icon="md-prefs-commit-message-style" />
</Extension>
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.CommitMessageStylePanelWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.CommitMessageStylePanelWidget.cs
index f765c4e9e9..873bbe9f15 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.CommitMessageStylePanelWidget.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.CommitMessageStylePanelWidget.cs
@@ -1,4 +1,4 @@
-
+#pragma warning disable 436
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.VersionControl
{
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs
index d97345f236..cc5e04ca1b 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.CommitDialog.cs
@@ -1,4 +1,4 @@
-
+#pragma warning disable 436
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.VersionControl.Dialogs
{
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs
index befc847e87..69cf01405f 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.EditRepositoryDialog.cs
@@ -1,4 +1,4 @@
-
+#pragma warning disable 436
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.VersionControl.Dialogs
{
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs
index 18af9f6ecd..592f91bf45 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Dialogs.SelectRepositoryDialog.cs
@@ -1,4 +1,4 @@
-
+#pragma warning disable 436
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.VersionControl.Dialogs
{
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs
index 7af2e53b50..8726b24f84 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.UrlBasedRepositoryEditor.cs
@@ -1,4 +1,4 @@
-
+#pragma warning disable 436
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.VersionControl
{
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Views.DiffWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Views.DiffWidget.cs
index a4ef0ed6e1..c4582416e6 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Views.DiffWidget.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Views.DiffWidget.cs
@@ -1,4 +1,4 @@
-
+#pragma warning disable 436
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.VersionControl.Views
{
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Views.LogWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Views.LogWidget.cs
index f17ab223b8..6f886546c3 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Views.LogWidget.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/MonoDevelop.VersionControl.Views.LogWidget.cs
@@ -1,4 +1,4 @@
-
+#pragma warning disable 436
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.VersionControl.Views
{
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/generated.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/generated.cs
index 97249fd82d..fbb51be9e1 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/generated.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/gtk-gui/generated.cs
@@ -1,4 +1,4 @@
-
+#pragma warning disable 436
// This file has been generated by the GUI designer. Do not modify.
namespace Stetic
{
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16.png
index ee84ca2bff..b0282a5116 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16@2x.png
index 00e84c79e4..3b1a6168c0 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~dark.png
new file mode 100644
index 0000000000..39898d7c8b
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~dark@2x.png
new file mode 100644
index 0000000000..36be421550
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~dark~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~dark~sel.png
new file mode 100644
index 0000000000..1354c0d347
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~dark~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~dark~sel@2x.png
new file mode 100644
index 0000000000..87220cc9f7
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~sel.png
new file mode 100644
index 0000000000..1354c0d347
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~sel@2x.png
new file mode 100644
index 0000000000..87220cc9f7
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/added-overlay-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16.png
index a6a5b24cfe..e4f03a7d94 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16@2x.png
index a2bff92231..8112684192 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~dark.png
new file mode 100644
index 0000000000..3b09162c07
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~dark@2x.png
new file mode 100644
index 0000000000..f858d0b065
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~dark~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~dark~disabled.png
new file mode 100644
index 0000000000..28cc3be949
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~dark~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~dark~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..c07a5322af
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~disabled.png
new file mode 100644
index 0000000000..c0abf4d3b4
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~disabled@2x.png
new file mode 100644
index 0000000000..47c75de529
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/branch-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16.png
index 7c9ad146d5..a712539cae 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16@2x.png
index 0bf30e0162..8796e746ad 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~dark.png
new file mode 100644
index 0000000000..8159d32c75
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~dark@2x.png
new file mode 100644
index 0000000000..0c86f23baf
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~dark~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~dark~disabled.png
new file mode 100644
index 0000000000..70b522bc66
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~dark~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~dark~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..bf07f8869a
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~disabled.png
new file mode 100644
index 0000000000..f7fe199170
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~disabled@2x.png
new file mode 100644
index 0000000000..1b90a2488f
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/comment-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16.png
index ea93ecbbf3..6c791cdeb1 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16@2x.png
index 596dc19eb9..2b988ffddb 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~dark.png
new file mode 100644
index 0000000000..038ebeec71
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~dark@2x.png
new file mode 100644
index 0000000000..692770349b
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~dark~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~dark~disabled.png
new file mode 100644
index 0000000000..f37d0466e1
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~dark~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~dark~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..71b549aa00
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~disabled.png
new file mode 100644
index 0000000000..193ad8ba5e
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~disabled@2x.png
new file mode 100644
index 0000000000..4c15660c39
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/commit-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16.png
index 811e2a0807..ee06fb0f96 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16@2x.png
index 1313d23118..f58311a7d3 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~dark.png
new file mode 100644
index 0000000000..e8fdd3ea4b
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~dark@2x.png
new file mode 100644
index 0000000000..c558765b24
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~dark~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~dark~sel.png
new file mode 100644
index 0000000000..6c4aea5db9
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~dark~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~dark~sel@2x.png
new file mode 100644
index 0000000000..5405d0894b
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~sel.png
new file mode 100644
index 0000000000..6c4aea5db9
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~sel@2x.png
new file mode 100644
index 0000000000..5405d0894b
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/conflict-overlay-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16.png
index 153e4a59e3..93106a163c 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16@2x.png
index 73900ae4b8..712754bbc6 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~dark.png
new file mode 100644
index 0000000000..d927501998
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~dark@2x.png
new file mode 100644
index 0000000000..0ebb29b2b0
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~dark~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~dark~disabled.png
new file mode 100644
index 0000000000..a836939b3a
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~dark~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~dark~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..2b771279c6
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~disabled.png
new file mode 100644
index 0000000000..a9bb381c56
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~disabled@2x.png
new file mode 100644
index 0000000000..37187c79b4
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/diff-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/gutter-added-15.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/gutter-added-15.png
new file mode 100644
index 0000000000..5ac5d87af3
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/gutter-added-15.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/gutter-added-15@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/gutter-added-15@2x.png
new file mode 100644
index 0000000000..39f3e7d2d6
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/gutter-added-15@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/gutter-removed-15.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/gutter-removed-15.png
new file mode 100644
index 0000000000..2279ed2693
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/gutter-removed-15.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/gutter-removed-15@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/gutter-removed-15@2x.png
new file mode 100644
index 0000000000..28e7c8fea9
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/gutter-removed-15@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16.png
index 678286ba01..db1352c363 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16@2x.png
index 45c41e3955..b296629431 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~dark.png
new file mode 100644
index 0000000000..429e96550d
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~dark@2x.png
new file mode 100644
index 0000000000..bf73671e49
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~dark~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~dark~sel.png
new file mode 100644
index 0000000000..71493fb5bc
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~dark~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~dark~sel@2x.png
new file mode 100644
index 0000000000..01e54b5067
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~sel.png
new file mode 100644
index 0000000000..71493fb5bc
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~sel@2x.png
new file mode 100644
index 0000000000..01e54b5067
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/ignored-overlay-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/local-status-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/local-status-16.png
index b50e6fc982..c67564b1e9 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/local-status-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/local-status-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/local-status-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/local-status-16@2x.png
index bf9dd78174..0fe0d64f2b 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/local-status-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/local-status-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/local-status-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/local-status-16~dark.png
new file mode 100644
index 0000000000..0646c5d95d
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/local-status-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/local-status-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/local-status-16~dark@2x.png
new file mode 100644
index 0000000000..e9b3047748
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/local-status-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16.png
index d02df13681..1639184a97 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16@2x.png
index 0220289f5a..c000b5a601 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~dark.png
new file mode 100644
index 0000000000..eb74218112
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~dark@2x.png
new file mode 100644
index 0000000000..a2904102ab
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~dark~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~dark~sel.png
new file mode 100644
index 0000000000..270a770f6d
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~dark~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~dark~sel@2x.png
new file mode 100644
index 0000000000..295901e13a
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~sel.png
new file mode 100644
index 0000000000..270a770f6d
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~sel@2x.png
new file mode 100644
index 0000000000..295901e13a
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/lock-required-overlay-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16.png
index 50bb6b6b5a..77d809bb6e 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16@2x.png
index 2e1c3f6684..1b1d1a8e81 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~dark.png
new file mode 100644
index 0000000000..9086e1e394
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~dark@2x.png
new file mode 100644
index 0000000000..a99bbd3d96
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~dark~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~dark~sel.png
new file mode 100644
index 0000000000..270a770f6d
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~dark~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~dark~sel@2x.png
new file mode 100644
index 0000000000..295901e13a
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~sel.png
new file mode 100644
index 0000000000..270a770f6d
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~sel@2x.png
new file mode 100644
index 0000000000..295901e13a
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/locked-overlay-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/log-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/log-16.png
index 72d172e2ab..6430bfc5cc 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/log-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/log-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/log-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/log-16@2x.png
index aaa76142ef..d410cd0186 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/log-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/log-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/log-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/log-16~dark.png
new file mode 100644
index 0000000000..a57fdb3b34
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/log-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/log-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/log-16~dark@2x.png
new file mode 100644
index 0000000000..8c9e358815
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/log-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16.png
index 2b9cef04ab..0b882c75bd 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16@2x.png
index 7a10f5edd7..1f5971063a 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~dark.png
new file mode 100644
index 0000000000..13b4ff7023
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~dark@2x.png
new file mode 100644
index 0000000000..300f40d574
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~dark~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~dark~sel.png
new file mode 100644
index 0000000000..51037dde19
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~dark~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~dark~sel@2x.png
new file mode 100644
index 0000000000..6e39782056
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~sel.png
new file mode 100644
index 0000000000..51037dde19
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~sel@2x.png
new file mode 100644
index 0000000000..6e39782056
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/modified-overlay-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16.png
index ea93ecbbf3..be975275fe 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16@2x.png
index 596dc19eb9..3cc519561c 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~dark.png
new file mode 100644
index 0000000000..7f80ff7816
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~dark@2x.png
new file mode 100644
index 0000000000..6e309b1b99
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~dark~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~dark~sel.png
new file mode 100644
index 0000000000..a2d66f5373
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~dark~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~dark~sel@2x.png
new file mode 100644
index 0000000000..f6794fd248
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~sel.png
new file mode 100644
index 0000000000..a2d66f5373
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~sel@2x.png
new file mode 100644
index 0000000000..f6794fd248
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-commit-message-style-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16.png
index ac46bb38b3..983b855fa5 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16@2x.png
index d09e54f010..c3edbd18bd 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~dark.png
new file mode 100644
index 0000000000..420c104055
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~dark@2x.png
new file mode 100644
index 0000000000..380bb5acad
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~dark~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~dark~sel.png
new file mode 100644
index 0000000000..ffdbe46f50
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~dark~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~dark~sel@2x.png
new file mode 100644
index 0000000000..ad0f58cfcd
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~sel.png
new file mode 100644
index 0000000000..ffdbe46f50
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~sel@2x.png
new file mode 100644
index 0000000000..ad0f58cfcd
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-git-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16.png
new file mode 100644
index 0000000000..b60fcb3b6c
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16@2x.png
new file mode 100644
index 0000000000..d0d7949bf5
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~dark.png
new file mode 100644
index 0000000000..686e1d5a5d
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~dark@2x.png
new file mode 100644
index 0000000000..b6dc465573
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~dark~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~dark~sel.png
new file mode 100644
index 0000000000..c38408f189
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~dark~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~dark~sel@2x.png
new file mode 100644
index 0000000000..73a1032f31
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~sel.png
new file mode 100644
index 0000000000..c38408f189
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~sel@2x.png
new file mode 100644
index 0000000000..73a1032f31
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-general-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-general-16.png
deleted file mode 100644
index f50af22deb..0000000000
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-general-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-general-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-general-16@2x.png
deleted file mode 100644
index 230d65e12d..0000000000
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/prefs-version-control-general-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16.png
index 7024886a2a..4852ab9415 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16@2x.png
index ad50947884..2de4dc0ea7 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~dark.png
new file mode 100644
index 0000000000..d3e8fd7192
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~dark@2x.png
new file mode 100644
index 0000000000..7edbe04680
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~dark~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~dark~disabled.png
new file mode 100644
index 0000000000..fa8b5a2de8
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~dark~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~dark~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..3e10d25314
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~disabled.png
new file mode 100644
index 0000000000..304c16ebb3
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~disabled@2x.png
new file mode 100644
index 0000000000..5237a1aa9c
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/pull-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16.png
index ac46bb38b3..8f960c125c 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16@2x.png
index d09e54f010..3588d7b302 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~dark.png
new file mode 100644
index 0000000000..19afa14ba5
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~dark@2x.png
new file mode 100644
index 0000000000..cb0e3b4312
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~dark~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~dark~disabled.png
new file mode 100644
index 0000000000..3a4a660d09
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~dark~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~dark~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..b7b53642f9
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~disabled.png
new file mode 100644
index 0000000000..671e179f79
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~disabled@2x.png
new file mode 100644
index 0000000000..09a8f84eea
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/push-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16.png
index d63fa2fad8..d96792ba71 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16@2x.png
index 848a94e174..ae40f00576 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~dark.png
new file mode 100644
index 0000000000..9d8cd6f608
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~dark@2x.png
new file mode 100644
index 0000000000..916b709792
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~dark~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~dark~disabled.png
new file mode 100644
index 0000000000..481804372b
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~dark~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~dark~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..5fc8f1c032
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~disabled.png
new file mode 100644
index 0000000000..bb031de2a4
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~disabled@2x.png
new file mode 100644
index 0000000000..17612ee4d0
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/refresh-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16.png
index e362102a8c..b594ed2036 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16@2x.png
index c270cd23a5..0bda079f14 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~dark.png
new file mode 100644
index 0000000000..e2d93b2726
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~dark@2x.png
new file mode 100644
index 0000000000..e3ab8ba0f4
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~dark~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~dark~disabled.png
new file mode 100644
index 0000000000..0646c5d95d
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~dark~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~dark~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..e9b3047748
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~disabled.png
new file mode 100644
index 0000000000..c67564b1e9
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~disabled@2x.png
new file mode 100644
index 0000000000..0fe0d64f2b
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/remote-status-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16.png
index 8f41659d22..722b025a04 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16@2x.png
index 953e8105a4..5219842fbb 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~dark.png
new file mode 100644
index 0000000000..1d3b633832
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~dark@2x.png
new file mode 100644
index 0000000000..92da963c3e
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~dark~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~dark~sel.png
new file mode 100644
index 0000000000..ac12f9b138
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~dark~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~dark~sel@2x.png
new file mode 100644
index 0000000000..cc1bb463ba
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~sel.png
new file mode 100644
index 0000000000..ac12f9b138
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~sel@2x.png
new file mode 100644
index 0000000000..cc1bb463ba
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/removed-overlay-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16.png
index bc94eec59b..add30910df 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16@2x.png
index 140a16ffbd..6affd6dc2a 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~dark.png
new file mode 100644
index 0000000000..e49f5331ae
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~dark@2x.png
new file mode 100644
index 0000000000..686d859782
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~dark~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~dark~sel.png
new file mode 100644
index 0000000000..dd100f4cad
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~dark~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~dark~sel@2x.png
new file mode 100644
index 0000000000..89de779d21
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~sel.png
new file mode 100644
index 0000000000..dd100f4cad
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~sel@2x.png
new file mode 100644
index 0000000000..89de779d21
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/renamed-overlay-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/repository-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/repository-16.png
index f50af22deb..ab6673922c 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/repository-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/repository-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/repository-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/repository-16@2x.png
index 230d65e12d..2d38ea01e9 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/repository-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/repository-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/repository-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/repository-16~dark.png
new file mode 100644
index 0000000000..5aa99bf942
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/repository-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/repository-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/repository-16~dark@2x.png
new file mode 100644
index 0000000000..4b50c0b458
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/repository-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16.png
index e08803d985..a67e18840a 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16@2x.png
index d9155f2685..7faee37ac9 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~dark.png
new file mode 100644
index 0000000000..e990f97de7
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~dark@2x.png
new file mode 100644
index 0000000000..fbaadddd44
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~dark~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~dark~disabled.png
new file mode 100644
index 0000000000..c453434fcc
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~dark~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~dark~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..ef172c44f8
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~disabled.png
new file mode 100644
index 0000000000..261a85670d
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~disabled@2x.png
new file mode 100644
index 0000000000..af3cffa5b8
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/revert-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16.png
index 5ed5e35bfb..73f83946d1 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16@2x.png
index 4de708587a..ebddd28d29 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~dark.png
new file mode 100644
index 0000000000..f54b303abe
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~dark@2x.png
new file mode 100644
index 0000000000..0501df6f37
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~dark~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~dark~disabled.png
new file mode 100644
index 0000000000..470e3b93f6
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~dark~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~dark~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..242f33a64e
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~disabled.png
new file mode 100644
index 0000000000..c722a41deb
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~disabled@2x.png
new file mode 100644
index 0000000000..b7922e78c3
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/tag-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16.png
index 3d2ff49956..a4080a07ee 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16@2x.png
index 14fb4b8bc1..1375a972dd 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~dark.png
new file mode 100644
index 0000000000..58fb9c2aa2
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~dark@2x.png
new file mode 100644
index 0000000000..a1a51e3873
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~dark~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~dark~sel.png
new file mode 100644
index 0000000000..270a770f6d
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~dark~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~dark~sel@2x.png
new file mode 100644
index 0000000000..295901e13a
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~sel.png
new file mode 100644
index 0000000000..270a770f6d
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~sel@2x.png
new file mode 100644
index 0000000000..295901e13a
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unlocked-overlay-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16.png
index aff6b9a6e9..8d4f6d8043 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16@2x.png
index 909a0fb128..61e207f732 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~dark.png
new file mode 100644
index 0000000000..8ecd048ea8
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~dark@2x.png
new file mode 100644
index 0000000000..30725a7fdf
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~dark~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~dark~sel.png
new file mode 100644
index 0000000000..2a2a261025
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~dark~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~dark~sel@2x.png
new file mode 100644
index 0000000000..d6df229d20
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~sel.png
new file mode 100644
index 0000000000..2a2a261025
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~sel@2x.png
new file mode 100644
index 0000000000..d6df229d20
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/unversioned-overlay-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16.png
index 1a0db8de4b..d871330d2a 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16@2x.png
index 67682b1ed1..cd7d92c9d7 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~dark.png
new file mode 100644
index 0000000000..66f4acf693
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~dark@2x.png
new file mode 100644
index 0000000000..a13fc89a90
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~dark~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~dark~disabled.png
new file mode 100644
index 0000000000..960f061f3a
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~dark~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~dark~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..517c9ccf8b
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~disabled.png
new file mode 100644
index 0000000000..3b52fc0336
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~disabled@2x.png
new file mode 100644
index 0000000000..8bf165d341
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-added-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16.png
index d92f477577..dd8b51440a 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16@2x.png
index a8ddfe5c84..56d1e330b6 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~dark.png
new file mode 100644
index 0000000000..1fa4e5f56b
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~dark@2x.png
new file mode 100644
index 0000000000..b1365ca79d
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~dark~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~dark~disabled.png
new file mode 100644
index 0000000000..9a05d84334
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~dark~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~dark~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..e5c1018897
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~disabled.png
new file mode 100644
index 0000000000..1b44deecd3
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~disabled@2x.png
new file mode 100644
index 0000000000..2a52a64f36
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-conflicted-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16.png
index 06271b21e1..81fae65eba 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16@2x.png
index 3f38ee7639..09e1bb2559 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~dark.png
new file mode 100644
index 0000000000..afc6cf1484
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~dark@2x.png
new file mode 100644
index 0000000000..085685f4de
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~dark~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~dark~disabled.png
new file mode 100644
index 0000000000..badde350c3
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~dark~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~dark~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..1e13a3819b
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~disabled.png
new file mode 100644
index 0000000000..ef7a5f8e77
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~disabled@2x.png
new file mode 100644
index 0000000000..18ffb68fc0
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-modified-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16.png
index d33e4da129..0e24d32859 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16@2x.png
index e29f3370cd..448750e2bd 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~dark.png
new file mode 100644
index 0000000000..f7dd8c449a
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~dark@2x.png
new file mode 100644
index 0000000000..0f7ec817d3
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~dark~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~dark~disabled.png
new file mode 100644
index 0000000000..338b1cbb6b
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~dark~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~dark~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..5669ace2df
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~disabled.png
new file mode 100644
index 0000000000..47ebff636e
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~disabled@2x.png
new file mode 100644
index 0000000000..1b977c1f0c
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-removed-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16.png
index 21c19491cc..26024d2577 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16@2x.png
index f39392b154..a814eac25d 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~dark.png
new file mode 100644
index 0000000000..7d50904383
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~dark@2x.png
new file mode 100644
index 0000000000..d7dd1ac722
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~dark~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~dark~disabled.png
new file mode 100644
index 0000000000..5f499cc257
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~dark~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~dark~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..69d3b00c69
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~disabled.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~disabled.png
new file mode 100644
index 0000000000..36e9c036e7
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~disabled.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~disabled@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~disabled@2x.png
new file mode 100644
index 0000000000..310ea81248
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/vcs-renamed-16~disabled@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/version-control-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/version-control-16.png
index b084d922fb..b60fcb3b6c 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/version-control-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/version-control-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/version-control-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/version-control-16@2x.png
index 2b5ba106e6..d0d7949bf5 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/version-control-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/version-control-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/version-control-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/version-control-16~dark.png
new file mode 100644
index 0000000000..686e1d5a5d
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/version-control-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/version-control-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/version-control-16~dark@2x.png
new file mode 100644
index 0000000000..b6dc465573
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/version-control-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16.png
index eccbc51b8a..2cd0be132a 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16@2x.png
index ff97459f65..9c5c7b2723 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16@2x.png
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~dark.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~dark.png
new file mode 100644
index 0000000000..947968e2f4
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~dark.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~dark@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~dark@2x.png
new file mode 100644
index 0000000000..0b2c310fd0
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~dark~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~dark~sel.png
new file mode 100644
index 0000000000..2a2a261025
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~dark~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~dark~sel@2x.png
new file mode 100644
index 0000000000..d6df229d20
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~sel.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~sel.png
new file mode 100644
index 0000000000..2a2a261025
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~sel.png
Binary files differ
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~sel@2x.png b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~sel@2x.png
new file mode 100644
index 0000000000..d6df229d20
--- /dev/null
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/icons/versioned-overlay-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/VersionControl/Subversion.Win32/SvnSharpClient.cs b/main/src/addins/VersionControl/Subversion.Win32/SvnSharpClient.cs
index 009341e6e9..5633892e23 100644
--- a/main/src/addins/VersionControl/Subversion.Win32/SvnSharpClient.cs
+++ b/main/src/addins/VersionControl/Subversion.Win32/SvnSharpClient.cs
@@ -17,14 +17,29 @@ namespace SubversionAddinWindows
sealed class SvnSharpClient: SubversionVersionControl
{
static bool errorShown;
+ static bool initialized;
static bool installError {
- get { return client.Value == null; }
+ get {
+ if (initialized)
+ return !client.IsValueCreated;
+
+ try {
+ initialized = true;
+
+ // Intended.
+ var dummy = client.Value;
+ } catch (Exception e) {
+ LoggingService.LogError ("SVN client could not be initialized", e);
+ return true;
+ }
+ return false;
+ }
}
- static readonly internal Lazy<SvnClient> client;
+ static readonly internal Lazy<object> client;
static SvnSharpClient ()
{
- client = new Lazy<SvnClient> (CheckInstalled);
+ client = new Lazy<object> (CheckInstalled);
}
public override string Version {
@@ -33,7 +48,7 @@ namespace SubversionAddinWindows
}
}
- static SvnClient CheckInstalled ()
+ static object CheckInstalled ()
{
try {
return new SvnClient ();
@@ -54,10 +69,15 @@ namespace SubversionAddinWindows
{
if (!errorShown && installError) {
errorShown = true;
- var db = new AlertButton ("Go to Download Page");
- AlertButton res = MessageService.AskQuestion ("The Subversion add-in could not be initialized", "This add-in requires the 'Microsoft Visual C++ 2005 Service Pack 1 Redistributable'. You may need to install it.", db, AlertButton.Ok);
+ var db = new AlertButton (GettextCatalog.GetString ("Go to Download Page"));
+ AlertButton res = MessageService.AskQuestion (
+ GettextCatalog.GetString ("The Subversion add-in could not be initialized"),
+ GettextCatalog.GetString ("This add-in requires the 'Microsoft Visual C++ 2010 Redistributable'. You may need to install it."),
+ db,
+ AlertButton.Ok);
+
if (res == db) {
- DesktopService.ShowUrl ("http://www.microsoft.com/downloads/details.aspx?familyid=766a6af7-ec73-40ff-b072-9112bab119c2");
+ DesktopService.ShowUrl ("https://www.microsoft.com/en-us/download/details.aspx?id=5555");
}
}
return !installError;
@@ -68,8 +88,11 @@ namespace SubversionAddinWindows
{
string wc_path;
try {
+ if (client.Value == null)
+ return string.Empty;
+
lock (client.Value)
- wc_path = client.Value.GetWorkingCopyRoot (path.FullPath);
+ wc_path = ((SvnClient)client.Value).GetWorkingCopyRoot (path.FullPath);
return wc_path;
} catch (SvnException e) {
switch (e.SvnErrorCode) {
@@ -85,10 +108,10 @@ namespace SubversionAddinWindows
sealed class SvnSharpBackend: SubversionBackend
{
static SvnClient client {
- get { return SvnSharpClient.client.Value; }
+ get { return (SvnClient)SvnSharpClient.client.Value; }
}
- IProgressMonitor updateMonitor;
+ ProgressMonitor updateMonitor;
NotifData notifyData;
ProgressData progressData;
@@ -145,7 +168,7 @@ namespace SubversionAddinWindows
if (updateMonitor == null)
return;
- a.Cancel = updateMonitor.IsCancelRequested;
+ a.Cancel = updateMonitor.CancellationToken.IsCancellationRequested;
};
}
@@ -207,7 +230,7 @@ namespace SubversionAddinWindows
e.CertificateFile = file;
}
- public override void Add (FilePath path, bool recurse, IProgressMonitor monitor)
+ public override void Add (FilePath path, bool recurse, ProgressMonitor monitor)
{
var args = new SvnAddArgs {
Depth = recurse ? SvnDepth.Infinity : SvnDepth.Empty,
@@ -218,7 +241,7 @@ namespace SubversionAddinWindows
client.Add (path, args);
}
- public override void Checkout (string url, FilePath path, Revision rev, bool recurse, IProgressMonitor monitor)
+ public override void Checkout (string url, FilePath path, Revision rev, bool recurse, ProgressMonitor monitor)
{
var args = new SvnCheckOutArgs {
Depth = recurse ? SvnDepth.Infinity : SvnDepth.Empty,
@@ -234,7 +257,7 @@ namespace SubversionAddinWindows
}
}
- public override void Commit (FilePath[] paths, string message, IProgressMonitor monitor)
+ public override void Commit (FilePath[] paths, string message, ProgressMonitor monitor)
{
var args = new SvnCommitArgs {
LogMessage = message,
@@ -244,7 +267,7 @@ namespace SubversionAddinWindows
client.Commit (paths.ToStringArray (), args);
}
- public override void Delete (FilePath path, bool force, IProgressMonitor monitor)
+ public override void Delete (FilePath path, bool force, ProgressMonitor monitor)
{
var args = new SvnDeleteArgs {
Force = force,
@@ -349,7 +372,7 @@ namespace SubversionAddinWindows
return RevisionAction.Other;
}
- public override void Mkdir (string[] paths, string message, IProgressMonitor monitor)
+ public override void Mkdir (string[] paths, string message, ProgressMonitor monitor)
{
var args = new SvnCreateDirectoryArgs {
CreateParents = true,
@@ -361,7 +384,7 @@ namespace SubversionAddinWindows
client.RemoteCreateDirectories (uris, args);
}
- public override void Move (FilePath srcPath, FilePath destPath, SvnRevision rev, bool force, IProgressMonitor monitor)
+ public override void Move (FilePath srcPath, FilePath destPath, SvnRevision rev, bool force, ProgressMonitor monitor)
{
var args = new SvnMoveArgs {
Force = force,
@@ -388,7 +411,7 @@ namespace SubversionAddinWindows
}
}
- public override void Revert (FilePath[] paths, bool recurse, IProgressMonitor monitor)
+ public override void Revert (FilePath[] paths, bool recurse, ProgressMonitor monitor)
{
var args = new SvnRevertArgs {
Depth = recurse ? SvnDepth.Infinity : SvnDepth.Children,
@@ -398,7 +421,7 @@ namespace SubversionAddinWindows
client.Revert (paths.ToStringArray (), args);
}
- public override void RevertRevision (FilePath path, Revision revision, IProgressMonitor monitor)
+ public override void RevertRevision (FilePath path, Revision revision, ProgressMonitor monitor)
{
var args = new SvnMergeArgs ();
BindMonitor (monitor);
@@ -408,7 +431,7 @@ namespace SubversionAddinWindows
client.Merge (path, new SvnPathTarget (path), range, args);
}
- public override void RevertToRevision (FilePath path, Revision revision, IProgressMonitor monitor)
+ public override void RevertToRevision (FilePath path, Revision revision, ProgressMonitor monitor)
{
var args = new SvnMergeArgs ();
BindMonitor (monitor);
@@ -457,7 +480,7 @@ namespace SubversionAddinWindows
if (ent.IsRemoteUpdated) {
rs = ConvertStatus (SvnSchedule.Normal, ent.RemoteContentStatus);
rr = new SvnRevision (repo, (int) ent.RemoteUpdateRevision, ent.RemoteUpdateCommitTime,
- ent.RemoteUpdateCommitAuthor, "(unavailable)", null);
+ ent.RemoteUpdateCommitAuthor, GettextCatalog.GetString ("(unavailable)"), null);
}
VersionStatus status = ConvertStatus (SvnSchedule.Normal, ent.LocalContentStatus);
@@ -511,7 +534,7 @@ namespace SubversionAddinWindows
return VersionStatus.Unversioned;
}
- public override void Lock (IProgressMonitor monitor, string comment, bool stealLock, params FilePath[] paths)
+ public override void Lock (ProgressMonitor monitor, string comment, bool stealLock, params FilePath[] paths)
{
var args = new SvnLockArgs {
Comment = comment,
@@ -522,7 +545,7 @@ namespace SubversionAddinWindows
client.Lock (paths.ToStringArray (), args);
}
- public override void Unlock (IProgressMonitor monitor, bool breakLock, params FilePath[] paths)
+ public override void Unlock (ProgressMonitor monitor, bool breakLock, params FilePath[] paths)
{
var args = new SvnUnlockArgs {
BreakLock = breakLock,
@@ -532,7 +555,7 @@ namespace SubversionAddinWindows
client.Unlock (paths.ToStringArray (), args);
}
- public override void Update (FilePath path, bool recurse, IProgressMonitor monitor)
+ public override void Update (FilePath path, bool recurse, ProgressMonitor monitor)
{
var args = new SvnUpdateArgs {
Depth = recurse ? SvnDepth.Infinity : SvnDepth.Children,
@@ -600,7 +623,7 @@ namespace SubversionAddinWindows
var annotations = new Annotation [numAnnotations];
foreach (var annotation in list) {
if (annotation.LineNumber < annotations.Length)
- annotations [(int)annotation.LineNumber] = new Annotation (annotation.Revision.ToString (),
+ annotations [(int)annotation.LineNumber] = new Annotation (new SvnRevision(repo, (int)annotation.Revision),
annotation.Author, annotation.Time);
}
return annotations;
@@ -658,7 +681,7 @@ namespace SubversionAddinWindows
public int Seconds;
}
- void BindMonitor (IProgressMonitor monitor)
+ void BindMonitor (ProgressMonitor monitor)
{
notifyData = new NotifData ();
progressData = new ProgressData ();
@@ -673,7 +696,7 @@ namespace SubversionAddinWindows
return String.Format ("{0:0.00} MBytes", kbytes / 1024.0);
}
- static void ProgressWork (SvnProgressEventArgs e, ProgressData data, IProgressMonitor monitor)
+ static void ProgressWork (SvnProgressEventArgs e, ProgressData data, ProgressMonitor monitor)
{
if (monitor == null)
return;
@@ -705,12 +728,12 @@ namespace SubversionAddinWindows
data.LogTimer.Interval = 1000;
data.LogTimer.Elapsed += delegate {
data.Seconds += 1;
- monitor.Log.WriteLine ("Transferred {0} in {1} seconds.", BytesToSize (data.KBytes), data.Seconds);
+ monitor.Log.WriteLine (GettextCatalog.GetString ("Transferred {0} in {1} seconds."), BytesToSize (data.KBytes), data.Seconds);
};
data.LogTimer.Start ();
}
- static void Notify (SvnNotifyEventArgs e, NotifData notifData, IProgressMonitor monitor)
+ static void Notify (SvnNotifyEventArgs e, NotifData notifData, ProgressMonitor monitor)
{
string actiondesc;
string file = e.Path;
diff --git a/main/src/addins/WindowsPlatform/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialog.cs b/main/src/addins/WindowsPlatform/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialog.cs
index 8d418ac4c6..3cb8d2ddeb 100644
--- a/main/src/addins/WindowsPlatform/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialog.cs
+++ b/main/src/addins/WindowsPlatform/WindowsAPICodePack/Shell/CommonFileDialogs/CommonFileDialog.cs
@@ -638,6 +638,8 @@ namespace Microsoft.WindowsAPICodePack.Dialogs
PopulateWithIShellItems(items);
}
+ CleanupEventSink();
+
return result;
}
/// <summary>
@@ -675,6 +677,15 @@ namespace Microsoft.WindowsAPICodePack.Dialogs
}
}
+ private void CleanupEventSink()
+ {
+ if (nativeEventSink != null)
+ {
+ nativeDialog.Unadvise(nativeEventSink.Cookie);
+ nativeEventSink = null;
+ }
+ }
+
private void ApplyNativeSettings(IFileDialog dialog)
{
Debug.Assert(dialog != null, "No dialog instance to configure");
diff --git a/main/src/addins/WindowsPlatform/WindowsAPICodePack/Shell/PropertySystem/ShellProperty.cs b/main/src/addins/WindowsPlatform/WindowsAPICodePack/Shell/PropertySystem/ShellProperty.cs
index ef4167876c..93650334e4 100644
--- a/main/src/addins/WindowsPlatform/WindowsAPICodePack/Shell/PropertySystem/ShellProperty.cs
+++ b/main/src/addins/WindowsPlatform/WindowsAPICodePack/Shell/PropertySystem/ShellProperty.cs
@@ -195,14 +195,15 @@ namespace Microsoft.WindowsAPICodePack.Shell.PropertySystem
// Make sure we use the correct type
Debug.Assert(ValueType == ShellPropertyFactory.VarEnumToSystemType(Description.VarEnumType));
- if (typeof(T) != ValueType)
+ var type = typeof(T);
+ if (type != ValueType)
{
throw new NotSupportedException(
string.Format(System.Globalization.CultureInfo.InvariantCulture,
LocalizedMessages.ShellPropertyWrongType, ValueType.Name));
}
- if (value is Nullable)
+ if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))
{
Type t = typeof(T);
PropertyInfo pi = t.GetProperty("HasValue");
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/ChangeLog b/main/src/addins/WindowsPlatform/WindowsPlatform/ChangeLog
deleted file mode 100644
index 909021cd2c..0000000000
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/ChangeLog
+++ /dev/null
@@ -1,182 +0,0 @@
-2010-05-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * SelectFileDialogHandler.cs: Fix build.
-
-2010-05-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddFileDialogHandler.cs:
- * SelectFileDialogHandler.cs: Track api changes.
-
-2010-05-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * WindowsPlatform.cs: Fixed Bug 606364 - Cannot execute
- program in external console.
-
-2010-05-04 Jonathan Pobst <monkey@jpobst.com>
-
- * WindowsPlatform.cs: Respect the workingDirectory parameter
- in StartConsoleProcess.
-
-2010-04-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * WindowsPlatform.cs: Fix build.
-
-2010-04-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * WindowsPlatform.cs: Track StartConsoleProcess API.
-
-2010-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * WindowsPlatform.cs: External console processes are now
- wrapped by a IProcessAsyncOperation interface, instead of a
- Process instance. In this way it is possible to create
- external consoles which are not directly bound to a process.
-
-2010-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * WindowsPlatform.cs: Quote the command.
-
-2010-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * WindowsPlatform.cs: Add support for external consoles using
- cmd.exe.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * WindowsPlatform.addin.xml: Bumped MD version.
-
-2010-03-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * WindowsPlatform.addin.xml: Remove old add-in.
-
-2010-03-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Win32.cs:
- * Enums.cs:
- * structs.cs:
- * WinFormsRoot.cs:
- * WindowsPlatform.cs:
- * OpenFileDialogEx.cs:
- * OpenFileDialogEx.resx:
- * WindowsPlatform.csproj:
- * CustomAddFilesDialog.cs:
- * AddFileDialogHandler.cs:
- * WindowsPlatform.addin.xml:
- * CustomAddFilesDialog.resx:
- * SelectFileDialogHandler.cs:
- * OpenFileDialogEx.Designer.cs:
- * CustomAddFilesDialog.Designer.cs: Initial implementation of
- native dialogs for file open operations. Not yet enabled.
- Fixed build.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * WindowsPlatform.csproj: Remove import off mono.addins
- targets.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Win32.cs:
- * WindowsPlatform.cs:
- * WindowsPlatform.csproj:
- * WindowsPlatform.addin.xml: Merged MD.Projects into MD.Core,
- and MD.Projects.Gui, MD.Core.Gui and MD.Components into
- MD.Ide.
-
-2009-12-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * WindowsPlatform.cs: Don't return an invalid application from
- GetAllApplications. Fixes "Bug 552403 - Right clicking Open
- With -> List of programs to open with on a file results in
- an exception".
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * WindowsPlatform.addin.xml: Bump MD version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * WindowsPlatform.csproj: Flush.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * WindowsPlatform.addin.xml: Bump MD version.
-
-2009-09-24 Mike Krüger <mkrueger@novell.com>
-
- * WindowsPlatform.cs: Fixed 'Bug 541610 - MonoDevelop 2.2 beta
- 1 can't display Chinese text'.
-
-2009-08-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * WindowsPlatform.cs: Add a default implementation of
- GetMimeTypeDescription.
-
-2009-05-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * WindowsPlatform.cs: Don't crash if icon for a file can't be
- found.
-
- * Win32.cs: Some win32 api.
-
-2009-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * WindowsPlatform.cs:
- * WindowsPlatform.csproj: Implemented mime type and file icon
- support.
-
-2009-04-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * WindowsPlatform.cs: New overrides.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * WindowsPlatform.addin.xml: Bump MD version.
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * WindowsPlatform.csproj: Flush.
-
-2009-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * WindowsPlatform.csproj: Remove more inadvertent local
- copying of references.
-
-2009-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * WindowsPlatform.csproj: Add project file for WindowsPlatform
- addin.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Make it work for parallel build.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * AssemblyInfo.cs: Add AssemblyInfo.cs files that are autogenerated from
- the addin manifests.
-
-2008-11-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Fix build dependencies.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * WindowsPlatform.addin.xml: Bump MD version.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * WindowsPlatform.addin.xml: Bump MD version.
-
-2008-04-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * WindowsPlatform.cs: Track api changes.
-
-2008-03-11 Jonathan Pobst <monkey@jpobst.com>
-
- * WindowsPlatform.cs: Initial version.
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/CommonFileDialogExtensions.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/CommonFileDialogExtensions.cs
index 71cbbdc966..bbb3c798d4 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/CommonFileDialogExtensions.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/CommonFileDialogExtensions.cs
@@ -55,7 +55,7 @@ namespace MonoDevelop.Platform
var fileDialog = dialog as CommonOpenFileDialog;
if (fileDialog != null) {
fileDialog.Multiselect = data.SelectMultiple;
- if (data.Action == FileChooserAction.SelectFolder) {
+ if ((data.Action & FileChooserAction.SelectFolder) != 0) {
fileDialog.IsFolderPicker = true;
return;
}
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/OpenFileDialogHandler.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/OpenFileDialogHandler.cs
index de8c74197f..df890a1a99 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/OpenFileDialogHandler.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/OpenFileDialogHandler.cs
@@ -230,21 +230,48 @@ namespace MonoDevelop.Platform
return false;
}
+ int selected = -1;
+ int i = 0;
bool hasBench = false;
var projectService = IdeApp.Services.ProjectService;
if (projectService.IsWorkspaceItemFile (fileName) || projectService.IsSolutionItemFile (fileName)) {
hasBench = true;
combo.Items.Add (new ViewerComboItem (null, GettextCatalog.GetString ("Solution Workbench")));
+ if (!CanBeOpenedInAssemblyBrowser (fileName))
+ selected = 0;
+ i++;
}
foreach (var vw in DisplayBindingService.GetFileViewers (fileName, null))
- if (!vw.IsExternal)
+ if (!vw.IsExternal) {
combo.Items.Add (new ViewerComboItem (vw, vw.Title));
+ if (vw.CanUseAsDefault && selected == -1)
+ selected = i;
+
+ i++;
+ }
+
+ if (selected == -1)
+ selected = 0;
+
combo.Enabled = combo.Items.Count >= 1;
+ if (selected > 0) {
+ // Unable to set SelectedIndex until ApplyControlPropertyChange called for Items
+ // which causes the combo box selection to visibly change selection twice. Instead just
+ // make the default item the first one in the combo.
+ var item = combo.Items[selected];
+ combo.Items.RemoveAt (selected);
+ combo.Items.Insert (0, item);
+ }
return hasBench;
}
+ static bool CanBeOpenedInAssemblyBrowser (FilePath filename)
+ {
+ return filename.Extension.ToLower () == ".exe" || filename.Extension.ToLower () == ".dll";
+ }
+
class ViewerComboItem : CommonFileDialogComboBoxItem
{
public ViewerComboItem (FileViewer viewer, string label) : base (label)
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/GdkWin32.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/GdkWin32.cs
index 6c02e62578..5b595b007b 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/GdkWin32.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/GdkWin32.cs
@@ -58,6 +58,12 @@ namespace MonoDevelop.Platform
[DllImport (Win32.USER32, SetLastError=true, CharSet=CharSet.Auto)]
static extern uint RegisterWindowMessage (string lpString);
+ public static IntPtr HgdiobjGet (MonoDevelop.Components.Window window)
+ {
+ Gtk.Window gtkWindow = window;
+ return HgdiobjGet (gtkWindow.GdkWindow);
+ }
+
public static IntPtr HgdiobjGet (Gdk.Drawable drawable)
{
return gdk_win32_drawable_get_handle (drawable.Handle);
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/ImageBox.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/ImageBox.cs
new file mode 100644
index 0000000000..a29c561545
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/ImageBox.cs
@@ -0,0 +1,167 @@
+//
+// ImageBox.cs
+//
+// Author:
+// Vsevolod Kukol <sevo@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Windows;
+using Xwt.Drawing;
+using System.Windows.Media;
+using System.Windows.Controls;
+
+namespace WindowsPlatform
+{
+ public class ImageBox : UserControl
+ {
+ public static readonly DependencyProperty ImageProperty =
+ DependencyProperty.Register ("Image", typeof (Xwt.Drawing.Image), typeof (ImageBox), new FrameworkPropertyMetadata () { AffectsMeasure = true, AffectsRender = true });
+
+ public static readonly DependencyProperty StretchProperty =
+ Viewbox.StretchProperty.AddOwner(typeof(ImageBox));
+
+ public static readonly DependencyProperty StretchDirectionProperty =
+ Viewbox.StretchDirectionProperty.AddOwner(typeof(ImageBox));
+
+ public ImageBox ()
+ {
+ Image = null;
+ Loaded += (sender, e) => MonoDevelop.Ide.Gui.Styles.Changed += HandleStylesChanged;
+ Unloaded += (sender, e) => MonoDevelop.Ide.Gui.Styles.Changed -= HandleStylesChanged;
+ }
+
+ public ImageBox (Xwt.Drawing.Image image) : this ()
+ {
+ Image = image;
+ }
+
+ public ImageBox (string iconId, Gtk.IconSize size) : this ()
+ {
+ Image = MonoDevelop.Ide.ImageService.GetIcon (iconId, size);
+ }
+
+ void HandleStylesChanged (object sender, EventArgs e)
+ {
+ InvalidateVisual ();
+ }
+
+ protected override void OnRender (DrawingContext dc)
+ {
+ var image = Image;
+ if (image != null) {
+ if (!IsEnabled)
+ image = image.WithStyles ("disabled").WithAlpha (0.4);
+ image = image.WithBoxSize (RenderSize.Width, RenderSize.Height);
+ var x = (RenderSize.Width - image.Size.Width) / 2;
+ var y = (RenderSize.Height - image.Size.Height) / 2;
+ MonoDevelop.Platform.WindowsPlatform.WPFToolkit.RenderImage (this, dc, image, x, y);
+ }
+ }
+
+ protected override void OnPropertyChanged (DependencyPropertyChangedEventArgs e)
+ {
+ base.OnPropertyChanged (e);
+ if (e.Property == IsEnabledProperty)
+ InvalidateVisual ();
+ }
+
+ public Xwt.Drawing.Image Image
+ {
+ get { return (Xwt.Drawing.Image)GetValue (ImageProperty); }
+ set { SetValue (ImageProperty, value); }
+ }
+
+ public Stretch Stretch
+ {
+ get { return (Stretch) GetValue(StretchProperty); }
+ set { SetValue(StretchProperty, value); }
+ }
+
+ public StretchDirection StretchDirection
+ {
+ get { return (StretchDirection)GetValue(StretchDirectionProperty); }
+ set { SetValue(StretchDirectionProperty, value); }
+ }
+
+ protected override Size MeasureOverride (Size constraint)
+ {
+ return CalcSizeForBounds (constraint);
+ }
+
+ protected override Size ArrangeOverride (Size arrangeBounds)
+ {
+ return CalcSizeForBounds (arrangeBounds);
+ }
+
+ Size CalcSizeForBounds (Size availableSize)
+ {
+ if (Image == null)
+ return new Size (0, 0);
+
+ double scaleX = 1.0;
+ double scaleY = 1.0;
+
+ bool isConstrainedWidth = !Double.IsPositiveInfinity(availableSize.Width);
+ bool isConstrainedHeight = !Double.IsPositiveInfinity(availableSize.Height);
+
+ if ((Stretch == Stretch.Uniform || Stretch == Stretch.UniformToFill || Stretch == Stretch.Fill)
+ && (isConstrainedWidth || isConstrainedHeight) )
+ {
+ scaleX = availableSize.Width / Image.Size.Width;
+ scaleY = availableSize.Height / Image.Size.Height;
+
+ if (!isConstrainedWidth)
+ scaleX = scaleY;
+ else if (!isConstrainedHeight)
+ scaleY = scaleX;
+ else switch (Stretch)
+ {
+ case Stretch.Uniform:
+ double minscale = scaleX < scaleY ? scaleX : scaleY;
+ scaleX = scaleY = minscale;
+ break;
+
+ case Stretch.UniformToFill:
+ double maxscale = scaleX > scaleY ? scaleX : scaleY;
+ scaleX = scaleY = maxscale;
+ break;
+ }
+
+ switch(StretchDirection)
+ {
+ case StretchDirection.UpOnly:
+ if (scaleX < 1.0) scaleX = 1.0;
+ if (scaleY < 1.0) scaleY = 1.0;
+ break;
+
+ case StretchDirection.DownOnly:
+ if (scaleX > 1.0) scaleX = 1.0;
+ if (scaleY > 1.0) scaleY = 1.0;
+ break;
+ }
+ }
+
+ return new Size(Image.Size.Width * scaleX, Image.Size.Height * scaleY);
+ }
+ }
+}
+
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/ImageHelper.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/ImageHelper.cs
new file mode 100644
index 0000000000..7ef98b6236
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/ImageHelper.cs
@@ -0,0 +1,76 @@
+//
+// ImageHelper.cs
+//
+// Author:
+// Vsevolod Kukol <sevo@sevo.org>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Windows.Media;
+using MonoDevelop.Core;
+using MonoDevelop.Ide;
+using Xwt.Drawing;
+
+namespace WindowsPlatform
+{
+ public static class ImageHelper
+ {
+ static Dictionary<string, Image> cachedIcons = new Dictionary<string, Image> ();
+
+ public static Image GetStockIcon (this IconId stockId)
+ {
+ if (stockId.IsNull)
+ return null;
+ Image image;
+ if (!cachedIcons.TryGetValue (stockId, out image)) {
+ try {
+ image = Image.FromResource (typeof (ImageHelper), stockId + ".png");
+ } catch (InvalidOperationException) {
+ image = ImageService.GetIcon (stockId);
+ }
+ }
+ if (image == null)
+ throw new InvalidOperationException ("Icon not found: " + stockId);
+ cachedIcons [stockId] = image;
+ return image;
+ }
+
+ public static ImageSource GetImageSource (this IconId stockId, Xwt.IconSize size)
+ {
+ if (stockId.IsNull)
+ return null;
+ try {
+ return stockId.GetStockIcon ().WithSize (size).GetImageSource ();
+ } catch (Exception ex) {
+ LoggingService.LogError ("Failed loading icon: " + stockId, ex);
+ }
+ return null;
+ }
+
+ public static ImageSource GetImageSource (this Image image)
+ {
+ return (ImageSource)MonoDevelop.Platform.WindowsPlatform.WPFToolkit.GetNativeImage (image);
+ }
+ }
+}
+
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/JumpList.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/JumpList.cs
index 67ec27e51e..4c907433e8 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/JumpList.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/JumpList.cs
@@ -76,7 +76,7 @@ namespace MonoDevelop.Platform
{
Taskbar.JumpList jumplist = Taskbar.JumpList.CreateJumpListForIndividualWindow (
MonoDevelop.Core.BrandingService.ApplicationName,
- GdkWin32.HgdiobjGet (MessageService.RootWindow.GdkWindow)
+ GdkWin32.HgdiobjGet (MessageService.RootWindow)
);
jumplist.KnownCategoryToDisplay = Taskbar.JumpListKnownCategoryType.Neither;
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/ComboMenu.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/ComboMenu.cs
new file mode 100644
index 0000000000..2a86ddfa95
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/ComboMenu.cs
@@ -0,0 +1,316 @@
+using MonoDevelop.Components.MainToolbar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Media;
+using System.Windows.Shapes;
+
+namespace WindowsPlatform.MainToolbar
+{
+ public class SelectionChangedEventArgs<T> : EventArgs
+ {
+ public T Added { get; private set; }
+ public T Removed { get; private set; }
+
+ public SelectionChangedEventArgs (T added, T removed)
+ {
+ Added = added;
+ Removed = removed;
+ }
+ }
+ public abstract class ComboMenu<T> : Menu
+ {
+ protected ComboMenu () : base ()
+ {
+ UseLayoutRounding = true;
+
+ var bindingFgColor = new Binding {
+ Path = new PropertyPath (typeof(Styles).GetProperty("MainToolbarForegroundBrush")),
+ Mode = BindingMode.OneWay,
+ };
+ var bindingDisabledFgColor = new Binding {
+ Path = new PropertyPath (typeof(Styles).GetProperty("MainToolbarDisabledForegroundBrush")),
+ Mode = BindingMode.OneWay,
+ };
+
+ var content = new StackPanel {
+ Orientation = Orientation.Horizontal,
+ Height = 20,
+ };
+
+ var textBlock = new TextBlock
+ {
+ HorizontalAlignment = HorizontalAlignment.Left,
+ VerticalAlignment = VerticalAlignment.Center,
+ Margin = new Thickness(0, 0, 0, 2),
+ };
+ content.Children.Add (textBlock);
+
+ var arrow = new Polygon {
+ Margin = new Thickness (5, 0, 0, 2),
+ HorizontalAlignment = HorizontalAlignment.Right,
+ VerticalAlignment = VerticalAlignment.Center,
+ };
+ arrow.SetBinding (Shape.FillProperty, new Binding ("Foreground") { Source = this });
+
+ IsEnabledChanged += (o, e) =>
+ {
+ textBlock.SetBinding(Control.ForegroundProperty, (bool)e.NewValue ? bindingFgColor : bindingDisabledFgColor);
+ arrow.SetBinding(Polygon.FillProperty, (bool)e.NewValue ? bindingFgColor : bindingDisabledFgColor);
+ };
+
+ arrow.Points.Add (new Point (0, 3));
+ arrow.Points.Add (new Point (3, 6));
+ arrow.Points.Add (new Point (6, 3));
+ content.Children.Add (arrow);
+
+ Items.Add (new SimpleMenuItem {
+ Header = content,
+ UseLayoutRounding = true,
+ });
+ IsEnabled = false;
+ DropMenuText = "Default";
+ }
+
+ protected MenuItem DropMenu
+ {
+ get { return (MenuItem)Items[0]; }
+ }
+
+ protected string DropMenuText
+ {
+ get { return ((TextBlock)((StackPanel)DropMenu.Header).Children[0]).Text; }
+ set { ((TextBlock)((StackPanel)DropMenu.Header).Children[0]).Text = value; }
+ }
+
+ public abstract T Active
+ {
+ get; set;
+ }
+
+ public abstract IEnumerable<T> Model
+ {
+ get; set;
+ }
+
+ public abstract event EventHandler<SelectionChangedEventArgs<T>> SelectionChanged;
+ }
+
+ public class ConfigurationComboMenu : ComboMenu<IConfigurationModel>
+ {
+ public ConfigurationComboMenu ()
+ {
+ }
+
+ IConfigurationModel active;
+ public override IConfigurationModel Active
+ {
+ get
+ {
+ return active;
+ }
+
+ set
+ {
+ active = model.FirstOrDefault (cm => cm.OriginalId == value.OriginalId);
+ if (active == null)
+ {
+ DropMenuText = "Default";
+ IsEnabled = false;
+ }
+ else
+ {
+ DropMenuText = active.DisplayString;
+ IsEnabled = true;
+ }
+ }
+ }
+
+ IEnumerable<IConfigurationModel> model;
+ public override IEnumerable<IConfigurationModel> Model
+ {
+ get
+ {
+ return model;
+ }
+
+ set
+ {
+ int count = value.Count ();
+ model = value;
+
+ var dropMenu = DropMenu;
+
+ foreach (MenuItem item in dropMenu.Items)
+ item.Click -= OnMenuItemClicked;
+ dropMenu.Items.Clear ();
+ foreach (var item in value) {
+ var menuItem = new ConfigurationMenuItem (item);
+ menuItem.Click += OnMenuItemClicked;
+ dropMenu.Items.Add (menuItem);
+ }
+ IsEnabled = Focusable = IsHitTestVisible = dropMenu.Items.Count > 1;
+ if (count == 0)
+ DropMenuText = "Default";
+ }
+ }
+
+ void OnMenuItemClicked (object sender, RoutedEventArgs args)
+ {
+ var item = (ConfigurationMenuItem)sender;
+ var old = active;
+
+ if (SelectionChanged != null)
+ SelectionChanged (this, new SelectionChangedEventArgs<IConfigurationModel> (item.Model, old));
+ }
+
+ class ConfigurationMenuItem : SimpleMenuItem
+ {
+ public ConfigurationMenuItem (IConfigurationModel model)
+ {
+ Model = model;
+ Header = model.DisplayString;
+ UseLayoutRounding = true;
+ }
+ public IConfigurationModel Model { get; private set; }
+ }
+
+ public override event EventHandler<SelectionChangedEventArgs<IConfigurationModel>> SelectionChanged;
+ }
+
+ public class RuntimeComboMenu : ComboMenu<IRuntimeModel>
+ {
+ public RuntimeComboMenu ()
+ {
+ DropMenu.SubmenuOpened += (o, e) => {
+ var menu = (MenuItem)o;
+
+ foreach (var item in menu.Items.OfType<RuntimeMenuItem> ())
+ item.Update ();
+ };
+ }
+
+ IRuntimeModel active;
+ public override IRuntimeModel Active
+ {
+ get
+ {
+ return active;
+ }
+
+ set
+ {
+ var menuItem = DropMenu.Items
+ .OfType<RuntimeMenuItem> ()
+ .FirstOrDefault (it => it.Model == value);
+
+ if (menuItem == null) {
+ active = null;
+ DropMenuText = "Default";
+ IsEnabled = false;
+ return;
+ }
+
+ active = menuItem.Model;
+ menuItem.Margin = new Thickness (0, 0, 0, 0);
+ menuItem.FontWeight = FontWeights.Normal;
+
+ using (var mutableModel = active.GetMutableModel ()) {
+ DropMenuText = mutableModel.FullDisplayString;
+ IsEnabled = true;
+ }
+ }
+ }
+
+ IEnumerable<IRuntimeModel> model;
+ public override IEnumerable<IRuntimeModel> Model
+ {
+ get
+ {
+ return model;
+ }
+
+ set
+ {
+ model = value;
+
+ FillSource (DropMenu.Items, value);
+
+ int count = DropMenu.Items.Count;
+ IsEnabled = Focusable = IsHitTestVisible = count > 1;
+ if (count == 0)
+ DropMenuText = "Default";
+ }
+ }
+
+ void OnMenuItemClicked (object sender, RoutedEventArgs args)
+ {
+ var item = (RuntimeMenuItem)sender;
+
+ if (SelectionChanged != null)
+ SelectionChanged (this, new SelectionChangedEventArgs<IRuntimeModel> (item.Model, Active));
+ }
+
+ void FillSource (ItemCollection source, IEnumerable<IRuntimeModel> model)
+ {
+ foreach (var item in source.OfType<MenuItem> ()) {
+ item.Click -= OnMenuItemClicked;
+ foreach (var subItem in item.Items.OfType<MenuItem> ())
+ subItem.Click -= OnMenuItemClicked;
+ }
+
+ source.Clear ();
+
+ foreach (var item in model) {
+ if (item.HasParent)
+ continue;
+
+ if (item.IsSeparator)
+ source.Add (new Separator { UseLayoutRounding = true, });
+ else {
+ var menuItem = new RuntimeMenuItem (item);
+ menuItem.Click += OnMenuItemClicked;
+ foreach (var child in item.Children) {
+ var childMenuItem = new RuntimeMenuItem (item);
+ childMenuItem.Click += OnMenuItemClicked;
+ menuItem.Items.Add (childMenuItem);
+ }
+ source.Add (menuItem);
+ }
+ }
+ }
+
+ public override event EventHandler<SelectionChangedEventArgs<IRuntimeModel>> SelectionChanged;
+
+ class RuntimeMenuItem : SimpleMenuItem
+ {
+ public IRuntimeModel Model { get; private set; }
+ public RuntimeMenuItem (IRuntimeModel model)
+ {
+ Model = model;
+ UseLayoutRounding = true;
+
+ Margin = new Thickness (model.IsIndented ? 15 : 0, 0, 0, 0);
+ if (model.Notable)
+ FontWeight = FontWeights.Bold;
+ }
+
+ public void Update ()
+ {
+ using (var mutableModel = Model.GetMutableModel ()) {
+ Header = mutableModel.DisplayString;
+ IsEnabled = mutableModel.Enabled;
+ Visibility = mutableModel.Visible ? Visibility.Visible : Visibility.Collapsed;
+ }
+
+ foreach (var item in Items.OfType<RuntimeMenuItem> ())
+ item.Update ();
+ }
+ }
+ }
+}
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/DottedSeparator.xaml b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/DottedSeparator.xaml
new file mode 100644
index 0000000000..348b67429a
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/DottedSeparator.xaml
@@ -0,0 +1,17 @@
+<UserControl x:Class="WindowsPlatform.MainToolbar.DottedSeparator"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:local="clr-namespace:WindowsPlatform.MainToolbar"
+ xmlns:platform="clr-namespace:WindowsPlatform"
+ mc:Ignorable="d"
+ d:DesignHeight="300" d:DesignWidth="300">
+ <UserControl.Style>
+ <Style TargetType="{x:Type local:DottedSeparator}">
+ <Setter Property="Foreground" Value="{Binding Path=(platform:Styles.MainToolbarSeparatorBrush), Mode=OneWay}" />
+ </Style>
+ </UserControl.Style>
+ <StackPanel x:Name="DotPanel">
+ </StackPanel>
+</UserControl>
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/DottedSeparator.xaml.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/DottedSeparator.xaml.cs
new file mode 100644
index 0000000000..3c580070f9
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/DottedSeparator.xaml.cs
@@ -0,0 +1,39 @@
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+using System.Windows.Shapes;
+
+namespace WindowsPlatform.MainToolbar
+{
+ /// <summary>
+ /// Interaction logic for DottedSeparator.xaml
+ /// </summary>
+ public partial class DottedSeparator : UserControl
+ {
+ public DottedSeparator()
+ {
+ InitializeComponent();
+
+ SizeChanged += ModifyPoints;
+ }
+
+ void ModifyPoints(object sender, SizeChangedEventArgs args)
+ {
+ DotPanel.Children.Clear();
+
+ for (int i = 0; i < args.NewSize.Height; i+=2)
+ {
+ DotPanel.Children.Add(new Ellipse
+ {
+ Fill = Foreground,
+ Stroke = Foreground,
+ HorizontalAlignment = HorizontalAlignment.Center,
+ Width = 1,
+ Height = 1,
+ StrokeThickness = 1,
+ Margin = new Thickness (0, 0, 0, 1),
+ });
+ }
+ }
+ }
+}
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/IconButton.xaml b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/IconButton.xaml
new file mode 100644
index 0000000000..eb42b07ebd
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/IconButton.xaml
@@ -0,0 +1,25 @@
+<UserControl x:Class="WindowsPlatform.MainToolbar.IconButtonControl"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:local="clr-namespace:WindowsPlatform.MainToolbar"
+ xmlns:platform="clr-namespace:WindowsPlatform"
+ mc:Ignorable="d"
+ Background="Transparent" BorderBrush="Transparent">
+ <Button Click="OnClick" FocusVisualStyle="{x:Null}" UseLayoutRounding="True" Focusable="{Binding Focusable}"
+ Background="{Binding Background}" BorderBrush="{Binding BorderBrush}" Width="24" Height="24">
+ <Button.Template>
+ <ControlTemplate TargetType="Button">
+ <Border UseLayoutRounding="True"
+ BorderThickness="{TemplateBinding BorderThickness}"
+ Background="{TemplateBinding Background}"
+ BorderBrush="{TemplateBinding BorderBrush}">
+ <ContentPresenter />
+ </Border>
+ </ControlTemplate>
+ </Button.Template>
+ <platform:ImageBox x:Name="RunIcon" UseLayoutRounding="True"
+ MouseLeftButtonDown="OnMouseLeftButtonDown" Width="24" Height="24" Margin="-1" />
+ </Button>
+</UserControl>
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/IconButton.xaml.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/IconButton.xaml.cs
new file mode 100644
index 0000000000..72f34c294d
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/IconButton.xaml.cs
@@ -0,0 +1,241 @@
+using MonoDevelop.Components.MainToolbar;
+using MonoDevelop.Core;
+using MonoDevelop.Ide;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace WindowsPlatform.MainToolbar
+{
+ /// <summary>
+ /// Interaction logic for RunButton.xaml
+ /// </summary>
+ public partial class IconButtonControl : UserControl, INotifyPropertyChanged
+ {
+ public static DependencyProperty ImageProperty = DependencyProperty.Register (
+ "Image", typeof (Xwt.Drawing.Image), typeof (IconButtonControl));
+
+ public Xwt.Drawing.Image Image
+ {
+ get { return (Xwt.Drawing.Image)GetValue(ImageProperty); }
+ set { SetValue (ImageProperty, value); }
+ }
+
+ public IconButtonControl (Xwt.Drawing.Image image) : this ()
+ {
+ Image = image;
+ }
+
+ public IconButtonControl ()
+ {
+ InitializeComponent ();
+
+ DataContext = this;
+ ToolTipService.SetShowOnDisabled (this, true);
+ }
+
+ void OnClick (object sender, RoutedEventArgs args)
+ {
+ if (Click != null)
+ Click (sender, args);
+ }
+
+ protected override void OnPropertyChanged (DependencyPropertyChangedEventArgs e)
+ {
+ base.OnPropertyChanged (e);
+ if (e.Property == ImageProperty) {
+ RunIcon.Image = Image;
+ if (Image != null)
+ InvalidateMeasure ();
+ }
+ if (Image == null)
+ return;
+ if (e.Property == IsMouseOverProperty && IsEnabled) {
+ RunIcon.Image = IsMouseOver ? Image.WithStyles ("hover") : Image;
+ InvalidateVisual ();
+ }
+ }
+
+ void OnMouseLeftButtonDown (object sender, MouseButtonEventArgs e)
+ {
+ OnMouseLeftButtonDown (e);
+ }
+
+ protected override void OnMouseLeftButtonDown (MouseButtonEventArgs e)
+ {
+ if (IsEnabled && Image != null) {
+ RunIcon.Image = Image.WithStyles ("pressed");
+ Background = Styles.MainToolbarButtonPressedBackgroundBrush;
+ BorderBrush = Styles.MainToolbarButtonPressedBorderBrush;
+ }
+ base.OnMouseLeftButtonDown (e);
+ }
+
+ protected override void OnMouseLeftButtonUp (MouseButtonEventArgs e)
+ {
+ if (Image != null) {
+ if (IsMouseOver)
+ RunIcon.Image = Image.WithStyles ("hover");
+ else
+ RunIcon.Image = Image;
+ }
+
+ Background = Brushes.Transparent;
+ BorderBrush = Brushes.Transparent;
+ base.OnMouseLeftButtonUp (e);
+ }
+
+ protected override void OnMouseLeave (MouseEventArgs e)
+ {
+ Background = Brushes.Transparent;
+ BorderBrush = Brushes.Transparent;
+ base.OnMouseLeave (e);
+ }
+
+ void RaisePropertyChanged ([CallerMemberName] string propName = null)
+ {
+ if (PropertyChanged != null)
+ PropertyChanged (this, new System.ComponentModel.PropertyChangedEventArgs(propName));
+ }
+
+ protected override Size MeasureOverride (Size constraint)
+ {
+ if (Image != null)
+ return new Size (Image.Width, Image.Width);
+ return base.MeasureOverride (constraint);
+ }
+
+ public event RoutedEventHandler Click;
+ public event PropertyChangedEventHandler PropertyChanged;
+ }
+
+ public class RunButtonControl : IconButtonControl
+ {
+ RunButtonControl (OperationIcon icon) : base(GetIcon(icon))
+ {
+ this.icon = icon;
+ ToolTip = GetTooltip(icon);
+ }
+ public RunButtonControl () : this (OperationIcon.Run)
+ {
+ }
+
+ OperationIcon icon;
+ public OperationIcon Icon
+ {
+ get { return icon; }
+ set
+ {
+ if (value == icon)
+ return;
+ icon = value;
+ ToolTip = GetTooltip (icon);
+ Image = GetIcon (icon);
+ }
+ }
+
+ static string GetTooltip (OperationIcon icon)
+ {
+ switch (icon)
+ {
+ case OperationIcon.Stop:
+ return GettextCatalog.GetString("Stop currently running operation");
+ case OperationIcon.Run:
+ return GettextCatalog.GetString("Run current startup project");
+ case OperationIcon.Build:
+ return GettextCatalog.GetString("Build current startup project");
+ default:
+ throw new InvalidOperationException();
+ }
+ }
+
+ static Xwt.Drawing.Image GetIcon (OperationIcon icon)
+ {
+ string img;
+ switch (icon) {
+ case OperationIcon.Stop:
+ img = "stop.png";
+ break;
+ case OperationIcon.Run:
+ img = "execute.png";
+ break;
+ case OperationIcon.Build:
+ img = "build.png";
+ break;
+ default:
+ throw new InvalidOperationException ();
+ }
+
+ return Xwt.Drawing.Image.FromResource (typeof (RunButtonControl), img).WithSize (Xwt.IconSize.Medium);
+ }
+ }
+
+ public class ButtonBarButton : IconButtonControl, IDisposable
+ {
+ IButtonBarButton button;
+ public ButtonBarButton (IButtonBarButton button)
+ : base (button.Image.IsNull ? null : button.Image.GetStockIcon().WithSize(Xwt.IconSize.Medium))
+ {
+ this.button = button;
+
+ VerticalContentAlignment = VerticalAlignment.Center;
+ ToolTip = button.Tooltip;
+ IsEnabled = button.Enabled;
+ Visibility = button.Visible ? Visibility.Visible : Visibility.Collapsed;
+ Margin = new Thickness(3, 0, 3, 0);
+
+ button.EnabledChanged += OnButtonEnabledChanged;
+ button.VisibleChanged += OnButtonVisibleChanged;
+ button.TooltipChanged += OnButtonTooltipChanged;
+ button.ImageChanged += OnButtonImageChanged;
+
+ Click += OnButtonClicked;
+ }
+
+ public void Dispose ()
+ {
+ button.EnabledChanged -= OnButtonEnabledChanged;
+ button.VisibleChanged -= OnButtonVisibleChanged;
+ button.TooltipChanged -= OnButtonTooltipChanged;
+ button.ImageChanged -= OnButtonImageChanged;
+ }
+
+ void OnButtonEnabledChanged (object sender, EventArgs args)
+ {
+ IsEnabled = button.Enabled;
+ }
+
+ void OnButtonVisibleChanged (object sender, EventArgs e)
+ {
+ Visibility = button.Visible ? Visibility.Visible : Visibility.Collapsed;
+ }
+
+ void OnButtonTooltipChanged (object sender, EventArgs args)
+ {
+ ToolTip = button.Tooltip;
+ }
+
+ void OnButtonImageChanged (object sender, EventArgs args)
+ {
+ Image = button.Image.GetStockIcon ().WithSize (Xwt.IconSize.Medium);
+ }
+
+ void OnButtonClicked (object sender, RoutedEventArgs args)
+ {
+ button.NotifyPushed ();
+ }
+ }
+}
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/SearchBar.xaml b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/SearchBar.xaml
new file mode 100644
index 0000000000..c28941bd0c
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/SearchBar.xaml
@@ -0,0 +1,22 @@
+<UserControl x:Class="WindowsPlatform.MainToolbar.SearchBarControl"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:local="clr-namespace:WindowsPlatform.MainToolbar"
+ xmlns:platform="clr-namespace:WindowsPlatform"
+ mc:Ignorable="d"
+ Background="{Binding Path=(platform:Styles.SearchBarBackgroundBrush), Mode=OneWay}"
+ Foreground="{Binding Path=(platform:Styles.SearchBarTextBrush), Mode=OneWay}"
+ BorderBrush="{Binding Path=(platform:Styles.SearchBarBorderBrush), Mode=OneWay}">
+ <Border BorderThickness="0" UseLayoutRounding="True">
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Height="26" UseLayoutRounding="True">
+ <TextBox x:Name="SearchBar" Text="{Binding Path=SearchText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" MinWidth="180" Margin="5,0,0,0" Background="Transparent" Foreground="{Binding Foreground}" CaretBrush="{Binding Foreground}" BorderThickness="0" UseLayoutRounding="True" />
+ <local:IconButtonControl x:Name="SearchIcon" Width="24" Height="24" Margin="0,0,1,0" Click="OnIconClicked" UseLayoutRounding="True" VerticalContentAlignment="Center" VerticalAlignment="Center" >
+ <local:IconButtonControl.ContextMenu>
+ <ContextMenu UseLayoutRounding="True" />
+ </local:IconButtonControl.ContextMenu>
+ </local:IconButtonControl>
+ </StackPanel>
+ </Border>
+</UserControl>
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/SearchBar.xaml.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/SearchBar.xaml.cs
new file mode 100644
index 0000000000..53a909d4a5
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/SearchBar.xaml.cs
@@ -0,0 +1,140 @@
+using MonoDevelop.Components.MainToolbar;
+using MonoDevelop.Ide;
+using MonoDevelop.Ide.Gui;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Globalization;
+
+namespace WindowsPlatform.MainToolbar
+{
+ /// <summary>
+ /// Interaction logic for SearchBar.xaml
+ /// </summary>
+ public partial class SearchBarControl : UserControl, INotifyPropertyChanged
+ {
+ readonly Xwt.Drawing.Image searchIcon, clearIcon;
+
+ public SearchBarControl ()
+ {
+ InitializeComponent ();
+ DataContext = this;
+
+ SearchBar.GotKeyboardFocus += (o, e) => {
+ if (searchText == placeholderText)
+ SearchText = string.Empty;
+ };
+ IdeApp.Workbench.RootWindow.SetFocus += (o, e) =>
+ {
+ if (Keyboard.FocusedElement == SearchBar) {
+ Keyboard.ClearFocus ();
+ IdeApp.Workbench.RootWindow.Present ();
+ }
+ };
+
+ searchIcon = Stock.SearchboxSearch.GetStockIcon ().WithSize (Xwt.IconSize.Small);
+ clearIcon = ((MonoDevelop.Core.IconId)"md-searchbox-clear").GetStockIcon ().WithSize (Xwt.IconSize.Small);
+ SearchIcon.Image = searchIcon;
+ SearchIcon.Focusable = false;
+ }
+
+ string placeholderText;
+ public string PlaceholderText {
+ get {
+ return placeholderText;
+ }
+ set {
+ var oldPlaceholderText = placeholderText;
+ placeholderText = value;
+ if (string.IsNullOrEmpty (SearchText) || searchText == oldPlaceholderText)
+ SearchText = placeholderText;
+ UpdateIcon ();
+ }
+ }
+
+ string searchText;
+ public string SearchText
+ {
+ get { return searchText; }
+ set {
+ searchText = value;
+ UpdateIcon ();
+ RaisePropertyChanged ();
+ }
+ }
+
+ bool isClearShown = false;
+ void UpdateIcon ()
+ {
+ if (string.IsNullOrEmpty (searchText) || searchText == PlaceholderText) {
+ if (isClearShown) {
+ SearchIcon.Image = searchIcon;
+ isClearShown = false;
+ }
+ } else if (!isClearShown) {
+ SearchIcon.Image = clearIcon;
+ isClearShown = true;
+ }
+ }
+
+ IEnumerable<ISearchMenuModel> searchMenuItems;
+ public IEnumerable<ISearchMenuModel> SearchMenuItems
+ {
+ get { return searchMenuItems; }
+ set {
+ searchMenuItems = value;
+
+ foreach (MenuItem menuItem in SearchIcon.ContextMenu.Items)
+ menuItem.Click -= OnMenuItemClicked;
+
+ SearchIcon.ContextMenu.Items.Clear ();
+ foreach (var item in value) {
+ var menuItem = new SimpleMenuItem {
+ Header = item.DisplayString,
+ Tag = item,
+ };
+ menuItem.Click += OnMenuItemClicked;
+ SearchIcon.ContextMenu.Items.Add (menuItem);
+ }
+ }
+ }
+
+ void OnIconClicked (object sender, RoutedEventArgs args)
+ {
+ if (isClearShown)
+ ClearIconClicked?.Invoke(this, EventArgs.Empty);
+ else
+ SearchIcon.ContextMenu.IsOpen = true;
+ }
+
+ void OnMenuItemClicked (object sender, RoutedEventArgs args)
+ {
+ var menuItem = (MenuItem)sender;
+ var searchModel = (ISearchMenuModel)menuItem.Tag;
+ searchModel.NotifyActivated ();
+ SearchBar.Focus ();
+ }
+
+ void RaisePropertyChanged ([CallerMemberName] string propName = null)
+ {
+ if (PropertyChanged != null)
+ PropertyChanged (this, new PropertyChangedEventArgs (propName));
+ }
+
+ public event EventHandler ClearIconClicked;
+ public event PropertyChangedEventHandler PropertyChanged;
+ }
+}
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/SimpleMenuItem.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/SimpleMenuItem.cs
new file mode 100644
index 0000000000..841cd8381f
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/SimpleMenuItem.cs
@@ -0,0 +1,39 @@
+//
+// SimpleMenuItem.cs
+//
+// Author:
+// Vsevolod Kukol <sevo@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Windows.Controls;
+
+namespace WindowsPlatform.MainToolbar
+{
+ public partial class SimpleMenuItem : MenuItem
+ {
+ public SimpleMenuItem ()
+ {
+ InitializeComponent();
+ }
+ }
+}
+
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/SimpleMenuItem.xaml b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/SimpleMenuItem.xaml
new file mode 100644
index 0000000000..b23e778c1e
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/SimpleMenuItem.xaml
@@ -0,0 +1,212 @@
+<MenuItem x:Class="WindowsPlatform.MainToolbar.SimpleMenuItem"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:local="clr-namespace:WindowsPlatform.MainToolbar"
+ xmlns:platform="clr-namespace:WindowsPlatform"
+ mc:Ignorable="d"
+ d:DesignHeight="300" d:DesignWidth="300">
+ <MenuItem.Resources>
+ <ControlTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:SimpleMenuItem}, ResourceId=SimpleTopLevelHeaderTemplateKey}" TargetType="{x:Type local:SimpleMenuItem}">
+ <Border x:Name="templateRoot"
+ SnapsToDevicePixels="true"
+ BorderThickness="{TemplateBinding BorderThickness}"
+ Background="Transparent"
+ BorderBrush="Transparent"
+ TextElement.Foreground="{Binding Path=(platform:Styles.MenuForegroundBrush), Mode=OneWay}">
+ <Grid VerticalAlignment="Center">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ </Grid.ColumnDefinitions>
+ <ContentPresenter
+ Grid.Column="0"
+ ContentSource="Header"
+ RecognizesAccessKey="True"
+ Margin="{TemplateBinding MenuItem.Padding}"
+ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+ <Popup x:Name="PART_Popup"
+ AllowsTransparency="true"
+ Focusable="false"
+ IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
+ MinWidth="{Binding ActualWidth, RelativeSource={RelativeSource TemplatedParent}}"
+ PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}"
+ Placement="Bottom"
+ PlacementTarget="{Binding ElementName=templateRoot}" >
+ <Border x:Name="SubMenuBorder"
+ Background="{Binding Path=(platform:Styles.MenuBackgroundBrush), Mode=OneWay}"
+ BorderBrush="{Binding Path=(platform:Styles.MenuBorderBrush), Mode=OneWay}"
+ BorderThickness="1"
+ Padding="2">
+ <ScrollViewer x:Name="SubMenuScrollViewer"
+ Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}">
+ <Grid RenderOptions.ClearTypeHint="Enabled">
+ <Canvas Height="0" Width="0" HorizontalAlignment="Left" VerticalAlignment="Top">
+ <Rectangle
+ Name="OpaqueRect"
+ Height="{Binding ElementName=SubMenuBorder,Path=ActualHeight}"
+ Width="{Binding ElementName=SubMenuBorder,Path=ActualWidth}"
+ Fill="{Binding ElementName=SubMenuBorder,Path=Background}" />
+ </Canvas>
+ <ItemsPresenter x:Name="ItemsPresenter"
+ KeyboardNavigation.DirectionalNavigation="Cycle"
+ KeyboardNavigation.TabNavigation="Cycle"
+ Grid.IsSharedSizeScope="true"
+ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+ </Grid>
+ </ScrollViewer>
+ </Border>
+ </Popup>
+ </Grid>
+ </Border>
+ <ControlTemplate.Triggers>
+ <Trigger Property="IsSuspendingPopupAnimation" Value="true">
+ <Setter TargetName="PART_Popup" Property="PopupAnimation" Value="None"/>
+ </Trigger>
+ <Trigger Property="IsHighlighted" Value="True">
+ <Setter TargetName="templateRoot" Property="Background" Value="{Binding Path=(platform:Styles.MenuHighlightBackgroundBrush), Mode=OneWay}" />
+ <Setter TargetName="templateRoot" Property="BorderBrush" Value="{Binding Path=(platform:Styles.MenuHighlightBorderBrush), Mode=OneWay}" />
+ </Trigger>
+ <Trigger Property="IsEnabled" Value="False">
+ <Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{Binding Path=(platform:Styles.MenuDisabledForegroundBrush), Mode=OneWay}" />
+ </Trigger>
+ <Trigger SourceName="SubMenuScrollViewer" Property="ScrollViewer.CanContentScroll" Value="false" >
+ <Setter TargetName="OpaqueRect" Property="Canvas.Top" Value="{Binding ElementName=SubMenuScrollViewer, Path=VerticalOffset}" />
+ <Setter TargetName="OpaqueRect" Property="Canvas.Left" Value="{Binding ElementName=SubMenuScrollViewer, Path=HorizontalOffset}" />
+ </Trigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+ <ControlTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:SimpleMenuItem}, ResourceId=SimpleItemTemplateKey}" TargetType="{x:Type local:SimpleMenuItem}">
+ <Border x:Name="templateRoot"
+ SnapsToDevicePixels="true"
+ Height="22"
+ BorderThickness="{TemplateBinding BorderThickness}"
+ Background="Transparent"
+ BorderBrush="Transparent"
+ TextElement.Foreground="{Binding Path=(platform:Styles.MenuForegroundBrush), Mode=OneWay}">
+ <Grid Margin="-1">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*"/>
+ </Grid.ColumnDefinitions>
+ <ContentPresenter x:Name="menuHeaderContainer"
+ Grid.Column="2"
+ HorizontalAlignment="Left"
+ VerticalAlignment="Center"
+ ContentSource="Header"
+ RecognizesAccessKey="True"
+ Margin="5,0,5,1"
+ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+ </Grid>
+ </Border>
+ <ControlTemplate.Triggers>
+ <Trigger Property="IsHighlighted" Value="True">
+ <Setter TargetName="templateRoot" Property="Background" Value="{Binding Path=(platform:Styles.MenuHighlightBackgroundBrush), Mode=OneWay}" />
+ <Setter TargetName="templateRoot" Property="BorderBrush" Value="{Binding Path=(platform:Styles.MenuHighlightBorderBrush), Mode=OneWay}" />
+ </Trigger>
+ <Trigger Property="IsEnabled" Value="False">
+ <Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{Binding Path=(platform:Styles.MenuDisabledForegroundBrush), Mode=OneWay}" />
+ </Trigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+
+ <ControlTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:SimpleMenuItem}, ResourceId=SimpleHeaderTemplateKey}" TargetType="{x:Type local:SimpleMenuItem}">
+ <Border x:Name="templateRoot"
+ SnapsToDevicePixels="true"
+ Height="22"
+ BorderThickness="{TemplateBinding BorderThickness}"
+ Background="Transparent"
+ BorderBrush="Transparent"
+ TextElement.Foreground="{Binding Path=(platform:Styles.MenuForegroundBrush), Mode=OneWay}">
+ <Grid Margin="-1">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*"/>
+ <ColumnDefinition Width="20"/>
+ </Grid.ColumnDefinitions>
+ <ContentPresenter
+ Grid.Column="0"
+ HorizontalAlignment="Left"
+ VerticalAlignment="Center"
+ ContentSource="Header"
+ RecognizesAccessKey="True"
+ Margin="5,0,0,1"
+ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+ <Path x:Name="RightArrow"
+ Grid.Column="1"
+ Data="{StaticResource RightArrow}"
+ Margin="10,0,0,0"
+ VerticalAlignment="Center"
+ HorizontalAlignment="Left"
+ Fill="{Binding Path=(platform:Styles.MenuForegroundBrush), Mode=OneWay}" />
+ <Popup x:Name="PART_Popup"
+ AllowsTransparency="true"
+ Focusable="false"
+ IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
+ PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}"
+ Placement="Right"
+ HorizontalOffset="-2"
+ VerticalOffset="-3">
+ <Border x:Name="SubMenuBorder"
+ Background="{Binding Path=(platform:Styles.MenuBackgroundBrush), Mode=OneWay}"
+ BorderBrush="{Binding Path=(platform:Styles.MenuBorderBrush), Mode=OneWay}"
+ BorderThickness="1"
+ Padding="2">
+ <ScrollViewer x:Name="SubMenuScrollViewer"
+ Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}">
+ <Grid RenderOptions.ClearTypeHint="Enabled">
+ <Canvas Height="0" Width="0" HorizontalAlignment="Left" VerticalAlignment="Top">
+ <Rectangle
+ Name="OpaqueRect"
+ Height="{Binding ElementName=SubMenuBorder,Path=ActualHeight}"
+ Width="{Binding ElementName=SubMenuBorder,Path=ActualWidth}"
+ Fill="{Binding ElementName=SubMenuBorder,Path=Background}" />
+ </Canvas>
+ <ItemsPresenter x:Name="ItemsPresenter"
+ KeyboardNavigation.DirectionalNavigation="Cycle"
+ KeyboardNavigation.TabNavigation="Cycle"
+ Grid.IsSharedSizeScope="true"
+ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+ </Grid>
+ </ScrollViewer>
+ </Border>
+ </Popup>
+ </Grid>
+ </Border>
+ <ControlTemplate.Triggers>
+ <Trigger Property="IsSuspendingPopupAnimation" Value="true">
+ <Setter TargetName="PART_Popup" Property="PopupAnimation" Value="None"/>
+ </Trigger>
+ <Trigger Property="IsHighlighted" Value="True">
+ <Setter TargetName="templateRoot" Property="Background" Value="{Binding Path=(platform:Styles.MenuHighlightBackgroundBrush), Mode=OneWay}" />
+ <Setter TargetName="templateRoot" Property="BorderBrush" Value="{Binding Path=(platform:Styles.MenuHighlightBorderBrush), Mode=OneWay}" />
+ </Trigger>
+ <Trigger Property="IsEnabled" Value="False">
+ <Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{Binding Path=(platform:Styles.MenuDisabledForegroundBrush), Mode=OneWay}" />
+ <Setter TargetName="RightArrow" Property="Fill" Value="{Binding Path=(platform:Styles.MenuDisabledForegroundBrush), Mode=OneWay}" />
+ </Trigger>
+ <Trigger SourceName="SubMenuScrollViewer" Property="ScrollViewer.CanContentScroll" Value="false" >
+ <Setter TargetName="OpaqueRect" Property="Canvas.Top" Value="{Binding ElementName=SubMenuScrollViewer, Path=VerticalOffset}" />
+ <Setter TargetName="OpaqueRect" Property="Canvas.Left" Value="{Binding ElementName=SubMenuScrollViewer, Path=HorizontalOffset}" />
+ </Trigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+ </MenuItem.Resources>
+ <MenuItem.Style>
+ <Style x:Key="{x:Type local:SimpleMenuItem}" TargetType="{x:Type local:SimpleMenuItem}">
+ <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
+ <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
+ <Setter Property="BorderThickness" Value="1" />
+ <Setter Property="ScrollViewer.PanningMode" Value="Both"/>
+ <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
+ <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type local:SimpleMenuItem}, ResourceId=SimpleItemTemplateKey}}" />
+ <Style.Triggers>
+ <Trigger Property="Role" Value="TopLevelHeader">
+ <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type local:SimpleMenuItem}, ResourceId=SimpleTopLevelHeaderTemplateKey}}" />
+ <Setter Property="Padding" Value="6,0"/>
+ </Trigger>
+ <Trigger Property="Role" Value="SubmenuHeader">
+ <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type local:SimpleMenuItem}, ResourceId=SimpleHeaderTemplateKey}}" />
+ </Trigger>
+ </Style.Triggers>
+ </Style>
+ </MenuItem.Style>
+</MenuItem>
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/StatusBar.xaml b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/StatusBar.xaml
new file mode 100644
index 0000000000..94f09ba30a
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/StatusBar.xaml
@@ -0,0 +1,72 @@
+<UserControl x:Class="WindowsPlatform.MainToolbar.StatusBarControl"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:local="clr-namespace:WindowsPlatform.MainToolbar"
+ xmlns:platform="clr-namespace:WindowsPlatform"
+ mc:Ignorable="d" Background="{Binding Path=(platform:Styles.StatusBarBackgroundBrush), Mode=OneWay}">
+ <UserControl.Style>
+ <Style TargetType="{x:Type local:StatusBarControl}">
+ <Setter Property="StatusTextBrush" Value="{Binding Path=(platform:Styles.StatusBarTextBrush), Mode=OneWay}" />
+ <Style.Triggers>
+ <Trigger Property="Status" Value="Ready">
+ <Setter Property="StatusTextBrush" Value="{Binding Path=(platform:Styles.StatusBarReadyTextBrush), Mode=OneWay}"/>
+ </Trigger>
+ <Trigger Property="Status" Value="Warning">
+ <Setter Property="StatusTextBrush" Value="{Binding Path=(platform:Styles.StatusBarWarningTextBrush), Mode=OneWay}"/>
+ </Trigger>
+ <Trigger Property="Status" Value="Error">
+ <Setter Property="StatusTextBrush" Value="{Binding Path=(platform:Styles.StatusBarErrorTextBrush), Mode=OneWay}"/>
+ </Trigger>
+ </Style.Triggers>
+ </Style>
+ </UserControl.Style>
+ <Grid VerticalAlignment="Center" Height="26" Width="350" MinWidth="220" MaxWidth="700" UseLayoutRounding="True">
+ <Grid>
+ <ProgressBar Minimum="0" Maximum="1" x:Name="ProgressBar"
+ Background="Transparent"
+ BorderBrush="{Binding Path=(platform:Styles.StatusBarProgressBorderBrush), Mode=OneWay}"
+ Foreground="{Binding Path=(platform:Styles.StatusBarProgressBackgroundBrush), Mode=OneWay}"/>
+ </Grid>
+ <Grid Background="Transparent" >
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+ <platform:ImageBox Grid.Column="0"
+ x:Name="StatusImageControl"
+ MaxWidth="16"
+ Margin="9,5,0,5"
+ MaxHeight="16"
+ Image="{Binding StatusImage}"
+ UseLayoutRounding="True"
+ MouseLeftButtonUp="OnShowPad" />
+ <TextBlock x:Name="StatusText"
+ Grid.Column="1"
+ VerticalAlignment="Center"
+ Padding="7,1,0,2"
+ Foreground="{Binding StatusTextBrush}"
+ Text="{Binding Message}"
+ TextTrimming="WordEllipsis"
+ UseLayoutRounding="True"
+ MouseLeftButtonUp="OnShowPad" />
+ <StackPanel x:Name="BuildResultPanel"
+ Grid.Column="2"
+ Visibility="{Binding BuildResultPanelVisibility}"
+ VerticalAlignment="Center"
+ Orientation="Horizontal"
+ UseLayoutRounding="True"
+ MouseLeftButtonUp="OnShowError">
+ <platform:ImageBox Image="{Binding BuildResultIcon}" Margin="0,0,0,0" MaxWidth="16" MaxHeight="16" UseLayoutRounding="True" />
+ <TextBlock
+ Text="{Binding BuildResultCount}"
+ VerticalAlignment="Center"
+ Padding="3,2,5,1" />
+ </StackPanel>
+ <StackPanel x:Name="StatusIconsPanel" Grid.Column="3" VerticalAlignment="Center" Orientation="Horizontal" UseLayoutRounding="True" Margin="0,0,3,0" />
+ </Grid>
+ </Grid>
+</UserControl>
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/StatusBar.xaml.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/StatusBar.xaml.cs
new file mode 100644
index 0000000000..35c33ee1da
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/StatusBar.xaml.cs
@@ -0,0 +1,376 @@
+using MonoDevelop.Ide;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Gui;
+using Xwt.Drawing;
+using MonoDevelop.Components.MainToolbar;
+using MonoDevelop.Ide.Tasks;
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
+using System.Windows.Media.Animation;
+using MonoDevelop.Ide.Gui.Components;
+
+namespace WindowsPlatform.MainToolbar
+{
+ public enum StatusBarStatus
+ {
+ Normal,
+ Ready,
+ Warning,
+ Error,
+ }
+
+ /// <summary>
+ /// Interaction logic for StatusBar.xaml
+ /// </summary>
+ public partial class StatusBarControl : UserControl, StatusBar, INotifyPropertyChanged
+ {
+ StatusBarContextHandler ctxHandler;
+ TaskEventHandler updateHandler;
+ public StatusBarControl ()
+ {
+ InitializeComponent ();
+ DataContext = this;
+
+ ctxHandler = new StatusBarContextHandler (this);
+
+ ShowReady ();
+
+ updateHandler = delegate {
+ int ec = 0, wc = 0;
+
+ foreach (MonoDevelop.Ide.Tasks.TaskListEntry t in TaskService.Errors) {
+ if (t.Severity == TaskSeverity.Error)
+ ec++;
+ else if (t.Severity == TaskSeverity.Warning)
+ wc++;
+ }
+
+ Runtime.RunInMainThread (delegate {
+ if (ec > 0) {
+ BuildResultPanelVisibility = Visibility.Visible;
+ BuildResultCount = ec;
+ BuildResultIcon = Stock.Error.GetStockIcon ().WithSize (Xwt.IconSize.Small);
+ } else if (wc > 0) {
+ BuildResultPanelVisibility = Visibility.Visible;
+ BuildResultCount = wc;
+ BuildResultIcon = Stock.Warning.GetStockIcon ().WithSize (Xwt.IconSize.Small);
+ } else
+ BuildResultPanelVisibility = Visibility.Collapsed;
+ });
+ };
+ TaskService.Errors.TasksAdded += updateHandler;
+ TaskService.Errors.TasksRemoved += updateHandler;
+ BrandingService.ApplicationNameChanged += ApplicationNameChanged;
+
+ StatusText.ToolTipOpening += (o, e) => {
+ e.Handled = !TextTrimmed ();
+ };
+ }
+
+ bool TextTrimmed ()
+ {
+ StatusText.Measure (new Size (double.PositiveInfinity, double.PositiveInfinity));
+ return StatusText.ActualWidth < StatusText.DesiredSize.Width;
+ }
+
+ public bool AutoPulse {
+ get { return ProgressBar.IsIndeterminate; }
+ set { ProgressBar.IsIndeterminate = value; }
+ }
+
+ public StatusBar MainContext
+ {
+ get { return ctxHandler.MainContext; }
+ }
+
+ public void BeginProgress (string name)
+ {
+ EndProgress();
+ Status = StatusBarStatus.Normal;
+ ShowMessage (name);
+ }
+
+ public void BeginProgress (IconId image, string name)
+ {
+ EndProgress();
+ Status = StatusBarStatus.Normal;
+ ShowMessage(image, name);
+ }
+
+ public StatusBarContext CreateContext ()
+ {
+ return ctxHandler.CreateContext ();
+ }
+
+ public void Dispose ()
+ {
+ TaskService.Errors.TasksAdded -= updateHandler;
+ TaskService.Errors.TasksRemoved -= updateHandler;
+ BrandingService.ApplicationNameChanged -= ApplicationNameChanged;
+ }
+
+ public void EndProgress ()
+ {
+ oldWork = 0;
+ ProgressBar.BeginAnimation(System.Windows.Controls.Primitives.RangeBase.ValueProperty, null);
+ }
+
+ public void Pulse ()
+ {
+ // Nothing to do here.
+ }
+
+ static Pad sourcePad;
+ public void SetMessageSourcePad (Pad pad)
+ {
+ sourcePad = pad;
+ }
+
+ void OnShowError(object sender, MouseButtonEventArgs e)
+ {
+ IdeApp.Workbench.GetPad<MonoDevelop.Ide.Gui.Pads.ErrorListPad>().BringToFront();
+ }
+
+ void OnShowPad(object sender, MouseButtonEventArgs e)
+ {
+ if (sourcePad != null)
+ sourcePad.BringToFront(true);
+ }
+
+ double oldWork = 0;
+ public void SetProgressFraction (double work)
+ {
+ if (work == oldWork)
+ return;
+
+ var anim = new DoubleAnimation
+ {
+ From = oldWork,
+ To = work,
+ Duration = TimeSpan.FromSeconds(0.2),
+ FillBehavior = FillBehavior.HoldEnd,
+ };
+ oldWork = work;
+
+ ProgressBar.BeginAnimation(System.Windows.Controls.Primitives.RangeBase.ValueProperty, anim, HandoffBehavior.SnapshotAndReplace);
+ }
+
+ public void ShowError (string error)
+ {
+ Status = StatusBarStatus.Error;
+ ShowMessage (error);
+ }
+
+ public void ShowMessage (string message)
+ {
+ ShowMessage (null, message, false);
+ }
+
+ public void ShowMessage (IconId image, string message)
+ {
+ ShowMessage (image, message, false);
+ }
+
+ public void ShowMessage (string message, bool isMarkup)
+ {
+ ShowMessage (null, message, true);
+ }
+
+ IconId currentIcon;
+ AnimatedIcon animatedIcon;
+ IDisposable xwtAnimation;
+ public void ShowMessage (IconId iconId, string message, bool isMarkup)
+ {
+ Message = message;
+ StatusText.ToolTip = message;
+
+ if (iconId.IsNull)
+ iconId = BrandingService.StatusSteadyIconId;
+
+ // don't reload same icon
+ if (currentIcon == iconId)
+ return;
+
+ currentIcon = iconId;
+
+ if (xwtAnimation != null) {
+ xwtAnimation.Dispose ();
+ xwtAnimation = null;
+ }
+
+ if (ImageService.IsAnimation (currentIcon, Gtk.IconSize.Menu)) {
+ animatedIcon = ImageService.GetAnimatedIcon (currentIcon, Gtk.IconSize.Menu);
+ StatusImage = animatedIcon.FirstFrame;
+ xwtAnimation = animatedIcon.StartAnimation (p => {
+ StatusImage = p;
+ });
+ } else
+ StatusImage = currentIcon.GetStockIcon ().WithSize (Xwt.IconSize.Small);
+ }
+
+ public void ShowReady ()
+ {
+ Status = StatusBarStatus.Ready;
+ ShowMessage (BrandingService.StatusSteadyIconId, BrandingService.ApplicationLongName);
+ }
+
+ void ApplicationNameChanged (object sender, EventArgs e)
+ {
+ if (Status == StatusBarStatus.Ready)
+ ShowReady ();
+ }
+
+ public StatusBarIcon ShowStatusIcon (Xwt.Drawing.Image pixbuf)
+ {
+ var icon = new StatusIcon (this) {
+ Image = pixbuf,
+ Margin = new Thickness (5, 5, 5, 5),
+ MaxWidth = 16,
+ MaxHeight = 16,
+ };
+
+ StatusIconsPanel.Children.Add (icon);
+
+ return icon;
+ }
+
+ public void ShowWarning (string warning)
+ {
+ Status = StatusBarStatus.Warning;
+ ShowMessage (warning);
+ }
+
+ string message;
+ public string Message
+ {
+ get { return message; }
+ set { message = value; RaisePropertyChanged (); }
+ }
+
+ public static readonly DependencyProperty StatusProperty =
+ DependencyProperty.Register("Status", typeof(StatusBarStatus), typeof(StatusBarControl), new FrameworkPropertyMetadata(StatusBarStatus.Normal, FrameworkPropertyMetadataOptions.AffectsRender));
+
+ public StatusBarStatus Status {
+ get { return (StatusBarStatus)GetValue(StatusProperty); }
+ private set { SetValue(StatusProperty, value); RaisePropertyChanged (); }
+ }
+
+ public static readonly DependencyProperty StatusTextBrushProperty =
+ DependencyProperty.Register("StatusTextBrush", typeof(Brush), typeof(StatusBarControl), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
+
+ public Brush StatusTextBrush
+ {
+ get { return GetValue (StatusTextBrushProperty) as Brush; }
+ set { SetValue (StatusTextBrushProperty, value); }
+ }
+
+ Xwt.Drawing.Image statusImage;
+ public Xwt.Drawing.Image StatusImage
+ {
+ get { return statusImage; }
+ set { statusImage = value; RaisePropertyChanged (); }
+ }
+
+ int buildResultCount;
+ public int BuildResultCount
+ {
+ get { return buildResultCount; }
+ set { buildResultCount = value; RaisePropertyChanged (); }
+ }
+
+ Xwt.Drawing.Image buildResultIcon;
+ public Xwt.Drawing.Image BuildResultIcon
+ {
+ get { return buildResultIcon; }
+ set { buildResultIcon = value; RaisePropertyChanged (); }
+ }
+
+ Visibility buildResultPanelVisibility = Visibility.Collapsed;
+ public Visibility BuildResultPanelVisibility
+ {
+ get { return buildResultPanelVisibility; }
+ set { buildResultPanelVisibility = value; RaisePropertyChanged (); }
+ }
+
+ void RaisePropertyChanged ([CallerMemberName] string propName = null)
+ {
+ if (PropertyChanged != null)
+ PropertyChanged (this, new System.ComponentModel.PropertyChangedEventArgs (propName));
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+ }
+
+ class StatusIcon : ImageBox, StatusBarIcon
+ {
+ StatusBar bar;
+
+ public StatusIcon (StatusBar bar)
+ {
+ this.bar = bar;
+ }
+
+ public void SetAlertMode (int seconds)
+ {
+ // Create fade-out fade-in animation.
+ }
+
+ public void Dispose ()
+ {
+ ((StackPanel)Parent).Children.Remove (this);
+ }
+
+ public new string ToolTip
+ {
+ get { return (string)base.ToolTip; }
+ set { base.ToolTip = value; }
+ }
+
+ protected override void OnMouseUp (MouseButtonEventArgs e)
+ {
+ base.OnMouseUp (e);
+
+ Xwt.PointerButton button;
+ switch (e.ChangedButton) {
+ case MouseButton.Left:
+ button = Xwt.PointerButton.Left;
+ break;
+ case MouseButton.Middle:
+ button = Xwt.PointerButton.Middle;
+ break;
+ case MouseButton.Right:
+ button = Xwt.PointerButton.Right;
+ break;
+ case MouseButton.XButton1:
+ button = Xwt.PointerButton.ExtendedButton1;
+ break;
+ case MouseButton.XButton2:
+ button = Xwt.PointerButton.ExtendedButton2;
+ break;
+ default:
+ throw new NotSupportedException ();
+ }
+
+ if (Clicked != null)
+ Clicked (this, new StatusBarIconClickedEventArgs {
+ Button = button,
+ });
+ }
+
+ public event EventHandler<StatusBarIconClickedEventArgs> Clicked;
+ }
+}
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/TitleBar.xaml b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/TitleBar.xaml
new file mode 100644
index 0000000000..4c24cbdd4c
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/TitleBar.xaml
@@ -0,0 +1,12 @@
+<UserControl x:Class="WindowsPlatform.MainToolbar.TitleBar"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:local="clr-namespace:WindowsPlatform.MainToolbar"
+ xmlns:platform="clr-namespace:WindowsPlatform"
+ mc:Ignorable="d" Background="{Binding Path=(platform:Styles.MainToolbarBackgroundBrush), Mode=OneWay}">
+ <DockPanel x:Name="DockTitle" Height="{DynamicResource {x:Static SystemParameters.WindowCaptionHeightKey}}" Margin="1,0,0,0" UseLayoutRounding="True">
+ <!-- Insert menu items programmatically here on Left. -->
+ </DockPanel>
+</UserControl>
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/TitleBar.xaml.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/TitleBar.xaml.cs
new file mode 100644
index 0000000000..cc5d8b9948
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/TitleBar.xaml.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using MonoDevelop.Ide;
+
+namespace WindowsPlatform.MainToolbar
+{
+ /// <summary>
+ /// Interaction logic for TitleBar.xaml
+ /// </summary>
+ public partial class TitleBar : UserControl
+ {
+ public TitleBar()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/TitleMenuItem.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/TitleMenuItem.cs
new file mode 100644
index 0000000000..c579ab60f3
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/TitleMenuItem.cs
@@ -0,0 +1,264 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Controls;
+using System.Windows.Input;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Ide;
+using System.Windows;
+using MonoDevelop.Core;
+
+namespace WindowsPlatform.MainToolbar
+{
+ public class TitleMenuItem : MenuItem
+ {
+ public TitleMenuItem (MonoDevelop.Components.Commands.CommandManager manager, CommandEntry entry, CommandInfo commandArrayInfo = null, CommandSource commandSource = CommandSource.MainMenu, object initialCommandTarget = null, Menu menu = null)
+ {
+ this.manager = manager;
+ this.initialCommandTarget = initialCommandTarget;
+ this.commandSource = commandSource;
+ this.commandArrayInfo = commandArrayInfo;
+
+ this.menu = menu;
+ menuEntry = entry;
+ menuEntrySet = entry as CommandEntrySet;
+ menuLinkEntry = entry as LinkCommandEntry;
+
+ if (commandArrayInfo != null) {
+ Header = commandArrayInfo.Text;
+
+ var commandArrayInfoSet = commandArrayInfo as CommandInfoSet;
+ if (commandArrayInfoSet != null) {
+ foreach (var item in commandArrayInfoSet.CommandInfos) {
+ if (item.IsArraySeparator)
+ Items.Add (new Separator { UseLayoutRounding = true, });
+ else
+ Items.Add (new TitleMenuItem (manager, entry, item, commandSource, initialCommandTarget, menu));
+ }
+ }
+ }
+
+ if (menuEntrySet != null) {
+ Header = menuEntrySet.Name;
+
+ foreach (CommandEntry item in menuEntrySet) {
+ if (item.CommandId == MonoDevelop.Components.Commands.Command.Separator) {
+ Items.Add (new Separator { UseLayoutRounding = true, });
+ } else
+ Items.Add (new TitleMenuItem (manager, item, menu: menu));
+ }
+ } else if (menuLinkEntry != null) {
+ Header = menuLinkEntry.Text;
+ Click += OnMenuLinkClicked;
+ } else if (entry != null) {
+ actionCommand = manager.GetCommand (menuEntry.CommandId) as ActionCommand;
+ if (actionCommand == null)
+ return;
+
+ IsCheckable = actionCommand.ActionType == ActionType.Check;
+
+ // FIXME: Use proper keybinding text.
+ if (actionCommand.KeyBinding != null)
+ InputGestureText = actionCommand.KeyBinding.ToString ();
+
+ try {
+ if (!actionCommand.Icon.IsNull)
+ Icon = new ImageBox (actionCommand.Icon.GetStockIcon ().WithSize (Xwt.IconSize.Small));
+ } catch (Exception ex) {
+ MonoDevelop.Core.LoggingService.LogError ("Failed loading menu icon: " + actionCommand.Icon, ex);
+ }
+ Click += OnMenuClicked;
+ }
+
+ Height = SystemParameters.CaptionHeight;
+ UseLayoutRounding = true;
+ }
+
+ Menu menu;
+
+ /// <summary>
+ /// Updates a command entry. Should only be called from a toplevel node.
+ /// This will update all the menu's children.
+ /// </summary>
+ void Update ()
+ {
+ hasCommand = false;
+ if (menuLinkEntry != null)
+ return;
+
+ if (menuEntrySet != null || commandArrayInfo is CommandInfoSet) {
+ for (int i = 0; i < Items.Count; ++i) {
+ var titleMenuItem = Items[i] as TitleMenuItem;
+
+ if (titleMenuItem != null) {
+ titleMenuItem.Update ();
+ continue;
+ }
+
+ // If we have a separator, don't draw another one if the previous visible item is a separator.
+ var separatorMenuItem = Items [i] as Separator;
+ separatorMenuItem.Visibility = Visibility.Collapsed;
+ for (int j = i - 1; j >= 0; --j) {
+ var iterMenuItem = Items [j] as Control;
+
+ if (iterMenuItem is Separator)
+ break;
+
+ if (iterMenuItem.Visibility != Visibility.Visible)
+ continue;
+
+ separatorMenuItem.Visibility = Visibility.Visible;
+ break;
+ }
+ }
+ if (menuEntrySet != null && menuEntrySet.AutoHide)
+ Visibility = Items.Cast<Control> ().Any (item => item.Visibility == Visibility.Visible) ? Visibility.Visible : Visibility.Collapsed;
+ return;
+ }
+
+ var info = manager.GetCommandInfo (menuEntry.CommandId, new CommandTargetRoute (initialCommandTarget));
+ if (actionCommand != null) {
+ if (!string.IsNullOrEmpty (info.Description) && (string)ToolTip != info.Description)
+ ToolTip = info.Description;
+
+ if (actionCommand.CommandArray && commandArrayInfo == null) {
+ Visibility = Visibility.Collapsed;
+
+ var parent = (TitleMenuItem)Parent;
+
+ int count = 1;
+ int indexOfThis = parent.Items.IndexOf (this);
+ foreach (var child in info.ArrayInfo) {
+ Control toAdd;
+ if (child.IsArraySeparator) {
+ toAdd = new Separator ();
+ } else {
+ toAdd = new TitleMenuItem (manager, menuEntry, child, menu: menu);
+ }
+
+ toRemoveFromParent.Add (toAdd);
+ parent.Items.Insert (indexOfThis + (count++), toAdd);
+ }
+ return;
+ }
+ }
+
+ SetInfo (commandArrayInfo != null ? commandArrayInfo : info);
+ }
+
+ bool hasCommand = false;
+ void SetInfo (CommandInfo info)
+ {
+ hasCommand = true;
+ Header = info.Text;
+ try {
+ if (!info.Icon.IsNull)
+ Icon = new ImageBox (info.Icon.GetStockIcon ().WithSize (Xwt.IconSize.Small));
+ } catch (Exception ex) {
+ MonoDevelop.Core.LoggingService.LogError ("Failed loading menu icon: " + info.Icon, ex);
+ }
+ IsEnabled = info.Enabled;
+ Visibility = info.Visible && (menuEntry.DisabledVisible || IsEnabled) ?
+ Visibility.Visible : Visibility.Collapsed;
+ IsChecked = info.Checked || info.CheckedInconsistent;
+ ToolTip = info.Description;
+ }
+
+ /// <summary>
+ /// Clears a command entry's saved data. Should only be called from a toplevel node.
+ /// This will update all the menu's children.
+ /// </summary>
+ IEnumerable<Control> Clear ()
+ {
+ if (menuLinkEntry != null) {
+ return Enumerable.Empty<TitleMenuItem> ();
+ }
+
+ if (menuEntrySet != null) {
+ var toRemove = Enumerable.Empty<Control> ();
+ foreach (var item in Items) {
+ var titleMenuItem = item as TitleMenuItem;
+ if (titleMenuItem == null)
+ continue;
+
+ toRemove = toRemove.Concat (titleMenuItem.Clear ());
+ }
+
+ foreach (var item in toRemove)
+ Items.Remove (item);
+
+ return Enumerable.Empty<TitleMenuItem> ();
+ }
+
+ var ret = toRemoveFromParent;
+ toRemoveFromParent = new List<Control> ();
+ return ret;
+ }
+
+ static bool closingSent;
+ protected override void OnSubmenuOpened (RoutedEventArgs e)
+ {
+ if (Parent is Menu) {
+ Update ();
+ closingSent = false;
+ }
+
+ base.OnSubmenuOpened (e);
+ }
+
+
+ protected override void OnSubmenuClosed (RoutedEventArgs e)
+ {
+ if (Parent is Menu)
+ Clear ();
+
+ if (!closingSent) {
+ OnSubmenuClosing ();
+ closingSent = false;
+ }
+
+ base.OnSubmenuClosed (e);
+ }
+
+ void OnMenuClicked (object sender, RoutedEventArgs e)
+ {
+ if (!hasCommand)
+ return;
+
+ closingSent = true;
+ OnSubmenuClosing ();
+
+ Xwt.Application.Invoke(() => {
+ if (commandArrayInfo != null) {
+ manager.DispatchCommand (menuEntry.CommandId, commandArrayInfo.DataItem, initialCommandTarget, commandSource);
+ } else {
+ manager.DispatchCommand (menuEntry.CommandId, null, initialCommandTarget, commandSource);
+ }
+ });
+ }
+
+ void OnMenuLinkClicked (object sender, RoutedEventArgs e)
+ {
+ DesktopService.ShowUrl (menuLinkEntry.Url);
+ }
+
+ void OnSubmenuClosing ()
+ {
+ bool shouldFocusIde = !menu.Items.OfType<MenuItem> ().Any (mi => mi.IsSubmenuOpen);
+ if (shouldFocusIde)
+ IdeApp.Workbench.RootWindow.Present ();
+ }
+
+ readonly MonoDevelop.Components.Commands.CommandManager manager;
+ readonly object initialCommandTarget;
+ readonly CommandSource commandSource;
+ readonly CommandInfo commandArrayInfo;
+ readonly ActionCommand actionCommand;
+ readonly CommandEntry menuEntry;
+ readonly CommandEntrySet menuEntrySet;
+ readonly LinkCommandEntry menuLinkEntry;
+ List<Control> toRemoveFromParent = new List<Control> ();
+ }
+}
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/ToolBar.xaml b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/ToolBar.xaml
new file mode 100644
index 0000000000..2dbefe0880
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/ToolBar.xaml
@@ -0,0 +1,33 @@
+<UserControl x:Class="WindowsPlatform.MainToolbar.ToolBar"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:local="clr-namespace:WindowsPlatform.MainToolbar"
+ xmlns:platform="clr-namespace:WindowsPlatform"
+ mc:Ignorable="d"
+ Background="{Binding Path=(platform:Styles.MainToolbarBackgroundBrush), Mode=OneWay}"
+ Foreground="{Binding Path=(platform:Styles.MainToolbarForegroundBrush), Mode=OneWay}"
+ BorderBrush="{Binding Path=(platform:Styles.MainToolbarShadowBrush), Mode=OneWay}"
+ BorderThickness="0, 0, 0, 0.5">
+ <UserControl.Resources>
+ <local:NotNullConverter x:Key="NotNullConverter" />
+ </UserControl.Resources>
+ <UniformGrid x:Name="DockTitle" Height="32" Margin="20,0,9,0" Background="Transparent" UseLayoutRounding="True" Rows="1" Columns="3">
+ <StackPanel x:Name="LeftPanel" Grid.Row="1" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Left" Height="Auto" UseLayoutRounding="True">
+ <local:RunButtonControl x:Name="RunButton" VerticalContentAlignment="Center" VerticalAlignment="Center" UseLayoutRounding="True" />
+ <Separator Opacity="0" Width="10" UseLayoutRounding="True" />
+ <local:ConfigurationComboMenu x:Name="ConfigurationMenu" VerticalContentAlignment="Center" Background="Transparent" VerticalAlignment="Center" UseLayoutRounding="True" />
+ <Separator Opacity="0" Width="10" UseLayoutRounding="True" />
+ <local:RuntimeComboMenu x:Name="RuntimeMenu" VerticalContentAlignment="Center" Background="Transparent" VerticalAlignment="Center" UseLayoutRounding="True" />
+ <Separator Opacity="0" Width="5" UseLayoutRounding="True" />
+ <StackPanel x:Name="ButtonBarPanel" Orientation="Horizontal" UseLayoutRounding="True" />
+ </StackPanel>
+ <StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center" Height="Auto" UseLayoutRounding="True">
+ <local:StatusBarControl x:Name="StatusBar" VerticalContentAlignment="Center" VerticalAlignment="Center" UseLayoutRounding="True" />
+ </StackPanel>
+ <StackPanel Grid.Row="1" Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right" Height="Auto" UseLayoutRounding="True">
+ <local:SearchBarControl x:Name="SearchBar" VerticalContentAlignment="Center" VerticalAlignment="Center" UseLayoutRounding="True" />
+ </StackPanel>
+ </UniformGrid>
+</UserControl>
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/Toolbar.xaml.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/Toolbar.xaml.cs
new file mode 100644
index 0000000000..afaa3144f0
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/Toolbar.xaml.cs
@@ -0,0 +1,29 @@
+using MonoDevelop.Components.MainToolbar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace WindowsPlatform.MainToolbar
+{
+ /// <summary>
+ /// Interaction logic for Toolbar.xaml
+ /// </summary>
+ public partial class ToolBar : UserControl
+ {
+ public ToolBar ()
+ {
+ InitializeComponent ();
+ }
+ }
+}
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFToolbar.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFToolbar.cs
new file mode 100644
index 0000000000..5182f66273
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFToolbar.cs
@@ -0,0 +1,276 @@
+using MonoDevelop.Components.MainToolbar;
+using MonoDevelop.Components.Windows;
+using MonoDevelop.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Gtk;
+using MonoDevelop.Ide;
+using Xwt;
+using Xwt.WPFBackend;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+using System.Windows.Threading;
+using System.Globalization;
+using System.Windows.Data;
+using System.Runtime.CompilerServices;
+using System.Windows.Controls;
+using System.Windows.Media;
+
+namespace WindowsPlatform.MainToolbar
+{
+ public class WPFToolbar : GtkWPFWidget, IMainToolbarView, INotifyPropertyChanged
+ {
+ ToolBar toolbar;
+ WPFToolbar (ToolBar toolbar) : base (toolbar)
+ {
+ this.toolbar = toolbar;
+
+ toolbar.ConfigurationMenu.SelectionChanged += (o, e) => {
+ var comboMenu = (ComboMenu<IConfigurationModel>)o;
+ var newModel = e.Added;
+ if (newModel == null)
+ return;
+
+ Runtime.RunInMainThread(() => {
+ ActiveConfiguration = newModel;
+
+ if (ConfigurationChanged != null)
+ ConfigurationChanged(o, e);
+ });
+ };
+
+ toolbar.RuntimeMenu.SelectionChanged += (o, e) => {
+ var newModel = e.Added;
+ if (newModel == null)
+ return;
+
+ using (var mutableModel = newModel.GetMutableModel()) {
+ Runtime.RunInMainThread(() => {
+ ActiveRuntime = newModel;
+
+ var ea = new MonoDevelop.Components.MainToolbar.HandledEventArgs();
+ if (RuntimeChanged != null)
+ RuntimeChanged(o, ea);
+
+ if (ea.Handled)
+ ActiveRuntime = e.Removed;
+ });
+ }
+ };
+
+ toolbar.RunButton.Click += (o, e) => {
+ if (RunButtonClicked != null)
+ RunButtonClicked (o, e);
+ };
+
+ toolbar.SearchBar.SearchBar.TextChanged += (o, e) => {
+ if (string.IsNullOrEmpty (SearchText) || SearchText == SearchPlaceholderMessage)
+ return;
+
+ if (SearchEntryChanged != null)
+ SearchEntryChanged (o, e);
+ };
+
+ toolbar.SearchBar.SearchBar.LostKeyboardFocus += (o, e) => {
+ if (SearchEntryLostFocus != null)
+ SearchEntryLostFocus (o, e);
+ toolbar.SearchBar.SearchText = toolbar.SearchBar.PlaceholderText;
+ };
+
+ toolbar.SearchBar.SearchBar.GotKeyboardFocus += (o, e) => {
+ SearchEntryActivated?.Invoke (o, e);
+ };
+
+ toolbar.SearchBar.SearchBar.SizeChanged += (o, e) => {
+ if (SearchEntryResized != null)
+ SearchEntryResized (o, e);
+ };
+
+ toolbar.SearchBar.SearchBar.PreviewKeyDown += (o, e) => {
+ var ka = new KeyEventArgs(KeyboardUtil.TranslateToXwtKey(e.Key), KeyboardUtil.GetModifiers(), e.IsRepeat, e.Timestamp);
+ SendKeyPress(ka);
+ e.Handled = ka.Handled;
+ };
+
+ toolbar.SearchBar.ClearIconClicked += (o, e) =>
+ {
+ SendKeyPress(new KeyEventArgs(Xwt.Key.Escape, KeyboardUtil.GetModifiers(), false, 0));
+ };
+ }
+
+ void SendKeyPress(KeyEventArgs ka)
+ {
+ if (SearchEntryKeyPressed != null)
+ SearchEntryKeyPressed(this, ka);
+ }
+
+ public WPFToolbar () : this (new ToolBar ())
+ {
+ }
+
+ public IConfigurationModel ActiveConfiguration {
+ get { return toolbar.ConfigurationMenu.Active; }
+ set { toolbar.ConfigurationMenu.Active = value; }
+ }
+
+ public IRuntimeModel ActiveRuntime {
+ get { return toolbar.RuntimeMenu.Active; }
+ set { toolbar.RuntimeMenu.Active = value; }
+ }
+
+ public bool ButtonBarSensitivity {
+ set { toolbar.ButtonBarPanel.IsEnabled = value; }
+ }
+
+ public IEnumerable<IConfigurationModel> ConfigurationModel {
+ get { return toolbar.ConfigurationMenu.Model; }
+ set { toolbar.ConfigurationMenu.Model = value; }
+ }
+
+ bool configurationPlatformSensitivity;
+ public bool ConfigurationPlatformSensitivity {
+ get { return configurationPlatformSensitivity; }
+ set {
+ configurationPlatformSensitivity = value;
+ toolbar.ConfigurationMenu.IsEnabled = value && ConfigurationModel.Count() > 1;
+ toolbar.RuntimeMenu.IsEnabled = value && RuntimeModel.Count() > 1;
+ }
+ }
+
+ public bool PlatformSensitivity {
+ set {
+ toolbar.RuntimeMenu.IsEnabled = value && RuntimeModel.Count() > 1;
+ }
+ }
+
+ public Gtk.Widget PopupAnchor {
+ get {
+ return this;
+ }
+ }
+
+ public OperationIcon RunButtonIcon {
+ set { toolbar.RunButton.Icon = value; }
+ }
+
+ public bool RunButtonSensitivity {
+ get { return toolbar.RunButton.IsEnabled; }
+ set { toolbar.RunButton.IsEnabled = value; }
+ }
+
+ public IEnumerable<IRuntimeModel> RuntimeModel {
+ get { return toolbar.RuntimeMenu.Model; }
+ set { toolbar.RuntimeMenu.Model = value; }
+ }
+
+ public string SearchCategory {
+ set {
+ toolbar.SearchBar.SearchText = value;
+ FocusSearchBar ();
+ toolbar.SearchBar.SearchBar.Select (value.Length, 0);
+ }
+ }
+
+ public IEnumerable<ISearchMenuModel> SearchMenuItems {
+ set {
+ toolbar.SearchBar.SearchMenuItems = value;
+ }
+ }
+
+ public string SearchPlaceholderMessage {
+ get { return toolbar.SearchBar.PlaceholderText; }
+ set { toolbar.SearchBar.PlaceholderText = value; }
+ }
+
+ public bool SearchSensivitity {
+ set { toolbar.SearchBar.IsEnabled = value; }
+ }
+
+ public string SearchText {
+ get { return toolbar.SearchBar.SearchText; }
+ set {
+ toolbar.SearchBar.SearchText = value;
+
+ if (value != SearchPlaceholderMessage) {
+ toolbar.SearchBar.SearchBar.SelectAll ();
+ }
+ }
+ }
+
+ public StatusBar StatusBar {
+ get { return toolbar.StatusBar; }
+ }
+
+ public event EventHandler ConfigurationChanged;
+ public event EventHandler RunButtonClicked;
+ public event EventHandler<MonoDevelop.Components.MainToolbar.HandledEventArgs> RuntimeChanged;
+ public event EventHandler SearchEntryActivated;
+ public event EventHandler SearchEntryChanged;
+ public event EventHandler<KeyEventArgs> SearchEntryKeyPressed;
+ public event EventHandler SearchEntryLostFocus;
+ public event EventHandler SearchEntryResized;
+
+ public void FocusSearchBar ()
+ {
+ toolbar.SearchBar.SearchBar.Focus ();
+ }
+
+ public void RebuildToolbar (IEnumerable<IButtonBarButton> buttons)
+ {
+ foreach (var item in toolbar.ButtonBarPanel.Children.OfType<IDisposable> ())
+ item.Dispose ();
+
+ toolbar.ButtonBarPanel.Children.Clear ();
+
+ if (!buttons.Any ())
+ return;
+
+ var sepStyle = toolbar.FindResource (System.Windows.Controls.ToolBar.SeparatorStyleKey) as System.Windows.Style;
+
+ bool needsSeparator = true;
+ foreach (var button in buttons) {
+ if (button.IsSeparator) {
+ needsSeparator = true;
+ continue;
+ }
+
+ if (needsSeparator)
+ toolbar.ButtonBarPanel.Children.Add (new DottedSeparator {
+ Margin = new System.Windows.Thickness {
+ Left = 3,
+ Right = 3,
+ },
+ UseLayoutRounding = true,
+ });
+
+ toolbar.ButtonBarPanel.Children.Add (new ButtonBarButton (button));
+ needsSeparator = false;
+ }
+ }
+
+ void RaisePropertyChanged ([CallerMemberName] string propName = null)
+ {
+ if (PropertyChanged != null)
+ PropertyChanged (this, new System.ComponentModel.PropertyChangedEventArgs (propName));
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+ }
+
+ public class NotNullConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return value != null;
+ }
+
+ public object ConvertBack (object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/Styles.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/Styles.cs
new file mode 100644
index 0000000000..400adbb662
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/Styles.cs
@@ -0,0 +1,364 @@
+//
+// Styles.cs
+//
+// Author:
+// Vsevolod Kukol <sevo@sevo.org>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
+using System.Windows;
+using System.Windows.Media;
+using MonoDevelop.Ide;
+
+namespace WindowsPlatform
+{
+ public static class Styles
+ {
+ static Brush mainToolbarBackgroundBrush;
+ static Brush mainToolbarForegroundBrush;
+ static Brush mainToolbarDisabledForegroundBrush;
+ static Brush mainToolbarShadowBrush;
+ static Brush mainToolbarSeparatorBrush;
+ static Brush mainToolbarButtonPressedBackgroundBrush;
+ static Brush mainToolbarButtonPressedBorderBrush;
+ static Brush menuBarBackgroundBrush;
+ static Brush menuBarForegroundBrush;
+ static Brush menuBarBorderBrush;
+ static Brush menuBarHighlightBackgroundBrush;
+ static Brush menuBarHighlightBorderBrush;
+
+ static Brush menuBackgroundBrush;
+ static Brush menuForegroundBrush;
+ static Brush menuBorderBrush;
+ static Brush menuHighlightBackgroundBrush;
+ static Brush menuHighlightBorderBrush;
+ static Brush menuSelectedBackgroundBrush;
+ static Brush menuSelectedBorderBrush;
+ static Brush menuDisabledForegroundBrush;
+ static Brush menuSeparatorBrush;
+
+ static Brush statusBarBackgroundBrush;
+ static Brush statusBarTextBrush;
+ static Brush statusBarErrorTextBrush;
+ static Brush statusBarWarningTextBrush;
+ static Brush statusBarReadyTextBrush;
+ static Brush statusBarProgressBorderBrush;
+ static Brush statusBarProgressBackgroundBrush;
+ static Brush searchBarBorderBrush;
+ static Brush searchBarBackgroundBrush;
+ static Brush searchBarTextBrush;
+
+ static Brush tooltipBackgroundBrush;
+ static Brush tooltipBorderBrush;
+ static Brush tooltipTextBrush;
+
+ public static Brush MainToolbarBackgroundBrush {
+ get { return mainToolbarBackgroundBrush; }
+ private set { mainToolbarBackgroundBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush MainToolbarForegroundBrush {
+ get { return mainToolbarForegroundBrush; }
+ private set { mainToolbarForegroundBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush MainToolbarDisabledForegroundBrush {
+ get { return mainToolbarDisabledForegroundBrush; }
+ private set { mainToolbarDisabledForegroundBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush MainToolbarShadowBrush {
+ get { return mainToolbarShadowBrush; }
+ private set { mainToolbarShadowBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush MainToolbarSeparatorBrush {
+ get { return mainToolbarSeparatorBrush; }
+ private set { mainToolbarSeparatorBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush MainToolbarButtonPressedBackgroundBrush {
+ get { return mainToolbarButtonPressedBackgroundBrush; }
+ set { mainToolbarButtonPressedBackgroundBrush = value; RaisePropertyChanged (); }
+ }
+
+
+ public static Brush MainToolbarButtonPressedBorderBrush {
+ get { return mainToolbarButtonPressedBorderBrush; }
+ set { mainToolbarButtonPressedBorderBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush MenuBarBackgroundBrush {
+ get { return menuBarBackgroundBrush; }
+ private set { menuBarBackgroundBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush MenuBarForegroundBrush {
+ get { return menuBarForegroundBrush; }
+ private set { menuBarForegroundBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush MenuBarBorderBrush {
+ get { return menuBarBorderBrush; }
+ private set { menuBarBorderBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush MenuBarHighlightBackgroundBrush {
+ get { return menuBarHighlightBackgroundBrush; }
+ private set { menuBarHighlightBackgroundBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush MenuBarHighlightBorderBrush {
+ get { return menuBarHighlightBorderBrush; }
+ private set { menuBarHighlightBorderBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush MenuBackgroundBrush {
+ get { return menuBackgroundBrush; }
+ private set { menuBackgroundBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush MenuForegroundBrush {
+ get { return menuForegroundBrush; }
+ private set { menuForegroundBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush MenuBorderBrush {
+ get { return menuBorderBrush; }
+ private set { menuBorderBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush MenuHighlightBackgroundBrush {
+ get { return menuHighlightBackgroundBrush; }
+ private set { menuHighlightBackgroundBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush MenuHighlightBorderBrush {
+ get { return menuHighlightBorderBrush; }
+ private set { menuHighlightBorderBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush MenuSelectedBackgroundBrush {
+ get { return menuSelectedBackgroundBrush; }
+ private set { menuSelectedBackgroundBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush MenuSelectedBorderBrush {
+ get { return menuSelectedBorderBrush; }
+ private set { menuSelectedBorderBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush MenuDisabledForegroundBrush {
+ get { return menuDisabledForegroundBrush; }
+ private set { menuDisabledForegroundBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush MenuSeparatorBrush {
+ get { return menuSeparatorBrush; }
+ set { menuSeparatorBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush StatusBarBackgroundBrush {
+ get { return statusBarBackgroundBrush; }
+ private set { statusBarBackgroundBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush StatusBarTextBrush {
+ get { return statusBarTextBrush; }
+ private set { statusBarTextBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush StatusBarErrorTextBrush {
+ get { return statusBarErrorTextBrush; }
+ private set { statusBarErrorTextBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush StatusBarWarningTextBrush {
+ get { return statusBarWarningTextBrush; }
+ private set { statusBarWarningTextBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush StatusBarReadyTextBrush {
+ get { return statusBarReadyTextBrush; }
+ private set { statusBarReadyTextBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush StatusBarProgressBorderBrush {
+ get { return statusBarProgressBorderBrush; }
+ private set { statusBarProgressBorderBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush StatusBarProgressBackgroundBrush {
+ get { return statusBarProgressBackgroundBrush; }
+ private set { statusBarProgressBackgroundBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush SearchBarBorderBrush {
+ get { return searchBarBorderBrush; }
+ private set { searchBarBorderBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush SearchBarBackgroundBrush {
+ get { return searchBarBackgroundBrush; }
+ private set { searchBarBackgroundBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush SearchBarTextBrush {
+ get { return searchBarTextBrush; }
+ private set { searchBarTextBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush TooltipBackgroundBrush {
+ get { return tooltipBackgroundBrush; }
+ private set { tooltipBackgroundBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush TooltipBorderBrush {
+ get { return tooltipBorderBrush; }
+ private set { tooltipBorderBrush = value; RaisePropertyChanged (); }
+ }
+
+ public static Brush TooltipTextBrush {
+ get { return tooltipTextBrush; }
+ private set { tooltipTextBrush = value; RaisePropertyChanged (); }
+ }
+
+ static Styles ()
+ {
+ Xwt.Drawing.Context.RegisterStyles ("hover", "pressed", "disabled");
+ LoadStyles ();
+ MonoDevelop.Ide.Gui.Styles.Changed += (o, e) => LoadStyles ();
+ }
+
+ public static Color ColorFromHex (string s, double alpha = 1.0)
+ {
+ if (s.StartsWith ("#", StringComparison.Ordinal))
+ s = s.Substring (1);
+ if (s.Length == 3)
+ s = "" + s[0]+s[0]+s[1]+s[1]+s[2]+s[2];
+ byte r = byte.Parse (s.Substring (0,2), System.Globalization.NumberStyles.HexNumber);
+ byte g = byte.Parse (s.Substring (2,2), System.Globalization.NumberStyles.HexNumber);
+ byte b = byte.Parse (s.Substring (4,2), System.Globalization.NumberStyles.HexNumber);
+ byte a = (byte)(alpha * 255d);
+ return new Color { R = r, G = g, B = b, A = a };
+ }
+
+ public static Color WithAlpha (this Color color, double alpha)
+ {
+ color.A = (byte)(alpha * 255d);
+ return color;
+ }
+
+ public static void LoadStyles ()
+ {
+ if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light) {
+ MainToolbarBackgroundBrush = new SolidColorBrush (ColorFromHex("FFFFFF", 0));
+ MainToolbarForegroundBrush = new SolidColorBrush (ColorFromHex("222222"));
+ MainToolbarDisabledForegroundBrush = new SolidColorBrush (ColorFromHex("808080"));
+ MainToolbarShadowBrush = new SolidColorBrush (ColorFromHex("808080"));
+ MainToolbarSeparatorBrush = new SolidColorBrush (ColorFromHex("7D7D7D"));
+ MainToolbarButtonPressedBackgroundBrush = new SolidColorBrush (ColorFromHex("008BFF", 0.4));
+ MainToolbarButtonPressedBorderBrush = new SolidColorBrush (ColorFromHex("008BFF", 0.4));
+
+ MenuBarBackgroundBrush = SystemColors.MenuBarBrush;
+ MenuBarForegroundBrush = SystemColors.MenuTextBrush;
+ MenuBarBorderBrush = new SolidColorBrush (ColorFromHex("999999"));
+ MenuBarHighlightBackgroundBrush = new SolidColorBrush (ColorFromHex("C3E3FE"));
+ MenuBarHighlightBorderBrush = new SolidColorBrush (ColorFromHex("C3E3FE"));
+
+ MenuBackgroundBrush = new SolidColorBrush (ColorFromHex("FFFFFF"));
+ MenuForegroundBrush = new SolidColorBrush (ColorFromHex("000000"));
+ MenuBorderBrush = new SolidColorBrush (ColorFromHex("999999"));
+ MenuSeparatorBrush = new SolidColorBrush (ColorFromHex("EAEAEA"));
+ MenuHighlightBackgroundBrush = new SolidColorBrush (ColorFromHex("008BFF", 0.2));
+ MenuHighlightBorderBrush = new SolidColorBrush (ColorFromHex("008BFF", 0.2));
+ MenuSelectedBackgroundBrush = new SolidColorBrush (ColorFromHex("008BFF", 0.2));
+ MenuSelectedBorderBrush = new SolidColorBrush (ColorFromHex("008BFF", 0.2));
+ MenuDisabledForegroundBrush = new SolidColorBrush (ColorFromHex("A0A0A0"));
+
+ StatusBarBackgroundBrush = new SolidColorBrush (ColorFromHex("E5E5E5"));
+ StatusBarTextBrush = MainToolbarForegroundBrush;
+ StatusBarErrorTextBrush = StatusBarTextBrush;
+ StatusBarWarningTextBrush = StatusBarTextBrush;
+ StatusBarReadyTextBrush = new SolidColorBrush (ColorFromHex("808080"));
+ StatusBarProgressBorderBrush = new SolidColorBrush (ColorFromHex("D9DCE1"));
+ StatusBarProgressBackgroundBrush = new SolidColorBrush (ColorFromHex("B3E770"));
+ SearchBarBorderBrush = new SolidColorBrush (ColorFromHex("D3D3D3"));
+ SearchBarBackgroundBrush = new SolidColorBrush (ColorFromHex("FFFFFF"));
+ SearchBarTextBrush = MainToolbarForegroundBrush;
+
+ TooltipBackgroundBrush = new SolidColorBrush (ColorFromHex("f2f2f2"));
+ TooltipBorderBrush = new SolidColorBrush (ColorFromHex("b2b2b2"));
+ TooltipTextBrush = new SolidColorBrush (ColorFromHex("222222"));
+ } else {
+ MainToolbarBackgroundBrush = new SolidColorBrush (ColorFromHex("303030"));
+ MainToolbarForegroundBrush = new SolidColorBrush (ColorFromHex("bfbfbf"));
+ MainToolbarDisabledForegroundBrush = new SolidColorBrush (ColorFromHex("808080"));
+ MainToolbarShadowBrush = new SolidColorBrush (ColorFromHex("747474"));
+ MainToolbarSeparatorBrush = new SolidColorBrush (ColorFromHex("7D7D7D"));
+ MainToolbarButtonPressedBackgroundBrush = new SolidColorBrush (ColorFromHex("008BFF", 0.4));
+ MainToolbarButtonPressedBorderBrush = new SolidColorBrush (ColorFromHex("008BFF", 0.4));
+
+ MenuBarBackgroundBrush = MainToolbarBackgroundBrush;
+ MenuBarForegroundBrush = MainToolbarForegroundBrush;
+ MenuBarBorderBrush = new SolidColorBrush (ColorFromHex("5D5D5D"));
+ MenuBarHighlightBackgroundBrush = new SolidColorBrush (ColorFromHex("8ECAFF", 0.3));
+ MenuBarHighlightBorderBrush = new SolidColorBrush (ColorFromHex("8ECAFF", 0.3));
+
+ MenuBackgroundBrush = MainToolbarBackgroundBrush;
+ MenuForegroundBrush = MainToolbarForegroundBrush;
+ MenuBorderBrush = new SolidColorBrush (ColorFromHex("5D5D5D"));
+ MenuSeparatorBrush = new SolidColorBrush (ColorFromHex("444444"));
+ MenuHighlightBackgroundBrush = new SolidColorBrush (ColorFromHex("8ECAFF", 0.3));
+ MenuHighlightBorderBrush = new SolidColorBrush (ColorFromHex("8ECAFF", 0.3));
+ MenuSelectedBackgroundBrush = MenuHighlightBackgroundBrush;
+ MenuSelectedBorderBrush = MenuHighlightBorderBrush;
+ MenuDisabledForegroundBrush = new SolidColorBrush (ColorFromHex("707070"));
+
+ StatusBarBackgroundBrush = new SolidColorBrush (ColorFromHex("3D3D3D"));
+ StatusBarTextBrush = MainToolbarForegroundBrush;
+ StatusBarErrorTextBrush = StatusBarTextBrush;
+ StatusBarWarningTextBrush = StatusBarTextBrush;
+ StatusBarReadyTextBrush = new SolidColorBrush (ColorFromHex("D3D3D3"));
+ StatusBarProgressBorderBrush = new SolidColorBrush (ColorFromHex("444444"));
+ StatusBarProgressBackgroundBrush = new SolidColorBrush (ColorFromHex("516833"));
+ SearchBarBorderBrush = new SolidColorBrush (ColorFromHex("1A1A1A"));
+ SearchBarBackgroundBrush = new SolidColorBrush (ColorFromHex("222222"));
+ SearchBarTextBrush = MainToolbarForegroundBrush;
+
+ TooltipBackgroundBrush = new SolidColorBrush (ColorFromHex("5a5a5a"));
+ TooltipBorderBrush = new SolidColorBrush (ColorFromHex("b2b2b2"));
+ TooltipTextBrush = new SolidColorBrush (ColorFromHex("d2d5cd"));
+ }
+ }
+
+ public static event EventHandler<PropertyChangedEventArgs> StaticPropertyChanged;
+
+ static void RaisePropertyChanged ([CallerMemberName] string propName = null)
+ {
+ if (StaticPropertyChanged != null)
+ StaticPropertyChanged (null, new PropertyChangedEventArgs (propName));
+ }
+ }
+}
+
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/Styles.xaml b/main/src/addins/WindowsPlatform/WindowsPlatform/Styles.xaml
new file mode 100644
index 0000000000..9184782887
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/Styles.xaml
@@ -0,0 +1,640 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:ui="clr-namespace:System.Windows.Documents;assembly=PresentationUI"
+ xmlns:platform="clr-namespace:WindowsPlatform">
+
+ <Style x:Key="FlatProgressBar" TargetType="{x:Type ProgressBar}">
+ <Setter Property="Background" Value="Transparent"/>
+ <Setter Property="Foreground" Value="{Binding Path=(platform:Styles.StatusBarProgressBackgroundBrush), Mode=OneWay}"/>
+ <Setter Property="BorderBrush" Value="{Binding Path=(platform:Styles.StatusBarProgressBorderBrush), Mode=OneWay}"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="ProgressBar">
+ <Border BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="0" CornerRadius="0" Padding="0">
+ <Grid x:Name="PART_Track">
+ <Rectangle x:Name="PART_Indicator" HorizontalAlignment="Left" Fill="{TemplateBinding Foreground}" />
+ </Grid>
+ </Border>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <MenuScrollingVisibilityConverter x:Key="MenuScrollingVisibilityConverter"/>
+ <Geometry x:Key="DownArrow"> M 0,0 L 3.5,4 L 7,0 Z</Geometry>
+ <Geometry x:Key="UpArrow"> M 0,4 L 3.5,0 L 7,4 Z</Geometry>
+ <Geometry x:Key="RightArrow">M 0,0 L 4,3.5 L 0,7 Z</Geometry>
+ <Geometry x:Key="Checkmark">F1 M 10.0,1.2 L 4.7,9.1 L 4.5,9.1 L 0,5.2 L 1.3,3.5 L 4.3,6.1L 8.3,0 L 10.0,1.2 Z</Geometry>
+
+ <Style TargetType="{x:Type Menu}">
+ <Setter Property="FontFamily" Value="{DynamicResource {x:Static SystemFonts.MenuFontFamilyKey}}"/>
+ <Setter Property="FontSize" Value="{DynamicResource {x:Static SystemFonts.MenuFontSizeKey}}"/>
+ <Setter Property="FontStyle" Value="{DynamicResource {x:Static SystemFonts.MenuFontStyleKey}}"/>
+ <Setter Property="FontWeight" Value="{DynamicResource {x:Static SystemFonts.MenuFontWeightKey}}"/>
+ <Setter Property="VerticalContentAlignment" Value="Center"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type Menu}">
+ <Border
+ Background="{Binding Path=(platform:Styles.MenuBarBackgroundBrush), Mode=OneWay}"
+ BorderBrush="{Binding Path=(platform:Styles.MenuBarBorderBrush), Mode=OneWay}"
+ BorderThickness="{TemplateBinding BorderThickness}"
+ Padding="{TemplateBinding Padding}"
+ SnapsToDevicePixels="true"
+ TextElement.Foreground="{Binding Path=(platform:Styles.MenuBarForegroundBrush), Mode=OneWay}">
+ <ItemsPresenter
+ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+ </Border>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="MenuScrollButton" TargetType="{x:Type RepeatButton}" BasedOn="{x:Null}" >
+ <Setter Property="ClickMode" Value="Hover"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type RepeatButton}">
+ <Border x:Name="templateRoot"
+ SnapsToDevicePixels="true"
+ Background="Transparent"
+ BorderBrush="Transparent"
+ BorderThickness="1">
+ <ContentPresenter
+ Margin="6"
+ HorizontalAlignment="Center"
+ VerticalAlignment="Center"/>
+ </Border>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type FrameworkElement}, ResourceId=MenuScrollViewer}" TargetType="{x:Type ScrollViewer}" BasedOn="{x:Null}">
+ <Setter Property="HorizontalScrollBarVisibility" Value="Hidden"/>
+ <Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type ScrollViewer}">
+ <Grid SnapsToDevicePixels="true">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*"/>
+ </Grid.ColumnDefinitions>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="*"/>
+ <RowDefinition Height="Auto"/>
+ </Grid.RowDefinitions>
+ <Border
+ Grid.Column="0"
+ Grid.Row="1">
+ <ScrollContentPresenter
+ Margin="{TemplateBinding Padding}"
+ CanContentScroll="{TemplateBinding CanContentScroll}"/>
+ </Border>
+ <RepeatButton
+ Grid.Column="0"
+ Grid.Row="0"
+ Style="{StaticResource MenuScrollButton}"
+ Command="{x:Static ScrollBar.LineUpCommand}"
+ CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
+ Focusable="false">
+ <RepeatButton.Visibility>
+ <MultiBinding ConverterParameter="0" Converter="{StaticResource MenuScrollingVisibilityConverter}" FallbackValue="Visibility.Collapsed">
+ <Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}"/>
+ <Binding Path="VerticalOffset" RelativeSource="{RelativeSource TemplatedParent}"/>
+ <Binding Path="ExtentHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
+ <Binding Path="ViewportHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
+ </MultiBinding>
+ </RepeatButton.Visibility>
+ <Path
+ Data="{StaticResource UpArrow}"
+ Fill="{Binding Path=(platform:Styles.MenuForegroundBrush), Mode=OneWay}" />
+ </RepeatButton>
+ <RepeatButton
+ Grid.Column="0"
+ Grid.Row="2"
+ Style="{StaticResource MenuScrollButton}"
+ Command="{x:Static ScrollBar.LineDownCommand}"
+ CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
+ Focusable="false">
+ <RepeatButton.Visibility>
+ <MultiBinding ConverterParameter="100" Converter="{StaticResource MenuScrollingVisibilityConverter}" FallbackValue="Visibility.Collapsed">
+ <Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}"/>
+ <Binding Path="VerticalOffset" RelativeSource="{RelativeSource TemplatedParent}"/>
+ <Binding Path="ExtentHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
+ <Binding Path="ViewportHeight" RelativeSource="{RelativeSource TemplatedParent}"/>
+ </MultiBinding>
+ </RepeatButton.Visibility>
+ <Path
+ Data="{StaticResource DownArrow}"
+ Fill="{Binding Path=(platform:Styles.MenuForegroundBrush), Mode=OneWay}" />
+ </RepeatButton>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="{x:Type Separator}">
+ <Setter Property="MinHeight" Value="1"/>
+ <Setter Property="SnapsToDevicePixels" Value="true"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type Separator}">
+ <Border Background="{Binding Path=(platform:Styles.MenuSeparatorBrush), Mode=OneWay}"
+ BorderBrush="{Binding Path=(platform:Styles.MenuSeparatorBrush), Mode=OneWay}"
+ BorderThickness="{TemplateBinding BorderThickness}"
+ Margin="30,0,0,0"/>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <ControlTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=TopLevelItemTemplateKey}" TargetType="{x:Type MenuItem}">
+ <Border x:Name="templateRoot"
+ SnapsToDevicePixels="true"
+ BorderThickness="{TemplateBinding BorderThickness}"
+ Background="Transparent"
+ BorderBrush="Transparent"
+ TextElement.Foreground="{Binding Path=(platform:Styles.MenuBarForegroundBrush), Mode=OneWay}">
+ <Grid VerticalAlignment="Center">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="Auto"/>
+ </Grid.ColumnDefinitions>
+ <ContentPresenter x:Name="Icon"
+ ContentSource="Icon"
+ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
+ VerticalAlignment="Center"
+ HorizontalAlignment="Center"
+ Width="16"
+ Height="16"
+ Margin="3" />
+ <Path x:Name="GlyphPanel"
+ Data="{StaticResource Checkmark}"
+ FlowDirection="LeftToRight"
+ Margin="3"
+ Visibility="Collapsed"
+ VerticalAlignment="Center"
+ Fill="{Binding Path=(platform:Styles.MenuBarForegroundBrush), Mode=OneWay}" />
+ <ContentPresenter
+ Grid.Column="1"
+ ContentSource="Header"
+ RecognizesAccessKey="True"
+ Margin="{TemplateBinding Padding}"
+ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+ </Grid>
+ </Border>
+ <ControlTemplate.Triggers>
+ <Trigger Property="Icon" Value="{x:Null}">
+ <Setter TargetName="Icon" Property="Visibility" Value="Collapsed"/>
+ </Trigger>
+ <Trigger Property="IsChecked" Value="true">
+ <Setter TargetName="GlyphPanel" Property="Visibility" Value="Visible"/>
+ <Setter TargetName="Icon" Property="Visibility" Value="Collapsed"/>
+ </Trigger>
+ <Trigger Property="IsHighlighted" Value="True">
+ <Setter TargetName="templateRoot" Property="Background" Value="{Binding Path=(platform:Styles.MenuHighlightBackgroundBrush), Mode=OneWay}" />
+ <Setter TargetName="templateRoot" Property="BorderBrush" Value="{Binding Path=(platform:Styles.MenuHighlightBorderBrush), Mode=OneWay}" />
+ </Trigger>
+ <Trigger Property="IsEnabled" Value="False">
+ <Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{Binding Path=(platform:Styles.MenuDisabledForegroundBrush), Mode=OneWay}" />
+ <Setter TargetName="GlyphPanel" Property="Fill" Value="{Binding Path=(platform:Styles.MenuDisabledForegroundBrush), Mode=OneWay}" />
+ </Trigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+
+ <ControlTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=TopLevelHeaderTemplateKey}" TargetType="{x:Type MenuItem}">
+ <Border x:Name="templateRoot"
+ SnapsToDevicePixels="true"
+ BorderThickness="{TemplateBinding BorderThickness}"
+ Background="Transparent"
+ BorderBrush="Transparent"
+ TextElement.Foreground="{Binding Path=(platform:Styles.MenuBarForegroundBrush), Mode=OneWay}">
+ <Grid VerticalAlignment="Center">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="Auto"/>
+ </Grid.ColumnDefinitions>
+ <ContentPresenter x:Name="Icon"
+ ContentSource="Icon"
+ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
+ VerticalAlignment="Center"
+ HorizontalAlignment="Center"
+ Width="16"
+ Height="16"
+ Margin="3"/>
+ <Path x:Name="GlyphPanel"
+ Data="{StaticResource Checkmark}"
+ FlowDirection="LeftToRight"
+ Margin="3"
+ Visibility="Collapsed"
+ VerticalAlignment="Center"
+ Fill="{Binding Path=(platform:Styles.MenuBarForegroundBrush), Mode=OneWay}" />
+ <ContentPresenter
+ Grid.Column="1"
+ ContentSource="Header"
+ RecognizesAccessKey="True"
+ Margin="{TemplateBinding MenuItem.Padding}"
+ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+ <Popup x:Name="PART_Popup"
+ AllowsTransparency="true"
+ Focusable="false"
+ IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
+ PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}"
+ Placement="Bottom"
+ PlacementTarget="{Binding ElementName=templateRoot}" >
+ <Border x:Name="SubMenuBorder"
+ Background="{Binding Path=(platform:Styles.MenuBackgroundBrush), Mode=OneWay}"
+ BorderBrush="{Binding Path=(platform:Styles.MenuBorderBrush), Mode=OneWay}"
+ BorderThickness="1"
+ Padding="2">
+ <ScrollViewer x:Name="SubMenuScrollViewer"
+ Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}">
+ <Grid RenderOptions.ClearTypeHint="Enabled">
+ <Canvas Height="0" Width="0" HorizontalAlignment="Left" VerticalAlignment="Top">
+ <Rectangle
+ Name="OpaqueRect"
+ Height="{Binding ElementName=SubMenuBorder,Path=ActualHeight}"
+ Width="{Binding ElementName=SubMenuBorder,Path=ActualWidth}"
+ Fill="{Binding ElementName=SubMenuBorder,Path=Background}" />
+ </Canvas>
+ <Rectangle HorizontalAlignment="Left"
+ Width="1"
+ Margin="29,2,0,2"
+ Fill="{Binding Path=(platform:Styles.MenuSeparatorBrush), Mode=OneWay}"/>
+ <ItemsPresenter x:Name="ItemsPresenter"
+ KeyboardNavigation.DirectionalNavigation="Cycle"
+ KeyboardNavigation.TabNavigation="Cycle"
+ Grid.IsSharedSizeScope="true"
+ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+ </Grid>
+ </ScrollViewer>
+ </Border>
+ </Popup>
+ </Grid>
+ </Border>
+ <ControlTemplate.Triggers>
+ <Trigger Property="IsSuspendingPopupAnimation" Value="true">
+ <Setter TargetName="PART_Popup" Property="PopupAnimation" Value="None"/>
+ </Trigger>
+ <Trigger Property="Icon" Value="{x:Null}">
+ <Setter TargetName="Icon" Property="Visibility" Value="Collapsed"/>
+ </Trigger>
+ <Trigger Property="IsChecked" Value="true">
+ <Setter TargetName="GlyphPanel" Property="Visibility" Value="Visible"/>
+ <Setter TargetName="Icon" Property="Visibility" Value="Collapsed"/>
+ </Trigger>
+ <Trigger Property="IsHighlighted" Value="True">
+ <Setter TargetName="templateRoot" Property="Background" Value="{Binding Path=(platform:Styles.MenuBarHighlightBackgroundBrush), Mode=OneWay}" />
+ <Setter TargetName="templateRoot" Property="BorderBrush" Value="{Binding Path=(platform:Styles.MenuBarHighlightBorderBrush), Mode=OneWay}" />
+ </Trigger>
+ <Trigger Property="IsEnabled" Value="False">
+ <Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{Binding Path=(platform:Styles.MenuDisabledForegroundBrush), Mode=OneWay}" />
+ <Setter TargetName="GlyphPanel" Property="Fill" Value="{Binding Path=(platform:Styles.MenuDisabledForegroundBrush), Mode=OneWay}" />
+ </Trigger>
+ <Trigger SourceName="SubMenuScrollViewer" Property="ScrollViewer.CanContentScroll" Value="false" >
+ <Setter TargetName="OpaqueRect" Property="Canvas.Top" Value="{Binding ElementName=SubMenuScrollViewer, Path=VerticalOffset}" />
+ <Setter TargetName="OpaqueRect" Property="Canvas.Left" Value="{Binding ElementName=SubMenuScrollViewer, Path=HorizontalOffset}" />
+ </Trigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+
+ <ControlTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=SubmenuItemTemplateKey}" TargetType="{x:Type MenuItem}">
+ <Border x:Name="templateRoot"
+ SnapsToDevicePixels="true"
+ Height="22"
+ BorderThickness="{TemplateBinding BorderThickness}"
+ Background="Transparent"
+ BorderBrush="Transparent"
+ TextElement.Foreground="{Binding Path=(platform:Styles.MenuForegroundBrush), Mode=OneWay}">
+ <Grid Margin="-1">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition MinWidth="22" SharedSizeGroup="MenuItemIconColumnGroup" Width="Auto"/>
+ <ColumnDefinition Width="13"/>
+ <ColumnDefinition Width="*"/>
+ <ColumnDefinition Width="30"/>
+ <ColumnDefinition SharedSizeGroup="MenuItemIGTColumnGroup" Width="Auto"/>
+ <ColumnDefinition Width="20"/>
+ </Grid.ColumnDefinitions>
+ <ContentPresenter x:Name="Icon"
+ ContentSource="Icon"
+ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
+ VerticalAlignment="Center"
+ HorizontalAlignment="Center"
+ Width="16"
+ Height="16"
+ Margin="6,3"/>
+ <Border x:Name="GlyphPanel"
+ Visibility="Hidden"
+ Height="22"
+ Width="22"
+ VerticalAlignment="Center"
+ HorizontalAlignment="Center"
+ Background="{Binding Path=(platform:Styles.MenuSelectedBackgroundBrush), Mode=OneWay}"
+ BorderBrush="{Binding Path=(platform:Styles.MenuSelectedBorderBrush), Mode=OneWay}"
+ BorderThickness="1"
+ ClipToBounds="False"
+ Margin="-1,0,0,0">
+ <Path x:Name="Glyph"
+ Data="{StaticResource Checkmark}"
+ FlowDirection="LeftToRight"
+ Height="11"
+ Width="10"
+ Fill="{Binding Path=(platform:Styles.MenuForegroundBrush), Mode=OneWay}" />
+ </Border>
+ <ContentPresenter x:Name="menuHeaderContainer"
+ Grid.Column="2"
+ HorizontalAlignment="Left"
+ VerticalAlignment="Center"
+ ContentSource="Header"
+ RecognizesAccessKey="True"
+ Margin="0,0,0,1"
+ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+ <TextBlock x:Name="menuGestureText"
+ Grid.Column="4"
+ Text="{TemplateBinding InputGestureText}"
+ Margin="{TemplateBinding MenuItem.Padding}"
+ VerticalAlignment="Center"
+ Opacity="0.7" />
+ </Grid>
+ </Border>
+ <ControlTemplate.Triggers>
+ <Trigger Property="Icon" Value="{x:Null}">
+ <Setter Property="Visibility" TargetName="Icon" Value="Collapsed"/>
+ </Trigger>
+ <Trigger Property="IsChecked" Value="True">
+ <Setter TargetName="GlyphPanel" Property="Visibility" Value="Visible"/>
+ <Setter TargetName="Icon" Property="Visibility" Value="Collapsed"/>
+ </Trigger>
+ <Trigger Property="IsHighlighted" Value="True">
+ <Setter TargetName="templateRoot" Property="Background" Value="{Binding Path=(platform:Styles.MenuHighlightBackgroundBrush), Mode=OneWay}" />
+ <Setter TargetName="templateRoot" Property="BorderBrush" Value="{Binding Path=(platform:Styles.MenuHighlightBorderBrush), Mode=OneWay}" />
+ </Trigger>
+ <Trigger Property="IsEnabled" Value="False">
+ <Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{Binding Path=(platform:Styles.MenuDisabledForegroundBrush), Mode=OneWay}" />
+ <Setter TargetName="Glyph" Property="Fill" Value="{Binding Path=(platform:Styles.MenuDisabledForegroundBrush), Mode=OneWay}" />
+ </Trigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+
+ <ControlTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=SubmenuHeaderTemplateKey}" TargetType="{x:Type MenuItem}">
+ <Border x:Name="templateRoot"
+ SnapsToDevicePixels="true"
+ Height="22"
+ BorderThickness="{TemplateBinding BorderThickness}"
+ Background="Transparent"
+ BorderBrush="Transparent"
+ TextElement.Foreground="{Binding Path=(platform:Styles.MenuForegroundBrush), Mode=OneWay}">
+ <Grid Margin="-1">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition MinWidth="22" SharedSizeGroup="MenuItemIconColumnGroup" Width="Auto"/>
+ <ColumnDefinition Width="13"/>
+ <ColumnDefinition Width="*"/>
+ <ColumnDefinition Width="30"/>
+ <ColumnDefinition SharedSizeGroup="MenuItemIGTColumnGroup" Width="Auto"/>
+ <ColumnDefinition Width="20"/>
+ </Grid.ColumnDefinitions>
+ <ContentPresenter x:Name="Icon"
+ ContentSource="Icon"
+ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
+ VerticalAlignment="Center"
+ HorizontalAlignment="Center"
+ Width="16"
+ Height="16"
+ Margin="6,3"/>
+ <Border x:Name="GlyphPanel"
+ BorderThickness="1"
+ Height="22"
+ Width="22"
+ Visibility="Hidden"
+ VerticalAlignment="Center"
+ Margin="-1,0,0,0"
+ BorderBrush="{Binding Path=(platform:Styles.MenuHighlightBorderBrush), Mode=OneWay}"
+ Background="{Binding Path=(platform:Styles.MenuHighlightBackgroundBrush), Mode=OneWay}">
+ <Path x:Name="Glyph"
+ Data="{DynamicResource Checkmark}"
+ FlowDirection="LeftToRight"
+ Height="11"
+ Width="9"
+ Fill="{Binding Path=(platform:Styles.MenuForegroundBrush), Mode=OneWay}" />
+ </Border>
+ <ContentPresenter
+ Grid.Column="2"
+ HorizontalAlignment="Left"
+ VerticalAlignment="Center"
+ ContentSource="Header"
+ RecognizesAccessKey="True"
+ Margin="0,0,0,1"
+ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+ <TextBlock
+ Grid.Column="4"
+ Text="{TemplateBinding InputGestureText}"
+ VerticalAlignment="Center"
+ Margin="0,0,0,1"
+ Opacity="0.7" />
+ <Path x:Name="RightArrow"
+ Grid.Column="5"
+ Data="{StaticResource RightArrow}"
+ Margin="10,0,0,0"
+ VerticalAlignment="Center"
+ HorizontalAlignment="Left"
+ Fill="{Binding Path=(platform:Styles.MenuForegroundBrush), Mode=OneWay}" />
+ <Popup x:Name="PART_Popup"
+ AllowsTransparency="true"
+ Focusable="false"
+ IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
+ PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}"
+ Placement="Right"
+ HorizontalOffset="-2"
+ VerticalOffset="-3">
+ <Border x:Name="SubMenuBorder"
+ Background="{Binding Path=(platform:Styles.MenuBackgroundBrush), Mode=OneWay}"
+ BorderBrush="{Binding Path=(platform:Styles.MenuBorderBrush), Mode=OneWay}"
+ BorderThickness="1"
+ Padding="2">
+ <ScrollViewer x:Name="SubMenuScrollViewer"
+ Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}">
+ <Grid RenderOptions.ClearTypeHint="Enabled">
+ <Canvas Height="0" Width="0" HorizontalAlignment="Left" VerticalAlignment="Top">
+ <Rectangle
+ Name="OpaqueRect"
+ Height="{Binding ElementName=SubMenuBorder,Path=ActualHeight}"
+ Width="{Binding ElementName=SubMenuBorder,Path=ActualWidth}"
+ Fill="{Binding ElementName=SubMenuBorder,Path=Background}" />
+ </Canvas>
+ <Rectangle HorizontalAlignment="Left"
+ Width="1"
+ Margin="29,0,0,0"
+ Fill="{Binding Path=(platform:Styles.MenuSeparatorBrush), Mode=OneWay}"/>
+ <ItemsPresenter x:Name="ItemsPresenter"
+ KeyboardNavigation.DirectionalNavigation="Cycle"
+ KeyboardNavigation.TabNavigation="Cycle"
+ Grid.IsSharedSizeScope="true"
+ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+ </Grid>
+ </ScrollViewer>
+ </Border>
+ </Popup>
+ </Grid>
+ </Border>
+ <ControlTemplate.Triggers>
+ <Trigger Property="IsSuspendingPopupAnimation" Value="true">
+ <Setter TargetName="PART_Popup" Property="PopupAnimation" Value="None"/>
+ </Trigger>
+ <Trigger Property="Icon" Value="{x:Null}">
+ <Setter TargetName="Icon" Property="Visibility" Value="Collapsed"/>
+ </Trigger>
+ <Trigger Property="IsChecked" Value="True">
+ <Setter TargetName="GlyphPanel" Property="Visibility" Value="Visible"/>
+ <Setter TargetName="Icon" Property="Visibility" Value="Collapsed"/>
+ </Trigger>
+ <Trigger Property="IsHighlighted" Value="True">
+ <Setter TargetName="templateRoot" Property="Background" Value="{Binding Path=(platform:Styles.MenuHighlightBackgroundBrush), Mode=OneWay}" />
+ <Setter TargetName="templateRoot" Property="BorderBrush" Value="{Binding Path=(platform:Styles.MenuHighlightBorderBrush), Mode=OneWay}" />
+ </Trigger>
+ <Trigger Property="IsEnabled" Value="False">
+ <Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{Binding Path=(platform:Styles.MenuDisabledForegroundBrush), Mode=OneWay}" />
+ <Setter TargetName="Glyph" Property="Fill" Value="{Binding Path=(platform:Styles.MenuDisabledForegroundBrush), Mode=OneWay}" />
+ <Setter TargetName="RightArrow" Property="Fill" Value="{Binding Path=(platform:Styles.MenuDisabledForegroundBrush), Mode=OneWay}" />
+ </Trigger>
+ <Trigger SourceName="SubMenuScrollViewer" Property="ScrollViewer.CanContentScroll" Value="false" >
+ <Setter TargetName="OpaqueRect" Property="Canvas.Top" Value="{Binding ElementName=SubMenuScrollViewer, Path=VerticalOffset}" />
+ <Setter TargetName="OpaqueRect" Property="Canvas.Left" Value="{Binding ElementName=SubMenuScrollViewer, Path=HorizontalOffset}" />
+ </Trigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+
+ <Style x:Key="{x:Type MenuItem}" TargetType="{x:Type MenuItem}">
+ <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
+ <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
+ <Setter Property="BorderThickness" Value="1" />
+ <Setter Property="ScrollViewer.PanningMode" Value="Both"/>
+ <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
+ <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=SubmenuItemTemplateKey}}" />
+ <Style.Triggers>
+ <Trigger Property="Role" Value="TopLevelHeader">
+ <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=TopLevelHeaderTemplateKey}}" />
+ <Setter Property="Padding" Value="6,0"/>
+ </Trigger>
+ <Trigger Property="Role" Value="TopLevelItem">
+ <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=TopLevelItemTemplateKey}}" />
+ <Setter Property="Padding" Value="6,0"/>
+ </Trigger>
+ <Trigger Property="Role" Value="SubmenuHeader">
+ <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=SubmenuHeaderTemplateKey}}" />
+ </Trigger>
+ </Style.Triggers>
+ </Style>
+
+ <Style x:Key="{x:Type ContextMenu}" TargetType="{x:Type ContextMenu}">
+ <Setter Property="FontFamily"
+ Value="{DynamicResource {x:Static SystemFonts.MenuFontFamilyKey}}"/>
+ <Setter Property="FontSize"
+ Value="{DynamicResource {x:Static SystemFonts.MenuFontSizeKey}}"/>
+ <Setter Property="FontStyle"
+ Value="{DynamicResource {x:Static SystemFonts.MenuFontStyleKey}}"/>
+ <Setter Property="FontWeight"
+ Value="{DynamicResource {x:Static SystemFonts.MenuFontWeightKey}}"/>
+ <Setter Property="Foreground"
+ Value="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}"/>
+ <Setter Property="VerticalContentAlignment"
+ Value="Center"/>
+ <Setter Property="BorderThickness"
+ Value="1"/>
+ <Setter Property="Padding"
+ Value="2"/>
+ <Setter Property="Grid.IsSharedSizeScope"
+ Value="true"/>
+ <Setter Property="HasDropShadow"
+ Value="{DynamicResource {x:Static SystemParameters.DropShadowKey}}"/>
+ <Setter Property="ScrollViewer.PanningMode"
+ Value="Both"/>
+ <Setter Property="Stylus.IsFlicksEnabled"
+ Value="False"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type ContextMenu}">
+ <Border Name="ContextMenuBorder" Background="{Binding Path=(platform:Styles.MenuBackgroundBrush), Mode=OneWay}"
+ BorderBrush="{Binding Path=(platform:Styles.MenuBorderBrush), Mode=OneWay}"
+ BorderThickness="{TemplateBinding BorderThickness}"
+ TextElement.Foreground="{Binding Path=(platform:Styles.MenuForegroundBrush), Mode=OneWay}">
+ <ScrollViewer Name="ContextMenuScrollViewer"
+ Grid.ColumnSpan="2" Margin="1,0"
+ Style="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type FrameworkElement}, ResourceId=MenuScrollViewer}}">
+ <Grid RenderOptions.ClearTypeHint="Enabled">
+ <Canvas Height="0" Width="0" HorizontalAlignment="Left" VerticalAlignment="Top">
+ <Rectangle
+ Name="OpaqueRect"
+ Height="{Binding ElementName=ContextMenuBorder,Path=ActualHeight}"
+ Width="{Binding ElementName=ContextMenuBorder,Path=ActualWidth}"
+ Fill="{Binding ElementName=ContextMenuBorder,Path=Background}" />
+ </Canvas>
+ <Rectangle Fill="{Binding Path=(platform:Styles.MenuBackgroundBrush), Mode=OneWay}"
+ HorizontalAlignment="Left"
+ Width="28"
+ Margin="1,2"
+ RadiusX="2"
+ RadiusY="2"/>
+ <!--<Rectangle HorizontalAlignment="Left"
+ Width="1"
+ Margin="29,2,0,2"
+ Fill="{Binding Path=(platform:Styles.MenuSeparatorBrush), Mode=OneWay}"/>-->
+ <ItemsPresenter Name="ItemsPresenter" Margin="{TemplateBinding Padding}"
+ KeyboardNavigation.DirectionalNavigation="Cycle"
+ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
+ </Grid>
+ </ScrollViewer>
+ </Border>
+ <ControlTemplate.Triggers>
+ <Trigger SourceName="ContextMenuScrollViewer"
+ Property="ScrollViewer.CanContentScroll"
+ Value="false" >
+ <Setter TargetName="OpaqueRect"
+ Property="Canvas.Top"
+ Value="{Binding ElementName=ContextMenuScrollViewer, Path=VerticalOffset}" />
+ <Setter TargetName="OpaqueRect"
+ Property="Canvas.Left"
+ Value="{Binding ElementName=ContextMenuScrollViewer, Path=HorizontalOffset}" />
+ </Trigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="{x:Type ToolTip}" TargetType="ToolTip">
+ <Setter Property="Background" Value="{Binding Path=(platform:Styles.TooltipBackgroundBrush), Mode=OneWay}" />
+ <Setter Property="BorderBrush" Value="{Binding Path=(platform:Styles.TooltipBorderBrush), Mode=OneWay}" />
+ <Setter Property="Foreground" Value="{Binding Path=(platform:Styles.TooltipTextBrush), Mode=OneWay}" />
+ <Setter Property="BorderThickness" Value="1" />
+ <Setter Property="Padding" Value="6,4" />
+ <Setter Property="FontFamily" Value="{DynamicResource {x:Static SystemFonts.StatusFontFamilyKey}}"/>
+ <Setter Property="FontSize" Value="{DynamicResource {x:Static SystemFonts.StatusFontSizeKey}}"/>
+ <Setter Property="FontStyle" Value="{DynamicResource {x:Static SystemFonts.StatusFontStyleKey}}"/>
+ <Setter Property="FontWeight" Value="{DynamicResource {x:Static SystemFonts.StatusFontWeightKey}}"/>
+ <Setter Property="HorizontalContentAlignment" Value="Left"/>
+ <Setter Property="VerticalContentAlignment" Value="Center"/>
+ <Setter Property="HasDropShadow" Value="False" />
+ <Setter Property="RenderOptions.ClearTypeHint" Value="Enabled" />
+ <Setter Property="SnapsToDevicePixels" Value="true" />
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="ToolTip">
+ <Border Name="Border"
+ Background="{TemplateBinding Background}"
+ BorderBrush="{TemplateBinding BorderBrush}"
+ BorderThickness="{TemplateBinding BorderThickness}"
+ SnapsToDevicePixels="True">
+ <ContentPresenter
+ Margin="{TemplateBinding Padding}"
+ HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+ VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
+ </Border>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+</ResourceDictionary> \ No newline at end of file
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs
index 554cf2cf0b..ef14841f3f 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs
@@ -34,17 +34,24 @@ using System.IO;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
-using System.Runtime.InteropServices;
+using System.Runtime.InteropServices;
using System.Collections.Generic;
using Microsoft.Win32;
-using CustomControls.OS;
+using CustomControls.OS;
using MonoDevelop.Ide.Desktop;
using System.Diagnostics;
using MonoDevelop.Core.Execution;
using System.Text;
using MonoDevelop.Core;
using Microsoft.WindowsAPICodePack.Taskbar;
-using MonoDevelop.Ide;
+using MonoDevelop.Ide;
+using MonoDevelop.Components.Windows;
+using WindowsPlatform.MainToolbar;
+using MonoDevelop.Components.Commands;
+using System.Windows.Controls;
+using System.Collections.ObjectModel;
+using System.Windows;
+using System.Windows.Input;
namespace MonoDevelop.Platform
{
@@ -62,10 +69,94 @@ namespace MonoDevelop.Platform
public override string Name {
get { return "Windows"; }
+ }
+
+ #region Toolbar implementation
+ Components.Commands.CommandManager commandManager;
+ string commandMenuAddinPath;
+ string appMenuAddinPath;
+ public override bool SetGlobalMenu (Components.Commands.CommandManager commandManager, string commandMenuAddinPath, string appMenuAddinPath)
+ {
+ // Only store this information. Release it when creating the main toolbar.
+ this.commandManager = commandManager;
+ this.commandMenuAddinPath = commandMenuAddinPath;
+ this.appMenuAddinPath = appMenuAddinPath;
+
+ return true;
+ }
+
+ const int WM_SYSCHAR = 0x0106;
+ internal override void AttachMainToolbar (Gtk.VBox parent, Components.MainToolbar.IMainToolbarView toolbar)
+ {
+ titleBar = new TitleBar ();
+ var topMenu = new GtkWPFWidget (titleBar) {
+ HeightRequest = System.Windows.Forms.SystemInformation.CaptionHeight,
+ };
+ //commandManager.IncompleteKeyPressed += (sender, e) => {
+ // if (e.Key == Gdk.Key.Alt_L) {
+ // Keyboard.Focus(titleBar.DockTitle.Children[0]);
+ // }
+ //};
+ parent.PackStart (topMenu, false, true, 0);
+ SetupMenu ();
+
+ parent.PackStart ((WPFToolbar)toolbar, false, true, 0);
+ }
+
+ void SetupMenu ()
+ {
+ // TODO: Use this?
+ CommandEntrySet appCes = commandManager.CreateCommandEntrySet (appMenuAddinPath);
+
+ CommandEntrySet ces = commandManager.CreateCommandEntrySet (commandMenuAddinPath);
+ var mainMenu = new Menu {
+ IsMainMenu = true,
+ FocusVisualStyle = null,
+ };
+ foreach (CommandEntrySet ce in ces)
+ {
+ var item = new TitleMenuItem (commandManager, ce, menu: mainMenu);
+ mainMenu.Items.Add(item);
+ }
+
+ titleBar.DockTitle.Children.Add (mainMenu);
+ DockPanel.SetDock (mainMenu, Dock.Left);
+
+ commandManager = null;
+ commandMenuAddinPath = appMenuAddinPath = null;
+ }
+
+ TitleBar titleBar;
+ internal override Components.MainToolbar.IMainToolbarView CreateMainToolbar (Gtk.Window window)
+ {
+ return new WPFToolbar {
+ HeightRequest = 40,
+ };
+ }
+ #endregion
+
+ internal static Xwt.Toolkit WPFToolkit;
+
+ public override void Initialize ()
+ {
+ // Only initialize elements for Win7+.
+ if (TaskbarManager.IsPlatformSupported) {
+ TaskbarManager.Instance.ApplicationId = BrandingService.ApplicationName;
+ }
+ }
+
+ public override Xwt.Toolkit LoadNativeToolkit ()
+ {
+ var path = Path.GetDirectoryName (GetType ().Assembly.Location);
+ System.Reflection.Assembly.LoadFrom (Path.Combine (path, "Xwt.WPF.dll"));
+ return WPFToolkit = Xwt.Toolkit.Load (Xwt.ToolkitType.Wpf);
}
internal override void SetMainWindowDecorations (Gtk.Window window)
{
+ Uri uri = new Uri ("pack://application:,,,/WindowsPlatform;component/Styles.xaml");
+ Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary() { Source = uri });
+
// Only initialize elements for Win7+.
if (TaskbarManager.IsPlatformSupported) {
TaskbarManager.Instance.SetApplicationIdForSpecificWindow (GdkWin32.HgdiobjGet (window.GdkWindow), BrandingService.ApplicationName);
@@ -200,8 +291,9 @@ namespace MonoDevelop.Platform
[DllImport (Win32.USER32)]
extern static int GetMonitorInfoA (IntPtr hmonitor, ref MonitorInfo info);
- public override Gdk.Rectangle GetUsableMonitorGeometry (Gdk.Screen screen, int monitor_id)
+ public override Xwt.Rectangle GetUsableMonitorGeometry (int screenNumber, int monitor_id)
{
+ var screen = Gdk.Display.Default.GetScreen (screenNumber);
Gdk.Rectangle geometry = screen.GetMonitorGeometry (monitor_id);
List<MonitorInfo> screens = new List<MonitorInfo> ();
@@ -232,7 +324,7 @@ namespace MonoDevelop.Platform
int y = geometry.Y + (visible.Top - frame.Top);
int height = visible.Height;
- return new Gdk.Rectangle (x, y, width, height);
+ return new Xwt.Rectangle (x, y, width, height);
}
static ProcessStartInfo CreateConsoleStartInfo (
@@ -263,7 +355,7 @@ namespace MonoDevelop.Platform
return psi;
}
- public override IProcessAsyncOperation StartConsoleProcess (
+ public override ProcessAsyncOperation StartConsoleProcess (
string command, string arguments, string workingDirectory,
IDictionary<string, string> environmentVariables,
string title, bool pauseWhenFinished)
@@ -274,7 +366,7 @@ namespace MonoDevelop.Platform
)
};
proc.Start ();
- return proc;
+ return proc.ProcessAsyncOperation;
}
public override bool CanOpenTerminal {
@@ -344,7 +436,7 @@ namespace MonoDevelop.Platform
//first check for the user's preferred app for this file type and use it as the default
using (var key = Registry.CurrentUser.OpenSubKey (@"Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\" + extension + @"\UserChoice")) {
- var progid = key == null ? null : key.GetValue ("ProgId") as string;
+ var progid = key?.GetValue ("ProgId") as string;
if (progid != null)
apps[progid] = defaultApp = WindowsAppFromName (progid, true, AssociationFlags.None);
}
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj
index 0f19949e44..13557731e3 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj
@@ -82,6 +82,10 @@
<Project>{252117CA-0ABB-4F36-BFC8-DE23A8089BB9}</Project>
<Name>Xwt.Gtk.Windows</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\..\..\external\xwt\Xwt.WPF\Xwt.WPF.csproj">
+ <Project>{C93D746E-1586-4D4F-B411-BF5A966E6A08}</Project>
+ <Name>Xwt.WPF</Name>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="Dialogs\AddFileDialogHandler.cs" />
@@ -92,6 +96,30 @@
<Compile Include="Dialogs\OpenFileDialogHandler.cs" />
<Compile Include="AssemblyInfo.cs" />
<Compile Include="GdkWin32.cs" />
+ <Compile Include="MainToolbar\ComboMenu.cs" />
+ <Compile Include="MainToolbar\DottedSeparator.xaml.cs">
+ <DependentUpon>DottedSeparator.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="MainToolbar\IconButton.xaml.cs">
+ <DependentUpon>IconButton.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="MainToolbar\SearchBar.xaml.cs">
+ <DependentUpon>SearchBar.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="MainToolbar\StatusBar.xaml.cs">
+ <DependentUpon>StatusBar.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="MainToolbar\SimpleMenuItem.cs">
+ <DependentUpon>SimpleMenuItem.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="MainToolbar\TitleMenuItem.cs" />
+ <Compile Include="MainToolbar\TitleBar.xaml.cs">
+ <DependentUpon>TitleBar.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="MainToolbar\Toolbar.xaml.cs">
+ <DependentUpon>ToolBar.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="MainToolbar\WPFToolbar.cs" />
<Compile Include="Win32.cs" />
<Compile Include="WindowsPlatform.cs" />
<Compile Include="RecentFiles.cs" />
@@ -105,11 +133,158 @@
<Compile Include="CustomDialogs\CustomCommonFileDialogComboBox.cs" />
<Compile Include="CustomDialogs\CustomCommonSaveFileDialog.cs" />
<Compile Include="Dialogs\CommonFileDialogExtensions.cs" />
+ <Compile Include="ImageHelper.cs" />
+ <Compile Include="ImageBox.cs" />
+ <Compile Include="Styles.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="WindowsPlatform.addin.xml">
<LogicalName>WindowsPlatform.addin.xml</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\md-continue-debug.png">
+ <LogicalName>md-continue-debug.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-continue-debug~dark.png">
+ <LogicalName>md-continue-debug~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-continue-debug~hover.png">
+ <LogicalName>md-continue-debug~hover.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-continue-debug~hover~dark.png">
+ <LogicalName>md-continue-debug~hover~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-continue-debug~pressed.png">
+ <LogicalName>md-continue-debug~pressed.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-continue-debug~pressed~dark.png">
+ <LogicalName>md-continue-debug~pressed~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-pause-debug.png">
+ <LogicalName>md-pause-debug.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-pause-debug~dark.png">
+ <LogicalName>md-pause-debug~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-pause-debug~hover.png">
+ <LogicalName>md-pause-debug~hover.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-pause-debug~hover~dark.png">
+ <LogicalName>md-pause-debug~hover~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-pause-debug~pressed.png">
+ <LogicalName>md-pause-debug~pressed.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-pause-debug~pressed~dark.png">
+ <LogicalName>md-pause-debug~pressed~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-step-into-debug.png">
+ <LogicalName>md-step-into-debug.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-step-into-debug~dark.png">
+ <LogicalName>md-step-into-debug~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-step-into-debug~hover.png">
+ <LogicalName>md-step-into-debug~hover.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-step-into-debug~hover~dark.png">
+ <LogicalName>md-step-into-debug~hover~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-step-into-debug~pressed.png">
+ <LogicalName>md-step-into-debug~pressed.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-step-into-debug~pressed~dark.png">
+ <LogicalName>md-step-into-debug~pressed~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-step-out-debug.png">
+ <LogicalName>md-step-out-debug.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-step-out-debug~dark.png">
+ <LogicalName>md-step-out-debug~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-step-out-debug~hover.png">
+ <LogicalName>md-step-out-debug~hover.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-step-out-debug~hover~dark.png">
+ <LogicalName>md-step-out-debug~hover~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-step-out-debug~pressed.png">
+ <LogicalName>md-step-out-debug~pressed.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-step-out-debug~pressed~dark.png">
+ <LogicalName>md-step-out-debug~pressed~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-step-over-debug.png">
+ <LogicalName>md-step-over-debug.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-step-over-debug~dark.png">
+ <LogicalName>md-step-over-debug~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-step-over-debug~hover.png">
+ <LogicalName>md-step-over-debug~hover.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-step-over-debug~hover~dark.png">
+ <LogicalName>md-step-over-debug~hover~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-step-over-debug~pressed.png">
+ <LogicalName>md-step-over-debug~pressed.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\md-step-over-debug~pressed~dark.png">
+ <LogicalName>md-step-over-debug~pressed~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\build.png">
+ <LogicalName>build.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\build~dark.png">
+ <LogicalName>build~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\build~hover.png">
+ <LogicalName>build~hover.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\build~hover~dark.png">
+ <LogicalName>build~hover~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\build~pressed.png">
+ <LogicalName>build~pressed.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\build~pressed~dark.png">
+ <LogicalName>build~pressed~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\stop.png">
+ <LogicalName>stop.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\stop~dark.png">
+ <LogicalName>stop~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\stop~hover.png">
+ <LogicalName>stop~hover.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\stop~hover~dark.png">
+ <LogicalName>stop~hover~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\stop~pressed.png">
+ <LogicalName>stop~pressed.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\stop~pressed~dark.png">
+ <LogicalName>stop~pressed~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute.png">
+ <LogicalName>execute.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute~dark.png">
+ <LogicalName>execute~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute~hover.png">
+ <LogicalName>execute~hover.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute~hover~dark.png">
+ <LogicalName>execute~hover~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute~pressed.png">
+ <LogicalName>execute~pressed.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute~pressed~dark.png">
+ <LogicalName>execute~pressed~dark.png</LogicalName>
+ </EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
@@ -117,5 +292,35 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+ <Page Include="MainToolbar\DottedSeparator.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="MainToolbar\IconButton.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="MainToolbar\SearchBar.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="MainToolbar\StatusBar.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="MainToolbar\SimpleMenuItem.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="MainToolbar\TitleBar.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="MainToolbar\ToolBar.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="Styles.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsProxyCredentialProvider.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsProxyCredentialProvider.cs
index 598f796ce0..76970ec8c4 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsProxyCredentialProvider.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsProxyCredentialProvider.cs
@@ -78,11 +78,11 @@ namespace MonoDevelop.Platform.Windows
{
NetworkCredential result = null;
- DispatchService.GuiSyncDispatch (() => {
+ Runtime.RunInMainThread (() => {
var form = new PlaceholderForm (credentialType, uri, null);
if (GdkWin32.RunModalWin32Form (form, IdeApp.Workbench.RootWindow))
result = new NetworkCredential (form.Username, form.Password, form.Domain);
- });
+ }).Wait ();
// store the obtained credentials in the auth store
// but don't store for the root url since it may have other credentials
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/build.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/build.png
new file mode 100644
index 0000000000..6ddc0f3492
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/build.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/build~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/build~dark.png
new file mode 100644
index 0000000000..4dec3eef62
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/build~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/build~hover.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/build~hover.png
new file mode 100644
index 0000000000..0addc45bb6
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/build~hover.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/build~hover~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/build~hover~dark.png
new file mode 100644
index 0000000000..b8cb68fda5
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/build~hover~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/build~pressed.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/build~pressed.png
new file mode 100644
index 0000000000..4480cde1ef
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/build~pressed.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/build~pressed~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/build~pressed~dark.png
new file mode 100644
index 0000000000..1aa2f118e7
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/build~pressed~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute.png
new file mode 100644
index 0000000000..e7b6db0a50
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute~dark.png
new file mode 100644
index 0000000000..818aff0ad3
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute~hover.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute~hover.png
new file mode 100644
index 0000000000..aaa5f9f32d
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute~hover.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute~hover~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute~hover~dark.png
new file mode 100644
index 0000000000..4aa55e23e7
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute~hover~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute~pressed.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute~pressed.png
new file mode 100644
index 0000000000..773a31bfe1
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute~pressed.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute~pressed~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute~pressed~dark.png
new file mode 100644
index 0000000000..e86b14d4c1
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/execute~pressed~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug.png
new file mode 100644
index 0000000000..03cb9e7ba7
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug~dark.png
new file mode 100644
index 0000000000..860f871cd7
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug~hover.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug~hover.png
new file mode 100644
index 0000000000..f7e0b0695d
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug~hover.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug~hover~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug~hover~dark.png
new file mode 100644
index 0000000000..7533422956
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug~hover~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug~pressed.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug~pressed.png
new file mode 100644
index 0000000000..68176aaee4
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug~pressed.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug~pressed~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug~pressed~dark.png
new file mode 100644
index 0000000000..0ac1d047b4
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-continue-debug~pressed~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug.png
new file mode 100644
index 0000000000..40915863c0
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug~dark.png
new file mode 100644
index 0000000000..8952922d20
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug~hover.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug~hover.png
new file mode 100644
index 0000000000..d83476b18b
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug~hover.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug~hover~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug~hover~dark.png
new file mode 100644
index 0000000000..392ce0d026
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug~hover~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug~pressed.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug~pressed.png
new file mode 100644
index 0000000000..e4d9d7f7da
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug~pressed.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug~pressed~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug~pressed~dark.png
new file mode 100644
index 0000000000..9781213f5e
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-pause-debug~pressed~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug.png
new file mode 100644
index 0000000000..6b756b74d7
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug~dark.png
new file mode 100644
index 0000000000..84162564d7
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug~hover.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug~hover.png
new file mode 100644
index 0000000000..54fcdd2d19
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug~hover.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug~hover~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug~hover~dark.png
new file mode 100644
index 0000000000..04cacda22c
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug~hover~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug~pressed.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug~pressed.png
new file mode 100644
index 0000000000..45096396b3
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug~pressed.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug~pressed~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug~pressed~dark.png
new file mode 100644
index 0000000000..2d7425f9b8
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-into-debug~pressed~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug.png
new file mode 100644
index 0000000000..ebf537f98c
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug~dark.png
new file mode 100644
index 0000000000..d396c074a7
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug~hover.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug~hover.png
new file mode 100644
index 0000000000..dedda1fe2d
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug~hover.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug~hover~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug~hover~dark.png
new file mode 100644
index 0000000000..92177a1afe
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug~hover~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug~pressed.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug~pressed.png
new file mode 100644
index 0000000000..29b22c51ea
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug~pressed.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug~pressed~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug~pressed~dark.png
new file mode 100644
index 0000000000..c1d754c159
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-out-debug~pressed~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug.png
new file mode 100644
index 0000000000..c5b7d130b6
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug~dark.png
new file mode 100644
index 0000000000..1a87c5f7ae
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug~hover.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug~hover.png
new file mode 100644
index 0000000000..5e3c9a91f9
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug~hover.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug~hover~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug~hover~dark.png
new file mode 100644
index 0000000000..6a7b525517
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug~hover~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug~pressed.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug~pressed.png
new file mode 100644
index 0000000000..d307dbac64
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug~pressed.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug~pressed~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug~pressed~dark.png
new file mode 100644
index 0000000000..25e17dfd7f
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/md-step-over-debug~pressed~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop.png
new file mode 100644
index 0000000000..528575211b
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop~dark.png
new file mode 100644
index 0000000000..e0c552e73b
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop~hover.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop~hover.png
new file mode 100644
index 0000000000..e7ab64e381
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop~hover.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop~hover~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop~hover~dark.png
new file mode 100644
index 0000000000..4d45bb423a
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop~hover~dark.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop~pressed.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop~pressed.png
new file mode 100644
index 0000000000..f009fae10b
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop~pressed.png
Binary files differ
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop~pressed~dark.png b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop~pressed~dark.png
new file mode 100644
index 0000000000..784b0c22d1
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/icons/stop~pressed~dark.png
Binary files differ
diff --git a/main/src/addins/Xml/Completion/EmptyXmlCompletionProvider.cs b/main/src/addins/Xml/Completion/EmptyXmlCompletionProvider.cs
index 8c6adceec0..7e5225e46b 100644
--- a/main/src/addins/Xml/Completion/EmptyXmlCompletionProvider.cs
+++ b/main/src/addins/Xml/Completion/EmptyXmlCompletionProvider.cs
@@ -26,50 +26,52 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
namespace MonoDevelop.Xml.Completion
{
public class EmptyXmlCompletionProvider : IXmlCompletionProvider
{
- public CompletionDataList GetElementCompletionData ()
+ public Task<CompletionDataList> GetElementCompletionData (CancellationToken token)
{
- return new CompletionDataList ();
+ return Task.FromResult (new CompletionDataList ());
}
- public CompletionDataList GetElementCompletionData (string namespacePrefix)
+ public Task<CompletionDataList> GetElementCompletionData (string namespacePrefix, CancellationToken token)
{
- return new CompletionDataList ();
+ return Task.FromResult (new CompletionDataList ());
}
- public CompletionDataList GetChildElementCompletionData (XmlElementPath path)
+ public Task<CompletionDataList> GetChildElementCompletionData (XmlElementPath path, CancellationToken token)
{
- return new CompletionDataList ();
+ return Task.FromResult (new CompletionDataList ());
}
- public CompletionDataList GetAttributeCompletionData (XmlElementPath path)
+ public Task<CompletionDataList> GetAttributeCompletionData (XmlElementPath path, CancellationToken token)
{
- return new CompletionDataList ();
+ return Task.FromResult (new CompletionDataList ());
}
- public CompletionDataList GetAttributeValueCompletionData (XmlElementPath path, string name)
+ public Task<CompletionDataList> GetAttributeValueCompletionData (XmlElementPath path, string name, CancellationToken token)
{
- return new CompletionDataList ();
+ return Task.FromResult (new CompletionDataList ());
}
- public CompletionDataList GetChildElementCompletionData (string tagName)
+ public Task<CompletionDataList> GetChildElementCompletionData (string tagName, CancellationToken token)
{
- return new CompletionDataList ();
+ return Task.FromResult (new CompletionDataList ());
}
- public CompletionDataList GetAttributeCompletionData (string tagName)
+ public Task<CompletionDataList> GetAttributeCompletionData (string tagName, CancellationToken token)
{
- return new CompletionDataList ();
+ return Task.FromResult (new CompletionDataList ());
}
- public CompletionDataList GetAttributeValueCompletionData (string tagName, string name)
+ public Task<CompletionDataList> GetAttributeValueCompletionData (string tagName, string name, CancellationToken token)
{
- return new CompletionDataList ();
+ return Task.FromResult (new CompletionDataList ());
}
}
}
diff --git a/main/src/addins/Xml/Completion/IXmlCompletionProvider.cs b/main/src/addins/Xml/Completion/IXmlCompletionProvider.cs
index 95251d5b73..a065ad9e54 100644
--- a/main/src/addins/Xml/Completion/IXmlCompletionProvider.cs
+++ b/main/src/addins/Xml/Completion/IXmlCompletionProvider.cs
@@ -27,6 +27,8 @@
//
using System;
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Editor;
@@ -34,15 +36,15 @@ namespace MonoDevelop.Xml.Completion
{
public interface IXmlCompletionProvider
{
- CompletionDataList GetElementCompletionData ();
- CompletionDataList GetElementCompletionData (string namespacePrefix);
+ Task<CompletionDataList> GetElementCompletionData (CancellationToken token);
+ Task<CompletionDataList> GetElementCompletionData (string namespacePrefix, CancellationToken token);
- CompletionDataList GetChildElementCompletionData (XmlElementPath path);
- CompletionDataList GetAttributeCompletionData (XmlElementPath path);
- CompletionDataList GetAttributeValueCompletionData (XmlElementPath path, string name);
+ Task<CompletionDataList> GetChildElementCompletionData (XmlElementPath path, CancellationToken token);
+ Task<CompletionDataList> GetAttributeCompletionData (XmlElementPath path, CancellationToken token);
+ Task<CompletionDataList> GetAttributeValueCompletionData (XmlElementPath path, string name, CancellationToken token);
- CompletionDataList GetChildElementCompletionData (string tagName);
- CompletionDataList GetAttributeCompletionData (string tagName);
- CompletionDataList GetAttributeValueCompletionData (string tagName, string name);
+ Task<CompletionDataList> GetChildElementCompletionData (string tagName, CancellationToken token);
+ Task<CompletionDataList> GetAttributeCompletionData (string tagName, CancellationToken token);
+ Task<CompletionDataList> GetAttributeValueCompletionData (string tagName, string name, CancellationToken token);
}
}
diff --git a/main/src/addins/Xml/Completion/InferredXmlCompletionProvider.cs b/main/src/addins/Xml/Completion/InferredXmlCompletionProvider.cs
index e1c361f76b..839dfb4330 100644
--- a/main/src/addins/Xml/Completion/InferredXmlCompletionProvider.cs
+++ b/main/src/addins/Xml/Completion/InferredXmlCompletionProvider.cs
@@ -26,6 +26,8 @@
using System;
using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Dom;
@@ -67,60 +69,60 @@ namespace MonoDevelop.Xml.Completion
}
}
- public CompletionDataList GetElementCompletionData ()
+ public Task<CompletionDataList> GetElementCompletionData (CancellationToken token)
{
- return GetChildElementCompletionData ("");
+ return GetChildElementCompletionData ("", token);
}
- public CompletionDataList GetElementCompletionData (string namespacePrefix)
+ public Task<CompletionDataList> GetElementCompletionData (string namespacePrefix, CancellationToken token)
{
- return new CompletionDataList ();
+ return Task.FromResult (new CompletionDataList ());
}
- public CompletionDataList GetChildElementCompletionData (XmlElementPath path)
+ public Task<CompletionDataList> GetChildElementCompletionData (XmlElementPath path, CancellationToken token)
{
return GetCompletions (elementCompletions, path, XmlCompletionData.DataType.XmlElement);
}
- public CompletionDataList GetAttributeCompletionData (XmlElementPath path)
+ public Task<CompletionDataList> GetAttributeCompletionData (XmlElementPath path, CancellationToken token)
{
return GetCompletions (attributeCompletions, path, XmlCompletionData.DataType.XmlAttribute);
}
- public CompletionDataList GetAttributeValueCompletionData (XmlElementPath path, string name)
+ public Task<CompletionDataList> GetAttributeValueCompletionData (XmlElementPath path, string name, CancellationToken token)
{
- return new CompletionDataList ();
+ return Task.FromResult (new CompletionDataList ());
}
- public CompletionDataList GetChildElementCompletionData (string tagName)
+ public Task<CompletionDataList> GetChildElementCompletionData (string tagName, CancellationToken token)
{
return GetCompletions (elementCompletions, tagName, XmlCompletionData.DataType.XmlElement);
}
- public CompletionDataList GetAttributeCompletionData (string tagName)
+ public Task<CompletionDataList> GetAttributeCompletionData (string tagName, CancellationToken token)
{
return GetCompletions (attributeCompletions, tagName, XmlCompletionData.DataType.XmlAttribute);
}
- public CompletionDataList GetAttributeValueCompletionData (string tagName, string name)
+ public Task<CompletionDataList> GetAttributeValueCompletionData (string tagName, string name, CancellationToken token)
{
- return new CompletionDataList ();
+ return Task.FromResult (new CompletionDataList ());
}
- static CompletionDataList GetCompletions (Dictionary<string,HashSet<string>> map, string tagName, XmlCompletionData.DataType type)
+ static Task<CompletionDataList> GetCompletions (Dictionary<string,HashSet<string>> map, string tagName, XmlCompletionData.DataType type)
{
var data = new CompletionDataList ();
HashSet<string> values;
if (map.TryGetValue (tagName, out values))
foreach (string s in values)
data.Add (new XmlCompletionData (s, type));
- return data;
+ return Task.FromResult (data);
}
- static CompletionDataList GetCompletions (Dictionary<string,HashSet<string>> map, XmlElementPath path, XmlCompletionData.DataType type)
+ static Task<CompletionDataList> GetCompletions (Dictionary<string,HashSet<string>> map, XmlElementPath path, XmlCompletionData.DataType type)
{
if (path == null || path.Elements.Count == 0)
- return new CompletionDataList ();
+ return Task.FromResult (new CompletionDataList ());
return GetCompletions (map, path.Elements[path.Elements.Count - 1].Name, type);
}
}
diff --git a/main/src/addins/Xml/Completion/XmlCompletionData.cs b/main/src/addins/Xml/Completion/XmlCompletionData.cs
index c3c77f6e94..7590f535f9 100644
--- a/main/src/addins/Xml/Completion/XmlCompletionData.cs
+++ b/main/src/addins/Xml/Completion/XmlCompletionData.cs
@@ -22,15 +22,20 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-using System;
-using Gdk;
-using Mono.TextEditor;
+using Gdk;
+using Gtk;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide.CodeCompletion;
+using System;
using MonoDevelop.Core;
+using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Ide.Commands;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Xml.Editor;
+using MonoDevelop.Ide.Editor.Extension;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Xml.Completion
{
@@ -104,18 +109,23 @@ namespace MonoDevelop.Xml.Completion
}
}
- public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, ModifierType modifier)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
if (XmlEditorOptions.AutoInsertFragments && dataType == DataType.XmlAttribute) {
- var textEditorDataProvier = window.CompletionWidget as ITextEditorDataProvider;
- var textBuffer = window.CompletionWidget as ITextBuffer;
- base.InsertCompletionText (window, ref ka, closeChar, keyChar, modifier);
- if (textEditorDataProvier != null && textBuffer != null)
- textEditorDataProvier.GetTextEditorData ().SetSkipChar (textBuffer.CursorPosition, '"');
- IdeApp.CommandService.DispatchCommand (TextEditorCommands.ShowCompletionWindow);
+ //This temporary variable is needed because
+ //base.InsertCompletionText sets window.CompletionWidget to null
+ var completionWidget = window.CompletionWidget;
+ base.InsertCompletionText (window, ref ka, descriptor);
+ if (completionWidget is ITextEditorImpl) {
+ ((ITextEditorImpl)completionWidget).EditorExtension.Editor.StartSession (new SkipCharSession ('"'));
+ }
+
+ //Even if we are on UI thread call Application.Invoke to postpone calling command
+ //otherwise code calling InsertCompletionText will close completion window created by this command
+ Application.Invoke ((s,e) => IdeApp.CommandService.DispatchCommand (TextEditorCommands.ShowCompletionWindow));
ka &= ~KeyActions.CloseWindow;
} else {
- base.InsertCompletionText (window, ref ka, closeChar, keyChar, modifier);
+ base.InsertCompletionText (window, ref ka, descriptor);
}
}
diff --git a/main/src/addins/Xml/Completion/XmlSchemaCompletionData.cs b/main/src/addins/Xml/Completion/XmlSchemaCompletionData.cs
index 6a52d9ffc3..aef67ce072 100644
--- a/main/src/addins/Xml/Completion/XmlSchemaCompletionData.cs
+++ b/main/src/addins/Xml/Completion/XmlSchemaCompletionData.cs
@@ -1,29 +1,31 @@
-//
-// MonoDevelop XML Editor
-//
+//
+// MonoDevelop XML Editor
+//
// Copyright (C) 2005 Matthew Ward
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
using System;
using System.IO;
using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
using System.Xml;
using System.Xml.Schema;
using MonoDevelop.Ide.CodeCompletion;
@@ -147,34 +149,41 @@ namespace MonoDevelop.Xml.Completion
public bool IsLoaded {
get { return loaded; }
- }
-
- public void EnsureLoaded ()
+ }
+
+ public void EnsureLoaded ()
+ {
+ EnsureLoadedAsync ().Wait ();
+ }
+
+ public Task EnsureLoadedAsync ()
{
if (loaded)
- return;
-
- if (schema == null)
- using (StreamReader reader = new StreamReader (fileName, true))
- ReadSchema (baseUri, reader);
-
- //TODO: should we evaluate unresolved imports against other registered schemas?
- //will be messy because we'll have to re-evaluate if any schema is added, removed or changes
- //maybe we should just force users to use schemaLocation in their includes
- var sset = new XmlSchemaSet ();
- sset.XmlResolver = new LocalOnlyXmlResolver ();
- sset.Add (schema);
- sset.ValidationEventHandler += SchemaValidation;
- sset.Compile ();
- loaded = true;
+ return Task.FromResult (0);
+
+ return Task.Run (() => {
+ if (schema == null)
+ using (StreamReader reader = new StreamReader (fileName, true))
+ ReadSchema (baseUri, reader);
+
+ //TODO: should we evaluate unresolved imports against other registered schemas?
+ //will be messy because we'll have to re-evaluate if any schema is added, removed or changes
+ //maybe we should just force users to use schemaLocation in their includes
+ var sset = new XmlSchemaSet ();
+ sset.XmlResolver = new LocalOnlyXmlResolver ();
+ sset.Add (schema);
+ sset.ValidationEventHandler += SchemaValidation;
+ sset.Compile ();
+ loaded = true;
+ });
}
#endregion
#region Simplified API, useful for e.g. HTML
- public CompletionDataList GetChildElementCompletionData (string tagName)
+ public async Task<CompletionDataList> GetChildElementCompletionData (string tagName, CancellationToken token)
{
- EnsureLoaded ();
+ await EnsureLoadedAsync ();
var list = new XmlCompletionDataList ();
var element = FindElement (tagName);
@@ -183,9 +192,9 @@ namespace MonoDevelop.Xml.Completion
return list;
}
- public CompletionDataList GetAttributeCompletionData (string tagName)
+ public async Task<CompletionDataList> GetAttributeCompletionData (string tagName, CancellationToken token)
{
- EnsureLoaded ();
+ await EnsureLoadedAsync ();
var list = new XmlCompletionDataList ();
var element = FindElement (tagName);
@@ -196,9 +205,9 @@ namespace MonoDevelop.Xml.Completion
return list;
}
- public CompletionDataList GetAttributeValueCompletionData (string tagName, string name)
+ public async Task<CompletionDataList> GetAttributeValueCompletionData (string tagName, string name, CancellationToken token)
{
- EnsureLoaded ();
+ await EnsureLoadedAsync ();
var list = new XmlCompletionDataList ();
var element = FindElement (tagName);
@@ -212,17 +221,17 @@ namespace MonoDevelop.Xml.Completion
/// <summary>
/// Gets the possible root elements for an xml document using this schema.
/// </summary>
- public CompletionDataList GetElementCompletionData ()
+ public Task<CompletionDataList> GetElementCompletionData (CancellationToken token)
{
- return GetElementCompletionData ("");
+ return GetElementCompletionData ("", token);
}
/// <summary>
/// Gets the possible root elements for an xml document using this schema.
/// </summary>
- public CompletionDataList GetElementCompletionData (string namespacePrefix)
+ public async Task<CompletionDataList> GetElementCompletionData (string namespacePrefix, CancellationToken token)
{
- EnsureLoaded ();
+ await EnsureLoadedAsync ();
var data = new XmlCompletionDataList ();
foreach (XmlSchemaElement element in schema.Elements.Values) {
@@ -239,9 +248,9 @@ namespace MonoDevelop.Xml.Completion
/// Gets the attribute completion data for the xml element that exists
/// at the end of the specified path.
/// </summary>
- public CompletionDataList GetAttributeCompletionData (XmlElementPath path)
+ public async Task<CompletionDataList> GetAttributeCompletionData (XmlElementPath path, CancellationToken token)
{
- EnsureLoaded ();
+ await EnsureLoadedAsync ();
var data = new XmlCompletionDataList (path.Namespaces);
var element = FindElement (path);
@@ -256,9 +265,9 @@ namespace MonoDevelop.Xml.Completion
/// Gets the child element completion data for the xml element that exists
/// at the end of the specified path.
/// </summary>
- public CompletionDataList GetChildElementCompletionData (XmlElementPath path)
+ public async Task<CompletionDataList> GetChildElementCompletionData (XmlElementPath path, CancellationToken token)
{
- EnsureLoaded ();
+ await EnsureLoadedAsync ();
var data = new XmlCompletionDataList (path.Namespaces);
var element = FindElement (path);
@@ -272,9 +281,9 @@ namespace MonoDevelop.Xml.Completion
/// <summary>
/// Gets the autocomplete data for the specified attribute value.
/// </summary>
- public CompletionDataList GetAttributeValueCompletionData (XmlElementPath path, string name)
+ public async Task<CompletionDataList> GetAttributeValueCompletionData (XmlElementPath path, string name, CancellationToken token)
{
- EnsureLoaded ();
+ await EnsureLoadedAsync ();
var data = new XmlCompletionDataList (path.Namespaces);
var element = FindElement (path);
diff --git a/main/src/addins/Xml/Completion/XmlTagCompletionData.cs b/main/src/addins/Xml/Completion/XmlTagCompletionData.cs
index befc32f068..e0d08b5ef2 100644
--- a/main/src/addins/Xml/Completion/XmlTagCompletionData.cs
+++ b/main/src/addins/Xml/Completion/XmlTagCompletionData.cs
@@ -31,6 +31,7 @@ using System;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Core;
+using MonoDevelop.Ide.Editor.Extension;
namespace MonoDevelop.Xml.Completion
{
@@ -66,20 +67,17 @@ namespace MonoDevelop.Xml.Completion
get { return element; }
}
- public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
- IEditableTextBuffer buf = window.CompletionWidget as IEditableTextBuffer;
+ var buf = window.CompletionWidget;
if (buf != null) {
//completion context gets nulled from window as soon as we alter the buffer
var codeCompletionContext = window.CodeCompletionContext;
- using (var undo = buf.OpenUndoGroup ()) {
- buf.InsertText (buf.CursorPosition, element);
+ buf.Replace (buf.CaretOffset, 0, element);
- // Move caret into the middle of the tags
- buf.CursorPosition = codeCompletionContext.TriggerOffset + cursorOffset;
- buf.Select (buf.CursorPosition, buf.CursorPosition);
- }
+ // Move caret into the middle of the tags
+ buf.CaretOffset = codeCompletionContext.TriggerOffset + cursorOffset;
}
}
}
diff --git a/main/src/addins/Xml/Dom/XAttribute.cs b/main/src/addins/Xml/Dom/XAttribute.cs
index f34f456727..c82a8e7a8b 100644
--- a/main/src/addins/Xml/Dom/XAttribute.cs
+++ b/main/src/addins/Xml/Dom/XAttribute.cs
@@ -23,21 +23,20 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-
-using ICSharpCode.NRefactory;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Xml.Dom
{
public class XAttribute : XObject, INamedXObject
{
- public XAttribute (TextLocation start, XName name, string value) : base (start)
+ public XAttribute (DocumentLocation start, XName name, string value) : base (start)
{
this.Name = name;
this.Value = value;
}
- public XAttribute (TextLocation start) : base (start)
+ public XAttribute (DocumentLocation start) : base (start)
{
}
diff --git a/main/src/addins/Xml/Dom/XCData.cs b/main/src/addins/Xml/Dom/XCData.cs
index 001f80521b..f850d91cec 100644
--- a/main/src/addins/Xml/Dom/XCData.cs
+++ b/main/src/addins/Xml/Dom/XCData.cs
@@ -24,15 +24,14 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Xml.Dom
{
public class XCData : XNode
{
- public XCData (TextLocation start) : base (start) {}
- public XCData (DomRegion region) : base (region) {}
+ public XCData (DocumentLocation start) : base (start) {}
+ public XCData (DocumentRegion region) : base (region) {}
protected XCData () {}
protected override XObject NewInstance () { return new XCData (); }
diff --git a/main/src/addins/Xml/Dom/XClosingTag.cs b/main/src/addins/Xml/Dom/XClosingTag.cs
index c134dea6a4..3973ad2ab8 100644
--- a/main/src/addins/Xml/Dom/XClosingTag.cs
+++ b/main/src/addins/Xml/Dom/XClosingTag.cs
@@ -24,15 +24,15 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using ICSharpCode.NRefactory;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Xml.Dom
{
public class XClosingTag : XNode, INamedXObject
{
- public XClosingTag (TextLocation start) : base (start) {}
+ public XClosingTag (DocumentLocation start) : base (start) {}
- public XClosingTag (XName name, TextLocation start) : base (start)
+ public XClosingTag (XName name, DocumentLocation start) : base (start)
{
this.Name = name;
}
diff --git a/main/src/addins/Xml/Dom/XComment.cs b/main/src/addins/Xml/Dom/XComment.cs
index 57231b974f..08a7998065 100644
--- a/main/src/addins/Xml/Dom/XComment.cs
+++ b/main/src/addins/Xml/Dom/XComment.cs
@@ -23,16 +23,14 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Xml.Dom
{
public class XComment : XNode
{
- public XComment (TextLocation start) : base (start) {}
- public XComment (DomRegion region) : base (region) {}
+ public XComment (DocumentLocation start) : base (start) {}
+ public XComment (DocumentRegion region) : base (region) {}
protected XComment () {}
protected override XObject NewInstance () { return new XComment (); }
diff --git a/main/src/addins/Xml/Dom/XContainer.cs b/main/src/addins/Xml/Dom/XContainer.cs
index 997def1ad0..dd6e0c10fd 100644
--- a/main/src/addins/Xml/Dom/XContainer.cs
+++ b/main/src/addins/Xml/Dom/XContainer.cs
@@ -25,14 +25,14 @@
// THE SOFTWARE.
using System.Collections.Generic;
-using System.Text;
-using ICSharpCode.NRefactory;
+using System.Text;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Xml.Dom
{
public abstract class XContainer : XNode
{
- protected XContainer (TextLocation start) : base (start) { }
+ protected XContainer (DocumentLocation start) : base (start) { }
XNode firstNode;
XNode lastChild;
diff --git a/main/src/addins/Xml/Dom/XDocType.cs b/main/src/addins/Xml/Dom/XDocType.cs
index ff29a31322..a91f85be96 100644
--- a/main/src/addins/Xml/Dom/XDocType.cs
+++ b/main/src/addins/Xml/Dom/XDocType.cs
@@ -24,15 +24,14 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Xml.Dom
{
public class XDocType : XNode, INamedXObject
{
- public XDocType (TextLocation start) : base (start) {}
- public XDocType (DomRegion region) : base (region) {}
+ public XDocType (DocumentLocation start) : base (start) {}
+ public XDocType (DocumentRegion region) : base (region) {}
protected XDocType () {}
protected override XObject NewInstance () { return new XDocType (); }
@@ -40,7 +39,7 @@ namespace MonoDevelop.Xml.Dom
public XName RootElement { get; set; }
public string PublicFpi { get; set; }
public bool IsPublic { get { return PublicFpi != null; } }
- public DomRegion InternalDeclarationRegion { get; set; }
+ public DocumentRegion InternalDeclarationRegion { get; set; }
public string Uri { get; set; }
public override string FriendlyPathRepresentation {
diff --git a/main/src/addins/Xml/Dom/XDocument.cs b/main/src/addins/Xml/Dom/XDocument.cs
index dc6cfafccc..2425c065c7 100644
--- a/main/src/addins/Xml/Dom/XDocument.cs
+++ b/main/src/addins/Xml/Dom/XDocument.cs
@@ -24,8 +24,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using System;
-using ICSharpCode.NRefactory;
+using System;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Xml.Dom
{
@@ -33,7 +33,7 @@ namespace MonoDevelop.Xml.Dom
{
public XElement RootElement { get; private set; }
- public XDocument () : base (new TextLocation (1, 1)) {}
+ public XDocument () : base (new DocumentLocation (1, 1)) {}
protected override XObject NewInstance () { return new XDocument (); }
public override string FriendlyPathRepresentation {
diff --git a/main/src/addins/Xml/Dom/XElement.cs b/main/src/addins/Xml/Dom/XElement.cs
index a49a2b81d4..81ff5eceba 100644
--- a/main/src/addins/Xml/Dom/XElement.cs
+++ b/main/src/addins/Xml/Dom/XElement.cs
@@ -25,8 +25,8 @@
// THE SOFTWARE.
using System.Collections.Generic;
-using System.Text;
-using ICSharpCode.NRefactory;
+using System.Text;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Xml.Dom
{
@@ -35,12 +35,12 @@ namespace MonoDevelop.Xml.Dom
XNode closingTag;
readonly XAttributeCollection attributes;
- public XElement (TextLocation start) : base (start)
+ public XElement (DocumentLocation start) : base (start)
{
attributes = new XAttributeCollection (this);
}
- public XElement (TextLocation start, XName name) : this (start)
+ public XElement (DocumentLocation start, XName name) : this (start)
{
this.Name = name;
}
diff --git a/main/src/addins/Xml/Dom/XNode.cs b/main/src/addins/Xml/Dom/XNode.cs
index d98b02b761..37fd74d643 100644
--- a/main/src/addins/Xml/Dom/XNode.cs
+++ b/main/src/addins/Xml/Dom/XNode.cs
@@ -24,15 +24,14 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Xml.Dom
{
public abstract class XNode : XObject
{
- protected XNode (TextLocation start) : base (start) {}
- protected XNode (DomRegion region) : base (region) {}
+ protected XNode (DocumentLocation start) : base (start) {}
+ protected XNode (DocumentRegion region) : base (region) {}
protected XNode () {}
public XNode NextSibling { get; internal protected set; }
diff --git a/main/src/addins/Xml/Dom/XObject.cs b/main/src/addins/Xml/Dom/XObject.cs
index f999256eea..c55d3e3742 100644
--- a/main/src/addins/Xml/Dom/XObject.cs
+++ b/main/src/addins/Xml/Dom/XObject.cs
@@ -25,22 +25,21 @@
// THE SOFTWARE.
using System.Collections.Generic;
-using System.Text;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory;
+using System.Text;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Xml.Dom
{
public abstract class XObject
{
- DomRegion region;
+ DocumentRegion region;
- protected XObject (TextLocation start)
+ protected XObject (DocumentLocation start)
{
- region = new DomRegion (start, TextLocation.Empty);
+ region = new DocumentRegion (start, DocumentLocation.Empty);
}
- protected XObject (DomRegion region)
+ protected XObject (DocumentRegion region)
{
this.region = region;
}
@@ -57,13 +56,13 @@ namespace MonoDevelop.Xml.Dom
}
}
- public DomRegion Region {
+ public DocumentRegion Region {
get { return region; }
}
- public void End (TextLocation endLocation)
+ public void End (DocumentLocation endLocation)
{
- region = new DomRegion (region.Begin, endLocation);
+ region = new DocumentRegion (region.Begin, endLocation);
}
public bool IsEnded {
diff --git a/main/src/addins/Xml/Dom/XProcessingInstruction.cs b/main/src/addins/Xml/Dom/XProcessingInstruction.cs
index 9089897116..03d907fe62 100644
--- a/main/src/addins/Xml/Dom/XProcessingInstruction.cs
+++ b/main/src/addins/Xml/Dom/XProcessingInstruction.cs
@@ -23,16 +23,14 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Xml.Dom
{
public class XProcessingInstruction : XNode
{
- public XProcessingInstruction (TextLocation start) : base (start) {}
- public XProcessingInstruction (DomRegion region) : base (region) {}
+ public XProcessingInstruction (DocumentLocation start) : base (start) {}
+ public XProcessingInstruction (DocumentRegion region) : base (region) {}
protected XProcessingInstruction () {}
protected override XObject NewInstance () { return new XProcessingInstruction (); }
diff --git a/main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs b/main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs
index 0258e22974..e135de5e60 100644
--- a/main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs
+++ b/main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs
@@ -34,10 +34,7 @@ using System.Linq;
using Gtk;
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.TypeSystem;
-using Mono.TextEditor;
using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.DesignerSupport;
@@ -45,10 +42,16 @@ using MonoDevelop.Ide;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Extension;
using MonoDevelop.Projects;
using MonoDevelop.Xml.Completion;
using MonoDevelop.Xml.Dom;
using MonoDevelop.Xml.Parser;
+using System.Threading.Tasks;
+using System.Threading;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Ide.Commands;
namespace MonoDevelop.Xml.Editor
{
@@ -65,18 +68,17 @@ namespace MonoDevelop.Xml.Editor
#region Setup and teardown
- public override bool ExtendsEditor (MonoDevelop.Ide.Gui.Document doc, IEditableTextBuffer editor)
+ public override bool IsValidInContext (DocumentContext context)
{
//can only attach if there is not already an attached BaseXmlEditorExtension
- return doc.GetContent<BaseXmlEditorExtension> () == null;
+ return context.GetContent<BaseXmlEditorExtension> () == null;
}
protected virtual XmlRootState CreateRootState ()
{
return new XmlRootState ();
}
-
- public override void Initialize ()
+ protected override void Initialize ()
{
base.Initialize ();
@@ -89,11 +91,11 @@ namespace MonoDevelop.Xml.Editor
var parser = new XmlParser (CreateRootState (), false);
tracker = new DocumentStateTracker<XmlParser> (parser, Editor);
+ DocumentContext.DocumentParsed += UpdateParsedDocument;
+ Editor.CaretPositionChanged += HandleCaretPositionChanged;
- Document.DocumentParsed += UpdateParsedDocument;
-
- if (Document.ParsedDocument != null) {
- lastCU = Document.ParsedDocument;
+ if (DocumentContext.ParsedDocument != null) {
+ lastCU = DocumentContext.ParsedDocument;
OnParsedDocumentUpdated ();
}
@@ -105,7 +107,7 @@ namespace MonoDevelop.Xml.Editor
void HandleProjectChanged (object sender, ProjectFileEventArgs e)
{
- if (e.Any (f => f.ProjectFile.FilePath == Document.FileName))
+ if (e.Any (f => f.ProjectFile.FilePath == DocumentContext.Name))
UpdateOwnerProjects ();
}
@@ -115,42 +117,52 @@ namespace MonoDevelop.Xml.Editor
ownerProjects = new List<DotNetProject> ();
return;
}
- var projects = new HashSet<DotNetProject> (IdeApp.Workspace.GetAllSolutionItems<DotNetProject> ().Where (p => p.IsFileInProject (Document.FileName)));
+ if (DocumentContext == null) {
+ return;//This can happen if this object is disposed
+ }
+ var projects = new HashSet<DotNetProject> (IdeApp.Workspace.GetAllItems<DotNetProject> ().Where (p => p.IsFileInProject (DocumentContext.Name)));
if (ownerProjects == null || !projects.SetEquals (ownerProjects)) {
ownerProjects = projects.OrderBy (p => p.Name).ToList ();
- var dnp = Document.Project as DotNetProject;
+ var dnp = DocumentContext.Project as DotNetProject;
if (ownerProjects.Count > 0 && (dnp == null || !ownerProjects.Contains (dnp))) {
// If the project for the document is not a DotNetProject but there is a project containing this file
// in the current solution, then use that project
- var pp = Document.Project != null ? ownerProjects.FirstOrDefault (p => p.ParentSolution == Document.Project.ParentSolution) : null;
+ var pp = DocumentContext.Project != null ? ownerProjects.FirstOrDefault (p => p.ParentSolution == DocumentContext.Project.ParentSolution) : null;
if (pp != null)
- Document.AttachToProject (pp);
+ DocumentContext.AttachToProject (pp);
}
}
- if (Document.Project == null && ownerProjects.Count > 0)
- Document.AttachToProject (ownerProjects[0]);
+ if (DocumentContext == null) {
+ return;//This can happen if this object is disposed, which is likely to happen in DocumentContext.AttachToProject (pp);
+ }
+ if (DocumentContext.Project == null && ownerProjects.Count > 0)
+ DocumentContext.AttachToProject (ownerProjects[0]);
UpdatePath ();
}
void UpdateParsedDocument (object sender, EventArgs args)
{
- lastCU = Document.ParsedDocument;
+ lastCU = DocumentContext.ParsedDocument;
OnParsedDocumentUpdated ();
}
public override void Dispose ()
{
+ Editor.CaretPositionChanged -= HandleCaretPositionChanged;
+
if (tracker != null) {
+ tracker.Dispose ();
tracker = null;
- base.Dispose ();
}
- Document.DocumentParsed -= UpdateParsedDocument;
+ DocumentContext.DocumentParsed -= UpdateParsedDocument;
if (IdeApp.Workspace != null) {
IdeApp.Workspace.FileAddedToProject -= HandleProjectChanged;
IdeApp.Workspace.FileRemovedFromProject -= HandleProjectChanged;
}
+
+ base.Dispose ();
}
protected virtual void OnParsedDocumentUpdated ()
@@ -183,34 +195,17 @@ namespace MonoDevelop.Xml.Editor
protected ParsedDocument CU {
get { return lastCU; }
}
-
- protected ITextBuffer Buffer {
- get {
- if (Document == null)
- throw new InvalidOperationException ("Editor extension not yet initialized");
- return Document.GetContent<ITextBuffer> ();
- }
- }
-
- protected IEditableTextBuffer EditableBuffer {
- get {
- if (Document == null)
- throw new InvalidOperationException ("Editor extension not yet initialized");
- return Document.GetContent<IEditableTextBuffer> ();
- }
- }
-
+
protected DocumentStateTracker<XmlParser> Tracker {
get { return tracker; }
}
- protected string GetBufferText (DomRegion region)
+ protected string GetBufferText (DocumentRegion region)
{
- ITextBuffer buf = Buffer;
- int start = buf.GetPositionFromLineColumn (region.BeginLine, region.BeginColumn);
- int end = buf.GetPositionFromLineColumn (region.EndLine, region.EndColumn);
+ int start = Editor.LocationToOffset (region.BeginLine, region.BeginColumn);
+ int end = Editor.LocationToOffset (region.EndLine, region.EndColumn);
if (end > start && start >= 0)
- return buf.GetText (start, end);
+ return Editor.GetTextBetween (start, end);
return null;
}
@@ -219,7 +214,12 @@ namespace MonoDevelop.Xml.Editor
public override string CompletionLanguage {
get { return "Xml"; }
}
-
+
+ protected FilePath FileName {
+ get {
+ return Editor.FileName;
+ }
+ }
protected XDocType DocType {
get { return docType; }
set {
@@ -234,63 +234,55 @@ namespace MonoDevelop.Xml.Editor
{
}
- public override bool KeyPress (Gdk.Key key, char keyChar, Gdk.ModifierType modifier)
+ public override bool KeyPress (KeyDescriptor descriptor)
{
- if (Document.Editor.Options.IndentStyle == IndentStyle.Smart) {
- var newLine = Editor.Caret.Line + 1;
- var ret = base.KeyPress (key, keyChar, modifier);
- if (key == Gdk.Key.Return && Editor.Caret.Line == newLine) {
+ if (Editor.Options.IndentStyle == IndentStyle.Smart) {
+ var newLine = Editor.CaretLine + 1;
+ var ret = base.KeyPress (descriptor);
+ if (descriptor.SpecialKey == SpecialKey.Return && Editor.CaretLine == newLine) {
string indent = GetLineIndent (newLine);
var oldIndent = Editor.GetLineIndent (newLine);
var seg = Editor.GetLine (newLine);
if (oldIndent != indent) {
- int newCaretOffset = Editor.Caret.Offset;
- if (newCaretOffset > seg.Offset) {
- newCaretOffset += (indent.Length - oldIndent.Length);
- }
using (var undo = Editor.OpenUndoGroup ()) {
- Editor.Replace (seg.Offset, oldIndent.Length, indent);
- Editor.Caret.Offset = newCaretOffset;
+ Editor.ReplaceText (seg.Offset, oldIndent.Length, indent);
}
}
}
return ret;
}
- return base.KeyPress (key, keyChar, modifier);
+ return base.KeyPress (descriptor);
}
#region Code completion
- public override ICompletionDataList CodeCompletionCommand (CodeCompletionContext completionContext)
+ public override Task<ICompletionDataList> CodeCompletionCommand (CodeCompletionContext completionContext)
{
int pos = completionContext.TriggerOffset;
if (pos <= 0)
return null;
- int triggerWordLength = 0;
-
tracker.UpdateEngine ();
- return HandleCodeCompletion (completionContext, true, ref triggerWordLength);
+ return HandleCodeCompletion (completionContext, true, default(CancellationToken));
}
- public override ICompletionDataList HandleCodeCompletion (
- CodeCompletionContext completionContext, char completionChar, ref int triggerWordLength)
+ public override Task<ICompletionDataList> HandleCodeCompletionAsync (CodeCompletionContext completionContext, char completionChar, CancellationToken token = default(CancellationToken))
{
int pos = completionContext.TriggerOffset;
char ch = CompletionWidget != null ? CompletionWidget.GetChar (pos - 1) : Editor.GetCharAt (pos - 1);
if (pos > 0 && ch == completionChar) {
tracker.UpdateEngine ();
- return HandleCodeCompletion (completionContext, false, ref triggerWordLength);
+ return HandleCodeCompletion (completionContext, false, token);
}
return null;
}
- protected virtual ICompletionDataList HandleCodeCompletion (
- CodeCompletionContext completionContext, bool forced, ref int triggerWordLength)
+ protected virtual async Task<ICompletionDataList> HandleCodeCompletion (
+ CodeCompletionContext completionContext, bool forced, CancellationToken token)
{
- IEditableTextBuffer buf = EditableBuffer;
+ var buf = this.Editor;
// completionChar may be a space even if the current char isn't, when ctrl-space is fired t
- var currentLocation = new TextLocation (completionContext.TriggerLine, completionContext.TriggerLineOffset);
+ var currentLocation = new DocumentLocation (completionContext.TriggerLine, completionContext.TriggerLineOffset);
char currentChar = completionContext.TriggerOffset < 1? ' ' : buf.GetCharAt (completionContext.TriggerOffset - 1);
char previousChar = completionContext.TriggerOffset < 2? ' ' : buf.GetCharAt (completionContext.TriggerOffset - 2);
@@ -299,13 +291,13 @@ namespace MonoDevelop.Xml.Editor
tracker.Engine.CurrentStateLength, previousChar, currentChar, forced);
//closing tag completion
- if (tracker.Engine.CurrentState is XmlRootState && currentChar == '>')
+ if (tracker.Engine.CurrentState is XmlRootState && currentChar == '>')
return ClosingTagCompletion (buf, currentLocation);
// Auto insert '>' when '/' is typed inside tag state (for quick tag closing)
//FIXME: avoid doing this when the next non-whitespace char is ">" or ignore the next ">" typed
if (XmlEditorOptions.AutoInsertFragments && tracker.Engine.CurrentState is XmlTagState && currentChar == '/') {
- buf.InsertText (buf.CursorPosition, ">");
+ buf.InsertAtCaret (">");
return null;
}
@@ -330,14 +322,15 @@ namespace MonoDevelop.Xml.Editor
list.Add (">").CompletionText = "gt;";
list.Add ("&").CompletionText = "amp;";
- GetEntityCompletions (list);
+ var ecList = await GetEntityCompletions (token);
+ list.AddRange (ecList);
return list;
}
//doctype completion
if (tracker.Engine.CurrentState is XmlDocTypeState) {
if (tracker.Engine.CurrentStateLength == 1) {
- CompletionDataList list = GetDocTypeCompletions ();
+ CompletionDataList list = await GetDocTypeCompletions (token);
if (list != null && list.Count > 0)
return list;
}
@@ -359,9 +352,13 @@ namespace MonoDevelop.Xml.Editor
return null;
//if triggered by first letter of value or forced, grab those letters
- triggerWordLength = Tracker.Engine.CurrentStateLength - 1;
- return GetAttributeValueCompletions (attributedOb, att);
+ var result = await GetAttributeValueCompletions (attributedOb, att, token);
+ if (result != null) {
+ result.TriggerWordLength = Tracker.Engine.CurrentStateLength - 1;
+ return result;
+ }
+ return null;
}
}
@@ -380,17 +377,18 @@ namespace MonoDevelop.Xml.Editor
if (attributedOb.Name.IsValid && (forced ||
(char.IsWhiteSpace (previousChar) && char.IsLetter (currentChar))))
{
-
- if (!forced)
- triggerWordLength = 1;
-
var existingAtts = new Dictionary<string,string> (StringComparer.OrdinalIgnoreCase);
foreach (XAttribute att in attributedOb.Attributes) {
existingAtts [att.Name.FullName] = att.Value ?? string.Empty;
}
-
- return GetAttributeCompletions (attributedOb, existingAtts);
+ var result = await GetAttributeCompletions (attributedOb, existingAtts, token);
+ if (result != null) {
+ if (!forced)
+ result.TriggerWordLength = 1;
+ return result;
+ }
+ return null;
}
}
@@ -402,80 +400,112 @@ namespace MonoDevelop.Xml.Editor
//element completion
if (currentChar == '<' && tracker.Engine.CurrentState is XmlRootState ||
(tracker.Engine.CurrentState is XmlNameState && forced)) {
- var list = new CompletionDataList ();
- GetElementCompletions (list);
+ var list = await GetElementCompletions (token);
AddCloseTag (list, Tracker.Engine.Nodes);
- return list.Count > 0? list : null;
+ return list.Count > 0 ? list : null;
}
if (forced && Tracker.Engine.CurrentState is XmlRootState) {
var list = new CompletionDataList ();
- MonoDevelop.Ide.CodeTemplates.CodeTemplateService.AddCompletionDataForFileName (Document.Name, list);
+ MonoDevelop.Ide.CodeTemplates.CodeTemplateService.AddCompletionDataForFileName (DocumentContext.Name, list);
return list.Count > 0? list : null;
}
return null;
- }
-
- protected virtual ICompletionDataList ClosingTagCompletion (IEditableTextBuffer buf, TextLocation currentLocation)
- {
- //get name of current node in document that's being ended
- var el = tracker.Engine.Nodes.Peek () as XElement;
- if (el != null && el.Region.End >= currentLocation && !el.IsClosed && el.IsNamed) {
- string tag = String.Concat ("</", el.Name.FullName, ">");
- if (XmlEditorOptions.AutoCompleteElements) {
-
- // //make sure we have a clean atomic undo so the user can undo the tag insertion
- // //independently of the >
- // bool wasInAtomicUndo = this.Editor.Document.IsInAtomicUndo;
- // if (wasInAtomicUndo)
- // this.Editor.Document.EndAtomicUndo ();
-
- using (var undo = buf.OpenUndoGroup ()) {
- buf.InsertText (buf.CursorPosition, tag);
- buf.CursorPosition -= tag.Length;
- }
-
- // if (wasInAtomicUndo)
- // this.Editor.Document.BeginAtomicUndo ();
-
- return null;
- } else {
- var cp = new CompletionDataList ();
- cp.Add (new XmlTagCompletionData (tag, 0, true));
- return cp;
- }
- }
- return null;
- }
-
- protected virtual void GetElementCompletions (CompletionDataList list)
- {
- }
-
- protected virtual CompletionDataList GetAttributeCompletions (IAttributedXObject attributedOb,
- Dictionary<string, string> existingAtts)
+ }
+
+
+
+ protected virtual ICompletionDataList ClosingTagCompletion (TextEditor buf, DocumentLocation currentLocation)
+
{
+
+ //get name of current node in document that's being ended
+
+ var el = tracker.Engine.Nodes.Peek () as XElement;
+
+ if (el != null && el.Region.End >= currentLocation && !el.IsClosed && el.IsNamed) {
+
+ string tag = String.Concat ("</", el.Name.FullName, ">");
+
+ if (XmlEditorOptions.AutoCompleteElements) {
+
+
+
+ // //make sure we have a clean atomic undo so the user can undo the tag insertion
+
+ // //independently of the >
+
+ // bool wasInAtomicUndo = this.Editor.Document.IsInAtomicUndo;
+
+ // if (wasInAtomicUndo)
+
+ // this.Editor.Document.EndAtomicUndo ();
+
+
+
+ using (var undo = buf.OpenUndoGroup ()) {
+
+ buf.InsertText (buf.CaretOffset, tag);
+
+ buf.CaretOffset -= tag.Length;
+
+ }
+
+
+
+ // if (wasInAtomicUndo)
+
+ // this.Editor.Document.BeginAtomicUndo ();
+
+
+
+ return null;
+
+ } else {
+
+ var cp = new CompletionDataList ();
+
+ cp.Add (new XmlTagCompletionData (tag, 0, true));
+
+ return cp;
+
+ }
+
+ }
+
return null;
}
- protected virtual CompletionDataList GetAttributeValueCompletions (IAttributedXObject attributedOb, XAttribute att)
+ protected virtual Task<CompletionDataList> GetElementCompletions (CancellationToken token)
{
- return null;
+ return Task.FromResult (new CompletionDataList ());
}
- protected virtual void GetEntityCompletions (CompletionDataList list)
+ protected virtual Task<CompletionDataList> GetAttributeCompletions (IAttributedXObject attributedOb,
+ Dictionary<string, string> existingAtts, CancellationToken token)
{
+ return Task.FromResult (new CompletionDataList ());
}
- protected virtual CompletionDataList GetDocTypeCompletions ()
+ protected virtual Task<CompletionDataList> GetAttributeValueCompletions (IAttributedXObject attributedOb, XAttribute att, CancellationToken token)
{
- return null;
+ return Task.FromResult (new CompletionDataList ());
+ }
+
+ protected virtual Task<CompletionDataList> GetEntityCompletions (CancellationToken token)
+ {
+ return Task.FromResult (new CompletionDataList ());
+ }
+
+ protected virtual Task<CompletionDataList> GetDocTypeCompletions (CancellationToken token)
+ {
+ return Task.FromResult (new CompletionDataList ());
}
protected string GetLineIndent (int line)
{
- var seg = Editor.Document.GetLine (line);
+ var seg = Editor.GetLine (line);
//reset the tracker to the beginning of the line
Tracker.UpdateEngine (seg.Offset);
@@ -575,16 +605,66 @@ namespace MonoDevelop.Xml.Editor
elements.Add (el);
}
}
-
+
+ //Prevents code completion on -, so <!-- doesn't code complete too soon
+ class IgnoreDashKeyHandler : ICompletionKeyHandler
+ {
+ public bool PreProcessKey (CompletionListWindow listWindow, KeyDescriptor descriptor, out KeyActions keyAction)
+ {
+ keyAction = KeyActions.None;
+ if (descriptor.KeyChar == '-') {
+ return true;
+ }
+ return false;
+ }
+
+ public bool PostProcessKey (CompletionListWindow listWindow, KeyDescriptor descriptor, out KeyActions keyAction)
+ {
+ keyAction = KeyActions.None;
+ if (descriptor.KeyChar == '-') {
+ return true;
+ }
+ return false;
+ }
+ }
+
/// <summary>
/// Adds CDATA and comment begin tags.
/// </summary>
protected static void AddMiscBeginTags (CompletionDataList list)
{
list.Add ("!--", "md-literal", GettextCatalog.GetString ("Comment"));
+ list.AddKeyHandler (new IgnoreDashKeyHandler ());
list.Add ("![CDATA[", "md-literal", GettextCatalog.GetString ("Character data"));
}
+ public override bool GetCompletionCommandOffset (out int cpos, out int wlen)
+ {
+ cpos = wlen = 0;
+ int pos = Editor.CaretOffset - 1;
+ while (pos >= 0) {
+ char c = Editor.GetCharAt (pos);
+ if (!char.IsLetterOrDigit (c) && c != '_' && c != ':' && c != '.')
+ break;
+ pos--;
+ }
+ if (pos == -1)
+ return false;
+
+ pos++;
+ cpos = pos;
+ int len = Editor.Length;
+
+ while (pos < len) {
+ char c = Editor.GetCharAt (pos);
+ if (!char.IsLetterOrDigit (c) && c != '_' && c != ':' && c != '.')
+ break;
+ pos++;
+ }
+ wlen = pos - cpos;
+ return true;
+ }
+
#endregion
#region IPathedDocument
@@ -592,7 +672,7 @@ namespace MonoDevelop.Xml.Editor
PathEntry[] currentPath;
bool pathUpdateQueued;
- public override void CursorPositionChanged ()
+ void HandleCaretPositionChanged (object sender, EventArgs e)
{
if (pathUpdateQueued)
return;
@@ -602,7 +682,6 @@ namespace MonoDevelop.Xml.Editor
UpdatePath ();
return false;
});
-
}
public void SelectPath (int depth)
@@ -662,16 +741,16 @@ namespace MonoDevelop.Xml.Editor
//pick out the locations, with some offsets to account for the parsing model
var s = contents? el.Region.End : el.Region.Begin;
var e = contents? el.ClosingTag.Region.Begin : el.ClosingTag.Region.End;
- EditorSelect (new DomRegion (s, e));
+ EditorSelect (new DocumentRegion (s, e));
} else {
LoggingService.LogDebug ("No end tag found for selection");
}
}
- protected void EditorSelect (DomRegion region)
+ protected void EditorSelect (DocumentRegion region)
{
- int s = Editor.Document.LocationToOffset (region.BeginLine, region.BeginColumn);
- int e = Editor.Document.LocationToOffset (region.EndLine, region.EndColumn);
+ int s = Editor.LocationToOffset (region.BeginLine, region.BeginColumn);
+ int e = Editor.LocationToOffset (region.EndLine, region.EndColumn);
if (s > -1 && e > s) {
Editor.SetSelection (s, e);
Editor.ScrollTo (s);
@@ -680,7 +759,7 @@ namespace MonoDevelop.Xml.Editor
public event EventHandler<DocumentPathChangedEventArgs> PathChanged;
- public Widget CreatePathWidget (int index)
+ public Control CreatePathWidget (int index)
{
if (ownerProjects.Count > 1 && index == 0) {
var window = new DropDownBoxListWindow (new DataProvider (this));
@@ -743,7 +822,7 @@ namespace MonoDevelop.Xml.Editor
public void ActivateItem (int n)
{
- ext.Document.AttachToProject (ext.ownerProjects [n]);
+ ext.DocumentContext.AttachToProject (ext.ownerProjects [n]);
}
public int IconCount {
@@ -842,7 +921,7 @@ namespace MonoDevelop.Xml.Editor
var path = new List<PathEntry> ();
if (ownerProjects.Count > 1) {
// Current project if there is more than one
- path.Add (new PathEntry (ImageService.GetIcon (Document.Project.StockIcon), GLib.Markup.EscapeText (Document.Project.Name)) { Tag = Document.Project });
+ path.Add (new PathEntry (ImageService.GetIcon (DocumentContext.Project.StockIcon), GLib.Markup.EscapeText (DocumentContext.Project.Name)) { Tag = DocumentContext.Project });
}
if (l != null) {
for (int i = 0; i < l.Count; i++) {
@@ -940,7 +1019,7 @@ namespace MonoDevelop.Xml.Editor
void refillOutlineStore ()
{
- DispatchService.AssertGuiThread ();
+ Runtime.AssertMainThread ();
Gdk.Threads.Enter ();
refreshingOutline = false;
if (outlineTreeStore == null || !outlineTreeView.IsRealized)
@@ -999,10 +1078,100 @@ namespace MonoDevelop.Xml.Editor
var el = n as XElement;
if (el != null && el.IsClosed && el.ClosingTag.Region.End > region.End) {
- region = new DomRegion (region.Begin, el.ClosingTag.Region.End);
+ region = new DocumentRegion (region.Begin, el.ClosingTag.Region.End);
}
EditorSelect (region);
}
#endregion
+
+ [CommandUpdateHandler (EditCommands.AddCodeComment)]
+ [CommandUpdateHandler (EditCommands.RemoveCodeComment)]
+ [CommandUpdateHandler (EditCommands.ToggleCodeComment)]
+ void ToggleCodeCommentCommandUpdate (CommandInfo info)
+ {
+ info.Enabled = true;
+ info.Visible = true;
+ }
+
+ bool IsInComment ()
+ {
+ Tracker.UpdateEngine ();
+ if (Tracker.Engine.CurrentState is XmlCommentState) {
+ return true;
+ }
+ //If we are not in comment, try parsing 3 letters so in case we are just after
+ //"<" of <!-- we come inside... and state changes into XmlCommentState
+ var engineClone = Tracker.Engine.GetTreeParser ();
+ int j = 0;
+ for (int i = engineClone.Position; i < Editor.Length && j < 3; i++, j++) {
+ engineClone.Push (Editor.GetCharAt (engineClone.Position));
+ }
+ return engineClone.CurrentState is XmlCommentState;
+ }
+
+ [CommandHandler (EditCommands.AddCodeComment)]
+ public void AddCodeCommentCommand ()
+ {
+ if (!IsInComment ()) {
+ ToggleCodeCommentCommandInternal (false);
+ }
+ }
+
+ [CommandHandler (EditCommands.RemoveCodeComment)]
+ public void RemoveCodeCommentCommand ()
+ {
+ if (IsInComment ()) {
+ ToggleCodeCommentCommandInternal (true);
+ }
+ }
+
+ [CommandHandler (EditCommands.ToggleCodeComment)]
+ public void ToggleCodeCommentCommand ()
+ {
+ ToggleCodeCommentCommandInternal (IsInComment ());
+ }
+
+ void ToggleCodeCommentCommandInternal (bool remove)
+ {
+ if (remove) {
+ //We are guarenteed we are inside comment start
+ var treeParser = Tracker.Engine.GetTreeParser ();
+ XComment commentNode = treeParser.Nodes.Peek () as XComment;
+ //Keep parsing XML until end of file or until comment node is ended
+ for (int i = treeParser.Position; i < Editor.Length; i++) {
+ treeParser.Push (Editor.GetCharAt (i));
+ if (commentNode != null) {
+ if (commentNode.IsEnded) {
+ break;
+ }
+ } else {
+ commentNode = treeParser.Nodes.Peek () as XComment;
+ }
+ }
+ //Comment doesn't close until end of file
+ if (commentNode == null || !commentNode.IsEnded) {
+ return;
+ }
+ var startOffset = Editor.LocationToOffset (commentNode.Region.Begin);
+ var endOffset = Editor.LocationToOffset (commentNode.Region.End) - 3 - 4;//-3 because End is after "-->", -4 because removed "<!--" just before
+ using (Editor.OpenUndoGroup ()) {
+ Editor.RemoveText (startOffset, 4);//4 equals "<!--"
+ Editor.RemoveText (endOffset, 3);//3 equals "-->"
+ }
+ } else {
+ using (Editor.OpenUndoGroup ()) {
+ if (Editor.IsSomethingSelected) {
+ //end variable is also used because inserting start deselectes text and Editor.SelectionRange.EndOffset becomes invalid
+ var end = Editor.SelectionRange.EndOffset + 4;//+4 equals "<!--" inserted in next line
+ Editor.InsertText (Editor.SelectionRange.Offset, "<!--");
+ Editor.InsertText (end, "-->");
+ } else {
+ var currentLine = Editor.GetLine (Editor.CaretLine);
+ Editor.InsertText (currentLine.Offset, "<!--");
+ Editor.InsertText (currentLine.EndOffset, "-->");//currentLine.EndOffset updates automaticlly
+ }
+ }
+ }
+ }
}
}
diff --git a/main/src/addins/Xml/Editor/XmlDocumentParser.cs b/main/src/addins/Xml/Editor/XmlDocumentParser.cs
index 5f17fead35..ff71b05cc5 100644
--- a/main/src/addins/Xml/Editor/XmlDocumentParser.cs
+++ b/main/src/addins/Xml/Editor/XmlDocumentParser.cs
@@ -27,7 +27,8 @@
//
using System;
-using System.IO;
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Xml.Parser;
@@ -36,24 +37,31 @@ namespace MonoDevelop.Xml.Editor
{
class XmlDocumentParser : TypeSystemParser
{
- public override ParsedDocument Parse (bool storeAst, string fileName, TextReader content, MonoDevelop.Projects.Project project = null)
+ public override Task<ParsedDocument> Parse (ParseOptions options, CancellationToken cancellationToken)
{
- var doc = new XmlParsedDocument (fileName);
+ return Task.Run (() => ParseInternal (options, cancellationToken));
+ }
+
+ ParsedDocument ParseInternal (ParseOptions options, CancellationToken cancellationToken)
+ {
+ var doc = new XmlParsedDocument (options.FileName);
doc.Flags |= ParsedDocumentFlags.NonSerializable;
+ var xmlParser = new XmlParser (new XmlRootState (), true);
+
try {
- var xmlParser = new XmlParser (new XmlRootState (), true);
- xmlParser.Parse (content);
- doc.XDocument = xmlParser.Nodes.GetRoot ();
- doc.Add (xmlParser.Errors);
-
- if (doc.XDocument != null && doc.XDocument.RootElement != null) {
- if (!doc.XDocument.RootElement.IsEnded)
- doc.XDocument.RootElement.End (xmlParser.Location);
- }
+ xmlParser.Parse (options.Content.CreateReader ());
+ } catch (Exception ex) {
+ Core.LoggingService.LogError ("Unhandled error parsing xml document", ex);
}
- catch (Exception ex) {
- MonoDevelop.Core.LoggingService.LogError ("Unhandled error parsing xml document", ex);
+
+ doc.XDocument = xmlParser.Nodes.GetRoot ();
+ doc.AddRange (xmlParser.Errors);
+
+ if (doc.XDocument != null && doc.XDocument.RootElement != null) {
+ if (!doc.XDocument.RootElement.IsEnded)
+ doc.XDocument.RootElement.End (xmlParser.Location);
}
+
return doc;
}
}
diff --git a/main/src/addins/Xml/Editor/XmlEditorOptionsPanel.cs b/main/src/addins/Xml/Editor/XmlEditorOptionsPanel.cs
index e9e6cc337a..a1106855ec 100644
--- a/main/src/addins/Xml/Editor/XmlEditorOptionsPanel.cs
+++ b/main/src/addins/Xml/Editor/XmlEditorOptionsPanel.cs
@@ -22,8 +22,8 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-using System;
-using Gtk;
+using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Core;
@@ -36,7 +36,7 @@ namespace MonoDevelop.Xml.Editor
{
XmlEditorOptionsPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
widget = new XmlEditorOptionsPanelWidget();
widget.AutoCompleteElements = XmlEditorOptions.AutoCompleteElements;
diff --git a/main/src/addins/Xml/Editor/XmlEditorService.cs b/main/src/addins/Xml/Editor/XmlEditorService.cs
index 513b2e7458..4b388eb528 100644
--- a/main/src/addins/Xml/Editor/XmlEditorService.cs
+++ b/main/src/addins/Xml/Editor/XmlEditorService.cs
@@ -1,42 +1,48 @@
-//
-// MonoDevelop XML Editor
-//
-// Copyright (C) 2006-2007 Matthew Ward
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+//
+// MonoDevelop XML Editor
+//
+// Copyright (C) 2006-2007 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
-using System.Text;
-using System.Xml;
-using System.Xml.Schema;
+using System.Text;
+using System.Xml;
+using System.Xml.Schema;
+using System.Xml.XPath;
+using System.Xml.Xsl;
+using MonoDevelop.Components;
+using Gtk;
+using MonoDevelop.Components.Extensions;
+using MonoDevelop.Ide.Editor;
using System.Xml.XPath;
using System.Xml.Xsl;
using MonoDevelop.Components;
using MonoDevelop.Components.Extensions;
-using MonoDevelop.Core;
-using MonoDevelop.Ide;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Tasks;
-using MonoDevelop.Projects;
+using MonoDevelop.Core;
+using MonoDevelop.Ide;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide.Tasks;
+using MonoDevelop.Projects;
using MonoDevelop.Xml.Completion;
namespace MonoDevelop.Xml.Editor
@@ -44,7 +50,7 @@ namespace MonoDevelop.Xml.Editor
static class XmlEditorService
{
#region Task management
- public static void AddTask(string fileName, string message, int column, int line, TaskSeverity taskType)
+ public static void AddTask(string fileName, string message, int column, int line, TaskSeverity taskType)
{
// HACK: Use a compiler error since we cannot add an error
// task otherwise (task type property is read-only and
@@ -55,23 +61,23 @@ namespace MonoDevelop.Xml.Editor
error.ErrorText = message;
error.FileName = fileName;
error.IsWarning = false;
-
+
//Task task = new Task(fileName, message, column, line);
- Task task = new Task (error);
- TaskService.Errors.Add(task);
- }
- #endregion
-
+ TaskListEntry task = new TaskListEntry (error);
+ TaskService.Errors.Add(task);
+ }
+ #endregion
+
#region View tracking
-
- public static XmlTextEditorExtension ActiveEditor {
- get {
- Document doc = IdeApp.Workbench.ActiveDocument;
- if (doc != null)
- return doc.GetContent<XmlTextEditorExtension>();
- return null;
- }
- }
+
+ public static XmlTextEditorExtension ActiveEditor {
+ get {
+ Document doc = IdeApp.Workbench.ActiveDocument;
+ if (doc != null)
+ return doc.GetContent<XmlTextEditorExtension>();
+ return null;
+ }
+ }
public static ReadOnlyCollection<XmlTextEditorExtension> OpenXmlEditorViews {
get {
@@ -89,8 +95,8 @@ namespace MonoDevelop.Xml.Editor
get {
return ActiveEditor != null;
}
- }
- #endregion
+ }
+ #endregion
/*
public static bool IsXslOutputViewContentActive {
@@ -100,342 +106,342 @@ namespace MonoDevelop.Xml.Editor
}
}*/
- public static IProgressMonitor GetMonitor ()
+ public static ProgressMonitor GetMonitor ()
{
return IdeApp.Workbench.ProgressMonitors.GetOutputProgressMonitor ("XML", "md-xml-file-icon", true, true);
- }
-
+ }
+
#region Formatting utilities
/// <summary>
/// Creates a XmlTextWriter using the current text editor
/// properties for indentation.
/// </summary>
- public static XmlTextWriter CreateXmlTextWriter (Document doc, TextWriter textWriter)
+ public static XmlTextWriter CreateXmlTextWriter (TextEditor doc, TextWriter textWriter)
{
- XmlTextWriter xmlWriter = new XmlTextWriter(textWriter);
- xmlWriter.Formatting = System.Xml.Formatting.Indented;
- if (doc.Editor.TabsToSpaces) {
- xmlWriter.Indentation = doc.Editor.Options.TabSize;
- xmlWriter.IndentChar = ' ';
- } else {
- xmlWriter.Indentation = 1;
- xmlWriter.IndentChar = '\t';
- }
+ XmlTextWriter xmlWriter = new XmlTextWriter(textWriter);
+ xmlWriter.Formatting = System.Xml.Formatting.Indented;
+ if (doc.Options.TabsToSpaces) {
+ xmlWriter.Indentation = doc.Options.TabSize;
+ xmlWriter.IndentChar = ' ';
+ } else {
+ xmlWriter.Indentation = 1;
+ xmlWriter.IndentChar = '\t';
+ }
return xmlWriter;
- }
-
- public static XmlTextWriter CreateXmlTextWriter (Document doc)
- {
- return CreateXmlTextWriter (doc, new EncodedStringWriter (Encoding.UTF8));
- }
-
+ }
+
+ public static XmlTextWriter CreateXmlTextWriter (TextEditor doc)
+ {
+ return CreateXmlTextWriter (doc, new EncodedStringWriter (Encoding.UTF8));
+ }
+
#endregion
- /// <summary>
- /// Runs an XSL transform on the input xml.
- /// </summary>
- /// <param name="input">The input xml to transform.</param>
- /// <param name="transform">The transform xml.</param>
- /// <returns>The output of the transform.</returns>
- public static string Transform (string input, string transform)
- {
- StringReader inputString = new StringReader (input);
- XPathDocument sourceDocument = new XPathDocument (inputString);
-
- StringReader transformString = new StringReader (transform);
- XPathDocument transformDocument = new XPathDocument (transformString);
-
- XslCompiledTransform xslTransform = new XslCompiledTransform ();
+ /// <summary>
+ /// Runs an XSL transform on the input xml.
+ /// </summary>
+ /// <param name="input">The input xml to transform.</param>
+ /// <param name="transform">The transform xml.</param>
+ /// <returns>The output of the transform.</returns>
+ public static string Transform (string input, string transform)
+ {
+ StringReader inputString = new StringReader (input);
+ XPathDocument sourceDocument = new XPathDocument (inputString);
+
+ StringReader transformString = new StringReader (transform);
+ XPathDocument transformDocument = new XPathDocument (transformString);
+
+ XslCompiledTransform xslTransform = new XslCompiledTransform ();
xslTransform.Load (transformDocument, null, new XmlUrlResolver ());
-
- MemoryStream outputStream = new MemoryStream ();
- XmlTextWriter writer = new XmlTextWriter (outputStream, Encoding.UTF8);
-
- xslTransform.Transform (sourceDocument, writer);
-
- int preambleLength = Encoding.UTF8.GetPreamble ().Length;
- byte[] outputBytes = outputStream.ToArray ();
- return UTF8Encoding.UTF8.GetString (outputBytes, preambleLength, outputBytes.Length - preambleLength);
- }
-
- public static string CreateSchema (Document doc, string xml)
- {
- using (System.Data.DataSet dataSet = new System.Data.DataSet()) {
- dataSet.ReadXml(new StringReader (xml), System.Data.XmlReadMode.InferSchema);
- using (EncodedStringWriter writer = new EncodedStringWriter (Encoding.UTF8)) {
- using (XmlTextWriter xmlWriter = XmlEditorService.CreateXmlTextWriter (doc, writer)) {
- dataSet.WriteXmlSchema(xmlWriter);
- return writer.ToString();
+
+ MemoryStream outputStream = new MemoryStream ();
+ XmlTextWriter writer = new XmlTextWriter (outputStream, Encoding.UTF8);
+
+ xslTransform.Transform (sourceDocument, writer);
+
+ int preambleLength = Encoding.UTF8.GetPreamble ().Length;
+ byte[] outputBytes = outputStream.ToArray ();
+ return UTF8Encoding.UTF8.GetString (outputBytes, preambleLength, outputBytes.Length - preambleLength);
+ }
+
+ public static string CreateSchema (TextEditor doc, string xml)
+ {
+ using (System.Data.DataSet dataSet = new System.Data.DataSet()) {
+ dataSet.ReadXml(new StringReader (xml), System.Data.XmlReadMode.InferSchema);
+ using (EncodedStringWriter writer = new EncodedStringWriter (Encoding.UTF8)) {
+ using (XmlTextWriter xmlWriter = XmlEditorService.CreateXmlTextWriter (doc, writer)) {
+ dataSet.WriteXmlSchema(xmlWriter);
+ return writer.ToString();
}
- }
- }
- }
-
- public static string GenerateFileName (string sourceName, string extensionFormat)
- {
- return GenerateFileName (
- Path.Combine (Path.GetDirectoryName (sourceName), Path.GetFileNameWithoutExtension (sourceName)) +
- extensionFormat);
- }
-
- // newNameFormat should be a string format for the new filename such as
- // "/some/path/oldname{0}.xsd", where {0} is the index that will be incremented until a
- // non-existing file is found.
- public static string GenerateFileName (string newNameFormat)
- {
- string generatedFilename = string.Format (newNameFormat, "");
+ }
+ }
+ }
+
+ public static string GenerateFileName (string sourceName, string extensionFormat)
+ {
+ return GenerateFileName (
+ Path.Combine (Path.GetDirectoryName (sourceName), Path.GetFileNameWithoutExtension (sourceName)) +
+ extensionFormat);
+ }
+
+ // newNameFormat should be a string format for the new filename such as
+ // "/some/path/oldname{0}.xsd", where {0} is the index that will be incremented until a
+ // non-existing file is found.
+ public static string GenerateFileName (string newNameFormat)
+ {
+ string generatedFilename = string.Format (newNameFormat, "");
int count = 1;
while (File.Exists (generatedFilename)) {
- generatedFilename = string.Format (newNameFormat, count);
- ++count;
- }
- return generatedFilename;
- }
-
- #region Validation
-
- /// <summary>
- /// Checks that the xml in this view is well-formed.
- /// </summary>
- public static XmlDocument ValidateWellFormedness (IProgressMonitor monitor, string xml, string fileName)
- {
+ generatedFilename = string.Format (newNameFormat, count);
+ ++count;
+ }
+ return generatedFilename;
+ }
+
+ #region Validation
+
+ /// <summary>
+ /// Checks that the xml in this view is well-formed.
+ /// </summary>
+ public static XmlDocument ValidateWellFormedness (ProgressMonitor monitor, string xml, string fileName)
+ {
monitor.BeginTask (GettextCatalog.GetString ("Validating XML..."), 1);
- bool error = false;
- XmlDocument doc = null;
+ bool error = false;
+ XmlDocument doc = null;
try {
- doc = new XmlDocument ();
- doc.LoadXml (xml);
- } catch (XmlException ex) {
- monitor.ReportError (ex.Message, ex);
- AddTask (fileName, ex.Message, ex.LinePosition, ex.LineNumber, TaskSeverity.Error);
- error = true;
- }
+ doc = new XmlDocument ();
+ doc.LoadXml (xml);
+ } catch (XmlException ex) {
+ monitor.ReportError (ex.Message, ex);
+ AddTask (fileName, ex.Message, ex.LinePosition, ex.LineNumber, TaskSeverity.Error);
+ error = true;
+ }
- if (error) {
+ if (error) {
monitor.Log.WriteLine (GettextCatalog.GetString ("Validation failed."));
TaskService.ShowErrors ();
- } else {
- monitor.Log.WriteLine (GettextCatalog.GetString ("XML is valid."));
- }
-
- monitor.EndTask ();
+ } else {
+ monitor.Log.WriteLine (GettextCatalog.GetString ("XML is valid."));
+ }
+
+ monitor.EndTask ();
return error? null: doc;
- }
-
- /// <summary>
- /// Validates the xml against known schemas.
+ }
+
+ /// <summary>
+ /// Validates the xml against known schemas.
/// </summary>
- public static XmlDocument ValidateXml (IProgressMonitor monitor, string xml, string fileName)
+ public static XmlDocument ValidateXml (ProgressMonitor monitor, string xml, string fileName)
{
monitor.BeginTask (GettextCatalog.GetString ("Validating XML..."), 1);
- bool error = false;
- XmlDocument doc = null;
- StringReader stringReader = new StringReader (xml);
-
- XmlReaderSettings settings = new XmlReaderSettings ();
- settings.ValidationFlags = XmlSchemaValidationFlags.ProcessIdentityConstraints
- | XmlSchemaValidationFlags.ProcessInlineSchema
- | XmlSchemaValidationFlags.ProcessSchemaLocation
- | XmlSchemaValidationFlags.ReportValidationWarnings;
- settings.ValidationType = ValidationType.Schema;
- settings.DtdProcessing = DtdProcessing.Parse;
-
- ValidationEventHandler validationHandler = delegate (object sender, System.Xml.Schema.ValidationEventArgs args) {
- if (args.Severity == XmlSeverityType.Warning) {
- monitor.Log.WriteLine (args.Message);
- AddTask (fileName, args.Exception.Message, args.Exception.LinePosition, args.Exception.LineNumber,TaskSeverity.Warning);
- } else {
- AddTask (fileName, args.Exception.Message, args.Exception.LinePosition, args.Exception.LineNumber,TaskSeverity.Error);
- monitor.Log.WriteLine (args.Message);
- error = true;
- }
- };
- settings.ValidationEventHandler += validationHandler;
-
+ bool error = false;
+ XmlDocument doc = null;
+ StringReader stringReader = new StringReader (xml);
+
+ XmlReaderSettings settings = new XmlReaderSettings ();
+ settings.ValidationFlags = XmlSchemaValidationFlags.ProcessIdentityConstraints
+ | XmlSchemaValidationFlags.ProcessInlineSchema
+ | XmlSchemaValidationFlags.ProcessSchemaLocation
+ | XmlSchemaValidationFlags.ReportValidationWarnings;
+ settings.ValidationType = ValidationType.Schema;
+ settings.DtdProcessing = DtdProcessing.Parse;
+
+ ValidationEventHandler validationHandler = delegate (object sender, System.Xml.Schema.ValidationEventArgs args) {
+ if (args.Severity == XmlSeverityType.Warning) {
+ monitor.Log.WriteLine (args.Message);
+ AddTask (fileName, args.Exception.Message, args.Exception.LinePosition, args.Exception.LineNumber,TaskSeverity.Warning);
+ } else {
+ AddTask (fileName, args.Exception.Message, args.Exception.LinePosition, args.Exception.LineNumber,TaskSeverity.Error);
+ monitor.Log.WriteLine (args.Message);
+ error = true;
+ }
+ };
+ settings.ValidationEventHandler += validationHandler;
+
try {
- foreach (XmlSchemaCompletionData sd in XmlSchemaManager.SchemaCompletionDataItems)
- settings.Schemas.Add (sd.Schema);
- settings.Schemas.Compile ();
-
- XmlReader reader = XmlReader.Create (stringReader, settings);
- doc = new XmlDocument();
- doc.Load (reader);
-
- } catch (XmlSchemaException ex) {
- monitor.ReportError (ex.Message, ex);
- AddTask (fileName, ex.Message, ex.LinePosition, ex.LineNumber,TaskSeverity.Error);
- error = true;
- }
- catch (XmlException ex) {
- monitor.ReportError (ex.Message, ex);
- AddTask (fileName, ex.Message, ex.LinePosition, ex.LineNumber,TaskSeverity.Error);
- error = true;
- }
- finally {
- if (stringReader != null)
- stringReader.Dispose ();
- settings.ValidationEventHandler -= validationHandler;
+ foreach (XmlSchemaCompletionData sd in XmlSchemaManager.SchemaCompletionDataItems)
+ settings.Schemas.Add (sd.Schema);
+ settings.Schemas.Compile ();
+
+ XmlReader reader = XmlReader.Create (stringReader, settings);
+ doc = new XmlDocument();
+ doc.Load (reader);
+
+ } catch (XmlSchemaException ex) {
+ monitor.ReportError (ex.Message, ex);
+ AddTask (fileName, ex.Message, ex.LinePosition, ex.LineNumber,TaskSeverity.Error);
+ error = true;
+ }
+ catch (XmlException ex) {
+ monitor.ReportError (ex.Message, ex);
+ AddTask (fileName, ex.Message, ex.LinePosition, ex.LineNumber,TaskSeverity.Error);
+ error = true;
+ }
+ finally {
+ if (stringReader != null)
+ stringReader.Dispose ();
+ settings.ValidationEventHandler -= validationHandler;
}
- if (error) {
+ if (error) {
monitor.Log.WriteLine (GettextCatalog.GetString ("Validation failed."));
TaskService.ShowErrors ();
} else {
- monitor.Log.WriteLine (GettextCatalog.GetString ("XML is valid."));
- }
-
- monitor.EndTask ();
- return error? null: doc;
- }
-
- /// <summary>
- /// Validates the schema.
+ monitor.Log.WriteLine (GettextCatalog.GetString ("XML is valid."));
+ }
+
+ monitor.EndTask ();
+ return error? null: doc;
+ }
+
+ /// <summary>
+ /// Validates the schema.
/// </summary>
- public static XmlSchema ValidateSchema (IProgressMonitor monitor, string xml, string fileName)
+ public static XmlSchema ValidateSchema (ProgressMonitor monitor, string xml, string fileName)
{
monitor.BeginTask (GettextCatalog.GetString ("Validating schema..."), 1);
- bool error = false;
- XmlSchema schema = null;
- try {
- StringReader stringReader = new StringReader (xml);
- XmlTextReader xmlReader = new XmlTextReader (stringReader);
+ bool error = false;
+ XmlSchema schema = null;
+ try {
+ StringReader stringReader = new StringReader (xml);
+ XmlTextReader xmlReader = new XmlTextReader (stringReader);
xmlReader.XmlResolver = null;
-
- ValidationEventHandler callback = delegate (object source, ValidationEventArgs args) {
- if (args.Severity == XmlSeverityType.Warning) {
- monitor.ReportWarning (args.Message);
- } else {
- monitor.ReportError (args.Message, args.Exception);
- error = true;
- }
- AddTask (fileName, args.Message, args.Exception.LinePosition, args.Exception.LineNumber,
- (args.Severity == XmlSeverityType.Warning)? TaskSeverity.Warning : TaskSeverity.Error);
+
+ ValidationEventHandler callback = delegate (object source, ValidationEventArgs args) {
+ if (args.Severity == XmlSeverityType.Warning) {
+ monitor.ReportWarning (args.Message);
+ } else {
+ monitor.ReportError (args.Message, args.Exception);
+ error = true;
+ }
+ AddTask (fileName, args.Message, args.Exception.LinePosition, args.Exception.LineNumber,
+ (args.Severity == XmlSeverityType.Warning)? TaskSeverity.Warning : TaskSeverity.Error);
};
- schema = XmlSchema.Read (xmlReader, callback);
- XmlSchemaSet sset = new XmlSchemaSet ();
- sset.Add (schema);
- sset.ValidationEventHandler += callback;
+ schema = XmlSchema.Read (xmlReader, callback);
+ XmlSchemaSet sset = new XmlSchemaSet ();
+ sset.Add (schema);
+ sset.ValidationEventHandler += callback;
sset.Compile ();
- }
- catch (XmlSchemaException ex) {
- monitor.ReportError (ex.Message, ex);
- AddTask (fileName, ex.Message, ex.LinePosition, ex.LineNumber,TaskSeverity.Error);
- error = true;
- }
- catch (XmlException ex) {
- monitor.ReportError (ex.Message, ex);
- AddTask (fileName, ex.Message, ex.LinePosition, ex.LineNumber,TaskSeverity.Error);
- error = true;
- }
+ }
+ catch (XmlSchemaException ex) {
+ monitor.ReportError (ex.Message, ex);
+ AddTask (fileName, ex.Message, ex.LinePosition, ex.LineNumber,TaskSeverity.Error);
+ error = true;
+ }
+ catch (XmlException ex) {
+ monitor.ReportError (ex.Message, ex);
+ AddTask (fileName, ex.Message, ex.LinePosition, ex.LineNumber,TaskSeverity.Error);
+ error = true;
+ }
- if (error) {
+ if (error) {
monitor.Log.WriteLine (GettextCatalog.GetString ("Validation failed."));
TaskService.ShowErrors ();
} else {
- monitor.Log.WriteLine (GettextCatalog.GetString ("Schema is valid."));
- }
-
- monitor.EndTask ();
- return error? null: schema;
- }
-
- public static XslCompiledTransform ValidateStylesheet (IProgressMonitor monitor, string xml, string fileName)
- {
+ monitor.Log.WriteLine (GettextCatalog.GetString ("Schema is valid."));
+ }
+
+ monitor.EndTask ();
+ return error? null: schema;
+ }
+
+ public static XslCompiledTransform ValidateStylesheet (ProgressMonitor monitor, string xml, string fileName)
+ {
monitor.BeginTask (GettextCatalog.GetString ("Validating stylesheet..."), 1);
- bool error = true;
- XslCompiledTransform xslt = null;
-
- try {
- StringReader reader = new StringReader (xml);
- XPathDocument doc = new XPathDocument (reader);
- xslt = new XslCompiledTransform ();
- xslt.Load (doc, null, new XmlUrlResolver ());
- error = false;
- } catch (XsltCompileException ex) {
- monitor.ReportError (ex.Message, ex);
- AddTask (fileName, ex.Message, ex.LinePosition, ex.LineNumber,TaskSeverity.Error);
- }
- catch (XsltException ex) {
- monitor.ReportError (ex.Message, ex);
- AddTask (fileName, ex.Message, ex.LinePosition, ex.LineNumber,TaskSeverity.Error);
- }
- catch (XmlException ex) {
- monitor.ReportError (ex.Message, ex);
- AddTask (fileName, ex.Message, ex.LinePosition, ex.LineNumber,TaskSeverity.Error);
- }
-
- if (error) {
+ bool error = true;
+ XslCompiledTransform xslt = null;
+
+ try {
+ StringReader reader = new StringReader (xml);
+ XPathDocument doc = new XPathDocument (reader);
+ xslt = new XslCompiledTransform ();
+ xslt.Load (doc, null, new XmlUrlResolver ());
+ error = false;
+ } catch (XsltCompileException ex) {
+ monitor.ReportError (ex.Message, ex);
+ AddTask (fileName, ex.Message, ex.LinePosition, ex.LineNumber,TaskSeverity.Error);
+ }
+ catch (XsltException ex) {
+ monitor.ReportError (ex.Message, ex);
+ AddTask (fileName, ex.Message, ex.LinePosition, ex.LineNumber,TaskSeverity.Error);
+ }
+ catch (XmlException ex) {
+ monitor.ReportError (ex.Message, ex);
+ AddTask (fileName, ex.Message, ex.LinePosition, ex.LineNumber,TaskSeverity.Error);
+ }
+
+ if (error) {
monitor.Log.WriteLine (GettextCatalog.GetString ("Validation failed."));
TaskService.ShowErrors ();
} else {
- monitor.Log.WriteLine (GettextCatalog.GetString ("Stylesheet is valid."));
- }
- return error? null: xslt;
- }
-
- #endregion
-
- #region File browsing utilities
-
- /// <summary>Allows the user to browse the file system for a stylesheet.</summary>
- /// <returns>The stylesheet filename the user selected; otherwise null.</returns>
- public static string BrowseForStylesheetFile ()
- {
- var dlg = new SelectFileDialog (GettextCatalog.GetString ("Select XSLT Stylesheet")) {
- TransientFor = IdeApp.Workbench.RootWindow,
- };
- dlg.AddFilter (new SelectFileDialogFilter (
- GettextCatalog.GetString ("XML Files"),
- new string[] { "*.xml" },
- new string[] { "text/xml", "application/xml" }
- ));
- dlg.AddFilter (new SelectFileDialogFilter(
- GettextCatalog.GetString ("XSL Files"),
- new string[] { "*.xslt", "*.xsl" },
- new string[] { "text/x-xslt" }
- ));
- dlg.AddAllFilesFilter ();
-
- if (dlg.Run ())
- return dlg.SelectedFile;
- return null;
- }
-
- /// <summary>Allows the user to browse the file system for a schema.</summary>
- /// <returns>The schema filename the user selected; otherwise null.</returns>
- public static string BrowseForSchemaFile ()
- {
- var dlg = new SelectFileDialog (GettextCatalog.GetString ("Select XML Schema"));
- dlg.AddFilter (new SelectFileDialogFilter (
- GettextCatalog.GetString ("XML Files"),
- new string[] { "*.xsd" },
- new string[] { "text/xml", "application/xml" }
- ));
- dlg.AddAllFilesFilter ();
-
- if (dlg.Run ())
- return dlg.SelectedFile;
- return null;
- }
-
- #endregion
-
- class EncodedStringWriter : StringWriter
- {
- readonly Encoding encoding;
-
- public EncodedStringWriter(Encoding encoding)
- {
- this.encoding = encoding;
- }
-
- public override Encoding Encoding {
- get {
- return encoding;
- }
- }
+ monitor.Log.WriteLine (GettextCatalog.GetString ("Stylesheet is valid."));
+ }
+ return error? null: xslt;
+ }
+
+ #endregion
+
+ #region File browsing utilities
+
+ /// <summary>Allows the user to browse the file system for a stylesheet.</summary>
+ /// <returns>The stylesheet filename the user selected; otherwise null.</returns>
+ public static string BrowseForStylesheetFile ()
+ {
+ var dlg = new SelectFileDialog (GettextCatalog.GetString ("Select XSLT Stylesheet")) {
+ TransientFor = IdeApp.Workbench.RootWindow,
+ };
+ dlg.AddFilter (new SelectFileDialogFilter (
+ GettextCatalog.GetString ("XML Files"),
+ new string[] { "*.xml" },
+ new string[] { "text/xml", "application/xml" }
+ ));
+ dlg.AddFilter (new SelectFileDialogFilter(
+ GettextCatalog.GetString ("XSL Files"),
+ new string[] { "*.xslt", "*.xsl" },
+ new string[] { "text/x-xslt" }
+ ));
+ dlg.AddAllFilesFilter ();
+
+ if (dlg.Run ())
+ return dlg.SelectedFile;
+ return null;
+ }
+
+ /// <summary>Allows the user to browse the file system for a schema.</summary>
+ /// <returns>The schema filename the user selected; otherwise null.</returns>
+ public static string BrowseForSchemaFile ()
+ {
+ var dlg = new SelectFileDialog (GettextCatalog.GetString ("Select XML Schema"));
+ dlg.AddFilter (new SelectFileDialogFilter (
+ GettextCatalog.GetString ("XML Files"),
+ new string[] { "*.xsd" },
+ new string[] { "text/xml", "application/xml" }
+ ));
+ dlg.AddAllFilesFilter ();
+
+ if (dlg.Run ())
+ return dlg.SelectedFile;
+ return null;
+ }
+
+ #endregion
+
+ class EncodedStringWriter : StringWriter
+ {
+ readonly Encoding encoding;
+
+ public EncodedStringWriter(Encoding encoding)
+ {
+ this.encoding = encoding;
+ }
+
+ public override Encoding Encoding {
+ get {
+ return encoding;
+ }
+ }
}
}
}
diff --git a/main/src/addins/Xml/Editor/XmlParsedDocument.cs b/main/src/addins/Xml/Editor/XmlParsedDocument.cs
index bd6bc32cbf..94de472070 100644
--- a/main/src/addins/Xml/Editor/XmlParsedDocument.cs
+++ b/main/src/addins/Xml/Editor/XmlParsedDocument.cs
@@ -29,8 +29,9 @@
using System;
using System.Collections.Generic;
using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
+using System.Linq;
namespace MonoDevelop.Xml.Editor
{
@@ -41,19 +42,24 @@ namespace MonoDevelop.Xml.Editor
}
public XDocument XDocument { get; set; }
-
- public override IEnumerable<FoldingRegion> Foldings {
+
+ public override System.Threading.Tasks.Task<IReadOnlyList<FoldingRegion>> GetFoldingsAsync (System.Threading.CancellationToken cancellationToken)
+ {
+ return System.Threading.Tasks.Task.FromResult((IReadOnlyList<FoldingRegion>)Foldings.ToList ());
+ }
+
+ public IEnumerable<FoldingRegion> Foldings {
get {
if (XDocument == null)
yield break;
- foreach (var region in Comments.ToFolds ())
+ foreach (var region in GetCommentsAsync().Result.ToFolds ())
yield return region;
foreach (XNode node in XDocument.AllDescendentNodes) {
if (node is XCData)
{
if (node.Region.EndLine - node.Region.BeginLine > 2)
yield return new FoldingRegion ("<![CDATA[ ]]>", node.Region);
- }
+ }
else if (node is XComment)
{
if (node.Region.EndLine - node.Region.BeginLine > 2)
@@ -65,7 +71,7 @@ namespace MonoDevelop.Xml.Editor
if (el.IsClosed && el.ClosingTag.Region.EndLine - el.Region.BeginLine > 2) {
yield return new FoldingRegion
(string.Format ("<{0}...>", el.Name.FullName),
- new DomRegion (el.Region.Begin, el.ClosingTag.Region.End));
+ new DocumentRegion (el.Region.Begin, el.ClosingTag.Region.End));
}
}
else if (node is XDocType)
diff --git a/main/src/addins/Xml/Editor/XmlSchemasPanel.cs b/main/src/addins/Xml/Editor/XmlSchemasPanel.cs
index bae0f24d56..cf0820b173 100644
--- a/main/src/addins/Xml/Editor/XmlSchemasPanel.cs
+++ b/main/src/addins/Xml/Editor/XmlSchemasPanel.cs
@@ -24,7 +24,7 @@
using System;
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.Xml.Editor
@@ -36,7 +36,7 @@ namespace MonoDevelop.Xml.Editor
{
XmlSchemasPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
widget = new XmlSchemasPanelWidget ();
widget.LoadUserSchemas (XmlSchemaManager.UserSchemas);
diff --git a/main/src/addins/Xml/Editor/XmlSchemasPanelWidget.cs b/main/src/addins/Xml/Editor/XmlSchemasPanelWidget.cs
index a2e5a5b8eb..f021a24120 100644
--- a/main/src/addins/Xml/Editor/XmlSchemasPanelWidget.cs
+++ b/main/src/addins/Xml/Editor/XmlSchemasPanelWidget.cs
@@ -73,8 +73,7 @@ namespace MonoDevelop.Xml.Editor
: GettextCatalog.GetString ("User schema");
});
- registeredSchemasStore.SetSortFunc (0,
- (model, a, b) => string.Compare (GetSchema (a).NamespaceUri, GetSchema (b).NamespaceUri, StringComparison.Ordinal));
+ registeredSchemasStore.SetSortFunc (0, SortSchemas);
registeredSchemasStore.SetSortColumnId (0, SortType.Ascending);
@@ -183,6 +182,11 @@ namespace MonoDevelop.Xml.Editor
XmlSchemaCompletionData GetSchema (TreeIter iter)
{
+ return GetSchema (registeredSchemasStore, iter);
+ }
+
+ static XmlSchemaCompletionData GetSchema (ListStore registeredSchemasStore, TreeIter iter)
+ {
return (XmlSchemaCompletionData) registeredSchemasStore.GetValue (iter, 0);
}
@@ -201,6 +205,12 @@ namespace MonoDevelop.Xml.Editor
valid = model.IterNext (ref iter);
}
}
+
+ static int SortSchemas (TreeModel model, TreeIter a, TreeIter b)
+ {
+ var listStore = (ListStore)model;
+ return string.Compare (GetSchema (listStore, a).NamespaceUri, GetSchema (listStore, b).NamespaceUri, StringComparison.Ordinal);
+ }
#region Schema accessors
diff --git a/main/src/addins/Xml/Editor/XmlTextEditorExtension.cs b/main/src/addins/Xml/Editor/XmlTextEditorExtension.cs
index 97017cb251..808883dc99 100644
--- a/main/src/addins/Xml/Editor/XmlTextEditorExtension.cs
+++ b/main/src/addins/Xml/Editor/XmlTextEditorExtension.cs
@@ -32,17 +32,21 @@ using System.Collections.Generic;
using System.Xml;
using System.Xml.Schema;
-using Mono.TextEditor;
-
using MonoDevelop.Components.Commands;
using MonoDevelop.Core;
using MonoDevelop.Ide;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Tasks;
+using MonoDevelop.Ide;
+using MonoDevelop.Ide.CodeFormatting;
+using MonoDevelop.Ide.Editor;
using MonoDevelop.Xml.Completion;
using MonoDevelop.Xml.Dom;
using MonoDevelop.Xml.Parser;
+using MonoDevelop.Ide.Editor.Extension;
+using System.Threading.Tasks;
+using System.Threading;
namespace MonoDevelop.Xml.Editor
{
@@ -56,12 +60,12 @@ namespace MonoDevelop.Xml.Editor
InferredXmlCompletionProvider inferredCompletionData;
bool inferenceQueued;
- public override bool ExtendsEditor (MonoDevelop.Ide.Gui.Document doc, IEditableTextBuffer editor)
+ public override bool IsValidInContext (DocumentContext context)
{
- return IsFileNameHandled (doc.Name) && base.ExtendsEditor (doc, editor);
+ return IsFileNameHandled (context.Name) && base.IsValidInContext (context);
}
- public override void Initialize ()
+ protected override void Initialize ()
{
base.Initialize ();
XmlEditorOptions.XmlFileAssociationChanged += HandleXmlFileAssociationChanged;
@@ -69,16 +73,16 @@ namespace MonoDevelop.Xml.Editor
XmlSchemaManager.UserSchemaRemoved += UserSchemaRemoved;
SetDefaultSchema ();
- var view = Document.GetContent<MonoDevelop.SourceEditor.SourceEditorView> ();
- if (view != null && string.IsNullOrEmpty (view.Document.MimeType)) {
- view.Document.MimeType = ApplicationXmlMimeType;
- Document.ReparseDocument ();
+ //var view = Document.GetContent<MonoDevelop.SourceEditor.SourceEditorView> ();
+ if (string.IsNullOrEmpty (Editor.MimeType)) {
+ Editor.MimeType = ApplicationXmlMimeType;
+ DocumentContext.ReparseDocument ();
}
}
void HandleXmlFileAssociationChanged (object sender, XmlFileAssociationChangedEventArgs e)
{
- var filename = document.FileName;
+ var filename = DocumentContext.Name;
if (filename != null && filename.ToString ().EndsWith (e.Extension, StringComparison.Ordinal))
SetDefaultSchema ();
}
@@ -89,7 +93,8 @@ namespace MonoDevelop.Xml.Editor
if (!disposed) {
disposed = false;
XmlEditorOptions.XmlFileAssociationChanged -= HandleXmlFileAssociationChanged;
- XmlSchemaManager.UserSchemaAdded -= UserSchemaAdded;
+ XmlSchemaManager.UserSchemaAdded -= UserSchemaAdded;
+
XmlSchemaManager.UserSchemaRemoved -= UserSchemaRemoved;
base.Dispose ();
}
@@ -106,49 +111,60 @@ namespace MonoDevelop.Xml.Editor
);
}
- protected override void GetElementCompletions (CompletionDataList list)
- {
- var path = GetElementPath ();
+ protected override async Task<CompletionDataList> GetElementCompletions (CancellationToken token)
+ {
+ var list = new CompletionDataList ();
+ var path = GetElementPath ();
+
if (path.Elements.Count > 0) {
IXmlCompletionProvider schema = FindSchema (path);
if (schema == null)
- schema = inferredCompletionData;
- if (schema != null) {
- var completionData = schema.GetChildElementCompletionData (path);
+ schema = inferredCompletionData;
+
+ if (schema != null) {
+
+ var completionData = await schema.GetChildElementCompletionData (path, token);
if (completionData != null)
list.AddRange (completionData);
- }
+ }
+
} else if (defaultSchemaCompletionData != null) {
- list.AddRange (defaultSchemaCompletionData.GetElementCompletionData (defaultNamespacePrefix));
+ list.AddRange (await defaultSchemaCompletionData.GetElementCompletionData (defaultNamespacePrefix, token));
+
} else if (inferredCompletionData != null) {
- list.AddRange (inferredCompletionData.GetElementCompletionData ());
+ list.AddRange (await inferredCompletionData.GetElementCompletionData (token));
}
AddMiscBeginTags (list);
+ return list;
}
- protected override CompletionDataList GetAttributeCompletions (IAttributedXObject attributedOb,
- Dictionary<string, string> existingAtts)
+ protected override Task<CompletionDataList> GetAttributeCompletions (IAttributedXObject attributedOb,
+ Dictionary<string, string> existingAtts, CancellationToken token)
{
- var path = GetElementPath ();
+ var path = GetElementPath ();
+
if (path.Elements.Count > 0) {
IXmlCompletionProvider schema = FindSchema (path);
if (schema == null)
- schema = inferredCompletionData;
- if (schema != null)
- return schema.GetAttributeCompletionData (path);
+ schema = inferredCompletionData;
+
+ if (schema != null)
+ return schema.GetAttributeCompletionData (path, token);
}
- return null;
+ return Task.FromResult (new CompletionDataList ());
}
- protected override CompletionDataList GetAttributeValueCompletions (IAttributedXObject attributedOb, XAttribute att)
+ protected override Task<CompletionDataList> GetAttributeValueCompletions (IAttributedXObject attributedOb, XAttribute att, CancellationToken token)
{
- var path = GetElementPath ();
+ var path = GetElementPath ();
+
if (path.Elements.Count > 0) {
- var schema = FindSchema (path);
- if (schema != null)
- return schema.GetAttributeValueCompletionData (path, att.Name.FullName);
+ var schema = FindSchema (path);
+
+ if (schema != null)
+ return schema.GetAttributeValueCompletionData (path, att.Name.FullName, token);
}
- return null;
+ return Task.FromResult (new CompletionDataList ());
}
#endregion
@@ -170,47 +186,79 @@ namespace MonoDevelop.Xml.Editor
return FindSchema (XmlSchemaManager.SchemaCompletionDataItems, path);
}
- /// <summary>
- /// Finds the schema given the xml element path.
- /// </summary>
- public XmlSchemaCompletionData FindSchema (IXmlSchemaCompletionDataCollection schemaCompletionDataItems, XmlElementPath path)
- {
- if (path.Elements.Count > 0) {
- string namespaceUri = path.Elements[0].Namespace;
- if (namespaceUri.Length > 0) {
- return schemaCompletionDataItems[namespaceUri];
- } else if (defaultSchemaCompletionData != null) {
-
- // Use the default schema namespace if none
- // specified in a xml element path, otherwise
- // we will not find any attribute or element matches
- // later.
- foreach (QualifiedName name in path.Elements) {
- if (name.Namespace.Length == 0) {
- name.Namespace = defaultSchemaCompletionData.NamespaceUri;
- }
- }
- return defaultSchemaCompletionData;
- }
- }
- return null;
+ /// <summary>
+
+ /// Finds the schema given the xml element path.
+
+ /// </summary>
+
+ public XmlSchemaCompletionData FindSchema (IXmlSchemaCompletionDataCollection schemaCompletionDataItems, XmlElementPath path)
+
+ {
+
+ if (path.Elements.Count > 0) {
+
+ string namespaceUri = path.Elements[0].Namespace;
+
+ if (namespaceUri.Length > 0) {
+
+ return schemaCompletionDataItems[namespaceUri];
+
+ } else if (defaultSchemaCompletionData != null) {
+
+
+
+ // Use the default schema namespace if none
+
+ // specified in a xml element path, otherwise
+
+ // we will not find any attribute or element matches
+
+ // later.
+
+ foreach (QualifiedName name in path.Elements) {
+
+ if (name.Namespace.Length == 0) {
+
+ name.Namespace = defaultSchemaCompletionData.NamespaceUri;
+
+ }
+
+ }
+
+ return defaultSchemaCompletionData;
+
+ }
+
+ }
+
+ return null;
+
}
#endregion
#region Schema resolution
- /// <summary>
- /// Gets the XmlSchemaObject that defines the currently selected xml element or attribute.
- /// </summary>
+ /// <summary>
+
+ /// Gets the XmlSchemaObject that defines the currently selected xml element or attribute.
+
+ /// </summary>
+
/// <param name="currentSchemaCompletionData">This is the schema completion data for the schema currently being
- /// displayed. This can be null if the document is not a schema.</param>
- public XmlSchemaObject GetSchemaObjectSelected (XmlSchemaCompletionData currentSchemaCompletionData)
- {
- // Find element under cursor.
+ /// displayed. This can be null if the document is not a schema.</param>
+
+ public XmlSchemaObject GetSchemaObjectSelected (XmlSchemaCompletionData currentSchemaCompletionData)
+
+ {
+
+ // Find element under cursor.
+
XmlElementPath path = GetElementPath ();
- //attribute name under cursor, if valid
+ //attribute name under cursor, if valid
+
string attributeName = null;
XAttribute xatt = Tracker.Engine.Nodes.Peek (0) as XAttribute;
if (xatt != null) {
@@ -219,173 +267,306 @@ namespace MonoDevelop.Xml.Editor
xattName = GetCompleteName ();
}
attributeName = xattName.FullName;
- }
+ }
+
- // Find schema definition object.
- XmlSchemaCompletionData schemaCompletionData = FindSchema (path);
- XmlSchemaObject schemaObject = null;
+ // Find schema definition object.
+
+ XmlSchemaCompletionData schemaCompletionData = FindSchema (path);
+
+ XmlSchemaObject schemaObject = null;
+
if (schemaCompletionData != null) {
- XmlSchemaElement element = schemaCompletionData.FindElement(path);
- schemaObject = element;
+ XmlSchemaElement element = schemaCompletionData.FindElement(path);
+
+ schemaObject = element;
+
if (element != null) {
if (!string.IsNullOrEmpty (attributeName)) {
- XmlSchemaAttribute attribute = schemaCompletionData.FindAttribute(element, attributeName);
+ XmlSchemaAttribute attribute = schemaCompletionData.FindAttribute(element, attributeName);
+
if (attribute != null) {
- if (currentSchemaCompletionData != null) {
- schemaObject = GetSchemaObjectReferenced (currentSchemaCompletionData, element, attribute);
- } else {
- schemaObject = attribute;
- }
- }
- }
- return schemaObject;
- }
- }
- return null;
- }
-
- /// <summary>
- /// If the attribute value found references another item in the schema
- /// return this instead of the attribute schema object. For example, if the
- /// user can select the attribute value and the code will work out the schema object pointed to by the ref
- /// or type attribute:
- ///
- /// xs:element ref="ref-name"
- /// xs:attribute type="type-name"
- /// </summary>
- /// <returns>
- /// The <paramref name="attribute"/> if no schema object was referenced.
- /// </returns>
- XmlSchemaObject GetSchemaObjectReferenced (XmlSchemaCompletionData currentSchemaCompletionData, XmlSchemaElement element, XmlSchemaAttribute attribute)
- {
- XmlSchemaObject schemaObject = null;
- if (IsXmlSchemaNamespace(element)) {
+ if (currentSchemaCompletionData != null) {
+
+ schemaObject = GetSchemaObjectReferenced (currentSchemaCompletionData, element, attribute);
+
+ } else {
+
+ schemaObject = attribute;
+
+ }
+
+ }
+
+ }
+
+ return schemaObject;
+
+ }
+
+ }
+
+ return null;
+
+ }
+
+ /// <summary>
+
+ /// If the attribute value found references another item in the schema
+
+ /// return this instead of the attribute schema object. For example, if the
+
+ /// user can select the attribute value and the code will work out the schema object pointed to by the ref
+
+ /// or type attribute:
+
+ ///
+
+ /// xs:element ref="ref-name"
+
+ /// xs:attribute type="type-name"
+
+ /// </summary>
+
+ /// <returns>
+
+ /// The <paramref name="attribute"/> if no schema object was referenced.
+
+ /// </returns>
+
+ XmlSchemaObject GetSchemaObjectReferenced (XmlSchemaCompletionData currentSchemaCompletionData, XmlSchemaElement element, XmlSchemaAttribute attribute)
+
+ {
+
+ XmlSchemaObject schemaObject = null;
+
+ if (IsXmlSchemaNamespace(element)) {
+
// Find attribute value.
- //fixme implement
- string attributeValue = "";// XmlParser.GetAttributeValueAtIndex(xml, index);
- if (attributeValue.Length == 0) {
- return attribute;
- }
-
- if (attribute.Name == "ref") {
- schemaObject = FindSchemaObjectReference(attributeValue, currentSchemaCompletionData, element.Name);
- } else if (attribute.Name == "type") {
- schemaObject = FindSchemaObjectType(attributeValue, currentSchemaCompletionData, element.Name);
- }
- }
-
- if (schemaObject != null) {
- return schemaObject;
- }
- return attribute;
- }
-
- /// <summary>
- /// Checks whether the element belongs to the XSD namespace.
- /// </summary>
- static bool IsXmlSchemaNamespace (XmlSchemaElement element)
- {
- XmlQualifiedName qualifiedName = element.QualifiedName;
- if (qualifiedName != null) {
- return XmlSchemaManager.IsXmlSchemaNamespace (qualifiedName.Namespace);
- }
- return false;
- }
-
- /// <summary>
- /// Attempts to locate the reference name in the specified schema.
- /// </summary>
- /// <param name="name">The reference to look up.</param>
- /// <param name="schemaCompletionData">The schema completion data to use to
- /// find the reference.</param>
- /// <param name="elementName">The element to determine what sort of reference it is
- /// (e.g. group, attribute, element).</param>
- /// <returns><see langword="null"/> if no match can be found.</returns>
- XmlSchemaObject FindSchemaObjectReference(string name, XmlSchemaCompletionData schemaCompletionData, string elementName)
- {
- QualifiedName qualifiedName = schemaCompletionData.CreateQualifiedName(name);
- XmlSchemaCompletionData qualifiedNameSchema = FindSchema(qualifiedName.Namespace);
- if (qualifiedNameSchema != null) {
- schemaCompletionData = qualifiedNameSchema;
- }
- switch (elementName) {
- case "element":
- return schemaCompletionData.FindElement(qualifiedName);
- case "attribute":
- return schemaCompletionData.FindAttribute(qualifiedName.Name);
- case "group":
- return schemaCompletionData.FindGroup(qualifiedName.Name);
- case "attributeGroup":
- return schemaCompletionData.FindAttributeGroup(qualifiedName.Name);
- }
- return null;
- }
-
- /// <summary>
- /// Attempts to locate the type name in the specified schema.
- /// </summary>
- /// <param name="name">The type to look up.</param>
- /// <param name="schemaCompletionData">The schema completion data to use to
- /// find the type.</param>
- /// <param name="elementName">The element to determine what sort of type it is
- /// (e.g. group, attribute, element).</param>
- /// <returns><see langword="null"/> if no match can be found.</returns>
- XmlSchemaObject FindSchemaObjectType(string name, XmlSchemaCompletionData schemaCompletionData, string elementName)
- {
- QualifiedName qualifiedName = schemaCompletionData.CreateQualifiedName(name);
- XmlSchemaCompletionData qualifiedNameSchema = FindSchema(qualifiedName.Namespace);
- if (qualifiedNameSchema != null) {
- schemaCompletionData = qualifiedNameSchema;
- }
- switch (elementName) {
- case "element":
- return schemaCompletionData.FindComplexType(qualifiedName);
- case "attribute":
- return schemaCompletionData.FindSimpleType(qualifiedName.Name);
- }
- return null;
+ //fixme implement
+
+ string attributeValue = "";// XmlParser.GetAttributeValueAtIndex(xml, index);
+
+ if (attributeValue.Length == 0) {
+
+ return attribute;
+
+ }
+
+
+
+ if (attribute.Name == "ref") {
+
+ schemaObject = FindSchemaObjectReference(attributeValue, currentSchemaCompletionData, element.Name);
+
+ } else if (attribute.Name == "type") {
+
+ schemaObject = FindSchemaObjectType(attributeValue, currentSchemaCompletionData, element.Name);
+
+ }
+
+ }
+
+
+
+ if (schemaObject != null) {
+
+ return schemaObject;
+
+ }
+
+ return attribute;
+
+ }
+
+ /// <summary>
+
+ /// Checks whether the element belongs to the XSD namespace.
+
+ /// </summary>
+
+ static bool IsXmlSchemaNamespace (XmlSchemaElement element)
+
+ {
+
+ XmlQualifiedName qualifiedName = element.QualifiedName;
+
+ if (qualifiedName != null) {
+
+ return XmlSchemaManager.IsXmlSchemaNamespace (qualifiedName.Namespace);
+
+ }
+
+ return false;
+
+ }
+
+ /// <summary>
+
+ /// Attempts to locate the reference name in the specified schema.
+
+ /// </summary>
+
+ /// <param name="name">The reference to look up.</param>
+
+ /// <param name="schemaCompletionData">The schema completion data to use to
+
+ /// find the reference.</param>
+
+ /// <param name="elementName">The element to determine what sort of reference it is
+
+ /// (e.g. group, attribute, element).</param>
+
+ /// <returns><see langword="null"/> if no match can be found.</returns>
+
+ XmlSchemaObject FindSchemaObjectReference(string name, XmlSchemaCompletionData schemaCompletionData, string elementName)
+
+ {
+
+ QualifiedName qualifiedName = schemaCompletionData.CreateQualifiedName(name);
+
+ XmlSchemaCompletionData qualifiedNameSchema = FindSchema(qualifiedName.Namespace);
+
+ if (qualifiedNameSchema != null) {
+
+ schemaCompletionData = qualifiedNameSchema;
+
+ }
+
+ switch (elementName) {
+
+ case "element":
+
+ return schemaCompletionData.FindElement(qualifiedName);
+
+ case "attribute":
+
+ return schemaCompletionData.FindAttribute(qualifiedName.Name);
+
+ case "group":
+
+ return schemaCompletionData.FindGroup(qualifiedName.Name);
+
+ case "attributeGroup":
+
+ return schemaCompletionData.FindAttributeGroup(qualifiedName.Name);
+
+ }
+
+ return null;
+
+ }
+
+
+
+ /// <summary>
+
+ /// Attempts to locate the type name in the specified schema.
+
+ /// </summary>
+
+ /// <param name="name">The type to look up.</param>
+
+ /// <param name="schemaCompletionData">The schema completion data to use to
+
+ /// find the type.</param>
+
+ /// <param name="elementName">The element to determine what sort of type it is
+
+ /// (e.g. group, attribute, element).</param>
+
+ /// <returns><see langword="null"/> if no match can be found.</returns>
+
+ XmlSchemaObject FindSchemaObjectType(string name, XmlSchemaCompletionData schemaCompletionData, string elementName)
+
+ {
+
+ QualifiedName qualifiedName = schemaCompletionData.CreateQualifiedName(name);
+
+ XmlSchemaCompletionData qualifiedNameSchema = FindSchema(qualifiedName.Namespace);
+
+ if (qualifiedNameSchema != null) {
+
+ schemaCompletionData = qualifiedNameSchema;
+
+ }
+
+ switch (elementName) {
+
+ case "element":
+
+ return schemaCompletionData.FindComplexType(qualifiedName);
+
+ case "attribute":
+
+ return schemaCompletionData.FindSimpleType(qualifiedName.Name);
+
+ }
+
+ return null;
+
}
#endregion
#region Settings handling
- void SetDefaultSchema ()
+ void SetDefaultSchema ()
+
{
- var filename = document.FileName;
+ var filename = DocumentContext.Name;
if (filename == null)
return;
-
+
+
defaultSchemaCompletionData = XmlSchemaManager.GetSchemaCompletionDataForFileName (filename);
if (defaultSchemaCompletionData != null)
inferredCompletionData = null;
else
- QueueInference ();
- defaultNamespacePrefix = XmlSchemaManager.GetNamespacePrefixForFileName (filename);
- }
-
- /// Updates the default schema association since the schema may have been added.
- void UserSchemaAdded (object source, EventArgs e)
+ QueueInference ();
+
+ defaultNamespacePrefix = XmlSchemaManager.GetNamespacePrefixForFileName (filename);
+
+ }
+
+
+
+ /// Updates the default schema association since the schema may have been added.
+
+ void UserSchemaAdded (object source, EventArgs e)
+
{
SetDefaultSchema ();
- }
-
- // Updates the default schema association since the schema may have been removed.
- void UserSchemaRemoved (object source, EventArgs e)
- {
- SetDefaultSchema ();
+ }
+
+
+
+ // Updates the default schema association since the schema may have been removed.
+
+ void UserSchemaRemoved (object source, EventArgs e)
+
+ {
+
+ SetDefaultSchema ();
+
}
#endregion
#region Stylesheet handling
- /// <summary>
- /// Gets or sets the stylesheet associated with this xml file.
- /// </summary>
- public string StylesheetFileName {
- get { return stylesheetFileName; }
- set { stylesheetFileName = value; }
+ /// <summary>
+
+ /// Gets or sets the stylesheet associated with this xml file.
+
+ /// </summary>
+
+ public string StylesheetFileName {
+
+ get { return stylesheetFileName; }
+
+ set { stylesheetFileName = value; }
+
}
#endregion
@@ -430,16 +611,17 @@ namespace MonoDevelop.Xml.Editor
#region Smart indent
- public override bool KeyPress (Gdk.Key key, char keyChar, Gdk.ModifierType modifier)
+ public override bool KeyPress (KeyDescriptor descriptor)
{
bool result;
-
- if (Document.Editor.Options.IndentStyle == IndentStyle.Smart && key == Gdk.Key.Return) {
- result = base.KeyPress (key, keyChar, modifier);
- SmartIndentLine (Editor.Caret.Line);
+
+
+ if (Editor.Options.IndentStyle == IndentStyle.Smart && descriptor.SpecialKey == SpecialKey.Return) {
+ result = base.KeyPress (descriptor);
+ SmartIndentLine (Editor.CaretLine);
return result;
}
- return base.KeyPress (key, keyChar, modifier);
+ return base.KeyPress (descriptor);
}
void SmartIndentLine (int line)
@@ -484,32 +666,23 @@ namespace MonoDevelop.Xml.Editor
#endregion
#region Command handlers
-
- [CommandUpdateHandler (MonoDevelop.Ide.Commands.EditCommands.ToggleCodeComment)]
- protected void ToggleCodeCommentCommandUpdate (CommandInfo info)
- {
- info.Enabled = false;
- }
-
- [CommandHandler (MonoDevelop.Ide.Commands.EditCommands.ToggleCodeComment)]
- public void ToggleCodeCommentCommand ()
- {
- //FIXME: implement
- }
-
+
[CommandHandler (XmlCommands.CreateSchema)]
public void CreateSchemaCommand ()
{
- try {
- TaskService.Errors.Clear ();
+ try {
+
+ TaskService.Errors.Clear ();
+
string xml = Editor.Text;
- using (IProgressMonitor monitor = XmlEditorService.GetMonitor ()) {
+ using (ProgressMonitor monitor = XmlEditorService.GetMonitor ()) {
XmlDocument doc = XmlEditorService.ValidateWellFormedness (monitor, xml, FileName);
if (doc == null)
return;
monitor.BeginTask (GettextCatalog.GetString ("Creating schema..."), 0);
try {
- string schema = XmlEditorService.CreateSchema (Document, xml);
+ string schema = XmlEditorService.CreateSchema (Editor, xml);
+
string fileName = XmlEditorService.GenerateFileName (FileName, "{0}.xsd");
IdeApp.Workbench.NewDocument (fileName, "application/xml", schema);
monitor.ReportSuccess (GettextCatalog.GetString ("Schema created."));
@@ -518,22 +691,30 @@ namespace MonoDevelop.Xml.Editor
LoggingService.LogError (msg, ex);
monitor.ReportError (msg, ex);
}
- }
- } catch (Exception ex) {
- MessageService.ShowError (ex.Message);
+ }
+
+ } catch (Exception ex) {
+
+ MessageService.ShowError (ex.Message);
+
}
}
[CommandHandler (XmlCommands.OpenStylesheet)]
public void OpenStylesheetCommand ()
- {
- if (!string.IsNullOrEmpty (stylesheetFileName)) {
- try {
- IdeApp.Workbench.OpenDocument (stylesheetFileName, Document.Project);
+ {
+
+ if (!string.IsNullOrEmpty (stylesheetFileName)) {
+
+ try {
+
+ IdeApp.Workbench.OpenDocument (stylesheetFileName, DocumentContext.Project);
+
} catch (Exception ex) {
- MessageService.ShowError ("Could not open document.", ex);
- }
- }
+ LoggingService.LogError ("Could not open document.", ex);
+ MessageService.ShowError ("Could not open document.", ex);
+ }
+ }
}
[CommandUpdateHandler (XmlCommands.OpenStylesheet)]
@@ -546,21 +727,28 @@ namespace MonoDevelop.Xml.Editor
public void GoToSchemaDefinitionCommand ()
{
try {
- //try to resolve the schema
- XmlSchemaCompletionData currentSchemaCompletionData = FindSchemaFromFileName (FileName);
- XmlSchemaObject schemaObject = GetSchemaObjectSelected (currentSchemaCompletionData);
-
- // Open schema if resolved
- if (schemaObject != null && schemaObject.SourceUri != null && schemaObject.SourceUri.Length > 0) {
+ //try to resolve the schema
+
+ XmlSchemaCompletionData currentSchemaCompletionData = FindSchemaFromFileName (FileName);
+
+ XmlSchemaObject schemaObject = GetSchemaObjectSelected (currentSchemaCompletionData);
+
+
+
+ // Open schema if resolved
+
+ if (schemaObject != null && schemaObject.SourceUri != null && schemaObject.SourceUri.Length > 0) {
+
string schemaFileName = schemaObject.SourceUri.Replace ("file:/", String.Empty);
IdeApp.Workbench.OpenDocument (
schemaFileName,
- Document.Project,
+ DocumentContext.Project,
Math.Max (1, schemaObject.LineNumber),
Math.Max (1, schemaObject.LinePosition));
}
} catch (Exception ex) {
- MessageService.ShowError ("Could not open document.", ex);
+ MonoDevelop.Core.LoggingService.LogError ("Could not open document.", ex);
+ MessageService.ShowError ("Could not open document.", ex);
}
}
@@ -568,10 +756,11 @@ namespace MonoDevelop.Xml.Editor
public void ValidateCommand ()
{
TaskService.Errors.Clear ();
- using (IProgressMonitor monitor = XmlEditorService.GetMonitor()) {
+ using (ProgressMonitor monitor = XmlEditorService.GetMonitor()) {
if (IsSchema)
XmlEditorService.ValidateSchema (monitor, Editor.Text, FileName);
- else
+ else
+
XmlEditorService.ValidateXml (monitor, Editor.Text, FileName);
}
}
@@ -579,22 +768,27 @@ namespace MonoDevelop.Xml.Editor
[CommandHandler (XmlCommands.AssignStylesheet)]
public void AssignStylesheetCommand ()
{
- // Prompt user for filename.
- string fileName = XmlEditorService.BrowseForStylesheetFile ();
- if (!string.IsNullOrEmpty (stylesheetFileName))
+ // Prompt user for filename.
+
+ string fileName = XmlEditorService.BrowseForStylesheetFile ();
+
+ if (!string.IsNullOrEmpty (stylesheetFileName))
+
stylesheetFileName = fileName;
}
[CommandHandler (XmlCommands.RunXslTransform)]
public void RunXslTransformCommand ()
{
- if (string.IsNullOrEmpty (stylesheetFileName)) {
- stylesheetFileName = XmlEditorService.BrowseForStylesheetFile ();
+ if (string.IsNullOrEmpty (stylesheetFileName)) {
+
+ stylesheetFileName = XmlEditorService.BrowseForStylesheetFile ();
+
if (string.IsNullOrEmpty (stylesheetFileName))
return;
}
- using (IProgressMonitor monitor = XmlEditorService.GetMonitor()) {
+ using (ProgressMonitor monitor = XmlEditorService.GetMonitor()) {
try {
string xsltContent;
try {
@@ -616,7 +810,7 @@ namespace MonoDevelop.Xml.Editor
string newFileName = XmlEditorService.GenerateFileName (FileName, "-transformed{0}.xml");
monitor.BeginTask (GettextCatalog.GetString ("Executing transform..."), 1);
- using (XmlTextWriter output = XmlEditorService.CreateXmlTextWriter(Document)) {
+ using (XmlTextWriter output = XmlEditorService.CreateXmlTextWriter(Editor)) {
xslt.Transform (doc, null, output);
IdeApp.Workbench.NewDocument (
newFileName, "application/xml", output.ToString ());
@@ -626,19 +820,24 @@ namespace MonoDevelop.Xml.Editor
} catch (Exception ex) {
string msg = GettextCatalog.GetString ("Could not run transform.");
monitor.ReportError (msg, ex);
- monitor.EndTask ();
+ monitor.EndTask ();
+
}
}
}
- string GetFileContent (string fileName)
+ string GetFileContent (string fileName)
+
{
- MonoDevelop.Projects.Text.IEditableTextFile tf =
- MonoDevelop.Ide.TextFileProvider.Instance.GetEditableTextFile (fileName);
+ var tf =
+ MonoDevelop.Ide.TextFileProvider.Instance.GetReadOnlyTextEditorData (fileName);
if (tf != null)
- return tf.Text;
- System.IO.StreamReader reader = new System.IO.StreamReader (fileName, true);
- return reader.ReadToEnd();
+ return tf.Text;
+
+ System.IO.StreamReader reader = new System.IO.StreamReader (fileName, true);
+
+ return reader.ReadToEnd();
+
}
#endregion
@@ -650,7 +849,7 @@ namespace MonoDevelop.Xml.Editor
return;
if (inferredCompletionData == null
|| (doc.LastWriteTimeUtc - inferredCompletionData.TimeStampUtc).TotalSeconds >= 5
- && doc.Errors.Count <= inferredCompletionData.ErrorCount)
+ && doc.GetErrorsAsync().Result.Count <= inferredCompletionData.ErrorCount)
{
inferenceQueued = true;
System.Threading.ThreadPool.QueueUserWorkItem (delegate {
@@ -658,7 +857,7 @@ namespace MonoDevelop.Xml.Editor
InferredXmlCompletionProvider newData = new InferredXmlCompletionProvider ();
newData.Populate (doc.XDocument);
newData.TimeStampUtc = DateTime.UtcNow;
- newData.ErrorCount = doc.Errors.Count;
+ newData.ErrorCount = doc.GetErrorsAsync().Result.Count;
this.inferenceQueued = false;
this.inferredCompletionData = newData;
} catch (Exception ex) {
diff --git a/main/src/addins/Xml/Formatting/XmlFormatter.cs b/main/src/addins/Xml/Formatting/XmlFormatter.cs
index f3090de438..610b373ba2 100644
--- a/main/src/addins/Xml/Formatting/XmlFormatter.cs
+++ b/main/src/addins/Xml/Formatting/XmlFormatter.cs
@@ -26,16 +26,18 @@
using System;
using System.IO;
+using System.Linq;
using System.Xml;
using System.Collections.Generic;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide;
using MonoDevelop.Projects.Policies;
using MonoDevelop.Ide.CodeFormatting;
+using MonoDevelop.Core.Text;
namespace MonoDevelop.Xml.Formatting
{
- public class XmlFormatter: ICodeFormatter
+ public class XmlFormatter: AbstractCodeFormatter
{
public static string FormatXml (TextStylePolicy textPolicy, XmlFormattingPolicy formattingPolicy, string input)
{
@@ -43,11 +45,18 @@ namespace MonoDevelop.Xml.Formatting
try {
doc = new XmlDocument ();
doc.LoadXml (input);
+ } catch (XmlException ex) {
+ // handle xml files without root element (https://bugzilla.xamarin.com/show_bug.cgi?id=4748)
+ if (ex.Message == "Root element is missing.")
+ return input;
+ MonoDevelop.Core.LoggingService.LogWarning ("Error formatting XML file", ex);
+ IdeApp.Workbench.StatusBar.ShowError ("Error formatting file: " + ex.Message);
+ return input;
} catch (Exception ex) {
// Ignore malformed xml
MonoDevelop.Core.LoggingService.LogWarning ("Error formatting XML file", ex);
IdeApp.Workbench.StatusBar.ShowError ("Error formatting file: " + ex.Message);
- return null;
+ return input;
}
var sw = new StringWriter ();
@@ -56,12 +65,15 @@ namespace MonoDevelop.Xml.Formatting
xmlWriter.Flush ();
return sw.ToString ();
}
-
- public string FormatText (PolicyContainer policyParent, IEnumerable<string> mimeTypeInheritanceChain, string input)
+
+ protected override Core.Text.ITextSource FormatImplementation (PolicyContainer policyParent, string mimeType, Core.Text.ITextSource input, int startOffset, int length)
{
+ if (policyParent == null)
+ policyParent = PolicyService.DefaultPolicies;
+ var mimeTypeInheritanceChain = DesktopService.GetMimeTypeInheritanceChain (mimeType).ToList ();
var txtPol = policyParent.Get<TextStylePolicy> (mimeTypeInheritanceChain);
var xmlPol = policyParent.Get<XmlFormattingPolicy> (mimeTypeInheritanceChain);
- return FormatXml (txtPol, xmlPol, input);
+ return new StringTextSource(FormatXml (txtPol, xmlPol, input.Text));
}
public string FormatText (PolicyContainer policyParent, IEnumerable<string> mimeTypeInheritanceChain, string input, int fromOffest, int toOffset)
diff --git a/main/src/addins/Xml/Formatting/XmlFormatterWriter.cs b/main/src/addins/Xml/Formatting/XmlFormatterWriter.cs
index d951ca08dd..424fa9e742 100644
--- a/main/src/addins/Xml/Formatting/XmlFormatterWriter.cs
+++ b/main/src/addins/Xml/Formatting/XmlFormatterWriter.cs
@@ -203,6 +203,8 @@ namespace MonoDevelop.Xml.Formatting
switch (node.NodeType) {
case XmlNodeType.Document: {
+ if (!defaultFormatSettings.OmitXmlDeclaration)
+ WriteDeclarationIfMissing ((XmlDocument)node);
WriteContent (node);
break;
}
@@ -297,14 +299,15 @@ namespace MonoDevelop.Xml.Formatting
break;
}
case XmlNodeType.XmlDeclaration: {
- XmlDeclaration dec = (XmlDeclaration) node;
- WriteRaw (String.Format ("<?xml {0}?>", dec.Value));
+ if (!defaultFormatSettings.OmitXmlDeclaration) {
+ XmlDeclaration dec = (XmlDeclaration) node;
+ WriteRaw (String.Format ("<?xml {0}?>", dec.Value));
+ }
break;
}
}
formatSettings = oldFormat;
- }
-
+ }
string GetAttributeName (XmlAttribute at)
{
if (at.NamespaceURI.Length > 0)
@@ -318,6 +321,15 @@ namespace MonoDevelop.Xml.Formatting
for (XmlNode n = node.FirstChild; n != null; n = n.NextSibling)
WriteNode (n);
}
+
+ void WriteDeclarationIfMissing (XmlDocument doc)
+ {
+ var declaration = doc.FirstChild as XmlDeclaration;
+ if (declaration == null) {
+ declaration = doc.CreateXmlDeclaration ("1.0", "UTF-8", null);
+ WriteNode (declaration);
+ }
+ }
void SetFormat (XmlNode node)
{
@@ -1128,7 +1140,7 @@ namespace MonoDevelop.Xml.Formatting
if (surrogate &&
('\uD800' > high || high > '\uDC00' ||
'\uDC00' > ch || ch > '\uDFFF'))
- throw ArgumentError (String.Format ("Invalid surrogate pair was found. Low: &#x{0:X}; High: &#x{0:X};", (int) ch, (int) high));
+ throw ArgumentError (String.Format ("Invalid surrogate pair was found. Low: &#x{0:X}; High: &#x{1:X};", (int) ch, (int) high));
else if (check_character_validity && XmlChar.IsInvalid (ch))
throw ArgumentError (String.Format ("Invalid character &#x{0:X};", (int) ch));
diff --git a/main/src/addins/Xml/Formatting/XmlFormattingPolicyPanel.cs b/main/src/addins/Xml/Formatting/XmlFormattingPolicyPanel.cs
index 93405e5ac1..1e3ff024e8 100644
--- a/main/src/addins/Xml/Formatting/XmlFormattingPolicyPanel.cs
+++ b/main/src/addins/Xml/Formatting/XmlFormattingPolicyPanel.cs
@@ -25,7 +25,7 @@
// THE SOFTWARE.
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.Xml.Formatting
@@ -34,7 +34,7 @@ namespace MonoDevelop.Xml.Formatting
{
XmlFormattingPolicyPanelWidget panel;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
panel = new XmlFormattingPolicyPanelWidget ();
return panel;
diff --git a/main/src/addins/Xml/Formatting/XmlFormattingPolicyPanelWidget.cs b/main/src/addins/Xml/Formatting/XmlFormattingPolicyPanelWidget.cs
index b637b0d3d2..d97e0858eb 100644
--- a/main/src/addins/Xml/Formatting/XmlFormattingPolicyPanelWidget.cs
+++ b/main/src/addins/Xml/Formatting/XmlFormattingPolicyPanelWidget.cs
@@ -26,6 +26,7 @@
using System;
using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide;
@@ -227,7 +228,7 @@ namespace MonoDevelop.Xml.Formatting
};
uint c = 2;
if (currentFormat.ScopeXPath.Count != 1) {
- var butRem = new Button (ImageService.GetImage (Stock.Remove, IconSize.Menu));
+ var butRem = new Button (new ImageView (Stock.Remove, IconSize.Menu));
tableScopes.Attach (butRem, 2, 3, n, n + 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
butRem.Clicked += delegate {
currentFormat.ScopeXPath.RemoveAt (capn);
@@ -237,7 +238,7 @@ namespace MonoDevelop.Xml.Formatting
c++;
}
if (n == currentFormat.ScopeXPath.Count - 1) {
- var butAdd = new Button (ImageService.GetImage (Stock.Add, IconSize.Menu));
+ var butAdd = new Button (new ImageView (Stock.Add, IconSize.Menu));
tableScopes.Attach (butAdd, c, c + 1, n, n + 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
butAdd.Clicked += delegate {
currentFormat.ScopeXPath.Add ("");
diff --git a/main/src/addins/Xml/MSBuild/MSBuildResolveContext.cs b/main/src/addins/Xml/MSBuild/MSBuildResolveContext.cs
index bb01db9027..b9de149700 100644
--- a/main/src/addins/Xml/MSBuild/MSBuildResolveContext.cs
+++ b/main/src/addins/Xml/MSBuild/MSBuildResolveContext.cs
@@ -82,7 +82,7 @@ namespace MonoDevelop.Xml.MSBuild
{
var ctx = new MSBuildResolveContext ();
ctx.Populate (doc.XDocument);
- if (doc.Errors.Count > 0)
+ if (doc.GetErrorsAsync().Result.Count > 0)
ctx.Merge (previous);
return ctx;
}
diff --git a/main/src/addins/Xml/MSBuild/MSBuildTextEditorExtension.cs b/main/src/addins/Xml/MSBuild/MSBuildTextEditorExtension.cs
index b0cbcf3288..63c1c11075 100644
--- a/main/src/addins/Xml/MSBuild/MSBuildTextEditorExtension.cs
+++ b/main/src/addins/Xml/MSBuild/MSBuildTextEditorExtension.cs
@@ -33,6 +33,7 @@ using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using MonoDevelop.Xml.Dom;
using MonoDevelop.Xml.Editor;
+using System.Threading.Tasks;
namespace MonoDevelop.Xml.MSBuild
{
@@ -40,20 +41,22 @@ namespace MonoDevelop.Xml.MSBuild
{
public static readonly string MSBuildMimeType = "application/x-msbuild";
- protected override void GetElementCompletions (CompletionDataList list)
+ protected override Task<CompletionDataList> GetElementCompletions (CancellationToken token)
{
+ var list = new CompletionDataList ();
+
AddMiscBeginTags (list);
var path = GetCurrentPath ();
if (path.Count == 0) {
list.Add (new XmlCompletionData ("Project", XmlCompletionData.DataType.XmlElement));
- return;
+ return Task.FromResult (list);
}
var rr = ResolveElement (path);
if (rr == null)
- return;
+ return Task.FromResult (list);
foreach (var c in rr.BuiltinChildren)
list.Add (new XmlCompletionData (c, XmlCompletionData.DataType.XmlElement));
@@ -62,6 +65,7 @@ namespace MonoDevelop.Xml.MSBuild
if (inferredChildren != null)
foreach (var c in inferredChildren)
list.Add (new XmlCompletionData (c, XmlCompletionData.DataType.XmlElement));
+ return Task.FromResult (list);
}
IEnumerable<string> GetInferredChildren (ResolveResult rr)
@@ -87,16 +91,16 @@ namespace MonoDevelop.Xml.MSBuild
return null;
}
- protected override CompletionDataList GetAttributeCompletions (IAttributedXObject attributedOb,
- Dictionary<string, string> existingAtts)
+ protected override Task<CompletionDataList> GetAttributeCompletions (IAttributedXObject attributedOb,
+ Dictionary<string, string> existingAtts, CancellationToken token)
{
+ var list = new CompletionDataList ();
var path = GetCurrentPath ();
var rr = ResolveElement (path);
if (rr == null)
- return null;
+ return Task.FromResult (list);
- var list = new CompletionDataList ();
foreach (var a in rr.BuiltinAttributes)
if (!existingAtts.ContainsKey (a))
list.Add (new XmlCompletionData (a, XmlCompletionData.DataType.XmlAttribute));
@@ -107,7 +111,7 @@ namespace MonoDevelop.Xml.MSBuild
if (!existingAtts.ContainsKey (a))
list.Add (new XmlCompletionData (a, XmlCompletionData.DataType.XmlAttribute));
- return list;
+ return Task.FromResult (list);
}
IEnumerable<string> GetInferredAttributes (ResolveResult rr)
diff --git a/main/src/addins/Xml/MonoDevelop.Xml.csproj b/main/src/addins/Xml/MonoDevelop.Xml.csproj
index 5a796abe25..ecd57e0813 100644
--- a/main/src/addins/Xml/MonoDevelop.Xml.csproj
+++ b/main/src/addins/Xml/MonoDevelop.Xml.csproj
@@ -66,6 +66,14 @@
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System.Core" />
+ <Reference Include="Microsoft.CodeAnalysis">
+ <HintPath>..\..\..\build\bin\Microsoft.CodeAnalysis.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Collections.Immutable">
+ <HintPath>..\..\..\build\bin\System.Collections.Immutable.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
@@ -83,26 +91,11 @@
<Name>MonoDevelop.DesignerSupport</Name>
<Private>False</Private>
</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="..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
- <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
- <Name>Mono.TextEditor</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\MonoDevelop.Debugger\MonoDevelop.Debugger.csproj">
<Project>{2357AABD-08C7-4808-A495-8FF2D3CDFDB0}</Project>
<Name>MonoDevelop.Debugger</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
- <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
- <Name>ICSharpCode.NRefactory</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\..\..\external\mono-addins\Mono.Addins\Mono.Addins.csproj">
<Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
<Name>Mono.Addins</Name>
@@ -126,11 +119,23 @@
<EmbeddedResource Include="icons\prefs-xml-16%402x.png">
<LogicalName>prefs-xml-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\prefs-xml-schemas-16.png">
- <LogicalName>prefs-xml-schemas-16.png</LogicalName>
+ <EmbeddedResource Include="icons\prefs-xml-16~dark.png">
+ <LogicalName>prefs-xml-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-xml-16~dark%402x.png">
+ <LogicalName>prefs-xml-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-xml-16~sel.png">
+ <LogicalName>prefs-xml-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-xml-16~sel%402x.png">
+ <LogicalName>prefs-xml-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-xml-16~dark~sel.png">
+ <LogicalName>prefs-xml-16~dark~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\prefs-xml-schemas-16%402x.png">
- <LogicalName>prefs-xml-schemas-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\prefs-xml-16~dark~sel%402x.png">
+ <LogicalName>prefs-xml-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="Formatting\MonoXmlPolicy.xml">
<LogicalName>MonoXmlPolicy.xml</LogicalName>
diff --git a/main/src/addins/Xml/Parser/XmlClosingTagState.cs b/main/src/addins/Xml/Parser/XmlClosingTagState.cs
index 138c85a736..f8ac10ee49 100644
--- a/main/src/addins/Xml/Parser/XmlClosingTagState.cs
+++ b/main/src/addins/Xml/Parser/XmlClosingTagState.cs
@@ -108,7 +108,8 @@ namespace MonoDevelop.Xml.Parser
}
if (c == '<') {
- context.LogError ("Unexpected '<' in tag.");
+ context.LogError ("Unexpected '<' in tag.", context.LocationMinus (1));
+ context.Nodes.Pop ();
rollback = string.Empty;
return Parent;
}
@@ -123,7 +124,8 @@ namespace MonoDevelop.Xml.Parser
}
rollback = string.Empty;
- context.LogError ("Unexpected character '" + c + "' in closing tag.");
+ context.LogError ("Unexpected character '" + c + "' in closing tag.", context.LocationMinus (1));
+ context.Nodes.Pop ();
return Parent;
}
}
diff --git a/main/src/addins/Xml/Parser/XmlCommentState.cs b/main/src/addins/Xml/Parser/XmlCommentState.cs
index c4ff6fb2e7..33ac93a3b1 100644
--- a/main/src/addins/Xml/Parser/XmlCommentState.cs
+++ b/main/src/addins/Xml/Parser/XmlCommentState.cs
@@ -64,6 +64,7 @@ namespace MonoDevelop.Xml.Parser
return Parent;
} else {
context.LogWarning ("The string '--' should not appear within comments.");
+ context.StateTag = NOMATCH;
}
} else {
// not any part of a '-->', so make sure matching is reset
diff --git a/main/src/addins/Xml/Parser/XmlDocTypeState.cs b/main/src/addins/Xml/Parser/XmlDocTypeState.cs
index fc8103e8fd..2445422939 100644
--- a/main/src/addins/Xml/Parser/XmlDocTypeState.cs
+++ b/main/src/addins/Xml/Parser/XmlDocTypeState.cs
@@ -27,9 +27,8 @@
//
using System;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory;
using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Xml.Parser
{
@@ -132,7 +131,7 @@ namespace MonoDevelop.Xml.Parser
switch (context.StateTag) {
case 0:
if (c == '[') {
- doc.InternalDeclarationRegion = new DomRegion (context.Location, TextLocation.Empty);
+ doc.InternalDeclarationRegion = new DocumentRegion (context.Location, DocumentLocation.Empty);
context.StateTag = 1;
return null;
}
@@ -143,7 +142,7 @@ namespace MonoDevelop.Xml.Parser
return null;
} else if (c == ']') {
context.StateTag = 0;
- doc.InternalDeclarationRegion = new DomRegion (doc.InternalDeclarationRegion.Begin, context.Location);
+ doc.InternalDeclarationRegion = new DocumentRegion (doc.InternalDeclarationRegion.Begin, context.Location);
return null;
}
break;
diff --git a/main/src/addins/Xml/Parser/XmlParser.cs b/main/src/addins/Xml/Parser/XmlParser.cs
index de40145786..72d8f726e6 100644
--- a/main/src/addins/Xml/Parser/XmlParser.cs
+++ b/main/src/addins/Xml/Parser/XmlParser.cs
@@ -30,10 +30,10 @@ using System;
using System.Collections.Generic;
using System.Text;
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.Gui.Content;
-using MonoDevelop.Xml.Dom;
+using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.TypeSystem;
namespace MonoDevelop.Xml.Parser
{
@@ -45,8 +45,8 @@ namespace MonoDevelop.Xml.Parser
bool buildTree;
int position;
- TextLocation location;
- TextLocation previousLineEnd;
+ DocumentLocation location;
+ DocumentLocation previousLineEnd;
int stateTag;
StringBuilder keywordBuilder;
int currentStateLength;
@@ -94,7 +94,7 @@ namespace MonoDevelop.Xml.Parser
#region IDocumentStateEngine
public int Position { get { return position; } }
- public TextLocation Location { get { return location; } }
+ public DocumentLocation Location { get { return location; } }
public void Reset ()
{
@@ -102,8 +102,8 @@ namespace MonoDevelop.Xml.Parser
previousState = rootState;
position = 0;
stateTag = 0;
- location = new TextLocation (1, 1);
- previousLineEnd = TextLocation.Empty;
+ location = new DocumentLocation (1, 1);
+ previousLineEnd = DocumentLocation.Empty;
keywordBuilder = new StringBuilder ();
currentStateLength = 0;
nodes = new NodeStack ();
@@ -131,10 +131,10 @@ namespace MonoDevelop.Xml.Parser
//FIXME: position/location should be at current char, not after it
position++;
if (c == '\n') {
- previousLineEnd = new TextLocation (location.Line, location.Column + 1);
- location = new TextLocation (location.Line + 1, 1);
+ previousLineEnd = new DocumentLocation (location.Line, location.Column + 1);
+ location = new DocumentLocation (location.Line + 1, 1);
} else {
- location = new TextLocation (location.Line, location.Column + 1);
+ location = new DocumentLocation (location.Line, location.Column + 1);
}
for (int loopLimit = 0; loopLimit < 10; loopLimit++) {
@@ -172,7 +172,7 @@ namespace MonoDevelop.Xml.Parser
//rollback position and location so they're valid
position -= (rollback.Length + 1);
- location = new TextLocation (location.Line, location.Column - (rollback.Length + 1));
+ location = new DocumentLocation (location.Line, location.Column - (rollback.Length + 1));
if (location.Column < 0)
throw new InvalidOperationException ("Can't roll back across line boundary");
@@ -181,7 +181,7 @@ namespace MonoDevelop.Xml.Parser
//restore position and location
position++;
- location = new TextLocation (location.Line, location.Column + 1);
+ location = new DocumentLocation (location.Line, location.Column + 1);
}
throw new InvalidOperationException ("Too many state changes for char '" + c + "'. Current state is " + currentState.ToString () + ".");
} catch (Exception ex) {
@@ -253,8 +253,8 @@ namespace MonoDevelop.Xml.Parser
builder.AppendLine ("Errors=");
foreach (Error err in errors) {
builder.Append (' ', 4);
- builder.AppendFormat ("[{0}@{1}:{2}, {3}]\n", err.ErrorType, err.Region.BeginLine,
- err.Region.BeginColumn, err.Message);
+ builder.AppendFormat ("[{0}@{1}:{2}, {3}]\n", err.ErrorType, err.Region.Begin.Line,
+ err.Region.Begin.Column, err.Message);
}
}
@@ -269,7 +269,7 @@ namespace MonoDevelop.Xml.Parser
set { stateTag = value; }
}
- TextLocation IXmlParserContext.LocationMinus (int colOffset)
+ DocumentLocation IXmlParserContext.LocationMinus (int colOffset)
{
int col = Location.Column - colOffset;
int line = Location.Line;
@@ -279,7 +279,7 @@ namespace MonoDevelop.Xml.Parser
System.Diagnostics.Debug.Assert (col > 0);
}
System.Diagnostics.Debug.Assert (line > 0);
- return new TextLocation (line, col);
+ return new DocumentLocation (line, col);
}
StringBuilder IXmlParserContext.KeywordBuilder {
@@ -307,25 +307,25 @@ namespace MonoDevelop.Xml.Parser
InternalLogError (new Error (ErrorType.Warning, message, ((IXmlParserContext)this).LocationMinus (1)));
}
- void IXmlParserContext.LogError (string message, TextLocation location)
+ void IXmlParserContext.LogError (string message, DocumentLocation location)
{
if (errors != null || ErrorLogged != null)
InternalLogError (new Error (ErrorType.Error, message, ((IXmlParserContext)this).LocationMinus (1)));
}
- void IXmlParserContext.LogWarning (string message, TextLocation location)
+ void IXmlParserContext.LogWarning (string message, DocumentLocation location)
{
if (errors != null || ErrorLogged != null)
InternalLogError (new Error (ErrorType.Warning, message, location));
}
- void IXmlParserContext.LogError (string message, DomRegion region)
+ void IXmlParserContext.LogError (string message, DocumentRegion region)
{
if (errors != null || ErrorLogged != null)
InternalLogError (new Error (ErrorType.Error, message, region));
}
- void IXmlParserContext.LogWarning (string message, DomRegion region)
+ void IXmlParserContext.LogWarning (string message, DocumentRegion region)
{
if (errors != null || ErrorLogged != null)
InternalLogError (new Error (ErrorType.Warning, message, region));
@@ -382,17 +382,17 @@ namespace MonoDevelop.Xml.Parser
int StateTag { get; set; }
StringBuilder KeywordBuilder { get; }
int CurrentStateLength { get; }
- TextLocation Location { get; }
- TextLocation LocationMinus (int colOffset);
+ DocumentLocation Location { get; }
+ DocumentLocation LocationMinus (int colOffset);
XmlParserState PreviousState { get; }
NodeStack Nodes { get; }
bool BuildTree { get; }
void LogError (string message);
void LogWarning (string message);
- void LogError (string message, TextLocation location);
- void LogWarning (string message, TextLocation location);
- void LogError (string message, DomRegion region);
- void LogWarning (string message, DomRegion region);
+ void LogError (string message, DocumentLocation location);
+ void LogWarning (string message, DocumentLocation location);
+ void LogError (string message, DocumentRegion region);
+ void LogWarning (string message, DocumentRegion region);
void EndAll (bool pop);
void ConnectAll ();
}
diff --git a/main/src/addins/Xml/Parser/XmlRootState.cs b/main/src/addins/Xml/Parser/XmlRootState.cs
index d77d7e787b..bdc49a57a9 100644
--- a/main/src/addins/Xml/Parser/XmlRootState.cs
+++ b/main/src/addins/Xml/Parser/XmlRootState.cs
@@ -26,8 +26,8 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Xml.Dom;
+using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Xml.Parser
{
@@ -106,7 +106,7 @@ namespace MonoDevelop.Xml.Parser
if (c == '<') {
if (context.StateTag != FREE)
context.LogError ("Incomplete tag opening; encountered unexpected '<'.",
- new DomRegion (
+ new DocumentRegion (
context.LocationMinus (LengthFromOpenBracket (context) + 1),
context.LocationMinus (1)));
context.StateTag = BRACKET;
@@ -176,7 +176,7 @@ namespace MonoDevelop.Xml.Parser
}
context.LogError ("Incomplete tag opening; encountered unexpected character '" + c + "'.",
- new DomRegion (
+ new DocumentRegion (
context.LocationMinus (LengthFromOpenBracket (context)),
context.Location));
diff --git a/main/src/addins/Xml/Parser/XmlTagState.cs b/main/src/addins/Xml/Parser/XmlTagState.cs
index 20de1d46ec..f7b49420c8 100644
--- a/main/src/addins/Xml/Parser/XmlTagState.cs
+++ b/main/src/addins/Xml/Parser/XmlTagState.cs
@@ -27,19 +27,19 @@
//
using System;
-using System.Diagnostics;
-using ICSharpCode.NRefactory;
-using MonoDevelop.Xml.Dom;
-
+using System.Diagnostics;
+using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
+
namespace MonoDevelop.Xml.Parser
{
public class XmlTagState : XmlParserState
- {
- const int ATTEMPT_RECOVERY = 1;
- const int RECOVERY_FOUND_WHITESPACE = 2;
- const int MAYBE_SELF_CLOSING = 2;
+ {
+ const int ATTEMPT_RECOVERY = 1;
+ const int RECOVERY_FOUND_WHITESPACE = 2;
+ const int MAYBE_SELF_CLOSING = 2;
const int OK = 0;
readonly XmlAttributeState AttributeState;
@@ -49,16 +49,16 @@ namespace MonoDevelop.Xml.Parser
public XmlTagState (XmlAttributeState attributeState)
: this (attributeState, new XmlNameState ()) {}
-
- public XmlTagState (XmlAttributeState attributeState, XmlNameState nameState)
+
+ public XmlTagState (XmlAttributeState attributeState, XmlNameState nameState)
{
this.AttributeState = attributeState;
this.NameState = nameState;
Adopt (this.AttributeState);
- Adopt (this.NameState);
+ Adopt (this.NameState);
}
-
+
public override XmlParserState PushChar (char c, IXmlParserContext context, ref string rollback)
{
XElement element = context.Nodes.Peek () as XElement;
@@ -105,33 +105,33 @@ namespace MonoDevelop.Xml.Parser
Close (element, context, context.Location);
}
return Parent;
- }
-
- if (c == '/') {
- context.StateTag = MAYBE_SELF_CLOSING;
- return null;
- }
-
- if (context.StateTag == ATTEMPT_RECOVERY) {
- if (XmlChar.IsWhitespace (c)) {
- context.StateTag = RECOVERY_FOUND_WHITESPACE;
- }
- return null;
- }
-
- if (context.StateTag == RECOVERY_FOUND_WHITESPACE) {
- if (!XmlChar.IsFirstNameChar (c))
- return null;
- }
-
- context.StateTag = OK;
-
+ }
+
+ if (c == '/') {
+ context.StateTag = MAYBE_SELF_CLOSING;
+ return null;
+ }
+
+ if (context.StateTag == ATTEMPT_RECOVERY) {
+ if (XmlChar.IsWhitespace (c)) {
+ context.StateTag = RECOVERY_FOUND_WHITESPACE;
+ }
+ return null;
+ }
+
+ if (context.StateTag == RECOVERY_FOUND_WHITESPACE) {
+ if (!XmlChar.IsFirstNameChar (c))
+ return null;
+ }
+
+ context.StateTag = OK;
+
if (!element.IsNamed && XmlChar.IsFirstNameChar (c)) {
rollback = string.Empty;
- return NameState;
- }
-
- if (context.CurrentStateLength > 1 && XmlChar.IsFirstNameChar (c)) {
+ return NameState;
+ }
+
+ if (context.CurrentStateLength > 1 && XmlChar.IsFirstNameChar (c)) {
rollback = string.Empty;
return AttributeState;
}
@@ -139,24 +139,21 @@ namespace MonoDevelop.Xml.Parser
if (XmlChar.IsWhitespace (c))
return null;
- context.LogError ("Unexpected character '" + c + "' in tag.", context.LocationMinus (1));
+ context.LogError ("Unexpected character '" + c + "' in tag.", context.LocationMinus (1));
context.StateTag = ATTEMPT_RECOVERY;
- return null;
+ return null;
}
- protected virtual void Close (XElement element, IXmlParserContext context, TextLocation location)
+ protected virtual void Close (XElement element, IXmlParserContext context, DocumentLocation location)
{
//have already checked that element is not null, i.e. top of stack is our element
if (element.IsClosed)
- context.Nodes.Pop ();
-
+ context.Nodes.Pop ();
+
element.End (location);
if (context.BuildTree) {
- XContainer container = element.IsClosed?
- (XContainer) context.Nodes.Peek ()
- : (XContainer) context.Nodes.Peek (1);
-
- container.AddChildNode (element);
+ var parent = (XContainer)context.Nodes.Peek (element.IsClosed ? 0 : 1);
+ parent.AddChildNode (element);
}
}
}
diff --git a/main/src/addins/Xml/Properties/MonoDevelop.XmlEditor.addin.xml b/main/src/addins/Xml/Properties/MonoDevelop.XmlEditor.addin.xml
index d2da8c8f7e..106cc52ce7 100644
--- a/main/src/addins/Xml/Properties/MonoDevelop.XmlEditor.addin.xml
+++ b/main/src/addins/Xml/Properties/MonoDevelop.XmlEditor.addin.xml
@@ -86,11 +86,11 @@
<Section id="XmlFormattingOptions" insertbefore="Formatting" _label="XML" fill="true" class="MonoDevelop.Xml.Editor.XmlEditorOptionsPanel" icon="md-prefs-xml" />
</Extension>
<Extension path = "/MonoDevelop/Ide/GlobalOptionsDialog/TextEditor">
- <Section id="XmlSchemas" _label="XML Schemas" fill="true" class="MonoDevelop.Xml.Editor.XmlSchemasPanel" icon="md-prefs-xml-schemas" />
+ <Section id="XmlSchemas" _label="XML Schemas" fill="true" class="MonoDevelop.Xml.Editor.XmlSchemasPanel" icon="md-prefs-xml" />
</Extension>
<Extension path = "/MonoDevelop/TypeSystem/Parser">
- <Parser class = "MonoDevelop.Xml.MSBuild.MSBuildDocumentParser" mimeType = "application/x-msbuild" id = "XmlParser"/>
+ <Parser class = "MonoDevelop.Xml.MSBuild.MSBuildDocumentParser" mimeType = "application/x-msbuild" id = "MSBuildParser"/>
<Parser class = "MonoDevelop.Xml.Editor.XmlDocumentParser" mimeType = "application/xml" id = "XmlParser"/>
</Extension>
@@ -120,6 +120,5 @@
<Extension path="/MonoDevelop/Core/StockIcons">
<StockIcon stockid="md-prefs-xml" resource="prefs-xml-16.png" size="Menu" />
- <StockIcon stockid="md-prefs-xml-schemas" resource="prefs-xml-schemas-16.png" size="Menu" />
</Extension>
</ExtensionModel>
diff --git a/main/src/addins/Xml/Tests/Formatting/XmlFormatterTests.cs b/main/src/addins/Xml/Tests/Formatting/XmlFormatterTests.cs
new file mode 100644
index 0000000000..ae5d1cf583
--- /dev/null
+++ b/main/src/addins/Xml/Tests/Formatting/XmlFormatterTests.cs
@@ -0,0 +1,83 @@
+//
+// XmlFormatterTests.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Xml.Formatting;
+using NUnit.Framework;
+
+namespace MonoDevelop.Xml.Tests.Formatting
+{
+ [TestFixture]
+ public class XmlFormatterTests
+ {
+ TextStylePolicy textPolicy;
+ XmlFormattingPolicy xmlPolicy;
+
+ [SetUp]
+ public void Init ()
+ {
+ textPolicy = new TextStylePolicy ();
+ xmlPolicy = new XmlFormattingPolicy ();
+ }
+
+ [Test]
+ public void OmitXmlDeclarationIsFalse_XmlDeclarationDoesNotExist_XmlDeclarationIsAdded ()
+ {
+ xmlPolicy.DefaultFormat.OmitXmlDeclaration = false;
+ string input = "<a></a>";
+ string expectedResult = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<a>\n</a>";
+
+ string result = XmlFormatter.FormatXml (textPolicy, xmlPolicy, input);
+
+ Assert.AreEqual (expectedResult, result);
+ }
+
+ [Test]
+ public void OmitXmlDeclarationIsTrue_XmlDeclarationExists_XmlDeclarationRemoved ()
+ {
+ xmlPolicy.DefaultFormat.OmitXmlDeclaration = true;
+ string input = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<a></a>";
+ string expectedResult = "<a>\n</a>";
+
+ string result = XmlFormatter.FormatXml (textPolicy, xmlPolicy, input);
+
+ Assert.AreEqual (expectedResult, result);
+ }
+
+ [Test]
+ public void OmitXmlDeclarationIsFalse_XmlDeclarationExists_XmlDeclarationUnmodified ()
+ {
+ xmlPolicy.DefaultFormat.OmitXmlDeclaration = false;
+ string input = "<?xml version=\"1.0\"?><a></a>";
+ string expectedResult = "<?xml version=\"1.0\"?>\n<a>\n</a>";
+
+ string result = XmlFormatter.FormatXml (textPolicy, xmlPolicy, input);
+
+ Assert.AreEqual (expectedResult, result);
+ }
+ }
+}
+
diff --git a/main/src/addins/Xml/Tests/MonoDevelop.Xml.Tests.csproj b/main/src/addins/Xml/Tests/MonoDevelop.Xml.Tests.csproj
index f218032b4d..4124d68165 100644
--- a/main/src/addins/Xml/Tests/MonoDevelop.Xml.Tests.csproj
+++ b/main/src/addins/Xml/Tests/MonoDevelop.Xml.Tests.csproj
@@ -52,10 +52,6 @@
<Name>MonoDevelop.Ide</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
- <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
- <Name>ICSharpCode.NRefactory</Name>
- </ProjectReference>
<ProjectReference Include="..\..\..\..\external\guiunit\src\framework\GuiUnit_NET_4_5.csproj">
<Project>{D12F0F7B-8DE3-43EC-BA49-41052D065A9B}</Project>
<Name>GuiUnit_NET_4_5</Name>
@@ -69,6 +65,10 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
+ <Reference Include="Microsoft.CodeAnalysis">
+ <HintPath>..\..\..\..\build\bin\Microsoft.CodeAnalysis.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Parser\ActiveElementStartPathTestFixture.cs" />
@@ -127,6 +127,7 @@
<Compile Include="Schema\Uri\GetUriTestFixture.cs" />
<Compile Include="Schema\Includes\AttributeGroupRefSchemaIncludeTestFixture.cs" />
<Compile Include="Schema\Includes\TwoElementSchemaIncludeTestFixture.cs" />
+ <Compile Include="Formatting\XmlFormatterTests.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Parser\" />
diff --git a/main/src/addins/Xml/Tests/Parser/ParsingTests.cs b/main/src/addins/Xml/Tests/Parser/ParsingTests.cs
index 04d8f2275d..a269ad7cd2 100644
--- a/main/src/addins/Xml/Tests/Parser/ParsingTests.cs
+++ b/main/src/addins/Xml/Tests/Parser/ParsingTests.cs
@@ -27,11 +27,11 @@
//
using System.Linq;
+using NUnit.Framework;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Xml.Dom;
using MonoDevelop.Xml.Parser;
-using NUnit.Framework;
+using MonoDevelop.Ide.TypeSystem;
namespace MonoDevelop.Xml.Tests.Parser
@@ -170,7 +170,17 @@ namespace MonoDevelop.Xml.Tests.Parser
parser.AssertEmpty ();
parser.AssertErrorCount (0);
}
-
+
+
+ [Test]
+ public void BadClosingTag ()
+ {
+ var parser = new TestXmlParser (CreateRootState ());
+ parser.Parse (@"<doc><x><abc></ab c><cd></cd></x></doc>");
+ parser.AssertEmpty ();
+ parser.AssertErrorCount (2);
+ }
+
[Test]
public void Misc ()
{
@@ -243,8 +253,8 @@ namespace MonoDevelop.Xml.Tests.Parser
Assert.AreEqual ("foo", el.Attributes.ElementAt (2).Name.Name);
Assert.AreEqual (3, el.Attributes.Count ());
parser.AssertErrorCount (1);
- Assert.AreEqual (1, parser.Errors [0].Region.BeginLine);
- Assert.AreEqual (26, parser.Errors [0].Region.BeginColumn);
+ Assert.AreEqual (1, parser.Errors [0].Region.Begin.Line);
+ Assert.AreEqual (26, parser.Errors [0].Region.Begin.Column);
}
[Test]
diff --git a/main/src/addins/Xml/Tests/Parser/TestXmlParser.cs b/main/src/addins/Xml/Tests/Parser/TestXmlParser.cs
index 74afe274ff..04b6c5b979 100644
--- a/main/src/addins/Xml/Tests/Parser/TestXmlParser.cs
+++ b/main/src/addins/Xml/Tests/Parser/TestXmlParser.cs
@@ -30,12 +30,12 @@ using System;
using System.Collections.Generic;
using System.Linq;
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Xml.Completion;
using MonoDevelop.Xml.Dom;
using MonoDevelop.Xml.Parser;
using NUnit.Framework;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Xml.Tests.Parser
{
@@ -65,7 +65,7 @@ namespace MonoDevelop.Xml.Tests.Parser
var p = new TestXmlParser (new XmlRootState (), true);
//parse and capture line/col info
- var list = new List<TextLocation> ();
+ var list = new List<DocumentLocation> ();
p.Parse (txt, Array.ConvertAll (asserts, a => (Action)(() => list.Add (p.Location))));
var doc = (XDocument) p.Nodes.Last ();
diff --git a/main/src/addins/Xml/Tests/Schema/AbstractElementTestFixture.cs b/main/src/addins/Xml/Tests/Schema/AbstractElementTestFixture.cs
index 62dd1300db..c24ae2d0e0 100644
--- a/main/src/addins/Xml/Tests/Schema/AbstractElementTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/AbstractElementTestFixture.cs
@@ -1,7 +1,9 @@
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
-
+using System.Threading;
+using System.Threading.Tasks;
+
namespace MonoDevelop.Xml.Tests.Schema
{
/// <summary>
@@ -14,49 +16,57 @@ namespace MonoDevelop.Xml.Tests.Schema
CompletionDataList fileElementAttributes;
CompletionDataList fileElementChildren;
- public override void FixtureInit()
+ async Task Init ()
{
+ if (fileElementAttributes != null)
+ return;
+
var path = new XmlElementPath();
path.Elements.Add(new QualifiedName("project", "http://foo"));
path.Elements.Add(new QualifiedName("items", "http://foo"));
-
- itemsElementChildren = SchemaCompletionData.GetChildElementCompletionData(path);
+
+ itemsElementChildren = await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None);
path.Elements.Add(new QualifiedName("file", "http://foo"));
- fileElementAttributes = SchemaCompletionData.GetAttributeCompletionData(path);
- fileElementChildren = SchemaCompletionData.GetChildElementCompletionData(path);
+ fileElementAttributes = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
+ fileElementChildren = await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None);
}
[Test]
- public void ItemsElementHasTwoChildElements()
+ public async Task ItemsElementHasTwoChildElements()
{
+ await Init ();
Assert.AreEqual(2, itemsElementChildren.Count,
"Should be 2 child elements.");
}
[Test]
- public void ReferenceElementIsChildOfItemsElement()
+ public async Task ReferenceElementIsChildOfItemsElement()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(itemsElementChildren, "reference"));
}
[Test]
- public void FileElementIsChildOfItemsElement()
+ public async Task FileElementIsChildOfItemsElement()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(itemsElementChildren, "file"));
}
[Test]
- public void FileElementHasAttributeNamedType()
+ public async Task FileElementHasAttributeNamedType()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(fileElementAttributes, "type"));
}
[Test]
- public void FileElementHasTwoChildElements()
+ public async Task FileElementHasTwoChildElements()
{
+ await Init ();
Assert.AreEqual(2, fileElementChildren.Count, "Should be 2 child elements.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/AllElementTestFixture.cs b/main/src/addins/Xml/Tests/Schema/AllElementTestFixture.cs
index a9a7a3265d..9f964e37b9 100644
--- a/main/src/addins/Xml/Tests/Schema/AllElementTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/AllElementTestFixture.cs
@@ -1,7 +1,9 @@
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
-
+using System.Threading;
+using System.Threading.Tasks;
+
namespace MonoDevelop.Xml.Tests.Schema
{
/// <summary>
@@ -15,33 +17,39 @@ namespace MonoDevelop.Xml.Tests.Schema
CompletionDataList firstNameAttributes;
CompletionDataList firstNameElementChildren;
- public override void FixtureInit()
+ async Task Init ()
{
+ if (personElementChildren != null)
+ return;
+
var path = new XmlElementPath();
path.Elements.Add(new QualifiedName("person", "http://foo"));
- personElementChildren = SchemaCompletionData.GetChildElementCompletionData(path);
+ personElementChildren = await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None);
path.Elements.Add(new QualifiedName("firstname", "http://foo"));
- firstNameAttributes = SchemaCompletionData.GetAttributeCompletionData(path);
- firstNameElementChildren = SchemaCompletionData.GetChildElementCompletionData(path);
+ firstNameAttributes = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
+ firstNameElementChildren = await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None);
}
[Test]
- public void PersonElementHasTwoChildElements()
+ public async Task PersonElementHasTwoChildElements()
{
+ await Init ();
Assert.AreEqual(2, personElementChildren.Count,
"Should be 2 child elements.");
}
[Test]
- public void FirstNameElementHasAttribute()
+ public async Task FirstNameElementHasAttribute()
{
+ await Init ();
Assert.AreEqual(1, firstNameAttributes.Count, "Should have one attribute.");
}
[Test]
- public void FirstNameElementHasChildren()
+ public async Task FirstNameElementHasChildren()
{
+ await Init ();
Assert.AreEqual(2, firstNameElementChildren.Count,
"Should be 2 child elements.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/AttributeAnnotationTestFixture.cs b/main/src/addins/Xml/Tests/Schema/AttributeAnnotationTestFixture.cs
index 071f9ac510..289c650d31 100644
--- a/main/src/addins/Xml/Tests/Schema/AttributeAnnotationTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/AttributeAnnotationTestFixture.cs
@@ -1,3 +1,5 @@
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
@@ -14,27 +16,32 @@ namespace MonoDevelop.Xml.Tests.Schema
CompletionDataList fooAttributeCompletionData;
CompletionDataList barAttributeCompletionData;
- public override void FixtureInit()
- {
+ async Task Init ()
+ {
+ if (fooAttributeCompletionData != null)
+ return;
+
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("foo", "http://foo.com"));
- fooAttributeCompletionData = SchemaCompletionData.GetAttributeCompletionData(path);
+ fooAttributeCompletionData = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
path.Elements.Add(new QualifiedName("bar", "http://foo.com"));
- barAttributeCompletionData = SchemaCompletionData.GetAttributeCompletionData(path);
+ barAttributeCompletionData = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
}
[Test]
- public void FooAttributeDocumentation()
+ public async Task FooAttributeDocumentation()
{
- Assert.AreEqual("Documentation for foo attribute.", fooAttributeCompletionData[0].Description);
+ await Init ();
+ Assert.AreEqual("Documentation for foo attribute.", ((MonoDevelop.Ide.CodeCompletion.CompletionData)fooAttributeCompletionData[0]).Description);
}
[Test]
- public void BarAttributeDocumentation()
+ public async Task BarAttributeDocumentation()
{
- Assert.AreEqual("Documentation for bar attribute.", barAttributeCompletionData[0].Description);
+ await Init ();
+ Assert.AreEqual("Documentation for bar attribute.", ((MonoDevelop.Ide.CodeCompletion.CompletionData)barAttributeCompletionData[0]).Description);
}
protected override string GetSchema()
diff --git a/main/src/addins/Xml/Tests/Schema/AttributeGroupRefTestFixture.cs b/main/src/addins/Xml/Tests/Schema/AttributeGroupRefTestFixture.cs
index 94b397c1bc..430ba4bdd3 100644
--- a/main/src/addins/Xml/Tests/Schema/AttributeGroupRefTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/AttributeGroupRefTestFixture.cs
@@ -1,3 +1,5 @@
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
@@ -12,43 +14,50 @@ namespace MonoDevelop.Xml.Tests.Schema
{
CompletionDataList attributeCompletionData;
- public override void FixtureInit()
- {
+ async Task Init ()
+ {
+ if (attributeCompletionData != null)
+ return;
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
- attributeCompletionData = SchemaCompletionData.GetAttributeCompletionData(path);
+ attributeCompletionData = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
}
[Test]
- public void AttributeCount()
+ public async Task AttributeCount()
{
+ await Init ();
Assert.AreEqual(4, attributeCompletionData.Count, "Should be 4 attributes.");
}
[Test]
- public void NameAttribute()
+ public async Task NameAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeCompletionData, "name"),
"Attribute name does not exist.");
}
[Test]
- public void IdAttribute()
+ public async Task IdAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeCompletionData, "id"),
"Attribute id does not exist.");
}
[Test]
- public void StyleAttribute()
+ public async Task StyleAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeCompletionData, "style"),
"Attribute style does not exist.");
}
[Test]
- public void TitleAttribute()
+ public async Task TitleAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeCompletionData, "title"),
"Attribute title does not exist.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/AttributeRefTestFixture.cs b/main/src/addins/Xml/Tests/Schema/AttributeRefTestFixture.cs
index 4cf58808ed..93afa986de 100644
--- a/main/src/addins/Xml/Tests/Schema/AttributeRefTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/AttributeRefTestFixture.cs
@@ -1,3 +1,5 @@
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
@@ -12,41 +14,48 @@ namespace MonoDevelop.Xml.Tests.Schema
{
CompletionDataList attributes;
- public override void FixtureInit()
- {
+ async Task Init ()
+ {
+ if (attributes != null)
+ return;
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("html", "http://foo/xhtml"));
- attributes = SchemaCompletionData.GetAttributeCompletionData(path);
+ attributes = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
}
[Test]
- public void HtmlAttributeCount()
+ public async Task HtmlAttributeCount()
{
+ await Init ();
Assert.AreEqual(4, attributes.Count,
"Should be 4 attributes.");
}
[Test]
- public void HtmlLangAttribute()
+ public async Task HtmlLangAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributes, "lang"), "Attribute lang not found.");
}
[Test]
- public void HtmlIdAttribute()
+ public async Task HtmlIdAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributes, "id"), "Attribute id not found.");
}
[Test]
- public void HtmlDirAttribute()
+ public async Task HtmlDirAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributes, "dir"), "Attribute dir not found.");
}
[Test]
- public void HtmlXmlLangAttribute()
+ public async Task HtmlXmlLangAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributes, "xml:lang"), "Attribute xml:lang not found.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/AttributeValueAnnotationTestFixture.cs b/main/src/addins/Xml/Tests/Schema/AttributeValueAnnotationTestFixture.cs
index 85860aeed5..baf51d11d3 100644
--- a/main/src/addins/Xml/Tests/Schema/AttributeValueAnnotationTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/AttributeValueAnnotationTestFixture.cs
@@ -1,3 +1,5 @@
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
@@ -13,16 +15,19 @@ namespace MonoDevelop.Xml.Tests.Schema
{
CompletionDataList barAttributeValuesCompletionData;
- public override void FixtureInit()
- {
+ async Task Init ()
+ {
+ if (barAttributeValuesCompletionData != null)
+ return;
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("foo", "http://foo.com"));
- barAttributeValuesCompletionData = SchemaCompletionData.GetAttributeValueCompletionData(path, "bar");
+ barAttributeValuesCompletionData = await SchemaCompletionData.GetAttributeValueCompletionData(path, "bar", CancellationToken.None);
}
[Test]
- public void BarAttributeValueDefaultDocumentation()
+ public async Task BarAttributeValueDefaultDocumentation()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.ContainsDescription(barAttributeValuesCompletionData, "default", "Default attribute value info."),
"Description for attribute value 'default' is incorrect.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/ChildElementAttributesTestFixture.cs b/main/src/addins/Xml/Tests/Schema/ChildElementAttributesTestFixture.cs
index 4154ee41d4..b2cf869f8a 100644
--- a/main/src/addins/Xml/Tests/Schema/ChildElementAttributesTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/ChildElementAttributesTestFixture.cs
@@ -1,3 +1,5 @@
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
@@ -12,24 +14,28 @@ namespace MonoDevelop.Xml.Tests.Schema
{
CompletionDataList attributes;
- public override void FixtureInit()
- {
+ async Task Init ()
+ {
+ if (attributes != null)
+ return;
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("project", "http://nant.sf.net//nant-0.84.xsd"));
path.Elements.Add(new QualifiedName("attrib", "http://nant.sf.net//nant-0.84.xsd"));
- attributes = SchemaCompletionData.GetAttributeCompletionData(path);
+ attributes = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
}
[Test]
- public void AttributeCount()
+ public async Task AttributeCount()
{
+ await Init ();
Assert.AreEqual(10, attributes.Count, "Should be one attribute.");
}
[Test]
- public void FileAttribute()
+ public async Task FileAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributes, "file"),
"Attribute file does not exist.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/ChoiceTestFixture.cs b/main/src/addins/Xml/Tests/Schema/ChoiceTestFixture.cs
index 6eff3b644c..2f6e50d4b1 100644
--- a/main/src/addins/Xml/Tests/Schema/ChoiceTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/ChoiceTestFixture.cs
@@ -1,3 +1,5 @@
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
@@ -13,51 +15,58 @@ namespace MonoDevelop.Xml.Tests.Schema
{
CompletionDataList noteChildElements;
- public override void FixtureInit()
- {
+ async Task Init ()
+ {
+ if (noteChildElements != null)
+ return;
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
- noteChildElements = SchemaCompletionData.GetChildElementCompletionData(path);
+ noteChildElements = await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None);
}
[Test]
- public void TitleHasNoChildElements()
+ public async Task TitleHasNoChildElements()
{
+ await Init ();
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
path.Elements.Add(new QualifiedName("title", "http://www.w3schools.com"));
- Assert.AreEqual(0, SchemaCompletionData.GetChildElementCompletionData(path).Count,
+ Assert.AreEqual(0, (await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None)).Count,
"Should be no child elements.");
}
[Test]
- public void TextHasNoChildElements()
+ public async Task TextHasNoChildElements()
{
+ await Init ();
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
path.Elements.Add(new QualifiedName("text", "http://www.w3schools.com"));
- Assert.AreEqual(0, SchemaCompletionData.GetChildElementCompletionData(path).Count,
+ Assert.AreEqual(0, (await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None)).Count,
"Should be no child elements.");
}
[Test]
- public void NoteHasTwoChildElements()
+ public async Task NoteHasTwoChildElements()
{
+ await Init ();
Assert.AreEqual(2, noteChildElements.Count,
"Should be two child elements.");
}
[Test]
- public void NoteChildElementIsText()
+ public async Task NoteChildElementIsText()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(noteChildElements, "text"),
"Should have a child element called text.");
}
[Test]
- public void NoteChildElementIsTitle()
+ public async Task NoteChildElementIsTitle()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(noteChildElements, "title"),
"Should have a child element called title.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/ComplexContentExtensionTestFixture.cs b/main/src/addins/Xml/Tests/Schema/ComplexContentExtensionTestFixture.cs
index 10c8aebc3d..9bda62faa7 100644
--- a/main/src/addins/Xml/Tests/Schema/ComplexContentExtensionTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/ComplexContentExtensionTestFixture.cs
@@ -1,3 +1,5 @@
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
@@ -13,68 +15,77 @@ namespace MonoDevelop.Xml.Tests.Schema
CompletionDataList bodyChildElements;
CompletionDataList bodyAttributes;
- public override void FixtureInit()
- {
+ async Task Init ()
+ {
+ if (bodyChildElements != null)
+ return;
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("body", "http://www.w3schools.com"));
- bodyChildElements = SchemaCompletionData.GetChildElementCompletionData(path);
- bodyAttributes = SchemaCompletionData.GetAttributeCompletionData(path);
+ bodyChildElements = await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None);
+ bodyAttributes = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
}
[Test]
- public void TitleHasNoChildElements()
+ public async Task TitleHasNoChildElements()
{
+ await Init ();
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("body", "http://www.w3schools.com"));
path.Elements.Add(new QualifiedName("title", "http://www.w3schools.com"));
- Assert.AreEqual(0, SchemaCompletionData.GetChildElementCompletionData(path).Count,
+ Assert.AreEqual(0, (await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None)).Count,
"Should be no child elements.");
}
[Test]
- public void TextHasNoChildElements()
+ public async Task TextHasNoChildElements()
{
+ await Init ();
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("body", "http://www.w3schools.com"));
path.Elements.Add(new QualifiedName("text", "http://www.w3schools.com"));
- Assert.AreEqual(0, SchemaCompletionData.GetChildElementCompletionData(path).Count,
+ Assert.AreEqual(0, (await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None)).Count,
"Should be no child elements.");
}
[Test]
- public void BodyHasTwoChildElements()
+ public async Task BodyHasTwoChildElements()
{
+ await Init ();
Assert.AreEqual(2, bodyChildElements.Count,
"Should be two child elements.");
}
[Test]
- public void BodyChildElementIsText()
+ public async Task BodyChildElementIsText()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(bodyChildElements, "text"),
"Should have a child element called text.");
}
[Test]
- public void BodyChildElementIsTitle()
+ public async Task BodyChildElementIsTitle()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(bodyChildElements, "title"),
"Should have a child element called title.");
}
[Test]
- public void BodyAttributeCount()
+ public async Task BodyAttributeCount()
{
+ await Init ();
Assert.AreEqual(1, bodyAttributes.Count,
"Should be one attribute.");
}
[Test]
- public void BodyAttributeName()
+ public async Task BodyAttributeName()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(bodyAttributes, "id"), "Attribute id not found.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/DuplicateElementTestFixture.cs b/main/src/addins/Xml/Tests/Schema/DuplicateElementTestFixture.cs
index 07ccb2afb0..ccafdc361d 100644
--- a/main/src/addins/Xml/Tests/Schema/DuplicateElementTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/DuplicateElementTestFixture.cs
@@ -1,7 +1,9 @@
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
-
+using System.Threading;
+using System.Threading.Tasks;
+
namespace MonoDevelop.Xml.Tests.Schema
{
/// <summary>
@@ -12,31 +14,36 @@ namespace MonoDevelop.Xml.Tests.Schema
{
CompletionDataList htmlChildElements;
- public override void FixtureInit()
+ async Task Init ()
{
+ if (htmlChildElements != null)
+ return;
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("html", "http://foo/xhtml"));
- htmlChildElements = SchemaCompletionData.GetChildElementCompletionData(path);
+ htmlChildElements = await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None);
}
[Test]
- public void HtmlHasTwoChildElements()
+ public async Task HtmlHasTwoChildElements()
{
+ await Init ();
Assert.AreEqual(2, htmlChildElements.Count,
"Should be 2 child elements.");
}
[Test]
- public void HtmlChildElementHead()
+ public async Task HtmlChildElementHead()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(htmlChildElements, "head"),
"Should have a child element called head.");
}
[Test]
- public void HtmlChildElementBody()
+ public async Task HtmlChildElementBody()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(htmlChildElements, "body"),
"Should have a child element called body.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/ElementAnnotationTestFixture.cs b/main/src/addins/Xml/Tests/Schema/ElementAnnotationTestFixture.cs
index f4f709366e..c577fd793f 100644
--- a/main/src/addins/Xml/Tests/Schema/ElementAnnotationTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/ElementAnnotationTestFixture.cs
@@ -1,3 +1,5 @@
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
@@ -14,26 +16,31 @@ namespace MonoDevelop.Xml.Tests.Schema
CompletionDataList fooChildElementCompletionData;
CompletionDataList rootElementCompletionData;
- public override void FixtureInit()
- {
- rootElementCompletionData = SchemaCompletionData.GetElementCompletionData();
+ async Task Init ()
+ {
+ if (rootElementCompletionData != null)
+ return;
+
+ rootElementCompletionData = await SchemaCompletionData.GetElementCompletionData(CancellationToken.None);
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("foo", "http://foo.com"));
- fooChildElementCompletionData = SchemaCompletionData.GetChildElementCompletionData(path);
+ fooChildElementCompletionData = await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None);
}
[Test]
- public void RootElementDocumentation()
+ public async Task RootElementDocumentation()
{
- Assert.AreEqual("Documentation for foo element.", rootElementCompletionData[0].Description);
+ await Init ();
+ Assert.AreEqual("Documentation for foo element.", ((MonoDevelop.Ide.CodeCompletion.CompletionData)rootElementCompletionData[0]).Description);
}
[Test]
- public void FooChildElementDocumentation()
+ public async Task FooChildElementDocumentation()
{
- Assert.AreEqual("Documentation for bar element.", fooChildElementCompletionData[0].Description);
+ await Init ();
+ Assert.AreEqual("Documentation for bar element.", ((MonoDevelop.Ide.CodeCompletion.CompletionData)fooChildElementCompletionData[0]).Description);
}
protected override string GetSchema()
diff --git a/main/src/addins/Xml/Tests/Schema/ElementRefAnnotationTestFixture.cs b/main/src/addins/Xml/Tests/Schema/ElementRefAnnotationTestFixture.cs
index f102adc70e..1e0abe564b 100644
--- a/main/src/addins/Xml/Tests/Schema/ElementRefAnnotationTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/ElementRefAnnotationTestFixture.cs
@@ -1,3 +1,5 @@
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
@@ -13,17 +15,21 @@ namespace MonoDevelop.Xml.Tests.Schema
{
CompletionDataList fooChildElementCompletionData;
- public override void FixtureInit()
- {
+ async Task Init ()
+ {
+ if (fooChildElementCompletionData != null)
+ return;
+
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("foo", "http://foo.com"));
- fooChildElementCompletionData = SchemaCompletionData.GetChildElementCompletionData(path);
+ fooChildElementCompletionData = await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None);
}
[Test]
- public void BarElementDocumentation()
+ public async Task BarElementDocumentation()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.ContainsDescription(fooChildElementCompletionData, "bar", "Documentation for bar element."),
"Missing documentation for bar element");
}
diff --git a/main/src/addins/Xml/Tests/Schema/ElementWithAttributeSchemaTestFixture.cs b/main/src/addins/Xml/Tests/Schema/ElementWithAttributeSchemaTestFixture.cs
index 5929d39082..106c187811 100644
--- a/main/src/addins/Xml/Tests/Schema/ElementWithAttributeSchemaTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/ElementWithAttributeSchemaTestFixture.cs
@@ -1,3 +1,5 @@
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
@@ -13,33 +15,38 @@ namespace MonoDevelop.Xml.Tests.Schema
CompletionDataList attributeCompletionData;
string attributeName;
- public override void FixtureInit()
- {
+ async Task Init ()
+ {
+ if (attributeCompletionData != null)
+ return;
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
- attributeCompletionData = SchemaCompletionData.GetAttributeCompletionData(path);
+ attributeCompletionData = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
attributeName = attributeCompletionData[0].DisplayText;
}
[Test]
- public void AttributeCount()
+ public async Task AttributeCount()
{
+ await Init ();
Assert.AreEqual(1, attributeCompletionData.Count, "Should be one attribute.");
}
[Test]
- public void AttributeName()
+ public async Task AttributeName()
{
+ await Init ();
Assert.AreEqual("name", attributeName, "Attribute name is incorrect.");
}
[Test]
- public void NoAttributesForUnknownElement()
+ public async Task NoAttributesForUnknownElement()
{
+ await Init ();
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("foobar", "http://www.w3schools.com"));
- CompletionDataList attributes = SchemaCompletionData.GetAttributeCompletionData(path);
+ CompletionDataList attributes = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
Assert.AreEqual(0, attributes.Count, "Should not find attributes for unknown element.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/EnumAttributeValueTestFixture.cs b/main/src/addins/Xml/Tests/Schema/EnumAttributeValueTestFixture.cs
index 7a56e0a84b..79a166e5ac 100644
--- a/main/src/addins/Xml/Tests/Schema/EnumAttributeValueTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/EnumAttributeValueTestFixture.cs
@@ -1,3 +1,5 @@
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
@@ -12,30 +14,35 @@ namespace MonoDevelop.Xml.Tests.Schema
{
CompletionDataList attributeValues;
- public override void FixtureInit()
- {
+ async Task Init ()
+ {
+ if (attributeValues != null)
+ return;
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("foo", "http://foo.com"));
- attributeValues = SchemaCompletionData.GetAttributeValueCompletionData(path, "id");
+ attributeValues = await SchemaCompletionData.GetAttributeValueCompletionData(path, "id", CancellationToken.None);
}
[Test]
- public void IdAttributeHasValueOne()
+ public async Task IdAttributeHasValueOne()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeValues, "one"),
"Missing attribute value 'one'");
}
[Test]
- public void IdAttributeHasValueTwo()
+ public async Task IdAttributeHasValueTwo()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeValues, "two"),
"Missing attribute value 'two'");
}
[Test]
- public void IdAttributeValueCount()
+ public async Task IdAttributeValueCount()
{
+ await Init ();
Assert.AreEqual(2, attributeValues.Count, "Expecting 2 attribute values.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/ExtensionElementTestFixture.cs b/main/src/addins/Xml/Tests/Schema/ExtensionElementTestFixture.cs
index f6ee5ba782..1f78317a4b 100644
--- a/main/src/addins/Xml/Tests/Schema/ExtensionElementTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/ExtensionElementTestFixture.cs
@@ -1,7 +1,9 @@
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
-
+using System.Threading;
+using System.Threading.Tasks;
+
namespace MonoDevelop.Xml.Tests.Schema
{
/// <summary>
@@ -18,59 +20,66 @@ namespace MonoDevelop.Xml.Tests.Schema
//CompletionDataList schemaAttributes;
CompletionDataList fooAttributes;
- public override void FixtureInit()
+ async Task Init ()
{
+ if (schemaChildElements != null)
+ return;
+
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("schema", "http://www.w3.org/2001/XMLSchema"));
- schemaChildElements = SchemaCompletionData.GetChildElementCompletionData(path);
+ schemaChildElements = await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None);
//schemaAttributes = SchemaCompletionData.GetAttributeCompletionData(path);
// Get include elements attributes.
path.Elements.Add(new QualifiedName("include", "http://www.w3.org/2001/XMLSchema"));
- includeAttributes = SchemaCompletionData.GetAttributeCompletionData(path);
+ includeAttributes = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
// Get annotation element info.
path.Elements.RemoveAt(path.Elements.Count - 1);
path.Elements.Add(new QualifiedName("annotation", "http://www.w3.org/2001/XMLSchema"));
- annotationChildElements = SchemaCompletionData.GetChildElementCompletionData(path);
- annotationAttributes = SchemaCompletionData.GetAttributeCompletionData(path);
+ annotationChildElements = await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None);
+ annotationAttributes = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
// Get app info attributes.
path.Elements.Add(new QualifiedName("appinfo", "http://www.w3.org/2001/XMLSchema"));
- appInfoAttributes = SchemaCompletionData.GetAttributeCompletionData(path);
+ appInfoAttributes = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
// Get foo attributes.
path = new XmlElementPath();
path.Elements.Add(new QualifiedName("foo", "http://www.w3.org/2001/XMLSchema"));
- fooAttributes = SchemaCompletionData.GetAttributeCompletionData(path);
+ fooAttributes = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
}
[Test]
- public void SchemaHasSevenChildElements()
+ public async Task SchemaHasSevenChildElements()
{
+ await Init ();
Assert.AreEqual(7, schemaChildElements.Count,
"Should be 7 child elements.");
}
[Test]
- public void SchemaChildElementIsInclude()
+ public async Task SchemaChildElementIsInclude()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(schemaChildElements, "include"),
"Should have a child element called include.");
}
[Test]
- public void SchemaChildElementIsImport()
+ public async Task SchemaChildElementIsImport()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(schemaChildElements, "import"),
"Should have a child element called import.");
}
[Test]
- public void SchemaChildElementIsNotation()
+ public async Task SchemaChildElementIsNotation()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(schemaChildElements, "notation"),
"Should have a child element called notation.");
}
@@ -79,68 +88,78 @@ namespace MonoDevelop.Xml.Tests.Schema
/// Tests that the extended element has the base type's attributes.
/// </summary>
[Test]
- public void FooHasClassAttribute()
+ public async Task FooHasClassAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(fooAttributes, "class"),
"Should have an attribute called class.");
}
[Test]
- public void AnnotationElementHasOneAttribute()
+ public async Task AnnotationElementHasOneAttribute()
{
+ await Init ();
Assert.AreEqual(1, annotationAttributes.Count, "Should be one attribute.");
}
[Test]
- public void AnnotationHasIdAttribute()
+ public async Task AnnotationHasIdAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(annotationAttributes, "id"),
"Should have an attribute called id.");
}
[Test]
- public void AnnotationHasTwoChildElements()
+ public async Task AnnotationHasTwoChildElements()
{
+ await Init ();
Assert.AreEqual(2, annotationChildElements.Count,
"Should be 2 child elements.");
}
[Test]
- public void AnnotationChildElementIsAppInfo()
+ public async Task AnnotationChildElementIsAppInfo()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(annotationChildElements, "appinfo"),
"Should have a child element called appinfo.");
}
[Test]
- public void AnnotationChildElementIsDocumentation()
+ public async Task AnnotationChildElementIsDocumentation()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(annotationChildElements, "documentation"),
"Should have a child element called documentation.");
}
[Test]
- public void IncludeElementHasOneAttribute()
+ public async Task IncludeElementHasOneAttribute()
{
+ await Init ();
Assert.AreEqual(1, includeAttributes.Count, "Should be one attribute.");
}
[Test]
- public void IncludeHasSchemaLocationAttribute()
+ public async Task IncludeHasSchemaLocationAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(includeAttributes, "schemaLocation"),
"Should have an attribute called schemaLocation.");
}
[Test]
- public void AppInfoElementHasOneAttribute()
+ public async Task AppInfoElementHasOneAttribute()
{
+ await Init ();
Assert.AreEqual(1, appInfoAttributes.Count, "Should be one attribute.");
}
[Test]
- public void AppInfoHasIdAttribute()
+ public async Task AppInfoHasIdAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(appInfoAttributes, "id"),
"Should have an attribute called id.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/GroupRefCompositorTestFixture.cs b/main/src/addins/Xml/Tests/Schema/GroupRefCompositorTestFixture.cs
index 6e6cb086f6..b65a8abd70 100644
--- a/main/src/addins/Xml/Tests/Schema/GroupRefCompositorTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/GroupRefCompositorTestFixture.cs
@@ -1,7 +1,9 @@
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
-
+using System.Threading;
+using System.Threading.Tasks;
+
namespace MonoDevelop.Xml.Tests.Schema
{
/// <summary>
@@ -17,42 +19,49 @@ namespace MonoDevelop.Xml.Tests.Schema
CompletionDataList rootChildElements;
CompletionDataList fooAttributes;
- public override void FixtureInit()
+ async Task Init ()
{
+ if (rootChildElements != null)
+ return;
+
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("root", "http://foo"));
- rootChildElements = SchemaCompletionData.GetChildElementCompletionData(path);
+ rootChildElements = await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None);
path.Elements.Add(new QualifiedName("foo", "http://foo"));
- fooAttributes = SchemaCompletionData.GetAttributeCompletionData(path);
+ fooAttributes = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
}
[Test]
- public void RootHasTwoChildElements()
+ public async Task RootHasTwoChildElements()
{
+ await Init ();
Assert.AreEqual(2, rootChildElements.Count,
"Should be two child elements.");
}
[Test]
- public void RootChildElementIsFoo()
+ public async Task RootChildElementIsFoo()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(rootChildElements, "foo"),
"Should have a child element called foo.");
}
[Test]
- public void RootChildElementIsBar()
+ public async Task RootChildElementIsBar()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(rootChildElements, "bar"),
"Should have a child element called bar.");
}
[Test]
- public void FooElementHasIdAttribute()
+ public async Task FooElementHasIdAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(fooAttributes, "id"),
"Should have an attribute called id.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/GroupRefTestFixture.cs b/main/src/addins/Xml/Tests/Schema/GroupRefTestFixture.cs
index 25d87736df..6bfffd4d7c 100644
--- a/main/src/addins/Xml/Tests/Schema/GroupRefTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/GroupRefTestFixture.cs
@@ -1,3 +1,5 @@
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
@@ -13,57 +15,66 @@ namespace MonoDevelop.Xml.Tests.Schema
CompletionDataList childElements;
CompletionDataList paraAttributes;
- public override void FixtureInit()
- {
+ async Task Init ()
+ {
+ if (childElements != null)
+ return;
+
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("html", "http://foo/xhtml"));
path.Elements.Add(new QualifiedName("body", "http://foo/xhtml"));
- childElements = SchemaCompletionData.GetChildElementCompletionData(path);
+ childElements = await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None);
path.Elements.Add(new QualifiedName("p", "http://foo/xhtml"));
- paraAttributes = SchemaCompletionData.GetAttributeCompletionData(path);
+ paraAttributes = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
}
[Test]
- public void BodyHasFourChildElements()
+ public async Task BodyHasFourChildElements()
{
+ await Init ();
Assert.AreEqual(4, childElements.Count,
"Should be 4 child elements.");
}
[Test]
- public void BodyChildElementForm()
+ public async Task BodyChildElementForm()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(childElements, "form"),
"Should have a child element called form.");
}
[Test]
- public void BodyChildElementPara()
+ public async Task BodyChildElementPara()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(childElements, "p"),
"Should have a child element called p.");
}
[Test]
- public void BodyChildElementTest()
+ public async Task BodyChildElementTest()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(childElements, "test"),
"Should have a child element called test.");
}
[Test]
- public void BodyChildElementId()
+ public async Task BodyChildElementId()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(childElements, "id"),
"Should have a child element called id.");
}
[Test]
- public void ParaElementHasIdAttribute()
+ public async Task ParaElementHasIdAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(paraAttributes, "id"),
"Should have an attribute called id.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/MissingSchemaElementTestFixture.cs b/main/src/addins/Xml/Tests/Schema/MissingSchemaElementTestFixture.cs
index 0736cbe62b..e22f668f54 100644
--- a/main/src/addins/Xml/Tests/Schema/MissingSchemaElementTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/MissingSchemaElementTestFixture.cs
@@ -1,7 +1,9 @@
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
-
+using System.Threading;
+using System.Threading.Tasks;
+
namespace MonoDevelop.Xml.Tests.Schema
{
[TestFixture]
@@ -9,17 +11,20 @@ namespace MonoDevelop.Xml.Tests.Schema
{
CompletionDataList barElementAttributes;
- public override void FixtureInit()
+ async Task Init ()
{
+ if (barElementAttributes != null)
+ return;
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("root", "http://foo"));
path.Elements.Add(new QualifiedName("bar", "http://foo"));
- barElementAttributes = SchemaCompletionData.GetAttributeCompletionData(path);
+ barElementAttributes = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
}
[Test]
- public void BarHasOneAttribute()
+ public async Task BarHasOneAttribute()
{
+ await Init ();
Assert.AreEqual(1, barElementAttributes.Count, "Should have 1 attribute.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/NestedAttributeGroupRefTestFixture.cs b/main/src/addins/Xml/Tests/Schema/NestedAttributeGroupRefTestFixture.cs
index fcb65fb900..16cb8525d0 100644
--- a/main/src/addins/Xml/Tests/Schema/NestedAttributeGroupRefTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/NestedAttributeGroupRefTestFixture.cs
@@ -1,3 +1,5 @@
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
@@ -12,64 +14,74 @@ namespace MonoDevelop.Xml.Tests.Schema
{
CompletionDataList attributeCompletionData;
- public override void FixtureInit()
- {
+ async Task Init ()
+ {
+ if (attributeCompletionData != null)
+ return;
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
- attributeCompletionData = SchemaCompletionData.GetAttributeCompletionData(path);
+ attributeCompletionData = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
}
[Test]
- public void AttributeCount()
+ public async Task AttributeCount()
{
+ await Init ();
Assert.AreEqual(7, attributeCompletionData.Count, "Should be 7 attributes.");
}
[Test]
- public void NameAttribute()
+ public async Task NameAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeCompletionData, "name"),
"Attribute name does not exist.");
}
[Test]
- public void IdAttribute()
+ public async Task IdAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeCompletionData, "id"),
"Attribute id does not exist.");
}
[Test]
- public void StyleAttribute()
+ public async Task StyleAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeCompletionData, "style"),
"Attribute style does not exist.");
}
[Test]
- public void TitleAttribute()
+ public async Task TitleAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeCompletionData, "title"),
"Attribute title does not exist.");
}
[Test]
- public void BaseIdAttribute()
+ public async Task BaseIdAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeCompletionData, "baseid"),
"Attribute baseid does not exist.");
}
[Test]
- public void BaseStyleAttribute()
+ public async Task BaseStyleAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeCompletionData, "basestyle"),
"Attribute basestyle does not exist.");
}
[Test]
- public void BaseTitleAttribute()
+ public async Task BaseTitleAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeCompletionData, "basetitle"),
"Attribute basetitle does not exist.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/NestedChoiceTestFixture.cs b/main/src/addins/Xml/Tests/Schema/NestedChoiceTestFixture.cs
index 3323065312..ae8e03b231 100644
--- a/main/src/addins/Xml/Tests/Schema/NestedChoiceTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/NestedChoiceTestFixture.cs
@@ -1,3 +1,5 @@
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
@@ -14,53 +16,61 @@ namespace MonoDevelop.Xml.Tests.Schema
CompletionDataList noteChildElements;
CompletionDataList titleChildElements;
- public override void FixtureInit()
- {
+ async Task Init ()
+ {
+ if (noteChildElements != null)
+ return;
+
// Get note child elements.
XmlElementPath path = new XmlElementPath();
- path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
-
- noteChildElements = SchemaCompletionData.GetChildElementCompletionData(path);
+ path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
+
+ noteChildElements = await SchemaCompletionData.GetChildElementCompletionData (path, CancellationToken.None);
// Get title child elements.
path.Elements.Add(new QualifiedName("title", "http://www.w3schools.com"));
- titleChildElements = SchemaCompletionData.GetChildElementCompletionData(path);
+ titleChildElements = await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None);
}
[Test]
- public void TitleHasTwoChildElements()
+ public async Task TitleHasTwoChildElements()
{
+ await Init ();
Assert.AreEqual(2, titleChildElements.Count,
"Should be 2 child elements.");
}
[Test]
- public void TextHasNoChildElements()
+ public async Task TextHasNoChildElements()
{
+ await Init ();
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
path.Elements.Add(new QualifiedName("text", "http://www.w3schools.com"));
- Assert.AreEqual(0, SchemaCompletionData.GetChildElementCompletionData(path).Count,
+ Assert.AreEqual(0, (await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None)).Count,
"Should be no child elements.");
}
[Test]
- public void NoteHasTwoChildElements()
+ public async Task NoteHasTwoChildElements()
{
+ await Init ();
Assert.AreEqual(2, noteChildElements.Count,
"Should be two child elements.");
}
[Test]
- public void NoteChildElementIsText()
+ public async Task NoteChildElementIsText()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(noteChildElements, "text"),
"Should have a child element called text.");
}
[Test]
- public void NoteChildElementIsTitle()
+ public async Task NoteChildElementIsTitle()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(noteChildElements, "title"),
"Should have a child element called title.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/NestedElementSchemaTestFixture.cs b/main/src/addins/Xml/Tests/Schema/NestedElementSchemaTestFixture.cs
index 20e01b0c72..85feec0578 100644
--- a/main/src/addins/Xml/Tests/Schema/NestedElementSchemaTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/NestedElementSchemaTestFixture.cs
@@ -1,3 +1,5 @@
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
@@ -10,23 +12,28 @@ namespace MonoDevelop.Xml.Tests.Schema
XmlElementPath noteElementPath;
CompletionDataList elementData;
- public override void FixtureInit()
- {
+ async Task Init ()
+ {
+ if (elementData != null)
+ return;
+
noteElementPath = new XmlElementPath();
noteElementPath.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
- elementData = SchemaCompletionData.GetChildElementCompletionData(noteElementPath);
+ elementData = await SchemaCompletionData.GetChildElementCompletionData(noteElementPath, CancellationToken.None);
}
[Test]
- public void NoteHasOneChildElementCompletionDataItem()
+ public async Task NoteHasOneChildElementCompletionDataItem()
{
+ await Init ();
Assert.AreEqual(1, elementData.Count, "Should be one child element completion data item.");
}
[Test]
- public void NoteChildElementCompletionDataText()
+ public async Task NoteChildElementCompletionDataText()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(elementData, "text"),
"Should be one child element called text.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/NestedSequenceTestFixture.cs b/main/src/addins/Xml/Tests/Schema/NestedSequenceTestFixture.cs
index c4b24ce395..1d7010f8c6 100644
--- a/main/src/addins/Xml/Tests/Schema/NestedSequenceTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/NestedSequenceTestFixture.cs
@@ -1,3 +1,5 @@
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
@@ -13,50 +15,58 @@ namespace MonoDevelop.Xml.Tests.Schema
{
CompletionDataList noteChildElements;
- public override void FixtureInit()
- {
+ async Task Init ()
+ {
+ if (noteChildElements != null)
+ return;
+
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
- noteChildElements = SchemaCompletionData.GetChildElementCompletionData(path);
+ noteChildElements = await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None);
}
[Test]
- public void TitleHasNoChildElements()
+ public async Task TitleHasNoChildElements()
{
+ await Init ();
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
path.Elements.Add(new QualifiedName("title", "http://www.w3schools.com"));
- Assert.AreEqual(0, SchemaCompletionData.GetChildElementCompletionData(path).Count,
+ Assert.AreEqual(0, (await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None)).Count,
"Should be no child elements.");
}
[Test]
- public void TextHasNoChildElements()
+ public async Task TextHasNoChildElements()
{
+ await Init ();
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
path.Elements.Add(new QualifiedName("text", "http://www.w3schools.com"));
- Assert.AreEqual(0, SchemaCompletionData.GetChildElementCompletionData(path).Count,
+ Assert.AreEqual(0, (await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None)).Count,
"Should be no child elements.");
}
[Test]
- public void NoteHasTwoChildElements()
+ public async Task NoteHasTwoChildElements()
{
+ await Init ();
Assert.AreEqual(2, noteChildElements.Count,
"Should be two child elements.");
}
[Test]
- public void NoteChildElementIsText()
+ public async Task NoteChildElementIsText()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(noteChildElements, "text"),
"Should have a child element called text.");
}
[Test]
- public void NoteChildElementIsTitle()
+ public async Task NoteChildElementIsTitle()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(noteChildElements, "title"),
"Should have a child element called title.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/ReferencedElementsTestFixture.cs b/main/src/addins/Xml/Tests/Schema/ReferencedElementsTestFixture.cs
index 125925b3c5..3bbdbf2b1e 100644
--- a/main/src/addins/Xml/Tests/Schema/ReferencedElementsTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/ReferencedElementsTestFixture.cs
@@ -1,6 +1,8 @@
+using System.Threading;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
+using System.Threading.Tasks;
namespace MonoDevelop.Xml.Tests.Schema
{
@@ -12,84 +14,96 @@ namespace MonoDevelop.Xml.Tests.Schema
XmlElementPath shipToPath;
XmlElementPath shipOrderPath;
- public override void FixtureInit()
- {
+ async Task Init ()
+ {
+ if (shipOrderAttributes != null)
+ return;
+
// Get shipto attributes.
shipToPath = new XmlElementPath();
QualifiedName shipOrderName = new QualifiedName("shiporder", "http://www.w3schools.com");
shipToPath.Elements.Add(shipOrderName);
shipToPath.Elements.Add(new QualifiedName("shipto", "http://www.w3schools.com"));
- shipToAttributes = SchemaCompletionData.GetAttributeCompletionData(shipToPath);
+ shipToAttributes = await SchemaCompletionData.GetAttributeCompletionData(shipToPath, CancellationToken.None);
// Get shiporder attributes.
shipOrderPath = new XmlElementPath();
shipOrderPath.Elements.Add(shipOrderName);
- shipOrderAttributes = SchemaCompletionData.GetAttributeCompletionData(shipOrderPath);
+ shipOrderAttributes = await SchemaCompletionData.GetAttributeCompletionData(shipOrderPath, CancellationToken.None);
}
[Test]
- public void OneShipOrderAttribute()
+ public async Task OneShipOrderAttribute()
{
+ await Init ();
Assert.AreEqual(1, shipOrderAttributes.Count, "Should only have one shiporder attribute.");
}
[Test]
- public void ShipOrderAttributeName()
+ public async Task ShipOrderAttributeName()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(shipOrderAttributes,"id"),
"Incorrect shiporder attribute name.");
}
[Test]
- public void OneShipToAttribute()
+ public async Task OneShipToAttribute()
{
+ await Init ();
Assert.AreEqual(1, shipToAttributes.Count, "Should only have one shipto attribute.");
}
[Test]
- public void ShipToAttributeName()
+ public async Task ShipToAttributeName()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(shipToAttributes, "address"),
"Incorrect shipto attribute name.");
}
[Test]
- public void ShipOrderChildElementsCount()
+ public async Task ShipOrderChildElementsCount()
{
- Assert.AreEqual(1, SchemaCompletionData.GetChildElementCompletionData(shipOrderPath).Count,
+ await Init ();
+ Assert.AreEqual(1, (await SchemaCompletionData.GetChildElementCompletionData(shipOrderPath, CancellationToken.None)).Count,
"Should be one child element.");
}
[Test]
- public void ShipOrderHasShipToChildElement()
+ public async Task ShipOrderHasShipToChildElement()
{
- CompletionDataList data = SchemaCompletionData.GetChildElementCompletionData(shipOrderPath);
+ await Init ();
+ CompletionDataList data = await SchemaCompletionData.GetChildElementCompletionData(shipOrderPath, CancellationToken.None);
Assert.IsTrue(SchemaTestFixtureBase.Contains(data, "shipto"),
"Incorrect child element name.");
}
[Test]
- public void ShipToChildElementsCount()
+ public async Task ShipToChildElementsCount()
{
- Assert.AreEqual(2, SchemaCompletionData.GetChildElementCompletionData(shipToPath).Count,
+ await Init ();
+ Assert.AreEqual(2, (await SchemaCompletionData.GetChildElementCompletionData(shipToPath, CancellationToken.None)).Count,
"Should be 2 child elements.");
}
[Test]
- public void ShipToHasNameChildElement()
+ public async Task ShipToHasNameChildElement()
{
- CompletionDataList data = SchemaCompletionData.GetChildElementCompletionData(shipToPath);
+ await Init ();
+ CompletionDataList data = await SchemaCompletionData.GetChildElementCompletionData(shipToPath, CancellationToken.None);
Assert.IsTrue(SchemaTestFixtureBase.Contains(data, "name"),
"Incorrect child element name.");
}
[Test]
- public void ShipToHasAddressChildElement()
+ public async Task ShipToHasAddressChildElement()
{
- CompletionDataList data = SchemaCompletionData.GetChildElementCompletionData(shipToPath);
+ await Init ();
+ CompletionDataList data = await SchemaCompletionData.GetChildElementCompletionData(shipToPath, CancellationToken.None);
Assert.IsTrue(SchemaTestFixtureBase.Contains(data, "address"),
"Incorrect child element name.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/RestrictionElementTestFixture.cs b/main/src/addins/Xml/Tests/Schema/RestrictionElementTestFixture.cs
index 44e3075cee..b2b867cf80 100644
--- a/main/src/addins/Xml/Tests/Schema/RestrictionElementTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/RestrictionElementTestFixture.cs
@@ -1,7 +1,9 @@
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
-
+using System.Threading;
+using System.Threading.Tasks;
+
namespace MonoDevelop.Xml.Tests.Schema
{
/// <summary>
@@ -14,69 +16,79 @@ namespace MonoDevelop.Xml.Tests.Schema
CompletionDataList attributes;
CompletionDataList annotationChildElements;
CompletionDataList choiceChildElements;
-
- public override void FixtureInit()
- {
- XmlElementPath path = new XmlElementPath();
- path.Elements.Add(new QualifiedName("group", "http://www.w3.org/2001/XMLSchema"));
- childElements = SchemaCompletionData.GetChildElementCompletionData(path);
- attributes = SchemaCompletionData.GetAttributeCompletionData(path);
-
- // Get annotation child elements.
- path.Elements.Add(new QualifiedName("annotation", "http://www.w3.org/2001/XMLSchema"));
- annotationChildElements = SchemaCompletionData.GetChildElementCompletionData(path);
-
- // Get choice child elements.
- path.Elements.RemoveAt (path.Elements.Count - 1);
- path.Elements.Add(new QualifiedName("choice", "http://www.w3.org/2001/XMLSchema"));
- choiceChildElements = SchemaCompletionData.GetChildElementCompletionData(path);
+
+ async Task Init ()
+ {
+ if (childElements != null)
+ return;
+
+ XmlElementPath path = new XmlElementPath ();
+ path.Elements.Add (new QualifiedName ("group", "http://www.w3.org/2001/XMLSchema"));
+ childElements = await SchemaCompletionData.GetChildElementCompletionData (path, CancellationToken.None);
+ attributes = await SchemaCompletionData.GetAttributeCompletionData (path, CancellationToken.None);
+
+ // Get annotation child elements.
+ path.Elements.Add (new QualifiedName ("annotation", "http://www.w3.org/2001/XMLSchema"));
+ annotationChildElements = await SchemaCompletionData.GetChildElementCompletionData (path, CancellationToken.None);
+
+ // Get choice child elements.
+ path.Elements.RemoveAt (path.Elements.Count - 1);
+ path.Elements.Add (new QualifiedName ("choice", "http://www.w3.org/2001/XMLSchema"));
+ choiceChildElements = await SchemaCompletionData.GetChildElementCompletionData (path, CancellationToken.None);
}
[Test]
- public void GroupChildElementIsAnnotation()
+ public async Task GroupChildElementIsAnnotation()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(childElements, "annotation"),
"Should have a child element called annotation.");
}
[Test]
- public void GroupChildElementIsChoice()
+ public async Task GroupChildElementIsChoice()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(childElements, "choice"),
"Should have a child element called choice.");
}
[Test]
- public void GroupChildElementIsSequence()
+ public async Task GroupChildElementIsSequence()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(childElements, "sequence"),
"Should have a child element called sequence.");
}
[Test]
- public void GroupAttributeIsName()
+ public async Task GroupAttributeIsName()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributes, "name"),
"Should have an attribute called name.");
}
[Test]
- public void AnnotationChildElementIsAppInfo()
+ public async Task AnnotationChildElementIsAppInfo()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(annotationChildElements, "appinfo"),
"Should have a child element called appinfo.");
}
[Test]
- public void AnnotationChildElementIsDocumentation()
+ public async Task AnnotationChildElementIsDocumentation()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(annotationChildElements, "documentation"),
"Should have a child element called appinfo.");
}
[Test]
- public void ChoiceChildElementIsSequence()
+ public async Task ChoiceChildElementIsSequence()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(choiceChildElements, "element"),
"Should have a child element called element.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/SchemaTestFixtureBase.cs b/main/src/addins/Xml/Tests/Schema/SchemaTestFixtureBase.cs
index 5997a316bd..16e56e185e 100644
--- a/main/src/addins/Xml/Tests/Schema/SchemaTestFixtureBase.cs
+++ b/main/src/addins/Xml/Tests/Schema/SchemaTestFixtureBase.cs
@@ -1,4 +1,3 @@
-using ICSharpCode.NRefactory.Completion;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
@@ -52,7 +51,7 @@ namespace MonoDevelop.Xml.Tests.Schema
{
bool Contains = false;
- foreach (ICompletionData data in items) {
+ foreach (var data in items) {
if (data.DisplayText == name) {
Contains = true;
break;
@@ -70,12 +69,12 @@ namespace MonoDevelop.Xml.Tests.Schema
{
bool Contains = false;
- foreach (ICompletionData data in items) {
+ foreach (var data in items) {
if (data.DisplayText == name) {
- if (data.Description == description) {
+ //if (data.DisplayText == description) {
Contains = true;
break;
- }
+ //}
}
}
@@ -90,7 +89,7 @@ namespace MonoDevelop.Xml.Tests.Schema
{
int count = 0;
- foreach (ICompletionData data in items) {
+ foreach (var data in items) {
if (data.DisplayText == name) {
++count;
}
diff --git a/main/src/addins/Xml/Tests/Schema/SequencedChoiceTestFixture.cs b/main/src/addins/Xml/Tests/Schema/SequencedChoiceTestFixture.cs
index 1d043b61c9..14cffc8118 100644
--- a/main/src/addins/Xml/Tests/Schema/SequencedChoiceTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/SequencedChoiceTestFixture.cs
@@ -1,6 +1,8 @@
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
+using System.Threading;
+using System.Threading.Tasks;
namespace MonoDevelop.Xml.Tests.Schema
{
@@ -13,53 +15,61 @@ namespace MonoDevelop.Xml.Tests.Schema
{
CompletionDataList noteChildElements;
- public override void FixtureInit()
+ async Task Init ()
{
+ if (noteChildElements != null)
+ return;
+
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
- noteChildElements = SchemaCompletionData.GetChildElementCompletionData(path);
+ noteChildElements = await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None);
}
[Test]
- public void TitleHasNoChildElements()
+ public async Task TitleHasNoChildElements()
{
+ await Init ();
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
path.Elements.Add(new QualifiedName("title", "http://www.w3schools.com"));
- Assert.AreEqual(0, SchemaCompletionData.GetChildElementCompletionData(path).Count,
+ Assert.AreEqual(0, (await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None)).Count,
"Should be no child elements.");
}
[Test]
- public void TextHasNoChildElements()
+ public async Task TextHasNoChildElements()
{
+ await Init ();
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
path.Elements.Add(new QualifiedName("title", "http://www.w3schools.com"));
- Assert.AreEqual(0, SchemaCompletionData.GetChildElementCompletionData(path).Count,
+ Assert.AreEqual(0, (await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None)).Count,
"Should be no child elements.");
}
[Test]
- public void NoteHasTwoChildElements()
+ public async Task NoteHasTwoChildElements()
{
+ await Init ();
Assert.AreEqual(2, noteChildElements.Count,
"Should be two child elements.");
}
[Test]
- public void NoteChildElementIsText()
+ public async Task NoteChildElementIsText()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(noteChildElements, "text"),
"Should have a child element called text.");
}
[Test]
- public void NoteChildElementIsTitle()
+ public async Task NoteChildElementIsTitle()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(noteChildElements, "title"),
"Should have a child element called title.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/SimpleContentWithAttributeTestFixture.cs b/main/src/addins/Xml/Tests/Schema/SimpleContentWithAttributeTestFixture.cs
index b83fc5e7e2..979b34b886 100644
--- a/main/src/addins/Xml/Tests/Schema/SimpleContentWithAttributeTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/SimpleContentWithAttributeTestFixture.cs
@@ -1,3 +1,5 @@
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
@@ -12,17 +14,21 @@ namespace MonoDevelop.Xml.Tests.Schema
{
CompletionDataList attributeCompletionData;
- public override void FixtureInit()
- {
+ async Task Init ()
+ {
+ if (attributeCompletionData != null)
+ return;
+
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("foo", "http://foo.com"));
- attributeCompletionData = SchemaCompletionData.GetAttributeCompletionData(path);
+ attributeCompletionData = await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
}
[Test]
- public void BarAttributeExists()
+ public async Task BarAttributeExists()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributeCompletionData, "bar"),
"Attribute bar does not exist.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/SingleElementSchemaTestFixture.cs b/main/src/addins/Xml/Tests/Schema/SingleElementSchemaTestFixture.cs
index 46cf1e2c70..3e2b58ebc9 100644
--- a/main/src/addins/Xml/Tests/Schema/SingleElementSchemaTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/SingleElementSchemaTestFixture.cs
@@ -1,3 +1,5 @@
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
@@ -14,36 +16,42 @@ namespace MonoDevelop.Xml.Tests.Schema
CompletionDataList childElementCompletionData;
CompletionDataList attributeCompletionData;
- public override void FixtureInit()
- {
+ async Task Init ()
+ {
+ if (attributeCompletionData != null)
+ return;
+
XmlElementPath path = new XmlElementPath();
path.Elements.Add(new QualifiedName("note", "http://www.w3schools.com"));
attributeCompletionData =
- SchemaCompletionData.GetAttributeCompletionData(path);
+ await SchemaCompletionData.GetAttributeCompletionData(path, CancellationToken.None);
childElementCompletionData =
- SchemaCompletionData.GetChildElementCompletionData(path);
+ await SchemaCompletionData.GetChildElementCompletionData(path, CancellationToken.None);
}
[Test]
- public void NamespaceUri()
+ public async Task NamespaceUri()
{
+ await Init ();
Assert.AreEqual("http://www.w3schools.com",
SchemaCompletionData.NamespaceUri,
"Unexpected namespace.");
}
[Test]
- public void NoteElementHasNoAttributes()
+ public async Task NoteElementHasNoAttributes()
{
+ await Init ();
Assert.AreEqual(0, attributeCompletionData.Count,
"Not expecting any attributes.");
}
[Test]
- public void NoteElementHasNoChildElements()
+ public async Task NoteElementHasNoChildElements()
{
+ await Init ();
Assert.AreEqual(0, childElementCompletionData.Count, "" +
"Not expecting any child elements.");
}
diff --git a/main/src/addins/Xml/Tests/Schema/TwoElementSchemaTestFixture.cs b/main/src/addins/Xml/Tests/Schema/TwoElementSchemaTestFixture.cs
index 3d101f7e23..b1a220b1b4 100644
--- a/main/src/addins/Xml/Tests/Schema/TwoElementSchemaTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/TwoElementSchemaTestFixture.cs
@@ -1,7 +1,9 @@
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Xml.Completion;
using NUnit.Framework;
-
+using System.Threading.Tasks;
+using System.Threading;
+
namespace MonoDevelop.Xml.Tests.Schema
{
/// <summary>
@@ -28,56 +30,56 @@ namespace MonoDevelop.Xml.Tests.Schema
}
[Test]
- public void TextElementHasOneAttribute()
+ public async Task TextElementHasOneAttribute()
{
- CompletionDataList attributesCompletionData = SchemaCompletionData.GetAttributeCompletionData(textElementPath);
+ CompletionDataList attributesCompletionData = await SchemaCompletionData.GetAttributeCompletionData(textElementPath, CancellationToken.None);
Assert.AreEqual(1, attributesCompletionData.Count,
"Should have 1 text attribute.");
}
[Test]
- public void TextElementAttributeName()
+ public async Task TextElementAttributeName()
{
- CompletionDataList attributesCompletionData = SchemaCompletionData.GetAttributeCompletionData(textElementPath);
+ CompletionDataList attributesCompletionData = await SchemaCompletionData.GetAttributeCompletionData(textElementPath, CancellationToken.None);
Assert.IsTrue(SchemaTestFixtureBase.Contains(attributesCompletionData, "foo"),
"Unexpected text attribute name.");
}
[Test]
- public void NoteElementHasChildElement()
+ public async Task NoteElementHasChildElement()
{
CompletionDataList childElementCompletionData
- = SchemaCompletionData.GetChildElementCompletionData(noteElementPath);
+ = await SchemaCompletionData.GetChildElementCompletionData(noteElementPath, CancellationToken.None);
Assert.AreEqual(1, childElementCompletionData.Count,
"Should be one child.");
}
[Test]
- public void NoteElementHasNoAttributes()
+ public async Task NoteElementHasNoAttributes()
{
CompletionDataList attributeCompletionData
- = SchemaCompletionData.GetAttributeCompletionData(noteElementPath);
+ = await SchemaCompletionData.GetAttributeCompletionData(noteElementPath, CancellationToken.None);
Assert.AreEqual(0, attributeCompletionData.Count,
"Should no attributes.");
}
[Test]
- public void OneRootElement()
+ public async Task OneRootElement()
{
CompletionDataList elementCompletionData
- = SchemaCompletionData.GetElementCompletionData();
+ = await SchemaCompletionData.GetElementCompletionData(CancellationToken.None);
Assert.AreEqual(1, elementCompletionData.Count, "Should be 1 root element.");
}
[Test]
- public void RootElementIsNote()
+ public async Task RootElementIsNote()
{
CompletionDataList elementCompletionData
- = SchemaCompletionData.GetElementCompletionData();
+ = await SchemaCompletionData.GetElementCompletionData(CancellationToken.None);
Assert.IsTrue(Contains(elementCompletionData, "note"),
"Should be called note.");
diff --git a/main/src/addins/Xml/Tests/Schema/XhtmlStrictSchemaTestFixture.cs b/main/src/addins/Xml/Tests/Schema/XhtmlStrictSchemaTestFixture.cs
index 1082b73df2..fa80df0103 100644
--- a/main/src/addins/Xml/Tests/Schema/XhtmlStrictSchemaTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/XhtmlStrictSchemaTestFixture.cs
@@ -3,7 +3,9 @@ using MonoDevelop.Xml.Completion;
using NUnit.Framework;
using System.Xml;
using MonoDevelop.Xml.Tests.Utils;
-
+using System.Threading;
+using System.Threading.Tasks;
+
namespace MonoDevelop.Xml.Tests.Schema
{
/// <summary>
@@ -17,9 +19,11 @@ namespace MonoDevelop.Xml.Tests.Schema
CompletionDataList h1Attributes;
string namespaceURI = "http://www.w3.org/1999/xhtml";
- [TestFixtureSetUp]
- public void FixtureInit()
- {
+ async Task Init ()
+ {
+ if (schemaCompletionData != null)
+ return;
+
XmlTextReader reader = ResourceManager.GetXhtmlStrictSchema();
schemaCompletionData = new XmlSchemaCompletionData(reader);
@@ -30,12 +34,13 @@ namespace MonoDevelop.Xml.Tests.Schema
h1Path.Elements.Add(new QualifiedName("h1", namespaceURI));
// Get h1 element info.
- h1Attributes = schemaCompletionData.GetAttributeCompletionData(h1Path);
+ h1Attributes = await schemaCompletionData.GetAttributeCompletionData(h1Path, CancellationToken.None);
}
[Test]
- public void H1HasAttributes()
- {
+ public async Task H1HasAttributes()
+ {
+ await Init ();
Assert.IsTrue(h1Attributes.Count > 0, "Should have at least one attribute.");
}
}
diff --git a/main/src/addins/Xml/Tests/Schema/XsdSchemaTestFixture.cs b/main/src/addins/Xml/Tests/Schema/XsdSchemaTestFixture.cs
index 2a436d7e41..c4659ff82b 100644
--- a/main/src/addins/Xml/Tests/Schema/XsdSchemaTestFixture.cs
+++ b/main/src/addins/Xml/Tests/Schema/XsdSchemaTestFixture.cs
@@ -3,6 +3,8 @@ using MonoDevelop.Xml.Completion;
using NUnit.Framework;
using System.Xml;
using MonoDevelop.Xml.Tests.Utils;
+using System.Threading;
+using System.Threading.Tasks;
namespace MonoDevelop.Xml.Tests.Schema
{
@@ -34,9 +36,11 @@ namespace MonoDevelop.Xml.Tests.Schema
string namespaceURI = "http://www.w3.org/2001/XMLSchema";
string prefix = "xs";
- [TestFixtureSetUp]
- public void FixtureInit()
+ async Task Init ()
{
+ if (schemaCompletionData != null)
+ return;
+
XmlTextReader reader = ResourceManager.GetXsdSchema();
schemaCompletionData = new XmlSchemaCompletionData(reader);
@@ -46,26 +50,26 @@ namespace MonoDevelop.Xml.Tests.Schema
choicePath.Elements.Add(new QualifiedName("element", namespaceURI, prefix));
choicePath.Elements.Add(new QualifiedName("complexType", namespaceURI, prefix));
- mixedAttributeValues = schemaCompletionData.GetAttributeValueCompletionData(choicePath, "mixed");
+ mixedAttributeValues = await schemaCompletionData.GetAttributeValueCompletionData(choicePath, "mixed", CancellationToken.None);
choicePath.Elements.Add(new QualifiedName("choice", namespaceURI, prefix));
// Get choice element info.
- choiceAttributes = schemaCompletionData.GetAttributeCompletionData(choicePath);
- maxOccursAttributeValues = schemaCompletionData.GetAttributeValueCompletionData(choicePath, "maxOccurs");
+ choiceAttributes = await schemaCompletionData.GetAttributeCompletionData(choicePath, CancellationToken.None);
+ maxOccursAttributeValues = await schemaCompletionData.GetAttributeValueCompletionData(choicePath, "maxOccurs", CancellationToken.None);
// Set up element path.
elementPath = new XmlElementPath();
elementPath.Elements.Add(new QualifiedName("schema", namespaceURI, prefix));
-
- elementFormDefaultAttributeValues = schemaCompletionData.GetAttributeValueCompletionData(elementPath, "elementFormDefault");
- blockDefaultAttributeValues = schemaCompletionData.GetAttributeValueCompletionData(elementPath, "blockDefault");
- finalDefaultAttributeValues = schemaCompletionData.GetAttributeValueCompletionData(elementPath, "finalDefault");
+
+ elementFormDefaultAttributeValues = await schemaCompletionData.GetAttributeValueCompletionData (elementPath, "elementFormDefault", CancellationToken.None);
+ blockDefaultAttributeValues = await schemaCompletionData.GetAttributeValueCompletionData(elementPath, "blockDefault", CancellationToken.None);
+ finalDefaultAttributeValues = await schemaCompletionData.GetAttributeValueCompletionData(elementPath, "finalDefault", CancellationToken.None);
elementPath.Elements.Add(new QualifiedName("element", namespaceURI, prefix));
// Get element attribute info.
- elementAttributes = schemaCompletionData.GetAttributeCompletionData(elementPath);
+ elementAttributes = await schemaCompletionData.GetAttributeCompletionData(elementPath, CancellationToken.None);
// Set up simple enum type path.
simpleEnumPath = new XmlElementPath();
@@ -74,7 +78,7 @@ namespace MonoDevelop.Xml.Tests.Schema
simpleEnumPath.Elements.Add(new QualifiedName("restriction", namespaceURI, prefix));
// Get child elements.
- simpleEnumElements = schemaCompletionData.GetChildElementCompletionData(simpleEnumPath);
+ simpleEnumElements = await schemaCompletionData.GetChildElementCompletionData(simpleEnumPath, CancellationToken.None);
// Set up enum path.
enumPath = new XmlElementPath();
@@ -84,7 +88,7 @@ namespace MonoDevelop.Xml.Tests.Schema
enumPath.Elements.Add(new QualifiedName("enumeration", namespaceURI, prefix));
// Get attributes.
- enumAttributes = schemaCompletionData.GetAttributeCompletionData(enumPath);
+ enumAttributes = await schemaCompletionData.GetAttributeCompletionData(enumPath, CancellationToken.None);
// Set up xs:all path.
allElementPath = new XmlElementPath();
@@ -94,7 +98,7 @@ namespace MonoDevelop.Xml.Tests.Schema
allElementPath.Elements.Add(new QualifiedName("all", namespaceURI, prefix));
// Get child elements of the xs:all element.
- allElementChildElements = schemaCompletionData.GetChildElementCompletionData(allElementPath);
+ allElementChildElements = await schemaCompletionData.GetChildElementCompletionData(allElementPath, CancellationToken.None);
// Set up the path to the annotation element that is a child of xs:all.
allElementAnnotationPath = new XmlElementPath();
@@ -105,25 +109,28 @@ namespace MonoDevelop.Xml.Tests.Schema
allElementAnnotationPath.Elements.Add(new QualifiedName("annotation", namespaceURI, prefix));
// Get the xs:all annotation child element.
- allElementAnnotationChildElements = schemaCompletionData.GetChildElementCompletionData(allElementAnnotationPath);
+ allElementAnnotationChildElements = await schemaCompletionData.GetChildElementCompletionData(allElementAnnotationPath, CancellationToken.None);
}
[Test]
- public void ChoiceHasAttributes()
+ public async Task ChoiceHasAttributes()
{
+ await Init ();
Assert.IsTrue(choiceAttributes.Count > 0, "Should have at least one attribute.");
}
[Test]
- public void ChoiceHasMinOccursAttribute()
+ public async Task ChoiceHasMinOccursAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(choiceAttributes, "minOccurs"),
"Attribute minOccurs missing.");
}
[Test]
- public void ChoiceHasMaxOccursAttribute()
+ public async Task ChoiceHasMaxOccursAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(choiceAttributes, "maxOccurs"),
"Attribute maxOccurs missing.");
}
@@ -132,8 +139,9 @@ namespace MonoDevelop.Xml.Tests.Schema
/// Tests that prohibited attributes are not added to the completion data.
/// </summary>
[Test]
- public void ChoiceDoesNotHaveNameAttribute()
+ public async Task ChoiceDoesNotHaveNameAttribute()
{
+ await Init ();
Assert.IsFalse(SchemaTestFixtureBase.Contains(choiceAttributes, "name"),
"Attribute name should not exist.");
}
@@ -142,8 +150,9 @@ namespace MonoDevelop.Xml.Tests.Schema
/// Tests that prohibited attributes are not added to the completion data.
/// </summary>
[Test]
- public void ChoiceDoesNotHaveRefAttribute()
+ public async Task ChoiceDoesNotHaveRefAttribute()
{
+ await Init ();
Assert.IsFalse(SchemaTestFixtureBase.Contains(choiceAttributes, "ref"),
"Attribute ref should not exist.");
}
@@ -152,57 +161,65 @@ namespace MonoDevelop.Xml.Tests.Schema
/// Duplicate attribute test.
/// </summary>
[Test]
- public void ElementNameAttributeAppearsOnce()
+ public async Task ElementNameAttributeAppearsOnce()
{
+ await Init ();
int nameAttributeCount = SchemaTestFixtureBase.GetItemCount(elementAttributes, "name");
Assert.AreEqual(1, nameAttributeCount, "Should be only one name attribute.");
}
[Test]
- public void ElementHasIdAttribute()
+ public async Task ElementHasIdAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(elementAttributes, "id"),
"id attribute missing.");
}
[Test]
- public void SimpleRestrictionTypeHasEnumChildElement()
+ public async Task SimpleRestrictionTypeHasEnumChildElement()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(simpleEnumElements, "xs:enumeration"),
"enumeration element missing.");
}
[Test]
- public void EnumHasValueAttribute()
+ public async Task EnumHasValueAttribute()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(enumAttributes, "value"),
"Attribute value missing.");
}
[Test]
- public void ElementFormDefaultAttributeHasValueQualified()
+ public async Task ElementFormDefaultAttributeHasValueQualified()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(elementFormDefaultAttributeValues, "qualified"),
"Attribute value 'qualified' missing.");
}
[Test]
- public void BlockDefaultAttributeHasValueAll()
+ public async Task BlockDefaultAttributeHasValueAll()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(blockDefaultAttributeValues, "#all"),
"Attribute value '#all' missing.");
}
[Test]
- public void BlockDefaultAttributeHasValueExtension()
+ public async Task BlockDefaultAttributeHasValueExtension()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(blockDefaultAttributeValues, "extension"),
"Attribute value 'extension' missing.");
}
[Test]
- public void FinalDefaultAttributeHasValueList()
+ public async Task FinalDefaultAttributeHasValueList()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(finalDefaultAttributeValues, "list"),
"Attribute value 'list' missing.");
}
@@ -212,36 +229,41 @@ namespace MonoDevelop.Xml.Tests.Schema
/// </summary>
[Test]
[Ignore]
- public void MixedAttributeHasValueTrue()
+ public async Task MixedAttributeHasValueTrue()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(mixedAttributeValues, "true"),
"Attribute value 'true' missing.");
}
[Test]
- public void MaxOccursAttributeHasValueUnbounded()
+ public async Task MaxOccursAttributeHasValueUnbounded()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(maxOccursAttributeValues, "unbounded"),
"Attribute value 'unbounded' missing.");
}
[Test]
- public void AllElementHasAnnotationChildElement()
+ public async Task AllElementHasAnnotationChildElement()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(allElementChildElements, "xs:annotation"),
"Should have an annotation child element.");
}
[Test]
- public void AllElementHasElementChildElement()
+ public async Task AllElementHasElementChildElement()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(allElementChildElements, "xs:element"),
"Should have an child element called 'element'.");
}
[Test]
- public void AllElementAnnotationHasDocumentationChildElement()
+ public async Task AllElementAnnotationHasDocumentationChildElement()
{
+ await Init ();
Assert.IsTrue(SchemaTestFixtureBase.Contains(allElementAnnotationChildElements, "xs:documentation"),
"Should have documentation child element.");
}
diff --git a/main/src/addins/Xml/icons/prefs-xml-16.png b/main/src/addins/Xml/icons/prefs-xml-16.png
index fc6082d1cb..658a3e0e60 100644
--- a/main/src/addins/Xml/icons/prefs-xml-16.png
+++ b/main/src/addins/Xml/icons/prefs-xml-16.png
Binary files differ
diff --git a/main/src/addins/Xml/icons/prefs-xml-16@2x.png b/main/src/addins/Xml/icons/prefs-xml-16@2x.png
index 0aef2fef5d..7b4a3e5602 100644
--- a/main/src/addins/Xml/icons/prefs-xml-16@2x.png
+++ b/main/src/addins/Xml/icons/prefs-xml-16@2x.png
Binary files differ
diff --git a/main/src/addins/Xml/icons/prefs-xml-16~dark.png b/main/src/addins/Xml/icons/prefs-xml-16~dark.png
new file mode 100644
index 0000000000..8a8ba1294c
--- /dev/null
+++ b/main/src/addins/Xml/icons/prefs-xml-16~dark.png
Binary files differ
diff --git a/main/src/addins/Xml/icons/prefs-xml-16~dark@2x.png b/main/src/addins/Xml/icons/prefs-xml-16~dark@2x.png
new file mode 100644
index 0000000000..37267d365b
--- /dev/null
+++ b/main/src/addins/Xml/icons/prefs-xml-16~dark@2x.png
Binary files differ
diff --git a/main/src/addins/Xml/icons/prefs-xml-16~dark~sel.png b/main/src/addins/Xml/icons/prefs-xml-16~dark~sel.png
new file mode 100644
index 0000000000..712f58462a
--- /dev/null
+++ b/main/src/addins/Xml/icons/prefs-xml-16~dark~sel.png
Binary files differ
diff --git a/main/src/addins/Xml/icons/prefs-xml-16~dark~sel@2x.png b/main/src/addins/Xml/icons/prefs-xml-16~dark~sel@2x.png
new file mode 100644
index 0000000000..2b56aa7bb5
--- /dev/null
+++ b/main/src/addins/Xml/icons/prefs-xml-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/addins/Xml/icons/prefs-xml-16~sel.png b/main/src/addins/Xml/icons/prefs-xml-16~sel.png
new file mode 100644
index 0000000000..c1fd928313
--- /dev/null
+++ b/main/src/addins/Xml/icons/prefs-xml-16~sel.png
Binary files differ
diff --git a/main/src/addins/Xml/icons/prefs-xml-16~sel@2x.png b/main/src/addins/Xml/icons/prefs-xml-16~sel@2x.png
new file mode 100644
index 0000000000..9b9f7fbae7
--- /dev/null
+++ b/main/src/addins/Xml/icons/prefs-xml-16~sel@2x.png
Binary files differ
diff --git a/main/src/addins/Xml/icons/prefs-xml-schemas-16.png b/main/src/addins/Xml/icons/prefs-xml-schemas-16.png
deleted file mode 100644
index fc6082d1cb..0000000000
--- a/main/src/addins/Xml/icons/prefs-xml-schemas-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/addins/Xml/icons/prefs-xml-schemas-16@2x.png b/main/src/addins/Xml/icons/prefs-xml-schemas-16@2x.png
deleted file mode 100644
index 0aef2fef5d..0000000000
--- a/main/src/addins/Xml/icons/prefs-xml-schemas-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/ChangeLog b/main/src/core/ChangeLog
deleted file mode 100644
index a668270c32..0000000000
--- a/main/src/core/ChangeLog
+++ /dev/null
@@ -1,19 +0,0 @@
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Projects.Formats.MSBuild: Added new assembly
- which allows loading msbuild projects out of process.
-
-2009-06-26 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am: fixed makefile.
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.Texteditor: Added text editor to core.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * Core.mds: Migrated to MSBuild file format.
-
diff --git a/main/src/core/Mono.Texteditor/ChangeLog b/main/src/core/Mono.Texteditor/ChangeLog
deleted file mode 100644
index b89a5635e2..0000000000
--- a/main/src/core/Mono.Texteditor/ChangeLog
+++ /dev/null
@@ -1,7179 +0,0 @@
-2010-07-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs: fix build.
-
-2010-07-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs: Added some delegation
- methods.
-
-2010-07-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Cache line offsets in
- performance critical sections.
-
-2010-07-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Fixed issue with folding
- update.
-
-2010-07-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Cached stack top
- elements.
-
-2010-07-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/GapBuffer.cs:
- * SyntaxModes/DiffSyntaxMode.xml:
- * SyntaxModes/MakefileSyntaxMode.xml:
- * SyntaxModes/ChangeLogSyntaxMode.xml:
- * Mono.TextEditor.Highlighting/Span.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting.Regex/Regex.cs:
- * Mono.TextEditor.Highlighting/JaySyntaxMode.cs: Tried to
- speed up highlighting.
-
-2010-07-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/LineSegment.cs: fixed 'regression Bug 615624
- - Pressing DOWN after RETURN moves cursor to beginning of
- blank lines instead of to the indent'.
-
-2010-07-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Fixed
- highlighting bug.
-
-2010-07-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/LineSegment.cs: fix build.
-
-2010-07-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/LineSegment.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor/FoldingScreenbackgroundRenderer.cs: Tweaked
- text editor performance.
-
-2010-07-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Optimized
- highlighting thread.
-
-2010-07-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/SimpleEditMode.cs:
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs: Added SetCaretTo
- delegation.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs: SelectionRange is now
- always != null.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextEditorData.cs: Added some delegation
- methods to the texteditordata to make its usage easier -
- moved the advanced setcaret (with highlight & pulse) to the
- texteditor.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs:
- comment-in span remove code.
-
-2010-07-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: pop span before
- end tag.
-
-2010-07-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting/JaySyntaxMode.cs:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Worked on
- syntax highlighting.
-
-2010-07-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/Chunk.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Changed
- highlighting.
-
-2010-07-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Check span stack.
-
-2010-07-16 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Styles/TangoLightStyle.xml:
- * Mono.TextEditor/LineSegment.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/ClipboardActions.cs:
- * Mono.TextEditor.Highlighting/Chunk.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting/JaySyntaxMode.cs:
- * Mono.TextEditor.Highlighting/CloneableStack.cs:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Worked on
- highlighting - it's now more speed & memory efficient and
- fixed 'Bug 622108 - Background color issues'.
-
-2010-07-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Added null check.
-
-2010-07-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Highlighting/Style.cs: Fix colours.
-
-2010-07-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Caret.cs:
- * Mono.TextEditor/TextEditorData.cs: Caret now exposes it's
- TextEditorData.
-
-2010-07-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * SyntaxModes/AspNetSyntaxMode.xml:
- * Mono.TextEditor.Highlighting/Style.cs: Added styles for
- templated regions in files, e.g. ASP.NET and T4.
-
-2010-07-13 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor.Highlighting/WorkerThread.cs: Replaced
- custom workerthread with
- system.compontentmodel.backgroundworker.
-
-2010-07-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed 'Bug 621483 - MD
- hangs for a few seconds when searching'.
-
-2010-07-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/FoldSegment.cs: Optimized fold segment
- updating/fixed 'Bug 621484 - Editor repaints multiple times
- after "resolve using"'.
-
-2010-07-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Implemented 'Bug
- 621461 - shift+tab should outdent a code line without
- selecting it' / shift-tab behaves now like in gedit.
-
-2010-07-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fixed build.
-
-2010-07-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Added some gdk window checks.
-
-2010-07-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Fixed indent
- selection.
-
-2010-07-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/Rule.cs: Fixed 'Bug 620977 -
- Special characters in source code crashes MD'.
-
-2010-07-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DeleteActions.cs: Fixed 'Bug 620854 -
- "delete to end of line" messes up edited file'.
-
-2010-07-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextMarker.cs: Changed the isVisible flag
- setting.
-
-2010-07-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextMarker.cs: Text marker now defaults to
- visible.
-
-2010-07-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Theatrics/SmartScrolledWindow.cs: Fixed GTK
- critical when closing a text editor.
-
-2010-07-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Fixed single line
- indent/outdent (Bug 619798 - Outdent a selected line selects
- the next line).
-
-2010-07-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Theatrics/SmartScrolledWindow.cs: Fixed text
- editor splitting.
-
-2010-07-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Caret.cs:
- * Mono.TextEditor/TextEditor.cs: Fixed some issues.
-
-2010-07-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs: Fixed text link
- markers.
-
-2010-06-29 Mike Krüger <mkrueger@novell.com>
-
- * Styles/BrownStyle.xml:
- * Styles/IrBlackStyle.xml:
- * Styles/OblivionStyle.xml:
- * Styles/TangoLightStyle.xml:
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor.Highlighting/Style.cs: Some styling changes
- for the version control gui.
-
-2010-06-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextMarker.cs:
- * Mono.TextEditor/TextViewMargin.cs: Fixed 'Bug 616949 -
- Message bubbles prevents the background color of selected
- text to change'.
-
-2010-06-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Fixed 'Bug 616921 -
- "Move the line or highlighted selection up" command deletes
- selection'.
-
-2010-06-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Check if
- line is valid.
-
-2010-06-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Fixed 'Bug 616128 - Text editor
- hiccoughs every 2 seconds (approx.)'.
-
-2010-06-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Update line after unregistering
- text marker.
-
-2010-06-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Fixed 'Bug 615624 - Pressing
- DOWN after RETURN moves cursor to beginning of blank lines
- instead of to the indent'.
-
-2010-06-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs:
- * Mono.TextEditor/InsertionCursorEditMode.cs: Text link edit
- mode can now show mode help windows as well.
-
-2010-06-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor/DefaultEditActions.cs: Improved virtual
- space return key behavior.
-
-2010-06-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViCommandBuilder.cs: Some simple
- multiplier support.
-
-2010-06-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Fixed 'Bug 615191 -
- When using multiline selection to indent/outdent, the
- indenter selects too much'.
-
-2010-06-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor/ClipboardActions.cs: Fixed 'Bug 615196 -
- Pasting a chunk of text into the virtual whitespace fracks
- everything up'.
-
-2010-06-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed 'Bug 615342 -
- Source code highlighting behaves badly on cyrillic text'.
-
-2010-06-17 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor.PopupWindow/ListWindow.cs:
- * Mono.TextEditor/InsertionCursorEditMode.cs:
- * Mono.TextEditor.PopupWindow/ModeHelpWindow.cs:
- * Mono.TextEditor/FoldingScreenbackgroundRenderer.cs: Added
- help window for insertion mode.
-
-2010-06-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Fixed
- highlighting bug.
-
-2010-06-16 Mike Krüger <mkrueger@novell.com>
-
- * SyntaxModes/JavascriptSyntaxMode.xml: Added mime type for
- java script.
-
-2010-06-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Corrected a
- highlighting bug (visible in the CTAGS section in xml
- highlighting).
-
-2010-06-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViCommandBuilder.cs: Remove debug code,
- tidy.
-
- * Mono.TextEditor.Vi/ViEditorContext.cs: Basic input
- processing.
-
-2010-06-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Use mapped modifier values
- for the IM commit. Modifiers and keys received by editor
- extensions and editor modes are now always post keyboard
- mapping.
-
- * Mono.TextEditor/SimpleEditMode.cs: Moved
- modifier-permits-input check here. Much simpler now that
- modifiers are consumed.
-
-2010-06-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/Platform.cs: Track MapRawKeys from Ide -
- don't restore consumed modifiers, since that breaks vi
- stuff.
-
-2010-06-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViCommandBuilder.cs: Work around a gmcs
- bug.
-
-2010-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViEditorContext.cs:
- * Mono.TextEditor.Vi/ViCommandBuilder.cs: Merged ViEditor and
- ViEditorContext. Added method for building commands.
-
-2010-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViCommandBuilder.cs: Fix build, add more
- actions.
-
-2010-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViKeyNotation.cs: Remove full ctor that
- could create invalid keys.
-
- * Mono.TextEditor.Vi/ViCommandBuilder.cs: Add some more action
- maps.
-
-2010-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj: Added file to project.
-
-2010-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViKeyNotation.cs: Implement equality
- members on ViKey.
-
- * Mono.TextEditor.Vi/ViCommandBuilder.cs: Parse motions,
- multipliers, registers.
-
-2010-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViKeyNotation.cs:
- * Mono.TextEditor.Vi/ViEditorContext.cs:
- * Mono.TextEditor.Vi/ViCommandBuilder.cs: New vi command
- builder architecture (incomplete)
-
-2010-06-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: made some functions
- public.
-
-2010-06-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/GutterMargin.cs: Fixed a bug where the
- gutter margin with isn't calculated correctly.
-
-2010-06-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor.Vi/ViKeyNotation.cs: Really fix the windows
- build.
-
-2010-06-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor.Vi/ViKeyNotation.cs: Fix windows build.
-
-2010-06-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/TextEditorData.cs: Fixed 'Bug 609674 -
- Selection changes on middle-click after selection'.
-
-2010-06-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DeleteActions.cs: Fixed 'Bug 613770 -
- Backspace inconsistently deletes entire lines when using
- "virtual spaces"'.
-
-2010-06-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViKeyNotation.cs: Use explicit
- dictionaries instead of switches, to make code more
- readable.
-
-2010-06-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViKeyNotation.cs: Added vi key notation
- parsing and stringifying.
-
- * Mono.TextEditor.Vi/ViCommandBuilder.cs: Added vi command
- builder stub.
-
- * Makefile.am:
- * Mono.TextEditor.csproj: Added files.
-
-2010-06-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fix super for block
- select.
-
-2010-06-11 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/CaretMoveActions.cs: Fixed 'Bug 612001 -
- "Virtual tab" line spacing is incorrect'.
-
-2010-06-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViActions.cs: Fix some buglets in the
- selection line pivoting.
-
-2010-06-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Fix mouse selection enabling
- visual mode.
-
-2010-06-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViMode.cs:
- * Mono.TextEditor.Vi/ViActions.cs: Fix the visual mode
- selection when pivoting around the anchor char and anchor
- line.
-
-2010-06-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViActions.cs: Fix line end text object.
-
-2010-06-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/Document.cs: Add RemoveMarker overloads
- allowing to skip line updates.
-
-2010-06-10 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor.Vi/ViMark.cs: Fixed 'Bug 613114 - NRE in
- editor means error marker never goes away'.
-
-2010-06-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Fixed 'Bug
- 611947 - XML highlighting broken'.
-
-2010-06-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextEditorAccessibility.cs: Disabled
- accessibility (produces a compile error on linux - on mac it
- works - the Atk.ObjectFactory implementation differs between
- my two systems).
-
-2010-06-04 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextEditorAccessibility.cs: Worked on
- accessibility.
-
-2010-06-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: atk impl. improvements
-
-2010-06-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Added accessibility support.
-
-2010-06-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting/JaySyntaxMode.cs: Fixed syntax
- highlighting bug.
-
-2010-06-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/InsertionCursorEditMode.cs: Don't start
- insertion cursor mode without insertion points.
-
-2010-06-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/SelectionActions.cs: Fixed virtual space
- drawing.
-
-2010-06-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViActions.cs: Fix navigation in visual
- mode.
-
- * Mono.TextEditor/SelectionActions.cs: Fix pivot around origin
- for line selection actions.
-
-2010-06-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/InsertionCursorEditMode.cs: Corrected
- indenting of insertion.
-
-2010-06-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Fix tests.
-
-2010-06-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/InsertionCursorEditMode.cs: Worked on
- insertion cursor mode.
-
-2010-06-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/InsertionCursorEditMode.cs: Worked on
- insertioncursoreditmode.
-
-2010-06-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Reset on external caret change
- if not in insert/replace mode.
-
-2010-05-31 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Better handling of '*'.
-
-2010-05-31 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Improve testability. Fix dd
- and cc behaviour.
-
- * Mono.TextEditor/EditMode.cs: Made RunActions take params,
- not just two.
-
-2010-05-31 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViActionMaps.cs: New EditObject map for
- 'c' to use word start/end instead of word navigation
- boundaries.
-
- * Mono.TextEditor/EmacsWordFindStrategy.cs:
- * Mono.TextEditor.Vi/ViWordFindStrategy.cs:
- * Mono.TextEditor/SharpDevelopWordFindStrategy.cs: Move code
- to abstract base class.
-
- * Mono.TextEditor.Vi/ViActions.cs: Added WordStart and WordEnd
- move actions.
-
- * Mono.TextEditor.Vi/ViMode.cs: Implemented '*'. Also, 'c'
- uses the EditObject map.
-
- * Mono.TextEditor/TextEditorData.cs: Added FindCurrentWordEnd
- and FindCurrentWordStart methods that use the
- IWordFindStrategy.
-
- * Mono.TextEditor/IWordFindStrategy.cs: New abstract base
- class. Added new FindCurrentWordEnd and FindCurrentWordStart
- methods to interface, with default implementation taken from
- TextViewMargin.
-
- * Mono.TextEditor/TextViewMargin.cs: Use the WordFindStrategy
- for word selection.
-
-2010-05-31 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViActions.cs: Fix possible exception.
-
-2010-05-31 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Single-char offset should not
- move caret position.
-
-2010-05-31 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Smart casing for searches. Fix
- 'cw' insertion position.
-
-2010-05-31 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Retreat from line end after x
- and on reset. Don't allow x to delete line delimiters.
-
-2010-05-31 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViActionMaps.cs: Use vi up/down/end
- commands with arrow and end keys too.
-
- * Mono.TextEditor.Vi/ViActions.cs: RetreatFromLineEnd now only
- retreats in caret is in block mode.
-
- * Mono.TextEditor.Vi/ViMode.cs: Retreat after exiting insert
- mode. Retreat from line end after caret placed with mouse.
- Fix 'a' at line end.
-
- * Mono.TextEditor/EditMode.cs:
- * Mono.TextEditor/TextEditor.cs: Added a caret position change
- notification for edit modes.
-
-2010-05-31 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/InsertionCursorEditMode.cs: Worked on
- insertion cursor mode.
-
-2010-05-31 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: added new scroll to overload.
-
-2010-05-31 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Use OnAdded/OnRemoved to
- change caret.
-
- * Mono.TextEditor/TextEditorData.cs: Properly implement the
- mode OnAdded/OnRemoved calls.
-
- * Mono.TextEditor/EditMode.cs: Don't access Editor unless
- necessary. Improves testability. Also properly implement the
- OnAdded/OnRemoved calls
-
-2010-05-30 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/InsertionCursorEditMode.cs: Worked on
- insertion cursor mode.
-
-2010-05-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs: Fixed 'Bug 610099 -
- Typing in lines with bubbles very slow'.
-
-2010-05-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed 'Bug 610050 - Ruler
- position wrong in unselected text'.
-
-2010-05-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Fixed 'Bug 610045 -
- Moving line with url alt-up/down leaves url markers'.
-
-2010-05-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Changed middle click
- paste.
-
-2010-05-28 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Margin.cs:
- * Mono.TextEditor/InsertionCursorEditMode.cs: Worked on
- insertion cursor edit mode.
-
-2010-05-28 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Caret.cs:
- * Mono.TextEditor/TextViewMargin.cs: Fixed 'Bug 609188 -
- Middle-click paste jumps to source location'.
-
-2010-05-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Theatrics/SmartScrolledWindow.cs: Provided
- intptr constructor.
-
-2010-05-27 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor/Margin.cs:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/MarginDrawer.cs:
- * Mono.TextEditor/DashedLineMargin.cs:
- * Mono.TextEditor/InsertionCursorEditMode.cs: Worked on
- insertion cursor edit mode.
-
-2010-05-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Theatrics/SmartScrolledWindow.cs: Destroy
- smart scrolled window children.
-
-2010-05-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Corrected text coordinate
- translation.
-
-2010-05-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/LineSegmentTree.cs: Correctly remove line
- markers when the line gets removed.
-
-2010-05-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/ClipboardActions.cs: fixed 'Bug 609188 -
- Middle-click paste jumps to source location'/improved middle
- click paste behavior.-
-
-2010-05-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs: Fix some
- properties and calculations.
-
-2010-05-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs: Added
- some properties to control behaviour.
-
-2010-05-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs: Fix some
- opacity calculations.
-
-2010-05-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs: New
- class extracted from MessageBubbleHighlightPopupWindow.
- Tooltip containing an image that "bounces" in size then
- fades away.
-
-2010-05-26 Mike Krüger <mkrueger@novell.com>
-
- * Styles/IrBlackStyle.xml: Fixed 'Bug 608974 - [regression]
- IrBlack color scheme badly highlights warnings and errors'.
-
-2010-05-26 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextMarker.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/TextLinkEditMode.cs: text markers can now
- override the selection drawing.
-
-2010-05-25 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/CodeSegmentPreviewWindow.cs: Removed debug
- code.
-
-2010-05-25 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/GutterMargin.cs:
- * Mono.TextEditor/FoldMarkerMargin.cs: Fixed gutter drawing
- bug/made change marker smaller.
-
-2010-05-25 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Ensure that the lineheight is
- up to date in the optionschanged event chain.
-
-2010-05-25 Mike Krüger <mkrueger@novell.com>
-
- * Styles/OblivionStyle.xml:
- * Styles/TangoLightStyle.xml:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/GutterMargin.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/DashedLineMargin.cs:
- * Mono.TextEditor/FoldMarkerMargin.cs:
- * Mono.TextEditor.Highlighting/Style.cs: Worked on text editor
- outfit.
-
-2010-05-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/PangoUtil.cs: Fix calling conventions for
- gtk/pango on Windows.
-
-2010-05-25 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Theatrics/SmartScrolledWindow.cs: Did some
- minor changes at smartscrolledwindow.
-
-2010-05-25 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor.Theatrics/SmartScrolledWindow.cs: Worked on
- scrolled window replacement.
-
-2010-05-25 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DocumentLocation.cs: fixed operator.
-
-2010-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/Platform.cs:
- * Mono.TextEditor/SimpleEditMode.cs:
- * Mono.TextEditor.Vi/ViActionMaps.cs:
- * Mono.TextEditor/TextLinkEditMode.cs: More shift-tab fixage.
-
-2010-05-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Corrected rounding of
- fold rectangles.
-
-2010-05-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed bug in logical line
- number calculation.
-
-2010-05-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed caret placement
- bug.
-
-2010-05-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Took out event handler on
- destroy
-
- * Mono.TextEditor/TextViewMargin.cs: Try to use the weak caret
- pos instead of the strong one.
-
-2010-05-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Speed up the line
- decorators a bit.
-
-2010-05-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Corrected caret drawing
- position.
-
-2010-05-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/Platform.cs: Fix shift-tab brokenness.
-
-2010-05-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: potentially fix search
- maker update.
-
-2010-05-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Corrected pixel rounding.
-
-2010-05-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Draw lines using pango
- coordinates instead of pixels (much better fix for #591459).
-
-2010-05-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs: Correctly adjust end
- offset.
-
-2010-05-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextLinkEditMode.cs: Fixed 'Bug 607154 -
- Negative column on rename refactoring'.
-
-2010-05-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fix typo.
-
- * Mono.TextEditor/Platform.cs: Copy MapRawKeys changes from
- KeyBindingManager.
-
-2010-05-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextMarker.cs:
- * Mono.TextEditor/TextViewMargin.cs: Advanced text markers can
- now provide tooltips.
-
-2010-05-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/HslColor.cs: Now supports cairo color
- conversion.
-
-2010-05-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextMarker.cs:
- * Mono.TextEditor/TextViewMargin.cs: Added basic support for
- extending markers.
-
-2010-05-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.PopupWindow/TooltipWindow.cs: fixed gtk
- criticals.
-
-2010-05-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/CodeSegmentPreviewWindow.cs:
- * Mono.TextEditor.PopupWindow/TooltipWindow.cs: Improved multi
- monitor support.
-
-2010-05-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed 'Bug 604999 -
- Horizontal scrolling during search is annoying'.
-
-2010-05-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed 'Bug 538800 - Tab
- positions are at wrong offsets'.
-
-
-2010-05-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs: Improved type flow on the
- mac: convert non breaking space -> standard space.
-
-2010-05-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Dispose animations & fixing
- 'Bug 606206 - Null ref in highlighting'.
-
-2010-05-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Improve the tooltip handling
- code so that it doesn't create so many glib timeouts.
-
-2010-05-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed 'Bug 604978 - Error
- bubbles prevent mouse clicking to move cursor'.
-
-2010-05-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed 'Bug 605710 - Caret
- not deleted when clicking out of the text area'.
-
-2010-05-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.PopupWindow/ListWidget.cs: Draw on the
- expose event's Window. Also cache Allocation and GCs to
- avoid wasteful transitions and allocations.
-
-2010-05-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextMarker.cs: made the squiggly lines a bit
- smaller / fixed cut&paste error.
-
-2010-05-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextMarker.cs:
- * Mono.TextEditor.Highlighting/SemanticRule.cs: Use pango
- function to draw the squiggly lines - should be faster than
- the custom version.
- (Bug 604983 - Moving the cursor on a line that has red
- squiggles is slooooooow)
-
-2010-05-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed 'Bug 605118 - Caret
- position is incorrect with folded code'.
-
-2010-05-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/IBackgroundRenderer.cs:
- * Mono.TextEditor/FoldingScreenbackgroundRenderer.cs: Fixed
- 'Bug 604980 – Code bubbles are draw incorrectly when there
- is a highlighted region of code'.
-
-2010-05-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/PangoUtil.cs: Added CreateLayout overload
- for PrintContext.
-
-2010-05-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Re-use the scrollwindowtimer
- to avoid creating so many thousands of objects while
- drag-selecting.
-
-2010-05-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor/PangoUtil.cs:
- * Mono.TextEditor/PangoUtils.cs:
- * Mono.TextEditor/TextViewMargin.cs: Much more efficient
- setting of Pango attributes.
-
-2010-05-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/PangoUtils.cs:
- * Mono.TextEditor/IconMargin.cs:
- * Mono.TextEditor/GutterMargin.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/FoldMarkerMargin.cs:
- * Mono.TextEditor.PopupWindow/ListWidget.cs:
- * Mono.TextEditor/CodeSegmentPreviewWindow.cs:
- * Mono.TextEditor.PopupWindow/TooltipWindow.cs: More layout
- leak fixing.
-
-2010-05-11 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Vi/ViMark.cs:
- * Mono.TextEditor.Vi/ViMode.cs:
- * Mono.TextEditor/DefaultEditActions.cs:
- * Mono.TextEditor.Highlighting/Style.cs:
- * Mono.TextEditor.PopupWindow/ListWidget.cs: Fixed some
- compiler warnings.
-
-2010-05-11 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Optimized text editor
- selection drawing a bit.
-
-2010-05-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/GutterMargin.cs:
- * Mono.TextEditor.PopupWindow/TooltipWindow.cs: Fix more
- leaks.
-
-2010-05-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fix crasher introduced by
- disposing attribute too early.
-
-2010-05-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor.dll.config:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/PangoUtils.cs:
- * Mono.TextEditor/TextViewMargin.cs: Work around massive
- memory leak in Gtk.Widget.CreatePangoLayout.
-
-2010-05-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditorOptions.cs: Store the zoom
- internally as a power, so that steps are always consistent.
-
-2010-05-10 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed little search
- highlighting display bug.
-
-2010-05-10 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorOptions.cs: Fixed 'Bug 604052 -
- View->Normal Size sensitivity is inconsistent'.
-
-2010-05-10 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/ITooltipProvider.cs:
- * Mono.TextEditor/TextLinkEditMode.cs: Implemented 'Bug 603988
- - Symbol tooltips do not hide when mouse moves away from
- symbol'.
-
-2010-05-10 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed 'Bug 603982 - Fold
- tooltips flash up briefly on mouseover'.
-
-2010-05-10 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/TextEditorData.cs: Fixed 'Bug 603971 -
- Symbol highlight combined with search highlight looks ugly'.
-
-2010-05-10 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor.Highlighting/Style.cs: Fixed 'Bug 603971 -
- Symbol highlight combined with search highlight looks ugly'.
-
-2010-05-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Tune search result animation.
- Restore double buffering accidentally disabled in earlier
- commit.
-
-2010-05-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Highlighting/DefaultStyle.cs: Tone down the
- current line marker a bit.
-
-2010-05-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Remove the backbuffer hack.
-
-2010-05-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Highlighting/Style.cs: Make the default
- colour definitions a lot easier to read by adding some
- overloads and constants.
-
-2010-05-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Highlighting/ChunkStyle.cs: Added methods
- for creating Gdk GCs.
-
- * Mono.TextEditor/CodeSegmentPreviewWindow.cs: Use GCs with
- the background set when rendering text. Fixes Mac rendering
- issues.
-
-2010-05-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/TextEditorContainer.cs: Fixed mac drawing
- bug & added v/hscroll events in the text editor widget.
-
-2010-05-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/IAnimationDrawer.cs: Speed up the animation
- process.
-
-2010-05-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs: Use CreatePangoLayout
- insead of new PangoLayout (PangoContext).
-
-2010-05-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Disable back buffer hack as
- it's very slow on Mac, which is where we used it.
-
-2010-05-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Added an alternative expose
- buffering system to hack around GTK 2.20 issues on Mac.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextEditorData.cs: Check the IsVisible flag
- for margins.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed 'Bug 603274 - Caret
- is moved to incorrect position when typing'.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/EditMode.cs: Fixed editor bug.
-
-2010-05-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor.csproj: Disable overflow checks.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Removed adjustment update on
- scroll to caret.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed 'Bug 603110 - Margin
- doesn't redraw after damaged'.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed 'Bug 603117 -
- Drag-selection is slow on large file'.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/ISearchEngine.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/TextEditorData.cs: Optimized search
- highlighting updates.
-
-2010-05-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Track GTK mouse modifier
- changes on Mac. Now block selection could be cmd or control,
- depending on GTK version.
-
-2010-05-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fix cmd-scroll zoom on Mac.
- Use more conventional direction for zooming.
-
-2010-05-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Add some (disabled) debug
- code.
-
-2010-05-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Made scrolling faster.
-
-2010-05-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/FoldMarkerMargin.cs: fixed little issue with
- toggle code focus command.
-
-2010-05-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/FoldMarkerMargin.cs:
- * Mono.TextEditor/DocumentUpdateRequest.cs: Fixed 'Bug 602615
- - Editor responds very slowly to quick mousewheel
- scrolling'.
-
-2010-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextEditorContainer.cs: Don't create a text
- editor unless required. Unsubscribe adjustment events when
- the container is destroyed. All this fixes some memory
- leaks.
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.PopupWindow/TooltipWindow.cs: Dispose
- Pango.Layout.
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Dispose pango attributes.
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs: Don't create empty
- gtk.adjustments on every text editor data creation.
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DashedLineMargin.cs: release resources in
- dashed line margin.
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs: Cleanly unregister from
- document & caret on dispose.
-
-2010-04-30 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed 'Bug 601184 -
- Flickering tooltips'.
-
-2010-04-30 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/DefaultEditActions.cs: Fixed 'Bug 601189 –
- Deindent on selection loses last line'.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Fixed 'Bug 600671 - Text
- painting gets into a weird state'.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed 'Bug 600609 - Parameter
- tooltips should hide when scrolling editor'.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed mac caret drawing
- bug.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: fixed 'Bug 599633 -
- Convert to block selection includes unexpected line'.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: fixed block mode update.
-
-2010-04-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Tweak search animation.
- Disable RedrawOnAllocate because we do it anyway.
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Addad Tag property.
-
-2010-04-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed 'Bug 598203 - Tooltip
- shows too fast, follows mouse, and flickers'.
-
-2010-04-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/EditMode.cs:
- * Mono.TextEditor/ClipboardActions.cs:
- * Mono.TextEditor/TextLinkEditMode.cs: Optimized text link
- mode & fixed a mac issue.
-
-2010-04-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/CodeSegmentEditorWindow.cs:
- * Mono.TextEditor/CodeSegmentPreviewWindow.cs: Fixed 'Bug
- 597670 - Focussed fold tooltip has too many lines'.
-
-2010-04-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/CodeSegmentPreviewWindow.cs: Fixed 'Bug
- 597668 - Focus message obscures text in small fold
- tooltips'.
-
-2010-04-21 Mike Krüger <mkrueger@novell.com>
-
- * Styles/OblivionStyle.xml:
- * Styles/TangoLightStyle.xml: Fixed 'Bug 597662 - Symbol
- highlight makes caret hard to see'.
-
-2010-04-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorContainer.cs: Fixed
- 'SetChidrenPositions'
-
-2010-04-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/LineSegment.cs: fixed GetIndentation.
-
-2010-04-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: handled rare x11 exception.
-
-2010-04-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Optimized error bubbles.
-
-2010-04-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs: Handled possible null
- ref.
-
-2010-04-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed 'Bug 596511 - Code
- completion removes block selection and only affects 1 line'
-
-2010-04-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/ClipboardActions.cs: Fixed some block
- selection mode issues.
-
-2010-04-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs: Worked on text link
- mode.
-
-2010-04-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Added GetLineIndent method to
- document.
-
-2010-04-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextEditorContainer.cs: Fixed 'Bug 594836 -
- Performance degradation in the text editor'.
-
-2010-04-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: When losing focus, don't hide
- the tooltip if it is getting the new focus.
-
-2010-04-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/GutterMargin.cs: Fixed 'Bug 571338 -
- multiline selection in monodevelop blows monkeys'.
-
-2010-04-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Added work around for
- 'Bug 591459 - Visual glitches when highlighting text'.
-
-2010-03-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/SimpleEditMode.cs: Fixed shortcut key bug.
-
-2010-03-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Check for invalid column
- positions.
-
-2010-03-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/JaySyntaxMode.cs: Fixed
- ms-build problem 'Bug 589118 – JaySyntaxMode.xml resource
- name problem => initializer exception'
-
-2010-03-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: For block select, use
- Command modifier on Mac and Super modifier on Linux, because
- we can't access the Alt modifier from mouse events on either
- platform.
-
-2010-03-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fixed 'Bug 588454 - Abysmal
- performance of the text editor over VNC'.
-
-2010-03-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Use command-scroll instead of
- control-scroll on Mac, because control-scroll is used by the
- window manager.
-
-2010-03-12 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor/PieceTable.cs: Implemented experimental
- piece table IBuffer implementation.
-
-2010-03-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Removed wait update.
-
-2010-03-11 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextEditor.cs: Fixed some error bubble
- calculating issues.
-
-2010-03-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Fixed failing
- unit tests.
-
-2010-03-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/JaySyntaxMode.cs: Improved jay
- syntax mode.
-
-2010-03-08 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * SyntaxModes/JaySyntaxMode.xml:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting/JaySyntaxMode.cs:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Added jay
- syntax mode (needed 'semantic' highlighting engine for
- this).
-
-2010-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor.csproj: Make it a real 3.5 project.
-
-2010-03-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Added some insanity checks.
-
-2010-03-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/LineSegment.cs: Added bounds check.
-
-2010-03-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs: Fixed 'Bug 584884 - Find
- markers render over line numbers'.
-
-2010-03-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Worked on 'Bug 584479 -
- Exception while undoing'.
-
-2010-03-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: added
- some debug code.
-
-2010-03-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Finishing old parser thread
- before starting a new one.
-
-2010-03-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/GutterMargin.cs: Fixed 'Bug 571337 - if a
- section of code is collapsed in monodevelop, when you select
- and copy, it only gets the top line'.
-
-2010-02-26 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextMarker.cs:
- * Mono.TextEditor.Highlighting/SemanticRule.cs: Re-activated
- url marker.
-
-2010-02-26 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed 'Bug 583459 - When
- the fold marker very wide, preview shows offscrre'.
-
-2010-02-26 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor/CodeSegmentEditorWindow.cs:
- * Mono.TextEditor/CodeSegmentPreviewWindow.cs: Fixed 'Bug
- 583461 - Fold preview scrolling is strange'.
-
-
-2010-02-25 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/ISearchEngine.cs:
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting.Regex/Regex.cs: Fixed text
- editor unit tests.
-
-2010-02-24 Mike Krüger <mkrueger@novell.com>
-
- * Styles/OblivionStyle.xml: changed color style
-
-2010-02-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: fixed hideselection bug.
-
-2010-02-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Highlighting/WorkerThread.cs: Actually write
- exceptions to console.
-
-2010-02-23 Sanjoy Das <sanjoy@playingwithpointers.com>
-
- * MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/IdeViMode.cs:
- * Mono.Texteditor/Mono.TextEditor.Vi/ViMode.cs:
- * Mono.Texteditor/Mono.TextEditor.Vi/ViMacro.cs: Macro support for Vi
- mode.
-
-2010-02-23 Sanjoy Das <sanjoy@playingwithpointers.com>
-
- * Mono.Texteditor/Mono.TextEditor.Vi/ViMode.cs:
- * Mono.Texteditor/Mono.TextEditor.Vi/ViMark.cs: Added support
- for marks in Vi mode.
-
-2010-02-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/Span.cs: made span property
- setter public.
-
-2010-02-23 Mike Krüger <mkrueger@novell.com>
-
- * Styles/OblivionStyle.xml: changed oblivion color.
-
-2010-02-22 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor.Theatrics/AnimatedBox.cs:
- * Mono.TextEditor.Theatrics/AnimatedVBox.cs:
- * Mono.TextEditor.Theatrics/AnimatedWidget.cs: Added animated
- box.
-
-2010-02-22 Mike Krüger <mkrueger@novell.com>
-
- * Styles/OblivionStyle.xml: changed main search result color
- in oblivion.
-
-2010-02-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Added helper function.
-
-2010-02-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Worked on search &
- replace.
-
-2010-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fix caret problem.
-
-2010-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Only request caret blink on
- caret move when the text editor has the focus.
-
-2010-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Styles/TangoLightStyle.xml:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor.Highlighting/Style.cs: Worked on search &
- replace.
-
-2010-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: fixed null ref.
-
-2010-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: fixed possible
- null reference.
-
-2010-02-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Remove debug code.
-
-2010-02-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Enable pixbuf animation
- scaling on Mac since it seem to work now the drawable is a
- pixmap.
-
-2010-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: worked on search result
- animation.
-
-2010-02-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Tweak search result animation
- a bit. Use pixbuf scaling instead of re-rendering text
- larger - avoid jarring from snapping. Disabled on Mac
- because drawable-to-pixmap rendering broken there.
-
-2010-02-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor.csproj: Fix file format issue.
-
-2010-02-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/ClipboardActions.cs: Fixed 'Bug 580395 -
- Exception when deleting several lines in a C# file'.
-
-2010-02-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor/FoldingScreenbackgroundRenderer.cs: Worked
- on new search result animation.
-
-2010-02-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Styles/IrBlackStyle.xml: Added IR Black style from Anirudh
- Sanjeev.
-
-2010-02-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Theatrics/AnimatedWidget.cs: Quick hack to
- make less ugly on Mac, because Mac GTK doesn't yet support
- offscreen drawing.
-
-2010-02-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed search update bug.
-
-2010-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs: Flush.
-
- * SyntaxModes/ILSyntaxMode.xml:
- * SyntaxModes/CPPSyntaxMode.xml:
- * SyntaxModes/LuaSyntaxMode.xml:
- * SyntaxModes/PythonSyntaxMode.xml: Added some missing
- properties.
-
-2010-02-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: made search results
- public.
-
-2010-02-15 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextEditorContainer.cs: Moved text editor
- container to own class.
-
-2010-02-12 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/IAnimation.cs:
- * Mono.TextEditor/IAnimationDrawer.cs:
- * Mono.TextEditor.Theatrics/Animation.cs: now using the
- theatrics framework for animations (text editor now supports
- multiple animations as well).
-
-2010-02-12 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor.Theatrics:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor.Theatrics/Actor.cs:
- * Mono.TextEditor.Theatrics/Stage.cs:
- * Mono.TextEditor.Theatrics/Pulsator.cs:
- * Mono.TextEditor.Theatrics/Choreographer.cs:
- * Mono.TextEditor.Theatrics/AnimatedWidget.cs:
- * Mono.TextEditor.Theatrics/SingleActorStage.cs: Added banshee
- Theatrics framework & text editor can now contain animated
- widgets.
-
-2010-02-10 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: re-implemented int ptr
- constructor
-
-2010-02-10 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fixed
- 'https://bugzilla.novell.com/show_bug.cgi?id=577848'.
-
-2010-02-10 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Now creating an own gdk
- window - no longer using the Gtk.EventBox 'hack'/should fix
- 'Bug 577848 - MissingIntPtrCtorException appears randomly'.
-
-2010-02-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: added intprt constructor.
-
-2010-02-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Added some changes for
- container childs.
-
-2010-02-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: some refactorings.
-
-2010-02-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs: Added OpenStream method.
-
-2010-01-28 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Added hovered line
- events.
-
-2010-01-26 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/ITooltipProvider.cs:
- * Mono.TextEditor/TextLinkEditMode.cs: Some API changes
- required for pin watches.
-
-2010-01-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed extending text line
- markers update bug.
-
-2010-01-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/CodeSegmentPreviewWindow.cs: Hide inform
- string during dnd.
-
-2010-01-19 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor/EditMode.cs:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/SimpleEditMode.cs:
- * Mono.TextEditor/CodeSegmentEditorWindow.cs:
- * Mono.TextEditor/CodeSegmentPreviewWindow.cs: Implemented
- 'Bug 433318 - Allow scrolling the text boxes that appear
- when hovering over a folded region'.
-
-2010-01-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/EditMode.cs:
- * Mono.TextEditor/Selection.cs:
- * Mono.TextEditor/DeleteActions.cs:
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/CodeSegmentPreviewWindow.cs: Implemented
- 'Bug 571367 - Block selection should allow change/replace
- test by'.
-
-2010-01-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorOptions.cs: Fixed mousewheel zoom
- bug.
-
-2010-01-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: added font null check.
-
-2010-01-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Use a
- manualresetevent instead of an active wait.
-
-2010-01-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextEditor.cs: Worked on 'Bug 570164 - Click
- positioning on wrapped message bubble is wrong'.
-
-2010-01-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Added move
- blockup/down actions.
-
-2010-01-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Wait for
- parser service update before document changing.
-
-2010-01-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/EditMode.cs:
- * Mono.TextEditor/Platform.cs:
- * Mono.TextEditor/SimpleEditMode.cs: Kill a few more trivial
- GTK 2.12 FIXMEs.
-
-2010-01-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextMarker.cs:
- * Mono.TextEditor/TextViewMargin.cs: Worked on collapsible
- error bubbles.
-
-2010-01-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: added missing property.
-
-2010-01-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: ruler divider line is now
- drawn in background.
-
-2010-01-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * SyntaxModes/CSyntaxMode.xml:
- * SyntaxModes/CPPSyntaxMode.xml: Use the C++ syntax mode for
- highlighting .h files, since they're often C++. Fixes "Bug
- 468416 - *.h aren't colorized as c++ headers".
-
-2010-01-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fix some GTK 2.12 FIXMEs.
-
-2010-01-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: VRuler now draws
- correctly with multiple line text markers.
-
-2010-01-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: fixed hruler drawing bug.
-
-2010-01-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting.Regex/Regex.cs: fixed 'Bug
- 568483 - IndexOutOfRangeException in CSharpSyntaxMode'.
-
-2010-01-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting.Regex/Regex.cs: fixed 'Bug
- 568483 - IndexOutOfRangeException in CSharpSyntaxMode'.
-
-2010-01-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/LineSplitter.cs: Remove lines with extending
- markers, when the line is removed.
-
-2010-01-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed 'Bug 567317 -
- Underscores not always visible in text editor when usign
- specific fonts, like Courier New'.
-
-2010-01-04 Mike Krüger <mkrueger@novell.com>
-
- * SyntaxModes/CSyntaxMode.xml:
- * SyntaxModes/CPPSyntaxMode.xml: Fixed 'Bug 564387 - #if 0
- grayed out until #endif'.
-
-2010-01-04 Mike Krüger <mkrueger@novell.com>
-
- * SyntaxModes/CSharpSyntaxMode.xml: fixed 'Bug 564378 - Inline
- comments in c# with ///< screw up code coloring'.
-
-2010-01-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: fixed 'Bug 560510 -
- Preprocessor enabled code shows as comment anyway'.
-
-2010-01-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Fixed
- 'Bug 560510 - Preprocessor enabled code shows as comment
- anyway'.
-
-2009-12-12 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Make bracket matching
- more selective for cursor types that enclose a character.
- Fixes #562289.
-
-2009-12-11 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor.Vi/ViMode.cs:
- * Mono.TextEditor.Vi/ViActions.cs:
- * Mono.TextEditor.Vi/ViActionMaps.cs: Make line-end behavior
- more consistent with vim. Fixes #562299.
-
-2009-12-11 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Select the highlighted
- character by default when entering visual mode. Fixes
- #562304.
-
-2009-12-11 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Make inline paste behave more
- like vim. Fixes #562294.
-
-2009-12-08 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Add Ctrl-[ as a workalike for
- Esc, Ctrl-C.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Name
- threads to make debugging easier.
-
-2009-12-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed 'Bug 559805 - X
- selection not set, middle-click paste broken'.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Do a Repaint instead of
- QueueDraw in OptionsChanged. We're no longer always setting
- the style, so the widget doesn't get invalidated
- accidentally any more, so we have to force it to make sure
- it's all updated.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Highlighting/DefaultStyle.cs: Don't attach
- to a widget, because that leaked easily. Instead, override
- the new UpdateFromGtkStyleMethod.
-
- * Mono.TextEditor.Highlighting/Style.cs: New
- UpdateFromGtkStyleMethod from styles that want to derive
- their colours from the current widget's GTK style.
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Only use
- the style, not the whole widget.
-
- * Mono.TextEditor/TextEditorOptions.cs:
- * Mono.TextEditor/ITextEditorOptions.cs: Track API.
-
- * Mono.TextEditor/TextEditor.cs: Track API, and update the
- syntax style when the GTK style changes.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: On an options change event,
- only update the style object if the style ID changed. Fixes
- excessive creation of default style objects that attached
- themselves to the widget's style event and leaked badly.
- There's still a leak when it actually changes, but no longer
- when every/any MD pref changes. Also avoid refreshing all
- the options on a GTK style change; just update the widget
- bg.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditorOptions.cs: Only emit change
- events when values actually change - make change events
- consistent for all properties. Only emit a single change
- event for a CopyFrom instead of once per property.
-
-2009-11-26 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor.PopupWindow/TooltipWindow.cs:
- LogicalToVisualLine now works when logical line is beyond
- the last line/fixed some compiler warnings.
-
-2009-11-25 Mike Krüger <mkrueger@novell.com>
-
- * Styles/TangoLightStyle.xml:
- * Mono.TextEditor/Document.cs: Made error bubbles lighter for
- tango colors.
-
-2009-11-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/BookmarkActions.cs: Applied patch from Tyson
- S. Maxwell <tyson.maxwell@gmail.com> fixing Bug 557637 -
- Bookmarked line 1 is not selected when going to the next
- bookmark.
-
-2009-11-24 Mike Krüger <mkrueger@novell.com>
-
- * Styles/OblivionStyle.xml:
- * Mono.TextEditor/Margin.cs:
- * Styles/TangoLightStyle.xml:
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/IconMargin.cs:
- * Mono.TextEditor/TextMarker.cs:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/GutterMargin.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/FoldMarkerMargin.cs:
- * Mono.TextEditor/DashedLineMargin.cs:
- * Mono.TextEditor.Highlighting/Style.cs: Worked on error
- bubbles.
-
-2009-11-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Highlighting/Style.cs: Added new styles.
-
-2009-11-20 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Support delete key in command
- mode.
-
-2009-11-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/FoldMarkerMargin.cs: Implemented 'Code focus
- toggle and follow-cursor'.
-
-2009-11-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Use system mono.cairo.
-
-2009-11-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/FoldMarkerMargin.cs: Fixed a bug where the
- fold marker margin draws out of bounds.
-
-2009-11-13 Mike Krüger <mkrueger@novell.com>
-
- * SyntaxModes/CSharpSyntaxMode.xml: Added let 'keyword'.
-
-2009-11-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.PopupWindow/TooltipWindow.cs: Track bugfixes
- and changes from MonoDevelop.Components.
-
- * Mono.TextEditor/DashedLineMargin.cs: Tweak some naming.
-
-2009-11-10 Rodrigo B. de Oliveira <rbo@acm.org>
-
- * SyntaxModes/BooSyntaxMode.xml: updated to the latest boo syntax and fixed triple quoted string highlighting.
-
-2009-11-10 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed horziontal scrolling
- bug.
-
-2009-11-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Fixed 'Bug 553089 - Some text
- editor lines are not rendered'.
-
-2009-11-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Handled
- possible null reference exception.
-
-2009-11-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/GapBuffer.cs: Fixed 'Bug 552562 - Crasher in
- auto-save thread'.
-
-2009-11-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed 'Bug 552778 - Redraw
- issues when scrolling with mouse wheel'.
-
-2009-11-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Only render the lines once in
- an update - this should fix many of the slowness complaints.
-
-2009-11-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Handled possible endless loop
- in ScrollToCaret.
-
-2009-11-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/GapBuffer.cs: gap buffer is now threadsafe.
-
-2009-11-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DashedLineMargin.cs: fixed 'Bug 548035 -
- Dashed line down left margin is uneven'.
-
-2009-11-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Disable pulse on
- inserting matching brace.
-
-2009-11-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: fixed 'Bug 551674 -
- Tab key doesn't always create correct number of spaces'.
-
-2009-11-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/DashedLineMargin.cs: Fix "Bug 548035 -
- Dashed line down left margin is uneven" by rendering solid
- background before rendering dashes.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj: Reference Mono.Cairo package.
-
- * gtk-gui/generated.cs: Flush.
-
-2009-10-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs: Fixed 'Bug 550943 -
- Search highlighting can get out of sync'.
-
-2009-10-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/FoldMarkerMargin.cs: Only generate motion
- events, when the mouse is inside the text area (code focus
- did sometimes pop up during text editor open without a mouse
- hover).
-
-2009-10-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed 'Bug 548734 - drag &
- drop code does not in the correct position'.
-
-2009-10-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextEditorOptions.cs:
- * Mono.TextEditor/ITextEditorOptions.cs: Added enable
- animations option.
-
-2009-10-20 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * SyntaxModes/CssSyntaxMode.xml:
- * Mono.TextEditor.Highlighting/Rule.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Fixed 'Bug
- 548235 - Incorrect highlighting of keywords with a hyphen'.
-
-2009-10-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs: When entering a bracket,
- pulse the matching bracket. Based on patch from
- Anirudh Sanjeev <anirudh@anirudhsanjeev.org>.
-
-2009-10-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed possible null
- reference.
-
-2009-10-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: set maximum radius.
-
-2009-10-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/EditMode.cs:
- * Mono.TextEditor/TextEditor.cs: Fixed 'Bug 547092 - Text
- editor hides mouse pointer during keyboard shortcuts'.
-
-2009-10-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/FoldingScreenbackgroundRenderer.cs: Fixed
- 'Bug 547093 - Code focus misaligned with wrapped method
- signature'.
-
-2009-10-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Make the animations a bit
- more noticeable.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: taking care of the
- hadjustment.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs: Added caret pulse
- animation.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: fixed background drawing
- bug in conjunction with the current line marker.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/IAnimation.cs: Added IAnimation interface
- for adding more animation effects.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Added caret line
- highlighting.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/SearchRequest.cs:
- * Mono.TextEditor/TextEditorData.cs: Animate search result is
- now exposed.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/FoldMarkerMargin.cs: Improved code focus -
- see 'Bug 546676 - Usability of code focus'.
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Added
- more descriptive exceptions for loading styles & mode files.
-
-2009-10-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Hide selection drawing
- during code focus.
-
-2009-10-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/FoldingScreenbackgroundRenderer.cs: adjusted
- the colors a bit.
-
-2009-10-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/FoldingScreenbackgroundRenderer.cs: Made the
- fold marker highlighting a bit more obvious.
-
-2009-10-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/Rule.cs: Case insensitive
- languages take fewer memory.
-
-2009-10-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs: Added animation support.
-
-2009-10-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/FoldingScreenbackgroundRenderer.cs: made the
- folding background marker a lot lighter.
-
-2009-10-13 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor/Margin.cs:
- * Mono.TextEditor/HslColor.cs:
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/BookmarkMarker.cs:
- * Mono.TextEditor/FoldMarkerMargin.cs:
- * Mono.TextEditor/IBackgroundRenderer.cs:
- * Mono.TextEditor/FoldingScreenbackgroundRenderer.cs: Worked
- on background renderers
-
-2009-10-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/BookmarkActions.cs:
- * Mono.TextEditor/CaretMoveActions.cs:
- * Mono.TextEditor/SelectionActions.cs:
- * Mono.TextEditor/ITextEditorOptions.cs:
- * Mono.TextEditor/DefaultEditActions.cs: made some action
- classes static.
-
-2009-10-11 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor/Caret.cs:
- * Mono.TextEditor/Margin.cs:
- * Mono.TextEditor/Platform.cs:
- * Mono.TextEditor/EditMode.cs:
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/IconMargin.cs:
- * Mono.TextEditor/RedBlackTree.cs:
- * Mono.TextEditor/DeleteActions.cs:
- * Mono.TextEditor/LineSegmentTree.cs:
- * Mono.TextEditor/FoldMarkerMargin.cs:
- * Mono.TextEditor/DashedLineMargin.cs: Removed some backing
- stores. Dashed line is now an own margin.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs: Secured caret blinking
- thread.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Update bracket
- highlighting on undo/redo.
-
-2009-10-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: removed line update.
-
-2009-10-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed document update
- bug.
-
-2009-10-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Compare real spans for
- the cache - span length is sometimes not enough.
-
-2009-10-06 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor/TextEditor.cs: Expose RedrawMarginLines.
-
-2009-10-06 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor/TextEditor.cs: Expose RedrawMarginLine.
-
-2009-10-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: text editor can now be
- reparented.
-
-2009-10-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed markup syntax mode
- 'link' click.
-
-2009-10-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: added repaint when caret line
- changes.
-
-2009-10-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Render all margings in a
- line.
-
-2009-10-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs: Overworked caret
- blinking/fixed some scrolling redraw issues & optimized
- margin re-drawing.
-
-2009-10-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Only create a bracket
- search thread when there is a bracket to search.
-
-2009-10-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Scrolling redraw is done in
- the scroll event again.
-
-2009-10-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/CodeSegmentPreviewWindow.cs: Fixed code
- segment preview window sizing.
-
-2009-10-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/FoldMarkerMargin.cs: Fixed dashed line
- drawing for the folder marker margin.
-
-2009-10-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Margin.cs:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs: Fixed scrolling update
- bug. TextMargin clip bounds are now set when they change
- instead of every redraw.
-
-2009-10-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: removed some unnecessary
- code.
-
-2009-10-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/GutterMargin.cs: Fixed gutter forced
- repaint.
-
-2009-10-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/EditMode.cs: Commented out some code that
- may've caused too much redraw operations.
-
-2009-10-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/DefaultStyle.cs:
- * Mono.TextEditor.Highlighting/MarkupSyntaxMode.cs: Better
- handling of the last null ref exception.
-
-2009-10-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/MarkupSyntaxMode.cs: Fixed
- possible null reference exception.
-
-2009-10-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: fixed indenting.
-
-2009-10-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/IBracketMatcher.cs: Threaded the highlight
- matching bracket algorithm - can be costly for large files.
-
-2009-10-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed center caret
- hadjustment value.
-
-2009-10-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs: Worked on hscrollbar
- logic
-
-2009-10-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Caret.cs:
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/HelperMethods.cs: Fixed 'Bug 543200 - Files
- with hscrollbar open scrolled one character to the
- right'/optimized file opening.
-
-2009-09-30 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Subscripe to the position
- change event after the first OptionsChanged.
-
-2009-09-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextViewMargin.cs: Optimized folding tree
- memory usage/fixed caret clip rectangle.
-
-2009-09-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/CaretMoveActions.cs: Fixed page up/down
- behavior.
-
-2009-09-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Only allow discrete values
- for HAdjustment/check if hadjustment really changed. (This
- could fix the hscrollbar flashes.)
-
-2009-09-25 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: fixed eol selection end
- offset.
-
-2009-09-25 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Corrected
- whitespacemarker drawing at the edge of selected text.
-
-2009-09-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/CodeSegmentPreviewWindow.cs: Fixed 'Bug
- 541585 - Gtk-criticals in code segment preview window'.
-
-2009-09-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/SimpleEditMode.cs: Fix
- InsertNewLinePreserveCaretPosition bindings on Mac.
-
-2009-09-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed 'Bug 541177 - Bottom of
- text editor not updated'.
-
-2009-09-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Shorten overlong line.
-
-2009-09-23 Mike Krüger <mkrueger@novell.com>
-
- * Styles/TangoLightStyle.xml: switched green/blue color.
-
-2009-09-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Added function to purge
- the layout cache.
-
-2009-09-23 Mike Krüger <mkrueger@novell.com>
-
- * Styles/OblivionStyle.xml:
- * Styles/TangoLightStyle.xml:
- * Styles/VisualStudioStyle.xml:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor.Highlighting/Style.cs: Added new
- highlighting type for semantic highlighting.
-
-2009-09-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Handled possible
- exception.
-
-2009-09-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/SimpleEditMode.cs: Add some emacs shortcuts
- to the Mac for miguel.
-
-2009-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Reduce time for showing the
- tooltip. Closes bug 531209 - Tooltip-delay when inspecting
- variables is too slow.
-
-2009-09-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/FoldActions.cs: Added toggle all folds
- command.
-
-2009-09-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/CodeSegmentPreviewWindow.cs: Reduced the
- maximum size of the code segment preview.
-
-2009-09-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/CodeSegmentPreviewWindow.cs: Code segment
- preview has now a small inner margin.
-
-2009-09-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: tooltip/code preview now hide
- on scrolling events.
-
-2009-09-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/CodeSegmentPreviewWindow.cs: Code segment
- preview is no longer fixed size.
-
-2009-09-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/CodeSegmentPreviewWindow.cs: Made code
- segment preview font smaller.
-
-2009-09-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: dnd is now atomic.
-
-2009-09-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextEditorData.cs: Fixed a dnd bug.
-
-2009-09-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs: Fixed text link update.
-
-2009-09-17 Mike Krüger <mkrueger@novell.com>
-
- * Styles/VisualStudioStyle.xml: this/base is no longer bold in
- vs highlighting.
-
-2009-09-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.csproj: Set the target framework to 3.5
-
-2009-09-17 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor/TextRenderer.cs:
- * Mono.TextEditor/TextViewMargin.cs: Fixed 'Bug 539797 - Text
- editor trying/failing to load strange font'.
-
-2009-09-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs: Fixed some compiler
- warnings.
-
-2009-09-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs: Fixing search request
- search changed registering.
-
-2009-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/ClipboardActions.cs: Worked on formatting.
-
-2009-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs: Corrected text link
- mode bug.
-
-2009-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs: Worked on text link
- mode - it's now possible to update the text while in text
- link mode & fixed some text link bugs.
-
-2009-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Worked on bug 'Bug 538800
- - Tab positions are at wrong offsets.'.
-
-2009-09-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: using the right tab array
- for coordinate translation.
-
-2009-09-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Added some isdispose checks.
-
-2009-09-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/Chunk.cs: Fixed "Bug 538298 -
- Exception thrown".
-
-2009-09-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs: Added method SetSelection
- for offsets.
-
-2009-09-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Caret.cs:
- * Mono.TextEditor/LineSegment.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor/ClipboardActions.cs: Fixed text selection
- ruler background color.
-
-2009-09-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed "Bug 538060 - text
- not visible when "Show column ruler" option enabled".
-
-2009-09-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor/ClipboardActions.cs: fixed 'Bug 538379 -
- Situation where CUT over an "box selection" cause a strange
- final result, see screenshots...'.
-
-2009-09-11 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/ClipboardActions.cs: Fixed "Bug 538197 -
- Paste of box selection copy, doesn't pastes as a box
- content, it pastes as flow content, even being box
- content...".
-
-2009-09-11 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/TextLinkEditMode.cs: Fixed 'Bug 538186 -
- Refactoring operations on document while links are active
- leave strange links'.
-
-2009-09-10 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor/SelectionActions.cs: Fix selection in vi
- mode.
-
-2009-09-10 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs: Fixed "Bug 537939 - Text
- editor doesn't correctly repaint when inline search string
- changes".
-
-2009-09-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed mouse selection
- issue.
-
-2009-09-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed "Bug 537392 - It is
- hard to see the cursor blinking when it is "over a
- breakpoint line", hard to see where it is...".
-
-2009-09-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/TextLinkEditMode.cs: Fixed some minor issues
- in textlink mode.
-
-2009-09-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Selection.cs: Added constructor.
-
-2009-09-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Caret.cs:
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/LineSegment.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor/ClipboardActions.cs: Overworked coordinate
- translation. fixed some bugs with folding coordinate
- translation. Refactored getvisualcolumn helper method.
-
-2009-09-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/ISearchEngine.cs: Support case-insensitive
- search in the regex search.
-
-2009-09-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed memory leak.
-
-2009-09-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs: Fixed possible memory
- issue.
-
-2009-09-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed repaint problem.
-
-2009-09-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Implemented update queue -
- this should solve the speed problems.
-
-2009-09-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextViewMargin.cs: Don't update bracket
- highlighting in atomic undo.
-
-2009-09-03 Christian Hergert <chris@dronelabs.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Make sure that the
- caret is clipped to the visible region of the Gdk.Drawable.
- This fixes a rendering issue on OS X where the cursor could
- be drawn outside of the TextView.
-
-2009-09-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/FoldActions.cs:
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor/FoldMarkerMargin.cs: Fold actions now re
- calculate the vertical scrollbar.
-
-2009-09-03 Christian Hergert <chris@dronelabs.com>
-
- * Mono.TextEditor/TextEditor.cs: Do not write directly to
- the GdkWindow unless it is currently viewable. Fixes
- rendering issue on OS X where pieces of multiple views
- render on top of each other.
-
-2009-09-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/IconMargin.cs:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/GutterMargin.cs: Optimized redrawing.
-
-2009-09-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/GutterMargin.cs: Handled some redraw issues.
-
-2009-09-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Removed unneccessary call.
-
-2009-09-02 Christian Hergert <chris@dronelabs.com>
-
- * Mono.TextEditor/TextEditor.cs: Track required exposure area
- manually so we always expose a large enough area to cover all
- the pending QueueDrawArea()'s before setting repaint == false.
-
-2009-09-02 Christian Hergert <chris@dronelabs.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs: Add IsIdentifier
- property indicating if the TextLink has restricted input.
- Space, Control+Tab and Control+Return can be used when the
- TextLink is not an Identifier.
-
-2009-08-27 Christian Hergert <chris@dronelabs.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Be a bit more resilient to
- erroneous exposure regions.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Vi/ViWordFindStrategy.cs:
- * Mono.TextEditor.PopupWindow/ListWidget.cs: Fixed compiler
- warnings.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor.csproj: Updated dependencies. We now depend
- on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-26 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Little performance fix.
-
-2009-08-26 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextMarker.cs:
- * Mono.TextEditor/GutterMargin.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor/TextLinkEditMode.cs:
- * Mono.TextEditor/DefaultEditActions.cs:
- * Mono.TextEditor.PopupWindow/ListWidget.cs:
- * Mono.TextEditor.Highlighting/SemanticRule.cs: Fixed some
- performance graveyards - complex text editor operations
- should be recognizable faster.
-
-2009-08-26 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/ITextEditorOptions.cs: Made it easier to
- work with the text editor control by allowing that options
- can be set directly. This doesn't affect monodevelop.
-
-2009-08-25 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/CaretMoveActions.cs: Fixed "Bug 513056 -
- Left-arrowing with cursor at end of line sometimes does not
- work for a while".
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Styles/Styles.xsd:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Fixed Bug
- 529544 - Source editor should validate styles when adding
- them & Bug 531014 - Syntax Highlighting: Style sheet file
- has to be called [something]Style.xml.
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs: Worked on "Bug 533332 -
- Caret is cometimes painted in wrong location".
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Caret.cs: fixed "Bug 533295 - Cursor
- incorrectly positioned when moving up/down".
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * SyntaxModes/CSyntaxMode.xml:
- * SyntaxModes/ILSyntaxMode.xml:
- * SyntaxModes/LuaSyntaxMode.xml:
- * SyntaxModes/BooSyntaxMode.xml:
- * SyntaxModes/CPPSyntaxMode.xml:
- * SyntaxModes/RubySyntaxMode.xml:
- * SyntaxModes/JavaSyntaxMode.xml:
- * SyntaxModes/ValaSyntaxMode.xml:
- * SyntaxModes/VBNetSyntaxMode.xml:
- * SyntaxModes/CSharpSyntaxMode.xml:
- * SyntaxModes/PythonSyntaxMode.xml:
- * SyntaxModes/MakefileSyntaxMode.xml:
- * SyntaxModes/JavascriptSyntaxMode.xml:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Fixed "Bug
- 530511 - Syntax highlighting not escaping strings
- correctly".
-
-2009-08-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Corrected clipping.
-
-2009-08-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Revert changes to
- horizontal clipping, as they caused rendering regressions.
- Keep vertical clipping changes.
-
-2009-08-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed clipping for mac
- (vwduder).
-
-2009-08-14 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor.Vi/ViActionMaps.cs:
- * Mono.TextEditor.Vi/ViWordFindStrategy.cs:
- Add vi-like word-breaking for wWbB.
-
-2009-08-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * SyntaxModes/XmlSyntaxMode.xml: Fix BlockCommentEnd value.
-
-2009-08-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Worked on coordinate
- calculation. (Selecting in assembly browser should work now
- and the new translation function works correct with
- kerning).
-
-2009-07-31 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Worked on selection
- drawing/fixed a possible array out of range exception.
-
-2009-07-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Caret.cs:
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextLinkEditMode.cs: Ensure that links in
- text link mode are never inside folded regions.
-
-2009-07-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextLinkEditMode.cs:
- * Mono.TextEditor.PopupWindow/TooltipWindow.cs: Fixed "Bug
- 524871 - Redraw issues in link mode". Fixed some tooltip
- issues.
-
-2009-07-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextMarker.cs:
- * Mono.TextEditor/TextLinkEditMode.cs: Fixed "Bug 524870 - F2
- rename can be activated multiple times".
-
- * Mono.TextEditor/Document.cs: Fixed that StackUndoToDepth
- creates an empty undo opertion (could dirty a document under
- some circumstances).
-
-2009-07-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Use a method of creating a
- pixmap for the invisible cursor that doesn't cause a
- Gdk-Critical on Mac.
-
-2009-07-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs: Fixed "Bug 524313 -
- Wrong caret position when exiting local rename link mode".
-
-2009-07-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs: Added some null checks.
-
-2009-07-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextLinkEditMode.cs: Text link edits are now
- atomic.
-
-2009-07-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs: Fixed "Bug 523905 -
- Inline variable rename unnecessarily dirties document".
-
-2009-07-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj: Remove unused ref.
-
-2009-07-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/ISearchEngine.cs: Fixed search & replace bug
- that could occur when caret is positinoed in or right after
- the matched pattern and there is only one match.
-
-2009-07-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed caret center method.
-
-2009-07-16 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj: Added removed gtk-dotnet reference.
-
-2009-07-16 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor.Highlighting/Rule.cs: Added ruby syntax
- highlighting from
-
- * SyntaxModes/RubySyntaxMode.xml: Added ruby syntax
- highlighting from Levi Bard
- <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
-2009-07-15 Mike Krüger <mkrueger@novell.com>
-
- * SyntaxModes/CSharpSyntaxMode.xml: Applied "[PATCH] New
- keywords for C#3: var, select, etc (including all LINQ
- keywords)".
-
-2009-07-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/Span.cs:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: changed
- some setters to protected.
-
-2009-07-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs: It's no longer needed
- to provide a list provider for text link edit mode.
-
-2009-07-11 Matt Enright <awickedshimmy@gmail.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Reset insertion cursor.
-
-2009-07-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/ClipboardActions.cs: Removed debug message.
-
-2009-07-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Remove unused dep.
-
-2009-07-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting.Regex/Regex.cs: Regex pattern
- is now accessible.
-
- * Mono.TextEditor/FoldActions.cs: Added patch "Bug 517487 -
- [PATCH] Can't unfold in vi mode.".
-
-2009-06-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/FoldActions.cs: Fixed "Bug 515825 - Toggle
- fold does not work if cursor sent to the end of folded
- line".
-
-2009-06-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Moved paste text event after
- the selection/caret is set.
-
-2009-06-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: dnd now fires a paste text
- event.
-
-2009-06-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor/ClipboardActions.cs:
- * Mono.TextEditor.Highlighting/SemanticRule.cs: Worked on code
- formatting.
-
-2009-06-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextRenderer.cs: Comment out unused
- renderers.
-
-2009-06-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs: Fixed "Bug 514278 –
- Matched word highlight not removed when closing search bar".
-
-2009-06-19 Mike Krüger <mkrueger@novell.com>
-
- * AssemblyInfo.cs: Commented out empty assembly key file
- attribute (Bug 513981 - Project template causes CS1726
- errors).
-
-2009-06-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/LineSplitter.cs: Fixed possible null
- reference.
-
-2009-06-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed unlikely (but
- possible) null reference.
-
-2009-06-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor.Highlighting/Chunk.cs:
- * Mono.TextEditor.Highlighting/MarkupSyntaxMode.cs: Fixed "Bug
- 513772 - Assembly browser not working in current SVN
- version?".
-
-2009-06-16 Mike Krüger <mkrueger@novell.com>
-
- * SyntaxModes/CPPSyntaxMode.xml:
- * Mono.TextEditor/TextViewMargin.cs: Fixed c++ highlighting.
-
-2009-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextRenderer.cs: Don't use Cairo text
- renderer on Mac. It crashes a lot.
-
-2009-06-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextMarker.cs:
- * Mono.TextEditor/LineSegment.cs:
- * Mono.TextEditor/GutterMargin.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/TextLinkEditMode.cs:
- * Mono.TextEditor.Highlighting/Rule.cs:
- * Mono.TextEditor.Highlighting/Match.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting/SemanticRule.cs: Overworked
- rendering backend.
-
-2009-06-10 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor.Vi/ViMode.cs:
- * Mono.TextEditor.Vi/ViActions.cs:
- * Mono.TextEditor.Vi/ViActionMaps.cs:
- Make left/right keybindings more consistent with vim.
-
-2009-06-10 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor/Caret.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor.Vi/ViMode.cs:
- Vi-style visual cursor.
-
-2009-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor.csproj: Fix gtk-dotnet reference.
-
-2009-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor.csproj: Fixed gtk# reference.
-
-2009-06-08 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor/FoldActions.cs:
- * Mono.TextEditor.Vi/ViMode.cs:
- Vi-style folding.
-
-2009-06-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/CaretMoveActions.cs: Fixed "Bug 510224 -
- Moving cursor past folded code with arrow keys sometimes
- unfolds code and sometimes doesn't".
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs:
-
-2009-06-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/GapBuffer.cs: Fixed "Bug 510316 – Pasting in
- a lot of text at the end of a file causes crash or unhandled
- exception".
-
-2009-06-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/Rule.cs: Removed debug message.
-
-2009-06-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
-
-2009-06-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/Rule.cs: Fixed possible crash
- for files with wrong encodings.
-
-2009-06-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/IBracketMatcher.cs: Fixed "Bug 509350 -
- Issuing multiple "Join Lines" sometimes causes MD to hang".
-
-2009-06-03 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * SyntaxModes/CSyntaxMode.xml:
- * Mono.TextEditor/Document.cs:
- * SyntaxModes/XmlSyntaxMode.xml:
- * SyntaxModes/JavaSyntaxMode.xml:
- * SyntaxModes/ValaSyntaxMode.xml:
- * SyntaxModes/VBNetSyntaxMode.xml:
- * SyntaxModes/CSharpSyntaxMode.xml:
- * Mono.TextEditor/IBracketMatcher.cs:
- * Mono.TextEditor.Highlighting/Rule.cs: Overworked the bracket
- matcher. It's now more general & syntax modes now contain
- some more meta data about the language.
-
-2009-06-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Fixed "Bug 509022 -
- Brace-matching gets confused by quote characters within
- comments".
-
-2009-06-02 Mike Krüger <mkrueger@novell.com>
-
- * SyntaxModes/ActionScriptSyntaxMode.xml: Applied patch from
- Federico Di Gregorio <fog@initd.org> ("Bug 507379 -
- ActionScript 3.0 syntax highlight")
-
-2009-06-01 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor/TextEditor.cs: Changes to support annotation
- view in VersionControl addin.
-
-2009-05-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor.csproj: Don't define debug for now. It is
- causing some issues on windows.
-
-2009-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Properly initialize the
- renderer when drawing the overwrite cursor. Fixes bug
- #507738.
-
-2009-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/Platform.cs: Avoid throwing some exceptions
- using preventive checks. Patch by Carlo Kok.
-
-2009-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor\TextViewMargin.cs: More chunk merging fixes.
-
-2009-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor\TextEditor.cs: Fix nullref.
-
- * Mono.TextEditor\TextViewMargin.cs: Properly compare chunk
- styles when trying to merge.
-
-2009-05-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor\TextRenderer.cs: Use the pango renderer on
- windows, the gdi renderer still has some issues.
-
- * Mono.TextEditor\Margin.cs: Added BeginRender/EndRender,
- which are called just before and after renering the lines of
- text. It can be used to initialize/finalize drawing
- resources.
-
- * Mono.TextEditor\FoldMarkerMargin.cs: Use DrawLine instead of
- DrawPoint to draw the separator line.
-
- * Mono.TextEditor\TextEditor.cs: Call the new
- Margin.BeginRender/EndRender methods. Optimized rendering a
- bit.
-
- * Mono.TextEditor\TextViewMargin.cs: Some optimizations. Avoid
- setting the clip area to gcs if it already was set. Don't
- special case rendering of whitespace if the 'draw space
- marker' option is not set. Don't draw the background for
- each text chunk. Instead, draw the default background for
- the whole line at the beginig, and then only draw the
- background if it is different from the default.
-
- * Mono.TextEditor\Platform.cs: Fix windows check.
-
-2009-05-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Merge consecutive chunks
- that have the the same style, so the text for all those
- chunks can be measured and rendered together.
-
-2009-05-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor/TextRenderer.cs:
- * Mono.TextEditor/TextViewMargin.cs: Abstracted the code that
- renders text into a new TextRenderer class. Created
- subclasses for Pango, Cairo and Gdi+.
-
-2009-05-14 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor/TextEditorData.cs: Fix upward highlighting
- in vi mode.
-
-2009-05-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting/SemanticRule.cs: URL semantic
- rules now work again.
-
-2009-05-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextEditorData.cs: Fixed "Bug 503696 -
- Clicking on hyperlink in Assembly Browser led to
- NulReferenceException and crash".
-
-2009-05-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Worked on
- semantic highlighting.
-
-2009-05-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor.Highlighting/Span.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Worked on
- semantic highlighting.
-
-2009-05-11 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs: Fixed "Bug 501995 - Find
- and Replace skips first occurrence if 'Find Next' pressed".
-
-2009-05-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/Rule.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting/MarkupSyntaxMode.cs:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Worked on
- highlighting engine to better support customized
- highlighting.
-
-2009-05-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/SimpleEditMode.cs: Add subword actions for
- Linux/Windows as well as Mac.
-
-2009-05-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/EditMode.cs:
- * Mono.TextEditor/Platform.cs: Fixed build with GTK# 2.8.
-
-2009-04-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/EmacsWordFindStrategy.cs: Fix subword
- behaviour on digits boundaries. Tidy using type alias.
-
-2009-04-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/SharpDevelopWordFindStrategy.cs: Make a
- method private.
-
- * Mono.TextEditor/EmacsWordFindStrategy.cs: Implement subword
- splitting (camelCase/PascalCase).
-
-2009-04-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/SharpDevelopWordFindStrategy.cs: Implement
- subword (camelCase/PascalCase) word splitting.
-
- * Mono.TextEditor/EmacsWordFindStrategy.cs: Track API.
-
-2009-04-30 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor/DefaultEditActions.cs: Improved removing
- trailing whitespace feature.
-
-2009-04-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/CaretMoveActions.cs: Fix Mac Bug 497904 -
- Cursor position incorrect when moving cursor after
- selection. Also a minor non-Mac fix for up/down on
- first/last lines.
-
-2009-04-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/SimpleEditMode.cs: Restore select up/down
- for Mac.
-
-2009-04-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/DeleteActions.cs:
- * Mono.TextEditor/SimpleEditMode.cs:
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor/CaretMoveActions.cs:
- * Mono.TextEditor/SelectionActions.cs:
- * Mono.TextEditor/IWordFindStrategy.cs:
- * Mono.TextEditor/EmacsWordFindStrategy.cs:
- * Mono.TextEditor/SharpDevelopWordFindStrategy.cs: Add subword
- move/select commands.
-
-2009-04-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj: Updated.
-
- * Mono.TextEditor/TextEditor.cs: Use raw keymapping code from
- keybinding service so we can extract Meta and Alt modifiers
- when on Mac. More comprehensive handling of the modifiers
- that reach the EditMode and that prevent the key being
- treated as character input.
-
- * Mono.TextEditor/SimpleEditMode.cs: Add Mac command bindings,
- used when on Mac.
-
- * Mono.TextEditor/SelectionActions.cs: Add MoveDownLineEnd and
- MoveUpLineStart actions for Mac.
-
- * Mono.TextEditor/Platform.cs: Added platform detection code.
-
- * Mono.TextEditor/EditMode.cs: Better keycode handling. Allows
- binding other modifiers than Shift and Control.
-
- * Mono.TextEditor/CaretMoveActions.cs: Add DownLineEnd and
- UpLineStart actions for Mac. Made Left/Right behave
- correctly on Mac when there's a selection.
-
-2009-04-29 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Highlight matches for
- vi mode searches.
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs: Fixed an issue I had
- while enabled compositing in metacity.
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Remove scroll timer on
- dispose.
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed "Bug 497566 -
- Mouse-based word selection is a bit weird".
-
-2009-04-28 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/LineSplitter.cs: Return no longer removes
- bookmarks from lines.
-
-2009-04-28 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Fixed update issues
- with indent selection commands.
-
-2009-04-28 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Fixed "Bug
- 498581 - Syntax highlighting engine crashes MD".
-
-2009-04-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor.csproj: Fix build.
-
-2009-04-27 Mike Krüger <mkrueger@novell.com>
-
- * SyntaxModes/ILSyntaxMode.xml:
- * Mono.TextEditor.Highlighting/Rule.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Delimiters are
- now configurable in the syntax mode (IL syntax mode made
- this required).
-
-2009-04-27 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am: Reverted makefile.
-
-2009-04-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: reverted to old
- delimeters.
-
- * Makefile.am:
-
-2009-04-27 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * SyntaxModes/ILSyntaxMode.xml:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Added IL syntax
- mode.
-
-2009-04-25 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * SyntaxModes/LuaSyntaxMode.xml: Added lua syntax mode.
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextEditor.cs: Fixed "Bug 497118 - Code
- folding makes debugging annoying".
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/ClipboardActions.cs: Fixed some minor text
- editor issues.
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Improved search pattern
- update.
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/SelectionActions.cs: Select All now works
- correct.
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs: Fixed selected lines
- property. Several IDE commands used that (ex.
- comment/uncomment). They should now work correctly again.
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/SearchRequest.cs: Only fire change event
- when the value actually changed.
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs: Fixed bug in code
- templates.
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/ISearchEngine.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/TextEditorData.cs: Fixed "Bug 495626 - Regex
- searches are slow, and CPU usage is high while results are
- highlighted".
-
-2009-04-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Implement actions for
- scrolling PageDown and PageUp.
-
-2009-04-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Fixed bug in
- markup highlighter.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * Mono.TextEditor.csproj: don't require specific
- gtk-sharp version.
-
-2009-04-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/objects.xml: Unused, remove.
-
-2009-04-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.csproj: Revert the (presumably accidental)
- 2008->2005 format change, since it broke MSBuild
- compatibility.
-
-2009-04-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Caret.cs: Fixed bug in caret movement.
-
-2009-04-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Caret.cs: Respect caret behind eol setting
- in SetColumn method.
-
-2009-04-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/ClipboardActions.cs: Handled possible
- cut&paste exceptions.
-
-2009-04-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: fixed "Bug
- 495263 - when trying to edit an 'unrecognized' xml file, an
- exception occurs (and sometimes crashes MD) when I try to
- edit.".
-
-2009-04-16 Mike Krüger <mkrueger@novell.com>
-
- * ChangeLog:
- * Mono.TextEditor.Vi/ViMode.cs:
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor/SelectionActions.cs: Added vi mode patch
- from levi bard.
-
-2009-04-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Don't interpret keystrokes as
- text input when alt, meta or super modifiers are active.
-
-2009-04-15 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor.Vi/ViMode.cs:
- * Mono.TextEditor/SelectionActions.cs:
- * Mono.TextEditor/TextEditorData.cs: Fix line-visual vi mode.
-
-2009-04-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Vi/ViMode.cs:
- * Mono.TextEditor/ClipboardActions.cs: Fixed some issues in
- vim mode.
-
-2009-04-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/Rule.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Fixed text
- editor issues.
-
-2009-04-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Selection.cs:
- * Mono.TextEditor.Vi/ViMode.cs:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/LineSegment.cs:
- * Mono.TextEditor/GutterMargin.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor/ClipboardActions.cs:
- * Mono.TextEditor/TextLinkEditMode.cs:
- * Mono.TextEditor/SelectionActions.cs:
- * Mono.TextEditor/DefaultEditActions.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Worked on the
- text editor. Added block selection mode & fixed some bugs.
-
- * Makefile.am:
- * gtk-gui/objects.xml:
- * Mono.TextEditor.csproj:
-
-2009-04-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: removed debug
- message.
-
-2009-04-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/Rule.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: fixed 'Bug
- 494534 - ignorecase="true" attribute isn't working on xml
- "Syntax Mode" files.'.
-
-2009-04-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: fixed little
- issue with regex match highlighting.
-
-2009-04-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/Rule.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting.Regex/Regex.cs:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs:
- Optimized/Refactored the highlighting engine. (Bug 387486 -
- Syntax scheme improvements).
-
-2009-04-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Caret.cs: Virtual spaces now works with
- up/down keys.
-
-2009-04-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Changed the virtual space
- click behavior.
-
-2009-04-08 Mike Krüger <mkrueger@novell.com>
-
- * SyntaxModes/XmlSyntaxMode.xml:
- * Mono.TextEditor.Highlighting.Regex:
- * Mono.TextEditor/ClipboardActions.cs:
- * Mono.TextEditor.Highlighting/Span.cs:
- * Mono.TextEditor.Highlighting/Rule.cs:
- * Mono.TextEditor.Highlighting/Match.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting.Regex/Regex.cs:
- * Mono.TextEditor.Highlighting.Regex/RegexMatch.cs:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs:
- Overworked the syntax highlighting & implemented "Bug 480133
- - XML highlighting doesn't deal well with incomplete tags".
-
- * Makefile.am:
- * gtk-gui/objects.xml:
- * Mono.TextEditor.csproj:
-
-2009-04-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: activated virtual leading
- whitespace click.
-
-2009-04-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs: Added some virtual
- leading whitespace fixes.
-
-2009-04-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs: Added some fixes for
- virtual leading whitespace feature.
-
-2009-04-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs: Fixed some drawing
- issues in text link mode (templates).
-
-2009-04-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs: fixed possible out of
- range exception.
-
-2009-04-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs: Fixed possible null
- ref.
-
-2009-04-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/SimpleEditMode.cs:
- * Mono.TextEditor/DefaultEditActions.cs: Added
- ctrl+return/shift+return commands.
-
-2009-04-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Fixed
- small issue in last bugfix.
-
-2009-04-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Caret.cs:
- * SyntaxModes/CSyntaxMode.xml:
- * Mono.TextEditor/EditMode.cs:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextLinkEditMode.cs:
- * Mono.TextEditor.Highlighting/Span.cs:
- * Mono.TextEditor.Highlighting/Rule.cs:
- * Mono.TextEditor.Highlighting/Style.cs:
- * Mono.TextEditor.Highlighting/Match.cs:
- * Mono.TextEditor.Highlighting/Marker.cs:
- * Mono.TextEditor.Highlighting/Keywords.cs:
- * Mono.TextEditor.PopupWindow/ListWidget.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: fixed
- "Bug 491089 - Oblivion syntax highlight error". Cleaned up
- some code.
-
-2009-04-02 Mike Krüger <mkrueger@novell.com>
-
- * SyntaxModes/VBNetSyntaxMode.xml:
- * Mono.TextEditor.Highlighting/Rule.cs:
- * Mono.TextEditor.Highlighting/Keywords.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: The ignorecase
- attribute can now be specified on any level
- (SyntaxMode/Rule/Keywords). (impl. request Bug 491356 -
- TextEditor should recognize non-sensitive highlighting
- mode.)
-
-2009-03-30 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Handeled invalid folding
- marker.
-
-2009-03-30 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed 'Bug 489850 - Implement
- mouse-cursor hide on typing'.
-
-2009-03-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: fixed "Bug 489000 -
- Cursor blinks when another window has focus".
-
-2009-03-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed "Bug 487736 - Clipboard
- ring and code snippets not shown anymore in the toolbox".
-
-2009-03-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/ClipboardActions.cs: Fixed "Bug 487422 -
- Ctrl+C/V/X should copy/paste/cut the whole line if no
- selection is made like in VS".
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs: Handled possible
- exception.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextLinkEditMode.cs:
- * Mono.TextEditor.PopupWindow/ListWindow.cs:
- * Mono.TextEditor.PopupWindow/ListWidget.cs:
- * Mono.TextEditor.PopupWindow/TooltipWindow.cs:
- * Mono.TextEditor.PopupWindow/IListDataProvider.cs: Cleaned up
- some source.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
-
- * Mono.TextEditor/TextLinkEditMode.cs:
- * Mono.TextEditor.PopupWindow/ListWindow.cs:
- * Mono.TextEditor.PopupWindow/ListWidget.cs:
- * Mono.TextEditor.PopupWindow/IListDataProvider.cs: Fixed
- headers.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs:
- * Mono.TextEditor.PopupWindow/ListWindow.cs:
- * Mono.TextEditor.PopupWindow/IListDataProvider.cs: Used
- template data provider.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
-
- * Mono.TextEditor/TextLinkEditMode.cs:
- * Mono.TextEditor.PopupWindow/ListWindow.cs:
- * Mono.TextEditor.PopupWindow/IListDataProvider.cs: Changed
- list provider interface.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * Styles/BrownStyle.xml:
- * Styles/OblivionStyle.xml:
- * Styles/TangoLightStyle.xml: Updated template colors (but I'm
- up for color suggestions).
-
- * Mono.TextEditor/TextLinkEditMode.cs: Fixed some minor issues
- in text link mode.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs:
- * Mono.TextEditor.PopupWindow/ListWindow.cs: Added icons to
- the template completion list.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs: Worked on templates.
-
-2009-03-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs: Worked on template
- callbacks.
-
-2009-03-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs: Worked on multi item
- callback.
-
-2009-03-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs:
- * Mono.TextEditor.PopupWindow/ListWindow.cs: Worked on text
- link mode.
-
-2009-03-21 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Styles/C64Style.xml:
- * Styles/BrownStyle.xml:
- * Mono.TextEditor.csproj:
- * Styles/OblivionStyle.xml:
- * Mono.TextEditor/Caret.cs:
- * Mono.TextEditor/Margin.cs:
- * Styles/TangoLightStyle.xml:
- * Styles/VisualStudioStyle.xml:
- * Mono.TextEditor/TextMarker.cs:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/TextLinkEditMode.cs:
- * Mono.TextEditor.Highlighting/Style.cs:
- * Mono.TextEditor.PopupWindow/ListWindow.cs: Worked on text
- link editor mode.
-
-2009-03-21 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/objects.xml:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor.PopupWindow:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextLinkEditMode.cs:
- * Mono.TextEditor.PopupWindow/TooltipWindow.cs: Text links now
- show tooltips. Set the tooltip popup hotkey to Ctrl+F1.
-
-2009-03-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextLinkEditMode.cs: Implemented function
- callbacks.
-
-2009-03-20 Mike Krüger <mkrueger@novell.com>
-
- * Styles/C64Style.xml:
- * Styles/BrownStyle.xml:
- * Styles/OblivionStyle.xml:
- * Styles/TangoLightStyle.xml:
- * Styles/VisualStudioStyle.xml:
- * Mono.TextEditor/TextMarker.cs:
- * Mono.TextEditor/LineSegment.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/TextLinkEditMode.cs:
- * Mono.TextEditor.Highlighting/Style.cs: Worked on text link
- edit mode.
-
-2009-03-13 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Clear selection when pasting.
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: ComitUpdateAll after text set.
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: fire commit update on text
- replace.
-
-2009-03-11 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Fix visual mode anchoring,
- return to normal mode when entire command buffer deleted.
-
-2009-03-11 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SemanticRule.cs: applied '
- [PATCH] Collapsed comment areas cause editor to throw
- unhandled exception'.
-
-2009-03-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Highlighting/IXmlProvider.cs:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Fix
- resource disposal issues that prevented addins adding syntax
- modes and colour schemes, and probably caused resource
- stream leaks.
-
-2009-03-08 Mike Krüger <mkrueger@novell.com>
-
- * Styles/OblivionStyle.xml: fixed "Bug 482804 - Highlight
- current line doesnt work in Oblivion theme".
-
-2009-03-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed "Bug 476015 -
- general crash _wapi_handle_unref: Attempting to unref unused
- handle 0x496".
-
-2009-03-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Removed debug messages.
-
-2009-03-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fixed "Bug 482120 - Selection
- isn't repainted correctly when it's reduced
- programmatically".
-
-2009-03-04 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * SyntaxModes/CSharpSyntaxMode.xml:
- * SyntaxModes/MakefileSyntaxMode.xml: Added makefile syntax
- mode.
-
-2009-03-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/GapBuffer.cs: Corrected insignificant
- algortihm glitch in gap buffer.
-
-2009-03-04 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am: fixed makefile.
-
-2009-03-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fixed "Bug 480308 - Editor
- not scrolling horizontally".
-
-2009-03-03 Mike Krüger <mkrueger@novell.com>
-
- * Styles/TangoLightStyle.xml: Changed diff header style for
- tango light.
-
-2009-03-03 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Styles/OblivionStyle.xml:
- * Styles/TangoLightStyle.xml:
- * SyntaxModes/DiffSyntaxMode.xml:
- * Mono.TextEditor.Highlighting/Span.cs:
- * Mono.TextEditor.Highlighting/Style.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Added diff file
- syntax mode.
-
-2009-03-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Worked on horizontal
- scrolling behavior.
-
-2009-03-02 Mike Krüger <mkrueger@novell.com>
-
- * Styles/OblivionStyle.xml: fixed "Bug 480800 - please
- highlight //TODO items as gedit does in oblivion style"
-
-2009-02-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * SyntaxModes/ValaSyntaxMode.xml:
- * SyntaxModes/PythonSyntaxMode.xml:
- * Mono.TextEditor.Highlighting/Span.cs: Remove unused
- constraint attribute.
-
- * SyntaxModes/AspNetSyntaxMode.xml: Better highlighting for
- comments and cdata.
-
- * SyntaxModes/XmlSyntaxMode.xml: Better highlighting for
- cdata.
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor.csproj: Flush.
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * Styles/C64Style.xml: Fixed description.
-
-2009-02-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Optimized pango
- output a bit.
-
-2009-02-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/Match.cs: fixed C# number
- matching.
-
-2009-02-24 Mike Krüger <mkrueger@novell.com>
-
- * SyntaxModes/CSharpSyntaxMode.xml: Added highlighting for
- undocumented keywords.
-
-2009-02-22 Mike Krüger <mkrueger@novell.com>
-
- * SyntaxModes/CSyntaxMode.xml:
- * SyntaxModes/BooSyntaxMode.xml:
- * SyntaxModes/JavaSyntaxMode.xml:
- * SyntaxModes/ValaSyntaxMode.xml:
- * SyntaxModes/VBNetSyntaxMode.xml:
- * SyntaxModes/PythonSyntaxMode.xml:
- * SyntaxModes/CSharpSyntaxMode.xml:
- * SyntaxModes/JavascriptSyntaxMode.xml: Corrected escape
- strings.
-
-2009-02-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: fixed
- "Bug 478459 - Syntax highlighting broken with tripple-quote
- literal strings".
-
-2009-02-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fix crash on documents with
- only one line. Also fix scrollable width when the last line
- is the longest line, e.g. when there is only one line.
-
-2009-02-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/ITooltipProvider.cs: Tooltip proviters now
- get informed about the modifier state.
-
-2009-02-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/LinkEventArgs.cs:
- * Mono.TextEditor/TextViewMargin.cs: Link events are now
- informed about the button and modifier state.
-
-2009-02-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fixed hruler width.
-
-2009-02-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: removed debug message.
-
-2009-02-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fixed horizontal adjustment
- behavior.
-
-2009-02-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed a bug where clip
- rectangles are not set on first draw (text may have been
- drawn over the line number margin at first draw for
- example).
-
-2009-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: removed gtk keyboard snooper.
-
-2009-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Used MergeUndoOperations for
- drag&drop move operation.
-
- * Mono.TextEditor/Document.cs: Added MergeUndoOperations for
- another way to merge undo operations.
-
-2009-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Only handle the control keys
- in the snooper func.
-
-2009-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fixed key snooper id.
-
-2009-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs: fixed "Bug 445395 -
- drag/drop text in editor".
-
-2009-02-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.csproj: Flush.
-
- * Mono.TextEditor/TextEditor.cs: Include the key & state in
- OnIMProcessedKeyPressEvent calls if possible, i.e. if the
- char matches the unprocessed one, since the IMMultiContext
- captures a lot of the character keystrokes.
-
-2009-02-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/EditMode.cs:
- * Mono.TextEditor/TextEditor.cs: Handle UTF32 code points from
- IMContext. Don't pass most recent keypress through with
- IMContext multi-press commits, so that it doesn't append the
- space/enter that was used to terminate the multi-press
- input.
-
-2009-02-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: enabled the preview editor
- string.
-
-2009-02-17 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/SimpleEditMode.cs:
- * Mono.TextEditor/DefaultEditActions.cs:
- * Mono.TextEditor/UnicodePreviewEditMode.cs: Made the preview
- string more general (input method now handles it).
-
-2009-02-17 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.csproj:
- * Mono.TextEditor/EditMode.cs:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/SimpleEditMode.cs:
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor/DefaultEditActions.cs:
- * Mono.TextEditor/UnicodePreviewEditMode.cs: Worked on unicode
- preview (but disabled it).
-
-2009-02-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed text editor line
- marker bug.
-
-2009-02-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Changed GetPixel method.
-
-2009-02-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/Style.cs: Changed color styles
- a bit.
-
-2008-02-13 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor/ISearchEngine.cs: Fix crash on empty search.
-
-2009-02-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Handle system style changes.
-
-2009-02-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed drawing issue with
- current line marker in color styles & syntax modes that
- define the same bg color than the default one for keywords.
-
-2009-02-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/GutterMargin.cs:
- * Mono.TextEditor/TextViewMargin.cs: Dispose Gdk cursors, else
- finalisers destroy them outside of the GUI thread and often
- crash MD due to X asserts resulting in _XCBUnlockDisplay
- errors.
-
-2009-02-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Worked on
- ColumnToVisualX.
-
-2009-02-11 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: fixed "Bug 474600 -
- Completion window's trigger position is wrong at start and
- end of line".
-
-2009-02-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/IconMargin.cs:
- * Mono.TextEditor/LineSegment.cs:
- * Mono.TextEditor/TextViewMargin.cs: LineSegment.Markers is
- now always != null. Removing all unneccessary null checks.
-
-2009-02-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextMarker.cs: fixed style text marker.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.csproj: Don't treat warning as errors,
- because csc still outputs warnings for this project.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * Mono.TextEditor.csproj: Fix GTK# version.
-
-2009-02-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/Style.cs:
- * Mono.TextEditor.Highlighting/ChunkStyle.cs: fixed "Bug
- 473258 - Current line highlight not correctly drawn".
-
-2009-02-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: validate
- now gives back an result.
-
-2009-02-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor.Highlighting/ChunkStyle.cs:
- * Mono.TextEditor.Highlighting/MarkupSyntaxMode.cs: Fixed link
- feature.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor.mds:
- * Mono.TextEditor.mdp:
- * Mono.TextEditor.csproj: Migrated to MSBuild file format.
-
-2009-02-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Add a hook for subclasses to
- add insert actions.
-
-2009-02-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.mdp:
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/EditMode.cs:
- * Mono.TextEditor.Vi/ViMode.cs:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor.Vi/ViActions.cs:
- * Mono.TextEditor/DeleteActions.cs:
- * Mono.TextEditor/ISearchEngine.cs:
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor/ClipboardActions.cs:
- * Mono.TextEditor/ReplaceEventArgs.cs:
- * Mono.TextEditor/DefaultEditActions.cs: fixed "Bug 472714 -
- MonoDevelop automatic indentation does not follow "Convert
- tabs to spaces" option".
-
-2009-02-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Remove debug code.
-
-2009-02-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: When the selection changes
- externally and there's no selection, only reset the state if
- the current state is Visual.
-
-2009-02-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Worked on visual ->
- document translation.
-
-2009-02-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Highlighting/Style.cs:
- * Mono.TextEditor.Highlighting/DefaultStyle.cs:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs:
- Implement namespace-like fallbacks for colours and chunk
- styles.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/objects.xml:
- * Mono.TextEditor.mdp: Updated references.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs: Flush.
-
-2009-02-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/ClipboardActions.cs: Track
- TextEditorOptions API.
-
-2009-02-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.mdp: Updated.
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Use the
- read-only ITextEditorOptions interface to avoid accidental
- modification.
-
- * Mono.TextEditor/TextEditorOptions.cs: Implement
- ITextEditorOptions. Rename the "Options" instance to
- "DefaultOptions" and make it read-only.
-
- * Mono.TextEditor/ITextEditorOptions.cs: Read-only interface
- ITextEditorOptions extracted from TextEditorOptions.
-
-2009-02-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Track changes in MD's assembly handling.
- Mono.Cairo is no longer considered to be a "system"
- assembly.
-
-2009-01-30 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: implemented ITextEditorDataProvider.
-
-2009-01-30 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/EditMode.cs:
- * Mono.TextEditor/ClipboardActions.cs: Fixed virtual positions.
-
-2009-01-30 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Caret.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/CaretMoveActions.cs: Added click support for caret
- beyond eol.
-
-2009-01-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor/CaretMoveActions.cs: Encapsulated virtual space
- management.
-
-2009-01-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Worked on line changed markers.
-
-2009-01-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Caret.cs:
- * Mono.TextEditor/EditMode.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor/CaretMoveActions.cs:
- * Mono.TextEditor/ClipboardActions.cs: Added support for caret behind
- eol
-
-2009-01-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: worked on line changed markers.
-
-2009-01-28 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/LineSplitter.cs: Worked on line changed markers.
-
-2009-01-28 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Optimized line changed markers a bit.
-
-2009-01-28 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/objects.xml:
- * Styles/OblivionStyle.xml:
- * Styles/TangoLightStyle.xml:
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/FoldMarkerMargin.cs:
- * Mono.TextEditor.Highlighting/Style.cs: Added line dirty/changed
- markers.
-
-2009-01-28 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/MarkupSyntaxMode.cs: fixed 'Bug 469928 -
- Text editor in assembly browser hung randomly'.
-
-2009-01-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.mdp: treat warnings as errors.
-
-2009-01-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * SyntaxModes/XmlSyntaxMode.xml: fixed "Bug 469628 - XML attribute
- highlighting broken"
-
-2009-01-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Remove debug code.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * Mono.TextEditor.mdp: Flush project format changes.
-
-2009-01-26 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/Rule.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Reduced memory
- consumption of syntax highlighting parser.
-
-2009-01-26 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/ClipboardActions.cs:
- * Mono.TextEditor.Highlighting/Chunk.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting/MarkupSyntaxMode.cs: Reduced memory
- footprint. Chunks are now represented as a primitve list instead of
- creating a collection object for each chunk request.
-
-2009-01-26 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: set clip region.
-
-2009-01-26 Mike Krüger <mkrueger@novell.com>
-
- * SyntaxModes/CSyntaxMode.xml:
- * SyntaxModes/XmlSyntaxMode.xml:
- * SyntaxModes/JavaSyntaxMode.xml:
- * SyntaxModes/ValaSyntaxMode.xml:
- * SyntaxModes/CSharpSyntaxMode.xml:
- * SyntaxModes/JavascriptSyntaxMode.xml:
- * Mono.TextEditor.Highlighting/Match.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Hard coded the number
- regular expression for speed up.
-
-2009-01-26 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/LineSegment.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor.Highlighting/Rule.cs:
- * Mono.TextEditor.Highlighting/Keywords.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Optimized text editor
- speed & reduced memory footprint.
-
-2009-01-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Optimized text editor
- drawing for very large chunks.
-
-2009-01-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/ClipboardActions.cs: fixed 'Bug 468808 - Cannot
- copy/paste in files'.
-
-2009-01-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs: Optimized text editor drawing when
- selection is changed.
-
-2009-01-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.mdp:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/ISearchEngine.cs:
- * Mono.TextEditor/SearchRequest.cs:
- * Mono.TextEditor/TextEditorData.cs: Moved search parameters to a new
- SearchRequest class, this allows creating a search engine independent
- from the one provided by TextEditor.
-
-2009-01-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/FoldSegment.cs:
- * Mono.TextEditor/FoldMarkerMargin.cs: Folding now uses a tree instead
- of a list (should speed up folding in files with many foldings).
-
-2009-01-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: optimized folding performace.
-
-2009-01-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fixed possible exception as modifing
- Offset is not always allowed on an unknown segment.
-
-2009-01-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/DefaultEditActions.cs: fixed "Bug 433777 -
- Auto-expanding is a little aggressive".
-
-2009-01-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/WorkerThread.cs: worker threads are now
- using thread pools.
-
-2009-01-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Made GetLink method more robust.
-
-2009-01-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/MarkupSyntaxMode.cs: Markup syntax mode
- now takes default color from style.
-
-2009-01-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fix NRE on docs without
- highlighting.
-
-2009-01-14 Mike Krüger <mkrueger@novell.com>
-
- * Styles/C64Style.xml:
- * Styles/BrownStyle.xml:
- * Styles/OblivionStyle.xml:
- * Styles/TangoLightStyle.xml:
- * Styles/VisualStudioStyle.xml:
- * Mono.TextEditor.Highlighting/Style.cs:
- * Mono.TextEditor.Highlighting/MarkupSyntaxMode.cs: Added link color
- support & markup can now re-use style defined colors
-
-2009-01-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting/MarkupSyntaxMode.cs: fixed cut & paste
- issue.
-
-2009-01-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/LinkEventArgs.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor.Highlighting/Span.cs: Added link support.
-
-2009-01-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViActions.cs: Add a ToggleCase action.
-
- * Mono.TextEditor.Vi/ViMode.cs: Implement ~, :$, :0. Make u work while
- there's a selection.
-
-2009-01-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/ClipboardActions.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Worked on copy operation
- with markup syntax mode.
-
-2009-01-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Don't add/remove bookmarks when
- clicking on the icon bar. It will now add/remove breakpoints.
-
-2009-01-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: fixed Bug 459732 - Cursor placed in
- the wrong position.
-
-2009-01-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: fixed 'Bug 458159 -
- crash when editing javascript'.
-
-2009-01-06 Mike Krüger <mkrueger@novell.com>
-
- * SyntaxModes/ChangeLogSyntaxMode.xml:
- * Mono.TextEditor.Highlighting/Span.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: fixed "Bug 457677 -
- Changelog syntax highlighting gets broken when an extra asterisk is
- found".
-
-2008-12-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextEditorOptions.cs: Cache the font description once
- created.
-
- * gtk-gui/objects.xml: Updated.
-
-2008-12-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/DocumentLocation.cs: Fix build for recent mcs
- versions.
-
-2008-12-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Fix some actions that're made up of
- sub-actions so that they take place in one atomic undo instead of
- multiple undos. Tweaks to make auto-visual mode work better with
- undo/redo.
-
- * Mono.TextEditor/EditMode.cs: Add utility method for executing two
- actions in one atomic undo.
-
-2008-12-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs: The selectionRange field should be
- set to null when the selection's length is 0. Makes
- IsSomethingSelected work correctly.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.mdp: Remove duplicate ref.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.mdp: All projects now require fx 3.5.
-
-2008-12-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Implement J, M.
-
- * Mono.TextEditor.Vi/ViActions.cs: Add a Join action.
-
-2008-12-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/objects.xml: Updated.
-
- * Mono.TextEditor.Vi/ViMode.cs: When selection is changed independently
- of the vi edit mode, switch into visual mode automatically.
-
- * Mono.TextEditor/EditMode.cs:
- * Mono.TextEditor/TextEditor.cs: Pass selection change events through to
- the edit mode.
-
-2008-12-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Implement H, L.
-
-2008-11-27 Grzegorz Sobański <silk@boktor.net>
-
- * Mono.TextEditor.Vi/ViMode.cs: Implement gg.
-
-2008-12-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Implement Y, based on patch by Grzegorz
- Sobański. Closes Bug 449293 - [PATCH] ViMode - implement Y. Also fix
- NREs when pasting an empty clipboard.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Make it work for parallel build.
-
-2008-12-02 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Match vim's post-replace caret positioning.
-
-2008-11-26 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Match vim's post-yank caret positioning.
-
-2008-11-26 Grzegorz Sobański <silk@boktor.net>
-
- * Mono.TextEditor.Vi/ViActionMaps.cs: handle Insert key in insert
- and replace mode.
-
-2008-11-26 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor.Highlighting/ChunkStyle.cs:
- * Mono.TextEditor.Highlighting/MarkupSyntaxMode.cs: Worked on markup
- syntax mode.
-
-2008-11-26 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/GutterMargin.cs: taken out line change command handler
- in gutter margin.
-
-2008-11-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextMarker.cs: Fix end location of underline marker.
-
-2008-11-25 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Implement sS.
-
-2008-11-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: fixed 'Bug 448006 -
- MD crashes while editing XML files'.
-
-2008-11-24 Mike Krüger <mkrueger@novell.com>
-
- * SyntaxModes/CSharpSyntaxMode.xml:
- * Mono.TextEditor.Highlighting/Span.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: fixed 'Bug 447547 -
- Error occurred when highlighting multiline strings(@"")'.
-
-2008-11-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: fixed off by 1 error.
-
-2008-11-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor.Highlighting/MarkupSyntaxMode.cs: Worked on markup
- syntax mode.
-
-2008-11-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextMarker.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor.Highlighting/MarkupSyntaxMode.cs: Added support for
- underlining highlighting styles.
-
-2008-11-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Highlighting/ChunkStyle.cs: Remove Console.WriteLine.
-
-2008-11-20 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.mdp:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor.Highlighting/Chunk.cs:
- * Mono.TextEditor.Highlighting/SyntaxMode.cs:
- * Mono.TextEditor.Highlighting/ChunkStyle.cs:
- * Mono.TextEditor.Highlighting/MarkupSyntaxMode.cs: Worked on markup
- syntax mode.
-
-2008-11-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/ClipboardActions.cs: Add missing '!'. Fixes pasting.
-
-2008-11-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/ClipboardActions.cs: Used CanEdit instead of readonly
-
-2008-11-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/ClipboardActions.cs: Recognizing readonly property for
- cut&paste operations.
-
-2008-11-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextMarker.cs: Add properties to UnderlineMarker to
- limit it to part of a line.
-
-2008-11-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextMarker.cs: Make underline marker use named
- colours. Fix some spelling.
-
- * Mono.TextEditor.Highlighting/Style.cs: Define colour names for error
- and warning underlines.
-
-2008-11-11 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Implement y.
-
-2008-11-10 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor.Vi/ViActionMaps.cs: Allow Page(Up|Down).
-
-2008-11-10 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Allow backspace for search/ex.
-
-2008-11-10 Mike Krüger <mike@icsharpcode.net>
-
- * Mono.TextEditor/ClipboardActions.cs: fixed possible null reference
- exception.
-
-2008-11-07 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Implement p P.
-
-2008-11-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Add helper for generating menu for
- selecting input method.
-
-2008-11-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Fix build dependencies.
-
-2008-11-06 Mike Krüger <mike@icsharpcode.net>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Fixed 'Bug 442110 - Syntax
- highlighting parser problem with escaped backslash'.
-
-2008-11-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Made the "I" command open insert mode
- before the first non-whitespace character on the line, not the line
- start. Fixes "Bug 438177 - [vi] 'I' behavior inconsistent with vi".
-
-2008-11-05 Mike Krüger <mike@icsharpcode.net>
-
- * Mono.TextEditor/Margin.cs:
- * Mono.TextEditor/IBuffer.cs:
- * Mono.TextEditor/Segment.cs:
- * Mono.TextEditor/Document.cs:
- * Mono.TextEditor/EditMode.cs:
- * Mono.TextEditor/GapBuffer.cs:
- * Mono.TextEditor.Vi/ViMode.cs:
- * Mono.TextEditor/TextEditor.cs:
- * Mono.TextEditor/IconMargin.cs:
- * Mono.TextEditor/FoldSegment.cs:
- * Mono.TextEditor/SearchResult.cs:
- * Mono.TextEditor/RedBlackTree.cs:
- * Mono.TextEditor/LineSplitter.cs:
- * Mono.TextEditor/GutterMargin.cs:
- * Mono.TextEditor/HelperMethods.cs:
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor/TextEditorData.cs:
- * Mono.TextEditor/BookmarkActions.cs:
- * Mono.TextEditor/LineSegmentTree.cs:
- * Mono.TextEditor/ClipboardActions.cs:
- * Mono.TextEditor/CaretMoveActions.cs:
- * Mono.TextEditor/FoldMarkerMargin.cs:
- * Mono.TextEditor/ReplaceEventArgs.cs:
- * Mono.TextEditor/DocumentLocation.cs:
- * Mono.TextEditor/CodeSegmentPreviewWindow.cs: Done some minor cosmetic
- changes. Fixed all warning messages.
-
-2008-11-05 Mike Krüger <mike@icsharpcode.net>
-
- * Mono.TextEditor/TextEditor.cs: fixed 'Bug 437049 - Horizontal keyboard
- scrolling sometimes does not work'.
-
-2008-11-04 Mike Krüger <mike@icsharpcode.net>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: added bounds checking for
- 'Bug 429905 - Tooltip folded region preview can crash MD'.
-
-2008-10-31 Full Name <Email Address>
-
- * Mono.TextEditor/Document.cs: fixed 'Bug 433729 - Copy/Paste/Folding
- the top comment of a file, you get a wrong display.'.
-
-2008-10-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs:
- * Mono.TextEditor.Highlighting/ChunkStyle.cs: fixed 'Bug 438946 – Editor
- does not respect Bold font setting for font'.
-
-2008-10-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Caret.cs:
- * Mono.TextEditor/DeleteActions.cs: fixed 'Bug 438696 - Error in text
- editor extension chain.'.
-
-2008-10-24 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed caret drawing when scrolling
- horizontally.
-
-2008-10-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: fixed 'Bug 437110 - NRE when switching to
- another file'.
-
-2008-10-20 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Implement / ? n N.
-
-2008-10-20 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor/SelectionActions.cs,
- Mono.TextEditor/SelectionActions.cs: Implement V.
-
-2008-10-19 Mike Krüger <mkrueger@novell.com>
-
- * SyntaxModes/AspNetSyntaxMode.xml: applied patch from 'Bug 436777 -
- Missing syntax highlighting / code completion for ASP.NET master
- pages'.
-
-2008-10-15 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Allow ex commands to apply to visual mode,
- add :s command.
-
-2008-10-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/DeleteActions.cs: Add DeleteSelection.
-
- * Mono.TextEditor.Vi/ViMode.cs: Implement >{motion}, <{motion}, >>, <<
- for normal mode, and and c d > < for visual mode.
-
-2008-10-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.Vi/ViMode.cs: Implement A I c C x X D.
-
-2008-10-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: fixed 'Bug 434248 - Need to refresh
- texteditor after removing folded code'.
-
-2008-10-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Don't use vi mode on default
- constructor.
-
- * Makefile.am:
- * Mono.TextEditor.mdp: Updated.
-
- * Mono.TextEditor.Vi/ViMode.cs:
- * Mono.TextEditor.Vi/ViActions.cs:
- * Mono.TextEditor.Vi/ViActionMaps.cs: Move vi code to new namespace.
- Move action lookup out of the way. Implement 'o' and 'O', and
- :{number}. Unbreak 'c' key and ':' commands by removing overzealous
- modifier check.
-
- * Mono.TextEditor/ViMode.cs:
- * Mono.TextEditor/ViActions.cs: Moved.
-
-2008-10-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/ViActions.cs: Fix { } behaviour.
-
-2008-10-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * Mono.TextEditor.mdp: Updated.
-
- * Mono.TextEditor/ViMode.cs:
- * Mono.TextEditor/ViActions.cs: Implemented { and }.
-
-2008-10-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/ViMode.cs:
- * Mono.TextEditor/DeleteActions.cs: Implemented 'dd' and 'd{motion}' for
- simple motions.
-
-2008-10-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/ViMode.cs: Refactor the dictionaries into switches to
- reduce overhead (also more readable for character commands). Split
- cursor and character navigation keys so that cursor keys can work in
- insert mode.
-
- * Mono.TextEditor/SelectionActions.cs: Add method for converting a
- movement action to a selection action.
-
-2008-10-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/ViMode.cs: Add support for simple vi commands.
-
-2008-10-10 Christian Hergert <chris@dronelabs.com>
-
- * SyntaxModes/PythonSyntaxMode.xml: Python does not support multiline
- comments.
- * SyntaxModes/CSyntaxMode.xml: Add NULL as a literal keyword.
-
-2008-10-10 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Caret.cs:
- * Mono.TextEditor/CaretMoveActions.cs:
- * Mono.TextEditor/FoldMarkerMargin.cs: fixed 'Bug 434165 - Page UP/Down
- Key on top/bottom of a code folded make the region Unfolded'.
-
-2008-10-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs: fixed 'Bug 432845 - Find and
- replace doesn't work'.
-
-2008-10-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor.mdp, Makefile.am: Updated.
- * Mono.TextEditor/BookmarkActions.cs,
- Mono.TextEditor/CaretMoveActions.cs,
- Mono.TextEditor/ClipboardActions.cs,
- Mono.TextEditor/DefaultEditActions.cs,
- Mono.TextEditor/DeleteActions.cs, Mono.TextEditor/EditAction.cs,
- Mono.TextEditor/EditMode.cs, Mono.TextEditor/SelectionActions.cs,
- Mono.TextEditor/SimpleEditMode.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/ViMode.cs:
- Switch to a delegate-based API so we aren't always newing up
- objects in order to perform actions. Allows actions to be invoked
- more easily, and tidies up API. Group actions logically in static
- classes.
-
-2008-10-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs: fixed 'Bug 430805 - Cannot
- middle-click-paste between source editors'.
-
-2008-10-06 Gabriel Burt <gburt@novell.com>
-
- * Mono.TextEditor/ViMode.cs: Added keybindings for ctrl-d and ctrl-u
- (pg dn/up), % (go to matching bracket), and G (go to eof), and fix
- keybinding for _ to go to first non-whitespace char instead of
- start of line
-
-2008-10-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/ViMode.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/EditMode.cs: Add a way for the EditMode to pre-empt
- the IM handling. This prevents the keystroke from reaching the
- editor extension chain, hence preventing code completion from
- triggering. Prevents accidental triggering of completion in vi
- navigation.
-
-2008-10-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/ViMode.cs: Implement 'u' for undo.
-
-2008-10-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/ViMode.cs: Implement a simple vi-like editing mode.
- * Mono.TextEditor/TextEditor.cs, Mono.TextEditor/SimpleEditMode.cs,
- Mono.TextEditor/EditMode.cs: Abstract out the editing into a mode
- object.
- * Mono.TextEditor/DefaultEditActions.cs: Add soem new actions for
- jumping to zero/home.
- * Mono.TextEditor.mdp, Makefile.am: Updated.
-
-2008-10-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs,
- Mono.TextEditor/TextEditorOptions.cs: text editor options are now
- disposable.
-
-2008-09-30 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/SharpDevelopWordFindStrategy.cs,
- Mono.TextEditor/Document.cs, Mono.TextEditor/TextEditorData.cs,
- Mono.TextEditor/TextEditorOptions.cs,
- Mono.TextEditor/DefaultEditActions.cs,
- Mono.TextEditor/EmacsWordFindStrategy.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs: Refactorey word
- strategy (moved to text editor options/added '_' treatment switch).
-
-2008-09-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/SharpDevelopWordFindStrategy.cs,
- Mono.TextEditor/Document.cs, Mono.TextEditor/IWordFindStrategy.cs,
- Mono.TextEditor/EmacsWordFindStrategy.cs: Added emacs/sharpdevelop
- find word strategies.
-
-2008-09-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: fixed 'Bug 430512 - Editor
- forcefully reformats my code incorrectly'.
-
-2008-09-25 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs, Mono.TextEditor/TextViewMargin.cs:
- fixed 'Bug 424443 - Many cursors shown when pressing the Down key
- for a while'.
-
-2008-09-25 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: fixed 'Bug 429738 - Middle-click paste
- past end of row pastes in next line'.
-
-2008-09-25 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs, Mono.TextEditor.Tests,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.mdp,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests/DocumentTests.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests/LineSplitterTests.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests/UndoRedoTests.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests/SearchTests.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests/SelectionTests.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/InsertTabTests.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/SelectionSelectAllTests.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/RemoveTabTests.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/CaretMoveTests.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/InsertNewLineTests.cs:
- Moved text editor unit tests.
-
-2008-09-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Handled tooltip provider exception, to
- prevent a text editor crash.
-
-2008-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor.mdp: Updated projects.
-
-2008-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/CodeSegmentPreviewWindow.cs: Fix crash caused by the
- double buffer flag. Dispose resources on destroy.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs, gtk-gui/objects.xml: Updated generated code.
-
-2008-09-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fixed "Bug 423278 - wrong view when
- jumping in editor without scrollbar".
-
-2008-08-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: optimized copy/cut.
-
-2008-08-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs, Mono.TextEditor/LineSegmentTree.cs,
- Mono.TextEditor/TextEditor.cs, Mono.TextEditor/LineSplitter.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs: Optimized text
- editor. Syntax update is now running on a single thread using a
- queue. Optimized the offset2line number operation.
-
-2008-08-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/GutterMargin.cs, Mono.TextEditor/TextViewMargin.cs:
- Worked on gutter width change.
-
-2008-08-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.mdp: set referenced gtk sharp version back to 2.8.
- * Mono.TextEditor/CodeSegmentPreviewWindow.cs: fixed compiler warning.
-
-2008-08-21 Mike Krüger <mkrueger@novell.com>
-
- * TangoLightStyle.xml, JavascriptSyntaxMode.xml, Styles,
- Styles/TangoLightStyle.xml, Styles/OblivionStyle.xml,
- Styles/BrownStyle.xml, Styles/VisualStudioStyle.xml,
- Styles/C64Style.xml, VBNetSyntaxMode.xml, BooSyntaxMode.xml,
- CSharpSyntaxMode.xml, PythonSyntaxMode.xml, JavaSyntaxMode.xml,
- CPPSyntaxMode.xml, CSyntaxMode.xml, ValaSyntaxMode.xml,
- OblivionStyle.xml, ChangeLogSyntaxMode.xml, AspNetSyntaxMode.xml,
- gtk-gui/objects.xml, BrownStyle.xml, XmlSyntaxMode.xml,
- VisualStudioStyle.xml, C64Style.xml, SyntaxModes,
- SyntaxModes/JavascriptSyntaxMode.xml,
- SyntaxModes/ChangeLogSyntaxMode.xml,
- SyntaxModes/AspNetSyntaxMode.xml, SyntaxModes/VBNetSyntaxMode.xml,
- SyntaxModes/BooSyntaxMode.xml, SyntaxModes/CSharpSyntaxMode.xml,
- SyntaxModes/XmlSyntaxMode.xml, SyntaxModes/JavaSyntaxMode.xml,
- SyntaxModes/PythonSyntaxMode.xml, SyntaxModes/CPPSyntaxMode.xml,
- SyntaxModes/CSyntaxMode.xml, SyntaxModes/ValaSyntaxMode.xml: Moved
- resources to own subdirecttories.
- * Mono.TextEditor/TextViewMargin.cs: Fixed little issue with folding
- markers and invalid lines.
-
-2008-08-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/LineSegment.cs: Changed text editor interface
- (add/remove marker moved to document).
-
-2008-08-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fix some memory leaks.
- * gtk-gui/objects.xml: Updated.
-
-2008-08-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/Style.cs,
- Mono.TextEditor.Highlighting/IColorDefinition.cs: Worked on styles
- (fixed 'Bug 405939 - Named colours in colour schemes should have
- fallbacks').
-
-2008-08-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs, Mono.TextEditor/FoldMarkerMargin.cs,
- Mono.TextEditor/TextEditor.cs: fixed 'Bug 405921 - Folding markers
- are often not repainted'. Fixed bug on fold marker painting.
-
-2008-08-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.mdp, ChangeLogSyntaxMode.xml: Added changelog syntax
- mode.
-
-2008-08-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DocumentUpdateRequest.cs,
- Mono.TextEditor/TextEditor.cs: Fixed some drawing issues.
-
-2008-08-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fixed color style bug.
-
-2008-08-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/CodeSegmentPreviewWindow.cs: optimized text editor
- code segment preview & fixed some issues with the drag widget.
-
-2008-08-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: fixed "Bug 416564 - Syntax highlighting
- is lost when reloading a file".
-
-2008-08-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorOptions.cs: changed default setting for new
- tabs after nontabs option.
-
-2008-08-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorOptions.cs,
- Mono.TextEditor/DefaultEditActions.cs: fixed "Bug 416089 - Warn
- about tabs after non-tabs".
-
-2008-08-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/CodeSegmentPreviewWindow.cs: fixed "Bug 405912 -
- Dragged text no longer shows preview".
-
-2008-08-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Fixed "Bug 405926
- - Addins cannot add syntax schemes or colour schemes to the text
- editor".
-
-2008-08-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditorOptions.cs: Fix spelling, sheme -> scheme.
-
-2008-08-11 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorOptions.cs,
- Mono.TextEditor/DefaultEditActions.cs: fixed Bug 416088 - Remove
- Whitespace From Newlines.
-
-2008-08-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor.mdp, Makefile.am: Updated.
- * Mono.TextEditor/Margin.cs, Mono.TextEditor/FoldMarkerMargin.cs,
- Mono.TextEditor/TextEditor.cs, Mono.TextEditor/GutterMargin.cs,
- Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/IMargin.cs:
- Merged IMargin and AbstractMargin into a new Margin class. Methods
- for handling mouse events are now internal, and new public events
- have been added.
- * Mono.TextEditor/TextMarker.cs, Mono.TextEditor/LineSegment.cs,
- Mono.TextEditor/IconMargin.cs, Mono.TextEditor/BookmarkMargin.cs,
- Mono.TextEditor/BookmarkMarker.cs: Renamed BookmarkMargin into
- IconMargin. Moved code for handling bookmarks to the new
- BookmarkMarker. Allow IIconBarMarker objects to handle mouse
- events.
-
-2008-08-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/Document.cs, Mono.TextEditor/TextEditorData.cs,
- Mono.TextEditor/TextEditor.cs, gtk-gui/objects.xml: Added delegate
- which is called to check if a line is read-only. Removed ReadOnly
- property from TextEditor since it is not used anymore (it was moved
- to Document).
-
-2008-07-22 Jeffrey Stedfast <fejj@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs (DeleteCaretLineToEnd):
- Mimic Emacs behavior when the cursor is in the last column of the
- line.
-
-2008-07-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed visual --> document location
- bug in lines with open foldings.
-
-2008-07-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: fixed "Bug 408896
- - Text editor: cannot insert apostrophe, parentheses, etc in text
- files".
-
-2008-07-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs, Mono.TextEditor/BufferedTextReader.cs:
- Added System.IO.TextReader support for the text buffer.
-
-2008-07-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: fixed 'Bug 385456 - Code folding'.
-
-2008-07-14 Mike Krüger <mkrueger@novell.com>
-
- * JavascriptSyntaxMode.xml, XmlSyntaxMode.xml: Added java script syntax
- mode (Bug 400896 - Syntax Mode for Javascript).
-
-2008-07-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/ITooltipProvider.cs, Mono.TextEditor/TextEditor.cs:
- Allow specifying the alignment of tooltips.
-
-2008-07-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/ITooltipProvider.cs, Mono.TextEditor/TextEditor.cs:
- Add support for "interactive" tooltips (tooltips which can have
- interactive widgets).
-
-2008-07-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs,
- Mono.TextEditor.Highlighting/IXmlProvider.cs: Worked on style
- support.
-
-2008-07-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs,
- Mono.TextEditor.Highlighting/IXmlProvider.cs: Added support for
- custom styles.
-
-2008-07-04 Mike Krüger <mkrueger@novell.com>
-
- * CSharpSyntaxMode.xml, XmlSyntaxMode.xml: fixed "Bug 405927 - Quotes
- are mis-highlighted in C# XML comments".
-
-2008-07-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: fixed 'Bug 405923 - After using
- middle-click insertion, the document jumps back to the location of
- the selection'.
-
-2008-07-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextMarker.cs: fixed 'Bug 405919 - Error underlines
- are sometimes painted over the line numbers and folding markers'.
-
-2008-07-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fixed 'Bug 405913 - Drag-n-dropping
- text should move text, not copy it'.
-
-2008-07-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextMarker.cs, Mono.TextEditor.Highlighting/Style.cs:
- Added color styles for breakpoints.
-
-2008-07-04 Mike Krüger <mkrueger@novell.com>
-
- * OblivionStyle.xml: set searchtextbg for oblivion.
-
-2008-07-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: fixed 'Bug 404713
- - Threading issues in text editor'.
-
-2008-07-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor.mdp, Mono.TextEditor/ITooltipProvider.cs,
- Mono.TextEditor/TextEditor.cs, Makefile.am: Added support for
- tooltips. It is now possible to register tooltip providers which
- can create custom tooltip windows.
-
-2008-07-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/Document.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs: Fix a couple of
- crasher race conditions.
- * Mono.TextEditor.Highlighting/WorkerThread.cs: Catch exceptions in
- worker threads so that they don't crash MD.
-
-2008-07-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/TextMarker.cs:
- Added support for style overriding in text markers. Now a text
- marker can easily change the text style without having to implement
- the draw method. Also use the background defined by the style
- object, if there is one.
- * Mono.TextEditor.Highlighting/ChunkStyle.cs: Added background color
- property. Added copy constructor.
-
-2008-07-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextMarker.cs, Mono.TextEditor/BookmarkMargin.cs:
- Added width and height parameters to IIConBarMarker.DrawIcon.
- Simplifies work to implementers.
-
-2008-06-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs, Mono.TextEditor/Segment.cs:
- Optimized selection - fixing [Bug 402777] New: Mouse selection is
- very slow.
-
-2008-06-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs,
- Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/Document.cs,
- Mono.TextEditor/TextEditorData.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/Caret.cs, Mono.TextEditor/LineSegment.cs:
- Refactored text editor. Corrected Document -> TextEditorData ->
- TextEditor layers.
-
-2008-06-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: fixed 'Bug 402543 - Crash
- while pasting text from closed document.'.
-
-2008-06-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs: Disable version auto-increment.
-
-2008-06-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Don't allow replacing text in
- read-only mode.
-
-2008-06-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Restore accidentally removed
- code.
-
-2008-06-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs,
- Mono.TextEditor/TextEditorData.cs, Mono.TextEditor/TextEditor.cs,
- gtk-gui/objects.xml: Implemented support for read-only editors.
- * Mono.TextEditor/TextEditorOptions.cs: Make the Font property safer
- for incorrect font names. Implemented CopyFrom method.
-
-2008-06-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs,
- Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/Document.cs,
- Mono.TextEditor/FoldMarkerMargin.cs,
- Mono.TextEditor/TextEditorData.cs,
- Mono.TextEditor/CodeSegmentPreviewWindow.cs,
- Mono.TextEditor/TextEditor.cs, Mono.TextEditor/Caret.cs,
- Mono.TextEditor/BookmarkMargin.cs,
- Mono.TextEditor/TextEditorOptions.cs,
- Mono.TextEditor/GutterMargin.cs, Mono.TextEditor/LineSegment.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs: Added support for
- editor-specific options. TextEditor now has an Options property and
- all classes use that object to get options, instead of the static
- instance.
-
-2008-06-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: added workaround to fix 400293.
-
-2008-06-17 Mike Krüger <mkrueger@novell.com>
-
- * VBNetSyntaxMode.xml, CSharpSyntaxMode.xml, JavaSyntaxMode.xml,
- CSyntaxMode.xml, ValaSyntaxMode.xml: Updated highlighting files.
-
-2008-06-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs: Fixed syntax
- highlighting issue.
-
-2008-06-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/RedBlackTree.cs: fixed possible null reference.
-
-2008-06-11 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorOptions.cs: changed visibility.
-
-2008-06-11 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/RedBlackTree.cs: Fixed red black tree.
-
-2008-06-11 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/RedBlackTree.cs: fixed 'Bug 381106 - Document view
- state can become scrambled'.
-
-2008-06-11 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SemanticRule.cs: fixed 'Bug 393118 - URL
- is not underlined completely and indeed redirects to only the
- domain'
-
-2008-06-10 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/LineSplitter.cs,
- Mono.TextEditor/Document.cs, Mono.TextEditor/LineSegmentTree.cs,
- Mono.TextEditor/TextEditor.cs, Mono.TextEditor/BookmarkMargin.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs,
- Mono.TextEditor.Highlighting/Rule.cs: Fixed some
- warnings/refactored code a bit. Improved the handling of the
- longest line.
-
-2008-06-10 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed tab placement bug.
-
-2008-06-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed horizontal scrollbar bug.
-
-2008-06-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed bug in
- VisualToDocumentLocation
-
-2008-06-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed tab stop calculation - it
- should work better now. Refactored visual <--> document location
- logic.
-
-2008-06-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: fixed possible null reference
- exception in VisualToDocumentLocation
-
-2008-06-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Improved support for non
- monospaced font.
-
-2008-06-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fixed Bug 394285 - NRE in CaretThread
-
-2008-06-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed possible div by zero
- exception.
-
-2008-06-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Use the OnDestroyed event instead of
- Dispose, since with the latest changes in gtk#, Dispose is not
- called anymore when a widget is destroyed.
-
-2008-05-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * XmlSyntaxMode.xml: Fix CDATA end tag.
-
-2008-05-27 David Makovský <yakeen@sannyas-on.net>
-
- * Mono.TextEditor/DefaultEditActions.cs: parse double value with invariant culture (Patch by Jérémie Laval).
-
-2008-05-26 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: handled possible nullref.
-
-2008-05-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SemanticRule.cs: fixed Bug 393118 - URL
- is not underlined completely and indeed redirects to only the
- domain
-
-2008-05-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fixed 'Bug 393037 - CTRL+F and writing
- text produces NRE'
-
-2008-05-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: fixed Bug 393411 - Pasted text
- offset is wrong when there is a selection
-
-2008-05-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: fixed 'Bug 392655
- - The 'stopateol' highlighting behaviour doesn't always work'.
-
-2008-05-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs,
- Mono.TextEditor/TextViewMargin.cs: fixed 'Bug 389561 - Regression:
- Middle-click paste does not insert at cursor location'.
-
-2008-05-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: fixed 'Bug 385844 - XML syntax
- highlighting is unreliable' & 'Bug 389352 - Regression: big comment
- is not coloured'.
-
-2008-05-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Optimized background buffer.
-
-2008-05-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/LineSplitter.cs, Mono.TextEditor/Document.cs,
- Mono.TextEditor/IBuffer.cs, Mono.TextEditor/RedBlackTree.cs,
- Mono.TextEditor/LineSegmentTree.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/GapBuffer.cs, Mono.TextEditor/LineSegment.cs: Fixed
- text editor memory leak.
-
-2008-05-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextMarker.cs: fixed cut&paste error.
-
-2008-05-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextMarker.cs: exposed color property of the text
- marker
-
-2008-05-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextMarker.cs: Moved the code that draws error
- underlines to a new UnderlineMarker. Created LineBackgroundMarker,
- to be used to change the background of a line.
-
-2008-05-13 Mike Krüger <mkrueger@novell.com>
-
- * CSharpSyntaxMode.xml, Mono.TextEditor.Highlighting/SyntaxMode.cs:
- Worked on c# syntax mode. Fixed syntax highlighting bug (keyword
- before span end now highlights correct).
-
-2008-05-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * AspNetSyntaxMode.xml, XmlSyntaxMode.xml: Highlight doctypes. Fix
- attribute highlighting.
-
-2008-05-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * AspNetSyntaxMode.xml, XmlSyntaxMode.xml: Improve attribute regex.
-
-2008-05-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Fixed highlighting update bug.
-
-2008-05-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs, XmlSyntaxMode.xml:
- Fixed a syntax highlighting bug/worked on xml highlighting.
-
-2008-05-08 Mike Krüger <mkrueger@novell.com>
-
- * XmlSyntaxMode.xml: worked on xml highlighting.
-
-2008-05-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/TextEditor.cs:
- fixed "Bug 387778 - MD Crash on Mouse Paste".
-
-2008-05-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/BookmarkMargin.cs: fixed null ref exception.
-
-2008-05-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/BookmarkMargin.cs: Bookmark margin now exposes it's
- draw event.
-
-2008-05-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/TextMarker.cs,
- Mono.TextEditor/BookmarkMargin.cs: Worked on text markers.
-
-2008-05-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs, Mono.TextEditor/ISearchEngine.cs:
- implemented replace regex groups.
-
-2008-05-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fixed Bug 387321 - Crash when Select
- All + Copy + Select All + Paste.
-
-2008-05-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Reset the IMContext even when there's
- an exception during a commit.
- * AspNetSyntaxMode.xml, XmlSyntaxMode.xml: Improve highlighting
- schemes.
- * Mono.TextEditor.Highlighting/Style.cs: Allow highlighting schemes to
- access the "default" colour.
-
-2008-05-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/TextMarker.cs:
- Worked on text markers.
-
-2008-05-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/TextEditorData.cs,
- Mono.TextEditor/TextEditor.cs, Mono.TextEditor/ISearchEngine.cs:
- Worked on regex search.
-
-2008-05-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/ISearchEngine.cs: worked on regex search.
-
-2008-05-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/ISearchEngine.cs: Abstracted the search engine.
-
-2008-05-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed Bug 385737 - Text editor shows
- unnecessary horizontal scrollbar
-
-2008-05-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: fixed Bug 382556 - Text editor
- should respect GTK settings.
-
-2008-05-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Add focus in and focus out calls to
- IMContext. Revert static IMContext changes., which for some reason
- also fixes crash on double-click.
-
-2008-04-30 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fixed resource deallocation.
-
-2008-04-30 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed an error in keyboard input when
- multiple text editors are open.
-
-2008-04-30 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed possible null ref exception when
- accessing disposed text editor.
-
-2008-04-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Dispose the IMContext, and check that
- it's realised when committing. Hopefully fixes possible NRE after
- the document is disposed.
-
-2008-04-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Replaced old some old coordination
- translation code.
-
-2008-04-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Attempt to fix major "Bug 382141 - ALL
- keypresses are intepreted as newlines" by reworking input method
- context handling.
-
-2008-04-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fixed keyboard input.
-
-2008-04-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fixed 'Bug 381115 - Ctrl+s prints an s
- if there's nothing to save'.
-
-2008-04-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fixed 'Bug 379935 - Can't type letters
- with accents and other composed chars with the text editor'.
-
-2008-04-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Removed work around.
-
-2008-04-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: fixed Bug 379236 - Pressing
- "end" on a folded code block doesn't move to end
-
-2008-04-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: fixed Bug 378195 - Text editor has
- visible caret when there is a selection
-
-2008-04-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Restore caret position after a
- middle-click insertion, and restore selection when the insertion is
- within the offset range space previously occupied by the selection.
- Fixes "Bug 378188 - Strange selection deletion behaviour".
-
-2008-04-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Optimized text editor drawing a
- bit. Worked on folding preview.
-
-2008-04-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: fixed some selection issues in
- some commands.
-
-2008-04-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs,
- Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/TextEditor.cs:
- fixed 'Bug 376331 - Middle-click paste should not change
- selection'.
-
-2008-04-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/CodeSegmentPreviewWindow.cs,
- Mono.TextEditor/LineSegment.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs: fixed 'Bug 376329 -
- Folded region tooltip readability issues'
-
-2008-04-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: fixed 'Bug 324272 - in search and
- replace, parenthesis matching should be disabled'
-
-2008-04-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs: worked on bug 'Bug 376136 - Array
- out of bounds selecting text'.
-
-2008-04-02 Mike Krüger <mkrueger@novell.com>
-
-
-
-2008-04-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/IMargin.cs,
- Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs: Optimized preview
- window a bit.
-
-2008-04-02 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.mdp, Mono.TextEditor/TextViewMargin.cs,
- Mono.TextEditor/IMargin.cs,
- Mono.TextEditor/CodeSegmentPreviewWindow.cs,
- Mono.TextEditor/LineSegmentTree.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs, Makefile.am: Added
- preview window for collapsed regions (feature request 363639).
-
-2008-03-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Removed debug message.
-
-2008-03-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/LineSegmentTree.cs: fixed Bug 372273 - MD crash.
-
-2008-03-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Fixed 'Bug 372256 - Region wrapped when
- Code Folding is disabled'
-
-2008-03-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Removed some debug messages.
-
-2008-03-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs: Fixed Bug 371702
- - XmlEditor - crash with empty file.
-
-2008-03-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.mdp, CSharpSyntaxMode.xml, CSyntaxMode.xml,
- Mono.TextEditor.Highlighting/SyntaxMode.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs,
- Mono.TextEditor.Highlighting/Rule.cs, Makefile.am: Fixed Bug 370303
- - '#if 0' blocks should be coloured as comments.
-
- Changed the way spans are scanned. The order of the span definition
- is now important - no more constraints. The first defined span is
- used first - so define /// before // for example.
-
-2008-03-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: fixed Bug 363951 - Numeric keyboard
- does not work
-
-2008-03-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Possible fix: 'Bug 368597 - Wrong
- location of caret in the new managed editor'.
-
-2008-03-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed Bug 370133 - When jumping to a
- line, caret should be placed in the middle of the window
-
-2008-03-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs: fixed Bug 370135
- - XML comment highlighting not working
-
-2008-03-13 Mike Krüger <mkrueger@novell.com>
-
- * ValaSyntaxMode.xml: Added vala syntax mode from levi bard.
-
-2008-03-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Implement AutoIndent
- behaviour.
-
-2008-03-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Added some thread locks for the update logic.
-
-2008-03-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * XmlSyntaxMode.xml: Apply XML highlighting to XAML , HTML and XHTML.
-
-2008-03-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Improved the scrolling speed (should be
- visible on old machines).
-
-2008-03-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Window split now removes the split that
- doesn't have the focus. (intelligent split)
-
-2008-03-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/BookmarkMargin.cs: Clicking on the bookmark margin on an
- invalid line no longer triggers the bookmark in the last line.
-
-2008-03-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.mdp, AspNetSyntaxMode.xml, Makefile.am: Started ASP.NET
- highlighting.
-
-2008-03-03 Mike Krüger <mkrueger@novell.com>
-
- * CPPSyntaxMode.xml, CSyntaxMode.xml, Mono.TextEditor/Document.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs: It's now possible that
- syntax highlighting files inherit from each other (C<-C++).
-
-2008-03-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Refactored highlighting
- algorithm.
-
-2008-03-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs,
- Mono.TextEditor.Highlighting/Style.cs,
- Mono.TextEditor.Highlighting/ChunkStyle.cs: Worked on the syntax
- highlighting algorithm.
-
-2008-03-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Added some worker threads.
-
-2008-03-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Removed debug message.
-
-2008-03-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Fixed syntax
- highlighting bug
-
-2008-03-01 Mike Krüger <mkrueger@novell.com>
-
- * CSharpSyntaxMode.xml, Mono.TextEditor/TextViewMargin.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs,
- Mono.TextEditor.Highlighting/Match.cs: Added support for regular
- expressions (syntax highlighting).
-
-2008-03-01 Mike Krüger <mkrueger@novell.com>
-
- * PythonSyntaxMode.xml, Mono.TextEditor.Highlighting/SyntaxMode.cs: fixed
- """, ''' pydocs
-
-2008-03-01 Mike Krüger <mkrueger@novell.com>
-
- * PythonSyntaxMode.xml: Added python syntax highlighting.
-
-2008-02-29 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * CPPSyntaxMode.xml, CSyntaxMode.xml: Added headers to highlighted mime
- types.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs: Freed up some
- resources.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/FoldMarkerMargin.cs, Mono.TextEditor/BookmarkMargin.cs:
- Fixed zooming bug.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs, Mono.TextEditor/TextEditorOptions.cs: Added
- zoom commands to main menu.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Added a function.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/TextViewMargin.cs,
- Mono.TextEditor/Document.cs, Mono.TextEditor/TextUtil.cs,
- Mono.TextEditor/TextEditorData.cs: Moved TextUtil functions into
- Document.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs,
- Mono.TextEditor.Highlighting/WorkerThread.cs: Abstracted safe threading
- in a reuseable workerthread class.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/TextUtil.cs: Fixed
- Bracket highlighting on text operations.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/TextUtil.cs:
- changed next/prev word behaviour.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: No longer using
- Thread.Abort ().
-
-2008-02-28 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs, Mono.TextEditor/TextEditor.cs: Worked
- on search&replace. (Bug 365439 - Replace usability issues)
-
-2008-02-28 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/Document.cs: Fixed some
- bugs caused by a former change.
-
-2008-02-28 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/LineSplitter.cs, Mono.TextEditor/TextEditorData.cs,
- Mono.TextEditor/TextEditor.cs, Mono.TextEditor/GapBuffer.cs,
- Mono.TextEditor/GutterMargin.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.pidb,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.mdp,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests/LineSplitterTests.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests/SelectionTests.cs: Fixed Bug
- 365570 - Crash in the editor.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
-
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs: Support for escape
- chars.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
-
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
-
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs: Refactored status bar.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs, Mono.TextEditor/TextEditorData.cs: Removed
- some debug messages
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/TextMarker.cs: Added
- draw routine for a caret marker.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextMarker.cs: Added background marker support.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs, Mono.TextEditor/TextEditorData.cs,
- Mono.TextEditor/TextEditor.cs, Mono.TextEditor/Caret.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests/UndoRedoTests.cs,
- Mono.TextEditor.Highlighting/Caret.cs: Fixed Bug 362692 - Undoing all
- changes should clear the modified flag of the editor.
-
- Refactored structure a bit. Added unit tests for undo/redo operations.
-
-2008-02-27 Aaron Bockover <abockover@novell.com>
-
- * OblivionStyle.xml: Made some style changes to be less bland
-
- * BrownStyle.xml: Renamed from UbuntuStyle
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: fixed drawing bug.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: fixed not to draw invalid line bug.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/Document.cs: Editor
- now updates automatically when inserting/removing lines. (internal
- change, does NOT affect users)
-
-2008-02-26 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed possible exception in
- TextViewMargin.
-
-2008-02-25 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: Fixed syntax highlighting bug.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/GapBuffer.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.pidb,
- Mono.TextEditor.Highlighting/Rule.cs,
- Mono.TextEditor.Highlighting/ChunkStyle.cs: Cleaned some code.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: possible fix for 363621.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.mdp, Mono.TextEditor/Document.cs,
- Mono.TextEditor/LineSegmentTree.cs, Mono.TextEditor/GapBuffer.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs: Added some assertions which
- help to track errors.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Tests/Mono.TextEditor.Tests.pidb: Removed some unused
- glade and gnome-sharp references (only the unused). But I'll continue to
- remove glade, we need to lower the dependency tree a bit.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/TextViewMargin.cs,
- Mono.TextEditor/SearchOptions.cs, Mono.TextEditor/TextEditorData.cs,
- Mono.TextEditor/TextEditor.cs, Mono.TextEditor/SearchResult.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests/SearchTests.cs: Fixed Bug
- 364045 - Can't use Search Previous command to go through to all matches.
- And wrote some unit tests for the search commands.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Fixed bug in logicaltovisuallocation.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs, Mono.TextEditor/SearchResult.cs: Search now
- gives more information about the result.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Added support for custom drag sources.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Added try/catch, may help to track
- the cut&paste problem.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Bug 363951 - Numeric keyboard does not work
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Changed copy behaviour.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Added global copy event (for the
- clipboard ring)
-
-2008-02-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed Bug 363631 - The selection does
- not work for "*" symbol.
-
-2008-02-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: fixed highlighting issue.
-
-2008-02-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed Bug 363762 - Scrollbar does not take
- into account collapsed regions.
-
-2008-02-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs, Mono.TextEditor/TextUtil.cs: Fixed Bug 363771
- - Strange behavior when typing on a new file.
-
-2008-02-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/Caret.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs,
- Mono.TextEditor.Highlighting/Caret.cs: Fixed Bug 363628 - MD text editor
- does not recognize comments inside comments
-
-2008-02-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxMode.cs: fixed Bug 363624 - variables
- which contains keyword are wrongly recongnized
-
-2008-02-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed control key problem.
-
-2008-02-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Fixed update at delet line/delete
- line to end commands.
-
-2008-02-20 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/BookmarkMargin.cs: Bookmark is now scaling better.
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.pidb,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/InsertTabTests.cs:
- Found insert tab case that failed.
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/TextEditorData.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/SelectionSelectAllTests.cs:
- Fixed "Bug 362983 - Text selected with Select All can't be unselected"
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Tests/Mono.TextEditor.Tests.pidb: Copy to primary
- clipboard is now lazy (Improves performance for large selections).
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/InsertTabTests.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/RemoveTabTests.cs:
- Added Remove tab tests.
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/TextViewMargin.cs,
- Mono.TextEditor/TextEditorData.cs, Mono.TextEditor/TextEditor.cs: Fixed
- little issues found by unit testing.
- * Mono.TextEditor.Tests/Mono.TextEditor.Tests/SelectionTests.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/InsertTabTests.cs:
- Extended unit tests.
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Caret.cs: Bug 362895 - Caret missplaced when jumping to an
- error.
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: fixed Bug 362879 - Bracket highlight
- not removed.
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/TextEditorData.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.pidb: Fixed Bug 362887 -
- Paste command pastes text to the wrong location.
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Tests/Mono.TextEditor.Tests.mdp,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/InsertTabTests.cs:
- Added some tests for the insert tab behavior.
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/Document.cs,
- Mono.TextEditor/TextEditorData.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.pidb: Fixed insert/remove
- indent (Bug 362896 - Unindent action leaves selection in a weird state).
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Tests/Mono.TextEditor.Tests.mdp,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests/DocumentTests.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/DocumentTests.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/CaretMoveTests.cs,
- Mono.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/InsertNewLineTests.cs:
- Worked on text editor unit tests.
-
-2008-02-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am, Mono.TextEditor.mdp: Fixed assembly references.
-
-2008-02-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Added key bindings for
- control+shift+up/down. In OnLeaveNotifyEvent, reset the cursor only when
- the mouse is really leaving the window.
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/TextViewMargin.cs,
- Mono.TextEditor/Document.cs, Mono.TextEditor/Segment.cs,
- Mono.TextEditor/LineSegment.cs: Fixed some warnings.
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed possible nullref.
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/TextViewMargin.cs,
- Mono.TextEditor/Document.cs, Mono.TextEditor/TextEditorData.cs,
- Mono.TextEditor/IMargin.cs, Mono.TextEditor/SelectionMarker.cs,
- Mono.TextEditor/TextEditor.cs, Mono.TextEditor/GutterMargin.cs: Worked
- on selection.
-
-2008-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: fixed Bug 322763 - Ctrl + Backspace
- deletes the end of the line.
-
-2008-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: goto/delete next/prev word should
- now be the same as in gtksourceview.
-
-2008-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs, Mono.TextEditor/TextEditor.cs: Implemented
- undo operation dispose
-
-2008-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs, Mono.TextEditor/TextEditorData.cs,
- Mono.TextEditor/TextEditor.cs: Fixed undo/redo bug.
-
-2008-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/Document.cs,
- Mono.TextEditor/TextEditorData.cs, Mono.TextEditor/TextEditor.cs: Worked
- on undo/redo.
-
-2008-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: fixed Bug 362691 - Mouse click doesn't
- clear selection in some specific case
-
-2008-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/FoldMarkerMargin.cs,
- Mono.TextEditor/IMargin.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/BookmarkMargin.cs, Mono.TextEditor/GutterMargin.cs:
- Worked on mouse behavior.
-
- Fixing Bug 362683 - Double click + drag selection not working
-
- Bug 362687 - Triple-click should select the whole line
-
-2008-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/FoldMarkerMargin.cs,
- Mono.TextEditor/TextEditor.cs, Mono.TextEditor/BookmarkMargin.cs,
- Mono.TextEditor/TextEditorOptions.cs: Implemented mouse wheel zoom.
-
-2008-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Changed scroll to caret a bit.
-
-2008-02-18 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Fixed tabs2spaces option.
-
-2008-02-18 Mike Krüger <mkrueger@novell.com>
-
- * BooSyntaxMode.xml: Added boo syntax mode.
-
-2008-02-18 Mike Krüger <mkrueger@novell.com>
-
- * VBNetSyntaxMode.xml: Fixed VB.NET syntax mode (comments).
-
-2008-02-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextUtil.cs, Mono.TextEditor/TextEditor.cs: Worked on
- search options.
-
-2008-02-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Caret line highlighting works again.
-
-2008-02-17 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/Document.cs,
- Mono.TextEditor/SearchOptions.cs, Mono.TextEditor/TextUtil.cs,
- Mono.TextEditor/TextEditorData.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/Segment.cs, Mono.TextEditor/LineSegment.cs,
- Mono.TextEditor.Highlighting/Style.cs: Worked on search and replace.
-
-2008-02-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Small refactorings.
-
-2008-02-16 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/TextViewMargin.cs,
- Mono.TextEditor/Document.cs, Mono.TextEditor/Caret.cs,
- Mono.TextEditor/LineSegment.cs: Caret now remembers it's column when
- moving up/down.
-
-2008-02-16 Mike Krüger <mkrueger@novell.com>
-
- * OblivionStyle.xml, Mono.TextEditor/TextViewMargin.cs: Fixed caret drawing
- issues.
-
-2008-02-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed ruler drawing.
-
-2008-02-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Corrected ruler posititon.
-
-2008-02-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/Document.cs,
- Mono.TextEditor/FoldMarkerMargin.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/GutterMargin.cs: Refactored text editor.
-
-2008-02-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Keypad control keys now work.
-
-2008-02-15 Mike Krüger <mkrueger@novell.com>
-
-
-
-2008-02-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/Document.cs,
- Mono.TextEditor/IBuffer.cs, Mono.TextEditor/GapBuffer.cs,
- Mono.TextEditor/GutterMargin.cs: Fixed gutter bug & refactored.
-
-2008-02-15 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/TextViewMargin.cs,
- Mono.TextEditor/Document.cs, Mono.TextEditor/LineSplitter.cs,
- Mono.TextEditor/TextUtil.cs, Mono.TextEditor/FoldMarkerMargin.cs,
- Mono.TextEditor/TextEditorData.cs, Mono.TextEditor/TextMarker.cs,
- Mono.TextEditor/SelectionMarker.cs,
- Mono.TextEditor/DocumentUpdateRequest.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/Caret.cs, Mono.TextEditor/BookmarkMargin.cs,
- Mono.TextEditor/DocumentLocation.cs, Mono.TextEditor/GutterMargin.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs,
- Mono.TextEditor.Highlighting/SemanticRule.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs: Refactored text
- editor. Fixed column ruler.
-
-2008-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Remove access to properties service
- from performance critical methods. Greatly improves performance.
-
-2008-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Added method for running an editor action.
-
-2008-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/TextViewMargin.cs,
- Mono.TextEditor/TextUtil.cs, Mono.TextEditor/TextEditor.cs: Implemented
- 'go to matching bracket' action.
-
-2008-02-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/TextMarker.cs,
- Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor.Highlighting/SemanticRule.cs: Url textmarker now has a
- type enum.
-
-2008-02-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed bug in ColumnToVisualX.
-
-2008-02-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Commented out smooth scrooling (can't get
- it right)
-
-2008-02-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/TextMarker.cs: Markers
- are now drawn with selection information.
-
-2008-02-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed highlighting bracket drawing
- issue.
-
-2008-02-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/Caret.cs: Fixed caret drawing error.
-
-2008-02-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/ISegment.cs, Mono.TextEditor/TextViewMargin.cs,
- Mono.TextEditor/Segment.cs, Mono.TextEditor/LineSegment.cs: Fixed
- folding marker drawing.
-
-2008-02-14 Mike Krüger <mkrueger@novell.com>
-
- * TangoLightStyle.xml, OblivionStyle.xml, UbuntuStyle.xml,
- Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor.Highlighting/Style.cs, C64Style.xml: Fixed some drawing
- issues & speed bug with ctrl+home.
-
-2008-02-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/ISegment.cs, Mono.TextEditor/DefaultEditActions.cs,
- Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/Document.cs,
- Mono.TextEditor/TextEditorData.cs, Mono.TextEditor/TextMarker.cs,
- Mono.TextEditor/TextEditor.cs, Mono.TextEditor/Segment.cs,
- Mono.TextEditor/LineSegment.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs: Refactored much. Tab
- stops should now work. I've changed the update behaviour a bit - so
- expect some drawing issues (something updated too late or not updated at
- all). Drawing itself should go faster, but I don't have hard data here.
-
-2008-02-14 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/TextEditor.cs: Fixed
- mouse selection to the left bug.
-
-2008-02-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Ignore leave events raised by pointer Grab,
- since the pointer is not actually leaving the window.
-
-2008-02-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs: Fixed Bug 361473 - Incorrect placement
- of the cursor with mouse click.
-
-2008-02-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/TextMarker.cs,
- Mono.TextEditor/TextEditor.cs: Optimized drawing.
-
-2008-02-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/TextEditor.cs: Fixed
- drawing glicht caused by false adjustment.
-
-2008-02-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Changed scrolling a bit.
-
-2008-02-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/FoldMarkerMargin.cs,
- Mono.TextEditor/IMargin.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/BookmarkMargin.cs, Mono.TextEditor/GutterMargin.cs:
- Implemented shift+click behavior.
-
-2008-02-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Changed delete action.
-
-2008-02-13 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/FoldMarkerMargin.cs,
- Mono.TextEditor/IMargin.cs, Mono.TextEditor/TextMarker.cs,
- Mono.TextEditor/TextEditor.cs, Mono.TextEditor/BookmarkMargin.cs,
- Mono.TextEditor/GutterMargin.cs: Implemented smooth scrolling.
-
-2008-02-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed an error.
-
-2008-02-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.mdp, Mono.TextEditor/Document.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs,
- Mono.TextEditor.Highlighting/SemanticRule.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs,
- Mono.TextEditor.Highlighting/Rule.cs, Makefile.am: Worked on semantic
- highlighting.
-
-2008-02-12 Mike Krüger <mkrueger@novell.com>
-
- * CSharpSyntaxMode.xml, Mono.TextEditor/LineSplitter.cs,
- Mono.TextEditor/TextMarker.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/LineSegment.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs,
- Mono.TextEditor.Highlighting/Rule.cs: Started support for semantic
- highlighting. Urls+email addresses in comments and strings are
- highlighted.
-
- (Yes I know that THIS doesn't need to be done with semantic
- highlighting, but I need to test it out somewhere)
-
-2008-02-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/Document.cs,
- Mono.TextEditor/FoldMarkerMargin.cs, Mono.TextEditor/BookmarkMargin.cs,
- Mono.TextEditor/GutterMargin.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs: Worked on memory
- management.
-
-2008-02-12 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextViewMargin.cs, Mono.TextEditor/Document.cs,
- Mono.TextEditor/LineSegment.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs: Syntax highlighting
- update is now faster. (produced too many redraws)
-
-2008-02-11 Mike Krüger <mkrueger@novell.com>
-
- * TangoLightStyle.xml, Mono.TextEditor.Highlighting/Style.cs, C64Style.xml:
- Reversed bookmark color.
-
-2008-02-11 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/TextViewMargin.cs,
- Mono.TextEditor/TextEditor.cs: Middle mouse button paste now works.
-
-2008-02-11 Mike Krüger <mkrueger@novell.com>
-
- * TangoLightStyle.xml, Mono.TextEditor.mdp, bookmark.png, OblivionStyle.xml,
- UbuntuStyle.xml, Mono.TextEditor/TextViewMargin.cs,
- Mono.TextEditor/Document.cs, Mono.TextEditor/FoldMarkerMargin.cs,
- Mono.TextEditor/IMargin.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/BookmarkMargin.cs, Mono.TextEditor/TextEditorOptions.cs,
- Mono.TextEditor/GutterMargin.cs, Mono.TextEditor.Highlighting/Style.cs,
- Makefile.am, C64Style.xml: Worked on text editor - performance & drawing
- improvements.
-
-2008-02-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am: Fix location of installed assembly.
-
-2008-02-11 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.mdp, Mono.TextEditor/TextViewMargin.cs,
- Mono.TextEditor/TextEditor.cs, Mono.TextEditor/GutterMargin.cs,
- gtk-gui/objects.xml, Makefile.am: Optimized/Refactored the text editor.
-
-2008-02-11 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/FoldMarkerMargin.cs, Mono.TextEditor/IMargin.cs,
- Mono.TextEditor/TextEditor.cs, Mono.TextEditor/BookmarkMargin.cs,
- Mono.TextEditor/GutterMargin.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs,
- Mono.TextEditor.Highlighting/Rule.cs: Optimized performance a bit. (To
- get real performance gain, scrolling must be solved differently)
-
-2008-02-10 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/LineSplitter.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs: Fixed some drawing issues.
-
-2008-02-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/TextEditor.cs:
- Primary clipboard now works.
-
-2008-02-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs, Mono.TextEditor/Caret.cs: Overwrite mode
- now works.
-
-2008-02-09 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed caret drawing bug (occurred when
- caret was in line with foldings).
-
-2008-02-08 Mike Krüger <mkrueger@novell.com>
-
- * TangoLightStyle.xml, OblivionStyle.xml, UbuntuStyle.xml,
- Mono.TextEditor.Highlighting/Style.cs,
- Mono.TextEditor.Highlighting/DefaultStyle.cs, C64Style.xml: Style names
- are not localized anymore (but descriptions are).
-
-2008-02-08 Mike Krüger <mkrueger@novell.com>
-
- * UbuntuStyle.xml: Added ubuntu style (but it could need some improvements).
-
-2008-02-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/DefaultStyle.cs: Changed default style
- (folding on mouse over).
-
-2008-02-08 Mike Krüger <mkrueger@novell.com>
-
- * XmlSyntaxMode.xml: Worked on xml syntax highlighting
-
-2008-02-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: removed some redraws.
-
-2008-02-08 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs, Mono.TextEditor/LineSplitter.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs: Fixed highlighting
- bug.
-
-2008-02-07 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs, Mono.TextEditor/TextEditorOptions.cs: Color
- styles are now in options.
-
-2008-02-06 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Worked on printing.
-
-2008-02-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs, Mono.TextEditor/FoldingType.cs,
- Mono.TextEditor/TextEditor.cs, Mono.TextEditor/FoldSegment.cs: Added
- some folding commands.
-
-2008-02-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/Document.cs,
- Mono.TextEditor/Caret.cs, Mono.TextEditor/FoldSegment.cs: Improved
- folding behavior.
-
-2008-02-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Changed bracket highlighting in selected
- regions.
-
-2008-02-05 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed click on invalid line bug.
-
-2008-02-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Fixed highlighting
- panel.
-
-2008-02-04 Mike Krüger <mkrueger@novell.com>
-
- * TangoStyle.xml: Tango bracket matching has now better colors.
-
-2008-02-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.mdp, TangoStyle.xml, OblivionStyle.xml,
- Mono.TextEditor/TextUtil.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/TextEditorOptions.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs,
- Mono.TextEditor.Highlighting/Style.cs, Makefile.am: Implemented bracket
- matching.
-
-2008-02-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Implemented Bug 354129 - Auto add
- second brackets, quotation mark.
-
-2008-02-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/Document.cs:
- Implemented Bug 313786 - New editor needs to handle cr/lf issues,
- encoding.
-
-2008-02-04 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Implemented Bug 323946 - Undo/Redo
- functionality are not context sensitive.
-
-2008-02-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs, Mono.TextEditor/LineSplitter.cs,
- Mono.TextEditor/IBuffer.cs, Mono.TextEditor/LineSegmentTree.cs: Fixed
- reload bug.
-
-2008-02-03 Mike Krüger <mkrueger@novell.com>
-
- * TangoStyle.xml: Changed literal color in tango style.
-
-2008-02-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.mdp, Makefile.am: bookmark.png wasn't a resource ?
-
-2008-02-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Insert/Remove Indent now works
- without selection.
-
-2008-02-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/TextEditorData.cs:
- Some changes to remove code duplication.
-
-2008-02-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/TextEditorData.cs:
- Fixed Insert/Remove tab selection range bug.
-
-2008-02-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs, Mono.TextEditor/BookmarkMargin.cs: Some
- changes for the splitting feature.
-
-2008-02-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/LineSplitter.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/GutterMargin.cs: Gutter redraws on width changes.
-
-2008-02-03 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/LineSplitter.cs: Added some safety checks.
-
-2008-02-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Fixed bug.
-
-2008-02-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Changed the way the textedior
- indents.
-
-2008-02-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.mdp, AssemblyInfo.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor.Highlighting/AssemblyInfo.cs, gtk-gui/gui.stetic,
- Makefile.am: Added makefile.
-
-2008-02-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/Segment.cs, Mono.TextEditor/FoldSegment.cs: Improved
- folding updating.
-
-2008-02-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs, Mono.TextEditor/TextEditor.cs: Fixed
- VisualToLogicalLine method.
-
-2008-02-01 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Worked on folding.
-
-2008-02-01 Mike Krüger <mkrueger@novell.com>
-
- * TangoStyle.xml, Mono.TextEditor/Document.cs: Worked on folding.
-
-2008-01-31 Mike Krüger <mkrueger@novell.com>
-
- * VBNetSyntaxMode.xml, CSharpSyntaxMode.xml, JavaSyntaxMode.xml,
- CPPSyntaxMode.xml, CSyntaxMode.xml,
- Mono.TextEditor.Highlighting/SyntaxMode.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs,
- Mono.TextEditor.Highlighting/Style.cs, XmlSyntaxMode.xml: Implemented
- lazy loading of syntax modes and styles.
-
-2008-01-31 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.mdp, TangoStyle.xml, VBNetSyntaxMode.xml,
- JavaSyntaxMode.xml, CSyntaxMode.xml, CPPSyntaxMode.xml,
- OblivionStyle.xml, Mono.TextEditor/Document.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs, XmlSyntaxMode.xml,
- C64Style.xml: Added some syntax highlighting files.
-
-2008-01-31 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/TextEditorData.cs,
- Mono.TextEditor/TextEditorOptions.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs, XmlSyntaxMode.xml: Added
- iterator for selected lines.
-
-2008-01-30 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Fixed italic bug in rtf output.
-
-2008-01-30 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/Document.cs: Added update after undo/redo.
-
-2008-01-30 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.mdp, OblivionStyle.xml, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs,
- Mono.TextEditor.Highlighting/Match.cs,
- Mono.TextEditor.Highlighting/Rule.cs,
- Mono.TextEditor.Highlighting/Keywords.cs, TangoStyle.xml,
- CSharpSyntaxMode.xml: Worked on styling.
-
-2008-01-29 Mike Krüger <mkrueger@novell.com>
-
- * OblivionStyle.xml, Mono.TextEditor/DefaultEditActions.cs,
- Mono.TextEditor/TextEditor.cs, Mono.TextEditor.Highlighting/Style.cs,
- Mono.TextEditor.Highlighting/DefaultStyle.cs, CSharpSyntaxMode.xml,
- C64Style.xml: Worked on styling.
-
-2008-01-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.mdp, Mono.TextEditor/LineSplitter.cs,
- Mono.TextEditor/TextEditorData.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs,
- Mono.TextEditor.Highlighting/Style.cs,
- Mono.TextEditor.Highlighting/Span.cs, CSharpSyntaxMode.xml,
- XmlSyntaxMode.xml: Worked on highlighting.
-
-2008-01-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/LineSplitter.cs,
- Mono.TextEditor/BookmarkMargin.cs: Worked on bookmark commands.
-
-2008-01-29 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Added update request to the delete
- action.
-
-2008-01-28 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor.Highlighting/Style.cs: Fixed delete selection bug (caret
- offset didn't get updated), added primitive longest line management,
- changed syntax colors a bit.
-
-2008-01-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/BookmarkMargin.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs: No/missing syntax
- highlighting is now handled with a default syntax highlighting.
-
-2008-01-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/FoldMarkerMargin.cs, Mono.TextEditor/IMargin.cs,
- Mono.TextEditor/TextEditor.cs: Text cursor is now only for the text
- region.
-
-2008-01-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/TextEditor.cs:
- Improved drag & drop support.
-
-2008-01-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs, Mono.TextEditor/DefaultEditActions.cs:
- Paste now requests a redraw.
-
-2008-01-27 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs, Mono.TextEditor/TextEditor.cs:
- Optimized re-draws a bit.
-
-2008-01-26 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs,
- Mono.TextEditor/FoldMarkerMargin.cs, Mono.TextEditor/IMargin.cs,
- Mono.TextEditor/TextEditor.cs, Mono.TextEditor/BookmarkMargin.cs,
- Mono.TextEditor/GutterMargin.cs,
- Mono.TextEditor.Highlighting/SyntaxModeService.cs: Worked on text editor
- mouse handling.
-
-2008-01-25 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs, Mono.TextEditor.Highlighting/SyntaxMode.cs,
- Mono.TextEditor.Highlighting/Style.cs: Worked on styles.
-
-2008-01-25 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Fixed little issue in rtf output.
-
-2008-01-25 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs: Optimized rtf color table output.
-
-2008-01-25 Mike Krüger <mkrueger@novell.com>
-
- * OblivionStyle.xml, Mono.TextEditor/DefaultEditActions.cs,
- Mono.TextEditor/TextEditorOptions.cs, Mono.TextEditor/GutterMargin.cs,
- Mono.TextEditor.Highlighting/SyntaxMode.cs,
- Mono.TextEditor.Highlighting/Style.cs,
- Mono.TextEditor.Highlighting/ChunkStyle.cs, CSharpSyntaxMode.xml,
- C64Style.xml: Worked on Syntax highlighting
-
-2008-01-25 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor/TextEditorOptions.cs: Optimized drawing a bit, added
- syntax mode enabled option.
-
-2008-01-25 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs, Mono.TextEditor/TextEditorOptions.cs: Added
- property change event.
-
-2008-01-25 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/DefaultEditActions.cs, Mono.TextEditor/TextEditorData.cs,
- Mono.TextEditor/TextEditor.cs, Mono.TextEditor.Highlighting/Style.cs:
- Editor is now capable of outputting rtf to clipboard.
-
-2008-01-25 Mike Krüger <mkrueger@novell.com>
-
- * OblivionStyle.xml, Mono.TextEditor/RedBlackTree.cs,
- Mono.TextEditor/LineSegmentTree.cs, Mono.TextEditor/TextEditor.cs,
- Mono.TextEditor.Highlighting/Style.cs,
- Mono.TextEditor.Highlighting/DefaultStyle.cs, C64Style.xml: Selected
- foreground colors are now part of the highlighting style.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Changes the mouse cursor to text when the
- mouse is inside the editor. Changes the way cursor blinking is handled,
- and make it work more like gtksourceview. Draws selected text using the
- system selection color (usually white).
-
-2008-01-23 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs: Worked on code completion.
-
-2008-01-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.Highlighting/SyntaxModeService.cs: Worked on style panel.
-
-2008-01-22 Mike Krüger <mkrueger@novell.com>
-
- * OblivionStyle.xml, Mono.TextEditor.Highlighting/Style.cs, C64Style.xml:
- Color styles now have descriptions. Name/Description is now localizable.
-
-2008-01-22 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditor.cs, Mono.TextEditor/TextEditorOptions.cs,
- Mono.TextEditor/GutterMargin.cs: Added some text editor options -
- options are now virtual.
-
-2008-01-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor.mdp, Mono.TextEditor.mds: Added changelogs to the project
- files.
-
-2008-01-21 Mike Krüger <mkrueger@novell.com>
-
- * Mono.TextEditor/TextEditorData.cs, Mono.TextEditor/TextEditor.cs: Worked
- on selection logic.
-
diff --git a/main/src/core/Mono.Texteditor/Makefile.am b/main/src/core/Mono.Texteditor/Makefile.am
index 75cb6dc120..f9131dc780 100644
--- a/main/src/core/Mono.Texteditor/Makefile.am
+++ b/main/src/core/Mono.Texteditor/Makefile.am
@@ -1,7 +1,9 @@
include $(top_srcdir)/xbuild.include
EXTRA_DIST += \
- Styles/DefaultStyle.json \
+ Styles/DarkStyle.json \
+ Styles/GruvboxStyle.json \
+ Styles/LightStyle.json \
Styles/MonokaiStyle.json \
Styles/NightshadeStyle.json \
Styles/OblivionStyle.json \
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting.Regex/Regex.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting.Regex/Regex.cs
index 5423678008..435e96fefa 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting.Regex/Regex.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting.Regex/Regex.cs
@@ -33,35 +33,24 @@ namespace Mono.TextEditor.Highlighting
{
foreach (string pattern in patterns) {
int curOffset = offset;
- bool match = true;
int length = 0;
for (int i = 0; i < pattern.Length; i++) {
- if (pattern[i] == '\u00AE' && i + 1 < pattern.Length) {
+ if ((pattern[i] == '\u00AE' || pattern[i] == '‹') && i + 1 < pattern.Length) {
i++;
if (curOffset >= doc.Length) {
- match = true;
break;
}
if (pattern[i] == doc [curOffset]) {
- match = false;
- break;
+ return RegexMatch.NoMatch;
}
} else {
- if (curOffset >= doc.Length) {
- match = false;
- break;
- }
- if (doc [curOffset] != pattern [i]) {
- match = false;
- break;
- }
+ if (curOffset >= doc.Length || doc [curOffset] != pattern [i])
+ return RegexMatch.NoMatch;
length++;
}
curOffset++;
-
}
- if (match)
- return new RegexMatch (length);
+ return new RegexMatch (length);
}
return RegexMatch.NoMatch;
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/ColorScheme.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/ColorScheme.cs
index 79dc77fd34..58d93b729e 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/ColorScheme.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/ColorScheme.cs
@@ -33,10 +33,26 @@ using System.Reflection;
using System.Text;
using System.Xml;
using Xwt.Drawing;
+using Mono.TextEditor.Utils;
namespace Mono.TextEditor.Highlighting
{
- public class ColorScheme
+ public class StyleImportException : Exception
+ {
+ public ImportFailReason Reason { get; private set; }
+
+ public StyleImportException (ImportFailReason reason)
+ {
+ Reason = reason;
+ }
+
+ public enum ImportFailReason {
+ Unknown,
+ NoValidColorsFound
+ }
+
+ }
+ public sealed class ColorScheme
{
public string Name { get; set; }
public string Description { get; set; }
@@ -70,14 +86,8 @@ namespace Mono.TextEditor.Highlighting
[ColorDescription("Indicator Margin(Separator)", VSSetting="color=Indicator Margin/Background")]
public AmbientColor IndicatorMarginSeparator { get; private set; }
- [ColorDescription("Tooltip Border")]
- public AmbientColor TooltipBorder { get; private set; }
-
[ColorDescription("Tooltip Pager Top")]
- public AmbientColor TooltipPagerTop { get; private set; }
-
- [ColorDescription("Tooltip Pager Bottom")]
- public AmbientColor TooltipPagerBottom { get; private set; }
+ public AmbientColor TooltipPager { get; private set; }
[ColorDescription("Tooltip Pager Triangle")]
public AmbientColor TooltipPagerTriangle { get; private set; }
@@ -115,7 +125,7 @@ namespace Mono.TextEditor.Highlighting
[ColorDescription("Usages(Rectangle)", VSSetting="color=MarkerFormatDefinition/HighlightedReference/Background,secondcolor=MarkerFormatDefinition/HighlightedReference/Background,bordercolor=MarkerFormatDefinition/HighlightedReference/Background")]
public AmbientColor UsagesRectangle { get; private set; }
- [ColorDescription("Changing usages(Rectangle)", VSSetting="color=MarkerFormatDefinition/HighlightedReference/Background,secondcolor=MarkerFormatDefinition/HighlightedReference/Background,bordercolor=MarkerFormatDefinition/HighlightedReference/Background")]
+ [ColorDescription("Changing usages(Rectangle)", VSSetting="color=MarkerFormatDefinition/HighlightedReference/Foreground,secondcolor=MarkerFormatDefinition/HighlightedReference/Foreground,bordercolor=MarkerFormatDefinition/HighlightedReference/Foreground")]
public AmbientColor ChangingUsagesRectangle { get; private set; }
[ColorDescription("Breakpoint Marker", VSSetting = "color=Breakpoint (Enabled)/Background")]
@@ -154,15 +164,24 @@ namespace Mono.TextEditor.Highlighting
[ColorDescription("Column Ruler")] // not defined
public AmbientColor Ruler { get; private set; }
- [ColorDescription("Completion Matching Substring")]
- public AmbientColor CompletionHighlight { get; private set; }
+ [ColorDescription("Completion Window", VSSetting = "color=Plain Text/Background")]
+ public AmbientColor CompletionWindow { get; private set; }
- [ColorDescription("Completion Border")]
- public AmbientColor CompletionBorder { get; private set; }
+ [ColorDescription("Completion Tooltip Window", VSSetting = "color=Plain Text/Background")]
+ public AmbientColor CompletionTooltipWindow { get; private set; }
+
+ [ColorDescription("Completion Selection Bar Border", VSSetting = "color=Selected Text/Background")]
+ public AmbientColor CompletionSelectionBarBorder { get; private set; }
+
+ [ColorDescription("Completion Selection Bar Background", VSSetting = "color=Selected Text/Background,secondcolor=Selected Text/Background")]
+ public AmbientColor CompletionSelectionBarBackground { get; private set; }
+
+ [ColorDescription("Completion Selection Bar Border(Inactive)", VSSetting = "color=Inactive Selected Text/Background")]
+ public AmbientColor CompletionSelectionBarBorderInactive { get; private set; }
+
+ [ColorDescription("Completion Selection Bar Background(Inactive)", VSSetting = "color=Inactive Selected Text/Background,secondcolor=Inactive Selected Text/Background")]
+ public AmbientColor CompletionSelectionBarBackgroundInactive { get; private set; }
- [ColorDescription("Completion Border(Inactive)")]
- public AmbientColor CompletionInactiveBorder { get; private set; }
-
[ColorDescription("Message Bubble Error Marker")]
public AmbientColor MessageBubbleErrorMarker { get; private set; }
@@ -199,338 +218,481 @@ namespace Mono.TextEditor.Highlighting
[ColorDescription("Message Bubble Warning IconMargin")]
public AmbientColor MessageBubbleWarningIconMargin { get; private set; }
+ [ColorDescription("Link Color")]
+ public AmbientColor LinkColor { get; private set; }
+
+ [ColorDescription("Link Color(Active)")]
+ public AmbientColor ActiveLinkColor { get; private set; }
+
#endregion
#region Text Colors
-
- [ColorDescription("Plain Text", VSSetting = "Plain Text")]
+
+ public const string PlainTextKey = "Plain Text";
+
+ [ColorDescription(PlainTextKey, VSSetting = "Plain Text")]
public ChunkStyle PlainText { get; private set; }
- [ColorDescription("Selected Text", VSSetting = "Selected Text")]
+ public const string SelectedTextKey = "Selected Text";
+ [ColorDescription(SelectedTextKey, VSSetting = "Selected Text")]
public ChunkStyle SelectedText { get; private set; }
- [ColorDescription("Selected Text(Inactive)", VSSetting = "Inactive Selected Text")]
+ public const string SelectedInactiveTextKey = "Selected Text(Inactive)";
+ [ColorDescription(SelectedInactiveTextKey, VSSetting = "Inactive Selected Text")]
public ChunkStyle SelectedInactiveText { get; private set; }
- [ColorDescription("Collapsed Text", VSSetting = "Collapsible Text")]
+ public const string CollapsedTextKey = "Collapsed Text";
+ [ColorDescription(CollapsedTextKey, VSSetting = "Collapsible Text")]
public ChunkStyle CollapsedText { get; private set; }
- [ColorDescription("Line Numbers", VSSetting = "Line Numbers")]
+ public const string LineNumbersKey = "Line Numbers";
+ [ColorDescription(LineNumbersKey, VSSetting = "Line Numbers")]
public ChunkStyle LineNumbers { get; private set; }
- [ColorDescription("Punctuation", VSSetting = "Operator")]
+ public const string PunctuationKey = "Punctuation";
+ [ColorDescription(PunctuationKey, VSSetting = "Operator")]
public ChunkStyle Punctuation { get; private set; }
- [ColorDescription("Punctuation(Brackets)", VSSetting = "Plain Text")]
+ public const string PunctuationForBracketsKey = "Punctuation(Brackets)";
+ [ColorDescription(PunctuationForBracketsKey, VSSetting = "Plain Text")]
public ChunkStyle PunctuationForBrackets { get; private set; }
- [ColorDescription("Comment(Line)", VSSetting = "Comment")]
+ public const string CommentsSingleLineKey = "Comment(Line)";
+ [ColorDescription(CommentsSingleLineKey, VSSetting = "Comment")]
public ChunkStyle CommentsSingleLine { get; private set; }
- [ColorDescription("Comment(Block)", VSSetting = "Comment")]
- public ChunkStyle CommentsMultiLine { get; private set; }
+ public const string CommentsBlockKey = "Comment(Block)";
+ [ColorDescription(CommentsBlockKey, VSSetting = "Comment")]
+ public ChunkStyle CommentsBlock { get; private set; }
- [ColorDescription("Comment(Doc)", VSSetting = "XML Doc Comment")]
+ public const string CommentsForDocumentationKey = "Comment(Doc)";
+ [ColorDescription(CommentsForDocumentationKey, VSSetting = "XML Doc Comment")]
public ChunkStyle CommentsForDocumentation { get; private set; }
- [ColorDescription("Comment(DocTag)", VSSetting = "XML Doc Tag")]
+ public const string CommentsForDocumentationTagsKey = "Comment(DocTag)";
+ [ColorDescription(CommentsForDocumentationTagsKey, VSSetting = "XML Doc Tag")]
public ChunkStyle CommentsForDocumentationTags { get; private set; }
- [ColorDescription("Comment Tag", VSSetting = "Comment")]
+ public const string CommentTagsKey = "Comment Tag";
+ [ColorDescription(CommentTagsKey, VSSetting = "Comment")]
public ChunkStyle CommentTags { get; private set; }
- [ColorDescription("Excluded Code", VSSetting = "Excluded Code")]
+ public const string ExcludedCodeKey = "Excluded Code";
+ [ColorDescription(ExcludedCodeKey, VSSetting = "Excluded Code")]
public ChunkStyle ExcludedCode { get; private set; }
- [ColorDescription("String", VSSetting = "String")]
+ public const string StringKey = "String";
+ [ColorDescription(StringKey, VSSetting = "String")]
public ChunkStyle String { get; private set; }
- [ColorDescription("String(Escape)", VSSetting = "String")]
+ public const string StringEscapeSequenceKey = "String(Escape)";
+ [ColorDescription(StringEscapeSequenceKey, VSSetting = "String")]
public ChunkStyle StringEscapeSequence { get; private set; }
- [ColorDescription("String(C# @ Verbatim)", VSSetting = "String(C# @ Verbatim)")]
+ public const string StringVerbatimKey = "String(C# @ Verbatim)";
+ [ColorDescription(StringVerbatimKey, VSSetting = "String(C# @ Verbatim)")]
public ChunkStyle StringVerbatim { get; private set; }
- [ColorDescription("Number", VSSetting = "Number")]
+ public const string NumberKey = "Number";
+ [ColorDescription(NumberKey, VSSetting = "Number")]
public ChunkStyle Number { get; private set; }
- [ColorDescription("Preprocessor", VSSetting = "Preprocessor Keyword")]
+ public const string PreprocessorKey = "Preprocessor";
+ [ColorDescription(PreprocessorKey, VSSetting = "Preprocessor Keyword")]
public ChunkStyle Preprocessor { get; private set; }
- [ColorDescription("Preprocessor(Region Name)", VSSetting = "Plain Text")]
+ public const string PreprocessorRegionNameKey = "Preprocessor(Region Name)";
+ [ColorDescription(PreprocessorRegionNameKey, VSSetting = "Plain Text")]
public ChunkStyle PreprocessorRegionName { get; private set; }
- [ColorDescription("Xml Text", VSSetting = "XML Text")]
+ public const string XmlTextKey = "Xml Text";
+ [ColorDescription(XmlTextKey, VSSetting = "XML Text")]
public ChunkStyle XmlText { get; private set; }
- [ColorDescription("Xml Delimiter", VSSetting = "XML Delimiter")]
+ public const string XmlDelimiterKey = "Xml Delimiter";
+ [ColorDescription(XmlDelimiterKey, VSSetting = "XML Delimiter")]
public ChunkStyle XmlDelimiter { get; private set; }
- [ColorDescription("Xml Name", VSSetting ="XML Name")]
+ public const string XmlNameKey = "Xml Name";
+ [ColorDescription(XmlNameKey, VSSetting ="XML Name")]
public ChunkStyle XmlName { get; private set; }
- [ColorDescription("Xml Attribute", VSSetting = "XML Attribute")]
+ public const string XmlAttributeKey = "Xml Attribute";
+ [ColorDescription(XmlAttributeKey, VSSetting = "XML Attribute")]
public ChunkStyle XmlAttribute { get; private set; }
- [ColorDescription("Xml Attribute Quotes", VSSetting = "XML Attribute Quotes")]
+ public const string XmlAttributeQuotesKey = "Xml Attribute Quotes";
+ [ColorDescription(XmlAttributeQuotesKey, VSSetting = "XML Attribute Quotes")]
public ChunkStyle XmlAttributeQuotes { get; private set; }
- [ColorDescription("Xml Attribute Value", VSSetting = "XML Attribute Value")]
+ public const string XmlAttributeValueKey = "Xml Attribute Value";
+ [ColorDescription(XmlAttributeValueKey, VSSetting = "XML Attribute Value")]
public ChunkStyle XmlAttributeValue { get; private set; }
- [ColorDescription("Xml Comment", VSSetting = "XML Comment")]
+ public const string XmlCommentKey = "Xml Comment";
+ [ColorDescription(XmlCommentKey, VSSetting = "XML Comment")]
public ChunkStyle XmlComment { get; private set; }
- [ColorDescription("Xml CData Section", VSSetting = "XML CData Section")]
+ public const string XmlCDataSectionKey = "Xml CData Section";
+ [ColorDescription(XmlCDataSectionKey, VSSetting = "XML CData Section")]
public ChunkStyle XmlCDataSection { get; private set; }
- [ColorDescription("Tooltip Text")] // not defined in vs.net
+ public const string TooltipTextKey = "Tooltip Text";
+ [ColorDescription(TooltipTextKey)] // not defined in vs.net
public ChunkStyle TooltipText { get; private set; }
- [ColorDescription("Notification Text")] // not defined in vs.net
+ public const string NotificationTextKey = "Notification Text";
+ [ColorDescription(NotificationTextKey)] // not defined in vs.net
public ChunkStyle NotificationText { get; private set; }
- [ColorDescription("Completion Text")] //not defined in vs.net
+ public const string CompletionTextKey = "Completion Text";
+ [ColorDescription(CompletionTextKey, VSSetting = "Plain Text")]
public ChunkStyle CompletionText { get; private set; }
- [ColorDescription("Completion Selected Text")] //not defined in vs.net
+ public const string CompletionMatchingSubstringKey = "Completion Matching Substring";
+ [ColorDescription(CompletionMatchingSubstringKey, VSSetting = "Keyword")]
+ public ChunkStyle CompletionMatchingSubstring { get; private set; }
+
+ public const string CompletionSelectedTextKey = "Completion Selected Text";
+ [ColorDescription(CompletionSelectedTextKey, VSSetting = "Selected Text")]
public ChunkStyle CompletionSelectedText { get; private set; }
- [ColorDescription("Completion Selected Text(Inactive)")] //not defined in vs.net
+ public const string CompletionSelectedMatchingSubstringKey = "Completion Selected Matching Substring";
+ [ColorDescription(CompletionSelectedMatchingSubstringKey, VSSetting = "Keyword")]
+ public ChunkStyle CompletionSelectedMatchingSubstring { get; private set; }
+
+ public const string CompletionSelectedInactiveTextKey = "Completion Selected Text(Inactive)";
+ [ColorDescription(CompletionSelectedInactiveTextKey, VSSetting = "Inactive Selected Text")]
public ChunkStyle CompletionSelectedInactiveText { get; private set; }
- [ColorDescription("Keyword(Access)", VSSetting = "Keyword")]
+ public const string CompletionSelectedInactiveMatchingSubstringKey = "Completion Selected Matching Substring(Inactive)";
+ [ColorDescription(CompletionSelectedInactiveMatchingSubstringKey, VSSetting = "Keyword")]
+ public ChunkStyle CompletionSelectedInactiveMatchingSubstring { get; private set; }
+
+ public const string KeywordAccessorsKey = "Keyword(Access)";
+ [ColorDescription(KeywordAccessorsKey, VSSetting = "Keyword")]
public ChunkStyle KeywordAccessors { get; private set; }
- [ColorDescription("Keyword(Type)", VSSetting = "Keyword")]
+ public const string KeywordTypesKey = "Keyword(Type)";
+ [ColorDescription(KeywordTypesKey, VSSetting = "Keyword")]
public ChunkStyle KeywordTypes { get; private set; }
- [ColorDescription("Keyword(Operator)", VSSetting = "Keyword")]
+ public const string KeywordOperatorsKey = "Keyword(Operator)";
+ [ColorDescription(KeywordOperatorsKey, VSSetting = "Keyword")]
public ChunkStyle KeywordOperators { get; private set; }
- [ColorDescription("Keyword(Selection)", VSSetting = "Keyword")]
+ public const string KeywordSelectionKey = "Keyword(Selection)";
+ [ColorDescription(KeywordSelectionKey, VSSetting = "Keyword")]
public ChunkStyle KeywordSelection { get; private set; }
- [ColorDescription("Keyword(Iteration)", VSSetting = "Keyword")]
+ public const string KeywordIterationKey = "Keyword(Iteration)";
+ [ColorDescription(KeywordIterationKey, VSSetting = "Keyword")]
public ChunkStyle KeywordIteration { get; private set; }
- [ColorDescription("Keyword(Jump)", VSSetting = "Keyword")]
+ public const string KeywordJumpKey = "Keyword(Jump)";
+ [ColorDescription(KeywordJumpKey, VSSetting = "Keyword")]
public ChunkStyle KeywordJump { get; private set; }
- [ColorDescription("Keyword(Context)", VSSetting = "Keyword")]
+ public const string KeywordContextKey = "Keyword(Context)";
+ [ColorDescription(KeywordContextKey, VSSetting = "Keyword")]
public ChunkStyle KeywordContext { get; private set; }
- [ColorDescription("Keyword(Exception)", VSSetting = "Keyword")]
+ public const string KeywordExceptionKey = "Keyword(Exception)";
+ [ColorDescription(KeywordExceptionKey, VSSetting = "Keyword")]
public ChunkStyle KeywordException { get; private set; }
- [ColorDescription("Keyword(Modifiers)", VSSetting = "Keyword")]
+ public const string KeywordModifiersKey = "Keyword(Modifiers)";
+ [ColorDescription(KeywordModifiersKey, VSSetting = "Keyword")]
public ChunkStyle KeywordModifiers { get; private set; }
- [ColorDescription("Keyword(Constants)", VSSetting = "Keyword")]
+ public const string KeywordConstantsKey = "Keyword(Constants)";
+ [ColorDescription(KeywordConstantsKey, VSSetting = "Keyword")]
public ChunkStyle KeywordConstants { get; private set; }
- [ColorDescription("Keyword(Void)", VSSetting = "Keyword")]
+ public const string KeywordVoidKey = "Keyword(Void)";
+ [ColorDescription(KeywordVoidKey, VSSetting = "Keyword")]
public ChunkStyle KeywordVoid { get; private set; }
- [ColorDescription("Keyword(Namespace)", VSSetting = "Keyword")]
+ public const string KeywordNamespaceKey = "Keyword(Namespace)";
+ [ColorDescription(KeywordNamespaceKey, VSSetting = "Keyword")]
public ChunkStyle KeywordNamespace { get; private set; }
- [ColorDescription("Keyword(Property)", VSSetting = "Keyword")]
+ public const string KeywordPropertyKey = "Keyword(Property)";
+ [ColorDescription(KeywordPropertyKey, VSSetting = "Keyword")]
public ChunkStyle KeywordProperty { get; private set; }
- [ColorDescription("Keyword(Declaration)", VSSetting = "Keyword")]
+ public const string KeywordDeclarationKey = "Keyword(Declaration)";
+ [ColorDescription(KeywordDeclarationKey, VSSetting = "Keyword")]
public ChunkStyle KeywordDeclaration { get; private set; }
- [ColorDescription("Keyword(Parameter)", VSSetting = "Keyword")]
+ public const string KeywordParameterKey = "Keyword(Parameter)";
+ [ColorDescription(KeywordParameterKey, VSSetting = "Keyword")]
public ChunkStyle KeywordParameter { get; private set; }
- [ColorDescription("Keyword(Operator Declaration)", VSSetting = "Keyword")]
+ public const string KeywordOperatorDeclarationKey = "Keyword(Operator Declaration)";
+ [ColorDescription(KeywordOperatorDeclarationKey, VSSetting = "Keyword")]
public ChunkStyle KeywordOperatorDeclaration { get; private set; }
- [ColorDescription("Keyword(Other)", VSSetting = "Keyword")]
+ public const string KeywordOtherKey = "Keyword(Other)";
+ [ColorDescription(KeywordOtherKey, VSSetting = "Keyword")]
public ChunkStyle KeywordOther { get; private set; }
- [ColorDescription("User Types", VSSetting = "User Types")]
+ public const string UserTypesKey = "User Types";
+ [ColorDescription(UserTypesKey, VSSetting = "User Types")]
public ChunkStyle UserTypes { get; private set; }
- [ColorDescription("User Types(Enums)", VSSetting = "User Types(Enums)")]
+ public const string UserTypesEnumsKey = "User Types(Enums)";
+ [ColorDescription(UserTypesEnumsKey, VSSetting = "User Types(Enums)")]
public ChunkStyle UserTypesEnums { get; private set; }
- [ColorDescription("User Types(Interfaces)", VSSetting = "User Types(Interfaces)")]
+ public const string UserTypesInterfacesKey = "User Types(Interfaces)";
+ [ColorDescription(UserTypesInterfacesKey, VSSetting = "User Types(Interfaces)")]
public ChunkStyle UserTypesInterfaces { get; private set; }
- [ColorDescription("User Types(Delegates)", VSSetting = "User Types(Delegates)")]
- public ChunkStyle UserTypesDelegatess { get; private set; }
+ public const string UserTypesDelegatesKey = "User Types(Delegates)";
+ [ColorDescription(UserTypesDelegatesKey, VSSetting = "User Types(Delegates)")]
+ public ChunkStyle UserTypesDelegates { get; private set; }
- [ColorDescription("User Types(Value types)", VSSetting = "User Types(Value types)")]
+ public const string UserTypesValueTypesKey = "User Types(Value types)";
+ [ColorDescription(UserTypesValueTypesKey, VSSetting = "User Types(Value types)")]
public ChunkStyle UserTypesValueTypes { get; private set; }
- [ColorDescription("User Types(Type parameters)", VSSetting = "User Types(Type parameters)")]
+ public const string UserTypesTypeParametersKey = "User Types(Type parameters)";
+ [ColorDescription(UserTypesTypeParametersKey, VSSetting = "User Types(Type parameters)")]
public ChunkStyle UserTypesTypeParameters { get; private set; }
- [ColorDescription("User Field Usage", VSSetting = "Identifier")]
+ public const string UserTypesMutableKey = "User Types(Mutable)";
+ [ColorDescription(UserTypesMutableKey, VSSetting = "User Types(Mutable")]
+ public ChunkStyle UserTypesMutable { get; private set; }
+
+ public const string UserFieldUsageKey = "User Field Usage";
+ [ColorDescription(UserFieldUsageKey, VSSetting = "Identifier")]
public ChunkStyle UserFieldUsage { get; private set; }
- [ColorDescription("User Field Declaration", VSSetting = "Identifier")]
+ public const string UserFieldDeclarationKey = "User Field Declaration";
+ [ColorDescription(UserFieldDeclarationKey, VSSetting = "Identifier")]
public ChunkStyle UserFieldDeclaration { get; private set; }
- [ColorDescription("User Property Usage", VSSetting = "Identifier")]
+ public const string UserPropertyUsageKey = "User Property Usage";
+ [ColorDescription(UserPropertyUsageKey, VSSetting = "Identifier")]
public ChunkStyle UserPropertyUsage { get; private set; }
- [ColorDescription("User Property Declaration", VSSetting = "Identifier")]
+ public const string UserPropertyDeclarationKey = "User Property Declaration";
+ [ColorDescription(UserPropertyDeclarationKey, VSSetting = "Identifier")]
public ChunkStyle UserPropertyDeclaration { get; private set; }
- [ColorDescription("User Event Usage", VSSetting = "Identifier")]
+ public const string UserEventUsageKey = "User Event Usage";
+ [ColorDescription(UserEventUsageKey, VSSetting = "Identifier")]
public ChunkStyle UserEventUsage { get; private set; }
- [ColorDescription("User Event Declaration", VSSetting = "Identifier")]
+ public const string UserEventDeclarationKey = "User Event Declaration";
+ [ColorDescription(UserEventDeclarationKey, VSSetting = "Identifier")]
public ChunkStyle UserEventDeclaration { get; private set; }
- [ColorDescription("User Method Usage", VSSetting = "Identifier")]
+ public const string UserMethodUsageKey = "User Method Usage";
+ [ColorDescription(UserMethodUsageKey, VSSetting = "Identifier")]
public ChunkStyle UserMethodUsage { get; private set; }
- [ColorDescription("User Method Declaration", VSSetting = "Identifier")]
+ public const string UserMethodDeclarationKey = "User Method Declaration";
+ [ColorDescription(UserMethodDeclarationKey, VSSetting = "Identifier")]
public ChunkStyle UserMethodDeclaration { get; private set; }
- [ColorDescription("User Parameter Usage", VSSetting = "Identifier")]
+ public const string UserParameterUsageKey = "User Parameter Usage";
+ [ColorDescription(UserParameterUsageKey, VSSetting = "Identifier")]
public ChunkStyle UserParameterUsage { get; private set; }
- [ColorDescription("User Parameter Declaration", VSSetting = "Identifier")]
+ public const string UserParameterDeclarationKey = "User Parameter Declaration";
+ [ColorDescription(UserParameterDeclarationKey, VSSetting = "Identifier")]
public ChunkStyle UserParameterDeclaration { get; private set; }
- [ColorDescription("User Variable Usage", VSSetting = "Identifier")]
+ public const string UserVariableUsageKey = "User Variable Usage";
+ [ColorDescription(UserVariableUsageKey, VSSetting = "Identifier")]
public ChunkStyle UserVariableUsage { get; private set; }
- [ColorDescription("User Variable Declaration", VSSetting = "Identifier")]
+ public const string UserVariableDeclarationKey = "User Variable Declaration";
+ [ColorDescription(UserVariableDeclarationKey, VSSetting = "Identifier")]
public ChunkStyle UserVariableDeclaration { get; private set; }
- [ColorDescription("Syntax Error", VSSetting = "Syntax Error")]
+ public const string SyntaxErrorKey = "Syntax Error";
+ [ColorDescription(SyntaxErrorKey, VSSetting = "Syntax Error")]
public ChunkStyle SyntaxError { get; private set; }
- [ColorDescription("String Format Items", VSSetting = "String")]
+ public const string StringFormatItemsKey = "String Format Items";
+ [ColorDescription(StringFormatItemsKey, VSSetting = "String")]
public ChunkStyle StringFormatItems { get; private set; }
- [ColorDescription("Breakpoint Text", VSSetting = "Breakpoint (Enabled)")]
+ public const string BreakpointTextKey = "Breakpoint Text";
+ [ColorDescription(BreakpointTextKey, VSSetting = "Breakpoint (Enabled)")]
public ChunkStyle BreakpointText { get; private set; }
- [ColorDescription("Debugger Current Statement", VSSetting = "Current Statement")]
+ public const string DebuggerCurrentLineKey = "Debugger Current Statement";
+ [ColorDescription(DebuggerCurrentLineKey, VSSetting = "Current Statement")]
public ChunkStyle DebuggerCurrentLine { get; private set; }
- [ColorDescription("Debugger Stack Line")] // not defined
+ public const string DebuggerStackLineKey = "Debugger Stack Line";
+ [ColorDescription(DebuggerStackLineKey)] // not defined
public ChunkStyle DebuggerStackLine { get; private set; }
- [ColorDescription("Diff Line(Added)")] //not defined
+ public const string DiffLineAddedKey = "Diff Line(Added)";
+ [ColorDescription(DiffLineAddedKey)] //not defined
public ChunkStyle DiffLineAdded { get; private set; }
- [ColorDescription("Diff Line(Removed)")] //not defined
+ public const string DiffLineRemovedKey = "Diff Line(Removed)";
+ [ColorDescription(DiffLineRemovedKey)] //not defined
public ChunkStyle DiffLineRemoved { get; private set; }
- [ColorDescription("Diff Line(Changed)")] //not defined
+ public const string DiffLineChangedKey = "Diff Line(Changed)";
+ [ColorDescription(DiffLineChangedKey)] //not defined
public ChunkStyle DiffLineChanged { get; private set; }
- [ColorDescription("Diff Header")] //not defined
+ public const string DiffHeaderKey = "Diff Header";
+ [ColorDescription(DiffHeaderKey)] //not defined
public ChunkStyle DiffHeader { get; private set; }
- [ColorDescription("Diff Header(Separator)")] //not defined
+ public const string DiffHeaderSeparatorKey = "Diff Header(Separator)";
+ [ColorDescription(DiffHeaderSeparatorKey)] //not defined
public ChunkStyle DiffHeaderSeparator { get; private set; }
- [ColorDescription("Diff Header(Old)")] //not defined
+ public const string DiffHeaderOldKey = "Diff Header(Old)";
+ [ColorDescription(DiffHeaderOldKey)] //not defined
public ChunkStyle DiffHeaderOld { get; private set; }
- [ColorDescription("Diff Header(New)")] //not defined
+ public const string DiffHeaderNewKey = "Diff Header(New)";
+ [ColorDescription(DiffHeaderNewKey)] //not defined
public ChunkStyle DiffHeaderNew { get; private set; }
- [ColorDescription("Diff Location")] //not defined
+ public const string DiffLocationKey = "Diff Location";
+ [ColorDescription(DiffLocationKey)] //not defined
public ChunkStyle DiffLocation { get; private set; }
- [ColorDescription("Html Attribute Name", VSSetting="HTML Attribute")]
+ public const string HtmlAttributeNameKey = "Html Attribute Name";
+ [ColorDescription(HtmlAttributeNameKey, VSSetting="HTML Attribute")]
public ChunkStyle HtmlAttributeName { get; private set; }
-
- [ColorDescription("Html Attribute Value", VSSetting="HTML Attribute Value")]
+
+ public const string HtmlAttributeValueKey = "Html Attribute Value";
+ [ColorDescription(HtmlAttributeValueKey, VSSetting="HTML Attribute Value")]
public ChunkStyle HtmlAttributeValue { get; private set; }
- [ColorDescription("Html Comment", VSSetting="HTML Comment")]
+ public const string HtmlCommentKey = "Html Comment";
+ [ColorDescription(HtmlCommentKey, VSSetting="HTML Comment")]
public ChunkStyle HtmlComment { get; private set; }
- [ColorDescription("Html Element Name", VSSetting="HTML Element Name")]
+ public const string HtmlElementNameKey = "Html Element Name";
+ [ColorDescription(HtmlElementNameKey, VSSetting="HTML Element Name")]
public ChunkStyle HtmlElementName { get; private set; }
- [ColorDescription("Html Entity", VSSetting="HTML Entity")]
+ public const string HtmlEntityKey = "Html Entity";
+ [ColorDescription(HtmlEntityKey, VSSetting="HTML Entity")]
public ChunkStyle HtmlEntity { get; private set; }
- [ColorDescription("Html Operator", VSSetting="HTML Operator")]
+ public const string HtmlOperatorKey = "Html Operator";
+ [ColorDescription(HtmlOperatorKey, VSSetting="HTML Operator")]
public ChunkStyle HtmlOperator { get; private set; }
- [ColorDescription("Html Server-Side Script", VSSetting="HTML Server-Side Script")]
+ public const string HtmlServerSideScriptKey = "Html Server-Side Script";
+ [ColorDescription(HtmlServerSideScriptKey, VSSetting="HTML Server-Side Script")]
public ChunkStyle HtmlServerSideScript { get; private set; }
- [ColorDescription("Html Tag Delimiter", VSSetting="HTML Tag Delimiter")]
+ public const string HtmlTagDelimiterKey = "Html Tag Delimiter";
+ [ColorDescription(HtmlTagDelimiterKey, VSSetting="HTML Tag Delimiter")]
public ChunkStyle HtmlTagDelimiter { get; private set; }
- [ColorDescription("Razor Code", VSSetting="Razor Code")]
+ public const string RazorCodeKey = "Razor Code";
+ [ColorDescription(RazorCodeKey, VSSetting="Razor Code")]
public ChunkStyle RazorCode { get; private set; }
- [ColorDescription("Css Comment", VSSetting="CSS Comment")]
+ public const string CssCommentKey = "Css Comment";
+ [ColorDescription(CssCommentKey, VSSetting="CSS Comment")]
public ChunkStyle CssComment { get; private set; }
- [ColorDescription("Css Property Name", VSSetting="CSS Property Name")]
+ public const string CssPropertyNameKey = "Css Property Name";
+ [ColorDescription(CssPropertyNameKey, VSSetting="CSS Property Name")]
public ChunkStyle CssPropertyName { get; private set; }
- [ColorDescription("Css Property Value", VSSetting="CSS Property Value")]
+ public const string CssPropertyValueKey = "Css Property Value";
+ [ColorDescription(CssPropertyValueKey, VSSetting="CSS Property Value")]
public ChunkStyle CssPropertyValue { get; private set; }
- [ColorDescription("Css Selector", VSSetting="CSS Selector")]
+ public const string CssSelectorKey = "Css Selector";
+ [ColorDescription(CssSelectorKey, VSSetting="CSS Selector")]
public ChunkStyle CssSelector { get; private set; }
- [ColorDescription("Css String Value", VSSetting="CSS String Value")]
+ public const string CssStringValueKey = "Css String Value";
+ [ColorDescription(CssStringValueKey, VSSetting="CSS String Value")]
public ChunkStyle CssStringValue { get; private set; }
- [ColorDescription("Css Keyword", VSSetting="CSS Keyword")]
+ public const string CssKeywordKey = "Css Keyword";
+ [ColorDescription(CssKeywordKey, VSSetting="CSS Keyword")]
public ChunkStyle CssKeyword { get; private set; }
- [ColorDescription("Script Comment", VSSetting="Script Comment")]
+ public const string ScriptCommentKey = "Script Comment";
+ [ColorDescription(ScriptCommentKey, VSSetting="Script Comment")]
public ChunkStyle ScriptComment { get; private set; }
- [ColorDescription("Script Identifier", VSSetting="Script Identifier")]
+ public const string ScriptIdentifierKey = "Script Identifier";
+ [ColorDescription(ScriptIdentifierKey, VSSetting="Script Identifier")]
public ChunkStyle ScriptIdentifier { get; private set; }
- [ColorDescription("Script Keyword", VSSetting="Script Keyword")]
+ public const string ScriptKeywordKey = "Script Keyword";
+ [ColorDescription(ScriptKeywordKey, VSSetting="Script Keyword")]
public ChunkStyle ScriptKeyword { get; private set; }
- [ColorDescription("Script Number", VSSetting="Script Number")]
+ public const string ScriptNumberKey = "Script Number";
+ [ColorDescription(ScriptNumberKey, VSSetting="Script Number")]
public ChunkStyle ScriptNumber { get; private set; }
- [ColorDescription("Script Operator", VSSetting="Script Operator")]
+ public const string ScriptOperatorKey = "Script Operator";
+ [ColorDescription(ScriptOperatorKey, VSSetting="Script Operator")]
public ChunkStyle ScriptOperator { get; private set; }
- [ColorDescription("Script String", VSSetting="Script String")]
+ public const string ScriptStringKey = "Script String";
+ [ColorDescription(ScriptStringKey, VSSetting="Script String")]
public ChunkStyle ScriptString { get; private set; }
+ public const string RegexSetConstructsKey = "String(Regex Set Constructs)";
+ [ColorDescription(RegexSetConstructsKey)]
+ public ChunkStyle RegexSetConstructs { get; private set; }
+
+ public const string RegexCharacterClassKey = "String(Regex Character Class)";
+ [ColorDescription(RegexCharacterClassKey)]
+ public ChunkStyle RegexCharacterClass { get; private set; }
+
+ public const string RegexGroupingConstructsKey = "String(Regex Grouping Constructs)";
+ [ColorDescription(RegexGroupingConstructsKey)]
+ public ChunkStyle RegexGroupingConstructs { get; private set; }
+
+ public const string RegexEscapeCharacterKey = "String(Regex Escape Character)";
+ [ColorDescription(RegexEscapeCharacterKey)]
+ public ChunkStyle RegexEscapeCharacter { get; private set; }
+
+ public const string RegexAltEscapeCharacterKey = "String(Regex Alt Escape Character)";
+ [ColorDescription(RegexAltEscapeCharacterKey)]
+ public ChunkStyle RegexAltEscapeCharacter { get; private set; }
#endregion
- public class PropertyDecsription
+ public sealed class PropertyDescription
{
public readonly PropertyInfo Info;
public readonly ColorDescriptionAttribute Attribute;
- public PropertyDecsription (PropertyInfo info, ColorDescriptionAttribute attribute)
+ public PropertyDescription (PropertyInfo info, ColorDescriptionAttribute attribute)
{
this.Info = info;
this.Attribute = attribute;
}
}
- static Dictionary<string, PropertyDecsription> textColors = new Dictionary<string, PropertyDecsription> ();
+ static Dictionary<string, PropertyDescription> textColors = new Dictionary<string, PropertyDescription> ();
- public static IEnumerable<PropertyDecsription> TextColors {
+ public static IEnumerable<PropertyDescription> TextColors {
get {
return textColors.Values;
}
}
- static Dictionary<string, PropertyDecsription> ambientColors = new Dictionary<string, PropertyDecsription> ();
+ static Dictionary<string, PropertyDescription> ambientColors = new Dictionary<string, PropertyDescription> ();
- public static IEnumerable<PropertyDecsription> AmbientColors {
+ public static IEnumerable<PropertyDescription> AmbientColors {
get {
return ambientColors.Values;
}
@@ -543,9 +705,9 @@ namespace Mono.TextEditor.Highlighting
if (description == null)
continue;
if (property.PropertyType == typeof (ChunkStyle)) {
- textColors.Add (description.Name, new PropertyDecsription (property, description));
+ textColors.Add (description.Name, new PropertyDescription (property, description));
} else {
- ambientColors.Add (description.Name, new PropertyDecsription (property, description));
+ ambientColors.Add (description.Name, new PropertyDescription (property, description));
}
}
}
@@ -591,7 +753,7 @@ namespace Mono.TextEditor.Highlighting
{
if (color == null)
return GetChunkStyle ("Plain Text");
- PropertyDecsription val;
+ PropertyDescription val;
if (!textColors.TryGetValue (color, out val)) {
Console.WriteLine ("Chunk style : " + color + " is undefined.");
return GetChunkStyle ("Plain Text");
@@ -610,7 +772,12 @@ namespace Mono.TextEditor.Highlighting
public static ColorScheme LoadFrom (Stream stream)
{
var result = new ColorScheme ();
- var reader = System.Runtime.Serialization.Json.JsonReaderWriterFactory.CreateJsonReader (stream, new System.Xml.XmlDictionaryReaderQuotas ());
+ byte [] bytes;
+ using (var sr = TextFileUtility.OpenStream (stream)) {
+ bytes = System.Text.Encoding.UTF8.GetBytes (sr.ReadToEnd ());
+ }
+
+ var reader = System.Runtime.Serialization.Json.JsonReaderWriterFactory.CreateJsonReader (bytes, new System.Xml.XmlDictionaryReaderQuotas ());
var root = XElement.Load(reader);
@@ -621,8 +788,10 @@ namespace Mono.TextEditor.Highlighting
result.CopyValues (SyntaxModeService.DefaultColorStyle);
var version = Version.Parse (root.XPathSelectElement("version").Value);
- if (version.Major != 1)
+ if (version.Major != 1) {
+ Console.WriteLine ("Can't load scheme : " + result.Name + " unsupported version:" + version);
return null;
+ }
var el = root.XPathSelectElement ("description");
if (el != null)
result.Description = el.Value;
@@ -652,7 +821,7 @@ namespace Mono.TextEditor.Highlighting
foreach (var colorElement in root.XPathSelectElements("//colors/*")) {
var color = AmbientColor.Create (colorElement, palette);
- PropertyDecsription info;
+ PropertyDescription info;
if (!ambientColors.TryGetValue (color.Name, out info)) {
Console.WriteLine ("Ambient color:" + color.Name + " not found.");
continue;
@@ -662,7 +831,7 @@ namespace Mono.TextEditor.Highlighting
foreach (var textColorElement in root.XPathSelectElements("//text/*")) {
var color = ChunkStyle.Create (textColorElement, palette);
- PropertyDecsription info;
+ PropertyDescription info;
if (!textColors.TryGetValue (color.Name, out info)) {
Console.WriteLine ("Text color:" + color.Name + " not found.");
continue;
@@ -805,7 +974,7 @@ namespace Mono.TextEditor.Highlighting
return HslColor.Parse (color);
}
- public class VSSettingColor
+ public sealed class VSSettingColor
{
public string Name { get; private set; }
public string Foreground { get; private set; }
@@ -892,6 +1061,9 @@ namespace Mono.TextEditor.Highlighting
Console.WriteLine (vsc.Name + " not imported!");
}
+ if (result.PlainText == null)
+ throw new StyleImportException (StyleImportException.ImportFailReason.NoValidColorsFound);
+
result.IndentationGuide = new AmbientColor ();
result.IndentationGuide.Colors.Add (Tuple.Create ("color", AlphaBlend (result.PlainText.Foreground, result.PlainText.Background, 0.3)));
@@ -900,18 +1072,12 @@ namespace Mono.TextEditor.Highlighting
h.L += 0.01;
result.TooltipText.Background = h;
- result.TooltipPagerTop = new AmbientColor ();
- result.TooltipPagerTop.Colors.Add (Tuple.Create ("color", result.TooltipText.Background));
+ result.TooltipPager = new AmbientColor ();
+ result.TooltipPager.Colors.Add (Tuple.Create ("color", result.TooltipText.Background));
- result.TooltipPagerBottom = new AmbientColor ();
- result.TooltipPagerBottom.Colors.Add (Tuple.Create ("color", result.TooltipText.Background));
-
result.TooltipPagerTriangle = new AmbientColor ();
result.TooltipPagerTriangle.Colors.Add (Tuple.Create ("color", AlphaBlend (result.PlainText.Foreground, result.PlainText.Background, 0.8)));
- result.TooltipBorder = new AmbientColor ();
- result.TooltipBorder.Colors.Add (Tuple.Create ("color", AlphaBlend (result.PlainText.Foreground, result.PlainText.Background, 0.5)));
-
var defaultStyle = SyntaxModeService.GetColorStyle (HslColor.Brightness (result.PlainText.Background) < 0.5 ? "Monokai" : TextEditorOptions.DefaultColorStyle);
foreach (var color in textColors.Values) {
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SemanticRule.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SemanticRule.cs
index 6fb63701a5..139ba9c29d 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SemanticRule.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SemanticRule.cs
@@ -56,7 +56,7 @@ namespace Mono.TextEditor
{
if (endOffset <= startOffset || startOffset >= doc.TextLength || inUpdate)
return;
- if (startChunk.Style != "Comment(Line)" && startChunk.Style != "Comment(Block)")
+ if (startChunk.Style != Highlighting.ColorScheme.CommentsSingleLineKey && startChunk.Style != Highlighting.ColorScheme.CommentsBlockKey)
return;
inUpdate = true;
try {
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxMode.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxMode.cs
index 0d9ecc76fb..183ff04be8 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxMode.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxMode.cs
@@ -38,7 +38,7 @@ namespace Mono.TextEditor.Highlighting
{
protected TextDocument doc;
- public TextDocument Document {
+ public virtual TextDocument Document {
get {
return doc;
}
@@ -226,6 +226,8 @@ namespace Mono.TextEditor.Highlighting
}
}
+ Stack<int> interpolatedBraces = new Stack<int> ();
+
public Stack<Rule> RuleStack {
get {
return ruleStack;
@@ -286,6 +288,8 @@ namespace Mono.TextEditor.Highlighting
ruleStack.Push (rule);
CurRule = rule;
CurSpan = span;
+ if (rule.Name == "InterpolatedString" || rule.Name == "InterpolatedVerbatimString")
+ interpolatedBraces.Push(0);
}
public Span PopSpan ()
@@ -294,8 +298,13 @@ namespace Mono.TextEditor.Highlighting
if (spanStack.Count > 0) {
result = spanStack.Pop ();
}
- if (ruleStack.Count > 1)
- ruleStack.Pop ();
+ if (ruleStack.Count > 1) {
+ var poppedRule = ruleStack.Pop ();
+ if (poppedRule.Name == "InterpolatedString" || poppedRule.Name == "InterpolatedVerbatimString") {
+ if (interpolatedBraces.Count > 0)
+ interpolatedBraces.Pop();
+ }
+ }
CurRule = ruleStack.Peek ();
CurSpan = spanStack.Count > 0 ? spanStack.Peek () : null;
return result;
@@ -373,6 +382,7 @@ namespace Mono.TextEditor.Highlighting
}
if (mismatch)
continue;
+
FoundSpanBegin (span, i, match.Length);
i += System.Math.Max (0, match.Length - 1);
return true;
@@ -385,6 +395,15 @@ namespace Mono.TextEditor.Highlighting
int textOffset = i - StartOffset;
if (cur.End != null) {
+ if (interpolatedBraces.Count > 0) {
+ char ch = CurText [textOffset];
+ if (ch == '{')
+ interpolatedBraces.Push (interpolatedBraces.Pop () + 1);
+ else if (ch == '}')
+ interpolatedBraces.Push (interpolatedBraces.Pop () - 1);
+ if (interpolatedBraces.Peek () >= 1)
+ return false;
+ }
RegexMatch match = cur.End.TryMatch (CurText, textOffset);
if (match.Success) {
FoundSpanEnd (cur, i, match.Length);
@@ -743,6 +762,9 @@ namespace Mono.TextEditor.Highlighting
string extends = reader.GetAttribute ("extends");
if (!String.IsNullOrEmpty (extends)) {
result = (SyntaxMode)SyntaxModeService.GetSyntaxMode (null, extends).MemberwiseClone ();
+ spanList.AddRange (result.spans);
+ prevMarkerList.AddRange (result.prevMarker);
+ matches.AddRange (result.matches);
}
result.Name = reader.GetAttribute ("name");
result.MimeType = reader.GetAttribute (MimeTypesAttribute);
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs
index 0b74632ea2..27b4aa3146 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs
@@ -65,18 +65,20 @@ namespace Mono.TextEditor.Highlighting
syntaxModeLookup.Remove (mimeType);
syntaxModes[mimeType] = modeProvider;
}
-
+
+
public static ColorScheme GetColorStyle (string name)
{
- if (styles.ContainsKey (name))
- return styles [name];
if (styleLookup.ContainsKey (name)) {
LoadStyle (name);
- return GetColorStyle (name);
}
- return GetColorStyle (TextEditorOptions.DefaultColorStyle);
+ if (!styles.ContainsKey (name))
+ name = TextEditorOptions.DefaultColorStyle;
+ if (!styles.ContainsKey (name))
+ return null;
+ return styles [name];
}
-
+
public static IStreamProvider GetProvider (SyntaxMode mode)
{
foreach (string mimeType in mode.MimeType.Split (';')) {
@@ -124,6 +126,8 @@ namespace Mono.TextEditor.Highlighting
styles [name] = ColorScheme.LoadFrom (stream);
}
styleLookup.Remove (name);
+ } catch (StyleImportException) {
+ throw;
} catch (Exception e) {
throw new IOException ("Error while loading style :" + name, e);
} finally {
@@ -487,9 +491,10 @@ namespace Mono.TextEditor.Highlighting
static string ScanStyle (Stream stream)
{
try {
- var file = new StreamReader (stream);
+ var file = Utils.TextFileUtility.OpenStream (stream);
file.ReadLine ();
var nameLine = file.ReadLine ();
+ file.Close ();
var match = nameRegex.Match (nameLine);
if (!match.Success)
return null;
@@ -551,7 +556,10 @@ namespace Mono.TextEditor.Highlighting
public static ColorScheme DefaultColorStyle {
get {
- return GetColorStyle (TextEditorOptions.DefaultColorStyle);
+ var defaultStyle = GetColorStyle (TextEditorOptions.DefaultColorStyle);
+ if (defaultStyle == null)
+ Console.WriteLine ("Default style {0} can't be loaded.", TextEditorOptions.DefaultColorStyle);
+ return defaultStyle;
}
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs
index 2c780a2924..8908df070f 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.PopupWindow/ModeHelpWindow.cs
@@ -58,12 +58,12 @@ namespace Mono.TextEditor.PopupWindow
void CheckScreenColormap ()
{
- SupportsAlpha = Screen.IsComposited;
- if (SupportsAlpha) {
- Colormap = Screen.RgbaColormap;
- } else {
+ Colormap = Screen.RgbaColormap;
+ if (Colormap == null) {
Colormap = Screen.RgbColormap;
- }
+ SupportsAlpha = false;
+ } else
+ SupportsAlpha = true;
}
protected override void OnScreenChanged (Gdk.Screen previous_screen)
@@ -128,14 +128,7 @@ namespace Mono.TextEditor.PopupWindow
const int yBorder = 2;
protected override bool OnExposeEvent (Gdk.EventExpose args)
- {
- Cairo.Color bgColor = new Cairo.Color (1, 1, 1);
- Cairo.Color titleBgColor = new Cairo.Color (0.88, 0.88, 0.98);
- Cairo.Color categoryBgColor = new Cairo.Color (0.58, 0.58, 0.98);
- Cairo.Color borderColor = new Cairo.Color (0.4, 0.4, 0.6);
- Cairo.Color textColor = new Cairo.Color (0.3, 0.3, 1);
- Cairo.Color gridColor = new Cairo.Color (0.8, 0.8, 0.8);
-
+ {
using (var g = Gdk.CairoHelper.Create (args.Window)) {
g.Translate (Allocation.X, Allocation.Y);
g.LineWidth = 1;
@@ -146,26 +139,26 @@ namespace Mono.TextEditor.PopupWindow
layout.GetPixelSize (out width, out height);
width += xBorder * 2;
FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, true, false, 0.5, 0.5, height + yBorder * 2 + 1.5, width, height + yBorder * 2);
- g.SetSourceColor (titleBgColor);
+ g.SetSourceColor (Styles.TableLayoutModeTitleBackgroundColor.ToCairoColor ());
g.FillPreserve ();
- g.SetSourceColor (borderColor);
+ g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ());
g.Stroke ();
g.Save ();
- g.SetSourceColor (textColor);
+ g.SetSourceColor (Styles.TableLayoutModeTextColor.ToCairoColor ());
g.Translate (xBorder, yBorder);
g.ShowLayout (layout);
g.Restore ();
FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, false, true, 0.5, height * 2 + yBorder * 2 + 0.5, height, Allocation.Width - 1, Allocation.Height - height * 2 - yBorder * 2 - 1);
- g.SetSourceColor (bgColor);
+ g.SetSourceColor (Styles.TableLayoutModeBackgroundColor.ToCairoColor ());
g.FillPreserve ();
- g.SetSourceColor (borderColor);
+ g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ());
g.Stroke ();
g.MoveTo (xSpacer + 0.5, height * 2 + yBorder * 2);
g.LineTo (xSpacer + 0.5, Allocation.Height - 1);
- g.SetSourceColor (gridColor);
+ g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ());
g.Stroke ();
int y = height + yBorder * 2;
@@ -178,26 +171,26 @@ namespace Mono.TextEditor.PopupWindow
if (i == 0) {
FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, false, true, false, false, 0, y + 0.5, height + 1.5, Allocation.Width, height);
- g.SetSourceColor (categoryBgColor);
+ g.SetSourceColor (Styles.TableLayoutModeCategoryBackgroundColor.ToCairoColor ());
g.FillPreserve ();
- g.SetSourceColor (borderColor);
+ g.SetSourceColor (Styles.TableLayoutModeBorderColor.ToCairoColor ());
g.Stroke ();
g.MoveTo (xSpacer + 0.5, height + yBorder * 2 + 1);
g.LineTo (xSpacer + 0.5, height * 2 + yBorder * 2 + 1);
- g.SetSourceColor (gridColor);
+ g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ());
g.Stroke ();
}
- gc.RgbFgColor = (HslColor)(i == 0 ? bgColor : textColor);
+ gc.RgbFgColor = (HslColor)(i == 0 ? Styles.TableLayoutModeBackgroundColor : Styles.TableLayoutModeTextColor).ToCairoColor ();
g.Save ();
- g.SetSourceColor (textColor);
+ g.SetSourceColor (Styles.TableLayoutModeTextColor.ToCairoColor ());
g.Translate (xBorder, y);
g.ShowLayout (layout);
g.Restore ();
g.Save ();
- g.SetSourceColor (textColor);
+ g.SetSourceColor (Styles.TableLayoutModeTextColor.ToCairoColor ());
g.Translate (xSpacer + xBorder, y);
layout.SetMarkup (pair.Value);
g.ShowLayout (layout);
@@ -207,7 +200,7 @@ namespace Mono.TextEditor.PopupWindow
if (i > 0) {
g.MoveTo (1, y + 0.5);
g.LineTo (Allocation.Width - 1, y + 0.5);
- g.SetSourceColor (gridColor);
+ g.SetSourceColor (Styles.TableLayoutModeGridColor.ToCairoColor ());
g.Stroke ();
}
y += height;
@@ -231,8 +224,6 @@ namespace Mono.TextEditor.PopupWindow
const int outlinedFontSize = 8;
const int outlinePadding = 1;
const int textInnerPadding = 1;
- static readonly Cairo.Color outlineColor = HslColor.Parse ("#666666");
- static readonly Cairo.Color textColor = HslColor.Parse ("#555555");
Pango.Layout layout;
SymbolTokenType Symbol;
@@ -293,7 +284,7 @@ namespace Mono.TextEditor.PopupWindow
cr.MoveTo (x, y);
cr.LineWidth = 1;
- cr.SetSourceColor (outlineColor);
+ cr.SetSourceColor (Styles.ModeHelpWindowTokenOutlineColor.ToCairoColor());
if (Symbol == SymbolTokenType.None)
inner_padding = textInnerPadding;
@@ -316,7 +307,7 @@ namespace Mono.TextEditor.PopupWindow
}
} else {
cr.MoveTo (x, y);
- cr.SetSourceColor (textColor);
+ cr.SetSourceColor (Styles.ModeHelpWindowTokenTextColor.ToCairoColor());
cr.ShowLayout (layout);
}
}
@@ -432,7 +423,7 @@ namespace Mono.TextEditor.PopupWindow
int h2 = descTexts.Sum (x => x.Height + x.Spacing);
int w2 = descTexts.Max (x => x.Width + x.Spacing * 2);
- totalHeight += h2;
+ totalHeight += h2 + 4;
xSpacer = System.Math.Max (width, w2);
xSpacer += xDescriptionBorder * 2 + 1;
@@ -459,10 +450,6 @@ namespace Mono.TextEditor.PopupWindow
const int xDescriptionBorder = 12;
const int yDescriptionBorder = 8;
const int yTitleBorder = 8;
- static readonly Cairo.Color bgColor = HslColor.Parse ("#f2f2f2");
- static readonly Cairo.Color titleTextColor = HslColor.Parse ("#242424");
- static readonly Cairo.Color borderColor = HslColor.Parse ("#d5d5d5");
- static readonly Cairo.Color textColor = HslColor.Parse ("#4c4c4c");
protected override bool OnExposeEvent (Gdk.EventExpose args)
{
@@ -479,16 +466,16 @@ namespace Mono.TextEditor.PopupWindow
if (SupportsAlpha) {
FoldingScreenbackgroundRenderer.DrawRoundRectangle (g, true, true, tw + 0.5, 0.5, 12, Allocation.Width - 1 - tw, Allocation.Height);
} else {
- g.Rectangle (0, 0, Allocation.Width, height + yTitleBorder * 2);
+ g.Rectangle (0, 0, Allocation.Width, Allocation.Height);
}
- g.SetSourceColor (bgColor);
+ g.SetSourceColor (Styles.InsertionCursorBackgroundColor.ToCairoColor ());
g.FillPreserve ();
- g.SetSourceColor (borderColor);
+ g.SetSourceColor (Styles.InsertionCursorBorderColor.ToCairoColor ());
g.Stroke ();
g.MoveTo (tw + xDescriptionBorder, yTitleBorder);
- g.SetSourceColor (titleTextColor);
+ g.SetSourceColor (Styles.InsertionCursorTitleTextColor.ToCairoColor ());
g.ShowLayout (titleLayout);
if (SupportsAlpha) {
@@ -498,19 +485,19 @@ namespace Mono.TextEditor.PopupWindow
g.LineTo (tw + 5, Allocation.Height / 2 + th / 2);
g.LineTo (tw + 5, Allocation.Height / 2 - th / 2);
g.ClosePath ();
- g.SetSourceColor (bgColor);
+ g.SetSourceColor (Styles.InsertionCursorBackgroundColor.ToCairoColor ());
g.Fill ();
g.MoveTo (tw, Allocation.Height / 2 - th / 2);
g.LineTo (0, Allocation.Height / 2);
g.LineTo (tw, Allocation.Height / 2 + th / 2);
- g.SetSourceColor (borderColor);
+ g.SetSourceColor (Styles.InsertionCursorBorderColor.ToCairoColor ());
g.Stroke ();
}
int y = height + yTitleBorder + yDescriptionBorder;
int x = tw + xDescriptionBorder;
- g.SetSourceColor (textColor);
+ g.SetSourceColor (Styles.InsertionCursorTextColor.ToCairoColor ());
foreach (var desc in descTexts) {
desc.Render (g, x, y + 4);
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs
index 6fc42b0782..8f74963df2 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Theatrics/BounceFadePopupWindow.cs
@@ -37,12 +37,12 @@ namespace Mono.TextEditor.Theatrics
{
Stage<BounceFadePopupWindow> stage = new Stage<BounceFadePopupWindow> ();
Gdk.Pixbuf textImage = null;
- TextEditor editor;
+ MonoTextEditor editor;
protected double scale = 0.0;
protected double opacity = 1.0;
- public BounceFadePopupWindow (TextEditor editor) : base (Gtk.WindowType.Popup)
+ public BounceFadePopupWindow (MonoTextEditor editor) : base (Gtk.WindowType.Popup)
{
if (!IsComposited)
throw new InvalidOperationException ("Only works with composited screen. Check Widget.IsComposited.");
@@ -69,7 +69,7 @@ namespace Mono.TextEditor.Theatrics
stage.UpdateFrequency = 10;
}
- protected TextEditor Editor { get { return editor; } }
+ protected MonoTextEditor Editor { get { return editor; } }
/// <summary>Duration of the animation, in milliseconds.</summary>
public uint Duration { get; set; }
@@ -227,12 +227,12 @@ namespace Mono.TextEditor.Theatrics
{
Stage<BounceFadePopupWidget> stage = new Stage<BounceFadePopupWidget> ();
Gdk.Pixbuf textImage = null;
- TextEditor editor;
+ MonoTextEditor editor;
protected double scale = 0.0;
protected double opacity = 1.0;
- public BounceFadePopupWidget (TextEditor editor)
+ public BounceFadePopupWidget (MonoTextEditor editor)
{
if (!IsComposited)
throw new InvalidOperationException ("Only works with composited screen. Check Widget.IsComposited.");
@@ -256,7 +256,7 @@ namespace Mono.TextEditor.Theatrics
stage.UpdateFrequency = 10;
}
- protected TextEditor Editor { get { return editor; } }
+ protected MonoTextEditor Editor { get { return editor; } }
/// <summary>Duration of the animation, in milliseconds.</summary>
public uint Duration { get; set; }
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/AvlTree.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/AvlTree.cs
deleted file mode 100644
index e067da2a73..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/AvlTree.cs
+++ /dev/null
@@ -1,774 +0,0 @@
-//
-// AvlTree.cs
-//
-// Author:
-// Andrea Krüger <andrea.krueger77@googlemail.com>
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace Mono.TextEditor.Utils
-{
- interface IAvlNode
- {
- IAvlNode Parent { get; set; }
-
- IAvlNode Left { get; set; }
-
- IAvlNode Right { get; set; }
-
- sbyte Balance { get; set; }
-
- void UpdateAugmentedData ();
- }
-
- class AvlTree<T> : ICollection<T> where T : class, IAvlNode
- {
- readonly Func<T, T, int> comparisonFunc;
-
- public T Root { get; set; }
-
- public AvlTree () : this (Comparer<T>.Default)
- {
- }
-
- public AvlTree (IComparer<T> comparer)
- {
- if (comparer == null)
- throw new ArgumentNullException ("comparer");
- this.comparisonFunc = comparer.Compare;
- }
-
- public AvlTree (Func<T, T, int> comparisonFunc)
- {
- if (comparisonFunc == null)
- throw new ArgumentNullException ("comparisonFunc");
- this.comparisonFunc = comparisonFunc;
- }
-
- public void InsertLeft (IAvlNode parentNode, IAvlNode newNode)
- {
- if (parentNode == null)
- throw new ArgumentNullException ("parentNode");
- if (newNode == null)
- throw new ArgumentNullException ("newNode");
- parentNode.Left = newNode;
- newNode.Parent = parentNode;
- InsertBalanceTree (parentNode, -1);
- parentNode.UpdateAugmentedData ();
- Count++;
- }
-
- public void InsertRight (IAvlNode parentNode, IAvlNode newNode)
- {
- if (parentNode == null)
- throw new ArgumentNullException ("parentNode");
- if (newNode == null)
- throw new ArgumentNullException ("newNode");
- parentNode.Right = newNode;
- newNode.Parent = parentNode;
- InsertBalanceTree (parentNode, 1);
- parentNode.UpdateAugmentedData ();
- Count++;
- }
-
- public void InsertBefore (IAvlNode node, IAvlNode newNode)
- {
- if (node == null)
- throw new ArgumentNullException ("node");
- if (newNode == null)
- throw new ArgumentNullException ("newNode");
- if (node.Left == null) {
- InsertLeft (node, newNode);
- } else {
- InsertRight (node.Left.AvlGetOuterRight (), newNode);
- }
- }
-
- public void InsertAfter (IAvlNode node, T newNode)
- {
- if (node == null)
- throw new ArgumentNullException ("node");
- if (newNode == null)
- throw new ArgumentNullException ("newNode");
- if (node.Right == null) {
- InsertRight (node, newNode);
- } else {
- InsertLeft (node.Right.AvlGetOuterLeft (), newNode);
- }
- }
-
- #region ICollection implementation
-
- public void Add (T node)
- {
- if (node == null)
- throw new ArgumentNullException ("node");
- if (Root == null) {
- Root = node;
- Count = 1;
- return;
- }
- T currentNode = Root;
- while (currentNode != null) {
- if (comparisonFunc (currentNode, node) < 0) {
- if (currentNode.Right == null) {
- InsertRight (currentNode, node);
- break;
- }
- currentNode = (T)currentNode.Right;
- } else {
- if (currentNode.Left == null) {
- InsertLeft (currentNode, node);
- break;
- }
- currentNode = (T)currentNode.Left;
- }
- }
- }
-
- public void Clear ()
- {
- Root = null;
- Count = 0;
- }
-
- public bool Contains (T node)
- {
- return this.Any (i => i.Equals (node));
- }
-
- public void CopyTo (T[] array, int arrayIndex)
- {
- if (array == null)
- throw new ArgumentNullException ("array");
- if (array.Length < Count)
- throw new ArgumentException ("The array is too small", "array");
- if (arrayIndex < 0 || arrayIndex + Count > array.Length)
- throw new ArgumentOutOfRangeException ("arrayIndex", arrayIndex, "Value must be between 0 and " + (array.Length - Count));
-
- int i = arrayIndex;
- foreach (T value in this)
- array [i++] = value;
- }
-
- bool ICollection<T>.Remove (T node)
- {
- return Remove (node);
- }
-
- public bool Remove (IAvlNode node)
- {
- if (node == null)
- throw new ArgumentNullException ("node");
- var left = node.Left;
- var right = node.Right;
- var parent = node.Parent;
-
- if (left == null) {
- if (right == null) {
- if (node == Root) {
- Clear ();
- return true;
- }
- if (parent == null) {
- throw new Exception ();
- }
- if (parent.Left == node) {
- parent.Left = null;
- DeleteBalanceTree (parent, 1);
- } else {
- parent.Right = null;
- DeleteBalanceTree (parent, -1);
- }
- } else {
- if (node == Root) {
- node.Right.Parent = null;
- Root = (T)node.Right;
- return true;
- }
- node.Right.Parent = node.Parent;
- if (parent.Left == node) {
- parent.Left = node.Right;
- DeleteBalanceTree (parent, 1);
- } else {
- parent.Right = node.Right;
- DeleteBalanceTree (parent, -1);
- }
- }
- } else if (right == null) {
- if (node == Root) {
- node.Left.Parent = null;
- Root = (T)node.Left;
- return true;
- }
- node.Left.Parent = node.Parent;
- if (parent.Left == node) {
- parent.Left = node.Left;
- DeleteBalanceTree (parent, 1);
- } else {
- parent.Right = node.Left;
- DeleteBalanceTree (parent, -1);
- }
- } else { // no (half-)leaf
- IAvlNode successor;
- if (node.Balance > -1)
- successor = node.AvlGetNextNode ();
- else
- successor = node.AvlGetPrevNode ();
- SwitchNodes (node, successor);
- successor.UpdateAugmentedData ();
- return Remove (node);
- }
- if (parent != null) {
- parent.UpdateAugmentedData ();
- }
- Count--;
- OnNodeRemoved (new TreeNodeEventArgs ((T)node));
- return true;
- }
-
- public int Count {
- get;
- internal set;
- }
-
- bool ICollection<T>.IsReadOnly {
- get {
- return false;
- }
- }
-
- protected virtual void OnNodeRemoved (TreeNodeEventArgs e)
- {
- var handler = this.NodeRemoved;
- if (handler != null)
- handler (this, e);
- }
-
- public event EventHandler<TreeNodeEventArgs> NodeRemoved;
-
- public class TreeNodeEventArgs : EventArgs
- {
- public T Node { get; private set; }
-
- public TreeNodeEventArgs (T node)
- {
- Node = node;
- }
- }
- #endregion
-
- #region IEnumerable implementation
-
- public IEnumerator<T> GetEnumerator ()
- {
- if (Root == null)
- yield break;
- var node = Root.AvlGetOuterLeft ();
- while (node != null) {
- yield return node;
- node = node.AvlGetNextNode ();
- }
- }
-
- System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator ()
- {
- return GetEnumerator ();
- }
-
- #endregion
-
- public void RotateLeft (IAvlNode node)
- {
- var rightChild = node.Right;
-
- var rightLeft = rightChild.Left;
- var parent = node.Parent;
-
- rightChild.Parent = parent;
- rightChild.Left = node;
-
- if (rightChild.Balance == 0) {
- node.Balance = 1;
- } else if (rightChild.Balance == 1) {
- node.Balance = 0;
- }
-
- rightChild.Balance--;
-
- node.Parent = rightChild;
- node.Right = rightLeft;
-
- if (rightLeft != null)
- rightLeft.Parent = node;
- node.UpdateAugmentedData ();
- rightChild.UpdateAugmentedData ();
-
- if (node == Root) {
- Root = (T)rightChild;
- } else {
- if (parent.Right == node) {
- parent.Right = rightChild;
- } else {
- parent.Left = rightChild;
- }
- parent.UpdateAugmentedData ();
- }
- }
-
- public void RotateRight (IAvlNode node)
- {
- var leftChild = node.Left;
-
- var leftRight = leftChild.Right;
- var parent = node.Parent;
-
- leftChild.Parent = parent;
- leftChild.Right = node;
-
- if (leftChild.Balance == 0) {
- node.Balance = -1;
- } else if (leftChild.Balance == -1) {
- node.Balance = 0;
- }
-
- leftChild.Balance++;
-
- node.Parent = leftChild;
- node.Left = leftRight;
-
- if (leftRight != null)
- leftRight.Parent = node;
- node.UpdateAugmentedData ();
- leftChild.UpdateAugmentedData ();
-
- if (node == Root) {
- Root = (T)leftChild;
- } else {
- if (parent.Left == node) {
- parent.Left = leftChild;
- } else {
- parent.Right = leftChild;
- }
- parent.UpdateAugmentedData ();
- }
- }
-
- public void RotateRightLeft (IAvlNode node)
- {
- var rightChild = node.Right;
- var rightLeft = rightChild.Left;
- var rightLeftRight = rightLeft.Right;
-
- rightChild.Left = rightLeftRight;
- if (rightLeftRight != null)
- rightLeftRight.Parent = rightChild;
- rightLeft.Right = rightChild;
- rightChild.Parent = rightLeft;
- node.Right = rightLeft.Left;
- if (rightLeft.Left != null)
- rightLeft.Left.Parent = node;
- rightLeft.Parent = node.Parent;
- if (node == Root) {
- Root = (T)rightLeft;
- } else {
- if (node.Parent.Right == node) {
- node.Parent.Right = rightLeft;
- } else {
- node.Parent.Left = rightLeft;
- }
- node.Parent.UpdateAugmentedData ();
- }
- rightLeft.Left = node;
- node.Parent = rightLeft;
- switch (rightLeft.Balance) {
- case 0:
- rightChild.Balance = 0;
- node.Balance = 0;
- break;
- case 1:
- rightChild.Balance = 0;
- node.Balance = -1;
- break;
- default: // -1
- rightChild.Balance = 1;
- node.Balance = 0;
- break;
- }
- rightLeft.Balance = 0;
-
- rightChild.UpdateAugmentedData ();
- node.UpdateAugmentedData ();
- rightLeft.UpdateAugmentedData ();
- }
-
- public void RotateLeftRight (IAvlNode node)
- {
- var leftChild = node.Left;
- var leftRight = leftChild.Right;
- var leftRightLeft = leftRight.Left;
-
- leftChild.Right = leftRightLeft;
- if (leftRightLeft != null)
- leftRightLeft.Parent = leftChild;
- leftRight.Left = leftChild;
- leftChild.Parent = leftRight;
- node.Left = leftRight.Right;
- if (leftRight.Right != null)
- leftRight.Right.Parent = node;
- leftRight.Parent = node.Parent;
- if (node == Root) {
- Root = (T)leftRight;
- } else {
- if (node.Parent.Right == node) {
- node.Parent.Right = leftRight;
- } else {
- node.Parent.Left = leftRight;
- }
- node.Parent.UpdateAugmentedData ();
- }
- leftRight.Right = node;
- node.Parent = leftRight;
- switch (leftRight.Balance) {
- case 1:
- leftChild.Balance = -1;
- node.Balance = 0;
- break;
- case 0:
- leftChild.Balance = 0;
- node.Balance = 0;
- break;
- default: // -1
- leftChild.Balance = 0;
- node.Balance = 1;
- break;
- }
- leftRight.Balance = 0;
-
- leftChild.UpdateAugmentedData ();
- node.UpdateAugmentedData ();
- leftRight.UpdateAugmentedData ();
- }
-
- void InsertBalanceTree (IAvlNode node, sbyte balance)
- {
- while (node != null) {
- node.Balance += balance;
- balance = node.Balance;
-
- if (balance == 0)
- return;
- if (balance == -2) {
- if (node.Left.Balance < 1) {
- RotateRight (node);
- } else {
- RotateLeftRight (node);
- }
- return;
- }
-
- if (balance == 2) {
- if (node.Right.Balance > -1) {
- RotateLeft (node);
- } else {
- RotateRightLeft (node);
- }
- return;
- }
-
- var parent = node.Parent;
- if (parent != null)
- balance = parent.Left == node ? (sbyte)-1 : (sbyte)1;
- node = parent;
- }
- }
-
- void DeleteBalanceTree (IAvlNode node, sbyte balance)
- {
- while (node != null) {
- node.Balance += balance;
- balance = node.Balance;
- if (balance == -2) {
- if (node.Left.Balance < 1) {
- RotateRight (node);
- if (node.Balance == 0) {
- node = node.Parent;
- } else if (node.Balance == -1)
- return;
- } else {
- RotateLeftRight (node);
- node = node.Parent;
- }
- } else if (balance == 2) {
- if (node.Right.Balance > -1) {
- RotateLeft (node);
- if (node.Balance == 0) {
- node = node.Parent;
- } else if (node.Balance == 1)
- return;
- } else {
- RotateRightLeft (node);
- node = node.Parent;
- }
- } else if (node.Balance != 0) {
- return;
- }
-
- var parent = node.Parent;
- if (parent != null)
- balance = parent.Left == node ? (sbyte)1 : (sbyte)-1;
- node = parent;
- }
- }
-
- public void SwitchNodes (IAvlNode oldNode, IAvlNode newNode)
- {
- if (oldNode == newNode)
- return;
-
- var oldBalance = oldNode.Balance;
- var newLeft = newNode.Left;
- var newRight = newNode.Right;
- var oldParent = oldNode.Parent;
-
- oldNode.Balance = newNode.Balance;
- newNode.Balance = oldBalance;
-
- // oldNode and newNode are Parent and Child
- if (newNode.Parent == oldNode) {
- if (oldNode.Parent != null) {
- if (oldNode.Parent.Right == oldNode) {
- oldNode.Parent.Right = newNode;
- } else {
- oldNode.Parent.Left = newNode;
- }
- } else if (oldNode == Root) {
- Root = (T)newNode;
- }
- newNode.Parent = oldNode.Parent;
- oldNode.Parent = newNode;
-
- if (oldNode.Left == newNode) {
- // update Children
- newNode.Left = oldNode;
- newNode.Right = oldNode.Right;
- oldNode.Left = newLeft;
- oldNode.Right = newRight;
-
- // update Parents of Children
- if (newNode.Right != null)
- newNode.Right.Parent = newNode;
- if (oldNode.Right != null)
- oldNode.Right.Parent = oldNode;
- if (oldNode.Left != null)
- oldNode.Left.Parent = oldNode;
- } else { //odlNode.Right == newNode
- // update Children
- newNode.Right = oldNode;
- newNode.Left = oldNode.Left;
- oldNode.Left = newLeft;
- oldNode.Right = newRight;
-
- // update Parents of Children
- if (newNode.Left != null)
- newNode.Left.Parent = newNode;
- if (oldNode.Right != null)
- oldNode.Right.Parent = oldNode;
- if (oldNode.Left != null)
- oldNode.Left.Parent = oldNode;
- }
- return;
- }
- if (oldNode.Parent == newNode) {
- if (newNode.Parent != null) {
- if (newNode.Parent.Right == newNode) {
- newNode.Parent.Right = oldNode;
- } else {
- newNode.Parent.Left = oldNode;
- }
- } else if (newNode == Root) {
- Root = (T)oldNode;
- }
- oldNode.Parent = newNode.Parent;
- newNode.Parent = oldNode;
-
- if (newNode.Left == oldNode) {
- // update Children
- newNode.Left = oldNode.Left;
- newNode.Right = oldNode.Right;
- oldNode.Left = newNode;
- oldNode.Right = newRight;
-
- // update Parents of Children
- if (newNode.Right != null)
- newNode.Right.Parent = newNode;
- if (newNode.Left != null)
- newNode.Left.Parent = newNode;
- if (oldNode.Right != null)
- oldNode.Right.Parent = oldNode;
- } else {
- // update Children
- newNode.Left = oldNode.Left;
- newNode.Right = oldNode.Right;
- oldNode.Left = newLeft;
- oldNode.Right = newNode;
-
- // update Parents of Children
- if (newNode.Right != null)
- newNode.Right.Parent = newNode;
- if (newNode.Left != null)
- newNode.Left.Parent = newNode;
- if (oldNode.Left != null)
- oldNode.Left.Parent = oldNode;
- }
- return;
- }
-
- // no node is Parent of the other
-
- // update Parents
- if (oldNode.AvlGetSibling () == newNode) {
- if (newNode.Parent.Right == newNode) {
- newNode.Parent.Right = oldNode;
- newNode.Parent.Left = newNode;
- } else {
- newNode.Parent.Left = oldNode;
- newNode.Parent.Right = newNode;
- }
- } else {
- oldNode.Parent = newNode.Parent;
- if (newNode.Parent != null) {
- if (newNode.Parent.Right == newNode) {
- newNode.Parent.Right = oldNode;
- } else {
- newNode.Parent.Left = oldNode;
- }
- } else if (newNode == Root) {
- Root = (T)oldNode;
- }
- newNode.Parent = oldParent;
- if (oldParent != null) {
- if (oldParent.Right == oldNode) {
- oldParent.Right = newNode;
- } else {
- oldParent.Left = newNode;
- }
- } else if (oldNode == Root) {
- Root = (T)newNode;
- }
- }
- // assign Children of newNode
- newNode.Left = oldNode.Left;
- if (newNode.Left != null)
- newNode.Left.Parent = newNode;
- newNode.Right = oldNode.Right;
- if (newNode.Right != null)
- newNode.Right.Parent = newNode;
-
- // assign Children of oldNode
- oldNode.Left = newLeft;
- if (oldNode.Left != null)
- oldNode.Left.Parent = oldNode;
- oldNode.Right = newRight;
- if (oldNode.Right != null)
- oldNode.Right.Parent = oldNode;
- }
- }
-
- static class AvlExtensions
- {
- public static bool IsLeaf (this IAvlNode node)
- {
- return node.Left == null && node.Right == null;
- }
-
- public static T AvlGetSibling<T> (this T node) where T : class, IAvlNode
- {
- if (node.Parent == null)
- return null;
- return (T)(node == node.Parent.Left ? node.Parent.Right : node.Parent.Left);
- }
-
- public static T AvlGetOuterLeft<T> (this T node) where T : class, IAvlNode
- {
- IAvlNode result = node;
- while (result.Left != null)
- result = result.Left;
- return (T)result;
- }
-
- public static T AvlGetOuterRight<T> (this T node) where T : class, IAvlNode
- {
- IAvlNode result = node;
- while (result.Right != null) {
- result = result.Right;
- }
- return (T)result;
- }
-
- public static T AvlGetGrandparent<T> (this T node) where T : class, IAvlNode
- {
- return (T)(node.Parent != null ? node.Parent.Parent : null);
- }
-
- public static T AvlGetUncle<T> (this T node) where T : class, IAvlNode
- {
- return (T)(node.Parent != null ? node.Parent.AvlGetSibling () : null);
- // var grandparent = node.AvlGetGrandparent ();
- // if (grandparent == null)
- // return null;
- // return (T)(node.Parent == grandparent.Left ? grandparent.Right : grandparent.Left);
- }
-
- public static T AvlGetNextNode<T> (this T node) where T : class, IAvlNode
- {
- if (node.Right == null) {
- IAvlNode curNode = node;
- IAvlNode oldNode;
- do {
- oldNode = curNode;
- curNode = curNode.Parent;
- } while (curNode != null && curNode.Right == oldNode);
- return (T)curNode;
- }
- return (T)node.Right.AvlGetOuterLeft ();
- }
-
- public static T AvlGetPrevNode<T> (this T node) where T : class, IAvlNode
- {
- if (node.Left == null) {
- IAvlNode curNode = node;
- IAvlNode oldNode;
- do {
- oldNode = curNode;
- curNode = curNode.Parent;
- } while (curNode != null && curNode.Left == oldNode);
- return (T)curNode;
- }
- return (T)node.Left.AvlGetOuterRight ();
- }
- }
-}
-
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/ImmutableText.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/ImmutableText.cs
new file mode 100644
index 0000000000..b463fd79a4
--- /dev/null
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/ImmutableText.cs
@@ -0,0 +1,712 @@
+//
+// ImmutableText.cs
+//
+// A pruned and optimized version of javolution.text.Text
+// Ported from IntelliJ IDEA File Version: 5.3, January 10, 2007.
+//
+// Author:
+// Jean-Marie Dautelle <jean-marie@dautelle.com>
+// Wilfried Middleton
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#region Java copyright notice
+/*
+ * Javolution - Java(tm) Solution for Real-Time and Embedded Systems
+ * Copyright (c) 2012, Javolution (http://javolution.org/)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#endregion
+
+using System;
+using System.Globalization;
+using System.IO;
+
+namespace Mono.TextEditor.Utils
+{
+ /// <summary>
+ /// <p> This class represents an immutable character sequence with
+ /// fast {@link #concat concatenation}, {@link #insert insertion} and
+ /// {@link #delete deletion} capabilities (O[Log(n)]) instead of
+ /// O[n] for StringBuffer/StringBuilder).</p>
+ ///
+ /// <p><i> Implementation Note: To avoid expensive copy operations ,
+ /// {@link ImmutableText} instances are broken down into smaller immutable
+ /// sequences, they form a minimal-depth binary tree.
+ /// The tree is maintained balanced automatically through <a
+ /// href="http://en.wikipedia.org/wiki/Tree_rotation">tree rotations</a>.
+ /// Insertion/deletions are performed in <code>O[Log(n)]</code>
+ /// instead of <code>O[n]</code> for
+ /// <code>StringBuffer/StringBuilder</code>.</i></p>
+ /// </summary>
+ public sealed class ImmutableText
+ {
+ /// <summary>Holds the default size for primitive blocks of characters.</summary>
+ const int BLOCK_SIZE = 1 << 6;
+
+ /// <summary>Holds the mask used to ensure a block boundary cesures.</summary>
+ const int BLOCK_MASK = ~(BLOCK_SIZE - 1);
+
+ static readonly LeafNode EMPTY_NODE = new Leaf8BitNode (new byte [0]);
+
+ public static readonly ImmutableText Empty = new ImmutableText (EMPTY_NODE);
+
+ readonly Node root;
+
+ /// <summary>
+ /// Returns the length of this text.
+ /// </summary>
+ /// <value>the number of characters (16-bits Unicode) composing this text.</value>
+ public int Length {
+ get {
+ return root.Length;
+ }
+ }
+
+ volatile InnerLeaf myLastLeaf;
+
+ /// <summary>
+ /// Gets/Sets a single character.
+ /// Runs in O(lg N) for random access. Sequential read-only access benefits from a special optimization and runs in amortized O(1).
+ /// </summary>
+ public char this [int index] {
+ get {
+ if (root is LeafNode) {
+ return root [index];
+ }
+
+ var leaf = myLastLeaf;
+ if (leaf == null || index < leaf.offset || index >= leaf.offset + leaf.leafNode.Length) {
+ myLastLeaf = leaf = FindLeaf (index, 0);
+ }
+ return leaf.leafNode [index - leaf.offset];
+ }
+ }
+
+ ImmutableText (Node node)
+ {
+ root = node;
+ }
+
+ public ImmutableText (string str)
+ {
+ root = CreateLeafNode (str.ToCharArray ());
+ }
+
+ public ImmutableText (char [] str)
+ {
+ root = CreateLeafNode (str);
+ }
+
+ /// <summary>
+ /// Concatenates the specified text to the end of this text.
+ /// This method is very fast (faster even than
+ /// <code>StringBuffer.append(String)</code>) and still returns
+ /// a text instance with an internal binary tree of minimal depth!
+ /// </summary>
+ /// <param name="that">that the text that is concatenated.</param>
+ /// <returns><code>this + that</code></returns>
+ public ImmutableText Concat (ImmutableText that)
+ {
+ return that.Length == 0 ? this : Length == 0 ? that : new ImmutableText (ConcatNodes (EnsureChunked ().root, that.EnsureChunked ().root));
+ }
+
+ /// <summary>
+ /// Returns the text having the specified text inserted at
+ /// the specified location.
+ /// </summary>
+ /// <param name="index">index the insertion position.</param>
+ /// <param name="txt">txt the text being inserted.</param>
+ /// <returns>subtext(0, index).concat(txt).concat(subtext(index))</returns>
+ /// <exception cref="IndexOutOfRangeException">if <code>(index &lt; 0) || (index &gt; this.Length)</code></exception>
+ public ImmutableText InsertText (int index, ImmutableText txt)
+ {
+ return GetText (0, index).Concat (txt).Concat (SubText (index));
+ }
+
+ public ImmutableText InsertText (int index, string txt)
+ {
+ return InsertText (index, new ImmutableText (txt));
+ }
+
+ /// <summary>
+ /// Returns the text without the characters between the specified indexes.
+ /// </summary>
+ /// <returns><code>subtext(0, start).concat(subtext(end))</code></returns>
+ public ImmutableText RemoveText (int start, int count)
+ {
+ if (count == 0)
+ return this;
+ var end = start + count;
+ if (end > Length)
+ throw new IndexOutOfRangeException ();
+ return EnsureChunked ().GetText (0, start).Concat (SubText (end));
+ }
+
+ /// <summary>
+ /// Returns a portion of this text.
+ /// </summary>
+ /// <returns>the sub-text starting at the specified start position and ending just before the specified end position.</returns>
+ public ImmutableText GetText (int start, int count)
+ {
+ var end = start + count;
+ if ((start < 0) || (start > end) || (end > Length)) {
+ throw new IndexOutOfRangeException (" start :" + start + " end :" + end + " needs to be between 0 <= " + Length);
+ }
+ if ((start == 0) && (end == Length)) {
+ return this;
+ }
+ if (start == end) {
+ return Empty;
+ }
+
+ return new ImmutableText (root.SubNode (start, end));
+ }
+
+ /// <summary>
+ /// Copies the whole content of the immutable text into the specified array.
+ /// Runs in O(N).
+ /// </summary>
+ /// <remarks>
+ /// This method counts as a read access and may be called concurrently to other read accesses.
+ /// </remarks>
+ public void CopyTo (char [] destination, int destinationIndex)
+ {
+ CopyTo (0, destination, destinationIndex, Length);
+ }
+
+ /// <summary>
+ /// Copies the a part of the immutable text into the specified array.
+ /// Runs in O(lg N + M).
+ /// </summary>
+ /// <remarks>
+ /// This method counts as a read access and may be called concurrently to other read accesses.
+ /// </remarks>
+ public void CopyTo (int sourceIndex, char [] destination, int destinationIndex, int count)
+ {
+ VerifyRange (sourceIndex, count);
+ VerifyArrayWithRange (destination, destinationIndex, count);
+ root.CopyTo (sourceIndex, destination, destinationIndex, count);
+ }
+
+ /// <summary>
+ /// Creates an array and copies the contents of the rope into it.
+ /// Runs in O(N).
+ /// </summary>
+ /// <remarks>
+ /// This method counts as a read access and may be called concurrently to other read accesses.
+ /// </remarks>
+ public char [] ToArray ()
+ {
+ char [] arr = new char [Length];
+ CopyTo (0, arr, 0, arr.Length);
+ return arr;
+ }
+
+ /// <summary>
+ /// Creates an array and copies the contents of the rope into it.
+ /// Runs in O(N).
+ /// </summary>
+ /// <remarks>
+ /// This method counts as a read access and may be called concurrently to other read accesses.
+ /// </remarks>
+ public char [] ToArray (int offset, int length)
+ {
+ VerifyRange (offset, length);
+ char [] arr = new char [length];
+ CopyTo (offset, arr, 0, length);
+ return arr;
+ }
+
+ void VerifyRange (int startIndex, int length)
+ {
+ if (startIndex < 0 || startIndex > Length) {
+ throw new ArgumentOutOfRangeException (nameof (startIndex), startIndex, "0 <= startIndex <= " + Length.ToString (CultureInfo.InvariantCulture));
+ }
+ if (length < 0 || startIndex + length > Length) {
+ throw new ArgumentOutOfRangeException (nameof (length), length, "0 <= length, startIndex(" + startIndex + ")+length(" + length + ") <= " + Length.ToString (CultureInfo.InvariantCulture));
+ }
+ }
+
+ static void VerifyArrayWithRange (char [] array, int arrayIndex, int count)
+ {
+ if (array == null)
+ throw new ArgumentNullException (nameof (array));
+ if (arrayIndex < 0 || arrayIndex > array.Length) {
+ throw new ArgumentOutOfRangeException (nameof (arrayIndex), arrayIndex, "0 <= arrayIndex <= " + array.Length.ToString (CultureInfo.InvariantCulture));
+ }
+ if (count < 0 || arrayIndex + count > array.Length) {
+ throw new ArgumentOutOfRangeException (nameof (count), count, "0 <= length, arrayIndex(" + arrayIndex + ")+count <= " + array.Length.ToString (CultureInfo.InvariantCulture));
+ }
+ }
+
+ public override string ToString ()
+ {
+ return root.ToString ();
+ }
+
+ public string ToString (int offset, int length)
+ {
+ char [] data = new char [length];
+ CopyTo (offset, data, 0, length);
+ return new string (data);
+ }
+
+ public void WriteTo (TextWriter output, int index, int count)
+ {
+ while (index < index + count) {
+ output.Write (this [index]);
+ index++;
+ }
+ }
+
+ public override bool Equals (object obj)
+ {
+ if (this == obj)
+ return true;
+
+ var that = obj as ImmutableText;
+ if (that == null)
+ return false;
+
+ int len = Length;
+ if (len != that.Length)
+ return false;
+
+ for (int i = 0; i < len; i++) {
+ if (this [i] != that [i])
+ return false;
+ }
+ return true;
+ }
+
+ int hash;
+ public override int GetHashCode ()
+ {
+ int h = hash;
+ if (h == 0) {
+ for (int off = 0; off < Length; off++) {
+ h = 31 * h + this [off];
+ }
+ hash = h;
+ }
+ return h;
+ }
+
+ #region Helper methods
+
+ ImmutableText SubText (int start)
+ {
+ return GetText (start, Length - start);
+ }
+
+ static LeafNode CreateLeafNode (char [] str)
+ {
+ byte [] bytes = ToBytesIfPossible (str);
+ if (bytes != null)
+ return new Leaf8BitNode (bytes);
+ return new WideLeafNode (str);
+ }
+
+ #region orinal version
+ //static byte [] ToBytesIfPossible (char [] seq)
+ //{
+ // byte [] bytes = new byte [seq.Length];
+ // for (int i = 0; i < bytes.Length; i++) {
+ // char c = seq [i];
+ // if ((c & 0xff00) != 0)
+ // return null;
+ // bytes [i] = (byte)c;
+ // }
+ // return bytes;
+ //}
+ #endregion
+
+ unsafe static byte [] ToBytesIfPossible (char [] seq)
+ {
+ var bytes = new byte [seq.Length];
+ fixed (byte* bBegin = bytes) {
+ fixed (char* cBegin = seq) {
+ var bPtr = bBegin;
+ var bEnd = bBegin + bytes.Length;
+
+ var cPtr = (ushort*)cBegin;
+ while (bPtr != bEnd) {
+ var c = *cPtr++;
+ if (c > 0xFF)
+ return null;
+ *(bPtr++) = (byte)c;
+ }
+ }
+ }
+ return bytes;
+ }
+
+ /// <summary>
+ /// When first loaded, ImmutableText contents are stored as a single large array. This saves memory but isn't
+ /// modification-friendly as it disallows slightly changed texts to retain most of the internal structure of the
+ /// original document. Whoever retains old non-chunked version will use more memory than really needed.
+ /// </summary>
+ /// <returns>A copy of this text better prepared for small modifications to fully enable structure-sharing capabilities</returns>
+ ImmutableText EnsureChunked ()
+ {
+ if (Length > BLOCK_SIZE && root is LeafNode) {
+ return new ImmutableText (NodeOf ((LeafNode)root, 0, Length));
+ }
+ return this;
+ }
+
+ static Node NodeOf (LeafNode node, int offset, int length)
+ {
+ if (length <= BLOCK_SIZE) {
+ return node.SubNode (offset, offset + length);
+ }
+ // Splits on a block boundary.
+ int half = ((length + BLOCK_SIZE) >> 1) & BLOCK_MASK;
+ return new CompositeNode (NodeOf (node, offset, half), NodeOf (node, offset + half, length - half));
+ }
+
+ static Node ConcatNodes (Node node1, Node node2)
+ {
+ // All Text instances are maintained balanced:
+ // (head < tail * 2) & (tail < head * 2)
+ int length = node1.Length + node2.Length;
+ if (length <= BLOCK_SIZE) { // Merges to primitive.
+ var mergedArray = new char [node1.Length + node2.Length];
+ node1.CopyTo (0, mergedArray, 0, node1.Length);
+ node2.CopyTo (0, mergedArray, node1.Length, node2.Length);
+ return CreateLeafNode (mergedArray);
+ } else { // Returns a composite.
+ Node head = node1;
+ Node tail = node2;
+ var compositeTail = tail as CompositeNode;
+ if (((head.Length << 1) < tail.Length) && compositeTail != null) {
+ // head too small, returns (head + tail/2) + (tail/2)
+ if (compositeTail.head.Length > compositeTail.tail.Length) {
+ // Rotates to concatenate with smaller part.
+ tail = compositeTail.RotateRight ();
+ }
+ head = ConcatNodes (head, compositeTail.head);
+ tail = compositeTail.tail;
+ } else {
+ var compositeHead = head as CompositeNode;
+ if (((tail.Length << 1) < head.Length) && compositeHead != null) {
+ // tail too small, returns (head/2) + (head/2 concat tail)
+ if (compositeHead.tail.Length > compositeHead.head.Length) {
+ // Rotates to concatenate with smaller part.
+ head = compositeHead.RotateLeft ();
+ }
+ tail = ConcatNodes (compositeHead.tail, tail);
+ head = compositeHead.head;
+ }
+ }
+
+ return new CompositeNode (head, tail);
+ }
+ }
+
+ InnerLeaf FindLeaf (int index, int offset)
+ {
+ Node node = root;
+ while (true) {
+ if (index >= node.Length)
+ throw new IndexOutOfRangeException ();
+
+ var leafNode = node as LeafNode;
+ if (leafNode != null)
+ return new InnerLeaf (leafNode, offset);
+
+ var composite = (CompositeNode)node;
+ if (index < composite.head.Length) {
+ node = composite.head;
+ } else {
+ offset += composite.head.Length;
+ index -= composite.head.Length;
+ node = composite.tail;
+ }
+ }
+ }
+
+ class InnerLeaf
+ {
+ internal readonly LeafNode leafNode;
+ internal readonly int offset;
+
+ public InnerLeaf (LeafNode leafNode, int offset)
+ {
+ this.leafNode = leafNode;
+ this.offset = offset;
+ }
+ }
+
+ #endregion
+
+ #region Tree
+
+ abstract class Node
+ {
+ public abstract int Length { get; }
+
+ public abstract char this [int index] {
+ get;
+ }
+
+ public abstract void CopyTo (int sourceIndex, char [] destination, int destinationIndex, int count);
+
+ public abstract Node SubNode (int start, int end);
+
+ public override string ToString ()
+ {
+ int len = Length;
+ char [] data = new char [len];
+ CopyTo (0, data, 0, len);
+ return new string (data);
+ }
+
+ public Node subSequence (int start, int end)
+ {
+ return SubNode (start, end);
+ }
+ }
+
+ abstract class LeafNode : Node
+ {
+ }
+
+ sealed class WideLeafNode : LeafNode
+ {
+ readonly char [] data;
+
+ public override int Length {
+ get {
+ return data.Length;
+ }
+ }
+
+ public override char this [int index] {
+ get {
+ return data [index];
+ }
+ }
+
+ public WideLeafNode (char [] data)
+ {
+ this.data = data;
+ }
+
+ public override void CopyTo (int sourceIndex, char [] destination, int destinationIndex, int count)
+ {
+ Array.Copy (data, sourceIndex, destination, destinationIndex, count);
+ }
+
+ public override Node SubNode (int start, int end)
+ {
+ if (start == 0 && end == Length) {
+ return this;
+ }
+ var subArray = new char [end - start];
+ Array.Copy (data, start, subArray, 0, subArray.Length);
+ return CreateLeafNode (subArray);
+ }
+
+ public override string ToString ()
+ {
+ return new string (data);
+ }
+ }
+
+ sealed class Leaf8BitNode : LeafNode
+ {
+ readonly byte [] data;
+
+ public override int Length {
+ get {
+ return data.Length;
+ }
+ }
+
+ public override char this [int index] {
+ get {
+ return (char)data [index];
+ }
+ }
+
+ public Leaf8BitNode (byte [] data)
+ {
+ this.data = data;
+ }
+
+ #region original version
+ //public override void GetChars(int start, int end, char[] dest, int destPos)
+ //{
+ // for (int i=start;i<end;i++) {
+ // dest[destPos++] = (char)data[i];
+ // }
+ //}
+ #endregion
+
+ public unsafe override void CopyTo (int sourceIndex, char [] destination, int destinationIndex, int count)
+ {
+ fixed (byte* bPtr = data)
+ {
+ fixed (char* cPtr = destination)
+ {
+ var b = bPtr + sourceIndex;
+ var endPtr = b + count;
+ var endPtr4 = endPtr - count % 4;
+
+ var c = (short*)cPtr + destinationIndex;
+
+ while (b != endPtr4) {
+ *(c++) = *(b++);
+ *(c++) = *(b++);
+ *(c++) = *(b++);
+ *(c++) = *(b++);
+ }
+
+ while (b != endPtr) {
+ *(c++) = *(b++);
+ }
+ }
+ }
+ }
+
+ public override Node SubNode (int start, int end)
+ {
+ if (start == 0 && end == Length) {
+ return this;
+ }
+ int length = end - start;
+ byte [] chars = new byte [length];
+ Array.Copy (data, start, chars, 0, length);
+ return new Leaf8BitNode (chars);
+ }
+ }
+
+ sealed class CompositeNode : Node
+ {
+ readonly int count;
+ internal readonly Node head;
+ internal readonly Node tail;
+
+ public override int Length {
+ get {
+ return count;
+ }
+ }
+
+ public override char this [int index] {
+ get {
+ int headLength = head.Length;
+ return index < headLength ? head [index] : tail [index - headLength];
+ }
+ }
+
+ public CompositeNode (Node head, Node tail)
+ {
+ count = head.Length + tail.Length;
+ this.head = head;
+ this.tail = tail;
+ }
+
+ internal Node RotateRight ()
+ {
+ // See: http://en.wikipedia.org/wiki/Tree_rotation
+ var P = head as CompositeNode;
+ if (P == null) {
+ return this; // Head not a composite, cannot rotate.
+ }
+ var A = P.head;
+ var B = P.tail;
+ var C = tail;
+ return new CompositeNode (A, new CompositeNode (B, C));
+ }
+
+ internal Node RotateLeft ()
+ {
+ // See: http://en.wikipedia.org/wiki/Tree_rotation
+ var Q = tail as CompositeNode;
+ if (Q == null) {
+ return this; // Tail not a composite, cannot rotate.
+ }
+ var B = Q.head;
+ var C = Q.tail;
+ var A = head;
+ return new CompositeNode (new CompositeNode (A, B), C);
+ }
+
+ public override void CopyTo (int sourceIndex, char [] destination, int destinationIndex, int count)
+ {
+ int cesure = head.Length;
+ if (sourceIndex + count <= cesure) {
+ head.CopyTo (sourceIndex, destination, destinationIndex, count);
+ } else if (sourceIndex >= cesure) {
+ tail.CopyTo (sourceIndex - cesure, destination, destinationIndex, count);
+ } else { // Overlaps head and tail.
+ var headChunkSize = cesure - sourceIndex;
+ head.CopyTo (sourceIndex, destination, destinationIndex, headChunkSize);
+ tail.CopyTo (0, destination, destinationIndex + headChunkSize, count - headChunkSize);
+ }
+ }
+
+ public override Node SubNode (int start, int end)
+ {
+ int cesure = head.Length;
+ if (end <= cesure) {
+ return head.SubNode (start, end);
+ }
+ if (start >= cesure) {
+ return tail.SubNode (start - cesure, end - cesure);
+ }
+ if ((start == 0) && (end == count)) {
+ return this;
+ }
+ // Overlaps head and tail.
+ return ConcatNodes (head.SubNode (start, cesure), tail.SubNode (0, end - cesure));
+ }
+ }
+
+ #endregion
+ }
+} \ No newline at end of file
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/ImmutableTextTextReader.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/ImmutableTextTextReader.cs
new file mode 100644
index 0000000000..afd809d3fa
--- /dev/null
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/ImmutableTextTextReader.cs
@@ -0,0 +1,72 @@
+//
+// ImmutableTextTextReader.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+
+using System;
+using System.IO;
+
+namespace Mono.TextEditor.Utils
+{
+ public sealed class ImmutableTextTextReader : TextReader
+ {
+ readonly ImmutableText immutableText;
+
+ int index;
+
+ public ImmutableTextTextReader(ImmutableText immutableText)
+ {
+ if (immutableText == null)
+ throw new ArgumentNullException(nameof (immutableText));
+ this.immutableText = immutableText;
+ }
+
+ public override int Peek()
+ {
+ if (index >= immutableText.Length)
+ return -1;
+ return immutableText[index];
+ }
+
+ public override int Read()
+ {
+ if (index >= immutableText.Length)
+ return -1;
+ return immutableText[index++];
+ }
+
+ public override int Read(char[] buffer, int index, int count)
+ {
+ if (immutableText == null)
+ return 0;
+ count = System.Math.Min (this.index + count, immutableText.Length) - this.index;
+ if (count <= 0)
+ return 0;
+ immutableText.CopyTo (this.index, buffer, index, count);
+ this.index += count;
+ return count;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextBreaker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextBreaker.cs
index e96caf39af..4e87370e22 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextBreaker.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextBreaker.cs
@@ -49,7 +49,7 @@ namespace Mono.TextEditor.Utils
/// <param name='lineCount'>
/// The number of lines to get words from
/// </param>
- public static List<TextSegment> BreakLinesIntoWords (TextEditor editor, int startLine, int lineCount, bool includeDelimiter = true)
+ public static List<TextSegment> BreakLinesIntoWords (MonoTextEditor editor, int startLine, int lineCount, bool includeDelimiter = true)
{
return BreakLinesIntoWords (editor.Document, startLine, lineCount, includeDelimiter);
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextFileUtility.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextFileUtility.cs
index 237fe39067..53ad85771e 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextFileUtility.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Utils/TextFileUtility.cs
@@ -57,9 +57,9 @@ namespace Mono.TextEditor.Utils
encodings.Add (encoding);
}
encodingsWithBom = encodings.ToArray ();
-
+
// Encoding verifiers
- var verifierList = new List<Verifier> () {
+ var verifierList = new List<Verifier> {
new Utf8Verifier (),
new GB18030CodePageVerifier (),
new WindowsCodePageVerifier (),
@@ -141,19 +141,42 @@ namespace Mono.TextEditor.Utils
#region string methods
public static string GetText (byte[] bytes)
{
- using (var stream = OpenStream (bytes)) {
- return stream.ReadToEnd ();
- }
+ Encoding encoding;
+ bool hadBom;
+ return GetText (bytes, out encoding, out hadBom);
}
public static string GetText (byte[] bytes, out Encoding encoding, out bool hadBom)
{
if (bytes == null)
throw new ArgumentNullException ("bytes");
- using (var stream = OpenStream (bytes, out hadBom)) {
- encoding = stream.CurrentEncoding;
- return stream.ReadToEnd ();
+ encoding = null;
+ hadBom = false;
+ int start = 0;
+ foreach (var enc in encodingsWithBom) {
+ var bom = enc.GetPreamble ();
+ bool invalid = false;
+ if (bom.Length > bytes.Length)
+ continue;
+ for (int i = 0; i < bom.Length; i++) {
+ if (bom [i] != bytes [i]) {
+ invalid = true;
+ break;
+ }
+ }
+
+ if (!invalid) {
+ encoding = enc;
+ hadBom = true;
+ start = bom.Length;
+ break;
+ }
+ }
+ if (encoding == null) {
+ int max = System.Math.Min (bytes.Length, maxBufferLength);
+ encoding = AutoDetectEncoding (bytes, max);
}
+ return encoding.GetString (bytes, start, bytes.Length - start);
}
public static string GetText (byte[] bytes, Encoding encoding, out bool hadBom)
@@ -194,25 +217,19 @@ namespace Mono.TextEditor.Utils
public static string GetText (string fileName)
{
- using (var stream = OpenStream (fileName)) {
- return stream.ReadToEnd ();
- }
+ return GetText (File.ReadAllBytes (fileName));
}
public static string GetText (string fileName, out Encoding encoding, out bool hadBom)
{
if (fileName == null)
throw new ArgumentNullException ("fileName");
- using (var stream = OpenStream (fileName, out hadBom)) {
- encoding = stream.CurrentEncoding;
- return stream.ReadToEnd ();
- }
+ return GetText (File.ReadAllBytes (fileName), out encoding, out hadBom);
}
#endregion
#region file methods
-
public static void WriteText (string fileName, string text, Encoding encoding, bool hadBom)
{
if (fileName == null)
@@ -236,7 +253,7 @@ namespace Mono.TextEditor.Utils
SystemRename (tmpPath, fileName);
} catch (Exception) {
try {
- System.IO.File.Delete (tmpPath);
+ File.Delete (tmpPath);
} catch {
// nothing
}
@@ -310,17 +327,17 @@ namespace Mono.TextEditor.Utils
{
if (fileName == null)
throw new ArgumentNullException ("fileName");
- using (var stream = new FileStream (fileName, FileMode.Open, FileAccess.Read, FileShare.Read)) {
- return GetText (stream, out encoding, out hadBom);
- }
+ byte[] content = File.ReadAllBytes (fileName);
+ return GetText (content, out encoding, out hadBom);
}
+
public static string ReadAllText (string fileName, Encoding encoding, out bool hadBom)
{
if (fileName == null)
throw new ArgumentNullException ("fileName");
if (encoding == null)
throw new ArgumentNullException ("encoding");
-
+
byte[] content = File.ReadAllBytes (fileName);
return GetText (content, encoding, out hadBom);
}
@@ -340,13 +357,13 @@ namespace Mono.TextEditor.Utils
}
#endregion
-
#region Binary check
public static bool IsBinary (byte[] bytes)
{
if (bytes == null)
throw new ArgumentNullException ("bytes");
- return IsBinary (new MemoryStream (bytes, false));
+ var enc = AutoDetectEncoding (bytes, System.Math.Min (bytes.Length, maxBufferLength));
+ return enc == Encoding.ASCII;
}
public static bool IsBinary (string fileName)
@@ -362,71 +379,56 @@ namespace Mono.TextEditor.Utils
{
if (stream == null)
throw new ArgumentNullException ("stream");
-
+
var enc = AutoDetectEncoding (stream);
return enc == Encoding.ASCII;
}
#endregion
#region Encoding autodetection
- static Verifier[] verifiers;
- static byte[][][] stateTables;
+ static readonly Verifier[] verifiers;
+ static readonly byte[][][] stateTables;
+
+ const int maxBufferLength = 50 * 1024;
static unsafe Encoding AutoDetectEncoding (Stream stream)
{
try {
- int max = (int)System.Math.Min (stream.Length, 50 * 1024);
- byte[] readBuf = new byte[max];
+ int max = (int)System.Math.Min (stream.Length, maxBufferLength);
+ var readBuf = new byte[max];
int readLength = stream.Read (readBuf, 0, max);
stream.Position = 0;
-
- // Store the dfa data from the verifiers in local variables.
- byte[] states = new byte[verifiers.Length];
- int verifiersRunning = verifiers.Length;
+ return AutoDetectEncoding (readBuf, readLength);
+ } catch (Exception e) {
+ Console.WriteLine (e);
+ }
+ return Encoding.ASCII;
+ }
- for (int i = 0; i < verifiers.Length; i++)
- states [i] = verifiers [i].InitalState;
+ static unsafe Encoding AutoDetectEncoding (byte[] bytes, int readLength)
+ {
+ try {
+ var readBuf = bytes;
// run the verifiers
- fixed (byte* bBeginPtr = readBuf, stateBeginPtr = states) {
- byte* bPtr = bBeginPtr;
+ fixed (byte* bBeginPtr = readBuf) {
byte* bEndPtr = bBeginPtr + readLength;
- byte* sEndPtr = stateBeginPtr + states.Length;
-
- while (bPtr != bEndPtr) {
- byte* sPtr = stateBeginPtr;
- int i = 0;
- while (sPtr != sEndPtr) {
- byte curState = *sPtr;
+ for (int i = 0; i < verifiers.Length; i++) {
+ byte curState = verifiers [i].InitalState;
+ byte* bPtr = bBeginPtr;
+ while (bPtr != bEndPtr) {
if (curState != 0) {
curState = stateTables [i] [curState] [*bPtr];
if (curState == 0) {
- verifiersRunning--;
- if (verifiersRunning == 0)
- goto finishVerify;
+ break;
}
- *sPtr = curState;
}
- sPtr++;
- i++;
- }
- bPtr++;
- }
- finishVerify:
- if (verifiersRunning > 0) {
-// Console.WriteLine ("valid encodings:");
-// for (int i = 0; i < verifiers.Length; i++) {
-// if (verifiers [i].IsEncodingValid (states [i]))
-// Console.WriteLine (verifiers [i].Encoding.EncodingName);
-// }
-// Console.WriteLine ("---------------");
- for (int i = 0; i < verifiers.Length; i++) {
- if (verifiers [i].IsEncodingValid (states [i]))
- return verifiers [i].Encoding;
+ bPtr++;
}
+ if (verifiers [i].IsEncodingValid (curState))
+ return verifiers [i].Encoding;
}
}
-
} catch (Exception e) {
Console.WriteLine (e);
}
@@ -443,7 +445,7 @@ namespace Mono.TextEditor.Utils
public abstract Encoding Encoding { get; }
public abstract byte[][] StateTable { get; }
-
+
protected abstract void Init ();
bool isInitialized = false;
@@ -506,7 +508,7 @@ namespace Mono.TextEditor.Utils
table [UTFTail2] [i] = UTFTail1;
table [UTFTail3] [i] = UTFTail2;
}
-
+
// UTF8-2 = %xC2-DF UTF8-tail
for (int i = 0xC2; i <= 0xDF; i++)
table [UTF1] [i] = UTFTail1;
@@ -577,7 +579,7 @@ namespace Mono.TextEditor.Utils
table [0] = errorTable;
for (int i = 1; i < LAST; i++)
table [i] = new byte[(int)byte.MaxValue + 1];
-
+
for (int i = 0x00; i <= 0xFF; i++) {
table [Even] [i] = Odd;
table [Odd] [i] = Even;
@@ -588,7 +590,7 @@ namespace Mono.TextEditor.Utils
table [Even] [0] = Error;
table [EvenPossible] [0] = Error;
}
-
+
public override byte InitalState { get { return Even; } }
public override Encoding Encoding { get { return Encoding.Unicode; } }
@@ -650,7 +652,7 @@ namespace Mono.TextEditor.Utils
table [0] = errorTable;
for (int i = 1; i < LAST; i++)
table [i] = new byte[(int)byte.MaxValue + 1];
-
+
for (int i = 0x00; i <= 0xFF; i++) {
table [Even] [i] = Odd;
table [Odd] [i] = Even;
@@ -848,8 +850,4 @@ namespace Mono.TextEditor.Utils
}
#endregion
}
-}
-
-
-
-
+} \ No newline at end of file
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/NewViEditMode.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/NewViEditMode.cs
deleted file mode 100644
index 2527e953bd..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/NewViEditMode.cs
+++ /dev/null
@@ -1,125 +0,0 @@
-//
-// NewViEditMode.cs
-//
-// Author:
-// Michael Hutchinson <m.j.hutchinson@gmail.com>
-//
-// Copyright (c) 2013 Xamarin Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace Mono.TextEditor.Vi
-{
- public class NewViEditMode : EditMode
- {
- ViStatusArea statusArea;
- TextEditor viTextEditor;
-
- protected ViEditor ViEditor { get ; private set ;}
-
- public NewViEditMode ()
- {
- ViEditor = new ViEditor (this);
- ViEditor.ModeChanged += (sender, e) => {
- if (statusArea != null)
- statusArea.ShowCaret = ViEditor.Mode == ViEditorMode.Command;
- };
- ViEditor.MessageChanged += (sender, e) => {
- if (statusArea != null)
- statusArea.Message = ViEditor.Message;
- };
- }
-
- protected override void OnAddedToEditor (TextEditorData data)
- {
- ViEditor.SetMode (ViEditorMode.Normal);
- SetCaretMode (CaretMode.Block, data);
- ViActions.RetreatFromLineEnd (data);
-
- viTextEditor = data.Parent;
- if (viTextEditor != null) {
- statusArea = new ViStatusArea (viTextEditor);
- }
- }
-
- protected override void OnRemovedFromEditor (TextEditorData data)
- {
- SetCaretMode (CaretMode.Insert, data);
-
- if (viTextEditor != null) {
- statusArea.RemoveFromParentAndDestroy ();
- statusArea = null;
- viTextEditor = null;
- }
- }
-
- public override void AllocateTextArea (TextEditor textEditor, TextArea textArea, Gdk.Rectangle allocation)
- {
- statusArea.AllocateArea (textArea, allocation);
- }
-
- protected override void HandleKeypress (Gdk.Key key, uint unicodeKey, Gdk.ModifierType modifier)
- {
- ViEditor.ProcessKey (modifier, key, (char)unicodeKey);
- }
-
- public new TextEditor Editor { get { return base.Editor; } }
- public new TextEditorData Data { get { return base.Data; } }
-
- public override bool WantsToPreemptIM {
- get {
- switch (ViEditor.Mode) {
- case ViEditorMode.Insert:
- case ViEditorMode.Replace:
- return false;
- case ViEditorMode.Normal:
- case ViEditorMode.Visual:
- case ViEditorMode.VisualLine:
- default:
- return true;
- }
- }
- }
-
- protected override void CaretPositionChanged ()
- {
- ViEditor.OnCaretPositionChanged ();
- }
-
- public void SetCaretMode (CaretMode mode)
- {
- SetCaretMode (mode, Data);
- }
-
- static void SetCaretMode (CaretMode mode, TextEditorData data)
- {
- if (data.Caret.Mode == mode)
- return;
- data.Caret.Mode = mode;
- data.Document.RequestUpdate (new SinglePositionUpdate (data.Caret.Line, data.Caret.Column));
- data.Document.CommitDocumentUpdate ();
- }
- }
-}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViActionMaps.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViActionMaps.cs
deleted file mode 100644
index fb0c3eb14c..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViActionMaps.cs
+++ /dev/null
@@ -1,277 +0,0 @@
-//
-// ViActionMaps.cs
-//
-// Author:
-// Michael Hutchinson <mhutchinson@novell.com>
-//
-// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace Mono.TextEditor.Vi
-{
-
-
- public static class ViActionMaps
- {
-
- public static Action<TextEditorData> GetEditObjectCharAction (char c, Motion motion)
- {
- if (motion == Motion.None) return GetEditObjectCharAction(c);
-
- switch (c) {
- case 'w':
- return ViActions.InnerWord;
- case ')':
- case '}':
- case ']':
- case '>':
- if (motion == Motion.Inner)
- return ViActions.InnerSymbol (c);
- else if (motion == Motion.Outer)
- return ViActions.OuterSymbol (c);
- else
- return null;
- case '"':
- case '\'':
- case '`':
- if (motion == Motion.Inner)
- return ViActions.InnerQuote (c);
- else if (motion == Motion.Outer)
- return ViActions.OuterQuote (c);
- else
- return null;
- default:
- return null;
- }
- }
-
- public static Action<TextEditorData> GetEditObjectCharAction (char c)
- {
- switch (c) {
- case 'W':
- case 'w':
- return ViActions.WordEnd;
- case 'B':
- case 'b':
- return ViActions.WordStart;
- }
- return GetNavCharAction (c);
- }
-
- public static Action<TextEditorData> GetNavCharAction (char c)
- {
- switch (c) {
- case 'h':
- return ViActions.Left;
- case 'b':
- return CaretMoveActions.PreviousSubword;
- case 'B':
- return CaretMoveActions.PreviousWord;
- case 'l':
- return ViActions.Right;
- case 'e':
- return ViActions.NextSubwordEnd;
- case 'E':
- return ViActions.NextWordEnd;
- case 'w':
- return CaretMoveActions.NextSubword;
- case 'W':
- return CaretMoveActions.NextWord;
- case 'k':
- return ViActions.Up;
- case 'j':
- return ViActions.Down;
- case '%':
- return MiscActions.GotoMatchingBracket;
- case '0':
- return CaretMoveActions.LineStart;
- case '^':
- case '_':
- return CaretMoveActions.LineFirstNonWhitespace;
- case '$':
- return ViActions.LineEnd;
- case 'G':
- return CaretMoveActions.ToDocumentEnd;
- case '{':
- return ViActions.MoveToPreviousEmptyLine;
- case '}':
- return ViActions.MoveToNextEmptyLine;
- }
- return null;
- }
-
- public static Action<TextEditorData> GetDirectionKeyAction (Gdk.Key key, Gdk.ModifierType modifier)
- {
- //
- // NO MODIFIERS
- //
- if ((modifier & (Gdk.ModifierType.ShiftMask | Gdk.ModifierType.ControlMask)) == 0) {
- switch (key) {
- case Gdk.Key.Left:
- case Gdk.Key.KP_Left:
- return ViActions.Left;
-
- case Gdk.Key.Right:
- case Gdk.Key.KP_Right:
- return ViActions.Right;
-
- case Gdk.Key.Up:
- case Gdk.Key.KP_Up:
- return ViActions.Up;
-
- case Gdk.Key.Down:
- case Gdk.Key.KP_Down:
- return ViActions.Down;
-
- //not strictly vi, but more useful IMO
- case Gdk.Key.KP_Home:
- case Gdk.Key.Home:
- return CaretMoveActions.LineHome;
-
- case Gdk.Key.KP_End:
- case Gdk.Key.End:
- return ViActions.LineEnd;
-
- case Gdk.Key.Page_Up:
- case Gdk.Key.KP_Page_Up:
- return CaretMoveActions.PageUp;
-
- case Gdk.Key.Page_Down:
- case Gdk.Key.KP_Page_Down:
- return CaretMoveActions.PageDown;
- }
- }
- //
- // === CONTROL ===
- //
- else if ((modifier & Gdk.ModifierType.ShiftMask) == 0
- && (modifier & Gdk.ModifierType.ControlMask) != 0)
- {
- switch (key) {
- case Gdk.Key.Left:
- case Gdk.Key.KP_Left:
- return CaretMoveActions.PreviousWord;
-
- case Gdk.Key.Right:
- case Gdk.Key.KP_Right:
- return CaretMoveActions.NextWord;
-
- case Gdk.Key.Up:
- case Gdk.Key.KP_Up:
- return ScrollActions.Up;
-
- // usually bound at IDE level
- case Gdk.Key.u:
- return CaretMoveActions.PageUp;
-
- case Gdk.Key.Down:
- case Gdk.Key.KP_Down:
- return ScrollActions.Down;
-
- case Gdk.Key.d:
- return CaretMoveActions.PageDown;
-
- case Gdk.Key.KP_Home:
- case Gdk.Key.Home:
- return CaretMoveActions.ToDocumentStart;
-
- case Gdk.Key.KP_End:
- case Gdk.Key.End:
- return CaretMoveActions.ToDocumentEnd;
- }
- }
- return null;
- }
-
- public static Action<TextEditorData> GetInsertKeyAction (Gdk.Key key, Gdk.ModifierType modifier)
- {
- //
- // NO MODIFIERS
- //
- if ((modifier & (Gdk.ModifierType.ShiftMask | Gdk.ModifierType.ControlMask)) == 0) {
- switch (key) {
- case Gdk.Key.Tab:
- return MiscActions.InsertTab;
-
- case Gdk.Key.Return:
- case Gdk.Key.KP_Enter:
- return MiscActions.InsertNewLine;
-
- case Gdk.Key.BackSpace:
- return DeleteActions.Backspace;
-
- case Gdk.Key.Delete:
- case Gdk.Key.KP_Delete:
- return DeleteActions.Delete;
-
- case Gdk.Key.Insert:
- return MiscActions.SwitchCaretMode;
- }
- }
- //
- // CONTROL
- //
- else if ((modifier & Gdk.ModifierType.ControlMask) != 0
- && (modifier & Gdk.ModifierType.ShiftMask) == 0)
- {
- switch (key) {
- case Gdk.Key.BackSpace:
- return DeleteActions.PreviousWord;
-
- case Gdk.Key.Delete:
- case Gdk.Key.KP_Delete:
- return DeleteActions.NextWord;
- }
- }
- //
- // SHIFT
- //
- else if ((modifier & Gdk.ModifierType.ControlMask) == 0
- && (modifier & Gdk.ModifierType.ShiftMask) != 0)
- {
- switch (key) {
- case Gdk.Key.Tab:
- return MiscActions.RemoveTab;
-
- case Gdk.Key.BackSpace:
- return DeleteActions.Backspace;
-
- case Gdk.Key.Return:
- case Gdk.Key.KP_Enter:
- return MiscActions.InsertNewLine;
- }
- }
- return null;
- }
-
- public static Action<TextEditorData> GetCommandCharAction (char c)
- {
- switch (c) {
- case 'u':
- return MiscActions.Undo;
- }
- return null;
- }
- }
-}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViActions.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViActions.cs
index dab41c1bd5..27fdac0607 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViActions.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViActions.cs
@@ -34,16 +34,6 @@ namespace Mono.TextEditor.Vi
{
public static class ViActions
{
- public static void NextSubwordEnd (TextEditorData data)
- {
- data.Caret.Offset = ViWordFindStrategy.FindNextSubwordEndOffset (data.Document, data.Caret.Offset);
- }
-
- public static void NextWordEnd (TextEditorData data)
- {
- data.Caret.Offset = ViWordFindStrategy.FindNextWordEndOffset (data.Document, data.Caret.Offset);
- }
-
public static void MoveToNextEmptyLine (TextEditorData data)
{
if (data.Caret.Line == data.Document.LineCount) {
@@ -305,7 +295,7 @@ namespace Mono.TextEditor.Vi
|| matchingEndBrace != endTokenOffset.GetValueOrDefault ()))
endTokenOffset = matchingEndBrace;
- if (!startTokenOffset.HasValue || !endTokenOffset.HasValue) throw new ViModeAbortException();
+ if (!startTokenOffset.HasValue || !endTokenOffset.HasValue) throw new Exception();
result = new SymbolBlock
{
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViBuilderContext.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViBuilderContext.cs
deleted file mode 100644
index 456b43ba18..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViBuilderContext.cs
+++ /dev/null
@@ -1,322 +0,0 @@
-//
-
-// ViBuilderContext.cs
-//
-// Author:
-// Michael Hutchinson <mhutchinson@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using Gdk;
-using System.Collections.Generic;
-using System.Text;
-using Mono.TextEditor;
-using System.Linq;
-
-namespace Mono.TextEditor.Vi
-{
-
- /// <summary>
- /// Returns true if it handled the keystroke.
- /// </summary>
- public delegate bool ViBuilder (ViBuilderContext ctx);
-
- public class ViBuilderContext
- {
- readonly ViEditor editor;
- readonly List<ViKey> keys = new List<ViKey> ();
-
- ViBuilderContext (ViEditor editor)
- {
- this.editor = editor;
- Multiplier = 1;
- }
-
- public void ProcessKey (Key key, char ch, ModifierType modifiers)
- {
- var k = ch == '\0'? new ViKey (modifiers, key) : new ViKey (modifiers, ch);
- Keys.Add (k);
- if (!Builder (this)) {
- SetError ("Unknown command");
- }
- }
-
- public void SetError (string error)
- {
- Completed = Error = true;
- Message = error;
- }
-
- public string Message { get; set; }
- public int Multiplier { get; set; }
- public char Register { get; set; }
- protected ViEditor Editor { get { return editor; } }
- public List<ViKey> Keys { get { return keys; } }
- public bool Completed { get; private set; }
- public bool Error { get; private set; }
-
- //copied from EditMode.cs, with the undo stack handling code removed
- public void InsertChar (char ch)
- {
- var data = Editor.Data;
- var doc = Editor.Document;
- var caret = Editor.Data.Caret;
-
- if (!data.CanEdit (data.Caret.Line))
- return;
-
- if (Editor.Editor != null)
- Editor.Editor.HideMouseCursor ();
-
- data.DeleteSelectedText (data.IsSomethingSelected ? data.MainSelection.SelectionMode != SelectionMode.Block : true);
-
- if (!char.IsControl (ch) && data.CanEdit (caret.Line)) {
- DocumentLine line = doc.GetLine (caret.Line);
- if (caret.IsInInsertMode || caret.Column >= line.Length + 1) {
- string text;
- if (data.HasIndentationTracker) {
- text = caret.Column > line.Length + 1 ? data.GetIndentationString (caret.Location) + ch.ToString () : ch.ToString ();
- } else {
- text = ch.ToString ();
- }
- if (data.IsSomethingSelected && data.MainSelection.SelectionMode == SelectionMode.Block) {
- int length = 0;
- for (int lineNumber = data.MainSelection.MinLine; lineNumber <= data.MainSelection.MaxLine; lineNumber++) {
- length = data.Insert (doc.GetLine (lineNumber).Offset + caret.Column, text);
- }
- caret.PreserveSelection = true;
- caret.Column += length - 1;
- data.MainSelection = data.MainSelection.WithRange (
- new DocumentLocation (data.MainSelection.Anchor.Line, caret.Column + 1),
- new DocumentLocation (data.MainSelection.Lead.Line, caret.Column + 1)
- );
- doc.CommitMultipleLineUpdate (data.MainSelection.MinLine, data.MainSelection.MaxLine);
- } else {
- int length = data.Insert (caret.Offset, text);
- caret.Column += length - 1;
- }
- } else {
- data.Replace (caret.Offset, 1, ch.ToString ());
- }
- caret.Column++;
- if (caret.PreserveSelection)
- caret.PreserveSelection = false;
- }
- if (data.IsSomethingSelected && data.MainSelection.SelectionMode == SelectionMode.Block)
- data.Caret.PreserveSelection = false;
- }
-
- public void RunAction (Action<ViEditor> action)
- {
- Completed = true;
-
- //FALLBACK for builders that don't handler multipliers directly
- //we cap these at 100, to reduce the length of time MD could be unresponsive
- if (Multiplier > 1) {
- for (int i = 0; i < System.Math.Min (100, Multiplier); i++)
- action (editor);
- } else {
- action (editor);
- }
- }
-
- public ViEditorMode Mode { get { return Editor.Mode; } }
-
- //HACK: this is really inelegant
- public void SuppressCompleted ()
- {
- Completed = false;
- }
-
- private ViBuilder _builder;
-
- public ViBuilder Builder {
- get { return _builder; }
- set {
- if (_builder == value)
- return;
- if (value == null)
- throw new ArgumentException ("builder cannot be null");
- if (Completed)
- throw new InvalidOperationException ("builder cannot be set after context is completed");
- _builder = value;
- }
- }
-
- public ViKey LastKey {
- get { return Keys[Keys.Count - 1]; }
- }
-
- public static ViBuilderContext Create (ViEditor editor)
- {
- return new ViBuilderContext (editor) {
- Builder = normalBuilder
- };
- }
-
- static ViBuilderContext ()
- {
- normalBuilder =
- ViBuilders.RegisterBuilder (
- ViBuilders.MultiplierBuilder (
- ViBuilders.First (normalActions.Builder, motions.Builder, nonCharMotions.Builder)));
- insertActions = ViBuilders.First (nonCharMotions.Builder, insertEditActions.Builder);
- }
-
- static ViBuilder normalBuilder, insertActions;
-
- static ViCommandMap normalActions = new ViCommandMap () {
- { 'J', ViActions.Join },
- { 'z', new ViCommandMap () {
- { 'A', FoldActions.ToggleFoldRecursive },
- { 'C', FoldActions.CloseFoldRecursive },
- { 'M', FoldActions.CloseAllFolds },
- { 'O', FoldActions.OpenFoldRecursive },
- { 'R', FoldActions.OpenAllFolds },
- { 'a', FoldActions.ToggleFold },
- { 'c', FoldActions.CloseFold },
- { 'o', FoldActions.OpenFold },
- }},
- { 'g', new ViCommandMap () {
- { 'g', GotoLine, true },
- }},
- { 'r', ViBuilders.ReplaceChar },
- { '~', ViActions.ToggleCase },
- { 'm', ViBuilders.Mark },
- { 'M', ViEditorActions.CaretToScreenCenter },
- { 'H', ViEditorActions.CaretToScreenTop },
- { 'L', ViEditorActions.CaretToScreenBottom },
- { 'u', MiscActions.Undo },
- { 'i', Insert, true },
- { 'R', Replace, true },
- { 'o', Open, true },
- { 'O', OpenAbove, true },
- { new ViKey (ModifierType.ControlMask, Key.Up), ScrollActions.Up },
- { new ViKey (ModifierType.ControlMask, Key.KP_Up), ScrollActions.Up },
- { new ViKey (ModifierType.ControlMask, Key.Down), ScrollActions.Down },
- { new ViKey (ModifierType.ControlMask, Key.KP_Down), ScrollActions.Down },
- };
-
- static ViCommandMap motions = new ViCommandMap () {
- { '`', ViBuilders.GoToMark },
- { 'h', ViActions.Left },
- { 'b', CaretMoveActions.PreviousSubword },
- { 'B', CaretMoveActions.PreviousWord },
- { 'l', ViActions.Right },
- { 'w', CaretMoveActions.NextSubword },
- { 'W', CaretMoveActions.NextWord },
- { 'k', ViActions.Up },
- { 'j', ViActions.Down },
- { '%', MiscActions.GotoMatchingBracket },
- { '0', CaretMoveActions.LineStart },
- { '^', CaretMoveActions.LineFirstNonWhitespace },
- { '_', CaretMoveActions.LineFirstNonWhitespace },
- { '$', ViActions.LineEnd },
- { 'G', CaretMoveActions.ToDocumentEnd },
- { '{', ViActions.MoveToPreviousEmptyLine },
- { '}', ViActions.MoveToNextEmptyLine },
- };
-
- static ViCommandMap nonCharMotions = new ViCommandMap () {
- { Key.Left, ViActions.Left },
- { Key.KP_Left, ViActions.Left },
- { Key.Right, ViActions.Right },
- { Key.KP_Right, ViActions.Right },
- { Key.Up, ViActions.Up },
- { Key.KP_Up, ViActions.Up },
- { Key.Down, ViActions.Down },
- { Key.KP_Down, ViActions.Down },
- { Key.KP_Home, CaretMoveActions.LineHome },
- { Key.Home, CaretMoveActions.LineHome },
- { Key.KP_End, ViActions.LineEnd },
- { Key.End, ViActions.LineEnd },
- { Key.Page_Up, CaretMoveActions.PageUp },
- { Key.KP_Page_Up, CaretMoveActions.PageUp },
- { Key.Page_Down, CaretMoveActions.PageDown },
- { Key.KP_Page_Down, CaretMoveActions.PageDown },
- { new ViKey (ModifierType.ControlMask, Key.Left), CaretMoveActions.PreviousWord },
- { new ViKey (ModifierType.ControlMask, Key.KP_Left), CaretMoveActions.PreviousWord },
- { new ViKey (ModifierType.ControlMask, Key.Right), CaretMoveActions.NextWord },
- { new ViKey (ModifierType.ControlMask, Key.KP_Right), CaretMoveActions.NextWord },
- { new ViKey (ModifierType.ControlMask, Key.Home), CaretMoveActions.ToDocumentStart },
- { new ViKey (ModifierType.ControlMask, Key.KP_Home), CaretMoveActions.ToDocumentStart },
- { new ViKey (ModifierType.ControlMask, Key.End), CaretMoveActions.ToDocumentEnd },
- { new ViKey (ModifierType.ControlMask, Key.KP_End), CaretMoveActions.ToDocumentEnd },
- { new ViKey (ModifierType.ControlMask, 'u'), CaretMoveActions.PageUp },
- { new ViKey (ModifierType.ControlMask, 'd'), CaretMoveActions.PageDown },
- };
-
- static ViCommandMap insertEditActions = new ViCommandMap () {
- { Key.Tab, MiscActions.InsertTab },
- { Key.Return, MiscActions.InsertNewLine },
- { Key.KP_Enter, MiscActions.InsertNewLine },
- { Key.BackSpace, DeleteActions.Backspace },
- { Key.Delete, DeleteActions.Delete },
- { Key.KP_Delete, DeleteActions.Delete },
- { Key.Insert, MiscActions.SwitchCaretMode },
- { new ViKey (ModifierType.ControlMask, Key.BackSpace), DeleteActions.PreviousWord },
- { new ViKey (ModifierType.ControlMask, Key.Delete), DeleteActions.NextWord },
- { new ViKey (ModifierType.ControlMask, Key.KP_Delete), DeleteActions.NextWord },
- { new ViKey (ModifierType.ShiftMask, Key.Tab), MiscActions.RemoveTab },
- { new ViKey (ModifierType.ShiftMask, Key.BackSpace), DeleteActions.Backspace },
- };
-
- static bool Insert (ViBuilderContext ctx)
- {
- ctx.RunAction ((ViEditor e) => e.SetMode (ViEditorMode.Insert));
- ctx.SuppressCompleted ();
-
- ctx.Builder = ViBuilders.InsertBuilder (insertActions);
- return true;
- }
-
- static bool Replace (ViBuilderContext ctx)
- {
- ctx.RunAction ((ViEditor e) => e.SetMode (ViEditorMode.Replace));
- ctx.SuppressCompleted ();
-
- ctx.Builder = ViBuilders.InsertBuilder (insertActions);
- return true;
- }
-
- static bool Open (ViBuilderContext ctx)
- {
- ctx.RunAction ((ViEditor e) => MiscActions.InsertNewLineAtEnd (e.Data));
- return Insert (ctx);
- }
-
- static bool OpenAbove (ViBuilderContext ctx)
- {
- // FIXME: this doesn't work correctly on the first line
- ctx.RunAction ((ViEditor e) => ViActions.Up (e.Data));
- return Open (ctx);
- }
-
- static bool GotoLine (ViBuilderContext ctx)
- {
- ctx.RunAction ((ViEditor e) => ViEditorActions.CaretToLineNumber (ctx.Multiplier, e));
- ctx.RunAction ((ViEditor e) => CaretMoveActions.LineFirstNonWhitespace (e.Data));
- return true;
- }
- }
-}
-
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViBuilders.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViBuilders.cs
deleted file mode 100644
index 20a8d05245..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViBuilders.cs
+++ /dev/null
@@ -1,206 +0,0 @@
-//
-// ViBuilders.cs
-//
-// Author:
-// Michael Hutchinson <mhutchinson@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Linq;
-using Gdk;
-using System.Text;
-
-namespace Mono.TextEditor.Vi
-{
- class ViBuilders
- {
- public static bool Mark (ViBuilderContext ctx)
- {
- char c = ctx.LastKey.Char;
- if (!char.IsLetterOrDigit (c)) {
- ctx.SetError ("Invalid Mark");
- return true;
- }
-
- ctx.RunAction ((ViEditor ed) => {
- ViMark mark;
- if (!ed.Marks.TryGetValue (c, out mark))
- ed.Marks [c] = mark = new ViMark (c);
- mark.SaveMark (ed.Data);
- });
- return true;
- }
-
- public static ViBuilder InsertBuilder (ViBuilder preInsertActions)
- {
- var lastInserted = new StringBuilder ();
- bool inUndoTx = false;
- return (ViBuilderContext ctx) => {
- var l = ctx.LastKey;
- bool noModifiers = l.Modifiers == ModifierType.None;
-
- ctx.Message = ctx.Mode == ViEditorMode.Replace? "-- REPLACE --" : "-- INSERT --";
-
- if ((noModifiers && l.Key == Key.Escape) || (l.Char == 'c' && (l.Modifiers & ModifierType.ControlMask) != 0)) {
- ctx.RunAction ((ViEditor ed) => {
- if (inUndoTx)
- {
- ed.Document.EndAtomicUndo ();
- inUndoTx = false;
- }
- ed.LastInsertedText = lastInserted.ToString ();
- ed.SetMode (ViEditorMode.Normal);
- });
- return true;
- }
-
- //keypad motions etc
- if (preInsertActions (ctx)) {
- if (inUndoTx)
- ctx.RunAction ( (ed) => ed.Document.EndAtomicUndo () );
- inUndoTx = false;
- ctx.SuppressCompleted ();
- lastInserted.Length = 0;
- return true;
- }
-
- if (l.Char != '\0' && noModifiers) {
- if (!inUndoTx)
- ctx.RunAction ( (ed) => ed.Document.BeginAtomicUndo () );
- inUndoTx = true;
- ctx.SuppressCompleted ();
- lastInserted.Append (l.Char);
- ctx.InsertChar (l.Char);
- return true;
- }
-
- return false;
- };
- }
-
- public static bool GoToMark (ViBuilderContext ctx)
- {
- char c = ctx.LastKey.Char;
- if (!char.IsLetterOrDigit (c)) {
- ctx.SetError ("Invalid Mark");
- return true;
- }
-
- ctx.RunAction ((ViEditor ed) => {
- ViMark mark;
- if (ed.Marks.TryGetValue (c, out mark))
- mark.LoadMark (ed.Data);
- else
- ed.Reset ("Unknown Mark");
- });
- return true;
- }
-
-
- public static bool ReplaceChar (ViBuilderContext ctx)
- {
- if (ctx.LastKey.Char != '\0')
- ctx.RunAction ((ViEditor ed) => ed.Data.Replace (ed.Data.Caret.Offset, 1, ctx.LastKey.Char.ToString ()));
- else
- ctx.SetError ("Expecting a character");
- return true;
- }
-
- static void StartRegisterBuilder (ViBuilderContext ctx, ViBuilder nextBuilder)
- {
- if (ctx.Register != '\0') {
- ctx.SetError ("Register already set");
- return;
- }
- ctx.Builder = (ViBuilderContext x) => {
- char c = x.LastKey.Char;
- if (!ViEditor.IsValidRegister (c)) {
- x.SetError ("Invalid register");
- return true;
- }
- x.Register = c;
- x.Builder = nextBuilder;
- return true;
- };
- }
-
- static void StartMultiplierBuilder (ViBuilderContext ctx, ViBuilder nextBuilder)
- {
- int factor = 1;
- int multiplier = 0;
- ctx.Builder = (ViBuilderContext x) => {
- int c = (int)x.LastKey.Char;
- if (c >= (int)'0' && c <= (int)'9') {
- //don't eat '0' if not preceded by non-zero digit
- //pass on to interpret as goto line start
- if (c == (int)'0' && factor == 1) {
- ctx.Multiplier *= multiplier;
- ctx.Builder = nextBuilder;
- return ctx.Builder (ctx);
- }
- int d = c - (int)'0';
- multiplier = multiplier * factor + d;
- factor *= 10;
- return true;
- } else {
- ctx.Multiplier *= multiplier;
- ctx.Builder = nextBuilder;
- return ctx.Builder (ctx);
- }
- };
- ctx.Builder (ctx);
- }
-
- public static ViBuilder MultiplierBuilder (ViBuilder nextBuilder)
- {
- return (ViBuilderContext ctx) => {
- var k = ctx.LastKey;
- if (char.IsDigit (k.Char)) {
- ViBuilders.StartMultiplierBuilder (ctx, nextBuilder);
- return true;
- } else {
- ctx.Builder = nextBuilder;
- return ctx.Builder (ctx);
- }
- };
- }
-
- public static ViBuilder RegisterBuilder (ViBuilder nextBuilder)
- {
- return (ViBuilderContext ctx) => {
- var k = ctx.LastKey;
- if (k.Char == '"') {
- ViBuilders.StartRegisterBuilder (ctx, nextBuilder);
- return true;
- } else {
- ctx.Builder = nextBuilder;
- return ctx.Builder (ctx);
- }
- };
- }
-
- public static ViBuilder First (params ViBuilder[] builders)
- {
- return (ViBuilderContext ctx) => builders.Any (b => b (ctx));
- }
- }
-}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViCommandMap.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViCommandMap.cs
deleted file mode 100644
index bf59e0e0ec..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViCommandMap.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// ViCommandMap.cs
-//
-// Author:
-// Michael Hutchinson <mhutchinson@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-using Mono.TextEditor;
-
-namespace Mono.TextEditor.Vi
-{
- class ViCommandMap : IEnumerable<KeyValuePair<ViKey,Action<ViEditor>>>
- {
- Dictionary<ViKey,BuilderAction> builders = new Dictionary<ViKey, BuilderAction> ();
- Dictionary<ViKey,Action<ViEditor>> actions = new Dictionary<ViKey,Action<ViEditor>> ();
-
- public bool Builder (ViBuilderContext ctx)
- {
- Action<ViEditor> a;
- if (actions.TryGetValue (ctx.LastKey, out a)) {
- ctx.RunAction (a);
- return true;
- } else {
- BuilderAction b;
- if (builders.TryGetValue (ctx.LastKey, out b)) {
- ctx.Builder = b.Builder;
- if (b.RunInstantly)
- ctx.Builder (ctx);
- return true;
- }
- }
- return false;
- }
-
- public void Add (ViKey key, ViCommandMap map)
- {
- Add (key, map.Builder);
- }
-
- public void Add (ViKey key, Action<ViEditor> action)
- {
- this.actions[key] = action;
- }
-
- public void Add (ViKey key, Action<TextEditorData> action)
- {
- this.actions[key] = (ViEditor ed) => action (ed.Data);
- }
-
- public void Add (ViKey key, ViBuilder builder)
- {
- Add (key, builder, false);
- }
-
- public void Add (ViKey key, ViBuilder builder, bool runInstantly)
- {
- this.builders[key] = new BuilderAction (builder, runInstantly);
- }
-
- System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator ()
- {
- return builders.GetEnumerator ();
- }
-
- public IEnumerator<KeyValuePair<ViKey,Action<ViEditor>>> GetEnumerator ()
- {
- return actions.GetEnumerator ();
- }
-
- struct BuilderAction
- {
- public BuilderAction (ViBuilder builder, bool runInstantly)
- {
- this.Builder = builder;
- this.RunInstantly = runInstantly;
- }
-
- public readonly ViBuilder Builder;
- public readonly bool RunInstantly;
- }
- }
-}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViEditor.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViEditor.cs
deleted file mode 100644
index 83110bd41e..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViEditor.cs
+++ /dev/null
@@ -1,314 +0,0 @@
-//
-// ViEditorContext.cs
-//
-// Author:
-// Michael Hutchinson <mhutchinson@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc. (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Gdk;
-
-namespace Mono.TextEditor.Vi
-{
- public class ViEditor
- {
- NewViEditMode editMode;
-
- #region Register constants
- const char REG_YANK_DEFAULT = '0';
- const char REG_DELETE_DEFAULT = '1';
- const char REG_PASTE_DEFAULT = '"';
- const char REG_DELETE_SMALL = '-';
- const char REG_BLACKHOLE = '_';
- const char REG_LAST_INSERTED_TEXT = '.';
- const char REG_FILENAME_CURRENT = '%';
- const char REG_FILENAME_ALTERNATE = '#';
- const char REG_LAST_COMMANDLINE = ':';
- const char REG_X11_PRIMARY = '*';
- const char REG_X11_CLIPBOARD = '+';
- const char REG_X11_LAST_DROP = '~';
- const char REG_LAST_SEARCH = '/';
- #endregion
-
- Dictionary<char,string> registers = new Dictionary<char,string> ();
- Dictionary<char,ViMark> marks = new Dictionary<char, ViMark> ();
-
- public TextEditor Editor { get { return editMode.Editor; } }
- public TextEditorData Data { get { return editMode.Data; } }
- public TextDocument Document { get { return Data.Document; } }
- ViBuilderContext Context { get; set; }
-
- public event EventHandler ModeChanged;
- public event EventHandler MessageChanged;
-
- string message;
- public string Message {
- get {
- return message;
- }
- private set {
- message = value;
- var e = MessageChanged;
- if (e != null)
- e (this, EventArgs.Empty);
- }
- }
-
- ViEditorMode mode;
- public ViEditorMode Mode {
- get {
- return mode;
- }
- private set {
- mode = value;
- var e = ModeChanged;
- if (e != null)
- e (this, EventArgs.Empty);
- }
- }
-
- //shared between editors in the same process
- //TODO: maybe move these into some kind of shared context to pass around explicitly
- static char lastRegisterUsed = '0';
- static string lastPattern;
- static string lastCommandline;
- static string lastInsertedText;
-
- public string LastCommandline {
- get { return lastCommandline; }
- set { lastCommandline = value; }
- }
-
- public string LastPattern {
- get { return lastPattern; }
- set { lastPattern = value; }
- }
-
- public string LastInsertedText {
- get { return lastInsertedText; }
- set { lastInsertedText = value; }
- }
-
- public void Reset (string message)
- {
- Context = ViBuilderContext.Create (this);
- Message = message;
-
- if (Data.Caret.Mode != CaretMode.Block) {
- Data.Caret.Mode = CaretMode.Block;
- if (Data.Caret.Column > DocumentLocation.MinColumn)
- Data.Caret.Column--;
- }
- ViActions.RetreatFromLineEnd (Data);
- }
-
- public void SetMode (ViEditorMode mode)
- {
- if (this.Mode == mode)
- return;
- this.Mode = mode;
-
- if (Data == null)
- return;
-
- switch (mode) {
- case ViEditorMode.Insert:
- Message = "-- INSERT --";
- editMode.SetCaretMode (CaretMode.Insert);
- break;
- case ViEditorMode.Normal:
- editMode.SetCaretMode (CaretMode.Block);
- break;
- case ViEditorMode.Replace:
- Message = "-- REPLACE --";
- editMode.SetCaretMode (CaretMode.Underscore);
- break;
- }
- }
-
- public void OnCaretPositionChanged ()
- {
- switch (Mode) {
- case ViEditorMode.Insert:
- case ViEditorMode.Replace:
- case ViEditorMode.Visual:
- return;
- case ViEditorMode.Normal:
- ViActions.RetreatFromLineEnd (Data);
- break;
- default:
- Reset ("");
- break;
- }
- }
-
- public void ProcessKey (Gdk.ModifierType modifiers, Key key, char ch)
- {
- if (Context == null)
- Reset ("");
-
- Context.ProcessKey (key, ch, modifiers);
- if (Context.Completed) {
- Reset (Context.Message);
- } else {
- Message = Context.Message;
- }
- }
-
- public Dictionary<char,ViMark> Marks { get { return marks; } }
-
- public bool SearchBackward { get; set; }
- public string LastReplacement { get; set; }
-
- public ViEditor (NewViEditMode editMode)
- {
- this.editMode = editMode;
- SetMode (ViEditorMode.Normal);
- }
-
- public string GetRegisterContents (char register)
- {
- if (register == '"')
- register = lastRegisterUsed;
-
- switch (register) {
- case REG_LAST_INSERTED_TEXT:
- return LastInsertedText;
-
- case REG_FILENAME_ALTERNATE:
- case REG_FILENAME_CURRENT:
- return Document.FileName;
-
- case REG_LAST_COMMANDLINE:
- return LastCommandline;
-
- case REG_LAST_SEARCH:
- return LastPattern;
-
- case REG_X11_PRIMARY:
- case REG_X11_CLIPBOARD:
- case REG_X11_LAST_DROP:
- throw new NotImplementedException("X11 registers");
-
- case REG_DELETE_SMALL:
- break;
-
- default:
- int regInt = (int)register;
- if (((int)'a' <= regInt && regInt <= (int)'z')
- || ((int)'A' <= regInt && regInt <= (int)'Z')
- || ((int)'0' <= regInt && regInt <= (int)'9'))
- break;
- else
- throw new InvalidOperationException ("Invalid register '" + register + "'.");
- }
-
- string value;
- registers.TryGetValue (register, out value);
- return value;
- }
-
- //FIXME: add others when implemented
- static string validSetRegisters = "\"-";
- static string validGetRegisters = ".%#:/-";
- static string validRegisters = "\".%#:/-";
-
- public static bool IsValidRegister (char c)
- {
- int regInt = (int) c;
- return (((int)'a' <= regInt && regInt <= (int)'z')
- || ((int)'A' <= regInt && regInt <= (int)'Z')
- || ((int)'0' <= regInt && regInt <= (int)'9')
- || validRegisters.Contains (c));
- }
-
- public static bool IsValidSetRegister (char c)
- {
- int regInt = (int) c;
- return (((int)'a' <= regInt && regInt <= (int)'z')
- || ((int)'A' <= regInt && regInt <= (int)'Z')
- || ((int)'0' <= regInt && regInt <= (int)'9')
- || validSetRegisters.Contains (c));
- }
-
- public static bool IsValidGetRegister (char c)
- {
- int regInt = (int) c;
- return (((int)'a' <= regInt && regInt <= (int)'z')
- || ((int)'A' <= regInt && regInt <= (int)'Z')
- || ((int)'0' <= regInt && regInt <= (int)'9')
- || validGetRegisters.Contains (c));
- }
-
- public void SetRegisterContents (char register, string value)
- {
- switch (register) {
- case REG_X11_PRIMARY:
- case REG_X11_CLIPBOARD:
- throw new NotImplementedException ("GUI clipboard");
-
- //delete/change registers
- case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '8':
- //move registers 1-8 downwards if needed
- for (int i = (int)'8'; i >= (int)register; i--)
- registers[(char)(i + 1)] = registers[(char)i];
- break;
-
- case '0':
- case '9':
- case REG_DELETE_SMALL:
- break;
-
- case REG_PASTE_DEFAULT:
- register = '0';
- break;
-
- default:
- int regInt = (int) register;
- if (((int)'a' <= regInt && regInt <= (int)'z')
- || ((int)'A' <= regInt && regInt <= (int)'Z'))
- break;
- else
- throw new InvalidOperationException ("Cannot write to register '" + register + "'.");
- }
-
- lastRegisterUsed = register;
- registers[register] = value;
- }
- }
-
- public enum ViEditorMode
- {
- Normal = 0,
- Insert, // I
- Replace, // R
- Visual, // v
- VisualLine, // V
- VisualBlock, // ^V TODO
- Command,
- }
-}
-
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViEditorActions.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViEditorActions.cs
deleted file mode 100644
index 8c65bf988d..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViEditorActions.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// ViEditorActions.cs
-//
-// Author:
-// Michael Hutchinson <mhutchinson@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using Mono.TextEditor;
-
-namespace Mono.TextEditor.Vi
-{
- public class ViEditorActions
- {
- public static void CaretToScreenCenter (ViEditor ed)
- {
- var line = ed.Editor.PointToLocation (0, ed.Editor.Allocation.Height/2).Line;
- if (line < 0)
- line = ed.Data.Document.LineCount;
- ed.Data.Caret.Line = line;
- }
-
- public static void CaretToScreenBottom (ViEditor ed)
- {
- int line = ed.Editor.PointToLocation (0, ed.Editor.Allocation.Height - ed.Editor.LineHeight * 2 - 2).Line;
- if (line < 0)
- line = ed.Data.Document.LineCount;
- ed.Data.Caret.Line = line;
- }
-
- public static void CaretToScreenTop (ViEditor ed)
- {
- ed.Data.Caret.Line = System.Math.Max (0, ed.Editor.PointToLocation (0, ed.Editor.LineHeight - 1).Line);
- }
-
- public static void CaretToLineNumber (int lineNumber, ViEditor ed)
- {
- ed.Data.Caret.Line = System.Math.Max (1, lineNumber);
- }
- }
-}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViKeyNotation.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViKeyNotation.cs
deleted file mode 100644
index 79d818f14d..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViKeyNotation.cs
+++ /dev/null
@@ -1,424 +0,0 @@
-//
-// ViKeyNotation.cs
-//
-// Author:
-// Michael Hutchinson <mhutchinson@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc. (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using Gdk;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Mono.TextEditor.Vi
-{
- public struct ViKey : IEquatable<ViKey>
- {
- Gdk.ModifierType modifiers;
- char ch;
- Gdk.Key key;
-
- public ViKey (char ch) : this (ModifierType.None, ch, (Gdk.Key) 0)
- {
- }
-
- public ViKey (Gdk.Key key) : this (ModifierType.None, '\0', key)
- {
- }
-
- public ViKey (ModifierType modifiers, Gdk.Key key) : this (modifiers, '\0', key)
- {
- }
-
- public ViKey (ModifierType modifiers, char ch) : this (modifiers, ch, (Gdk.Key)0)
- {
- }
-
- ViKey (ModifierType modifiers, char ch, Gdk.Key key): this ()
- {
- this.modifiers = modifiers & KnownModifiers;
- this.ch = ch;
- this.key = key;
- }
-
- public ModifierType Modifiers { get { return this.modifiers; } }
- public char Char { get { return this.ch; } }
- public Key Key { get { return this.key; } }
-
- static ModifierType KnownModifiers = ModifierType.ShiftMask | ModifierType.MetaMask
- | ModifierType.ControlMask | ModifierType.Mod1Mask;
-
- public static implicit operator ViKey (char ch)
- {
- return new ViKey (ch);
- }
-
- public static implicit operator ViKey (Gdk.Key key)
- {
- return new ViKey (key);
- }
-
- public bool Equals (ViKey other)
- {
- return modifiers == other.modifiers && ch == other.ch && key == other.key;
- }
-
- public override bool Equals (object obj)
- {
- if (obj == null)
- return false;
- if (object.Equals (this, obj))
- return true;
- if (!(obj is ViKey))
- return false;
- return Equals ((ViKey)obj);
- }
-
- public override int GetHashCode ()
- {
- unchecked {
- return modifiers.GetHashCode () ^ ch.GetHashCode () ^ key.GetHashCode ();
- }
- }
-
- public override string ToString()
- {
- return ViKeyNotation.IsValid(this)? ViKeyNotation.ToString(this) : "<Invalid>";
- }
- }
-
- public static class ViKeyNotation
- {
- public static string ToString(ViKey key)
- {
- var sb = new StringBuilder();
- ViKeyNotation.AppendToString(key, sb);
- return sb.ToString();
- }
-
- public static string ToString (IList<ViKey> keys)
- {
- var sb = new StringBuilder ();
- foreach (var k in keys)
- AppendToString (k, sb);
- return sb.ToString ();
- }
-
- static void AppendToString (ViKey key, StringBuilder sb)
- {
- var c = GetString (key.Char);
- if (c != null && key.Char != '\0') {
- if (c.Length == 1 && key.Modifiers == ModifierType.None) {
- sb.Append (c);
- return;
- }
- } else {
- c = GetString (key.Key);
- }
-
- if (c == null) {
- var msg = string.Format ("Invalid key char=0x{0:x} key={1}", (int)key.Char, key.Key);
- throw new InvalidOperationException (msg);
- }
-
- sb.Append ("<");
-
- if ((key.Modifiers & ModifierType.ShiftMask) != 0)
- sb.Append ("S-");
- if ((key.Modifiers & ModifierType.ControlMask) != 0)
- sb.Append ("C-");
- if ((key.Modifiers & ModifierType.Mod1Mask) != 0)
- sb.Append ("M-");
- if ((key.Modifiers & ModifierType.MetaMask) != 0) //HACK: Mac command key
- sb.Append ("D-");
-
- sb.Append (c);
- sb.Append (">");
- }
-
- public static bool IsValid (ViKey key)
- {
- return GetString (key.Char) != null || keyStringMaps.ContainsKey (key.Key);
- }
-
- static string GetString (char ch)
- {
- string s;
- if (charStringMaps.TryGetValue (ch, out s))
- return s;
- if (char.IsControl (ch))
- return null;
- return ch.ToString ();
- }
-
- static Dictionary<char, string> charStringMaps = new Dictionary<char, string> () {
- { '\0', "Nul" },
- { ' ', "Space" },
- { '\r', "CR" },
- { '\n', "NL" },
- { '\f', "FF" },
- { '\t', "Tab" },
- { '<', "lt" },
- { '\\', "Bslash" },
- { '|', "Bar" },
- };
-
- static string GetString (Key key)
- {
- string str;
- if (keyStringMaps.TryGetValue (key, out str))
- return str;
- return null;
- }
-
- static Dictionary<Gdk.Key, string> keyStringMaps = new Dictionary<Gdk.Key, string> () {
- { Gdk.Key.BackSpace, "BS" },
- { Gdk.Key.Tab, "Tab" },
- { Gdk.Key.Return, "Enter" }, //"CR" "Return"
- { Gdk.Key.Escape, "Esc" },
- { Gdk.Key.space, "Space" },
- { Gdk.Key.KP_Up, "Up" },
- { Gdk.Key.Up, "Up" },
- { Gdk.Key.KP_Down, "Down" },
- { Gdk.Key.Down, "Down" },
- { Gdk.Key.KP_Left, "Left" },
- { Gdk.Key.Left, "Left" },
- { Gdk.Key.KP_Right, "Right" },
- { Gdk.Key.Right, "Right" },
- { Gdk.Key.F1, "F1" },
- { Gdk.Key.F2, "F2" },
- { Gdk.Key.F3, "F3" },
- { Gdk.Key.F4, "F4" },
- { Gdk.Key.F5, "F5" },
- { Gdk.Key.F6, "F6" },
- { Gdk.Key.F7, "F7" },
- { Gdk.Key.F8, "F8" },
- { Gdk.Key.F9, "F9" },
- { Gdk.Key.F10, "F10" },
- { Gdk.Key.F11, "F11" },
- { Gdk.Key.F12, "F12" },
- { Gdk.Key.Insert, "Insert" },
- { Gdk.Key.Delete, "Del" },
- { Gdk.Key.KP_Delete, "kDel" },
- { Gdk.Key.Home, "Home" },
- { Gdk.Key.End, "End" },
- { Gdk.Key.Page_Up, "PageUp" },
- { Gdk.Key.Page_Down, "PageDown" },
- { Gdk.Key.KP_Home, "kHome" },
- { Gdk.Key.KP_End, "kEnd" },
- { Gdk.Key.KP_Page_Up, "kPageUp" },
- { Gdk.Key.KP_Page_Down, "kPageDown" },
- { Gdk.Key.KP_Add, "kPlus" },
- { Gdk.Key.KP_Subtract, "kMinus" },
- { Gdk.Key.KP_Multiply, "kMultiply" },
- { Gdk.Key.KP_Divide, "kDivide" },
- { Gdk.Key.KP_Enter, "kEnter" },
- { Gdk.Key.KP_Decimal, "kPoint" },
- { Gdk.Key.KP_0, "k0" },
- { Gdk.Key.KP_1, "k1" },
- { Gdk.Key.KP_2, "k2" },
- { Gdk.Key.KP_3, "k3" },
- { Gdk.Key.KP_4, "k4" },
- { Gdk.Key.KP_5, "k5" },
- { Gdk.Key.KP_6, "k6" },
- { Gdk.Key.KP_7, "k7" },
- { Gdk.Key.KP_8, "k8" },
- { Gdk.Key.KP_9, "k9" },
- { Gdk.Key.Help, "Help" },
- { Gdk.Key.Undo, "Undo" },
- };
-
- static char GetChar (string charName)
- {
- if (charName.Length == 1)
- return charName[0];
-
- char c;
- if (stringCharMaps.TryGetValue (charName, out c))
- return c;
-
- //FIXME this should be environment/editor-dependent
- if (charName == "EOL")
- return '\n';
-
- throw new FormatException ("Unknown char '" + charName +"'");
- }
-
- static Dictionary<string, char> stringCharMaps = new Dictionary<string, char> () {
- { "Nul", '\0' },
- { "Space", ' ' },
- { "CR", '\r' },
- { "NL", '\n' },
- { "FF", '\f' },
- { "Tab", '\t' },
- { "lt", '<' },
- { "Bslash", '\\' },
- { "Bar", '|' },
- };
-
- static Gdk.Key GetKey (string code)
- {
- Gdk.Key k;
- if (stringKeyMaps.TryGetValue (code, out k))
- return k;
- return (Gdk.Key)0;
- }
-
- static Dictionary<string, Gdk.Key> stringKeyMaps = new Dictionary<string, Gdk.Key> () {
- { "BS", Gdk.Key.BackSpace },
- { "Tab", Gdk.Key.Tab },
- { "CR", Gdk.Key.Return },
- { "Return", Gdk.Key.Return },
- { "Enter", Gdk.Key.Return },
- { "Esc", Gdk.Key.Escape },
- { "Space", Gdk.Key.space },
- { "Up", Gdk.Key.Up },
- { "Down", Gdk.Key.Down },
- { "Left", Gdk.Key.Left },
- { "Right", Gdk.Key.Right },
- { "#1", Gdk.Key.F1 },
- { "F1", Gdk.Key.F1 },
- { "#2", Gdk.Key.F2 },
- { "F2", Gdk.Key.F2 },
- { "#3", Gdk.Key.F3 },
- { "F3", Gdk.Key.F3 },
- { "#4", Gdk.Key.F4 },
- { "F4", Gdk.Key.F4 },
- { "#5", Gdk.Key.F5 },
- { "F5", Gdk.Key.F5 },
- { "#6", Gdk.Key.F6 },
- { "F6", Gdk.Key.F6 },
- { "#7", Gdk.Key.F7 },
- { "F7", Gdk.Key.F7 },
- { "#8", Gdk.Key.F8 },
- { "F8", Gdk.Key.F8 },
- { "#9", Gdk.Key.F9 },
- { "F9", Gdk.Key.F9 },
- { "#0", Gdk.Key.F10 },
- { "F10", Gdk.Key.F10 },
- { "F11", Gdk.Key.F11 },
- { "F12", Gdk.Key.F12 },
- { "Insert", Gdk.Key.Insert },
- { "Del", Gdk.Key.Delete },
- { "Home", Gdk.Key.Home },
- { "End", Gdk.Key.End },
- { "PageUp", Gdk.Key.Page_Up },
- { "PageDown", Gdk.Key.Page_Down },
- { "kHome", Gdk.Key.KP_Home },
- { "kEnd", Gdk.Key.KP_End },
- { "kPageUp", Gdk.Key.KP_Page_Up },
- { "kPageDown", Gdk.Key.KP_Page_Down },
- { "kPlus", Gdk.Key.KP_Add },
- { "kMinus", Gdk.Key.KP_Subtract },
- { "kMultiply", Gdk.Key.KP_Multiply },
- { "kDivide", Gdk.Key.KP_Divide },
- { "kEnter", Gdk.Key.KP_Enter },
- { "kPoint", Gdk.Key.KP_Decimal },
- { "k0", Gdk.Key.KP_0 },
- { "k1", Gdk.Key.KP_1 },
- { "k2", Gdk.Key.KP_2 },
- { "k3", Gdk.Key.KP_3 },
- { "k4", Gdk.Key.KP_4 },
- { "k5", Gdk.Key.KP_5 },
- { "k6", Gdk.Key.KP_6 },
- { "k7", Gdk.Key.KP_7 },
- { "k8", Gdk.Key.KP_8 },
- { "k9", Gdk.Key.KP_9 },
- { "Help", Gdk.Key.Help },
- { "Undo", Gdk.Key.Undo },
- };
-
- static ViKey FlattenControlMappings (ViKey k)
- {
- ViKey ret;
- if ((k.Modifiers & ModifierType.ControlMask) == k.Modifiers &&
- controlMappings.TryGetValue (k.Char, out ret))
- return ret;
- return k;
- }
-
- static Dictionary<uint, ViKey> controlMappings = new Dictionary<uint, ViKey> () {
- { '@', '\0' },
- { 'h', Key.BackSpace },
- { 'i', '\t' },
- { 'j', '\n' },
- { 'l', '\f' },
- { 'm', '\r' },
- { '[', Key.Escape },
- { 'p', Key.Up },
- };
-
- public static IList<ViKey> Parse (string command)
- {
- var list = new List<ViKey> ();
- for (int i = 0; i < command.Length; i++) {
- if (command[i] == '<') {
- int j = command.IndexOf ('>', i);
- if (j < i + 2)
- throw new FormatException ("Could not find matching > at index " + i.ToString ());
- string seq = command.Substring (i + 1, j - i - 1);
- list.Add (ParseKeySequence (seq));
- i = j;
- } else {
- list.Add (command[i]);
- }
- }
- return list;
- }
-
- //TODO: <CSI> <xCSI>
- static ViKey ParseKeySequence (string seq)
- {
- var modifiers = ModifierType.None;
- while (seq.Length > 2 && seq[1] == '-') {
- switch (seq[0]) {
- case 'S':
- modifiers |= ModifierType.ShiftMask;
- break;
- case 'C':
- modifiers |= ModifierType.ControlMask;
- break;
- case 'M':
- case 'A':
- modifiers |= ModifierType.Mod1Mask;
- break;
- case 'D':
- modifiers |= ModifierType.MetaMask; //HACK: Mac command key
- break;
- default:
- throw new FormatException ("Unknown modifier " + seq[0].ToString ());
- }
- seq = seq.Substring (2);
- }
- var k = GetKey (seq);
- var c = '\0';
- if (k == (Gdk.Key)0)
- c = GetChar (seq);
-
- var key = c == '\0'? new ViKey (modifiers, k) : new ViKey (modifiers, c);
- if (!IsValid (key))
- throw new FormatException ("Invalid key sequence '" + seq + "'");
- return key;
- }
- }
-}
-
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViMacro.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViMacro.cs
deleted file mode 100644
index b3d2bb4450..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViMacro.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// ViMacro.cs
-//
-// Author:
-// Sanjoy Das <sanjoy@playingwithpointers.com>
-//
-// Copyright (c) 2010 Sanjoy Das
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-
-namespace Mono.TextEditor.Vi
-{
- /// <summary>
- /// Implements a Vi macro. Only the keys pressed need to be stored. Though this class
- /// is not exactly required, it provides a possible place to extend the code.
- /// </summary>
- public class ViMacro {
-
- /// <summary>
- /// One of these determines a complete set of arguments passed to HandleKeyPress. I am
- /// still not sure about whether each of these fields is indepedent in itself or may
- /// be eliminated and re-constructed later.
- /// </summary>
- public struct KeySet {
- public Gdk.Key Key { get; set;}
- public uint UnicodeKey {get; set;}
- public Gdk.ModifierType Modifiers {get; set;}
- }
-
- /// <summary>
- /// This <see cref="System.Collections.Queue"/> of KeySets determine the ultimate functionality
- /// of the macro this ViMacro object represents.
- /// </summary>
- public Queue<KeySet> KeysPressed {get; set;}
- public char MacroCharacter {get; set;}
-
- public ViMacro (char macroCharacter) {
- MacroCharacter = MacroCharacter;
- }
-
- }
-
-}
-
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViMark.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViMark.cs
deleted file mode 100644
index 76f241a2d0..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViMark.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-//
-// ViMark.cs
-//
-// Author:
-// Sanjoy Das <sanjoy@playingwithpointers.com>
-//
-// Copyright (c) 2010 Sanjoy Das
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using Mono.TextEditor.Highlighting;
-
-namespace Mono.TextEditor.Vi
-{
- public class ViMark : Mono.TextEditor.TextLineMarker
- {
-
- public char MarkCharacter {get; set;}
-
- /// <summary>
- /// Only way to construct a ViMark.
- /// </summary>
- /// <param name="markCharacter">
- /// The <see cref="System.Char"/> with which the ViMark object needs to be
- /// associated.
- /// </param>
- public ViMark (char markCharacter) {
- MarkCharacter = MarkCharacter;
- }
-
- public int ColumnNumber {get; protected set;}
-
- public void SaveMark (TextEditorData data) {
-
- if (base.LineSegment != null) {
- // Remove the marker first
- data.Document.RemoveMarker (this);
- }
-
- // Is there a better way of doing this?
- int lineNumber = data.IsSomethingSelected ? data.MainSelection.MinLine : data.Caret.Line;
- base.LineSegment = data.Document.GetLine (lineNumber);
- ColumnNumber = data.Caret.Column;
- data.Document.AddMarker(lineNumber, this);
-
- data.Document.RequestUpdate (new UpdateAll ());
- data.Document.CommitDocumentUpdate ();
-
- }
-
- public void LoadMark (TextEditorData data) {
- int x = base.LineSegment.LineNumber;
- data.Caret.Line = x;
- int len = base.LineSegment.LengthIncludingDelimiter;
- if (ColumnNumber >= len) {
- // Check if the line has been truncated after the setting the mark
- data.Caret.Column = len - 1;
- } else {
- data.Caret.Column = ColumnNumber;
- }
- }
-
- public override ChunkStyle GetStyle (ChunkStyle baseStyle) {
- return baseStyle;
- }
-
- }
-
-}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViMode.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViMode.cs
deleted file mode 100644
index 9eb1a3164c..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViMode.cs
+++ /dev/null
@@ -1,1155 +0,0 @@
-//
-// ViMode.cs
-//
-// Author:
-// Michael Hutchinson <mhutchinson@novell.com>
-//
-// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace Mono.TextEditor.Vi
-{
- public class ViEditMode : EditMode
- {
- bool searchBackward;
- static string lastPattern;
- static string lastReplacement;
- State curState;
- State CurState {
- get {
- return curState;
- }
- set {
- curState = value;
- if (statusArea != null) {
- statusArea.ShowCaret = curState == State.Command;
- }
- }
- }
-
- Motion motion;
- const string substMatch = @"^:s(?<sep>.)(?<pattern>.+?)\k<sep>(?<replacement>.*?)(\k<sep>(?<trailer>i?))?$";
- StringBuilder commandBuffer = new StringBuilder ();
- Dictionary<char,ViMark> marks = new Dictionary<char, ViMark>();
- Dictionary<char,ViMacro> macros = new Dictionary<char, ViMacro>();
- char macros_lastplayed = '@'; // start with the illegal macro character
-
- /// <summary>
- /// The macro currently being implemented. Will be set to null and checked as a flag when required.
- /// </summary>
- ViMacro currentMacro;
-
- public virtual string Status {
-
- get {
- return statusArea.Message;
- }
-
- protected set {
- if (currentMacro != null) {
- value = value + " recording";
- }
- if (viTextEditor != null) {
- statusArea.Message = value;
- }
- }
- }
-
- protected virtual string RunExCommand (string command)
- {
- switch (command[0]) {
- case ':':
- if (2 > command.Length)
- break;
-
- int line;
- if (int.TryParse (command.Substring (1), out line)) {
- if (line < DocumentLocation.MinLine || line > Data.Document.LineCount) {
- return "Invalid line number.";
- } else if (line == 0) {
- RunAction (CaretMoveActions.ToDocumentStart);
- return "Jumped to beginning of document.";
- }
-
- Data.Caret.Line = line;
- Editor.ScrollToCaret ();
- return string.Format ("Jumped to line {0}.", line);
- }
-
- switch (command[1]) {
- case 's':
- if (2 == command.Length) {
- if (null == lastPattern || null == lastReplacement)
- return "No stored pattern.";
-
- // Perform replacement with stored stuff
- command = string.Format (":s/{0}/{1}/", lastPattern, lastReplacement);
- }
-
- var match = Regex.Match (command, substMatch, RegexOptions.Compiled);
- if (!(match.Success && match.Groups["pattern"].Success && match.Groups["replacement"].Success))
- break;
-
- return RegexReplace (match);
-
- case '$':
- if (command.Length == 2) {
- RunAction (CaretMoveActions.ToDocumentEnd);
- return "Jumped to end of document.";
- }
- break;
- }
- break;
-
- case '?':
- case '/':
- searchBackward = ('?' == command[0]);
- if (1 < command.Length) {
- Editor.HighlightSearchPattern = true;
- Editor.SearchEngine = new RegexSearchEngine ();
- var pattern = command.Substring (1);
- Editor.SearchPattern = pattern;
- var caseSensitive = pattern.ToCharArray ().Any (c => char.IsUpper (c));
- Editor.SearchEngine.SearchRequest.CaseSensitive = caseSensitive;
- }
- return Search ();
- }
-
- return "Command not recognised";
- }
-
- void SearchWordAtCaret ()
- {
- Editor.SearchEngine = new RegexSearchEngine ();
- var s = Data.FindCurrentWordStart (Data.Caret.Offset);
- var e = Data.FindCurrentWordEnd (Data.Caret.Offset);
- if (s < 0 || e <= s)
- return;
-
- var word = Document.GetTextBetween (s, e);
- //use negative lookahead and lookbehind for word characters to make sure we only get fully matching words
- word = "(?<!\\w)" + System.Text.RegularExpressions.Regex.Escape (word) + "(?!\\w)";
- Editor.SearchPattern = word;
- Editor.SearchEngine.SearchRequest.CaseSensitive = true;
- searchBackward = false;
- Search ();
- }
-
- public override bool WantsToPreemptIM {
- get {
- return CurState != State.Insert && CurState != State.Replace;
- }
- }
-
- protected override void SelectionChanged ()
- {
- if (Data.IsSomethingSelected) {
- CurState = ViEditMode.State.Visual;
- Status = "-- VISUAL --";
- } else if (CurState == State.Visual && !Data.IsSomethingSelected) {
- Reset ("");
- }
- }
-
- protected override void CaretPositionChanged ()
- {
- if (CurState == State.Replace || CurState == State.Insert || CurState == State.Visual)
- return;
- else if (CurState == ViEditMode.State.Normal || CurState == ViEditMode.State.Unknown)
- ViActions.RetreatFromLineEnd (Data);
- else
- Reset ("");
- }
-
- ViStatusArea statusArea;
- TextEditor viTextEditor;
-
- void CheckVisualMode ()
- {
- if (CurState == ViEditMode.State.Visual || CurState == ViEditMode.State.VisualLine) {
- if (!Data.IsSomethingSelected)
- CurState = ViEditMode.State.Normal;
- } else {
- if (Data.IsSomethingSelected) {
- CurState = ViEditMode.State.Visual;
- Status = "-- VISUAL --";
- }
- }
- }
-
- void ResetEditorState (TextEditorData data)
- {
- if (data == null)
- return;
- data.ClearSelection ();
-
- //Editor can be null during GUI-less tests
- // Commenting this fixes bug: Bug 622618 - Inline search fails in vi mode
-// if (Editor != null)
-// Editor.HighlightSearchPattern = false;
-
- if (CaretMode.Block != data.Caret.Mode) {
- data.Caret.Mode = CaretMode.Block;
- if (data.Caret.Column > DocumentLocation.MinColumn)
- data.Caret.Column--;
- }
- ViActions.RetreatFromLineEnd (data);
- }
-
- protected override void OnAddedToEditor (TextEditorData data)
- {
- data.Caret.Mode = CaretMode.Block;
- ViActions.RetreatFromLineEnd (data);
-
- viTextEditor = data.Parent;
- if (viTextEditor != null) {
- statusArea = new ViStatusArea (viTextEditor);
- }
- }
-
- protected override void OnRemovedFromEditor (TextEditorData data)
- {
- data.Caret.Mode = CaretMode.Insert;
-
- if (viTextEditor != null) {
- statusArea.RemoveFromParentAndDestroy ();
- statusArea = null;
- viTextEditor = null;
- }
- }
-
- public override void AllocateTextArea (TextEditor textEditor, TextArea textArea, Gdk.Rectangle allocation)
- {
- statusArea.AllocateArea (textArea, allocation);
- }
-
- void Reset (string status)
- {
- CurState = State.Normal;
- ResetEditorState (Data);
- motion = Motion.None;
- commandBuffer.Length = 0;
- Status = status;
- }
-
- protected virtual Action<TextEditorData> GetInsertAction (Gdk.Key key, Gdk.ModifierType modifier)
- {
- return ViActionMaps.GetInsertKeyAction (key, modifier) ??
- ViActionMaps.GetDirectionKeyAction (key, modifier);
- }
-
- protected override void HandleKeypress (Gdk.Key key, uint unicodeKey, Gdk.ModifierType modifier)
- {
-
- // Reset on Esc, Ctrl-C, Ctrl-[
- if (key == Gdk.Key.Escape) {
- if (currentMacro != null) {
- // Record Escapes into the macro since it actually does something
- ViMacro.KeySet toAdd = new ViMacro.KeySet();
- toAdd.Key = key;
- toAdd.Modifiers = modifier;
- toAdd.UnicodeKey = unicodeKey;
- currentMacro.KeysPressed.Enqueue(toAdd);
- }
- Reset(string.Empty);
- return;
- } else if (((key == Gdk.Key.c || key == Gdk.Key.bracketleft) && (modifier & Gdk.ModifierType.ControlMask) != 0)) {
- Reset (string.Empty);
- if (currentMacro != null) {
- // Otherwise remove the macro from the pool
- macros.Remove(currentMacro.MacroCharacter);
- currentMacro = null;
- }
- return;
- } else if (currentMacro != null && !((char)unicodeKey == 'q' && modifier == Gdk.ModifierType.None)) {
- ViMacro.KeySet toAdd = new ViMacro.KeySet();
- toAdd.Key = key;
- toAdd.Modifiers = modifier;
- toAdd.UnicodeKey = unicodeKey;
- currentMacro.KeysPressed.Enqueue(toAdd);
- }
-
- Action<TextEditorData> action = null;
- bool lineAction = false;
-
- switch (CurState) {
- case State.Unknown:
- Reset (string.Empty);
- goto case State.Normal;
- case State.Normal:
- if (((modifier & (Gdk.ModifierType.ControlMask)) == 0)) {
- if (key == Gdk.Key.Delete)
- unicodeKey = 'x';
- switch ((char)unicodeKey) {
- case '?':
- case '/':
- case ':':
- CurState = State.Command;
- commandBuffer.Append ((char)unicodeKey);
- Status = commandBuffer.ToString ();
- return;
-
- case 'A':
- RunAction (CaretMoveActions.LineEnd);
- goto case 'i';
-
- case 'I':
- RunAction (CaretMoveActions.LineFirstNonWhitespace);
- goto case 'i';
-
- case 'a':
- //use CaretMoveActions so that we can move past last character on line end
- RunAction (CaretMoveActions.Right);
- goto case 'i';
- case 'i':
- Caret.Mode = CaretMode.Insert;
- Status = "-- INSERT --";
- CurState = State.Insert;
- return;
-
- case 'R':
- Caret.Mode = CaretMode.Underscore;
- Status = "-- REPLACE --";
- CurState = State.Replace;
- return;
-
- case 'V':
- Status = "-- VISUAL LINE --";
- Data.SetSelectLines (Caret.Line, Caret.Line);
- CurState = State.VisualLine;
- return;
-
- case 'v':
- Status = "-- VISUAL --";
- CurState = State.Visual;
- RunAction (ViActions.VisualSelectionFromMoveAction (ViActions.Right));
- return;
-
- case 'd':
- Status = "d";
- CurState = State.Delete;
- return;
-
- case 'y':
- Status = "y";
- CurState = State.Yank;
- return;
-
- case 'Y':
- CurState = State.Yank;
- HandleKeypress (Gdk.Key.y, (int)'y', Gdk.ModifierType.None);
- return;
-
- case 'O':
- RunAction (ViActions.NewLineAbove);
- goto case 'i';
-
- case 'o':
- RunAction (ViActions.NewLineBelow);
- goto case 'i';
-
- case 'r':
- Caret.Mode = CaretMode.Underscore;
- Status = "-- REPLACE --";
- CurState = State.WriteChar;
- return;
-
- case 'c':
- Caret.Mode = CaretMode.Insert;
- Status = "c";
- CurState = State.Change;
- return;
-
- case 'x':
- if (Data.Caret.Column == Data.Document.GetLine (Data.Caret.Line).Length + 1)
- return;
- Status = string.Empty;
- if (!Data.IsSomethingSelected)
- RunActions (SelectionActions.FromMoveAction (CaretMoveActions.Right), ClipboardActions.Cut);
- else
- RunAction (ClipboardActions.Cut);
- ViActions.RetreatFromLineEnd (Data);
- return;
-
- case 'X':
- if (Data.Caret.Column == DocumentLocation.MinColumn)
- return;
- Status = string.Empty;
- if (!Data.IsSomethingSelected && 0 < Caret.Offset)
- RunActions (SelectionActions.FromMoveAction (CaretMoveActions.Left), ClipboardActions.Cut);
- else
- RunAction (ClipboardActions.Cut);
- return;
-
- case 'D':
- RunActions (SelectionActions.FromMoveAction (CaretMoveActions.LineEnd), ClipboardActions.Cut);
- return;
-
- case 'C':
- RunActions (SelectionActions.FromMoveAction (CaretMoveActions.LineEnd), ClipboardActions.Cut);
- goto case 'i';
-
- case '>':
- Status = ">";
- CurState = State.Indent;
- return;
-
- case '<':
- Status = "<";
- CurState = State.Unindent;
- return;
- case 'n':
- Search ();
- return;
- case 'N':
- searchBackward = !searchBackward;
- Search ();
- searchBackward = !searchBackward;
- return;
- case 'p':
- PasteAfter (false);
- return;
- case 'P':
- PasteBefore (false);
- return;
- case 's':
- if (!Data.IsSomethingSelected)
- RunAction (SelectionActions.FromMoveAction (CaretMoveActions.Right));
- RunAction (ClipboardActions.Cut);
- goto case 'i';
- case 'S':
- if (!Data.IsSomethingSelected)
- RunAction (SelectionActions.LineActionFromMoveAction (CaretMoveActions.LineEnd));
- else Data.SetSelectLines (Data.MainSelection.Anchor.Line, Data.Caret.Line);
- RunAction (ClipboardActions.Cut);
- goto case 'i';
-
- case 'g':
- Status = "g";
- CurState = State.G;
- return;
-
- case 'H':
- Caret.Line = System.Math.Max (DocumentLocation.MinLine, Editor.PointToLocation (0, Editor.LineHeight - 1).Line);
- return;
- case 'J':
- RunAction (ViActions.Join);
- return;
- case 'L':
- int line = Editor.PointToLocation (0, Editor.Allocation.Height - Editor.LineHeight * 2 - 2).Line;
- if (line < DocumentLocation.MinLine)
- line = Document.LineCount;
- Caret.Line = line;
- return;
- case 'M':
- line = Editor.PointToLocation (0, Editor.Allocation.Height/2).Line;
- if (line < DocumentLocation.MinLine)
- line = Document.LineCount;
- Caret.Line = line;
- return;
-
- case '~':
- RunAction (ViActions.ToggleCase);
- return;
-
- case 'z':
- Status = "z";
- CurState = State.Fold;
- return;
-
- case 'm':
- Status = "m";
- CurState = State.Mark;
- return;
-
- case '`':
- Status = "`";
- CurState = State.GoToMark;
- return;
-
- case '@':
- Status = "@";
- CurState = State.PlayMacro;
- return;
-
- case 'q':
- if (currentMacro == null) {
- Status = "q";
- CurState = State.NameMacro;
- return;
- }
- currentMacro = null;
- Reset("Macro Recorded");
- return;
- case '*':
- SearchWordAtCaret ();
- return;
- }
-
- }
-
- action = ViActionMaps.GetNavCharAction ((char)unicodeKey);
- if (action == null)
- action = ViActionMaps.GetDirectionKeyAction (key, modifier);
- if (action == null)
- action = ViActionMaps.GetCommandCharAction ((char)unicodeKey);
-
- if (action != null)
- RunAction (action);
-
- //undo/redo may leave MD with a selection mode without activating visual mode
- CheckVisualMode ();
- return;
-
- case State.Delete:
- if (IsInnerOrOuterMotionKey (unicodeKey, ref motion)) return;
-
- if (motion != Motion.None) {
- action = ViActionMaps.GetEditObjectCharAction((char) unicodeKey, motion);
- }
- else if (((modifier & (Gdk.ModifierType.ShiftMask | Gdk.ModifierType.ControlMask)) == 0
- && unicodeKey == 'd'))
- {
- action = SelectionActions.LineActionFromMoveAction (CaretMoveActions.LineEnd);
- lineAction = true;
- } else {
- action = ViActionMaps.GetNavCharAction ((char)unicodeKey);
- if (action == null)
- action = ViActionMaps.GetDirectionKeyAction (key, modifier);
- if (action != null)
- action = SelectionActions.FromMoveAction (action);
- }
-
- if (action != null) {
- if (lineAction)
- RunActions (action, ClipboardActions.Cut, CaretMoveActions.LineFirstNonWhitespace);
- else
- RunActions (action, ClipboardActions.Cut);
- Reset ("");
- } else {
- Reset ("Unrecognised motion");
- }
-
- return;
-
- case State.Yank:
- if (IsInnerOrOuterMotionKey (unicodeKey, ref motion)) return;
- int offset = Caret.Offset;
-
- if (motion != Motion.None) {
- action = ViActionMaps.GetEditObjectCharAction((char) unicodeKey, motion);
- }
- else if (((modifier & (Gdk.ModifierType.ShiftMask | Gdk.ModifierType.ControlMask)) == 0
- && unicodeKey == 'y'))
- {
- action = SelectionActions.LineActionFromMoveAction (CaretMoveActions.LineEnd);
- lineAction = true;
- } else {
- action = ViActionMaps.GetNavCharAction ((char)unicodeKey);
- if (action == null)
- action = ViActionMaps.GetDirectionKeyAction (key, modifier);
- if (action != null)
- action = SelectionActions.FromMoveAction (action);
- }
-
- if (action != null) {
- RunAction (action);
- if (Data.IsSomethingSelected && !lineAction)
- offset = Data.SelectionRange.Offset;
- RunAction (ClipboardActions.Copy);
- Reset (string.Empty);
- } else {
- Reset ("Unrecognised motion");
- }
- Caret.Offset = offset;
-
- return;
-
- case State.Change:
- if (IsInnerOrOuterMotionKey (unicodeKey, ref motion)) return;
-
- if (motion != Motion.None) {
- action = ViActionMaps.GetEditObjectCharAction((char) unicodeKey, motion);
- }
- //copied from delete action
- else if (((modifier & (Gdk.ModifierType.ShiftMask | Gdk.ModifierType.ControlMask)) == 0
- && unicodeKey == 'c'))
- {
- action = SelectionActions.LineActionFromMoveAction (CaretMoveActions.LineEnd);
- lineAction = true;
- } else {
- action = ViActionMaps.GetEditObjectCharAction ((char)unicodeKey);
- if (action == null)
- action = ViActionMaps.GetDirectionKeyAction (key, modifier);
- if (action != null)
- action = SelectionActions.FromMoveAction (action);
- }
-
- if (action != null) {
- if (lineAction)
- RunActions (action, ClipboardActions.Cut, ViActions.NewLineAbove);
- else
- RunActions (action, ClipboardActions.Cut);
- Status = "-- INSERT --";
- CurState = State.Insert;
- motion = Motion.None;
- Caret.Mode = CaretMode.Insert;
- } else {
- Reset ("Unrecognised motion");
- }
-
- return;
-
- case State.Insert:
- case State.Replace:
- action = GetInsertAction (key, modifier);
-
- if (action != null)
- RunAction (action);
- else if (unicodeKey != 0)
- InsertCharacter (unicodeKey);
-
- return;
-
- case State.VisualLine:
- if (key == Gdk.Key.Delete)
- unicodeKey = 'x';
- switch ((char)unicodeKey) {
- case 'p':
- PasteAfter (true);
- return;
- case 'P':
- PasteBefore (true);
- return;
- }
- action = ViActionMaps.GetNavCharAction ((char)unicodeKey);
- if (action == null) {
- action = ViActionMaps.GetDirectionKeyAction (key, modifier);
- }
- if (action == null) {
- action = ViActionMaps.GetCommandCharAction ((char)unicodeKey);
- }
- if (action != null) {
- RunAction (SelectionActions.LineActionFromMoveAction (action));
- return;
- }
-
- ApplyActionToSelection (modifier, unicodeKey);
- return;
-
- case State.Visual:
- if (IsInnerOrOuterMotionKey (unicodeKey, ref motion)) return;
-
- if (motion != Motion.None) {
- action = ViActionMaps.GetEditObjectCharAction((char) unicodeKey, motion);
- if (action != null) {
- RunAction (action);
- return;
- }
- }
-
- if (key == Gdk.Key.Delete)
- unicodeKey = 'x';
- switch ((char)unicodeKey) {
- case 'p':
- PasteAfter (false);
- return;
- case 'P':
- PasteBefore (false);
- return;
- }
- action = ViActionMaps.GetNavCharAction ((char)unicodeKey);
- if (action == null) {
- action = ViActionMaps.GetDirectionKeyAction (key, modifier);
- }
- if (action == null) {
- action = ViActionMaps.GetCommandCharAction ((char)unicodeKey);
- }
- if (action != null) {
- RunAction (ViActions.VisualSelectionFromMoveAction (action));
- return;
- }
-
- ApplyActionToSelection (modifier, unicodeKey);
- return;
-
- case State.Command:
- switch (key) {
- case Gdk.Key.Return:
- case Gdk.Key.KP_Enter:
- Status = RunExCommand (commandBuffer.ToString ());
- commandBuffer.Length = 0;
- CurState = State.Normal;
- break;
- case Gdk.Key.BackSpace:
- case Gdk.Key.Delete:
- case Gdk.Key.KP_Delete:
- if (0 < commandBuffer.Length) {
- commandBuffer.Remove (commandBuffer.Length-1, 1);
- Status = commandBuffer.ToString ();
- if (0 == commandBuffer.Length)
- Reset (Status);
- }
- break;
- default:
- if(unicodeKey != 0) {
- commandBuffer.Append ((char)unicodeKey);
- Status = commandBuffer.ToString ();
- }
- break;
- }
- return;
-
- case State.WriteChar:
- if (unicodeKey != 0) {
- RunAction (SelectionActions.StartSelection);
- int roffset = Data.SelectionRange.Offset;
- InsertCharacter ((char) unicodeKey);
- Reset (string.Empty);
- Caret.Offset = roffset;
- } else {
- Reset ("Keystroke was not a character");
- }
- return;
-
- case State.Indent:
- if (((modifier & (Gdk.ModifierType.ControlMask)) == 0 && unicodeKey == '>'))
- {
- RunAction (MiscActions.IndentSelection);
- Reset ("");
- return;
- }
-
- action = ViActionMaps.GetNavCharAction ((char)unicodeKey);
- if (action == null)
- action = ViActionMaps.GetDirectionKeyAction (key, modifier);
-
- if (action != null) {
- RunActions (SelectionActions.FromMoveAction (action), MiscActions.IndentSelection);
- Reset ("");
- } else {
- Reset ("Unrecognised motion");
- }
- return;
-
- case State.Unindent:
- if (((modifier & (Gdk.ModifierType.ControlMask)) == 0 && ((char)unicodeKey) == '<'))
- {
- RunAction (MiscActions.RemoveIndentSelection);
- Reset ("");
- return;
- }
-
- action = ViActionMaps.GetNavCharAction ((char)unicodeKey);
- if (action == null)
- action = ViActionMaps.GetDirectionKeyAction (key, modifier);
-
- if (action != null) {
- RunActions (SelectionActions.FromMoveAction (action), MiscActions.RemoveIndentSelection);
- Reset ("");
- } else {
- Reset ("Unrecognised motion");
- }
- return;
-
- case State.G:
- if (((modifier & (Gdk.ModifierType.ControlMask)) == 0)) {
- switch ((char)unicodeKey) {
- case 'g':
- Caret.Offset = 0;
- Reset ("");
- return;
- }
- }
- Reset ("Unknown command");
- return;
-
- case State.Mark: {
- char k = (char)unicodeKey;
- ViMark mark = null;
- if (!char.IsLetterOrDigit(k)) {
- Reset ("Invalid Mark");
- return;
- }
- if (marks.ContainsKey(k)) {
- mark = marks [k];
- } else {
- mark = new ViMark(k);
- marks [k] = mark;
- }
- RunAction(mark.SaveMark);
- Reset("");
- return;
- }
-
- case State.NameMacro: {
- char k = (char) unicodeKey;
- if(!char.IsLetterOrDigit(k)) {
- Reset("Invalid Macro Name");
- return;
- }
- currentMacro = new ViMacro (k);
- currentMacro.KeysPressed = new Queue<ViMacro.KeySet> ();
- macros [k] = currentMacro;
- Reset("");
- return;
- }
-
- case State.PlayMacro: {
- char k = (char) unicodeKey;
- if (k == '@')
- k = macros_lastplayed;
- if (macros.ContainsKey(k)) {
- Reset ("");
- macros_lastplayed = k; // FIXME play nice when playing macros from inside macros?
- ViMacro macroToPlay = macros [k];
- foreach (ViMacro.KeySet keySet in macroToPlay.KeysPressed) {
- HandleKeypress(keySet.Key, keySet.UnicodeKey, keySet.Modifiers); // FIXME stop on errors? essential with multipliers and nowrapscan
- }
- /* Once all the keys have been played back, quickly exit. */
- return;
- } else {
- Reset ("Invalid Macro Name '" + k + "'");
- return;
- }
- }
-
- case State.GoToMark: {
- char k = (char)unicodeKey;
- if (marks.ContainsKey(k)) {
- RunAction(marks [k].LoadMark);
- Reset ("");
- } else {
- Reset ("Unknown Mark");
- }
- return;
- }
-
- case State.Fold:
- if (((modifier & (Gdk.ModifierType.ControlMask)) == 0)) {
- switch ((char)unicodeKey) {
- case 'A':
- // Recursive fold toggle
- action = FoldActions.ToggleFoldRecursive;
- break;
- case 'C':
- // Recursive fold close
- action = FoldActions.CloseFoldRecursive;
- break;
- case 'M':
- // Close all folds
- action = FoldActions.CloseAllFolds;
- break;
- case 'O':
- // Recursive fold open
- action = FoldActions.OpenFoldRecursive;
- break;
- case 'R':
- // Expand all folds
- action = FoldActions.OpenAllFolds;
- break;
- case 'a':
- // Fold toggle
- action = FoldActions.ToggleFold;
- break;
- case 'c':
- // Fold close
- action = FoldActions.CloseFold;
- break;
- case 'o':
- // Fold open
- action = FoldActions.OpenFold;
- break;
- case 'z':
- case '.':
- editor.CenterToCaret ();
- Reset ("");
- break;
- default:
- Reset ("Unknown command");
- break;
- }
-
- if (null != action) {
- RunAction (action);
- Reset (string.Empty);
- }
- }
-
- return;
- }
- }
-
- static bool IsInnerOrOuterMotionKey (uint unicodeKey, ref Motion motion)
- {
- if (unicodeKey == 'i') {
- motion = Motion.Inner;
- return true;
- }
- if (unicodeKey == 'a') {
- motion = Motion.Outer;
- return true;
- }
- return false;
- }
-
- /// <summary>
- /// Runs an in-place replacement on the selection or the current line
- /// using the "pattern", "replacement", and "trailer" groups of match.
- /// </summary>
- public string RegexReplace (System.Text.RegularExpressions.Match match)
- {
- string line = null;
- var segment = TextSegment.Invalid;
-
- if (Data.IsSomethingSelected) {
- // Operate on selection
- line = Data.SelectedText;
- segment = Data.SelectionRange;
- } else {
- // Operate on current line
- var lineSegment = Data.Document.GetLine (Caret.Line);
- if (lineSegment != null)
- segment = lineSegment;
- line = Data.Document.GetTextBetween (segment.Offset, segment.EndOffset);
- }
-
- // Set regex options
- RegexOptions options = RegexOptions.Multiline;
- if (match.Groups["trailer"].Success && "i" == match.Groups["trailer"].Value)
- options |= RegexOptions.IgnoreCase;
-
- // Mogrify group backreferences to .net-style references
- string replacement = Regex.Replace (match.Groups["replacement"].Value, @"\\([0-9]+)", "$$$1", RegexOptions.Compiled);
- replacement = Regex.Replace (replacement, "&", "$$0", RegexOptions.Compiled);
-
- try {
- string newline = Regex.Replace (line, match.Groups["pattern"].Value, replacement, options);
- Data.Replace (segment.Offset, line.Length, newline);
- if (Data.IsSomethingSelected)
- Data.ClearSelection ();
- lastPattern = match.Groups["pattern"].Value;
- lastReplacement = replacement;
- } catch (ArgumentException ae) {
- return string.Format("Replacement error: {0}", ae.Message);
- }
-
- return "Performed replacement.";
- }
-
- public void ApplyActionToSelection (Gdk.ModifierType modifier, uint unicodeKey)
- {
- if (Data.IsSomethingSelected && (modifier & (Gdk.ModifierType.ControlMask)) == 0) {
- switch ((char)unicodeKey) {
- case 'x':
- case 'd':
- RunAction (ClipboardActions.Cut);
- Reset ("Deleted selection");
- return;
- case 'y':
- int offset = Data.SelectionRange.Offset;
- RunAction (ClipboardActions.Copy);
- Reset ("Yanked selection");
- Caret.Offset = offset;
- return;
- case 's':
- case 'c':
- RunAction (ClipboardActions.Cut);
- Caret.Mode = CaretMode.Insert;
- CurState = State.Insert;
- Status = "-- INSERT --";
- return;
- case 'S':
- Data.SetSelectLines (Data.MainSelection.Anchor.Line, Data.Caret.Line);
- goto case 'c';
-
- case '>':
- RunAction (MiscActions.IndentSelection);
- Reset ("");
- return;
-
- case '<':
- RunAction (MiscActions.RemoveIndentSelection);
- Reset ("");
- return;
-
- case ':':
- commandBuffer.Append (":");
- Status = commandBuffer.ToString ();
- CurState = State.Command;
- break;
- case 'J':
- RunAction (ViActions.Join);
- Reset ("");
- return;
-
- case '~':
- RunAction (ViActions.ToggleCase);
- Reset ("");
- return;
- }
- }
- }
-
- private string Search()
- {
- SearchResult result = searchBackward?
- Editor.SearchBackward (Caret.Offset):
- Editor.SearchForward (Caret.Offset+1);
- Editor.HighlightSearchPattern = (null != result);
- if (null == result)
- return string.Format ("Pattern not found: '{0}'", Editor.SearchPattern);
- else Caret.Offset = result.Offset;
-
- return string.Empty;
- }
-
- /// <summary>
- /// Pastes the selection after the caret,
- /// or replacing an existing selection.
- /// </summary>
- private void PasteAfter (bool linemode)
- {
- TextEditorData data = Data;
- using (var undo = Document.OpenUndoGroup ()) {
-
- Gtk.Clipboard.Get (ClipboardActions.CopyOperation.CLIPBOARD_ATOM).RequestText
- (delegate (Gtk.Clipboard cb, string contents) {
- if (contents == null)
- return;
- if (contents.EndsWith ("\r") || contents.EndsWith ("\n")) {
- // Line mode paste
- if (data.IsSomethingSelected) {
- // Replace selection
- RunAction (ClipboardActions.Cut);
- data.InsertAtCaret (data.EolMarker);
- int offset = data.Caret.Offset;
- data.InsertAtCaret (contents);
- if (linemode) {
- // Existing selection was also in line mode
- data.Caret.Offset = offset;
- RunAction (DeleteActions.FromMoveAction (CaretMoveActions.Left));
- }
- RunAction (CaretMoveActions.LineStart);
- } else {
- // Paste on new line
- RunAction (ViActions.NewLineBelow);
- RunAction (DeleteActions.FromMoveAction (CaretMoveActions.LineStart));
- data.InsertAtCaret (contents);
- RunAction (DeleteActions.FromMoveAction (CaretMoveActions.Left));
- RunAction (CaretMoveActions.LineStart);
- }
- } else {
- // Inline paste
- if (data.IsSomethingSelected)
- RunAction (ClipboardActions.Cut);
- else RunAction (CaretMoveActions.Right);
- data.InsertAtCaret (contents);
- RunAction (ViActions.Left);
- }
- Reset (string.Empty);
- });
- }
- }
-
- /// <summary>
- /// Pastes the selection before the caret,
- /// or replacing an existing selection.
- /// </summary>
- private void PasteBefore (bool linemode)
- {
- TextEditorData data = Data;
-
- using (var undo = Document.OpenUndoGroup ()) {
- Gtk.Clipboard.Get (ClipboardActions.CopyOperation.CLIPBOARD_ATOM).RequestText
- (delegate (Gtk.Clipboard cb, string contents) {
- if (contents == null)
- return;
- if (contents.EndsWith ("\r") || contents.EndsWith ("\n")) {
- // Line mode paste
- if (data.IsSomethingSelected) {
- // Replace selection
- RunAction (ClipboardActions.Cut);
- data.InsertAtCaret (data.EolMarker);
- int offset = data.Caret.Offset;
- data.InsertAtCaret (contents);
- if (linemode) {
- // Existing selection was also in line mode
- data.Caret.Offset = offset;
- RunAction (DeleteActions.FromMoveAction (CaretMoveActions.Left));
- }
- RunAction (CaretMoveActions.LineStart);
- } else {
- // Paste on new line
- RunAction (ViActions.NewLineAbove);
- RunAction (DeleteActions.FromMoveAction (CaretMoveActions.LineStart));
- data.InsertAtCaret (contents);
- RunAction (DeleteActions.FromMoveAction (CaretMoveActions.Left));
- RunAction (CaretMoveActions.LineStart);
- }
- } else {
- // Inline paste
- if (data.IsSomethingSelected)
- RunAction (ClipboardActions.Cut);
- data.InsertAtCaret (contents);
- RunAction (ViActions.Left);
- }
- Reset (string.Empty);
- });
- }
- }
-
- enum State {
- Unknown = 0,
- Normal,
- Command,
- Delete,
- Yank,
- Visual,
- VisualLine,
- Insert,
- Replace,
- WriteChar,
- Change,
- Indent,
- Unindent,
- G,
- Fold,
- Mark,
- GoToMark,
- NameMacro,
- PlayMacro
- }
- }
-
- public enum Motion {
- None = 0,
- Inner,
- Outer
- }
-}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViModeAbortException.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViModeAbortException.cs
deleted file mode 100644
index cd5f15b1ec..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViModeAbortException.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// ViModeAbortException.cs
-//
-// Author:
-// Tim Kellogg <timothy.kellogg@gmail.com>
-//
-// Copyright (c) 2013 Tim Kellogg
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-
-namespace Mono.TextEditor.Vi
-{
- /// <summary>
- /// Thrown to indicate that the vi parser was unable to recognize the key
- /// sequence and should abort quietly.
- /// </summary>
- public class ViModeAbortException : Exception
- {
- /// <summary>
- /// Thrown to indicate that the vi parser was unable to recognize the key
- /// sequence and should abort quietly.
- /// </summary>
- public ViModeAbortException ()
- {
- }
-
- /// <summary>
- /// Thrown to indicate that the vi parser was unable to recognize the key
- /// sequence and should abort quietly.
- /// </summary>
- /// <param name="reason">The reason for the abort. May be displayed to the user</param>
- public ViModeAbortException (string reason) : base(reason)
- {
- }
- }
-}
-
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViStatusArea.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViStatusArea.cs
deleted file mode 100644
index 6c768d7935..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViStatusArea.cs
+++ /dev/null
@@ -1,168 +0,0 @@
-//
-// ViStatusArea.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-// Michael Hutchinson <m.j.hutchinson@gmail.com>
-//
-// Copyright (c) 2013 Xamarin Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-
-namespace Mono.TextEditor.Vi
-{
- class ViStatusArea : Gtk.DrawingArea
- {
- TextEditor editor;
- bool showCaret;
- string statusText;
-
- public ViStatusArea (TextEditor editor)
- {
- this.editor = editor;
- editor.TextViewMargin.CaretBlink += HandleCaretBlink;
- editor.Caret.PositionChanged += HandlePositionChanged;
-
- editor.AddTopLevelWidget (this, 0, 0);
- ((TextEditor.EditorContainerChild)editor[this]).FixedPosition = true;
- Show ();
- }
-
- void HandlePositionChanged (object sender, DocumentLocationEventArgs e)
- {
- QueueDraw ();
- }
-
- void HandleCaretBlink (object sender, EventArgs e)
- {
- QueueDraw ();
- }
-
- public void RemoveFromParentAndDestroy ()
- {
- editor.Remove (this);
- Destroy ();
- }
-
- protected override void OnDestroyed ()
- {
- editor.Caret.PositionChanged -= HandlePositionChanged;
- editor.TextViewMargin.CaretBlink -= HandleCaretBlink;
- base.OnDestroyed ();
- }
-
- Gdk.Rectangle lastAllocation;
- public void AllocateArea (TextArea textArea, Gdk.Rectangle allocation)
- {
- if (!Visible)
- Show ();
- allocation.Height -= (int)textArea.LineHeight;
- if (lastAllocation.Width == allocation.Width &&
- lastAllocation.Height == allocation.Height || allocation.Height <= 1)
- return;
- lastAllocation = allocation;
-
- if (textArea.Allocation != allocation) {
- textArea.SizeAllocate (allocation);
- SetSizeRequest (allocation.Width, (int)editor.LineHeight);
- var pos = ((TextEditor.EditorContainerChild)editor [this]);
- if (pos.X != 0 || pos.Y != allocation.Height)
- editor.MoveTopLevelWidget (this, 0, allocation.Height);
- }
- }
-
- public bool ShowCaret {
- get { return showCaret; }
- set {
- if (showCaret != value) {
- showCaret = value;
- editor.Caret.IsVisible = !showCaret;
- editor.RequestResetCaretBlink ();
- QueueDraw ();
- }
- }
- }
-
- public string Message {
- get { return statusText; }
- set {
- if (statusText == value)
- return;
- statusText = value;
- if (showCaret) {
- editor.RequestResetCaretBlink ();
- }
- QueueDraw ();
- }
- }
-
- protected override bool OnExposeEvent (Gdk.EventExpose evnt)
- {
- using (Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window)) {
- cr.Rectangle (evnt.Region.Clipbox.X, evnt.Region.Clipbox.Y, evnt.Region.Clipbox.Width, evnt.Region.Clipbox.Height);
- cr.SetSourceColor (editor.ColorStyle.PlainText.Background);
- cr.Fill ();
- using (var layout = PangoUtil.CreateLayout (editor)) {
- layout.FontDescription = editor.Options.Font;
-
- layout.SetText ("000,00-00");
- int minstatusw, minstatush;
- layout.GetPixelSize (out minstatusw, out minstatush);
-
- var line = editor.GetLine (editor.Caret.Line);
- var visColumn = line.GetVisualColumn (editor.GetTextEditorData (), editor.Caret.Column);
-
- if (visColumn != editor.Caret.Column) {
- layout.SetText (editor.Caret.Line + "," + editor.Caret.Column + "-" + visColumn);
- } else {
- layout.SetText (editor.Caret.Line + "," + editor.Caret.Column);
- }
-
- int statusw, statush;
- layout.GetPixelSize (out statusw, out statush);
-
- statusw = System.Math.Max (statusw, minstatusw);
-
- statusw += 8;
- cr.MoveTo (Allocation.Width - statusw, 0);
- statusw += 8;
- cr.SetSourceColor (editor.ColorStyle.PlainText.Foreground);
- cr.ShowLayout (layout);
-
- layout.SetText (statusText ?? "");
- int w, h;
- layout.GetPixelSize (out w, out h);
- var x = System.Math.Min (0, -w + Allocation.Width - editor.TextViewMargin.CharWidth - statusw);
- cr.MoveTo (x, 0);
- cr.SetSourceColor (editor.ColorStyle.PlainText.Foreground);
- cr.ShowLayout (layout);
- if (ShowCaret) {
- if (editor.TextViewMargin.caretBlink) {
- cr.Rectangle (w + x, 0, (int)editor.TextViewMargin.CharWidth, (int)editor.LineHeight);
- cr.Fill ();
- }
- }
- }
- }
- return true;
- }
- }
-}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViWordFindStrategy.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViWordFindStrategy.cs
deleted file mode 100644
index de2efa4548..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Vi/ViWordFindStrategy.cs
+++ /dev/null
@@ -1,196 +0,0 @@
-//
-// ViWordFindStrategy.cs
-//
-// Author:
-// Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-//
-// Copyright (c) 2009 Levi Bard
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-
-namespace Mono.TextEditor.Vi
-{
- /// <summary>
- /// A word find strategy to mimic vi's
- /// </summary>
- public class ViWordFindStrategy: WordFindStrategy
- {
-
- #region IWordFindStrategy implementation
-
- /// <summary>
- /// Move to next non-whitespace change in character class.
- /// </summary>
- public override int FindNextSubwordOffset (TextDocument doc, int offset)
- {
- int myoffset = offset;
- if (0 > myoffset || doc.TextLength-1 <= myoffset){ return myoffset; }
-
- char c = doc.GetCharAt (myoffset);
- CharacterClass initialClass = GetCharacterClass (c);
-
- while (GetCharacterClass (c) == initialClass && 0 <= myoffset && doc.TextLength-1 > myoffset) {
- c = doc.GetCharAt (++myoffset);
- }
- for (c = doc.GetCharAt (myoffset);
- char.IsWhiteSpace (c) && 0 <= myoffset && doc.TextLength-1 > myoffset;
- c = doc.GetCharAt (++myoffset));
-
- return (myoffset == offset)? myoffset+1: myoffset;
- }
-
- /// <summary>
- /// Move past next whitespace group.
- /// </summary>
- public override int FindNextWordOffset (TextDocument doc, int offset)
- {
- int myoffset = offset;
- if (0 > myoffset || doc.TextLength-1 <= myoffset){ return myoffset; }
-
- for (char c = doc.GetCharAt (myoffset);
- !char.IsWhiteSpace (c) && 0 <= myoffset && doc.TextLength-1 > myoffset;
- c = doc.GetCharAt (++myoffset));
- for (char c = doc.GetCharAt (myoffset);
- char.IsWhiteSpace (c) && 0 <= myoffset && doc.TextLength-1 > myoffset;
- c = doc.GetCharAt (++myoffset));
-
- return (myoffset == offset)? myoffset+1: myoffset;
- }
-
- /// <summary>
- /// Move to previous non-whitespace change in character class.
- /// </summary>
- public override int FindPrevSubwordOffset (TextDocument doc, int offset)
- {
- int myoffset = offset-1;
- char c;
- if (0 > myoffset || doc.TextLength-1 <= myoffset){ return myoffset; }
-
- for (c = doc.GetCharAt (myoffset);
- char.IsWhiteSpace (c) && 0 <= myoffset && doc.TextLength-1 > myoffset;
- c = doc.GetCharAt (--myoffset));
-
- CharacterClass initialClass = GetCharacterClass (c);
-
- for (; GetCharacterClass (c) == initialClass &&
- 0 <= myoffset && doc.TextLength-1 > myoffset;
- c = doc.GetCharAt (--myoffset));
-
- return (0 == myoffset)? myoffset: myoffset+1;
- }
-
- /// <summary>
- /// Move to end of previous whitespace group.
- /// </summary>
- public override int FindPrevWordOffset (TextDocument doc, int offset)
- {
- --offset;
- if (0 > offset || doc.TextLength-1 <= offset){ return offset; }
-
- for (char c = doc.GetCharAt (offset);
- char.IsWhiteSpace (c) && 0 < offset && doc.TextLength > offset;
- c = doc.GetCharAt (--offset));
- for (char c = doc.GetCharAt (offset);
- !char.IsWhiteSpace (c) && 0 < offset && doc.TextLength > offset;
- c = doc.GetCharAt (--offset));
-
- return (0 == offset)? offset: offset+1;
- }
-
- #endregion
-
- private static bool OffsetIsWithinBounds (TextDocument doc, int offset)
- {
- return (offset >= 0 && offset <= doc.TextLength - 1);
- }
-
- public static int FindNextSubwordEndOffset (TextDocument doc, int offset)
- {
- int myoffset = offset + 1;
-
- if (!OffsetIsWithinBounds (doc, myoffset)) {
- return myoffset;
- }
-
- char c = doc.GetCharAt (myoffset);
- // skip whitespace
- while (char.IsWhiteSpace (c)) {
- if (OffsetIsWithinBounds (doc, ++myoffset)) {
- c = doc.GetCharAt (myoffset);
- } else {
- return offset;
- }
- }
- var initialClass = ViWordFindStrategy.GetCharacterClass (c);
- while (ViWordFindStrategy.GetCharacterClass (c) == initialClass && 0 <= myoffset && doc.TextLength-1 > myoffset) {
- c = doc.GetCharAt (++myoffset);
- }
-
- return System.Math.Max (offset, myoffset - 1);
- }
-
- public static int FindNextWordEndOffset (TextDocument doc, int offset)
- {
- int myoffset = offset + 1;
-
- if (!OffsetIsWithinBounds (doc, myoffset)) {
- return myoffset;
- }
-
- char c = doc.GetCharAt (myoffset);
- // skip whitespace
- while (char.IsWhiteSpace (c)) {
- if (OffsetIsWithinBounds (doc, ++myoffset)) {
- c = doc.GetCharAt (myoffset);
- } else {
- return offset;
- }
- }
-
- while (!char.IsWhiteSpace (c) && 0 <= myoffset && doc.TextLength-1 > myoffset) {
- c = doc.GetCharAt (++myoffset);
- }
-
- return System.Math.Max (offset, myoffset - 1);
- }
-
- /// <summary>
- /// Gets the character class for a given character.
- /// </summary>
- new static CharacterClass GetCharacterClass (char c)
- {
- if (char.IsLetterOrDigit (c) || '_' == c) {
- return CharacterClass.AlphaNumeric;
- } else if (char.IsWhiteSpace (c)) {
- return CharacterClass.Whitespace;
- } else {
- return CharacterClass.Symbol;
- }
- }
-
- new enum CharacterClass
- {
- AlphaNumeric, // Should be roughly equivalent to [\w\d]
- Whitespace,
- Symbol // !(AlphaNumeric || Whitespace)
- }
- }
-}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.csproj b/main/src/core/Mono.Texteditor/Mono.TextEditor.csproj
index fde0ebbec9..cbac3a716e 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.csproj
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.csproj
@@ -75,6 +75,9 @@
<Reference Include="Mono.Cairo" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Collections.Immutable">
+ <HintPath>..\..\..\build\bin\System.Collections.Immutable.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Mono.TextEditor.Highlighting\Rule.cs" />
@@ -96,9 +99,7 @@
<Compile Include="gtk-gui\generated.cs" />
<Compile Include="Mono.TextEditor\EditMode.cs" />
<Compile Include="Mono.TextEditor\SimpleEditMode.cs" />
- <Compile Include="Mono.TextEditor.Vi\ViMode.cs" />
<Compile Include="Mono.TextEditor.Vi\ViActions.cs" />
- <Compile Include="Mono.TextEditor.Vi\ViActionMaps.cs" />
<Compile Include="Mono.TextEditor\HelperMethods.cs" />
<Compile Include="Mono.TextEditor\LinkEventArgs.cs" />
<Compile Include="Mono.TextEditor\SearchRequest.cs" />
@@ -112,7 +113,6 @@
<Compile Include="Mono.TextEditor\Selection.cs" />
<Compile Include="Mono.TextEditor\Platform.cs" />
<Compile Include="Mono.TextEditor\IBracketMatcher.cs" />
- <Compile Include="Mono.TextEditor.Vi\ViWordFindStrategy.cs" />
<Compile Include="Mono.TextEditor.Theatrics\Actor.cs" />
<Compile Include="Mono.TextEditor.Theatrics\Choreographer.cs" />
<Compile Include="Mono.TextEditor.Theatrics\Pulsator.cs" />
@@ -122,21 +122,13 @@
<Compile Include="Mono.TextEditor.Theatrics\Animation.cs" />
<Compile Include="Mono.TextEditor.Theatrics\AnimatedBox.cs" />
<Compile Include="Mono.TextEditor.Theatrics\AnimatedVBox.cs" />
- <Compile Include="Mono.TextEditor.Vi\ViMacro.cs" />
- <Compile Include="Mono.TextEditor.Vi\ViMark.cs" />
<Compile Include="Mono.TextEditor.Theatrics\SmartScrolledWindow.cs" />
<Compile Include="Mono.TextEditor.Highlighting\JaySyntaxMode.cs" />
<Compile Include="Mono.TextEditor.Theatrics\BounceFadePopupWindow.cs" />
<Compile Include="Mono.TextEditor\InsertionCursorEditMode.cs" />
- <Compile Include="Mono.TextEditor.Vi\ViKeyNotation.cs" />
<Compile Include="Mono.TextEditor.PopupWindow\ModeHelpWindow.cs" />
<Compile Include="Mono.TextEditor.Highlighting\CloneableStack.cs" />
<Compile Include="Mono.TextEditor.Utils\Diff.cs" />
- <Compile Include="Mono.TextEditor.Vi\ViEditorActions.cs" />
- <Compile Include="Mono.TextEditor.Vi\ViBuilderContext.cs" />
- <Compile Include="Mono.TextEditor.Vi\ViBuilders.cs" />
- <Compile Include="Mono.TextEditor.Vi\ViCommandMap.cs" />
- <Compile Include="Mono.TextEditor.Vi\ViEditor.cs" />
<Compile Include="Mono.TextEditor.Utils\TextBreaker.cs" />
<Compile Include="Mono.TextEditor\TextMarkerEvent.cs" />
<Compile Include="Mono.TextEditor.Utils\RedBlackTree.cs" />
@@ -168,9 +160,7 @@
<Compile Include="Mono.TextEditor\Document\DocumentLocation.cs" />
<Compile Include="Mono.TextEditor\Document\DocumentRegion.cs" />
<Compile Include="Mono.TextEditor\Document\DocumentUpdateRequest.cs" />
- <Compile Include="Mono.TextEditor\Document\IBuffer.cs" />
<Compile Include="Mono.TextEditor\Gui\ITooltipProvider.cs" />
- <Compile Include="Mono.TextEditor\Document\GapBuffer.cs" />
<Compile Include="Mono.TextEditor\Document\FoldSegment.cs" />
<Compile Include="Mono.TextEditor\Document\LineEventArgs.cs" />
<Compile Include="Mono.TextEditor\Document\LineSplitter.cs" />
@@ -183,12 +173,10 @@
<Compile Include="Mono.TextEditor\Document\PrimitiveLineSplitter.cs" />
<Compile Include="Mono.TextEditor\Document\IWordFindStrategy.cs" />
<Compile Include="Mono.TextEditor\Actions\SelectionActions.cs" />
- <Compile Include="Mono.TextEditor\Document\StringBuffer.cs" />
<Compile Include="Mono.TextEditor\Document\TextSegment.cs" />
<Compile Include="Mono.TextEditor\Gui\TextViewMargin.cs" />
<Compile Include="Mono.TextEditor\Document\SharpDevelopWordFindStrategy.cs" />
<Compile Include="Mono.TextEditor\Document\EmacsWordFindStrategy.cs" />
- <Compile Include="Mono.TextEditor\Document\BufferedTextReader.cs" />
<Compile Include="Mono.TextEditor\Document\SyntaxModeChangeEventArgs.cs" />
<Compile Include="Mono.TextEditor\Document\DocumentLine.cs" />
<Compile Include="Mono.TextEditor\Standalone\TextSourceVersionProvider.cs" />
@@ -207,7 +195,6 @@
<Compile Include="Mono.TextEditor\TextSegmentMarker.cs" />
<Compile Include="Mono.TextEditor\Gui\FoldMarkerMargin.cs" />
<Compile Include="Mono.TextEditor\Gui\TextArea.cs" />
- <Compile Include="Mono.TextEditor\Gui\TextEditor.cs" />
<Compile Include="Mono.TextEditor\Standalone\StringTextSource.cs" />
<Compile Include="Mono.TextEditor.Utils\HtmlWriter.cs" />
<Compile Include="Mono.TextEditor.PopupWindow\WindowTransparencyDecorator.cs" />
@@ -218,9 +205,6 @@
<Compile Include="Mono.TextEditor.Highlighting\IStreamProvider.cs" />
<Compile Include="Mono.TextEditor.Highlighting\AmbientColor.cs" />
<Compile Include="Mono.TextEditor\ITextEditorOptions.cs" />
- <Compile Include="Mono.TextEditor.Vi\ViModeAbortException.cs" />
- <Compile Include="Mono.TextEditor.Vi\NewViEditMode.cs" />
- <Compile Include="Mono.TextEditor.Vi\ViStatusArea.cs" />
<Compile Include="Mono.TextEditor\MarginMarker.cs" />
<Compile Include="Mono.TextEditor\UnderlineMarker.cs" />
<Compile Include="Mono.TextEditor\LineBackgroundMarker.cs" />
@@ -231,11 +215,15 @@
<Compile Include="Mono.TextEditor\Document\OperationType.cs" />
<Compile Include="Mono.TextEditor\Document\DiffTracker.cs" />
<Compile Include="Mono.TextEditor.Utils\CompressingTreeList.cs" />
- <Compile Include="Mono.TextEditor.Utils\AvlTree.cs" />
<Compile Include="Mono.TextEditor.Utils\FileSettingsStore.cs" />
<Compile Include="Mono.TextEditor\Gui\LayoutCache.cs" />
<Compile Include="Mono.TextEditor\Gui\GtkUtil.cs" />
<Compile Include="Mono.TextEditor\EditModeChangedEventArgs.cs" />
+ <Compile Include="Mono.TextEditor\Gui\MonoTextEditor.cs" />
+ <Compile Include="Mono.TextEditor\Document\LazyLineSplitter.cs" />
+ <Compile Include="Mono.TextEditor.Utils\ImmutableText.cs" />
+ <Compile Include="Mono.TextEditor.Utils\ImmutableTextTextReader.cs" />
+ <Compile Include="Mono.TextEditor\Styles.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Mono.TextEditor.dll.config">
@@ -327,8 +315,8 @@
<EmbeddedResource Include="SyntaxModes\AspNetAshxSyntaxMode.xml">
<LogicalName>AspNetAshxSyntaxMode.xml</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="Styles\DefaultStyle.json">
- <LogicalName>DefaultStyle.json</LogicalName>
+ <EmbeddedResource Include="Styles\LightStyle.json">
+ <LogicalName>LightStyle.json</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="SyntaxModes\HtmlSyntaxMode.xml">
<LogicalName>HtmlSyntaxMode.xml</LogicalName>
@@ -360,6 +348,12 @@
<EmbeddedResource Include="SyntaxModes\LessSyntaxMode.xml">
<LogicalName>LessSyntaxMode.xml</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="Styles\DarkStyle.json">
+ <LogicalName>DarkStyle.json</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Styles\GruvboxStyle.json">
+ <LogicalName>GruvboxStyle.json</LogicalName>
+ </EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/ClipboardActions.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/ClipboardActions.cs
index 5176573157..793ef7c514 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/ClipboardActions.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/ClipboardActions.cs
@@ -358,8 +358,7 @@ namespace Mono.TextEditor
data.Caret.PreserveSelection = true;
result = text.Length;
DocumentLine curLine = data.Document.GetLine (data.Caret.Line);
-
- result = PastePlainText (data, curLine.Offset, text + data.EolMarker, preserveSelection, copyData);
+ result = PastePlainText (data, curLine.Offset, text + data.EolMarker, preserveSelection, copyData);
if (!preserveState)
data.ClearSelection ();
data.Caret.PreserveSelection = false;
@@ -389,36 +388,38 @@ namespace Mono.TextEditor
{
int inserted = 0;
var undo = data.OpenUndoGroup ();
- var version = data.Document.Version;
- if (!preserveSelection)
- data.DeleteSelectedText (!data.IsSomethingSelected || data.MainSelection.SelectionMode != SelectionMode.Block);
- int startLine = data.Caret.Line;
- data.EnsureCaretIsNotVirtual ();
- if (data.IsSomethingSelected && data.MainSelection.SelectionMode == SelectionMode.Block) {
- var selection = data.MainSelection;
- var visualInsertLocation = data.LogicalToVisualLocation (selection.Anchor);
- for (int lineNumber = selection.MinLine; lineNumber <= selection.MaxLine; lineNumber++) {
- var lineSegment = data.GetLine (lineNumber);
- int insertOffset = lineSegment.GetLogicalColumn (data, visualInsertLocation.Column) - 1;
- string textToInsert;
- if (lineSegment.Length < insertOffset) {
- int visualLastColumn = lineSegment.GetVisualColumn (data, lineSegment.Length + 1);
- int charsToInsert = visualInsertLocation.Column - visualLastColumn;
- int spaceCount = charsToInsert % data.Options.TabSize;
- textToInsert = new string ('\t', (charsToInsert - spaceCount) / data.Options.TabSize) + new string (' ', spaceCount) + text;
- insertOffset = lineSegment.Length;
- } else {
- textToInsert = text;
+ try {
+ var version = data.Document.Version;
+ if (!preserveSelection)
+ data.DeleteSelectedText (!data.IsSomethingSelected || data.MainSelection.SelectionMode != SelectionMode.Block);
+ int startLine = data.Caret.Line;
+ data.EnsureCaretIsNotVirtual ();
+ if (data.IsSomethingSelected && data.MainSelection.SelectionMode == SelectionMode.Block) {
+ var selection = data.MainSelection;
+ var visualInsertLocation = data.LogicalToVisualLocation (selection.Anchor);
+ for (int lineNumber = selection.MinLine; lineNumber <= selection.MaxLine; lineNumber++) {
+ var lineSegment = data.GetLine (lineNumber);
+ int insertOffset = lineSegment.GetLogicalColumn (data, visualInsertLocation.Column) - 1;
+ string textToInsert;
+ if (lineSegment.Length < insertOffset) {
+ int visualLastColumn = lineSegment.GetVisualColumn (data, lineSegment.Length + 1);
+ int charsToInsert = visualInsertLocation.Column - visualLastColumn;
+ int spaceCount = charsToInsert % data.Options.TabSize;
+ textToInsert = new string ('\t', (charsToInsert - spaceCount) / data.Options.TabSize) + new string (' ', spaceCount) + text;
+ insertOffset = lineSegment.Length;
+ } else {
+ textToInsert = text;
+ }
+ inserted = data.Insert (lineSegment.Offset + insertOffset, textToInsert);
}
- inserted = data.Insert (lineSegment.Offset + insertOffset, textToInsert);
+ } else {
+ offset = version.MoveOffsetTo (data.Document.Version, offset);
+ inserted = data.PasteText (offset, text, copyData, ref undo);
}
- } else {
- offset = version.MoveOffsetTo (data.Document.Version, offset);
- inserted = data.PasteText (offset, text, copyData, ref undo);
+ data.FixVirtualIndentation (startLine);
+ } finally {
+ undo.Dispose ();
}
- data.FixVirtualIndentation (startLine);
-
- undo.Dispose ();
return inserted;
}
@@ -435,5 +436,13 @@ namespace Mono.TextEditor
return;
PasteFrom (Clipboard.Get (CopyOperation.CLIPBOARD_ATOM), data, false, data.IsSomethingSelected ? data.SelectionRange.Offset : data.Caret.Offset);
}
+
+ public static string GetClipboardContent()
+ {
+ var clipboard = Clipboard.Get (CopyOperation.CLIPBOARD_ATOM);
+ if (!clipboard.WaitIsTextAvailable ())
+ return null;
+ return clipboard.WaitForText ();
+ }
}
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/DeleteActions.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/DeleteActions.cs
index 9107ee1b81..114261d97a 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/DeleteActions.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/DeleteActions.cs
@@ -197,6 +197,8 @@ namespace Mono.TextEditor
{
if (!data.CanEditSelection)
return;
+ DocumentLine line;
+ bool smartBackspace = false;
using (var undo = data.OpenUndoGroup ()) {
if (data.IsSomethingSelected) {
var visualAnchorLocation = data.LogicalToVisualLocation (data.MainSelection.Anchor);
@@ -237,7 +239,23 @@ namespace Mono.TextEditor
// Virtual indentation needs to be fixed before to have the same behavior
// if it's there or not (otherwise user has to press multiple backspaces in some cases)
data.EnsureCaretIsNotVirtual ();
- DocumentLine line = data.Document.GetLine (data.Caret.Line);
+
+ line = data.Document.GetLine (data.Caret.Line);
+ // smart backspace (delete indentation)
+ if (data.HasIndentationTracker && (data.IndentationTracker.SupportedFeatures & IndentatitonTrackerFeatures.SmartBackspace) != 0 && (data.Options.IndentStyle == IndentStyle.Smart || data.Options.IndentStyle == IndentStyle.Virtual)) {
+ if (data.Caret.Column == data.GetVirtualIndentationColumn (data.Caret.Location)) {
+ bool isAllIndent = line.GetIndentation (data.Document).Length == data.Caret.Column - 1;
+ if (isAllIndent) {
+ if (!data.Options.GenerateFormattingUndoStep) {
+ SmartBackspace (data, line);
+ return;
+ }
+ smartBackspace = true;
+ }
+ }
+ }
+
+ // normal backspace.
if (data.Caret.Column > line.Length + 1) {
data.Caret.Column = line.Length + 1;
} else if (data.Caret.Offset == line.Offset) {
@@ -255,8 +273,37 @@ namespace Mono.TextEditor
// Needs to be fixed after, the line may just contain the indentation
data.FixVirtualIndentation ();
}
+
+ if (data.Options.GenerateFormattingUndoStep && smartBackspace) {
+ using (var undo = data.OpenUndoGroup ()) {
+ data.EnsureCaretIsNotVirtual ();
+ SmartBackspace (data, line);
+ }
+ }
}
-
+
+ static void SmartBackspace (TextEditorData data, DocumentLine line)
+ {
+ var prevLine = line.PreviousLine;
+ var prevLineIsEmpty = prevLine != null && prevLine.Length == 0;
+
+ var startOffset = prevLine != null ? prevLine.EndOffset : 0;
+ var count = data.Caret.Offset - startOffset;
+ if (count < 0)
+ return;
+ data.Remove (startOffset, count);
+ if (prevLine != null) {
+ if (prevLineIsEmpty) {
+ if (line.Length - data.Caret.Column - 1 > 0 && data.HasIndentationTracker) {
+ data.InsertAtCaret (data.IndentationTracker.GetIndentationString (data.Caret.Offset));
+ } else {
+ data.Caret.Column = data.GetVirtualIndentationColumn (prevLine.Offset);
+ }
+ }
+ data.FixVirtualIndentation ();
+ }
+ }
+
static void RemoveCharBeforeCaret (TextEditorData data)
{
int offset = data.Caret.Offset;
@@ -304,7 +351,21 @@ namespace Mono.TextEditor
DocumentLine line = data.Document.GetLine (data.Caret.Line);
if (data.Caret.Column == line.Length + 1) {
if (data.Caret.Line < data.Document.LineCount) {
- data.Remove (line.EndOffsetIncludingDelimiter - line.DelimiterLength, line.DelimiterLength);
+ var deletionLength = line.DelimiterLength;
+ // smart backspace (delete indentation)
+ if (data.Options.IndentStyle == IndentStyle.Smart || data.Options.IndentStyle == IndentStyle.Virtual) {
+ var next = line.NextLine;
+ if (next != null) {
+ if (data.HasIndentationTracker) {
+ var lineIndentation = next.GetIndentation (data.Document);
+ if (lineIndentation.StartsWith (data.IndentationTracker.GetIndentationString (next.Offset))) {
+ deletionLength += lineIndentation.Length;
+ }
+ }
+ }
+ }
+
+ data.Remove (line.EndOffsetIncludingDelimiter - line.DelimiterLength, deletionLength);
if (line.EndOffsetIncludingDelimiter == data.Document.TextLength)
line.UnicodeNewline = UnicodeNewline.Unknown;
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/MiscActions.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/MiscActions.cs
index 8a42f8b0a0..35cbd01be4 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/MiscActions.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/MiscActions.cs
@@ -43,12 +43,12 @@ namespace Mono.TextEditor
int matchingBracketOffset = data.Document.GetMatchingBracketOffset (data.Caret.Offset);
if (matchingBracketOffset == -1 && data.Caret.Offset > 0)
matchingBracketOffset = data.Document.GetMatchingBracketOffset (data.Caret.Offset - 1);
-
+
if (matchingBracketOffset != -1)
data.Caret.Offset = matchingBracketOffset;
}
}
-
+
public static int RemoveTabInLine (TextEditorData data, DocumentLine line)
{
if (line.LengthIncludingDelimiter == 0)
@@ -116,7 +116,7 @@ namespace Mono.TextEditor
if (!removedFromLast)
lc = lead.Column;
} else {
- if (!removedFromFirst)
+ if (!removedFromFirst)
lc = lead.Column;
if (!removedFromLast)
ac = anchor.Column;
@@ -135,10 +135,15 @@ namespace Mono.TextEditor
return;
}
var line = data.Document.GetLine (data.Caret.Line);
- if (line != null)
- RemoveTabInLine (data, line);
+ if (line != null) {
+ if (line.Length == 0 && data.Caret.Column > 1) {
+ data.Caret.Column = 1;
+ } else {
+ RemoveTabInLine (data, line);
+ }
+ }
}
-
+
public static void GetSelectedLines (TextEditorData data, out int startLineNr, out int endLineNr)
{
if (data.IsSomethingSelected) {
@@ -272,9 +277,11 @@ namespace Mono.TextEditor
break;
case IndentStyle.Auto:
data.EnsureCaretIsNotVirtual ();
- var sb = new StringBuilder (data.EolMarker);
- sb.Append (data.Document.GetLineIndent (data.Caret.Line));
- data.InsertAtCaret (sb.ToString ());
+ var indent = data.Document.GetLineIndent (data.Caret.Line);
+ data.InsertAtCaret (data.EolMarker);
+ data.EnsureCaretIsNotVirtual ();
+ if (data.GetLine (data.Caret.Line).Length == 0)
+ data.InsertAtCaret (indent);
break;
case IndentStyle.Smart:
if (!data.HasIndentationTracker)
@@ -506,64 +513,14 @@ namespace Mono.TextEditor
DocumentLine line = data.Document.GetLine (data.Caret.Line);
if (line == null)
return;
- data.Insert (line.Offset, data.GetTextAt (line.SegmentIncludingDelimiter));
- }
- }
- }
-
- public static void SortSelectedLines (TextEditorData data)
- {
- var start = data.MainSelection.Start;
- var end = data.MainSelection.End;
- var caret = data.Caret.Location;
-
- int startLine = start.Line;
- int endLine = end.Line;
- if (startLine == endLine)
- return;
-
- int length = 0;
- var lines = new string[endLine - startLine + 1];
- for (int i = startLine; i <= endLine; i++) {
- //get lines *with* line endings
- var lineText = data.GetLineText (i, true);
- lines [i - startLine] = lineText;
- length += lineText.Length;
- }
-
- var linesUnsorted = new string[lines.Length];
-
- Array.Sort (lines, StringComparer.Ordinal);
-
- bool changed = false;
- for (int i = 0; i <= lines.Length; i++) {
- //can't simply use reference comparison as Array.Sort is not stable
- if (string.Equals (lines [i], linesUnsorted [i], StringComparison.Ordinal)) {
- continue;
+ if (line.DelimiterLength == 0) {
+ data.Insert (line.Offset, data.GetTextAt (line.SegmentIncludingDelimiter) + data.EolMarker);
+ } else {
+ data.Insert (line.Offset, data.GetTextAt (line.SegmentIncludingDelimiter));
+ }
}
- changed = true;
- break;
}
- if (!changed) {
- return;
- }
-
-
- var sb = new StringBuilder ();
- for (int i = 0; i < lines.Length; i++) {
- sb.Append (lines [i]);
- }
-
- var startOffset = data.Document.LocationToOffset (new TextLocation (startLine, 0));
- data.Replace (startOffset, length, sb.ToString ());
-
- data.Caret.Location = LimitColumn (data, caret);
- data.SetSelection (LimitColumn (data, start), LimitColumn (data, end));
}
- static DocumentLocation LimitColumn (TextEditorData data, DocumentLocation loc)
- {
- return new DocumentLocation (loc.Line, System.Math.Min (loc.Column, data.GetLine (loc.Line).Length + 1));
- }
}
} \ No newline at end of file
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/BookmarkMarker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/BookmarkMarker.cs
index c40ea22edf..6b6c3b41e2 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/BookmarkMarker.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/BookmarkMarker.cs
@@ -49,27 +49,30 @@ namespace Mono.TextEditor
return margin is IconMargin;
}
- public override void DrawForeground (TextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
+ public override void DrawForeground (MonoTextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
{
DrawBookmarkFunc (editor, cr, LineSegment, metrics.X, metrics.Y, metrics.Width, metrics.Height);
}
- public static Action<TextEditor, Cairo.Context, DocumentLine, double, double, double, double> DrawBookmarkFunc = DrawIcon;
+ public static Action<MonoTextEditor, Cairo.Context, DocumentLine, double, double, double, double> DrawBookmarkFunc = DrawIcon;
- static void DrawIcon (TextEditor editor, Cairo.Context cr, DocumentLine lineSegment, double x, double y, double width, double height)
+ static void DrawIcon (MonoTextEditor editor, Cairo.Context cr, DocumentLine lineSegment, double x, double y, double width, double height)
{
if (lineSegment.IsBookmarked) {
var color1 = editor.ColorStyle.Bookmarks.Color;
var color2 = editor.ColorStyle.Bookmarks.SecondColor;
DrawRoundRectangle (cr, x + 1, y + 1, 8, width - 4, height - 4);
+
+ // FIXME: VV: Remove gradient features
using (var pat = new Cairo.LinearGradient (x + width / 4, y, x + width / 2, y + height - 4)) {
pat.AddColorStop (0, color1);
pat.AddColorStop (1, color2);
cr.SetSource (pat);
cr.FillPreserve ();
}
-
+
+ // FIXME: VV: Remove gradient features
using (var pat = new Cairo.LinearGradient (x, y + height, x + width, y)) {
pat.AddColorStop (0, color2);
//pat.AddColorStop (1, color1);
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Caret.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Caret.cs
index ed4e4973c4..c0723e76e0 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Caret.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Caret.cs
@@ -105,6 +105,10 @@ namespace Mono.TextEditor
set {
if (caretOffset == value)
return;
+ if (caretOffset < 0)
+ throw new InvalidOperationException ($"Caret offset must be >= 0 tried to set {value}");
+ if (caretOffset > TextEditorData.Length)
+ throw new InvalidOperationException ($"Caret offset must be < Length {TextEditorData.Length} but was {value}");
DocumentLocation old = Location;
caretOffset = value;
offsetVersion = TextEditorData.Document.Version;
@@ -347,7 +351,7 @@ namespace Mono.TextEditor
result += System.Math.Min (Column - 1, line.Length);
}
}
- caretOffset = result;
+ caretOffset = System.Math.Max(0, result);
offsetVersion = doc.Version;
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/BufferedTextReader.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/BufferedTextReader.cs
deleted file mode 100644
index 77340951be..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/BufferedTextReader.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-// BufferedTextReader.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-namespace Mono.TextEditor
-{
- /// <summary>
- /// Wraps the IBuffer interface to a System.IO.TextReader model.
- /// </summary>
- class BufferedTextReader : System.IO.TextReader
- {
- int position = 0;
- IBuffer buffer;
-
- public BufferedTextReader (IBuffer buffer)
- {
- this.buffer = buffer;
- }
-
- protected override void Dispose (bool disposing)
- {
- if (disposing)
- buffer = null;
- }
-
- public override void Close ()
- {
- Dispose ();
- }
-
- public override int Peek ()
- {
- if (position < 0 || position >= buffer.TextLength)
- return -1;
- return buffer.GetCharAt (position);
- }
-
- public override int Read ()
- {
- if (position < 0 || position >= buffer.TextLength)
- return -1;
- return buffer.GetCharAt (position++);
- }
-
- public override int Read (char[] buffer, int index, int count)
- {
- if (buffer == null)
- throw new ArgumentNullException ();
- int lastOffset = System.Math.Min (this.buffer.TextLength, position + count);
- int length = lastOffset - position;
- if (length <= 0)
- return 0;
- string text = this.buffer.GetTextAt (position, length);
- text.CopyTo (0, buffer, index, length);
- position += length;
- return length;
- }
-
- public override string ReadToEnd ()
- {
- if (position < 0 || position >= buffer.TextLength)
- return "";
- string result = this.buffer.GetTextAt (position, buffer.TextLength - position);
- position = buffer.TextLength;
- return result;
- }
- }
-}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DiffTracker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DiffTracker.cs
index 1b56c0130f..1c8a1e190a 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DiffTracker.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DiffTracker.cs
@@ -46,7 +46,7 @@ namespace Mono.TextEditor
public Mono.TextEditor.TextDocument.LineState GetLineState (DocumentLine line)
{
- if (line != null) {
+ if (line != null && lineStates != null) {
try {
var info = lineStates [line.LineNumber];
if (info != null) {
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentLine.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentLine.cs
index b87a77c38e..9dc9932f70 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentLine.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentLine.cs
@@ -88,11 +88,6 @@ namespace Mono.TextEditor
}
}
- public bool WasChanged {
- get;
- set;
- }
-
CloneableStack<Span> startSpan;
static readonly CloneableStack<Span> EmptySpan = new CloneableStack<Span> ();
@@ -195,12 +190,16 @@ namespace Mono.TextEditor
UnicodeNewline = unicodeNewline;
}
- internal void AddMarker (TextLineMarker marker)
+ internal void AddMarker (TextLineMarker marker, int idx = -1)
{
if (markers == null)
markers = new List<TextLineMarker> ();
marker.LineSegment = this;
- markers.Add (marker);
+ if (idx < 0) {
+ markers.Add (marker);
+ } else {
+ markers.Insert (idx, marker);
+ }
}
public void ClearMarker ()
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentUpdateRequest.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentUpdateRequest.cs
index bf4ce8f02d..e414b6af73 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentUpdateRequest.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/DocumentUpdateRequest.cs
@@ -29,7 +29,7 @@ namespace Mono.TextEditor
{
public abstract class DocumentUpdateRequest
{
- public abstract void Update (TextEditor editor);
+ public abstract void Update (MonoTextEditor editor);
}
public class SinglePositionUpdate : DocumentUpdateRequest
@@ -42,7 +42,7 @@ namespace Mono.TextEditor
this.column = column;
}
- public override void Update (TextEditor editor)
+ public override void Update (MonoTextEditor editor)
{
editor.RedrawPosition (line, column);
}
@@ -50,7 +50,7 @@ namespace Mono.TextEditor
public class UpdateAll : DocumentUpdateRequest
{
- public override void Update (TextEditor editor)
+ public override void Update (MonoTextEditor editor)
{
editor.QueueDraw ();
}
@@ -65,7 +65,7 @@ namespace Mono.TextEditor
this.line = line;
}
- public override void Update (TextEditor editor)
+ public override void Update (MonoTextEditor editor)
{
editor.RedrawLine (line);
}
@@ -81,10 +81,19 @@ namespace Mono.TextEditor
this.end = end;
}
- public override void Update (TextEditor editor)
+ public override void Update (MonoTextEditor editor)
{
- editor.TextViewMargin.PurgeLayoutCache ();
- editor.RedrawLines (start, end);
+ var startLine = editor.GetLine (start);
+ if (start == end) {
+ editor.TextViewMargin.RemoveCachedLine (startLine);
+ editor.RedrawLine (start);
+ } else {
+ for (int i = 0; startLine != null && i < end - start; i++) {
+ editor.TextViewMargin.RemoveCachedLine (startLine);
+ startLine = startLine.NextLine;
+ }
+ editor.RedrawLines (start, end);
+ }
}
}
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/GapBuffer.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/GapBuffer.cs
deleted file mode 100644
index 7ba81771aa..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/GapBuffer.cs
+++ /dev/null
@@ -1,599 +0,0 @@
-// GapBuffer.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2007 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.Text;
-using System.Collections.Generic;
-
-namespace Mono.TextEditor
-{
- public sealed class GapBuffer : IBuffer
- {
- char[] buffer = new char[0];
-
- int gapBegin = 0;
- int gapEnd = 0;
- int gapLength = 0;
-
- const int minGapLength = 4 * 1024;
- const int maxGapLength = 32 * 1024;
-
- public int TextLength {
- get {
- return buffer.Length - gapLength;
- }
- }
-
- public void Insert (int offset, string text)
- {
- Replace (offset, 0, text);
- }
-
- public void Remove (int offset, int count)
- {
- Replace (offset, count, null);
- }
-
- public void Remove (TextSegment segment)
- {
- Remove (segment.Offset, segment.Length);
- }
-
- public string GetTextAt (TextSegment segment)
- {
- return GetTextAt (segment.Offset, segment.Length);
- }
-
- public string Text {
- get {
- return GetTextAt (0, TextLength);
- }
- set {
- buffer = value != null ? value.ToCharArray () : new char[0];
- gapBegin = gapEnd = gapLength = 0;
- }
- }
-
- public char GetCharAt (int offset)
- {
- return buffer[offset < gapBegin ? offset : offset + gapLength];
- }
-
- public string GetTextAt (int offset, int count)
- {
- int end = offset + count;
- if (end < gapBegin)
- return new string (buffer, offset, count);
- if (offset > gapBegin)
- return new string (buffer, offset + gapLength, count);
-
- int leftBlockSize = gapBegin - offset;
- int rightBlockSize = end - gapBegin;
- char[] result = new char [leftBlockSize + rightBlockSize];
- Array.Copy (buffer, offset, result, 0, leftBlockSize);
- Array.Copy (buffer, gapEnd, result, leftBlockSize, rightBlockSize);
- return new string (result);
- }
-
- public void Replace (int offset, int count, string text)
- {
- if (!string.IsNullOrEmpty (text)) {
- PlaceGap (offset, text.Length - count);
- text.CopyTo (0, buffer, offset, text.Length);
- gapBegin += text.Length;
- } else {
- PlaceGap (offset, 0);
- }
- gapEnd += count;
- gapLength = gapEnd - gapBegin;
- if (gapLength > maxGapLength)
- CreateBuffer (gapBegin, minGapLength);
- }
-
- void PlaceGap (int newOffset, int minLength)
- {
- if (gapLength < minLength) {
- if (minLength < maxGapLength) {
- CreateBuffer (newOffset, minLength + (maxGapLength - minLength) / 2);
- } else {
- CreateBuffer (newOffset, minLength + minGapLength);
- }
- return;
- }
-
- int delta = gapBegin - newOffset;
- if (delta > 0) {
- Array.Copy (buffer, newOffset, buffer, gapEnd - delta, delta);
- } else {
- Array.Copy (buffer, gapEnd, buffer, gapBegin, -delta);
- }
- gapBegin -= delta;
- gapEnd -= delta;
- }
-
- void CreateBuffer (int gapOffset, int gapLength)
- {
- gapLength = System.Math.Max (minGapLength, gapLength);
-
- char[] newBuffer = new char[TextLength + gapLength];
- if (gapOffset < gapBegin) {
- Array.Copy (buffer, 0, newBuffer, 0, gapOffset);
- Array.Copy (buffer, gapOffset, newBuffer, gapOffset + gapLength, gapBegin - gapOffset);
- Array.Copy (buffer, gapEnd, newBuffer, newBuffer.Length - (buffer.Length - gapEnd), buffer.Length - gapEnd);
- } else {
- Array.Copy (buffer, 0, newBuffer, 0, gapBegin);
- Array.Copy (buffer, gapEnd, newBuffer, gapBegin, gapOffset - gapBegin);
- int lastPartLength = newBuffer.Length - (gapOffset + gapLength);
- Array.Copy (buffer, buffer.Length - lastPartLength, newBuffer, gapOffset + gapLength, lastPartLength);
- }
-
- gapBegin = gapOffset;
- gapEnd = gapOffset + gapLength;
- this.gapLength = gapLength;
- buffer = newBuffer;
- }
-
-
- // TODO: Optimize!
- int IBuffer.IndexOf (char c, int startIndex, int count)
- {
- return Text.IndexOf (c, startIndex, count);
- }
-
- int IBuffer.IndexOfAny (char[] anyOf, int startIndex, int count)
- {
- return Text.IndexOfAny (anyOf, startIndex, count);
- }
-
- public int IndexOf (string searchText, int startIndex, int count, StringComparison comparisonType)
- {
- return Text.IndexOf (searchText, startIndex, count, comparisonType);
- }
-
- int IBuffer.LastIndexOf (char c, int startIndex, int count)
- {
- return Text.LastIndexOf (c, startIndex, count);
- }
-
- public int LastIndexOf (string searchText, int startIndex, int count, StringComparison comparisonType)
- {
- return Text.LastIndexOf (searchText, startIndex, count, comparisonType);
- }
-
-// #region Search
-// unsafe int SearchForwardInternal (string pattern, int startIndex)
-// {
-// if (startIndex > gapBegin)
-// startIndex += gapLength;
-//
-// int valueLen = pattern.Length;
-// if (startIndex >= buffer.Length - valueLen + 1)
-// return -1;
-//
-// fixed (char* bufferPtr = buffer, patternPtr = pattern) {
-// char* ap = bufferPtr + startIndex;
-// char* bufferPhysEnd = bufferPtr + buffer.Length;
-// char* bufferEnd = bufferPhysEnd - valueLen + 1;
-// char* gapBeginPtr = bufferPtr + gapBegin;
-// char* gapEndPtr = bufferPtr + gapEnd;
-// char* stopGap = gapBeginPtr - valueLen + 1;
-// char* patternPos1Ptr = patternPtr + 1;
-// char* patternEndPtr = patternPtr + valueLen;
-// char p0 = *patternPtr;
-//
-// if (ap < gapBeginPtr) {
-// if (stopGap > bufferPtr) {
-// while (ap < stopGap) {
-// if (*ap == p0) {
-// char* p = ap + 1;
-// char* v = patternPos1Ptr;
-// while (v < patternEndPtr) {
-// if (*p != *v)
-// goto NextVal;
-// v++;
-// p++;
-// }
-// return (int)(ap - bufferPtr);
-// }
-// NextVal:
-// ap++;
-// }
-// }
-//
-// while (ap != gapBeginPtr) {
-// if (*ap == p0) {
-// char* p = ap + 1;
-// char* v = patternPos1Ptr;
-// while (v < patternEndPtr) {
-// if (*p != *v)
-// goto NextVal;
-// v++;
-// p++;
-// if (p == gapBeginPtr)
-// p = gapEndPtr;
-// }
-// return (int)(ap - bufferPtr);
-// }
-// NextVal:
-// ap++;
-// }
-// }
-//
-// if (ap < gapEndPtr)
-// ap = gapEndPtr;
-// if (ap < bufferEnd) {
-// while (ap != bufferEnd) {
-// if (*ap == p0) {
-// char* p = ap + 1;
-// char* v = patternPos1Ptr;
-// while (v < patternEndPtr) {
-// if (*p != *v)
-// goto NextVal;
-// v++;
-// p++;
-// }
-// return (int)(ap - gapLength - bufferPtr);
-// }
-// NextVal:
-// ap++;
-// }
-// }
-// }
-// return -1;
-// }
-//
-// unsafe int SearchForwardInternalIgnoreCase (string pattern, int startIndex)
-// {
-// if (startIndex > gapBegin)
-// startIndex += gapLength;
-//
-// int valueLen = pattern.Length;
-// if (startIndex >= buffer.Length - valueLen + 1)
-// return -1;
-//
-// fixed (char* bufferPtr = buffer, patternPtr = pattern) {
-// char* ap = bufferPtr + startIndex;
-// char* bufferPhysEnd = bufferPtr + buffer.Length;
-// char* bufferEnd = bufferPhysEnd - valueLen + 1;
-// char* gapBeginPtr = bufferPtr + gapBegin;
-// char* gapEndPtr = bufferPtr + gapEnd;
-// char* stopGap = gapBeginPtr - valueLen + 1;
-// char* patternPos1Ptr = patternPtr + 1;
-// char* patternEndPtr = patternPtr + valueLen;
-// char p0 = *patternPtr;
-//
-// if (ap < gapBeginPtr) {
-// if (stopGap > bufferPtr) {
-// while (ap < stopGap) {
-// if (char.ToUpper (*ap) == p0) {
-// char* p = ap + 1;
-// char* v = patternPos1Ptr;
-// while (v < patternEndPtr) {
-// if (char.ToUpper (*p) != *v)
-// goto NextVal;
-// v++;
-// p++;
-// }
-// return (int)(ap - bufferPtr);
-// }
-// NextVal:
-// ap++;
-// }
-// }
-//
-// while (ap != gapBeginPtr) {
-// if (char.ToUpper (*ap) == p0) {
-// char* p = ap + 1;
-// char* v = patternPos1Ptr;
-// while (v < patternEndPtr) {
-// if (char.ToUpper (*p) != *v)
-// goto NextVal;
-// v++;
-// p++;
-// if (p == gapBeginPtr)
-// p = gapEndPtr;
-// }
-// return (int)(ap - bufferPtr);
-// }
-// NextVal:
-// ap++;
-// }
-// }
-//
-// if (ap < gapEndPtr)
-// ap = gapEndPtr;
-// if (ap < bufferEnd) {
-// while (ap != bufferEnd) {
-// if (char.ToUpper (*ap) == p0) {
-// char* p = ap + 1;
-// char* v = patternPos1Ptr;
-// while (v < patternEndPtr) {
-// if (char.ToUpper (*p) != *v)
-// goto NextVal;
-// v++;
-// p++;
-// }
-// return (int)(ap - gapLength - bufferPtr);
-// }
-// NextVal:
-// ap++;
-// }
-// }
-// }
-// return -1;
-// }
-//
-// public IEnumerable<int> SearchForward (string pattern, int startIndex)
-// {
-// int idx = startIndex;
-// while ((idx = SearchForwardInternal (pattern, idx)) != -1) {
-// yield return idx;
-// idx += pattern.Length;
-// }
-// }
-//
-// public IEnumerable<int> SearchForwardIgnoreCase (string pattern, int startIndex)
-// {
-// pattern = pattern.ToUpper ();
-// int idx = startIndex;
-// while ((idx = SearchForwardInternalIgnoreCase (pattern, idx)) != -1) {
-// yield return idx;
-// idx += pattern.Length;
-// }
-// }
-//
-// unsafe int SearchBackwardInternal (string pattern, int startIndex)
-// {
-// int valueLen = pattern.Length;
-// if (startIndex < valueLen - 1)
-// return -1;
-// if (startIndex > gapBegin)
-// startIndex += gapLength;
-// fixed (char* bufferPtr = buffer, patternPtr = pattern) {
-// char* ap = bufferPtr + startIndex;
-// char* bufferEnd = bufferPtr + valueLen - 1;
-//
-// char* bufferPhysEnd = bufferPtr + buffer.Length;
-// char* gapBeginPtr = bufferPtr + gapBegin;
-// char* gapEndPtr = bufferPtr + gapEnd;
-// char* stopGap = gapEndPtr + valueLen - 1;
-// char* patternPos1Ptr = patternPtr + valueLen - 2;
-// char* patternEndPtr = patternPtr - 1;
-// char p0 = *(patternPtr + valueLen - 1);
-//
-// if (ap >= gapEndPtr) {
-// if (stopGap < bufferPhysEnd) {
-// while (ap >= stopGap) {
-// if (*ap == p0) {
-// char* p = ap - 1;
-// char* v = patternPos1Ptr;
-// while (v > patternEndPtr) {
-// if (*p != *v)
-// goto NextVal;
-// v--;
-// p--;
-// }
-// return (int)(p - gapLength - bufferPtr + 1);
-// }
-// NextVal:
-// ap--;
-// }
-// }
-//
-// while (ap >= gapEndPtr) {
-// if (*ap == p0) {
-// char* p = ap - 1;
-// char* v = patternPos1Ptr;
-// while (v > patternEndPtr) {
-// if (*p != *v)
-// goto NextVal;
-// v--;
-// if (p == gapEndPtr) {
-// p = gapBeginPtr - 1;
-// } else {
-// p--;
-// }
-// }
-// if (p >= gapEndPtr)
-// return (int)(p - gapLength - bufferPtr + 1);
-// return (int)(p - bufferPtr + 1);
-// }
-// NextVal:
-// ap--;
-// }
-// }
-//
-// while (ap >= bufferEnd) {
-// if (*ap == p0) {
-// char* p = ap - 1;
-// char* v = patternPos1Ptr;
-// while (v > patternEndPtr) {
-// if (*p != *v)
-// goto NextVal;
-// v--;
-// p--;
-// }
-// return (int)(p - bufferPtr + 1);
-// }
-// NextVal:
-// ap--;
-// }
-// }
-// return -1;
-// }
-//
-// unsafe int SearchBackwardInternalIgnoreCase (string pattern, int startIndex)
-// {
-// int valueLen = pattern.Length;
-// if (startIndex < valueLen - 1)
-// return -1;
-// if (startIndex > gapBegin)
-// startIndex += gapLength;
-//
-// fixed (char* bufferPtr = buffer, patternPtr = pattern) {
-// char* ap = bufferPtr + startIndex;
-// char* bufferEnd = bufferPtr + valueLen - 1;
-//
-// char* bufferPhysEnd = bufferPtr + buffer.Length;
-// char* gapBeginPtr = bufferPtr + gapBegin;
-// char* gapEndPtr = bufferPtr + gapEnd;
-// char* stopGap = gapEndPtr + valueLen - 1;
-// char* patternPos1Ptr = patternPtr + valueLen - 2;
-// char* patternEndPtr = patternPtr - 1;
-// char p0 = *(patternPtr + valueLen - 1);
-//
-// if (ap >= gapEndPtr) {
-// if (stopGap < bufferPhysEnd) {
-// while (ap >= stopGap) {
-// if (char.ToUpper (*ap) == p0) {
-// char* p = ap - 1;
-// char* v = patternPos1Ptr;
-// while (v > patternEndPtr) {
-// if (char.ToUpper (*p) != *v)
-// goto NextVal;
-// v--;
-// p--;
-// }
-// return (int)(p - gapLength - bufferPtr + 1);
-// }
-// NextVal:
-// ap--;
-// }
-// }
-//
-// while (ap >= gapEndPtr) {
-// if (char.ToUpper (*ap) == p0) {
-// char* p = ap - 1;
-// char* v = patternPos1Ptr;
-// while (v > patternEndPtr) {
-// if (char.ToUpper (*p) != *v)
-// goto NextVal;
-// v--;
-// if (p == gapEndPtr) {
-// p = gapBeginPtr - 1;
-// } else {
-// p--;
-// }
-// }
-// if (p >= gapEndPtr)
-// return (int)(p - gapLength - bufferPtr + 1);
-// return (int)(p - bufferPtr + 1);
-// }
-// NextVal:
-// ap--;
-// }
-// }
-// while (ap >= bufferEnd) {
-// if (char.ToUpper (*ap) == p0) {
-// char* p = ap - 1;
-// char* v = patternPos1Ptr;
-// while (v > patternEndPtr) {
-// if (char.ToUpper (*p) != *v)
-// goto NextVal;
-// v--;
-// p--;
-// }
-// return (int)(p - bufferPtr + 1);
-// }
-// NextVal:
-// ap--;
-// }
-// }
-// return -1;
-// }
-//
-// public IEnumerable<int> SearchBackward (string pattern, int startIndex)
-// {
-// int idx = startIndex;
-// while ((idx = SearchBackwardInternal (pattern, idx)) != -1) {
-// yield return idx;
-// idx -= pattern.Length;
-// }
-// }
-//
-// public IEnumerable<int> SearchBackwardIgnoreCase (string pattern, int startIndex)
-// {
-// pattern = pattern.ToUpper ();
-// int idx = startIndex;
-// while ((idx = SearchBackwardInternalIgnoreCase (pattern, idx)) != -1) {
-// yield return idx;
-// idx -= pattern.Length;
-// }
-// }
-//
-// /* Boyer-Moore-Horspool-Raita implementation: (but on Intel Core i brute force outpeforms it.
-//
-// static int[] ProcessString (string pattern)
-// {
-// var result = new int[char.MaxValue];
-// for (int i = 0; i < result.Length; i++)
-// result[i] = pattern.Length - 1;
-// for (int i = 0; i < pattern.Length - 1; ++i) {
-// result[pattern[i]] = pattern.Length - i - 1;
-// }
-// return result;
-// }
-// unsafe static int bmhrSearchBytes (string text, string pattern, int textStart, int[] b)
-// {
-// int lastIndex = text.Length + pattern.Length - 1;
-// if (textStart >= lastIndex)
-// return -1;
-//
-// int m = pattern.Length - 1;
-// int mMinusOne = pattern.Length - 2;
-//
-// var last = pattern[pattern.Length - 1];
-// var first = pattern[0];
-//
-// fixed (char* textPtr = text, pattenrPtr = pattern) {
-// char* i = textPtr + textStart + pattern.Length - 1;
-// char* endText = textPtr + lastIndex;
-// while (i < endText) {
-// if (*i == last) {
-// //if (*(i - m) == first) {
-// char* k = i - 1;
-// char* pp = pattenrPtr + mMinusOne;
-//
-// while (pp >= pattenrPtr && *k == *pp) {
-// --k;
-// --pp;
-// }
-//
-// if (pp < pattenrPtr)
-// return (int)(k - textPtr) + 1;
-// // }
-// }
-// i += b[*i];
-// }
-// }
-// return -1;
-// }
-// * */
-// #endregion
-
- }
-} \ No newline at end of file
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/IBuffer.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/IBuffer.cs
deleted file mode 100644
index 0cfffef74e..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/IBuffer.cs
+++ /dev/null
@@ -1,131 +0,0 @@
-// IBuffer.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2007 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Mono.TextEditor
-{
- public interface IBuffer
- {
- /// <summary>
- /// Gets the total text length.
- /// </summary>
- /// <returns>The length of the text, in characters.</returns>
- /// <remarks>This is the same as Text.Length, but is more efficient because
- /// it doesn't require creating a String object.</remarks>
- int TextLength {
- get;
- }
-
- /// <summary>
- /// Gets the whole text as string.
- /// </summary>
- string Text {
- get;
- set;
- }
-
- /// <summary>
- /// Replaces text.
- /// </summary>
- /// <param name="offset">The starting offset of the text to be replaced.</param>
- /// <param name="count">The length of the text to be replaced.</param>
- /// <param name="value">The new text.</param>
- void Replace (int offset, int count, string value);
-
- /// <summary>
- /// Retrieves the text for a portion of the document.
- /// </summary>
- /// <exception cref="ArgumentOutOfRangeException">offset or length is outside the valid range.</exception>
- /// <remarks>This is the same as Text.Substring, but is more efficient because
- /// it doesn't require creating a String object for the whole document.</remarks>
- string GetTextAt (int offset, int count);
-
- /// <summary>
- /// Gets a character at the specified position in the document.
- /// </summary>
- /// <paramref name="offset">The index of the character to get.</paramref>
- /// <exception cref="ArgumentOutOfRangeException">Offset is outside the valid range (0 to TextLength-1).</exception>
- /// <returns>The character at the specified position.</returns>
- /// <remarks>This is the same as Text[offset], but is more efficient because
- /// it doesn't require creating a String object.</remarks>
- char GetCharAt (int offset);
-
- /// <summary>
- /// Gets the index of the first occurrence of the character in the specified array.
- /// </summary>
- /// <param name="c">Character to search for</param>
- /// <param name="startIndex">Start index of the area to search.</param>
- /// <param name="count">Length of the area to search.</param>
- /// <returns>The first index where the character was found; or -1 if no occurrence was found.</returns>
- int IndexOf (char c, int startIndex, int count);
-
- /// <summary>
- /// Gets the index of the first occurrence of any character in the specified array.
- /// </summary>
- /// <param name="anyOf">Characters to search for</param>
- /// <param name="startIndex">Start index of the area to search.</param>
- /// <param name="count">Length of the area to search.</param>
- /// <returns>The first index where any character was found; or -1 if no occurrence was found.</returns>
- int IndexOfAny (char[] anyOf, int startIndex, int count);
-
- /// <summary>
- /// Gets the index of the first occurrence of the specified search text in this text source.
- /// </summary>
- /// <param name="searchText">The search text</param>
- /// <param name="startIndex">Start index of the area to search.</param>
- /// <param name="count">Length of the area to search.</param>
- /// <param name="comparisonType">String comparison to use.</param>
- /// <returns>The first index where the search term was found; or -1 if no occurrence was found.</returns>
- int IndexOf (string searchText, int startIndex, int count, StringComparison comparisonType);
-
- /// <summary>
- /// Gets the index of the last occurrence of the specified character in this text source.
- /// </summary>
- /// <param name="c">The search character</param>
- /// <param name="startIndex">Start index of the area to search.</param>
- /// <param name="count">Length of the area to search.</param>
- /// <returns>The last index where the search term was found; or -1 if no occurrence was found.</returns>
- /// <remarks>The search proceeds backwards from (startIndex+count) to startIndex.
- /// This is different than the meaning of the parameters on string.LastIndexOf!</remarks>
- int LastIndexOf (char c, int startIndex, int count);
-
- /// <summary>
- /// Gets the index of the last occurrence of the specified search text in this text source.
- /// </summary>
- /// <param name="searchText">The search text</param>
- /// <param name="startIndex">Start index of the area to search.</param>
- /// <param name="count">Length of the area to search.</param>
- /// <param name="comparisonType">String comparison to use.</param>
- /// <returns>The last index where the search term was found; or -1 if no occurrence was found.</returns>
- /// <remarks>The search proceeds backwards from (startIndex+count) to startIndex.
- /// This is different than the meaning of the parameters on string.LastIndexOf!</remarks>
- int LastIndexOf (string searchText, int startIndex, int count, StringComparison comparisonType);
- }
-}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LazyLineSplitter.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LazyLineSplitter.cs
new file mode 100644
index 0000000000..ca336fc671
--- /dev/null
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LazyLineSplitter.cs
@@ -0,0 +1,206 @@
+//
+// LazyLineSplitter.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using ICSharpCode.NRefactory;
+using System.Collections.Generic;
+using ICSharpCode.NRefactory.Editor;
+
+namespace Mono.TextEditor
+{
+ class LazyLineSplitter : ILineSplitter
+ {
+ internal ITextSource src;
+ LineSegment[] lines;
+
+ sealed class LineSegment : DocumentLine
+ {
+ readonly LazyLineSplitter splitter;
+ readonly int lineNumber;
+
+ public override int Offset { get; set; }
+
+ public override int LineNumber {
+ get {
+ return lineNumber + 1;
+ }
+ }
+
+ public override DocumentLine NextLine {
+ get {
+ return splitter.Get (lineNumber + 1);
+ }
+ }
+
+ public override DocumentLine PreviousLine {
+ get {
+ return splitter.Get (lineNumber - 1);
+ }
+ }
+
+ public LineSegment (LazyLineSplitter splitter, int lineNumber, int offset, int length, UnicodeNewline newLine) : base(length, newLine)
+ {
+ this.splitter = splitter;
+ this.lineNumber = lineNumber;
+ Offset = offset;
+ }
+ }
+
+ void EnsureBuild()
+ {
+ if (this.lines != null)
+ return;
+ var text = src.Text;
+ var nodes = new List<LineSegment> ();
+
+ var delimiterType = UnicodeNewline.Unknown;
+ int offset = 0, maxLength = 0, lineNumber = 0;
+ while (true) {
+ var delimiter = LineSplitter.NextDelimiter (text, offset);
+ if (delimiter.IsInvalid)
+ break;
+ int delimiterEndOffset = delimiter.Offset + delimiter.Length;
+ var length = delimiterEndOffset - offset;
+ var newLine = new LineSegment (this, lineNumber++, offset, length, delimiter.UnicodeNewline);
+ nodes.Add (newLine);
+ if (length > maxLength) {
+ maxLength = length;
+ }
+ if (offset > 0) {
+ LineEndingMismatch |= delimiterType != delimiter.UnicodeNewline;
+ } else {
+ delimiterType = delimiter.UnicodeNewline;
+ }
+ offset = delimiterEndOffset;
+ }
+ var lastLine = new LineSegment (this, lineNumber++, offset, text.Length - offset, UnicodeNewline.Unknown);
+ nodes.Add (lastLine);
+ this.lines = nodes.ToArray ();
+ }
+
+ public LazyLineSplitter (int lineCount)
+ {
+ this.Count = lineCount;
+ }
+
+ #region ILineSplitter implementation
+
+ event EventHandler<LineEventArgs> ILineSplitter.LineChanged { add { /* unused */ } remove { /* unused */ } }
+
+ event EventHandler<LineEventArgs> ILineSplitter.LineInserted { add { /* unused */ } remove { /* unused */ } }
+
+ event EventHandler<LineEventArgs> ILineSplitter.LineRemoved { add { /* unused */ } remove { /* unused */ } }
+
+ public void Clear ()
+ {
+ }
+
+ public void Initalize (string text, out DocumentLine longestLine)
+ {
+ longestLine = null;
+ }
+
+ public DocumentLine Get (int number)
+ {
+ EnsureBuild ();
+ return lines [number - 1];
+ }
+
+ public DocumentLine GetLineByOffset (int offset)
+ {
+ EnsureBuild ();
+ return lines [OffsetToLineNumber (offset) - 1];
+ }
+
+ public int OffsetToLineNumber (int offset)
+ {
+ EnsureBuild ();
+ int min = 0;
+ int max = lines.Length - 1;
+ while (min <= max) {
+ int mid = (min + max) / 2;
+ var middleLine = lines [mid];
+ if (offset < middleLine.Offset) {
+ max = mid - 1;
+ } else if (offset > middleLine.EndOffset) {
+ min = mid + 1;
+ } else {
+ return mid + 1;
+ }
+ }
+ return lines.Length;
+ }
+
+ public void TextReplaced (object sender, DocumentChangeEventArgs args)
+ {
+ }
+
+ public void TextRemove (int offset, int length)
+ {
+ }
+
+ public void TextInsert (int offset, string text)
+ {
+ }
+
+ public IEnumerable<DocumentLine> GetLinesBetween (int startLine, int endLine)
+ {
+ for (int i = startLine; i <= endLine; i++)
+ yield return Get (i);
+ }
+
+ public IEnumerable<DocumentLine> GetLinesStartingAt (int startLine)
+ {
+ for (int i = startLine; i <= Count; i++)
+ yield return Get (i);
+ }
+
+ public IEnumerable<DocumentLine> GetLinesReverseStartingAt (int startLine)
+ {
+ for (int i = startLine; i-- > DocumentLocation.MinLine;)
+ yield return Get (i);
+ }
+
+ public int Count {
+ get;
+ private set;
+ }
+
+ public bool LineEndingMismatch {
+ get;
+ set;
+ }
+
+ public System.Collections.Generic.IEnumerable<DocumentLine> Lines {
+ get {
+ EnsureBuild ();
+ return lines;
+ }
+ }
+
+ #endregion
+ }
+} \ No newline at end of file
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LineSplitter.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LineSplitter.cs
index 3b3ec80988..4343b21bb4 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LineSplitter.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LineSplitter.cs
@@ -90,7 +90,7 @@ namespace Mono.TextEditor
public DocumentLine GetLineByOffset (int offset)
{
var lineNumber = OffsetToLineNumber (offset);
- return lineNumber >= 0 ? Get (lineNumber) : null;
+ return lineNumber >= 1 ? Get (lineNumber) : null;
}
public void TextReplaced (object sender, DocumentChangeEventArgs args)
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/PrimitiveLineSplitter.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/PrimitiveLineSplitter.cs
index 25e119c629..3094e1d2bd 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/PrimitiveLineSplitter.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/PrimitiveLineSplitter.cs
@@ -156,8 +156,10 @@ namespace Mono.TextEditor
yield return Get (i);
}
- public event EventHandler<LineEventArgs> LineChanged;
- public event EventHandler<LineEventArgs> LineInserted;
- public event EventHandler<LineEventArgs> LineRemoved;
+ event EventHandler<LineEventArgs> ILineSplitter.LineChanged { add { /* unused */ } remove { /* unused */ } }
+
+ event EventHandler<LineEventArgs> ILineSplitter.LineInserted { add { /* unused */ } remove { /* unused */ } }
+
+ event EventHandler<LineEventArgs> ILineSplitter.LineRemoved { add { /* unused */ } remove { /* unused */ } }
}
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/StringBuffer.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/StringBuffer.cs
deleted file mode 100644
index ba504a179a..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/StringBuffer.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-namespace Mono.TextEditor
-{
- /// <summary>
- /// Simple implementation of the buffer interface to support fast read-only documents.
- /// </summary>
- public class StringBuffer : IBuffer
- {
- string buffer;
-
- public StringBuffer (string buffer)
- {
- this.buffer = buffer;
- }
-
- #region IBuffer Members
- int IBuffer.TextLength {
- get { return buffer.Length; }
- }
-
- string IBuffer.Text {
- get { return buffer; }
- set { buffer = value; }
- }
-
- void IBuffer.Replace (int offset, int count, string value)
- {
- throw new NotSupportedException ("Operation not supported on this buffer.");
- }
-
- string IBuffer.GetTextAt (int offset, int count)
- {
- return buffer.Substring (offset, count);
- }
-
- char IBuffer.GetCharAt (int offset)
- {
- return buffer[offset];
- }
-
- int IBuffer.IndexOf (char c, int startIndex, int count)
- {
- return buffer.IndexOf (c, startIndex, count);
- }
-
- int IBuffer.IndexOfAny (char[] anyOf, int startIndex, int count)
- {
- return buffer.IndexOfAny (anyOf, startIndex, count);
- }
-
- public int IndexOf (string searchText, int startIndex, int count, StringComparison comparisonType)
- {
- return buffer.IndexOf (searchText, startIndex, count, comparisonType);
- }
-
- int IBuffer.LastIndexOf (char c, int startIndex, int count)
- {
- return buffer.LastIndexOf (c, startIndex, count);
- }
-
- public int LastIndexOf (string searchText, int startIndex, int count, StringComparison comparisonType)
- {
- return buffer.LastIndexOf (searchText, startIndex, count, comparisonType);
- }
- #endregion
- }
-}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs
index a60ae490f5..9b6f9cccee 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs
@@ -40,7 +40,7 @@ namespace Mono.TextEditor
{
public class TextDocument : ICSharpCode.NRefactory.AbstractAnnotatable, ICSharpCode.NRefactory.Editor.IDocument
{
- readonly IBuffer buffer;
+ ImmutableText buffer;
readonly ILineSplitter splitter;
ISyntaxMode syntaxMode = null;
@@ -61,11 +61,21 @@ namespace Mono.TextEditor
lock (this) {
mimeType = value;
SyntaxMode = SyntaxModeService.GetSyntaxMode (this, value);
+ OnMimeTypeChanged (EventArgs.Empty);
}
}
}
}
-
+
+ public event EventHandler MimeTypeChanged;
+
+ protected virtual void OnMimeTypeChanged (EventArgs e)
+ {
+ EventHandler handler = this.MimeTypeChanged;
+ if (handler != null)
+ handler (this, e);
+ }
+
string fileName;
public string FileName {
get {
@@ -91,6 +101,16 @@ namespace Mono.TextEditor
set;
}
+ public bool UseBom {
+ get;
+ set;
+ }
+
+ public System.Text.Encoding Encoding {
+ get;
+ set;
+ }
+
internal ILineSplitter Splitter {
get {
return splitter;
@@ -112,7 +132,7 @@ namespace Mono.TextEditor
}
}
- protected virtual void OnSyntaxModeChanged (Mono.TextEditor.SyntaxModeChangeEventArgs e)
+ protected virtual void OnSyntaxModeChanged (SyntaxModeChangeEventArgs e)
{
var handler = SyntaxModeChanged;
if (handler != null)
@@ -135,11 +155,10 @@ namespace Mono.TextEditor
}
}
- protected TextDocument (IBuffer buffer,ILineSplitter splitter)
+ protected TextDocument (ImmutableText buffer,ILineSplitter splitter)
{
this.buffer = buffer;
this.splitter = splitter;
- splitter.LineChanged += SplitterLineSegmentTreeLineChanged;
splitter.LineRemoved += HandleSplitterLineSegmentTreeLineRemoved;
foldSegmentTree.tree.NodeRemoved += HandleFoldSegmentTreetreeNodeRemoved;
textSegmentMarkerTree.InstallListener (this);
@@ -152,7 +171,7 @@ namespace Mono.TextEditor
foldedSegments.Remove (e.Node);
}
- public TextDocument () : this(new GapBuffer (), new LineSplitter ())
+ public TextDocument () : this(ImmutableText.Empty, new LineSplitter ())
{
}
@@ -163,41 +182,55 @@ namespace Mono.TextEditor
public static TextDocument CreateImmutableDocument (string text, bool suppressHighlighting = true)
{
- return new TextDocument (new StringBuffer (text), new PrimitiveLineSplitter ()) {
+ return new TextDocument (new ImmutableText (text), new PrimitiveLineSplitter ()) {
SuppressHighlightUpdate = suppressHighlighting,
Text = text,
ReadOnly = true
};
}
- void SplitterLineSegmentTreeLineChanged (object sender, LineEventArgs e)
- {
- if (LineChanged != null)
- LineChanged (this, e);
+ public event EventHandler<LineEventArgs> LineChanged {
+ add { splitter.LineChanged += value; }
+ remove { splitter.LineChanged -= value; }
}
-
- public event EventHandler<LineEventArgs> LineChanged;
- // public event EventHandler<LineEventArgs> LineInserted;
-
+
+ public event EventHandler<LineEventArgs> LineInserted {
+ add { splitter.LineInserted += value; }
+ remove { splitter.LineInserted -= value; }
+ }
+
+ public event EventHandler<LineEventArgs> LineRemoved {
+ add { splitter.LineRemoved += value; }
+ remove { splitter.LineRemoved -= value; }
+ }
+
#region Buffer implementation
+
public int TextLength {
get {
- return buffer.TextLength;
+ return buffer.Length;
}
}
public bool SuppressHighlightUpdate { get; set; }
internal DocumentLine longestLineAtTextSet;
+ WeakReference cachedText;
public string Text {
get {
- return buffer.Text;
+ string completeText = cachedText != null ? (cachedText.Target as string) : null;
+ if (completeText == null) {
+ completeText = buffer.ToString();
+ cachedText = new WeakReference(completeText);
+ }
+ return completeText;
}
set {
var args = new DocumentChangeEventArgs (0, Text, value);
textSegmentMarkerTree.Clear ();
OnTextReplacing (args);
- buffer.Text = value;
+ cachedText = null;
+ buffer = new ImmutableText (value);
extendingTextMarkers = new List<TextLineMarker> ();
splitter.Initalize (value, out longestLineAtTextSet);
ClearFoldSegments ();
@@ -232,18 +265,20 @@ namespace Mono.TextEditor
public void Replace (int offset, int count, string value, ICSharpCode.NRefactory.Editor.AnchorMovementType anchorMovementType = AnchorMovementType.Default)
{
if (offset < 0)
- throw new ArgumentOutOfRangeException ("offset", "must be > 0, was: " + offset);
+ throw new ArgumentOutOfRangeException (nameof (offset), "must be > 0, was: " + offset);
if (offset > TextLength)
- throw new ArgumentOutOfRangeException ("offset", "must be <= Length, was: " + offset);
+ throw new ArgumentOutOfRangeException (nameof (offset), "must be <= TextLength(" + TextLength +"), was: " + offset);
if (count < 0)
- throw new ArgumentOutOfRangeException ("count", "must be > 0, was: " + count);
-
+ throw new ArgumentOutOfRangeException (nameof (count), "must be > 0, was: " + count);
+ if (ReadOnly)
+ return;
InterruptFoldWorker ();
+
//int oldLineCount = LineCount;
var args = new DocumentChangeEventArgs (offset, count > 0 ? GetTextAt (offset, count) : "", value, anchorMovementType);
- OnTextReplacing (args);
- value = args.InsertedText.Text;
+
UndoOperation operation = null;
+ bool endUndo = false;
if (!isInUndo) {
operation = new UndoOperation (args);
if (currentAtomicOperation != null) {
@@ -251,16 +286,27 @@ namespace Mono.TextEditor
} else {
OnBeginUndo ();
undoStack.Push (operation);
- OnEndUndo (new UndoOperationEventArgs (operation));
+ endUndo = true;
}
redoStack.Clear ();
}
+
+ if (value != null)
+ EnsureSegmentIsUnfolded (offset, value.Length);
- buffer.Replace (offset, count, value);
+ OnTextReplacing (args);
+ value = args.InsertedText.Text;
+
+ cachedText = null;
+ buffer = buffer.RemoveText(offset, count);
+ if (!string.IsNullOrEmpty (value))
+ buffer = buffer.InsertText (offset, value);
foldSegmentTree.UpdateOnTextReplace (this, args);
splitter.TextReplaced (this, args);
versionProvider.AppendChange (args);
OnTextReplaced (args);
+ if (endUndo)
+ OnEndUndo (new UndoOperationEventArgs (operation));
}
public string GetTextBetween (int startOffset, int endOffset)
@@ -274,7 +320,7 @@ namespace Mono.TextEditor
if (endOffset > TextLength)
throw new ArgumentException ("endOffset > Length");
- return buffer.GetTextAt (startOffset, endOffset - startOffset);
+ return buffer.ToString (startOffset, endOffset - startOffset);
}
public string GetTextBetween (DocumentLocation start, DocumentLocation end)
@@ -297,7 +343,7 @@ namespace Mono.TextEditor
throw new ArgumentException ("count < 0");
if (offset + count > TextLength)
throw new ArgumentException ("offset + count is beyond EOF");
- return buffer.GetTextAt (offset, count);
+ return buffer.ToString (offset, count);
}
public string GetTextAt (DocumentRegion region)
@@ -333,21 +379,17 @@ namespace Mono.TextEditor
public char GetCharAt (int offset)
{
- if (offset < 0)
- throw new ArgumentException ("offset < 0");
- if (offset >= TextLength)
- throw new ArgumentException ("offset >= TextLength");
- return buffer.GetCharAt (offset);
+ return buffer [offset];
}
public char GetCharAt (DocumentLocation location)
{
- return buffer.GetCharAt (LocationToOffset (location));
+ return buffer [LocationToOffset (location)];
}
public char GetCharAt (int line, int column)
{
- return buffer.GetCharAt (LocationToOffset (line, column));
+ return buffer [LocationToOffset (line, column)];
}
/// <summary>
@@ -359,7 +401,7 @@ namespace Mono.TextEditor
/// <returns>The first index where the character was found; or -1 if no occurrence was found.</returns>
public int IndexOf (char c, int startIndex, int count)
{
- return buffer.IndexOf (c, startIndex, count);
+ return Text.IndexOf (c, startIndex, count);
}
/// <summary>
@@ -371,7 +413,7 @@ namespace Mono.TextEditor
/// <returns>The first index where any character was found; or -1 if no occurrence was found.</returns>
public int IndexOfAny (char[] anyOf, int startIndex, int count)
{
- return buffer.IndexOfAny (anyOf, startIndex, count);
+ return Text.IndexOfAny (anyOf, startIndex, count);
}
/// <summary>
@@ -384,7 +426,7 @@ namespace Mono.TextEditor
/// <returns>The first index where the search term was found; or -1 if no occurrence was found.</returns>
public int IndexOf (string searchText, int startIndex, int count, StringComparison comparisonType)
{
- return buffer.IndexOf (searchText, startIndex, count, comparisonType);
+ return Text.IndexOf (searchText, startIndex, count, comparisonType);
}
/// <summary>
@@ -398,7 +440,7 @@ namespace Mono.TextEditor
/// This is different than the meaning of the parameters on string.LastIndexOf!</remarks>
public int LastIndexOf (char c, int startIndex, int count)
{
- return buffer.LastIndexOf (c, startIndex, count);
+ return Text.LastIndexOf (c, startIndex, count);
}
/// <summary>
@@ -413,7 +455,7 @@ namespace Mono.TextEditor
/// This is different than the meaning of the parameters on string.LastIndexOf!</remarks>
public int LastIndexOf (string searchText, int startIndex, int count, StringComparison comparisonType)
{
- return buffer.LastIndexOf (searchText, startIndex, count, comparisonType);
+ return Text.LastIndexOf (searchText, startIndex, count, comparisonType);
}
protected virtual void OnTextReplaced (DocumentChangeEventArgs args)
@@ -619,24 +661,30 @@ namespace Mono.TextEditor
public override void Undo (TextDocument doc, bool fireEvent = true)
{
- doc.currentAtomicUndoOperationType.Push (operationType);
- for (int i = operations.Count - 1; i >= 0; i--) {
- operations [i].Undo (doc, false);
- doc.OnUndone (new UndoOperationEventArgs (operations[i]));
+ doc.BeginAtomicUndo (operationType);
+ try {
+ for (int i = operations.Count - 1; i >= 0; i--) {
+ operations [i].Undo (doc, false);
+ doc.OnUndone (new UndoOperationEventArgs (operations [i]));
+ }
+ } finally {
+ doc.EndAtomicUndo ();
}
- doc.currentAtomicUndoOperationType.Pop ();
if (fireEvent)
OnUndoDone ();
}
public override void Redo (TextDocument doc, bool fireEvent = true)
{
- doc.currentAtomicUndoOperationType.Push (operationType);
- foreach (UndoOperation operation in this.operations) {
- operation.Redo (doc, false);
- doc.OnRedone (new UndoOperationEventArgs (operation));
+ doc.BeginAtomicUndo (operationType);
+ try {
+ foreach (UndoOperation operation in this.operations) {
+ operation.Redo (doc, false);
+ doc.OnRedone (new UndoOperationEventArgs (operation));
+ }
+ } finally {
+ doc.EndAtomicUndo ();
}
- doc.currentAtomicUndoOperationType.Pop ();
if (fireEvent)
OnRedoDone ();
}
@@ -815,7 +863,6 @@ namespace Mono.TextEditor
operation.Undo (this);
isInUndo = false;
OnUndone (new UndoOperationEventArgs (operation));
- CommitDocumentUpdate ();
}
public void RollbackTo (ICSharpCode.NRefactory.Editor.ITextSourceVersion version)
@@ -862,7 +909,6 @@ namespace Mono.TextEditor
operation.Redo (this);
isInUndo = false;
OnRedone (new UndoOperationEventArgs (operation));
- CommitDocumentUpdate ();
}
internal protected virtual void OnRedone (UndoOperationEventArgs e)
@@ -923,11 +969,7 @@ namespace Mono.TextEditor
internal void BeginAtomicUndo (OperationType operationType = OperationType.Undefined)
{
currentAtomicUndoOperationType.Push (operationType);
- if (atomicUndoLevel == 0) {
- if (this.syntaxMode != null && !SuppressHighlightUpdate)
- Mono.TextEditor.Highlighting.SyntaxModeService.WaitUpdate (this);
- }
- if (currentAtomicOperation == null) {
+ if (currentAtomicOperation == null) {
Debug.Assert (atomicUndoLevel == 0);
currentAtomicOperation = new AtomicUndoOperation (operationType);
OnBeginUndo ();
@@ -1108,8 +1150,10 @@ namespace Mono.TextEditor
} else {
DocumentLine startLine = splitter.GetLineByOffset (offset);
DocumentLine endLine = splitter.GetLineByOffset (newFoldSegment.EndOffset);
- newFoldSegment.EndColumn = newFoldSegment.EndOffset - endLine.Offset + 1;
- newFoldSegment.Column = offset - startLine.Offset + 1;
+ if (endLine != null)
+ newFoldSegment.EndColumn = newFoldSegment.EndOffset - endLine.Offset + 1;
+ if (startLine != null)
+ newFoldSegment.Column = offset - startLine.Offset + 1;
newFoldSegment.isAttached = true;
foldedSegmentAdded |= newFoldSegment.IsFolded;
if (oldIndex < oldSegments.Count && newFoldSegment.Length == oldSegments [oldIndex].Length) {
@@ -1136,7 +1180,13 @@ namespace Mono.TextEditor
public void WaitForFoldUpdateFinished ()
{
if (foldSegmentTask != null) {
- foldSegmentTask.Wait (5000);
+ try {
+ foldSegmentTask.Wait (5000);
+ } catch (AggregateException e) {
+ e.Flatten ().Handle (x => x is OperationCanceledException);
+ } catch (OperationCanceledException) {
+
+ }
foldSegmentTask = null;
}
}
@@ -1178,6 +1228,11 @@ namespace Mono.TextEditor
return foldSegmentTree.GetSegmentsOverlapping (line.Offset, line.Length).Cast<FoldSegment> ();
}
+ public IEnumerable<FoldSegment> GetFoldingContaining (int offset, int length)
+ {
+ return foldSegmentTree.GetSegmentsOverlapping (offset, length).Cast<FoldSegment> ();
+ }
+
public IEnumerable<FoldSegment> GetStartFoldings (int lineNumber)
{
return GetStartFoldings (this.GetLine (lineNumber));
@@ -1190,6 +1245,11 @@ namespace Mono.TextEditor
return GetFoldingContaining (line).Where (fold => fold.StartLine == line);
}
+ public IEnumerable<FoldSegment> GetStartFoldings (int offset, int length)
+ {
+ return GetFoldingContaining (offset, length).Where (fold => offset <= fold.StartLine.Offset && fold.StartLine.Offset < offset + length);
+ }
+
public IEnumerable<FoldSegment> GetEndFoldings (int lineNumber)
{
return GetStartFoldings (this.GetLine (lineNumber));
@@ -1202,7 +1262,12 @@ namespace Mono.TextEditor
yield return segment;
}
}
-
+
+ public IEnumerable<FoldSegment> GetEndFoldings (int offset, int length)
+ {
+ return GetFoldingContaining (offset, length).Where (fold => offset <= fold.EndLine.Offset && fold.EndLine.Offset < offset + length);
+ }
+
public int GetLineCount (FoldSegment segment)
{
return segment.EndLine.LineNumber - segment.StartLine.LineNumber;
@@ -1220,7 +1285,20 @@ namespace Mono.TextEditor
CommitDocumentUpdate ();
}
}
-
+
+ public void EnsureSegmentIsUnfolded (int offset, int length)
+ {
+ bool needUpdate = false;
+ foreach (var fold in GetFoldingContaining (offset, length).Where (f => f.IsFolded)) {
+ needUpdate = true;
+ fold.IsFolded = false;
+ }
+ if (needUpdate) {
+ RequestUpdate (new UpdateAll ());
+ CommitDocumentUpdate ();
+ }
+ }
+
internal void InformFoldTreeUpdated ()
{
var handler = FoldTreeUpdated;
@@ -1286,7 +1364,7 @@ namespace Mono.TextEditor
AddMarker (line, marker, true);
}
- public void AddMarker (DocumentLine line, TextLineMarker marker, bool commitUpdate)
+ public void AddMarker (DocumentLine line, TextLineMarker marker, bool commitUpdate, int idx = -1)
{
if (line == null || marker == null)
return;
@@ -1297,7 +1375,7 @@ namespace Mono.TextEditor
extendingTextMarkers.Sort (CompareMarkers);
}
}
- line.AddMarker (marker);
+ line.AddMarker (marker, idx);
OnMarkerAdded (new TextMarkerEvent (line, marker));
if (commitUpdate)
this.CommitLineUpdate (line);
@@ -1369,7 +1447,13 @@ namespace Mono.TextEditor
#region Text segment markers
- SegmentTree<TextSegmentMarker> textSegmentMarkerTree = new SegmentTree<TextSegmentMarker> ();
+ int textSegmentInsertId = 0;
+ SegmentTree<TextSegmentMarker> textSegmentMarkerTree = new SegmentTree<TextSegmentMarker> ();
+
+ public static IEnumerable<TextSegmentMarker> OrderTextSegmentMarkersByInsertion (IEnumerable<TextSegmentMarker> enumerable)
+ {
+ return enumerable.OrderBy (m => m.insertId);
+ }
public IEnumerable<TextSegmentMarker> GetTextSegmentMarkersAt (DocumentLine line)
{
@@ -1389,6 +1473,7 @@ namespace Mono.TextEditor
public void AddMarker (TextSegmentMarker marker)
{
+ marker.insertId = textSegmentInsertId++;
textSegmentMarkerTree.Add (marker);
var startLine = OffsetToLineNumber (marker.Offset);
var endLine = OffsetToLineNumber (marker.EndOffset);
@@ -1658,12 +1743,14 @@ namespace Mono.TextEditor
#region Diff
+
+
int[] GetDiffCodes (ref int codeCounter, Dictionary<string, int> codeDictionary, bool includeEol)
{
int i = 0;
var result = new int[LineCount];
foreach (DocumentLine line in Lines) {
- string lineText = buffer.GetTextAt (line.Offset, includeEol ? line.LengthIncludingDelimiter : line.Length);
+ string lineText = buffer.ToString (line.Offset, includeEol ? line.LengthIncludingDelimiter : line.Length);
int curCode;
if (!codeDictionary.TryGetValue (lineText, out curCode)) {
codeDictionary[lineText] = curCode = ++codeCounter;
@@ -1856,12 +1943,12 @@ namespace Mono.TextEditor
public System.IO.TextReader CreateReader ()
{
- return new BufferedTextReader (buffer);
+ return new ImmutableTextTextReader (buffer);
}
public System.IO.TextReader CreateReader (int offset, int length)
{
- throw new NotImplementedException ();
+ return new ImmutableTextTextReader(buffer.GetText(offset, length));
}
string ICSharpCode.NRefactory.Editor.ITextSource.GetText (int offset, int length)
@@ -1895,26 +1982,43 @@ namespace Mono.TextEditor
}
}
- public SnapshotDocument (string text, ITextSourceVersion version) : base (new StringBuffer (text), new PrimitiveLineSplitter ())
+ public SnapshotDocument (TextDocument doc) : base (doc.buffer, new LazyLineSplitter (doc.LineCount))
{
- this.version = version;
- Text = text;
+ this.version = doc.Version;
+ ((LazyLineSplitter)splitter).src = this;
+ fileName = doc.fileName;
+ Encoding = doc.Encoding;
+ UseBom = doc.UseBom;
+ mimeType = doc.mimeType;
+
ReadOnly = true;
}
}
public TextDocument CreateDocumentSnapshot ()
{
- return new SnapshotDocument (Text, Version);
+ return new SnapshotDocument (this);
}
- ICSharpCode.NRefactory.Editor.IDocument ICSharpCode.NRefactory.Editor.IDocument.CreateDocumentSnapshot ()
+ public ImmutableText GetImmutableText ()
{
- return new SnapshotDocument (Text, Version);
+ return buffer;
}
+ public ImmutableText GetImmutableText (int offset, int count)
+ {
+ return buffer.GetText (offset, count);
+ }
+ ICSharpCode.NRefactory.Editor.IDocument ICSharpCode.NRefactory.Editor.IDocument.CreateDocumentSnapshot ()
+ {
+ return new SnapshotDocument (this);
+ }
+ public void CopyTo (int sourceIndex, char [] destination, int destinationIndex, int count)
+ {
+ buffer.CopyTo (sourceIndex, destination, destinationIndex, count);
+ }
#endregion
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/EditMode.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/EditMode.cs
index a6f2acded4..3385275a32 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/EditMode.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/EditMode.cs
@@ -37,10 +37,10 @@ namespace Mono.TextEditor
//NOTE: the behaviour of this class is actually stateless; these variables are used to make the API
// friendlier for subclassers of this class
protected TextEditorData textEditorData;
- protected TextEditor editor;
+ protected MonoTextEditor editor;
// string status;
- public void InternalHandleKeypress (TextEditor editor, TextEditorData data, Gdk.Key key,
+ public void InternalHandleKeypress (MonoTextEditor editor, TextEditorData data, Gdk.Key key,
uint unicodeChar, Gdk.ModifierType modifier)
{
this.editor = editor;
@@ -53,7 +53,7 @@ namespace Mono.TextEditor
this.editor = null;
}
- internal virtual void InternalSelectionChanged (TextEditor editor, TextEditorData data)
+ internal virtual void InternalSelectionChanged (MonoTextEditor editor, TextEditorData data)
{
// only trigger SelectionChanged when event is a result of external stimuli, i.e. when
// not already running HandleKeypress
@@ -66,7 +66,7 @@ namespace Mono.TextEditor
}
}
- internal void InternalCaretPositionChanged (TextEditor editor, TextEditorData data)
+ internal void InternalCaretPositionChanged (MonoTextEditor editor, TextEditorData data)
{
// only trigger CaretPositionChanged when event is a result of external stimuli, i.e. when
// not already running HandleKeypress
@@ -95,7 +95,7 @@ namespace Mono.TextEditor
protected Caret Caret { get { return textEditorData.Caret; } }
protected TextDocument Document { get { return textEditorData.Document; } }
- protected TextEditor Editor { get { return editor; } }
+ protected MonoTextEditor Editor { get { return editor; } }
protected TextEditorData Data { get { return textEditorData; } }
protected abstract void HandleKeypress (Gdk.Key key, uint unicodeKey, Gdk.ModifierType modifier);
@@ -117,11 +117,11 @@ namespace Mono.TextEditor
HideMouseCursor ();
+ if (textEditorData.IsSomethingSelected && textEditorData.Options.EnableSelectionWrappingKeys && IsSpecialKeyForSelection (unicodeKey)) {
+ textEditorData.SelectionSurroundingProvider.HandleSpecialSelectionKey (textEditorData, unicodeKey);
+ return;
+ }
using (var undo = Document.OpenUndoGroup ()) {
- if (textEditorData.IsSomethingSelected && textEditorData.Options.EnableSelectionWrappingKeys && IsSpecialKeyForSelection (unicodeKey)) {
- textEditorData.SelectionSurroundingProvider.HandleSpecialSelectionKey (textEditorData, unicodeKey);
- return;
- }
textEditorData.DeleteSelectedText (
textEditorData.IsSomethingSelected ? textEditorData.MainSelection.SelectionMode != SelectionMode.Block : true);
@@ -266,7 +266,7 @@ namespace Mono.TextEditor
}
#region TextAreaControl
- public virtual void AllocateTextArea (TextEditor textEditor, TextArea textArea, Rectangle allocation)
+ public virtual void AllocateTextArea (MonoTextEditor textEditor, TextArea textArea, Rectangle allocation)
{
if (textArea.Allocation != allocation)
textArea.SizeAllocate (allocation);
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/ActionMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/ActionMargin.cs
index ba069dfc6e..6c8678d746 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/ActionMargin.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/ActionMargin.cs
@@ -30,7 +30,7 @@ namespace Mono.TextEditor
{
public class ActionMargin : Margin
{
- readonly TextEditor editor;
+ readonly MonoTextEditor editor;
double marginWidth;
public override double Width {
@@ -39,7 +39,7 @@ namespace Mono.TextEditor
}
}
- public ActionMargin (TextEditor editor)
+ public ActionMargin (MonoTextEditor editor)
{
if (editor == null)
throw new ArgumentNullException ("editor");
@@ -49,6 +49,12 @@ namespace Mono.TextEditor
this.editor.Caret.PositionChanged += HandlePositionChanged;;
}
+ public override void Dispose ()
+ {
+ editor.Caret.PositionChanged -= HandlePositionChanged;;
+ base.Dispose ();
+ }
+
void HandlePositionChanged (object sender, DocumentLocationEventArgs e)
{
if (e.Location.Line == editor.Caret.Line)
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/CodeSegmentEditorWindow.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/CodeSegmentEditorWindow.cs
index b461bc6b7a..47d7f7916a 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/CodeSegmentEditorWindow.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/CodeSegmentEditorWindow.cs
@@ -29,7 +29,7 @@ namespace Mono.TextEditor
{
public class CodeSegmentEditorWindow : Gtk.Window
{
- TextEditor codeSegmentEditor = new TextEditor ();
+ MonoTextEditor codeSegmentEditor = new MonoTextEditor ();
public ISyntaxMode SyntaxMode {
get {
@@ -49,15 +49,15 @@ namespace Mono.TextEditor
}
}
- public CodeSegmentEditorWindow (TextEditor editor) : base (Gtk.WindowType.Toplevel)
+ public CodeSegmentEditorWindow (MonoTextEditor editor) : base (Gtk.WindowType.Toplevel)
{
Gtk.ScrolledWindow scrolledWindow = new Gtk.ScrolledWindow ();
scrolledWindow.Child = codeSegmentEditor;
scrolledWindow.ShadowType = Gtk.ShadowType.In;
Child = scrolledWindow;
codeSegmentEditor.Realize ();
- ((SimpleEditMode)codeSegmentEditor.CurrentMode).AddBinding (Gdk.Key.Escape, Close);
- TextEditorOptions options = new TextEditorOptions ();
+ ((SimpleEditMode)codeSegmentEditor.CurrentMode).AddBinding (Gdk.Key.Escape, Close, true);
+ TextEditorOptions options = new TextEditorOptions (true);
options.FontName = editor.Options.FontName;
options.ColorScheme = editor.Options.ColorScheme;
options.ShowRuler = false;
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs
index 29a546cb20..8124b6b71a 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/CodeSegmentPreviewWindow.cs
@@ -38,8 +38,8 @@ namespace Mono.TextEditor
{
const int DefaultPreviewWindowWidth = 320;
const int DefaultPreviewWindowHeight = 200;
- TextEditor editor;
- Pango.FontDescription fontDescription;
+ MonoTextEditor editor;
+ Pango.FontDescription fontDescription, fontInform;
Pango.Layout layout;
Pango.Layout informLayout;
@@ -64,11 +64,11 @@ namespace Mono.TextEditor
}
}
- public CodeSegmentPreviewWindow (TextEditor editor, bool hideCodeSegmentPreviewInformString, TextSegment segment, bool removeIndent = true) : this(editor, hideCodeSegmentPreviewInformString, segment, DefaultPreviewWindowWidth, DefaultPreviewWindowHeight, removeIndent)
+ public CodeSegmentPreviewWindow (MonoTextEditor editor, bool hideCodeSegmentPreviewInformString, TextSegment segment, bool removeIndent = true) : this(editor, hideCodeSegmentPreviewInformString, segment, DefaultPreviewWindowWidth, DefaultPreviewWindowHeight, removeIndent)
{
}
- public CodeSegmentPreviewWindow (TextEditor editor, bool hideCodeSegmentPreviewInformString, TextSegment segment, int width, int height, bool removeIndent = true) : base (Gtk.WindowType.Popup)
+ public CodeSegmentPreviewWindow (MonoTextEditor editor, bool hideCodeSegmentPreviewInformString, TextSegment segment, int width, int height, bool removeIndent = true) : base (Gtk.WindowType.Popup)
{
this.HideCodeSegmentPreviewInformString = hideCodeSegmentPreviewInformString;
this.Segment = segment;
@@ -78,6 +78,9 @@ namespace Mono.TextEditor
this.TypeHint = WindowTypeHint.Menu;
layout = PangoUtil.CreateLayout (this);
informLayout = PangoUtil.CreateLayout (this);
+ fontInform = Pango.FontDescription.FromString (editor.Options.FontName);
+ fontInform.Size = (int)(fontInform.Size * 0.7f);
+ informLayout.FontDescription = fontInform;
informLayout.SetText (CodeSegmentPreviewInformString);
fontDescription = Pango.FontDescription.FromString (editor.Options.FontName);
@@ -122,8 +125,8 @@ namespace Mono.TextEditor
h += h2;
}
Gdk.Rectangle geometry = Screen.GetUsableMonitorGeometry (Screen.GetMonitorAtWindow (editor.GdkWindow));
- this.SetSizeRequest (System.Math.Max (1, System.Math.Min (w + 3, geometry.Width * 2 / 5)),
- System.Math.Max (1, System.Math.Min (h + 3, geometry.Height * 2 / 5)));
+ this.SetSizeRequest (System.Math.Max (1, System.Math.Min (w + 3, geometry.Width * 2 / 5) + 5),
+ System.Math.Max (1, System.Math.Min (h + 3, geometry.Height * 2 / 5)) + 5);
}
protected override void OnDestroyed ()
@@ -131,6 +134,7 @@ namespace Mono.TextEditor
layout = layout.Kill ();
informLayout = informLayout.Kill ();
fontDescription = fontDescription.Kill ();
+ fontInform = fontInform.Kill ();
if (textGC != null) {
textGC.Dispose ();
textBgGC.Dispose ();
@@ -138,6 +142,7 @@ namespace Mono.TextEditor
foldBgGC.Dispose ();
textGC = textBgGC = foldGC = foldBgGC = null;
}
+ editor = null;
base.OnDestroyed ();
}
@@ -159,7 +164,7 @@ namespace Mono.TextEditor
}
ev.Window.DrawRectangle (textBgGC, true, ev.Area);
- ev.Window.DrawLayout (textGC, 1, 1, layout);
+ ev.Window.DrawLayout (textGC, 5, 4, layout);
ev.Window.DrawRectangle (textBgGC, false, 1, 1, this.Allocation.Width - 3, this.Allocation.Height - 3);
ev.Window.DrawRectangle (foldGC, false, 0, 0, this.Allocation.Width - 1, this.Allocation.Height - 1);
@@ -169,7 +174,7 @@ namespace Mono.TextEditor
informLayout.GetPixelSize (out w, out h);
PreviewInformStringHeight = h;
ev.Window.DrawRectangle (foldBgGC, true, Allocation.Width - w - 3, Allocation.Height - h, w + 2, h - 1);
- ev.Window.DrawLayout (foldGC, Allocation.Width - w - 3, Allocation.Height - h, informLayout);
+ ev.Window.DrawLayout (foldGC, Allocation.Width - w - 4, Allocation.Height - h - 3, informLayout);
}
return true;
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/DashedLineMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/DashedLineMargin.cs
index 154111bc09..db52b966d9 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/DashedLineMargin.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/DashedLineMargin.cs
@@ -30,7 +30,7 @@ namespace Mono.TextEditor
{
public class DashedLineMargin : Margin
{
- TextEditor editor;
+ MonoTextEditor editor;
Cairo.Color color;
public override double Width {
@@ -39,7 +39,7 @@ namespace Mono.TextEditor
}
}
- public DashedLineMargin (TextEditor editor)
+ public DashedLineMargin (MonoTextEditor editor)
{
this.editor = editor;
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldMarkerMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldMarkerMargin.cs
index 7a87bfe63a..c8c2f0bd93 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldMarkerMargin.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldMarkerMargin.cs
@@ -35,7 +35,7 @@ namespace Mono.TextEditor
{
public class FoldMarkerMargin : Margin
{
- TextEditor editor;
+ MonoTextEditor editor;
DocumentLine lineHover;
Pango.Layout layout;
@@ -63,13 +63,13 @@ namespace Mono.TextEditor
}
}
- public FoldMarkerMargin (TextEditor editor)
+ public FoldMarkerMargin (MonoTextEditor editor)
{
this.editor = editor;
layout = PangoUtil.CreateLayout (editor);
editor.Caret.PositionChanged += HandleEditorCaretPositionChanged;
editor.Document.FoldTreeUpdated += HandleEditorDocumentFoldTreeUpdated;
- this.editor.Caret.PositionChanged += EditorCarethandlePositionChanged;
+ editor.Caret.PositionChanged += EditorCarethandlePositionChanged;
}
void EditorCarethandlePositionChanged (object sender, DocumentLocationEventArgs e)
@@ -125,8 +125,9 @@ namespace Mono.TextEditor
internal protected override void MousePressed (MarginMouseEventArgs args)
{
base.MousePressed (args);
- if (args.LineSegment == null)
+ if (args.LineSegment == null || !editor.Options.ShowFoldMargin)
return;
+
foreach (FoldSegment segment in editor.Document.GetStartFoldings (args.LineSegment)) {
segment.IsFolded = !segment.IsFolded;
}
@@ -137,7 +138,9 @@ namespace Mono.TextEditor
internal protected override void MouseHover (MarginMouseEventArgs args)
{
base.MouseHover (args);
-
+ if (!editor.Options.ShowFoldMargin)
+ return;
+
DocumentLine lineSegment = null;
if (args.LineSegment != null) {
lineSegment = args.LineSegment;
@@ -246,7 +249,7 @@ namespace Mono.TextEditor
lineStateChangedGC = editor.ColorStyle.QuickDiffChanged.Color;
lineStateDirtyGC = editor.ColorStyle.QuickDiffDirty.Color;
- marginWidth = editor.LineHeight;
+ marginWidth = editor.LineHeight * 3 / 4;
}
Cairo.Color foldBgGC, foldLineGC, foldLineHighlightedGC, foldLineHighlightedGCBg, foldToggleMarkerGC, foldToggleMarkerBackground;
@@ -256,6 +259,8 @@ namespace Mono.TextEditor
{
base.Dispose ();
StopTimer ();
+ editor.Caret.PositionChanged -= HandleEditorCaretPositionChanged;
+ editor.Caret.PositionChanged -= EditorCarethandlePositionChanged;
editor.Document.FoldTreeUpdated -= HandleEditorDocumentFoldTreeUpdated;
layout = layout.Kill ();
foldings = null;
@@ -309,7 +314,7 @@ namespace Mono.TextEditor
Cairo.Rectangle drawArea = new Cairo.Rectangle (x, y, marginWidth, lineHeight);
var state = editor.Document.GetLineState (lineSegment);
-
+
bool isFoldStart = false;
bool isContaining = false;
bool isFoldEnd = false;
@@ -360,16 +365,32 @@ namespace Mono.TextEditor
}
}
- if (editor.Options.EnableQuickDiff) {
+ if (editor.Options.EnableQuickDiff && state != TextDocument.LineState.Unchanged) {
+ var prevState = lineSegment?.PreviousLine != null ? editor.Document.GetLineState (lineSegment.PreviousLine) : TextDocument.LineState.Unchanged;
+ var nextState = lineSegment?.NextLine != null ? editor.Document.GetLineState (lineSegment.NextLine) : TextDocument.LineState.Unchanged;
+
if (state == TextDocument.LineState.Changed) {
cr.SetSourceColor (lineStateChangedGC);
- cr.Rectangle (x + 1, y, marginWidth / 3, lineHeight);
- cr.Fill ();
} else if (state == TextDocument.LineState.Dirty) {
cr.SetSourceColor (lineStateDirtyGC);
- cr.Rectangle (x + 1, y, marginWidth / 3, lineHeight);
- cr.Fill ();
}
+
+ if ((prevState == TextDocument.LineState.Unchanged && prevState != state ||
+ nextState == TextDocument.LineState.Unchanged && nextState != state)) {
+ FoldingScreenbackgroundRenderer.DrawRoundRectangle (
+ cr,
+ prevState == TextDocument.LineState.Unchanged,
+ nextState == TextDocument.LineState.Unchanged,
+ x + 1,
+ y,
+ lineHeight / 4,
+ marginWidth / 4,
+ lineHeight
+ );
+ } else {
+ cr.Rectangle (x + 1, y, marginWidth / 4, lineHeight);
+ }
+ cr.Fill ();
}
if (editor.Options.ShowFoldMargin && line <= editor.Document.LineCount) {
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldingScreenbackgroundRenderer.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldingScreenbackgroundRenderer.cs
index 6c392f8ae7..c1803dbdaf 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldingScreenbackgroundRenderer.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/FoldingScreenbackgroundRenderer.cs
@@ -31,7 +31,7 @@ namespace Mono.TextEditor
{
public class FoldingScreenbackgroundRenderer : IBackgroundRenderer, IDisposable
{
- TextEditor editor;
+ MonoTextEditor editor;
List<FoldSegment> foldSegments;
[Flags]
enum Roles
@@ -54,7 +54,7 @@ namespace Mono.TextEditor
}
}
- public FoldingScreenbackgroundRenderer (TextEditor editor, IEnumerable<FoldSegment> foldSegments)
+ public FoldingScreenbackgroundRenderer (MonoTextEditor editor, IEnumerable<FoldSegment> foldSegments)
{
this.editor = editor;
this.foldSegments = new List<FoldSegment> (foldSegments);
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs
index 43bfd4e04b..c9cfe5fc9d 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs
@@ -34,7 +34,7 @@ using Gtk;
namespace Mono.TextEditor
{
- public static class GtkWorkarounds
+ static class GtkWorkarounds
{
const string LIBOBJC ="/usr/lib/libobjc.dylib";
const string USER32DLL = "User32.dll";
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GutterMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GutterMargin.cs
index 1428c3fc0c..2d69642e90 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GutterMargin.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GutterMargin.cs
@@ -34,13 +34,11 @@ namespace Mono.TextEditor
{
public class GutterMargin : Margin
{
- TextEditor editor;
+ MonoTextEditor editor;
int width;
int oldLineCountLog10 = -1;
- double fontHeight;
-
- public GutterMargin (TextEditor editor)
+ public GutterMargin (MonoTextEditor editor)
{
this.editor = editor;
@@ -80,11 +78,6 @@ namespace Mono.TextEditor
this.width += 4;
if (!editor.Options.ShowFoldMargin)
this.width += 2;
-
- using (var metrics = editor.PangoContext.GetMetrics (layout.FontDescription, editor.PangoContext.Language)) {
- fontHeight = System.Math.Ceiling (0.5 + (metrics.Ascent + metrics.Descent) / Pango.Scale.PangoScale);
- }
-
}
}
@@ -183,6 +176,7 @@ namespace Mono.TextEditor
base.cursor.Dispose ();
base.cursor = null;
+ this.editor.Caret.PositionChanged -= EditorCarethandlePositionChanged;
this.editor.Document.TextSet -= HandleEditorDocumenthandleTextSet;
this.editor.Document.LineChanged -= UpdateWidth;
// layout = layout.Kill ();
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/HslColor.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/HslColor.cs
index 6f7f446845..f8e525f939 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/HslColor.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/HslColor.cs
@@ -30,7 +30,7 @@ using System.Collections.Generic;
namespace Mono.TextEditor
{
- public struct HslColor
+ struct HslColor
{
public double H {
get;
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/ITooltipProvider.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/ITooltipProvider.cs
index cd0cb8d027..6cdc53eccb 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/ITooltipProvider.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/ITooltipProvider.cs
@@ -50,5 +50,15 @@ namespace Mono.TextEditor
this.ItemSegment = new TextSegment (offset, length);
this.Item = item;
}
+
+ public override bool Equals (object obj)
+ {
+ return ItemSegment.Equals (((TooltipItem)obj).ItemSegment);
+ }
+
+ public override int GetHashCode ()
+ {
+ return ItemSegment.GetHashCode ();
+ }
}
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/IconMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/IconMargin.cs
index 89f264056d..f3ab923632 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/IconMargin.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/IconMargin.cs
@@ -33,11 +33,11 @@ namespace Mono.TextEditor
{
public class IconMargin : Margin
{
- TextEditor editor;
+ MonoTextEditor editor;
Cairo.Color backgroundColor, separatorColor;
const int marginWidth = 22;
- public IconMargin (TextEditor editor)
+ public IconMargin (MonoTextEditor editor)
{
this.editor = editor;
}
@@ -136,7 +136,7 @@ namespace Mono.TextEditor
public class BookmarkMarginDrawEventArgs : EventArgs
{
- public TextEditor Editor {
+ public MonoTextEditor Editor {
get;
private set;
}
@@ -166,7 +166,7 @@ namespace Mono.TextEditor
private set;
}
- public BookmarkMarginDrawEventArgs (TextEditor editor, Cairo.Context context, DocumentLine line, int lineNumber, double xPos, double yPos)
+ public BookmarkMarginDrawEventArgs (MonoTextEditor editor, Cairo.Context context, DocumentLine line, int lineNumber, double xPos, double yPos)
{
this.Editor = editor;
this.Context = context;
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/LayoutCache.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/LayoutCache.cs
index ab99a0fa95..aa7127d6dd 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/LayoutCache.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/LayoutCache.cs
@@ -33,10 +33,10 @@ namespace Mono.TextEditor
/// </summary>
public class LayoutCache : IDisposable
{
- readonly Gtk.Widget widget;
+ readonly MonoTextEditor widget;
readonly Queue<LayoutProxy> layoutQueue = new Queue<LayoutProxy> ();
- public LayoutCache (Gtk.Widget widget)
+ public LayoutCache (MonoTextEditor widget)
{
if (widget == null)
throw new ArgumentNullException ("widget");
@@ -65,6 +65,7 @@ namespace Mono.TextEditor
{
readonly LayoutCache layoutCache;
readonly Pango.Layout layout;
+ int width = -1, height = -1, lineCount = -1;
public LayoutProxy (LayoutCache layoutCache, Pango.Layout layout)
{
@@ -134,11 +135,12 @@ namespace Mono.TextEditor
}
public int LineCount {
- get { return layout.LineCount; }
+ get { return lineCount < 0 ? lineCount = layout.LineCount : lineCount; }
}
public void SetText (string text)
{
+ this.width = this.height = lineCount = -1;
layout.SetText (text);
}
@@ -159,7 +161,14 @@ namespace Mono.TextEditor
public void GetSize (out int width, out int height)
{
- layout.GetSize (out width, out height);
+ if (this.width >= 0) {
+ width = this.width;
+ height = this.height;
+ return;
+ }
+ layout.GetSize (out width, out height);
+ this.width = width;
+ this.height = height;
}
public bool XyToIndex (int x, int y, out int index, out int trailing)
@@ -174,11 +183,29 @@ namespace Mono.TextEditor
public void GetPixelSize (out int width, out int height)
{
- layout.GetPixelSize (out width, out height);
+ if (this.width >= 0) {
+ width = (int)(this.width / Pango.Scale.PangoScale);
+ height = (int)(this.height / Pango.Scale.PangoScale);
+ return;
+ }
+
+ layout.GetPixelSize (out width, out height);
+ this.width = (int)(width * Pango.Scale.PangoScale);
+ this.height = (int)(height * Pango.Scale.PangoScale);
}
public void GetExtents (out Pango.Rectangle ink_rect, out Pango.Rectangle logical_rect)
{
+ if (this.width >= 0) {
+ ink_rect = logical_rect = new Pango.Rectangle {
+ X = 0,
+ Y = 0,
+ Width = width,
+ Height = height
+ };
+ return;
+ }
+
layout.GetExtents (out ink_rect, out logical_rect);
}
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/Margin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/Margin.cs
index 9a132f34ee..fdd570e2c3 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/Margin.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/Margin.cs
@@ -182,18 +182,18 @@ namespace Mono.TextEditor
}
}
- public TextEditor Editor {
+ public MonoTextEditor Editor {
get;
private set;
}
- public MarginMouseEventArgs (TextEditor editor, Gdk.Event raw, uint button, double x, double y, Gdk.ModifierType modifierState)
+ public MarginMouseEventArgs (MonoTextEditor editor, Gdk.Event raw, uint button, double x, double y, Gdk.ModifierType modifierState)
: this (editor, raw.Type, button, x, y, modifierState)
{
this.RawEvent = raw;
}
- public MarginMouseEventArgs (TextEditor editor, Gdk.EventType type, uint button, double x, double y, Gdk.ModifierType modifierState)
+ public MarginMouseEventArgs (MonoTextEditor editor, Gdk.EventType type, uint button, double x, double y, Gdk.ModifierType modifierState)
{
this.Editor = editor;
this.Type = type;
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/MonoTextEditor.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/MonoTextEditor.cs
new file mode 100644
index 0000000000..381d056ea7
--- /dev/null
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/MonoTextEditor.cs
@@ -0,0 +1,1284 @@
+//
+// TextEditor.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using System.Diagnostics;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading;
+using Mono.TextEditor.Highlighting;
+using Mono.TextEditor.PopupWindow;
+using Mono.TextEditor.Theatrics;
+
+using Gdk;
+using Gtk;
+
+namespace Mono.TextEditor
+{
+ [System.ComponentModel.Category("Mono.TextEditor")]
+ [System.ComponentModel.ToolboxItem(true)]
+ public class MonoTextEditor : Container
+ {
+ readonly TextArea textArea;
+
+ internal LayoutCache LayoutCache {
+ get;
+ private set;
+ }
+
+ internal bool IsInKeypress {
+ get { return textArea.IsInKeypress; }
+ }
+
+ public TextArea TextArea {
+ get {
+ return textArea;
+ }
+ }
+
+ public MonoTextEditor () : this(new TextDocument ())
+ {
+ }
+
+ public MonoTextEditor (TextDocument doc)
+ : this (doc, null)
+ {
+ }
+
+ public MonoTextEditor (TextDocument doc, ITextEditorOptions options)
+ : this (doc, options, new SimpleEditMode ())
+ {
+ }
+ Thread uiThread;
+
+ public MonoTextEditor (TextDocument doc, ITextEditorOptions options, EditMode initialMode)
+ {
+ uiThread = Thread.CurrentThread;
+ GtkWorkarounds.FixContainerLeak (this);
+ WidgetFlags |= WidgetFlags.NoWindow;
+ LayoutCache = new LayoutCache (this);
+ this.textArea = new TextArea (doc, options, initialMode);
+ this.textArea.Initialize (this, doc, options, initialMode);
+ this.textArea.EditorOptionsChanged += (sender, e) => OptionsChanged (sender, e);
+ AddTopLevelWidget (textArea, 0, 0);
+ ShowAll ();
+
+ stage.ActorStep += OnActorStep;
+ if (Platform.IsMac) {
+ VScroll += delegate {
+ for (int i = 1; i < containerChildren.Count; i++) {
+ containerChildren[i].Child.QueueDraw ();
+ }
+ };
+ HScroll += delegate {
+ for (int i = 1; i < containerChildren.Count; i++) {
+ containerChildren[i].Child.QueueDraw ();
+ }
+ };
+ }
+ }
+
+ internal bool IsUIThread { get { return Thread.CurrentThread != uiThread; } }
+
+ internal void CheckUIThread ()
+ {
+ if (Thread.CurrentThread != uiThread)
+ throw new InvalidOperationException ("Not executed on UI thread.");
+ }
+
+ public new void GrabFocus ()
+ {
+ TextArea.GrabFocus ();
+ }
+
+ protected override void OnDestroyed ()
+ {
+ base.OnDestroyed ();
+ UnregisterAdjustments ();
+ LayoutCache.Dispose ();
+ }
+
+ void UnregisterAdjustments ()
+ {
+ if (vAdjustement != null)
+ vAdjustement.ValueChanged -= HandleAdjustmentValueChange;
+ if (hAdjustement != null)
+ hAdjustement.ValueChanged -= HandleAdjustmentValueChange;
+ vAdjustement = null;
+ hAdjustement = null;
+ }
+
+ Adjustment hAdjustement;
+ Adjustment vAdjustement;
+ protected override void OnSetScrollAdjustments (Adjustment hAdjustement, Adjustment vAdjustement)
+ {
+ UnregisterAdjustments ();
+ this.vAdjustement = vAdjustement;
+ this.hAdjustement = hAdjustement;
+ base.OnSetScrollAdjustments (hAdjustement, vAdjustement);
+ textArea.SetTextEditorScrollAdjustments (hAdjustement, vAdjustement);
+ if (hAdjustement != null) {
+ hAdjustement.ValueChanged += HandleAdjustmentValueChange;
+ }
+
+ if (vAdjustement != null) {
+ vAdjustement.ValueChanged += HandleAdjustmentValueChange;
+ }
+ OnScrollAdjustmentsSet ();
+ }
+
+ void HandleAdjustmentValueChange (object sender, EventArgs e)
+ {
+ SetChildrenPositions (Allocation);
+ }
+
+ protected virtual void OnScrollAdjustmentsSet ()
+ {
+ }
+
+ protected override void OnSizeAllocated (Rectangle allocation)
+ {
+ base.OnSizeAllocated (allocation);
+ CurrentMode.AllocateTextArea (this, textArea, allocation);
+ SetChildrenPositions (allocation);
+ }
+
+ protected override void OnSizeRequested (ref Requisition requisition)
+ {
+ base.OnSizeRequested (ref requisition);
+ containerChildren.ForEach (c => c.Child.SizeRequest ());
+ }
+
+ internal protected virtual string GetIdeColorStyleName ()
+ {
+ return TextEditorOptions.DefaultColorStyle;
+ }
+
+ #region Container
+ public override ContainerChild this [Widget w] {
+ get {
+ return containerChildren.FirstOrDefault (info => info.Child == w || (info.Child is AnimatedWidget && ((AnimatedWidget)info.Child).Widget == w));
+ }
+ }
+
+ public class EditorContainerChild : Container.ContainerChild
+ {
+ public int X { get; set; }
+ public int Y { get; set; }
+ public bool FixedPosition { get; set; }
+ public EditorContainerChild (Container parent, Widget child) : base (parent, child)
+ {
+ }
+ }
+
+ public override GLib.GType ChildType ()
+ {
+ return Gtk.Widget.GType;
+ }
+
+ internal List<EditorContainerChild> containerChildren = new List<EditorContainerChild> ();
+
+ public void AddTopLevelWidget (Gtk.Widget widget, int x, int y)
+ {
+ widget.Parent = this;
+ EditorContainerChild info = new EditorContainerChild (this, widget);
+ info.X = x;
+ info.Y = y;
+ containerChildren.Add (info);
+ SetAdjustments ();
+ }
+
+ public void MoveTopLevelWidget (Gtk.Widget widget, int x, int y)
+ {
+ foreach (EditorContainerChild info in containerChildren.ToArray ()) {
+ if (info.Child == widget || (info.Child is AnimatedWidget && ((AnimatedWidget)info.Child).Widget == widget)) {
+ if (info.X == x && info.Y == y)
+ break;
+ info.X = x;
+ info.Y = y;
+ if (widget.Visible)
+ ResizeChild (Allocation, info);
+ break;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Returns the position of an embedded widget
+ /// </summary>
+ public void GetTopLevelWidgetPosition (Gtk.Widget widget, out int x, out int y)
+ {
+ foreach (EditorContainerChild info in containerChildren.ToArray ()) {
+ if (info.Child == widget || (info.Child is AnimatedWidget && ((AnimatedWidget)info.Child).Widget == widget)) {
+ x = info.X;
+ y = info.Y;
+ return;
+ }
+ }
+ x = y = 0;
+ }
+
+ public void MoveToTop (Gtk.Widget widget)
+ {
+ EditorContainerChild editorContainerChild = containerChildren.FirstOrDefault (c => c.Child == widget);
+ if (editorContainerChild == null)
+ throw new Exception ("child " + widget + " not found.");
+ List<EditorContainerChild> newChilds = new List<EditorContainerChild> (containerChildren.Where (child => child != editorContainerChild));
+ newChilds.Add (editorContainerChild);
+ this.containerChildren = newChilds;
+ widget.GdkWindow.Raise ();
+ }
+
+ protected override void OnAdded (Widget widget)
+ {
+ AddTopLevelWidget (widget, 0, 0);
+ }
+
+ protected override void OnRemoved (Widget widget)
+ {
+ foreach (EditorContainerChild info in containerChildren.ToArray ()) {
+ if (info.Child == widget) {
+ widget.Unparent ();
+ containerChildren.Remove (info);
+ break;
+ }
+ }
+ }
+
+ protected override void ForAll (bool include_internals, Gtk.Callback callback)
+ {
+ foreach (var child in containerChildren.ToArray ()) {
+ callback (child.Child);
+ }
+ }
+
+ void ResizeChild (Rectangle allocation, EditorContainerChild child)
+ {
+ Requisition req = child.Child.SizeRequest ();
+ var childRectangle = new Gdk.Rectangle (Allocation.X + child.X, Allocation.Y + child.Y, System.Math.Max (1, req.Width), System.Math.Max (1, req.Height));
+ if (!child.FixedPosition) {
+ double zoom = Options.Zoom;
+ childRectangle.X = Allocation.X + (int)(child.X * zoom - HAdjustment.Value);
+ childRectangle.Y = Allocation.Y + (int)(child.Y * zoom - VAdjustment.Value);
+ }
+ // childRectangle.X += allocation.X;
+ // childRectangle.Y += allocation.Y;
+ child.Child.SizeAllocate (childRectangle);
+ }
+
+ void SetChildrenPositions (Rectangle allocation)
+ {
+ foreach (EditorContainerChild child in containerChildren.ToArray ()) {
+ if (child.Child == textArea)
+ continue;
+ ResizeChild (allocation, child);
+ }
+ }
+ #endregion
+
+ #region Animated Widgets
+ Stage<AnimatedWidget> stage = new Stage<AnimatedWidget> ();
+
+ bool OnActorStep (Actor<AnimatedWidget> actor)
+ {
+ switch (actor.Target.AnimationState) {
+ case AnimationState.Coming:
+ actor.Target.QueueDraw ();
+ actor.Target.Percent = actor.Percent;
+ if (actor.Expired) {
+ actor.Target.AnimationState = AnimationState.Idle;
+ return false;
+ }
+ break;
+ case AnimationState.IntendingToGo:
+ actor.Target.AnimationState = AnimationState.Going;
+ actor.Target.Bias = actor.Percent;
+ actor.Reset ((uint)(actor.Target.Duration * actor.Percent));
+ break;
+ case AnimationState.Going:
+ if (actor.Expired) {
+ this.Remove (actor.Target);
+ return false;
+ }
+ actor.Target.Percent = 1.0 - actor.Percent;
+ break;
+ }
+ return true;
+ }
+
+ void OnWidgetDestroyed (object sender, EventArgs args)
+ {
+ RemoveCore ((AnimatedWidget)sender);
+ }
+
+ void RemoveCore (AnimatedWidget widget)
+ {
+ RemoveCore (widget, widget.Duration, 0, 0, false, false);
+ }
+
+ void RemoveCore (AnimatedWidget widget, uint duration, Easing easing, Blocking blocking, bool use_easing, bool use_blocking)
+ {
+ if (duration > 0)
+ widget.Duration = duration;
+
+ if (use_easing)
+ widget.Easing = easing;
+
+ if (use_blocking)
+ widget.Blocking = blocking;
+
+ if (widget.AnimationState == AnimationState.Coming) {
+ widget.AnimationState = AnimationState.IntendingToGo;
+ } else {
+ if (widget.Easing == Easing.QuadraticIn) {
+ widget.Easing = Easing.QuadraticOut;
+ } else if (widget.Easing == Easing.QuadraticOut) {
+ widget.Easing = Easing.QuadraticIn;
+ } else if (widget.Easing == Easing.ExponentialIn) {
+ widget.Easing = Easing.ExponentialOut;
+ } else if (widget.Easing == Easing.ExponentialOut) {
+ widget.Easing = Easing.ExponentialIn;
+ }
+ widget.AnimationState = AnimationState.Going;
+ stage.Add (widget, widget.Duration);
+ }
+ }
+
+ public void AddAnimatedWidget (Widget widget, uint duration, Easing easing, Blocking blocking, int x, int y)
+ {
+ AnimatedWidget animated_widget = new AnimatedWidget (widget, duration, easing, blocking, false);
+ animated_widget.Parent = this;
+ animated_widget.WidgetDestroyed += OnWidgetDestroyed;
+ stage.Add (animated_widget, duration);
+ animated_widget.StartPadding = 0;
+ animated_widget.EndPadding = widget.Allocation.Height;
+ // animated_widget.Node = animated_widget;
+
+ EditorContainerChild info = new EditorContainerChild (this, animated_widget);
+ info.X = x;
+ info.Y = y;
+ info.FixedPosition = true;
+ containerChildren.Add (info);
+ }
+ #endregion
+
+ #region TextArea delegation
+ public TextDocument Document {
+ get {
+ return textArea.Document;
+ }
+ set {
+ textArea.Document = value;
+ }
+ }
+
+ public bool IsDisposed {
+ get {
+ return textArea.IsDisposed;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this <see cref="MonoTextEditor"/> converts tabs to spaces.
+ /// It is possible to overwrite the default options value for certain languages (like F#).
+ /// </summary>
+ /// <value>
+ /// <c>true</c> if tabs to spaces should be converted; otherwise, <c>false</c>.
+ /// </value>
+ public bool TabsToSpaces {
+ get {
+ return textArea.TabsToSpaces;
+ }
+ set {
+ textArea.TabsToSpaces = value;
+ }
+ }
+
+ public Mono.TextEditor.Caret Caret {
+ get {
+ return textArea.Caret;
+ }
+ }
+
+ protected internal IMMulticontext IMContext {
+ get { return textArea.IMContext; }
+ }
+
+ public string IMModule {
+ get {
+ return textArea.IMModule;
+ }
+ set {
+ textArea.IMModule = value;
+ }
+ }
+
+ public ITextEditorOptions Options {
+ get {
+ return textArea.Options;
+ }
+ set {
+ textArea.Options = value;
+ }
+ }
+
+ public string FileName {
+ get {
+ return textArea.FileName;
+ }
+ }
+
+ public string MimeType {
+ get {
+ return textArea.MimeType;
+ }
+ }
+
+ public double LineHeight {
+ get {
+ return textArea.LineHeight;
+ }
+ internal set {
+ textArea.LineHeight = value;
+ }
+ }
+
+ public TextViewMargin TextViewMargin {
+ get {
+ return textArea.TextViewMargin;
+ }
+ }
+
+ public ActionMargin ActionMargin {
+ get {
+ return textArea.ActionMargin;
+ }
+ }
+
+ public Margin IconMargin {
+ get { return textArea.IconMargin; }
+ }
+
+ public DocumentLocation LogicalToVisualLocation (DocumentLocation location)
+ {
+ return textArea.LogicalToVisualLocation (location);
+ }
+
+ public DocumentLocation LogicalToVisualLocation (int line, int column)
+ {
+ return textArea.LogicalToVisualLocation (line, column);
+ }
+
+ public void CenterToCaret ()
+ {
+ textArea.CenterToCaret ();
+ }
+
+ public void CenterTo (int offset)
+ {
+ textArea.CenterTo (offset);
+ }
+
+ public void CenterTo (int line, int column)
+ {
+ textArea.CenterTo (line, column);
+ }
+
+ public void CenterTo (DocumentLocation p)
+ {
+ textArea.CenterTo (p);
+ }
+
+ internal void SmoothScrollTo (double value)
+ {
+ textArea.SmoothScrollTo (value);
+ }
+
+ public void ScrollTo (int offset)
+ {
+ textArea.ScrollTo (offset);
+ }
+
+ public void ScrollTo (int line, int column)
+ {
+ textArea.ScrollTo (line, column);
+ }
+
+ public void ScrollTo (DocumentLocation p)
+ {
+ textArea.ScrollTo (p);
+ }
+
+ public void ScrollTo (Gdk.Rectangle rect)
+ {
+ textArea.ScrollTo (rect);
+ }
+
+ public void ScrollToCaret ()
+ {
+ textArea.ScrollToCaret ();
+ }
+
+ public void TryToResetHorizontalScrollPosition ()
+ {
+ textArea.TryToResetHorizontalScrollPosition ();
+ }
+
+ public int GetWidth (string text)
+ {
+ return textArea.GetWidth (text);
+ }
+
+ internal void HideMouseCursor ()
+ {
+ textArea.HideMouseCursor ();
+ }
+
+ public void ClearTooltipProviders ()
+ {
+ GetTextEditorData ().ClearTooltipProviders ();
+ }
+
+ public void AddTooltipProvider (TooltipProvider provider)
+ {
+ GetTextEditorData ().AddTooltipProvider (provider);
+ }
+
+ public void RemoveTooltipProvider (TooltipProvider provider)
+ {
+ GetTextEditorData ().RemoveTooltipProvider (provider);
+ }
+
+ internal void RedrawMargin (Margin margin)
+ {
+ textArea.RedrawMargin (margin);
+ }
+
+ public void RedrawMarginLine (Margin margin, int logicalLine)
+ {
+ textArea.RedrawMarginLine (margin, logicalLine);
+ }
+ internal void RedrawPosition (int logicalLine, int logicalColumn)
+ {
+ textArea.RedrawPosition (logicalLine, logicalColumn);
+ }
+
+ internal void RedrawLine (int line)
+ {
+ textArea.RedrawLine (line);
+ }
+
+ internal void RedrawLines (int start, int end)
+ {
+ textArea.RedrawLines (start, end);
+ }
+
+ internal string preeditString {
+ get {
+ return textArea.preeditString;
+ }
+ }
+
+ internal int preeditOffset {
+ get {
+ return textArea.preeditOffset;
+ }
+ }
+
+ internal int preeditCursorCharIndex {
+ get {
+ return textArea.preeditCursorCharIndex;
+ }
+ }
+
+ internal Pango.AttrList preeditAttrs {
+ get {
+ return textArea.preeditAttrs;
+ }
+ }
+
+ internal bool UpdatePreeditLineHeight ()
+ {
+ return textArea.UpdatePreeditLineHeight ();
+ }
+
+ internal void ResetIMContext ()
+ {
+ textArea.ResetIMContext ();
+ }
+
+ internal bool ContainsPreedit (int offset, int length)
+ {
+ return textArea.ContainsPreedit (offset, length);
+ }
+
+ internal void FireLinkEvent (string link, uint button, ModifierType modifierState)
+ {
+ textArea.FireLinkEvent (link, button, modifierState);
+ }
+
+ internal void RequestResetCaretBlink ()
+ {
+ textArea.RequestResetCaretBlink ();
+ }
+
+ internal void SetAdjustments ()
+ {
+ textArea.SetAdjustments ();
+ }
+
+ public bool IsInDrag {
+ get {
+ return textArea.IsInDrag;
+ }
+ }
+
+ public event EventHandler VScroll {
+ add { textArea.VScroll += value; }
+ remove { textArea.VScroll -= value; }
+ }
+
+ public event EventHandler HScroll {
+ add { textArea.HScroll += value; }
+ remove { textArea.HScroll -= value; }
+ }
+
+ #endregion
+
+ #region TextEditorData delegation
+ public string EolMarker {
+ get {
+ return textArea.EolMarker;
+ }
+ }
+
+ public Mono.TextEditor.Highlighting.ColorScheme ColorStyle {
+ get {
+ return textArea.ColorStyle;
+ }
+ }
+
+ public EditMode CurrentMode {
+ get {
+ return textArea.CurrentMode;
+ }
+ set {
+ textArea.CurrentMode = value;
+ }
+ }
+
+ public bool IsSomethingSelected {
+ get {
+ return textArea.IsSomethingSelected;
+ }
+ }
+
+ public Selection MainSelection {
+ get {
+ return textArea.MainSelection;
+ }
+ set {
+ textArea.MainSelection = value;
+ }
+ }
+
+ public SelectionMode SelectionMode {
+ get {
+ return textArea.SelectionMode;
+ }
+ set {
+ textArea.SelectionMode = value;
+ }
+ }
+
+ public TextSegment SelectionRange {
+ get {
+ return textArea.SelectionRange;
+ }
+ set {
+ textArea.SelectionRange = value;
+ }
+ }
+
+ public string SelectedText {
+ get {
+ return textArea.SelectedText;
+ }
+ set {
+ textArea.SelectedText = value;
+ }
+ }
+
+ public int SelectionAnchor {
+ get {
+ return textArea.SelectionAnchor;
+ }
+ set {
+ textArea.SelectionAnchor = value;
+ }
+ }
+
+ public int SelectionLead {
+ get {
+ return textArea.SelectionLead;
+ }
+ set {
+ textArea.SelectionLead = value;
+ }
+ }
+
+ public IEnumerable<DocumentLine> SelectedLines {
+ get {
+ return textArea.SelectedLines;
+ }
+ }
+
+ public Adjustment HAdjustment {
+ get {
+ return textArea.HAdjustment;
+ }
+ }
+
+ public Adjustment VAdjustment {
+ get {
+ return textArea.VAdjustment;
+ }
+ }
+
+ public int Insert (int offset, string value)
+ {
+ return textArea.Insert (offset, value);
+ }
+
+ public void Remove (DocumentRegion region)
+ {
+ textArea.Remove (region);
+ }
+
+ public void Remove (TextSegment removeSegment)
+ {
+ textArea.Remove (removeSegment);
+ }
+
+ public void Remove (int offset, int count)
+ {
+ textArea.Remove (offset, count);
+ }
+
+ public int Replace (int offset, int count, string value)
+ {
+ return textArea.Replace (offset, count, value);
+ }
+
+ public void ClearSelection ()
+ {
+ textArea.ClearSelection ();
+ }
+
+ public void DeleteSelectedText ()
+ {
+ textArea.DeleteSelectedText ();
+ }
+
+ public void DeleteSelectedText (bool clearSelection)
+ {
+ textArea.DeleteSelectedText (clearSelection);
+ }
+
+ public void RunEditAction (Action<TextEditorData> action)
+ {
+ action (GetTextEditorData ());
+ }
+
+ public void SetSelection (int anchorOffset, int leadOffset)
+ {
+ textArea.SetSelection (anchorOffset, leadOffset);
+ }
+
+ public void SetSelection (DocumentLocation anchor, DocumentLocation lead)
+ {
+ textArea.SetSelection (anchor, lead);
+ }
+
+ public void SetSelection (int anchorLine, int anchorColumn, int leadLine, int leadColumn)
+ {
+ textArea.SetSelection (anchorLine, anchorColumn, leadLine, leadColumn);
+ }
+
+ public void ExtendSelectionTo (DocumentLocation location)
+ {
+ textArea.ExtendSelectionTo (location);
+ }
+ public void ExtendSelectionTo (int offset)
+ {
+ textArea.ExtendSelectionTo (offset);
+ }
+ public void SetSelectLines (int from, int to)
+ {
+ textArea.SetSelectLines (from, to);
+ }
+
+ public void InsertAtCaret (string text)
+ {
+ textArea.InsertAtCaret (text);
+ }
+
+ public bool CanEdit (int line)
+ {
+ return textArea.CanEdit (line);
+ }
+
+ public string GetLineText (int line)
+ {
+ return textArea.GetLineText (line);
+ }
+
+ public string GetLineText (int line, bool includeDelimiter)
+ {
+ return textArea.GetLineText (line, includeDelimiter);
+ }
+
+ /// <summary>
+ /// Use with care.
+ /// </summary>
+ /// <returns>
+ /// A <see cref="TextEditorData"/>
+ /// </returns>
+ public TextEditorData GetTextEditorData ()
+ {
+ return textArea.GetTextEditorData ();
+ }
+
+ /// <remarks>
+ /// The Key may be null if it has been handled by the IMContext. In such cases, the char is the value.
+ /// </remarks>
+ protected internal virtual bool OnIMProcessedKeyPressEvent (Gdk.Key key, uint ch, Gdk.ModifierType state)
+ {
+ SimulateKeyPress (key, ch, state);
+ return true;
+ }
+
+ public void SimulateKeyPress (Gdk.Key key, uint unicodeChar, ModifierType modifier)
+ {
+ textArea.SimulateKeyPress (key, unicodeChar, modifier);
+ }
+
+
+ public void RunAction (Action<TextEditorData> action)
+ {
+ try {
+ action (GetTextEditorData ());
+ } catch (Exception e) {
+ if (Debugger.IsAttached)
+ Debugger.Break ();
+ //TODO: we should really find a way to log this properly
+ Console.WriteLine ("Error while executing " + action + " :" + e);
+ }
+ }
+
+ public void HideTooltip (bool checkMouseOver = true)
+ {
+ textArea.HideTooltip (checkMouseOver);
+ }
+ public Action<Gdk.EventButton> DoPopupMenu {
+ get {
+ return textArea.DoPopupMenu;
+ }
+ set {
+ textArea.DoPopupMenu = value;
+ }
+ }
+
+ public MenuItem CreateInputMethodMenuItem (string label)
+ {
+ return textArea.CreateInputMethodMenuItem (label);
+ }
+
+ public event EventHandler SelectionChanged {
+ add { textArea.SelectionChanged += value; }
+ remove { textArea.SelectionChanged -= value; }
+ }
+
+ public void CaretToDragCaretPosition ()
+ {
+ textArea.CaretToDragCaretPosition ();
+ }
+
+ public event EventHandler<PaintEventArgs> Painted {
+ add { textArea.Painted += value; }
+ remove { textArea.Painted -= value; }
+ }
+
+ public event EventHandler<LinkEventArgs> LinkRequest {
+ add { textArea.LinkRequest += value; }
+ remove { textArea.LinkRequest -= value; }
+ }
+
+ public void ShowListWindow<T> (ListWindow<T> window, DocumentLocation loc)
+ {
+ textArea.ShowListWindow<T> (window, loc);
+ }
+
+ public Margin LockedMargin {
+ get {
+ return textArea.LockedMargin;
+ }
+ set {
+ textArea.LockedMargin = value;
+ }
+ }
+ #endregion
+
+ #region Document delegation
+
+ public event EventHandler EditorOptionsChanged {
+ add { textArea.EditorOptionsChanged += value; }
+ remove { textArea.EditorOptionsChanged -= value; }
+ }
+
+ protected virtual void OptionsChanged (object sender, EventArgs args)
+ {
+ }
+
+ public int Length {
+ get {
+ return Document.TextLength;
+ }
+ }
+
+ public string Text {
+ get {
+ return Document.Text;
+ }
+ set {
+ Document.Text = value;
+ }
+ }
+
+ public string GetTextBetween (int startOffset, int endOffset)
+ {
+ return Document.GetTextBetween (startOffset, endOffset);
+ }
+
+ public string GetTextBetween (DocumentLocation start, DocumentLocation end)
+ {
+ return Document.GetTextBetween (start, end);
+ }
+
+ public string GetTextBetween (int startLine, int startColumn, int endLine, int endColumn)
+ {
+ return Document.GetTextBetween (startLine, startColumn, endLine, endColumn);
+ }
+
+ public string GetTextAt (int offset, int count)
+ {
+ return Document.GetTextAt (offset, count);
+ }
+
+ public string GetTextAt (TextSegment segment)
+ {
+ return Document.GetTextAt (segment);
+ }
+
+ public string GetTextAt (DocumentRegion region)
+ {
+ return Document.GetTextAt (region);
+ }
+
+ public char GetCharAt (int offset)
+ {
+ return Document.GetCharAt (offset);
+ }
+
+ public IEnumerable<DocumentLine> Lines {
+ get {
+ return Document.Lines;
+ }
+ }
+
+ public int LineCount {
+ get {
+ return Document.LineCount;
+ }
+ }
+
+ public int LocationToOffset (int line, int column)
+ {
+ return Document.LocationToOffset (line, column);
+ }
+
+ public int LocationToOffset (DocumentLocation location)
+ {
+ return Document.LocationToOffset (location);
+ }
+
+ public DocumentLocation OffsetToLocation (int offset)
+ {
+ return Document.OffsetToLocation (offset);
+ }
+
+ public string GetLineIndent (int lineNumber)
+ {
+ return Document.GetLineIndent (lineNumber);
+ }
+
+ public string GetLineIndent (DocumentLine segment)
+ {
+ return Document.GetLineIndent (segment);
+ }
+
+ public DocumentLine GetLine (int lineNumber)
+ {
+ return Document.GetLine (lineNumber);
+ }
+
+ public DocumentLine GetLineByOffset (int offset)
+ {
+ return Document.GetLineByOffset (offset);
+ }
+
+ public int OffsetToLineNumber (int offset)
+ {
+ return Document.OffsetToLineNumber (offset);
+ }
+
+ public IDisposable OpenUndoGroup()
+ {
+ return Document.OpenUndoGroup ();
+ }
+#endregion
+
+ #region Search & Replace
+ public string SearchPattern {
+ get {
+ return textArea.SearchPattern;
+ }
+ set {
+ textArea.SearchPattern = value;
+ }
+ }
+
+ public ISearchEngine SearchEngine {
+ get {
+ return textArea.SearchEngine;
+ }
+ set {
+ textArea.SearchEngine = value;
+ }
+ }
+
+ public event EventHandler HighlightSearchPatternChanged {
+ add { textArea.HighlightSearchPatternChanged += value; }
+ remove { textArea.HighlightSearchPatternChanged -= value; }
+ }
+
+ public bool HighlightSearchPattern {
+ get {
+ return textArea.HighlightSearchPattern;
+ }
+ set {
+ textArea.HighlightSearchPattern = value;
+ }
+ }
+
+ public bool IsCaseSensitive {
+ get {
+ return textArea.IsCaseSensitive;
+ }
+ set {
+ textArea.IsCaseSensitive = value;
+ }
+ }
+
+ public bool IsWholeWordOnly {
+ get {
+ return textArea.IsWholeWordOnly;
+ }
+
+ set {
+ textArea.IsWholeWordOnly = value;
+ }
+ }
+
+ public TextSegment SearchRegion {
+ get {
+ return textArea.SearchRegion;
+ }
+
+ set {
+ textArea.SearchRegion = value;
+ }
+ }
+
+ public SearchResult SearchForward (int fromOffset)
+ {
+ return textArea.SearchForward (fromOffset);
+ }
+
+ public SearchResult SearchBackward (int fromOffset)
+ {
+ return textArea.SearchBackward (fromOffset);
+ }
+
+ /// <summary>
+ /// Initiate a pulse at the specified document location
+ /// </summary>
+ /// <param name="pulseStart">
+ /// A <see cref="DocumentLocation"/>
+ /// </param>
+ public void PulseCharacter (DocumentLocation pulseStart)
+ {
+ textArea.PulseCharacter (pulseStart);
+ }
+
+
+ public SearchResult FindNext (bool setSelection)
+ {
+ return textArea.FindNext (setSelection);
+ }
+
+ public void StartCaretPulseAnimation ()
+ {
+ textArea.StartCaretPulseAnimation ();
+ }
+
+ public void StopSearchResultAnimation ()
+ {
+ textArea.StopSearchResultAnimation ();
+ }
+
+ public void AnimateSearchResult (SearchResult result)
+ {
+ textArea.AnimateSearchResult (result);
+ }
+
+ public SearchResult FindPrevious (bool setSelection)
+ {
+ return textArea.FindPrevious (setSelection);
+ }
+
+ public bool Replace (string withPattern)
+ {
+ return textArea.Replace (withPattern);
+ }
+
+ public int ReplaceAll (string withPattern)
+ {
+ return textArea.ReplaceAll (withPattern);
+ }
+ #endregion
+
+ #region Coordinate transformation
+ public DocumentLocation PointToLocation (double xp, double yp)
+ {
+ return TextViewMargin.PointToLocation (xp, yp);
+ }
+
+ public DocumentLocation PointToLocation (Cairo.Point p)
+ {
+ return TextViewMargin.PointToLocation (p);
+ }
+
+ public DocumentLocation PointToLocation (Cairo.PointD p)
+ {
+ return TextViewMargin.PointToLocation (p);
+ }
+
+ public Cairo.Point LocationToPoint (DocumentLocation loc)
+ {
+ return TextViewMargin.LocationToPoint (loc);
+ }
+
+ public Cairo.Point LocationToPoint (int line, int column)
+ {
+ return TextViewMargin.LocationToPoint (line, column);
+ }
+
+ public Cairo.Point LocationToPoint (int line, int column, bool useAbsoluteCoordinates)
+ {
+ return TextViewMargin.LocationToPoint (line, column, useAbsoluteCoordinates);
+ }
+
+ public Cairo.Point LocationToPoint (DocumentLocation loc, bool useAbsoluteCoordinates)
+ {
+ return TextViewMargin.LocationToPoint (loc, useAbsoluteCoordinates);
+ }
+
+ public double ColumnToX (DocumentLine line, int column)
+ {
+ if (line == null)
+ throw new ArgumentNullException ("line");
+ return TextViewMargin.ColumnToX (line, column);
+ }
+
+ /// <summary>
+ /// Calculates the line number at line start (in one visual line could be several logical lines be displayed).
+ /// </summary>
+ public int YToLine (double yPos)
+ {
+ return TextViewMargin.YToLine (yPos);
+ }
+
+ public double LineToY (int logicalLine)
+ {
+ return TextViewMargin.LineToY (logicalLine);
+ }
+
+ public double GetLineHeight (DocumentLine line)
+ {
+ return TextViewMargin.GetLineHeight (line);
+ }
+
+ public double GetLineHeight (int logicalLineNumber)
+ {
+ return TextViewMargin.GetLineHeight (logicalLineNumber);
+ }
+ #endregion
+
+
+ public void SetCaretTo (int line, int column)
+ {
+ textArea.SetCaretTo (line, column);
+ }
+
+ public void SetCaretTo (int line, int column, bool highlight)
+ {
+ textArea.SetCaretTo (line, column, highlight);
+ }
+
+ public void SetCaretTo (int line, int column, bool highlight, bool centerCaret)
+ {
+ textArea.SetCaretTo (line, column, highlight, centerCaret);
+ }
+ public event EventHandler<Xwt.MouseMovedEventArgs> BeginHover {
+ add { textArea.BeginHover += value; }
+ remove { textArea.BeginHover -= value; }
+ }
+
+ }
+}
+
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs
index 7795463769..2f1fba8a8a 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs
@@ -41,11 +41,14 @@ using Mono.TextEditor.Theatrics;
using Gdk;
using Gtk;
+using GLib;
+using System.Threading.Tasks;
namespace Mono.TextEditor
{
public class TextArea : Container, ITextEditorDataProvider
{
+
TextEditorData textEditorData;
protected IconMargin iconMargin;
@@ -53,7 +56,7 @@ namespace Mono.TextEditor
protected GutterMargin gutterMargin;
protected FoldMarkerMargin foldMarkerMargin;
protected TextViewMargin textViewMargin;
-
+
DocumentLine longestLine = null;
double longestLineWidth = -1;
@@ -76,6 +79,9 @@ namespace Mono.TextEditor
get {
return textEditorData.Document;
}
+ set {
+ textEditorData.Document = value;
+ }
}
public bool IsDisposed {
@@ -85,7 +91,7 @@ namespace Mono.TextEditor
}
/// <summary>
- /// Gets or sets a value indicating whether this <see cref="Mono.TextEditor.TextEditor"/> converts tabs to spaces.
+ /// Gets or sets a value indicating whether this <see cref="Mono.TextEditor.MonoTextEditor"/> converts tabs to spaces.
/// It is possible to overwrite the default options value for certain languages (like F#).
/// </summary>
/// <value>
@@ -212,7 +218,6 @@ namespace Mono.TextEditor
{
var alloc = this.Allocation;
alloc.X = alloc.Y = 0;
-
VAdjustmentValueChanged ();
SetChildrenPositions (alloc);
}
@@ -278,7 +283,6 @@ namespace Mono.TextEditor
if (hAdjustement == null || vAdjustement == null)
return;
-
this.textEditorData.HAdjustment = hAdjustement;
this.textEditorData.VAdjustment = vAdjustement;
@@ -294,19 +298,35 @@ namespace Mono.TextEditor
// This is required to properly handle resizing and rendering of children
ResizeMode = ResizeMode.Queue;
+ snooperID = Gtk.Key.SnooperInstall (TooltipKeySnooper);
+ }
+
+ uint snooperID;
+
+ int TooltipKeySnooper (Gtk.Widget widget, EventKey evnt)
+ {
+ if (evnt != null && (evnt.Key == Gdk.Key.Alt_L || evnt.Key == Gdk.Key.Alt_R)) {
+ if (tipWindow != null && (nextTipModifierState & ModifierType.Mod1Mask) == 0) {
+ nextTipModifierState |= ModifierType.Mod1Mask;
+ nextTipX = tipX;
+ nextTipY = tipY;
+ nextTipOffset = tipOffset;
+ nextTipScheduledTime = DateTime.FromBinary (0);
+ tipItem = null;
+ TooltipTimer ();
+ }
+ }
+ return 0; //FALSE
}
- TextEditor editor;
- internal void Initialize (TextEditor editor, TextDocument doc, ITextEditorOptions options, EditMode initialMode)
+ MonoTextEditor editor;
+ internal void Initialize (MonoTextEditor editor, TextDocument doc, ITextEditorOptions options, EditMode initialMode)
{
if (doc == null)
throw new ArgumentNullException ("doc");
this.editor = editor;
textEditorData = new TextEditorData (doc);
- textEditorData.RecenterEditor += delegate {
- CenterToCaret ();
- StartCaretPulseAnimation ();
- };
+ textEditorData.RecenterEditor += TextEditorData_RecenterEditor;
textEditorData.Document.TextReplaced += OnDocumentStateChanged;
textEditorData.Document.TextSet += OnTextSet;
textEditorData.Document.LineChanged += UpdateLinesOnTextMarkerHeightChange;
@@ -352,7 +372,12 @@ namespace Mono.TextEditor
imContext.RetrieveSurrounding += delegate (object o, RetrieveSurroundingArgs args) {
//use a single line of context, whole document would be very expensive
//FIXME: UTF16 surrogates handling for caret offset? only matters for astral plane
- imContext.SetSurrounding (Document.GetLineText (Caret.Line, false), Caret.Column);
+ var text = Document.GetLineText (Caret.Line, false);
+ // Gtk#, with some input methods, causes
+ // "Gtk-Critical: IA__gtk_im_context_set_surrounding: assertion 'cursor_index >= 0 && cursor_index <= len' failed"
+ // so, do not try to attempt erroneous imcontext call.
+ if (Caret.Column < text.Length)
+ imContext.SetSurrounding (text, Caret.Column);
args.RetVal = true;
};
@@ -369,16 +394,19 @@ namespace Mono.TextEditor
InitAnimations ();
this.Document.EndUndo += HandleDocumenthandleEndUndo;
- this.textEditorData.HeightTree.LineUpdateFrom += delegate(object sender, HeightTree.HeightChangedEventArgs e) {
- //Console.WriteLine ("redraw from :" + e.Line);
- RedrawFromLine (e.Line);
- };
-#if ATK
- TextEditorAccessible.Factory.Init (this);
-#endif
+ this.textEditorData.HeightTree.LineUpdateFrom += HeightTree_LineUpdateFrom;
+//#if ATK
+// TextEditorAccessible.Factory.Init (this);
+//#endif
+
OptionsChanged (this, EventArgs.Empty);
}
+ void TextEditorData_RecenterEditor (object sender, EventArgs e)
+ {
+ CenterToCaret ();
+ StartCaretPulseAnimation ();
+ }
public void RunAction (Action<TextEditorData> action)
{
@@ -622,6 +650,7 @@ namespace Mono.TextEditor
{
var result = base.OnFocusOutEvent (evnt);
imContextNeedsReset = true;
+ mouseButtonPressed = 0;
imContext.FocusOut ();
RemoveFocusOutTimerId ();
@@ -695,7 +724,9 @@ namespace Mono.TextEditor
gutterMargin.IsVisible = Options.ShowLineNumberMargin;
foldMarkerMargin.IsVisible = Options.ShowFoldMargin || Options.EnableQuickDiff;
// dashedLineMargin.IsVisible = foldMarkerMargin.IsVisible || gutterMargin.IsVisible;
-
+ if (!Options.ShowFoldMargin) {
+ Document.UpdateFoldSegments (new List<FoldSegment> ());
+ }
if (EditorOptionsChanged != null)
EditorOptionsChanged (this, args);
@@ -726,7 +757,11 @@ namespace Mono.TextEditor
if (parent != null) {
parent.ModifyBg (StateType.Normal, (HslColor)this.textEditorData.ColorStyle.PlainText.Background);
}
-
+
+ // set additionally the real parent background for gtk themes that use the content background
+ // to draw the scrollbar slider trough.
+ this.Parent.ModifyBg (StateType.Normal, (HslColor)this.textEditorData.ColorStyle.PlainText.Background);
+
this.ModifyBg (StateType.Normal, (HslColor)this.textEditorData.ColorStyle.PlainText.Background);
settingWidgetBg = false;
}
@@ -751,7 +786,8 @@ namespace Mono.TextEditor
{
if (popupWindow != null)
popupWindow.Destroy ();
-
+ this.Options = null;
+ Gtk.Key.SnooperRemove (snooperID);
HideTooltip ();
Document.EndUndo -= HandleDocumenthandleEndUndo;
Document.TextReplaced -= OnDocumentStateChanged;
@@ -784,15 +820,36 @@ namespace Mono.TextEditor
if (margin is IDisposable)
((IDisposable)margin).Dispose ();
}
+ iconMargin = null;
+ actionMargin = null;
+ foldMarkerMargin = null;
+ gutterMargin = null;
+ textViewMargin = null;
+ margins = null;
+ oldMargin = null;
textEditorData.ClearTooltipProviders ();
-
- this.textEditorData.SelectionChanged -= TextEditorDataSelectionChanged;
- this.textEditorData.Dispose ();
- longestLine = null;
+ textEditorData.RecenterEditor -= TextEditorData_RecenterEditor;
+ textEditorData.Options = null;
+ textEditorData.Parent = null;
+ textEditorData.SelectionChanged -= TextEditorDataSelectionChanged;
+ textEditorData.UpdateAdjustmentsRequested -= TextEditorDatahandleUpdateAdjustmentsRequested;
+ textEditorData.HeightTree.LineUpdateFrom -= HeightTree_LineUpdateFrom;
+ Gtk.Drag.DestUnset (this);
+
+ textEditorData.Dispose ();
+ textEditorData = null;
+ longestLine = null;
base.OnDestroyed ();
}
+ void HeightTree_LineUpdateFrom (object sender, TextEditor.HeightTree.HeightChangedEventArgs e)
+ {
+ //Console.WriteLine ("redraw from :" + e.Line);
+ RedrawFromLine (e.Line);
+
+ }
+
public void RedrawMargin (Margin margin)
{
if (isDisposed)
@@ -802,14 +859,17 @@ namespace Mono.TextEditor
public void RedrawMarginLine (Margin margin, int logicalLine)
{
- if (isDisposed)
+ if (isDisposed || !margin.IsVisible)
return;
double y = LineToY (logicalLine) - this.textEditorData.VAdjustment.Value;
double h = GetLineHeight (logicalLine);
-
- if (y + h > 0)
- QueueDrawArea ((int)margin.XOffset, (int)y, (int)GetMarginWidth (margin), (int)h);
+
+ if (y + h > 0) {
+ var mw = (int)GetMarginWidth (margin);
+ if (mw > 0 && h > 0)
+ QueueDrawArea ((int)margin.XOffset, (int)y, mw, (int)h);
+ }
}
int GetMarginWidth (Margin margin)
@@ -1232,9 +1292,9 @@ namespace Mono.TextEditor
Margin oldMargin = null;
bool overChildWidget;
- public event EventHandler BeginHover;
+ public event EventHandler<Xwt.MouseMovedEventArgs> BeginHover;
- protected virtual void OnBeginHover (EventArgs e)
+ protected virtual void OnBeginHover (Xwt.MouseMovedEventArgs e)
{
var handler = BeginHover;
if (handler != null)
@@ -1243,7 +1303,7 @@ namespace Mono.TextEditor
protected override bool OnMotionNotifyEvent (Gdk.EventMotion e)
{
- OnBeginHover (EventArgs.Empty);
+ OnBeginHover (new Xwt.MouseMovedEventArgs (e.Time, e.X, e.Y));
try {
// The coordinates have to be properly adjusted to the origin since
// the event may come from a child widget
@@ -1251,6 +1311,7 @@ namespace Mono.TextEditor
GdkWindow.GetOrigin (out rx, out ry);
double x = (int) e.XRoot - rx;
double y = (int) e.YRoot - ry;
+
overChildWidget = containerChildren.Any (w => w.Child.Allocation.Contains ((int)x, (int)y));
RemoveScrollWindowTimer ();
@@ -1440,41 +1501,69 @@ namespace Mono.TextEditor
{
CenterTo (new DocumentLocation (line, column));
}
-
+
public void CenterTo (DocumentLocation p)
{
if (isDisposed || p.Line < 0 || p.Line > Document.LineCount)
return;
- SetAdjustments (this.Allocation);
- // Adjustment adj;
- //adj.Upper
- if (this.textEditorData.VAdjustment.Upper < Allocation.Height) {
- this.textEditorData.VAdjustment.Value = 0;
- return;
+ if (!sizeHasBeenAllocated) {
+ var wrapper = new CenterToWrapper (editor, p);
+ SizeAllocated += wrapper.Run;
+ } else {
+ new CenterToWrapper (editor, p).Run (null, null);
}
-
- // int yMargin = 1 * this.LineHeight;
- double caretPosition = LineToY (p.Line);
- caretPosition -= this.textEditorData.VAdjustment.PageSize / 2;
+ }
- // Make sure the caret position is inside the bounds. This avoids an unnecessary bump of the scrollview.
- // The adjustment does this check, but does it after assigning the value, so the value may be out of bounds for a while.
- if (caretPosition + this.textEditorData.VAdjustment.PageSize > this.textEditorData.VAdjustment.Upper)
- caretPosition = this.textEditorData.VAdjustment.Upper - this.textEditorData.VAdjustment.PageSize;
+ class CenterToWrapper
+ {
+ MonoTextEditor editor;
+ DocumentLocation p;
- this.textEditorData.VAdjustment.Value = caretPosition;
-
- if (this.textEditorData.HAdjustment.Upper < Allocation.Width) {
- this.textEditorData.HAdjustment.Value = 0;
- } else {
- double caretX = ColumnToX (Document.GetLine (p.Line), p.Column);
- double textWith = Allocation.Width - textViewMargin.XOffset;
- if (this.textEditorData.HAdjustment.Value > caretX) {
- this.textEditorData.HAdjustment.Value = caretX;
- } else if (this.textEditorData.HAdjustment.Value + textWith < caretX + TextViewMargin.CharWidth) {
- double adjustment = System.Math.Max (0, caretX - textWith + TextViewMargin.CharWidth);
- this.textEditorData.HAdjustment.Value = adjustment;
+ public CenterToWrapper (MonoTextEditor editor, DocumentLocation p)
+ {
+ this.editor = editor;
+ this.p = p;
+ }
+
+ public void Run (object sender, EventArgs e)
+ {
+ if (editor.IsDisposed)
+ return;
+ editor.TextArea.SizeAllocated -= Run;
+ editor.TextArea.SetAdjustments (editor.Allocation);
+ // Adjustment adj;
+ //adj.Upper
+ if (editor.TextArea.textEditorData.VAdjustment.Upper < editor.TextArea.Allocation.Height) {
+ editor.TextArea.textEditorData.VAdjustment.Value = 0;
+ return;
}
+
+ // int yMargin = 1 * this.LineHeight;
+ double caretPosition = editor.TextArea.LineToY (p.Line);
+ caretPosition -= editor.TextArea.textEditorData.VAdjustment.PageSize / 2;
+
+ // Make sure the caret position is inside the bounds. This avoids an unnecessary bump of the scrollview.
+ // The adjustment does this check, but does it after assigning the value, so the value may be out of bounds for a while.
+ if (caretPosition + editor.TextArea.textEditorData.VAdjustment.PageSize > editor.TextArea.textEditorData.VAdjustment.Upper)
+ caretPosition = editor.TextArea.textEditorData.VAdjustment.Upper - editor.TextArea.textEditorData.VAdjustment.PageSize;
+
+ editor.TextArea.textEditorData.VAdjustment.Value = caretPosition;
+
+ if (editor.TextArea.textEditorData.HAdjustment.Upper < editor.TextArea.Allocation.Width) {
+ editor.TextArea.textEditorData.HAdjustment.Value = 0;
+ } else {
+ double caretX = editor.TextArea.ColumnToX (editor.TextArea.Document.GetLine (p.Line), p.Column);
+ double textWith = editor.TextArea.Allocation.Width - editor.TextArea.textViewMargin.XOffset;
+ if (caretX < editor.TextArea.textEditorData.HAdjustment.Upper) {
+ editor.TextArea.textEditorData.HAdjustment.Value = 0;
+ } else if (editor.TextArea.textEditorData.HAdjustment.Value > caretX) {
+ editor.TextArea.textEditorData.HAdjustment.Value = System.Math.Max (0, caretX - editor.TextArea.textEditorData.HAdjustment.Upper / 2);
+ } else if (editor.TextArea.textEditorData.HAdjustment.Value + textWith < caretX + editor.TextArea.TextViewMargin.CharWidth) {
+ double adjustment = System.Math.Max (0, caretX - textWith + editor.TextArea.TextViewMargin.CharWidth);
+ editor.TextArea.textEditorData.HAdjustment.Value = adjustment;
+ }
+ }
+ editor.TextArea.QueueDraw ();
}
}
@@ -1692,6 +1781,8 @@ namespace Mono.TextEditor
internal void SetAdjustments ()
{
+ if (textEditorData == null)
+ return;
SetAdjustments (Allocation);
}
@@ -1880,7 +1971,7 @@ namespace Mono.TextEditor
public Mono.TextEditor.Highlighting.ColorScheme ColorStyle {
get {
- return this.textEditorData.ColorStyle;
+ return this.textEditorData?.ColorStyle;
}
}
@@ -1943,7 +2034,16 @@ namespace Mono.TextEditor
this.textEditorData.SelectionAnchor = value;
}
}
-
+
+ public int SelectionLead {
+ get {
+ return this.textEditorData.SelectionLead;
+ }
+ set {
+ this.textEditorData.SelectionLead = value;
+ }
+ }
+
public IEnumerable<DocumentLine> SelectedLines {
get {
return this.textEditorData.SelectedLines;
@@ -2267,7 +2367,7 @@ namespace Mono.TextEditor
class CaretPulseAnimation : IAnimationDrawer
{
- TextEditor editor;
+ MonoTextEditor editor;
public double Percent { get; set; }
@@ -2284,7 +2384,7 @@ namespace Mono.TextEditor
}
}
- public CaretPulseAnimation (TextEditor editor)
+ public CaretPulseAnimation (MonoTextEditor editor)
{
this.editor = editor;
}
@@ -2321,7 +2421,7 @@ namespace Mono.TextEditor
public class RegionPulseAnimation : IAnimationDrawer
{
- TextEditor editor;
+ MonoTextEditor editor;
public PulseKind Kind { get; set; }
public double Percent { get; set; }
@@ -2342,10 +2442,10 @@ namespace Mono.TextEditor
}
}
- public RegionPulseAnimation (TextEditor editor, Gdk.Point position, Gdk.Size size)
+ public RegionPulseAnimation (MonoTextEditor editor, Gdk.Point position, Gdk.Size size)
: this (editor, new Gdk.Rectangle (position, size)) {}
- public RegionPulseAnimation (TextEditor editor, Gdk.Rectangle region)
+ public RegionPulseAnimation (MonoTextEditor editor, Gdk.Rectangle region)
{
if (region.X < 0 || region.Y < 0 || region.Width < 0 || region.Height < 0)
throw new ArgumentException ("region is invalid");
@@ -2468,7 +2568,7 @@ namespace Mono.TextEditor
set;
}
- public SearchHighlightPopupWindow (TextEditor editor) : base (editor)
+ public SearchHighlightPopupWindow (MonoTextEditor editor) : base (editor)
{
}
@@ -2572,6 +2672,8 @@ namespace Mono.TextEditor
//draw the highlight rectangle
FoldingScreenbackgroundRenderer.DrawRoundRectangle (cr, true, true, 0, 0, corner, width, height);
+
+ // FIXME: VV: Remove gradient features
using (var gradient = new Cairo.LinearGradient (0, 0, 0, height)) {
color = ColorLerp (
TextViewMargin.DimColor (Editor.ColorStyle.SearchResultMain.Color, 1.1),
@@ -2635,7 +2737,7 @@ namespace Mono.TextEditor
const int TooltipTimeout = 650;
TooltipItem tipItem;
- int tipX, tipY;
+ int tipX, tipY, tipOffset;
uint tipHideTimeoutId = 0;
uint tipShowTimeoutId = 0;
static Gtk.Window tipWindow;
@@ -2695,64 +2797,70 @@ namespace Mono.TextEditor
// If a tooltip is already scheduled, there is no need to create a new timer.
if (tipShowTimeoutId == 0)
- tipShowTimeoutId = GLib.Timeout.Add (TooltipTimeout, TooltipTimer);
+ tipShowTimeoutId = GLib.Timeout.Add (TooltipTimeout, () => { TooltipTimer (); return false; });
}
- bool TooltipTimer ()
+ async void TooltipTimer ()
{
// This timer can't be reused, so reset the var now
tipShowTimeoutId = 0;
-
// Cancelled?
if (nextTipOffset == -1)
- return false;
+ return;
int remainingMs = (int) (nextTipScheduledTime - DateTime.Now).TotalMilliseconds;
if (remainingMs > 50) {
// Still some significant time left. Re-schedule the timer
- tipShowTimeoutId = GLib.Timeout.Add ((uint) remainingMs, TooltipTimer);
- return false;
+ tipShowTimeoutId = GLib.Timeout.Add ((uint) remainingMs, () => { TooltipTimer (); return false; });
+ return;
}
-
+
+ var token = tooltipCancellationSource.Token;
// Find a provider
TooltipProvider provider = null;
TooltipItem item = null;
foreach (TooltipProvider tp in textEditorData.tooltipProviders) {
try {
- item = tp.GetItem (editor, nextTipOffset);
+ item = await tp.GetItem (editor, nextTipOffset, token);
+ } catch (OperationCanceledException) {
} catch (Exception e) {
System.Console.WriteLine ("Exception in tooltip provider " + tp + " GetItem:");
System.Console.WriteLine (e);
}
+ if (token.IsCancellationRequested) {
+ return;
+ }
if (item != null) {
provider = tp;
break;
}
}
-
if (item != null) {
// Tip already being shown for this item?
if (tipWindow != null && tipItem != null && tipItem.Equals (item)) {
CancelScheduledHide ();
- return false;
+ return;
}
tipX = nextTipX;
tipY = nextTipY;
+ tipOffset = nextTipOffset;
tipItem = item;
Gtk.Window tw = null;
try {
- tw = provider.ShowTooltipWindow (editor, nextTipOffset, nextTipModifierState, tipX + (int) TextViewMargin.XOffset, tipY, item);
+ tw = provider.CreateTooltipWindow (editor, nextTipOffset, nextTipModifierState, item);
+ if (tw != null)
+ provider.ShowTooltipWindow (editor, tw, nextTipOffset, nextTipModifierState, tipX + (int) TextViewMargin.XOffset, tipY, item);
} catch (Exception e) {
- Console.WriteLine ("-------- Exception while creating tooltip:");
+ Console.WriteLine ("-------- Exception while creating tooltip: " + provider);
Console.WriteLine (e);
}
if (tw == tipWindow)
- return false;
+ return;
HideTooltip ();
if (tw == null)
- return false;
+ return;
CancelScheduledShow ();
@@ -2762,7 +2870,7 @@ namespace Mono.TextEditor
tipShowTimeoutId = 0;
} else
HideTooltip ();
- return false;
+ return;
}
public void HideTooltip (bool checkMouseOver = true)
@@ -2771,15 +2879,15 @@ namespace Mono.TextEditor
CancelScheduledShow ();
if (tipWindow != null) {
- if (checkMouseOver && tipWindow.GdkWindow != null) {
- // Don't hide the tooltip window if the mouse pointer is inside it.
- int x, y, w, h;
- Gdk.ModifierType m;
- tipWindow.GdkWindow.GetPointer (out x, out y, out m);
- tipWindow.GdkWindow.GetSize (out w, out h);
- if (x >= 0 && y >= 0 && x < w && y < h)
- return;
- }
+// if (checkMouseOver && tipWindow.GdkWindow != null) {
+// // Don't hide the tooltip window if the mouse pointer is inside it.
+// int x, y, w, h;
+// Gdk.ModifierType m;
+// tipWindow.GdkWindow.GetPointer (out x, out y, out m);
+// tipWindow.GdkWindow.GetSize (out w, out h);
+// if (x >= 0 && y >= 0 && x < w && y < h)
+// return;
+// }
tipWindow.Destroy ();
tipWindow = null;
tipItem = null;
@@ -2804,16 +2912,22 @@ namespace Mono.TextEditor
tipHideTimeoutId = 0;
}
}
-
+
+ CancellationTokenSource tooltipCancellationSource = new CancellationTokenSource ();
void CancelScheduledShow ()
{
+ tooltipCancellationSource.Cancel ();
+ tooltipCancellationSource = new CancellationTokenSource ();
// Don't remove the timeout handler since it may be reused
nextTipOffset = -1;
}
- void OnDocumentStateChanged (object s, EventArgs a)
+ void OnDocumentStateChanged (object s, DocumentChangeEventArgs args)
{
HideTooltip ();
+ var start = editor.Document.OffsetToLineNumber (args.Offset);
+ var end = editor.Document.OffsetToLineNumber (args.Offset + args.InsertionLength);
+ editor.Document.CommitMultipleLineUpdate (start, end);
}
void OnTextSet (object sender, EventArgs e)
@@ -3037,12 +3151,12 @@ namespace Mono.TextEditor
class SetCaret
{
- TextEditor view;
+ MonoTextEditor view;
int line, column;
bool highlightCaretLine;
bool centerCaret;
- public SetCaret (TextEditor view, int line, int column, bool highlightCaretLine, bool centerCaret)
+ public SetCaret (MonoTextEditor view, int line, int column, bool highlightCaretLine, bool centerCaret)
{
this.view = view;
this.line = line;
@@ -3112,15 +3226,15 @@ namespace Mono.TextEditor
return Gtk.Widget.GType;
}
- internal List<TextEditor.EditorContainerChild> containerChildren = new List<TextEditor.EditorContainerChild> ();
-
+ internal List<MonoTextEditor.EditorContainerChild> containerChildren = new List<MonoTextEditor.EditorContainerChild> ();
+
public void AddTopLevelWidget (Gtk.Widget widget, int x, int y)
{
widget.Parent = this;
- TextEditor.EditorContainerChild info = new TextEditor.EditorContainerChild (this, widget);
+ MonoTextEditor.EditorContainerChild info = new MonoTextEditor.EditorContainerChild (this, widget);
info.X = x;
info.Y = y;
- var newContainerChildren = new List<TextEditor.EditorContainerChild> (containerChildren);
+ var newContainerChildren = new List<MonoTextEditor.EditorContainerChild> (containerChildren);
newContainerChildren.Add (info);
containerChildren = newContainerChildren;
ResizeChild (Allocation, info);
@@ -3176,7 +3290,7 @@ namespace Mono.TextEditor
protected override void OnRemoved (Widget widget)
{
- var newContainerChildren = new List<TextEditor.EditorContainerChild> (containerChildren);
+ var newContainerChildren = new List<MonoTextEditor.EditorContainerChild> (containerChildren);
foreach (var info in newContainerChildren.ToArray ()) {
if (info.Child == widget) {
widget.Unparent ();
@@ -3212,7 +3326,7 @@ namespace Mono.TextEditor
containerChildren.ForEach (child => child.Child.Unmap ());
}
- void ResizeChild (Rectangle allocation, TextEditor.EditorContainerChild child)
+ void ResizeChild (Rectangle allocation, MonoTextEditor.EditorContainerChild child)
{
Requisition req = child.Child.SizeRequest ();
var childRectangle = new Gdk.Rectangle (child.X, child.Y, req.Width, req.Height);
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextEditor.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextEditor.cs
deleted file mode 100644
index 9c6542011c..0000000000
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextEditor.cs
+++ /dev/null
@@ -1,1255 +0,0 @@
-//
-// TextEditor.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Linq;
-using System.Diagnostics;
-using System.Collections.Generic;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Threading;
-using Mono.TextEditor.Highlighting;
-using Mono.TextEditor.PopupWindow;
-using Mono.TextEditor.Theatrics;
-
-using Gdk;
-using Gtk;
-
-namespace Mono.TextEditor
-{
- [System.ComponentModel.Category("Mono.TextEditor")]
- [System.ComponentModel.ToolboxItem(true)]
- public class TextEditor : Container
- {
- readonly TextArea textArea;
-
- internal LayoutCache LayoutCache {
- get;
- private set;
- }
-
- internal bool IsInKeypress {
- get { return textArea.IsInKeypress; }
- }
-
- public TextArea TextArea {
- get {
- return textArea;
- }
- }
-
- public TextEditor () : this(new TextDocument ())
- {
- }
-
- public TextEditor (TextDocument doc)
- : this (doc, null)
- {
- }
-
- public TextEditor (TextDocument doc, ITextEditorOptions options)
- : this (doc, options, new SimpleEditMode ())
- {
- }
-
- public TextEditor (TextDocument doc, ITextEditorOptions options, EditMode initialMode)
- {
- GtkWorkarounds.FixContainerLeak (this);
- WidgetFlags |= WidgetFlags.NoWindow;
- LayoutCache = new LayoutCache (this);
- this.textArea = new TextArea (doc, options, initialMode);
- this.textArea.Initialize (this, doc, options, initialMode);
- this.textArea.EditorOptionsChanged += (sender, e) => OptionsChanged (sender, e);
- AddTopLevelWidget (textArea, 0, 0);
- ShowAll ();
-
- stage.ActorStep += OnActorStep;
- if (Platform.IsMac) {
- VScroll += delegate {
- for (int i = 1; i < containerChildren.Count; i++) {
- containerChildren[i].Child.QueueDraw ();
- }
- };
- HScroll += delegate {
- for (int i = 1; i < containerChildren.Count; i++) {
- containerChildren[i].Child.QueueDraw ();
- }
- };
- }
- }
-
- public new void GrabFocus ()
- {
- TextArea.GrabFocus ();
- }
-
- protected override void OnDestroyed ()
- {
- base.OnDestroyed ();
- UnregisterAdjustments ();
- LayoutCache.Dispose ();
- }
-
- void UnregisterAdjustments ()
- {
- if (vAdjustement != null)
- vAdjustement.ValueChanged -= HandleAdjustmentValueChange;
- if (hAdjustement != null)
- hAdjustement.ValueChanged -= HandleAdjustmentValueChange;
- vAdjustement = null;
- hAdjustement = null;
- }
-
- Adjustment hAdjustement;
- Adjustment vAdjustement;
- protected override void OnSetScrollAdjustments (Adjustment hAdjustement, Adjustment vAdjustement)
- {
- UnregisterAdjustments ();
- this.vAdjustement = vAdjustement;
- this.hAdjustement = hAdjustement;
- base.OnSetScrollAdjustments (hAdjustement, vAdjustement);
- textArea.SetTextEditorScrollAdjustments (hAdjustement, vAdjustement);
- if (hAdjustement != null) {
- hAdjustement.ValueChanged += HandleAdjustmentValueChange;
- }
-
- if (vAdjustement != null) {
- vAdjustement.ValueChanged += HandleAdjustmentValueChange;
- }
- OnScrollAdjustmentsSet ();
- }
-
- void HandleAdjustmentValueChange (object sender, EventArgs e)
- {
- SetChildrenPositions (Allocation);
- }
-
- protected virtual void OnScrollAdjustmentsSet ()
- {
- }
-
- protected override void OnSizeAllocated (Rectangle allocation)
- {
- base.OnSizeAllocated (allocation);
- CurrentMode.AllocateTextArea (this, textArea, allocation);
- SetChildrenPositions (allocation);
- }
-
- protected override void OnSizeRequested (ref Requisition requisition)
- {
- base.OnSizeRequested (ref requisition);
- containerChildren.ForEach (c => c.Child.SizeRequest ());
- }
-
- #region Container
- public override ContainerChild this [Widget w] {
- get {
- return containerChildren.FirstOrDefault (info => info.Child == w || (info.Child is AnimatedWidget && ((AnimatedWidget)info.Child).Widget == w));
- }
- }
-
- public class EditorContainerChild : Container.ContainerChild
- {
- public int X { get; set; }
- public int Y { get; set; }
- public bool FixedPosition { get; set; }
- public EditorContainerChild (Container parent, Widget child) : base (parent, child)
- {
- }
- }
-
- public override GLib.GType ChildType ()
- {
- return Gtk.Widget.GType;
- }
-
- internal List<EditorContainerChild> containerChildren = new List<EditorContainerChild> ();
-
- public void AddTopLevelWidget (Gtk.Widget widget, int x, int y)
- {
- widget.Parent = this;
- EditorContainerChild info = new EditorContainerChild (this, widget);
- info.X = x;
- info.Y = y;
- containerChildren.Add (info);
- SetAdjustments ();
- }
-
- public void MoveTopLevelWidget (Gtk.Widget widget, int x, int y)
- {
- foreach (EditorContainerChild info in containerChildren.ToArray ()) {
- if (info.Child == widget || (info.Child is AnimatedWidget && ((AnimatedWidget)info.Child).Widget == widget)) {
- if (info.X == x && info.Y == y)
- break;
- info.X = x;
- info.Y = y;
- if (widget.Visible)
- ResizeChild (Allocation, info);
- break;
- }
- }
- }
-
- /// <summary>
- /// Returns the position of an embedded widget
- /// </summary>
- public void GetTopLevelWidgetPosition (Gtk.Widget widget, out int x, out int y)
- {
- foreach (EditorContainerChild info in containerChildren.ToArray ()) {
- if (info.Child == widget || (info.Child is AnimatedWidget && ((AnimatedWidget)info.Child).Widget == widget)) {
- x = info.X;
- y = info.Y;
- return;
- }
- }
- x = y = 0;
- }
-
- public void MoveToTop (Gtk.Widget widget)
- {
- EditorContainerChild editorContainerChild = containerChildren.FirstOrDefault (c => c.Child == widget);
- if (editorContainerChild == null)
- throw new Exception ("child " + widget + " not found.");
- List<EditorContainerChild> newChilds = new List<EditorContainerChild> (containerChildren.Where (child => child != editorContainerChild));
- newChilds.Add (editorContainerChild);
- this.containerChildren = newChilds;
- widget.GdkWindow.Raise ();
- }
-
- protected override void OnAdded (Widget widget)
- {
- AddTopLevelWidget (widget, 0, 0);
- }
-
- protected override void OnRemoved (Widget widget)
- {
- foreach (EditorContainerChild info in containerChildren.ToArray ()) {
- if (info.Child == widget) {
- widget.Unparent ();
- containerChildren.Remove (info);
- break;
- }
- }
- }
-
- protected override void ForAll (bool include_internals, Gtk.Callback callback)
- {
- foreach (var child in containerChildren.ToArray ()) {
- callback (child.Child);
- }
- }
-
- void ResizeChild (Rectangle allocation, EditorContainerChild child)
- {
- Requisition req = child.Child.SizeRequest ();
- var childRectangle = new Gdk.Rectangle (Allocation.X + child.X, Allocation.Y + child.Y, req.Width, req.Height);
- if (!child.FixedPosition) {
- double zoom = Options.Zoom;
- childRectangle.X = Allocation.X + (int)(child.X * zoom - HAdjustment.Value);
- childRectangle.Y = Allocation.Y + (int)(child.Y * zoom - VAdjustment.Value);
- }
- // childRectangle.X += allocation.X;
- // childRectangle.Y += allocation.Y;
- child.Child.SizeAllocate (childRectangle);
- }
-
- void SetChildrenPositions (Rectangle allocation)
- {
- foreach (EditorContainerChild child in containerChildren.ToArray ()) {
- if (child.Child == textArea || child.Child is Mono.TextEditor.Vi.ViStatusArea)
- continue;
- ResizeChild (allocation, child);
- }
- }
- #endregion
-
- #region Animated Widgets
- Stage<AnimatedWidget> stage = new Stage<AnimatedWidget> ();
-
- bool OnActorStep (Actor<AnimatedWidget> actor)
- {
- switch (actor.Target.AnimationState) {
- case AnimationState.Coming:
- actor.Target.QueueDraw ();
- actor.Target.Percent = actor.Percent;
- if (actor.Expired) {
- actor.Target.AnimationState = AnimationState.Idle;
- return false;
- }
- break;
- case AnimationState.IntendingToGo:
- actor.Target.AnimationState = AnimationState.Going;
- actor.Target.Bias = actor.Percent;
- actor.Reset ((uint)(actor.Target.Duration * actor.Percent));
- break;
- case AnimationState.Going:
- if (actor.Expired) {
- this.Remove (actor.Target);
- return false;
- }
- actor.Target.Percent = 1.0 - actor.Percent;
- break;
- }
- return true;
- }
-
- void OnWidgetDestroyed (object sender, EventArgs args)
- {
- RemoveCore ((AnimatedWidget)sender);
- }
-
- void RemoveCore (AnimatedWidget widget)
- {
- RemoveCore (widget, widget.Duration, 0, 0, false, false);
- }
-
- void RemoveCore (AnimatedWidget widget, uint duration, Easing easing, Blocking blocking, bool use_easing, bool use_blocking)
- {
- if (duration > 0)
- widget.Duration = duration;
-
- if (use_easing)
- widget.Easing = easing;
-
- if (use_blocking)
- widget.Blocking = blocking;
-
- if (widget.AnimationState == AnimationState.Coming) {
- widget.AnimationState = AnimationState.IntendingToGo;
- } else {
- if (widget.Easing == Easing.QuadraticIn) {
- widget.Easing = Easing.QuadraticOut;
- } else if (widget.Easing == Easing.QuadraticOut) {
- widget.Easing = Easing.QuadraticIn;
- } else if (widget.Easing == Easing.ExponentialIn) {
- widget.Easing = Easing.ExponentialOut;
- } else if (widget.Easing == Easing.ExponentialOut) {
- widget.Easing = Easing.ExponentialIn;
- }
- widget.AnimationState = AnimationState.Going;
- stage.Add (widget, widget.Duration);
- }
- }
-
- public void AddAnimatedWidget (Widget widget, uint duration, Easing easing, Blocking blocking, int x, int y)
- {
- AnimatedWidget animated_widget = new AnimatedWidget (widget, duration, easing, blocking, false);
- animated_widget.Parent = this;
- animated_widget.WidgetDestroyed += OnWidgetDestroyed;
- stage.Add (animated_widget, duration);
- animated_widget.StartPadding = 0;
- animated_widget.EndPadding = widget.Allocation.Height;
- // animated_widget.Node = animated_widget;
-
- EditorContainerChild info = new EditorContainerChild (this, animated_widget);
- info.X = x;
- info.Y = y;
- info.FixedPosition = true;
- containerChildren.Add (info);
- }
- #endregion
-
- #region TextArea delegation
- public TextDocument Document {
- get {
- return textArea.Document;
- }
- }
-
- public bool IsDisposed {
- get {
- return textArea.IsDisposed;
- }
- }
-
- /// <summary>
- /// Gets or sets a value indicating whether this <see cref="Mono.TextEditor.TextEditor"/> converts tabs to spaces.
- /// It is possible to overwrite the default options value for certain languages (like F#).
- /// </summary>
- /// <value>
- /// <c>true</c> if tabs to spaces should be converted; otherwise, <c>false</c>.
- /// </value>
- public bool TabsToSpaces {
- get {
- return textArea.TabsToSpaces;
- }
- set {
- textArea.TabsToSpaces = value;
- }
- }
-
- public Mono.TextEditor.Caret Caret {
- get {
- return textArea.Caret;
- }
- }
-
- protected internal IMMulticontext IMContext {
- get { return textArea.IMContext; }
- }
-
- public string IMModule {
- get {
- return textArea.IMModule;
- }
- set {
- textArea.IMModule = value;
- }
- }
-
- public ITextEditorOptions Options {
- get {
- return textArea.Options;
- }
- set {
- textArea.Options = value;
- }
- }
-
- public string FileName {
- get {
- return textArea.FileName;
- }
- }
-
- public string MimeType {
- get {
- return textArea.MimeType;
- }
- }
-
- public double LineHeight {
- get {
- return textArea.LineHeight;
- }
- internal set {
- textArea.LineHeight = value;
- }
- }
-
- public TextViewMargin TextViewMargin {
- get {
- return textArea.TextViewMargin;
- }
- }
-
- public ActionMargin ActionMargin {
- get {
- return textArea.ActionMargin;
- }
- }
-
- public Margin IconMargin {
- get { return textArea.IconMargin; }
- }
-
- public DocumentLocation LogicalToVisualLocation (DocumentLocation location)
- {
- return textArea.LogicalToVisualLocation (location);
- }
-
- public DocumentLocation LogicalToVisualLocation (int line, int column)
- {
- return textArea.LogicalToVisualLocation (line, column);
- }
-
- public void CenterToCaret ()
- {
- textArea.CenterToCaret ();
- }
-
- public void CenterTo (int offset)
- {
- textArea.CenterTo (offset);
- }
-
- public void CenterTo (int line, int column)
- {
- textArea.CenterTo (line, column);
- }
-
- public void CenterTo (DocumentLocation p)
- {
- textArea.CenterTo (p);
- }
-
- internal void SmoothScrollTo (double value)
- {
- textArea.SmoothScrollTo (value);
- }
-
- public void ScrollTo (int offset)
- {
- textArea.ScrollTo (offset);
- }
-
- public void ScrollTo (int line, int column)
- {
- textArea.ScrollTo (line, column);
- }
-
- public void ScrollTo (DocumentLocation p)
- {
- textArea.ScrollTo (p);
- }
-
- public void ScrollTo (Gdk.Rectangle rect)
- {
- textArea.ScrollTo (rect);
- }
-
- public void ScrollToCaret ()
- {
- textArea.ScrollToCaret ();
- }
-
- public void TryToResetHorizontalScrollPosition ()
- {
- textArea.TryToResetHorizontalScrollPosition ();
- }
-
- public int GetWidth (string text)
- {
- return textArea.GetWidth (text);
- }
-
- internal void HideMouseCursor ()
- {
- textArea.HideMouseCursor ();
- }
-
- public void ClearTooltipProviders ()
- {
- GetTextEditorData ().ClearTooltipProviders ();
- }
-
- public void AddTooltipProvider (TooltipProvider provider)
- {
- GetTextEditorData ().AddTooltipProvider (provider);
- }
-
- public void RemoveTooltipProvider (TooltipProvider provider)
- {
- GetTextEditorData ().RemoveTooltipProvider (provider);
- }
-
- internal void RedrawMargin (Margin margin)
- {
- textArea.RedrawMargin (margin);
- }
-
- public void RedrawMarginLine (Margin margin, int logicalLine)
- {
- textArea.RedrawMarginLine (margin, logicalLine);
- }
- internal void RedrawPosition (int logicalLine, int logicalColumn)
- {
- textArea.RedrawPosition (logicalLine, logicalColumn);
- }
-
- internal void RedrawLine (int line)
- {
- textArea.RedrawLine (line);
- }
-
- internal void RedrawLines (int start, int end)
- {
- textArea.RedrawLines (start, end);
- }
-
- internal string preeditString {
- get {
- return textArea.preeditString;
- }
- }
-
- internal int preeditOffset {
- get {
- return textArea.preeditOffset;
- }
- }
-
- internal int preeditCursorCharIndex {
- get {
- return textArea.preeditCursorCharIndex;
- }
- }
-
- internal Pango.AttrList preeditAttrs {
- get {
- return textArea.preeditAttrs;
- }
- }
-
- internal bool UpdatePreeditLineHeight ()
- {
- return textArea.UpdatePreeditLineHeight ();
- }
-
- internal void ResetIMContext ()
- {
- textArea.ResetIMContext ();
- }
-
- internal bool ContainsPreedit (int offset, int length)
- {
- return textArea.ContainsPreedit (offset, length);
- }
-
- internal void FireLinkEvent (string link, uint button, ModifierType modifierState)
- {
- textArea.FireLinkEvent (link, button, modifierState);
- }
-
- internal void RequestResetCaretBlink ()
- {
- textArea.RequestResetCaretBlink ();
- }
-
- internal void SetAdjustments ()
- {
- textArea.SetAdjustments ();
- }
-
- public bool IsInDrag {
- get {
- return textArea.IsInDrag;
- }
- }
-
- public event EventHandler VScroll {
- add { textArea.VScroll += value; }
- remove { textArea.VScroll -= value; }
- }
-
- public event EventHandler HScroll {
- add { textArea.HScroll += value; }
- remove { textArea.HScroll -= value; }
- }
-
- #endregion
-
- #region TextEditorData delegation
- public string EolMarker {
- get {
- return textArea.EolMarker;
- }
- }
-
- public Mono.TextEditor.Highlighting.ColorScheme ColorStyle {
- get {
- return textArea.ColorStyle;
- }
- }
-
- public EditMode CurrentMode {
- get {
- return textArea.CurrentMode;
- }
- set {
- textArea.CurrentMode = value;
- }
- }
-
- public bool IsSomethingSelected {
- get {
- return textArea.IsSomethingSelected;
- }
- }
-
- public Selection MainSelection {
- get {
- return textArea.MainSelection;
- }
- set {
- textArea.MainSelection = value;
- }
- }
-
- public SelectionMode SelectionMode {
- get {
- return textArea.SelectionMode;
- }
- set {
- textArea.SelectionMode = value;
- }
- }
-
- public TextSegment SelectionRange {
- get {
- return textArea.SelectionRange;
- }
- set {
- textArea.SelectionRange = value;
- }
- }
-
- public string SelectedText {
- get {
- return textArea.SelectedText;
- }
- set {
- textArea.SelectedText = value;
- }
- }
-
- public int SelectionAnchor {
- get {
- return textArea.SelectionAnchor;
- }
- set {
- textArea.SelectionAnchor = value;
- }
- }
-
- public IEnumerable<DocumentLine> SelectedLines {
- get {
- return textArea.SelectedLines;
- }
- }
-
- public Adjustment HAdjustment {
- get {
- return textArea.HAdjustment;
- }
- }
-
- public Adjustment VAdjustment {
- get {
- return textArea.VAdjustment;
- }
- }
-
- public int Insert (int offset, string value)
- {
- return textArea.Insert (offset, value);
- }
-
- public void Remove (DocumentRegion region)
- {
- textArea.Remove (region);
- }
-
- public void Remove (TextSegment removeSegment)
- {
- textArea.Remove (removeSegment);
- }
-
- public void Remove (int offset, int count)
- {
- textArea.Remove (offset, count);
- }
-
- public int Replace (int offset, int count, string value)
- {
- return textArea.Replace (offset, count, value);
- }
-
- public void ClearSelection ()
- {
- textArea.ClearSelection ();
- }
-
- public void DeleteSelectedText ()
- {
- textArea.DeleteSelectedText ();
- }
-
- public void DeleteSelectedText (bool clearSelection)
- {
- textArea.DeleteSelectedText (clearSelection);
- }
-
- public void RunEditAction (Action<TextEditorData> action)
- {
- action (GetTextEditorData ());
- }
-
- public void SetSelection (int anchorOffset, int leadOffset)
- {
- textArea.SetSelection (anchorOffset, leadOffset);
- }
-
- public void SetSelection (DocumentLocation anchor, DocumentLocation lead)
- {
- textArea.SetSelection (anchor, lead);
- }
-
- public void SetSelection (int anchorLine, int anchorColumn, int leadLine, int leadColumn)
- {
- textArea.SetSelection (anchorLine, anchorColumn, leadLine, leadColumn);
- }
-
- public void ExtendSelectionTo (DocumentLocation location)
- {
- textArea.ExtendSelectionTo (location);
- }
- public void ExtendSelectionTo (int offset)
- {
- textArea.ExtendSelectionTo (offset);
- }
- public void SetSelectLines (int from, int to)
- {
- textArea.SetSelectLines (from, to);
- }
-
- public void InsertAtCaret (string text)
- {
- textArea.InsertAtCaret (text);
- }
-
- public bool CanEdit (int line)
- {
- return textArea.CanEdit (line);
- }
-
- public string GetLineText (int line)
- {
- return textArea.GetLineText (line);
- }
-
- public string GetLineText (int line, bool includeDelimiter)
- {
- return textArea.GetLineText (line, includeDelimiter);
- }
-
- /// <summary>
- /// Use with care.
- /// </summary>
- /// <returns>
- /// A <see cref="TextEditorData"/>
- /// </returns>
- public TextEditorData GetTextEditorData ()
- {
- return textArea.GetTextEditorData ();
- }
-
- /// <remarks>
- /// The Key may be null if it has been handled by the IMContext. In such cases, the char is the value.
- /// </remarks>
- protected internal virtual bool OnIMProcessedKeyPressEvent (Gdk.Key key, uint ch, Gdk.ModifierType state)
- {
- SimulateKeyPress (key, ch, state);
- return true;
- }
-
- public void SimulateKeyPress (Gdk.Key key, uint unicodeChar, ModifierType modifier)
- {
- textArea.SimulateKeyPress (key, unicodeChar, modifier);
- }
-
-
- public void RunAction (Action<TextEditorData> action)
- {
- try {
- action (GetTextEditorData ());
- } catch (Exception e) {
- if (Debugger.IsAttached)
- Debugger.Break ();
- //TODO: we should really find a way to log this properly
- Console.WriteLine ("Error while executing " + action + " :" + e);
- }
- }
-
- public void HideTooltip (bool checkMouseOver = true)
- {
- textArea.HideTooltip (checkMouseOver);
- }
- public Action<Gdk.EventButton> DoPopupMenu {
- get {
- return textArea.DoPopupMenu;
- }
- set {
- textArea.DoPopupMenu = value;
- }
- }
-
- public MenuItem CreateInputMethodMenuItem (string label)
- {
- return textArea.CreateInputMethodMenuItem (label);
- }
-
- public event EventHandler SelectionChanged {
- add { textArea.SelectionChanged += value; }
- remove { textArea.SelectionChanged -= value; }
- }
-
- public void CaretToDragCaretPosition ()
- {
- textArea.CaretToDragCaretPosition ();
- }
-
- public event EventHandler<PaintEventArgs> Painted {
- add { textArea.Painted += value; }
- remove { textArea.Painted -= value; }
- }
-
- public event EventHandler<LinkEventArgs> LinkRequest {
- add { textArea.LinkRequest += value; }
- remove { textArea.LinkRequest -= value; }
- }
-
- public void ShowListWindow<T> (ListWindow<T> window, DocumentLocation loc)
- {
- textArea.ShowListWindow<T> (window, loc);
- }
-
- public Margin LockedMargin {
- get {
- return textArea.LockedMargin;
- }
- set {
- textArea.LockedMargin = value;
- }
- }
- #endregion
-
- #region Document delegation
-
- public event EventHandler EditorOptionsChanged {
- add { textArea.EditorOptionsChanged += value; }
- remove { textArea.EditorOptionsChanged -= value; }
- }
-
- protected virtual void OptionsChanged (object sender, EventArgs args)
- {
- }
-
- public int Length {
- get {
- return Document.TextLength;
- }
- }
-
- public string Text {
- get {
- return Document.Text;
- }
- set {
- Document.Text = value;
- }
- }
-
- public string GetTextBetween (int startOffset, int endOffset)
- {
- return Document.GetTextBetween (startOffset, endOffset);
- }
-
- public string GetTextBetween (DocumentLocation start, DocumentLocation end)
- {
- return Document.GetTextBetween (start, end);
- }
-
- public string GetTextBetween (int startLine, int startColumn, int endLine, int endColumn)
- {
- return Document.GetTextBetween (startLine, startColumn, endLine, endColumn);
- }
-
- public string GetTextAt (int offset, int count)
- {
- return Document.GetTextAt (offset, count);
- }
-
- public string GetTextAt (TextSegment segment)
- {
- return Document.GetTextAt (segment);
- }
-
- public string GetTextAt (DocumentRegion region)
- {
- return Document.GetTextAt (region);
- }
-
- public char GetCharAt (int offset)
- {
- return Document.GetCharAt (offset);
- }
-
- public IEnumerable<DocumentLine> Lines {
- get {
- return Document.Lines;
- }
- }
-
- public int LineCount {
- get {
- return Document.LineCount;
- }
- }
-
- public int LocationToOffset (int line, int column)
- {
- return Document.LocationToOffset (line, column);
- }
-
- public int LocationToOffset (DocumentLocation location)
- {
- return Document.LocationToOffset (location);
- }
-
- public DocumentLocation OffsetToLocation (int offset)
- {
- return Document.OffsetToLocation (offset);
- }
-
- public string GetLineIndent (int lineNumber)
- {
- return Document.GetLineIndent (lineNumber);
- }
-
- public string GetLineIndent (DocumentLine segment)
- {
- return Document.GetLineIndent (segment);
- }
-
- public DocumentLine GetLine (int lineNumber)
- {
- return Document.GetLine (lineNumber);
- }
-
- public DocumentLine GetLineByOffset (int offset)
- {
- return Document.GetLineByOffset (offset);
- }
-
- public int OffsetToLineNumber (int offset)
- {
- return Document.OffsetToLineNumber (offset);
- }
-
- public IDisposable OpenUndoGroup()
- {
- return Document.OpenUndoGroup ();
- }
-#endregion
-
- #region Search & Replace
- public string SearchPattern {
- get {
- return textArea.SearchPattern;
- }
- set {
- textArea.SearchPattern = value;
- }
- }
-
- public ISearchEngine SearchEngine {
- get {
- return textArea.SearchEngine;
- }
- set {
- textArea.SearchEngine = value;
- }
- }
-
- public event EventHandler HighlightSearchPatternChanged {
- add { textArea.HighlightSearchPatternChanged += value; }
- remove { textArea.HighlightSearchPatternChanged -= value; }
- }
-
- public bool HighlightSearchPattern {
- get {
- return textArea.HighlightSearchPattern;
- }
- set {
- textArea.HighlightSearchPattern = value;
- }
- }
-
- public bool IsCaseSensitive {
- get {
- return textArea.IsCaseSensitive;
- }
- set {
- textArea.IsCaseSensitive = value;
- }
- }
-
- public bool IsWholeWordOnly {
- get {
- return textArea.IsWholeWordOnly;
- }
-
- set {
- textArea.IsWholeWordOnly = value;
- }
- }
-
- public TextSegment SearchRegion {
- get {
- return textArea.SearchRegion;
- }
-
- set {
- textArea.SearchRegion = value;
- }
- }
-
- public SearchResult SearchForward (int fromOffset)
- {
- return textArea.SearchForward (fromOffset);
- }
-
- public SearchResult SearchBackward (int fromOffset)
- {
- return textArea.SearchBackward (fromOffset);
- }
-
- /// <summary>
- /// Initiate a pulse at the specified document location
- /// </summary>
- /// <param name="pulseStart">
- /// A <see cref="DocumentLocation"/>
- /// </param>
- public void PulseCharacter (DocumentLocation pulseStart)
- {
- textArea.PulseCharacter (pulseStart);
- }
-
-
- public SearchResult FindNext (bool setSelection)
- {
- return textArea.FindNext (setSelection);
- }
-
- public void StartCaretPulseAnimation ()
- {
- textArea.StartCaretPulseAnimation ();
- }
-
- public void StopSearchResultAnimation ()
- {
- textArea.StopSearchResultAnimation ();
- }
-
- public void AnimateSearchResult (SearchResult result)
- {
- textArea.AnimateSearchResult (result);
- }
-
- public SearchResult FindPrevious (bool setSelection)
- {
- return textArea.FindPrevious (setSelection);
- }
-
- public bool Replace (string withPattern)
- {
- return textArea.Replace (withPattern);
- }
-
- public int ReplaceAll (string withPattern)
- {
- return textArea.ReplaceAll (withPattern);
- }
- #endregion
-
- #region Coordinate transformation
- public DocumentLocation PointToLocation (double xp, double yp)
- {
- return TextViewMargin.PointToLocation (xp, yp);
- }
-
- public DocumentLocation PointToLocation (Cairo.Point p)
- {
- return TextViewMargin.PointToLocation (p);
- }
-
- public DocumentLocation PointToLocation (Cairo.PointD p)
- {
- return TextViewMargin.PointToLocation (p);
- }
-
- public Cairo.Point LocationToPoint (DocumentLocation loc)
- {
- return TextViewMargin.LocationToPoint (loc);
- }
-
- public Cairo.Point LocationToPoint (int line, int column)
- {
- return TextViewMargin.LocationToPoint (line, column);
- }
-
- public Cairo.Point LocationToPoint (int line, int column, bool useAbsoluteCoordinates)
- {
- return TextViewMargin.LocationToPoint (line, column, useAbsoluteCoordinates);
- }
-
- public Cairo.Point LocationToPoint (DocumentLocation loc, bool useAbsoluteCoordinates)
- {
- return TextViewMargin.LocationToPoint (loc, useAbsoluteCoordinates);
- }
-
- public double ColumnToX (DocumentLine line, int column)
- {
- return TextViewMargin.ColumnToX (line, column);
- }
-
- /// <summary>
- /// Calculates the line number at line start (in one visual line could be several logical lines be displayed).
- /// </summary>
- public int YToLine (double yPos)
- {
- return TextViewMargin.YToLine (yPos);
- }
-
- public double LineToY (int logicalLine)
- {
- return TextViewMargin.LineToY (logicalLine);
- }
-
- public double GetLineHeight (DocumentLine line)
- {
- return TextViewMargin.GetLineHeight (line);
- }
-
- public double GetLineHeight (int logicalLineNumber)
- {
- return TextViewMargin.GetLineHeight (logicalLineNumber);
- }
- #endregion
-
-
- public void SetCaretTo (int line, int column)
- {
- textArea.SetCaretTo (line, column);
- }
-
- public void SetCaretTo (int line, int column, bool highlight)
- {
- textArea.SetCaretTo (line, column, highlight);
- }
-
- public void SetCaretTo (int line, int column, bool highlight, bool centerCaret)
- {
- textArea.SetCaretTo (line, column, highlight, centerCaret);
- }
- public event EventHandler BeginHover {
- add { textArea.BeginHover += value; }
- remove { textArea.BeginHover -= value; }
- }
-
- }
-}
-
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs
index b3dafffb02..ca73502970 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs
@@ -37,20 +37,20 @@ using Gdk;
using Gtk;
using System.Timers;
using ICSharpCode.NRefactory;
+using System.Diagnostics;
namespace Mono.TextEditor
{
public class TextViewMargin : Margin
{
- readonly TextEditor textEditor;
+ readonly MonoTextEditor textEditor;
Pango.TabArray tabArray;
Pango.Layout markerLayout, defaultLayout;
Pango.Layout[] eolMarkerLayout;
Pango.Rectangle[] eolMarkerLayoutRect;
internal double charWidth;
- int highlightBracketOffset = -1;
-
+
double LineHeight {
get {
return textEditor.LineHeight;
@@ -120,7 +120,7 @@ namespace Mono.TextEditor
}
- public TextViewMargin (TextEditor textEditor)
+ public TextViewMargin (MonoTextEditor textEditor)
{
if (textEditor == null)
throw new ArgumentNullException ("textEditor");
@@ -128,25 +128,23 @@ namespace Mono.TextEditor
textEditor.Document.TextReplaced += HandleTextReplaced;
base.cursor = xtermCursor;
- textEditor.HighlightSearchPatternChanged += delegate {
- selectedRegions.Clear ();
- RefreshSearchMarker ();
- };
+ textEditor.HighlightSearchPatternChanged += TextEditor_HighlightSearchPatternChanged;
textEditor.Document.LineChanged += TextEditorDocumentLineChanged;
textEditor.GetTextEditorData ().SearchChanged += HandleSearchChanged;
markerLayout = PangoUtil.CreateLayout (textEditor);
defaultLayout = PangoUtil.CreateLayout (textEditor);
- textEditor.Document.EndUndo += HandleEndUndo;
- textEditor.SelectionChanged += UpdateBracketHighlighting;
- textEditor.Document.Undone += HandleUndone;
- textEditor.Document.Redone += HandleUndone;
textEditor.TextArea.FocusInEvent += HandleFocusInEvent;
textEditor.TextArea.FocusOutEvent += HandleFocusOutEvent;
- Caret.PositionChanged += UpdateBracketHighlighting;
textEditor.VScroll += HandleVAdjustmentValueChanged;
}
+ void TextEditor_HighlightSearchPatternChanged (object sender, EventArgs e)
+ {
+ selectedRegions.Clear ();
+ RefreshSearchMarker ();
+ }
+
void HandleFocusInEvent (object o, FocusInEventArgs args)
{
selectionColor = ColorStyle.SelectedText;
@@ -159,17 +157,6 @@ namespace Mono.TextEditor
currentLineColor = ColorStyle.LineMarkerInactive;
}
- void HandleUndone (object sender, EventArgs e)
- {
- UpdateBracketHighlighting (this, EventArgs.Empty);
- }
-
- void HandleEndUndo (object sender, EventArgs e)
- {
- if (!textEditor.Document.IsInAtomicUndo)
- UpdateBracketHighlighting (this, EventArgs.Empty);
- }
-
void HandleTextReplaced (object sender, DocumentChangeEventArgs e)
{
RemoveCachedLine (Document.GetLineByOffset (e.Offset));
@@ -353,89 +340,9 @@ namespace Mono.TextEditor
}
System.ComponentModel.BackgroundWorker searchPatternWorker;
- System.ComponentModel.BackgroundWorker highlightBracketWorker;
Gdk.Cursor xtermCursor = new Gdk.Cursor (Gdk.CursorType.Xterm);
Gdk.Cursor textLinkCursor = new Gdk.Cursor (Gdk.CursorType.Hand1);
- void UpdateBracketHighlighting (object sender, EventArgs e)
- {
- HighlightCaretLine = false;
-
- if (!textEditor.Options.HighlightMatchingBracket || textEditor.IsSomethingSelected) {
- if (highlightBracketOffset >= 0) {
- textEditor.RedrawLine (Document.OffsetToLineNumber (highlightBracketOffset));
- highlightBracketOffset = -1;
- }
- return;
- }
-
- int offset = Caret.Offset - 1;
- if (Caret.Mode != CaretMode.Insert || (offset >= 0 && offset < Document.TextLength && !TextDocument.IsBracket (Document.GetCharAt (offset))))
- offset++;
- offset = System.Math.Max (0, offset);
- if (highlightBracketOffset >= 0 && (offset >= Document.TextLength || !TextDocument.IsBracket (Document.GetCharAt (offset)))) {
- int old = highlightBracketOffset;
- highlightBracketOffset = -1;
- if (old >= 0)
- textEditor.RedrawLine (Document.OffsetToLineNumber (old));
- return;
- }
- if (offset < 0)
- offset = 0;
-
- DisposeHighightBackgroundWorker ();
-
- highlightBracketWorker = new System.ComponentModel.BackgroundWorker ();
- highlightBracketWorker.WorkerSupportsCancellation = true;
- highlightBracketWorker.DoWork += HighlightBracketWorkerDoWork;
- highlightBracketWorker.RunWorkerAsync (offset);
- }
-
- void HighlightBracketWorkerDoWork (object sender, System.ComponentModel.DoWorkEventArgs e)
- {
- System.ComponentModel.BackgroundWorker worker = (System.ComponentModel.BackgroundWorker)sender;
- int offset = (int)e.Argument;
- int oldIndex = highlightBracketOffset;
- int caretOffset = Caret.Offset;
- int matchingBracket;
- matchingBracket = Document.GetMatchingBracketOffset (worker, offset);
- if (worker.CancellationPending)
- return;
- if (matchingBracket == caretOffset && offset + 1 < Document.TextLength)
- matchingBracket = Document.GetMatchingBracketOffset (worker, offset + 1);
- if (worker.CancellationPending)
- return;
- if (matchingBracket == caretOffset)
- matchingBracket = -1;
- if (matchingBracket != oldIndex) {
- int line1 = oldIndex >= 0 ? Document.OffsetToLineNumber (oldIndex) : -1;
- int line2 = matchingBracket >= 0 ? Document.OffsetToLineNumber (matchingBracket) : -1;
- //DocumentLocation matchingBracketLocation = Document.OffsetToLocation (matchingBracket);
- if (worker.CancellationPending)
- return;
- highlightBracketOffset = matchingBracket;
- Application.Invoke (delegate {
- if (textEditor.IsDisposed)
- return;
- if (line1 >= 0)
- textEditor.RedrawLine (line1);
- if (line1 != line2 && line2 >= 0)
- textEditor.RedrawLine (line2);
- });
- }
- }
-
- void DisposeHighightBackgroundWorker ()
- {
- if (highlightBracketWorker == null)
- return;
- if (highlightBracketWorker.IsBusy)
- highlightBracketWorker.CancelAsync ();
- highlightBracketWorker.DoWork -= HighlightBracketWorkerDoWork;
- highlightBracketWorker.Dispose ();
- highlightBracketWorker = null;
- }
-
static readonly string[] markerTexts = {
"<EOF>",
"\\n",
@@ -520,10 +427,6 @@ namespace Mono.TextEditor
eolMarkerLayoutRect [i] = tRect;
}
- DecorateLineBg -= DecorateMatchingBracket;
- if (textEditor.Options.HighlightMatchingBracket && !Document.ReadOnly)
- DecorateLineBg += DecorateMatchingBracket;
-
if (tabArray != null) {
tabArray.Dispose ();
tabArray = null;
@@ -554,19 +457,15 @@ namespace Mono.TextEditor
{
CancelCodeSegmentTooltip ();
StopCaretThread ();
- DisposeHighightBackgroundWorker ();
DisposeSearchPatternWorker ();
-
+ HideCodeSegmentPreviewWindow ();
+ textEditor.VScroll -= HandleVAdjustmentValueChanged;
+ textEditor.HighlightSearchPatternChanged -= TextEditor_HighlightSearchPatternChanged;
+
textEditor.Document.TextReplaced -= HandleTextReplaced;
textEditor.Document.LineChanged -= TextEditorDocumentLineChanged;
- textEditor.Document.EndUndo -= HandleEndUndo;
- textEditor.Document.Undone -= HandleUndone;
- textEditor.Document.Redone -= HandleUndone;
-
- textEditor.Document.EndUndo -= UpdateBracketHighlighting;
textEditor.TextArea.FocusInEvent -= HandleFocusInEvent;
textEditor.TextArea.FocusOutEvent -= HandleFocusOutEvent;
- Caret.PositionChanged -= UpdateBracketHighlighting;
textEditor.GetTextEditorData ().SearchChanged -= HandleSearchChanged;
@@ -897,6 +796,7 @@ namespace Mono.TextEditor
public LayoutWrapper CreateLinePartLayout (ISyntaxMode mode, DocumentLine line, int logicalRulerColumn, int offset, int length, int selectionStart, int selectionEnd)
{
+ textEditor.CheckUIThread ();
bool containsPreedit = textEditor.ContainsPreedit (offset, length);
LayoutDescriptor descriptor;
if (!containsPreedit && layoutDict.TryGetValue (line, out descriptor)) {
@@ -921,7 +821,7 @@ namespace Mono.TextEditor
}
StringBuilder textBuilder = new StringBuilder ();
var chunks = GetCachedChunks (mode, Document, textEditor.ColorStyle, line, offset, length);
- var markers = Document.GetTextSegmentMarkersAt (line).Where (m => m.IsVisible).ToArray ();
+ var markers = TextDocument.OrderTextSegmentMarkersByInsertion (Document.GetTextSegmentMarkersAt (line).Where (m => m.IsVisible)).ToArray ();
foreach (var marker in markers) {
var chunkMarker = marker as IChunkMarker;
if (chunkMarker == null)
@@ -955,150 +855,185 @@ namespace Mono.TextEditor
uint curChunkIndex = 0, byteChunkIndex = 0;
uint oldEndIndex = 0;
- foreach (Chunk chunk in chunks) {
- ChunkStyle chunkStyle = chunk != null ? textEditor.ColorStyle.GetChunkStyle (chunk) : null;
- foreach (TextLineMarker marker in line.Markers)
- chunkStyle = marker.GetStyle (chunkStyle);
-
- if (chunkStyle != null) {
- //startOffset = chunk.Offset;
- //endOffset = chunk.EndOffset;
-
- uint startIndex = (uint)(oldEndIndex);
- uint endIndex = (uint)(startIndex + chunk.Length);
- oldEndIndex = endIndex;
- HandleSelection (lineOffset, logicalRulerColumn, selectionStart, selectionEnd, chunk.Offset, chunk.EndOffset, delegate(int start, int end) {
- if (containsPreedit) {
- if (textEditor.preeditOffset < start)
- start += (int)preeditLength;
- if (textEditor.preeditOffset < end)
- end += (int)preeditLength;
- }
- var si = TranslateToUTF8Index (lineChars, (uint)(startIndex + start - chunk.Offset), ref curIndex, ref byteIndex);
- var ei = TranslateToUTF8Index (lineChars, (uint)(startIndex + end - chunk.Offset), ref curIndex, ref byteIndex);
- var color = ColorStyle.GetForeground (chunkStyle);
- foreach (var marker in markers) {
- var chunkMarker = marker as IChunkMarker;
- if (chunkMarker == null)
- continue;
- chunkMarker.ChangeForeColor (textEditor, chunk, ref color);
- }
- atts.AddForegroundAttribute ((HslColor)color, si, ei);
-
- if (!chunkStyle.TransparentBackground && GetPixel (ColorStyle.PlainText.Background) != GetPixel (chunkStyle.Background)) {
- wrapper.AddBackground (chunkStyle.Background, (int)si, (int)ei);
- } else if (chunk.SpanStack != null && ColorStyle != null) {
- foreach (var span in chunk.SpanStack) {
- if (span == null || string.IsNullOrEmpty (span.Color))
+ bool disableHighlighting = false;
+ var sw = new Stopwatch ();
+ sw.Start ();
+ try {
+ restart:
+ foreach (Chunk chunk in chunks) {
+ if (!disableHighlighting && sw.ElapsedMilliseconds > 50) {
+ chunks.Clear ();
+ chunks.Add (new Chunk (line.Offset, line.Length, "Plain Text"));
+ disableHighlighting = true;
+ atts.Dispose ();
+ atts = new FastPangoAttrList ();
+ curIndex = byteIndex = 0;
+ curChunkIndex = byteChunkIndex = 0;
+ oldEndIndex = 0;
+ goto restart;
+ }
+ ChunkStyle chunkStyle = chunk != null ? textEditor.ColorStyle.GetChunkStyle (chunk) : null;
+ foreach (TextLineMarker marker in line.Markers)
+ chunkStyle = marker.GetStyle (chunkStyle);
+
+ if (chunkStyle != null) {
+ //startOffset = chunk.Offset;
+ //endOffset = chunk.EndOffset;
+
+ uint startIndex = (uint)(oldEndIndex);
+ uint endIndex = (uint)(startIndex + chunk.Length);
+ oldEndIndex = endIndex;
+ HandleSelection (lineOffset, logicalRulerColumn, selectionStart, selectionEnd, chunk.Offset, chunk.EndOffset, delegate (int start, int end) {
+ if (containsPreedit) {
+ if (textEditor.preeditOffset < start)
+ start += (int)preeditLength;
+ if (textEditor.preeditOffset < end)
+ end += (int)preeditLength;
+ }
+ var si = TranslateToUTF8Index (lineChars, (uint)(startIndex + start - chunk.Offset), ref curIndex, ref byteIndex);
+ var ei = TranslateToUTF8Index (lineChars, (uint)(startIndex + end - chunk.Offset), ref curIndex, ref byteIndex);
+ var color = ColorStyle.GetForeground (chunkStyle);
+ foreach (var marker in markers) {
+ var chunkMarker = marker as IChunkMarker;
+ if (chunkMarker == null)
continue;
- var spanStyle = ColorStyle.GetChunkStyle (span.Color);
- if (spanStyle != null && !spanStyle.TransparentBackground && GetPixel (ColorStyle.PlainText.Background) != GetPixel (spanStyle.Background)) {
- wrapper.AddBackground (spanStyle.Background, (int)si, (int)ei);
- break;
+ chunkMarker.ChangeForeColor (textEditor, chunk, ref color);
+ }
+ atts.AddForegroundAttribute ((HslColor)color, si, ei);
+
+ if (!chunkStyle.TransparentBackground && GetPixel (ColorStyle.PlainText.Background) != GetPixel (chunkStyle.Background)) {
+ wrapper.AddBackground (chunkStyle.Background, (int)si, (int)ei);
+ } else if (chunk.SpanStack != null && ColorStyle != null) {
+ foreach (var span in chunk.SpanStack) {
+ if (span == null || string.IsNullOrEmpty (span.Color))
+ continue;
+ var spanStyle = ColorStyle.GetChunkStyle (span.Color);
+ if (spanStyle != null && !spanStyle.TransparentBackground && GetPixel (ColorStyle.PlainText.Background) != GetPixel (spanStyle.Background)) {
+ wrapper.AddBackground (spanStyle.Background, (int)si, (int)ei);
+ break;
+ }
}
}
- }
- }, delegate(int start, int end) {
- if (containsPreedit) {
- if (textEditor.preeditOffset < start)
- start += (int)preeditLength;
- if (textEditor.preeditOffset < end)
- end += (int)preeditLength;
- }
- var si = TranslateToUTF8Index (lineChars, (uint)(startIndex + start - chunk.Offset), ref curIndex, ref byteIndex);
- var ei = TranslateToUTF8Index (lineChars, (uint)(startIndex + end - chunk.Offset), ref curIndex, ref byteIndex);
- var color = !SelectionColor.TransparentForeground ? SelectionColor.Foreground : ColorStyle.GetForeground (chunkStyle);
- foreach (var marker in markers) {
- var chunkMarker = marker as IChunkMarker;
- if (chunkMarker == null)
- continue;
- chunkMarker.ChangeForeColor (textEditor, chunk, ref color);
- }
- atts.AddForegroundAttribute ((HslColor)color, si, ei);
- if (!wrapper.StartSet)
- wrapper.SelectionStartIndex = (int)si;
- wrapper.SelectionEndIndex = (int)ei;
- });
+ }, delegate (int start, int end) {
+ if (containsPreedit) {
+ if (textEditor.preeditOffset < start)
+ start += (int)preeditLength;
+ if (textEditor.preeditOffset < end)
+ end += (int)preeditLength;
+ }
+ var si = TranslateToUTF8Index (lineChars, (uint)(startIndex + start - chunk.Offset), ref curIndex, ref byteIndex);
+ var ei = TranslateToUTF8Index (lineChars, (uint)(startIndex + end - chunk.Offset), ref curIndex, ref byteIndex);
+ var color = !SelectionColor.TransparentForeground ? SelectionColor.Foreground : ColorStyle.GetForeground (chunkStyle);
+ foreach (var marker in markers) {
+ var chunkMarker = marker as IChunkMarker;
+ if (chunkMarker == null)
+ continue;
+ chunkMarker.ChangeForeColor (textEditor, chunk, ref color);
+ }
+ atts.AddForegroundAttribute ((HslColor)color, si, ei);
+ if (!wrapper.StartSet)
+ wrapper.SelectionStartIndex = (int)si;
+ wrapper.SelectionEndIndex = (int)ei;
+ });
- var translatedStartIndex = TranslateToUTF8Index (lineChars, (uint)startIndex, ref curChunkIndex, ref byteChunkIndex);
- var translatedEndIndex = TranslateToUTF8Index (lineChars, (uint)endIndex, ref curChunkIndex, ref byteChunkIndex);
+ var translatedStartIndex = TranslateToUTF8Index (lineChars, (uint)startIndex, ref curChunkIndex, ref byteChunkIndex);
+ var translatedEndIndex = TranslateToUTF8Index (lineChars, (uint)endIndex, ref curChunkIndex, ref byteChunkIndex);
- if (chunkStyle.FontWeight != Xwt.Drawing.FontWeight.Normal)
- atts.AddWeightAttribute ((Pango.Weight)chunkStyle.FontWeight, translatedStartIndex, translatedEndIndex);
+ if (chunkStyle.FontWeight != Xwt.Drawing.FontWeight.Normal)
+ atts.AddWeightAttribute ((Pango.Weight)chunkStyle.FontWeight, translatedStartIndex, translatedEndIndex);
- if (chunkStyle.FontStyle != Xwt.Drawing.FontStyle.Normal)
- atts.AddStyleAttribute ((Pango.Style)chunkStyle.FontStyle, translatedStartIndex, translatedEndIndex);
+ if (chunkStyle.FontStyle != Xwt.Drawing.FontStyle.Normal)
+ atts.AddStyleAttribute ((Pango.Style)chunkStyle.FontStyle, translatedStartIndex, translatedEndIndex);
- if (chunkStyle.Underline)
- atts.AddUnderlineAttribute (Pango.Underline.Single, translatedStartIndex, translatedEndIndex);
+ if (chunkStyle.Underline)
+ atts.AddUnderlineAttribute (Pango.Underline.Single, translatedStartIndex, translatedEndIndex);
+ }
}
- }
- if (containsPreedit) {
- var si = TranslateToUTF8Index (lineChars, (uint)(textEditor.preeditOffset - offset), ref curIndex, ref byteIndex);
- var ei = TranslateToUTF8Index (lineChars, (uint)(textEditor.preeditOffset - offset + preeditLength), ref curIndex, ref byteIndex);
+ if (containsPreedit) {
+ var si = TranslateToUTF8Index (lineChars, (uint)(textEditor.preeditOffset - offset), ref curIndex, ref byteIndex);
+ var ei = TranslateToUTF8Index (lineChars, (uint)(textEditor.preeditOffset - offset + preeditLength), ref curIndex, ref byteIndex);
- if (textEditor.GetTextEditorData ().IsCaretInVirtualLocation) {
- uint len = (uint)textEditor.GetTextEditorData ().GetIndentationString (textEditor.Caret.Location).Length;
- si += len;
- ei += len;
- }
-
- atts.AddForegroundAttribute ((HslColor)ColorStyle.PlainText.Foreground, si, ei);
- var hasBackground = wrapper.BackgroundColors.Any (bg => bg.FromIdx <= si && bg.ToIdx >= ei);
- if (hasBackground)
- atts.AddBackgroundAttribute ((HslColor)ColorStyle.PlainText.Background, si, ei);
- atts.InsertOffsetList (textEditor.preeditAttrs, si, ei);
- }
- wrapper.LineChars = lineChars;
- wrapper.Layout.SetText (lineText);
- wrapper.IndentSize = 0;
- var tabSize = textEditor.Options != null ? textEditor.Options.TabSize : 4;
- for (int i = 0; i < lineChars.Length; i++) {
- char ch = lineChars [i];
- if (ch == ' ') {
- wrapper.IndentSize ++;
- } else if (ch == '\t') {
- wrapper.IndentSize = GetNextTabstop (textEditor.GetTextEditorData (), wrapper.IndentSize, tabSize);
- } else {
- break;
+ if (textEditor.GetTextEditorData ().IsCaretInVirtualLocation) {
+ uint len = (uint)textEditor.GetTextEditorData ().GetIndentationString (textEditor.Caret.Location).Length;
+ si += len;
+ ei += len;
+ }
+
+ atts.AddForegroundAttribute ((HslColor)ColorStyle.PlainText.Foreground, si, ei);
+ var hasBackground = wrapper.BackgroundColors.Any (bg => bg.FromIdx <= si && bg.ToIdx >= ei);
+ if (hasBackground)
+ atts.AddBackgroundAttribute ((HslColor)ColorStyle.PlainText.Background, si, ei);
+ atts.InsertOffsetList (textEditor.preeditAttrs, si, ei);
+ }
+ wrapper.LineChars = lineChars;
+ wrapper.Layout.SetText (lineText);
+ wrapper.IndentSize = 0;
+ var tabSize = textEditor.Options != null ? textEditor.Options.TabSize : 4;
+ for (int i = 0; i < lineChars.Length; i++) {
+ char ch = lineChars [i];
+ if (ch == ' ') {
+ wrapper.IndentSize++;
+ } else if (ch == '\t') {
+ wrapper.IndentSize = GetNextTabstop (textEditor.GetTextEditorData (), wrapper.IndentSize, tabSize);
+ } else {
+ break;
+ }
}
- }
- var nextLine = line.NextLine;
- wrapper.EolSpanStack = nextLine != null ? nextLine.StartSpan : null;
- atts.AssignTo (wrapper.Layout);
- atts.Dispose ();
- int w, h;
- wrapper.Layout.GetSize (out w, out h);
- wrapper.Width = System.Math.Floor (w / Pango.Scale.PangoScale);
- wrapper.Height = System.Math.Floor (h / Pango.Scale.PangoScale);
+ var nextLine = line.NextLine;
+ wrapper.EolSpanStack = nextLine != null ? nextLine.StartSpan : null;
+ atts.AssignTo (wrapper.Layout);
+ atts.Dispose ();
+ int w, h;
+ wrapper.Layout.GetSize (out w, out h);
+ wrapper.Width = System.Math.Floor (w / Pango.Scale.PangoScale);
+ wrapper.Height = System.Math.Floor (h / Pango.Scale.PangoScale);
+
+ var lines = wrapper.Layout.LineCount;
+
+ if (lines == 1) {
+ wrapper.LastLineWidth = wrapper.Width;
+ } else {
+ var layoutLine = wrapper.Layout.GetLine (lines - 1);
+ Pango.Rectangle iR = Pango.Rectangle.Zero;
+ Pango.Rectangle lR = Pango.Rectangle.Zero;
+ layoutLine.GetExtents (ref iR, ref lR);
+ wrapper.LastLineWidth = System.Math.Floor (lR.Width / Pango.Scale.PangoScale);
+ }
- var lines = wrapper.Layout.LineCount;
- if (lines == 1) {
- wrapper.LastLineWidth = wrapper.Width;
- } else {
- var layoutLine = wrapper.Layout.GetLine (lines - 1);
- Pango.Rectangle iR = Pango.Rectangle.Zero;
- Pango.Rectangle lR = Pango.Rectangle.Zero;
- layoutLine.GetExtents (ref iR, ref lR);
- wrapper.LastLineWidth = System.Math.Floor (lR.Width / Pango.Scale.PangoScale);
+ selectionStart = System.Math.Max (line.Offset - 1, selectionStart);
+ selectionEnd = System.Math.Min (line.EndOffsetIncludingDelimiter + 1, selectionEnd);
+ descriptor = new LayoutDescriptor (line, offset, length, wrapper, selectionStart, selectionEnd);
+ if (!containsPreedit) {
+ layoutDict [line] = descriptor;
+ }
+ // textEditor.GetTextEditorData ().HeightTree.SetLineHeight (line.LineNumber, System.Math.Max (LineHeight, wrapper.Height));
+ OnLineShown (line);
+ return wrapper;
+ } finally {
+ sw.Stop ();
}
+ }
+ void OnLineShown (DocumentLine line)
+ {
+ LineShown?.Invoke (this, new LineEventArgs (line));
+ }
- selectionStart = System.Math.Max (line.Offset - 1, selectionStart);
- selectionEnd = System.Math.Min (line.EndOffsetIncludingDelimiter + 1, selectionEnd);
- descriptor = new LayoutDescriptor (line, offset, length, wrapper, selectionStart, selectionEnd);
- if (!containsPreedit)
- layoutDict [line] = descriptor;
-// textEditor.GetTextEditorData ().HeightTree.SetLineHeight (line.LineNumber, System.Math.Max (LineHeight, wrapper.Height));
- return wrapper;
+ public event EventHandler<LineEventArgs> LineShown;
+
+ public IEnumerable<DocumentLine> CachedLine {
+ get {
+ return layoutDict.Keys;
+ }
}
public void RemoveCachedLine (DocumentLine line)
{
if (line == null)
return;
+ textEditor.CheckUIThread ();
LayoutDescriptor descriptor;
if (layoutDict.TryGetValue (line, out descriptor)) {
descriptor.Dispose ();
@@ -1113,6 +1048,7 @@ namespace Mono.TextEditor
internal void DisposeLayoutDict ()
{
+ textEditor.CheckUIThread ();
foreach (LayoutDescriptor descr in layoutDict.Values) {
descr.Dispose ();
}
@@ -1213,7 +1149,7 @@ namespace Mono.TextEditor
public static uint TranslateToUTF8Index (char[] charArray, uint textIndex, ref uint curIndex, ref uint byteIndex)
{
if (textIndex > charArray.Length)
- throw new ArgumentOutOfRangeException ("textIndex", " must be <= charArrayLength (" + charArray.Length + ") was :" + textIndex);
+ throw new ArgumentOutOfRangeException (nameof (textIndex), " must be <= charArrayLength (" + charArray.Length + ") was :" + textIndex);
if (textIndex < curIndex) {
byteIndex = (uint)Encoding.UTF8.GetByteCount (charArray, 0, (int)textIndex);
} else {
@@ -1379,7 +1315,7 @@ namespace Mono.TextEditor
public event LineDecorator DecorateLineBg;
- const double whitespaceMarkerAlpha = 0.3;
+ const double whitespaceMarkerAlpha = 0.12;
void InnerDecorateTabsAndSpaces (Cairo.Context ctx, LayoutWrapper layout, int offset, double x, double y, int selectionStart, int selectionEnd, char spaceOrTab)
{
@@ -1486,24 +1422,6 @@ namespace Mono.TextEditor
}
}
- void DecorateMatchingBracket (Cairo.Context ctx, LayoutWrapper layout, int offset, int length, double xPos, double y, int selectionStart, int selectionEnd)
- {
- uint curIndex = 0, byteIndex = 0;
- if (offset <= highlightBracketOffset && highlightBracketOffset <= offset + length) {
- int index = highlightBracketOffset - offset;
- Pango.Rectangle rect = layout.Layout.IndexToPos ((int)TranslateToUTF8Index (layout.LineChars, (uint)index, ref curIndex, ref byteIndex));
-
- var bracketMatch = new Cairo.Rectangle (xPos + rect.X / Pango.Scale.PangoScale + 0.5, y + 0.5, (rect.Width / Pango.Scale.PangoScale) - 1, (rect.Height / Pango.Scale.PangoScale) - 1);
- if (BackgroundRenderer == null) {
- ctx.SetSourceColor (ColorStyle.BraceMatchingRectangle.Color);
- ctx.Rectangle (bracketMatch);
- ctx.FillPreserve ();
- ctx.SetSourceColor (ColorStyle.BraceMatchingRectangle.SecondColor);
- ctx.Stroke ();
- }
- }
- }
-
public LayoutWrapper GetLayout (DocumentLine line)
{
ISyntaxMode mode = Document.SyntaxMode != null && textEditor.Options.EnableSyntaxHighlighting ? Document.SyntaxMode : new SyntaxMode (Document);
@@ -1632,18 +1550,27 @@ namespace Mono.TextEditor
TextRenderEndPosition = xPos + width,
LineHeight = _lineHeight,
- WholeLineWidth = textEditor.Allocation.Width - xPos
+ WholeLineWidth = textEditor.Allocation.Width - xPos,
+
+ LineYRenderStartPosition = y
};
foreach (TextLineMarker marker in line.Markers) {
if (!marker.IsVisible)
continue;
- if (marker.DrawBackground (textEditor, cr, y, metrics)) {
+ if (marker.DrawBackground (textEditor, cr, metrics)) {
isSelectionDrawn |= (marker.Flags & TextLineMarkerFlags.DrawsSelection) == TextLineMarkerFlags.DrawsSelection;
}
}
+ var textSegmentMarkers = TextDocument.OrderTextSegmentMarkersByInsertion (Document.GetTextSegmentMarkersAt (line).Where (m => m.IsVisible)).ToArray ();
+ foreach (var marker in textSegmentMarkers) {
+ if (layout.Layout != null)
+ marker.DrawBackground (textEditor, cr, metrics, offset, offset + length);
+ }
+
+
if (DecorateLineBg != null)
DecorateLineBg (cr, layout, offset, length, xPos, y, selectionStartOffset, selectionEndOffset);
@@ -1766,11 +1693,11 @@ namespace Mono.TextEditor
BackgroundRenderer == null) {
DecorateTabsAndSpaces (cr, wrapper, offset, xPos, y, selectionStartOffset, selectionEndOffset + wrapper.LineChars.Length);
}
+
+ DrawIndent (cr, wrapper, line, position, y);
}
}
-
}
-
if (lineNumber == Caret.Line) {
int caretOffset = Caret.Offset;
if (offset <= caretOffset && caretOffset <= offset + length) {
@@ -1786,8 +1713,10 @@ namespace Mono.TextEditor
// When drawing virtual space before the selection start paint it as unselected.
var virtualSpaceMod = selectionStartOffset < caretOffset ? 0 : wrapper.LineChars.Length;
- if ((!textEditor.IsSomethingSelected || (selectionStartOffset >= offset && selectionStartOffset != selectionEndOffset)) && (HighlightCaretLine || textEditor.Options.HighlightCaretLine) && Caret.Line == lineNumber)
+ if ((!textEditor.IsSomethingSelected || (selectionStartOffset >= offset && selectionStartOffset != selectionEndOffset)) && (HighlightCaretLine || textEditor.Options.HighlightCaretLine) && Caret.Line == lineNumber) {
DrawCaretLineMarker (cr, position, y, wrapper.Width, _lineHeight);
+ DrawIndent (cr, wrapper, line, position, y); // caret line marker overdrawn that
+ }
if (DecorateLineBg != null)
DecorateLineBg (cr, wrapper, offset, length, xPos, y, selectionStartOffset + virtualSpaceMod, selectionEndOffset + wrapper.LineChars.Length);
@@ -1795,6 +1724,8 @@ namespace Mono.TextEditor
if (textEditor.Options.ShowWhitespaces == ShowWhitespaces.Always) {
DecorateTabsAndSpaces (cr, wrapper, offset, xPos, y, selectionStartOffset, selectionEndOffset + wrapper.LineChars.Length);
}
+
+ position += System.Math.Floor (wrapper.Width);
}
} else if (index == length && string.IsNullOrEmpty (textEditor.preeditString)) {
var x = position + layout.Width;
@@ -1821,12 +1752,12 @@ namespace Mono.TextEditor
}
foreach (TextLineMarker marker in line.Markers.Where (m => m.IsVisible)) {
if (layout.Layout != null)
- marker.Draw (textEditor, cr, y, metrics);
+ marker.Draw (textEditor, cr, metrics);
}
- foreach (var marker in Document.GetTextSegmentMarkersAt (line).Where (m => m.IsVisible)) {
+ foreach (var marker in textSegmentMarkers) {
if (layout.Layout != null)
- marker.Draw (textEditor, cr, layout.Layout, false, /*selected*/offset, offset + length, y, xPos, xPos + width);
+ marker.Draw (textEditor, cr, metrics, offset, offset + length);
}
position += System.Math.Floor (layout.LastLineWidth);
@@ -1890,7 +1821,7 @@ namespace Mono.TextEditor
}
}
- cr.SetSourceRGBA (col.R, col.G, col.B, whitespaceMarkerAlpha);
+ cr.SetSourceRGBA (col.R, col.G, col.B, whitespaceMarkerAlpha * 1.4); // needs to more opaque due to font rendering
cr.ShowLayout (layout);
cr.Restore ();
}
@@ -1950,6 +1881,7 @@ namespace Mono.TextEditor
string link = GetLink != null ? GetLink (args) : null;
if (!String.IsNullOrEmpty (link)) {
+ textEditor.ClearSelection ();
textEditor.FireLinkEvent (link, args.Button, args.ModifierState);
return;
}
@@ -1968,7 +1900,8 @@ namespace Mono.TextEditor
break;
}
}
- foreach (var marker in Document.GetTextSegmentMarkersAt (line).Where (m => m.IsVisible)) {
+ var locNotSnapped = PointToLocation (args.X, args.Y, snapCharacters: false);
+ foreach (var marker in Document.GetTextSegmentMarkersAt (Document.GetOffset (locNotSnapped)).Where (m => m.IsVisible)) {
if (marker is IActionTextLineMarker) {
isHandled |= ((IActionTextLineMarker)marker).MousePressed (textEditor, args);
if (isHandled)
@@ -2039,7 +1972,7 @@ namespace Mono.TextEditor
textEditor.ClearSelection ();
Caret.Location = clickLocation;
InSelectionDrag = true;
- textEditor.SetSelection (clickLocation, clickLocation);
+ textEditor.MainSelection = new Selection (clickLocation, clickLocation);
}
textEditor.RequestResetCaretBlink ();
}
@@ -2092,6 +2025,28 @@ namespace Mono.TextEditor
{
if (args.Button != 2 && !InSelectionDrag)
textEditor.ClearSelection ();
+
+ DocumentLine line = Document.GetLine (clickLocation.Line);
+ bool isHandled = false;
+ if (line != null) {
+ foreach (TextLineMarker marker in line.Markers) {
+ if (marker is IActionTextLineMarker) {
+ isHandled |= ((IActionTextLineMarker)marker).MouseReleased(textEditor, args);
+ if (isHandled)
+ break;
+ }
+ }
+ var locNotSnapped = PointToLocation (args.X, args.Y, snapCharacters: false);
+ foreach (var marker in Document.GetTextSegmentMarkersAt (Document.GetOffset (locNotSnapped)).Where (m => m.IsVisible)) {
+ if (marker is IActionTextLineMarker) {
+ isHandled |= ((IActionTextLineMarker)marker).MouseReleased (textEditor, args);
+ if (isHandled)
+ break;
+ }
+ }
+ }
+
+
InSelectionDrag = false;
if (inDrag)
Caret.Location = clickLocation;
@@ -2279,6 +2234,7 @@ namespace Mono.TextEditor
var line = Document.GetLine (loc.Line);
var oldHoveredLine = HoveredLine;
HoveredLine = line;
+ HoveredLocation = loc;
OnHoveredLineChanged (new LineEventArgs (oldHoveredLine));
var hoverResult = new TextLineMarkerHoverResult ();
@@ -2297,7 +2253,8 @@ namespace Mono.TextEditor
var tmp = oldMarkers;
oldMarkers = newMarkers;
newMarkers = tmp;
- foreach (var marker in Document.GetTextSegmentMarkersAt (line).Where (m => m.IsVisible)) {
+ var locNotSnapped = PointToLocation (args.X, args.Y, snapCharacters: false);
+ foreach (var marker in Document.GetTextSegmentMarkersAt (Document.GetOffset (locNotSnapped)).Where (m => m.IsVisible)) {
if (marker is IActionTextLineMarker) {
((IActionTextLineMarker)marker).MouseHover (textEditor, args, hoverResult);
}
@@ -2419,6 +2376,8 @@ namespace Mono.TextEditor
public static int GetNextTabstop (TextEditorData textEditor, int currentColumn, int tabSize)
{
+ if (tabSize == 0)
+ return currentColumn;
int result = currentColumn - 1 + tabSize;
return 1 + (result / tabSize) * tabSize;
}
@@ -2587,6 +2546,8 @@ namespace Mono.TextEditor
}
}
+ public DocumentLocation HoveredLocation { get; private set; }
+
[Flags]
public enum CairoCorners
{
@@ -2666,7 +2627,7 @@ namespace Mono.TextEditor
var lineArea = new Cairo.Rectangle (correctedXOffset, y, textEditor.Allocation.Width - correctedXOffset, _lineHeight);
double position = x - textEditor.HAdjustment.Value + TextStartPosition;
defaultBgColor = Document.ReadOnly ? ColorStyle.BackgroundReadOnly.Color : ColorStyle.PlainText.Background;
-
+ var startLineNr = lineNr;
// Draw the default back color for the whole line. Colors other than the default
// background will be drawn when rendering the text chunks.
if (BackgroundRenderer == null)
@@ -2699,14 +2660,13 @@ namespace Mono.TextEditor
continue;
if (folding.IsFolded) {
-
DrawLinePart (cr, line, lineNr, logicalRulerColumn, offset, foldOffset - offset, ref position, ref isSelectionDrawn, y, area.X + area.Width, _lineHeight);
-
+
offset = folding.EndLine.Offset + folding.EndColumn - 1;
markerLayout.SetText (folding.Description);
int width, height;
markerLayout.GetPixelSize (out width, out height);
-
+
bool isFoldingSelected = !this.HideSelection && textEditor.IsSomethingSelected && textEditor.SelectionRange.Contains (folding.Segment);
double pixelX = 0.5 + System.Math.Floor (position);
double foldXMargin = foldMarkerXMargin * textEditor.Options.Zoom;
@@ -2737,7 +2697,7 @@ namespace Mono.TextEditor
System.Math.Floor (boundingRectangleHeight - cr.LineWidth),
LineHeight / 8, CairoCorners.All, false);
cr.Stroke ();
-
+
cr.Save ();
cr.Translate (
position + foldXMargin,
@@ -2776,7 +2736,8 @@ namespace Mono.TextEditor
!this.HideSelection &&
textEditor.IsSomethingSelected &&
textEditor.SelectionMode == SelectionMode.Normal &&
- (textEditor.MainSelection.Contains (lineNr, 1) || lineNr == textEditor.MainSelection.Start.Line);
+ textEditor.MainSelection.ContainsLine (lineNr) &&
+ textEditor.MainSelection.Contains (lineNr + 1, 1);
var lx = (int)position;
lineArea = new Cairo.Rectangle (lx,
@@ -2815,14 +2776,7 @@ namespace Mono.TextEditor
// prevent "gaps" in the selection drawing ('fuzzy' lines problem)
wrapper = GetLayout (line);
if (lineNr == textEditor.MainSelection.Start.Line && line.Length == 0 && textEditor.MainSelection.Start.Column > 1) {
- using (var vwrapper = GetVirtualSpaceLayout (line, textEditor.MainSelection.Start)) {
- lineArea = new Cairo.Rectangle (
- lineArea.X + vwrapper.Width,
- lineArea.Y + System.Math.Max (0, wrapper.Height - LineHeight),
- textEditor.Allocation.Width - (lineArea.X + vwrapper.Width),
- LineHeight
- );
- }
+ // position already skipped virtual space layout
} else {
var eolStartX = System.Math.Floor (position);
lineArea = new Cairo.Rectangle (
@@ -2835,7 +2789,7 @@ namespace Mono.TextEditor
DrawRectangleWithRuler (cr, x, lineArea, this.SelectionColor.Background, false);
if (line.Length == 0)
DrawIndent (cr, wrapper, line, lx, y);
- } else if (!(HighlightCaretLine || textEditor.GetTextEditorData ().HighlightCaretLine) || Caret.Line != lineNr) {
+ } else if (!(HighlightCaretLine || textEditor.GetTextEditorData ().HighlightCaretLine) || Caret.Line != lineNr && Caret.Line != startLineNr) {
wrapper = GetLayout (line);
if (wrapper.EolSpanStack != null) {
foreach (var span in wrapper.EolSpanStack) {
@@ -2850,6 +2804,8 @@ namespace Mono.TextEditor
}
} else {
double xPos = position;
+ if (line.Length == 0 && Caret.Column > 1)
+ DrawIndent (cr, wrapper, line, lx, y);
DrawCaretLineMarker (cr, xPos, y, lineArea.X + lineArea.Width - xPos, _lineHeight);
}
}
@@ -2880,10 +2836,11 @@ namespace Mono.TextEditor
var metrics = new EndOfLineMetrics {
LineSegment = line,
TextRenderEndPosition = TextStartPosition + position,
- LineHeight = _lineHeight
+ LineHeight = _lineHeight,
+ LineYRenderStartPosition = y
};
foreach (var marker in line.Markers) {
- marker.DrawAfterEol (textEditor, cr, y, metrics);
+ marker.DrawAfterEol (textEditor, cr, metrics);
}
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TooltipProvider.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TooltipProvider.cs
index 20ea1309e9..d08a7e6f8c 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TooltipProvider.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TooltipProvider.cs
@@ -24,35 +24,33 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using System.Threading;
+using System.Threading.Tasks;
namespace Mono.TextEditor
{
public abstract class TooltipProvider
{
- public abstract TooltipItem GetItem (TextEditor editor, int offset);
+ public abstract Task<TooltipItem> GetItem (MonoTextEditor editor, int offset, CancellationToken token = default(CancellationToken));
- public virtual bool IsInteractive (TextEditor editor, Gtk.Window tipWindow)
+ public virtual bool IsInteractive (MonoTextEditor editor, Gtk.Window tipWindow)
{
return false;
}
- protected virtual void GetRequiredPosition (TextEditor editor, Gtk.Window tipWindow, out int requiredWidth, out double xalign)
+ protected virtual void GetRequiredPosition (MonoTextEditor editor, Gtk.Window tipWindow, out int requiredWidth, out double xalign)
{
requiredWidth = tipWindow.SizeRequest ().Width;
xalign = 0.5;
}
- protected virtual Gtk.Window CreateTooltipWindow (TextEditor editor, int offset, Gdk.ModifierType modifierState, TooltipItem item)
+ public virtual Gtk.Window CreateTooltipWindow (MonoTextEditor editor, int offset, Gdk.ModifierType modifierState, TooltipItem item)
{
return null;
}
- public virtual Gtk.Window ShowTooltipWindow (TextEditor editor, int offset, Gdk.ModifierType modifierState, int mouseX, int mouseY, TooltipItem item)
+ public virtual Gtk.Window ShowTooltipWindow (MonoTextEditor editor, Gtk.Window tipWindow, int offset, Gdk.ModifierType modifierState, int mouseX, int mouseY, TooltipItem item)
{
- Gtk.Window tipWindow = CreateTooltipWindow (editor, offset, modifierState, item);
- if (tipWindow == null)
- return null;
-
int ox = 0, oy = 0;
if (editor.GdkWindow != null)
editor.GdkWindow.GetOrigin (out ox, out oy);
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/HeightTree.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/HeightTree.cs
index 7ea191115a..1eb4018304 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/HeightTree.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/HeightTree.cs
@@ -70,7 +70,9 @@ namespace Mono.TextEditor
void HandleLineRemoved (object sender, LineEventArgs e)
{
- RemoveLine (e.Line.LineNumber);
+ Rebuild ();
+ OnLineUpdateFrom (new HeightChangedEventArgs (e.Line.LineNumber - 1));
+ //RemoveLine (e.Line.LineNumber);
}
public void Dispose ()
@@ -434,8 +436,7 @@ namespace Mono.TextEditor
if (node.count == 1)
return node;
}
- Debug.Assert (lineNumber == node.GetLineNumber (), lineNumber + " should match node line number " + node.GetLineNumber () + " (max: " + tree.Root.totalCount + ")");
-
+
InsertAfter (node, new HeightNode () {
count = node.count - 1,
height = (node.count - 1) * editor.LineHeight,
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/HelperMethods.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/HelperMethods.cs
index 1b74818031..29c68acd36 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/HelperMethods.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/HelperMethods.cs
@@ -34,7 +34,7 @@ using System.Collections.Generic;
namespace Mono.TextEditor
{
- public static class HelperMethods
+ public static class PublicHelperMethods
{
public static TextSegment AdjustSegment (this TextSegment segment, DocumentChangeEventArgs args)
{
@@ -50,7 +50,10 @@ namespace Mono.TextEditor
yield return segment.AdjustSegment (args);
}
}
+ }
+ static class HelperMethods
+ {
public static T Kill<T>(this T gc) where T : IDisposable
{
if (gc != null)
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/IIndentationTracker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/IIndentationTracker.cs
index 443b76f343..5d82d61df3 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/IIndentationTracker.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/IIndentationTracker.cs
@@ -27,8 +27,17 @@ using System;
namespace Mono.TextEditor
{
+ [Flags]
+ public enum IndentatitonTrackerFeatures {
+ None = 0,
+ SmartBackspace = 1,
+ All = SmartBackspace
+ }
+
public interface IIndentationTracker
{
+ IndentatitonTrackerFeatures SupportedFeatures { get; }
+
string GetIndentationString (int offset);
string GetIndentationString (int lineNumber, int column);
@@ -57,7 +66,12 @@ namespace Mono.TextEditor
{
this.doc = doc;
}
-
+
+ public IndentatitonTrackerFeatures SupportedFeatures {
+ get;
+ set;
+ }
+
public string GetIndentationString (int offset)
{
var loc = doc.OffsetToLocation (offset);
@@ -86,5 +100,6 @@ namespace Mono.TextEditor
{
return 1 + GetIndentationString (lineNumber, column).Length;
}
+
}
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/ITextEditorOptions.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/ITextEditorOptions.cs
index 3c5e8551e3..732f4d2302 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/ITextEditorOptions.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/ITextEditorOptions.cs
@@ -29,21 +29,23 @@ using Mono.TextEditor.Highlighting;
namespace Mono.TextEditor
{
- public enum ShowWhitespaces {
+ public enum ShowWhitespaces
+ {
Never,
Selection,
Always
}
[Flags]
- public enum IncludeWhitespaces {
- None = 0,
- Space = 1,
- Tab = 2,
+ public enum IncludeWhitespaces
+ {
+ None = 0,
+ Space = 1,
+ Tab = 2,
LineEndings = 4,
- All = Space | Tab | LineEndings
+ All = Space | Tab | LineEndings
}
-
+
public interface ITextEditorOptions : IDisposable
{
double Zoom { get; set; }
@@ -53,11 +55,11 @@ namespace Mono.TextEditor
void ZoomIn ();
void ZoomOut ();
void ZoomReset ();
-
+
string IndentationString { get; }
-
+
IWordFindStrategy WordFindStrategy { get; set; }
-
+
bool AllowTabsAfterNonTabs { get; set; }
bool HighlightMatchingBracket { get; set; }
bool TabsToSpaces { get; set; }
@@ -80,21 +82,23 @@ namespace Mono.TextEditor
bool DrawIndentationMarkers { get; set; }
bool WrapLines { get; set; }
- string FontName { get; set; }
- Pango.FontDescription Font { get; }
+ string FontName { get; set; }
+ Pango.FontDescription Font { get; }
string GutterFontName { get; set; }
Pango.FontDescription GutterFont { get; }
-
- string ColorScheme { get; set; }
+
+ string ColorScheme { get; set; }
string DefaultEolMarker { get; set; }
ShowWhitespaces ShowWhitespaces { get; set; }
IncludeWhitespaces IncludeWhitespaces { get; set; }
bool GenerateFormattingUndoStep { get; set; }
+ event EventHandler ZoomChanged;
+
ColorScheme GetColorStyle ();
-
+
event EventHandler Changed;
}
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/InsertionCursorEditMode.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/InsertionCursorEditMode.cs
index 6a776e3212..b9a4c73edc 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/InsertionCursorEditMode.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/InsertionCursorEditMode.cs
@@ -97,9 +97,9 @@ namespace Mono.TextEditor
public class HelpWindowEditMode : SimpleEditMode
{
- protected new TextEditor editor;
+ protected new MonoTextEditor editor;
- public new TextEditor Editor {
+ public new MonoTextEditor Editor {
get {
return editor;
}
@@ -143,8 +143,10 @@ namespace Mono.TextEditor
editor.SizeAllocated -= MoveHelpWindow;
editor.VScroll -= HandleVScroll;
editor.Destroyed -= HandleEditorDestroy;
+ HelpWindow.Hide ();
HelpWindow.Destroy ();
HelpWindow = null;
+ editor.QueueDraw ();
}
void HandleEditorDestroy (object sender, EventArgs e)
@@ -199,7 +201,7 @@ namespace Mono.TextEditor
get { return insertionPoints; }
}
- public InsertionCursorEditMode (TextEditor editor, List<InsertionPoint> insertionPoints)
+ public InsertionCursorEditMode (MonoTextEditor editor, List<InsertionPoint> insertionPoints)
{
this.editor = editor;
this.insertionPoints = insertionPoints;
@@ -294,7 +296,6 @@ namespace Mono.TextEditor
class CursorDrawer : MarginDrawer
{
InsertionCursorEditMode mode;
- static readonly Cairo.Color LineColor = HslColor.Parse ("#666666");
public CursorDrawer (InsertionCursorEditMode mode)
@@ -324,7 +325,7 @@ namespace Mono.TextEditor
public double GetLineIndentationStart ()
{
- TextEditor editor = mode.editor;
+ MonoTextEditor editor = mode.editor;
var lineAbove = editor.Document.GetLine (mode.CurrentInsertionPoint.Line - 1);
var lineBelow = editor.Document.GetLine (mode.CurrentInsertionPoint.Line);
@@ -356,15 +357,15 @@ namespace Mono.TextEditor
public override void Draw (Cairo.Context cr, Cairo.Rectangle erea)
{
- TextEditor editor = mode.editor;
+ MonoTextEditor editor = mode.editor;
double y = editor.LineToY (mode.CurrentInsertionPoint.Line) - editor.VAdjustment.Value;
- double x = GetLineIndentationStart ();
- double x2 = editor.Allocation.Width - mode.HelpWindow.Allocation.Width - InsertionCursorEditMode.HelpWindowMargin * 2;
+ double x = GetLineIndentationStart () - 3;
+ double x2 = editor.Allocation.Width - mode.HelpWindow.Allocation.Width - InsertionCursorEditMode.HelpWindowMargin * 2 + 4;
cr.MoveTo (x, y);
cr.LineTo (x2, y);
- cr.SetSourceColor (LineColor);
+ cr.SetSourceColor (Styles.InsertionCursorLineColor.ToCairoColor ());
cr.Stroke ();
// DrawArrow (cr, x - 4, y);
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/LineBackgroundMarker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/LineBackgroundMarker.cs
index 3fead25185..f74f08ec90 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/LineBackgroundMarker.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/LineBackgroundMarker.cs
@@ -40,12 +40,12 @@ namespace Mono.TextEditor
this.color = color;
}
- public override bool DrawBackground (TextEditor editor, Cairo.Context cr, double y, LineMetrics metrics)
+ public override bool DrawBackground (MonoTextEditor editor, Cairo.Context cr, LineMetrics metrics)
{
if (metrics.SelectionStart > 0)
return true;
cr.SetSourceColor (color);
- cr.Rectangle (metrics.TextRenderStartPosition, y, metrics.TextRenderEndPosition - metrics.TextRenderStartPosition, editor.LineHeight);
+ cr.Rectangle (metrics.TextRenderStartPosition, metrics.LineYRenderStartPosition, metrics.TextRenderEndPosition - metrics.TextRenderStartPosition, editor.LineHeight);
cr.Fill ();
return true;
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/MarginMarker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/MarginMarker.cs
index c8cd377311..26638df368 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/MarginMarker.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/MarginMarker.cs
@@ -128,7 +128,7 @@ namespace Mono.TextEditor
/// <summary>
/// Draws the foreground of the specified margin.
/// </summary>
- public virtual void DrawForeground (TextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
+ public virtual void DrawForeground (MonoTextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
{
}
@@ -136,7 +136,7 @@ namespace Mono.TextEditor
/// Draws the background of the specified margin.
/// </summary>
/// <returns>true, if the background is drawn. false if the margin should fallback to the default background renderer. </returns>
- public virtual bool DrawBackground (TextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
+ public virtual bool DrawBackground (MonoTextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
{
return false;
}
@@ -147,7 +147,7 @@ namespace Mono.TextEditor
/// <param name="editor">The text editor in which the event press occured.</param>
/// <param name="margin">The margin in which the event occured.</param>
/// <param name="args">The event arguments.</param>
- public virtual void InformMousePress (TextEditor editor, Margin margin, MarginMouseEventArgs args)
+ public virtual void InformMousePress (MonoTextEditor editor, Margin margin, MarginMouseEventArgs args)
{
}
@@ -157,7 +157,7 @@ namespace Mono.TextEditor
/// <param name="editor">The text editor in which the event press occured.</param>
/// <param name="margin">The margin in which the event occured.</param>
/// <param name="args">The event arguments.</param>
- public virtual void InformMouseRelease (TextEditor editor, Margin margin, MarginMouseEventArgs args)
+ public virtual void InformMouseRelease (MonoTextEditor editor, Margin margin, MarginMouseEventArgs args)
{
}
@@ -167,7 +167,7 @@ namespace Mono.TextEditor
/// <param name="editor">The text editor in which the event press occured.</param>
/// <param name="margin">The margin in which the event occured.</param>
/// <param name="args">The event arguments.</param>
- public virtual void InformMouseHover (TextEditor editor, Margin margin, MarginMouseEventArgs args)
+ public virtual void InformMouseHover (MonoTextEditor editor, Margin margin, MarginMouseEventArgs args)
{
}
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Selection.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Selection.cs
index 7a49554375..b8c139e1d1 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Selection.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Selection.cs
@@ -185,5 +185,10 @@ namespace Mono.TextEditor
{
return string.Format("[Selection: Anchor={0}, Lead={1}, MinLine={2}, MaxLine={3}, SelectionMode={4}]", Anchor, Lead, MinLine, MaxLine, SelectionMode);
}
+
+ internal bool ContainsLine (int lineNr)
+ {
+ return anchor.Line <= lineNr && lineNr <= lead.Line || lead.Line <= lineNr && lineNr <= anchor.Line;
+ }
}
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/SimpleEditMode.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/SimpleEditMode.cs
index 824011e8a4..a965bdcc32 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/SimpleEditMode.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/SimpleEditMode.cs
@@ -140,7 +140,6 @@ namespace Mono.TextEditor
// == subword motions ==
-
action = CaretMoveActions.PreviousSubword;
keyBindings.Add (GetKeyCode (Gdk.Key.KP_Left, subwordModifier), action);
keyBindings.Add (GetKeyCode (Gdk.Key.Left, subwordModifier), action);
@@ -158,7 +157,7 @@ namespace Mono.TextEditor
keyBindings.Add (GetKeyCode (Gdk.Key.Right, Gdk.ModifierType.ShiftMask | subwordModifier), action);
keyBindings.Add (GetKeyCode (Gdk.Key.BackSpace, subwordModifier), DeleteActions.PreviousSubword);
-
+
action = DeleteActions.NextSubword;
keyBindings.Add (GetKeyCode (Gdk.Key.KP_Delete, subwordModifier), action);
keyBindings.Add (GetKeyCode (Gdk.Key.Delete, subwordModifier), action);
@@ -179,7 +178,7 @@ namespace Mono.TextEditor
action = SelectionActions.MoveLineHome;
keyBindings.Add (GetKeyCode (Gdk.Key.KP_Home, Gdk.ModifierType.ShiftMask), action);
keyBindings.Add (GetKeyCode (Gdk.Key.Home, Gdk.ModifierType.ShiftMask), action);
-
+
action = CaretMoveActions.ToDocumentStart;
keyBindings.Add (GetKeyCode (Gdk.Key.KP_Home, Gdk.ModifierType.ControlMask), action);
keyBindings.Add (GetKeyCode (Gdk.Key.Home, Gdk.ModifierType.ControlMask), action);
@@ -294,42 +293,44 @@ namespace Mono.TextEditor
// === Home ===
action = CaretMoveActions.LineHome;
+ keyBindings.Add (GetKeyCode (Gdk.Key.KP_Home), action);
+ keyBindings.Add (GetKeyCode (Gdk.Key.Home), action);
keyBindings.Add (GetKeyCode (Gdk.Key.Left, Gdk.ModifierType.MetaMask), action);
keyBindings.Add (GetKeyCode (Gdk.Key.a, Gdk.ModifierType.ControlMask), action); //emacs
keyBindings.Add (GetKeyCode (Gdk.Key.a, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask), SelectionActions.MoveLineHome);
-
+
action = SelectionActions.MoveLineHome;
+ keyBindings.Add (GetKeyCode (Gdk.Key.KP_Home, Gdk.ModifierType.ShiftMask), action);
+ keyBindings.Add (GetKeyCode (Gdk.Key.Home, Gdk.ModifierType.ShiftMask), action);
+ keyBindings.Add (GetKeyCode (Gdk.Key.KP_Left, Gdk.ModifierType.MetaMask | Gdk.ModifierType.ShiftMask), action);
keyBindings.Add (GetKeyCode (Gdk.Key.Left, Gdk.ModifierType.MetaMask | Gdk.ModifierType.ShiftMask), action);
-
+
action = CaretMoveActions.ToDocumentStart;
- keyBindings.Add (GetKeyCode (Gdk.Key.KP_Home), action);
- keyBindings.Add (GetKeyCode (Gdk.Key.Home), action);
keyBindings.Add (GetKeyCode (Gdk.Key.Up, Gdk.ModifierType.MetaMask), action);
action = SelectionActions.MoveToDocumentStart;
- keyBindings.Add (GetKeyCode (Gdk.Key.KP_Home, Gdk.ModifierType.ShiftMask), action);
- keyBindings.Add (GetKeyCode (Gdk.Key.Home, Gdk.ModifierType.ShiftMask), action);
keyBindings.Add (GetKeyCode (Gdk.Key.Up, Gdk.ModifierType.MetaMask | Gdk.ModifierType.ShiftMask), action);
// ==== End ====
action = CaretMoveActions.LineEnd;
+ keyBindings.Add (GetKeyCode (Gdk.Key.KP_End), action);
+ keyBindings.Add (GetKeyCode (Gdk.Key.End), action);
keyBindings.Add (GetKeyCode (Gdk.Key.Right, Gdk.ModifierType.MetaMask), action);
keyBindings.Add (GetKeyCode (Gdk.Key.e, Gdk.ModifierType.ControlMask), action); //emacs
keyBindings.Add (GetKeyCode (Gdk.Key.e, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask), SelectionActions.MoveLineEnd);
action = SelectionActions.MoveLineEnd;
+ keyBindings.Add (GetKeyCode (Gdk.Key.KP_End, Gdk.ModifierType.ShiftMask), action);
+ keyBindings.Add (GetKeyCode (Gdk.Key.End, Gdk.ModifierType.ShiftMask), action);
+ keyBindings.Add (GetKeyCode (Gdk.Key.KP_Right, Gdk.ModifierType.MetaMask | Gdk.ModifierType.ShiftMask), action);
keyBindings.Add (GetKeyCode (Gdk.Key.Right, Gdk.ModifierType.MetaMask | Gdk.ModifierType.ShiftMask), action);
-
+
action = CaretMoveActions.ToDocumentEnd;
- keyBindings.Add (GetKeyCode (Gdk.Key.KP_End), action);
- keyBindings.Add (GetKeyCode (Gdk.Key.End), action);
keyBindings.Add (GetKeyCode (Gdk.Key.Down, Gdk.ModifierType.MetaMask), action);
action = SelectionActions.MoveToDocumentEnd;
- keyBindings.Add (GetKeyCode (Gdk.Key.KP_End, Gdk.ModifierType.ShiftMask), action);
- keyBindings.Add (GetKeyCode (Gdk.Key.End, Gdk.ModifierType.ShiftMask), action);
keyBindings.Add (GetKeyCode (Gdk.Key.Down, Gdk.ModifierType.MetaMask | Gdk.ModifierType.ShiftMask), action);
// ==== Cut, copy, paste ===
@@ -377,7 +378,10 @@ namespace Mono.TextEditor
keyBindings.Add (GetKeyCode (Gdk.Key.z, Gdk.ModifierType.MetaMask), MiscActions.Undo);
keyBindings.Add (GetKeyCode (Gdk.Key.z, Gdk.ModifierType.MetaMask | Gdk.ModifierType.ShiftMask), MiscActions.Redo);
-
+
+ keyBindings.Add (GetKeyCode (Key.BackSpace, ModifierType.Mod1Mask | ModifierType.ShiftMask), DeleteActions.PreviousSubword);
+ keyBindings.Add (GetKeyCode (Key.Delete, ModifierType.Mod1Mask | ModifierType.ShiftMask), DeleteActions.NextSubword);
+
// selection actions
action = SelectionActions.MoveDown;
@@ -400,9 +404,16 @@ namespace Mono.TextEditor
keyBindings.Add (GetKeyCode (Gdk.Key.o, Gdk.ModifierType.ControlMask), MiscActions.InsertNewLinePreserveCaretPosition);
}
- public void AddBinding (Gdk.Key key, Action<TextEditorData> action)
+ public void AddBinding (Gdk.Key key, Action<TextEditorData> action, bool force = false)
{
- keyBindings.Add (GetKeyCode (key), action);
+ var code = GetKeyCode (key);
+ if (force) {
+ if (keyBindings.ContainsKey (code)) {
+ keyBindings [code] = action;
+ return;
+ }
+ }
+ keyBindings.Add (code, action);
}
public override void SelectValidShortcut (KeyboardShortcut[] accels, out Gdk.Key key, out ModifierType mod)
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Styles.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Styles.cs
new file mode 100644
index 0000000000..3a650d5b75
--- /dev/null
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Styles.cs
@@ -0,0 +1,83 @@
+//
+// Styles.cs
+//
+// Author:
+// Vsevolod Kukol <sevo@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Xwt.Drawing;
+
+namespace Mono.TextEditor.PopupWindow
+{
+ public static class Styles
+ {
+ public static Color ModeHelpWindowTokenOutlineColor { get; internal set; }
+ public static Color ModeHelpWindowTokenTextColor { get; internal set; }
+
+ public static Color InsertionCursorBackgroundColor { get; internal set; }
+ public static Color InsertionCursorTitleTextColor { get; internal set; }
+ public static Color InsertionCursorBorderColor { get; internal set; }
+ public static Color InsertionCursorTextColor { get; internal set; }
+ public static Color InsertionCursorLineColor { get; internal set; }
+
+ public static Color TableLayoutModeBackgroundColor { get; internal set; }
+ public static Color TableLayoutModeTitleBackgroundColor { get; internal set; }
+ public static Color TableLayoutModeCategoryBackgroundColor { get; internal set; }
+ public static Color TableLayoutModeBorderColor { get; internal set; }
+ public static Color TableLayoutModeTextColor { get; internal set; }
+ public static Color TableLayoutModeGridColor { get; internal set; }
+
+ static Styles ()
+ {
+ LoadStyles ();
+ Context.GlobalStylesChanged += (o, e) => LoadStyles ();
+ }
+
+ public static void LoadStyles ()
+ {
+ var bgColor = Platform.IsMac ? Color.FromName ("#5189ed") : Color.FromName ("#cce8ff");
+ var fgColor = Platform.IsMac ? Color.FromName ("#ffffff") : Color.FromName ("#000000");
+
+ ModeHelpWindowTokenOutlineColor = fgColor;
+ ModeHelpWindowTokenTextColor = fgColor;
+
+ InsertionCursorBackgroundColor = bgColor;
+ InsertionCursorBorderColor = InsertionCursorBackgroundColor;
+ InsertionCursorTitleTextColor = fgColor;
+ InsertionCursorTextColor = InsertionCursorTitleTextColor;
+ InsertionCursorLineColor = bgColor;
+
+ TableLayoutModeBackgroundColor = new Color (1, 1, 1);
+ TableLayoutModeTitleBackgroundColor = new Color (0.88, 0.88, 0.98);
+ TableLayoutModeCategoryBackgroundColor = new Color (0.58, 0.58, 0.98);
+ TableLayoutModeBorderColor = new Color (0.4, 0.4, 0.6);
+ TableLayoutModeTextColor = new Color (0.3, 0.3, 1);
+ TableLayoutModeGridColor = new Color (0.8, 0.8, 0.8);
+ }
+
+ public static Cairo.Color ToCairoColor (this Xwt.Drawing.Color color)
+ {
+ return new Cairo.Color (color.Red, color.Green, color.Blue, color.Alpha);
+ }
+ }
+}
+
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs
index a9c9e75adc..0a11df8224 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs
@@ -95,7 +95,7 @@ namespace Mono.TextEditor
/// </summary>
public event EventHandler<EditModeChangedEventArgs> EditModeChanged;
- public TextEditor Parent {
+ public MonoTextEditor Parent {
get;
set;
}
@@ -207,24 +207,27 @@ namespace Mono.TextEditor
caret.PositionChanged += CaretPositionChanged;
options = TextEditorOptions.DefaultOptions;
-
document = doc;
+ AttachDocument ();
+ SearchEngine = new BasicSearchEngine ();
+
+ HeightTree = new HeightTree (this);
+ HeightTree.Rebuild ();
+ IndentationTracker = new DefaultIndentationTracker (document);
+ }
+
+ void AttachDocument ()
+ {
+ if (document == null)
+ return;
document.BeginUndo += OnBeginUndo;
document.EndUndo += OnEndUndo;
-
document.Undone += DocumentHandleUndone;
document.Redone += DocumentHandleRedone;
- document.LineChanged += HandleDocLineChanged;
document.TextReplaced += HandleTextReplaced;
-
document.TextSet += HandleDocTextSet;
document.Folded += HandleTextEditorDataDocumentFolded;
document.FoldTreeUpdated += HandleFoldTreeUpdated;
- SearchEngine = new BasicSearchEngine ();
-
- HeightTree = new HeightTree (this);
- HeightTree.Rebuild ();
- IndentationTracker = new DefaultIndentationTracker (document);
}
void HandleFoldTreeUpdated (object sender, EventArgs e)
@@ -256,17 +259,17 @@ namespace Mono.TextEditor
return LineHeight;
return Parent.GetLineHeight (line);
}
-
- void HandleDocLineChanged (object sender, LineEventArgs e)
- {
- e.Line.WasChanged = true;
- }
-
public TextDocument Document {
get {
return document;
}
+ set {
+ DetachDocument ();
+ document = value;
+ this.caret.SetDocument (document);
+ AttachDocument ();
+ }
}
void HandleTextReplaced (object sender, DocumentChangeEventArgs e)
@@ -284,13 +287,28 @@ namespace Mono.TextEditor
get {
if (Options.OverrideDocumentEolMarker)
return Options.DefaultEolMarker;
- string eol = null;
if (Document.LineCount > 0) {
- DocumentLine line = Document.GetLine (DocumentLocation.MinLine);
- if (line.DelimiterLength > 0)
- eol = Document.GetTextAt (line.Length, line.DelimiterLength);
- }
- return !String.IsNullOrEmpty (eol) ? eol : Options.DefaultEolMarker;
+ var line = Document.GetLine (DocumentLocation.MinLine);
+ switch (line.UnicodeNewline) {
+ case ICSharpCode.NRefactory.UnicodeNewline.LF:
+ return "\u000A";
+ case ICSharpCode.NRefactory.UnicodeNewline.CRLF:
+ return "\u000D\u000A";
+ case ICSharpCode.NRefactory.UnicodeNewline.CR:
+ return "\u000D";
+ case ICSharpCode.NRefactory.UnicodeNewline.NEL:
+ return "\u0085";
+ case ICSharpCode.NRefactory.UnicodeNewline.VT:
+ return "\u000B";
+ case ICSharpCode.NRefactory.UnicodeNewline.FF:
+ return "\u000C";
+ case ICSharpCode.NRefactory.UnicodeNewline.LS:
+ return "\u2028";
+ case ICSharpCode.NRefactory.UnicodeNewline.PS:
+ return "\u2029";
+ }
+ }
+ return Options.DefaultEolMarker;
}
}
@@ -350,10 +368,10 @@ namespace Mono.TextEditor
return result.ToString ();
}
- public string GetMarkup (int offset, int length, bool removeIndent, bool useColors = true, bool replaceTabs = true)
+ public string GetMarkup (int offset, int length, bool removeIndent, bool useColors = true, bool replaceTabs = true, bool fitIdeStyle = false)
{
ISyntaxMode mode = Document.SyntaxMode;
- var style = ColorStyle;
+ var style = fitIdeStyle ? SyntaxModeService.GetColorStyle(Parent.GetIdeColorStyleName()) : ColorStyle;
if (style == null) {
var str = Document.GetTextAt (offset, length);
@@ -372,6 +390,8 @@ namespace Mono.TextEditor
var styleStack = new Stack<ChunkStyle> ();
foreach (var chunk in mode.GetChunks (style, line, curOffset, toOffset - curOffset)) {
+ if (chunk.Length == 0)
+ continue;
var chunkStyle = style.GetChunkStyle (chunk);
bool setBold = (styleStack.Count > 0 && styleStack.Peek ().FontWeight != chunkStyle.FontWeight) ||
chunkStyle.FontWeight != FontWeight.Normal;
@@ -544,7 +564,6 @@ namespace Mono.TextEditor
document.Undone -= DocumentHandleUndone;
document.Redone -= DocumentHandleRedone;
- document.LineChanged -= HandleDocLineChanged;
document.TextReplaced -= HandleTextReplaced;
document.TextSet -= HandleDocTextSet;
@@ -596,9 +615,11 @@ namespace Mono.TextEditor
public bool CanEdit (int line)
{
+ if (document.ReadOnly)
+ return false;
if (document.ReadOnlyCheckDelegate != null)
return document.ReadOnlyCheckDelegate (line);
- return !document.ReadOnly;
+ return true;
}
public int FindNextWordOffset (int offset)
@@ -805,6 +826,26 @@ namespace Mono.TextEditor
}
}
+ public int SelectionLead {
+ get {
+ if (MainSelection.IsEmpty)
+ return -1;
+ return MainSelection.GetLeadOffset (this);
+ }
+ set {
+ DocumentLocation location = Document.OffsetToLocation (value);
+ if (mainSelection.IsEmpty) {
+ MainSelection = new Selection (location, location);
+ } else {
+ if (MainSelection.Anchor == location) {
+ MainSelection = MainSelection.WithAnchor (MainSelection.Lead);
+ } else {
+ MainSelection = MainSelection.WithLead (location);
+ }
+ }
+ }
+ }
+
/// <summary>
/// Gets or sets the selection range. If nothing is selected (Caret.Offset, 0) is returned.
/// </summary>
@@ -872,8 +913,6 @@ namespace Mono.TextEditor
public void ClearSelection ()
{
- if (!IsSomethingSelected)
- return;
MainSelection = Selection.Empty;
}
@@ -888,6 +927,10 @@ namespace Mono.TextEditor
public void SetSelection (int anchorOffset, int leadOffset)
{
+ if (anchorOffset == leadOffset) {
+ MainSelection = Selection.Empty;
+ return;
+ }
var anchor = document.OffsetToLocation (anchorOffset);
var lead = document.OffsetToLocation (leadOffset);
MainSelection = new Selection (anchor, lead);
@@ -895,7 +938,7 @@ namespace Mono.TextEditor
public void SetSelection (DocumentLocation anchor, DocumentLocation lead)
{
- MainSelection = new Selection (anchor, lead);
+ MainSelection = anchor == lead ? Selection.Empty : new Selection (anchor, lead);
}
public void SetSelection (int anchorLine, int anchorColumn, int leadLine, int leadColumn)
@@ -927,7 +970,6 @@ namespace Mono.TextEditor
EnsureCaretIsNotVirtual ();
if (len > 0)
Remove (segment.Offset, len);
- caret.Location = loc;
break;
case SelectionMode.Block:
DocumentLocation visStart = LogicalToVisualLocation (selection.Anchor);
@@ -1563,41 +1605,6 @@ namespace Mono.TextEditor
#endregion
- #region SkipChars
- public class SkipChar
- {
-
- public int Start { get; set; }
-
- public int Offset { get; set; }
-
- public char Char { get; set; }
-
- public override string ToString ()
- {
- return string.Format ("[SkipChar: Start={0}, Offset={1}, Char={2}]", Start, Offset, Char);
- }
- }
-
- List<SkipChar> skipChars = new List<SkipChar> ();
-
- public List<SkipChar> SkipChars {
- get {
- return skipChars;
- }
- }
-
- public void SetSkipChar (int offset, char ch)
- {
- skipChars.Add (new SkipChar () {
- Start = offset - 1,
- Offset = offset,
- Char = ch
- });
- }
-
- #endregion
-
/// <summary>
/// Creates the a text editor data object which document can't be changed. This is useful for 'view' only
/// documents.
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorOptions.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorOptions.cs
index 3028e70c6d..c5273cb2f1 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorOptions.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorOptions.cs
@@ -61,14 +61,15 @@ namespace Mono.TextEditor
bool removeTrailingWhitespaces = true;
bool allowTabsAfterNonTabs = true;
string fontName = DEFAULT_FONT;
- public static string DefaultColorStyle = "Default";
+ public static string DefaultColorStyle = "Light";
string colorStyle = DefaultColorStyle;
Pango.FontDescription font, gutterFont;
- double zoom = 1d;
IWordFindStrategy wordFindStrategy = new EmacsWordFindStrategy (true);
#region Zoom
+ static double zoom = 1d;
+ static event EventHandler StaticZoomChanged;
const double ZOOM_FACTOR = 1.1f;
const int ZOOM_MIN_POW = -4;
@@ -76,53 +77,70 @@ namespace Mono.TextEditor
static readonly double ZOOM_MIN = System.Math.Pow (ZOOM_FACTOR, ZOOM_MIN_POW);
static readonly double ZOOM_MAX = System.Math.Pow (ZOOM_FACTOR, ZOOM_MAX_POW);
+
+ double myZoom = 1d;
+ public bool ZoomOverride { get; private set; }
+
+
public double Zoom {
get {
- return zoom;
+ if (ZoomOverride)
+ return myZoom;
+ return zoom;
}
set {
value = System.Math.Min (ZOOM_MAX, System.Math.Max (ZOOM_MIN, value));
if (value > ZOOM_MAX || value < ZOOM_MIN)
return;
+
//snap to one, if within 0.001d
if ((System.Math.Abs (value - 1d)) < 0.001d) {
value = 1d;
}
+ if (ZoomOverride) {
+ if (myZoom != value) {
+ myZoom = value;
+ DisposeFont ();
+ ZoomChanged?.Invoke (this, EventArgs.Empty);
+ OnChanged (EventArgs.Empty);
+ }
+ return;
+ }
if (zoom != value) {
zoom = value;
- DisposeFont ();
- OnChanged (EventArgs.Empty);
+ StaticZoomChanged?.Invoke (this, EventArgs.Empty);
}
}
}
-
+ public event EventHandler ZoomChanged;
+
public bool CanZoomIn {
get {
- return zoom < ZOOM_MAX - 0.000001d;
+ return Zoom < ZOOM_MAX - 0.000001d;
}
}
public bool CanZoomOut {
get {
- return zoom > ZOOM_MIN + 0.000001d;
+ return Zoom > ZOOM_MIN + 0.000001d;
}
}
public bool CanResetZoom {
get {
- return zoom != 1d;
+ return Zoom != 1d;
}
}
public void ZoomIn ()
{
- int oldPow = (int)System.Math.Round (System.Math.Log (zoom) / System.Math.Log (ZOOM_FACTOR));
+ int oldPow = (int)System.Math.Round (System.Math.Log (Zoom) / System.Math.Log (ZOOM_FACTOR));
Zoom = System.Math.Pow (ZOOM_FACTOR, oldPow + 1);
}
public void ZoomOut ()
{
- int oldPow = (int)System.Math.Round (System.Math.Log (zoom) / System.Math.Log (ZOOM_FACTOR));
+ int oldPow = (int)System.Math.Round (System.Math.Log (Zoom) / System.Math.Log (ZOOM_FACTOR));
Zoom = System.Math.Pow (ZOOM_FACTOR, oldPow - 1);
}
@@ -345,7 +363,7 @@ namespace Mono.TextEditor
}
}
- void DisposeFont ()
+ protected void DisposeFont ()
{
if (font != null) {
font.Dispose ();
@@ -543,7 +561,7 @@ namespace Mono.TextEditor
public virtual void CopyFrom (TextEditorOptions other)
{
- zoom = other.zoom;
+ Zoom = other.Zoom;
highlightMatchingBracket = other.highlightMatchingBracket;
tabsToSpaces = other.tabsToSpaces;
indentationSize = other.indentationSize;
@@ -568,11 +586,27 @@ namespace Mono.TextEditor
DisposeFont ();
OnChanged (EventArgs.Empty);
}
-
+
+ public TextEditorOptions (bool zoomOverride = false)
+ {
+ ZoomOverride = zoomOverride;
+ if (!ZoomOverride)
+ StaticZoomChanged += HandleStaticZoomChanged;
+ }
+
public virtual void Dispose ()
{
+ if (!ZoomOverride)
+ StaticZoomChanged -= HandleStaticZoomChanged;
}
-
+
+ void HandleStaticZoomChanged (object sender, EventArgs e)
+ {
+ DisposeFont ();
+ ZoomChanged?.Invoke (this, EventArgs.Empty);
+ OnChanged (EventArgs.Empty);
+ }
+
protected void OnChanged (EventArgs args)
{
if (Changed != null)
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextLineMarker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextLineMarker.cs
index 90f5d5fc52..0e87da7b3b 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextLineMarker.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextLineMarker.cs
@@ -31,8 +31,8 @@ namespace Mono.TextEditor
{
public interface IExtendingTextLineMarker
{
- double GetLineHeight (TextEditor editor);
- void Draw (TextEditor editor, Cairo.Context cr, int lineNr, Cairo.Rectangle lineArea);
+ double GetLineHeight (MonoTextEditor editor);
+ void Draw (MonoTextEditor editor, Cairo.Context cr, int lineNr, Cairo.Rectangle lineArea);
}
public interface IActionTextLineMarker
@@ -40,9 +40,10 @@ namespace Mono.TextEditor
/// <returns>
/// true, if the mouse press was handled - false otherwise.
/// </returns>
- bool MousePressed (TextEditor editor, MarginMouseEventArgs args);
-
- void MouseHover (TextEditor editor, MarginMouseEventArgs args, TextLineMarkerHoverResult result);
+ bool MousePressed (MonoTextEditor editor, MarginMouseEventArgs args);
+ bool MouseReleased (MonoTextEditor editor, MarginMouseEventArgs args);
+
+ void MouseHover (MonoTextEditor editor, MarginMouseEventArgs args, TextLineMarkerHoverResult result);
}
public class TextLineMarkerHoverResult
@@ -90,6 +91,8 @@ namespace Mono.TextEditor
public double LineHeight { get; internal set; }
public double WholeLineWidth { get; internal set; }
+
+ public double LineYRenderStartPosition { get; internal set; }
}
public class EndOfLineMetrics
@@ -97,6 +100,7 @@ namespace Mono.TextEditor
public DocumentLine LineSegment { get; internal set; }
public double TextRenderEndPosition { get; internal set; }
public double LineHeight { get; internal set; }
+ public double LineYRenderStartPosition { get; internal set; }
}
public class TextLineMarker
@@ -116,7 +120,11 @@ namespace Mono.TextEditor
get;
set;
}
-
+
+ public object Tag {
+ get;
+ set;
+ }
bool isVisible = true;
public virtual bool IsVisible {
@@ -128,7 +136,7 @@ namespace Mono.TextEditor
{
}
- public virtual void Draw (TextEditor editor, Cairo.Context cr, double y, LineMetrics metrics)
+ public virtual void Draw (MonoTextEditor editor, Cairo.Context cr, LineMetrics metrics)
{
}
@@ -143,9 +151,8 @@ namespace Mono.TextEditor
/// <returns><c>true</c>, if background was drawn, <c>false</c> otherwise.</returns>
/// <param name="editor">The editor.</param>
/// <param name="cr">The cairo context.</param>
- /// <param name="y">The y coordinate.</param>
/// <param name="metrics">The line metrics.</param>
- public virtual bool DrawBackground (TextEditor editor, Cairo.Context cr, double y, LineMetrics metrics)
+ public virtual bool DrawBackground (MonoTextEditor editor, Cairo.Context cr, LineMetrics metrics)
{
return false;
}
@@ -153,7 +160,7 @@ namespace Mono.TextEditor
/// <summary>
/// Is used to draw in the area after the visible text.
/// </summary>
- public virtual void DrawAfterEol (TextEditor textEditor, Cairo.Context cr, double y, EndOfLineMetrics lineHeight)
+ public virtual void DrawAfterEol (MonoTextEditor textEditor, Cairo.Context cr, EndOfLineMetrics metrics)
{
}
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextLinkEditMode.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextLinkEditMode.cs
index 16415127e2..bc5fc1f175 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextLinkEditMode.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextLinkEditMode.cs
@@ -27,6 +27,8 @@ using System;
using System.Linq;
using System.Collections.Generic;
using Mono.TextEditor.PopupWindow;
+using System.Threading.Tasks;
+using System.Threading;
namespace Mono.TextEditor
{
@@ -188,7 +190,7 @@ namespace Mono.TextEditor
TextLinkTooltipProvider tooltipProvider;
- public TextLinkEditMode (TextEditor editor, int baseOffset, List<TextLink> links)
+ public TextLinkEditMode (MonoTextEditor editor, int baseOffset, List<TextLink> links)
{
this.editor = editor;
this.links = links;
@@ -547,19 +549,19 @@ namespace Mono.TextEditor
this.mode = mode;
}
#region ITooltipProvider implementation
- public override TooltipItem GetItem (TextEditor Editor, int offset)
+ public override Task<TooltipItem> GetItem (MonoTextEditor Editor, int offset, CancellationToken token = default(CancellationToken))
{
int o = offset - mode.BaseOffset;
for (int i = 0; i < mode.Links.Count; i++) {
TextLink l = mode.Links [i];
if (!l.PrimaryLink.IsInvalid && l.PrimaryLink.Offset <= o && o <= l.PrimaryLink.EndOffset)
- return new TooltipItem (l, l.PrimaryLink.Offset, l.PrimaryLink.Length);
+ return Task.FromResult (new TooltipItem (l, l.PrimaryLink.Offset, l.PrimaryLink.Length));
}
- return null;
+ return Task.FromResult<TooltipItem> (null);
//return mode.Links.First (l => l.PrimaryLink != null && l.PrimaryLink.Offset <= o && o <= l.PrimaryLink.EndOffset);
}
- protected override Gtk.Window CreateTooltipWindow (TextEditor Editor, int offset, Gdk.ModifierType modifierState, TooltipItem item)
+ public override Gtk.Window CreateTooltipWindow (MonoTextEditor Editor, int offset, Gdk.ModifierType modifierState, TooltipItem item)
{
TextLink link = item.Item as TextLink;
if (link == null || string.IsNullOrEmpty (link.Tooltip))
@@ -570,7 +572,7 @@ namespace Mono.TextEditor
return window;
}
- protected override void GetRequiredPosition (TextEditor Editor, Gtk.Window tipWindow, out int requiredWidth, out double xalign)
+ protected override void GetRequiredPosition (MonoTextEditor Editor, Gtk.Window tipWindow, out int requiredWidth, out double xalign)
{
TooltipWindow win = (TooltipWindow)tipWindow;
requiredWidth = win.SetMaxWidth (win.Screen.Width);
@@ -594,7 +596,7 @@ namespace Mono.TextEditor
IsVisible = true;
}
- public override bool DrawBackground (TextEditor editor, Cairo.Context cr, double y, LineMetrics metrics)
+ public override bool DrawBackground (MonoTextEditor editor, Cairo.Context cr, LineMetrics metrics)
{
int caretOffset = editor.Caret.Offset - BaseOffset;
@@ -625,7 +627,7 @@ namespace Mono.TextEditor
double x1 = metrics.TextRenderStartPosition + x_pos - 1;
double x2 = metrics.TextRenderStartPosition + x_pos2 - 1 + 0.5;
- cr.Rectangle (x1 + 0.5, y + 0.5, x2 - x1, editor.LineHeight - 1);
+ cr.Rectangle (x1 + 0.5, metrics.LineYRenderStartPosition + 0.5, x2 - x1, editor.LineHeight - 1);
cr.SetSourceColor (fillGc);
cr.FillPreserve ();
@@ -649,7 +651,7 @@ namespace Mono.TextEditor
return margin is GutterMargin;
}
- public override bool DrawBackground (TextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
+ public override bool DrawBackground (MonoTextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
{
var width = metrics.Width;
@@ -661,7 +663,7 @@ namespace Mono.TextEditor
return true;
}
- public override void DrawForeground (TextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
+ public override void DrawForeground (MonoTextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
{
var width = metrics.Width;
var lineNumberBgGC = editor.ColorStyle.LineNumbers.Background;
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextSegmentMarker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextSegmentMarker.cs
index cb2c35d223..1e6182c817 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/TextSegmentMarker.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/TextSegmentMarker.cs
@@ -32,7 +32,7 @@ namespace Mono.TextEditor
{
public class TextSegmentMarker : TreeSegment
{
-
+ internal int insertId;
public virtual TextLineMarkerFlags Flags {
get;
set;
@@ -53,7 +53,11 @@ namespace Mono.TextEditor
{
}
- public virtual void Draw (TextEditor editor, Cairo.Context cr, Pango.Layout layout, bool selected, int startOffset, int endOffset, double y, double startXPos, double endXPos)
+ public virtual void Draw (MonoTextEditor editor, Context cr, LineMetrics metrics, int startOffset, int endOffset)
+ {
+ }
+
+ public virtual void DrawBackground (MonoTextEditor editor, Context cr, LineMetrics metrics, int startOffset, int endOffset)
{
}
@@ -67,7 +71,7 @@ namespace Mono.TextEditor
{
void TransformChunks (List<Chunk> chunks);
- void ChangeForeColor (TextEditor editor, Chunk chunk, ref Cairo.Color color);
+ void ChangeForeColor (MonoTextEditor editor, Chunk chunk, ref Cairo.Color color);
}
public class UnderlineTextSegmentMarker : TextSegmentMarker
@@ -88,14 +92,16 @@ namespace Mono.TextEditor
public Cairo.Color Color { get; set; }
public bool Wave { get; set; }
- public override void Draw (TextEditor editor, Cairo.Context cr, Pango.Layout layout, bool selected, int startOffset, int endOffset, double y, double startXPos, double endXPos)
+ public override void Draw (MonoTextEditor editor, Cairo.Context cr, LineMetrics metrics, int startOffset, int endOffset)
{
int markerStart = Segment.Offset;
int markerEnd = Segment.EndOffset;
if (markerEnd < startOffset || markerStart > endOffset)
return;
-
-
+ var layout = metrics.Layout.Layout;
+ double startXPos = metrics.TextRenderStartPosition;
+ double endXPos = metrics.TextRenderEndPosition;
+ double y = metrics.LineYRenderStartPosition;
if (editor.IsSomethingSelected) {
var range = editor.SelectionRange;
if (range.Contains (markerStart)) {
@@ -121,7 +127,7 @@ namespace Mono.TextEditor
InternalDraw (markerStart, markerEnd, editor, cr, layout, false, startOffset, endOffset, y, startXPos, endXPos);
}
- void InternalDraw (int markerStart, int markerEnd, TextEditor editor, Cairo.Context cr, Pango.Layout layout, bool selected, int startOffset, int endOffset, double y, double startXPos, double endXPos)
+ void InternalDraw (int markerStart, int markerEnd, MonoTextEditor editor, Cairo.Context cr, Pango.Layout layout, bool selected, int startOffset, int endOffset, double y, double startXPos, double endXPos)
{
if (markerStart >= markerEnd)
return;
@@ -135,10 +141,10 @@ namespace Mono.TextEditor
int end = endOffset < markerEnd ? endOffset : markerEnd;
int /*lineNr,*/ x_pos;
- x_pos = layout.IndexToPos (start - startOffset).X;
+ x_pos = layout.IndexToPos (System.Math.Max (0, start - startOffset)).X;
@from = startXPos + (int)(x_pos / Pango.Scale.PangoScale);
- x_pos = layout.IndexToPos (end - startOffset).X;
+ x_pos = layout.IndexToPos (System.Math.Max (0, end - startOffset)).X;
to = startXPos + (int)(x_pos / Pango.Scale.PangoScale);
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/UnderlineMarker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/UnderlineMarker.cs
index 0e8f4240d2..06698c143b 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/UnderlineMarker.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/UnderlineMarker.cs
@@ -57,12 +57,13 @@ namespace Mono.TextEditor
public int EndCol { get; set; }
public bool Wave { get; set; }
- public override void Draw (TextEditor editor, Cairo.Context cr, double y, LineMetrics metrics)
+ public override void Draw (MonoTextEditor editor, Cairo.Context cr, LineMetrics metrics)
{
var startOffset = metrics.TextStartOffset;
int endOffset = metrics.TextEndOffset;
double startXPos = metrics.TextRenderStartPosition;
double endXPos = metrics.TextRenderEndPosition;
+ double y = metrics.LineYRenderStartPosition;
var layout = metrics.Layout.Layout;
int markerStart = LineSegment.Offset + System.Math.Max (StartCol - 1, 0);
@@ -95,7 +96,7 @@ namespace Mono.TextEditor
InternalDraw (markerStart, markerEnd, editor, cr, layout, false, startOffset, endOffset, y, startXPos, endXPos);
}
- void InternalDraw (int markerStart, int markerEnd, TextEditor editor, Cairo.Context cr, Pango.Layout layout, bool selected, int startOffset, int endOffset, double y, double startXPos, double endXPos)
+ void InternalDraw (int markerStart, int markerEnd, MonoTextEditor editor, Cairo.Context cr, Pango.Layout layout, bool selected, int startOffset, int endOffset, double y, double startXPos, double endXPos)
{
if (markerStart >= markerEnd)
return;
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/UrlMarker.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/UrlMarker.cs
index 88469244a8..681fee2e66 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/UrlMarker.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/UrlMarker.cs
@@ -100,12 +100,13 @@ namespace Mono.TextEditor
line = null;
}
- public override void Draw (TextEditor editor, Cairo.Context cr, double y, LineMetrics metrics)
+ public override void Draw (MonoTextEditor editor, Cairo.Context cr, LineMetrics metrics)
{
var startOffset = metrics.TextStartOffset;
int endOffset = metrics.TextEndOffset;
double startXPos = metrics.TextRenderStartPosition;
double endXPos = metrics.TextRenderEndPosition;
+ double y = metrics.LineYRenderStartPosition;
var layout = metrics.Layout.Layout;
int markerStart = line.Offset + startColumn;
int markerEnd = line.Offset + endColumn;
diff --git a/main/src/core/Mono.Texteditor/Styles/DarkStyle.json b/main/src/core/Mono.Texteditor/Styles/DarkStyle.json
new file mode 100644
index 0000000000..2f3d61b77c
--- /dev/null
+++ b/main/src/core/Mono.Texteditor/Styles/DarkStyle.json
@@ -0,0 +1,247 @@
+{
+ "name": "Dark",
+ "version": "1.0.3",
+ "description": "A dark scheme using colors from the Tango Project",
+ "originator": "Xamarin Inc. (http://xamarin.com)",
+
+ "palette": [
+ { "name": "butter2", "value": "#edd400" },
+ { "name": "orange1", "value": "#fcaf3e" },
+ { "name": "orange2", "value": "#f57900" },
+ { "name": "chocolate1", "value": "#e9b96e" },
+ { "name": "chocolate2", "value": "#c17d11" },
+ { "name": "chocolate3", "value": "#8f5902" },
+ { "name": "chameleon1", "value": "#8ae234" },
+ { "name": "chameleon2", "value": "#73d216" },
+ { "name": "chameleon3", "value": "#4e9a06" },
+ { "name": "chameleon4", "value": "#356904" },
+ { "name": "skyblue1", "value": "#729fcf" },
+ { "name": "skyblue2", "value": "#3465a4" },
+ { "name": "skyblue3", "value": "#204a87" },
+ { "name": "plum1", "value": "#ad7fa8" },
+ { "name": "scarletred1", "value": "#ef2929" },
+ { "name": "scarletred2", "value": "#cc0000" },
+ { "name": "aluminium1", "value": "#eeeeec" },
+ { "name": "aluminium2", "value": "#d3d7cf" },
+ { "name": "aluminium3", "value": "#babdb6" },
+ { "name": "aluminium4", "value": "#888a85" },
+ { "name": "aluminium5", "value": "#555753" },
+ { "name": "aluminium6", "value": "#2e3436" },
+ { "name": "aluminium7", "value": "#0e1416" }
+ ],
+
+ "colors": [
+ { "name": "Background(Read Only)", "color": "aluminium7" },
+
+ { "name": "Search result background", "color": "#006060" },
+ { "name": "Search result background (highlighted)", "color": "#008080" },
+
+ { "name": "Column Ruler", "color": "#2a2c2f" },
+
+ { "name": "Fold Square", "color": "aluminium5", "secondcolor": "#1c1e1f" },
+ { "name": "Fold Cross", "color": "aluminium5", "secondcolor": "#1c1e1f" },
+
+ { "name": "Indentation Guide", "color": "#444a4d" },
+
+ { "name": "Indicator Margin", "color": "#303030" },
+ { "name": "Indicator Margin(Separator)", "color": "#303030" },
+
+ { "name": "Tooltip Pager Top", "color": "aluminium5" },
+ { "name": "Tooltip Pager Triangle", "color": "aluminium2" },
+ { "name": "Tooltip Pager Text", "color": "aluminium2" },
+
+ { "name": "Notification Border", "color": "aluminium1" },
+
+ { "name": "Completion Window", "color": "aluminium6", "bordercolor": "aluminium1" },
+ { "name": "Completion Tooltip Window", "color": "aluminium5", "bordercolor": "aluminium1" },
+ { "name": "Completion Selection Bar Border", "color": "aluminium5" },
+ { "name": "Completion Selection Bar Border(Inactive)", "color": "aluminium7" },
+ { "name": "Completion Selection Bar Background", "color": "aluminium5", "secondcolor": "aluminium5" },
+ { "name": "Completion Selection Bar Background(Inactive)", "color": "aluminium7", "secondcolor": "aluminium7" },
+
+ { "name": "Bookmarks", "color": "aluminium1", "secondcolor": "aluminium4" },
+
+ { "name": "Underline(Error)", "color": "scarletred2" },
+ { "name": "Underline(Warning)", "color": "butter2" },
+ { "name": "Underline(Suggestion)", "color": "chameleon3" },
+ { "name": "Underline(Hint)", "color": "chameleon2" },
+
+ { "name": "Quick Diff(Dirty)", "color": "butter2" },
+ { "name": "Quick Diff(Changed)", "color": "chameleon2" },
+
+ { "name": "Brace Matching(Rectangle)", "color": "aluminium4", "secondcolor": "aluminium4" },
+ { "name": "Usages(Rectangle)", "color": "skyblue3", "secondcolor": "skyblue3", "bordercolor": "skyblue2" },
+ { "name": "Changing usages(Rectangle)", "color": "chameleon4", "secondcolor": "chameleon4", "bordercolor": "chameleon3" },
+
+ { "name": "Breakpoint Marker", "color": "#6f3535", "bordercolor": "#6f3535" },
+ { "name": "Breakpoint Marker(Disabled)", "color": "#4d4d4d", "bordercolor": "#4d4d4d" },
+ { "name": "Breakpoint Marker(Invalid)", "color": "#604343", "bordercolor": "#604343" },
+
+ { "name": "Current Line Marker", "color": "#2a2c2f", "secondcolor": "#2a2c2f" },
+ { "name": "Current Line Marker(Inactive)", "color": "#2a2c2f", "secondcolor": "#2a2c2f" },
+
+ { "name": "Debugger Current Line Marker", "color": "#69684c", "bordercolor": "#69684c" },
+ { "name": "Debugger Stack Line Marker", "color": "#5f7247", "bordercolor": "#5f7247" },
+
+ { "name": "Primary Link", "color": "chocolate1", "secondcolor": "chocolate3" },
+ { "name": "Primary Link(Highlighted)", "color": "chocolate1", "secondcolor": "chocolate2" },
+ { "name": "Secondary Link", "color": "white", "secondcolor": "aluminium6" },
+ { "name": "Secondary Link(Highlighted)", "color": "aluminium1", "secondcolor": "aluminium5" },
+
+ { "name": "Message Bubble Error Marker", "color": "#b28d37" },
+ { "name": "Message Bubble Error Tag", "color": "#e3a6a1", "secondcolor": "black" },
+ { "name": "Message Bubble Error Counter", "color": "black", "secondcolor": "#e3a6a1" },
+ { "name": "Message Bubble Error IconMargin", "color": "#735c54", "bordercolor": "#805b4d" },
+ { "name": "Message Bubble Error Line", "color": "#7b645c" },
+ { "name": "Message Bubble Error Tooltip", "color": "#e3a6a1" },
+
+ { "name": "Message Bubble Warning Tag", "color": "#efe89d", "secondcolor": "black" },
+ { "name": "Message Bubble Warning Counter", "color": "black", "secondcolor": "#efe89d" },
+ { "name": "Message Bubble Warning IconMargin", "color": "#777553", "bordercolor": "#948e51" },
+ { "name": "Message Bubble Warning Line", "color": "#807e5c" },
+ { "name": "Message Bubble Warning Tooltip", "color": "#efe89d" },
+
+ { "name": "Link Color", "color": "#41e2cb" },
+ { "name": "Link Color(Active)", "color": "#41e2cb" }
+ ],
+
+ "text": [
+ { "name": "Plain Text", "fore": "aluminium1", "back": "#1c1e1f" },
+ { "name": "Selected Text", "back": "#245176" },
+ { "name": "Selected Text(Inactive)", "back": "aluminium5" },
+
+ { "name": "Collapsed Text", "fore": "aluminium4", "back": "#1c1e1f" },
+
+ { "name": "Line Numbers", "fore": "aluminium5", "back": "#242424" },
+
+ { "name": "Punctuation", "fore": "aluminium1" },
+ { "name": "Punctuation(Brackets)", "fore": "aluminium1" },
+
+ { "name": "Comment(Line)", "fore": "aluminium4" },
+ { "name": "Comment(Block)", "fore": "aluminium4" },
+ { "name": "Comment(Doc)", "fore": "aluminium3" },
+ { "name": "Comment(DocTag)", "fore": "aluminium4" },
+ { "name": "Comment Tag", "fore": "#ff00ff" },
+
+ { "name": "Excluded Code", "fore": "aluminium4" },
+
+ { "name": "String", "fore": "#E6DB74" },
+ { "name": "String(Escape)", "fore": "#A6AB34" },
+ { "name": "String(C# @ Verbatim)", "fore": "#E6DB74" },
+ { "name": "String(Regex Set Constructs)", "fore": "chameleon2" },
+ { "name": "String(Regex Character Class)", "fore": "skyblue1" },
+ { "name": "String(Regex Grouping Constructs)", "fore": "plum1" },
+ { "name": "String(Regex Escape Character)", "fore": "orange2" },
+ { "name": "String(Regex Alt Escape Character)", "fore": "orange1" },
+
+ { "name": "Number", "fore": "chameleon1" },
+
+ { "name": "Preprocessor", "fore": "plum1" },
+ { "name": "Preprocessor(Region Name)", "fore": "aluminium1" },
+
+ { "name": "Xml Text", "fore": "aluminium1" },
+ { "name": "Xml Delimiter", "fore": "aluminium1" },
+ { "name": "Xml Name", "fore": "skyblue1" },
+ { "name": "Xml Attribute", "fore": "aluminium1" },
+ { "name": "Xml Attribute Quotes", "fore": "#E6DB74" },
+ { "name": "Xml Attribute Value", "fore": "#E6DB74" },
+ { "name": "Xml Comment", "fore": "aluminium4" },
+ { "name": "Xml CData Section", "fore": "aluminium1" },
+
+ { "name": "Html Attribute Name", "fore": "aluminium1" },
+ { "name": "Html Attribute Value", "fore": "#E6DB74" },
+ { "name": "Html Comment", "fore": "aluminium4" },
+ { "name": "Html Element Name", "fore": "skyblue1" },
+ { "name": "Html Entity", "fore": "skyblue1" },
+ { "name": "Html Operator", "fore": "aluminium1" },
+ { "name": "Html Server-Side Script", "fore": "butter2", "back": "black" },
+ { "name": "Html Tag Delimiter", "fore": "aluminium1" },
+ { "name": "Razor Code", "fore": "aluminium1", "back": "aluminium7" },
+
+ { "name": "Tooltip Text", "fore": "#d1d1cd", "back": "#525759" },
+ { "name": "Notification Text", "fore": "aluminium1", "back": "aluminium5" },
+
+ { "name": "Completion Text", "fore": "aluminium1" },
+ { "name": "Completion Matching Substring", "fore": "plum1" },
+
+ { "name": "Completion Selected Text", "fore": "aluminium1" },
+ { "name": "Completion Selected Matching Substring", "fore": "plum1" },
+
+ { "name": "Completion Selected Text(Inactive)", "fore": "aluminium1" },
+ { "name": "Completion Selected Matching Substring(Inactive)", "fore": "plum1" },
+
+ { "name": "Keyword(Access)", "fore": "skyblue1" },
+ { "name": "Keyword(Type)", "fore": "skyblue1" },
+ { "name": "Keyword(Operator)", "fore": "skyblue1" },
+ { "name": "Keyword(Selection)", "fore": "skyblue1" },
+ { "name": "Keyword(Iteration)", "fore": "skyblue1" },
+ { "name": "Keyword(Jump)", "fore": "skyblue1" },
+ { "name": "Keyword(Context)", "fore": "skyblue1" },
+ { "name": "Keyword(Exception)", "fore": "skyblue1" },
+ { "name": "Keyword(Modifiers)", "fore": "skyblue1" },
+ { "name": "Keyword(Constants)", "fore": "skyblue1" },
+ { "name": "Keyword(Void)", "fore": "skyblue1" },
+ { "name": "Keyword(Namespace)", "fore": "skyblue1" },
+ { "name": "Keyword(Property)", "fore": "skyblue1" },
+ { "name": "Keyword(Declaration)", "fore": "skyblue1" },
+ { "name": "Keyword(Parameter)", "fore": "skyblue1" },
+ { "name": "Keyword(Operator Declaration)", "fore": "skyblue1" },
+ { "name": "Keyword(Other)", "fore": "skyblue1" },
+
+ { "name": "User Types", "fore": "#4ec9b0" },
+ { "name": "User Types(Enums)", "fore": "#b8d7a3" },
+ { "name": "User Types(Interfaces)", "fore": "#b8d7a3" },
+ { "name": "User Types(Delegates)", "fore": "#4ec9b0" },
+ { "name": "User Types(Value types)", "fore": "#4ec9b0" },
+ { "name": "User Types(Type parameters)", "fore": "#4ec9b0" },
+ { "name": "User Types(Mutable)", "fore": "#ffd21c" },
+
+ { "name": "User Field Usage", "fore": "aluminium1" },
+ { "name": "User Field Declaration", "fore": "aluminium1" },
+
+ { "name": "User Property Usage", "fore": "aluminium1" },
+ { "name": "User Property Declaration", "fore": "aluminium1" },
+
+ { "name": "User Event Usage", "fore": "aluminium1" },
+ { "name": "User Event Declaration", "fore": "aluminium1" },
+
+ { "name": "User Method Usage", "fore": "aluminium1" },
+ { "name": "User Method Declaration", "fore": "aluminium1" },
+
+ { "name": "User Parameter Usage", "fore": "aluminium1" },
+ { "name": "User Parameter Declaration", "fore": "aluminium1" },
+
+ { "name": "User Variable Usage", "fore": "aluminium1" },
+ { "name": "User Variable Declaration", "fore": "aluminium1" },
+
+ { "name": "Syntax Error", "fore": "scarletred1" },
+
+ { "name": "String Format Items", "fore": "aluminium1" },
+
+ { "name": "Breakpoint Text", "fore": "white", "back": "#6f3535" },
+
+ { "name": "Debugger Current Statement", "fore": "white", "back": "#69684c" },
+ { "name": "Debugger Stack Line", "fore": "white", "back": "#5c6b4d" },
+
+ { "name": "Diff Line(Added)", "fore": "chameleon1" },
+ { "name": "Diff Line(Removed)", "fore": "scarletred2" },
+ { "name": "Diff Line(Changed)", "fore": "plum1" },
+ { "name": "Diff Header", "fore": "chameleon1", "weight": "bold" },
+ { "name": "Diff Header(Separator)", "fore": "aluminium4", "weight": "bold" },
+ { "name": "Diff Header(Old)", "fore": "scarletred2", "weight": "bold" },
+ { "name": "Diff Header(New)", "fore": "chameleon1", "weight": "bold" },
+ { "name": "Diff Location", "fore": "chameleon1", "weight": "bold" },
+
+ { "name": "Css Comment", "fore": "aluminium4", "weight": "bold" },
+ { "name": "Css Property Name", "fore": "aluminium1", "weight": "bold" },
+ { "name": "Css Property Value", "fore": "butter2", "weight": "bold" },
+ { "name": "Css Selector", "fore": "aluminium1", "weight": "bold" },
+ { "name": "Css String Value", "fore": "butter2", "weight": "bold" },
+ { "name": "Css Keyword", "fore": "plum1", "weight": "bold" },
+
+ { "name": "Script Comment", "fore": "aluminium4" },
+ { "name": "Script Keyword", "fore": "plum1" },
+ { "name": "Script Number", "fore": "butter2" },
+ { "name": "Script String", "fore": "butter2" }
+ ]
+}
diff --git a/main/src/core/Mono.Texteditor/Styles/DefaultStyle.json b/main/src/core/Mono.Texteditor/Styles/DefaultStyle.json
deleted file mode 100644
index d38ce55e4e..0000000000
--- a/main/src/core/Mono.Texteditor/Styles/DefaultStyle.json
+++ /dev/null
@@ -1,237 +0,0 @@
-{
- "name":"Default",
- "version":"1.3.1",
- "description":"Bright and friendly, just like Xamarin.",
- "originator":"Xamarin Inc. (http://xamarin.com)",
-
- "palette":[
- { "name":"butter2", "value":"#edd400" },
- { "name":"chameleon1", "value":"#8ae234" },
- { "name":"chameleon2", "value":"#73d216" },
- { "name":"chameleon3", "value":"#4e9a06" },
- { "name":"chocolate1", "value":"#e9b96e" },
- { "name":"chocolate2", "value":"#c17d11" },
- { "name":"chocolate3", "value":"#8f5902" },
- { "name":"skyblue1", "value":"#729fcf" },
- { "name":"skyblue2", "value":"#3465a4" },
- { "name":"plum2", "value":"#75507b" },
- { "name":"scarletred1", "value":"#ef2929" },
- { "name":"aluminium1", "value":"#eeeeec" },
- { "name":"aluminium2", "value":"#d3d7cf" },
- { "name":"aluminium3", "value":"#babdb6" },
- { "name":"aluminium4", "value":"#888a85" },
- { "name":"aluminium5", "value":"#555753" },
- { "name":"aluminium6", "value":"#2e3436" },
- { "name":"text-black", "value":"#333" },
- { "name":"comment-gray", "value":"#888" },
- { "name":"literal-orange", "value":"#F57E00" },
- { "name":"literal-escape", "value":"#A53E00" },
- { "name":"keyword-teal", "value":"#009695" },
- { "name":"selection-bg", "value":"#b5d5ff" },
- { "name":"invalid-red", "value":"#C44D58" },
- { "name":"orangesicle", "value":"#fdab75" },
- { "name":"orangesicle-light", "value":"#fed9c0" }
- ],
-
- "colors":[
- { "name":"Background(Read Only)", "color":"white" },
-
- { "name":"Search result background", "color":"#fffeb7" },
- { "name":"Search result background (highlighted)", "color":"#fffc38" },
-
- { "name":"Column Ruler", "color":"aluminium3" },
-
- { "name":"Fold Square", "color":"aluminium4", "secondcolor":"white" },
- { "name":"Fold Cross", "color":"aluminium4", "secondcolor":"white" },
-
- { "name":"Indentation Guide", "color":"aluminium2" },
-
- { "name":"Indicator Margin", "color":"aluminium1" },
- { "name":"Indicator Margin(Separator)", "color":"aluminium3" },
-
- { "name":"Tooltip Border", "color":"#b2b2b2" },
- { "name":"Tooltip Pager Top", "color":"#ffffff" },
- { "name":"Tooltip Pager Bottom", "color":"#f5f5f5" },
- { "name":"Tooltip Pager Triangle", "color":"#737373" },
- { "name":"Tooltip Pager Text", "color":"#828282" },
-
- { "name":"Notification Border", "color":"#D2B457" },
-
- { "name":"Completion Matching Substring", "color":"#BA3373" },
- { "name":"Completion Border", "color":"#C9C9C9" },
- { "name":"Completion Border(Inactive)", "color":"#666666" },
-
- { "name":"Bookmarks", "color":"white", "secondcolor":"skyblue" },
-
- { "name":"Underline(Error)", "color":"#E896A0" },
- { "name":"Underline(Warning)", "color":"#FEB958" },
- { "name":"Underline(Suggestion)", "color":"#9CC0EA" },
- { "name":"Underline(Hint)", "color":"#9CC0EA" },
-
- { "name":"Quick Diff(Dirty)", "color":"orangesicle-light" },
- { "name":"Quick Diff(Changed)", "color":"orangesicle" },
-
- { "name":"Brace Matching(Rectangle)", "color":"orangesicle", "secondcolor":"orangesicle-light" },
- { "name":"Usages(Rectangle)", "color":"#B1DFF9", "secondcolor":"#B1DFF9", "bordercolor":"#B1DFF9" },
- { "name":"Changing usages(Rectangle)", "color":"#FFD6DD", "secondcolor":"#FFD6DD", "bordercolor":"#FFD6DD" },
-
- { "name":"Breakpoint Marker", "color":"#f9dbda", "bordercolor":"#ebcccb" },
- { "name":"Breakpoint Marker(Disabled)", "color":"#e9e9e9", "bordercolor":"#dbdbdb" },
- { "name":"Breakpoint Marker(Invalid)", "color":"#f1e3e3", "bordercolor":"#e3d5d5" },
-
- { "name":"Current Line Marker", "color":"aluminium1", "secondcolor":"aluminium2" },
- { "name":"Current Line Marker(Inactive)", "color":"aluminium2", "secondcolor":"aluminium3" },
-
- { "name":"Debugger Current Line Marker", "color":"#f8f4a1", "bordercolor":"#ede993" },
- { "name":"Debugger Stack Line Marker", "color":"#ccfca6", "bordercolor":"#bff197" },
-
- { "name":"Primary Link", "color":"chameleon3", "secondcolor":"chameleon2" },
- { "name":"Primary Link(Highlighted)", "color":"chameleon3", "secondcolor":"chameleon1" },
- { "name":"Secondary Link", "color":"aluminium2", "secondcolor":"white" },
- { "name":"Secondary Link(Highlighted)", "color":"aluminium3", "secondcolor":"aluminium1" },
-
- { "name":"Message Bubble Error Marker", "color":"#df6962" },
- { "name":"Message Bubble Error Tag", "color":"#d83f3f", "secondcolor":"white" },
- { "name":"Message Bubble Error Counter", "color":"white", "secondcolor":"#d83f3f" },
- { "name":"Message Bubble Error IconMargin", "color":"#d83f3f", "bordercolor":"#b12a2a" },
- { "name":"Message Bubble Error Line", "color":"#fbe4e6" },
- { "name":"Message Bubble Error Tooltip", "color":"#D10B0B" },
-
- { "name":"Message Bubble Warning Marker", "color":"#b28d37" },
- { "name":"Message Bubble Warning Tag", "color":"#e68100", "secondcolor":"white" },
- { "name":"Message Bubble Warning Counter", "color":"white", "secondcolor":"#e68100" },
- { "name":"Message Bubble Warning IconMargin", "color":"#e68100", "bordercolor":"#c76f00" },
- { "name":"Message Bubble Warning Line", "color":"#fff1da" },
- { "name":"Message Bubble Warning Tooltip", "color":"#D1590B" }
- ],
-
- "text":[
- { "name":"Plain Text", "fore":"text-black", "back":"white" },
- { "name":"Selected Text", "back":"selection-bg" },
- { "name":"Selected Text(Inactive)", "back":"aluminium2" },
-
- { "name":"Collapsed Text", "fore":"aluminium4", "back":"white" },
-
- { "name":"Line Numbers", "fore":"aluminium4", "back":"white" },
-
- { "name":"Punctuation", "fore":"text-black" },
- { "name":"Punctuation(Brackets)", "fore":"text-black" },
-
- { "name":"Comment(Line)", "fore":"comment-gray", "style":"italic" },
- { "name":"Comment(Block)", "fore":"comment-gray", "style":"italic" },
- { "name":"Comment(Doc)", "fore":"comment-gray", "style":"italic" },
- { "name":"Comment(DocTag)", "fore":"comment-gray", "style":"italic" },
- { "name":"Comment Tag", "fore":"comment-gray", "weight":"bold" },
- { "name":"Excluded Code", "fore":"comment-gray" },
-
- { "name":"String", "fore":"literal-orange" },
- { "name":"String(Escape)", "fore":"literal-escape" },
- { "name":"String(C# @ Verbatim)", "fore":"literal-orange" },
-
- { "name":"Number", "fore":"literal-orange" },
-
- { "name":"Preprocessor", "fore":"#c12dad" },
- { "name":"Preprocessor(Region Name)", "fore":"#c12dad" },
-
- { "name":"Xml Text", "fore":"text-black" },
- { "name":"Xml Delimiter", "fore":"text-black" },
- { "name":"Xml Name", "fore":"skyblue2" },
- { "name":"Xml Attribute", "fore":"text-black" },
- { "name":"Xml Attribute Quotes", "fore":"literal-orange" },
- { "name":"Xml Attribute Value", "fore":"literal-orange" },
- { "name":"Xml Comment", "fore":"comment-gray" },
- { "name":"Xml CData Section", "fore":"text-black" },
-
- { "name":"Html Attribute Name", "fore":"text-black" },
- { "name":"Html Attribute Value", "fore":"literal-orange" },
- { "name":"Html Comment", "fore":"comment-gray" },
- { "name":"Html Element Name", "fore":"skyblue2" },
- { "name":"Html Entity", "fore":"#c12dad" },
- { "name":"Html Operator", "fore":"skyblue2" },
- { "name":"Html Server-Side Script", "fore":"text-black", "back":"#fdf0bd" },
- { "name":"Html Tag Delimiter", "fore":"skyblue2" },
- { "name":"Razor Code", "fore":"text-black", "back":"#fdfaed" },
-
- { "name":"Tooltip Text", "fore":"text-black", "back":"#feffe9" },
- { "name":"Notification Text", "fore":"text-black", "back":"#feffe9" },
-
- { "name":"Completion Text", "fore":"#434343", "back":"#F0F6F8" },
- { "name":"Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
- { "name":"Completion Selected Text(Inactive)", "fore":"#434343", "back":"#FFFFFF" },
-
- { "name":"Keyword(Access)", "fore":"keyword-teal" },
- { "name":"Keyword(Type)", "fore":"keyword-teal" },
- { "name":"Keyword(Operator)", "fore":"keyword-teal" },
- { "name":"Keyword(Selection)", "fore":"keyword-teal" },
- { "name":"Keyword(Iteration)", "fore":"keyword-teal" },
- { "name":"Keyword(Jump)", "fore":"keyword-teal" },
- { "name":"Keyword(Context)", "fore":"keyword-teal" },
- { "name":"Keyword(Exception)", "fore":"keyword-teal" },
- { "name":"Keyword(Modifiers)", "fore":"keyword-teal" },
- { "name":"Keyword(Constants)", "fore":"keyword-teal" },
- { "name":"Keyword(Void)", "fore":"keyword-teal" },
- { "name":"Keyword(Namespace)", "fore":"keyword-teal" },
- { "name":"Keyword(Property)", "fore":"keyword-teal" },
- { "name":"Keyword(Declaration)", "fore":"keyword-teal" },
- { "name":"Keyword(Parameter)", "fore":"keyword-teal" },
- { "name":"Keyword(Operator Declaration)", "fore":"keyword-teal" },
- { "name":"Keyword(Other)", "fore":"keyword-teal" },
-
- { "name":"User Types", "fore":"skyblue2" },
- { "name":"User Types(Enums)", "fore":"skyblue2" },
- { "name":"User Types(Interfaces)", "fore":"skyblue2" },
- { "name":"User Types(Delegates)", "fore":"skyblue2" },
- { "name":"User Types(Value types)", "fore":"skyblue2" },
- { "name":"User Types(Type parameters)", "fore":"skyblue2" },
-
- { "name":"User Field Usage", "fore":"text-black" },
- { "name":"User Field Declaration", "fore":"text-black" },
-
- { "name":"User Property Usage", "fore":"text-black" },
- { "name":"User Property Declaration", "fore":"text-black" },
-
- { "name":"User Event Usage", "fore":"text-black" },
- { "name":"User Event Declaration", "fore":"text-black" },
-
- { "name":"User Method Usage", "fore":"text-black" },
- { "name":"User Method Declaration", "fore":"text-black" },
-
- { "name":"User Parameter Usage", "fore":"text-black" },
- { "name":"User Parameter Declaration", "fore":"text-black" },
-
- { "name":"User Variable Usage", "fore":"text-black" },
- { "name":"User Variable Declaration", "fore":"text-black" },
-
- { "name":"Syntax Error", "fore":"invalid-red" },
-
- { "name":"String Format Items", "fore":"#FF0000" },
-
- { "name":"Breakpoint Text", "fore":"text-black", "back":"#ffe8e7" },
-
- { "name":"Debugger Current Statement", "fore":"text-black", "back":"#f8f4a1" },
- { "name":"Debugger Stack Line", "fore":"text-black", "back":"#ccfca6" },
-
- { "name":"Diff Line(Added)", "fore":"skyblue2" },
- { "name":"Diff Line(Removed)", "fore":"scarletred1" },
- { "name":"Diff Line(Changed)", "fore":"plum2" },
- { "name":"Diff Header", "fore":"chameleon3" },
- { "name":"Diff Header(Separator)", "fore":"chameleon3", "weight":"bold" },
- { "name":"Diff Header(Old)", "fore":"scarletred1", "weight":"bold" },
- { "name":"Diff Header(New)", "fore":"skyblue2", "weight":"bold" },
- { "name":"Diff Location", "fore":"plum2", "weight":"bold" },
-
- { "name":"Css Comment", "fore":"comment-gray", "weight":"bold" },
- { "name":"Css Property Name", "fore":"black", "weight":"bold" },
- { "name":"Css Property Value", "fore":"literal-orange", "weight":"bold" },
- { "name":"Css Selector", "fore":"comment-gray", "weight":"bold" },
- { "name":"Css String Value", "fore":"literal-orange", "weight":"bold" },
- { "name":"Css Keyword", "fore":"keyword-teal", "weight":"bold" },
-
- { "name":"Script Comment", "fore":"comment-gray" },
- { "name":"Script Identifier" },
- { "name":"Script Keyword", "fore":"keyword-teal" },
- { "name":"Script Number", "fore":"literal-orange" },
- { "name":"Script Operator" },
- { "name":"Script String", "fore":"literal-orange" }
- ]
-} \ No newline at end of file
diff --git a/main/src/core/Mono.Texteditor/Styles/GruvboxStyle.json b/main/src/core/Mono.Texteditor/Styles/GruvboxStyle.json
new file mode 100644
index 0000000000..5f530cbf8c
--- /dev/null
+++ b/main/src/core/Mono.Texteditor/Styles/GruvboxStyle.json
@@ -0,0 +1,231 @@
+{
+ "name": "Gruvbox",
+ "version": "1.0.3",
+ "description": "A retro groove color scheme",
+ "originator": "https://github.com/morhetz/gruvbox",
+
+ "palette": [
+ { "name": "selection", "value": "#49483E" },
+ { "name": "chameleon1", "value": "#8ae234" },
+ { "name": "chameleon3", "value": "#4e9a06" },
+ { "name": "background", "value": "#282828" },
+ { "name": "foreground", "value": "#ebdbb2" },
+ { "name": "bright-red", "value": "#fb4934" },
+ { "name": "bright-green", "value": "#b8bb26" },
+ { "name": "neutral-blue", "value": "#458588" },
+ { "name": "bright-blue", "value": "#83a598" },
+ { "name": "bright-purple", "value": "#d3869b" },
+ { "name": "comment", "value": "#75715E" }
+ ],
+
+ "colors": [
+ { "name": "Background(Read Only)", "color": "background" },
+
+ { "name": "Search result background", "color": "#006060" },
+ { "name": "Search result background (highlighted)", "color": "#008080" },
+
+ { "name": "Column Ruler", "color": "#323229" },
+
+ { "name": "Fold Square", "color": "comment", "secondcolor": "background" },
+ { "name": "Fold Cross", "color": "white", "secondcolor": "background" },
+
+ { "name": "Indentation Guide", "color": "comment" },
+
+ { "name": "Indicator Margin", "color": "#3B3A32" },
+ { "name": "Indicator Margin(Separator)", "color": "#3B3A32" },
+
+ { "name": "Tooltip Pager Top", "color": "#757575" },
+ { "name": "Tooltip Pager Triangle", "color": "#ffffff" },
+ { "name": "Tooltip Pager Text", "color": "#ffffff" },
+
+ { "name": "Notification Border", "color": "#989892" },
+
+ { "name": "Completion Window", "color": "background", "bordercolor": "#989892" },
+ { "name": "Completion Tooltip Window", "color": "#272725", "bordercolor": "#989892" },
+ { "name": "Completion Selection Bar Border", "color": "selection" },
+ { "name": "Completion Selection Bar Border(Inactive)", "color": "#383830" },
+ { "name": "Completion Selection Bar Background", "color": "selection" },
+ { "name": "Completion Selection Bar Background(Inactive)", "color": "#383830", "secondcolor": "#383830" },
+
+ { "name": "Bookmarks", "color": "#FDD99B", "secondcolor": "#816647" },
+
+ { "name": "Underline(Error)", "color": "red" },
+ { "name": "Underline(Warning)", "color": "bright-blue" },
+ { "name": "Underline(Suggestion)", "color": "chameleon3" },
+ { "name": "Underline(Hint)", "color": "chameleon1" },
+
+ { "name": "Quick Diff(Dirty)", "color": "bright-green" },
+ { "name": "Quick Diff(Changed)", "color": "#A4E22E" },
+
+ { "name": "Brace Matching(Rectangle)", "color": "#6699CC", "secondcolor": "#AACCEE" },
+ { "name": "Usages(Rectangle)", "color": "#527F99", "secondcolor": "#527F99", "bordercolor": "#527F99" },
+ { "name": "Changing usages(Rectangle)", "color": "#996E75", "secondcolor": "#996E75", "bordercolor": "#996E75" },
+
+ { "name": "Breakpoint Marker", "color": "#6f3535", "bordercolor": "#7a3a3a" },
+ { "name": "Breakpoint Marker(Disabled)", "color": "#707070", "bordercolor": "#7b7b7b" },
+ { "name": "Breakpoint Marker(Invalid)", "color": "#604343", "bordercolor": "#6a4a4a" },
+
+ { "name": "Current Line Marker", "color": "#323229", "secondcolor": "#323229" },
+ { "name": "Current Line Marker(Inactive)", "color": "#2F2F28", "secondcolor": "#2F2F28" },
+
+ { "name": "Debugger Current Line Marker", "color": "#69684c", "bordercolor": "#69684c" },
+ { "name": "Debugger Stack Line Marker", "color": "#5c6b4d", "bordercolor": "#5c6b4d" },
+
+ { "name": "Primary Link", "color": "foreground", "secondcolor": "#7f4a81" },
+ { "name": "Primary Link(Highlighted)", "color": "foreground", "secondcolor": "#b167b3" },
+ { "name": "Secondary Link", "color": "foreground", "secondcolor": "#262228" },
+ { "name": "Secondary Link(Highlighted)", "color": "foreground", "secondcolor": "#4e4552" },
+
+ { "name": "Message Bubble Error Marker", "color": "#b28d37" },
+ { "name": "Message Bubble Error Tag", "color": "#e3a6a1", "secondcolor": "black" },
+ { "name": "Message Bubble Error Counter", "color": "black", "secondcolor": "#e3a6a1" },
+ { "name": "Message Bubble Error IconMargin", "color": "#735c54", "bordercolor": "#805b4d" },
+ { "name": "Message Bubble Error Line", "color": "#7b645c" },
+ { "name": "Message Bubble Error Tooltip", "color": "#e3a6a1" },
+
+ { "name": "Message Bubble Warning Marker", "color": "#b28d37" },
+ { "name": "Message Bubble Warning Tag", "color": "#efe89d", "secondcolor": "black" },
+ { "name": "Message Bubble Warning Counter", "color": "black", "secondcolor": "#efe89d" },
+ { "name": "Message Bubble Warning IconMargin", "color": "#777553", "bordercolor": "#948e51" },
+ { "name": "Message Bubble Warning Line", "color": "#807e5c" },
+ { "name": "Message Bubble Warning Tooltip", "color": "#efe89d" },
+
+ { "name": "Link Color", "color": "#41e2cb" },
+ { "name": "Link Color(Active)", "color": "#41e2cb" }
+ ],
+
+ "text": [
+ { "name": "Plain Text", "fore": "foreground", "back": "background" },
+ { "name": "Selected Text", "back": "selection" },
+ { "name": "Selected Text(Inactive)", "back": "#383830" },
+
+ { "name": "Collapsed Text", "fore": "comment", "back": "background" },
+
+ { "name": "Line Numbers", "fore": "comment", "back": "background" },
+
+ { "name": "Punctuation", "fore": "foreground" },
+ { "name": "Punctuation(Brackets)", "fore": "neutral-blue" },
+
+ { "name": "Comment(Line)", "fore": "comment" },
+ { "name": "Comment(Block)", "fore": "comment" },
+ { "name": "Comment(Doc)", "fore": "comment" },
+ { "name": "Comment(DocTag)", "fore": "comment" },
+ { "name": "Comment Tag", "fore": "#ff00ff" },
+
+ { "name": "Excluded Code", "fore": "comment" },
+
+ { "name": "String", "fore": "bright-green" },
+ { "name": "String(Escape)", "fore": "#A6AB34" },
+ { "name": "String(C# @ Verbatim)", "fore": "bright-green" },
+
+ { "name": "Number", "fore": "bright-purple" },
+
+ { "name": "Preprocessor", "fore": "bright-red" },
+ { "name": "Preprocessor(Region Name)", "fore": "bright-red" },
+
+ { "name": "Xml Text", "fore": "foreground" },
+ { "name": "Xml Delimiter", "fore": "bright-blue" },
+ { "name": "Xml Name", "fore": "bright-red" },
+ { "name": "Xml Attribute", "fore": "bright-blue" },
+ { "name": "Xml Attribute Quotes", "fore": "bright-green" },
+ { "name": "Xml Attribute Value", "fore": "bright-green" },
+ { "name": "Xml Comment", "fore": "comment" },
+ { "name": "Xml CData Section", "fore": "foreground" },
+
+ { "name": "Html Attribute Name", "fore": "foreground" },
+ { "name": "Html Attribute Value", "fore": "bright-green" },
+ { "name": "Html Comment", "fore": "comment" },
+ { "name": "Html Element Name", "fore": "bright-red" },
+ { "name": "Html Entity", "fore": "bright-purple" },
+ { "name": "Html Operator", "fore": "bright-red" },
+ { "name": "Html Server-Side Script", "fore": "foreground", "back": "#373832" },
+ { "name": "Html Tag Delimiter", "fore": "foreground" },
+ { "name": "Razor Code", "fore": "foreground", "back": "#373832" },
+
+ { "name": "Tooltip Text", "fore": "foreground", "back": "#525759" },
+ { "name": "Notification Text", "fore": "foreground", "back": "#272725" },
+
+ { "name": "Completion Text", "fore": "foreground" },
+ { "name": "Completion Matching Substring", "fore": "bright-red" },
+
+ { "name": "Completion Selected Text", "fore": "foreground" },
+ { "name": "Completion Selected Matching Substring", "fore": "bright-red" },
+
+ { "name": "Completion Selected Text(Inactive)", "fore": "foreground" },
+ { "name": "Completion Selected Matching Substring(Inactive)", "fore": "bright-red" },
+
+ { "name": "Keyword(Access)", "fore": "foreground" },
+ { "name": "Keyword(Type)", "fore": "bright-red" },
+ { "name": "Keyword(Operator)", "fore": "bright-red" },
+ { "name": "Keyword(Selection)", "fore": "bright-red" },
+ { "name": "Keyword(Iteration)", "fore": "bright-red" },
+ { "name": "Keyword(Jump)", "fore": "bright-red" },
+ { "name": "Keyword(Context)", "fore": "bright-red" },
+ { "name": "Keyword(Exception)", "fore": "bright-red" },
+ { "name": "Keyword(Modifiers)", "fore": "bright-red" },
+ { "name": "Keyword(Constants)", "fore": "bright-red" },
+ { "name": "Keyword(Void)", "fore": "bright-red" },
+ { "name": "Keyword(Namespace)", "fore": "bright-red" },
+ { "name": "Keyword(Property)", "fore": "bright-red" },
+ { "name": "Keyword(Declaration)", "fore": "bright-red" },
+ { "name": "Keyword(Parameter)", "fore": "bright-red" },
+ { "name": "Keyword(Operator Declaration)", "fore": "bright-red" },
+ { "name": "Keyword(Other)", "fore": "bright-red" },
+
+ { "name": "User Types", "fore": "bright-purple" },
+ { "name": "User Types(Enums)", "fore": "bright-purple" },
+ { "name": "User Types(Interfaces)", "fore": "bright-purple" },
+ { "name": "User Types(Delegates)", "fore": "bright-purple" },
+ { "name": "User Types(Value types)", "fore": "bright-purple" },
+ { "name": "User Types(Type parameters)", "fore": "bright-purple" },
+ { "name": "User Types(Mutable)", "fore": "#ffd21c" },
+
+ { "name": "User Field Usage", "fore": "bright-blue" },
+ { "name": "User Field Declaration", "fore": "bright-blue" },
+
+ { "name": "User Property Usage", "fore": "bright-blue" },
+ { "name": "User Property Declaration", "fore": "bright-blue" },
+
+ { "name": "User Event Usage", "fore": "neutral-blue" },
+ { "name": "User Event Declaration", "fore": "neutral-blue" },
+
+ { "name": "User Method Usage", "fore": "bright-green" },
+ { "name": "User Method Declaration", "fore": "bright-green" },
+
+ { "name": "User Parameter Usage", "fore": "foreground" },
+ { "name": "User Parameter Declaration", "fore": "foreground" },
+
+ { "name": "User Variable Usage", "fore": "foreground" },
+ { "name": "User Variable Declaration", "fore": "foreground" },
+
+ { "name": "Syntax Error", "fore": "foreground", "back": "bright-red" },
+
+ { "name": "String Format Items", "fore": "foreground" },
+
+ { "name": "Breakpoint Text", "fore": "white", "back": "#6f3535" },
+
+ { "name": "Debugger Current Statement", "fore": "white", "back": "#69684c" },
+ { "name": "Debugger Stack Line", "fore": "white", "back": "#5c6b4d" },
+
+ { "name": "Diff Line(Added)", "fore": "#008A8B" },
+ { "name": "Diff Line(Removed)", "fore": "line-removed" },
+ { "name": "Diff Line(Changed)", "fore": "line-changed" },
+ { "name": "Diff Header", "fore": "#008000", "weight": "bold" },
+ { "name": "Diff Header(Separator)", "fore": "#0000FF", "weight": "bold" },
+ { "name": "Diff Header(Old)", "fore": "#008000", "weight": "bold" },
+ { "name": "Diff Header(New)", "fore": "#008000", "weight": "bold" },
+ { "name": "Diff Location", "fore": "#FB8B00", "weight": "bold" },
+
+ { "name": "Css Comment", "fore": "comment", "weight": "bold" },
+ { "name": "Css Property Name", "fore": "black", "weight": "bold" },
+ { "name": "Css Property Value", "fore": "bright-green", "weight": "bold" },
+ { "name": "Css Selector", "fore": "comment", "weight": "bold" },
+ { "name": "Css String Value", "fore": "literal-orange", "weight": "bold" },
+ { "name": "Css Keyword", "fore": "bright-red", "weight": "bold" },
+
+ { "name": "Script Comment", "fore": "comment" },
+ { "name": "Script Keyword", "fore": "bright-red" },
+ { "name": "Script Number", "fore": "foreground" },
+ { "name": "Script String", "fore": "bright-green" }
+ ]
+}
diff --git a/main/src/core/Mono.Texteditor/Styles/LightStyle.json b/main/src/core/Mono.Texteditor/Styles/LightStyle.json
new file mode 100644
index 0000000000..898e3defa7
--- /dev/null
+++ b/main/src/core/Mono.Texteditor/Styles/LightStyle.json
@@ -0,0 +1,246 @@
+{
+ "name": "Light",
+ "version": "1.4.4",
+ "description": "Bright and friendly, just like Xamarin",
+ "originator": "Xamarin Inc. (http://xamarin.com)",
+
+ "palette": [
+ { "name": "text-black", "value": "#222222" },
+ { "name": "comment-gray", "value": "#888a85" },
+ { "name": "chameleon1", "value": "#8ae234" },
+ { "name": "chameleon2", "value": "#73d216" },
+ { "name": "chameleon3", "value": "#4e9a06" },
+ { "name": "skyblue2", "value": "#3465a4" },
+ { "name": "plum2", "value": "#75507b" },
+ { "name": "scarletred1", "value": "#ef2929" },
+ { "name": "aluminium1", "value": "#eeeeec" },
+ { "name": "aluminium2", "value": "#d3d7cf" },
+ { "name": "aluminium3", "value": "#babdb6" },
+ { "name": "aluminium4", "value": "#888a85" },
+ { "name": "literal-orange", "value": "#db7100" },
+ { "name": "literal-escape", "value": "#A53E00" },
+ { "name": "keyword-teal", "value": "#009695" },
+ { "name": "selection-bg", "value": "#b5d5ff" },
+ { "name": "invalid-red", "value": "#C44D58" },
+ { "name": "orangesicle", "value": "#fdab75" },
+ { "name": "orangesicle-light", "value": "#fed9c0" }
+ ],
+
+ "colors": [
+ { "name": "Background(Read Only)", "color": "white" },
+
+ { "name": "Search result background", "color": "#fffeb7" },
+ { "name": "Search result background (highlighted)", "color": "#fffc38" },
+
+ { "name": "Column Ruler", "color": "#eeeeee" },
+
+ { "name": "Fold Square", "color": "#cdcecc", "secondcolor": "white" },
+ { "name": "Fold Cross", "color": "#b1b2b0", "secondcolor": "white" },
+
+ { "name": "Indentation Guide", "color": "#e5e5e5" },
+
+ { "name": "Indicator Margin", "color": "#f6f6f6" },
+ { "name": "Indicator Margin(Separator)", "color": "#f6f6f6" },
+
+ { "name": "Tooltip Pager Top", "color": "#ffffff" },
+ { "name": "Tooltip Pager Triangle", "color": "#737373" },
+ { "name": "Tooltip Pager Text", "color": "#828282" },
+
+ { "name": "Notification Border", "color": "#D2B457" },
+
+ { "name": "Completion Window", "color": "#F0F6F8", "bordercolor": "#b2b2b2" },
+ { "name": "Completion Tooltip Window", "color": "#fafae2", "bordercolor": "#b2b2b2" },
+ { "name": "Completion Selection Bar Border", "color": "#C9C9C9" },
+ { "name": "Completion Selection Bar Border(Inactive)", "color": "#666666" },
+ { "name": "Completion Selection Bar Background", "color": "#f8fcfc", "secondcolor": "#dff4f0" },
+ { "name": "Completion Selection Bar Background(Inactive)", "color": "white", "secondcolor": "white" },
+
+ { "name": "Bookmarks", "color": "white", "secondcolor": "skyblue" },
+
+ { "name": "Underline(Error)", "color": "#E896A0" },
+ { "name": "Underline(Warning)", "color": "#FEB958" },
+ { "name": "Underline(Suggestion)", "color": "#9CC0EA" },
+ { "name": "Underline(Hint)", "color": "#9CC0EA" },
+
+ { "name": "Quick Diff(Dirty)", "color": "orangesicle-light" },
+ { "name": "Quick Diff(Changed)", "color": "orangesicle" },
+
+ { "name": "Brace Matching(Rectangle)", "color": "#fde5d6", "secondcolor": "#fde5d6" },
+ { "name": "Usages(Rectangle)", "color": "#B1DFF9", "secondcolor": "#B1DFF9", "bordercolor": "#B1DFF9" },
+ { "name": "Changing usages(Rectangle)", "color": "#FFD6DD", "secondcolor": "#FFD6DD", "bordercolor": "#FFD6DD" },
+
+ { "name": "Breakpoint Marker", "color": "#f9dbda", "bordercolor": "#f9dbda" },
+ { "name": "Breakpoint Marker(Disabled)", "color": "#e9e9e9", "bordercolor": "#e9e9e9" },
+ { "name": "Breakpoint Marker(Invalid)", "color": "#f1e3e3", "bordercolor": "#f1e3e3" },
+
+ { "name": "Current Line Marker", "color": "#f7f7f7", "secondcolor": "#f7f7f7" },
+ { "name": "Current Line Marker(Inactive)", "color": "#f7f7f7", "secondcolor": "#f7f7f7" },
+
+ { "name": "Debugger Current Line Marker", "color": "#f8f4a1", "bordercolor": "#f8f4a1" },
+ { "name": "Debugger Stack Line Marker", "color": "#d0efa9", "bordercolor": "#d0efa9" },
+
+ { "name": "Primary Link", "color": "chameleon3", "secondcolor": "chameleon2" },
+ { "name": "Primary Link(Highlighted)", "color": "chameleon3", "secondcolor": "chameleon1" },
+ { "name": "Secondary Link", "color": "aluminium2", "secondcolor": "white" },
+ { "name": "Secondary Link(Highlighted)", "color": "aluminium3", "secondcolor": "aluminium1" },
+
+ { "name": "Message Bubble Error Marker", "color": "#df6962" },
+ { "name": "Message Bubble Error Tag", "color": "#d83f3f", "secondcolor": "white" },
+ { "name": "Message Bubble Error Counter", "color": "white", "secondcolor": "#d83f3f" },
+ { "name": "Message Bubble Error IconMargin", "color": "#d83f3f", "bordercolor": "#d83f3f" },
+ { "name": "Message Bubble Error Line", "color": "#fbe4e6" },
+ { "name": "Message Bubble Error Tooltip", "color": "#D10B0B" },
+
+ { "name": "Message Bubble Warning Marker", "color": "#b28d37" },
+ { "name": "Message Bubble Warning Tag", "color": "#e68100", "secondcolor": "white" },
+ { "name": "Message Bubble Warning Counter", "color": "white", "secondcolor": "#e68100" },
+ { "name": "Message Bubble Warning IconMargin", "color": "#e68100", "bordercolor": "#e68100" },
+ { "name": "Message Bubble Warning Line", "color": "#fff1da" },
+ { "name": "Message Bubble Warning Tooltip", "color": "#D1590B" },
+
+ { "name": "Link Color", "color": "#26c8b1" },
+ { "name": "Link Color(Active)", "color": "#26c8b1" }
+ ],
+
+ "text": [
+ { "name": "Plain Text", "fore": "text-black", "back": "white" },
+ { "name": "Selected Text", "back": "selection-bg" },
+ { "name": "Selected Text(Inactive)", "back": "aluminium2" },
+
+ { "name": "Collapsed Text", "fore": "comment-gray", "back": "white" },
+
+ { "name": "Line Numbers", "fore": "aluminium4", "back": "white" },
+
+ { "name": "Punctuation", "fore": "text-black" },
+ { "name": "Punctuation(Brackets)", "fore": "text-black" },
+
+ { "name": "Comment(Line)", "fore": "comment-gray" },
+ { "name": "Comment(Block)", "fore": "comment-gray" },
+ { "name": "Comment(Doc)", "fore": "#97b488" },
+ { "name": "Comment(DocTag)", "fore": "#c8b97c" },
+ { "name": "Comment Tag", "fore": "#ff00ff" },
+
+ { "name": "Excluded Code", "fore": "comment-gray" },
+
+ { "name": "String", "fore": "literal-orange" },
+ { "name": "String(Escape)", "fore": "literal-escape" },
+ { "name": "String(C# @ Verbatim)", "fore": "literal-orange" },
+ { "name": "String(Regex Set Constructs)", "fore": "#e5ae41" },
+ { "name": "String(Regex Character Class)", "fore": "#6fb3f8" },
+ { "name": "String(Regex Grouping Constructs)", "fore": "#2b922b" },
+ { "name": "String(Regex Escape Character)", "fore": "#ff0d80" },
+ { "name": "String(Regex Alt Escape Character)", "fore": "#faafba" },
+
+ { "name": "Number", "fore": "literal-orange" },
+
+ { "name": "Preprocessor", "fore": "#c12dad" },
+ { "name": "Preprocessor(Region Name)", "fore": "#c12dad" },
+
+ { "name": "Xml Text", "fore": "text-black" },
+ { "name": "Xml Delimiter", "fore": "text-black" },
+ { "name": "Xml Name", "fore": "skyblue2" },
+ { "name": "Xml Attribute", "fore": "text-black" },
+ { "name": "Xml Attribute Quotes", "fore": "literal-orange" },
+ { "name": "Xml Attribute Value", "fore": "literal-orange" },
+ { "name": "Xml Comment", "fore": "comment-gray" },
+ { "name": "Xml CData Section", "fore": "text-black" },
+
+ { "name": "Html Attribute Name", "fore": "text-black" },
+ { "name": "Html Attribute Value", "fore": "literal-orange" },
+ { "name": "Html Comment", "fore": "comment-gray" },
+ { "name": "Html Element Name", "fore": "skyblue2" },
+ { "name": "Html Entity", "fore": "#c12dad" },
+ { "name": "Html Operator", "fore": "skyblue2" },
+ { "name": "Html Server-Side Script", "fore": "text-black", "back": "#fdf0bd" },
+ { "name": "Html Tag Delimiter", "fore": "skyblue2" },
+ { "name": "Razor Code", "fore": "text-black", "back": "#fdfaed" },
+
+ { "name": "Tooltip Text", "fore": "text-black", "back": "#fafae3" },
+ { "name": "Notification Text", "fore": "text-black", "back": "#feffe9" },
+
+ { "name": "Completion Text", "fore": "#434343" },
+ { "name": "Completion Matching Substring", "fore": "#BA3373" },
+
+ { "name": "Completion Selected Text", "fore": "#434343" },
+ { "name": "Completion Selected Matching Substring", "fore": "#BA3373" },
+
+ { "name": "Completion Selected Text(Inactive)", "fore": "#434343" },
+ { "name": "Completion Selected Matching Substring(Inactive)", "fore": "#BA3373" },
+
+ { "name": "Keyword(Access)", "fore": "keyword-teal" },
+ { "name": "Keyword(Type)", "fore": "keyword-teal" },
+ { "name": "Keyword(Operator)", "fore": "keyword-teal" },
+ { "name": "Keyword(Selection)", "fore": "keyword-teal" },
+ { "name": "Keyword(Iteration)", "fore": "keyword-teal" },
+ { "name": "Keyword(Jump)", "fore": "keyword-teal" },
+ { "name": "Keyword(Context)", "fore": "keyword-teal" },
+ { "name": "Keyword(Exception)", "fore": "keyword-teal" },
+ { "name": "Keyword(Modifiers)", "fore": "keyword-teal" },
+ { "name": "Keyword(Constants)", "fore": "keyword-teal" },
+ { "name": "Keyword(Void)", "fore": "keyword-teal" },
+ { "name": "Keyword(Namespace)", "fore": "keyword-teal" },
+ { "name": "Keyword(Property)", "fore": "keyword-teal" },
+ { "name": "Keyword(Declaration)", "fore": "keyword-teal" },
+ { "name": "Keyword(Parameter)", "fore": "keyword-teal" },
+ { "name": "Keyword(Operator Declaration)", "fore": "keyword-teal" },
+ { "name": "Keyword(Other)", "fore": "keyword-teal" },
+
+ { "name": "User Types", "fore": "skyblue2" },
+ { "name": "User Types(Enums)", "fore": "skyblue2" },
+ { "name": "User Types(Interfaces)", "fore": "skyblue2" },
+ { "name": "User Types(Delegates)", "fore": "skyblue2" },
+ { "name": "User Types(Value types)", "fore": "skyblue2" },
+ { "name": "User Types(Type parameters)", "fore": "skyblue2" },
+ { "name": "User Types(Mutable)", "fore": "#a08000" },
+
+ { "name": "User Field Usage", "fore": "text-black" },
+ { "name": "User Field Declaration", "fore": "text-black" },
+
+ { "name": "User Property Usage", "fore": "text-black" },
+ { "name": "User Property Declaration", "fore": "text-black" },
+
+ { "name": "User Event Usage", "fore": "text-black" },
+ { "name": "User Event Declaration", "fore": "text-black" },
+
+ { "name": "User Method Usage", "fore": "text-black" },
+ { "name": "User Method Declaration", "fore": "text-black" },
+
+ { "name": "User Parameter Usage", "fore": "text-black" },
+ { "name": "User Parameter Declaration", "fore": "text-black" },
+
+ { "name": "User Variable Usage", "fore": "text-black" },
+ { "name": "User Variable Declaration", "fore": "text-black" },
+
+ { "name": "Syntax Error", "fore": "invalid-red" },
+
+ { "name": "String Format Items", "fore": "#FF0000" },
+
+ { "name": "Breakpoint Text", "fore": "text-black", "back": "#ffe8e7" },
+
+ { "name": "Debugger Current Statement", "fore": "text-black", "back": "#f8f4a1" },
+ { "name": "Debugger Stack Line", "fore": "text-black", "back": "#ccfca6" },
+
+ { "name": "Diff Line(Added)", "fore": "skyblue2" },
+ { "name": "Diff Line(Removed)", "fore": "scarletred1" },
+ { "name": "Diff Line(Changed)", "fore": "plum2" },
+ { "name": "Diff Header", "fore": "chameleon3", "weight": "bold" },
+ { "name": "Diff Header(Separator)", "fore": "chameleon3", "weight": "bold" },
+ { "name": "Diff Header(Old)", "fore": "scarletred1", "weight": "bold" },
+ { "name": "Diff Header(New)", "fore": "skyblue2", "weight": "bold" },
+ { "name": "Diff Location", "fore": "plum2", "weight": "bold" },
+
+ { "name": "Css Comment", "fore": "comment-gray", "weight": "bold" },
+ { "name": "Css Property Name", "fore": "text-black", "weight": "bold" },
+ { "name": "Css Property Value", "fore": "literal-orange", "weight": "bold" },
+ { "name": "Css Selector", "fore": "comment-gray", "weight": "bold" },
+ { "name": "Css String Value", "fore": "literal-orange", "weight": "bold" },
+ { "name": "Css Keyword", "fore": "keyword-teal", "weight": "bold" },
+
+ { "name": "Script Comment", "fore": "comment-gray" },
+ { "name": "Script Identifier" },
+ { "name": "Script Keyword", "fore": "keyword-teal" },
+ { "name": "Script Number", "fore": "literal-orange" },
+ { "name": "Script Operator" },
+ { "name": "Script String", "fore": "literal-orange" }
+ ]
+}
diff --git a/main/src/core/Mono.Texteditor/Styles/MonokaiStyle.json b/main/src/core/Mono.Texteditor/Styles/MonokaiStyle.json
index c56cbe1ba3..0df6f240ab 100644
--- a/main/src/core/Mono.Texteditor/Styles/MonokaiStyle.json
+++ b/main/src/core/Mono.Texteditor/Styles/MonokaiStyle.json
@@ -1,227 +1,241 @@
{
- "name":"Monokai",
- "version":"1.1",
- "description":"A smooth, dusky scheme.",
- "originator":"Xamarin Inc. (http://xamarin.com)",
-
- "palette":[
- { "name":"monokai-white", "value":"#F8F8F2" },
- { "name":"monokai-selection", "value":"#49483E" },
- { "name":"monokai-background", "value":"#272822" },
- { "name":"monokai-comment", "value":"#75715E" },
- { "name":"monokai-string", "value":"#E6DB74" },
- { "name":"monokai-constant", "value":"#AE81FF" },
- { "name":"monokai-keyword", "value":"#F92672" },
- { "name":"monokai-type", "value":"#66d9ef" },
- { "name":"monokai-classname", "value":"#A6E22E" },
- { "name":"monokai-functionargument", "value":"#FD971F" },
- { "name":"monokai-invalid", "value":"#F8F8F0" },
- { "name":"monokai-invalidBackground", "value":"#F92672" },
- { "name":"skyblue1", "value":"#729fcf" },
- { "name":"chameleon1", "value":"#8ae234" },
- { "name":"chameleon2", "value":"#73d216" },
- { "name":"chameleon3", "value":"#4e9a06" }
- ],
-
- "colors":[
- { "name":"Background(Read Only)", "color":"#252620" },
-
- { "name":"Search result background", "color":"#006060" },
- { "name":"Search result background (highlighted)", "color":"#008080" },
-
- { "name":"Column Ruler", "color":"#575852" },
-
- { "name":"Fold Square", "color":"monokai-comment", "secondcolor":"monokai-background" },
- { "name":"Fold Cross", "color":"white", "secondcolor":"monokai-background" },
-
- { "name":"Indentation Guide", "color":"monokai-comment" },
-
- { "name":"Indicator Margin", "color":"#3B3A32" },
- { "name":"Indicator Margin(Separator)", "color":"#3B3A32" },
-
- { "name":"Tooltip Border", "color":"#989892" },
- { "name":"Tooltip Pager Top", "color":"#292A25" },
- { "name":"Tooltip Pager Bottom", "color":"#292A25" },
- { "name":"Tooltip Pager Triangle", "color":"#C8C8C2" },
- { "name":"Tooltip Pager Text", "color":"#C8C8C2" },
-
- { "name":"Notification Border", "color":"#989892" },
-
- { "name":"Completion Matching Substring", "color":"#BA3373" },
- { "name":"Completion Border", "color":"#C9C9C9" },
- { "name":"Completion Border(Inactive)", "color":"#bebebe" },
-
- { "name":"Bookmarks", "color":"#FDD99B", "secondcolor":"#816647 " },
-
- { "name":"Underline(Error)", "color":"red" },
- { "name":"Underline(Warning)", "color":"skyblue1" },
- { "name":"Underline(Suggestion)", "color":"chameleon3" },
- { "name":"Underline(Hint)", "color":"chameleon1" },
-
- { "name":"Quick Diff(Dirty)", "color":"monokai-string" },
- { "name":"Quick Diff(Changed)", "color":"#A4E22E" },
-
- { "name":"Brace Matching(Rectangle)", "color":"#6699CC", "secondcolor":"#AACCEE" },
- { "name":"Usages(Rectangle)", "color":"#527F99", "secondcolor":"#527F99", "bordercolor":"#527F99" },
- { "name":"Changing usages(Rectangle)", "color":"#996E75", "secondcolor":"#996E75", "bordercolor":"#996E75" },
-
- { "name":"Breakpoint Marker", "color":"#6f3535", "bordercolor":"#7a3a3a" },
- { "name":"Breakpoint Marker(Disabled)", "color":"#707070", "bordercolor":"#7b7b7b" },
- { "name":"Breakpoint Marker(Invalid)", "color":"#604343", "bordercolor":"#6a4a4a" },
-
- { "name":"Current Line Marker", "color":"#323229"},
- { "name":"Current Line Marker(Inactive)", "color":"#2F2F28"},
-
- { "name":"Debugger Current Line Marker", "color":"#69684c", "bordercolor":"#747354" },
- { "name":"Debugger Stack Line Marker", "color":"#5c6b4d", "bordercolor":"#657655"},
-
- { "name":"Primary Link", "color":"monokai-white", "secondcolor":"#7f4a81"},
- { "name":"Primary Link(Highlighted)", "color":"monokai-white", "secondcolor":"#b167b3"},
- { "name":"Secondary Link", "color":"monokai-white", "secondcolor":"#262228"},
- { "name":"Secondary Link(Highlighted)", "color":"monokai-white", "secondcolor":"#4e4552"},
-
- { "name":"Message Bubble Error Marker", "color":"#b28d37"},
- { "name":"Message Bubble Error Tag", "color":"#e3a6a1", "secondcolor":"black"},
- { "name":"Message Bubble Error Counter", "color":"black", "secondcolor":"#e3a6a1"},
- { "name":"Message Bubble Error IconMargin", "color":"#735c54", "bordercolor":"#805b4d"},
- { "name":"Message Bubble Error Line", "color":"#7b645c"},
- { "name":"Message Bubble Error Tooltip", "color":"#e3a6a1"},
-
- { "name":"Message Bubble Warning Marker", "color":"#b28d37"},
- { "name":"Message Bubble Warning Tag", "color":"#efe89d", "secondcolor":"black"},
- { "name":"Message Bubble Warning Counter", "color":"black", "secondcolor":"#efe89d"},
- { "name":"Message Bubble Warning IconMargin", "color":"#777553", "bordercolor":"#948e51"},
- { "name":"Message Bubble Warning Line", "color":"#807e5c"},
- { "name":"Message Bubble Warning Tooltip", "color":"#efe89d"}
- ],
-
- "text":[
- { "name":"Plain Text", "fore":"monokai-white", "back":"monokai-background" },
- { "name":"Selected Text", "back":"monokai-selection" },
- { "name":"Selected Text(Inactive)", "back":"#383830" },
-
- { "name":"Collapsed Text", "fore":"monokai-comment", "back":"monokai-background" },
-
- { "name":"Line Numbers", "fore":"#BCBCBC", "back":"monokai-background"},
-
- { "name":"Punctuation", "fore":"monokai-white" },
- { "name":"Punctuation(Brackets)", "fore":"monokai-white" },
-
- { "name":"Comment(Line)", "fore":"monokai-comment" },
- { "name":"Comment(Block)", "fore":"monokai-comment" },
- { "name":"Comment(Doc)", "fore":"monokai-comment" },
- { "name":"Comment(DocTag)", "fore":"monokai-comment" },
- { "name":"Comment Tag", "fore":"monokai-comment", "weight":"bold" },
- { "name":"Excluded Code", "fore":"monokai-comment" },
-
- { "name":"String", "fore":"monokai-string"},
- { "name":"String(Escape)", "fore":"#A6AB34"},
- { "name":"String(C# @ Verbatim)", "fore":"monokai-string"},
-
- { "name":"Number", "fore":"monokai-constant"},
-
- { "name":"Preprocessor", "fore":"monokai-classname" },
- { "name":"Preprocessor(Region Name)", "fore":"monokai-classname" },
-
- { "name":"Xml Text", "fore":"monokai-white" },
- { "name":"Xml Delimiter", "fore":"monokai-white" },
- { "name":"Xml Name", "fore":"monokai-keyword" },
- { "name":"Xml Attribute", "fore":"monokai-white" },
- { "name":"Xml Attribute Quotes", "fore":"monokai-string" },
- { "name":"Xml Attribute Value", "fore":"monokai-string" },
- { "name":"Xml Comment", "fore":"monokai-comment" },
- { "name":"Xml CData Section", "fore":"monokai-white" },
-
- { "name":"Html Attribute Name", "fore":"monokai-white" },
- { "name":"Html Attribute Value", "fore":"monokai-string" },
- { "name":"Html Comment", "fore":"monokai-comment" },
- { "name":"Html Element Name", "fore":"monokai-keyword" },
- { "name":"Html Entity", "fore":"monokai-classname" },
- { "name":"Html Operator", "fore":"monokai-keyword" },
- { "name":"Html Server-Side Script", "fore":"monokai-white", "back":"#373832" },
- { "name":"Html Tag Delimiter", "fore":"monokai-white" },
- { "name":"Razor Code", "fore":"monokai-white", "back":"#373832" },
-
- { "name":"Tooltip Text", "fore":"monokai-white", "back":"#272725" },
- { "name":"Notification Text", "fore":"monokai-white", "back":"#272725" },
-
- { "name":"Completion Text", "fore":"#434343", "back":"#F0F6F8" },
- { "name":"Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
- { "name":"Completion Selected Text(Inactive)", "fore":"white", "back":"white" },
-
- { "name":"Keyword(Access)", "fore":"monokai-constant" },
- { "name":"Keyword(Type)", "fore":"monokai-keyword" },
- { "name":"Keyword(Operator)", "fore":"monokai-keyword" },
- { "name":"Keyword(Selection)", "fore":"monokai-keyword" },
- { "name":"Keyword(Iteration)", "fore":"monokai-keyword" },
- { "name":"Keyword(Jump)", "fore":"monokai-keyword" },
- { "name":"Keyword(Context)", "fore":"monokai-keyword" },
- { "name":"Keyword(Exception)", "fore":"monokai-keyword" },
- { "name":"Keyword(Modifiers)", "fore":"monokai-keyword" },
- { "name":"Keyword(Constants)", "fore":"monokai-constant" },
- { "name":"Keyword(Void)", "fore":"monokai-keyword" },
- { "name":"Keyword(Namespace)", "fore":"monokai-keyword" },
- { "name":"Keyword(Property)", "fore":"monokai-keyword" },
- { "name":"Keyword(Declaration)", "fore":"monokai-keyword" },
- { "name":"Keyword(Parameter)", "fore":"monokai-keyword" },
- { "name":"Keyword(Operator Declaration)", "fore":"monokai-keyword" },
- { "name":"Keyword(Other)", "fore":"monokai-keyword" },
-
- { "name":"User Types", "fore":"monokai-type" },
- { "name":"User Types(Enums)", "fore":"monokai-type" },
- { "name":"User Types(Interfaces)", "fore":"monokai-type" },
- { "name":"User Types(Delegates)", "fore":"monokai-type" },
- { "name":"User Types(Value types)", "fore":"monokai-type" },
- { "name":"User Types(Type parameters)", "fore":"monokai-type" },
-
- { "name":"User Field Usage", "fore":"#2EE2A6" },
- { "name":"User Field Declaration", "fore":"#2EE2A6" },
-
- { "name":"User Property Usage", "fore":"#2EE2A6" },
- { "name":"User Property Declaration", "fore":"#2EE2A6" },
-
- { "name":"User Event Usage", "fore":"#FFAE81" },
- { "name":"User Event Declaration", "fore":"#FFAE81" },
-
- { "name":"User Method Usage", "fore":"monokai-functionargument" },
- { "name":"User Method Declaration", "fore":"monokai-functionargument" },
-
- { "name":"User Parameter Usage", "fore":"monokai-white" },
- { "name":"User Parameter Declaration", "fore":"monokai-white" },
-
- { "name":"User Variable Usage", "fore":"monokai-white" },
- { "name":"User Variable Declaration", "fore":"monokai-white" },
-
- { "name":"Syntax Error", "fore":"monokai-invalid", "back":"monokai-invalidBackground" },
-
- { "name":"String Format Items", "fore":"monokai-white" },
-
- { "name":"Breakpoint Text", "fore":"white", "back":"#6f3535" },
-
- { "name":"Debugger Current Statement", "fore":"white", "back":"#69684c" },
- { "name":"Debugger Stack Line", "fore":"white", "back":"#5c6b4d" },
-
- { "name":"Diff Line(Added)", "fore":"#008A8B" },
- { "name":"Diff Line(Removed)", "fore":"line-removed" },
- { "name":"Diff Line(Changed)", "fore":"line-changed" },
- { "name":"Diff Header", "fore":"#008000" },
- { "name":"Diff Header(Separator)", "fore":"#0000FF", "weight":"bold" },
- { "name":"Diff Header(Old)", "fore":"#008000", "weight":"bold" },
- { "name":"Diff Header(New)", "fore":"#008000", "weight":"bold" },
- { "name":"Diff Location", "fore":"#FB8B00", "weight":"bold" },
-
- { "name":"Css Comment", "fore":"monokai-comment", "weight":"bold" },
- { "name":"Css Property Name", "fore":"black", "weight":"bold" },
- { "name":"Css Property Value", "fore":"monokai-string", "weight":"bold" },
- { "name":"Css Selector", "fore":"monokai-comment", "weight":"bold" },
- { "name":"Css String Value", "fore":"literal-orange", "weight":"bold" },
- { "name":"Css Keyword", "fore":"monokai-keyword", "weight":"bold" },
-
- { "name":"Script Comment", "fore":"monokai-comment" },
- { "name":"Script Identifier" },
- { "name":"Script Keyword", "fore":"monokai-keyword" },
- { "name":"Script Number", "fore":"monokai-constant" },
- { "name":"Script Operator" },
- { "name":"Script String", "fore":"monokai-string" }
- ]
-} \ No newline at end of file
+ "name": "Monokai",
+ "version": "1.3.3",
+ "description": "A smooth, dusky scheme",
+ "originator": "Xamarin Inc. (http://xamarin.com)",
+
+ "palette": [
+ { "name": "monokai-white", "value": "#F8F8F2" },
+ { "name": "monokai-selection", "value": "#49483E" },
+ { "name": "monokai-background", "value": "#272822" },
+ { "name": "monokai-comment", "value": "#75715E" },
+ { "name": "monokai-string", "value": "#E6DB74" },
+ { "name": "monokai-constant", "value": "#AE81FF" },
+ { "name": "monokai-keyword", "value": "#F92672" },
+ { "name": "monokai-type", "value": "#66d9ef" },
+ { "name": "monokai-classname", "value": "#A6E22E" },
+ { "name": "monokai-functionargument", "value": "#FD971F" },
+ { "name": "monokai-invalid", "value": "#F8F8F0" },
+ { "name": "monokai-invalidBackground", "value": "#F92672" },
+ { "name": "skyblue1", "value": "#729fcf" },
+ { "name": "chameleon1", "value": "#8ae234" },
+ { "name": "chameleon2", "value": "#73d216" },
+ { "name": "chameleon3", "value": "#4e9a06" },
+ { "name": "orange1", "value": "#fcaf3e" },
+ { "name": "orange2", "value": "#f57900" },
+ { "name": "plum1", "value": "#ad7fa8" }
+ ],
+
+ "colors": [
+ { "name": "Background(Read Only)", "color": "#252620" },
+
+ { "name": "Search result background", "color": "#006060" },
+ { "name": "Search result background (highlighted)", "color": "#008080" },
+
+ { "name": "Column Ruler", "color": "#393933" },
+
+ { "name": "Fold Square", "color": "monokai-comment", "secondcolor": "monokai-background" },
+ { "name": "Fold Cross", "color": "#8f8c7e", "secondcolor": "monokai-background" },
+
+ { "name": "Indentation Guide", "color": "monokai-comment" },
+
+ { "name": "Indicator Margin", "color": "#3B3A32" },
+ { "name": "Indicator Margin(Separator)", "color": "#3B3A32" },
+
+ { "name": "Tooltip Pager Top", "color": "#757575" },
+ { "name": "Tooltip Pager Triangle", "color": "#ffffff" },
+ { "name": "Tooltip Pager Text", "color": "#ffffff" },
+
+ { "name": "Notification Border", "color": "#989892" },
+
+ { "name": "Completion Window", "color": "monokai-background", "bordercolor": "#989892" },
+ { "name": "Completion Tooltip Window", "color": "#272725", "bordercolor": "#989892" },
+ { "name": "Completion Selection Bar Border", "color": "monokai-selection" },
+ { "name": "Completion Selection Bar Border(Inactive)", "color": "#383830" },
+ { "name": "Completion Selection Bar Background", "color": "monokai-selection", "secondcolor": "monokai-selection" },
+ { "name": "Completion Selection Bar Background(Inactive)", "color": "#383830", "secondcolor": "#383830" },
+
+ { "name": "Bookmarks", "color": "#FDD99B", "secondcolor": "#816647" },
+
+ { "name": "Underline(Error)", "color": "red" },
+ { "name": "Underline(Warning)", "color": "skyblue1" },
+ { "name": "Underline(Suggestion)", "color": "chameleon3" },
+ { "name": "Underline(Hint)", "color": "chameleon1" },
+
+ { "name": "Quick Diff(Dirty)", "color": "monokai-string" },
+ { "name": "Quick Diff(Changed)", "color": "#A4E22E" },
+
+ { "name": "Brace Matching(Rectangle)", "color": "#517297", "secondcolor": "#517297" },
+ { "name": "Usages(Rectangle)", "color": "#527F99", "secondcolor": "#527F99", "bordercolor": "#527F99" },
+ { "name": "Changing usages(Rectangle)", "color": "#996E75", "secondcolor": "#996E75", "bordercolor": "#996E75" },
+
+ { "name": "Breakpoint Marker", "color": "#6f3535", "bordercolor": "#6f3535" },
+ { "name": "Breakpoint Marker(Disabled)", "color": "#4d4d4d", "bordercolor": "#4d4d4d" },
+ { "name": "Breakpoint Marker(Invalid)", "color": "#604343", "bordercolor": "#604343" },
+
+ { "name": "Current Line Marker", "color": "#393933", "secondcolor": "#393933" },
+ { "name": "Current Line Marker(Inactive)", "color": "#393933", "secondcolor": "#393933" },
+
+ { "name": "Debugger Current Line Marker", "color": "#69684c", "bordercolor": "#69684c" },
+ { "name": "Debugger Stack Line Marker", "color": "#618336", "bordercolor": "#618336" },
+
+ { "name": "Primary Link", "color": "monokai-white", "secondcolor": "#7f4a81" },
+ { "name": "Primary Link(Highlighted)", "color": "monokai-white", "secondcolor": "#b167b3" },
+ { "name": "Secondary Link", "color": "monokai-white", "secondcolor": "#262228" },
+ { "name": "Secondary Link(Highlighted)", "color": "monokai-white", "secondcolor": "#4e4552" },
+
+ { "name": "Message Bubble Error Marker", "color": "#b28d37" },
+ { "name": "Message Bubble Error Tag", "color": "#e3a6a1", "secondcolor": "black" },
+ { "name": "Message Bubble Error Counter", "color": "black", "secondcolor": "#e3a6a1" },
+ { "name": "Message Bubble Error IconMargin", "color": "#735c54", "bordercolor": "#805b4d" },
+ { "name": "Message Bubble Error Line", "color": "#7b645c" },
+ { "name": "Message Bubble Error Tooltip", "color": "#e3a6a1" },
+
+ { "name": "Message Bubble Warning Tag", "color": "#efe89d", "secondcolor": "black" },
+ { "name": "Message Bubble Warning Counter", "color": "black", "secondcolor": "#efe89d" },
+ { "name": "Message Bubble Warning IconMargin", "color": "#777553", "bordercolor": "#948e51" },
+ { "name": "Message Bubble Warning Line", "color": "#807e5c" },
+ { "name": "Message Bubble Warning Tooltip", "color": "#efe89d" },
+
+ { "name": "Link Color", "color": "#41e2cb" },
+ { "name": "Link Color(Active)", "color": "#41e2cb" }
+ ],
+
+ "text": [
+ { "name": "Plain Text", "fore": "monokai-white", "back": "monokai-background" },
+ { "name": "Selected Text", "back": "monokai-selection" },
+ { "name": "Selected Text(Inactive)", "back": "#383830" },
+
+ { "name": "Collapsed Text", "fore": "monokai-comment", "back": "monokai-background" },
+
+ { "name": "Line Numbers", "fore": "#BCBCBC", "back": "monokai-background" },
+
+ { "name": "Punctuation", "fore": "monokai-white" },
+ { "name": "Punctuation(Brackets)", "fore": "monokai-white" },
+
+ { "name": "Comment(Line)", "fore": "monokai-comment" },
+ { "name": "Comment(Block)", "fore": "monokai-comment" },
+ { "name": "Comment(Doc)", "fore": "monokai-comment" },
+ { "name": "Comment(DocTag)", "fore": "monokai-comment" },
+
+ { "name": "Excluded Code", "fore": "monokai-comment" },
+
+ { "name": "String", "fore": "monokai-string" },
+ { "name": "String(Escape)", "fore": "#A6AB34" },
+ { "name": "String(C# @ Verbatim)", "fore": "monokai-string" },
+ { "name": "String(Regex Set Constructs)", "fore": "chameleon2" },
+ { "name": "String(Regex Character Class)", "fore": "skyblue1" },
+ { "name": "String(Regex Grouping Constructs)", "fore": "plum1" },
+ { "name": "String(Regex Escape Character)", "fore": "orange2" },
+ { "name": "String(Regex Alt Escape Character)", "fore": "orange1" },
+
+ { "name": "Number", "fore": "monokai-constant" },
+
+ { "name": "Preprocessor", "fore": "monokai-classname" },
+ { "name": "Preprocessor(Region Name)", "fore": "monokai-classname" },
+
+ { "name": "Xml Text", "fore": "monokai-white" },
+ { "name": "Xml Delimiter", "fore": "monokai-white" },
+ { "name": "Xml Name", "fore": "monokai-keyword" },
+ { "name": "Xml Attribute", "fore": "monokai-white" },
+ { "name": "Xml Attribute Quotes", "fore": "monokai-string" },
+ { "name": "Xml Attribute Value", "fore": "monokai-string" },
+ { "name": "Xml Comment", "fore": "monokai-comment" },
+ { "name": "Xml CData Section", "fore": "monokai-white" },
+
+ { "name": "Html Attribute Name", "fore": "monokai-white" },
+ { "name": "Html Attribute Value", "fore": "monokai-string" },
+ { "name": "Html Comment", "fore": "monokai-comment" },
+ { "name": "Html Element Name", "fore": "monokai-keyword" },
+ { "name": "Html Entity", "fore": "monokai-classname" },
+ { "name": "Html Operator", "fore": "monokai-keyword" },
+ { "name": "Html Server-Side Script", "fore": "monokai-white", "back": "#373832" },
+ { "name": "Html Tag Delimiter", "fore": "monokai-white" },
+ { "name": "Razor Code", "fore": "monokai-white", "back": "#373832" },
+
+ { "name": "Tooltip Text", "fore": "#d1d1cd", "back": "#525759" },
+ { "name": "Notification Text", "fore": "monokai-white", "back": "#272725" },
+
+ { "name": "Completion Text", "fore": "monokai-white" },
+ { "name": "Completion Matching Substring", "fore": "monokai-keyword" },
+
+ { "name": "Completion Selected Text", "fore": "monokai-white" },
+ { "name": "Completion Selected Matching Substring", "fore": "monokai-keyword" },
+
+ { "name": "Completion Selected Text(Inactive)", "fore": "monokai-white" },
+ { "name": "Completion Selected Matching Substring(Inactive)", "fore": "monokai-keyword" },
+
+ { "name": "Keyword(Access)", "fore": "monokai-constant" },
+ { "name": "Keyword(Type)", "fore": "monokai-keyword" },
+ { "name": "Keyword(Operator)", "fore": "monokai-keyword" },
+ { "name": "Keyword(Selection)", "fore": "monokai-keyword" },
+ { "name": "Keyword(Iteration)", "fore": "monokai-keyword" },
+ { "name": "Keyword(Jump)", "fore": "monokai-keyword" },
+ { "name": "Keyword(Context)", "fore": "monokai-keyword" },
+ { "name": "Keyword(Exception)", "fore": "monokai-keyword" },
+ { "name": "Keyword(Modifiers)", "fore": "monokai-keyword" },
+ { "name": "Keyword(Constants)", "fore": "monokai-constant" },
+ { "name": "Keyword(Void)", "fore": "monokai-keyword" },
+ { "name": "Keyword(Namespace)", "fore": "monokai-keyword" },
+ { "name": "Keyword(Property)", "fore": "monokai-keyword" },
+ { "name": "Keyword(Declaration)", "fore": "monokai-keyword" },
+ { "name": "Keyword(Parameter)", "fore": "monokai-keyword" },
+ { "name": "Keyword(Operator Declaration)", "fore": "monokai-keyword" },
+ { "name": "Keyword(Other)", "fore": "monokai-keyword" },
+
+ { "name": "User Types", "fore": "monokai-type" },
+ { "name": "User Types(Enums)", "fore": "monokai-type" },
+ { "name": "User Types(Interfaces)", "fore": "monokai-type" },
+ { "name": "User Types(Delegates)", "fore": "monokai-type" },
+ { "name": "User Types(Value types)", "fore": "monokai-type" },
+ { "name": "User Types(Type parameters)", "fore": "monokai-type" },
+ { "name": "User Types(Mutable)", "fore": "#ffd21c" },
+
+ { "name": "User Field Usage", "fore": "#2EE2A6" },
+ { "name": "User Field Declaration", "fore": "#2EE2A6" },
+
+ { "name": "User Property Usage", "fore": "#2EE2A6" },
+ { "name": "User Property Declaration", "fore": "#2EE2A6" },
+
+ { "name": "User Event Usage", "fore": "#FFAE81" },
+ { "name": "User Event Declaration", "fore": "#FFAE81" },
+
+ { "name": "User Method Usage", "fore": "monokai-functionargument" },
+ { "name": "User Method Declaration", "fore": "monokai-functionargument" },
+
+ { "name": "User Parameter Usage", "fore": "monokai-white" },
+ { "name": "User Parameter Declaration", "fore": "monokai-white" },
+
+ { "name": "User Variable Usage", "fore": "monokai-white" },
+ { "name": "User Variable Declaration", "fore": "monokai-white" },
+
+ { "name": "Syntax Error", "fore": "monokai-invalid", "back": "monokai-invalidBackground" },
+
+ { "name": "String Format Items", "fore": "monokai-white" },
+
+ { "name": "Breakpoint Text", "fore": "white", "back": "#6f3535" },
+
+ { "name": "Debugger Current Statement", "fore": "white", "back": "#69684c" },
+ { "name": "Debugger Stack Line", "fore": "white", "back": "#5c6b4d" },
+
+ { "name": "Diff Line(Added)", "fore": "#008A8B" },
+ { "name": "Diff Line(Removed)", "fore": "line-removed" },
+ { "name": "Diff Line(Changed)", "fore": "line-changed" },
+ { "name": "Diff Header", "fore": "#008000", "weight": "bold" },
+ { "name": "Diff Header(Separator)", "fore": "#0000FF", "weight": "bold" },
+ { "name": "Diff Header(Old)", "fore": "#008000", "weight": "bold" },
+ { "name": "Diff Header(New)", "fore": "#008000", "weight": "bold" },
+ { "name": "Diff Location", "fore": "#FB8B00", "weight": "bold" },
+
+ { "name": "Css Comment", "fore": "monokai-comment", "weight": "bold" },
+ { "name": "Css Property Name", "fore": "black", "weight": "bold" },
+ { "name": "Css Property Value", "fore": "monokai-string", "weight": "bold" },
+ { "name": "Css Selector", "fore": "monokai-comment", "weight": "bold" },
+ { "name": "Css Keyword", "fore": "monokai-keyword", "weight": "bold" },
+
+ { "name": "Script Comment", "fore": "monokai-comment" },
+ { "name": "Script Keyword", "fore": "monokai-keyword" },
+ { "name": "Script Number", "fore": "monokai-constant" },
+ { "name": "Script String", "fore": "monokai-string" }
+ ]
+}
diff --git a/main/src/core/Mono.Texteditor/Styles/NightshadeStyle.json b/main/src/core/Mono.Texteditor/Styles/NightshadeStyle.json
index 11aeb07916..8d807916e4 100644
--- a/main/src/core/Mono.Texteditor/Styles/NightshadeStyle.json
+++ b/main/src/core/Mono.Texteditor/Styles/NightshadeStyle.json
@@ -1,263 +1,255 @@
{
- "name":"Nightshade",
- "version":"1.1",
- "description":"An inky scheme with vibrant highlights.",
- "originator":"Anirudh Sanjeev <anirudh@anirudhsanjeev.org>",
-
- "palette":[
- { "name":"butter1", "value":"#fce94f" },
- { "name":"butter2", "value":"#edd400" },
- { "name":"butter3", "value":"#c4a000" },
- { "name":"orange1", "value":"#fcaf3e" },
- { "name":"orange2", "value":"#f57900" },
- { "name":"orange3", "value":"#ce5c00" },
- { "name":"chocolate1", "value":"#e9b96e" },
- { "name":"chocolate2", "value":"#c17d11" },
- { "name":"chocolate3", "value":"#8f5902" },
- { "name":"chameleon1", "value":"#8ae234" },
- { "name":"chameleon2", "value":"#73d216" },
- { "name":"chameleon3", "value":"#4e9a06" },
- { "name":"skyblue1", "value":"#729fcf" },
- { "name":"skyblue2", "value":"#3465a4" },
- { "name":"skyblue3", "value":"#204a87" },
- { "name":"plum1", "value":"#ad7fa8" },
- { "name":"plum2", "value":"#75507b" },
- { "name":"plum3", "value":"#5c3566" },
- { "name":"scarletred1", "value":"#ef2929" },
- { "name":"scarletred2", "value":"#cc0000" },
- { "name":"scarletred3", "value":"#a40000" },
- { "name":"aluminium1", "value":"#eeeeec" },
- { "name":"aluminium2", "value":"#d3d7cf" },
- { "name":"aluminium3", "value":"#babdb6" },
- { "name":"aluminium4", "value":"#888a85" },
- { "name":"aluminium5", "value":"#555753" },
- { "name":"aluminium6", "value":"#2e3436" },
- { "name":"NormalVim", "value":"#f6f3e8" },
- { "name":"NonTextVim", "value":"#070707" },
- { "name":"CursorVim", "value":"#000000" },
- { "name":"CursorLineBGVim", "value":"#121212" },
- { "name":"MatchParenVim", "value":"#f6f3e8" },
- { "name":"SearchVim", "value":"#f6f3e8" },
- { "name":"CommentVim", "value":"#7C7C7C" },
- { "name":"StringVim", "value":"#A8FF60" },
- { "name":"StringSingleQuoteVim", "value":"#FF8080" },
- { "name":"NumberVim", "value":"#FF73FD" },
- { "name":"PreProcVim", "value":"#96CBFE" },
- { "name":"ConditionalVim", "value":"#6699CC" },
- { "name":"TodoVim", "value":"#8f8f8f" },
- { "name":"ConstantVim", "value":"#99CC99" },
- { "name":"IdentifierVim", "value":"#C6C5FE" },
- { "name":"FunctionVim", "value":"#FFD2A7" },
- { "name":"TypeVim", "value":"#FFFFB6" },
- { "name":"StatementVim", "value":"#6699CC" },
- { "name":"SpecialVim", "value":"#E18964" },
- { "name":"KeywordSemanticVim", "value":"#E18964" },
- { "name":"DelimiterVim", "value":"#00A0A0" },
- { "name":"OperatorVim", "value":"#ffffff" },
- { "name":"BlackVim", "value":"#000000" },
- { "name":"VisualBGVim", "value":"#262D51" },
- { "name":"LineNrVim", "value":"#3D3D3D" }
- ],
-
- "colors":[
- { "name":"Background(Read Only)", "color":"BlackVim" },
-
- { "name":"Search result background", "color":"VisualBGVim" },
- { "name":"Search result background (highlighted)", "color":"VisualBGVim" },
-
- { "name":"Column Ruler", "color":"aluminium5" },
-
- { "name":"Fold Square", "color":"white", "secondcolor":"BlackVim" },
- { "name":"Fold Cross", "color":"white", "secondcolor":"BlackVim" },
-
- { "name":"Indentation Guide", "color":"aluminium5" },
-
- { "name":"Indicator Margin", "color":"aluminium7" },
- { "name":"Indicator Margin(Separator)", "color":"aluminium6" },
-
- { "name":"Tooltip Border", "color":"#989892" },
- { "name":"Tooltip Pager Top", "color":"BlackVim" },
- { "name":"Tooltip Pager Bottom", "color":"BlackVim" },
- { "name":"Tooltip Pager Triangle", "color":"NormalVim" },
- { "name":"Tooltip Pager Text", "color":"NormalVim" },
-
- { "name":"Notification Border", "color":"#989892" },
-
- { "name":"Completion Matching Substring", "color":"#BA3373" },
- { "name":"Completion Border", "color":"#C9C9C9" },
- { "name":"Completion Border(Inactive)", "color":"#666666" },
-
- { "name":"Bookmarks", "color":"aluminium1", "secondcolor":"aluminium4" },
-
- { "name":"Underline(Error)", "color":"invalid-red" },
- { "name":"Underline(Warning)", "color":"skyblue1" },
- { "name":"Underline(Suggestion)", "color":"chameleon3" },
- { "name":"Underline(Hint)", "color":"chameleon1" },
-
- { "name":"Quick Diff(Dirty)", "color":"butter2" },
- { "name":"Quick Diff(Changed)", "color":"StringVim" },
-
- { "name":"Brace Matching(Rectangle)", "color":"aluminium4", "secondcolor":"aluminium5" },
- { "name":"Usages(Rectangle)", "color":"aluminium4", "secondcolor":"aluminium5", "bordercolor":"aluminium5" },
- { "name":"Changing usages(Rectangle)", "color":"aluminium4", "secondcolor":"aluminium5", "bordercolor":"aluminium5" },
-
- { "name":"Breakpoint Marker", "color":"#6f3535", "bordercolor":"#7a3a3a" },
- { "name":"Breakpoint Marker(Disabled)", "color":"#707070", "bordercolor":"#7b7b7b" },
- { "name":"Breakpoint Marker(Invalid)", "color":"#604343", "bordercolor":"#6a4a4a" },
-
- { "name":"Current Line Marker", "color":"CursorLineBGVim"},
- { "name":"Current Line Marker(Inactive)", "color":"CursorLineBGVim"},
-
- { "name":"Debugger Current Line Marker", "color":"#69684c", "bordercolor":"#747354" },
- { "name":"Debugger Stack Line Marker", "color":"#5c6b4d", "bordercolor":"#657655"},
-
- { "name":"Primary Link", "color":"chocolate1", "secondcolor":"chocolate3"},
- { "name":"Primary Link(Highlighted)", "color":"chocolate1", "secondcolor":"chocolate2"},
- { "name":"Secondary Link", "color":"white", "secondcolor":"aluminium6"},
- { "name":"Secondary Link(Highlighted)", "color":"aluminium1", "secondcolor":"aluminium5"},
-
- { "name":"Message Bubble Error Marker", "color":"#b28d37"},
- { "name":"Message Bubble Error Tag", "color":"#e3a6a1", "secondcolor":"black"},
- { "name":"Message Bubble Error Counter", "color":"black", "secondcolor":"#e3a6a1"},
- { "name":"Message Bubble Error IconMargin", "color":"#735c54", "bordercolor":"#805b4d"},
- { "name":"Message Bubble Error Line", "color":"#7b645c"},
- { "name":"Message Bubble Error Tooltip", "color":"#e3a6a1"},
-
- { "name":"Message Bubble Warning Marker", "color":"#b28d37"},
- { "name":"Message Bubble Warning Tag", "color":"#efe89d", "secondcolor":"black"},
- { "name":"Message Bubble Warning Counter", "color":"black", "secondcolor":"#efe89d"},
- { "name":"Message Bubble Warning IconMargin", "color":"#777553", "bordercolor":"#948e51"},
- { "name":"Message Bubble Warning Line", "color":"#807e5c"},
- { "name":"Message Bubble Warning Tooltip", "color":"#efe89d"}
- ],
-
- "text":[
- { "name":"Plain Text", "fore":"NormalVim", "back":"BlackVim" },
- { "name":"Selected Text", "back":"#2647DD" },
- { "name":"Selected Text(Inactive)", "back":"aluminium4" },
-
- { "name":"Collapsed Text", "fore":"aluminium3", "back":"BlackVim" },
-
- { "name":"Line Numbers", "fore":"LineNrVim", "back":"BlackVim"},
-
- { "name":"Punctuation", "fore":"StringVim" },
- { "name":"Punctuation(Brackets)", "fore":"StringVim" },
-
- { "name":"Comment(Line)", "fore":"CommentVim" },
- { "name":"Comment(Block)", "fore":"CommentVim" },
- { "name":"Comment(Doc)", "fore":"CommentVim" },
- { "name":"Comment(DocTag)", "fore":"CommentVim"},
- { "name":"Comment Tag", "fore":"TodoVim", "weight":"bold" },
- { "name":"Excluded Code", "fore":"CommentVim" },
-
- { "name":"String", "fore":"StringVim"},
- { "name":"String(Escape)", "fore":"StringVim"},
- { "name":"String(C# @ Verbatim)", "fore":"StringVim"},
-
- { "name":"Number", "fore":"NumberVim"},
-
- { "name":"Preprocessor", "fore":"PreProcVim" },
- { "name":"Preprocessor(Region Name)", "fore":"PreProcVim" },
-
- { "name":"Xml Text", "fore":"NormalVim" },
- { "name":"Xml Delimiter", "fore":"NormalVim" },
- { "name":"Xml Name", "fore":"PreProcVim" },
- { "name":"Xml Attribute", "fore":"NormalVim" },
- { "name":"Xml Attribute Quotes", "fore":"StringVim" },
- { "name":"Xml Attribute Value", "fore":"StringVim" },
- { "name":"Xml Comment", "fore":"CommentVim" },
- { "name":"Xml CData Section", "fore":"PreProcVim" },
-
- { "name":"Html Attribute Name", "fore":"NormalVim" },
- { "name":"Html Attribute Value", "fore":"StringVim" },
- { "name":"Html Comment", "fore":"CommentVim" },
- { "name":"Html Element Name", "fore":"PreProcVim" },
- { "name":"Html Entity", "fore":"PreProcVim" },
- { "name":"Html Operator", "fore":"PreProcVim" },
- { "name":"Html Server-Side Script", "fore":"NormalVim", "back":"aluminium6" },
- { "name":"Html Tag Delimiter", "fore":"PreProcVim" },
- { "name":"Razor Code", "fore":"NormalVim", "back":"aluminium6" },
-
- { "name":"Tooltip Text", "fore":"NormalVim", "back":"#0a0a0a" },
- { "name":"Notification Text", "fore":"NormalVim", "back":"#0a0a0a" },
-
- { "name":"Completion Text", "fore":"#434343", "back":"#F0F6F8" },
- { "name":"Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
- { "name":"Completion Selected Text(Inactive)", "fore":"#434343", "back":"white" },
-
- { "name":"Keyword(Access)", "fore":"TypeVim" },
- { "name":"Keyword(Type)", "fore":"TypeVim" },
- { "name":"Keyword(Operator)", "fore":"ConstantVim" },
- { "name":"Keyword(Selection)", "fore":"StatementVim" },
- { "name":"Keyword(Iteration)", "fore":"StatementVim" },
- { "name":"Keyword(Jump)", "fore":"StatementVim" },
- { "name":"Keyword(Context)", "fore":"StatementVim" },
- { "name":"Keyword(Exception)", "fore":"StatementVim" },
- { "name":"Keyword(Modifiers)", "fore":"TypeVim" },
- { "name":"Keyword(Constants)", "fore":"SpecialVim" },
- { "name":"Keyword(Void)", "fore":"SpecialVim" },
- { "name":"Keyword(Namespace)", "fore":"TypeVim", "weight":"Bold" },
- { "name":"Keyword(Property)", "fore":"TypeVim" },
- { "name":"Keyword(Declaration)", "fore":"TypeVim", "weight":"Bold" },
- { "name":"Keyword(Parameter)", "fore":"TypeVim" },
- { "name":"Keyword(Operator Declaration)", "fore":"TypeVim", "weight":"Bold" },
- { "name":"Keyword(Other)", "fore":"SpecialVim" },
-
- { "name":"User Types", "fore":"IdentifierVim" },
- { "name":"User Types(Enums)", "fore":"IdentifierVim" },
- { "name":"User Types(Interfaces)", "fore":"IdentifierVim" },
- { "name":"User Types(Delegates)", "fore":"IdentifierVim" },
- { "name":"User Types(Value types)", "fore":"IdentifierVim" },
- { "name":"User Types(Type parameters)", "fore":"IdentifierVim" },
-
- { "name":"User Field Usage", "fore":"NormalVim" },
- { "name":"User Field Declaration", "fore":"NormalVim" },
-
- { "name":"User Property Usage", "fore":"NormalVim" },
- { "name":"User Property Declaration", "fore":"NormalVim" },
-
- { "name":"User Event Usage", "fore":"NormalVim" },
- { "name":"User Event Declaration", "fore":"NormalVim" },
-
- { "name":"User Method Usage", "fore":"NormalVim" },
- { "name":"User Method Declaration", "fore":"NormalVim" },
-
- { "name":"User Parameter Usage", "fore":"NormalVim" },
- { "name":"User Parameter Declaration", "fore":"NormalVim" },
-
- { "name":"User Variable Usage", "fore":"NormalVim" },
- { "name":"User Variable Declaration", "fore":"NormalVim" },
-
- { "name":"Syntax Error", "fore":"scarletred1" },
-
- { "name":"String Format Items", "fore":"NormalVim" },
-
- { "name":"Breakpoint Text", "fore":"white", "back":"#6f3535" },
-
- { "name":"Debugger Current Statement", "fore":"white", "back":"#69684c" },
- { "name":"Debugger Stack Line", "fore":"white", "back":"#5c6b4d" },
-
- { "name":"Diff Line(Added)", "fore":"butter2" },
- { "name":"Diff Line(Removed)", "fore":"skyblue1" },
- { "name":"Diff Line(Changed)", "fore":"plum1" },
- { "name":"Diff Header", "fore":"chameleon1", "weight":"bold" },
- { "name":"Diff Header(Separator)", "fore":"aluminium4" },
- { "name":"Diff Header(Old)", "fore":"chameleon1", "weight":"bold" },
- { "name":"Diff Header(New)", "fore":"chameleon1", "weight":"bold" },
- { "name":"Diff Location", "fore":"chameleon1", "weight":"bold" },
-
- { "name":"Css Comment", "fore":"CommentVim" },
- { "name":"Css Property Name", "fore":"NormalVim" },
- { "name":"Css Property Value", "fore":"StringVim" },
- { "name":"Css Selector", "fore":"CommentVim" },
- { "name":"Css String Value", "fore":"StringVim" },
- { "name":"Css Keyword", "fore":"StatementVim" },
-
- { "name":"Script Comment", "fore":"CommentVim" },
- { "name":"Script Identifier" },
- { "name":"Script Keyword", "fore":"StatementVim" },
- { "name":"Script Number", "fore":"NumberVim" },
- { "name":"Script Operator" },
- { "name":"Script String", "fore":"StringVim" }
- ]
-} \ No newline at end of file
+ "name": "Nightshade",
+ "version": "1.2.3",
+ "description": "An inky scheme with vibrant highlights",
+ "originator": "Anirudh Sanjeev <anirudh@anirudhsanjeev.org>",
+
+ "palette": [
+ { "name": "butter2", "value": "#edd400" },
+ { "name": "orange1", "value": "#fcaf3e" },
+ { "name": "orange2", "value": "#f57900" },
+ { "name": "chocolate1", "value": "#e9b96e" },
+ { "name": "chocolate2", "value": "#c17d11" },
+ { "name": "chocolate3", "value": "#8f5902" },
+ { "name": "chameleon1", "value": "#8ae234" },
+ { "name": "chameleon2", "value": "#73d216" },
+ { "name": "chameleon3", "value": "#4e9a06" },
+ { "name": "skyblue1", "value": "#729fcf" },
+ { "name": "plum1", "value": "#ad7fa8" },
+ { "name": "scarletred1", "value": "#ef2929" },
+ { "name": "scarletred2", "value": "#cc0000" },
+ { "name": "aluminium1", "value": "#eeeeec" },
+ { "name": "aluminium3", "value": "#babdb6" },
+ { "name": "aluminium4", "value": "#888a85" },
+ { "name": "aluminium5", "value": "#555753" },
+ { "name": "aluminium6", "value": "#2e3436" },
+ { "name": "NormalVim", "value": "#f6f3e8" },
+ { "name": "CommentVim", "value": "#7C7C7C" },
+ { "name": "StringVim", "value": "#A8FF60" },
+ { "name": "NumberVim", "value": "#FF73FD" },
+ { "name": "PreProcVim", "value": "#96CBFE" },
+ { "name": "ConstantVim", "value": "#99CC99" },
+ { "name": "IdentifierVim", "value": "#C6C5FE" },
+ { "name": "TypeVim", "value": "#FFFFB6" },
+ { "name": "StatementVim", "value": "#6699CC" },
+ { "name": "SpecialVim", "value": "#E18964" },
+ { "name": "BlackVim", "value": "#000000" },
+ { "name": "VisualBGVim", "value": "#262D51" },
+ { "name": "LineNrVim", "value": "#3D3D3D" }
+ ],
+
+ "colors": [
+ { "name": "Background(Read Only)", "color": "BlackVim" },
+
+ { "name": "Search result background", "color": "VisualBGVim" },
+ { "name": "Search result background (highlighted)", "color": "VisualBGVim" },
+
+ { "name": "Column Ruler", "color": "#2a2a2a" },
+
+ { "name": "Fold Square", "color": "#3d3d3b", "secondcolor": "BlackVim" },
+ { "name": "Fold Cross", "color": "#6f706c", "secondcolor": "BlackVim" },
+
+ { "name": "Indentation Guide", "color": "aluminium5" },
+
+ { "name": "Indicator Margin", "color": "aluminium7" },
+ { "name": "Indicator Margin(Separator)", "color": "aluminium6" },
+
+ { "name": "Tooltip Pager Top", "color": "BlackVim" },
+ { "name": "Tooltip Pager Triangle", "color": "NormalVim" },
+ { "name": "Tooltip Pager Text", "color": "NormalVim" },
+
+ { "name": "Notification Border", "color": "#989892" },
+
+ { "name": "Completion Window", "color": "BlackVim", "bordercolor": "#989892" },
+ { "name": "Completion Tooltip Window", "color": "#0a0a0a", "bordercolor": "#989892" },
+ { "name": "Completion Selection Bar Border", "color": "#2647DD" },
+ { "name": "Completion Selection Bar Border(Inactive)", "color": "aluminium4" },
+ { "name": "Completion Selection Bar Background", "color": "#2647DD", "secondcolor": "#2647DD" },
+ { "name": "Completion Selection Bar Background(Inactive)", "color": "aluminium4", "secondcolor": "aluminium4" },
+
+ { "name": "Bookmarks", "color": "aluminium1", "secondcolor": "aluminium4" },
+
+ { "name": "Underline(Error)", "color": "scarletred2" },
+ { "name": "Underline(Warning)", "color": "skyblue1" },
+ { "name": "Underline(Suggestion)", "color": "chameleon3" },
+ { "name": "Underline(Hint)", "color": "chameleon1" },
+
+ { "name": "Quick Diff(Dirty)", "color": "butter2" },
+ { "name": "Quick Diff(Changed)", "color": "StringVim" },
+
+ { "name": "Brace Matching(Rectangle)", "color": "#517297", "secondcolor": "#517297" },
+ { "name": "Usages(Rectangle)", "color": "#527F99", "secondcolor": "#527F99", "bordercolor": "#527F99" },
+ { "name": "Changing usages(Rectangle)", "color": "#996E75", "secondcolor": "#996E75", "bordercolor": "#996E75" },
+
+ { "name": "Breakpoint Marker", "color": "#6f3535", "bordercolor": "#6f3535" },
+ { "name": "Breakpoint Marker(Disabled)", "color": "#4d4d4d", "bordercolor": "#4d4d4d" },
+ { "name": "Breakpoint Marker(Invalid)", "color": "#604343", "bordercolor": "#604343" },
+
+ { "name": "Current Line Marker", "color": "#2a2a2a", "secondcolor": "#2a2a2a" },
+ { "name": "Current Line Marker(Inactive)", "color": "#2a2a2a", "secondcolor": "#2a2a2a" },
+
+ { "name": "Debugger Current Line Marker", "color": "#69684c", "bordercolor": "#69684c" },
+ { "name": "Debugger Stack Line Marker", "color": "#4a6429", "bordercolor": "#4a6429" },
+
+ { "name": "Primary Link", "color": "chocolate1", "secondcolor": "chocolate3" },
+ { "name": "Primary Link(Highlighted)", "color": "chocolate1", "secondcolor": "chocolate2" },
+ { "name": "Secondary Link", "color": "white", "secondcolor": "aluminium6" },
+ { "name": "Secondary Link(Highlighted)", "color": "aluminium1", "secondcolor": "aluminium5" },
+
+ { "name": "Message Bubble Error Marker", "color": "#b28d37" },
+ { "name": "Message Bubble Error Tag", "color": "#e3a6a1", "secondcolor": "black" },
+ { "name": "Message Bubble Error Counter", "color": "black", "secondcolor": "#e3a6a1" },
+ { "name": "Message Bubble Error IconMargin", "color": "#735c54", "bordercolor": "#805b4d" },
+ { "name": "Message Bubble Error Line", "color": "#7b645c" },
+ { "name": "Message Bubble Error Tooltip", "color": "#e3a6a1" },
+
+ { "name": "Message Bubble Warning Marker", "color": "#b28d37" },
+ { "name": "Message Bubble Warning Tag", "color": "#efe89d", "secondcolor": "black" },
+ { "name": "Message Bubble Warning Counter", "color": "black", "secondcolor": "#efe89d" },
+ { "name": "Message Bubble Warning IconMargin", "color": "#777553", "bordercolor": "#948e51" },
+ { "name": "Message Bubble Warning Line", "color": "#807e5c" },
+ { "name": "Message Bubble Warning Tooltip", "color": "#efe89d" },
+
+ { "name": "Link Color", "color": "#41e2cb" },
+ { "name": "Link Color(Active)", "color": "#41e2cb" }
+ ],
+
+ "text": [
+ { "name": "Plain Text", "fore": "NormalVim", "back": "BlackVim" },
+ { "name": "Selected Text", "back": "#2647DD" },
+ { "name": "Selected Text(Inactive)", "back": "aluminium4" },
+
+ { "name": "Collapsed Text", "fore": "CommentVim", "back": "BlackVim" },
+
+ { "name": "Line Numbers", "fore": "LineNrVim", "back": "BlackVim" },
+
+ { "name": "Punctuation", "fore": "StringVim" },
+ { "name": "Punctuation(Brackets)", "fore": "StringVim" },
+
+ { "name": "Comment(Line)", "fore": "CommentVim" },
+ { "name": "Comment(Block)", "fore": "CommentVim" },
+ { "name": "Comment(Doc)", "fore": "CommentVim" },
+ { "name": "Comment(DocTag)", "fore": "CommentVim" },
+
+ { "name": "Excluded Code", "fore": "CommentVim" },
+
+ { "name": "String", "fore": "StringVim" },
+ { "name": "String(Escape)", "fore": "StringVim" },
+ { "name": "String(C# @ Verbatim)", "fore": "StringVim" },
+ { "name": "String(Regex Set Constructs)", "fore": "chameleon2" },
+ { "name": "String(Regex Character Class)", "fore": "skyblue1" },
+ { "name": "String(Regex Grouping Constructs)", "fore": "plum1" },
+ { "name": "String(Regex Escape Character)", "fore": "orange2" },
+ { "name": "String(Regex Alt Escape Character)", "fore": "orange1" },
+
+ { "name": "Number", "fore": "NumberVim" },
+
+ { "name": "Preprocessor", "fore": "PreProcVim" },
+ { "name": "Preprocessor(Region Name)", "fore": "PreProcVim" },
+
+ { "name": "Xml Text", "fore": "NormalVim" },
+ { "name": "Xml Delimiter", "fore": "NormalVim" },
+ { "name": "Xml Name", "fore": "PreProcVim" },
+ { "name": "Xml Attribute", "fore": "NormalVim" },
+ { "name": "Xml Attribute Quotes", "fore": "StringVim" },
+ { "name": "Xml Attribute Value", "fore": "StringVim" },
+ { "name": "Xml Comment", "fore": "CommentVim" },
+ { "name": "Xml CData Section", "fore": "PreProcVim" },
+
+ { "name": "Html Attribute Name", "fore": "NormalVim" },
+ { "name": "Html Attribute Value", "fore": "StringVim" },
+ { "name": "Html Comment", "fore": "CommentVim" },
+ { "name": "Html Element Name", "fore": "PreProcVim" },
+ { "name": "Html Entity", "fore": "PreProcVim" },
+ { "name": "Html Operator", "fore": "PreProcVim" },
+ { "name": "Html Server-Side Script", "fore": "NormalVim", "back": "aluminium6" },
+ { "name": "Html Tag Delimiter", "fore": "PreProcVim" },
+ { "name": "Razor Code", "fore": "NormalVim", "back": "aluminium6" },
+
+ { "name": "Tooltip Text", "fore": "#d1d1cd", "back": "#525759" },
+ { "name": "Notification Text", "fore": "NormalVim", "back": "#0a0a0a" },
+
+ { "name": "Completion Text", "fore": "NormalVim" },
+ { "name": "Completion Matching Substring", "fore": "StatementVim" },
+
+ { "name": "Completion Selected Text", "fore": "NormalVim" },
+ { "name": "Completion Selected Matching Substring", "fore": "StatementVim" },
+
+ { "name": "Completion Selected Text(Inactive)", "fore": "NormalVim" },
+ { "name": "Completion Selected Matching Substring(Inactive)", "fore": "StatementVim" },
+
+ { "name": "Keyword(Access)", "fore": "TypeVim" },
+ { "name": "Keyword(Type)", "fore": "TypeVim" },
+ { "name": "Keyword(Operator)", "fore": "ConstantVim" },
+ { "name": "Keyword(Selection)", "fore": "StatementVim" },
+ { "name": "Keyword(Iteration)", "fore": "StatementVim" },
+ { "name": "Keyword(Jump)", "fore": "StatementVim" },
+ { "name": "Keyword(Context)", "fore": "StatementVim" },
+ { "name": "Keyword(Exception)", "fore": "StatementVim" },
+ { "name": "Keyword(Modifiers)", "fore": "TypeVim" },
+ { "name": "Keyword(Constants)", "fore": "SpecialVim" },
+ { "name": "Keyword(Void)", "fore": "SpecialVim" },
+ { "name": "Keyword(Namespace)", "fore": "TypeVim" },
+ { "name": "Keyword(Property)", "fore": "TypeVim" },
+ { "name": "Keyword(Declaration)", "fore": "TypeVim" },
+ { "name": "Keyword(Parameter)", "fore": "TypeVim" },
+ { "name": "Keyword(Operator Declaration)", "fore": "TypeVim" },
+ { "name": "Keyword(Other)", "fore": "SpecialVim" },
+
+ { "name": "User Types", "fore": "IdentifierVim" },
+ { "name": "User Types(Enums)", "fore": "IdentifierVim" },
+ { "name": "User Types(Interfaces)", "fore": "IdentifierVim" },
+ { "name": "User Types(Delegates)", "fore": "IdentifierVim" },
+ { "name": "User Types(Value types)", "fore": "IdentifierVim" },
+ { "name": "User Types(Type parameters)", "fore": "IdentifierVim" },
+ { "name": "User Types(Mutable)", "fore": "#ffd21c" },
+
+ { "name": "User Field Usage", "fore": "NormalVim" },
+ { "name": "User Field Declaration", "fore": "NormalVim" },
+
+ { "name": "User Property Usage", "fore": "NormalVim" },
+ { "name": "User Property Declaration", "fore": "NormalVim" },
+
+ { "name": "User Event Usage", "fore": "NormalVim" },
+ { "name": "User Event Declaration", "fore": "NormalVim" },
+
+ { "name": "User Method Usage", "fore": "NormalVim" },
+ { "name": "User Method Declaration", "fore": "NormalVim" },
+
+ { "name": "User Parameter Usage", "fore": "NormalVim" },
+ { "name": "User Parameter Declaration", "fore": "NormalVim" },
+
+ { "name": "User Variable Usage", "fore": "NormalVim" },
+ { "name": "User Variable Declaration", "fore": "NormalVim" },
+
+ { "name": "Syntax Error", "fore": "scarletred1" },
+
+ { "name": "String Format Items", "fore": "NormalVim" },
+
+ { "name": "Breakpoint Text", "fore": "white", "back": "#6f3535" },
+
+ { "name": "Debugger Current Statement", "fore": "white", "back": "#69684c" },
+ { "name": "Debugger Stack Line", "fore": "white", "back": "#5c6b4d" },
+
+ { "name": "Diff Line(Added)", "fore": "butter2" },
+ { "name": "Diff Line(Removed)", "fore": "skyblue1" },
+ { "name": "Diff Line(Changed)", "fore": "plum1" },
+ { "name": "Diff Header", "fore": "chameleon1", "weight": "bold" },
+ { "name": "Diff Header(Separator)", "fore": "aluminium4", "weight": "bold" },
+ { "name": "Diff Header(Old)", "fore": "chameleon1", "weight": "bold" },
+ { "name": "Diff Header(New)", "fore": "chameleon1", "weight": "bold" },
+ { "name": "Diff Location", "fore": "chameleon1", "weight": "bold" },
+
+ { "name": "Css Comment", "fore": "CommentVim", "weight": "bold" },
+ { "name": "Css Property Name", "fore": "NormalVim", "weight": "bold" },
+ { "name": "Css Property Value", "fore": "StringVim", "weight": "bold" },
+ { "name": "Css Selector", "fore": "CommentVim", "weight": "bold" },
+ { "name": "Css String Value", "fore": "StringVim", "weight": "bold" },
+ { "name": "Css Keyword", "fore": "StatementVim", "weight": "bold" },
+
+ { "name": "Script Comment", "fore": "CommentVim" },
+ { "name": "Script Keyword", "fore": "StatementVim" },
+ { "name": "Script Number", "fore": "NumberVim" },
+ { "name": "Script String", "fore": "StringVim" }
+ ]
+}
diff --git a/main/src/core/Mono.Texteditor/Styles/OblivionStyle.json b/main/src/core/Mono.Texteditor/Styles/OblivionStyle.json
index e7064c653c..bca141ae50 100644
--- a/main/src/core/Mono.Texteditor/Styles/OblivionStyle.json
+++ b/main/src/core/Mono.Texteditor/Styles/OblivionStyle.json
@@ -1,239 +1,246 @@
{
- "name":"Oblivion",
- "version":"1.1",
- "description":"'...where the soul at last is lost in utter peace'",
- "originator":"Xamarin Inc. (http://xamarin.com)",
-
- "palette":[
- { "name":"butter1", "value":"#fce94f" },
- { "name":"butter2", "value":"#edd400" },
- { "name":"butter3", "value":"#c4a000" },
- { "name":"orange1", "value":"#fcaf3e" },
- { "name":"orange2", "value":"#f57900" },
- { "name":"orange3", "value":"#ce5c00" },
- { "name":"chocolate1", "value":"#e9b96e" },
- { "name":"chocolate2", "value":"#c17d11" },
- { "name":"chocolate3", "value":"#8f5902" },
- { "name":"chameleon1", "value":"#8ae234" },
- { "name":"chameleon2", "value":"#73d216" },
- { "name":"chameleon3", "value":"#4e9a06" },
- { "name":"skyblue1", "value":"#729fcf" },
- { "name":"skyblue2", "value":"#3465a4" },
- { "name":"skyblue3", "value":"#204a87" },
- { "name":"plum1", "value":"#ad7fa8" },
- { "name":"plum2", "value":"#75507b" },
- { "name":"plum3", "value":"#5c3566" },
- { "name":"scarletred1", "value":"#ef2929" },
- { "name":"scarletred2", "value":"#cc0000" },
- { "name":"scarletred3", "value":"#a40000" },
- { "name":"aluminium1", "value":"#eeeeec" },
- { "name":"aluminium2", "value":"#d3d7cf" },
- { "name":"aluminium3", "value":"#babdb6" },
- { "name":"aluminium4", "value":"#888a85" },
- { "name":"aluminium5", "value":"#555753" },
- { "name":"aluminium6", "value":"#2e3436" },
- { "name":"aluminium7", "value":"#202424" }
- ],
-
- "colors":[
- { "name":"Background(Read Only)", "color":"aluminium7" },
-
- { "name":"Search result background", "color":"#006060" },
- { "name":"Search result background (highlighted)", "color":"#008080" },
-
- { "name":"Column Ruler", "color":"aluminium5" },
-
- { "name":"Fold Square", "color":"white", "secondcolor":"aluminium7" },
- { "name":"Fold Cross", "color":"white", "secondcolor":"aluminium7" },
-
- { "name":"Indentation Guide", "color":"aluminium5" },
-
- { "name":"Indicator Margin", "color":"aluminium7" },
- { "name":"Indicator Margin(Separator)", "color":"aluminium6" },
-
- { "name":"Tooltip Border", "color":"aluminium1" },
- { "name":"Tooltip Pager Top", "color":"aluminium5" },
- { "name":"Tooltip Pager Bottom", "color":"aluminium5" },
- { "name":"Tooltip Pager Triangle", "color":"aluminium2" },
- { "name":"Tooltip Pager Text", "color":"aluminium2" },
-
- { "name":"Notification Border", "color":"aluminium1" },
-
- { "name":"Completion Matching Substring", "color":"#BA3373" },
- { "name":"Completion Border", "color":"#C9C9C9" },
- { "name":"Completion Border(Inactive)", "color":"#bebebe" },
-
- { "name":"Bookmarks", "color":"aluminium1", "secondcolor":"aluminium4" },
-
- { "name":"Underline(Error)", "color":"scarletred2" },
- { "name":"Underline(Warning)", "color":"skyblue1" },
- { "name":"Underline(Suggestion)", "color":"chameleon3" },
- { "name":"Underline(Hint)", "color":"chameleon1" },
-
- { "name":"Quick Diff(Dirty)", "color":"butter2" },
- { "name":"Quick Diff(Changed)", "color":"chameleon2" },
-
- { "name":"Brace Matching(Rectangle)", "color":"aluminium4", "secondcolor":"aluminium5" },
- { "name":"Usages(Rectangle)", "color":"#527F99", "secondcolor":"#527F99", "bordercolor":"#527F99" },
- { "name":"Changing usages(Rectangle)", "color":"#996E75", "secondcolor":"#996E75", "bordercolor":"#996E75" },
-
- { "name":"Breakpoint Marker", "color":"#6f3535", "bordercolor":"#7a3a3a" },
- { "name":"Breakpoint Marker(Disabled)", "color":"#707070", "bordercolor":"#7b7b7b" },
- { "name":"Breakpoint Marker(Invalid)", "color":"#604343", "bordercolor":"#6a4a4a" },
-
- { "name":"Current Line Marker", "color":"aluminium7"},
- { "name":"Current Line Marker(Inactive)", "color":"aluminium7"},
-
- { "name":"Debugger Current Line Marker", "color":"#69684c", "bordercolor":"#747354" },
- { "name":"Debugger Stack Line Marker", "color":"#5c6b4d", "bordercolor":"#657655"},
-
- { "name":"Primary Link", "color":"chocolate1", "secondcolor":"chocolate3"},
- { "name":"Primary Link(Highlighted)", "color":"chocolate1", "secondcolor":"chocolate2"},
- { "name":"Secondary Link", "color":"white", "secondcolor":"aluminium6"},
- { "name":"Secondary Link(Highlighted)", "color":"aluminium1", "secondcolor":"aluminium5"},
-
- { "name":"Message Bubble Error Marker", "color":"#b28d37"},
- { "name":"Message Bubble Error Tag", "color":"#e3a6a1", "secondcolor":"black"},
- { "name":"Message Bubble Error Counter", "color":"black", "secondcolor":"#e3a6a1"},
- { "name":"Message Bubble Error IconMargin", "color":"#735c54", "bordercolor":"#805b4d"},
- { "name":"Message Bubble Error Line", "color":"#7b645c"},
- { "name":"Message Bubble Error Tooltip", "color":"#e3a6a1"},
-
- { "name":"Message Bubble Warning Marker", "color":"#b28d37"},
- { "name":"Message Bubble Warning Tag", "color":"#efe89d", "secondcolor":"black"},
- { "name":"Message Bubble Warning Counter", "color":"black", "secondcolor":"#efe89d"},
- { "name":"Message Bubble Warning IconMargin", "color":"#777553", "bordercolor":"#948e51"},
- { "name":"Message Bubble Warning Line", "color":"#807e5c"},
- { "name":"Message Bubble Warning Tooltip", "color":"#efe89d"}
- ],
-
- "text":[
- { "name":"Plain Text", "fore":"aluminium2", "back":"aluminium6" },
- { "name":"Selected Text", "back":"aluminium5" },
- { "name":"Selected Text(Inactive)", "back":"aluminium7" },
-
- { "name":"Collapsed Text", "fore":"aluminium3", "back":"aluminium6" },
-
- { "name":"Line Numbers", "fore":"aluminium5", "back":"black"},
-
- { "name":"Punctuation", "fore":"aluminium2" },
- { "name":"Punctuation(Brackets)", "fore":"aluminium2" },
-
- { "name":"Comment(Line)", "fore":"aluminium4" },
- { "name":"Comment(Block)", "fore":"aluminium4" },
- { "name":"Comment(Doc)", "fore":"aluminium4" },
- { "name":"Comment(DocTag)", "fore":"aluminium4" },
- { "name":"Comment Tag", "fore":"aluminium4", "back":"butter1", "weight":"bold" },
- { "name":"Excluded Code", "fore":"aluminium4" },
-
- { "name":"String", "fore":"butter2"},
- { "name":"String(Escape)", "fore":"butter3"},
- { "name":"String(C# @ Verbatim)", "fore":"butter2"},
-
- { "name":"Number", "fore":"butter2"},
-
- { "name":"Preprocessor", "fore":"skyblue1", "style":"italic" },
- { "name":"Preprocessor(Region Name)", "fore":"skyblue1", "style":"italic" },
-
- { "name":"Xml Text", "fore":"aluminium2" },
- { "name":"Xml Delimiter", "fore":"aluminium2" },
- { "name":"Xml Name", "fore":"plum1" },
- { "name":"Xml Attribute", "fore":"skyblue1" },
- { "name":"Xml Attribute Quotes", "fore":"butter2" },
- { "name":"Xml Attribute Value", "fore":"butter2" },
- { "name":"Xml Comment", "fore":"aluminium4" },
- { "name":"Xml CData Section", "fore":"aluminium2" },
-
- { "name":"Html Attribute Name", "fore":"aluminium2" },
- { "name":"Html Attribute Value", "fore":"butter2" },
- { "name":"Html Comment", "fore":"aluminium4" },
- { "name":"Html Element Name", "fore":"plum1" },
- { "name":"Html Entity", "fore":"skyblue1" },
- { "name":"Html Operator", "fore":"aluminium2" },
- { "name":"Html Server-Side Script", "fore":"butter2", "back":"black" },
- { "name":"Html Tag Delimiter", "fore":"aluminium2" },
- { "name":"Razor Code", "fore":"aluminium2", "back":"aluminium7" },
-
- { "name":"Tooltip Text", "fore":"aluminium2", "back":"aluminium5" },
- { "name":"Notification Text", "fore":"aluminium2", "back":"aluminium5" },
-
- { "name":"Completion Text", "fore":"#434343", "back":"#F0F6F8" },
- { "name":"Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
- { "name":"Completion Selected Text(Inactive)", "fore":"#434343", "back":"white" },
-
- { "name":"Keyword(Access)", "fore":"plum1", "weight":"bold" },
- { "name":"Keyword(Type)", "fore":"plum1", "weight":"bold" },
- { "name":"Keyword(Operator)", "fore":"plum1", "weight":"bold" },
- { "name":"Keyword(Selection)", "fore":"white", "weight":"bold" },
- { "name":"Keyword(Iteration)", "fore":"plum1", "weight":"bold" },
- { "name":"Keyword(Jump)", "fore":"plum1", "weight":"bold" },
- { "name":"Keyword(Context)", "fore":"white", "weight":"bold" },
- { "name":"Keyword(Exception)", "fore":"white", "weight":"bold" },
- { "name":"Keyword(Modifiers)", "fore":"plum1", "weight":"bold" },
- { "name":"Keyword(Constants)", "fore":"orange3", "weight":"bold" },
- { "name":"Keyword(Void)", "fore":"plum1", "weight":"bold" },
- { "name":"Keyword(Namespace)", "fore":"plum1", "weight":"bold" },
- { "name":"Keyword(Property)", "fore":"plum1", "weight":"bold" },
- { "name":"Keyword(Declaration)", "fore":"plum1", "weight":"bold" },
- { "name":"Keyword(Parameter)", "fore":"white", "weight":"bold" },
- { "name":"Keyword(Operator Declaration)", "fore":"plum1", "weight":"bold" },
- { "name":"Keyword(Other)", "fore":"white", "weight":"bold" },
-
- { "name":"User Types", "fore":"chameleon1" },
- { "name":"User Types(Enums)", "fore":"chameleon1" },
- { "name":"User Types(Interfaces)", "fore":"chameleon1" },
- { "name":"User Types(Delegates)", "fore":"chameleon1" },
- { "name":"User Types(Value types)", "fore":"chameleon1" },
- { "name":"User Types(Type parameters)", "fore":"chameleon1" },
-
- { "name":"User Field Usage", "fore":"aluminium2", "style":"italic" },
- { "name":"User Field Declaration", "fore":"aluminium2", "style":"italic" },
-
- { "name":"User Property Usage", "fore":"aluminium2", "style":"italic" },
- { "name":"User Property Declaration", "fore":"aluminium2", "style":"italic" },
-
- { "name":"User Event Usage", "fore":"aluminium2", "style":"italic" },
- { "name":"User Event Declaration", "fore":"aluminium2", "style":"italic" },
-
- { "name":"User Method Usage", "fore":"aluminium2", "style":"italic" },
- { "name":"User Method Declaration", "fore":"aluminium2", "style":"italic" },
-
- { "name":"User Parameter Usage", "fore":"aluminium2" },
- { "name":"User Parameter Declaration", "fore":"aluminium2" },
-
- { "name":"User Variable Usage", "fore":"aluminium2" },
- { "name":"User Variable Declaration", "fore":"aluminium2" },
-
- { "name":"Syntax Error", "fore":"scarletred1" },
-
- { "name":"String Format Items", "fore":"chocolate2" },
-
- { "name":"Breakpoint Text", "fore":"white", "back":"#6f3535" },
-
- { "name":"Debugger Current Statement", "fore":"white", "back":"#69684c" },
- { "name":"Debugger Stack Line", "fore":"white", "back":"#5c6b4d" },
-
- { "name":"Diff Line(Added)", "fore":"butter2" },
- { "name":"Diff Line(Removed)", "fore":"skyblue1" },
- { "name":"Diff Line(Changed)", "fore":"plum1" },
- { "name":"Diff Header", "fore":"chameleon1", "weight":"bold" },
- { "name":"Diff Header(Separator)", "fore":"aluminium4" },
- { "name":"Diff Header(Old)", "fore":"chameleon1", "weight":"bold" },
- { "name":"Diff Header(New)", "fore":"chameleon1", "weight":"bold" },
- { "name":"Diff Location", "fore":"chameleon1", "weight":"bold" },
-
- { "name":"Css Comment", "fore":"aluminium4", "weight":"bold" },
- { "name":"Css Property Name", "fore":"aluminium2", "weight":"bold" },
- { "name":"Css Property Value", "fore":"butter2", "weight":"bold" },
- { "name":"Css Selector", "fore":"aluminium2", "weight":"bold" },
- { "name":"Css String Value", "fore":"butter2", "weight":"bold" },
- { "name":"Css Keyword", "fore":"plum1", "weight":"bold" },
-
- { "name":"Script Comment", "fore":"aluminium4" },
- { "name":"Script Identifier" },
- { "name":"Script Keyword", "fore":"plum1" },
- { "name":"Script Number", "fore":"butter2" },
- { "name":"Script Operator" },
- { "name":"Script String", "fore":"butter2" }
- ]
-} \ No newline at end of file
+ "name": "Oblivion",
+ "version": "1.2.3",
+ "description": "‘...where the soul at last is lost in utter peace’",
+ "originator": "Xamarin Inc. (http://xamarin.com)",
+
+ "palette": [
+ { "name": "butter2", "value": "#edd400" },
+ { "name": "butter3", "value": "#c4a000" },
+ { "name": "orange1", "value": "#fcaf3e" },
+ { "name": "orange2", "value": "#f57900" },
+ { "name": "orange3", "value": "#ce5c00" },
+ { "name": "chocolate1", "value": "#e9b96e" },
+ { "name": "chocolate2", "value": "#c17d11" },
+ { "name": "chocolate3", "value": "#8f5902" },
+ { "name": "chameleon1", "value": "#8ae234" },
+ { "name": "chameleon2", "value": "#73d216" },
+ { "name": "chameleon3", "value": "#4e9a06" },
+ { "name": "skyblue1", "value": "#729fcf" },
+ { "name": "plum1", "value": "#ad7fa8" },
+ { "name": "scarletred1", "value": "#ef2929" },
+ { "name": "scarletred2", "value": "#cc0000" },
+ { "name": "scarletred3", "value": "#a40000" },
+ { "name": "aluminium1", "value": "#eeeeec" },
+ { "name": "aluminium2", "value": "#d3d7cf" },
+ { "name": "aluminium3", "value": "#babdb6" },
+ { "name": "aluminium4", "value": "#888a85" },
+ { "name": "aluminium5", "value": "#555753" },
+ { "name": "aluminium6", "value": "#2e3436" },
+ { "name": "aluminium7", "value": "#202424" }
+ ],
+
+ "colors": [
+ { "name": "Background(Read Only)", "color": "aluminium7" },
+
+ { "name": "Search result background", "color": "#006060" },
+ { "name": "Search result background (highlighted)", "color": "#008080" },
+
+ { "name": "Column Ruler", "color": "#3a3f42" },
+
+ { "name": "Fold Square", "color": "#555653", "secondcolor": "aluminium6" },
+ { "name": "Fold Cross", "color": "#686e5c", "secondcolor": "aluminium6" },
+
+ { "name": "Indentation Guide", "color": "#444a4d" },
+
+ { "name": "Indicator Margin", "color": "#2c2f30" },
+ { "name": "Indicator Margin(Separator)", "color": "#2c2f30" },
+
+ { "name": "Tooltip Pager Top", "color": "aluminium5" },
+ { "name": "Tooltip Pager Triangle", "color": "aluminium2" },
+ { "name": "Tooltip Pager Text", "color": "aluminium2" },
+
+ { "name": "Notification Border", "color": "aluminium1" },
+
+ { "name": "Completion Window", "color": "aluminium6", "bordercolor": "aluminium1" },
+ { "name": "Completion Tooltip Window", "color": "aluminium5", "bordercolor": "aluminium1" },
+ { "name": "Completion Selection Bar Border", "color": "aluminium5" },
+ { "name": "Completion Selection Bar Border(Inactive)", "color": "aluminium7" },
+ { "name": "Completion Selection Bar Background", "color": "aluminium5", "secondcolor": "aluminium5" },
+ { "name": "Completion Selection Bar Background(Inactive)", "color": "aluminium7", "secondcolor": "aluminium7" },
+
+ { "name": "Bookmarks", "color": "aluminium1", "secondcolor": "aluminium4" },
+
+ { "name": "Underline(Error)", "color": "scarletred2" },
+ { "name": "Underline(Warning)", "color": "skyblue1" },
+ { "name": "Underline(Suggestion)", "color": "chameleon3" },
+ { "name": "Underline(Hint)", "color": "chameleon1" },
+
+ { "name": "Quick Diff(Dirty)", "color": "butter2" },
+ { "name": "Quick Diff(Changed)", "color": "chameleon2" },
+
+ { "name": "Brace Matching(Rectangle)", "color": "#5b9bc1", "secondcolor": "#5b9bc1" },
+ { "name": "Usages(Rectangle)", "color": "#527F99", "secondcolor": "#527F99", "bordercolor": "#527F99" },
+ { "name": "Changing usages(Rectangle)", "color": "#996E75", "secondcolor": "#996E75", "bordercolor": "#996E75" },
+
+ { "name": "Breakpoint Marker", "color": "#6f3535", "bordercolor": "#6f3535" },
+ { "name": "Breakpoint Marker(Disabled)", "color": "#4d4d4d", "bordercolor": "#4d4d4d" },
+ { "name": "Breakpoint Marker(Invalid)", "color": "#604343", "bordercolor": "#604343" },
+
+ { "name": "Current Line Marker", "color": "#3a3f42", "secondcolor": "#3a3f42" },
+ { "name": "Current Line Marker(Inactive)", "color": "#3a3f42", "secondcolor": "#3a3f42" },
+
+ { "name": "Debugger Current Line Marker", "color": "#69684c", "bordercolor": "#69684c" },
+ { "name": "Debugger Stack Line Marker", "color": "#5f7247", "bordercolor": "#5f7247" },
+
+ { "name": "Primary Link", "color": "chocolate1", "secondcolor": "chocolate3" },
+ { "name": "Primary Link(Highlighted)", "color": "chocolate1", "secondcolor": "chocolate2" },
+ { "name": "Secondary Link", "color": "white", "secondcolor": "aluminium6" },
+ { "name": "Secondary Link(Highlighted)", "color": "aluminium1", "secondcolor": "aluminium5" },
+
+ { "name": "Message Bubble Error Marker", "color": "#b28d37" },
+ { "name": "Message Bubble Error Tag", "color": "#e3a6a1", "secondcolor": "black" },
+ { "name": "Message Bubble Error Counter", "color": "black", "secondcolor": "#e3a6a1" },
+ { "name": "Message Bubble Error IconMargin", "color": "#735c54", "bordercolor": "#805b4d" },
+ { "name": "Message Bubble Error Line", "color": "#740000" },
+ { "name": "Message Bubble Error Tooltip", "color": "#e3a6a1" },
+
+ { "name": "Message Bubble Warning Tag", "color": "#efe89d", "secondcolor": "black" },
+ { "name": "Message Bubble Warning Counter", "color": "black", "secondcolor": "#efe89d" },
+ { "name": "Message Bubble Warning IconMargin", "color": "#777553", "bordercolor": "#948e51" },
+ { "name": "Message Bubble Warning Line", "color": "#807e5c" },
+ { "name": "Message Bubble Warning Tooltip", "color": "#efe89d" },
+
+ { "name": "Link Color", "color": "#41e2cb" },
+ { "name": "Link Color(Active)", "color": "#41e2cb" }
+ ],
+
+ "text": [
+ { "name": "Plain Text", "fore": "aluminium2", "back": "aluminium6" },
+ { "name": "Selected Text", "back": "#61677e" },
+ { "name": "Selected Text(Inactive)", "back": "#6f6f6f" },
+
+ { "name": "Collapsed Text", "fore": "aluminium4", "back": "aluminium6" },
+
+ { "name": "Line Numbers", "fore": "aluminium5", "back": "aluminium6" },
+
+ { "name": "Punctuation", "fore": "aluminium2" },
+ { "name": "Punctuation(Brackets)", "fore": "aluminium2" },
+
+ { "name": "Comment(Line)", "fore": "aluminium4" },
+ { "name": "Comment(Block)", "fore": "aluminium4" },
+ { "name": "Comment(Doc)", "fore": "#7ab8c8" },
+ { "name": "Comment(DocTag)", "fore": "#79809e" },
+
+ { "name": "Excluded Code", "fore": "aluminium4" },
+
+ { "name": "String", "fore": "butter2" },
+ { "name": "String(Escape)", "fore": "butter3" },
+ { "name": "String(C# @ Verbatim)", "fore": "butter2" },
+ { "name": "String(Regex Set Constructs)", "fore": "chameleon2" },
+ { "name": "String(Regex Character Class)", "fore": "skyblue1" },
+ { "name": "String(Regex Grouping Constructs)", "fore": "plum1" },
+ { "name": "String(Regex Escape Character)", "fore": "orange2" },
+ { "name": "String(Regex Alt Escape Character)", "fore": "orange1" },
+
+ { "name": "Number", "fore": "butter2" },
+
+ { "name": "Preprocessor", "fore": "skyblue1" },
+ { "name": "Preprocessor(Region Name)", "fore": "skyblue1" },
+
+ { "name": "Xml Text", "fore": "aluminium2" },
+ { "name": "Xml Delimiter", "fore": "aluminium2" },
+ { "name": "Xml Name", "fore": "plum1" },
+ { "name": "Xml Attribute", "fore": "skyblue1" },
+ { "name": "Xml Attribute Quotes", "fore": "butter2" },
+ { "name": "Xml Attribute Value", "fore": "butter2" },
+ { "name": "Xml Comment", "fore": "aluminium4" },
+ { "name": "Xml CData Section", "fore": "aluminium2" },
+
+ { "name": "Html Attribute Name", "fore": "aluminium2" },
+ { "name": "Html Attribute Value", "fore": "butter2" },
+ { "name": "Html Comment", "fore": "aluminium4" },
+ { "name": "Html Element Name", "fore": "plum1" },
+ { "name": "Html Entity", "fore": "skyblue1" },
+ { "name": "Html Operator", "fore": "aluminium2" },
+ { "name": "Html Server-Side Script", "fore": "butter2", "back": "black" },
+ { "name": "Html Tag Delimiter", "fore": "aluminium2" },
+ { "name": "Razor Code", "fore": "aluminium2", "back": "aluminium7" },
+
+ { "name": "Tooltip Text", "fore": "#d1d1cd", "back": "#525759" },
+ { "name": "Notification Text", "fore": "aluminium2", "back": "aluminium5" },
+
+ { "name": "Completion Text", "fore": "aluminium2" },
+ { "name": "Completion Matching Substring", "fore": "plum1" },
+
+ { "name": "Completion Selected Text", "fore": "aluminium2" },
+ { "name": "Completion Selected Matching Substring", "fore": "plum1" },
+
+ { "name": "Completion Selected Text(Inactive)", "fore": "aluminium2" },
+ { "name": "Completion Selected Matching Substring(Inactive)", "fore": "plum1" },
+
+ { "name": "Keyword(Access)", "fore": "plum1" },
+ { "name": "Keyword(Type)", "fore": "plum1" },
+ { "name": "Keyword(Operator)", "fore": "plum1" },
+ { "name": "Keyword(Selection)", "fore": "white" },
+ { "name": "Keyword(Iteration)", "fore": "plum1" },
+ { "name": "Keyword(Jump)", "fore": "plum1" },
+ { "name": "Keyword(Context)", "fore": "white" },
+ { "name": "Keyword(Exception)", "fore": "white" },
+ { "name": "Keyword(Modifiers)", "fore": "plum1" },
+ { "name": "Keyword(Constants)", "fore": "orange3" },
+ { "name": "Keyword(Void)", "fore": "plum1" },
+ { "name": "Keyword(Namespace)", "fore": "plum1" },
+ { "name": "Keyword(Property)", "fore": "plum1" },
+ { "name": "Keyword(Declaration)", "fore": "plum1" },
+ { "name": "Keyword(Parameter)", "fore": "white" },
+ { "name": "Keyword(Operator Declaration)", "fore": "plum1" },
+ { "name": "Keyword(Other)", "fore": "white" },
+
+ { "name": "User Types", "fore": "chameleon1" },
+ { "name": "User Types(Enums)", "fore": "chameleon1" },
+ { "name": "User Types(Interfaces)", "fore": "chameleon1" },
+ { "name": "User Types(Delegates)", "fore": "chameleon1" },
+ { "name": "User Types(Value types)", "fore": "chameleon1" },
+ { "name": "User Types(Type parameters)", "fore": "chameleon1" },
+ { "name": "User Types(Mutable)", "fore": "#ffd21c" },
+
+ { "name": "User Field Usage", "fore": "aluminium2" },
+ { "name": "User Field Declaration", "fore": "aluminium2" },
+
+ { "name": "User Property Usage", "fore": "aluminium2" },
+ { "name": "User Property Declaration", "fore": "aluminium2" },
+
+ { "name": "User Event Usage", "fore": "aluminium2" },
+ { "name": "User Event Declaration", "fore": "aluminium2" },
+
+ { "name": "User Method Usage", "fore": "aluminium2" },
+ { "name": "User Method Declaration", "fore": "aluminium2" },
+
+ { "name": "User Parameter Usage", "fore": "aluminium2" },
+ { "name": "User Parameter Declaration", "fore": "aluminium2" },
+
+ { "name": "User Variable Usage", "fore": "aluminium2" },
+ { "name": "User Variable Declaration", "fore": "aluminium2" },
+
+ { "name": "Syntax Error", "fore": "scarletred1" },
+
+ { "name": "String Format Items", "fore": "chocolate2" },
+
+ { "name": "Breakpoint Text", "fore": "white", "back": "#6f3535" },
+
+ { "name": "Debugger Current Statement", "fore": "white", "back": "#69684c" },
+ { "name": "Debugger Stack Line", "fore": "white", "back": "#5c6b4d" },
+
+ { "name": "Diff Line(Added)", "fore": "butter2" },
+ { "name": "Diff Line(Removed)", "fore": "skyblue1" },
+ { "name": "Diff Line(Changed)", "fore": "plum1" },
+ { "name": "Diff Header", "fore": "chameleon1", "weight": "bold" },
+ { "name": "Diff Header(Separator)", "fore": "aluminium4", "weight": "bold" },
+ { "name": "Diff Header(Old)", "fore": "chameleon1", "weight": "bold" },
+ { "name": "Diff Header(New)", "fore": "chameleon1", "weight": "bold" },
+ { "name": "Diff Location", "fore": "chameleon1", "weight": "bold" },
+
+ { "name": "Css Comment", "fore": "aluminium4", "weight": "bold" },
+ { "name": "Css Property Name", "fore": "aluminium2", "weight": "bold" },
+ { "name": "Css Property Value", "fore": "butter2", "weight": "bold" },
+ { "name": "Css Selector", "fore": "aluminium2", "weight": "bold" },
+ { "name": "Css String Value", "fore": "butter2", "weight": "bold" },
+ { "name": "Css Keyword", "fore": "plum1", "weight": "bold" },
+
+ { "name": "Script Comment", "fore": "aluminium4" },
+ { "name": "Script Keyword", "fore": "plum1" },
+ { "name": "Script Number", "fore": "butter2" },
+ { "name": "Script String", "fore": "butter2" }
+ ]
+}
diff --git a/main/src/core/Mono.Texteditor/Styles/SolarizedDarkStyle.json b/main/src/core/Mono.Texteditor/Styles/SolarizedDarkStyle.json
index 920197e99f..7387d1c7ae 100644
--- a/main/src/core/Mono.Texteditor/Styles/SolarizedDarkStyle.json
+++ b/main/src/core/Mono.Texteditor/Styles/SolarizedDarkStyle.json
@@ -1,228 +1,235 @@
{
- "name":"Solarized Dark",
- "version":"1.1",
- "description":"An artful, dark scheme that's easy on the eyes.",
- "originator":"Xamarin Inc. (http://xamarin.com)",
-
- "palette":[
- { "name":"base03", "value":"#002b36" },
- { "name":"base02", "value":"#073642" },
- { "name":"base01", "value":"#586e75" },
- { "name":"base00", "value":"#657b83" },
- { "name":"base0", "value":"#839496" },
- { "name":"base1", "value":"#93a1a1" },
- { "name":"base2", "value":"#eee8d5" },
- { "name":"base3", "value":"#fdf6e3" },
- { "name":"yellow", "value":"#b58900" },
- { "name":"orange", "value":"#cb4b16" },
- { "name":"red", "value":"#dc322f" },
- { "name":"magenta", "value":"#d33682" },
- { "name":"violet", "value":"#6c71c4" },
- { "name":"blue", "value":"#268bd2" },
- { "name":"cyan", "value":"#2aa198" },
- { "name":"green", "value":"#859900" },
- { "name":"invalid-red", "value":"#ff0000"}
- ],
-
- "colors":[
- { "name":"Background(Read Only)", "color":"base02" },
-
- { "name":"Search result background", "color":"base02" },
- { "name":"Search result background (highlighted)", "color":"base02" },
-
- { "name":"Column Ruler", "color":"base1" },
-
- { "name":"Fold Square", "color":"base01", "secondcolor":"base02" },
- { "name":"Fold Cross", "color":"base01", "secondcolor":"base02" },
-
- { "name":"Indentation Guide", "color":"#354243" },
-
- { "name":"Indicator Margin", "color":"base03" },
- { "name":"Indicator Margin(Separator)", "color":"base02" },
-
- { "name":"Tooltip Border", "color":"base1" },
- { "name":"Tooltip Pager Top", "color":"base2" },
- { "name":"Tooltip Pager Bottom", "color":"base2" },
- { "name":"Tooltip Pager Triangle", "color":"base00" },
- { "name":"Tooltip Pager Text", "color":"base00" },
-
- { "name":"Notification Border", "color":"base1" },
-
- { "name":"Completion Matching Substring", "color":"#BA3373" },
- { "name":"Completion Border", "color":"#C9C9C9" },
- { "name":"Completion Border(Inactive)", "color":"#bebebe" },
-
- { "name":"Bookmarks", "color":"base3", "secondcolor":"blue" },
-
- { "name":"Underline(Error)", "color":"red" },
- { "name":"Underline(Warning)", "color":"orange" },
- { "name":"Underline(Suggestion)", "color":"blue" },
- { "name":"Underline(Hint)", "color":"green" },
-
- { "name":"Quick Diff(Dirty)", "color":"yellow" },
- { "name":"Quick Diff(Changed)", "color":"green" },
-
- { "name":"Brace Matching(Rectangle)", "color":"base1", "secondcolor":"base02" },
- { "name":"Usages(Rectangle)", "color":"base02", "secondcolor":"base02", "bordercolor":"base02" },
- { "name":"Changing usages(Rectangle)", "color":"base02", "secondcolor":"base02", "bordercolor":"base02" },
-
- { "name":"Breakpoint Marker", "color":"#6f3535", "bordercolor":"#7a3a3a" },
- { "name":"Breakpoint Marker(Disabled)", "color":"#707070", "bordercolor":"#7b7b7b" },
- { "name":"Breakpoint Marker(Invalid)", "color":"#604343", "bordercolor":"#6a4a4a" },
-
- { "name":"Current Line Marker", "color":"base02"},
- { "name":"Current Line Marker(Inactive)", "color":"base02"},
-
- { "name":"Debugger Current Line Marker", "color":"#69684c", "bordercolor":"#747354" },
- { "name":"Debugger Stack Line Marker", "color":"#5c6b4d", "bordercolor":"#657655"},
-
- { "name":"Primary Link", "color":"chameleon3", "secondcolor":"chameleon2"},
- { "name":"Primary Link(Highlighted)", "color":"chameleon3", "secondcolor":"chameleon1"},
- { "name":"Secondary Link", "color":"aluminium2", "secondcolor":"white"},
- { "name":"Secondary Link(Highlighted)", "color":"aluminium3", "secondcolor":"aluminium1"},
-
- { "name":"Message Bubble Error Marker", "color":"#b28d37"},
- { "name":"Message Bubble Error Tag", "color":"#e3a6a1", "secondcolor":"black"},
- { "name":"Message Bubble Error Counter", "color":"black", "secondcolor":"#e3a6a1"},
- { "name":"Message Bubble Error IconMargin", "color":"#735c54", "bordercolor":"#805b4d"},
- { "name":"Message Bubble Error Line", "color":"#7b645c"},
- { "name":"Message Bubble Error Tooltip", "color":"#e3a6a1"},
-
- { "name":"Message Bubble Warning Marker", "color":"#b28d37"},
- { "name":"Message Bubble Warning Tag", "color":"#efe89d", "secondcolor":"black"},
- { "name":"Message Bubble Warning Counter", "color":"black", "secondcolor":"#efe89d"},
- { "name":"Message Bubble Warning IconMargin", "color":"#777553", "bordercolor":"#948e51"},
- { "name":"Message Bubble Warning Line", "color":"#807e5c"},
- { "name":"Message Bubble Warning Tooltip", "color":"#efe89d"}
- ],
-
- "text":[
- { "name":"Plain Text", "fore":"base00", "back":"base03" },
- { "name":"Selected Text", "back":"base02" },
- { "name":"Selected Text(Inactive)", "back":"base3" },
-
- { "name":"Collapsed Text", "fore":"base01", "back":"base03" },
-
- { "name":"Line Numbers", "fore":"base00", "back":"base02"},
-
- { "name":"Punctuation", "fore":"base00" },
- { "name":"Punctuation(Brackets)", "fore":"base00" },
-
- { "name":"Comment(Line)", "fore":"base01" },
- { "name":"Comment(Block)", "fore":"base01" },
- { "name":"Comment(Doc)", "fore":"base01" },
- { "name":"Comment(DocTag)", "fore":"base01" },
- { "name":"Comment Tag", "fore":"base01", "style":"italic" },
- { "name":"Excluded Code", "fore":"base01" },
-
- { "name":"String", "fore":"cyan"},
- { "name":"String(Escape)", "fore":"lightcyan"},
- { "name":"String(C# @ Verbatim)", "fore":"cyan"},
-
- { "name":"Number", "fore":"violet"},
-
- { "name":"Preprocessor", "fore":"orange" },
- { "name":"Preprocessor(Region Name)", "fore":"orange" },
-
- { "name":"Xml Text", "fore":"base00" },
- { "name":"Xml Delimiter", "fore":"base00" },
- { "name":"Xml Name", "fore":"blue" },
- { "name":"Xml Attribute", "fore":"base00" },
- { "name":"Xml Attribute Quotes", "fore":"cyan" },
- { "name":"Xml Attribute Value", "fore":"cyan" },
- { "name":"Xml Comment", "fore":"base01" },
- { "name":"Xml CData Section", "fore":"cyan" },
-
- { "name":"Html Attribute Name", "fore":"base00" },
- { "name":"Html Attribute Value", "fore":"cyan" },
- { "name":"Html Comment", "fore":"base01" },
- { "name":"Html Element Name", "fore":"blue" },
- { "name":"Html Entity", "fore":"orange" },
- { "name":"Html Operator", "fore":"base00" },
- { "name":"Html Server-Side Script", "fore":"magenta", "back":"base02" },
- { "name":"Html Tag Delimiter", "fore":"base00" },
- { "name":"Razor Code", "fore":"black", "back":"base02" },
-
- { "name":"Tooltip Text", "fore":"black", "back":"#feffe9" },
- { "name":"Notification Text", "fore":"black", "back":"#feffe9" },
-
- { "name":"Completion Text", "fore":"#434343", "back":"#F0F6F8" },
- { "name":"Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
- { "name":"Completion Selected Text(Inactive)", "fore":"#434343", "back":"white" },
-
- { "name":"Keyword(Access)", "fore":"violet" },
- { "name":"Keyword(Type)", "fore":"green" },
- { "name":"Keyword(Operator)", "fore":"green" },
- { "name":"Keyword(Selection)", "fore":"green" },
- { "name":"Keyword(Iteration)", "fore":"green" },
- { "name":"Keyword(Jump)", "fore":"green" },
- { "name":"Keyword(Context)", "fore":"green" },
- { "name":"Keyword(Exception)", "fore":"green" },
- { "name":"Keyword(Modifiers)", "fore":"green" },
- { "name":"Keyword(Constants)", "fore":"green" },
- { "name":"Keyword(Void)", "fore":"yellow" },
- { "name":"Keyword(Namespace)", "fore":"green" },
- { "name":"Keyword(Property)", "fore":"green" },
- { "name":"Keyword(Declaration)", "fore":"green" },
- { "name":"Keyword(Parameter)", "fore":"green" },
- { "name":"Keyword(Operator Declaration)", "fore":"green" },
- { "name":"Keyword(Other)", "fore":"green" },
-
- { "name":"User Types", "fore":"yellow" },
- { "name":"User Types(Enums)", "fore":"yellow" },
- { "name":"User Types(Interfaces)", "fore":"yellow" },
- { "name":"User Types(Delegates)", "fore":"yellow" },
- { "name":"User Types(Value types)", "fore":"yellow" },
- { "name":"User Types(Type parameters)", "fore":"yellow" },
-
- { "name":"User Field Usage", "fore":"blue" },
- { "name":"User Field Declaration", "fore":"blue" },
-
- { "name":"User Property Usage", "fore":"blue" },
- { "name":"User Property Declaration", "fore":"blue" },
-
- { "name":"User Event Usage", "fore":"blue" },
- { "name":"User Event Declaration", "fore":"blue" },
-
- { "name":"User Method Usage", "fore":"blue" },
- { "name":"User Method Declaration", "fore":"blue" },
-
- { "name":"User Parameter Usage", "fore":"base00" },
- { "name":"User Parameter Declaration", "fore":"base00" },
-
- { "name":"User Variable Usage", "fore":"base00" },
- { "name":"User Variable Declaration", "fore":"base00" },
-
- { "name":"Syntax Error", "fore":"invalid-red" },
-
- { "name":"String Format Items", "fore":"base00" },
-
- { "name":"Breakpoint Text", "fore":"white", "back":"#6f3535" },
-
- { "name":"Debugger Current Statement", "fore":"white", "back":"#69684c" },
- { "name":"Debugger Stack Line", "fore":"white", "back":"#5c6b4d" },
-
- { "name":"Diff Line(Added)", "fore":"Blue" },
- { "name":"Diff Line(Removed)", "fore":"Red" },
- { "name":"Diff Line(Changed)", "fore":"Green" },
- { "name":"Diff Header", "fore":"Magenta" },
- { "name":"Diff Header(Separator)", "fore":"Magenta", "weight":"bold" },
- { "name":"Diff Header(Old)", "fore":"Red", "weight":"bold" },
- { "name":"Diff Header(New)", "fore":"Blue", "weight":"bold" },
- { "name":"Diff Location", "fore":"Magenta", "weight":"bold" },
-
- { "name":"Css Comment", "fore":"base01", "weight":"bold" },
- { "name":"Css Property Name", "fore":"black", "weight":"bold" },
- { "name":"Css Property Value", "fore":"cyan", "weight":"bold" },
- { "name":"Css Selector", "fore":"base01", "weight":"bold" },
- { "name":"Css String Value", "fore":"cyan", "weight":"bold" },
- { "name":"Css Keyword", "fore":"keyword-teal", "weight":"bold" },
-
- { "name":"Script Comment", "fore":"base01" },
- { "name":"Script Identifier" },
- { "name":"Script Keyword", "fore":"green" },
- { "name":"Script Number", "fore":"violet" },
- { "name":"Script Operator" },
- { "name":"Script String", "fore":"cyan" }
- ]
-} \ No newline at end of file
+ "name": "Solarized Dark",
+ "version": "1.2.3",
+ "description": "An artful, dark scheme that's easy on the eyes",
+ "originator": "Xamarin Inc. (http://xamarin.com)",
+
+ "palette": [
+ { "name": "base03", "value": "#002b36" },
+ { "name": "base02", "value": "#073642" },
+ { "name": "base01", "value": "#586e75" },
+ { "name": "base00", "value": "#657b83" },
+ { "name": "base0", "value": "#839496" },
+ { "name": "base1", "value": "#93a1a1" },
+ { "name": "base2", "value": "#eee8d5" },
+ { "name": "base3", "value": "#fdf6e3" },
+ { "name": "yellow", "value": "#b58900" },
+ { "name": "orange", "value": "#cb4b16" },
+ { "name": "red", "value": "#dc322f" },
+ { "name": "magenta", "value": "#d33682" },
+ { "name": "violet", "value": "#6c71c4" },
+ { "name": "blue", "value": "#268bd2" },
+ { "name": "cyan", "value": "#2aa198" },
+ { "name": "green", "value": "#859900" },
+ { "name": "invalid-red", "value": "#ff0000" }
+ ],
+
+ "colors": [
+ { "name": "Background(Read Only)", "color": "base02" },
+
+ { "name": "Search result background", "color": "base02" },
+ { "name": "Search result background (highlighted)", "color": "base02" },
+
+ { "name": "Column Ruler", "color": "#183842" },
+
+ { "name": "Fold Square", "color": "base01", "secondcolor": "base03" },
+ { "name": "Fold Cross", "color": "base01", "secondcolor": "base03" },
+
+ { "name": "Indentation Guide", "color": "#354243" },
+
+ { "name": "Indicator Margin", "color": "base03" },
+ { "name": "Indicator Margin(Separator)", "color": "base02" },
+
+ { "name": "Tooltip Pager Top", "color": "base2" },
+ { "name": "Tooltip Pager Triangle", "color": "base00" },
+ { "name": "Tooltip Pager Text", "color": "base00" },
+
+ { "name": "Notification Border", "color": "base1" },
+
+ { "name": "Completion Window", "color": "base03", "bordercolor": "base1" },
+ { "name": "Completion Tooltip Window", "color": "#feffe9", "bordercolor": "base1" },
+ { "name": "Completion Selection Bar Border", "color": "base02" },
+ { "name": "Completion Selection Bar Border(Inactive)", "color": "base3" },
+ { "name": "Completion Selection Bar Background", "color": "base02", "secondcolor": "base02" },
+ { "name": "Completion Selection Bar Background(Inactive)", "color": "base3", "secondcolor": "base3" },
+
+ { "name": "Bookmarks", "color": "base3", "secondcolor": "blue" },
+
+ { "name": "Underline(Error)", "color": "red" },
+ { "name": "Underline(Warning)", "color": "orange" },
+ { "name": "Underline(Suggestion)", "color": "blue" },
+ { "name": "Underline(Hint)", "color": "green" },
+
+ { "name": "Quick Diff(Dirty)", "color": "yellow" },
+ { "name": "Quick Diff(Changed)", "color": "green" },
+
+ { "name": "Brace Matching(Rectangle)", "color": "#0e5465", "secondcolor": "#0e5465" },
+ { "name": "Usages(Rectangle)", "color": "#527F99", "secondcolor": "#527F99", "bordercolor": "#527F99" },
+ { "name": "Changing usages(Rectangle)", "color": "#996E75", "secondcolor": "#996E75", "bordercolor": "#996E75" },
+
+ { "name": "Breakpoint Marker", "color": "#6f3535", "bordercolor": "#6f3535" },
+ { "name": "Breakpoint Marker(Disabled)", "color": "#4d4d4d", "bordercolor": "#4d4d4d" },
+ { "name": "Breakpoint Marker(Invalid)", "color": "#604343", "bordercolor": "#604343" },
+
+ { "name": "Current Line Marker", "color": "#183842", "secondcolor": "#183842" },
+ { "name": "Current Line Marker(Inactive)", "color": "#183842", "secondcolor": "#183842" },
+
+ { "name": "Debugger Current Line Marker", "color": "#69684c", "bordercolor": "#69684c" },
+ { "name": "Debugger Stack Line Marker", "color": "#54653f", "bordercolor": "#54653f" },
+
+ { "name": "Message Bubble Error Marker", "color": "#b28d37" },
+ { "name": "Message Bubble Error Tag", "color": "#e3a6a1", "secondcolor": "black" },
+ { "name": "Message Bubble Error Counter", "color": "black", "secondcolor": "#e3a6a1" },
+ { "name": "Message Bubble Error IconMargin", "color": "#735c54", "bordercolor": "#805b4d" },
+ { "name": "Message Bubble Error Line", "color": "#7b645c" },
+ { "name": "Message Bubble Error Tooltip", "color": "#e3a6a1" },
+
+ { "name": "Message Bubble Warning Tag", "color": "#efe89d", "secondcolor": "black" },
+ { "name": "Message Bubble Warning Counter", "color": "black", "secondcolor": "#efe89d" },
+ { "name": "Message Bubble Warning IconMargin", "color": "#777553", "bordercolor": "#948e51" },
+ { "name": "Message Bubble Warning Line", "color": "#807e5c" },
+ { "name": "Message Bubble Warning Tooltip", "color": "#efe89d" },
+
+ { "name": "Link Color", "color": "#41e2cb" },
+ { "name": "Link Color(Active)", "color": "#41e2cb" }
+ ],
+
+ "text": [
+ { "name": "Plain Text", "fore": "base00", "back": "base03" },
+ { "name": "Selected Text", "back": "base02" },
+ { "name": "Selected Text(Inactive)", "back": "base3" },
+
+ { "name": "Collapsed Text", "fore": "base01", "back": "base03" },
+
+ { "name": "Line Numbers", "fore": "base00", "back": "base02" },
+
+ { "name": "Punctuation", "fore": "base00" },
+ { "name": "Punctuation(Brackets)", "fore": "base00" },
+
+ { "name": "Comment(Line)", "fore": "base01" },
+ { "name": "Comment(Block)", "fore": "base01" },
+ { "name": "Comment(Doc)", "fore": "base01" },
+ { "name": "Comment(DocTag)", "fore": "base01" },
+
+ { "name": "Excluded Code", "fore": "base01" },
+
+ { "name": "String", "fore": "cyan" },
+ { "name": "String(Escape)", "fore": "lightcyan" },
+ { "name": "String(C# @ Verbatim)", "fore": "cyan" },
+ { "name": "String(Regex Set Constructs)", "fore": "yellow" },
+ { "name": "String(Regex Character Class)", "fore": "orange" },
+ { "name": "String(Regex Grouping Constructs)", "fore": "magenta" },
+ { "name": "String(Regex Escape Character)", "fore": "cyan" },
+ { "name": "String(Regex Alt Escape Character)", "fore": "green" },
+
+ { "name": "Number", "fore": "violet" },
+
+ { "name": "Preprocessor", "fore": "orange" },
+ { "name": "Preprocessor(Region Name)", "fore": "orange" },
+
+ { "name": "Xml Text", "fore": "base00" },
+ { "name": "Xml Delimiter", "fore": "base00" },
+ { "name": "Xml Name", "fore": "blue" },
+ { "name": "Xml Attribute", "fore": "base00" },
+ { "name": "Xml Attribute Quotes", "fore": "cyan" },
+ { "name": "Xml Attribute Value", "fore": "cyan" },
+ { "name": "Xml Comment", "fore": "base01" },
+ { "name": "Xml CData Section", "fore": "cyan" },
+
+ { "name": "Html Attribute Name", "fore": "base00" },
+ { "name": "Html Attribute Value", "fore": "cyan" },
+ { "name": "Html Comment", "fore": "base01" },
+ { "name": "Html Element Name", "fore": "blue" },
+ { "name": "Html Entity", "fore": "orange" },
+ { "name": "Html Operator", "fore": "base00" },
+ { "name": "Html Server-Side Script", "fore": "magenta", "back": "base02" },
+ { "name": "Html Tag Delimiter", "fore": "base00" },
+ { "name": "Razor Code", "fore": "black", "back": "base02" },
+
+ { "name": "Tooltip Text", "fore": "black", "back": "#feffe9" },
+ { "name": "Notification Text", "fore": "black", "back": "#feffe9" },
+
+ { "name": "Completion Text", "fore": "base00" },
+ { "name": "Completion Matching Substring", "fore": "green" },
+
+ { "name": "Completion Selected Text", "fore": "base00" },
+ { "name": "Completion Selected Matching Substring", "fore": "green" },
+
+ { "name": "Completion Selected Text(Inactive)", "fore": "base00" },
+ { "name": "Completion Selected Matching Substring(Inactive)", "fore": "green" },
+
+ { "name": "Keyword(Access)", "fore": "violet" },
+ { "name": "Keyword(Type)", "fore": "green" },
+ { "name": "Keyword(Operator)", "fore": "green" },
+ { "name": "Keyword(Selection)", "fore": "green" },
+ { "name": "Keyword(Iteration)", "fore": "green" },
+ { "name": "Keyword(Jump)", "fore": "green" },
+ { "name": "Keyword(Context)", "fore": "green" },
+ { "name": "Keyword(Exception)", "fore": "green" },
+ { "name": "Keyword(Modifiers)", "fore": "green" },
+ { "name": "Keyword(Constants)", "fore": "green" },
+ { "name": "Keyword(Void)", "fore": "yellow" },
+ { "name": "Keyword(Namespace)", "fore": "green" },
+ { "name": "Keyword(Property)", "fore": "green" },
+ { "name": "Keyword(Declaration)", "fore": "green" },
+ { "name": "Keyword(Parameter)", "fore": "green" },
+ { "name": "Keyword(Operator Declaration)", "fore": "green" },
+ { "name": "Keyword(Other)", "fore": "green" },
+
+ { "name": "User Types", "fore": "yellow" },
+ { "name": "User Types(Enums)", "fore": "yellow" },
+ { "name": "User Types(Interfaces)", "fore": "yellow" },
+ { "name": "User Types(Delegates)", "fore": "yellow" },
+ { "name": "User Types(Value types)", "fore": "yellow" },
+ { "name": "User Types(Type parameters)", "fore": "yellow" },
+ { "name": "User Types(Mutable)", "fore": "#ffd21c" },
+
+ { "name": "User Field Usage", "fore": "blue" },
+ { "name": "User Field Declaration", "fore": "blue" },
+
+ { "name": "User Property Usage", "fore": "blue" },
+ { "name": "User Property Declaration", "fore": "blue" },
+
+ { "name": "User Event Usage", "fore": "blue" },
+ { "name": "User Event Declaration", "fore": "blue" },
+
+ { "name": "User Method Usage", "fore": "blue" },
+ { "name": "User Method Declaration", "fore": "blue" },
+
+ { "name": "User Parameter Usage", "fore": "base00" },
+ { "name": "User Parameter Declaration", "fore": "base00" },
+
+ { "name": "User Variable Usage", "fore": "base00" },
+ { "name": "User Variable Declaration", "fore": "base00" },
+
+ { "name": "Syntax Error", "fore": "invalid-red" },
+
+ { "name": "String Format Items", "fore": "base00" },
+
+ { "name": "Breakpoint Text", "fore": "white", "back": "#6f3535" },
+
+ { "name": "Debugger Current Statement", "fore": "white", "back": "#69684c" },
+ { "name": "Debugger Stack Line", "fore": "white", "back": "#5c6b4d" },
+
+ { "name": "Diff Line(Added)", "fore": "Blue" },
+ { "name": "Diff Line(Removed)", "fore": "Red" },
+ { "name": "Diff Line(Changed)", "fore": "Green" },
+ { "name": "Diff Header", "fore": "Magenta", "weight": "bold" },
+ { "name": "Diff Header(Separator)", "fore": "Magenta", "weight": "bold" },
+ { "name": "Diff Header(Old)", "fore": "Red", "weight": "bold" },
+ { "name": "Diff Header(New)", "fore": "Blue", "weight": "bold" },
+ { "name": "Diff Location", "fore": "Magenta", "weight": "bold" },
+
+ { "name": "Css Comment", "fore": "base01", "weight": "bold" },
+ { "name": "Css Property Name", "fore": "black", "weight": "bold" },
+ { "name": "Css Property Value", "fore": "cyan", "weight": "bold" },
+ { "name": "Css Selector", "fore": "base01", "weight": "bold" },
+ { "name": "Css String Value", "fore": "cyan", "weight": "bold" },
+ { "name": "Css Keyword", "fore": "keyword-teal", "weight": "bold" },
+
+ { "name": "Script Comment", "fore": "base01" },
+ { "name": "Script Keyword", "fore": "green" },
+ { "name": "Script Number", "fore": "violet" },
+ { "name": "Script String", "fore": "cyan" }
+ ]
+}
diff --git a/main/src/core/Mono.Texteditor/Styles/SolarizedLightStyle.json b/main/src/core/Mono.Texteditor/Styles/SolarizedLightStyle.json
index 5ce265c4f1..caf2cfd257 100644
--- a/main/src/core/Mono.Texteditor/Styles/SolarizedLightStyle.json
+++ b/main/src/core/Mono.Texteditor/Styles/SolarizedLightStyle.json
@@ -1,228 +1,212 @@
{
- "name":"Solarized Light",
- "version":"1.1",
- "description":"An artful, light scheme that's easy on the eyes.",
- "originator":"Xamarin Inc. (http://xamarin.com)",
-
- "palette":[
- { "name":"base03", "value":"#002b36" },
- { "name":"base02", "value":"#073642" },
- { "name":"base01", "value":"#586e75" },
- { "name":"base00", "value":"#657b83" },
- { "name":"base0", "value":"#839496" },
- { "name":"base1", "value":"#93a1a1" },
- { "name":"base2", "value":"#eee8d5" },
- { "name":"base3", "value":"#fdf6e3" },
- { "name":"yellow", "value":"#b58900" },
- { "name":"orange", "value":"#cb4b16" },
- { "name":"red", "value":"#dc322f" },
- { "name":"magenta", "value":"#d33682" },
- { "name":"violet", "value":"#6c71c4" },
- { "name":"blue", "value":"#268bd2" },
- { "name":"cyan", "value":"#2aa198" },
- { "name":"green", "value":"#859900" },
- { "name":"invalid-red", "value":"#ff0000"}
- ],
-
- "colors":[
- { "name":"Background(Read Only)", "color":"base02" },
-
- { "name":"Search Result Background", "color":"base3" },
- { "name":"Search Result Background (highlighted)", "color":"base3" },
-
- { "name":"Column Ruler", "color":"base1" },
-
- { "name":"Fold Square", "color":"base01", "secondcolor":"base3" },
- { "name":"Fold Cross", "color":"base01", "secondcolor":"base3" },
-
- { "name":"Indentation Guide", "color":"#354243" },
-
- { "name":"Indicator Margin", "color":"base2" },
- { "name":"Indicator Margin(Separator)", "color":"base3" },
-
- { "name":"Tooltip Border", "color":"base1" },
- { "name":"Tooltip Pager Top", "color":"base2" },
- { "name":"Tooltip Pager Bottom", "color":"base2" },
- { "name":"Tooltip Pager Triangle", "color":"base00" },
- { "name":"Tooltip Pager Text", "color":"base00" },
-
- { "name":"Notification Border", "color":"base1" },
-
- { "name":"Completion Matching Substring", "color":"#BA3373" },
- { "name":"Completion Border", "color":"#C9C9C9" },
- { "name":"Completion Border(Inactive)", "color":"#bebebe" },
-
- { "name":"Bookmarks", "color":"base3", "secondcolor":"blue" },
-
- { "name":"Underline(Error)", "color":"red" },
- { "name":"Underline(Warning)", "color":"orange" },
- { "name":"Underline(Suggestion)", "color":"blue" },
- { "name":"Underline(Hint)", "color":"green" },
-
- { "name":"Quick Diff(Dirty)", "color":"yellow" },
- { "name":"Quick Diff(Changed)", "color":"green" },
-
- { "name":"Brace Matching(Rectangle)", "color":"base1", "secondcolor":"base3" },
- { "name":"Usages(Rectangle)", "color":"base3", "secondcolor":"base3", "bordercolor":"base3" },
- { "name":"Changing usages(Rectangle)", "color":"base3", "secondcolor":"base3", "bordercolor":"base3" },
-
- { "name":"Breakpoint Marker", "color":"#f9dbda", "bordercolor":"#ebcccb" },
- { "name":"Breakpoint Marker(Disabled)", "color":"#e9e9e9", "bordercolor":"#dbdbdb" },
- { "name":"Breakpoint Marker(Invalid)", "color":"#f1e3e3", "bordercolor":"#e3d5d5" },
-
- { "name":"Current Line Marker", "color":"base3"},
- { "name":"Current Line Marker(Inactive)", "color":"base3"},
-
- { "name":"Debugger Current Line Marker", "color":"#f8f4a1", "bordercolor":"#ede993" },
- { "name":"Debugger Stack Line Marker", "color":"#ccfca6", "bordercolor":"#bff197" },
-
- { "name":"Primary Link", "color":"chameleon3", "secondcolor":"chameleon2"},
- { "name":"Primary Link(Highlighted)", "color":"chameleon3", "secondcolor":"chameleon1"},
- { "name":"Secondary Link", "color":"aluminium2", "secondcolor":"white"},
- { "name":"Secondary Link(Highlighted)", "color":"aluminium3", "secondcolor":"aluminium1"},
-
- { "name":"Message Bubble Error Marker", "color":"#b28d37"},
- { "name":"Message Bubble Error Tag", "color":"#e3a6a1", "secondcolor":"black"},
- { "name":"Message Bubble Error Counter", "color":"black", "secondcolor":"#e3a6a1"},
- { "name":"Message Bubble Error IconMargin", "color":"#735c54", "bordercolor":"#805b4d"},
- { "name":"Message Bubble Error Line", "color":"#7b645c"},
- { "name":"Message Bubble Error Tooltip", "color":"#e3a6a1"},
-
- { "name":"Message Bubble Warning Marker", "color":"#b28d37"},
- { "name":"Message Bubble Warning Tag", "color":"#efe89d", "secondcolor":"black"},
- { "name":"Message Bubble Warning Counter", "color":"black", "secondcolor":"#efe89d"},
- { "name":"Message Bubble Warning IconMargin", "color":"#777553", "bordercolor":"#948e51"},
- { "name":"Message Bubble Warning Line", "color":"#807e5c"},
- { "name":"Message Bubble Warning Tooltip", "color":"#efe89d"}
- ],
-
- "text":[
- { "name":"Plain Text", "fore":"base00", "back":"base3" },
- { "name":"Selected Text", "back":"base02" },
- { "name":"Selected Text(Inactive)", "back":"base3" },
-
- { "name":"Collapsed Text", "fore":"base01", "back":"base3" },
-
- { "name":"Line Numbers", "fore":"base00", "back":"base2"},
-
- { "name":"Punctuation", "fore":"base00" },
- { "name":"Punctuation(Brackets)", "fore":"base00" },
-
- { "name":"Comment(Line)", "fore":"base01" },
- { "name":"Comment(Block)", "fore":"base01" },
- { "name":"Comment(Doc)", "fore":"base01" },
- { "name":"Comment(DocTag)", "fore":"base01" },
- { "name":"Comment Tag", "fore":"base01", "style":"italic" },
- { "name":"Excluded Code", "fore":"base01" },
-
- { "name":"String", "fore":"cyan"},
- { "name":"String(Escape)", "fore":"lightcyan"},
- { "name":"String(C# @ Verbatim)", "fore":"cyan"},
-
- { "name":"Number", "fore":"violet"},
-
- { "name":"Preprocessor", "fore":"orange" },
- { "name":"Preprocessor(Region Name)", "fore":"orange" },
-
- { "name":"Xml Text", "fore":"base00" },
- { "name":"Xml Delimiter", "fore":"base00" },
- { "name":"Xml Name", "fore":"blue" },
- { "name":"Xml Attribute", "fore":"base00" },
- { "name":"Xml Attribute Quotes", "fore":"cyan" },
- { "name":"Xml Attribute Value", "fore":"cyan" },
- { "name":"Xml Comment", "fore":"base01" },
- { "name":"Xml CData Section", "fore":"cyan" },
-
- { "name":"Html Attribute Name", "fore":"base00" },
- { "name":"Html Attribute Value", "fore":"cyan" },
- { "name":"Html Comment", "fore":"base01" },
- { "name":"Html Element Name", "fore":"blue" },
- { "name":"Html Entity", "fore":"orange" },
- { "name":"Html Operator", "fore":"base00" },
- { "name":"Html Server-Side Script", "fore":"magenta", "back":"base2" },
- { "name":"Html Tag Delimiter", "fore":"base00" },
- { "name":"Razor Code", "fore":"black", "back":"base2" },
-
- { "name":"Tooltip Text", "fore":"black", "back":"#feffe9" },
- { "name":"Notification Text", "fore":"black", "back":"#feffe9" },
-
- { "name":"Completion Text", "fore":"#434343", "back":"#F0F6F8" },
- { "name":"Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
- { "name":"Completion Selected Text(Inactive)", "fore":"#434343", "back":"white" },
-
- { "name":"Keyword(Access)", "fore":"violet" },
- { "name":"Keyword(Type)", "fore":"green" },
- { "name":"Keyword(Operator)", "fore":"green" },
- { "name":"Keyword(Selection)", "fore":"green" },
- { "name":"Keyword(Iteration)", "fore":"green" },
- { "name":"Keyword(Jump)", "fore":"green" },
- { "name":"Keyword(Context)", "fore":"green" },
- { "name":"Keyword(Exception)", "fore":"green" },
- { "name":"Keyword(Modifiers)", "fore":"green" },
- { "name":"Keyword(Constants)", "fore":"green" },
- { "name":"Keyword(Void)", "fore":"yellow" },
- { "name":"Keyword(Namespace)", "fore":"green" },
- { "name":"Keyword(Property)", "fore":"green" },
- { "name":"Keyword(Declaration)", "fore":"green" },
- { "name":"Keyword(Parameter)", "fore":"green" },
- { "name":"Keyword(Operator Declaration)", "fore":"green" },
- { "name":"Keyword(Other)", "fore":"green" },
-
- { "name":"User Types", "fore":"yellow" },
- { "name":"User Types(Enums)", "fore":"yellow" },
- { "name":"User Types(Interfaces)", "fore":"yellow" },
- { "name":"User Types(Delegates)", "fore":"yellow" },
- { "name":"User Types(Value types)", "fore":"yellow" },
- { "name":"User Types(Type parameters)", "fore":"yellow" },
-
- { "name":"User Field Usage", "fore":"blue" },
- { "name":"User Field Declaration", "fore":"blue" },
-
- { "name":"User Property Usage", "fore":"blue" },
- { "name":"User Property Declaration", "fore":"blue" },
-
- { "name":"User Event Usage", "fore":"blue" },
- { "name":"User Event Declaration", "fore":"blue" },
-
- { "name":"User Method Usage", "fore":"blue" },
- { "name":"User Method Declaration", "fore":"blue" },
-
- { "name":"User Parameter Usage", "fore":"base00" },
- { "name":"User Parameter Declaration", "fore":"base00" },
-
- { "name":"User Variable Usage", "fore":"base00" },
- { "name":"User Variable Declaration", "fore":"base00" },
-
- { "name":"Syntax Error", "fore":"invalid-red" },
-
- { "name":"String Format Items", "fore":"base00" },
-
- { "name":"Breakpoint Text", "fore":"text-black", "back":"#ffe8e7" },
-
- { "name":"Debugger Current Statement", "fore":"text-black", "back":"#f8f4a1" },
- { "name":"Debugger Stack Line", "fore":"text-black", "back":"#ccfca6" },
-
- { "name":"Diff Line(Added)", "fore":"Blue" },
- { "name":"Diff Line(Removed)", "fore":"Red" },
- { "name":"Diff Line(Changed)", "fore":"Green" },
- { "name":"Diff Header", "fore":"Magenta" },
- { "name":"Diff Header(Separator)", "fore":"Magenta", "weight":"bold" },
- { "name":"Diff Header(Old)", "fore":"Red", "weight":"bold" },
- { "name":"Diff Header(New)", "fore":"Blue", "weight":"bold" },
- { "name":"Diff Location", "fore":"Magenta", "weight":"bold" },
-
- { "name":"Css Comment", "fore":"base01", "weight":"bold" },
- { "name":"Css Property Name", "fore":"black", "weight":"bold" },
- { "name":"Css Property Value", "fore":"cyan", "weight":"bold" },
- { "name":"Css Selector", "fore":"base01", "weight":"bold" },
- { "name":"Css String Value", "fore":"cyan", "weight":"bold" },
- { "name":"Css Keyword", "fore":"keyword-teal", "weight":"bold" },
-
- { "name":"Script Comment", "fore":"base01" },
- { "name":"Script Identifier" },
- { "name":"Script Keyword", "fore":"green" },
- { "name":"Script Number", "fore":"violet" },
- { "name":"Script Operator" },
- { "name":"Script String", "fore":"cyan" }
- ]
-} \ No newline at end of file
+ "name": "Solarized Light",
+ "version": "1.2.1",
+ "description": "An artful, light scheme that's easy on the eyes",
+ "originator": "Xamarin Inc. (http://xamarin.com)",
+
+ "palette": [
+ { "name": "base03", "value": "#002b36" },
+ { "name": "base02", "value": "#073642" },
+ { "name": "base01", "value": "#586e75" },
+ { "name": "base00", "value": "#657b83" },
+ { "name": "base0", "value": "#839496" },
+ { "name": "base1", "value": "#93a1a1" },
+ { "name": "base2", "value": "#eee8d5" },
+ { "name": "base3", "value": "#fdf6e3" },
+ { "name": "yellow", "value": "#b58900" },
+ { "name": "orange", "value": "#cb4b16" },
+ { "name": "red", "value": "#dc322f" },
+ { "name": "magenta", "value": "#d33682" },
+ { "name": "violet", "value": "#6c71c4" },
+ { "name": "blue", "value": "#268bd2" },
+ { "name": "cyan", "value": "#2aa198" },
+ { "name": "green", "value": "#859900" },
+ { "name": "invalid-red", "value": "#ff0000" }
+ ],
+
+ "colors": [
+ { "name": "Background(Read Only)", "color": "base02" },
+
+ { "name": "Search result background", "color": "base3" },
+ { "name": "Search result background (highlighted)", "color": "base3" },
+
+ { "name": "Column Ruler", "color": "#eae4d3" },
+
+ { "name": "Fold Square", "color": "#dcd8c6", "secondcolor": "base3" },
+ { "name": "Fold Cross", "color": "#a3afb3", "secondcolor": "base3" },
+
+ { "name": "Indentation Guide", "color": "#e2dccc" },
+
+ { "name": "Indicator Margin", "color": "base2" },
+ { "name": "Indicator Margin(Separator)", "color": "base3" },
+
+ { "name": "Tooltip Pager Top", "color": "base2" },
+ { "name": "Tooltip Pager Triangle", "color": "base00" },
+ { "name": "Tooltip Pager Text", "color": "base00" },
+
+ { "name": "Notification Border", "color": "base1" },
+
+ { "name": "Completion Window", "color": "base3", "bordercolor": "base1" },
+ { "name": "Completion Tooltip Window", "color": "#feffe9", "bordercolor": "base1" },
+ { "name": "Completion Selection Bar Border", "color": "base03" },
+ { "name": "Completion Selection Bar Border(Inactive)", "color": "base2" },
+ { "name": "Completion Selection Bar Background", "color": "base03", "secondcolor": "base03" },
+ { "name": "Completion Selection Bar Background(Inactive)", "color": "base2", "secondcolor": "base2" },
+
+ { "name": "Bookmarks", "color": "base3", "secondcolor": "blue" },
+
+ { "name": "Underline(Error)", "color": "red" },
+ { "name": "Underline(Warning)", "color": "orange" },
+ { "name": "Underline(Suggestion)", "color": "blue" },
+ { "name": "Underline(Hint)", "color": "green" },
+
+ { "name": "Quick Diff(Dirty)", "color": "yellow" },
+ { "name": "Quick Diff(Changed)", "color": "green" },
+
+ { "name": "Current Line Marker", "color": "#f5eedd", "secondcolor": "#f5eedd" },
+ { "name": "Current Line Marker(Inactive)", "color": "#f5eedd", "secondcolor": "#f5eedd" },
+
+ { "name": "Debugger Stack Line Marker", "color": "#c9e1a9", "bordercolor": "#c9e1a9" },
+
+ { "name": "Message Bubble Error Marker", "color": "#b28d37" },
+ { "name": "Message Bubble Error Tag", "color": "#e3a6a1", "secondcolor": "black" },
+ { "name": "Message Bubble Error Counter", "color": "black", "secondcolor": "#e3a6a1" },
+ { "name": "Message Bubble Error Line", "color": "#7b645c" },
+ { "name": "Message Bubble Error Tooltip", "color": "#e3a6a1" },
+
+ { "name": "Message Bubble Warning Tag", "color": "#efe89d", "secondcolor": "black" },
+ { "name": "Message Bubble Warning Counter", "color": "black", "secondcolor": "#efe89d" },
+ { "name": "Message Bubble Warning Line", "color": "#807e5c" },
+ { "name": "Message Bubble Warning Tooltip", "color": "#efe89d" }
+ ],
+
+ "text": [
+ { "name": "Plain Text", "fore": "base00", "back": "base3" },
+ { "name": "Selected Text", "back": "base03" },
+ { "name": "Selected Text(Inactive)", "back": "base2" },
+
+ { "name": "Collapsed Text", "fore": "base01", "back": "base3" },
+
+ { "name": "Line Numbers", "fore": "base00", "back": "base2" },
+
+ { "name": "Punctuation", "fore": "base00" },
+ { "name": "Punctuation(Brackets)", "fore": "base00" },
+
+ { "name": "Comment(Line)", "fore": "base01" },
+ { "name": "Comment(Block)", "fore": "base01" },
+ { "name": "Comment(Doc)", "fore": "base01" },
+ { "name": "Comment(DocTag)", "fore": "base01" },
+
+ { "name": "Excluded Code", "fore": "base01" },
+
+ { "name": "String", "fore": "cyan" },
+ { "name": "String(Escape)", "fore": "lightcyan" },
+ { "name": "String(C# @ Verbatim)", "fore": "cyan" },
+ { "name": "String(Regex Set Constructs)", "fore": "yellow" },
+ { "name": "String(Regex Character Class)", "fore": "orange" },
+ { "name": "String(Regex Grouping Constructs)", "fore": "magenta" },
+ { "name": "String(Regex Escape Character)", "fore": "cyan" },
+ { "name": "String(Regex Alt Escape Character)", "fore": "green" },
+
+ { "name": "Number", "fore": "violet" },
+
+ { "name": "Preprocessor", "fore": "orange" },
+ { "name": "Preprocessor(Region Name)", "fore": "orange" },
+
+ { "name": "Xml Text", "fore": "base00" },
+ { "name": "Xml Delimiter", "fore": "base00" },
+ { "name": "Xml Name", "fore": "blue" },
+ { "name": "Xml Attribute", "fore": "base00" },
+ { "name": "Xml Attribute Quotes", "fore": "cyan" },
+ { "name": "Xml Attribute Value", "fore": "cyan" },
+ { "name": "Xml Comment", "fore": "base01" },
+ { "name": "Xml CData Section", "fore": "cyan" },
+
+ { "name": "Html Attribute Name", "fore": "base00" },
+ { "name": "Html Attribute Value", "fore": "cyan" },
+ { "name": "Html Comment", "fore": "base01" },
+ { "name": "Html Element Name", "fore": "blue" },
+ { "name": "Html Entity", "fore": "orange" },
+ { "name": "Html Operator", "fore": "base00" },
+ { "name": "Html Server-Side Script", "fore": "magenta", "back": "base2" },
+ { "name": "Html Tag Delimiter", "fore": "base00" },
+ { "name": "Razor Code", "fore": "black", "back": "base2" },
+
+ { "name": "Tooltip Text", "fore": "#222", "back": "#fff" },
+ { "name": "Notification Text", "fore": "black", "back": "#feffe9" },
+
+ { "name": "Completion Text", "fore": "base00" },
+ { "name": "Completion Matching Substring", "fore": "green" },
+
+ { "name": "Completion Selected Text", "fore": "base00" },
+ { "name": "Completion Selected Matching Substring", "fore": "green" },
+
+ { "name": "Completion Selected Text(Inactive)", "fore": "base00" },
+ { "name": "Completion Selected Matching Substring(Inactive)", "fore": "green" },
+
+ { "name": "Keyword(Access)", "fore": "violet" },
+ { "name": "Keyword(Type)", "fore": "green" },
+ { "name": "Keyword(Operator)", "fore": "green" },
+ { "name": "Keyword(Selection)", "fore": "green" },
+ { "name": "Keyword(Iteration)", "fore": "green" },
+ { "name": "Keyword(Jump)", "fore": "green" },
+ { "name": "Keyword(Context)", "fore": "green" },
+ { "name": "Keyword(Exception)", "fore": "green" },
+ { "name": "Keyword(Modifiers)", "fore": "green" },
+ { "name": "Keyword(Constants)", "fore": "green" },
+ { "name": "Keyword(Void)", "fore": "yellow" },
+ { "name": "Keyword(Namespace)", "fore": "green" },
+ { "name": "Keyword(Property)", "fore": "green" },
+ { "name": "Keyword(Declaration)", "fore": "green" },
+ { "name": "Keyword(Parameter)", "fore": "green" },
+ { "name": "Keyword(Operator Declaration)", "fore": "green" },
+ { "name": "Keyword(Other)", "fore": "green" },
+
+ { "name": "User Types", "fore": "yellow" },
+ { "name": "User Types(Enums)", "fore": "yellow" },
+ { "name": "User Types(Interfaces)", "fore": "yellow" },
+ { "name": "User Types(Delegates)", "fore": "yellow" },
+ { "name": "User Types(Value types)", "fore": "yellow" },
+ { "name": "User Types(Type parameters)", "fore": "yellow" },
+
+ { "name": "User Field Usage", "fore": "blue" },
+ { "name": "User Field Declaration", "fore": "blue" },
+
+ { "name": "User Property Usage", "fore": "blue" },
+ { "name": "User Property Declaration", "fore": "blue" },
+
+ { "name": "User Event Usage", "fore": "blue" },
+ { "name": "User Event Declaration", "fore": "blue" },
+
+ { "name": "User Method Usage", "fore": "blue" },
+ { "name": "User Method Declaration", "fore": "blue" },
+
+ { "name": "User Parameter Usage", "fore": "base00" },
+ { "name": "User Parameter Declaration", "fore": "base00" },
+
+ { "name": "User Variable Usage", "fore": "base00" },
+ { "name": "User Variable Declaration", "fore": "base00" },
+
+ { "name": "String Format Items", "fore": "base00" },
+
+ { "name": "Diff Line(Added)", "fore": "Blue" },
+ { "name": "Diff Line(Removed)", "fore": "Red" },
+ { "name": "Diff Line(Changed)", "fore": "Green" },
+ { "name": "Diff Header", "fore": "Magenta", "weight": "bold" },
+ { "name": "Diff Header(Separator)", "fore": "Magenta", "weight": "bold" },
+ { "name": "Diff Header(Old)", "fore": "Red", "weight": "bold" },
+ { "name": "Diff Header(New)", "fore": "Blue", "weight": "bold" },
+ { "name": "Diff Location", "fore": "Magenta", "weight": "bold" },
+
+ { "name": "Css Comment", "fore": "base01", "weight": "bold" },
+ { "name": "Css Property Name", "fore": "black", "weight": "bold" },
+ { "name": "Css Property Value", "fore": "cyan", "weight": "bold" },
+ { "name": "Css Selector", "fore": "base01", "weight": "bold" },
+ { "name": "Css String Value", "fore": "cyan", "weight": "bold" },
+
+ { "name": "Script Comment", "fore": "base01" },
+ { "name": "Script Keyword", "fore": "green" },
+ { "name": "Script Number", "fore": "violet" },
+ { "name": "Script String", "fore": "cyan" }
+ ]
+}
diff --git a/main/src/core/Mono.Texteditor/Styles/TangoStyle.json b/main/src/core/Mono.Texteditor/Styles/TangoStyle.json
index 29fe565465..c6a14b6732 100644
--- a/main/src/core/Mono.Texteditor/Styles/TangoStyle.json
+++ b/main/src/core/Mono.Texteditor/Styles/TangoStyle.json
@@ -1,239 +1,129 @@
{
- "name":"Tango",
- "version":"1.1",
- "description":"A light scheme using colors from the Tango Project.",
- "originator":"Xamarin Inc. (http://xamarin.com)",
-
- "palette":[
- { "name":"butter1", "value":"#fce94f" },
- { "name":"butter2", "value":"#edd400" },
- { "name":"butter3", "value":"#c4a000" },
- { "name":"orange1", "value":"#fcaf3e" },
- { "name":"orange2", "value":"#f57900" },
- { "name":"orange3", "value":"#ce5c00" },
- { "name":"chocolate1", "value":"#e9b96e" },
- { "name":"chocolate2", "value":"#c17d11" },
- { "name":"chocolate3", "value":"#8f5902" },
- { "name":"chameleon1", "value":"#8ae234" },
- { "name":"chameleon2", "value":"#73d216" },
- { "name":"chameleon3", "value":"#4e9a06" },
- { "name":"skyblue0", "value":"#92BfFf" },
- { "name":"skyblue1", "value":"#729fcf" },
- { "name":"skyblue2", "value":"#3465a4" },
- { "name":"skyblue3", "value":"#204a87" },
- { "name":"plum1", "value":"#ad7fa8" },
- { "name":"plum2", "value":"#75507b" },
- { "name":"plum3", "value":"#5c3566" },
- { "name":"scarletred1", "value":"#ef2929" },
- { "name":"scarletred2", "value":"#cc0000" },
- { "name":"scarletred3", "value":"#a40000" },
- { "name":"aluminium1", "value":"#eeeeec" },
- { "name":"aluminium2", "value":"#d3d7cf" },
- { "name":"aluminium3", "value":"#babdb6" },
- { "name":"aluminium4", "value":"#888a85" },
- { "name":"aluminium5", "value":"#555753" },
- { "name":"aluminium6", "value":"#2e3436" }
- ],
-
- "colors":[
- { "name":"Background(Read Only)", "color":"white" },
-
- { "name":"Search result background", "color":"#F6B94D" },
- { "name":"Search result background (highlighted)", "color":"#E5992F" },
-
- { "name":"Column Ruler", "color":"aluminium3" },
-
- { "name":"Fold Square", "color":"aluminium4", "secondcolor":"white" },
- { "name":"Fold Cross", "color":"aluminium4", "secondcolor":"white" },
-
- { "name":"Indentation Guide", "color":"aluminium2" },
-
- { "name":"Indicator Margin", "color":"aluminium1" },
- { "name":"Indicator Margin(Separator)", "color":"aluminium3" },
-
- { "name":"Tooltip Border", "color":"#b2b2b2" },
- { "name":"Tooltip Pager Top", "color":"#ffffff" },
- { "name":"Tooltip Pager Bottom", "color":"#f5f5f5" },
- { "name":"Tooltip Pager Triangle", "color":"#737373" },
- { "name":"Tooltip Pager Text", "color":"#828282" },
-
- { "name":"Notification Border", "color":"#b2b2b2" },
-
- { "name":"Completion Matching Substring", "color":"#BA3373" },
- { "name":"Completion Border", "color":"#C9C9C9" },
- { "name":"Completion Border(Inactive)", "color":"#666666" },
-
- { "name":"Bookmarks", "color":"white", "secondcolor":"skyblue" },
-
- { "name":"Underline(Error)", "color":"scarletred2" },
- { "name":"Underline(Warning)", "color":"skyblue1" },
- { "name":"Underline(Suggestion)", "color":"chameleon3" },
- { "name":"Underline(Hint)", "color":"chameleon1" },
-
- { "name":"Quick Diff(Dirty)", "color":"butter2" },
- { "name":"Quick Diff(Changed)", "color":"chameleon2" },
-
- { "name":"Brace Matching(Rectangle)", "color":"aluminium1", "secondcolor":"aluminium2" },
- { "name":"Usages(Rectangle)", "color":"#B1DFF9", "secondcolor":"#B1DFF9", "bordercolor":"#B1DFF9" },
- { "name":"Changing usages(Rectangle)", "color":"#FFD6DD", "secondcolor":"#FFD6DD", "bordercolor":"#FFD6DD" },
-
- { "name":"Breakpoint Marker", "color":"#f9dbda", "bordercolor":"#ebcccb" },
- { "name":"Breakpoint Marker(Disabled)", "color":"#e9e9e9", "bordercolor":"#dbdbdb" },
- { "name":"Breakpoint Marker(Invalid)", "color":"#f1e3e3", "bordercolor":"#e3d5d5" },
-
- { "name":"Current Line Marker", "color":"aluminium1", "secondcolor":"aluminium2" },
- { "name":"Current Line Marker(Inactive)", "color":"aluminium2", "secondcolor":"aluminium3" },
-
- { "name":"Debugger Current Line Marker", "color":"#f8f4a1", "bordercolor":"#ede993" },
- { "name":"Debugger Stack Line Marker", "color":"#ccfca6", "bordercolor":"#bff197" },
-
- { "name":"Primary Link", "color":"chameleon3", "secondcolor":"chameleon2"},
- { "name":"Primary Link(Highlighted)", "color":"chameleon3", "secondcolor":"chameleon1"},
- { "name":"Secondary Link", "color":"aluminium2", "secondcolor":"white"},
- { "name":"Secondary Link(Highlighted)", "color":"aluminium3", "secondcolor":"aluminium1"},
-
- { "name":"Message Bubble Error Marker", "color":"#df6962" },
- { "name":"Message Bubble Error Tag", "color":"#d83f3f", "secondcolor":"white" },
- { "name":"Message Bubble Error Counter", "color":"white", "secondcolor":"#d83f3f" },
- { "name":"Message Bubble Error IconMargin", "color":"#d83f3f", "bordercolor":"#b12a2a" },
- { "name":"Message Bubble Error Line", "color":"#fbe4e6" },
- { "name":"Message Bubble Error Tooltip", "color":"#D10B0B" },
-
- { "name":"Message Bubble Warning Marker", "color":"#b28d37" },
- { "name":"Message Bubble Warning Tag", "color":"#e68100", "secondcolor":"white" },
- { "name":"Message Bubble Warning Counter", "color":"white", "secondcolor":"#e68100" },
- { "name":"Message Bubble Warning IconMargin", "color":"#e68100", "bordercolor":"#c76f00" },
- { "name":"Message Bubble Warning Line", "color":"#fff1da" },
- { "name":"Message Bubble Warning Tooltip", "color":"#D1590B" }
- ],
-
- "text":[
- { "name":"Plain Text", "fore":"black", "back":"white" },
- { "name":"Selected Text", "back":"skyblue0" },
- { "name":"Selected Text(Inactive)", "back":"aluminium3" },
-
- { "name":"Collapsed Text", "fore":"aluminium4", "back":"white" },
-
- { "name":"Line Numbers", "fore":"aluminium4", "back":"white"},
-
- { "name":"Punctuation", "fore":"black" },
- { "name":"Punctuation(Brackets)", "fore":"black" },
-
- { "name":"Comment(Line)", "fore":"aluminium4" },
- { "name":"Comment(Block)", "fore":"aluminium4" },
- { "name":"Comment(Doc)", "fore":"aluminium4" },
- { "name":"Comment(DocTag)", "fore":"aluminium3" },
- { "name":"Comment Tag", "fore":"aluminium4" },
- { "name":"Excluded Code", "fore":"aluminium4" },
-
- { "name":"String", "fore":"scarletred3"},
- { "name":"String(Escape)", "fore":"scarletred3", "weight":"bold"},
- { "name":"String(C# @ Verbatim)", "fore":"scarletred3"},
-
- { "name":"Number", "fore":"scarletred3"},
-
- { "name":"Preprocessor", "fore":"butter3" },
- { "name":"Preprocessor(Region Name)", "fore":"black" },
-
- { "name":"Xml Text", "fore":"black" },
- { "name":"Xml Delimiter", "fore":"black" },
- { "name":"Xml Name", "fore":"skyblue3" },
- { "name":"Xml Attribute", "fore":"orange2" },
- { "name":"Xml Attribute Quotes", "fore":"scarletred3" },
- { "name":"Xml Attribute Value", "fore":"scarletred3" },
- { "name":"Xml Comment", "fore":"aluminium4" },
- { "name":"Xml CData Section", "fore":"scarletred3" },
-
- { "name":"Html Attribute Name", "fore":"orange2" },
- { "name":"Html Attribute Value", "fore":"scarletred3" },
- { "name":"Html Comment", "fore":"aluminium4" },
- { "name":"Html Element Name", "fore":"skyblue3" },
- { "name":"Html Entity", "fore":"#c12dad" },
- { "name":"Html Operator", "fore":"skyblue3" },
- { "name":"Html Server-Side Script", "fore":"black", "back":"#fdf0bd" },
- { "name":"Html Tag Delimiter", "fore":"skyblue2" },
- { "name":"Razor Code", "fore":"black", "back":"#fdfaed" },
-
- { "name":"Tooltip Text", "fore":"black", "back":"#feffe9" },
- { "name":"Notification Text", "fore":"black", "back":"#feffe9" },
-
- { "name":"Completion Text", "fore":"#434343", "back":"#F0F6F8" },
- { "name":"Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
- { "name":"Completion Selected Text(Inactive)", "fore":"#434343", "back":"white" },
-
- { "name":"Keyword(Access)", "fore":"skyblue2" },
- { "name":"Keyword(Type)", "fore":"skyblue2" },
- { "name":"Keyword(Operator)", "fore":"skyblue2" },
- { "name":"Keyword(Selection)", "fore":"skyblue2" },
- { "name":"Keyword(Iteration)", "fore":"skyblue2" },
- { "name":"Keyword(Jump)", "fore":"skyblue2" },
- { "name":"Keyword(Context)", "fore":"skyblue2" },
- { "name":"Keyword(Exception)", "fore":"skyblue2" },
- { "name":"Keyword(Modifiers)", "fore":"skyblue2" },
- { "name":"Keyword(Constants)", "fore":"skyblue2" },
- { "name":"Keyword(Void)", "fore":"skyblue2" },
- { "name":"Keyword(Namespace)", "fore":"skyblue2" },
- { "name":"Keyword(Property)", "fore":"skyblue2" },
- { "name":"Keyword(Declaration)", "fore":"skyblue2" },
- { "name":"Keyword(Parameter)", "fore":"skyblue2" },
- { "name":"Keyword(Operator Declaration)", "fore":"skyblue2" },
- { "name":"Keyword(Other)", "fore":"skyblue2" },
-
- { "name":"User Types", "fore":"plum2" },
- { "name":"User Types(Enums)", "fore":"plum2" },
- { "name":"User Types(Interfaces)", "fore":"plum2" },
- { "name":"User Types(Delegates)", "fore":"plum2" },
- { "name":"User Types(Value types)", "fore":"plum2" },
- { "name":"User Types(Type parameters)", "fore":"plum2" },
-
- { "name":"User Field Usage", "fore":"black", "style":"oblique" },
- { "name":"User Field Declaration", "fore":"black", "style":"oblique" },
-
- { "name":"User Property Usage", "fore":"black" },
- { "name":"User Property Declaration", "fore":"black" },
-
- { "name":"User Event Usage", "fore":"orange3", "style":"oblique" },
- { "name":"User Event Declaration", "fore":"orange3", "style":"oblique" },
-
- { "name":"User Method Usage", "fore":"black" },
- { "name":"User Method Declaration", "fore":"black" },
-
- { "name":"User Parameter Usage", "fore":"black" },
- { "name":"User Parameter Declaration", "fore":"black" },
-
- { "name":"User Variable Usage", "fore":"black" },
- { "name":"User Variable Declaration", "fore":"black" },
-
- { "name":"Syntax Error", "fore":"scarletred1" },
-
- { "name":"String Format Items", "fore":"chocolate2" },
-
- { "name":"Breakpoint Text", "fore":"text-black", "back":"#ffe8e7" },
-
- { "name":"Debugger Current Statement", "fore":"text-black", "back":"#f8f4a1" },
- { "name":"Debugger Stack Line", "fore":"text-black", "back":"#ccfca6" },
-
- { "name":"Diff Line(Added)", "fore":"skyblue2" },
- { "name":"Diff Line(Removed)", "fore":"scarletred1" },
- { "name":"Diff Line(Changed)", "fore":"plum2" },
- { "name":"Diff Header", "fore":"chameleon3" },
- { "name":"Diff Header(Separator)", "fore":"chameleon3", "weight":"bold" },
- { "name":"Diff Header(Old)", "fore":"scarletred1", "weight":"bold" },
- { "name":"Diff Header(New)", "fore":"skyblue2", "weight":"bold" },
- { "name":"Diff Location", "fore":"plum2", "weight":"bold" },
-
- { "name":"Css Comment", "fore":"chameleon3", "weight":"bold" },
- { "name":"Css Property Name", "fore":"black", "weight":"bold" },
- { "name":"Css Property Value", "fore":"literal-orange", "weight":"bold" },
- { "name":"Css Selector", "fore":"chameleon3", "weight":"bold" },
- { "name":"Css String Value", "fore":"literal-orange", "weight":"bold" },
- { "name":"Css Keyword", "fore":"keyword-teal", "weight":"bold" },
-
- { "name":"Script Comment", "fore":"chameleon3" },
- { "name":"Script Identifier" },
- { "name":"Script Keyword", "fore":"skyblue2" },
- { "name":"Script Number", "fore":"scarletred3" },
- { "name":"Script Operator" },
- { "name":"Script String", "fore":"scarletred3" }
- ]
-} \ No newline at end of file
+ "name": "Tango",
+ "version": "1.2.2",
+ "description": "A light scheme using colors from the Tango Project",
+ "originator": "Xamarin Inc. (http://xamarin.com)",
+
+ "palette": [
+ { "name": "text-black", "value": "#222222" },
+ { "name": "butter2", "value": "#edd400" },
+ { "name": "butter3", "value": "#c4a000" },
+ { "name": "orange2", "value": "#f57900" },
+ { "name": "orange3", "value": "#ce5c00" },
+ { "name": "chocolate2", "value": "#c17d11" },
+ { "name": "chameleon1", "value": "#8ae234" },
+ { "name": "chameleon2", "value": "#73d216" },
+ { "name": "chameleon3", "value": "#4e9a06" },
+ { "name": "skyblue0", "value": "#92BfFf" },
+ { "name": "skyblue1", "value": "#729fcf" },
+ { "name": "skyblue2", "value": "#3465a4" },
+ { "name": "skyblue3", "value": "#204a87" },
+ { "name": "plum2", "value": "#75507b" },
+ { "name": "scarletred1", "value": "#ef2929" },
+ { "name": "scarletred2", "value": "#cc0000" },
+ { "name": "scarletred3", "value": "#a40000" },
+ { "name": "aluminium1", "value": "#eeeeec" },
+ { "name": "aluminium2", "value": "#d3d7cf" },
+ { "name": "aluminium3", "value": "#babdb6" },
+ { "name": "aluminium4", "value": "#888a85" }
+ ],
+
+ "colors": [
+ { "name": "Search result background", "color": "#F6B94D" },
+ { "name": "Search result background (highlighted)", "color": "#E5992F" },
+
+ { "name": "Notification Border", "color": "#b2b2b2" },
+
+ { "name": "Underline(Error)", "color": "scarletred2" },
+ { "name": "Underline(Warning)", "color": "skyblue1" },
+ { "name": "Underline(Suggestion)", "color": "chameleon3" },
+ { "name": "Underline(Hint)", "color": "chameleon1" },
+
+ { "name": "Quick Diff(Dirty)", "color": "butter2" },
+ { "name": "Quick Diff(Changed)", "color": "chameleon2" },
+
+ { "name": "Message Bubble Warning Tooltip", "color": "#D1590B" }
+ ],
+
+ "text": [
+ { "name": "Selected Text", "back": "skyblue0" },
+ { "name": "Selected Text(Inactive)", "back": "aluminium3" },
+
+ { "name": "Collapsed Text", "fore": "aluminium4", "back": "white" },
+
+ { "name": "Comment(Line)", "fore": "aluminium4" },
+ { "name": "Comment(Block)", "fore": "aluminium4" },
+ { "name": "Comment(Doc)", "fore": "aluminium4" },
+ { "name": "Comment(DocTag)", "fore": "aluminium4" },
+ { "name": "Comment Tag", "fore": "#ff00ff" },
+
+ { "name": "Excluded Code", "fore": "aluminium4" },
+
+ { "name": "String", "fore": "scarletred3" },
+ { "name": "String(Escape)", "fore": "scarletred3" },
+ { "name": "String(C# @ Verbatim)", "fore": "scarletred3" },
+ { "name": "String(Regex Set Constructs)", "fore": "orange3" },
+ { "name": "String(Regex Character Class)", "fore": "skyblue3" },
+ { "name": "String(Regex Grouping Constructs)", "fore": "butter3" },
+ { "name": "String(Regex Escape Character)", "fore": "chameleon3" },
+ { "name": "String(Regex Alt Escape Character)", "fore": "chameleon2" },
+
+ { "name": "Number", "fore": "chameleon3" },
+
+ { "name": "Preprocessor", "fore": "butter3" },
+ { "name": "Preprocessor(Region Name)", "fore": "text-black" },
+
+ { "name": "Xml Name", "fore": "skyblue3" },
+ { "name": "Xml Attribute", "fore": "orange2" },
+ { "name": "Xml Attribute Quotes", "fore": "scarletred3" },
+ { "name": "Xml Attribute Value", "fore": "scarletred3" },
+ { "name": "Xml Comment", "fore": "aluminium4" },
+ { "name": "Xml CData Section", "fore": "scarletred3" },
+
+ { "name": "Html Attribute Name", "fore": "orange2" },
+ { "name": "Html Attribute Value", "fore": "scarletred3" },
+ { "name": "Html Comment", "fore": "aluminium4" },
+ { "name": "Html Element Name", "fore": "skyblue3" },
+ { "name": "Html Operator", "fore": "skyblue3" },
+
+ { "name": "Keyword(Access)", "fore": "skyblue2" },
+ { "name": "Keyword(Type)", "fore": "skyblue2" },
+ { "name": "Keyword(Operator)", "fore": "skyblue2" },
+ { "name": "Keyword(Selection)", "fore": "skyblue2" },
+ { "name": "Keyword(Iteration)", "fore": "skyblue2" },
+ { "name": "Keyword(Jump)", "fore": "skyblue2" },
+ { "name": "Keyword(Context)", "fore": "skyblue2" },
+ { "name": "Keyword(Exception)", "fore": "skyblue2" },
+ { "name": "Keyword(Modifiers)", "fore": "skyblue2" },
+ { "name": "Keyword(Constants)", "fore": "skyblue2" },
+ { "name": "Keyword(Void)", "fore": "skyblue2" },
+ { "name": "Keyword(Namespace)", "fore": "skyblue2" },
+ { "name": "Keyword(Property)", "fore": "skyblue2" },
+ { "name": "Keyword(Declaration)", "fore": "skyblue2" },
+ { "name": "Keyword(Parameter)", "fore": "skyblue2" },
+ { "name": "Keyword(Operator Declaration)", "fore": "skyblue2" },
+ { "name": "Keyword(Other)", "fore": "skyblue2" },
+
+ { "name": "User Types", "fore": "plum2" },
+ { "name": "User Types(Enums)", "fore": "plum2" },
+ { "name": "User Types(Interfaces)", "fore": "plum2" },
+ { "name": "User Types(Delegates)", "fore": "plum2" },
+ { "name": "User Types(Value types)", "fore": "plum2" },
+ { "name": "User Types(Type parameters)", "fore": "plum2" },
+
+ { "name": "User Event Usage", "fore": "orange3" },
+ { "name": "User Event Declaration", "fore": "orange3" },
+
+ { "name": "Syntax Error", "fore": "scarletred1" },
+
+ { "name": "String Format Items", "fore": "chocolate2" },
+
+ { "name": "Css Comment", "fore": "aluminium3", "weight": "bold" },
+ { "name": "Css Selector", "fore": "chameleon3", "weight": "bold" },
+
+ { "name": "Script Comment", "fore": "aluminium3" },
+ { "name": "Script Keyword", "fore": "skyblue2" },
+ { "name": "Script Number", "fore": "scarletred3" },
+ { "name": "Script String", "fore": "scarletred3" }
+ ]
+}
diff --git a/main/src/core/Mono.Texteditor/Styles/VisualStudioStyle.json b/main/src/core/Mono.Texteditor/Styles/VisualStudioStyle.json
index 24c60691e3..a19b234914 100644
--- a/main/src/core/Mono.Texteditor/Styles/VisualStudioStyle.json
+++ b/main/src/core/Mono.Texteditor/Styles/VisualStudioStyle.json
@@ -1,148 +1,112 @@
{
- "name":"Visual Studio",
- "version":"1.1",
- "description":"Reminiscent of Microsoft Visual Studio's default colors.",
- "originator":"Jeffrey Stedfast <fejj@novell.com>",
-
- "palette":[
- { "name":"comment-green", "value":"#008000" },
- { "name":"keyword-blue", "value":"#0000ff" },
- { "name":"semantic-type", "value":"#2B90AF" },
- { "name":"aluminium2", "value":"#d3d7cf" }
- ],
-
- "colors":[
- { "name":"Background(Read Only)", "color":"#FFFFFF" },
-
- { "name":"Fold Square", "color":"#A5A5A5" },
- { "name":"Fold Cross", "color":"#555555", "secondcolor":"#E2E2E2" },
-
- { "name":"Indentation Guide", "color":"aluminium2" },
-
- { "name":"Underline(Error)", "color":"#FF0000" },
- { "name":"Underline(Warning)", "color":"comment-green" },
-
- { "name":"Quick Diff(Dirty)", "color":"yellow" },
- { "name":"Quick Diff(Changed)", "color":"green" },
-
- { "name":"Brace Matching(Rectangle)", "color":"#DBE0CC", "secondcolor":"#00000000" },
- { "name":"Usages(Rectangle)", "color":"#B1DFF9", "secondcolor":"#B1DFF9", "bordercolor":"#B1DFF9" },
- { "name":"Changing usages(Rectangle)", "color":"#FFD6DD", "secondcolor":"#FFD6DD", "bordercolor":"#FFD6DD" },
-
- { "name":"Current Line Marker", "color":"white", "secondcolor":"gray"},
- { "name":"Current Line Marker(Inactive)", "color":"white", "secondcolor":"gray"},
-
- { "name":"Indicator Margin", "color":"#F0F0F0" },
- { "name":"Indicator Margin(Separator)", "color":"#F0F0F0" }
- ],
-
- "text":[
- { "name":"Plain Text", "fore":"#000000", "back":"#FFFFFF" },
- { "name":"Selected Text", "fore":"white", "back":"#3298FF" },
- { "name":"Selected Text(Inactive)", "fore":"white", "back":"#BFCDDB" },
-
- { "name":"Collapsed Text", "fore":"#808080" },
-
- { "name":"Line Numbers", "fore":"semantic-type", "back":"#FFFFFF" },
-
- { "name":"Punctuation" },
- { "name":"Punctuation(Brackets)", "fore":"#000000", "back":"#FFFFFF" },
-
- { "name":"Comment(Line)", "fore":"comment-green" },
- { "name":"Comment(Block)", "fore":"comment-green" },
- { "name":"Comment(Doc)", "fore":"comment-green" },
- { "name":"Comment(DocTag)", "fore":"#808080" },
- { "name":"Comment Tag", "fore":"comment-green" },
- { "name":"Excluded Code", "fore":"comment-green" },
-
- { "name":"String", "fore":"#A31515" },
- { "name":"String(Escape)", "fore":"#A31515" },
- { "name":"String(C# @ Verbatim)", "fore":"#A31515" },
-
- { "name":"Number" },
-
- { "name":"Preprocessor", "fore":"keyword-blue" },
- { "name":"Preprocessor(Region Name)", "fore":"#000000" },
-
- { "name":"Xml Text" },
- { "name":"Xml Delimiter", "fore":"keyword-blue" },
- { "name":"Xml Name", "fore":"#A31515" },
- { "name":"Xml Attribute", "fore":"#FF0000" },
- { "name":"Xml Attribute Quotes", "fore":"#000000" },
- { "name":"Xml Attribute Value", "fore":"keyword-blue" },
- { "name":"Xml Comment", "fore":"#006400" },
- { "name":"Xml CData Section", "fore":"#808080" },
-
- { "name":"Html Attribute Name", "fore":"#FF0000" },
- { "name":"Html Attribute Value", "fore":"keyword-blue" },
- { "name":"Html Comment", "fore":"#006400" },
- { "name":"Html Element Name", "fore":"#800000" },
- { "name":"Html Entity", "fore":"#FF0000" },
- { "name":"Html Operator", "fore":"keyword-blue" },
- { "name":"Html Server-Side Script", "back":"#FEFF00" },
- { "name":"Html Tag Delimiter", "fore":"keyword-blue" },
- { "name":"Razor Code", "back":"#E7EFF2" },
-
- { "name":"Keyword(Access)", "fore":"keyword-blue" },
- { "name":"Keyword(Type)", "fore":"keyword-blue" },
- { "name":"Keyword(Operator)", "fore":"keyword-blue" },
- { "name":"Keyword(Selection)", "fore":"keyword-blue" },
- { "name":"Keyword(Iteration)", "fore":"keyword-blue" },
- { "name":"Keyword(Jump)", "fore":"keyword-blue" },
- { "name":"Keyword(Context)", "fore":"keyword-blue" },
- { "name":"Keyword(Exception)", "fore":"keyword-blue" },
- { "name":"Keyword(Modifiers)", "fore":"keyword-blue" },
- { "name":"Keyword(Constants)", "fore":"keyword-blue" },
- { "name":"Keyword(Void)", "fore":"keyword-blue" },
- { "name":"Keyword(Namespace)", "fore":"keyword-blue" },
- { "name":"Keyword(Property)", "fore":"keyword-blue" },
- { "name":"Keyword(Declaration)", "fore":"keyword-blue" },
- { "name":"Keyword(Parameter)", "fore":"keyword-blue" },
- { "name":"Keyword(Operator Declaration)", "fore":"keyword-blue" },
- { "name":"Keyword(Other)", "fore":"keyword-blue" },
-
- { "name":"User Types", "fore":"semantic-type" },
- { "name":"User Types(Enums)", "fore":"semantic-type" },
- { "name":"User Types(Interfaces)", "fore":"semantic-type" },
- { "name":"User Types(Delegates)", "fore":"semantic-type" },
- { "name":"User Types(Value types)", "fore":"semantic-type" },
-
- { "name":"User Field Usage" },
- { "name":"User Field Declaration" },
-
- { "name":"User Property Usage" },
- { "name":"User Property Declaration" },
-
- { "name":"User Event Usage" },
- { "name":"User Event Declaration" },
-
- { "name":"User Method Usage" },
- { "name":"User Method Declaration" },
-
- { "name":"User Parameter Usage" },
- { "name":"User Parameter Declaration" },
-
- { "name":"User Variable Usage" },
- { "name":"User Variable Declaration" },
-
- { "name":"Syntax Error", "fore":"#FF0000" },
-
- { "name":"Breakpoint Text", "fore":"#000000", "back":"#963945" },
-
- { "name":"Debugger Current Statement", "fore":"#000000", "back":"#FFEE61" },
-
- { "name":"Css Comment", "fore":"#006400" },
- { "name":"Css Property Name", "fore":"#FF0000" },
- { "name":"Css Property Value", "fore":"keyword-blue" },
- { "name":"Css Selector", "fore":"#800000" },
- { "name":"Css String Value", "fore":"keyword-blue" },
- { "name":"Css Keyword", "fore":"keyword-blue" },
-
- { "name":"Script Comment", "fore":"comment-green" },
- { "name":"Script Identifier" },
- { "name":"Script Keyword", "fore":"keyword-blue" },
- { "name":"Script Number" },
- { "name":"Script Operator" },
- { "name":"Script String" }
- ]
-} \ No newline at end of file
+ "name": "Visual Studio",
+ "version": "1.2.2",
+ "description": "Reminiscent of Microsoft Visual Studio's default colors",
+ "originator": "Jeffrey Stedfast <fejj@novell.com>",
+
+ "palette": [
+ { "name": "text-black", "value": "#222222" },
+ { "name": "comment-green", "value": "#008000" },
+ { "name": "keyword-blue", "value": "#0000ff" },
+ { "name": "semantic-type", "value": "#2B90AF" }
+ ],
+
+ "colors": [
+ { "name": "Background(Read Only)", "color": "#FFFFFF" },
+
+ { "name": "Underline(Error)", "color": "#FF0000" },
+ { "name": "Underline(Warning)", "color": "comment-green" },
+
+ { "name": "Quick Diff(Dirty)", "color": "yellow" },
+ { "name": "Quick Diff(Changed)", "color": "green" },
+
+ { "name": "Indicator Margin", "color": "#f6f6f6" },
+ { "name": "Indicator Margin(Separator)", "color": "#f6f6f6" },
+
+ { "name": "Message Bubble Warning IconMargin", "color": "#e68100", "bordercolor": "#e68100" }
+ ],
+
+ "text": [
+ { "name": "Plain Text", "fore": "text-black", "back": "#FFFFFF" },
+ { "name": "Selected Text", "fore": "white", "back": "#3298FF" },
+ { "name": "Selected Text(Inactive)", "fore": "white", "back": "#BFCDDB" },
+
+ { "name": "Collapsed Text", "fore": "comment-green", "back": "white" },
+
+ { "name": "Line Numbers", "fore": "semantic-type", "back": "#FFFFFF" },
+
+ { "name": "Punctuation(Brackets)", "fore": "#000000", "back": "#FFFFFF" },
+
+ { "name": "Comment(Line)", "fore": "comment-green" },
+ { "name": "Comment(Block)", "fore": "comment-green" },
+
+ { "name": "Excluded Code", "fore": "comment-green" },
+
+ { "name": "String", "fore": "#A31515" },
+ { "name": "String(Escape)", "fore": "#A31515" },
+ { "name": "String(C# @ Verbatim)", "fore": "#A31515" },
+
+ { "name": "Preprocessor", "fore": "keyword-blue" },
+ { "name": "Preprocessor(Region Name)", "fore": "#000000" },
+
+ { "name": "Xml Delimiter", "fore": "keyword-blue" },
+ { "name": "Xml Name", "fore": "#A31515" },
+ { "name": "Xml Attribute", "fore": "#FF0000" },
+ { "name": "Xml Attribute Quotes", "fore": "#000000" },
+ { "name": "Xml Attribute Value", "fore": "keyword-blue" },
+ { "name": "Xml Comment", "fore": "#006400" },
+ { "name": "Xml CData Section", "fore": "#808080" },
+
+ { "name": "Html Attribute Name", "fore": "#FF0000" },
+ { "name": "Html Attribute Value", "fore": "keyword-blue" },
+ { "name": "Html Comment", "fore": "#006400" },
+ { "name": "Html Element Name", "fore": "#800000" },
+ { "name": "Html Entity", "fore": "#FF0000" },
+ { "name": "Html Operator", "fore": "keyword-blue" },
+ { "name": "Html Server-Side Script", "back": "#FEFF00" },
+ { "name": "Html Tag Delimiter", "fore": "keyword-blue" },
+ { "name": "Razor Code", "back": "#E7EFF2" },
+
+ { "name": "Keyword(Access)", "fore": "keyword-blue" },
+ { "name": "Keyword(Type)", "fore": "keyword-blue" },
+ { "name": "Keyword(Operator)", "fore": "keyword-blue" },
+ { "name": "Keyword(Selection)", "fore": "keyword-blue" },
+ { "name": "Keyword(Iteration)", "fore": "keyword-blue" },
+ { "name": "Keyword(Jump)", "fore": "keyword-blue" },
+ { "name": "Keyword(Context)", "fore": "keyword-blue" },
+ { "name": "Keyword(Exception)", "fore": "keyword-blue" },
+ { "name": "Keyword(Modifiers)", "fore": "keyword-blue" },
+ { "name": "Keyword(Constants)", "fore": "keyword-blue" },
+ { "name": "Keyword(Void)", "fore": "keyword-blue" },
+ { "name": "Keyword(Namespace)", "fore": "keyword-blue" },
+ { "name": "Keyword(Property)", "fore": "keyword-blue" },
+ { "name": "Keyword(Declaration)", "fore": "keyword-blue" },
+ { "name": "Keyword(Parameter)", "fore": "keyword-blue" },
+ { "name": "Keyword(Operator Declaration)", "fore": "keyword-blue" },
+ { "name": "Keyword(Other)", "fore": "keyword-blue" },
+
+ { "name": "User Types", "fore": "semantic-type" },
+ { "name": "User Types(Enums)", "fore": "semantic-type" },
+ { "name": "User Types(Interfaces)", "fore": "semantic-type" },
+ { "name": "User Types(Delegates)", "fore": "semantic-type" },
+ { "name": "User Types(Value types)", "fore": "semantic-type" },
+
+ { "name": "Syntax Error", "fore": "#FF0000" },
+
+ { "name": "Breakpoint Text", "fore": "#000000", "back": "#963945" },
+
+ { "name": "Debugger Current Statement", "fore": "#000000", "back": "#FFEE61" },
+
+ { "name": "Css Comment", "fore": "#006400", "weight": "bold" },
+ { "name": "Css Property Name", "fore": "#FF0000", "weight": "bold" },
+ { "name": "Css Property Value", "fore": "keyword-blue", "weight": "bold" },
+ { "name": "Css Selector", "fore": "#800000", "weight": "bold" },
+ { "name": "Css String Value", "fore": "keyword-blue", "weight": "bold" },
+ { "name": "Css Keyword", "fore": "keyword-blue", "weight": "bold" },
+
+ { "name": "Script Comment", "fore": "comment-green" },
+ { "name": "Script Keyword", "fore": "keyword-blue" },
+
+ { "name": "Tooltip Text", "fore": "text-black", "back": "#fafae3" }
+ ]
+}
diff --git a/main/src/core/Mono.Texteditor/SyntaxModes/CSharpSyntaxMode.xml b/main/src/core/Mono.Texteditor/SyntaxModes/CSharpSyntaxMode.xml
index b7cea68816..c1d491f171 100644
--- a/main/src/core/Mono.Texteditor/SyntaxModes/CSharpSyntaxMode.xml
+++ b/main/src/core/Mono.Texteditor/SyntaxModes/CSharpSyntaxMode.xml
@@ -58,6 +58,16 @@
<End>"</End>
</Span>
+ <Span color = "String" rule="InterpolatedString" stopateol = "true" escape='\"'>
+ <Begin>$"</Begin>
+ <End>"</End>
+ </Span>
+
+ <Span color = "String" rule="InterpolatedVerbatimString" stopateol = "false" escape='""'>
+ <Begin>$@"</Begin>
+ <End>"</End>
+ </Span>
+
<Span color = "String" rule="String" stopateol = "true" escape='\"'>
<Begin>"</Begin>
<End>"</End>
@@ -77,12 +87,13 @@
<Word>/</Word>
<Word>%</Word>
<Word>^</Word>
+ <Word>&amp;</Word>
+ <Word>|</Word>
<Word>?</Word>
<Word>:</Word>
-
- <Word>&amp;</Word>
-
+ <Word>!</Word>
+
<Word>=</Word>
<Word>;</Word>
<Word>,</Word>
@@ -321,11 +332,32 @@
<Rule name = "String">
<Match color ="String(Escape)" ignorecase="True">\\(['"\\abfnrtv]|x[0-9a-fA-F]{2,4}|0\d\d)</Match>
</Rule>
-
+
+
+ <Rule name = "InterpolatedString">
+ <Match color ="String(Escape)" ignorecase="True">\\(['"\\abfnrtv]|x[0-9a-fA-F]{2,4}|0\d\d)</Match>
+ <Match color ="String" ignorecase="True">{{</Match>
+
+ <Span color = "Plain Text" rule="mode:text/x-csharp" stopateol = "true">
+ <Begin color = "String">{‹{</Begin>
+ <End color = "String">}</End>
+ </Span>
+ </Rule>
+
<Rule name = "VerbatimString">
<Match color ="String(Escape)">""</Match>
</Rule>
+ <Rule name = "InterpolatedVerbatimString">
+ <Match color ="String(Escape)">""</Match>
+ <Match color ="String" ignorecase="True">{{</Match>
+
+ <Span color = "Plain Text" rule="mode:text/x-csharp" stopateol = "false">
+ <Begin color = "String">{‹{</Begin>
+ <End color = "String">}</End>
+ </Span>
+ </Rule>
+
<Rule name = "XmlDocumentation">
<Delimiters>&lt;&gt;</Delimiters>
diff --git a/main/src/core/Mono.Texteditor/SyntaxModes/FSharpSyntaxMode.xml b/main/src/core/Mono.Texteditor/SyntaxModes/FSharpSyntaxMode.xml
index 2907e63f63..53bc2dda05 100644
--- a/main/src/core/Mono.Texteditor/SyntaxModes/FSharpSyntaxMode.xml
+++ b/main/src/core/Mono.Texteditor/SyntaxModes/FSharpSyntaxMode.xml
@@ -69,11 +69,6 @@
<Begin>"</Begin>
<End>"</End>
</Span>
-
- <Span rule="Let" stopateol = "false">
- <Begin color="Keyword(Iteration)" flags="NewWord">let </Begin>
- <End>=|(|&lt;</End>
- </Span>
<!--
<Span color="String" rule="String" stopateol="true" escape='\'>
@@ -92,75 +87,34 @@
<Group color="String"/>
</Match> -->
+ <!-- FSI text -->
+ <Match color="Plain Text" ignorecase="True">^\u00A0.*$</Match>
<Match color="String" ignorecase="True">'(\w|\\['ntbrafv])'</Match>
-
-
-
- <Match color="Number">CSharpNumber</Match>
- <Match color="Keyword(Iteration)">(let|use|yield|return|do)(!)?\s</Match>
- <Match color="Keyword(Iteration)">(let|use|yield|return|do)(!)?$</Match>
+<!-- <Match color="User Method Declaration">``(.*)``</Match> -->
+
+ <Match color="Number">(-*[0-9]+[\w]*)</Match>
+ <Match color="Keyword(Iteration)" ignorecase="False">(do!|use!|yield!|return!|let!)</Match>
+ <Match color="Keyword(Iteration)" ignorecase="False">(do|use|yield|return)\b</Match>
<!-- reserved-ident-keyword F# spec v3.0 section 3.4 -->
- <Match color="Keyword(Other)">(atomic|break|checked|component|const|constraint|constructor|continue|eager|fixed|fori|functor|include|measure|method|mixin|object|parallel|params|process|protected|pure|recursive|sealed|tailcall|trait|virtual|volatile)[!#]?\s</Match>
- <Match color="Keyword(Other)">(atomic|break|checked|component|const|constraint|constructor|continue|eager|fixed|fori|functor|include|measure|method|mixin|object|parallel|params|process|protected|pure|recursive|sealed|tailcall|trait|virtual|volatile)[!#]?$</Match>
+ <Match color="Keyword(Other)" ignorecase="False">(atomic|break|checked|component|const|constraint|constructor|continue|eager|fixed|fori|functor|include|measure|method|mixin|object|parallel|params|process|protected|pure|recursive|sealed|tailcall|trait|virtual|volatile)[!#]?\s</Match>
+ <Match color="Keyword(Other)" ignorecase="False">(atomic|break|checked|component|const|constraint|constructor|continue|eager|fixed|fori|functor|include|measure|method|mixin|object|parallel|params|process|protected|pure|recursive|sealed|tailcall|trait|virtual|volatile)[!#]?$</Match>
<!-- It is really impossible to do some intelligent grouping here, because
it looks weird no matter what we do... some things are context-sensitive,
some things may appear in unexpected place.. so just use single color -->
- <Keywords color="Keyword(Jump)">
- <!-- expressions that create some value -->
- <Word>fun</Word>
- <Word>function</Word>
- <Word>new</Word>
- </Keywords>
-
- <Keywords color="Keyword(Iteration)">
- <!-- control flow constructs -->
- <Word>finally</Word>
- <Word>try</Word>
- <Word>with</Word>
-
- <Word>val</Word>
- <Word>while</Word>
- <Word>for</Word>
-
- <Word>begin</Word>
- <Word>done</Word>
- <Word>elif</Word>
- <Word>else</Word>
- <Word>end</Word>
- <Word>if</Word>
- <Word>match</Word>
- <Word>then</Word>
- <Word>when</Word>
-
- <!-- object model things -->
+ <Keywords color="Keyword(Modifiers)">
<Word>inline</Word>
<Word>static</Word>
<Word>abstract</Word>
- <Word>override</Word>
+ <Word>default</Word>
<Word>private</Word>
<Word>public</Word>
<Word>extern</Word>
<Word>internal</Word>
<Word>mutable</Word>
<Word>rec</Word>
- <Word>void</Word>
-
- <Word>global</Word>
- <Word>base</Word>
- <Word>default</Word>
- <Word>inherit</Word>
- <Word>member</Word>
- <Word>type</Word>
-
- <Word>of</Word>
- <Word>class</Word>
- <Word>delegate</Word>
- <Word>exception</Word>
- <Word>interface</Word>
- <Word>struct</Word>
</Keywords>
<Keywords color="Keyword(Operator)">
@@ -177,16 +131,6 @@
<Word>select</Word>
</Keywords>
- <Keywords color="Keyword(Constants)">
- <Word>false</Word>
- <Word>null</Word>
- <Word>true</Word>
-
- <Word>__LINE__</Word>
- <Word>__SOURCE_DIRECTORY__</Word>
- <Word>__SOURCE_FILE__</Word>
- </Keywords>
-
<Keywords color="Keyword(Type)">
</Keywords>
@@ -208,7 +152,17 @@
<Keywords color="Keyword(Parameter)">
</Keywords>
-
+ <Keywords color = "Punctuation(Brackets)">
+ <Word>(</Word>
+ <Word>)</Word>
+ <Word>[</Word>
+ <Word>]</Word>
+ <Word>&lt;</Word>
+ <Word>&gt;</Word>
+ <Word>{</Word>
+ <Word>}</Word>
+ </Keywords>
+
<Keywords color="Keyword(Operator Declaration)">
</Keywords>
@@ -224,34 +178,30 @@
<Word>sig</Word>
</Keywords>
- <Rule name="text.preprocessor" ignorecase="True">
+<!-- <Rule name="text.preprocessor" ignorecase="True">-->
<Span color = "String" rule="String" stopateol = "true">
<Begin>"</Begin>
<End>"</End>
</Span>
- <Keywords color = "Keyword(Constants)">
+ <!--<Keywords color = "Keyword(Constants)">
<Word>true</Word>
<Word>false</Word>
- </Keywords>
+ </Keywords>-->
<Keywords color = "Punctuation">
<Word>==</Word>
<Word>!=</Word>
- <Word>!</Word>
+<!-- <Word>!</Word>-->
<Word>&amp;&amp;</Word>
<Word>||</Word>
</Keywords>
- <Keywords color = "Punctuation(Brackets)">
- <Word>(</Word>
- <Word>)</Word>
- </Keywords>
-
+
<EolSpan color = "Comment(Doc)" rule="XmlDocumentation" tagColor="Comment(DocTag)">///</EolSpan>
<EolSpan color = "Comment(Line)" rule="Comment" tagColor="Comment(Line)">//</EolSpan>
- </Rule>
+<!-- </Rule>-->
<Rule name="Comment">
<Keywords color="Comment Tag" ignorecase="True">
@@ -306,5 +256,170 @@
<End>&gt;</End>
</Span>
</Rule>
-
+
+ <Match color="Plain Text">\b(get|set)\b</Match>
+
+ <Match expression="(\s{3})(string|unit|bool|option|list|int|uint|int16|int32|int64|uint32|uint64|byte|sbyte|double|float|nint|single|float32|bigint|decimal|Char)(?:\s*:)" ignorecase="False">
+ <!-- tooltip -->
+ <Group color="Plain Text" />
+ <Group color="User Field Declaration" />
+ </Match>
+
+ <Match color="User Types" ignorecase="False">\b(string|unit|bool|option|list|int|uint|int16|int32|int64|uint32|uint64|byte|sbyte|double|float|nint|single|float32|bigint|decimal|Char)\b</Match>
+
+ <Match expression="(override)(\s+)(\w+)(\.)(\w+)(?:\s[^=:])" ignorecase="False">
+ <!-- override x.CanHandle y = -->
+ <Group color="Keyword(Modifiers)"/>
+ <Group color="Plain Text" />
+ <Group color="User Field Declaration" />
+ <Group color="Plain Text" />
+ <Group color="User Method Declaration"/>
+ </Match>
+<!--
+ <Match expression="(let)(\s+)(\w+)(\s*)=$" ignorecase="False">
+ <Group color="Keyword(Iteration)"/>
+ <Group color="Plain Text" />
+ <Group color="User Field Declaration"/>
+ <Group color="Plain Text" />
+ </Match>-->
+
+ <Match expression="(of)(\s+)(\w+)">
+ <Group color="Keyword(Iteration)"/>
+ <Group color="Plain Text" />
+ <Group color="User Types"/>
+ </Match>
+
+ <Match expression="(\|\s*:\?\s*)(\w+)">
+ <!-- | :? §string§ -->
+ <Group color="Plain Text" />
+ <Group color="User Types"/>
+ </Match>
+
+ <Match expression="(let)(\s+)(static|abstract|default|override|public|extern|internal|mutable|rec|inline|private)(\s+)(static|abstract|default|override|public|extern|internal|mutable|rec|inline|private)(\s+)(\w+|``.*``)(?:\s[^=:])" ignorecase="False">
+ <!-- let inline add x y = x + y -->
+ <Group color="Keyword(Iteration)"/>
+ <Group color="Plain Text" />
+ <Group color="Keyword(Modifiers)"/>
+ <Group color="Plain Text" />
+ <Group color="Keyword(Modifiers)"/>
+ <Group color="Plain Text" />
+ <Group color="User Method Declaration"/>
+ </Match>
+
+ <Match expression="(let)(\s+)(static|abstract|default|override|public|extern|internal|mutable|rec|inline|private)(\s+)(\w+|``[^`]*``)(?:\s+[^=:])" ignorecase="False">
+ <!-- let inline add x y = x + y -->
+ <Group color="Keyword(Iteration)"/>
+ <Group color="Plain Text" />
+ <Group color="Keyword(Modifiers)"/>
+ <Group color="Plain Text" />
+ <Group color="User Method Declaration"/>
+ </Match>
+
+ <Match expression="(let\s+)(\w+|``[^`]*``)(?:\s+[^\s=:])" ignorecase="False">
+ <!-- let add x y = x + y -->
+ <Group color="Keyword(Iteration)"/>
+ <Group color="User Method Declaration"/>
+ </Match>
+
+ <Match expression="(\w+|``[^`]*``)(?:\s:$)" ignorecase="False">
+ <!-- tooltip -->
+ <Group color="User Method Declaration"/>
+ </Match>
+
+ <Match color="Keyword(Modifiers)">(static|abstract|default|override|public|extern|internal|mutable|rec|inline|private)\b</Match>
+
+ <Match expression="([A-Z]{1}\w*)(\s*=)">
+ <Group color="User Field Declaration"/>
+ <Group color="Plain Text" />
+ </Match>
+
+ <Match expression="\b([A-Z][\w]+)\b" ignorecase="False">
+ <Group color="User Types"/>
+ </Match>
+
+ <Match expression="(:\s*)(['\w]+)\b">
+ <Group color="Plain Text"/>
+ <Group color="User Types"/>
+ </Match>
+
+ <Match expression="(\^[\w]+)\b">
+ <Group color="User Types"/>
+ </Match>
+
+ <!-- ( ) [ ] < > { } |> |< << >> <= >= <- -> :?> -->
+ <Match expression="(\&lt;\-)">
+ <Group color="Punctuation(Brackets)"/>
+ </Match>
+ <Match expression="(&lt;)([A-Za-z]+)(?:&gt;)">
+ <Group color="Punctuation(Brackets)"/>
+ <Group color="User Types"/>
+ </Match>
+
+ <Match color="Punctuation(Brackets)">(\|&gt;|\|&lt;|&lt;&lt;|&gt;&gt;|&lt;=|&gt;=|&lt;-|-&gt;|:\?&gt;)</Match>
+ <Match color="User Types">'\w+</Match>
+
+ <Match expression="(namespace|open)\b(.*)$" ignorecase="False">
+ <Group color="Keyword(Namespace)"/>
+ <Group color="Plain Text"/>
+ </Match>
+
+ <Match expression="(module|type)(\s+)(\w+|``[^`]*``)" ignorecase="False">
+ <Group color="Keyword(Namespace)"/>
+ <Group color="Plain Text"/>
+ <Group color="User Types"/>
+ </Match>
+
+ <Match color="Keyword(Jump)" ignorecase="False">(function|fun|new)\b</Match>
+
+ <Match color="Keyword(Constants)" ignorecase="False">\b(false|null|true|__LINE__|__SOURCE_DIRECTORY__|__SOURCE_FILE__)\b</Match>
+ <Match color="Keyword(Iteration)" ignorecase="False">\b(async|maybe|asyncMaybe|asyncSeq|asyncChoice|seq|query|let|finally|try|with|val|while|for|begin|done|elif|else|end|if|match|then|when|void|global|base|inherit|member|type|module|of|class|delegate|exception|interface|struct|as|in)\b</Match>
+
+ <Match expression="^(\s+)(-&gt;)(\s+)(\w+)" ignorecase="False">
+ <!-- tooltip -->
+ <Group color="Plain Text"/>
+ <Group color="Punctuation(Brackets)"/>
+ <Group color="Plain Text"/>
+ <Group color="User Types"/>
+ </Match>
+
+ <Match expression="([a-z]{1}\w*|``[^`]*``)(?:\s*\&quot;)">
+ <Group color="User Method Declaration"/>
+ </Match>
+
+ <Match expression="(\|>\s*)([a-z]{1}\w*|``[^`]*``)" ignorecase="False">
+ <Group color="Plain Text" />
+ <Group color="User Method Declaration"/>
+ </Match>
+
+ <Match expression="(\.)(\w+|``[^`]*``)(?:\s*[\(]{1})">
+ <Group color="Plain Text" />
+ <Group color="User Method Declaration"/>
+ <Group color="Plain Text" />
+ <Group color="Punctuation(Brackets)" />
+ </Match>
+
+ <Match expression="(\.)([a-z]{1}\w*)" ignorecase="False">
+ <Group color="Plain Text" />
+ <Group color="User Method Declaration"/>
+ </Match>
+
+ <Match expression="([a-z]{1}\w*|``[^`]*``)(?:\s*[\(])" ignorecase="False">
+ <Group color="User Method Declaration"/>
+ </Match>
+
+ <Match expression="([a-z]{1}\w*|``[^`]*``)" ignorecase="False">
+ <Group color="User Field Declaration"/>
+ </Match>
+
+ <Match expression="(\.)([A-Z]{1}\w*|``[^`]``)" ignorecase="False">
+ <Group color="Plain Text" />
+ <Group color="User Property Declaration"/>
+ </Match>
+
+ <Match expression="(let)(\s+)(static|abstract|default|override|public|extern|internal|mutable|rec|inline|private)" ignorecase="False">
+ <!-- let mutable x = 1 -->
+ <Group color="Keyword(Iteration)"/>
+ <Group color="Plain Text" />
+ <Group color="Keyword(Modifiers)"/>
+ </Match>
</SyntaxMode>
diff --git a/main/src/core/Mono.Texteditor/SyntaxModes/VBNetSyntaxMode.xml b/main/src/core/Mono.Texteditor/SyntaxModes/VBNetSyntaxMode.xml
index e7627b3ca7..8190c28bb7 100644
--- a/main/src/core/Mono.Texteditor/SyntaxModes/VBNetSyntaxMode.xml
+++ b/main/src/core/Mono.Texteditor/SyntaxModes/VBNetSyntaxMode.xml
@@ -229,7 +229,6 @@
<Keywords color = "Keyword(Other)">
<Word>As</Word>
<Word>Of</Word>
- <Word>New</Word>
<Word>End</Word>
<Word>CBool</Word>
diff --git a/main/src/core/MonoDevelop.Core/AssemblyInfo.cs b/main/src/core/MonoDevelop.Core/AssemblyInfo.cs
index fa705fa3dd..1a7c5318cd 100644
--- a/main/src/core/MonoDevelop.Core/AssemblyInfo.cs
+++ b/main/src/core/MonoDevelop.Core/AssemblyInfo.cs
@@ -1,9 +1,12 @@
// Autogenerated from MonoDevelop.Core.addin.xml
using System.Reflection;
+using System.Runtime.CompilerServices;
[assembly: AssemblyProduct ("MonoDevelop")]
[assembly: AssemblyTitle ("MonoDevelop Runtime")]
[assembly: AssemblyDescription ("Provides the core services of the MonoDevelop platform")]
[assembly: AssemblyVersion ("2.6")]
[assembly: AssemblyCopyright ("MIT/X11")]
+
+[assembly: InternalsVisibleTo("UnitTests")]
diff --git a/main/src/core/MonoDevelop.Core/ChangeLog b/main/src/core/MonoDevelop.Core/ChangeLog
deleted file mode 100644
index 855f70b2fa..0000000000
--- a/main/src/core/MonoDevelop.Core/ChangeLog
+++ /dev/null
@@ -1,4056 +0,0 @@
-2010-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Projects/Solution.cs:
- * MonoDevelop.Projects/SolutionItem.cs:
- * MonoDevelop.Projects/AuthorInformation.cs: Moved
- AuthorInformation from MD.Ide to MD.Projects. Added an
- AuthorInformation property to Solution and SolutionItem.
-
-2010-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects.Formats.MD1/MD1DotNetProjectHandler.cs:
- Moved GetCulture to DotNetProject. Implemented the Clean
- method in Project.
-
- * MonoDevelop.Projects/DotNetProject.cs: Include generated
- satellite resource files into the list of output files.
- Fixes bug #615700 - Satellite assemblies not included in
- package project.
-
- * MonoDevelop.Projects/FileCopySet.cs: Added some
- documentation.
-
- * MonoDevelop.Projects/Project.cs: Added some documentation.
- Added GetOutputFiles overridable. It returns a list of files
- generated by the project.
-
-2010-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects.Formats.MSBuild/MSBuildProject.cs:
- * MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs:
- Don't save the msbuild file to disk if the content did not
- change. Fixes bug #628082 - MonoDevelop needs writable
- project files even though it doesn't write them.
-
-2010-07-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom.Parser/ProjectDomService.cs:
- * MonoDevelop.Projects.Dom.Serialization/CodeCompletionDatabase.cs:
- * MonoDevelop.Projects.Dom.MemoryDatabase/ProjectMemoryProjectDom.cs:
- Made queue parse job public.
-
-2010-07-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom.Serialization/SimpleCodeCompletionDatabase.cs:
- Lock database updates.
-
-2010-07-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/IExpressionFinder.cs: HACK: the
- expression finder now needs to take an textEditorData -
- unfortunately we've a rule that doesn't allow to reference
- the Mono.TextEditor from here - take care when calling this.
-
-2010-07-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom.Parser/ProjectDom.cs:
- * MonoDevelop.Projects.Dom.Serialization/CodeCompletionDatabase.cs:
- Fixed little namespace bug.
-
-2010-07-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom.Parser/ProjectDom.cs: Some
- performance optimization of SearchType.
-
-2010-07-20 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Projects.Dom.Serialization/FileEntry.cs:
- * MonoDevelop.Projects.Dom.Serialization/ClassEntry.cs:
- * MonoDevelop.Projects.Dom.Serialization/DomTypeProxy.cs:
- * MonoDevelop.Projects.Dom.Serialization/NamespaceEntry.cs:
- * MonoDevelop.Projects.Dom.Serialization/CodeCompletionDatabase.cs:
- * MonoDevelop.Projects.Dom.Serialization/ProjectCodeCompletionDatabase.cs:
- * MonoDevelop.Projects.Dom.Serialization/AssemblyCodeCompletionDatabase.cs:
- Optimized the code completion database (especially the
- string operations in the type lookup were expensive).
-
-2010-07-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.addin.xml:
- * MonoDevelop.Projects.CodeGeneration/BaseRefactorer.cs:
- * MonoDevelop.Projects.CodeGeneration/CodeRefactorer.cs:
- * MonoDevelop.Projects.Dom.MemoryDatabase/ProjectMemoryProjectDom.cs:
- * MonoDevelop.Projects.Dom.Serialization/ProjectCodeCompletionDatabase.cs:
- Track ProjectDomService/Parser API.
-
- * MonoDevelop.Projects.Dom.Parser/IParser.cs:
- * MonoDevelop.Projects.Extensions/ParserNode.cs:
- * MonoDevelop.Projects.Dom.Parser/AbstractParser.cs:
- * MonoDevelop.Projects.Dom.Parser/ProjectDomService.cs: Parser
- now uses a custom extension node which does the file type
- check, so we avoid loading all the parser assemblies at
- startup.
-
- * Makefile.am:
- * MonoDevelop.Core.csproj: Added file to project.
-
-2010-06-29 Lars Magnusson <lavima@gmail.com>
- * MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs:
- Added functionality for excluding imports when loading
- projects.
- * MonoDevelop.Projects.Extensions/DotNetProjectSubtypeNode.cs:
- Added attribute exclude which takes a colon separated list
- of targets to exclude. Added functionality to exclude the
- targets in the initializer.
-
-2010-06-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects/ProjectFileCollection.cs: Use FilePath
- when comparing files, since it will is case insensitive on
- windows. Sould fix bug #567155 - Linked source files not
- saved before building.
-
-2010-06-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * frameworks/framework_NET_4_0.xml: Add missing assembly.
-
-2010-06-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/DataContext.cs: Properly
- register extended properties. Fixes bug #Bug 615523 -
- [regression] tarball packages lack pixmaps / desktop files.
-
-2010-06-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- * MonoDevelop.Core.Execution/ExecutionEnvironment.cs:
- * MonoDevelop.Core.Assemblies/TargetFrameworkBackend.cs:
- * MonoDevelop.Projects.Formats.MD1/MD1DotNetProjectHandler.cs:
- * MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectService.cs:
- Added ExecutionEnvironment class, which can be used to
- customize the environment of a process.
-
-2010-06-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Projects/Project.cs: Use a monitor task for the
- build so things get indented properly in the build output
- pad.
-
-2010-06-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Projects.CodeGeneration/CodeGenerator.cs: Use
- start & end offset for regions, not start + length.
-
-2010-06-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Projects.CodeGeneration/CodeGenerator.cs:
- CreateMemberImplementation now returns a
- CodeGeneratorMemberResult with body regions.
-
- * MonoDevelop.Projects.Dom/IDomVisitor.cs:
- * MonoDevelop.Projects.Dom/DomCecilCompilationUnit.cs: Fix
- spelling.
-
-2010-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects/DotNetProject.cs: Added option for
- setting a project to use an external console.
-
-2010-06-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Text/Formatter.cs: Fixed 'Bug 611202 -
- Move line up/down command fails in aspx files'.
-
-2010-06-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.CodeGeneration/CodeGenerator.cs: Code
- generator get's now used by code completion auto generation
- & insert code feature.
-
-2010-06-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.CodeGeneration/CodeGenerator.cs: Worked
- on code generation.
-
-2010-06-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.CodeGeneration/CodeGenerator.cs: Append
- new line between members.
-
-2010-06-01 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core.addin.xml:
- * MonoDevelop.Projects.CodeGeneration/CodeGenerator.cs:
- * MonoDevelop.Projects.CodeGeneration/MimeTypeExtensionNode.cs:
- Worked on code generation.
-
-2010-05-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/ResolveResult.cs: Fixed 'Bug 610203
- - Go to declaration on a method doesn't go to the correct
- overload'.
-
-2010-05-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/DomReturnType.cs:
- * MonoDevelop.Projects.Dom/ResolveResult.cs: Fixed 'Bug 610006
- - Intellisense gives members of return type of functions
- even when that function isn't invoked'.
-
-2010-05-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/CompilationUnit.cs: Fixed part of
- 'Bug 609221 - Refactor->"Create Method" does not infer type
- for parameter from LINQ query'.
-
-2010-05-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/ExpressionContext.cs: Changed linq
- context.
-
-2010-05-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom.Parser/TypeResolverVisitor.cs:
- Fixed potential type lookup problem.
-
-2010-05-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/MonoRuntimeInfo.cs: Update
- runtime version parsing.
-
-2010-05-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/DomReturnType.cs: Addad check.
-
-2010-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/FileService.cs: New ToFilePathArray
- extension method.
-
-2010-05-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/CompilationUnit.cs: fixed
- collection already modified exception.
-
-2010-05-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/ParsedDocument.cs: Implemented 'Bug
- 606544 - Better comment fold markers'.
-
-2010-05-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/ResolveResult.cs: Removed some
- debug code.
-
-2010-05-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/ResolveResult.cs: Added a property
- to determine, if a method resove result matches exactly one
- of the found methods.
-
-2010-05-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/ExpressionContext.cs: Added LINQ
- context.
-
-2010-05-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/FileService.cs: FilePath should be
- serializable.
-
-2010-05-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/ResolveResult.cs: Resolve results
- can now contain errors.
-
-2010-05-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects/DotNetProject.cs:
- * MonoDevelop.Projects/DotNetAssemblyProject.cs:
- * MonoDevelop.Projects/ProjectCreateInformation.cs: Added new
- GetDefaultTargetPlatform virtual to DotNetProject. It is
- overriden in DotNetAssemblyProject to set the default
- configuration for exes (x86).
-
-2010-05-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom.Output/AmbienceService.cs: Added
- null check for 'Bug 605005 - Exception viewing asax files'.
-
-
-2010-05-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Projects/DotNetProject.cs: Remove
- SupportedClrVersions, as it's been superseded by
- SupportsFramework.
-
-2010-05-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Projects/ProjectFile.cs: Expose
- DependentChildren as an IList not an IEnumerable.
-
- * MonoDevelop.Projects/DotNetAssemblyProject.cs: Improve
- comment.
-
-2010-05-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects.Dom.Parser/ProjectDomService.cs: Use
- FilePath to index the file database dictionary.
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- ExecuteAssembly sets env vars, so UseShellExecute must be
- false.
-
- * MonoDevelop.Core.Instrumentation/InstrumentationService.cs:
- Start the monitor process using a cross platform method.
-
-2010-05-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core/FileService.cs: Check empty file name.
-
-2010-05-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom.Parser/ProjectDomService.cs: Added
- file name check.
-
-2010-05-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Logging/ConsoleLogger.cs: Don't localize
- log message headers, since it's possible for this to cause a
- circular type initialization problem with the
- PropertyService, GettextCatalog, and InstrumentationService.
- Console log messages probably shouldn't be localized anyway,
- because it makes them harder for us to interpret.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom.Parser/ProjectDomService.cs: Added
- method for removing a file dom.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom.Parser/ProjectDom.cs: fix null ref
- if returnType == null.
-
-2010-05-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs: Fix Windows
- build.
-
- * MonoDevelop.Core.Instrumentation/Counter.cs:
- * MonoDevelop.Core.Instrumentation/TimerCounter.cs:
- * MonoDevelop.Core.Instrumentation/InstrumentationService.cs:
- Add support for counter data serialization.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects/ProjectsServices.cs: Delay project
- service loading.
-
-2010-05-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs: Fix the Exited
- event on StartProcess. Add a FIXME regarding killing the
- wapi hack.
-
-2010-05-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/PropertyBag.cs: Really fix unescaping of keys.
-
-2010-05-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/PropertyBag.cs: Fix unescaping of keys.
-
-2010-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects.Policies/PolicyService.cs: In
- ParanoidSave, make sure the writer is closed before trying
- to rename the file. Should fix bug #591321 - Edit/Default
- Policies are not persistent between sessions.
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core/Properties.cs: Dispose stream reader after
- use.
-
-2010-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/AssemblyContext.cs:
- * MonoDevelop.Core.Assemblies/DirectoryAssemblyContext.cs:
- Don't crash if there is some error while scanning an
- assembly folder. Fire the Changed event if the directory
- list of DirectoryAssemblyContext changes.
-
-2010-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/StringParserService.cs: Added formatting
- support for float and double.
-
-2010-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects.Policies/PolicySet.cs:
- * MonoDevelop.Projects.Policies/ScopedPolicy.cs:
- * MonoDevelop.Projects.Policies/PolicyService.cs: Added
- attribute to explicitly allow differential serialization for
- a policy (which is disabled by default).
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom.Parser/ProjectDomService.cs: Fixed
- 'Bug 601351 - changing collection while enumerating in the
- dom parser'.
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/ResolveResult.cs: Fixed 'Bug 601350
- - Null ref in highlighting/tooltips'.
-
-2010-04-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs: Added
- documentation and some additional overloads for
- ExecuteAssembly.
-
-2010-04-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs: Pass info to
- StartConsoleProcess separately instead of in a
- ProcessStartInfo, so it's clear what values are being
- passed.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/CompilationUnit.cs: Added special
- addusing method.
-
-2010-04-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessWrapper.cs:
- * MonoDevelop.Core.Execution/IProcessAsyncOperation.cs: Make
- IProcessAsyncOperation IDisposable.
-
-2010-04-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom.Parser/ProjectDom.cs: fixed
- cut&paste error.
-
-2010-04-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom.Parser/ProjectDom.cs: Improved
- dirty compiation unit merge.
-
-2010-04-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom.Parser/ProjectDom.cs:
- * MonoDevelop.Projects.Dom.Parser/ProjectDomService.cs: Added
- mergin of compilation units that contain errors.
-
-2010-04-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/DomReturnType.cs:
- * MonoDevelop.Projects.Dom.Serialization/DomPersistence.cs:
- * MonoDevelop.Projects.Dom.Serialization/CodeCompletionDatabase.cs:
- Optimized code completion database reading (saves up to ~20%
- file size of the code completion db files).
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/DomReturnType.cs: used a LRU method
- to prevent a memory leak of the return type cache.
-
-2010-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs: External
- console processes are now wrapped by a
- IProcessAsyncOperation interface, instead of a Process
- instance. In this way it is possible to create external
- consoles which are not directly bound to a process.
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/DomReturnType.cs:
- * MonoDevelop.Projects.Dom.Parser/ProjectDom.cs:
- * MonoDevelop.Projects.Dom.Parser/TypeResolverVisitor.cs:
- * MonoDevelop.Projects.Dom.Serialization/DomPersistence.cs:
- Re-enabled return type sharing for code completion database.
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom.Output/NetAmbience.cs: Print type
- name for constructors.
-
-2010-04-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects/ProjectFileCollection.cs: Properly
- check for child files.
-
- * MonoDevelop.Core/FileService.cs: Added CanonicalPath
- property.
-
-2010-04-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs: Fix build.
-
-2010-04-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs: Added null
- check on the result of the external console handler.
-
-2010-04-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects.Formats.MSBuild/SlnFileFormat.cs:
- Report a better error when there are two projects with the
- same guid. Fixes bug #545285 - When opening another
- solution, sometimes i got an error.
-
-2010-04-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects.Dom.Serialization/DomTypeProxy.cs: Use
- the new LoadClass method, which takes into account that the
- entry may already have been loaded. Fixes bug #586574 - Goto
- Type dialog throws a NullReferenceException.
-
- * MonoDevelop.Projects.Dom.Serialization/ClassEntry.cs:
- * MonoDevelop.Projects.Dom.Serialization/CodeCompletionDatabase.cs:
- Simplified ReadClass. The new LoadClass assigns the loaded
- class and returns the existing class if it was already
- loaded. Also, don't unload classes which have not been
- saved.
-
-2010-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/CompilationUnit.cs: ShortenTypeName
- now handles inner types.
-
-2010-04-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/CompilationUnit.cs:
- * MonoDevelop.Projects.Dom/ICompilationUnit.cs: Added Tag to
- compilation unit (to hold the original compilation unit).
-
-2010-04-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/LocalVariable.cs: Handled possible
- null ref.
-
-2010-04-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs:
- Improve configuration condition validation.
-
-2010-04-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Text/Formatter.cs:
- * MonoDevelop.Projects.Text/IPrettyPrinter.cs: Added a correct
- indenting method to the pretty printer (Bug 595587 - Move
- code block to correct depth when Alt+arrow moving).
-
-2010-04-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects/DotNetProject.cs: When checking if a
- project has to be built, return true if the mdb/pdb file is
- not up to date. Fixes bug #594959 - MD doesn't recompile
- when switching runtime.
-
-2010-04-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects/SolutionFolder.cs:
- * MonoDevelop.Projects.Formats.MSBuild/SlnFileFormat.cs:
- * MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectService.cs:
- * MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs:
- Add support for files added to solution folders.
-
-2010-04-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs:
- Add the Service element to the list of unsupported elements.
- Fixes bug #483716 - Strange "GUID" files are shown in
- projects.
-
-2010-04-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects/WorkspaceItem.cs:
- * MonoDevelop.Projects/ProjectService.cs:
- * MonoDevelop.Projects/FileFormatManager.cs:
- * MonoDevelop.Projects.Formats.MSBuild/SlnFileFormat.cs:
- Assign the correct format to the loaded solutions.
-
-2010-03-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects.Formats.MSBuild\MSBuildProjectService.cs:
- Fix resurce name generation in windows.
-
-2010-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects/ProjectService.cs: Make sure a full
- path is always used to read projects and solutions.
-
- * MonoDevelop.Projects/SolutionItem.cs: Added some timers.
-
-2010-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core.Execution/ProcessService.cs:
- * MonoDevelop.Core.Execution/ExternalConsoleLocator.cs: Moved
- external console creation to the platform service.
-
-2010-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.csproj: Don't do overflow checks.
-
-2010-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.StringParsing/IStringTagModel.cs: Make sure
- search on dictionary is case insensitive.
-
-2010-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs: Fix possible
- NRE.
-
-2010-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core.StringParsing:
- * MonoDevelop.Projects/Project.cs:
- * MonoDevelop.Projects/Solution.cs:
- * MonoDevelop.Projects/SolutionItem.cs:
- * MonoDevelop.Projects/WorkspaceItem.cs:
- * MonoDevelop.Projects/CustomCommand.cs:
- * MonoDevelop.Projects/ProjectService.cs:
- * MonoDevelop.Core/StringParserService.cs:
- * MonoDevelop.Projects/SolutionEntityItem.cs:
- * MonoDevelop.Projects/ProjectConfiguration.cs:
- * MonoDevelop.Core.StringParsing/StringTagModel.cs:
- * MonoDevelop.Core.StringParsing/IStringTagModel.cs:
- * MonoDevelop.Projects/DotNetProjectConfiguration.cs:
- * MonoDevelop.Core.StringParsing/StringTagProvider.cs:
- * MonoDevelop.Core.StringParsing/IStringTagProvider.cs:
- * MonoDevelop.Core.StringParsing/StringTagDescription.cs:
- * MonoDevelop.Core.StringParsing/StringTagModelDescription.cs:
- Reworked the string parser service. Added an extension point
- for registering tag providers. Added StringTagModel and
- StringTagModelDescription classes.
-
-2010-03-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/INode.cs: Added some node types.
-
-2010-03-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/INode.cs: Added method.
-
-2010-03-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs:
- Ignore duplicate references when loading a project. Fixes
- bug #582498 - Duplicate references break things.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Core.addin.xml: Bumped MD version.
-
-2010-03-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/CopyDomVisitor.cs: Handle parameter
- location.
-
-2010-03-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom/DomMethod.cs:
- * MonoDevelop.Projects.Dom/DomProperty.cs:
- * MonoDevelop.Projects.Dom/DomParameter.cs: Correctly set
- parameter declaring member.
-
-2010-03-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects.Policies/PolicyService.cs: Improved
- differential serialization. It can now properly serialize
- lists where items are added/removed.
-
- * MonoDevelop.Projects.Policies/PolicyBag.cs: Don't abort
- project loading if a policy can't be found.
-
-2010-03-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Instrumentation/TimeCounter.cs: This
- doesn't need to be public.
-
- * MonoDevelop.Core.Instrumentation/Counter.cs: Use better name
- for the duration property.
-
- * MonoDevelop.Core.Instrumentation/TimerCounter.cs: Added some
- statistics.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects.Dom.Parser/ProjectDomService.cs: Don't
- completely fail the loading of the solution data if one of
- the projects fails.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects.Dom.Serialization/CodeCompletionDatabase.cs:
- Bump db version because serialized headers are referencing
- the old MD.Projects assembly.
-
- * MonoDevelop.Projects.Dom/DomType.cs: Added null check.
-
-2010-03-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Projects.Dom.Parser/ProjectDom.cs:
- * MonoDevelop.Projects.Dom.Serialization/FileEntry.cs:
- * MonoDevelop.Projects.Dom.Parser/ProjectDomService.cs:
- * MonoDevelop.Projects.Dom.Parser/TypeResolverVisitor.cs:
- * MonoDevelop.Projects.Dom.Serialization/CodeCompletionDatabase.cs:
- * MonoDevelop.Projects.Dom.MemoryDatabase/ProjectMemoryProjectDom.cs:
- * MonoDevelop.Projects.Dom.Serialization/SimpleCodeCompletionDatabase.cs:
- * MonoDevelop.Projects.Dom.Serialization/AssemblyCodeCompletionDatabase.cs:
- Fixed 'Bug 553554 - MD takes a while to quit'.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- Merged MD.Projects into MD.Core, and MD.Projects.Gui,
- MD.Core.Gui and MD.Components into MD.Ide.
-
-2010-03-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/Runtime.cs:
- * MonoDevelop.Core.Instrumentation/Counter.cs:
- * MonoDevelop.Core.Instrumentation/CounterCategory.cs:
- * MonoDevelop.Core.Instrumentation/InstrumentationService.cs:
- Allow remote access to counter data.
-
-2010-03-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Instrumentation/TimeCounter.cs: Add missing
- null check.
-
-2010-03-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/PropertyBag.cs: Add missing null check.
-
-2010-03-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/StringParserService.cs: Added new
- CustomTagStore type, which can be used to put together
- several related tags for string parsing.
-
-2010-03-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core/Runtime.cs:
- * MonoDevelop.Core/LoggingService.cs:
- * MonoDevelop.Core.Instrumentation/Counter.cs:
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- * MonoDevelop.Core.Instrumentation/TimeCounter.cs:
- * MonoDevelop.Core.Instrumentation/TimerCounter.cs:
- * MonoDevelop.Core.Logging/InstrumentationLogger.cs:
- * MonoDevelop.Core.Instrumentation/InstrumentationService.cs:
- Add support for timers in the instrumentation service.
-
- * MonoDevelop.Core/PropertyBag.cs: Dispose should be public.
-
- * MonoDevelop.Core.Serialization/DataCollection.cs: Add setter
- indexer.
-
-2010-03-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/DataContext.cs: Initialize
- the data type before adding it to the name dictionary, since
- initialization may change the item name.
-
-2010-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/DataContext.cs:
- * MonoDevelop.Core.Serialization/PrimitiveDataType.cs: Added
- support for serializing time spans.
-
- * MonoDevelop.Core/PropertyBag.cs: Escape spaces in key names
- when saving the property bag to xml.
-
-2010-03-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * Mono.Options.cs:
- * MonoDevelop.Core.csproj: Added Mono.Options.
-
-2010-02-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/Runtime.cs:
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/MsNetTargetRuntime.cs: If the
- runtime is shutting down, stop the initialization of the
- system assembly service. Should fix bug #582511 - NRE in
- DirectoryAssemblyContext.OnUpdatePackage.
-
-2010-02-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/SystemAssemblyService.cs: New
- public method.
-
-2010-02-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/ClassDataType.cs: When a
- derived type is not found, try a direct type query before
- returning the fallback type. Fixes issue with .mdp loading.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core/IconId.cs: Implemented new IconId class
- which can be used to represent icon names and supports lazy
- loading of pixbufs.
-
-2010-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/TargetFrameworkNode.cs: Allow
- loading a framework description from a file.
-
-2010-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * frameworks/framework_NET_4_0.xml:
- * frameworks/framework_NET_2_0.xml:
- * frameworks/framework_NET_1_1.xml: Add missing assemblies.
-
-2010-02-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/DataContext.cs: Fix build.
-
-2010-02-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/DataContext.cs: Fix
- registering of extended properties.
-
-2010-02-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/DataContext.cs: (Revert
- revision 151674)
-
-2010-02-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Serialization/DataContext.cs: First attempt
- at fixing losing extended properties.
-
-2010-02-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/DataContext.cs: Add support
- for delayed loading of serializable types.
-
-2010-02-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/Runtime.cs:
- * MonoDevelop.Core/PropertyService.cs: Add startup trace
- calls.
-
-2010-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/Runtime.cs:
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs: Add startup
- trace calls.
-
- * MonoDevelop.Core/LoggingService.cs: Add startup trace
- method.
-
-2010-02-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/MonoRuntimeInfo.cs: Don't
- inherit the MONO_PATH var from the current process
- environment.
-
-2010-01-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/TargetFrameworkBackend.cs:
- Prefer using launch scripts for tools if they exist, rather
- than using the exes directly.
-
-2010-01-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core\Gettext.cs: Make languange selection work
- on windows.
-
-2010-01-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/Gettext.cs: Honor the custom language
- option.
-
-2010-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/FileService.cs: Add type and null checks on
- equality and hash.
-
-2010-01-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs:
- * MonoDevelop.Core.Execution/ExternalConsoleLocator.cs:
- Factorize code for setting env vars.
-
- * MonoDevelop.Core.ProgressMonitoring/SimpleProgressMonitor.cs:
- Fire the progress changed event when progress is completed.
-
- * MonoDevelop.Core/Properties.cs: Added null check.
-
-2009-12-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/AssemblyContext.cs: Don't fall
- back to returning current corlib if an exact match for a
- corlib assembly name can't be found, as this breaks composed
- assembly contexts. The first context will return current
- corlib, and the later assembly contexts - that contains the
- real corlib - are then not queried at all.
-
-2009-12-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/AssemblyContext.cs: When
- searching for an assembly by name, prefer framework
- assemblies. Consider all assemblies of same name when
- determining whether an assembly name is a framework
- assembly.
-
- * MonoDevelop.Core.Assemblies/SystemAssembly.cs: Add method
- for enumerating the NextSameName linked list.
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs: Block name
- conflicts with existing fx packages, not just name+version.
-
-2009-12-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/TargetFramework.cs: Fix a
- possible NRE that could prevent SystemAssemblyService from
- fully initializing.
-
-2009-12-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/AssemblyContext.cs: Always set
- the package name so that package name lookups work on
- framework packages.
-
-2009-12-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/AssemblyContext.cs: Fix
- framework package duplication for internal backend packages
- too.
-
-2009-12-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/AssemblyContext.cs: If package
- names are duplicated and one of them is a framework package,
- remove the others.
-
- * MonoDevelop.Core.Assemblies/MonoRuntimeInfo.cs: Remove
- unneeded env vars.
-
-2009-12-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs: Fix array
- resizing.
-
- * MonoDevelop.Core.Assemblies/TargetFramework.cs: Don't
- explode trying to create backend for unregistered Framework
- that has been created in respose to a request.
-
- * MonoDevelop.Core.Assemblies/SystemAssemblyService.cs: Log a
- warning when an unregistered TargetFramework is requested.
-
-2009-12-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Execution/IProcessAsyncOperation.cs:
- Implement a NullProcessAsyncOperation.
-
- * MonoDevelop.Core.ProgressMonitoring/NullAsyncOperation.cs:
- Open up the ctor to subclasses.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessWrapper.cs:
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs: Name threads
- to make debugging easier.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/Properties.cs: Only emit change events if
- the value actually changed, since there may be many event
- handlers listening for these events, so they can be quite
- costly.
-
-2009-11-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs:
- Exposed master monitor.
-
-2009-11-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/DotNetExecutionCommand.cs: Return
- a default target runtime when none is specified.
-
-2009-11-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Execution/DotNetExecutionCommand.cs: Missed
- file in last commit.
-
-2009-11-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/Runtime.cs: Moved add-in repo to
- monodevelop.com.
-
-2009-11-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/MonoRuntimeInfo.cs: Add doc
- comments about not using the Version string for version
- checks.
-
-2009-11-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/MonoRuntimeInfo.cs: Handle
- "/trunk/mono" in version string.
-
-2009-11-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/MonoRuntimeInfo.cs: Fix runtime
- detection.
-
-2009-11-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessWrapper.cs: Fix possible
- NRE.
-
-2009-11-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/MonoRuntimeInfo.cs: Improve
- detection of the current Mono version.
-
-2009-11-10 Jonathan Chambers <joncham@gmail.com>
-
- * MonoDevelop.Core.Assemblies/MonoTargetRuntimeFactory.cs:
- Support custom mono installations on all platforms.
-
-2009-11-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/MonoTargetRuntimeFactory.cs: Fix
- crash when removing a runtime.
-
-2009-11-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/MsNetFrameworkBackend.cs:
- Include the 2.0 clr tools path for the 3.5 framework.
-
-2009-11-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * frameworks/framework_NET_3_5.xml: Added missing assemblies.
-
- * MonoDevelop.Core.Assemblies/MonoFrameworkBackend.cs: Look
- for 3.5 assemblies in the 3.5 folder.
-
-2009-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * frameworks/framework_NET_4_0.xml:
- * frameworks/framework_NET_2_0.xml:
- * frameworks/framework_NET_1_1.xml: Put Mono.Cairo back again.
-
-2009-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/MsNetTargetRuntime.cs: Use a
- runtime-dependent method for getting the debug info file of
- an assembly.
-
-2009-11-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * frameworks/framework_NET_4_0.xml:
- * frameworks/framework_NET_2_0.xml: Add new Mono.Debugger.Soft
- assembly.
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core.Execution/LocalConsole.cs: Added IConsole
- implementation.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Core.addin.xml: Bump MD version.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * frameworks/framework_NET_4_0.xml:
- * frameworks/framework_NET_2_0.xml:
- * frameworks/framework_NET_1_1.xml: Exclude mono-cairo from
- the framework list.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies\MonoFrameworkBackend.cs:
- Properly resolve the vb compiler for Mono.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/ClassDataType.cs: Add missing
- null check. Fixes bug #549712.
-
-2009-10-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/SystemAssemblyService.cs: Fix
- race in runtime initialization. Fixes bug #524337 -
- PackageNotInstalled NRE error starting MonoDevelop.
-
-2009-10-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/PcFileCache.cs: It seems that
- the share pkgconfig directory should come before lib by
- default.
-
-2009-10-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/PlatformCondition.cs: Allow negating
- target platform.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Core.addin.xml: Bump MD version.
-
-2009-10-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/DataNode.cs:
- * MonoDevelop.Core.Serialization/DataItem.cs:
- * MonoDevelop.Core.Serialization/DataValue.cs:
- * MonoDevelop.Core.Serialization/DataCollection.cs: Made
- serializable.
-
- * MonoDevelop.Core.Serialization/DataContext.cs:
- * MonoDevelop.Core.Serialization/ClassDataType.cs: Improved
- the way types are resolved from deserialized names. Now a
- context can provide a custom resolver method. Also added
- support for serializing boxed primitive types.
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core.Serialization/BinaryDataSerializer.cs:
- Implemented a binary serializer.
-
- * MonoDevelop.Core.Assemblies/SystemAssemblyService.cs: Use
- cecil to read assembly names.
-
-2009-10-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core.ProgressMonitoring/AggregatedAsyncOperation.cs:
- Added async operation aggregator.
-
-2009-09-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/TargetFramework.cs:
- * MonoDevelop.Core.Assemblies/AssemblyContext.cs:
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/SystemAssemblyService.cs:
- Improve detection of the target framework of a library.
- Should fix bug #542333.
-
-2009-09-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/ItemProperty.cs: Allow
- getting the custom attributes of a property.
-
-2009-09-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/PcFileCache.cs:
- * MonoDevelop.Core.Assemblies/LibraryPcFileCache.cs: Added
- some notes.
-
-2009-09-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core.Assemblies/PcFileCache.cs: made
- PcFileCache.cs .NET2 compatible.
-
-2009-09-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core.Assemblies/PcFileCache.cs: Removed some
- debug code/fixed read/write package as proposed by lluis.
-
-2009-09-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core.Assemblies/PcFileCache.cs:
- * MonoDevelop.Core.Assemblies/SystemPackage.cs: Add Requires
- info to package data.
-
-2009-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * frameworks/framework_NET_4_0.xml: Added Microsoft.CSharp.
-
-2009-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/ClassDataType.cs: Propagate
- ReadOnly and WriteOnly from ItemPropertyAttribute to
- ItemProperty.
-
-2009-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.addin.xml:
- * MonoDevelop.Core.AddIns/PlatformCondition.cs: New platform
- condition, which allows enabling/disabling extensions
- depending on the current platform.
-
- * MonoDevelop.Core.Instrumentation/Counter.cs:
- * MonoDevelop.Core.Instrumentation/TimeCounter.cs:
- * MonoDevelop.Core.Instrumentation/InstrumentationService.cs:
- Initial support for timers.
-
- * Makefile.am:
- * MonoDevelop.Core.csproj: Added new files.
-
-2009-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies\MsNetTargetRuntime.cs: Don't
- crash if an assembly folder doesn't exist.
-
- * MonoDevelop.Core\Gettext.cs: Improve error reporting.
-
-2009-09-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/Gettext.cs: On windows, the catalog is
- located in a 'locale' subdir.
-
-2009-09-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies\MsNetTargetRuntime.cs:
- * MonoDevelop.Core.Assemblies\MsNetFrameworkBackend.cs: Scan
- folders registered in AssemblyFoldersEx keys.
-
-2009-09-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/MsNetFrameworkBackend.cs: On
- windows, include the MD startup path in the tools path list,
- since we may bundle some tools in the setup.
-
-2009-09-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/TargetFrameworkBackend.cs: In
- GetToolPaths, unquote quoted paths.
-
-2009-09-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessHostController.cs: Added a
- watch dog in mdhost. The process will exit if the main MD
- process dies.
-
- * MonoDevelop.Core.Assemblies/TargetFrameworkBackend.cs:
- Removed debug code.
-
-2009-09-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/TargetFrameworkBackend.cs: Log
- tool search paths.
-
-2009-09-02 Carlo Kok <ck@remobjects.com>
-
- * MonoDevelop.Core.Serialization/EnumDataType.cs: Use ignore-case
- on enums so both "winexe" and "WinExe" work.
-
-2009-08-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/DisposerFormatterSink.cs: The
- WaitHandle.WaitOne(int) method was added in an SP, so it is
- not available in all 3.5 frameworks.
-
-2009-08-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core/LoggingService.cs:
- * MonoDevelop.Core.Logging/RemoteLogger.cs:
- * MonoDevelop.Core.Execution/ProcessHostController.cs:
- * MonoDevelop.Core.Execution/IProcessHostController.cs: Allow
- routing log messages from external processes into the main
- MD process.
-
-2009-08-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/PcFileCache.cs: Don't try to
- store custom data if a package is not valid.
-
-2009-08-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/PcFileCache.cs: Another fix to
- make it build with .net 2.0.
-
-2009-08-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/PcFileCache.cs: Make it
- buildable with .net 2.0.
-
-2009-08-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core.Assemblies/PcFileCache.cs:
- * MonoDevelop.Core.Assemblies/SystemPackage.cs:
- * MonoDevelop.Core.Assemblies/AssemblyContext.cs:
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/LibraryPcFileCache.cs:
- * MonoDevelop.Core.Assemblies/DirectoryAssemblyContext.cs:
- Renamed some classes used by PcFileCache. Split PcFileCache
- in two files, to make it easier to reuse in Mono.Addins.
-
-2009-08-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs: Added an event
- which is fired when the runtime has finished initializing.
-
- * MonoDevelop.Core.Assemblies/SystemAssemblyService.cs: Load
- the user assembly context after the runtimes have been
- initialized.
-
- * MonoDevelop.Core.Assemblies/DirectoryAssemblyContext.cs:
- Don't update the packages until the current runtime has been
- initialized. It is required to find the target framework of
- the assemblies.
-
- * MonoDevelop.Core/Runtime.cs: Don't call shutdown here. The
- Main method does it.
-
-2009-08-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/SystemPackage.cs:
- * MonoDevelop.Core.Assemblies/AssemblyContext.cs:
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/SystemAssemblyService.cs:
- * MonoDevelop.Core.AddIns/PackageInstalledCondition.cs:
- * MonoDevelop.Core.Assemblies/DirectoryAssemblyContext.cs:
- Added support for user-defined assembly paths. MD will look
- for assemblies and .pc files in those paths.
-
-2009-08-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/PcFileCache.cs: Typo.
-
-2009-08-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/PcFileCache.cs: Store culture
- info.
-
-2009-08-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/PcFileCache.cs: Added method for
- resolving non-full assembly names.
-
-2009-08-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/AssemblyContext.cs: Make
- GetAssemblyForVersion work properly again.
-
-2009-08-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/PcFileCache.cs: Libraries list
- is stored in 'Libraries', not 'libraries.
-
-2009-08-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/AssemblyContext.cs:
- * MonoDevelop.Core.Assemblies/IAssemblyContext.cs:
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/MsNetTargetRuntime.cs:
- * MonoDevelop.Core.AddIns/PackageInstalledCondition.cs:
- * MonoDevelop.Core.Assemblies/SystemAssemblyService.cs:
- * MonoDevelop.Core.Assemblies/RuntimeAssemblyContext.cs:
- * MonoDevelop.Core.Assemblies/ComposedAssemblyContext.cs:
- * MonoDevelop.Core.Assemblies/DirectoryAssemblyContext.cs:
- Moved all assembly and package query methods to a new
- AssemblyContext class. TargetRuntime now has an instance of
- that class.
-
-2009-08-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/PcFileCache.cs: Use normalized
- assembly names when storing assemblies in the assembly
- dictionary.
-
-2009-08-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/PcFileCache.cs:
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/SystemPackage.cs:
- * MonoDevelop.Core.Assemblies/TargetFramework.cs:
- * MonoDevelop.Core.Assemblies/MonoRuntimeInfo.cs:
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs: Moved all
- related to parsing .pc files to PcFileCache. This class is
- now isolated from MD and can be reused for xbuild.
-
- * MonoDevelop.Core/Runtime.cs:
- * MonoDevelop.Core/FileService.cs: Added some counters.
-
-2009-08-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs: Remove
- duplicate pc file enumerating code.
-
-2009-08-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies\TargetRuntime.cs:
- * MonoDevelop.Core.Assemblies\MonoTargetRuntime.cs:
- * MonoDevelop.Core.Assemblies\MsNetTargetRuntime.cs: The
- target framework is required to get the msbuild path.
-
- * MonoDevelop.Core\Runtime.cs: Made initialization code more
- robust.
-
-2009-08-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/Runtime.cs: Added configuration option for
- enabling/disabling instrumentation.
-
-2009-08-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core/Runtime.cs:
- * MonoDevelop.Core.Instrumentation:
- * MonoDevelop.Core.Instrumentation/Counter.cs:
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- * MonoDevelop.Core.Execution/ProcessService.cs:
- * MonoDevelop.Core.Instrumentation/MemoryProbe.cs:
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs:
- * MonoDevelop.Core.Execution/ProcessHostController.cs:
- * MonoDevelop.Core.Instrumentation/CounterCategory.cs:
- * MonoDevelop.Core.Instrumentation/InstrumentationService.cs:
- Implemented basic instrumentation support.
-
-2009-08-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.AddIns/PackageInstalledCondition.cs:
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- Fix a race in the target runtime background initialization
- that particularly affected machines with many cores and fast I/O.
-
-2009-08-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * frameworks/framework_NET_3_0.xml:
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/SystemPackage.cs:
- * MonoDevelop.Core.Assemblies/TargetFramework.cs:
- * MonoDevelop.Core.Assemblies/MonoFrameworkBackend.cs:
- * MonoDevelop.Core.Assemblies/MsNetFrameworkBackend.cs:
- * MonoDevelop.Core.Assemblies/SystemAssemblyService.cs:
- * MonoDevelop.Core.Assemblies/TargetFrameworkBackend.cs:
- Changed a bit the object model to support the new assembly
- organization of the 3.0 framework. WFC is not part of mono,
- while there are other 3.0 assemblies provided by the olive
- package.
-
-2009-08-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/MonoRuntimeInfo.cs:
- Improve PKG_CONFIG_LIBDIR/PKG_CONFIG_PATH consistency.
- Should fix loading moonlight pc files.
-
-2009-07-31 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs: When trying to
- find newer versions of an assembly name, respect the fx
- version as well as the package.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core.Execution/IProcessHost.cs:
- * MonoDevelop.Core.Execution/ProcessService.cs:
- * MonoDevelop.Core.Execution/RemotingService.cs:
- * MonoDevelop.Core.Execution/RemoteProcessObject.cs:
- * MonoDevelop.Core.Execution/ProcessHostController.cs:
- * MonoDevelop.Core.Execution/DisposerFormatterSink.cs:
- * MonoDevelop.Core.Execution/IProcessHostController.cs:
- Changed the way MD comunicates with external processes. Now
- we are always using the IcpChannel, which is available in
- Linux and Windows. Also improved the way remote objects are
- disposed. A Dispose call on the object is now always
- guaranteed to succeed, even if the remote process has
- crashed.
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/MsNetTargetRuntime.cs: Added
- ExecuteAssembly method, which runs an assembly using a
- specific runtime environment. Also added MSBuildBinPath
- property to get the msbuild bin path for the runtime.
-
-2009-07-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs:
- RegisterRemotingChannel is now public.
-
- * MonoDevelop.Core.Assemblies/MonoFrameworkBackend.cs: Add
- support for xbuild.
-
-2009-07-28 Daniel Newton <djpnewton@gmail.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs: Quoted temp
- file argument in call to DotNetExecutionCommand.
-
-2009-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs: In
- GetAssemblyFullName, look for a matching name in the list of
- assemblies of the provided framework. Only if that fails,
- look for the assembly in the gac. It avoids returning
- assemblies which belong to another framework.
-
- * MonoDevelop.Core.Assemblies/TargetFramework.cs: Implement
- ToString.
-
-2009-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.addin.xml: Change order of frameworks, to
- give more priority to most recent frameworks.
-
- * MonoDevelop.Core.Assemblies/TargetFramework.cs:
- SubsetOfFramework is not public, required by the MSBuild
- handler.
-
-2009-07-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * frameworks/framework_NET_4_0.xml:
- * MonoDevelop.Core.Assemblies/MonoFrameworkBackend.cs: Add
- support for .NET 4.0 when targetting the mono runtime.
-
-2009-07-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- NormalizeAsmName is now public.
-
-2009-07-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/MonoTargetRuntimeFactory.cs:
- Don't explode when there isn't a Mono.framework directory.
- Allows MD to work on machines that only have Mono from
- source.
-
-2009-07-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/PropertyBag.cs: Added null check.
-
-2009-07-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/SystemAssemblyService.cs: Add
- sanity check.
-
-2009-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/DotNetExecutionCommand.cs:
- * MonoDevelop.Core.Execution/MonoPlatformExecutionHandler.cs:
- Add support for custom runtime arguments in the
- DotNetExecutionCommand.
-
-2009-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/MonoRuntimeInfo.cs: Add the
- libdata directory to the list of searched path so that
- monodevelop behaves correctly on FreeBSD. Patch by Romain
- Tartière.
-
-2009-07-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core.Execution/ProcessService.cs:
- * MonoDevelop.Core.Execution/IExecutionModeSet.cs:
- * MonoDevelop.Core.Execution/DefaultExecutionMode.cs:
- * MonoDevelop.Core.Execution/DefaultExecutionHandler.cs:
- * MonoDevelop.Core.Execution/DefaultExecutionHandlerFactory.cs:
- Added method for getting the default execution mode. Made
- the DefaultExecutionHandler class internal (use
- Runtime.ProcessService.DefaultExecutionHandler instead).
-
- * MonoDevelop.Core.Serialization/XmlDataSerializer.cs: Added
- overloads for serializing directly into a file.
-
- * MonoDevelop.Core/PropertyBag.cs: When deserializing an
- object store it in replacement of the old xml data.
-
- * MonoDevelop.Core/PropertyService.cs: Use FilePath for paths.
-
-2009-07-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessWrapper.cs: Don't abort
- the output and error capture threads when stopping the
- process. The threads will stop by themselves when the
- process exits. Aborting was especially problematic because
- the output capture thread is in charge of calling OnExit, so
- sometimes the thread was aborted before or while calling
- that method. Fixes bug #463321 - stop button on Gtk# app
- sometimes does not become disabled.
-
-2009-07-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.addin.xml:
- * MonoDevelop.Core.Execution/ProcessService.cs:
- * MonoDevelop.Core.AddIns/ExecutionModeSetNode.cs: Added new
- ModeSet extension node.
-
- * Makefile.am:
- * MonoDevelop.Core.csproj: Updated.
-
- * MonoDevelop.Core/PropertyBag.cs: Moved here from
- MonoDevelop.Projects.
-
- * MonoDevelop.Core/FileService.cs: Added method for notifying
- file removals.
-
-2009-06-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ExternalConsoleLocator.cs: Make
- sure gnome-terminal is spawned by MD and not by an existing
- terminal process. Fixes bug #494575 - Launch-in-terminal
- problem with gnome-terminal.
-
-2009-06-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/XmlDataSerializer.cs: Added
- overridables which allow changing the writer/reader to use
- for child items.
-
-2009-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/SystemAssembly.cs: Make assembly
- name consistent with "normalized" names.
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs: Use
- TargetFramework for assembly lookups. Prioritize framework
- assemblies over GAC assemblies.
-
-2009-06-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies\MsNetFrameworkBackend.cs: Fix
- framework location path.
-
-2009-06-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * frameworks:
- * Makefile.am:
- * frameworks.xml:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core.addin.xml:
- * frameworks/framework_NET_2_0.xml:
- * frameworks/framework_NET_1_1.xml:
- * frameworks/framework_NET_3_0.xml:
- * frameworks/framework_NET_4_0.xml:
- * frameworks/framework_NET_3_5.xml:
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/TargetFramework.cs:
- * MonoDevelop.Core.AddIns/TargetFrameworkNode.cs:
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/MsNetTargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/MonoFrameworkBackend.cs:
- * MonoDevelop.Core.Assemblies/MsNetFrameworkBackend.cs:
- * MonoDevelop.Core.Assemblies/SystemAssemblyService.cs:
- * MonoDevelop.Core.Assemblies/TargetFrameworkBackend.cs: Added
- extensibility support for frameworks. Now add-ins can define
- new frameworks and support for them for specific runtimes.
-
-2009-06-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies\MsNetTargetRuntime.cs: Added sdk
- tools path to the framework tools path.
-
-2009-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.ProgressMonitoring\LogTextWriter.cs: New
- override for TextWriter. Improves performance on Windows.
-
-2009-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Properties:
- * MonoDevelop.Core.Properties/IXmlConvertable.cs:
- * MonoDevelop.Core.Properties/PropertyFileLoadException.cs:
- * MonoDevelop.Core.Properties/UnknownPropertyNodeException.cs:
- Removed unused code.
-
-2009-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/XmlDataSerializer.cs: Added
- an option which allows storing all values as elements.
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs: Fix potential
- infinite loop
-
-2009-05-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution\ProcessService.cs: Fix crash on
- Windows.
-
- * MonoDevelop.Core.Assemblies\TargetRuntime.cs:
- * MonoDevelop.Core.Assemblies\MonoTargetRuntime.cs: In
- GetToolPath, change some tool names depending on the target
- framework.
-
- * MonoDevelop.Core\Runtime.cs: Use a special add-in repo for
- windows.
-
-2009-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/PropertyService.cs:
- * MonoDevelop.Core.Serialization/GenericCollectionHandler.cs:
- Avoid throwing some exceptions using preventive checks.
- Patch by Carlo Kok.
-
-2009-05-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution\ProcessHostController.cs: Someti
-
- * MonoDevelop.Core.Assemblies\MsNetTargetRuntime.cs: Fixed
- tools and assembly directories.
-
- * MonoDevelop.Core.Assemblies\TargetRuntime.cs:
- * MonoDevelop.Core.Assemblies\MonoTargetRuntime.cs: Some
- runtimes may require the target framework to get the tools
- paths.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * frameworks.xml:
- * frameworks-source.xml:
- * MonoDevelop.Core\ClrVersion.cs:
- * MonoDevelop.Core.Assemblies\TargetRuntime.cs:
- * MonoDevelop.Core.Assemblies\MsNetTargetRuntime.cs:
- * MonoDevelop.Core.Assemblies\SystemAssemblyService.cs: Added
- support for .net 4.0.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/SystemAssembly.cs: If an
- assembly has no token, don't add it.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/CollectionDataType.cs: Use
- the correct item type when initializing custom data
- serializers.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core\FileService.cs: Fix warning.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core\FileService.cs:
- * MonoDevelop.Core.Serialization\DataContext.cs:
- * MonoDevelop.Core.Serialization\PrimitiveDataType.cs: Use the
- new FilePath class for handling file and directory paths.
-
- * MonoDevelop.Core\PropertyService.cs: Store IsWindows and
- IsMac in readonly fields, which are faster than properties.
-
-2009-05-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core\Properties.cs: Fix file saving issue.
-
-2009-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core\Properties.cs:
- * MonoDevelop.Core\FileService.cs: Added method for doing
- atomic renames. Use it when saving properties.
-
-2009-05-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs: Make suer
- GetExecutionModes always reuses the IExecutionModeSet
- instances. Added class for keeping execution mode handler
- references.
-
- * MonoDevelop.Core.addin.xml: Don't add the default execution
- handler as a special execution mode.
-
- * MonoDevelop.Core.Assemblies/MonoTargetRuntimeFactory.cs:
- Automatically detect mono runtimes in some common install
- locations.
-
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs: Show the
- prefix in the display name.
-
-2009-05-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/MonoRuntimeInfo.cs:
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs: Add
- MOONLIGHT_2_SDK_PATH env var for using a non-installed
- Moonlight SDK.
-
-2009-05-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * frameworks.xml: Add assembly version for System.Windows.dll
- and System.Windows.Browser.dll.
-
-2009-05-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core.Assemblies/SystemPackage.cs:
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/SystemAssemblyService.cs: When
- parsing a .pc file, detect the target runtime of the package
- and store it in the cache.
-
- * MonoDevelop.Core.Assemblies/PcFileCache.cs: Store a cache
- version number in the cache file, so we can force a
- regeneration if the format changes.
-
-2009-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs: Added property
- for getting the default execution handler.
-
-2009-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessHostController.cs: Use the
- execution handler from the running runtime to fork external
- object processes.
-
- * MonoDevelop.Core.Execution/DotNetExecutionCommand.cs: Added
- DebugMode property.
-
- * MonoDevelop.Core.Execution/ProcessService.cs: Never show the
- console window when forking a process in Windows.
-
- * MonoDevelop.Core.Assemblies/MonoTargetRuntimeFactory.cs:
- Properly detect mono frameworks in windows.
-
- * MonoDevelop.Core.Assemblies/MsNetTargetRuntime.cs:
- Implemented GetToolsPaths.
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs: Added
- TargetFramework argument to GetToolPath, since tools may
- differ depending on the framework.
-
-2009-04-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * frameworks.xml:
- * frameworks-source.xml: Removed some invalid assemblies.
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs: If something
- goes wrong when getting an assembly name, just ignore the
- assembly.
-
-2009-04-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/ClassDataType.cs: When
- looking for ItemPropertyAttribute on a member, use
- inherit=false because if a base class already has an
- ItemProperty applied to the member, then that member will
- already have been added while copying props from the base
- class.
-
-2009-04-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * frameworks.xml:
- * frameworks-source.xml:
- * MonoDevelop.Core.Assemblies/SystemAssembly.cs:
- * MonoDevelop.Core.Assemblies/TargetFramework.cs:
- * MonoDevelop.Core.AddIns/PackageExtensionNode.cs:
- * MonoDevelop.Core.Assemblies/SystemAssemblyService.cs: The
- frameworks.xml file now contains full assembly info. There
- is no need to scan the frameworks assemblies anymore. Added
- some code which can be used to update that file.
-
- * MonoDevelop.Core.Serialization/DataType.cs: Get a better
- default element name for generic types.
-
- * MonoDevelop.Core.Serialization/DictionaryDataType.cs: Fix
- bug in creation of dictionary type maps.
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core.Assemblies/PcFileCache.cs:
- * MonoDevelop.Core.Assemblies/SystemPackage.cs:
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs: Added a
- .pc file cache, to avoid having to scan all pc files every
- time MD starts.
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs: Load framework
- assembly data from the frameworks.xml file. The core package
- for a framework now don't include assemblies from extended
- frameowrks. Those assemblies will now be available from the
- original packages.
-
-2009-04-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs: If a .pc
- file has a Libraries var, get the assemblies list from it
- instead of taking it from "Libs".
-
-2009-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core/FileService.cs: Fixed wrong invalid chars.
-
-2009-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core/FileService.cs: Fixed "Bug 492716 - #
- characters are not supported in path names in Preferences
- dialog".
-
-2009-04-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs: Added
- public property for getting the install prefix.
-
- * MonoDevelop.Core.Assemblies/MonoRuntimeInfo.cs: Properly
- expand vars when initializing the runtime environment.
-
-2009-04-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/MonoTargetRuntimeFactory.cs:
- Detect available runtimes on Mac.
-
-2009-04-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/PropertyService.cs: Add an IsMac property.
-
-2009-04-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/MonoTargetRuntimeFactory.cs: Log
- exception. Use new API for getting current runtime's info.
-
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs: Remove all
- code for detecting the current environment, since that now
- comes in a MonoRuntimeInfo parameter object. Restore
- GetToolsEnvironmentVariables overload.
-
- * MonoDevelop.Core.Assemblies/MonoRuntimeInfo.cs: Add code to
- create a MonoRuntimeInfo for the current runtime, and unify
- the pkg-config detection codepaths. Use PKG_CONFIG_LIBDIR to
- ensure pkgconfig has the exact set of paths MD does.
-
-2009-04-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * frameworks.xml: Remove invalid assemblies.
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core.addin.xml:
- * MonoDevelop.Core.Assemblies/MsNetTargetRuntime.cs:
- * MonoDevelop.Core.Execution/MsNetExecutionHandler.cs:
- * MonoDevelop.Core.Assemblies/MsNetTargetRuntimeFactory.cs:
- * MonoDevelop.Core.Execution/NativePlatformExecutionHandler.cs:
- Initial support for the MS.NET runtime.
-
- * MonoDevelop.Core.Assemblies/MonoTargetRuntimeFactory.cs:
- Autodetect mono runtimes when running on windows.
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs: Don't use
- an external process for locating assemblies from partial
- names. Implemented the logic by looking at directories. Add
- support for multiple gac paths.
-
- * MonoDevelop.Core.Assemblies/SystemAssembly.cs:
- * MonoDevelop.Core.Assemblies/SystemAssemblyService.cs: Added
- GetAssemblyName method that works around a bug in
- mono/windows (AssemblyName.GetAssemblyName is not case
- insensitive).
-
- * MonoDevelop.Core/FileService.cs: Fixed file name and path
- validation methods, so they work for Windows.
-
- * MonoDevelop.Core/PropertyService.cs: Added property for
- checking if we are running on windows.
-
-2009-04-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs:
- * MonoDevelop.Core.Execution/ExecutionCommand.cs:
- * MonoDevelop.Core.Execution/IExecutionHandler.cs:
- * MonoDevelop.Core.Execution/ProcessHostController.cs:
- * MonoDevelop.Core.Execution/DotNetExecutionHandler.cs:
- * MonoDevelop.Core.Execution/DotNetExecutionCommand.cs:
- * MonoDevelop.Core.Execution/NativeExecutionCommand.cs:
- * MonoDevelop.Core.Execution/ProcessExecutionCommand.cs:
- * MonoDevelop.Core.Execution/MonoPlatformExecutionHandler.cs:
- * MonoDevelop.Core.Execution/NativePlatformExecutionHandler.cs:
- * MonoDevelop.Core.Execution/DefaultExecutionHandlerFactory.cs:
- Changed the way IExecutionHandler works. It now takes an
- ExecutionCommand as parameter. ExecutionCommand subclasses
- contains all required data to execute a command.
- IExecutionHandler can be specialized on specific subtypes of
- ExecutionCommand.
-
- * MonoDevelop.Core.addin.xml:
- * MonoDevelop.Core.Execution/ExecutionMode.cs:
- * MonoDevelop.Core.Execution/IExecutionModeSet.cs:
- * MonoDevelop.Core.Assemblies/CustomRuntimeExecutionModeSet.cs:
- Added support for IExecutionModeSet. It is a factory of
- related execution modes. For example, debuggers or
- profilers.
-
- * MonoDevelop.Core.Assemblies/MonoRuntimeInfo.cs:
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs:
- * MonoDevelop.Core.Assemblies/SystemAssemblyService.cs:
- * MonoDevelop.Core.Assemblies/MonoTargetRuntimeFactory.cs: Add
- support for mono runtimes installed in prefixes other than
- the current runtime.
-
- * Makefile.am:
- * MonoDevelop.Core.csproj: Added new Files.
-
-2009-04-17 Jason Smith <jassmith@gmail.com>
-
- * MonoDevelop.Core.Assemblies/SystemAssemblyService.cs: Add
- runtimes to the runtime list during initialization.
-
-2009-04-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs: Set the
- pkgconfig environment more accurately for child processes
- and tools.
-
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs: Add a
- GetToolsEnvironmentVariables method for setting up the
- environment for tools with this runtime.
-
-2009-04-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Assemblies:
-
- * MonoDevelop.Core/TargetRuntime.cs:
- * MonoDevelop.Core/SystemPackage.cs:
- * MonoDevelop.Core/SystemAssembly.cs:
- * MonoDevelop.Core/TargetFramework.cs:
- * MonoDevelop.Core/MonoTargetRuntime.cs:
- * MonoDevelop.Core/SystemAssemblyService.cs:
- * MonoDevelop.Core/MonoTargetRuntimeFactory.cs: Moved
- SystemAssemblyService and related classes to the namespace
- MonoDevelop.Core.Assemblies.
-
-2009-04-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core.addin.xml:
- * MonoDevelop.Core.Assemblies:
- * MonoDevelop.Core/Runtime.cs:
- * MonoDevelop.Core.Assemblies/SystemPackage.cs:
- * MonoDevelop.Core.Assemblies/TargetRuntime.cs:
- * MonoDevelop.Core.Execution/ProcessService.cs:
- * MonoDevelop.Core.Assemblies/SystemAssembly.cs:
- * MonoDevelop.Core.Assemblies/TargetFramework.cs:
- * MonoDevelop.Core.AddIns/PackageExtensionNode.cs:
- * MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs:
- * MonoDevelop.Core.AddIns/ITargetRuntimeFactory.cs:
- * MonoDevelop.Core.AddIns/PackageInstalledCondition.cs:
- * MonoDevelop.Core.Assemblies/SystemAssemblyService.cs:
- * MonoDevelop.Core.Assemblies/MonoTargetRuntimeFactory.cs:
- Moved SystemAssemblyService and related classes to the
- namespace MonoDevelop.Core.Assemblies.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Core.addin.xml: Bump MD version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * frameworks.xml:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core.addin.xml:
- * MonoDevelop.Core/Runtime.cs:
- * MonoDevelop.Core/SystemPackage.cs:
- * MonoDevelop.Core/TargetRuntime.cs:
- * MonoDevelop.Core/SystemAssembly.cs:
- * MonoDevelop.Core/TargetFramework.cs:
- * MonoDevelop.Core/MonoTargetRuntime.cs:
- * MonoDevelop.Core/SystemAssemblyService.cs:
- * MonoDevelop.Core/MonoTargetRuntimeFactory.cs:
- * MonoDevelop.Core.AddIns/PackageExtensionNode.cs:
- * MonoDevelop.Core.AddIns/ITargetRuntimeFactory.cs:
- * MonoDevelop.Core.AddIns/PackageInstalledCondition.cs:
- Initial support for multiple target runtimes.
-
- * MonoDevelop.Core.Execution/MonoPlatformExecutionHandler.cs:
- * MonoDevelop.Core.Execution/NativePlatformExecutionHandler.cs:
- Allow specifying a default set of env vars to be defined
- when creating a new process.
-
- * MonoDevelop.Core.Execution/ProcessService.cs: Allow
- specifying the target runtime to use when creating an
- external process object.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core/ComponentModelLocalization.cs: Fixed
- Header.
-
-2009-03-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core.ProgressMonitoring/SimpleProgressMonitor.cs:
- Added new progress monitor which implements the most basic
- progress tracking functionality.
-
-2009-03-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core/XmlReadHelper.cs: Improved error handing.
-
-2009-03-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core.addin.xml:
- * MonoDevelop.Core.Execution/IExecutionMode.cs:
- * MonoDevelop.Core.Execution/ProcessService.cs:
- * MonoDevelop.Core.AddIns/ExecutionModeNode.cs:
- * MonoDevelop.Core.Execution/IExecutionHandler.cs:
- * MonoDevelop.Core.AddIns/ExecutionHandlerCodon.cs:
- * MonoDevelop.Core.Execution/ProcessHostController.cs:
- * MonoDevelop.Core.Execution/IExecutionHandlerFactory.cs:
- * MonoDevelop.Core.Execution/MonoPlatformExecutionHandler.cs:
- * MonoDevelop.Core.Execution/MintPlatformExecutionHandler.cs:
- * MonoDevelop.Core.Execution/DefaultExecutionHandlerFactory.cs:
- * MonoDevelop.Core.Execution/NativePlatformExecutionHandler.cs:
- Changed the way execution handlers work. We are not using
- platform ids anymore. Instead, we use command strings when
- looking for execution handlers. IExecutionHandlerFactory has
- been removed and now everything is handled by
- IExecutionHandler, which has a new CanExecute method. This
- model is more simple and more generic.
-
-2009-02-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: Fixed logic for
- detecting gac packages. Don't consider a package a gac
- package if it contains at least one assembly with an
- absolute path outside the mono directory.
-
-2009-02-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: In
- GetAssemblyFromFullName, if package is null, prefer GAC
- packages.
-
-2009-02-26 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.csproj:
- * MonoDevelop.Core/ComponentModelLocalization.cs: Worked on
- propertygrid localization.
-
-2009-02-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/ItemProperty.cs: An element
- which only has the ctype (type name) attribute is now
- considered empty when checking the SkipEmpty property.
-
-2009-02-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: Add
- Mac-compatible pkgconfig sniffing
-
-2009-02-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core/StringParserService.cs: fixed "Bug 456971 -
- ${ProjectDir} Not updating for currently building project".
-
-2009-02-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: Added some logic
- for automatically checking if a package is GACed or not.
-
-2009-02-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * frameworks.xml: Added mscorlib to frameworks.
- System.Deployment belongs to 2.0.
-
- * MonoDevelop.Core.Execution/ProcessService.cs:
- * MonoDevelop.Core.Execution/ProcessHostController.cs: Allow
- specifying an execution handler when creating a remote
- process object. Added method for explicitly disposing a
- remote object with a timeout.
-
- * Makefile.am:
- * MonoDevelop.Core.csproj: Updated.
-
- * MonoDevelop.Core/SystemPackage.cs:
- * MonoDevelop.Core/SystemAssembly.cs:
- * MonoDevelop.Core/SystemAssemblyService.cs: Improved handling
- of assemblies with the same version provided by different
- packages. Added support for IsGacPackage flag.
-
-2009-02-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/DataContext.cs: Added api for
- getting the list of registered types.
-
-2009-02-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Serialization/ClassDataType.cs:
- * MonoDevelop.Core.Serialization/DataSerializer.cs:
- * MonoDevelop.Core.Serialization/SerializationContext.cs: Add
- a flag for including default values in the serialized
- output. Doesn't include nulls.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.csproj: Don't treat warning as errors,
- because csc still outputs warnings for this project.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.mdp:
- * MonoDevelop.Core.csproj: Migrated to MSBuild file format.
-
-2009-02-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: Expose some
- pkgconfig path information and helpers for non-.NET addins
- to use.
-
-2009-02-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.mdp:
- * MonoDevelop.Core.addin.xml:
- * MonoDevelop.Core.AddIns/PackageInstalledCondition.cs: Added
- new condition types for checking if a package is installed.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Core.addin.xml: Bump MD version.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * frameworks.xml: Put Mono.Cairo back to the core mono
- package, since the runtime remaps that assembly version to
- the running mscorlib version.
-
-2009/01/30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Serialization/XmlMapAttributeProvider.cs:
- Add skipEmpty support to xml serialization maps.
-
-2009-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/StringParserService.cs: Add support for formatting
- strings in tags.
-
-2009-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * frameworks.xml: Remove Mono.Cairo from the framework since it has its
- own package.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.mdp: Flush project format changes.
-
-2009-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/DataContext.cs:
- * MonoDevelop.Core.Serialization/ItemProperty.cs:
- * MonoDevelop.Core.Serialization/ClassDataType.cs:
- * MonoDevelop.Core.Serialization/ItemPropertyAttribute.cs: Added support
- for SkipEmpty in the serializer. When set to true for a property, if
- the element generated by the property is empty, it will not be
- serialized.
-
-2009-01-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.addin.xml: Update copyright. Remove unnecessary
- assembly import.
-
-2009-01-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Serialization/XmlDataSerializer.cs: Allow
- XmlDataSerializer to wrap an existing DataSerializer instead of
- creating one in the constructor.
-
-2009-01-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.mdp:
- * MonoDevelop.Core.ProgressMonitoring/AsyncOperation.cs: Added default
- implementation of IAsyncOperation
-
-2009-01-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: Handle PKG_CONFIG_LIBDIR.
- If it's not set, sniff for the install prefixes of MD, Mono and
- pkg-config and the associated pkgconfig directories.
-
-2009-01-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: In GetAssemblyLocation,
- added fast path for mscorlib.
-
-2009-01-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/FileService.cs: Fix logic for IsInvalidFileName.
-
-2008-12-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/DataContext.cs: Allow registering new
- properties which are not external.
-
-2008-12-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.mdp: Updated.
-
- * MonoDevelop.Core/FileService.cs: Added method for checking validity of
- paths.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * frameworks.xml: Add missing lib.
-
- * Makefile.am:
- * MonoDevelop.Core.mdp:
- * MonoDevelop.Core/PropertyService.cs:
- * MonoDevelop.Core/SystemAssemblyService.cs:
- * MonoDevelop.Core.ProgressMonitoring/NullAsyncOperation.cs: No more
- warnings.
-
-2008-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: Added method for checking
- if an assembly is in the gac.
-
-2008-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: Nullref fixes.
-
-2008-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * frameworks.xml:
- * MonoDevelop.Core.mdp:
- * MonoDevelop.Core/SystemPackage.cs:
- * MonoDevelop.Core/TargetFramework.cs:
- * MonoDevelop.Core/SystemAssemblyService.cs:
- * MonoDevelop.Core.AddIns/PackageExtensionNode.cs:
- * MonoDevelop.Core.Serialization/ISerializationAttributeProvider.cs:
- Implemented support for multiple frameworks in SystemAssemblyService.
- Until now it was supporting multiple CLRs, but this model did not fit
- very well with the Visual Studio model.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.mdp: Don't require a specific version of Mono.Addins.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/IAsyncOperation.cs:
- * MonoDevelop.Core.Execution/ProcessWrapper.cs:
- * MonoDevelop.Core.ProgressMonitoring/NullAsyncOperation.cs:
- * MonoDevelop.Core.ProgressMonitoring/NullProgressMonitor.cs:
- * MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs:
- Implement new SuccessWithWarnings property.
-
-2008-12-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Make it work for parallel builds.
-
- * MonoDevelop.Core/PropertyService.cs: Set the FirstRun flag when the
- properties file is not present.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Core.mdp: Fix Makefile integration for AssemblyInfo.cs
- files.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * AssemblyInfo.cs:
- * AssemblyInfo.cs.in:
- * MonoDevelop.Core.mdp: Add AssemblyInfo.cs files that are autogenerated
- from the addin manifests.
-
-2008-11-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/Properties.cs: Copy properties file to backup when
- saving it. Restore the backup if the save fails.
-
- * MonoDevelop.Core/PropertyService.cs: Catch and report errors when
- loading config file, and fall back to trying previous settings file.
- Prevents MD crash.
-
- Should fix Bug 442567 - Crash at shutdown lost all setting.
-
-2008-11-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/Gettext.cs: Fix some obsoletion warnings by using
- Mono.Unix.Catalog instead of Mono.Posix.Catalog.
-
-2008-11-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessHostController.cs: Windows doesn't
- like single quotes when specifying arguments to a process.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.addin.xml: Bump MD version.
-
-2008-10-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessWrapper.cs: Fix bug 436200 - Crash
- when stopping a process execution.
-
-2008-10-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/GenericCollectionHandler.cs: Added
- protection against multiple Add methods in a class.
-
-2008-10-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.mdp, Makefile.am,
- MonoDevelop.Core/GettextCatalog.cs, MonoDevelop.Core/Gettext.cs:
- Replaced GettextCatalog.
-
-2008-10-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.AddIns/ServiceExtensionNode.cs,
- MonoDevelop.Core.Execution/ProcessService.cs,
- MonoDevelop.Core.addin.xml, MonoDevelop.Core.mdp, Makefile.am,
- MonoDevelop.Core/Runtime.cs, MonoDevelop.Core/AbstractService.cs,
- MonoDevelop.Core/ServiceManager.cs,
- MonoDevelop.Core/SystemAssemblyService.cs,
- MonoDevelop.Core/IService.cs: Remove service APIs.
-
-2008-09-16 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessWrapper.cs: null check to avoid
- NREs. Fixes #418650.
-
-2008-09-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/XmlMapAttributeProvider.cs: Allow
- chaining several serialization maps for a type.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Collections/ReadOnlyDictionary.cs,
- MonoDevelop.Core.mdp, Makefile.am: Implemented new
- ReadOnlyDictionary class.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Collections/Set.cs: The Add method now returns true
- if the item was not already present. False otherwise.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Collections, MonoDevelop.Core.Collections/Set.cs,
- MonoDevelop.Core.mdp, Makefile.am: Added Set collection.
-
-2008-08-28 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.Core.Execution/ExternalConsoleLocator.cs: Fix xterm launch string.
-
-2008-08-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/ClassDataType.cs: Add missing null
- check.
-
-2008-08-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/ClassDataType.cs: When deserializing
- nested properties, make sure the nesting element is not added as
- unknown element unless it actually contains unknown properties.
- Fixes bug #403847.
-
-2008-08-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/XmlReadHelper.cs: Add stack trace to error message,
- replace a 'goto', and fix bug that skipped nodes with same name as
- start node.
-
-2008-07-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: Catched possible
- exception.
-
-2008-07-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessWrapper.cs,
- MonoDevelop.Core.Execution/ProcessService.cs: Work around Mono bug
- 410743 - "wapi leak in System.Diagnostic.Process". Fixes "Bug
- 410740 - ProcessWrapper leaks wapi handles".
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Serialization/DataContext.cs,
- MonoDevelop.Core.Serialization/ISerializationAttributeProvider.cs,
- MonoDevelop.Core.Serialization/XmlMapAttributeProvider.cs: Moved
- serialization engine to MonoDevelop.Core. Use new syntax for
- specifying attribute scope.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am, MonoDevelop.Core.Serialization,
- MonoDevelop.Core.Serialization/DataType.cs,
- MonoDevelop.Core.Serialization/ArrayHandler.cs,
- MonoDevelop.Core.Serialization/DataContext.cs,
- MonoDevelop.Core.Serialization/TypeAttributeProvider.cs,
- MonoDevelop.Core.Serialization/IExtendedDataItem.cs,
- MonoDevelop.Core.Serialization/SerializationContext.cs,
- MonoDevelop.Core.Serialization/ISerializationAttributeProvider.cs,
- MonoDevelop.Core.Serialization/DataCollection.cs,
- MonoDevelop.Core.Serialization/ItemPropertyAttribute.cs,
- MonoDevelop.Core.Serialization/DataItem.cs,
- MonoDevelop.Core.Serialization/ICustomDataItemHandler.cs,
- MonoDevelop.Core.Serialization/XmlMapAttributeProvider.cs,
- MonoDevelop.Core.Serialization/DataIncludeAttribute.cs,
- MonoDevelop.Core.Serialization/DictionaryDataType.cs,
- MonoDevelop.Core.Serialization/ClassDataType.cs,
- MonoDevelop.Core.Serialization/ICollectionHandler.cs,
- MonoDevelop.Core.Serialization/IPropertyFilter.cs,
- MonoDevelop.Core.Serialization/ItemProperty.cs,
- MonoDevelop.Core.Serialization/DataItemAttribute.cs,
- MonoDevelop.Core.Serialization/DataNode.cs,
- MonoDevelop.Core.Serialization/XmlDataSerializer.cs,
- MonoDevelop.Core.Serialization/GenericCollectionHandler.cs,
- MonoDevelop.Core.Serialization/CollectionDataType.cs,
- MonoDevelop.Core.Serialization/ExpandedCollectionAttribute.cs,
- MonoDevelop.Core.Serialization/EnumDataType.cs,
- MonoDevelop.Core.Serialization/DataSerializer.cs,
- MonoDevelop.Core.Serialization/PrimitiveDataType.cs,
- MonoDevelop.Core.Serialization/XmlElementDataType.cs,
- MonoDevelop.Core.Serialization/DataValue.cs,
- MonoDevelop.Core.Serialization/ArrayListHandler.cs,
- MonoDevelop.Core.mdp: Moved serializer to MD.Core.
-
-2008-06-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/Runtime.cs: Write application error messages to the
- console.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.addin.xml: Bump MD version.
-
-2008-06-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/ExecutionModeNode.cs,
- MonoDevelop.Core.Execution/IExecutionMode.cs,
- MonoDevelop.Core.Execution/DefaultExecutionHandlerFactory.cs,
- MonoDevelop.Core.Execution/ProcessService.cs,
- MonoDevelop.Core.Execution/ExecutionPlatform.cs, Makefile.am,
- MonoDevelop.Core.addin.xml, MonoDevelop.Core.mdp: Implemented
- IExecutionMode. And execution mode is basically an
- IExecutionHandlerFactory with a name. There will be several
- execution modes, such as Debug, Profile, etc.
- * MonoDevelop.Core.Execution/IExecutionHandlerFactory.cs: Added new
- SupportsPlatform method for checking if a handler is supported for
- a platform.
- * MonoDevelop.Core.Logging/ConsoleLogger.cs: Fix warning.
-
-2008-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs: If a process is
- terminated by a signal, log the signal name. Fixes bug #368482.
-
-2008-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/IConsole.cs,
- MonoDevelop.Core.Execution/ExternalConsoleFactory.cs: Added logging
- support to IConsole.
- * MonoDevelop.Core.Execution/ProcessWrapper.cs: Fix locking.
- * MonoDevelop.Core.Execution/ProcessService.cs: Log the exit code if it
- is not zero.
-
-2008-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessWrapper.cs,
- MonoDevelop.Core.Execution/ProcessService.cs: Read output from
- process by blocks, not by lines. Fixes bug 368479 - Delayed printf
- from a gtk+ app in MD.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/Properties.cs, MonoDevelop.Core/PropertyService.cs,
- MonoDevelop.Core/SystemAssemblyService.cs: New project model
- changes.
-
-2008-04-29 Aaron Bockover <abock@gnome.org>
-
- * MonoDevelop.Core.Execution/ProcessService.cs: Use the new
- ExternalConsoleLocator instead of hardcoding xterm when running builds
- on an external console
-
- * MonoDevelop.Core.Execution/ExternalConsoleLocator.cs: First pass at
- reasonably resolving a working and preferred terminal for Linux users;
- currently only uses GNOME Terminal if running under GNOME, xterm otherwise;
- can be easily extended for Konsole, but it was acting strange when I tried,
- so someone else needs to do this if there's interest; also this is sort
- of a temporary measure in part until the external console stuff can be
- properly moved into the platform service layer so it'll work on Windows
- and OS X along with various Linux/DE flavors
-
- * Makefile.am:
- * MonoDevelop.Core.mdp: Updated build with new file
-
-2008-03-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Logging/ConsoleCrayon.cs,
- MonoDevelop.Core.Logging/ConsoleLogger.cs, Makefile.am,
- MonoDevelop.Core.mdp, MonoDevelop.Core/LoggingService.cs: Enable console
- logging in colour by default. Thanks to Aaron Bockover for the
- ConsoleCrayon workaround -- we now "manually" handle emitting console
- colour codes on Mono, because its terminfo driver can leave the console
- unusable if the app crashes.
-
-2008-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: Don't install packages provided
- by add-ins that already exist in the system.
-
-2008-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.ProgressMonitoring/ConsoleProgressStatus.cs: Allow
- specifying the log level.
-
-2008-02-15 Geoff Norton <gnorton@novell.com>
-
- * MonoDevelop.Core/Runtime.cs: Only pinvoke libc on unix.
-
-2008-02-15 Geoff Norton <gnorton@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs: Disable .NET remoting
- security on the TCP channel.
-
-2008-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/Properties.cs: Improve performance of Get method.
-
-2008-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessWrapper.cs: Add a WaitForOutput overload
- with a time limit.
-
-2008-02-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/Runtime.cs: Use MD's config directory for addin engine
- too. More cross-platform safe, and ensures that they're always the same
- directory (previously, unusual combinations of environment variables
- could cause them to differ).
- * MonoDevelop.Core/PropertyService.cs: Make config directory more
- cross-platform safe.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.addin.xml: Update MD version.
-
-2008-01-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/GettextCatalog.cs: Fix logic that determines the location
- of locale directory.
-
-2008-01-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/FileService.cs: Make NotifyFileChanged safer against
- exceptions.
-
-2008-01-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.ProgressMonitoring/NullProgressMonitor.cs: Added new
- override.
- * MonoDevelop.Core/Runtime.cs: Use a version specific default MD add-in
- repo.
-
-2008-01-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessHostController.cs:
- If MD is running in debug mode (i.e. stack traces have line numbers)
- then the process hosting RemoteProcessObjects should be in debug
- mode too. Also, remove an "sh" call to improve portability.
-
-2008-01-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/Runtime.cs: Get add-ins from a version specific
- repository.
-
-2008-01-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am, MonoDevelop.Core.mdp, MonoDevelop.Core/GettextCatalog.cs,
- MonoDevelop.Core/GettextCatalog.cs.in: Make Gettext catalogue path
- relative to MD rather than hardcoding the prefix set at build time.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am, MonoDevelop.Core.addin.xml, MonoDevelop.Core.mdp,
- MonoDevelop.Core/Runtime.cs, MonoDevelop.Core/DesktopApplication.cs,
- MonoDevelop.Core/PlatformService.cs: Moved PlatformService to
- MD.Core.Gui. Removed old FileIconService class, which is now implemented
- in PlatformService.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs: Fix warning.
- * MonoDevelop.Core.mdp: Updated.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: Catch exceptions thrown by
- ParsePCFile. Fixes bug #346295.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.addin.xml: Bump add-in versions.
-
-2007-12-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: Catch exception when pkg-config
- can't be executed. Catch top-level unhandled exceptions in background
- initialisation thread to stop MD dying on Mono 1.2.6.
- * MonoDevelop.Core/LoggingService.cs: Add some newlines to the log messages
- when an exception is being logged, to improve readability.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/PackageExtensionNode.cs,
- MonoDevelop.Core.AddIns/ServiceExtensionNode.cs,
- MonoDevelop.Core.AddIns/ExecutionHandlerCodon.cs,
- MonoDevelop.Core.Execution/ProcessService.cs,
- MonoDevelop.Core.FileSystem/DefaultFileSystemExtension.cs,
- MonoDevelop.Core.addin.xml: API cleanup.
-
-2007-12-07 Geoff Norton <gnorton@novell.com>
-
- * MonoDevelop.Core/PlatformService.cs: Add fallback mime-type support
- for ChangeLogs.
-
-2007-12-06 Geoff Norton <gnorton@novell.com>
-
- * MonoDevelop.Core/PlatformService.cs: New service to hand off the
- platform specific operations to platform-specific addins. Operations
- such as Mime, Font, DefaultApplication and Icons (anything that
- touches Gnome) is abstracted for now.
- * MonoDevelop.Core/Runtime.cs: Expose a static PlatformService to the
- system.
- * MonoDevelop.Core/DesktopApplication.cs: Move this from
- MonoDevelop.Core.Gui as it needs to be available from
- PlatformService.cs. Refactor the actual commands that get the
- applications into the PlatformService
- * Makefile.am: Add PlatformService.cs and DesktopApplication.cs to
- the build.
- * MonoDevelop.Core.addin.xml: Register a new ExtensoinPoint for the
- PlatformService
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am, MonoDevelop.Core.mdp: Directory reorganization.
-
-2007-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs: Added
- property to disable message logging.
-
-2007-11-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: Update SupportedVersions
- depending on which ClrVersions were registered successfully.
-
-2007-11-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/ClrVersion.cs, MonoDevelop.Core/SystemAssemblyService.cs:
- Add the 2.1 profile.
-
-2007-11-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/PackageExtensionNode.cs,
- MonoDevelop.Core.AddIns/AssemblyExtensionNode.cs,
- MonoDevelop.Core.AddIns/ServiceExtensionNode.cs,
- MonoDevelop.Core.AddIns/ApplicationExtensionNode.cs,
- MonoDevelop.Core.Execution/ProcessService.cs,
- MonoDevelop.Core.ProgressMonitoring/ConsoleProgressStatus.cs,
- MonoDevelop.Core.FileSystem/FileSystemExtension.cs,
- MonoDevelop.Core.FileSystem/DefaultFileSystemExtension.cs,
- MonoDevelop.Core/DefaultAddinLocalizer.cs,
- MonoDevelop.Core/FileService.cs,
- MonoDevelop.Core/SystemAssemblyService.cs,
- MonoDevelop.Core/IAsyncOperation.cs: Added missing license headers.
- * MonoDevelop.Core.Utils.DirectoryArchive,
- MonoDevelop.Core.Utils.DirectoryArchive/TarDecompressor.cs,
- MonoDevelop.Core.Utils.DirectoryArchive/GzSupport.cs,
- MonoDevelop.Core.Utils.DirectoryArchive/Decompressor.cs,
- MonoDevelop.Core.Utils.DirectoryArchive/ZipDecompressor.cs,
- MonoDevelop.Core.Utils.DirectoryArchive/Bz2Support.cs,
- MonoDevelop.Core.mdp, MonoDevelop.Core.Utils.ReportingStream,
- MonoDevelop.Core.Utils.ReportingStream/ReportingStream.cs, Makefile.am:
- Removed unused classes.
-
-2007-11-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs: Add API to allow global
- override of environment variables on processes launched from
- MonoDevelop. Part of fix for "Bug 342965 - When running my program from
- monodevelop (F5) MONO_MANAGED_WATCHER is enabled".
- * MonoDevelop.Core/Runtime.cs: Convert a writeline to a log message.
-
-2007-11-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.mdp, Makefile.am, MonoDevelop.Core/Runtime.cs,
- MonoDevelop.Core/DefaultAddinLocalizer.cs: Set the default localizer for
- add-ins.
-
-2007-11-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Logging/LogLevel.cs: EnabledLoggingLevel.All should be
- equivalent to UpToDebug, not UpToInfo.
-
-2007-11-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Logging/FileLogger.cs,
- MonoDevelop.Core.Logging/ConsoleLogger.cs,
- MonoDevelop.Core.Logging/ILogger.cs: Track LogLevel changes.
- * MonoDevelop.Core.Logging/LogLevel.cs: Split LogLevel enum's two uses --
- flags for enabled logging levels, and mutually exclusive values for
- message severity -- into two compatible enums.
- * MonoDevelop.Core/LoggingService.cs: Disable coloured console output by
- default due to weird issues when Mono doesn't shut down cleanly.
- Spelling correction for RemoveLogger. Track LogLevel changes.
-
-2007-11-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/Runtime.cs: Add new SetProcessName method.
-
-2007-11-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Logging/ConsoleLogger.cs: Fix logic that checks
- whether console text colouring is possible.
-
-2007-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessWrapper.cs,
- MonoDevelop.Core.Execution/ProcessHostController.cs,
- MonoDevelop.Core/ServiceManager.cs, MonoDevelop.Core/XmlReadHelper.cs,
- MonoDevelop.Core/Properties.cs: Track LoggingService API changes.
- * MonoDevelop.Core.mdp, Makefile.am: Updated..
- * MonoDevelop.Core.Logging/FileLogger.cs,
- MonoDevelop.Core.Logging/ConsoleLogger.cs,
- MonoDevelop.Core.Logging/ILogger.cs,
- MonoDevelop.Core.Logging/LogLevel.cs,
- MonoDevelop.Core/LoggingService.cs: Rewrite logging service as a MIT/X11
- static class.
- * MonoDevelop.Core/DefaultLoggingService.cs,
- MonoDevelop.Core/ILoggingService.cs, MonoDevelop.Core/Runtime.cs: Remove
- old logging service.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.addin.xml: Bump MD version.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.mdp: Project file names updated by change in MD path
- functions.
-
-2007-10-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core/FileService.cs: Found a better solution for the "." case
- in abs2rel path.
-
-2007-10-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core/FileService.cs: AbsoluteToRelativePath gives back . if
- the paths are the same.
-
-2007-10-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core.FileSystem/DefaultFileSystemExtension.cs,
- MonoDevelop.Core/Runtime.cs, MonoDevelop.Core/FileEventArgs.cs,
- MonoDevelop.Core/FileService.cs: Rewrote/Refactored FileService (it's
- now under MIT), removed some unneccessary/unused methods.
-
-2007-10-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core/StringParserService.cs: Renamed some variables in the
- stringparser service.
-
-2007-10-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core/Runtime.cs, MonoDevelop.Core/ServiceManager.cs,
- MonoDevelop.Core/StringParserService.cs: StringParserService is now a
- singleton and re-wrote under MIT.
-
-2007-10-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Execution/NativePlatformExecutionHandler.cs,
- MonoDevelop.Core.Execution/MintPlatformExecutionHandler.cs,
- MonoDevelop.Core.Execution/MonoPlatformExecutionHandler.cs,
- MonoDevelop.Core.Execution/IExecutionHandler.cs: Allow setting
- environment variables when processes via an IExecutionHandler.
- * MonoDevelop.Core.Execution/ProcessService.cs: Allow setting environment
- variables when starting console processes.
-
-2007-09-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.mdp: Fix warning level.
- * MonoDevelop.Core/Properties.cs: When getting the value of a property, if
- it is a LazyXmlDeserializer, deserialize it and store the deserialized
- value in the internal dictionary. In this way the next time the property
- is requested, the same object will be returned, insted of deserializing
- the data every time.
-
-2007-09-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/PropertyService.cs: In SaveProperties, create the
- configuration path if it doesn't exist.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.addin.xml: Bump MD version.
-
-2007-09-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core/XmlReadHelper.cs: Fixed XmlReadHelper behavior - starting
- nodes are only read once.
-
-2007-09-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core/XmlReadHelper.cs: XmlReadHelper - already read starting
- node message is now more verbose.
-
-2007-09-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs: Escape arguments to xterm
- external console. Set xterm title so it doesn't display the 'internal'
- commands.
-
-2007-09-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/PackageExtensionNode.cs,
- MonoDevelop.Core/SystemAssemblyService.cs: Don't use the extension node
- Id to identify packages because that Id must be unique, but there can be
- several packages with the same name but different version.
-
-2007-09-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core/XmlReadHelper.cs, MonoDevelop.Core/Properties.cs: Removed
- some debug code.
-
-2007-09-07 <>
-
- * MonoDevelop.Core/Properties.cs, MonoDevelop.Core/XmlReadHelper.cs: Fixed
- bug in properties. Made XmlReadHelper more verbose on some possible
- errors.
-
-2007-09-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Core/DefaultLoggingService.cs: Change default log level to
- "WARN". Verbosity doesn't increase substantially, and the warning
- messages do generally indicate a problem.
-
-2007-09-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core/Properties.cs, MonoDevelop.Core/XmlReadHelper.cs: It's
- now possible to specifiy more than one possible end node in the
- XmlReadHelper class.
-
- The Properties class now generates root node called "Serialized"
- (Properties.SerializedNode) for the custom xml serialized documents -
- they do not need to generate an own root node anymore (therefore saving
- some space).
-
-2007-09-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core/Properties.cs, MonoDevelop.Core/ICustomXmlSerializer.cs:
- Worked on property infrastructure - serialization can now be customized
- using the ICustomXmlSerializer interface.
-
-2007-09-04 Michael Hutchinson <MHutchinson@novell.com>
-
- * MonoDevelop.Core/Properties.cs: Fix compiler warnings. Note: one is
- clearly a typo, but the fix changes the logic.
-
-2007-09-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core/XmlReadHelper.cs: Changed the XmlReadHelper behavior - it
- now handles the case that the first node is equal to the closing tag
- node.
-
-2007-09-04 <>
-
- * MonoDevelop.Core/Properties.cs: Changed the md property file format output
- (no unknown node:Properties message anymore).
-
-2007-08-31 <>
-
- * MonoDevelop.Core.Properties/IXmlConvertable.cs,
- MonoDevelop.Core.Properties/DefaultProperties.cs,
- MonoDevelop.Core.Properties/PropertyEventArgs.cs,
- MonoDevelop.Core.Properties/IProperties.cs,
- MonoDevelop.Core.Properties/CharacterEncodings.cs,
- MonoDevelop.Core/PropertyChangedEventArgs.cs,
- MonoDevelop.Core/Runtime.cs, MonoDevelop.Core/AbstractService.cs,
- MonoDevelop.Core/IStringTagProvider.cs,
- MonoDevelop.Core/CharacterEncodings.cs,
- MonoDevelop.Core/ServiceManager.cs, MonoDevelop.Core/XmlReadHelper.cs,
- MonoDevelop.Core/Properties.cs, MonoDevelop.Core/FileService.cs,
- MonoDevelop.Core/StringParserService.cs,
- MonoDevelop.Core/PropertyService.cs, MonoDevelop.Core/IService.cs:
- Rewrote property infrastructure. Faster (no XmlDom), smaller Xml (No
- write back of defaultValues), easier to use (only one property class,
- better to use interface).
-
-2007-08-29 <>
-
- * MonoDevelop.Core.Properties/DefaultProperties.cs: Fixed 82621: Crash while
- building moon.mds.
- * MonoDevelop.Core.Properties/IProperties.cs: Fi
-
-2007-08-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.ProgressMonitoring/ProgressTracker.cs: The Global work
- may be known even if the last task has an unknown amount of work, so we
- need to check all tasks.
-
-2007-08-14 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs
- (ReportError): Show exception also in the emitted message.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/IconCodon.cs: Moved to MD.Projects.Gui.
- * MonoDevelop.Core.Execution/ProcessService.cs, Makefile.am,
- MonoDevelop.Core.addin.xml, MonoDevelop.Core.mdp,
- MonoDevelop.Core/Runtime.cs, MonoDevelop.Core/ServiceManager.cs,
- MonoDevelop.Core/FileService.cs: Reorganized the extension point
- hierarchy. Embedded all add-in manifests as resources.
-
-2007-08-07 Ankit Jain <jankit@novell.com>
-
- * StringParserService.cs (Replace): Update to use TryGetValue with
- Dictionary objects, indexer throws for non-existant keys.
-
-2007-07-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/DefaultLoggingService.cs: Added some null checks.
-
-2007-07-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessWrapper.cs: Set the 'done' flag
- before exiting WaitForOutput. It fixes a race that was the cause of
- bug #82128.
-
-2007-07-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.mdp: Updated.
- * MonoDevelop.Core/Runtime.cs: Use a local add-in registry when running
- MD from the build directory.
-
-2007-07-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessHostController.cs,
- MonoDevelop.Core/Runtime.cs: Use the logging service instead of the
- console.
-
-2007-07-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/AddinDependencyAttribute.cs: Set the
- correct namespace.
-
-2007-07-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core.Properties/CharacterEncodings.cs,
- MonoDevelop.Core/StringParserService.cs: Removed some commented out
- code.
-
-2007-07-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs,
- MonoDevelop.Core.ProgressMonitoring/ProgressTracker.cs,
- MonoDevelop.Core.ProgressMonitoring/AggregatedOperationMonitor.cs,
- MonoDevelop.Core.ProgressMonitoring/LogTextWriter.cs,
- MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs,
- MonoDevelop.Core.ProgressMonitoring/NullProgressMonitor.cs,
- MonoDevelop.Core.Properties/DefaultProperties.cs,
- MonoDevelop.Core.Properties/PropertyEventArgs.cs,
- MonoDevelop.Core.Properties/IProperties.cs,
- MonoDevelop.Core.Properties/CharacterEncodings.cs,
- MonoDevelop.Core.mdp, MonoDevelop.Core/ServiceManager.cs,
- MonoDevelop.Core/StringParserService.cs,
- MonoDevelop.Core/SystemAssemblyService.cs: Refactored a bit.
- Brought source code to .NET2 standards.
-
-2007-07-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.ProgressMonitoring/ConsoleProgressStatus.cs: Track
- api changes.
-
-2007-07-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/SetupApp.cs, Makefile.am,
- MonoDevelop.Core.addin.xml, MonoDevelop.Core.mdp: Removed
- implementation of setup utility, moved to mdtool.
-
-2007-07-02 Ben Motmans <ben.motmans@gmail.com>
-
- * MonoDevelop.Core.Execution/ProcessWrapper.cs,
- MonoDevelop.Core.Execution/IProcessAsyncOperation.cs:
- Added ProcessId property
-
-2007-06-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs: Added new overload for
- StartProcess.
-
-2007-06-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/PackageExtensionNode.cs,
- MonoDevelop.Core/SystemPackage.cs,
- MonoDevelop.Core/SystemAssemblyService.cs: Allow specifying the gac
- root where assemblies from a package are installed.
-
-2007-06-20 Mike Krüger <mkrueger@novell.com>
-
- forget some ToStrings ()
-
-2007-06-20 Mike Krüger <mkrueger@novell.com>
-
- String parser service now has more tags: year,month,day, hour,minute,second.
-
-2007-06-14 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs (GetAssemblyNameForVersion):
- Return fullname if its ClrVersion matches the target version.
-
-2007-06-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: In GetAssemblyFullName,
- use AssemblyName.GetAssemblyName if the provided name is a file.
-
-2007-06-07 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Core/FileService.cs (NormalizeRelativePath): Moved from
- AutotoolsContext.cs to here.
-
-2007-06-01 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs (assemblyFullNameToPath):
- Change type from Hashtable to Dictionary<string,string>.
- (GetAssemblyFullNames): New.
-
-2007-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.ProgressMonitoring/FilteredProgressMonitor.cs,
- Makefile.am, MonoDevelop.Core.mdp: Added new
- FilteredProgressMonitor class, which can be used to filter out part
- of the progress information provided by an operation.
- * MonoDevelop.Core/ServiceManager.cs: Fix warning.
-
-2007-05-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/RemoteProcessObject.cs,
- MonoDevelop.Core.Execution/ProcessService.cs: Properly handle
- add-in unload events.
-
-2007-05-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/FileService.cs: Added missing error message
- parameter in DeleteFile.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.mdp: Copy mono.addins to target directory.
-
-2007-05-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am, MonoDevelop.Core.mdp: Reference shared assemblies from
- the correct location.
-
-2007-05-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/IconCodon.cs: Updated description attributes.
- Removed unused property.
- * MonoDevelop.Core.AddIns/SetupApp.cs, Makefile.am,
- MonoDevelop.Core.addin.xml, MonoDevelop.Core.mdp: Implemented setup
- tool using Mono.Addins.
- * MonoDevelop.Core.AddIns/ExecutionHandlerCodon.cs: Updated description
- attributes.
- * MonoDevelop.Core.AddIns/ApplicationExtensionNode.cs: Read the class
- name from the 'class' attribute, not from 'type'. Updated
- documentation attributes.
- * MonoDevelop.Core/Runtime.cs: Register the main md repository by
- default. Improved add-in error message.
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/IconCodon.cs,
- MonoDevelop.Core.AddIns/AssemblyExtensionNode.cs,
- MonoDevelop.Core.AddIns/ApplicationExtensionNode.cs,
- MonoDevelop.Core.AddIns/ExecutionHandlerCodon.cs,
- MonoDevelop.Core.AddIns/PackageExtensionNode.cs,
- MonoDevelop.Core.AddIns/ServiceExtensionNode.cs,
- MonoDevelop.Core.Execution/ProcessService.cs,
- MonoDevelop.Core.ProgressMonitoring/ConsoleProgressStatus.cs,
- MonoDevelop.Core.addin.xml, MonoDevelop.Core.mdp, Makefile.am,
- MonoDevelop.Core/Runtime.cs, MonoDevelop.Core/AbstractService.cs,
- MonoDevelop.Core/GettextCatalog.cs.in,
- MonoDevelop.Core/ServiceManager.cs,
- MonoDevelop.Core/FileService.cs,
- MonoDevelop.Core/SystemAssemblyService.cs,
- MonoDevelop.Core/IService.cs: Migration to Mono.Addins.
- * MonoDevelop.Core.AddIns/*,
- MonoDevelop.Core.AddIns.Setup/*: Removed many
- classes now implemented in Mono.Addins.
-
-2007-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.ProgressMonitoring/NullProgressMonitor.cs: Fix bug
- in ReportWarning.
- * MonoDevelop.Core/FileService.cs: Added method for creating temporary
- directories.
-
-2007-04-07 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: Avoid duplicating
- search paths which use relative components ("../").
-
-2007-04-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/AssemblyExtensionNode.cs,
- MonoDevelop.Core.AddIns/PackageExtensionNode.cs,
- MonoDevelop.Core.addin.xml, MonoDevelop.Core.mdp, Makefile.am,
- MonoDevelop.Core/SystemAssemblyService.cs: Added new extension
- point for registering packages.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.addin.xml: Change add-in versions to 0.13.
- * Makefile.am: Flush.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/DefaultAddInTreeNode.cs: Avoid creating
- unnecessary arraylists.
- * Makefile.am: Flush.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.mdp: Added missing files.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessWrapper.cs: Improved protection
- against exceptions.
- * MonoDevelop.Core.mdp, Makefile.am: Flush.
-
-2007-02-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am, MonoDevelop.Core/SystemPackage.cs,
- MonoDevelop.Core/SystemAssemblyService.cs: Added method for
- registering new (add-in provided) packages.
-
-2007-02-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessWrapper.cs: Make Cancel method safe
- to exceptions.
- * MonoDevelop.Core.mdp, Makefile.am: Synchronized the Makefile and the
- MD project.
-
-2007-01-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/AddIn.cs,
- MonoDevelop.Core.Properties/DefaultProperties.cs: Allow comments in
- the loaded xml. Patch by atsushi@ximian.com (Atsushi Enomoto).
- Fixes bug #80474.
-
-2007-01-30 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs (GetPackage): New.
- (GetPackageFromPath): New.
-
-2007-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/AssemblyLoader.cs: Track changes in the Cecil
- api.
- * MonoDevelop.Core/FileService.cs: Implemented GetFullPath method,
- which works like Path.GetFullPath, but which works even in the path
- doesn't exist.
-
-2007-01-19 Marek Sieradzki <marek.sieradzki@gmail.com>
-
- * MonoDevelop.Core.AddIns.Setup/SetupService.cs,
- MonoDevelop.Core.AddIns.Setup/AddinPackage.cs,
- MonoDevelop.Core/FileService.cs: Removed redundant String.Format ().
-
-2007-01-18 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs (StartProcess): Add new
- overload that takes a ProcessStartInfo.
- (CreateProcessStartInfo): New.
-
-2007-01-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/FileService.cs: Fire events in the correct order
- when renaming files and directories. Fixes bug #80470.
-
-2007-01-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/FileService.cs: Removed debug code.
-
-2006-12-20 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessService.cs (StartProcess): Add a new
- overload with 'redirectStandardInput' param.
-
-2006-12-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.FileSystem: Added missing files.
-
-2006-12-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/AddIn.cs,
- MonoDevelop.Core.AddIns.Setup/SetupService.cs: Track changes in
- FileService API.
- * Makefile.am, MonoDevelop.Core/FileEventArgs.cs: Moved from
- MonoDevelop.Core.Gui.
- * MonoDevelop.Core.addin.xml: Registered new extension point for file
- system extensions.
- * MonoDevelop.Core.mdp: Updated.
- * MonoDevelop.Core/Runtime.cs: Added FileService.
- * MonoDevelop.Core/FileUtilityService.cs: Merged with FileService.
- * MonoDevelop.Core/ServiceManager.cs: Added null check.
- * MonoDevelop.Core/FileService.cs: Moved from MonoDevelop.Core.Gui and
- added some new features. It is now possible to register extensions
- which can hook into the file operations such as Copy or Move.
-
-2006-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/AddInService.cs: In
- RegisterExtensionItemListener, avoid firing duplicate events by
- getting the list of tree items before registering the listener.
- * MonoDevelop.Core.mdp: Updated.
-
-2006-09-12 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.Core.AddIns/AddInService.cs: Added robustness for addin dir detection failure.
- * MonoDevelop.Core.Execution/MonoPlatformExecutionHandler.cs: Removed /bin/sh dependence.
- * MonoDevelop.Core.Execution/ProcessService.cs: Default to TCP IPC on win32.
- * MonoDevelop.Core/SystemAssemblyService.cs: Pathing and environment variable compatibility fixes.
- * MonoDevelop.Core.AddIns.Setup/SetupService.cs: Win32 URI workaround.
-
-2006-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns.Setup/SetupService.cs: Don't crash if
- a repository file can't be found.
-
-2006-08-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns.Setup/SetupService.cs: Added support
- for adding and removing add-in directories.
- * MonoDevelop.Core.addin.xml: Break back compatibility.
- * MonoDevelop.Core.AddIns.Setup/SystemConfiguration.cs: New file.
- * MonoDevelop.Core.mdp: Updated.
- * Makefile.am: Added new file.
-
-2006-08-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/StringParserService.cs: Use invariant culture
- for case-insensitive variable checks. Fixes bug #78814.
-
-2006-07-25 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.Core.Execution/RemoteProcessObject.cs:
- Make Dispose() virtual so that derived classes can clean up too.
-
-2006-07-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessHostController.cs:
- * MonoDevelop.Core.Execution/IProcessHost.cs:
- * MonoDevelop.Core.Execution/ProcessService.cs: Get the list
- of add-ins required by a type, and load those add-ins into
- the remote process before loading the type.
-
- * MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs:
- allow specifying slave monitors in the constructor.
-
-2006-07-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns.Setup/SetupService.cs: store cached
- repositories in the correct directory.
-
-2006-07-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: The service now
- stores package information in a SystemPackage class.
- * MonoDevelop.Core/SystemPackage.cs: New class.
-
- * MonoDevelop.Core.mdp:
- * Makefile.am: Added new file.
-
-2006-07-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: Added some missing
- Initialize() calls.
-
-2006-07-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: Some assembly names
- include PublicKeyToken=null, some others do not (depending on
- the origin of the name. SystemAssemblyService now normalizes
- all names so there are no problems when different nane formats
- are used.
-
-2006-07-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/AddIn.cs:
- * MonoDevelop.Core.AddIns/AbstractCodon.cs:
- Added an Extension property to AbstractCodon, which
- returns the extension point to which the codon is attached.
- * MonoDevelop.Core.mdp: Updated.
-
- * MonoDevelop.Core.AddIns.Setup/AddinSetupInfo.cs:
- * MonoDevelop.Core.AddIns.Setup/SetupService.cs:
- * MonoDevelop.Core.AddIns.Setup/AddinConfiguration.cs: Many improvements
- in AddinConfiguration. Now it reads more information and can write
- changes.
-
- * MonoDevelop.Core.addin.xml: Updated version.
-
-2006-06-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/DefaultAddInTreeNode.cs:
- * MonoDevelop.Core.AddIns/IAddInTreeNode.cs: Added Build method,
- which builds the tree node.
-
- * MonoDevelop.Core.AddIns/DefaultAddInTree.cs:
- * MonoDevelop.Core.AddIns/AddInService.cs: Added new methods for
- registering listeners on extension items. Listeners are notified
- when new items are available in an extension, as a result of
- loading new add-ins.
-
- * MonoDevelop.Core.AddIns.Setup/SetupService.cs: When enabling an
- add-in, make sure all required add-ins are also enabled. When disabling,
- make sure all dependent add-ins are disabled.
-
- * MonoDevelop.Core.Execution/ProcessService.cs: Use the new extension
- listeners to read extensions.
-
-2006-06-12 John Luke <john.luke@gmail.com>
-
- * MonoDevelop.Core.AddIns/DefaultAddInTree.cs:
- * MonoDevelop.Core.Execution/ProcessService.cs:
- * MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs:
- * MonoDevelop.Core/FileUtilityService.cs:
- * MonoDevelop.Core/PropertyService.cs:
- * MonoDevelop.Core/SystemAssemblyService.cs: use String.IsNullOrEmpty
- in a few places
-
-2006-06-03 John Luke <john.luke@gmail.com>
-
- * MonoDevelop.Core/FileUtilityService.cs: fix warning
- by using the non-obsolete Path.GetInvalidPathChars()
- instead of Path.InvalidPathChars
-
-2006-06-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: Added fast path for
- LocateAssembly.
-
-2006-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns.Setup/AddinInfo.cs:
- * MonoDevelop.Core.AddIns/AddIn.cs: Implemented support for optional
- extensions in add-ins.
-
- * MonoDevelop.Core.AddIns/AddInService.cs: Don't crash if pre-loading
- of an add-in fails, just report the error. While resolving deps and
- preloading add-ins, take into account disabled add-ins.
-
- * MonoDevelop.Core.AddIns.Setup/AddinSystemConfiguration.cs:
- * MonoDevelop.Core.AddIns.Setup/SetupService.cs:
- * MonoDevelop.Core.AddIns.Setup/AddinSetupInfo.cs: Implement support
- for enabling/disabling add-ins.
-
- * MonoDevelop.Core.AddIns/DumpAddinInfoApp.cs:
- * MonoDevelop.Core.AddIns/AddInTreeSingleton.cs: Removed unused code.
-
- * MonoDevelop.Core/PropertyService.cs:
- * MonoDevelop.Core.AddIns.Setup/AddinPackage.cs: Fix warning.
-
-
-2006-05-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/AddInService.cs: Throw an UserException if
- StartApplication can't find the provided application.
- Implemented GetApplications().
- * MonoDevelop.Core.AddIns/AssemblyLoader.cs: Use GetAssemblyManifest
- instead of GetAssembly to get the referenced assemblies, since it
- is much faster.
- * MonoDevelop.Core.AddIns/CodonBuilder.cs: Use the new ChildCodonsAttribute
- instead of CategoryAttribute.
- * MonoDevelop.Core.addin.xml: Added some descriptions.
- * MonoDevelop.Core.AddIns.Setup/SetupService.cs: When resolving dependencies,
- if one of the unresolved dep is MonoDevelop.Core, just report that a
- new MD version is required. Make ApplicationRecord implement
- IApplicationInfo.
-
- * MonoDevelop.Core.mdp:
- * Makefile.am: Added ChildCodonsAttribute.cs.
-
-2006-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.addin.xml: Updated versions.
- * MonoDevelop.Core.mdp: Updated.
-
-2006-04-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: Implemented support for
- 2.0 assemblies.
- * MonoDevelop.Core/ClrVersion.cs: New enum which represents the target
- runtime version.
-
- * MonoDevelop.Core.mdp:
- * Makefile.am: added ClrVersion.cs.
-
-2006-04-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.addin.xml:
- * MonoDevelop.Core.AddIns/ClassCodon.cs
- * MonoDevelop.Core.AddIns/AbstractCodon.cs:
- * MonoDevelop.Core.AddIns/ExecutionHandlerCodon.cs:
- * MonoDevelop.Core.AddIns/IconCodon.cs: Added documentation.
-
- * MonoDevelop.Core.AddIns/IAddInTreeNode.cs: Add new
- properties to be able to get more information about
- an extension point.
- * MonoDevelop.Core.AddIns/AddIn.cs: When checking dependencies,
- make sure the required version of an add-in is installed.
- Read the new extension-nodes and description attributes for
- extensions.
- * MonoDevelop.Core.AddIns/CodonFactory.cs: Added helper method.
- * MonoDevelop.Core.AddIns/DefaultAddInTree.cs: Add documentation
- from extensions into the tree.
- * MonoDevelop.Core.AddIns/CodonBuilder.cs: Added some helper
- methods for getting codon documentation.
- * MonoDevelop.Core.AddIns/DefaultAddInTreeNode.cs: Added properties
- for storing extension point documentation.
- * MonoDevelop.Core.AddIns/DumpAddinInfoApp.cs: New command-line
- application which writes the extension tree in an xml file.
-
- * MonoDevelop.Core.mdp:
- * Makefile.am: Updated.
-
-2006-04-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns.Setup/SetupService.cs: Added
- CheckInstalledAddin helper method.
-
-2006-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns.Setup/AssemblyDependency.cs: Improve
- dependency description.
-
-2006-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessHostController.cs:
- * MonoDevelop.Core.Execution/ProcessService.cs: Support the
- Unix channel for comunication with the host process.
- * MonoDevelop.Core/Runtime.cs: Added Shutdown method.
-
-2006-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/AddInService.cs: Improved error message
- for a know error.
-
-2006-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/MonoDevelop.Core.addin.xml: Break backwards
- compatibility.
-
-2006-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.mdp: Updated.
- * Makefile.am: Use an unified format. Patch by Matze Braun.
-
- * MonoDevelop.Core.AddIns/AddInService.cs: When checking add-in
- dependencies, check compatible versions if exact versions are
- not found.
- * MonoDevelop.Core.addin.xml: Updated add-in version.
-
-2006-03-24 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Core.AddIns/AddInTreeSingleton.cs:
- * MonoDevelop.Core.AddIns.Setup/SetupService.cs:
- * MonoDevelop.Core/DefaultLoggingService.cs:
- * MonoDevelop.Core/FileUtilityService.cs:
- * MonoDevelop.Core/PropertyService.cs:
- Use AppDomain.CurrentDomain.BaseDirectory in case Assembly.GetEntryAssembly() is null.
-
-2006-03-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: Load the assembly
- information in a background thread. Added FindInstalledAssembly
- method.
-
-2006-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/AddIn.cs: Make GetType work for
- System types.
-
-2006-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/AddInTreeSingleton.cs:
- * MonoDevelop.Core.AddIns/AddInService.cs:
- * MonoDevelop.Core.AddIns/DefaultAddInTree.cs:
- * MonoDevelop.Core.AddIns/AssemblyLoader.cs:
- Made assembly load check optional. It will be enabled when
- starting the main MD app, but not for tools.
-
-2006-02-28 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Core/GettextCatalog.cs.in: Added a string.Format
- version of GetPluralString.
-
-2006-02-19 Andrés G. Aragoneses <knocte@gmail.com>
-
- * MonoDevelop.Core/PropertyService.cs: fixed a typo in a
- comment.
-
-2006-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/AddInService.cs: Made PreloadAddin
- public.
- * MonoDevelop.Core/Runtime.cs: Don't crash if Initialize
- is called more than once.
-
- * MonoDevelop.Core.mdp, Makefile.am: Updated.
-
-2006-01-25 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Core.AddIns/AddInService.cs:
- * MonoDevelop.Core.AddIns.Setup/SetupService.cs:
- * MonoDevelop.Core.AddIns.Setup/AddinPackage.cs:
- Fixed spelling of add-in.
-
-2006-01-23 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Core.AddIns/AddInService.cs: Added internationalization.
-
-2006-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/DefaultAddInTreeNode.cs: Added some
- null checks.
- * MonoDevelop.Core.Execution/RemoteProcessObject.cs: Made protected
- default constructor.
- * MonoDevelop.Core/FileUtilityService.cs: Removed unused enums and
- delegates.
- * MonoDevelop.Core/GettextCatalog.cs.in: Added private constructor.
-
-2006-01-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs:
- Don't try to cancel monitors that are already cancelled. Fixes
- bug #77100.
- * MonoDevelop.Core/Runtime.cs: Runtime is a static class.
-
-2006-01-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/GettextCatalog.cs.in: Added some null checks.
-
-2006-01-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/DefaultAddInTreeNode.cs:
- * MonoDevelop.Core.AddIns/AddIn.cs: Implement support for InsertBefore.
-
- * MonoDevelop.Core.AddIns/AssemblyLoader.cs: When a specific version of an
- assembly is required and not found, use the currently loaded version.
- For example, it should fix the problem of loading an add-in that has been
- compiled with a different but compatible gtk version.
-
- * MonoDevelop.Core/UserException.cs: New exception type to be used for errors
- that are to be shown to the user.
-
- * MonoDevelop.Core/StringParserService.cs: Keep variable refereces intact if the
- variable has not been defined.
-
- * Makefile.am:
- * MonoDevelop.Core.mdp: Updated.
-
-2005-12-01 Todd Berman <tberman@off.net>
-
- * MonoDevelop.Core.AddIns.Setup/SetupService.cs: Make ReadObject
- return null if it encounters an error. This happens with 0 length
- files.
-
-2005-11-29 David Makovský <yakeen@sannyas-on.net>
-
- * MonoDevelop.Core.AddIns.Setup/SetupService.cs:
- * MonoDevelop.Core/ServiceManager.cs: Make some strings translatable.
- * Monodevelop.Core/GettextCatalog.cs.in: use Mono.Unix instead of Mono.Posix which is depreceated
-
-2005-11-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/AddIn.cs: Add support for "Assembly"
- dependencies. Removed unneeded error log message.
-
- * MonoDevelop.Core.AddIns.Setup/AddinInfo.cs:
- * MonoDevelop.Core.AddIns/AddInService.cs: Add support for "Assembly"
- dependencies.
-
- * MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs:
- Improved formatting.
-
- * MonoDevelop.Core.AddIns.Setup/SetupService.cs: Generate an index page
- when building a repository.
-
- * Makefile.am:
- * MonoDevelop.Core.mdp: Added new files.
-
-2005-11-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/AddIn.cs:
- * MonoDevelop.Core.AddIns/DefaultAddInTree.cs:
- * MonoDevelop.Core.AddIns/DefaultAddInTreeNode.cs: Make sure that child
- nodes are added in the same order as in the xml file. In this way
- the topological sort used to merge the nodes is not needed, and the
- resulting order makes more sense.
-
-2005-11-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/PropertyService.cs:
- * MonoDevelop.Core/FileUtilityService.cs: Removed unused code.
-
-2005-11-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns.Setup/SetupTool.cs: Unified install and rinstall
- commands. Added update and list-update. Added per command help.
-
-2005-11-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/ProcessHostController.cs:
- Always stop the process asyncrhonously, so the remote object has time
- to end the dispose call.
- * Makefile.am: Fixed the location of GettextCatalog.
- * MonoDevelop.Core/GettextCatalog.cs.in: Added GetString overload.
-
-2005-11-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Properties/DefaultProperties.cs: Properly store
- DateTime properties.
-
-2005-11-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core/SystemAssemblyService.cs: Added method
- for getting the full name of an assembly.
-
-2005-11-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns.Setup/AddinSetupInfo.cs:
- * MonoDevelop.Core.AddIns.Setup/AddinDependency.cs:
- * MonoDevelop.Core.AddIns.Setup/SetupService.cs:
- * MonoDevelop.Core.AddIns.Setup/NativeDependency.cs:
- * MonoDevelop.Core.AddIns.Setup/PackageDependency.cs
- * MonoDevelop.Core.AddIns.Setup/AddinPackage.cs: Added support
- for installing add-ins in the user's home directory.
-
-2005-11-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns.Setup/SetupTool.cs: Fix warning.
-
-2005-10-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/AssemblyLoader.cs: Simplified the
- assembly loader check. The only conflictive situation is when
- trying to load two versions of gtk#. This can't happen with
- gtk# 2.4 and 2.6 since they are not side-by-side installable.
-
-2005-10-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/AddIn.cs: the Import element may
- reference files as well as assemblies, so don't crash if
- the assembly attribute is missing.
-
-2005-10-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns.Setup/RepositoryRecord.cs: Don't
- use DateTime.MinValue since the serializer may have trouble
- with it in some timezones
-
-2005-10-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Gui.mdp: Added references.
-
- * MonoDevelop.Core.Properties/IProperties.cs:
- * MonoDevelop.Core.Properties/DefaultProperties.cs:
- Added GetProperty overloads for DateTime and TimeSpan.
-
- * MonoDevelop.Core.AddIns.Setup/RepositoryRecord.cs: Properly
- set repo name when it has been updated.
-
- * MonoDevelop.Core.AddIns.Setup/SetupService.cs: Several fixes
- in repository registration.
-
- * MonoDevelop.Core.AddIns.Setup/AddinInfo.cs: Generate better
- names for addin reference elements.
-
- * MonoDevelop.Core.AddIns.Setup/SetupTool.cs: Improved build
- package command.
-
-2005-10-18 John Luke <john.luke@gmail.com>
-
- * MonoDevelop.Core.AddIns/IAddInTree.cs:
- * MonoDevelop.Core.AddIns/DefaultAddInTree.cs:
- add TreeNodeExists (path) method
-
-2005-10-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.Execution/MintPlatformExecutionHandler.cs:
- * MonoDevelop.Core.Execution/ProcessService.cs:
- * MonoDevelop.Core.Execution/MonoPlatformExecutionHandler.cs:
- Properly escape whitespaces in directory names. Fixes bug #76418.
-
-2005-10-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/AddIn.cs: In CreateObject(), use GetType(name)
- to find the class in the addin and all its dependencies.
-
-2005-10-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/AddInService.cs:
- * MonoDevelop.Core.AddIns/AddInCollection.cs:
- * MonoDevelop.Core.AddIns/AddIn.cs:
- * MonoDevelop.Core.addin.xml: Fixed addin header information.
- Use "id" attribuet instead of "name" to identify addins.
-
- * MonoDevelop.Core/IProgressMonitor.cs:
- * MonoDevelop.Core.ProgressMonitoring/ProgressTracker.cs:
- * MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs:
- * MonoDevelop.Core.ProgressMonitoring/SynchronizedProgressMonitor.cs:
- Implemented BeginStepTask.
-
- * MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs:
- Fixed indenting and wrapping of text.
-
- * MonoDevelop.Core.ProgressMonitoring/NullProgressMonitor.cs: Keep
- a list of error messages.
-
- * MonoDevelop.Core.AddIns.Setup/SetupTool.cs: Initial implementation
- of a command line setup tool.
-
- * Makefile.am: Added new files.
-
- * MonoDevelop.Core.AddIns.Setup/RepositoryRecord.cs:
- * MonoDevelop.Core.AddIns.Setup/AddinDependency.cs:
- * MonoDevelop.Core.AddIns.Setup/NativeDependency.cs:
- * MonoDevelop.Core.AddIns.Setup/PackageDependency.cs:
- * MonoDevelop.Core.AddIns.Setup/AddinPackage.cs:
- * MonoDevelop.Core.AddIns.Setup/AddinInfo.cs:
- * MonoDevelop.Core.AddIns.Setup/Package.cs:
- * MonoDevelop.Core.AddIns.Setup/NativePackage.cs:
- * MonoDevelop.Core.AddIns.Setup/AddinConfiguration.cs:
- * MonoDevelop.Core.AddIns.Setup/PackageCollection.cs:
- * MonoDevelop.Core.AddIns.Setup/SetupService.cs: Improved the process
- of resolving dependencies and installing/uninstalling addins.
-
-2005-10-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/ClassCodon.cs: Added Type property.
- * MonoDevelop.Core.AddIns/AddInService.cs: Added method for getting
- a codons list, not the items they build.
-
-2005-10-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Core.AddIns/AddInTreeSingleton.cs: Created method
- InsertAddIn.
- * MonoDevelop.Core.AddIns/DefaultAddInTree.cs: The Core addin is now
- loaded like any other addin, so there is no need to load default
- codons and conditions here.
- * MonoDevelop.Core.Execution/ProcessService.cs: Lazily get ExecutionHandler
- information.
- * Makefile.am: Added files.
- * MonoDevelop.Core.addin.xml: Added application extension point.
- * MonoDevelop.Core/ServiceManager.cs: Added method for initializing
- the services for a given addin.
- * MonoDevelop.Core/Runtime.cs: Added AddInService and SetupService.
-
- * MonoDevelop.Core.Setup/*: New API for managing addins.
-
-2005-09-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * Changed internal organization of files and namespaces.
-
-2005-08-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIns/Codons/AbstractCodon.cs: Make the ID attribute optional.
- In general, IDs are only needed when codons can be extended, or when
- the entity they represent requires an ID. There are some kind of codons
- which don't have any of those requirements, and the ID is not needed.
-
- * AddIns/AddIn.cs: Added method for getting a resource from an addin's
- asseblies.
-
- * AddIns/Codons/CodonFactory.cs:
- * AddIns/DefaultAddInTree.cs:
- * AddIns/Codons/DuplicateCodonException.cs: Improve error message.
-
-2005-08-10 Ben Motmans <ben.motmans@gmail.com>
-
- * MonoDevelop.Core.mdp: references update
-
-2005-07-29 John Luke <john.luke@gmail.com>
-
- * MonoDevelop.Core.mdp: add new files and references
-
-2005-07-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIns/AssemblyLoader.cs:
- * AddIns/DefaultAddInTree.cs:
- * AddIns/AddInTreeSingleton.cs: Added an assembly sanity check, which
- ensures that all addins reference the same assembly versions.
-
-2005-07-22 John Luke <john.luke@gmail.com>
-
- * AddIns/Addin.cs: remove unused variable warning
-
-2005-07-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIns/AddInTreeSingleton.cs: Added a method that explicitely
- initializes the tree of addins, and which returns a list of load errors
- instead of throwing an exception if something fails.
-
-2005-07-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIns/AddIn.cs:
- * AddIns/AddInTreeSingleton.cs:
- * AddIns/AddInCollection.cs:
- * AddIns/AddInLoadException.cs: Implemented some basic support for
- declaring addin dependencies.
-
-2005-06-27 John Luke <john.luke@gmail.com>
-
- * MonoDevelop.Core.mdp:
- * MonoDevelop.Core.mds: add project files
-
-2005-06-01 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * Services/IMessageService.cs: Added methods to ask a question
- with a cancel option.
-
-2005-04-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIns/AddIn.cs: Added GetType method.
-
-2005-03-24 Raja R Harinath <rharinath@novell.com>
-
- * Makefile.am (FILES): Move AssemblyInfo.cs ...
- (build_sources): ... here.
-
-2005-02-20 John Luke <john.luke@gmail.com>
-
- * Services/ServiceManager.cs:
- * Services/IMessageService.cs:
- * Services/AbstractService.cs:
- * Services/FileUtilityService.cs:
- * Services/IService.cs:
- * Makefile.am: remove System.Drawing stuff
- dont define:LINUX
- * Services/SaveErrorChooseDialog.cs:
- * Services/SaveErrorInformDialog.cs: remove SWF cruft
-
- * ./AddIns/Codons/CodonNameAttribute.cs
- * ./AddIns/PathAttribute.cs
- * ./AddIns/XmlMemberAttributeAttribute.cs
- * ./AddIns/Conditions/ConditionAttribute.cs
- * ./AddIns/XmlMemberArraryAttribute.cs: mark attributes sealed
-
-2005-01-31 Todd Berman <tberman@off.net>
-
- * AddIns/AddIn.cs: Remove usage of AddIn.xsd, it is a bad solution.
- * Makefile.am:
- * AddIn.xsd: Remove AddIn.xsd
-
-2005-01-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn.xsd: Defined new codon for project formats.
-
-2005-01-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIns/AddIn.cs: Use IsDefined() to look for custom attributes. It's
- faster and uses less memory than GetCustomAttribute().
-
-2005-01-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * AddIn.xsd: Added new codon type, and new condition.
-
-2004-08-07 Todd Berman <tberman@off.net>
-
- * AssemblyInfo.cs.in: Use new ASSEMBLY_VERSION variable.
-
-2004-07-05 Todd Berman <tberman@off.net>
-
- * Services/GettextCatalog.cs: removed
- * Services/GettextCatalog.cs.in: Added, this is a passthru to
- Mono.Posix.Catalog. We are using the .in so that the locale dir is
- specified properly.
- * Makefile.am: Add .cs.in rules to generate, etc.
-
-2004-07-02 Todd Berman <tberman@off.net>
-
- * Services/FileUtilityService.cs: remove some unneeded code, and
- fix a string.
-
-2004-06-28 Todd Berman <tberman@off.net>
-
- * AddIns/AddIn.cs: Add a C.WL so you dont get weird errors without
- some more info.
- * Makefile.am: fixup makefile so that if the AddIn.xsd changes, the
- assembly is rebuilt.
-
-2004-06-23 Todd Berman <tberman@off.net>
-
- * Services/ServiceManager.cs: protected ctor added.
-
-2004-06-23 Todd Berman <tberman@off.net>
-
- * Services/ServiceManager.cs: make GetService a static method, hide
- the instance everywhere.
-
-2004-05-29 Vladimir Vukicevic <vladimir@pobox.com>
-
- * Services/GettextCatalog.cs: fix marshalling issues and gettext
-
-2004-05-26 Todd Berman <tberman@sevenl.net>
-
- * Services/GettextCatalog.cs: oops, thats not what i wanted i guess.
-
-2004-05-26 Todd Berman <tberman@sevenl.net>
-
- * Services/GettextCatalog.cs: change to string marshaling to prevent
- leaks.
-
-2004-04-04 Todd Berman <tberman@sevenl.net>
-
- * AddIns/AddInTreeSingleton.cs: Change to .addin.xml to allow gettext
-
-2004-04-02 Todd Berman <tberman@sevenl.net>
-
- * Makefile.am: add GettextCatalog.cs.
- * Services/GettextCatalog.cs: move here so other libs can use easier.
diff --git a/main/src/core/MonoDevelop.Core/CoreExtensions.cs b/main/src/core/MonoDevelop.Core/CoreExtensions.cs
new file mode 100644
index 0000000000..68eaceeb02
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/CoreExtensions.cs
@@ -0,0 +1,40 @@
+//
+// CoreExtensions.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace System
+{
+ public static class CoreExtensions
+ {
+ public static IEnumerable<T> Concat<T> (this IEnumerable<T> e, T item)
+ {
+ return e.Concat (Enumerable.Repeat (item, 1));
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MSBuild/CodeSharing.CSharp.targets b/main/src/core/MonoDevelop.Core/MSBuild/CodeSharing.CSharp.targets
new file mode 100644
index 0000000000..df41a844aa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MSBuild/CodeSharing.CSharp.targets
@@ -0,0 +1,2 @@
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project>
diff --git a/main/src/core/MonoDevelop.Core/MSBuild/CodeSharing.Common.Default.props b/main/src/core/MonoDevelop.Core/MSBuild/CodeSharing.Common.Default.props
new file mode 100644
index 0000000000..df41a844aa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MSBuild/CodeSharing.Common.Default.props
@@ -0,0 +1,2 @@
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project>
diff --git a/main/src/core/MonoDevelop.Core/MSBuild/CodeSharing.Common.props b/main/src/core/MonoDevelop.Core/MSBuild/CodeSharing.Common.props
new file mode 100644
index 0000000000..df41a844aa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MSBuild/CodeSharing.Common.props
@@ -0,0 +1,2 @@
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project>
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/AssemblyContext.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/AssemblyContext.cs
index 03c844c227..5f2ddd3280 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/AssemblyContext.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/AssemblyContext.cs
@@ -29,20 +29,21 @@ using System.Linq;
using System.IO;
using System.Reflection;
using System.Collections.Generic;
+using System.Collections.Immutable;
using Mono.PkgConfig;
namespace MonoDevelop.Core.Assemblies
{
public class AssemblyContext: IAssemblyContext
{
- Dictionary<string, SystemPackage> assemblyPathToPackage = new Dictionary<string, SystemPackage> ();
- Dictionary<string, SystemAssembly> assemblyFullNameToAsm = new Dictionary<string, SystemAssembly> ();
- Dictionary<string, SystemPackage> packagesHash = new Dictionary<string, SystemPackage> ();
- List<SystemPackage> packages = new List<SystemPackage> ();
+ ImmutableDictionary<string, SystemPackage> assemblyPathToPackage = ImmutableDictionary<string, SystemPackage>.Empty;
+ ImmutableDictionary<string, SystemAssembly> assemblyFullNameToAsm = ImmutableDictionary<string, SystemAssembly>.Empty;
+ ImmutableDictionary<string, SystemPackage> packagesHash = ImmutableDictionary<string, SystemPackage>.Empty;
+ ImmutableList<SystemPackage> packages = ImmutableList<SystemPackage>.Empty;
public event EventHandler Changed;
- public ICollection<string> GetAssemblyFullNames ()
+ public IEnumerable<string> GetAssemblyFullNames ()
{
return assemblyFullNameToAsm.Keys;
}
@@ -90,8 +91,8 @@ namespace MonoDevelop.Core.Assemblies
asms.Add (AddAssembly (asm.File, new AssemblyInfo (asm), p));
}
p.Initialize (pinfo, asms, isInternal);
- packages.Add (p);
- packagesHash [pinfo.Name] = p;
+ packages = packages.Add (p);
+ packagesHash = packagesHash.SetItem (pinfo.Name, p);
NotifyChanged ();
@@ -117,8 +118,8 @@ namespace MonoDevelop.Core.Assemblies
foreach (SystemAssembly asm in p.Assemblies)
RemoveAssembly (asm);
- packages.Remove (p);
- packagesHash.Remove (p.Name);
+ packages = packages.Remove (p);
+ packagesHash = packagesHash.Remove (p.Name);
NotifyChanged ();
}
@@ -537,8 +538,8 @@ namespace MonoDevelop.Core.Assemblies
asm.NextSameName = prevAsm.NextSameName;
prevAsm.NextSameName = asm;
} else
- assemblyFullNameToAsm [asm.FullName] = asm;
- assemblyPathToPackage [assemblyfile] = package;
+ assemblyFullNameToAsm = assemblyFullNameToAsm.SetItem (asm.FullName, asm);
+ assemblyPathToPackage = assemblyPathToPackage.SetItem (assemblyfile, package);
return asm;
} catch {
return null;
@@ -551,7 +552,7 @@ namespace MonoDevelop.Core.Assemblies
if (!assemblyFullNameToAsm.TryGetValue (asm.FullName, out ca))
return;
- assemblyPathToPackage.Remove (asm.Location);
+ assemblyPathToPackage = assemblyPathToPackage.Remove (asm.Location);
SystemAssembly prev = null;
do {
@@ -559,9 +560,9 @@ namespace MonoDevelop.Core.Assemblies
if (prev != null)
prev.NextSameName = ca.NextSameName;
else if (ca.NextSameName != null)
- assemblyFullNameToAsm [asm.FullName] = ca.NextSameName;
+ assemblyFullNameToAsm = assemblyFullNameToAsm.SetItem (asm.FullName, ca.NextSameName);
else
- assemblyFullNameToAsm.Remove (asm.FullName);
+ assemblyFullNameToAsm = assemblyFullNameToAsm.Remove (asm.FullName);
break;
} else {
prev = ca;
@@ -577,8 +578,8 @@ namespace MonoDevelop.Core.Assemblies
&& packagesHash.TryGetValue (package.Name, out oldPackage) && !oldPackage.IsFrameworkPackage) {
ForceUnregisterPackage (oldPackage);
}
- packagesHash [package.Name] = package;
- packages.Add (package);
+ packagesHash = packagesHash.SetItem (package.Name, package);
+ packages = packages.Add (package);
}
public static AssemblyName ParseAssemblyName (string fullname)
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/ComposedAssemblyContext.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/ComposedAssemblyContext.cs
index 3136b5f48e..b1170c6f6b 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/ComposedAssemblyContext.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/ComposedAssemblyContext.cs
@@ -26,23 +26,26 @@
using System;
using System.Collections.Generic;
+using System.Collections.Immutable;
namespace MonoDevelop.Core.Assemblies
{
public class ComposedAssemblyContext: IAssemblyContext
{
- List<IAssemblyContext> sources = new List<IAssemblyContext> ();
+ ImmutableList<IAssemblyContext> sources = ImmutableList<IAssemblyContext>.Empty;
public void Add (IAssemblyContext ctx)
{
- sources.Add (ctx);
+ sources = sources.Add (ctx);
ctx.Changed += CtxChanged;
CtxChanged (null, null);
}
public void Remove (IAssemblyContext ctx)
{
- if (sources.Remove (ctx)) {
+ var prev = sources;
+ sources = sources.Remove (ctx);
+ if (sources != prev) {
ctx.Changed -= CtxChanged;
CtxChanged (null, null);
}
@@ -52,7 +55,7 @@ namespace MonoDevelop.Core.Assemblies
{
int i = sources.IndexOf (oldCtx);
if (i != -1) {
- sources [i] = newCtx;
+ sources = sources.SetItem (i, newCtx);
CtxChanged (null, null);
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs
index 84fc117ddc..73df382ce9 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs
@@ -109,13 +109,6 @@ namespace MonoDevelop.Core.Assemblies
public override IEnumerable<FilePath> GetReferenceFrameworkDirectories ()
{
- //during initializion, only return the global directory once (for the running runtime) so that it doesn't
- //get scanned multiple times
- return GetReferenceFrameworkDirectories (IsInitialized || IsRunning);
- }
-
- IEnumerable<FilePath> GetReferenceFrameworkDirectories (bool includeGlobalDirectories)
- {
//duplicate xbuild's framework folders path logic
//see xbuild man page
string env;
@@ -124,7 +117,7 @@ namespace MonoDevelop.Core.Assemblies
yield return (FilePath) dir;
}
- if (includeGlobalDirectories && Platform.IsMac) {
+ if (Platform.IsMac) {
yield return "/Library/Frameworks/Mono.framework/External/xbuild-frameworks";
}
@@ -148,8 +141,7 @@ namespace MonoDevelop.Core.Assemblies
public override IExecutionHandler GetExecutionHandler ()
{
if (execHandler == null) {
- string monoPath = Path.Combine (Path.Combine (MonoRuntimeInfo.Prefix, "bin"), "mono");
- execHandler = new MonoPlatformExecutionHandler (monoPath, environmentVariables);
+ execHandler = new MonoPlatformExecutionHandler (this);
}
return execHandler;
}
@@ -287,6 +279,43 @@ namespace MonoDevelop.Core.Assemblies
{
return new ExecutionEnvironment (EnvironmentVariables);
}
+
+ /// <summary>
+ /// Get the Mono executable best matching the assembly architecture flags.
+ /// </summary>
+ /// <remarks>Returns a fallback Mono executable, if a match cannot be found.</remarks>
+ /// <returns>The Mono executable that should be used to execute the assembly.</returns>
+ /// <param name="assemblyPath">Assembly path.</param>
+ public string GetMonoExecutableForAssembly (string assemblyPath)
+ {
+ IKVM.Reflection.PortableExecutableKinds peKind;
+ IKVM.Reflection.ImageFileMachine machine;
+
+ using (var universe = new IKVM.Reflection.Universe ()) {
+ IKVM.Reflection.Assembly assembly;
+ try {
+ assembly = universe.LoadFile (assemblyPath);
+ assembly.ManifestModule.GetPEKind (out peKind, out machine);
+ } catch {
+ peKind = IKVM.Reflection.PortableExecutableKinds.ILOnly;
+ machine = IKVM.Reflection.ImageFileMachine.I386;
+ }
+ }
+
+ string monoPath;
+
+ if ((peKind & (IKVM.Reflection.PortableExecutableKinds.Required32Bit | IKVM.Reflection.PortableExecutableKinds.Preferred32Bit)) != 0) {
+ monoPath = Path.Combine (MonoRuntimeInfo.Prefix, "bin", "mono32");
+ if (File.Exists (monoPath))
+ return monoPath;
+ } else if ((peKind & IKVM.Reflection.PortableExecutableKinds.PE32Plus) != 0) {
+ monoPath = Path.Combine (MonoRuntimeInfo.Prefix, "bin", "mono64");
+ if (File.Exists (monoPath))
+ return monoPath;
+ }
+
+ return monoPath = Path.Combine (MonoRuntimeInfo.Prefix, "bin", "mono");
+ }
}
class PcFileCacheContext: Mono.PkgConfig.IPcFileCacheContext<LibraryPackageInfo>
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/SystemAssemblyService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/SystemAssemblyService.cs
index a03241af68..c46e6dfb26 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/SystemAssemblyService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/SystemAssemblyService.cs
@@ -36,6 +36,7 @@ using MonoDevelop.Core.AddIns;
using Mono.Addins;
using System.Reflection;
using System.Linq;
+using System.Collections.Immutable;
namespace MonoDevelop.Core.Assemblies
{
@@ -415,22 +416,37 @@ namespace MonoDevelop.Core.Assemblies
}
}
+ static ImmutableDictionary<string, bool> referenceDict = ImmutableDictionary<string, bool>.Empty;
+ static object referenceLock = new object ();
+
public static bool ContainsReferenceToSystemRuntime (string fileName)
{
- using (var universe = new IKVM.Reflection.Universe ()) {
- IKVM.Reflection.Assembly assembly;
- try {
- assembly = universe.LoadFile (fileName);
- } catch {
- return false;
- }
- foreach (var r in assembly.GetReferencedAssemblies ()) {
- if (r.FullName.Equals ("System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"))
- return true;
+ lock (referenceLock) {
+ bool result;
+ if (referenceDict.TryGetValue (fileName, out result))
+ return result;
+
+ //const int cacheLimit = 4096;
+ //if (referenceDict.Count > cacheLimit)
+ // referenceDict = ImmutableDictionary<string, bool>.Empty
+
+ using (var universe = new IKVM.Reflection.Universe ()) {
+ IKVM.Reflection.Assembly assembly;
+ try {
+ assembly = universe.LoadFile (fileName);
+ } catch {
+ return false;
+ }
+ foreach (var r in assembly.GetReferencedAssemblies ()) {
+ if (r.FullName.Equals ("System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")) {
+ referenceDict = referenceDict.SetItem (fileName, true);
+ return true;
+ }
+ }
}
+ referenceDict = referenceDict.SetItem (fileName, false);
+ return false;
}
-
- return false;
}
public class ManifestResource
@@ -470,6 +486,5 @@ namespace MonoDevelop.Core.Assemblies
}
}
}
-
}
-}
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetFramework.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetFramework.cs
index d3be657e8e..ab96b7ac7a 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetFramework.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetFramework.cs
@@ -299,6 +299,8 @@ namespace MonoDevelop.Core.Assemblies
break;
case "4.5":
case "4.5.1":
+ // PCL 4.6 uses 4.6 as the "Rutime version", not sure why, since it has nothing to do with .NET 4.6
+ case "4.6":
fx.clrVersion = ClrVersion.Net_4_5;
break;
default:
@@ -364,7 +366,7 @@ namespace MonoDevelop.Core.Assemblies
if (reader.MoveToAttribute ("InGac") && reader.ReadAttributeValue ())
ainfo.InGac = reader.ReadContentAsBoolean ();
} while (reader.ReadToFollowing ("File"));
- } else {
+ } else if (Directory.Exists (dir)) {
// HACK: we were using EnumerateFiles but it's broken in some Mono releases
// https://bugzilla.xamarin.com/show_bug.cgi?id=2975
@@ -375,9 +377,11 @@ namespace MonoDevelop.Core.Assemblies
var ainfo = new AssemblyInfo ();
ainfo.Update (an);
assemblies.Add (ainfo);
+ } catch (BadImageFormatException ex) {
+ LoggingService.LogError ("Invalid assembly in framework '{0}': {1}{2}{3}", fx.Id, f, Environment.NewLine, ex.ToString ());
} catch (Exception ex) {
- LoggingService.LogError ("Error reading name for assembly '{0}' in framework '{1}':\n{2}",
- f, fx.Id, ex.ToString ());
+ LoggingService.LogError ("Error reading assembly '{0}' in framework '{1}':{2}{3}",
+ f, fx.Id, Environment.NewLine, ex.ToString ());
}
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetRuntime.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetRuntime.cs
index 2be51b1f9e..adec8d3baf 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetRuntime.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetRuntime.cs
@@ -41,6 +41,7 @@ using MonoDevelop.Core.Serialization;
using Mono.Addins;
using Mono.PkgConfig;
using MonoDevelop.Core.Instrumentation;
+using System.Linq;
namespace MonoDevelop.Core.Assemblies
{
@@ -292,6 +293,16 @@ namespace MonoDevelop.Core.Assemblies
return Directory.GetFiles (facades, "*.dll");
}
+ //MonoDroid is special case because it's keeping Fascades in v1.0 folder
+ if (tx.Id.Identifier == TargetFrameworkMoniker.ID_MONODROID) {
+ var frameworkFolder = GetFrameworkFolders (tx).FirstOrDefault ();
+ if (frameworkFolder != null) {
+ var facades = Path.Combine (Path.Combine (Path.GetDirectoryName (frameworkFolder), "v1.0"), "Facades");
+ if (Directory.Exists (facades))
+ return Directory.GetFiles (facades, "*.dll");
+ }
+ }
+
return new string[0];
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/BinaryMessage.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/BinaryMessage.cs
new file mode 100644
index 0000000000..bb83d11c39
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/BinaryMessage.cs
@@ -0,0 +1,748 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Collections;
+using System.Reflection;
+using System.Reflection.Emit;
+using System.Runtime.InteropServices;
+
+namespace MonoDevelop.Core.Execution
+{
+ public class BinaryMessage
+ {
+ enum TypeCode
+ {
+ Array = 1,
+ String = 2,
+ Object = 3,
+ Map = 4,
+ Null = 5,
+ Boolean = 6,
+ Single = 7,
+ Double = 8,
+ Int16 = 9,
+ Int32 = 10,
+ Int64 = 11,
+ Byte = 12,
+ DateTime = 13,
+ TimeSpan = 14,
+ }
+
+ static object dataTypesLock = new object ();
+ static Dictionary<Type, TypeMap> dataTypes = new Dictionary<Type, TypeMap> ();
+
+ List<BinaryMessageArgument> args = new List<BinaryMessageArgument> ();
+ static int nextId;
+
+ public int Id { get; set; }
+ public string Name { get; set; }
+ public string Target { get; set; }
+ public DateTime SentTime { get; set; }
+ public bool OneWay { get; set; }
+ internal bool BypassConnection { get; set; }
+
+ internal long ProcessingTime { get; set; }
+
+ public BinaryMessage CreateResponse ()
+ {
+ return new BinaryMessage {
+ Name = Name + "Response",
+ Id = Id
+ };
+ }
+
+ public BinaryMessage CreateResponse (object result)
+ {
+ return new BinaryMessage {
+ Name = Name + "Response",
+ Id = Id
+ }.AddArgument ("Result", result);
+ }
+
+ public BinaryMessage CreateErrorResponse (string message, bool isInternal = false)
+ {
+ return new BinaryMessage ("Error") { Id = Id }.AddArgument ("Message", message).AddArgument ("IsInternal", isInternal);
+ }
+
+ public BinaryMessage AddArgument (string name, object value)
+ {
+ args.Add (new BinaryMessageArgument () { Name = name, Value = value });
+ return this;
+ }
+
+ public object GetArgument (string name)
+ {
+ var arg = args.FirstOrDefault (a => a.Name == name);
+ return arg != null ? arg.Value : null;
+ }
+
+ public T GetArgument<T> (string name)
+ {
+ var r = GetArgument (name);
+ return (T)ConvertToType (r, typeof (T));
+ }
+
+ public List<BinaryMessageArgument> Args {
+ get { return args; }
+ }
+
+ protected BinaryMessage ()
+ {
+ Id = System.Threading.Interlocked.Increment (ref nextId);
+ }
+
+ public BinaryMessage (string name)
+ {
+ Id = System.Threading.Interlocked.Increment (ref nextId);
+ Name = name ?? "";
+ Target = "";
+ }
+
+ public BinaryMessage (string name, string target)
+ {
+ Id = System.Threading.Interlocked.Increment (ref nextId);
+ Name = name ?? "";
+ Target = target ?? "";
+ }
+
+ public void CopyFrom (BinaryMessage msg)
+ {
+ Id = msg.Id;
+ Name = msg.Name;
+ Target = msg.Target;
+ SentTime = msg.SentTime;
+ OneWay = msg.OneWay;
+ BypassConnection = msg.BypassConnection;
+ ProcessingTime = msg.ProcessingTime;
+ args = new List<BinaryMessageArgument> (msg.args);
+ LoadCustomData ();
+ }
+
+ internal protected virtual Type GetResponseType ()
+ {
+ return typeof (BinaryMessage);
+ }
+
+ internal void ReadCustomData ()
+ {
+ var att = (MessageDataTypeAttribute) Attribute.GetCustomAttribute (GetType (), typeof (MessageDataTypeAttribute));
+ if (att == null)
+ return;
+ if (string.IsNullOrEmpty (Name)) {
+ Name = att.Name ?? GetType ().FullName;
+ }
+ var data = WriteMessageData (this);
+ foreach (var e in data)
+ AddArgument (e.Key, e.Value);
+ }
+
+ internal void LoadCustomData ()
+ {
+ if (!Attribute.IsDefined (GetType (), typeof (MessageDataTypeAttribute)))
+ return;
+ ReadMessageData ();
+ }
+
+ public void Write (Stream outStream)
+ {
+ MemoryStream s = new MemoryStream ();
+ BinaryWriter bw = new BinaryWriter (s);
+ bw.Write (Id);
+ bw.Write (Name ?? "");
+ bw.Write (Target ?? "");
+ bw.Write (args.Count);
+ foreach (var arg in args) {
+ bw.Write (arg.Name ?? "");
+ WriteValue (bw, arg.Value);
+ }
+ var data = s.ToArray ();
+ bw = new BinaryWriter (outStream);
+ bw.Write (data.Length);
+ bw.Write (data);
+ }
+
+ void WriteValue (BinaryWriter bw, object val)
+ {
+ if (val == null)
+ bw.Write ((byte)TypeCode.Null);
+ else if (val is Array) {
+ bw.Write ((byte)TypeCode.Array);
+ WriteArray (bw, val);
+ } else if (val is byte) {
+ bw.Write ((byte)TypeCode.Byte);
+ bw.Write ((byte)val);
+ } else if (val is short) {
+ bw.Write ((byte)TypeCode.Int16);
+ bw.Write ((short)val);
+ } else if (val is int) {
+ bw.Write ((byte)TypeCode.Int32);
+ bw.Write ((int)val);
+ } else if (val is long) {
+ bw.Write ((byte)TypeCode.Int64);
+ bw.Write ((long)val);
+ } else if (val is float) {
+ bw.Write ((byte)TypeCode.Single);
+ bw.Write ((float)val);
+ } else if (val is double) {
+ bw.Write ((byte)TypeCode.Double);
+ bw.Write ((double)val);
+ } else if (val is string) {
+ bw.Write ((byte)TypeCode.String);
+ bw.Write ((string)val);
+ } else if (val is bool) {
+ bw.Write ((byte)TypeCode.Boolean);
+ bw.Write ((bool)val);
+ } else if (val is DateTime) {
+ bw.Write ((byte)TypeCode.DateTime);
+ bw.Write (((DateTime)val).Ticks);
+ } else if (val is TimeSpan) {
+ bw.Write ((byte)TypeCode.TimeSpan);
+ bw.Write (((TimeSpan)val).Ticks);
+ } else if (val.GetType ().IsGenericType && val.GetType ().GetGenericTypeDefinition () == typeof(Dictionary<,>)) {
+ bw.Write ((byte)TypeCode.Map);
+ var t = val.GetType ();
+ var keyType = t.GetGenericArguments () [0];
+ var valueType = t.GetGenericArguments () [1];
+ var dict = (IDictionary)val;
+ var keys = Array.CreateInstance (keyType, dict.Count);
+ var values = Array.CreateInstance (valueType, dict.Count);
+ int n = 0;
+ foreach (DictionaryEntry e in dict) {
+ keys.SetValue (e.Key, n);
+ values.SetValue (e.Value, n);
+ n++;
+ }
+ WriteArray (bw, keys);
+ WriteArray (bw, values);
+ } else if (val.GetType ().IsEnum) {
+ WriteValue (bw, Convert.ToInt64(val));
+ } else {
+ var d = WriteMessageData (val);
+ WriteValue (bw, d);
+ }
+ }
+
+ void WriteArray (BinaryWriter bw, object val)
+ {
+ Array array = (Array)val;
+ bw.Write (array.Length);
+
+ var et = val.GetType ().GetElementType ();
+
+ if (et == typeof(byte)) {
+ bw.Write ((byte)TypeCode.Byte);
+ bw.Write ((byte [])val);
+ } else if (et == typeof(short)) {
+ bw.Write ((byte)TypeCode.Int16);
+ foreach (var v in (short [])val)
+ bw.Write (v);
+ } else if (et == typeof(int)) {
+ bw.Write ((byte)TypeCode.Int32);
+ foreach (var v in (int [])val)
+ bw.Write (v);
+ } else if (et == typeof(long)) {
+ bw.Write ((byte)TypeCode.Int64);
+ foreach (var v in (long [])val)
+ bw.Write (v);
+ } else if (et == typeof(float)) {
+ bw.Write ((byte)TypeCode.Single);
+ foreach (var v in (float [])val)
+ bw.Write (v);
+ } else if (et == typeof(double)) {
+ bw.Write ((byte)TypeCode.Double);
+ foreach (var v in (double [])val)
+ bw.Write (v);
+ } else if (et == typeof(string)) {
+ bw.Write ((byte)TypeCode.String);
+ foreach (var v in (string [])val)
+ bw.Write (v);
+ } else if (et == typeof(bool)) {
+ bw.Write ((byte)TypeCode.Boolean);
+ foreach (var v in (bool [])val)
+ bw.Write (v);
+ } else if (et == typeof(DateTime)) {
+ bw.Write ((byte)TypeCode.DateTime);
+ foreach (var v in (DateTime [])val)
+ bw.Write (v.Ticks);
+ } else if (et == typeof(TimeSpan)) {
+ bw.Write ((byte)TypeCode.TimeSpan);
+ foreach (var v in (TimeSpan [])val)
+ bw.Write (v.Ticks);
+ } else {
+ bw.Write ((byte)TypeCode.Object);
+ foreach (var elem in array)
+ WriteValue (bw, elem);
+ }
+ }
+
+ public static BinaryMessage Read (Stream s)
+ {
+ BinaryReader br = new BinaryReader (s);
+ br.ReadInt32 (); // length
+
+ BinaryMessage msg = new BinaryMessage ();
+ msg.Id = br.ReadInt32 ();
+ msg.Name = br.ReadString ();
+ msg.Target = br.ReadString ();
+ int ac = br.ReadInt32 ();
+ for (int n=0; n<ac; n++) {
+ BinaryMessageArgument arg = new BinaryMessageArgument ();
+ arg.Name = br.ReadString ();
+ arg.Value = ReadValue (br);
+ msg.Args.Add (arg);
+ }
+ return msg;
+ }
+
+ public static object ReadValue (BinaryReader br)
+ {
+ byte t = br.ReadByte ();
+ switch ((TypeCode)t) {
+ case TypeCode.Null:
+ return null;
+ case TypeCode.Array:
+ return ReadArray (br);
+ case TypeCode.Double:
+ return br.ReadDouble ();
+ case TypeCode.Byte:
+ return br.ReadByte ();
+ case TypeCode.Int16:
+ return br.ReadInt16 ();
+ case TypeCode.Int32:
+ return br.ReadInt32 ();
+ case TypeCode.Int64:
+ return br.ReadInt64 ();
+ case TypeCode.Single:
+ return br.ReadSingle ();
+ case TypeCode.String:
+ return br.ReadString ();
+ case TypeCode.Boolean:
+ return br.ReadBoolean ();
+ case TypeCode.DateTime:
+ return new DateTime (br.ReadInt64 ());
+ case TypeCode.TimeSpan:
+ return new TimeSpan (br.ReadInt64 ());
+ case TypeCode.Map: {
+ var keys = (Array)ReadArray (br);
+ var values = (Array)ReadArray (br);
+ var dt = typeof (Dictionary<,>);
+ var dictType = dt.MakeGenericType (keys.GetType ().GetElementType (), values.GetType ().GetElementType ());
+
+ var dict = (IDictionary)Activator.CreateInstance (dictType);
+ for (int n = 0; n < keys.Length; n++)
+ dict [keys.GetValue (n)] = values.GetValue (n);
+ return dict;
+ }
+ }
+ throw new NotSupportedException ("code: " + t);
+ }
+
+ static object ReadArray (BinaryReader br)
+ {
+ int count = br.ReadInt32 ();
+ var type = (TypeCode)br.ReadByte ();
+
+ switch (type) {
+ case TypeCode.Object: {
+ var a = new object [count];
+ for (int n = 0; n < count; n++)
+ a [n] = ReadValue (br);
+ return a;
+ }
+ case TypeCode.Double: {
+ var a = new double [count];
+ for (int n = 0; n < count; n++)
+ a [n] = br.ReadDouble ();
+ return a;
+ }
+ case TypeCode.Byte: {
+ return br.ReadBytes (count);
+ }
+ case TypeCode.Int16: {
+ var a = new short [count];
+ for (int n = 0; n < count; n++)
+ a [n] = br.ReadInt16 ();
+ return a;
+ }
+ case TypeCode.Int32: {
+ var a = new int [count];
+ for (int n = 0; n < count; n++)
+ a [n] = br.ReadInt32 ();
+ return a;
+ }
+ case TypeCode.Int64: {
+ var a = new long [count];
+ for (int n = 0; n < count; n++)
+ a [n] = br.ReadInt64 ();
+ return a;
+ }
+ case TypeCode.Single: {
+ var a = new float [count];
+ for (int n = 0; n < count; n++)
+ a [n] = br.ReadSingle ();
+ return a;
+ }
+ case TypeCode.String: {
+ var a = new string [count];
+ for (int n = 0; n < count; n++)
+ a [n] = br.ReadString ();
+ return a;
+ }
+ case TypeCode.Boolean: {
+ var a = new bool [count];
+ for (int n = 0; n < count; n++)
+ a [n] = br.ReadBoolean ();
+ return a;
+ }
+ case TypeCode.DateTime: {
+ var a = new DateTime [count];
+ for (int n = 0; n < count; n++)
+ a [n] = new DateTime (br.ReadInt64 ());
+ return a;
+ }
+ case TypeCode.TimeSpan: {
+ var a = new TimeSpan [count];
+ for (int n = 0; n < count; n++)
+ a [n] = new TimeSpan (br.ReadInt64 ());
+ return a;
+ }
+ }
+ throw new NotSupportedException ("Array of " + type);
+ }
+
+ bool IsSerializableType (Type type)
+ {
+ return Type.GetTypeCode (type) == System.TypeCode.Object && !type.IsArray && !typeof(IDictionary).IsAssignableFrom (type);
+ }
+
+ public override string ToString ()
+ {
+ var sb = new StringBuilder ();
+ foreach (var ar in args) {
+ if (sb.Length > 0)
+ sb.Append (", ");
+ sb.Append (ar.Name).Append (":");
+ AppendArg (sb, ar.Value);
+ }
+ return string.Format ("({3}) [{0} Target={1}, Args=[{2}]]", Name, Target, sb, Id);
+ }
+
+ void AppendArg (StringBuilder sb, object arg)
+ {
+ if (arg == null)
+ sb.Append ("(null)");
+ else if (arg is IDictionary) {
+ sb.Append ("{");
+ foreach (DictionaryEntry e in (IDictionary)arg) {
+ if (sb.Length > 0)
+ sb.Append (", ");
+ sb.Append (e.Key).Append (":");
+ AppendArg (sb, e.Value);
+ }
+ sb.Append ("}");
+ } else if (arg is byte[])
+ sb.Append ("byte[").Append (((byte[])arg).Length).Append ("]");
+ else if (arg is Array) {
+ sb.Append ("[");
+ foreach (object e in (Array)arg) {
+ if (sb.Length > 0)
+ sb.Append (", ");
+ AppendArg (sb, e);
+ }
+ sb.Append ("]");
+ }
+ else
+ sb.Append (arg);
+ }
+
+ TypeMap GetTypeMap (Type type)
+ {
+ TypeMap map;
+ if (dataTypes.TryGetValue (type, out map))
+ return map;
+
+ lock (dataTypesLock) {
+ var newTypes = new Dictionary<Type, TypeMap> (dataTypes);
+ if (!Attribute.IsDefined (type, typeof (MessageDataTypeAttribute))) {
+ map = newTypes [type] = null;
+ } else {
+ map = new TypeMap ();
+ foreach (var m in type.GetMembers (BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)) {
+ var at = (MessageDataPropertyAttribute)Attribute.GetCustomAttribute (m, typeof(MessageDataPropertyAttribute));
+ if (at == null || (!(m is PropertyInfo) && !(m is FieldInfo)))
+ continue;
+ map [at.Name ?? m.Name] = m;
+ }
+ newTypes [type] = map;
+ }
+ dataTypes = newTypes;
+ return map;
+ }
+ }
+
+ void ReadMessageData ()
+ {
+ TypeMap map = GetTypeMap (GetType ());
+ if (map == null)
+ throw new InvalidOperationException ("Type '" + GetType ().FullName + "' can't be read from message data. The type must have the [MessageDataType] attribute applied to it");
+
+ foreach (var e in map) {
+ var m = e.Value;
+ object val = GetArgument (e.Key);
+ if (m is PropertyInfo) {
+ val = ConvertToType (val, ((PropertyInfo)m).PropertyType);
+ ((PropertyInfo)m).SetValue (this, val, null);
+ } else {
+ val = ConvertToType (val, ((FieldInfo)m).FieldType);
+ ((FieldInfo)m).SetValue (this, val);
+ }
+ }
+ }
+
+ object ReadMessageData (Type type, Dictionary<string, object> data)
+ {
+ TypeMap map = GetTypeMap (type);
+ if (map == null)
+ throw new InvalidOperationException ("Type '" + type.FullName + "' can't be read from message data. The type must have the [MessageDataType] attribute applied to it");
+
+ var result = Activator.CreateInstance (type, true);
+ foreach (var e in map) {
+ var m = e.Value;
+ object val;
+ if (data.TryGetValue (e.Key, out val)) {
+ if (m is PropertyInfo) {
+ var prop = (PropertyInfo)m;
+ val = ConvertToType (val, prop.PropertyType);
+ prop.SetValue (result, val, null);
+ } else {
+ var field = (FieldInfo)m;
+ val = ConvertToType (val, field.FieldType);
+ field.SetValue (result, val);
+ }
+ }
+ }
+ return result;
+ }
+
+ object ConvertToType (object ob, Type type)
+ {
+ if (ob == null)
+ return null;
+
+ if (type.IsAssignableFrom (ob.GetType ()))
+ return ob;
+
+ if (ob is Dictionary<string, object> && IsSerializableType (type))
+ return ReadMessageData (type, (Dictionary<string, object>)ob);
+
+ if (ob.GetType ().IsGenericType && ob.GetType().GetGenericTypeDefinition () == typeof(Dictionary<,>)) {
+ if (type.IsGenericType && type.GetGenericTypeDefinition () == typeof(Dictionary<,>)) {
+ var targs = type.GetGenericArguments ();
+ var keyType = targs [0];
+ var elemType = targs [1];
+ var dict = (IDictionary)Activator.CreateInstance (type);
+ foreach (DictionaryEntry e in (IDictionary)ob) {
+ var key = ConvertToType (e.Key, keyType);
+ var val = ConvertToType (e.Value, elemType);
+ dict [key] = val;
+ }
+ return dict;
+ }
+ }
+ if (type.IsEnum && !ob.GetType ().IsEnum) {
+ return Enum.ToObject (type, ob);
+ }
+
+ var array = ob as Array;
+ if (array != null) {
+ if (type.IsArray && ob.GetType ().GetElementType () != type.GetElementType ()) {
+ // Array types are different. Convert!
+ var targetType = type.GetElementType ();
+ var newArray = Array.CreateInstance (targetType, array.Length);
+ for (int n = 0; n < array.Length; n++) {
+ var val = ConvertToType (array.GetValue (n), targetType);
+ newArray.SetValue (val, n);
+ }
+ return newArray;
+ }
+ }
+ return ob;
+ }
+
+ Dictionary<string, object> WriteMessageData (object instance)
+ {
+ TypeMap map = GetTypeMap (instance.GetType ());
+ if (map == null)
+ throw new InvalidOperationException ("Type '" + instance.GetType ().FullName + "' can't be serialized. The type must have the [MessageDataType] attribute applied to it");
+
+ Dictionary<string, object> data = new Dictionary<string, object> ();
+ foreach (var e in map) {
+ var m = e.Value;
+ object val;
+ if (m is PropertyInfo)
+ val = ((PropertyInfo)m).GetValue (instance, null);
+ else
+ val = ((FieldInfo)m).GetValue (instance);
+ data [e.Key] = val;
+ }
+ return data;
+ }
+
+ class TypeMap: Dictionary<string,MemberInfo>
+ {
+ }
+ }
+
+ public class BinaryMessageArgument
+ {
+ public string Name { get; set; }
+ public object Value { get; set; }
+ }
+
+ public class BinaryMessage<RT>: BinaryMessage where RT:BinaryMessage
+ {
+ internal protected override Type GetResponseType ()
+ {
+ return typeof (RT);
+ }
+ }
+
+ public class MessageListener
+ {
+ Dictionary<string, MethodInfo> handlers = new Dictionary<string, MethodInfo> ();
+ object target;
+
+ public MessageListener ()
+ {
+ target = this;
+ RegisterHandlers ();
+ }
+
+ internal MessageListener (object target)
+ {
+ this.target = target;
+ RegisterHandlers ();
+ }
+
+ internal object Target {
+ get {
+ return target;
+ }
+ }
+
+ public virtual string TargetId {
+ get { return ""; }
+ }
+
+ void RegisterHandlers ()
+ {
+ foreach (var m in target.GetType ().GetMethods (BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)) {
+ var att = (MessageHandlerAttribute) Attribute.GetCustomAttribute (m, typeof (MessageHandlerAttribute));
+ if (att != null) {
+ var pars = m.GetParameters ();
+ if (pars.Length != 1 || !typeof (BinaryMessage).IsAssignableFrom (pars [0].ParameterType))
+ continue;
+ var name = att.Name;
+ if (name == null) {
+ var ma = (MessageDataTypeAttribute) Attribute.GetCustomAttribute (pars [0].ParameterType, typeof (MessageDataTypeAttribute));
+ if (ma != null)
+ name = ma.Name;
+ if (name == null) {
+ if (pars [0].ParameterType != typeof (BinaryMessage))
+ name = pars [0].ParameterType.FullName;
+ else
+ name = m.Name;
+ }
+ }
+ handlers [name] = m;
+ }
+ }
+ }
+
+ internal BinaryMessage ProcessMessage (BinaryMessage msg)
+ {
+ MethodInfo m;
+ if (handlers.TryGetValue (msg.Name, out m)) {
+ var r = m.Invoke (target, new object [] { msg });
+ if (r is BinaryMessage)
+ return (BinaryMessage)r;
+ else
+ return msg.CreateResponse ();
+ }
+ return null;
+ }
+
+ internal Type [] GetMessageTypes ()
+ {
+ HashSet<Type> res = new HashSet<Type> ();
+ foreach (var h in handlers.Values) {
+ res.Add (h.GetParameters () [0].ParameterType);
+ }
+ return res.ToArray ();
+ }
+ }
+
+ class RemoteProcessException: Exception
+ {
+ public string ExtendedDetails { get; set; }
+
+ public RemoteProcessException ()
+ {
+ }
+
+ public RemoteProcessException (string message, Exception wrappedException = null): base (message, wrappedException)
+ {
+ if (wrappedException != null)
+ ExtendedDetails = wrappedException.ToString ();
+ }
+
+ }
+
+ [AttributeUsage (AttributeTargets.Class)]
+ public class MessageDataTypeAttribute : Attribute
+ {
+ public MessageDataTypeAttribute ()
+ {
+ }
+
+ public MessageDataTypeAttribute (string name)
+ {
+ Name = name;
+ }
+
+ public string Name { get; set; }
+ }
+
+ [AttributeUsage (AttributeTargets.Property | AttributeTargets.Field)]
+ public class MessageDataPropertyAttribute : Attribute
+ {
+ public MessageDataPropertyAttribute ()
+ {
+ }
+
+ public MessageDataPropertyAttribute (string name)
+ {
+ Name = name;
+ }
+
+ public string Name { get; set; }
+ }
+
+ [AttributeUsage (AttributeTargets.Method)]
+ public class MessageHandlerAttribute : Attribute
+ {
+ public MessageHandlerAttribute ()
+ {
+ }
+
+ public MessageHandlerAttribute (string name)
+ {
+ Name = name;
+ }
+
+ public string Name { get; set; }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/DefaultExecutionHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/DefaultExecutionHandler.cs
index e56f71e714..6f29bd4958 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/DefaultExecutionHandler.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/DefaultExecutionHandler.cs
@@ -27,6 +27,7 @@
//
using System;
+using System.Threading;
namespace MonoDevelop.Core.Execution
{
@@ -37,7 +38,7 @@ namespace MonoDevelop.Core.Execution
return Runtime.ProcessService.GetDefaultExecutionHandler (command) != null;
}
- public IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
+ public ProcessAsyncOperation Execute (ExecutionCommand command, OperationConsole console)
{
IExecutionHandler handler = Runtime.ProcessService.GetDefaultExecutionHandler (command);
return handler.Execute (command, console);
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/DotNetExecutionHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/DotNetExecutionHandler.cs
index da3985afa5..873eb004db 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/DotNetExecutionHandler.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/DotNetExecutionHandler.cs
@@ -35,7 +35,7 @@ namespace MonoDevelop.Core.Execution
return command is DotNetExecutionCommand;
}
- public IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
+ public ProcessAsyncOperation Execute (ExecutionCommand command, OperationConsole console)
{
DotNetExecutionCommand cmd = (DotNetExecutionCommand) command;
if (cmd.TargetRuntime == null)
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ExternalConsoleFactory.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ExternalConsoleFactory.cs
index 335a73da35..50231e64ca 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ExternalConsoleFactory.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ExternalConsoleFactory.cs
@@ -28,55 +28,51 @@
using System;
using System.IO;
+using System.Threading;
namespace MonoDevelop.Core.Execution
{
- public sealed class ExternalConsoleFactory: IConsoleFactory
+ public sealed class ExternalConsoleFactory: OperationConsoleFactory
{
public static ExternalConsoleFactory Instance = new ExternalConsoleFactory ();
- public IConsole CreateConsole (bool closeOnDispose)
+ public ExternalConsole CreateConsole (bool closeOnDispose, CancellationToken cancellationToken = default (CancellationToken))
{
- return new ExternalConsole (closeOnDispose);
+ var c = new ExternalConsole (closeOnDispose);
+ if (cancellationToken != default(CancellationToken))
+ c.BindToCancelToken (cancellationToken);
+ return c;
+ }
+
+ protected override OperationConsole OnCreateConsole (CreateConsoleOptions options)
+ {
+ return new ExternalConsole (true);
}
}
- public sealed class ExternalConsole: IConsole
+ public sealed class ExternalConsole: OperationConsole
{
- bool closeOnDispose;
-
internal ExternalConsole (bool closeOnDispose)
{
- this.closeOnDispose = closeOnDispose;
+ CloseOnDispose = closeOnDispose;
}
- public TextReader In {
+ public bool CloseOnDispose { get; set; }
+
+ public override TextReader In {
get { return Console.In; }
}
- public TextWriter Out {
+ public override TextWriter Out {
get { return Console.Out; }
}
- public TextWriter Error {
+ public override TextWriter Error {
get { return Console.Error; }
}
- public bool CloseOnDispose {
- get { return closeOnDispose; }
- }
-
- public TextWriter Log {
+ public override TextWriter Log {
get { return Out; }
}
-
- public void Dispose ()
- {
- }
-
- public event EventHandler CancelRequested {
- add {}
- remove {}
- }
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IConsole.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IConsole.cs
deleted file mode 100644
index 4d29687ebb..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IConsole.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// IConsole.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-namespace MonoDevelop.Core.Execution
-{
- public interface IConsole: IDisposable
- {
- TextReader In { get; }
- TextWriter Out { get; }
- TextWriter Error { get; }
- TextWriter Log { get; }
- bool CloseOnDispose { get; }
-
- event EventHandler CancelRequested;
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IConsoleFactory.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IConsoleFactory.cs
deleted file mode 100644
index 586b1251a1..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IConsoleFactory.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// IConsoleFactory.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace MonoDevelop.Core.Execution
-{
- public interface IConsoleFactory
- {
- IConsole CreateConsole (bool closeOnDispose);
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IDebugConsole.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IDebugConsole.cs
deleted file mode 100644
index feded135b7..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IDebugConsole.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// IDebugConsole.cs
-//
-// Author:
-// David Karlaš <david.karlas@xamarin.com>
-//
-// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.IO;
-
-namespace MonoDevelop.Core.Execution
-{
- public interface IDebugConsole: IConsole
- {
- void Debug (int level, string category, string message);
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IExecutionHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IExecutionHandler.cs
index 08a9201224..fbde4d74ec 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IExecutionHandler.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IExecutionHandler.cs
@@ -28,6 +28,7 @@
using System;
using System.Collections.Generic;
+using System.Threading;
namespace MonoDevelop.Core.Execution
{
@@ -56,7 +57,7 @@ namespace MonoDevelop.Core.Execution
/// <param name='console'>
/// Console where to log the output
/// </param>
- IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console);
+ ProcessAsyncOperation Execute (ExecutionCommand command, OperationConsole console);
}
/// <summary>
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IProcessAsyncOperation.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IProcessAsyncOperation.cs
deleted file mode 100644
index 977ea67c7c..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/IProcessAsyncOperation.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// IProcessAsyncOperation.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using MonoDevelop.Core;
-using MonoDevelop.Core.ProgressMonitoring;
-
-namespace MonoDevelop.Core.Execution
-{
- public interface IProcessAsyncOperation: IAsyncOperation, IDisposable
- {
- int ExitCode { get; }
-
- int ProcessId { get; }
- }
-
- public class NullProcessAsyncOperation : NullAsyncOperation, IProcessAsyncOperation
- {
- public NullProcessAsyncOperation (bool success) : base (success, false) {}
- public int ExitCode { get { return ((IAsyncOperation)this).Success? 0 : 1; } }
- public int ProcessId { get { return 0; } }
-
- void IDisposable.Dispose () {}
-
- public new static NullProcessAsyncOperation Success = new NullProcessAsyncOperation (true);
- public new static NullProcessAsyncOperation Failure = new NullProcessAsyncOperation (false);
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/LocalConsole.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/LocalConsole.cs
index 1c7c15741c..9731bde3f4 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/LocalConsole.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/LocalConsole.cs
@@ -36,7 +36,7 @@ namespace MonoDevelop.Core.Execution
/// This is an implementation of the IConsole interface which allows reading
/// the output generated from a process, and writing its input.
/// </summary>
- public class LocalConsole: IConsole
+ public class LocalConsole: OperationConsole
{
InternalWriter cin;
InternalWriter cout;
@@ -51,12 +51,13 @@ namespace MonoDevelop.Core.Execution
cin = new InternalWriter ();
}
- public void Dispose ()
+ public override void Dispose ()
{
cout.Dispose ();
cerror.Dispose ();
clog.Dispose ();
cin.Dispose ();
+ base.Dispose ();
}
/// <summary>
@@ -73,14 +74,14 @@ namespace MonoDevelop.Core.Execution
/// <summary>
/// This writer can be used to provide the input of the console.
/// </summary>
- public TextWriter In {
+ public TextWriter InWriter {
get { return cin; }
}
/// <summary>
/// Output of the process.
/// </summary>
- public TextReader Out {
+ public TextReader OutReader {
get {
return cout.DataReader;
}
@@ -89,7 +90,7 @@ namespace MonoDevelop.Core.Execution
/// <summary>
/// Error log of the process
/// </summary>
- public TextReader Error {
+ public TextReader ErrorReader {
get {
return cerror.DataReader;
}
@@ -98,46 +99,35 @@ namespace MonoDevelop.Core.Execution
/// <summary>
/// Log of the process
/// </summary>
- public TextReader Log {
+ public TextReader LogReader {
get {
return clog.DataReader;
}
}
- TextReader IConsole.In {
+ public override TextReader In {
get {
return cin.DataReader;
}
}
- TextWriter IConsole.Out {
+ public override TextWriter Out {
get {
return cout;
}
}
- TextWriter IConsole.Error {
+ public override TextWriter Error {
get {
return cerror;
}
}
- TextWriter IConsole.Log {
+ public override TextWriter Log {
get {
return clog;
}
}
-
- bool IConsole.CloseOnDispose {
- get {
- return true;
- }
- }
-
- public event EventHandler CancelRequested {
- add { }
- remove { }
- }
}
class InternalReader: TextReader
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/MonoPlatformExecutionHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/MonoPlatformExecutionHandler.cs
index a164a13508..845ffd7727 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/MonoPlatformExecutionHandler.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/MonoPlatformExecutionHandler.cs
@@ -28,30 +28,31 @@
using System;
using System.Collections.Generic;
+using System.Threading;
+using MonoDevelop.Core.Assemblies;
+using System.IO;
namespace MonoDevelop.Core.Execution
{
public class MonoPlatformExecutionHandler: NativePlatformExecutionHandler
{
- string monoPath = "mono";
-
- public MonoPlatformExecutionHandler ()
- {
- }
-
- public MonoPlatformExecutionHandler (string monoPath, IDictionary<string, string> defaultEnvironmentVariables): base (defaultEnvironmentVariables)
+ MonoTargetRuntime runtime;
+
+ internal MonoPlatformExecutionHandler (MonoTargetRuntime runtime) : base (runtime.EnvironmentVariables)
{
- this.monoPath = monoPath;
+ this.runtime = runtime;
}
- public override IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
+ public override ProcessAsyncOperation Execute (ExecutionCommand command, OperationConsole console)
{
- DotNetExecutionCommand dotcmd = (DotNetExecutionCommand) command;
+ var dotcmd = (DotNetExecutionCommand) command;
string runtimeArgs = string.IsNullOrEmpty (dotcmd.RuntimeArguments) ? "--debug" : dotcmd.RuntimeArguments;
+
+ var monoRunner = runtime.GetMonoExecutableForAssembly (dotcmd.Command);
string args = string.Format ("{2} \"{0}\" {1}", dotcmd.Command, dotcmd.Arguments, runtimeArgs);
- NativeExecutionCommand cmd = new NativeExecutionCommand (monoPath, args, dotcmd.WorkingDirectory, dotcmd.EnvironmentVariables);
+ NativeExecutionCommand cmd = new NativeExecutionCommand (monoRunner, args, dotcmd.WorkingDirectory, dotcmd.EnvironmentVariables);
return base.Execute (cmd, console);
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/MultipleOperationConsoles.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/MultipleOperationConsoles.cs
new file mode 100644
index 0000000000..5d3eebddf1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/MultipleOperationConsoles.cs
@@ -0,0 +1,474 @@
+//
+// MultipleOperationConsoles.cs
+//
+// Author:
+// David Karlaš <david.karlas@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.IO;
+using System.Text;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using System.Linq;
+
+namespace MonoDevelop.Core.Execution
+{
+ public class MultipleOperationConsoles : OperationConsole
+ {
+ readonly OperationConsole [] consoles;
+ readonly TextWriter OutWriter;
+ readonly TextWriter ErrorWriter;
+ readonly TextWriter LogWriter;
+
+ public MultipleOperationConsoles (params OperationConsole [] consoles)
+ {
+ if (consoles == null)
+ throw new ArgumentNullException (nameof (consoles));
+ if (consoles.Length == 0)
+ throw new ArgumentOutOfRangeException (nameof (consoles));
+
+ this.consoles = consoles;
+ this.ErrorWriter = new MultipleTextWriters (consoles.Select (c => c.Error).ToArray ());
+ this.OutWriter = new MultipleTextWriters (consoles.Select (c => c.Out).ToArray ());
+ this.LogWriter = new MultipleTextWriters (consoles.Select (c => c.Log).ToArray ());
+ }
+
+ public override void Debug (int level, string category, string message)
+ {
+ foreach (var console in consoles) {
+ console.Debug (level, category, message);
+ }
+ }
+
+ public override TextWriter Error {
+ get {
+ return ErrorWriter;
+ }
+ }
+
+ public override TextReader In {
+ get {
+ return consoles [0].In;
+ }
+ }
+
+ public override TextWriter Log {
+ get {
+ return LogWriter;
+ }
+ }
+
+ public override TextWriter Out {
+ get {
+ return OutWriter;
+ }
+ }
+
+ public override void Dispose ()
+ {
+ foreach (var console in consoles) {
+ console.Dispose ();
+ }
+ }
+
+ class MultipleTextWriters : TextWriter
+ {
+ readonly Encoding encoding;
+ readonly TextWriter [] writers;
+
+ public MultipleTextWriters (params TextWriter [] writers)
+ {
+ if (writers == null)
+ throw new ArgumentNullException (nameof (writers));
+ if (writers.Length == 0)
+ throw new ArgumentOutOfRangeException (nameof (writers));
+
+ this.writers = writers;
+ encoding = writers [0].Encoding;
+ }
+
+ public override Encoding Encoding {
+ get {
+ return encoding;
+ }
+ }
+
+ public override void Close ()
+ {
+ foreach (var writer in writers) {
+ writer.Close ();
+ }
+ }
+
+ protected override void Dispose (bool disposing)
+ {
+ foreach (var writer in writers) {
+ writer.Dispose ();
+ }
+ base.Dispose (disposing);
+ }
+
+ public override void Flush ()
+ {
+ foreach (var writer in writers) {
+ writer.Flush ();
+ }
+ }
+
+ public override Task FlushAsync ()
+ {
+ var tasks = new List<Task> (writers.Length);
+ foreach (var writer in writers) {
+ tasks.Add (writer.FlushAsync ());
+ }
+ return Task.WhenAll (tasks);
+ }
+
+ public override IFormatProvider FormatProvider {
+ get {
+ return writers [0].FormatProvider;
+ }
+ }
+
+ public override string NewLine {
+ get {
+ return writers [0].NewLine;
+ }
+ set {
+ foreach (var writer in writers) {
+ writer.NewLine = value;
+ }
+ }
+ }
+
+ public override void Write (bool value)
+ {
+ foreach (var writer in writers) {
+ writer.Write (value);
+ }
+ }
+
+ public override void Write (char value)
+ {
+ foreach (var writer in writers) {
+ writer.Write (value);
+ }
+ }
+
+ public override void Write (char [] buffer)
+ {
+ foreach (var writer in writers) {
+ writer.Write (buffer);
+ }
+ }
+
+ public override void Write (char [] buffer, int index, int count)
+ {
+ foreach (var writer in writers) {
+ writer.Write (buffer, index, count);
+ }
+ }
+
+ public override void Write (decimal value)
+ {
+ foreach (var writer in writers) {
+ writer.Write (value);
+ }
+ }
+
+ public override void Write (double value)
+ {
+ foreach (var writer in writers) {
+ writer.Write (value);
+ }
+ }
+
+ public override void Write (float value)
+ {
+ foreach (var writer in writers) {
+ writer.Write (value);
+ }
+ }
+
+ public override void Write (int value)
+ {
+ foreach (var writer in writers) {
+ writer.Write (value);
+ }
+ }
+
+ public override void Write (long value)
+ {
+ foreach (var writer in writers) {
+ writer.Write (value);
+ }
+ }
+
+ public override void Write (object value)
+ {
+ foreach (var writer in writers) {
+ writer.Write (value);
+ }
+ }
+
+ public override void Write (string format, object arg0)
+ {
+ foreach (var writer in writers) {
+ writer.Write (format, arg0);
+ }
+ }
+
+ public override void Write (string format, object arg0, object arg1)
+ {
+ foreach (var writer in writers) {
+ writer.Write (format, arg0, arg1);
+ }
+ }
+
+ public override void Write (string format, object arg0, object arg1, object arg2)
+ {
+ foreach (var writer in writers) {
+ writer.Write (format, arg0, arg1, arg2);
+ }
+ }
+
+ public override void Write (string format, params object [] arg)
+ {
+ foreach (var writer in writers) {
+ writer.Write (format, arg);
+ }
+ }
+
+ public override void Write (string value)
+ {
+ foreach (var writer in writers) {
+ writer.Write (value);
+ }
+ }
+
+ public override void Write (uint value)
+ {
+ foreach (var writer in writers) {
+ writer.Write (value);
+ }
+ }
+
+ public override void Write (ulong value)
+ {
+ foreach (var writer in writers) {
+ writer.Write (value);
+ }
+ }
+
+ public override Task WriteAsync (char value)
+ {
+ var tasks = new List<Task> (writers.Length);
+ foreach (var writer in writers) {
+ tasks.Add (writer.WriteAsync (value));
+ }
+ return Task.WhenAll (tasks);
+ }
+
+ public override Task WriteAsync (char [] buffer, int index, int count)
+ {
+ var tasks = new List<Task> (writers.Length);
+ foreach (var writer in writers) {
+ tasks.Add (writer.WriteAsync (buffer, index, count));
+ }
+ return Task.WhenAll (tasks);
+ }
+
+ public override Task WriteAsync (string value)
+ {
+ var tasks = new List<Task> (writers.Length);
+ foreach (var writer in writers) {
+ tasks.Add (writer.WriteAsync (value));
+ }
+ return Task.WhenAll (tasks);
+ }
+
+
+ public override Task WriteLineAsync ()
+ {
+ var tasks = new List<Task> (writers.Length);
+ foreach (var writer in writers) {
+ tasks.Add (writer.WriteLineAsync ());
+ }
+ return Task.WhenAll (tasks);
+ }
+
+ public override void WriteLine ()
+ {
+ foreach (var writer in writers) {
+ writer.WriteLine ();
+ }
+ }
+
+ public override void WriteLine (bool value)
+ {
+ foreach (var writer in writers) {
+ writer.WriteLine (value);
+ }
+ }
+
+ public override void WriteLine (char value)
+ {
+ foreach (var writer in writers) {
+ writer.WriteLine (value);
+ }
+ }
+
+ public override void WriteLine (char [] buffer)
+ {
+ foreach (var writer in writers) {
+ writer.WriteLine (buffer);
+ }
+ }
+
+ public override void WriteLine (char [] buffer, int index, int count)
+ {
+ foreach (var writer in writers) {
+ writer.WriteLine (buffer, index, count);
+ }
+ }
+
+ public override void WriteLine (decimal value)
+ {
+ foreach (var writer in writers) {
+ writer.WriteLine (value);
+ }
+ }
+
+ public override void WriteLine (double value)
+ {
+ foreach (var writer in writers) {
+ writer.WriteLine (value);
+ }
+ }
+
+ public override void WriteLine (float value)
+ {
+ foreach (var writer in writers) {
+ writer.WriteLine (value);
+ }
+ }
+
+ public override void WriteLine (int value)
+ {
+ foreach (var writer in writers) {
+ writer.WriteLine (value);
+ }
+ }
+
+ public override void WriteLine (long value)
+ {
+ foreach (var writer in writers) {
+ writer.WriteLine (value);
+ }
+ }
+
+ public override void WriteLine (object value)
+ {
+ foreach (var writer in writers) {
+ writer.WriteLine (value);
+ }
+ }
+
+ public override void WriteLine (string format, object arg0)
+ {
+ foreach (var writer in writers) {
+ writer.WriteLine (format, arg0);
+ }
+ }
+
+ public override void WriteLine (string format, object arg0, object arg1)
+ {
+ foreach (var writer in writers) {
+ writer.WriteLine (format, arg0, arg1);
+ }
+ }
+
+ public override void WriteLine (string format, object arg0, object arg1, object arg2)
+ {
+ foreach (var writer in writers) {
+ writer.WriteLine (format, arg0, arg1, arg2);
+ }
+ }
+
+ public override void WriteLine (string format, params object [] arg)
+ {
+ foreach (var writer in writers) {
+ writer.WriteLine (format, arg);
+ }
+ }
+
+ public override void WriteLine (string value)
+ {
+ foreach (var writer in writers) {
+ writer.WriteLine (value);
+ }
+ }
+
+ public override void WriteLine (uint value)
+ {
+ foreach (var writer in writers) {
+ writer.WriteLine (value);
+ }
+ }
+
+ public override void WriteLine (ulong value)
+ {
+ foreach (var writer in writers) {
+ writer.WriteLine (value);
+ }
+ }
+
+ public override Task WriteLineAsync (char [] buffer, int index, int count)
+ {
+ var tasks = new List<Task> (writers.Length);
+ foreach (var writer in writers) {
+ tasks.Add (writer.WriteLineAsync (buffer, index, count));
+ }
+ return Task.WhenAll (tasks);
+ }
+
+ public override Task WriteLineAsync (char value)
+ {
+ var tasks = new List<Task> (writers.Length);
+ foreach (var writer in writers) {
+ tasks.Add (writer.WriteLineAsync (value));
+ }
+ return Task.WhenAll (tasks);
+ }
+
+ public override Task WriteLineAsync (string value)
+ {
+ var tasks = new List<Task> (writers.Length);
+ foreach (var writer in writers) {
+ tasks.Add (writer.WriteLineAsync (value));
+ }
+ return Task.WhenAll (tasks);
+ }
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/NativePlatformExecutionHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/NativePlatformExecutionHandler.cs
index 6783653e3a..804ca70168 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/NativePlatformExecutionHandler.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/NativePlatformExecutionHandler.cs
@@ -29,6 +29,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
+using System.Threading;
namespace MonoDevelop.Core.Execution
{
@@ -45,7 +46,7 @@ namespace MonoDevelop.Core.Execution
this.defaultEnvironmentVariables = defaultEnvironmentVariables;
}
- public virtual IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
+ public virtual ProcessAsyncOperation Execute (ExecutionCommand command, OperationConsole console)
{
ProcessExecutionCommand cmd = (ProcessExecutionCommand) command;
IDictionary<string, string> vars;
@@ -61,7 +62,7 @@ namespace MonoDevelop.Core.Execution
} else
vars = cmd.EnvironmentVariables;
- return Runtime.ProcessService.StartConsoleProcess (cmd.Command, cmd.Arguments, cmd.WorkingDirectory, vars, console, null);
+ return Runtime.ProcessService.StartConsoleProcess (cmd.Command, cmd.Arguments, cmd.WorkingDirectory, console, vars);
}
public virtual bool CanExecute (ExecutionCommand command)
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/OperationConsole.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/OperationConsole.cs
new file mode 100644
index 0000000000..ae3cd59354
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/OperationConsole.cs
@@ -0,0 +1,157 @@
+//
+// IConsole.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+using System.Threading;
+
+namespace MonoDevelop.Core.Execution
+{
+ /// <summary>
+ /// A console where an operation can use to write output or read input
+ /// </summary>
+ public abstract class OperationConsole: IDisposable
+ {
+ IDisposable cancelReg;
+
+ /// <summary>
+ /// Input stream
+ /// </summary>
+ public abstract TextReader In { get; }
+
+ /// <summary>
+ /// Output stream
+ /// </summary>
+ public abstract TextWriter Out { get; }
+
+ /// <summary>
+ /// Error stream
+ /// </summary>
+ public abstract TextWriter Error { get; }
+
+ /// <summary>
+ /// Log stream
+ /// </summary>
+ public abstract TextWriter Log { get; }
+
+ /// <summary>
+ /// Writes debug information to the console
+ /// </summary>
+ public virtual void Debug (int level, string category, string message)
+ {
+ if (level == 0 && string.IsNullOrEmpty (category)) {
+ Log.Write (message);
+ } else {
+ Log.Write (string.Format ("[{0}:{1}] {2}", level, category, message));
+ }
+ }
+
+ /// <summary>
+ /// Gets the cancelation token to be used to cancel the operation that is using the console
+ /// </summary>
+ public CancellationToken CancellationToken {
+ get { return CancellationSource.Token; }
+ }
+
+ protected CancellationTokenSource CancellationSource { get; set; }
+
+ protected OperationConsole ()
+ {
+ CancellationSource = new CancellationTokenSource ();
+ }
+
+ protected OperationConsole (CancellationToken cancelToken): this ()
+ {
+ BindToCancelToken (cancelToken);
+ }
+
+ internal protected void BindToCancelToken (CancellationToken cancelToken)
+ {
+ cancelReg = cancelToken.Register (CancellationSource.Cancel);
+ }
+
+ /// <summary>
+ /// Returns a console that wraps this console, but it overrides the cancel
+ /// operation, so instead of signaling the cancel token, it executes
+ /// the provided action.
+ /// </summary>
+ public OperationConsole WithCancelCallback (Action cancelAction)
+ {
+ return new OperationConsoleWrapper (this, cancelAction);
+ }
+
+ public virtual void Dispose ()
+ {
+ if (cancelReg != null)
+ cancelReg.Dispose ();
+ }
+ }
+
+ class OperationConsoleWrapper : OperationConsole
+ {
+ OperationConsole console;
+ Action cancelAction;
+
+ public OperationConsoleWrapper (OperationConsole console, Action cancelAction)
+ {
+ this.console = console;
+ this.cancelAction = cancelAction;
+ console.CancellationToken.Register (cancelAction);
+ }
+
+ public override TextWriter Error {
+ get {
+ return console.Error;
+ }
+ }
+
+ public override TextReader In {
+ get {
+ return console.In;
+ }
+ }
+
+ public override TextWriter Log {
+ get {
+ return console.Log;
+ }
+ }
+
+ public override TextWriter Out {
+ get {
+ return console.Out;
+ }
+ }
+
+ public override void Dispose ()
+ {
+ base.Dispose ();
+ console.Dispose ();
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/OperationConsoleFactory.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/OperationConsoleFactory.cs
new file mode 100644
index 0000000000..8d9ffdf557
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/OperationConsoleFactory.cs
@@ -0,0 +1,81 @@
+//
+// IConsoleFactory.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Threading;
+
+namespace MonoDevelop.Core.Execution
+{
+ public abstract class OperationConsoleFactory
+ {
+ public class CreateConsoleOptions
+ {
+ public static readonly CreateConsoleOptions Default = new CreateConsoleOptions { BringToFront = true };
+
+ public bool BringToFront { get; private set; }
+
+ CreateConsoleOptions ()
+ {
+ }
+
+ CreateConsoleOptions (CreateConsoleOptions options)
+ {
+ this.BringToFront = options.BringToFront;
+ }
+
+ public CreateConsoleOptions (bool bringToFront)
+ {
+ BringToFront = bringToFront;
+ }
+
+ public CreateConsoleOptions WithBringToFront (bool bringToFront)
+ {
+ if (bringToFront == BringToFront)
+ return this;
+ var result = new CreateConsoleOptions (this);
+ result.BringToFront = bringToFront;
+ return result;
+ }
+ }
+
+ public OperationConsole CreateConsole (CancellationToken cancellationToken = default (CancellationToken))
+ {
+ return CreateConsole (CreateConsoleOptions.Default, cancellationToken);
+ }
+
+ public OperationConsole CreateConsole (CreateConsoleOptions options, CancellationToken cancellationToken = default (CancellationToken))
+ {
+ var c = OnCreateConsole (options);
+ if (cancellationToken != default(CancellationToken))
+ c.BindToCancelToken (cancellationToken);
+ return c;
+ }
+
+ protected abstract OperationConsole OnCreateConsole (CreateConsoleOptions options);
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/OutputProgressMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/OutputProgressMonitor.cs
new file mode 100644
index 0000000000..b2a603277e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/OutputProgressMonitor.cs
@@ -0,0 +1,45 @@
+//
+// OutputProgressMonitor.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Threading;
+
+namespace MonoDevelop.Core.Execution
+{
+ public abstract class OutputProgressMonitor: ProgressMonitor
+ {
+ public OutputProgressMonitor ()
+ {
+ }
+
+ public OutputProgressMonitor (SynchronizationContext context): base (context)
+ {
+ }
+
+ public abstract OperationConsole Console { get; }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessAsyncOperation.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessAsyncOperation.cs
new file mode 100644
index 0000000000..1cdeadd47f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessAsyncOperation.cs
@@ -0,0 +1,62 @@
+//
+// IProcessAsyncOperation.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Core;
+using MonoDevelop.Core.ProgressMonitoring;
+using System.Threading.Tasks;
+using System.Threading;
+
+namespace MonoDevelop.Core.Execution
+{
+ public class ProcessAsyncOperation: AsyncOperation
+ {
+ protected ProcessAsyncOperation ()
+ {
+ }
+
+ public ProcessAsyncOperation (Task task, CancellationTokenSource cancellationTokenSource): base (task, cancellationTokenSource)
+ {
+ }
+
+ public int ExitCode { get; set; }
+
+ public int ProcessId { get; set; }
+ }
+
+ public class NullProcessAsyncOperation : ProcessAsyncOperation
+ {
+ public NullProcessAsyncOperation (int exitCode)
+ {
+ ExitCode = exitCode;
+ }
+
+ public static NullProcessAsyncOperation Success = new NullProcessAsyncOperation (0);
+ public static NullProcessAsyncOperation Failure = new NullProcessAsyncOperation (1);
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessHostController.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessHostController.cs
index 11be57b373..536d9c3dd4 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessHostController.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessHostController.cs
@@ -50,7 +50,7 @@ namespace MonoDevelop.Core.Execution
DateTime lastReleaseTime;
bool starting;
bool stopping;
- IProcessAsyncOperation process;
+ ProcessAsyncOperation process;
Timer timer;
string id;
IExecutionHandler executionHandlerFactory;
@@ -88,7 +88,7 @@ namespace MonoDevelop.Core.Execution
timer.Elapsed += new System.Timers.ElapsedEventHandler (WaitTimeout);
}
- public void Start (IList<string> userAssemblyPaths = null)
+ public void Start (IList<string> userAssemblyPaths = null, OperationConsole console = null)
{
lock (this) {
if (starting)
@@ -129,11 +129,11 @@ namespace MonoDevelop.Core.Execution
if (userAssemblyPaths != null)
cmd.UserAssemblyPaths = userAssemblyPaths;
cmd.DebugMode = isDebugMode;
- ProcessHostConsole cons = new ProcessHostConsole ();
- process = executionHandlerFactory.Execute (cmd, cons);
+ OperationConsole cons = console ?? new ProcessHostConsole ();
+ var p = process = executionHandlerFactory.Execute (cmd, cons);
Counters.ExternalHostProcesses++;
- process.Completed += ProcessExited;
+ process.Task.ContinueWith ((t) => ProcessExited (p));
} catch (Exception ex) {
if (tmpFile != null) {
@@ -155,7 +155,7 @@ namespace MonoDevelop.Core.Execution
}
}
- void ProcessExited (IAsyncOperation oper)
+ void ProcessExited (ProcessAsyncOperation oper)
{
lock (this) {
@@ -182,12 +182,12 @@ namespace MonoDevelop.Core.Execution
}
}
- public object CreateInstance (Type type, string[] addins, IList<string> userAssemblyPaths = null)
+ public object CreateInstance (Type type, string[] addins, IList<string> userAssemblyPaths = null, OperationConsole console = null)
{
lock (this) {
references++;
if (processHost == null)
- Start (userAssemblyPaths);
+ Start (userAssemblyPaths, console);
}
if (!runningEvent.WaitOne (15000, false)) {
@@ -212,12 +212,12 @@ namespace MonoDevelop.Core.Execution
}
}
- public object CreateInstance (string assemblyPath, string typeName, string[] addins, IList<string> userAssemblyPaths = null)
+ public object CreateInstance (string assemblyPath, string typeName, string[] addins, IList<string> userAssemblyPaths = null, OperationConsole console = null)
{
lock (this) {
references++;
if (processHost == null)
- Start (userAssemblyPaths);
+ Start (userAssemblyPaths, console);
}
if (!runningEvent.WaitOne (15000, false)) {
@@ -307,7 +307,7 @@ namespace MonoDevelop.Core.Execution
void WaitTimeout (object sender, System.Timers.ElapsedEventArgs args)
{
try {
- IProcessAsyncOperation oldProcess;
+ ProcessAsyncOperation oldProcess;
lock (this) {
if (references > 0) {
@@ -364,106 +364,22 @@ namespace MonoDevelop.Core.Execution
}
- class ProcessHostConsole: IConsole
+ class ProcessHostConsole: OperationConsole
{
- //nothing fires this event so make a dummy implementation to keep csc happy
- event EventHandler IConsole.CancelRequested { add { } remove {} }
-
- public TextReader In {
+ public override TextReader In {
get { return Console.In; }
}
- public TextWriter Out {
+ public override TextWriter Out {
get { return Console.Out; }
}
- public TextWriter Error {
+ public override TextWriter Error {
get { return Console.Error; }
}
- public TextWriter Log {
+ public override TextWriter Log {
get { return Out; }
}
-
- public bool CloseOnDispose {
- get {
- return false;
- }
- }
-
- public void Dispose ()
- {
- }
- }
-
- class InernalProcessHost: Process, IProcessAsyncOperation
- {
- object doneLock = new object ();
- bool finished;
- OperationHandler completed;
-
- public InernalProcessHost ()
- {
- Exited += delegate {
- lock (doneLock) {
- finished = true;
- Monitor.PulseAll (doneLock);
- if (completed != null)
- completed (this);
- }
- };
- }
-
- public int ProcessId {
- get { return Id; }
- }
-
- public event OperationHandler Completed {
- add {
- lock (doneLock) {
- completed += value;
- if (finished)
- value (this);
- }
- }
- remove {
- lock (doneLock) {
- completed -= value;
- }
- }
- }
-
- public void Cancel ()
- {
- Kill ();
- }
-
- public void WaitForCompleted ()
- {
- lock (doneLock) {
- while (!finished)
- Monitor.Wait (doneLock);
- }
- }
-
- public bool IsCompleted {
- get {
- lock (doneLock) {
- return finished;
- }
- }
- }
-
- public bool Success {
- get {
- return true;
- }
- }
-
- public bool SuccessWithWarnings {
- get {
- return true;
- }
- }
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessService.cs
index b88803792d..a84f5846d7 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessService.cs
@@ -39,6 +39,7 @@ using MonoDevelop.Core;
using MonoDevelop.Core.Assemblies;
using MonoDevelop.Core.Instrumentation;
using Mono.Addins;
+using System.Threading.Tasks;
namespace MonoDevelop.Core.Execution
{
@@ -155,17 +156,12 @@ namespace MonoDevelop.Core.Execution
// p.Exited += exited;
// p.EnableRaisingEvents = true;
- if (exited != null) {
- MonoDevelop.Core.OperationHandler handler = null;
- handler = delegate (MonoDevelop.Core.IAsyncOperation op) {
- op.Completed -= handler;
- exited (p, EventArgs.Empty);
- };
- ((MonoDevelop.Core.IAsyncOperation)p).Completed += handler;
- }
-
Counters.ProcessesStarted++;
p.Start ();
+
+ if (exited != null)
+ p.Task.ContinueWith (t => exited (p, EventArgs.Empty), Runtime.MainTaskScheduler);
+
return p;
}
@@ -194,17 +190,13 @@ namespace MonoDevelop.Core.Execution
return startInfo;
}
- public IProcessAsyncOperation StartConsoleProcess (string command, string arguments, string workingDirectory, IConsole console,
- EventHandler exited)
- {
- return StartConsoleProcess (command, arguments, workingDirectory, null, console, exited);
- }
-
- public IProcessAsyncOperation StartConsoleProcess (string command, string arguments, string workingDirectory,
- IDictionary<string, string> environmentVariables, IConsole console, EventHandler exited)
+ public ProcessAsyncOperation StartConsoleProcess (string command, string arguments, string workingDirectory, OperationConsole console,
+ IDictionary<string, string> environmentVariables = null, EventHandler exited = null)
{
- if ((console == null || (console is ExternalConsole)) && externalConsoleHandler != null) {
-
+ var externalConsole = console as ExternalConsole;
+
+ if ((console == null || externalConsole != null) && externalConsoleHandler != null) {
+
var dict = new Dictionary<string,string> ();
if (environmentVariables != null)
foreach (var kvp in environmentVariables)
@@ -215,14 +207,11 @@ namespace MonoDevelop.Core.Execution
var p = externalConsoleHandler (command, arguments, workingDirectory, dict,
GettextCatalog.GetString ("{0} External Console", BrandingService.ApplicationName),
- console != null ? !console.CloseOnDispose : false);
+ externalConsole != null ? !externalConsole.CloseOnDispose : false);
if (p != null) {
- if (exited != null) {
- p.Completed += delegate {
- exited (p, EventArgs.Empty);
- };
- }
+ if (exited != null)
+ p.Task.ContinueWith (t => exited (p, EventArgs.Empty), Runtime.MainTaskScheduler);
Counters.ProcessesStarted++;
return p;
} else {
@@ -234,8 +223,8 @@ namespace MonoDevelop.Core.Execution
foreach (KeyValuePair<string, string> kvp in environmentVariables)
psi.EnvironmentVariables [kvp.Key] = kvp.Value;
ProcessWrapper pw = StartProcess (psi, console.Out, console.Error, null);
- new ProcessMonitor (console, pw, exited);
- return pw;
+ new ProcessMonitor (console, pw.ProcessAsyncOperation, exited);
+ return pw.ProcessAsyncOperation;
}
public IExecutionHandler GetDefaultExecutionHandler (ExecutionCommand command)
@@ -316,44 +305,25 @@ namespace MonoDevelop.Core.Execution
return externalProcess;
}
}
-
- public IDisposable CreateExternalProcessObject (Type type)
- {
- return CreateExternalProcessObject (type, true);
- }
-
+
void CheckRemoteType (Type type)
{
if (!typeof(IDisposable).IsAssignableFrom (type))
throw new ArgumentException ("The remote object type must implement IDisposable", "type");
}
- public IDisposable CreateExternalProcessObject (Type type, bool shared, IList<string> userAssemblyPaths = null)
+ public IDisposable CreateExternalProcessObject (Type type, bool shared = true, IList<string> userAssemblyPaths = null, OperationConsole console = null)
{
CheckRemoteType (type);
- ProcessHostController hc = GetHost (type.ToString(), shared, null);
- return (IDisposable) hc.CreateInstance (type.Assembly.Location, type.FullName, GetRequiredAddins (type), userAssemblyPaths);
- }
-
- public IDisposable CreateExternalProcessObject (Type type, TargetRuntime runtime)
- {
- return CreateExternalProcessObject (type, runtime.GetExecutionHandler ());
+ var hc = GetHost (type.ToString(), shared, null);
+ return (IDisposable) hc.CreateInstance (type.Assembly.Location, type.FullName, GetRequiredAddins (type), userAssemblyPaths, console);
}
- public IDisposable CreateExternalProcessObject (Type type, IExecutionHandler executionHandler, IList<string> userAssemblyPaths = null)
+ public IDisposable CreateExternalProcessObject (Type type, IExecutionHandler executionHandler, IList<string> userAssemblyPaths = null, OperationConsole console = null)
{
CheckRemoteType (type);
- return (IDisposable)GetHost (type.ToString (), false, executionHandler).CreateInstance (type.Assembly.Location, type.FullName, GetRequiredAddins (type), userAssemblyPaths);
- }
-
- public IDisposable CreateExternalProcessObject (string assemblyPath, string typeName, bool shared, params string[] requiredAddins)
- {
- return (IDisposable) GetHost (typeName, shared, null).CreateInstance (assemblyPath, typeName, requiredAddins);
- }
-
- public IDisposable CreateExternalProcessObject (string assemblyPath, string typeName, IExecutionHandler executionHandler, params string[] requiredAddins)
- {
- return (IDisposable) GetHost (typeName, false, executionHandler).CreateInstance (assemblyPath, typeName, requiredAddins);
+ var hc = GetHost (type.ToString (), false, executionHandler);
+ return (IDisposable)hc.CreateInstance (type.Assembly.Location, type.FullName, GetRequiredAddins (type), userAssemblyPaths, console);
}
public bool IsValidForRemoteHosting (IExecutionHandler handler)
@@ -418,24 +388,28 @@ namespace MonoDevelop.Core.Execution
class ProcessMonitor
{
- public IConsole console;
+ public OperationConsole console;
EventHandler exited;
- IProcessAsyncOperation operation;
+ ProcessAsyncOperation operation;
+ IDisposable cancelRegistration;
- public ProcessMonitor (IConsole console, IProcessAsyncOperation operation, EventHandler exited)
+ public ProcessMonitor (OperationConsole console, ProcessAsyncOperation operation, EventHandler exited)
{
this.exited = exited;
this.operation = operation;
this.console = console;
- operation.Completed += new OperationHandler (OnOperationCompleted);
- console.CancelRequested += new EventHandler (OnCancelRequest);
+ operation.Task.ContinueWith (t => OnOperationCompleted ());
+ cancelRegistration = console.CancellationToken.Register (operation.Cancel);
}
- public void OnOperationCompleted (IAsyncOperation op)
+ public void OnOperationCompleted ()
{
+ cancelRegistration.Dispose ();
try {
if (exited != null)
- exited (op, null);
+ Runtime.RunInMainThread (() => {
+ exited (operation, EventArgs.Empty);
+ });
if (!Platform.IsWindows && Mono.Unix.Native.Syscall.WIFSIGNALED (operation.ExitCode))
console.Log.WriteLine (GettextCatalog.GetString ("The application was terminated by a signal: {0}"), Mono.Unix.Native.Syscall.WTERMSIG (operation.ExitCode));
@@ -445,14 +419,6 @@ namespace MonoDevelop.Core.Execution
console.Dispose ();
}
}
-
- void OnCancelRequest (object sender, EventArgs args)
- {
- operation.Cancel ();
-
- //remove the cancel handler, it will be attached again when StartConsoleProcess is called
- console.CancelRequested -= new EventHandler (OnCancelRequest);
- }
}
class OutWriter
@@ -475,5 +441,5 @@ namespace MonoDevelop.Core.Execution
}
}
- public delegate IProcessAsyncOperation ExternalConsoleHandler (string command, string arguments, string workingDirectory, IDictionary<string, string> environmentVariables, string title, bool pauseWhenFinished);
+ public delegate ProcessAsyncOperation ExternalConsoleHandler (string command, string arguments, string workingDirectory, IDictionary<string, string> environmentVariables, string title, bool pauseWhenFinished);
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessWrapper.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessWrapper.cs
index a5f121882e..296f6d18e8 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessWrapper.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessWrapper.cs
@@ -2,13 +2,14 @@
using System;
using System.Threading;
using System.Diagnostics;
+using System.Threading.Tasks;
namespace MonoDevelop.Core.Execution
{
public delegate void ProcessEventHandler(object sender, string message);
[System.ComponentModel.DesignerCategory ("Code")]
- public class ProcessWrapper : Process, IProcessAsyncOperation
+ public class ProcessWrapper : Process
{
private Thread captureOutputThread;
private Thread captureErrorThread;
@@ -16,22 +17,37 @@ namespace MonoDevelop.Core.Execution
ManualResetEvent endEventErr = new ManualResetEvent (false);
bool done;
object lockObj = new object ();
+ ProcessAsyncOperation operation;
+ IDisposable customCancelToken;
+ TaskCompletionSource<int> taskCompletionSource = new TaskCompletionSource<int> ();
public ProcessWrapper ()
{
}
- public bool CancelRequested { get; private set; }
-
+ public bool CancelRequested { get; private set; }
+
+ public Task Task {
+ get { return taskCompletionSource.Task; }
+ }
+
+ public ProcessAsyncOperation ProcessAsyncOperation {
+ get { return operation; }
+ }
+
public new void Start ()
{
CheckDisposed ();
base.Start ();
-
+
captureOutputThread = new Thread (new ThreadStart(CaptureOutput));
captureOutputThread.Name = "Process output reader";
captureOutputThread.IsBackground = true;
captureOutputThread.Start ();
-
+
+ var cs = new CancellationTokenSource ();
+ operation = new ProcessAsyncOperation (Task, cs);
+ cs.Token.Register (Cancel);
+
if (ErrorStreamChanged != null) {
captureErrorThread = new Thread (new ThreadStart(CaptureError));
captureErrorThread.Name = "Process error reader";
@@ -40,6 +56,12 @@ namespace MonoDevelop.Core.Execution
} else {
endEventErr.Set ();
}
+ operation.ProcessId = Id;
+ }
+
+ public void SetCancellationToken (CancellationToken cancelToken)
+ {
+ customCancelToken = cancelToken.Register (Cancel);
}
public void WaitForOutput (int milliseconds)
@@ -74,14 +96,22 @@ namespace MonoDevelop.Core.Execution
if (endEventErr != null)
endEventErr.WaitOne ();
- OnExited (this, EventArgs.Empty);
+ if (HasExited)
+ operation.ExitCode = ExitCode;
+
+ try {
+ OnExited (this, EventArgs.Empty);
+ } catch {
+ // Ignore
+ }
lock (lockObj) {
//call this AFTER the exit event, or the ProcessWrapper may get disposed and abort this thread
if (endEventOut != null)
endEventOut.Set ();
}
- }
+ taskCompletionSource.SetResult (operation.ExitCode);
+ }
}
private void CaptureError ()
@@ -108,7 +138,7 @@ namespace MonoDevelop.Core.Execution
return;
if (!done)
- ((IAsyncOperation)this).Cancel ();
+ Cancel ();
captureOutputThread = captureErrorThread = null;
endEventOut.Close ();
@@ -132,15 +162,7 @@ namespace MonoDevelop.Core.Execution
throw new ObjectDisposedException ("ProcessWrapper");
}
- int IProcessAsyncOperation.ExitCode {
- get { return ExitCode; }
- }
-
- int IProcessAsyncOperation.ProcessId {
- get { return Id; }
- }
-
- void IAsyncOperation.Cancel ()
+ public void Cancel ()
{
try {
if (!done) {
@@ -156,13 +178,12 @@ namespace MonoDevelop.Core.Execution
}
}
- void IAsyncOperation.WaitForCompleted ()
- {
- WaitForOutput ();
- }
-
void OnExited (object sender, EventArgs args)
{
+ if (customCancelToken != null) {
+ customCancelToken.Dispose ();
+ customCancelToken = null;
+ }
try {
if (!HasExited)
WaitForExit ();
@@ -171,49 +192,10 @@ namespace MonoDevelop.Core.Execution
} finally {
lock (lockObj) {
done = true;
- try {
- if (completedEvent != null)
- completedEvent (this);
- } catch {
- // Ignore
- }
- }
- }
- }
-
- event OperationHandler IAsyncOperation.Completed {
- add {
- bool raiseNow = false;
- lock (lockObj) {
- if (done)
- raiseNow = true;
- else
- completedEvent += value;
}
- if (raiseNow)
- value (this);
}
- remove {
- lock (lockObj) {
- completedEvent -= value;
- }
- }
- }
-
- bool IAsyncOperation.Success {
- get { return done ? ExitCode == 0 : false; }
}
- bool IAsyncOperation.SuccessWithWarnings {
- get { return false; }
- }
-
- bool IAsyncOperation.IsCompleted {
- get { return done; }
- }
-
- event OperationHandler completedEvent;
-
public event ProcessEventHandler OutputStreamChanged;
public event ProcessEventHandler ErrorStreamChanged;
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/RemoteProcessConnection.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/RemoteProcessConnection.cs
new file mode 100644
index 0000000000..6f01b43fd6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/RemoteProcessConnection.cs
@@ -0,0 +1,661 @@
+//#define DEBUG_MESSAGES
+
+using System;
+using System.Threading;
+using System.Net.Sockets;
+using System.Net;
+using System.Diagnostics;
+using System.IO;
+using System.Collections.Generic;
+
+using System.Linq;
+using System.Threading.Tasks;
+using System.Text;
+using MonoDevelop.Core.Assemblies;
+using System.Reflection;
+
+namespace MonoDevelop.Core.Execution
+{
+ public class RemoteProcessConnection: IDisposable
+ {
+ bool initializationDone;
+ TaskCompletionSource<bool> processConnectedEvent = new TaskCompletionSource<bool> ();
+ ManualResetEvent processDisconnectedEvent = new ManualResetEvent (false);
+ ProcessAsyncOperation process;
+ ConnectionStatus status;
+ bool disposed;
+ CancellationTokenSource mainCancelSource;
+ List<BinaryMessage> messageQueue = new List<BinaryMessage> ();
+ Dictionary<string, Type> messageTypes = new Dictionary<string, Type> ();
+
+ List<MessageListener> listeners = new List<MessageListener> ();
+ object listenersLock = new object ();
+
+ string exePath;
+
+ // This class will ping the remote process every PingPeriod milliseconds
+ // If the remote process doesn't get a message in PingPeriod*2 it assumes
+ // that XS has died and shutdowns itself.
+ #if DEBUG_MESSAGES
+ const int PingPeriod = 5000000;
+ #else
+ const int PingPeriod = 5000;
+ #endif
+
+ Timer pinger;
+ object pingerLock = new object ();
+
+ // Time this connection will wait for the process to connect back
+ const int ProcessInitializationTimeout = 15000;
+
+ #if DEBUG_MESSAGES
+ internal static bool DebugMode = true;
+ #else
+ internal static bool DebugMode = false;
+ #endif
+
+ TcpListener listener;
+ TcpClient connection;
+ Stream connectionStream;
+ SynchronizationContext syncContext;
+ IExecutionHandler executionHandler;
+ OperationConsole console;
+
+ public event EventHandler<MessageEventArgs> MessageReceived;
+ public event EventHandler StatusChanged;
+
+ public RemoteProcessConnection (string exePath, IExecutionHandler executionHandler = null, OperationConsole console = null, SynchronizationContext syncContext = null)
+ {
+ if (executionHandler == null)
+ executionHandler = Runtime.ProcessService.DefaultExecutionHandler;
+ if (console == null)
+ console = new ProcessHostConsole ();
+ this.executionHandler = executionHandler;
+ this.exePath = exePath;
+ this.syncContext = syncContext;
+ this.console = console;
+ mainCancelSource = new CancellationTokenSource ();
+ }
+
+ public ConnectionStatus Status {
+ get { return status; }
+ }
+
+ /// <summary>
+ /// If true, the remote process is either connected or connecting
+ /// </summary>
+ public bool IsReachable {
+ get {
+ var s = status;
+ return s != ConnectionStatus.ConnectionFailed && s != ConnectionStatus.Disconnected;
+ }
+ }
+
+ public string StatusMessage { get; private set; }
+ public Exception StatusException { get; private set; }
+
+ internal IMessageInterceptor Interceptor {
+ get;
+ set;
+ }
+
+ void SetStatus (ConnectionStatus s, string message, Exception e = null)
+ {
+ status = s;
+ StatusMessage = message;
+ StatusException = e;
+ var se = StatusChanged;
+ if (se != null)
+ se (this, EventArgs.Empty);
+ }
+
+ void PostSetStatus (ConnectionStatus s, string message, Exception e = null)
+ {
+ if (syncContext != null) {
+ syncContext.Post (delegate {
+ SetStatus (s, message, e);
+ }, null);
+ } else {
+ SetStatus (s, message, e);
+ }
+ }
+
+ public void RegisterMessageTypes (params Type[] types)
+ {
+ foreach (var t in types) {
+ var a = (MessageDataTypeAttribute) Attribute.GetCustomAttribute (t, typeof (MessageDataTypeAttribute));
+ if (a != null) {
+ var name = a.Name ?? t.FullName;
+ messageTypes [name] = t;
+ }
+ }
+ }
+
+ public void Dispose ()
+ {
+ Disconnect (false);
+ }
+
+ public void AddListener (MessageListener listener)
+ {
+ AddListener ((object)listener);
+ }
+
+ public void AddListener (object listener)
+ {
+ lock (listenersLock) {
+ var lis = listener as MessageListener;
+ if (lis == null)
+ lis = new MessageListener (listener);
+
+ var newList = new List<MessageListener> (listeners);
+ newList.Add (lis);
+ RegisterMessageTypes (lis.GetMessageTypes ());
+ listeners = newList;
+ }
+ }
+
+ public void Disconnect (bool waitUntilDone)
+ {
+ mainCancelSource.Cancel ();
+ mainCancelSource = new CancellationTokenSource ();
+
+ try {
+ StopRemoteProcess ();
+ } catch {
+ // Ignore
+ }
+ if (waitUntilDone)
+ processDisconnectedEvent.WaitOne (TimeSpan.FromSeconds (7));
+ }
+
+ public Task Connect ()
+ {
+ initializationDone = false;
+ AbortPendingMessages ();
+ if (listener != null && !disposed) {
+ // Disconnect the current session and reconnect
+ Disconnect (true);
+ }
+ return StartConnecting ();
+ }
+
+ Task StartConnecting ()
+ {
+ processDisconnectedEvent.Reset ();
+ disposed = false;
+ SetStatus (ConnectionStatus.Connecting, "Connecting");
+ return DoConnect (mainCancelSource.Token);
+ }
+
+ async Task DoConnect (CancellationToken token)
+ {
+ if (disposed)
+ return;
+
+ try {
+ if (listener != null) {
+ listener.Stop ();
+ listener = null;
+ }
+
+ listener = new TcpListener (IPAddress.Loopback, 0);
+ listener.Start ();
+
+ processConnectedEvent = new TaskCompletionSource<bool> ();
+
+ listener.BeginAcceptTcpClient (OnConnected, listener);
+
+ await InitializeRemoteProcessAsync (token).ConfigureAwait (false);
+ } catch (Exception ex) {
+ HandleRemoteConnectException (ex, token);
+ }
+ }
+
+ async Task InitializeRemoteProcessAsync (CancellationToken token)
+ {
+ try {
+ await StartRemoteProcess ().ConfigureAwait (false);
+
+ token.ThrowIfCancellationRequested ();
+
+ if (disposed)
+ throw new Exception ("Could not start process");
+
+ var timeout = Task.Delay (ProcessInitializationTimeout, token).ContinueWith (t => {
+ if (t.IsCanceled)
+ return;
+ if (!processConnectedEvent.Task.IsCompleted)
+ processConnectedEvent.SetException (new Exception ("Could not start process"));
+ });
+
+ await Task.WhenAny (timeout, processConnectedEvent.Task).ConfigureAwait (false);
+
+ if (connectionStream == null || disposed)
+ throw new Exception ("Process failed to start");
+
+/* var msg = new BinaryMessage ("Initialize", "Process").AddArgument ("MessageWaitTimeout", PingPeriod * 2);
+ msg.BypassConnection = true;
+ var cs = new TaskCompletionSource<BinaryMessage> ();
+ PostMessage (msg, cs, false);
+ token.ThrowIfCancellationRequested ();
+ await cs.Task;
+*/
+ token.ThrowIfCancellationRequested ();
+
+ SetStatus (ConnectionStatus.Connected, "Connected");
+ initializationDone = true;
+
+ } catch (Exception ex) {
+ HandleRemoteConnectException (ex, token);
+ }
+ }
+
+ void HandleRemoteConnectException (Exception ex, CancellationToken token)
+ {
+ LoggingService.LogError ("Connection failed", ex);
+ token.ThrowIfCancellationRequested ();
+ StopRemoteProcess ();
+ SetStatus (ConnectionStatus.ConnectionFailed, ex.Message, ex);
+ processDisconnectedEvent.Set ();
+ }
+
+ Task StartRemoteProcess ()
+ {
+ return Task.Run (() => {
+ var cmd = Runtime.ProcessService.CreateCommand (exePath);
+ cmd.Arguments = ((IPEndPoint)listener.LocalEndpoint).Port + " " + DebugMode;
+ process = executionHandler.Execute (cmd, console);
+ process.Task.ContinueWith (t => ProcessExited ());
+ });
+ }
+
+ bool stopping;
+ void ProcessExited ()
+ {
+ if (!stopping)
+ AbortConnection (isAsync: true);
+ processDisconnectedEvent.Set ();
+ }
+
+ public async Task<RT> SendMessage<RT> (BinaryMessage<RT> message) where RT:BinaryMessage
+ {
+ return (RT) await SendMessage ((BinaryMessage) message);
+ }
+
+ public Task<BinaryMessage> SendMessage (BinaryMessage message)
+ {
+ message.ReadCustomData ();
+ var interceptor = Interceptor;
+ if (interceptor != null && !interceptor.PreProcessMessage (message))
+ return Task.FromResult (message.CreateErrorResponse ("Message was refused by interceptor"));
+
+ var cs = new TaskCompletionSource<BinaryMessage> ();
+ PostMessage (message, cs, true);
+ return cs.Task;
+ }
+
+ public void PostMessage (BinaryMessage message)
+ {
+ message.ReadCustomData ();
+ var interceptor = Interceptor;
+ if (interceptor != null && !interceptor.PreProcessMessage (message))
+ return;
+
+ PostMessage (message, null, true);
+ }
+
+ public void FlushMessages (string target)
+ {
+ var msg = new BinaryMessage ("FlushMessages", target);
+ SendMessage (msg);
+ }
+
+ void PostMessage (BinaryMessage message, TaskCompletionSource<BinaryMessage> cs, bool checkInitialized)
+ {
+ if (checkInitialized && !initializationDone)
+ throw new RemoteProcessException ("Not connected");
+
+ if (cs != null) {
+ lock (messageWaiters) {
+ messageWaiters [message.Id] = new MessageRequest {
+ Request = message,
+ TaskSource = cs
+ };
+ }
+ }
+
+ lock (messageQueue) {
+ messageQueue.Add (message);
+ if (!senderRunning) {
+ senderRunning = true;
+ ThreadPool.QueueUserWorkItem (delegate {
+ SendMessages ();
+ });
+ }
+ }
+ }
+
+ bool senderRunning;
+
+ void SendMessages ()
+ {
+ while (true) {
+ List<BinaryMessage> queueCopy;
+ lock (messageQueue) {
+ if (messageQueue.Count == 0) {
+ senderRunning = false;
+ return;
+ }
+ queueCopy = new List<BinaryMessage> (messageQueue);
+ messageQueue.Clear ();
+ }
+ foreach (var m in queueCopy)
+ PostMessageInternal (m);
+ }
+ }
+
+ void PostMessageInternal (BinaryMessage message)
+ {
+ if ((status != ConnectionStatus.Connected || disposed) && !message.BypassConnection) {
+ ProcessResponse (message.CreateErrorResponse ("Connection is closed"));
+ return;
+ }
+
+ try {
+ if (DebugMode)
+ message.SentTime = DateTime.Now;
+
+ // Now send the message. This one will need a response
+
+ if (DebugMode)
+ LogMessage (MessageType.Request, message);
+
+ connectionStream.WriteByte ((byte)RequestType.QueueEnd);
+ message.Write (connectionStream);
+
+ connectionStream.Flush ();
+ }
+ catch (Exception ex){
+ if (connection == null || (!connection.Connected && status == ConnectionStatus.Connected)) {
+ AbortConnection ("Disconnected from remote process due to a communication error", isAsync: true);
+ } else
+ ProcessResponse (message.CreateErrorResponse (ex.ToString ()));
+ }
+ }
+
+ class MessageRequest
+ {
+ public BinaryMessage Request;
+ public TaskCompletionSource<BinaryMessage> TaskSource;
+ }
+
+ Dictionary<int, MessageRequest> messageWaiters = new Dictionary<int, MessageRequest> ();
+
+ void AbortConnection (string message = null, bool isAsync = false)
+ {
+ if (message == null)
+ message = "Disconnected from layout renderer";
+ AbortPendingMessages ();
+ disposed = true;
+ processConnectedEvent.TrySetResult (true);
+ if (isAsync)
+ PostSetStatus (ConnectionStatus.Disconnected, message);
+ else
+ SetStatus (ConnectionStatus.Disconnected, message);
+ }
+
+ void AbortPendingMessages ()
+ {
+ lock (messageWaiters) {
+ foreach (var m in messageWaiters.Values)
+ NotifyResponse (m, m.Request.CreateErrorResponse ("Connection closed"));
+ messageQueue.Clear ();
+ }
+ }
+
+ void StopRemoteProcess (bool isAsync = false)
+ {
+ if (process != null)
+ stopping = true;
+
+ AbortConnection (isAsync: isAsync);
+
+ if (pinger != null) {
+ pinger.Dispose ();
+ pinger = null;
+ }
+ if (listener != null) {
+ listener.Stop ();
+ listener = null;
+ }
+ if (connectionStream != null) {
+ connectionStream.Close ();
+ connectionStream = null;
+ }
+ if (connection != null) {
+ connection.Close ();
+ connection = null;
+ }
+ process.Cancel ();
+ }
+
+ void OnConnected (IAsyncResult res)
+ {
+ if (disposed)
+ return;
+ var tcpl = (TcpListener) res.AsyncState;
+ if (tcpl == listener) {
+ try {
+ connection = listener.EndAcceptTcpClient (res);
+ connectionStream = connection.GetStream ();
+ pinger = new Timer (PingConnection, null, PingPeriod, PingPeriod);
+ } catch (Exception ex) {
+ LoggingService.LogError ("Connection to layout renderer failed", ex);
+ PostSetStatus (ConnectionStatus.ConnectionFailed, "Connection to layout renderer failed");
+ return;
+ }
+
+ ReadMessages ();
+ }
+ }
+
+ async void ReadMessages ()
+ {
+ byte[] buffer = new byte [1];
+
+ while (!disposed && connectionStream != null)
+ {
+ BinaryMessage msg;
+ byte type;
+
+ try {
+ int nr = await connectionStream.ReadAsync (buffer, 0, 1, mainCancelSource.Token).ConfigureAwait (false);
+ if (nr == 0) {
+ StopRemoteProcess (isAsync: true);
+ return;
+ }
+ type = buffer [0];
+ msg = BinaryMessage.Read (connectionStream);
+ } catch (Exception ex) {
+ if (disposed)
+ return;
+ LoggingService.LogError ("ReadMessage failed", ex);
+ StopRemoteProcess (isAsync: true);
+ PostSetStatus (ConnectionStatus.ConnectionFailed, "Connection to layout renderer failed.");
+ return;
+ }
+
+ lock (pendingMessageTasks) {
+ var t = Task.Run (() => {
+ msg = LoadMessageData (msg);
+ if (type == 0)
+ ProcessResponse (msg);
+ else
+ ProcessRemoteMessage (msg);
+ });
+ t.ContinueWith (ta => {
+ pendingMessageTasks.Remove (ta);
+ });
+ pendingMessageTasks.Add (t);
+ }
+ }
+ }
+
+ List<Task> pendingMessageTasks = new List<Task> ();
+
+ public Task ProcessPendingMessages ()
+ {
+ return Task.WhenAll (pendingMessageTasks.ToArray ());
+ }
+
+ BinaryMessage LoadMessageData (BinaryMessage msg)
+ {
+ Type type;
+ if (messageTypes.TryGetValue (msg.Name, out type)) {
+ var res = (BinaryMessage)Activator.CreateInstance (type);
+ res.CopyFrom (msg);
+ return res;
+ }
+ return msg;
+ }
+
+ void ProcessResponse (BinaryMessage msg)
+ {
+ DateTime respTime = DateTime.Now;
+
+ lock (messageWaiters) {
+ MessageRequest req;
+ if (messageWaiters.TryGetValue (msg.Id, out req)) {
+ messageWaiters.Remove (msg.Id);
+ try {
+ var rt = req.Request.GetResponseType ();
+ if (rt != typeof (BinaryMessage)) {
+ var resp = (BinaryMessage)Activator.CreateInstance (rt);
+ resp.CopyFrom (msg);
+ msg = resp;
+ }
+ } catch (Exception ex) {
+ msg = msg.CreateErrorResponse (ex.ToString ());
+ }
+
+ if (DebugMode) {
+ var time = (int)(respTime - req.Request.SentTime).TotalMilliseconds;
+ LogMessage (MessageType.Response, msg, time);
+ }
+
+ if (!req.Request.OneWay)
+ NotifyResponse (req, msg);
+ }
+ else if (DebugMode)
+ LogMessage (MessageType.Response, msg, -1);
+ }
+ }
+
+ void NotifyResponse (MessageRequest req, BinaryMessage res)
+ {
+ if (disposed || res == null) {
+ req.TaskSource.SetException (new Exception ("Connection closed"));
+ }
+ else if (res.Name == "Error") {
+ string msg = res.GetArgument<string> ("Message");
+ if (res.GetArgument<bool> ("IsInternal") && !string.IsNullOrEmpty (msg)) {
+ msg = "The operation failed due to an internal error: " + msg + ".";
+ }
+ req.TaskSource.SetException (new RemoteProcessException (msg) { ExtendedDetails = res.GetArgument<string> ("Log") });
+ } else {
+ req.TaskSource.SetResult (res);
+ }
+ }
+
+ void ProcessRemoteMessage (BinaryMessage msg)
+ {
+ if (DebugMode)
+ LogMessage (MessageType.Message, msg);
+
+ if (msg.Name == "Connect") {
+ processConnectedEvent.SetResult (true);
+ return;
+ }
+
+ Runtime.RunInMainThread (delegate {
+ if (MessageReceived != null)
+ MessageReceived (null, new MessageEventArgs () { Message = msg });
+ });
+
+ try {
+ foreach (var li in listeners) {
+ li.ProcessMessage (msg);
+ }
+ } catch (Exception ex) {
+ LoggingService.LogError ("Exception in message invocation: " + msg, ex);
+ }
+ }
+
+ enum MessageType { Request, Response, Message }
+
+ long tickBase = Environment.TickCount;
+
+ void LogMessage (MessageType type, BinaryMessage msg, int time = -1)
+ {
+ Console.Write ("[" + (Environment.TickCount - tickBase) + "] ");
+
+ if (type == MessageType.Request)
+ Console.WriteLine ("[CLIENT] XS >> RP " + msg);
+ else if (type == MessageType.Response) {
+ if (time != -1)
+ Console.WriteLine ("[CLIENT] XS << RP " + time + "ms " + msg);
+ else
+ Console.WriteLine ("[CLIENT] XS << RP " + msg);
+ }
+ else
+ Console.WriteLine ("[CLIENT] XS <- RP " + msg);
+ }
+
+ void PingConnection (object state)
+ {
+ bool lockTaken = false;
+ try {
+ Monitor.TryEnter (pingerLock, ref lockTaken);
+ if (!lockTaken)
+ return;
+ var msg = new BinaryMessage ("Ping", "Process");
+ SendMessage (msg);
+ } catch (Exception ex) {
+ LoggingService.LogError ("Connection ping failed", ex);
+ } finally {
+ if (lockTaken)
+ Monitor.Exit (pingerLock);
+ }
+ }
+ }
+
+ public class MessageEventArgs: EventArgs
+ {
+ public BinaryMessage Message { get; set; }
+ }
+
+ public enum ConnectionStatus
+ {
+ Connecting,
+ Connected,
+ ConnectionFailed,
+ Disconnected
+ }
+
+ enum RequestType
+ {
+ QueueEnd = 1,
+ Queued = 2
+ }
+
+ internal interface IMessageInterceptor
+ {
+ /// <summary>
+ /// Give a chance to an implementor to peek at messages before they are sent.
+ /// </summary>
+ /// <returns><c>true</c>, if message should sent, <c>false</c> if it should be discarded.</returns>
+ bool PreProcessMessage (BinaryMessage message);
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/RemoteProcessServer.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/RemoteProcessServer.cs
new file mode 100644
index 0000000000..5a4425ef76
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/RemoteProcessServer.cs
@@ -0,0 +1,313 @@
+//
+// RemoteProcessServer.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Net.Sockets;
+using System.Threading;
+using System.Reflection;
+using System.Linq;
+
+namespace MonoDevelop.Core.Execution
+{
+ public class RemoteProcessServer
+ {
+ TcpClient socket;
+ Stream outStream;
+ Stream inStream;
+ string messages = "";
+
+ Dictionary<string, MessageListenerHandler> listeners = new Dictionary<string, MessageListenerHandler> ();
+ Dictionary<string, Type> messageTypes = new Dictionary<string, Type> ();
+
+ const int MESSAGE_QUEUE_END = 1;
+
+ public void Connect (string [] processArgs, object processListener)
+ {
+ Connect (int.Parse (processArgs [0]), processListener, bool.Parse (processArgs [1]));
+ }
+
+ public void Connect (int port, object processListener, bool debugMode = false)
+ {
+ DebugMode = debugMode;
+ socket = new TcpClient ("127.0.0.1", port);
+ outStream = socket.GetStream ();
+ inStream = outStream;
+
+ AddListener (processListener);
+ Start ();
+
+ BinaryMessage msg = new BinaryMessage ("Connect");
+ WriteMessage (1, msg);
+ }
+
+ public bool DebugMode { get; private set; }
+
+ public void LogError (Exception ex)
+ {
+ Log ("ERROR", ex.ToString ());
+ }
+
+ public void LogError (string message)
+ {
+ Log ("ERROR", message);
+ }
+
+ public void LogWarning (string message)
+ {
+ Log ("WARNING", message);
+ }
+
+ public void LogInfo (string message)
+ {
+ Log ("INFO", message);
+ }
+
+ private void Log (string tag, string message)
+ {
+ if (messages.Length == 0)
+ messages += "\n";
+ messages += message;
+ Console.WriteLine (tag + ": " + message);
+ }
+
+ public void ResetLog ()
+ {
+ messages = "";
+ }
+
+ public string GetLog ()
+ {
+ return messages;
+ }
+
+ void Start ()
+ {
+ var t = new Thread (Run);
+ t.Start ();
+ }
+
+ public void AddListener (MessageListener listener)
+ {
+ AddListener ((object)listener);
+ }
+
+ public void AddListener (object listener)
+ {
+ lock (listeners) {
+ var li = new MessageListenerHandler (listener);
+ li.InitListener (this);
+ listeners [li.TargetId] = li;
+ RegisterMessageTypes (li.Listener.GetMessageTypes ());
+ }
+ }
+
+ public void RemoveListener (MessageListener listener)
+ {
+ RemoveListener ((object)listener);
+ }
+
+ public void RemoveListener (object listener)
+ {
+ lock (listeners) {
+ var li = listeners.Values.FirstOrDefault (l => l.Target == listener);
+ if (li != null)
+ listeners.Remove (li.TargetId);
+ }
+ }
+
+ public void SendMessage (BinaryMessage msg)
+ {
+ WriteMessage (1, msg);
+ }
+
+ public void Run ()
+ {
+ List<BinaryMessage> messages = new List<BinaryMessage> ();
+
+ while (true) {
+ BinaryMessage msg;
+ int type;
+ try {
+ type = inStream.ReadByte ();
+ if (type == -1)
+ break;
+ msg = BinaryMessage.Read (inStream);
+ msg = LoadMessageData (msg);
+ if (DebugMode) {
+ String mtype = type == MESSAGE_QUEUE_END ? "[M] " : "[Q] ";
+ Console.WriteLine ("[SERVER] XS >> RP " + mtype + msg);
+ }
+ } catch (Exception e) {
+ Console.WriteLine (e);
+ break;
+ }
+ if (msg.Name == "Stop" && msg.Target == "Process") {
+ try {
+ WriteMessage (0, msg.CreateResponse ());
+ } catch {
+ // Ignore
+ }
+ break;
+ }
+ messages.Add (msg);
+ if (type == MESSAGE_QUEUE_END) {
+ ProcessMessages (messages);
+ messages.Clear ();
+ }
+ }
+ }
+
+ void ProcessMessages (List<BinaryMessage> msgs)
+ {
+ foreach (BinaryMessage msg in msgs) {
+ MessageListenerHandler l;
+ lock (listeners) {
+ listeners.TryGetValue (msg.Target ?? "", out l);
+ }
+
+ if (l != null) {
+ l.DispatchMessage (msg);
+ } else {
+ BinaryMessage response = msg.CreateErrorResponse ("No handler found for target: " + msg.Target, true);
+ SendResponse (response);
+ }
+ }
+ }
+
+ public void SendResponse (BinaryMessage response)
+ {
+ WriteMessage (0, response);
+ }
+
+ public void WriteMessage (byte type, BinaryMessage msg)
+ {
+ msg.ReadCustomData ();
+ lock (listeners) {
+ if (DebugMode)
+ Console.WriteLine ("[SERVER] XS << RP " + type + " [" + msg.ProcessingTime + "ms] " + msg);
+ outStream.WriteByte (type);
+ try {
+ msg.Write (outStream);
+ } catch (Exception ex) {
+ msg.CreateErrorResponse (ex.ToString (), true).Write (outStream);
+ }
+ }
+ }
+
+ public void RegisterMessageTypes (params Type [] types)
+ {
+ foreach (var t in types) {
+ var a = (MessageDataTypeAttribute)Attribute.GetCustomAttribute (t, typeof (MessageDataTypeAttribute));
+ if (a != null) {
+ var name = a.Name ?? t.FullName;
+ messageTypes [name] = t;
+ }
+ }
+ }
+
+ BinaryMessage LoadMessageData (BinaryMessage msg)
+ {
+ Type type;
+ if (messageTypes.TryGetValue (msg.Name, out type)) {
+ var res = (BinaryMessage)Activator.CreateInstance (type);
+ res.CopyFrom (msg);
+ return res;
+ }
+ return msg;
+ }
+
+ class MessageListenerHandler
+ {
+ RemoteProcessServer server;
+ MessageListener listener;
+ object target;
+
+ public MessageListenerHandler (object target)
+ {
+ this.target = target;
+ listener = target as MessageListener;
+ if (listener == null)
+ listener = new MessageListener (target);
+ }
+
+ public object Target {
+ get {
+ return target;
+ }
+ }
+
+ public MessageListener Listener {
+ get {
+ return listener;
+ }
+ }
+
+ internal void InitListener (RemoteProcessServer server)
+ {
+ this.server = server;
+ }
+
+ public void Dispose ()
+ {
+ }
+
+ public void DispatchMessage (BinaryMessage msg)
+ {
+ ThreadPool.QueueUserWorkItem ((state) => { ExecuteMessage (msg); });
+ }
+
+ void ExecuteMessage (BinaryMessage msg)
+ {
+ BinaryMessage response = null;
+ var sw = System.Diagnostics.Stopwatch.StartNew ();
+ try {
+ if (msg.Name == "FlushMessages") {
+ response = msg.CreateResponse ();
+ } else
+ response = listener.ProcessMessage (msg);
+ } catch (Exception ex) {
+ if (ex is TargetInvocationException)
+ ex = ((TargetInvocationException)ex).InnerException;
+ server.LogError (ex);
+ response = msg.CreateErrorResponse (ex.Message, !(ex is RemoteProcessException));
+ Console.WriteLine (ex);
+ }
+ if (response != null) {
+ response.Id = msg.Id;
+ response.ProcessingTime = sw.ElapsedMilliseconds;
+ server.SendResponse (response);
+ } else if (!msg.OneWay)
+ server.SendResponse (msg.CreateErrorResponse ("Got no response from server", true));
+ }
+
+ public string TargetId {
+ get { return listener.TargetId ?? ""; }
+ }
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.FileSystem/DefaultFileSystemExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.FileSystem/DefaultFileSystemExtension.cs
index ac77a0bb22..3c2fd9d448 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.FileSystem/DefaultFileSystemExtension.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.FileSystem/DefaultFileSystemExtension.cs
@@ -105,10 +105,15 @@ namespace MonoDevelop.Core.FileSystem
Directory.Delete (path, true);
}
- public override void RequestFileEdit (IEnumerable<FilePath> files)
+ public override void RequestFileEdit (FilePath file)
{
}
-
+
+ public override FileWriteableState GetWriteableState (FilePath file)
+ {
+ return FileWriteableState.Unknown;
+ }
+
public override void NotifyFilesChanged (IEnumerable<FilePath> file)
{
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.FileSystem/FileSystemExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.FileSystem/FileSystemExtension.cs
index 240cb8913c..43c1f7a785 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.FileSystem/FileSystemExtension.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.FileSystem/FileSystemExtension.cs
@@ -127,10 +127,14 @@ namespace MonoDevelop.Core.FileSystem
GetNextForPath (path, true).DeleteDirectory (path);
}
- public virtual void RequestFileEdit (IEnumerable<FilePath> files)
+ public virtual FileWriteableState GetWriteableState (FilePath file)
{
- foreach (var fg in files.GroupBy (f => GetNextForPath (f, false)))
- fg.Key.RequestFileEdit (fg);
+ return GetNextForPath (file, false).GetWriteableState (file);
+ }
+
+ public virtual void RequestFileEdit (FilePath file)
+ {
+ GetNextForPath (file, false).RequestFileEdit (file);
}
public virtual void NotifyFilesChanged (IEnumerable<FilePath> files)
@@ -138,6 +142,7 @@ namespace MonoDevelop.Core.FileSystem
foreach (var fsFiles in files.GroupBy (f => GetNextForPath (f, false)))
fsFiles.Key.NotifyFilesChanged (files);
}
+
}
class DummyFileSystemExtension: FileSystemExtension
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Instrumentation/InstrumentationService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Instrumentation/InstrumentationService.cs
index 023d7ee759..78dc2bca5b 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Instrumentation/InstrumentationService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Instrumentation/InstrumentationService.cs
@@ -394,48 +394,34 @@ namespace MonoDevelop.Core.Instrumentation
}
}
- public static IProgressMonitor GetInstrumentedMonitor (IProgressMonitor monitor, TimerCounter counter)
+ public static ProgressMonitor GetInstrumentedMonitor (ProgressMonitor monitor, TimerCounter counter)
{
if (enabled) {
AggregatedProgressMonitor mon = new AggregatedProgressMonitor (monitor);
- mon.AddSlaveMonitor (new IntrumentationMonitor (counter), MonitorAction.Tasks | MonitorAction.WriteLog);
+ mon.AddFollowerMonitor (new IntrumentationMonitor (counter), MonitorAction.Tasks | MonitorAction.WriteLog);
return mon;
} else
return monitor;
}
}
- class IntrumentationMonitor: NullProgressMonitor
+ class IntrumentationMonitor: ProgressMonitor
{
TimerCounter counter;
Stack<ITimeTracker> timers = new Stack<ITimeTracker> ();
- LogTextWriter logger = new LogTextWriter ();
-
+
public IntrumentationMonitor (TimerCounter counter)
{
this.counter = counter;
- logger.TextWritten += HandleLoggerTextWritten;
}
- void HandleLoggerTextWritten (string writtenText)
+ protected override void OnWriteLog (string message)
{
if (timers.Count > 0)
- timers.Peek ().Trace (writtenText);
- }
-
- public override void BeginTask (string name, int totalWork)
- {
- if (!string.IsNullOrEmpty (name)) {
- ITimeTracker c = counter.BeginTiming (name);
- c.Trace (name);
- timers.Push (c);
- } else {
- timers.Push (null);
- }
- base.BeginTask (name, totalWork);
+ timers.Peek ().Trace (message);
}
-
- public override void BeginStepTask (string name, int totalWork, int stepSize)
+
+ protected override void OnBeginTask (string name, int totalWork, int stepWork)
{
if (!string.IsNullOrEmpty (name)) {
ITimeTracker c = counter.BeginTiming (name);
@@ -444,23 +430,15 @@ namespace MonoDevelop.Core.Instrumentation
} else {
timers.Push (null);
}
- base.BeginStepTask (name, totalWork, stepSize);
}
- public override void EndTask ()
+ protected override void OnEndTask (string name, int totalWork, int stepWork)
{
if (timers.Count > 0) {
ITimeTracker c = timers.Pop ();
if (c != null)
c.End ();
}
- base.EndTask ();
- }
-
- public override System.IO.TextWriter Log {
- get {
- return logger;
- }
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Logging/AssertLoggingTraceListener.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Logging/AssertLoggingTraceListener.cs
index 75ae50cac6..9cf02b44e3 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Logging/AssertLoggingTraceListener.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Logging/AssertLoggingTraceListener.cs
@@ -32,28 +32,8 @@ using System.IO;
namespace MonoDevelop.Core.Logging
{
- class AssertLoggingTraceListener : TraceListener
+ class AssertLoggingTraceListener : DefaultTraceListener
{
- public override void Write (string message)
- {
- //ignore
- }
-
- public override void WriteLine (string message)
- {
- //ignore
- }
-
- public override void TraceData (TraceEventCache eventCache, string source, TraceEventType eventType, int id, params object[] data)
- {
- //ignore
- }
-
- public override void TraceData (TraceEventCache eventCache, string source, TraceEventType eventType, int id, object data)
- {
- //ignore
- }
-
public override void Fail (string message, string detailMessage)
{
var frames = new StackTrace (1, true).GetFrames ();
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedAsyncOperation.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedAsyncOperation.cs
deleted file mode 100644
index b4067d2923..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedAsyncOperation.cs
+++ /dev/null
@@ -1,112 +0,0 @@
-//
-// AggregatedAsyncOperation.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-
-namespace MonoDevelop.Core.ProgressMonitoring
-{
- public class AggregatedAsyncOperation: IAsyncOperation
- {
- public event OperationHandler Completed;
-
- List<IAsyncOperation> operations = new List<IAsyncOperation> ();
- bool started;
- bool success = true;
- bool successWithWarnings = true;
- int completed;
-
- public void Add (IAsyncOperation oper)
- {
- if (started)
- throw new InvalidOperationException ("Can't add more operations after calling StartMonitoring");
- operations.Add (oper);
- }
-
- public void StartMonitoring ()
- {
- started = true;
- foreach (IAsyncOperation oper in operations)
- oper.Completed += OperCompleted;
- }
-
- void OperCompleted (IAsyncOperation op)
- {
- bool raiseEvent;
- lock (operations) {
- completed++;
- success = success && op.Success;
- successWithWarnings = success && op.SuccessWithWarnings;
- raiseEvent = (completed == operations.Count);
- }
- if (raiseEvent && Completed != null)
- Completed (this);
- }
-
- public void Cancel ()
- {
- CheckStarted ();
- lock (operations) {
- foreach (IAsyncOperation op in operations)
- op.Cancel ();
- }
- }
-
- public void WaitForCompleted ()
- {
- CheckStarted ();
- foreach (IAsyncOperation op in operations)
- op.WaitForCompleted ();
- }
-
- public bool IsCompleted {
- get {
- CheckStarted ();
- return completed == operations.Count;
- }
- }
-
- public bool Success {
- get {
- CheckStarted ();
- return success;
- }
- }
-
- public bool SuccessWithWarnings {
- get {
- CheckStarted ();
- return successWithWarnings;
- }
- }
-
- void CheckStarted ()
- {
- if (!started)
- throw new InvalidOperationException ("Operation not started");
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedOperationMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedOperationMonitor.cs
deleted file mode 100644
index c8ffc6fa50..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedOperationMonitor.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// AggregatedOperationMonitor.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections.Generic;
-
-namespace MonoDevelop.Core.ProgressMonitoring
-{
- public class AggregatedOperationMonitor: IDisposable
- {
- List<IAsyncOperation> list = new List<IAsyncOperation> ();
- IProgressMonitor monitor;
-
- public AggregatedOperationMonitor (IProgressMonitor monitor, params IAsyncOperation[] operations)
- {
- this.monitor = monitor;
-
- if (operations != null) {
- lock (list) {
- foreach (IAsyncOperation operation in operations)
- AddOperation (operation);
- }
- }
-
- monitor.CancelRequested += new MonitorHandler (OnCancel);
- }
-
- public void AddOperation (IAsyncOperation operation)
- {
- lock (list) {
- if (monitor.IsCancelRequested)
- operation.Cancel ();
- else
- list.Add (operation);
- }
- }
-
- void OnCancel (IProgressMonitor m)
- {
- lock (list) {
- foreach (IAsyncOperation operation in list)
- operation.Cancel ();
- }
- }
-
- public void Dispose ()
- {
- monitor.CancelRequested -= new MonitorHandler (OnCancel);
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs
index cd8c4aed7b..cef5943162 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs
@@ -30,6 +30,8 @@
using System;
using System.Collections.Generic;
using System.IO;
+using System.Threading.Tasks;
+using System.Threading;
namespace MonoDevelop.Core.ProgressMonitoring
{
@@ -44,183 +46,151 @@ namespace MonoDevelop.Core.ProgressMonitoring
Dispose = 0x10,
Tasks = 0x20,
Cancel = 0x40,
- SlaveCancel = 0x80, // when the slave is cancelled, the whole aggregated monitor is cancelled.
+ FollowerCancel = 0x80, // when the follower is cancelled, the whole aggregated monitor is cancelled.
All = 0xff
}
- public class AggregatedProgressMonitor: IProgressMonitor, IAsyncOperation
+ public class AggregatedProgressMonitor: ProgressMonitor
{
- IProgressMonitor masterMonitor;
+ ProgressMonitor leaderMonitor;
List<MonitorInfo> monitors = new List<MonitorInfo> ();
- LogTextWriter logger;
-
+
class MonitorInfo {
public MonitorAction ActionMask;
- public IProgressMonitor Monitor;
+ public ProgressMonitor Monitor;
+ public CancellationTokenRegistration CancellationTokenRegistration;
}
- public IProgressMonitor MasterMonitor {
- get { return this.masterMonitor; }
+ public ProgressMonitor LeaderMonitor {
+ get { return this.leaderMonitor; }
}
- public AggregatedProgressMonitor (): this (new NullProgressMonitor ())
+ public AggregatedProgressMonitor (): this (new ProgressMonitor ())
{
}
- public AggregatedProgressMonitor (IProgressMonitor masterMonitor, params IProgressMonitor[] slaveMonitors)
+ public AggregatedProgressMonitor (ProgressMonitor leaderMonitor, params ProgressMonitor[] followerMonitors): this (leaderMonitor, null, followerMonitors)
+ {
+ }
+
+ internal AggregatedProgressMonitor (ProgressMonitor leaderMonitor, CancellationTokenSource cancelSource, params ProgressMonitor[] followerMonitors)
{
- this.masterMonitor = masterMonitor;
- AddSlaveMonitor (masterMonitor, MonitorAction.All);
- logger = new LogTextWriter ();
- logger.TextWritten += new LogTextEventHandler (OnWriteLog);
- foreach (IProgressMonitor mon in slaveMonitors)
- AddSlaveMonitor (mon);
+ CancellationTokenSource = cancelSource ?? new CancellationTokenSource ();
+ this.leaderMonitor = leaderMonitor;
+ AddFollowerMonitor (leaderMonitor, MonitorAction.All);
+ foreach (ProgressMonitor mon in followerMonitors)
+ AddFollowerMonitor (mon);
}
- public void AddSlaveMonitor (IProgressMonitor slaveMonitor)
+ public new void AddFollowerMonitor (ProgressMonitor followerMonitor)
{
- AddSlaveMonitor (slaveMonitor, MonitorAction.All);
+ AddFollowerMonitor (followerMonitor, MonitorAction.All);
}
- public void AddSlaveMonitor (IProgressMonitor slaveMonitor, MonitorAction actionMask)
+ public void AddFollowerMonitor (ProgressMonitor followerMonitor, MonitorAction actionMask)
{
MonitorInfo smon = new MonitorInfo ();
smon.ActionMask = actionMask;
- smon.Monitor = slaveMonitor;
+ smon.Monitor = followerMonitor;
monitors.Add (smon);
- if ((actionMask & MonitorAction.SlaveCancel) != 0)
- slaveMonitor.CancelRequested += new MonitorHandler (OnSlaveCancelRequested);
+ if ((actionMask & MonitorAction.FollowerCancel) != 0)
+ smon.CancellationTokenRegistration = followerMonitor.CancellationToken.Register (OnFollowerCancelRequested);
}
-
- public void BeginTask (string name, int totalWork)
+
+ protected override void OnBeginTask (string name, int totalWork, int stepWork)
{
foreach (MonitorInfo info in monitors)
if ((info.ActionMask & MonitorAction.Tasks) != 0)
info.Monitor.BeginTask (name, totalWork);
}
-
- public void BeginStepTask (string name, int totalWork, int stepSize)
+
+ protected override void OnEndTask (string name, int totalWork, int stepWork)
{
foreach (MonitorInfo info in monitors)
if ((info.ActionMask & MonitorAction.Tasks) != 0)
- info.Monitor.BeginStepTask (name, totalWork, stepSize);
+ info.Monitor.EndTask ();
}
-
- public void EndTask ()
+
+ protected override void OnStep (string message, int work)
{
foreach (MonitorInfo info in monitors)
if ((info.ActionMask & MonitorAction.Tasks) != 0)
- info.Monitor.EndTask ();
+ info.Monitor.Step (message, work);
}
-
- public void Step (int work)
+
+ protected override void OnBeginStep (string message, int work)
{
foreach (MonitorInfo info in monitors)
if ((info.ActionMask & MonitorAction.Tasks) != 0)
- info.Monitor.Step (work);
+ info.Monitor.BeginStep (message, work);
}
-
- public TextWriter Log
+
+ protected override ProgressMonitor CreateAsyncStepMonitor ()
{
- get { return logger; }
+ return new AggregatedProgressMonitor ();
}
-
- void OnWriteLog (string text)
+
+ protected override void OnBeginAsyncStep (string message, int work, ProgressMonitor stepMonitor)
+ {
+ var am = (AggregatedProgressMonitor) stepMonitor;
+ foreach (MonitorInfo info in monitors)
+ if ((info.ActionMask & MonitorAction.Tasks) != 0) {
+ var sm = info.Monitor.BeginAsyncStep (message, work);
+ sm.ReportGlobalDataToParent = false;
+ am.AddFollowerMonitor (sm);
+ }
+ }
+
+ protected override void OnWriteLog (string message)
{
foreach (MonitorInfo info in monitors)
if ((info.ActionMask & MonitorAction.WriteLog) != 0)
- info.Monitor.Log.Write (text);
+ info.Monitor.Log.Write (message);
}
-
- public void ReportSuccess (string message)
+
+ protected override void OnWriteErrorLog (string message)
+ {
+ foreach (MonitorInfo info in monitors)
+ if ((info.ActionMask & MonitorAction.WriteLog) != 0)
+ info.Monitor.ErrorLog.Write (message);
+ }
+
+ protected override void OnSuccessReported (string message)
{
foreach (MonitorInfo info in monitors)
if ((info.ActionMask & MonitorAction.ReportSuccess) != 0)
info.Monitor.ReportSuccess (message);
}
-
- public void ReportWarning (string message)
+
+ protected override void OnWarningReported (string message)
{
foreach (MonitorInfo info in monitors)
if ((info.ActionMask & MonitorAction.ReportWarning) != 0)
info.Monitor.ReportWarning (message);
}
-
- public void ReportError (string message, Exception ex)
+
+ protected override void OnErrorReported (string message, Exception exception)
{
foreach (MonitorInfo info in monitors)
if ((info.ActionMask & MonitorAction.ReportError) != 0)
- info.Monitor.ReportError (message, ex);
+ info.Monitor.ReportError (message, exception);
}
-
- public void Dispose ()
+
+ public override void Dispose ()
{
- foreach (MonitorInfo info in monitors) {
+ base.Dispose ();
+ foreach (MonitorInfo info in monitors) {
if ((info.ActionMask & MonitorAction.Dispose) != 0)
info.Monitor.Dispose ();
- if ((info.ActionMask & MonitorAction.SlaveCancel) != 0)
- info.Monitor.CancelRequested -= new MonitorHandler (OnSlaveCancelRequested);
- }
- }
-
- public bool IsCancelRequested
- {
- get {
- foreach (MonitorInfo info in monitors)
- if ((info.ActionMask & MonitorAction.SlaveCancel) != 0) {
- if (info.Monitor.IsCancelRequested) return true;
- }
- return false;
+ if ((info.ActionMask & MonitorAction.FollowerCancel) != 0)
+ info.CancellationTokenRegistration.Dispose ();
}
}
-
- public object SyncRoot {
- get { return this; }
- }
-
- void OnSlaveCancelRequested (IProgressMonitor sender)
- {
- AsyncOperation.Cancel ();
- }
-
- public IAsyncOperation AsyncOperation
- {
- get { return this; }
- }
-
- void IAsyncOperation.Cancel ()
- {
- foreach (MonitorInfo info in monitors)
- if ((info.ActionMask & MonitorAction.Cancel) != 0 && !info.Monitor.IsCancelRequested)
- info.Monitor.AsyncOperation.Cancel ();
- }
-
- void IAsyncOperation.WaitForCompleted ()
+
+ void OnFollowerCancelRequested ()
{
- masterMonitor.AsyncOperation.WaitForCompleted ();
- }
-
- public bool IsCompleted {
- get { return masterMonitor.AsyncOperation.IsCompleted; }
- }
-
- bool IAsyncOperation.Success {
- get { return masterMonitor.AsyncOperation.Success; }
- }
-
- bool IAsyncOperation.SuccessWithWarnings {
- get { return masterMonitor.AsyncOperation.SuccessWithWarnings; }
- }
-
- public event MonitorHandler CancelRequested {
- add { masterMonitor.CancelRequested += value; }
- remove { masterMonitor.CancelRequested -= value; }
- }
-
- public event OperationHandler Completed {
- add { masterMonitor.AsyncOperation.Completed += value; }
- remove { masterMonitor.AsyncOperation.Completed -= value; }
+ CancellationTokenSource.Cancel ();
}
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AsyncOperation.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AsyncOperation.cs
deleted file mode 100644
index 59201ae555..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AsyncOperation.cs
+++ /dev/null
@@ -1,134 +0,0 @@
-// AsyncOperation.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.Threading;
-
-namespace MonoDevelop.Core
-{
- public class AsyncOperation: IAsyncOperation
- {
- bool canceled;
- bool completed;
- bool success;
- bool successWithWarnings;
- IAsyncOperation trackedOperation;
- object lck = new object ();
-
- OperationHandler completedEvent;
-
- public event OperationHandler Completed {
- add {
- bool done = false;
- lock (lck) {
- if (completed)
- done = true;
- else
- completedEvent += value;
- }
- if (done)
- value (this);
- }
- remove {
- lock (lck) {
- completedEvent -= value;
- }
- }
- }
-
- public event OperationHandler CancelRequested;
-
- public bool Canceled {
- get { return canceled; }
- }
-
- public void Cancel ()
- {
- canceled = true;
- if (trackedOperation != null)
- trackedOperation.Cancel ();
- if (CancelRequested != null)
- CancelRequested (this);
- }
-
- void IAsyncOperation.WaitForCompleted ()
- {
- lock (lck) {
- if (!completed)
- Monitor.Wait (lck);
- }
- }
-
- public bool IsCompleted {
- get {
- return completed;
- }
- }
-
- public bool Success {
- get {
- return success;
- }
- }
-
- public bool SuccessWithWarnings {
- get {
- return successWithWarnings;
- }
- }
-
- public void TrackOperation (IAsyncOperation oper, bool isFinal)
- {
- if (trackedOperation != null)
- throw new InvalidOperationException ("An operation is already being tracked.");
- trackedOperation = oper;
- oper.Completed += delegate {
- if (!oper.Success || isFinal)
- SetCompleted (oper.Success, oper.SuccessWithWarnings);
- trackedOperation = null;
- };
- }
-
- public void SetCompleted (bool success)
- {
- SetCompleted (success, false);
- }
-
- public void SetCompleted (bool success, bool hasWarnings)
- {
- lock (lck) {
- completed = true;
- this.success = success;
- if (success && hasWarnings)
- successWithWarnings = true;
- Monitor.PulseAll (lck);
- if (completedEvent != null)
- completedEvent (this);
- }
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs
index 90cecfdb54..2341b979cc 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs
@@ -31,7 +31,7 @@ using System.IO;
namespace MonoDevelop.Core.ProgressMonitoring
{
- public class ConsoleProgressMonitor: NullProgressMonitor
+ public class ConsoleProgressMonitor: ProgressMonitor
{
int columns = 0;
bool leaveOpen;
@@ -40,7 +40,6 @@ namespace MonoDevelop.Core.ProgressMonitoring
int ilevel = 0;
int isize = 3;
int col = -1;
- LogTextWriter logger;
bool ignoreLogMessages;
TextWriter writer;
@@ -64,8 +63,6 @@ namespace MonoDevelop.Core.ProgressMonitoring
{
this.writer = writer;
this.leaveOpen = leaveOpen;
- logger = new LogTextWriter ();
- logger.TextWritten += WriteLog;
}
public ConsoleProgressMonitor (TextWriter writer) : this (writer, false)
@@ -74,9 +71,6 @@ namespace MonoDevelop.Core.ProgressMonitoring
public override void Dispose ()
{
- logger.TextWritten -= WriteLog;
- logger.Dispose ();
-
if (!leaveOpen)
writer.Dispose ();
@@ -107,7 +101,7 @@ namespace MonoDevelop.Core.ProgressMonitoring
set { indent = value; }
}
- public override void BeginTask (string name, int totalWork)
+ protected override void OnBeginTask (string name, int totalWork, int stepWork)
{
if (!ignoreLogMessages) {
WriteText (name);
@@ -115,38 +109,29 @@ namespace MonoDevelop.Core.ProgressMonitoring
}
}
- public override void BeginStepTask (string name, int totalWork, int stepSize)
- {
- BeginTask (name, totalWork);
- }
-
- public override void EndTask ()
+ protected override void OnEndTask (string name, int totalWork, int stepWork)
{
if (!ignoreLogMessages)
Unindent ();
}
-
- void WriteLog (string text)
+
+ protected override void OnWriteLog (string message)
{
if (!ignoreLogMessages)
- WriteText (text);
- }
-
- public override TextWriter Log {
- get { return logger; }
+ WriteText (message);
}
-
- public override void ReportSuccess (string message)
+
+ protected override void OnSuccessReported (string message)
{
WriteText (message + "\n");
}
-
- public override void ReportWarning (string message)
+
+ protected override void OnWarningReported (string message)
{
WriteText ("WARNING: " + message + "\n");
}
-
- public override void ReportError (string message, Exception ex)
+
+ protected override void OnErrorReported (string message, Exception ex)
{
if (message == null && ex != null)
message = ex.Message;
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProjectLoadProgressMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProjectLoadProgressMonitor.cs
index fdc4b32e36..2251f9698f 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProjectLoadProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProjectLoadProgressMonitor.cs
@@ -27,23 +27,14 @@ using System;
namespace MonoDevelop.Core.ProgressMonitoring
{
- public class ConsoleProjectLoadProgressMonitor : WrappedProgressMonitor, IProjectLoadProgressMonitor
+ public class ConsoleProjectLoadProgressMonitor : ProjectLoadProgressMonitor
{
- public MonoDevelop.Projects.Solution CurrentSolution { get; set; }
-
- public ConsoleProjectLoadProgressMonitor (IProgressMonitor monitor)
- : base (monitor)
- {
-
- }
-
- protected override void Dispose (bool disposing)
+ public ConsoleProjectLoadProgressMonitor (ConsoleProgressMonitor monitor)
{
- CurrentSolution = null;
- base.Dispose (disposing);
+ AddFollowerMonitor (monitor);
}
- public MonoDevelop.Projects.Extensions.MigrationType ShouldMigrateProject ()
+ public override MonoDevelop.Projects.Extensions.MigrationType ShouldMigrateProject ()
{
Console.WriteLine ("Warning: One or more projects in this solution cannot be ");
Console.WriteLine ("compiled unless they are migrated to a newer format. Please ");
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/FilteredProgressMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/FilteredProgressMonitor.cs
index 4c1f97df84..3d1a800824 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/FilteredProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/FilteredProgressMonitor.cs
@@ -34,14 +34,14 @@ namespace MonoDevelop.Core.ProgressMonitoring
// the operation being monitorized provides.
public class FilteredProgressMonitor: AggregatedProgressMonitor
{
- public FilteredProgressMonitor (IProgressMonitor targetMonitor)
- : this (targetMonitor, MonitorAction.WriteLog | MonitorAction.ReportError | MonitorAction.ReportWarning | MonitorAction.ReportSuccess | MonitorAction.Cancel | MonitorAction.SlaveCancel)
+ public FilteredProgressMonitor (ProgressMonitor targetMonitor)
+ : this (targetMonitor, MonitorAction.WriteLog | MonitorAction.ReportError | MonitorAction.ReportWarning | MonitorAction.ReportSuccess | MonitorAction.Cancel | MonitorAction.FollowerCancel)
{
}
- public FilteredProgressMonitor (IProgressMonitor targetMonitor, MonitorAction actionMask)
+ public FilteredProgressMonitor (ProgressMonitor targetMonitor, MonitorAction actionMask)
{
- AddSlaveMonitor (targetMonitor, actionMask);
+ AddFollowerMonitor (targetMonitor, actionMask);
}
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/IProjectLoadProgressMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/IProjectLoadProgressMonitor.cs
deleted file mode 100644
index e6511a2215..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/IProjectLoadProgressMonitor.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// IProjectLoadProgressMonitor.cs
-//
-// Author:
-// Alan McGovern <alan@xamarin.com>
-//
-// Copyright 2011 Xamarin Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using MonoDevelop.Projects.Extensions;
-
-namespace MonoDevelop.Core
-{
- public interface IProjectLoadProgressMonitor : IProgressMonitor
- {
- MonoDevelop.Projects.Solution CurrentSolution { get; set; }
- MigrationType ShouldMigrateProject ();
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/NullAsyncOperation.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/NullAsyncOperation.cs
deleted file mode 100644
index 4262120002..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/NullAsyncOperation.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// NullAsyncOperation.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-
-namespace MonoDevelop.Core.ProgressMonitoring
-{
- public class NullAsyncOperation: IAsyncOperation
- {
- public static NullAsyncOperation Success = new NullAsyncOperation (true, false);
- public static NullAsyncOperation Failure = new NullAsyncOperation (false, false);
-
- bool success;
- bool warnings;
-
- protected NullAsyncOperation (bool success, bool warnings)
- {
- this.success = success;
- this.warnings = warnings;
- }
-
- public void Cancel ()
- {
- }
-
- public void WaitForCompleted ()
- {
- }
-
- public bool IsCompleted {
- get { return true; }
- }
-
- bool IAsyncOperation.Success {
- get { return success; }
- }
-
- bool IAsyncOperation.SuccessWithWarnings {
- get { return success && warnings; }
- }
-
- public event OperationHandler Completed {
- add { value (this); }
- remove {}
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/NullProgressMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/NullProgressMonitor.cs
deleted file mode 100644
index d79899c4f0..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/NullProgressMonitor.cs
+++ /dev/null
@@ -1,242 +0,0 @@
-//
-// NullProgressMonitor.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using System.IO;
-
-namespace MonoDevelop.Core.ProgressMonitoring
-{
- public class NullProgressMonitor: IProgressMonitor, IAsyncOperation
- {
- bool done, canceled, error;
- ManualResetEvent waitEvent;
- List<ProgressError> errors;
- List<string> warnings;
- List<string> messages;
-
- public object SyncRoot {
- get { return this; }
- }
-
- public string[] Messages {
- get {
- if (messages != null)
- return messages.ToArray ();
- return new string [0];
- }
- }
-
- public string[] Warnings {
- get {
- if (warnings != null)
- return warnings.ToArray ();
- return new string [0];
- }
- }
-
- public ProgressError[] Errors {
- get {
- if (errors != null)
- return errors.ToArray ();
- return new ProgressError [0];
- }
- }
-
- public virtual void BeginTask (string name, int totalWork)
- {
- }
-
- public virtual void EndTask ()
- {
- }
-
- public virtual void BeginStepTask (string name, int totalWork, int stepSize)
- {
- }
-
- public virtual void Step (int work)
- {
- }
-
- public virtual TextWriter Log {
- get { return TextWriter.Null; }
- }
-
- public virtual void ReportSuccess (string message)
- {
- if (messages == null)
- messages = new List<string> ();
- messages.Add (message);
- }
-
- public virtual void ReportWarning (string message)
- {
- if (warnings == null)
- warnings = new List<string> ();
- warnings.Add (message);
- }
-
- public virtual void ReportError (string message, Exception ex)
- {
- if (errors == null)
- errors = new List<ProgressError> ();
-
- if (message == null && ex != null)
- message = ex.Message;
- else if (message != null && ex != null) {
- if (!message.EndsWith (".")) message += ".";
- message += " " + ex.Message;
- }
-
- errors.Add (new ProgressError (message, ex));
- error = true;
- }
-
- public bool IsCancelRequested {
- get { return canceled; }
- }
-
- public virtual void Dispose ()
- {
- lock (this) {
- if (done) return;
- done = true;
- if (waitEvent != null)
- waitEvent.Set ();
- }
- OnCompleted ();
- }
-
- public IAsyncOperation AsyncOperation
- {
- get { return this; }
- }
-
- void IAsyncOperation.Cancel ()
- {
- OnCancelRequested ();
- }
-
- void IAsyncOperation.WaitForCompleted ()
- {
- lock (this) {
- if (done) return;
- if (waitEvent == null)
- waitEvent = new ManualResetEvent (false);
- }
- waitEvent.WaitOne ();
- }
-
- bool IAsyncOperation.IsCompleted
- {
- get { return done; }
- }
-
- bool IAsyncOperation.Success {
- get { return !error && !canceled; }
- }
-
- bool IAsyncOperation.SuccessWithWarnings {
- get { return !error && warnings != null; }
- }
-
- public event OperationHandler Completed {
- add {
- bool alreadyCompleted = false;
- lock (this) {
- completedEvent += value;
- alreadyCompleted = done;
- }
- if (alreadyCompleted) value (this);
- }
- remove {
- lock (this) {
- completedEvent -= value;
- }
- }
- }
-
- public event MonitorHandler CancelRequested {
- add {
- bool alreadyCanceled = false;
- lock (this) {
- cancelRequestedEvent += value;
- alreadyCanceled = canceled;
- }
- if (alreadyCanceled) value (this);
- }
- remove {
- lock (this) {
- cancelRequestedEvent -= value;
- }
- }
- }
-
- protected virtual void OnCancelRequested ()
- {
- lock (this) {
- if (canceled) return;
- canceled = true;
- }
- if (cancelRequestedEvent != null)
- cancelRequestedEvent (this);
- }
-
- protected virtual void OnCompleted ()
- {
- if (completedEvent != null)
- completedEvent (AsyncOperation);
- }
-
- event MonitorHandler cancelRequestedEvent;
- event OperationHandler completedEvent;
- }
-
- public class ProgressError
- {
- Exception ex;
- string message;
-
- public ProgressError (string message, Exception ex)
- {
- this.ex = ex;
- this.message = message;
- }
-
- public string Message {
- get { return message; }
- }
-
- public Exception Exception {
- get { return ex; }
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ProgressStatusMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ProgressStatusMonitor.cs
index b35e4043de..6f3c772b21 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ProgressStatusMonitor.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ProgressStatusMonitor.cs
@@ -33,15 +33,16 @@ namespace MonoDevelop.Core.ProgressMonitoring
{
public class ProgressStatusMonitor: MarshalByRefObject, IProgressStatus, IDisposable
{
- IProgressMonitor monitor;
+ ProgressMonitor monitor;
int step;
int logLevel;
+ bool canceled;
- public ProgressStatusMonitor (IProgressMonitor monitor): this (monitor, 1)
+ public ProgressStatusMonitor (ProgressMonitor monitor): this (monitor, 1)
{
}
- public ProgressStatusMonitor (IProgressMonitor monitor, int logLevel)
+ public ProgressStatusMonitor (ProgressMonitor monitor, int logLevel)
{
this.logLevel = logLevel;
this.monitor = monitor;
@@ -77,7 +78,7 @@ namespace MonoDevelop.Core.ProgressMonitoring
}
public bool IsCanceled {
- get { return monitor.IsCancelRequested; }
+ get { return monitor.CancellationToken.IsCancellationRequested || canceled; }
}
public int LogLevel {
@@ -87,7 +88,7 @@ namespace MonoDevelop.Core.ProgressMonitoring
public void Cancel ()
{
- monitor.AsyncOperation.Cancel ();
+ canceled = true;
}
public void Dispose ()
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ProjectLoadProgressMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ProjectLoadProgressMonitor.cs
new file mode 100644
index 0000000000..8322df451d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ProjectLoadProgressMonitor.cs
@@ -0,0 +1,53 @@
+//
+// IProjectLoadProgressMonitor.cs
+//
+// Author:
+// Alan McGovern <alan@xamarin.com>
+//
+// Copyright 2011 Xamarin Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Threading;
+using MonoDevelop.Projects.Extensions;
+
+namespace MonoDevelop.Core
+{
+ public abstract class ProjectLoadProgressMonitor : ProgressMonitor
+ {
+ public MonoDevelop.Projects.Solution CurrentSolution { get; set; }
+ public abstract MigrationType ShouldMigrateProject ();
+
+ public ProjectLoadProgressMonitor ()
+ {
+ }
+
+ public ProjectLoadProgressMonitor (SynchronizationContext context): base (context)
+ {
+ }
+
+ public override void Dispose ()
+ {
+ CurrentSolution = null;
+ base.Dispose ();
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/SimpleProgressMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/SimpleProgressMonitor.cs
deleted file mode 100644
index 13ff23051e..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/SimpleProgressMonitor.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-//
-// SimpleProgressMonitor.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-
-namespace MonoDevelop.Core.ProgressMonitoring
-{
- public class SimpleProgressMonitor: NullProgressMonitor
- {
- ProgressTracker tracker = new ProgressTracker ();
-
- protected ProgressTracker Tracker {
- get { return tracker; }
- }
-
- public SimpleProgressMonitor()
- {
- }
-
- public override void BeginTask (string name, int totalWork)
- {
- tracker.BeginTask (name, totalWork);
- OnProgressChanged ();
- }
-
- public override void BeginStepTask (string name, int totalWork, int stepSize)
- {
- tracker.BeginStepTask (name, totalWork, stepSize);
- OnProgressChanged ();
- }
-
- public override void EndTask ()
- {
- tracker.EndTask ();
- OnProgressChanged ();
- }
-
- public override void Step (int work)
- {
- tracker.Step (work);
- OnProgressChanged ();
- }
-
- protected override void OnCompleted ()
- {
- base.OnCompleted ();
- OnProgressChanged ();
- }
-
- protected virtual void OnProgressChanged ()
- {
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/SynchronizedProgressMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/SynchronizedProgressMonitor.cs
deleted file mode 100644
index 083000735f..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/SynchronizedProgressMonitor.cs
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// SynchronizedProgressMonitor.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Threading;
-using System.IO;
-
-namespace MonoDevelop.Core.ProgressMonitoring
-{
- public sealed class SynchronizedProgressMonitor: IProgressMonitor
- {
- IProgressMonitor monitor;
-
- public SynchronizedProgressMonitor (IProgressMonitor monitor)
- {
- this.monitor = monitor;
- }
-
- public void BeginTask (string name, int totalWork)
- {
- lock (monitor.SyncRoot) {
- monitor.BeginTask (name, totalWork);
- }
- }
-
- public void BeginStepTask (string name, int totalWork, int stepSize)
- {
- lock (monitor.SyncRoot) {
- monitor.BeginStepTask (name, totalWork, stepSize);
- }
- }
-
- public void EndTask ()
- {
- lock (monitor.SyncRoot) {
- monitor.EndTask ();
- }
- }
-
- public void Step (int work)
- {
- lock (monitor.SyncRoot) {
- monitor.Step (work);
- }
- }
-
- public TextWriter Log {
- get { return monitor.Log; }
- }
-
- public void ReportSuccess (string message)
- {
- lock (monitor.SyncRoot) {
- monitor.ReportSuccess (message);
- }
- }
-
- public void ReportWarning (string message)
- {
- lock (monitor.SyncRoot) {
- monitor.ReportWarning (message);
- }
- }
-
- public void ReportError (string message, Exception ex)
- {
- lock (monitor.SyncRoot) {
- monitor.ReportError (message, ex);
- }
- }
-
- public bool IsCancelRequested {
- get {
- lock (monitor.SyncRoot) {
- return monitor.IsCancelRequested;
- }
- }
- }
-
- public void Dispose ()
- {
- lock (monitor.SyncRoot) {
- monitor.Dispose ();
- }
- }
-
- public IAsyncOperation AsyncOperation
- {
- get {
- lock (monitor.SyncRoot) {
- return monitor.AsyncOperation;
- }
- }
- }
-
- public event MonitorHandler CancelRequested {
- add {
- lock (monitor.SyncRoot) {
- monitor.CancelRequested += value;
- }
- }
- remove {
- lock (monitor.SyncRoot) {
- monitor.CancelRequested -= value;
- }
- }
- }
-
- public object SyncRoot {
- get { return monitor.SyncRoot; }
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/WrappedProgressMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/WrappedProgressMonitor.cs
deleted file mode 100644
index d8550f2a0f..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/WrappedProgressMonitor.cs
+++ /dev/null
@@ -1,115 +0,0 @@
-//
-// ProjectLoadProgressMonitor.cs
-//
-// Author:
-// Alan McGovern <alan@xamarin.com>
-//
-// Copyright 2011 Xamarin Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-
-namespace MonoDevelop.Core
-{
- public class WrappedProgressMonitor : IProgressMonitor
- {
- public event MonitorHandler CancelRequested {
- add { WrappedMonitor.CancelRequested += value; }
- remove { WrappedMonitor.CancelRequested -= value; }
- }
-
- public IAsyncOperation AsyncOperation {
- get { return WrappedMonitor.AsyncOperation; }
- }
-
- public bool IsCancelRequested {
- get { return WrappedMonitor.IsCancelRequested; }
- }
-
- public System.IO.TextWriter Log {
- get { return WrappedMonitor.Log; }
- }
-
- public object SyncRoot {
- get { return WrappedMonitor.SyncRoot; }
- }
-
- IProgressMonitor WrappedMonitor {
- get; set;
- }
-
- public WrappedProgressMonitor (IProgressMonitor monitor)
- {
- WrappedMonitor = monitor;
- }
-
- public void BeginStepTask (string name, int totalWork, int stepSize)
- {
- WrappedMonitor.BeginStepTask (name, totalWork, stepSize);
- }
-
- public void BeginTask (string name, int totalWork)
- {
- WrappedMonitor.BeginTask (name, totalWork);
- }
-
- protected virtual void Dispose (bool disposing)
- {
- if (!disposing)
- return;
-
- if (WrappedMonitor != null) {
- WrappedMonitor.Dispose ();
- WrappedMonitor = null;
- }
- }
-
- public void Dispose ()
- {
- Dispose (true);
- GC.SuppressFinalize (this);
- }
-
- public void EndTask ()
- {
- WrappedMonitor.EndTask ();
- }
-
- public void ReportError (string message, Exception exception)
- {
- WrappedMonitor.ReportError (message, exception);
- }
-
- public void ReportSuccess (string message)
- {
- WrappedMonitor.ReportSuccess (message);
- }
-
- public void ReportWarning (string message)
- {
- WrappedMonitor.ReportWarning (message);
- }
-
- public void Step (int work)
- {
- WrappedMonitor.Step (work);
- }
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/ClassDataType.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/ClassDataType.cs
index 719e316efe..c1d0954759 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/ClassDataType.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/ClassDataType.cs
@@ -313,15 +313,25 @@ namespace MonoDevelop.Core.Serialization
foreach (ItemProperty prop in Properties) {
if (prop.ReadOnly || !prop.CanSerialize (serCtx, obj))
continue;
+
+ DataCollection col = itemCol;
+
object val = prop.GetValue (obj);
- if (val == null)
- continue;
- if (!serCtx.IsDefaultValueSerializationForced (prop) && val.Equals (prop.DefaultValue))
+ if (val == null) {
+ if (serCtx.IncludeDeletedValues) {
+ if (prop.IsNested)
+ col = GetNestedCollection (col, prop.NameList, 0, true);
+ col.Add (new DataDeletedNode (prop.SingleName));
+ }
continue;
+ }
- DataCollection col = itemCol;
+ var isDefault = val.Equals (prop.DefaultValue);
+ if (isDefault && !serCtx.IsDefaultValueSerializationForced (prop))
+ continue;
+
if (prop.IsNested)
- col = GetNestedCollection (col, prop.NameList, 0);
+ col = GetNestedCollection (col, prop.NameList, 0, isDefault);
if (prop.ExpandedCollection) {
ICollectionHandler handler = prop.ExpandedCollectionHandler;
@@ -336,8 +346,12 @@ namespace MonoDevelop.Core.Serialization
}
else {
DataNode data = prop.Serialize (serCtx, obj, val);
- if (data == null)
+ if (data == null) {
+ if (serCtx.IncludeDeletedValues)
+ col.Add (new DataDeletedNode (prop.SingleName));
continue;
+ }
+ data.IsDefaultValue = isDefault;
col.Add (data);
}
}
@@ -352,7 +366,7 @@ namespace MonoDevelop.Core.Serialization
return itemCol;
}
- DataCollection GetNestedCollection (DataCollection col, string[] nameList, int pos)
+ DataCollection GetNestedCollection (DataCollection col, string[] nameList, int pos, bool isDefault)
{
if (pos == nameList.Length - 1) return col;
@@ -361,8 +375,11 @@ namespace MonoDevelop.Core.Serialization
item = new DataItem ();
item.Name = nameList[pos];
col.Add (item);
+ item.IsDefaultValue = isDefault;
}
- return GetNestedCollection (item.ItemData, nameList, pos + 1);
+ if (item.IsDefaultValue && !isDefault)
+ item.IsDefaultValue = false;
+ return GetNestedCollection (item.ItemData, nameList, pos + 1, isDefault);
}
internal protected override object OnDeserialize (SerializationContext serCtx, object mapData, DataNode data)
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataCollection.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataCollection.cs
index f1b2f12b5d..970427f092 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataCollection.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataCollection.cs
@@ -29,57 +29,28 @@
using System;
using System.Collections;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
namespace MonoDevelop.Core.Serialization
{
[Serializable]
- public class DataCollection: IEnumerable
+ public sealed class DataCollection: Collection<DataNode>
{
- List<DataNode> list = new List<DataNode> ();
-
- public DataCollection ()
- {
- }
-
- protected List<DataNode> List {
- get {
- if (list == null)
- list = new List<DataNode> ();
- return list;
- }
- }
-
- public int Count
- {
- get { return list == null ? 0 : list.Count; }
- }
-
- public virtual DataNode this [int n]
- {
- get { return List[n]; }
- set { List[n] = value; }
- }
-
- public virtual DataNode this [string name]
+ public DataNode this [string name]
{
get {
DataCollection col;
int i = FindData (name, out col, false);
- if (i != -1) return col.List [i];
+ if (i != -1) return col [i];
else return null;
}
}
int FindData (string name, out DataCollection colec, bool buildTree)
{
- if (list == null) {
- colec = null;
- return -1;
- }
-
if (name.IndexOf ('/') == -1) {
- for (int n=0; n<list.Count; n++) {
- DataNode data = list [n];
+ for (int n=0; n<Items.Count; n++) {
+ DataNode data = Items [n];
if (data.Name == name) {
colec = this;
return n;
@@ -111,8 +82,8 @@ namespace MonoDevelop.Core.Serialization
}
pos = -1;
- for (int n=0; n<colec.List.Count; n++) {
- data = colec.List [n];
+ for (int n=0; n<colec.Count; n++) {
+ data = colec [n];
if (data.Name == names [p]) {
pos = n; break;
}
@@ -122,47 +93,14 @@ namespace MonoDevelop.Core.Serialization
}
}
- public virtual IEnumerator GetEnumerator ()
- {
- return list == null ? Type.EmptyTypes.GetEnumerator() : list.GetEnumerator ();
- }
-
- public void AddRange (DataCollection col)
- {
- foreach (DataNode node in col)
- Add (node);
- }
-
- public virtual void Add (DataNode entry)
- {
- if (entry == null)
- throw new ArgumentNullException ("entry");
-
- List.Add (entry);
- }
-
- public virtual void Insert (int index, DataNode entry)
- {
- if (entry == null)
- throw new ArgumentNullException ("entry");
-
- List.Insert (index, entry);
- }
-
- public virtual void Add (DataNode entry, string itemPath)
+ public void Add (DataNode entry, string itemPath)
{
if (entry == null)
throw new ArgumentNullException ("entry");
DataCollection col;
FindData (itemPath + "/", out col, true);
- col.List.Add (entry);
- }
-
- public virtual void Remove (DataNode entry)
- {
- if (list != null)
- list.Remove (entry);
+ Add (entry);
}
public DataNode Extract (string name)
@@ -170,25 +108,13 @@ namespace MonoDevelop.Core.Serialization
DataCollection col;
int i = FindData (name, out col, false);
if (i != -1) {
- DataNode data = col.List [i];
- col.list.RemoveAt (i);
+ DataNode data = col [i];
+ col.RemoveAt (i);
return data;
}
return null;
}
- public int IndexOf (DataNode entry)
- {
- if (list == null) return -1;
- return list.IndexOf (entry);
- }
-
- public virtual void Clear ()
- {
- if (list != null)
- list.Clear ();
- }
-
public void Merge (DataCollection col)
{
ArrayList toAdd = new ArrayList ();
@@ -204,18 +130,5 @@ namespace MonoDevelop.Core.Serialization
foreach (DataNode node in toAdd)
Add (node);
}
-
- // Sorts the list using the specified key order
- public void Sort (Dictionary<string,int> nameToPosition)
- {
- list.Sort (delegate (DataNode x, DataNode y) {
- int p1, p2;
- if (!nameToPosition.TryGetValue (x.Name, out p1))
- p1 = int.MaxValue;
- if (!nameToPosition.TryGetValue (y.Name, out p2))
- p2 = int.MaxValue;
- return p1.CompareTo (p2);
- });
- }
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataDeletedValue.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataDeletedValue.cs
new file mode 100644
index 0000000000..55233bc925
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataDeletedValue.cs
@@ -0,0 +1,42 @@
+//
+// DataDeletedValue.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Core.Serialization
+{
+ /// <summary>
+ /// A data node that represents a value that has been deleted.
+ /// </summary>
+ [Serializable]
+ public class DataDeletedNode: DataNode
+ {
+ public DataDeletedNode (string name)
+ {
+ Name = name;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataItem.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataItem.cs
index 19bccb54aa..5fd5d9320d 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataItem.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataItem.cs
@@ -27,6 +27,7 @@
//
using System;
+using System.Collections.Generic;
namespace MonoDevelop.Core.Serialization
{
@@ -65,6 +66,30 @@ namespace MonoDevelop.Core.Serialization
if (data == null) return null;
return data.Extract (name);
}
+
+ internal void UpdateFromItem (DataItem item, HashSet<DataItem> removedItems)
+ {
+ foreach (var d in item.ItemData) {
+ var current = ItemData[d.Name];
+ if (current != null) {
+ if (d.IsDefaultValue || d is DataDeletedNode) {
+ if (current is DataItem)
+ removedItems.Add ((DataItem)current);
+ ItemData.Remove (current);
+ }
+ else if (current.GetType () != d.GetType () || current is DataValue) {
+ var i = ItemData.IndexOf (current);
+ ItemData [i] = d;
+ if (current is DataItem)
+ removedItems.Add ((DataItem)current);
+ } else if (current is DataItem) {
+ ((DataItem)current).UpdateFromItem ((DataItem)d, removedItems);
+ }
+ } else if (!d.IsDefaultValue && !(d is DataDeletedNode)) {
+ ItemData.Add (d);
+ }
+ }
+ }
public override string ToString ()
{
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataNode.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataNode.cs
index 1f6a847719..98b1cd9b29 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataNode.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/DataNode.cs
@@ -44,5 +44,11 @@ namespace MonoDevelop.Core.Serialization
{
return "";
}
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is default value.
+ /// </summary>
+ /// <remarks>This flag is set when an object is serialized using the IncludeDefaultValues or IncludeDeletedValues</remarks>
+ public bool IsDefaultValue { get; set; }
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/GenericCollectionHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/GenericCollectionHandler.cs
index ae2c4787fa..8916afbc71 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/GenericCollectionHandler.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/GenericCollectionHandler.cs
@@ -37,7 +37,6 @@ namespace MonoDevelop.Core.Serialization
protected Type type;
protected Type elementType;
protected MethodInfo addMethod;
- protected object[] itemParam = new object [1];
bool hasPublicConstructor;
protected GenericCollectionHandler (Type type, Type elemType, MethodInfo addMethod)
@@ -111,9 +110,7 @@ namespace MonoDevelop.Core.Serialization
public void AddItem (ref object collection, ref object position, object item)
{
- itemParam [0] = item;
- addMethod.Invoke (collection, itemParam);
- itemParam [0] = null;
+ addMethod.Invoke (collection, new [] { item });
position = (int)position + 1;
}
@@ -143,9 +140,7 @@ namespace MonoDevelop.Core.Serialization
public override void SetItem (object collection, object position, object item)
{
- itemParam [0] = position;
- indexer.SetValue (collection, item, itemParam);
- itemParam [0] = null;
+ indexer.SetValue (collection, item, new [] { position });
}
public override object GetInitialPosition (object collection)
@@ -162,10 +157,7 @@ namespace MonoDevelop.Core.Serialization
public override object GetCurrentItem (object collection, object position)
{
- itemParam [0] = position;
- object res = indexer.GetValue (collection, itemParam);
- itemParam [0] = null;
- return res;
+ return indexer.GetValue (collection, new [] { position });
}
public override bool IsEmpty (object collection)
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/ILoadController.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/ILoadController.cs
deleted file mode 100644
index 2fd60df738..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/ILoadController.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-// IReaderControl.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-
-namespace MonoDevelop.Projects
-{
- public interface ILoadController
- {
- void BeginLoad ();
- void EndLoad ();
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/SerializationContext.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/SerializationContext.cs
index 37df92c37f..ffa277d0d8 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/SerializationContext.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/SerializationContext.cs
@@ -37,7 +37,7 @@ namespace MonoDevelop.Core.Serialization
string file;
IPropertyFilter propertyFilter;
DataSerializer serializer;
- IProgressMonitor monitor;
+ ProgressMonitor monitor;
char directorySeparatorChar = System.IO.Path.DirectorySeparatorChar;
HashSet<ItemProperty> forcedSerializationProps;
@@ -73,7 +73,7 @@ namespace MonoDevelop.Core.Serialization
}
}
- public IProgressMonitor ProgressMonitor {
+ public ProgressMonitor ProgressMonitor {
get {
return monitor;
}
@@ -81,9 +81,18 @@ namespace MonoDevelop.Core.Serialization
monitor = value;
}
}
-
+
+ /// <summary>
+ /// When set to true, properties with default values are serialized
+ /// </summary>
public bool IncludeDefaultValues { get; set; }
+ /// <summary>
+ /// When set to true, properties with default values are serialized, and properties that have
+ /// been removed are serialized as a DataDeletedValue.
+ /// </summary>
+ public bool IncludeDeletedValues { get; set; }
+
public void ResetDefaultValueSerialization ()
{
forcedSerializationProps = null;
@@ -98,7 +107,7 @@ namespace MonoDevelop.Core.Serialization
public bool IsDefaultValueSerializationForced (ItemProperty prop)
{
- if (IncludeDefaultValues)
+ if (IncludeDefaultValues || IncludeDeletedValues)
return true;
else if (forcedSerializationProps != null)
return forcedSerializationProps.Contains (prop);
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/XmlDataSerializer.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/XmlDataSerializer.cs
index 2e4a6effff..4765c079fc 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/XmlDataSerializer.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/XmlDataSerializer.cs
@@ -39,6 +39,8 @@ namespace MonoDevelop.Core.Serialization
public bool StoreAllInElements { get; set; }
+ public string Namespace { get; set; }
+
public XmlDataSerializer (DataContext ctx) : this (new DataSerializer (ctx))
{
}
@@ -81,22 +83,38 @@ namespace MonoDevelop.Core.Serialization
{
DataNode data = serializer.Serialize (obj, type);
XmlConfigurationWriter cw = new XmlConfigurationWriter ();
+ cw.Namespace = Namespace;
cw.StoreAllInElements = StoreAllInElements;
cw.Write (writer, data);
}
-
+
+ public T Deserialize<T> (string fileName)
+ {
+ return (T)Deserialize (fileName, typeof (T));
+ }
+
public object Deserialize (string fileName, Type type)
{
using (StreamReader sr = new StreamReader (fileName)) {
return Deserialize (sr, type);
}
}
-
+
+ public T Deserialize<T> (TextReader reader)
+ {
+ return (T)Deserialize (reader, typeof (T));
+ }
+
public object Deserialize (TextReader reader, Type type)
{
return Deserialize (new XmlTextReader (reader), type);
}
-
+
+ public T Deserialize<T> (XmlReader reader)
+ {
+ return (T)Deserialize (reader, typeof (T));
+ }
+
public object Deserialize (XmlReader reader, Type type)
{
DataNode data = XmlConfigurationReader.DefaultReader.Read (reader);
@@ -115,13 +133,15 @@ namespace MonoDevelop.Core.Serialization
public bool StoreAllInElements = false;
public string[] StoreInElementExceptions { get; set; }
+
+ public string Namespace { get; set; }
public void Write (XmlWriter writer, DataNode data)
{
if (data is DataValue)
writer.WriteElementString (data.Name, ((DataValue)data).Value);
else if (data is DataItem) {
- writer.WriteStartElement (data.Name);
+ writer.WriteStartElement (data.Name, Namespace);
WriteAttributes (writer, (DataItem) data);
WriteChildren (writer, (DataItem) data);
writer.WriteEndElement ();
@@ -130,7 +150,7 @@ namespace MonoDevelop.Core.Serialization
public XmlElement Write (XmlDocument doc, DataNode data)
{
- XmlElement elem = doc.CreateElement (data.Name);
+ XmlElement elem = doc.CreateElement (data.Name, Namespace);
if (data is DataValue) {
elem.InnerText = ((DataValue)data).Value;
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.StringParsing/StringTagModelExtensions.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.StringParsing/StringTagModelExtensions.cs
new file mode 100644
index 0000000000..4e8768cb70
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.StringParsing/StringTagModelExtensions.cs
@@ -0,0 +1,52 @@
+//
+// StringTagModelExtensions.cs
+//
+// Author:
+// Michael Hutchinson <m.j.hutchinson@gmail.com>
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2014-2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Core.StringParsing
+{
+ public static class StringTagModelExtensions
+ {
+ public static bool GetBoolValue (this IStringTagModel model, string name, bool defaultValue = false)
+ {
+ object value = model.GetValue (name);
+
+ if (value is bool) {
+ return ((bool)value);
+ }
+
+ var stringValue = value as string;
+ if (!string.IsNullOrEmpty (stringValue)) {
+ bool result;
+ if (bool.TryParse (stringValue, out result)) {
+ return result;
+ }
+ }
+
+ return defaultValue;
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/BacktrackingStringMatcher.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/BacktrackingStringMatcher.cs
index 53c9f25962..d28da461a2 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/BacktrackingStringMatcher.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/BacktrackingStringMatcher.cs
@@ -138,17 +138,23 @@ namespace MonoDevelop.Core.Text
// letter case
ch = text [j];
bool textCharIsUpper = char.IsUpper (ch);
- if (!onlyWordStart && filterChar == (textCharIsUpper ? ch : char.ToUpper (ch)) && char.IsLetter (ch)) {
- // cases don't match. Filter is upper char & letter is low, now prefer the match that does the word skip.
- if (!(textCharIsUpper || (filterTextLowerCaseTable & flag) != 0) && j + 1 < text.Length) {
- int possibleBetterResult = GetMatchChar (text, i, j + 1, onlyWordStart);
- if (possibleBetterResult >= 0)
- return possibleBetterResult;
+ if (!onlyWordStart) {
+ if (filterChar == (textCharIsUpper ? ch : char.ToUpper (ch)) && char.IsLetter (ch)) {
+ // cases don't match. Filter is upper char & letter is low, now prefer the match that does the word skip.
+ if (!(textCharIsUpper || (filterTextLowerCaseTable & flag) != 0) && j + 1 < text.Length) {
+ int possibleBetterResult = GetMatchChar (text, i, j + 1, onlyWordStart);
+ if (possibleBetterResult >= 0)
+ return possibleBetterResult;
+ }
+ return j;
+ }
+ } else {
+ if (textCharIsUpper && filterChar == ch && char.IsLetter (ch)) {
+ return j;
}
- return j;
}
+
// no match, try to continue match at the next word start
-
bool lastWasLower = false;
bool lastWasUpper = false;
int wordStart = j + 1;
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/ISegment.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/ISegment.cs
new file mode 100644
index 0000000000..7c34d93a29
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/ISegment.cs
@@ -0,0 +1,421 @@
+//
+// ISegment.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Core.Text
+{
+ /// <summary>
+ /// An (Offset,Length)-pair.
+ /// </summary>
+ public interface ISegment
+ {
+ /// <summary>
+ /// Gets the start offset of the segment.
+ /// </summary>
+ int Offset { get; }
+
+ /// <summary>
+ /// Gets the length of the segment.
+ /// </summary>
+ /// <remarks>For line segments (IDocumentLine), the length does not include the line delimeter.</remarks>
+ int Length { get; }
+
+ /// <summary>
+ /// Gets the end offset of the segment.
+ /// </summary>
+ /// <remarks>EndOffset = Offset + Length;</remarks>
+ int EndOffset { get; }
+ }
+
+ /// <summary>
+ /// An (Offset, Length) pair representing a text span.
+ /// </summary>
+ public struct TextSegment : IEquatable<TextSegment>, ISegment
+ {
+ public static readonly TextSegment Invalid = new TextSegment (-1, 0);
+
+ readonly int offset;
+
+ /// <summary>
+ /// Gets the start offset of the segment.
+ /// </summary>
+ /// <value>
+ /// The offset.
+ /// </value>
+ public int Offset {
+ get {
+ return offset;
+ }
+ }
+
+ readonly int length;
+
+ /// <summary>
+ /// Gets the length of the segment.
+ /// </summary>
+ /// <value>
+ /// The length.
+ /// </value>
+ public int Length {
+ get {
+ return length;
+ }
+ }
+
+ /// <summary>
+ /// Gets the end offset of the segment.
+ /// </summary>
+ /// <remarks>
+ /// EndOffset = Offset + Length;
+ /// </remarks>
+ /// <value>
+ /// The end offset.
+ /// </value>
+ public int EndOffset {
+ get {
+ return Offset + Length;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether this instance is empty.
+ /// </summary>
+ /// <value>
+ /// <c>true</c> if this instance is empty; otherwise, <c>false</c>.
+ /// </value>
+ public bool IsEmpty {
+ get {
+ return Length == 0;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether this instance is invalid.
+ /// </summary>
+ /// <value>
+ /// <c>true</c> if this instance is invalid; otherwise, <c>false</c>.
+ /// </value>
+ public bool IsInvalid {
+ get {
+ return Offset < 0;
+ }
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="TextSegment"/> struct.
+ /// </summary>
+ /// <param name='offset'>
+ /// The offset of the segment.
+ /// </param>
+ /// <param name='length'>
+ /// The length of the segment.
+ /// </param>
+ public TextSegment (int offset, int length)
+ {
+ this.offset = offset;
+ this.length = length;
+ }
+
+ public static bool operator == (TextSegment left, TextSegment right)
+ {
+ return Equals (left, right);
+ }
+
+ public static bool operator != (TextSegment left, TextSegment right)
+ {
+ return !Equals (left, right);
+ }
+
+ public static bool Equals (TextSegment left, TextSegment right)
+ {
+ return left.Offset == right.Offset && left.Length == right.Length;
+ }
+
+ /// <summary>
+ /// Determines whether this instance is inside the specified offset.
+ /// </summary>
+ /// <returns>
+ /// <c>true</c> if this instance is inside the specified offset (upper bound inclusive); otherwise, <c>false</c>.
+ /// </returns>
+ /// <param name='offset'>
+ /// The offset offset.
+ /// </param>
+ public bool IsInside (int offset)
+ {
+ return Offset <= offset && offset <= EndOffset;
+ }
+
+ /// <summary>
+ /// Determines whether the specified <see cref="TextSegment"/> is equal to the current <see cref="TextSegment"/>.
+ /// </summary>
+ /// <param name='other'>
+ /// The <see cref="TextSegment"/> to compare with the current <see cref="TextSegment"/>.
+ /// </param>
+ /// <returns>
+ /// <c>true</c> if the specified <see cref="TextSegment"/> is equal to the current
+ /// <see cref="TextSegment"/>; otherwise, <c>false</c>.
+ /// </returns>
+ public bool Equals (TextSegment other)
+ {
+ return Equals (this, other);
+ }
+
+ /// <summary>
+ /// Determines whether the specified <see cref="System.Object"/> is equal to the current <see cref="TextSegment"/>.
+ /// </summary>
+ /// <param name='obj'>
+ /// The <see cref="System.Object"/> to compare with the current <see cref="TextSegment"/>.
+ /// </param>
+ /// <returns>
+ /// <c>true</c> if the specified <see cref="System.Object"/> is equal to the current
+ /// <see cref="TextSegment"/>; otherwise, <c>false</c>.
+ /// </returns>
+ public override bool Equals (object obj)
+ {
+ return obj is ISegment && Equals (this, (ISegment)obj);
+ }
+
+ /// <summary>
+ /// Serves as a hash function for a <see cref="TextSegment"/> object.
+ /// </summary>
+ /// <returns>
+ /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a hash table.
+ /// </returns>
+ public override int GetHashCode ()
+ {
+ return Offset ^ Length;
+ }
+
+ public static TextSegment FromBounds (int startOffset, int endOffset)
+ {
+ if (startOffset > endOffset)
+ throw new ArgumentOutOfRangeException ("endOffset", "endOffset < startOffset");
+ return new TextSegment (startOffset, endOffset - startOffset);
+ }
+
+ /// <summary>
+ /// Returns a <see cref="System.String"/> that represents the current <see cref="TextSegment"/>.
+ /// </summary>
+ /// <returns>
+ /// A <see cref="System.String"/> that represents the current <see cref="TextSegment"/>.
+ /// </returns>
+ public override string ToString ()
+ {
+ return string.Format ("[TextSegment: Offset={0}, Length={1}]", Offset, Length);
+ }
+ }
+
+ /// <summary>
+ /// An abstract implementation of the ISegment (Offset, Length) pair representing a text span.
+ /// </summary>
+ public abstract class AbstractSegment : ISegment
+ {
+ readonly int offset;
+
+ /// <summary>
+ /// Gets the start offset of the segment.
+ /// </summary>
+ /// <value>
+ /// The offset.
+ /// </value>
+ public int Offset {
+ get {
+ return offset;
+ }
+ }
+
+ readonly int length;
+
+ /// <summary>
+ /// Gets the length of the segment.
+ /// </summary>
+ /// <value>
+ /// The length.
+ /// </value>
+ public int Length {
+ get {
+ return length;
+ }
+ }
+
+ /// <summary>
+ /// Gets the end offset of the segment.
+ /// </summary>
+ /// <remarks>
+ /// EndOffset = Offset + Length;
+ /// </remarks>
+ /// <value>
+ /// The end offset.
+ /// </value>
+ public int EndOffset {
+ get {
+ return Offset + Length;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether this instance is empty.
+ /// </summary>
+ /// <value>
+ /// <c>true</c> if this instance is empty; otherwise, <c>false</c>.
+ /// </value>
+ public bool IsEmpty {
+ get {
+ return Length == 0;
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether this instance is invalid.
+ /// </summary>
+ /// <value>
+ /// <c>true</c> if this instance is invalid; otherwise, <c>false</c>.
+ /// </value>
+ public bool IsInvalid {
+ get {
+ return Offset < 0;
+ }
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="TextSegment"/> struct.
+ /// </summary>
+ /// <param name='offset'>
+ /// The offset of the segment.
+ /// </param>
+ /// <param name='length'>
+ /// The length of the segment.
+ /// </param>
+ protected AbstractSegment (int offset, int length)
+ {
+ this.offset = offset;
+ this.length = length;
+ }
+
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="TextSegment"/> struct.
+ /// </summary>
+ protected AbstractSegment (ISegment segment)
+ {
+ if (segment == null)
+ throw new ArgumentNullException ("segment");
+ this.offset = segment.Offset;
+ this.length = segment.Length;
+ }
+
+ public override string ToString ()
+ {
+ return string.Format ("[AbstractSegment: Offset={0}, Length={1}]", Offset, Length);
+ }
+ }
+
+
+ /// <summary>
+ /// Extension methods for <see cref="ISegment"/>.
+ /// </summary>
+ public static class ISegmentExtensions
+ {
+ /// <summary>
+ /// Gets whether <paramref name="segment"/> fully contains the specified segment.
+ /// </summary>
+ /// <remarks>
+ /// Use <c>segment.Contains(offset, 0)</c> to detect whether a segment (end inclusive) contains offset;
+ /// use <c>segment.Contains(offset, 1)</c> to detect whether a segment (end exclusive) contains offset.
+ /// </remarks>
+ public static bool Contains (this ISegment segment, int offset, int length)
+ {
+ if (segment == null)
+ throw new ArgumentNullException ("segment");
+ return segment.Offset <= offset && offset + length <= segment.EndOffset;
+ }
+
+ /// <summary>
+ /// Gets whether <paramref name="segment"/> fully contains the specified segment.
+ /// </summary>
+ public static bool Contains (this ISegment segment, ISegment span)
+ {
+ if (segment == null)
+ throw new ArgumentNullException ("segment");
+ if (span == null)
+ throw new ArgumentNullException ("span");
+ return segment.Offset <= span.Offset && span.EndOffset <= segment.EndOffset;
+ }
+
+ /// <summary>
+ /// Gets whether the offset is within the <paramref name="segment"/>.
+ /// </summary>
+ public static bool Contains (this ISegment segment, int offset)
+ {
+ if (segment == null)
+ throw new ArgumentNullException ("segment");
+ return unchecked((uint)(offset - segment.Offset) < (uint)segment.Length);
+ }
+
+ /// <summary>
+ /// Gets whether the offset is within the <paramref name="segment"/>.
+ /// </summary>
+ public static bool IsInside (this ISegment segment, int offset)
+ {
+ if (segment == null)
+ throw new ArgumentNullException ("segment");
+ return unchecked((uint)(offset - segment.Offset) <= (uint)segment.Length);
+ }
+
+ /// <summary>
+ /// Determines whether <paramref name="other"/> overlaps this span. Two spans are considered to overlap
+ /// if they have positions in common and neither is empty. Empty spans do not overlap with any
+ /// other span.
+ /// </summary>
+ public static bool OverlapsWith (this ISegment segment, ISegment other)
+ {
+ int overlapStart = Math.Max (segment.Offset, other.Offset);
+ int overlapEnd = Math.Min (segment.EndOffset, other.EndOffset);
+ return overlapStart < overlapEnd;
+ }
+
+ public static ISegment AdjustSegment (this ISegment segment, TextChangeEventArgs args)
+ {
+ if (segment == null)
+ throw new ArgumentNullException ("segment");
+ if (args.Offset < segment.Offset)
+ return new TextSegment (segment.Offset + args.InsertionLength - args.RemovalLength, segment.Length);
+ if (args.Offset <= segment.EndOffset)
+ return new TextSegment (segment.Offset, segment.Length);
+ return segment;
+ }
+
+ public static IEnumerable<ISegment> AdjustSegments (this IEnumerable<ISegment> segments, TextChangeEventArgs args)
+ {
+ if (segments == null)
+ throw new ArgumentNullException ("segments");
+ foreach (var segment in segments) {
+ yield return segment.AdjustSegment (args);
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/ITextSource.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/ITextSource.cs
new file mode 100644
index 0000000000..436b8a969f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/ITextSource.cs
@@ -0,0 +1,215 @@
+//
+// ITextSource.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.IO;
+using System.Text;
+
+namespace MonoDevelop.Core.Text
+{
+ /// <summary>
+ /// A read-only view on a (potentially mutable) text source.
+ /// The IDocument interface derives from this interface.
+ /// </summary>
+ public interface ITextSource
+ {
+ /// <summary>
+ /// Gets a version identifier for this text source.
+ /// Returns null for unversioned text sources.
+ /// </summary>
+ ITextSourceVersion Version { get; }
+
+ /// <summary>
+ /// Determines if a byte order mark was read or is going to be written.
+ /// </summary>
+ bool UseBOM { get; }
+
+ /// <summary>
+ /// Encoding of the text that was read from or is going to be saved to.
+ /// </summary>
+ Encoding Encoding { get; }
+
+ /// <summary>
+ /// Gets the total text length.
+ /// </summary>
+ /// <returns>The length of the text, in characters.</returns>
+ /// <remarks>This is the same as Text.Length, but is more efficient because
+ /// it doesn't require creating a String object.</remarks>
+ int Length { get; }
+
+ /// <summary>
+ /// Gets the whole text as string.
+ /// </summary>
+ [System.Diagnostics.CodeAnalysis.SuppressMessage ("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")]
+ string Text { get; }
+
+ /// <summary>
+ /// Gets a character at the specified position in the document.
+ /// </summary>
+ /// <paramref name="offset">The index of the character to get.</paramref>
+ /// <exception cref="ArgumentOutOfRangeException">Offset is outside the valid range (0 to TextLength-1).</exception>
+ /// <returns>The character at the specified position.</returns>
+ /// <remarks>This is the same as Text[offset], but is more efficient because
+ /// it doesn't require creating a String object.</remarks>
+ char this [int offset] { get; }
+
+ /// <summary>
+ /// Gets a character at the specified position in the document.
+ /// </summary>
+ /// <paramref name="offset">The index of the character to get.</paramref>
+ /// <exception cref="ArgumentOutOfRangeException">Offset is outside the valid range (0 to TextLength-1).</exception>
+ /// <returns>The character at the specified position.</returns>
+ /// <remarks>This is the same as Text[offset], but is more efficient because
+ /// it doesn't require creating a String object.</remarks>
+ char GetCharAt (int offset);
+
+ /// <summary>
+ /// Retrieves the text for a portion of the document.
+ /// </summary>
+ /// <exception cref="ArgumentOutOfRangeException">offset or length is outside the valid range.</exception>
+ /// <remarks>This is the same as Text.Substring, but is more efficient because
+ /// it doesn't require creating a String object for the whole document.</remarks>
+ string GetTextAt (int offset, int length);
+
+ /// <summary>
+ /// Creates a new TextReader to read from this text source.
+ /// </summary>
+ TextReader CreateReader ();
+
+ /// <summary>
+ /// Creates a new TextReader to read from this text source.
+ /// </summary>
+ TextReader CreateReader (int offset, int length);
+
+ /// <summary>
+ /// Writes the text from this document into the TextWriter.
+ /// </summary>
+ void WriteTextTo (TextWriter writer);
+
+ /// <summary>
+ /// Writes the text from this document into the TextWriter.
+ /// </summary>
+ void WriteTextTo (TextWriter writer, int offset, int length);
+
+ /// <summary>
+ /// Copies text from the source index to a destination array at destinationIndex.
+ /// </summary>
+ /// <param name="sourceIndex">The start offset copied from.</param>
+ /// <param name="destination">The destination array copied to.</param>
+ /// <param name="destinationIndex">The destination index copied to.</param>
+ /// <param name="count">The number of characters to be copied.</param>
+ void CopyTo (int sourceIndex, char [] destination, int destinationIndex, int count);
+
+ /// <summary>
+ /// Creates an immutable snapshot of this text source.
+ /// Unlike all other methods in this interface, this method is thread-safe.
+ /// </summary>
+ ITextSource CreateSnapshot ();
+
+ /// <summary>
+ /// Creates an immutable snapshot of a part of this text source.
+ /// Unlike all other methods in this interface, this method is thread-safe.
+ /// </summary>
+ ITextSource CreateSnapshot (int offset, int length);
+ }
+
+ public static class TextSourceExtension
+ {
+ /// <summary>
+ /// Retrieves the text for a portion of the document.
+ /// </summary>
+ /// <exception cref="ArgumentOutOfRangeException">offset or length is outside the valid range.</exception>
+ public static string GetTextAt (this ITextSource source, ISegment segment)
+ {
+ if (source == null)
+ throw new ArgumentNullException ("source");
+ return source.GetTextAt (segment.Offset, segment.Length);
+ }
+
+
+ public static string GetTextBetween (this ITextSource source, int startOffset, int endOffset)
+ {
+ if (source == null)
+ throw new ArgumentNullException ("source");
+ if (startOffset < 0 || startOffset > source.Length)
+ throw new ArgumentNullException ("startOffset");
+ if (endOffset < 0 || endOffset > source.Length)
+ throw new ArgumentNullException ("endOffset");
+ if (startOffset > endOffset)
+ throw new InvalidOperationException ();
+ return source.GetTextAt (startOffset, endOffset - startOffset);
+ }
+
+
+ /// <summary>
+ /// Writes the text from this document into a file.
+ /// </summary>
+ public static void WriteTextTo (this ITextSource source, string fileName)
+ {
+ if (source == null)
+ throw new ArgumentNullException ("source");
+ TextFileUtility.WriteText (fileName, source.Text, source.Encoding, source.UseBOM);
+ }
+
+ /// <summary>
+ /// Writes the text from this document into the TextWriter.
+ /// </summary>
+ public static void WriteTextTo (this ITextSource source, TextWriter writer, ISegment segment)
+ {
+ if (source == null)
+ throw new ArgumentNullException ("source");
+ if (writer == null)
+ throw new ArgumentNullException ("writer");
+ if (segment == null)
+ throw new ArgumentNullException ("segment");
+ source.WriteTextTo (writer, segment.Offset, segment.Length);
+ }
+
+ /// <summary>
+ /// Creates a new TextReader to read from this text source.
+ /// </summary>
+ public static TextReader CreateReader (this ITextSource source, ISegment segment)
+ {
+ if (source == null)
+ throw new ArgumentNullException ("source");
+ if (segment == null)
+ throw new ArgumentNullException ("segment");
+ return source.CreateReader (segment.Offset, segment.Length);
+ }
+
+ /// <summary>
+ /// Creates an immutable snapshot of a part of this text source.
+ /// Unlike all other methods in this interface, this method is thread-safe.
+ /// </summary>
+ public static ITextSource CreateSnapshot (this ITextSource source, ISegment segment)
+ {
+ if (source == null)
+ throw new ArgumentNullException ("source");
+ if (segment == null)
+ throw new ArgumentNullException ("segment");
+ return source.CreateSnapshot (segment.Offset, segment.Length);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/ITextSourceVersion.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/ITextSourceVersion.cs
new file mode 100644
index 0000000000..fe38c35a09
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/ITextSourceVersion.cs
@@ -0,0 +1,74 @@
+//
+// ITextSourceVersion.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Collections.Generic;
+
+namespace MonoDevelop.Core.Text
+{
+ /// <summary>
+ /// Represents a version identifier for a text source.
+ /// </summary>
+ /// <remarks>
+ /// Verions can be used to efficiently detect whether a document has changed and needs reparsing;
+ /// or even to implement incremental parsers.
+ /// It is a separate class from ITextSource to allow the GC to collect the text source while
+ /// the version checkpoint is still in use.
+ /// </remarks>
+ public interface ITextSourceVersion
+ {
+ /// <summary>
+ /// Gets whether this checkpoint belongs to the same document as the other checkpoint.
+ /// </summary>
+ /// <remarks>
+ /// Returns false when given <c>null</c>.
+ /// </remarks>
+ bool BelongsToSameDocumentAs (ITextSourceVersion other);
+
+ /// <summary>
+ /// Compares the age of this checkpoint to the other checkpoint.
+ /// </summary>
+ /// <remarks>This method is thread-safe.</remarks>
+ /// <exception cref="System.ArgumentException">Raised if 'other' belongs to a different document than this version.</exception>
+ /// <returns>-1 if this version is older than <paramref name="other"/>.
+ /// 0 if <c>this</c> version instance represents the same version as <paramref name="other"/>.
+ /// 1 if this version is newer than <paramref name="other"/>.</returns>
+ int CompareAge (ITextSourceVersion other);
+
+ /// <summary>
+ /// Gets the changes from this checkpoint to the other checkpoint.
+ /// If 'other' is older than this checkpoint, reverse changes are calculated.
+ /// </summary>
+ /// <remarks>This method is thread-safe.</remarks>
+ /// <exception cref="System.ArgumentException">Raised if 'other' belongs to a different document than this checkpoint.</exception>
+ IEnumerable<TextChangeEventArgs> GetChangesTo (ITextSourceVersion other);
+
+ /// <summary>
+ /// Calculates where the offset has moved in the other buffer version.
+ /// </summary>
+ /// <exception cref="System.ArgumentException">Raised if 'other' belongs to a different document than this checkpoint.</exception>
+ int MoveOffsetTo (ITextSourceVersion other, int oldOffset);
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/StringTextSource.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/StringTextSource.cs
new file mode 100644
index 0000000000..e49e6bb145
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/StringTextSource.cs
@@ -0,0 +1,195 @@
+//
+// StringTextSource.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Text;
+using System.IO;
+
+namespace MonoDevelop.Core.Text
+{
+ /// <summary>
+ /// Implements the ITextSource interface using a string.
+ /// Note that objects from this class are immutable.
+ /// </summary>
+ [Serializable]
+ public class StringTextSource : ITextSource
+ {
+ /// <summary>
+ /// Gets a text source containing the empty string.
+ /// </summary>
+ public static readonly StringTextSource Empty = new StringTextSource (string.Empty);
+
+ readonly string text;
+ readonly ITextSourceVersion version;
+
+ /// <summary>
+ /// Determines if a byte order mark was read or is going to be written.
+ /// </summary>
+ public bool UseBOM { get; private set; }
+
+ /// <summary>
+ /// Encoding of the text that was read from or is going to be saved to.
+ /// </summary>
+ public Encoding Encoding { get; private set; }
+
+ /// <summary>
+ /// Creates a new StringTextSource with the given text.
+ /// </summary>
+ public StringTextSource (string text, Encoding encoding = null, bool useBom = true)
+ {
+ if (text == null)
+ throw new ArgumentNullException ("text");
+ this.text = text;
+ this.UseBOM = useBom;
+ this.Encoding = encoding ?? Encoding.UTF8;
+ }
+
+ /// <summary>
+ /// Creates a new StringTextSource with the given text.
+ /// </summary>
+ public StringTextSource (string text, ITextSourceVersion version, Encoding encoding = null, bool useBom = true)
+ {
+ if (text == null)
+ throw new ArgumentNullException ("text");
+ this.text = text;
+ this.version = version;
+ this.UseBOM = useBom;
+ this.Encoding = encoding ?? Encoding.UTF8;
+ }
+
+ /// <inheritdoc/>
+ public ITextSourceVersion Version {
+ get { return version; }
+ }
+
+ /// <inheritdoc/>
+ public int Length {
+ get { return text.Length; }
+ }
+
+ /// <inheritdoc/>
+ public string Text {
+ get { return text; }
+ }
+
+ /// <inheritdoc/>
+ public ITextSource CreateSnapshot ()
+ {
+ return this; // StringTextSource is immutable
+ }
+
+ /// <inheritdoc/>
+ public ITextSource CreateSnapshot (int offset, int length)
+ {
+ return new StringTextSource (text.Substring (offset, length));
+ }
+
+ /// <inheritdoc/>
+ public char GetCharAt (int offset)
+ {
+ return text [offset];
+ }
+
+ public char this [int offset] {
+ get {
+ return text [offset];
+ }
+ }
+
+ /// <inheritdoc/>
+ public string GetTextAt (int offset, int length)
+ {
+ return text.Substring (offset, length);
+ }
+
+ public StringTextSource WithEncoding (Encoding encoding)
+ {
+ return new StringTextSource (text, encoding, UseBOM);
+ }
+
+ public StringTextSource WithBom (bool useBom)
+ {
+ return new StringTextSource (text, Encoding, useBom);
+ }
+
+ public static StringTextSource ReadFrom (string fileName)
+ {
+ bool hadBom;
+ Encoding encoding;
+ var text = TextFileUtility.ReadAllText (fileName, out hadBom, out encoding);
+ return new StringTextSource (text, encoding, hadBom);
+ }
+
+ public static StringTextSource ReadFrom (Stream stream)
+ {
+ bool hadBom;
+ Encoding encoding;
+ var text = TextFileUtility.GetText (stream, out encoding, out hadBom);
+ return new StringTextSource (text, encoding, hadBom);
+ }
+
+ public static StringTextSource ReadFrom (byte[] data)
+ {
+ bool hadBom;
+ Encoding encoding;
+ var text = TextFileUtility.GetText (data, out encoding, out hadBom);
+ return new StringTextSource (text, encoding, hadBom);
+ }
+
+ /// <inheritdoc/>
+ public TextReader CreateReader ()
+ {
+ return new StringReader (text);
+ }
+
+ /// <inheritdoc/>
+ public TextReader CreateReader (int offset, int length)
+ {
+ return new StringReader (text.Substring (offset, length));
+ }
+
+ /// <inheritdoc/>
+ public void WriteTextTo (TextWriter writer)
+ {
+ if (writer == null)
+ throw new ArgumentNullException ("writer");
+ writer.Write (text);
+ }
+
+ /// <inheritdoc/>
+ public void WriteTextTo (TextWriter writer, int offset, int length)
+ {
+ if (writer == null)
+ throw new ArgumentNullException ("writer");
+ writer.Write (text.Substring (offset, length));
+ }
+
+ /// <inheritdoc/>
+ public void CopyTo (int sourceIndex, char [] destination, int destinationIndex, int count)
+ {
+ text.CopyTo (sourceIndex, destination, destinationIndex, count);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextChangeEventArgs.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextChangeEventArgs.cs
new file mode 100644
index 0000000000..ccd4033844
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextChangeEventArgs.cs
@@ -0,0 +1,135 @@
+//
+// TextChangeEventArgs.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Core.Text
+{
+ /// <summary>
+ /// Describes a change of the document text.
+ /// This class is thread-safe.
+ /// </summary>
+ [Serializable]
+ public class TextChangeEventArgs : EventArgs
+ {
+ readonly int offset;
+ readonly ITextSource removedText;
+ readonly ITextSource insertedText;
+
+ /// <summary>
+ /// The offset at which the change occurs.
+ /// </summary>
+ public int Offset {
+ get { return offset; }
+ }
+
+ /// <summary>
+ /// The text that was removed.
+ /// </summary>
+ public ITextSource RemovedText {
+ get { return removedText; }
+ }
+
+ /// <summary>
+ /// The number of characters removed.
+ /// </summary>
+ public int RemovalLength {
+ get { return removedText.Length; }
+ }
+
+ /// <summary>
+ /// The text that was inserted.
+ /// </summary>
+ public ITextSource InsertedText {
+ get { return insertedText; }
+ }
+
+ /// <summary>
+ /// The number of characters inserted.
+ /// </summary>
+ public int InsertionLength {
+ get { return insertedText.Length; }
+ }
+
+ /// <summary>
+ /// InsertionLength - RemovalLength
+ /// </summary>
+ public int ChangeDelta {
+ get {
+ return InsertionLength - RemovalLength;
+ }
+ }
+
+ /// <summary>
+ /// Creates a new TextChangeEventArgs object.
+ /// </summary>
+ public TextChangeEventArgs(int offset, string removedText, string insertedText)
+ {
+ if (offset < 0)
+ throw new ArgumentOutOfRangeException("offset", offset, "offset must not be negative");
+ this.offset = offset;
+ this.removedText = removedText != null ? new StringTextSource(removedText) : StringTextSource.Empty;
+ this.insertedText = insertedText != null ? new StringTextSource(insertedText) : StringTextSource.Empty;
+ }
+
+ /// <summary>
+ /// Creates a new TextChangeEventArgs object.
+ /// </summary>
+ public TextChangeEventArgs(int offset, ITextSource removedText, ITextSource insertedText)
+ {
+ if (offset < 0)
+ throw new ArgumentOutOfRangeException("offset", offset, "offset must not be negative");
+ this.offset = offset;
+ this.removedText = removedText ?? StringTextSource.Empty;
+ this.insertedText = insertedText ?? StringTextSource.Empty;
+ }
+
+ /// <summary>
+ /// Gets the new offset where the specified offset moves after this document change.
+ /// </summary>
+ public virtual int GetNewOffset(int offset)
+ {
+ if (offset >= this.Offset && offset <= this.Offset + this.RemovalLength) {
+// if (movementType == AnchorMovementType.BeforeInsertion)
+// return this.Offset;
+// else
+ return this.Offset + this.InsertionLength;
+ } else if (offset > this.Offset) {
+ return offset + this.InsertionLength - this.RemovalLength;
+ } else {
+ return offset;
+ }
+ }
+
+ /// <summary>
+ /// Creates TextChangeEventArgs for the reverse change.
+ /// </summary>
+ public virtual TextChangeEventArgs Invert()
+ {
+ return new TextChangeEventArgs(offset, insertedText, removedText);
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextFileUtility.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextFileUtility.cs
new file mode 100644
index 0000000000..56c75a82ca
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextFileUtility.cs
@@ -0,0 +1,959 @@
+//
+// TextFileUtility.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+using System.Threading.Tasks;
+using System.Threading;
+
+namespace MonoDevelop.Core.Text
+{
+ /// <summary>
+ /// This class handles text input from files, streams and byte arrays with auto-detect encoding.
+ /// </summary>
+ public static class TextFileUtility
+ {
+ readonly static int maxBomLength = 0;
+ readonly static Encoding[] encodingsWithBom;
+
+ static TextFileUtility ()
+ {
+ var encodings = new List<Encoding> ();
+
+ foreach (var info in Encoding.GetEncodings ()) {
+ Encoding encoding;
+ try {
+ encoding = info.GetEncoding ();
+ } catch (NotSupportedException) {
+ continue;
+ }
+ var bom = encoding.GetPreamble ();
+ if (bom == null || bom.Length == 0)
+ continue;
+ maxBomLength = System.Math.Max (maxBomLength, bom.Length);
+ encodings.Add (encoding);
+ }
+ encodingsWithBom = encodings.ToArray ();
+
+ // Encoding verifiers
+ var verifierList = new List<Verifier> {
+ new Utf8Verifier (),
+ new GB18030CodePageVerifier (),
+ new WindowsCodePageVerifier (),
+ new UnicodeVerifier (),
+ new BigEndianUnicodeVerifier (),
+ new CodePage858Verifier ()
+ };
+
+ verifiers = verifierList.Where (v => v.IsSupported).ToArray ();
+
+ // cache the verifier machine state tables, to do the virtual StateTable only once.
+ stateTables = new byte[verifiers.Length][][];
+ for (int i = 0; i < verifiers.Length; i++) {
+ verifiers [i].Initialize ();
+ stateTables [i] = verifiers [i].StateTable;
+ }
+ }
+
+ #region stream reader methods
+ public static StreamReader OpenStream (string fileName)
+ {
+ bool hadBom;
+ return OpenStream (File.ReadAllBytes (fileName), out hadBom);
+ }
+
+ public static StreamReader OpenStream (string fileName, out bool hadBom)
+ {
+ return OpenStream (File.ReadAllBytes (fileName), out hadBom);
+ }
+
+ public static StreamReader OpenStream (byte[] bytes)
+ {
+ bool hadBom;
+ return OpenStream (bytes, out hadBom);
+ }
+
+ public static StreamReader OpenStream (byte[] bytes, out bool hadBom)
+ {
+ if (bytes == null)
+ throw new ArgumentNullException ("bytes");
+ return OpenStream (new MemoryStream (bytes, false), out hadBom);
+ }
+
+ public static StreamReader OpenStream (Stream stream)
+ {
+ bool hadBom;
+ return OpenStream (stream, out hadBom);
+ }
+
+ public static StreamReader OpenStream (Stream stream, out bool hadBom)
+ {
+ if (stream == null)
+ throw new ArgumentNullException ("stream");
+ byte[] possibleBom = new byte[maxBomLength];
+ stream.Read (possibleBom, 0, System.Math.Min ((int)stream.Length, maxBomLength));
+
+ foreach (var encoding in encodingsWithBom) {
+ var bom = encoding.GetPreamble ();
+ bool invalid = false;
+ for (int i = 0; i < bom.Length; i++) {
+ if (bom [i] != possibleBom [i]) {
+ invalid = true;
+ break;
+ }
+ }
+
+ if (!invalid) {
+ hadBom = true;
+ stream.Position = bom.Length;
+ return new StreamReader (stream, encoding);
+ }
+ }
+ stream.Position = 0;
+ hadBom = false;
+ return new StreamReader (stream, AutoDetectEncoding (stream));
+ }
+ #endregion
+
+ #region string methods
+ public static string GetText (byte[] bytes)
+ {
+ Encoding encoding;
+ bool hadBom;
+ return GetText (bytes, out encoding, out hadBom);
+ }
+
+ public static string GetText (byte[] bytes, out Encoding encoding, out bool hadBom)
+ {
+ if (bytes == null)
+ throw new ArgumentNullException ("bytes");
+ encoding = null;
+ hadBom = false;
+ int start = 0;
+ foreach (var enc in encodingsWithBom) {
+ var bom = enc.GetPreamble ();
+ bool invalid = false;
+ if (bom.Length > bytes.Length)
+ continue;
+ for (int i = 0; i < bom.Length; i++) {
+ if (bom [i] != bytes [i]) {
+ invalid = true;
+ break;
+ }
+ }
+
+ if (!invalid) {
+ encoding = enc;
+ hadBom = true;
+ start = bom.Length;
+ break;
+ }
+ }
+ if (encoding == null) {
+ int max = System.Math.Min (bytes.Length, maxBufferLength);
+ encoding = AutoDetectEncoding (bytes, max);
+ }
+ return encoding.GetString (bytes, start, bytes.Length - start);
+ }
+
+ public static string GetText (byte[] bytes, Encoding encoding, out bool hadBom)
+ {
+ byte[] bom = encoding.GetPreamble ();
+ if (bom != null && bom.Length > 0 && bom.Length <= bytes.Length) {
+ hadBom = true;
+ for (int i = 0; i < bom.Length; i++) {
+ if (bytes [i] != bom [i]) {
+ hadBom = false;
+ break;
+ }
+ }
+ } else {
+ hadBom = false;
+ }
+ if (hadBom)
+ return encoding.GetString (bytes, bom.Length, bytes.Length - bom.Length);
+ return encoding.GetString (bytes);
+ }
+
+ public static string GetText (Stream inputStream)
+ {
+ using (var stream = OpenStream (inputStream)) {
+ return stream.ReadToEnd ();
+ }
+ }
+
+ public static string GetText (Stream inputStream, out Encoding encoding, out bool hadBom)
+ {
+ if (inputStream == null)
+ throw new ArgumentNullException ("inputStream");
+ using (var stream = OpenStream (inputStream, out hadBom)) {
+ encoding = stream.CurrentEncoding;
+ return stream.ReadToEnd ();
+ }
+ }
+
+ public static async Task<TextContent> GetTextAsync (Stream inputStream)
+ {
+ if (inputStream == null)
+ throw new ArgumentNullException ("inputStream");
+ var tc = new TextContent ();
+ bool hadBom;
+ using (var stream = OpenStream (inputStream, out hadBom)) {
+ tc.Encoding = stream.CurrentEncoding;
+ tc.Text = await stream.ReadToEndAsync ().ConfigureAwait (false);
+ tc.HasBom = hadBom;
+ }
+ return tc;
+ }
+
+ public static string GetText (string fileName)
+ {
+ return GetText (File.ReadAllBytes (fileName));
+ }
+
+ public static async Task<string> GetTextAsync (string fileName, CancellationToken token)
+ {
+ return GetText (await ReadAllBytesAsync (fileName, token).ConfigureAwait (false));
+ }
+
+ public static string GetText (string fileName, out Encoding encoding, out bool hadBom)
+ {
+ if (fileName == null)
+ throw new ArgumentNullException ("fileName");
+ return GetText (File.ReadAllBytes (fileName), out encoding, out hadBom);
+ }
+
+ #endregion
+
+ #region file methods
+ static string WriteTextInit (string fileName, string text, Encoding encoding)
+ {
+ if (fileName == null)
+ throw new ArgumentNullException ("fileName");
+ if (text == null)
+ throw new ArgumentNullException ("text");
+ if (encoding == null)
+ throw new ArgumentNullException ("encoding");
+ // atomic rename only works in the same directory on linux. The tmp files may be on another partition -> breaks save.
+ string tmpPath = Path.Combine (Path.GetDirectoryName (fileName), ".#" + Path.GetFileName (fileName));
+ return tmpPath;
+ }
+
+ static void WriteTextFinal (string tmpPath, string fileName)
+ {
+ try {
+ SystemRename (tmpPath, fileName);
+ } catch (Exception) {
+ try {
+ File.Delete (tmpPath);
+ } catch {
+ // nothing
+ }
+ throw;
+ }
+ }
+
+ public static void WriteText (string fileName, string text, Encoding encoding, bool hadBom)
+ {
+ var tmpPath = WriteTextInit (fileName, text, encoding);
+ using (var stream = new FileStream (tmpPath, FileMode.OpenOrCreate, FileAccess.Write, FileShare.Write)) {
+ if (hadBom) {
+ var bom = encoding.GetPreamble ();
+ if (bom != null && bom.Length > 0)
+ stream.Write (bom, 0, bom.Length);
+ }
+ byte[] bytes = encoding.GetBytes (text);
+ stream.Write (bytes, 0, bytes.Length);
+ }
+ WriteTextFinal (tmpPath, fileName);
+ }
+
+ public static async Task WriteTextAsync (string fileName, string text, Encoding encoding, bool hadBom)
+ {
+ var tmpPath = WriteTextInit (fileName, text, encoding);
+ using (var stream = new FileStream (tmpPath, FileMode.OpenOrCreate, FileAccess.Write, FileShare.Write)) {
+ if (hadBom) {
+ var bom = encoding.GetPreamble ();
+ if (bom != null && bom.Length > 0)
+ await stream.WriteAsync (bom, 0, bom.Length).ConfigureAwait (false);
+ }
+ byte[] bytes = encoding.GetBytes (text);
+ await stream.WriteAsync (bytes, 0, bytes.Length).ConfigureAwait (false);
+ }
+ WriteTextFinal (tmpPath, fileName);
+ }
+
+ /// <summary>
+ /// Returns a byte array containing the text encoded by a specified encoding &amp; bom.
+ /// </summary>
+ /// <param name="text">The text to encode.</param>
+ /// <param name="encoding">The encoding.</param>
+ /// <param name="hadBom">If set to <c>true</c> a bom will be prepended.</param>
+ public static byte[] GetBuffer (string text, Encoding encoding, bool hadBom)
+ {
+ using (var stream = new MemoryStream ()) {
+ if (hadBom) {
+ var bom = encoding.GetPreamble ();
+ if (bom != null && bom.Length > 0)
+ stream.Write (bom, 0, bom.Length);
+ }
+ byte[] bytes = encoding.GetBytes (text);
+ stream.Write (bytes, 0, bytes.Length);
+ return stream.GetBuffer ();
+ }
+ }
+
+ // Code taken from FileService.cs
+ static void SystemRename (string sourceFile, string destFile)
+ {
+ //FIXME: use the atomic System.IO.File.Replace on NTFS
+ if (Platform.IsWindows) {
+ string wtmp = null;
+ if (File.Exists (destFile)) {
+ do {
+ wtmp = Path.Combine (Path.GetTempPath (), Guid.NewGuid ().ToString ());
+ } while (File.Exists (wtmp));
+ File.Move (destFile, wtmp);
+ }
+ try {
+ File.Move (sourceFile, destFile);
+ } catch {
+ try {
+ if (wtmp != null)
+ File.Move (wtmp, destFile);
+ } catch {
+ wtmp = null;
+ }
+ throw;
+ } finally {
+ if (wtmp != null) {
+ try {
+ File.Delete (wtmp);
+ } catch {
+ }
+ }
+ }
+ } else {
+ Mono.Unix.Native.Syscall.rename (sourceFile, destFile);
+ }
+ }
+
+ public static string ReadAllText (string fileName)
+ {
+ bool hadBom;
+ Encoding encoding;
+ return ReadAllText (fileName, out hadBom, out encoding);
+ }
+
+ public static string ReadAllText (string fileName, out bool hadBom, out Encoding encoding)
+ {
+ if (fileName == null)
+ throw new ArgumentNullException ("fileName");
+ byte[] content = File.ReadAllBytes (fileName);
+ return GetText (content, out encoding, out hadBom);
+ }
+
+ public static async Task<TextContent> ReadAllTextAsync (string fileName)
+ {
+ if (fileName == null)
+ throw new ArgumentNullException ("fileName");
+ byte[] content = await ReadAllBytesAsync (fileName).ConfigureAwait (false);
+
+ bool hadBom;
+ Encoding encoding;
+ var txt = GetText (content, out encoding, out hadBom);
+ return new TextContent {
+ Text = txt,
+ HasBom = hadBom,
+ Encoding = encoding
+ };
+ }
+
+ public static string ReadAllText (string fileName, Encoding encoding, out bool hadBom)
+ {
+ if (fileName == null)
+ throw new ArgumentNullException ("fileName");
+ if (encoding == null)
+ throw new ArgumentNullException ("encoding");
+
+ byte[] content = File.ReadAllBytes (fileName);
+ return GetText (content, encoding, out hadBom);
+ }
+
+ public static async Task<TextContent> ReadAllTextAsync (string fileName, Encoding encoding)
+ {
+ if (fileName == null)
+ throw new ArgumentNullException ("fileName");
+ if (encoding == null)
+ throw new ArgumentNullException ("encoding");
+
+ byte[] content = await ReadAllBytesAsync (fileName).ConfigureAwait (false);
+
+ bool hadBom;
+ var txt = GetText (content, encoding, out hadBom);
+ return new TextContent {
+ Text = txt,
+ HasBom = hadBom,
+ Encoding = encoding
+ };
+ }
+
+ public static Task<byte []> ReadAllBytesAsync (string file)
+ {
+ return ReadAllBytesAsync (file, CancellationToken.None);
+ }
+
+ public static async Task<byte[]> ReadAllBytesAsync (string file, CancellationToken token)
+ {
+ using (var f = File.OpenRead (file)) {
+ var res = new byte [f.Length];
+ int nr = 0;
+ int c = 0;
+ while (nr < res.Length && (c = await f.ReadAsync (res, nr, res.Length - nr, token).ConfigureAwait (false)) > 0)
+ nr += c;
+ return res;
+ }
+ }
+
+ #endregion
+
+ #region ASCII encoding check
+ public static bool IsASCII (string text)
+ {
+ if (text == null)
+ throw new ArgumentNullException ("text");
+ for (int i = 0; i < text.Length; i++) {
+ var ch = text [i];
+ if (ch > 0x7F)
+ return false;
+ }
+ return true;
+ }
+ #endregion
+
+ #region Binary check
+ public static bool IsBinary (byte[] bytes)
+ {
+ if (bytes == null)
+ throw new ArgumentNullException ("bytes");
+ var enc = AutoDetectEncoding (bytes, Math.Min (bytes.Length, maxBufferLength));
+ return enc == Encoding.ASCII;
+ }
+
+ public static bool IsBinary (string fileName)
+ {
+ if (fileName == null)
+ throw new ArgumentNullException ("fileName");
+ using (var stream = new FileStream (fileName, FileMode.Open, FileAccess.Read, FileShare.Read)) {
+ return IsBinary (stream);
+ }
+ }
+
+ public static bool IsBinary (Stream stream)
+ {
+ if (stream == null)
+ throw new ArgumentNullException ("stream");
+
+ var enc = AutoDetectEncoding (stream);
+ return enc == Encoding.ASCII;
+ }
+ #endregion
+
+ #region Encoding autodetection
+ static readonly Verifier[] verifiers;
+ static readonly byte[][][] stateTables;
+
+ const int maxBufferLength = 50 * 1024;
+
+ static unsafe Encoding AutoDetectEncoding (Stream stream)
+ {
+ try {
+ int max = (int)System.Math.Min (stream.Length, maxBufferLength);
+ var readBuf = new byte[max];
+ int readLength = stream.Read (readBuf, 0, max);
+ stream.Position = 0;
+ return AutoDetectEncoding (readBuf, readLength);
+ } catch (Exception e) {
+ Console.WriteLine (e);
+ }
+ return Encoding.ASCII;
+ }
+
+ static unsafe Encoding AutoDetectEncoding (byte[] bytes, int readLength)
+ {
+ try {
+ var readBuf = bytes;
+
+ // run the verifiers
+ fixed (byte* bBeginPtr = readBuf) {
+ byte* bEndPtr = bBeginPtr + readLength;
+ for (int i = 0; i < verifiers.Length; i++) {
+ byte curState = verifiers [i].InitalState;
+ byte* bPtr = bBeginPtr;
+ while (bPtr != bEndPtr) {
+ if (curState != 0) {
+ curState = stateTables [i] [curState] [*bPtr];
+ if (curState == 0) {
+ break;
+ }
+ }
+ bPtr++;
+ }
+ if (verifiers [i].IsEncodingValid (curState))
+ return verifiers [i].Encoding;
+ }
+ }
+ } catch (Exception e) {
+ Console.WriteLine (e);
+ }
+ return Encoding.ASCII;
+ }
+
+ abstract class Verifier
+ {
+ internal const byte Error = 0;
+ protected static readonly byte[] errorTable = new byte[(int)byte.MaxValue + 1];
+
+ public abstract byte InitalState { get; }
+
+ public abstract Encoding Encoding { get; }
+
+ public abstract byte[][] StateTable { get; }
+
+ protected abstract void Init ();
+
+ bool isInitialized = false;
+
+ public void Initialize ()
+ {
+ if (isInitialized)
+ throw new InvalidOperationException ("Already initialized");
+ isInitialized = true;
+ Init ();
+ }
+
+ public abstract bool IsSupported { get; }
+
+ public virtual bool IsEncodingValid (byte state)
+ {
+ return state != Error;
+ }
+ }
+
+ class Utf8Verifier : Verifier
+ {
+ const byte UTF1 = 1;
+ const byte UTFTail1 = 2;
+ const byte UTFTail2 = 3;
+ const byte UTFTail3 = 4;
+ const byte UTF8_3_TailPre1 = 5;
+ const byte UTF8_3_TailPre2 = 6;
+ const byte UTF8_4_TailPre1 = 7;
+ const byte UTF8_4_TailPre2 = 8;
+ const byte LAST = 9;
+ static byte[][] table;
+
+ public override bool IsSupported {
+ get {
+ try {
+ return Encoding.UTF8 != null;
+ } catch (Exception) {
+ return false;
+ }
+ }
+ }
+
+ protected override void Init ()
+ {
+ table = new byte[LAST][];
+ table [0] = errorTable;
+ for (int i = 1; i < LAST; i++)
+ table [i] = new byte[(int)byte.MaxValue + 1];
+
+ // UTF8-1 = %x00-7F
+ // Take out the 0 case, that indicates a UTF16/32 file.
+ for (int i = 0x00; i <= 0x7F; i++) {
+ table [UTF1] [i] = UTF1;
+ }
+
+ // UTF8-tail = %x80-BF
+ for (int i = 0x80; i <= 0xBF; i++) {
+ table [UTFTail1] [i] = UTF1;
+ table [UTFTail2] [i] = UTFTail1;
+ table [UTFTail3] [i] = UTFTail2;
+ }
+
+ // UTF8-2 = %xC2-DF UTF8-tail
+ for (int i = 0xC2; i <= 0xDF; i++)
+ table [UTF1] [i] = UTFTail1;
+
+ // UTF8-3 = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2( UTF8-tail ) /
+ // %xED %x80-9F UTF8-tail / %xEE-EF 2( UTF8-tail )
+ for (int i = 0xA0; i <= 0xBF; i++) {
+ table [UTF8_3_TailPre1] [i] = UTFTail1;
+ }
+ for (int i = 0x80; i <= 0x9F; i++) {
+ table [UTF8_3_TailPre2] [i] = UTFTail1;
+ }
+
+ table [UTF1] [0xE0] = UTF8_3_TailPre1;
+ for (int i = 0xE1; i <= 0xEC; i++)
+ table [UTF1] [i] = UTFTail2;
+ table [UTF1] [0xED] = UTF8_3_TailPre2;
+ for (int i = 0xEE; i <= 0xEF; i++)
+ table [UTF1] [i] = UTFTail2;
+
+ // UTF8-4 = %xF0 %x90-BF 2( UTF8-tail ) / %xF1-F3 3( UTF8-tail ) /
+ // %xF4 %x80-8F 2( UTF8-tail )
+
+ for (int i = 0x90; i <= 0xBF; i++) {
+ table [UTF8_4_TailPre1] [i] = UTFTail2;
+ }
+ for (int i = 0x80; i <= 0xBF; i++) {
+ table [UTF8_4_TailPre2] [i] = UTFTail2;
+ }
+ table [UTF1] [0xF0] = UTF8_4_TailPre1;
+ for (int i = 0xF1; i <= 0xF3; i++)
+ table [UTF1] [i] = UTFTail3;
+ table [UTF1] [0xF4] = UTF8_4_TailPre2;
+
+ // always invalid.
+ for (int i = 0; i < table.Length; i++) {
+ table [i] [0xC0] = Error;
+ table [i] [0xC1] = Error;
+ table [i] [0xF5] = Error;
+ table [i] [0xFF] = Error;
+ }
+ }
+
+ public override byte InitalState { get { return UTF1; } }
+
+ public override Encoding Encoding { get { return Encoding.UTF8; } }
+
+ public override byte[][] StateTable { get { return table; } }
+ }
+
+ /// <summary>
+ /// Unicode verifier
+ /// </summary>
+ class UnicodeVerifier : Verifier
+ {
+ const byte Even = 1;
+ const byte Odd = 2;
+ const byte EvenPossible = 3;
+ const byte OddPossible = 4;
+ const byte LAST = 5;
+ static byte[][] table;
+
+ protected override void Init ()
+ {
+ // Simple approach - detect 0 at odd posititons, then it's likely a utf16
+ // if 0 at an even position it's regarded as no utf-16.
+ table = new byte[LAST][];
+ table [0] = errorTable;
+ for (int i = 1; i < LAST; i++)
+ table [i] = new byte[(int)byte.MaxValue + 1];
+
+ for (int i = 0x00; i <= 0xFF; i++) {
+ table [Even] [i] = Odd;
+ table [Odd] [i] = Even;
+ table [EvenPossible] [i] = OddPossible;
+ table [OddPossible] [i] = EvenPossible;
+ }
+ table [Odd] [0] = EvenPossible;
+ table [Even] [0] = Error;
+ table [EvenPossible] [0] = Error;
+ }
+
+ public override byte InitalState { get { return Even; } }
+
+ public override Encoding Encoding { get { return Encoding.Unicode; } }
+
+ public override byte[][] StateTable { get { return table; } }
+
+ public override bool IsSupported {
+ get {
+ try {
+ return Encoding.Unicode != null;
+ } catch (Exception) {
+ return false;
+ }
+ }
+ }
+
+ public override bool IsEncodingValid (byte state)
+ {
+ return state == EvenPossible || state == OddPossible;
+ }
+ }
+
+ class BigEndianUnicodeVerifier : Verifier
+ {
+ const byte Even = 1;
+ const byte Odd = 2;
+ const byte EvenPossible = 3;
+ const byte OddPossible = 4;
+ const byte LAST = 5;
+
+ public override byte InitalState { get { return Even; } }
+
+ public override Encoding Encoding { get { return Encoding.BigEndianUnicode; } }
+
+ public override byte[][] StateTable { get { return table; } }
+
+ public override bool IsSupported {
+ get {
+ try {
+ return Encoding.BigEndianUnicode != null;
+ } catch (Exception) {
+ return false;
+ }
+ }
+ }
+
+ public override bool IsEncodingValid (byte state)
+ {
+ return state == EvenPossible || state == OddPossible;
+ }
+
+ static byte[][] table;
+
+ protected override void Init ()
+ {
+ // Simple approach - detect 0 at even posititons, then it's likely a utf16be
+ // if 0 at an odd position it's regarded as no utf-16be.
+ table = new byte[LAST][];
+ table [0] = errorTable;
+ for (int i = 1; i < LAST; i++)
+ table [i] = new byte[(int)byte.MaxValue + 1];
+
+ for (int i = 0x00; i <= 0xFF; i++) {
+ table [Even] [i] = Odd;
+ table [Odd] [i] = Even;
+ table [EvenPossible] [i] = OddPossible;
+ table [OddPossible] [i] = EvenPossible;
+ }
+ table [Odd] [0] = Error;
+ table [OddPossible] [0] = Error;
+ table [Even] [0] = OddPossible;
+ }
+ }
+
+ /// <summary>
+ /// Code page 1252 was the long time default on windows. This encoding is a superset of ISO 8859-1.
+ /// </summary>
+ class WindowsCodePageVerifier : Verifier
+ {
+ const byte Valid = 1;
+ const byte LAST = 2;
+ static byte[][] table;
+ static Encoding EncodingWindows;
+
+ public override byte InitalState { get { return Valid; } }
+
+ public override Encoding Encoding { get { return EncodingWindows; } }
+
+ public override byte[][] StateTable { get { return table; } }
+
+
+ const int westernEncodingCodePage = 1252;
+ /// <summary>
+ /// Try to guess the windows code page using the default encoding, on non windows system default
+ /// to 1252 (western encoding).
+ /// </summary>
+ int WindowsCodePage {
+ get {
+ if (Platform.IsWindows) {
+ int cp = Encoding.Default.CodePage;
+ if (cp >= 1250 && cp < 1260)
+ return cp;
+ }
+ return westernEncodingCodePage;
+ }
+ }
+
+ public override bool IsSupported {
+ get {
+ try {
+ return Encoding.GetEncoding (WindowsCodePage) != null;
+ } catch (Exception) {
+ return false;
+ }
+ }
+ }
+
+ protected override void Init ()
+ {
+ EncodingWindows = Encoding.GetEncoding (WindowsCodePage);
+ table = new byte[LAST][];
+ table [0] = errorTable;
+ for (int i = 1; i < LAST; i++)
+ table [i] = new byte[(int)byte.MaxValue + 1];
+
+ for (int i = 0x00; i <= 0xFF; i++) {
+ table [Valid] [i] = Valid;
+ }
+ table [Valid] [0x81] = Error;
+ table [Valid] [0x8D] = Error;
+ table [Valid] [0x8F] = Error;
+ table [Valid] [0x90] = Error;
+ table [Valid] [0x9D] = Error;
+ }
+ }
+
+ /// <summary>
+ /// Code page 858 supports old DOS style files extended with the euro sign.
+ /// </summary>
+ class CodePage858Verifier : Verifier
+ {
+ const byte Valid = 1;
+ const byte LAST = 2;
+ static byte[][] table;
+ static Encoding EncodingCp858;
+
+ public override byte InitalState { get { return Valid; } }
+
+ public override Encoding Encoding { get { return EncodingCp858; } }
+
+ public override byte[][] StateTable { get { return table; } }
+
+ public override bool IsSupported {
+ get {
+ try {
+ return Encoding.GetEncoding (858) != null;
+ } catch (Exception) {
+ return false;
+ }
+ }
+ }
+
+ protected override void Init ()
+ {
+ EncodingCp858 = Encoding.GetEncoding (858);
+ table = new byte[LAST][];
+ table [0] = errorTable;
+ for (int i = 1; i < LAST; i++)
+ table [i] = new byte[(int)byte.MaxValue + 1];
+
+ for (int i = 0x20; i <= 0xFF; i++) {
+ table [Valid] [i] = Valid;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Try to detect chinese encoding.
+ /// </summary>
+ class GB18030CodePageVerifier : Verifier
+ {
+ const byte Valid = 1;
+ const byte Second = 2;
+ const byte Third = 3;
+ const byte Fourth = 4;
+ const byte NotValid = 5;
+
+ const byte LAST = 6;
+ static byte[][] table;
+ static Encoding EncodingWindows;
+
+ public override byte InitalState { get { return NotValid; } }
+
+ public override Encoding Encoding { get { return EncodingWindows; } }
+
+ public override byte[][] StateTable { get { return table; } }
+
+ public override bool IsEncodingValid (byte state)
+ {
+ return state == Valid;
+ }
+
+ int WindowsCodePage {
+ get {
+ return 54936;
+ }
+ }
+
+ public override bool IsSupported {
+ get {
+ try {
+ return Encoding.GetEncoding (WindowsCodePage) != null;
+ } catch (Exception) {
+ return false;
+ }
+ }
+ }
+
+ protected override void Init ()
+ {
+ EncodingWindows = Encoding.GetEncoding (WindowsCodePage);
+ table = new byte[LAST][];
+ table [0] = errorTable;
+ for (int i = 1; i < LAST; i++)
+ table [i] = new byte[(int)byte.MaxValue + 1];
+
+ for (int i = 0x00; i <= 0x80; i++)
+ table [Valid] [i] = Valid;
+ for (int i = 0x81; i <= 0xFE; i++)
+ table [Valid] [i] = Second;
+ table [Valid] [0xFF] = Error;
+
+ // need to encounter a multi byte sequence first.
+ for (int i = 0x00; i <= 0x80; i++)
+ table [NotValid] [i] = NotValid;
+ for (int i = 0x81; i <= 0xFE; i++)
+ table [NotValid] [i] = Second;
+ table [NotValid] [0xFF] = Error;
+
+ for (int i = 0x00; i <= 0xFF; i++)
+ table [Second] [i] = Error;
+ for (int i = 0x40; i <= 0xFE; i++)
+ table [Second] [i] = Valid;
+ for (int i = 0x30; i <= 0x39; i++)
+ table [Second] [i] = Third;
+
+ for (int i = 0x00; i <= 0xFF; i++)
+ table [Third] [i] = Error;
+ for (int i = 0x81; i <= 0xFE; i++)
+ table [Third] [i] = Fourth;
+
+ for (int i = 0x00; i <= 0xFF; i++)
+ table [Fourth] [i] = Error;
+ for (int i = 0x30; i <= 0x39; i++)
+ table [Fourth] [i] = Valid;
+ }
+ }
+ #endregion
+ }
+
+ public class TextContent
+ {
+ public string Text { get; internal set; }
+ public bool HasBom { get; internal set; }
+ public Encoding Encoding { get; internal set; }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextSourceVersionProvider.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextSourceVersionProvider.cs
new file mode 100644
index 0000000000..3e2cae228b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextSourceVersionProvider.cs
@@ -0,0 +1,136 @@
+//
+// TextSourceVersionProvider.cs
+//
+// Taken from NRefactory 5.
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace MonoDevelop.Core.Text
+{
+ /// <summary>
+ /// Provides ITextSourceVersion instances.
+ /// </summary>
+ public class TextSourceVersionProvider
+ {
+ Version currentVersion;
+
+ public TextSourceVersionProvider ()
+ {
+ this.currentVersion = new Version (this);
+ }
+
+ /// <summary>
+ /// Gets the current version.
+ /// </summary>
+ public ITextSourceVersion CurrentVersion {
+ get { return currentVersion; }
+ }
+
+ /// <summary>
+ /// Replaces the current version with a new version.
+ /// </summary>
+ /// <param name="change">Change from current version to new version</param>
+ public void AppendChange (TextChangeEventArgs change)
+ {
+ if (change == null)
+ throw new ArgumentNullException ("change");
+ currentVersion.change = change;
+ currentVersion.next = new Version (currentVersion);
+ currentVersion = currentVersion.next;
+ }
+
+ sealed class Version : ITextSourceVersion
+ {
+
+ // Reference back to the provider.
+ // Used to determine if two checkpoints belong to the same document.
+ readonly TextSourceVersionProvider provider;
+ // ID used for CompareAge()
+ readonly int id;
+
+ // the change from this version to the next version
+ internal TextChangeEventArgs change;
+ internal Version next;
+
+ internal Version (TextSourceVersionProvider provider)
+ {
+ this.provider = provider;
+ }
+
+ internal Version (Version prev)
+ {
+ this.provider = prev.provider;
+ this.id = unchecked(prev.id + 1);
+ }
+
+ public bool BelongsToSameDocumentAs (ITextSourceVersion other)
+ {
+ Version o = other as Version;
+ return o != null && provider == o.provider;
+ }
+
+ public int CompareAge (ITextSourceVersion other)
+ {
+ if (other == null)
+ throw new ArgumentNullException ("other");
+ var o = other as Version;
+ if (o == null || provider != o.provider)
+ throw new ArgumentException ("Versions do not belong to the same document.");
+ // We will allow overflows, but assume that the maximum distance between checkpoints is 2^31-1.
+ // This is guaranteed on x86 because so many checkpoints don't fit into memory.
+ return Math.Sign (unchecked(this.id - o.id));
+ }
+
+ public IEnumerable<TextChangeEventArgs> GetChangesTo (ITextSourceVersion other)
+ {
+ int result = CompareAge (other);
+ Version o = (Version)other;
+ if (result < 0)
+ return GetForwardChanges (o);
+ else if (result > 0)
+ return o.GetForwardChanges (this).Reverse ().Select (change => change.Invert ());
+ return Enumerable.Empty<TextChangeEventArgs> ();
+ }
+
+ IEnumerable<TextChangeEventArgs> GetForwardChanges (Version other)
+ {
+ for (Version node = this; node != other; node = node.next) {
+ yield return node.change;
+ }
+ }
+
+ public int MoveOffsetTo (ITextSourceVersion other, int oldOffset)
+ {
+ int offset = oldOffset;
+ foreach (var e in GetChangesTo(other)) {
+ offset = e.GetNewOffset (offset);
+ }
+ return offset;
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/UnicodeNewLine.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/UnicodeNewLine.cs
new file mode 100644
index 0000000000..0f371c2f32
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/UnicodeNewLine.cs
@@ -0,0 +1,366 @@
+//
+// UnicodeNewLine.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Core.Text
+{
+ public enum UnicodeNewline
+ {
+ Unknown,
+
+ /// <summary>
+ /// Line Feed, U+000A
+ /// </summary>
+ LF = 0x0A,
+
+
+ CRLF = 0x0D0A,
+
+ /// <summary>
+ /// Carriage Return, U+000D
+ /// </summary>
+ CR = 0x0D,
+
+ /// <summary>
+ /// Next Line, U+0085
+ /// </summary>
+ NEL = 0x85,
+
+ /// <summary>
+ /// Vertical Tab, U+000B
+ /// </summary>
+ VT = 0x0B,
+
+ /// <summary>
+ /// Form Feed, U+000C
+ /// </summary>
+ FF = 0x0C,
+
+ /// <summary>
+ /// Line Separator, U+2028
+ /// </summary>
+ LS = 0x2028,
+
+ /// <summary>
+ /// Paragraph Separator, U+2029
+ /// </summary>
+ PS = 0x2029
+ }
+
+
+ /// <summary>
+ /// Defines unicode new lines according to Unicode Technical Report #13
+ /// http://www.unicode.org/standard/reports/tr13/tr13-5.html
+ /// </summary>
+ public static class NewLine
+ {
+ /// <summary>
+ /// Carriage Return, U+000D
+ /// </summary>
+ public const char CR = (char)0x0D;
+
+ /// <summary>
+ /// Line Feed, U+000A
+ /// </summary>
+ public const char LF = (char)0x0A;
+
+ /// <summary>
+ /// Next Line, U+0085
+ /// </summary>
+ public const char NEL = (char)0x85;
+
+ /// <summary>
+ /// Vertical Tab, U+000B
+ /// </summary>
+ public const char VT = (char)0x0B;
+
+ /// <summary>
+ /// Form Feed, U+000C
+ /// </summary>
+ public const char FF = (char)0x0C;
+
+ /// <summary>
+ /// Line Separator, U+2028
+ /// </summary>
+ public const char LS = (char)0x2028;
+
+ /// <summary>
+ /// Paragraph Separator, U+2029
+ /// </summary>
+ public const char PS = (char)0x2029;
+
+ /// <summary>
+ /// Determines if a char is a new line delimiter.
+ /// </summary>
+ /// <returns>0 == no new line, otherwise it returns either 1 or 2 depending of the length of the delimiter.</returns>
+ /// <param name="curChar">The current character.</param>
+ /// <param name="nextChar">A callback getting the next character (may be null).</param>
+ public static int GetDelimiterLength (char curChar, Func<char> nextChar = null)
+ {
+ if (curChar == CR) {
+ if (nextChar != null && nextChar () == LF)
+ return 2;
+ return 1;
+ }
+
+ if (curChar == LF || curChar == NEL || curChar == VT || curChar == FF || curChar == LS || curChar == PS)
+ return 1;
+ return 0;
+ }
+
+ /// <summary>
+ /// Determines if a char is a new line delimiter.
+ /// </summary>
+ /// <returns>0 == no new line, otherwise it returns either 1 or 2 depending of the length of the delimiter.</returns>
+ /// <param name="curChar">The current character.</param>
+ /// <param name="nextChar">The next character (if != LF then length will always be 0 or 1).</param>
+ public static int GetDelimiterLength (char curChar, char nextChar)
+ {
+ if (curChar == CR) {
+ if (nextChar == LF)
+ return 2;
+ return 1;
+ }
+
+ if (curChar == LF || curChar == NEL || curChar == VT || curChar == FF || curChar == LS || curChar == PS)
+ return 1;
+ return 0;
+ }
+
+
+ /// <summary>
+ /// Determines if a char is a new line delimiter.
+ /// </summary>
+ /// <returns>0 == no new line, otherwise it returns either 1 or 2 depending of the length of the delimiter.</returns>
+ /// <param name="curChar">The current character.</param>
+ /// <param name = "length">The length of the delimiter</param>
+ /// <param name = "type">The type of the delimiter</param>
+ /// <param name="nextChar">A callback getting the next character (may be null).</param>
+ public static bool TryGetDelimiterLengthAndType (char curChar, out int length, out UnicodeNewline type, Func<char> nextChar = null)
+ {
+ if (curChar == CR) {
+ if (nextChar != null && nextChar () == LF) {
+ length = 2;
+ type = UnicodeNewline.CRLF;
+ } else {
+ length = 1;
+ type = UnicodeNewline.CR;
+
+ }
+ return true;
+ }
+
+ switch (curChar) {
+ case LF:
+ type = UnicodeNewline.LF;
+ length = 1;
+ return true;
+ case NEL:
+ type = UnicodeNewline.NEL;
+ length = 1;
+ return true;
+ case VT:
+ type = UnicodeNewline.VT;
+ length = 1;
+ return true;
+ case FF:
+ type = UnicodeNewline.FF;
+ length = 1;
+ return true;
+ case LS:
+ type = UnicodeNewline.LS;
+ length = 1;
+ return true;
+ case PS:
+ type = UnicodeNewline.PS;
+ length = 1;
+ return true;
+ }
+ length = -1;
+ type = UnicodeNewline.Unknown;
+ return false;
+ }
+
+ /// <summary>
+ /// Determines if a char is a new line delimiter.
+ /// </summary>
+ /// <returns>0 == no new line, otherwise it returns either 1 or 2 depending of the length of the delimiter.</returns>
+ /// <param name="curChar">The current character.</param>
+ /// <param name = "length">The length of the delimiter</param>
+ /// <param name = "type">The type of the delimiter</param>
+ /// <param name="nextChar">The next character (if != LF then length will always be 0 or 1).</param>
+ public static bool TryGetDelimiterLengthAndType (char curChar, out int length, out UnicodeNewline type, char nextChar)
+ {
+ if (curChar == CR) {
+ if (nextChar == LF) {
+ length = 2;
+ type = UnicodeNewline.CRLF;
+ } else {
+ length = 1;
+ type = UnicodeNewline.CR;
+
+ }
+ return true;
+ }
+
+ switch (curChar) {
+ case LF:
+ type = UnicodeNewline.LF;
+ length = 1;
+ return true;
+ case NEL:
+ type = UnicodeNewline.NEL;
+ length = 1;
+ return true;
+ case VT:
+ type = UnicodeNewline.VT;
+ length = 1;
+ return true;
+ case FF:
+ type = UnicodeNewline.FF;
+ length = 1;
+ return true;
+ case LS:
+ type = UnicodeNewline.LS;
+ length = 1;
+ return true;
+ case PS:
+ type = UnicodeNewline.PS;
+ length = 1;
+ return true;
+ }
+ length = -1;
+ type = UnicodeNewline.Unknown;
+ return false;
+ }
+
+ /// <summary>
+ /// Gets the new line type of a given char/next char.
+ /// </summary>
+ /// <returns>0 == no new line, otherwise it returns either 1 or 2 depending of the length of the delimiter.</returns>
+ /// <param name="curChar">The current character.</param>
+ /// <param name="nextChar">A callback getting the next character (may be null).</param>
+ public static UnicodeNewline GetDelimiterType (char curChar, Func<char> nextChar = null)
+ {
+ switch (curChar) {
+ case CR:
+ if (nextChar != null && nextChar () == LF)
+ return UnicodeNewline.CRLF;
+ return UnicodeNewline.CR;
+ case LF:
+ return UnicodeNewline.LF;
+ case NEL:
+ return UnicodeNewline.NEL;
+ case VT:
+ return UnicodeNewline.VT;
+ case FF:
+ return UnicodeNewline.FF;
+ case LS:
+ return UnicodeNewline.LS;
+ case PS:
+ return UnicodeNewline.PS;
+ }
+ return UnicodeNewline.Unknown;
+ }
+
+ /// <summary>
+ /// Gets the new line type of a given char/next char.
+ /// </summary>
+ /// <returns>0 == no new line, otherwise it returns either 1 or 2 depending of the length of the delimiter.</returns>
+ /// <param name="curChar">The current character.</param>
+ /// <param name="nextChar">The next character (if != LF then length will always be 0 or 1).</param>
+ public static UnicodeNewline GetDelimiterType (char curChar, char nextChar)
+ {
+ switch (curChar) {
+ case CR:
+ if (nextChar == LF)
+ return UnicodeNewline.CRLF;
+ return UnicodeNewline.CR;
+ case LF:
+ return UnicodeNewline.LF;
+ case NEL:
+ return UnicodeNewline.NEL;
+ case VT:
+ return UnicodeNewline.VT;
+ case FF:
+ return UnicodeNewline.FF;
+ case LS:
+ return UnicodeNewline.LS;
+ case PS:
+ return UnicodeNewline.PS;
+ }
+ return UnicodeNewline.Unknown;
+ }
+
+ /// <summary>
+ /// Determines if a char is a new line delimiter.
+ ///
+ /// Note that the only 2 char wide new line is CR LF and both chars are new line
+ /// chars on their own. For most cases GetDelimiterLength is the better choice.
+ /// </summary>
+ public static bool IsNewLine (char ch)
+ {
+ return
+ ch == NewLine.CR ||
+ ch == NewLine.LF ||
+ ch == NewLine.NEL ||
+ ch == NewLine.VT ||
+ ch == NewLine.FF ||
+ ch == NewLine.LS ||
+ ch == NewLine.PS;
+ }
+
+ /// <summary>
+ /// Gets the new line as a string.
+ /// </summary>
+ public static string GetString (UnicodeNewline newLine)
+ {
+ switch (newLine) {
+ case UnicodeNewline.Unknown:
+ return "";
+ case UnicodeNewline.LF:
+ return "\n";
+ case UnicodeNewline.CRLF:
+ return "\r\n";
+ case UnicodeNewline.CR:
+ return "\r";
+ case UnicodeNewline.NEL:
+ return "\u0085";
+ case UnicodeNewline.VT:
+ return "\u000B";
+ case UnicodeNewline.FF:
+ return "\u000C";
+ case UnicodeNewline.LS:
+ return "\u2028";
+ case UnicodeNewline.PS:
+ return "\u2029";
+ default:
+ throw new ArgumentOutOfRangeException ();
+ }
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Web/RequestHelper.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Web/RequestHelper.cs
index c3afcac25b..fb29860769 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Web/RequestHelper.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Web/RequestHelper.cs
@@ -19,6 +19,7 @@ using System;
using System.Net;
using System.Collections.Specialized;
using System.Threading;
+using System.Threading.Tasks;
namespace MonoDevelop.Core.Web
{
@@ -63,6 +64,104 @@ namespace MonoDevelop.Core.Web
token.Register (request.Abort);
}
+ public async Task<HttpWebResponse> GetResponseAsync (CancellationToken token)
+ {
+ _previousRequest = null;
+ _previousResponse = null;
+ _previousStatusCode = null;
+ _usingSTSAuth = false;
+ _continueIfFailed = true;
+ _proxyCredentialsRetryCount = 0;
+ _credentialsRetryCount = 0;
+ int failureCount = 0;
+ const int MaxFailureCount = 10;
+
+ while (true)
+ {
+ // Create the request
+ var request = (HttpWebRequest)_createRequest();
+ MakeCancelable (request, token);
+ ConfigureRequest(request);
+
+ try
+ {
+ var auth = request.Headers["Authorization"];
+ _basicAuthIsUsedInPreviousRequest = (auth != null)
+ && auth.StartsWith("Basic ", StringComparison.Ordinal);
+
+ // Prepare the request, we do something like write to the request stream
+ // which needs to happen last before the request goes out
+ _prepareRequest(request);
+
+ HttpWebResponse response = (HttpWebResponse) await request.GetResponseAsync ();
+
+ // Cache the proxy and credentials
+ _proxyCache.Add(request.Proxy);
+
+ ICredentials credentials = request.Credentials;
+ _credentialCache.Add(request.RequestUri, credentials);
+ _credentialCache.Add(response.ResponseUri, credentials);
+
+ return response;
+ }
+ catch (WebException ex)
+ {
+ ++failureCount;
+ if (failureCount >= MaxFailureCount)
+ {
+ throw;
+ }
+
+ using (IHttpWebResponse response = GetResponse(ex.Response))
+ {
+ if (response == null &&
+ ex.Status != WebExceptionStatus.SecureChannelFailure)
+ {
+ // No response, something went wrong so just rethrow
+ throw;
+ }
+
+ // Special case https connections that might require authentication
+ if (ex.Status == WebExceptionStatus.SecureChannelFailure)
+ {
+ if (_continueIfFailed)
+ {
+ // Act like we got a 401 so that we prompt for credentials on the next request
+ _previousStatusCode = HttpStatusCode.Unauthorized;
+ continue;
+ }
+ throw;
+ }
+
+ // If we were trying to authenticate the proxy or the request and succeeded, cache the result.
+ if (_previousStatusCode == HttpStatusCode.ProxyAuthenticationRequired &&
+ response.StatusCode != HttpStatusCode.ProxyAuthenticationRequired)
+ {
+ _proxyCache.Add(request.Proxy);
+ }
+ else if (_previousStatusCode == HttpStatusCode.Unauthorized &&
+ response.StatusCode != HttpStatusCode.Unauthorized)
+ {
+ _credentialCache.Add(request.RequestUri, request.Credentials);
+ _credentialCache.Add(response.ResponseUri, request.Credentials);
+ }
+
+ _usingSTSAuth = STSAuthHelper.TryRetrieveSTSToken(request.RequestUri, response);
+
+ if (!IsAuthenticationResponse(response) || !_continueIfFailed)
+ {
+ throw;
+ }
+
+ _previousRequest = request;
+ _previousResponse = response;
+ _previousStatusCode = _previousResponse.StatusCode;
+ }
+ }
+ }
+
+ }
+
public HttpWebResponse GetResponse(CancellationToken token)
{
_previousRequest = null;
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.addin.xml b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.addin.xml
index 9c95f1d362..36a30abe46 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.addin.xml
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.addin.xml
@@ -4,6 +4,7 @@
<ConditionType id="PackageNotInstalled" type="MonoDevelop.Core.AddIns.PackageNotInstalledCondition" />
<ConditionType id="Platform" type="MonoDevelop.Core.AddIns.PlatformCondition" />
<ConditionType id="AssemblyInstalled" type="MonoDevelop.Core.AddIns.AssemblyInstalledCondition" />
+ <ConditionType id="MSBuildTargetIsAvailable" type="MonoDevelop.Projects.MSBuild.TargetsAvailableCondition" />
<!-- Extension points -->
@@ -77,20 +78,6 @@
<ExtensionNode name="Migration" type="MonoDevelop.Core.AddIns.UserDataMigrationNode" />
</ExtensionPoint>
- <ExtensionPoint path = "/MonoDevelop/ProjectModel/ProjectBindings" name = "Project bindings">
- <Description>Project bindings</Description>
- <ExtensionNode name="ProjectBinding" type="MonoDevelop.Projects.Extensions.ProjectBindingCodon">
- <Description>A project binding. The specified class must implement MonoDevelop.Projects.IProjectBinding.</Description>
- </ExtensionNode>
- </ExtensionPoint>
-
- <ExtensionPoint path = "/MonoDevelop/ProjectModel/FileFormats" name = "Solution file format handlers">
- <Description>File format handlers for workspaces, solutions and projects</Description>
- <ExtensionNode name="FileFormat" type="MonoDevelop.Projects.Extensions.FileFormatNode">
- <Description>A file format handler. The specified class must implement MonoDevelop.Projects.IFileFormat.</Description>
- </ExtensionNode>
- </ExtensionPoint>
-
<ExtensionPoint path = "/MonoDevelop/ProjectModel/SerializableClasses" name = "Serializable classes">
<Description>Classes to be registered for serialization.</Description>
<ExtensionNode name="DataType" type="MonoDevelop.Projects.Extensions.DataTypeCodon" customAttributeType="MonoDevelop.Projects.ProjectModelDataItemAttribute">
@@ -98,36 +85,36 @@
</ExtensionNode>
</ExtensionPoint>
- <ExtensionPoint path = "/MonoDevelop/ProjectModel/ExtendedProperties" name = "Serializable classes">
- <Description>Custom properties for projects and other types.</Description>
- <ExtensionNode name="ItemProperty" type="MonoDevelop.Projects.Extensions.ItemPropertyCodon">
- <Description>A custom property. The type specified in the 'class' property is the type to which the property has to be added. Only types which implement IExtendedDataItem can be extended in this way.</Description>
+ <ExtensionPoint path = "/MonoDevelop/ProjectModel/WorkspaceObjectReaders" name = "Project service extensions">
+ <Description>WorkspaceObject readers. Specified classes must be a subclass of WorkspaceObjectReader</Description>
+ <ExtensionNode name="Class">
+ <Description>A subclass of WorkspaceObjectReader.</Description>
</ExtensionNode>
</ExtensionPoint>
- <ExtensionPoint path = "/MonoDevelop/ProjectModel/ProjectServiceExtensions" name = "Project service extensions">
- <Description>Project service extensions. Specified classes must be a subclass of ProjectServiceExtension</Description>
+ <ExtensionPoint path = "/MonoDevelop/ProjectModel/ProjectModelExtensions" name = "Project model extensions">
+ <Description>Extensions for project model objects</Description>
+ <ExtensionNode name="Class" type="MonoDevelop.Projects.Extensions.ProjectModelExtensionNode">
+ <Description>A subclass of WorkspaceObjectExtension.</Description>
+ </ExtensionNode>
+ <ExtensionNode name="ProjectFlavor" type="MonoDevelop.Projects.Extensions.SolutionItemExtensionNode">
+ <Description>A subclass of ProjectExtension.</Description>
+ </ExtensionNode>
<ConditionType id="ItemType" type="MonoDevelop.Core.Gui.Dialogs.OptionPanels.ItemTypeCondition">
<Description>Type of the item. If no namespace is provided, MonoDevelop.Projects is assumed.</Description>
</ConditionType>
- <ConditionType id="ActiveLanguage" type="MonoDevelop.Projects.Extensions.ItemTypeCondition">
- <Description>Language of the project. It will evaluate to false if the project is not a .NET project.</Description>
- </ConditionType>
- <ExtensionNode name="Class">
- <Description>A subclass of ProjectServiceExtension.</Description>
- </ExtensionNode>
</ExtensionPoint>
<ExtensionPoint path = "/MonoDevelop/ProjectModel/LanguageBindings" name = "Language bindings">
<Description>Language bindings.</Description>
- <ExtensionNode name="LanguageBinding" type="MonoDevelop.Projects.Extensions.LanguageBindingCodon"/>
+ <ExtensionNode name="LanguageBinding" type="MonoDevelop.Projects.Extensions.LanguageBindingExtensionNode"/>
</ExtensionPoint>
<ExtensionPoint path = "/MonoDevelop/ProjectModel/MSBuildItemTypes" name = "MSBuild item types">
<Description>Item types supported by MSBuild</Description>
- <ExtensionNode name="SolutionItem" type="MonoDevelop.Projects.Extensions.SolutionItemNode"/>
- <ExtensionNode name="DotNetProject" type="MonoDevelop.Projects.Extensions.DotNetProjectNode"/>
- <ExtensionNode name="DotNetProjectSubtype" type="MonoDevelop.Projects.Extensions.DotNetProjectSubtypeNode"/>
+ <ExtensionNode name="SolutionItemType" type="MonoDevelop.Projects.Extensions.SolutionItemTypeNode"/>
+ <ExtensionNode name="ProjectType" type="MonoDevelop.Projects.Extensions.ProjectTypeNode"/>
+ <ExtensionNode name="DotNetProjectType" type="MonoDevelop.Projects.Extensions.DotNetProjectTypeNode"/>
</ExtensionPoint>
<ExtensionPoint path = "/MonoDevelop/ProjectModel/PolicyTypes" name = "Policy types">
@@ -141,16 +128,8 @@
</ExtensionNode>
</ExtensionPoint>
- <ExtensionPoint path = "/MonoDevelop/ProjectModel/MSBuildImportProviders" name = "MSBuild Import Providers">
- <ExtensionNode objectType="MonoDevelop.Projects.Formats.MSBuild.IMSBuildImportProvider"/>
- </ExtensionPoint>
-
<ExtensionPoint path = "/MonoDevelop/ProjectModel/MSBuildGlobalPropertyProviders" name = "MSBuild Global Property Providers">
- <ExtensionNode objectType="MonoDevelop.Projects.Formats.MSBuild.IMSBuildGlobalPropertyProvider"/>
- </ExtensionPoint>
-
- <ExtensionPoint path = "/MonoDevelop/ProjectModel/MSBuildExtensions" name = "MSBuild Extensions">
- <ExtensionNode name="Class" objectType="MonoDevelop.Projects.Formats.MSBuild.MSBuildExtension"/>
+ <ExtensionNode objectType="MonoDevelop.Projects.MSBuild.IMSBuildGlobalPropertyProvider"/>
</ExtensionPoint>
<ExtensionPoint path = "/MonoDevelop/ProjectModel/MonoDocSources" name = "MonoDoc Sources">
@@ -165,7 +144,17 @@
<Description>Project types not supported by MonoDevelop</Description>
<ExtensionNode name="ProjectType" type="MonoDevelop.Projects.Extensions.UnknownProjectTypeNode"/>
</ExtensionPoint>
-
+
+ <ExtensionPoint path = "/MonoDevelop/ProjectModel/MSBuildImportRedirects" name = "MSBuild import redirects">
+ <Description>Allows replacing an import by another one when a project is evaluated</Description>
+ <ExtensionNode name="Import" type="MonoDevelop.Projects.Extensions.ImportRedirectTypeNode"/>
+ </ExtensionPoint>
+
+ <ExtensionPoint path = "/MonoDevelop/ProjectModel/MSBuildProjectItemTypes" name = "MSBuild project item subclasses">
+ <Description>Allows defining ProjectItem subclasses to be used for specific msbuild project items</Description>
+ <ExtensionNode name="Item" customAttributeType="MonoDevelop.Projects.ExportProjectItemTypeAttribute" />
+ </ExtensionPoint>
+
<!-- Extensions -->
@@ -219,43 +208,13 @@
<Application id = "project-export" class = "MonoDevelop.Projects.ProjectConvertTool" description = "Project conversion tool"/>
</Extension>
- <Extension path = "/MonoDevelop/ProjectModel/ProjectBindings">
- <ProjectBinding id = "DotNet" class = "MonoDevelop.Projects.DotNetProjectBinding" />
- <ProjectBinding id = "GenericProject" class = "MonoDevelop.Projects.GenericProjectBinding" />
- <ProjectBinding id = "PortableDotNet" class = "MonoDevelop.Projects.PortableDotNetProjectBinding" />
- <ProjectBinding id = "SharedAssetsProject" class = "MonoDevelop.Projects.SharedAssetsProjects.SharedAssetsProjectBinding" />
- </Extension>
-
- <Extension path = "/MonoDevelop/ProjectModel/FileFormats">
- <FileFormat id = "MSBuild08"
- class = "MonoDevelop.Projects.Formats.MSBuild.MSBuildFileFormatVS08"
- name = "MSBuild (Visual Studio 2008)"
- canDefault = "true" />
- <FileFormat id = "MSBuild05"
- class = "MonoDevelop.Projects.Formats.MSBuild.MSBuildFileFormatVS05"
- name = "MSBuild (Visual Studio 2005)"
- canDefault = "true" />
- <FileFormat id = "MSBuild10"
- class = "MonoDevelop.Projects.Formats.MSBuild.MSBuildFileFormatVS10"
- name = "MSBuild (Visual Studio 2010)"
- canDefault = "true" />
- <FileFormat id = "MSBuild12"
- class = "MonoDevelop.Projects.Formats.MSBuild.MSBuildFileFormatVS12"
- name = "MSBuild (Visual Studio 2012)"
- canDefault = "true" />
- <FileFormat id = "MD1"
- class = "MonoDevelop.Projects.Formats.MD1.MD1FileFormat"
- name = "MonoDevelop 1.0 (deprecated)" />
- </Extension>
-
- <Extension path = "/MonoDevelop/ProjectModel/ExtendedProperties">
- </Extension>
-
- <Extension path = "/MonoDevelop/ProjectModel/ProjectServiceExtensions">
- <Class id="InitialStep" class = "MonoDevelop.Projects.ProjectServiceExtension" />
- <Class class = "MonoDevelop.Projects.CompiledAssemblyExtension" />
- <Class id="MidStep" class = "MonoDevelop.Projects.ProjectServiceExtension" />
- <Class id="FinalStep" class = "MonoDevelop.Projects.ProjectServiceExtension" />
+ <Extension path = "/MonoDevelop/ProjectModel/WorkspaceObjectReaders">
+ <Class id="InitialStep" class = "MonoDevelop.Projects.DummyWorkspaceObjectReader" />
+ <Class id="CompiledAssembly" class = "MonoDevelop.Projects.CompiledAssemblyExtension" />
+ <Class id="Workspace" class = "MonoDevelop.Projects.WorkspaceSerializationExtension" />
+ <Class id="MSBuild" class = "MonoDevelop.Projects.MSBuildSerializationExtension" />
+ <Class id="MidStep" class = "MonoDevelop.Projects.DummyWorkspaceObjectReader" />
+ <Class id="FinalStep" class = "MonoDevelop.Projects.DummyWorkspaceObjectReader" />
</Extension>
<Extension path = "/MonoDevelop/Core/FileSystemExtensions">
@@ -274,18 +233,10 @@
<PolicySet id="Invariant" _name="Invariant" visible="false"/>
</Extension>
- <Extension path = "/MonoDevelop/ProjectModel/MSBuildItemTypes">
- <SolutionItem guid = "{8BC9CEB9-8B4A-11D0-8D11-00A0C91BC942}"
- type = "MonoDevelop.Projects.CompiledAssemblyProject"
- handlerType = "MonoDevelop.Projects.Formats.MSBuild.CompiledAssemblyProjectMSBuildHandler" />
- <SolutionItem guid = "{D954291E-2A0B-460D-934E-DC6B0785DB48}"
- type = "MonoDevelop.Projects.SharedAssetsProjects.SharedAssetsProject"
- extension = "shproj"
- handlerType = "MonoDevelop.Projects.SharedAssetsProjects.SharedAssetsProjectMSBuildHandler" />
- </Extension>
-
- <Extension path = "/MonoDevelop/ProjectModel/MSBuildExtensions">
- <Class class="MonoDevelop.Projects.SharedAssetsProjects.SharedAssetsProjectMSBuildExtension"/>
+ <Extension path = "/MonoDevelop/ProjectModel/ProjectModelExtensions">
+ <Class id="InitialStep" class = "MonoDevelop.Projects.WorkspaceObjectExtension" />
+ <Class id="MidStep" class = "MonoDevelop.Projects.WorkspaceObjectExtension" />
+ <Class id="FinalStep" class = "MonoDevelop.Projects.WorkspaceObjectExtension" />
</Extension>
@@ -361,5 +312,14 @@
<ProjectType guid = "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}" name = "Visual C++" extension="vcxproj"/>
<ProjectType guid = "{E6FDF86B-F3D1-11D4-8576-0002A516ECE8}" name = "Visual J#" extension="vjsproj"/>
<ProjectType guid = "{82B43B9B-A64C-4715-B499-D71E9CA2BD60}" name = "Visual Studio Extension" />
+ <ProjectType guid = "{14182A97-F7F0-4C62-8B27-98AA8AE2109A}" name = "VB.NET Portable Library" />
+ <ProjectType guid = "{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A}" name = "Universal Windows Platform (UWP)" />
</Extension>
+
+ <Extension path = "/MonoDevelop/ProjectModel/MSBuildImportRedirects">
+ <Import project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" target="MSBuild/CodeSharing.Common.Default.props" />
+ <Import project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" target="MSBuild/CodeSharing.Common.props" />
+ <Import project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" target="MSBuild/CodeSharing.CSharp.targets" />
+ </Extension>
+
</ExtensionModel>
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj
index 8d43742ac4..7268502b89 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj
@@ -70,6 +70,21 @@
<NoWarn>1591;1573</NoWarn>
<DocumentationFile>..\..\..\build\bin\MonoDevelop.Core.xml</DocumentationFile>
</PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugWin32|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\..\..\build\bin\</OutputPath>
+ <DefineConstants>DEBUG;WINDOWS</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <DocumentationFile>..\..\..\build\bin\MonoDevelop.Core.xml</DocumentationFile>
+ <Execution>
+ <Execution clr-version="Net_2_0" />
+ </Execution>
+ <NoWarn>1591;1573</NoWarn>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Mono.Posix" />
@@ -79,15 +94,29 @@
<Reference Include="System.Core" />
<Reference Include="ICSharpCode.SharpZipLib" />
<Reference Include="monodoc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756">
- <SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Web" />
<Reference Include="System.ServiceModel" />
<Reference Include="Microsoft.CSharp" />
+ <Reference Include="Microsoft.Build.Engine" />
+ <Reference Include="Microsoft.Build" />
+ <Reference Include="Microsoft.Build.Utilities.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Newtonsoft.Json">
<HintPath>..\..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
+ <Reference Include="System.Reflection.Metadata">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Reflection.Metadata.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="System.Collections.Immutable">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Collections.Immutable.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="MonoDevelop.Core\StringParserService.cs" />
@@ -104,21 +133,14 @@
<Compile Include="MonoDevelop.Core.Execution\RemoteProcessObject.cs" />
<Compile Include="MonoDevelop.Core.ProgressMonitoring\AggregatedProgressMonitor.cs" />
<Compile Include="MonoDevelop.Core.ProgressMonitoring\ConsoleProgressMonitor.cs" />
- <Compile Include="MonoDevelop.Core\IAsyncOperation.cs" />
<Compile Include="MonoDevelop.Core\IProgressMonitor.cs" />
<Compile Include="MonoDevelop.Core.ProgressMonitoring\LogTextWriter.cs" />
- <Compile Include="MonoDevelop.Core.ProgressMonitoring\NullAsyncOperation.cs" />
<Compile Include="MonoDevelop.Core.ProgressMonitoring\ProgressTracker.cs" />
<Compile Include="MonoDevelop.Core.Execution\DefaultExecutionHandler.cs" />
<Compile Include="MonoDevelop.Core.Execution\ExternalConsoleFactory.cs" />
- <Compile Include="MonoDevelop.Core.Execution\IConsole.cs" />
- <Compile Include="MonoDevelop.Core.Execution\IConsoleFactory.cs" />
<Compile Include="MonoDevelop.Core.Execution\IExecutionHandler.cs" />
- <Compile Include="MonoDevelop.Core.Execution\IProcessAsyncOperation.cs" />
<Compile Include="MonoDevelop.Core.Execution\MonoPlatformExecutionHandler.cs" />
<Compile Include="MonoDevelop.Core.Execution\NativePlatformExecutionHandler.cs" />
- <Compile Include="MonoDevelop.Core.ProgressMonitoring\AggregatedOperationMonitor.cs" />
- <Compile Include="MonoDevelop.Core.ProgressMonitoring\SynchronizedProgressMonitor.cs" />
<Compile Include="MonoDevelop.Core\ClrVersion.cs" />
<Compile Include="MonoDevelop.Core\FileService.cs" />
<Compile Include="MonoDevelop.Core\FileEventArgs.cs" />
@@ -164,7 +186,6 @@
<Compile Include="MonoDevelop.Core.Serialization\ICollectionHandler.cs" />
<Compile Include="MonoDevelop.Core.Serialization\ICustomDataItemHandler.cs" />
<Compile Include="MonoDevelop.Core.Serialization\IExtendedDataItem.cs" />
- <Compile Include="MonoDevelop.Core.Serialization\ILoadController.cs" />
<Compile Include="MonoDevelop.Core.Serialization\IPropertyFilter.cs" />
<Compile Include="MonoDevelop.Core.Serialization\ISerializationAttributeProvider.cs" />
<Compile Include="MonoDevelop.Core.Serialization\ItemProperty.cs" />
@@ -177,7 +198,6 @@
<Compile Include="MonoDevelop.Core.Serialization\XmlMapAttributeProvider.cs" />
<Compile Include="MonoDevelop.Core.Collections\Set.cs" />
<Compile Include="MonoDevelop.Core\Gettext.cs" />
- <Compile Include="MonoDevelop.Core.ProgressMonitoring\AsyncOperation.cs" />
<Compile Include="MonoDevelop.Core.AddIns\PackageInstalledCondition.cs" />
<Compile Include="MonoDevelop.Core\ComponentModelLocalization.cs" />
<Compile Include="MonoDevelop.Core.AddIns\ITargetRuntimeFactory.cs" />
@@ -223,25 +243,19 @@
<Compile Include="MonoDevelop.Core.Logging\RemoteLogger.cs" />
<Compile Include="MonoDevelop.Core.Instrumentation\TimeCounter.cs" />
<Compile Include="MonoDevelop.Core.AddIns\PlatformCondition.cs" />
- <Compile Include="MonoDevelop.Core.ProgressMonitoring\AggregatedAsyncOperation.cs" />
<Compile Include="MonoDevelop.Core.Serialization\BinaryDataSerializer.cs" />
<Compile Include="MonoDevelop.Core.Execution\LocalConsole.cs" />
<Compile Include="MonoDevelop.Core\IconId.cs" />
- <Compile Include="MonoDevelop.Core.ProgressMonitoring\NullProgressMonitor.cs" />
- <Compile Include="MonoDevelop.Core.ProgressMonitoring\SimpleProgressMonitor.cs" />
<Compile Include="Mono.Options.cs" />
<Compile Include="MonoDevelop.Core.Logging\InstrumentationLogger.cs" />
<Compile Include="MonoDevelop.Core.Instrumentation\TimerCounter.cs" />
- <Compile Include="MonoDevelop.Projects\FileFormatManager.cs" />
<Compile Include="MonoDevelop.Projects\ProjectService.cs" />
<Compile Include="MonoDevelop.Projects\ProjectPathItemPropertyAttribute.cs" />
<Compile Include="MonoDevelop.Projects\SolutionConfiguration.cs" />
- <Compile Include="MonoDevelop.Projects\SolutionEntityItem.cs" />
<Compile Include="MonoDevelop.Projects\SolutionItemEventArgs.cs" />
<Compile Include="MonoDevelop.Projects\CombineEntryRenamedEventArgs.cs" />
<Compile Include="MonoDevelop.Projects\SolutionItemConfiguration.cs" />
<Compile Include="MonoDevelop.Projects\ProjectConfiguration.cs" />
- <Compile Include="MonoDevelop.Projects\DotNetProjectBinding.cs" />
<Compile Include="MonoDevelop.Projects\DotNetProjectConfiguration.cs" />
<Compile Include="MonoDevelop.Projects\Project.cs" />
<Compile Include="MonoDevelop.Projects\ProjectFile.cs" />
@@ -251,20 +265,15 @@
<Compile Include="MonoDevelop.Projects\ProjectFileCollection.cs" />
<Compile Include="MonoDevelop.Projects\ProjectReferenceCollection.cs" />
<Compile Include="MonoDevelop.Projects\ProjectCreateInformation.cs" />
- <Compile Include="MonoDevelop.Projects\IProjectBinding.cs" />
- <Compile Include="MonoDevelop.Projects\IDotNetLanguageBinding.cs" />
<Compile Include="MonoDevelop.Projects\SolutionItemConfigurationCollection.cs" />
<Compile Include="MonoDevelop.Projects\ConfigurationEventHandler.cs" />
<Compile Include="MonoDevelop.Projects\ExecutionContext.cs" />
<Compile Include="MonoDevelop.Projects\BuildTool.cs" />
<Compile Include="MonoDevelop.Projects\BuildEventHandler.cs" />
- <Compile Include="MonoDevelop.Projects\ProjectServiceExtension.cs" />
<Compile Include="MonoDevelop.Projects\CustomCommandCollection.cs" />
<Compile Include="MonoDevelop.Projects\CustomCommand.cs" />
<Compile Include="MonoDevelop.Projects\CustomCommandType.cs" />
<Compile Include="MonoDevelop.Projects\GenericProject.cs" />
- <Compile Include="MonoDevelop.Projects\GenericProjectBinding.cs" />
- <Compile Include="MonoDevelop.Projects\CustomCommandExtension.cs" />
<Compile Include="MonoDevelop.Projects\ProjectConvertTool.cs" />
<Compile Include="MonoDevelop.Projects\ProjectsServices.cs" />
<Compile Include="MonoDevelop.Projects\UnknownSolutionItem.cs" />
@@ -278,16 +287,13 @@
<Compile Include="MonoDevelop.Projects\WorkspaceItemCollection.cs" />
<Compile Include="MonoDevelop.Projects\WorkspaceItemEventArgs.cs" />
<Compile Include="MonoDevelop.Projects\SolutionEventArgs.cs" />
- <Compile Include="MonoDevelop.Projects\IWorkspaceObject.cs" />
<Compile Include="MonoDevelop.Projects\SolutionConfigurationCollection.cs" />
<Compile Include="MonoDevelop.Projects\ItemConfiguration.cs" />
<Compile Include="MonoDevelop.Projects\ItemConfigurationCollection.cs" />
<Compile Include="MonoDevelop.Projects\IConfigurationTarget.cs" />
<Compile Include="MonoDevelop.Projects\ItemCollection.cs" />
- <Compile Include="MonoDevelop.Projects\SolutionItem.cs" />
<Compile Include="MonoDevelop.Projects\SolutionFolderItemCollection.cs" />
<Compile Include="MonoDevelop.Projects\SolutionItemReference.cs" />
- <Compile Include="MonoDevelop.Projects\FileFormat.cs" />
<Compile Include="MonoDevelop.Projects\UnknownWorkspaceItem.cs" />
<Compile Include="MonoDevelop.Projects\BuildResult.cs" />
<Compile Include="MonoDevelop.Projects\BuildAction.cs" />
@@ -296,14 +302,9 @@
<Compile Include="MonoDevelop.Projects\FileCopySet.cs" />
<Compile Include="MonoDevelop.Projects\ProjectItem.cs" />
<Compile Include="MonoDevelop.Projects\ProjectItemCollection.cs" />
- <Compile Include="MonoDevelop.Projects\SimpleProjectItem.cs" />
<Compile Include="MonoDevelop.Projects\IFolderItem.cs" />
<Compile Include="MonoDevelop.Projects\IFileItem.cs" />
- <Compile Include="MonoDevelop.Projects\ProjectParameters.cs" />
- <Compile Include="MonoDevelop.Projects\ConfigurationParameters.cs" />
<Compile Include="MonoDevelop.Projects\CyclicDependencyException.cs" />
- <Compile Include="MonoDevelop.Projects\DotNetAssemblyProject.cs" />
- <Compile Include="MonoDevelop.Projects\DotNetProjectParameters.cs" />
<Compile Include="MonoDevelop.Projects\ItemConfigurationSelector.cs" />
<Compile Include="MonoDevelop.Projects\SolutionConfigurationSelector.cs" />
<Compile Include="MonoDevelop.Projects\DefaultConfigurationSelector.cs" />
@@ -312,54 +313,35 @@
<Compile Include="MonoDevelop.Projects\CompiledAssemblyProject.cs" />
<Compile Include="MonoDevelop.Projects\IAssemblyProject.cs" />
<Compile Include="MonoDevelop.Projects.Extensions\ItemPropertyCodon.cs" />
- <Compile Include="MonoDevelop.Projects.Extensions\LanguageBindingCodon.cs" />
<Compile Include="MonoDevelop.Projects.Extensions\DataTypeCodon.cs" />
- <Compile Include="MonoDevelop.Projects.Extensions\ProjectBindingCodon.cs" />
- <Compile Include="MonoDevelop.Projects.Extensions\ItemTypeNode.cs" />
- <Compile Include="MonoDevelop.Projects.Extensions\DotNetProjectNode.cs" />
- <Compile Include="MonoDevelop.Projects.Extensions\SolutionItemNode.cs" />
<Compile Include="MonoDevelop.Projects.Extensions\SerlializationMapNode.cs" />
- <Compile Include="MonoDevelop.Projects.Extensions\IFileFormat.cs" />
<Compile Include="MonoDevelop.Projects.Extensions\FileFormatNode.cs" />
- <Compile Include="MonoDevelop.Projects.Extensions\ProjectExtensionUtil.cs" />
- <Compile Include="MonoDevelop.Projects.Extensions\ISolutionItemHandler.cs" />
- <Compile Include="MonoDevelop.Projects.Extensions\SolutionItemHandler.cs" />
- <Compile Include="MonoDevelop.Projects.Extensions\DotNetProjectSubtypeNode.cs" />
<Compile Include="MonoDevelop.Projects.Extensions\PolicySetNode.cs" />
<Compile Include="MonoDevelop.Projects.Extensions\PolicyNode.cs" />
<Compile Include="MonoDevelop.Projects.Extensions\ItemTypeCondition.cs" />
<Compile Include="MonoDevelop.Projects.Extensions\MonoDocSourceNode.cs" />
<Compile Include="MonoDevelop.Projects.Extensions\ProjectLanguageCondition.cs" />
- <Compile Include="MonoDevelop.Projects.Extensions\IResourceHandler.cs" />
- <Compile Include="MonoDevelop.Projects.Extensions\IPathHandler.cs" />
<Compile Include="MonoDevelop.Projects.Extensions\IAssemblyReferenceHandler.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MD1\MD1DotNetProjectHandler.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MD1\MD1FileFormat.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MD1\MD1SolutionEntityItemHandler.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MD1\MD1SolutionItemHandler.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild\MSBuildFileFormat.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild\MSBuildProjectHandler.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild\SlnFileFormat.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild\MSBuildProjectService.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild\SlnData.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild\MSBuildProject.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild\MSBuildHandler.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild\MSBuildImportAttribute.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild\RemoteProjectBuilder.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild\IMSBuildImportProvider.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild\MergeToProjectAttribute.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild\CompiledAssemblyProjectMSBuildHandler.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild.Conditions\ConditionAndExpression.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild.Conditions\ConditionExpression.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild.Conditions\ConditionFactorExpresion.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild.Conditions\ConditionFunctionExpression.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild.Conditions\ConditionNotExpression.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild.Conditions\ConditionOrExpression.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild.Conditions\ConditionParser.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild.Conditions\ConditionRelationalExpression.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild.Conditions\ConditionTokenizer.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild.Conditions\ExpressionParseException.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild.Conditions\Token.cs" />
+ <Compile Include="MonoDevelop.Projects.MD1\MD1DotNetProjectHandler.cs" />
+ <Compile Include="MonoDevelop.Projects.MD1\MD1FileFormat.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildFileFormat.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\SlnFileFormat.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildProjectService.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildProject.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildImportAttribute.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\RemoteProjectBuilder.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MergeToProjectAttribute.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild.Conditions\ConditionAndExpression.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild.Conditions\ConditionExpression.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild.Conditions\ConditionFactorExpresion.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild.Conditions\ConditionFunctionExpression.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild.Conditions\ConditionNotExpression.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild.Conditions\ConditionOrExpression.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild.Conditions\ConditionParser.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild.Conditions\ConditionRelationalExpression.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild.Conditions\ConditionTokenizer.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild.Conditions\ExpressionParseException.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild.Conditions\Token.cs" />
<Compile Include="MonoDevelop.Projects.Policies\PolicyBag.cs" />
<Compile Include="MonoDevelop.Projects.Policies\PolicyService.cs" />
<Compile Include="MonoDevelop.Projects.Policies\PolicySet.cs" />
@@ -368,9 +350,7 @@
<Compile Include="MonoDevelop.Projects.Policies\PolicyContainer.cs" />
<Compile Include="MonoDevelop.Projects.Policies\ScopedPolicy.cs" />
<Compile Include="MonoDevelop.Projects.Policies\PolicyDictionary.cs" />
- <Compile Include="MonoDevelop.Projects.Text\IEditableTextFile.cs" />
<Compile Include="MonoDevelop.Projects.Text\ITextFile.cs" />
- <Compile Include="MonoDevelop.Projects.Text\ITextFileProvider.cs" />
<Compile Include="MonoDevelop.Projects.Text\TextFile.cs" />
<Compile Include="MonoDevelop.Projects.Text\TextEncoding.cs" />
<Compile Include="MonoDevelop.Projects.Text\TextFileReader.cs" />
@@ -407,13 +387,10 @@
<Compile Include="MonoDevelop.Core\ApplicationService.cs" />
<Compile Include="MonoDevelop.Core.ProgressMonitoring\ProgressStatusMonitor.cs" />
<Compile Include="MonoDevelop.Projects\LanguageBindingService.cs" />
- <Compile Include="MonoDevelop.Projects\ILanguageBinding.cs" />
<Compile Include="MonoDevelop.Core\Platform.cs" />
<Compile Include="MonoDevelop.Core\UserProfile.cs" />
<Compile Include="MonoDevelop.Core\BrandingService.cs" />
<Compile Include="MonoDevelop.Projects\CleanEventHandler.cs" />
- <Compile Include="MonoDevelop.Core.ProgressMonitoring\IProjectLoadProgressMonitor.cs" />
- <Compile Include="MonoDevelop.Core.ProgressMonitoring\WrappedProgressMonitor.cs" />
<Compile Include="MonoDevelop.Core.ProgressMonitoring\ConsoleProjectLoadProgressMonitor.cs" />
<Compile Include="MonoDevelop.Core\SystemInformation.cs" />
<Compile Include="MonoDevelop.Core\MacSystemInformation.cs" />
@@ -428,10 +405,8 @@
<Compile Include="MonoDevelop.Core\PasswordService.cs" />
<Compile Include="MonoDevelop.Core\IPasswordProvider.cs" />
<Compile Include="MonoDevelop.Projects.Utility\ByteOrderMark.cs" />
- <Compile Include="MonoDevelop.Projects\PortableDotNetProject.cs" />
<Compile Include="MonoDevelop.Core.AddIns\FilePathExtensionNode.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild\TargetsAvailableCondition.cs" />
- <Compile Include="MonoDevelop.Projects\PortableDotNetProjectBinding.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\TargetsAvailableCondition.cs" />
<Compile Include="MonoDevelop.Core.AddIns\AssemblyInstalledCondition.cs" />
<Compile Include="MonoDevelop.Core\WebCertificateService.cs" />
<Compile Include="MonoDevelop.Core\IWebCertificateProvider.cs" />
@@ -443,13 +418,10 @@
<Compile Include="BuildVariables.cs" />
<Compile Include="AddinInfo.cs" />
<Compile Include="MonoDevelop.Core.Logging\AssertLoggingTraceListener.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MD1\MD1ProjectService.cs" />
+ <Compile Include="MonoDevelop.Projects.MD1\MD1ProjectService.cs" />
<Compile Include="MonoDevelop.Projects\UnknownProject.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild\MSBuildExtension.cs" />
<Compile Include="MonoDevelop.Projects.SharedAssetsProjects\SharedAssetsProject.cs" />
<Compile Include="MonoDevelop.Projects.SharedAssetsProjects\SharedAssetsProjectMSBuildExtension.cs" />
- <Compile Include="MonoDevelop.Projects.SharedAssetsProjects\SharedAssetsProjectMSBuildHandler.cs" />
- <Compile Include="MonoDevelop.Projects.SharedAssetsProjects\SharedAssetsProjectBinding.cs" />
<Compile Include="MonoDevelop.Core\WebRequestHelper.cs" />
<Compile Include="MonoDevelop.Core.Web\IProxyAuthenticationHandler.cs" />
<Compile Include="MonoDevelop.Core.Web\CredentialStore.cs" />
@@ -466,26 +438,162 @@
<Compile Include="MonoDevelop.Core.Web\STSAuthHelper.cs" />
<Compile Include="MonoDevelop.Core.Web\WIFTypeProvider.cs" />
<Compile Include="MonoDevelop.Core.Web\CredentialProviderExtensions.cs" />
- <Compile Include="MonoDevelop.Core.Execution\IDebugConsole.cs" />
+ <Compile Include="MonoDevelop.Core.Text\ISegment.cs" />
+ <Compile Include="MonoDevelop.Core.Text\UnicodeNewLine.cs" />
+ <Compile Include="MonoDevelop.Core.Text\ITextSource.cs" />
+ <Compile Include="MonoDevelop.Core.Text\TextChangeEventArgs.cs" />
+ <Compile Include="MonoDevelop.Core.Text\StringTextSource.cs" />
+ <Compile Include="MonoDevelop.Core.Text\TextFileUtility.cs" />
+ <Compile Include="MonoDevelop.Core.Text\ITextSourceVersion.cs" />
<Compile Include="MonoDevelop.Projects\IDotNetFileContainer.cs" />
- <Compile Include="MonoDevelop.Projects.Formats.MSBuild\IMSBuildGlobalPropertyProvider.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\IMSBuildGlobalPropertyProvider.cs" />
<Compile Include="MonoDevelop.Projects\DotNetProjectImport.cs" />
+ <Compile Include="MonoDevelop.Core.Text\TextSourceVersionProvider.cs" />
<Compile Include="MonoDevelop.Core.LogReporting\CrashReporter.cs" />
<Compile Include="MonoDevelop.Core.Instrumentation\InstrumentationConsumer.cs" />
+ <Compile Include="MonoDevelop.Projects\DotNetProjectExtension.cs" />
+ <Compile Include="MonoDevelop.Projects.Extensions\MSBuildProjectExtensionNode.cs" />
+ <Compile Include="MonoDevelop.Projects\ChainedExtension.cs" />
+ <Compile Include="MonoDevelop.Projects\ExtensionChain.cs" />
+ <Compile Include="MonoDevelop.Projects\SolutionFolderItem.cs" />
+ <Compile Include="MonoDevelop.Projects\SolutionItem.cs" />
+ <Compile Include="MonoDevelop.Projects\SolutionItemExtension.cs" />
+ <Compile Include="MonoDevelop.Projects\WorkspaceItemExtension.cs" />
+ <Compile Include="MonoDevelop.Projects\SolutionExtension.cs" />
+ <Compile Include="MonoDevelop.Projects.Extensions\ProjectModelExtensionNode.cs" />
+ <Compile Include="MonoDevelop.Projects.Extensions\SolutionItemExtensionNode.cs" />
+ <Compile Include="MonoDevelop.Projects.Extensions\FlavorTypeCondition.cs" />
+ <Compile Include="MonoDevelop.Projects\WorkspaceObject.cs" />
+ <Compile Include="MonoDevelop.Projects\WorkspaceObjectExtension.cs" />
+ <Compile Include="MonoDevelop.Core.Execution\ProcessAsyncOperation.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildProperty.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildPropertyGroup.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildItem.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildItemGroup.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildEvaluationContext.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildImport.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildObject.cs" />
+ <Compile Include="MonoDevelop.Projects\IPropertySet.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\IMSBuildPropertySet.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildPropertyGroupEvaluated.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\SlnFile.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\UnknownSolutionItemTypeException.cs" />
+ <Compile Include="MonoDevelop.Projects\DotNetCompilerParameters.cs" />
+ <Compile Include="MonoDevelop.Projects\PortableDotNetProjectFlavor.cs" />
+ <Compile Include="MonoDevelop.Projects\SolutionItemFactory.cs" />
+ <Compile Include="MonoDevelop.Projects.Extensions\ProjectMigrationHandler.cs" />
+ <Compile Include="MonoDevelop.Projects.Extensions\ProjectMigrationHandlerNode.cs" />
+ <Compile Include="MonoDevelop.Projects.Extensions\SolutionItemTypeNode.cs" />
+ <Compile Include="MonoDevelop.Projects.Extensions\ProjectTypeNode.cs" />
+ <Compile Include="MonoDevelop.Projects.Extensions\DotNetProjectTypeNode.cs" />
+ <Compile Include="MonoDevelop.Projects\ProjectExtension.cs" />
+ <Compile Include="MonoDevelop.Core\ProgressMonitor.cs" />
+ <Compile Include="MonoDevelop.Core.ProgressMonitoring\ProjectLoadProgressMonitor.cs" />
+ <Compile Include="MonoDevelop.Projects\ExportProjectModelExtensionAttribute.cs" />
+ <Compile Include="MonoDevelop.Projects\ExportSolutionItemTypeAttribute.cs" />
+ <Compile Include="MonoDevelop.Projects\ExportProjectFlavorAttribute.cs" />
+ <Compile Include="MonoDevelop.Projects\ExportProjectTypeAttribute.cs" />
+ <Compile Include="MonoDevelop.Projects\ExportDotNetProjectTypeAttribute.cs" />
<Compile Include="MonoDevelop.Projects\ProjectCreateParameters.cs" />
<Compile Include="MonoDevelop.Projects\BuildError.cs" />
<Compile Include="MonoDevelop.Projects\MSBuildErrorParser.cs" />
+ <Compile Include="MonoDevelop.Projects\ProjectItemMetadata.cs" />
+ <Compile Include="MonoDevelop.Projects\ProjectFeature.cs" />
+ <Compile Include="MonoDevelop.Projects\MSBuildSupport.cs" />
+ <Compile Include="MonoDevelop.Projects\ThreadSafeAttribute.cs" />
+ <Compile Include="MonoDevelop.Projects\MSBuildSerializationExtension.cs" />
+ <Compile Include="MonoDevelop.Projects\WorkspaceSerializationExtension.cs" />
+ <Compile Include="MonoDevelop.Projects\IMSBuildFileObject.cs" />
+ <Compile Include="MonoDevelop.Projects.Extensions\TypeTagCondition.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildEngine.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\ProjectEvaluationException.cs" />
+ <Compile Include="MonoDevelop.Projects.Extensions\ImportRedirectTypeNode.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\FileUtil.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\DefaultMSBuildEngine.cs" />
+ <Compile Include="MonoDevelop.Projects\SolutionDataSectionAttribute.cs" />
+ <Compile Include="MonoDevelop.Core.Serialization\DataDeletedValue.cs" />
+ <Compile Include="MonoDevelop.Projects\WorkspaceObjectReader.cs" />
+ <Compile Include="MonoDevelop.Projects\LanguageBinding.cs" />
+ <Compile Include="MonoDevelop.Projects.Extensions\LanguageBindingExtensionNode.cs" />
+ <Compile Include="MonoDevelop.Core.Execution\OperationConsole.cs" />
+ <Compile Include="MonoDevelop.Core.Execution\OutputProgressMonitor.cs" />
+ <Compile Include="MonoDevelop.Core.Execution\OperationConsoleFactory.cs" />
+ <Compile Include="MonoDevelop.Projects\PathBasedProjectItem.cs" />
+ <Compile Include="MonoDevelop.Projects\ExportProjectItemTypeAttribute.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildProjectInstance.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildEngineV12.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildEngineV4.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildEngineManager.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild.Conditions\ExpressionEvaluationException.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildValueType.cs" />
+ <Compile Include="MonoDevelop.Projects\ConfigurationKind.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\IMetadataProperty.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\IMSBuildPropertyEvaluated.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildPropertyEvaluated.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildPropertyCore.cs" />
+ <Compile Include="MonoDevelop.Projects\TargetEvaluationResult.cs" />
+ <Compile Include="MonoDevelop.Projects\TargetEvaluationContext.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildImportGroup.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildChoose.cs" />
+ <Compile Include="MonoDevelop.Core.StringParsing\StringTagModelExtensions.cs" />
<Compile Include="MonoDevelop.Projects\OperationContext.cs" />
<Compile Include="MonoDevelop.Projects\ProjectOperationContext.cs" />
- <Compile Include="MonoDevelop.Projects\TargetEvaluationContext.cs" />
- <Compile Include="MonoDevelop.Projects\TargetEvaluationResult.cs" />
+ <Compile Include="MonoDevelop.Projects\AsyncCriticalSection.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildTarget.cs" />
<Compile Include="MonoDevelop.Projects.Extensions\SupportsTargetCondition.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildTask.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildProjectExtensions.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildWhitespace.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildXmlReader.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildElement.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildXmlNode.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildFileFormatException.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\MSBuildXmlElement.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\IMSBuildProjectObject.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\IntrinsicFunctions.cs" />
+ <Compile Include="MonoDevelop.Projects.MSBuild\EscapingUtilities.cs" />
+ <Compile Include="CoreExtensions.cs" />
+ <Compile Include="MonoDevelop.Core\FileWriteableState.cs" />
+ <Compile Include="MonoDevelop.Projects\ConditionedPropertyCollection.cs" />
+ <Compile Include="MonoDevelop.Core\AsyncEventHandler.cs" />
+ <Compile Include="MonoDevelop.Core.Execution\MultipleOperationConsoles.cs" />
+ <Compile Include="MonoDevelop.Core.Execution\BinaryMessage.cs" />
+ <Compile Include="MonoDevelop.Core.Execution\RemoteProcessConnection.cs" />
+ <Compile Include="MonoDevelop.Core.Execution\RemoteProcessServer.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Makefile.am" />
- <None Include="MonoDevelop.Projects.Formats.MSBuild.Conditions\InvalidProjectFileException.cs" />
<None Include="BuildVariables.cs.in" />
<None Include="packages.config" />
+ <None Include="MSBuild\CodeSharing.Common.props">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="MSBuild\CodeSharing.Common.Default.props">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="MSBuild\CodeSharing.CSharp.targets">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.CSharp.dll">
+ <Link>Microsoft.CodeAnalysis.CSharp.dll</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.CSharp.Features.dll">
+ <Link>Microsoft.CodeAnalysis.CSharp.Features.dll</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.CSharp.Workspaces.dll">
+ <Link>Microsoft.CodeAnalysis.CSharp.Workspaces.dll</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.Workspaces.Desktop.dll">
+ <Link>Microsoft.CodeAnalysis.Workspaces.Desktop.dll</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.VisualBasic.dll">
+ <Link>Microsoft.CodeAnalysis.VisualBasic.dll</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="MonoDevelop.Core.addin.xml">
@@ -532,14 +640,6 @@
<Project>{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}</Project>
<Name>Mono.Cecil.Mdb</Name>
</ProjectReference>
- <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
- <Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
- <Name>ICSharpCode.NRefactory</Name>
- </ProjectReference>
- <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory.CSharp\ICSharpCode.NRefactory.CSharp.csproj">
- <Project>{53DCA265-3C3C-42F9-B647-F72BA678122B}</Project>
- <Name>ICSharpCode.NRefactory.CSharp</Name>
- </ProjectReference>
<ProjectReference Include="..\..\..\external\mono-addins\Mono.Addins\Mono.Addins.csproj">
<Project>{91DD5A2D-9FE3-4C3C-9253-876141874DAD}</Project>
<Name>Mono.Addins</Name>
@@ -560,10 +660,6 @@
<Project>{63E6915C-7EA4-4D76-AB28-0D7191EEA626}</Project>
<Name>Mono.Cecil.Pdb</Name>
</ProjectReference>
- <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory.Cecil\ICSharpCode.NRefactory.Cecil.csproj">
- <Project>{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}</Project>
- <Name>ICSharpCode.NRefactory.Cecil</Name>
- </ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="MonoDevelop.Core.dll.config">
@@ -572,6 +668,7 @@
</ItemGroup>
<ItemGroup>
<Folder Include="MonoDevelop.Projects.SharedAssetsProjects\" />
+ <Folder Include="MSBuild\" />
</ItemGroup>
<Target Name="BeforeBuild" Inputs="BuildVariables.cs.in; $(MSBuildProjectDirectory)\..\..\..\..\version.config" Outputs="BuildVariables.cs">
<Csc Sources="BuildVariables.gen.cs" OutputAssembly="BuildVariables.gen.exe" />
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/ApplicationService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/ApplicationService.cs
index 46698c89d1..781ce45239 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/ApplicationService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/ApplicationService.cs
@@ -29,12 +29,13 @@ using Mono.Addins;
using Mono.Addins.Setup;
using MonoDevelop.Core;
using MonoDevelop.Core.AddIns;
+using System.Threading.Tasks;
namespace MonoDevelop.Core
{
public class ApplicationService
{
- public int StartApplication (string appId, string[] parameters)
+ public Task<int> StartApplication (string appId, string[] parameters)
{
var app = GetApplication (appId);
if (app == null)
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/AsyncEventHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/AsyncEventHandler.cs
new file mode 100644
index 0000000000..a4d2ee1517
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/AsyncEventHandler.cs
@@ -0,0 +1,36 @@
+//
+// AsyncEventHandler.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Core
+{
+ public delegate Task AsyncEventHandler (object sender, EventArgs args);
+
+ public delegate Task AsyncEventHandler<T> (object sender, T args);
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/BrandingService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/BrandingService.cs
index 4803909107..b5d5675c9f 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/BrandingService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/BrandingService.cs
@@ -42,11 +42,44 @@ namespace MonoDevelop.Core
static XDocument brandingDocument;
static XDocument localizedBrandingDocument;
- public static readonly string ApplicationName;
+ static string applicationName;
+ static string applicationLongName;
+
public static readonly string SuiteName;
public static readonly string ProfileDirectoryName;
public static readonly string StatusSteadyIconId;
-
+ public static readonly string HelpAboutIconId;
+
+ public static string ApplicationName {
+ get {
+ return applicationName;
+ }
+ set {
+ if (string.IsNullOrEmpty (value))
+ value = "MonoDevelop";
+
+ if (applicationName != value) {
+ applicationName = value;
+ OnApplicationNameChanged ();
+ }
+ }
+ }
+
+ public static string ApplicationLongName {
+ get {
+ return applicationLongName;
+ }
+ set {
+ if (string.IsNullOrEmpty (value))
+ value = "MonoDevelop";
+
+ if (applicationLongName != value) {
+ applicationLongName = value;
+ OnApplicationNameChanged ();
+ }
+ }
+ }
+
static BrandingService ()
{
try {
@@ -76,15 +109,14 @@ namespace MonoDevelop.Core
}
}
ApplicationName = GetString ("ApplicationName");
+ ApplicationLongName = GetString ("ApplicationLongName") ?? ApplicationName;
SuiteName = GetString ("SuiteName");
ProfileDirectoryName = GetString ("ProfileDirectoryName");
StatusSteadyIconId = GetString ("StatusAreaSteadyIcon");
+ HelpAboutIconId = GetString ("HelpAboutIcon");
} catch (Exception ex) {
LoggingService.LogError ("Could not read branding document", ex);
}
-
- if (string.IsNullOrEmpty (ApplicationName))
- ApplicationName = "MonoDevelop";
if (string.IsNullOrEmpty (SuiteName))
SuiteName = ApplicationName;
@@ -94,6 +126,9 @@ namespace MonoDevelop.Core
if (string.IsNullOrEmpty (StatusSteadyIconId))
StatusSteadyIconId = "md-status-steady";
+
+ if (string.IsNullOrEmpty (HelpAboutIconId))
+ HelpAboutIconId = "md-about";
}
public static string GetString (params string[] keyPath)
@@ -179,5 +214,14 @@ namespace MonoDevelop.Core
{
return s.Replace ("MonoDevelop", ApplicationName);
}
+
+ public static event EventHandler ApplicationNameChanged;
+
+ static void OnApplicationNameChanged ()
+ {
+ var handler = ApplicationNameChanged;
+ if (handler != null)
+ handler (null, new EventArgs ());
+ }
}
} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FilePath.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FilePath.cs
index d93a7257d6..0f8f88efd2 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FilePath.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FilePath.cs
@@ -27,6 +27,7 @@
using System;
using System.Collections.Generic;
using System.IO;
+using System.Threading.Tasks;
using System.Runtime.InteropServices;
using System.Linq;
@@ -35,8 +36,8 @@ namespace MonoDevelop.Core
[Serializable]
public struct FilePath: IComparable<FilePath>, IComparable, IEquatable<FilePath>
{
- static readonly StringComparer PathComparer = (Platform.IsWindows || Platform.IsMac) ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal;
- static readonly StringComparison PathComparison = (Platform.IsWindows || Platform.IsMac) ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
+ public static readonly StringComparer PathComparer = (Platform.IsWindows || Platform.IsMac) ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal;
+ public static readonly StringComparison PathComparison = (Platform.IsWindows || Platform.IsMac) ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
readonly string fileName;
@@ -69,13 +70,13 @@ namespace MonoDevelop.Core
const int PATHMAX = 4096 + 1;
- static readonly char[] invalidPathChars = Path.GetInvalidPathChars ().Concat ("#%").ToArray ();
+ static readonly char[] invalidPathChars = Path.GetInvalidPathChars ();
public static char[] GetInvalidPathChars()
{
return (char[])invalidPathChars.Clone();
}
- static readonly char[] invalidFileNameChars = Path.GetInvalidFileNameChars ().Concat ("#%").ToArray ();
+ static readonly char[] invalidFileNameChars = Path.GetInvalidFileNameChars ();
public static char[] GetInvalidFileNameChars ()
{
return (char[])invalidFileNameChars.Clone ();
@@ -94,7 +95,7 @@ namespace MonoDevelop.Core
try {
buffer = Marshal.AllocHGlobal (PATHMAX);
var result = realpath (this, buffer);
- return result == IntPtr.Zero ? "" : Marshal.PtrToStringAuto (buffer);
+ return result == IntPtr.Zero ? Path.GetFullPath (this) : Marshal.PtrToStringAuto (buffer);
} finally {
if (buffer != IntPtr.Zero)
Marshal.FreeHGlobal (buffer);
@@ -120,7 +121,9 @@ namespace MonoDevelop.Core
/// </summary>
public FilePath CanonicalPath {
get {
- if (string.IsNullOrEmpty (fileName))
+ if (fileName == null)
+ return FilePath.Null;
+ if (fileName.Length == 0)
return FilePath.Empty;
string fp = Path.GetFullPath (fileName);
if (fp.Length > 0) {
@@ -180,7 +183,17 @@ namespace MonoDevelop.Core
{
return Path.ChangeExtension (fileName, ext);
}
-
+
+ /// <summary>
+ /// Returns a file path with the name changed to the provided name, but keeping the extension
+ /// </summary>
+ /// <returns>The new file path</returns>
+ /// <param name="newName">New file name</param>
+ public FilePath ChangeName (string newName)
+ {
+ return ParentDirectory.Combine (newName) + Extension;
+ }
+
public FilePath Combine (params FilePath[] paths)
{
string path = fileName;
@@ -194,6 +207,11 @@ namespace MonoDevelop.Core
return new FilePath (Path.Combine (fileName, Path.Combine (paths)));
}
+ public Task DeleteAsync ()
+ {
+ return Task.Run ((System.Action)Delete);
+ }
+
public void Delete ()
{
// Ensure that this file/directory and all children are writable
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FileService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FileService.cs
index 9d2fe4481d..d6e9d90da1 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FileService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FileService.cs
@@ -1,95 +1,101 @@
-//
-// FileService.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Diagnostics;
-using System.IO;
-using System.Text;
-
-using Mono.Addins;
-using Mono.Unix.Native;
-using MonoDevelop.Core.FileSystem;
-using System.Collections.Generic;
-using System.Threading;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Net;
-
-namespace MonoDevelop.Core
-{
- public static class FileService
- {
- const string addinFileSystemExtensionPath = "/MonoDevelop/Core/FileSystemExtensions";
-
- static FileServiceErrorHandler errorHandler;
-
- static FileSystemExtension fileSystemChain;
- static readonly FileSystemExtension defaultExtension = new DefaultFileSystemExtension ();
-
- static readonly EventQueue eventQueue = new EventQueue ();
-
- static readonly string applicationRootPath = Path.Combine (PropertyService.EntryAssemblyPath, "..");
- public static string ApplicationRootPath {
- get {
- return applicationRootPath;
- }
- }
-
- static FileService()
- {
- AddinManager.ExtensionChanged += delegate (object sender, ExtensionEventArgs args) {
- if (args.PathChanged (addinFileSystemExtensionPath))
- UpdateExtensions ();
- };
- UpdateExtensions ();
- }
-
- static void UpdateExtensions ()
- {
- if (!Runtime.Initialized) {
- fileSystemChain = defaultExtension;
- return;
- }
-
- var extensions = AddinManager.GetExtensionObjects (addinFileSystemExtensionPath, typeof(FileSystemExtension)).Cast<FileSystemExtension> ().ToArray ();
- for (int n=0; n<extensions.Length - 1; n++) {
- extensions [n].Next = extensions [n + 1];
- }
-
- if (extensions.Length > 0) {
- extensions [extensions.Length - 1].Next = defaultExtension;
- fileSystemChain = extensions [0];
- } else {
- fileSystemChain = defaultExtension;
- }
- }
-
+//
+// FileService.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Diagnostics;
+using System.IO;
+using System.Text;
+
+using Mono.Addins;
+using Mono.Unix.Native;
+using MonoDevelop.Core.FileSystem;
+using System.Collections.Generic;
+using System.Threading;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Net;
+
+namespace MonoDevelop.Core
+{
+ public static class FileService
+ {
+ delegate bool PathCharsAreEqualDelegate (char a, char b);
+
+ static PathCharsAreEqualDelegate PathCharsAreEqual = Platform.IsWindows || Platform.IsMac ?
+ (PathCharsAreEqualDelegate) PathCharsAreEqualCaseInsensitive :
+ (PathCharsAreEqualDelegate) PathCharsAreEqualCaseSensitive;
+
+ const string addinFileSystemExtensionPath = "/MonoDevelop/Core/FileSystemExtensions";
+
+ static FileServiceErrorHandler errorHandler;
+
+ static FileSystemExtension fileSystemChain;
+ static readonly FileSystemExtension defaultExtension = new DefaultFileSystemExtension ();
+
+ static readonly EventQueue eventQueue = new EventQueue ();
+
+ static readonly string applicationRootPath = Path.Combine (PropertyService.EntryAssemblyPath, "..");
+ public static string ApplicationRootPath {
+ get {
+ return applicationRootPath;
+ }
+ }
+
+ static FileService()
+ {
+ AddinManager.ExtensionChanged += delegate (object sender, ExtensionEventArgs args) {
+ if (args.PathChanged (addinFileSystemExtensionPath))
+ UpdateExtensions ();
+ };
+ UpdateExtensions ();
+ }
+
+ static void UpdateExtensions ()
+ {
+ if (!Runtime.Initialized) {
+ fileSystemChain = defaultExtension;
+ return;
+ }
+
+ var extensions = AddinManager.GetExtensionObjects (addinFileSystemExtensionPath, typeof(FileSystemExtension)).Cast<FileSystemExtension> ().ToArray ();
+ for (int n=0; n<extensions.Length - 1; n++) {
+ extensions [n].Next = extensions [n + 1];
+ }
+
+ if (extensions.Length > 0) {
+ extensions [extensions.Length - 1].Next = defaultExtension;
+ fileSystemChain = extensions [0];
+ } else {
+ fileSystemChain = defaultExtension;
+ }
+ }
+
/// <summary>
/// Returns true if the folder is in a case sensitive file system
/// </summary>
@@ -119,623 +125,642 @@ namespace MonoDevelop.Core
return file ?? path.FileName;
}
- public static void DeleteFile (string fileName)
- {
- Debug.Assert (!String.IsNullOrEmpty (fileName));
- try {
- GetFileSystemForPath (fileName, false).DeleteFile (fileName);
- } catch (Exception e) {
- if (!HandleError (GettextCatalog.GetString ("Can't remove file {0}", fileName), e))
- throw;
- return;
- }
- OnFileRemoved (new FileEventArgs (fileName, false));
- }
-
- public static void DeleteDirectory (string path)
- {
- Debug.Assert (!String.IsNullOrEmpty (path));
- try {
- GetFileSystemForPath (path, true).DeleteDirectory (path);
- } catch (Exception e) {
- if (!HandleError (GettextCatalog.GetString ("Can't remove directory {0}", path), e))
- throw;
- return;
- }
- OnFileRemoved (new FileEventArgs (path, true));
- }
-
- public static void RenameFile (string oldName, string newName)
- {
- Debug.Assert (!String.IsNullOrEmpty (oldName));
- Debug.Assert (!String.IsNullOrEmpty (newName));
- if (Path.GetFileName (oldName) != newName) {
- var newPath = ((FilePath)oldName).ParentDirectory.Combine (newName);
- InternalRenameFile (oldName, newName);
- OnFileRenamed (new FileCopyEventArgs (oldName, newPath, false));
- }
- }
-
- public static void RenameDirectory (string oldName, string newName)
- {
- Debug.Assert (!String.IsNullOrEmpty (oldName));
- Debug.Assert (!String.IsNullOrEmpty (newName));
- if (Path.GetFileName (oldName) != newName) {
- string newPath = Path.Combine (Path.GetDirectoryName (oldName), newName);
- InternalMoveDirectory (oldName, newPath);
- OnFileRenamed (new FileCopyEventArgs (oldName, newPath, true));
- OnFileCreated (new FileEventArgs (newPath, false));
- OnFileRemoved (new FileEventArgs (oldName, false));
- }
- }
-
- public static void CopyFile (string srcFile, string dstFile)
- {
- Debug.Assert (!String.IsNullOrEmpty (srcFile));
- Debug.Assert (!String.IsNullOrEmpty (dstFile));
- GetFileSystemForPath (dstFile, false).CopyFile (srcFile, dstFile, true);
- OnFileCopied (new FileCopyEventArgs (srcFile, dstFile, false));
- OnFileCreated (new FileEventArgs (dstFile, false));
- }
-
- public static void MoveFile (string srcFile, string dstFile)
- {
- Debug.Assert (!String.IsNullOrEmpty (srcFile));
- Debug.Assert (!String.IsNullOrEmpty (dstFile));
- InternalMoveFile (srcFile, dstFile);
- OnFileMoved (new FileCopyEventArgs (srcFile, dstFile, false));
- OnFileCreated (new FileEventArgs (dstFile, false));
- OnFileRemoved (new FileEventArgs (srcFile, false));
- }
-
- static void InternalMoveFile (string srcFile, string dstFile)
- {
- Debug.Assert (!String.IsNullOrEmpty (srcFile));
- Debug.Assert (!String.IsNullOrEmpty (dstFile));
- FileSystemExtension srcExt = GetFileSystemForPath (srcFile, false);
- FileSystemExtension dstExt = GetFileSystemForPath (dstFile, false);
-
- if (srcExt == dstExt) {
- // Everything can be handled by the same file system
- srcExt.MoveFile (srcFile, dstFile);
- } else {
- // If the file system of the source and dest files are
- // different, decompose the Move operation into a Copy
- // and Delete, so every file system can handle its part
- dstExt.CopyFile (srcFile, dstFile, true);
- srcExt.DeleteFile (srcFile);
- }
- }
-
- static void InternalRenameFile (string srcFile, string newName)
- {
- Debug.Assert (!string.IsNullOrEmpty (srcFile));
- Debug.Assert (!string.IsNullOrEmpty (newName));
- FileSystemExtension srcExt = GetFileSystemForPath (srcFile, false);
-
- srcExt.RenameFile (srcFile, newName);
- }
-
- public static void CreateDirectory (string path)
- {
- if (!Directory.Exists (path)) {
- Debug.Assert (!String.IsNullOrEmpty (path));
- GetFileSystemForPath (path, true).CreateDirectory (path);
- OnFileCreated (new FileEventArgs (path, true));
- }
- }
-
- public static void CopyDirectory (string srcPath, string dstPath)
- {
- Debug.Assert (!String.IsNullOrEmpty (srcPath));
- Debug.Assert (!String.IsNullOrEmpty (dstPath));
- GetFileSystemForPath (dstPath, true).CopyDirectory (srcPath, dstPath);
- }
-
- public static void MoveDirectory (string srcPath, string dstPath)
- {
- Debug.Assert (!String.IsNullOrEmpty (srcPath));
- Debug.Assert (!String.IsNullOrEmpty (dstPath));
- InternalMoveDirectory (srcPath, dstPath);
- OnFileMoved (new FileCopyEventArgs (srcPath, dstPath, true));
- OnFileCreated (new FileEventArgs (dstPath, true));
- OnFileRemoved (new FileEventArgs (srcPath, true));
- }
-
- static void InternalMoveDirectory (string srcPath, string dstPath)
- {
- Debug.Assert (!String.IsNullOrEmpty (srcPath));
- Debug.Assert (!String.IsNullOrEmpty (dstPath));
- FileSystemExtension srcExt = GetFileSystemForPath (srcPath, true);
- FileSystemExtension dstExt = GetFileSystemForPath (dstPath, true);
-
- if (srcExt == dstExt) {
- // Everything can be handled by the same file system
- srcExt.MoveDirectory (srcPath, dstPath);
- } else {
- // If the file system of the source and dest files are
- // different, decompose the Move operation into a Copy
- // and Delete, so every file system can handle its part
- dstExt.CopyDirectory (srcPath, dstPath);
- srcExt.DeleteDirectory (srcPath);
- }
- }
-
- /// <summary>
- /// Requests permission for modifying a file
- /// </summary>
- /// <param name="fileName">The file to be modified</param>
- /// <param name="throwIfFails">If set to false, it will catch the exception that would've been thrown.</param>
- /// <remarks>This method must be called before trying to write any file. It throws an exception if permission is not granted.</remarks>
- public static bool RequestFileEdit (FilePath fileName, bool throwIfFails = true)
- {
- Debug.Assert (!String.IsNullOrEmpty (fileName));
- return RequestFileEdit (new FilePath[] { fileName }, throwIfFails);
- }
-
- /// <summary>
- /// Requests permission for modifying a set of files
- /// </summary>
- /// <param name="fileNames">Files</param>
- /// <remarks>This method must be called before trying to write any file. It throws an exception if permission is not granted.</remarks>
- public static bool RequestFileEdit (IEnumerable<FilePath> fileNames, bool throwIfFails = true)
- {
- try {
- foreach (var fg in fileNames.GroupBy (f => GetFileSystemForPath (f, false)))
- fg.Key.RequestFileEdit (fg);
- return true;
- } catch (Exception ex) {
- if (throwIfFails)
- throw;
- LoggingService.LogError ("File can't be written", ex);
- return false;
- }
- }
-
- public static void NotifyFileChanged (FilePath fileName)
- {
- NotifyFileChanged (fileName, false);
- }
-
- public static void NotifyFileChanged (FilePath fileName, bool autoReload)
- {
- NotifyFilesChanged (new FilePath[] { fileName }, autoReload);
- }
-
- public static void NotifyFilesChanged (IEnumerable<FilePath> files)
- {
- NotifyFilesChanged (files, false);
- }
-
- public static void NotifyFilesChanged (IEnumerable<FilePath> files, bool autoReload)
- {
- try {
- foreach (var fsFiles in files.GroupBy (f => GetFileSystemForPath (f, false)))
- fsFiles.Key.NotifyFilesChanged (fsFiles);
- OnFileChanged (new FileEventArgs (files, false, autoReload));
- } catch (Exception ex) {
- LoggingService.LogError ("File change notification failed", ex);
- }
- }
-
- public static void NotifyFileRemoved (string fileName)
- {
- NotifyFilesRemoved (new FilePath[] { fileName });
- }
-
- public static void NotifyFilesRemoved (IEnumerable<FilePath> files)
- {
- try {
- OnFileRemoved (new FileEventArgs (files, false));
- } catch (Exception ex) {
- LoggingService.LogError ("File remove notification failed", ex);
- }
- }
-
- internal static FileSystemExtension GetFileSystemForPath (string path, bool isDirectory)
- {
- Debug.Assert (!String.IsNullOrEmpty (path));
- FileSystemExtension nx = fileSystemChain;
- while (nx != null && !nx.CanHandlePath (path, isDirectory))
- nx = nx.Next;
- return nx;
- }
-
-/*
- readonly static char[] separators = { Path.DirectorySeparatorChar, Path.VolumeSeparatorChar, Path.AltDirectorySeparatorChar };
- public static string AbsoluteToRelativePath (string baseDirectoryPath, string absPath)
- {
- if (!Path.IsPathRooted (absPath))
- return absPath;
-
- absPath = Path.GetFullPath (absPath);
- baseDirectoryPath = Path.GetFullPath (baseDirectoryPath.TrimEnd (Path.DirectorySeparatorChar));
-
- string[] bPath = baseDirectoryPath.Split (separators);
- string[] aPath = absPath.Split (separators);
- int indx = 0;
-
- for (; indx < Math.Min (bPath.Length, aPath.Length); indx++) {
- if (!bPath[indx].Equals(aPath[indx]))
- break;
- }
-
- if (indx == 0)
- return absPath;
-
- StringBuilder result = new StringBuilder ();
-
- for (int i = indx; i < bPath.Length; i++) {
- result.Append ("..");
- if (i + 1 < bPath.Length || aPath.Length - indx > 0)
- result.Append (Path.DirectorySeparatorChar);
- }
-
-
- result.Append (String.Join(Path.DirectorySeparatorChar.ToString(), aPath, indx, aPath.Length - indx));
- if (result.Length == 0)
- return ".";
- return result.ToString ();
- }*/
-
- static bool IsSeparator (char ch)
- {
- return ch == Path.DirectorySeparatorChar || ch == Path.AltDirectorySeparatorChar || ch == Path.VolumeSeparatorChar;
- }
-
- public unsafe static string AbsoluteToRelativePath (string baseDirectoryPath, string absPath)
- {
- if (!Path.IsPathRooted (absPath) || string.IsNullOrEmpty (baseDirectoryPath))
- return absPath;
-
- absPath = GetFullPath (absPath);
- baseDirectoryPath = GetFullPath (baseDirectoryPath).TrimEnd (Path.DirectorySeparatorChar);
-
- fixed (char* bPtr = baseDirectoryPath, aPtr = absPath) {
- var bEnd = bPtr + baseDirectoryPath.Length;
- var aEnd = aPtr + absPath.Length;
- char* lastStartA = aEnd;
- char* lastStartB = bEnd;
-
- int indx = 0;
- // search common base path
- var a = aPtr;
- var b = bPtr;
- while (a < aEnd) {
- if (*a != *b)
- break;
- if (IsSeparator (*a)) {
- indx++;
- lastStartA = a + 1;
- lastStartB = b;
- }
- a++;
- b++;
- if (b >= bEnd) {
- if (a >= aEnd || IsSeparator (*a)) {
- indx++;
- lastStartA = a + 1;
- lastStartB = b;
- }
- break;
- }
- }
- if (indx == 0)
- return absPath;
-
- if (lastStartA >= aEnd)
- return ".";
-
- // handle case a: some/path b: some/path/deeper...
- if (a >= aEnd) {
- if (IsSeparator (*b)) {
- lastStartA = a + 1;
- lastStartB = b;
- }
- }
-
- // look how many levels to go up into the base path
- int goUpCount = 0;
- while (lastStartB < bEnd) {
- if (IsSeparator (*lastStartB))
- goUpCount++;
- lastStartB++;
- }
- var size = goUpCount * 2 + goUpCount + aEnd - lastStartA;
- var result = new char [size];
- fixed (char* rPtr = result) {
- // go paths up
- var r = rPtr;
- for (int i = 0; i < goUpCount; i++) {
- *(r++) = '.';
- *(r++) = '.';
- *(r++) = Path.DirectorySeparatorChar;
- }
- // copy the remaining absulute path
- while (lastStartA < aEnd)
- *(r++) = *(lastStartA++);
- }
- return new string (result);
- }
- }
-
- public static string RelativeToAbsolutePath (string baseDirectoryPath, string relPath)
- {
- return Path.GetFullPath (Path.Combine (baseDirectoryPath, relPath));
- }
-
- public static bool IsValidPath (string fileName)
- {
- if (String.IsNullOrEmpty (fileName) || fileName.Trim() == string.Empty)
- return false;
- if (fileName.IndexOfAny (FilePath.GetInvalidPathChars ()) >= 0)
- return false;
- return true;
- }
-
-
- public static bool IsValidFileName (string fileName)
- {
- if (String.IsNullOrEmpty (fileName) || fileName.Trim() == string.Empty)
- return false;
- if (fileName.IndexOfAny (FilePath.GetInvalidFileNameChars ()) >= 0)
- return false;
- return true;
- }
-
- public static bool IsDirectory (string filename)
- {
+ public static void DeleteFile (string fileName)
+ {
+ Debug.Assert (!String.IsNullOrEmpty (fileName));
+ try {
+ GetFileSystemForPath (fileName, false).DeleteFile (fileName);
+ } catch (Exception e) {
+ if (!HandleError (GettextCatalog.GetString ("Can't remove file {0}", fileName), e))
+ throw;
+ return;
+ }
+ OnFileRemoved (new FileEventArgs (fileName, false));
+ }
+
+ public static void DeleteDirectory (string path)
+ {
+ Debug.Assert (!String.IsNullOrEmpty (path));
+ try {
+ GetFileSystemForPath (path, true).DeleteDirectory (path);
+ } catch (Exception e) {
+ if (!HandleError (GettextCatalog.GetString ("Can't remove directory {0}", path), e))
+ throw;
+ return;
+ }
+ OnFileRemoved (new FileEventArgs (path, true));
+ }
+
+ public static void RenameFile (string oldName, string newName)
+ {
+ Debug.Assert (!String.IsNullOrEmpty (oldName));
+ Debug.Assert (!String.IsNullOrEmpty (newName));
+ if (Path.GetFileName (oldName) != newName) {
+ var newPath = ((FilePath)oldName).ParentDirectory.Combine (newName);
+ InternalRenameFile (oldName, newName);
+ OnFileRenamed (new FileCopyEventArgs (oldName, newPath, false));
+ }
+ }
+
+ public static void RenameDirectory (string oldName, string newName)
+ {
+ Debug.Assert (!String.IsNullOrEmpty (oldName));
+ Debug.Assert (!String.IsNullOrEmpty (newName));
+ if (Path.GetFileName (oldName) != newName) {
+ string newPath = Path.Combine (Path.GetDirectoryName (oldName), newName);
+ InternalMoveDirectory (oldName, newPath);
+ OnFileRenamed (new FileCopyEventArgs (oldName, newPath, true));
+ OnFileCreated (new FileEventArgs (newPath, false));
+ OnFileRemoved (new FileEventArgs (oldName, false));
+ }
+ }
+
+ public static void CopyFile (string srcFile, string dstFile)
+ {
+ Debug.Assert (!String.IsNullOrEmpty (srcFile));
+ Debug.Assert (!String.IsNullOrEmpty (dstFile));
+ GetFileSystemForPath (dstFile, false).CopyFile (srcFile, dstFile, true);
+ OnFileCopied (new FileCopyEventArgs (srcFile, dstFile, false));
+ OnFileCreated (new FileEventArgs (dstFile, false));
+ }
+
+ public static void MoveFile (string srcFile, string dstFile)
+ {
+ Debug.Assert (!String.IsNullOrEmpty (srcFile));
+ Debug.Assert (!String.IsNullOrEmpty (dstFile));
+ InternalMoveFile (srcFile, dstFile);
+ OnFileMoved (new FileCopyEventArgs (srcFile, dstFile, false));
+ OnFileCreated (new FileEventArgs (dstFile, false));
+ OnFileRemoved (new FileEventArgs (srcFile, false));
+ }
+
+ static void InternalMoveFile (string srcFile, string dstFile)
+ {
+ Debug.Assert (!String.IsNullOrEmpty (srcFile));
+ Debug.Assert (!String.IsNullOrEmpty (dstFile));
+ FileSystemExtension srcExt = GetFileSystemForPath (srcFile, false);
+ FileSystemExtension dstExt = GetFileSystemForPath (dstFile, false);
+
+ if (srcExt == dstExt) {
+ // Everything can be handled by the same file system
+ srcExt.MoveFile (srcFile, dstFile);
+ } else {
+ // If the file system of the source and dest files are
+ // different, decompose the Move operation into a Copy
+ // and Delete, so every file system can handle its part
+ dstExt.CopyFile (srcFile, dstFile, true);
+ srcExt.DeleteFile (srcFile);
+ }
+ }
+
+ static void InternalRenameFile (string srcFile, string newName)
+ {
+ Debug.Assert (!string.IsNullOrEmpty (srcFile));
+ Debug.Assert (!string.IsNullOrEmpty (newName));
+ FileSystemExtension srcExt = GetFileSystemForPath (srcFile, false);
+
+ srcExt.RenameFile (srcFile, newName);
+ }
+
+ public static void CreateDirectory (string path)
+ {
+ if (!Directory.Exists (path)) {
+ Debug.Assert (!String.IsNullOrEmpty (path));
+ GetFileSystemForPath (path, true).CreateDirectory (path);
+ OnFileCreated (new FileEventArgs (path, true));
+ }
+ }
+
+ public static void CopyDirectory (string srcPath, string dstPath)
+ {
+ Debug.Assert (!String.IsNullOrEmpty (srcPath));
+ Debug.Assert (!String.IsNullOrEmpty (dstPath));
+ GetFileSystemForPath (dstPath, true).CopyDirectory (srcPath, dstPath);
+ }
+
+ public static void MoveDirectory (string srcPath, string dstPath)
+ {
+ Debug.Assert (!String.IsNullOrEmpty (srcPath));
+ Debug.Assert (!String.IsNullOrEmpty (dstPath));
+ InternalMoveDirectory (srcPath, dstPath);
+ OnFileMoved (new FileCopyEventArgs (srcPath, dstPath, true));
+ OnFileCreated (new FileEventArgs (dstPath, true));
+ OnFileRemoved (new FileEventArgs (srcPath, true));
+ }
+
+ static void InternalMoveDirectory (string srcPath, string dstPath)
+ {
+ Debug.Assert (!String.IsNullOrEmpty (srcPath));
+ Debug.Assert (!String.IsNullOrEmpty (dstPath));
+ FileSystemExtension srcExt = GetFileSystemForPath (srcPath, true);
+ FileSystemExtension dstExt = GetFileSystemForPath (dstPath, true);
+
+ if (srcExt == dstExt) {
+ // Everything can be handled by the same file system
+ srcExt.MoveDirectory (srcPath, dstPath);
+ } else {
+ // If the file system of the source and dest files are
+ // different, decompose the Move operation into a Copy
+ // and Delete, so every file system can handle its part
+ dstExt.CopyDirectory (srcPath, dstPath);
+ srcExt.DeleteDirectory (srcPath);
+ }
+ }
+
+ public static FileWriteableState GetWriteableState (FilePath fileName)
+ {
+ Debug.Assert (!String.IsNullOrEmpty (fileName));
+ try {
+ return GetFileSystemForPath (fileName, false).GetWriteableState (fileName);
+ } catch (Exception ex) {
+ LoggingService.LogError ("File can't be written", ex);
+ return FileWriteableState.Unknown;
+ }
+ }
+
+ /// <summary>
+ /// Requests permission for modifying a file
+ /// </summary>
+ /// <param name="fileName">The file to be modified</param>
+ /// <param name="throwIfFails">If set to false, it will catch the exception that would've been thrown.</param>
+ /// <remarks>This method must be called before trying to write any file. It throws an exception if permission is not granted.</remarks>
+ public static bool RequestFileEdit (FilePath fileName, bool throwIfFails = true)
+ {
+ Debug.Assert (!String.IsNullOrEmpty (fileName));
+ try {
+ GetFileSystemForPath (fileName, false).RequestFileEdit (fileName);
+ return true;
+ } catch (Exception ex) {
+ if (throwIfFails)
+ throw;
+ LoggingService.LogError ("File can't be written", ex);
+ return false;
+ }
+ }
+
+
+ public static void NotifyFileChanged (FilePath fileName)
+ {
+ NotifyFileChanged (fileName, false);
+ }
+
+ public static void NotifyFileChanged (FilePath fileName, bool autoReload)
+ {
+ NotifyFilesChanged (new FilePath[] { fileName }, autoReload);
+ }
+
+ public static void NotifyFilesChanged (IEnumerable<FilePath> files)
+ {
+ NotifyFilesChanged (files, false);
+ }
+
+ public static void NotifyFilesChanged (IEnumerable<FilePath> files, bool autoReload)
+ {
+ try {
+ foreach (var fsFiles in files.GroupBy (f => GetFileSystemForPath (f, false)))
+ fsFiles.Key.NotifyFilesChanged (fsFiles);
+ OnFileChanged (new FileEventArgs (files, false, autoReload));
+ } catch (Exception ex) {
+ LoggingService.LogError ("File change notification failed", ex);
+ }
+ }
+
+ public static void NotifyFileRemoved (string fileName)
+ {
+ NotifyFilesRemoved (new FilePath[] { fileName });
+ }
+
+ public static void NotifyFilesRemoved (IEnumerable<FilePath> files)
+ {
+ try {
+ OnFileRemoved (new FileEventArgs (files, false));
+ } catch (Exception ex) {
+ LoggingService.LogError ("File remove notification failed", ex);
+ }
+ }
+
+ internal static FileSystemExtension GetFileSystemForPath (string path, bool isDirectory)
+ {
+ Debug.Assert (!String.IsNullOrEmpty (path));
+ FileSystemExtension nx = fileSystemChain;
+ while (nx != null && !nx.CanHandlePath (path, isDirectory))
+ nx = nx.Next;
+ return nx;
+ }
+
+/*
+ readonly static char[] separators = { Path.DirectorySeparatorChar, Path.VolumeSeparatorChar, Path.AltDirectorySeparatorChar };
+ public static string AbsoluteToRelativePath (string baseDirectoryPath, string absPath)
+ {
+ if (!Path.IsPathRooted (absPath))
+ return absPath;
+
+ absPath = Path.GetFullPath (absPath);
+ baseDirectoryPath = Path.GetFullPath (baseDirectoryPath.TrimEnd (Path.DirectorySeparatorChar));
+
+ string[] bPath = baseDirectoryPath.Split (separators);
+ string[] aPath = absPath.Split (separators);
+ int indx = 0;
+
+ for (; indx < Math.Min (bPath.Length, aPath.Length); indx++) {
+ if (!bPath[indx].Equals(aPath[indx]))
+ break;
+ }
+
+ if (indx == 0)
+ return absPath;
+
+ StringBuilder result = new StringBuilder ();
+
+ for (int i = indx; i < bPath.Length; i++) {
+ result.Append ("..");
+ if (i + 1 < bPath.Length || aPath.Length - indx > 0)
+ result.Append (Path.DirectorySeparatorChar);
+ }
+
+
+ result.Append (String.Join(Path.DirectorySeparatorChar.ToString(), aPath, indx, aPath.Length - indx));
+ if (result.Length == 0)
+ return ".";
+ return result.ToString ();
+ }*/
+
+ static bool IsSeparator (char ch)
+ {
+ return ch == Path.DirectorySeparatorChar || ch == Path.AltDirectorySeparatorChar || ch == Path.VolumeSeparatorChar;
+ }
+
+ static char ToOrdinalIgnoreCase (char c)
+ {
+ return (((uint) c - 'a') <= ((uint) 'z' - 'a')) ? (char) (c - 0x20) : c;
+ }
+
+ static bool PathCharsAreEqualCaseInsensitive (char a, char b)
+ {
+ a = ToOrdinalIgnoreCase (a);
+ b = ToOrdinalIgnoreCase (b);
+
+ return a == b;
+ }
+
+ static bool PathCharsAreEqualCaseSensitive (char a, char b)
+ {
+ return a == b;
+ }
+
+ public unsafe static string AbsoluteToRelativePath (string baseDirectoryPath, string absPath)
+ {
+ if (!Path.IsPathRooted (absPath) || string.IsNullOrEmpty (baseDirectoryPath))
+ return absPath;
+
+ absPath = GetFullPath (absPath);
+ baseDirectoryPath = GetFullPath (baseDirectoryPath).TrimEnd (Path.DirectorySeparatorChar);
+
+ fixed (char* bPtr = baseDirectoryPath, aPtr = absPath) {
+ var bEnd = bPtr + baseDirectoryPath.Length;
+ var aEnd = aPtr + absPath.Length;
+ char* lastStartA = aEnd;
+ char* lastStartB = bEnd;
+
+ int indx = 0;
+ // search common base path
+ var a = aPtr;
+ var b = bPtr;
+ while (a < aEnd) {
+ if (!PathCharsAreEqual (*a, *b))
+ break;
+ if (IsSeparator (*a)) {
+ indx++;
+ lastStartA = a + 1;
+ lastStartB = b;
+ }
+ a++;
+ b++;
+ if (b >= bEnd) {
+ if (a >= aEnd || IsSeparator (*a)) {
+ indx++;
+ lastStartA = a + 1;
+ lastStartB = b;
+ }
+ break;
+ }
+ }
+ if (indx == 0)
+ return absPath;
+
+ if (lastStartA >= aEnd)
+ return ".";
+
+ // handle case a: some/path b: some/path/deeper...
+ if (a >= aEnd) {
+ if (IsSeparator (*b)) {
+ lastStartA = a + 1;
+ lastStartB = b;
+ }
+ }
+
+ // look how many levels to go up into the base path
+ int goUpCount = 0;
+ while (lastStartB < bEnd) {
+ if (IsSeparator (*lastStartB))
+ goUpCount++;
+ lastStartB++;
+ }
+ var size = goUpCount * 2 + goUpCount + aEnd - lastStartA;
+ var result = new char [size];
+ fixed (char* rPtr = result) {
+ // go paths up
+ var r = rPtr;
+ for (int i = 0; i < goUpCount; i++) {
+ *(r++) = '.';
+ *(r++) = '.';
+ *(r++) = Path.DirectorySeparatorChar;
+ }
+ // copy the remaining absulute path
+ while (lastStartA < aEnd)
+ *(r++) = *(lastStartA++);
+ }
+ return new string (result);
+ }
+ }
+
+ public static string RelativeToAbsolutePath (string baseDirectoryPath, string relPath)
+ {
+ return Path.GetFullPath (Path.Combine (baseDirectoryPath, relPath));
+ }
+
+ public static bool IsValidPath (string fileName)
+ {
+ if (String.IsNullOrEmpty (fileName) || fileName.Trim() == string.Empty)
+ return false;
+ if (fileName.IndexOfAny (FilePath.GetInvalidPathChars ()) >= 0)
+ return false;
+ return true;
+ }
+
+
+ public static bool IsValidFileName (string fileName)
+ {
+ if (String.IsNullOrEmpty (fileName) || fileName.Trim() == string.Empty)
+ return false;
+ if (fileName.IndexOfAny (FilePath.GetInvalidFileNameChars ()) >= 0)
+ return false;
+ return true;
+ }
+
+ public static bool IsDirectory (string filename)
+ {
return Directory.Exists (filename);
- }
-
- public static string GetFullPath (string path)
- {
- if (path == null)
- throw new ArgumentNullException ("path");
- if (!Platform.IsWindows || path.IndexOf ('*') == -1)
- return Path.GetFullPath (path);
- else {
- // On Windows, GetFullPath doesn't work if the path contains wildcards.
- path = path.Replace ("*", wildcardMarker);
- path = Path.GetFullPath (path);
- return path.Replace (wildcardMarker, "*");
- }
- }
-
- static readonly string wildcardMarker = "_" + Guid.NewGuid ().ToString () + "_";
-
- public static string CreateTempDirectory ()
- {
- Random rnd = new Random ();
- string result;
- while (true) {
- result = Path.Combine (Path.GetTempPath (), "mdTmpDir" + rnd.Next ());
- if (!Directory.Exists (result))
- break;
- }
- Directory.CreateDirectory (result);
- return result;
- }
-
- public static string NormalizeRelativePath (string path)
- {
- string result = path.Trim (Path.DirectorySeparatorChar, ' ');
- while (result.StartsWith ("." + Path.DirectorySeparatorChar)) {
- result = result.Substring (2);
- result = result.Trim (Path.DirectorySeparatorChar);
- }
- return result == "." ? "" : result;
- }
-
- // Atomic rename of a file. It does not fire events.
- public static void SystemRename (string sourceFile, string destFile)
- {
- if (string.IsNullOrEmpty (sourceFile))
- throw new ArgumentException ("sourceFile");
-
- if (string.IsNullOrEmpty (destFile))
- throw new ArgumentException ("destFile");
-
- //FIXME: use the atomic System.IO.File.Replace on NTFS
- if (Platform.IsWindows) {
- string wtmp = null;
- if (File.Exists (destFile)) {
- do {
- wtmp = Path.Combine (Path.GetTempPath (), Guid.NewGuid ().ToString ());
- } while (File.Exists (wtmp));
-
- File.Move (destFile, wtmp);
- }
- try {
- File.Move (sourceFile, destFile);
- }
- catch {
- try {
- if (wtmp != null)
- File.Move (wtmp, destFile);
- }
- catch {
- wtmp = null;
- }
- throw;
- }
- finally {
- if (wtmp != null) {
- try {
- File.Delete (wtmp);
- }
- catch { }
- }
- }
- }
- else {
- if (Syscall.rename (sourceFile, destFile) != 0) {
- switch (Stdlib.GetLastError ()) {
- case Errno.EACCES:
- case Errno.EPERM:
- throw new UnauthorizedAccessException ();
- case Errno.EINVAL:
- throw new InvalidOperationException ();
- case Errno.ENOTDIR:
- throw new DirectoryNotFoundException ();
- case Errno.ENOENT:
- throw new FileNotFoundException ();
- case Errno.ENAMETOOLONG:
- throw new PathTooLongException ();
- default:
- throw new IOException ();
- }
- }
- }
- }
-
- /// <summary>
- /// Renames a directory
- /// </summary>
- /// <param name="sourceDir">Source directory</param>
- /// <param name="destDir">Destination directory</param>
- /// <remarks>
- /// It works like Directory.Move, but it supports changing the case of a directory name in case-insensitive file systems
- /// </remarks>
- public static void SystemDirectoryRename (string sourceDir, string destDir)
- {
- if (Directory.Exists (destDir) && string.Equals (Path.GetFullPath (sourceDir), Path.GetFullPath (destDir), StringComparison.CurrentCultureIgnoreCase)) {
- // If the destination directory exists but we can't find it with the provided name casing, then it means we are just changing the case
- var existingDir = Directory.GetDirectories (Path.GetDirectoryName (destDir), Path.GetFileName (destDir)).FirstOrDefault ();
- if (existingDir == null || (Path.GetFileName (existingDir) == Path.GetFileName (sourceDir))) {
- var temp = destDir + ".renaming";
- int n = 0;
- while (Directory.Exists (temp) || File.Exists (temp))
- temp = destDir + ".renaming_" + (n++);
- Directory.Move (sourceDir, temp);
- try {
- Directory.Move (temp, destDir);
- } catch {
- Directory.Move (temp, sourceDir);
- }
- return;
- }
- }
- Directory.Move (sourceDir, destDir);
- }
-
- /// <summary>
- /// Removes the directory if it's empty.
- /// </summary>
- public static void RemoveDirectoryIfEmpty (string directory)
- {
- // HACK: we should use EnumerateFiles but it's broken in some Mono releases
- // https://bugzilla.xamarin.com/show_bug.cgi?id=2975
- if (Directory.Exists (directory) && !Directory.GetFiles (directory).Any ())
- Directory.Delete (directory);
- }
-
- /// <summary>
- /// Makes the path separators native.
- /// </summary>
- public static string MakePathSeparatorsNative (string path)
- {
- if (string.IsNullOrEmpty (path))
- return path;
- char c = Path.DirectorySeparatorChar == '\\'? '/' : '\\';
- return path.Replace (c, Path.DirectorySeparatorChar);
- }
-
- static bool HandleError (string message, Exception ex)
- {
- return errorHandler != null ? errorHandler (message, ex) : false;
- }
-
- public static FileServiceErrorHandler ErrorHandler {
- get { return errorHandler; }
- set { errorHandler = value; }
- }
-
- public static void FreezeEvents ()
- {
- eventQueue.Freeze ();
- }
-
- public static void ThawEvents ()
- {
- eventQueue.Thaw ();
- }
-
- public static event EventHandler<FileEventArgs> FileCreated;
- static void OnFileCreated (FileEventArgs args)
- {
- foreach (FileEventInfo fi in args) {
- if (fi.IsDirectory)
- Counters.DirectoriesCreated++;
- else
- Counters.FilesCreated++;
- }
-
- eventQueue.RaiseEvent (() => FileCreated, args);
- }
-
- public static event EventHandler<FileCopyEventArgs> FileCopied;
- static void OnFileCopied (FileCopyEventArgs args)
- {
- eventQueue.RaiseEvent (() => FileCopied, args);
- }
-
- public static event EventHandler<FileCopyEventArgs> FileMoved;
- static void OnFileMoved (FileCopyEventArgs args)
- {
- eventQueue.RaiseEvent (() => FileMoved, args);
- }
-
- public static event EventHandler<FileCopyEventArgs> FileRenamed;
- static void OnFileRenamed (FileCopyEventArgs args)
- {
- foreach (FileCopyEventInfo fi in args) {
- if (fi.IsDirectory)
- Counters.DirectoriesRenamed++;
- else
- Counters.FilesRenamed++;
- }
-
- eventQueue.RaiseEvent (() => FileRenamed, args);
- }
-
- public static event EventHandler<FileEventArgs> FileRemoved;
- static void OnFileRemoved (FileEventArgs args)
- {
- foreach (FileEventInfo fi in args) {
- if (fi.IsDirectory)
- Counters.DirectoriesRemoved++;
- else
- Counters.FilesRemoved++;
- }
-
- eventQueue.RaiseEvent (() => FileRemoved, args);
- }
-
- public static event EventHandler<FileEventArgs> FileChanged;
- static void OnFileChanged (FileEventArgs args)
- {
- Counters.FileChangeNotifications++;
- eventQueue.RaiseEvent (() => FileChanged, null, args);
- }
-
- public static Task<bool> UpdateDownloadedCacheFile (string url, string cacheFile,
+ }
+
+ public static string GetFullPath (string path)
+ {
+ if (path == null)
+ throw new ArgumentNullException ("path");
+ if (!Platform.IsWindows || path.IndexOf ('*') == -1)
+ return Path.GetFullPath (path);
+ else {
+ // On Windows, GetFullPath doesn't work if the path contains wildcards.
+ path = path.Replace ("*", wildcardMarker);
+ path = Path.GetFullPath (path);
+ return path.Replace (wildcardMarker, "*");
+ }
+ }
+
+ static readonly string wildcardMarker = "_" + Guid.NewGuid ().ToString () + "_";
+
+ public static string CreateTempDirectory ()
+ {
+ Random rnd = new Random ();
+ string result;
+ while (true) {
+ result = Path.Combine (Path.GetTempPath (), "mdTmpDir" + rnd.Next ());
+ if (!Directory.Exists (result))
+ break;
+ }
+ Directory.CreateDirectory (result);
+ return result;
+ }
+
+ public static string NormalizeRelativePath (string path)
+ {
+ string result = path.Trim (Path.DirectorySeparatorChar, ' ');
+ while (result.StartsWith ("." + Path.DirectorySeparatorChar)) {
+ result = result.Substring (2);
+ result = result.Trim (Path.DirectorySeparatorChar);
+ }
+ return result == "." ? "" : result;
+ }
+
+ // Atomic rename of a file. It does not fire events.
+ public static void SystemRename (string sourceFile, string destFile)
+ {
+ if (string.IsNullOrEmpty (sourceFile))
+ throw new ArgumentException ("sourceFile");
+
+ if (string.IsNullOrEmpty (destFile))
+ throw new ArgumentException ("destFile");
+
+ //FIXME: use the atomic System.IO.File.Replace on NTFS
+ if (Platform.IsWindows) {
+ string wtmp = null;
+ if (File.Exists (destFile)) {
+ do {
+ wtmp = Path.Combine (Path.GetTempPath (), Guid.NewGuid ().ToString ());
+ } while (File.Exists (wtmp));
+
+ File.Move (destFile, wtmp);
+ }
+ try {
+ File.Move (sourceFile, destFile);
+ }
+ catch {
+ try {
+ if (wtmp != null)
+ File.Move (wtmp, destFile);
+ }
+ catch {
+ wtmp = null;
+ }
+ throw;
+ }
+ finally {
+ if (wtmp != null) {
+ try {
+ File.Delete (wtmp);
+ }
+ catch { }
+ }
+ }
+ }
+ else {
+ if (Syscall.rename (sourceFile, destFile) != 0) {
+ switch (Stdlib.GetLastError ()) {
+ case Errno.EACCES:
+ case Errno.EPERM:
+ throw new UnauthorizedAccessException ();
+ case Errno.EINVAL:
+ throw new InvalidOperationException ();
+ case Errno.ENOTDIR:
+ throw new DirectoryNotFoundException ();
+ case Errno.ENOENT:
+ throw new FileNotFoundException ();
+ case Errno.ENAMETOOLONG:
+ throw new PathTooLongException ();
+ default:
+ throw new IOException ();
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Renames a directory
+ /// </summary>
+ /// <param name="sourceDir">Source directory</param>
+ /// <param name="destDir">Destination directory</param>
+ /// <remarks>
+ /// It works like Directory.Move, but it supports changing the case of a directory name in case-insensitive file systems
+ /// </remarks>
+ public static void SystemDirectoryRename (string sourceDir, string destDir)
+ {
+ if (Directory.Exists (destDir) && string.Equals (Path.GetFullPath (sourceDir), Path.GetFullPath (destDir), StringComparison.CurrentCultureIgnoreCase)) {
+ // If the destination directory exists but we can't find it with the provided name casing, then it means we are just changing the case
+ var existingDir = Directory.GetDirectories (Path.GetDirectoryName (destDir), Path.GetFileName (destDir)).FirstOrDefault ();
+ if (existingDir == null || (Path.GetFileName (existingDir) == Path.GetFileName (sourceDir))) {
+ var temp = destDir + ".renaming";
+ int n = 0;
+ while (Directory.Exists (temp) || File.Exists (temp))
+ temp = destDir + ".renaming_" + (n++);
+ Directory.Move (sourceDir, temp);
+ try {
+ Directory.Move (temp, destDir);
+ } catch {
+ Directory.Move (temp, sourceDir);
+ }
+ return;
+ }
+ }
+ Directory.Move (sourceDir, destDir);
+ }
+
+ /// <summary>
+ /// Removes the directory if it's empty.
+ /// </summary>
+ public static void RemoveDirectoryIfEmpty (string directory)
+ {
+ // HACK: we should use EnumerateFiles but it's broken in some Mono releases
+ // https://bugzilla.xamarin.com/show_bug.cgi?id=2975
+ if (Directory.Exists (directory) && !Directory.GetFiles (directory).Any ())
+ Directory.Delete (directory);
+ }
+
+ /// <summary>
+ /// Makes the path separators native.
+ /// </summary>
+ public static string MakePathSeparatorsNative (string path)
+ {
+ if (string.IsNullOrEmpty (path))
+ return path;
+ char c = Path.DirectorySeparatorChar == '\\'? '/' : '\\';
+ return path.Replace (c, Path.DirectorySeparatorChar);
+ }
+
+ static bool HandleError (string message, Exception ex)
+ {
+ return errorHandler != null ? errorHandler (message, ex) : false;
+ }
+
+ public static FileServiceErrorHandler ErrorHandler {
+ get { return errorHandler; }
+ set { errorHandler = value; }
+ }
+
+ public static void FreezeEvents ()
+ {
+ eventQueue.Freeze ();
+ }
+
+ public static void ThawEvents ()
+ {
+ eventQueue.Thaw ();
+ }
+
+ public static event EventHandler<FileEventArgs> FileCreated;
+ static void OnFileCreated (FileEventArgs args)
+ {
+ foreach (FileEventInfo fi in args) {
+ if (fi.IsDirectory)
+ Counters.DirectoriesCreated++;
+ else
+ Counters.FilesCreated++;
+ }
+
+ eventQueue.RaiseEvent (() => FileCreated, args);
+ }
+
+ public static event EventHandler<FileCopyEventArgs> FileCopied;
+ static void OnFileCopied (FileCopyEventArgs args)
+ {
+ eventQueue.RaiseEvent (() => FileCopied, args);
+ }
+
+ public static event EventHandler<FileCopyEventArgs> FileMoved;
+ static void OnFileMoved (FileCopyEventArgs args)
+ {
+ eventQueue.RaiseEvent (() => FileMoved, args);
+ }
+
+ public static event EventHandler<FileCopyEventArgs> FileRenamed;
+ static void OnFileRenamed (FileCopyEventArgs args)
+ {
+ foreach (FileCopyEventInfo fi in args) {
+ if (fi.IsDirectory)
+ Counters.DirectoriesRenamed++;
+ else
+ Counters.FilesRenamed++;
+ }
+
+ eventQueue.RaiseEvent (() => FileRenamed, args);
+ }
+
+ public static event EventHandler<FileEventArgs> FileRemoved;
+ static void OnFileRemoved (FileEventArgs args)
+ {
+ foreach (FileEventInfo fi in args) {
+ if (fi.IsDirectory)
+ Counters.DirectoriesRemoved++;
+ else
+ Counters.FilesRemoved++;
+ }
+
+ eventQueue.RaiseEvent (() => FileRemoved, args);
+ }
+
+ public static event EventHandler<FileEventArgs> FileChanged;
+ static void OnFileChanged (FileEventArgs args)
+ {
+ Counters.FileChangeNotifications++;
+ eventQueue.RaiseEvent (() => FileChanged, null, args);
+ }
+
+ public static Task<bool> UpdateDownloadedCacheFile (string url, string cacheFile,
Func<Stream,bool> validateDownload = null, CancellationToken ct = default (CancellationToken))
- {
+ {
return WebRequestHelper.GetResponseAsync (
() => (HttpWebRequest)WebRequest.Create (url),
r => {
- //check to see if the online file has been modified since it was last downloaded
- var localNewsXml = new FileInfo (cacheFile);
- if (localNewsXml.Exists)
+ //check to see if the online file has been modified since it was last downloaded
+ var localNewsXml = new FileInfo (cacheFile);
+ if (localNewsXml.Exists)
r.IfModifiedSince = localNewsXml.LastWriteTime;
},
ct
).ContinueWith (t => {
bool deleteTempFile = true;
var tempFile = cacheFile + ".temp";
-
- try {
+
+ try {
ct.ThrowIfCancellationRequested ();
if (t.IsFaulted) {
@@ -749,10 +774,10 @@ namespace MonoDevelop.Core
//TODO: limit this size in case open wifi hotspots provide junk data
var response = t.Result;
- if (response.StatusCode == HttpStatusCode.OK) {
- using (var fs = File.Create (tempFile))
+ if (response.StatusCode == HttpStatusCode.OK) {
+ using (var fs = File.Create (tempFile))
response.GetResponseStream ().CopyTo (fs, 2048);
- }
+ }
//check the document is valid, might get bad ones from wifi hotspots etc
if (validateDownload != null) {
@@ -768,108 +793,108 @@ namespace MonoDevelop.Core
if (!validated) {
throw new Exception ("Failed to validate downloaded file");
}
- }
- }
-
+ }
+ }
+
ct.ThrowIfCancellationRequested ();
-
+
SystemRename (tempFile, cacheFile);
deleteTempFile = false;
return true;
} finally {
if (deleteTempFile) {
- try {
+ try {
File.Delete (tempFile);
- } catch (Exception ex) {
+ } catch (Exception ex) {
LoggingService.LogError ("Failed to delete temp download file", ex);
- }
- }
- }
+ }
+ }
+ }
}, ct);
- }
- }
-
- class EventQueue
- {
- class EventData
- {
- public Func<Delegate> Delegate;
- public object ThisObject;
- public EventArgs Args;
- }
-
- List<EventData> events = new List<EventData> ();
-
- int frozen;
- object defaultSourceObject;
-
- public EventQueue ()
- {
- }
-
- public EventQueue (object defaultSourceObject)
- {
- this.defaultSourceObject = defaultSourceObject;
- }
-
- public void Freeze ()
- {
- lock (events) {
- frozen++;
- }
- }
-
- public void Thaw ()
- {
- List<EventData> pendingEvents = null;
- lock (events) {
- if (--frozen == 0) {
- pendingEvents = events;
- events = new List<EventData> ();
- }
- }
- if (pendingEvents != null) {
- for (int n=0; n<pendingEvents.Count; n++) {
- EventData ev = pendingEvents [n];
- Delegate del = ev.Delegate ();
- if (ev.Args is IEventArgsChain) {
- EventData next = n < pendingEvents.Count - 1 ? pendingEvents [n + 1] : null;
- if (next != null && (next.Args.GetType() == ev.Args.GetType ()) && next.Delegate() == del && next.ThisObject == ev.ThisObject) {
- ((IEventArgsChain)next.Args).MergeWith ((IEventArgsChain)ev.Args);
- continue;
- }
- }
- if (del != null)
- del.DynamicInvoke (ev.ThisObject, ev.Args);
- }
- }
- }
-
- public void RaiseEvent (Func<Delegate> d, EventArgs args)
- {
- RaiseEvent (d, defaultSourceObject, args);
- }
-
- public void RaiseEvent (Func<Delegate> d, object thisObj, EventArgs args)
- {
- Delegate del = d ();
- lock (events) {
- if (frozen > 0) {
- EventData ed = new EventData ();
- ed.Delegate = d;
- ed.ThisObject = thisObj;
- ed.Args = args;
- events.Add (ed);
- return;
- }
- }
- if (del != null) {
- Runtime.MainSynchronizationContext.Post (delegate {
- del.DynamicInvoke (thisObj, args);
- }, null);
- }
- }
- }
-
- public delegate bool FileServiceErrorHandler (string message, Exception ex);
-}
+ }
+ }
+
+ class EventQueue
+ {
+ class EventData
+ {
+ public Func<Delegate> Delegate;
+ public object ThisObject;
+ public EventArgs Args;
+ }
+
+ List<EventData> events = new List<EventData> ();
+
+ int frozen;
+ object defaultSourceObject;
+
+ public EventQueue ()
+ {
+ }
+
+ public EventQueue (object defaultSourceObject)
+ {
+ this.defaultSourceObject = defaultSourceObject;
+ }
+
+ public void Freeze ()
+ {
+ lock (events) {
+ frozen++;
+ }
+ }
+
+ public void Thaw ()
+ {
+ List<EventData> pendingEvents = null;
+ lock (events) {
+ if (--frozen == 0) {
+ pendingEvents = events;
+ events = new List<EventData> ();
+ }
+ }
+ if (pendingEvents != null) {
+ for (int n=0; n<pendingEvents.Count; n++) {
+ EventData ev = pendingEvents [n];
+ Delegate del = ev.Delegate ();
+ if (ev.Args is IEventArgsChain) {
+ EventData next = n < pendingEvents.Count - 1 ? pendingEvents [n + 1] : null;
+ if (next != null && (next.Args.GetType() == ev.Args.GetType ()) && next.Delegate() == del && next.ThisObject == ev.ThisObject) {
+ ((IEventArgsChain)next.Args).MergeWith ((IEventArgsChain)ev.Args);
+ continue;
+ }
+ }
+ if (del != null)
+ del.DynamicInvoke (ev.ThisObject, ev.Args);
+ }
+ }
+ }
+
+ public void RaiseEvent (Func<Delegate> d, EventArgs args)
+ {
+ RaiseEvent (d, defaultSourceObject, args);
+ }
+
+ public void RaiseEvent (Func<Delegate> d, object thisObj, EventArgs args)
+ {
+ Delegate del = d ();
+ lock (events) {
+ if (frozen > 0) {
+ EventData ed = new EventData ();
+ ed.Delegate = d;
+ ed.ThisObject = thisObj;
+ ed.Args = args;
+ events.Add (ed);
+ return;
+ }
+ }
+ if (del != null) {
+ Runtime.MainSynchronizationContext.Post (delegate {
+ del.DynamicInvoke (thisObj, args);
+ }, null);
+ }
+ }
+ }
+
+ public delegate bool FileServiceErrorHandler (string message, Exception ex);
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FileWriteableState.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FileWriteableState.cs
new file mode 100644
index 0000000000..249ef410de
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FileWriteableState.cs
@@ -0,0 +1,52 @@
+//
+// FileWriteableState.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+namespace MonoDevelop.Core
+{
+ public enum FileWriteableState {
+ Unknown,
+ /// <summary>
+ /// File can be written
+ /// </summary>
+ Writeable,
+
+ /// <summary>
+ /// File is read only but can be made writeable
+ /// </summary>
+ ReadOnly,
+
+ /// <summary>
+ /// File is locked it can't be written to.
+ /// </summary>
+ Locked,
+
+ /// <summary>
+ /// File wasn't found
+ /// </summary>
+ NotExistant
+ }
+
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Gettext.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Gettext.cs
index db19326ea8..c022562ca3 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Gettext.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Gettext.cs
@@ -28,32 +28,32 @@
using System;
using System.IO;
-
-using Mono.Unix;
-using System.Globalization;
-using System.Runtime.InteropServices;
-using System.Threading;
-
-namespace MonoDevelop.Core
-{
- public static class GettextCatalog
- {
- static Thread mainThread;
-
- [DllImport ("kernel32.dll", SetLastError = true)]
- static extern int SetThreadUILanguage (int LangId);
+
+using Mono.Unix;
+using System.Globalization;
+using System.Runtime.InteropServices;
+using System.Threading;
+
+namespace MonoDevelop.Core
+{
+ public static class GettextCatalog
+ {
+ static Thread mainThread;
+
+ [DllImport ("kernel32.dll", SetLastError = true)]
+ static extern int SetThreadUILanguage (int LangId);
const int LOCALE_CUSTOM_UNSPECIFIED = 4096;
-
- static GettextCatalog ()
- {
- mainThread = Thread.CurrentThread;
-
- //variable can be used to override where Gettext looks for the catalogues
- string catalog = Environment.GetEnvironmentVariable ("MONODEVELOP_LOCALE_PATH");
-
- // Set the user defined language
- string lang = PropertyService.Get ("MonoDevelop.Ide.UserInterfaceLanguage", "");
+
+ static GettextCatalog ()
+ {
+ mainThread = Thread.CurrentThread;
+
+ //variable can be used to override where Gettext looks for the catalogues
+ string catalog = Environment.GetEnvironmentVariable ("MONODEVELOP_LOCALE_PATH");
+
+ // Set the user defined language
+ string lang = Runtime.Preferences.UserInterfaceLanguage;
if (!string.IsNullOrEmpty (lang)) {
if (Platform.IsWindows) {
lang = lang.Replace("_", "-");
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/IApplication.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/IApplication.cs
index 112ee738f9..47bddf2009 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/IApplication.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/IApplication.cs
@@ -24,12 +24,13 @@ using Mono.Addins;
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+using System.Threading.Tasks;
namespace MonoDevelop.Core
{
public interface IApplication
{
- int Run (string[] arguments);
+ Task<int> Run (string[] arguments);
}
public class ApplicationExtensionAttribute: CustomExtensionAttribute
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/IAsyncOperation.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/IAsyncOperation.cs
deleted file mode 100644
index 214e9d7203..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/IAsyncOperation.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// IAsyncOperation.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-
-namespace MonoDevelop.Core
-{
- public delegate void OperationHandler (IAsyncOperation op);
-
- public interface IAsyncOperation
- {
- void Cancel ();
- void WaitForCompleted ();
- bool IsCompleted { get; }
- bool Success { get; }
- bool SuccessWithWarnings { get; }
-
- event OperationHandler Completed;
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/IProgressMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/IProgressMonitor.cs
index f8a056ab73..8f728d8422 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/IProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/IProgressMonitor.cs
@@ -29,36 +29,58 @@
using System;
using System.IO;
+using System.Threading;
+using System.Threading.Tasks;
+using MonoDevelop.Core.ProgressMonitoring;
namespace MonoDevelop.Core
{
- public delegate void MonitorHandler (IProgressMonitor monitor);
+ public delegate void MonitorHandler (ProgressMonitor monitor);
- public interface IProgressMonitor: IDisposable
+ public interface IProgressMonitorFactory
{
- void BeginTask (string name, int totalWork);
- void BeginStepTask (string name, int totalWork, int stepSize);
- void EndTask ();
- void Step (int work);
-
- TextWriter Log { get; }
-
- void ReportWarning (string message);
-
- void ReportSuccess (string message);
- void ReportError (string message, Exception exception);
-
- bool IsCancelRequested { get; }
- event MonitorHandler CancelRequested;
-
- // The returned IAsyncOperation object must be thread safe
- IAsyncOperation AsyncOperation { get; }
-
- object SyncRoot { get; }
+ ProgressMonitor CreateProgressMonitor ();
}
-
- public interface IProgressMonitorFactory
+
+ public class AsyncOperation
+ {
+ public static AsyncOperation CompleteOperation = new AsyncOperation (Task.FromResult(0), null);
+
+ protected AsyncOperation ()
+ {
+ Task = Task.FromResult (0);
+ CancellationTokenSource = new CancellationTokenSource ();
+ }
+
+ public AsyncOperation (Task task, CancellationTokenSource cancellationTokenSource)
+ {
+ Task = task;
+ this.CancellationTokenSource = cancellationTokenSource ?? new CancellationTokenSource ();
+ }
+
+ public Task Task { get; protected set; }
+
+ protected CancellationTokenSource CancellationTokenSource { get; set; }
+
+ public bool IsCompleted {
+ get { return Task.IsCompleted; }
+ }
+
+ public void Cancel ()
+ {
+ if (CancellationTokenSource != null)
+ CancellationTokenSource.Cancel ();
+ }
+ }
+
+ public class AsyncOperation<T>: AsyncOperation
{
- IProgressMonitor CreateProgressMonitor ();
+ public AsyncOperation (Task<T> task, CancellationTokenSource cancellationTokenSource): base (task, cancellationTokenSource)
+ {
+ }
+
+ public new Task<T> Task {
+ get { return (Task<T>) base.Task; }
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs
index bda363cc1d..eecba00c21 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs
@@ -530,7 +530,7 @@ namespace MonoDevelop.Core
public static void LogError (string message, Exception ex)
{
- LogUserError (message, ex);
+ Log (LogLevel.Error, message + (ex != null? Environment.NewLine + ex : string.Empty));
}
[Obsolete ("Use LogError")]
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/ProgressMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/ProgressMonitor.cs
new file mode 100644
index 0000000000..6aea01f2ce
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/ProgressMonitor.cs
@@ -0,0 +1,791 @@
+//
+// ProgressMonitor.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using System.IO;
+using System.Threading;
+using MonoDevelop.Core.ProgressMonitoring;
+using System.Collections.Generic;
+using System.Text;
+
+namespace MonoDevelop.Core
+{
+ public class ProgressMonitor: IDisposable
+ {
+ ProgressTask currentTask;
+ ProgressTask parentRootTask;
+ ProgressTask rootTask;
+ bool disposed;
+
+ LogTextWriter logWriter;
+ LogTextWriter errorLogWriter;
+ TextWriter customLogWriter;
+ TextWriter customErrorLogWriter;
+
+ LogChunk firstCachedLogChunk;
+ LogChunk lastCachedLogChunk;
+
+ class LogChunk
+ {
+ public bool IsError;
+ public StringBuilder Log = new StringBuilder ();
+ public LogChunk Next;
+ }
+
+ int openStepWork = -1;
+ ProgressMonitor parentMonitor;
+ SynchronizationContext context;
+
+ internal bool ReportGlobalDataToParent { get; set; }
+
+ List<ProgressError> errors = new List<ProgressError> ();
+ List<string> warnings = new List<string> ();
+ List<string> messages = new List<string> ();
+
+ List<ProgressMonitor> followerMonitors;
+ List<Action> disposeCallbacks;
+ object localLock = new object ();
+
+ public ProgressMonitor (): this (null, null)
+ {
+ }
+
+ public ProgressMonitor (SynchronizationContext context): this (context, null)
+ {
+ }
+
+ public ProgressMonitor (CancellationTokenSource cancellationTokenSource): this (null, cancellationTokenSource)
+ {
+ }
+
+ public ProgressMonitor (SynchronizationContext context, CancellationTokenSource cancellationTokenSource)
+ {
+ this.cancellationTokenSource = cancellationTokenSource;
+ this.context = context;
+ logWriter = new LogTextWriter ();
+ logWriter.TextWritten += DoWriteLog;
+
+ errorLogWriter = new LogTextWriter ();
+ errorLogWriter.TextWritten += DoWriteErrorLog;
+ }
+
+ public ProgressMonitor WithCancellationSource (CancellationTokenSource cancellationTokenSource)
+ {
+ return new AggregatedProgressMonitor (this, cancellationTokenSource);
+ }
+
+ public ProgressMonitor WithCancellationToken (CancellationToken cancellationToken)
+ {
+ var ct = new CancellationTokenSource ();
+ var cr = cancellationToken.Register (ct.Cancel);
+ RegisterDisposeCallback (cr.Dispose);
+ return new AggregatedProgressMonitor (this, ct);
+ }
+
+ void RegisterDisposeCallback (Action action)
+ {
+ lock (localLock) {
+ if (disposeCallbacks == null)
+ disposeCallbacks = new List<Action> ();
+ disposeCallbacks.Add (action);
+ }
+ }
+
+ void SetParentTask (ProgressMonitor parent, ProgressTask task, int work)
+ {
+ parentMonitor = parent;
+ currentTask = parentRootTask = task;
+ openStepWork = work;
+ ReportGlobalDataToParent = true;
+ }
+
+ public virtual void Dispose ()
+ {
+ if (disposed)
+ return;
+ disposed = true;
+
+ if (parentMonitor != null && firstCachedLogChunk != null) {
+ parentMonitor.DumpLog (firstCachedLogChunk);
+ firstCachedLogChunk = null;
+ }
+
+ var t = parentRootTask;
+ parentRootTask = null;
+ while (currentTask != t && currentTask != null)
+ EndTask ();
+
+ if (context != null)
+ context.Post ((o) => OnCompleted (), null);
+ else
+ OnCompleted ();
+
+ if (followerMonitors != null) {
+ foreach (var m in followerMonitors)
+ m.Dispose ();
+ }
+ if (disposeCallbacks != null) {
+ foreach (var c in disposeCallbacks.ToArray ())
+ c ();
+ disposeCallbacks = null;
+ }
+ }
+
+ protected void AddFollowerMonitor (ProgressMonitor monitor)
+ {
+ if (followerMonitors == null)
+ followerMonitors = new List<ProgressMonitor> ();
+ followerMonitors.Add (monitor);
+ logWriter.ChainWriter (monitor.Log);
+ errorLogWriter.ChainWriter (monitor.ErrorLog);
+ }
+
+ protected void RemoveFollowerMonitor (ProgressMonitor monitor)
+ {
+ if (followerMonitors == null)
+ return;
+ followerMonitors.Remove (monitor);
+ logWriter.UnchainWriter (monitor.Log);
+ errorLogWriter.UnchainWriter (monitor.ErrorLog);
+ }
+
+ public ProgressTask CurrentTask {
+ get {
+ var t = currentTask;
+ while (t != null && t.Name == null)
+ t = t.ParentTask;
+ return t;
+ }
+ }
+
+ public string CurrentTaskName {
+ get {
+ var t = CurrentTask;
+ return t != null ? t.Name ?? "" : "";
+ }
+ }
+
+ public IEnumerable<ProgressTask> GetRootTasks ()
+ {
+ var t = rootTask;
+ if (t.Name != null)
+ return new [] {t};
+ return t.GetChildrenTasks ();
+ }
+
+ public IDisposable BeginTask (string name, int totalWork)
+ {
+ var t = new ProgressTask (this, name, totalWork);
+ if (openStepWork != -1) {
+ t.StepWork = openStepWork;
+ openStepWork = -1;
+ }
+ if (currentTask == null)
+ rootTask = t;
+ else
+ currentTask.AddChild (t);
+
+ currentTask = t;
+
+ // if (name != null) {
+ if (context != null)
+ context.Post ((o) => OnBeginTask (name, totalWork, t.StepWork), null);
+ else
+ OnBeginTask (name, totalWork, t.StepWork);
+ // }
+
+ ReportProgressChanged ();
+
+ if (followerMonitors != null) {
+ foreach (var m in followerMonitors)
+ m.BeginTask (name, totalWork);
+ }
+ return t;
+ }
+
+ public void BeginTask (int totalWork)
+ {
+ BeginTask (null, totalWork);
+ }
+
+ public void EndTask ()
+ {
+ if (currentTask != null && currentTask != parentRootTask) {
+ openStepWork = -1;
+ var t = currentTask;
+ currentTask = t.ParentTask;
+ if (currentTask == null)
+ rootTask = null;
+ t.SetComplete ();
+ // if (t.Name != null) {
+ if (context != null)
+ context.Post ((o) => OnEndTask (t.Name, t.TotalWork, t.StepWork), null);
+ else
+ OnEndTask (t.Name, t.TotalWork, t.StepWork);
+ // }
+ } else
+ LoggingService.LogError ("Task not started");
+
+ ReportProgressChanged ();
+
+ if (followerMonitors != null) {
+ foreach (var m in followerMonitors)
+ m.EndTask ();
+ }
+ }
+
+ internal void EndTask (ProgressTask task)
+ {
+ while (currentTask != null && currentTask != task)
+ EndTask ();
+ EndTask ();
+ }
+
+ public void Step (int work = 1)
+ {
+ Step (null, work);
+ }
+
+ public void Step (string message, int work = 1)
+ {
+ if (currentTask == null) {
+ LoggingService.LogError ("Task not started in progress monitor");
+ return;
+ }
+ if (work < 0)
+ work = 0;
+
+ ConsumePendingWork ();
+ currentTask.Step (message, work);
+
+ if (context != null)
+ context.Post ((o) => {
+ OnStep (message, work);
+ ReportProgressChanged ();
+ }, null);
+ else {
+ OnStep (message, work);
+ ReportProgressChanged ();
+ }
+
+ if (followerMonitors != null) {
+ foreach (var m in followerMonitors)
+ m.Step (message, work);
+ }
+ }
+
+ public void BeginStep (int work = 1)
+ {
+ BeginStep (null, work);
+ }
+
+ public void BeginStep (string message, int work = 1)
+ {
+ if (currentTask == null)
+ throw new InvalidOperationException ("Task not started in progress monitor");
+ if (work < 0)
+ throw new ArgumentException ("work can't be negative");
+
+ ConsumePendingWork ();
+
+ openStepWork = work;
+ if (message != null)
+ currentTask.Step (message, 0);
+
+ if (context != null)
+ context.Post ((o) => {
+ OnBeginStep (message, work);
+ ReportProgressChanged ();
+ }, null);
+ else {
+ OnBeginStep (message, work);
+ ReportProgressChanged ();
+ }
+
+ if (followerMonitors != null) {
+ foreach (var m in followerMonitors)
+ m.BeginStep (message, work);
+ }
+ }
+
+ public void EndStep ()
+ {
+ ConsumePendingWork ();
+
+ if (followerMonitors != null) {
+ foreach (var m in followerMonitors)
+ m.EndStep ();
+ }
+ }
+
+ void ConsumePendingWork ()
+ {
+ if (openStepWork != -1) {
+ currentTask.Step (null, openStepWork);
+ openStepWork = -1;
+ }
+ }
+
+ public ProgressMonitor BeginAsyncStep (int work)
+ {
+ return BeginAsyncStep (null, work);
+ }
+
+ public ProgressMonitor BeginAsyncStep (string message, int work)
+ {
+ if (currentTask == null)
+ throw new InvalidOperationException ("Task not started in progress monitor");
+ if (work < 0)
+ throw new ArgumentException ("work can't be negative");
+
+ ConsumePendingWork ();
+ if (message != null)
+ currentTask.Step (message, 0);
+
+ ProgressMonitor m = null;
+ if (context != null)
+ context.Send ((o) => m = CreateAsyncStepMonitor (), null);
+ else
+ m = CreateAsyncStepMonitor ();
+
+ m.SetParentTask (this, currentTask, work);
+
+ if (context != null) {
+ context.Post ((o) => {
+ OnBeginAsyncStep (message, work, m);
+ ReportProgressChanged ();
+ }, null);
+ } else {
+ OnBeginAsyncStep (message, work, m);
+ ReportProgressChanged ();
+ }
+
+ if (followerMonitors != null) {
+ foreach (var sm in followerMonitors)
+ m.AddFollowerMonitor (sm.BeginAsyncStep (message, work));
+ }
+ return m;
+ }
+
+ public void ReportWarning (string message)
+ {
+ if (ReportGlobalDataToParent && parentMonitor != null)
+ parentMonitor.ReportWarning (message);
+ lock (warnings)
+ warnings.Add (message);
+
+ if (context != null)
+ context.Post ((o) => OnWarningReported (message), null);
+ else
+ OnWarningReported (message);
+
+ if (followerMonitors != null) {
+ foreach (var sm in followerMonitors)
+ sm.ReportWarning (message);
+ }
+ }
+
+ public void ReportSuccess (string message)
+ {
+ if (ReportGlobalDataToParent && parentMonitor != null)
+ parentMonitor.ReportSuccess (message);
+ lock (messages)
+ messages.Add (message);
+
+ if (context != null)
+ context.Post ((o) => OnSuccessReported (message), null);
+ else
+ OnSuccessReported (message);
+
+ if (followerMonitors != null) {
+ foreach (var sm in followerMonitors)
+ sm.ReportSuccess (message);
+ }
+ }
+
+ public void ReportError (string message, Exception exception = null)
+ {
+ if (ReportGlobalDataToParent && parentMonitor != null)
+ parentMonitor.ReportError (message, exception);
+ else if (exception != null)
+ LoggingService.LogError (message, exception);
+
+ var msg = message;
+ if (message == null && exception != null)
+ msg = exception.Message;
+
+ lock (errors)
+ errors.Add (new ProgressError (msg, exception));
+
+ if (context != null)
+ context.Post ((o) => OnErrorReported (msg, exception), null);
+ else
+ OnErrorReported (msg, exception);
+
+ if (followerMonitors != null) {
+ foreach (var sm in followerMonitors)
+ sm.ReportError (message, exception);
+ }
+ }
+
+ public bool HasErrors {
+ get {
+ lock (errors)
+ return errors.Count > 0;
+ }
+ }
+
+ public bool HasWarnings {
+ get {
+ lock (warnings)
+ return warnings.Count > 0;
+ }
+ }
+
+ public string[] SuccessMessages {
+ get {
+ lock (messages)
+ return messages.ToArray ();
+ }
+ }
+
+ public string[] Warnings {
+ get {
+ lock (warnings)
+ return warnings.ToArray ();
+ }
+ }
+
+ public ProgressError[] Errors {
+ get {
+ lock (errors)
+ return errors.ToArray ();
+ }
+ }
+
+ public TextWriter Log {
+ get {
+ return logWriter;
+ }
+ protected set {
+ if (parentMonitor != null)
+ throw new InvalidOperationException ("Log writter can't be modified");
+ if (customLogWriter != null)
+ logWriter.UnchainWriter (customLogWriter);
+ customLogWriter = value;
+ logWriter.ChainWriter (customLogWriter);
+ }
+ }
+
+ public TextWriter ErrorLog {
+ get {
+ return errorLogWriter ?? Log;
+ }
+ protected set {
+ if (parentMonitor != null)
+ throw new InvalidOperationException ("Log writter can't be modified");
+ if (customErrorLogWriter != null)
+ errorLogWriter.UnchainWriter (customErrorLogWriter);
+ customErrorLogWriter = value;
+ errorLogWriter.ChainWriter (customErrorLogWriter);
+ }
+ }
+
+ public CancellationToken CancellationToken {
+ get {
+ if (parentMonitor != null)
+ return parentMonitor.CancellationToken;
+ else
+ return CancellationTokenSource.Token;
+ }
+ }
+
+ public double Progress {
+ get {
+ return rootTask != null ? rootTask.Progress : 0;
+ }
+ }
+
+ public bool ProgressIsUnknown {
+ get {
+ return rootTask == null;
+ }
+ }
+
+ CancellationTokenSource cancellationTokenSource;
+
+ protected CancellationTokenSource CancellationTokenSource {
+ get {
+ if (cancellationTokenSource == null)
+ cancellationTokenSource = new CancellationTokenSource ();
+ return cancellationTokenSource;
+ } set {
+ cancellationTokenSource = value;
+ }
+ }
+
+ protected virtual void OnBeginTask (string name, int totalWork, int stepWork)
+ {
+ }
+
+ protected virtual void OnEndTask (string name, int totalWork, int stepWork)
+ {
+ }
+
+ protected virtual void OnStep (string message, int work)
+ {
+ }
+
+ protected virtual void OnBeginStep (string message, int work)
+ {
+ }
+
+ protected virtual void OnBeginAsyncStep (string message, int work, ProgressMonitor stepMonitor)
+ {
+ }
+
+ protected virtual ProgressMonitor CreateAsyncStepMonitor ()
+ {
+ return new ProgressMonitor ();
+ }
+
+ protected virtual void OnSuccessReported (string message)
+ {
+ }
+
+ protected virtual void OnWarningReported (string message)
+ {
+ }
+
+ protected virtual void OnErrorReported (string message, Exception exception)
+ {
+ }
+
+ void DumpLog (LogChunk logChain)
+ {
+ if (context != null)
+ context.Post (o => {
+ while (logChain != null) {
+ if (logChain.IsError)
+ DoWriteErrorLog (logChain.Log.ToString ());
+ else
+ DoWriteLog (logChain.Log.ToString ());
+ logChain = logChain.Next;
+ }
+ }, null);
+ else {
+ while (logChain != null) {
+ if (logChain.IsError)
+ DoWriteErrorLog (logChain.Log.ToString ());
+ else
+ DoWriteLog (logChain.Log.ToString ());
+ logChain = logChain.Next;
+ }
+ }
+ }
+
+ void DoWriteLog (string message)
+ {
+ if (ReportGlobalDataToParent && parentMonitor != null)
+ AppendLog (message, false);
+ OnWriteLog (message);
+ }
+
+ void DoWriteErrorLog (string message)
+ {
+ if (ReportGlobalDataToParent && parentMonitor != null)
+ AppendLog (message, true);
+ OnWriteErrorLog (message);
+ }
+
+ void AppendLog (string message, bool error)
+ {
+ if (firstCachedLogChunk == null)
+ firstCachedLogChunk = lastCachedLogChunk = new LogChunk { IsError = error };
+ else if (lastCachedLogChunk.IsError != error) {
+ var newChunk = new LogChunk { IsError = error };
+ lastCachedLogChunk.Next = newChunk;
+ lastCachedLogChunk = newChunk;
+ }
+ lastCachedLogChunk.Log.Append (message);
+ }
+
+ protected virtual void OnWriteLog (string message)
+ {
+ }
+
+ protected virtual void OnWriteErrorLog (string message)
+ {
+ }
+
+ internal void ReportProgressChanged ()
+ {
+ if (context != null)
+ context.Post ((o) => OnProgressChanged (), null);
+ else
+ OnProgressChanged ();
+
+ if (parentMonitor != null)
+ parentMonitor.ReportProgressChanged ();
+ }
+
+ protected virtual void OnProgressChanged ()
+ {
+ }
+
+ protected virtual void OnCompleted ()
+ {
+ }
+ }
+
+ public class ProgressTask: IDisposable
+ {
+ List<ProgressTask> childrenTasks = new List<ProgressTask> ();
+
+ double currentWork;
+ double completedChildrenWork;
+ ProgressMonitor monitor;
+
+ internal ProgressTask (ProgressMonitor monitor, string name, int totalWork)
+ {
+ this.monitor = monitor;
+ Name = name;
+ TotalWork = totalWork;
+ StepWork = -1;
+ }
+
+ public int StepWork { get; set; }
+
+ bool HasStepWork {
+ get { return StepWork != -1; }
+ }
+
+ public string Name { get; private set; }
+
+ public double Progress { get; private set; }
+
+ public string StatusMessage { get; internal set; }
+
+ public int TotalWork { get; private set; }
+
+ public ProgressTask ParentTask { get; private set; }
+
+ public ProgressTask[] GetChildrenTasks ()
+ {
+ List<ProgressTask> children = new List<ProgressTask> ();
+ lock (childrenTasks) {
+ foreach (var t in childrenTasks) {
+ if (t.Name == null)
+ children.AddRange (t.GetChildrenTasks ());
+ else
+ children.Add (t);
+ }
+ }
+ return children.ToArray ();
+ }
+
+ internal void AddChild (ProgressTask task)
+ {
+ task.ParentTask = this;
+ lock (childrenTasks)
+ childrenTasks.Add (task);
+ }
+
+ internal void Step (string message, double work)
+ {
+ if (message != null)
+ StatusMessage = message;
+
+ IncCurrentWork (work);
+ }
+
+ internal void SetComplete ()
+ {
+ lock (childrenTasks) {
+ currentWork = TotalWork;
+ completedChildrenWork = 0;
+ Progress = 1;
+ if (ParentTask != null)
+ ParentTask.SetChildComplete (this);
+ }
+ }
+
+ void SetChildComplete (ProgressTask child)
+ {
+ child.ParentTask = null;
+ lock (childrenTasks) {
+ if (child.HasStepWork)
+ currentWork += child.StepWork;
+ childrenTasks.Remove (child);
+ }
+ UpdateProgressFromChildren ();
+ }
+
+ void IncCurrentWork (double work)
+ {
+ lock (childrenTasks) {
+ currentWork += work;
+ Progress = Math.Min (currentWork + completedChildrenWork, (double)TotalWork) / (double)TotalWork;
+ if (ParentTask != null && HasStepWork)
+ ParentTask.UpdateProgressFromChildren ();
+ }
+ }
+
+ void UpdateProgressFromChildren ()
+ {
+ lock (childrenTasks) {
+ completedChildrenWork = childrenTasks.Where (t => t.HasStepWork).Sum (t => t.Progress * (double)t.StepWork);
+ IncCurrentWork (0);
+ }
+ }
+
+ void IDisposable.Dispose ()
+ {
+ monitor.EndTask (this);
+ }
+ }
+
+ public class ProgressError
+ {
+ Exception ex;
+ string message;
+
+ public ProgressError (string message, Exception ex)
+ {
+ this.ex = ex;
+ this.message = message;
+ }
+
+ public string Message {
+ get { return message; }
+ }
+
+ public Exception Exception {
+ get { return ex; }
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Properties.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Properties.cs
index 2c35989714..ad6d6b54ba 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Properties.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Properties.cs
@@ -28,7 +28,7 @@
using System;
using System.Collections.Generic;
-using System.ComponentModel;
+using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
@@ -37,17 +37,18 @@ using System.Xml;
using System.Xml.Serialization;
using MonoDevelop.Core;
+using System.Collections.Immutable;
namespace MonoDevelop.Core
{
public class Properties : ICustomXmlSerializer
{
- Dictionary<string, object> properties = new Dictionary<string, object> ();
- Dictionary<string, object> defaultValues = new Dictionary<string, object> ();
- Dictionary<Type, TypeConverter> cachedConverters = new Dictionary<Type, TypeConverter> ();
+ ImmutableDictionary<string, object> properties = ImmutableDictionary<string, object>.Empty;
+ ImmutableDictionary<string, object> defaultValues = ImmutableDictionary<string, object>.Empty;
+ ImmutableDictionary<Type, TypeConverter> cachedConverters = ImmutableDictionary<Type, TypeConverter>.Empty;
Dictionary<string,EventHandler<PropertyChangedEventArgs>> propertyListeners;
- public ICollection<string> Keys {
+ public IEnumerable<string> Keys {
get {
return properties.Keys;
}
@@ -66,19 +67,19 @@ namespace MonoDevelop.Core
return (T) o;
TypeConverter converter = GetConverter (typeof(T));
-
- if (o is string) {
- try {
- return (T)converter.ConvertFromInvariantString (o.ToString ());
- } catch (Exception) {
- return default(T);
+
+ if (o is string) {
+ try {
+ return (T)converter.ConvertFromInvariantString (o.ToString ());
+ } catch (Exception) {
+ return default(T);
}
}
- try {
- return (T)converter.ConvertFrom (o);
- } catch (Exception) {
- return default(T);
+ try {
+ return (T)converter.ConvertFrom (o);
+ } catch (Exception) {
+ return default(T);
}
}
@@ -87,26 +88,26 @@ namespace MonoDevelop.Core
if (o == null)
return null;
TypeConverter converter = GetConverter (o.GetType ());
- return converter.ConvertToInvariantString (o);
+ return converter.ConvertToInvariantString (o);
}
TypeConverter GetConverter (Type type)
{
TypeConverter converter;
- if (!cachedConverters.TryGetValue (type, out converter)) {
+ if (!cachedConverters.TryGetValue (type, out converter)) {
converter = TypeDescriptor.GetConverter (type);
- cachedConverters [type] = converter;
+ cachedConverters = cachedConverters.SetItem (type, converter);
}
return converter;
}
public T Get<T> (string property, T defaultValue)
{
- defaultValues[property] = defaultValue;
+ defaultValues = defaultValues.SetItem (property, defaultValue);
object val;
if (GetPropertyValue<T> (property, out val))
return Convert<T> (val);
- properties[property] = defaultValue;
+ properties = properties.SetItem (property, defaultValue);
return defaultValue;
}
@@ -127,7 +128,7 @@ namespace MonoDevelop.Core
// Deserialize the data and store it in the dictionary, so
// following calls return the same object
val = ((LazyXmlDeserializer)val).Deserialize<T> ();
- properties[property] = val;
+ properties = properties.SetItem (property, val);
}
return true;
} else {
@@ -149,16 +150,16 @@ namespace MonoDevelop.Core
if (old == null)
return;
if (properties.ContainsKey (key))
- properties.Remove (key);
+ properties = properties.Remove (key);
} else {
//avoid emitting the event if not necessary
if (val.Equals (old))
return;
- properties[key] = val;
+ properties = properties.SetItem (key, val);
if (!val.GetType ().IsClass ||(val is string)) {
if (defaultValues.ContainsKey (key)) {
if (defaultValues[key] == val)
- properties.Remove (key);
+ properties = properties.Remove (key);
}
}
}
@@ -239,14 +240,14 @@ namespace MonoDevelop.Core
}
//write out the new state to a temp file
- try {
- using (XmlTextWriter writer = new XmlTextWriter (tempFileName, System.Text.Encoding.UTF8)) {
- writer.Formatting = Formatting.Indented;
- writer.WriteStartElement (PropertiesRootNode);
- writer.WriteAttributeString (PropertiesVersionAttribute, PropertiesVersion);
- Write (writer, false);
- writer.WriteEndElement (); // PropertiesRootNode
- }
+ try {
+ using (XmlTextWriter writer = new XmlTextWriter (tempFileName, System.Text.Encoding.UTF8)) {
+ writer.Formatting = Formatting.Indented;
+ writer.WriteStartElement (PropertiesRootNode);
+ writer.WriteAttributeString (PropertiesVersionAttribute, PropertiesVersion);
+ Write (writer, false);
+ writer.WriteEndElement (); // PropertiesRootNode
+ }
//write was successful (no exception)
//so move the file to the real location, overwriting the old file
@@ -355,7 +356,7 @@ namespace MonoDevelop.Core
public Properties Clone ()
{
Properties result = new Properties ();
- result.properties = new Dictionary<string, object> (properties);
+ result.properties = properties;
return result;
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/PropertyBag.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/PropertyBag.cs
index 453ef5ad2a..6d561994a4 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/PropertyBag.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/PropertyBag.cs
@@ -33,22 +33,41 @@ using System.Collections.Generic;
using MonoDevelop.Core.Serialization;
using System.Text;
using System.Globalization;
+using System.Collections.Immutable;
namespace MonoDevelop.Core
{
[DataItem ("Properties")]
- public class PropertyBag: ICustomDataItem, IDisposable
+ public sealed class PropertyBag: ICustomDataItem, IDisposable
{
- Dictionary<string,object> properties;
+ ImmutableDictionary<string,object> properties = ImmutableDictionary<string,object>.Empty;
DataContext context;
string sourceFile;
-
+ bool isShared;
+
+ class DataNodeInfo
+ {
+ public DataNode DataNode;
+ public object Object;
+ }
+
public PropertyBag()
{
}
+ void AssertMainThread ()
+ {
+ if (isShared)
+ Runtime.AssertMainThread ();
+ }
+
+ public void SetShared ()
+ {
+ isShared = true;
+ }
+
public bool IsEmpty {
- get { return properties == null || properties.Count == 0; }
+ get { return properties.Count == 0; }
}
public T GetValue<T> ()
@@ -63,18 +82,7 @@ namespace MonoDevelop.Core
public T GetValue<T> (string name, DataContext ctx)
{
- if (properties != null) {
- object val;
- if (properties.TryGetValue (name, out val)) {
- if (val is DataNode) {
- val = Deserialize (name, (DataNode) val, typeof(T), ctx ?? context);
- properties [name] = val;
- OnChanged (name);
- }
- return (T) val;
- }
- }
- return default (T);
+ return GetValue<T> (name, default(T), ctx);
}
public T GetValue<T> (string name, T defaultValue)
@@ -87,9 +95,13 @@ namespace MonoDevelop.Core
if (properties != null) {
object val;
if (properties.TryGetValue (name, out val)) {
- if (val is DataNode) {
- val = Deserialize (name, (DataNode) val, typeof(T), ctx ?? context);
- properties [name] = val;
+ var di = val as DataNodeInfo;
+ if (di != null) {
+ if (di.Object == null) {
+ di.Object = Deserialize (name, di.DataNode, typeof(T), ctx ?? context);
+ di.DataNode = null;
+ }
+ val = di.Object;
}
return (T) val;
}
@@ -104,9 +116,8 @@ namespace MonoDevelop.Core
public void SetValue<T> (string name, T value)
{
- if (properties == null)
- properties = new Dictionary<string,object> ();
- properties [name] = value;
+ AssertMainThread ();
+ properties = properties.SetItem (name, value);
OnChanged (name);
}
@@ -117,12 +128,15 @@ namespace MonoDevelop.Core
public bool RemoveValue (string name)
{
- if (properties != null && properties.Remove (name)) {
- OnChanged (name);
- return true;
- }
+ AssertMainThread ();
+ var cc = properties.Count;
+
+ properties = properties.Remove (name);
+ if (cc == properties.Count)
+ return false;
- return false;
+ OnChanged (name);
+ return true;
}
public bool HasValue<T> ()
@@ -132,7 +146,7 @@ namespace MonoDevelop.Core
public bool HasValue (string name)
{
- return properties != null && properties.ContainsKey (name);
+ return properties.ContainsKey (name);
}
public event EventHandler<PropertyBagChangedEventArgs> Changed;
@@ -147,14 +161,13 @@ namespace MonoDevelop.Core
public void Dispose ()
{
- if (properties != null) {
- foreach (object ob in properties.Values) {
- IDisposable disp = ob as IDisposable;
- if (disp != null)
- disp.Dispose ();
- }
- properties = null;
+ AssertMainThread ();
+ foreach (object ob in properties.Values) {
+ IDisposable disp = ob as IDisposable;
+ if (disp != null)
+ disp.Dispose ();
}
+ properties = properties.Clear ();
}
object Deserialize (string name, DataNode node, Type type, DataContext ctx)
@@ -198,6 +211,14 @@ namespace MonoDevelop.Core
}
else if (entry.Value is DataNode) {
val = (DataNode) entry.Value;
+ } else if (entry.Value is DataNodeInfo) {
+ var di = (DataNodeInfo)entry.Value;
+ if (di.DataNode != null)
+ val = di.DataNode;
+ else if (di.Object != null) {
+ val = handler.SerializationContext.Serializer.Serialize (di.Object, di.Object.GetType ());
+ } else
+ continue;
} else {
val = handler.SerializationContext.Serializer.Serialize (entry.Value, entry.Value.GetType ());
}
@@ -212,12 +233,12 @@ namespace MonoDevelop.Core
if (data.Count == 0)
return;
- properties = new Dictionary<string,object> ();
+ properties = ImmutableDictionary<string,object>.Empty;
context = handler.SerializationContext.Serializer.DataContext;
sourceFile = handler.SerializationContext.BaseFile;
foreach (DataNode nod in data) {
if (nod.Name != "ctype")
- properties [UnescapeName (nod.Name)] = nod;
+ properties = properties.SetItem (UnescapeName (nod.Name), new DataNodeInfo { DataNode = nod });
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/PropertyService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/PropertyService.cs
index 282b03f585..eb34904ede 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/PropertyService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/PropertyService.cs
@@ -39,18 +39,11 @@ namespace MonoDevelop.Core
/// <summary>
/// The Property wrapper wraps a global property service value as an easy to use object.
/// </summary>
- public class PropertyWrapper<T>
+ public abstract class ConfigurationProperty<T>
{
- T value;
- readonly string propertyName;
-
public T Value {
- get {
- return value;
- }
- set {
- Set (value);
- }
+ get { return OnGetValue (); }
+ set { OnSetValue (value); }
}
/// <summary>
@@ -64,40 +57,79 @@ namespace MonoDevelop.Core
/// </returns>
public bool Set (T newValue)
{
- if (!object.Equals (this.value, newValue)) {
- this.value = newValue;
- PropertyService.Set (propertyName, value);
- OnChanged (EventArgs.Empty);
- return true;
+ return OnSetValue (newValue);
+ }
+
+ public static implicit operator T (ConfigurationProperty<T> watch)
+ {
+ return watch.Value;
+ }
+
+ protected abstract T OnGetValue ();
+
+ protected abstract bool OnSetValue (T value);
+
+ protected void OnChanged ()
+ {
+ var handler = this.Changed;
+ if (handler != null)
+ handler (this, EventArgs.Empty);
+ }
+
+ public event EventHandler Changed;
+ }
+
+ class CoreConfigurationProperty<T>: ConfigurationProperty<T>
+ {
+ T value;
+ string propertyName;
+
+ public CoreConfigurationProperty (string name, T defaultValue, string oldName = null)
+ {
+ this.propertyName = name;
+ if (PropertyService.HasValue (name)) {
+ value = PropertyService.Get<T> (name);
+ return;
+ } else if (!string.IsNullOrEmpty (oldName)) {
+ if (PropertyService.HasValue (oldName)) {
+ value = PropertyService.Get<T> (oldName);
+ PropertyService.Set (name, value);
+ return;
+ }
}
- return false;
+ value = defaultValue;
}
- public PropertyWrapper (string propertyName, T defaultValue)
+ protected override T OnGetValue ()
{
- this.propertyName = propertyName;
- value = PropertyService.Get (propertyName, defaultValue);
+ return value;
}
- public static implicit operator T (PropertyWrapper<T> watch)
+ protected override bool OnSetValue (T value)
{
- return watch.value;
+ if (!object.Equals (this.value, value)) {
+ this.value = value;
+ PropertyService.Set (propertyName, value);
+ OnChanged ();
+ return true;
+ }
+ return false;
}
+ }
- protected virtual void OnChanged (EventArgs e)
+ public abstract class ConfigurationProperty
+ {
+ public static ConfigurationProperty<T> Create<T> (string propertyName, T defaultValue, string oldName = null)
{
- EventHandler handler = this.Changed;
- if (handler != null)
- handler (this, e);
+ return new CoreConfigurationProperty<T> (propertyName, defaultValue, oldName);
}
- public event EventHandler Changed;
}
public static class PropertyService
{
- public static PropertyWrapper<T> Wrap<T> (string property, T defaultValue)
+ public static ConfigurationProperty<T> Wrap<T> (string property, T defaultValue)
{
- return new PropertyWrapper<T> (property, defaultValue);
+ return new CoreConfigurationProperty<T> (property, defaultValue);
}
//force the static class to intialize
@@ -168,8 +200,10 @@ namespace MonoDevelop.Core
UserDataMigrationService.SetMigrationSource (migratableProfile, migrateVersion);
properties.PropertyChanged += delegate(object sender, PropertyChangedEventArgs args) {
- if (PropertyChanged != null)
- PropertyChanged (sender, args);
+ Runtime.RunInMainThread (() => {
+ if (PropertyChanged != null)
+ PropertyChanged (sender, args);
+ });
};
Counters.PropertyServiceInitialization.EndTiming ();
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs
index fa4f97eb9b..5db30ff3e2 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs
@@ -41,7 +41,7 @@ using MonoDevelop.Core.Setup;
using System.Security.Cryptography.X509Certificates;
using System.Net.Security;
using System.Net;
-using MonoDevelop.Core.Web;
+using System.Threading.Tasks;
using System.Collections.Generic;
@@ -55,6 +55,9 @@ namespace MonoDevelop.Core
static ApplicationService applicationService;
static bool initialized;
static SynchronizationContext mainSynchronizationContext;
+ static SynchronizationContext defaultSynchronizationContext;
+ static RuntimePreferences preferences = new RuntimePreferences ();
+ static Thread mainThread;
public static void GetAddinRegistryLocation (out string configDir, out string addinsDir, out string databaseDir)
{
@@ -81,10 +84,15 @@ namespace MonoDevelop.Core
SetupInstrumentation ();
Platform.Initialize ();
-
+
+ mainThread = Thread.CurrentThread;
// Set a default sync context
- if (SynchronizationContext.Current == null)
- SynchronizationContext.SetSynchronizationContext (new SynchronizationContext ());
+ if (SynchronizationContext.Current == null) {
+ defaultSynchronizationContext = new SynchronizationContext ();
+ SynchronizationContext.SetSynchronizationContext (defaultSynchronizationContext);
+ } else
+ defaultSynchronizationContext = SynchronizationContext.Current;
+
// Hook up the SSL certificate validation codepath
ServicePointManager.ServerCertificateValidationCallback += delegate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) {
@@ -183,7 +191,7 @@ namespace MonoDevelop.Core
static void SetupInstrumentation ()
{
- InstrumentationService.Enabled = PropertyService.Get ("MonoDevelop.EnableInstrumentation", false);
+ InstrumentationService.Enabled = Runtime.Preferences.EnableInstrumentation;
if (InstrumentationService.Enabled) {
LoggingService.LogInfo ("Instrumentation Service started");
try {
@@ -193,9 +201,7 @@ namespace MonoDevelop.Core
LoggingService.LogError ("Instrumentation service could not be published", ex);
}
}
- PropertyService.AddPropertyHandler ("MonoDevelop.EnableInstrumentation", delegate {
- InstrumentationService.Enabled = PropertyService.Get ("MonoDevelop.EnableInstrumentation", false);
- });
+ Runtime.Preferences.EnableInstrumentation.Changed += (s,e) => InstrumentationService.Enabled = Runtime.Preferences.EnableInstrumentation;
}
static void OnLoadError (object s, AddinErrorEventArgs args)
@@ -262,6 +268,10 @@ namespace MonoDevelop.Core
return applicationService;
}
}
+
+ public static RuntimePreferences Preferences {
+ get { return preferences; }
+ }
static Version version;
@@ -282,13 +292,153 @@ namespace MonoDevelop.Core
public static SynchronizationContext MainSynchronizationContext {
get {
- return mainSynchronizationContext ?? SynchronizationContext.Current;
+ return mainSynchronizationContext ?? defaultSynchronizationContext;
}
set {
if (mainSynchronizationContext != null && value != null)
throw new InvalidOperationException ("The main synchronization context has already been set");
mainSynchronizationContext = value;
+ taskScheduler = null;
+ }
+ }
+
+
+ static TaskScheduler taskScheduler;
+ public static TaskScheduler MainTaskScheduler {
+ get {
+ if (taskScheduler == null)
+ RunInMainThread (() => taskScheduler = TaskScheduler.FromCurrentSynchronizationContext ()).Wait ();
+ return taskScheduler;
+ }
+ }
+
+ /// <summary>
+ /// Runs an action in the main thread (usually the UI thread). The method returns a task, so it can be awaited.
+ /// </summary>
+ public static Task RunInMainThread (Action action)
+ {
+ var ts = new TaskCompletionSource<int> ();
+ if (IsMainThread) {
+ try {
+ action ();
+ ts.SetResult (0);
+ } catch (Exception ex) {
+ ts.SetException (ex);
+ }
+ } else {
+ MainSynchronizationContext.Post (delegate {
+ try {
+ action ();
+ ts.SetResult (0);
+ } catch (Exception ex) {
+ ts.SetException (ex);
+ }
+ }, null);
}
+ return ts.Task;
+ }
+
+ /// <summary>
+ /// Runs a function in the main thread (usually the UI thread). The method returns a task, so it can be awaited.
+ /// </summary>
+ public static Task<T> RunInMainThread<T> (Func<T> func)
+ {
+ var ts = new TaskCompletionSource<T> ();
+ if (IsMainThread) {
+ try {
+ ts.SetResult (func ());
+ } catch (Exception ex) {
+ ts.SetException (ex);
+ }
+ } else {
+ MainSynchronizationContext.Post (delegate {
+ try {
+ ts.SetResult (func ());
+ } catch (Exception ex) {
+ ts.SetException (ex);
+ }
+ }, null);
+ }
+ return ts.Task;
+ }
+
+ /// <summary>
+ /// Runs an action in the main thread (usually the UI thread). The method returns a task, so it can be awaited.
+ /// </summary>
+ /// <remarks>This version of the method is useful when the operation to be executed in the main
+ /// thread is asynchronous.</remarks>
+ public static Task<T> RunInMainThread<T> (Func<Task<T>> func)
+ {
+ if (IsMainThread) {
+ return func ();
+ } else {
+ var ts = new TaskCompletionSource<T> ();
+ MainSynchronizationContext.Post (delegate {
+ try {
+ var t = func ();
+ t.ContinueWith (ta => {
+ try {
+ ts.SetResult (ta.Result);
+ } catch (Exception ex) {
+ ts.SetException (ex);
+ }
+ });
+ } catch (Exception ex) {
+ ts.SetException (ex);
+ }
+ }, null);
+ return ts.Task;
+ }
+ }
+
+ /// <summary>
+ /// Runs an action in the main thread (usually the UI thread). The method returns a task, so it can be awaited.
+ /// </summary>
+ /// <remarks>This version of the method is useful when the operation to be executed in the main
+ /// thread is asynchronous.</remarks>
+ public static Task RunInMainThread (Func<Task> func)
+ {
+ if (IsMainThread) {
+ return func ();
+ } else {
+ var ts = new TaskCompletionSource<int> ();
+ MainSynchronizationContext.Post (delegate {
+ try {
+ var t = func ();
+ t.ContinueWith (ta => {
+ try {
+ ts.SetResult (0);
+ } catch (Exception ex) {
+ ts.SetException (ex);
+ }
+ });
+ } catch (Exception ex) {
+ ts.SetException (ex);
+ }
+ }, null);
+ return ts.Task;
+ }
+ }
+
+ /// <summary>
+ /// Returns true if current thread is GUI thread.
+ /// </summary>
+ public static bool IsMainThread
+ {
+ // TODO: This logic should probably change to:
+ // Compare types, because instances can change (using SynchronizationContext.CreateCopy).
+ // if (SynchronizationContext.Current.GetType () != MainSynchronizationContext.GetType ())
+ // once https://bugzilla.xamarin.com/show_bug.cgi?id=35530 is resolved
+ get { return mainThread == Thread.CurrentThread; }
+ }
+
+ /// <summary>
+ /// Asserts that the current thread is the main thread. It will throw an exception if it isn't.
+ /// </summary>
+ public static void AssertMainThread ()
+ {
+ if (!IsMainThread)
+ throw new InvalidOperationException ("Operation not supported in background thread");
}
public static void SetProcessName (string name)
@@ -354,4 +504,21 @@ namespace MonoDevelop.Core
public static Counter LogFatalErrors = InstrumentationService.CreateCounter ("Fatal errors", "Log");
public static Counter LogDebug = InstrumentationService.CreateCounter ("Debug messages", "Log");
}
+
+ public class RuntimePreferences
+ {
+ internal RuntimePreferences () { }
+
+ public readonly ConfigurationProperty<bool> EnableInstrumentation = ConfigurationProperty.Create ("MonoDevelop.EnableInstrumentation", false);
+ public readonly ConfigurationProperty<bool> EnableAutomatedTesting = ConfigurationProperty.Create ("MonoDevelop.EnableAutomatedTesting", false);
+ public readonly ConfigurationProperty<string> UserInterfaceLanguage = ConfigurationProperty.Create ("MonoDevelop.Ide.UserInterfaceLanguage", "");
+ public readonly ConfigurationProperty<MonoDevelop.Projects.MSBuild.MSBuildVerbosity> MSBuildVerbosity = ConfigurationProperty.Create ("MonoDevelop.Ide.MSBuildVerbosity", MonoDevelop.Projects.MSBuild.MSBuildVerbosity.Normal);
+ public readonly ConfigurationProperty<bool> ParallelBuild = ConfigurationProperty.Create ("MonoDevelop.ParallelBuild", true);
+
+ public readonly ConfigurationProperty<string> AuthorName = ConfigurationProperty.Create ("Author.Name", Environment.UserName, oldName:"ChangeLogAddIn.Name");
+ public readonly ConfigurationProperty<string> AuthorEmail = ConfigurationProperty.Create ("Author.Email", "", oldName:"ChangeLogAddIn.Email");
+ public readonly ConfigurationProperty<string> AuthorCopyright = ConfigurationProperty.Create ("Author.Copyright", (string) null);
+ public readonly ConfigurationProperty<string> AuthorCompany = ConfigurationProperty.Create ("Author.Company", "");
+ public readonly ConfigurationProperty<string> AuthorTrademark = ConfigurationProperty.Create ("Author.Trademark", "");
+ }
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/StringParserService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/StringParserService.cs
index ad4145815b..b156d9bdb8 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/StringParserService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/StringParserService.cs
@@ -222,6 +222,20 @@ namespace MonoDevelop.Core
{
foreach (IStringTagProvider provider in AddinManager.GetExtensionObjects (typeof(IStringTagProvider)))
yield return provider;
+ foreach (IStringTagProvider provider in customProviders)
+ yield return provider;
+ }
+
+ static List<IStringTagProvider> customProviders = new List<IStringTagProvider> ();
+
+ public static void RegisterStringTagProvider (IStringTagProvider provider)
+ {
+ customProviders.Add (provider);
+ }
+
+ public static void UnregisterStringTagProvider (IStringTagProvider provider)
+ {
+ customProviders.Remove (provider);
}
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/UserProfile.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/UserProfile.cs
index 84f6e61dea..cff070b602 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/UserProfile.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/UserProfile.cs
@@ -42,7 +42,8 @@ namespace MonoDevelop.Core
"2.8",
"3.0",
"4.0",
- "5.0"
+ "5.0",
+ "6.0"
};
static UserProfile ()
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/WebRequestHelper.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/WebRequestHelper.cs
index 0fa710e677..2c2f6d59b6 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/WebRequestHelper.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/WebRequestHelper.cs
@@ -73,13 +73,28 @@ namespace MonoDevelop.Core
/// Keeps sending requests until a response code that doesn't require authentication happens or if the request
/// requires authentication and the user has stopped trying to enter them (i.e. they hit cancel when they are prompted).
/// </remarks>
- public static Task<HttpWebResponse> GetResponseAsync (
+ public static async Task<HttpWebResponse> GetResponseAsync (
Func<HttpWebRequest> createRequest,
Action<HttpWebRequest> prepareRequest = null,
CancellationToken token = default(CancellationToken))
{
- //TODO: make this really async under the covers
- return Task.Factory.StartNew (() => GetResponse (createRequest, prepareRequest, token), token);
+ if (prepareRequest == null) {
+ prepareRequest = r => {};
+ }
+
+ if (credentialProvider == null) {
+ var req = createRequest ();
+ req.MakeCancelable (token);
+ prepareRequest (req);
+
+ return (HttpWebResponse) await req.GetResponseAsync ();
+ }
+
+ var handler = new RequestHelper (
+ createRequest, prepareRequest, proxyCache, CredentialStore.Instance, credentialProvider
+ );
+
+ return await handler.GetResponseAsync (token);
}
/// <summary>
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/DotNetProjectNode.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/DotNetProjectNode.cs
deleted file mode 100644
index 1b0759072d..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/DotNetProjectNode.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-// MSBuildDotNetProjectExtensionNode.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using Mono.Addins;
-using MonoDevelop.Core;
-using MonoDevelop.Projects.Formats.MSBuild;
-using MonoDevelop.Projects.Extensions;
-
-namespace MonoDevelop.Projects.Extensions
-{
- public class DotNetProjectNode: ItemTypeNode
- {
- [NodeAttribute (Required=true)]
- string language = null;
-
- [NodeAttribute]
- string resourceHandler = null;
-
- public override bool CanHandleItem (SolutionEntityItem item)
- {
- return (item is DotNetProject) && ((DotNetProject)item).LanguageName == language;
- }
-
- public override bool CanHandleFile (string fileName, string typeGuid)
- {
- if (base.CanHandleFile (fileName, typeGuid))
- return true;
- else if (!string.IsNullOrEmpty (typeGuid) && typeGuid.Contains (Guid))
- {
- DotNetProjectSubtypeNode node = MSBuildProjectService.GetDotNetProjectSubtype (typeGuid);
- if (node != null && node.CanHandleFile (fileName, typeGuid))
- return true;
- }
- return false;
- }
-
- public override SolutionEntityItem LoadSolutionItem (IProgressMonitor monitor, string fileName, MSBuildFileFormat expectedFormat, string itemGuid)
- {
- MSBuildProjectHandler handler = CreateHandler<MSBuildProjectHandler> (fileName, itemGuid);
- handler.SetCustomResourceHandler (GetResourceHandler ());
- return handler.Load (monitor, fileName, expectedFormat, language, null);
- }
-
- public IResourceHandler GetResourceHandler ()
- {
- if (!string.IsNullOrEmpty (resourceHandler))
- return (IResourceHandler) Addin.CreateInstance (resourceHandler, true);
- else
- return new MSBuildResourceHandler ();
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/DotNetProjectSubtypeNode.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/DotNetProjectSubtypeNode.cs
deleted file mode 100644
index 2da66dcfa6..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/DotNetProjectSubtypeNode.cs
+++ /dev/null
@@ -1,214 +0,0 @@
-// DotNetProjectSubtype.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.Linq;
-using Mono.Addins;
-using MonoDevelop.Projects.Formats.MSBuild;
-using System.Collections.Generic;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Projects.Extensions
-{
- [ExtensionNodeChild (typeof(DotNetProjectSubtypeNodeImport), "AddImport")]
- [ExtensionNodeChild (typeof(DotNetProjectSubtypeNodeImport), "RemoveImport")]
- public class DotNetProjectSubtypeNode: ExtensionNode
- {
- #pragma warning disable 649
-
- [NodeAttribute]
- string guid = null;
-
- [NodeAttribute]
- string type = null;
-
- [NodeAttribute]
- string import = null;
-
- [NodeAttribute]
- string extension = null;
-
- [NodeAttribute]
- string exclude = null;
-
- [NodeAttribute]
- bool useXBuild = false;
-
- [NodeAttribute]
- bool requireXBuild = true;
-
- [NodeAttribute]
- string migrationHandler;
-
- [NodeAttribute]
- bool migrationRequired = true;
-
- #pragma warning restore 649
-
- Type itemType;
-
- public string Import {
- get {
- return import;
- }
- }
-
- public Type Type {
- get {
- if (itemType == null) {
- itemType = Addin.GetType (type, true);
- if (!typeof(MonoDevelop.Projects.DotNetProject).IsAssignableFrom (itemType))
- throw new InvalidOperationException ("Type must be a subclass of DotNetProject");
- }
- return itemType;
- }
- }
-
- public string Extension {
- get {
- return extension;
- }
- }
-
- public string Exclude {
- get {
- return exclude;
- }
- }
-
- public string Guid {
- get { return guid; }
- }
-
- public bool UseXBuild {
- get { return useXBuild; }
- }
-
- public bool RequireXBuild {
- get { return useXBuild && requireXBuild; }
- }
-
- public bool IsMigration {
- get { return migrationHandler != null; }
- }
-
- public bool IsMigrationRequired {
- get { return migrationRequired; }
- }
-
- public IDotNetSubtypeMigrationHandler MigrationHandler {
- get { return (IDotNetSubtypeMigrationHandler) Addin.CreateInstance (migrationHandler); }
- }
-
- public bool SupportsType (string guid)
- {
- return string.Compare (this.guid, guid, true) == 0;
- }
-
- public DotNetProject CreateInstance (string language)
- {
- return (DotNetProject) Activator.CreateInstance (Type, language);
- }
-
- public virtual bool CanHandleItem (SolutionEntityItem item)
- {
- return !(IsMigration && IsMigrationRequired) && Type.IsAssignableFrom (item.GetType ());
- }
-
- public virtual bool CanHandleType (Type type)
- {
- return !(IsMigration && IsMigrationRequired) && Type.IsAssignableFrom (type);
- }
-
- public virtual bool CanHandleFile (string fileName, string typeGuid)
- {
- if (typeGuid != null && typeGuid.ToLower().Contains(guid.ToLower()))
- return true;
- if (!string.IsNullOrEmpty (extension) && System.IO.Path.GetExtension (fileName) == "." + extension)
- return true;
- return false;
- }
-
- public virtual void InitializeHandler (SolutionEntityItem item)
- {
- MSBuildProjectHandler h = (MSBuildProjectHandler) ProjectExtensionUtil.GetItemHandler (item);
- UpdateImports (item, h.TargetImports);
- h.SubtypeGuids.Add (guid);
- h.UseMSBuildEngineByDefault |= UseXBuild;
- h.RequireMSBuildEngine |= RequireXBuild;
- }
-
- public void UpdateImports (SolutionEntityItem item, List<string> imports)
- {
- DotNetProject p = (DotNetProject) item;
- if (!string.IsNullOrEmpty (import))
- imports.AddRange (import.Split (':'));
- if (!string.IsNullOrEmpty (exclude))
- exclude.Split (':').ToList ().ForEach (i => imports.Remove (i));
-
- foreach (DotNetProjectSubtypeNodeImport iob in ChildNodes) {
- if (iob.Language == p.LanguageName) {
- if (iob.IsAdd)
- imports.AddRange (iob.Projects.Split (':'));
- else
- iob.Projects.Split (':').ToList ().ForEach (i => imports.Remove (i));
- }
- }
- }
- }
-
- class DotNetProjectSubtypeNodeImport: ExtensionNode
- {
- protected override void Read (NodeElement elem)
- {
- IsAdd = elem.NodeName == "AddImport";
- base.Read (elem);
- }
-
- [NodeAttribute ("language")]
- public string Language { get; set; }
-
- [NodeAttribute ("projects")]
- public string Projects { get; set; }
-
- public bool IsAdd { get; private set; }
- }
-
- public interface IDotNetSubtypeMigrationHandler
- {
- IEnumerable<string> FilesToBackup (string filename);
- Type Migrate (IProjectLoadProgressMonitor monitor, MSBuildProject project, string fileName, string language);
- bool CanPromptForMigration { get; }
- MigrationType PromptForMigration (IProjectLoadProgressMonitor monitor, MSBuildProject project, string fileName, string language);
- }
-
- public enum MigrationType {
- Ignore,
- Migrate,
- BackupAndMigrate,
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/DotNetProjectTypeNode.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/DotNetProjectTypeNode.cs
new file mode 100644
index 0000000000..202a41f0c7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/DotNetProjectTypeNode.cs
@@ -0,0 +1,68 @@
+// MSBuildDotNetProjectExtensionNode.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+using System;
+using Mono.Addins;
+using MonoDevelop.Core;
+using MonoDevelop.Projects.MSBuild;
+using MonoDevelop.Projects.Extensions;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Projects.Extensions
+{
+ [ExtensionNode (ExtensionAttributeType=typeof(ExportDotNetProjectTypeAttribute))]
+ public class DotNetProjectTypeNode: ProjectTypeNode
+ {
+ [NodeAttribute (Required=true)]
+ string language = null;
+
+ public string Language {
+ get { return language; }
+ }
+
+ public DotNetProjectTypeNode ()
+ {
+ }
+
+ protected override void Read (NodeElement elem)
+ {
+ base.Read (elem);
+ if (!string.IsNullOrEmpty (language) && string.IsNullOrEmpty (TypeAlias))
+ TypeAlias = language;
+ }
+
+ public override Type ItemType {
+ get {
+ if (!string.IsNullOrEmpty (ItemTypeName))
+ return base.ItemType;
+ else
+ return typeof(DotNetProject);
+ }
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/FlavorTypeCondition.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/FlavorTypeCondition.cs
new file mode 100644
index 0000000000..855a09dd15
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/FlavorTypeCondition.cs
@@ -0,0 +1,46 @@
+//
+// FlavorCondition.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+
+namespace MonoDevelop.Projects.Extensions
+{
+ public class FlavorTypeCondition: ItemTypeCondition
+ {
+ Project project;
+
+ public FlavorTypeCondition (Project project)
+ {
+ this.project = project;
+ }
+
+ protected override System.Collections.Generic.IEnumerable<Type> GetObjectTypes ()
+ {
+ return project.GetFlavors ().Select (e => e.GetType ());
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/IFileFormat.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/IFileFormat.cs
deleted file mode 100644
index 6c02e7d1f2..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/IFileFormat.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// IFileFormat.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using MonoDevelop.Core;
-using System.Collections.Generic;
-
-namespace MonoDevelop.Projects.Extensions
-{
- public interface IFileFormat
- {
- // Returns a valid file name for the provided object and file (e.g. it might change
- // the extension to .csproj for the VS2005 format)
- FilePath GetValidFormatName (object obj, FilePath fileName);
-
- // Returns true if this file format can read the provided file to load an
- // object of the specified type
- bool CanReadFile (FilePath file, Type expectedObjectType);
-
- // Returns true if this file format can write the provided object
- bool CanWriteFile (object obj);
-
- // Makes the required changes in the object to support this file format.
- // It usually means setting the ISolutionItemHandler of the item.
- void ConvertToFormat (object obj);
-
- void WriteFile (FilePath file, object obj, IProgressMonitor monitor);
- object ReadFile (FilePath file, Type expectedType, IProgressMonitor monitor);
-
- // Returns the list of files where the object is stored
- List<FilePath> GetItemFiles (object obj);
-
- // Return true if the file formats supports mixing items of different formats.
- // For example, solutions using the MonoDevelop 1.0 file format can contain
- // projects stored using the MSBuild file format.
- bool SupportsMixedFormats { get; }
-
- // Returns a list of warnings to show to the user about compatibility issues
- // that may arise when exporting the object to this format.
- IEnumerable<string> GetCompatibilityWarnings (object obj);
-
- bool SupportsFramework (MonoDevelop.Core.Assemblies.TargetFramework framework);
- }
-} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/IPathHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/IPathHandler.cs
deleted file mode 100644
index e987803100..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/IPathHandler.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// ISolutionItemHandler.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Projects.Extensions
-{
- /// <summary>
- /// This interface can be implemented by a ISolutionItemHandler class to provide
- /// custom rules for encoding and decoding paths
- /// </summary>
- public interface IPathHandler
- {
- string EncodePath (string path, string oldPath);
- string DecodePath (string path);
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/IResourceHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/IResourceHandler.cs
deleted file mode 100644
index 89a594f8a2..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/IResourceHandler.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// ISolutionItemHandler.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Projects.Extensions
-{
- /// <summary>
- /// This interface can be implemented by a ISolutionItemHandler class to provide
- /// custom resource id generation rules
- /// </summary>
- public interface IResourceHandler
- {
- string GetDefaultResourceId (ProjectFile file);
- }
-
- internal class DefaultResourceHandler : IResourceHandler
- {
- public string GetDefaultResourceId (ProjectFile file)
- {
- return System.IO.Path.GetFileName (file.Name);
- }
-
- public static readonly DefaultResourceHandler Instance = new DefaultResourceHandler ();
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ISolutionItemHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ISolutionItemHandler.cs
deleted file mode 100644
index 83b0603b79..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ISolutionItemHandler.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-// ISolutionItemHandler.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Projects.Extensions
-{
- /// <summary>
- /// An abstraction of some solution item operations that may be specific to the underlying file format.
- /// </summary>
- public interface ISolutionItemHandler: IDisposable
- {
- /// <summary>
- /// Executes a build target
- /// </summary>
- /// <returns>
- /// The result of the operation
- /// </returns>
- /// <param name='monitor'>
- /// A progress monitor
- /// </param>
- /// <param name='target'>
- /// Name of the target to execute
- /// </param>
- /// <param name='configuration'>
- /// Selector to be used to get the target configuration
- /// </param>
- BuildResult RunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration);
-
- /// <summary>
- /// Saves the solution item
- /// </summary>
- /// <param name='monitor'>
- /// A progress monitor
- /// </param>
- void Save (IProgressMonitor monitor);
-
- /// <summary>
- /// Gets a value indicating whether the name of the solution item should be the same as the name of the file
- /// </summary>
- /// <value>
- /// <c>true</c> if the file name must be in sync with the solution item name; otherwise, <c>false</c>.
- /// </value>
- bool SyncFileName { get; }
-
- /// <summary>
- /// Unique and immutable identifier of the solution item inside the solution
- /// </summary>
- string ItemId { get; }
-
- /// <summary>
- /// Notifies that this solution item has been modified
- /// </summary>
- /// <param name='hint'>
- /// Hint about which part of the solution item has been modified. This will typically be the property name.
- /// </param>
- void OnModified (string hint);
-
- /// <summary>
- /// Gets a service instance of a given type
- /// </summary>
- /// <returns>
- /// The service.
- /// </returns>
- /// <param name='t'>
- /// Type of the service
- /// </param>
- /// <remarks>
- /// This method looks for an imlpementation of a service of the given type.
- /// </remarks>
- object GetService (Type t);
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ImportRedirectTypeNode.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ImportRedirectTypeNode.cs
new file mode 100644
index 0000000000..2b31c4a847
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ImportRedirectTypeNode.cs
@@ -0,0 +1,40 @@
+//
+// ImportRedirectTypeNode.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Mono.Addins;
+
+namespace MonoDevelop.Projects.Extensions
+{
+ class ImportRedirectTypeNode: ExtensionNode
+ {
+ [NodeAttribute ("project")]
+ public string Project { get; set; }
+
+ [NodeAttribute ("target")]
+ public string Target { get; set; }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ItemTypeCondition.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ItemTypeCondition.cs
index 48824db647..b83091da19 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ItemTypeCondition.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ItemTypeCondition.cs
@@ -34,11 +34,12 @@ namespace MonoDevelop.Projects.Extensions
public class ItemTypeCondition: ConditionType
{
Type objType;
- List<string> typeNames;
+ HashSet<string> typeNames;
IDictionary<string,string> aliases;
public ItemTypeCondition ()
{
+ aliases = new Dictionary<string, string> ();
}
public ItemTypeCondition (Type objType): this (objType, null)
@@ -76,7 +77,7 @@ namespace MonoDevelop.Projects.Extensions
public override bool Evaluate (NodeElement conditionNode)
{
foreach (string type in conditionNode.GetAttribute ("value").Split ('|')) {
- if (MatchesType (type))
+ if (MatchesType (type.Trim ()))
return true;
}
return false;
@@ -87,7 +88,7 @@ namespace MonoDevelop.Projects.Extensions
aliases [alias] = fullName;
}
- bool MatchesType (string type)
+ protected bool MatchesType (string type)
{
if (type.IndexOf ('.') == -1) {
string res;
@@ -106,29 +107,36 @@ namespace MonoDevelop.Projects.Extensions
// use of the condition.
if (typeNames == null) {
- typeNames = new List<string> ();
-
- typeNames.Add (objType.FullName);
- typeNames.Add (objType.AssemblyQualifiedName);
+ typeNames = new HashSet<string> ();
+
+ foreach (var t in GetObjectTypes ()) {
+ typeNames.Add (t.FullName);
+ typeNames.Add (t.AssemblyQualifiedName);
- // base class hierarchy
+ // base class hierarchy
- Type baseType = objType.BaseType;
- while (baseType != null) {
- typeNames.Add (baseType.FullName);
- typeNames.Add (baseType.AssemblyQualifiedName);
- baseType = baseType.BaseType;
- }
+ Type baseType = t.BaseType;
+ while (baseType != null) {
+ typeNames.Add (baseType.FullName);
+ typeNames.Add (baseType.AssemblyQualifiedName);
+ baseType = baseType.BaseType;
+ }
- // Implemented interfaces
+ // Implemented interfaces
- Type[] interfaces = objType.GetInterfaces();
- foreach (Type itype in interfaces) {
- typeNames.Add (itype.FullName);
- typeNames.Add (itype.AssemblyQualifiedName);
+ Type[] interfaces = t.GetInterfaces ();
+ foreach (Type itype in interfaces) {
+ typeNames.Add (itype.FullName);
+ typeNames.Add (itype.AssemblyQualifiedName);
+ }
}
}
return typeNames.Contains (type);
}
+
+ protected virtual IEnumerable<Type> GetObjectTypes ()
+ {
+ yield return objType;
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ItemTypeNode.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ItemTypeNode.cs
deleted file mode 100644
index 7608071bee..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ItemTypeNode.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-// MSBuildItemTypeExtensionNode.cs
-//
-// Author:sdfsdf
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.IO;
-using System.Xml;
-using Mono.Addins;
-using MonoDevelop.Projects.Formats.MSBuild;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Projects.Extensions
-{
- public abstract class ItemTypeNode: ExtensionNode
- {
- [NodeAttribute (Required=true)]
- string guid = null;
-
- [NodeAttribute]
- string extension = null;
-
- [NodeAttribute]
- string import = null;
-
- [NodeAttribute]
- string handlerType = null;
-
- public ItemTypeNode ()
- {
- }
-
- public ItemTypeNode (string guid, string extension, string import)
- {
- this.guid = guid;
- this.extension = extension;
- this.import = import;
- }
-
- public string Guid {
- get { return guid; }
- }
-
- public string Extension {
- get {
- return extension;
- }
- }
-
- public string Import {
- get {
- return import;
- }
- }
-
- public abstract bool CanHandleItem (SolutionEntityItem item);
-
- public virtual void InitializeHandler (SolutionEntityItem item)
- {
- MSBuildHandler h = CreateHandler<MSBuildHandler> (null, null);
- h.Item = item;
- item.SetItemHandler (h);
- }
-
- public virtual bool CanHandleFile (string fileName, string typeGuid)
- {
- if (typeGuid != null && string.Compare (typeGuid, guid, true) == 0)
- return true;
- if (!string.IsNullOrEmpty (extension) && System.IO.Path.GetExtension (fileName) == "." + extension)
- return true;
- return false;
- }
-
- protected T CreateHandler<T> (string fileName, string itemGuid) where T:MSBuildHandler
- {
- MSBuildHandler h = OnCreateHandler (fileName, itemGuid);
- if (!(h is T))
- throw new InvalidOperationException ("Error while creating a MSBuildHandler. Expected an object of type '" + typeof(T).FullName + ", found type '" + h.GetType ());
- return (T)h;
- }
-
- protected virtual MSBuildHandler OnCreateHandler (string fileName, string itemGuid)
- {
- MSBuildHandler h;
- if (!string.IsNullOrEmpty (handlerType)) {
- h = Addin.CreateInstance (handlerType, true) as MSBuildHandler;
- if (h == null)
- throw new InvalidOperationException ("Type '" + handlerType + "' must be a subclass of 'MonoDevelop.Projects.Formats.MSBuild.MSBuildHandler'");
- if (h is MSBuildProjectHandler)
- ((MSBuildProjectHandler)h).Initialize (Guid, Import, itemGuid);
- else
- h.Initialize (Guid, itemGuid);
- } else {
- h = new MSBuildProjectHandler (Guid, Import, itemGuid);
- }
- return h;
- }
-
- public abstract SolutionEntityItem LoadSolutionItem (IProgressMonitor monitor, string fileName, MSBuildFileFormat expectedFormat, string itemGuid);
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/LanguageBindingCodon.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/LanguageBindingCodon.cs
deleted file mode 100644
index a61fe33308..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/LanguageBindingCodon.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-// LanguageBindingCodon.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2007 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.Collections;
-using System.Diagnostics;
-using System.ComponentModel;
-
-using Mono.Addins;
-using MonoDevelop.Projects;
-
-namespace MonoDevelop.Projects.Extensions
-{
- [ExtensionNode (Description="A language binding. The specified class must implement MonoDevelop.Projects.ILanguageBinding")]
- internal class LanguageBindingCodon : TypeExtensionNode
- {
- [NodeAttribute("supportedextensions", "File extensions supported by this binding (to be shown in the Open File dialog)")]
- string[] supportedExtensions;
-
- public string[] Supportedextensions {
- get {
- return supportedExtensions;
- }
- set {
- supportedExtensions = value;
- }
- }
-
- public ILanguageBinding LanguageBinding {
- get {
- return (ILanguageBinding) GetInstance ();
- }
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/LanguageBindingExtensionNode.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/LanguageBindingExtensionNode.cs
new file mode 100644
index 0000000000..ba82ce3217
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/LanguageBindingExtensionNode.cs
@@ -0,0 +1,74 @@
+// LanguageBindingCodon.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+using System;
+using System.Collections;
+using System.Diagnostics;
+using System.ComponentModel;
+
+using Mono.Addins;
+using MonoDevelop.Projects;
+
+namespace MonoDevelop.Projects.Extensions
+{
+ [ExtensionNode (Description="A language binding. If no class name is provided, a custom language binding withe the provided data will be created")]
+ internal class LanguageBindingExtensionNode : ExtensionNode
+ {
+ LanguageBinding binding;
+
+ [NodeAttribute("extensions", "Comma separated list of file extensions supported by this binding (to be shown in the Open File dialog)")]
+ public string[] SupportedExtensions { get; set; }
+
+ [NodeAttribute("singleLineCommentTag", "Single line comment tag")]
+ public string SingleLineCommentTag { get; set; }
+
+ [NodeAttribute("blockCommentStartTag", "Block comment start tag")]
+ public string BlockCommentStartTag { get; set; }
+
+ [NodeAttribute("blockCommentEndTag", "Block comment end tag")]
+ public string BlockCommentEndTag { get; set; }
+
+ [NodeAttribute("codeDomType", "Block comment end tag")]
+ public string CodeDomType { get; set; }
+
+ [NodeAttribute("class", "Optional type of the language binding. Must be a subclass of LanguageBinding.")]
+ public string LanguageBindingType { get; set; }
+
+ internal LanguageBinding LanguageBinding {
+ get {
+ if (binding == null) {
+ if (!string.IsNullOrEmpty (LanguageBindingType))
+ binding = (LanguageBinding) Addin.CreateInstance (LanguageBindingType, true);
+ else
+ binding = new LanguageBinding ();
+ binding.InitFromNode (this);
+ }
+ return binding;
+ }
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/MSBuildProjectExtensionNode.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/MSBuildProjectExtensionNode.cs
new file mode 100644
index 0000000000..85daa23c06
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/MSBuildProjectExtensionNode.cs
@@ -0,0 +1,46 @@
+//
+// MSBuildProjectExtensionNode.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Mono.Addins;
+
+namespace MonoDevelop.Projects.Extensions
+{
+ public class MSBuildProjectExtensionNode: TypeExtensionNode
+ {
+ [NodeAttribute (Description = "GUID of the extension. The extension will be loaded if the project has this GUID in the project type GUID list. " +
+ "If not specified, the SupportsItem method will be called on the extension to determine if it is supported or not.")]
+ string guid;
+
+ public MSBuildProjectExtensionNode ()
+ {
+ }
+
+ public string Guid {
+ get { return guid; }
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectBindingCodon.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectBindingCodon.cs
deleted file mode 100644
index c0cda37f63..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectBindingCodon.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// ProjectBindingCodon.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections;
-using System.ComponentModel;
-
-using Mono.Addins;
-using MonoDevelop.Projects;
-
-namespace MonoDevelop.Projects.Extensions
-{
- [ExtensionNode (Description="A project binding. The specified class must implement MonoDevelop.Projects.IProjectBinding.")]
- internal class ProjectBindingCodon : TypeExtensionNode
- {
- public IProjectBinding ProjectBinding {
- get { return (IProjectBinding) base.GetInstance (); }
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectExtensionUtil.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectExtensionUtil.cs
deleted file mode 100644
index 6004da536e..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectExtensionUtil.cs
+++ /dev/null
@@ -1,147 +0,0 @@
-// ProjectExtensionUtil.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.IO;
-using System.Collections.Generic;
-using System.Threading;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Projects.Extensions
-{
- public static class ProjectExtensionUtil
- {
- static int loading;
- static LocalDataStoreSlot loadControlSlot;
-
- static ProjectExtensionUtil ()
- {
- loadControlSlot = Thread.AllocateDataSlot ();
- }
-
- public static ISolutionItemHandler GetItemHandler (SolutionItem item)
- {
- return item.GetItemHandler ();
- }
-
- public static void InstallHandler (ISolutionItemHandler handler, SolutionItem item)
- {
- item.SetItemHandler (handler);
- }
-
- public static SolutionEntityItem LoadSolutionItem (IProgressMonitor monitor, string fileName, ItemLoadCallback callback)
- {
- using (Counters.ReadSolutionItem.BeginTiming ("Read project " + fileName)) {
- return Services.ProjectService.GetExtensionChain (null).LoadSolutionItem (monitor, fileName, callback);
- }
- }
-
- public static BuildResult Compile (IProgressMonitor monitor, SolutionEntityItem item, BuildData buildData, ItemCompileCallback callback)
- {
- return Services.ProjectService.GetExtensionChain (item).Compile (monitor, item, buildData, callback);
- }
-
- public static void BeginLoadOperation ()
- {
- Interlocked.Increment (ref loading);
- LoadOperation op = (LoadOperation) Thread.GetData (loadControlSlot);
- if (op == null) {
- op = new LoadOperation ();
- Thread.SetData (loadControlSlot, op);
- }
- op.LoadingCount++;
- }
-
- public static void EndLoadOperation ()
- {
- Interlocked.Decrement (ref loading);
- LoadOperation op = (LoadOperation) Thread.GetData (loadControlSlot);
- if (op != null && --op.LoadingCount == 0) {
- Thread.SetData (loadControlSlot, null);
- op.End ();
- }
- }
-
- public static void LoadControl (ILoadController rc)
- {
- if (loading == 0)
- return;
- LoadOperation op = (LoadOperation) Thread.GetData (loadControlSlot);
- if (op != null)
- op.Add (rc);
- }
-
- public static string EncodePath (SolutionEntityItem item, string path, string oldPath)
- {
- IPathHandler ph = item.GetItemHandler () as IPathHandler;
- if (ph != null)
- return ph.EncodePath (path, oldPath);
- else {
- string basePath = Path.GetDirectoryName (item.FileName);
- return FileService.RelativeToAbsolutePath (basePath, path);
- }
- }
-
- public static string DecodePath (SolutionEntityItem item, string path)
- {
- IPathHandler ph = item.GetItemHandler () as IPathHandler;
- if (ph != null)
- return ph.DecodePath (path);
- else {
- string basePath = Path.GetDirectoryName (item.FileName);
- return FileService.AbsoluteToRelativePath (basePath, path);
- }
- }
- }
-
- class LoadOperation
- {
- List<ILoadController> objects = new List<ILoadController> ();
- public int LoadingCount;
-
- public void Add (object ob)
- {
- ILoadController lc = ob as ILoadController;
- if (lc != null) {
- objects.Add (lc);
- lc.BeginLoad ();
- }
- }
-
- public void End ()
- {
- foreach (ILoadController ob in objects)
- ob.EndLoad ();
- }
- }
-
-
-
- public delegate SolutionEntityItem ItemLoadCallback (IProgressMonitor monitor, string fileName);
-
- public delegate BuildResult ItemCompileCallback (IProgressMonitor monitor, SolutionEntityItem item, BuildData buildData);
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectMigrationHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectMigrationHandler.cs
new file mode 100644
index 0000000000..90d9898296
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectMigrationHandler.cs
@@ -0,0 +1,85 @@
+// DotNetProjectSubtype.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+using System;
+using System.Linq;
+using Mono.Addins;
+using MonoDevelop.Projects.MSBuild;
+using System.Collections.Generic;
+using MonoDevelop.Core;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Projects.Extensions
+{
+ public abstract class ProjectMigrationHandler
+ {
+ /// <summary>
+ /// Returns a list of files that should be backed up during migration.
+ /// </summary>
+ /// <returns>Files to backup.</returns>
+ /// <param name="filename">Project path</param>
+ public virtual IEnumerable<string> FilesToBackup (string filename)
+ {
+ yield break;
+ }
+
+ /// <summary>
+ /// Executes the proejct migration
+ /// </summary>
+ /// <param name="monitor">Progress monitor</param>
+ /// <param name="project">MSBuild project instance, if available</param>
+ /// <param name="fileName">Project path</param>
+ /// <param name="language">Language name (for .NET projects).</param>
+ public abstract Task<bool> Migrate (ProjectLoadProgressMonitor monitor, MSBuildProject project, string fileName, string language);
+
+ /// <summary>
+ /// If it returns true, PromptForMigration will be called to confirm the migration.
+ /// </summary>
+ public virtual bool CanPromptForMigration {
+ get { return false; }
+ }
+
+ /// <summary>
+ /// Ask the use for confirmation of the migration
+ /// </summary>
+ /// <returns>Use answer</returns>
+ /// <param name="monitor">Progress monitor</param>
+ /// <param name="project">MSBuild project instance, if available</param>
+ /// <param name="fileName">Project path</param>
+ /// <param name="language">Language name (for .NET projects).</param>
+ public virtual Task<MigrationType> PromptForMigration (ProjectLoadProgressMonitor monitor, MSBuildProject project, string fileName, string language)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public enum MigrationType {
+ Ignore,
+ Migrate,
+ BackupAndMigrate,
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectMigrationHandlerNode.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectMigrationHandlerNode.cs
new file mode 100644
index 0000000000..9e61188b88
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectMigrationHandlerNode.cs
@@ -0,0 +1,45 @@
+//
+// ProjectMigrationHandlerNode.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Mono.Addins;
+
+namespace MonoDevelop.Projects.Extensions
+{
+ public class ProjectMigrationHandlerNode: TypeExtensionNode
+ {
+ [NodeAttribute]
+ bool migrationRequired = true;
+
+ public bool IsMigrationRequired {
+ get { return migrationRequired; }
+ }
+
+ public ProjectMigrationHandler MigrationHandler {
+ get { return (ProjectMigrationHandler) CreateInstance (typeof(ProjectMigrationHandler)); }
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectModelExtensionNode.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectModelExtensionNode.cs
new file mode 100644
index 0000000000..5ebae884dc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectModelExtensionNode.cs
@@ -0,0 +1,45 @@
+//
+// ProjectModelExtensionNode.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Mono.Addins;
+
+namespace MonoDevelop.Projects.Extensions
+{
+ [ExtensionNode (ExtensionAttributeType = typeof(ExportProjectModelExtensionAttribute))]
+ public class ProjectModelExtensionNode: TypeExtensionNode
+ {
+ public virtual bool CanHandleObject (object ob)
+ {
+ return ob is WorkspaceObject;
+ }
+
+ public virtual WorkspaceObjectExtension CreateExtension ()
+ {
+ return (WorkspaceObjectExtension) CreateInstance (typeof(WorkspaceObjectExtension));
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectTypeNode.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectTypeNode.cs
new file mode 100644
index 0000000000..aebc87597c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/ProjectTypeNode.cs
@@ -0,0 +1,96 @@
+//
+// MSBuildProjectNode.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using MonoDevelop.Projects.MSBuild;
+using Mono.Addins;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.Projects.Extensions
+{
+ [ExtensionNode (ExtensionAttributeType=typeof(ExportProjectTypeAttribute))]
+ public class ProjectTypeNode: SolutionItemTypeNode
+ {
+ [NodeAttribute ("msbuildSupport")]
+ public MSBuildSupport MSBuildSupport { get; set; }
+
+ public ProjectTypeNode ()
+ {
+ MSBuildSupport = MSBuildSupport.Supported;
+ }
+
+ public override async Task<SolutionItem> CreateSolutionItem (ProgressMonitor monitor, SolutionLoadContext ctx, string fileName)
+ {
+ MSBuildProject p = null;
+ Project project = null;
+
+ if (!string.IsNullOrEmpty (fileName)) {
+ p = await MSBuildProject.LoadAsync (fileName);
+ if (ctx != null && ctx.Solution != null) {
+ p.EngineManager = ctx.Solution.MSBuildEngineManager;
+ p.SolutionDirectory = ctx.Solution.ItemDirectory;
+ }
+
+ var migrators = MSBuildProjectService.GetMigrableFlavors (p.ProjectTypeGuids);
+ if (migrators.Count > 0)
+ await MSBuildProjectService.MigrateFlavors (monitor, fileName, Guid, p, migrators);
+
+ var unsupporedFlavor = p.ProjectTypeGuids.FirstOrDefault (fid => !MSBuildProjectService.IsKnownFlavorGuid (fid) && !MSBuildProjectService.IsKnownTypeGuid (fid));
+ if (unsupporedFlavor != null) {
+ // The project has a flavor that's not supported. Return a fake project (if possible).
+ return MSBuildProjectService.CreateUnknownSolutionItem (monitor, fileName, Guid, unsupporedFlavor, null);
+ }
+
+ if (MSBuildSupport == MSBuildSupport.NotSupported || MSBuildProjectService.GetMSBuildSupportForFlavors (p.ProjectTypeGuids) == MSBuildSupport.NotSupported)
+ p.UseMSBuildEngine = false;
+
+ // Evaluate the project now. If evaluation fails an exception will be thrown, and when that
+ // happens the solution will create a placeholder project.
+ p.Evaluate ();
+ }
+
+ if (project == null)
+ project = await base.CreateSolutionItem (monitor, ctx, fileName) as Project;
+
+ if (project == null)
+ throw new InvalidOperationException ("Project node type is not a subclass of MonoDevelop.Projects.Project");
+
+ if (p != null)
+ project.SetCreationContext (Project.CreationContext.Create (p, Guid));
+ return project;
+ }
+
+ public virtual Project CreateProject (params string[] flavorGuids)
+ {
+ var p = (Project) CreateSolutionItem (new ProgressMonitor (), null, null).Result;
+ p.SetCreationContext (Project.CreationContext.Create (Guid, flavorGuids));
+ return p;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemExtensionNode.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemExtensionNode.cs
new file mode 100644
index 0000000000..1c49919e0a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemExtensionNode.cs
@@ -0,0 +1,105 @@
+//
+// SolutionItemExtensionNode.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Mono.Addins;
+using System.Linq;
+
+namespace MonoDevelop.Projects.Extensions
+{
+ [ExtensionNode (ExtensionAttributeType = typeof(ExportProjectFlavorAttribute))]
+ public class SolutionItemExtensionNode: ProjectModelExtensionNode
+ {
+ [NodeAttribute (Description = "GUID of the extension. The extension will be loaded if the project has this GUID in the project type GUID list. " +
+ "If not specified, the extension will be applied to all projects.")]
+ string guid;
+
+ public string Guid {
+ get { return guid; }
+ set { guid = value; }
+ }
+
+ [NodeAttribute]
+ bool migrationRequired = true;
+
+ [NodeAttribute]
+ string migrationHandler;
+
+ [NodeAttribute ("msbuildSupport")]
+ public MSBuildSupport MSBuildSupport { get; set; }
+
+ ProjectMigrationHandler handler;
+
+ [NodeAttribute ("alias", Description = "Friendly id of the extension")]
+ public string TypeAlias { get; set; }
+
+ public SolutionItemExtensionNode ()
+ {
+ MSBuildSupport = MSBuildSupport.Supported;
+ }
+
+ public bool IsMigrationRequired {
+ get { return migrationRequired; }
+ set { migrationRequired = value; }
+ }
+
+ public bool SupportsMigration {
+ get { return !string.IsNullOrEmpty (migrationHandler) || handler != null; }
+ }
+
+ public ProjectMigrationHandler MigrationHandler {
+ get {
+ if (handler == null)
+ handler = (ProjectMigrationHandler) Addin.CreateInstance (migrationHandler);
+ return handler;
+ }
+ set {
+ handler = value;
+ }
+ }
+
+ public override bool CanHandleObject (object ob)
+ {
+ SolutionItem p = ob as SolutionItem;
+ if (p == null)
+ return false;
+
+ if (guid == null)
+ return true;
+
+ var typeGuids = p.GetItemTypeGuids ();
+ return typeGuids.Any (g => string.Equals (g, guid, StringComparison.InvariantCultureIgnoreCase));
+ }
+
+ public override WorkspaceObjectExtension CreateExtension ()
+ {
+ var ext = (SolutionItemExtension) CreateInstance (typeof(SolutionItemExtension));
+ ext.FlavorGuid = Guid;
+ ext.TypeAlias = TypeAlias;
+ return ext;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemHandler.cs
deleted file mode 100644
index 835a0c2d92..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemHandler.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-// MD1SolutionItemHandler.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.CodeDom.Compiler;
-using MonoDevelop.Core;
-using MonoDevelop.Projects.Extensions;
-
-namespace MonoDevelop.Projects.Extensions
-{
- public abstract class SolutionItemHandler: ISolutionItemHandler
- {
- SolutionItem item;
-
- public SolutionItemHandler (SolutionItem item)
- {
- this.item = item;
- }
-
- public virtual bool SyncFileName {
- get { return true; }
- }
-
- public SolutionItem Item {
- get { return item; }
- }
-
- public virtual BuildResult RunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration)
- {
- switch (target)
- {
- case "Build":
- return OnBuild (monitor, configuration);
- case "Clean":
- return OnClean (monitor, configuration);
- }
- return new BuildResult (new CompilerResults (null), "");
- }
-
- protected virtual BuildResult OnBuild (IProgressMonitor monitor, ConfigurationSelector configuration)
- {
- return null;
- }
-
- protected virtual BuildResult OnClean (IProgressMonitor monitor, ConfigurationSelector configuration)
- {
- return null;
- }
-
- public virtual void Dispose ()
- {
- }
-
- public abstract string ItemId { get; }
-
- public abstract void Save (IProgressMonitor monitor);
-
- public virtual void OnModified (string hint)
- {
- }
-
- public virtual object GetService (Type t)
- {
- return null;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemNode.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemNode.cs
deleted file mode 100644
index 1dc81dafca..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemNode.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-// SolutionItemNode.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.IO;
-using System.Xml;
-using Mono.Addins;
-using MonoDevelop.Projects.Formats.MSBuild;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Projects.Extensions
-{
- public class SolutionItemNode: ItemTypeNode
- {
- [NodeAttribute (Required=true)]
- string type = null;
-
- public Type ItemType {
- get { return Addin.GetType (type, true); }
- }
-
- public override bool CanHandleItem (SolutionEntityItem item)
- {
- return ItemType != null && ItemType.IsAssignableFrom (item.GetType ());
- }
-
- public override SolutionEntityItem LoadSolutionItem (IProgressMonitor monitor, string fileName, MSBuildFileFormat expectedFormat, string itemGuid)
- {
- MSBuildProjectHandler handler = CreateHandler<MSBuildProjectHandler> (fileName, itemGuid);
- return handler.Load (monitor, fileName, expectedFormat, null, ItemType);
- }
- }
-} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemTypeNode.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemTypeNode.cs
new file mode 100644
index 0000000000..46fa87c880
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemTypeNode.cs
@@ -0,0 +1,123 @@
+// MSBuildItemTypeExtensionNode.cs
+//
+// Author:sdfsdf
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+using System;
+using System.IO;
+using System.Xml;
+using Mono.Addins;
+using MonoDevelop.Projects.MSBuild;
+using MonoDevelop.Core;
+using System.Threading.Tasks;
+using MonoDevelop.Core.ProgressMonitoring;
+using System.Runtime.Remoting.Messaging;
+
+namespace MonoDevelop.Projects.Extensions
+{
+ [ExtensionNode (ExtensionAttributeType=typeof(ExportSolutionItemTypeAttribute))]
+ public abstract class SolutionItemTypeNode: ExtensionNode
+ {
+ [NodeAttribute (Required=true)]
+ string guid = null;
+
+ [NodeAttribute]
+ string extension = null;
+
+ [NodeAttribute]
+ string type = null;
+
+ protected SolutionItemTypeNode ()
+ {
+ }
+
+ protected SolutionItemTypeNode (string guid, string extension)
+ {
+ this.guid = guid;
+ this.extension = extension;
+ }
+
+ [NodeAttribute ("alias")]
+ public string TypeAlias { get; set; }
+
+ public string Guid {
+ get { return guid; }
+ set { guid = value; }
+ }
+
+ public string Extension {
+ get { return extension; }
+ set { extension = value; }
+ }
+
+ internal string ItemTypeName {
+ get { return type; }
+ set { type = value; }
+ }
+
+ public virtual Type ItemType {
+ get { return Addin.GetType (type, true); }
+ }
+
+ public virtual bool CanHandleFile (string fileName, string typeGuid)
+ {
+ if (typeGuid != null && string.Compare (typeGuid, guid, true) == 0)
+ return true;
+ if (!string.IsNullOrEmpty (extension) && System.IO.Path.GetExtension (fileName) == "." + extension)
+ return true;
+ return false;
+ }
+
+ SolutionItemFactory factory;
+
+ public virtual async Task<SolutionItem> CreateSolutionItem (ProgressMonitor monitor, SolutionLoadContext ctx, string fileName)
+ {
+ SolutionItem item;
+
+ if (typeof(SolutionItemFactory).IsAssignableFrom (ItemType)) {
+ if (factory == null)
+ factory = (SolutionItemFactory)Activator.CreateInstance (ItemType);
+ item = await factory.CreateItem (fileName, Guid);
+ } else
+ item = MSBuildProjectService.CreateUninitializedInstance (ItemType);
+
+ item.TypeGuid = Guid;
+ return item;
+ }
+
+ public virtual bool CanCreateSolutionItem (string type, ProjectCreateInformation info, System.Xml.XmlElement projectOptions)
+ {
+ return type.Equals (Guid, StringComparison.OrdinalIgnoreCase) || type == TypeAlias;
+ }
+
+ public virtual SolutionItem CreateSolutionItem (string type, ProjectCreateInformation info, System.Xml.XmlElement projectOptions)
+ {
+ var item = CreateSolutionItem (new ProgressMonitor (), null, null).Result;
+ item.EnsureInitialized ();
+ item.InitializeFromTemplate (info, projectOptions);
+ return item;
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/TypeTagCondition.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/TypeTagCondition.cs
new file mode 100644
index 0000000000..cc1afe825c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/TypeTagCondition.cs
@@ -0,0 +1,71 @@
+//
+// TypeTagCondition.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using Mono.Addins;
+using MonoDevelop.Projects.MSBuild;
+
+namespace MonoDevelop.Projects.Extensions
+{
+ public class ProjectTypeIdCondition: ConditionType
+ {
+ string[] tags;
+
+ public ProjectTypeIdCondition (Project project)
+ {
+ tags = project.FlavorGuids.Concat (Enumerable.Repeat (project.TypeGuid, 1)).ToArray ();
+ }
+
+ public override bool Evaluate (NodeElement conditionNode)
+ {
+ var val = conditionNode.GetAttribute ("value");
+ if (val.IndexOf ('|') != -1) {
+ string[] ors = val.Split ('|');
+ foreach (var cond in ors) {
+ if (EvalAnd (cond))
+ return true;
+ }
+ return false;
+ }
+ return EvalAnd (val);
+ }
+
+ bool EvalAnd (string val)
+ {
+ if (val.IndexOf ('&') != -1) {
+ var ands = val.Split ('&');
+ foreach (var tag in ands) {
+ var id = MSBuildProjectService.ConvertTypeAliasToGuid (tag.Trim ());
+ if (!tags.Contains (id))
+ return false;
+ }
+ return true;
+ }
+ return tags.Contains (MSBuildProjectService.ConvertTypeAliasToGuid (val.Trim ()));
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1DotNetProjectHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1DotNetProjectHandler.cs
deleted file mode 100644
index c370403ffa..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1DotNetProjectHandler.cs
+++ /dev/null
@@ -1,420 +0,0 @@
-// MD1DotNetProjectHandler.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.IO;
-using System.Diagnostics;
-using System.Collections.Generic;
-using System.CodeDom.Compiler;
-using System.Text.RegularExpressions;
-using MonoDevelop.Core;
-using MonoDevelop.Core.Execution;
-using MonoDevelop.Projects.Extensions;
-using Microsoft.Build.BuildEngine;
-
-namespace MonoDevelop.Projects.Formats.MD1
-{
- internal class MD1DotNetProjectHandler: MD1SolutionEntityItemHandler
- {
- public MD1DotNetProjectHandler (DotNetProject entry): base (entry)
- {
- }
-
- DotNetProject Project {
- get { return (DotNetProject) Item; }
- }
-
- protected override BuildResult OnBuild (IProgressMonitor monitor, ConfigurationSelector configuration)
- {
- if (!Project.InternalCheckNeedsBuild (configuration)) {
- monitor.Log.WriteLine (GettextCatalog.GetString ("Skipping project since output files are up to date"));
- return new BuildResult ();
- }
-
- DotNetProject project = Project;
-
- if (!project.TargetRuntime.IsInstalled (project.TargetFramework)) {
- BuildResult res = new BuildResult ();
- res.AddError (GettextCatalog.GetString ("Framework '{0}' not installed.", project.TargetFramework.Name));
- return res;
- }
-
- bool hasBuildableFiles = false;
- foreach (ProjectFile pf in project.Files) {
- if (pf.BuildAction == BuildAction.Compile || pf.BuildAction == BuildAction.EmbeddedResource) {
- hasBuildableFiles = true;
- break;
- }
- }
- if (!hasBuildableFiles)
- return new BuildResult ();
-
- if (project.LanguageBinding == null) {
- BuildResult langres = new BuildResult ();
- string msg = GettextCatalog.GetString ("Unknown language '{0}'. You may need to install an additional add-in to support this language.", project.LanguageName);
- langres.AddError (msg);
- monitor.ReportError (msg, null);
- return langres;
- }
-
- BuildResult refres = null;
- HashSet<ProjectItem> itemsToExclude = new HashSet<ProjectItem> ();
-
- foreach (ProjectReference pr in project.References) {
-
- if (pr.ReferenceType == ReferenceType.Project) {
- // Ignore non-dotnet projects
- Project p = project.ParentSolution != null ? project.ParentSolution.FindProjectByName (pr.Reference) : null;
- if (p != null && !(p is DotNetProject))
- continue;
-
- if (p == null || pr.GetReferencedFileNames (configuration).Length == 0) {
- if (refres == null)
- refres = new BuildResult ();
- string msg = GettextCatalog.GetString ("Referenced project '{0}' not found in the solution.", pr.Reference);
- monitor.ReportWarning (msg);
- refres.AddWarning (msg);
- }
- }
-
- if (!pr.IsValid) {
- if (refres == null)
- refres = new BuildResult ();
- string msg;
- if (!pr.IsExactVersion && pr.SpecificVersion) {
- msg = GettextCatalog.GetString ("Reference '{0}' not found on system. Using '{1}' instead.", pr.StoredReference, pr.Reference);
- monitor.ReportWarning (msg);
- refres.AddWarning (msg);
- }
- else {
- bool errorsFound = false;
- foreach (string asm in pr.GetReferencedFileNames (configuration)) {
- if (!File.Exists (asm)) {
- msg = GettextCatalog.GetString ("Assembly '{0}' not found. Make sure that the assembly exists in disk. If the reference is required to build the project you may get compilation errors.", Path.GetFileName (asm));
- refres.AddWarning (msg);
- monitor.ReportWarning (msg);
- errorsFound = true;
- itemsToExclude.Add (pr);
- }
- }
- msg = null;
- if (!errorsFound) {
- msg = GettextCatalog.GetString ("The reference '{0}' is not valid for the target framework of the project.", pr.StoredReference, pr.Reference);
- monitor.ReportWarning (msg);
- refres.AddWarning (msg);
- itemsToExclude.Add (pr);
- }
- }
- }
- }
-
- DotNetProjectConfiguration conf = (DotNetProjectConfiguration) project.GetConfiguration (configuration);
-
- // Create a copy of the data needed to compile the project.
- // This data can be modified by extensions.
- // Also filter out items whose condition evaluates to false
-
- BuildData buildData = new BuildData ();
- ProjectParserContext ctx = new ProjectParserContext (project, conf);
-
- buildData.Items = new ProjectItemCollection ();
- foreach (ProjectItem item in project.Items) {
- if (!itemsToExclude.Contains (item) && (string.IsNullOrEmpty (item.Condition) || ConditionParser.ParseAndEvaluate (item.Condition, ctx)))
- buildData.Items.Add (item);
- }
- buildData.Configuration = (DotNetProjectConfiguration) conf.Clone ();
- buildData.Configuration.SetParentItem (project);
- buildData.ConfigurationSelector = configuration;
-
- return ProjectExtensionUtil.Compile (monitor, project, buildData, delegate {
- ProjectItemCollection items = buildData.Items;
- BuildResult res = BuildResources (buildData.Configuration, ref items, monitor);
- if (res != null)
- return res;
-
- res = project.LanguageBinding.Compile (items, buildData.Configuration, buildData.ConfigurationSelector, monitor);
- if (refres != null) {
- refres.Append (res);
- return refres;
- }
- else
- return res;
- });
- }
-
- // Builds the EmbedAsResource files. If any localized resources are found then builds the satellite assemblies
- // and sets @projectItems to a cloned collection minus such resource files.
- private BuildResult BuildResources (DotNetProjectConfiguration configuration, ref ProjectItemCollection projectItems, IProgressMonitor monitor)
- {
- string resgen = configuration.TargetRuntime.GetToolPath (configuration.TargetFramework, "resgen");
- ExecutionEnvironment env = configuration.TargetRuntime.GetToolsExecutionEnvironment (configuration.TargetFramework);
-
- bool cloned = false;
- Dictionary<string, string> resourcesByCulture = new Dictionary<string, string> ();
- foreach (ProjectFile finfo in projectItems.GetAll<ProjectFile> ()) {
- if (finfo.Subtype == Subtype.Directory || finfo.BuildAction != BuildAction.EmbeddedResource)
- continue;
-
- string fname = finfo.Name;
- string resourceId;
- CompilerError ce = GetResourceId (configuration.IntermediateOutputDirectory.Combine (finfo.ResourceId), env, finfo, ref fname, resgen, out resourceId, monitor);
- if (ce != null) {
- CompilerResults cr = new CompilerResults (new TempFileCollection ());
- cr.Errors.Add (ce);
-
- return new BuildResult (cr, String.Empty);
- }
- string culture = DotNetProject.GetResourceCulture (finfo.Name);
- if (culture == null)
- continue;
-
- string cmd = String.Empty;
- if (resourcesByCulture.ContainsKey (culture))
- cmd = resourcesByCulture [culture];
-
- cmd = String.Format ("{0} \"/embed:{1},{2}\"", cmd, fname, resourceId);
- resourcesByCulture [culture] = cmd;
- if (!cloned) {
- // Clone only if required
- ProjectItemCollection items = new ProjectItemCollection ();
- items.AddRange (projectItems);
- projectItems = items;
- cloned = true;
- }
- projectItems.Remove (finfo);
- }
-
- string al = configuration.TargetRuntime.GetToolPath (configuration.TargetFramework, "al");
- CompilerError err = GenerateSatelliteAssemblies (resourcesByCulture, configuration.OutputDirectory, al, Path.GetFileName (configuration.OutputAssembly), monitor);
- if (err != null) {
- CompilerResults cr = new CompilerResults (new TempFileCollection ());
- cr.Errors.Add (err);
-
- return new BuildResult (cr, String.Empty);
- }
-
- return null;
- }
-
- CompilerError GetResourceId (FilePath outputFile, ExecutionEnvironment env, ProjectFile finfo, ref string fname, string resgen, out string resourceId, IProgressMonitor monitor)
- {
- resourceId = finfo.ResourceId;
- if (resourceId == null) {
- LoggingService.LogDebug (GettextCatalog.GetString ("Error: Unable to build ResourceId for {0}.", fname));
- monitor.Log.WriteLine (GettextCatalog.GetString ("Error: Unable to build ResourceId for {0}.", fname));
-
- return new CompilerError (fname, 0, 0, String.Empty,
- GettextCatalog.GetString ("Unable to build ResourceId for {0}.", fname));
- }
-
- if (String.Compare (Path.GetExtension (fname), ".resx", true) != 0)
- return null;
-
- if (!IsResgenRequired (fname, outputFile)) {
- fname = File.Exists (outputFile) ? (string)outputFile : Path.ChangeExtension (fname, ".resources");
- return null;
- }
-
- if (resgen == null) {
- string msg = GettextCatalog.GetString ("Unable to find 'resgen' tool.");
- monitor.ReportError (msg, null);
- return new CompilerError (fname, 0, 0, String.Empty, msg);
- }
-
- using (StringWriter sw = new StringWriter ()) {
- LoggingService.LogDebug ("Compiling resources\n{0}$ {1} /compile {2}", Path.GetDirectoryName (fname), resgen, fname);
- monitor.Log.WriteLine (GettextCatalog.GetString (
- "Compiling resource {0} with {1}", fname, resgen));
- ProcessWrapper pw = null;
- try {
- ProcessStartInfo info = Runtime.ProcessService.CreateProcessStartInfo (
- resgen, String.Format ("/compile \"{0}\"", fname),
- Path.GetDirectoryName (fname), false);
-
- env.MergeTo (info);
- if (PlatformID.Unix == Environment.OSVersion.Platform)
- info.EnvironmentVariables ["MONO_IOMAP"] = "drive";
-
- pw = Runtime.ProcessService.StartProcess (info, sw, sw, null);
- } catch (System.ComponentModel.Win32Exception ex) {
- LoggingService.LogDebug (GettextCatalog.GetString (
- "Error while trying to invoke '{0}' to compile resource '{1}' :\n {2}", resgen, fname, ex.ToString ()));
- monitor.Log.WriteLine (GettextCatalog.GetString (
- "Error while trying to invoke '{0}' to compile resource '{1}' :\n {2}", resgen, fname, ex.Message));
-
- return new CompilerError (fname, 0, 0, String.Empty, ex.Message);
- }
-
- //FIXME: Handle exceptions
- pw.WaitForOutput ();
-
- if (pw.ExitCode == 0) {
- fname = Path.ChangeExtension (fname, ".resources");
- } else {
- string output = sw.ToString ();
- LoggingService.LogDebug (GettextCatalog.GetString (
- "Unable to compile ({0}) {1} to .resources. \nReason: \n{2}\n",
- resgen, fname, output));
- monitor.Log.WriteLine (GettextCatalog.GetString (
- "Unable to compile ({0}) {1} to .resources. \nReason: \n{2}\n",
- resgen, fname, output));
-
- //Try to get the line/pos
- int line = 0;
- int pos = 0;
- Match match = RegexErrorLinePos.Match (output);
- if (match.Success && match.Groups.Count == 3) {
- try {
- line = int.Parse (match.Groups [1].Value);
- } catch (FormatException){
- }
-
- try {
- pos = int.Parse (match.Groups [2].Value);
- } catch (FormatException){
- }
- }
-
- return new CompilerError (fname, line, pos, String.Empty, output);
- }
- }
-
- return null;
- }
-
- // true if the resx file or any file referenced
- // by the resx is newer than the .resources file
- public static bool IsResgenRequired (string resx_filename, string output_filename)
- {
- if (String.Compare (Path.GetExtension (resx_filename), ".resx", true) != 0)
- throw new ArgumentException (".resx file expected", "resx_filename");
-
- if (File.Exists (output_filename))
- return IsFileNewerThan (resx_filename, output_filename);
- return IsFileNewerThan (resx_filename, Path.ChangeExtension (resx_filename, ".resources"));
- }
-
- // true if first is newer than second
- static bool IsFileNewerThan (string first, string second)
- {
- FileInfo finfo_first = new FileInfo (first);
- FileInfo finfo_second = new FileInfo (second);
- return finfo_first.LastWriteTime > finfo_second.LastWriteTime;
- }
-
- CompilerError GenerateSatelliteAssemblies (Dictionary<string, string> resourcesByCulture, string outputDir, string al, string defaultns, IProgressMonitor monitor)
- {
- foreach (KeyValuePair<string, string> pair in resourcesByCulture) {
- string culture = pair.Key;
- string satDir = Path.Combine (outputDir, culture);
- string outputFile = defaultns + ".resources.dll";
-
- //FIXME: don't regen if not required,
- //for that we'll need name of the .resources that these depend on..
-
- //create target dir
- Directory.CreateDirectory (satDir);
-
- using (StringWriter sw = new StringWriter ()) {
- //generate assembly
- string args = String.Format ("/t:lib {0} \"/out:{1}\" /culture:{2}", pair.Value, outputFile, culture);
-
- LoggingService.LogDebug ("Generating satellite assembly for '{0}' culture.\n{1}$ {2} {3}", culture, satDir, al, args);
- monitor.Log.WriteLine (GettextCatalog.GetString (
- "Generating satellite assembly for '{0}' culture with {1}", culture, al));
- ProcessWrapper pw = null;
- try {
- ProcessStartInfo info = Runtime.ProcessService.CreateProcessStartInfo (
- al, args,
- satDir, false);
-
- pw = Runtime.ProcessService.StartProcess (info, sw, sw, null);
- } catch (System.ComponentModel.Win32Exception ex) {
- LoggingService.LogDebug (GettextCatalog.GetString (
- "Error while trying to invoke '{0}' to generate satellite assembly for '{1}' culture:\n {2}", al, culture, ex.ToString ()));
- monitor.Log.WriteLine (GettextCatalog.GetString (
- "Error while trying to invoke '{0}' to generate satellite assembly for '{1}' culture:\n {2}", al, culture, ex.Message));
-
- return new CompilerError ("", 0, 0, String.Empty, ex.Message);
- }
-
- //FIXME: Handle exceptions
- pw.WaitForOutput ();
-
- if (pw.ExitCode != 0) {
- string output = sw.ToString ();
- LoggingService.LogDebug (GettextCatalog.GetString (
- "Unable to generate satellite assemblies for '{0}' culture with {1}.\nReason: \n{2}\n",
- culture, al, output));
- monitor.Log.WriteLine (GettextCatalog.GetString (
- "Unable to generate satellite assemblies for '{0}' culture with {1}.\nReason: \n{2}\n",
- culture, al, output));
-
- return new CompilerError (String.Empty, 0, 0, String.Empty, output);
- }
- }
- }
-
- return null;
- }
-
- // Used for parsing "Line 123, position 5" errors from tools
- // like resgen, xamlg
- static Regex regexErrorLinePos;
- static Regex RegexErrorLinePos {
- get {
- if (regexErrorLinePos == null)
- regexErrorLinePos = new Regex (@"Line (\d*), position (\d*)");
- return regexErrorLinePos;
- }
- }
- }
-
- class ProjectParserContext: IExpressionContext
- {
- Project project;
- DotNetProjectConfiguration config;
-
- public ProjectParserContext (Project project, DotNetProjectConfiguration config)
- {
- this.project = project;
- this.config = config;
- }
-
- public string FullFileName {
- get {
- return project.FileName;
- }
- }
-
- public string EvaluateString (string value)
- {
- string val = value.Replace ("$(Configuration)", config.Name).Replace ("$(Platform)", config.Platform);
- return val;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1FileFormat.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1FileFormat.cs
deleted file mode 100644
index 669a0e92c7..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1FileFormat.cs
+++ /dev/null
@@ -1,189 +0,0 @@
-//
-// MonoDevelopFileFormat.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Xml;
-using MonoDevelop.Core.Serialization;
-using MonoDevelop.Projects.Extensions;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Projects.Formats.MD1
-{
- class MD1FileFormat: IFileFormat
- {
- public bool SupportsMixedFormats {
- get { return true; }
- }
-
- public FilePath GetValidFormatName (object obj, FilePath fileName)
- {
- if (obj is WorkspaceItem && !(obj is Solution))
- return Path.ChangeExtension (fileName, ".mdw");
- throw new InvalidOperationException ();
- }
-
- public bool CanReadFile (FilePath file, Type expectedType)
- {
- string ext = Path.GetExtension (file).ToLower ();
- return ext == ".mdw" && expectedType.IsAssignableFrom (typeof(WorkspaceItem));
- }
-
- public bool CanWriteFile (object obj)
- {
- return (obj is WorkspaceItem && !(obj is Solution));
- }
-
- public List<FilePath> GetItemFiles (object obj)
- {
- return new List<FilePath> ();
- }
-
- public void WriteFile (FilePath file, object node, IProgressMonitor monitor)
- {
- string tmpfilename = null;
- try {
- try {
- if (File.Exists (file))
- tmpfilename = Path.GetTempFileName ();
- } catch (IOException) {
- }
-
- if (tmpfilename == null) {
- WriteFileInternal (file, file, node, monitor);
- } else {
- WriteFileInternal (file, tmpfilename, node, monitor);
- File.Delete (file);
- File.Move (tmpfilename, file);
- }
- } catch {
- if (tmpfilename != String.Empty && File.Exists (tmpfilename))
- File.Delete (tmpfilename);
- throw;
- }
- }
-
- void WriteFileInternal (FilePath actualFile, FilePath outFile, object node, IProgressMonitor monitor)
- {
- WriteWorkspaceItem (actualFile, outFile, (WorkspaceItem) node, monitor);
- }
-
- void WriteWorkspaceItem (FilePath actualFile, FilePath outFile, WorkspaceItem item, IProgressMonitor monitor)
- {
- Workspace ws = item as Workspace;
- if (ws != null) {
- monitor.BeginTask (null, ws.Items.Count);
- try {
- foreach (WorkspaceItem it in ws.Items) {
- it.Save (monitor);
- monitor.Step (1);
- }
- } finally {
- monitor.EndTask ();
- }
- }
-
- StreamWriter sw = new StreamWriter (outFile);
- try {
- monitor.BeginTask (GettextCatalog.GetString ("Saving item: {0}", actualFile), 1);
- XmlTextWriter tw = new XmlTextWriter (sw);
- tw.Formatting = Formatting.Indented;
- XmlDataSerializer ser = new XmlDataSerializer (MD1ProjectService.DataContext);
- ser.SerializationContext.BaseFile = actualFile;
- ser.SerializationContext.ProgressMonitor = monitor;
- ser.Serialize (sw, item, typeof(WorkspaceItem));
- } catch (Exception ex) {
- monitor.ReportError (GettextCatalog.GetString ("Could not save item: {0}", actualFile), ex);
- throw;
- } finally {
- monitor.EndTask ();
- sw.Close ();
- }
- }
-
- public object ReadFile (FilePath fileName, Type expectedType, IProgressMonitor monitor)
- {
- string ext = Path.GetExtension (fileName).ToLower ();
- if (ext != ".mdw")
- throw new ArgumentException ();
-
- object readObject = null;
-
- ProjectExtensionUtil.BeginLoadOperation ();
- try {
- readObject = ReadWorkspaceItemFile (fileName, monitor);
- } finally {
- ProjectExtensionUtil.EndLoadOperation ();
- }
-
- IWorkspaceFileObject fo = readObject as IWorkspaceFileObject;
- if (fo != null)
- fo.ConvertToFormat (MD1ProjectService.FileFormat, false);
- return readObject;
- }
-
- object ReadWorkspaceItemFile (FilePath fileName, IProgressMonitor monitor)
- {
- XmlTextReader reader = new XmlTextReader (new StreamReader (fileName));
- try {
- monitor.BeginTask (string.Format (GettextCatalog.GetString ("Loading workspace item: {0}"), fileName), 1);
- reader.MoveToContent ();
- XmlDataSerializer ser = new XmlDataSerializer (MD1ProjectService.DataContext);
- ser.SerializationContext.BaseFile = fileName;
- ser.SerializationContext.ProgressMonitor = monitor;
- WorkspaceItem entry = (WorkspaceItem) ser.Deserialize (reader, typeof(WorkspaceItem));
- entry.ConvertToFormat (MD1ProjectService.FileFormat, false);
- entry.FileName = fileName;
- return entry;
- }
- catch (Exception ex) {
- monitor.ReportError (string.Format (GettextCatalog.GetString ("Could not load solution item: {0}"), fileName), ex);
- throw;
- }
- finally {
- monitor.EndTask ();
- reader.Close ();
- }
- }
-
- public void ConvertToFormat (object obj)
- {
- }
-
- public IEnumerable<string> GetCompatibilityWarnings (object obj)
- {
- yield break;
- }
-
- public bool SupportsFramework (MonoDevelop.Core.Assemblies.TargetFramework framework)
- {
- return true;
- }
- }
-} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1ProjectService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1ProjectService.cs
deleted file mode 100644
index 250404fc5d..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1ProjectService.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-// MD1ProjectService.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using MonoDevelop.Projects;
-using MonoDevelop.Core.Serialization;
-
-namespace MonoDevelop.Projects.Formats.MD1
-{
- static class MD1ProjectService
- {
- static DataContext dataContext;
-
- public static DataContext DataContext {
- get {
- if (dataContext == null) {
- dataContext = new DataContext ();
- Services.ProjectService.InitializeDataContext (dataContext);
- }
- return dataContext;
- }
- }
-
- public static FileFormat FileFormat {
- get {
- return Services.ProjectService.FileFormats.GetFileFormat ("MD1");
- }
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1SolutionEntityItemHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1SolutionEntityItemHandler.cs
deleted file mode 100644
index 6034c074c4..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1SolutionEntityItemHandler.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-// MD1SolutionItemHandler.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.CodeDom.Compiler;
-using MonoDevelop.Core;
-using MonoDevelop.Projects.Extensions;
-
-namespace MonoDevelop.Projects.Formats.MD1
-{
- internal class MD1SolutionEntityItemHandler: MD1SolutionItemHandler
- {
- public MD1SolutionEntityItemHandler (SolutionEntityItem item): base (item)
- {
- }
-
- public override void Save (IProgressMonitor monitor)
- {
- SolutionEntityItem it = (SolutionEntityItem) Item;
- it.FileFormat.Format.WriteFile (it.FileName, it, monitor);
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1SolutionItemHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1SolutionItemHandler.cs
deleted file mode 100644
index 4d971784bb..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MD1/MD1SolutionItemHandler.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-// MD1SolutionItemHandler.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.CodeDom.Compiler;
-using MonoDevelop.Core;
-using MonoDevelop.Projects.Extensions;
-
-namespace MonoDevelop.Projects.Formats.MD1
-{
- internal class MD1SolutionItemHandler: SolutionItemHandler
- {
- public MD1SolutionItemHandler (SolutionItem item): base (item)
- {
- }
-
- public override void Save (IProgressMonitor monitor)
- {
- throw new NotSupportedException ();
- }
-
- public override bool SyncFileName {
- get { return false; }
- }
-
- public override string ItemId {
- get {
- if (Item.ParentFolder != null)
- return Item.ParentFolder.ItemId + "/" + Item.Name;
- else
- return Item.Name;
- }
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionAndExpression.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionAndExpression.cs
deleted file mode 100644
index ded44148b9..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionAndExpression.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// ConditionAndExpression.cs
-//
-// Author:
-// Marek Sieradzki (marek.sieradzki@gmail.com)
-//
-// (C) 2006 Marek Sieradzki
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-using System;
-using System.Xml;
-
-namespace Microsoft.Build.BuildEngine {
- internal sealed class ConditionAndExpression : ConditionExpression {
-
- readonly ConditionExpression left;
- readonly ConditionExpression right;
-
- public ConditionAndExpression (ConditionExpression left, ConditionExpression right)
- {
- this.left = left;
- this.right = right;
- }
-
- public ConditionExpression Left {
- get { return left; }
- }
-
- public ConditionExpression Right {
- get { return right; }
- }
-
- public override bool BoolEvaluate (IExpressionContext context)
- {
- if (!left.BoolEvaluate (context))
- return false;
- if (!right.BoolEvaluate (context))
- return false;
- return true;
- }
-
-
- public override float NumberEvaluate (IExpressionContext context)
- {
- throw new NotSupportedException ();
- }
-
- public override string StringEvaluate (IExpressionContext context)
- {
- throw new NotSupportedException ();
- }
-
- public override bool CanEvaluateToBool (IExpressionContext context)
- {
- return left.CanEvaluateToBool (context) && right.CanEvaluateToBool (context);
- }
-
- public override bool CanEvaluateToNumber (IExpressionContext context)
- {
- return false;
- }
-
- public override bool CanEvaluateToString (IExpressionContext context)
- {
- return false;
- }
- }
-
- interface IExpressionContext
- {
- string FullFileName { get; }
- string EvaluateString (string value);
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionExpression.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionExpression.cs
deleted file mode 100644
index 1325d596ef..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionExpression.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// ConditionExpression.cs
-//
-// Author:
-// Marek Sieradzki (marek.sieradzki@gmail.com)
-//
-// (C) 2006 Marek Sieradzki
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-using System;
-using System.Xml;
-
-namespace Microsoft.Build.BuildEngine {
- internal abstract class ConditionExpression {
-
- public abstract bool BoolEvaluate (IExpressionContext context);
- public abstract float NumberEvaluate (IExpressionContext context);
- public abstract string StringEvaluate (IExpressionContext context);
-
- public abstract bool CanEvaluateToBool (IExpressionContext context);
- public abstract bool CanEvaluateToNumber (IExpressionContext context);
- public abstract bool CanEvaluateToString (IExpressionContext context);
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionFactorExpresion.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionFactorExpresion.cs
deleted file mode 100644
index 4df1fbac72..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionFactorExpresion.cs
+++ /dev/null
@@ -1,126 +0,0 @@
-//
-// ConditionFactorExpression.cs
-//
-// Author:
-// Marek Sieradzki (marek.sieradzki@gmail.com)
-//
-// (C) 2006 Marek Sieradzki
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-using System;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Globalization;
-using System.Xml;
-
-namespace Microsoft.Build.BuildEngine {
- internal sealed class ConditionFactorExpression : ConditionExpression {
-
- readonly Token token;
-
- static Hashtable allValues;
- static Hashtable trueValues;
- static Hashtable falseValues;
-
- static ConditionFactorExpression ()
- {
- string[] trueValuesArray = new string[] {"true", "on", "yes"};
- string[] falseValuesArray = new string[] {"false", "off", "no"};
-
-
- allValues = CollectionsUtil.CreateCaseInsensitiveHashtable ();
- trueValues = CollectionsUtil.CreateCaseInsensitiveHashtable ();
- falseValues = CollectionsUtil.CreateCaseInsensitiveHashtable ();
-
- foreach (string s in trueValuesArray) {
- trueValues.Add (s, s);
- allValues.Add (s, s);
- }
-
- foreach (string s in falseValuesArray) {
- falseValues.Add (s, s);
- allValues.Add (s, s);
- }
- }
-
- public ConditionFactorExpression (Token token)
- {
- this.token = token;
- }
-
- public override bool BoolEvaluate (IExpressionContext context)
- {
- Token evaluatedToken = EvaluateToken (token, context);
-
- if (trueValues [evaluatedToken.Value] != null)
- return true;
- else if (falseValues [evaluatedToken.Value] != null)
- return false;
- else
- throw new InvalidOperationException ();
- }
-
- public override float NumberEvaluate (IExpressionContext context)
- {
- Token evaluatedToken = EvaluateToken (token, context);
-
- return Single.Parse (evaluatedToken.Value, CultureInfo.InvariantCulture);
- }
-
- public override string StringEvaluate (IExpressionContext context)
- {
- Token evaluatedToken = EvaluateToken (token, context);
-
- return evaluatedToken.Value;
- }
-
- // FIXME: check if we really can do it
- public override bool CanEvaluateToBool (IExpressionContext context)
- {
- Token evaluatedToken = EvaluateToken (token, context);
-
- if (token.Type == TokenType.String && allValues [evaluatedToken.Value] != null)
- return true;
- else
- return false;
- }
-
- public override bool CanEvaluateToNumber (IExpressionContext context)
- {
- if (token.Type == TokenType.Number)
- return true;
- else
- return false;
- }
-
- public override bool CanEvaluateToString (IExpressionContext context)
- {
- return true;
- }
-
- // FIXME: in some situations items might not be allowed
- static Token EvaluateToken (Token token, IExpressionContext context)
- {
- string val = context.EvaluateString (token.Value);
- return new Token (val, TokenType.String);
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionFunctionExpression.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionFunctionExpression.cs
deleted file mode 100644
index 780c98441b..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionFunctionExpression.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-//
-// ConditionFunctionExpression.cs
-//
-// Author:
-// Marek Sieradzki (marek.sieradzki@gmail.com)
-//
-// (C) 2006 Marek Sieradzki
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Reflection;
-using System.Xml;
-
-namespace Microsoft.Build.BuildEngine {
- internal sealed class ConditionFunctionExpression : ConditionExpression {
-
- List <ConditionFactorExpression> args;
- string name;
-
- static Dictionary <string, MethodInfo> functions;
-
- static ConditionFunctionExpression ()
- {
- Type t = typeof (ConditionFunctionExpression);
- string [] names = new string [] { "Exists" };
-
- functions = new Dictionary <string, MethodInfo> ();
- foreach (string name in names)
- functions.Add (name, t.GetMethod (name, BindingFlags.NonPublic | BindingFlags.Static));
- }
-
- public ConditionFunctionExpression (string name, List <ConditionFactorExpression> args)
- {
- this.args = args;
- this.name = name;
- }
-
- public override bool BoolEvaluate (IExpressionContext context)
- {
- if (!functions.ContainsKey (name))
- throw new InvalidOperationException ();
-
- if (functions [name] == null)
- throw new InvalidOperationException ();
-
- MethodInfo mi = functions [name];
- object [] argsArr = new object [args.Count + 1];
- int i = 0;
- foreach (ConditionFactorExpression cfe in args)
- argsArr [i++] = cfe.StringEvaluate (context);
- argsArr [i] = context;
-
- return (bool) mi.Invoke (null, argsArr);
- }
-
- public override float NumberEvaluate (IExpressionContext context)
- {
- throw new NotSupportedException ();
- }
-
- public override string StringEvaluate (IExpressionContext context)
- {
- throw new NotSupportedException ();
- }
-
- public override bool CanEvaluateToBool (IExpressionContext context)
- {
- return functions.ContainsKey (name);
- }
-
- public override bool CanEvaluateToNumber (IExpressionContext context)
- {
- return false;
- }
-
- public override bool CanEvaluateToString (IExpressionContext context)
- {
- return false;
- }
-
-#pragma warning disable 0169
-#region Functions
- // FIXME imported projects
- static bool Exists (string file, IExpressionContext context)
- {
- string directory = null;
-
- if (context.FullFileName != String.Empty)
- directory = Path.GetDirectoryName (context.FullFileName);
-
- if (!Path.IsPathRooted (file) && directory != null && directory != String.Empty)
- file = Path.Combine (directory, file);
-
- return File.Exists (file);
- }
-#endregion
-#pragma warning restore 0169
-
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionNotExpression.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionNotExpression.cs
deleted file mode 100644
index 1e6f8b9743..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionNotExpression.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// ConditionNotExpression.cs
-//
-// Author:
-// Marek Sieradzki (marek.sieradzki@gmail.com)
-//
-// (C) 2006 Marek Sieradzki
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-
-using System;
-using System.Xml;
-
-namespace Microsoft.Build.BuildEngine {
- internal sealed class ConditionNotExpression : ConditionExpression {
-
- readonly ConditionExpression expression;
-
- public ConditionNotExpression (ConditionExpression expression)
- {
- this.expression = expression;
- }
-
- public override bool BoolEvaluate (IExpressionContext context)
- {
- return !(expression.BoolEvaluate (context));
- }
-
-
- public override float NumberEvaluate (IExpressionContext context)
- {
- throw new NotSupportedException ();
- }
-
- public override string StringEvaluate (IExpressionContext context)
- {
- throw new NotSupportedException ();
- }
-
- public override bool CanEvaluateToBool (IExpressionContext context)
- {
- return expression.CanEvaluateToBool (context);
- }
-
- public override bool CanEvaluateToNumber (IExpressionContext context)
- {
- return false;
- }
-
- public override bool CanEvaluateToString (IExpressionContext context)
- {
- return false;
- }
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionOrExpression.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionOrExpression.cs
deleted file mode 100644
index 2cca20e274..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionOrExpression.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-//
-// ConditionOrExpression.cs
-//
-// Author:
-// Marek Sieradzki (marek.sieradzki@gmail.com)
-//
-// (C) 2006 Marek Sieradzki
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-using System;
-using System.Xml;
-
-namespace Microsoft.Build.BuildEngine {
- internal sealed class ConditionOrExpression : ConditionExpression {
-
- readonly ConditionExpression left;
- readonly ConditionExpression right;
-
- public ConditionOrExpression (ConditionExpression left, ConditionExpression right)
- {
- this.left = left;
- this.right = right;
- }
-
- public ConditionExpression Left {
- get { return left; }
- }
-
- public ConditionExpression Right {
- get { return right; }
- }
-
- public override bool BoolEvaluate (IExpressionContext context)
- {
- if (left.BoolEvaluate (context))
- return true;
- if (right.BoolEvaluate (context))
- return true;
- return false;
- }
-
- public override float NumberEvaluate (IExpressionContext context)
- {
- throw new NotSupportedException ();
- }
-
- public override string StringEvaluate (IExpressionContext context)
- {
- throw new NotSupportedException ();
- }
-
- // FIXME: check if we really can do it
- public override bool CanEvaluateToBool (IExpressionContext context)
- {
- return true;
- }
-
- public override bool CanEvaluateToNumber (IExpressionContext context)
- {
- return false;
- }
-
- public override bool CanEvaluateToString (IExpressionContext context)
- {
- return false;
- }
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionParser.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionParser.cs
deleted file mode 100644
index 2b891db10b..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionParser.cs
+++ /dev/null
@@ -1,250 +0,0 @@
-//
-// ConditionParser.cs
-//
-// Author:
-// Marek Sieradzki (marek.sieradzki@gmail.com)
-// Jaroslaw Kowalski <jaak@jkowalski.net>
-//
-// (C) 2006 Marek Sieradzki
-// (C) 2004-2006 Jaroslaw Kowalski
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Microsoft.Build.BuildEngine {
-
- internal class ConditionParser {
-
- ConditionTokenizer tokenizer;
-
- ConditionParser (string condition)
- {
- tokenizer = new ConditionTokenizer ();
- tokenizer.Tokenize (condition);
- }
-
- public static bool ParseAndEvaluate (string condition, IExpressionContext context)
- {
- if (String.IsNullOrEmpty (condition))
- return true;
-
- ConditionExpression ce = ParseCondition (condition);
-
- if (!ce.CanEvaluateToBool (context))
- throw new Exception (String.Format ("Can not evaluate \"{0}\" to bool.", condition));
-
- return ce.BoolEvaluate (context);
- }
-
- public static ConditionExpression ParseCondition (string condition)
- {
- ConditionParser parser = new ConditionParser (condition);
- ConditionExpression e = parser.ParseExpression ();
-
- if (!parser.tokenizer.IsEOF ())
- throw new ExpressionParseException (String.Format ("Unexpected token at end of condition: \"{0}\"", parser.tokenizer.Token.Value));
-
- return e;
- }
-
- ConditionExpression ParseExpression ()
- {
- return ParseBooleanExpression ();
- }
-
- ConditionExpression ParseBooleanExpression ()
- {
- return ParseBooleanAnd ();
- }
-
- ConditionExpression ParseBooleanAnd ()
- {
- ConditionExpression e = ParseBooleanOr ();
-
- while (tokenizer.IsToken (TokenType.And)) {
- tokenizer.GetNextToken ();
- e = new ConditionAndExpression (e, ParseBooleanOr ());
- }
-
- return e;
- }
-
- ConditionExpression ParseBooleanOr ()
- {
- ConditionExpression e = ParseRelationalExpression ();
-
- while (tokenizer.IsToken (TokenType.Or)) {
- tokenizer.GetNextToken ();
- e = new ConditionOrExpression (e, ParseRelationalExpression ());
- }
-
- return e;
- }
-
- ConditionExpression ParseRelationalExpression ()
- {
- ConditionExpression e = ParseFactorExpression ();
-
- Token opToken;
- RelationOperator op;
-
- if (tokenizer.IsToken (TokenType.Less) ||
- tokenizer.IsToken (TokenType.Greater) ||
- tokenizer.IsToken (TokenType.Equal) ||
- tokenizer.IsToken (TokenType.NotEqual) ||
- tokenizer.IsToken (TokenType.LessOrEqual) ||
- tokenizer.IsToken (TokenType.GreaterOrEqual)) {
-
- opToken = tokenizer.Token;
- tokenizer.GetNextToken ();
-
- switch (opToken.Type) {
- case TokenType.Equal:
- op = RelationOperator.Equal;
- break;
- case TokenType.NotEqual:
- op = RelationOperator.NotEqual;
- break;
- case TokenType.Less:
- op = RelationOperator.Less;
- break;
- case TokenType.LessOrEqual:
- op = RelationOperator.LessOrEqual;
- break;
- case TokenType.Greater:
- op = RelationOperator.Greater;
- break;
- case TokenType.GreaterOrEqual:
- op = RelationOperator.GreaterOrEqual;
- break;
- default:
- throw new ExpressionParseException (String.Format ("Wrong relation operator {0}", opToken.Value));
- }
-
- e = new ConditionRelationalExpression (e, ParseFactorExpression (), op);
- }
-
- return e;
- }
-
- ConditionExpression ParseFactorExpression ()
- {
- ConditionExpression e;
- Token token = tokenizer.Token;
- tokenizer.GetNextToken ();
-
- if (token.Type == TokenType.LeftParen) {
- e = ParseExpression ();
- tokenizer.Expect (TokenType.RightParen);
- } else if (token.Type == TokenType.String && tokenizer.Token.Type == TokenType.LeftParen) {
- e = ParseFunctionExpression (token.Value);
- } else if (token.Type == TokenType.String) {
- e = new ConditionFactorExpression (token);
- } else if (token.Type == TokenType.Number) {
- e = new ConditionFactorExpression (token);
- } else if (token.Type == TokenType.Item || token.Type == TokenType.Property
- || token.Type == TokenType.Metadata) {
- e = ParseReferenceExpression (token.Value);
- } else if (token.Type == TokenType.Not) {
- e = ParseNotExpression ();
- } else
- throw new ExpressionParseException (String.Format ("Unexpected token type {0}.", token.Type));
-
- return e;
- }
-
- ConditionExpression ParseNotExpression ()
- {
- return new ConditionNotExpression (ParseFactorExpression ());
- }
-
- ConditionExpression ParseFunctionExpression (string function_name)
- {
- return new ConditionFunctionExpression (function_name, ParseFunctionArguments ());
- }
-
- List <ConditionFactorExpression> ParseFunctionArguments ()
- {
- List <ConditionFactorExpression> list = new List <ConditionFactorExpression> ();
- ConditionFactorExpression e;
-
- while (true) {
- tokenizer.GetNextToken ();
- if (tokenizer.Token.Type == TokenType.RightParen) {
- tokenizer.GetNextToken ();
- break;
- }
- if (tokenizer.Token.Type == TokenType.Comma)
- continue;
-
- tokenizer.Putback (tokenizer.Token);
- e = (ConditionFactorExpression) ParseFactorExpression ();
- list.Add (e);
- }
-
- return list;
- }
-
- //@prefix: @ or $
- ConditionExpression ParseReferenceExpression (string prefix)
- {
- StringBuilder sb = new StringBuilder ();
-
- ExpectToken (TokenType.LeftParen);
- tokenizer.GetNextToken ();
-
- sb.AppendFormat ("{0}({1}", prefix, tokenizer.Token.Value);
-
- tokenizer.GetNextToken ();
- if (prefix == "@" && tokenizer.Token.Type == TokenType.Transform) {
- tokenizer.GetNextToken ();
- sb.AppendFormat ("->'{0}'", tokenizer.Token.Value);
-
- tokenizer.GetNextToken ();
- if (tokenizer.Token.Type == TokenType.Comma) {
- tokenizer.GetNextToken ();
- sb.AppendFormat (", '{0}'", tokenizer.Token.Value);
- tokenizer.GetNextToken ();
- }
- }
-
- ExpectToken (TokenType.RightParen);
- tokenizer.GetNextToken ();
-
- sb.Append (")");
-
- //FIXME: HACKY!
- return new ConditionFactorExpression (new Token (sb.ToString (), TokenType.String));
- }
-
- void ExpectToken (TokenType type)
- {
- if (tokenizer.Token.Type != type)
- throw new ExpressionParseException ("Expected token type of type: " + type + ", got " +
- tokenizer.Token.Type + " (" + tokenizer.Token.Value + ") .");
- }
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionRelationalExpression.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionRelationalExpression.cs
deleted file mode 100644
index fcd5211cab..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionRelationalExpression.cs
+++ /dev/null
@@ -1,167 +0,0 @@
-//
-// ConditionRelationalExpression.cs
-//
-// Author:
-// Marek Sieradzki (marek.sieradzki@gmail.com)
-//
-// (C) 2006 Marek Sieradzki
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-using System;
-using System.Collections;
-using System.Xml;
-
-namespace Microsoft.Build.BuildEngine {
- internal sealed class ConditionRelationalExpression : ConditionExpression {
-
- readonly ConditionExpression left;
- readonly ConditionExpression right;
- readonly RelationOperator op;
-
- public ConditionRelationalExpression (ConditionExpression left,
- ConditionExpression right,
- RelationOperator op)
- {
- this.left = left;
- this.right = right;
- this.op = op;
- }
-
- public override bool BoolEvaluate (IExpressionContext context)
- {
- if (left.CanEvaluateToNumber (context) && right.CanEvaluateToNumber (context)) {
- float l,r;
-
- l = left.NumberEvaluate (context);
- r = right.NumberEvaluate (context);
-
- return NumberCompare (l, r, op);
- } else if (left.CanEvaluateToBool (context) && right.CanEvaluateToBool (context)) {
- bool l,r;
-
- l = left.BoolEvaluate (context);
- r = right.BoolEvaluate (context);
-
- return BoolCompare (l, r, op);
- } else {
- string l,r;
-
- l = left.StringEvaluate (context);
- r = right.StringEvaluate (context);
-
- return StringCompare (l, r, op);
- }
- }
-
- public override float NumberEvaluate (IExpressionContext context)
- {
- throw new NotSupportedException ();
- }
-
- public override string StringEvaluate (IExpressionContext context)
- {
- throw new NotSupportedException ();
- }
-
- // FIXME: check if we really can do it
- public override bool CanEvaluateToBool (IExpressionContext context)
- {
- return true;
- }
-
- public override bool CanEvaluateToNumber (IExpressionContext context)
- {
- return false;
- }
-
- public override bool CanEvaluateToString (IExpressionContext context)
- {
- return false;
- }
-
- static bool NumberCompare (float l,
- float r,
- RelationOperator op)
- {
- IComparer comparer = CaseInsensitiveComparer.DefaultInvariant;
-
- switch (op) {
- case RelationOperator.Equal:
- return comparer.Compare (l, r) == 0;
- case RelationOperator.NotEqual:
- return comparer.Compare (l, r) != 0;
- case RelationOperator.Greater:
- return comparer.Compare (l, r) > 0;
- case RelationOperator.GreaterOrEqual:
- return comparer.Compare (l, r) >= 0;
- case RelationOperator.Less:
- return comparer.Compare (l, r) < 0;
- case RelationOperator.LessOrEqual:
- return comparer.Compare (l, r) <= 0;
- default:
- throw new NotSupportedException (String.Format ("Relational operator {0} is not supported.", op));
- }
- }
-
- static bool BoolCompare (bool l,
- bool r,
- RelationOperator op)
- {
- IComparer comparer = CaseInsensitiveComparer.DefaultInvariant;
-
- switch (op) {
- case RelationOperator.Equal:
- return comparer.Compare (l, r) == 0;
- case RelationOperator.NotEqual:
- return comparer.Compare (l, r) != 0;
- default:
- throw new NotSupportedException (String.Format ("Relational operator {0} is not supported.", op));
- }
- }
-
- static bool StringCompare (string l,
- string r,
- RelationOperator op)
- {
- IComparer comparer = CaseInsensitiveComparer.DefaultInvariant;
-
- switch (op) {
- case RelationOperator.Equal:
- return comparer.Compare (l, r) == 0;
- case RelationOperator.NotEqual:
- return comparer.Compare (l, r) != 0;
- default:
- throw new NotSupportedException (String.Format ("Relational operator {0} is not supported.", op));
- }
- }
- }
-
- internal enum RelationOperator {
- Equal,
- NotEqual,
- Less,
- Greater,
- LessOrEqual,
- GreaterOrEqual
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionTokenizer.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionTokenizer.cs
deleted file mode 100644
index 1927b4bbda..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ConditionTokenizer.cs
+++ /dev/null
@@ -1,301 +0,0 @@
-//
-// ConditionTokenizer.cs
-//
-// Author:
-// Marek Sieradzki (marek.sieradzki@gmail.com)
-// Jaroslaw Kowalski <jaak@jkowalski.net>
-//
-// (C) 2006 Marek Sieradzki
-// (C) 2004-2006 Jaroslaw Kowalski
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.Specialized;
-using System.Text;
-
-namespace Microsoft.Build.BuildEngine {
-
- internal sealed class ConditionTokenizer {
-
- string inputString = null;
- int position = 0;
- int tokenPosition = 0;
-
- Token token;
- Token putback = null;
-
-// bool ignoreWhiteSpace = true;
-
- static TokenType[] charIndexToTokenType = new TokenType[128];
- static Dictionary <string, TokenType> keywords = new Dictionary <string, TokenType> (StringComparer.InvariantCultureIgnoreCase);
-
- static ConditionTokenizer ()
- {
- for (int i = 0; i < 128; i++)
- charIndexToTokenType [i] = TokenType.Invalid;
-
- foreach (CharToTokenType cht in charToTokenType)
- charIndexToTokenType [(int) cht.ch] = cht.tokenType;
-
- keywords.Add ("and", TokenType.And);
- keywords.Add ("or", TokenType.Or);
- }
-
- public ConditionTokenizer ()
- {
-// this.ignoreWhiteSpace = true;
- }
-
- public void Tokenize (string s)
- {
- if (s == null)
- throw new ArgumentNullException ("s");
-
- this.inputString = s;
- this.position = 0;
- this.token = new Token (null, TokenType.BOF);
-
- GetNextToken ();
- }
-
- void SkipWhiteSpace ()
- {
- int ch;
-
- while ((ch = PeekChar ()) != -1) {
- if (!Char.IsWhiteSpace ((char)ch))
- break;
- ReadChar ();
- }
- }
-
- int PeekChar ()
- {
- if (position < inputString.Length)
- return (int) inputString [position];
- else
- return -1;
- }
-
- int ReadChar ()
- {
- if (position < inputString.Length)
- return (int) inputString [position++];
- else
- return -1;
- }
-
- public void Expect (TokenType type)
- {
- if (token.Type != type)
- throw new ExpressionParseException ("Expected token type of type: " + type + ", got " + token.Type +
- " (" + token.Value + ") .");
-
- GetNextToken ();
- }
-
- public bool IsEOF ()
- {
- return token.Type == TokenType.EOF;
- }
-
- public bool IsNumber ()
- {
- return token.Type == TokenType.Number;
- }
-
- public bool IsToken (TokenType type)
- {
- return token.Type == type;
- }
-
- public bool IsPunctation ()
- {
- return (token.Type >= TokenType.FirstPunct && token.Type < TokenType.LastPunct);
- }
-
- // FIXME test this
- public void Putback (Token token)
- {
- putback = token;
- }
-
- public void GetNextToken ()
- {
- if (putback != null) {
- token = putback;
- putback = null;
- return;
- }
-
- if (token.Type == TokenType.EOF)
- throw new ExpressionParseException ("Cannot read past the end of stream.");
-
- SkipWhiteSpace ();
-
- tokenPosition = position;
-
-// int i = PeekChar ();
- int i = ReadChar ();
-
- if (i == -1) {
- token = new Token (null, TokenType.EOF);
- return;
- }
-
- char ch = (char) i;
-
-
- // FIXME: looks like a hack: if '-' is here '->' won't be tokenized
- // maybe we should treat item reference as a token
- if (ch == '-' && PeekChar () == '>') {
- ReadChar ();
- token = new Token ("->", TokenType.Transform);
- } else if (Char.IsDigit (ch) || ch == '-') {
- StringBuilder sb = new StringBuilder ();
-
- sb.Append (ch);
-
- while ((i = PeekChar ()) != -1) {
- ch = (char) i;
-
- if (Char.IsDigit (ch) || ch == '.')
- sb.Append ((char) ReadChar ());
- else
- break;
- }
-
- token = new Token (sb.ToString (), TokenType.Number);
- } else if (ch == '\'') {
- StringBuilder sb = new StringBuilder ();
- string temp;
-
- sb.Append (ch);
- bool is_itemref = (PeekChar () == '@');
- int num_open_braces = 0;
- bool in_literal = false;
-
- while ((i = PeekChar ()) != -1) {
- ch = (char) i;
- if (ch == '(' && !in_literal && is_itemref)
- num_open_braces ++;
- if (ch == ')' && !in_literal && is_itemref)
- num_open_braces --;
-
- sb.Append ((char) ReadChar ());
-
- if (ch == '\'') {
- if (num_open_braces == 0)
- break;
- in_literal = !in_literal;
- }
- }
-
- temp = sb.ToString ();
-
- token = new Token (temp.Substring (1, temp.Length - 2), TokenType.String);
-
- } else if (ch == '_' || Char.IsLetter (ch)) {
- StringBuilder sb = new StringBuilder ();
-
- sb.Append ((char) ch);
-
- while ((i = PeekChar ()) != -1) {
- if ((char) i == '_' || Char.IsLetterOrDigit ((char) i))
- sb.Append ((char) ReadChar ());
- else
- break;
- }
-
- string temp = sb.ToString ();
-
- if (keywords.ContainsKey (temp))
- token = new Token (temp, keywords [temp]);
- else
- token = new Token (temp, TokenType.String);
-
- } else if (ch == '!' && PeekChar () == (int) '=') {
- token = new Token ("!=", TokenType.NotEqual);
- ReadChar ();
- } else if (ch == '<' && PeekChar () == (int) '=') {
- token = new Token ("<=", TokenType.LessOrEqual);
- ReadChar ();
- } else if (ch == '>' && PeekChar () == (int) '=') {
- token = new Token (">=", TokenType.GreaterOrEqual);
- ReadChar ();
- } else if (ch == '=' && PeekChar () == (int) '=') {
- token = new Token ("==", TokenType.Equal);
- ReadChar ();
- } else if (ch >= 32 && ch < 128) {
- if (charIndexToTokenType [ch] != TokenType.Invalid) {
- token = new Token (new String (ch, 1), charIndexToTokenType [ch]);
- return;
- } else
- throw new ExpressionParseException (String.Format ("Invalid punctuation: {0}", ch));
- } else
- throw new ExpressionParseException (String.Format ("Invalid token: {0}", ch));
- }
-
- public int TokenPosition {
- get { return tokenPosition; }
- }
-
- public Token Token {
- get { return token; }
- }
-
-/*
- public bool IgnoreWhiteSpace {
- get { return ignoreWhiteSpace; }
- set { ignoreWhiteSpace = value; }
- }
-*/
-
- struct CharToTokenType {
- public char ch;
- public TokenType tokenType;
-
- public CharToTokenType (char ch, TokenType tokenType)
- {
- this.ch = ch;
- this.tokenType = tokenType;
- }
- }
-
- static CharToTokenType[] charToTokenType = {
- new CharToTokenType ('<', TokenType.Less),
- new CharToTokenType ('>', TokenType.Greater),
- new CharToTokenType ('=', TokenType.Equal),
- new CharToTokenType ('(', TokenType.LeftParen),
- new CharToTokenType (')', TokenType.RightParen),
- new CharToTokenType ('.', TokenType.Dot),
- new CharToTokenType (',', TokenType.Comma),
- new CharToTokenType ('!', TokenType.Not),
- new CharToTokenType ('@', TokenType.Item),
- new CharToTokenType ('$', TokenType.Property),
- new CharToTokenType ('%', TokenType.Metadata),
- new CharToTokenType ('\'', TokenType.Apostrophe),
- };
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ExpressionParseException.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ExpressionParseException.cs
deleted file mode 100644
index 0cb29491fd..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/ExpressionParseException.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// ExpressionParseException.cs
-//
-// Author:
-// Marek Sieradzki (marek.sieradzki@gmail.com)
-//
-// (C) 2006 Marek Sieradzki
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-using System;
-using System.Runtime.Serialization;
-
-namespace Microsoft.Build.BuildEngine {
- [Serializable]
- internal class ExpressionParseException : Exception {
-
- public ExpressionParseException ()
- : base ("Exception occured when parsing an expression.")
- {
- }
-
- public ExpressionParseException (string message)
- : base (message)
- {
- }
-
- public ExpressionParseException (string message,
- Exception innerException)
- : base (message, innerException)
- {
- }
-
- protected ExpressionParseException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/InvalidProjectFileException.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/InvalidProjectFileException.cs
deleted file mode 100644
index 1c64bd264c..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/InvalidProjectFileException.cs
+++ /dev/null
@@ -1,192 +0,0 @@
-//
-// InvalidProjectFileException.cs:
-//
-// Author:
-// Marek Sieradzki (marek.sieradzki@gmail.com)
-//
-// (C) 2005 Marek Sieradzki
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-
-using System;
-using System.Runtime.Serialization;
-using System.Security.Permissions;
-using System.Xml;
-
-namespace Microsoft.Build.BuildEngine {
- [Serializable]
- public sealed class InvalidProjectFileException : Exception {
-
- int columnNumber;
- int endColumnNumber;
- string errorCode;
- string errorSubcategory;
- string helpKeyword;
- int lineNumber;
- int endLineNumber;
- string projectFile;
-
- public InvalidProjectFileException ()
- : base ("Invalid project file exception has occured")
- {
- }
-
- public InvalidProjectFileException (string message)
- : base (message)
- {
- }
-
- public InvalidProjectFileException (string projectFile,
- int lineNumber,
- int columnNumber,
- int endLineNumber,
- int endColumnNumber,
- string message,
- string errorSubcategory,
- string errorCode,
- string helpKeyword)
- : base (message)
- {
- this.projectFile = projectFile;
- this.lineNumber = lineNumber;
- this.columnNumber = columnNumber;
- this.endLineNumber = endLineNumber;
- this.endColumnNumber = endColumnNumber;
- this.errorSubcategory = errorSubcategory;
- this.errorCode = errorCode;
- this.helpKeyword = helpKeyword;
- }
-
- public InvalidProjectFileException (string message,
- Exception innerException)
- : base (message, innerException)
- {
- }
-
- // FIXME: set line/column numbers?
- public InvalidProjectFileException (XmlNode xmlNode,
- string message,
- string errorSubcategory,
- string errorCode,
- string helpKeyword)
- : base (message)
- {
- this.errorSubcategory = errorSubcategory;
- this.errorCode = errorCode;
- this.helpKeyword = helpKeyword;
- }
-
- // FIXME: private temporarily
- private InvalidProjectFileException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- this.columnNumber = info.GetInt32 ("columnNumber");
- this.endColumnNumber = info.GetInt32 ("endColumnNumber");
- this.errorCode = info.GetString ("errorCode");
- this.errorSubcategory = info.GetString ("errorSubcategory");
- this.helpKeyword = info.GetString ("helpKeyword");
- this.lineNumber = info.GetInt32 ("lineNumber");
- this.endLineNumber = info.GetInt32 ("endLineNumber");
- this.projectFile = info.GetString ("projectFile");
- }
-
- [SecurityPermission (SecurityAction.LinkDemand, SerializationFormatter = true)]
- public override void GetObjectData (SerializationInfo info,
- StreamingContext context)
- {
- base.GetObjectData (info, context);
- info.AddValue ("columnNumber", columnNumber);
- info.AddValue ("endColumnNumber", endColumnNumber);
- info.AddValue ("errorCode", errorCode);
- info.AddValue ("errorSubcategory", errorSubcategory);
- info.AddValue ("helpKeyword", helpKeyword);
- info.AddValue ("lineNumber", lineNumber);
- info.AddValue ("endLineNumber", endLineNumber);
- info.AddValue ("projectFile", projectFile);
- }
-
- public string BaseMessage {
- get {
- return base.Message;
- }
- }
-
- public int ColumnNumber {
- get {
- return columnNumber;
- }
- }
-
- public int EndColumnNumber {
- get {
- return endColumnNumber;
- }
- }
-
- public int EndLineNumber {
- get {
- return endLineNumber;
- }
- }
-
- public string ErrorCode {
- get {
- return errorCode;
- }
- }
-
- public string ErrorSubcategory {
- get {
- return errorSubcategory;
- }
- }
-
- public string HelpKeyword {
- get {
- return helpKeyword;
- }
- }
-
- public int LineNumber {
- get {
- return lineNumber;
- }
- }
-
- public override string Message {
- get {
- if (projectFile == null || projectFile == String.Empty) {
- return BaseMessage;
- } else {
- return BaseMessage + " " + ProjectFile;
- }
- }
- }
-
- public string ProjectFile {
- get {
- return projectFile;
- }
- }
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/Token.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/Token.cs
deleted file mode 100644
index 801b4cdd98..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild.Conditions/Token.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// TokenType.cs
-//
-// Author:
-// Marek Sieradzki (marek.sieradzki@gmail.com)
-// Jaroslaw Kowalski <jaak@jkowalski.net>
-//
-// (C) 2006 Marek Sieradzki
-// (C) 2004-2006 Jaroslaw Kowalski
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-using System;
-
-namespace Microsoft.Build.BuildEngine {
-
- internal class Token {
-
- string tokenValue;
- TokenType tokenType;
-
- public Token (string tokenValue, TokenType tokenType)
- {
- this.tokenValue = tokenValue;
- this.tokenType = tokenType;
- }
-
- public string Value {
- get { return tokenValue; }
- }
-
- public TokenType Type {
- get { return tokenType; }
- }
-
- public override string ToString ()
- {
- return String.Format ("Token (Type: {0} -> Value: {1})", tokenType, tokenValue);
- }
- }
-
- internal enum TokenType {
- EOF,
- BOF,
- Number,
- String,
- //Keyword,
- Punct,
- WhiteSpace,
- Item,
- Property,
- Metadata,
- FunctionName,
- Transform,
-// LiteralSubExpression,
-
- FirstPunct,
-
- Less,
- Greater,
- LessOrEqual,
- GreaterOrEqual,
- Equal,
- NotEqual,
- LeftParen,
- RightParen,
- Dot,
- Comma,
- Not,
- And,
- Or,
- Apostrophe,
-
- LastPunct,
- Invalid,
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/CompiledAssemblyProjectMSBuildHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/CompiledAssemblyProjectMSBuildHandler.cs
deleted file mode 100644
index 513a286921..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/CompiledAssemblyProjectMSBuildHandler.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-//
-// CompiledAssemblyProjectMSBuildHandler.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using MonoDevelop.Core.Serialization;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Projects.Formats.MSBuild
-{
- class CompiledAssemblyProjectMSBuildHandler: MSBuildProjectHandler
- {
- public override bool HasSlnData {
- get {
- return true;
- }
- }
-
- public override DataItem WriteSlnData ()
- {
- DataSerializer ser = new DataSerializer (MSBuildProjectService.DataContext);
- ser.SerializationContext.BaseFile = EntityItem.FileName;
- ser.SerializationContext.DirectorySeparatorChar = '\\';
- DataItem data = (DataItem) ser.Serialize (EntityItem, typeof(CompiledAssemblyProject));
- return data;
- }
-
- public override void ReadSlnData (DataItem item)
- {
- // Remove the default configuration, since new ones will be loaded
- CompiledAssemblyProject project = (CompiledAssemblyProject) EntityItem;
- project.Configurations.Clear ();
-
- DataSerializer ser = new DataSerializer (MSBuildProjectService.DataContext);
- ser.SerializationContext.BaseFile = EntityItem.FileName;
- ser.SerializationContext.DirectorySeparatorChar = '\\';
- ser.Deserialize (project, item);
- }
-
- protected override void SaveItem (IProgressMonitor monitor)
- {
- // Do nothing, since info is saved to the .sln
- }
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/IMSBuildGlobalPropertyProvider.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/IMSBuildGlobalPropertyProvider.cs
deleted file mode 100644
index df7c76e443..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/IMSBuildGlobalPropertyProvider.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// IMSBuildGlobalPropertyProvider.cs
-//
-// Author:
-// Michael Hutchinson <m.j.hutchinson@gmail.com>
-//
-// Copyright (c) 2014 Xamarin Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Collections.Generic;
-
-namespace MonoDevelop.Projects.Formats.MSBuild
-{
- public interface IMSBuildGlobalPropertyProvider
- {
- event EventHandler GlobalPropertiesChanged;
- IDictionary<string,string> GetGlobalProperties ();
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/IMSBuildImportProvider.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/IMSBuildImportProvider.cs
deleted file mode 100644
index 397e432eaf..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/IMSBuildImportProvider.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// IMSBuildImportProvider.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-
-namespace MonoDevelop.Projects.Formats.MSBuild
-{
- public interface IMSBuildImportProvider
- {
- void UpdateImports (SolutionEntityItem item, List<string> imports);
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildExtension.cs
deleted file mode 100644
index adb9f0a0c4..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildExtension.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// MSBuildExtension.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@xamarin.com>
-//
-// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Projects.Formats.MSBuild
-{
- public class MSBuildExtension
- {
- public MSBuildProjectHandler Handler { get; set; }
-
- public virtual void LoadProject (IProgressMonitor monitor, SolutionEntityItem item, MSBuildProject project)
- {
- }
-
- public virtual void SaveProject (IProgressMonitor monitor, SolutionEntityItem item, MSBuildProject project)
- {
- }
-
- public virtual object GetService (Type t)
- {
- return null;
- }
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildFileFormat.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildFileFormat.cs
deleted file mode 100644
index 814935bdbb..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildFileFormat.cs
+++ /dev/null
@@ -1,353 +0,0 @@
-// MSBuildFileFormat.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.Xml;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using MonoDevelop.Core;
-using MonoDevelop.Core.Assemblies;
-using MonoDevelop.Projects.Extensions;
-
-namespace MonoDevelop.Projects.Formats.MSBuild
-{
- public abstract class MSBuildFileFormat: IFileFormat
- {
- readonly SlnFileFormat slnFileFormat = new SlnFileFormat ();
-
- public string Name {
- get { return "MSBuild"; }
- }
-
- public SlnFileFormat SlnFileFormat {
- get { return slnFileFormat; }
- }
-
- public bool SupportsMonikers { get { return SupportedFrameworks == null; } }
-
- public bool SupportsFramework (TargetFramework fx)
- {
- return SupportsMonikers || ((IList<TargetFrameworkMoniker>)SupportedFrameworks).Contains (fx.Id);
- }
-
- internal virtual bool SupportsSlnVersion (string version)
- {
- return version == SlnVersion;
- }
-
- protected virtual bool SupportsToolsVersion (string version)
- {
- return version == DefaultToolsVersion;
- }
-
- public FilePath GetValidFormatName (object obj, FilePath fileName)
- {
- if (slnFileFormat.CanWriteFile (obj, this))
- return slnFileFormat.GetValidFormatName (obj, fileName, this);
- else {
- string ext = MSBuildProjectService.GetExtensionForItem ((SolutionEntityItem)obj);
- if (!string.IsNullOrEmpty (ext))
- return fileName.ChangeExtension ("." + ext);
- else
- return fileName;
- }
- }
-
- public bool CanReadFile (FilePath file, Type expectedType)
- {
- if (expectedType.IsAssignableFrom (typeof(Solution)) && slnFileFormat.CanReadFile (file, this))
- return true;
- else if (expectedType.IsAssignableFrom (typeof(SolutionEntityItem))) {
- if (!MSBuildProjectService.CanReadFile (file))
- return false;
- //TODO: check ProductVersion first
- return SupportsToolsVersion (ReadToolsVersion (file));
- }
- return false;
- }
-
- public bool CanWriteFile (object obj)
- {
- if (slnFileFormat.CanWriteFile (obj, this)) {
- Solution sol = (Solution) obj;
- foreach (SolutionEntityItem si in sol.GetAllSolutionItems<SolutionEntityItem> ())
- if (!CanWriteFile (si))
- return false;
- return true;
- }
- else if (obj is SolutionEntityItem) {
- DotNetProject p = obj as DotNetProject;
- // Check the framework only if the project is not loading, since otherwise the
- // project may not yet have the framework info set.
- if (p != null && !p.Loading && !SupportsFramework (p.TargetFramework))
- return false;
-
- // This file format can write all types of projects. If there isn't a handler for a project,
- // it will use a generic handler.
- return true;
- } else
- return false;
- }
-
- public virtual IEnumerable<string> GetCompatibilityWarnings (object obj)
- {
- if (obj is Solution) {
- List<string> msg = new List<string> ();
- foreach (SolutionEntityItem si in ((Solution)obj).GetAllSolutionItems<SolutionEntityItem> ()) {
- IEnumerable<string> ws = GetCompatibilityWarnings (si);
- if (ws != null)
- msg.AddRange (ws);
- }
- return msg;
- }
- var prj = obj as DotNetProject;
- if (prj != null && !SupportsMonikers && !((IList)SupportedFrameworks).Contains (prj.TargetFramework.Id))
- return new [] { GettextCatalog.GetString (
- "The project '{0}' is being saved using the file format '{1}', but this version of Visual Studio " +
- "does not support the framework that the project is targetting ({2})",
- prj.Name, ProductDescription, prj.TargetFramework.Name)
- };
- return null;
- }
-
- public void WriteFile (FilePath file, object obj, IProgressMonitor monitor)
- {
- if (slnFileFormat.CanWriteFile (obj, this)) {
- slnFileFormat.WriteFile (file, obj, this, true, monitor);
- } else {
- SolutionEntityItem item = (SolutionEntityItem) obj;
- if (!(item.ItemHandler is MSBuildProjectHandler))
- MSBuildProjectService.InitializeItemHandler (item);
- MSBuildProjectHandler handler = (MSBuildProjectHandler) item.ItemHandler;
- handler.SetSolutionFormat (this, false);
- handler.Save (monitor);
- }
- }
-
- public object ReadFile (FilePath file, Type expectedType, MonoDevelop.Core.IProgressMonitor monitor)
- {
- if (slnFileFormat.CanReadFile (file, this))
- return slnFileFormat.ReadFile (file, this, monitor);
- else
- return MSBuildProjectService.LoadItem (monitor, file, null, null, null);
- }
-
- public List<FilePath> GetItemFiles (object obj)
- {
- return new List<FilePath> ();
- }
-
- public void ConvertToFormat (object obj)
- {
- if (obj == null)
- return;
-
- MSBuildHandler handler;
- SolutionItem item = obj as SolutionItem;
- if (item != null) {
- handler = item.GetItemHandler() as MSBuildHandler;
- if (handler != null) {
- handler.SetSolutionFormat (this, true);
- return;
- }
- }
-
- MSBuildProjectService.InitializeItemHandler (item);
- handler = (MSBuildHandler) item.ItemHandler;
- handler.SetSolutionFormat (this, true);
- }
-
- public bool SupportsMixedFormats {
- get { return false; }
- }
-
- public abstract string DefaultToolsVersion { get; }
-
- public abstract string SlnVersion { get; }
-
- public virtual string DefaultProductVersion { get { return null; } }
-
- public virtual string DefaultSchemaVersion { get { return null; } }
-
- public abstract string ProductDescription { get; }
-
- public virtual TargetFrameworkMoniker[] SupportedFrameworks {
- get { return null; }
- }
-
- static string ReadToolsVersion (FilePath file)
- {
- try {
- using (XmlTextReader tr = new XmlTextReader (new StreamReader (file))) {
- if (tr.MoveToContent () == XmlNodeType.Element) {
- if (tr.LocalName != "Project" || tr.NamespaceURI != "http://schemas.microsoft.com/developer/msbuild/2003")
- return string.Empty;
- string tv = tr.GetAttribute ("ToolsVersion");
- if (string.IsNullOrEmpty (tv))
- return "2.0"; // Some old VS versions don't specify the tools version, so assume 2.0
- else
- return tv;
- }
- }
- } catch {
- // Ignore
- }
- return string.Empty;
- }
-
- public abstract string Id { get; }
- }
-
- class MSBuildFileFormatVS05: MSBuildFileFormat
- {
- static readonly TargetFrameworkMoniker[] supportedFrameworks = {
- TargetFrameworkMoniker.NET_2_0,
- };
-
- public override string Id {
- get { return "MSBuild05"; }
- }
-
- public override string DefaultProductVersion {
- get { return "8.0.50727"; }
- }
-
- public override string DefaultToolsVersion {
- get { return "2.0"; }
- }
-
- public override string DefaultSchemaVersion {
- get { return "2.0"; }
- }
-
- public override string SlnVersion {
- get { return "9.00"; }
- }
-
- public override string ProductDescription {
- get { return "Visual Studio 2005"; }
- }
-
- public override TargetFrameworkMoniker[] SupportedFrameworks {
- get { return supportedFrameworks; }
- }
- }
-
- class MSBuildFileFormatVS08: MSBuildFileFormat
- {
- static readonly TargetFrameworkMoniker[] supportedFrameworks = {
- TargetFrameworkMoniker.NET_2_0,
- TargetFrameworkMoniker.NET_3_0,
- TargetFrameworkMoniker.NET_3_5,
- TargetFrameworkMoniker.SL_2_0,
- TargetFrameworkMoniker.SL_3_0,
- TargetFrameworkMoniker.MONOTOUCH_1_0,
- };
-
- public override string Id {
- get { return "MSBuild08"; }
- }
-
- public override string DefaultProductVersion {
- get { return "9.0.21022"; }
- }
-
- public override string DefaultToolsVersion {
- get { return "3.5"; }
- }
-
- public override string DefaultSchemaVersion {
- get { return "2.0"; }
- }
-
- public override string SlnVersion {
- get { return "10.00"; }
- }
-
- public override string ProductDescription {
- get { return "Visual Studio 2008"; }
- }
-
- public override TargetFrameworkMoniker[] SupportedFrameworks {
- get { return supportedFrameworks; }
- }
- }
-
- class MSBuildFileFormatVS10: MSBuildFileFormat
- {
- public override string Id {
- get { return "MSBuild10"; }
- }
-
- //WTF VS
- public override string DefaultProductVersion {
- get { return "8.0.30703"; }
- }
-
- public override string DefaultSchemaVersion {
- get { return "2.0"; }
- }
-
- public override string DefaultToolsVersion {
- get { return "4.0"; }
- }
-
- public override string SlnVersion {
- get { return "11.00"; }
- }
-
- public override string ProductDescription {
- get { return "Visual Studio 2010"; }
- }
- }
-
- // this is actually VS2010 SP1 and later
- class MSBuildFileFormatVS12: MSBuildFileFormat
- {
- public override string Id {
- get { return "MSBuild12"; }
- }
-
- public override string DefaultToolsVersion {
- get { return "4.0"; }
- }
-
- public override string SlnVersion {
- get { return "12.00"; }
- }
-
- public override string ProductDescription {
- get { return "Visual Studio 2012"; }
- }
-
- protected override bool SupportsToolsVersion (string version)
- {
- return version == "4.0" || version == "12.0" || version == "14.0";
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildHandler.cs
deleted file mode 100644
index 29e862cb26..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildHandler.cs
+++ /dev/null
@@ -1,172 +0,0 @@
-// MSBuildHandler.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.IO;
-using System.Collections;
-using System.Collections.Generic;
-using System.Reflection;
-using MonoDevelop.Core;
-using MonoDevelop.Core.Serialization;
-using MonoDevelop.Projects;
-using MonoDevelop.Projects.Extensions;
-
-namespace MonoDevelop.Projects.Formats.MSBuild
-{
- public class MSBuildHandler: ISolutionItemHandler
- {
- SolutionItem item;
- string typeGuid;
- string id;
- string[] slnProjectContent;
- DataItem customSlnData;
-
- internal List<string> UnresolvedProjectDependencies { get; set; }
-
- internal protected MSBuildHandler ()
- {
- }
-
- public MSBuildHandler (string typeGuid, string itemId)
- {
- Initialize (typeGuid, itemId);
- }
-
- internal void Initialize (string typeGuid, string itemId)
- {
- this.typeGuid = typeGuid;
- this.id = itemId;
- }
-
- // When set, it means this item is saved as part of a global solution save operation
- internal bool SavingSolution { get; set; }
-
- internal protected SolutionItem Item {
- get { return item; }
- set { item = value; }
- }
-
- public virtual bool SyncFileName {
- get { return true; }
- }
-
- public string TypeGuid {
- get {
- return typeGuid;
- }
- }
-
- internal string[] SlnProjectContent {
- get {
- return slnProjectContent;
- }
- set {
- slnProjectContent = value;
- }
- }
-
- public string ItemId {
- get {
- if (id == null)
- id = String.Format ("{{{0}}}", System.Guid.NewGuid ().ToString ().ToUpper ());
- return id;
- }
- set { id = value; }
- }
-
- internal MSBuildFileFormat SolutionFormat { get; private set; }
-
- internal virtual void SetSolutionFormat (MSBuildFileFormat format, bool converting)
- {
- SolutionFormat = format;
- }
-
- public virtual BuildResult RunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration)
- {
- throw new NotSupportedException ();
- }
-
- public void Save (IProgressMonitor monitor)
- {
- if (HasSlnData && !SavingSolution && Item.ParentSolution != null) {
- // The project has data that has to be saved in the solution, but the solution is not being saved. Do it now.
- monitor.BeginTask (null, 2);
- SaveItem (monitor);
- monitor.Step (1);
- Solution sol = Item.ParentSolution;
- SolutionFormat.SlnFileFormat.WriteFile (sol.FileName, sol, SolutionFormat, false, monitor);
- sol.NeedsReload = false;
- monitor.EndTask ();
- } else
- SaveItem (monitor);
- }
-
- protected virtual void SaveItem (MonoDevelop.Core.IProgressMonitor monitor)
- {
- throw new NotSupportedException ();
- }
-
- public virtual void OnModified (string hint)
- {
- }
-
- public virtual void Dispose ()
- {
- }
-
- public virtual bool HasSlnData {
- get { return false; }
- }
-
- public virtual DataItem WriteSlnData ()
- {
- return customSlnData;
- }
-
- public virtual void ReadSlnData (DataItem item)
- {
- customSlnData = item;
- }
-
- /// <summary>
- /// Gets a service instance of a given type
- /// </summary>
- /// <returns>
- /// The service.
- /// </returns>
- /// <param name='t'>
- /// Type of the service
- /// </param>
- /// <remarks>
- /// This method looks for an imlpementation of a service of the given type.
- /// </remarks>
- public virtual object GetService (Type t)
- {
- return null;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildImportAttribute.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildImportAttribute.cs
deleted file mode 100644
index 04e8c4d260..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildImportAttribute.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// MSBuildImportAttribute.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-
-namespace MonoDevelop.Projects.Formats.MSBuild
-{
- [AttributeUsage (AttributeTargets.Class)]
- public class MSBuildImportAttribute: Attribute
- {
- public MSBuildImportAttribute (string project)
- {
- Project = project;
- }
-
- public string Project { get; set; }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProject.cs
deleted file mode 100644
index bc122951c5..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProject.cs
+++ /dev/null
@@ -1,1096 +0,0 @@
-// MSBuildProject.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.Linq;
-using System.IO;
-using System.Collections.Generic;
-using System.Xml;
-using System.Text;
-
-using MonoDevelop.Projects.Utility;
-using MonoDevelop.Projects.Text;
-using Microsoft.Build.BuildEngine;
-
-namespace MonoDevelop.Projects.Formats.MSBuild
-{
- public class MSBuildProject
- {
- XmlDocument doc;
- string file;
- Dictionary<XmlElement,MSBuildObject> elemCache = new Dictionary<XmlElement,MSBuildObject> ();
- Dictionary<string, MSBuildItemGroup> bestGroups;
-
- public const string Schema = "http://schemas.microsoft.com/developer/msbuild/2003";
- static XmlNamespaceManager manager;
-
- bool endsWithEmptyLine;
- string newLine = Environment.NewLine;
- ByteOrderMark bom;
-
- internal static XmlNamespaceManager XmlNamespaceManager {
- get {
- if (manager == null) {
- manager = new XmlNamespaceManager (new NameTable ());
- manager.AddNamespace ("tns", Schema);
- }
- return manager;
- }
- }
-
- public string FileName {
- get { return file; }
- }
-
- public XmlDocument Document {
- get { return doc; }
- }
-
- public MSBuildProject ()
- {
- doc = new XmlDocument ();
- doc.PreserveWhitespace = false;
- doc.AppendChild (doc.CreateElement (null, "Project", Schema));
- }
-
- public void Load (string file)
- {
- this.file = file;
- using (FileStream fs = File.OpenRead (file)) {
- byte[] buf = new byte [1024];
- int nread, i;
-
- if ((nread = fs.Read (buf, 0, buf.Length)) <= 0)
- return;
-
- if (ByteOrderMark.TryParse (buf, nread, out bom))
- i = bom.Length;
- else
- i = 0;
-
- do {
- // Read to the first newline to figure out which line endings this file is using
- while (i < nread) {
- if (buf[i] == '\r') {
- newLine = "\r\n";
- break;
- } else if (buf[i] == '\n') {
- newLine = "\n";
- break;
- }
-
- i++;
- }
-
- if (newLine == null) {
- if ((nread = fs.Read (buf, 0, buf.Length)) <= 0) {
- newLine = "\n";
- break;
- }
-
- i = 0;
- }
- } while (newLine == null);
-
- // Check for a blank line at the end
- endsWithEmptyLine = fs.Seek (-1, SeekOrigin.End) > 0 && fs.ReadByte () == (int) '\n';
- }
-
- // Load the XML document
- doc = new XmlDocument ();
- doc.PreserveWhitespace = false;
-
- // HACK: XmlStreamReader will fail if the file is encoded in UTF-8 but has <?xml version="1.0" encoding="utf-16"?>
- // To work around this, we load the XML content into a string and use XmlDocument.LoadXml() instead.
- string xml = File.ReadAllText (file);
-
- doc.LoadXml (xml);
- Evaluate ();
- }
-
- class ProjectWriter : StringWriter
- {
- Encoding encoding;
-
- public ProjectWriter (ByteOrderMark bom)
- {
- encoding = bom != null ? Encoding.GetEncoding (bom.Name) : null;
- ByteOrderMark = bom;
- }
-
- public ByteOrderMark ByteOrderMark {
- get; private set;
- }
-
- public override Encoding Encoding {
- get { return encoding ?? Encoding.UTF8; }
- }
- }
-
- public void Save (string fileName)
- {
- string content = SaveToString ();
- TextFile.WriteFile (fileName, content, bom, true);
- }
-
- public string SaveToString ()
- {
- // StringWriter.Encoding always returns UTF16. We need it to return UTF8, so the
- // XmlDocument will write the UTF8 header.
- ProjectWriter sw = new ProjectWriter (bom);
- sw.NewLine = newLine;
- doc.Save (sw);
-
- string content = sw.ToString ();
- if (endsWithEmptyLine && !content.EndsWith (newLine))
- content += newLine;
-
- return content;
- }
-
- public void Evaluate ()
- {
- Evaluate (new MSBuildEvaluationContext ());
- }
-
- public void Evaluate (MSBuildEvaluationContext context)
- {
- context.InitEvaluation (this);
- foreach (var pg in PropertyGroups)
- pg.Evaluate (context);
- foreach (var pg in ItemGroups)
- pg.Evaluate (context);
- }
-
- public string DefaultTargets {
- get { return doc.DocumentElement.GetAttribute ("DefaultTargets"); }
- set { doc.DocumentElement.SetAttribute ("DefaultTargets", value); }
- }
-
- public string ToolsVersion {
- get { return doc.DocumentElement.GetAttribute ("ToolsVersion"); }
- set {
- if (!string.IsNullOrEmpty (value))
- doc.DocumentElement.SetAttribute ("ToolsVersion", value);
- else
- doc.DocumentElement.RemoveAttribute ("ToolsVersion");
- }
- }
-
- public MSBuildImport AddNewImport (string name, MSBuildImport beforeImport = null)
- {
- XmlElement elem = doc.CreateElement (null, "Import", MSBuildProject.Schema);
- elem.SetAttribute ("Project", name);
-
- if (beforeImport != null) {
- doc.DocumentElement.InsertBefore (elem, beforeImport.Element);
- } else {
- XmlElement last = doc.DocumentElement.SelectSingleNode ("tns:Import[last()]", XmlNamespaceManager) as XmlElement;
- if (last != null)
- doc.DocumentElement.InsertAfter (elem, last);
- else
- doc.DocumentElement.AppendChild (elem);
- }
- return new MSBuildImport (elem);
- }
-
- public void RemoveImport (string name)
- {
- XmlElement elem = (XmlElement) doc.DocumentElement.SelectSingleNode ("tns:Import[@Project='" + name + "']", XmlNamespaceManager);
- if (elem != null)
- elem.ParentNode.RemoveChild (elem);
- else
- //FIXME: should this actually log an error?
- Console.WriteLine ("ppnf:");
- }
-
- public IEnumerable<MSBuildImport> Imports {
- get {
- foreach (XmlElement elem in doc.DocumentElement.SelectNodes ("tns:Import", XmlNamespaceManager))
- yield return new MSBuildImport (elem);
- }
- }
-
- public MSBuildPropertySet GetGlobalPropertyGroup ()
- {
- MSBuildPropertyGroupMerged res = new MSBuildPropertyGroupMerged ();
- foreach (MSBuildPropertyGroup grp in PropertyGroups) {
- if (grp.Condition.Length == 0)
- res.Add (grp);
- }
- return res.GroupCount > 0 ? res : null;
- }
-
- public MSBuildPropertyGroup AddNewPropertyGroup (bool insertAtEnd)
- {
- XmlElement elem = doc.CreateElement (null, "PropertyGroup", MSBuildProject.Schema);
-
- if (insertAtEnd) {
- XmlElement last = doc.DocumentElement.SelectSingleNode ("tns:PropertyGroup[last()]", XmlNamespaceManager) as XmlElement;
- if (last != null)
- doc.DocumentElement.InsertAfter (elem, last);
- } else {
- XmlElement first = doc.DocumentElement.SelectSingleNode ("tns:PropertyGroup", XmlNamespaceManager) as XmlElement;
- if (first != null)
- doc.DocumentElement.InsertBefore (elem, first);
- }
-
- if (elem.ParentNode == null) {
- XmlElement first = doc.DocumentElement.SelectSingleNode ("tns:ItemGroup", XmlNamespaceManager) as XmlElement;
- if (first != null)
- doc.DocumentElement.InsertBefore (elem, first);
- else
- doc.DocumentElement.AppendChild (elem);
- }
-
- return GetGroup (elem);
- }
-
- public IEnumerable<MSBuildItem> GetAllItems ()
- {
- foreach (XmlElement elem in doc.DocumentElement.SelectNodes ("tns:ItemGroup/*", XmlNamespaceManager)) {
- yield return GetItem (elem);
- }
- }
-
- public IEnumerable<MSBuildItem> GetAllItems (params string[] names)
- {
- string name = string.Join ("|tns:ItemGroup/tns:", names);
- foreach (XmlElement elem in doc.DocumentElement.SelectNodes ("tns:ItemGroup/tns:" + name, XmlNamespaceManager)) {
- yield return GetItem (elem);
- }
- }
-
- public IEnumerable<MSBuildPropertyGroup> PropertyGroups {
- get {
- foreach (XmlElement elem in doc.DocumentElement.SelectNodes ("tns:PropertyGroup", XmlNamespaceManager))
- yield return GetGroup (elem);
- }
- }
-
- public IEnumerable<MSBuildItemGroup> ItemGroups {
- get {
- foreach (XmlElement elem in doc.DocumentElement.SelectNodes ("tns:ItemGroup", XmlNamespaceManager))
- yield return GetItemGroup (elem);
- }
- }
-
- public MSBuildItemGroup AddNewItemGroup ()
- {
- XmlElement elem = doc.CreateElement (null, "ItemGroup", MSBuildProject.Schema);
- doc.DocumentElement.AppendChild (elem);
- return GetItemGroup (elem);
- }
-
- public MSBuildItem AddNewItem (string name, string include)
- {
- MSBuildItemGroup grp = FindBestGroupForItem (name);
- return grp.AddNewItem (name, include);
- }
-
- MSBuildItemGroup FindBestGroupForItem (string itemName)
- {
- MSBuildItemGroup group;
-
- if (bestGroups == null)
- bestGroups = new Dictionary<string, MSBuildItemGroup> ();
- else {
- if (bestGroups.TryGetValue (itemName, out group))
- return group;
- }
-
- foreach (MSBuildItemGroup grp in ItemGroups) {
- foreach (MSBuildItem it in grp.Items) {
- if (it.Name == itemName) {
- bestGroups [itemName] = grp;
- return grp;
- }
- }
- }
- group = AddNewItemGroup ();
- bestGroups [itemName] = group;
- return group;
- }
-
- public string GetProjectExtensions (string section)
- {
- XmlElement elem = doc.DocumentElement.SelectSingleNode ("tns:ProjectExtensions/tns:" + section, XmlNamespaceManager) as XmlElement;
- if (elem != null)
- return elem.InnerXml;
- else
- return string.Empty;
- }
-
- public void SetProjectExtensions (string section, string value)
- {
- XmlElement elem = doc.DocumentElement ["ProjectExtensions", MSBuildProject.Schema];
- if (elem == null) {
- elem = doc.CreateElement (null, "ProjectExtensions", MSBuildProject.Schema);
- doc.DocumentElement.AppendChild (elem);
- }
- XmlElement sec = elem [section];
- if (sec == null) {
- sec = doc.CreateElement (null, section, MSBuildProject.Schema);
- elem.AppendChild (sec);
- }
- sec.InnerXml = value;
- }
-
- public void RemoveProjectExtensions (string section)
- {
- XmlElement elem = doc.DocumentElement.SelectSingleNode ("tns:ProjectExtensions/tns:" + section, XmlNamespaceManager) as XmlElement;
- if (elem != null) {
- XmlElement parent = (XmlElement) elem.ParentNode;
- parent.RemoveChild (elem);
- if (!parent.HasChildNodes)
- parent.ParentNode.RemoveChild (parent);
- }
- }
-
- public void RemoveItem (MSBuildItem item)
- {
- elemCache.Remove (item.Element);
- XmlElement parent = (XmlElement) item.Element.ParentNode;
- item.Element.ParentNode.RemoveChild (item.Element);
- if (parent.ChildNodes.Count == 0) {
- elemCache.Remove (parent);
- parent.ParentNode.RemoveChild (parent);
- bestGroups = null;
- }
- }
-
- internal MSBuildItem GetItem (XmlElement elem)
- {
- MSBuildObject ob;
- if (elemCache.TryGetValue (elem, out ob))
- return (MSBuildItem) ob;
- MSBuildItem it = new MSBuildItem (elem);
- elemCache [elem] = it;
- return it;
- }
-
- MSBuildPropertyGroup GetGroup (XmlElement elem)
- {
- MSBuildObject ob;
- if (elemCache.TryGetValue (elem, out ob))
- return (MSBuildPropertyGroup) ob;
- MSBuildPropertyGroup it = new MSBuildPropertyGroup (this, elem);
- elemCache [elem] = it;
- return it;
- }
-
- MSBuildItemGroup GetItemGroup (XmlElement elem)
- {
- MSBuildObject ob;
- if (elemCache.TryGetValue (elem, out ob))
- return (MSBuildItemGroup) ob;
- MSBuildItemGroup it = new MSBuildItemGroup (this, elem);
- elemCache [elem] = it;
- return it;
- }
-
- public void RemoveGroup (MSBuildPropertyGroup grp)
- {
- elemCache.Remove (grp.Element);
- grp.Element.ParentNode.RemoveChild (grp.Element);
- }
-
- public IEnumerable<MSBuildTarget> Targets {
- get {
- foreach (XmlElement elem in doc.DocumentElement.SelectNodes ("tns:Target", XmlNamespaceManager))
- yield return new MSBuildTarget (elem);
- }
- }
- }
-
- public class MSBuildObject
- {
- XmlElement elem;
- XmlElement evaluatedElem;
-
- public MSBuildObject (XmlElement elem)
- {
- this.elem = elem;
- }
-
- public XmlElement Element {
- get { return elem; }
- }
-
- public XmlElement EvaluatedElement {
- get { return evaluatedElem ?? elem; }
- protected set { evaluatedElem = value; }
- }
-
- public bool IsEvaluated {
- get { return evaluatedElem != null; }
- }
-
- protected XmlElement AddChildElement (string name)
- {
- XmlElement e = elem.OwnerDocument.CreateElement (null, name, MSBuildProject.Schema);
- elem.AppendChild (e);
- return e;
- }
-
- public string Label {
- get { return EvaluatedElement.GetAttribute ("Label"); }
- set { Element.SetAttribute ("Label", value); }
- }
-
- public string Condition {
- get {
- return Element.GetAttribute ("Condition");
- }
- set {
- if (string.IsNullOrEmpty (value))
- Element.RemoveAttribute ("Condition");
- else
- Element.SetAttribute ("Condition", value);
- }
- }
-
- internal virtual void Evaluate (MSBuildEvaluationContext context)
- {
- }
- }
-
- public class MSBuildImport: MSBuildObject
- {
- public MSBuildImport (XmlElement elem): base (elem)
- {
- }
-
- public string Project {
- get { return EvaluatedElement.GetAttribute ("Project"); }
- set { Element.SetAttribute ("Project", value); }
- }
-
- public string Condition {
- get { return EvaluatedElement.GetAttribute ("Condition"); }
- set { Element.SetAttribute ("Condition", value); }
- }
- }
-
- public class MSBuildProperty: MSBuildObject
- {
- public MSBuildProperty (XmlElement elem): base (elem)
- {
- }
-
- public string Name {
- get { return Element.Name; }
- }
-
- internal bool Overwritten { get; set; }
-
- public string GetValue (bool isXml = false)
- {
- if (isXml)
- return EvaluatedElement.InnerXml;
- return EvaluatedElement.InnerText;
- }
-
- public void SetValue (string value, bool isXml = false)
- {
- if (isXml)
- Element.InnerXml = value;
- else
- Element.InnerText = value;
- }
-
- internal override void Evaluate (MSBuildEvaluationContext context)
- {
- EvaluatedElement = null;
-
- if (!string.IsNullOrEmpty (Condition)) {
- string cond;
- if (!context.Evaluate (Condition, out cond)) {
- // The value could not be evaluated, so if there is an existing value, it is not valid anymore
- context.ClearPropertyValue (Name);
- return;
- }
- if (!ConditionParser.ParseAndEvaluate (cond, context))
- return;
- }
-
- XmlElement elem;
-
- if (context.Evaluate (Element, out elem)) {
- EvaluatedElement = elem;
- context.SetPropertyValue (Name, GetValue ());
- } else {
- // The value could not be evaluated, so if there is an existing value, it is not valid anymore
- context.ClearPropertyValue (Name);
- }
- }
- }
-
- public interface MSBuildPropertySet
- {
- MSBuildProperty GetProperty (string name);
- IEnumerable<MSBuildProperty> Properties { get; }
- MSBuildProperty SetPropertyValue (string name, string value, bool preserveExistingCase, bool isXml = false);
- string GetPropertyValue (string name, bool isXml = false);
- bool RemoveProperty (string name);
- void RemoveAllProperties ();
- void UnMerge (MSBuildPropertySet baseGrp, ISet<string> propertiesToExclude);
- }
-
- class MSBuildPropertyGroupMerged: MSBuildPropertySet
- {
- List<MSBuildPropertyGroup> groups = new List<MSBuildPropertyGroup> ();
-
- public void Add (MSBuildPropertyGroup g)
- {
- groups.Add (g);
- }
-
- public int GroupCount {
- get { return groups.Count; }
- }
-
- public MSBuildProperty GetProperty (string name)
- {
- // Find property in reverse order, since the last set
- // value is the good one
- for (int n=groups.Count - 1; n >= 0; n--) {
- var g = groups [n];
- MSBuildProperty p = g.GetProperty (name);
- if (p != null)
- return p;
- }
- return null;
- }
-
- public MSBuildProperty SetPropertyValue (string name, string value, bool preserveExistingCase, bool isXml = false)
- {
- MSBuildProperty p = GetProperty (name);
- if (p != null) {
- if (!preserveExistingCase || !string.Equals (value, p.GetValue (isXml), StringComparison.OrdinalIgnoreCase)) {
- p.SetValue (value, isXml);
- }
- return p;
- }
- return groups [0].SetPropertyValue (name, value, preserveExistingCase, isXml);
- }
-
- public string GetPropertyValue (string name, bool isXml = false)
- {
- MSBuildProperty prop = GetProperty (name);
- return prop != null ? prop.GetValue (isXml) : null;
- }
-
- public bool RemoveProperty (string name)
- {
- bool found = false;
- foreach (var g in groups) {
- if (g.RemoveProperty (name)) {
- Prune (g);
- found = true;
- }
- }
- return found;
- }
-
- public void RemoveAllProperties ()
- {
- foreach (var g in groups) {
- g.RemoveAllProperties ();
- Prune (g);
- }
- }
-
- public void UnMerge (MSBuildPropertySet baseGrp, ISet<string> propertiesToExclude)
- {
- foreach (var g in groups) {
- g.UnMerge (baseGrp, propertiesToExclude);
- }
- }
-
- public IEnumerable<MSBuildProperty> Properties {
- get {
- foreach (var g in groups) {
- foreach (var p in g.Properties)
- yield return p;
- }
- }
- }
-
- void Prune (MSBuildPropertyGroup g)
- {
- if (g != groups [0] && !g.Properties.Any()) {
- // Remove this group since it's now empty
- g.Parent.RemoveGroup (g);
- }
- }
- }
-
- public class MSBuildPropertyGroup: MSBuildObject, MSBuildPropertySet
- {
- Dictionary<string,MSBuildProperty> properties = new Dictionary<string,MSBuildProperty> ();
- List<MSBuildProperty> propertyList = new List<MSBuildProperty> ();
- MSBuildProject parent;
-
- public MSBuildPropertyGroup (MSBuildProject parent, XmlElement elem): base (elem)
- {
- this.parent = parent;
-
- foreach (var pelem in Element.ChildNodes.OfType<XmlElement> ()) {
- MSBuildProperty prevSameName;
- if (properties.TryGetValue (pelem.Name, out prevSameName))
- prevSameName.Overwritten = true;
-
- var prop = new MSBuildProperty (pelem);
- propertyList.Add (prop);
- properties [pelem.Name] = prop; // If a property is defined more than once, we only care about the last registered value
- }
- }
-
- public MSBuildProject Parent {
- get {
- return this.parent;
- }
- }
-
- public MSBuildProperty GetProperty (string name)
- {
- MSBuildProperty prop;
- properties.TryGetValue (name, out prop);
- return prop;
- }
-
- public IEnumerable<MSBuildProperty> Properties {
- get {
- return propertyList.Where (p => !p.Overwritten);
- }
- }
-
- public MSBuildProperty SetPropertyValue (string name, string value, bool preserveExistingCase, bool isXml = false)
- {
- MSBuildProperty prop = GetProperty (name);
- if (prop == null) {
- XmlElement pelem = AddChildElement (name);
- prop = new MSBuildProperty (pelem);
- properties [name] = prop;
- propertyList.Add (prop);
- prop.SetValue (value, isXml);
- } else if (!preserveExistingCase || !string.Equals (value, prop.GetValue (isXml), StringComparison.OrdinalIgnoreCase)) {
- prop.SetValue (value, isXml);
- }
- return prop;
- }
-
- public string GetPropertyValue (string name, bool isXml = false)
- {
- MSBuildProperty prop = GetProperty (name);
- if (prop == null)
- return null;
- else
- return prop.GetValue (isXml);
- }
-
- public bool RemoveProperty (string name)
- {
- MSBuildProperty prop = GetProperty (name);
- if (prop != null) {
- properties.Remove (name);
- propertyList.Remove (prop);
- Element.RemoveChild (prop.Element);
- return true;
- }
- return false;
- }
-
- public void RemoveAllProperties ()
- {
- List<XmlNode> toDelete = new List<XmlNode> ();
- foreach (XmlNode node in Element.ChildNodes) {
- if (node is XmlElement)
- toDelete.Add (node);
- }
- foreach (XmlNode node in toDelete)
- Element.RemoveChild (node);
- properties.Clear ();
- propertyList.Clear ();
- }
-
- public void UnMerge (MSBuildPropertySet baseGrp, ISet<string> propsToExclude)
- {
- foreach (MSBuildProperty prop in baseGrp.Properties) {
- if (propsToExclude != null && propsToExclude.Contains (prop.Name))
- continue;
- MSBuildProperty thisProp = GetProperty (prop.Name);
- if (thisProp != null && prop.GetValue (true).Equals (thisProp.GetValue (true), StringComparison.OrdinalIgnoreCase))
- RemoveProperty (prop.Name);
- }
- }
-
- internal override void Evaluate (MSBuildEvaluationContext context)
- {
- if (!string.IsNullOrEmpty (Condition)) {
- string cond;
- if (!context.Evaluate (Condition, out cond)) {
- // The condition could not be evaluated. Clear all properties that this group defines
- // since we don't know if they will have a value or not
- foreach (var prop in Properties)
- context.ClearPropertyValue (prop.Name);
- return;
- }
- if (!ConditionParser.ParseAndEvaluate (cond, context))
- return;
- }
-
- foreach (var prop in propertyList)
- prop.Evaluate (context);
- }
-
- public override string ToString()
- {
- string s = "[MSBuildPropertyGroup:";
- foreach (MSBuildProperty prop in Properties)
- s += " " + prop.Name + "=" + prop.GetValue (true);
- return s + "]";
- }
-
- }
-
- public class MSBuildItem: MSBuildObject
- {
- public MSBuildItem (XmlElement elem): base (elem)
- {
- }
-
- public string Include {
- get { return EvaluatedElement.GetAttribute ("Include"); }
- set { Element.SetAttribute ("Include", value); }
- }
-
- public string UnevaluatedInclude {
- get { return Element.GetAttribute ("Include"); }
- set { Element.SetAttribute ("Include", value); }
- }
-
- public string Name {
- get { return Element.Name; }
- }
-
- public bool HasMetadata (string name)
- {
- return EvaluatedElement [name, MSBuildProject.Schema] != null;
- }
-
- public void SetMetadata (string name, bool value)
- {
- SetMetadata (name, value ? "True" : "False");
- }
-
- public void SetMetadata (string name, string value, bool isXml = false)
- {
- // Don't overwrite the metadata value if the new value is the same as the old
- // This will keep the old metadata string, which can contain property references
- if (GetMetadata (name, isXml) == value)
- return;
-
- XmlElement elem = Element [name, MSBuildProject.Schema];
- if (elem == null) {
- elem = AddChildElement (name);
- Element.AppendChild (elem);
- }
- if (isXml)
- elem.InnerXml = value;
- else
- elem.InnerText = value;
- }
-
- public void UnsetMetadata (string name)
- {
- XmlElement elem = Element [name, MSBuildProject.Schema];
- if (elem != null) {
- Element.RemoveChild (elem);
- if (!Element.HasChildNodes)
- Element.IsEmpty = true;
- }
- }
-
- public string GetMetadata (string name, bool isXml = false)
- {
- XmlElement elem = EvaluatedElement [name, MSBuildProject.Schema];
- if (elem != null)
- return isXml ? elem.InnerXml : elem.InnerText;
- else
- return null;
- }
-
- public bool? GetBoolMetadata (string name)
- {
- var val = GetMetadata (name);
- if (String.Equals (val, "False", StringComparison.OrdinalIgnoreCase))
- return false;
- if (String.Equals (val, "True", StringComparison.OrdinalIgnoreCase))
- return true;
- return null;
- }
-
- public bool GetMetadataIsFalse (string name)
- {
- return String.Compare (GetMetadata (name), "False", StringComparison.OrdinalIgnoreCase) == 0;
- }
-
- public void MergeFrom (MSBuildItem other)
- {
- foreach (XmlNode node in Element.ChildNodes) {
- if (node is XmlElement)
- SetMetadata (node.LocalName, node.InnerXml, true);
- }
- }
-
- internal override void Evaluate (MSBuildEvaluationContext context)
- {
- XmlElement elem;
- if (context.Evaluate (Element, out elem))
- EvaluatedElement = elem;
- else
- EvaluatedElement = null;
- }
- }
-
- public class MSBuildItemGroup: MSBuildObject
- {
- MSBuildProject parent;
-
- internal MSBuildItemGroup (MSBuildProject parent, XmlElement elem): base (elem)
- {
- this.parent = parent;
- }
-
- public MSBuildItem AddNewItem (string name, string include)
- {
- XmlElement elem = AddChildElement (name);
- MSBuildItem it = parent.GetItem (elem);
- it.Include = include;
- return it;
- }
-
- public IEnumerable<MSBuildItem> Items {
- get {
- foreach (XmlNode node in Element.ChildNodes) {
- XmlElement elem = node as XmlElement;
- if (elem != null)
- yield return parent.GetItem (elem);
- }
- }
- }
-
- internal override void Evaluate (MSBuildEvaluationContext context)
- {
- foreach (var item in Items)
- item.Evaluate (context);
- }
- }
-
- public class MSBuildTarget: MSBuildObject
- {
- public MSBuildTarget (XmlElement elem): base (elem)
- {
- }
-
- public string Name {
- get { return EvaluatedElement.GetAttribute ("Name"); }
- set { Element.SetAttribute ("Name", value); }
- }
-
- public IEnumerable<MSBuildTask> Tasks {
- get {
- foreach (XmlNode node in Element.ChildNodes) {
- var elem = node as XmlElement;
- if (MSBuildTask.IsTask (elem))
- yield return new MSBuildTask (elem);
- }
- }
- }
- }
-
- public class MSBuildTask: MSBuildObject
- {
- public static bool IsTask (XmlElement elem)
- {
- if (elem == null)
- return false;
-
- return elem.LocalName == "Error";
- }
-
- public MSBuildTask (XmlElement elem): base (elem)
- {
- }
-
- public string Name {
- get { return EvaluatedElement.GetAttribute ("Name"); }
- set { Element.SetAttribute ("Name", value); }
- }
- }
-
- public class MSBuildEvaluationContext: IExpressionContext
- {
- Dictionary<string,string> properties = new Dictionary<string, string> ();
- bool allResolved;
- MSBuildProject project;
-
- public MSBuildEvaluationContext ()
- {
- }
-
- internal void InitEvaluation (MSBuildProject project)
- {
- this.project = project;
- SetPropertyValue ("MSBuildThisFile", Path.GetFileName (project.FileName));
- SetPropertyValue ("MSBuildThisFileName", Path.GetFileNameWithoutExtension (project.FileName));
- SetPropertyValue ("MSBuildThisFileDirectory", Path.GetDirectoryName (project.FileName) + Path.DirectorySeparatorChar);
- SetPropertyValue ("MSBuildThisFileExtension", Path.GetExtension (project.FileName));
- SetPropertyValue ("MSBuildThisFileFullPath", Path.GetFullPath (project.FileName));
- SetPropertyValue ("VisualStudioReferenceAssemblyVersion", project.ToolsVersion + ".0.0");
- }
-
- public string GetPropertyValue (string name)
- {
- string val;
- if (properties.TryGetValue (name, out val))
- return val;
- else
- return Environment.GetEnvironmentVariable (name);
- }
-
- public void SetPropertyValue (string name, string value)
- {
- properties [name] = value;
- }
-
- public void ClearPropertyValue (string name)
- {
- properties.Remove (name);
- }
-
- public bool Evaluate (XmlElement source, out XmlElement result)
- {
- allResolved = true;
- result = (XmlElement) EvaluateNode (source);
- return allResolved;
- }
-
- XmlNode EvaluateNode (XmlNode source)
- {
- var elemSource = source as XmlElement;
- if (elemSource != null) {
- var elem = source.OwnerDocument.CreateElement (elemSource.Prefix, elemSource.LocalName, elemSource.NamespaceURI);
- foreach (XmlAttribute attr in elemSource.Attributes)
- elem.Attributes.Append ((XmlAttribute)EvaluateNode (attr));
- foreach (XmlNode child in elemSource.ChildNodes)
- elem.AppendChild (EvaluateNode (child));
- return elem;
- }
-
- var attSource = source as XmlAttribute;
- if (attSource != null) {
- bool oldResolved = allResolved;
- var att = source.OwnerDocument.CreateAttribute (attSource.Prefix, attSource.LocalName, attSource.NamespaceURI);
- att.Value = Evaluate (attSource.Value);
-
- // Condition attributes don't change the resolution status. Conditions are handled in the property and item objects
- if (attSource.Name == "Condition")
- allResolved = oldResolved;
-
- return att;
- }
- var textSource = source as XmlText;
- if (textSource != null) {
- return source.OwnerDocument.CreateTextNode (Evaluate (textSource.InnerText));
- }
- return source.Clone ();
- }
-
- public bool Evaluate (string str, out string result)
- {
- allResolved = true;
- result = Evaluate (str);
- return allResolved;
- }
-
- string Evaluate (string str)
- {
- int i = str.IndexOf ("$(");
- if (i == -1)
- return str;
-
- int last = 0;
-
- StringBuilder sb = new StringBuilder ();
- do {
- sb.Append (str, last, i - last);
- i += 2;
- int j = str.IndexOf (")", i);
- if (j == -1) {
- allResolved = false;
- return "";
- }
-
- string prop = str.Substring (i, j - i);
- string val = GetPropertyValue (prop);
- if (val == null) {
- allResolved = false;
- return "";
- }
-
- sb.Append (val);
- last = j + 1;
- i = str.IndexOf ("$(", last);
- }
- while (i != -1);
-
- sb.Append (str, last, str.Length - last);
- return sb.ToString ();
- }
-
- #region IExpressionContext implementation
-
- public string EvaluateString (string value)
- {
- if (value.StartsWith ("$(") && value.EndsWith (")"))
- return GetPropertyValue (value.Substring (2, value.Length - 3)) ?? value;
- else
- return value;
- }
-
- public string FullFileName {
- get {
- return project.FileName;
- }
- }
-
- #endregion
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs
deleted file mode 100644
index fe62395a0d..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs
+++ /dev/null
@@ -1,2216 +0,0 @@
-// MSBuildProjectHandler.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.Xml;
-using System.IO;
-using System.Collections;
-using System.Collections.Generic;
-using System.Reflection;
-using MonoDevelop.Core;
-using MonoDevelop.Projects;
-using MonoDevelop.Core.Serialization;
-using MonoDevelop.Core.Assemblies;
-using MonoDevelop.Projects.Formats.MD1;
-using MonoDevelop.Projects.Extensions;
-using Mono.Addins;
-using System.Linq;
-using MonoDevelop.Core.Instrumentation;
-using MonoDevelop.Core.ProgressMonitoring;
-using System.Runtime.Remoting.Messaging;
-
-namespace MonoDevelop.Projects.Formats.MSBuild
-{
- public class MSBuildProjectHandler: MSBuildHandler, IResourceHandler, IPathHandler, IAssemblyReferenceHandler
- {
- List<string> targetImports = new List<string> ();
- IResourceHandler customResourceHandler;
- List<string> subtypeGuids = new List<string> ();
- const string Unspecified = null;
- RemoteProjectBuilder projectBuilder;
- ITimeTracker timer;
- bool modifiedInMemory;
- UnknownProjectTypeNode unknownProjectTypeInfo;
-
- string lastBuildToolsVersion;
- string lastBuildRuntime;
- string lastFileName;
- string lastSlnFileName;
-
- struct ItemInfo {
- public MSBuildItem Item;
- public bool Added;
- }
-
- protected SolutionEntityItem EntityItem {
- get { return (SolutionEntityItem) Item; }
- }
-
- public string ToolsVersion { get; private set; }
- string productVersion;
- string schemaVersion;
-
- internal bool ProjectTypeIsUnsupported {
- get { return unknownProjectTypeInfo != null; }
- }
-
- internal UnknownProjectTypeNode UnknownProjectTypeInfo {
- get { return unknownProjectTypeInfo; }
- }
-
- public List<string> TargetImports {
- get { return targetImports; }
- }
-
- internal void SetUnsupportedType (UnknownProjectTypeNode typeInfo)
- {
- unknownProjectTypeInfo = typeInfo;
- }
-
- internal override void SetSolutionFormat (MSBuildFileFormat format, bool converting)
- {
- // when converting formats, set ToolsVersion, ProductVersion, SchemaVersion to default values written by VS
- // this happens on creation too
- // else we leave them alone and just roundtrip them
- if (converting) {
- ToolsVersion = format.DefaultToolsVersion;
- productVersion = format.DefaultProductVersion;
- schemaVersion = format.DefaultSchemaVersion;
- }
-
- base.SetSolutionFormat (format, converting);
- }
-
- //HACK: the solution's format is irrelevant to MSBuild projects, what matters is the ToolsVersion
- // but other parts of the MD API expect a FileFormat
- MSBuildFileFormat GetToolsFormat ()
- {
- switch (ToolsVersion) {
- case "2.0":
- return new MSBuildFileFormatVS05 ();
- case "3.5":
- return new MSBuildFileFormatVS08 ();
- case "4.0":
- if (SolutionFormat != null && SolutionFormat.Id == "MSBuild10")
- return SolutionFormat;
- return new MSBuildFileFormatVS12 ();
- case "12.0":
- case "14.0":
- return new MSBuildFileFormatVS12 ();
- default:
- throw new Exception ("Unknown ToolsVersion '" + ToolsVersion + "'");
- }
- }
-
- public void SetCustomResourceHandler (IResourceHandler value)
- {
- customResourceHandler = value;
- }
-
- public List<string> SubtypeGuids {
- get {
- return subtypeGuids;
- }
- }
-
- public MSBuildProjectHandler ()
- {
- }
-
- public MSBuildProjectHandler (string typeGuid, string import, string itemId)
- {
- Initialize (typeGuid, import, itemId);
- }
-
- internal void Initialize (string typeGuid, string import, string itemId)
- {
- base.Initialize (typeGuid, itemId);
- if (import != null && import.Trim().Length > 0)
- this.targetImports.AddRange (import.Split (':'));
-
- Runtime.SystemAssemblyService.DefaultRuntimeChanged += OnDefaultRuntimeChanged;
- }
-
- public override object GetService (Type t)
- {
- foreach (var ex in GetMSBuildExtensions ()) {
- var s = ex.GetService (t);
- if (s != null)
- return s;
- }
- return null;
- }
-
- void OnDefaultRuntimeChanged (object o, EventArgs args)
- {
- // If the default runtime changes, the project builder for this project may change
- // so it has to be created again.
- CleanupProjectBuilder ();
- }
-
- object builderLock = new object ();
-
- RemoteProjectBuilder GetProjectBuilder ()
- {
- var item = (SolutionEntityItem) Item;
-
- //FIXME: we can't really have per-project runtimes, has to be per-solution
- TargetRuntime runtime = null;
- var ap = item as IAssemblyProject;
- runtime = ap != null ? ap.TargetRuntime : Runtime.SystemAssemblyService.CurrentRuntime;
-
- var sln = item.ParentSolution;
- var slnFile = sln != null ? sln.FileName : null;
-
- lock (builderLock) {
- if (projectBuilder == null || lastBuildToolsVersion != ToolsVersion || lastBuildRuntime != runtime.Id || lastFileName != item.FileName || lastSlnFileName != slnFile) {
- CleanupProjectBuilder ();
- projectBuilder = MSBuildProjectService.GetProjectBuilder (runtime, ToolsVersion, item.FileName, slnFile);
- projectBuilder.Disconnected += delegate {
- CleanupProjectBuilder ();
- };
- lastBuildToolsVersion = ToolsVersion;
- lastBuildRuntime = runtime.Id;
- lastFileName = item.FileName;
- lastSlnFileName = slnFile;
- }
- if (modifiedInMemory) {
- modifiedInMemory = false;
- var p = SaveProject (new NullProgressMonitor ());
- projectBuilder.RefreshWithContent (p.SaveToString ());
- }
- }
- return projectBuilder;
- }
-
- internal void CleanupProjectBuilder ()
- {
- if (projectBuilder != null) {
- projectBuilder.Dispose ();
- projectBuilder = null;
- }
- }
-
- internal void RefreshProjectBuilder ()
- {
- if (projectBuilder != null) {
- projectBuilder.Refresh ();
- }
- }
-
- public override void Dispose ()
- {
- base.Dispose ();
- CleanupProjectBuilder ();
- Runtime.SystemAssemblyService.DefaultRuntimeChanged -= OnDefaultRuntimeChanged;
- }
-
- //for some reason, MD internally handles "AnyCPU" as "", but we need to be explicit when
- //passing it to the build engine
- static string GetExplicitPlatform (SolutionItemConfiguration configObject)
- {
- if (string.IsNullOrEmpty (configObject.Platform)) {
- return "AnyCPU";
- }
- return configObject.Platform;
- }
-
- ProjectConfigurationInfo[] GetConfigurations (SolutionEntityItem item, ConfigurationSelector configuration)
- {
- // Returns a list of project/configuration information for the provided item and all its references
- List<ProjectConfigurationInfo> configs = new List<ProjectConfigurationInfo> ();
- var c = item.GetConfiguration (configuration);
- configs.Add (new ProjectConfigurationInfo () {
- ProjectFile = item.FileName,
- Configuration = c.Name,
- Platform = GetExplicitPlatform (c),
- ProjectGuid = ((MSBuildProjectHandler)item.ItemHandler).ItemId
- });
- foreach (var refProject in item.GetReferencedItems (configuration).OfType<Project> ()) {
- var refConfig = refProject.GetConfiguration (configuration);
- if (refConfig != null) {
- configs.Add (new ProjectConfigurationInfo () {
- ProjectFile = refProject.FileName,
- Configuration = refConfig.Name,
- Platform = GetExplicitPlatform (refConfig),
- ProjectGuid = ((MSBuildProjectHandler)refProject.ItemHandler).ItemId
- });
- }
- }
- return configs.ToArray ();
- }
-
- IEnumerable<string> IAssemblyReferenceHandler.GetAssemblyReferences (ConfigurationSelector configuration)
- {
- if (UseMSBuildEngineForItem (Item, configuration)) {
- // Get the references list from the msbuild project
- SolutionEntityItem item = (SolutionEntityItem) Item;
- RemoteProjectBuilder builder = GetProjectBuilder ();
- var configs = GetConfigurations (item, configuration);
-
- string[] refs;
- using (Counters.ResolveMSBuildReferencesTimer.BeginTiming (Item.GetProjectEventMetadata (configuration)))
- refs = builder.ResolveAssemblyReferences (configs);
- foreach (var r in refs)
- yield return r;
- }
- else {
- CleanupProjectBuilder ();
- DotNetProject item = Item as DotNetProject;
- if (item == null)
- yield break;
- foreach (ProjectReference pref in item.References.Where (pr => pr.ReferenceType != ReferenceType.Project)) {
- foreach (string asm in pref.GetReferencedFileNames (configuration))
- yield return asm;
- }
- }
- }
-
- public string[] GetSupportedTargets ()
- {
- if (UseMSBuildEngineForItem (Item, ConfigurationSelector.Default)) {
- SolutionEntityItem item = (SolutionEntityItem) Item;
- var configs = GetConfigurations (item, ConfigurationSelector.Default);
- RemoteProjectBuilder builder = GetProjectBuilder ();
- return builder.GetSupportedTargets (configs);
- } else
- return new string[0];
- }
-
- public override BuildResult RunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration)
- {
- var currentContext = CallContext.GetData ("MonoDevelop.Projects.ProjectOperationContext") as ProjectOperationContext;
- ProjectOperationContext newContext = currentContext;
-
- try {
- if (newContext == null)
- newContext = new TargetEvaluationContext ();
- else if (!(newContext is TargetEvaluationContext))
- newContext = new TargetEvaluationContext (newContext);
- var res = RunTarget (monitor, target, configuration, (TargetEvaluationContext) newContext);
- CallContext.SetData ("MonoDevelop.Projects.TargetEvaluationResult", res);
- return res != null ? res.BuildResult : null;
- } finally {
- if (newContext != currentContext)
- CallContext.SetData ("MonoDevelop.Projects.ProjectOperationContext", currentContext);
- }
- }
-
- TargetEvaluationResult RunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration, TargetEvaluationContext context)
- {
- if (UseMSBuildEngineForItem (Item, configuration)) {
- SolutionEntityItem item = Item as SolutionEntityItem;
- if (item != null) {
- LogWriter logWriter = new LogWriter (monitor.Log);
- RemoteProjectBuilder builder = GetProjectBuilder ();
- var configs = GetConfigurations (item, configuration);
-
- TimerCounter buildTimer = null;
- switch (target) {
- case "Build": buildTimer = Counters.BuildMSBuildProjectTimer; break;
- case "Clean": buildTimer = Counters.CleanMSBuildProjectTimer; break;
- }
-
- var t1 = Counters.RunMSBuildTargetTimer.BeginTiming (Item.GetProjectEventMetadata (configuration));
- var t2 = buildTimer != null ? buildTimer.BeginTiming (Item.GetProjectEventMetadata (configuration)) : null;
-
- MSBuildResult result;
-
- try {
- result = builder.Run (configs, logWriter, MSBuildProjectService.DefaultMSBuildVerbosity, new[] { target }, context.ItemsToEvaluate.ToArray(), context.PropertiesToEvaluate.ToArray (), context.GlobalProperties);
- } finally {
- t1.End ();
- if (t2 != null)
- t2.End ();
- }
-
- System.Runtime.Remoting.RemotingServices.Disconnect (logWriter);
-
- var br = new BuildResult ();
- foreach (var err in result.Errors) {
- FilePath file = null;
- if (err.File != null)
- file = Path.Combine (Path.GetDirectoryName (err.ProjectFile), err.File);
-
- br.Append (new BuildError (file, err.LineNumber, err.ColumnNumber, err.Code, err.Message) {
- Subcategory = err.Subcategory,
- EndLine = err.EndLineNumber,
- EndColumn = err.EndColumnNumber,
- IsWarning = err.IsWarning,
- HelpKeyword = err.HelpKeyword,
- });
- }
-
- return new TargetEvaluationResult (br, result.Items.Values.SelectMany (i => i), result.Properties);
- }
- }
- else {
- CleanupProjectBuilder ();
- if (Item is DotNetProject) {
- MD1DotNetProjectHandler handler = new MD1DotNetProjectHandler ((DotNetProject)Item);
- var br = handler.RunTarget (monitor, target, configuration);
- return new TargetEvaluationResult (br);
- }
- }
- return null;
- }
-
- public string GetDefaultResourceId (ProjectFile file)
- {
- if (customResourceHandler != null)
- return customResourceHandler.GetDefaultResourceId (file);
- else
- return MSBuildResourceHandler.Instance.GetDefaultResourceId (file);
- }
-
- public string EncodePath (string path, string oldPath)
- {
- string basePath = Path.GetDirectoryName (EntityItem.FileName);
- return FileService.RelativeToAbsolutePath (basePath, path);
- }
-
- public string DecodePath (string path)
- {
- string basePath = Path.GetDirectoryName (EntityItem.FileName);
- return FileService.AbsoluteToRelativePath (basePath, path);
- }
-
- public SolutionEntityItem Load (IProgressMonitor monitor, string fileName, MSBuildFileFormat format, string language, Type itemClass)
- {
- timer = Counters.ReadMSBuildProject.BeginTiming ();
-
- timer.Trace ("Reading project file");
- MSBuildProject p = new MSBuildProject ();
- p.Load (fileName);
-
- ToolsVersion = p.ToolsVersion;
- if (string.IsNullOrEmpty (ToolsVersion))
- ToolsVersion = "2.0";
-
- SetSolutionFormat (format ?? new MSBuildFileFormatVS12 (), false);
-
- timer.Trace ("Read project guids");
-
- MSBuildPropertySet globalGroup = p.GetGlobalPropertyGroup ();
-
- // Avoid crash if there is not global group
- if (globalGroup == null)
- globalGroup = p.AddNewPropertyGroup (false);
-
- productVersion = globalGroup.GetPropertyValue ("ProductVersion");
- schemaVersion = globalGroup.GetPropertyValue ("SchemaVersion");
-
- string itemGuid = globalGroup.GetPropertyValue ("ProjectGuid");
- if (itemGuid == null)
- throw new UserException ("Project file doesn't have a valid ProjectGuid");
-
- // Workaround for a VS issue. VS doesn't include the curly braces in the ProjectGuid
- // of shared projects.
- if (!itemGuid.StartsWith ("{", StringComparison.Ordinal))
- itemGuid = "{" + itemGuid + "}";
-
- itemGuid = itemGuid.ToUpper ();
- string projectTypeGuids = globalGroup.GetPropertyValue ("ProjectTypeGuids");
- string itemType = globalGroup.GetPropertyValue ("ItemType");
-
- subtypeGuids.Clear ();
- if (projectTypeGuids != null) {
- foreach (string guid in projectTypeGuids.Split (';')) {
- string sguid = guid.Trim ();
- if (sguid.Length > 0 && string.Compare (sguid, TypeGuid, StringComparison.OrdinalIgnoreCase) != 0)
- subtypeGuids.Add (guid);
- }
- }
-
- try {
- timer.Trace ("Create item instance");
- ProjectExtensionUtil.BeginLoadOperation ();
- Item = CreateSolutionItem (monitor, p, fileName, language, itemType, itemClass);
-
- if (subtypeGuids.Any ()) {
- string gg = string.Join (";", subtypeGuids) + ";" + TypeGuid;
- Item.ExtendedProperties ["ProjectTypeGuids"] = gg.ToUpper ();
- }
-
- Item.SetItemHandler (this);
- MSBuildProjectService.SetId (Item, itemGuid);
-
- SolutionEntityItem it = (SolutionEntityItem) Item;
-
- it.FileName = fileName;
- it.Name = System.IO.Path.GetFileNameWithoutExtension (fileName);
-
- RemoveDuplicateItems (p, fileName);
-
- LoadProject (monitor, p);
- return it;
-
- } finally {
- ProjectExtensionUtil.EndLoadOperation ();
- timer.End ();
- }
- }
-
- /// <summary>Whether to use the MSBuild engine for the specified item.</summary>
- internal bool UseMSBuildEngineForItem (SolutionItem item, ConfigurationSelector sel, bool checkReferences = true)
- {
- // if the item mandates MSBuild, always use it
- if (RequireMSBuildEngine)
- return true;
- // if the user has set the option, use the setting
- if (item.UseMSBuildEngine.HasValue)
- return item.UseMSBuildEngine.Value;
-
- // If the item type defaults to using MSBuild, only use MSBuild if its direct references also use MSBuild.
- // This prevents a not-uncommon common error referencing non-MSBuild projects from MSBuild projects
- // NOTE: This adds about 11ms to the load/build/etc times of the MonoDevelop solution. Doing it recursively
- // adds well over a second.
- return UseMSBuildEngineByDefault && (
- !checkReferences ||
- item.GetReferencedItems (sel).All (i => {
- var h = i.ItemHandler as MSBuildProjectHandler;
- return h != null && h.UseMSBuildEngineForItem (i, sel, false);
- })
- );
- }
-
- bool? useMSBuildEngineByDefault;
-
- /// <summary>Whether to use the MSBuild engine by default.</summary>
- internal bool UseMSBuildEngineByDefault {
- get {
- //enable msbuild by default .NET assembly projects
- return useMSBuildEngineByDefault ?? (Item is DotNetAssemblyProject && !string.IsNullOrEmpty (((DotNetAssemblyProject)Item).LanguageName));
- }
- set {
- useMSBuildEngineByDefault = value;
- }
- }
-
- /// <summary>Forces the MSBuild engine to be used.</summary>
- internal bool RequireMSBuildEngine { get; set; }
-
- // All of the last 4 parameters are optional, but at least one must be provided.
- SolutionItem CreateSolutionItem (IProgressMonitor monitor, MSBuildProject p, string fileName, string language,
- string itemType, Type itemClass)
- {
- if (ProjectTypeIsUnsupported)
- return new UnknownProject (fileName, UnknownProjectTypeInfo.GetInstructions ());
-
- if (subtypeGuids.Any ()) {
- DotNetProjectSubtypeNode st = MSBuildProjectService.GetDotNetProjectSubtype (subtypeGuids);
- if (st != null) {
- UseMSBuildEngineByDefault = st.UseXBuild;
- RequireMSBuildEngine = st.RequireXBuild;
- Type migratedType = null;
-
- if (st.IsMigration && (migratedType = MigrateProject (monitor, st, p, fileName, language)) != null) {
- var oldSt = st;
- st = MSBuildProjectService.GetItemSubtypeNodes ().Last (t => t.CanHandleType (migratedType));
-
- for (int i = 0; i < subtypeGuids.Count; i++) {
- if (string.Equals (subtypeGuids [i], oldSt.Guid, StringComparison.OrdinalIgnoreCase)) {
- subtypeGuids [i] = st.Guid;
- oldSt = null;
- break;
- }
- }
-
- if (oldSt != null)
- throw new Exception ("Unable to correct flavor GUID");
-
- var gg = string.Join (";", subtypeGuids) + ";" + TypeGuid;
- p.GetGlobalPropertyGroup ().SetPropertyValue ("ProjectTypeGuids", gg.ToUpper (), true);
- p.Save (fileName);
- }
-
- var item = st.CreateInstance (language);
- st.UpdateImports ((SolutionEntityItem)item, targetImports);
- return item;
- } else {
- var projectInfo = MSBuildProjectService.GetUnknownProjectTypeInfo (subtypeGuids.ToArray (), fileName);
- if (projectInfo != null && projectInfo.LoadFiles) {
- SetUnsupportedType (projectInfo);
- return new UnknownProject (fileName, UnknownProjectTypeInfo.GetInstructions ());
- }
- throw new UnknownSolutionItemTypeException (ProjectTypeIsUnsupported ? TypeGuid : string.Join (";", subtypeGuids));
- }
- }
-
- if (itemClass != null)
- return (SolutionItem) Activator.CreateInstance (itemClass);
-
- if (!string.IsNullOrEmpty (language)) {
- //enable msbuild by default .NET assembly projects
- UseMSBuildEngineByDefault = true;
- RequireMSBuildEngine = false;
- return new DotNetAssemblyProject (language);
- }
-
- if (string.IsNullOrEmpty (itemType))
- throw new UnknownSolutionItemTypeException ();
-
- DataType dt = MSBuildProjectService.DataContext.GetConfigurationDataType (itemType);
- if (dt == null)
- throw new UnknownSolutionItemTypeException (itemType);
-
- return (SolutionItem) Activator.CreateInstance (dt.ValueType);
- }
-
- Type MigrateProject (IProgressMonitor monitor, DotNetProjectSubtypeNode st, MSBuildProject p, string fileName, string language)
- {
- var projectLoadMonitor = monitor as IProjectLoadProgressMonitor;
- if (projectLoadMonitor == null) {
- // projectLoadMonitor will be null when running through md-tool, but
- // this is not fatal if migration is not required, so just ignore it. --abock
- if (!st.IsMigrationRequired)
- return null;
-
- LoggingService.LogError (Environment.StackTrace);
- monitor.ReportError ("Could not open unmigrated project and no migrator was supplied", null);
- throw new Exception ("Could not open unmigrated project and no migrator was supplied");
- }
-
- var migrationType = st.MigrationHandler.CanPromptForMigration
- ? st.MigrationHandler.PromptForMigration (projectLoadMonitor, p, fileName, language)
- : projectLoadMonitor.ShouldMigrateProject ();
- if (migrationType == MigrationType.Ignore) {
- if (st.IsMigrationRequired) {
- monitor.ReportError (string.Format ("{1} cannot open the project '{0}' unless it is migrated.", Path.GetFileName (fileName), BrandingService.ApplicationName), null);
- throw new Exception ("The user choose not to migrate the project");
- } else
- return null;
- }
-
- var baseDir = (FilePath) Path.GetDirectoryName (fileName);
- if (migrationType == MigrationType.BackupAndMigrate) {
- var backupDirFirst = baseDir.Combine ("backup");
- string backupDir = backupDirFirst;
- int i = 0;
- while (Directory.Exists (backupDir)) {
- backupDir = backupDirFirst + "-" + i.ToString ();
- if (i++ > 20) {
- throw new Exception ("Too many backup directories");
- }
- }
- Directory.CreateDirectory (backupDir);
- foreach (var file in st.MigrationHandler.FilesToBackup (fileName))
- File.Copy (file, Path.Combine (backupDir, Path.GetFileName (file)));
- }
-
- var type = st.MigrationHandler.Migrate (projectLoadMonitor, p, fileName, language);
- if (type == null)
- throw new Exception ("Could not migrate the project");
-
- return type;
- }
-
- FileFormat GetFileFormat (MSBuildFileFormat fmt)
- {
- return new FileFormat (fmt, fmt.Id, fmt.Name);
- }
-
- void RemoveDuplicateItems (MSBuildProject msproject, string fileName)
- {
- timer.Trace ("Checking for duplicate items");
-
- var uniqueIncludes = new Dictionary<string,object> ();
- var toRemove = new List<MSBuildItem> ();
- foreach (MSBuildItem bi in msproject.GetAllItems ()) {
- object existing;
- string key = bi.Name + "<" + bi.Include;
- if (!uniqueIncludes.TryGetValue (key, out existing)) {
- uniqueIncludes[key] = bi;
- continue;
- }
- var exBi = existing as MSBuildItem;
- if (exBi != null) {
- if (exBi.Condition != bi.Condition || exBi.Element.InnerXml != bi.Element.InnerXml) {
- uniqueIncludes[key] = new List<MSBuildItem> { exBi, bi };
- } else {
- toRemove.Add (bi);
- }
- continue;
- }
-
- var exList = (List<MSBuildItem>)existing;
- bool found = false;
- foreach (var m in (exList)) {
- if (m.Condition == bi.Condition && m.Element.InnerXml == bi.Element.InnerXml) {
- found = true;
- break;
- }
- }
- if (!found) {
- exList.Add (bi);
- } else {
- toRemove.Add (bi);
- }
- }
- if (toRemove.Count == 0)
- return;
-
- timer.Trace ("Removing duplicate items");
-
- foreach (var t in toRemove)
- msproject.RemoveItem (t);
-
- msproject.Save (fileName);
- }
-
- void LoadConfiguration (MSBuildSerializer serializer, List<ConfigData> configData, string conf, string platform)
- {
- MSBuildPropertySet grp = GetMergedConfiguration (configData, conf, platform, null);
- SolutionItemConfiguration config = EntityItem.CreateConfiguration (conf);
-
- config.Platform = platform;
- DataItem data = ReadPropertyGroupMetadata (serializer, grp, config);
- serializer.Deserialize (config, data);
- EntityItem.Configurations.Add (config);
-
- if (config is DotNetProjectConfiguration) {
- DotNetProjectConfiguration dpc = (DotNetProjectConfiguration) config;
- if (dpc.CompilationParameters != null) {
- data = ReadPropertyGroupMetadata (serializer, grp, dpc.CompilationParameters);
- serializer.Deserialize (dpc.CompilationParameters, data);
- }
- }
- }
-
- protected virtual void LoadProject (IProgressMonitor monitor, MSBuildProject msproject)
- {
- timer.Trace ("Initialize serialization");
-
- MSBuildSerializer ser = CreateSerializer ();
- ser.SerializationContext.BaseFile = EntityItem.FileName;
- ser.SerializationContext.ProgressMonitor = monitor;
-
- MSBuildPropertySet globalGroup = msproject.GetGlobalPropertyGroup ();
-
- Item.SetItemHandler (this);
-
- DotNetProject dotNetProject = Item as DotNetProject;
-
- // Read all items
-
- timer.Trace ("Read project items");
-
- LoadProjectItems (msproject, ser, ProjectItemFlags.None);
-
- timer.Trace ("Read configurations");
-
- TargetFrameworkMoniker targetFx = null;
-
- if (dotNetProject != null) {
- string frameworkIdentifier = globalGroup.GetPropertyValue ("TargetFrameworkIdentifier");
- string frameworkVersion = globalGroup.GetPropertyValue ("TargetFrameworkVersion");
- string frameworkProfile = globalGroup.GetPropertyValue ("TargetFrameworkProfile");
-
- //determine the default target framework from the project type's default
- //overridden by the components in the project
- var def = dotNetProject.GetDefaultTargetFrameworkForFormat (GetFileFormat (GetToolsFormat ()));
- targetFx = new TargetFrameworkMoniker (
- string.IsNullOrEmpty (frameworkIdentifier)? def.Identifier : frameworkIdentifier,
- string.IsNullOrEmpty (frameworkVersion)? def.Version : frameworkVersion,
- string.IsNullOrEmpty (frameworkProfile)? def.Profile : frameworkProfile);
-
- if (dotNetProject.LanguageParameters != null) {
- DataItem data = ReadPropertyGroupMetadata (ser, globalGroup, dotNetProject.LanguageParameters);
- ser.Deserialize (dotNetProject.LanguageParameters, data);
- }
- }
-
- // Read configurations
-
- List<ConfigData> configData = GetConfigData (msproject, false);
- List<ConfigData> partialConfigurations = new List<ConfigData> ();
- HashSet<string> handledConfigurations = new HashSet<string> ();
- var configurations = new HashSet<string> ();
- var platforms = new HashSet<string> ();
-
- MSBuildPropertyGroup mergedToProjectProperties = ExtractMergedtoprojectProperties (ser, globalGroup, EntityItem.CreateConfiguration ("Dummy"));
- configData.Insert (0, new ConfigData (Unspecified, Unspecified, mergedToProjectProperties));
-
- // Load configurations, skipping the dummy config at index 0.
- for (int i = 1; i < configData.Count; i++) {
- ConfigData cgrp = configData[i];
- string platform = cgrp.Platform;
- string conf = cgrp.Config;
-
- if (platform != Unspecified)
- platforms.Add (platform);
-
- if (conf != Unspecified)
- configurations.Add (conf);
-
- if (conf == Unspecified || platform == Unspecified) {
- // skip partial configurations for now...
- partialConfigurations.Add (cgrp);
- continue;
- }
-
- string key = conf + "|" + platform;
- if (handledConfigurations.Contains (key))
- continue;
-
- LoadConfiguration (ser, configData, conf, platform);
-
- handledConfigurations.Add (key);
- }
-
- // Now we can load any partial configurations by combining them with known configs or platforms.
- if (partialConfigurations.Count > 0) {
- if (platforms.Count == 0)
- platforms.Add (string.Empty); // AnyCpu
-
- foreach (ConfigData cgrp in partialConfigurations) {
- if (cgrp.Config != Unspecified && cgrp.Platform == Unspecified) {
- string conf = cgrp.Config;
-
- foreach (var platform in platforms) {
- string key = conf + "|" + platform;
-
- if (handledConfigurations.Contains (key))
- continue;
-
- LoadConfiguration (ser, configData, conf, platform);
-
- handledConfigurations.Add (key);
- }
- } else if (cgrp.Config == Unspecified && cgrp.Platform != Unspecified) {
- string platform = cgrp.Platform;
-
- foreach (var conf in configurations) {
- string key = conf + "|" + platform;
-
- if (handledConfigurations.Contains (key))
- continue;
-
- LoadConfiguration (ser, configData, conf, platform);
-
- handledConfigurations.Add (key);
- }
- }
- }
- }
-
- // Read extended properties
-
- timer.Trace ("Read extended properties");
-
- DataItem globalData = ReadPropertyGroupMetadata (ser, globalGroup, Item);
-
- string extendedData = msproject.GetProjectExtensions ("MonoDevelop");
- if (!string.IsNullOrEmpty (extendedData)) {
- StringReader sr = new StringReader (extendedData);
- DataItem data = (DataItem) XmlConfigurationReader.DefaultReader.Read (new XmlTextReader (sr));
- globalData.ItemData.AddRange (data.ItemData);
- }
- ser.Deserialize (Item, globalData);
-
- // Final initializations
-
- timer.Trace ("Final initializations");
-
- //clean up the "InternalTargetFrameworkVersion" hack from MD 2.2, 2.4
- if (dotNetProject != null) {
- string fx = Item.ExtendedProperties ["InternalTargetFrameworkVersion"] as string;
- if (!string.IsNullOrEmpty (fx)) {
- targetFx = TargetFrameworkMoniker.Parse (fx);
- Item.ExtendedProperties.Remove ("InternalTargetFrameworkVersion");
- }
-
- dotNetProject.TargetFramework = Runtime.SystemAssemblyService.GetTargetFramework (targetFx);
- }
-
- LoadFromMSBuildProject (monitor, msproject);
-
- Item.NeedsReload = false;
- }
-
- internal void LoadProjectItems (MSBuildProject msproject, MSBuildSerializer ser, ProjectItemFlags flags)
- {
- foreach (MSBuildItem buildItem in msproject.GetAllItems ()) {
- ProjectItem it = ReadItem (ser, buildItem);
- if (it == null)
- continue;
- it.Flags = flags;
- if (it is ProjectFile) {
- var file = (ProjectFile)it;
- if (file.Name.IndexOf ('*') > -1) {
- // Thanks to IsOriginatedFromWildcard, these expanded items will not be saved back to disk.
- foreach (var expandedItem in ResolveWildcardItems (file))
- EntityItem.Items.Add (expandedItem);
- // Add to wildcard items (so it can be re-saved) instead of Items (where tools will
- // try to compile and display these nonstandard items
- EntityItem.WildcardItems.Add (it);
- continue;
- }
- if (ProjectTypeIsUnsupported && !File.Exists (file.FilePath))
- continue;
- }
- EntityItem.Items.Add (it);
- it.ExtendedProperties ["MSBuild.SourceProject"] = msproject.FileName;
- }
- }
-
- protected virtual void LoadFromMSBuildProject (IProgressMonitor monitor, MSBuildProject msproject)
- {
- foreach (var ext in GetMSBuildExtensions ())
- ext.LoadProject (monitor, EntityItem, msproject);
- }
-
- const string RecursiveDirectoryWildcard = "**";
- static readonly char[] directorySeparators = new [] {
- Path.DirectorySeparatorChar,
- Path.AltDirectorySeparatorChar
- };
-
- static string GetWildcardDirectoryName (string path)
- {
- int indexOfLast = path.LastIndexOfAny (directorySeparators);
- if (indexOfLast < 0)
- return String.Empty;
- return path.Substring (0, indexOfLast);
- }
-
- static string GetWildcardFileName (string path)
- {
- int indexOfLast = path.LastIndexOfAny (directorySeparators);
- if (indexOfLast < 0)
- return path;
- if (indexOfLast == path.Length)
- return String.Empty;
- return path.Substring (indexOfLast + 1, path.Length - (indexOfLast + 1));
- }
-
- static IEnumerable<string> ExpandWildcardFilePath (string filePath)
- {
- if (String.IsNullOrWhiteSpace (filePath))
- throw new ArgumentException ("Not a wildcard path");
-
- string dir = GetWildcardDirectoryName (filePath);
- string file = GetWildcardFileName (filePath);
-
- if (String.IsNullOrEmpty (dir) || String.IsNullOrEmpty (file))
- return null;
-
- SearchOption searchOption = SearchOption.TopDirectoryOnly;
- if (dir.EndsWith (RecursiveDirectoryWildcard, StringComparison.Ordinal)) {
- dir = dir.Substring (0, dir.Length - RecursiveDirectoryWildcard.Length);
- searchOption = SearchOption.AllDirectories;
- }
-
- if (!Directory.Exists (dir))
- return null;
-
- return Directory.GetFiles (dir, file, searchOption);
- }
-
- static IEnumerable<ProjectFile> ResolveWildcardItems (ProjectFile wildcardFile)
- {
- var paths = ExpandWildcardFilePath (wildcardFile.Name);
- if (paths == null)
- yield break;
- foreach (var resolvedFilePath in paths) {
- var projectFile = (ProjectFile)wildcardFile.Clone ();
- projectFile.Name = resolvedFilePath;
- projectFile.IsOriginatedFromWildcard = true;
- yield return projectFile;
- }
- }
-
- MSBuildPropertyGroup ExtractMergedtoprojectProperties (MSBuildSerializer ser, MSBuildPropertySet pgroup, SolutionItemConfiguration ob)
- {
- XmlDocument doc = new XmlDocument ();
- MSBuildPropertyGroup res = new MSBuildPropertyGroup (null, doc.CreateElement ("PropGroup"));
-
- // When reading a project, all configuration properties specified in the global property group have to
- // be merged with all project configurations, no matter if they have the MergeToProject attribute or not
-
- ClassDataType dt = (ClassDataType) ser.DataContext.GetConfigurationDataType (ob.GetType ());
- foreach (ItemProperty prop in dt.GetProperties (ser.SerializationContext, ob)) {
- MSBuildProperty bp = pgroup.GetProperty (prop.Name);
- if (bp != null) {
- var preserveCase = prop.DataType is MSBuildBoolDataType;
- res.SetPropertyValue (bp.Name, bp.Element.InnerXml, preserveCase, true);
- }
- }
- if (ob is DotNetProjectConfiguration) {
- object cparams = ((DotNetProjectConfiguration)ob).CompilationParameters;
- dt = (ClassDataType) ser.DataContext.GetConfigurationDataType (cparams.GetType ());
- foreach (ItemProperty prop in dt.GetProperties (ser.SerializationContext, cparams)) {
- MSBuildProperty bp = pgroup.GetProperty (prop.Name);
- if (bp != null) {
- var preserveCase = prop.DataType is MSBuildBoolDataType;
- res.SetPropertyValue (bp.Name, bp.Element.InnerXml, preserveCase, true);
- }
- }
- }
- return res;
- }
-
- IEnumerable<MergedProperty> GetMergeToProjectProperties (MSBuildSerializer ser, object ob)
- {
- ClassDataType dt = (ClassDataType) ser.DataContext.GetConfigurationDataType (ob.GetType ());
- foreach (ItemProperty prop in dt.GetProperties (ser.SerializationContext, ob)) {
- if (IsMergeToProjectProperty (prop)) {
- yield return new MergedProperty (prop.Name, prop.DataType is MSBuildBoolDataType);
- }
- }
- }
-
- struct MergedProperty
- {
- public readonly string Name;
- public readonly bool PreserveExistingCase;
-
- public MergedProperty (string name, bool preserveExistingCase)
- {
- this.Name = name;
- this.PreserveExistingCase = preserveExistingCase;
- }
- }
-
- internal ProjectItem ReadItem (MSBuildSerializer ser, MSBuildItem buildItem)
- {
- Project project = Item as Project;
- DotNetProject dotNetProject = Item as DotNetProject;
-
- DataType dt = ser.DataContext.GetConfigurationDataType (buildItem.Name);
-
- if (project != null) {
- if (buildItem.Name == "Folder") {
- // Read folders
- string path = MSBuildProjectService.FromMSBuildPath (project.ItemDirectory, buildItem.Include);
- return new ProjectFile () { Name = Path.GetDirectoryName (path), Subtype = Subtype.Directory };
- }
- else if (buildItem.Name == "Reference" && dotNetProject != null) {
- ProjectReference pref;
- if (buildItem.HasMetadata ("HintPath")) {
- string hintPath = buildItem.GetMetadata ("HintPath");
- string path;
- if (!MSBuildProjectService.FromMSBuildPath (dotNetProject.ItemDirectory, hintPath, out path)) {
- pref = new ProjectReference (ReferenceType.Assembly, path);
- pref.SetInvalid (GettextCatalog.GetString ("Invalid file path"));
- pref.ExtendedProperties ["_OriginalMSBuildReferenceInclude"] = buildItem.Include;
- pref.ExtendedProperties ["_OriginalMSBuildReferenceHintPath"] = hintPath;
- } else {
- var type = File.Exists (path) ? ReferenceType.Assembly : ReferenceType.Package;
- pref = new ProjectReference (type, buildItem.Include, path);
- pref.ExtendedProperties ["_OriginalMSBuildReferenceHintPath"] = hintPath;
- if (MSBuildProjectService.IsAbsoluteMSBuildPath (hintPath))
- pref.ExtendedProperties ["_OriginalMSBuildReferenceIsAbsolute"] = true;
- }
- } else {
- string asm = buildItem.Include;
- // This is a workaround for a VS bug. Looks like it is writing this assembly incorrectly
- if (asm == "System.configuration")
- asm = "System.Configuration";
- else if (asm == "System.XML")
- asm = "System.Xml";
- else if (asm == "system")
- asm = "System";
- pref = new ProjectReference (ReferenceType.Package, asm);
- }
- var privateCopy = buildItem.GetBoolMetadata ("Private");
- if (privateCopy != null)
- pref.LocalCopy = privateCopy.Value;
-
- pref.Condition = buildItem.Condition;
- string specificVersion = buildItem.GetMetadata ("SpecificVersion");
- if (string.IsNullOrWhiteSpace (specificVersion)) {
- // If the SpecificVersion element isn't present, check if the Assembly Reference specifies a Version
- pref.SpecificVersion = ReferenceStringHasVersion (buildItem.Include);
- }
- else {
- bool value;
- // if we can't parse the value, default to false which is more permissive
- pref.SpecificVersion = bool.TryParse (specificVersion, out value) && value;
- }
- ReadBuildItemMetadata (ser, buildItem, pref, typeof(ProjectReference));
- return pref;
- }
- else if (buildItem.Name == "ProjectReference" && dotNetProject != null) {
- // Get the project name from the path, since the Name attribute may other stuff other than the name
- string path = MSBuildProjectService.FromMSBuildPath (project.ItemDirectory, buildItem.Include);
- string name = Path.GetFileNameWithoutExtension (path);
- ProjectReference pref = new ProjectReference (ReferenceType.Project, name);
- pref.Condition = buildItem.Condition;
- var privateCopy = buildItem.GetBoolMetadata ("Private");
- if (privateCopy != null)
- pref.LocalCopy = privateCopy.Value;
- var roa = buildItem.GetBoolMetadata ("ReferenceOutputAssembly");
- pref.ReferenceOutputAssembly = roa == null || roa.Value;
- ReadBuildItemMetadata (ser, buildItem, pref, typeof(ProjectReference));
- return pref;
- }
- else if (dt == null && !string.IsNullOrEmpty (buildItem.Include)) {
- // Unknown item. Must be a file.
- if (!UnsupportedItems.Contains (buildItem.Name) && IsValidFile (buildItem.Include))
- return ReadProjectFile (ser, project, buildItem, typeof(ProjectFile));
- }
- }
-
- // ProjectReference objects only make sense on a DotNetProject, so don't load them
- // if that's not the type of the project.
- if (dt != null && dt.ValueType == typeof(ProjectReference) && dotNetProject == null)
- dt = null;
-
- if (dt != null && typeof(ProjectItem).IsAssignableFrom (dt.ValueType)) {
- ProjectItem obj = (ProjectItem) Activator.CreateInstance (dt.ValueType);
- ReadBuildItemMetadata (ser, buildItem, obj, dt.ValueType);
- return obj;
- }
-
- UnknownProjectItem uitem = new UnknownProjectItem (buildItem.Name, "");
- ReadBuildItemMetadata (ser, buildItem, uitem, typeof(UnknownProjectItem));
-
- return uitem;
- }
-
- bool ReferenceStringHasVersion (string asmName)
- {
- int commaPos = asmName.IndexOf (',');
- return commaPos >= 0 && asmName.IndexOf ("Version", commaPos, StringComparison.Ordinal) >= 0;
- }
-
- bool IsValidFile (string path)
- {
- // If it is an absolute uri, it's not a valid file
- try {
- if (Uri.IsWellFormedUriString (path, UriKind.Absolute)) {
- var f = new Uri (path);
- return f.Scheme == "file";
- }
- } catch {
- // Old mono versions may crash in IsWellFormedUriString if the path
- // is not an uri.
- }
- return true;
- }
-
- class ConfigData
- {
- public ConfigData (string conf, string plt, MSBuildPropertyGroup grp)
- {
- Config = conf;
- Platform = plt;
- Group = grp;
- }
-
- public bool FullySpecified {
- get { return Config != Unspecified && Platform != Unspecified; }
- }
-
- public string Config;
- public string Platform;
- public MSBuildPropertyGroup Group;
- public bool Exists;
- public bool IsNew; // The group did not exist in the original file
- }
-
- MSBuildPropertySet GetMergedConfiguration (List<ConfigData> configData, string conf, string platform, MSBuildPropertyGroup propGroupLimit)
- {
- MSBuildPropertySet merged = null;
-
- foreach (ConfigData grp in configData) {
- if (grp.Group == propGroupLimit)
- break;
- if ((grp.Config == conf || grp.Config == Unspecified || conf == Unspecified) && (grp.Platform == platform || grp.Platform == Unspecified || platform == Unspecified)) {
- if (merged == null)
- merged = grp.Group;
- else if (merged is MSBuildPropertyGroupMerged)
- ((MSBuildPropertyGroupMerged)merged).Add (grp.Group);
- else {
- MSBuildPropertyGroupMerged m = new MSBuildPropertyGroupMerged ();
- m.Add ((MSBuildPropertyGroup)merged);
- m.Add (grp.Group);
- merged = m;
- }
- }
- }
- return merged;
- }
-
- bool ContainsSpecificPlatformConfiguration (List<ConfigData> configData, string conf)
- {
- foreach (ConfigData grp in configData) {
- if (grp.Config == conf && grp.Platform != Unspecified)
- return true;
- }
- return false;
- }
-
- public override void OnModified (string hint)
- {
- base.OnModified (hint);
- modifiedInMemory = true;
- }
-
- protected override void SaveItem (MonoDevelop.Core.IProgressMonitor monitor)
- {
- modifiedInMemory = false;
-
- MSBuildProject msproject = SaveProject (monitor);
- if (msproject == null)
- return;
-
- // Don't save the file to disk if the content did not change
- msproject.Save (EntityItem.FileName);
-
- if (projectBuilder != null)
- projectBuilder.Refresh ();
- }
-
- protected virtual MSBuildProject SaveProject (IProgressMonitor monitor)
- {
- if (Item is UnknownSolutionItem)
- return null;
-
- var toolsFormat = GetToolsFormat ();
-
- bool newProject;
- SolutionEntityItem eitem = EntityItem;
-
- MSBuildSerializer ser = CreateSerializer ();
- ser.SerializationContext.BaseFile = eitem.FileName;
- ser.SerializationContext.ProgressMonitor = monitor;
-
- DotNetProject dotNetProject = Item as DotNetProject;
-
- MSBuildProject msproject = new MSBuildProject ();
- newProject = EntityItem.FileName == null || !File.Exists (EntityItem.FileName);
- if (newProject) {
- msproject.DefaultTargets = "Build";
- } else {
- msproject.Load (EntityItem.FileName);
- }
-
- // Global properties
-
- MSBuildPropertySet globalGroup = msproject.GetGlobalPropertyGroup ();
- if (globalGroup == null) {
- globalGroup = msproject.AddNewPropertyGroup (false);
- }
-
- if (eitem.Configurations.Count > 0) {
- ItemConfiguration conf = eitem.Configurations.FirstOrDefault<ItemConfiguration> (c => c.Name == "Debug");
- if (conf == null) conf = eitem.Configurations [0];
- MSBuildProperty bprop = globalGroup.SetPropertyValue ("Configuration", conf.Name, false);
- bprop.Condition = " '$(Configuration)' == '' ";
-
- string platform = conf.Platform.Length == 0 ? "AnyCPU" : conf.Platform;
- bprop = globalGroup.SetPropertyValue ("Platform", platform, false);
- bprop.Condition = " '$(Platform)' == '' ";
- }
-
- if (TypeGuid == MSBuildProjectService.GenericItemGuid) {
- DataType dt = MSBuildProjectService.DataContext.GetConfigurationDataType (Item.GetType ());
- globalGroup.SetPropertyValue ("ItemType", dt.Name, false);
- }
-
- Item.ExtendedProperties ["ProjectGuid"] = Item.ItemId;
- if (subtypeGuids.Count > 0) {
- string gg = "";
- foreach (string sg in subtypeGuids) {
- if (gg.Length > 0)
- gg += ";";
- gg += sg;
- }
- gg += ";" + TypeGuid;
- Item.ExtendedProperties ["ProjectTypeGuids"] = gg.ToUpper ();
- globalGroup.SetPropertyValue ("ProjectTypeGuids", gg.ToUpper (), true);
- } else {
- Item.ExtendedProperties.Remove ("ProjectTypeGuids");
- globalGroup.RemoveProperty ("ProjectTypeGuids");
- }
-
- Item.ExtendedProperties ["ProductVersion"] = productVersion;
- Item.ExtendedProperties ["SchemaVersion"] = schemaVersion;
-
- // having no ToolsVersion is equivalent to 2.0, roundtrip that correctly
- if (ToolsVersion != "2.0")
- msproject.ToolsVersion = ToolsVersion;
- else if (string.IsNullOrEmpty (msproject.ToolsVersion))
- msproject.ToolsVersion = null;
- else
- msproject.ToolsVersion = "2.0";
-
- // This serialize call will write data to ser.InternalItemProperties and ser.ExternalItemProperties
- ser.Serialize (Item, Item.GetType ());
-
- object langParams = null;
-
- if (dotNetProject != null && dotNetProject.LanguageParameters != null) {
- // Remove all language parameters properties from the data item, since we are going to write them again.
- ClassDataType dt = (ClassDataType) ser.DataContext.GetConfigurationDataType (dotNetProject.LanguageParameters.GetType ());
- foreach (ItemProperty prop in dt.GetProperties (ser.SerializationContext, dotNetProject.LanguageParameters)) {
- DataNode n = ser.InternalItemProperties.ItemData [prop.Name];
- if (n != null)
- ser.InternalItemProperties.ItemData.Remove (n);
- }
- DataItem ditemComp = (DataItem) ser.Serialize (dotNetProject.LanguageParameters);
- ser.InternalItemProperties.ItemData.AddRange (ditemComp.ItemData);
- langParams = dotNetProject.LanguageParameters;
- }
-
- if (newProject)
- ser.InternalItemProperties.ItemData.Sort (globalConfigOrder);
-
- WritePropertyGroupMetadata (globalGroup, ser.InternalItemProperties.ItemData, ser, Item, langParams);
-
- // Convert debug property
-
- foreach (SolutionItemConfiguration conf in eitem.Configurations) {
- if (newProject && conf is DotNetProjectConfiguration) {
- conf.ExtendedProperties ["ErrorReport"] = "prompt";
- }
- }
-
- // Configurations
-
- if (eitem.Configurations.Count > 0) {
- List<ConfigData> configData = GetConfigData (msproject, true);
-
- var mergeToProjectPropertyValues = new Dictionary<string,MergedPropertyValue> ();
- var mergeToProjectProperties = new HashSet<MergedProperty> (GetMergeToProjectProperties (ser, eitem.Configurations [0]));
- var mergeToProjectPropertyNames = new HashSet<string> (mergeToProjectProperties.Select (p => p.Name));
-
- foreach (SolutionItemConfiguration conf in eitem.Configurations) {
- bool newConf = false;
- ConfigData cdata = FindPropertyGroup (configData, conf);
- if (cdata == null) {
- MSBuildPropertyGroup pg = msproject.AddNewPropertyGroup (true);
- pg.Condition = BuildConfigCondition (conf.Name, conf.Platform);
- cdata = new ConfigData (conf.Name, conf.Platform, pg);
- cdata.IsNew = true;
- configData.Add (cdata);
- newConf = true;
- }
-
- MSBuildPropertyGroup propGroup = cdata.Group;
- cdata.Exists = true;
-
- MSBuildPropertySet baseGroup = GetMergedConfiguration (configData, conf.Name, conf.Platform, propGroup);
-
- // Force the serialization of properties defined in
- // the base group, so that they can be later unmerged
- if (baseGroup != null)
- ForceDefaultValueSerialization (ser, baseGroup, conf);
- DataItem ditem = (DataItem) ser.Serialize (conf);
- ser.SerializationContext.ResetDefaultValueSerialization ();
-
- DotNetProjectConfiguration netConfig = conf as DotNetProjectConfiguration;
-
- if (netConfig != null && netConfig.CompilationParameters != null) {
- // Remove all compilation parameters properties from the data item, since we are going to write them again.
- ClassDataType dt = (ClassDataType) ser.DataContext.GetConfigurationDataType (netConfig.CompilationParameters.GetType ());
- foreach (ItemProperty prop in dt.GetProperties (ser.SerializationContext, netConfig.CompilationParameters)) {
- DataNode n = ditem.ItemData [prop.Name];
- if (n != null)
- ditem.ItemData.Remove (n);
- }
- if (baseGroup != null)
- ForceDefaultValueSerialization (ser, baseGroup, netConfig.CompilationParameters);
- DataItem ditemComp = (DataItem) ser.Serialize (netConfig.CompilationParameters);
- ser.SerializationContext.ResetDefaultValueSerialization ();
- ditem.ItemData.AddRange (ditemComp.ItemData);
- }
-
- if (newConf)
- ditem.ItemData.Sort (configOrder);
-
- WritePropertyGroupMetadata (propGroup, ditem.ItemData, ser, conf, netConfig != null ? netConfig.CompilationParameters : null);
-
- CollectMergetoprojectProperties (propGroup, mergeToProjectProperties, mergeToProjectPropertyValues);
-
- if (baseGroup != null)
- propGroup.UnMerge (baseGroup, mergeToProjectPropertyNames);
- }
-
- // Move properties with common values from configurations to the main
- // property group
- foreach (KeyValuePair<string,MergedPropertyValue> prop in mergeToProjectPropertyValues)
- globalGroup.SetPropertyValue (prop.Key, prop.Value.XmlValue, prop.Value.PreserveExistingCase, true);
- foreach (string prop in mergeToProjectPropertyNames) {
- if (!mergeToProjectPropertyValues.ContainsKey (prop))
- globalGroup.RemoveProperty (prop);
- }
- foreach (SolutionItemConfiguration conf in eitem.Configurations) {
- MSBuildPropertyGroup propGroup = FindPropertyGroup (configData, conf).Group;
- foreach (string mp in mergeToProjectPropertyValues.Keys)
- propGroup.RemoveProperty (mp);
- }
-
- // Remove groups corresponding to configurations that have been removed
- // or groups which don't have any property and did not already exist
- foreach (ConfigData cd in configData) {
- if ((!cd.Exists && cd.FullySpecified) || (cd.IsNew && !cd.Group.Properties.Any ()))
- msproject.RemoveGroup (cd.Group);
- }
- }
-
- SaveProjectItems (monitor, toolsFormat, ser, msproject);
-
- if (dotNetProject != null) {
- var moniker = dotNetProject.TargetFramework.Id;
- bool supportsMultipleFrameworks = toolsFormat.SupportsMonikers || toolsFormat.SupportedFrameworks.Length > 0;
- var def = dotNetProject.GetDefaultTargetFrameworkForFormat (GetFileFormat (toolsFormat));
-
- // If the format only supports one fx version, or the version is the default, there is no need to store it.
- // However, is there is already a value set, do not remove it.
- if (supportsMultipleFrameworks) {
- SetIfPresentOrNotDefaultValue (globalGroup, "TargetFrameworkVersion", "v" + moniker.Version, "v" + def.Version);
- }
-
- if (toolsFormat.SupportsMonikers) {
- SetIfPresentOrNotDefaultValue (globalGroup, "TargetFrameworkIdentifier", moniker.Identifier, def.Identifier);
- SetIfPresentOrNotDefaultValue (globalGroup, "TargetFrameworkProfile", moniker.Profile, def.Profile);
- }
- }
-
- // Impdate the imports section
-
- List<DotNetProjectImport> currentImports = msproject.Imports.Select (i => new DotNetProjectImport (i.Project)).ToList ();
- List<DotNetProjectImport> imports = new List<DotNetProjectImport> (currentImports);
-
- // If the project is not new, don't add the default project imports,
- // just assume that the current imports are correct
- UpdateImports (imports, dotNetProject, newProject);
- foreach (DotNetProjectImport imp in imports) {
- if (!currentImports.Contains (imp)) {
- MSBuildImport import = msproject.AddNewImport (imp.Name);
- if (imp.HasCondition ())
- import.Condition = imp.Condition;
- currentImports.Add (imp);
- }
- }
- foreach (DotNetProjectImport imp in currentImports) {
- if (!imports.Contains (imp))
- msproject.RemoveImport (imp.Name);
- }
-
- DataItem extendedData = ser.ExternalItemProperties;
- if (extendedData.HasItemData) {
- extendedData.Name = "Properties";
- StringWriter sw = new StringWriter ();
- XmlConfigurationWriter.DefaultWriter.Write (new XmlTextWriter (sw), extendedData);
- msproject.SetProjectExtensions ("MonoDevelop", sw.ToString ());
- } else
- msproject.RemoveProjectExtensions ("MonoDevelop");
-
- SaveToMSBuildProject (monitor, msproject);
-
- return msproject;
- }
-
- internal void SaveProjectItems (IProgressMonitor monitor, MSBuildFileFormat toolsFormat, MSBuildSerializer ser, MSBuildProject msproject, string pathPrefix = null)
- {
- // Remove old items
- Dictionary<string, ItemInfo> oldItems = new Dictionary<string, ItemInfo> ();
- foreach (MSBuildItem item in msproject.GetAllItems ())
- oldItems [item.Name + "<" + item.UnevaluatedInclude + "<" + item.Condition] = new ItemInfo () {
- Item = item
- };
- // Add the new items
- foreach (object ob in ((SolutionEntityItem)Item).Items.Concat (((SolutionEntityItem)Item).WildcardItems).Where (it => !it.Flags.HasFlag (ProjectItemFlags.DontPersist)))
- SaveItem (monitor, toolsFormat, ser, msproject, ob, oldItems, pathPrefix);
- foreach (ItemInfo itemInfo in oldItems.Values) {
- if (!itemInfo.Added)
- msproject.RemoveItem (itemInfo.Item);
- }
- }
-
- protected void SaveToMSBuildProject (IProgressMonitor monitor, MSBuildProject msproject)
- {
- foreach (var ext in GetMSBuildExtensions ())
- ext.SaveProject (monitor, EntityItem, msproject);
- }
-
- void SetIfPresentOrNotDefaultValue (MSBuildPropertySet propGroup, string name, string value, string defaultValue, bool isXml = false)
- {
- bool hasDefaultValue = string.IsNullOrEmpty (value) || value == defaultValue;
- var prop = propGroup.GetProperty (name);
- if (prop != null) {
- //if the value is default or empty, only remove the element if it was not already the default or empty
- //to avoid unnecessary project file churn
- if (hasDefaultValue) {
- var existing = prop.GetValue (isXml);
- bool alreadyHadDefaultValue = string.IsNullOrEmpty (existing) || existing == defaultValue;
- if (!alreadyHadDefaultValue)
- propGroup.RemoveProperty (name);
- } else {
- prop.SetValue (value, isXml);
- }
- } else if (!hasDefaultValue) {
- propGroup.SetPropertyValue (name, value, false, isXml);
- }
- }
-
- void ForceDefaultValueSerialization (MSBuildSerializer ser, MSBuildPropertySet baseGroup, object ob)
- {
- ClassDataType dt = (ClassDataType) ser.DataContext.GetConfigurationDataType (ob.GetType());
- foreach (ItemProperty prop in dt.GetProperties (ser.SerializationContext, ob)) {
- if (baseGroup.GetProperty (prop.Name) != null)
- ser.SerializationContext.ForceDefaultValueSerialization (prop);
- }
- }
-
- void CollectMergetoprojectProperties (MSBuildPropertyGroup pgroup, HashSet<MergedProperty> properties, Dictionary<string,MergedPropertyValue> mergeToProjectProperties)
- {
- // This method checks every property in pgroup which has the MergeToProject flag.
- // If the value of this property is the same as the one stored in mergeToProjectProperties
- // it means that the property can be merged to the main project property group (so far).
-
- foreach (var pinfo in new List<MergedProperty> (properties)) {
- MSBuildProperty prop = pgroup.GetProperty (pinfo.Name);
-
- MergedPropertyValue mvalue;
- if (!mergeToProjectProperties.TryGetValue (pinfo.Name, out mvalue)) {
- if (prop != null) {
- // This is the first time the value is checked. Just assign it.
- mergeToProjectProperties.Add (pinfo.Name, new MergedPropertyValue (prop.GetValue (true), pinfo.PreserveExistingCase));
- continue;
- }
- // If there is no value, it can't be merged
- }
- else if (prop != null && string.Equals (prop.GetValue (true), mvalue.XmlValue, StringComparison.OrdinalIgnoreCase))
- // Same value. It can be merged.
- continue;
-
- // The property can't be merged because different configurations have different
- // values for it. Remove it from the list.
- properties.Remove (pinfo);
- mergeToProjectProperties.Remove (pinfo.Name);
- }
- }
-
- struct MergedPropertyValue
- {
- public readonly string XmlValue;
- public readonly bool PreserveExistingCase;
-
- public MergedPropertyValue (string xmlValue, bool preserveExistingCase)
- {
- this.XmlValue = xmlValue;
- this.PreserveExistingCase = preserveExistingCase;
- }
- }
-
- void SaveItem (IProgressMonitor monitor, MSBuildFileFormat fmt, MSBuildSerializer ser, MSBuildProject msproject, object ob, Dictionary<string,ItemInfo> oldItems, string pathPrefix = null)
- {
- if (ob is ProjectReference) {
- SaveReference (monitor, fmt, ser, msproject, (ProjectReference) ob, oldItems);
- }
- else if (ob is ProjectFile) {
- SaveProjectFile (ser, msproject, (ProjectFile) ob, oldItems, pathPrefix);
- }
- else {
- string itemName;
- if (ob is UnknownProjectItem) {
- var ui = (UnknownProjectItem)ob;
- itemName = ui.ItemName;
- var buildItem = AddOrGetBuildItem (msproject, oldItems, itemName, ui.Include, ui.Condition);
- WriteBuildItemMetadata (ser, buildItem, ob, oldItems);
- }
- else {
- DataType dt = ser.DataContext.GetConfigurationDataType (ob.GetType ());
- var buildItem = msproject.AddNewItem (dt.Name, "");
- WriteBuildItemMetadata (ser, buildItem, ob, oldItems);
- }
- }
- }
-
- void SaveProjectFile (MSBuildSerializer ser, MSBuildProject msproject, ProjectFile file, Dictionary<string,ItemInfo> oldItems, string pathPrefix = null)
- {
- if (file.IsOriginatedFromWildcard) return;
-
- string itemName = (file.Subtype == Subtype.Directory)? "Folder" : file.BuildAction;
-
- string path = pathPrefix + MSBuildProjectService.ToMSBuildPath (Item.ItemDirectory, file.FilePath);
- if (path.Length == 0)
- return;
-
- //directory paths must end with '/'
- if ((file.Subtype == Subtype.Directory) && path[path.Length-1] != '\\')
- path = path + "\\";
-
- MSBuildItem buildItem = AddOrGetBuildItem (msproject, oldItems, itemName, path, file.Condition);
- WriteBuildItemMetadata (ser, buildItem, file, oldItems);
-
- if (!string.IsNullOrEmpty (file.DependsOn))
- buildItem.SetMetadata ("DependentUpon", MSBuildProjectService.ToMSBuildPath (Path.GetDirectoryName (file.FilePath), file.DependsOn));
- else
- buildItem.UnsetMetadata ("DependentUpon");
-
- if (!string.IsNullOrEmpty (file.ContentType))
- buildItem.SetMetadata ("SubType", file.ContentType);
-
- if (!string.IsNullOrEmpty (file.Generator))
- buildItem.SetMetadata ("Generator", file.Generator);
- else
- buildItem.UnsetMetadata ("Generator");
-
- if (!string.IsNullOrEmpty (file.CustomToolNamespace))
- buildItem.SetMetadata ("CustomToolNamespace", file.CustomToolNamespace);
- else
- buildItem.UnsetMetadata ("CustomToolNamespace");
-
- if (!string.IsNullOrEmpty (file.LastGenOutput))
- buildItem.SetMetadata ("LastGenOutput", file.LastGenOutput);
- else
- buildItem.UnsetMetadata ("LastGenOutput");
-
- if (!string.IsNullOrEmpty (file.Link))
- buildItem.SetMetadata ("Link", MSBuildProjectService.ToMSBuildPathRelative (Item.ItemDirectory, file.Link));
- else
- buildItem.UnsetMetadata ("Link");
-
- buildItem.Condition = file.Condition;
-
- if (file.CopyToOutputDirectory == FileCopyMode.None) {
- buildItem.UnsetMetadata ("CopyToOutputDirectory");
- } else {
- buildItem.SetMetadata ("CopyToOutputDirectory", file.CopyToOutputDirectory.ToString ());
- }
-
- if (!file.Visible) {
- buildItem.SetMetadata ("Visible", "False");
- } else {
- buildItem.UnsetMetadata ("Visible");
- }
-
- var resId = file.ResourceId;
-
- //For EmbeddedResource, emit LogicalName only when it does not match the default Id
- if (file.BuildAction == BuildAction.EmbeddedResource && GetDefaultResourceId (file) == resId)
- resId = null;
-
- if (!string.IsNullOrEmpty (resId)) {
- buildItem.SetMetadata ("LogicalName", resId);
- } else {
- buildItem.UnsetMetadata ("LogicalName");
- }
- }
-
- void SaveReference (IProgressMonitor monitor, MSBuildFileFormat fmt, MSBuildSerializer ser, MSBuildProject msproject, ProjectReference pref, Dictionary<string,ItemInfo> oldItems)
- {
- MSBuildItem buildItem;
- if (pref.ReferenceType == ReferenceType.Assembly) {
- string asm = null;
- string hintPath = null;
- if (pref.ExtendedProperties.Contains ("_OriginalMSBuildReferenceInclude")) {
- asm = (string) pref.ExtendedProperties ["_OriginalMSBuildReferenceInclude"];
- hintPath = (string) pref.ExtendedProperties ["_OriginalMSBuildReferenceHintPath"];
- }
- else {
- if (File.Exists (pref.HintPath)) {
- try {
- var aname = AssemblyName.GetAssemblyName (pref.HintPath);
- if (pref.SpecificVersion) {
- asm = aname.FullName;
- } else {
- asm = aname.Name;
- }
- } catch (Exception ex) {
- string msg = string.Format ("Could not get full name for assembly '{0}'.", pref.Reference);
- monitor.ReportWarning (msg);
- LoggingService.LogError (msg, ex);
- }
- }
- string basePath = Item.ItemDirectory;
- if (pref.ExtendedProperties.Contains ("_OriginalMSBuildReferenceIsAbsolute"))
- basePath = null;
- hintPath = MSBuildProjectService.ToMSBuildPath (basePath, pref.HintPath);
- }
- if (asm == null)
- asm = Path.GetFileNameWithoutExtension (pref.Reference);
-
- buildItem = AddOrGetBuildItem (msproject, oldItems, "Reference", asm, pref.Condition);
-
- if (!pref.SpecificVersion && ReferenceStringHasVersion (asm)) {
- buildItem.SetMetadata ("SpecificVersion", "False");
- } else {
- buildItem.UnsetMetadata ("SpecificVersion");
- }
-
- buildItem.SetMetadata ("HintPath", hintPath);
- }
- else if (pref.ReferenceType == ReferenceType.Package) {
- string include = pref.StoredReference;
- SystemPackage pkg = pref.Package;
- if (pkg != null && pkg.IsFrameworkPackage) {
- int i = include.IndexOf (',');
- if (i != -1)
- include = include.Substring (0, i).Trim ();
- }
- buildItem = AddOrGetBuildItem (msproject, oldItems, "Reference", include, pref.Condition);
- if (!pref.SpecificVersion && ReferenceStringHasVersion (include))
- buildItem.SetMetadata ("SpecificVersion", "False");
- else
- buildItem.UnsetMetadata ("SpecificVersion");
-
- //RequiredTargetFramework is undocumented, maybe only a hint for VS. Only seems to be used for .NETFramework
- var dnp = pref.OwnerProject as DotNetProject;
- IList supportedFrameworks = fmt.SupportedFrameworks;
- if (supportedFrameworks != null && dnp != null && pkg != null
- && dnp.TargetFramework.Id.Identifier == TargetFrameworkMoniker.ID_NET_FRAMEWORK
- && pkg.IsFrameworkPackage && supportedFrameworks.Contains (pkg.TargetFramework)
- && pkg.TargetFramework.Version != "2.0" && supportedFrameworks.Count > 1)
- {
- TargetFramework fx = Runtime.SystemAssemblyService.GetTargetFramework (pkg.TargetFramework);
- buildItem.SetMetadata ("RequiredTargetFramework", fx.Id.Version);
- } else {
- buildItem.UnsetMetadata ("RequiredTargetFramework");
- }
-
- string hintPath = (string) pref.ExtendedProperties ["_OriginalMSBuildReferenceHintPath"];
- if (hintPath != null)
- buildItem.SetMetadata ("HintPath", hintPath);
- else
- buildItem.UnsetMetadata ("HintPath");
- }
- else if (pref.ReferenceType == ReferenceType.Project) {
- Project refProj = Item.ParentSolution != null ? Item.ParentSolution.FindProjectByName (pref.Reference) : null;
- if (refProj != null) {
- buildItem = AddOrGetBuildItem (msproject, oldItems, "ProjectReference", MSBuildProjectService.ToMSBuildPath (Item.ItemDirectory, refProj.FileName), pref.Condition);
- MSBuildProjectHandler handler = refProj.ItemHandler as MSBuildProjectHandler;
- if (handler != null)
- buildItem.SetMetadata ("Project", handler.Item.ItemId);
- else
- buildItem.UnsetMetadata ("Project");
- buildItem.SetMetadata ("Name", refProj.Name);
- if (pref.ReferenceOutputAssembly)
- buildItem.UnsetMetadata ("ReferenceOutputAssembly");
- else
- buildItem.SetMetadata ("ReferenceOutputAssembly", false);
- } else {
- monitor.ReportWarning (GettextCatalog.GetString ("Reference to unknown project '{0}' ignored.", pref.Reference));
- return;
- }
- }
- else {
- // Custom
- DataType dt = ser.DataContext.GetConfigurationDataType (pref.GetType ());
- buildItem = AddOrGetBuildItem (msproject, oldItems, dt.Name, pref.Reference, pref.Condition);
- }
-
- if (pref.LocalCopy != pref.DefaultLocalCopy)
- buildItem.SetMetadata ("Private", pref.LocalCopy);
- else
- buildItem.UnsetMetadata ("Private");
-
- WriteBuildItemMetadata (ser, buildItem, pref, oldItems);
- buildItem.Condition = pref.Condition;
- }
-
- void UpdateImports (List<DotNetProjectImport> imports, DotNetProject project, bool addItemTypeImports)
- {
- if (targetImports != null && addItemTypeImports) {
- AddMissingImports (imports, targetImports);
- }
-
- List <string> updatedImports = imports.Select (import => import.Name).ToList ();
- foreach (IMSBuildImportProvider ip in AddinManager.GetExtensionObjects ("/MonoDevelop/ProjectModel/MSBuildImportProviders")) {
- ip.UpdateImports (EntityItem, updatedImports);
- }
-
- UpdateImports (imports, updatedImports);
-
- if (project != null) {
- AddMissingImports (imports, project.ImportsAdded);
- RemoveImports (imports, project.ImportsRemoved);
- project.ImportsSaved ();
- }
- }
-
- void AddMissingImports (List<DotNetProjectImport> existingImports, IEnumerable<string> newImports)
- {
- AddMissingImports (existingImports, newImports.Select (import => new DotNetProjectImport (import)));
- }
-
- void AddMissingImports (List<DotNetProjectImport> existingImports, IEnumerable<DotNetProjectImport> newImports)
- {
- foreach (DotNetProjectImport imp in newImports)
- if (!existingImports.Contains (imp))
- existingImports.Add (imp);
- }
-
- void UpdateImports (List<DotNetProjectImport> existingImports, List<string> updatedImports)
- {
- RemoveMissingImports (existingImports, updatedImports);
- AddMissingImports (existingImports, updatedImports);
- }
-
- void RemoveMissingImports (List<DotNetProjectImport> existingImports, List<string> updatedImports)
- {
- List <DotNetProjectImport> importsToRemove = existingImports.Where (import => !updatedImports.Contains (import.Name)).ToList ();
- RemoveImports (existingImports, importsToRemove);
- }
-
- void RemoveImports (List<DotNetProjectImport> existingImports, IEnumerable<DotNetProjectImport> importsToRemove)
- {
- foreach (DotNetProjectImport imp in importsToRemove)
- existingImports.Remove (imp);
- }
-
- IEnumerable<MSBuildExtension> GetMSBuildExtensions ()
- {
- foreach (var e in AddinManager.GetExtensionObjects<MSBuildExtension> ("/MonoDevelop/ProjectModel/MSBuildExtensions")) {
- e.Handler = this;
- yield return e;
- e.Handler = null;
- }
- }
-
- void ReadBuildItemMetadata (DataSerializer ser, MSBuildItem buildItem, object dataItem, Type extendedType)
- {
- DataItem ditem = new DataItem ();
- foreach (ItemProperty prop in ser.GetProperties (dataItem)) {
- string name = ToMsbuildItemName (prop.Name);
- if (name == "Include")
- ditem.ItemData.Add (new DataValue ("Include", buildItem.Include));
- else if (buildItem.HasMetadata (name)) {
- string data = buildItem.GetMetadata (name, !prop.DataType.IsSimpleType);
- ditem.ItemData.Add (GetDataNode (prop, data));
- }
- }
- ConvertFromMsbuildFormat (ditem);
- ser.Deserialize (dataItem, ditem);
- }
-
- void WriteBuildItemMetadata (DataSerializer ser, MSBuildItem buildItem, object dataItem, Dictionary<string,ItemInfo> oldItems)
- {
- var notWrittenProps = new HashSet<string> ();
- foreach (ItemProperty prop in ser.GetProperties (dataItem))
- notWrittenProps.Add (prop.Name);
-
- DataItem ditem = (DataItem) ser.Serialize (dataItem, dataItem.GetType ());
- if (ditem.HasItemData) {
- foreach (DataNode node in ditem.ItemData) {
- notWrittenProps.Remove (node.Name);
- if (node.Name == "Include" && node is DataValue)
- buildItem.Include = ((DataValue) node).Value;
- else {
- ConvertToMsbuildFormat (node);
- buildItem.SetMetadata (node.Name, GetXmlString (node), node is DataItem);
- }
- }
- }
- foreach (string prop in notWrittenProps)
- buildItem.UnsetMetadata (prop);
- }
-
- MSBuildItem AddOrGetBuildItem (MSBuildProject msproject, Dictionary<string,ItemInfo> oldItems, string name, string include, string condition)
- {
- ItemInfo itemInfo;
- string key = name + "<" + include + "<" + condition;
- if (oldItems.TryGetValue (key, out itemInfo)) {
- if (!itemInfo.Added) {
- itemInfo.Added = true;
- oldItems [key] = itemInfo;
- }
- return itemInfo.Item;
- } else {
- return msproject.AddNewItem (name, include);
- }
- }
-
- DataItem ReadPropertyGroupMetadata (DataSerializer ser, MSBuildPropertySet propGroup, object dataItem)
- {
- DataItem ditem = new DataItem ();
-
- foreach (MSBuildProperty bprop in propGroup.Properties) {
- DataNode node = null;
- foreach (XmlNode xnode in bprop.Element.ChildNodes) {
- if (xnode is XmlElement) {
- node = XmlConfigurationReader.DefaultReader.Read ((XmlElement)xnode);
- break;
- }
- }
- if (node == null) {
- node = new DataValue (bprop.Name, bprop.GetValue (false));
- }
-
- ConvertFromMsbuildFormat (node);
- ditem.ItemData.Add (node);
- }
-
- return ditem;
- }
-
- void WritePropertyGroupMetadata (MSBuildPropertySet propGroup, DataCollection itemData, MSBuildSerializer ser, params object[] itemsToReplace)
- {
- var notWrittenProps = new HashSet<string> ();
-
- foreach (object ob in itemsToReplace) {
- if (ob == null)
- continue;
- ClassDataType dt = (ClassDataType) ser.DataContext.GetConfigurationDataType (ob.GetType ());
- foreach (ItemProperty prop in dt.GetProperties (ser.SerializationContext, ob))
- notWrittenProps.Add (prop.Name);
- }
-
- foreach (DataNode node in itemData) {
- notWrittenProps.Remove (node.Name);
- ConvertToMsbuildFormat (node);
-
- // In the other msbuild contexts (metadata, solution properties, etc) we TitleCase by default, so the node.Value is TitleCase.
- // However, for property value, we lowercase by default and preserve existing case to reduce noise on VS-created files.
- var boolNode = node as MSBuildBoolDataValue;
- string value;
- bool preserveExistingCase;
- if (boolNode != null) {
- value = boolNode.RawValue? "true" : "false";
- preserveExistingCase = true;
- } else {
- value = GetXmlString (node);
- preserveExistingCase = false;
- }
-
- propGroup.SetPropertyValue (node.Name, value, preserveExistingCase, node is DataItem);
- }
- foreach (string prop in notWrittenProps)
- propGroup.RemoveProperty (prop);
- }
-
- string ToMsbuildItemName (string name)
- {
- return name.Replace ('.', '-');
- }
-
- void ConvertToMsbuildFormat (DataNode node)
- {
- ReplaceChar (node, true, '.', '-');
- }
-
- void ConvertFromMsbuildFormat (DataNode node)
- {
- ReplaceChar (node, true, '-', '.');
- }
-
- void ReplaceChar (DataNode node, bool force, char oldChar, char newChar)
- {
- DataItem it = node as DataItem;
- if ((force || it != null) && node.Name != null)
- node.Name = node.Name.Replace (oldChar, newChar);
- if (it != null) {
- foreach (DataNode cnode in it.ItemData)
- ReplaceChar (cnode, !it.UniqueNames, oldChar, newChar);
- }
- }
-
- List<ConfigData> GetConfigData (MSBuildProject msproject, bool includeGlobalGroups)
- {
- List<ConfigData> configData = new List<ConfigData> ();
- foreach (MSBuildPropertyGroup cgrp in msproject.PropertyGroups) {
- string conf, platform;
- if (ParseConfigCondition (cgrp.Condition, out conf, out platform) || includeGlobalGroups)
- configData.Add (new ConfigData (conf, platform, cgrp));
- }
- return configData;
- }
-
- ConfigData FindPropertyGroup (List<ConfigData> configData, SolutionItemConfiguration config)
- {
- foreach (ConfigData data in configData) {
- if (data.Config == config.Name && data.Platform == config.Platform)
- return data;
- }
- return null;
- }
-
- ProjectFile ReadProjectFile (DataSerializer ser, Project project, MSBuildItem buildItem, Type type)
- {
- string path = MSBuildProjectService.FromMSBuildPath (project.ItemDirectory, buildItem.Include);
- ProjectFile file = (ProjectFile) Activator.CreateInstance (type);
- file.Name = path;
- file.BuildAction = buildItem.Name;
-
- ReadBuildItemMetadata (ser, buildItem, file, type);
-
- string dependentFile = buildItem.GetMetadata ("DependentUpon");
- if (!string.IsNullOrEmpty (dependentFile)) {
- dependentFile = MSBuildProjectService.FromMSBuildPath (Path.GetDirectoryName (path), dependentFile);
- file.DependsOn = dependentFile;
- }
-
- string copyToOutputDirectory = buildItem.GetMetadata ("CopyToOutputDirectory");
- if (!string.IsNullOrEmpty (copyToOutputDirectory)) {
- switch (copyToOutputDirectory) {
- case "None": break;
- case "Always": file.CopyToOutputDirectory = FileCopyMode.Always; break;
- case "PreserveNewest": file.CopyToOutputDirectory = FileCopyMode.PreserveNewest; break;
- default:
- MonoDevelop.Core.LoggingService.LogWarning (
- "Unrecognised value {0} for CopyToOutputDirectory MSBuild property",
- copyToOutputDirectory);
- break;
- }
- }
-
- if (buildItem.GetMetadataIsFalse ("Visible"))
- file.Visible = false;
-
-
- string resourceId = buildItem.GetMetadata ("LogicalName");
- if (!string.IsNullOrEmpty (resourceId))
- file.ResourceId = resourceId;
-
- string contentType = buildItem.GetMetadata ("SubType");
- if (!string.IsNullOrEmpty (contentType))
- file.ContentType = contentType;
-
- string generator = buildItem.GetMetadata ("Generator");
- if (!string.IsNullOrEmpty (generator))
- file.Generator = generator;
-
- string customToolNamespace = buildItem.GetMetadata ("CustomToolNamespace");
- if (!string.IsNullOrEmpty (customToolNamespace))
- file.CustomToolNamespace = customToolNamespace;
-
- string lastGenOutput = buildItem.GetMetadata ("LastGenOutput");
- if (!string.IsNullOrEmpty (lastGenOutput))
- file.LastGenOutput = lastGenOutput;
-
- string link = buildItem.GetMetadata ("Link");
- if (!string.IsNullOrEmpty (link)) {
- if (!Platform.IsWindows)
- link = MSBuildProjectService.UnescapePath (link);
- file.Link = link;
- }
-
- file.Condition = buildItem.Condition;
- return file;
- }
-
- bool ParseConfigCondition (string cond, out string config, out string platform)
- {
- config = platform = Unspecified;
- int i = cond.IndexOf ("==", StringComparison.Ordinal);
- if (i == -1)
- return false;
- if (cond.Substring (0, i).Trim () == "'$(Configuration)|$(Platform)'") {
- if (!ExtractConfigName (cond.Substring (i + 2), out cond))
- return false;
- i = cond.IndexOf ('|');
- if (i != -1) {
- config = cond.Substring (0, i);
- platform = cond.Substring (i+1);
- } else {
- // Invalid configuration
- return false;
- }
- if (platform == "AnyCPU")
- platform = string.Empty;
- return true;
- }
- else if (cond.Substring (0, i).Trim () == "'$(Configuration)'") {
- if (!ExtractConfigName (cond.Substring (i + 2), out config))
- return false;
- platform = Unspecified;
- return true;
- }
- else if (cond.Substring (0, i).Trim () == "'$(Platform)'") {
- config = Unspecified;
- if (!ExtractConfigName (cond.Substring (i + 2), out platform))
- return false;
- if (platform == "AnyCPU")
- platform = string.Empty;
- return true;
- }
- return false;
- }
-
- bool ExtractConfigName (string name, out string config)
- {
- config = name.Trim (' ');
- if (config.Length <= 2)
- return false;
- if (config [0] != '\'' || config [config.Length - 1] != '\'')
- return false;
- config = config.Substring (1, config.Length - 2);
- return config.IndexOf ('\'') == -1;
- }
-
- string BuildConfigCondition (string config, string platform)
- {
- if (platform.Length == 0)
- platform = "AnyCPU";
- return " '$(Configuration)|$(Platform)' == '" + config + "|" + platform + "' ";
- }
-
- bool IsMergeToProjectProperty (ItemProperty prop)
- {
- foreach (object at in prop.CustomAttributes) {
- if (at is MergeToProjectAttribute)
- return true;
- }
- return false;
- }
-
- string GetXmlString (DataNode node)
- {
- if (node is DataValue)
- return ((DataValue)node).Value;
- else {
- StringWriter sw = new StringWriter ();
- XmlTextWriter xw = new XmlTextWriter (sw);
- XmlConfigurationWriter.DefaultWriter.Write (xw, node);
- return sw.ToString ();
- }
- }
-
- DataNode GetDataNode (ItemProperty prop, string xmlString)
- {
- if (prop.DataType.IsSimpleType)
- return new DataValue (prop.Name, xmlString);
- else {
- StringReader sr = new StringReader (xmlString);
- return XmlConfigurationReader.DefaultReader.Read (new XmlTextReader (sr));
- }
- }
-
- internal virtual MSBuildSerializer CreateSerializer ()
- {
- return new MSBuildSerializer (EntityItem.FileName);
- }
-
- static readonly MSBuildElementOrder globalConfigOrder = new MSBuildElementOrder (
- "Configuration","Platform","ProductVersion","SchemaVersion","ProjectGuid", "OutputType",
- "AppDesignerFolder","RootNamespace","AssemblyName","StartupObject"
- );
- static readonly MSBuildElementOrder configOrder = new MSBuildElementOrder (
- "DebugSymbols","DebugType","Optimize","OutputPath","DefineConstants","ErrorReport","WarningLevel",
- "TreatWarningsAsErrors","DocumentationFile"
- );
-
- // Those are properties which are dynamically set by this file format
-
- internal static readonly ItemMember[] ExtendedMSBuildProperties = new ItemMember [] {
- new ItemMember (typeof(SolutionEntityItem), "ProductVersion"),
- new ItemMember (typeof(SolutionEntityItem), "SchemaVersion"),
- new ItemMember (typeof(SolutionEntityItem), "ProjectGuid"),
- new ItemMember (typeof(DotNetProjectConfiguration), "ErrorReport"),
- new ItemMember (typeof(DotNetProjectConfiguration), "TargetFrameworkVersion", new object[] { new MergeToProjectAttribute () }),
- new ItemMember (typeof(ProjectReference), "RequiredTargetFramework"),
- new ItemMember (typeof(Project), "InternalTargetFrameworkVersion", true),
- };
-
- // Items generated by VS but which MD is not using and should be ignored
-
- internal static readonly IList<string> UnsupportedItems = new string[] {
- "BootstrapperFile", "AppDesigner", "WebReferences", "WebReferenceUrl", "Service",
- "ProjectReference", "Reference", // Reference elements are included here because they are special-cased for DotNetProject, and they are unsupported in other types of projects
- "InternalsVisibleTo",
- "InternalsVisibleToTest"
- };
- }
-
- class MSBuildSerializer: DataSerializer
- {
- public DataItem InternalItemProperties = new DataItem ();
- public DataItem ExternalItemProperties = new DataItem ();
-
- public MSBuildSerializer (string baseFile): base (MSBuildProjectService.DataContext)
- {
- // Use windows separators
- SerializationContext.BaseFile = baseFile;
- SerializationContext.DirectorySeparatorChar = '\\';
- }
-
- internal protected override bool CanHandleProperty (ItemProperty prop, SerializationContext serCtx, object instance)
- {
- if (instance is Project) {
- if (prop.Name == "Contents")
- return false;
- }
- if (instance is DotNetProject) {
- if (prop.Name == "References" || prop.Name == "LanguageParameters")
- return false;
- }
- if (instance is SolutionEntityItem) {
- if (prop.IsExtendedProperty (typeof(SolutionEntityItem)))
- return true;
- return prop.Name != "name" && prop.Name != "Configurations";
- }
- if (instance is SolutionFolder) {
- if (prop.Name == "Files")
- return false;
- }
- if (instance is ProjectFile)
- return prop.IsExtendedProperty (typeof(ProjectFile));
- if (instance is ProjectReference)
- return prop.IsExtendedProperty (typeof(ProjectReference)) || prop.Name == "Package" || prop.Name == "Aliases";
- if (instance is DotNetProjectConfiguration)
- if (prop.Name == "CodeGeneration")
- return false;
- if (instance is ItemConfiguration)
- if (prop.Name == "name")
- return false;
- return true;
- }
-
- internal protected override DataNode OnSerializeProperty (ItemProperty prop, SerializationContext serCtx, object instance, object value)
- {
- DataNode data = base.OnSerializeProperty (prop, serCtx, instance, value);
- if (instance is SolutionEntityItem && data != null) {
- if (prop.IsExternal)
- ExternalItemProperties.ItemData.Add (data);
- else
- InternalItemProperties.ItemData.Add (data);
- }
- return data;
- }
- }
-
- class UnknownSolutionItemTypeException : InvalidOperationException
- {
- public UnknownSolutionItemTypeException ()
- : base ("Unknown solution item type")
- {
- }
-
- public UnknownSolutionItemTypeException (string name)
- : base ("Unknown solution item type: " + name)
- {
- this.TypeName = name;
- }
-
- public string TypeName { get; private set; }
- }
-
- class MSBuildElementOrder: Dictionary<string, int>
- {
- public MSBuildElementOrder (params string[] elements)
- {
- for (int n=0; n<elements.Length; n++)
- this [elements [n]] = n;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectService.cs
deleted file mode 100644
index c8efc96d0c..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectService.cs
+++ /dev/null
@@ -1,821 +0,0 @@
-// MSBuildProjectService.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.Linq;
-using System.Diagnostics;
-using System.Collections.Generic;
-using System.IO;
-using System.Globalization;
-using System.Runtime.Serialization.Formatters.Binary;
-using Mono.Addins;
-using MonoDevelop.Core.ProgressMonitoring;
-using MonoDevelop.Projects;
-using MonoDevelop.Projects.Extensions;
-using MonoDevelop.Core.Serialization;
-using MonoDevelop.Core;
-using MonoDevelop.Core.Assemblies;
-using Cecil = Mono.Cecil;
-using System.Threading;
-
-namespace MonoDevelop.Projects.Formats.MSBuild
-{
- public static class MSBuildProjectService
- {
- const string ItemTypesExtensionPath = "/MonoDevelop/ProjectModel/MSBuildItemTypes";
- public const string GenericItemGuid = "{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}";
- public const string FolderTypeGuid = "{2150E333-8FDC-42A3-9474-1A3956D46DE8}";
-
- //NOTE: default toolsversion should match the default format.
- // remember to update the builder process' app.config too
- public const string DefaultFormat = "MSBuild12";
-
- static DataContext dataContext;
-
- static IMSBuildGlobalPropertyProvider[] globalPropertyProviders;
- static Dictionary<string,RemoteBuildEngine> builders = new Dictionary<string, RemoteBuildEngine> ();
- static GenericItemTypeNode genericItemTypeNode = new GenericItemTypeNode ();
-
- internal static bool ShutDown { get; private set; }
-
- public static DataContext DataContext {
- get {
- if (dataContext == null) {
- dataContext = new MSBuildDataContext ();
- Services.ProjectService.InitializeDataContext (dataContext);
- foreach (ItemMember prop in MSBuildProjectHandler.ExtendedMSBuildProperties) {
- ItemProperty iprop = new ItemProperty (prop.Name, prop.Type);
- iprop.IsExternal = prop.IsExternal;
- if (prop.CustomAttributes != null)
- iprop.CustomAttributes = prop.CustomAttributes;
- dataContext.RegisterProperty (prop.DeclaringType, iprop);
- }
- }
- return dataContext;
- }
- }
-
- static MSBuildProjectService ()
- {
- Services.ProjectService.DataContextChanged += delegate {
- dataContext = null;
- };
-
- PropertyService.PropertyChanged += HandlePropertyChanged;
- DefaultMSBuildVerbosity = PropertyService.Get ("MonoDevelop.Ide.MSBuildVerbosity", MSBuildVerbosity.Normal);
-
- Runtime.ShuttingDown += (sender, e) => ShutDown = true;
-
- const string gppPath = "/MonoDevelop/ProjectModel/MSBuildGlobalPropertyProviders";
- globalPropertyProviders = AddinManager.GetExtensionObjects<IMSBuildGlobalPropertyProvider> (gppPath);
- foreach (var gpp in globalPropertyProviders) {
- gpp.GlobalPropertiesChanged += HandleGlobalPropertyProviderChanged;
- }
- }
-
- static void HandleGlobalPropertyProviderChanged (object sender, EventArgs e)
- {
- lock (builders) {
- var gpp = (IMSBuildGlobalPropertyProvider) sender;
- foreach (var builder in builders.Values)
- builder.SetGlobalProperties (gpp.GetGlobalProperties ());
- }
- }
-
- static void HandlePropertyChanged (object sender, PropertyChangedEventArgs e)
- {
- if (e.Key == "MonoDevelop.Ide.MSBuildVerbosity") {
- DefaultMSBuildVerbosity = (MSBuildVerbosity) e.NewValue;
- }
- }
-
- internal static MSBuildVerbosity DefaultMSBuildVerbosity { get; private set; }
-
- public static SolutionEntityItem LoadItem (IProgressMonitor monitor, string fileName, MSBuildFileFormat expectedFormat, string typeGuid, string itemGuid)
- {
- foreach (ItemTypeNode node in GetItemTypeNodes ()) {
- if (node.CanHandleFile (fileName, typeGuid))
- return node.LoadSolutionItem (monitor, fileName, expectedFormat, itemGuid);
- }
-
- if (string.IsNullOrEmpty (typeGuid) && IsProjectSubtypeFile (fileName)) {
- typeGuid = LoadProjectTypeGuids (fileName);
- foreach (ItemTypeNode node in GetItemTypeNodes ()) {
- if (node.CanHandleFile (fileName, typeGuid))
- return node.LoadSolutionItem (monitor, fileName, expectedFormat, itemGuid);
- }
- }
-
- // If it is a known unsupported project, load it as UnknownProject
- var projectInfo = MSBuildProjectService.GetUnknownProjectTypeInfo (typeGuid != null ? new [] { typeGuid } : new string[0], fileName);
- if (projectInfo != null && projectInfo.LoadFiles) {
- if (typeGuid == null)
- typeGuid = projectInfo.Guid;
- var h = new MSBuildProjectHandler (typeGuid, "", itemGuid);
- h.SetUnsupportedType (projectInfo);
- return h.Load (monitor, fileName, expectedFormat, "", null);
- }
-
- return null;
- }
-
- internal static IResourceHandler GetResourceHandlerForItem (DotNetProject project)
- {
- foreach (ItemTypeNode node in GetItemTypeNodes ()) {
- DotNetProjectNode pNode = node as DotNetProjectNode;
- if (pNode != null && pNode.CanHandleItem (project))
- return pNode.GetResourceHandler ();
- }
- return new MSBuildResourceHandler ();
- }
-
- internal static MSBuildHandler GetItemHandler (SolutionEntityItem item)
- {
- MSBuildHandler handler = item.ItemHandler as MSBuildHandler;
- if (handler != null)
- return handler;
- else
- throw new InvalidOperationException ("Not an MSBuild project");
- }
-
- internal static void SetId (SolutionItem item, string id)
- {
- MSBuildHandler handler = item.ItemHandler as MSBuildHandler;
- if (handler != null)
- handler.ItemId = id;
- else
- throw new InvalidOperationException ("Not an MSBuild project");
- }
-
- internal static void InitializeItemHandler (SolutionItem item)
- {
- SolutionEntityItem eitem = item as SolutionEntityItem;
- if (eitem != null) {
- foreach (ItemTypeNode node in GetItemTypeNodes ()) {
- if (node.CanHandleItem (eitem)) {
- node.InitializeHandler (eitem);
- foreach (DotNetProjectSubtypeNode snode in GetItemSubtypeNodes ()) {
- if (snode.CanHandleItem (eitem))
- snode.InitializeHandler (eitem);
- }
- return;
- }
- }
- }
- else if (item is SolutionFolder) {
- MSBuildHandler h = new MSBuildHandler (FolderTypeGuid, null);
- h.Item = item;
- item.SetItemHandler (h);
- }
- }
-
- public static bool SupportsProjectType (string projectFile)
- {
- if (!string.IsNullOrWhiteSpace (projectFile)) {
- // If we have a project file, try to load it.
- try {
- using (var monitor = new ConsoleProgressMonitor ()) {
- return MSBuildProjectService.LoadItem (monitor, projectFile, null, null, null) != null;
- }
- } catch {
- return false;
- }
- }
-
- return false;
- }
-
- public static void CheckHandlerUsesMSBuildEngine (SolutionItem item, out bool useByDefault, out bool require)
- {
- var handler = item.ItemHandler as MSBuildProjectHandler;
- if (handler == null) {
- useByDefault = require = false;
- return;
- }
- useByDefault = handler.UseMSBuildEngineByDefault;
- require = handler.RequireMSBuildEngine;
- }
-
- internal static DotNetProjectSubtypeNode GetDotNetProjectSubtype (string typeGuids)
- {
- if (!string.IsNullOrEmpty (typeGuids))
- return GetDotNetProjectSubtype (typeGuids.Split (';').Select (t => t.Trim ()));
- else
- return null;
- }
-
- internal static DotNetProjectSubtypeNode GetDotNetProjectSubtype (IEnumerable<string> typeGuids)
- {
- Type ptype = null;
- DotNetProjectSubtypeNode foundNode = null;
- foreach (string guid in typeGuids) {
- foreach (DotNetProjectSubtypeNode st in GetItemSubtypeNodes ()) {
- if (st.SupportsType (guid)) {
- if (ptype == null || ptype.IsAssignableFrom (st.Type)) {
- ptype = st.Type;
- foundNode = st;
- }
- }
- }
- }
- return foundNode;
- }
-
- static IEnumerable<ItemTypeNode> GetItemTypeNodes ()
- {
- foreach (ExtensionNode node in AddinManager.GetExtensionNodes (ItemTypesExtensionPath)) {
- if (node is ItemTypeNode)
- yield return (ItemTypeNode) node;
- }
- yield return genericItemTypeNode;
- }
-
- internal static IEnumerable<DotNetProjectSubtypeNode> GetItemSubtypeNodes ()
- {
- foreach (ExtensionNode node in AddinManager.GetExtensionNodes (ItemTypesExtensionPath)) {
- if (node is DotNetProjectSubtypeNode)
- yield return (DotNetProjectSubtypeNode) node;
- }
- }
-
- internal static bool CanReadFile (FilePath file)
- {
- foreach (ItemTypeNode node in GetItemTypeNodes ()) {
- if (node.CanHandleFile (file, null)) {
- return true;
- }
- }
- if (IsProjectSubtypeFile (file)) {
- string typeGuids = LoadProjectTypeGuids (file);
- foreach (ItemTypeNode node in GetItemTypeNodes ()) {
- if (node.CanHandleFile (file, typeGuids)) {
- return true;
- }
- }
- }
- return GetUnknownProjectTypeInfo (new string[0], file) != null;
- }
-
- internal static string GetExtensionForItem (SolutionEntityItem item)
- {
- foreach (DotNetProjectSubtypeNode node in GetItemSubtypeNodes ()) {
- if (!string.IsNullOrEmpty (node.Extension) && node.CanHandleItem (item))
- return node.Extension;
- }
- foreach (ItemTypeNode node in GetItemTypeNodes ()) {
- if (node.CanHandleItem (item)) {
- return node.Extension;
- }
- }
- // The generic handler should always be found
- throw new InvalidOperationException ();
- }
-
- static bool IsProjectSubtypeFile (FilePath file)
- {
- foreach (DotNetProjectSubtypeNode node in GetItemSubtypeNodes ()) {
- if (!string.IsNullOrEmpty (node.Extension) && node.CanHandleFile (file, null))
- return true;
- }
- return false;
- }
-
- static char[] specialCharacters = new char [] {'%', '$', '@', '(', ')', '\'', ';', '?' };
-
- public static string EscapeString (string str)
- {
- int i = str.IndexOfAny (specialCharacters);
- while (i != -1) {
- str = str.Substring (0, i) + '%' + ((int) str [i]).ToString ("X") + str.Substring (i + 1);
- i = str.IndexOfAny (specialCharacters, i + 3);
- }
- return str;
- }
-
- public static string UnescapePath (string path)
- {
- if (string.IsNullOrEmpty (path))
- return path;
-
- if (!Platform.IsWindows)
- path = path.Replace ("\\", "/");
-
- return UnscapeString (path);
- }
-
- public static string UnscapeString (string str)
- {
- int i = str.IndexOf ('%');
- while (i != -1 && i < str.Length - 2) {
- int c;
- if (int.TryParse (str.Substring (i+1, 2), NumberStyles.HexNumber, null, out c))
- str = str.Substring (0, i) + (char) c + str.Substring (i + 3);
- i = str.IndexOf ('%', i + 1);
- }
- return str;
- }
-
- public static string ToMSBuildPath (string baseDirectory, string absPath)
- {
- if (baseDirectory != null) {
- absPath = FileService.NormalizeRelativePath (FileService.AbsoluteToRelativePath (baseDirectory, absPath));
- }
- return EscapeString (absPath).Replace ('/', '\\');
- }
-
- internal static string ToMSBuildPathRelative (string baseDirectory, string absPath)
- {
- FilePath file = ToMSBuildPath (baseDirectory, absPath);
- return file.ToRelative (baseDirectory);
- }
-
-
- internal static string FromMSBuildPathRelative (string basePath, string relPath)
- {
- FilePath file = FromMSBuildPath (basePath, relPath);
- return file.ToRelative (basePath);
- }
-
- public static string FromMSBuildPath (string basePath, string relPath)
- {
- string res;
- FromMSBuildPath (basePath, relPath, out res);
- return res;
- }
-
- internal static bool IsAbsoluteMSBuildPath (string path)
- {
- if (path.Length > 1 && char.IsLetter (path [0]) && path[1] == ':')
- return true;
- if (path.Length > 0 && path [0] == '\\')
- return true;
- return false;
- }
-
- internal static bool FromMSBuildPath (string basePath, string relPath, out string resultPath)
- {
- resultPath = relPath;
-
- if (string.IsNullOrEmpty (relPath))
- return false;
-
- string path = UnescapePath (relPath);
-
- if (char.IsLetter (path [0]) && path.Length > 1 && path[1] == ':') {
- if (Platform.IsWindows) {
- resultPath = path; // Return the escaped value
- return true;
- } else
- return false;
- }
-
- bool isRooted = Path.IsPathRooted (path);
-
- if (!isRooted && basePath != null) {
- path = Path.Combine (basePath, path);
- isRooted = Path.IsPathRooted (path);
- }
-
- // Return relative paths as-is, we can't do anything else with them
- if (!isRooted) {
- resultPath = FileService.NormalizeRelativePath (path);
- return true;
- }
-
- // If we're on Windows, don't need to fix file casing.
- if (Platform.IsWindows) {
- resultPath = FileService.GetFullPath (path);
- return true;
- }
-
- // If the path exists with the exact casing specified, then we're done
- if (System.IO.File.Exists (path) || System.IO.Directory.Exists (path)){
- resultPath = Path.GetFullPath (path);
- return true;
- }
-
- // Not on Windows, file doesn't exist. That could mean the project was brought from Windows
- // and the filename case in the project doesn't match the file on disk, because Windows is
- // case-insensitive. Since we have an absolute path, search the directory for the file with
- // the correct case.
- string[] names = path.Substring (1).Split ('/');
- string part = "/";
-
- for (int n=0; n<names.Length; n++) {
- string[] entries;
-
- if (names [n] == ".."){
- if (part == "/")
- return false; // Can go further back. It's not an existing file
- part = Path.GetFullPath (part + "/..");
- continue;
- }
-
- entries = Directory.GetFileSystemEntries (part);
-
- string fpath = null;
- foreach (string e in entries) {
- if (string.Compare (Path.GetFileName (e), names [n], StringComparison.OrdinalIgnoreCase) == 0) {
- fpath = e;
- break;
- }
- }
- if (fpath == null) {
- // Part of the path does not exist. Can't do any more checking.
- part = Path.GetFullPath (part);
- for (; n < names.Length; n++)
- part += "/" + names[n];
- resultPath = part;
- return true;
- }
-
- part = fpath;
- }
- resultPath = Path.GetFullPath (part);
- return true;
- }
-
- //Given a filename like foo.it.resx, splits it into - foo, it, resx
- //Returns true only if a valid culture is found
- //Note: hand-written as this can get called lotsa times
- public static bool TrySplitResourceName (string fname, out string only_filename, out string culture, out string extn)
- {
- only_filename = culture = extn = null;
-
- int last_dot = -1;
- int culture_dot = -1;
- int i = fname.Length - 1;
- while (i >= 0) {
- if (fname [i] == '.') {
- last_dot = i;
- break;
- }
- i --;
- }
- if (i < 0)
- return false;
-
- i--;
- while (i >= 0) {
- if (fname [i] == '.') {
- culture_dot = i;
- break;
- }
- i --;
- }
- if (culture_dot < 0)
- return false;
-
- culture = fname.Substring (culture_dot + 1, last_dot - culture_dot - 1);
- if (!CultureNamesTable.ContainsKey (culture))
- return false;
-
- only_filename = fname.Substring (0, culture_dot);
- extn = fname.Substring (last_dot + 1);
- return true;
- }
-
- static bool runLocal = false;
-
- internal static RemoteProjectBuilder GetProjectBuilder (TargetRuntime runtime, string minToolsVersion, string file, string solutionFile)
- {
- lock (builders) {
- //attempt to use 14.0 builder first if available
- string toolsVersion = "14.0";
- string binDir = runtime.GetMSBuildBinPath ("14.0");
- if (binDir == null) {
- toolsVersion = "12.0";
- binDir = runtime.GetMSBuildBinPath ("12.0");
- if (binDir == null) {
- //fall back to 4.0, we know it's always available
- toolsVersion = "4.0";
- }
- }
-
- //check the ToolsVersion we found can handle the project
- Version tv, mtv;
- if (Version.TryParse (toolsVersion, out tv) && Version.TryParse (minToolsVersion, out mtv) && tv < mtv) {
- string error = null;
- if (runtime is MsNetTargetRuntime && minToolsVersion == "12.0")
- error = "MSBuild 2013 is not installed. Please download and install it from " +
- "http://www.microsoft.com/en-us/download/details.aspx?id=40760";
- throw new InvalidOperationException (error ?? string.Format (
- "Runtime '{0}' does not have MSBuild '{1}' ToolsVersion installed",
- runtime.Id, toolsVersion)
- );
- }
-
- //one builder per solution
- string builderKey = runtime.Id + " # " + solutionFile;
- RemoteBuildEngine builder;
- if (builders.TryGetValue (builderKey, out builder)) {
- builder.ReferenceCount++;
- return new RemoteProjectBuilder (file, builder);
- }
-
- //always start the remote process explicitly, even if it's using the current runtime and fx
- //else it won't pick up the assembly redirects from the builder exe
- var exe = GetExeLocation (runtime, toolsVersion);
-
- MonoDevelop.Core.Execution.RemotingService.RegisterRemotingChannel ();
- var pinfo = new ProcessStartInfo (exe) {
- UseShellExecute = false,
- CreateNoWindow = true,
- RedirectStandardError = true,
- RedirectStandardInput = true,
- };
- runtime.GetToolsExecutionEnvironment ().MergeTo (pinfo);
-
- Process p = null;
-
- try {
- IBuildEngine engine;
- if (!runLocal) {
- p = runtime.ExecuteAssembly (pinfo);
-
- // The builder app will write the build engine reference
- // after reading the process id from the standard input
- ManualResetEvent ev = new ManualResetEvent (false);
- string responseKey = "[MonoDevelop]";
- string sref = null;
- p.ErrorDataReceived += (sender, e) => {
- if (e.Data == null)
- return;
-
- if (e.Data.StartsWith (responseKey, StringComparison.Ordinal)) {
- sref = e.Data.Substring (responseKey.Length);
- ev.Set ();
- } else
- Console.WriteLine (e.Data);
- };
- p.BeginErrorReadLine ();
- p.StandardInput.WriteLine (Process.GetCurrentProcess ().Id.ToString ());
- if (!ev.WaitOne (TimeSpan.FromSeconds (5)))
- throw new Exception ("MSBuild process could not be started");
-
- byte[] data = Convert.FromBase64String (sref);
- MemoryStream ms = new MemoryStream (data);
- BinaryFormatter bf = new BinaryFormatter ();
- engine = (IBuildEngine)bf.Deserialize (ms);
- } else {
- var asm = System.Reflection.Assembly.LoadFrom (exe);
- var t = asm.GetType ("MonoDevelop.Projects.Formats.MSBuild.BuildEngine");
- engine = (IBuildEngine)Activator.CreateInstance (t);
- }
- engine.SetCulture (GettextCatalog.UICulture);
- engine.SetGlobalProperties (GetCoreGlobalProperties (solutionFile));
- foreach (var gpp in globalPropertyProviders)
- engine.SetGlobalProperties (gpp.GetGlobalProperties ());
- builder = new RemoteBuildEngine (p, engine);
- } catch {
- if (p != null) {
- try {
- p.Kill ();
- } catch {
- }
- }
- throw;
- }
-
- builders [builderKey] = builder;
- builder.ReferenceCount = 1;
- builder.Disconnected += delegate {
- lock (builders)
- builders.Remove (builderKey);
- };
- return new RemoteProjectBuilder (file, builder);
- }
- }
-
- static IDictionary<string,string> GetCoreGlobalProperties (string slnFile)
- {
- var dictionary = new Dictionary<string,string> ();
-
- //this causes build targets to behave how they should inside an IDE, instead of in a command-line process
- dictionary.Add ("BuildingInsideVisualStudio", "true");
-
- //we don't have host compilers in MD, and this is set to true by some of the MS targets
- //which causes it to always run the CoreCompile task if BuildingInsideVisualStudio is also
- //true, because the VS in-process compiler would take care of the deps tracking
- dictionary.Add ("UseHostCompilerIfAvailable", "false" );
-
- if (string.IsNullOrEmpty (slnFile))
- return dictionary;
-
- dictionary.Add ("SolutionPath", Path.GetFullPath (slnFile));
- dictionary.Add ("SolutionName", Path.GetFileNameWithoutExtension (slnFile));
- dictionary.Add ("SolutionFilename", Path.GetFileName (slnFile));
- dictionary.Add ("SolutionDir", Path.GetDirectoryName (slnFile) + Path.DirectorySeparatorChar);
-
- return dictionary;;
- }
-
- static string GetExeLocation (TargetRuntime runtime, string toolsVersion)
- {
- FilePath sourceExe = typeof(MSBuildProjectService).Assembly.Location;
-
- if ((runtime is MsNetTargetRuntime) && int.Parse (toolsVersion.Split ('.')[0]) >= 4)
- toolsVersion = "dotnet." + toolsVersion;
-
- var exe = sourceExe.ParentDirectory.Combine ("MSBuild", toolsVersion, "MonoDevelop.Projects.Formats.MSBuild.exe");
- if (File.Exists (exe))
- return exe;
-
- throw new InvalidOperationException ("Unsupported MSBuild ToolsVersion '" + toolsVersion + "'");
- }
-
- internal static void ReleaseProjectBuilder (RemoteBuildEngine engine)
- {
- lock (builders) {
- if (--engine.ReferenceCount != 0)
- return;
- builders.Remove (builders.First (kvp => kvp.Value == engine).Key);
- }
- engine.Dispose ();
- }
-
- static Dictionary<string, string> cultureNamesTable;
- static Dictionary<string, string> CultureNamesTable {
- get {
- if (cultureNamesTable == null) {
- cultureNamesTable = new Dictionary<string, string> ();
- foreach (CultureInfo ci in CultureInfo.GetCultures (CultureTypes.AllCultures))
- cultureNamesTable [ci.Name] = ci.Name;
- }
-
- return cultureNamesTable;
- }
- }
-
- static string LoadProjectTypeGuids (string fileName)
- {
- MSBuildProject project = new MSBuildProject ();
- project.Load (fileName);
-
- MSBuildPropertySet globalGroup = project.GetGlobalPropertyGroup ();
- if (globalGroup == null)
- return null;
-
- return globalGroup.GetPropertyValue ("ProjectTypeGuids");
- }
-
- internal static UnknownProjectTypeNode GetUnknownProjectTypeInfo (string[] guids, string fileName = null)
- {
- var ext = fileName != null ? Path.GetExtension (fileName).TrimStart ('.') : null;
- var nodes = AddinManager.GetExtensionNodes<UnknownProjectTypeNode> ("/MonoDevelop/ProjectModel/UnknownMSBuildProjectTypes")
- .Where (p => guids.Any (p.MatchesGuid) || (ext != null && p.Extension == ext)).ToList ();
- return nodes.FirstOrDefault (n => !n.IsSolvable) ?? nodes.FirstOrDefault (n => n.IsSolvable);
- }
-
- public static MSBuildProjectHandler GetHandler (Project project)
- {
- return (MSBuildProjectHandler) project.GetItemHandler ();
- }
- }
-
- class MSBuildDataContext: DataContext
- {
- protected override DataType CreateConfigurationDataType (Type type)
- {
- if (type == typeof(bool))
- return new MSBuildBoolDataType ();
- else if (type == typeof(bool?))
- return new MSBuildNullableBoolDataType ();
- else
- return base.CreateConfigurationDataType (type);
- }
- }
-
- class MSBuildBoolDataType: PrimitiveDataType
- {
- public MSBuildBoolDataType (): base (typeof(bool))
- {
- }
-
- internal protected override DataNode OnSerialize (SerializationContext serCtx, object mapData, object value)
- {
- return new MSBuildBoolDataValue (Name, (bool) value);
- }
-
- internal protected override object OnDeserialize (SerializationContext serCtx, object mapData, DataNode data)
- {
- return String.Equals (((DataValue)data).Value, "true", StringComparison.OrdinalIgnoreCase);
- }
- }
-
- class MSBuildBoolDataValue : DataValue
- {
- public MSBuildBoolDataValue (string name, bool value)
- : base (name, value ? "True" : "False")
- {
- RawValue = value;
- }
-
- public bool RawValue { get; private set; }
- }
-
- class MSBuildNullableBoolDataType: PrimitiveDataType
- {
- public MSBuildNullableBoolDataType (): base (typeof(bool))
- {
- }
-
- internal protected override DataNode OnSerialize (SerializationContext serCtx, object mapData, object value)
- {
- return new MSBuildNullableBoolDataValue (Name, (bool?) value);
- }
-
- internal protected override object OnDeserialize (SerializationContext serCtx, object mapData, DataNode data)
- {
- var d = (DataValue)data;
- if (string.IsNullOrEmpty (d.Value))
- return (bool?) null;
- return (bool?) String.Equals (d.Value, "true", StringComparison.OrdinalIgnoreCase);
- }
- }
-
- class MSBuildNullableBoolDataValue : DataValue
- {
- public MSBuildNullableBoolDataValue (string name, bool? value)
- : base (name, value.HasValue? (value.Value? "True" : "False") : null)
- {
- RawValue = value;
- }
-
- public bool? RawValue { get; private set; }
- }
-
- public class MSBuildResourceHandler: IResourceHandler
- {
- public static MSBuildResourceHandler Instance = new MSBuildResourceHandler ();
-
- public virtual string GetDefaultResourceId (ProjectFile file)
- {
- string fname = file.ProjectVirtualPath;
- fname = FileService.NormalizeRelativePath (fname);
- fname = Path.Combine (Path.GetDirectoryName (fname).Replace (' ','_'), Path.GetFileName (fname));
-
- if (String.Compare (Path.GetExtension (fname), ".resx", true) == 0) {
- fname = Path.ChangeExtension (fname, ".resources");
- } else {
- string only_filename, culture, extn;
- if (MSBuildProjectService.TrySplitResourceName (fname, out only_filename, out culture, out extn)) {
- //remove the culture from fname
- //foo.it.bmp -> foo.bmp
- fname = only_filename + "." + extn;
- }
- }
-
- string rname = fname.Replace (Path.DirectorySeparatorChar, '.');
-
- DotNetProject dp = file.Project as DotNetProject;
-
- if (dp == null || String.IsNullOrEmpty (dp.DefaultNamespace))
- return rname;
- else
- return dp.DefaultNamespace + "." + rname;
- }
- }
-
- class GenericItemTypeNode: ItemTypeNode
- {
- public GenericItemTypeNode (): base (MSBuildProjectService.GenericItemGuid, "mdproj", null)
- {
- }
-
- public override bool CanHandleItem (SolutionEntityItem item)
- {
- return true;
- }
-
- public override SolutionEntityItem LoadSolutionItem (IProgressMonitor monitor, string fileName, MSBuildFileFormat expectedFormat, string itemGuid)
- {
- MSBuildProjectHandler handler = new MSBuildProjectHandler (Guid, Import, itemGuid);
- return handler.Load (monitor, fileName, expectedFormat, null, null);
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MergeToProjectAttribute.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MergeToProjectAttribute.cs
deleted file mode 100644
index a04b220e29..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MergeToProjectAttribute.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// MergeToProjectAttribute.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-
-namespace MonoDevelop.Projects.Formats.MSBuild
-{
- /// <summary>
- /// Specifies that a property of a project configuration has to be stored as a project property
- /// </summary>
- /// <remarks>
- /// When applied to a property of a project configuration, MD will check
- /// if the value of that property is the same for all configurations.
- /// If they are the same, the value will be stored in the main property
- /// group, instead of individually in each configuration.
- /// </remarks>
- public class MergeToProjectAttribute: Attribute
- {
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/RemoteProjectBuilder.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/RemoteProjectBuilder.cs
deleted file mode 100644
index 57f2e797e5..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/RemoteProjectBuilder.cs
+++ /dev/null
@@ -1,275 +0,0 @@
-//
-// RemoteProjectBuilder.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Diagnostics;
-using System.Globalization;
-using System.Collections.Generic;
-using System.Threading;
-using System.Threading.Tasks;
-using MonoDevelop.Core;
-using System.IO;
-using System.Linq;
-
-namespace MonoDevelop.Projects.Formats.MSBuild
-{
- class RemoteBuildEngine: IBuildEngine
- {
- IBuildEngine engine;
- Process proc;
- bool alive = true;
-
- public int ReferenceCount { get; set; }
- public DateTime ReleaseTime { get; set; }
-
- public RemoteBuildEngine (Process proc, IBuildEngine engine)
- {
- this.proc = proc;
- this.engine = engine;
- }
-
- public event EventHandler Disconnected;
-
- public IProjectBuilder LoadProject (string projectFile)
- {
- try {
- return engine.LoadProject (projectFile);
- } catch (Exception ex) {
- CheckDisconnected ();
- throw;
- }
- }
-
- public void UnloadProject (IProjectBuilder pb)
- {
- try {
- engine.UnloadProject (pb);
- } catch (Exception ex) {
- LoggingService.LogError ("Project unloading failed", ex);
- if (!CheckDisconnected ())
- throw;
- }
- }
-
- public void SetCulture (CultureInfo uiCulture)
- {
- try {
- engine.SetCulture (uiCulture);
- } catch (Exception ex) {
- CheckDisconnected ();
- throw;
- }
- }
-
- public void SetGlobalProperties (IDictionary<string, string> properties)
- {
- try {
- engine.SetGlobalProperties (properties);
- } catch (Exception ex) {
- CheckDisconnected ();
- throw;
- }
- }
-
- void IBuildEngine.Ping ()
- {
- engine.Ping ();
- }
-
- bool CheckAlive ()
- {
- if (!alive)
- return false;
- try {
- engine.Ping ();
- return true;
- } catch {
- alive = false;
- return false;
- }
- }
-
- internal bool CheckDisconnected ()
- {
- if (!CheckAlive ()) {
- if (Disconnected != null)
- Disconnected (this, EventArgs.Empty);
- return true;
- }
- return false;
- }
-
- public void Dispose ()
- {
- try {
- alive = false;
- if (proc != null) {
- try {
- proc.Kill ();
- } catch {
- }
- }
- else
- engine.Dispose ();
- } catch {
- // Ignore
- }
- }
- }
-
- public class RemoteProjectBuilder: IDisposable
- {
- RemoteBuildEngine engine;
- IProjectBuilder builder;
- Dictionary<string,string[]> referenceCache;
- string file;
-
- internal RemoteProjectBuilder (string file, RemoteBuildEngine engine)
- {
- this.file = file;
- this.engine = engine;
- builder = engine.LoadProject (file);
- referenceCache = new Dictionary<string, string[]> ();
- }
-
- public event EventHandler Disconnected;
-
- void CheckDisconnected ()
- {
- if (engine != null && engine.CheckDisconnected ()) {
- if (Disconnected != null)
- Disconnected (this, EventArgs.Empty);
- }
- }
-
- public MSBuildResult Run (
- ProjectConfigurationInfo[] configurations,
- ILogWriter logWriter,
- MSBuildVerbosity verbosity,
- string[] runTargets,
- string[] evaluateItems,
- string[] evaluateProperties,
- Dictionary<string,string> globalProperties)
- {
- try {
- return builder.Run (configurations, logWriter, verbosity, runTargets, evaluateItems, evaluateProperties, globalProperties);
- } catch (Exception ex) {
- CheckDisconnected ();
- LoggingService.LogError ("RunTarget failed", ex);
- MSBuildTargetResult err = new MSBuildTargetResult (file, false, "", "", file, 1, 1, 1, 1, "Unknown MSBuild failure. Please try building the project again", "");
- MSBuildResult res = new MSBuildResult (new [] { err });
- return res;
- }
- }
-
- public string[] ResolveAssemblyReferences (ProjectConfigurationInfo[] configurations)
- {
- string[] refs = null;
- var id = configurations [0].Configuration + "|" + configurations [0].Platform;
-
- lock (referenceCache) {
- if (!referenceCache.TryGetValue (id, out refs)) {
- MSBuildResult result;
- try {
- result = builder.Run (
- configurations, null, MSBuildVerbosity.Normal,
- new[] { "ResolveAssemblyReferences" }, new [] { "ReferencePath" }, null, null
- );
- } catch (Exception ex) {
- CheckDisconnected ();
- LoggingService.LogError ("ResolveAssemblyReferences failed", ex);
- return new string[0];
- }
-
- List<MSBuildEvaluatedItem> items;
- if (result.Items.TryGetValue ("ReferencePath", out items) && items != null) {
- refs = items.Select (i => i.ItemSpec).ToArray ();
- } else
- refs = new string[0];
-
- referenceCache [id] = refs;
- }
- }
- return refs;
- }
-
- public string[] GetSupportedTargets (ProjectConfigurationInfo[] configurations)
- {
- try {
- return builder.GetSupportedTargets (configurations);
- } catch (Exception ex) {
- CheckDisconnected ();
- LoggingService.LogError ("GetSupportedTargets failed", ex);
- return new string[0];
- }
- }
-
- public void Refresh ()
- {
- lock (referenceCache)
- referenceCache.Clear ();
- try {
- builder.Refresh ();
- } catch (Exception ex) {
- LoggingService.LogError ("MSBuild refresh failed", ex);
- CheckDisconnected ();
- }
- }
-
- public void RefreshWithContent (string projectContent)
- {
- lock (referenceCache)
- referenceCache.Clear ();
- try {
- builder.RefreshWithContent (projectContent);
- } catch (Exception ex) {
- LoggingService.LogError ("MSBuild refresh failed", ex);
- CheckDisconnected ();
- }
- }
-
- public void Dispose ()
- {
- if (!MSBuildProjectService.ShutDown && engine != null) {
- try {
- if (builder != null)
- engine.UnloadProject (builder);
- MSBuildProjectService.ReleaseProjectBuilder (engine);
- } catch {
- // Ignore
- }
- GC.SuppressFinalize (this);
- engine = null;
- builder = null;
- }
- }
-
- ~RemoteProjectBuilder ()
- {
- Dispose ();
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/SlnData.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/SlnData.cs
deleted file mode 100644
index 9f602a5dff..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/SlnData.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-//
-// SlnData.cs
-//
-// Author:
-// Ankit Jain <jankit@novell.com>
-//
-// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using MonoDevelop.Projects;
-
-using System;
-using System.Collections.Generic;
-
-namespace MonoDevelop.Projects.Formats.MSBuild
-{
- class SlnData
- {
- string headerComment = "# MonoDevelop";
- Dictionary<SolutionConfiguration, string> configStrings;
- List<string> globalExtra; // unused GlobalSections
- Dictionary<string, List<string>> sectionExtras;
- string[] extra; //used by solution folders..
- List<string> unknownProjects;
- Dictionary<string, SolutionEntityItem> projectsByGuidTable;
-
- public void UpdateVersion (MSBuildFileFormat format)
- {
- VersionString = format.SlnVersion;
- headerComment = "# " + format.ProductDescription;
- }
-
- // Eg. "# Visual C# Express 2008"
- public string HeaderComment {
- get { return headerComment; }
- set { headerComment = value; }
- }
-
- // Eg. 9.00 or 10.00
- public string VersionString { get; set; }
-
- public Version VisualStudioVersion { get; set; }
-
- public Version MinimumVisualStudioVersion { get; set; }
-
- public Dictionary<SolutionConfiguration, string> ConfigStrings {
- get {
- if (configStrings == null)
- configStrings = new Dictionary<SolutionConfiguration, string> ();
- return configStrings;
- }
- }
-
- public List<string> GlobalExtra {
- get { return globalExtra; }
- set { globalExtra = value; }
- }
-
- public string[] Extra {
- get { return extra; }
- set { extra = value; }
- }
-
- public List<string> UnknownProjects {
- get {
- if (unknownProjects == null)
- unknownProjects = new List<string> ();
- return unknownProjects;
- }
- }
-
- //Extra lines per section which need to be preserved
- //eg. lines in ProjectConfigurationPlatforms for projects
- //that we couldn't load
- public Dictionary<string, List<string>> SectionExtras {
- get {
- if (sectionExtras == null)
- sectionExtras = new Dictionary<string, List<string>> ();
- return sectionExtras;
- }
- }
-
- public Dictionary<string, SolutionEntityItem> ItemsByGuid {
- get {
- if (projectsByGuidTable == null)
- projectsByGuidTable = new Dictionary<string, SolutionEntityItem> ();
- return projectsByGuidTable;
- }
- }
-
- }
-
- class ItemSlnData
- {
- List<string> configLines;
-
- public List<string> ConfigLines {
- get {
- if (configLines == null)
- configLines = new List<string> ();
- return configLines;
- }
- }
-
- public static ItemSlnData ForItem (SolutionItem item)
- {
- ItemSlnData data = (ItemSlnData) item.ExtendedProperties [typeof(ItemSlnData)];
- if (data == null) {
- data = new ItemSlnData ();
- item.ExtendedProperties [typeof(ItemSlnData)] = data;
- }
- return data;
- }
-
- public static void TransferData (SolutionItem source, SolutionItem target)
- {
- ItemSlnData data = (ItemSlnData) source.ExtendedProperties [typeof(ItemSlnData)];
- if (data != null)
- target.ExtendedProperties [typeof(ItemSlnData)] = data;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/SlnFileFormat.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/SlnFileFormat.cs
deleted file mode 100644
index 0ebb7f4c4a..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/SlnFileFormat.cs
+++ /dev/null
@@ -1,1338 +0,0 @@
-//
-// SlnFileFormat.cs
-//
-// Author:
-// Ankit Jain <jankit@novell.com>
-//
-// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.Specialized;
-using System.Globalization;
-using System.IO;
-using System.Text;
-using System.Text.RegularExpressions;
-
-using MonoDevelop.Projects;
-using MonoDevelop.Core.Serialization;
-using MonoDevelop.Projects.Extensions;
-using MonoDevelop.Core;
-using System.Reflection;
-using System.Linq;
-
-namespace MonoDevelop.Projects.Formats.MSBuild
-{
- public class SlnFileFormat
- {
- public string GetValidFormatName (object obj, string fileName, MSBuildFileFormat format)
- {
- return Path.ChangeExtension (fileName, ".sln");
- }
-
- public bool CanReadFile (string file, MSBuildFileFormat format)
- {
- if (String.Compare (Path.GetExtension (file), ".sln", StringComparison.OrdinalIgnoreCase) == 0) {
- string tmp;
- string version = GetSlnFileVersion (file, out tmp);
- return format.SupportsSlnVersion (version);
- }
- return false;
- }
-
- public bool CanWriteFile (object obj, MSBuildFileFormat format)
- {
- return obj is Solution;
- }
-
- public List<string> GetItemFiles (object obj)
- {
- return null;
- }
-
- public void WriteFile (string file, object obj, MSBuildFileFormat format, bool saveProjects, IProgressMonitor monitor)
- {
- Solution sol = (Solution) obj;
-
- string tmpfilename = String.Empty;
- try {
- monitor.BeginTask (GettextCatalog.GetString ("Saving solution: {0}", file), 1);
- try {
- if (File.Exists (file))
- tmpfilename = Path.GetDirectoryName (file) + Path.DirectorySeparatorChar + ".#" + Path.GetFileName (file);
- } catch (IOException) {
- }
-
- string baseDir = Path.GetDirectoryName (file);
- if (tmpfilename == String.Empty) {
- WriteFileInternal (file, sol, baseDir, format, saveProjects, monitor);
- } else {
- WriteFileInternal (tmpfilename, sol, baseDir, format, saveProjects, monitor);
- FileService.SystemRename (tmpfilename, file);
- }
- } catch (Exception ex) {
- monitor.ReportError (GettextCatalog.GetString ("Could not save solution: {0}", file), ex);
- LoggingService.LogError (GettextCatalog.GetString ("Could not save solution: {0}", file), ex);
-
- if (!String.IsNullOrEmpty (tmpfilename) && File.Exists (tmpfilename))
- File.Delete (tmpfilename);
- throw;
- } finally {
- monitor.EndTask ();
- }
- }
-
- void WriteFileInternal (string file, Solution solution, string baseDir, MSBuildFileFormat format, bool saveProjects, IProgressMonitor monitor)
- {
- SolutionFolder c = solution.RootFolder;
-
- using (StreamWriter sw = new StreamWriter (file, false, Encoding.UTF8)) {
- sw.NewLine = "\r\n";
-
- SlnData slnData = GetSlnData (c);
- if (slnData == null) {
- // If a non-msbuild project is being converted by just
- // changing the fileformat, then create the SlnData for it
- slnData = new SlnData ();
- c.ExtendedProperties [typeof (SlnFileFormat)] = slnData;
- }
-
- slnData.UpdateVersion (format);
-
- sw.WriteLine ();
-
- //Write Header
- sw.WriteLine ("Microsoft Visual Studio Solution File, Format Version " + slnData.VersionString);
- sw.WriteLine (slnData.HeaderComment);
- if (slnData.VisualStudioVersion != null)
- sw.WriteLine ("VisualStudioVersion = {0}", slnData.VisualStudioVersion);
- if (slnData.MinimumVisualStudioVersion != null)
- sw.WriteLine ("MinimumVisualStudioVersion = {0}", slnData.MinimumVisualStudioVersion);
-
- //Write the projects
- monitor.BeginTask (GettextCatalog.GetString ("Saving projects"), 1);
- WriteProjects (c, baseDir, sw, saveProjects, monitor);
- monitor.EndTask ();
-
- //Write the lines for unknownProjects
- foreach (string l in slnData.UnknownProjects)
- sw.WriteLine (l);
-
- //Write the Globals
- sw.WriteLine ("Global");
-
- //Write SolutionConfigurationPlatforms
- //FIXME: SolutionConfigurations?
- sw.WriteLine ("\tGlobalSection(SolutionConfigurationPlatforms) = preSolution");
-
- foreach (SolutionConfiguration config in solution.Configurations)
- sw.WriteLine ("\t\t{0} = {0}", ToSlnConfigurationId (config));
-
- sw.WriteLine ("\tEndGlobalSection");
-
- //Write ProjectConfigurationPlatforms
- sw.WriteLine ("\tGlobalSection(ProjectConfigurationPlatforms) = postSolution");
-
- List<string> list = new List<string> ();
- WriteProjectConfigurations (solution, list);
-
- list.Sort (StringComparer.Create (CultureInfo.InvariantCulture, true));
- foreach (string s in list)
- sw.WriteLine (s);
-
- //Write lines for projects we couldn't load
- if (slnData.SectionExtras.ContainsKey ("ProjectConfigurationPlatforms")) {
- foreach (string s in slnData.SectionExtras ["ProjectConfigurationPlatforms"])
- sw.WriteLine ("\t\t{0}", s);
- }
-
- sw.WriteLine ("\tEndGlobalSection");
-
- //Write Nested Projects
- ICollection<SolutionFolder> folders = solution.RootFolder.GetAllItems<SolutionFolder> ();
- if (folders.Count > 1) {
- // If folders ==1, that's the root folder
- sw.WriteLine ("\tGlobalSection(NestedProjects) = preSolution");
- foreach (SolutionFolder folder in folders) {
- if (folder.IsRoot)
- continue;
- WriteNestedProjects (folder, solution.RootFolder, sw);
- }
- sw.WriteLine ("\tEndGlobalSection");
- }
-
- //Write custom properties
- MSBuildSerializer ser = new MSBuildSerializer (solution.FileName);
- DataItem data = (DataItem) ser.Serialize (solution, typeof(Solution));
- if (data.HasItemData) {
- sw.WriteLine ("\tGlobalSection(MonoDevelopProperties) = preSolution");
- WriteDataItem (sw, data);
- sw.WriteLine ("\tEndGlobalSection");
- }
-
- // Write custom properties for configurations
- foreach (SolutionConfiguration conf in solution.Configurations) {
- data = (DataItem) ser.Serialize (conf);
- if (data.HasItemData) {
- sw.WriteLine ("\tGlobalSection(MonoDevelopProperties." + conf.Id + ") = preSolution");
- WriteDataItem (sw, data);
- sw.WriteLine ("\tEndGlobalSection");
- }
- }
-
- //Write 'others'
- if (slnData.GlobalExtra != null) {
- foreach (string s in slnData.GlobalExtra)
- sw.WriteLine (s);
- }
-
- sw.WriteLine ("EndGlobal");
- }
- }
-
- void WriteProjects (SolutionFolder folder, string baseDirectory, StreamWriter writer, bool saveProjects, IProgressMonitor monitor)
- {
- monitor.BeginStepTask (GettextCatalog.GetString ("Saving projects"), folder.Items.Count, 1);
- foreach (SolutionItem ce in folder.Items.ToArray ())
- {
- string[] l = null;
- if (ce is SolutionEntityItem) {
-
- SolutionEntityItem item = (SolutionEntityItem) ce;
- MSBuildHandler handler = MSBuildProjectService.GetItemHandler (item);
-
- if (saveProjects) {
- try {
- handler.SavingSolution = true;
- item.Save (monitor);
- } finally {
- handler.SavingSolution = false;
- }
- }
-
- l = handler.SlnProjectContent;
-
- writer.WriteLine (@"Project(""{0}"") = ""{1}"", ""{2}"", ""{3}""",
- handler.TypeGuid,
- item.Name,
- FileService.NormalizeRelativePath (FileService.AbsoluteToRelativePath (
- baseDirectory, item.FileName)).Replace ('/', '\\'),
- ce.ItemId);
- DataItem data = handler.WriteSlnData ();
- if (data != null && data.HasItemData) {
- writer.WriteLine ("\tProjectSection(MonoDevelopProperties) = preProject");
- WriteDataItem (writer, data);
- writer.WriteLine ("\tEndProjectSection");
- }
- if (item.ItemDependencies.Count > 0 || handler.UnresolvedProjectDependencies != null) {
- writer.WriteLine ("\tProjectSection(ProjectDependencies) = postProject");
- foreach (var dep in item.ItemDependencies)
- writer.WriteLine ("\t\t{0} = {0}", dep.ItemId);
- if (handler.UnresolvedProjectDependencies != null) {
- foreach (var dep in handler.UnresolvedProjectDependencies)
- writer.WriteLine ("\t\t{0} = {0}", dep);
- }
- writer.WriteLine ("\tEndProjectSection");
- }
- } else if (ce is SolutionFolder) {
- //Solution
- SlnData slnData = GetSlnData (ce);
- if (slnData == null) {
- // Solution folder
- slnData = new SlnData ();
- ce.ExtendedProperties [typeof (SlnFileFormat)] = slnData;
- }
-
- l = slnData.Extra;
-
- writer.WriteLine (@"Project(""{0}"") = ""{1}"", ""{2}"", ""{3}""",
- MSBuildProjectService.FolderTypeGuid,
- ce.Name,
- ce.Name,
- ce.ItemId);
-
- // Folder files
- WriteFolderFiles (writer, (SolutionFolder) ce);
-
- //Write custom properties
- MSBuildSerializer ser = new MSBuildSerializer (folder.ParentSolution.FileName);
- DataItem data = (DataItem) ser.Serialize (ce, typeof(SolutionFolder));
- if (data.HasItemData) {
- writer.WriteLine ("\tProjectSection(MonoDevelopProperties) = preProject");
- WriteDataItem (writer, data);
- writer.WriteLine ("\tEndProjectSection");
- }
- }
-
- if (l != null) {
- foreach (string s in l)
- writer.WriteLine (s);
- }
-
- writer.WriteLine ("EndProject");
- if (ce is SolutionFolder)
- WriteProjects (ce as SolutionFolder, baseDirectory, writer, saveProjects, monitor);
- monitor.Step (1);
- }
- monitor.EndTask ();
- }
-
- void WriteFolderFiles (StreamWriter writer, SolutionFolder folder)
- {
- if (folder.Files.Count > 0) {
- writer.WriteLine ("\tProjectSection(SolutionItems) = preProject");
- foreach (FilePath f in folder.Files) {
- string relFile = MSBuildProjectService.ToMSBuildPathRelative (folder.ParentSolution.ItemDirectory, f);
- writer.WriteLine ("\t\t" + relFile + " = " + relFile);
- }
- writer.WriteLine ("\tEndProjectSection");
- }
- }
-
- void WriteProjectConfigurations (Solution sol, List<string> list)
- {
- foreach (SolutionConfiguration cc in sol.Configurations) {
-
- foreach (SolutionConfigurationEntry cce in cc.Configurations) {
- SolutionEntityItem p = cce.Item;
-
- // Don't save configurations for shared projects
- if (!p.SupportsConfigurations ())
- continue;
-
- // <ProjectGuid>...</ProjectGuid> in some Visual Studio generated F# project files
- // are missing "{"..."}" in their guid. This is not generally a problem since it
- // is a valid GUID format. However the solution file format requires that these are present.
- string itemGuid = p.ItemId;
- if (!itemGuid.StartsWith("{") && !itemGuid.EndsWith("}"))
- itemGuid = "{" + itemGuid + "}";
-
- list.Add (String.Format (
- "\t\t{0}.{1}.ActiveCfg = {2}", itemGuid, ToSlnConfigurationId (cc), ToSlnConfigurationId (cce.ItemConfiguration)));
-
- if (cce.Build)
- list.Add (String.Format (
- "\t\t{0}.{1}.Build.0 = {2}", itemGuid, ToSlnConfigurationId (cc), ToSlnConfigurationId (cce.ItemConfiguration)));
-
- if (cce.Deploy)
- list.Add (String.Format (
- "\t\t{0}.{1}.Deploy.0 = {2}", itemGuid, ToSlnConfigurationId (cc), ToSlnConfigurationId (cce.ItemConfiguration)));
- }
- }
-
- }
-
- void WriteNestedProjects (SolutionFolder folder, SolutionFolder root, StreamWriter writer)
- {
- foreach (SolutionItem ce in folder.Items)
- writer.WriteLine (@"{0}{1} = {2}", "\t\t", ce.ItemId, folder.ItemId);
- }
-
- DataItem GetSolutionItemData (List<string> lines)
- {
- // Find a project section of type MonoDevelopProperties
- int start, end;
- if (!FindSection (lines, "MonoDevelopProperties", true, out start, out end))
- return null;
-
- // Deserialize the object
- DataItem it = ReadDataItem (start, end - start + 1, lines);
-
- // Remove the lines, since they have already been preocessed
- lines.RemoveRange (start, end - start + 1);
- return it;
- }
-
- List<string> ReadSolutionItemDependencies (List<string> lines)
- {
- // Find a project section of type MonoDevelopProperties
- int start, end;
- if (!FindSection (lines, "ProjectDependencies", false, out start, out end))
- return null;
-
- var ids = new List<string> ();
- for (int n=start + 1; n < end; n++) {
- string line = lines [n];
- int i = line.IndexOf ('=');
- if (i != -1)
- ids.Add (line.Substring (0, i).Trim ());
- }
-
- // Remove the lines, since they have already been preocessed
- lines.RemoveRange (start, end - start + 1);
- return ids;
- }
-
- List<string> ReadFolderFiles (List<string> lines)
- {
- // Find a solution item section of type SolutionItems
-
- List<string> list = new List<string> ();
- int start, end;
- if (!FindSection (lines, "SolutionItems", true, out start, out end))
- return list;
-
- for (int n=start + 1; n < end; n++) {
- string file = lines [n];
- int i = file.IndexOf ('=');
- if (i == -1)
- continue;
- file = file.Substring (0, i).Trim (' ','\t');
- if (file.Length > 0)
- list.Add (file);
- }
-
- // Remove the lines, since they have already been preocessed
- lines.RemoveRange (start, end - start + 1);
- return list;
- }
-
- bool FindSection (List<string> lines, string name, bool preProject, out int start, out int end)
- {
- start = -1;
- end = -1;
-
- string prePost = preProject ? "preProject" : "postProject";
- var sectionLine = "ProjectSection(" + name + ")=" + prePost;
-
- for (int n=0; n<lines.Count && start == -1; n++) {
- string line = lines [n].Replace ("\t","").Replace (" ", "");
- if (line == sectionLine)
- start = n;
- }
- if (start == -1)
- return false;
-
- for (int n=start+1; n<lines.Count && end == -1; n++) {
- string line = lines [n].Replace ("\t","").Replace (" ", "");
- if (line == "EndProjectSection")
- end = n;
- }
- return end != -1;
- }
-
- void DeserializeSolutionItem (Solution sln, SolutionItem item, List<string> lines)
- {
- // Deserialize the object
- DataItem it = GetSolutionItemData (lines);
- if (it == null)
- return;
-
- MSBuildSerializer ser = new MSBuildSerializer (sln.FileName);
- ser.SerializationContext.BaseFile = sln.FileName;
- ser.Deserialize (item, it);
- }
-
- void WriteDataItem (StreamWriter sw, DataItem item)
- {
- int id = 0;
- foreach (DataNode val in item.ItemData)
- WriteDataNode (sw, "", val, ref id);
- }
-
- void WriteDataNode (StreamWriter sw, string prefix, DataNode node, ref int id)
- {
- string name = node.Name;
- string newPrefix = prefix.Length > 0 ? prefix + "." + name: name;
-
- if (node is DataValue) {
- DataValue val = (DataValue) node;
- string value = EncodeString (val.Value);
- sw.WriteLine ("\t\t" + newPrefix + " = " + value);
- }
- else {
- DataItem it = (DataItem) node;
- sw.WriteLine ("\t\t" + newPrefix + " = $" + id);
- newPrefix = "$" + id;
- id ++;
- foreach (DataNode cn in it.ItemData)
- WriteDataNode (sw, newPrefix, cn, ref id);
- }
- }
-
- string EncodeString (string val)
- {
- if (val.Length == 0)
- return val;
-
- int i = val.IndexOfAny (new char[] {'\n','\r','\t'});
- if (i != -1 || val [0] == '@') {
- StringBuilder sb = new StringBuilder ();
- if (i != -1) {
- int fi = val.IndexOf ('\\');
- if (fi != -1 && fi < i) i = fi;
- sb.Append (val.Substring (0,i));
- } else
- i = 0;
- for (int n = i; n < val.Length; n++) {
- char c = val [n];
- if (c == '\r')
- sb.Append (@"\r");
- else if (c == '\n')
- sb.Append (@"\n");
- else if (c == '\t')
- sb.Append (@"\t");
- else if (c == '\\')
- sb.Append (@"\\");
- else
- sb.Append (c);
- }
- val = "@" + sb.ToString ();
- }
- char fc = val [0];
- char lc = val [val.Length - 1];
- if (fc == ' ' || fc == '"' || fc == '$' || lc == ' ')
- val = "\"" + val + "\"";
- return val;
- }
-
- string DecodeString (string val)
- {
- val = val.Trim (' ', '\t');
- if (val.Length == 0)
- return val;
- if (val [0] == '\"')
- val = val.Substring (1, val.Length - 2);
- if (val [0] == '@') {
- StringBuilder sb = new StringBuilder (val.Length);
- for (int n = 1; n < val.Length; n++) {
- char c = val [n];
- if (c == '\\') {
- c = val [++n];
- if (c == 'r') c = '\r';
- else if (c == 'n') c = '\n';
- else if (c == 't') c = '\t';
- }
- sb.Append (c);
- }
- return sb.ToString ();
- }
- else
- return val;
- }
-
- DataItem ReadDataItem (Section sec, List<string> lines)
- {
- return ReadDataItem (sec.Start, sec.Count, lines);
- }
-
- DataItem ReadDataItem (int start, int count, List<string> lines)
- {
- DataItem it = new DataItem ();
- int lineNum = start + 1;
- int lastLine = start + count - 2;
- while (lineNum <= lastLine) {
- if (!ReadDataNode (it, lines, lastLine, "", ref lineNum))
- lineNum++;
- }
- return it;
- }
-
- bool ReadDataNode (DataItem item, List<string> lines, int lastLine, string prefix, ref int lineNum)
- {
- string s = lines [lineNum].Trim (' ','\t');
-
- if (s.Length == 0) {
- lineNum++;
- return true;
- }
-
- // Check if the line belongs to the current item
- if (prefix.Length > 0) {
- if (!s.StartsWith (prefix + "."))
- return false;
- s = s.Substring (prefix.Length + 1);
- } else {
- if (s.StartsWith ("$"))
- return false;
- }
-
- int i = s.IndexOf ('=');
- if (i == -1) {
- lineNum++;
- return true;
- }
-
- string name = s.Substring (0, i).Trim (' ','\t');
- if (name.Length == 0) {
- lineNum++;
- return true;
- }
-
- string value = s.Substring (i+1).Trim (' ','\t');
- if (value.StartsWith ("$")) {
- // New item
- DataItem child = new DataItem ();
- child.Name = name;
- lineNum++;
- while (lineNum <= lastLine) {
- if (!ReadDataNode (child, lines, lastLine, value, ref lineNum))
- break;
- }
- item.ItemData.Add (child);
- }
- else {
- value = DecodeString (value);
- DataValue val = new DataValue (name, value);
- item.ItemData.Add (val);
- lineNum++;
- }
- return true;
- }
-
- string ToSlnConfigurationId (ItemConfiguration configuration)
- {
- if (configuration.Platform.Length == 0)
- return configuration.Name + "|Any CPU";
- else
- return configuration.Name + "|" + configuration.Platform;
- }
-
- string FromSlnConfigurationId (string configId)
- {
- int i = configId.IndexOf ('|');
- if (i != -1) {
- if (configId.Substring (i+1) == "Any CPU")
- return configId.Substring (0, i);
- }
- return configId;
- }
-
- string ToSlnConfigurationId (string configId)
- {
- if (configId.IndexOf ('|') == -1)
- return configId + "|Any CPU";
- else
- return configId;
- }
-
- //Reader
- public object ReadFile (string fileName, MSBuildFileFormat format, IProgressMonitor monitor)
- {
- if (fileName == null || monitor == null)
- return null;
-
- Solution sol;
- try {
- ProjectExtensionUtil.BeginLoadOperation ();
- sol = new Solution ();
- monitor.BeginTask (string.Format (GettextCatalog.GetString ("Loading solution: {0}"), fileName), 1);
- var projectLoadMonitor = monitor as IProjectLoadProgressMonitor;
- if (projectLoadMonitor != null)
- projectLoadMonitor.CurrentSolution = sol;
- LoadSolution (sol, fileName, format, monitor);
- } catch (Exception ex) {
- monitor.ReportError (GettextCatalog.GetString ("Could not load solution: {0}", fileName), ex);
- throw;
- } finally {
- ProjectExtensionUtil.EndLoadOperation ();
- monitor.EndTask ();
- }
- return sol;
- }
-
- //ExtendedProperties
- // Per config
- // Platform : Eg. Any CPU
- // SolutionConfigurationPlatforms
- //
- SolutionFolder LoadSolution (Solution sol, string fileName, MSBuildFileFormat format, IProgressMonitor monitor)
- {
- string headerComment;
- string version = GetSlnFileVersion (fileName, out headerComment);
-
- ListDictionary globals = null;
- SolutionFolder folder = null;
- SlnData data = null;
- List<Section> projectSections = null;
- List<string> lines = null;
-
- FileFormat projectFormat = Services.ProjectService.FileFormats.GetFileFormat (format);
-
- monitor.BeginTask (GettextCatalog.GetString ("Loading solution: {0}", fileName), 1);
- //Parse the .sln file
- using (StreamReader reader = new StreamReader(fileName)) {
- sol.FileName = fileName;
- sol.ConvertToFormat (projectFormat, false);
- folder = sol.RootFolder;
- sol.Version = "0.1"; //FIXME:
- data = new SlnData ();
- folder.ExtendedProperties [typeof (SlnFileFormat)] = data;
- data.VersionString = version;
- data.HeaderComment = headerComment;
-
- string s = null;
- projectSections = new List<Section> ();
- lines = new List<string> ();
- globals = new ListDictionary ();
- //Parse
- while (reader.Peek () >= 0) {
- s = GetNextLine (reader, lines).Trim ();
-
- if (String.Compare (s, "Global", StringComparison.OrdinalIgnoreCase) == 0) {
- ParseGlobal (reader, lines, globals);
- continue;
- }
-
- if (s.StartsWith ("Project", StringComparison.Ordinal)) {
- Section sec = new Section ();
- projectSections.Add (sec);
-
- sec.Start = lines.Count - 1;
-
- int e = ReadUntil ("EndProject", reader, lines);
- sec.Count = (e < 0) ? 1 : (e - sec.Start + 1);
-
- continue;
- }
-
- if (s.StartsWith ("VisualStudioVersion = ", StringComparison.Ordinal)) {
- Version v;
- if (Version.TryParse (s.Substring ("VisualStudioVersion = ".Length), out v))
- data.VisualStudioVersion = v;
- else
- monitor.Log.WriteLine ("Ignoring unparseable VisualStudioVersion value in sln file");
- }
-
- if (s.StartsWith ("MinimumVisualStudioVersion = ", StringComparison.Ordinal)) {
- Version v;
- if (Version.TryParse (s.Substring ("MinimumVisualStudioVersion = ".Length), out v))
- data.MinimumVisualStudioVersion = v;
- else
- monitor.Log.WriteLine ("Ignoring unparseable MinimumVisualStudioVersion value in sln file");
- }
- }
- }
-
- monitor.BeginTask("Loading projects ..", projectSections.Count + 1);
- Dictionary<string, SolutionItem> items = new Dictionary<string, SolutionItem> ();
- List<SolutionItem> sortedList = new List<SolutionItem> ();
- foreach (Section sec in projectSections) {
- monitor.Step (1);
- Match match = ProjectRegex.Match (lines [sec.Start]);
- if (!match.Success) {
- LoggingService.LogDebug (GettextCatalog.GetString (
- "Invalid Project definition on line number #{0} in file '{1}'. Ignoring.",
- sec.Start + 1,
- fileName));
-
- continue;
- }
-
- try {
- // Valid guid?
- new Guid (match.Groups [1].Value);
- } catch (FormatException) {
- //Use default guid as projectGuid
- LoggingService.LogDebug (GettextCatalog.GetString (
- "Invalid Project type guid '{0}' on line #{1}. Ignoring.",
- match.Groups [1].Value,
- sec.Start + 1));
- continue;
- }
-
- string projTypeGuid = match.Groups [1].Value.ToUpper ();
- string projectName = match.Groups [2].Value;
- string projectPath = match.Groups [3].Value;
- string projectGuid = match.Groups [4].Value.ToUpper ();
- List<string> projLines;
-
- if (projTypeGuid == MSBuildProjectService.FolderTypeGuid) {
- //Solution folder
- SolutionFolder sfolder = new SolutionFolder ();
- sfolder.Name = projectName;
- MSBuildProjectService.InitializeItemHandler (sfolder);
- MSBuildProjectService.SetId (sfolder, projectGuid);
-
- projLines = lines.GetRange (sec.Start + 1, sec.Count - 2);
- DeserializeSolutionItem (sol, sfolder, projLines);
-
- foreach (string f in ReadFolderFiles (projLines))
- sfolder.Files.Add (MSBuildProjectService.FromMSBuildPath (Path.GetDirectoryName (fileName), f));
-
- SlnData slnData = new SlnData ();
- slnData.Extra = projLines.ToArray ();
- sfolder.ExtendedProperties [typeof (SlnFileFormat)] = slnData;
-
- items.Add (projectGuid, sfolder);
- sortedList.Add (sfolder);
-
- continue;
- }
-
- if (projectPath.StartsWith("http://")) {
- monitor.ReportWarning (GettextCatalog.GetString (
- "{0}({1}): Projects with non-local source (http://...) not supported. '{2}'.",
- fileName, sec.Start + 1, projectPath));
- data.UnknownProjects.AddRange (lines.GetRange (sec.Start, sec.Count));
- continue;
- }
-
- string path = MSBuildProjectService.FromMSBuildPath (Path.GetDirectoryName (fileName), projectPath);
- if (String.IsNullOrEmpty (path)) {
- monitor.ReportWarning (GettextCatalog.GetString (
- "Invalid project path found in {0} : {1}", fileName, projectPath));
- LoggingService.LogWarning (GettextCatalog.GetString (
- "Invalid project path found in {0} : {1}", fileName, projectPath));
- continue;
- }
-
- projectPath = Path.GetFullPath (path);
-
- SolutionEntityItem item = null;
-
- try {
- if (sol.IsSolutionItemEnabled (projectPath)) {
- item = ProjectExtensionUtil.LoadSolutionItem (monitor, projectPath, delegate {
- return MSBuildProjectService.LoadItem (monitor, projectPath, format, projTypeGuid, projectGuid);
- });
-
- if (item == null) {
- throw new UnknownSolutionItemTypeException (projTypeGuid);
- }
- } else {
- var uitem = new UnloadedSolutionItem () {
- FileName = projectPath
- };
- var h = new MSBuildHandler (projTypeGuid, projectGuid) {
- Item = uitem,
- };
- uitem.SetItemHandler (h);
- item = uitem;
- }
-
- } catch (Exception e) {
- // If we get a TargetInvocationException from using Activator.CreateInstance we
- // need to unwrap the real exception
- while (e is TargetInvocationException)
- e = ((TargetInvocationException) e).InnerException;
-
- bool loadAsProject = false;
-
- if (e is UnknownSolutionItemTypeException) {
- var name = ((UnknownSolutionItemTypeException)e).TypeName;
-
- var relPath = new FilePath (path).ToRelative (sol.BaseDirectory);
- if (!string.IsNullOrEmpty (name)) {
- var guids = name.Split (';');
- var projectInfo = MSBuildProjectService.GetUnknownProjectTypeInfo (guids, fileName);
- if (projectInfo != null) {
- loadAsProject = projectInfo.LoadFiles;
- LoggingService.LogWarning (string.Format ("Could not load {0} project '{1}'. {2}", projectInfo.Name, relPath, projectInfo.GetInstructions ()));
- monitor.ReportWarning (GettextCatalog.GetString ("Could not load {0} project '{1}'. {2}", projectInfo.Name, relPath, projectInfo.GetInstructions ()));
- } else {
- LoggingService.LogWarning (string.Format ("Could not load project '{0}' with unknown item type '{1}'", relPath, name));
- monitor.ReportWarning (GettextCatalog.GetString ("Could not load project '{0}' with unknown item type '{1}'", relPath, name));
- }
- } else {
- LoggingService.LogWarning (string.Format ("Could not load project '{0}' with unknown item type", relPath));
- monitor.ReportWarning (GettextCatalog.GetString ("Could not load project '{0}' with unknown item type", relPath));
- }
-
- } else if (e is UserException) {
- var ex = (UserException) e;
- LoggingService.LogError ("{0}: {1}", ex.Message, ex.Details);
- monitor.ReportError (string.Format ("{0}{1}{1}{2}", ex.Message, Environment.NewLine, ex.Details), null);
- } else {
- LoggingService.LogError (string.Format ("Error while trying to load the project {0}", projectPath), e);
- monitor.ReportWarning (GettextCatalog.GetString (
- "Error while trying to load the project '{0}': {1}", projectPath, e.Message));
- }
-
- SolutionEntityItem uitem;
- if (loadAsProject) {
- uitem = new UnknownProject () {
- FileName = projectPath,
- LoadError = e.Message,
- };
- } else {
- uitem = new UnknownSolutionItem () {
- FileName = projectPath,
- LoadError = e.Message,
- };
- }
-
- var h = new MSBuildHandler (projTypeGuid, projectGuid) {
- Item = uitem,
- };
- uitem.SetItemHandler (h);
- item = uitem;
- }
-
- MSBuildHandler handler = (MSBuildHandler) item.ItemHandler;
- projLines = lines.GetRange (sec.Start + 1, sec.Count - 2);
- DataItem it = GetSolutionItemData (projLines);
-
- handler.UnresolvedProjectDependencies = ReadSolutionItemDependencies (projLines);
- handler.SlnProjectContent = projLines.ToArray ();
- handler.ReadSlnData (it);
-
- if (!items.ContainsKey (projectGuid)) {
- items.Add (projectGuid, item);
- sortedList.Add (item);
- data.ItemsByGuid [projectGuid] = item;
- } else {
- monitor.ReportError (GettextCatalog.GetString ("Invalid solution file. There are two projects with the same GUID. The project {0} will be ignored.", projectPath), null);
- }
- }
- monitor.EndTask ();
-
- if (globals != null && globals.Contains ("NestedProjects")) {
- LoadNestedProjects (globals ["NestedProjects"] as Section, lines, items, monitor);
- globals.Remove ("NestedProjects");
- }
-
- // Resolve project dependencies
- foreach (var it in items.Values.OfType<SolutionEntityItem> ()) {
- MSBuildHandler handler = (MSBuildHandler) it.ItemHandler;
- if (handler.UnresolvedProjectDependencies != null) {
- foreach (var id in handler.UnresolvedProjectDependencies.ToArray ()) {
- SolutionItem dep;
- if (items.TryGetValue (id, out dep) && dep is SolutionEntityItem) {
- handler.UnresolvedProjectDependencies.Remove (id);
- it.ItemDependencies.Add ((SolutionEntityItem)dep);
- }
- }
- if (handler.UnresolvedProjectDependencies.Count == 0)
- handler.UnresolvedProjectDependencies = null;
- }
- }
-
- //Add top level folders and projects to the main folder
- foreach (SolutionItem ce in sortedList) {
- if (ce.ParentFolder == null)
- folder.Items.Add (ce);
- }
-
- //FIXME: This can be just SolutionConfiguration also!
- if (globals != null) {
- if (globals.Contains ("SolutionConfigurationPlatforms")) {
- LoadSolutionConfigurations (globals ["SolutionConfigurationPlatforms"] as Section, lines,
- sol, monitor);
- globals.Remove ("SolutionConfigurationPlatforms");
- }
-
- if (globals.Contains ("ProjectConfigurationPlatforms")) {
- LoadProjectConfigurationMappings (globals ["ProjectConfigurationPlatforms"] as Section, lines,
- sol, monitor);
- globals.Remove ("ProjectConfigurationPlatforms");
- }
-
- if (globals.Contains ("MonoDevelopProperties")) {
- LoadMonoDevelopProperties (globals ["MonoDevelopProperties"] as Section, lines, sol, monitor);
- globals.Remove ("MonoDevelopProperties");
- }
-
- ArrayList toRemove = new ArrayList ();
- foreach (DictionaryEntry e in globals) {
- string name = (string) e.Key;
- if (name.StartsWith ("MonoDevelopProperties.")) {
- int i = name.IndexOf ('.');
- LoadMonoDevelopConfigurationProperties (name.Substring (i+1), (Section)e.Value, lines, sol, monitor);
- toRemove.Add (e.Key);
- }
- }
- foreach (object key in toRemove)
- globals.Remove (key);
- }
-
- //Save the global sections that we dont use
- List<string> globalLines = new List<string> ();
- foreach (Section sec in globals.Values)
- globalLines.InsertRange (globalLines.Count, lines.GetRange (sec.Start, sec.Count));
-
- data.GlobalExtra = globalLines;
- monitor.EndTask ();
-
- // When reloading a project, keep the solution data and item id
- sol.SolutionItemAdded += delegate(object sender, SolutionItemChangeEventArgs e) {
- if (e.Reloading) {
- ItemSlnData.TransferData (e.ReplacedItem, e.SolutionItem);
- var ih = e.SolutionItem.ItemHandler as MSBuildHandler;
- if (ih != null)
- ih.ItemId = e.ReplacedItem.ItemId;
- }
- };
-
- return folder;
- }
-
- void ParseGlobal (StreamReader reader, List<string> lines, ListDictionary dict)
- {
- //Process GlobalSection-s
- while (reader.Peek () >= 0) {
- string s = GetNextLine (reader, lines).Trim ();
- if (s.Length == 0)
- //Skip blank lines
- continue;
-
- Match m = GlobalSectionRegex.Match (s);
- if (!m.Success) {
- if (String.Compare (s, "EndGlobal", true) == 0)
- return;
-
- continue;
- }
-
- Section sec = new Section (m.Groups [1].Value, m.Groups [2].Value, lines.Count - 1, 1);
- dict [sec.Key] = sec;
-
- sec.Count = ReadUntil ("EndGlobalSection", reader, lines) - sec.Start + 1;
- //FIXME: sec.Count == -1 : No EndGlobalSection found, ignore entry?
- }
- }
-
- void LoadProjectConfigurationMappings (Section sec, List<string> lines, Solution sln, IProgressMonitor monitor)
- {
- if (sec == null || String.Compare (sec.Val, "postSolution", true) != 0)
- return;
-
- Dictionary<string, SolutionConfigurationEntry> cache = new Dictionary<string, SolutionConfigurationEntry> ();
- Dictionary<string, string> ignoredProjects = new Dictionary<string, string> ();
- SlnData slnData = GetSlnData (sln.RootFolder);
-
- List<string> extras = new List<string> ();
-
- for (int i = 0; i < sec.Count - 2; i ++) {
- int lineNum = i + sec.Start + 1;
- string s = lines [lineNum].Trim ();
- extras.Add (s);
-
- //Format:
- // {projectGuid}.SolutionConfigName|SolutionPlatform.ActiveCfg = ProjConfigName|ProjPlatform
- // {projectGuid}.SolutionConfigName|SolutionPlatform.Build.0 = ProjConfigName|ProjPlatform
- // {projectGuid}.SolutionConfigName|SolutionPlatform.Deploy.0 = ProjConfigName|ProjPlatform
-
- string [] parts = s.Split (new char [] {'='}, 2);
- if (parts.Length < 2) {
- LoggingService.LogDebug ("{0} ({1}) : Invalid format. Ignoring", sln.FileName, lineNum + 1);
- continue;
- }
-
- string action;
- string projConfig = parts [1].Trim ();
-
- string left = parts [0].Trim ();
- if (left.EndsWith (".ActiveCfg")) {
- action = "ActiveCfg";
- left = left.Substring (0, left.Length - 10);
- } else if (left.EndsWith (".Build.0")) {
- action = "Build.0";
- left = left.Substring (0, left.Length - 8);
- } else if (left.EndsWith (".Deploy.0")) {
- action = "Deploy.0";
- left = left.Substring (0, left.Length - 9);
- } else {
- LoggingService.LogWarning (GettextCatalog.GetString ("{0} ({1}) : Unknown action. Only ActiveCfg, Build.0 and Deploy.0 supported.",
- sln.FileName, lineNum + 1));
- continue;
- }
-
- string [] t = left.Split (new char [] {'.'}, 2);
- if (t.Length < 2) {
- LoggingService.LogDebug ("{0} ({1}) : Invalid format of the left side. Ignoring",
- sln.FileName, lineNum + 1);
- continue;
- }
-
- string projGuid = t [0].ToUpper ();
- string slnConfig = t [1];
-
- if (!slnData.ItemsByGuid.ContainsKey (projGuid)) {
- if (ignoredProjects.ContainsKey (projGuid))
- // already warned
- continue;
-
- LoggingService.LogWarning (GettextCatalog.GetString ("{0} ({1}) : Project with guid = '{2}' not found or not loaded. Ignoring",
- sln.FileName, lineNum + 1, projGuid));
- ignoredProjects [projGuid] = projGuid;
- continue;
- }
-
- SolutionEntityItem item;
- if (slnData.ItemsByGuid.TryGetValue (projGuid, out item) && item.SupportsConfigurations ()) {
- string key = projGuid + "." + slnConfig;
- SolutionConfigurationEntry combineConfigEntry = null;
- if (cache.ContainsKey (key)) {
- combineConfigEntry = cache [key];
- } else {
- combineConfigEntry = GetConfigEntry (sln, item, slnConfig);
- combineConfigEntry.Build = false; // Not buildable by default. Build will be enabled if a Build.0 entry is found
- cache [key] = combineConfigEntry;
- }
-
- /* If both ActiveCfg & Build.0 entries are missing
- * for a project, then default values :
- * ActiveCfg : same as the solution config
- * Build : true
- *
- * ELSE
- * if Build (true/false) for the project will
- * will depend on presence/absence of Build.0 entry
- */
- if (action == "ActiveCfg") {
- combineConfigEntry.ItemConfiguration = FromSlnConfigurationId (projConfig);
- } else if (action == "Build.0") {
- combineConfigEntry.Build = true;
- } else if (action == "Deploy.0") {
- combineConfigEntry.Deploy = true;
- }
- }
- extras.RemoveAt (extras.Count - 1);
- }
-
- slnData.SectionExtras ["ProjectConfigurationPlatforms"] = extras;
- }
-
- /* Gets the CombineConfigurationEntry corresponding to the @entry in its parentCombine's
- * CombineConfiguration. Creates the required bits if not present */
- SolutionConfigurationEntry GetConfigEntry (Solution sol, SolutionEntityItem item, string configName)
- {
- configName = FromSlnConfigurationId (configName);
-
- SolutionConfiguration solutionConfig = sol.Configurations [configName];
- if (solutionConfig == null) {
- solutionConfig = CreateSolutionConfigurationFromId (configName);
- sol.Configurations.Add (solutionConfig);
- }
-
- SolutionConfigurationEntry conf = solutionConfig.GetEntryForItem (item);
- if (conf != null)
- return conf;
- return solutionConfig.AddItem (item);
- }
-
- void LoadSolutionConfigurations (Section sec, List<string> lines, Solution solution, IProgressMonitor monitor)
- {
- if (sec == null || String.Compare (sec.Val, "preSolution", true) != 0)
- return;
-
- for (int i = 0; i < sec.Count - 2; i ++) {
- //FIXME: expects both key and val to be on the same line
- int lineNum = i + sec.Start + 1;
- string s = lines [lineNum].Trim ();
- if (s.Length == 0)
- //Skip blank lines
- continue;
-
- KeyValuePair<string, string> pair = SplitKeyValue (s);
-
- string configId = FromSlnConfigurationId (pair.Key);
- SolutionConfiguration config = solution.Configurations [configId];
-
- if (config == null) {
- config = CreateSolutionConfigurationFromId (configId);
- solution.Configurations.Add (config);
- }
- }
- }
-
- SolutionConfiguration CreateSolutionConfigurationFromId (string fullId)
- {
- return new SolutionConfiguration (fullId);
- }
-
- void LoadMonoDevelopProperties (Section sec, List<string> lines, Solution sln, IProgressMonitor monitor)
- {
- DataItem it = ReadDataItem (sec, lines);
- MSBuildSerializer ser = new MSBuildSerializer (sln.FileName);
- ser.SerializationContext.BaseFile = sln.FileName;
- ser.Deserialize (sln, it);
- }
-
- void LoadMonoDevelopConfigurationProperties (string configName, Section sec, List<string> lines, Solution sln, IProgressMonitor monitor)
- {
- SolutionConfiguration config = sln.Configurations [configName];
- if (config == null)
- return;
- DataItem it = ReadDataItem (sec, lines);
- MSBuildSerializer ser = new MSBuildSerializer (sln.FileName);
- ser.Deserialize (config, it);
- }
-
- void LoadNestedProjects (Section sec, List<string> lines,
- IDictionary<string, SolutionItem> entries, IProgressMonitor monitor)
- {
- if (sec == null || String.Compare (sec.Val, "preSolution", true) != 0)
- return;
-
- for (int i = 0; i < sec.Count - 2; i ++) {
- // Guids should be upper case for VS compatibility
- KeyValuePair<string, string> pair = SplitKeyValue (lines [i + sec.Start + 1].Trim ());
- pair = new KeyValuePair<string, string> (pair.Key.ToUpper (), pair.Value.ToUpper ());
-
- SolutionItem folderItem;
- SolutionItem item;
-
- if (!entries.TryGetValue (pair.Value, out folderItem)) {
- //Container not found
- LoggingService.LogWarning (GettextCatalog.GetString ("Project with guid '{0}' not found.", pair.Value));
- continue;
- }
-
- SolutionFolder folder = folderItem as SolutionFolder;
- if (folder == null) {
- LoggingService.LogWarning (GettextCatalog.GetString ("Item with guid '{0}' is not a folder.", pair.Value));
- continue;
- }
-
- if (!entries.TryGetValue (pair.Key, out item)) {
- //Containee not found
- LoggingService.LogWarning (GettextCatalog.GetString ("Project with guid '{0}' not found.", pair.Key));
- continue;
- }
-
- folder.Items.Add (item);
- }
- }
-
- string GetNextLine (StreamReader reader, List<string> list)
- {
- if (reader.Peek () < 0)
- return null;
-
- string ret = reader.ReadLine ();
- list.Add (ret);
- return ret;
- }
-
- int ReadUntil (string end, StreamReader reader, List<string> lines)
- {
- int ret = -1;
- while (reader.Peek () >= 0) {
- string s = GetNextLine (reader, lines);
-
- if (String.Compare (s.Trim (), end, true) == 0)
- return (lines.Count - 1);
- }
-
- return ret;
- }
-
-
- KeyValuePair<string, string> SplitKeyValue (string s)
- {
- string [] pair = s.Split (new char [] {'='}, 2);
- string key = pair [0].Trim ();
- string val = String.Empty;
- if (pair.Length == 2)
- val = pair [1].Trim ();
-
- return new KeyValuePair<string, string> (key, val);
- }
-
- // Utility function to determine the sln file version
- string GetSlnFileVersion(string strInSlnFile, out string headerComment)
- {
- string strVersion = null;
- string strInput = null;
- headerComment = null;
- Match match;
- StreamReader reader = new StreamReader(strInSlnFile);
-
- strInput = reader.ReadLine();
- if (strInput == null)
- return null;
-
- match = SlnVersionRegex.Match(strInput);
- if (!match.Success) {
- strInput = reader.ReadLine();
- if (strInput == null)
- return null;
- match = SlnVersionRegex.Match (strInput);
- }
-
- if (match.Success)
- {
- strVersion = match.Groups[1].Value;
- headerComment = reader.ReadLine ();
- }
-
- // Close the stream
- reader.Close();
-
- return strVersion;
- }
-
- static SlnData GetSlnData (SolutionItem c)
- {
- if (c.ExtendedProperties.Contains (typeof (SlnFileFormat)))
- return c.ExtendedProperties [typeof (SlnFileFormat)] as SlnData;
- return null;
- }
-
- // static regexes
- static Regex projectRegex = null;
- internal static Regex ProjectRegex {
- get {
- if (projectRegex == null)
- projectRegex = new Regex(@"Project\(""(\{[^}]*\})""\) = ""(.*)"", ""(.*)"", ""(\{[^{]*\})""");
- return projectRegex;
- }
- }
-
- static Regex globalSectionRegex = null;
- static Regex GlobalSectionRegex {
- get {
- if (globalSectionRegex == null)
- globalSectionRegex = new Regex (@"GlobalSection\s*\(([^)]*)\)\s*=\s*(\w*)");
- return globalSectionRegex;
- }
- }
-
- static Regex slnVersionRegex = null;
- internal static Regex SlnVersionRegex {
- get {
- if (slnVersionRegex == null)
- slnVersionRegex = new Regex (@"Microsoft Visual Studio Solution File, Format Version (\d?\d.\d\d)");
- return slnVersionRegex;
- }
- }
-
- public string Name {
- get { return "MSBuild"; }
- }
-
- }
-
- class Section {
- public string Key;
- public string Val;
-
- public int Start = -1; //Line number
- public int Count = 0;
-
- public Section ()
- {
- }
-
- public Section (string Key, string Val, int Start, int Count)
- {
- this.Key = Key;
- this.Val = Val;
- this.Start = Start;
- this.Count = Count;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/TargetsAvailableCondition.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/TargetsAvailableCondition.cs
deleted file mode 100644
index 81e7119165..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/TargetsAvailableCondition.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// TargetAvailableCondition.cs
-//
-// Author: Jeffrey Stedfast <jeff@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.IO;
-using System.Text;
-using System.Collections.Generic;
-
-using Mono.Addins;
-using MonoDevelop.Core;
-using MonoDevelop.Core.Assemblies;
-
-namespace MonoDevelop.Projects.Formats.MSBuild
-{
- public class TargetsAvailableCondition : ConditionType
- {
- public override bool Evaluate (NodeElement conditionNode)
- {
- var target = conditionNode.GetAttribute ("target");
-
- if (string.IsNullOrEmpty (target))
- return false;
-
- string msbuild = Runtime.SystemAssemblyService.CurrentRuntime.GetMSBuildExtensionsPath ();
- Dictionary<string, string> variables = new Dictionary<string, string> (StringComparer.OrdinalIgnoreCase) {
- { "MSBuildExtensionsPath64", msbuild },
- { "MSBuildExtensionsPath32", msbuild },
- { "MSBuildExtensionsPath", msbuild }
- };
-
- string path = StringParserService.Parse (target, variables);
- if (Path.DirectorySeparatorChar != '\\')
- path = path.Replace ('\\', Path.DirectorySeparatorChar);
-
- return File.Exists (path);
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MD1/MD1DotNetProjectHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MD1/MD1DotNetProjectHandler.cs
new file mode 100644
index 0000000000..f9c1f338af
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MD1/MD1DotNetProjectHandler.cs
@@ -0,0 +1,440 @@
+// MD1DotNetProjectHandler.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+using System;
+using System.IO;
+using System.Diagnostics;
+using System.Collections.Generic;
+using System.CodeDom.Compiler;
+using System.Text.RegularExpressions;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Execution;
+using MonoDevelop.Projects.Extensions;
+using Microsoft.Build.BuildEngine;
+using System.Threading.Tasks;
+using MonoDevelop.Projects.MSBuild.Conditions;
+
+namespace MonoDevelop.Projects.MD1
+{
+ class MD1DotNetProjectHandler
+ {
+ DotNetProject project;
+
+ public MD1DotNetProjectHandler (DotNetProject entry)
+ {
+ project = entry;
+ }
+
+ public async Task<BuildResult> RunTarget (ProgressMonitor monitor, string target, ConfigurationSelector configuration)
+ {
+ switch (target)
+ {
+ case "Build":
+ return await OnBuild (monitor, configuration);
+ case "Clean":
+ return await OnClean (monitor, configuration);
+ }
+ return new BuildResult (new CompilerResults (null), "");
+ }
+
+ async Task<BuildResult> OnBuild (ProgressMonitor monitor, ConfigurationSelector configuration)
+ {
+ if (!project.OnGetNeedsBuilding (configuration)) {
+ monitor.Log.WriteLine (GettextCatalog.GetString ("Skipping project since output files are up to date"));
+ return new BuildResult ();
+ }
+
+ if (!project.TargetRuntime.IsInstalled (project.TargetFramework)) {
+ BuildResult res = new BuildResult ();
+ res.AddError (GettextCatalog.GetString ("Framework '{0}' not installed.", project.TargetFramework.Name));
+ return res;
+ }
+
+ bool hasBuildableFiles = false;
+ foreach (ProjectFile pf in project.Files) {
+ if (pf.BuildAction == BuildAction.Compile || pf.BuildAction == BuildAction.EmbeddedResource) {
+ hasBuildableFiles = true;
+ break;
+ }
+ }
+ if (!hasBuildableFiles)
+ return new BuildResult ();
+
+ if (project.LanguageBinding == null) {
+ BuildResult langres = new BuildResult ();
+ string msg = GettextCatalog.GetString ("Unknown language '{0}'. You may need to install an additional add-in to support this language.", project.LanguageName);
+ langres.AddError (msg);
+ monitor.ReportError (msg, null);
+ return langres;
+ }
+
+ BuildResult refres = null;
+ HashSet<ProjectItem> itemsToExclude = new HashSet<ProjectItem> ();
+
+ foreach (ProjectReference pr in project.References) {
+
+ if (pr.ReferenceType == ReferenceType.Project) {
+ // Ignore non-dotnet projects
+ Project p = project.ParentSolution != null ? pr.ResolveProject (project.ParentSolution) : null;
+ if (p != null && !(p is DotNetProject))
+ continue;
+
+ if (p == null || pr.GetReferencedFileNames (configuration).Length == 0) {
+ if (refres == null)
+ refres = new BuildResult ();
+ string msg = GettextCatalog.GetString ("Referenced project '{0}' not found in the solution.", pr.Reference);
+ monitor.ReportWarning (msg);
+ refres.AddWarning (msg);
+ }
+ }
+
+ if (!pr.IsValid) {
+ if (refres == null)
+ refres = new BuildResult ();
+ string msg;
+ if (!pr.IsExactVersion && pr.SpecificVersion) {
+ msg = GettextCatalog.GetString ("Reference '{0}' not found on system. Using '{1}' instead.", pr.StoredReference, pr.Reference);
+ monitor.ReportWarning (msg);
+ refres.AddWarning (msg);
+ }
+ else {
+ bool errorsFound = false;
+ foreach (string asm in pr.GetReferencedFileNames (configuration)) {
+ if (!File.Exists (asm)) {
+ msg = GettextCatalog.GetString ("Assembly '{0}' not found. Make sure that the assembly exists in disk. If the reference is required to build the project you may get compilation errors.", Path.GetFileName (asm));
+ refres.AddWarning (msg);
+ monitor.ReportWarning (msg);
+ errorsFound = true;
+ itemsToExclude.Add (pr);
+ }
+ }
+ msg = null;
+ if (!errorsFound) {
+ msg = GettextCatalog.GetString ("The reference '{0}' is not valid for the target framework of the project.", pr.StoredReference, pr.Reference);
+ monitor.ReportWarning (msg);
+ refres.AddWarning (msg);
+ itemsToExclude.Add (pr);
+ }
+ }
+ }
+ }
+
+ DotNetProjectConfiguration conf = (DotNetProjectConfiguration) project.GetConfiguration (configuration);
+
+ // Create a copy of the data needed to compile the project.
+ // This data can be modified by extensions.
+ // Also filter out items whose condition evaluates to false
+
+ BuildData buildData = new BuildData ();
+ ProjectParserContext ctx = new ProjectParserContext (project, conf);
+
+ buildData.Items = new ProjectItemCollection ();
+ foreach (ProjectItem item in project.Items) {
+ if (!itemsToExclude.Contains (item) && (string.IsNullOrEmpty (item.Condition) || ConditionParser.ParseAndEvaluate (item.Condition, ctx)))
+ buildData.Items.Add (item);
+ }
+ buildData.Configuration = (DotNetProjectConfiguration) project.CloneConfiguration (conf, conf.Id);
+ buildData.Configuration.SetParentItem (project);
+ buildData.ConfigurationSelector = configuration;
+
+ var br = await project.Compile (monitor, buildData);
+
+ if (refres != null) {
+ refres.Append (br);
+ return refres;
+ } else
+ return br;
+ }
+
+ internal static Task<BuildResult> Compile (ProgressMonitor monitor, DotNetProject project, BuildData buildData)
+ {
+ return Task<BuildResult>.Run (delegate {
+ ProjectItemCollection items = buildData.Items;
+ BuildResult br = BuildResources (buildData.Configuration, ref items, monitor);
+ if (br != null)
+ return br;
+ return project.OnCompileSources (items, buildData.Configuration, buildData.ConfigurationSelector, monitor);
+ });
+ }
+
+ // Builds the EmbedAsResource files. If any localized resources are found then builds the satellite assemblies
+ // and sets @projectItems to a cloned collection minus such resource files.
+ internal static BuildResult BuildResources (DotNetProjectConfiguration configuration, ref ProjectItemCollection projectItems, ProgressMonitor monitor)
+ {
+ string resgen = configuration.TargetRuntime.GetToolPath (configuration.TargetFramework, "resgen");
+ ExecutionEnvironment env = configuration.TargetRuntime.GetToolsExecutionEnvironment (configuration.TargetFramework);
+
+ bool cloned = false;
+ Dictionary<string, string> resourcesByCulture = new Dictionary<string, string> ();
+ foreach (ProjectFile finfo in projectItems.GetAll<ProjectFile> ()) {
+ if (finfo.Subtype == Subtype.Directory || finfo.BuildAction != BuildAction.EmbeddedResource)
+ continue;
+
+ string fname = finfo.Name;
+ string resourceId;
+ CompilerError ce = GetResourceId (configuration.IntermediateOutputDirectory.Combine (finfo.ResourceId), env, finfo, ref fname, resgen, out resourceId, monitor);
+ if (ce != null) {
+ CompilerResults cr = new CompilerResults (new TempFileCollection ());
+ cr.Errors.Add (ce);
+
+ return new BuildResult (cr, String.Empty);
+ }
+ string culture = DotNetProject.GetResourceCulture (finfo.Name);
+ if (culture == null)
+ continue;
+
+ string cmd = String.Empty;
+ if (resourcesByCulture.ContainsKey (culture))
+ cmd = resourcesByCulture [culture];
+
+ cmd = String.Format ("{0} \"/embed:{1},{2}\"", cmd, fname, resourceId);
+ resourcesByCulture [culture] = cmd;
+ if (!cloned) {
+ // Clone only if required
+ ProjectItemCollection items = new ProjectItemCollection ();
+ items.AddRange (projectItems);
+ projectItems = items;
+ cloned = true;
+ }
+ projectItems.Remove (finfo);
+ }
+
+ string al = configuration.TargetRuntime.GetToolPath (configuration.TargetFramework, "al");
+ CompilerError err = GenerateSatelliteAssemblies (resourcesByCulture, configuration.OutputDirectory, al, Path.GetFileName (configuration.OutputAssembly), monitor);
+ if (err != null) {
+ CompilerResults cr = new CompilerResults (new TempFileCollection ());
+ cr.Errors.Add (err);
+
+ return new BuildResult (cr, String.Empty);
+ }
+
+ return null;
+ }
+
+ static CompilerError GetResourceId (FilePath outputFile, ExecutionEnvironment env, ProjectFile finfo, ref string fname, string resgen, out string resourceId, ProgressMonitor monitor)
+ {
+ resourceId = finfo.ResourceId;
+ if (resourceId == null) {
+ LoggingService.LogDebug (GettextCatalog.GetString ("Error: Unable to build ResourceId for {0}.", fname));
+ monitor.Log.WriteLine (GettextCatalog.GetString ("Error: Unable to build ResourceId for {0}.", fname));
+
+ return new CompilerError (fname, 0, 0, String.Empty,
+ GettextCatalog.GetString ("Unable to build ResourceId for {0}.", fname));
+ }
+
+ if (String.Compare (Path.GetExtension (fname), ".resx", true) != 0)
+ return null;
+
+ if (!IsResgenRequired (fname, outputFile)) {
+ fname = File.Exists (outputFile) ? (string)outputFile : Path.ChangeExtension (fname, ".resources");
+ return null;
+ }
+
+ if (resgen == null) {
+ string msg = GettextCatalog.GetString ("Unable to find 'resgen' tool.");
+ monitor.ReportError (msg, null);
+ return new CompilerError (fname, 0, 0, String.Empty, msg);
+ }
+
+ using (StringWriter sw = new StringWriter ()) {
+ LoggingService.LogDebug ("Compiling resources\n{0}$ {1} /compile {2}", Path.GetDirectoryName (fname), resgen, fname);
+ monitor.Log.WriteLine (GettextCatalog.GetString (
+ "Compiling resource {0} with {1}", fname, resgen));
+ ProcessWrapper pw = null;
+ try {
+ ProcessStartInfo info = Runtime.ProcessService.CreateProcessStartInfo (
+ resgen, String.Format ("/compile \"{0}\"", fname),
+ Path.GetDirectoryName (fname), false);
+
+ env.MergeTo (info);
+ if (PlatformID.Unix == Environment.OSVersion.Platform)
+ info.EnvironmentVariables ["MONO_IOMAP"] = "drive";
+
+ pw = Runtime.ProcessService.StartProcess (info, sw, sw, null);
+ } catch (System.ComponentModel.Win32Exception ex) {
+ LoggingService.LogDebug (GettextCatalog.GetString (
+ "Error while trying to invoke '{0}' to compile resource '{1}' :\n {2}", resgen, fname, ex.ToString ()));
+ monitor.Log.WriteLine (GettextCatalog.GetString (
+ "Error while trying to invoke '{0}' to compile resource '{1}' :\n {2}", resgen, fname, ex.Message));
+
+ return new CompilerError (fname, 0, 0, String.Empty, ex.Message);
+ }
+
+ //FIXME: Handle exceptions
+ pw.WaitForOutput ();
+
+ if (pw.ExitCode == 0) {
+ fname = Path.ChangeExtension (fname, ".resources");
+ } else {
+ string output = sw.ToString ();
+ LoggingService.LogDebug (GettextCatalog.GetString (
+ "Unable to compile ({0}) {1} to .resources. \nReason: \n{2}\n",
+ resgen, fname, output));
+ monitor.Log.WriteLine (GettextCatalog.GetString (
+ "Unable to compile ({0}) {1} to .resources. \nReason: \n{2}\n",
+ resgen, fname, output));
+
+ //Try to get the line/pos
+ int line = 0;
+ int pos = 0;
+ Match match = RegexErrorLinePos.Match (output);
+ if (match.Success && match.Groups.Count == 3) {
+ try {
+ line = int.Parse (match.Groups [1].Value);
+ } catch (FormatException){
+ }
+
+ try {
+ pos = int.Parse (match.Groups [2].Value);
+ } catch (FormatException){
+ }
+ }
+
+ return new CompilerError (fname, line, pos, String.Empty, output);
+ }
+ }
+
+ return null;
+ }
+
+ protected virtual Task<BuildResult> OnClean (ProgressMonitor monitor, ConfigurationSelector configuration)
+ {
+ return Task.FromResult (BuildResult.CreateSuccess ());
+ }
+
+ // true if the resx file or any file referenced
+ // by the resx is newer than the .resources file
+ public static bool IsResgenRequired (string resx_filename, string output_filename)
+ {
+ if (String.Compare (Path.GetExtension (resx_filename), ".resx", true) != 0)
+ throw new ArgumentException (".resx file expected", "resx_filename");
+
+ if (File.Exists (output_filename))
+ return IsFileNewerThan (resx_filename, output_filename);
+ return IsFileNewerThan (resx_filename, Path.ChangeExtension (resx_filename, ".resources"));
+ }
+
+ // true if first is newer than second
+ static bool IsFileNewerThan (string first, string second)
+ {
+ FileInfo finfo_first = new FileInfo (first);
+ FileInfo finfo_second = new FileInfo (second);
+ return finfo_first.LastWriteTime > finfo_second.LastWriteTime;
+ }
+
+ static CompilerError GenerateSatelliteAssemblies (Dictionary<string, string> resourcesByCulture, string outputDir, string al, string defaultns, ProgressMonitor monitor)
+ {
+ foreach (KeyValuePair<string, string> pair in resourcesByCulture) {
+ string culture = pair.Key;
+ string satDir = Path.Combine (outputDir, culture);
+ string outputFile = defaultns + ".resources.dll";
+
+ //FIXME: don't regen if not required,
+ //for that we'll need name of the .resources that these depend on..
+
+ //create target dir
+ Directory.CreateDirectory (satDir);
+
+ using (StringWriter sw = new StringWriter ()) {
+ //generate assembly
+ string args = String.Format ("/t:lib {0} \"/out:{1}\" /culture:{2}", pair.Value, outputFile, culture);
+
+ LoggingService.LogDebug ("Generating satellite assembly for '{0}' culture.\n{1}$ {2} {3}", culture, satDir, al, args);
+ monitor.Log.WriteLine (GettextCatalog.GetString (
+ "Generating satellite assembly for '{0}' culture with {1}", culture, al));
+ ProcessWrapper pw = null;
+ try {
+ ProcessStartInfo info = Runtime.ProcessService.CreateProcessStartInfo (
+ al, args,
+ satDir, false);
+
+ pw = Runtime.ProcessService.StartProcess (info, sw, sw, null);
+ } catch (System.ComponentModel.Win32Exception ex) {
+ LoggingService.LogDebug (GettextCatalog.GetString (
+ "Error while trying to invoke '{0}' to generate satellite assembly for '{1}' culture:\n {2}", al, culture, ex.ToString ()));
+ monitor.Log.WriteLine (GettextCatalog.GetString (
+ "Error while trying to invoke '{0}' to generate satellite assembly for '{1}' culture:\n {2}", al, culture, ex.Message));
+
+ return new CompilerError ("", 0, 0, String.Empty, ex.Message);
+ }
+
+ //FIXME: Handle exceptions
+ pw.WaitForOutput ();
+
+ if (pw.ExitCode != 0) {
+ string output = sw.ToString ();
+ LoggingService.LogDebug (GettextCatalog.GetString (
+ "Unable to generate satellite assemblies for '{0}' culture with {1}.\nReason: \n{2}\n",
+ culture, al, output));
+ monitor.Log.WriteLine (GettextCatalog.GetString (
+ "Unable to generate satellite assemblies for '{0}' culture with {1}.\nReason: \n{2}\n",
+ culture, al, output));
+
+ return new CompilerError (String.Empty, 0, 0, String.Empty, output);
+ }
+ }
+ }
+
+ return null;
+ }
+
+ // Used for parsing "Line 123, position 5" errors from tools
+ // like resgen, xamlg
+ static Regex regexErrorLinePos;
+ static Regex RegexErrorLinePos {
+ get {
+ if (regexErrorLinePos == null)
+ regexErrorLinePos = new Regex (@"Line (\d*), position (\d*)");
+ return regexErrorLinePos;
+ }
+ }
+ }
+
+ class ProjectParserContext: IExpressionContext
+ {
+ Project project;
+ DotNetProjectConfiguration config;
+
+ public ProjectParserContext (Project project, DotNetProjectConfiguration config)
+ {
+ this.project = project;
+ this.config = config;
+ }
+
+ public string FullFileName {
+ get {
+ return project.FileName;
+ }
+ }
+
+ public string EvaluateString (string value)
+ {
+ string val = value.Replace ("$(Configuration)", config.Name).Replace ("$(Platform)", config.Platform);
+ return val;
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MD1/MD1FileFormat.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MD1/MD1FileFormat.cs
new file mode 100644
index 0000000000..bd2360350b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MD1/MD1FileFormat.cs
@@ -0,0 +1,158 @@
+//
+// MonoDevelopFileFormat.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Xml;
+using MonoDevelop.Core.Serialization;
+using MonoDevelop.Projects.Extensions;
+using MonoDevelop.Core;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Projects.MD1
+{
+ class MD1FileFormat
+ {
+ public static readonly MD1FileFormat Instance = new MD1FileFormat ();
+
+ public FilePath GetValidFormatName (object obj, FilePath fileName)
+ {
+ if (obj is WorkspaceItem && !(obj is Solution))
+ return Path.ChangeExtension (fileName, ".mdw");
+ throw new InvalidOperationException ();
+ }
+
+ public bool CanReadFile (FilePath file, Type expectedType)
+ {
+ string ext = Path.GetExtension (file).ToLower ();
+ return ext == ".mdw" && expectedType.IsAssignableFrom (typeof(WorkspaceItem));
+ }
+
+ public bool CanWriteFile (object obj)
+ {
+ return (obj is WorkspaceItem && !(obj is Solution));
+ }
+
+ async public Task WriteFile (FilePath file, object node, ProgressMonitor monitor)
+ {
+ string tmpfilename = null;
+ try {
+ try {
+ if (File.Exists (file))
+ tmpfilename = Path.GetTempFileName ();
+ } catch (IOException) {
+ }
+
+ if (tmpfilename == null) {
+ await WriteFileInternal (file, file, node, monitor);
+ } else {
+ await WriteFileInternal (file, tmpfilename, node, monitor);
+ File.Delete (file);
+ File.Move (tmpfilename, file);
+ }
+ } catch {
+ if (tmpfilename != String.Empty && File.Exists (tmpfilename))
+ File.Delete (tmpfilename);
+ throw;
+ }
+ }
+
+ Task WriteFileInternal (FilePath actualFile, FilePath outFile, object node, ProgressMonitor monitor)
+ {
+ return WriteWorkspaceItem (actualFile, outFile, (WorkspaceItem) node, monitor);
+ }
+
+ async Task WriteWorkspaceItem (FilePath actualFile, FilePath outFile, WorkspaceItem item, ProgressMonitor monitor)
+ {
+ Workspace ws = item as Workspace;
+ if (ws != null) {
+ monitor.BeginTask (null, ws.Items.Count);
+ try {
+ foreach (WorkspaceItem it in ws.Items) {
+ await it.SaveAsync (monitor);
+ monitor.Step (1);
+ }
+ } finally {
+ monitor.EndTask ();
+ }
+ }
+
+ await Task.Run (delegate {
+ StreamWriter sw = new StreamWriter (outFile);
+ try {
+ monitor.BeginTask (GettextCatalog.GetString ("Saving item: {0}", actualFile), 1);
+ XmlTextWriter tw = new XmlTextWriter (sw);
+ tw.Formatting = Formatting.Indented;
+ XmlDataSerializer ser = new XmlDataSerializer (MD1ProjectService.DataContext);
+ ser.SerializationContext.BaseFile = actualFile;
+ ser.SerializationContext.ProgressMonitor = monitor;
+ ser.Serialize (sw, item, typeof(WorkspaceItem));
+ } catch (Exception ex) {
+ monitor.ReportError (GettextCatalog.GetString ("Could not save item: {0}", actualFile), ex);
+ throw;
+ } finally {
+ monitor.EndTask ();
+ sw.Close ();
+ }
+ });
+ }
+
+ public async Task<object> ReadFile (FilePath fileName, Type expectedType, ProgressMonitor monitor)
+ {
+ string ext = Path.GetExtension (fileName).ToLower ();
+ if (ext != ".mdw")
+ throw new ArgumentException ();
+
+ return await ReadWorkspaceItemFile (fileName, monitor);
+ }
+
+ Task<object> ReadWorkspaceItemFile (FilePath fileName, ProgressMonitor monitor)
+ {
+ return Task<object>.Factory.StartNew (delegate {
+ XmlTextReader reader = new XmlTextReader (new StreamReader (fileName));
+ try {
+ monitor.BeginTask (string.Format (GettextCatalog.GetString ("Loading workspace item: {0}"), fileName), 1);
+ reader.MoveToContent ();
+ XmlDataSerializer ser = new XmlDataSerializer (MD1ProjectService.DataContext);
+ ser.SerializationContext.BaseFile = fileName;
+ ser.SerializationContext.ProgressMonitor = monitor;
+ WorkspaceItem entry = (WorkspaceItem)ser.Deserialize (reader, typeof(WorkspaceItem));
+ entry.FileName = fileName;
+ return entry;
+ } catch (Exception ex) {
+ monitor.ReportError (string.Format (GettextCatalog.GetString ("Could not load solution item: {0}"), fileName), ex);
+ throw;
+ } finally {
+ monitor.EndTask ();
+ reader.Close ();
+ }
+ });
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MD1/MD1ProjectService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MD1/MD1ProjectService.cs
new file mode 100644
index 0000000000..8dae9be020
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MD1/MD1ProjectService.cs
@@ -0,0 +1,47 @@
+// MD1ProjectService.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+using MonoDevelop.Projects;
+using MonoDevelop.Core.Serialization;
+
+namespace MonoDevelop.Projects.MD1
+{
+ static class MD1ProjectService
+ {
+ static DataContext dataContext;
+
+ public static DataContext DataContext {
+ get {
+ if (dataContext == null) {
+ dataContext = new DataContext ();
+ Services.ProjectService.InitializeDataContext (dataContext);
+ }
+ return dataContext;
+ }
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionAndExpression.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionAndExpression.cs
new file mode 100644
index 0000000000..634a202b4d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionAndExpression.cs
@@ -0,0 +1,100 @@
+//
+// ConditionAndExpression.cs
+//
+// Author:
+// Marek Sieradzki (marek.sieradzki@gmail.com)
+//
+// (C) 2006 Marek Sieradzki
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.Xml;
+
+namespace MonoDevelop.Projects.MSBuild.Conditions {
+ internal sealed class ConditionAndExpression : ConditionExpression {
+
+ readonly ConditionExpression left;
+ readonly ConditionExpression right;
+
+ public ConditionAndExpression (ConditionExpression left, ConditionExpression right)
+ {
+ this.left = left;
+ this.right = right;
+ }
+
+ public ConditionExpression Left {
+ get { return left; }
+ }
+
+ public ConditionExpression Right {
+ get { return right; }
+ }
+
+ public override bool BoolEvaluate (IExpressionContext context)
+ {
+ if (!left.BoolEvaluate (context))
+ return false;
+ if (!right.BoolEvaluate (context))
+ return false;
+ return true;
+ }
+
+
+ public override float NumberEvaluate (IExpressionContext context)
+ {
+ throw new NotSupportedException ();
+ }
+
+ public override string StringEvaluate (IExpressionContext context)
+ {
+ throw new NotSupportedException ();
+ }
+
+ public override bool CanEvaluateToBool (IExpressionContext context)
+ {
+ // Short-circuiting, check only left expr, right
+ // would be required only if left == true
+ return left.CanEvaluateToBool (context);
+ }
+
+ public override bool CanEvaluateToNumber (IExpressionContext context)
+ {
+ return false;
+ }
+
+ public override bool CanEvaluateToString (IExpressionContext context)
+ {
+ return false;
+ }
+
+ public override void CollectConditionProperties (ConditionedPropertyCollection properties)
+ {
+ left.CollectConditionProperties (properties);
+ right.CollectConditionProperties (properties);
+ }
+ }
+
+ interface IExpressionContext
+ {
+ string FullFileName { get; }
+ string EvaluateString (string value);
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionExpression.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionExpression.cs
new file mode 100644
index 0000000000..f97da39df7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionExpression.cs
@@ -0,0 +1,46 @@
+//
+// ConditionExpression.cs
+//
+// Author:
+// Marek Sieradzki (marek.sieradzki@gmail.com)
+//
+// (C) 2006 Marek Sieradzki
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.Xml;
+
+namespace MonoDevelop.Projects.MSBuild.Conditions {
+ internal abstract class ConditionExpression {
+
+ public abstract bool BoolEvaluate (IExpressionContext context);
+ public abstract float NumberEvaluate (IExpressionContext context);
+ public abstract string StringEvaluate (IExpressionContext context);
+
+ public abstract bool CanEvaluateToBool (IExpressionContext context);
+ public abstract bool CanEvaluateToNumber (IExpressionContext context);
+ public abstract bool CanEvaluateToString (IExpressionContext context);
+
+ public virtual void CollectConditionProperties (ConditionedPropertyCollection properties)
+ {
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionFactorExpresion.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionFactorExpresion.cs
new file mode 100644
index 0000000000..73aa9bc4d7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionFactorExpresion.cs
@@ -0,0 +1,139 @@
+//
+// ConditionFactorExpression.cs
+//
+// Author:
+// Marek Sieradzki (marek.sieradzki@gmail.com)
+//
+// (C) 2006 Marek Sieradzki
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.Collections;
+using System.Collections.Specialized;
+using System.Globalization;
+using System.Xml;
+
+namespace MonoDevelop.Projects.MSBuild.Conditions {
+ internal sealed class ConditionFactorExpression : ConditionExpression {
+
+ readonly Token token;
+
+ static Hashtable allValues;
+ static Hashtable trueValues;
+ static Hashtable falseValues;
+
+ static ConditionFactorExpression ()
+ {
+ string[] trueValuesArray = new string[] {"true", "on", "yes"};
+ string[] falseValuesArray = new string[] {"false", "off", "no"};
+
+
+ allValues = CollectionsUtil.CreateCaseInsensitiveHashtable ();
+ trueValues = CollectionsUtil.CreateCaseInsensitiveHashtable ();
+ falseValues = CollectionsUtil.CreateCaseInsensitiveHashtable ();
+
+ foreach (string s in trueValuesArray) {
+ trueValues.Add (s, s);
+ allValues.Add (s, s);
+ }
+
+ foreach (string s in falseValuesArray) {
+ falseValues.Add (s, s);
+ allValues.Add (s, s);
+ }
+ }
+
+ public ConditionFactorExpression (Token token)
+ {
+ this.token = token;
+ }
+
+ public override bool BoolEvaluate (IExpressionContext context)
+ {
+ Token evaluatedToken = EvaluateToken (token, context);
+
+ if (trueValues [evaluatedToken.Value] != null)
+ return true;
+ else if (falseValues [evaluatedToken.Value] != null)
+ return false;
+ else
+ throw new ExpressionEvaluationException (
+ String.Format ("Expression \"{0}\" evaluated to \"{1}\" instead of a boolean value",
+ token.Value, evaluatedToken.Value));
+ }
+
+ public override float NumberEvaluate (IExpressionContext context)
+ {
+ Token evaluatedToken = EvaluateToken (token, context);
+
+ return Single.Parse (evaluatedToken.Value, CultureInfo.InvariantCulture);
+ }
+
+ public override string StringEvaluate (IExpressionContext context)
+ {
+ Token evaluatedToken = EvaluateToken (token, context);
+
+ return evaluatedToken.Value;
+ }
+
+ // FIXME: check if we really can do it
+ public override bool CanEvaluateToBool (IExpressionContext context)
+ {
+ Token evaluatedToken = EvaluateToken (token, context);
+
+ if (token.Type == TokenType.String && allValues [evaluatedToken.Value] != null)
+ return true;
+ else
+ return false;
+ }
+
+ public override bool CanEvaluateToNumber (IExpressionContext context)
+ {
+ if (token.Type == TokenType.Number)
+ return true;
+ else if (token.Type == TokenType.String) {
+ var text = StringEvaluate (context);
+ Single number;
+ return Single.TryParse (text, out number);
+ }
+ else
+ return false;
+ }
+
+ public override bool CanEvaluateToString (IExpressionContext context)
+ {
+ return true;
+ }
+
+ // FIXME: in some situations items might not be allowed
+ static Token EvaluateToken (Token token, IExpressionContext context)
+ {
+ string val = context.EvaluateString (token.Value);
+ return new Token (val, TokenType.String, 0);
+ }
+
+ internal Conditions.Token Token {
+ get {
+ return this.token;
+ }
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionFunctionExpression.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionFunctionExpression.cs
new file mode 100644
index 0000000000..d1a0105374
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionFunctionExpression.cs
@@ -0,0 +1,131 @@
+//
+// ConditionFunctionExpression.cs
+//
+// Authors:
+// Marek Sieradzki (marek.sieradzki@gmail.com)
+// Marek Safar (marek.safar@gmail.com)
+//
+// (C) 2006 Marek Sieradzki
+// Copyright (c) 2014 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Reflection;
+using System.Xml;
+
+namespace MonoDevelop.Projects.MSBuild.Conditions {
+ internal sealed class ConditionFunctionExpression : ConditionExpression {
+
+ List <ConditionFactorExpression> args;
+ string name;
+
+ static readonly Dictionary<string, Func<string, IExpressionContext, bool>> functions = new Dictionary<string, Func<string, IExpressionContext, bool>> (StringComparer.OrdinalIgnoreCase) {
+ { "Exists", Exists },
+ { "HasTrailingSlash" , HasTrailingSlash }
+ };
+
+ public ConditionFunctionExpression (string name, List <ConditionFactorExpression> args)
+ {
+ this.args = args;
+ this.name = name;
+ }
+
+ public override bool BoolEvaluate (IExpressionContext context)
+ {
+ Func<string, IExpressionContext, bool> func;
+ if (!functions.TryGetValue (name, out func)) {
+ // MSB4091
+ throw new Exception (string.Format ("Found a call to an undefined function \"{0}\".", name));
+ }
+
+ if (args.Count != 1) {
+ // MSB4089
+ throw new Exception (string.Format ("Incorrect number of arguments to function in condition \"{0}\". Found {1} argument(s) when expecting {2}.",
+ name, args.Count, 1));
+ }
+
+ return func (args [0].StringEvaluate (context), context);
+ }
+
+ public override float NumberEvaluate (IExpressionContext context)
+ {
+ throw new NotSupportedException ();
+ }
+
+ public override string StringEvaluate (IExpressionContext context)
+ {
+ throw new NotSupportedException ();
+ }
+
+ public override bool CanEvaluateToBool (IExpressionContext context)
+ {
+ return functions.ContainsKey (name);
+ }
+
+ public override bool CanEvaluateToNumber (IExpressionContext context)
+ {
+ return false;
+ }
+
+ public override bool CanEvaluateToString (IExpressionContext context)
+ {
+ return false;
+ }
+
+#pragma warning disable 0169
+#region Functions
+ // FIXME imported projects
+ static bool Exists (string file, IExpressionContext context)
+ {
+ if (string.IsNullOrEmpty (file))
+ return false;
+
+ string directory = null;
+
+ if (context.FullFileName != String.Empty)
+ directory = Path.GetDirectoryName (context.FullFileName);
+
+ file = MSBuildProjectService.FromMSBuildPath (directory, file);
+
+ return File.Exists (file) || Directory.Exists (file);
+ }
+
+ static bool HasTrailingSlash (string file, IExpressionContext context)
+ {
+ if (file == null)
+ return false;
+
+ file = file.Trim ();
+
+ int len = file.Length;
+ if (len == 0)
+ return false;
+
+ return file [len - 1] == '\\' || file [len - 1] == '/';
+ }
+
+#endregion
+#pragma warning restore 0169
+
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionNotExpression.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionNotExpression.cs
new file mode 100644
index 0000000000..f53c5f0bc2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionNotExpression.cs
@@ -0,0 +1,80 @@
+//
+// ConditionNotExpression.cs
+//
+// Author:
+// Marek Sieradzki (marek.sieradzki@gmail.com)
+//
+// (C) 2006 Marek Sieradzki
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+
+using System;
+using System.Xml;
+
+namespace MonoDevelop.Projects.MSBuild.Conditions {
+ internal sealed class ConditionNotExpression : ConditionExpression {
+
+ readonly ConditionExpression expression;
+
+ public ConditionNotExpression (ConditionExpression expression)
+ {
+ this.expression = expression;
+ }
+
+ public override bool BoolEvaluate (IExpressionContext context)
+ {
+ return !(expression.BoolEvaluate (context));
+ }
+
+
+ public override float NumberEvaluate (IExpressionContext context)
+ {
+ throw new NotSupportedException ();
+ }
+
+ public override string StringEvaluate (IExpressionContext context)
+ {
+ throw new NotSupportedException ();
+ }
+
+ public override bool CanEvaluateToBool (IExpressionContext context)
+ {
+ return expression.CanEvaluateToBool (context);
+ }
+
+ public override bool CanEvaluateToNumber (IExpressionContext context)
+ {
+ return false;
+ }
+
+ public override bool CanEvaluateToString (IExpressionContext context)
+ {
+ return false;
+ }
+
+ public override void CollectConditionProperties (ConditionedPropertyCollection properties)
+ {
+ expression.CollectConditionProperties (properties);
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionOrExpression.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionOrExpression.cs
new file mode 100644
index 0000000000..e0d2fa2b20
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionOrExpression.cs
@@ -0,0 +1,94 @@
+//
+// ConditionOrExpression.cs
+//
+// Author:
+// Marek Sieradzki (marek.sieradzki@gmail.com)
+//
+// (C) 2006 Marek Sieradzki
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+using System;
+using System.Xml;
+
+namespace MonoDevelop.Projects.MSBuild.Conditions {
+ internal sealed class ConditionOrExpression : ConditionExpression {
+
+ readonly ConditionExpression left;
+ readonly ConditionExpression right;
+
+ public ConditionOrExpression (ConditionExpression left, ConditionExpression right)
+ {
+ this.left = left;
+ this.right = right;
+ }
+
+ public ConditionExpression Left {
+ get { return left; }
+ }
+
+ public ConditionExpression Right {
+ get { return right; }
+ }
+
+ public override bool BoolEvaluate (IExpressionContext context)
+ {
+ if (left.BoolEvaluate (context))
+ return true;
+ if (right.BoolEvaluate (context))
+ return true;
+ return false;
+ }
+
+ public override float NumberEvaluate (IExpressionContext context)
+ {
+ throw new NotSupportedException ();
+ }
+
+ public override string StringEvaluate (IExpressionContext context)
+ {
+ throw new NotSupportedException ();
+ }
+
+ // FIXME: check if we really can do it
+ public override bool CanEvaluateToBool (IExpressionContext context)
+ {
+ return true;
+ }
+
+ public override bool CanEvaluateToNumber (IExpressionContext context)
+ {
+ return false;
+ }
+
+ public override bool CanEvaluateToString (IExpressionContext context)
+ {
+ return false;
+ }
+
+ public override void CollectConditionProperties (ConditionedPropertyCollection properties)
+ {
+ left.CollectConditionProperties (properties);
+ right.CollectConditionProperties (properties);
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionParser.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionParser.cs
new file mode 100644
index 0000000000..bbaa7e8852
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionParser.cs
@@ -0,0 +1,293 @@
+//
+// ConditionParser.cs
+//
+// Author:
+// Marek Sieradzki (marek.sieradzki@gmail.com)
+// Jaroslaw Kowalski <jaak@jkowalski.net>
+//
+// (C) 2006 Marek Sieradzki
+// (C) 2004-2006 Jaroslaw Kowalski
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+using Microsoft.Build.BuildEngine;
+
+namespace MonoDevelop.Projects.MSBuild.Conditions {
+
+ internal class ConditionParser {
+
+ ConditionTokenizer tokenizer;
+ string conditionStr;
+
+ ConditionParser (string condition)
+ {
+ tokenizer = new ConditionTokenizer ();
+ tokenizer.Tokenize (condition);
+ conditionStr = condition;
+ }
+
+ public static bool ParseAndEvaluate (string condition, IExpressionContext context)
+ {
+ if (String.IsNullOrEmpty (condition))
+ return true;
+
+ try {
+ ConditionExpression ce = ParseCondition (condition);
+
+ if (!ce.CanEvaluateToBool (context))
+ throw new InvalidProjectFileException (String.Format ("Can not evaluate \"{0}\" to bool.", condition));
+
+ return ce.BoolEvaluate (context);
+ } catch (ExpressionParseException epe) {
+ throw new InvalidProjectFileException (
+ String.Format ("Unable to parse condition \"{0}\" : {1}", condition, epe.Message),
+ epe);
+ } catch (ExpressionEvaluationException epe) {
+ throw new InvalidProjectFileException (
+ String.Format ("Unable to evaluate condition \"{0}\" : {1}", condition, epe.Message),
+ epe);
+ }
+ }
+
+ public static ConditionExpression ParseCondition (string condition)
+ {
+ ConditionParser parser = new ConditionParser (condition);
+ ConditionExpression e = parser.ParseExpression ();
+
+ if (!parser.tokenizer.IsEOF ())
+ throw new ExpressionParseException (String.Format ("Unexpected token found, {0}, in condition \"{1}\"", parser.tokenizer.Token, condition));
+
+ return e;
+ }
+
+ ConditionExpression ParseExpression ()
+ {
+ return ParseBooleanExpression ();
+ }
+
+ ConditionExpression ParseBooleanExpression ()
+ {
+ return ParseBooleanAnd ();
+ }
+
+ public static string And (string a, string b)
+ {
+ return a + " and " + b;
+ }
+
+ ConditionExpression ParseBooleanAnd ()
+ {
+ ConditionExpression e = ParseBooleanOr ();
+
+ while (tokenizer.IsToken (TokenType.And)) {
+ tokenizer.GetNextToken ();
+ e = new ConditionAndExpression (e, ParseBooleanOr ());
+ }
+
+ return e;
+ }
+
+ ConditionExpression ParseBooleanOr ()
+ {
+ ConditionExpression e = ParseRelationalExpression ();
+
+ while (tokenizer.IsToken (TokenType.Or)) {
+ tokenizer.GetNextToken ();
+ e = new ConditionOrExpression (e, ParseRelationalExpression ());
+ }
+
+ return e;
+ }
+
+ ConditionExpression ParseRelationalExpression ()
+ {
+ ConditionExpression e = ParseFactorExpression ();
+
+ Token opToken;
+ RelationOperator op;
+
+ if (tokenizer.IsToken (TokenType.Less) ||
+ tokenizer.IsToken (TokenType.Greater) ||
+ tokenizer.IsToken (TokenType.Equal) ||
+ tokenizer.IsToken (TokenType.NotEqual) ||
+ tokenizer.IsToken (TokenType.LessOrEqual) ||
+ tokenizer.IsToken (TokenType.GreaterOrEqual)) {
+
+ opToken = tokenizer.Token;
+ tokenizer.GetNextToken ();
+
+ switch (opToken.Type) {
+ case TokenType.Equal:
+ op = RelationOperator.Equal;
+ break;
+ case TokenType.NotEqual:
+ op = RelationOperator.NotEqual;
+ break;
+ case TokenType.Less:
+ op = RelationOperator.Less;
+ break;
+ case TokenType.LessOrEqual:
+ op = RelationOperator.LessOrEqual;
+ break;
+ case TokenType.Greater:
+ op = RelationOperator.Greater;
+ break;
+ case TokenType.GreaterOrEqual:
+ op = RelationOperator.GreaterOrEqual;
+ break;
+ default:
+ throw new ExpressionParseException (String.Format ("Wrong relation operator {0}", opToken.Value));
+ }
+
+ e = new ConditionRelationalExpression (e, ParseFactorExpression (), op);
+ }
+
+ return e;
+ }
+
+ ConditionExpression ParseFactorExpression ()
+ {
+ ConditionExpression e;
+ Token token = tokenizer.Token;
+ tokenizer.GetNextToken ();
+
+ if (token.Type == TokenType.LeftParen) {
+ e = ParseExpression ();
+ tokenizer.Expect (TokenType.RightParen);
+ } else if (token.Type == TokenType.String && tokenizer.Token.Type == TokenType.LeftParen) {
+ e = ParseFunctionExpression (token.Value);
+ } else if (token.Type == TokenType.String) {
+ e = new ConditionFactorExpression (token);
+ } else if (token.Type == TokenType.Number) {
+ e = new ConditionFactorExpression (token);
+ } else if (token.Type == TokenType.Item || token.Type == TokenType.Property
+ || token.Type == TokenType.Metadata) {
+ e = ParseReferenceExpression (token.Value [0]);
+ } else if (token.Type == TokenType.Not) {
+ e = ParseNotExpression ();
+ } else
+ throw new ExpressionParseException (String.Format ("Unexpected token {0}, while parsing condition \"{1}\"", token, conditionStr));
+
+ return e;
+ }
+
+ ConditionExpression ParseNotExpression ()
+ {
+ return new ConditionNotExpression (ParseFactorExpression ());
+ }
+
+ ConditionExpression ParseFunctionExpression (string function_name)
+ {
+ return new ConditionFunctionExpression (function_name, ParseFunctionArguments ());
+ }
+
+ List <ConditionFactorExpression> ParseFunctionArguments ()
+ {
+ List <ConditionFactorExpression> list = new List <ConditionFactorExpression> ();
+ ConditionFactorExpression e;
+
+ while (true) {
+ tokenizer.GetNextToken ();
+ if (tokenizer.Token.Type == TokenType.RightParen) {
+ tokenizer.GetNextToken ();
+ break;
+ }
+ if (tokenizer.Token.Type == TokenType.Comma)
+ continue;
+
+ tokenizer.Putback (tokenizer.Token);
+ e = (ConditionFactorExpression) ParseFactorExpression ();
+ list.Add (e);
+ }
+
+ return list;
+ }
+
+ //@prefix: @ or $
+ ConditionExpression ParseReferenceExpression (char prefix)
+ {
+ int token_pos = tokenizer.Token.Position;
+ string ref_type = prefix == '$' ? "a property" : "an item list";
+ IsAtToken (TokenType.LeftParen, String.Format (
+ "Expected {0} at position {1} in condition \"{2}\". Missing opening parantheses after the '{3}'.",
+ ref_type, token_pos, conditionStr, prefix));
+
+
+ if (prefix == '$') {
+ //
+ // Tjhe scan should consider quoted parenthesis but it breaks on .net as well
+ // we are bug compatible
+ //
+ tokenizer.ScanForClosingParens ();
+ } else {
+ tokenizer.GetNextToken ();
+ }
+
+ if (tokenizer.IsEOF ())
+ throw new ExpressionParseException ("Missing closing parenthesis in condition " + conditionStr);
+
+ StringBuilder sb = new StringBuilder ();
+ sb.AppendFormat ("{0}({1}", prefix, tokenizer.Token.Value);
+
+ tokenizer.GetNextToken ();
+ if (prefix == '@' && tokenizer.Token.Type == TokenType.Transform) {
+ tokenizer.GetNextToken ();
+ sb.AppendFormat ("->'{0}'", tokenizer.Token.Value);
+
+ tokenizer.GetNextToken ();
+ if (tokenizer.Token.Type == TokenType.Comma) {
+ tokenizer.GetNextToken ();
+ sb.AppendFormat (", '{0}'", tokenizer.Token.Value);
+ tokenizer.GetNextToken ();
+ }
+ }
+
+ IsAtToken (TokenType.RightParen, "Missing closing parenthesis in condition " + conditionStr);
+ tokenizer.GetNextToken ();
+
+ sb.Append (")");
+
+ //FIXME: HACKY!
+ return new ConditionFactorExpression (new Token (sb.ToString (), TokenType.String, token_pos));
+ }
+
+ // used to check current token type
+ void IsAtToken (TokenType type, string error_msg)
+ {
+ if (tokenizer.Token.Type != type) {
+ if (!String.IsNullOrEmpty (error_msg))
+ throw new ExpressionParseException (error_msg);
+
+ if (tokenizer.Token.Type == TokenType.EOF)
+ throw new ExpressionParseException (String.Format (
+ "Expected a \"{0}\" but the condition ended abruptly, while parsing condition \"{1}\"",
+ Token.TypeAsString (type), conditionStr));
+
+ throw new ExpressionParseException (String.Format (
+ "Expected \"{0}\" token, but got {1}, while parsing \"{2}\"",
+ Token.TypeAsString (type), tokenizer.Token, conditionStr));
+ }
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionRelationalExpression.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionRelationalExpression.cs
new file mode 100644
index 0000000000..0010e3e08b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionRelationalExpression.cs
@@ -0,0 +1,232 @@
+//
+// ConditionRelationalExpression.cs
+//
+// Author:
+// Marek Sieradzki (marek.sieradzki@gmail.com)
+//
+// (C) 2006 Marek Sieradzki
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.Collections;
+using System.Xml;
+using System.Text;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Projects.MSBuild.Conditions {
+ internal sealed class ConditionRelationalExpression : ConditionExpression {
+
+ readonly ConditionExpression left;
+ readonly ConditionExpression right;
+ readonly RelationOperator op;
+
+ public ConditionRelationalExpression (ConditionExpression left,
+ ConditionExpression right,
+ RelationOperator op)
+ {
+ this.left = left;
+ this.right = right;
+ this.op = op;
+ }
+
+ public override bool BoolEvaluate (IExpressionContext context)
+ {
+ if (left.CanEvaluateToNumber (context) && right.CanEvaluateToNumber (context)) {
+ float l,r;
+
+ l = left.NumberEvaluate (context);
+ r = right.NumberEvaluate (context);
+
+ return NumberCompare (l, r, op);
+ } else if (left.CanEvaluateToBool (context) && right.CanEvaluateToBool (context)) {
+ bool l,r;
+
+ l = left.BoolEvaluate (context);
+ r = right.BoolEvaluate (context);
+
+ return BoolCompare (l, r, op);
+ } else {
+ string l,r;
+
+ l = left.StringEvaluate (context);
+ r = right.StringEvaluate (context);
+
+ return StringCompare (l, r, op);
+ }
+ }
+
+ public override float NumberEvaluate (IExpressionContext context)
+ {
+ throw new NotSupportedException ();
+ }
+
+ public override string StringEvaluate (IExpressionContext context)
+ {
+ throw new NotSupportedException ();
+ }
+
+ // FIXME: check if we really can do it
+ public override bool CanEvaluateToBool (IExpressionContext context)
+ {
+ return true;
+ }
+
+ public override bool CanEvaluateToNumber (IExpressionContext context)
+ {
+ return false;
+ }
+
+ public override bool CanEvaluateToString (IExpressionContext context)
+ {
+ return false;
+ }
+
+ static bool NumberCompare (float l,
+ float r,
+ RelationOperator op)
+ {
+ IComparer comparer = CaseInsensitiveComparer.DefaultInvariant;
+
+ switch (op) {
+ case RelationOperator.Equal:
+ return comparer.Compare (l, r) == 0;
+ case RelationOperator.NotEqual:
+ return comparer.Compare (l, r) != 0;
+ case RelationOperator.Greater:
+ return comparer.Compare (l, r) > 0;
+ case RelationOperator.GreaterOrEqual:
+ return comparer.Compare (l, r) >= 0;
+ case RelationOperator.Less:
+ return comparer.Compare (l, r) < 0;
+ case RelationOperator.LessOrEqual:
+ return comparer.Compare (l, r) <= 0;
+ default:
+ throw new NotSupportedException (String.Format ("Relational operator {0} is not supported.", op));
+ }
+ }
+
+ static bool BoolCompare (bool l,
+ bool r,
+ RelationOperator op)
+ {
+ IComparer comparer = CaseInsensitiveComparer.DefaultInvariant;
+
+ switch (op) {
+ case RelationOperator.Equal:
+ return comparer.Compare (l, r) == 0;
+ case RelationOperator.NotEqual:
+ return comparer.Compare (l, r) != 0;
+ default:
+ throw new NotSupportedException (String.Format ("Relational operator {0} is not supported.", op));
+ }
+ }
+
+ static bool StringCompare (string l,
+ string r,
+ RelationOperator op)
+ {
+ IComparer comparer = CaseInsensitiveComparer.DefaultInvariant;
+
+ switch (op) {
+ case RelationOperator.Equal:
+ return comparer.Compare (l, r) == 0;
+ case RelationOperator.NotEqual:
+ return comparer.Compare (l, r) != 0;
+ default:
+ throw new NotSupportedException (String.Format ("Relational operator {0} is not supported.", op));
+ }
+ }
+
+ public override void CollectConditionProperties (ConditionedPropertyCollection properties)
+ {
+ if ((op == RelationOperator.Equal || op == RelationOperator.NotEqual) && left is ConditionFactorExpression && right is ConditionFactorExpression) {
+ var leftString = ((ConditionFactorExpression)left).Token.Value;
+ var rightString = ((ConditionFactorExpression)right).Token.Value;
+ List<string> combinedProperty = null;
+ List<string> combinedValue = null;
+
+ int il = 0;
+ int rl = 0;
+ while (il < leftString.Length && rl < rightString.Length) {
+ if (il < leftString.Length - 2 && leftString [il] == '$' && leftString [il + 1] == '(')
+ ReadPropertyCondition (leftString, ref combinedProperty, ref combinedValue, ref il, rightString, ref rl);
+ else if (rl < rightString.Length - 2 && rightString [rl] == '$' && rightString [rl + 1] == '(')
+ ReadPropertyCondition (rightString, ref combinedProperty, ref combinedValue, ref rl, leftString, ref il);
+ else if (leftString [il] != rightString [rl])
+ return; // Condition can't be true
+ il++; rl++;
+ }
+
+ // This condition sets values for more that one property. In addition to the individual values, also register
+ // the combination of values. So for example if the condition has "$(Configuration)|$(Platform) == Foo|Bar",
+ // the conditioned property collection would contain Configuration=Foo, Platform=Bar, (Configuration|Platfrom)=Foo|Bar
+ if (combinedProperty != null)
+ properties.AddPropertyValues (combinedProperty.ToArray (), combinedValue.ToArray ());
+ }
+ }
+
+ void ReadPropertyCondition (string propString, ref List<string> combinedProperty, ref List<string> combinedValue, ref int i, string valString, ref int j)
+ {
+ var prop = ReadPropertyTag (propString, ref i);
+ string val;
+ if (i < propString.Length)
+ val = ReadPropertyValue (valString, ref j, propString [i]);
+ else
+ val = valString.Substring (j);
+
+ if (combinedProperty == null) {
+ combinedProperty = new List<string> ();
+ combinedValue = new List<string> ();
+ }
+
+ combinedProperty.Add (prop);
+ combinedValue.Add (val);
+ }
+
+ string ReadPropertyValue (string valString, ref int j, char v)
+ {
+ var s = j;
+ while (j < valString.Length && valString [j] != v)
+ j++;
+ return valString.Substring (s, j - s);
+ }
+
+ string ReadPropertyTag (string propString, ref int i)
+ {
+ i += 2;
+ var s = i;
+ while (i < propString.Length && propString [i] != ')')
+ i++;
+ if (i < propString.Length)
+ return propString.Substring (s, (i++) - s);
+ return propString.Substring (s);
+ }
+ }
+
+ internal enum RelationOperator {
+ Equal,
+ NotEqual,
+ Less,
+ Greater,
+ LessOrEqual,
+ GreaterOrEqual
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionTokenizer.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionTokenizer.cs
new file mode 100644
index 0000000000..688c478f56
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ConditionTokenizer.cs
@@ -0,0 +1,325 @@
+//
+// ConditionTokenizer.cs
+//
+// Author:
+// Marek Sieradzki (marek.sieradzki@gmail.com)
+// Jaroslaw Kowalski <jaak@jkowalski.net>
+//
+// (C) 2006 Marek Sieradzki
+// (C) 2004-2006 Jaroslaw Kowalski
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Text;
+
+namespace MonoDevelop.Projects.MSBuild.Conditions {
+
+ internal sealed class ConditionTokenizer {
+
+ string inputString = null;
+ int position = 0;
+ int tokenPosition = 0;
+
+ Token token;
+ Token putback = null;
+
+// bool ignoreWhiteSpace = true;
+
+ static TokenType[] charIndexToTokenType = new TokenType[128];
+ static Dictionary <string, TokenType> keywords = new Dictionary <string, TokenType> (StringComparer.OrdinalIgnoreCase);
+
+ static ConditionTokenizer ()
+ {
+ for (int i = 0; i < 128; i++)
+ charIndexToTokenType [i] = TokenType.Invalid;
+
+ foreach (CharToTokenType cht in charToTokenType)
+ charIndexToTokenType [(int) cht.ch] = cht.tokenType;
+
+ keywords.Add ("and", TokenType.And);
+ keywords.Add ("or", TokenType.Or);
+ }
+
+ public ConditionTokenizer ()
+ {
+// this.ignoreWhiteSpace = true;
+ }
+
+ public void Tokenize (string s)
+ {
+ if (s == null)
+ throw new ArgumentNullException ("s");
+
+ this.inputString = s;
+ this.position = 0;
+ this.token = new Token (null, TokenType.BOF, 0);
+
+ GetNextToken ();
+ }
+
+ void SkipWhiteSpace ()
+ {
+ int ch;
+
+ while ((ch = PeekChar ()) != -1) {
+ if (!Char.IsWhiteSpace ((char)ch))
+ break;
+ ReadChar ();
+ }
+ }
+
+ int PeekChar ()
+ {
+ if (position < inputString.Length)
+ return (int) inputString [position];
+ else
+ return -1;
+ }
+
+ int ReadChar ()
+ {
+ if (position < inputString.Length)
+ return (int) inputString [position++];
+ else
+ return -1;
+ }
+
+ public void Expect (TokenType type)
+ {
+ if (token.Type != type)
+ throw new ExpressionParseException ("Expected token type of type: " + type + ", got " + token.Type +
+ " (" + token.Value + ") .");
+
+ GetNextToken ();
+ }
+
+ public bool IsEOF ()
+ {
+ return token.Type == TokenType.EOF;
+ }
+
+ public bool IsNumber ()
+ {
+ return token.Type == TokenType.Number;
+ }
+
+ public bool IsToken (TokenType type)
+ {
+ return token.Type == type;
+ }
+
+ public bool IsPunctation ()
+ {
+ return (token.Type >= TokenType.FirstPunct && token.Type < TokenType.LastPunct);
+ }
+
+ // FIXME test this
+ public void Putback (Token token)
+ {
+ putback = token;
+ }
+
+ public void GetNextToken ()
+ {
+ if (putback != null) {
+ token = putback;
+ putback = null;
+ return;
+ }
+
+ if (token.Type == TokenType.EOF)
+ throw new ExpressionParseException (String.Format (
+ "Error while parsing condition \"{0}\", ended abruptly.",
+ inputString));
+
+ SkipWhiteSpace ();
+
+ tokenPosition = position;
+
+// int i = PeekChar ();
+ int i = ReadChar ();
+
+ if (i == -1) {
+ token = new Token (null, TokenType.EOF, tokenPosition);
+ return;
+ }
+
+ char ch = (char) i;
+
+
+ // FIXME: looks like a hack: if '-' is here '->' won't be tokenized
+ // maybe we should treat item reference as a token
+ if (ch == '-' && PeekChar () == '>') {
+ ReadChar ();
+ token = new Token ("->", TokenType.Transform, tokenPosition);
+ } else if (Char.IsDigit (ch) || ch == '-') {
+ StringBuilder sb = new StringBuilder ();
+
+ sb.Append (ch);
+
+ while ((i = PeekChar ()) != -1) {
+ ch = (char) i;
+
+ if (Char.IsDigit (ch) || ch == '.')
+ sb.Append ((char) ReadChar ());
+ else
+ break;
+ }
+
+ token = new Token (sb.ToString (), TokenType.Number, tokenPosition);
+ } else if (ch == '\'' && position < inputString.Length) {
+ StringBuilder sb = new StringBuilder ();
+ string temp;
+
+ sb.Append (ch);
+ bool is_itemref = (PeekChar () == '@');
+ int num_open_braces = 0;
+ bool in_literal = false;
+
+ while ((i = PeekChar ()) != -1) {
+ ch = (char) i;
+ if (ch == '(' && !in_literal && is_itemref)
+ num_open_braces ++;
+ if (ch == ')' && !in_literal && is_itemref)
+ num_open_braces --;
+
+ sb.Append ((char) ReadChar ());
+
+ if (ch == '\'') {
+ if (num_open_braces == 0)
+ break;
+ in_literal = !in_literal;
+ }
+ }
+
+ temp = sb.ToString ();
+
+ token = new Token (temp.Substring (1, temp.Length - 2), TokenType.String, tokenPosition);
+
+ } else if (ch == '_' || Char.IsLetter (ch)) {
+ StringBuilder sb = new StringBuilder ();
+
+ sb.Append ((char) ch);
+
+ while ((i = PeekChar ()) != -1) {
+ if ((char) i == '_' || Char.IsLetterOrDigit ((char) i))
+ sb.Append ((char) ReadChar ());
+ else
+ break;
+ }
+
+ string temp = sb.ToString ();
+
+ if (keywords.ContainsKey (temp))
+ token = new Token (temp, keywords [temp], tokenPosition);
+ else
+ token = new Token (temp, TokenType.String, tokenPosition);
+
+ } else if (ch == '!' && PeekChar () == (int) '=') {
+ token = new Token ("!=", TokenType.NotEqual, tokenPosition);
+ ReadChar ();
+ } else if (ch == '<' && PeekChar () == (int) '=') {
+ token = new Token ("<=", TokenType.LessOrEqual, tokenPosition);
+ ReadChar ();
+ } else if (ch == '>' && PeekChar () == (int) '=') {
+ token = new Token (">=", TokenType.GreaterOrEqual, tokenPosition);
+ ReadChar ();
+ } else if (ch == '=' && PeekChar () == (int) '=') {
+ token = new Token ("==", TokenType.Equal, tokenPosition);
+ ReadChar ();
+ } else if (ch >= 32 && ch < 128) {
+ if (charIndexToTokenType [ch] != TokenType.Invalid) {
+ token = new Token (new String (ch, 1), charIndexToTokenType [ch], tokenPosition);
+ return;
+ } else
+ throw new ExpressionParseException (String.Format ("Invalid punctuation: {0}", ch));
+ } else
+ throw new ExpressionParseException (String.Format ("Invalid token: {0}", ch));
+ }
+
+ public void ScanForClosingParens (int parensCounter = 1)
+ {
+ tokenPosition = position;
+ int start = position;
+ int ch;
+ while ((ch = ReadChar ()) >= 0) {
+ switch (ch) {
+ case ')':
+ if (--parensCounter == 0) {
+ --position;
+ token = new Token (inputString.Substring (start, position - start), TokenType.String, tokenPosition);
+ return;
+ }
+ break;
+ case '(':
+ ++parensCounter;
+ break;
+ }
+ }
+
+ token = new Token (null, TokenType.EOF, tokenPosition);
+ }
+
+ public int TokenPosition {
+ get { return tokenPosition; }
+ }
+
+ public Token Token {
+ get { return token; }
+ }
+
+/*
+ public bool IgnoreWhiteSpace {
+ get { return ignoreWhiteSpace; }
+ set { ignoreWhiteSpace = value; }
+ }
+*/
+
+ struct CharToTokenType {
+ public char ch;
+ public TokenType tokenType;
+
+ public CharToTokenType (char ch, TokenType tokenType)
+ {
+ this.ch = ch;
+ this.tokenType = tokenType;
+ }
+ }
+
+ static CharToTokenType[] charToTokenType = {
+ new CharToTokenType ('<', TokenType.Less),
+ new CharToTokenType ('>', TokenType.Greater),
+ new CharToTokenType ('=', TokenType.Equal),
+ new CharToTokenType ('(', TokenType.LeftParen),
+ new CharToTokenType (')', TokenType.RightParen),
+ new CharToTokenType ('.', TokenType.Dot),
+ new CharToTokenType (',', TokenType.Comma),
+ new CharToTokenType ('!', TokenType.Not),
+ new CharToTokenType ('@', TokenType.Item),
+ new CharToTokenType ('$', TokenType.Property),
+ new CharToTokenType ('%', TokenType.Metadata),
+ new CharToTokenType ('\'', TokenType.Apostrophe),
+ };
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ExpressionEvaluationException.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ExpressionEvaluationException.cs
new file mode 100644
index 0000000000..b15103fe15
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ExpressionEvaluationException.cs
@@ -0,0 +1,57 @@
+//
+// ExpressionEvaluationException.cs
+//
+// Author:
+// Ankit Jain (jankit@novell.com)
+//
+// Copyright 2011 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.Runtime.Serialization;
+
+namespace MonoDevelop.Projects.MSBuild.Conditions {
+ [Serializable]
+ internal class ExpressionEvaluationException : Exception {
+
+ public ExpressionEvaluationException ()
+ : base ("Exception occured when evaluating the expression.")
+ {
+ }
+
+ public ExpressionEvaluationException (string message)
+ : base (message)
+ {
+ }
+
+ public ExpressionEvaluationException (string message,
+ Exception innerException)
+ : base (message, innerException)
+ {
+ }
+
+ protected ExpressionEvaluationException (SerializationInfo info,
+ StreamingContext context)
+ : base (info, context)
+ {
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ExpressionParseException.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ExpressionParseException.cs
new file mode 100644
index 0000000000..2b2c8c84ae
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/ExpressionParseException.cs
@@ -0,0 +1,57 @@
+//
+// ExpressionParseException.cs
+//
+// Author:
+// Marek Sieradzki (marek.sieradzki@gmail.com)
+//
+// (C) 2006 Marek Sieradzki
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.Runtime.Serialization;
+
+namespace MonoDevelop.Projects.MSBuild.Conditions {
+ [Serializable]
+ internal class ExpressionParseException : Exception {
+
+ public ExpressionParseException ()
+ : base ("Exception occured when parsing an expression.")
+ {
+ }
+
+ public ExpressionParseException (string message)
+ : base (message)
+ {
+ }
+
+ public ExpressionParseException (string message,
+ Exception innerException)
+ : base (message, innerException)
+ {
+ }
+
+ protected ExpressionParseException (SerializationInfo info,
+ StreamingContext context)
+ : base (info, context)
+ {
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/Token.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/Token.cs
new file mode 100644
index 0000000000..0b0a8420f3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild.Conditions/Token.cs
@@ -0,0 +1,128 @@
+//
+// TokenType.cs
+//
+// Author:
+// Marek Sieradzki (marek.sieradzki@gmail.com)
+// Jaroslaw Kowalski <jaak@jkowalski.net>
+//
+// (C) 2006 Marek Sieradzki
+// (C) 2004-2006 Jaroslaw Kowalski
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+using System;
+
+namespace MonoDevelop.Projects.MSBuild.Conditions {
+
+ internal class Token {
+
+ string tokenValue;
+ TokenType tokenType;
+
+ public Token (string tokenValue, TokenType tokenType, int position)
+ {
+ this.tokenValue = tokenValue;
+ this.tokenType = tokenType;
+ this.Position = position + 1;
+ }
+
+ public string Value {
+ get { return tokenValue; }
+ }
+
+ public TokenType Type {
+ get { return tokenType; }
+ }
+
+ // this is 1-based
+ public int Position {
+ get; private set;
+ }
+
+ public static string TypeAsString (TokenType tokenType)
+ {
+ switch (tokenType) {
+ case TokenType.Item:return "@";
+ case TokenType.Property:return "$";
+ case TokenType.Metadata:return "%";
+ case TokenType.Transform:return "->";
+ case TokenType.Less:return "<";
+ case TokenType.Greater:return ">";
+ case TokenType.LessOrEqual:return "<=";
+ case TokenType.GreaterOrEqual:return ">=";
+ case TokenType.Equal:return "=";
+ case TokenType.NotEqual:return "!=";
+ case TokenType.LeftParen:return "(";
+ case TokenType.RightParen:return ")";
+ case TokenType.Dot:return ".";
+ case TokenType.Comma:return ",";
+ case TokenType.Not:return "!";
+ case TokenType.And:return "and";
+ case TokenType.Or:return "or";
+ case TokenType.Apostrophe:return "'";
+ default: return tokenType.ToString ();
+ }
+ }
+
+ public override string ToString ()
+ {
+ if (tokenType == TokenType.EOF || tokenType == TokenType.BOF)
+ return String.Format ("{0} at character position {1}", tokenType.ToString (), Position);
+
+ return String.Format ("\"{0}\" at character position {1}", tokenValue, Position);
+ }
+ }
+
+ internal enum TokenType {
+ EOF,
+ BOF,
+ Number,
+ String,
+ //Keyword,
+ Punct,
+ WhiteSpace,
+ Item,
+ Property,
+ Metadata,
+ FunctionName,
+ Transform,
+// LiteralSubExpression,
+
+ FirstPunct,
+
+ Less,
+ Greater,
+ LessOrEqual,
+ GreaterOrEqual,
+ Equal,
+ NotEqual,
+ LeftParen,
+ RightParen,
+ Dot,
+ Comma,
+ Not,
+ And,
+ Or,
+ Apostrophe,
+
+ LastPunct,
+ Invalid,
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs
new file mode 100644
index 0000000000..5bd8f88fe8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs
@@ -0,0 +1,698 @@
+//
+// DefaultMSBuildEngine.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Xml;
+using System.IO;
+using System.Text;
+using System.Text.RegularExpressions;
+using Microsoft.Build.BuildEngine;
+using MonoDevelop.Core;
+using MonoDevelop.Projects.MSBuild.Conditions;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ class DefaultMSBuildEngine: MSBuildEngine
+ {
+ Dictionary<FilePath, LoadedProjectInfo> loadedProjects = new Dictionary<FilePath, LoadedProjectInfo> ();
+
+ class LoadedProjectInfo
+ {
+ public MSBuildProject Project;
+ public DateTime LastWriteTime;
+ public int ReferenceCount;
+ }
+
+ class ProjectInfo
+ {
+ public MSBuildProject Project;
+ public List<MSBuildItemEvaluated> EvaluatedItemsIgnoringCondition = new List<MSBuildItemEvaluated> ();
+ public List<MSBuildItemEvaluated> EvaluatedItems = new List<MSBuildItemEvaluated> ();
+ public Dictionary<string,PropertyInfo> Properties = new Dictionary<string, PropertyInfo> ();
+ public Dictionary<MSBuildImport,string> Imports = new Dictionary<MSBuildImport, string> ();
+ public Dictionary<string,string> GlobalProperties = new Dictionary<string, string> ();
+ public List<MSBuildTarget> Targets = new List<MSBuildTarget> ();
+ public List<MSBuildTarget> TargetsIgnoringCondition = new List<MSBuildTarget> ();
+ public List<MSBuildProject> ReferencedProjects = new List<MSBuildProject> ();
+ public Dictionary<MSBuildImport, List<ProjectInfo>> ImportedProjects = new Dictionary<MSBuildImport, List<ProjectInfo>> ();
+ public ConditionedPropertyCollection ConditionedProperties = new ConditionedPropertyCollection ();
+ }
+
+ class PropertyInfo
+ {
+ public string Name;
+ public string Value;
+ public string FinalValue;
+ public bool IsImported;
+ }
+
+ #region implemented abstract members of MSBuildEngine
+
+ public DefaultMSBuildEngine (MSBuildEngineManager manager): base (manager)
+ {
+ }
+
+ public override object LoadProject (MSBuildProject project, string xml, FilePath fileName)
+ {
+ return project;
+ }
+
+ public override void UnloadProject (object project)
+ {
+ }
+
+ MSBuildProject LoadProject (FilePath fileName)
+ {
+ fileName = fileName.CanonicalPath;
+ lock (loadedProjects) {
+ LoadedProjectInfo pi;
+ if (loadedProjects.TryGetValue (fileName, out pi)) {
+ pi.ReferenceCount++;
+ var lastWriteTime = File.GetLastWriteTime (fileName);
+ if (pi.LastWriteTime != lastWriteTime) {
+ pi.LastWriteTime = lastWriteTime;
+ pi.Project.Load (fileName, new MSBuildXmlReader { ForEvaluation = true });
+ }
+ return pi.Project;
+ }
+ MSBuildProject p = new MSBuildProject (EngineManager);
+ p.Load (fileName, new MSBuildXmlReader { ForEvaluation = true });
+ loadedProjects [fileName] = new LoadedProjectInfo { Project = p, LastWriteTime = File.GetLastWriteTime (fileName) };
+ //Console.WriteLine ("Loaded: " + fileName);
+ return p;
+ }
+ }
+
+ void UnloadProject (MSBuildProject project)
+ {
+ var fileName = project.FileName.CanonicalPath;
+ lock (loadedProjects) {
+ LoadedProjectInfo pi;
+ if (loadedProjects.TryGetValue (fileName, out pi)) {
+ pi.ReferenceCount--;
+ if (pi.ReferenceCount == 0) {
+ loadedProjects.Remove (fileName);
+ project.Dispose ();
+ //Console.WriteLine ("Unloaded: " + fileName);
+ }
+ }
+ }
+ }
+
+ public override object CreateProjectInstance (object project)
+ {
+ var pi = new ProjectInfo {
+ Project = (MSBuildProject) project
+ };
+ return pi;
+ }
+
+ public override void DisposeProjectInstance (object projectInstance)
+ {
+ var pi = (ProjectInfo) projectInstance;
+ foreach (var p in pi.ReferencedProjects)
+ UnloadProject (p);
+ }
+
+ public override void Evaluate (object projectInstance)
+ {
+ var pi = (ProjectInfo) projectInstance;
+
+ pi.EvaluatedItemsIgnoringCondition.Clear ();
+ pi.EvaluatedItems.Clear ();
+ pi.Properties.Clear ();
+ pi.Imports.Clear ();
+ pi.Targets.Clear ();
+ pi.TargetsIgnoringCondition.Clear ();
+
+ // Unload referenced projects after evaluating to avoid unnecessary unload + load
+ var oldRefProjects = pi.ReferencedProjects;
+ pi.ReferencedProjects = new List<MSBuildProject> ();
+
+ try {
+ var context = new MSBuildEvaluationContext ();
+ foreach (var p in pi.GlobalProperties) {
+ context.SetPropertyValue (p.Key, p.Value);
+ pi.Properties [p.Key] = new PropertyInfo { Name = p.Key, Value = p.Value, FinalValue = p.Value };
+ }
+ EvaluateProject (pi, context);
+ }
+ finally {
+ foreach (var p in oldRefProjects)
+ UnloadProject (p);
+ DisposeImportedProjects (pi);
+ pi.ImportedProjects.Clear ();
+ }
+ }
+
+ void EvaluateProject (ProjectInfo pi, MSBuildEvaluationContext context)
+ {
+ context.InitEvaluation (pi.Project);
+ EvaluateObjects (pi, context, pi.Project.GetAllObjects (), false);
+ EvaluateObjects (pi, context, pi.Project.GetAllObjects (), true);
+ }
+
+ void EvaluateProject (ProjectInfo pi, MSBuildEvaluationContext context, bool evalItems)
+ {
+ // XmlDocument is not thread safe, so we need to lock while evaluating
+ context.InitEvaluation (pi.Project);
+ EvaluateObjects (pi, context, pi.Project.GetAllObjects (), evalItems);
+ }
+
+ void EvaluateObjects (ProjectInfo pi, MSBuildEvaluationContext context, IEnumerable<MSBuildObject> objects, bool evalItems)
+ {
+ foreach (var ob in objects) {
+ if (evalItems) {
+ if (ob is MSBuildItemGroup)
+ Evaluate (pi, context, (MSBuildItemGroup)ob);
+ else if (ob is MSBuildTarget)
+ Evaluate (pi, context, (MSBuildTarget)ob);
+ } else {
+ if (ob is MSBuildPropertyGroup)
+ Evaluate (pi, context, (MSBuildPropertyGroup)ob);
+ }
+ if (ob is MSBuildImportGroup)
+ Evaluate (pi, context, (MSBuildImportGroup)ob, evalItems);
+ else if (ob is MSBuildImport)
+ Evaluate (pi, context, (MSBuildImport)ob, evalItems);
+ else if (ob is MSBuildChoose)
+ Evaluate (pi, context, (MSBuildChoose)ob, evalItems);
+ }
+ }
+
+ void Evaluate (ProjectInfo project, MSBuildEvaluationContext context, MSBuildPropertyGroup group)
+ {
+ if (!string.IsNullOrEmpty (group.Condition) && !SafeParseAndEvaluate (project, context, group.Condition, true))
+ return;
+
+ foreach (var prop in group.GetProperties ())
+ Evaluate (project, context, prop);
+ }
+
+ void Evaluate (ProjectInfo project, MSBuildEvaluationContext context, MSBuildItemGroup items)
+ {
+ bool conditionIsTrue = true;
+
+ if (!string.IsNullOrEmpty (items.Condition))
+ conditionIsTrue = SafeParseAndEvaluate (project, context, items.Condition);
+
+ foreach (var item in items.Items) {
+
+ var include = context.EvaluateString (item.Include);
+ var exclude = context.EvaluateString (item.Exclude);
+
+ var it = CreateEvaluatedItem (context, project, project.Project, item, include);
+
+ var trueCond = conditionIsTrue && (string.IsNullOrEmpty (it.Condition) || SafeParseAndEvaluate (project, context, it.Condition));
+
+ var excludeRegex = !string.IsNullOrEmpty (exclude) ? new Regex (ExcludeToRegex (exclude)) : null;
+
+ if (it.Include.IndexOf (';') == -1)
+ AddItem (project, context, item, it, it.Include, excludeRegex, trueCond);
+ else {
+ foreach (var inc in it.Include.Split (new [] {';'}, StringSplitOptions.RemoveEmptyEntries))
+ AddItem (project, context, item, it, inc, excludeRegex, trueCond);
+ }
+ }
+ }
+
+ static void AddItem (ProjectInfo project, MSBuildEvaluationContext context, MSBuildItem item, MSBuildItemEvaluated it, string include, Regex excludeRegex, bool trueCond)
+ {
+ if (include.IndexOf ('*') != -1) {
+ var path = include;
+ if (path == "**" || path.EndsWith ("\\**"))
+ path = path + "/*";
+ var subpath = path.Split ('\\');
+ foreach (var eit in ExpandWildcardFilePath (project, project.Project, context, item, project.Project.BaseDirectory, FilePath.Null, false, subpath, 0)) {
+ if (excludeRegex != null && excludeRegex.IsMatch (eit.Include))
+ continue;
+ project.EvaluatedItemsIgnoringCondition.Add (eit);
+ if (trueCond)
+ project.EvaluatedItems.Add (eit);
+ }
+ }
+ else if (include != it.Include) {
+ if (excludeRegex != null && excludeRegex.IsMatch (include))
+ return;
+ it = CreateEvaluatedItem (context, project, project.Project, item, include);
+ project.EvaluatedItemsIgnoringCondition.Add (it);
+ if (trueCond)
+ project.EvaluatedItems.Add (it);
+ }
+ else {
+ if (excludeRegex != null && excludeRegex.IsMatch (include))
+ return;
+ project.EvaluatedItemsIgnoringCondition.Add (it);
+ if (trueCond)
+ project.EvaluatedItems.Add (it);
+ }
+ }
+
+ void Evaluate (ProjectInfo project, MSBuildEvaluationContext context, MSBuildImportGroup imports, bool evalItems)
+ {
+ if (!string.IsNullOrEmpty (imports.Condition) && !SafeParseAndEvaluate (project, context, imports.Condition, true))
+ return;
+
+ foreach (var item in imports.Imports)
+ Evaluate (project, context, item, evalItems);
+ }
+
+ static IEnumerable<MSBuildItemEvaluated> ExpandWildcardFilePath (ProjectInfo pinfo, MSBuildProject project, MSBuildEvaluationContext context, MSBuildItem sourceItem, FilePath basePath, FilePath baseRecursiveDir, bool recursive, string[] filePath, int index)
+ {
+ var res = Enumerable.Empty<MSBuildItemEvaluated> ();
+
+ if (index >= filePath.Length)
+ return res;
+
+ var path = filePath [index];
+
+ if (path == "..")
+ return ExpandWildcardFilePath (pinfo, project, context, sourceItem, basePath.ParentDirectory, baseRecursiveDir, recursive, filePath, index + 1);
+
+ if (path == ".")
+ return ExpandWildcardFilePath (pinfo, project, context, sourceItem, basePath, baseRecursiveDir, recursive, filePath, index + 1);
+
+ if (!Directory.Exists (basePath))
+ return res;
+
+ if (path == "**") {
+ // if this is the last component of the path, there isn't any file specifier, so there is no possible match
+ if (index + 1 >= filePath.Length)
+ return res;
+
+ // If baseRecursiveDir has already been set, don't overwrite it.
+ if (baseRecursiveDir.IsNullOrEmpty)
+ baseRecursiveDir = basePath;
+
+ return ExpandWildcardFilePath (pinfo, project, context, sourceItem, basePath, baseRecursiveDir, true, filePath, index + 1);
+ }
+
+ if (recursive) {
+ // Recursive search. Try to match the remaining subpath in all subdirectories.
+ foreach (var dir in Directory.GetDirectories (basePath))
+ res = res.Concat (ExpandWildcardFilePath (pinfo, project, context, sourceItem, dir, baseRecursiveDir, true, filePath, index));
+ }
+
+ if (index == filePath.Length - 1) {
+ // Last path component. It has to be a file specifier.
+ string baseDir = basePath.ToRelative (project.BaseDirectory).ToString().Replace ('/','\\');
+ if (baseDir == ".")
+ baseDir = "";
+ else if (!baseDir.EndsWith ("\\", StringComparison.Ordinal))
+ baseDir += '\\';
+ var recursiveDir = baseRecursiveDir.IsNullOrEmpty ? FilePath.Null : basePath.ToRelative (baseRecursiveDir);
+ res = res.Concat (Directory.GetFiles (basePath, path).Select (f => {
+ context.SetItemContext (f, recursiveDir);
+ var ev = baseDir + Path.GetFileName (f);
+ return CreateEvaluatedItem (context, pinfo, project, sourceItem, ev);
+ }));
+ }
+ else {
+ // Directory specifier
+ // Look for matching directories.
+ // The search here is non-recursive, not matter what the 'recursive' parameter says, since we are trying to match a subpath.
+ // The recursive search is done below.
+
+ if (path.IndexOfAny (wildcards) != -1) {
+ foreach (var dir in Directory.GetDirectories (basePath, path))
+ res = res.Concat (ExpandWildcardFilePath (pinfo, project, context, sourceItem, dir, baseRecursiveDir, false, filePath, index + 1));
+ } else
+ res = res.Concat (ExpandWildcardFilePath (pinfo, project, context, sourceItem, basePath.Combine (path), baseRecursiveDir, false, filePath, index + 1));
+ }
+
+ return res;
+ }
+
+ static string ExcludeToRegex (string exclude)
+ {
+ var sb = new StringBuilder ();
+ foreach (var ep in exclude.Split (new char [] { ';' }, StringSplitOptions.RemoveEmptyEntries)) {
+ var ex = ep.Trim ();
+ if (sb.Length > 0)
+ sb.Append ('|');
+ sb.Append ('^');
+ for (int n = 0; n < ex.Length; n++) {
+ var c = ex [n];
+ if (c == '*') {
+ if (n < ex.Length - 1 && ex [n + 1] == '*') {
+ if (n < ex.Length - 2 && ex [n + 2] == '\\') {
+ // zero or more subdirectories
+ sb.Append ("(.*\\\\)?");
+ n += 2;
+ } else {
+ sb.Append (".*");
+ n++;
+ }
+ }
+ else
+ sb.Append ("[^\\\\.]*");
+ } else if (regexEscapeChars.Contains (c)) {
+ sb.Append ('\\').Append (c);
+ } else
+ sb.Append (c);
+ }
+ sb.Append ('$');
+ }
+ return sb.ToString ();
+ }
+
+ static char [] regexEscapeChars = { '\\', '^', '$', '{', '}', '[', ']', '(', ')', '.', '*', '+', '?', '|', '<', '>', '-', '&' };
+
+ static MSBuildItemEvaluated CreateEvaluatedItem (MSBuildEvaluationContext context, ProjectInfo pinfo, MSBuildProject project, MSBuildItem sourceItem, string include)
+ {
+ var it = new MSBuildItemEvaluated (project, sourceItem.Name, sourceItem.Include, include);
+ var md = new Dictionary<string,IMSBuildPropertyEvaluated> ();
+ foreach (var c in sourceItem.Metadata.GetProperties ()) {
+ if (string.IsNullOrEmpty (c.Condition) || SafeParseAndEvaluate (pinfo, context, c.Condition, true))
+ md [c.Name] = new MSBuildPropertyEvaluated (project, c.Name, c.Value, context.EvaluateString (c.Value));
+ }
+ ((MSBuildPropertyGroupEvaluated)it.Metadata).SetProperties (md);
+ it.SourceItem = sourceItem;
+ it.Condition = sourceItem.Condition;
+ return it;
+ }
+
+ static char[] wildcards = { '*', '%' };
+
+ void Evaluate (ProjectInfo project, MSBuildEvaluationContext context, MSBuildProperty prop)
+ {
+ if (string.IsNullOrEmpty (prop.Condition) || SafeParseAndEvaluate (project, context, prop.Condition, true)) {
+ var val = context.EvaluateString (prop.Value);
+ project.Properties [prop.Name] = new PropertyInfo { Name = prop.Name, Value = prop.Value, FinalValue = val };
+ context.SetPropertyValue (prop.Name, val);
+ }
+ }
+
+ MSBuildItemEvaluated Evaluate (ProjectInfo project, MSBuildEvaluationContext context, MSBuildItem item)
+ {
+ return CreateEvaluatedItem (context, project, project.Project, item, context.EvaluateString (item.Include));
+ }
+
+ IEnumerable<ProjectInfo> GetImportedProjects (ProjectInfo project, MSBuildImport import)
+ {
+ List<ProjectInfo> prefProjects;
+ if (project.ImportedProjects.TryGetValue (import, out prefProjects))
+ return prefProjects;
+ return Enumerable.Empty<ProjectInfo> ();
+ }
+
+ void AddImportedProject (ProjectInfo project, MSBuildImport import, ProjectInfo imported)
+ {
+ List<ProjectInfo> prefProjects;
+ if (!project.ImportedProjects.TryGetValue (import, out prefProjects))
+ project.ImportedProjects [import] = prefProjects = new List<ProjectInfo> ();
+ prefProjects.Add (imported);
+ }
+
+ void DisposeImportedProjects (ProjectInfo pi)
+ {
+ foreach (var imported in pi.ImportedProjects.Values.SelectMany (i => i)) {
+ DisposeImportedProjects (imported);
+ DisposeProjectInstance (imported);
+ }
+ }
+
+ void Evaluate (ProjectInfo project, MSBuildEvaluationContext context, MSBuildImport import, bool evalItems)
+ {
+ if (evalItems) {
+ // Properties have already been evaluated
+ // Don't evaluate properties, only items and other elements
+ foreach (var p in GetImportedProjects (project, import)) {
+
+ EvaluateProject (p, new MSBuildEvaluationContext (context), true);
+
+ foreach (var it in p.EvaluatedItems) {
+ it.IsImported = true;
+ project.EvaluatedItems.Add (it);
+ }
+ foreach (var it in p.EvaluatedItemsIgnoringCondition) {
+ it.IsImported = true;
+ project.EvaluatedItemsIgnoringCondition.Add (it);
+ }
+ foreach (var t in p.Targets) {
+ t.IsImported = true;
+ project.Targets.Add (t);
+ }
+ foreach (var t in p.TargetsIgnoringCondition) {
+ t.IsImported = true;
+ project.TargetsIgnoringCondition.Add (t);
+ }
+ project.ConditionedProperties.Append (p.ConditionedProperties);
+ }
+ return;
+ }
+
+ // For some reason, Mono can have several extension paths, so we need to try each of them
+ foreach (var ep in MSBuildEvaluationContext.GetApplicableExtensionsPaths ()) {
+ var files = GetImportFiles (project, context, import, ep);
+ if (files == null || files.Length == 0)
+ continue;
+ foreach (var f in files)
+ ImportFile (project, context, import, f);
+ return;
+ }
+
+ // No import was found
+ }
+
+ string[] GetImportFiles (ProjectInfo project, MSBuildEvaluationContext context, MSBuildImport import, string extensionsPath)
+ {
+ if (extensionsPath != null) {
+ var tempCtx = new MSBuildEvaluationContext (context);
+ var mep = MSBuildProjectService.ToMSBuildPath (null, extensionsPath);
+ tempCtx.SetPropertyValue ("MSBuildExtensionsPath", mep);
+ tempCtx.SetPropertyValue ("MSBuildExtensionsPath32", mep);
+ tempCtx.SetPropertyValue ("MSBuildExtensionsPath64", mep);
+ context = tempCtx;
+ }
+
+ var pr = context.EvaluateString (import.Project);
+ project.Imports [import] = pr;
+
+ if (!string.IsNullOrEmpty (import.Condition) && !SafeParseAndEvaluate (project, context, import.Condition, true))
+ return null;
+
+ var path = MSBuildProjectService.FromMSBuildPath (project.Project.BaseDirectory, pr);
+ var fileName = Path.GetFileName (path);
+
+ if (fileName.IndexOfAny (new [] { '*', '?' }) == -1) {
+ return File.Exists (path) ? new [] { path } : null;
+ }
+ else {
+ path = Path.GetDirectoryName (path);
+ if (!Directory.Exists (path))
+ return null;
+ var files = Directory.GetFiles (path, fileName);
+ Array.Sort (files);
+ return files;
+ }
+ }
+
+ void ImportFile (ProjectInfo project, MSBuildEvaluationContext context, MSBuildImport import, string file)
+ {
+ if (!File.Exists (file))
+ return;
+
+ var pref = LoadProject (file);
+ project.ReferencedProjects.Add (pref);
+
+ var prefProject = new ProjectInfo { Project = pref };
+ AddImportedProject (project, import, prefProject);
+
+ var refCtx = new MSBuildEvaluationContext (context);
+
+ EvaluateProject (prefProject, refCtx, false);
+
+ foreach (var p in prefProject.Properties) {
+ p.Value.IsImported = true;
+ project.Properties [p.Key] = p.Value;
+ }
+ }
+
+ void Evaluate (ProjectInfo project, MSBuildEvaluationContext context, MSBuildChoose choose, bool evalItems)
+ {
+ foreach (var op in choose.GetOptions ()) {
+ if (op.IsOtherwise || SafeParseAndEvaluate (project, context, op.Condition, true)) {
+ EvaluateObjects (project, context, op.GetAllObjects (), evalItems);
+ break;
+ }
+ }
+ }
+
+ void Evaluate (ProjectInfo project, MSBuildEvaluationContext context, MSBuildTarget target)
+ {
+ bool condIsTrue = SafeParseAndEvaluate (project, context, target.Condition);
+ var newTarget = new MSBuildTarget (target.Name, target.Tasks);
+ newTarget.AfterTargets = context.EvaluateString (target.AfterTargets);
+ newTarget.Inputs = context.EvaluateString (target.Inputs);
+ newTarget.Outputs = context.EvaluateString (target.Outputs);
+ newTarget.BeforeTargets = context.EvaluateString (target.BeforeTargets);
+ newTarget.DependsOnTargets = context.EvaluateString (target.DependsOnTargets);
+ newTarget.Returns = context.EvaluateString (target.Returns);
+ newTarget.KeepDuplicateOutputs = context.EvaluateString (target.KeepDuplicateOutputs);
+ project.TargetsIgnoringCondition.Add (newTarget);
+ if (condIsTrue)
+ project.Targets.Add (newTarget);
+ }
+
+ static bool SafeParseAndEvaluate (ProjectInfo project, MSBuildEvaluationContext context, string condition, bool collectConditionedProperties = false)
+ {
+ try {
+ if (String.IsNullOrEmpty (condition))
+ return true;
+
+ try {
+ ConditionExpression ce = ConditionParser.ParseCondition (condition);
+
+ if (!ce.CanEvaluateToBool (context))
+ throw new InvalidProjectFileException (String.Format ("Can not evaluate \"{0}\" to bool.", condition));
+
+ if (collectConditionedProperties)
+ ce.CollectConditionProperties (project.ConditionedProperties);
+
+ return ce.BoolEvaluate (context);
+ } catch (ExpressionParseException epe) {
+ throw new InvalidProjectFileException (
+ String.Format ("Unable to parse condition \"{0}\" : {1}", condition, epe.Message),
+ epe);
+ } catch (ExpressionEvaluationException epe) {
+ throw new InvalidProjectFileException (
+ String.Format ("Unable to evaluate condition \"{0}\" : {1}", condition, epe.Message),
+ epe);
+ }
+ }
+ catch {
+ // The condition is likely to be invalid
+ return false;
+ }
+ }
+
+ public override bool GetItemHasMetadata (object item, string name)
+ {
+ var it = item as MSBuildItem;
+ if (it != null)
+ return it.Metadata.HasProperty (name);
+ return ((IMSBuildItemEvaluated) item).Metadata.HasProperty (name);
+ }
+
+ public override string GetItemMetadata (object item, string name)
+ {
+ var it = item as MSBuildItem;
+ if (it != null)
+ return it.Metadata.GetValue (name);
+ return ((IMSBuildItemEvaluated)item).Metadata.GetValue (name);
+ }
+
+ public override string GetEvaluatedItemMetadata (object item, string name)
+ {
+ IMSBuildItemEvaluated it = (IMSBuildItemEvaluated) item;
+ return it.Metadata.GetValue (name);
+ }
+
+ public override IEnumerable<object> GetImports (object projectInstance)
+ {
+ return ((ProjectInfo)projectInstance).Project.Imports;
+ }
+
+ public override string GetImportEvaluatedProjectPath (object projectInstance, object import)
+ {
+ return ((ProjectInfo)projectInstance).Imports [(MSBuildImport)import];
+ }
+
+ public override IEnumerable<object> GetEvaluatedItems (object projectInstance)
+ {
+ return ((ProjectInfo)projectInstance).EvaluatedItems;
+ }
+
+ public override IEnumerable<object> GetEvaluatedItemsIgnoringCondition (object projectInstance)
+ {
+ return ((ProjectInfo)projectInstance).EvaluatedItemsIgnoringCondition;
+ }
+
+ public override IEnumerable<object> GetEvaluatedProperties (object projectInstance)
+ {
+ return ((ProjectInfo)projectInstance).Properties.Values;
+ }
+
+ public override void GetItemInfo (object item, out string name, out string include, out string finalItemSpec, out bool imported)
+ {
+ var it = (MSBuildItem) item;
+ name = it.Name;
+ include = it.Include;
+ finalItemSpec = it.Include;
+ imported = it.IsImported;
+ }
+
+ public override void GetEvaluatedItemInfo (object item, out string name, out string include, out string finalItemSpec, out bool imported)
+ {
+ var it = (IMSBuildItemEvaluated) item;
+ name = it.Name;
+ include = it.Include;
+ finalItemSpec = it.Include;
+ imported = it.IsImported;
+ }
+
+ public override void GetPropertyInfo (object property, out string name, out string value, out string finalValue)
+ {
+ var prop = (PropertyInfo)property;
+ name = prop.Name;
+ value = prop.Value;
+ finalValue = prop.FinalValue;
+ }
+
+ public override IEnumerable<MSBuildTarget> GetTargets (object projectInstance)
+ {
+ return ((ProjectInfo)projectInstance).Targets;
+ }
+
+ public override IEnumerable<MSBuildTarget> GetTargetsIgnoringCondition (object projectInstance)
+ {
+ return ((ProjectInfo)projectInstance).TargetsIgnoringCondition;
+ }
+
+ public override void SetGlobalProperty (object projectInstance, string property, string value)
+ {
+ var pi = (ProjectInfo)projectInstance;
+ pi.GlobalProperties [property] = value;
+ }
+
+ public override void RemoveGlobalProperty (object projectInstance, string property)
+ {
+ var pi = (ProjectInfo)projectInstance;
+ pi.GlobalProperties.Remove (property);
+ }
+
+ public override ConditionedPropertyCollection GetConditionedProperties (object projectInstance)
+ {
+ var pi = (ProjectInfo)projectInstance;
+ return pi.ConditionedProperties;
+ }
+
+ #endregion
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/EscapingUtilities.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/EscapingUtilities.cs
new file mode 100644
index 0000000000..94a180f36d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/EscapingUtilities.cs
@@ -0,0 +1,296 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Text;
+
+namespace Microsoft.Build.Shared
+{
+ /// <summary>
+ /// This class implements static methods to assist with unescaping of %XX codes
+ /// in the MSBuild file format.
+ /// </summary>
+ /// <remarks>
+ /// PERF: since we escape and unescape relatively frequently, it may be worth caching
+ /// the last N strings that were (un)escaped
+ /// </remarks>
+ static internal class EscapingUtilities
+ {
+ /// <summary>
+ /// Optional cache of escaped strings for use when needing to escape in performance-critical scenarios with significant
+ /// expected string reuse.
+ /// </summary>
+ private static Dictionary<string, string> s_unescapedToEscapedStrings = new Dictionary<string, string>(StringComparer.Ordinal);
+
+ /// <summary>
+ /// Replaces all instances of %XX in the input string with the character represented
+ /// by the hexadecimal number XX.
+ /// </summary>
+ /// <param name="escapedString">The string to unescape.</param>
+ /// <returns>unescaped string</returns>
+ internal static string UnescapeAll
+ (
+ string escapedString
+ )
+ {
+ bool throwAwayBool;
+ return UnescapeAll(escapedString, out throwAwayBool);
+ }
+
+ /// <summary>
+ /// Replaces all instances of %XX in the input string with the character represented
+ /// by the hexadecimal number XX.
+ /// </summary>
+ /// <param name="escapedString">The string to unescape.</param>
+ /// <param name="escapingWasNecessary">Whether any replacements were made.</param>
+ /// <returns>unescaped string</returns>
+ internal static string UnescapeAll
+ (
+ string escapedString,
+ out bool escapingWasNecessary
+ )
+ {
+ escapingWasNecessary = false;
+
+ // If the string doesn't contain anything, then by definition it doesn't
+ // need unescaping.
+ if (String.IsNullOrEmpty(escapedString))
+ {
+ return escapedString;
+ }
+
+ // If there are no percent signs, just return the original string immediately.
+ // Don't even instantiate the StringBuilder.
+ int indexOfPercent = escapedString.IndexOf('%');
+ if (indexOfPercent == -1)
+ {
+ return escapedString;
+ }
+
+ // This is where we're going to build up the final string to return to the caller.
+ StringBuilder unescapedString = new StringBuilder (escapedString.Length);
+
+ int currentPosition = 0;
+
+ // Loop until there are no more percent signs in the input string.
+ while (indexOfPercent != -1)
+ {
+ // There must be two hex characters following the percent sign
+ // for us to even consider doing anything with this.
+ if (
+ (indexOfPercent <= (escapedString.Length - 3)) &&
+ Uri.IsHexDigit(escapedString[indexOfPercent + 1]) &&
+ Uri.IsHexDigit(escapedString[indexOfPercent + 2])
+ )
+ {
+ // First copy all the characters up to the current percent sign into
+ // the destination.
+ unescapedString.Append(escapedString, currentPosition, indexOfPercent - currentPosition);
+
+ // Convert the %XX to an actual real character.
+ string hexString = escapedString.Substring(indexOfPercent + 1, 2);
+ char unescapedCharacter = (char)int.Parse(hexString, System.Globalization.NumberStyles.HexNumber,
+ CultureInfo.InvariantCulture);
+
+ // if the unescaped character is not on the exception list, append it
+ unescapedString.Append(unescapedCharacter);
+
+ // Advance the current pointer to reflect the fact that the destination string
+ // is up to date with everything up to and including this escape code we just found.
+ currentPosition = indexOfPercent + 3;
+
+ escapingWasNecessary = true;
+ }
+
+ // Find the next percent sign.
+ indexOfPercent = escapedString.IndexOf('%', indexOfPercent + 1);
+ }
+
+ // Okay, there are no more percent signs in the input string, so just copy the remaining
+ // characters into the destination.
+ unescapedString.Append(escapedString, currentPosition, escapedString.Length - currentPosition);
+
+ return unescapedString.ToString ();
+ }
+
+
+ /// <summary>
+ /// Adds instances of %XX in the input string where the char char to be escaped appears
+ /// XX is the hex value of the ASCII code for the char. Interns and caches the result.
+ /// </summary>
+ /// <comment>
+ /// NOTE: Only recommended for use in scenarios where there's expected to be significant
+ /// repetition of the escaped string. Cache currently grows unbounded.
+ /// </comment>
+ internal static string EscapeWithCaching(string unescapedString)
+ {
+ return EscapeWithOptionalCaching(unescapedString, cache: true);
+ }
+
+ /// <summary>
+ /// Adds instances of %XX in the input string where the char char to be escaped appears
+ /// XX is the hex value of the ASCII code for the char.
+ /// </summary>
+ /// <param name="unescapedString">The string to escape.</param>
+ /// <returns>escaped string</returns>
+ internal static string Escape(string unescapedString)
+ {
+ return EscapeWithOptionalCaching(unescapedString, cache: false);
+ }
+
+ /// <summary>
+ /// Adds instances of %XX in the input string where the char char to be escaped appears
+ /// XX is the hex value of the ASCII code for the char. Caches if requested.
+ /// </summary>
+ /// <param name="unescapedString">The string to escape.</param>
+ /// <param name="cache">
+ /// True if the cache should be checked, and if the resultant string
+ /// should be cached.
+ /// </param>
+ private static string EscapeWithOptionalCaching(string unescapedString, bool cache)
+ {
+ // If there are no special chars, just return the original string immediately.
+ // Don't even instantiate the StringBuilder.
+ if (String.IsNullOrEmpty(unescapedString) || !ContainsReservedCharacters(unescapedString))
+ {
+ return unescapedString;
+ }
+
+ // next, if we're caching, check to see if it's already there.
+ if (cache)
+ {
+ string cachedEscapedString = null;
+ lock (s_unescapedToEscapedStrings)
+ {
+ if (s_unescapedToEscapedStrings.TryGetValue(unescapedString, out cachedEscapedString))
+ {
+ return cachedEscapedString;
+ }
+ }
+ }
+
+ // This is where we're going to build up the final string to return to the caller.
+ StringBuilder escapedStringBuilder = new StringBuilder (unescapedString.Length * 2);
+
+ AppendEscapedString(escapedStringBuilder, unescapedString);
+
+ if (!cache)
+ {
+ return escapedStringBuilder.ToString ();
+ }
+
+ string escapedString = escapedStringBuilder.ToString ();
+
+ lock (s_unescapedToEscapedStrings)
+ {
+ s_unescapedToEscapedStrings[unescapedString] = escapedString;
+ }
+
+ return escapedString;
+ }
+
+ /// <summary>
+ /// Before trying to actually escape the string, it can be useful to call this method to determine
+ /// if escaping is necessary at all. This can save lots of calls to copy around item metadata
+ /// that is really the same whether escaped or not.
+ /// </summary>
+ /// <param name="unescapedString"></param>
+ /// <returns></returns>
+ private static bool ContainsReservedCharacters
+ (
+ string unescapedString
+ )
+ {
+ return (-1 != unescapedString.IndexOfAny(s_charsToEscape));
+ }
+
+ /// <summary>
+ /// Determines whether the string contains the escaped form of '*' or '?'.
+ /// </summary>
+ /// <param name="escapedString"></param>
+ /// <returns></returns>
+ internal static bool ContainsEscapedWildcards
+ (
+ string escapedString
+ )
+ {
+ if (-1 != escapedString.IndexOf('%'))
+ {
+ // It has a '%' sign. We have promise.
+ if (
+ (-1 != escapedString.IndexOf("%2", StringComparison.Ordinal)) ||
+ (-1 != escapedString.IndexOf("%3", StringComparison.Ordinal))
+ )
+ {
+ // It has either a '%2' or a '%3'. This is looking very promising.
+ return
+ (
+ (-1 != escapedString.IndexOf("%2a", StringComparison.Ordinal)) ||
+ (-1 != escapedString.IndexOf("%2A", StringComparison.Ordinal)) ||
+ (-1 != escapedString.IndexOf("%3f", StringComparison.Ordinal)) ||
+ (-1 != escapedString.IndexOf("%3F", StringComparison.Ordinal))
+ );
+ }
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// Convert the given integer into its hexadecimal representation.
+ /// </summary>
+ /// <param name="x">The number to convert, which must be non-negative and less than 16</param>
+ /// <returns>The character which is the hexadecimal representation of <paramref name="x"/>.</returns>
+ private static char HexDigitChar(int x)
+ {
+ return (char)(x + (x < 10 ? '0' : ('a' - 10)));
+ }
+
+ /// <summary>
+ /// Append the escaped version of the given character to a <see cref="StringBuilder"/>.
+ /// </summary>
+ /// <param name="sb">The <see cref="StringBuilder"/> to which to append.</param>
+ /// <param name="ch">The character to escape.</param>
+ private static void AppendEscapedChar(StringBuilder sb, char ch)
+ {
+ // Append the escaped version which is a percent sign followed by two hexadecimal digits
+ sb.Append('%');
+ sb.Append(HexDigitChar(ch / 0x10));
+ sb.Append(HexDigitChar(ch & 0x0F));
+ }
+
+ /// <summary>
+ /// Append the escaped version of the given string to a <see cref="StringBuilder"/>.
+ /// </summary>
+ /// <param name="sb">The <see cref="StringBuilder"/> to which to append.</param>
+ /// <param name="unescapedString">The unescaped string.</param>
+ private static void AppendEscapedString(StringBuilder sb, string unescapedString)
+ {
+ // Replace each unescaped special character with an escape sequence one
+ for (int idx = 0; ;)
+ {
+ int nextIdx = unescapedString.IndexOfAny(s_charsToEscape, idx);
+ if (nextIdx == -1)
+ {
+ sb.Append(unescapedString, idx, unescapedString.Length - idx);
+ break;
+ }
+
+ sb.Append(unescapedString, idx, nextIdx - idx);
+ AppendEscapedChar(sb, unescapedString[nextIdx]);
+ idx = nextIdx + 1;
+ }
+ }
+
+ /// <summary>
+ /// Special characters that need escaping.
+ /// It's VERY important that the percent character is the FIRST on the list - since it's both a character
+ /// we escape and use in escape sequences, we can unintentionally escape other escape sequences if we
+ /// don't process it first. Of course we'll have a similar problem if we ever decide to escape hex digits
+ /// (that would require rewriting the algorithm) but since it seems unlikely that we ever do, this should
+ /// be good enough to avoid complicating the algorithm at this point.
+ /// </summary>
+ private static readonly char[] s_charsToEscape = { '%', '*', '?', '@', '$', '(', ')', ';', '\'' };
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/FileUtil.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/FileUtil.cs
new file mode 100644
index 0000000000..00d87ca022
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/FileUtil.cs
@@ -0,0 +1,98 @@
+//
+// FileUtil.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.IO;
+using MonoDevelop.Projects.Utility;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ static class FileUtil
+ {
+ public static TextFormatInfo GetTextFormatInfo (string file)
+ {
+ var info = new TextFormatInfo ();
+
+ string newLine = null;
+ ByteOrderMark bom;
+
+ using (FileStream fs = File.OpenRead (file)) {
+ byte[] buf = new byte [1024];
+ int nread, i;
+
+ if ((nread = fs.Read (buf, 0, buf.Length)) <= 0)
+ return info;
+
+ if (ByteOrderMark.TryParse (buf, nread, out bom))
+ i = bom.Length;
+ else
+ i = 0;
+
+ do {
+ // Read to the first newline to figure out which line endings this file is using
+ while (i < nread) {
+ if (buf[i] == '\r') {
+ newLine = "\r\n";
+ break;
+ } else if (buf[i] == '\n') {
+ newLine = "\n";
+ break;
+ }
+
+ i++;
+ }
+
+ if (newLine == null) {
+ if ((nread = fs.Read (buf, 0, buf.Length)) <= 0) {
+ newLine = "\n";
+ break;
+ }
+
+ i = 0;
+ }
+ } while (newLine == null);
+
+ // Check for a blank line at the end
+ info.EndsWithEmptyLine = fs.Seek (-1, SeekOrigin.End) > 0 && fs.ReadByte () == (int) '\n';
+ info.NewLine = newLine;
+ info.ByteOrderMark = bom;
+ return info;
+ }
+ }
+ }
+
+ class TextFormatInfo
+ {
+ public TextFormatInfo ()
+ {
+ NewLine = Environment.NewLine;
+ }
+
+ public string NewLine { get; set; }
+ public ByteOrderMark ByteOrderMark { get; set; }
+ public bool EndsWithEmptyLine { get; set; }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMSBuildGlobalPropertyProvider.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMSBuildGlobalPropertyProvider.cs
new file mode 100644
index 0000000000..3297443bdf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMSBuildGlobalPropertyProvider.cs
@@ -0,0 +1,36 @@
+//
+// IMSBuildGlobalPropertyProvider.cs
+//
+// Author:
+// Michael Hutchinson <m.j.hutchinson@gmail.com>
+//
+// Copyright (c) 2014 Xamarin Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public interface IMSBuildGlobalPropertyProvider
+ {
+ event EventHandler GlobalPropertiesChanged;
+ IDictionary<string,string> GetGlobalProperties ();
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMSBuildProject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMSBuildProject.cs
new file mode 100644
index 0000000000..a43393337c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMSBuildProject.cs
@@ -0,0 +1,519 @@
+//
+// IMSBuildProject.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core;
+using System.Collections.Generic;
+using System.Xml;
+using System.Xml.Linq;
+using System.Linq;
+
+namespace MonoDevelop.Projects.Formats.MSBuildInternal
+{
+ public abstract class MSBuildProject
+ {
+ Dictionary<object,Dictionary<Type,IMSBuildDataObject>> customDataObjects = new Dictionary<object,Dictionary<Type,IMSBuildDataObject>> ();
+ Dictionary<string, MSBuildItemGroup> bestGroups;
+
+ public abstract FilePath FileName { get; }
+
+ public FilePath BaseDirectory {
+ get { return FileName.ParentDirectory; }
+ }
+
+ public abstract void Load (FilePath file);
+
+ public abstract void Save (string fileName);
+
+ public abstract string SaveToString ();
+
+ public MonoDevelop.Projects.Formats.MSBuild.MSBuildFileFormat Format {
+ get;
+ set;
+ }
+
+ public abstract string DefaultTargets { get; set; }
+
+ public abstract string ToolsVersion { get; set; }
+
+ public T GetObject<T> () where T : IMSBuildDataObject, new()
+ {
+ return GetObject<T> (this);
+ }
+
+ public void SetObject<T> (T t) where T : IMSBuildDataObject
+ {
+ SetObject<T> (this, t);
+ }
+
+ internal T GetObject<T> (object owner) where T : IMSBuildDataObject, new()
+ {
+ Dictionary<Type,IMSBuildDataObject> col;
+ if (!customDataObjects.TryGetValue (owner, out col))
+ return default(T);
+ IMSBuildDataObject res;
+ col.TryGetValue (typeof(T), out res);
+ return (T)res;
+ }
+
+ internal void SetObject<T> (object owner, T t) where T : IMSBuildDataObject
+ {
+ Dictionary<Type,IMSBuildDataObject> col;
+ if (!customDataObjects.TryGetValue (owner, out col))
+ col = customDataObjects [owner] = new Dictionary<Type, IMSBuildDataObject> ();
+ col [typeof(T)] = t;
+ }
+
+ internal IEnumerable<IMSBuildDataObject> GetDataObjects (object owner)
+ {
+ Dictionary<Type,IMSBuildDataObject> col;
+ if (!customDataObjects.TryGetValue (owner, out col))
+ return new IMSBuildDataObject[0];
+ else
+ return col.Values;
+ }
+
+ public abstract void AddNewImport (string name, MSBuildImport beforeImport = null);
+
+ public abstract void RemoveImport (MSBuildImport import);
+
+ public abstract IEnumerable<MSBuildImport> Imports { get; }
+
+ public MSBuildPropertyGroup GetGlobalPropertyGroup ()
+ {
+ return PropertyGroups.FirstOrDefault (p => string.IsNullOrEmpty (p.Condition));
+ }
+
+ public abstract MSBuildPropertyGroup AddNewPropertyGroup (MSBuildPropertyGroup beforeGroup = null);
+
+ public abstract void RemovePropertyGroup (MSBuildPropertyGroup grp);
+
+ public abstract IEnumerable<MSBuildItem> GetAllItems ();
+
+ public abstract IEnumerable<MSBuildItem> GetAllItems (params string[] names);
+
+ public abstract IEnumerable<MSBuildPropertyGroup> PropertyGroups { get; }
+
+ public abstract IEnumerable<MSBuildItemGroup> ItemGroups { get; }
+
+ public abstract MSBuildItemGroup AddNewItemGroup ();
+
+ public abstract MSBuildItem AddNewItem (string name, string include);
+
+ public MSBuildItemGroup FindBestGroupForItem (string itemName)
+ {
+ MSBuildItemGroup group;
+
+ if (bestGroups == null)
+ bestGroups = new Dictionary<string, MSBuildItemGroup> ();
+ else {
+ if (bestGroups.TryGetValue (itemName, out group))
+ return group;
+ }
+
+ foreach (MSBuildItemGroup grp in ItemGroups) {
+ foreach (MSBuildItem it in grp.Items) {
+ if (it.Name == itemName) {
+ bestGroups [itemName] = grp;
+ return grp;
+ }
+ }
+ }
+ group = AddNewItemGroup ();
+ bestGroups [itemName] = group;
+ return group;
+ }
+
+ public abstract XmlElement GetProjectExtensions (string section);
+
+ public abstract void SetProjectExtensions (string section, string value);
+
+ public abstract void RemoveProjectExtensions (string section);
+
+ public abstract void RemoveItem (MSBuildItem item);
+ }
+
+ public abstract class MSBuildItemGroup
+ {
+ internal MSBuildItemGroup (MSBuildProject parent)
+ {
+ Project = parent;
+ }
+
+ public abstract MSBuildItem AddNewItem (string name, string include);
+
+ public abstract IEnumerable<MSBuildItem> Items { get; }
+
+ public MSBuildProject Project { get; private set; }
+ }
+
+ public abstract class MSBuildPropertyGroup: MSBuildPropertySet
+ {
+ MSBuildProject project;
+
+ internal MSBuildPropertyGroup (MSBuildProject project): base (project)
+ {
+ this.project = project;
+ }
+
+ public abstract string Label { get; set; }
+ public abstract string Condition { get; set; }
+ }
+
+ internal interface IPropertySetImpl
+ {
+ bool HasProperty (string name);
+ MSBuildProperty GetProperty (string name, string condition = null);
+ MSBuildProperty AddProperty (string name, string condition = null);
+ bool RemoveProperty (MSBuildProperty prop);
+ bool RemoveProperty (string name);
+ void RemoveAllProperties ();
+ IEnumerable<MSBuildProperty> Properties { get; }
+ }
+
+ public abstract class MSBuildPropertySet: IMSBuildPropertySet
+ {
+ MSBuildProject project;
+ Dictionary<Type,IMSBuildDataObject> customDataObjects = new Dictionary<Type,IMSBuildDataObject> ();
+
+ internal MSBuildPropertySet (MSBuildProject project)
+ {
+ this.project = project;
+ }
+
+ internal abstract IPropertySetImpl PropertySet { get; }
+
+ public T GetObject<T> () where T : IMSBuildDataObject, new()
+ {
+ IMSBuildDataObject res;
+ customDataObjects.TryGetValue (typeof(T), out res);
+ return (T)res;
+ }
+
+ public void SetObject<T> (T t) where T : IMSBuildDataObject
+ {
+ customDataObjects [typeof(T)] = t;
+ }
+
+ internal void WriteDataObjects ()
+ {
+ foreach (IMSBuildDataObject ob in customDataObjects.Values)
+ ob.Write (this, project.Format);
+ }
+
+ public bool HasProperty (string name)
+ {
+ return PropertySet.HasProperty (name);
+ }
+
+ public MSBuildProperty GetProperty (string name, string condition = null)
+ {
+ return PropertySet.GetProperty (name, condition);
+ }
+
+ public MSBuildProperty AddProperty (string name, string condition = null)
+ {
+ return PropertySet.AddProperty (name, condition);
+ }
+
+ MSBuildProperty SafeGetProperty (string name, string condition)
+ {
+ var prop = GetProperty (name, condition);
+ if (prop == null) {
+ prop = GetProperty (name);
+ if (prop != null) {
+ prop.Condition = condition;
+ return prop;
+ }
+ }
+ return AddProperty (name, condition);
+ }
+
+ public void SetValue (string name, string value, string defaultValue = null, bool preserveExistingCase = false, bool isXmlValue = false, bool mergeToMainGroup = false, string condition = null)
+ {
+ var prop = SafeGetProperty (name, condition);
+ if (value == defaultValue) {
+ RemoveProperty (prop);
+ return;
+ }
+ prop.SetValue (value, preserveExistingCase, isXmlValue, mergeToMainGroup);
+ }
+
+ public void SetValue (string name, XmlElement elem, bool mergeToMainGroup = false, string condition = null)
+ {
+ SafeGetProperty (name, condition).SetValue (elem, mergeToMainGroup);
+ }
+
+ public void SetValue (string name, XElement elem, bool mergeToMainGroup = false, string condition = null)
+ {
+ SafeGetProperty (name, condition).SetValue (elem, mergeToMainGroup);
+ }
+
+ public void SetValue (string name, FilePath value, FilePath defaultValue = default(FilePath), bool relativeToProject = true, FilePath relativeToPath = default(FilePath), bool mergeToMainGroup = false, string condition = null)
+ {
+ SafeGetProperty (name, condition).SetValue (value, relativeToProject, relativeToPath, mergeToMainGroup);
+ }
+
+ public void SetValue (string name, bool value, bool? defaultValue = false, bool mergeToMainGroup = false, string condition = null)
+ {
+ SafeGetProperty (name, condition).SetValue (value, mergeToMainGroup);
+ }
+
+ public string GetValue (string name, string defaultValue = null)
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.GetValue ();
+ else
+ return defaultValue;
+ }
+
+ public XElement GetXmlValue (string name)
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return XElement.Parse (prop.GetValue ());
+ else
+ return null;
+ }
+
+ public FilePath GetPathValue (string name, FilePath defaultValue = default(FilePath), bool relativeToProject = true, FilePath relativeToPath = default(FilePath))
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.GetPathValue (relativeToProject, relativeToPath);
+ else
+ return defaultValue;
+ }
+
+ public bool TryGetPathValue (string name, out FilePath value, FilePath defaultValue = default(FilePath), bool relativeToProject = true, FilePath relativeToPath = default(FilePath))
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.TryGetPathValue (out value, relativeToProject, relativeToPath);
+ else {
+ value = defaultValue;
+ return value != default(FilePath);
+ }
+ }
+
+ public bool GetBoolValue (string name, bool defaultValue = false)
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.GetBoolValue ();
+ else
+ return defaultValue;
+ }
+
+ public virtual bool RemoveProperty (string name)
+ {
+ return PropertySet.RemoveProperty (name);
+ }
+
+ public bool RemoveProperty (MSBuildProperty prop)
+ {
+ return PropertySet.RemoveProperty (prop);
+ }
+
+ public void RemoveAllProperties ()
+ {
+ PropertySet.RemoveAllProperties ();
+ }
+
+ public IEnumerable<MSBuildProperty> Properties {
+ get { return PropertySet.Properties; }
+ }
+ }
+
+ public interface IMSBuildPropertySet
+ {
+ T GetObject<T> () where T:IMSBuildDataObject, new();
+ void SetObject<T> (T t) where T:IMSBuildDataObject;
+
+ bool HasProperty (string name);
+ MSBuildProperty GetProperty (string name, string condition = null);
+ IEnumerable<MSBuildProperty> Properties { get; }
+
+ void SetValue (string name, string value, string defaultValue = null, bool preserveExistingCase = false, bool isXmlValue = false, bool mergeToMainGroup = false, string condition = null);
+ void SetValue (string name, XmlElement elem, bool mergeToMainGroup = false, string condition = null);
+ void SetValue (string name, XElement elem, bool mergeToMainGroup = false, string condition = null);
+ void SetValue (string name, FilePath value, FilePath defaultValue = default(FilePath), bool relativeToProject = true, FilePath relativeToPath = default(FilePath), bool mergeToMainGroup = false, string condition = null);
+ void SetValue (string name, bool value, bool? defaultValue = false, bool mergeToMainGroup = false, string condition = null);
+
+ string GetValue (string name, string defaultValue = null);
+ XElement GetXmlValue (string name);
+ FilePath GetPathValue (string name, FilePath defaultValue = default(FilePath), bool relativeToProject = true, FilePath relativeToPath = default(FilePath));
+ bool TryGetPathValue (string name, out FilePath value, FilePath defaultValue = default(FilePath), bool relativeToProject = true, FilePath relativeToPath = default(FilePath));
+ bool GetBoolValue (string name, bool defaultValue = false);
+
+ bool RemoveProperty (string name);
+ void RemoveAllProperties ();
+ }
+
+ public abstract class MSBuildImport
+ {
+ public abstract string Target { get; set; }
+
+ public abstract string Label { get; set; }
+
+ public abstract string Condition { get; set; }
+ }
+
+ public abstract class MSBuildProperty
+ {
+ MSBuildProject project;
+
+ internal MSBuildProperty (MSBuildProject project)
+ {
+ this.project = project;
+ }
+
+ public abstract string Name {
+ get;
+ }
+
+ public abstract string Condition { get; set; }
+
+ public void SetValue (string value, bool preserveExistingCase = false, bool isXmlValue = false, bool mergeToMainGroup = false)
+ {
+ if (value == null)
+ value = String.Empty;
+
+ if (preserveExistingCase) {
+ var current = GetPropertyValue ();
+ if (current != null) {
+ if (current.Equals (value, preserveExistingCase ? StringComparison.InvariantCultureIgnoreCase : StringComparison.InvariantCulture))
+ return;
+ }
+ }
+ SetPropertyValue (value, isXmlValue);
+ }
+
+ public void SetValue (XmlElement elem, bool mergeToMainGroup = false)
+ {
+ SetPropertyValue (elem.OuterXml, true);
+ }
+
+ public void SetValue (XElement elem, bool mergeToMainGroup = false)
+ {
+ SetPropertyValue (elem.ToString (), true);
+ }
+
+ public void SetValue (FilePath value, bool relativeToProject = true, FilePath relativeToPath = default(FilePath), bool mergeToMainGroup = false)
+ {
+ string baseDir = null;
+ if (relativeToProject) {
+ if (relativeToPath != default(FilePath))
+ throw new ArgumentException ("relativeToPath argument can't be used together with relativeToProject");
+ baseDir = project.BaseDirectory;
+ } else if (relativeToPath != null) {
+ baseDir = relativeToPath;
+ }
+ SetPropertyValue (MonoDevelop.Projects.Formats.MSBuild.MSBuildProjectService.ToMSBuildPath (baseDir, value), false);
+ }
+
+ public void SetValue (bool value, bool mergeToMainGroup = false)
+ {
+ SetPropertyValue (value ? "True" : "False", false);
+ }
+
+ public string GetValue ()
+ {
+ return GetPropertyValue ();
+ }
+
+ public XElement GetXmlValue ()
+ {
+ var val = GetPropertyValue ();
+ if (val == null)
+ return null;
+ return XElement.Parse (val);
+ }
+
+ public FilePath GetPathValue (bool relativeToProject = true, FilePath relativeToPath = default(FilePath))
+ {
+ var val = GetPropertyValue ();
+ string baseDir = null;
+ if (relativeToProject) {
+ if (relativeToPath != default(FilePath))
+ throw new ArgumentException ("relativeToPath argument can't be used together with relativeToProject");
+ baseDir = project.BaseDirectory;
+ } else if (relativeToPath != null) {
+ baseDir = relativeToPath;
+ }
+ return MonoDevelop.Projects.Formats.MSBuild.MSBuildProjectService.FromMSBuildPath (baseDir, val);
+ }
+
+ public bool TryGetPathValue (out FilePath value, bool relativeToProject = true, FilePath relativeToPath = default(FilePath))
+ {
+ var val = GetPropertyValue ();
+ string baseDir = null;
+ if (relativeToProject) {
+ if (relativeToPath != default(FilePath))
+ throw new ArgumentException ("relativeToPath argument can't be used together with relativeToProject");
+ baseDir = project.BaseDirectory;
+ } else if (relativeToPath != null) {
+ baseDir = relativeToPath;
+ }
+ string path;
+ var res = MonoDevelop.Projects.Formats.MSBuild.MSBuildProjectService.FromMSBuildPath (baseDir, val, out path);
+ value = path;
+ return res;
+ }
+
+ public bool GetBoolValue ()
+ {
+ var val = GetPropertyValue ();
+ return val.Equals ("true", StringComparison.InvariantCultureIgnoreCase);
+ }
+
+ protected abstract void SetPropertyValue (string value, bool isXml);
+ protected abstract string GetPropertyValue ();
+ }
+
+ public abstract class MSBuildItem: MSBuildPropertySet
+ {
+ MSBuildProject project;
+
+ internal MSBuildItem (MSBuildProject project): base (project)
+ {
+ this.project = project;
+ }
+
+ public abstract string Include { get; }
+
+ public abstract string UnevaluatedInclude { get; }
+
+ public abstract string Name { get; }
+ }
+
+ public interface IMSBuildDataObject
+ {
+ void Read (IMSBuildPropertySet pset, MonoDevelop.Projects.Formats.MSBuild.MSBuildFileFormat format);
+ void Write (IMSBuildPropertySet pset, MonoDevelop.Projects.Formats.MSBuild.MSBuildFileFormat format);
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMSBuildProjectObject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMSBuildProjectObject.cs
new file mode 100644
index 0000000000..5ee831fa8a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMSBuildProjectObject.cs
@@ -0,0 +1,34 @@
+//
+// IMSBuildProjectObject.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+namespace MonoDevelop.Projects.MSBuild
+{
+ interface IMSBuildProjectObject
+ {
+ MSBuildProject ParentProject { get; }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMSBuildPropertyEvaluated.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMSBuildPropertyEvaluated.cs
new file mode 100644
index 0000000000..fc9590437f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMSBuildPropertyEvaluated.cs
@@ -0,0 +1,58 @@
+//
+// IMSBuildPropertyEvaluated.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Xml;
+using Microsoft.Build.BuildEngine;
+using System.Xml.Linq;
+using MonoDevelop.Core;
+using System.Globalization;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+
+ public interface IMSBuildPropertyEvaluated
+ {
+ bool IsImported { get; }
+
+ string Name { get; }
+
+ MSBuildProject ParentProject { get; }
+
+ string Value { get; }
+
+ string UnevaluatedValue { get; }
+
+ T GetValue<T> ();
+
+ object GetValue (Type t);
+
+ FilePath GetPathValue (bool relativeToProject = true, FilePath relativeToPath = default(FilePath));
+
+ bool TryGetPathValue (out FilePath value, bool relativeToProject = true, FilePath relativeToPath = default(FilePath));
+ }
+
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMSBuildPropertySet.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMSBuildPropertySet.cs
new file mode 100644
index 0000000000..c50d165ac6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMSBuildPropertySet.cs
@@ -0,0 +1,392 @@
+//
+// MSBuildPropertySet.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Linq;
+using System.IO;
+using System.Collections.Generic;
+using System.Xml;
+using System.Text;
+
+using Microsoft.Build.BuildEngine;
+using MonoDevelop.Core;
+using System.Xml.Linq;
+using System.Reflection;
+using MonoDevelop.Core.Serialization;
+using System.Globalization;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public interface IMSBuildPropertySet: IPropertySet
+ {
+ string Label { get; set; }
+
+ new MSBuildProperty GetProperty (string name);
+ new IEnumerable<MSBuildProperty> GetProperties ();
+
+ MSBuildProject ParentProject { get; }
+ }
+
+ public static class IMSBuildPropertySetExtensions
+ {
+ public static void WriteObjectProperties (this IPropertySet pset, object ob, Type typeToScan, bool includeBaseMembers = false)
+ {
+ DataSerializer ser = new DataSerializer (Services.ProjectService.DataContext);
+ var props = Services.ProjectService.DataContext.GetProperties (ser.SerializationContext, ob);
+ XmlConfigurationWriter cwriter = null;
+
+ var mso = pset as IMSBuildProjectObject;
+ if (mso != null && mso.ParentProject != null)
+ ser.SerializationContext.BaseFile = mso.ParentProject.FileName;
+ ser.SerializationContext.DirectorySeparatorChar = '\\';
+
+ foreach (var prop in props) {
+ if (prop.IsExternal)
+ continue;
+ bool merge = Attribute.IsDefined (prop.Member, typeof(MergeToProjectAttribute));
+ if (prop.PropertyType == typeof(FilePath)) {
+ var val = (FilePath)prop.GetValue (ob);
+ FilePath def = (string)prop.DefaultValue;
+ pset.SetValue (prop.Name, val, def, mergeToMainGroup: merge);
+ } else if (prop.DataType is PathDataType && prop.PropertyType == typeof(string)) {
+ FilePath val = (string)prop.GetValue (ob);
+ FilePath def = (string)prop.DefaultValue;
+ pset.SetValue (prop.Name, val, def, mergeToMainGroup: merge);
+ } else if (prop.PropertyType == typeof(string)) {
+ pset.SetValue (prop.Name, (string)prop.GetValue (ob), (string)prop.DefaultValue, merge);
+ } else if (prop.DataType.IsSimpleType) {
+ pset.SetValue (prop.Name, prop.GetValue (ob), prop.DefaultValue, merge);
+ } else if (prop.PropertyType.IsGenericType && prop.PropertyType.GetGenericTypeDefinition () == typeof(Nullable<>)) {
+ pset.SetValue (prop.Name, prop.GetValue (ob), prop.DefaultValue, merge);
+ } else {
+ var val = prop.GetValue (ob);
+ if (val != null) {
+ if (cwriter == null)
+ cwriter = new XmlConfigurationWriter { Namespace = MSBuildProject.Schema };
+ var w = new StringWriter ();
+ var data = prop.Serialize (ser.SerializationContext, ob, val);
+ if (data != null) {
+ cwriter.Write (new XmlTextWriter (w), data);
+ pset.SetValue (prop.Name, w.ToString ());
+ } else
+ pset.RemoveProperty (prop.Name);
+ } else
+ pset.RemoveProperty (prop.Name);
+ }
+ }
+ }
+
+ public static void ReadObjectProperties (this IReadOnlyPropertySet pset, object ob, Type typeToScan, bool includeBaseMembers = false)
+ {
+ DataSerializer ser = new DataSerializer (Services.ProjectService.DataContext);
+ var props = Services.ProjectService.DataContext.GetProperties (ser.SerializationContext, ob);
+
+ var mso = pset as IMSBuildProjectObject;
+ if (mso != null && mso.ParentProject != null)
+ ser.SerializationContext.BaseFile = mso.ParentProject.FileName;
+ ser.SerializationContext.DirectorySeparatorChar = '\\';
+
+ foreach (var prop in props) {
+ if (prop.IsExternal)
+ continue;
+ object readVal = null;
+ if (prop.PropertyType == typeof(FilePath)) {
+ FilePath def = (string)prop.DefaultValue;
+ readVal = pset.GetPathValue (prop.Name, def);
+ } else if (prop.DataType is PathDataType && prop.PropertyType == typeof(string)) {
+ FilePath def = (string)prop.DefaultValue;
+ readVal = pset.GetPathValue (prop.Name, def);
+ readVal = readVal.ToString ();
+ } else if (prop.PropertyType == typeof(string)) {
+ readVal = pset.GetValue (prop.Name, (string)prop.DefaultValue);
+ } else if (prop.DataType.IsSimpleType) {
+ readVal = pset.GetValue (prop.Name, prop.PropertyType, prop.DefaultValue);
+ } else if (prop.PropertyType.IsGenericType && prop.PropertyType.GetGenericTypeDefinition () == typeof(Nullable<>)) {
+ readVal = pset.GetValue (prop.Name, prop.PropertyType, prop.DefaultValue);
+ } else {
+ var val = pset.GetValue (prop.Name);
+ if (!string.IsNullOrEmpty (val)) {
+ try {
+ var data = XmlConfigurationReader.DefaultReader.Read (new XmlTextReader (new StringReader (val)));
+ if (prop.HasSetter && prop.DataType.CanCreateInstance) {
+ readVal = prop.Deserialize (ser.SerializationContext, ob, data);
+ } else if (prop.DataType.CanReuseInstance) {
+ // Try to deserialize over the existing instance
+ prop.Deserialize (ser.SerializationContext, ob, data, prop.GetValue (ob));
+ continue;
+ } else {
+ throw new InvalidOperationException ("The property '" + prop.Name + "' does not have a setter.");
+ }
+ } catch (Exception ex) {
+ LoggingService.LogError ("Cound not read project property '" + prop.Name + "'", ex);
+ }
+ } else
+ continue;
+ }
+ prop.SetValue (ob, readVal);
+ }
+ }
+
+ static DataContext solutionDataContext = new DataContext ();
+
+ public static void WriteObjectProperties (this SlnSection pset, object ob)
+ {
+ DataSerializer ser = new DataSerializer (solutionDataContext);
+ ser.SerializationContext.BaseFile = pset.ParentFile.FileName;
+ ser.SerializationContext.IncludeDeletedValues = true;
+ var data = ser.Serialize (ob, ob.GetType()) as DataItem;
+ if (data != null)
+ WriteDataItem (pset, data);
+ }
+
+ public static void ReadObjectProperties (this SlnSection pset, object ob)
+ {
+ DataSerializer ser = new DataSerializer (solutionDataContext);
+ ser.SerializationContext.BaseFile = pset.ParentFile.FileName;
+ var data = ReadDataItem (pset);
+ ser.Deserialize (ob, data);
+ }
+
+ static void WriteDataItem (SlnSection pset, DataItem item)
+ {
+ HashSet<DataItem> removedItems = new HashSet<DataItem> ();
+ Dictionary<DataNode,int> ids = new Dictionary<DataNode, int> ();
+
+ // First of all read the existing data item, since we want to keep data that has not been modified
+ // The ids collection is filled with a map of items and their ids
+ var currentItem = ReadDataItem (pset, ids);
+
+ // UpdateFromItem will add new data to the item, it will remove the data that has been removed, and
+ // will ignore unknown data that has not been set or removed
+ currentItem.UpdateFromItem (item, removedItems);
+
+ // List of IDs that are not used anymore and can be reused when writing the item
+ var unusedIds = new Queue<int> (removedItems.Select (it => ids[it]).OrderBy (i => i));
+
+ // Calculate the next free id, to be used when adding new items
+ var usedIds = ids.Where (p => !removedItems.Contains (p.Key)).Select (p => p.Value).ToArray ();
+ int nextId = usedIds.Length > 0 ? usedIds.Max () + 1 : 0;
+
+ var newSet = new List<KeyValuePair<string, string>> ();
+
+ foreach (DataNode val in currentItem.ItemData)
+ WriteDataNode (newSet, "", val, ids, unusedIds, ref nextId);
+
+ pset.SetContent (newSet);
+ }
+
+ static void WriteDataNode (List<KeyValuePair<string, string>> pset, string prefix, DataNode node, Dictionary<DataNode,int> ids, Queue<int> unusedIds, ref int id)
+ {
+ string name = node.Name;
+ string newPrefix = prefix.Length > 0 ? prefix + "." + name: name;
+
+ if (node is DataValue) {
+ DataValue val = (DataValue) node;
+ string value = EncodeString (val.Value);
+ pset.Add (new KeyValuePair<string, string> (newPrefix, value));
+ }
+ else {
+ DataItem it = (DataItem) node;
+ int newId;
+ if (!ids.TryGetValue (node, out newId))
+ newId = unusedIds.Count > 0 ? unusedIds.Dequeue () : (id++);
+ pset.Add (new KeyValuePair<string, string> (newPrefix, "$" + newId));
+ newPrefix = "$" + newId;
+ foreach (DataNode cn in it.ItemData)
+ WriteDataNode (pset, newPrefix, cn, ids, unusedIds, ref id);
+ }
+ }
+
+ static string EncodeString (string val)
+ {
+ if (val.Length == 0)
+ return val;
+
+ int i = val.IndexOfAny (new char[] {'\n','\r','\t'});
+ if (i != -1 || val [0] == '@') {
+ StringBuilder sb = new StringBuilder ();
+ if (i != -1) {
+ int fi = val.IndexOf ('\\');
+ if (fi != -1 && fi < i) i = fi;
+ sb.Append (val.Substring (0,i));
+ } else
+ i = 0;
+ for (int n = i; n < val.Length; n++) {
+ char c = val [n];
+ if (c == '\r')
+ sb.Append (@"\r");
+ else if (c == '\n')
+ sb.Append (@"\n");
+ else if (c == '\t')
+ sb.Append (@"\t");
+ else if (c == '\\')
+ sb.Append (@"\\");
+ else
+ sb.Append (c);
+ }
+ val = "@" + sb.ToString ();
+ }
+ char fc = val [0];
+ char lc = val [val.Length - 1];
+ if (fc == ' ' || fc == '"' || fc == '$' || lc == ' ')
+ val = "\"" + val + "\"";
+ return val;
+ }
+
+ static string DecodeString (string val)
+ {
+ val = val.Trim (' ', '\t');
+ if (val.Length == 0)
+ return val;
+ if (val [0] == '\"')
+ val = val.Substring (1, val.Length - 2);
+ if (val [0] == '@') {
+ StringBuilder sb = new StringBuilder (val.Length);
+ for (int n = 1; n < val.Length; n++) {
+ char c = val [n];
+ if (c == '\\') {
+ c = val [++n];
+ if (c == 'r') c = '\r';
+ else if (c == 'n') c = '\n';
+ else if (c == 't') c = '\t';
+ }
+ sb.Append (c);
+ }
+ return sb.ToString ();
+ }
+ else
+ return val;
+ }
+
+ static DataItem ReadDataItem (SlnSection pset)
+ {
+ return ReadDataItem (pset, null);
+ }
+
+ static DataItem ReadDataItem (SlnSection pset, Dictionary<DataNode,int> ids)
+ {
+ DataItem it = new DataItem ();
+
+ var lines = pset.GetContent ().ToArray ();
+
+ int lineNum = 0;
+ int lastLine = lines.Length - 1;
+ while (lineNum <= lastLine) {
+ if (!ReadDataNode (it, lines, lastLine, "", ids, ref lineNum))
+ lineNum++;
+ }
+ return it;
+ }
+
+ static bool ReadDataNode (DataItem item, KeyValuePair<string,string>[] lines, int lastLine, string prefix, Dictionary<DataNode,int> ids, ref int lineNum)
+ {
+ var s = lines [lineNum];
+
+ string name = s.Key;
+ if (name.Length == 0) {
+ lineNum++;
+ return true;
+ }
+
+ // Check if the line belongs to the current item
+ if (prefix.Length > 0) {
+ if (!s.Key.StartsWith (prefix + ".", StringComparison.Ordinal))
+ return false;
+ name = s.Key.Substring (prefix.Length + 1);
+ } else {
+ if (s.Key.StartsWith ("$", StringComparison.Ordinal))
+ return false;
+ }
+
+ string value = s.Value;
+ if (value.StartsWith ("$", StringComparison.Ordinal)) {
+ // New item
+ DataItem child = new DataItem ();
+ child.Name = name;
+ int id;
+ if (ids != null && int.TryParse (value.Substring (1), out id))
+ ids [child] = id;
+ lineNum++;
+ while (lineNum <= lastLine) {
+ if (!ReadDataNode (child, lines, lastLine, value, ids, ref lineNum))
+ break;
+ }
+ item.ItemData.Add (child);
+ } else {
+ value = DecodeString (value);
+ DataValue val = new DataValue (name, value);
+ item.ItemData.Add (val);
+ lineNum++;
+ }
+ return true;
+ }
+
+ internal static void WriteExternalProjectProperties (this MSBuildProject project, object ob, Type typeToScan, bool includeBaseMembers = false)
+ {
+ DataSerializer ser = new DataSerializer (Services.ProjectService.DataContext);
+ var props = Services.ProjectService.DataContext.GetProperties (ser.SerializationContext, ob);
+
+ XmlConfigurationWriter writer = null;
+ foreach (var prop in props) {
+ if (!prop.IsExternal)
+ continue;
+ var val = prop.GetValue (ob);
+ if (val != null) {
+ var data = prop.Serialize (ser.SerializationContext, ob, val);
+ if (data != null) {
+ data.Name = prop.Name;
+ if (writer == null)
+ writer = new XmlConfigurationWriter { Namespace = MSBuildProject.Schema };
+
+ XmlDocument doc = new XmlDocument ();
+ var elem = writer.Write (doc, data);
+ // TODO NPM
+ project.SetMonoDevelopProjectExtension (prop.Name, elem);
+ continue;
+ }
+ }
+ project.RemoveMonoDevelopProjectExtension (prop.Name);
+ }
+ }
+
+ internal static void ReadExternalProjectProperties (this MSBuildProject project, object ob, Type typeToScan, bool includeBaseMembers = false)
+ {
+ DataSerializer ser = new DataSerializer (Services.ProjectService.DataContext);
+ var props = Services.ProjectService.DataContext.GetProperties (ser.SerializationContext, ob);
+
+ foreach (var prop in props) {
+ if (!prop.IsExternal)
+ continue;
+ var sec = project.GetMonoDevelopProjectExtension (prop.Name);
+ if (sec != null) {
+ var data = XmlConfigurationReader.DefaultReader.Read (sec);
+ var val = prop.Deserialize (ser.SerializationContext, ob, data);
+ prop.SetValue (ob, val);
+ }
+ }
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMetadataProperty.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMetadataProperty.cs
new file mode 100644
index 0000000000..8f9c627d19
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IMetadataProperty.cs
@@ -0,0 +1,60 @@
+//
+// IMetadataProperty.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Xml;
+using Microsoft.Build.BuildEngine;
+using System.Xml.Linq;
+using MonoDevelop.Core;
+using System.Globalization;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+
+ public interface IMetadataProperty
+ {
+ string Name { get; }
+
+ string Value { get; }
+
+ string UnevaluatedValue { get; }
+
+ T GetValue<T> ();
+
+ object GetValue (Type t);
+
+ FilePath GetPathValue (bool relativeToProject = true, FilePath relativeToPath = default(FilePath));
+
+ bool TryGetPathValue (out FilePath value, bool relativeToProject = true, FilePath relativeToPath = default(FilePath));
+
+ void SetValue (string value, bool preserveCase = false, bool mergeToMainGroup = false, MSBuildValueType valueType = null);
+
+ void SetValue (FilePath value, bool relativeToProject = true, FilePath relativeToPath = default(FilePath), bool mergeToMainGroup = false);
+
+ void SetValue (object value, bool mergeToMainGroup = false);
+ }
+
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IntrinsicFunctions.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IntrinsicFunctions.cs
new file mode 100644
index 0000000000..d6335e62f2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/IntrinsicFunctions.cs
@@ -0,0 +1,416 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//-----------------------------------------------------------------------
+// </copyright>
+// <summary>Definition of functions which can be accessed from MSBuild files.</summary>
+//-----------------------------------------------------------------------
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text.RegularExpressions;
+
+using Microsoft.Win32;
+using Microsoft.Build.Shared;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Assemblies;
+
+namespace Microsoft.Build.Evaluation
+{
+ /// <summary>
+ /// The Intrinsic class provides static methods that can be accessed from MSBuild's
+ /// property functions using $([MSBuild]::Function(x,y))
+ /// </summary>
+ internal static class IntrinsicFunctions
+ {
+ /// <summary>
+ /// Add two doubles
+ /// </summary>
+ internal static double Add(double a, double b)
+ {
+ return a + b;
+ }
+
+ /// <summary>
+ /// Add two longs
+ /// </summary>
+ internal static long Add(long a, long b)
+ {
+ return a + b;
+ }
+
+ /// <summary>
+ /// Subtract two doubles
+ /// </summary>
+ internal static double Subtract(double a, double b)
+ {
+ return a - b;
+ }
+
+ /// <summary>
+ /// Subtract two longs
+ /// </summary>
+ internal static long Subtract(long a, long b)
+ {
+ return a - b;
+ }
+
+ /// <summary>
+ /// Multiply two doubles
+ /// </summary>
+ internal static double Multiply(double a, double b)
+ {
+ return a * b;
+ }
+
+ /// <summary>
+ /// Multiply two longs
+ /// </summary>
+ internal static long Multiply(long a, long b)
+ {
+ return a * b;
+ }
+
+ /// <summary>
+ /// Divide two doubles
+ /// </summary>
+ internal static double Divide(double a, double b)
+ {
+ return a / b;
+ }
+
+ /// <summary>
+ /// Divide two longs
+ /// </summary>
+ internal static long Divide(long a, long b)
+ {
+ return a / b;
+ }
+
+ /// <summary>
+ /// Modulo two doubles
+ /// </summary>
+ internal static double Modulo(double a, double b)
+ {
+ return a % b;
+ }
+
+ /// <summary>
+ /// Modulo two longs
+ /// </summary>
+ internal static long Modulo(long a, long b)
+ {
+ return a % b;
+ }
+
+ /// <summary>
+ /// Escape the string according to MSBuild's escaping rules
+ /// </summary>
+ internal static string Escape(string unescaped)
+ {
+ return EscapingUtilities.Escape(unescaped);
+ }
+
+ /// <summary>
+ /// Unescape the string according to MSBuild's escaping rules
+ /// </summary>
+ internal static string Unescape(string escaped)
+ {
+ return EscapingUtilities.UnescapeAll(escaped);
+ }
+
+ /// <summary>
+ /// Perform a bitwise OR on the first and second (first | second)
+ /// </summary>
+ internal static int BitwiseOr(int first, int second)
+ {
+ return first | second;
+ }
+
+ /// <summary>
+ /// Perform a bitwise AND on the first and second (first &amp; second)
+ /// </summary>
+ internal static int BitwiseAnd(int first, int second)
+ {
+ return first & second;
+ }
+
+ /// <summary>
+ /// Perform a bitwise XOR on the first and second (first ^ second)
+ /// </summary>
+ internal static int BitwiseXor(int first, int second)
+ {
+ return first ^ second;
+ }
+
+ /// <summary>
+ /// Perform a bitwise NOT on the first and second (~first)
+ /// </summary>
+ internal static int BitwiseNot(int first)
+ {
+ return ~first;
+ }
+
+ /// <summary>
+ /// Get the value of the registry key and value, default value is null
+ /// </summary>
+ internal static object GetRegistryValue(string keyName, string valueName)
+ {
+ return Registry.GetValue(keyName, valueName, null /* null to match the $(Regsitry:XYZ@ZBC) behaviour */);
+ }
+
+ /// <summary>
+ /// Get the value of the registry key and value
+ /// </summary>
+ internal static object GetRegistryValue(string keyName, string valueName, object defaultValue)
+ {
+ return Registry.GetValue(keyName, valueName, defaultValue);
+ }
+
+ /// <summary>
+ /// Get the value of the registry key from one of the RegistryView's specified
+ /// </summary>
+ internal static object GetRegistryValueFromView(string keyName, string valueName, object defaultValue, object view)
+ {
+ return GetRegistryValueFromView (keyName, valueName, defaultValue, new [] { view });
+ }
+
+ /// <summary>
+ /// Get the value of the registry key from one of the RegistryView's specified
+ /// </summary>
+ internal static object GetRegistryValueFromView(string keyName, string valueName, object defaultValue, params object[] views)
+ {
+ string subKeyName;
+
+ // We will take on handing of default value
+ // A we need to act on the null return from the GetValue call below
+ // so we can keep searching other registry views
+ object result = defaultValue;
+
+ // If we haven't been passed any views, then we'll just use the default view
+ if (views == null || views.Length == 0)
+ {
+ views = new object[] { RegistryView.Default };
+ }
+
+ foreach (object viewObject in views)
+ {
+ string viewAsString = viewObject as string;
+
+ if (viewAsString != null)
+ {
+ string typeLeafName = typeof(RegistryView).Name + ".";
+ string typeFullName = typeof(RegistryView).FullName + ".";
+
+ // We'll allow the user to specify the leaf or full type name on the RegistryView enum
+ viewAsString = viewAsString.Replace(typeFullName, "").Replace(typeLeafName, "");
+
+ // This may throw - and that's fine as the user will receive a controlled version
+ // of that error.
+ RegistryView view = (RegistryView)Enum.Parse(typeof(RegistryView), viewAsString, true);
+
+ if (!Platform.IsWindows && !keyName.StartsWith("HKEY_CURRENT_USER", StringComparison.OrdinalIgnoreCase))
+ {
+ // Fake common requests to HKLM that we can resolve
+
+
+ // See if this asks for a specific SDK
+ var m = Regex.Match(keyName,
+ @"^HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Microsoft SDKs\\Windows\\v(\d+\.\d+)$",
+ RegexOptions.IgnoreCase);
+ if (m.Success && m.Groups.Count >= 1 && valueName.Equals("InstallRoot", StringComparison.OrdinalIgnoreCase))
+ {
+ var mr = MonoDevelop.Core.Runtime.SystemAssemblyService.DefaultRuntime as MonoTargetRuntime;
+ if (mr != null)
+ return Path.Combine(mr.MonoDirectory, m.Groups[0].Value) + Path.DirectorySeparatorChar;
+ }
+
+ return string.Empty;
+ }
+
+ using (RegistryKey key = GetBaseKeyFromKeyName(keyName, view, out subKeyName))
+ {
+ if (key != null)
+ {
+ using (RegistryKey subKey = key.OpenSubKey(subKeyName, false))
+ {
+ // If we managed to retrieve the subkey, then move onto locating the value
+ if (subKey != null)
+ {
+ result = subKey.GetValue(valueName);
+ }
+
+ // We've found a value, so stop looking
+ if (result != null)
+ {
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // We will have either found a result or defaultValue if one wasn't found at this point
+ return result;
+ }
+
+ /// <summary>
+ /// Given the absolute location of a file, and a disc location, returns relative file path to that disk location.
+ /// Throws UriFormatException.
+ /// </summary>
+ /// <param name="basePath">
+ /// The base path we want to relativize to. Must be absolute.
+ /// Should <i>not</i> include a filename as the last segment will be interpreted as a directory.
+ /// </param>
+ /// <param name="path">
+ /// The path we need to make relative to basePath. The path can be either absolute path or a relative path in which case it is relative to the base path.
+ /// If the path cannot be made relative to the base path (for example, it is on another drive), it is returned verbatim.
+ /// </param>
+ /// <returns>relative path (can be the full path)</returns>
+ internal static string MakeRelative(string basePath, string path)
+ {
+ string result = FileService.AbsoluteToRelativePath (basePath, path);
+
+ return result;
+ }
+
+ /// <summary>
+ /// Locate a file in either the directory specified or a location in the
+ /// direcorty structure above that directory.
+ /// </summary>
+ internal static string GetDirectoryNameOfFileAbove(string startingDirectory, string fileName)
+ {
+ // Canonicalize our starting location
+ string lookInDirectory = Path.GetFullPath(startingDirectory);
+
+ do
+ {
+ // Construct the path that we will use to test against
+ string possibleFileDirectory = Path.Combine(lookInDirectory, fileName);
+
+ // If we successfully locate the file in the directory that we're
+ // looking in, simply return that location. Otherwise we'll
+ // keep moving up the tree.
+ if (File.Exists(possibleFileDirectory))
+ {
+ // We've found the file, return the directory we found it in
+ return lookInDirectory;
+ }
+ else
+ {
+ // GetDirectoryName will return null when we reach the root
+ // terminating our search
+ lookInDirectory = Path.GetDirectoryName(lookInDirectory);
+ }
+ }
+ while (lookInDirectory != null);
+
+ // When we didn't find the location, then return an empty string
+ return String.Empty;
+ }
+
+ /// <summary>
+ /// Return the string in parameter 'defaultValue' only if parameter 'conditionValue' is empty
+ /// else, return the value conditionValue
+ /// </summary>
+ internal static string ValueOrDefault(string conditionValue, string defaultValue)
+ {
+ if (String.IsNullOrEmpty(conditionValue))
+ {
+ return defaultValue;
+ }
+ else
+ {
+ return conditionValue;
+ }
+ }
+
+ /// <summary>
+ /// Returns true if a task host exists that can service the requested runtime and architecture
+ /// values, and false otherwise.
+ /// </summary>
+ internal static bool DoesTaskHostExist(string runtime, string architecture)
+ {
+ return false;
+ }
+
+ #region Debug only intrinsics
+
+ /// <summary>
+ /// returns if the string contains escaped wildcards
+ /// </summary>
+ internal static List<string> __GetListTest()
+ {
+ return new List<string> { "A", "B", "C", "D" };
+ }
+
+ #endregion
+
+ /// <summary>
+ /// Following function will parse a keyName and returns the basekey for it.
+ /// It will also store the subkey name in the out parameter.
+ /// If the keyName is not valid, we will throw ArgumentException.
+ /// The return value shouldn't be null.
+ /// Taken from: \ndp\clr\src\BCL\Microsoft\Win32\Registry.cs
+ /// </summary>
+ private static RegistryKey GetBaseKeyFromKeyName(string keyName, RegistryView view, out string subKeyName)
+ {
+ if (keyName == null)
+ {
+ throw new ArgumentNullException("keyName");
+ }
+
+ string basekeyName;
+ int i = keyName.IndexOf('\\');
+ if (i != -1)
+ {
+ basekeyName = keyName.Substring(0, i).ToUpper(System.Globalization.CultureInfo.InvariantCulture);
+ }
+ else
+ {
+ basekeyName = keyName.ToUpper(System.Globalization.CultureInfo.InvariantCulture);
+ }
+
+ RegistryKey basekey = null;
+
+ switch (basekeyName)
+ {
+ case "HKEY_CURRENT_USER":
+ basekey = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, view);
+ break;
+ case "HKEY_LOCAL_MACHINE":
+ basekey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, view);
+ break;
+ case "HKEY_CLASSES_ROOT":
+ basekey = RegistryKey.OpenBaseKey(RegistryHive.ClassesRoot, view);
+ break;
+ case "HKEY_USERS":
+ basekey = RegistryKey.OpenBaseKey(RegistryHive.Users, view);
+ break;
+ case "HKEY_PERFORMANCE_DATA":
+ basekey = RegistryKey.OpenBaseKey(RegistryHive.PerformanceData, view);
+ break;
+ case "HKEY_CURRENT_CONFIG":
+ basekey = RegistryKey.OpenBaseKey(RegistryHive.CurrentConfig, view);
+ break;
+ case "HKEY_DYN_DATA":
+ basekey = RegistryKey.OpenBaseKey(RegistryHive.DynData, view);
+ break;
+ default:
+ throw new ArgumentException(keyName);
+ }
+
+ if (i == -1 || i == keyName.Length)
+ {
+ subKeyName = string.Empty;
+ }
+ else
+ {
+ subKeyName = keyName.Substring(i + 1, keyName.Length - i - 1);
+ }
+
+ return basekey;
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildChoose.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildChoose.cs
new file mode 100644
index 0000000000..c6091d7a45
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildChoose.cs
@@ -0,0 +1,105 @@
+//
+// MSBuildChooseElement.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Xml;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public class MSBuildChoose: MSBuildElement
+ {
+ internal override void ReadChildElement (MSBuildXmlReader reader)
+ {
+ MSBuildChooseOption op = null;
+ switch (reader.LocalName) {
+ case "When": op = new MSBuildChooseOption (); break;
+ case "Otherwise": op = new MSBuildChooseOption (true); break;
+ }
+ if (op != null) {
+ op.ParentNode = this;
+ op.Read (reader);
+ ChildNodes = ChildNodes.Add (op);
+ } else
+ base.ReadChildElement (reader);
+ }
+
+ internal override string GetElementName ()
+ {
+ return "Choose";
+ }
+
+ internal IEnumerable<MSBuildChooseOption> GetOptions ()
+ {
+ return ChildNodes.OfType<MSBuildChooseOption> ();
+ }
+ }
+
+ public class MSBuildChooseOption: MSBuildElement
+ {
+ public MSBuildChooseOption ()
+ {
+ }
+
+ public MSBuildChooseOption (bool isOtherwise)
+ {
+ IsOtherwise = isOtherwise;
+ }
+
+ public bool IsOtherwise {
+ get; private set;
+ }
+
+ internal override void ReadChildElement (MSBuildXmlReader reader)
+ {
+ MSBuildObject ob = null;
+ switch (reader.LocalName) {
+ case "ItemGroup": ob = new MSBuildItemGroup (); break;
+ case "PropertyGroup": ob = new MSBuildPropertyGroup (); break;
+ case "ImportGroup": ob = new MSBuildImportGroup (); break;
+ case "Choose": ob = new MSBuildChoose (); break;
+ default: ob = new MSBuildXmlElement (); break;
+ }
+ if (ob != null) {
+ ob.ParentNode = this;
+ ob.Read (reader);
+ ChildNodes = ChildNodes.Add (ob);
+ } else
+ reader.Read ();
+ }
+
+ internal override string GetElementName ()
+ {
+ return IsOtherwise ? "Otherwise" : "When";
+ }
+
+ public IEnumerable<MSBuildObject> GetAllObjects ()
+ {
+ return ChildNodes.OfType<MSBuildObject> ();
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildElement.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildElement.cs
new file mode 100644
index 0000000000..b3e83ecec3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildElement.cs
@@ -0,0 +1,69 @@
+//
+// MSBuildElement.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+namespace MonoDevelop.Projects.MSBuild
+{
+ public abstract class MSBuildElement: MSBuildObject
+ {
+ string condition;
+
+ static readonly string [] knownAttributes = { "Label", "Condition" };
+
+ internal override string [] GetKnownAttributes ()
+ {
+ return knownAttributes;
+ }
+
+ internal override void ReadAttribute (string name, string value)
+ {
+ switch (name) {
+ case "Label": Label = value; break;
+ case "Condition": Condition = value; break;
+ }
+ }
+
+ internal override string WriteAttribute (string name)
+ {
+ switch (name) {
+ case "Label": return Label != null && Label.Length > 0 ? Label : null;
+ case "Condition": return Condition.Length > 0 ? Condition : null;
+ }
+ return null;
+ }
+
+ public string Label { get; set; }
+
+ public string Condition {
+ get {
+ return condition ?? "";
+ }
+ set {
+ condition = value;
+ }
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEngine.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEngine.cs
new file mode 100644
index 0000000000..f9ba3da355
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEngine.cs
@@ -0,0 +1,115 @@
+//
+// MSBuildEngine.cs
+//
+// Author:
+// lluis <>
+//
+// Copyright (c) 2015 lluis
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Xml;
+using System.IO;
+using System.Text;
+
+using Microsoft.Build.Evaluation;
+using EvalProject = Microsoft.Build.Evaluation.Project;
+using EvalProjectItem = Microsoft.Build.Evaluation.ProjectItem;
+
+using Microsoft.Build.BuildEngine;
+using MSProject = Microsoft.Build.BuildEngine.Project;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ abstract class MSBuildEngine: IDisposable
+ {
+ bool disposed;
+
+ protected MSBuildEngine (MSBuildEngineManager manager)
+ {
+ EngineManager = manager;
+ }
+
+ public MSBuildEngineManager EngineManager { get; private set; }
+
+ public abstract object LoadProject (MSBuildProject project, string xml, FilePath fileName);
+
+ public abstract void UnloadProject (object project);
+
+ public void Dispose ()
+ {
+ if (!disposed) {
+ disposed = true;
+ OnDispose ();
+ }
+ }
+
+ internal bool Disposed {
+ get { return disposed; }
+ }
+
+ public virtual void OnDispose ()
+ {
+ }
+
+ public abstract object CreateProjectInstance (object project);
+
+ public abstract void DisposeProjectInstance (object projectInstance);
+
+ public virtual void Evaluate (object projectInstance)
+ {
+ }
+
+ public abstract bool GetItemHasMetadata (object item, string name);
+
+ public abstract string GetItemMetadata (object item, string name);
+
+ public abstract string GetEvaluatedItemMetadata (object item, string name);
+
+ public abstract IEnumerable<object> GetImports (object projectInstance);
+
+ public abstract string GetImportEvaluatedProjectPath (object projectInstance, object import);
+
+ public abstract IEnumerable<object> GetEvaluatedItemsIgnoringCondition (object projectInstance);
+
+ public abstract IEnumerable<object> GetEvaluatedProperties (object projectInstance);
+
+ public abstract IEnumerable<object> GetEvaluatedItems (object projectInstance);
+
+ public abstract void GetItemInfo (object item, out string name, out string include, out string finalItemSpec, out bool imported);
+
+ public abstract void GetEvaluatedItemInfo (object item, out string name, out string include, out string finalItemSpec, out bool imported);
+
+ public abstract void GetPropertyInfo (object property, out string name, out string value, out string finalValue);
+
+ public abstract IEnumerable<MSBuildTarget> GetTargets (object projectInstance);
+
+ public abstract IEnumerable<MSBuildTarget> GetTargetsIgnoringCondition (object projectInstance);
+
+ public abstract void SetGlobalProperty (object projectInstance, string property, string value);
+
+ public abstract void RemoveGlobalProperty (object projectInstance, string property);
+
+ public abstract ConditionedPropertyCollection GetConditionedProperties (object projectInstance);
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEngineManager.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEngineManager.cs
new file mode 100644
index 0000000000..1a48a53aca
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEngineManager.cs
@@ -0,0 +1,76 @@
+//
+// MSBuildEngineManager.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ class MSBuildEngineManager: IDisposable
+ {
+ MSBuildEngine internalEngine;
+ MSBuildEngine msbuildEngine;
+ object localLock = new object ();
+ bool disposed;
+
+ public MSBuildEngine GetEngine (bool supportsMSBuild)
+ {
+/* if (supportsMSBuild) {
+ lock (localLock) {
+ if (disposed)
+ throw new ObjectDisposedException ("MSBuildEngineManager");
+ if (msbuildEngine == null) {
+ #if !WINDOWS
+ msbuildEngine = new MSBuildEngineV4 (this);
+ #else
+ msbuildEngine = new MSBuildEngineV12 (this);
+ #endif
+ }
+ return msbuildEngine;
+ }
+ }*/
+ lock (localLock) {
+ if (disposed)
+ throw new ObjectDisposedException ("MSBuildEngineManager");
+ if (internalEngine == null)
+ internalEngine = new DefaultMSBuildEngine (this);
+ return internalEngine;
+ }
+ }
+
+ public void Dispose ()
+ {
+ lock (localLock) {
+ if (internalEngine != null)
+ internalEngine.Dispose ();
+ if (msbuildEngine != null)
+ msbuildEngine.Dispose ();
+ internalEngine = null;
+ msbuildEngine = null;
+ disposed = true;
+ }
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEngineV12.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEngineV12.cs
new file mode 100644
index 0000000000..f6a287abc7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEngineV12.cs
@@ -0,0 +1,192 @@
+//
+// MSBuildEngineV12.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Xml;
+using System.IO;
+
+using Microsoft.Build.Evaluation;
+using Microsoft.Build.Execution;
+using MSProject = Microsoft.Build.Evaluation.Project;
+using MSProjectItem = Microsoft.Build.Evaluation.ProjectItem;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+
+ class MSBuildEngineV12: MSBuildEngine
+ {
+ ProjectCollection projects;
+
+ public MSBuildEngineV12 (MSBuildEngineManager manager): base (manager)
+ {
+ projects = new ProjectCollection ();
+ }
+
+ public override object LoadProject (MSBuildProject project, string xml, FilePath fileName)
+ {
+ var d = Environment.CurrentDirectory;
+ Environment.CurrentDirectory = Path.GetDirectoryName (fileName);
+ try {
+ var p = projects.LoadProject (new XmlTextReader (new StringReader (xml)));
+ p.FullPath = fileName;
+ return p;
+ } finally {
+ Environment.CurrentDirectory = d;
+ }
+ }
+
+ public override void UnloadProject (object project)
+ {
+ projects.UnloadProject ((MSProject)project);
+ }
+
+ public override object CreateProjectInstance (object project)
+ {
+ return project;
+ }
+
+ public override void DisposeProjectInstance (object projectInstance)
+ {
+ }
+
+ public override string GetItemMetadata (object item, string name)
+ {
+ var m = ((MSProjectItem)item).GetMetadata(name);
+ if (m != null)
+ return m.UnevaluatedValue;
+ else
+ return null;
+ }
+
+ public override IEnumerable<object> GetImports (object project)
+ {
+ return ((MSProject)project).Imports.Cast<object> ();
+ }
+
+ public override string GetImportEvaluatedProjectPath (object project, object import)
+ {
+ return ((ResolvedImport)import).ImportedProject.FullPath;
+ }
+
+ public override void GetItemInfo (object item, out string name, out string include, out string finalItemSpec, out bool imported)
+ {
+ var it = (MSProjectItem)item;
+ name = it.ItemType;
+ include = it.UnevaluatedInclude;
+ if (it.UnevaluatedInclude.Contains ("*"))
+ // MSBuild expands wildcards in the evaluated include. We don't want that, unless we are getting evaluated item info.
+ finalItemSpec = include;
+ else
+ finalItemSpec = it.EvaluatedInclude;
+ imported = it.IsImported;
+ }
+
+ public override void GetEvaluatedItemInfo (object item, out string name, out string include, out string finalItemSpec, out bool imported)
+ {
+ var it = (MSProjectItem)item;
+ name = it.ItemType;
+ include = it.UnevaluatedInclude;
+ finalItemSpec = it.EvaluatedInclude;
+ imported = it.IsImported;
+ }
+
+ public override bool GetItemHasMetadata (object item, string name)
+ {
+ return ((MSProjectItem)item).HasMetadata (name);
+ }
+
+ public override string GetEvaluatedItemMetadata (object item, string name)
+ {
+ return ((MSProjectItem)item).GetMetadataValue (name);
+ }
+
+ public override IEnumerable<object> GetEvaluatedItems (object project)
+ {
+ return ((MSProject)project).AllEvaluatedItems;
+ }
+
+ public override IEnumerable<object> GetEvaluatedItemsIgnoringCondition (object project)
+ {
+ return ((MSProject)project).ItemsIgnoringCondition;
+ }
+
+ public override IEnumerable<object> GetEvaluatedProperties (object project)
+ {
+ return ((MSProject)project).AllEvaluatedProperties;
+ }
+
+ public override void GetPropertyInfo (object property, out string name, out string value, out string finalValue)
+ {
+ var p = (ProjectProperty)property;
+ name = p.Name;
+ value = p.UnevaluatedValue;
+ finalValue = p.EvaluatedValue;
+ }
+
+ public override IEnumerable<MSBuildTarget> GetTargets (object project)
+ {
+ var p = (MSProject)project;
+ foreach (var t in p.Targets) {
+ List<MSBuildTask> tasks = new List<MSBuildTask> ();
+ foreach (var task in t.Value.Tasks)
+ tasks.Add (new MSBuildTask (task.Name) { Condition = task.Condition });
+ yield return new MSBuildTarget (t.Key, tasks) {
+ IsImported = t.Value.Location.File == p.FullPath,
+ Condition = t.Value.Condition
+ };
+ }
+ }
+
+ public override IEnumerable<MSBuildTarget> GetTargetsIgnoringCondition (object projectInstance)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override void SetGlobalProperty (object project, string property, string value)
+ {
+ var p = (MSProject)project;
+ p.SetGlobalProperty (property, value);
+ }
+
+ public override void RemoveGlobalProperty (object project, string property)
+ {
+ var p = (MSProject)project;
+ p.RemoveGlobalProperty (property);
+ }
+
+ public override ConditionedPropertyCollection GetConditionedProperties (object project)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ #if !WINDOWS
+
+ #endif
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEngineV4.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEngineV4.cs
new file mode 100644
index 0000000000..a0b6424037
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEngineV4.cs
@@ -0,0 +1,212 @@
+//
+// MSBuildEngineV4.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Xml;
+using System.Text;
+
+using Microsoft.Build.BuildEngine;
+using MSProject = Microsoft.Build.BuildEngine.Project;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ #if !WINDOWS
+ class MSBuildEngineV4: MSBuildEngine
+ {
+ Engine engine;
+
+ public MSBuildEngineV4 (MSBuildEngineManager manager): base (manager)
+ {
+ engine = new Engine ();
+ }
+
+ public override object LoadProject (MSBuildProject p, string xml, FilePath fileName)
+ {
+ lock (engine) {
+ engine.GlobalProperties.Clear ();
+
+ var project = new MSProject (engine);
+ project.BuildEnabled = false;
+ project.FullFileName = fileName;
+ project.LoadXml (xml);
+ return project;
+ }
+ }
+
+ public override void UnloadProject (object project)
+ {
+ }
+
+ public override object CreateProjectInstance (object project)
+ {
+ return project;
+ }
+
+ public override void DisposeProjectInstance (object projectInstance)
+ {
+ // Don't unload, since we are using the same instance as the project
+ }
+
+ public override string GetItemMetadata (object item, string name)
+ {
+ return ((BuildItem)item).GetMetadata (name);
+ }
+
+ public override IEnumerable<object> GetImports (object project)
+ {
+ return ((MSProject)project).Imports.Cast<object> ();
+ }
+
+ public override string GetImportEvaluatedProjectPath (object project, object import)
+ {
+ return ((Import)import).EvaluatedProjectPath;
+ }
+
+ public override void GetItemInfo (object item, out string name, out string include, out string finalItemSpec, out bool imported)
+ {
+ var it = (BuildItem)item;
+ name = it.Name;
+ include = it.Include;
+ finalItemSpec = it.FinalItemSpec;
+ imported = it.IsImported;
+ }
+
+ public override void GetEvaluatedItemInfo (object item, out string name, out string include, out string finalItemSpec, out bool imported)
+ {
+ GetItemInfo (item, out name, out include, out finalItemSpec, out imported);
+ }
+
+ public override bool GetItemHasMetadata (object item, string name)
+ {
+ return ((BuildItem)item).HasMetadata (name);
+ }
+
+ public override string GetEvaluatedItemMetadata (object item, string name)
+ {
+ var it = (BuildItem)item;
+ var val = it.GetEvaluatedMetadata (name);
+ if (val.IndexOf ('%') != -1)
+ return ReplaceMetadata (it, val);
+ else
+ return val;
+ }
+
+ string ReplaceMetadata (BuildItem it, string value)
+ {
+ // Workaround to xbuild bug. xbuild does not replace well known item metadata
+
+ var sb = new StringBuilder ();
+ int i = value.IndexOf ("%(", StringComparison.Ordinal);
+ int lastPos = 0;
+ while (i != -1) {
+ int j = value.IndexOf (')', i + 3);
+ if (j != -1) {
+ var val = EvaluateMetadata (it, value.Substring (i + 2, j - (i + 2)));
+ if (val != null) {
+ sb.Append (value, lastPos, i - lastPos);
+ sb.Append (val);
+ lastPos = j + 1;
+ }
+ }
+ i = value.IndexOf ("%(", i + 2, StringComparison.Ordinal);
+ }
+ sb.Append (value, lastPos, value.Length - lastPos);
+ return sb.ToString ();
+ }
+
+ string EvaluateMetadata (BuildItem it, string metadata)
+ {
+ var d = it.GetEvaluatedMetadata (metadata);
+ if (string.IsNullOrEmpty (d))
+ return null;
+ else
+ return d;
+ }
+
+ public override IEnumerable<object> GetEvaluatedItems (object project)
+ {
+ return ((MSProject)project).EvaluatedItems.Cast<object> ();
+ }
+
+ public override IEnumerable<object> GetEvaluatedItemsIgnoringCondition (object project)
+ {
+ return ((MSProject)project).EvaluatedItemsIgnoringCondition.Cast<object> ();
+ }
+
+ public override IEnumerable<object> GetEvaluatedProperties (object project)
+ {
+ return ((MSProject)project).EvaluatedProperties.Cast<object> ();
+ }
+
+ public override void GetPropertyInfo (object property, out string name, out string value, out string finalValue)
+ {
+ var p = (BuildProperty)property;
+ name = p.Name;
+ value = p.Value;
+ finalValue = p.FinalValue;
+ }
+
+ public override IEnumerable<MSBuildTarget> GetTargets (object project)
+ {
+ var p = (MSProject)project;
+ foreach (var t in p.Targets.Cast<Target> ()) {
+ List<MSBuildTask> tasks = new List<MSBuildTask> ();
+ foreach (var task in t.OfType<BuildTask> ())
+ tasks.Add (new MSBuildTask (task.Name) { Condition = task.Condition });
+ yield return new MSBuildTarget (t.Name, tasks) {
+ IsImported = t.IsImported,
+ Condition = t.Condition
+ };
+ }
+ }
+
+ public override void SetGlobalProperty (object project, string property, string value)
+ {
+ var p = (MSProject)project;
+ p.GlobalProperties.SetProperty (property, value);
+ }
+
+ public override void RemoveGlobalProperty (object project, string property)
+ {
+ var p = (MSProject)project;
+ p.GlobalProperties.RemoveProperty (property);
+ }
+
+ public override ConditionedPropertyCollection GetConditionedProperties (object project)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override IEnumerable<MSBuildTarget> GetTargetsIgnoringCondition (object projectInstance)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+ #endif
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEvaluationContext.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEvaluationContext.cs
new file mode 100644
index 0000000000..e980e56fe2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEvaluationContext.cs
@@ -0,0 +1,767 @@
+//
+// MSBuildEvaluationContext.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Linq;
+using System.IO;
+using System.Collections.Generic;
+using System.Xml;
+using System.Text;
+
+using Microsoft.Build.BuildEngine;
+using MonoDevelop.Core;
+using System.Reflection;
+using Microsoft.Build.Utilities;
+using MonoDevelop.Projects.MSBuild.Conditions;
+using System.Globalization;
+using Microsoft.Build.Evaluation;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ class MSBuildEvaluationContext: IExpressionContext
+ {
+ Dictionary<string,string> properties = new Dictionary<string, string> ();
+
+ bool allResolved;
+ MSBuildProject project;
+ MSBuildEvaluationContext parentContext;
+
+ string itemFile;
+ string recursiveDir;
+
+ public MSBuildEvaluationContext ()
+ {
+ }
+
+ public MSBuildEvaluationContext (MSBuildEvaluationContext parentContext)
+ {
+ this.parentContext = parentContext;
+ this.project = parentContext.project;
+ }
+
+ internal void InitEvaluation (MSBuildProject project)
+ {
+ this.project = project;
+
+ // Project file properties
+
+ properties.Add ("MSBuildThisFile", Path.GetFileName (project.FileName));
+ properties.Add ("MSBuildThisFileName", project.FileName.FileNameWithoutExtension);
+ properties.Add ("MSBuildThisFileExtension", Path.GetExtension (project.FileName));
+ properties.Add ("MSBuildThisFileFullPath", MSBuildProjectService.ToMSBuildPath (null, project.FileName.FullPath));
+
+ string dir = Path.GetDirectoryName (project.FileName) + Path.DirectorySeparatorChar;
+ properties.Add ("MSBuildThisFileDirectory", MSBuildProjectService.ToMSBuildPath (null, dir));
+ properties.Add ("MSBuildThisFileDirectoryNoRoot", MSBuildProjectService.ToMSBuildPath (null, dir.Substring (Path.GetPathRoot (dir).Length)));
+
+ // Properties only set for the root project, not for imported projects
+
+ if (parentContext == null) {
+ properties.Add ("VisualStudioReferenceAssemblyVersion", project.ToolsVersion + ".0.0");
+ properties.Add ("MSBuildProjectDefaultTargets", project.DefaultTargets);
+ properties.Add ("MSBuildProjectExtension", Path.GetExtension (project.FileName));
+ properties.Add ("MSBuildProjectFile", project.FileName.FileName);
+ properties.Add ("MSBuildProjectFullPath", MSBuildProjectService.ToMSBuildPath (null, project.FileName.FullPath.ToString()));
+ properties.Add ("MSBuildProjectName", project.FileName.FileNameWithoutExtension);
+
+ dir = project.BaseDirectory.IsNullOrEmpty ? Environment.CurrentDirectory : project.BaseDirectory.ToString();
+ properties.Add ("MSBuildProjectDirectory", MSBuildProjectService.ToMSBuildPath (null, dir));
+ properties.Add ("MSBuildProjectDirectoryNoRoot", MSBuildProjectService.ToMSBuildPath (null, dir.Substring (Path.GetPathRoot (dir).Length)));
+
+ string toolsVersion = project.ToolsVersion;
+ if (string.IsNullOrEmpty (toolsVersion) || Version.Parse (toolsVersion) < new Version ("12.0"))
+ toolsVersion = "12.0";
+ string toolsPath = ToolLocationHelper.GetPathToBuildTools ("12.0");
+
+ var frameworkToolsPath = ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.VersionLatest);
+
+ properties.Add ("MSBuildBinPath", MSBuildProjectService.ToMSBuildPath (null, toolsPath));
+ properties.Add ("MSBuildToolsPath", MSBuildProjectService.ToMSBuildPath (null, toolsPath));
+ properties.Add ("MSBuildToolsRoot", MSBuildProjectService.ToMSBuildPath (null, Path.GetDirectoryName (toolsPath)));
+ properties.Add ("MSBuildToolsVersion", toolsVersion);
+ properties.Add ("OS", Platform.IsWindows ? "Windows_NT" : "Unix");
+
+ properties.Add ("MSBuildBinPath32", MSBuildProjectService.ToMSBuildPath (null, toolsPath));
+
+ properties.Add ("MSBuildFrameworkToolsPath", MSBuildProjectService.ToMSBuildPath (null, frameworkToolsPath));
+ properties.Add ("MSBuildFrameworkToolsPath32", MSBuildProjectService.ToMSBuildPath (null, frameworkToolsPath));
+
+ if (Platform.IsWindows) {
+ // Taken from MSBuild source:
+ var programFiles = Environment.GetFolderPath (Environment.SpecialFolder.ProgramFiles);
+ var programFiles32 = Environment.GetFolderPath (Environment.SpecialFolder.ProgramFilesX86);
+ if (string.IsNullOrEmpty(programFiles32))
+ programFiles32 = programFiles; // 32 bit box
+
+ string programFiles64;
+ if (programFiles == programFiles32) {
+ // either we're in a 32-bit window, or we're on a 32-bit machine.
+ // if we're on a 32-bit machine, ProgramW6432 won't exist
+ // if we're on a 64-bit machine, ProgramW6432 will point to the correct Program Files.
+ programFiles64 = Environment.GetEnvironmentVariable("ProgramW6432");
+ }
+ else {
+ // 64-bit window on a 64-bit machine; %ProgramFiles% points to the 64-bit
+ // Program Files already.
+ programFiles64 = programFiles;
+ }
+
+ var extensionsPath32 = MSBuildProjectService.ToMSBuildPath (null, Path.Combine (programFiles32, "MSBuild"));
+ properties.Add ("MSBuildExtensionsPath32", extensionsPath32);
+
+ if (programFiles64 != null)
+ properties.Add ("MSBuildExtensionsPath64", MSBuildProjectService.ToMSBuildPath (null, Path.Combine(programFiles64, "MSBuild")));
+
+ // MSBuildExtensionsPath: The way this used to work is that it would point to "Program Files\MSBuild" on both
+ // 32-bit and 64-bit machines. We have a switch to continue using that behavior; however the default is now for
+ // MSBuildExtensionsPath to always point to the same location as MSBuildExtensionsPath32.
+
+ bool useLegacyMSBuildExtensionsPathBehavior = !String.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDLEGACYEXTENSIONSPATH"));
+
+ string extensionsPath;
+ if (useLegacyMSBuildExtensionsPathBehavior)
+ extensionsPath = Path.Combine (programFiles, "MSBuild");
+ else
+ extensionsPath = extensionsPath32;
+ properties.Add ("MSBuildExtensionsPath", extensionsPath);
+ }
+ else if (!String.IsNullOrEmpty (DefaultExtensionsPath)) {
+ var ep = MSBuildProjectService.ToMSBuildPath (null, extensionsPath);
+ properties.Add ("MSBuildExtensionsPath", ep);
+ properties.Add ("MSBuildExtensionsPath32", ep);
+ properties.Add ("MSBuildExtensionsPath64", ep);
+ }
+
+ // Environment
+
+ properties.Add ("MSBuildProgramFiles32", MSBuildProjectService.ToMSBuildPath (null, Environment.GetFolderPath (Environment.SpecialFolder.ProgramFilesX86)));
+ }
+ }
+
+ static string extensionsPath;
+
+ internal static string DefaultExtensionsPath {
+ get {
+ if (extensionsPath == null) {
+ // NOTE: code from mcs/tools/gacutil/driver.cs
+ PropertyInfo gac = typeof (System.Environment).GetProperty (
+ "GacPath", BindingFlags.Static | BindingFlags.NonPublic);
+
+ if (gac != null) {
+ MethodInfo get_gac = gac.GetGetMethod (true);
+ string gac_path = (string) get_gac.Invoke (null, null);
+ extensionsPath = Path.GetFullPath (Path.Combine (
+ gac_path, Path.Combine ("..", "xbuild")));
+ }
+ }
+ return extensionsPath;
+ }
+ }
+
+ static string DotConfigExtensionsPath = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), Path.Combine ("xbuild", "tasks"));
+ const string MacOSXExternalXBuildDir = "/Library/Frameworks/Mono.framework/External/xbuild";
+
+ internal static IEnumerable<string> GetApplicableExtensionsPaths ()
+ {
+ // On windows there is a single extension path, which is already properly defined in the engine
+ if (Platform.IsWindows)
+ yield return null;
+ if (Platform.IsMac)
+ yield return MacOSXExternalXBuildDir;
+ yield return DotConfigExtensionsPath;
+ yield return DefaultExtensionsPath;
+ }
+
+ internal void SetItemContext (string itemFile, string recursiveDir)
+ {
+ this.itemFile = itemFile;
+ this.recursiveDir = recursiveDir;
+ }
+
+ internal void ClearItemContext ()
+ {
+ this.itemFile = null;
+ this.recursiveDir = null;
+ }
+
+ string GetPropertyValue (string name)
+ {
+ string val;
+ if (properties.TryGetValue (name, out val))
+ return val;
+ if (parentContext != null)
+ return parentContext.GetPropertyValue (name);
+ else
+ return Environment.GetEnvironmentVariable (name);
+ }
+
+ public string GetMetadataValue (string name)
+ {
+ if (itemFile == null)
+ return "";
+
+ switch (name.ToLower ()) {
+ case "fullpath": return ToMSBuildPath (Path.GetFullPath (itemFile));
+ case "rootdir": return ToMSBuildDir (Path.GetPathRoot (itemFile));
+ case "filename": return Path.GetFileNameWithoutExtension (itemFile);
+ case "extension": return Path.GetExtension (itemFile);
+ case "relativedir": return ToMSBuildDir (new FilePath (itemFile).ToRelative (project.BaseDirectory).ParentDirectory);
+ case "directory": {
+ var root = Path.GetPathRoot (itemFile);
+ if (!string.IsNullOrEmpty (root))
+ return ToMSBuildDir (Path.GetFullPath (itemFile).Substring (root.Length));
+ return ToMSBuildDir (Path.GetFullPath (itemFile));
+ }
+ case "recursivedir": return recursiveDir != null ? ToMSBuildDir (recursiveDir) : "";
+ case "identity": return ToMSBuildPath (itemFile);
+ case "modifiedtime": {
+ try {
+ return File.GetLastWriteTime (itemFile).ToString ("yyyy-MM-dd hh:mm:ss");
+ } catch {
+ return "";
+ }
+ }
+ case "createdtime": {
+ try {
+ return File.GetCreationTime (itemFile).ToString ("yyyy-MM-dd hh:mm:ss");
+ } catch {
+ return "";
+ }
+ }
+ case "accessedtime": {
+ try {
+ return File.GetLastAccessTime (itemFile).ToString ("yyyy-MM-dd hh:mm:ss");
+ } catch {
+ return "";
+ }
+ }
+ }
+ return "";
+ }
+
+ string ToMSBuildPath (string path)
+ {
+ return path.Replace ('/','\\');
+ }
+
+ string ToMSBuildDir (string path)
+ {
+ path = path.Replace ('/','\\');
+ if (!path.EndsWith ("\\", StringComparison.Ordinal))
+ path = path + '\\';
+ return path;
+ }
+
+ public void SetPropertyValue (string name, string value)
+ {
+ if (parentContext != null)
+ parentContext.SetPropertyValue (name, value);
+ else
+ properties [name] = value;
+ }
+
+ public void ClearPropertyValue (string name)
+ {
+ properties.Remove (name);
+ if (parentContext != null)
+ parentContext.ClearPropertyValue (name);
+ }
+
+ XmlNode EvaluateNode (XmlNode source)
+ {
+ var elemSource = source as XmlElement;
+ if (elemSource != null) {
+ var elem = source.OwnerDocument.CreateElement (elemSource.Prefix, elemSource.LocalName, elemSource.NamespaceURI);
+ foreach (XmlAttribute attr in elemSource.Attributes)
+ elem.Attributes.Append ((XmlAttribute)EvaluateNode (attr));
+ foreach (XmlNode child in elemSource.ChildNodes)
+ elem.AppendChild (EvaluateNode (child));
+ return elem;
+ }
+
+ var attSource = source as XmlAttribute;
+ if (attSource != null) {
+ bool oldResolved = allResolved;
+ var att = source.OwnerDocument.CreateAttribute (attSource.Prefix, attSource.LocalName, attSource.NamespaceURI);
+ att.Value = Evaluate (attSource.Value);
+
+ // Condition attributes don't change the resolution status. Conditions are handled in the property and item objects
+ if (attSource.Name == "Condition")
+ allResolved = oldResolved;
+
+ return att;
+ }
+ var textSource = source as XmlText;
+ if (textSource != null) {
+ return source.OwnerDocument.CreateTextNode (Evaluate (textSource.InnerText));
+ }
+ return source.Clone ();
+ }
+
+ readonly static char[] tagStart = new [] {'$','%','@'};
+
+ public string Evaluate (string str)
+ {
+ if (str == null)
+ return null;
+
+ int i = FindNextTag (str, 0);
+ if (i == -1)
+ return str;
+
+ int last = 0;
+
+ StringBuilder sb = new StringBuilder ();
+ do {
+ sb.Append (str, last, i - last);
+ int j = i;
+ object val;
+ if (!EvaluateReference (str, ref j, out val))
+ allResolved = false;
+ sb.Append (ValueToString (val));
+ last = j;
+
+ i = FindNextTag (str, last);
+ }
+ while (i != -1);
+
+ sb.Append (str, last, str.Length - last);
+ return sb.ToString ();
+ }
+
+ bool EvaluateReference (string str, ref int i, out object val)
+ {
+ val = null;
+ var tag = str[i];
+ int start = i;
+
+ i += 2;
+ int j = FindClosingChar (str, i, ')');
+ if (j == -1) {
+ val = str.Substring (start);
+ i = str.Length;
+ return false;
+ }
+
+ string prop = str.Substring (i, j - i).Trim ();
+ i = j + 1;
+
+ bool res = false;
+ if (prop.Length > 0) {
+ switch (tag) {
+ case '$': res = EvaluateProperty (prop, out val); break;
+ case '%': res = EvaluateMetadata (prop, out val); break;
+ case '@': res = EvaluateList (prop, out val); break;
+ }
+ }
+ if (!res)
+ val = str.Substring (start, j - start + 1);
+ return res;
+ }
+
+ string ValueToString (object ob)
+ {
+ return ob != null ? Convert.ToString (ob, CultureInfo.InvariantCulture) : string.Empty;
+ }
+
+ bool EvaluateProperty (string prop, out object val)
+ {
+ val = null;
+ if (prop [0] == '[') {
+ int i = prop.IndexOf (']');
+ if (i == -1 || (prop.Length - i) < 3 || prop [i + 1] != ':' || prop [i + 2] != ':')
+ return false;
+ var typeName = prop.Substring (1, i - 1).Trim ();
+ if (typeName.Length == 0)
+ return false;
+ var type = ResolveType (typeName);
+ if (type == null)
+ return false;
+ i += 3;
+ return EvaluateMember (type, null, prop, i, out val);
+ }
+ int n = prop.IndexOf ('.');
+ if (n == -1) {
+ val = GetPropertyValue (prop) ?? string.Empty;
+ return true;
+ } else {
+ var pn = prop.Substring (0, n);
+ val = GetPropertyValue (pn) ?? string.Empty;
+ return EvaluateMember (typeof(string), val, prop, n + 1, out val);
+ }
+ }
+
+ bool EvaluateMember (Type type, object instance, string str, int i, out object val)
+ {
+ val = null;
+
+ // Find the delimiter of the member
+ int j = str.IndexOfAny (new [] { '.', ')', '(' }, i);
+ if (j == -1)
+ j = str.Length;
+
+ var memberName = str.Substring (i, j - i).Trim ();
+ if (memberName.Length == 0)
+ return false;
+
+ var member = ResolveMember (type, memberName, instance == null);
+ if (member.Length == 0)
+ return false;
+
+ if (j < str.Length && str[j] == '(') {
+ // It is a method invocation
+ object [] parameterValues;
+ j++;
+ if (!EvaluateParameters (str, ref j, out parameterValues))
+ return false;
+
+ // Find a method with a matching number of parameters
+ var method = FindBestOverload (member.OfType<MethodInfo> (), parameterValues);
+ if (method == null)
+ return false;
+
+ try {
+ // Convert the given parameters to the types specified in the method signature
+ var methodParams = method.GetParameters ();
+
+ var convertedArgs = (methodParams.Length == parameterValues.Length) ? parameterValues : new object [methodParams.Length];
+
+ int numArgs = methodParams.Length;
+ Type paramsArgType = null;
+ if (methodParams.Length > 0 && methodParams [methodParams.Length - 1].ParameterType.IsArray && methodParams [methodParams.Length - 1].IsDefined (typeof (ParamArrayAttribute))) {
+ paramsArgType = methodParams [methodParams.Length - 1].ParameterType.GetElementType ();
+ numArgs--;
+ }
+
+ int n;
+ for (n = 0; n < numArgs; n++)
+ convertedArgs [n] = ConvertArg (method, n, parameterValues [n], methodParams [n].ParameterType);
+
+ if (methodParams.Length == parameterValues.Length && paramsArgType != null) {
+ // Invoking an method with a params argument, but the number of arguments provided is the same as the
+ // number of arguments of the method, so the last argument can be either one of the values of the
+ // params array, or it can be the whole params array.
+ try {
+ var last = convertedArgs.Length - 1;
+ convertedArgs [last] = ConvertArg (method, last, parameterValues [last], methodParams [last].ParameterType);
+
+ // Conversion worked. Ignore the params argument.
+ paramsArgType = null;
+ } catch (InvalidCastException) {
+ // Conversion of the last argument failed, so it probably needs to be handled as a single value
+ // for the params argument.
+ }
+ }
+
+ if (paramsArgType != null) {
+ var argsArray = new object [parameterValues.Length - numArgs];
+ for (int m = 0; m < argsArray.Length; m++)
+ argsArray [m] = ConvertArg (method, n, parameterValues [n++], paramsArgType);
+ convertedArgs [convertedArgs.Length - 1] = argsArray;
+ }
+
+ // Invoke the method
+ val = method.Invoke (instance, convertedArgs);
+
+ // Skip the closing parens
+ j++;
+ }
+ catch (Exception ex) {
+ LoggingService.LogError ("MSBuild property evaluation failed: " + str, ex);
+ return false;
+ }
+ } else {
+ // It has to be a property or field
+ try {
+ if (member[0] is PropertyInfo)
+ val = ((PropertyInfo)member[0]).GetValue (instance);
+ else if (member[0] is FieldInfo)
+ val = ((FieldInfo)member[0]).GetValue (instance);
+ else
+ return false;
+ } catch (Exception ex) {
+ LoggingService.LogError ("MSBuild property evaluation failed: " + str, ex);
+ return false;
+ }
+ }
+ if (j < str.Length && str[j] == '.') {
+ // Chained member invocation
+ if (val == null)
+ return false;
+ return EvaluateMember (val.GetType (), val, str, j + 1, out val);
+ }
+ return true;
+ }
+
+ bool EvaluateParameters (string str, ref int i, out object[] parameters)
+ {
+ parameters = null;
+ var list = new List<object> ();
+
+ while (i < str.Length) {
+ var j = FindClosingChar (str, i, new [] { ',', ')' });
+ if (j == -1)
+ return false;
+
+ var arg = str.Substring (i, j - i).Trim ();
+
+ if (arg.Length == 0 && str [j] == ')' && list.Count == 0) {
+ // Empty parameters list
+ parameters = new object [0];
+ i = j;
+ return true;
+ }
+
+ // Trim enclosing quotation marks
+ if (arg.Length > 1 && IsQuote(arg [0]) && arg[arg.Length - 1] == arg [0])
+ arg = arg.Substring (1, arg.Length - 2);
+
+ list.Add (Evaluate (arg));
+
+ if (str [j] == ')') {
+ // End of parameters list
+ parameters = list.ToArray ();
+ i = j;
+ return true;
+ }
+ i = j + 1;
+ }
+ return false;
+ }
+
+ MethodInfo FindBestOverload (IEnumerable<MethodInfo> methods, object [] args)
+ {
+ MethodInfo methodWithParams = null;
+
+ foreach (var m in methods.OfType<MethodInfo> ()) {
+ var argInfo = m.GetParameters ();
+
+ // Exclude methods which take a complex object as argument
+ if (argInfo.Any (a => a.ParameterType != typeof(object) && Type.GetTypeCode (a.ParameterType) == TypeCode.Object && !IsParamsArg(a)))
+ continue;
+
+ if (args.Length >= argInfo.Length - 1 && argInfo.Length > 0 && IsParamsArg (argInfo [argInfo.Length - 1])) {
+ methodWithParams = m;
+ continue;
+ }
+ if (args.Length != argInfo.Length)
+ continue;
+
+ return m;
+ }
+ return methodWithParams;
+ }
+
+ bool IsParamsArg (ParameterInfo pi)
+ {
+ return pi.ParameterType.IsArray && pi.IsDefined (typeof (ParamArrayAttribute));
+ }
+
+ object ConvertArg (MethodInfo method, int argNum, object value, Type parameterType)
+ {
+ var sval = value as string;
+ if (sval == "null")
+ return null;
+
+ if (value == null)
+ return null;
+
+ if (sval != null && parameterType == typeof (char[]))
+ return sval.ToCharArray ();
+
+ if (sval != null && Path.DirectorySeparatorChar != '\\')
+ value = sval.Replace ('\\', Path.DirectorySeparatorChar);
+
+ var res = Convert.ChangeType (value, parameterType, CultureInfo.InvariantCulture);
+ bool convertPath = false;
+
+ if ((method.DeclaringType == typeof (System.IO.File) || method.DeclaringType == typeof (System.IO.Directory)) && argNum == 0) {
+ convertPath = true;
+ } else if (method.DeclaringType == typeof (IntrinsicFunctions)) {
+ if (method.Name == "MakeRelative")
+ convertPath = true;
+ else if (method.Name == "GetDirectoryNameOfFileAbove" && argNum == 0)
+ convertPath = true;
+ }
+
+ // The argument is a path. Convert to native path and make absolute
+ if (convertPath)
+ res = MSBuildProjectService.FromMSBuildPath (project.BaseDirectory, (string)res);
+
+ return res;
+ }
+
+ bool EvaluateMetadata (string prop, out object val)
+ {
+ val = GetMetadataValue (prop);
+ return val != null;
+ }
+
+ bool EvaluateList (string prop, out object val)
+ {
+ val = "";
+ return false;
+ }
+
+ Type ResolveType (string typeName)
+ {
+ if (typeName == "MSBuild")
+ return typeof (Microsoft.Build.Evaluation.IntrinsicFunctions);
+ else {
+ var t = supportedTypeMembers.FirstOrDefault (st => st.Item1.FullName == typeName);
+ if (t == null)
+ return null;
+ return t.Item1;
+ }
+ }
+
+ MemberInfo[] ResolveMember (Type type, string memberName, bool isStatic)
+ {
+ var flags = isStatic ? BindingFlags.Static : BindingFlags.Instance;
+ if (type != typeof (Microsoft.Build.Evaluation.IntrinsicFunctions)) {
+ var t = supportedTypeMembers.FirstOrDefault (st => st.Item1 == type);
+ if (t == null)
+ return null;
+ if (t.Item2 != null && !t.Item2.Contains (memberName))
+ return null;
+ } else
+ flags |= BindingFlags.NonPublic;
+
+ return type.GetMember (memberName, flags | BindingFlags.Public);
+ }
+
+ static Tuple<Type, string []> [] supportedTypeMembers = {
+ Tuple.Create (typeof(System.Byte), (string[]) null),
+ Tuple.Create (typeof(System.Char), (string[]) null),
+ Tuple.Create (typeof(System.Convert), (string[]) null),
+ Tuple.Create (typeof(System.DateTime), (string[]) null),
+ Tuple.Create (typeof(System.Decimal), (string[]) null),
+ Tuple.Create (typeof(System.Double), (string[]) null),
+ Tuple.Create (typeof(System.Enum), (string[]) null),
+ Tuple.Create (typeof(System.Guid), (string[]) null),
+ Tuple.Create (typeof(System.Int16), (string[]) null),
+ Tuple.Create (typeof(System.Int32), (string[]) null),
+ Tuple.Create (typeof(System.Int64), (string[]) null),
+ Tuple.Create (typeof(System.IO.Path), (string[]) null),
+ Tuple.Create (typeof(System.Math), (string[]) null),
+ Tuple.Create (typeof(System.UInt16), (string[]) null),
+ Tuple.Create (typeof(System.UInt32), (string[]) null),
+ Tuple.Create (typeof(System.UInt64), (string[]) null),
+ Tuple.Create (typeof(System.SByte), (string[]) null),
+ Tuple.Create (typeof(System.Single), (string[]) null),
+ Tuple.Create (typeof(System.String), (string[]) null),
+ Tuple.Create (typeof(System.StringComparer), (string[]) null),
+ Tuple.Create (typeof(System.TimeSpan), (string[]) null),
+ Tuple.Create (typeof(System.Text.RegularExpressions.Regex), (string[]) null),
+ Tuple.Create (typeof(Microsoft.Build.Utilities.ToolLocationHelper), (string[]) null),
+ Tuple.Create (typeof(System.Environment), new string [] {
+ "CommandLine", "ExpandEnvironmentVariables", "GetEnvironmentVariable", "GetEnvironmentVariables", "GetFolderPath", "GetLogicalDrives"
+ }),
+ Tuple.Create (typeof(System.IO.Directory), new string [] {
+ "GetDirectories", "GetFiles", "GetLastAccessTime", "GetLastWriteTime", "GetParent"
+ }),
+ Tuple.Create (typeof(System.IO.File), new string [] {
+ "Exists", "GetCreationTime", "GetAttributes", "GetLastAccessTime", "GetLastWriteTime", "ReadAllText"
+ }),
+ };
+
+ int FindNextTag (string str, int i)
+ {
+ do {
+ i = str.IndexOfAny (tagStart, i);
+ if (i == -1 || i == str.Length - 1)
+ break;
+ if (str[i + 1] == '(')
+ return i;
+ i++;
+ } while (i < str.Length);
+
+ return -1;
+ }
+
+ int FindClosingChar (string str, int i, char closeChar)
+ {
+ int pc = 0;
+ while (i < str.Length) {
+ var c = str [i];
+ if (pc == 0 && c == closeChar)
+ return i;
+ if (c == '(' || c == '[')
+ pc++;
+ else if (c == ')' || c == ']')
+ pc--;
+ else if (IsQuote (c)) {
+ i = str.IndexOf (c, i + 1);
+ if (i == -1)
+ return -1;
+ }
+ i++;
+ }
+ return -1;
+ }
+
+ bool IsQuote (char c)
+ {
+ return c == '"' || c == '\'' || c == '`';
+ }
+
+ int FindClosingChar (string str, int i, char[] closeChar)
+ {
+ int pc = 0;
+ while (i < str.Length) {
+ var c = str [i];
+ if (pc == 0 && closeChar.Contains (c))
+ return i;
+ if (c == '(' || c == '[')
+ pc++;
+ else if (c == ')' || c == ']')
+ pc--;
+ else if (IsQuote (c)) {
+ i = str.IndexOf (c, i + 1);
+ if (i == -1)
+ return -1;
+ }
+ i++;
+ }
+ return -1;
+ }
+
+ #region IExpressionContext implementation
+
+ public string EvaluateString (string value)
+ {
+ return Evaluate (value);
+ }
+
+ public string FullFileName {
+ get {
+ return project.FileName;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildFileFormat.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildFileFormat.cs
new file mode 100644
index 0000000000..12a69d7c01
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildFileFormat.cs
@@ -0,0 +1,371 @@
+// MSBuildFileFormat.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+using System;
+using System.Xml;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Assemblies;
+using MonoDevelop.Projects.Extensions;
+using System.Threading.Tasks;
+using System.Linq;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public abstract class MSBuildFileFormat
+ {
+ readonly SlnFileFormat slnFileFormat;
+
+ internal MSBuildFileFormat ()
+ {
+ slnFileFormat = new SlnFileFormat (this);
+ }
+
+ public static readonly MSBuildFileFormat VS2005 = new MSBuildFileFormatVS05 ();
+ public static readonly MSBuildFileFormat VS2008 = new MSBuildFileFormatVS08 ();
+ public static readonly MSBuildFileFormat VS2010 = new MSBuildFileFormatVS10 ();
+ public static readonly MSBuildFileFormat VS2012 = new MSBuildFileFormatVS12 ();
+
+ public static IEnumerable<MSBuildFileFormat> GetSupportedFormats ()
+ {
+ yield return VS2012;
+ yield return VS2010;
+ yield return VS2008;
+ yield return VS2005;
+ }
+
+ public static IEnumerable<MSBuildFileFormat> GetSupportedFormats (IMSBuildFileObject targetItem)
+ {
+ return GetSupportedFormats ().Where (f => f.CanWriteFile (targetItem));
+ }
+
+ public static MSBuildFileFormat DefaultFormat {
+ get { return VS2012; }
+ }
+
+ public string Name {
+ get { return "MSBuild"; }
+ }
+
+ public abstract Version Version { get; }
+
+ internal SlnFileFormat SlnFileFormat {
+ get { return slnFileFormat; }
+ }
+
+ public bool SupportsMonikers { get { return SupportedFrameworks == null; } }
+
+ public static bool ToolsSupportMonikers (string toolsVersion)
+ {
+ return new Version (toolsVersion) >= new Version ("4.0");
+ }
+
+ public bool SupportsFramework (TargetFramework fx)
+ {
+ return SupportsMonikers || ((IList<TargetFrameworkMoniker>)SupportedFrameworks).Contains (fx.Id);
+ }
+
+ internal virtual bool SupportsSlnVersion (string version)
+ {
+ return version == SlnVersion;
+ }
+
+ protected virtual bool SupportsToolsVersion (string version)
+ {
+ return version == DefaultToolsVersion;
+ }
+
+ public FilePath GetValidFormatName (object obj, FilePath fileName)
+ {
+ if (slnFileFormat.CanWriteFile (obj, this))
+ return slnFileFormat.GetValidFormatName (obj, fileName, this);
+ else {
+ string ext = MSBuildProjectService.GetExtensionForItem ((SolutionItem)obj);
+ if (!string.IsNullOrEmpty (ext))
+ return fileName.ChangeExtension ("." + ext);
+ else
+ return fileName;
+ }
+ }
+
+ internal bool CanReadFile (FilePath file, Type expectedType)
+ {
+ if (expectedType.IsAssignableFrom (typeof(Solution)) && slnFileFormat.CanReadFile (file, this))
+ return true;
+ else if (expectedType.IsAssignableFrom (typeof(SolutionItem))) {
+ if (!MSBuildProjectService.CanReadFile (file))
+ return false;
+ //TODO: check ProductVersion first
+ return SupportsToolsVersion (ReadToolsVersion (file));
+ }
+ return false;
+ }
+
+ public bool CanWriteFile (object obj)
+ {
+ if (slnFileFormat.CanWriteFile (obj, this)) {
+ Solution sol = (Solution) obj;
+ foreach (SolutionItem si in sol.GetAllItems<SolutionItem> ())
+ if (!CanWriteFile (si))
+ return false;
+ return true;
+ }
+ else if (obj is SolutionItem) {
+ DotNetProject p = obj as DotNetProject;
+ // Check the framework only if the project is not loading, since otherwise the
+ // project may not yet have the framework info set.
+ if (p != null && !p.Loading && !SupportsFramework (p.TargetFramework))
+ return false;
+
+ // This file format can write all types of projects. If there isn't a handler for a project,
+ // it will use a generic handler.
+ return true;
+ } else
+ return false;
+ }
+
+ public virtual IEnumerable<string> GetCompatibilityWarnings (object obj)
+ {
+ if (obj is Solution) {
+ List<string> msg = new List<string> ();
+ foreach (SolutionItem si in ((Solution)obj).GetAllItems<SolutionItem> ()) {
+ IEnumerable<string> ws = GetCompatibilityWarnings (si);
+ if (ws != null)
+ msg.AddRange (ws);
+ }
+ return msg;
+ }
+ var prj = obj as DotNetProject;
+ if (prj != null && !SupportsMonikers && !((IList)SupportedFrameworks).Contains (prj.TargetFramework.Id))
+ return new [] { GettextCatalog.GetString (
+ "The project '{0}' is being saved using the file format '{1}', but this version of Visual Studio " +
+ "does not support the framework that the project is targetting ({2})",
+ prj.Name, ProductDescription, prj.TargetFramework.Name)
+ };
+ return null;
+ }
+
+ internal async Task WriteFile (FilePath file, object obj, ProgressMonitor monitor)
+ {
+ if (slnFileFormat.CanWriteFile (obj, this)) {
+ await slnFileFormat.WriteFile (file, obj, true, monitor);
+ } else {
+ throw new NotSupportedException ();
+ }
+ }
+
+ internal async Task<object> ReadFile (FilePath file, Type expectedType, MonoDevelop.Core.ProgressMonitor monitor)
+ {
+ if (slnFileFormat.CanReadFile (file, this))
+ return await slnFileFormat.ReadFile (file, monitor);
+ else
+ throw new NotSupportedException ();
+ }
+
+ public abstract string DefaultToolsVersion { get; }
+
+ public abstract string SlnVersion { get; }
+
+ public virtual string DefaultProductVersion { get { return null; } }
+
+ public virtual string DefaultSchemaVersion { get { return null; } }
+
+ public abstract string ProductDescription { get; }
+
+ public virtual TargetFrameworkMoniker[] SupportedFrameworks {
+ get { return null; }
+ }
+
+ static string ReadToolsVersion (FilePath file)
+ {
+ try {
+ using (XmlTextReader tr = new XmlTextReader (new StreamReader (file))) {
+ if (tr.MoveToContent () == XmlNodeType.Element) {
+ if (tr.LocalName != "Project" || tr.NamespaceURI != "http://schemas.microsoft.com/developer/msbuild/2003")
+ return string.Empty;
+ string tv = tr.GetAttribute ("ToolsVersion");
+ if (string.IsNullOrEmpty (tv))
+ return "2.0"; // Some old VS versions don't specify the tools version, so assume 2.0
+ else
+ return tv;
+ }
+ }
+ } catch {
+ // Ignore
+ }
+ return string.Empty;
+ }
+
+ public abstract string Id { get; }
+ }
+
+ class MSBuildFileFormatVS05: MSBuildFileFormat
+ {
+ static readonly TargetFrameworkMoniker[] supportedFrameworks = {
+ TargetFrameworkMoniker.NET_2_0,
+ };
+
+ public override string Id {
+ get { return "MSBuild05"; }
+ }
+
+ public override Version Version {
+ get { return new Version ("2005"); }
+ }
+
+ public override string DefaultProductVersion {
+ get { return "8.0.50727"; }
+ }
+
+ public override string DefaultToolsVersion {
+ get { return "2.0"; }
+ }
+
+ public override string DefaultSchemaVersion {
+ get { return "2.0"; }
+ }
+
+ public override string SlnVersion {
+ get { return "9.00"; }
+ }
+
+ public override string ProductDescription {
+ get { return "Visual Studio 2005"; }
+ }
+
+ public override TargetFrameworkMoniker[] SupportedFrameworks {
+ get { return supportedFrameworks; }
+ }
+ }
+
+ class MSBuildFileFormatVS08: MSBuildFileFormat
+ {
+ static readonly TargetFrameworkMoniker[] supportedFrameworks = {
+ TargetFrameworkMoniker.NET_2_0,
+ TargetFrameworkMoniker.NET_3_0,
+ TargetFrameworkMoniker.NET_3_5,
+ TargetFrameworkMoniker.SL_2_0,
+ TargetFrameworkMoniker.SL_3_0,
+ TargetFrameworkMoniker.MONOTOUCH_1_0,
+ };
+
+ public override string Id {
+ get { return "MSBuild08"; }
+ }
+
+ public override Version Version {
+ get { return new Version ("2008"); }
+ }
+
+ public override string DefaultProductVersion {
+ get { return "9.0.21022"; }
+ }
+
+ public override string DefaultToolsVersion {
+ get { return "3.5"; }
+ }
+
+ public override string DefaultSchemaVersion {
+ get { return "2.0"; }
+ }
+
+ public override string SlnVersion {
+ get { return "10.00"; }
+ }
+
+ public override string ProductDescription {
+ get { return "Visual Studio 2008"; }
+ }
+
+ public override TargetFrameworkMoniker[] SupportedFrameworks {
+ get { return supportedFrameworks; }
+ }
+ }
+
+ class MSBuildFileFormatVS10: MSBuildFileFormat
+ {
+ public override string Id {
+ get { return "MSBuild10"; }
+ }
+
+ public override Version Version {
+ get { return new Version ("2010"); }
+ }
+
+ //WTF VS
+ public override string DefaultProductVersion {
+ get { return "8.0.30703"; }
+ }
+
+ public override string DefaultSchemaVersion {
+ get { return "2.0"; }
+ }
+
+ public override string DefaultToolsVersion {
+ get { return "4.0"; }
+ }
+
+ public override string SlnVersion {
+ get { return "11.00"; }
+ }
+
+ public override string ProductDescription {
+ get { return "Visual Studio 2010"; }
+ }
+ }
+
+ // this is actually VS2010 SP1 and later
+ class MSBuildFileFormatVS12: MSBuildFileFormat
+ {
+ public override string Id {
+ get { return "MSBuild12"; }
+ }
+
+ public override Version Version {
+ get { return new Version ("2012"); }
+ }
+
+ public override string DefaultToolsVersion {
+ get { return "4.0"; }
+ }
+
+ public override string SlnVersion {
+ get { return "12.00"; }
+ }
+
+ public override string ProductDescription {
+ get { return "Visual Studio 2012"; }
+ }
+
+ protected override bool SupportsToolsVersion (string version)
+ {
+ return version == "4.0" || version == "12.0" || version == "14.0";
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildFileFormatException.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildFileFormatException.cs
new file mode 100644
index 0000000000..4881170d82
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildFileFormatException.cs
@@ -0,0 +1,36 @@
+//
+// MSBuildFileFormatException.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+namespace MonoDevelop.Projects.MSBuild
+{
+ public class MSBuildFileFormatException: Exception
+ {
+ public MSBuildFileFormatException (string message): base (message)
+ {
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildImport.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildImport.cs
new file mode 100644
index 0000000000..bc821dad2e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildImport.cs
@@ -0,0 +1,119 @@
+//
+// MSBuildImport.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Xml;
+
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public class MSBuildImport: MSBuildElement
+ {
+ string target;
+
+ static readonly string [] knownAttributes = { "Project", "Label", "Condition" };
+
+ internal override string [] GetKnownAttributes ()
+ {
+ return knownAttributes;
+ }
+
+ internal override void ReadAttribute (string name, string value)
+ {
+ if (name == "Project")
+ target = value;
+ else
+ base.ReadAttribute (name, value);
+ }
+
+ internal override string WriteAttribute (string name)
+ {
+ if (name == "Project")
+ return target;
+ else
+ return base.WriteAttribute (name);
+ }
+
+ internal override string GetElementName ()
+ {
+ return "Import";
+ }
+
+ public string Project {
+ get { return target; }
+ set { AssertCanModify (); target = value; NotifyChanged (); }
+ }
+
+ internal override void Write (XmlWriter writer, WriteContext context)
+ {
+ if (context.Evaluating) {
+ var newTarget = MSBuildProjectService.GetImportRedirect (target);
+ if (newTarget != null) {
+ WritePatchedImport (writer, newTarget);
+ return;
+ }
+ }
+
+ base.Write (writer, context);
+ }
+
+ void WritePatchedImport (XmlWriter writer, string newTarget)
+ {
+ /* If an import redirect exists, add a fake import to the project which will be used only
+ if the original import doesn't exist. That is, the following import:
+
+ <Import Project = "PathToReplace" />
+
+ will be converted into:
+
+ <Import Project = "PathToReplace" Condition = "Exists('PathToReplace')"/>
+ <Import Project = "ReplacementPath" Condition = "!Exists('PathToReplace')" />
+ */
+
+ // Modify the original import by adding a condition, so that this import will be used only
+ // if the targets file exists.
+
+ string cond = "Exists('" + target + "')";
+ if (!string.IsNullOrEmpty (Condition))
+ cond = "( " + Condition + " ) AND " + cond;
+
+ writer.WriteStartElement ("Import", MSBuildProject.Schema);
+ writer.WriteAttributeString ("Project", target);
+ writer.WriteAttributeString ("Condition", cond);
+
+ // Now add the fake import, with a condition so that it will be used only if the original
+ // import does not exist.
+
+ cond = "!Exists('" + target + "')";
+ if (!string.IsNullOrEmpty (Condition))
+ cond = "( " + Condition + " ) AND " + cond;
+
+ writer.WriteStartElement ("Import", MSBuildProject.Schema);
+ writer.WriteAttributeString ("Project", MSBuildProjectService.ToMSBuildPath (null, newTarget));
+ writer.WriteAttributeString ("Condition", cond);
+ }
+ }
+
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildImportAttribute.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildImportAttribute.cs
new file mode 100644
index 0000000000..f1493475b1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildImportAttribute.cs
@@ -0,0 +1,41 @@
+//
+// MSBuildImportAttribute.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ [AttributeUsage (AttributeTargets.Class)]
+ public class MSBuildImportAttribute: Attribute
+ {
+ public MSBuildImportAttribute (string project)
+ {
+ Project = project;
+ }
+
+ public string Project { get; set; }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildImportGroup.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildImportGroup.cs
new file mode 100644
index 0000000000..48d2e81d64
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildImportGroup.cs
@@ -0,0 +1,92 @@
+//
+// MSBuildImportGroup.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Xml;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public class MSBuildImportGroup: MSBuildElement
+ {
+ internal override void ReadChildElement (MSBuildXmlReader reader)
+ {
+ if (reader.LocalName == "Import") {
+ var item = new MSBuildImport ();
+ item.ParentNode = this;
+ item.Read (reader);
+ ChildNodes = ChildNodes.Add (item);
+ } else
+ base.ReadChildElement (reader);
+ }
+
+ internal override string GetElementName ()
+ {
+ return "ImportGroup";
+ }
+
+ public bool IsImported {
+ get;
+ set;
+ }
+
+ public MSBuildImport AddNewImport (string name, string condition = null, MSBuildImport beforeImport = null)
+ {
+ AssertCanModify ();
+ var import = new MSBuildImport ();
+ import.Project = name;
+ import.Condition = condition;
+
+ int insertIndex = -1;
+ if (beforeImport != null)
+ insertIndex = ChildNodes.IndexOf (beforeImport);
+
+ if (insertIndex != -1)
+ ChildNodes = ChildNodes.Insert (insertIndex, import);
+ else
+ ChildNodes = ChildNodes.Add (import);
+
+ import.ResetIndent (false);
+ NotifyChanged ();
+ return import;
+ }
+
+ public void RemoveImport (MSBuildImport import)
+ {
+ AssertCanModify ();
+ if (import.ParentObject == this) {
+ import.RemoveIndent ();
+ ChildNodes = ChildNodes.Remove (import);
+ NotifyChanged ();
+ }
+ }
+
+ public IEnumerable<MSBuildImport> Imports {
+ get { return ChildNodes.OfType<MSBuildImport> (); }
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildItem.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildItem.cs
new file mode 100644
index 0000000000..62c2c9c633
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildItem.cs
@@ -0,0 +1,225 @@
+//
+// MSBuildItem.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Xml;
+using System.Collections.Generic;
+using System;
+using System.Collections.Immutable;
+
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public class MSBuildItem: MSBuildElement
+ {
+ MSBuildPropertyGroup metadata;
+ string name;
+ string include;
+ string exclude;
+
+ public MSBuildItem ()
+ {
+ metadata = new MSBuildPropertyGroup ();
+ metadata.UppercaseBools = true;
+ metadata.ParentNode = this;
+ }
+
+ public MSBuildItem (string name): this ()
+ {
+ this.name = name;
+ }
+
+ static readonly string [] knownAttributes = { "Include", "Exclude", "Condition", "Label" };
+
+ internal override string [] GetKnownAttributes ()
+ {
+ return knownAttributes;
+ }
+
+ internal override void ReadAttribute (string name, string value)
+ {
+ if (name == "Include")
+ include = value;
+ else if (name == "Exclude")
+ exclude = value;
+ else
+ base.ReadAttribute (name, value);
+ }
+
+ internal override string WriteAttribute (string name)
+ {
+ if (name == "Include")
+ return include;
+ else if (name == "Exclude")
+ return exclude;
+ else
+ return base.WriteAttribute (name);
+ }
+
+ internal override void Read (MSBuildXmlReader reader)
+ {
+ name = reader.LocalName;
+ base.Read (reader);
+ }
+
+ internal override void ReadChildElement (MSBuildXmlReader reader)
+ {
+ metadata.ReadChildElement (reader);
+ }
+
+ internal override void Write (XmlWriter writer, WriteContext context)
+ {
+ base.Write (writer, context);
+ if (context.Evaluating) {
+ string id = context.ItemMap.Count.ToString ();
+ context.ItemMap [id] = this;
+ }
+ }
+
+ internal override string GetElementName ()
+ {
+ return name;
+ }
+
+ public MSBuildItemGroup ParentGroup {
+ get {
+ return (MSBuildItemGroup)ParentObject;
+ }
+ }
+
+ public string Include {
+ get { return include; }
+ set {
+ AssertCanModify ();
+ include = value;
+ NotifyChanged ();
+ }
+ }
+
+ public string Exclude {
+ get { return exclude; }
+ set {
+ AssertCanModify ();
+ exclude = value;
+ NotifyChanged ();
+ }
+ }
+
+ public bool IsImported {
+ get;
+ set;
+ }
+
+ public string Name {
+ get { return name; }
+ }
+
+ public IMSBuildPropertySet Metadata {
+ get {
+ return metadata;
+ }
+ }
+
+ internal int EvaluatedItemCount { get; set; }
+
+ internal bool IsWildcardItem {
+ get { return EvaluatedItemCount > 1 && (Include.Contains ("*") || Include.Contains (";")); }
+ }
+ }
+
+ class MSBuildItemEvaluated: IMSBuildItemEvaluated
+ {
+ MSBuildPropertyGroupEvaluated metadata;
+ string evaluatedInclude;
+ string include;
+ MSBuildItem sourceItem;
+
+ internal MSBuildItemEvaluated (MSBuildProject parent, string name, string include, string evaluatedInclude)
+ {
+ this.include = include;
+ this.evaluatedInclude = evaluatedInclude;
+ metadata = new MSBuildPropertyGroupEvaluated (parent);
+ Name = name;
+ }
+
+ public string Label { get; internal set; }
+
+ public string Condition { get; internal set; }
+
+ public string Include {
+ get { return evaluatedInclude; }
+ }
+
+ public string UnevaluatedInclude {
+ get { return include; }
+ }
+
+ public bool IsImported {
+ get;
+ internal set;
+ }
+
+ public string Name { get; private set; }
+
+ public IMSBuildPropertyGroupEvaluated Metadata {
+ get {
+ return metadata;
+ }
+ }
+
+ public MSBuildItem SourceItem {
+ get { return sourceItem; }
+ set { sourceItem = value; sourceItem.EvaluatedItemCount++; }
+ }
+
+ public override string ToString ()
+ {
+ return string.Format ("<{0} Include='{1}'>", Name, Include);
+ }
+ }
+
+
+ public interface IMSBuildItemEvaluated
+ {
+ string Include { get; }
+
+ string UnevaluatedInclude { get; }
+
+ string Condition { get; }
+
+ bool IsImported { get; }
+
+ string Name { get; }
+
+ IMSBuildPropertyGroupEvaluated Metadata { get; }
+
+ /// <summary>
+ /// The project item that generated this item. Null if this item has not been
+ /// generated by a project item declared in an ItemGroup.
+ /// </summary>
+ /// <value>The source item.</value>
+ MSBuildItem SourceItem { get; }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildItemGroup.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildItemGroup.cs
new file mode 100644
index 0000000000..ecbcf2d05d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildItemGroup.cs
@@ -0,0 +1,91 @@
+//
+// MSBuildItemGroup.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Collections.Generic;
+using System.Xml;
+using System.Linq;
+using System;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public class MSBuildItemGroup: MSBuildElement
+ {
+ internal override void ReadChildElement (MSBuildXmlReader reader)
+ {
+ var item = new MSBuildItem ();
+ item.ParentNode = this;
+ item.Read (reader);
+ ChildNodes = ChildNodes.Add (item);
+ }
+
+ internal override string GetElementName ()
+ {
+ return "ItemGroup";
+ }
+
+ public bool IsImported {
+ get;
+ set;
+ }
+
+ public MSBuildItem AddNewItem (string name, string include)
+ {
+ AssertCanModify ();
+ var it = new MSBuildItem (name);
+ it.Include = include;
+ AddItem (it);
+ return it;
+ }
+
+ public void AddItem (MSBuildItem item)
+ {
+ AssertCanModify ();
+ item.ParentNode = this;
+ ChildNodes = ChildNodes.Add (item);
+ item.ResetIndent (false);
+ if (ParentProject != null)
+ ParentProject.NotifyChanged ();
+ }
+
+ public IEnumerable<MSBuildItem> Items {
+ get {
+ return ChildNodes.OfType<MSBuildItem> ();
+ }
+ }
+
+ internal void RemoveItem (MSBuildItem item)
+ {
+ AssertCanModify ();
+ if (ChildNodes.Contains (item)) {
+ item.RemoveIndent ();
+ ChildNodes = ChildNodes.Remove (item);
+ item.ParentNode = null;
+ NotifyChanged ();
+ }
+ }
+ }
+
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildObject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildObject.cs
new file mode 100644
index 0000000000..4b8de4f6a6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildObject.cs
@@ -0,0 +1,428 @@
+//
+// MSBuildObject.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+//#define ATTR_STATS
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Linq;
+using System.Xml;
+
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public abstract class MSBuildObject: MSBuildNode
+ {
+ UnknownAttribute[] unknownAttributes;
+ string [] attributeOrder;
+ ImmutableList<MSBuildNode> children = ImmutableList<MSBuildNode>.Empty;
+ EmptyElementMode emptyElementMode;
+
+ enum EmptyElementMode : byte
+ {
+ Unknown, Empty, NotEmpty
+ }
+
+ class UnknownAttribute
+ {
+ public string LocalName;
+ public string Prefix;
+ public string Namespace;
+ public string Value;
+ public string AfterAttribute;
+ }
+
+ internal object StartInnerWhitespace { get; set; }
+ internal object EndInnerWhitespace { get; set; }
+
+ internal virtual bool PreferEmptyElement { get { return true; } }
+
+ #if ATTR_STATS
+ public static StringCounter UnknownAtts = new StringCounter ();
+ public static StringCounter KnownAttOrder = new StringCounter ();
+ #endif
+
+ internal override void Read (MSBuildXmlReader reader)
+ {
+ if (reader.ForEvaluation) {
+ if (reader.MoveToFirstAttribute ()) {
+ do {
+ ReadAttribute (reader.LocalName, reader.Value);
+ } while (reader.MoveToNextAttribute ());
+ }
+ } else {
+ StartWhitespace = reader.ConsumeWhitespace ();
+
+ if (reader.MoveToFirstAttribute ()) {
+ var knownAtts = GetKnownAttributes ();
+ int attOrderIndex = 0;
+ int expectedKnownAttIndex = 0;
+ bool attOrderIsUnexpected = false;
+ List<UnknownAttribute> unknownAttsList = null;
+ attributeOrder = new string [knownAtts.Length];
+ string lastAttr = null;
+ do {
+ var attName = reader.LocalName;
+ int i = Array.IndexOf (knownAtts, attName);
+ if (i == -1) {
+ if (attName == "xmlns")
+ continue;
+
+ #if ATTR_STATS
+ UnknownAtts.Add (GetType ().Name + " " + attName);
+ #endif
+
+ var ua = new UnknownAttribute {
+ LocalName = attName,
+ Prefix = !string.IsNullOrEmpty (reader.Prefix) ? reader.Prefix : null,
+ Namespace = reader.NamespaceURI,
+ Value = reader.Value,
+ AfterAttribute = lastAttr
+ };
+ if (unknownAttsList == null)
+ unknownAttsList = new List<UnknownAttribute> ();
+ unknownAttsList.Add (ua);
+ lastAttr = null;
+ } else {
+ if (attOrderIndex >= attributeOrder.Length)
+ throw new InvalidOperationException ("Attribute specified twice");
+ attributeOrder [attOrderIndex++] = attName;
+ ReadAttribute (attName, reader.Value);
+ if (i < expectedKnownAttIndex) {
+ // Attributes have an unexpected order
+ attOrderIsUnexpected = true;
+ }
+ expectedKnownAttIndex = i + 1;
+ lastAttr = attName;
+ }
+ } while (reader.MoveToNextAttribute ());
+
+ if (unknownAttsList != null)
+ unknownAttributes = unknownAttsList.ToArray ();
+ if (!attOrderIsUnexpected)
+ attributeOrder = null;
+ else {
+ // Fill the remaning slots in the attributeOrder array (known attributes that were not read)
+ foreach (var a in knownAtts) {
+ if (!attributeOrder.Contains (a)) {
+ if (attOrderIndex >= attributeOrder.Length)
+ throw new InvalidOperationException ("Attribute specified twice");
+ attributeOrder [attOrderIndex++] = a;
+ }
+ }
+ }
+
+ #if ATTR_STATS
+ var atts = GetType().Name + " - " + string.Join (", ", (attributeOrder ?? knownAtts));
+ if (attributeOrder == null)
+ atts += " *";
+ KnownAttOrder.Add (atts);
+ #endif
+ }
+ }
+ reader.MoveToElement ();
+
+ emptyElementMode = reader.IsEmptyElement ? EmptyElementMode.Empty : EmptyElementMode.NotEmpty;
+
+ if (!string.IsNullOrEmpty (reader.Prefix) && !SupportsNamespacePrefixes)
+ throw new MSBuildFileFormatException ("XML namespace prefixes are not supported for " + reader.LocalName + " elements");
+
+ ReadContent (reader);
+
+ while (reader.IsWhitespace)
+ reader.ReadAndStoreWhitespace ();
+
+ EndWhitespace = reader.ConsumeWhitespaceUntilNewLine ();
+ }
+
+ internal virtual void ReadContent (MSBuildXmlReader reader)
+ {
+ if (reader.IsEmptyElement) {
+ reader.Skip ();
+ return;
+ }
+ var elemName = reader.LocalName;
+
+ reader.Read ();
+ bool childFound = false;
+
+ while (reader.NodeType != XmlNodeType.EndElement) {
+ if (reader.NodeType == XmlNodeType.Element) {
+ if (!childFound) {
+ childFound = true;
+ StartInnerWhitespace = reader.ConsumeWhitespaceUntilNewLine ();
+ }
+ ReadChildElement (reader);
+ } else if (reader.NodeType == XmlNodeType.Text) {
+ if (!SupportsTextContent)
+ throw new MSBuildFileFormatException ("Text content is not allowed inside a " + elemName + " element");
+ if (!childFound) {
+ childFound = true;
+ StartInnerWhitespace = reader.ConsumeWhitespaceUntilNewLine ();
+ }
+ var tn = new MSBuildXmlTextNode ();
+ tn.Read (reader);
+ ChildNodes = ChildNodes.Add (tn);
+ } else if (reader.NodeType == XmlNodeType.CDATA) {
+ if (!childFound) {
+ childFound = true;
+ StartInnerWhitespace = reader.ConsumeWhitespaceUntilNewLine ();
+ }
+ var tn = new MSBuildXmlCDataNode ();
+ tn.Read (reader);
+ ChildNodes = ChildNodes.Add (tn);
+ } else if (reader.NodeType == XmlNodeType.Comment) {
+ if (!childFound) {
+ childFound = true;
+ StartInnerWhitespace = reader.ConsumeWhitespaceUntilNewLine ();
+ }
+ var tn = new MSBuildXmlCommentNode ();
+ tn.Read (reader);
+ ChildNodes = ChildNodes.Add (tn);
+ } else if (reader.IsWhitespace) {
+ reader.ReadAndStoreWhitespace ();
+ } else if (reader.EOF)
+ throw new InvalidOperationException ("Invalid XML");
+ else
+ reader.Read ();
+ }
+ reader.Read ();
+
+ EndInnerWhitespace = reader.ConsumeWhitespace ();
+ }
+
+ internal override void Write (XmlWriter writer, WriteContext context)
+ {
+ MSBuildWhitespace.Write (StartWhitespace, writer);
+
+ writer.WriteStartElement (NamespacePrefix, GetElementName (), Namespace);
+
+ if (unknownAttributes != null) {
+ int unknownIndex = 0;
+ int knownIndex = 0;
+ var knownAtts = attributeOrder ?? GetKnownAttributes ();
+ string lastAttr = null;
+ do {
+ if (unknownIndex < unknownAttributes.Length && (lastAttr == unknownAttributes [unknownIndex].AfterAttribute || unknownAttributes [unknownIndex].AfterAttribute == null)) {
+ var att = unknownAttributes [unknownIndex++];
+ writer.WriteAttributeString (att.Prefix, att.LocalName, att.Namespace, att.Value);
+ lastAttr = att.LocalName;
+ } else if (knownIndex < knownAtts.Length) {
+ var aname = knownAtts [knownIndex++];
+ lastAttr = aname;
+ var val = WriteAttribute (aname);
+ if (val != null)
+ writer.WriteAttributeString (aname, val);
+ } else
+ lastAttr = null;
+ } while (unknownIndex < unknownAttributes.Length || knownIndex < knownAtts.Length);
+ } else {
+ var knownAtts = attributeOrder ?? GetKnownAttributes ();
+ for (int i = 0; i < knownAtts.Length; i++) {
+ var aname = knownAtts [i];
+ var val = WriteAttribute (aname);
+ if (val != null)
+ writer.WriteAttributeString (aname, val);
+ }
+ }
+
+ WriteContent (writer, context);
+
+ writer.WriteEndElement ();
+
+ MSBuildWhitespace.Write (EndWhitespace, writer);
+ }
+
+ internal bool WasReadAsEmptyElement {
+ get {
+ return emptyElementMode == EmptyElementMode.Empty;
+ }
+ }
+
+ internal virtual string Namespace {
+ get {
+ return MSBuildProject.Schema;
+ }
+ }
+
+ internal virtual string NamespacePrefix {
+ get {
+ return null;
+ }
+ }
+
+ internal virtual bool SupportsNamespacePrefixes {
+ get { return false; }
+ }
+
+ internal virtual bool SupportsTextContent {
+ get { return false; }
+ }
+
+ internal virtual void WriteContent (XmlWriter writer, WriteContext context)
+ {
+ var children = GetChildren ();
+ var hasChildren = children.Any ();
+
+ var hasContent = StartInnerWhitespace != null || EndInnerWhitespace != null;
+
+ if (hasChildren || emptyElementMode == EmptyElementMode.NotEmpty || (emptyElementMode == EmptyElementMode.Unknown && !PreferEmptyElement)) {
+ MSBuildWhitespace.Write (StartInnerWhitespace, writer);
+
+ foreach (var c in GetChildren ()) {
+ c.Write (writer, context);
+ hasContent = true;
+ }
+
+ MSBuildWhitespace.Write (EndInnerWhitespace, writer);
+ }
+
+
+ if (!hasContent && (emptyElementMode == EmptyElementMode.NotEmpty || (emptyElementMode == EmptyElementMode.Unknown && !PreferEmptyElement))) {
+ // Don't write an empty element if it wasn't read as an empty element
+ writer.WriteString ("");
+ }
+ }
+
+ internal virtual void ReadAttribute (string name, string value)
+ {
+ }
+
+ internal virtual string WriteAttribute (string name)
+ {
+ return null;
+ }
+
+ internal virtual void ReadChildElement (MSBuildXmlReader reader)
+ {
+ if (reader.ForEvaluation)
+ reader.Skip ();
+ else {
+ var n = new MSBuildXmlElement ();
+ n.Read (reader);
+ n.ParentNode = this;
+ ChildNodes = ChildNodes.Add (n);
+ }
+ }
+
+ internal string GetUnknownAttribute (string name)
+ {
+ if (unknownAttributes == null)
+ return null;
+ var at = unknownAttributes.FirstOrDefault (a => a.LocalName == name);
+ if (at != null)
+ return at.Value;
+ else
+ return null;
+ }
+
+ internal abstract string [] GetKnownAttributes ();
+
+ internal abstract string GetElementName ();
+
+ internal virtual ImmutableList<MSBuildNode> ChildNodes {
+ get {
+ return children;
+ }
+ set {
+ children = value;
+ }
+ }
+
+ internal override IEnumerable<MSBuildNode> GetChildren ()
+ {
+ return children;
+ }
+
+ internal void ResetIndent (bool closeInNewLine)
+ {
+ if (ParentProject == null)
+ return;
+
+ ResetIndent (closeInNewLine, ParentProject, ParentObject, GetPreviousSibling ());
+ }
+
+ internal void ResetIndent (bool closeInNewLine, MSBuildProject project, MSBuildObject parent, MSBuildNode previousSibling)
+ {
+ StartInnerWhitespace = StartWhitespace = EndWhitespace = EndInnerWhitespace = null;
+
+ if (previousSibling != null) {
+ StartWhitespace = previousSibling.StartWhitespace;
+ if (closeInNewLine)
+ EndInnerWhitespace = StartWhitespace;
+ } else if (parent != null) {
+ if (parent.StartInnerWhitespace == null) {
+ parent.StartInnerWhitespace = project.TextFormat.NewLine;
+ parent.EndInnerWhitespace = parent.StartWhitespace;
+ }
+ object parentStartWhitespace = (parent != project) ? parent.StartWhitespace : "";
+ StartWhitespace = parentStartWhitespace + " ";
+ if (closeInNewLine)
+ EndInnerWhitespace = StartWhitespace;
+ }
+ EndWhitespace = project.TextFormat.NewLine;
+ if (closeInNewLine)
+ StartInnerWhitespace = project.TextFormat.NewLine;
+
+ ResetChildrenIndent ();
+ }
+
+ internal void ResetChildrenIndent ()
+ {
+ foreach (var c in GetChildren ().OfType<MSBuildObject> ())
+ c.ResetIndent (false);
+ }
+
+ internal void RemoveIndent ()
+ {
+ }
+ }
+
+ #if ATTR_STATS
+ public class StringCounter
+ {
+ Dictionary<string, int> dict = new Dictionary<string, int> ();
+
+ public void Add (string str)
+ {
+ int c;
+ if (dict.TryGetValue (str, out c)) {
+ dict [str] = c + 1;
+ } else
+ dict [str] = 1;
+ }
+
+ public void Dump ()
+ {
+ foreach (var e in dict.GroupBy (en => en.Key.Substring (0, en.Key.IndexOf (' ')))) {
+ foreach (var c in e.OrderByDescending (a => a.Value))
+ Console.WriteLine (c.Key + " : " + c.Value);
+ }
+ }
+ }
+ #endif
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProject.cs
new file mode 100644
index 0000000000..187da6cd79
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProject.cs
@@ -0,0 +1,1108 @@
+// MSBuildProject.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Xml;
+using System.Text;
+
+using MonoDevelop.Core;
+using MonoDevelop.Projects.Utility;
+using System.Linq;
+using MonoDevelop.Projects.Text;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public sealed partial class MSBuildProject : MSBuildObject, IDisposable
+ {
+ FilePath file;
+ Dictionary<string, MSBuildItemGroup> bestGroups;
+ MSBuildProjectInstance mainProjectInstance;
+ int changeStamp;
+ bool hadXmlDeclaration;
+ bool isShared;
+ ConditionedPropertyCollection conditionedProperties = new ConditionedPropertyCollection ();
+
+ MSBuildEngineManager engineManager;
+ bool engineManagerIsLocal;
+
+ MSBuildProjectInstanceInfo nativeProjectInfo;
+
+ public const string Schema = "http://schemas.microsoft.com/developer/msbuild/2003";
+ static XmlNamespaceManager manager;
+
+ TextFormatInfo format = new TextFormatInfo { NewLine = "\r\n" };
+
+ static readonly string [] knownAttributes = { "DefaultTargets", "ToolsVersion", "xmlns" };
+
+ public static XmlNamespaceManager XmlNamespaceManager
+ {
+ get
+ {
+ if (manager == null) {
+ manager = new XmlNamespaceManager (new NameTable ());
+ manager.AddNamespace ("tns", Schema);
+ }
+ return manager;
+ }
+ }
+
+ public FilePath FileName
+ {
+ get { return file; }
+ set { AssertCanModify (); file = value; }
+ }
+
+ public FilePath BaseDirectory
+ {
+ get { return file.ParentDirectory; }
+ }
+
+ public FilePath SolutionDirectory { get; set; }
+
+ public MSBuildFileFormat Format
+ {
+ get;
+ set;
+ }
+
+ internal TextFormatInfo TextFormat
+ {
+ get { return format; }
+ }
+
+ public bool IsNewProject { get; internal set; }
+
+ internal int ChangeStamp
+ {
+ get { return changeStamp; }
+ }
+
+ internal object ReadLock
+ {
+ get { return readLock; }
+ }
+
+ public MSBuildProject ()
+ {
+ ParentProject = this;
+ hadXmlDeclaration = true;
+ mainProjectInstance = new MSBuildProjectInstance (this);
+ UseMSBuildEngine = true;
+ IsNewProject = true;
+ initialWhitespace = format.NewLine;
+ StartInnerWhitespace = format.NewLine;
+ AddNewPropertyGroup (false);
+ EnableChangeTracking ();
+ }
+
+ internal MSBuildProject (MSBuildEngineManager manager) : this ()
+ {
+ engineManager = manager;
+ }
+
+ public void Dispose ()
+ {
+ DisposeMainInstance ();
+ }
+
+ void DisposeMainInstance ()
+ {
+ if (nativeProjectInfo != null) {
+ if (mainProjectInstance != null)
+ mainProjectInstance.Dispose ();
+ nativeProjectInfo.Engine.UnloadProject (nativeProjectInfo.Project);
+ if (engineManagerIsLocal)
+ nativeProjectInfo.Engine.Dispose ();
+ nativeProjectInfo = null;
+ mainProjectInstance = null;
+ }
+ }
+
+ internal override void AssertCanModify ()
+ {
+ if (isShared)
+ Runtime.AssertMainThread ();
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether this instance is shared.
+ /// </summary>
+ /// <remarks>Shared objects can only be modified in the main thread</remarks>
+ public bool IsShared {
+ get { return isShared; }
+ }
+
+ /// <summary>
+ /// Sets this object as shared, which means that it is accessible from several threads for reading,
+ /// but it can only be modified in the main thread
+ /// </summary>
+ public void SetShared ()
+ {
+ isShared = true;
+ }
+
+
+ void EnableChangeTracking ()
+ {
+ }
+
+ void DisableChangeTracking ()
+ {
+ }
+
+ internal MSBuildEngineManager EngineManager
+ {
+ get
+ {
+ return engineManager;
+ }
+ set
+ {
+ engineManager = value;
+ }
+ }
+
+ public static Task<MSBuildProject> LoadAsync (string file)
+ {
+ return Task<MSBuildProject>.Factory.StartNew (delegate {
+ var p = new MSBuildProject ();
+ p.Load (file);
+ return p;
+ });
+ }
+
+ public void Load (string file)
+ {
+ Load (file, new MSBuildXmlReader ());
+ }
+
+ internal void Load (string file, MSBuildXmlReader reader)
+ {
+ AssertCanModify ();
+ try {
+ this.file = file;
+ IsNewProject = false;
+ format = FileUtil.GetTextFormatInfo (file);
+
+ // HACK: XmlStreamReader will fail if the file is encoded in UTF-8 but has <?xml version="1.0" encoding="utf-16"?>
+ // To work around this, we load the XML content into a string and use XmlDocument.LoadXml() instead.
+ string xml = File.ReadAllText (file);
+
+ LoadXml (xml, reader);
+
+ } finally {
+ EnableChangeTracking ();
+ }
+ }
+
+ public void LoadXml (string xml)
+ {
+ LoadXml (xml, new MSBuildXmlReader ());
+ }
+
+ internal void LoadXml (string xml, MSBuildXmlReader reader)
+ {
+ AssertCanModify ();
+ try {
+ DisableChangeTracking ();
+ var xr = new XmlTextReader (new StringReader (xml));
+ xr.WhitespaceHandling = WhitespaceHandling.All;
+ xr.Normalization = false;
+ reader.XmlReader = xr;
+ LoadFromXml (reader);
+ } finally {
+ EnableChangeTracking ();
+ }
+ }
+
+ object initialWhitespace;
+
+ void LoadFromXml (MSBuildXmlReader reader)
+ {
+ AssertCanModify ();
+ DisposeMainInstance ();
+ ChildNodes = ChildNodes.Clear ();
+ conditionedProperties = new ConditionedPropertyCollection ();
+ bestGroups = null;
+ hadXmlDeclaration = false;
+ initialWhitespace = null;
+ StartInnerWhitespace = null;
+
+ while (!reader.EOF && reader.NodeType != XmlNodeType.Element) {
+ if (reader.NodeType == XmlNodeType.XmlDeclaration) {
+ initialWhitespace = reader.ConsumeWhitespace ();
+ hadXmlDeclaration = true;
+ reader.Read ();
+ }
+ else if (reader.IsWhitespace)
+ reader.ReadAndStoreWhitespace ();
+ else
+ reader.Read ();
+ }
+
+ if (reader.EOF)
+ return;
+
+ Read (reader);
+
+ while (!reader.EOF) {
+ if (reader.IsWhitespace)
+ reader.ReadAndStoreWhitespace ();
+ else
+ reader.Read ();
+ }
+ }
+
+ internal override string [] GetKnownAttributes ()
+ {
+ return knownAttributes;
+ }
+
+ internal override string GetElementName ()
+ {
+ return "Project";
+ }
+
+ internal override void ReadAttribute (string name, string value)
+ {
+ switch (name) {
+ case "DefaultTargets": defaultTargets = value; return;
+ case "ToolsVersion": toolsVersion = value; return;
+ }
+ base.ReadAttribute (name, value);
+ }
+
+ internal override string WriteAttribute (string name)
+ {
+ switch (name) {
+ case "DefaultTargets": return defaultTargets;
+ case "ToolsVersion": return toolsVersion;
+ case "xmlns": return Schema;
+ }
+ return base.WriteAttribute (name);
+ }
+
+ internal override void ReadChildElement (MSBuildXmlReader reader)
+ {
+ MSBuildObject ob = null;
+ switch (reader.LocalName) {
+ case "ItemGroup": ob = new MSBuildItemGroup (); break;
+ case "PropertyGroup": ob = new MSBuildPropertyGroup (); break;
+ case "ImportGroup": ob = new MSBuildImportGroup (); break;
+ case "Import": ob = new MSBuildImport (); break;
+ case "Target": ob = new MSBuildTarget (); break;
+ case "Choose": ob = new MSBuildChoose (); break;
+ case "ProjectExtensions": ob = new MSBuildProjectExtensions (); break;
+ default: ob = new MSBuildXmlElement (); break;
+ }
+ if (ob != null) {
+ ob.ParentNode = this;
+ ob.Read (reader);
+ ChildNodes = ChildNodes.Add (ob);
+ } else
+ base.ReadChildElement (reader);
+ }
+
+ class ProjectWriter : StringWriter
+ {
+ Encoding encoding;
+
+ public ProjectWriter (ByteOrderMark bom)
+ {
+ encoding = bom != null ? Encoding.GetEncoding (bom.Name) : null;
+ ByteOrderMark = bom;
+ }
+
+ public ByteOrderMark ByteOrderMark
+ {
+ get; private set;
+ }
+
+ public override Encoding Encoding
+ {
+ get { return encoding ?? Encoding.UTF8; }
+ }
+ }
+
+ public bool Save (string fileName)
+ {
+ string content = SaveToString ();
+ return TextFile.WriteFile (fileName, content, format.ByteOrderMark, true);
+ }
+
+ public Task<bool> SaveAsync (string fileName)
+ {
+ return Task.Run (() => {
+ string content = SaveToString ();
+ return TextFile.WriteFile (fileName, content, format.ByteOrderMark, true);
+ });
+ }
+
+ public string SaveToString ()
+ {
+ IsNewProject = false;
+ return SaveToString (new WriteContext ());
+ }
+
+ string SaveToString (WriteContext ctx)
+ {
+ // StringWriter.Encoding always returns UTF16. We need it to return UTF8, so the
+ // XmlDocument will write the UTF8 header.
+ ProjectWriter sw = new ProjectWriter (format.ByteOrderMark);
+ sw.NewLine = format.NewLine;
+ var xw = XmlWriter.Create (sw, new XmlWriterSettings {
+ OmitXmlDeclaration = !hadXmlDeclaration,
+ NewLineChars = format.NewLine,
+ NewLineHandling = NewLineHandling.Replace
+ });
+
+ MSBuildWhitespace.Write (initialWhitespace, xw);
+
+ Save (xw);
+
+ xw.Dispose ();
+
+ return sw.ToString ();
+ }
+
+ public void Save (XmlWriter writer)
+ {
+ Save (writer, new WriteContext ());
+ }
+
+ void Save (XmlWriter writer, WriteContext ctx)
+ {
+ Write (writer, ctx);
+ }
+
+ internal new void NotifyChanged ()
+ {
+ changeStamp++;
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this project uses the msbuild engine for evaluation.
+ /// </summary>
+ /// <remarks>When set to false, evaluation support is limited but it allows loading projects
+ /// which are not fully compliant with MSBuild (old MD projects).</remarks>
+ public bool UseMSBuildEngine { get; set; }
+
+ public void Evaluate ()
+ {
+ if (mainProjectInstance != null)
+ mainProjectInstance.Dispose ();
+ mainProjectInstance = new MSBuildProjectInstance (this);
+ mainProjectInstance.Evaluate ();
+ conditionedProperties = mainProjectInstance.GetConditionedProperties ();
+ }
+
+ public Task EvaluateAsync ()
+ {
+ if (mainProjectInstance != null)
+ mainProjectInstance.Dispose ();
+ mainProjectInstance = new MSBuildProjectInstance (this);
+ return mainProjectInstance.EvaluateAsync ().ContinueWith (t => {
+ conditionedProperties = mainProjectInstance.GetConditionedProperties ();
+ });
+ }
+
+ public MSBuildProjectInstance CreateInstance ()
+ {
+ return new MSBuildProjectInstance (this);
+ }
+
+ object readLock = new object ();
+
+ internal MSBuildProjectInstanceInfo LoadNativeInstance ()
+ {
+ lock (readLock) {
+ var supportsMSBuild = UseMSBuildEngine && GetGlobalPropertyGroup ().GetValue ("UseMSBuildEngine", true);
+
+ if (engineManager == null) {
+ engineManager = new MSBuildEngineManager ();
+ engineManagerIsLocal = true;
+ }
+
+ MSBuildEngine e = engineManager.GetEngine (supportsMSBuild);
+
+ if (nativeProjectInfo != null && nativeProjectInfo.Engine != null && (nativeProjectInfo.Engine != e || nativeProjectInfo.ProjectStamp != ChangeStamp)) {
+ nativeProjectInfo.Engine.UnloadProject (nativeProjectInfo.Project);
+ nativeProjectInfo = null;
+ }
+
+ if (nativeProjectInfo == null) {
+ nativeProjectInfo = new MSBuildProjectInstanceInfo {
+ Engine = e,
+ ProjectStamp = ChangeStamp
+ };
+ }
+
+ if (nativeProjectInfo.Project == null) {
+ // Use a private metadata property to assign an id to each item. This id is used to match
+ // evaluated items with the items that generated them.
+
+ try {
+ DisableChangeTracking ();
+
+ var ctx = new WriteContext {
+ Evaluating = true,
+ ItemMap = new Dictionary<string, MSBuildItem> ()
+ };
+ var xml = SaveToString (ctx);
+
+ foreach (var it in GetAllItems ())
+ it.EvaluatedItemCount = 0;
+
+ nativeProjectInfo.Project = e.LoadProject (this, xml, FileName);
+ } catch (Exception ex) {
+ // If the project can't be evaluated don't crash
+ LoggingService.LogError ("MSBuild project could not be evaluated", ex);
+ throw new ProjectEvaluationException (this, ex.Message);
+ } finally {
+ EnableChangeTracking ();
+ }
+ }
+ return nativeProjectInfo;
+ }
+ }
+
+ string defaultTargets;
+
+ public string DefaultTargets
+ {
+ get { return defaultTargets; }
+ set { AssertCanModify (); defaultTargets = value; NotifyChanged (); }
+ }
+
+ string toolsVersion;
+
+ public string ToolsVersion
+ {
+ get { return toolsVersion; }
+ set
+ {
+ AssertCanModify ();
+ toolsVersion = value;
+ NotifyChanged ();
+ }
+ }
+
+ public string [] ProjectTypeGuids
+ {
+ get { return GetGlobalPropertyGroup ().GetValue ("ProjectTypeGuids", "").Split (new [] { ';' }, StringSplitOptions.RemoveEmptyEntries).Select (t => t.Trim ()).ToArray (); }
+ set { GetGlobalPropertyGroup ().SetValue ("ProjectTypeGuids", string.Join (";", value), preserveExistingCase: true); }
+ }
+
+ public bool AddProjectTypeGuid (string guid)
+ {
+ var guids = GetGlobalPropertyGroup ().GetValue ("ProjectTypeGuids", "").Trim ();
+ if (guids.IndexOf (guid, StringComparison.OrdinalIgnoreCase) == -1) {
+ if (!string.IsNullOrEmpty (guids))
+ guids += ";" + guid;
+ else
+ guids = guid;
+ GetGlobalPropertyGroup ().SetValue ("ProjectTypeGuids", guids, preserveExistingCase: true);
+ return true;
+ }
+ return false;
+ }
+
+ public bool RemoveProjectTypeGuid (string guid)
+ {
+ var guids = ProjectTypeGuids;
+ var newGuids = guids.Where (g => !g.Equals (guid, StringComparison.OrdinalIgnoreCase)).ToArray ();
+ if (newGuids.Length != guids.Length) {
+ ProjectTypeGuids = newGuids;
+ return true;
+ } else
+ return false;
+ }
+
+ public MSBuildImport AddNewImport (string name, string condition = null, MSBuildObject beforeObject = null)
+ {
+ AssertCanModify ();
+ var import = new MSBuildImport {
+ Project = name,
+ Condition = condition
+ };
+
+ int index = -1;
+ if (beforeObject != null)
+ index = ChildNodes.IndexOf (beforeObject);
+ else {
+ index = ChildNodes.FindLastIndex (ob => ob is MSBuildImport);
+ if (index != -1)
+ index++;
+ }
+
+ import.ParentNode = this;
+
+ if (index != -1)
+ ChildNodes = ChildNodes.Insert (index, import);
+ else
+ ChildNodes = ChildNodes.Add (import);
+
+ import.ResetIndent (false);
+ NotifyChanged ();
+ return import;
+ }
+
+ public MSBuildImport GetImport (string name, string condition = null)
+ {
+ return Imports.FirstOrDefault (i => string.Equals (i.Project, name, StringComparison.OrdinalIgnoreCase) && (condition == null || i.Condition == condition));
+ }
+
+ public void RemoveImport (string name, string condition = null)
+ {
+ AssertCanModify ();
+ var i = GetImport (name, condition);
+ if (i != null) {
+ i.RemoveIndent ();
+ ChildNodes = ChildNodes.Remove (i);
+ NotifyChanged ();
+ }
+ }
+
+ public void RemoveImport (MSBuildImport import)
+ {
+ AssertCanModify ();
+ if (import.ParentProject != this)
+ throw new InvalidOperationException ("Import object does not belong to this project");
+
+ if (import.ParentObject == this) {
+ import.RemoveIndent ();
+ ChildNodes = ChildNodes.Remove (import);
+ NotifyChanged ();
+ } else
+ ((MSBuildImportGroup)import.ParentObject).RemoveImport (import);
+ }
+
+ public ConditionedPropertyCollection ConditionedProperties {
+ get {
+ return conditionedProperties;
+ }
+ }
+
+ public IMSBuildEvaluatedPropertyCollection EvaluatedProperties
+ {
+ get { return mainProjectInstance != null ? mainProjectInstance.EvaluatedProperties : (IMSBuildEvaluatedPropertyCollection)GetGlobalPropertyGroup (); }
+ }
+
+ public IEnumerable<IMSBuildItemEvaluated> EvaluatedItems
+ {
+ get { return mainProjectInstance.EvaluatedItems; }
+ }
+
+ public IEnumerable<IMSBuildItemEvaluated> EvaluatedItemsIgnoringCondition
+ {
+ get { return mainProjectInstance.EvaluatedItemsIgnoringCondition; }
+ }
+
+ public IEnumerable<IMSBuildTargetEvaluated> EvaluatedTargets
+ {
+ get { return mainProjectInstance.Targets; }
+ }
+
+ public IEnumerable<IMSBuildTargetEvaluated> EvaluatedTargetsIgnoringCondition
+ {
+ get { return mainProjectInstance.TargetsIgnoringCondition; }
+ }
+
+ public MSBuildPropertyGroup GetGlobalPropertyGroup ()
+ {
+ return PropertyGroups.FirstOrDefault (g => g.Condition.Length == 0);
+ }
+
+ public MSBuildPropertyGroup CreatePropertyGroup ()
+ {
+ return new MSBuildPropertyGroup ();
+ }
+
+ public MSBuildPropertyGroup AddNewPropertyGroup (bool insertAtEnd = true, MSBuildObject beforeObject = null)
+ {
+ var group = new MSBuildPropertyGroup ();
+ AddPropertyGroup (group, insertAtEnd);
+ return group;
+ }
+
+ public void AddPropertyGroup (MSBuildPropertyGroup group, bool insertAtEnd = true, MSBuildObject beforeObject = null)
+ {
+ AssertCanModify ();
+ if (group.ParentProject != null)
+ throw new InvalidOperationException ("Group already belongs to a project");
+
+ group.ParentNode = this;
+
+ bool added = false;
+ if (beforeObject != null) {
+ var index = ChildNodes.IndexOf (beforeObject);
+ if (index != -1) {
+ ChildNodes = ChildNodes.Insert (index, group);
+ added = true;
+ }
+ }
+ if (!added) {
+ if (insertAtEnd) {
+ var last = ChildNodes.FindLastIndex (g => g is MSBuildPropertyGroup);
+ if (last != -1) {
+ ChildNodes = ChildNodes.Insert (last + 1, group);
+ added = true;
+ }
+ } else {
+ var first = ChildNodes.FindIndex (g => g is MSBuildPropertyGroup);
+ if (first != -1) {
+ ChildNodes = ChildNodes.Insert (first, group);
+ added = true;
+ }
+ }
+ if (!added) {
+ var first = ChildNodes.FindIndex (g => g is MSBuildItemGroup);
+ if (first != -1)
+ ChildNodes = ChildNodes.Insert (first, group);
+ else
+ ChildNodes = ChildNodes.Add (group);
+ }
+ }
+
+ group.ResetIndent (true);
+ NotifyChanged ();
+ }
+
+ public IEnumerable<MSBuildObject> GetAllObjects ()
+ {
+ return ChildNodes.OfType<MSBuildObject> ();
+ }
+
+ public IEnumerable<MSBuildItem> GetAllItems ()
+ {
+ return GetAllItems (ChildNodes.OfType<MSBuildObject> ());
+ }
+
+ IEnumerable<MSBuildItem> GetAllItems (IEnumerable<MSBuildObject> list)
+ {
+ foreach (var ob in list) {
+ if (ob is MSBuildItemGroup) {
+ foreach (var it in ((MSBuildItemGroup)ob).Items)
+ yield return it;
+ } else if (ob is MSBuildChoose) {
+ foreach (var op in ((MSBuildChoose)ob).GetOptions ()) {
+ foreach (var c in GetAllItems (op.GetAllObjects ()))
+ yield return c;
+ }
+ }
+ }
+ }
+
+ public IEnumerable<MSBuildPropertyGroup> PropertyGroups
+ {
+ get { return ChildNodes.OfType<MSBuildPropertyGroup> (); }
+ }
+
+ public IEnumerable<MSBuildItemGroup> ItemGroups
+ {
+ get { return ChildNodes.OfType<MSBuildItemGroup> (); }
+ }
+
+ public IEnumerable<MSBuildImportGroup> ImportGroups
+ {
+ get { return ChildNodes.OfType<MSBuildImportGroup> (); }
+ }
+
+ public IEnumerable<MSBuildTarget> Targets
+ {
+ get { return ChildNodes.OfType<MSBuildTarget> (); }
+ }
+
+ public IEnumerable<MSBuildImport> Imports
+ {
+ get { return ChildNodes.OfType<MSBuildImport> (); }
+ }
+
+ public MSBuildItemGroup AddNewItemGroup ()
+ {
+ AssertCanModify ();
+ var group = new MSBuildItemGroup ();
+
+ MSBuildObject refNode = null;
+ var lastGroup = ItemGroups.LastOrDefault ();
+ if (lastGroup != null)
+ refNode = lastGroup;
+ else {
+ var g = PropertyGroups.LastOrDefault ();
+ if (g != null)
+ refNode = g;
+ }
+
+ group.ParentNode = this;
+ if (refNode != null)
+ ChildNodes = ChildNodes.Insert (ChildNodes.IndexOf (refNode) + 1, group);
+ else
+ ChildNodes = ChildNodes.Add (group);
+
+ group.ResetIndent (true);
+ NotifyChanged ();
+ return group;
+ }
+
+ public MSBuildItem AddNewItem (string name, string include)
+ {
+ MSBuildItemGroup grp = FindBestGroupForItem (name);
+ return grp.AddNewItem (name, include);
+ }
+
+ public MSBuildItem CreateItem (string name, string include)
+ {
+ var bitem = new MSBuildItem (name);
+ bitem.Include = include;
+ return bitem;
+ }
+
+ public void AddItem (MSBuildItem it)
+ {
+ if (string.IsNullOrEmpty (it.Name))
+ throw new InvalidOperationException ("Item doesn't have a name");
+ MSBuildItemGroup grp = FindBestGroupForItem (it.Name);
+ grp.AddItem (it);
+ }
+
+ MSBuildItemGroup FindBestGroupForItem (string itemName)
+ {
+ MSBuildItemGroup group;
+
+ if (bestGroups == null)
+ bestGroups = new Dictionary<string, MSBuildItemGroup> ();
+ else {
+ if (bestGroups.TryGetValue (itemName, out group))
+ return group;
+ }
+
+ foreach (MSBuildItemGroup grp in ItemGroups) {
+ foreach (MSBuildItem it in grp.Items) {
+ if (it.Name == itemName) {
+ bestGroups [itemName] = grp;
+ return grp;
+ }
+ }
+ }
+ group = AddNewItemGroup ();
+ bestGroups [itemName] = group;
+ return group;
+ }
+
+ public XmlElement GetProjectExtension (string section)
+ {
+ var ext = (MSBuildProjectExtensions)ChildNodes.FirstOrDefault (ob => ob is MSBuildProjectExtensions);
+ if (ext != null)
+ return ext.GetProjectExtension (section);
+ return null;
+ }
+
+ public XmlElement GetMonoDevelopProjectExtension (string section)
+ {
+ var elem = GetProjectExtension ("MonoDevelop");
+ if (elem != null)
+ return elem.SelectSingleNode ("tns:Properties/tns:" + section, XmlNamespaceManager) as XmlElement;
+ else
+ return null;
+ }
+
+ public void SetProjectExtension (XmlElement value)
+ {
+ AssertCanModify ();
+ var ext = (MSBuildProjectExtensions)ChildNodes.FirstOrDefault (ob => ob is MSBuildProjectExtensions);
+ if (ext == null) {
+ ext = new MSBuildProjectExtensions ();
+ ext.ParentNode = this;
+ ChildNodes = ChildNodes.Add (ext);
+ ext.ResetIndent (false);
+ }
+ ext.SetProjectExtension (value);
+ NotifyChanged ();
+ }
+
+ public void SetMonoDevelopProjectExtension (string section, XmlElement value)
+ {
+ AssertCanModify ();
+ var elem = GetProjectExtension ("MonoDevelop");
+ if (elem == null) {
+ XmlDocument doc = new XmlDocument ();
+ elem = doc.CreateElement (null, "MonoDevelop", MSBuildProject.Schema);
+ }
+ value = (XmlElement) elem.OwnerDocument.ImportNode (value, true);
+ var parent = elem;
+ elem = parent ["Properties", MSBuildProject.Schema];
+ if (elem == null) {
+ elem = parent.OwnerDocument.CreateElement (null, "Properties", MSBuildProject.Schema);
+ parent.AppendChild (elem);
+ XmlUtil.Indent (format, elem, true);
+ }
+ XmlElement sec = elem [value.LocalName];
+ if (sec == null)
+ elem.AppendChild (value);
+ else {
+ elem.InsertAfter (value, sec);
+ XmlUtil.RemoveElementAndIndenting (sec);
+ }
+ XmlUtil.Indent (format, value, false);
+ var xmlns = value.GetAttribute ("xmlns");
+ if (xmlns == Schema)
+ value.RemoveAttribute ("xmlns");
+ SetProjectExtension (parent);
+ NotifyChanged ();
+ }
+
+ public void RemoveProjectExtension (string section)
+ {
+ AssertCanModify ();
+ var ext = (MSBuildProjectExtensions)ChildNodes.FirstOrDefault (ob => ob is MSBuildProjectExtensions);
+ if (ext != null) {
+ ext.RemoveProjectExtension (section);
+ if (ext.IsEmpty)
+ Remove (ext);
+ }
+ }
+
+ public void RemoveMonoDevelopProjectExtension (string section)
+ {
+ AssertCanModify ();
+ var md = GetProjectExtension ("MonoDevelop");
+ if (md == null)
+ return;
+ XmlElement elem = md.SelectSingleNode ("tns:Properties/tns:" + section, XmlNamespaceManager) as XmlElement;
+ if (elem != null) {
+ var parent = (XmlElement)elem.ParentNode;
+ XmlUtil.RemoveElementAndIndenting (elem);
+ if (parent.ChildNodes.OfType<XmlNode> ().All (n => n is XmlWhitespace))
+ RemoveProjectExtension ("MonoDevelop");
+ else
+ SetProjectExtension (md);
+ NotifyChanged ();
+ }
+ }
+
+ public void Remove (MSBuildObject ob)
+ {
+ AssertCanModify ();
+ if (ob.ParentObject == this) {
+ ob.RemoveIndent ();
+ ChildNodes = ChildNodes.Remove (ob);
+ ob.ParentNode = null;
+ }
+ }
+
+ public void RemoveItem (MSBuildItem item, bool removeEmptyParentGroup = true)
+ {
+ AssertCanModify ();
+ if (item.ParentGroup != null) {
+ item.RemoveIndent ();
+ var g = item.ParentGroup;
+ g.RemoveItem (item);
+ if (removeEmptyParentGroup && !g.Items.Any ()) {
+ Remove (g);
+ if (bestGroups != null)
+ bestGroups.Remove (item.Name);
+ }
+ }
+ }
+ }
+
+ static class XmlUtil
+ {
+ public static void RemoveElementAndIndenting (XmlElement elem)
+ {
+ var ws = elem.PreviousSibling as XmlWhitespace;
+ elem.ParentNode.RemoveChild (elem);
+
+ while (ws != null) {
+ var t = ws.InnerText;
+ t = t.TrimEnd (' ');
+ bool hasNewLine = t.Length > 0 && (t [t.Length - 1] == '\r' || t [t.Length - 1] == '\n');
+ if (hasNewLine)
+ t = RemoveLineEnd (t);
+
+ if (t.Length == 0) {
+ var nextws = ws.PreviousSibling as XmlWhitespace;
+ ws.ParentNode.RemoveChild (ws);
+ ws = nextws;
+ if (hasNewLine)
+ break;
+ } else {
+ ws.InnerText = t;
+ break;
+ }
+ }
+ }
+
+ static string RemoveLineEnd (string s)
+ {
+ if (s [s.Length - 1] == '\n') {
+ if (s.Length > 1 && s [s.Length - 2] == '\r')
+ return s.Substring (0, s.Length - 2);
+ }
+ return s.Substring (0, s.Length - 1);
+ }
+
+ static string GetIndentString (XmlNode elem)
+ {
+ if (elem == null)
+ return "";
+ var node = elem.PreviousSibling;
+ StringBuilder res = new StringBuilder ();
+
+ while (node != null) {
+ var ws = node as XmlWhitespace;
+ if (ws != null) {
+ var t = ws.InnerText;
+ int i = t.LastIndexOfAny (new [] { '\r', '\n' });
+ if (i == -1) {
+ res.Append (t);
+ } else {
+ res.Append (t.Substring (i + 1));
+ return res.ToString ();
+ }
+ } else
+ res.Clear ();
+ node = node.PreviousSibling;
+ }
+ return res.ToString ();
+ }
+
+ public static void FormatElement (TextFormatInfo format, XmlElement elem)
+ {
+ // Remove duplicate namespace declarations
+ var nsa = elem.Attributes ["xmlns"];
+ if (nsa != null && nsa.Value == MSBuildProject.Schema)
+ elem.Attributes.Remove (nsa);
+
+ foreach (var e in elem.ChildNodes.OfType<XmlElement> ().ToArray ()) {
+ Indent (format, e, false);
+ FormatElement (format, e);
+ }
+ }
+
+ public static void Indent (TextFormatInfo format, XmlElement elem, bool closeInNewLine)
+ {
+ var prev = FindPreviousSibling (elem);
+
+ string indent;
+ if (prev != null)
+ indent = GetIndentString (prev);
+ else if (elem != elem.OwnerDocument.DocumentElement)
+ indent = GetIndentString (elem.ParentNode) + " ";
+ else
+ indent = "";
+
+ Indent (format, elem, indent);
+ if (elem.ChildNodes.Count == 0 && closeInNewLine) {
+ var ws = elem.OwnerDocument.CreateWhitespace (format.NewLine + indent);
+ elem.AppendChild (ws);
+ }
+
+ if (elem.NextSibling is XmlElement)
+ SetIndent (format, (XmlElement)elem.NextSibling, indent);
+
+ if (elem.NextSibling == null && elem != elem.OwnerDocument.DocumentElement && elem.ParentNode != null) {
+ var parentIndent = GetIndentString (elem.ParentNode);
+ var ws = elem.OwnerDocument.CreateWhitespace (format.NewLine + parentIndent);
+ elem.ParentNode.InsertAfter (ws, elem);
+ }
+ }
+
+ static XmlElement FindPreviousSibling (XmlElement elem)
+ {
+ XmlNode node = elem;
+ do {
+ node = node.PreviousSibling;
+ } while (node != null && !(node is XmlElement));
+ return node as XmlElement;
+ }
+
+ static void Indent (TextFormatInfo format, XmlElement elem, string indent)
+ {
+ SetIndent (format, elem, indent);
+ foreach (var c in elem.ChildNodes.OfType<XmlElement> ())
+ Indent (format, c, indent + " ");
+ }
+
+ static void SetIndent (TextFormatInfo format, XmlElement elem, string indent)
+ {
+ if (string.IsNullOrEmpty (indent) || elem.ParentNode == null)
+ return;
+ bool foundLineBreak = RemoveIndent (elem.PreviousSibling);
+ string newIndent = foundLineBreak ? indent : format.NewLine + indent;
+
+ var ws = elem.OwnerDocument.CreateWhitespace (newIndent);
+ if (elem.ParentNode is XmlDocument) {
+ // MS.NET doesn't allow inserting whitespace if there is a document element. The workaround
+ // is to remove the element, add the space, then add back the element
+ var doc = elem.OwnerDocument;
+ doc.RemoveChild (elem);
+ doc.AppendChild (ws);
+ doc.AppendChild (elem);
+ } else
+ elem.ParentNode.InsertBefore (ws, elem);
+
+ if (elem.ChildNodes.OfType<XmlElement> ().Any ()) {
+ foundLineBreak = RemoveIndent (elem.LastChild);
+ newIndent = foundLineBreak ? indent : format.NewLine + indent;
+ elem.AppendChild (elem.OwnerDocument.CreateWhitespace (newIndent));
+ }
+ }
+
+ static bool RemoveIndent (XmlNode node)
+ {
+ List<XmlNode> toDelete = new List<XmlNode> ();
+ bool foundLineBreak = false;
+
+ var ws = node as XmlWhitespace;
+ while (ws != null) {
+ var t = ws.InnerText;
+ int i = t.LastIndexOfAny (new [] { '\r', '\n' });
+ if (i == -1) {
+ toDelete.Add (ws);
+ } else {
+ ws.InnerText = t.Substring (0, i + 1);
+ foundLineBreak = true;
+ break;
+ }
+ ws = ws.PreviousSibling as XmlWhitespace;
+ }
+ foreach (var n in toDelete)
+ n.ParentNode.RemoveChild (n);
+ return foundLineBreak;
+ }
+ }
+
+ class WriteContext
+ {
+ public bool Evaluating;
+ public Dictionary<string, MSBuildItem> ItemMap;
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectExtensions.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectExtensions.cs
new file mode 100644
index 0000000000..2f0a36142a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectExtensions.cs
@@ -0,0 +1,108 @@
+//
+// MSBuildProjectExtensions.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Xml;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public class MSBuildProjectExtensions: MSBuildElement
+ {
+ public MSBuildProjectExtensions ()
+ {
+ }
+
+ internal override void Read (MSBuildXmlReader reader)
+ {
+ if (reader.ForEvaluation)
+ reader.Read ();
+ else
+ base.Read (reader);
+ }
+
+ internal override string GetElementName ()
+ {
+ return "ProjectExtensions";
+ }
+
+ internal bool IsEmpty {
+ get {
+ return !ChildNodes.OfType<MSBuildXmlElement> ().Any ();
+ }
+ }
+
+ public XmlElement GetProjectExtension (string section)
+ {
+ var elem = ChildNodes.OfType<MSBuildXmlElement> ().FirstOrDefault (n => n.Name == section);
+ if (elem != null) {
+ var w = new StringWriter ();
+ using (var tw = new XmlTextWriter (w))
+ elem.Write (tw, new WriteContext ());
+ var doc = new XmlDocument ();
+ doc.LoadXml (w.ToString ());
+ return doc.DocumentElement;
+ } else
+ return null;
+ }
+
+ public void SetProjectExtension (XmlElement value)
+ {
+ AssertCanModify ();
+ var sr = new StringReader (value.OuterXml);
+ var xr = new XmlTextReader (sr);
+ xr.MoveToContent ();
+ var cr = new MSBuildXmlReader { XmlReader = xr };
+ var section = value.LocalName;
+
+ MSBuildXmlElement elem = new MSBuildXmlElement ();
+ elem.Read (cr);
+
+ int i = ChildNodes.FindIndex (n => (n is MSBuildXmlElement) && ((MSBuildXmlElement)n).Name == section);
+ if (i == -1)
+ ChildNodes = ChildNodes.Add (elem);
+ else {
+ ChildNodes = ChildNodes.RemoveAt (i);
+ ChildNodes = ChildNodes.Insert (i, elem);
+ }
+ elem.ParentNode = this;
+ elem.ResetIndent (false);
+ NotifyChanged ();
+ }
+
+ public void RemoveProjectExtension (string section)
+ {
+ AssertCanModify ();
+ int i = ChildNodes.FindIndex (n => (n is MSBuildXmlElement) && ((MSBuildXmlElement)n).Name == section);
+ if (i != -1) {
+ ChildNodes = ChildNodes.RemoveAt (i);
+ NotifyChanged ();
+ }
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectFromFile.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectFromFile.cs
new file mode 100644
index 0000000000..5dc76c4283
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectFromFile.cs
@@ -0,0 +1,324 @@
+//
+// MSBuildProjectFromFile.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MSProject = Microsoft.Build.BuildEngine.Project;
+using Microsoft.Build.BuildEngine;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Projects.Formats.MSBuildInternal
+{
+ public class MSBuildProjectFromFile: MSBuildProject
+ {
+ MSProject project;
+ List<ImportData> imports = new List<ImportData> ();
+ List<MSBuildPropertyGroup> propertyGroups = new List<MSBuildPropertyGroup> ();
+
+ class ImportData: MSBuildImport
+ {
+ #region implemented abstract members of MSBuildImport
+
+ public override string Target { get; set; }
+
+ public override string Label { get; set; }
+
+ public override string Condition { get; set; }
+
+ #endregion
+ }
+
+ class ProperyGroupData: MSBuildPropertyGroup, IPropertySetImpl
+ {
+ public List<MSBuildProperty> Properties = new List<MSBuildProperty> ();
+
+ public ProperyGroupData (MSBuildProject project) : base (project)
+ {
+ }
+
+ internal override IPropertySetImpl PropertySet {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public override string Label { get; set; }
+
+ public override string Condition { get; set; }
+ }
+
+ class ItemGroupData: MSBuildItemGroup
+ {
+ public List<MSBuildItem> GroupItems = new List<MSBuildItem> ();
+
+ public ItemGroupData (MSBuildProject project): base (project)
+ {
+ }
+
+ public override MSBuildItem AddNewItem (string name, string include)
+ {
+ var it = new ItemData (Project, name, include, include);
+ GroupItems.Add (it);
+ return it;
+ }
+
+ public override IEnumerable<MSBuildItem> Items {
+ get {
+ return GroupItems;
+ }
+ }
+ }
+
+ class ItemData: MSBuildItem
+ {
+ string name;
+ string unevaluatedInclude;
+ string include;
+
+ public ItemData (MSBuildProject project, string name, string include, string unevaluatedInclude): base (project)
+ {
+ this.name = name;
+ this.include = include;
+ this.unevaluatedInclude = unevaluatedInclude;
+ }
+
+ internal override IPropertySetImpl PropertySet {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public override string Include {
+ get { return include; }
+ }
+
+ public override string UnevaluatedInclude {
+ get {
+ return unevaluatedInclude;
+ }
+ }
+
+ public override string Name {
+ get {
+ return name;
+ }
+ }
+ }
+
+ class PropertyData: MSBuildProperty
+ {
+ public string Value;
+ public string RawValue;
+ string name;
+
+ public PropertyData (string name, MSBuildProject project) : base (project)
+ {
+ this.name = name;
+ }
+
+ public override string Name {
+ get { return name; }
+ }
+
+ protected override void SetPropertyValue (string value, bool isXml)
+ {
+ Value = value;
+ }
+
+ protected override string GetPropertyValue ()
+ {
+ return Value;
+ }
+
+ public override string Condition { get; set; }
+ }
+
+ public MSBuildProjectFromFile ()
+ {
+ }
+
+ #region IMSBuildProjectImpl implementation
+
+ public override void Load (MonoDevelop.Core.FilePath file)
+ {
+ foreach (Import im in project.Imports) {
+ imports.Add (new ImportData {
+ Condition = im.Condition
+ });
+ }
+ foreach (BuildPropertyGroup pg in project.PropertyGroups) {
+ var g = new ProperyGroupData (this) {
+ Condition = pg.Condition
+ };
+ foreach (BuildProperty p in pg) {
+ var prop = new PropertyData (p.Name, this) {
+ Value = p.FinalValue,
+ RawValue = p.Value
+ };
+ g.Properties.Add (prop);
+ }
+ propertyGroups.Add (g);
+ }
+ foreach (BuildItemGroup ig in project.ItemGroups) {
+
+ }
+ }
+
+ public override void AddNewImport (string name, MSBuildImport beforeImport = null)
+ {
+ var data = new ImportData {
+ Target = name
+ };
+ if (beforeImport != null) {
+ var other = (ImportData)beforeImport;
+ int i = imports.IndexOf (other);
+ if (i != -1) {
+ imports.Insert (i, data);
+ return;
+ }
+ }
+ imports.Add (data);
+ }
+
+ public override void RemoveImport (MSBuildImport import)
+ {
+ var data = (ImportData)import;
+ imports.Remove (data);
+ }
+
+ public override void Save (string fileName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override string SaveToString ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override MSBuildPropertyGroup AddNewPropertyGroup (MSBuildPropertyGroup beforeGroup = null)
+ {
+ var g = new ProperyGroupData (this);
+ if (beforeGroup != null) {
+ var i = propertyGroups.IndexOf (beforeGroup);
+ if (i != -1) {
+ propertyGroups.Insert (i, g);
+ return g;
+ }
+ }
+ propertyGroups.Add (g);
+ return g;
+ }
+
+ public override void RemovePropertyGroup (MSBuildPropertyGroup grp)
+ {
+ propertyGroups.Remove (grp);
+ }
+
+ public override IEnumerable<MSBuildItem> GetAllItems ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override IEnumerable<MSBuildItem> GetAllItems (params string[] names)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override MSBuildItemGroup AddNewItemGroup ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override MSBuildItem AddNewItem (string name, string include)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override System.Xml.XmlElement GetProjectExtensions (string section)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override void SetProjectExtensions (string section, string value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override void RemoveProjectExtensions (string section)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override void RemoveItem (MSBuildItem item)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override MonoDevelop.Core.FilePath FileName {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public override string DefaultTargets {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public override string ToolsVersion {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public override IEnumerable<MSBuildImport> Imports {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public override IEnumerable<MSBuildPropertyGroup> PropertyGroups {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public override IEnumerable<MSBuildItemGroup> ItemGroups {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ #endregion
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectInstance.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectInstance.cs
new file mode 100644
index 0000000000..73e5bdd747
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectInstance.cs
@@ -0,0 +1,233 @@
+//
+// MSBuildProjectInstance.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Xml;
+using MonoDevelop.Core;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public sealed class MSBuildProjectInstance: IDisposable
+ {
+ MSBuildProject msproject;
+ List<IMSBuildItemEvaluated> evaluatedItems = new List<IMSBuildItemEvaluated> ();
+ List<IMSBuildItemEvaluated> evaluatedItemsIgnoringCondition = new List<IMSBuildItemEvaluated> ();
+ MSBuildEvaluatedPropertyCollection evaluatedProperties;
+ MSBuildTarget[] targets = new MSBuildTarget[0];
+ MSBuildTarget[] targetsIgnoringCondition = new MSBuildTarget[0];
+ Dictionary<string,string> globalProperties = new Dictionary<string, string> ();
+ ConditionedPropertyCollection conditionedProperties;
+
+ MSBuildProjectInstanceInfo info;
+
+ object projectInstance;
+ MSBuildEngine engine;
+
+ public MSBuildProjectInstance (MSBuildProject project)
+ {
+ msproject = project;
+ evaluatedItemsIgnoringCondition = new List<IMSBuildItemEvaluated> ();
+ evaluatedProperties = new MSBuildEvaluatedPropertyCollection (msproject);
+ if (!project.SolutionDirectory.IsNullOrEmpty)
+ globalProperties.Add ("SolutionDir", project.SolutionDirectory.ToString ());
+ }
+
+ public void Dispose ()
+ {
+ if (projectInstance != null) {
+ engine.DisposeProjectInstance (projectInstance);
+ projectInstance = null;
+ engine = null;
+ }
+ }
+
+ public void SetGlobalProperty (string property, string value)
+ {
+ globalProperties [property] = value;
+ }
+
+ public void RemoveGlobalProperty (string property)
+ {
+ globalProperties.Remove (property);
+ }
+
+ internal bool OnlyEvaluateProperties { get; set; }
+
+ public Task EvaluateAsync ()
+ {
+ return Task.Run (() => Evaluate ());
+ }
+
+ public void Evaluate ()
+ {
+ if (projectInstance != null)
+ engine.DisposeProjectInstance (projectInstance);
+
+ info = msproject.LoadNativeInstance ();
+
+ engine = info.Engine;
+ projectInstance = engine.CreateProjectInstance (info.Project);
+
+ try {
+ foreach (var prop in globalProperties)
+ engine.SetGlobalProperty (projectInstance, prop.Key, prop.Value);
+
+ engine.Evaluate (projectInstance);
+
+ SyncBuildProject (info.ItemMap, info.Engine, projectInstance);
+ } catch (Exception ex) {
+ // If the project can't be evaluated don't crash
+ LoggingService.LogError ("MSBuild project could not be evaluated", ex);
+ throw new ProjectEvaluationException (msproject, ex.Message);
+ }
+ }
+
+ internal const string NodeIdPropertyName = "__MD_NodeId";
+
+ void SyncBuildProject (Dictionary<string,MSBuildItem> currentItems, MSBuildEngine e, object project)
+ {
+ evaluatedItemsIgnoringCondition.Clear ();
+ evaluatedItems.Clear ();
+
+ if (!OnlyEvaluateProperties) {
+
+ var evalItems = new Dictionary<string,MSBuildItemEvaluated> ();
+ foreach (var it in e.GetEvaluatedItems (project)) {
+ var xit = it as MSBuildItemEvaluated;
+ if (xit == null) {
+ xit = CreateEvaluatedItem (e, it);
+ var itemId = e.GetItemMetadata (it, NodeIdPropertyName);
+ var key = itemId + " " + xit.Include;
+ if (evalItems.ContainsKey (key))
+ continue; // xbuild seems to return duplicate items when using wildcards. This is a workaround to avoid the duplicates.
+ MSBuildItem pit;
+ if (!string.IsNullOrEmpty (itemId) && currentItems.TryGetValue (itemId, out pit)) {
+ xit.SourceItem = pit;
+ xit.Condition = pit.Condition;
+ evalItems [key] = xit;
+ }
+ }
+ evaluatedItems.Add (xit);
+ }
+
+ var evalItemsNoCond = new Dictionary<string,MSBuildItemEvaluated> ();
+ foreach (var it in e.GetEvaluatedItemsIgnoringCondition (project)) {
+ var xit = it as MSBuildItemEvaluated;
+ if (xit == null) {
+ xit = CreateEvaluatedItem (e, it);
+ var itemId = e.GetItemMetadata (it, NodeIdPropertyName);
+ MSBuildItemEvaluated evItem;
+ var key = itemId + " " + xit.Include;
+ if (evalItemsNoCond.ContainsKey (key))
+ continue; // xbuild seems to return duplicate items when using wildcards. This is a workaround to avoid the duplicates.
+ if (!string.IsNullOrEmpty (itemId) && evalItems.TryGetValue (key, out evItem)) {
+ evaluatedItemsIgnoringCondition.Add (evItem);
+ evalItemsNoCond [key] = evItem;
+ continue;
+ }
+ MSBuildItem pit;
+ if (!string.IsNullOrEmpty (itemId) && currentItems.TryGetValue (itemId, out pit)) {
+ xit.SourceItem = pit;
+ xit.Condition = pit.Condition;
+ evalItemsNoCond [key] = xit;
+ }
+ }
+ evaluatedItemsIgnoringCondition.Add (xit);
+ }
+
+ // Clear the node id metadata
+ foreach (var it in evaluatedItems.Concat (evaluatedItemsIgnoringCondition))
+ ((MSBuildPropertyGroupEvaluated)it.Metadata).RemoveProperty (NodeIdPropertyName);
+
+ targets = e.GetTargets (project).ToArray ();
+ targetsIgnoringCondition = e.GetTargetsIgnoringCondition (project).ToArray ();
+ }
+
+ var props = new MSBuildEvaluatedPropertyCollection (msproject);
+ evaluatedProperties = props;
+ props.SyncCollection (e, project);
+
+ conditionedProperties = engine.GetConditionedProperties (project);
+ }
+
+ MSBuildItemEvaluated CreateEvaluatedItem (MSBuildEngine e, object it)
+ {
+ string name, include, finalItemSpec;
+ bool imported;
+ e.GetEvaluatedItemInfo (it, out name, out include, out finalItemSpec, out imported);
+ var xit = new MSBuildItemEvaluated (msproject, name, include, finalItemSpec);
+ xit.IsImported = imported;
+ ((MSBuildPropertyGroupEvaluated)xit.Metadata).Sync (e, it);
+ return xit;
+ }
+
+ public IMSBuildEvaluatedPropertyCollection EvaluatedProperties {
+ get { return evaluatedProperties; }
+ }
+
+ public IEnumerable<IMSBuildItemEvaluated> EvaluatedItems {
+ get { return evaluatedItems; }
+ }
+
+ public IEnumerable<IMSBuildItemEvaluated> EvaluatedItemsIgnoringCondition {
+ get { return evaluatedItemsIgnoringCondition; }
+ }
+
+ public IEnumerable<IMSBuildTargetEvaluated> Targets {
+ get {
+ return targets;
+ }
+ }
+
+ public IEnumerable<IMSBuildTargetEvaluated> TargetsIgnoringCondition {
+ get {
+ return targetsIgnoringCondition;
+ }
+ }
+
+ internal IPropertySet GetPropertiesLinkedToGroup (MSBuildPropertyGroup group)
+ {
+ evaluatedProperties.LinkToGroup (group);
+ return evaluatedProperties;
+ }
+
+ internal ConditionedPropertyCollection GetConditionedProperties ()
+ {
+ return conditionedProperties;
+ }
+ }
+
+ class MSBuildProjectInstanceInfo
+ {
+ public object Project { get; set; }
+ public MSBuildEngine Engine { get; set; }
+ public int ProjectStamp { get; set; }
+ public Dictionary<string,MSBuildItem> ItemMap { get; set; }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs
new file mode 100644
index 0000000000..95dc677318
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs
@@ -0,0 +1,1239 @@
+// MSBuildProjectService.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+using System;
+using System.Linq;
+using System.Diagnostics;
+using System.Collections.Generic;
+using System.IO;
+using System.Globalization;
+using System.Runtime.Serialization.Formatters.Binary;
+using Mono.Addins;
+using MonoDevelop.Core.ProgressMonitoring;
+using MonoDevelop.Projects;
+using MonoDevelop.Projects.Extensions;
+using MonoDevelop.Core.Serialization;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Assemblies;
+using Cecil = Mono.Cecil;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Xml;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public static class MSBuildProjectService
+ {
+ internal const string ItemTypesExtensionPath = "/MonoDevelop/ProjectModel/MSBuildItemTypes";
+ internal const string ImportRedirectsExtensionPath = "/MonoDevelop/ProjectModel/MSBuildImportRedirects";
+ internal const string GlobalPropertyProvidersExtensionPath = "/MonoDevelop/ProjectModel/MSBuildGlobalPropertyProviders";
+ internal const string UnknownMSBuildProjectTypesExtensionPath = "/MonoDevelop/ProjectModel/UnknownMSBuildProjectTypes";
+ internal const string MSBuildProjectItemTypesPath = "/MonoDevelop/ProjectModel/MSBuildProjectItemTypes";
+
+ public const string GenericItemGuid = "{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}";
+ public const string FolderTypeGuid = "{2150E333-8FDC-42A3-9474-1A3956D46DE8}";
+
+ //NOTE: default toolsversion should match the default format.
+ // remember to update the builder process' app.config too
+ public const string DefaultFormat = "MSBuild12";
+
+ static DataContext dataContext;
+
+ static IMSBuildGlobalPropertyProvider[] globalPropertyProviders;
+ static BuilderCache builders = new BuilderCache ();
+ static Dictionary<string,Type> genericProjectTypes = new Dictionary<string, Type> ();
+ static Dictionary<string,string> importRedirects = new Dictionary<string, string> ();
+ static UnknownProjectTypeNode[] unknownProjectTypeNodes;
+ static IDictionary<string,TypeExtensionNode> projecItemTypeNodes;
+
+ static AsyncCriticalSection buildersLock = new AsyncCriticalSection ();
+
+
+ internal static bool ShutDown { get; private set; }
+
+ static ExtensionNode[] itemTypeNodes;
+
+ public static DataContext DataContext {
+ get {
+ if (dataContext == null) {
+ dataContext = new MSBuildDataContext ();
+ Services.ProjectService.InitializeDataContext (dataContext);
+ }
+ return dataContext;
+ }
+ }
+
+ static MSBuildProjectService ()
+ {
+ Services.ProjectService.DataContextChanged += delegate {
+ dataContext = null;
+ };
+
+ PropertyService.PropertyChanged += HandlePropertyChanged;
+ DefaultMSBuildVerbosity = Runtime.Preferences.MSBuildVerbosity;
+
+ Runtime.ShuttingDown += (sender, e) => ShutDown = true;
+
+ AddinManager.ExtensionChanged += OnExtensionChanged;
+ LoadExtensionData ();
+ }
+
+ static void OnExtensionChanged (object sender, ExtensionEventArgs args)
+ {
+ if (args.Path == ItemTypesExtensionPath ||
+ args.Path == ImportRedirectsExtensionPath ||
+ args.Path == UnknownMSBuildProjectTypesExtensionPath ||
+ args.Path == GlobalPropertyProvidersExtensionPath ||
+ args.Path == MSBuildProjectItemTypesPath)
+ LoadExtensionData ();
+ }
+
+ static void LoadExtensionData ()
+ {
+ // Get global property providers
+
+ if (globalPropertyProviders != null) {
+ foreach (var gpp in globalPropertyProviders)
+ gpp.GlobalPropertiesChanged -= HandleGlobalPropertyProviderChanged;
+ }
+
+ globalPropertyProviders = AddinManager.GetExtensionObjects<IMSBuildGlobalPropertyProvider> (GlobalPropertyProvidersExtensionPath);
+
+ foreach (var gpp in globalPropertyProviders)
+ gpp.GlobalPropertiesChanged -= HandleGlobalPropertyProviderChanged;
+
+ // Get item type nodes
+
+ itemTypeNodes = AddinManager.GetExtensionNodes<ExtensionNode> (ItemTypesExtensionPath).Concat (Enumerable.Repeat (GenericItemNode.Instance,1)).ToArray ();
+
+ // Get import redirects
+
+ var newImportRedirects = new Dictionary<string, string> ();
+ foreach (ImportRedirectTypeNode node in AddinManager.GetExtensionNodes (ImportRedirectsExtensionPath))
+ newImportRedirects [node.Project] = node.Addin.GetFilePath (node.Target);
+ importRedirects = newImportRedirects;
+
+ // Unknown project type information
+
+ unknownProjectTypeNodes = AddinManager.GetExtensionNodes<UnknownProjectTypeNode> (UnknownMSBuildProjectTypesExtensionPath).ToArray ();
+
+ projecItemTypeNodes = AddinManager.GetExtensionNodes<TypeExtensionNode> (MSBuildProjectItemTypesPath).ToDictionary (e => e.TypeName);
+ }
+
+ static Dictionary<string,Type> customProjectItemTypes = new Dictionary<string,Type> ();
+
+ internal static void RegisterCustomProjectItemType (string name, Type type)
+ {
+ customProjectItemTypes [name] = type;
+ }
+
+ internal static void UnregisterCustomProjectItemType (string name)
+ {
+ customProjectItemTypes.Remove (name);
+ }
+
+ static async void HandleGlobalPropertyProviderChanged (object sender, EventArgs e)
+ {
+ using (await buildersLock.EnterAsync ()) {
+ var gpp = (IMSBuildGlobalPropertyProvider)sender;
+ foreach (var builder in builders.GetAllBuilders ())
+ builder.SetGlobalProperties (gpp.GetGlobalProperties ());
+ }
+ }
+
+ static void HandlePropertyChanged (object sender, PropertyChangedEventArgs e)
+ {
+ if (e.Key == "MonoDevelop.Ide.MSBuildVerbosity") {
+ DefaultMSBuildVerbosity = (MSBuildVerbosity) e.NewValue;
+ }
+ }
+
+ internal static MSBuildVerbosity DefaultMSBuildVerbosity { get; private set; }
+
+ public static bool IsTargetsAvailable (string targetsPath)
+ {
+ if (string.IsNullOrEmpty (targetsPath))
+ return false;
+
+ string msbuild = Runtime.SystemAssemblyService.CurrentRuntime.GetMSBuildExtensionsPath ();
+ Dictionary<string, string> variables = new Dictionary<string, string> (StringComparer.OrdinalIgnoreCase) {
+ { "MSBuildExtensionsPath64", msbuild },
+ { "MSBuildExtensionsPath32", msbuild },
+ { "MSBuildExtensionsPath", msbuild }
+ };
+
+ string path = StringParserService.Parse (targetsPath, variables);
+ if (Path.DirectorySeparatorChar != '\\')
+ path = path.Replace ('\\', Path.DirectorySeparatorChar);
+
+ return File.Exists (path);
+ }
+
+ /// <summary>
+ /// Given a project referenced in an Import, returns a project that should be loaded instead, or null if there is no redirect
+ /// </summary>
+ internal static string GetImportRedirect (string project)
+ {
+ string target;
+ if (importRedirects.TryGetValue (project, out target))
+ return target;
+ return null;
+ }
+
+ /// <summary>
+ /// Loads a solution item
+ /// </summary>
+ /// <returns>The item.</returns>
+ /// <param name="monitor">Progress monitor</param>
+ /// <param name="fileName">File path to the item file</param>
+ /// <param name="expectedFormat">File format that the project should have</param>
+ /// <param name="typeGuid">Optional item type GUID. If not provided, the type is guessed from the file extension.</param>
+ /// <param name="itemGuid">Optional item Id</param>
+ /// <param name="ctx">Optional solution context</param>
+ public async static Task<SolutionItem> LoadItem (ProgressMonitor monitor, string fileName, MSBuildFileFormat expectedFormat, string typeGuid, string itemGuid, SolutionLoadContext ctx)
+ {
+ SolutionItem item = null;
+
+ // Find an extension node that can handle this item type
+ var node = GetItemTypeNodes ().FirstOrDefault (n => n.CanHandleFile (fileName, typeGuid));
+
+ if (node != null) {
+ item = await node.CreateSolutionItem (monitor, ctx, fileName);
+ if (item == null)
+ return null;
+ }
+
+ if (item == null) {
+ // If it is a known unsupported project, load it as UnknownProject
+ item = CreateUnknownSolutionItem (monitor, fileName, typeGuid, typeGuid, ctx);
+ if (item == null)
+ return null;
+ }
+
+ item.EnsureInitialized ();
+
+ item.BeginLoad ();
+ ctx.LoadCompleted += delegate {
+ item.EndLoad ();
+ item.NotifyItemReady ();
+ };
+
+ await item.LoadAsync (monitor, fileName, expectedFormat);
+ return item;
+ }
+
+ internal static SolutionItem CreateUnknownSolutionItem (ProgressMonitor monitor, string fileName, string typeGuid, string unknownTypeGuid, SolutionLoadContext ctx)
+ {
+ bool loadAsProject = false;
+ string unsupportedMessage;
+
+ var relPath = ctx != null && ctx.Solution != null ? new FilePath (fileName).ToRelative (ctx.Solution.BaseDirectory).ToString() : new FilePath (fileName).FileName;
+ var guids = !string.IsNullOrEmpty (unknownTypeGuid) ? unknownTypeGuid.Split (new char[] {';'}, StringSplitOptions.RemoveEmptyEntries) : new string[0];
+
+ if (!string.IsNullOrEmpty (unknownTypeGuid)) {
+ var projectInfo = MSBuildProjectService.GetUnknownProjectTypeInfo (guids, fileName);
+ if (projectInfo != null) {
+ loadAsProject = projectInfo.LoadFiles;
+ unsupportedMessage = projectInfo.GetInstructions ();
+ LoggingService.LogWarning (string.Format ("Could not load {0} project '{1}'. {2}", projectInfo.Name, relPath, projectInfo.GetInstructions ()));
+ if (!loadAsProject)
+ monitor.ReportWarning (GettextCatalog.GetString ("Could not load {0} project '{1}'. {2}", projectInfo.Name, relPath, projectInfo.GetInstructions ()));
+ } else {
+ unsupportedMessage = GettextCatalog.GetString ("Unknown project type: {0}", unknownTypeGuid);
+ LoggingService.LogWarning (string.Format ("Could not load project '{0}' with unknown item type '{1}'", relPath, unknownTypeGuid));
+ monitor.ReportWarning (GettextCatalog.GetString ("Could not load project '{0}' with unknown item type '{1}'", relPath, unknownTypeGuid));
+ return null;
+ }
+ } else {
+ unsupportedMessage = GettextCatalog.GetString ("Unknown project type");
+ LoggingService.LogWarning (string.Format ("Could not load project '{0}' with unknown item type", relPath));
+ monitor.ReportWarning (GettextCatalog.GetString ("Could not load project '{0}' with unknown item type", relPath));
+ }
+ if (loadAsProject) {
+ var project = (Project) CreateUninitializedInstance (typeof(UnknownProject));
+ project.UnsupportedProjectMessage = unsupportedMessage;
+ project.SetCreationContext (Project.CreationContext.Create (typeGuid, new string[0]));
+ return project;
+ } else
+ return null;
+ }
+
+
+ /// <summary>
+ /// Creates an uninitialized solution item instance
+ /// </summary>
+ /// <param name="type">Solution item type</param>
+ /// <remarks>
+ /// Some subclasses (such as ProjectTypeNode) need to assign some data to
+ /// the object before it is initialized. However, by default initialization
+ /// is automatically made by the constructor, so to support this scenario
+ /// the initialization has to be delayed. This is done by setting the
+ /// MonoDevelop.DelayItemInitialization logical context property.
+ /// When this property is set, the object is not initialized, and it has
+ /// to be manually initialized by calling EnsureInitialized.
+ /// </remarks>
+ internal static SolutionItem CreateUninitializedInstance (Type type)
+ {
+ try {
+ System.Runtime.Remoting.Messaging.CallContext.LogicalSetData ("MonoDevelop.DelayItemInitialization", true);
+ return (SolutionItem)Activator.CreateInstance (type, true);
+ } finally {
+ System.Runtime.Remoting.Messaging.CallContext.LogicalSetData ("MonoDevelop.DelayItemInitialization", false);
+ }
+ }
+
+ internal static bool CanCreateSolutionItem (string type, ProjectCreateInformation info, System.Xml.XmlElement projectOptions)
+ {
+ type = ConvertTypeAliasToGuid (type);
+
+ foreach (var node in GetItemTypeNodes ()) {
+ if (node.CanCreateSolutionItem (type, info, projectOptions))
+ return true;
+ }
+ return false;
+ }
+
+ internal static Project CreateProject (string typeGuid, params string[] flavorGuids)
+ {
+ flavorGuids = ConvertTypeAliasesToGuids (flavorGuids);
+
+ foreach (var node in GetItemTypeNodes ().OfType<ProjectTypeNode> ()) {
+ if (node.Guid.Equals (typeGuid, StringComparison.OrdinalIgnoreCase) || node.TypeAlias == typeGuid) {
+ var p = node.CreateProject (flavorGuids);
+ p.EnsureInitialized ();
+ p.NotifyItemReady ();
+ return p;
+ }
+ }
+ throw new InvalidOperationException ("Unknown project type: " + typeGuid);
+ }
+
+ internal static bool CanCreateProject (string typeGuid, params string[] flavorGuids)
+ {
+ return IsKnownTypeGuid (ConvertTypeAliasToGuid (typeGuid)) && ConvertTypeAliasesToGuids (flavorGuids).All (id => IsKnownFlavorGuid (id));
+ }
+
+ internal static SolutionItem CreateSolutionItem (string type, ProjectCreateInformation info, System.Xml.XmlElement projectOptions)
+ {
+ type = ConvertTypeAliasToGuid (type);
+
+ foreach (var node in GetItemTypeNodes ()) {
+ if (node.CanCreateSolutionItem (type, info, projectOptions)) {
+ var item = node.CreateSolutionItem (type, info, projectOptions);
+ item.NotifyItemReady ();
+ return item;
+ }
+ }
+ throw new InvalidOperationException ("Unknown project type: " + type);
+ }
+
+ internal static Project CreateProject (string typeGuid, ProjectCreateInformation info, System.Xml.XmlElement projectOptions, params string[] flavorGuids)
+ {
+ flavorGuids = ConvertTypeAliasesToGuids (flavorGuids);
+
+ foreach (var node in GetItemTypeNodes ().OfType<ProjectTypeNode> ()) {
+ if (node.Guid.Equals (typeGuid, StringComparison.OrdinalIgnoreCase) || typeGuid == node.TypeAlias) {
+ var p = node.CreateProject (flavorGuids);
+ p.EnsureInitialized ();
+ p.InitializeFromTemplate (info, projectOptions);
+ p.NotifyItemReady ();
+ return p;
+ }
+ }
+ throw new InvalidOperationException ("Unknown project type: " + typeGuid);
+ }
+
+ public static string ConvertTypeAliasToGuid (string type)
+ {
+ var node = GetItemTypeNodes ().FirstOrDefault (n => n.TypeAlias == type);
+ if (node != null)
+ return node.Guid;
+ var enode = WorkspaceObject.GetModelExtensions (null).OfType<SolutionItemExtensionNode> ().FirstOrDefault (n => n.TypeAlias == type);
+ if (enode != null)
+ return enode.Guid;
+ return type;
+ }
+
+ public static string[] ConvertTypeAliasesToGuids (string[] types)
+ {
+ string[] copy = null;
+ for (int n=0; n<types.Length; n++) {
+ var nt = ConvertTypeAliasToGuid (types[n]);
+ if (nt != types[n]) {
+ if (copy == null)
+ copy = types.ToArray ();
+ copy [n] = nt;
+ }
+ }
+ return copy ?? types;
+ }
+
+ internal static MSBuildSupport GetMSBuildSupportForFlavors (IEnumerable<string> flavorGuids)
+ {
+ foreach (var fid in flavorGuids) {
+ var node = WorkspaceObject.GetModelExtensions (null).OfType<SolutionItemExtensionNode> ().FirstOrDefault (n => n.Guid.Equals (fid, StringComparison.InvariantCultureIgnoreCase));
+ if (node != null) {
+ if (node.MSBuildSupport != MSBuildSupport.Supported)
+ return node.MSBuildSupport;
+ } else if (!IsKnownTypeGuid (fid))
+ throw new UnknownSolutionItemTypeException (fid);
+ }
+ return MSBuildSupport.Supported;
+ }
+
+ internal static List<SolutionItemExtensionNode> GetMigrableFlavors (string[] flavorGuids)
+ {
+ var list = new List<SolutionItemExtensionNode> ();
+ foreach (var fid in flavorGuids) {
+ foreach (var node in WorkspaceObject.GetModelExtensions (null).OfType<SolutionItemExtensionNode> ()) {
+ if (node.SupportsMigration && node.Guid.Equals (fid, StringComparison.InvariantCultureIgnoreCase))
+ list.Add (node);
+ }
+ }
+ return list;
+ }
+
+ internal static async Task MigrateFlavors (ProgressMonitor monitor, string fileName, string typeGuid, MSBuildProject p, List<SolutionItemExtensionNode> nodes)
+ {
+ var language = GetLanguageFromGuid (typeGuid);
+
+ bool migrated = false;
+
+ foreach (var node in nodes) {
+ if (await MigrateProject (monitor, node, p, fileName, language))
+ migrated = true;
+ }
+ if (migrated)
+ await p.SaveAsync (fileName);
+ }
+
+ static async Task<bool> MigrateProject (ProgressMonitor monitor, SolutionItemExtensionNode st, MSBuildProject p, string fileName, string language)
+ {
+ var projectLoadMonitor = GetProjectLoadProgressMonitor (monitor);
+ if (projectLoadMonitor == null) {
+ // projectLoadMonitor will be null when running through md-tool, but
+ // this is not fatal if migration is not required, so just ignore it. --abock
+ if (!st.IsMigrationRequired)
+ return false;
+
+ LoggingService.LogError (Environment.StackTrace);
+ monitor.ReportError ("Could not open unmigrated project and no migrator was supplied", null);
+ throw new UserException ("Project migration failed");
+ }
+
+ var migrationType = st.MigrationHandler.CanPromptForMigration
+ ? await st.MigrationHandler.PromptForMigration (projectLoadMonitor, p, fileName, language)
+ : projectLoadMonitor.ShouldMigrateProject ();
+ if (migrationType == MigrationType.Ignore) {
+ if (st.IsMigrationRequired) {
+ monitor.ReportError (string.Format ("{1} cannot open the project '{0}' unless it is migrated.", Path.GetFileName (fileName), BrandingService.ApplicationName), null);
+ throw new UserException ("The user choose not to migrate the project");
+ } else
+ return false;
+ }
+
+ var baseDir = (FilePath) Path.GetDirectoryName (fileName);
+ if (migrationType == MigrationType.BackupAndMigrate) {
+ var backupDirFirst = baseDir.Combine ("backup");
+ string backupDir = backupDirFirst;
+ int i = 0;
+ while (Directory.Exists (backupDir)) {
+ backupDir = backupDirFirst + "-" + i.ToString ();
+ if (i++ > 20) {
+ throw new Exception ("Too many backup directories");
+ }
+ }
+ Directory.CreateDirectory (backupDir);
+ foreach (var file in st.MigrationHandler.FilesToBackup (fileName))
+ File.Copy (file, Path.Combine (backupDir, Path.GetFileName (file)));
+ }
+
+ if (!await st.MigrationHandler.Migrate (projectLoadMonitor, p, fileName, language))
+ throw new UserException ("Project migration failed");
+
+ return true;
+ }
+
+ static ProjectLoadProgressMonitor GetProjectLoadProgressMonitor (ProgressMonitor monitor)
+ {
+ var projectLoadMonitor = monitor as ProjectLoadProgressMonitor;
+ if (projectLoadMonitor != null)
+ return projectLoadMonitor;
+
+ var aggregatedMonitor = monitor as AggregatedProgressMonitor;
+ if (aggregatedMonitor != null)
+ return aggregatedMonitor.LeaderMonitor as ProjectLoadProgressMonitor;
+
+ return null;
+ }
+
+ internal static string GetLanguageGuid (string language)
+ {
+ foreach (var node in GetItemTypeNodes ().OfType<DotNetProjectTypeNode> ()) {
+ if (node.Language == language)
+ return node.Guid;
+ }
+ throw new InvalidOperationException ("Language not supported: " + language);
+ }
+
+ internal static string GetLanguageFromGuid (string guid)
+ {
+ foreach (var node in GetItemTypeNodes ().OfType<DotNetProjectTypeNode> ()) {
+ if (node.Guid.Equals (guid, StringComparison.OrdinalIgnoreCase))
+ return node.Language;
+ }
+ throw new InvalidOperationException ("Language not supported: " + guid);
+ }
+
+ internal static bool IsKnownFlavorGuid (string guid)
+ {
+ return WorkspaceObject.GetModelExtensions (null).OfType<SolutionItemExtensionNode> ().Any (n => n.Guid.Equals (guid, StringComparison.InvariantCultureIgnoreCase));
+ }
+
+ internal static bool IsKnownTypeGuid (string guid)
+ {
+ foreach (var node in GetItemTypeNodes ()) {
+ if (node.Guid.Equals (guid, StringComparison.OrdinalIgnoreCase))
+ return true;
+ }
+ return false;
+ }
+
+ internal static string GetTypeGuidFromAlias (string alias)
+ {
+ foreach (var node in GetItemTypeNodes ()) {
+ if (node.TypeAlias.Equals (alias, StringComparison.OrdinalIgnoreCase))
+ return node.Guid;
+ }
+ return null;
+ }
+
+ public static void CheckHandlerUsesMSBuildEngine (SolutionFolderItem item, out bool useByDefault, out bool require)
+ {
+ var handler = item as Project;
+ if (handler == null) {
+ useByDefault = require = false;
+ return;
+ }
+ useByDefault = handler.MSBuildEngineSupport.HasFlag (MSBuildSupport.Supported);
+ require = handler.MSBuildEngineSupport.HasFlag (MSBuildSupport.Required);
+ }
+
+ static IEnumerable<SolutionItemTypeNode> GetItemTypeNodes ()
+ {
+ foreach (ExtensionNode node in itemTypeNodes) {
+ if (node is SolutionItemTypeNode)
+ yield return (SolutionItemTypeNode) node;
+ }
+ foreach (var node in customNodes)
+ yield return node;
+ }
+
+ static List<SolutionItemTypeNode> customNodes = new List<SolutionItemTypeNode> ();
+
+ internal static void RegisterCustomItemType (SolutionItemTypeNode node)
+ {
+ customNodes.Add (node);
+ }
+
+ internal static void UnregisterCustomItemType (SolutionItemTypeNode node)
+ {
+ customNodes.Remove (node);
+ }
+
+ internal static bool CanReadFile (FilePath file)
+ {
+ foreach (SolutionItemTypeNode node in GetItemTypeNodes ()) {
+ if (node.CanHandleFile (file, null)) {
+ return true;
+ }
+ }
+ return GetUnknownProjectTypeInfo (new string[0], file) != null;
+ }
+
+ internal static string GetExtensionForItem (SolutionItem item)
+ {
+ foreach (SolutionItemTypeNode node in GetItemTypeNodes ()) {
+ if (node.Guid.Equals (item.TypeGuid, StringComparison.OrdinalIgnoreCase))
+ return node.Extension;
+ }
+ // The generic handler should always be found
+ throw new InvalidOperationException ();
+ }
+
+ internal static string GetTypeGuidForItem (SolutionItem item)
+ {
+ var className = item.GetType ().FullName;
+ foreach (SolutionItemTypeNode node in GetItemTypeNodes ()) {
+ if (node.ItemTypeName == className)
+ return node.Guid;
+ }
+ return GenericItemGuid;
+ }
+
+ internal static MSBuildSupport GetMSBuildSupportForProject (Project project)
+ {
+ if (project is UnknownProject)
+ return MSBuildSupport.NotSupported;
+
+ foreach (var node in GetItemTypeNodes ().OfType<ProjectTypeNode> ()) {
+ if (node.Guid.Equals (project.TypeGuid, StringComparison.OrdinalIgnoreCase)) {
+ if (node.MSBuildSupport != MSBuildSupport.Supported)
+ return node.MSBuildSupport;
+ return GetMSBuildSupportForFlavors (project.FlavorGuids);
+ }
+ }
+ return MSBuildSupport.NotSupported;
+ }
+
+ public static void RegisterGenericProjectType (string projectId, Type type)
+ {
+ lock (genericProjectTypes) {
+ if (!typeof(Project).IsAssignableFrom (type))
+ throw new ArgumentException ("Type is not a subclass of MonoDevelop.Projects.Project");
+ genericProjectTypes [projectId] = type;
+ }
+ }
+
+ internal static Task<SolutionItem> CreateGenericProject (string file)
+ {
+ if (file == null)
+ return Task.FromResult<SolutionItem> (new GenericProject ());
+
+ return Task<SolutionItem>.Factory.StartNew (delegate {
+ var t = ReadGenericProjectType (file);
+ if (t == null)
+ throw new UserException ("Unknown project type");
+
+ var dt = Services.ProjectService.DataContext.GetConfigurationDataType (t);
+ if (dt != null) {
+ if (!typeof(Project).IsAssignableFrom (dt.ValueType))
+ throw new UserException ("Unknown project type: " + t);
+ return (SolutionItem)Activator.CreateInstance (dt.ValueType);
+ }
+
+ Type type;
+ lock (genericProjectTypes) {
+ if (!genericProjectTypes.TryGetValue (t, out type))
+ throw new UserException ("Unknown project type: " + t);
+ }
+ return (SolutionItem)Activator.CreateInstance (type);
+ });
+ }
+
+ static string ReadGenericProjectType (string file)
+ {
+ using (XmlTextReader tr = new XmlTextReader (file)) {
+ tr.MoveToContent ();
+ if (tr.LocalName != "Project")
+ return null;
+ if (tr.IsEmptyElement)
+ return null;
+ tr.ReadStartElement ();
+ tr.MoveToContent ();
+ if (tr.LocalName != "PropertyGroup")
+ return null;
+ if (tr.IsEmptyElement)
+ return null;
+ tr.ReadStartElement ();
+ tr.MoveToContent ();
+ while (tr.NodeType != XmlNodeType.EndElement) {
+ if (tr.NodeType == XmlNodeType.Element && !tr.IsEmptyElement && tr.LocalName == "ItemType")
+ return tr.ReadElementString ();
+ tr.Skip ();
+ }
+ return null;
+ }
+ }
+
+ static char[] specialCharacters = new char [] {'%', '$', '@', '(', ')', '\'', ';', '?' };
+
+ public static string EscapeString (string str)
+ {
+ int i = str.IndexOfAny (specialCharacters);
+ while (i != -1) {
+ str = str.Substring (0, i) + '%' + ((int) str [i]).ToString ("X") + str.Substring (i + 1);
+ i = str.IndexOfAny (specialCharacters, i + 3);
+ }
+ return str;
+ }
+
+ public static string UnescapePath (string path)
+ {
+ if (string.IsNullOrEmpty (path))
+ return path;
+
+ if (!Platform.IsWindows)
+ path = path.Replace ("\\", "/");
+
+ return UnscapeString (path);
+ }
+
+ public static string UnscapeString (string str)
+ {
+ int i = str.IndexOf ('%');
+ while (i != -1 && i < str.Length - 2) {
+ int c;
+ if (int.TryParse (str.Substring (i+1, 2), NumberStyles.HexNumber, null, out c))
+ str = str.Substring (0, i) + (char) c + str.Substring (i + 3);
+ i = str.IndexOf ('%', i + 1);
+ }
+ return str;
+ }
+
+ public static string ToMSBuildPath (string baseDirectory, string absPath, bool normalize = true)
+ {
+ if (string.IsNullOrEmpty (absPath))
+ return absPath;
+ if (baseDirectory != null) {
+ absPath = FileService.AbsoluteToRelativePath (baseDirectory, absPath);
+ if (normalize)
+ absPath = FileService.NormalizeRelativePath (absPath);
+ }
+ return EscapeString (absPath).Replace ('/', '\\');
+ }
+
+ internal static string ToMSBuildPathRelative (string baseDirectory, string absPath)
+ {
+ FilePath file = ToMSBuildPath (baseDirectory, absPath);
+ return file.ToRelative (baseDirectory);
+ }
+
+
+ internal static string FromMSBuildPathRelative (string basePath, string relPath)
+ {
+ FilePath file = FromMSBuildPath (basePath, relPath);
+ return file.ToRelative (basePath);
+ }
+
+ public static string FromMSBuildPath (string basePath, string relPath)
+ {
+ string res;
+ FromMSBuildPath (basePath, relPath, out res);
+ return res;
+ }
+
+ internal static bool IsAbsoluteMSBuildPath (string path)
+ {
+ if (path.Length > 1 && char.IsLetter (path [0]) && path[1] == ':')
+ return true;
+ if (path.Length > 0 && path [0] == '\\')
+ return true;
+ return false;
+ }
+
+ internal static bool FromMSBuildPath (string basePath, string relPath, out string resultPath)
+ {
+ resultPath = relPath;
+
+ if (string.IsNullOrEmpty (relPath))
+ return false;
+
+ string path = UnescapePath (relPath);
+
+ if (char.IsLetter (path [0]) && path.Length > 1 && path[1] == ':') {
+ if (Platform.IsWindows) {
+ resultPath = path; // Return the escaped value
+ return true;
+ } else
+ return false;
+ }
+
+ bool isRooted = Path.IsPathRooted (path);
+
+ if (!isRooted && basePath != null) {
+ path = Path.Combine (basePath, path);
+ isRooted = Path.IsPathRooted (path);
+ }
+
+ // Return relative paths as-is, we can't do anything else with them
+ if (!isRooted) {
+ resultPath = FileService.NormalizeRelativePath (path);
+ return true;
+ }
+
+ // If we're on Windows, don't need to fix file casing.
+ if (Platform.IsWindows) {
+ resultPath = FileService.GetFullPath (path);
+ return true;
+ }
+
+ // If the path exists with the exact casing specified, then we're done
+ if (System.IO.File.Exists (path) || System.IO.Directory.Exists (path)){
+ resultPath = Path.GetFullPath (path);
+ return true;
+ }
+
+ // Not on Windows, file doesn't exist. That could mean the project was brought from Windows
+ // and the filename case in the project doesn't match the file on disk, because Windows is
+ // case-insensitive. Since we have an absolute path, search the directory for the file with
+ // the correct case.
+ string[] names = path.Substring (1).Split ('/');
+ string part = "/";
+
+ for (int n=0; n<names.Length; n++) {
+ string[] entries;
+
+ if (names [n] == ".."){
+ if (part == "/")
+ return false; // Can go further back. It's not an existing file
+ part = Path.GetFullPath (part + "/..");
+ continue;
+ }
+
+ entries = Directory.GetFileSystemEntries (part);
+
+ string fpath = null;
+ foreach (string e in entries) {
+ if (string.Compare (Path.GetFileName (e), names [n], StringComparison.OrdinalIgnoreCase) == 0) {
+ fpath = e;
+ break;
+ }
+ }
+ if (fpath == null) {
+ // Part of the path does not exist. Can't do any more checking.
+ part = Path.GetFullPath (part);
+ for (; n < names.Length; n++)
+ part += "/" + names[n];
+ resultPath = part;
+ return true;
+ }
+
+ part = fpath;
+ }
+ resultPath = Path.GetFullPath (part);
+ return true;
+ }
+
+ //Given a filename like foo.it.resx, splits it into - foo, it, resx
+ //Returns true only if a valid culture is found
+ //Note: hand-written as this can get called lotsa times
+ public static bool TrySplitResourceName (string fname, out string only_filename, out string culture, out string extn)
+ {
+ only_filename = culture = extn = null;
+
+ int last_dot = -1;
+ int culture_dot = -1;
+ int i = fname.Length - 1;
+ while (i >= 0) {
+ if (fname [i] == '.') {
+ last_dot = i;
+ break;
+ }
+ i --;
+ }
+ if (i < 0)
+ return false;
+
+ i--;
+ while (i >= 0) {
+ if (fname [i] == '.') {
+ culture_dot = i;
+ break;
+ }
+ i --;
+ }
+ if (culture_dot < 0)
+ return false;
+
+ culture = fname.Substring (culture_dot + 1, last_dot - culture_dot - 1);
+ if (!CultureNamesTable.ContainsKey (culture))
+ return false;
+
+ only_filename = fname.Substring (0, culture_dot);
+ extn = fname.Substring (last_dot + 1);
+ return true;
+ }
+
+ static bool runLocal = false;
+
+ internal static async Task<RemoteProjectBuilder> GetProjectBuilder (TargetRuntime runtime, string minToolsVersion, string file, string solutionFile, int customId, bool lockBuilder = false)
+ {
+ using (await buildersLock.EnterAsync ())
+ {
+ //attempt to use 14.0 builder first if available
+ string toolsVersion = "14.0";
+ string binDir = runtime.GetMSBuildBinPath ("14.0");
+ if (binDir == null) {
+ toolsVersion = "12.0";
+ binDir = runtime.GetMSBuildBinPath ("12.0");
+ if (binDir == null) {
+ //fall back to 4.0, we know it's always available
+ toolsVersion = "4.0";
+ }
+ }
+
+ // Check the ToolsVersion we found can handle the project
+ // The check is only done for the .NET framework since Mono doesn't really have the concept of ToolsVersion.
+ // On Mono we'll just try to build with whatever is installed.
+ Version tv, mtv;
+ if (runtime is MsNetTargetRuntime && Version.TryParse (toolsVersion, out tv) && Version.TryParse (minToolsVersion, out mtv) && tv < mtv) {
+ string error = null;
+ if (minToolsVersion == "12.0")
+ error = "MSBuild 2013 is not installed. Please download and install it from " +
+ "http://www.microsoft.com/en-us/download/details.aspx?id=40760";
+ throw new InvalidOperationException (error ?? string.Format (
+ "Runtime '{0}' does not have MSBuild '{1}' ToolsVersion installed",
+ runtime.Id, toolsVersion)
+ );
+ }
+
+ //one builder per solution
+ string builderKey = runtime.Id + " # " + solutionFile + " # " + customId;
+
+ RemoteBuildEngine builder = null;
+
+ if (lockBuilder) {
+ foreach (var b in builders.GetBuilders (builderKey)) {
+ if (b.Lock ()) {
+ builder = b;
+ break;
+ }
+ b.Unlock ();
+ }
+ } else
+ builder = builders.GetBuilders (builderKey).FirstOrDefault ();
+
+ if (builder != null) {
+ builder.ReferenceCount++;
+ return new RemoteProjectBuilder (file, builder);
+ }
+
+ return await Task.Run (async () => {
+ //always start the remote process explicitly, even if it's using the current runtime and fx
+ //else it won't pick up the assembly redirects from the builder exe
+ var exe = GetExeLocation (runtime, toolsVersion);
+
+ MonoDevelop.Core.Execution.RemotingService.RegisterRemotingChannel ();
+ var pinfo = new ProcessStartInfo (exe) {
+ UseShellExecute = false,
+ CreateNoWindow = true,
+ RedirectStandardError = true,
+ RedirectStandardInput = true,
+ };
+ runtime.GetToolsExecutionEnvironment ().MergeTo (pinfo);
+
+ Process p = null;
+
+ try {
+ IBuildEngine engine;
+ if (!runLocal) {
+ p = runtime.ExecuteAssembly (pinfo);
+
+ // The builder app will write the build engine reference
+ // after reading the process id from the standard input
+ var processStartedSignal = new TaskCompletionSource<bool> ();
+ string responseKey = "[MonoDevelop]";
+ string sref = null;
+ p.ErrorDataReceived += (sender, e) => {
+ if (e.Data == null) {
+ if (string.IsNullOrEmpty (sref))
+ LoggingService.LogError ("The MSBuild builder exited before initializing");
+ return;
+ }
+
+ if (e.Data.StartsWith (responseKey, StringComparison.Ordinal)) {
+ sref = e.Data.Substring (responseKey.Length);
+ processStartedSignal.SetResult (true);
+ } else
+ Console.WriteLine (e.Data);
+ };
+ p.BeginErrorReadLine ();
+ p.StandardInput.WriteLine (Process.GetCurrentProcess ().Id.ToString ());
+ if (await Task.WhenAny (processStartedSignal.Task, Task.Delay (5000)) != processStartedSignal.Task)
+ throw new Exception ("MSBuild process could not be started");
+
+ byte [] data = Convert.FromBase64String (sref);
+ MemoryStream ms = new MemoryStream (data);
+ BinaryFormatter bf = new BinaryFormatter ();
+ engine = (IBuildEngine)bf.Deserialize (ms);
+ } else {
+ var asm = System.Reflection.Assembly.LoadFrom (exe);
+ var t = asm.GetType ("MonoDevelop.Projects.MSBuild.BuildEngine");
+ engine = (IBuildEngine)Activator.CreateInstance (t);
+ }
+ engine.SetCulture (GettextCatalog.UICulture);
+ engine.SetGlobalProperties (GetCoreGlobalProperties (solutionFile));
+ foreach (var gpp in globalPropertyProviders)
+ engine.SetGlobalProperties (gpp.GetGlobalProperties ());
+ builder = new RemoteBuildEngine (p, engine);
+ } catch {
+ if (p != null) {
+ try {
+ p.Kill ();
+ } catch {
+ }
+ }
+ throw;
+ }
+
+ builders.Add (builderKey, builder);
+ builder.ReferenceCount = 1;
+ builder.Disconnected += async delegate {
+ using (await buildersLock.EnterAsync ())
+ builders.Remove (builder);
+ };
+ if (lockBuilder)
+ builder.Lock ();
+ return new RemoteProjectBuilder (file, builder);
+ });
+ }
+ }
+
+ static IDictionary<string,string> GetCoreGlobalProperties (string slnFile)
+ {
+ var dictionary = new Dictionary<string,string> ();
+
+ //this causes build targets to behave how they should inside an IDE, instead of in a command-line process
+ dictionary.Add ("BuildingInsideVisualStudio", "true");
+
+ //we don't have host compilers in MD, and this is set to true by some of the MS targets
+ //which causes it to always run the CoreCompile task if BuildingInsideVisualStudio is also
+ //true, because the VS in-process compiler would take care of the deps tracking
+ dictionary.Add ("UseHostCompilerIfAvailable", "false" );
+
+ if (string.IsNullOrEmpty (slnFile))
+ return dictionary;
+
+ dictionary.Add ("SolutionPath", Path.GetFullPath (slnFile));
+ dictionary.Add ("SolutionName", Path.GetFileNameWithoutExtension (slnFile));
+ dictionary.Add ("SolutionFilename", Path.GetFileName (slnFile));
+ dictionary.Add ("SolutionDir", Path.GetDirectoryName (slnFile) + Path.DirectorySeparatorChar);
+
+ return dictionary;;
+ }
+
+ static string GetExeLocation (TargetRuntime runtime, string toolsVersion)
+ {
+ FilePath sourceExe = typeof(MSBuildProjectService).Assembly.Location;
+
+ if ((runtime is MsNetTargetRuntime) && int.Parse (toolsVersion.Split ('.')[0]) >= 4)
+ toolsVersion = "dotnet." + toolsVersion;
+
+ var exe = sourceExe.ParentDirectory.Combine ("MSBuild", toolsVersion, "MonoDevelop.Projects.Formats.MSBuild.exe");
+ if (File.Exists (exe))
+ return exe;
+
+ throw new InvalidOperationException ("Unsupported MSBuild ToolsVersion '" + toolsVersion + "'");
+ }
+
+ internal static async void ReleaseProjectBuilder (RemoteBuildEngine engine)
+ {
+ using (await buildersLock.EnterAsync ()) {
+ if (--engine.ReferenceCount != 0)
+ return;
+ builders.Remove (engine);
+ }
+ engine.Dispose ();
+ }
+
+ static Dictionary<string, string> cultureNamesTable;
+ static Dictionary<string, string> CultureNamesTable {
+ get {
+ if (cultureNamesTable == null) {
+ cultureNamesTable = new Dictionary<string, string> ();
+ foreach (CultureInfo ci in CultureInfo.GetCultures (CultureTypes.AllCultures))
+ cultureNamesTable [ci.Name] = ci.Name;
+ }
+
+ return cultureNamesTable;
+ }
+ }
+
+ internal static UnknownProjectTypeNode GetUnknownProjectTypeInfo (string[] guids, string fileName = null)
+ {
+ var ext = fileName != null ? Path.GetExtension (fileName).TrimStart ('.') : null;
+ var nodes = unknownProjectTypeNodes.Where (p => guids.Any (p.MatchesGuid) || (ext != null && p.Extension == ext)).ToList ();
+ return nodes.FirstOrDefault (n => !n.IsSolvable) ?? nodes.FirstOrDefault (n => n.IsSolvable);
+ }
+
+ internal static Type GetProjectItemType (string itemName)
+ {
+ var node = projecItemTypeNodes.Values.FirstOrDefault (e => e.Id == itemName);
+ if (node != null) {
+ var t = node.Addin.GetType (node.TypeName, true);
+ if (!typeof(ProjectItem).IsAssignableFrom (t))
+ throw new InvalidOperationException ("Project item type '" + node.TypeName + "' is not a subclass of ProjectItem");
+ return t;
+ }
+ Type tt;
+ if (customProjectItemTypes.TryGetValue (itemName, out tt))
+ return tt;
+ else
+ return null;
+ }
+
+ internal static string GetNameForProjectItem (Type type)
+ {
+ TypeExtensionNode node;
+ if (projecItemTypeNodes.TryGetValue (type.FullName, out node))
+ return node.Id;
+
+ var r = customProjectItemTypes.FirstOrDefault (k => k.Value == type);
+ if (r.Key != null)
+ return r.Key;
+ return null;
+ }
+ }
+
+ class MSBuildDataContext: DataContext
+ {
+ protected override DataType CreateConfigurationDataType (Type type)
+ {
+ if (type == typeof(bool))
+ return new MSBuildBoolDataType ();
+ else if (type == typeof(bool?))
+ return new MSBuildNullableBoolDataType ();
+ else
+ return base.CreateConfigurationDataType (type);
+ }
+ }
+
+ class MSBuildBoolDataType: PrimitiveDataType
+ {
+ public MSBuildBoolDataType (): base (typeof(bool))
+ {
+ }
+
+ internal protected override DataNode OnSerialize (SerializationContext serCtx, object mapData, object value)
+ {
+ return new MSBuildBoolDataValue (Name, (bool) value);
+ }
+
+ internal protected override object OnDeserialize (SerializationContext serCtx, object mapData, DataNode data)
+ {
+ return String.Equals (((DataValue)data).Value, "true", StringComparison.OrdinalIgnoreCase);
+ }
+ }
+
+ class MSBuildBoolDataValue : DataValue
+ {
+ public MSBuildBoolDataValue (string name, bool value)
+ : base (name, value ? "True" : "False")
+ {
+ RawValue = value;
+ }
+
+ public bool RawValue { get; private set; }
+ }
+
+ class MSBuildNullableBoolDataType: PrimitiveDataType
+ {
+ public MSBuildNullableBoolDataType (): base (typeof(bool))
+ {
+ }
+
+ internal protected override DataNode OnSerialize (SerializationContext serCtx, object mapData, object value)
+ {
+ return new MSBuildNullableBoolDataValue (Name, (bool?) value);
+ }
+
+ internal protected override object OnDeserialize (SerializationContext serCtx, object mapData, DataNode data)
+ {
+ var d = (DataValue)data;
+ if (string.IsNullOrEmpty (d.Value))
+ return (bool?) null;
+ return (bool?) String.Equals (d.Value, "true", StringComparison.OrdinalIgnoreCase);
+ }
+ }
+
+ class MSBuildNullableBoolDataValue : DataValue
+ {
+ public MSBuildNullableBoolDataValue (string name, bool? value)
+ : base (name, value.HasValue? (value.Value? "True" : "False") : null)
+ {
+ RawValue = value;
+ }
+
+ public bool? RawValue { get; private set; }
+ }
+
+ class GenericItemNode : ProjectTypeNode
+ {
+ public static readonly GenericItemNode Instance = new GenericItemNode ();
+
+ public GenericItemNode ()
+ {
+ Guid = MSBuildProjectService.GenericItemGuid;
+ Extension = "mdproj";
+ MSBuildSupport = MSBuildSupport.NotSupported;
+ TypeAlias = "GenericProject";
+ }
+
+ public override Type ItemType {
+ get {
+ return typeof (GenericItemFactory);
+ }
+ }
+
+ class GenericItemFactory: SolutionItemFactory
+ {
+ public override Task<SolutionItem> CreateItem (string fileName, string typeGuid)
+ {
+ return MSBuildProjectService.CreateGenericProject (fileName);
+ }
+ }
+ }
+
+ class BuilderCache
+ {
+ Dictionary<string,List<RemoteBuildEngine>> builders = new Dictionary<string, List<RemoteBuildEngine>> ();
+
+ public void Add (string key, RemoteBuildEngine builder)
+ {
+ List<RemoteBuildEngine> list;
+ if (!builders.TryGetValue (key, out list))
+ builders [key] = list = new List<RemoteBuildEngine> ();
+ list.Add (builder);
+ }
+
+ public IEnumerable<RemoteBuildEngine> GetBuilders (string key)
+ {
+ List<RemoteBuildEngine> list;
+ if (builders.TryGetValue (key, out list))
+ return list;
+ else
+ return Enumerable.Empty<RemoteBuildEngine> ();
+ }
+
+ public IEnumerable<RemoteBuildEngine> GetAllBuilders ()
+ {
+ return builders.Values.SelectMany (r => r);
+ }
+
+ public void Remove (RemoteBuildEngine builder)
+ {
+ foreach (var p in builders) {
+ if (p.Value.Remove (builder)) {
+ if (p.Value.Count == 0)
+ builders.Remove (p.Key);
+ return;
+ }
+ }
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProperty.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProperty.cs
new file mode 100644
index 0000000000..92f758c613
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProperty.cs
@@ -0,0 +1,504 @@
+//
+// MSBuildProperty.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Xml;
+using Microsoft.Build.BuildEngine;
+using System.Xml.Linq;
+using MonoDevelop.Core;
+using System.Globalization;
+using System.Text;
+using System.IO;
+using System.Linq;
+using System.Security.Cryptography;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public class MSBuildProperty: MSBuildPropertyCore, IMetadataProperty, IMSBuildPropertyEvaluated
+ {
+ MSBuildValueType valueType = MSBuildValueType.Default;
+ string value;
+ string rawValue, textValue;
+ string name;
+ string unevaluatedValue;
+ LinkedPropertyFlags flags;
+
+ static readonly string EmptyElementMarker = new string ('e', 1);
+
+ internal MSBuildProperty ()
+ {
+ NotifyChanges = true;
+ }
+
+ internal MSBuildProperty (string name): this ()
+ {
+ this.name = name;
+ }
+
+ internal MSBuildProperty (MSBuildNode parentNode, string name, string value, string evaluatedValue): this ()
+ {
+ ParentNode = parentNode;
+ this.name = name;
+ this.unevaluatedValue = value;
+ this.value = evaluatedValue;
+ }
+
+ internal override void Read (MSBuildXmlReader reader)
+ {
+ name = reader.LocalName;
+ base.Read (reader);
+ }
+
+ internal override void ReadContent (MSBuildXmlReader reader)
+ {
+ value = unevaluatedValue = ReadValue (reader);
+ }
+
+ internal override void WriteContent (XmlWriter writer, WriteContext context)
+ {
+ MSBuildWhitespace.Write (StartInnerWhitespace, writer);
+ if (rawValue != null) {
+ if (!object.ReferenceEquals (rawValue, EmptyElementMarker)) {
+ if (rawValue.Length == 0 && !WasReadAsEmptyElement)
+ writer.WriteString (""); // Keep the non-empty element
+ else
+ writer.WriteRaw (rawValue);
+ }
+ } else if (textValue != null) {
+ writer.WriteValue (textValue);
+ } else {
+ WriteValue (writer, context, unevaluatedValue);
+ }
+ MSBuildWhitespace.Write (EndInnerWhitespace, writer);
+ }
+
+ internal override bool PreferEmptyElement {
+ get {
+ return false;
+ }
+ }
+
+ internal override string GetElementName ()
+ {
+ return name;
+ }
+
+ string ReadValue (MSBuildXmlReader reader)
+ {
+ if (reader.IsEmptyElement) {
+ rawValue = EmptyElementMarker;
+ reader.Skip ();
+ return string.Empty;
+ }
+
+ MSBuildXmlElement elem = new MSBuildXmlElement ();
+ elem.ParentNode = this;
+ elem.ReadContent (reader);
+
+ if (elem.ChildNodes.Count == 0) {
+ StartInnerWhitespace = elem.StartInnerWhitespace;
+ EndInnerWhitespace = elem.EndInnerWhitespace;
+ rawValue = elem.GetInnerXml ();
+ return string.Empty;
+ }
+
+ if (elem.ChildNodes.Count == 1) {
+ var node = elem.ChildNodes [0] as MSBuildXmlValueNode;
+ if (node != null) {
+ StartInnerWhitespace = elem.StartInnerWhitespace;
+ StartInnerWhitespace = MSBuildWhitespace.AppendSpace (StartInnerWhitespace, node.StartWhitespace);
+ EndInnerWhitespace = node.EndWhitespace;
+ EndInnerWhitespace = MSBuildWhitespace.AppendSpace (EndInnerWhitespace, elem.EndInnerWhitespace);
+ if (node is MSBuildXmlTextNode) {
+ textValue = node.Value;
+ return node.Value.Trim ();
+ } else if (node is MSBuildXmlCDataNode) {
+ rawValue = "<![CDATA[" + node.Value + "]]>";
+ return node.Value;
+ }
+ }
+ }
+
+ if (elem.ChildNodes.Any (n => n is MSBuildXmlElement))
+ return elem.GetInnerXml ();
+ else {
+ rawValue = elem.GetInnerXml ();
+ return elem.GetText ();
+ }
+ }
+
+ void WriteValue (XmlWriter writer, WriteContext context, string value)
+ {
+ if (value == null)
+ value = string.Empty;
+
+ // This code is from Microsoft.Build.Internal.Utilities
+
+ if (value.IndexOf('<') != -1) {
+ // If the value looks like it probably contains XML markup ...
+ try {
+ var sr = new StringReader ("<a>"+ value + "</a>");
+ var elem = new MSBuildXmlElement ();
+ using (var xr = new XmlTextReader (sr)) {
+ xr.MoveToContent ();
+ var cr = new MSBuildXmlReader { XmlReader = xr };
+ elem.Read (cr);
+ }
+ elem.ParentNode = this;
+ elem.SetNamespace (MSBuildProject.Schema);
+
+ elem.StartWhitespace = StartWhitespace;
+ elem.EndWhitespace = EndWhitespace;
+ elem.ResetChildrenIndent ();
+ elem.WriteContent (writer, context);
+ return;
+ }
+ catch (XmlException) {
+ // But that may fail, in the event that "value" is not really well-formed
+ // XML. Eat the exception and fall through below ...
+ }
+ }
+
+ // The value does not contain valid XML markup. Write it as text, so it gets
+ // escaped properly.
+ writer.WriteValue (value);
+ }
+
+ internal virtual MSBuildProperty Clone (XmlDocument newOwner = null)
+ {
+ var prop = (MSBuildProperty)MemberwiseClone ();
+ prop.ParentNode = null;
+ return prop;
+ }
+
+ internal override string GetName ()
+ {
+ return name;
+ }
+
+ internal MSBuildPropertyGroup Owner { get; set; }
+
+ public bool IsImported {
+ get { return (flags & LinkedPropertyFlags.Imported) != 0; }
+ set {
+ if (value)
+ flags |= LinkedPropertyFlags.Imported;
+ else
+ flags &= ~LinkedPropertyFlags.Imported;
+ }
+ }
+
+ public bool MergeToMainGroup {
+ get { return (flags & LinkedPropertyFlags.MergeToMainGroup) != 0; }
+ set {
+ if (value)
+ flags |= LinkedPropertyFlags.MergeToMainGroup;
+ else
+ flags &= ~LinkedPropertyFlags.MergeToMainGroup;
+ }
+ }
+
+ internal bool Overwritten {
+ get { return (flags & LinkedPropertyFlags.Overwritten) != 0; }
+ set {
+ if (value)
+ flags |= LinkedPropertyFlags.Overwritten;
+ else
+ flags &= ~LinkedPropertyFlags.Overwritten;
+ }
+ }
+
+ internal bool HasDefaultValue {
+ get { return (flags & LinkedPropertyFlags.HasDefaultValue) != 0; }
+ set {
+ if (value)
+ flags |= LinkedPropertyFlags.HasDefaultValue;
+ else
+ flags &= ~LinkedPropertyFlags.HasDefaultValue;
+ }
+ }
+
+ internal bool Modified {
+ get { return (flags & LinkedPropertyFlags.Modified) != 0; }
+ set {
+ if (value)
+ flags |= LinkedPropertyFlags.Modified;
+ else
+ flags &= ~LinkedPropertyFlags.Modified;
+ }
+ }
+
+ internal bool EvaluatedValueModified {
+ get { return (flags & LinkedPropertyFlags.EvaluatedValueModified) != 0; }
+ set {
+ if (value)
+ flags |= LinkedPropertyFlags.EvaluatedValueModified;
+ else
+ flags &= ~LinkedPropertyFlags.EvaluatedValueModified;
+ }
+ }
+
+ internal bool IsNew {
+ get { return (flags & LinkedPropertyFlags.IsNew) != 0; }
+ set {
+ if (value)
+ flags |= LinkedPropertyFlags.IsNew;
+ else
+ flags &= ~LinkedPropertyFlags.IsNew;
+ }
+ }
+
+ internal bool NotifyChanges { get; set; }
+
+ internal MSBuildValueType ValueType {
+ get { return valueType; }
+ }
+
+ internal MergedProperty CreateMergedProperty ()
+ {
+ return new MergedProperty (Name, valueType, HasDefaultValue);
+ }
+
+ public void SetValue (string value, bool preserveCase = false, bool mergeToMainGroup = false, MSBuildValueType valueType = null)
+ {
+ AssertCanModify ();
+
+ // If no value type is specified, use the default
+ if (valueType == null)
+ valueType = preserveCase ? MSBuildValueType.DefaultPreserveCase : MSBuildValueType.Default;
+
+ MergeToMainGroup = mergeToMainGroup;
+ this.valueType = valueType;
+
+ if (value == null)
+ value = String.Empty;
+
+ SetPropertyValue (value);
+ }
+
+ public void SetValue (FilePath value, bool relativeToProject = true, FilePath relativeToPath = default(FilePath), bool mergeToMainGroup = false)
+ {
+ AssertCanModify ();
+ MergeToMainGroup = mergeToMainGroup;
+ valueType = MSBuildValueType.Path;
+
+ string baseDir = null;
+ if (relativeToPath != null) {
+ baseDir = relativeToPath;
+ } else if (relativeToProject) {
+ if (ParentProject == null) {
+ // The project has not been set, so we can't calculate the relative path.
+ // Store the full path for now, and set the property type to UnresolvedPath.
+ // When the property gets a value, the relative path will be calculated
+ valueType = MSBuildValueType.UnresolvedPath;
+ SetPropertyValue (value.ToString ());
+ return;
+ }
+ baseDir = ParentProject.BaseDirectory;
+ }
+
+ // If the path is normalized in the property, keep the value
+ if (!string.IsNullOrEmpty (Value) && new FilePath (MSBuildProjectService.FromMSBuildPath (baseDir, Value)).CanonicalPath == value.CanonicalPath)
+ return;
+
+ SetPropertyValue (MSBuildProjectService.ToMSBuildPath (baseDir, value, false));
+ }
+
+ internal void ResolvePath ()
+ {
+ if (valueType == MSBuildValueType.UnresolvedPath) {
+ var val = Value;
+ SetPropertyValue (MSBuildProjectService.ToMSBuildPath (ParentProject.BaseDirectory, val, false));
+ }
+ }
+
+ public void SetValue (object value, bool mergeToMainGroup = false)
+ {
+ AssertCanModify ();
+ if (value is bool) {
+ if (Owner != null && Owner.UppercaseBools)
+ SetValue ((bool)value ? "True" : "False", preserveCase: true, mergeToMainGroup: mergeToMainGroup);
+ else
+ SetValue ((bool)value ? "true" : "false", preserveCase: true, mergeToMainGroup: mergeToMainGroup);
+ valueType = MSBuildValueType.Boolean;
+ }
+ else
+ SetValue (Convert.ToString (value, CultureInfo.InvariantCulture), false, mergeToMainGroup);
+ }
+
+ internal void InitEvaluatedValue (string value)
+ {
+ this.value = value;
+ }
+
+ internal virtual void SetPropertyValue (string value)
+ {
+ if (this.value == null || !valueType.Equals (this.value, value)) {
+ // If the property has an initial evaluated value, then set the EvaluatedValueModified flag
+ if (!Modified && this.value != null)
+ EvaluatedValueModified = true;
+
+ Modified = true;
+ this.value = value;
+ this.unevaluatedValue = value;
+ this.rawValue = null;
+ this.textValue = null;
+ StartInnerWhitespace = null;
+ EndInnerWhitespace = null;
+ if (ParentProject != null && NotifyChanges)
+ ParentProject.NotifyChanged ();
+ }
+ }
+
+ internal override string GetPropertyValue ()
+ {
+ return value;
+ }
+
+ public override string UnevaluatedValue {
+ get {
+ return unevaluatedValue;
+ }
+ }
+
+ // This code is from Microsoft.Build.Internal.Utilities
+
+ /// <summary>
+ /// Figure out whether there are any XML tags, other than comment tags,
+ /// in the string.
+ /// </summary>
+ /// <remarks>
+ /// We know the string coming in is a valid XML fragment. (The project loaded after all.)
+ /// So for example we can ignore an open comment tag without a matching closing comment tag.
+ /// </remarks>
+ static bool ContainsNoTagsOtherThanComments (string innerXml, int firstLessThan)
+ {
+ bool insideComment = false;
+ for (int i = firstLessThan; i < innerXml.Length; i++)
+ {
+ if (!insideComment)
+ {
+ // XML comments start with exactly "<!--"
+ if (i < innerXml.Length - 3
+ && innerXml[i] == '<'
+ && innerXml[i + 1] == '!'
+ && innerXml[i + 2] == '-'
+ && innerXml[i + 3] == '-')
+ {
+ // Found the start of a comment
+ insideComment = true;
+ i = i + 3;
+ continue;
+ }
+ }
+
+ if (!insideComment)
+ {
+ if (innerXml[i] == '<')
+ {
+ // Found a tag!
+ return false;
+ }
+ }
+
+ if (insideComment)
+ {
+ // XML comments end with exactly "-->"
+ if (i < innerXml.Length - 2
+ && innerXml[i] == '-'
+ && innerXml[i + 1] == '-'
+ && innerXml[i + 2] == '>')
+ {
+ // Found the end of a comment
+ insideComment = false;
+ i = i + 2;
+ continue;
+ }
+ }
+ }
+
+ // Didn't find any tags, except possibly comments
+ return true;
+ }
+ }
+
+ class ItemMetadataProperty: MSBuildProperty
+ {
+ string value;
+ string unevaluatedValue;
+ string name;
+
+ public ItemMetadataProperty (string name)
+ {
+ NotifyChanges = false;
+ this.name = name;
+ }
+
+ public ItemMetadataProperty (string name, string value, string unevaluatedValue)
+ {
+ NotifyChanges = false;
+ this.name = name;
+ this.value = value;
+ this.unevaluatedValue = unevaluatedValue;
+ }
+
+ internal override string GetName ()
+ {
+ return name;
+ }
+
+ internal override void SetPropertyValue (string value)
+ {
+ if (!ValueType.Equals (value, this.value))
+ this.value = unevaluatedValue = value;
+ }
+
+ internal override string GetPropertyValue ()
+ {
+ return value;
+ }
+
+ public override string UnevaluatedValue {
+ get {
+ return unevaluatedValue;
+ }
+ }
+ }
+
+ class MergedProperty
+ {
+ public readonly string Name;
+ public readonly bool IsDefault;
+ public readonly MSBuildValueType ValueType;
+
+ public MergedProperty (string name, MSBuildValueType valueType, bool isDefault)
+ {
+ this.Name = name;
+ IsDefault = isDefault;
+ ValueType = valueType;
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyCore.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyCore.cs
new file mode 100644
index 0000000000..a4ebb44cdb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyCore.cs
@@ -0,0 +1,119 @@
+//
+// MSBuildPropertyCore.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Xml;
+using Microsoft.Build.BuildEngine;
+using System.Xml.Linq;
+using MonoDevelop.Core;
+using System.Globalization;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+
+ public abstract class MSBuildPropertyCore: MSBuildElement
+ {
+ internal override string GetElementName ()
+ {
+ return GetName ();
+ }
+
+ public string Name {
+ get { return GetName (); }
+ }
+
+ public string Value {
+ get { return GetPropertyValue (); }
+ }
+
+ public T GetValue<T> ()
+ {
+ return (T)GetValue (typeof(T));
+ }
+
+ public object GetValue (Type t)
+ {
+ var val = GetPropertyValue ();
+ if (t == typeof(bool))
+ return (object) val.Equals ("true", StringComparison.InvariantCultureIgnoreCase);
+ if (t.IsEnum)
+ return Enum.Parse (t, val, true);
+ if (t.IsGenericType && t.GetGenericTypeDefinition () == typeof(Nullable<>)) {
+ var at = t.GetGenericArguments () [0];
+ if (string.IsNullOrEmpty (Value))
+ return null;
+ return Convert.ChangeType (Value, at, CultureInfo.InvariantCulture);
+ }
+ return Convert.ChangeType (Value, t, CultureInfo.InvariantCulture);
+ }
+
+ public FilePath GetPathValue (bool relativeToProject = true, FilePath relativeToPath = default(FilePath))
+ {
+ FilePath path;
+ TryGetPathValue (out path, relativeToProject, relativeToPath);
+ return path;
+ }
+
+ public bool TryGetPathValue (out FilePath value, bool relativeToProject = true, FilePath relativeToPath = default(FilePath))
+ {
+ var val = GetPropertyValue ();
+ string baseDir = null;
+
+ if (relativeToPath != null) {
+ baseDir = relativeToPath;
+ } else if (relativeToProject) {
+ if (ParentProject == null) {
+ // The path can't yet be resolved, return the raw value
+ value = val;
+ return true;
+ }
+
+ baseDir = ParentProject.BaseDirectory;
+ }
+ string path;
+ var res = MSBuildProjectService.FromMSBuildPath (baseDir, val, out path);
+
+ // Remove the trailing slash
+ if (path.Length > 0 && path[path.Length - 1] == System.IO.Path.DirectorySeparatorChar && path != "." + System.IO.Path.DirectorySeparatorChar)
+ path = path.TrimEnd (System.IO.Path.DirectorySeparatorChar);
+
+ value = path;
+ return res;
+ }
+
+ public abstract string UnevaluatedValue { get; }
+
+ internal abstract string GetPropertyValue ();
+
+ internal abstract string GetName ();
+
+ public override string ToString ()
+ {
+ return "[" + Name + " = " + Value + "]";
+ }
+ }
+
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyEvaluated.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyEvaluated.cs
new file mode 100644
index 0000000000..1c9990f496
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyEvaluated.cs
@@ -0,0 +1,131 @@
+//
+// MSBuildPropertyEvaluated.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Xml;
+using Microsoft.Build.BuildEngine;
+using System.Xml.Linq;
+using MonoDevelop.Core;
+using System.Globalization;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+
+ class MSBuildPropertyEvaluated: MSBuildPropertyCore, IMSBuildPropertyEvaluated, IMetadataProperty
+ {
+ string value;
+ string evaluatedValue;
+ string name;
+ MSBuildProperty linkedProperty;
+ LinkedPropertyFlags flags;
+
+ internal MSBuildPropertyEvaluated (MSBuildProject project, string name, string value, string evaluatedValue)
+ {
+ ParentProject = project;
+ this.evaluatedValue = evaluatedValue;
+ this.value = value;
+ this.name = name;
+ }
+
+ internal override string GetName ()
+ {
+ return name;
+ }
+
+ public bool IsImported { get; set; }
+
+ public override string UnevaluatedValue {
+ get {
+ if (linkedProperty != null)
+ return linkedProperty.UnevaluatedValue;
+ return value;
+ }
+ }
+
+ internal bool IsNew {
+ get { return (flags & LinkedPropertyFlags.IsNew) != 0; }
+ set {
+ if (value)
+ flags |= LinkedPropertyFlags.IsNew;
+ else
+ flags &= ~LinkedPropertyFlags.IsNew;
+ }
+ }
+
+ public MSBuildProperty LinkedProperty {
+ get {
+ return linkedProperty;
+ }
+ }
+
+ internal override string GetPropertyValue ()
+ {
+ if (linkedProperty != null)
+ return linkedProperty.Value;
+ return evaluatedValue;
+ }
+
+ public void LinkToProperty (MSBuildProperty property)
+ {
+ linkedProperty = property;
+ if (linkedProperty != null && !linkedProperty.Modified && !IsNew)
+ linkedProperty.InitEvaluatedValue (evaluatedValue);
+ }
+
+ void IMetadataProperty.SetValue (string value, bool preserveCase, bool mergeToMainGroup, MSBuildValueType valueType)
+ {
+ if (linkedProperty == null)
+ throw new InvalidOperationException ("Evaluated property can't be modified");
+ linkedProperty.SetValue (value, preserveCase, mergeToMainGroup, valueType);
+ }
+
+ void IMetadataProperty.SetValue (FilePath value, bool relativeToProject, FilePath relativeToPath, bool mergeToMainGroup)
+ {
+ if (linkedProperty == null)
+ throw new InvalidOperationException ("Evaluated property can't be modified");
+ linkedProperty.SetValue (value, relativeToProject, relativeToPath, mergeToMainGroup);
+ }
+
+ void IMetadataProperty.SetValue (object value, bool mergeToMainGroup)
+ {
+ if (linkedProperty == null)
+ throw new InvalidOperationException ("Evaluated property can't be modified");
+ linkedProperty.SetValue (value, mergeToMainGroup);
+ }
+ }
+
+ [Flags]
+ public enum LinkedPropertyFlags: byte
+ {
+ Modified = 1,
+ IsNew = 2,
+ HasDefaultValue = 4,
+ Overwritten = 8,
+ MergeToMainGroup = 16,
+ Imported = 32,
+ EvaluatedValueModified = 64
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyGroup.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyGroup.cs
new file mode 100644
index 0000000000..8a9be4f60d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyGroup.cs
@@ -0,0 +1,451 @@
+//
+// MSBuildPropertyGroup.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using System.Xml;
+
+using MonoDevelop.Core;
+using System.Xml.Linq;
+using Microsoft.Build.BuildEngine;
+using System.Collections.Immutable;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public class MSBuildPropertyGroup: MSBuildElement, IMSBuildPropertySet, IMSBuildEvaluatedPropertyCollection
+ {
+ Dictionary<string,MSBuildProperty> properties = new Dictionary<string, MSBuildProperty> ();
+
+ public MSBuildPropertyGroup ()
+ {
+ }
+
+ internal override ImmutableList<MSBuildNode> ChildNodes {
+ get {
+ if (ParentNode is MSBuildItem)
+ return ((MSBuildItem)ParentNode).ChildNodes;
+ return base.ChildNodes;
+ }
+ set {
+ if (ParentNode is MSBuildItem)
+ ((MSBuildItem)ParentNode).ChildNodes = value;
+ base.ChildNodes = value;
+ }
+ }
+
+ internal MSBuildObject PropertiesParent {
+ get {
+ return (MSBuildObject) (ParentNode as MSBuildItem) ?? this;
+ }
+ }
+
+ internal override void ReadChildElement (MSBuildXmlReader reader)
+ {
+ MSBuildProperty prevSameName;
+ if (properties.TryGetValue (reader.LocalName, out prevSameName))
+ prevSameName.Overwritten = true;
+
+ var prop = new MSBuildProperty ();
+ prop.ParentNode = PropertiesParent;
+ prop.Owner = this;
+ prop.Read (reader);
+ ChildNodes = ChildNodes.Add (prop);
+ properties [prop.Name] = prop; // If a property is defined more than once, we only care about the last registered value
+ }
+
+ internal override string GetElementName ()
+ {
+ return "PropertyGroup";
+ }
+
+ internal override void OnProjectSet ()
+ {
+ base.OnProjectSet ();
+ foreach (var p in ChildNodes.OfType<MSBuildProperty> ())
+ p.ResolvePath ();
+ }
+
+ internal void CopyFrom (MSBuildPropertyGroup other)
+ {
+ AssertCanModify ();
+ foreach (var node in other.ChildNodes) {
+ var prop = node as MSBuildProperty;
+ if (prop != null) {
+ var cp = prop.Clone ();
+ var currentPropIndex = ChildNodes.FindIndex (p => (p is MSBuildProperty) && ((MSBuildProperty)p).Name == prop.Name);
+ if (currentPropIndex != -1) {
+ var currentProp = (MSBuildProperty) ChildNodes [currentPropIndex];
+ ChildNodes = ChildNodes.SetItem (currentPropIndex, cp);
+ } else {
+ ChildNodes = ChildNodes.Add (cp);
+ }
+ properties [cp.Name] = cp;
+ cp.ParentNode = PropertiesParent;
+ cp.Owner = this;
+ } else
+ ChildNodes = ChildNodes.Add (node);
+ }
+ foreach (var prop in ChildNodes.OfType<MSBuildProperty> ().ToArray ()) {
+ if (!other.HasProperty (prop.Name))
+ RemoveProperty (prop);
+ }
+
+ NotifyChanged ();
+ }
+
+ public bool IsImported {
+ get;
+ set;
+ }
+
+ internal bool IgnoreDefaultValues { get; set; }
+
+ internal bool UppercaseBools { get; set; }
+
+ IMetadataProperty IPropertySet.GetProperty (string name)
+ {
+ return GetProperty (name);
+ }
+
+ IEnumerable<IMetadataProperty> IPropertySet.GetProperties ()
+ {
+ return GetProperties ().Cast<IMetadataProperty> ();
+ }
+
+ IMSBuildPropertyEvaluated IMSBuildPropertyGroupEvaluated.GetProperty (string name)
+ {
+ return GetProperty (name);
+ }
+
+ IEnumerable<IMSBuildPropertyEvaluated> IMSBuildEvaluatedPropertyCollection.Properties {
+ get { return GetProperties (); }
+ }
+
+ public MSBuildProperty GetProperty (string name)
+ {
+ return GetProperty (name, null);
+ }
+
+ public MSBuildProperty GetProperty (string name, string condition)
+ {
+ MSBuildProperty prop;
+ properties.TryGetValue (name, out prop);
+ return prop;
+ }
+
+ public IEnumerable<MSBuildProperty> GetProperties ()
+ {
+ return ChildNodes.OfType<MSBuildProperty> ();
+ }
+
+ public string GetValue (string name, string defaultValue = null)
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.Value;
+ else
+ return defaultValue;
+ }
+
+ public FilePath GetPathValue (string name, FilePath defaultValue = default(FilePath), bool relativeToProject = true, FilePath relativeToPath = default(FilePath))
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.GetPathValue (relativeToProject, relativeToPath);
+ else
+ return defaultValue;
+ }
+
+ public bool TryGetPathValue (string name, out FilePath value, FilePath defaultValue = default(FilePath), bool relativeToProject = true, FilePath relativeToPath = default(FilePath))
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.TryGetPathValue (out value, relativeToProject, relativeToPath);
+ else {
+ value = defaultValue;
+ return value != default(FilePath);
+ }
+ }
+
+ public T GetValue<T> (string name)
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.GetValue<T> ();
+ else
+ return default(T);
+ }
+
+ public T GetValue<T> (string name, T defaultValue)
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.GetValue<T> ();
+ else
+ return defaultValue;
+ }
+
+ public object GetValue (string name, Type type, object defaultValue)
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.GetValue (type);
+ else
+ return defaultValue;
+ }
+
+ MSBuildProperty AddProperty (string name, string condition = null)
+ {
+ AssertCanModify ();
+ int i = propertyOrder.IndexOf (name);
+ int insertIndex = -1;
+ if (i != -1) {
+ var foundProp = FindExistingProperty (i - 1, -1);
+ if (foundProp != null) {
+ insertIndex = ChildNodes.IndexOf (foundProp) + 1;
+ } else {
+ foundProp = FindExistingProperty (i + 1, 1);
+ if (foundProp != null)
+ insertIndex = ChildNodes.IndexOf (foundProp);
+ }
+ }
+
+ var prop = new MSBuildProperty (name);
+ prop.IsNew = true;
+ prop.ParentNode = PropertiesParent;
+ prop.Owner = this;
+ properties [name] = prop;
+
+ if (insertIndex != -1)
+ ChildNodes = ChildNodes.Insert (insertIndex, prop);
+ else
+ ChildNodes = ChildNodes.Add (prop);
+
+ if (condition != null)
+ prop.Condition = condition;
+
+ prop.ResetIndent (false);
+
+ if (PropertyGroupListener != null)
+ PropertyGroupListener.PropertyAdded (prop);
+
+ NotifyChanged ();
+ return prop;
+ }
+
+ internal IPropertyGroupListener PropertyGroupListener { get; set; }
+
+ MSBuildProperty FindExistingProperty (int index, int inc)
+ {
+ while (index >= 0 && index < propertyOrder.Count) {
+ var ep = GetProperty (propertyOrder[index]);
+ if (ep != null)
+ return ep;
+ index += inc;
+ }
+ return null;
+ }
+
+ MSBuildProperty SafeGetProperty (string name, string condition)
+ {
+ var prop = GetProperty (name, condition);
+ if (prop == null) {
+ prop = GetProperty (name);
+ if (prop != null) {
+ prop.Condition = condition;
+ return prop;
+ }
+ }
+ return AddProperty (name, condition);
+ }
+
+ public void SetValue (string name, string value, string defaultValue = null, bool preserveExistingCase = false, bool mergeToMainGroup = false, string condition = null, MSBuildValueType valueType = null)
+ {
+ AssertCanModify ();
+
+ // If no value type is specified, use the default
+ if (valueType == null)
+ valueType = preserveExistingCase ? MSBuildValueType.DefaultPreserveCase : MSBuildValueType.Default;
+
+ if (value == null && defaultValue == "")
+ value = "";
+
+ var prop = GetProperty (name, condition);
+ var isDefault = value == defaultValue;
+ if (isDefault && !mergeToMainGroup) {
+ // if the value is default, only remove the property if it was not already the default
+ // to avoid unnecessary project file churn
+ if (prop != null && valueType.Equals (defaultValue ?? "", prop.Value))
+ return;
+ if (!IgnoreDefaultValues) {
+ if (prop != null)
+ RemoveProperty (prop);
+ return;
+ }
+ }
+ if (prop == null)
+ prop = AddProperty (name, condition);
+ prop.SetValue (value, preserveExistingCase, mergeToMainGroup, valueType);
+ prop.HasDefaultValue = isDefault;
+ }
+
+ public void SetValue (string name, FilePath value, FilePath defaultValue = default(FilePath), bool relativeToProject = true, FilePath relativeToPath = default(FilePath), bool mergeToMainGroup = false, string condition = null)
+ {
+ AssertCanModify ();
+ var prop = GetProperty (name, condition);
+ var isDefault = value.CanonicalPath == defaultValue.CanonicalPath;
+ if (isDefault && !mergeToMainGroup) {
+ // if the value is default, only remove the property if it was not already the default
+ // to avoid unnecessary project file churn
+ if (prop != null && defaultValue != null && defaultValue == prop.GetPathValue (relativeToProject, relativeToPath))
+ return;
+ if (!IgnoreDefaultValues) {
+ if (prop != null)
+ RemoveProperty (prop);
+ return;
+ }
+ }
+ if (prop == null)
+ prop = AddProperty (name, condition);
+ prop.SetValue (value, relativeToProject, relativeToPath, mergeToMainGroup);
+ prop.HasDefaultValue = isDefault;
+ }
+
+ public void SetValue (string name, object value, object defaultValue = null, bool mergeToMainGroup = false, string condition = null)
+ {
+ AssertCanModify ();
+ var prop = GetProperty (name, condition);
+ var isDefault = object.Equals (value, defaultValue);
+ if (isDefault && !mergeToMainGroup) {
+ // if the value is default, only remove the property if it was not already the default
+ // to avoid unnecessary project file churn
+ if (prop != null && defaultValue != null && object.Equals (defaultValue, prop.GetValue (defaultValue.GetType ())))
+ return;
+ if (!IgnoreDefaultValues) {
+ if (prop != null)
+ RemoveProperty (prop);
+ return;
+ }
+ }
+ if (prop == null)
+ prop = AddProperty (name, condition);
+ prop.SetValue (value, mergeToMainGroup);
+ prop.HasDefaultValue = isDefault;
+ }
+
+ public bool RemoveProperty (string name)
+ {
+ MSBuildProperty prop = GetProperty (name);
+ if (prop != null) {
+ RemoveProperty (prop);
+ return true;
+ }
+ return false;
+ }
+
+ public void RemoveProperty (MSBuildProperty prop)
+ {
+ AssertCanModify ();
+ if (PropertyGroupListener != null)
+ PropertyGroupListener.PropertyRemoved (prop);
+ prop.RemoveIndent ();
+ properties.Remove (prop.Name);
+ ChildNodes = ChildNodes.Remove (prop);
+ NotifyChanged ();
+ }
+
+ internal void SetLoadedValues (IMSBuildPropertyGroupEvaluated loadedProps)
+ {
+ foreach (var p in GetProperties ()) {
+ var ep = loadedProps.GetProperty (p.Name);
+ p.InitEvaluatedValue (ep.Value);
+ }
+ }
+
+ internal void ResetIsNewFlags ()
+ {
+ foreach (MSBuildProperty prop in GetProperties ()) {
+ prop.IsNew = false;
+ prop.Modified = false;
+ }
+ }
+
+ internal void PurgeDefaultProperties ()
+ {
+ // Remove properties that have been modified and have the default value. Usually such properties
+ // would be removed when assigning the value, but that won't happen if IgnoreDefaultValues=true
+ foreach (MSBuildProperty prop in GetProperties ()) {
+ if ((prop.Modified && prop.HasDefaultValue && !prop.EvaluatedValueModified) || (!prop.Modified && prop.IsNew))
+ RemoveProperty (prop.Name);
+ prop.Modified = false;
+ }
+ }
+
+ public override string ToString()
+ {
+ string s = "[MSBuildPropertyGroup:";
+ foreach (MSBuildProperty prop in GetProperties ())
+ s += " " + prop.Name + "=" + prop.Value;
+ return s + "]";
+ }
+
+ public bool HasProperty (string name)
+ {
+ return properties.ContainsKey (name);
+ }
+
+ List<string> propertyOrder = new List<string> ();
+
+ public void SetPropertyOrder (params string[] propertyNames)
+ {
+ AssertCanModify ();
+ int i = 0;
+ foreach (var name in propertyNames) {
+ if (i < propertyOrder.Count) {
+ var pos = propertyOrder.IndexOf (name, i);
+ if (pos != -1) {
+ i = pos + 1;
+ continue;
+ } else {
+ propertyOrder.Insert (i, name);
+ i++;
+ continue;
+ }
+ }
+ propertyOrder.Add (name);
+ i++;
+ }
+ }
+ }
+
+ public interface IMSBuildPropertyGroupEvaluated: IReadOnlyPropertySet
+ {
+ bool HasProperty (string name);
+
+ IMSBuildPropertyEvaluated GetProperty (string name);
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyGroupEvaluated.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyGroupEvaluated.cs
new file mode 100644
index 0000000000..d14b983605
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildPropertyGroupEvaluated.cs
@@ -0,0 +1,292 @@
+//
+// MSBuildPropertyGroupEvaluated.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Xml.Linq;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ class MSBuildPropertyGroupEvaluated: MSBuildNode, IMSBuildPropertyGroupEvaluated, IMSBuildProjectObject
+ {
+ protected Dictionary<string,IMSBuildPropertyEvaluated> properties = new Dictionary<string, IMSBuildPropertyEvaluated> ();
+ object sourceItem;
+ MSBuildEngine engine;
+
+ internal MSBuildPropertyGroupEvaluated (MSBuildProject parent)
+ {
+ ParentProject = parent;
+ }
+
+ internal void Sync (MSBuildEngine engine, object item)
+ {
+ properties.Clear ();
+ this.engine = engine;
+ sourceItem = item;
+ }
+
+ public bool HasProperty (string name)
+ {
+ if (properties.ContainsKey (name))
+ return true;
+ if (sourceItem != null)
+ return engine.GetItemHasMetadata (sourceItem, name);
+ return false;
+ }
+
+ public IMSBuildPropertyEvaluated GetProperty (string name)
+ {
+ IMSBuildPropertyEvaluated prop;
+ if (!properties.TryGetValue (name, out prop)) {
+ if (sourceItem != null) {
+ if (engine.GetItemHasMetadata (sourceItem, name)) {
+ prop = new MSBuildPropertyEvaluated (ParentProject, name, engine.GetItemMetadata (sourceItem, name), engine.GetEvaluatedItemMetadata (sourceItem, name));
+ properties [name] = prop;
+ }
+ }
+ }
+ return prop;
+ }
+
+ internal void SetProperties (Dictionary<string,IMSBuildPropertyEvaluated> properties)
+ {
+ this.properties = properties;
+ }
+
+ internal bool RemoveProperty (string name)
+ {
+ if (properties != null)
+ return properties.Remove (name);
+ return false;
+ }
+
+ public string GetValue (string name, string defaultValue = null)
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.Value;
+ else
+ return defaultValue;
+ }
+
+ public FilePath GetPathValue (string name, FilePath defaultValue = default(FilePath), bool relativeToProject = true, FilePath relativeToPath = default(FilePath))
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.GetPathValue (relativeToProject, relativeToPath);
+ else
+ return defaultValue;
+ }
+
+ public bool TryGetPathValue (string name, out FilePath value, FilePath defaultValue = default(FilePath), bool relativeToProject = true, FilePath relativeToPath = default(FilePath))
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.TryGetPathValue (out value, relativeToProject, relativeToPath);
+ else {
+ value = defaultValue;
+ return value != default(FilePath);
+ }
+ }
+
+ public T GetValue<T> (string name)
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.GetValue<T> ();
+ else
+ return default(T);
+ }
+
+ public T GetValue<T> (string name, T defaultValue)
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.GetValue<T> ();
+ else
+ return defaultValue;
+ }
+
+ public object GetValue (string name, Type type, object defaultValue)
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.GetValue (type);
+ else
+ return defaultValue;
+ }
+ }
+
+ class MSBuildEvaluatedPropertyCollection: MSBuildPropertyGroupEvaluated, IMSBuildEvaluatedPropertyCollection, IPropertySet, IPropertyGroupListener
+ {
+ public readonly static MSBuildEvaluatedPropertyCollection Empty = new MSBuildEvaluatedPropertyCollection (null);
+
+ public MSBuildPropertyGroup LinkedGroup { get; set; }
+
+ public MSBuildEvaluatedPropertyCollection (MSBuildProject parent): base (parent)
+ {
+ }
+
+ internal void SyncCollection (MSBuildEngine e, object project)
+ {
+ properties.Clear ();
+ foreach (var p in e.GetEvaluatedProperties (project)) {
+ string name, value, finalValue;
+ e.GetPropertyInfo (p, out name, out value, out finalValue);
+ properties [name] = new MSBuildPropertyEvaluated (ParentProject, name, value, finalValue);
+ }
+ }
+
+ public void LinkToGroup (MSBuildPropertyGroup group)
+ {
+ LinkedGroup = group;
+ group.PropertyGroupListener = this;
+ foreach (var p in group.GetProperties ()) {
+ var ep = (MSBuildPropertyEvaluated) GetProperty (p.Name);
+ if (ep == null)
+ ep = AddProperty (p.Name);
+ ep.LinkToProperty (p);
+ }
+ }
+
+ public void RemoveRedundantProperties ()
+ {
+ // Remove properties whose value is the same as the one set in the global group
+ // Remove properties which have the default value and which are not defined in the main group
+
+ foreach (MSBuildProperty prop in LinkedGroup.GetProperties ()) {
+ if (prop.Modified && prop.HasDefaultValue)
+ RemoveProperty (prop.Name);
+ }
+ }
+
+ IMetadataProperty IPropertySet.GetProperty (string name)
+ {
+ AssertLinkedToGroup ();
+ return (IMetadataProperty) GetProperty (name);
+ }
+
+ IEnumerable<IMetadataProperty> IPropertySet.GetProperties ()
+ {
+ AssertLinkedToGroup ();
+ foreach (IMetadataProperty p in Properties)
+ yield return p;
+ }
+
+ void IPropertySet.SetValue (string name, string value, string defaultValue, bool preserveExistingCase, bool mergeToMainGroup, string condition, MSBuildValueType valueType)
+ {
+ AssertLinkedToGroup ();
+ LinkedGroup.SetValue (name, value, defaultValue, preserveExistingCase, mergeToMainGroup, condition, valueType);
+ }
+
+ void IPropertySet.SetValue (string name, FilePath value, FilePath defaultValue, bool relativeToProject, FilePath relativeToPath, bool mergeToMainGroup, string condition)
+ {
+ AssertLinkedToGroup ();
+ LinkedGroup.SetValue (name, value, defaultValue, relativeToProject, relativeToPath, mergeToMainGroup, condition);
+ }
+
+ void IPropertySet.SetValue (string name, object value, object defaultValue, bool mergeToMainGroup, string condition)
+ {
+ AssertLinkedToGroup ();
+ LinkedGroup.SetValue (name, value, defaultValue, mergeToMainGroup, condition);
+ }
+
+ void IPropertySet.SetPropertyOrder (params string [] propertyNames)
+ {
+ // When used as IPropertySet, this collection must be linked to a property group
+ AssertLinkedToGroup ();
+ LinkedGroup.SetPropertyOrder (propertyNames);
+ }
+
+ bool IPropertySet.RemoveProperty (string name)
+ {
+ AssertLinkedToGroup ();
+ return LinkedGroup.RemoveProperty (name);
+ }
+
+ MSBuildPropertyEvaluated AddProperty (string name)
+ {
+ var p = new MSBuildPropertyEvaluated (ParentProject, name, null, null);
+ p.IsNew = true;
+ properties [name] = p;
+ return p;
+ }
+
+ void AssertLinkedToGroup ()
+ {
+ if (LinkedGroup == null)
+ throw new InvalidOperationException ("MSBuildEvaluatedPropertyCollection not linked to a property group");
+ }
+
+ void IPropertyGroupListener.PropertyAdded (MSBuildProperty prop)
+ {
+ var p = (MSBuildPropertyEvaluated) GetProperty (prop.Name);
+ if (p == null || p.LinkedProperty == null) {
+ if (p == null)
+ p = AddProperty (prop.Name);
+ p.LinkToProperty (prop);
+ }
+ }
+
+ void IPropertyGroupListener.PropertyRemoved (MSBuildProperty prop)
+ {
+ var ep = (MSBuildPropertyEvaluated) GetProperty (prop.Name);
+ if (ep == null)
+ return;
+
+ if (ep.LinkedProperty != null) {
+ // Unlink the property
+ ep.LinkToProperty (null);
+
+ // The corresponding evaluated property instance will be removed id
+ // 1) It didn't exist when the project was loaded
+ // 2) The property did exist in the property group when the project was loaded,
+ // which means that the evaluated property is actually the result of evaluating
+ // that property group property.
+ if (ep.IsNew || !prop.IsNew) {
+ ep.IsNew = false;
+ properties.Remove (ep.Name);
+ }
+ }
+ }
+
+ public IEnumerable<IMSBuildPropertyEvaluated> Properties {
+ get { return properties.Values; }
+ }
+ }
+
+ public interface IMSBuildEvaluatedPropertyCollection: IMSBuildPropertyGroupEvaluated
+ {
+ IEnumerable<IMSBuildPropertyEvaluated> Properties { get; }
+ }
+
+ interface IPropertyGroupListener
+ {
+ void PropertyAdded (MSBuildProperty prop);
+ void PropertyRemoved (MSBuildProperty prop);
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildTarget.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildTarget.cs
new file mode 100644
index 0000000000..debf9f3045
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildTarget.cs
@@ -0,0 +1,250 @@
+//
+// MSBuildTarget.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Xml;
+using System.Text;
+
+using MonoDevelop.Core;
+using MonoDevelop.Projects.Utility;
+using System.Linq;
+using MonoDevelop.Projects.Text;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+
+ public class MSBuildTarget: MSBuildElement, IMSBuildTargetEvaluated
+ {
+ string name;
+ string afterTargets;
+ string inputs;
+ string outputs;
+ string beforeTargets;
+ string dependsOnTargets;
+ string returns;
+ string keepDuplicateOutputs;
+
+ static readonly string [] knownAttributes = { "Name", "Condition", "Label", "AfterTargets", "Inputs", "Outputs", "BeforeTargets", "DependsOnTargets", "Returns", "KeepDuplicateOutputs" };
+
+ internal override string [] GetKnownAttributes ()
+ {
+ return knownAttributes;
+ }
+
+ public string AfterTargets {
+ get {
+ return this.afterTargets;
+ }
+ set {
+ AssertCanModify ();
+ this.afterTargets = value;
+ NotifyChanged ();
+ }
+ }
+
+ public string Inputs {
+ get {
+ return this.inputs;
+ }
+ set {
+ AssertCanModify ();
+ this.inputs = value;
+ NotifyChanged ();
+ }
+ }
+
+ public string Outputs {
+ get {
+ return this.outputs;
+ }
+ set {
+ AssertCanModify ();
+ this.outputs = value;
+ NotifyChanged ();
+ }
+ }
+
+ public string BeforeTargets {
+ get {
+ return this.beforeTargets;
+ }
+ set {
+ AssertCanModify ();
+ this.beforeTargets = value;
+ NotifyChanged ();
+ }
+ }
+
+ public string DependsOnTargets
+ {
+ get {
+ return this.dependsOnTargets;
+ }
+ set {
+ AssertCanModify ();
+ this.dependsOnTargets = value;
+ NotifyChanged ();
+ }
+ }
+
+ public string Returns {
+ get {
+ return this.returns;
+ }
+ set {
+ AssertCanModify ();
+ this.returns = value;
+ NotifyChanged ();
+ }
+ }
+
+ public string KeepDuplicateOutputs {
+ get {
+ return this.keepDuplicateOutputs;
+ }
+ set {
+ AssertCanModify ();
+ this.keepDuplicateOutputs = value;
+ NotifyChanged ();
+ }
+ }
+
+ internal override void ReadAttribute (string name, string value)
+ {
+ switch (name) {
+ case "Name": this.name = value; break;
+ case "AfterTargets": AfterTargets = value; break;
+ case "Inputs": Inputs = value; break;
+ case "Outputs": Outputs = value; break;
+ case "BeforeTargets": BeforeTargets = value; break;
+ case "DependsOnTargets": DependsOnTargets = value; break;
+ case "Returns": Returns = value; break;
+ case "KeepDuplicateOutputs": KeepDuplicateOutputs = value; break;
+ default: base.ReadAttribute (name, value); break;
+ }
+ }
+
+ internal override string WriteAttribute (string name)
+ {
+ switch (name) {
+ case "Name": return this.name;
+ case "AfterTargets": return AfterTargets;
+ case "Inputs": return Inputs;
+ case "Outputs": return Outputs;
+ case "BeforeTargets": return BeforeTargets;
+ case "DependsOnTargets": return DependsOnTargets;
+ case "Returns": return Returns;
+ case "KeepDuplicateOutputs": return KeepDuplicateOutputs;
+ default: return base.WriteAttribute (name);
+ }
+ }
+
+ internal override string GetElementName ()
+ {
+ return "Target";
+ }
+
+ internal override void ReadChildElement (MSBuildXmlReader reader)
+ {
+ MSBuildObject ob = null;
+ switch (reader.LocalName) {
+ case "ItemGroup": ob = new MSBuildItemGroup (); break;
+ case "PropertyGroup": ob = new MSBuildPropertyGroup (); break;
+ }
+ if (ob != null) {
+ ob.ParentNode = this;
+ ob.Read (reader);
+ ChildNodes = ChildNodes.Add (ob);
+ return;
+ }
+
+ var task = new MSBuildTask ();
+ task.ParentNode = this;
+ task.Read (reader);
+ ChildNodes = ChildNodes.Add (task);
+ }
+
+ internal override void Write (XmlWriter writer, WriteContext context)
+ {
+ base.Write (writer, context);
+ }
+
+ internal MSBuildTarget ()
+ {
+ }
+
+ public MSBuildTarget (string name, IEnumerable<MSBuildTask> tasks)
+ {
+ this.name = name;
+ ChildNodes = ChildNodes.AddRange (tasks);
+ }
+
+ public string Name {
+ get { return name; }
+ }
+
+ public bool IsImported { get; internal set; }
+
+ public IEnumerable<MSBuildTask> Tasks {
+ get { return ChildNodes.OfType<MSBuildTask> (); }
+ }
+
+ public void RemoveTask (MSBuildTask task)
+ {
+ AssertCanModify ();
+ if (task.ParentObject != this)
+ throw new InvalidOperationException ("Task doesn't belong to the target");
+ task.RemoveIndent ();
+ ChildNodes = ChildNodes.Remove (task);
+ }
+ }
+
+ public interface IMSBuildTargetEvaluated
+ {
+ string AfterTargets { get; }
+
+ string Inputs { get; }
+
+ string Outputs { get; }
+
+ string BeforeTargets { get; }
+
+ string DependsOnTargets { get; }
+
+ string Returns { get; }
+
+ string KeepDuplicateOutputs { get; }
+
+ string Name { get; }
+
+ bool IsImported { get; }
+
+ IEnumerable<MSBuildTask> Tasks { get; }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildTask.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildTask.cs
new file mode 100644
index 0000000000..95716a4644
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildTask.cs
@@ -0,0 +1,79 @@
+//
+// MSBuildTask.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Xml;
+using System.Text;
+
+using MonoDevelop.Core;
+using MonoDevelop.Projects.Utility;
+using System.Linq;
+using MonoDevelop.Projects.Text;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+
+ public class MSBuildTask: MSBuildElement
+ {
+ public MSBuildTask ()
+ {
+ }
+
+ public MSBuildTask (string name)
+ {
+ this.Name = name;
+ }
+
+ static readonly string [] knownAttributes = { "Condition", "Label" };
+
+ internal override string [] GetKnownAttributes ()
+ {
+ return knownAttributes;
+ }
+
+ internal override void Read (MSBuildXmlReader reader)
+ {
+ Name = reader.LocalName;
+ base.Read (reader);
+ }
+
+ internal override void Write (XmlWriter writer, WriteContext context)
+ {
+ base.Write (writer, context);
+ }
+
+ internal override string GetElementName ()
+ {
+ return Name;
+ }
+
+ public string Name { get; private set; }
+ }
+
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildValueType.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildValueType.cs
new file mode 100644
index 0000000000..9a17c659e3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildValueType.cs
@@ -0,0 +1,75 @@
+//
+// MSBuildValueType.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public class MSBuildValueType
+ {
+ public static readonly MSBuildValueType Default = new MSBuildValueType ();
+ public static readonly MSBuildValueType DefaultPreserveCase = new PreserveCaseValueType ();
+ public static readonly MSBuildValueType Path = new PathValueType ();
+ public static readonly MSBuildValueType Boolean = new PreserveCaseValueType ();
+ public static readonly MSBuildValueType Guid = new GuidValueType ();
+ internal static readonly MSBuildValueType UnresolvedPath = new PathValueType ();
+
+ public virtual bool Equals (string ob1, string ob2)
+ {
+ return object.Equals (ob1, ob2);
+ }
+ }
+
+ class PathValueType: MSBuildValueType
+ {
+ public override bool Equals (string ob1, string ob2)
+ {
+ if (base.Equals (ob1, ob2))
+ return true;
+ if (ob1 == null || ob2 == null)
+ return string.IsNullOrEmpty (ob1) && string.IsNullOrEmpty (ob2);//Empty or null path is same thing
+ return ob1.TrimEnd ('\\') == ob2.TrimEnd ('\\');
+ }
+ }
+
+ class PreserveCaseValueType: MSBuildValueType
+ {
+ public override bool Equals (string ob1, string ob2)
+ {
+ return ob1.Equals (ob2, StringComparison.OrdinalIgnoreCase);
+ }
+ }
+
+ class GuidValueType: MSBuildValueType
+ {
+ public override bool Equals (string ob1, string ob2)
+ {
+ ob1 = ob1.Trim ('{', '}');
+ ob2 = ob2.Trim ('{', '}');
+ return ob1.Equals (ob2, StringComparison.OrdinalIgnoreCase);
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildWhitespace.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildWhitespace.cs
new file mode 100644
index 0000000000..c7115cb3d3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildWhitespace.cs
@@ -0,0 +1,308 @@
+//
+// MSBuildWhitespace.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Xml;
+using System.Text;
+
+using MonoDevelop.Core;
+using MonoDevelop.Projects.Utility;
+using System.Linq;
+using MonoDevelop.Projects.Text;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ class MSBuildWhitespace
+ {
+ bool isComment;
+ MSBuildWhitespace next;
+ object content;
+
+ MSBuildWhitespace GetLast ()
+ {
+ var mws = this;
+ while (mws.next != null)
+ mws = mws.next;
+ return mws;
+ }
+
+ void GenerateStrings ()
+ {
+ var mws = this;
+ while (mws != null) {
+ if (mws.content is StringBuilder)
+ mws.content = mws.content.ToString ();
+ mws = mws.next;
+ }
+ }
+
+ public static object GenerateStrings (object ws)
+ {
+ if (ws == null)
+ return null;
+ if (ws is string)
+ return ws;
+ if (ws is StringBuilder)
+ return ((StringBuilder)ws).ToString ();
+ var mw = (MSBuildWhitespace)ws;
+ mw.GenerateStrings ();
+ return mw;
+ }
+
+ public static bool IsWhitespace (XmlReader reader)
+ {
+ return reader.NodeType == XmlNodeType.Whitespace || reader.NodeType == XmlNodeType.SignificantWhitespace || reader.NodeType == XmlNodeType.Comment;
+ }
+
+ public static object Append (object ws, XmlReader reader)
+ {
+ if (reader.NodeType == XmlNodeType.Comment) {
+ var newWs = new MSBuildWhitespace {
+ isComment = true,
+ content = reader.Value
+ };
+ if (ws == null)
+ return newWs;
+ else if (ws is string || ws is StringBuilder) {
+ return new MSBuildWhitespace {
+ content = ws.ToString (),
+ next = newWs
+ };
+ } else {
+ var last = ((MSBuildWhitespace)ws).GetLast ();
+ last.next = newWs;
+ return ws;
+ }
+ } else if (ws is MSBuildWhitespace) {
+ var last = ((MSBuildWhitespace)ws).GetLast ();
+ if (last.isComment) {
+ last.next = new MSBuildWhitespace {
+ content = reader.Value
+ };
+ } else if (last.content is StringBuilder)
+ ((StringBuilder)last.content).Append (reader.Value);
+ else {
+ var val = reader.Value;
+ var sb = new StringBuilder ((string)last.content, ((string)last.content).Length + val.Length);
+ sb.Append (val);
+ last.content = sb;
+ }
+ return ws;
+ } else {
+ if (ws == null)
+ return reader.Value;
+ if (ws is StringBuilder) {
+ ((StringBuilder)ws).Append (reader.Value);
+ return ws;
+ }
+ else {
+ var val = reader.Value;
+ var sb = new StringBuilder ((string)ws, ((string)ws).Length + val.Length);
+ sb.Append (val);
+ return sb;
+ }
+ }
+ }
+
+ public static object AppendSpace (object ws1, object ws2)
+ {
+ if (ws1 == null)
+ return ws2;
+ if (ws2 == null)
+ return ws1;
+
+ var ob2 = ws2 as MSBuildWhitespace;
+ if (ob2 != null && ob2.isComment) {
+ if (ws1 is string || ws1 is StringBuilder) {
+ return new MSBuildWhitespace {
+ content = ws1.ToString (),
+ next = ob2
+ };
+ } else {
+ var last = ((MSBuildWhitespace)ws1).GetLast ();
+ last.next = ob2;
+ return ws1;
+ }
+ } else if (ws1 is MSBuildWhitespace) {
+ var last = ((MSBuildWhitespace)ws1).GetLast ();
+ if (last.isComment) {
+ var next = ob2 != null ? ob2 : new MSBuildWhitespace {
+ content = ws2 // is a string or stringbuilder
+ };
+ last.next = new MSBuildWhitespace {
+ content = next
+ };
+ } else if (last.content is StringBuilder) {
+ var val = ob2 != null ? ob2.content.ToString () : ws2.ToString ();
+ ((StringBuilder)last.content).Append (val);
+ } else {
+ var val = ob2 != null ? ob2.content.ToString () : ws2.ToString ();
+ var sb = new StringBuilder ((string)last.content, ((string)last.content).Length + val.Length);
+ sb.Append (val);
+ last.content = sb;
+ }
+ return ws1;
+ } else {
+ var val = ob2 != null ? ob2.content.ToString () : ws2.ToString ();
+ if (ws1 is StringBuilder) {
+ ((StringBuilder)ws1).Append (val);
+ return ws1;
+ }
+ else {
+ var sb = new StringBuilder ((string)ws1, ((string)ws1).Length + val.Length);
+ sb.Append (val);
+ return sb;
+ }
+ }
+ }
+
+ public static void Write (object ws, XmlWriter writer)
+ {
+ if (ws == null)
+ return;
+
+ if (ws is string || ws is StringBuilder) {
+ writer.WriteWhitespace (ws.ToString ());
+ return;
+ }
+
+ var mws = (MSBuildWhitespace)ws;
+
+ while (mws != null) {
+ if (mws.isComment)
+ writer.WriteComment ((string)mws.content);
+ else
+ writer.WriteWhitespace (mws.content.ToString ());
+ mws = mws.next;
+ }
+ }
+
+ public static object ConsumeUntilNewLine (ref object ws)
+ {
+ if (ws == null)
+ return null;
+
+ var s = ws as string;
+ if (s != null) {
+ for (int n = s.Length - 1; n >= 0; n--) {
+ var c = s [n];
+ if (c == '\r' || c == '\n') {
+ if (n == s.Length - 1)
+ break; // Default case, consume the whole string
+ var res = s.Substring (0, n + 1);
+ ws = s.Substring (n + 1);
+ return res;
+ }
+ }
+ var result = ws;
+ ws = null;
+ return result;
+ }
+ var sb = ws as StringBuilder;
+ if (sb != null) {
+ for (int n = sb.Length - 1; n >= 0; n--) {
+ var c = sb [n];
+ if (c == '\r' || c == '\n') {
+ if (n == sb.Length - 1)
+ break; // Default case, consume the whole string
+ var res = sb.ToString (0, n + 1);
+ sb.Remove (0, n + 1);
+ return res;
+ }
+ }
+ var result = ws.ToString ();
+ ws = null;
+ return result;
+ }
+
+ // It's a MSBuildWhitespace
+
+ var mw = (MSBuildWhitespace)ws;
+ mw.GenerateStrings ();
+
+ var toSplit = mw.FindLastWithNewLine ();
+ if (toSplit == null) {
+ var result = ws;
+ ws = null;
+ return result;
+ } else {
+ var remaining = toSplit.content;
+ var result = ConsumeUntilNewLine (ref remaining);
+
+ // Set the remaining value
+
+ if (toSplit.next == null) {
+ // New line found in last node. The remaining is just the split string
+ ws = remaining;
+ } else {
+ if (remaining == null)
+ return toSplit.next; // Consumed the whole string of this node. The remaining is the next node
+
+ // New line found in the middle of the chain. A new node with the remaining has to be created
+ ws = new MSBuildWhitespace {
+ content = remaining,
+ next = toSplit.next
+ };
+ }
+
+ // Generate the consumed value
+
+ if (toSplit != mw) {
+ // New line found in the middle of the chain. Update the node content and split the chain.
+ toSplit.content = result;
+ toSplit.next = null;
+ return mw;
+ } else {
+ // New line found in first node. The result is just the consumed string. Nothing else to do.
+ return result;
+ }
+ }
+ }
+
+ MSBuildWhitespace FindLastWithNewLine ()
+ {
+ if (next != null) {
+ var r = next.FindLastWithNewLine ();
+ if (r != null)
+ return r;
+ }
+ if (isComment)
+ return null;
+
+ var s = (string)content;
+
+ for (int n = 0; n < s.Length; n++) {
+ var c = s [n];
+ if (c == '\r' || c == '\n')
+ return this;
+ }
+ return null;
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildXmlElement.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildXmlElement.cs
new file mode 100644
index 0000000000..ce45e64c85
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildXmlElement.cs
@@ -0,0 +1,154 @@
+//
+// MSBuildXmlElement.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+using System.Xml;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+
+ class MSBuildXmlElement : MSBuildObject
+ {
+ string name;
+ string ns;
+ string prefix;
+
+ static string [] knownAtts = { "xmlns" };
+
+ public string Name {
+ get {
+ return name;
+ }
+ }
+
+ internal void SetNamespace (string ns)
+ {
+ this.ns = ns;
+ }
+
+ internal override void Read (MSBuildXmlReader reader)
+ {
+ name = reader.LocalName;
+ ns = reader.NamespaceURI;
+ prefix = reader.Prefix;
+ base.Read (reader);
+ }
+
+ internal override void ReadAttribute (string name, string value)
+ {
+ // Ignore xmlns
+ if (name != "xmlns")
+ base.ReadAttribute (name, value);
+ }
+
+ internal override string WriteAttribute (string name)
+ {
+ // Ignore xmlns since the xml writer automatically generates it
+ if (name == "xmlns")
+ return null;
+
+ return base.WriteAttribute (name);
+ }
+
+ internal override bool SupportsNamespacePrefixes {
+ get {
+ return true;
+ }
+ }
+
+ internal override bool SupportsTextContent {
+ get {
+ return true;
+ }
+ }
+
+ internal override string Namespace {
+ get {
+ if (ns != null)
+ return ns;
+ var parentElement = ParentNode as MSBuildXmlElement;
+ return parentElement != null ? parentElement.ns : MSBuildProject.Schema;
+ }
+ }
+
+ internal override string NamespacePrefix {
+ get {
+ return prefix;
+ }
+ }
+
+ internal override string GetElementName ()
+ {
+ return name;
+ }
+
+ internal override string [] GetKnownAttributes ()
+ {
+ return knownAtts;
+ }
+
+ internal string GetInnerXml ()
+ {
+ if (StartInnerWhitespace == null && EndInnerWhitespace == null && ChildNodes.Count == 0)
+ return string.Empty;
+
+ var c = new WriteContext ();
+ StringWriter sb = new StringWriter ();
+
+ var xw = XmlWriter.Create (sb, new XmlWriterSettings {
+ OmitXmlDeclaration = true,
+ NewLineChars = ParentProject.TextFormat.NewLine,
+ NewLineHandling = NewLineHandling.None
+ });
+
+ using (xw) {
+ xw.WriteStartElement ("a");
+ WriteContent (xw, c);
+ xw.WriteEndElement ();
+ }
+ var s = sb.ToString ();
+ int si = s.IndexOf ('>') + 1;
+ int ei = s.LastIndexOf ('<');
+ if (ei < si)
+ return string.Empty;
+ return s.Substring (si, ei - si);
+ }
+
+ internal string GetText ()
+ {
+ StringBuilder sb = new StringBuilder ();
+ foreach (var c in ChildNodes) {
+ if (c is MSBuildXmlTextNode || c is MSBuildXmlCDataNode)
+ sb.Append (((MSBuildXmlValueNode)c).Value);
+ }
+ return sb.ToString ();
+ }
+ }
+
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildXmlNode.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildXmlNode.cs
new file mode 100644
index 0000000000..814892f5d9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildXmlNode.cs
@@ -0,0 +1,168 @@
+//
+// MSBuildXmlNode.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+using System.Xml;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public class MSBuildNode: IMSBuildProjectObject
+ {
+ public MSBuildNode ()
+ {
+ }
+
+ MSBuildProject project;
+ MSBuildNode parentObject;
+
+ internal object StartWhitespace { get; set; }
+ internal object EndWhitespace { get; set; }
+
+ internal virtual void Read (MSBuildXmlReader reader)
+ {
+ }
+
+ internal virtual void Write (XmlWriter writer, WriteContext context)
+ {
+ }
+
+ internal virtual void AssertCanModify ()
+ {
+ var pp = ParentProject;
+ if (pp != null)
+ pp.AssertCanModify ();
+ }
+
+ internal MSBuildNode ParentNode {
+ get {
+ return parentObject;
+ }
+ set {
+ parentObject = value;
+ if (parentObject != null && parentObject.ParentProject != null)
+ OnProjectSet ();
+ }
+ }
+
+ public MSBuildObject ParentObject {
+ get {
+ if (ParentNode == null)
+ return null;
+ return ParentNode is MSBuildObject ? (MSBuildObject) ParentNode : ParentNode.ParentObject;
+ }
+ }
+
+ public MSBuildProject ParentProject {
+ get {
+ return project ?? (ParentObject != null ? ParentObject.ParentProject : null);
+ }
+ internal set {
+ project = value;
+ OnProjectSet ();
+ }
+ }
+
+ internal virtual IEnumerable<MSBuildNode> GetChildren ()
+ {
+ yield break;
+ }
+
+ internal virtual MSBuildNode GetPreviousSibling ()
+ {
+ var p = ParentObject;
+ if (p != null) {
+ MSBuildNode last = null;
+ foreach (var c in p.GetChildren ()) {
+ if (c == this)
+ return last;
+ last = c;
+ }
+ }
+ return null;
+ }
+
+ internal void NotifyChanged ()
+ {
+ if (ParentProject != null)
+ ParentProject.NotifyChanged ();
+ }
+
+ internal virtual void OnProjectSet ()
+ {
+ }
+ }
+
+
+ class MSBuildXmlValueNode: MSBuildNode
+ {
+ public string Value { get; set; }
+
+ internal override void Read (MSBuildXmlReader reader)
+ {
+ StartWhitespace = reader.ConsumeWhitespace ();
+ Value = reader.Value;
+ reader.Read ();
+
+ while (reader.IsWhitespace)
+ reader.ReadAndStoreWhitespace ();
+
+ EndWhitespace = reader.ConsumeWhitespaceUntilNewLine ();
+ }
+ }
+
+ class MSBuildXmlTextNode: MSBuildXmlValueNode
+ {
+ internal override void Write (XmlWriter writer, WriteContext context)
+ {
+ MSBuildWhitespace.Write (StartWhitespace, writer);
+ writer.WriteString (Value);
+ MSBuildWhitespace.Write (EndWhitespace, writer);
+ }
+ }
+
+ class MSBuildXmlCDataNode : MSBuildXmlValueNode
+ {
+ internal override void Write (XmlWriter writer, WriteContext context)
+ {
+ MSBuildWhitespace.Write (StartWhitespace, writer);
+ writer.WriteCData (Value);
+ MSBuildWhitespace.Write (EndWhitespace, writer);
+ }
+ }
+
+ class MSBuildXmlCommentNode: MSBuildXmlValueNode
+ {
+ internal override void Write (XmlWriter writer, WriteContext context)
+ {
+ MSBuildWhitespace.Write (StartWhitespace, writer);
+ writer.WriteComment (Value);
+ MSBuildWhitespace.Write (EndWhitespace, writer);
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildXmlReader.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildXmlReader.cs
new file mode 100644
index 0000000000..3dc429738b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildXmlReader.cs
@@ -0,0 +1,151 @@
+//
+// MSBuildXmlReader.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Xml;
+using System.Text;
+
+using MonoDevelop.Core;
+using MonoDevelop.Projects.Utility;
+using System.Linq;
+using MonoDevelop.Projects.Text;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+
+ class MSBuildXmlReader
+ {
+ public bool ForEvaluation;
+
+ object currentWhitespace;
+
+ public MSBuildXmlReader ()
+ {
+ }
+
+ public object ConsumeWhitespace ()
+ {
+ var ws = MSBuildWhitespace.GenerateStrings (currentWhitespace);
+ currentWhitespace = null;
+ return ws;
+ }
+
+ public object ConsumeWhitespaceUntilNewLine ()
+ {
+ return MSBuildWhitespace.ConsumeUntilNewLine (ref currentWhitespace);
+ }
+
+ public void ReadAndStoreWhitespace ()
+ {
+ currentWhitespace = MSBuildWhitespace.Append (currentWhitespace, XmlReader);
+ Read ();
+ }
+
+ public bool EOF {
+ get {
+ return XmlReader.EOF;
+ }
+ }
+
+ public bool IsEmptyElement {
+ get {
+ return XmlReader.IsEmptyElement;
+ }
+ }
+
+ public bool IsWhitespace {
+ get {
+ return MSBuildWhitespace.IsWhitespace (XmlReader);
+ }
+ }
+
+ public string LocalName {
+ get {
+ return XmlReader.LocalName;
+ }
+ }
+
+ public string NamespaceURI {
+ get {
+ return XmlReader.NamespaceURI;
+ }
+ }
+
+ public XmlNodeType NodeType {
+ get {
+ return XmlReader.NodeType;
+ }
+ }
+
+ public string Prefix {
+ get {
+ return XmlReader.Prefix;
+ }
+ }
+
+ public string Value {
+ get {
+ return XmlReader.Value;
+ }
+ }
+
+ public XmlReader XmlReader { get; internal set; }
+
+ internal string GetAttribute (string v)
+ {
+ return XmlReader.GetAttribute (v);
+ }
+
+ internal void MoveToElement ()
+ {
+ XmlReader.MoveToElement ();
+ }
+
+ internal bool MoveToFirstAttribute ()
+ {
+ return XmlReader.MoveToFirstAttribute ();
+ }
+
+ internal bool MoveToNextAttribute ()
+ {
+ return XmlReader.MoveToNextAttribute ();
+ }
+
+ internal bool Read ()
+ {
+ return XmlReader.Read ();
+ }
+
+ internal void Skip ()
+ {
+ XmlReader.Skip ();
+ }
+ }
+
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MergeToProjectAttribute.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MergeToProjectAttribute.cs
new file mode 100644
index 0000000000..2053557750
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MergeToProjectAttribute.cs
@@ -0,0 +1,43 @@
+//
+// MergeToProjectAttribute.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ /// <summary>
+ /// Specifies that a property of a project configuration has to be stored as a project property
+ /// </summary>
+ /// <remarks>
+ /// When applied to a property of a project configuration, MD will check
+ /// if the value of that property is the same for all configurations.
+ /// If they are the same, the value will be stored in the main property
+ /// group, instead of individually in each configuration.
+ /// </remarks>
+ public class MergeToProjectAttribute: Attribute
+ {
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/ProjectEvaluationException.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/ProjectEvaluationException.cs
new file mode 100644
index 0000000000..000fcea525
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/ProjectEvaluationException.cs
@@ -0,0 +1,40 @@
+//
+// ProjectEvaluationException.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public class ProjectEvaluationException: ApplicationException
+ {
+ public ProjectEvaluationException (MSBuildProject project, string message): base (message)
+ {
+ Project = project;
+ }
+
+ public MSBuildProject Project { get; private set; }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteProjectBuilder.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteProjectBuilder.cs
new file mode 100644
index 0000000000..e16eedf6b4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteProjectBuilder.cs
@@ -0,0 +1,438 @@
+//
+// RemoteProjectBuilder.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Diagnostics;
+using System.Globalization;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using MonoDevelop.Core;
+using System.IO;
+using System.Linq;
+using MonoDevelop.Projects.MSBuild;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ class RemoteBuildEngine: IBuildEngine
+ {
+ IBuildEngine engine;
+ Process proc;
+ bool alive = true;
+ static int count;
+ int busy;
+
+ public int ReferenceCount { get; set; }
+ public DateTime ReleaseTime { get; set; }
+
+ public RemoteBuildEngine (Process proc, IBuildEngine engine)
+ {
+ this.proc = proc;
+ this.engine = engine;
+
+ Interlocked.Increment (ref count);
+ }
+
+ public event EventHandler Disconnected;
+
+ public int AciveEngines {
+ get {
+ return count;
+ }
+ }
+
+ public IProjectBuilder LoadProject (string projectFile)
+ {
+ try {
+ return engine.LoadProject (projectFile);
+ } catch {
+ CheckDisconnected ();
+ throw;
+ }
+ }
+
+ public void UnloadProject (IProjectBuilder pb)
+ {
+ try {
+ engine.UnloadProject (pb);
+ } catch (Exception ex) {
+ LoggingService.LogError ("Project unloading failed", ex);
+ if (!CheckDisconnected ())
+ throw;
+ }
+ }
+
+ public void CancelTask (int taskId)
+ {
+ try {
+ engine.CancelTask (taskId);
+ } catch {
+ CheckDisconnected ();
+ throw;
+ }
+ }
+
+ public void SetCulture (CultureInfo uiCulture)
+ {
+ try {
+ engine.SetCulture (uiCulture);
+ } catch {
+ CheckDisconnected ();
+ throw;
+ }
+ }
+
+ public void SetGlobalProperties (IDictionary<string, string> properties)
+ {
+ try {
+ engine.SetGlobalProperties (properties);
+ } catch {
+ CheckDisconnected ();
+ throw;
+ }
+ }
+
+ void IBuildEngine.Ping ()
+ {
+ engine.Ping ();
+ }
+
+ bool CheckAlive ()
+ {
+ if (!alive)
+ return false;
+ try {
+ engine.Ping ();
+ return true;
+ } catch {
+ alive = false;
+ return false;
+ }
+ }
+
+ internal bool CheckDisconnected ()
+ {
+ if (!CheckAlive ()) {
+ if (Disconnected != null)
+ Disconnected (this, EventArgs.Empty);
+ return true;
+ }
+ return false;
+ }
+
+ public void Dispose ()
+ {
+ Interlocked.Decrement (ref count);
+ try {
+ alive = false;
+ if (proc != null) {
+ try {
+ proc.Kill ();
+ } catch {
+ }
+ }
+ else
+ engine.Dispose ();
+ } catch {
+ // Ignore
+ }
+ }
+
+ public bool Lock ()
+ {
+ return Interlocked.Increment (ref busy) == 1;
+ }
+
+ public void Unlock ()
+ {
+ Interlocked.Decrement (ref busy);
+ }
+
+ public bool IsBusy {
+ get {
+ return busy > 0;
+ }
+ }
+ }
+
+ public class RemoteProjectBuilder: IDisposable
+ {
+ RemoteBuildEngine engine;
+ IProjectBuilder builder;
+ Dictionary<string,string[]> referenceCache;
+ AsyncCriticalSection referenceCacheLock = new AsyncCriticalSection ();
+ string file;
+ static int lastTaskId;
+
+ internal RemoteProjectBuilder (string file, RemoteBuildEngine engine)
+ {
+ this.file = file;
+ this.engine = engine;
+ builder = engine.LoadProject (file);
+ referenceCache = new Dictionary<string, string[]> ();
+ }
+
+ public event EventHandler Disconnected;
+
+ void CheckDisconnected ()
+ {
+ if (engine != null && engine.CheckDisconnected ()) {
+ if (Disconnected != null)
+ Disconnected (this, EventArgs.Empty);
+ }
+ }
+
+ IDisposable RegisterCancellation (CancellationToken cancellationToken, int taskId)
+ {
+ return cancellationToken.Register (() => {
+ try {
+ BeginOperation ();
+ engine.CancelTask (taskId);
+ } catch (Exception ex) {
+ // Ignore
+ LoggingService.LogError ("CancelTask failed", ex);
+ } finally {
+ EndOperation ();
+ }
+ });
+ }
+
+ public Task<MSBuildResult> Run (
+ ProjectConfigurationInfo[] configurations,
+ ILogWriter logWriter,
+ MSBuildVerbosity verbosity,
+ string[] runTargets,
+ string[] evaluateItems,
+ string[] evaluateProperties,
+ Dictionary<string, string> globalProperties,
+ CancellationToken cancellationToken
+ )
+ {
+ // Get an id for the task, and get ready to cancel it if the cancellation token is signalled
+ var taskId = Interlocked.Increment (ref lastTaskId);
+ var cr = RegisterCancellation (cancellationToken, taskId);
+
+ var t = Task.Run (() => {
+ try {
+ BeginOperation ();
+ var res = builder.Run (configurations, logWriter, verbosity, runTargets, evaluateItems, evaluateProperties, globalProperties, taskId);
+ if (res == null && cancellationToken.IsCancellationRequested) {
+ MSBuildTargetResult err = new MSBuildTargetResult (file, false, "", "", file, 1, 1, 1, 1, "Build cancelled", "");
+ return new MSBuildResult (new [] { err });
+ }
+ if (res == null)
+ throw new Exception ("Unknown failure");
+ return res;
+ } catch (Exception ex) {
+ CheckDisconnected ();
+ LoggingService.LogError ("RunTarget failed", ex);
+ MSBuildTargetResult err = new MSBuildTargetResult (file, false, "", "", file, 1, 1, 1, 1, "Unknown MSBuild failure. Please try building the project again", "");
+ MSBuildResult res = new MSBuildResult (new [] { err });
+ return res;
+ } finally {
+ EndOperation ();
+ }
+ });
+
+ // Dispose the cancel registration
+ t.ContinueWith (r => cr.Dispose ());
+
+ return t;
+ }
+
+ public async Task<string[]> ResolveAssemblyReferences (ProjectConfigurationInfo[] configurations, CancellationToken cancellationToken)
+ {
+ string[] refs = null;
+ var id = configurations [0].Configuration + "|" + configurations [0].Platform;
+
+ using (await referenceCacheLock.EnterAsync ()) {
+ // Check the cache before starting the task
+ if (referenceCache.TryGetValue (id, out refs))
+ return refs;
+ }
+
+ // Get an id for the task, it will be used later on to cancel the task if necessary
+ var taskId = Interlocked.Increment (ref lastTaskId);
+ IDisposable cr = null;
+
+ refs = await Task.Run (async () => {
+ using (await referenceCacheLock.EnterAsync ()) {
+ // Check again the cache, maybe the value was set while the task was starting
+ if (referenceCache.TryGetValue (id, out refs))
+ return refs;
+
+ // Get ready to cancel the task if the cancellation token is signalled
+ cr = RegisterCancellation (cancellationToken, taskId);
+
+ MSBuildResult result;
+ try {
+ BeginOperation ();
+ lock (engine) {
+ // FIXME: This lock should not be necessary, but remoting seems to have problems when doing many concurrent calls.
+ result = builder.Run (
+ configurations, null, MSBuildVerbosity.Normal,
+ new [] { "ResolveAssemblyReferences" }, new [] { "ReferencePath" }, null, null, taskId
+ );
+ }
+ } catch (Exception ex) {
+ CheckDisconnected ();
+ LoggingService.LogError ("ResolveAssemblyReferences failed", ex);
+ return new string [0];
+ } finally {
+ EndOperation ();
+ }
+
+ List<MSBuildEvaluatedItem> items;
+ if (result.Items.TryGetValue ("ReferencePath", out items) && items != null) {
+ refs = items.Select (i => i.ItemSpec).ToArray ();
+ } else
+ refs = new string[0];
+
+ referenceCache [id] = refs;
+ }
+ return refs;
+ });
+
+ // Dispose the cancel registration
+ if (cr != null)
+ cr.Dispose ();
+
+ return refs;
+ }
+
+ public async Task Refresh ()
+ {
+ using (await referenceCacheLock.EnterAsync ())
+ referenceCache.Clear ();
+
+ await Task.Run (() => {
+ try {
+ BeginOperation ();
+ builder.Refresh ();
+ } catch (Exception ex) {
+ LoggingService.LogError ("MSBuild refresh failed", ex);
+ CheckDisconnected ();
+ } finally {
+ EndOperation ();
+ }
+ });
+ }
+
+ public async Task RefreshWithContent (string projectContent)
+ {
+ using (await referenceCacheLock.EnterAsync ())
+ referenceCache.Clear ();
+
+ await Task.Run (() => {
+ try {
+ BeginOperation ();
+ builder.RefreshWithContent (projectContent);
+ } catch (Exception ex) {
+ LoggingService.LogError ("MSBuild refresh failed", ex);
+ CheckDisconnected ();
+ } finally {
+ EndOperation ();
+ }
+ });
+ }
+
+ public void Dispose ()
+ {
+ if (!MSBuildProjectService.ShutDown && engine != null) {
+ try {
+ if (builder != null)
+ engine.UnloadProject (builder);
+ MSBuildProjectService.ReleaseProjectBuilder (engine);
+ } catch {
+ // Ignore
+ }
+ GC.SuppressFinalize (this);
+ engine = null;
+ builder = null;
+ }
+ }
+
+ void BeginOperation ()
+ {
+ engine.Lock ();
+ }
+
+ void EndOperation ()
+ {
+ if (engine != null)
+ engine.Unlock ();
+ }
+
+ public void Lock ()
+ {
+ BeginOperation ();
+ }
+
+ public void Unlock ()
+ {
+ EndOperation ();
+ }
+
+ public bool IsBusy {
+ get {
+ return engine.IsBusy;
+ }
+ }
+
+ object usageLock = new object ();
+ public int references;
+ bool shuttingDown;
+
+ public bool AddReference ()
+ {
+ lock (usageLock) {
+ if (shuttingDown)
+ return false;
+ references++;
+ return true;
+ }
+ }
+
+ public void ReleaseReference ()
+ {
+ lock (usageLock) {
+ if (--references == 0 && shuttingDown)
+ Dispose ();
+ }
+ }
+
+ public void Shutdown ()
+ {
+ lock (usageLock) {
+ if (!shuttingDown) {
+ shuttingDown = true;
+ if (references == 0)
+ Dispose ();
+ }
+ }
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/SlnFile.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/SlnFile.cs
new file mode 100644
index 0000000000..b20b15c0a5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/SlnFile.cs
@@ -0,0 +1,1046 @@
+//
+// SlnFile.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
+using System.IO;
+using System.Collections;
+using MonoDevelop.Core;
+using MonoDevelop.Projects.Text;
+using System.Text.RegularExpressions;
+using System.Globalization;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public class SlnFile
+ {
+ SlnProjectCollection projects = new SlnProjectCollection ();
+ SlnSectionCollection sections = new SlnSectionCollection ();
+ SlnPropertySet metadata = new SlnPropertySet (true);
+ int prefixBlankLines = 1;
+ TextFormatInfo format = new TextFormatInfo { NewLine = "\r\n" };
+
+ public string FormatVersion { get; set; }
+ public string ProductDescription { get; set; }
+
+ public string VisualStudioVersion {
+ get { return metadata.GetValue ("VisualStudioVersion"); }
+ set { metadata.SetValue ("VisualStudioVersion", value); }
+ }
+
+ public string MinimumVisualStudioVersion {
+ get { return metadata.GetValue ("MinimumVisualStudioVersion"); }
+ set { metadata.SetValue ("MinimumVisualStudioVersion", value); }
+ }
+
+ public SlnFile ()
+ {
+ projects.ParentFile = this;
+ sections.ParentFile = this;
+ }
+
+ /// <summary>
+ /// Gets the sln format version of the provided solution file
+ /// </summary>
+ /// <returns>The file version.</returns>
+ /// <param name="file">File.</param>
+ public static string GetFileVersion (string file)
+ {
+ string strVersion;
+ using (var reader = new StreamReader (file)) {
+ var strInput = reader.ReadLine();
+ if (strInput == null)
+ return null;
+
+ var match = slnVersionRegex.Match (strInput);
+ if (!match.Success) {
+ strInput = reader.ReadLine();
+ if (strInput == null)
+ return null;
+ match = slnVersionRegex.Match (strInput);
+ if (!match.Success)
+ return null;
+ }
+
+ strVersion = match.Groups[1].Value;
+ return strVersion;
+ }
+ }
+
+ static Regex slnVersionRegex = new Regex (@"Microsoft Visual Studio Solution File, Format Version (\d?\d.\d\d)");
+
+ /// <summary>
+ /// The directory to be used as base for converting absolute paths to relative
+ /// </summary>
+ public FilePath BaseDirectory {
+ get { return FileName.ParentDirectory; }
+ }
+
+ /// <summary>
+ /// Gets the solution configurations section.
+ /// </summary>
+ /// <value>The solution configurations section.</value>
+ public SlnPropertySet SolutionConfigurationsSection {
+ get { return sections.GetOrCreateSection ("SolutionConfigurationPlatforms", SlnSectionType.PreProcess).Properties; }
+ }
+
+ /// <summary>
+ /// Gets the project configurations section.
+ /// </summary>
+ /// <value>The project configurations section.</value>
+ public SlnPropertySetCollection ProjectConfigurationsSection {
+ get { return sections.GetOrCreateSection ("ProjectConfigurationPlatforms", SlnSectionType.PostProcess).NestedPropertySets; }
+ }
+
+ public SlnSectionCollection Sections {
+ get { return sections; }
+ }
+
+ public SlnProjectCollection Projects {
+ get { return projects; }
+ }
+
+ public FilePath FileName { get; set; }
+
+ public void Read (string file)
+ {
+ FileName = file;
+ format = FileUtil.GetTextFormatInfo (file);
+
+ using (var sr = new StreamReader (file))
+ Read (sr);
+ }
+
+ public void Read (TextReader reader)
+ {
+ string line;
+ int curLineNum = 0;
+ bool globalFound = false;
+ bool productRead = false;
+
+ while ((line = reader.ReadLine ()) != null) {
+ curLineNum++;
+ line = line.Trim ();
+ if (line.StartsWith ("Microsoft Visual Studio Solution File", StringComparison.Ordinal)) {
+ int i = line.LastIndexOf (' ');
+ if (i == -1)
+ throw new InvalidSolutionFormatException (curLineNum);
+ FormatVersion = line.Substring (i + 1);
+ prefixBlankLines = curLineNum - 1;
+ }
+ if (line.StartsWith ("# ", StringComparison.Ordinal)) {
+ if (!productRead) {
+ productRead = true;
+ ProductDescription = line.Substring (2);
+ }
+ } else if (line.StartsWith ("Project", StringComparison.Ordinal)) {
+ SlnProject p = new SlnProject ();
+ p.Read (reader, line, ref curLineNum);
+ projects.Add (p);
+ } else if (line == "Global") {
+ if (globalFound)
+ throw new InvalidSolutionFormatException (curLineNum, "Global section specified more than once");
+ globalFound = true;
+ while ((line = reader.ReadLine ()) != null) {
+ curLineNum++;
+ line = line.Trim ();
+ if (line == "EndGlobal") {
+ break;
+ } else if (line.StartsWith ("GlobalSection", StringComparison.Ordinal)) {
+ var sec = new SlnSection ();
+ sec.Read (reader, line, ref curLineNum);
+ sections.Add (sec);
+ } else
+ throw new InvalidSolutionFormatException (curLineNum);
+ }
+ if (line == null)
+ throw new InvalidSolutionFormatException (curLineNum, "Global section not closed");
+ } else if (line.IndexOf ('=') != -1) {
+ metadata.ReadLine (line, curLineNum);
+ }
+ }
+ if (FormatVersion == null)
+ throw new InvalidSolutionFormatException (curLineNum, "File header is missing");
+ }
+
+ public void Write (string file)
+ {
+ FileName = file;
+ var sw = new StringWriter ();
+ Write (sw);
+ TextFile.WriteFile (file, sw.ToString(), format.ByteOrderMark, true);
+ }
+
+ public void Write (TextWriter writer)
+ {
+ writer.NewLine = format.NewLine;
+ for (int n=0; n<prefixBlankLines; n++)
+ writer.WriteLine ();
+ writer.WriteLine ("Microsoft Visual Studio Solution File, Format Version " + FormatVersion);
+ writer.WriteLine ("# " + ProductDescription);
+
+ metadata.Write (writer);
+
+ foreach (var p in projects)
+ p.Write (writer);
+
+ writer.WriteLine ("Global");
+ foreach (SlnSection s in sections)
+ s.Write (writer, "GlobalSection");
+ writer.WriteLine ("EndGlobal");
+ }
+ }
+
+ public class SlnProject
+ {
+ SlnSectionCollection sections = new SlnSectionCollection ();
+
+ SlnFile parentFile;
+
+ public SlnFile ParentFile {
+ get {
+ return parentFile;
+ }
+ internal set {
+ parentFile = value;
+ sections.ParentFile = parentFile;
+ }
+ }
+
+ public string Id { get; set; }
+ public string TypeGuid { get; set; }
+ public string Name { get; set; }
+ public string FilePath { get; set; }
+ public int Line { get; private set; }
+ internal bool Processed { get; set; }
+
+ public SlnSectionCollection Sections {
+ get { return sections; }
+ }
+
+ internal void Read (TextReader reader, string line, ref int curLineNum)
+ {
+ Line = curLineNum;
+
+ int n = 0;
+ FindNext (curLineNum, line, ref n, '(');
+ n++;
+ FindNext (curLineNum, line, ref n, '"');
+ int n2 = n + 1;
+ FindNext (curLineNum, line, ref n2, '"');
+ TypeGuid = line.Substring (n + 1, n2 - n - 1);
+
+ n = n2 + 1;
+ FindNext (curLineNum, line, ref n, ')');
+ FindNext (curLineNum, line, ref n, '=');
+
+ FindNext (curLineNum, line, ref n, '"');
+ n2 = n + 1;
+ FindNext (curLineNum, line, ref n2, '"');
+ Name = line.Substring (n + 1, n2 - n - 1);
+
+ n = n2 + 1;
+ FindNext (curLineNum, line, ref n, ',');
+ FindNext (curLineNum, line, ref n, '"');
+ n2 = n + 1;
+ FindNext (curLineNum, line, ref n2, '"');
+ FilePath = line.Substring (n + 1, n2 - n - 1);
+
+ n = n2 + 1;
+ FindNext (curLineNum, line, ref n, ',');
+ FindNext (curLineNum, line, ref n, '"');
+ n2 = n + 1;
+ FindNext (curLineNum, line, ref n2, '"');
+ Id = line.Substring (n + 1, n2 - n - 1);
+
+ while ((line = reader.ReadLine ()) != null) {
+ curLineNum++;
+ line = line.Trim ();
+ if (line == "EndProject") {
+ return;
+ }
+ if (line.StartsWith ("ProjectSection", StringComparison.Ordinal)) {
+ if (sections == null)
+ sections = new SlnSectionCollection ();
+ var sec = new SlnSection ();
+ sections.Add (sec);
+ sec.Read (reader, line, ref curLineNum);
+ }
+ }
+
+ throw new InvalidSolutionFormatException (curLineNum, "Project section not closed");
+ }
+
+ void FindNext (int ln, string line, ref int i, char c)
+ {
+ i = line.IndexOf (c, i);
+ if (i == -1)
+ throw new InvalidSolutionFormatException (ln);
+ }
+
+ public void Write (TextWriter writer)
+ {
+ writer.Write ("Project(\"");
+ writer.Write (TypeGuid);
+ writer.Write ("\") = \"");
+ writer.Write (Name);
+ writer.Write ("\", \"");
+ writer.Write (FilePath);
+ writer.Write ("\", \"");
+ writer.Write (Id);
+ writer.WriteLine ("\"");
+ if (sections != null) {
+ foreach (SlnSection s in sections)
+ s.Write (writer, "ProjectSection");
+ }
+ writer.WriteLine ("EndProject");
+ }
+ }
+
+ public class SlnSection
+ {
+ SlnPropertySetCollection nestedPropertySets;
+ SlnPropertySet properties;
+ List<string> sectionLines;
+ int baseIndex;
+
+ public string Id { get; set; }
+ public int Line { get; private set; }
+
+ internal bool Processed { get; set; }
+
+ public SlnFile ParentFile { get; internal set; }
+
+ public bool IsEmpty {
+ get {
+ return (properties == null || properties.Count == 0) && (nestedPropertySets == null || nestedPropertySets.All (t => t.IsEmpty)) && (sectionLines == null || sectionLines.Count == 0);
+ }
+ }
+
+ /// <summary>
+ /// If true, this section won't be written to the file if it is empty
+ /// </summary>
+ /// <value><c>true</c> if skip if empty; otherwise, <c>false</c>.</value>
+ public bool SkipIfEmpty { get; set; }
+
+ public void Clear ()
+ {
+ properties = null;
+ nestedPropertySets = null;
+ sectionLines = null;
+ }
+
+ public SlnPropertySet Properties {
+ get {
+ if (properties == null) {
+ properties = new SlnPropertySet ();
+ properties.ParentSection = this;
+ if (sectionLines != null) {
+ foreach (var line in sectionLines)
+ properties.ReadLine (line, Line);
+ sectionLines = null;
+ }
+ }
+ return properties;
+ }
+ }
+
+ public SlnPropertySetCollection NestedPropertySets {
+ get {
+ if (nestedPropertySets == null) {
+ nestedPropertySets = new SlnPropertySetCollection (this);
+ if (sectionLines != null)
+ LoadPropertySets ();
+ }
+ return nestedPropertySets;
+ }
+ }
+
+ public void SetContent (IEnumerable<KeyValuePair<string,string>> lines)
+ {
+ sectionLines = new List<string> (lines.Select (p => p.Key + " = " + p.Value));
+ properties = null;
+ nestedPropertySets = null;
+ }
+
+ public IEnumerable<KeyValuePair<string,string>> GetContent ()
+ {
+ if (sectionLines != null)
+ return sectionLines.Select (li => {
+ int i = li.IndexOf ('=');
+ if (i != -1)
+ return new KeyValuePair<string,string> (li.Substring (0, i).Trim(), li.Substring (i + 1).Trim());
+ else
+ return new KeyValuePair<string,string> (li.Trim (), "");
+ });
+ else
+ return new KeyValuePair<string,string> [0];
+ }
+
+ public SlnSectionType SectionType { get; set; }
+
+ SlnSectionType ToSectionType (int curLineNum, string s)
+ {
+ if (s == "preSolution" || s == "preProject")
+ return SlnSectionType.PreProcess;
+ if (s == "postSolution" || s == "postProject")
+ return SlnSectionType.PostProcess;
+ throw new InvalidSolutionFormatException (curLineNum, "Invalid section type: " + s);
+ }
+
+ string FromSectionType (bool isProjectSection, SlnSectionType type)
+ {
+ if (type == SlnSectionType.PreProcess)
+ return isProjectSection ? "preProject" : "preSolution";
+ else
+ return isProjectSection ? "postProject" : "postSolution";
+ }
+
+ internal void Read (TextReader reader, string line, ref int curLineNum)
+ {
+ Line = curLineNum;
+ int k = line.IndexOf ('(');
+ if (k == -1)
+ throw new InvalidSolutionFormatException (curLineNum, "Section id missing");
+ var tag = line.Substring (0, k).Trim ();
+ var k2 = line.IndexOf (')', k);
+ if (k2 == -1)
+ throw new InvalidSolutionFormatException (curLineNum);
+ Id = line.Substring (k + 1, k2 - k - 1);
+
+ k = line.IndexOf ('=', k2);
+ SectionType = ToSectionType (curLineNum, line.Substring (k + 1).Trim ());
+
+ var endTag = "End" + tag;
+
+ sectionLines = new List<string> ();
+ baseIndex = ++curLineNum;
+ while ((line = reader.ReadLine()) != null) {
+ curLineNum++;
+ line = line.Trim ();
+ if (line == endTag)
+ break;
+ sectionLines.Add (line);
+ }
+ if (line == null)
+ throw new InvalidSolutionFormatException (curLineNum, "Closing section tag not found");
+ }
+
+ void LoadPropertySets ()
+ {
+ if (sectionLines != null) {
+ SlnPropertySet curSet = null;
+ for (int n = 0; n < sectionLines.Count; n++) {
+ var line = sectionLines [n];
+ if (string.IsNullOrEmpty (line.Trim ()))
+ continue;
+ var i = line.IndexOf ('.');
+ if (i == -1)
+ throw new InvalidSolutionFormatException (baseIndex + n);
+ var id = line.Substring (0, i);
+ if (curSet == null || id != curSet.Id) {
+ curSet = new SlnPropertySet (id);
+ nestedPropertySets.Add (curSet);
+ }
+ curSet.ReadLine (line.Substring (i + 1), baseIndex + n);
+ }
+ sectionLines = null;
+ }
+ }
+
+ internal void Write (TextWriter writer, string sectionTag)
+ {
+ if (SkipIfEmpty && IsEmpty)
+ return;
+
+ writer.Write ("\t");
+ writer.Write (sectionTag);
+ writer.Write ('(');
+ writer.Write (Id);
+ writer.Write (") = ");
+ writer.WriteLine (FromSectionType (sectionTag == "ProjectSection", SectionType));
+ if (sectionLines != null) {
+ foreach (var l in sectionLines)
+ writer.WriteLine ("\t\t" + l);
+ } else if (properties != null)
+ properties.Write (writer);
+ else if (nestedPropertySets != null) {
+ foreach (var ps in nestedPropertySets)
+ ps.Write (writer);
+ }
+ writer.WriteLine ("\tEnd" + sectionTag);
+ }
+ }
+
+ /// <summary>
+ /// A collection of properties
+ /// </summary>
+ public class SlnPropertySet: IDictionary<string,string>
+ {
+ OrderedDictionary values = new OrderedDictionary ();
+ bool isMetadata;
+
+ internal bool Processed { get; set; }
+
+ public SlnFile ParentFile {
+ get { return ParentSection != null ? ParentSection.ParentFile : null; }
+ }
+
+ public SlnSection ParentSection { get; set; }
+
+ /// <summary>
+ /// Text file line of this section in the original file
+ /// </summary>
+ /// <value>The line.</value>
+ public int Line { get; private set; }
+
+ internal SlnPropertySet ()
+ {
+ }
+
+ /// <summary>
+ /// Creates a new property set with the specified ID
+ /// </summary>
+ /// <param name="id">Identifier.</param>
+ public SlnPropertySet (string id)
+ {
+ Id = id;
+ }
+
+ internal SlnPropertySet (bool isMetadata)
+ {
+ this.isMetadata = isMetadata;
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether this property set is empty.
+ /// </summary>
+ /// <value><c>true</c> if this instance is empty; otherwise, <c>false</c>.</value>
+ public bool IsEmpty {
+ get {
+ return values.Count == 0;
+ }
+ }
+
+ internal void ReadLine (string line, int currentLine)
+ {
+ if (Line == 0)
+ Line = currentLine;
+ line = line.Trim ();
+ int k = line.IndexOf ('=');
+ if (k != -1) {
+ var name = line.Substring (0, k).Trim ();
+ var val = line.Substring (k + 1).Trim ();
+ values [name] = val;
+ } else {
+ values.Add (line, null);
+ }
+ }
+
+ internal void Write (TextWriter writer)
+ {
+ foreach (DictionaryEntry e in values) {
+ if (!isMetadata)
+ writer.Write ("\t\t");
+ if (Id != null)
+ writer.Write (Id + ".");
+ writer.WriteLine (e.Key + " = " + e.Value);
+ }
+ }
+
+ /// <summary>
+ /// Gets the identifier of the property set
+ /// </summary>
+ /// <value>The identifier.</value>
+ public string Id { get; private set; }
+
+ public string GetValue (string name, string defaultValue = null)
+ {
+ string res;
+ if (TryGetValue (name, out res))
+ return res;
+ else
+ return defaultValue;
+ }
+
+ public FilePath GetPathValue (string name, FilePath defaultValue = default(FilePath), bool relativeToSolution = true, FilePath relativeToPath = default(FilePath))
+ {
+ string val;
+ if (TryGetValue (name, out val)) {
+ string baseDir = null;
+ if (relativeToPath != null) {
+ baseDir = relativeToPath;
+ } else if (relativeToSolution && ParentFile != null && ParentFile.FileName != null) {
+ baseDir = ParentFile.FileName.ParentDirectory;
+ }
+ return MSBuildProjectService.FromMSBuildPath (baseDir, val);
+ }
+ else
+ return defaultValue;
+ }
+
+ public bool TryGetPathValue (string name, out FilePath value, FilePath defaultValue = default(FilePath), bool relativeToSolution = true, FilePath relativeToPath = default(FilePath))
+ {
+ string val;
+ if (TryGetValue (name, out val)) {
+ string baseDir = null;
+
+ if (relativeToPath != null) {
+ baseDir = relativeToPath;
+ } else if (relativeToSolution && ParentFile != null && ParentFile.FileName != null) {
+ baseDir = ParentFile.FileName.ParentDirectory;
+ }
+ string path;
+ var res = MSBuildProjectService.FromMSBuildPath (baseDir, val, out path);
+ value = path;
+ return res;
+ }
+ else {
+ value = defaultValue;
+ return value != default(FilePath);
+ }
+ }
+
+ public T GetValue<T> (string name)
+ {
+ return (T) GetValue (name, typeof(T), default(T));
+ }
+
+ public T GetValue<T> (string name, T defaultValue)
+ {
+ return (T) GetValue (name, typeof(T), defaultValue);
+ }
+
+ public object GetValue (string name, Type t, object defaultValue)
+ {
+ string val;
+ if (TryGetValue (name, out val)) {
+ if (t == typeof(bool))
+ return (object) val.Equals ("true", StringComparison.InvariantCultureIgnoreCase);
+ if (t.IsEnum)
+ return Enum.Parse (t, val, true);
+ if (t.IsGenericType && t.GetGenericTypeDefinition () == typeof(Nullable<>)) {
+ var at = t.GetGenericArguments () [0];
+ if (string.IsNullOrEmpty (val))
+ return null;
+ return Convert.ChangeType (val, at, CultureInfo.InvariantCulture);
+
+ }
+ return Convert.ChangeType (val, t, CultureInfo.InvariantCulture);
+ }
+ else
+ return defaultValue;
+ }
+
+ public void SetValue (string name, string value, string defaultValue = null, bool preserveExistingCase = false)
+ {
+ if (value == null && defaultValue == "")
+ value = "";
+ if (value == defaultValue) {
+ // if the value is default, only remove the property if it was not already the default
+ // to avoid unnecessary project file churn
+ string res;
+ if (TryGetValue (name, out res) && !string.Equals (defaultValue ?? "", res, preserveExistingCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal))
+ Remove (name);
+ return;
+ }
+ string currentValue;
+ if (preserveExistingCase && TryGetValue (name, out currentValue) && string.Equals (value, currentValue, StringComparison.OrdinalIgnoreCase))
+ return;
+ values [name] = value;
+ }
+
+ public void SetValue (string name, FilePath value, FilePath defaultValue = default(FilePath), bool relativeToSolution = true, FilePath relativeToPath = default(FilePath))
+ {
+ var isDefault = value.CanonicalPath == defaultValue.CanonicalPath;
+ if (isDefault) {
+ // if the value is default, only remove the property if it was not already the default
+ // to avoid unnecessary project file churn
+ if (ContainsKey (name) && (defaultValue == null || defaultValue != GetPathValue (name, relativeToSolution:relativeToSolution, relativeToPath:relativeToPath)))
+ Remove (name);
+ return;
+ }
+ string baseDir = null;
+ if (relativeToPath != null) {
+ baseDir = relativeToPath;
+ } else if (relativeToSolution && ParentFile != null && ParentFile.FileName != null) {
+ baseDir = ParentFile.FileName.ParentDirectory;
+ }
+ values [name] = MSBuildProjectService.ToMSBuildPath (baseDir, value, false);
+ }
+
+ public void SetValue (string name, object value, object defaultValue = null)
+ {
+ var isDefault = object.Equals (value, defaultValue);
+ if (isDefault) {
+ // if the value is default, only remove the property if it was not already the default
+ // to avoid unnecessary project file churn
+ if (ContainsKey (name) && (defaultValue == null || !object.Equals (defaultValue, GetValue (name, defaultValue.GetType (), null))))
+ Remove (name);
+ return;
+ }
+
+ if (value is bool)
+ values [name] = (bool)value ? "TRUE" : "FALSE";
+ else
+ values [name] = Convert.ToString (value, CultureInfo.InvariantCulture);
+ }
+
+ void IDictionary<string,string>.Add (string key, string value)
+ {
+ SetValue (key, value);
+ }
+
+ /// <summary>
+ /// Determines whether the current instance contains an entry with the specified key
+ /// </summary>
+ /// <returns><c>true</c>, if key was containsed, <c>false</c> otherwise.</returns>
+ /// <param name="key">Key.</param>
+ public bool ContainsKey (string key)
+ {
+ return values.Contains (key);
+ }
+
+ /// <summary>
+ /// Removes a property
+ /// </summary>
+ /// <param name="key">Property name</param>
+ public bool Remove (string key)
+ {
+ var wasThere = values.Contains (key);
+ values.Remove (key);
+ return wasThere;
+ }
+
+ /// <summary>
+ /// Tries to get the value of a property
+ /// </summary>
+ /// <returns><c>true</c>, if the property exists, <c>false</c> otherwise.</returns>
+ /// <param name="key">Property name</param>
+ /// <param name="value">Value.</param>
+ public bool TryGetValue (string key, out string value)
+ {
+ value = (string) values [key];
+ return value != null;
+ }
+
+ /// <summary>
+ /// Gets or sets the value of a property
+ /// </summary>
+ /// <param name="index">Index.</param>
+ public string this [string index] {
+ get {
+ return (string) values [index];
+ }
+ set {
+ values [index] = value;
+ }
+ }
+
+ public ICollection<string> Values {
+ get {
+ return values.Values.Cast<string>().ToList ();
+ }
+ }
+
+ public ICollection<string> Keys {
+ get { return values.Keys.Cast<string> ().ToList (); }
+ }
+
+ void ICollection<KeyValuePair<string, string>>.Add (KeyValuePair<string, string> item)
+ {
+ SetValue (item.Key, item.Value);
+ }
+
+ public void Clear ()
+ {
+ values.Clear ();
+ }
+
+ internal void ClearExcept (HashSet<string> keys)
+ {
+ foreach (var k in values.Keys.Cast<string>().Except (keys).ToArray ())
+ values.Remove (k);
+ }
+
+ bool ICollection<KeyValuePair<string, string>>.Contains (KeyValuePair<string, string> item)
+ {
+ var val = GetValue (item.Key);
+ return val == item.Value;
+ }
+
+ public void CopyTo (KeyValuePair<string, string>[] array, int arrayIndex)
+ {
+ foreach (DictionaryEntry de in values)
+ array [arrayIndex++] = new KeyValuePair<string, string> ((string)de.Key, (string)de.Value);
+ }
+
+ bool ICollection<KeyValuePair<string, string>>.Remove (KeyValuePair<string, string> item)
+ {
+ if (((ICollection<KeyValuePair<string, string>>)this).Contains (item)) {
+ Remove (item.Key);
+ return true;
+ } else
+ return false;
+ }
+
+ public int Count {
+ get {
+ return values.Count;
+ }
+ }
+
+ internal void SetLines (IEnumerable<KeyValuePair<string,string>> lines)
+ {
+ values.Clear ();
+ foreach (var line in lines)
+ values [line.Key] = line.Value;
+ }
+
+ bool ICollection<KeyValuePair<string, string>>.IsReadOnly {
+ get {
+ return false;
+ }
+ }
+
+ public IEnumerator<KeyValuePair<string, string>> GetEnumerator ()
+ {
+ foreach (DictionaryEntry de in values)
+ yield return new KeyValuePair<string,string> ((string)de.Key, (string)de.Value);
+ }
+
+ IEnumerator IEnumerable.GetEnumerator ()
+ {
+ foreach (DictionaryEntry de in values)
+ yield return new KeyValuePair<string,string> ((string)de.Key, (string)de.Value);
+ }
+ }
+
+ public class SlnProjectCollection: Collection<SlnProject>
+ {
+ SlnFile parentFile;
+
+ internal SlnFile ParentFile {
+ get {
+ return parentFile;
+ }
+ set {
+ parentFile = value;
+ foreach (var it in this)
+ it.ParentFile = parentFile;
+ }
+ }
+
+ public SlnProject GetProject (string id)
+ {
+ return this.FirstOrDefault (s => s.Id == id);
+ }
+
+ public SlnProject GetOrCreateProject (string id)
+ {
+ var p = this.FirstOrDefault (s => s.Id.Equals (id, StringComparison.OrdinalIgnoreCase));
+ if (p == null) {
+ p = new SlnProject { Id = id };
+ Add (p);
+ }
+ return p;
+ }
+
+ protected override void InsertItem (int index, SlnProject item)
+ {
+ base.InsertItem (index, item);
+ item.ParentFile = ParentFile;
+ }
+
+ protected override void SetItem (int index, SlnProject item)
+ {
+ base.SetItem (index, item);
+ item.ParentFile = ParentFile;
+ }
+
+ protected override void RemoveItem (int index)
+ {
+ var it = this [index];
+ it.ParentFile = null;
+ base.RemoveItem (index);
+ }
+
+ protected override void ClearItems ()
+ {
+ foreach (var it in this)
+ it.ParentFile = null;
+ base.ClearItems ();
+ }
+ }
+
+ public class SlnSectionCollection: Collection<SlnSection>
+ {
+ SlnFile parentFile;
+
+ internal SlnFile ParentFile {
+ get {
+ return parentFile;
+ }
+ set {
+ parentFile = value;
+ foreach (var it in this)
+ it.ParentFile = parentFile;
+ }
+ }
+
+ public SlnSection GetSection (string id)
+ {
+ return this.FirstOrDefault (s => s.Id == id);
+ }
+
+ public SlnSection GetSection (string id, SlnSectionType sectionType)
+ {
+ return this.FirstOrDefault (s => s.Id == id && s.SectionType == sectionType);
+ }
+
+ public SlnSection GetOrCreateSection (string id, SlnSectionType sectionType)
+ {
+ if (id == null)
+ throw new ArgumentNullException ("id");
+ var sec = this.FirstOrDefault (s => s.Id == id);
+ if (sec == null) {
+ sec = new SlnSection { Id = id };
+ sec.SectionType = sectionType;
+ Add (sec);
+ }
+ return sec;
+ }
+
+ public void RemoveSection (string id)
+ {
+ if (id == null)
+ throw new ArgumentNullException ("id");
+ var s = GetSection (id);
+ if (s != null)
+ Remove (s);
+ }
+
+ protected override void InsertItem (int index, SlnSection item)
+ {
+ base.InsertItem (index, item);
+ item.ParentFile = ParentFile;
+ }
+
+ protected override void SetItem (int index, SlnSection item)
+ {
+ base.SetItem (index, item);
+ item.ParentFile = ParentFile;
+ }
+
+ protected override void RemoveItem (int index)
+ {
+ var it = this [index];
+ it.ParentFile = null;
+ base.RemoveItem (index);
+ }
+
+ protected override void ClearItems ()
+ {
+ foreach (var it in this)
+ it.ParentFile = null;
+ base.ClearItems ();
+ }
+ }
+
+ public class SlnPropertySetCollection: Collection<SlnPropertySet>
+ {
+ SlnSection parentSection;
+
+ internal SlnPropertySetCollection (SlnSection parentSection)
+ {
+ this.parentSection = parentSection;
+ }
+
+ public SlnPropertySet GetPropertySet (string id, bool ignoreCase = false)
+ {
+ var sc = ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
+ return this.FirstOrDefault (s => s.Id.Equals (id, sc));
+ }
+
+ public SlnPropertySet GetOrCreatePropertySet (string id, bool ignoreCase = false)
+ {
+ var ps = GetPropertySet (id, ignoreCase);
+ if (ps == null) {
+ ps = new SlnPropertySet (id);
+ Add (ps);
+ }
+ return ps;
+ }
+
+ protected override void InsertItem (int index, SlnPropertySet item)
+ {
+ base.InsertItem (index, item);
+ item.ParentSection = parentSection;
+ }
+
+ protected override void SetItem (int index, SlnPropertySet item)
+ {
+ base.SetItem (index, item);
+ item.ParentSection = parentSection;
+ }
+
+ protected override void RemoveItem (int index)
+ {
+ var it = this [index];
+ it.ParentSection = null;
+ base.RemoveItem (index);
+ }
+
+ protected override void ClearItems ()
+ {
+ foreach (var it in this)
+ it.ParentSection = null;
+ base.ClearItems ();
+ }
+ }
+
+ class InvalidSolutionFormatException: Exception
+ {
+ public InvalidSolutionFormatException (int line): base ("Invalid format in line " + line)
+ {
+ }
+
+ public InvalidSolutionFormatException (int line, string msg): base ("Invalid format in line " + line + ": " + msg)
+ {
+
+ }
+ }
+
+ public enum SlnSectionType
+ {
+ PreProcess,
+ PostProcess
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/SlnFileFormat.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/SlnFileFormat.cs
new file mode 100644
index 0000000000..84d44984aa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/SlnFileFormat.cs
@@ -0,0 +1,782 @@
+//
+// SlnFileFormat.cs
+//
+// Author:
+// Ankit Jain <jankit@novell.com>
+//
+// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+using System.Text.RegularExpressions;
+
+using MonoDevelop.Projects;
+using MonoDevelop.Core.Serialization;
+using MonoDevelop.Projects.Extensions;
+using MonoDevelop.Core;
+using System.Reflection;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ class SlnFileFormat
+ {
+ MSBuildFileFormat format;
+
+ public SlnFileFormat (MSBuildFileFormat format)
+ {
+ this.format = format;
+ }
+
+ public string GetValidFormatName (object obj, string fileName, MSBuildFileFormat format)
+ {
+ return Path.ChangeExtension (fileName, ".sln");
+ }
+
+ public bool CanReadFile (string file, MSBuildFileFormat format)
+ {
+ if (String.Compare (Path.GetExtension (file), ".sln", StringComparison.OrdinalIgnoreCase) == 0) {
+ string version = SlnFile.GetFileVersion (file);
+ return format.SupportsSlnVersion (version);
+ }
+ return false;
+ }
+
+ public bool CanWriteFile (object obj, MSBuildFileFormat format)
+ {
+ return obj is Solution;
+ }
+
+ public Task WriteFile (string file, object obj, bool saveProjects, ProgressMonitor monitor)
+ {
+ return Task.Run (delegate {
+ Solution sol = (Solution)obj;
+
+ try {
+ monitor.BeginTask (GettextCatalog.GetString ("Saving solution: {0}", file), 1);
+ WriteFileInternal (file, file, sol, saveProjects, monitor);
+ } catch (Exception ex) {
+ monitor.ReportError (GettextCatalog.GetString ("Could not save solution: {0}", file), ex);
+ LoggingService.LogError (GettextCatalog.GetString ("Could not save solution: {0}", file), ex);
+ throw;
+ } finally {
+ monitor.EndTask ();
+ }
+ });
+ }
+
+ void WriteFileInternal (string file, string sourceFile, Solution solution, bool saveProjects, ProgressMonitor monitor)
+ {
+ if (saveProjects) {
+ var items = solution.GetAllSolutionItems ().ToArray ();
+ monitor.BeginTask (items.Length + 1);
+ foreach (var item in items) {
+ try {
+ monitor.BeginStep ();
+ item.SavingSolution = true;
+ item.SaveAsync (monitor).Wait ();
+ } finally {
+ item.SavingSolution = false;
+ }
+ }
+ } else {
+ monitor.BeginTask (1);
+ monitor.BeginStep ();
+ }
+
+ SlnFile sln = new SlnFile ();
+ sln.FileName = file;
+ if (File.Exists (sourceFile)) {
+ try {
+ sln.Read (sourceFile);
+ } catch (Exception ex) {
+ LoggingService.LogError ("Existing solution can't be updated since it can't be read", ex);
+ }
+ }
+
+ sln.FormatVersion = format.SlnVersion;
+
+ // Don't modify the product description if it already has a value
+ if (string.IsNullOrEmpty (sln.ProductDescription))
+ sln.ProductDescription = format.ProductDescription;
+
+ solution.WriteSolution (monitor, sln);
+
+ sln.Write (file);
+ monitor.EndTask ();
+ }
+
+ internal void WriteFileInternal (SlnFile sln, Solution solution, ProgressMonitor monitor)
+ {
+ SolutionFolder c = solution.RootFolder;
+
+ // Delete data for projects that have been removed from the solution
+
+ var currentProjects = new HashSet<string> (solution.GetAllItems<SolutionFolderItem> ().Select (it => it.ItemId));
+ var removedProjects = new HashSet<string> ();
+ if (solution.LoadedProjects != null)
+ removedProjects.UnionWith (solution.LoadedProjects.Except (currentProjects));
+ var unknownProjects = new HashSet<string> (sln.Projects.Select (p => p.Id).Except (removedProjects).Except (currentProjects));
+
+ foreach (var p in removedProjects) {
+ var ps = sln.Projects.GetProject (p);
+ if (ps != null)
+ sln.Projects.Remove (ps);
+ var pc = sln.ProjectConfigurationsSection.GetPropertySet (p, true);
+ if (pc != null)
+ sln.ProjectConfigurationsSection.Remove (pc);
+ }
+ var secNested = sln.Sections.GetSection ("NestedProjects");
+ if (secNested != null) {
+ foreach (var np in secNested.Properties.ToArray ()) {
+ if (removedProjects.Contains (np.Key) || removedProjects.Contains (np.Value))
+ secNested.Properties.Remove (np.Key);
+ }
+ }
+ solution.LoadedProjects = currentProjects;
+
+ //Write the projects
+ using (monitor.BeginTask (GettextCatalog.GetString ("Saving projects"), 1)) {
+ monitor.BeginStep ();
+ WriteProjects (c, sln, monitor, unknownProjects);
+ }
+
+ //FIXME: SolutionConfigurations?
+
+ var pset = sln.SolutionConfigurationsSection;
+ foreach (SolutionConfiguration config in solution.Configurations) {
+ var cid = ToSlnConfigurationId (config);
+ pset.SetValue (cid, cid);
+ }
+
+ WriteProjectConfigurations (solution, sln);
+
+ //Write Nested Projects
+ ICollection<SolutionFolder> folders = solution.RootFolder.GetAllItems<SolutionFolder> ().ToList ();
+ if (folders.Count > 1) {
+ // If folders ==1, that's the root folder
+ var sec = sln.Sections.GetSection ("NestedProjects", SlnSectionType.PreProcess);
+ if (sec == null) {
+ sec = sln.Sections.GetOrCreateSection ("NestedProjects", SlnSectionType.PreProcess);
+ sec.SkipIfEmpty = true; // don't write the section if there are no nested projects after all
+ }
+ foreach (SolutionFolder folder in folders) {
+ if (folder.IsRoot)
+ continue;
+ WriteNestedProjects (folder, solution.RootFolder, sec);
+ }
+ // Remove items which don't have a parent folder
+ var toRemove = solution.GetAllItems<SolutionFolderItem> ().Where (it => it.ParentFolder == solution.RootFolder);
+ foreach (var it in toRemove)
+ sec.Properties.Remove (it.ItemId);
+ }
+
+ // Write custom properties for configurations
+ foreach (SolutionConfiguration conf in solution.Configurations) {
+ string secId = "MonoDevelopProperties." + conf.Id;
+ var sec = sln.Sections.GetOrCreateSection (secId, SlnSectionType.PreProcess);
+ solution.WriteConfigurationData (monitor, sec.Properties, conf);
+ if (sec.IsEmpty)
+ sln.Sections.Remove (sec);
+ }
+ }
+
+ void WriteProjects (SolutionFolder folder, SlnFile sln, ProgressMonitor monitor, HashSet<string> unknownProjects)
+ {
+ monitor.BeginTask (folder.Items.Count);
+ foreach (SolutionFolderItem ce in folder.Items.ToArray ())
+ {
+ monitor.BeginStep ();
+ if (ce is SolutionItem) {
+
+ SolutionItem item = (SolutionItem) ce;
+
+ var proj = sln.Projects.GetOrCreateProject (ce.ItemId);
+ proj.TypeGuid = item.TypeGuid;
+ proj.Name = item.Name;
+ proj.FilePath = FileService.NormalizeRelativePath (FileService.AbsoluteToRelativePath (sln.BaseDirectory, item.FileName)).Replace ('/', '\\');
+
+ var sec = proj.Sections.GetOrCreateSection ("MonoDevelopProperties", SlnSectionType.PreProcess);
+ sec.SkipIfEmpty = true;
+ folder.ParentSolution.WriteSolutionFolderItemData (monitor, sec.Properties, ce);
+
+ if (item.ItemDependencies.Count > 0) {
+ sec = proj.Sections.GetOrCreateSection ("ProjectDependencies", SlnSectionType.PostProcess);
+ sec.Properties.ClearExcept (unknownProjects);
+ foreach (var dep in item.ItemDependencies)
+ sec.Properties.SetValue (dep.ItemId, dep.ItemId);
+ } else
+ proj.Sections.RemoveSection ("ProjectDependencies");
+ } else if (ce is SolutionFolder) {
+ var proj = sln.Projects.GetOrCreateProject (ce.ItemId);
+ proj.TypeGuid = MSBuildProjectService.FolderTypeGuid;
+ proj.Name = ce.Name;
+ proj.FilePath = ce.Name;
+
+ // Folder files
+ WriteFolderFiles (proj, (SolutionFolder) ce);
+
+ //Write custom properties
+ var sec = proj.Sections.GetOrCreateSection ("MonoDevelopProperties", SlnSectionType.PreProcess);
+ sec.SkipIfEmpty = true;
+ folder.ParentSolution.WriteSolutionFolderItemData (monitor, sec.Properties, ce);
+ }
+ if (ce is SolutionFolder)
+ WriteProjects (ce as SolutionFolder, sln, monitor, unknownProjects);
+ }
+ monitor.EndTask ();
+ }
+
+ void WriteFolderFiles (SlnProject proj, SolutionFolder folder)
+ {
+ if (folder.Files.Count > 0) {
+ var sec = proj.Sections.GetOrCreateSection ("SolutionItems", SlnSectionType.PreProcess);
+ sec.Properties.Clear ();
+ foreach (FilePath f in folder.Files) {
+ string relFile = MSBuildProjectService.ToMSBuildPathRelative (folder.ParentSolution.ItemDirectory, f);
+ sec.Properties.SetValue (relFile, relFile);
+ }
+ } else
+ proj.Sections.RemoveSection ("SolutionItems");
+ }
+
+ void WriteProjectConfigurations (Solution sol, SlnFile sln)
+ {
+ var col = sln.ProjectConfigurationsSection;
+
+ foreach (var item in sol.GetAllSolutionItems ()) {
+ // Don't save configurations for shared projects
+ if (!item.SupportsConfigurations ())
+ continue;
+
+ // <ProjectGuid>...</ProjectGuid> in some Visual Studio generated F# project files
+ // are missing "{"..."}" in their guid. This is not generally a problem since it
+ // is a valid GUID format. However the solution file format requires that these are present.
+ string itemGuid = item.ItemId;
+ if (!itemGuid.StartsWith ("{") && !itemGuid.EndsWith ("}"))
+ itemGuid = "{" + itemGuid + "}";
+
+ var pset = col.GetOrCreatePropertySet (itemGuid, ignoreCase:true);
+ var existingKeys = new HashSet<string> (pset.Keys);
+
+ foreach (SolutionConfiguration cc in sol.Configurations) {
+ var cce = cc.GetEntryForItem (item);
+ if (cce == null)
+ continue;
+ var configId = ToSlnConfigurationId (cc);
+ var itemConfigId = ToSlnConfigurationId (cce.ItemConfiguration);
+
+ string key;
+ pset.SetValue (key = configId + ".ActiveCfg", itemConfigId);
+ existingKeys.Remove (key);
+
+ if (cce.Build) {
+ pset.SetValue (key = configId + ".Build.0", itemConfigId);
+ existingKeys.Remove (key);
+ }
+
+ if (cce.Deploy) {
+ pset.SetValue (key = configId + ".Deploy.0", itemConfigId);
+ existingKeys.Remove (key);
+ }
+ }
+ foreach (var k in existingKeys)
+ pset.Remove (k);
+ }
+ }
+
+ void WriteNestedProjects (SolutionFolder folder, SolutionFolder root, SlnSection sec)
+ {
+ foreach (SolutionFolderItem ce in folder.Items)
+ sec.Properties.SetValue (ce.ItemId, folder.ItemId);
+ }
+
+ List<string> ReadSolutionItemDependencies (SlnProject proj)
+ {
+ // Find a project section of type ProjectDependencies
+ var sec = proj.Sections.GetSection ("ProjectDependencies");
+ if (sec == null)
+ return null;
+
+ return sec.Properties.Keys.ToList ();
+ }
+
+ IEnumerable<string> ReadFolderFiles (SlnProject proj)
+ {
+ // Find a solution item section of type SolutionItems
+ var sec = proj.Sections.GetSection ("SolutionItems");
+ if (sec == null)
+ return new string[0];
+
+ return sec.Properties.Keys.ToList ();
+ }
+
+ void DeserializeSolutionItem (ProgressMonitor monitor, Solution sln, SolutionFolderItem item, SlnProject proj)
+ {
+ // Deserialize the object
+ var sec = proj.Sections.GetSection ("MonoDevelopProperties");
+ if (sec == null)
+ return;
+
+ sln.ReadSolutionFolderItemData (monitor, sec.Properties, item);
+ }
+
+ string ToSlnConfigurationId (ItemConfiguration configuration)
+ {
+ if (configuration.Platform.Length == 0)
+ return configuration.Name + "|Any CPU";
+ else
+ return configuration.Name + "|" + configuration.Platform;
+ }
+
+ string FromSlnConfigurationId (string configId)
+ {
+ int i = configId.IndexOf ('|');
+ if (i != -1) {
+ if (configId.Substring (i+1) == "Any CPU")
+ return configId.Substring (0, i);
+ }
+ return configId;
+ }
+
+ string ToSlnConfigurationId (string configId)
+ {
+ if (configId.IndexOf ('|') == -1)
+ return configId + "|Any CPU";
+ else
+ return configId;
+ }
+
+ //Reader
+ public async Task<object> ReadFile (string fileName, ProgressMonitor monitor)
+ {
+ if (fileName == null || monitor == null)
+ return null;
+
+ var sol = new Solution (true);
+ sol.FileName = fileName;
+ sol.FileFormat = format;
+
+ try {
+ monitor.BeginTask (string.Format (GettextCatalog.GetString ("Loading solution: {0}"), fileName), 1);
+ monitor.BeginStep ();
+ await sol.OnBeginLoad ();
+ var projectLoadMonitor = monitor as ProjectLoadProgressMonitor;
+ if (projectLoadMonitor != null)
+ projectLoadMonitor.CurrentSolution = sol;
+ await Task.Factory.StartNew (() => {
+ sol.ReadSolution (monitor);
+ });
+ } catch (Exception ex) {
+ monitor.ReportError (GettextCatalog.GetString ("Could not load solution: {0}", fileName), ex);
+ sol.OnEndLoad ().Wait ();
+ sol.NotifyItemReady ();
+ monitor.EndTask ();
+ throw;
+ }
+ await sol.OnEndLoad ();
+ sol.NotifyItemReady ();
+ monitor.EndTask ();
+ return sol;
+ }
+
+ internal void LoadSolution (Solution sol, SlnFile sln, ProgressMonitor monitor, SolutionLoadContext ctx)
+ {
+ var version = sln.FormatVersion;
+
+ //Parse the .sln file
+ var folder = sol.RootFolder;
+ sol.Version = "0.1"; //FIXME:
+
+ monitor.BeginTask("Loading projects ..", sln.Projects.Count + 1);
+ Dictionary<string, SolutionFolderItem> items = new Dictionary<string, SolutionFolderItem> ();
+ List<string> sortedList = new List<string> ();
+
+ List<Task> loadTasks = new List<Task> ();
+
+ foreach (SlnProject sec in sln.Projects) {
+ try {
+ // Valid guid?
+ new Guid (sec.TypeGuid);
+ } catch (FormatException) {
+ monitor.Step (1);
+ //Use default guid as projectGuid
+ LoggingService.LogDebug (GettextCatalog.GetString (
+ "Invalid Project type guid '{0}' on line #{1}. Ignoring.",
+ sec.Id,
+ sec.Line));
+ continue;
+ }
+
+ string projTypeGuid = sec.TypeGuid.ToUpper ();
+ string projectName = sec.Name;
+ string projectPath = sec.FilePath;
+ string projectGuid = sec.Id;
+
+ lock (items)
+ sortedList.Add (projectGuid);
+
+ if (projTypeGuid == MSBuildProjectService.FolderTypeGuid) {
+ //Solution folder
+ SolutionFolder sfolder = new SolutionFolder ();
+ sfolder.Name = projectName;
+ sfolder.ItemId = projectGuid;
+
+ DeserializeSolutionItem (monitor, sol, sfolder, sec);
+
+ foreach (string f in ReadFolderFiles (sec))
+ sfolder.Files.Add (MSBuildProjectService.FromMSBuildPath (Path.GetDirectoryName (sol.FileName), f));
+
+ lock (items)
+ items.Add (projectGuid, sfolder);
+
+ monitor.Step (1);
+ continue;
+ }
+
+ if (projectPath.StartsWith("http://")) {
+ monitor.ReportWarning (GettextCatalog.GetString (
+ "{0}({1}): Projects with non-local source (http://...) not supported. '{2}'.",
+ sol.FileName, sec.Line, projectPath));
+ monitor.Step (1);
+ continue;
+ }
+
+ string path = MSBuildProjectService.FromMSBuildPath (Path.GetDirectoryName (sol.FileName), projectPath);
+ if (String.IsNullOrEmpty (path)) {
+ monitor.ReportWarning (GettextCatalog.GetString (
+ "Invalid project path found in {0} : {1}", sol.FileName, projectPath));
+ LoggingService.LogWarning (GettextCatalog.GetString (
+ "Invalid project path found in {0} : {1}", sol.FileName, projectPath));
+ monitor.Step (1);
+ continue;
+ }
+
+ projectPath = Path.GetFullPath (path);
+
+ SolutionItem item = null;
+ Task<SolutionItem> loadTask;
+ DateTime ti = DateTime.Now;
+
+ if (sol.IsSolutionItemEnabled (projectPath)) {
+ loadTask = Services.ProjectService.ReadSolutionItem (monitor, projectPath, format, projTypeGuid, projectGuid, ctx);
+ } else {
+ loadTask = Task.FromResult<SolutionItem> (new UnloadedSolutionItem () {
+ FileName = projectPath
+ });
+ }
+
+ var ft = loadTask.ContinueWith (ta => {
+ try {
+ item = ta.Result;
+ if (item == null)
+ throw new UnknownSolutionItemTypeException (projTypeGuid);
+ } catch (Exception cex) {
+ var e = UnwrapException (cex).First ();
+
+ string unsupportedMessage = e.Message;
+
+ if (e is UserException) {
+ var ex = (UserException) e;
+ LoggingService.LogError ("{0}: {1}", ex.Message, ex.Details);
+ monitor.ReportError (string.Format ("{0}{1}{1}{2}", ex.Message, Environment.NewLine, ex.Details), null);
+ } else {
+ LoggingService.LogError (string.Format ("Error while trying to load the project {0}", projectPath), e);
+ monitor.ReportWarning (GettextCatalog.GetString (
+ "Error while trying to load the project '{0}': {1}", projectPath, e.Message));
+ }
+
+ SolutionItem uitem;
+ uitem = new UnknownSolutionItem () {
+ FileName = projectPath,
+ LoadError = unsupportedMessage,
+ };
+ item = uitem;
+ item.ItemId = projectGuid;
+ item.TypeGuid = projTypeGuid;
+ }
+
+ item.UnresolvedProjectDependencies = ReadSolutionItemDependencies (sec);
+
+ // Deserialize the object
+ DeserializeSolutionItem (monitor, sol, item, sec);
+
+ lock (items) {
+ if (!items.ContainsKey (projectGuid)) {
+ items.Add (projectGuid, item);
+ } else {
+ monitor.ReportError (GettextCatalog.GetString ("Invalid solution file. There are two projects with the same GUID. The project {0} will be ignored.", projectPath), null);
+ }
+ }
+ monitor.Step (1);
+ });
+ loadTasks.Add (ft);
+
+ // Limit the number of concurrent tasks. Por solutions with many projects, spawning one thread per
+ // project makes the whole load process slower.
+ loadTasks.RemoveAll (t => t.IsCompleted);
+ if (loadTasks.Count > 4)
+ Task.WaitAny (loadTasks.ToArray ());
+ }
+
+ Task.WaitAll (loadTasks.ToArray ());
+
+ sol.LoadedProjects = new HashSet<string> (items.Keys);
+
+ var nested = sln.Sections.GetSection ("NestedProjects");
+ if (nested != null)
+ LoadNestedProjects (nested, items, monitor);
+
+ // Resolve project dependencies
+ foreach (var it in items.Values.OfType<SolutionItem> ()) {
+ if (it.UnresolvedProjectDependencies != null) {
+ foreach (var id in it.UnresolvedProjectDependencies.ToArray ()) {
+ SolutionFolderItem dep;
+ if (items.TryGetValue (id, out dep) && dep is SolutionItem) {
+ it.UnresolvedProjectDependencies.Remove (id);
+ it.ItemDependencies.Add ((SolutionItem)dep);
+ }
+ }
+ if (it.UnresolvedProjectDependencies.Count == 0)
+ it.UnresolvedProjectDependencies = null;
+ }
+ }
+
+ //Add top level folders and projects to the main folder
+ foreach (string id in sortedList) {
+ SolutionFolderItem ce;
+ if (items.TryGetValue (id, out ce) && ce.ParentFolder == null)
+ folder.Items.Add (ce);
+ }
+
+ //FIXME: This can be just SolutionConfiguration also!
+ LoadSolutionConfigurations (sln.SolutionConfigurationsSection, sol, monitor);
+
+ LoadProjectConfigurationMappings (sln.ProjectConfigurationsSection, sol, items, monitor);
+
+ foreach (var e in sln.Sections) {
+ string name = e.Id;
+ if (name.StartsWith ("MonoDevelopProperties.")) {
+ int i = name.IndexOf ('.');
+ LoadMonoDevelopConfigurationProperties (name.Substring (i+1), e, sol, monitor);
+ }
+ }
+
+ monitor.EndTask ();
+ }
+
+ IEnumerable<Exception> UnwrapException (Exception ex)
+ {
+ var a = ex as AggregateException;
+ if (a != null) {
+ foreach (var e in a.InnerExceptions) {
+ foreach (var u in UnwrapException (e))
+ yield return u;
+ }
+ } else if (ex is TargetInvocationException) {
+ // If we get a TargetInvocationException from using Activator.CreateInstance we
+ // need to unwrap the real exception
+ ex = ex.InnerException;
+ foreach (var e in UnwrapException (ex))
+ yield return e;
+ }
+ else
+ yield return ex;
+ }
+
+ void LoadProjectConfigurationMappings (SlnPropertySetCollection sets, Solution sln, Dictionary<string, SolutionFolderItem> items, ProgressMonitor monitor)
+ {
+ if (sets == null)
+ return;
+
+ Dictionary<string, SolutionConfigurationEntry> cache = new Dictionary<string, SolutionConfigurationEntry> ();
+ Dictionary<string, string> ignoredProjects = new Dictionary<string, string> ();
+
+ foreach (var pset in sets) {
+
+ var projGuid = pset.Id;
+
+ if (!items.ContainsKey (projGuid)) {
+ if (ignoredProjects.ContainsKey (projGuid))
+ // already warned
+ continue;
+
+ LoggingService.LogWarning (GettextCatalog.GetString ("{0} ({1}) : Project with guid = '{2}' not found or not loaded. Ignoring",
+ sln.FileName, pset.Line + 1, projGuid));
+ ignoredProjects [projGuid] = projGuid;
+ continue;
+ }
+
+ SolutionFolderItem it;
+ if (!items.TryGetValue (projGuid, out it))
+ continue;
+
+ SolutionItem item = it as SolutionItem;
+
+ if (item == null || !item.SupportsConfigurations ())
+ continue;
+
+ //Format:
+ // {projectGuid}.SolutionConfigName|SolutionPlatform.ActiveCfg = ProjConfigName|ProjPlatform
+ // {projectGuid}.SolutionConfigName|SolutionPlatform.Build.0 = ProjConfigName|ProjPlatform
+ // {projectGuid}.SolutionConfigName|SolutionPlatform.Deploy.0 = ProjConfigName|ProjPlatform
+
+ foreach (var prop in pset) {
+ string action;
+ string projConfig = prop.Value;
+
+ string left = prop.Key;
+ if (left.EndsWith (".ActiveCfg")) {
+ action = "ActiveCfg";
+ left = left.Substring (0, left.Length - 10);
+ } else if (left.EndsWith (".Build.0")) {
+ action = "Build.0";
+ left = left.Substring (0, left.Length - 8);
+ } else if (left.EndsWith (".Deploy.0")) {
+ action = "Deploy.0";
+ left = left.Substring (0, left.Length - 9);
+ } else {
+ LoggingService.LogWarning (GettextCatalog.GetString ("{0} ({1}) : Unknown action. Only ActiveCfg, Build.0 and Deploy.0 supported.",
+ sln.FileName, pset.Line));
+ continue;
+ }
+
+ string slnConfig = left;
+
+ string key = projGuid + "." + slnConfig;
+ SolutionConfigurationEntry combineConfigEntry = null;
+ if (cache.ContainsKey (key)) {
+ combineConfigEntry = cache [key];
+ } else {
+ combineConfigEntry = GetConfigEntry (sln, item, slnConfig);
+ combineConfigEntry.Build = false; // Not buildable by default. Build will be enabled if a Build.0 entry is found
+ cache [key] = combineConfigEntry;
+ }
+
+ /* If both ActiveCfg & Build.0 entries are missing
+ * for a project, then default values :
+ * ActiveCfg : same as the solution config
+ * Build : true
+ *
+ * ELSE
+ * if Build (true/false) for the project will
+ * will depend on presence/absence of Build.0 entry
+ */
+
+ if (action == "ActiveCfg") {
+ combineConfigEntry.ItemConfiguration = FromSlnConfigurationId (projConfig);
+ } else if (action == "Build.0") {
+ combineConfigEntry.Build = true;
+ } else if (action == "Deploy.0") {
+ combineConfigEntry.Deploy = true;
+ }
+ }
+ }
+ }
+
+ /* Gets the CombineConfigurationEntry corresponding to the @entry in its parentCombine's
+ * CombineConfiguration. Creates the required bits if not present */
+ SolutionConfigurationEntry GetConfigEntry (Solution sol, SolutionItem item, string configName)
+ {
+ configName = FromSlnConfigurationId (configName);
+
+ SolutionConfiguration solutionConfig = sol.Configurations [configName];
+ if (solutionConfig == null) {
+ solutionConfig = CreateSolutionConfigurationFromId (configName);
+ sol.Configurations.Add (solutionConfig);
+ }
+
+ SolutionConfigurationEntry conf = solutionConfig.GetEntryForItem (item);
+ if (conf != null)
+ return conf;
+ return solutionConfig.AddItem (item);
+ }
+
+ void LoadSolutionConfigurations (SlnPropertySet sec, Solution solution, ProgressMonitor monitor)
+ {
+ if (sec == null)
+ return;
+
+ foreach (var pair in sec) {
+
+ string configId = FromSlnConfigurationId (pair.Key);
+ SolutionConfiguration config = solution.Configurations [configId];
+
+ if (config == null) {
+ config = CreateSolutionConfigurationFromId (configId);
+ solution.Configurations.Add (config);
+ }
+ }
+ }
+
+ SolutionConfiguration CreateSolutionConfigurationFromId (string fullId)
+ {
+ return new SolutionConfiguration (fullId);
+ }
+
+ void LoadMonoDevelopConfigurationProperties (string configName, SlnSection sec, Solution sln, ProgressMonitor monitor)
+ {
+ SolutionConfiguration config = sln.Configurations [configName];
+ if (config == null)
+ return;
+ sln.ReadConfigurationData (monitor, sec.Properties, config);
+ }
+
+ void LoadNestedProjects (SlnSection sec, IDictionary<string, SolutionFolderItem> entries, ProgressMonitor monitor)
+ {
+ if (sec == null || sec.SectionType != SlnSectionType.PreProcess)
+ return;
+
+ foreach (var kvp in sec.Properties) {
+ // Guids should be upper case for VS compatibility
+ var pair = new KeyValuePair<string, string> (kvp.Key.ToUpper (), kvp.Value.ToUpper ());
+
+ SolutionFolderItem folderItem;
+ SolutionFolderItem item;
+
+ if (!entries.TryGetValue (pair.Value, out folderItem)) {
+ //Container not found
+ LoggingService.LogWarning (GettextCatalog.GetString ("Project with guid '{0}' not found.", pair.Value));
+ continue;
+ }
+
+ SolutionFolder folder = folderItem as SolutionFolder;
+ if (folder == null) {
+ LoggingService.LogWarning (GettextCatalog.GetString ("Item with guid '{0}' is not a folder.", pair.Value));
+ continue;
+ }
+
+ if (!entries.TryGetValue (pair.Key, out item)) {
+ //Containee not found
+ LoggingService.LogWarning (GettextCatalog.GetString ("Project with guid '{0}' not found.", pair.Key));
+ continue;
+ }
+
+ folder.Items.Add (item);
+ }
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/TargetsAvailableCondition.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/TargetsAvailableCondition.cs
new file mode 100644
index 0000000000..4057b33d8d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/TargetsAvailableCondition.cs
@@ -0,0 +1,60 @@
+//
+// TargetAvailableCondition.cs
+//
+// Author: Jeffrey Stedfast <jeff@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.IO;
+using System.Text;
+using System.Collections.Generic;
+
+using Mono.Addins;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Assemblies;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public class TargetsAvailableCondition : ConditionType
+ {
+ public override bool Evaluate (NodeElement conditionNode)
+ {
+ var target = conditionNode.GetAttribute ("target");
+
+ if (string.IsNullOrEmpty (target))
+ return false;
+
+ string msbuild = Runtime.SystemAssemblyService.CurrentRuntime.GetMSBuildExtensionsPath ();
+ Dictionary<string, string> variables = new Dictionary<string, string> (StringComparer.OrdinalIgnoreCase) {
+ { "MSBuildExtensionsPath64", msbuild },
+ { "MSBuildExtensionsPath32", msbuild },
+ { "MSBuildExtensionsPath", msbuild }
+ };
+
+ string path = StringParserService.Parse (target, variables);
+ if (Path.DirectorySeparatorChar != '\\')
+ path = path.Replace ('\\', Path.DirectorySeparatorChar);
+
+ return File.Exists (path);
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/UnknownSolutionItemTypeException.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/UnknownSolutionItemTypeException.cs
new file mode 100644
index 0000000000..d1d977b40e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/UnknownSolutionItemTypeException.cs
@@ -0,0 +1,64 @@
+//
+// UnknownSolutionItemTypeException.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Xml;
+using System.IO;
+using System.Collections;
+using System.Collections.Generic;
+using System.Reflection;
+using MonoDevelop.Core;
+using MonoDevelop.Projects;
+using MonoDevelop.Core.Serialization;
+using MonoDevelop.Core.Assemblies;
+using MonoDevelop.Projects.MD1;
+using MonoDevelop.Projects.Extensions;
+using Mono.Addins;
+using System.Linq;
+using MonoDevelop.Core.Instrumentation;
+using MonoDevelop.Core.ProgressMonitoring;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+
+ class UnknownSolutionItemTypeException : InvalidOperationException
+ {
+ public UnknownSolutionItemTypeException ()
+ : base ("Unknown solution item type")
+ {
+ }
+
+ public UnknownSolutionItemTypeException (string name)
+ : base ("Unknown solution item type: " + name)
+ {
+ this.TypeName = name;
+ }
+
+ public string TypeName { get; private set; }
+ }
+
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/DotNetNamingPolicy.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/DotNetNamingPolicy.cs
index 882004de7c..919e65c6fd 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/DotNetNamingPolicy.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/DotNetNamingPolicy.cs
@@ -58,22 +58,6 @@ namespace MonoDevelop.Projects.Policies
return other != null && other.DirectoryNamespaceAssociation == DirectoryNamespaceAssociation
&& other.ResourceNamePolicy == ResourceNamePolicy;
}
-
- internal static ResourceNamePolicy GetDefaultResourceNamePolicy (object ob)
- {
- FileFormat format = null;
- if (ob is SolutionEntityItem)
- format = ((SolutionEntityItem)ob).FileFormat;
- else if (ob is SolutionItem)
- format = ((SolutionItem)ob).ParentSolution.FileFormat;
- else if (ob is Solution)
- format = ((Solution)ob).FileFormat;
-
- if (format != null && format.Name.StartsWith ("MSBuild"))
- return ResourceNamePolicy.MSBuild;
- else
- return ResourceNamePolicy.FileName;
- }
}
public enum DirectoryNamespaceAssociation
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicyBag.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicyBag.cs
index 074bcc8d0d..4d8ce0d6be 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicyBag.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicyBag.cs
@@ -42,7 +42,7 @@ namespace MonoDevelop.Projects.Policies
[DataItem ("Policies")]
public class PolicyBag: PolicyContainer, ICustomDataItem
{
- public PolicyBag (SolutionItem owner)
+ public PolicyBag (SolutionFolderItem owner)
{
this.Owner = owner;
}
@@ -51,7 +51,7 @@ namespace MonoDevelop.Projects.Policies
{
}
- public SolutionItem Owner { get; internal set; }
+ public SolutionFolderItem Owner { get; internal set; }
public override bool IsRoot {
get { return Owner == null || Owner.ParentFolder == null; }
@@ -107,7 +107,7 @@ namespace MonoDevelop.Projects.Policies
{
SolutionFolder solFol = Owner as SolutionFolder;
if (solFol != null)
- foreach (SolutionItem item in solFol.Items)
+ foreach (SolutionFolderItem item in solFol.Items)
if (!item.Policies.DirectHas (args.PolicyType, args.Scope))
item.Policies.OnPolicyChanged (args.PolicyType, args.Scope);
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicyDictionary.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicyDictionary.cs
index c07aa081e6..168d5dfe4d 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicyDictionary.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicyDictionary.cs
@@ -97,7 +97,7 @@ namespace MonoDevelop.Projects.Policies
public void Add (ScopedPolicy scopedPolicy)
{
- Add (new PolicyKey (scopedPolicy.PolicyType, scopedPolicy.Scope), scopedPolicy.Policy);
+ this[new PolicyKey (scopedPolicy.PolicyType, scopedPolicy.Scope)] = scopedPolicy.Policy;
}
public bool ContainsKey (Type policyType, string scope)
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicyService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicyService.cs
index e3604edc2d..ea5dfd7104 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicyService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicyService.cs
@@ -1192,7 +1192,7 @@ namespace MonoDevelop.Projects.Policies
static string GetPolicyFile (PolicySet set)
{
- return PoliciesFolder.Combine ((set.Name ?? set.Id) + ".mdpolicy.xml");
+ return PoliciesFolder.Combine ((set.Id ?? set.Name) + ".mdpolicy.xml");
}
static void LoadPolicies ()
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProject.cs
index 112b9e8fb0..6c2dc55ffc 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProject.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProject.cs
@@ -1,4 +1,4 @@
-//
+//
// SharedProject.cs
//
// Author:
@@ -31,34 +31,174 @@ using MonoDevelop.Core;
using System.IO;
using System.Xml;
using MonoDevelop.Projects.Policies;
+using System.Threading.Tasks;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.Projects.SharedAssetsProjects
{
- public class SharedAssetsProject: Project, IDotNetFileContainer
+ [ExportProjectType ("{D954291E-2A0B-460D-934E-DC6B0785DB48}", Extension="shproj", Alias="SharedAssetsProject")]
+ public sealed class SharedAssetsProject: Project, IDotNetFileContainer
{
Solution currentSolution;
- IDotNetLanguageBinding languageBinding;
+ LanguageBinding languageBinding;
string languageName;
FilePath projItemsPath;
+ MSBuildProject projitemsProject;
+ HashSet<MSBuildItem> usedMSBuildItems = new HashSet<MSBuildItem> ();
+
+ const string CSharptargets = @"$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets";
+ const string FSharptargets = @"$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.FSharp.targets";
public SharedAssetsProject ()
{
+ Initialize (this);
}
- public SharedAssetsProject (string language)
+ public SharedAssetsProject (string language): this ()
{
languageName = language;
}
- public SharedAssetsProject (ProjectCreateInformation projectCreateInfo, XmlElement projectOptions)
+ protected override void OnNameChanged (SolutionItemRenamedEventArgs e)
{
+ if (!projItemsPath.IsNullOrEmpty && Path.GetFileNameWithoutExtension (e.OldName) == projItemsPath.FileNameWithoutExtension) {
+ // We are going to rename the projitems file, but before that, let's get all referencing projects, since they reference
+ // using the old path
+ string oldPath = ProjItemsPath;
+ var refProjects = GetReferencingProjects ().ToArray ();
+
+ // Set the new projitems file name
+ projItemsPath = projItemsPath.ParentDirectory.Combine (e.NewName) + projItemsPath.Extension;
+
+ // Update all referencing projects
+ foreach (var p in refProjects) {
+ var sr = p.References.FirstOrDefault (r => r.GetItemsProjectPath () == oldPath);
+ if (sr != null)
+ sr.SetItemsProjectPath (ProjItemsPath);
+ }
+ }
+ base.OnNameChanged (e);
+ }
+
+ protected override void OnInitializeFromTemplate (ProjectCreateInformation projectCreateInfo, XmlElement projectOptions)
+ {
+ base.OnInitializeFromTemplate (projectCreateInfo, projectOptions);
languageName = projectOptions.GetAttribute ("language");
DefaultNamespace = projectCreateInfo.ProjectName;
}
- internal protected override List<FilePath> OnGetItemFiles (bool includeReferencedFiles)
+ protected override void OnReadProject (ProgressMonitor monitor, MSBuildProject msproject)
+ {
+ base.OnReadProject (monitor, msproject);
+
+ var import = msproject.Imports.FirstOrDefault (im => im.Label == "Shared");
+ if (import == null)
+ return;
+
+ // TODO: load the type from msbuild
+ foreach (var item in msproject.Imports) {
+ if (item.Project.Equals (CSharptargets, StringComparison.OrdinalIgnoreCase)) {
+ LanguageName = "C#";
+ break;
+ }
+ if (item.Project.Equals (FSharptargets, StringComparison.OrdinalIgnoreCase)) {
+ LanguageName = "F#";
+ break;
+ }
+ }
+ //If for some reason the language name is empty default it to C#
+ if (String.IsNullOrEmpty(LanguageName))
+ LanguageName = "C#";
+
+ projItemsPath = MSBuildProjectService.FromMSBuildPath (msproject.BaseDirectory, import.Project);
+
+ MSBuildProject p = new MSBuildProject (msproject.EngineManager);
+ p.Load (projItemsPath);
+ p.Evaluate ();
+
+ var cp = p.PropertyGroups.FirstOrDefault (g => g.Label == "Configuration");
+ if (cp != null)
+ DefaultNamespace = cp.GetValue ("Import_RootNamespace");
+
+ LoadProjectItems (p, ProjectItemFlags.None, usedMSBuildItems);
+
+ projitemsProject = p;
+ }
+
+ internal override void SaveProjectItems (ProgressMonitor monitor, MSBuildProject msproject, HashSet<MSBuildItem> loadedItems, string pathPrefix)
{
- var list = base.OnGetItemFiles (includeReferencedFiles);
+ // Save project items in the .projitems file
+ base.SaveProjectItems (monitor, projitemsProject, usedMSBuildItems, "$(MSBuildThisFileDirectory)");
+ }
+
+ protected override void OnWriteProject (ProgressMonitor monitor, MonoDevelop.Projects.MSBuild.MSBuildProject msproject)
+ {
+ if (projItemsPath == FilePath.Null)
+ projItemsPath = Path.ChangeExtension (FileName, ".projitems");
+
+ if (projitemsProject == null) {
+ projitemsProject = new MSBuildProject (msproject.EngineManager);
+ projitemsProject.FileName = projItemsPath;
+ var grp = projitemsProject.GetGlobalPropertyGroup ();
+ if (grp == null)
+ grp = projitemsProject.AddNewPropertyGroup (false);
+ grp.SetValue ("MSBuildAllProjects", "$(MSBuildAllProjects);$(MSBuildThisFileFullPath)");
+ grp.SetValue ("HasSharedItems", true);
+ grp.SetValue ("SharedGUID", ItemId, preserveExistingCase:true);
+ }
+
+ IMSBuildPropertySet configGrp = projitemsProject.PropertyGroups.FirstOrDefault (g => g.Label == "Configuration");
+ if (configGrp == null) {
+ configGrp = projitemsProject.AddNewPropertyGroup (true);
+ configGrp.Label = "Configuration";
+ }
+ configGrp.SetValue ("Import_RootNamespace", DefaultNamespace);
+
+ base.OnWriteProject (monitor, msproject);
+
+ var newProject = FileName == null || projitemsProject.IsNewProject;
+ if (newProject) {
+ var grp = msproject.GetGlobalPropertyGroup ();
+ if (grp == null)
+ grp = msproject.AddNewPropertyGroup (false);
+ grp.SetValue ("ProjectGuid", ItemId, preserveExistingCase:true);
+ var import = msproject.AddNewImport (@"$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props");
+ import.Condition = @"Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')";
+ msproject.AddNewImport (@"$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props");
+ msproject.AddNewImport (@"$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props");
+ import = msproject.AddNewImport (MSBuildProjectService.ToMSBuildPath (FileName.ParentDirectory, projItemsPath));
+ import.Label = "Shared";
+ if (LanguageName.Equals("C#", StringComparison.OrdinalIgnoreCase)) {
+ msproject.AddNewImport (CSharptargets);
+ }
+ else if (LanguageName.Equals("F#", StringComparison.OrdinalIgnoreCase)) {
+ msproject.AddNewImport (FSharptargets);
+ }
+
+ } else {
+ var itemsImport = msproject.Imports.FirstOrDefault (i => i.Label == "Shared");
+ if (itemsImport != null)
+ itemsImport.Project = MSBuildProjectService.ToMSBuildPath (FileName.ParentDirectory, projItemsPath);
+ else {
+ var import = msproject.AddNewImport (MSBuildProjectService.ToMSBuildPath (FileName.ParentDirectory, projItemsPath));
+ import.Label = "Shared";
+ }
+ }
+
+ // having no ToolsVersion is equivalent to 2.0, roundtrip that correctly
+ if (ToolsVersion != "2.0")
+ msproject.ToolsVersion = ToolsVersion;
+ else if (string.IsNullOrEmpty (msproject.ToolsVersion))
+ msproject.ToolsVersion = null;
+ else
+ msproject.ToolsVersion = "2.0";
+
+ projitemsProject.Save (projItemsPath);
+ }
+
+ protected override IEnumerable<FilePath> OnGetItemFiles (bool includeReferencedFiles)
+ {
+ var list = base.OnGetItemFiles (includeReferencedFiles).ToList ();
if (!string.IsNullOrEmpty (FileName))
list.Add (ProjItemsPath);
return list;
@@ -80,57 +220,56 @@ namespace MonoDevelop.Projects.SharedAssetsProjects
}
}
- public override IEnumerable<string> GetProjectTypes ()
+ protected override void OnGetTypeTags (HashSet<string> types)
{
- yield return "SharedAssets";
- yield return "DotNet";
+ types.Add ("SharedAssets");
+ types.Add ("DotNet");
}
- public override string[] SupportedLanguages {
- get {
- return new [] { "", languageName };
- }
+ protected override string[] OnGetSupportedLanguages ()
+ {
+ return new [] { "", languageName };
}
- public IDotNetLanguageBinding LanguageBinding {
+ public LanguageBinding LanguageBinding {
get {
if (languageBinding == null)
- languageBinding = LanguageBindingService.GetBindingPerLanguageName (languageName) as IDotNetLanguageBinding;
+ languageBinding = LanguageBindingService.GetBindingPerLanguageName (languageName);
return languageBinding;
}
}
- public override bool IsCompileable (string fileName)
+ protected override bool OnGetIsCompileable (string fileName)
{
return LanguageBinding.IsSourceCodeFile (fileName);
}
- protected override BuildResult OnBuild (MonoDevelop.Core.IProgressMonitor monitor, ConfigurationSelector configuration)
+ protected override Task<BuildResult> OnBuild (MonoDevelop.Core.ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
- return new BuildResult ();
+ return Task.FromResult (BuildResult.CreateSuccess ());
}
- internal protected override bool OnGetSupportsTarget (string target)
+ protected override bool OnGetSupportsTarget (string target)
{
return false;
}
- internal protected override bool OnGetSupportsExecute ()
+ protected override ProjectFeatures OnGetSupportedFeatures ()
{
- return false;
+ return ProjectFeatures.None;
}
- public override bool FastCheckNeedsBuild (ConfigurationSelector configuration)
+ protected override bool OnFastCheckNeedsBuild (ConfigurationSelector configuration)
{
return false;
}
- protected override IEnumerable<string> GetStandardBuildActions ()
+ protected override IEnumerable<string> OnGetStandardBuildActions ()
{
return BuildAction.DotNetActions;
}
- protected override IList<string> GetCommonBuildActions ()
+ protected override IList<string> OnGetCommonBuildActions ()
{
return BuildAction.DotNetCommonActions;
}
@@ -139,9 +278,9 @@ namespace MonoDevelop.Projects.SharedAssetsProjects
/// Gets the default namespace for the file, according to the naming policy.
/// </summary>
/// <remarks>Always returns a valid namespace, even if the fileName is null.</remarks>
- public string GetDefaultNamespace (string fileName)
+ public string GetDefaultNamespace (string fileName, bool useVisualStudioNamingPolicy = false)
{
- return DotNetProject.GetDefaultNamespace (this, DefaultNamespace, fileName);
+ return DotNetProject.GetDefaultNamespace (this, DefaultNamespace, fileName, useVisualStudioNamingPolicy);
}
protected override void OnBoundToSolution ()
@@ -158,7 +297,7 @@ namespace MonoDevelop.Projects.SharedAssetsProjects
// Maybe there is a project that is already referencing this one. It may happen when creating a solution
// from a template
- foreach (var p in ParentSolution.GetAllSolutionItems<DotNetProject> ())
+ foreach (var p in ParentSolution.GetAllItems<DotNetProject> ())
ProcessProject (p);
}
@@ -168,12 +307,21 @@ namespace MonoDevelop.Projects.SharedAssetsProjects
if (p != null)
// Maybe the new project already contains a reference to this shared project
ProcessProject (p);
+
+ var folder = e.SolutionItem as SolutionFolder;
+ if (folder != null) {
+ foreach (var proj in folder.GetAllItems<DotNetProject>()) {
+ ProcessProject (proj);
+ }
+ }
}
- public override void Dispose ()
+ protected override void OnDispose ()
{
- base.Dispose ();
+ if (projitemsProject != null)
+ projitemsProject.Dispose ();
DisconnectFromSolution ();
+ base.OnDispose ();
}
void DisconnectFromSolution ()
@@ -211,7 +359,7 @@ namespace MonoDevelop.Projects.SharedAssetsProjects
var referencesToFix = p.References.Where (r => r.GetItemsProjectPath () == ProjItemsPath && r.Reference != Name).ToList ();
foreach (var r in referencesToFix) {
p.References.Remove (r);
- p.References.Add (new ProjectReference (this));
+ p.References.Add (ProjectReference.CreateProjectReference (this));
}
foreach (var pref in p.References.Where (r => r.ReferenceType == ReferenceType.Project && r.Reference == Name))
@@ -291,7 +439,7 @@ namespace MonoDevelop.Projects.SharedAssetsProjects
if (ParentSolution == null)
return new DotNetProject[0];
- return ParentSolution.GetAllSolutionItems<DotNetProject> ().Where (p => p.References.Any (r => r.GetItemsProjectPath () != null));
+ return ParentSolution.GetAllItems<DotNetProject> ().Where (p => p.References.Any (r => r.GetItemsProjectPath () == ProjItemsPath));
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProjectBinding.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProjectBinding.cs
deleted file mode 100644
index ca7f7527a1..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProjectBinding.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// SharedAssetsProjectBinding.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@xamarin.com>
-//
-// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-
-namespace MonoDevelop.Projects.SharedAssetsProjects
-{
- public class SharedAssetsProjectBinding: IProjectBinding
- {
- #region IProjectBinding implementation
-
- public Project CreateProject (ProjectCreateInformation info, System.Xml.XmlElement projectOptions)
- {
- return new SharedAssetsProject (info, projectOptions);
- }
-
- public Project CreateSingleFileProject (string sourceFile)
- {
- throw new NotImplementedException ();
- }
-
- public bool CanCreateSingleFileProject (string sourceFile)
- {
- return false;
- }
-
- public string Name {
- get {
- return "SharedAssetsProject";
- }
- }
-
- #endregion
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProjectMSBuildExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProjectMSBuildExtension.cs
index 1da660c7a1..1f5f652c87 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProjectMSBuildExtension.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProjectMSBuildExtension.cs
@@ -28,63 +28,67 @@ using System.Linq;
using System.IO;
using MonoDevelop.Core;
using System.Collections.Generic;
-using MonoDevelop.Projects.Formats.MSBuild;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.Projects.SharedAssetsProjects
{
- class SharedAssetsProjectMSBuildExtension: MSBuildExtension
+ [ExportProjectModelExtension]
+ class SharedAssetsProjectMSBuildExtension: DotNetProjectExtension
{
- public override void LoadProject (IProgressMonitor monitor, SolutionEntityItem item, MSBuildProject msproject)
+ internal protected override void OnReadProject (ProgressMonitor monitor, MSBuildProject msproject)
{
- base.LoadProject (monitor, item, msproject);
-
- var dnp = item as DotNetProject;
- if (dnp == null)
- return;
+ base.OnReadProject (monitor, msproject);
// Convert .projitems imports into project references
foreach (var sp in msproject.Imports.Where (im => im.Label == "Shared" && im.Project.EndsWith (".projitems"))) {
var projitemsFile = sp.Project;
if (!string.IsNullOrEmpty (projitemsFile)) {
- projitemsFile = MSBuildProjectService.FromMSBuildPath (item.ItemDirectory, projitemsFile);
+ projitemsFile = MSBuildProjectService.FromMSBuildPath (Project.ItemDirectory, projitemsFile);
projitemsFile = Path.Combine (Path.GetDirectoryName (msproject.FileName), projitemsFile);
if (File.Exists (projitemsFile)) {
- MSBuildSerializer iser = Handler.CreateSerializer ();
- iser.SerializationContext.BaseFile = projitemsFile;
- iser.SerializationContext.ProgressMonitor = monitor;
- MSBuildProject p = new MSBuildProject ();
- p.Load (projitemsFile);
- Handler.LoadProjectItems (p, iser, ProjectItemFlags.Hidden | ProjectItemFlags.DontPersist);
- var r = new ProjectReference (ReferenceType.Project, Path.GetFileNameWithoutExtension (projitemsFile));
- r.Flags = ProjectItemFlags.DontPersist;
- r.SetItemsProjectPath (projitemsFile);
- dnp.References.Add (r);
+ using (MSBuildProject p = new MSBuildProject (msproject.EngineManager)) {
+ p.Load (projitemsFile);
+ Project.LoadProjectItems (p, ProjectItemFlags.Hidden | ProjectItemFlags.DontPersist, null);
+ var r = ProjectReference.CreateProjectReference (projitemsFile);
+ r.Flags = ProjectItemFlags.DontPersist;
+ r.SetItemsProjectPath (projitemsFile);
+ Project.References.Add (r);
+ }
}
}
}
}
- public override void SaveProject (IProgressMonitor monitor, SolutionEntityItem item, MSBuildProject project)
+ internal protected override void OnWriteProject (ProgressMonitor monitor, MSBuildProject project)
{
- base.SaveProject (monitor, item, project);
- var dnp = item as DotNetProject;
- if (dnp == null)
- return;
+ base.OnWriteProject (monitor, project);
+
HashSet<string> validProjitems = new HashSet<string> ();
- foreach (var r in dnp.References.Where (rp => rp.ReferenceType == ReferenceType.Project)) {
+ foreach (var r in Project.References.Where (rp => rp.ReferenceType == ReferenceType.Project)) {
var ip = r.GetItemsProjectPath ();
if (!string.IsNullOrEmpty (ip)) {
- ip = MSBuildProjectService.ToMSBuildPath (item.ItemDirectory, ip);
+ ip = MSBuildProjectService.ToMSBuildPath (Project.ItemDirectory, ip);
validProjitems.Add (ip);
if (!project.Imports.Any (im => im.Project == ip)) {
- var im = project.AddNewImport (ip, project.Imports.FirstOrDefault (i => i.Label != "Shared"));
+ // If there is already a Shared import, place the new import in the same location
+ MSBuildObject before = project.Imports.FirstOrDefault (i => i.Label == "Shared" && i.Project.EndsWith (".projitems"));
+ if (before == null) {
+ var fsharpProject = project.ProjectTypeGuids.Contains("{F2A71F9B-5D33-465A-A702-920D77279786}");
+ if (fsharpProject)
+ //For F# use the first item group as the shared project files have to be listed first
+ before = project.ItemGroups.FirstOrDefault (i => i.Label != "Shared");
+ else
+ before = project.Imports.FirstOrDefault (i => i.Label != "Shared");
+ }
+
+ var im = project.AddNewImport (ip, beforeObject: before);
im.Label = "Shared";
im.Condition = "Exists('" + ip + "')";
}
}
}
- foreach (var im in project.Imports) {
+ foreach (var im in project.Imports.ToArray ()) {
if (im.Label == "Shared" && im.Project.EndsWith (".projitems") && !(validProjitems.Contains (im.Project)))
project.RemoveImport (im.Project);
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProjectMSBuildHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProjectMSBuildHandler.cs
deleted file mode 100644
index 57ce88e3d3..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProjectMSBuildHandler.cs
+++ /dev/null
@@ -1,143 +0,0 @@
-//
-// SharedProjectMSBuildHandler.cs
-//
-// Author:
-// Lluis Sanchez <lluis@xamarin.com>
-//
-// Copyright (c) 2014 Xamarin Inc
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Linq;
-using System.Xml;
-using System.IO;
-using MonoDevelop.Core;
-using System.Collections.Generic;
-using MonoDevelop.Projects.Formats.MSBuild;
-
-namespace MonoDevelop.Projects.SharedAssetsProjects
-{
- class SharedAssetsProjectMSBuildHandler: MSBuildProjectHandler
- {
- string projitemsFile;
-
- public SharedAssetsProjectMSBuildHandler ()
- {
- // Shared projects use msbuild by default. Without this, referencing projects assume that a SAP
- // doesn't support msbuild and they fall back to MD's build system.
- UseMSBuildEngineByDefault = true;
- }
-
- protected override void LoadProject (IProgressMonitor monitor, MSBuildProject msproject)
- {
- var doc = msproject.Document;
- projitemsFile = null;
- foreach (var no in doc.DocumentElement.ChildNodes) {
- var im = no as XmlElement;
- if (im != null && im.LocalName == "Import" && im.GetAttribute ("Label") == "Shared") {
- projitemsFile = im.GetAttribute ("Project");
- break;
- }
- }
- if (projitemsFile == null)
- return;
-
- // TODO: load the type from msbuild
- ((SharedAssetsProject)EntityItem).LanguageName = "C#";
-
- projitemsFile = Path.Combine (Path.GetDirectoryName (msproject.FileName), projitemsFile);
-
- MSBuildProject p = new MSBuildProject ();
- p.Load (projitemsFile);
-
- MSBuildSerializer ser = CreateSerializer ();
- ser.SerializationContext.BaseFile = EntityItem.FileName;
- ser.SerializationContext.ProgressMonitor = monitor;
-
- ((SharedAssetsProject)Item).ProjItemsPath = projitemsFile;
- Item.SetItemHandler (this);
-
- var cp = p.PropertyGroups.FirstOrDefault (g => g.Label == "Configuration");
- if (cp != null)
- ((SharedAssetsProject)EntityItem).DefaultNamespace = cp.GetPropertyValue ("Import_RootNamespace");
-
- LoadProjectItems (p, ser, ProjectItemFlags.None);
- }
-
- protected override MSBuildProject SaveProject (IProgressMonitor monitor)
- {
- MSBuildSerializer ser = CreateSerializer ();
- ser.SerializationContext.BaseFile = EntityItem.FileName;
- ser.SerializationContext.ProgressMonitor = monitor;
-
- MSBuildProject projitemsProject = new MSBuildProject ();
- MSBuildProject msproject = new MSBuildProject ();
-
- var newProject = EntityItem.FileName == null || !File.Exists (EntityItem.FileName);
- if (newProject) {
- var grp = msproject.GetGlobalPropertyGroup ();
- if (grp == null)
- grp = msproject.AddNewPropertyGroup (false);
- grp.SetPropertyValue ("ProjectGuid", EntityItem.ItemId, false);
- var import = msproject.AddNewImport (@"$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props");
- import.Condition = @"Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')";
- msproject.AddNewImport (@"$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props");
- msproject.AddNewImport (@"$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props");
- import = msproject.AddNewImport (Path.ChangeExtension (EntityItem.FileName.FileName, ".projitems"));
- import.Label = "Shared";
- msproject.AddNewImport (@"$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets");
- } else {
- msproject.Load (EntityItem.FileName);
- }
-
- // having no ToolsVersion is equivalent to 2.0, roundtrip that correctly
- if (ToolsVersion != "2.0")
- msproject.ToolsVersion = ToolsVersion;
- else if (string.IsNullOrEmpty (msproject.ToolsVersion))
- msproject.ToolsVersion = null;
- else
- msproject.ToolsVersion = "2.0";
-
- if (projitemsFile == null)
- projitemsFile = ((SharedAssetsProject)Item).ProjItemsPath;
- if (File.Exists (projitemsFile)) {
- projitemsProject.Load (projitemsFile);
- } else {
- var grp = projitemsProject.AddNewPropertyGroup (true);
- grp.SetPropertyValue ("MSBuildAllProjects", "$(MSBuildAllProjects);$(MSBuildThisFileFullPath)", false);
- grp.SetPropertyValue ("HasSharedItems", "true", false);
- grp.SetPropertyValue ("SharedGUID", EntityItem.ItemId, false);
- }
-
- var configGrp = projitemsProject.PropertyGroups.FirstOrDefault (g => g.Label == "Configuration");
- if (configGrp == null) {
- configGrp = projitemsProject.AddNewPropertyGroup (true);
- configGrp.Label = "Configuration";
- }
- configGrp.SetPropertyValue ("Import_RootNamespace", ((SharedAssetsProject)EntityItem).DefaultNamespace, false);
-
- SaveProjectItems (monitor, new MSBuildFileFormatVS12 (), ser, projitemsProject, "$(MSBuildThisFileDirectory)");
-
- projitemsProject.Save (projitemsFile);
-
- return msproject;
- }
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/DocGenerator.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/DocGenerator.cs
index 7d5a752b09..94622ce476 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/DocGenerator.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/DocGenerator.cs
@@ -26,7 +26,7 @@
using System;
using MonoDevelop.Core;
using Mono.Addins;
-using ICSharpCode.NRefactory.TypeSystem;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.Projects.Text
{
@@ -37,7 +37,7 @@ namespace MonoDevelop.Projects.Text
private set;
}
- public abstract string GenerateDocumentation (IMember member, string linePrefix);
+ public abstract string GenerateDocumentation (ISymbol member, string linePrefix);
static DocGenerator ()
{
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/IEditableTextFile.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/IEditableTextFile.cs
deleted file mode 100644
index fa9a33ff06..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/IEditableTextFile.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// IEditableTextFile.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace MonoDevelop.Projects.Text
-{
- public interface IEditableTextFile: ITextFile
- {
- new string Text {
- get;
- set;
- }
-
- /// <returns>
- /// The length of the inserted text. The real text may differ in lenth because
- /// of some conversions (tabs -> spaces, different line ends etc.)
- /// </returns>
- int InsertText (int position, string text);
- void DeleteText (int position, int length);
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/ITextFileProvider.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/ITextFileProvider.cs
deleted file mode 100644
index 47afc17755..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/ITextFileProvider.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// ITextFileProvider.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Projects.Text
-{
- public interface ITextFileProvider
- {
- IEditableTextFile GetEditableTextFile (FilePath filePath);
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/TextFile.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/TextFile.cs
index 85f4dd8b26..3fcc926da1 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/TextFile.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/TextFile.cs
@@ -39,7 +39,7 @@ using MonoDevelop.Projects.Utility;
namespace MonoDevelop.Projects.Text
{
- public class TextFile: IEditableTextFile
+ public class TextFile: ITextFile
{
const string LIBGLIB = "libglib-2.0-0.dll";
@@ -354,13 +354,14 @@ namespace MonoDevelop.Projects.Text
modified = true;
}
- public void Save ()
+ public bool Save ()
{
- WriteFile (name, text.ToString (), sourceEncoding, HadBOM);
+ var result = WriteFile (name, text.ToString (), sourceEncoding, HadBOM);
modified = false;
+ return result;
}
- public static void WriteFile (FilePath fileName, byte[] content, string encoding, ByteOrderMark bom, bool onlyIfChanged)
+ public static bool WriteFile (FilePath fileName, byte[] content, string encoding, ByteOrderMark bom, bool onlyIfChanged)
{
int contentLength = content.Length + (bom != null ? bom.Length : 0);
byte[] converted;
@@ -374,95 +375,94 @@ namespace MonoDevelop.Projects.Text
FileInfo finfo = new FileInfo (fileName);
if (finfo.Exists && finfo.Length == contentLength) {
bool changed = false;
-
+
// Open the file on disk and compare them byte by byte...
using (FileStream stream = finfo.Open (FileMode.Open, FileAccess.Read, FileShare.Read)) {
- byte[] buf = new byte [4096];
+ byte [] buf = new byte [4096];
int bomOffset = 0;
int offset = 0;
int nread;
int i;
-
+
while (!changed && (nread = stream.Read (buf, 0, buf.Length)) > 0) {
i = 0;
-
+
if (bom != null && bomOffset < bom.Length) {
while (i < nread && bomOffset < bom.Length) {
- if (bom.Bytes[bomOffset] != buf[i]) {
+ if (bom.Bytes [bomOffset] != buf [i]) {
changed = true;
break;
}
-
+
bomOffset++;
i++;
}
-
+
if (changed)
break;
}
-
+
while (i < nread && offset < converted.Length) {
- if (converted[offset] != buf[i]) {
+ if (converted [offset] != buf [i]) {
changed = true;
break;
}
-
+
offset++;
i++;
}
-
+
if (offset == converted.Length && i < nread)
changed = true;
}
-
+
if (offset < converted.Length)
changed = true;
}
-
+
if (!changed)
- return;
- }
-
+ return true;
+ }
+
// Content has changed...
}
string tempName = Path.GetDirectoryName (fileName) +
Path.DirectorySeparatorChar + ".#" + Path.GetFileName (fileName);
- FileStream fs = new FileStream (tempName, FileMode.Create, FileAccess.Write);
- if (bom != null)
- fs.Write (bom.Bytes, 0, bom.Length);
-
- fs.Write (converted, 0, converted.Length);
- fs.Flush ();
- fs.Close ();
+ using (FileStream fs = new FileStream (tempName, FileMode.Create, FileAccess.Write)) {
+ if (bom != null)
+ fs.Write (bom.Bytes, 0, bom.Length);
+
+ fs.Write (converted, 0, converted.Length);
+ }
FileService.SystemRename (tempName, fileName);
FileService.NotifyFileChanged (fileName);
+ return true;
}
- public static void WriteFile (FilePath fileName, string content, string encoding, ByteOrderMark bom, bool onlyIfChanged)
+ public static bool WriteFile (FilePath fileName, string content, string encoding, ByteOrderMark bom, bool onlyIfChanged)
{
byte[] buf = Encoding.UTF8.GetBytes (content);
-
- WriteFile (fileName, buf, encoding, bom, onlyIfChanged);
+ return WriteFile (fileName, buf, encoding, bom, onlyIfChanged);
}
- public static void WriteFile (FilePath fileName, string content, ByteOrderMark bom, bool onlyIfChanged)
+ public static bool WriteFile (FilePath fileName, string content, ByteOrderMark bom, bool onlyIfChanged)
{
- WriteFile (fileName, content, bom != null ? bom.Name : null, bom, onlyIfChanged);
+ return WriteFile (fileName, content, bom != null ? bom.Name : null, bom, onlyIfChanged);
}
- public static void WriteFile (FilePath fileName, string content, string encoding)
+ public static bool WriteFile (FilePath fileName, string content, string encoding)
{
- WriteFile (fileName, content, encoding, false);
+ return WriteFile (fileName, content, encoding, false);
}
- public static void WriteFile (FilePath fileName, string content, string encoding, bool saveBOM)
+ public static bool WriteFile (FilePath fileName, string content, string encoding, bool saveBOM)
{
ByteOrderMark bom = saveBOM && encoding != null ? ByteOrderMark.GetByName (encoding) : null;
- WriteFile (fileName, content, encoding, bom, false);
+ return WriteFile (fileName, content, encoding, bom, false);
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/AsyncCriticalSection.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/AsyncCriticalSection.cs
new file mode 100644
index 0000000000..c18d28d2bb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/AsyncCriticalSection.cs
@@ -0,0 +1,88 @@
+//
+// AsyncCriticalSection.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Projects
+{
+ /// <summary>
+ /// A critical section object which can be awaited
+ /// </summary>
+ /// <remarks>This critical section is not reentrant.</remarks>
+ public class AsyncCriticalSection
+ {
+ class CriticalSectionDisposer: IDisposable
+ {
+ public AsyncCriticalSection AsyncCriticalSection;
+
+ public void Dispose ()
+ {
+ AsyncCriticalSection.Exit ();
+ }
+ }
+
+ IDisposable criticalSectionDisposer;
+ Queue<TaskCompletionSource<IDisposable>> queue = new Queue<TaskCompletionSource<IDisposable>> ();
+ bool locked;
+
+ public AsyncCriticalSection ()
+ {
+ criticalSectionDisposer = new CriticalSectionDisposer { AsyncCriticalSection = this };
+ }
+
+ public IDisposable Enter ()
+ {
+ return EnterAsync ().Result;
+ }
+
+ public Task<IDisposable> EnterAsync ()
+ {
+ lock (queue) {
+ if (!locked) {
+ locked = true;
+ return Task.FromResult (criticalSectionDisposer);
+ }
+ var s = new TaskCompletionSource<IDisposable> ();
+ queue.Enqueue (s);
+ return s.Task;
+ }
+ }
+
+ void Exit ()
+ {
+ lock (queue) {
+ if (queue.Count > 0) {
+ var cs = queue.Dequeue ();
+ cs.SetResult (criticalSectionDisposer);
+ } else
+ locked = false;
+ }
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/AuthorInformation.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/AuthorInformation.cs
index a7c88345bb..8639006765 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/AuthorInformation.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/AuthorInformation.cs
@@ -67,11 +67,11 @@ namespace MonoDevelop.Projects
public static AuthorInformation Default {
get {
- string name = GetValueOrMigrate<string> ("Author.Name", "ChangeLogAddIn.Name") ?? Environment.UserName;
- string email = GetValueOrMigrate<string> ("Author.Email", "ChangeLogAddIn.Email");
- string copyright = PropertyService.Get<string> ("Author.Copyright", name);
- string company = PropertyService.Get<string> ("Author.Company", "");
- string trademark = PropertyService.Get<string> ("Author.Trademark", "");
+ string name = Runtime.Preferences.AuthorName.Value;
+ string email = Runtime.Preferences.AuthorEmail;
+ string copyright = Runtime.Preferences.AuthorCopyright ?? name;
+ string company = Runtime.Preferences.AuthorCompany;
+ string trademark = Runtime.Preferences.AuthorTrademark;
return new AuthorInformation (name, email, copyright, company, trademark);
}
}
@@ -81,19 +81,5 @@ namespace MonoDevelop.Projects
return !String.IsNullOrEmpty (Name) && !String.IsNullOrEmpty (Email);
}
}
-
- static T GetValueOrMigrate<T> (string name, string oldName)
- {
- T val = PropertyService.Get<T> (name);
- if (val != null)
- return val;
-
- val = PropertyService.Get<T> (oldName);
- if (val != null) {
- PropertyService.Set (oldName, null);
- PropertyService.Set (name, val);
- }
- return val;
- }
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildAction.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildAction.cs
index 81ab41c67d..8124778fdc 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildAction.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildAction.cs
@@ -77,5 +77,13 @@ namespace MonoDevelop.Projects
};
}
}
+
+ internal static string[] ReserverIdeActions {
+ get {
+ return new string[] {
+ "AvailableItemName"
+ };
+ }
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildEventHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildEventHandler.cs
index ef76135af7..596d7ee072 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildEventHandler.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildEventHandler.cs
@@ -35,10 +35,10 @@ namespace MonoDevelop.Projects
public class BuildEventArgs: EventArgs
{
- IProgressMonitor monitor;
+ ProgressMonitor monitor;
bool success;
- public BuildEventArgs (IProgressMonitor monitor, bool success)
+ public BuildEventArgs (ProgressMonitor monitor, bool success)
{
this.monitor = monitor;
this.success = success;
@@ -48,7 +48,7 @@ namespace MonoDevelop.Projects
this.FailedBuildCount = -1;
}
- public IProgressMonitor ProgressMonitor {
+ public ProgressMonitor ProgressMonitor {
get { return monitor; }
}
@@ -72,7 +72,7 @@ namespace MonoDevelop.Projects
get; set;
}
- public SolutionItem SolutionItem {
+ public SolutionFolderItem SolutionItem {
get; set;
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildResult.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildResult.cs
index 862b0a5b25..307f70ddb1 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildResult.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildResult.cs
@@ -29,6 +29,7 @@
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+using MonoDevelop.Core;
namespace MonoDevelop.Projects
{
@@ -39,7 +40,7 @@ namespace MonoDevelop.Projects
int buildCount = 1;
List<BuildError> errors = new List<BuildError> ();
IBuildTarget sourceTarget;
-
+
public BuildResult()
{
}
@@ -61,7 +62,25 @@ namespace MonoDevelop.Projects
}
}
}
-
+
+ public bool HasErrors {
+ get { return ErrorCount > 0; }
+ }
+
+ public bool HasWarnings {
+ get { return WarningCount > 0; }
+ }
+
+ public static BuildResult CreateSuccess ()
+ {
+ return new BuildResult ();
+ }
+
+ public static BuildResult CreateCancelled ()
+ {
+ return new BuildResult ().AddError (GettextCatalog.GetString ("Cancelled"));
+ }
+
public ReadOnlyCollection<BuildError> Errors {
get { return errors.AsReadOnly (); }
}
@@ -76,36 +95,42 @@ namespace MonoDevelop.Projects
sourceTarget = null;
}
- public void AddError (string file, int line, int col, string errorNum, string text)
+ public BuildResult AddError (string file, int line, int col, string errorNum, string text)
{
Append (new BuildError (file, line, col, errorNum, text));
+ return this;
}
- public void AddError (string text)
+ public BuildResult AddError (string text)
{
Append (new BuildError (null, 0, 0, null, text));
+ return this;
}
- public void AddError (string text, string file)
+ public BuildResult AddError (string text, string file)
{
Append (new BuildError (file, 0, 0, null, text));
+ return this;
}
- public void AddWarning (string file, int line, int col, string errorNum, string text)
+ public BuildResult AddWarning (string file, int line, int col, string errorNum, string text)
{
var ce = new BuildError (file, line, col, errorNum, text);
ce.IsWarning = true;
Append (ce);
+ return this;
}
- public void AddWarning (string text)
+ public BuildResult AddWarning (string text)
{
AddWarning (text, null);
+ return this;
}
- public void AddWarning (string text, string file)
+ public BuildResult AddWarning (string text, string file)
{
AddWarning (file, 0, 0, null, text);
+ return this;
}
public BuildResult Append (BuildResult res)
@@ -146,6 +171,12 @@ namespace MonoDevelop.Projects
return this;
}
+ internal BuildResult SetSource (IBuildTarget source)
+ {
+ SourceTarget = source;
+ return this;
+ }
+
public string CompilerOutput { get; set; }
public int WarningCount {
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildTool.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildTool.cs
index 43b3b5cfd6..757e760e36 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildTool.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildTool.cs
@@ -34,6 +34,7 @@ using Mono.Addins;
using MonoDevelop.Core.ProgressMonitoring;
using MonoDevelop.Core;
using MonoDevelop.Core.Assemblies;
+using System.Threading.Tasks;
namespace MonoDevelop.Projects
{
@@ -46,7 +47,7 @@ namespace MonoDevelop.Projects
string command = ProjectService.BuildTarget;
string runtime;
- public int Run (string[] arguments)
+ public async Task<int> Run (string[] arguments)
{
Console.WriteLine (BrandingService.BrandApplicationName ("MonoDevelop Build Tool"));
foreach (string s in arguments)
@@ -93,7 +94,7 @@ namespace MonoDevelop.Projects
}
}
- IProgressMonitor monitor = new ConsoleProjectLoadProgressMonitor (new ConsoleProgressMonitor ());
+ ProgressMonitor monitor = new ConsoleProjectLoadProgressMonitor (new ConsoleProgressMonitor ());
TargetRuntime targetRuntime = null;
TargetRuntime defaultRuntime = Runtime.SystemAssemblyService.DefaultRuntime;
@@ -106,11 +107,16 @@ namespace MonoDevelop.Projects
IBuildTarget item;
if (solFile != null)
- item = Services.ProjectService.ReadWorkspaceItem (monitor, solFile);
+ item = await Services.ProjectService.ReadWorkspaceItem (monitor, solFile) as IBuildTarget;
else
- item = Services.ProjectService.ReadSolutionItem (monitor, itemFile);
+ item = await Services.ProjectService.ReadSolutionItem (monitor, itemFile);
- using (var readItem = item) {
+ if (item == null) {
+ Console.WriteLine ("The file '" + file + "' can't be built");
+ return 1;
+ }
+
+ using (var readItem = (WorkspaceObject)item) {
if (project != null) {
Solution solution = item as Solution;
item = null;
@@ -130,24 +136,29 @@ namespace MonoDevelop.Projects
monitor = new ConsoleProgressMonitor ();
BuildResult res = null;
- if (item is SolutionEntityItem && ((SolutionEntityItem)item).ParentSolution == null) {
+ if (item is SolutionItem && ((SolutionItem)item).ParentSolution == null) {
ConfigurationSelector configuration = new ItemConfigurationSelector (config);
- res = item.RunTarget (monitor, command, configuration);
+ if (command == ProjectService.BuildTarget)
+ res = await item.Build (monitor, configuration);
+ else if (command == ProjectService.CleanTarget)
+ res = await item.Clean (monitor, configuration);
} else {
ConfigurationSelector configuration = new SolutionConfigurationSelector (config);
- SolutionEntityItem solutionEntityItem = item as SolutionEntityItem;
- if (solutionEntityItem != null) {
- if (command == ProjectService.BuildTarget)
- res = solutionEntityItem.Build (monitor, configuration, true);
- else if (command == ProjectService.CleanTarget)
- solutionEntityItem.Clean (monitor, configuration);
- else
- res = item.RunTarget (monitor, command, configuration);
- } else {
- res = item.RunTarget (monitor, command, configuration);
+
+ if (command == ProjectService.BuildTarget)
+ res = await item.Build (monitor, configuration, true);
+ else if (command == ProjectService.CleanTarget)
+ res = await item.Clean (monitor, configuration);
+ else {
+ var p = item as Project;
+ if (p != null) {
+ res = (await p.RunTarget (monitor, command, configuration)).BuildResult;
+ } else {
+ Console.WriteLine ("Target '" + command + " not supported");
+ return 1;
+ }
}
}
-
if (targetRuntime != null)
{
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ChainedExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ChainedExtension.cs
new file mode 100644
index 0000000000..1b8b3f282b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ChainedExtension.cs
@@ -0,0 +1,113 @@
+//
+// ChainedExtension.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Reflection;
+using System.Linq;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Projects
+{
+ public class ChainedExtension: IDisposable
+ {
+ ChainedExtension nextInChain;
+ ExtensionChain chain;
+
+ internal static T CreateChain<T> (ChainedExtension next) where T:ChainedExtension, new()
+ {
+ var first = new T ();
+ first.nextInChain = ChainedExtension.FindNextImplementation<T> (next);
+ return first;
+ }
+
+ internal protected static T FindNextImplementation<T> (ChainedExtension next) where T:ChainedExtension
+ {
+ return (T)FindNextImplementation (typeof(T), next);
+ }
+
+ internal static ChainedExtension FindNextImplementation (Type type, ChainedExtension next)
+ {
+ if (next == null)
+ return null;
+
+ if (!type.IsInstanceOfType (next))
+ return FindNextImplementation (type, next.nextInChain);
+
+ foreach (var m in type.GetMembers (BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)) {
+ MethodInfo method = m as MethodInfo;
+ if (method == null) {
+ var prop = m as PropertyInfo;
+ if (prop != null) {
+ method = prop.GetGetMethod ();
+ if (method == null)
+ method = prop.GetSetMethod ();
+ }
+ }
+ if (method != null && method.IsVirtual && method.Name != "InitializeChain") {
+ var tm = next.GetType ().GetMethod (method.Name, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, method.GetParameters ().Select (p=>p.ParameterType).ToArray (), null);
+ if (tm == null)
+ continue;
+ if (tm.DeclaringType != type)
+ return next;
+ }
+ }
+
+ // Serializable fields and properties
+ if (next.GetType ().GetMembers (BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).Any (m => m.IsDefined (typeof(MonoDevelop.Core.Serialization.ItemPropertyAttribute))))
+ return next;
+
+ return FindNextImplementation (type, next.nextInChain);
+ }
+
+ internal void InitChain (ExtensionChain chain, ChainedExtension next)
+ {
+ this.chain = chain;
+ nextInChain = next;
+ InitializeChain (next);
+ }
+
+ internal protected virtual void InitializeChain (ChainedExtension next)
+ {
+ }
+
+ internal ChainedExtension Next {
+ get { return nextInChain; }
+ }
+
+ internal void DisposeChain ()
+ {
+ Dispose ();
+ if (nextInChain != null)
+ nextInChain.DisposeChain ();
+ }
+
+ public virtual void Dispose ()
+ {
+ if (chain != null)
+ chain.RemoveExtension (this);
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CleanEventHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CleanEventHandler.cs
index 5d0dc54264..430a43b3fe 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CleanEventHandler.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CleanEventHandler.cs
@@ -33,14 +33,14 @@ namespace MonoDevelop.Projects
public class CleanEventArgs : EventArgs
{
- IProgressMonitor monitor;
+ ProgressMonitor monitor;
- public CleanEventArgs (IProgressMonitor monitor)
+ public CleanEventArgs (ProgressMonitor monitor)
{
this.monitor = monitor;
}
- public IProgressMonitor Monitor {
+ public ProgressMonitor Monitor {
get {
return monitor;
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CombineEntryRenamedEventArgs.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CombineEntryRenamedEventArgs.cs
index 41f95e07ad..c7efbcef93 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CombineEntryRenamedEventArgs.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CombineEntryRenamedEventArgs.cs
@@ -37,7 +37,7 @@ namespace MonoDevelop.Projects
string oldName;
string newName;
- public SolutionItemRenamedEventArgs (SolutionItem node, string oldName, string newName)
+ public SolutionItemRenamedEventArgs (SolutionFolderItem node, string oldName, string newName)
: base (node)
{
this.oldName = oldName;
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CompiledAssemblyProject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CompiledAssemblyProject.cs
index 481bcd9ecf..6b5226d49c 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CompiledAssemblyProject.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CompiledAssemblyProject.cs
@@ -34,30 +34,31 @@ using MonoDevelop.Core.ProgressMonitoring;
using System.Collections.Generic;
using Mono.Cecil.Mdb;
using Mono.Cecil.Cil;
+using System.Threading.Tasks;
+using MonoDevelop.Core.Serialization;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.Projects
{
+ [ExportProjectType ("{8BC9CEB9-8B4A-11D0-8D11-00A0C91BC942}")]
public class CompiledAssemblyProject: Project, IAssemblyProject
{
TargetFramework targetFramework;
public CompiledAssemblyProject ()
{
+ Initialize (this);
AddNewConfiguration ("Default");
+ StockIcon = "md-assembly-project";
}
- public override IEnumerable<string> GetProjectTypes ()
+ protected override void OnGetTypeTags (HashSet<string> types)
{
- yield return "CompiledAssembly";
- }
-
- public override IconId StockIcon {
- get {
- return "md-assembly-project";
- }
+ base.OnGetTypeTags (types);
+ types.Add ("CompiledAssembly");
}
- public override SolutionItemConfiguration CreateConfiguration (string name)
+ protected override SolutionItemConfiguration OnCreateConfiguration (string name, ConfigurationKind kind)
{
return new ProjectConfiguration (name);
}
@@ -137,27 +138,20 @@ namespace MonoDevelop.Projects
return string.Join (Path.DirectorySeparatorChar.ToString (), s1, 0, n);
}
- protected override BuildResult OnBuild (IProgressMonitor monitor, ConfigurationSelector configuration)
- {
- return new BuildResult ();
- }
-
- internal protected override bool OnGetNeedsBuilding (ConfigurationSelector configuration)
+ protected override Task<BuildResult> OnBuild (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
- return false;
+ return Task.FromResult (BuildResult.CreateSuccess ());
}
- internal protected override void OnExecute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ protected async override Task OnExecute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
{
ProjectConfiguration conf = (ProjectConfiguration) GetConfiguration (configuration);
monitor.Log.WriteLine (GettextCatalog.GetString ("Running {0} ...", FileName));
- IConsole console = conf.ExternalConsole
- ? context.ExternalConsoleFactory.CreateConsole (!conf.PauseConsoleOutput)
- : context.ConsoleFactory.CreateConsole (!conf.PauseConsoleOutput);
+ OperationConsole console = conf.ExternalConsole
+ ? context.ExternalConsoleFactory.CreateConsole (!conf.PauseConsoleOutput, monitor.CancellationToken)
+ : context.ConsoleFactory.CreateConsole (monitor.CancellationToken);
- AggregatedOperationMonitor aggregatedOperationMonitor = new AggregatedOperationMonitor (monitor);
-
try {
try {
ExecutionCommand executionCommand = CreateExecutionCommand (configuration, conf);
@@ -167,14 +161,16 @@ namespace MonoDevelop.Projects
return;
}
- IProcessAsyncOperation asyncOp = context.ExecutionHandler.Execute (executionCommand, console);
- aggregatedOperationMonitor.AddOperation (asyncOp);
- asyncOp.WaitForCompleted ();
+ ProcessAsyncOperation asyncOp = context.ExecutionHandler.Execute (executionCommand, console);
+ var stopper = monitor.CancellationToken.Register (asyncOp.Cancel);
+
+ await asyncOp.Task;
+
+ stopper.Dispose ();
monitor.Log.WriteLine (GettextCatalog.GetString ("The application exited with code: {0}", asyncOp.ExitCode));
} finally {
console.Dispose ();
- aggregatedOperationMonitor.Dispose ();
}
} catch (Exception ex) {
LoggingService.LogError (string.Format ("Cannot execute \"{0}\"", FileName), ex);
@@ -182,7 +178,7 @@ namespace MonoDevelop.Projects
}
}
- internal protected override bool OnGetCanExecute (ExecutionContext context, ConfigurationSelector configuration)
+ protected override bool OnGetCanExecute (ExecutionContext context, ConfigurationSelector configuration)
{
ProjectConfiguration config = (ProjectConfiguration) GetConfiguration (configuration);
if (config == null)
@@ -201,32 +197,28 @@ namespace MonoDevelop.Projects
cmd.EnvironmentVariables = new Dictionary<string, string> (configuration.EnvironmentVariables);
return cmd;
}
+
+ internal protected override Task OnSave (ProgressMonitor monitor)
+ {
+ // Compiled assemblies can't be saved
+ return Task.FromResult (0);
+ }
}
- public class CompiledAssemblyExtension: ProjectServiceExtension
+ public class CompiledAssemblyExtension: WorkspaceObjectReader
{
- public override bool IsSolutionItemFile (string fileName)
+ public override bool CanRead (FilePath file, Type expectedType)
{
- if (fileName.ToLower().EndsWith (".exe") || fileName.ToLower().EndsWith (".dll"))
- return true;
- return base.IsSolutionItemFile (fileName);
+ return expectedType.IsAssignableFrom (typeof(SolutionItem)) && (file.Extension.ToLower() == ".exe" || file.Extension.ToLower() == ".dll");
}
-
- protected override SolutionEntityItem LoadSolutionItem (IProgressMonitor monitor, string fileName)
+
+ public override Task<SolutionItem> LoadSolutionItem (ProgressMonitor monitor, SolutionLoadContext ctx, string fileName, MSBuildFileFormat expectedFormat, string typeGuid, string itemGuid)
{
- if (fileName.ToLower().EndsWith (".exe") || fileName.ToLower().EndsWith (".dll")) {
+ return Task<SolutionItem>.Factory.StartNew (delegate {
CompiledAssemblyProject p = new CompiledAssemblyProject ();
p.LoadFrom (fileName);
return p;
- }
- return base.LoadSolutionItem (monitor, fileName);
- }
-
- public override void Save (IProgressMonitor monitor, SolutionEntityItem item)
- {
-// if (item is CompiledAssemblyProject)
-// return;
- base.Save (monitor, item);
+ });
}
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConditionedPropertyCollection.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConditionedPropertyCollection.cs
new file mode 100644
index 0000000000..813ea2f36d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConditionedPropertyCollection.cs
@@ -0,0 +1,269 @@
+//
+// ConditionedPropertyCollection.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+
+namespace MonoDevelop.Projects
+{
+ public class ConditionedPropertyCollection
+ {
+ Dictionary<string, ImmutableList<string>> props = new Dictionary<string, ImmutableList<string>> ();
+ Dictionary<KeySet, ImmutableList<ValueSet>> combinedProps = new Dictionary<KeySet, ImmutableList<ValueSet>> ();
+
+ /// <summary>
+ /// A set of strings, which can be compared to other sets ignoring the order.
+ /// </summary>
+ struct KeySet
+ {
+ string [] keys;
+
+ public KeySet (string [] keys)
+ {
+ this.keys = keys;
+ }
+
+ public override bool Equals (object obj)
+ {
+ if (!(obj is KeySet))
+ return false;
+
+ var other = (KeySet)obj;
+ if (other.keys.Length != keys.Length)
+ return false;
+
+ foreach (var k in keys) {
+ if (!other.keys.Contains (k))
+ return false;
+ }
+ return true;
+ }
+
+ public override int GetHashCode ()
+ {
+ unchecked {
+ int r = 0;
+ foreach (var k in keys)
+ r ^= k.GetHashCode ();
+ return r;
+ }
+ }
+ }
+
+ /// <summary>
+ /// A set of key/value pairs
+ /// </summary>
+ public struct ValueSet
+ {
+ internal string [] ReferenceKeys;
+ internal string [] Values;
+
+ /// <summary>
+ /// Initializes a new ValueSet
+ /// </summary>
+ /// <param name="referenceKeys">Array of keys that specifies the order in which values are stored</param>
+ /// <param name="names">Array of keys, ordered according to the values parameter</param>
+ /// <param name="values">Values of the keys.</param>
+ internal ValueSet (string [] referenceKeys, string[] names, string[] values)
+ {
+ this.ReferenceKeys = referenceKeys;
+ this.Values = new string [values.Length];
+ if (referenceKeys.Length == 1)
+ this.Values [0] = values [0];
+ else {
+ for (int n = 0; n < names.Length; n++) {
+ // Store the values using the order of the reference keys
+ int i = Array.IndexOf (referenceKeys, names [n]);
+ this.Values [i] = values [n];
+ }
+ }
+ }
+
+ public ValueSet (string [] names, string [] values): this (names, names, values)
+ {
+ }
+
+ /// <summary>
+ /// Gets the value for the given property
+ /// </summary>
+ public string GetValue (string property)
+ {
+ if (ReferenceKeys.Length == 1) {
+ // Fast path when there is only one property in the set
+ if (ReferenceKeys [0] == property)
+ return Values [0];
+ else
+ return null;
+ } else {
+ int i = Array.IndexOf (ReferenceKeys, property);
+ if (i != -1)
+ return Values [i];
+ else
+ return null;
+ }
+ }
+
+ public override bool Equals (object obj)
+ {
+ if (!(obj is ValueSet))
+ return false;
+
+ var other = (ValueSet)obj;
+
+ if (ReferenceKeys == other.ReferenceKeys) {
+ // Fast path, used when both sets are based on the same reference keys
+ for (int n = 0; n < Values.Length; n++)
+ if (Values [n] != other.Values [n])
+ return false;
+ return true;
+ }
+
+ if (other.ReferenceKeys.Length != ReferenceKeys.Length)
+ return false;
+
+ if (other.ReferenceKeys.Length == 1)
+ return ReferenceKeys[0] == other.ReferenceKeys[0] && Values [0] == other.Values [0];
+
+ for (int n = 0; n < ReferenceKeys.Length; n++) {
+ if (other.GetValue (ReferenceKeys[n]) != Values[n])
+ return false;
+ }
+ return true;
+ }
+
+ public override int GetHashCode ()
+ {
+ unchecked {
+ int r = 0;
+ foreach (var k in Values)
+ r ^= k.GetHashCode ();
+ return r;
+ }
+ }
+ }
+
+ internal void Append (ConditionedPropertyCollection other)
+ {
+ foreach (var e in other.props) {
+ var otherList = e.Value;
+ var key = e.Key;
+ ImmutableList<string> list;
+ if (props.TryGetValue (key, out list)) {
+ foreach (var c in otherList) {
+ if (!list.Contains (c))
+ list = list.Add (c);
+ }
+ props [key] = list;
+ } else
+ props [key] = otherList;
+ }
+
+ foreach (var e in other.combinedProps) {
+ var otherList = e.Value;
+ var key = e.Key;
+ ImmutableList<ValueSet> thisList;
+ if (combinedProps.TryGetValue (key, out thisList)) {
+ foreach (var c in otherList) {
+ if (!thisList.Contains (c))
+ // Create a new ValueSet so that the reference keys of this collection are reused
+ thisList = thisList.Add (new ValueSet (thisList [0].ReferenceKeys, c.ReferenceKeys, c.Values));
+ }
+ combinedProps [key] = thisList;
+ } else
+ combinedProps [key] = otherList;
+ }
+ }
+
+ internal void AddPropertyValues (string[] names, string[] values)
+ {
+ var key = new KeySet (names);
+ ImmutableList<ValueSet> list;
+ ValueSet valueSet;
+
+ // First register the combination of values
+
+ if (!combinedProps.TryGetValue (key, out list)) {
+ list = ImmutableList<ValueSet>.Empty;
+ valueSet = new ValueSet (names, names, values);
+ } else {
+ // If there is already a list, there must be at least one item.
+ // Use the reference key of that item, so they share the same reference key array
+ valueSet = new ValueSet (list [0].ReferenceKeys, names, values);
+ }
+
+ if (!list.Contains (valueSet))
+ combinedProps[key] = list.Add (valueSet);
+
+ // Now register each value individually
+
+ ImmutableList<string> valList;
+ for (int n = 0; n < names.Length; n++) {
+ var name = names [n];
+ var val = values [n];
+ if (!props.TryGetValue (name, out valList))
+ valList = ImmutableList<string>.Empty;
+ if (!valList.Contains (val))
+ props[name] = valList.Add (val);
+ }
+ }
+
+ /// <summary>
+ /// Retuns the name of all conditioned properties
+ /// </summary>
+ /// <returns>The all properties.</returns>
+ public IEnumerable<string> GetAllProperties ()
+ {
+ return props.Keys;
+ }
+
+ /// <summary>
+ /// Gets the values used in conditions for the given property
+ /// </summary>
+ public ImmutableList<string> GetAllPropertyValues (string property)
+ {
+ ImmutableList<string> list;
+ if (props.TryGetValue (property, out list))
+ return list;
+ return ImmutableList<string>.Empty;
+ }
+
+ /// <summary>
+ /// Gets the values for a combination of properties. It only returns values specified in conditions that
+ /// reference only (and only) the given properties. For example, if the properties are Configuration and
+ /// Platform, it will return values for those properties specified in conditions that reference both
+ /// Configuration and Platform.
+ /// </summary>
+ public ImmutableList<ValueSet> GetCombinedPropertyValues (params string[] properties)
+ {
+ ImmutableList<ValueSet> list;
+ if (combinedProps.TryGetValue (new KeySet (properties), out list))
+ return list;
+ return ImmutableList<ValueSet>.Empty;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConfigurationEventHandler.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConfigurationEventHandler.cs
index fdec84f720..61d537dd5f 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConfigurationEventHandler.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConfigurationEventHandler.cs
@@ -38,7 +38,7 @@ namespace MonoDevelop.Projects
{
ItemConfiguration configuration;
- public ConfigurationEventArgs (SolutionEntityItem entry, ItemConfiguration configuration): base (entry)
+ public ConfigurationEventArgs (SolutionItem entry, ItemConfiguration configuration): base (entry)
{
this.configuration = configuration;
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConfigurationKind.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConfigurationKind.cs
new file mode 100644
index 0000000000..b47aa17e26
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConfigurationKind.cs
@@ -0,0 +1,37 @@
+//
+// ConfigurationKind.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Projects
+{
+ public enum ConfigurationKind
+ {
+ Blank,
+ Debug,
+ Release
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConfigurationParameters.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConfigurationParameters.cs
deleted file mode 100644
index 1f76d54be8..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConfigurationParameters.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-//
-// ConfigurationParameters.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using MonoDevelop.Core.Serialization;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace MonoDevelop.Projects
-{
- ///<summary>This should really be called DotNetCompilerParameters</summary>
- [DataItem (FallbackType=typeof(UnknownCompilationParameters))]
- public abstract class ConfigurationParameters: ProjectParameters
- {
- DotNetProjectConfiguration configuration;
-
- public virtual IEnumerable<string> GetDefineSymbols ()
- {
- yield break;
- }
-
- [Obsolete]
- public virtual void AddDefineSymbol (string symbol)
- {
- }
-
- [Obsolete]
- public virtual void RemoveDefineSymbol (string symbol)
- {
- }
-
- [Obsolete]
- public virtual bool HasDefineSymbol (string symbol)
- {
- return GetDefineSymbols ().Any (s => s == symbol);
- }
-
- public new ConfigurationParameters Clone ()
- {
- return (ConfigurationParameters) base.Clone ();
- }
-
- public DotNetProjectConfiguration ParentConfiguration {
- get { return configuration; }
- internal set {
- configuration = value;
- if (configuration != null)
- ParentProject = configuration.ParentItem;
- }
- }
- }
-
- public abstract class DotNetConfigurationParameters : ConfigurationParameters
- {
- public abstract bool NoStdLib { get; set; }
- public virtual string DebugType { get { return ""; } set {} }
- }
-
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConfigurationSelector.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConfigurationSelector.cs
index a4a4e00a0c..69f5ec9a3c 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConfigurationSelector.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ConfigurationSelector.cs
@@ -36,6 +36,10 @@ namespace MonoDevelop.Projects
/// A configuration selector which selects the default (active) project or solution configuration
/// </summary>
public static readonly ConfigurationSelector Default = new DefaultConfigurationSelector ();
+
+ internal ConfigurationSelector ()
+ {
+ }
/// <summary>
/// Gets the configuration selected by this instance for a given target
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommand.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommand.cs
index 05c9132fee..d6afe1b4f3 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommand.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommand.cs
@@ -35,6 +35,8 @@ using MonoDevelop.Core.Execution;
using MonoDevelop.Core.StringParsing;
using System.Collections.Generic;
using MonoDevelop.Core.ProgressMonitoring;
+using System.Threading.Tasks;
+using System.Threading;
namespace MonoDevelop.Projects
{
@@ -116,7 +118,7 @@ namespace MonoDevelop.Projects
}
}
- public string GetCommandFile (IWorkspaceObject entry, ConfigurationSelector configuration)
+ public string GetCommandFile (WorkspaceObject entry, ConfigurationSelector configuration)
{
string exe, args;
StringTagModel tagSource = GetTagModel (entry, configuration);
@@ -124,7 +126,7 @@ namespace MonoDevelop.Projects
return exe;
}
- public string GetCommandArgs (IWorkspaceObject entry, ConfigurationSelector configuration)
+ public string GetCommandArgs (WorkspaceObject entry, ConfigurationSelector configuration)
{
string exe, args;
StringTagModel tagSource = GetTagModel (entry, configuration);
@@ -132,7 +134,7 @@ namespace MonoDevelop.Projects
return args;
}
- public FilePath GetCommandWorkingDir (IWorkspaceObject entry, ConfigurationSelector configuration)
+ public FilePath GetCommandWorkingDir (WorkspaceObject entry, ConfigurationSelector configuration)
{
StringTagModel tagSource = GetTagModel (entry, configuration);
if (string.IsNullOrEmpty (workingdir))
@@ -150,13 +152,18 @@ namespace MonoDevelop.Projects
cmd.externalConsole = externalConsole;
cmd.pauseExternalConsole = pauseExternalConsole;
cmd.type = type;
+
+ foreach (var variable in environmentVariables) {
+ cmd.environmentVariables.Add (variable.Key, variable.Value);
+ }
+
return cmd;
}
- StringTagModel GetTagModel (IWorkspaceObject entry, ConfigurationSelector configuration)
+ StringTagModel GetTagModel (WorkspaceObject entry, ConfigurationSelector configuration)
{
- if (entry is SolutionItem)
- return ((SolutionItem)entry).GetStringTagModel (configuration);
+ if (entry is SolutionFolderItem)
+ return ((SolutionFolderItem)entry).GetStringTagModel (configuration);
else if (entry is WorkspaceItem)
return ((WorkspaceItem)entry).GetStringTagModel ();
else
@@ -190,7 +197,7 @@ namespace MonoDevelop.Projects
args = StringParserService.Parse (args, tagSource);
}
- public ProcessExecutionCommand CreateExecutionCommand (IWorkspaceObject entry, ConfigurationSelector configuration)
+ public ProcessExecutionCommand CreateExecutionCommand (WorkspaceObject entry, ConfigurationSelector configuration)
{
if (string.IsNullOrEmpty (command))
throw new UserException (GettextCatalog.GetString ("Invalid custom command for '{0}' step: the path to the command to execute has not been provided.", TypeLabel));
@@ -227,12 +234,12 @@ namespace MonoDevelop.Projects
return cmd;
}
- public void Execute (IProgressMonitor monitor, IWorkspaceObject entry, ConfigurationSelector configuration)
+ public Task<bool> Execute (ProgressMonitor monitor, WorkspaceObject entry, ConfigurationSelector configuration)
{
- Execute (monitor, entry, null, configuration);
+ return Execute (monitor, entry, null, configuration);
}
- public bool CanExecute (IWorkspaceObject entry, ExecutionContext context, ConfigurationSelector configuration)
+ public bool CanExecute (WorkspaceObject entry, ExecutionContext context, ConfigurationSelector configuration)
{
if (string.IsNullOrEmpty (command))
return false;
@@ -244,7 +251,7 @@ namespace MonoDevelop.Projects
return context.ExecutionHandler.CanExecute (cmd);
}
- public void Execute (IProgressMonitor monitor, IWorkspaceObject entry, ExecutionContext context,
+ public async Task<bool> Execute (ProgressMonitor monitor, WorkspaceObject entry, ExecutionContext context,
ConfigurationSelector configuration)
{
ProcessExecutionCommand cmd = CreateExecutionCommand (entry, configuration);
@@ -253,56 +260,54 @@ namespace MonoDevelop.Projects
if (!Directory.Exists (cmd.WorkingDirectory)) {
monitor.ReportError (GettextCatalog.GetString ("Custom command working directory does not exist"), null);
- return;
+ return false;
}
- AggregatedOperationMonitor aggMon = null;
- IProcessAsyncOperation oper = null;
- IConsole console = null;
+ ProcessAsyncOperation oper = null;
+ OperationConsole console = null;
+ var result = true;
try {
if (context != null) {
if (externalConsole)
- console = context.ExternalConsoleFactory.CreateConsole (!pauseExternalConsole);
+ console = context.ExternalConsoleFactory.CreateConsole (!pauseExternalConsole, monitor.CancellationToken);
else
- console = context.ConsoleFactory.CreateConsole (!pauseExternalConsole);
+ console = context.ConsoleFactory.CreateConsole (monitor.CancellationToken);
oper = context.ExecutionHandler.Execute (cmd, console);
} else {
if (externalConsole) {
- console = ExternalConsoleFactory.Instance.CreateConsole (!pauseExternalConsole);
+ console = context.ExternalConsoleFactory.CreateConsole (!pauseExternalConsole, monitor.CancellationToken);
oper = Runtime.ProcessService.StartConsoleProcess (cmd.Command, cmd.Arguments,
cmd.WorkingDirectory, console, null);
} else {
oper = Runtime.ProcessService.StartProcess (cmd.Command, cmd.Arguments,
- cmd.WorkingDirectory, monitor.Log, monitor.Log, null, false);
+ cmd.WorkingDirectory, monitor.Log, monitor.Log, null, false).ProcessAsyncOperation;
}
}
- aggMon = new AggregatedOperationMonitor (monitor, oper);
- oper.WaitForCompleted ();
- if (!oper.Success) {
+
+ var stopper = monitor.CancellationToken.Register (oper.Cancel);
+
+ await oper.Task;
+
+ stopper.Dispose ();
+
+ if (oper.ExitCode != 0) {
monitor.ReportError ("Custom command failed (exit code: " + oper.ExitCode + ")", null);
}
} catch (Win32Exception w32ex) {
monitor.ReportError (GettextCatalog.GetString ("Failed to execute custom command '{0}': {1}",
cmd.Command, w32ex.Message), null);
- return;
+ return false;
} catch (Exception ex) {
LoggingService.LogError ("Command execution failed", ex);
throw new UserException (GettextCatalog.GetString ("Command execution failed: {0}", ex.Message));
} finally {
- if (oper == null || !oper.Success) {
- monitor.AsyncOperation.Cancel ();
- }
- if (oper != null) {
- oper.Dispose ();
- }
+ result = oper != null && oper.ExitCode == 0;
if (console != null) {
console.Dispose ();
}
- if (aggMon != null) {
- aggMon.Dispose ();
- }
}
+ return result;
}
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommandCollection.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommandCollection.cs
index 797ee6da64..ee37994054 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommandCollection.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommandCollection.cs
@@ -29,6 +29,7 @@
using System;
using System.Collections.Generic;
using MonoDevelop.Core;
+using System.Threading.Tasks;
namespace MonoDevelop.Projects
{
@@ -48,19 +49,20 @@ namespace MonoDevelop.Projects
Add (cmd.Clone ());
}
- public void ExecuteCommand (IProgressMonitor monitor, IWorkspaceObject entry, CustomCommandType type, ConfigurationSelector configuration)
+ public Task<bool> ExecuteCommand (ProgressMonitor monitor, WorkspaceObject entry, CustomCommandType type, ConfigurationSelector configuration)
{
- ExecuteCommand (monitor, entry, type, null, configuration);
+ return ExecuteCommand (monitor, entry, type, null, configuration);
}
- public void ExecuteCommand (IProgressMonitor monitor, IWorkspaceObject entry, CustomCommandType type, ExecutionContext context, ConfigurationSelector configuration)
+ public async Task<bool> ExecuteCommand (ProgressMonitor monitor, WorkspaceObject entry, CustomCommandType type, ExecutionContext context, ConfigurationSelector configuration)
{
foreach (CustomCommand cmd in this) {
- if (cmd.Type == type)
- cmd.Execute (monitor, entry, context, configuration);
- if (monitor.IsCancelRequested)
- break;
+ if (cmd.Type == type) {
+ if (!await cmd.Execute (monitor, entry, context, configuration))
+ return false;
+ }
}
+ return true;
}
public bool HasCommands (CustomCommandType type)
@@ -71,7 +73,7 @@ namespace MonoDevelop.Projects
return false;
}
- public bool CanExecute (IWorkspaceObject entry, CustomCommandType type, ExecutionContext context, ConfigurationSelector configuration)
+ public bool CanExecute (WorkspaceObject entry, CustomCommandType type, ExecutionContext context, ConfigurationSelector configuration)
{
// Note: if this gets changed to return true if *any* of the commands can execute, then
// ExecuteCommand() needs to be fixed to only execute commands that can be executed.
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommandExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommandExtension.cs
deleted file mode 100644
index fc0a9bf77b..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/CustomCommandExtension.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-// CustomCommandExtension.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2007 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-
-using System;
-using MonoDevelop.Core;
-using System.CodeDom.Compiler;
-using MonoDevelop.Core.Execution;
-
-namespace MonoDevelop.Projects
-{
- internal class CustomCommandExtension: ProjectServiceExtension
- {
- protected override BuildResult Build (IProgressMonitor monitor, SolutionEntityItem entry, ConfigurationSelector configuration)
- {
- SolutionItemConfiguration conf = entry.GetConfiguration (configuration) as SolutionItemConfiguration;
- if (conf != null) {
- if (conf.CustomCommands.CanExecute (entry, CustomCommandType.BeforeBuild, null, configuration))
- conf.CustomCommands.ExecuteCommand (monitor, entry, CustomCommandType.BeforeBuild, configuration);
-
- if (monitor.IsCancelRequested)
- return new BuildResult (new CompilerResults (null), "");
- }
-
- BuildResult res = base.Build (monitor, entry, configuration);
-
- if (conf != null && !monitor.IsCancelRequested && !res.Failed) {
- if (conf.CustomCommands.CanExecute (entry, CustomCommandType.AfterBuild, null, configuration))
- conf.CustomCommands.ExecuteCommand (monitor, entry, CustomCommandType.AfterBuild, configuration);
- }
-
- return res;
- }
-
- protected override void Clean (IProgressMonitor monitor, SolutionEntityItem entry, ConfigurationSelector configuration)
- {
- SolutionItemConfiguration conf = entry.GetConfiguration (configuration) as SolutionItemConfiguration;
- if (conf != null) {
- if (conf.CustomCommands.CanExecute (entry, CustomCommandType.BeforeClean, null, configuration))
- conf.CustomCommands.ExecuteCommand (monitor, entry, CustomCommandType.BeforeClean, configuration);
-
- if (monitor.IsCancelRequested)
- return;
- }
-
- base.Clean (monitor, entry, configuration);
-
- if (conf != null && !monitor.IsCancelRequested) {
- if (conf.CustomCommands.CanExecute (entry, CustomCommandType.AfterClean, null, configuration))
- conf.CustomCommands.ExecuteCommand (monitor, entry, CustomCommandType.AfterClean, configuration);
- }
- }
-
- protected override void Execute (IProgressMonitor monitor, SolutionEntityItem entry, ExecutionContext context, ConfigurationSelector configuration)
- {
- SolutionItemConfiguration conf = entry.GetConfiguration (configuration) as SolutionItemConfiguration;
- if (conf != null) {
- ExecutionContext localContext = new ExecutionContext (Runtime.ProcessService.DefaultExecutionHandler, context.ConsoleFactory, context.ExecutionTarget);
-
- if (conf.CustomCommands.CanExecute (entry, CustomCommandType.BeforeExecute, localContext, configuration))
- conf.CustomCommands.ExecuteCommand (monitor, entry, CustomCommandType.BeforeExecute, localContext, configuration);
-
- if (monitor.IsCancelRequested)
- return;
- }
-
- base.Execute (monitor, entry, context, configuration);
-
- if (conf != null && !monitor.IsCancelRequested) {
- ExecutionContext localContext = new ExecutionContext (Runtime.ProcessService.DefaultExecutionHandler, context.ConsoleFactory, context.ExecutionTarget);
-
- if (conf.CustomCommands.CanExecute (entry, CustomCommandType.AfterExecute, localContext, configuration))
- conf.CustomCommands.ExecuteCommand (monitor, entry, CustomCommandType.AfterExecute, localContext, configuration);
- }
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DefaultConfigurationSelector.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DefaultConfigurationSelector.cs
index 9ac0d6162b..53138fa190 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DefaultConfigurationSelector.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DefaultConfigurationSelector.cs
@@ -27,7 +27,7 @@
namespace MonoDevelop.Projects
{
- public class DefaultConfigurationSelector: ConfigurationSelector
+ public sealed class DefaultConfigurationSelector: ConfigurationSelector
{
public override ItemConfiguration GetConfiguration (IConfigurationTarget target)
{
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetAssemblyProject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetAssemblyProject.cs
deleted file mode 100644
index cba01e80c1..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetAssemblyProject.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-//
-// DotNetAssemblyProject.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Xml;
-using MonoDevelop.Core;
-using MonoDevelop.Core.Assemblies;
-
-namespace MonoDevelop.Projects
-{
- [ProjectModelDataItem ("DotNetProject")]
- public class DotNetAssemblyProject: DotNetProject
- {
- public DotNetAssemblyProject ()
- {
- }
-
- public DotNetAssemblyProject (string languageName) : base (languageName)
- {
- }
-
- public DotNetAssemblyProject (string languageName, ProjectCreateInformation projectCreateInfo, XmlElement projectOptions):
- base (languageName, projectCreateInfo, projectOptions)
- {
- }
-
- public override System.Collections.Generic.IEnumerable<string> GetProjectTypes ()
- {
- yield return "DotNetAssembly";
- foreach (var pt in base.GetProjectTypes ())
- yield return pt;
- }
-
- public override bool SupportsFramework (TargetFramework framework)
- {
- // DotNetAssemblyProject can only generate assemblies for the regular framework.
- // Special frameworks such as Moonlight or MonoTouch must subclass DotNetProject directly.
- if (!framework.CanReferenceAssembliesTargetingFramework (TargetFrameworkMoniker.NET_1_1))
- return false;
-
- return base.SupportsFramework (framework);
- }
-
- public override TargetFrameworkMoniker GetDefaultTargetFrameworkForFormat (FileFormat format)
- {
- switch (format.Id) {
- case "MSBuild05":
- return TargetFrameworkMoniker.NET_2_0;
- case "MSBuild08":
- return TargetFrameworkMoniker.NET_2_0;
- case "MSBuild10":
- case "MSBuild12":
- return TargetFrameworkMoniker.NET_4_0;
- }
- return Services.ProjectService.DefaultTargetFramework.Id;
- }
-
- protected override string GetDefaultTargetPlatform (ProjectCreateInformation projectCreateInfo)
- {
- if (CompileTarget == CompileTarget.Library)
- return string.Empty;
-
- // Guess a good default platform for the project
- if (projectCreateInfo.ParentFolder != null && projectCreateInfo.ParentFolder.ParentSolution != null) {
- ItemConfiguration conf = projectCreateInfo.ParentFolder.ParentSolution.GetConfiguration (projectCreateInfo.ActiveConfiguration);
- if (conf != null)
- return conf.Platform;
- else {
- string curName, curPlatform, bestPlatform = null;
- string sconf = projectCreateInfo.ActiveConfiguration.ToString ();
- ItemConfiguration.ParseConfigurationId (sconf, out curName, out curPlatform);
- foreach (ItemConfiguration ic in projectCreateInfo.ParentFolder.ParentSolution.Configurations) {
- if (ic.Platform == curPlatform)
- return curPlatform;
- if (ic.Name == curName)
- bestPlatform = ic.Platform;
- }
- if (bestPlatform != null)
- return bestPlatform;
- }
- }
- return Services.ProjectService.DefaultPlatformTarget;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetCompilerParameters.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetCompilerParameters.cs
new file mode 100644
index 0000000000..ee9e801bcc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetCompilerParameters.cs
@@ -0,0 +1,88 @@
+//
+// ConfigurationParameters.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using MonoDevelop.Core.Serialization;
+using System.Collections.Generic;
+using System.Linq;
+using MonoDevelop.Projects.MSBuild;
+
+namespace MonoDevelop.Projects
+{
+ public abstract class DotNetCompilerParameters
+ {
+ public DotNetProject ParentProject {
+ get { return ParentConfiguration.ParentItem; }
+ }
+
+ internal protected virtual void Read (IPropertySet pset)
+ {
+ pset.ReadObjectProperties (this, GetType (), true);
+ }
+
+ internal protected virtual void Write (IPropertySet pset)
+ {
+ pset.WriteObjectProperties (this, GetType (), true);
+ }
+
+ public virtual DotNetCompilerParameters Clone ()
+ {
+ return (DotNetCompilerParameters) MemberwiseClone ();
+ }
+
+ public virtual IEnumerable<string> GetDefineSymbols ()
+ {
+ yield break;
+ }
+
+ public virtual void AddDefineSymbol (string symbol)
+ {
+ }
+
+ public virtual void RemoveDefineSymbol (string symbol)
+ {
+ }
+
+ public bool HasDefineSymbol (string symbol)
+ {
+ return GetDefineSymbols ().Any (s => s == symbol);
+ }
+
+ public DotNetProjectConfiguration ParentConfiguration { get; internal set; }
+
+ public virtual bool NoStdLib { get; set; }
+
+ public virtual Microsoft.CodeAnalysis.CompilationOptions CreateCompilationOptions ()
+ {
+ return null;
+ }
+
+ public virtual Microsoft.CodeAnalysis.ParseOptions CreateParseOptions (DotNetProjectConfiguration configuration)
+ {
+ return null;
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs
index 904ecdf71a..b951ce7706 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs
@@ -2,7 +2,7 @@
//
// Author:
// Lluis Sanchez Gual <lluis@novell.com>
-//
+//
// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -27,7 +27,6 @@
using System;
using System.Linq;
-using System.CodeDom.Compiler;
using System.Text;
using System.Collections;
using System.Collections.Generic;
@@ -36,107 +35,119 @@ using System.Xml;
using System.Threading;
using MonoDevelop.Core;
using MonoDevelop.Core.Execution;
-using MonoDevelop.Core.Serialization;
-using MonoDevelop.Core.ProgressMonitoring;
using MonoDevelop.Projects.Policies;
-using MonoDevelop.Projects.Formats.MD1;
+using MonoDevelop.Projects.MD1;
using MonoDevelop.Projects.Extensions;
-using MonoDevelop.Projects.Formats.MSBuild;
+using MonoDevelop.Projects.MSBuild;
using MonoDevelop.Core.Assemblies;
using System.Globalization;
+using System.Threading.Tasks;
+using System.Collections.Immutable;
+using MonoDevelop.Projects.MSBuild.Conditions;
namespace MonoDevelop.Projects
{
- [DataInclude(typeof(DotNetProjectConfiguration))]
- [ProjectModelDataItem ("AbstractDotNetProject")]
public abstract class DotNetProject : Project, IAssemblyProject, IDotNetFileContainer
{
bool usePartialTypes = true;
- ProjectParameters languageParameters;
DirectoryAssemblyContext privateAssemblyContext;
ComposedAssemblyContext composedAssemblyContext;
IAssemblyContext currentRuntimeContext;
- [ItemProperty("OutputType")]
CompileTarget compileTarget;
- IDotNetLanguageBinding languageBinding;
+ LanguageBinding languageBinding;
protected ProjectReferenceCollection projectReferences;
- [ItemProperty("RootNamespace", DefaultValue = "")]
protected string defaultNamespace = String.Empty;
-
- public DotNetProject ()
+
+ DotNetProjectFlags flags;
+
+ protected DotNetProject ()
+ {
+ Initialize (this);
+ }
+
+ protected DotNetProject (string languageName, params string[] flavorIds): base (flavorIds)
+ {
+ this.languageName = languageName;
+ Initialize (this);
+ }
+
+ public static DotNetProject CreateProject (string language, params string[] typeGuids)
+ {
+ string typeGuid = MSBuildProjectService.GetLanguageGuid (language);
+ return (DotNetProject) MSBuildProjectService.CreateProject (typeGuid, typeGuids);
+ }
+
+ protected override void OnInitialize ()
{
- Runtime.SystemAssemblyService.DefaultRuntimeChanged += RuntimeSystemAssemblyServiceDefaultRuntimeChanged;
projectReferences = new ProjectReferenceCollection ();
Items.Bind (projectReferences);
- if (IsLibraryBasedProjectType)
- CompileTarget = CompileTarget.Library;
FileService.FileRemoved += OnFileRemoved;
+ Runtime.SystemAssemblyService.DefaultRuntimeChanged += RuntimeSystemAssemblyServiceDefaultRuntimeChanged;
+
+ base.OnInitialize ();
+
+ if (languageName == null)
+ languageName = MSBuildProjectService.GetLanguageFromGuid (TypeGuid);
}
- public DotNetProject (string languageName) : this()
+ protected override void OnExtensionChainInitialized ()
{
- // Language name must be set before the item handler is assigned
- this.languageName = languageName;
- this.languageBinding = FindLanguage (languageName);
+ projectExtension = ExtensionChain.GetExtension<DotNetProjectExtension> ();
+ base.OnExtensionChainInitialized ();
- if (this.languageBinding != null)
- this.StockIcon = this.languageBinding.ProjectStockIcon;
+ if (IsLibraryBasedProjectType)
+ CompileTarget = CompileTarget.Library;
- this.usePartialTypes = SupportsPartialTypes;
+ flags = ProjectExtension.OnGetDotNetProjectFlags ();
+ usePartialTypes = SupportsPartialTypes;
}
- public DotNetProject (string languageName, ProjectCreateInformation projectCreateInfo, XmlElement projectOptions) : this(languageName)
+ protected override void OnSetShared ()
{
+ base.OnSetShared ();
+ projectReferences.SetShared ();
+ }
+
+ protected override void OnInitializeFromTemplate (ProjectCreateInformation projectCreateInfo, XmlElement projectOptions)
+ {
+ base.OnInitializeFromTemplate (projectCreateInfo, projectOptions);
+
if ((projectOptions != null) && (projectOptions.Attributes ["Target"] != null))
CompileTarget = (CompileTarget)Enum.Parse (typeof(CompileTarget), projectOptions.Attributes ["Target"].Value);
else if (IsLibraryBasedProjectType)
CompileTarget = CompileTarget.Library;
if (this.LanguageBinding != null) {
- LanguageParameters = languageBinding.CreateProjectParameters (projectOptions);
-
+
bool externalConsole = false;
string platform = null;
- if (projectOptions != null) {
- projectOptions.SetAttribute ("DefineDebug", "True");
- if (!projectOptions.HasAttribute ("Platform")) {
- // Clone the element since we are going to change it
- platform = GetDefaultTargetPlatform (projectCreateInfo);
- projectOptions = (XmlElement)projectOptions.CloneNode (true);
- projectOptions.SetAttribute ("Platform", platform);
- } else
- platform = projectOptions.GetAttribute ("Platform");
- if (projectOptions.GetAttribute ("ExternalConsole") == "True")
- externalConsole = true;
- }
+ if (!projectOptions.HasAttribute ("Platform")) {
+ // Clone the element since we are going to change it
+ platform = GetDefaultTargetPlatform (projectCreateInfo);
+ projectOptions = (XmlElement)projectOptions.CloneNode (true);
+ projectOptions.SetAttribute ("Platform", platform);
+ } else
+ platform = projectOptions.GetAttribute ("Platform");
+
+ if (projectOptions.GetAttribute ("ExternalConsole") == "True")
+ externalConsole = true;
+
string platformSuffix = string.IsNullOrEmpty (platform) ? string.Empty : "|" + platform;
- DotNetProjectConfiguration configDebug = CreateConfiguration ("Debug" + platformSuffix) as DotNetProjectConfiguration;
- configDebug.CompilationParameters = languageBinding.CreateCompilationParameters (projectOptions);
+ DotNetProjectConfiguration configDebug = CreateConfiguration ("Debug" + platformSuffix, ConfigurationKind.Debug) as DotNetProjectConfiguration;
DefineSymbols (configDebug.CompilationParameters, projectOptions, "DefineConstantsDebug");
- configDebug.DebugMode = true;
configDebug.ExternalConsole = externalConsole;
configDebug.PauseConsoleOutput = externalConsole;
Configurations.Add (configDebug);
- DotNetProjectConfiguration configRelease = CreateConfiguration ("Release" + platformSuffix) as DotNetProjectConfiguration;
-
- if (projectOptions != null) {
- XmlElement releaseProjectOptions = (XmlElement)projectOptions.CloneNode (true);
- releaseProjectOptions.SetAttribute ("Release", "True");
- configRelease.CompilationParameters = languageBinding.CreateCompilationParameters (releaseProjectOptions);
- DefineSymbols (configRelease.CompilationParameters, projectOptions, "DefineConstantsRelease");
- } else {
- configRelease.CompilationParameters = languageBinding.CreateCompilationParameters (null);
- }
-
+ DotNetProjectConfiguration configRelease = CreateConfiguration ("Release" + platformSuffix, ConfigurationKind.Release) as DotNetProjectConfiguration;
+ DefineSymbols (configRelease.CompilationParameters, projectOptions, "DefineConstantsRelease");
configRelease.CompilationParameters.RemoveDefineSymbol ("DEBUG");
- configRelease.DebugMode = false;
configRelease.ExternalConsole = externalConsole;
configRelease.PauseConsoleOutput = externalConsole;
Configurations.Add (configRelease);
@@ -164,7 +175,7 @@ namespace MonoDevelop.Projects
}
}
- void DefineSymbols (ConfigurationParameters pars, XmlElement projectOptions, string attributeName)
+ void DefineSymbols (DotNetCompilerParameters pars, XmlElement projectOptions, string attributeName)
{
if (projectOptions != null) {
string symbols = projectOptions.GetAttribute (attributeName);
@@ -196,9 +207,33 @@ namespace MonoDevelop.Projects
return Runtime.SystemAssemblyService.GetTargetFramework (moniker);
}
- public override IEnumerable<string> GetProjectTypes ()
+ protected override void OnGetTypeTags (HashSet<string> types)
+ {
+ base.OnGetTypeTags (types);
+ types.Add ("DotNet");
+ types.Add ("DotNetAssembly");
+ }
+
+ DotNetProjectExtension projectExtension;
+ DotNetProjectExtension ProjectExtension {
+ get {
+ if (projectExtension == null)
+ AssertExtensionChainCreated ();
+ return projectExtension;
+ }
+ }
+
+ protected override IEnumerable<WorkspaceObjectExtension> CreateDefaultExtensions ()
+ {
+ return base.CreateDefaultExtensions ().Concat (Enumerable.Repeat (new DefaultDotNetProjectExtension (), 1));
+ }
+
+ protected override ProjectItem OnCreateProjectItem (IMSBuildItemEvaluated item)
{
- yield return "DotNet";
+ if (item.Name == "Reference" || item.Name == "ProjectReference")
+ return new ProjectReference ();
+
+ return base.OnCreateProjectItem (item);
}
private string languageName;
@@ -206,23 +241,62 @@ namespace MonoDevelop.Projects
get { return languageName; }
}
- public override string[] SupportedLanguages {
- get { return new string[] {"",languageName}; }
+ protected override string[] OnGetSupportedLanguages ()
+ {
+ return new [] { "", languageName };
+ }
+
+ public bool IsLibraryBasedProjectType {
+ get { return (flags & DotNetProjectFlags.IsLibrary) != 0; }
}
- public virtual bool IsLibraryBasedProjectType {
- get { return false; }
+ public bool IsPortableLibrary {
+ get { return GetService<PortableDotNetProjectFlavor> () != null; }
+ }
+
+ public bool GeneratesDebugInfoFile {
+ get { return (flags & DotNetProjectFlags.GeneratesDebugInfoFile) != 0; }
+ }
+
+ public bool SupportsRoslyn { get; protected set; }
+
+ protected virtual DotNetProjectFlags OnGetDotNetProjectFlags ()
+ {
+ return DotNetProjectFlags.GeneratesDebugInfoFile;
}
- public virtual bool GeneratesDebugInfoFile {
- get { return true; }
+ protected string GetDefaultTargetPlatform (ProjectCreateInformation projectCreateInfo)
+ {
+ return ProjectExtension.OnGetDefaultTargetPlatform (projectCreateInfo);
}
-
- protected virtual string GetDefaultTargetPlatform (ProjectCreateInformation projectCreateInfo)
+
+ protected virtual string OnGetDefaultTargetPlatform (ProjectCreateInformation projectCreateInfo)
{
- return string.Empty;
+ if (CompileTarget == CompileTarget.Library)
+ return string.Empty;
+
+ // Guess a good default platform for the project
+ if (projectCreateInfo.ParentFolder != null && projectCreateInfo.ParentFolder.ParentSolution != null) {
+ ItemConfiguration conf = projectCreateInfo.ParentFolder.ParentSolution.GetConfiguration (projectCreateInfo.ActiveConfiguration);
+ if (conf != null)
+ return conf.Platform;
+ else {
+ string curName, curPlatform, bestPlatform = null;
+ string sconf = projectCreateInfo.ActiveConfiguration.ToString ();
+ ItemConfiguration.ParseConfigurationId (sconf, out curName, out curPlatform);
+ foreach (ItemConfiguration ic in projectCreateInfo.ParentFolder.ParentSolution.Configurations) {
+ if (ic.Platform == curPlatform)
+ return curPlatform;
+ if (ic.Name == curName)
+ bestPlatform = ic.Platform;
+ }
+ if (bestPlatform != null)
+ return bestPlatform;
+ }
+ }
+ return Services.ProjectService.DefaultPlatformTarget;
}
-
+
public ProjectReferenceCollection References {
get { return projectReferences; }
}
@@ -239,7 +313,11 @@ namespace MonoDevelop.Projects
}
}
- public virtual bool CanReferenceProject (DotNetProject targetProject, out string reason)
+ public bool CanReferenceProject (DotNetProject targetProject, out string reason)
+ {
+ return ProjectExtension.OnGetCanReferenceProject (targetProject, out reason);
+ }
+ bool CheckCanReferenceProject (DotNetProject targetProject, out string reason)
{
if (!TargetFramework.CanReferenceAssembliesTargetingFramework (targetProject.TargetFramework)) {
reason = GettextCatalog.GetString ("Incompatible target framework: {0}", targetProject.TargetFramework.Id);
@@ -251,7 +329,7 @@ namespace MonoDevelop.Projects
return true;
}
- public IDotNetLanguageBinding LanguageBinding {
+ public LanguageBinding LanguageBinding {
get {
if (languageBinding == null) {
languageBinding = FindLanguage (languageName);
@@ -276,20 +354,6 @@ namespace MonoDevelop.Projects
}
}
- [ItemProperty("LanguageParameters")]
- public ProjectParameters LanguageParameters {
- get {
- if (languageParameters == null && LanguageBinding != null)
- LanguageParameters = LanguageBinding.CreateProjectParameters (null);
- return languageParameters;
- }
- internal set {
- languageParameters = value;
- if (languageParameters != null)
- languageParameters.ParentProject = this;
- }
- }
-
/// <summary>
/// Default namespace setting. May be empty, use GetDefaultNamespace to get a usable value.
/// </summary>
@@ -300,7 +364,7 @@ namespace MonoDevelop.Projects
NotifyModified ("DefaultNamespace");
}
}
-
+
/// <summary>
/// Given a namespace, removes from it the implicit namespace of the project,
/// if there is one. This depends on the target language. For example, in VB.NET
@@ -308,7 +372,7 @@ namespace MonoDevelop.Projects
/// </summary>
public string StripImplicitNamespace (string ns)
{
- if ((LanguageParameters is DotNetProjectParameters) && ((DotNetProjectParameters)LanguageParameters).DefaultNamespaceIsImplicit) {
+ if (DefaultNamespaceIsImplicit) {
if (DefaultNamespace.Length > 0 && ns.StartsWith (DefaultNamespace + "."))
return ns.Substring (DefaultNamespace.Length + 1);
else if (DefaultNamespace == ns)
@@ -317,23 +381,8 @@ namespace MonoDevelop.Projects
return ns;
}
- IResourceHandler resourceHandler;
+ public bool DefaultNamespaceIsImplicit { get; set; }
- public IResourceHandler ResourceHandler {
- get {
- if (resourceHandler == null) {
- DotNetNamingPolicy pol = Policies.Get<DotNetNamingPolicy> ();
- if (pol.ResourceNamePolicy == ResourceNamePolicy.FileFormatDefault)
- resourceHandler = ItemHandler as IResourceHandler;
- else if (pol.ResourceNamePolicy == ResourceNamePolicy.MSBuild)
- resourceHandler = MSBuildProjectService.GetResourceHandlerForItem (this);
- if (resourceHandler == null)
- resourceHandler = DefaultResourceHandler.Instance;
- }
- return resourceHandler;
- }
- }
-
TargetFramework targetFramework;
public TargetFramework TargetFramework {
@@ -348,7 +397,7 @@ namespace MonoDevelop.Projects
if (!SupportsFramework (value))
throw new ArgumentException ("Project does not support framework '" + value.Id.ToString () +"'");
if (value == null)
- value = Runtime.SystemAssemblyService.GetTargetFramework (GetDefaultTargetFrameworkForFormat (FileFormat));
+ value = Runtime.SystemAssemblyService.GetTargetFramework (GetDefaultTargetFrameworkForFormat (ToolsVersion));
if (targetFramework != null && value.Id == targetFramework.Id)
return;
bool updateReferences = targetFramework != null;
@@ -362,36 +411,59 @@ namespace MonoDevelop.Projects
public TargetRuntime TargetRuntime {
get { return Runtime.SystemAssemblyService.DefaultRuntime; }
}
-
+
/// <summary>
/// Gets the target framework for new projects
/// </summary>
/// <returns>
/// The default target framework identifier.
/// </returns>
- public virtual TargetFrameworkMoniker GetDefaultTargetFrameworkId ()
+ public TargetFrameworkMoniker GetDefaultTargetFrameworkId ()
+ {
+ return ProjectExtension.OnGetDefaultTargetFrameworkId ();
+ }
+
+ protected virtual TargetFrameworkMoniker OnGetDefaultTargetFrameworkId ()
{
return Services.ProjectService.DefaultTargetFramework.Id;
}
-
+
/// <summary>
/// Returns the default framework for a given format
/// </summary>
/// <returns>
/// The default target framework for the format.
/// </returns>
- /// <param name='format'>
- /// A format
+ /// <param name='toolsVersion'>
+ /// MSBuild tools version for which to get the default format
/// </param>
/// <remarks>
/// This method is used to determine what's the correct target framework for a project
/// deserialized using a specific format.
/// </remarks>
- public virtual TargetFrameworkMoniker GetDefaultTargetFrameworkForFormat (FileFormat format)
+ public TargetFrameworkMoniker GetDefaultTargetFrameworkForFormat (string toolsVersion)
+ {
+ return ProjectExtension.OnGetDefaultTargetFrameworkForFormat (toolsVersion);
+ }
+
+ protected virtual TargetFrameworkMoniker OnGetDefaultTargetFrameworkForFormat (string toolsVersion)
{
- return GetDefaultTargetFrameworkId ();
+ // If GetDefaultTargetFrameworkId has been overriden to return something different than the
+ // default framework, but OnGetDefaultTargetFrameworkForFormat has not been overriden, then
+ // the framework most likely to be correct is the one returned by GetDefaultTargetFrameworkId.
+
+ var fxid = GetDefaultTargetFrameworkId ();
+ if (fxid == Services.ProjectService.DefaultTargetFramework.Id) {
+ switch (toolsVersion) {
+ case "2.0":
+ return TargetFrameworkMoniker.NET_2_0;
+ case "4.0":
+ return TargetFrameworkMoniker.NET_4_0;
+ }
+ }
+ return fxid;
}
-
+
public IAssemblyContext AssemblyContext {
get {
if (composedAssemblyContext == null) {
@@ -412,11 +484,20 @@ namespace MonoDevelop.Projects
}
}
- public virtual bool SupportsFramework (TargetFramework framework)
+ public bool SupportsFramework (TargetFramework framework)
+ {
+ return ProjectExtension.OnGetSupportsFramework (framework);
+ }
+
+ protected virtual bool OnSupportsFramework (TargetFramework framework)
{
+ // DotNetAssemblyProject can only generate assemblies for the regular framework.
+ // Special frameworks such as Moonlight or MonoTouch must override SupportsFramework.
+ if (!framework.CanReferenceAssembliesTargetingFramework (TargetFrameworkMoniker.NET_1_1))
+ return false;
if (LanguageBinding == null)
return false;
- ClrVersion[] versions = LanguageBinding.GetSupportedClrVersions ();
+ ClrVersion[] versions = OnGetSupportedClrVersions ();
if (versions != null && versions.Length > 0 && framework != null) {
foreach (ClrVersion v in versions) {
if (v == framework.ClrVersion)
@@ -426,44 +507,32 @@ namespace MonoDevelop.Projects
return false;
}
- [ItemProperty(DefaultValue = true)]
public bool UsePartialTypes {
get { return usePartialTypes; }
set { usePartialTypes = value; }
}
- public override void Dispose ()
+ protected override void OnDispose ()
{
if (composedAssemblyContext != null) {
composedAssemblyContext.Dispose ();
// composedAssemblyContext = null;
}
-
+
// languageParameters = null;
// privateAssemblyContext = null;
// currentRuntimeContext = null;
// languageBinding = null;
// projectReferences = null;
-
+
Runtime.SystemAssemblyService.DefaultRuntimeChanged -= RuntimeSystemAssemblyServiceDefaultRuntimeChanged;
FileService.FileRemoved -= OnFileRemoved;
-
- base.Dispose ();
- }
- public virtual bool SupportsPartialTypes {
- get {
- if (LanguageBinding == null)
- return false;
- System.CodeDom.Compiler.CodeDomProvider provider = LanguageBinding.GetCodeDomProvider ();
- if (provider == null)
- return false;
- return provider.Supports (System.CodeDom.Compiler.GeneratorSupport.PartialTypes);
- }
+ base.OnDispose ();
}
- public override string[] SupportedPlatforms {
- get { return new string[] { "AnyCPU" }; }
+ public bool SupportsPartialTypes {
+ get { return LanguageBinding.SupportsPartialTypes; }
}
void CheckReferenceChange (FilePath updatedFile)
@@ -483,16 +552,16 @@ namespace MonoDevelop.Projects
}
}
- /* Removed because it is very slow. SetFastBuildCheckDirty() is being called above. It is not the perfect solution but it is good enough
- * In the new project model GetReferencedAssemblies is asynchronous, so the code can be uncommented there.
-
// If a referenced assembly changes, dirtify the project.
- foreach (var asm in GetReferencedAssemblies (DefaultConfiguration.Selector))
- if (asm == updatedFile) {
- SetFastBuildCheckDirty ();
- break;
- }
- */
+/* if (DefaultConfiguration != null) {
+ foreach (var asm in await GetReferencedAssemblies (DefaultConfiguration.Selector))
+ if (asm == updatedFile) {
+ SetFastBuildCheckDirty ();
+ break;
+ }
+ }
+ Removed for now since it can be a very slow operation
+ */
}
internal override void OnFileChanged (object source, MonoDevelop.Core.FileEventArgs e)
@@ -503,7 +572,7 @@ namespace MonoDevelop.Projects
// cached and won't take into account unsubscriptions until the next dispatch
if (Disposed)
return;
-
+
base.OnFileChanged (source, e);
foreach (FileEventInfo ei in e)
CheckReferenceChange (ei.FileName);
@@ -512,7 +581,7 @@ namespace MonoDevelop.Projects
internal void RenameReferences (string oldName, string newName)
{
- ArrayList toBeRenamed = new ArrayList ();
+ List<ProjectReference> toBeRenamed = new List<ProjectReference> ();
foreach (ProjectReference refInfo in this.References) {
if (refInfo.ReferenceType == ReferenceType.Project) {
@@ -527,24 +596,24 @@ namespace MonoDevelop.Projects
this.References.Add (prNew);
}
}
-
+
internal protected override void PopulateOutputFileList (List<FilePath> list, ConfigurationSelector configuration)
{
base.PopulateOutputFileList (list, configuration);
DotNetProjectConfiguration conf = GetConfiguration (configuration) as DotNetProjectConfiguration;
-
+
// Debug info file
-
- if (conf.DebugMode) {
+
+ if (conf.DebugSymbols) {
string mdbFile = TargetRuntime.GetAssemblyDebugInfoFile (conf.CompiledOutputName);
list.Add (mdbFile);
}
-
+
// Generated satellite resource files
-
+
FilePath outputDir = conf.OutputDirectory;
string satelliteAsmName = Path.GetFileNameWithoutExtension (conf.CompiledOutputName) + ".resources.dll";
-
+
HashSet<string> cultures = new HashSet<string> ();
foreach (ProjectFile finfo in Files) {
if (finfo.Subtype == Subtype.Directory || finfo.BuildAction != BuildAction.EmbeddedResource)
@@ -558,7 +627,7 @@ namespace MonoDevelop.Projects
}
}
}
-
+
[ThreadStatic]
static int supportReferDistance;
[ThreadStatic]
@@ -587,34 +656,42 @@ namespace MonoDevelop.Projects
//rename the app.config file
list.Remove ("app.config");
list.Remove ("App.config");
-
+
ProjectFile appConfig = Files.FirstOrDefault (f => f.FilePath.FileName.Equals ("app.config", StringComparison.CurrentCultureIgnoreCase));
if (appConfig != null) {
string output = GetOutputFileName (configuration).FileName;
list.Add (appConfig.FilePath, true, output + ".config");
}
-
+
//collect all the "local copy" references and their attendant files
foreach (ProjectReference projectReference in References) {
if (!projectReference.LocalCopy || !projectReference.CanSetLocalCopy)
continue;
if (ParentSolution != null && projectReference.ReferenceType == ReferenceType.Project) {
- DotNetProject p = ParentSolution.FindProjectByName (projectReference.Reference) as DotNetProject;
+ DotNetProject p = projectReference.ResolveProject (ParentSolution) as DotNetProject;
if (p == null) {
LoggingService.LogWarning ("Project '{0}' referenced from '{1}' could not be found", projectReference.Reference, this.Name);
continue;
- }
+ }
+
DotNetProjectConfiguration conf = p.GetConfiguration (configuration) as DotNetProjectConfiguration;
//VS COMPAT: recursively copy references's "local copy" files
- //but only copy the "copy to output" files from the immediate references
- if (processedProjects.Add (p) || supportReferDistance == 1) {
- foreach (var v in p.GetOutputFiles (configuration))
- list.Add (v, true, v.CanonicalPath.ToString ().Substring (conf.OutputDirectory.CanonicalPath.ToString ().Length + 1));
-
- foreach (var v in p.GetSupportFileList (configuration))
- list.Add (v.Src, v.CopyOnlyIfNewer, v.Target);
+ //but only copy the "copy to output" files from the immediate references
+
+ if (processedProjects.Add (p) || supportReferDistance == 1) {
+
+ foreach (var v in p.GetOutputFiles (configuration))
+
+ list.Add (v, true, v.CanonicalPath.ToString ().Substring (conf.OutputDirectory.CanonicalPath.ToString ().Length + 1));
+
+
+
+ foreach (var v in p.GetSupportFileList (configuration))
+
+ list.Add (v.Src, v.CopyOnlyIfNewer, v.Target);
+
}
}
else if (projectReference.ReferenceType == ReferenceType.Assembly) {
@@ -640,7 +717,7 @@ namespace MonoDevelop.Projects
}
}
}
-
+
//Given a filename like foo.it.resx, get 'it', if its
//a valid culture
//Note: hand-written as this can get called lotsa times
@@ -690,14 +767,14 @@ namespace MonoDevelop.Projects
return cultureNamesTable;
}
}
-
+
IEnumerable<string> GetAssemblyRefsRec (string fileName, HashSet<string> visited)
{
// Recursivelly finds assemblies referenced by the given assembly
-
+
if (!visited.Add (fileName))
yield break;
-
+
if (!File.Exists (fileName)) {
string ext = Path.GetExtension (fileName).ToLower ();
if (ext == ".dll" || ext == ".exe")
@@ -709,7 +786,7 @@ namespace MonoDevelop.Projects
else
yield break;
}
-
+
yield return fileName;
foreach (var reference in SystemAssemblyService.GetAssemblyReferences (fileName)) {
@@ -726,20 +803,21 @@ namespace MonoDevelop.Projects
return rInfo;
}
}
- ProjectReference newReferenceInformation = new ProjectReference (ReferenceType.Assembly, filename);
+ ProjectReference newReferenceInformation = ProjectReference.CreateAssemblyFileReference (filename);
References.Add (newReferenceInformation);
return newReferenceInformation;
}
- public override IEnumerable<SolutionItem> GetReferencedItems (ConfigurationSelector configuration)
+ protected override IEnumerable<SolutionItem> OnGetReferencedItems (ConfigurationSelector configuration)
{
- List<SolutionItem> items = new List<SolutionItem> (base.GetReferencedItems (configuration));
+ var items = new List<SolutionItem> (base.OnGetReferencedItems (configuration));
if (ParentSolution == null)
return items;
foreach (ProjectReference pref in References) {
- if (pref.ReferenceType == ReferenceType.Project) {
- Project rp = ParentSolution.FindProjectByName (pref.Reference);
+ if (pref.ReferenceType == ReferenceType.Project && (string.IsNullOrEmpty (pref.Condition) ||
+ ConditionParser.ParseAndEvaluate (pref.Condition, new ProjectParserContext (this, (DotNetProjectConfiguration)GetConfiguration (configuration))))) {
+ Project rp = pref.ResolveProject (ParentSolution);
if (rp != null)
items.Add (rp);
}
@@ -754,7 +832,7 @@ namespace MonoDevelop.Projects
/// <param name="configuration">
/// Configuration for which to get the assemblies.
/// </param>
- public IEnumerable<string> GetReferencedAssemblies (ConfigurationSelector configuration)
+ public Task<IEnumerable<string>> GetReferencedAssemblies (ConfigurationSelector configuration)
{
return GetReferencedAssemblies (configuration, true);
}
@@ -769,66 +847,157 @@ namespace MonoDevelop.Projects
/// When set to true, it will include assemblies generated by referenced project. When set to false,
/// it will only include package and direct assembly references.
/// </param>
- public IEnumerable<string> GetReferencedAssemblies (ConfigurationSelector configuration, bool includeProjectReferences)
+ public Task<IEnumerable<string>> GetReferencedAssemblies (ConfigurationSelector configuration, bool includeProjectReferences)
{
- return Services.ProjectService.GetExtensionChain (this).GetReferencedAssemblies (this, configuration, includeProjectReferences);
- }
-
- internal protected virtual IEnumerable<string> OnGetReferencedAssemblies (ConfigurationSelector configuration, bool includeProjectReferences)
- {
- IAssemblyReferenceHandler handler = this.ItemHandler as IAssemblyReferenceHandler;
- if (handler != null) {
+ return BindTask<IEnumerable<string>> (async ct => {
+ var res = await ProjectExtension.OnGetReferencedAssemblies (configuration);
+
if (includeProjectReferences) {
foreach (ProjectReference pref in References.Where (pr => pr.ReferenceType == ReferenceType.Project)) {
foreach (string asm in pref.GetReferencedFileNames (configuration))
- yield return asm;
+ res.Add (asm);
}
}
- foreach (string file in handler.GetAssemblyReferences (configuration))
- yield return file;
- }
- else {
+ return res;
+ });
+ }
+
+ /// <summary>
+ /// Gets the referenced assembly projects, but only projects which output are actually referenced
+ /// for example references with ReferenceOutputAssembly=false are excluded
+ /// </summary>
+ /// <param name="configuration">Configuration.</param>
+ public IEnumerable<DotNetProject> GetReferencedAssemblyProjects (ConfigurationSelector configuration)
+ {
+ return ProjectExtension.OnGetReferencedAssemblyProjects (configuration);
+ }
+
+ internal protected virtual async Task<List<string>> OnGetReferencedAssemblies (ConfigurationSelector configuration)
+ {
+ List<string> result = new List<string> ();
+ if (CheckUseMSBuildEngine (configuration)) {
+ // Get the references list from the msbuild project
+ RemoteProjectBuilder builder = await GetProjectBuilder ();
+ try {
+ var configs = GetConfigurations (configuration, false);
+
+ string [] refs;
+ using (Counters.ResolveMSBuildReferencesTimer.BeginTiming (GetProjectEventMetadata (configuration)))
+ refs = await builder.ResolveAssemblyReferences (configs, CancellationToken.None);
+ foreach (var r in refs)
+ result.Add (r);
+ } finally {
+ builder.ReleaseReference ();
+ }
+ } else {
foreach (ProjectReference pref in References) {
- if (includeProjectReferences || pref.ReferenceType != ReferenceType.Project) {
+ if (pref.ReferenceType != ReferenceType.Project) {
foreach (string asm in pref.GetReferencedFileNames (configuration))
- yield return asm;
+ result.Add (asm);
}
}
+ var mscorlib = AssemblyContext.GetAssemblyFullName ("mscorlib", TargetFramework);
+ var mscorlibPath = AssemblyContext.GetAssemblyLocation (mscorlib, TargetFramework);
+ if (!result.Contains (mscorlibPath))
+ result.Add (mscorlibPath);
+
+ var core = AssemblyContext.GetAssemblyFullName ("System.Core", TargetFramework);
+ var corePath = AssemblyContext.GetAssemblyLocation (core, TargetFramework);
+ if (!string.IsNullOrEmpty (corePath)) {
+ if (!result.Contains (corePath))
+ result.Add (corePath);
+ }
}
var config = (DotNetProjectConfiguration)GetConfiguration (configuration);
bool noStdLib = false;
- if (config != null) {
- var parameters = config.CompilationParameters as DotNetConfigurationParameters;
- if (parameters != null) {
- noStdLib = parameters.NoStdLib;
- }
- }
+ if (config != null)
+ noStdLib = config.CompilationParameters.NoStdLib;
// System.Core is an implicit reference
if (!noStdLib) {
var sa = AssemblyContext.GetAssemblies (TargetFramework).FirstOrDefault (a => a.Name == "System.Core" && a.Package.IsFrameworkPackage);
if (sa != null)
- yield return sa.Location;
+ result.Add (sa.Location);
}
+ var addFacadeAssemblies = false;
+ foreach (var r in GetReferencedAssemblyProjects (configuration)) {
+ if (r.IsPortableLibrary) {
+ addFacadeAssemblies = true;
+ break;
+ }
+ }
+ if (!addFacadeAssemblies) {
+ foreach (var refFilename in result) {
+ string fullPath = null;
+ if (!Path.IsPathRooted (refFilename)) {
+ fullPath = Path.Combine (Path.GetDirectoryName (FileName), refFilename);
+ } else {
+ fullPath = Path.GetFullPath (refFilename);
+ }
+ if (SystemAssemblyService.ContainsReferenceToSystemRuntime (fullPath)) {
+ addFacadeAssemblies = true;
+ break;
+ }
+ }
+ }
+
+ if (addFacadeAssemblies) {
+ var runtime = TargetRuntime ?? MonoDevelop.Core.Runtime.SystemAssemblyService.DefaultRuntime;
+ var facades = runtime.FindFacadeAssembliesForPCL (TargetFramework);
+ foreach (var facade in facades) {
+ if (!File.Exists (facade))
+ continue;
+ result.Add (facade);
+ }
+ }
+ return result;
+ }
+
+ internal protected virtual IEnumerable<DotNetProject> OnGetReferencedAssemblyProjects (ConfigurationSelector configuration)
+ {
+ if (ParentSolution == null) {
+ yield break;
+ }
+ foreach (ProjectReference pref in References) {
+ if (pref.ReferenceType == ReferenceType.Project &&
+ (string.IsNullOrEmpty (pref.Condition) || ConditionParser.ParseAndEvaluate (pref.Condition, new ProjectParserContext (this, (DotNetProjectConfiguration)GetConfiguration (configuration))))) {
+ if (!pref.ReferenceOutputAssembly)
+ continue;
+ var rp = pref.ResolveProject (ParentSolution) as DotNetProject;
+ if (rp != null)
+ yield return rp;
+ }
+ }
+ }
+
+ protected override Task<BuildResult> DoBuild (ProgressMonitor monitor, ConfigurationSelector configuration)
+ {
+ var handler = new MD1DotNetProjectHandler (this);
+ return handler.RunTarget (monitor, "Build", configuration);
}
- protected internal override void OnSave (IProgressMonitor monitor)
+ protected override Task<BuildResult> DoClean (ProgressMonitor monitor, ConfigurationSelector configuration)
+ {
+ var handler = new MD1DotNetProjectHandler (this);
+ return handler.RunTarget (monitor, "Clean", configuration);
+ }
+
+ protected internal override Task OnSave (ProgressMonitor monitor)
{
// Make sure the fx version is sorted out before saving
- // to avoid changes in project references while saving
+ // to avoid changes in project references while saving
if (targetFramework == null)
- targetFramework = Runtime.SystemAssemblyService.GetTargetFramework (GetDefaultTargetFrameworkForFormat (FileFormat));
- base.OnSave (monitor);
+ targetFramework = Runtime.SystemAssemblyService.GetTargetFramework (GetDefaultTargetFrameworkForFormat (ToolsVersion));
+ return base.OnSave (monitor);
}
- IDotNetLanguageBinding FindLanguage (string name)
+ LanguageBinding FindLanguage (string name)
{
- IDotNetLanguageBinding binding = LanguageBindingService.GetBindingPerLanguageName (languageName) as IDotNetLanguageBinding;
- return binding;
+ return LanguageBindingService.GetBindingPerLanguageName (languageName);
}
- public override SolutionItemConfiguration CreateConfiguration (string name)
+ protected override SolutionItemConfiguration OnCreateConfiguration (string name, ConfigurationKind kind)
{
DotNetProjectConfiguration conf = new DotNetProjectConfiguration (name);
string dir;
@@ -839,20 +1008,22 @@ namespace MonoDevelop.Projects
conf.OutputDirectory = String.IsNullOrEmpty (BaseDirectory) ? dir : Path.Combine (BaseDirectory, dir);
conf.OutputAssembly = Name;
- if (LanguageBinding != null) {
- XmlElement xconf = null;
- if (!string.IsNullOrEmpty (conf.Platform)) {
- XmlDocument doc = new XmlDocument ();
- xconf = doc.CreateElement ("Options");
- xconf.SetAttribute ("Platform", conf.Platform);
- }
- conf.CompilationParameters = LanguageBinding.CreateCompilationParameters (xconf);
+
+ if (kind == ConfigurationKind.Debug) {
+ conf.DebugSymbols = true;
+ conf.DebugType = "full";
+ } else {
+ conf.DebugSymbols = false;
}
+
+ if (LanguageBinding != null)
+ conf.CompilationParameters = OnCreateCompilationParameters (conf, kind);
+
return conf;
}
- public override FilePath GetOutputFileName (ConfigurationSelector configuration)
+ protected override FilePath OnGetOutputFileName (ConfigurationSelector configuration)
{
DotNetProjectConfiguration conf = (DotNetProjectConfiguration)GetConfiguration (configuration);
if (conf != null)
@@ -865,7 +1036,7 @@ namespace MonoDevelop.Projects
{
if (base.CheckNeedsBuild (configuration))
return true;
-
+
// base.CheckNeedsBuild() checks Project references, but not Assembly, Package, or Custom.
DateTime mtime = GetLastBuildTime (configuration);
foreach (ProjectReference pref in References) {
@@ -901,14 +1072,14 @@ namespace MonoDevelop.Projects
&& String.Compare (Path.GetExtension (file.FilePath), ".resx", StringComparison.OrdinalIgnoreCase) == 0
&& MD1DotNetProjectHandler.IsResgenRequired (file.FilePath, config.IntermediateOutputDirectory.Combine (file.ResourceId)));
}
-
+
protected internal override DateTime OnGetLastBuildTime (ConfigurationSelector configuration)
{
var outputBuildTime = base.OnGetLastBuildTime (configuration);
-
+
//if the debug file is newer than the output file, use that as the build time
var conf = (DotNetProjectConfiguration) GetConfiguration (configuration);
- if (GeneratesDebugInfoFile && conf != null && conf.DebugMode) {
+ if (GeneratesDebugInfoFile && conf != null && conf.DebugSymbols) {
string file = GetOutputFileName (configuration);
if (file != null) {
file = TargetRuntime.GetAssemblyDebugInfoFile (file);
@@ -922,7 +1093,7 @@ namespace MonoDevelop.Projects
}
return outputBuildTime;
}
-
+
public IList<string> GetUserAssemblyPaths (ConfigurationSelector configuration)
{
if (ParentSolution == null)
@@ -934,18 +1105,22 @@ namespace MonoDevelop.Projects
.Where (d => !string.IsNullOrEmpty (d)).ToList ();
}
- protected virtual ExecutionCommand CreateExecutionCommand (ConfigurationSelector configSel, DotNetProjectConfiguration configuration)
+ public ExecutionCommand CreateExecutionCommand (ConfigurationSelector configSel, DotNetProjectConfiguration configuration)
+ {
+ return ProjectExtension.OnCreateExecutionCommand (configSel, configuration);
+ }
+
+ internal protected virtual ExecutionCommand OnCreateExecutionCommand (ConfigurationSelector configSel, DotNetProjectConfiguration configuration)
{
DotNetExecutionCommand cmd = new DotNetExecutionCommand (configuration.CompiledOutputName);
cmd.Arguments = configuration.CommandLineParameters;
cmd.WorkingDirectory = Path.GetDirectoryName (configuration.CompiledOutputName);
cmd.EnvironmentVariables = configuration.GetParsedEnvironmentVariables ();
cmd.TargetRuntime = TargetRuntime;
- cmd.UserAssemblyPaths = GetUserAssemblyPaths (configSel);
return cmd;
}
- protected internal override bool OnGetCanExecute (ExecutionContext context, ConfigurationSelector configuration)
+ protected override bool OnGetCanExecute (ExecutionContext context, ConfigurationSelector configuration)
{
DotNetProjectConfiguration config = (DotNetProjectConfiguration) GetConfiguration (configuration);
if (config == null)
@@ -957,29 +1132,22 @@ namespace MonoDevelop.Projects
return (compileTarget == CompileTarget.Exe || compileTarget == CompileTarget.WinExe) && context.ExecutionHandler.CanExecute (cmd);
}
- internal protected override bool OnGetSupportsExecute ()
+ protected override ProjectFeatures OnGetSupportedFeatures ()
{
- if (compileTarget == CompileTarget.Exe || compileTarget == CompileTarget.WinExe)
- return true;
+ var sf = base.OnGetSupportedFeatures ();
- if (Configurations.OfType<DotNetProjectConfiguration> ().Any (c => c.CustomCommands.Any (cc => cc.Type == CustomCommandType.Execute)))
- return true;
-
- // Hack to keep backwards compatibility with the old behavior. For example, a MonoDroid project is a library, but OnGetSupportsExecute
- // is not overriden, so it depends on DotNetProject to return true by default.
- if (compileTarget == CompileTarget.Library) {
- Type thisType = GetType ();
- if (thisType == typeof (DotNetAssemblyProject) || thisType == typeof (PortableDotNetProject))
- return false;
- }
-
- return true;
+ // Libraries are not executable by default, unless the project has a custom execution command
+ if (compileTarget == CompileTarget.Library && !Configurations.OfType<ProjectConfiguration> ().Any (c => c.CustomCommands.HasCommands (CustomCommandType.Execute)))
+ sf &= ~ProjectFeatures.Execute;
+
+ return sf;
}
- protected internal override List<FilePath> OnGetItemFiles (bool includeReferencedFiles)
+ protected override IEnumerable<FilePath> OnGetItemFiles (bool includeReferencedFiles)
{
- List<FilePath> col = base.OnGetItemFiles (includeReferencedFiles);
+ var baseFiles = base.OnGetItemFiles (includeReferencedFiles);
if (includeReferencedFiles) {
+ List<FilePath> col = new List<FilePath> ();
foreach (ProjectReference pref in References) {
if (pref.ReferenceType == ReferenceType.Assembly) {
foreach (var f in pref.GetReferencedFileNames (DefaultConfiguration.Selector))
@@ -987,15 +1155,25 @@ namespace MonoDevelop.Projects
}
}
foreach (DotNetProjectConfiguration c in Configurations) {
- if (c.SignAssembly)
+ if (c.SignAssembly && !c.AssemblyKeyFile.IsNullOrEmpty)
col.Add (c.AssemblyKeyFile);
}
+ baseFiles = baseFiles.Concat (col);
}
- return col;
+ return baseFiles;
}
+ internal Task<BuildResult> Compile (ProgressMonitor monitor, BuildData buildData)
+ {
+ return ProjectExtension.OnCompile (monitor, buildData);
+ }
+
+ protected virtual Task<BuildResult> OnCompile (ProgressMonitor monitor, BuildData buildData)
+ {
+ return MD1DotNetProjectHandler.Compile (monitor, this, buildData);
+ }
- public override bool IsCompileable (string fileName)
+ protected override bool OnGetIsCompileable (string fileName)
{
if (LanguageBinding == null)
return false;
@@ -1006,25 +1184,36 @@ namespace MonoDevelop.Projects
/// Gets the default namespace for the file, according to the naming policy.
/// </summary>
/// <remarks>Always returns a valid namespace, even if the fileName is null.</remarks>
- public virtual string GetDefaultNamespace (string fileName)
+ public string GetDefaultNamespace (string fileName, bool useVisualStudioNamingPolicy = false)
{
- return GetDefaultNamespace (this, DefaultNamespace, fileName);
+ return OnGetDefaultNamespace (fileName, useVisualStudioNamingPolicy);
}
/// <summary>
/// Gets the default namespace for the file, according to the naming policy.
/// </summary>
/// <remarks>Always returns a valid namespace, even if the fileName is null.</remarks>
- internal static string GetDefaultNamespace (Project project, string defaultNamespace, string fileName)
+ protected virtual string OnGetDefaultNamespace (string fileName, bool useVisualStudioNamingPolicy = false)
{
- DotNetNamingPolicy pol = project.Policies.Get<DotNetNamingPolicy> ();
+ return GetDefaultNamespace (this, DefaultNamespace, fileName, useVisualStudioNamingPolicy);
+ }
+
+ /// <summary>
+ /// Gets the default namespace for the file, according to the naming policy.
+ /// </summary>
+ /// <remarks>Always returns a valid namespace, even if the fileName is null.</remarks>
+ internal static string GetDefaultNamespace (Project project, string defaultNamespace, string fileName, bool useVisualStudioNamingPolicy = false)
+ {
+ DirectoryNamespaceAssociation association = useVisualStudioNamingPolicy
+ ? DirectoryNamespaceAssociation.PrefixedHierarchical
+ : project.Policies.Get<DotNetNamingPolicy> ().DirectoryNamespaceAssociation;
string root = null;
string dirNamespc = null;
string defaultNmspc = !string.IsNullOrEmpty (defaultNamespace)
? defaultNamespace
: SanitisePotentialNamespace (project.Name) ?? "Application";
-
+
if (string.IsNullOrEmpty (fileName)) {
return defaultNmspc;
}
@@ -1033,13 +1222,13 @@ namespace MonoDevelop.Projects
string relativeDirname = null;
if (!String.IsNullOrEmpty (dirname)) {
relativeDirname = project.GetRelativeChildPath (dirname);
- if (string.IsNullOrEmpty (relativeDirname) || relativeDirname.StartsWith (".."))
+ if (string.IsNullOrEmpty (relativeDirname) || relativeDirname.StartsWith("..", StringComparison.Ordinal))
relativeDirname = null;
}
if (relativeDirname != null) {
try {
- switch (pol.DirectoryNamespaceAssociation) {
+ switch (association) {
case DirectoryNamespaceAssociation.PrefixedFlat:
root = defaultNmspc;
goto case DirectoryNamespaceAssociation.Flat;
@@ -1126,66 +1315,105 @@ namespace MonoDevelop.Projects
}
}
- protected override IEnumerable<string> GetStandardBuildActions ()
+ protected override IEnumerable<string> OnGetStandardBuildActions ()
{
return BuildAction.DotNetActions;
}
- protected override IList<string> GetCommonBuildActions ()
+ protected override IList<string> OnGetCommonBuildActions ()
{
return BuildAction.DotNetCommonActions;
}
- internal override void SetItemHandler (ISolutionItemHandler handler)
+ protected override void OnEndLoad ()
{
- if (ProjectExtensionUtil.GetItemHandler (this) == null) {
- // Initial assignment of the item handler
- base.SetItemHandler (handler);
- return;
- }
- IResourceHandler rh = ResourceHandler;
+ // Just after loading, the resource Ids are using the file format's policy.
+ // They have to be converted to the new policy
+ MigrateResourceIds (ResourceNamePolicy.FileFormatDefault, Policies.Get<DotNetNamingPolicy>().ResourceNamePolicy);
- base.SetItemHandler (handler);
- resourceHandler = null;
- // A change in the file format may imply a change in the resource naming policy.
- // Make sure that the resource Id don't change.
- MigrateResourceIds (rh, ResourceHandler);
+ base.OnEndLoad ();
}
- protected override void OnEndLoad ()
+ protected abstract DotNetCompilerParameters OnCreateCompilationParameters (DotNetProjectConfiguration config, ConfigurationKind kind);
+
+ internal protected virtual BuildResult OnCompileSources (ProjectItemCollection items, DotNetProjectConfiguration configuration, ConfigurationSelector configSelector, ProgressMonitor monitor)
{
- // The resource handler policy may have changed after loading, so reset any
- // previously allocated resource handler
- resourceHandler = null;
+ throw new NotSupportedException ();
+ }
- // Just after loading, the resource Ids are using the file format's policy.
- // They have to be converted to the new policy
- IResourceHandler handler = ItemHandler as IResourceHandler;
- if (handler != null)
- MigrateResourceIds (handler, ResourceHandler);
+ protected abstract ClrVersion[] OnGetSupportedClrVersions ();
- base.OnEndLoad ();
+ internal string GetDefaultResourceId (ProjectFile projectFile)
+ {
+ DotNetNamingPolicy pol = Policies.Get<DotNetNamingPolicy> ();
+ return GetDefaultResourceIdForPolicy (projectFile, pol.ResourceNamePolicy);
}
- public void UpdateResourceHandler (bool keepOldIds)
+ internal string GetDefaultResourceIdForPolicy (ProjectFile projectFile, ResourceNamePolicy policy)
{
- IResourceHandler oldHandler = resourceHandler;
- resourceHandler = null;
- if (keepOldIds && oldHandler != null)
- MigrateResourceIds (oldHandler, ResourceHandler);
+ if (policy == ResourceNamePolicy.FileFormatDefault || policy == ResourceNamePolicy.MSBuild)
+ return GetDefaultMSBuildResourceId (projectFile);
+ else
+ return projectFile.FilePath.FileName;
}
- void MigrateResourceIds (IResourceHandler oldHandler, IResourceHandler newHandler)
+ internal string GetDefaultMSBuildResourceId (ProjectFile projectFile)
{
- if (oldHandler.GetType () != newHandler.GetType ()) {
+ return ProjectExtension.OnGetDefaultResourceId (projectFile);
+ }
+
+ /// <summary>
+ /// Returns the resource id that the provided file will have if none is explicitly set
+ /// </summary>
+ /// <param name="projectFile">Project file.</param>
+ /// <remarks>The algorithm for getting the resource id is usually language-specific.</remarks>
+ protected virtual string OnGetDefaultResourceId (ProjectFile projectFile)
+ {
+ string fname = projectFile.ProjectVirtualPath;
+ fname = FileService.NormalizeRelativePath (fname);
+ fname = Path.Combine (Path.GetDirectoryName (fname).Replace (' ','_'), Path.GetFileName (fname));
+
+ if (String.Compare (Path.GetExtension (fname), ".resx", true) == 0) {
+ fname = Path.ChangeExtension (fname, ".resources");
+ } else {
+ string only_filename, culture, extn;
+ if (MSBuildProjectService.TrySplitResourceName (fname, out only_filename, out culture, out extn)) {
+ //remove the culture from fname
+ //foo.it.bmp -> foo.bmp
+ fname = only_filename + "." + extn;
+ }
+ }
+
+ string rname = fname.Replace (Path.DirectorySeparatorChar, '.');
+
+ DotNetProject dp = projectFile.Project as DotNetProject;
+
+ if (dp == null || String.IsNullOrEmpty (dp.DefaultNamespace))
+ return rname;
+ else
+ return dp.DefaultNamespace + "." + rname;
+ }
+
+ /// <summary>
+ /// Migrates resource identifiers from a policy to the current policy of the project.
+ /// </summary>
+ /// <param name="oldPolicy">Old policy.</param>
+ public void MigrateResourceIds (ResourceNamePolicy oldPolicy)
+ {
+ MigrateResourceIds (oldPolicy, Policies.Get<DotNetNamingPolicy>().ResourceNamePolicy);
+ }
+
+ void MigrateResourceIds (ResourceNamePolicy oldPolicy, ResourceNamePolicy newPolicy)
+ {
+ if (oldPolicy != newPolicy) {
// If the file format has a default resource handler different from the one
// choosen for this project, then all resource ids must be converted
foreach (ProjectFile file in Files.Where (f => f.BuildAction == BuildAction.EmbeddedResource)) {
if (file.Subtype == Subtype.Directory)
continue;
- string oldId = file.GetResourceId (oldHandler);
- string newId = file.GetResourceId (newHandler);
- string newDefault = newHandler.GetDefaultResourceId (file);
+ string oldId = file.GetResourceId (oldPolicy);
+ string newId = file.GetResourceId (newPolicy);
+ string newDefault = GetDefaultResourceIdForPolicy (file, newPolicy);
if (oldId != newId) {
if (newDefault == oldId)
file.ResourceId = null;
@@ -1199,7 +1427,7 @@ namespace MonoDevelop.Projects
}
}
- protected internal override void OnItemsAdded (IEnumerable<ProjectItem> objs)
+ protected override void OnItemsAdded (IEnumerable<ProjectItem> objs)
{
base.OnItemsAdded (objs);
foreach (var pref in objs.OfType<ProjectReference> ()) {
@@ -1208,7 +1436,7 @@ namespace MonoDevelop.Projects
}
}
- protected internal override void OnItemsRemoved (IEnumerable<ProjectItem> objs)
+ protected override void OnItemsRemoved (IEnumerable<ProjectItem> objs)
{
base.OnItemsRemoved (objs);
foreach (var pref in objs.OfType<ProjectReference> ()) {
@@ -1220,13 +1448,21 @@ namespace MonoDevelop.Projects
internal void NotifyReferenceRemovedFromProject (ProjectReference reference)
{
NotifyModified ("References");
- OnReferenceRemovedFromProject (new ProjectReferenceEventArgs (this, reference));
+ ProjectExtension.OnReferenceRemovedFromProject (new ProjectReferenceEventArgs (this, reference));
+ NotifyReferencedAssembliesChanged ();
}
internal void NotifyReferenceAddedToProject (ProjectReference reference)
{
NotifyModified ("References");
- OnReferenceAddedToProject (new ProjectReferenceEventArgs (this, reference));
+ ProjectExtension.OnReferenceAddedToProject (new ProjectReferenceEventArgs (this, reference));
+ NotifyReferencedAssembliesChanged ();
+ }
+
+ internal void NotifyReferencedAssembliesChanged ()
+ {
+ NotifyModified ("References");
+ ProjectExtension.OnReferencedAssembliesChanged ();
}
protected virtual void OnReferenceRemovedFromProject (ProjectReferenceEventArgs e)
@@ -1243,9 +1479,20 @@ namespace MonoDevelop.Projects
}
}
+ protected virtual void OnReferencedAssembliesChanged ()
+ {
+ if (ReferencedAssembliesChanged != null) {
+ ReferencedAssembliesChanged (this, EventArgs.Empty);
+ }
+ }
+
public event ProjectReferenceEventHandler ReferenceRemovedFromProject;
public event ProjectReferenceEventHandler ReferenceAddedToProject;
+ /// <summary>
+ /// Raised when the list of assemblies that this project references changes
+ /// </summary>
+ public event EventHandler ReferencedAssembliesChanged;
private void OnFileRemoved (Object o, FileEventArgs e)
{
@@ -1253,85 +1500,220 @@ namespace MonoDevelop.Projects
CheckReferenceChange (ei.FileName);
}
- protected override void DoExecute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ protected async override Task DoExecute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
{
DotNetProjectConfiguration dotNetProjectConfig = GetConfiguration (configuration) as DotNetProjectConfiguration;
- monitor.Log.WriteLine (GettextCatalog.GetString ("Running {0} ...", dotNetProjectConfig.CompiledOutputName));
-
- IConsole console = dotNetProjectConfig.ExternalConsole
- ? context.ExternalConsoleFactory.CreateConsole (!dotNetProjectConfig.PauseConsoleOutput)
- : context.ConsoleFactory.CreateConsole (!dotNetProjectConfig.PauseConsoleOutput);
-
- AggregatedOperationMonitor aggregatedOperationMonitor = new AggregatedOperationMonitor (monitor);
+ if (dotNetProjectConfig == null) {
+ monitor.ReportError (GettextCatalog.GetString ("Configuration '{0}' not found in project '{1}'", configuration, Name), null);
+ return;
+ }
- try {
- try {
- ExecutionCommand executionCommand = CreateExecutionCommand (configuration, dotNetProjectConfig);
- if (context.ExecutionTarget != null)
- executionCommand.Target = context.ExecutionTarget;
+ monitor.Log.WriteLine (GettextCatalog.GetString ("Running {0} ...", dotNetProjectConfig.CompiledOutputName));
- if (!context.ExecutionHandler.CanExecute (executionCommand)) {
- monitor.ReportError (GettextCatalog.GetString ("Can not execute \"{0}\". The selected execution mode is not supported for .NET projects.", dotNetProjectConfig.CompiledOutputName), null);
- return;
- }
+ ExecutionCommand executionCommand = CreateExecutionCommand (configuration, dotNetProjectConfig);
+ if (context.ExecutionTarget != null)
+ executionCommand.Target = context.ExecutionTarget;
- IProcessAsyncOperation asyncOp = context.ExecutionHandler.Execute (executionCommand, console);
- aggregatedOperationMonitor.AddOperation (asyncOp);
- asyncOp.WaitForCompleted ();
+ if (!context.ExecutionHandler.CanExecute (executionCommand)) {
+ monitor.ReportError (GettextCatalog.GetString ("Can not execute \"{0}\". The selected execution mode is not supported for .NET projects.", dotNetProjectConfig.CompiledOutputName), null);
+ return;
+ }
- monitor.Log.WriteLine (GettextCatalog.GetString ("The application exited with code: {0}", asyncOp.ExitCode));
- } finally {
- console.Dispose ();
- aggregatedOperationMonitor.Dispose ();
- }
+ try {
+ await ProjectExtension.OnExecuteCommand (monitor, context, configuration, executionCommand);
} catch (Exception ex) {
LoggingService.LogError (string.Format ("Cannot execute \"{0}\"", dotNetProjectConfig.CompiledOutputName), ex);
monitor.ReportError (GettextCatalog.GetString ("Cannot execute \"{0}\"", dotNetProjectConfig.CompiledOutputName), ex);
}
}
- public void AddImportIfMissing (string name, string condition)
+ protected virtual async Task OnExecuteCommand (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration, ExecutionCommand executionCommand)
{
- importsAdded.Add (new DotNetProjectImport (name, condition));
+ var dotNetExecutionCommand = executionCommand as DotNetExecutionCommand;
+ if (dotNetExecutionCommand != null) {
+ dotNetExecutionCommand.UserAssemblyPaths = GetUserAssemblyPaths (configuration);
+ }
+
+ var dotNetProjectConfig = GetConfiguration (configuration) as DotNetProjectConfiguration;
+ var console = dotNetProjectConfig.ExternalConsole
+ ? context.ExternalConsoleFactory.CreateConsole (!dotNetProjectConfig.PauseConsoleOutput, monitor.CancellationToken)
+ : context.ConsoleFactory.CreateConsole (monitor.CancellationToken);
+ using (console) {
+ ProcessAsyncOperation asyncOp = context.ExecutionHandler.Execute (executionCommand, console);
+
+ using (var stopper = monitor.CancellationToken.Register (asyncOp.Cancel))
+ await asyncOp.Task;
+
+ monitor.Log.WriteLine (GettextCatalog.GetString ("The application exited with code: {0}", asyncOp.ExitCode));
+ }
}
- public void RemoveImport (string name)
+
+ protected override void OnReadProjectHeader (ProgressMonitor monitor, MSBuildProject msproject)
{
- importsRemoved.Add (new DotNetProjectImport (name));
- }
+ base.OnReadProjectHeader (monitor, msproject);
- List <DotNetProjectImport> importsAdded = new List<DotNetProjectImport> ();
+ compileTarget = msproject.EvaluatedProperties.GetValue<CompileTarget> ("OutputType");
+ defaultNamespace = msproject.EvaluatedProperties.GetValue ("RootNamespace", string.Empty);
+ usePartialTypes = msproject.EvaluatedProperties.GetValue ("UsePartialTypes", true);
- internal IList<DotNetProjectImport> ImportsAdded {
- get { return importsAdded; }
- }
+ string frameworkIdentifier = msproject.EvaluatedProperties.GetValue ("TargetFrameworkIdentifier");
+ string frameworkVersion = msproject.EvaluatedProperties.GetValue ("TargetFrameworkVersion");
+ string frameworkProfile = msproject.EvaluatedProperties.GetValue ("TargetFrameworkProfile");
+
+ //determine the default target framework from the project type's default
+ //overridden by the components in the project
+ var def = GetDefaultTargetFrameworkForFormat (ToolsVersion);
+ var targetFx = new TargetFrameworkMoniker (
+ string.IsNullOrEmpty (frameworkIdentifier)? def.Identifier : frameworkIdentifier,
+ string.IsNullOrEmpty (frameworkVersion)? def.Version : frameworkVersion,
+ string.IsNullOrEmpty (frameworkProfile)? def.Profile : frameworkProfile);
- List <DotNetProjectImport> importsRemoved = new List<DotNetProjectImport> ();
- internal IList<DotNetProjectImport> ImportsRemoved {
- get { return importsRemoved; }
+ string fx = ExtendedProperties ["InternalTargetFrameworkVersion"] as string;
+ if (!string.IsNullOrEmpty (fx)) {
+ targetFx = TargetFrameworkMoniker.Parse (fx);
+ ExtendedProperties.Remove ("InternalTargetFrameworkVersion");
+ }
+
+ TargetFramework = Runtime.SystemAssemblyService.GetTargetFramework (targetFx);
}
- public void ImportsSaved ()
+ protected override void OnWriteProjectHeader (ProgressMonitor monitor, MSBuildProject msproject)
{
- importsAdded.Clear ();
- importsRemoved.Clear ();
+ base.OnWriteProjectHeader (monitor, msproject);
+
+ IMSBuildPropertySet globalGroup = msproject.GetGlobalPropertyGroup ();
+
+ globalGroup.SetValue ("OutputType", compileTarget);
+ globalGroup.SetValue ("RootNamespace", defaultNamespace, string.Empty);
+ globalGroup.SetValue ("UsePartialTypes", usePartialTypes, true);
}
- public void RefreshProjectBuilder ()
+ protected override void OnWriteProject (ProgressMonitor monitor, MSBuildProject msproject)
{
- var handler = ItemHandler as MSBuildProjectHandler;
- if (handler != null) {
- handler.RefreshProjectBuilder ();
+ base.OnWriteProject (monitor, msproject);
+
+ var moniker = TargetFramework.Id;
+ bool supportsMultipleFrameworks = true; // All supported formats support multiple frameworks. // toolsFormat.SupportsMonikers || toolsFormat.SupportedFrameworks.Length > 0;
+ var def = GetDefaultTargetFrameworkForFormat (ToolsVersion);
+
+ IMSBuildPropertySet globalGroup = msproject.GetGlobalPropertyGroup ();
+
+ // If the format only supports one fx version, or the version is the default, there is no need to store it.
+ // However, is there is already a value set, do not remove it.
+ if (supportsMultipleFrameworks) {
+ globalGroup.SetValue ("TargetFrameworkVersion", "v" + moniker.Version, "v" + def.Version, true);
}
+
+ if (MSBuildFileFormat.ToolsSupportMonikers (ToolsVersion)) {
+ globalGroup.SetValue ("TargetFrameworkIdentifier", moniker.Identifier, def.Identifier, true);
+ globalGroup.SetValue ("TargetFrameworkProfile", moniker.Profile, def.Profile, true);
+ }
+ }
+
+ protected override void OnWriteConfiguration (ProgressMonitor monitor, ProjectConfiguration config, IPropertySet pset)
+ {
+ base.OnWriteConfiguration (monitor, config, pset);
+ if (MSBuildProject.IsNewProject)
+ pset.SetValue ("ErrorReport", "prompt");
+
}
- public void DisposeProjectBuilder ()
+ internal class DefaultDotNetProjectExtension: DotNetProjectExtension
{
- var handler = ItemHandler as MSBuildProjectHandler;
- if (handler != null) {
- handler.CleanupProjectBuilder ();
+ internal protected override DotNetProjectFlags OnGetDotNetProjectFlags ()
+ {
+ return Project.OnGetDotNetProjectFlags ();
+ }
+
+ internal protected override bool OnGetCanReferenceProject (DotNetProject targetProject, out string reason)
+ {
+ return Project.CheckCanReferenceProject (targetProject, out reason);
+ }
+
+ internal protected override string OnGetDefaultTargetPlatform (ProjectCreateInformation projectCreateInfo)
+ {
+ return Project.OnGetDefaultTargetPlatform (projectCreateInfo);
+ }
+
+ internal protected override Task<List<string>> OnGetReferencedAssemblies (ConfigurationSelector configuration)
+ {
+ return Project.OnGetReferencedAssemblies (configuration);
+ }
+
+ internal protected override IEnumerable<DotNetProject> OnGetReferencedAssemblyProjects (ConfigurationSelector configuration)
+ {
+ return Project.OnGetReferencedAssemblyProjects (configuration);
+ }
+
+ internal protected override ExecutionCommand OnCreateExecutionCommand (ConfigurationSelector configSel, DotNetProjectConfiguration configuration)
+ {
+ return Project.OnCreateExecutionCommand (configSel, configuration);
+ }
+
+ internal protected override void OnReferenceRemovedFromProject (ProjectReferenceEventArgs e)
+ {
+ Project.OnReferenceRemovedFromProject (e);
+ }
+
+ internal protected override void OnReferenceAddedToProject (ProjectReferenceEventArgs e)
+ {
+ Project.OnReferenceAddedToProject (e);
+ }
+
+ internal protected override void OnReferencedAssembliesChanged ()
+ {
+ Project.OnReferencedAssembliesChanged ();
+ }
+
+ internal protected override Task<BuildResult> OnCompile (ProgressMonitor monitor, BuildData buildData)
+ {
+ return Project.OnCompile (monitor, buildData);
}
+
+ internal protected override string OnGetDefaultResourceId (ProjectFile projectFile)
+ {
+ return Project.OnGetDefaultResourceId (projectFile);
+ }
+
+ internal protected override Task OnExecuteCommand (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration, ExecutionCommand executionCommand)
+ {
+ return Project.OnExecuteCommand (monitor, context, configuration, executionCommand);
+ }
+
+ internal protected override string[] SupportedLanguages {
+ get {
+ return Project.OnGetSupportedLanguages ();
+ }
+ }
+
+ #region Framework management
+
+ internal protected override TargetFrameworkMoniker OnGetDefaultTargetFrameworkId ()
+ {
+ return Project.OnGetDefaultTargetFrameworkId ();
+ }
+
+ internal protected override TargetFrameworkMoniker OnGetDefaultTargetFrameworkForFormat (string toolsVersion)
+ {
+ return Project.OnGetDefaultTargetFrameworkForFormat (toolsVersion);
+ }
+
+ internal protected override bool OnGetSupportsFramework (TargetFramework framework)
+ {
+ return Project.OnSupportsFramework (framework);
+ }
+
+ #endregion
}
}
+
+ [Flags]
+ public enum DotNetProjectFlags
+ {
+ None = 0,
+ GeneratesDebugInfoFile = 1,
+ IsLibrary = 2
+ }
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectBinding.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectBinding.cs
deleted file mode 100644
index e2e26591cb..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectBinding.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// DotNetProjectBinding.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Xml;
-using MonoDevelop.Core.Serialization;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Projects
-{
- public class DotNetProjectBinding : IProjectBinding
- {
- public virtual string Name {
- get { return "DotNet"; }
- }
-
- public Project CreateProject (ProjectCreateInformation info, XmlElement projectOptions)
- {
- string lang = projectOptions.GetAttribute ("language");
- return CreateProject (lang, info, projectOptions);
- }
-
- protected virtual DotNetProject CreateProject (string languageName, ProjectCreateInformation info, XmlElement projectOptions)
- {
- return new DotNetAssemblyProject (languageName, info, projectOptions);
- }
-
- public Project CreateSingleFileProject (string file)
- {
- IDotNetLanguageBinding binding = LanguageBindingService.GetBindingPerFileName (file) as IDotNetLanguageBinding;
- if (binding != null) {
- ProjectCreateInformation info = new ProjectCreateInformation ();
- info.ProjectName = Path.GetFileNameWithoutExtension (file);
- info.SolutionPath = Path.GetDirectoryName (file);
- info.ProjectBasePath = Path.GetDirectoryName (file);
- Project project = CreateProject (binding.Language, info, null);
- project.Files.Add (new ProjectFile (file));
- return project;
- }
- return null;
- }
-
- public bool CanCreateSingleFileProject (string file)
- {
- IDotNetLanguageBinding binding = LanguageBindingService.GetBindingPerFileName (file) as IDotNetLanguageBinding;
- return binding != null;
- }
-
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectConfiguration.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectConfiguration.cs
index 524f7a6587..411c8f7d30 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectConfiguration.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectConfiguration.cs
@@ -35,6 +35,7 @@ using MonoDevelop.Core.Serialization;
using MonoDevelop.Core.Assemblies;
using MonoDevelop.Core.StringParsing;
using System.Collections.Generic;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.Projects
{
@@ -47,48 +48,57 @@ namespace MonoDevelop.Projects
public class DotNetProjectConfiguration: ProjectConfiguration
{
- [MonoDevelop.Projects.Formats.MSBuild.MergeToProject]
- [ItemProperty ("AssemblyName")]
string assembly;
-
- ConfigurationParameters compilationParameters;
-
string sourcePath;
-
- public DotNetProjectConfiguration ()
+ DotNetCompilerParameters compilationParameters;
+
+ public DotNetProjectConfiguration (string id): base (id)
+ {
+ }
+
+ internal protected override void Read (IPropertySet pset)
{
+ base.Read (pset);
+
+ assembly = pset.GetValue ("AssemblyName");
+ signAssembly = pset.GetValue<bool> ("SignAssembly");
+ delaySign = pset.GetValue<bool> ("DelaySign");
+ assemblyKeyFile = pset.GetPathValue ("AssemblyOriginatorKeyFile", FilePath.Empty);
+ if (string.IsNullOrEmpty (assemblyKeyFile))
+ assemblyKeyFile = pset.GetPathValue ("AssemblyKeyFile", FilePath.Empty);
+ if (compilationParameters != null)
+ compilationParameters.Read (pset);
}
- public DotNetProjectConfiguration (string name): base (name)
+ internal protected override void Write (IPropertySet pset)
{
+ base.Write (pset);
+ pset.SetValue ("AssemblyName", assembly, mergeToMainGroup: true);
+ pset.SetValue ("SignAssembly", signAssembly, defaultValue:false, mergeToMainGroup: true);
+ pset.SetValue ("DelaySign", delaySign, defaultValue:false, mergeToMainGroup:true);
+ pset.SetValue ("AssemblyOriginatorKeyFile", assemblyKeyFile, defaultValue:FilePath.Empty, mergeToMainGroup:true);
+ if (compilationParameters != null)
+ compilationParameters.Write (pset);
}
- [MonoDevelop.Projects.Formats.MSBuild.MergeToProject]
- [ItemProperty("SignAssembly", DefaultValue = false)]
private bool signAssembly = false;
public bool SignAssembly {
get { return signAssembly; }
set { signAssembly = value; }
}
- [MonoDevelop.Projects.Formats.MSBuild.MergeToProject]
- [ItemProperty("DelaySign", DefaultValue = false)]
private bool delaySign = false;
public bool DelaySign {
get { return delaySign; }
set { delaySign = value; }
}
- [MonoDevelop.Projects.Formats.MSBuild.MergeToProject]
- [ProjectPathItemProperty("AssemblyKeyFile", ReadOnly=true)]
internal string OldAssemblyKeyFile {
set { assemblyKeyFile = value; }
}
- [MonoDevelop.Projects.Formats.MSBuild.MergeToProject]
- [ProjectPathItemProperty("AssemblyOriginatorKeyFile", DefaultValue = "")]
- private string assemblyKeyFile = "";
- public string AssemblyKeyFile {
+ private FilePath assemblyKeyFile = FilePath.Empty;
+ public FilePath AssemblyKeyFile {
get { return assemblyKeyFile; }
set { assemblyKeyFile = value; }
}
@@ -149,8 +159,7 @@ namespace MonoDevelop.Projects
}
}
- [ItemProperty ("CodeGeneration")]
- public ConfigurationParameters CompilationParameters {
+ public DotNetCompilerParameters CompilationParameters {
get { return compilationParameters; }
set {
compilationParameters = value;
@@ -159,16 +168,6 @@ namespace MonoDevelop.Projects
}
}
- public ProjectParameters ProjectParameters {
- get {
- DotNetProject dnp = ParentItem as DotNetProject;
- if (dnp != null)
- return dnp.LanguageParameters;
- else
- return null;
- }
- }
-
public FilePath CompiledOutputName {
get {
FilePath fullPath = OutputDirectory.Combine (OutputAssembly);
@@ -179,9 +178,9 @@ namespace MonoDevelop.Projects
}
}
- public override void CopyFrom (ItemConfiguration configuration)
+ protected override void OnCopyFrom (ItemConfiguration configuration, bool isRename)
{
- base.CopyFrom (configuration);
+ base.OnCopyFrom (configuration, isRename);
DotNetProjectConfiguration conf = (DotNetProjectConfiguration) configuration;
assembly = conf.assembly;
@@ -206,24 +205,6 @@ namespace MonoDevelop.Projects
}
}
- public class UnknownCompilationParameters: ConfigurationParameters, IExtendedDataItem
- {
- readonly Hashtable table = new Hashtable ();
-
- public IDictionary ExtendedProperties {
- get { return table; }
- }
- }
-
- public class UnknownProjectParameters: ProjectParameters, IExtendedDataItem
- {
- readonly Hashtable table = new Hashtable ();
-
- public IDictionary ExtendedProperties {
- get { return table; }
- }
- }
-
[Mono.Addins.Extension]
class ProjectTagProvider: StringTagProvider<DotNetProjectConfiguration>, IStringTagProvider
{
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectExtension.cs
new file mode 100644
index 0000000000..1bf92a0cfb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectExtension.cs
@@ -0,0 +1,140 @@
+//
+// DotNetProjectExtension.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using MonoDevelop.Core.Assemblies;
+using MonoDevelop.Core.Execution;
+using MonoDevelop.Core;
+using System.Threading.Tasks;
+using MonoDevelop.Projects.MSBuild;
+
+namespace MonoDevelop.Projects
+{
+ public class DotNetProjectExtension : ProjectExtension
+ {
+ #region Project properties
+
+ DotNetProjectExtension next;
+
+ internal protected override void InitializeChain (ChainedExtension next)
+ {
+ base.InitializeChain (next);
+ this.next = FindNextImplementation<DotNetProjectExtension> (next);
+ }
+
+ internal protected override bool SupportsObject (WorkspaceObject item)
+ {
+ return base.SupportsObject (item) && (item is DotNetProject);
+ }
+
+ new public DotNetProject Project {
+ get { return (DotNetProject)base.Item; }
+ }
+
+
+ internal protected virtual DotNetProjectFlags OnGetDotNetProjectFlags ()
+ {
+ return next.OnGetDotNetProjectFlags ();
+ }
+
+ #endregion
+
+ internal protected virtual bool OnGetCanReferenceProject (DotNetProject targetProject, out string reason)
+ {
+ return next.OnGetCanReferenceProject (targetProject, out reason);
+ }
+
+ internal protected virtual string OnGetDefaultTargetPlatform (ProjectCreateInformation projectCreateInfo)
+ {
+ return next.OnGetDefaultTargetPlatform (projectCreateInfo);
+ }
+
+ internal protected virtual Task<List<string>> OnGetReferencedAssemblies (ConfigurationSelector configuration)
+ {
+ return next.OnGetReferencedAssemblies (configuration);
+ }
+
+ internal protected virtual IEnumerable<DotNetProject> OnGetReferencedAssemblyProjects (ConfigurationSelector configuration)
+ {
+ return next.OnGetReferencedAssemblyProjects (configuration);
+ }
+
+ internal protected virtual ExecutionCommand OnCreateExecutionCommand (ConfigurationSelector configSel, DotNetProjectConfiguration configuration)
+ {
+ return next.OnCreateExecutionCommand (configSel, configuration);
+ }
+
+ internal protected virtual void OnReferenceRemovedFromProject (ProjectReferenceEventArgs e)
+ {
+ next.OnReferenceRemovedFromProject (e);
+ }
+
+ internal protected virtual void OnReferenceAddedToProject (ProjectReferenceEventArgs e)
+ {
+ next.OnReferenceAddedToProject (e);
+ }
+
+ internal protected virtual void OnReferencedAssembliesChanged ()
+ {
+ next.OnReferencedAssembliesChanged ();
+ }
+
+ internal protected virtual string OnGetDefaultResourceId (ProjectFile projectFile)
+ {
+ return next.OnGetDefaultResourceId (projectFile);
+ }
+
+ internal protected virtual Task OnExecuteCommand (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration, ExecutionCommand executionCommand)
+ {
+ return next.OnExecuteCommand (monitor, context, configuration, executionCommand);
+ }
+
+ #region Framework management
+
+ internal protected virtual TargetFrameworkMoniker OnGetDefaultTargetFrameworkId ()
+ {
+ return next.OnGetDefaultTargetFrameworkId ();
+ }
+
+ internal protected virtual TargetFrameworkMoniker OnGetDefaultTargetFrameworkForFormat (string toolsVersion)
+ {
+ return next.OnGetDefaultTargetFrameworkForFormat (toolsVersion);
+ }
+
+ internal protected virtual bool OnGetSupportsFramework (TargetFramework framework)
+ {
+ return next.OnGetSupportsFramework (framework);
+ }
+
+ internal protected virtual Task<BuildResult> OnCompile (ProgressMonitor monitor, BuildData buildData)
+ {
+ return next.OnCompile (monitor, buildData);
+ }
+
+ #endregion
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectParameters.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectParameters.cs
deleted file mode 100644
index 013b99f441..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectParameters.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// DotNetProjectParameters.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-
-namespace MonoDevelop.Projects
-{
- /// <summary>
- /// This is the base class for project parameter classes.
- /// </summary>
- public class DotNetProjectParameters: ProjectParameters
- {
- public virtual bool DefaultNamespaceIsImplicit {
- get { return false; }
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExecutionContext.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExecutionContext.cs
index 90222b4342..ae1334fe5f 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExecutionContext.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExecutionContext.cs
@@ -35,15 +35,15 @@ namespace MonoDevelop.Projects
public sealed class ExecutionContext
{
IExecutionHandler executionHandler;
- IConsoleFactory consoleFactory;
+ OperationConsoleFactory consoleFactory;
ExecutionTarget executionTarget;
- public ExecutionContext (IExecutionMode executionMode, IConsoleFactory consoleFactory, ExecutionTarget target)
+ public ExecutionContext (IExecutionMode executionMode, OperationConsoleFactory consoleFactory, ExecutionTarget target)
: this (executionMode.ExecutionHandler, consoleFactory, target)
{
}
- public ExecutionContext (IExecutionHandler executionHandler, IConsoleFactory consoleFactory, ExecutionTarget target)
+ public ExecutionContext (IExecutionHandler executionHandler, OperationConsoleFactory consoleFactory, ExecutionTarget target)
{
var targetedHandler = executionHandler as ITargetedExecutionHandler;
if (targetedHandler != null)
@@ -62,11 +62,11 @@ namespace MonoDevelop.Projects
get { return executionTarget; }
}
- public IConsoleFactory ConsoleFactory {
+ public OperationConsoleFactory ConsoleFactory {
get { return consoleFactory; }
}
- public IConsoleFactory ExternalConsoleFactory {
+ public ExternalConsoleFactory ExternalConsoleFactory {
get { return MonoDevelop.Core.Execution.ExternalConsoleFactory.Instance; }
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportDotNetProjectTypeAttribute.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportDotNetProjectTypeAttribute.cs
new file mode 100644
index 0000000000..167e1c299a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportDotNetProjectTypeAttribute.cs
@@ -0,0 +1,45 @@
+//
+// RegisterDotNetProject.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Mono.Addins;
+
+namespace MonoDevelop.Projects
+{
+ public class ExportDotNetProjectTypeAttribute: ExportProjectTypeAttribute
+ {
+ protected ExportDotNetProjectTypeAttribute ()
+ {
+ }
+
+ public ExportDotNetProjectTypeAttribute ([NodeAttribute ("guid")] string guid, [NodeAttribute("language")] string language): base (guid)
+ {
+ }
+
+ [NodeAttribute ("language", Required=true)]
+ public string Language { get; set; }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportProjectFlavorAttribute.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportProjectFlavorAttribute.cs
new file mode 100644
index 0000000000..b30a10ece3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportProjectFlavorAttribute.cs
@@ -0,0 +1,48 @@
+//
+// ProjectFlavorTypeAttribute.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using Mono.Addins;
+
+namespace MonoDevelop.Projects
+{
+ public class ExportProjectFlavorAttribute: ExportProjectModelExtensionAttribute
+ {
+ internal ExportProjectFlavorAttribute ()
+ {
+ }
+
+ public ExportProjectFlavorAttribute ([NodeAttribute ("guid")] string guid)
+ {
+ Guid = guid;
+ }
+
+ [NodeAttribute ("guid", Description = "GUID of the extension. The extension will be loaded if the project has this GUID in the project type GUID list. " +
+ "If not specified, the extension will be applied to all projects.")]
+ public string Guid { get; set; }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportProjectItemTypeAttribute.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportProjectItemTypeAttribute.cs
new file mode 100644
index 0000000000..87255630cb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportProjectItemTypeAttribute.cs
@@ -0,0 +1,43 @@
+//
+// ExportProjectItemTypeAttribute.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Mono.Addins;
+
+namespace MonoDevelop.Projects
+{
+ public class ExportProjectItemTypeAttribute: CustomExtensionAttribute
+ {
+ ExportProjectItemTypeAttribute ()
+ {
+ }
+
+ public ExportProjectItemTypeAttribute ([NodeAttribute ("id")] string itemName)
+ {
+ Id = itemName;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportProjectModelExtensionAttribute.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportProjectModelExtensionAttribute.cs
new file mode 100644
index 0000000000..3bcbf8cc82
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportProjectModelExtensionAttribute.cs
@@ -0,0 +1,36 @@
+//
+// RegisterProjectModelExtensionAttribute.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Mono.Addins;
+
+namespace MonoDevelop.Projects
+{
+ public class ExportProjectModelExtensionAttribute: CustomExtensionAttribute
+ {
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportProjectTypeAttribute.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportProjectTypeAttribute.cs
new file mode 100644
index 0000000000..1d108c12f3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportProjectTypeAttribute.cs
@@ -0,0 +1,45 @@
+//
+// MSBuildProjectTypeAttribute.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core;
+using System.Threading.Tasks;
+using MonoDevelop.Projects.MSBuild;
+using Mono.Addins;
+
+namespace MonoDevelop.Projects
+{
+ public class ExportProjectTypeAttribute: ExportSolutionItemTypeAttribute
+ {
+ protected ExportProjectTypeAttribute ()
+ {
+ }
+
+ public ExportProjectTypeAttribute ([NodeAttribute ("guid")] string guid): base (guid)
+ {
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportSolutionItemTypeAttribute.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportSolutionItemTypeAttribute.cs
new file mode 100644
index 0000000000..b109c8128b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExportSolutionItemTypeAttribute.cs
@@ -0,0 +1,62 @@
+//
+// SolutionItemTypeAttribute.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Threading.Tasks;
+using MonoDevelop.Core;
+using Mono.Addins;
+using MonoDevelop.Core.ProgressMonitoring;
+
+namespace MonoDevelop.Projects
+{
+ public class ExportSolutionItemTypeAttribute: CustomExtensionAttribute
+ {
+ [NodeAttribute ("guid", Required=true)]
+ public string Guid { get; set; }
+
+ [NodeAttribute ("extension")]
+ public string Extension { get; set; }
+
+ [NodeAttribute ("import")]
+ public string Import { get; set; }
+
+ [NodeAttribute ("alias")]
+ public string Alias { get; set; }
+
+ public string TypeName {
+ get { return ((TypeExtensionNode)ExtensionNode).TypeName; }
+ }
+
+ protected ExportSolutionItemTypeAttribute ()
+ {
+ }
+
+ public ExportSolutionItemTypeAttribute ([NodeAttribute ("guid")] string guid)
+ {
+ Guid = guid;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExtensionChain.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExtensionChain.cs
new file mode 100644
index 0000000000..09fe6e5566
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ExtensionChain.cs
@@ -0,0 +1,95 @@
+//
+// ExtensionChain.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace MonoDevelop.Projects
+{
+ public class ExtensionChain
+ {
+ Dictionary<Type,ChainedExtension> chains = new Dictionary<Type, ChainedExtension> ();
+ ChainedExtension[] extensions;
+
+ public static ExtensionChain Create<T> (T[] extensions) where T:ChainedExtension
+ {
+ var c = new ExtensionChain ();
+
+ for (int n = extensions.Length - 2; n >= 0; n--)
+ extensions [n].InitChain (c, extensions [n + 1]);
+
+ c.extensions = extensions;
+ return c;
+ }
+
+ public T GetExtension<T> () where T:ChainedExtension, new()
+ {
+ ChainedExtension e;
+ if (!chains.TryGetValue (typeof(T), out e)) {
+ e = new T ();
+ e.InitChain (this, ChainedExtension.FindNextImplementation<T> (extensions[0]));
+ chains [typeof(T)] = e;
+ }
+ return (T)e;
+ }
+
+ public IEnumerable<ChainedExtension> GetAllExtensions ()
+ {
+ return extensions;
+ }
+
+ internal void AddExtension (ChainedExtension ext)
+ {
+ Array.Resize (ref extensions, extensions.Length + 1);
+ extensions [extensions.Length - 1] = ext;
+ Rechain ();
+ }
+
+ internal void RemoveExtension (ChainedExtension ext)
+ {
+ extensions = extensions.Where (e => e != ext).ToArray ();
+ Rechain ();
+ }
+
+ void Rechain ()
+ {
+ // Re-chain every extension
+ for (int n = extensions.Length - 2; n >= 0; n--)
+ extensions [n].InitChain (this, extensions [n + 1]);
+
+ // The first extension object in type-specific chains is a placeholder extension used only to hold
+ // a reference to the real first extension.
+ foreach (var fex in chains)
+ fex.Value.InitChain (this, ChainedExtension.FindNextImplementation (fex.Key, extensions[0]));
+ }
+
+ public void Dispose ()
+ {
+ extensions[0].DisposeChain ();
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/FileFormat.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/FileFormat.cs
deleted file mode 100644
index dad5e0ae81..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/FileFormat.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-// FileFormat.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.Collections.Generic;
-using MonoDevelop.Projects.Extensions;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Projects
-{
- public class FileFormat
- {
- string id;
- string name;
- IFileFormat format;
-
- public string Id {
- get {
- return id;
- }
- }
-
- public string Name {
- get {
- return name;
- }
- }
-
- public bool CanDefault { get; private set; }
-
- public string GetValidFileName (object obj, string fileName)
- {
- return format.GetValidFormatName (obj, fileName);
- }
-
- public IEnumerable<string> GetCompatibilityWarnings (object obj)
- {
- IWorkspaceFileObject wfo = obj as IWorkspaceFileObject;
- if (wfo != null && !wfo.SupportsFormat (this)) {
- return new string[] {GettextCatalog.GetString ("The project '{0}' is not supported by {1}", wfo.Name, Name) };
- }
- IEnumerable<string> res = format.GetCompatibilityWarnings (obj);
- return res ?? new string [0];
- }
-
- public bool CanWrite (object obj)
- {
- IWorkspaceFileObject wfo = obj as IWorkspaceFileObject;
- if (wfo != null && !wfo.SupportsFormat (this))
- return false;
- return format.CanWriteFile (obj);
- }
-
- public bool SupportsMixedFormats {
- get { return format.SupportsMixedFormats; }
- }
-
- public bool SupportsFramework (MonoDevelop.Core.Assemblies.TargetFramework framework)
- {
- return format.SupportsFramework (framework);
- }
-
- internal IFileFormat Format {
- get { return format; }
- }
-
- internal FileFormat (IFileFormat format, string id, string name)
- : this (format, id, name, false)
- {
- }
-
- internal FileFormat (IFileFormat format, string id, string name, bool canDefault)
- {
- this.id = id;
- this.name = name ?? id;
- this.format = format;
- this.CanDefault = canDefault;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/FileFormatManager.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/FileFormatManager.cs
deleted file mode 100644
index 12390ee15e..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/FileFormatManager.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// FileFormatManager.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using MonoDevelop.Projects;
-using MonoDevelop.Projects.Extensions;
-
-namespace MonoDevelop.Projects
-{
- public class FileFormatManager
- {
- List<FileFormat> fileFormats = new List<FileFormat> ();
-
- public void RegisterFileFormat (IFileFormat format, string id, string name, bool canDefault)
- {
- FileFormat f = new FileFormat (format, id, name, canDefault);
- fileFormats.Add (f);
- }
-
- public void UnregisterFileFormat (IFileFormat format)
- {
- foreach (FileFormat f in fileFormats) {
- if (f.Format == format) {
- fileFormats.Remove (f);
- return;
- }
- }
- }
-
- public FileFormat[] GetFileFormats (string fileName, Type expectedType)
- {
- List<FileFormat> list = new List<FileFormat> ();
- foreach (FileFormat f in fileFormats)
- if (f.Format.CanReadFile (fileName, expectedType))
- list.Add (f);
- return list.ToArray ();
- }
-
- public FileFormat GetFileFormatForFile (string fileName, Type expectedType)
- {
- foreach (FileFormat f in fileFormats)
- if (f.Format.CanReadFile (fileName, expectedType))
- return f;
- return null;
- }
-
- public FileFormat[] GetFileFormatsForObject (object obj)
- {
- List<FileFormat> list = new List<FileFormat> ();
- foreach (FileFormat f in fileFormats)
- if (f.CanWrite(obj))
- list.Add (f);
- return list.ToArray ();
- }
-
- public FileFormat[] GetAllFileFormats ()
- {
- List<FileFormat> list = new List<FileFormat> ();
- list.AddRange (fileFormats);
- return list.ToArray ();
- }
-
- public FileFormat GetFileFormat (string id)
- {
- foreach (FileFormat f in fileFormats)
- if (f.Id == id)
- return f;
- return null;
- }
-
- internal FileFormat GetFileFormat (IFileFormat format)
- {
- foreach (FileFormat f in fileFormats)
- if (f.Format == format)
- return f;
- return null;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/GenericProject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/GenericProject.cs
index 9e14d17bb6..e08223f506 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/GenericProject.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/GenericProject.cs
@@ -28,6 +28,7 @@
using System.Xml;
using System.Collections.Generic;
+using System.Collections.Immutable;
namespace MonoDevelop.Projects
{
@@ -42,27 +43,29 @@ namespace MonoDevelop.Projects
{
Configurations.Add (CreateConfiguration ("Default"));
}
-
- public override SolutionItemConfiguration CreateConfiguration (string name)
+
+ protected override void OnInitializeFromTemplate (ProjectCreateInformation projectCreateInfo, XmlElement template)
+ {
+ Configurations.Add (CreateConfiguration ("Default"));
+ }
+
+ protected override SolutionItemConfiguration OnCreateConfiguration (string name, ConfigurationKind kind)
{
GenericProjectConfiguration conf = new GenericProjectConfiguration (name);
return conf;
}
- public override IEnumerable<string> GetProjectTypes ()
+ protected override void OnGetTypeTags (HashSet<string> types)
{
- yield return "GenericProject";
+ base.OnGetTypeTags (types);
+ types.Add ("GenericProject");
}
}
[ProjectModelDataItem]
public class GenericProjectConfiguration: ProjectConfiguration
{
- public GenericProjectConfiguration ()
- {
- }
-
- public GenericProjectConfiguration (string name): base (name)
+ public GenericProjectConfiguration (string id): base (id)
{
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/GenericProjectBinding.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/GenericProjectBinding.cs
deleted file mode 100644
index a0adbabee8..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/GenericProjectBinding.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// MakefileProjectBinding.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.IO;
-using System.Xml;
-using MonoDevelop.Core.Serialization;
-using MonoDevelop.Core;
-using MonoDevelop.Projects;
-
-namespace MonoDevelop.Projects
-{
- public class GenericProjectBinding : IProjectBinding
- {
- public virtual string Name {
- get { return "GenericProject"; }
- }
-
- public Project CreateProject (ProjectCreateInformation info, XmlElement projectOptions)
- {
- return new GenericProject (info, projectOptions);
- }
-
- public Project CreateSingleFileProject (string file)
- {
- return null;
- }
-
- public bool CanCreateSingleFileProject (string file)
- {
- return false;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/HelpService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/HelpService.cs
index 55148f5392..c5bf38ffcb 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/HelpService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/HelpService.cs
@@ -33,11 +33,6 @@ using Mono.Addins;
using System.IO;
using System.Collections.Generic;
using MonoDevelop.Projects.Extensions;
-using ICSharpCode.NRefactory.TypeSystem;
-using System.Text;
-using System.Xml;
-using ICSharpCode.NRefactory.Semantics;
-using ICSharpCode.NRefactory.Documentation;
namespace MonoDevelop.Projects
{
@@ -135,172 +130,12 @@ namespace MonoDevelop.Projects
//note: this method is very careful to check that the generated URLs exist in MonoDoc
//because if we send nonexistent URLS to MonoDoc, it shows empty pages
- public static string GetMonoDocHelpUrl (ResolveResult result)
+ public static string GetMonoDocHelpUrl (Microsoft.CodeAnalysis.ISymbol result)
{
if (result == null)
return null;
-
-// if (result is AggregatedResolveResult)
-// result = ((AggregatedResolveResult)result).PrimaryResult;
-
-
- if (result is NamespaceResolveResult) {
- string namespc = ((NamespaceResolveResult)result).NamespaceName;
- //verify that the namespace exists in the help tree
- //FIXME: GetHelpXml doesn't seem to work for namespaces, so forced to do full render
- Monodoc.Node dummy;
- if (!String.IsNullOrEmpty (namespc) && HelpTree != null && HelpTree.RenderUrl ("N:" + namespc, out dummy) != null)
- return "N:" + namespc;
- else
- return null;
- }
-
- IMember member = null;
-// if (result is MethodGroupResolveResult)
-// member = ((MethodGroupResolveResult)result).Methods.FirstOrDefault ();
-// else
- if (result is MemberResolveResult)
- member = ((MemberResolveResult)result).Member;
-
- if (member != null && member.GetMonodocDocumentation () != null)
- return member.GetIdString ();
-
- var type = result.Type;
- if (type != null && !String.IsNullOrEmpty (type.FullName)) {
- string t = "T:" + type.FullName;
- try {
- var tree = HelpTree;
- if (tree != null && tree.GetHelpXml (t) != null)
- return t;
- } catch (Exception) {
- return null;
- }
- }
-
- return null;
- }
- }
-
- public static class HelpExtension
- {
- static void AppendTypeReference (StringBuilder result, ITypeReference type)
- {
- if (type is ArrayTypeReference) {
- var array = (ArrayTypeReference)type;
- AppendTypeReference (result, array.ElementType);
- result.Append ("[");
- result.Append (new string (',', array.Dimensions));
- result.Append ("]");
- return;
- }
-
- if (type is PointerTypeReference) {
- var ptr = (PointerTypeReference)type;
- AppendTypeReference (result, ptr.ElementType);
- result.Append ("*");
- return;
- }
-
- if (type is IType)
- result.Append (((IType)type).FullName);
+ return result.GetDocumentationCommentId ();
}
-
-
- static void AppendHelpParameterList (StringBuilder result, IList<IParameter> parameters)
- {
- result.Append ('(');
- if (parameters != null) {
- for (int i = 0; i < parameters.Count; i++) {
- if (i > 0)
- result.Append (',');
- var p = parameters [i];
- if (p == null)
- continue;
- if (p.IsRef || p.IsOut)
- result.Append ("&");
- AppendTypeReference (result, p.Type.ToTypeReference ());
- }
- }
- result.Append (')');
- }
-
- static void AppendHelpParameterList (StringBuilder result, IList<IUnresolvedParameter> parameters)
- {
- result.Append ('(');
- if (parameters != null) {
- for (int i = 0; i < parameters.Count; i++) {
- if (i > 0)
- result.Append (',');
- var p = parameters [i];
- if (p == null)
- continue;
- if (p.IsRef || p.IsOut)
- result.Append ("&");
- AppendTypeReference (result, p.Type);
- }
- }
- result.Append (')');
- }
-
- static XmlNode FindMatch (IMethod method, XmlNodeList nodes)
- {
- foreach (XmlNode node in nodes) {
- XmlNodeList paramList = node.SelectNodes ("Parameters/*");
- if (method.Parameters.Count == 0 && paramList.Count == 0)
- return node;
- if (method.Parameters.Count != paramList.Count)
- continue;
-
-/* bool matched = true;
- for (int i = 0; i < p.Count; i++) {
- if (p [i].ReturnType.FullName != paramList [i].Attributes ["Type"].Value) {
- matched = false;
- break;
- }
- }
- if (matched)*/
- return node;
- }
- return null;
- }
-
- public static XmlNode GetMonodocDocumentation (this IEntity member)
- {
- if (member.SymbolKind == SymbolKind.TypeDefinition) {
- var helpXml = HelpService.HelpTree != null ? HelpService.HelpTree.GetHelpXml (member.GetIdString ()) : null;
- if (helpXml == null)
- return null;
- return helpXml.SelectSingleNode ("/Type/Docs");
- }
-
- var declaringXml = HelpService.HelpTree != null && member.DeclaringTypeDefinition != null ? HelpService.HelpTree.GetHelpXml (member.DeclaringTypeDefinition.GetIdString ()) : null;
- if (declaringXml == null)
- return null;
-
- switch (member.SymbolKind) {
- case SymbolKind.Method: {
- var nodes = declaringXml.SelectNodes ("/Type/Members/Member[@MemberName='" + member.Name + "']");
- XmlNode node = nodes.Count == 1 ? nodes [0] : FindMatch ((IMethod)member, nodes);
- if (node != null) {
- System.Xml.XmlNode result = node.SelectSingleNode ("Docs");
- return result;
- }
- return null;
- }
- case SymbolKind.Constructor: {
- var nodes = declaringXml.SelectNodes ("/Type/Members/Member[@MemberName='.ctor']");
- XmlNode node = nodes.Count == 1 ? nodes [0] : FindMatch ((IMethod)member, nodes);
- if (node != null) {
- System.Xml.XmlNode result = node.SelectSingleNode ("Docs");
- return result;
- }
- return null;
- }
- default:
- return declaringXml.SelectSingleNode ("/Type/Members/Member[@MemberName='" + member.Name + "']/Docs");
- }
- }
-
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IBuildTarget.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IBuildTarget.cs
index 4b0a66460d..4838362f9d 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IBuildTarget.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IBuildTarget.cs
@@ -27,28 +27,73 @@
using System.Collections.Generic;
using MonoDevelop.Core;
+using System.Threading.Tasks;
using System;
namespace MonoDevelop.Projects
{
- public interface IBuildTarget: IWorkspaceObject
+ public interface IBuildTarget
{
- BuildResult RunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration);
- bool SupportsTarget (string target);
+ /// <summary>
+ /// Builds the target
+ /// </summary>
+ /// <param name="monitor">Monitor for tracking progress</param>
+ /// <param name="configuration">Configuration to build</param>
+ /// <param name="buildReferencedTargets">If set to <c>true</c> build referenced targets before building this one</param>
+ Task<BuildResult> Build (ProgressMonitor monitor, ConfigurationSelector configuration, bool buildReferencedTargets = false, OperationContext operationContext = null);
- [Obsolete ("This method will be removed in future releases")]
- bool NeedsBuilding (ConfigurationSelector configuration);
+ /// <summary>
+ /// Cleans the targets
+ /// </summary>
+ /// <param name="monitor">Monitor for tracking progress</param>
+ /// <param name="configuration">Configuration to clean</param>
+ Task<BuildResult> Clean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext = null);
- [Obsolete ("This method will be removed in future releases")]
- void SetNeedsBuilding (bool needsBuilding, ConfigurationSelector configuration);
+ /// <summary>
+ /// Executes the target
+ /// </summary>
+ /// <param name="monitor">Monitor for tracking progress</param>
+ /// <param name="context">Execution context</param>
+ /// <param name="configuration">Configuration to execute</param>
+ Task Execute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration);
- //TODO: move these to IExecutableWorkspaceObject when we break API
- void Execute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration);
+ /// <summary>
+ /// Determines whether this target can be executed using the specified execution context and configuration.
+ /// </summary>
+ /// <returns><c>true</c> if this instance can be executed; otherwise, <c>false</c>.</returns>
+ /// <param name="context">An execution context</param>
+ /// <param name="configuration">Configuration to execute</param>
bool CanExecute (ExecutionContext context, ConfigurationSelector configuration);
- }
- public interface IExecutableWorkspaceObject : IBuildTarget
- {
+ /// <summary>
+ /// Determines whether this target can be built using the specified configuration.
+ /// </summary>
+ /// <returns><c>true</c> if this instance can be built; otherwise, <c>false</c>.</returns>
+ /// <param name="configuration">Configuration.</param>
+ bool CanBuild (ConfigurationSelector configuration);
+
+ /// <summary>
+ /// Prepares the target for execution
+ /// </summary>
+ /// <returns>The execution.</returns>
+ /// <param name="monitor">Monitor for tracking progress</param>
+ /// <param name="context">Execution context</param>
+ /// <param name="configuration">Configuration to execute</param>
+ /// <remarks>This method can be called (it is not mandatory) before Execute() to give the target a chance
+ /// to asynchronously prepare the execution that is going to be done later on. It can be used for example
+ /// to start the simulator that is going to be used for execution. Calling this method is optional, and
+ /// there is no guarantee that Execute() will actually be called.</remarks>
+ Task PrepareExecution (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration);
+
+ [Obsolete ("This method will be removed in future releases")]
+ bool NeedsBuilding (ConfigurationSelector configuration);
+
+ /// <summary>
+ /// Gets the name of the target
+ /// </summary>
+ /// <value>The name</value>
+ string Name { get; }
+
/// <summary>
/// Gets the build targets that should be built before the project is executed.
/// If the project itself is not included, it will not be built.
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IConfigurationTarget.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IConfigurationTarget.cs
index c2b22e2d86..dc52dd5400 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IConfigurationTarget.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IConfigurationTarget.cs
@@ -36,7 +36,17 @@ namespace MonoDevelop.Projects
ReadOnlyCollection<string> GetConfigurations ();
IItemConfigurationCollection Configurations { get; }
ItemConfiguration DefaultConfiguration { get; set; }
- ItemConfiguration CreateConfiguration (string name);
+ ItemConfiguration CreateConfiguration (string id, ConfigurationKind kind);
string DefaultConfigurationId { get; set; }
}
+
+ public static class ConfigurationTargetExtensions
+ {
+ public static ItemConfiguration CloneConfiguration (this IConfigurationTarget target, ItemConfiguration configuration, string newId)
+ {
+ var clone = target.CreateConfiguration (newId, ConfigurationKind.Blank);
+ clone.CopyFrom (configuration);
+ return clone;
+ }
+ }
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IDotNetFileContainer.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IDotNetFileContainer.cs
index 321e8cac14..f7caf3172b 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IDotNetFileContainer.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IDotNetFileContainer.cs
@@ -30,7 +30,7 @@ namespace MonoDevelop.Projects
{
public interface IDotNetFileContainer
{
- string GetDefaultNamespace (string fileName);
+ string GetDefaultNamespace (string fileName, bool useVisualStudioNamingPolicy = false);
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IDotNetLanguageBinding.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IDotNetLanguageBinding.cs
deleted file mode 100644
index 618219d4a3..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IDotNetLanguageBinding.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-// IDotNetLanguageBinding.cs
-//
-// Author:
-// Viktoria Dudka (viktoriad@remobjects.com)
-//
-// Copyright (c) 2009 RemObjects Software
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.Xml;
-using MonoDevelop.Core;
-using System.CodeDom.Compiler;
-
-namespace MonoDevelop.Projects
-{
- public interface IDotNetLanguageBinding : ILanguageBinding
- {
- string ProjectStockIcon {
- get;
- }
-
- ConfigurationParameters CreateCompilationParameters (XmlElement projectOptions);
- ProjectParameters CreateProjectParameters (XmlElement projectOptions);
-
- BuildResult Compile (ProjectItemCollection items, DotNetProjectConfiguration configuration, ConfigurationSelector configSelector, IProgressMonitor monitor);
-
- ClrVersion[] GetSupportedClrVersions ();
-
- CodeDomProvider GetCodeDomProvider ();
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ILanguageBinding.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ILanguageBinding.cs
deleted file mode 100644
index 811c3d55df..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ILanguageBinding.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// ILanguageBinding.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Projects
-{
- public interface ILanguageBinding
- {
- string Language {
- get;
- }
-
- string SingleLineCommentTag {
- get;
- }
-
- string BlockCommentStartTag {
- get;
- }
-
- string BlockCommentEndTag {
- get;
- }
-
- bool IsSourceCodeFile (FilePath fileName);
- FilePath GetFileName (FilePath fileNameWithoutExtension);
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IMSBuildFileObject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IMSBuildFileObject.cs
new file mode 100644
index 0000000000..329d253fcc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IMSBuildFileObject.cs
@@ -0,0 +1,37 @@
+//
+// IMSBuildItem.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Projects.MSBuild;
+
+namespace MonoDevelop.Projects
+{
+ public interface IMSBuildFileObject: IWorkspaceFileObject
+ {
+ MSBuildFileFormat FileFormat { get; }
+ void ConvertToFormat (MSBuildFileFormat format);
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IProjectBinding.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IProjectBinding.cs
deleted file mode 100644
index 5c0ce972f9..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IProjectBinding.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// IProjectBinding.cs
-//
-// Author:
-// Lluis Sanchez Gual
-
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Collections;
-using System.Xml;
-
-namespace MonoDevelop.Projects
-{
- public interface IProjectBinding
- {
- /// <remarks>
- /// Returns the project type name
- /// </remarks>
- string Name { get; }
-
- /// <remarks>
- /// Creates a Project out of the given ProjetCreateInformation object.
- /// Each project binding must provide a representation of the project
- /// it 'controls'.
- /// </remarks>
- Project CreateProject (ProjectCreateInformation info, XmlElement projectOptions);
-
- /// <remarks>
- /// Creates a Project for a single source file. If the file is not
- /// valid for this project type, it must return null.
- /// </remarks>
- Project CreateSingleFileProject (string sourceFile);
-
- bool CanCreateSingleFileProject (string sourceFile);
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IPropertySet.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IPropertySet.cs
new file mode 100644
index 0000000000..70fa3e23b3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IPropertySet.cs
@@ -0,0 +1,60 @@
+//
+// IPropertySet.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Xml;
+using MonoDevelop.Core;
+using System.Xml.Linq;
+using MonoDevelop.Projects.MSBuild;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Projects
+{
+ public interface IReadOnlyPropertySet
+ {
+ string GetValue (string name, string defaultValue = null);
+ FilePath GetPathValue (string name, FilePath defaultValue = default(FilePath), bool relativeToProject = true, FilePath relativeToPath = default(FilePath));
+ bool TryGetPathValue (string name, out FilePath value, FilePath defaultValue = default(FilePath), bool relativeToProject = true, FilePath relativeToPath = default(FilePath));
+ T GetValue<T> (string name);
+ T GetValue<T> (string name, T defaultValue);
+ object GetValue (string name, Type type, object defaultValue);
+ }
+
+ public interface IPropertySet: IReadOnlyPropertySet
+ {
+ bool HasProperty (string name);
+ IMetadataProperty GetProperty (string name);
+ IEnumerable<IMetadataProperty> GetProperties ();
+
+ void SetValue (string name, string value, string defaultValue = null, bool preserveExistingCase = false, bool mergeToMainGroup = false, string condition = null, MSBuildValueType valueType = null);
+ void SetValue (string name, FilePath value, FilePath defaultValue = default(FilePath), bool relativeToProject = true, FilePath relativeToPath = default(FilePath), bool mergeToMainGroup = false, string condition = null);
+ void SetValue (string name, object value, object defaultValue = null, bool mergeToMainGroup = false, string condition = null);
+
+ bool RemoveProperty (string name);
+
+ void SetPropertyOrder (params string[] propertyNames);
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IWorkspaceObject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IWorkspaceObject.cs
deleted file mode 100644
index 502337e651..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/IWorkspaceObject.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-// IWorkspaceObject.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.Collections.Generic;
-using MonoDevelop.Core;
-using MonoDevelop.Core.Serialization;
-
-
-namespace MonoDevelop.Projects
-{
- public interface IWorkspaceObject: IExtendedDataItem, IFolderItem, IDisposable
- {
- string Name { get; set; }
- FilePath ItemDirectory { get; }
- new FilePath BaseDirectory { get; set; }
- void Save (IProgressMonitor monitor);
- }
-
- public interface IWorkspaceFileObject: IWorkspaceObject, IFileItem
- {
- FileFormat FileFormat { get; }
- void ConvertToFormat (FileFormat format, bool convertChildren);
- bool SupportsFormat (FileFormat format);
- List<FilePath> GetItemFiles (bool includeReferencedFiles);
- new FilePath FileName { get; set; }
- bool NeedsReload { get; set; }
- bool ItemFilesChanged { get; }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemCollection.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemCollection.cs
index c4f7ad68e2..cc38755f4b 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemCollection.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemCollection.cs
@@ -28,46 +28,141 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+using System.Collections.Immutable;
+using MonoDevelop.Core;
namespace MonoDevelop.Projects
{
- public class ItemCollection<T>: Collection<T>
+ public class ItemCollection<T>: IEnumerable<T>
{
- protected override void InsertItem (int index, T item)
+ ImmutableList<T> list = ImmutableList<T>.Empty;
+ bool controlWrites;
+
+ protected ImmutableList<T> List {
+ get {
+ return this.list;
+ }
+ set {
+ list = value;
+ }
+ }
+
+ internal void SetShared ()
{
- base.InsertItem (index, item);
- OnItemAdded (item);
+ controlWrites = true;
}
-
- protected override void RemoveItem (int index)
+
+ protected void AssertCanWrite ()
{
- T it = this [index];
- base.RemoveItem (index);
- OnItemRemoved (it);
+ if (controlWrites)
+ Runtime.AssertMainThread ();
}
-
- protected override void SetItem (int index, T item)
+
+ public void Add (T item)
{
- T it = this [index];
- base.SetItem (index, item);
- OnItemRemoved (it);
- OnItemAdded (item);
+ list = list.Add (item);
+ OnItemsAdded (new [] { item });
}
-
- protected override void ClearItems ()
+
+ public void AddRange (IEnumerable<T> items)
+ {
+ AssertCanWrite ();
+ list = list.AddRange (items);
+ OnItemsAdded (items);
+ }
+
+ public void Insert (int index, T item)
{
- List<T> items = new List<T> (this);
- base.ClearItems ();
- foreach (T it in items)
- OnItemRemoved (it);
+ list = list.Insert (index, item);
+ OnItemsAdded (new [] { item });
}
- protected virtual void OnItemAdded (T item)
+ public void RemoveRange (IEnumerable<T> items)
+ {
+ AssertCanWrite ();
+ list = list.RemoveRange (items);
+ OnItemsRemoved (items);
+ }
+
+ public bool Remove (T item)
+ {
+ AssertCanWrite ();
+
+ int i = list.IndexOf (item);
+ if (i != -1) {
+ RemoveAt (i);
+ return true;
+ }
+ return false;
+ }
+
+ public void RemoveAt (int index)
+ {
+ AssertCanWrite ();
+ T it = list [index];
+ list = list.RemoveAt (index);
+ OnItemsRemoved (new [] { it });
+ }
+
+ public int IndexOf (T item)
+ {
+ return list.IndexOf (item);
+ }
+
+ public bool Contains (T item)
+ {
+ return list.Contains (item);
+ }
+
+ public T this [int index] {
+ get {
+ return list [index];
+ }
+ set {
+ AssertCanWrite ();
+ T it = list [index];
+ list = list.SetItem (index, value);
+ OnItemsRemoved (new [] { it });
+ OnItemsAdded (new [] { value });
+ }
+ }
+
+ public void Clear ()
+ {
+ AssertCanWrite ();
+ var oldList = list;
+ list = list.Clear ();
+ OnItemsRemoved (oldList);
+ }
+
+ public int Count {
+ get { return list.Count; }
+ }
+
+ protected virtual void OnItemsAdded (IEnumerable<T> items)
{
}
- protected virtual void OnItemRemoved (T item)
+ protected virtual void OnItemsRemoved (IEnumerable<T> items)
+ {
+ }
+
+ #region IEnumerable implementation
+
+ public IEnumerator<T> GetEnumerator ()
{
+ return list.GetEnumerator ();
}
+
+ #endregion
+
+ #region IEnumerable implementation
+
+ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator ()
+ {
+ return ((System.Collections.IEnumerable)list).GetEnumerator ();
+ }
+
+ #endregion
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemConfiguration.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemConfiguration.cs
index 32e1e1316e..b07ba7cbc4 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemConfiguration.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemConfiguration.cs
@@ -32,26 +32,22 @@ using System.Collections.ObjectModel;
using MonoDevelop.Projects;
using MonoDevelop.Core.Serialization;
using MonoDevelop.Core;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.Projects
{
public class ItemConfiguration: IExtendedDataItem
{
- [ItemProperty]
string name = null;
string platform;
- [ItemProperty ("CustomCommands")]
+ [ItemProperty ("CustomCommands", SkipEmpty = true)]
[ItemProperty ("Command", Scope="*")]
CustomCommandCollection customCommands = new CustomCommandCollection ();
Hashtable properties;
- public ItemConfiguration ()
- {
- }
-
public ItemConfiguration (string id)
{
ParseConfigurationId (id, out name, out platform);
@@ -84,7 +80,6 @@ namespace MonoDevelop.Projects
public string Name {
get { return name; }
- set { name = value; }
}
public string Id {
@@ -94,35 +89,34 @@ namespace MonoDevelop.Projects
else
return name + "|" + platform;
}
- set {
- ParseConfigurationId (value, out name, out platform);
- }
}
public string Platform {
get { return platform ?? string.Empty; }
- set { platform = value; }
}
public CustomCommandCollection CustomCommands {
get { return customCommands; }
}
-
- public object Clone()
+
+ /// <summary>
+ /// Copies the data of a configuration into this configuration
+ /// </summary>
+ /// <param name="configuration">Configuration from which to get the data.</param>
+ /// <param name="isRename">If true, it means that the copy is being made as a result of a rename or clone operation. In this case,
+ /// the overriden method may change the value of some properties that depend on the configuration name. For example, if the
+ /// copied configuration is Debug and the OutputPath property has "bin/Debug" as value, then that value may be changed
+ /// to match the new configuration name instead of keeping "bin/Debug"</param>
+ public void CopyFrom (ItemConfiguration configuration, bool isRename = false)
{
- ItemConfiguration conf = (ItemConfiguration) Activator.CreateInstance (GetType ());
- conf.CopyFrom (this);
- conf.name = name;
- conf.platform = platform;
- return conf;
+ OnCopyFrom (configuration, isRename);
}
-
- public virtual void CopyFrom (ItemConfiguration configuration)
+
+ protected virtual void OnCopyFrom (ItemConfiguration configuration, bool isRename)
{
- ItemConfiguration other = (ItemConfiguration) configuration;
- if (other.properties != null) {
+ if (configuration.properties != null) {
properties = new Hashtable ();
- foreach (DictionaryEntry e in other.properties) {
+ foreach (DictionaryEntry e in configuration.properties) {
if (e.Value is ICloneable)
properties [e.Key] = ((ICloneable)e.Value).Clone ();
else
@@ -131,12 +125,12 @@ namespace MonoDevelop.Projects
}
else
properties = null;
- customCommands = other.customCommands.Clone ();
+ customCommands = configuration.customCommands.Clone ();
}
public override string ToString()
{
- return name;
+ return Id;
}
public IDictionary ExtendedProperties {
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemConfigurationCollection.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemConfigurationCollection.cs
index 9104295b95..2b361185ba 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemConfigurationCollection.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemConfigurationCollection.cs
@@ -109,16 +109,20 @@ namespace MonoDevelop.Projects
#endregion
- protected override void OnItemAdded (T conf)
+ protected override void OnItemsAdded (IEnumerable<T> confs)
{
- if (ConfigurationAdded != null)
- ConfigurationAdded (this, new ConfigurationEventArgs (null, conf));
+ foreach (var conf in confs) {
+ if (ConfigurationAdded != null)
+ ConfigurationAdded (this, new ConfigurationEventArgs (null, conf));
+ }
}
- protected override void OnItemRemoved (T conf)
+ protected override void OnItemsRemoved (IEnumerable<T> confs)
{
- if (ConfigurationRemoved != null)
- ConfigurationRemoved (this, new ConfigurationEventArgs (null, conf));
+ foreach (var conf in confs) {
+ if (ConfigurationRemoved != null)
+ ConfigurationRemoved (this, new ConfigurationEventArgs (null, conf));
+ }
}
#pragma warning disable 67
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemConfigurationSelector.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemConfigurationSelector.cs
index c450aa62b9..803c848897 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemConfigurationSelector.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ItemConfigurationSelector.cs
@@ -26,7 +26,7 @@
namespace MonoDevelop.Projects
{
- public class ItemConfigurationSelector: ConfigurationSelector
+ public sealed class ItemConfigurationSelector: ConfigurationSelector
{
public string Id { get; private set; }
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/LanguageBinding.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/LanguageBinding.cs
new file mode 100644
index 0000000000..d3fe2f47e1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/LanguageBinding.cs
@@ -0,0 +1,108 @@
+//
+// ILanguageBinding.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core;
+using System.CodeDom.Compiler;
+using Mono.Addins;
+using MonoDevelop.Projects.Extensions;
+using System.Linq;
+
+namespace MonoDevelop.Projects
+{
+ public class LanguageBinding
+ {
+ string[] fileExtensions;
+ string codeDomTypeName;
+ RuntimeAddin addin;
+ CodeDomProvider codeDomProvider;
+ bool? supportsPartialTypes;
+
+ public string Language { get; protected set; }
+
+ public string SingleLineCommentTag { get; protected set; }
+
+ public string BlockCommentStartTag { get; protected set; }
+
+ public string BlockCommentEndTag { get; protected set; }
+
+ public bool SupportsPartialTypes {
+ get {
+ if (!supportsPartialTypes.HasValue && codeDomTypeName != null)
+ supportsPartialTypes = GetCodeDomProvider ().Supports (GeneratorSupport.PartialTypes);
+ return supportsPartialTypes ?? false;
+ }
+ set {
+ supportsPartialTypes = value;
+ }
+ }
+
+ public virtual bool IsSourceCodeFile (FilePath fileName)
+ {
+ if (fileExtensions != null && fileExtensions.Length > 0)
+ return fileExtensions.Any (ex => StringComparer.OrdinalIgnoreCase.Equals (fileName.Extension, ex));
+ throw new NotImplementedException ();
+ }
+
+ public virtual FilePath GetFileName (FilePath fileNameWithoutExtension)
+ {
+ if (fileExtensions != null && fileExtensions.Length > 0)
+ return fileNameWithoutExtension + fileExtensions [0];
+ throw new NotImplementedException ();
+ }
+
+ public virtual CodeDomProvider GetCodeDomProvider ()
+ {
+ if (codeDomTypeName != null) {
+ if (codeDomProvider == null)
+ codeDomProvider = (CodeDomProvider) addin.CreateInstance (codeDomTypeName, true);
+ return codeDomProvider;
+ }
+ return null;
+ }
+
+ internal void InitFromNode (LanguageBindingExtensionNode node)
+ {
+ Language = node.Id;
+
+ if (!string.IsNullOrEmpty (node.SingleLineCommentTag))
+ SingleLineCommentTag = node.SingleLineCommentTag;
+
+ if (!string.IsNullOrEmpty (node.BlockCommentStartTag))
+ BlockCommentStartTag = node.BlockCommentStartTag;
+
+ if (!string.IsNullOrEmpty (node.BlockCommentEndTag))
+ BlockCommentEndTag = node.BlockCommentEndTag;
+
+ if (node.SupportedExtensions != null && node.SupportedExtensions.Length > 0)
+ fileExtensions = node.SupportedExtensions;
+
+ if (!string.IsNullOrEmpty (node.CodeDomType)) {
+ codeDomTypeName = node.CodeDomType;
+ addin = node.Addin;
+ }
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/LanguageBindingService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/LanguageBindingService.cs
index f2823eeeb3..2834623931 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/LanguageBindingService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/LanguageBindingService.cs
@@ -29,70 +29,54 @@ using System.Collections.Generic;
using System.Linq;
using Mono.Addins;
using MonoDevelop.Projects.Extensions;
+using MonoDevelop.Core;
namespace MonoDevelop.Projects
{
public static class LanguageBindingService
{
- static List<LanguageBindingCodon> languageBindingCodons = new List<LanguageBindingCodon> ();
-
- static LanguageBindingService ()
+ const string LanguageBindingExtensionPath = "/MonoDevelop/ProjectModel/LanguageBindings";
+ static LanguageBinding[] extensions;
+
+ static void InitExtensions ()
{
- AddinManager.AddExtensionNodeHandler ("/MonoDevelop/ProjectModel/LanguageBindings", delegate(object sender, ExtensionNodeEventArgs args) {
- LanguageBindingCodon languageBindingCodon = (LanguageBindingCodon)args.ExtensionNode;
- switch (args.Change) {
- case ExtensionChange.Add:
- languageBindingCodons.Add (languageBindingCodon);
- IDotNetLanguageBinding dotNetBinding = languageBindingCodon as IDotNetLanguageBinding;
- if (dotNetBinding != null) {
- object par = dotNetBinding.CreateCompilationParameters (null);
- if (par != null)
- Services.ProjectService.DataContext.IncludeType (par.GetType ());
- par = dotNetBinding.CreateProjectParameters (null);
- if (par != null)
- Services.ProjectService.DataContext.IncludeType (par.GetType ());
- }
- break;
- case ExtensionChange.Remove:
- languageBindingCodons.Remove (languageBindingCodon);
- break;
- }
- languageBindings = null;
- });
- }
-
- static List<ILanguageBinding> languageBindings = null;
- public static IEnumerable<ILanguageBinding> LanguageBindings {
- get {
- CheckBindings ();
- return languageBindings;
+ if (extensions == null) {
+ AddinManager.ExtensionChanged += (sender, args) => {
+ if (args.Path == LanguageBindingExtensionPath)
+ LoadExtensions ();
+ };
+ Runtime.RunInMainThread ((Action)LoadExtensions).Wait ();
}
}
-
- static void CheckBindings ()
+
+ static void LoadExtensions ()
{
- if (languageBindings == null)
- languageBindings = new List<ILanguageBinding> (from codon in languageBindingCodons select codon.LanguageBinding);
+ extensions = AddinManager.GetExtensionNodes<LanguageBindingExtensionNode> (LanguageBindingExtensionPath).Select (b => b.LanguageBinding).ToArray ();
+ }
+
+ public static IEnumerable<LanguageBinding> LanguageBindings {
+ get {
+ InitExtensions ();
+ return extensions;
+ }
}
- public static ILanguageBinding GetBindingPerFileName (string fileName)
+ public static LanguageBinding GetBindingPerFileName (string fileName)
{
if (String.IsNullOrEmpty (fileName)) {
MonoDevelop.Core.LoggingService.LogWarning ("Cannot get binding for null filename at {0}", Environment.StackTrace);
return null;
}
- CheckBindings ();
- return languageBindings.FirstOrDefault (binding => binding.IsSourceCodeFile (fileName));
+ return LanguageBindings.FirstOrDefault (binding => binding.IsSourceCodeFile (fileName));
}
- public static ILanguageBinding GetBindingPerLanguageName (string language)
+ public static LanguageBinding GetBindingPerLanguageName (string language)
{
if (String.IsNullOrEmpty (language)) {
MonoDevelop.Core.LoggingService.LogWarning ("Cannot get binding for null language at {0}", Environment.StackTrace);
return null;
}
- CheckBindings ();
- return languageBindings.FirstOrDefault (binding => binding.Language == language);
+ return LanguageBindings.FirstOrDefault (binding => binding.Language == language);
}
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/MSBuildSerializationExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/MSBuildSerializationExtension.cs
new file mode 100644
index 0000000000..0b2e8efdf9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/MSBuildSerializationExtension.cs
@@ -0,0 +1,67 @@
+//
+// MSBuildSerializationExtension.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Projects.MSBuild;
+using MonoDevelop.Core;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Projects
+{
+ class MSBuildSerializationExtension: WorkspaceObjectReader
+ {
+ public override bool CanRead (FilePath file, Type expectedType)
+ {
+ foreach (var f in MSBuildFileFormat.GetSupportedFormats ()) {
+ if (f.CanReadFile (file, expectedType))
+ return true;
+ }
+ return false;
+ }
+
+ public override Task<SolutionItem> LoadSolutionItem (ProgressMonitor monitor, SolutionLoadContext ctx, string fileName, MSBuildFileFormat expectedFormat, string typeGuid, string itemGuid)
+ {
+ return Task.Run (() => {
+ foreach (var f in MSBuildFileFormat.GetSupportedFormats ()) {
+ if (f.CanReadFile (fileName, typeof(SolutionItem)))
+ return MSBuildProjectService.LoadItem (monitor, fileName, f, typeGuid, itemGuid, ctx);
+ }
+ throw new NotSupportedException ();
+ });
+ }
+
+ public override Task<WorkspaceItem> LoadWorkspaceItem (ProgressMonitor monitor, string fileName)
+ {
+ return Task.Run (async () => {
+ foreach (var f in MSBuildFileFormat.GetSupportedFormats ()) {
+ if (f.CanReadFile (fileName, typeof(WorkspaceItem)))
+ return (WorkspaceItem) await f.ReadFile (fileName, typeof(WorkspaceItem), monitor);
+ }
+ throw new NotSupportedException ();
+ });
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/MSBuildSupport.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/MSBuildSupport.cs
new file mode 100644
index 0000000000..ac942c6f2b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/MSBuildSupport.cs
@@ -0,0 +1,49 @@
+//
+// MSBuildSupport.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Projects
+{
+ [Flags]
+ public enum MSBuildSupport
+ {
+ /// <summary>
+ /// MSBuild engine is not supported
+ /// </summary>
+ NotSupported = 0,
+
+ /// <summary>
+ /// MSBuild engine is supported and will be used by default
+ /// </summary>
+ Supported = 1,
+
+ /// <summary>
+ /// MSBuild engine is required
+ /// </summary>
+ Required = 3
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PathBasedProjectItem.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PathBasedProjectItem.cs
new file mode 100644
index 0000000000..3ad5203a43
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PathBasedProjectItem.cs
@@ -0,0 +1,62 @@
+//
+// PathBasedProjectItem.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core;
+using MonoDevelop.Projects.MSBuild;
+
+namespace MonoDevelop.Projects
+{
+ /// <summary>
+ /// A base class for project items that represent a file or a folder
+ /// </summary>
+ public abstract class PathBasedProjectItem: ProjectItem
+ {
+ public FilePath Path { get; protected set; }
+
+ public override string Include {
+ get {
+ return MSBuildProjectService.ToMSBuildPath (Project != null ? Project.ItemDirectory : null, Path);
+ }
+ protected set {
+ Path = MSBuildProjectService.FromMSBuildPath (Project != null ? Project.ItemDirectory : null, value);
+ }
+ }
+
+ internal protected override void Read (Project project, IMSBuildItemEvaluated buildItem)
+ {
+ base.Read (project, buildItem);
+ Path = MSBuildProjectService.FromMSBuildPath (project.ItemDirectory, buildItem.Include);
+ }
+
+ internal protected override void Write (Project project, MSBuildItem buildItem)
+ {
+ if (string.IsNullOrEmpty (Include))
+ Include = MSBuildProjectService.ToMSBuildPath (project.ItemDirectory, Path);
+ base.Write (project, buildItem);
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PortableDotNetProject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PortableDotNetProject.cs
deleted file mode 100644
index 7903a6152a..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PortableDotNetProject.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// PortableDotNetProject.cs
-//
-// Author: Jeffrey Stedfast <jeff@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Xml;
-using MonoDevelop.Core;
-using MonoDevelop.Core.Assemblies;
-using System.Linq;
-using System.Collections.Generic;
-
-namespace MonoDevelop.Projects
-{
- public class PortableDotNetProject : DotNetProject
- {
- public PortableDotNetProject ()
- {
- }
-
- public PortableDotNetProject (string languageName) : base (languageName)
- {
- }
-
- public PortableDotNetProject (string languageName, ProjectCreateInformation projectCreateInfo, XmlElement projectOptions)
- : base (languageName, projectCreateInfo, projectOptions)
- {
- }
-
- public override IEnumerable<string> GetProjectTypes ()
- {
- yield return "PortableDotNet";
- foreach (var t in base.GetProjectTypes ())
- yield return t;
- }
-
- public override bool SupportsFormat (FileFormat format)
- {
- int version;
-
- if (!format.Id.StartsWith ("MSBuild", StringComparison.Ordinal))
- return false;
-
- if (!int.TryParse (format.Id.Substring ("MSBuild".Length), out version))
- return false;
-
- return version >= 10;
- }
-
- public override bool SupportsFramework (TargetFramework framework)
- {
- return framework.Id.Identifier == TargetFrameworkMoniker.ID_PORTABLE;
- }
-
- public override TargetFrameworkMoniker GetDefaultTargetFrameworkForFormat (FileFormat format)
- {
- // Note: This value is used only when serializing the TargetFramework to the .csproj file.
- // Any component of the TargetFramework that is different from this base TargetFramework
- // value will be serialized.
- //
- // Therefore, if we only specify the TargetFrameworkIdentifier, then both the
- // TargetFrameworkVersion and TargetFrameworkProfile values will be serialized.
- return new TargetFrameworkMoniker (".NETPortable", "1.0");
- }
-
- public override TargetFrameworkMoniker GetDefaultTargetFrameworkId ()
- {
- // Profile78 includes .NET 4.5+, Windows Phone 8, and Xamarin.iOS/Android, so make that our default.
- // Note: see also: PortableLibrary.xpt.xml
- return new TargetFrameworkMoniker (".NETPortable", "4.5", "Profile78");
- }
-
- protected internal override IEnumerable<string> OnGetReferencedAssemblies (ConfigurationSelector configuration, bool includeProjectReferences)
- {
- var res = base.OnGetReferencedAssemblies (configuration, includeProjectReferences);
- var asms = TargetRuntime.AssemblyContext.GetAssemblies (TargetFramework).Where (a => a.Package.IsFrameworkPackage).Select (a => a.Location);
- return res.Concat (asms).Distinct ();
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PortableDotNetProjectBinding.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PortableDotNetProjectBinding.cs
deleted file mode 100644
index 4ec770d696..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PortableDotNetProjectBinding.cs
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// PortableDotNetProjectBinding.cs
-//
-// Author: Jeffrey Stedfast <jeff@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.IO;
-using System.Xml;
-using MonoDevelop.Core.Serialization;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Projects
-{
- public class PortableDotNetProjectBinding : IProjectBinding
- {
- public string Name {
- get { return "PortableDotNet"; }
- }
-
- public Project CreateProject (ProjectCreateInformation info, System.Xml.XmlElement projectOptions)
- {
- string languageName = projectOptions.GetAttribute ("language");
-
- return new PortableDotNetProject (languageName, info, projectOptions);
- }
-
- public Project CreateSingleFileProject (string sourceFile)
- {
- throw new InvalidOperationException ();
- }
-
- public bool CanCreateSingleFileProject (string sourceFile)
- {
- return false;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PortableDotNetProjectFlavor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PortableDotNetProjectFlavor.cs
new file mode 100644
index 0000000000..6ffc5cb2e2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PortableDotNetProjectFlavor.cs
@@ -0,0 +1,88 @@
+//
+// PortableDotNetProjectFlavor.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using MonoDevelop.Core.Assemblies;
+using System.Linq;
+using MonoDevelop.Projects.MSBuild;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Projects
+{
+ public class PortableDotNetProjectFlavor: DotNetProjectExtension
+ {
+ internal protected override void OnGetTypeTags (HashSet<string> types)
+ {
+ base.OnGetTypeTags (types);
+ types.Add ("PortableDotNet");
+ }
+
+ internal protected override bool OnGetSupportsFormat (MSBuildFileFormat format)
+ {
+ int version;
+
+ if (!format.Id.StartsWith ("MSBuild", StringComparison.Ordinal))
+ return false;
+
+ if (!int.TryParse (format.Id.Substring ("MSBuild".Length), out version))
+ return false;
+
+ return version >= 10;
+ }
+
+ internal protected override bool OnGetSupportsFramework (TargetFramework framework)
+ {
+ return framework.Id.Identifier == TargetFrameworkMoniker.ID_PORTABLE;
+ }
+
+ internal protected override TargetFrameworkMoniker OnGetDefaultTargetFrameworkForFormat (string toolsVersion)
+ {
+ // Note: This value is used only when serializing the TargetFramework to the .csproj file.
+ // Any component of the TargetFramework that is different from this base TargetFramework
+ // value will be serialized.
+ //
+ // Therefore, if we only specify the TargetFrameworkIdentifier, then both the
+ // TargetFrameworkVersion and TargetFrameworkProfile values will be serialized.
+ return new TargetFrameworkMoniker (".NETPortable", "1.0");
+ }
+
+ internal protected override TargetFrameworkMoniker OnGetDefaultTargetFrameworkId ()
+ {
+ // Profile78 includes .NET 4.5+, Windows Phone 8, and Xamarin.iOS/Android, so make that our default.
+ // Note: see also: PortableLibrary.xpt.xml
+ return new TargetFrameworkMoniker (".NETPortable", "4.5", "Profile78");
+ }
+
+ internal protected override async Task<List<string>> OnGetReferencedAssemblies (ConfigurationSelector configuration)
+ {
+ var res = await base.OnGetReferencedAssemblies (configuration);
+ var asms = Project.TargetRuntime.AssemblyContext.GetAssemblies (Project.TargetFramework).Where (a => a.Package.IsFrameworkPackage).Select (a => a.Location);
+ res.AddRange (asms);
+ return res;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs
index ce57c35a54..c17a026bc0 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs
@@ -33,14 +33,17 @@ using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.IO;
-using MonoDevelop;
using MonoDevelop.Core;
using MonoDevelop.Core.Serialization;
using MonoDevelop.Projects;
+using System.Threading.Tasks;
+using MonoDevelop.Projects.MSBuild;
+using System.Xml;
using MonoDevelop.Core.Instrumentation;
-using MonoDevelop.Projects.Formats.MSBuild;
-using System.Runtime.Remoting.Messaging;
-
+using MonoDevelop.Core.Assemblies;
+using MonoDevelop.Projects.Extensions;
+using System.Collections.Immutable;
+using System.Threading;
namespace MonoDevelop.Projects
{
@@ -51,107 +54,505 @@ namespace MonoDevelop.Projects
/// This is the base class for MonoDevelop projects. A project is a solution item which has a list of
/// source code files and which can be built to generate an output.
/// </remarks>
- [DataInclude(typeof(ProjectFile))]
- [ProjectModelDataItem(FallbackType = typeof(UnknownProject))]
- public abstract class Project : SolutionEntityItem
+ public class Project : SolutionItem
{
+ string[] flavorGuids = new string[0];
static Counter ProjectOpenedCounter = InstrumentationService.CreateCounter ("Project Opened", "Project Model", id:"Ide.Project.Open");
string[] buildActions;
+ MSBuildProject sourceProject;
+
+ string productVersion;
+ string schemaVersion;
+ bool modifiedInMemory;
+ bool msbuildUpdatePending;
+ ProjectExtension projectExtension;
+
+ List<string> defaultImports;
+
+ ProjectItemCollection items;
+
+ IEnumerable<string> loadedAvailableItemNames = ImmutableList<string>.Empty;
protected Project ()
{
- FileService.FileChanged += OnFileChanged;
+ items = new ProjectItemCollection (this);
+ FileService.FileChanged += HandleFileChanged;
+ Runtime.SystemAssemblyService.DefaultRuntimeChanged += OnDefaultRuntimeChanged;
files = new ProjectFileCollection ();
Items.Bind (files);
DependencyResolutionEnabled = true;
+ }
+
+ public ProjectItemCollection Items {
+ get { return items; }
}
- public TargetEvaluationResult RunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration, TargetEvaluationContext context)
+ protected Project (params string[] flavorGuids): this()
{
- var currentContext = CallContext.GetData ("MonoDevelop.Projects.ProjectOperationContext");
- var currentResult = CallContext.GetData ("MonoDevelop.Projects.TargetEvaluationResult");
- try {
- CallContext.SetData ("MonoDevelop.Projects.ProjectOperationContext", context);
- CallContext.SetData ("MonoDevelop.Projects.TargetEvaluationResult", null);
+ this.flavorGuids = flavorGuids;
+ }
+
+ protected Project (ProjectCreateInformation projectCreateInfo, XmlElement projectOptions): this()
+ {
+ var ids = projectOptions != null ? projectOptions.GetAttribute ("flavorIds") : null;
+ if (!string.IsNullOrEmpty (ids)) {
+ this.flavorGuids = ids.Split (new [] {';'}, StringSplitOptions.RemoveEmptyEntries);
+ }
+ }
+
+ protected override void OnSetShared ()
+ {
+ base.OnSetShared ();
+ items.SetShared ();
+ files.SetShared ();
+ }
+
+ internal class CreationContext
+ {
+ public MSBuildProject Project { get; set; }
+ public string TypeGuid { get; set; }
+ public string[] FlavorGuids { get; set; }
+
+ internal static CreationContext Create (MSBuildProject p, string typeGuid)
+ {
+ return new CreationContext {
+ Project = p,
+ TypeGuid = typeGuid
+ };
+ }
+
+ internal static CreationContext Create (string typeGuid, string[] flavorGuids)
+ {
+ return new CreationContext {
+ TypeGuid = typeGuid,
+ FlavorGuids = flavorGuids
+ };
+ }
+ }
+
+ CreationContext creationContext;
+
+ internal void SetCreationContext (CreationContext ctx)
+ {
+ creationContext = ctx;
+ }
+
+ protected override void OnInitialize ()
+ {
+ base.OnInitialize ();
+
+ if (creationContext != null) {
+
+ if (IsExtensionChainCreated)
+ throw new InvalidOperationException ("Extension chain already created for this object");
+
+ TypeGuid = creationContext.TypeGuid;
- var r = RunTarget (monitor, target, configuration);
+ string projectTypeGuids;
- var evalRes = CallContext.GetData ("MonoDevelop.Projects.TargetEvaluationResult") as TargetEvaluationResult;
- if (evalRes != null) {
- evalRes.BuildResult = r;
- return evalRes;
+ if (creationContext.Project != null) {
+ this.sourceProject = creationContext.Project;
+ projectTypeGuids = sourceProject.EvaluatedProperties.GetValue ("ProjectTypeGuids");
+ if (projectTypeGuids != null) {
+ var subtypeGuids = new List<string> ();
+ foreach (string guid in projectTypeGuids.Split (';')) {
+ string sguid = guid.Trim ();
+ if (sguid.Length > 0 && string.Compare (sguid, creationContext.TypeGuid, StringComparison.OrdinalIgnoreCase) != 0)
+ subtypeGuids.Add (guid);
+ }
+ flavorGuids = subtypeGuids.ToArray ();
+ }
+ } else {
+ sourceProject = new MSBuildProject ();
+ sourceProject.FileName = FileName;
+ flavorGuids = creationContext.FlavorGuids;
}
- return new TargetEvaluationResult (r);
- } finally {
- CallContext.SetData ("MonoDevelop.Projects.ProjectOperationContext", currentContext);
- CallContext.SetData ("MonoDevelop.Projects.TargetEvaluationResult", currentResult);
}
+
+ if (sourceProject == null) {
+ sourceProject = new MSBuildProject ();
+ sourceProject.FileName = FileName;
+ }
+
+ var ggroup = sourceProject.GetGlobalPropertyGroup ();
+ // Avoid crash if there is not global group
+ if (ggroup == null)
+ ggroup = sourceProject.AddNewPropertyGroup (false);
+
+ // Load the evaluated properties
+ InitMainGroupProperties (ggroup);
}
- internal protected override BuildResult OnRunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration)
+ void InitMainGroupProperties (MSBuildPropertyGroup globalGroup)
{
- var currentContext = CallContext.GetData ("MonoDevelop.Projects.ProjectOperationContext") as ProjectOperationContext;
- ProjectOperationContext newContext = currentContext;
+ // Create a project instance to be used for comparing old and new values in the global property group
+ // We use a dummy configuration and platform to avoid loading default values from the configurations
+ // while evaluating
+ var c = Guid.NewGuid ().ToString ();
+ using (var pi = CreateProjectInstaceForConfiguration (c, c))
+ mainGroupProperties = pi.GetPropertiesLinkedToGroup (globalGroup);
+ }
- // Collect last write times for the files generated by this project
- var fileTimes = new Dictionary<FilePath, DateTime> ();
- foreach (var f in GetOutputFiles (configuration))
- fileTimes [f] = File.GetLastWriteTime (f);
+ protected override void OnExtensionChainInitialized ()
+ {
+ projectExtension = ExtensionChain.GetExtension<ProjectExtension> ();
+ base.OnExtensionChainInitialized ();
+ if (creationContext != null && creationContext.Project != null)
+ FileName = creationContext.Project.FileName;
- try {
- if (newContext == null)
- newContext = new TargetEvaluationContext ();
- else if (!(newContext is TargetEvaluationContext))
- newContext = new TargetEvaluationContext (newContext);
-
- var res = OnRunTarget (monitor, target, configuration, (TargetEvaluationContext) newContext);
- CallContext.SetData ("MonoDevelop.Projects.TargetEvaluationResult", res);
- return res.BuildResult;
- } finally {
- if (newContext != currentContext)
- CallContext.SetData ("MonoDevelop.Projects.ProjectOperationContext", currentContext);
+ MSBuildEngineSupport = MSBuildProjectService.GetMSBuildSupportForProject (this);
+ InitFormatProperties ();
+ }
- // If any of the project generated files changes, notify it
- foreach (var e in fileTimes) {
- if (File.GetLastWriteTime (e.Key) != e.Value)
- FileService.NotifyFileChanged (e.Key);
+ void OnDefaultRuntimeChanged (object o, EventArgs args)
+ {
+ // If the default runtime changes, the project builder for this project may change
+ // so it has to be created again.
+ CleanupProjectBuilder ();
+ }
+
+ public IEnumerable<string> FlavorGuids {
+ get { return flavorGuids; }
+ }
+
+ public IPropertySet ProjectProperties {
+ get { return mainGroupProperties ?? MSBuildProject.GetGlobalPropertyGroup (); }
+ }
+
+ public MSBuildProject MSBuildProject {
+ get {
+ return sourceProject;
+ }
+ }
+
+ public List<string> DefaultImports {
+ get {
+ if (defaultImports == null) {
+ var list = new List<string> ();
+ ProjectExtension.OnGetDefaultImports (list);
+ defaultImports = list;
}
+ return defaultImports;
}
}
- internal protected virtual TargetEvaluationResult OnRunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration, TargetEvaluationContext context)
+ new public ProjectConfiguration CreateConfiguration (string name, string platform, ConfigurationKind kind = ConfigurationKind.Blank)
{
- var currentContext = CallContext.GetData ("MonoDevelop.Projects.ProjectOperationContext") as ProjectOperationContext;
- CallContext.SetData ("MonoDevelop.Projects.ProjectOperationContext", context);
+ return (ProjectConfiguration) base.CreateConfiguration (name, platform, kind);
+ }
- try {
- var r = base.OnRunTarget (monitor, target, configuration);
- var evalRes = CallContext.GetData ("MonoDevelop.Projects.TargetEvaluationResult") as TargetEvaluationResult;
- if (evalRes != null)
- evalRes.BuildResult = r;
- else
- evalRes = new TargetEvaluationResult (r);
- return evalRes;
- } finally {
- CallContext.SetData ("MonoDevelop.Projects.ProjectOperationContext", currentContext);
+ new public ProjectConfiguration CreateConfiguration (string id, ConfigurationKind kind = ConfigurationKind.Blank)
+ {
+ return (ProjectConfiguration) base.CreateConfiguration (id, kind);
+ }
+
+ new public ProjectConfiguration CloneConfiguration (SolutionItemConfiguration configuration, string newName, string newPlatform)
+ {
+ return (ProjectConfiguration) base.CloneConfiguration (configuration, newName, newPlatform);
+ }
+
+ new public ProjectConfiguration CloneConfiguration (SolutionItemConfiguration configuration, string newId)
+ {
+ return (ProjectConfiguration) base.CloneConfiguration (configuration, newId);
+ }
+
+ protected override void OnConfigurationAdded (ConfigurationEventArgs args)
+ {
+ var conf = (ProjectConfiguration)args.Configuration;
+
+ // Initialize the property group only if the project is not being loaded (in which case it will
+ // be initialized by the ReadProject method) or if the project is new (because it will be initialized
+ // after the project is fully written, since only then all imports are in place
+ if (!Loading && !sourceProject.IsNewProject)
+ InitConfiguration (conf);
+
+ base.OnConfigurationAdded (args);
+ }
+
+ void InitConfiguration (ProjectConfiguration conf)
+ {
+ var pi = CreateProjectInstaceForConfiguration (conf.Name, conf.Platform);
+ conf.Properties = pi.GetPropertiesLinkedToGroup (conf.MainPropertyGroup);
+ conf.ProjectInstance = pi;
+ }
+
+ protected override void OnConfigurationRemoved (ConfigurationEventArgs args)
+ {
+ var conf = (ProjectConfiguration) args.Configuration;
+ if (conf.ProjectInstance != null) {
+ // Dispose the project instance that was used to load the configuration
+ conf.Properties = conf.MainPropertyGroup;
+ conf.ProjectInstance.Dispose ();
+ conf.ProjectInstance = null;
}
+ base.OnConfigurationRemoved (args);
}
- string[] supportedMSBuildTargets;
+ protected virtual void OnGetDefaultImports (List<string> imports)
+ {
+ }
+
+ public string ToolsVersion { get; private set; }
- internal protected override bool OnGetSupportsTarget (string target)
+ internal bool CheckAllFlavorsSupported ()
{
- if (target == ProjectService.BuildTarget || target == ProjectService.CleanTarget)
- return true;
- if (supportedMSBuildTargets == null) {
- var h = ItemHandler as MSBuildProjectHandler;
- if (h != null)
- supportedMSBuildTargets = h.GetSupportedTargets ();
- else
- supportedMSBuildTargets = new string[0];
+ return FlavorGuids.All (g => ProjectExtension.SupportsFlavor (g));
+ }
+
+ ProjectExtension ProjectExtension {
+ get {
+ if (projectExtension == null)
+ AssertExtensionChainCreated ();
+ return projectExtension;
+ }
+ }
+
+ public MSBuildSupport MSBuildEngineSupport { get; private set; }
+
+ protected override void OnModified (SolutionItemModifiedEventArgs args)
+ {
+ if (!Loading) {
+ modifiedInMemory = true;
+ msbuildUpdatePending = true;
+ }
+ base.OnModified (args);
+ }
+
+ protected override Task OnLoad (ProgressMonitor monitor)
+ {
+ return Task.Run (async delegate {
+ if (sourceProject == null || sourceProject.IsNewProject) {
+ sourceProject = await MSBuildProject.LoadAsync (FileName);
+ if (MSBuildEngineSupport == MSBuildSupport.NotSupported)
+ sourceProject.UseMSBuildEngine = false;
+ sourceProject.Evaluate ();
+ }
+
+ IMSBuildPropertySet globalGroup = sourceProject.GetGlobalPropertyGroup ();
+ // Avoid crash if there is not global group
+ if (globalGroup == null)
+ sourceProject.AddNewPropertyGroup (false);
+
+ ProjectExtension.OnPrepareForEvaluation (sourceProject);
+
+ ReadProject (monitor, sourceProject);
+ });
+ }
+
+ /// <summary>
+ /// Runs the generator target and sends file change notifications if any files were modified, returns the build result
+ /// </summary>
+ public Task<TargetEvaluationResult> PerformGeneratorAsync (ConfigurationSelector configuration, string generatorTarget)
+ {
+ return BindTask<TargetEvaluationResult> (async cancelToken => {
+ var cancelSource = new CancellationTokenSource ();
+ cancelToken.Register (() => cancelSource.Cancel ());
+
+ using (var monitor = new ProgressMonitor (cancelSource)) {
+ return await this.PerformGeneratorAsync (monitor, configuration, generatorTarget);
+ }
+ });
+ }
+
+ /// <summary>
+ /// Runs the generator target and sends file change notifications if any files were modified, returns the build result
+ /// </summary>
+ public async Task<TargetEvaluationResult> PerformGeneratorAsync (ProgressMonitor monitor, ConfigurationSelector configuration, string generatorTarget)
+ {
+ var fileInfo = await GetProjectFileTimestamps (monitor, configuration);
+ var evalResult = await this.RunTarget (monitor, generatorTarget, configuration);
+ SendFileChangeNotifications (monitor, configuration, fileInfo);
+
+ return evalResult;
+ }
+
+ /// <summary>
+ /// Returns a list containing FileInfo for all the source files in the project
+ /// </summary>
+ async Task<List<FileInfo>> GetProjectFileTimestamps (ProgressMonitor monitor, ConfigurationSelector configuration)
+ {
+ var infoList = new List<FileInfo> ();
+ var projectFiles = await this.GetSourceFilesAsync (monitor, configuration);
+
+ foreach (var projectFile in projectFiles) {
+ var info = new FileInfo (projectFile.FilePath);
+ infoList.Add (info);
+ }
+
+ return infoList;
+ }
+
+ /// <summary>
+ /// Sends a file change notification via FileService for any file that has changed since the timestamps in beforeFileInfo
+ /// </summary>
+ void SendFileChangeNotifications (ProgressMonitor monitor, ConfigurationSelector configuration, List<FileInfo> beforeFileInfo)
+ {
+ var changedFiles = new List<FileInfo> ();
+
+ foreach (var file in beforeFileInfo) {
+ var info = new FileInfo (file.FullName);
+
+ if (file.Exists && info.Exists) {
+ if (file.LastWriteTime != info.LastWriteTime) {
+ changedFiles.Add (info);
+ }
+ } else if (info.Exists) {
+ changedFiles.Add (info);
+ } else if (file.Exists) {
+ // not sure if this should or could happen, it doesn't really make much sense
+ FileService.NotifyFileRemoved (file.FullName);
+ }
+ }
+
+ FileService.NotifyFilesChanged (changedFiles.Select (cf => new FilePath (cf.FullName)));
+ }
+
+ /// <summary>
+ /// Gets the source files that are included in the project, including any that are added by `CoreCompileDependsOn`
+ /// </summary>
+ public Task<ProjectFile[]> GetSourceFilesAsync (ConfigurationSelector configuration)
+ {
+ if (sourceProject == null)
+ return Task.FromResult (new ProjectFile [0]);
+
+ return BindTask<ProjectFile []> (async cancelToken => {
+ var cancelSource = new CancellationTokenSource ();
+ cancelToken.Register (() => cancelSource.Cancel ());
+
+ using (var monitor = new ProgressMonitor (cancelSource)) {
+ return await GetSourceFilesAsync (monitor, configuration);
+ }
+ });
+ }
+
+ /// <summary>
+ /// Gets the source files that are included in the project, including any that are added by `CoreCompileDependsOn`
+ /// </summary>
+ public Task<ProjectFile []> GetSourceFilesAsync (ProgressMonitor monitor, ConfigurationSelector configuration)
+ {
+ return ProjectExtension.OnGetSourceFiles (monitor, configuration);
+ }
+
+ /// <summary>
+ /// Gets the source files that are included in the project, including any that are added by `CoreCompileDependsOn`
+ /// </summary>
+ protected virtual async Task<ProjectFile[]> OnGetSourceFiles (ProgressMonitor monitor, ConfigurationSelector configuration)
+ {
+ // pre-load the results with the current list of files in the project
+ var results = new List<ProjectFile> ();
+
+ var buildActions = GetBuildActions ().Where (a => a != "Folder" && a != "--").ToArray ();
+
+ var config = configuration != null ? GetConfiguration (configuration) : null;
+ var pri = await CreateProjectInstaceForConfigurationAsync (config?.Name, config?.Platform, false);
+ foreach (var it in pri.EvaluatedItems.Where (i => buildActions.Contains (i.Name)))
+ results.Add (CreateProjectFile (it));
+
+ // add in any compile items that we discover from running the CoreCompile dependencies
+ var evaluatedCompileItems = await GetCompileItemsFromCoreCompileDependenciesAsync (monitor, configuration);
+ var addedItems = evaluatedCompileItems.Where (i => results.All (pi => pi.FilePath != i.FilePath)).ToList ();
+ results.AddRange (addedItems);
+
+ return results.ToArray ();
+ }
+
+ bool evaluatedCoreCompileDependencies;
+ readonly TaskCompletionSource<ProjectFile[]> evaluatedCompileItemsTask = new TaskCompletionSource<ProjectFile[]> ();
+
+ /// <summary>
+ /// Gets the list of files that are included as Compile items from the evaluation of the CoreCompile dependecy targets
+ /// </summary>
+ async Task<ProjectFile[]> GetCompileItemsFromCoreCompileDependenciesAsync (ProgressMonitor monitor, ConfigurationSelector configuration)
+ {
+ List<ProjectFile> result = null;
+ lock (evaluatedCompileItemsTask) {
+ if (!evaluatedCoreCompileDependencies) {
+ result = new List<ProjectFile> ();
+ evaluatedCoreCompileDependencies = true;
+ }
+ }
+
+ if (result != null) {
+ var coreCompileDependsOn = sourceProject.EvaluatedProperties.GetValue<string> ("CoreCompileDependsOn");
+
+ if (string.IsNullOrEmpty (coreCompileDependsOn)) {
+ evaluatedCompileItemsTask.SetResult (new ProjectFile [0]);
+ return evaluatedCompileItemsTask.Task.Result;
+ }
+
+ var dependsList = coreCompileDependsOn.Split (new [] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ foreach (var dependTarget in dependsList) {
+ try {
+ // evaluate the Compile targets
+ var ctx = new TargetEvaluationContext ();
+ ctx.ItemsToEvaluate.Add ("Compile");
+
+ var evalResult = await this.RunTarget (monitor, dependTarget, configuration, ctx);
+ if (evalResult != null && !evalResult.BuildResult.HasErrors) {
+ var evalItems = evalResult
+ .Items
+ .Select (i => CreateProjectFile (i))
+ .ToList ();
+
+ result.AddRange (evalItems);
+ }
+ } catch (Exception ex) {
+ LoggingService.LogInternalError (string.Format ("Error running target {0}", dependTarget), ex);
+ }
+ }
+ evaluatedCompileItemsTask.SetResult (result.ToArray ());
+ }
+
+ return await evaluatedCompileItemsTask.Task;
+ }
+
+ ProjectFile CreateProjectFile (IMSBuildItemEvaluated item)
+ {
+ return new ProjectFile (MSBuildProjectService.FromMSBuildPath (sourceProject.BaseDirectory, item.Include), item.Name) { Project = this };
+ }
+
+ /// <summary>
+ /// Called just after the MSBuild project is loaded but before it is evaluated.
+ /// </summary>
+ /// <param name="project">The project</param>
+ /// <remarks>
+ /// Subclasses can override this method to transform the MSBuild project before it is evaluated.
+ /// For example, it can be used to add or remove imports, or to set custom values for properties.
+ /// Changes done in the MSBuild files are not saved.
+ /// </remarks>
+ protected virtual void OnPrepareForEvaluation (MSBuildProject project)
+ {
+ }
+
+ internal protected override async Task OnSave (ProgressMonitor monitor)
+ {
+ SetFastBuildCheckDirty ();
+ modifiedInMemory = false;
+
+ await WriteProjectAsync (monitor);
+
+ // Doesn't save the file to disk if the content did not change
+ if (await sourceProject.SaveAsync (FileName)) {
+ var pb = GetCachedProjectBuilder ();
+ if (pb != null) {
+ try {
+ await pb.Refresh ();
+ } finally {
+ pb.ReleaseReference ();
+ }
+ }
}
- return supportedMSBuildTargets.Contains (target);
+ }
+
+ protected override IEnumerable<WorkspaceObjectExtension> CreateDefaultExtensions ()
+ {
+ return base.CreateDefaultExtensions ().Concat (Enumerable.Repeat (new DefaultMSBuildProjectExtension (), 1));
+ }
+
+ internal protected override IEnumerable<string> GetItemTypeGuids ()
+ {
+ return base.GetItemTypeGuids ().Concat (flavorGuids);
}
protected override void OnGetProjectEventMetadata (IDictionary<string, string> metadata)
@@ -160,7 +561,7 @@ namespace MonoDevelop.Projects
var sb = new System.Text.StringBuilder ();
var first = true;
- var projectTypes = this.GetProjectTypes ().ToList ();
+ var projectTypes = this.GetTypeTags ().ToList ();
foreach (var p in projectTypes.Where (x => (x != "DotNet") || projectTypes.Count == 1)) {
if (!first)
sb.Append (", ");
@@ -180,10 +581,9 @@ namespace MonoDevelop.Projects
/// <summary>
/// Description of the project.
/// </summary>
- [ItemProperty("Description", DefaultValue = "")]
private string description = "";
public string Description {
- get { return description; }
+ get { return description ?? ""; }
set {
description = value;
NotifyModified ("Description");
@@ -199,12 +599,32 @@ namespace MonoDevelop.Projects
/// <param name='fileName'>
/// File name
/// </param>
- public virtual bool IsCompileable (string fileName)
+ public bool IsCompileable (string fileName)
+ {
+ return ProjectExtension.OnGetIsCompileable (fileName);
+ }
+
+ protected virtual bool OnGetIsCompileable (string fileName)
{
return false;
}
/// <summary>
+ /// Determines whether the provided build action is a compile action
+ /// </summary>
+ /// <returns><c>true</c> if this instance is compile build action the specified buildAction; otherwise, <c>false</c>.</returns>
+ /// <param name="buildAction">Build action.</param>
+ public bool IsCompileBuildAction (string buildAction)
+ {
+ return ProjectExtension.OnGetIsCompileBuildAction (buildAction);
+ }
+
+ protected virtual bool OnGetIsCompileBuildAction (string buildAction)
+ {
+ return buildAction == BuildAction.Compile;
+ }
+
+ /// <summary>
/// Files of the project
/// </summary>
public ProjectFileCollection Files {
@@ -212,10 +632,9 @@ namespace MonoDevelop.Projects
}
private ProjectFileCollection files;
- [ProjectPathItemProperty ("BaseIntermediateOutputPath")]
FilePath baseIntermediateOutputPath;
- public virtual FilePath BaseIntermediateOutputPath {
+ public FilePath BaseIntermediateOutputPath {
get {
if (!baseIntermediateOutputPath.IsNullOrEmpty)
return baseIntermediateOutputPath;
@@ -231,20 +650,33 @@ namespace MonoDevelop.Projects
}
/// <summary>
- /// Gets the type of the project.
+ /// Gets the project type and its base types.
/// </summary>
- /// <value>
- /// The type of the project.
- /// </value>
- [Obsolete ("Use GetProjectTypes")]
- public virtual string ProjectType {
- get { return GetProjectTypes ().First (); }
+ public IEnumerable<string> GetTypeTags ()
+ {
+ HashSet<string> sset = new HashSet<string> ();
+ ProjectExtension.OnGetTypeTags (sset);
+ return sset;
}
- /// <summary>
- /// Gets the project type and its base types.
- /// </summary>
- public abstract IEnumerable<string> GetProjectTypes ();
+ protected virtual void OnGetTypeTags (HashSet<string> types)
+ {
+ }
+
+ public bool HasFlavor<T> ()
+ {
+ return GetService (typeof(T)) != null;
+ }
+
+ public T GetFlavor<T> () where T:ProjectExtension
+ {
+ return (T) GetService (typeof(T));
+ }
+
+ internal IEnumerable<ProjectExtension> GetFlavors ()
+ {
+ return ExtensionChain.GetAllExtensions ().OfType<ProjectExtension> ();
+ }
/// <summary>
/// Gets or sets the icon of the project.
@@ -252,11 +684,16 @@ namespace MonoDevelop.Projects
/// <value>
/// The stock icon.
/// </value>
- public virtual IconId StockIcon {
- get { return stockIcon; }
+ public IconId StockIcon {
+ get {
+ if (stockIcon != null)
+ return stockIcon.Value;
+ else
+ return ProjectExtension.StockIcon;
+ }
set { this.stockIcon = value; NotifyModified ("StockIcon"); }
}
- IconId stockIcon = "md-project";
+ IconId? stockIcon;
/// <summary>
/// List of languages that this project supports
@@ -264,8 +701,13 @@ namespace MonoDevelop.Projects
/// <value>
/// The identifiers of the supported languages.
/// </value>
- public virtual string[] SupportedLanguages {
- get { return new String[] { "" }; }
+ public string[] SupportedLanguages {
+ get { return ProjectExtension.SupportedLanguages; }
+ }
+
+ protected virtual string[] OnGetSupportedLanguages ()
+ {
+ return new String[] { "" };
}
/// <summary>
@@ -277,11 +719,61 @@ namespace MonoDevelop.Projects
/// <param name='fileName'>
/// File name.
/// </param>
- public virtual string GetDefaultBuildAction (string fileName)
+ public string GetDefaultBuildAction (string fileName)
+ {
+ return ProjectExtension.OnGetDefaultBuildAction (fileName);
+ }
+
+ protected virtual string OnGetDefaultBuildAction (string fileName)
{
return IsCompileable (fileName) ? BuildAction.Compile : BuildAction.None;
}
-
+
+ internal ProjectItem CreateProjectItem (IMSBuildItemEvaluated item)
+ {
+ return ProjectExtension.OnCreateProjectItem (item);
+ }
+
+ protected virtual ProjectItem OnCreateProjectItem (IMSBuildItemEvaluated item)
+ {
+ if (item.Name == "Folder")
+ return new ProjectFile ();
+
+ var type = MSBuildProjectService.GetProjectItemType (item.Name);
+ if (type != null)
+ return (ProjectItem) Activator.CreateInstance (type, true);
+
+ // Unknown item. Must be a file.
+ if (!string.IsNullOrEmpty (item.Include) && !UnsupportedItems.Contains (item.Name) && IsValidFile (item.Include))
+ return new ProjectFile ();
+
+ return new UnknownProjectItem (item.Name, item.Include);
+ }
+
+ bool IsValidFile (string path)
+ {
+ // If it is an absolute uri, it's not a valid file
+ try {
+ if (Uri.IsWellFormedUriString (path, UriKind.Absolute)) {
+ var f = new Uri (path);
+ return f.Scheme == "file";
+ }
+ } catch {
+ // Old mono versions may crash in IsWellFormedUriString if the path
+ // is not an uri.
+ }
+ return true;
+ }
+
+ // Items generated by VS but which MD is not using and should be ignored
+
+ internal static readonly IList<string> UnsupportedItems = new string[] {
+ "BootstrapperFile", "AppDesigner", "WebReferences", "WebReferenceUrl", "Service",
+ "ProjectReference", "Reference", // Reference elements are included here because they are special-cased for DotNetProject, and they are unsupported in other types of projects
+ "InternalsVisibleTo",
+ "InternalsVisibleToTest"
+ };
+
/// <summary>
/// Gets a project file.
/// </summary>
@@ -320,19 +812,17 @@ namespace MonoDevelop.Projects
return buildActions;
// find all the actions in use and add them to the list of standard actions
- Hashtable actions = new Hashtable ();
- object marker = new object (); //avoid using bools as they need to be boxed. re-use single object instead
+ HashSet<string> actions = new HashSet<string> ();
//ad the standard actions
- foreach (string action in GetStandardBuildActions ())
- actions[action] = marker;
+ foreach (string action in ProjectExtension.OnGetStandardBuildActions ().Concat (loadedAvailableItemNames))
+ actions.Add (action);
//add any more actions that are in the project file
foreach (ProjectFile pf in files)
- if (!actions.ContainsKey (pf.BuildAction))
- actions[pf.BuildAction] = marker;
+ actions.Add (pf.BuildAction);
//remove the "common" actions, since they're handled separately
- IList<string> commonActions = GetCommonBuildActions ();
+ IList<string> commonActions = ProjectExtension.OnGetCommonBuildActions ();
foreach (string action in commonActions)
if (actions.Contains (action))
actions.Remove (action);
@@ -352,7 +842,7 @@ namespace MonoDevelop.Projects
if (hasDash)
buildActions[dashPos] = "--";
if (actions.Count > 0)
- actions.Keys.CopyTo (buildActions, uncommonStart);
+ actions.CopyTo (buildActions, uncommonStart);
//sort the actions
if (hasDash) {
@@ -368,7 +858,7 @@ namespace MonoDevelop.Projects
/// <summary>
/// Gets a list of standard build actions.
/// </summary>
- protected virtual IEnumerable<string> GetStandardBuildActions ()
+ protected virtual IEnumerable<string> OnGetStandardBuildActions ()
{
return BuildAction.StandardActions;
}
@@ -376,27 +866,424 @@ namespace MonoDevelop.Projects
/// <summary>
/// Gets a list of common build actions (common actions are shown first in the project build action list)
/// </summary>
- protected virtual IList<string> GetCommonBuildActions ()
+ protected virtual IList<string> OnGetCommonBuildActions ()
{
return BuildAction.StandardActions;
}
- public static Project LoadProject (string filename, IProgressMonitor monitor)
+ protected override void OnDispose ()
{
- Project prj = Services.ProjectService.ReadSolutionItem (monitor, filename) as Project;
- if (prj == null)
- throw new InvalidOperationException ("Invalid project file: " + filename);
+ foreach (ProjectConfiguration c in Configurations)
+ c.ProjectInstance.Dispose ();
+
+ foreach (var item in items) {
+ IDisposable disp = item as IDisposable;
+ if (disp != null)
+ disp.Dispose ();
+ }
+
+ FileService.FileChanged -= HandleFileChanged;
+ Runtime.SystemAssemblyService.DefaultRuntimeChanged -= OnDefaultRuntimeChanged;
+ CleanupProjectBuilder ();
- return prj;
+ if (sourceProject != null) {
+ sourceProject.Dispose ();
+ sourceProject = null;
+ }
+ base.OnDispose ();
+ }
+
+ /// <summary>
+ /// Runs a build or execution target.
+ /// </summary>
+ /// <returns>
+ /// The result of the operation
+ /// </returns>
+ /// <param name='monitor'>
+ /// A progress monitor
+ /// </param>
+ /// <param name='target'>
+ /// Name of the target
+ /// </param>
+ /// <param name='configuration'>
+ /// Configuration to use to run the target
+ /// </param>
+ public async Task<TargetEvaluationResult> RunTarget (ProgressMonitor monitor, string target, ConfigurationSelector configuration, TargetEvaluationContext context = null)
+ {
+ return await ProjectExtension.OnRunTarget (monitor, target, configuration, context);
}
+ public bool SupportsTarget (string target)
+ {
+ return !IsUnsupportedProject && ProjectExtension.OnGetSupportsTarget (target);
+ }
- public override void Dispose ()
+ protected virtual bool OnGetSupportsTarget (string target)
{
- FileService.FileChanged -= OnFileChanged;
- base.Dispose ();
+ return sourceProject.EvaluatedTargetsIgnoringCondition.Any (t => t.Name == target);
}
-
+
+ /// <summary>
+ /// Runs a build or execution target.
+ /// </summary>
+ /// <returns>
+ /// The result of the operation
+ /// </returns>
+ /// <param name='monitor'>
+ /// A progress monitor
+ /// </param>
+ /// <param name='target'>
+ /// Name of the target
+ /// </param>
+ /// <param name='configuration'>
+ /// Configuration to use to run the target
+ /// </param>
+ /// <remarks>
+ /// Subclasses can override this method to provide a custom implementation of project operations such as
+ /// build or clean. The default implementation delegates the execution to the more specific OnBuild
+ /// and OnClean methods, or to the item handler for other targets.
+ /// </remarks>
+ internal protected virtual Task<TargetEvaluationResult> OnRunTarget (ProgressMonitor monitor, string target, ConfigurationSelector configuration, TargetEvaluationContext context)
+ {
+ if (target == ProjectService.BuildTarget)
+ return RunBuildTarget (monitor, configuration, context);
+ else if (target == ProjectService.CleanTarget)
+ return RunCleanTarget (monitor, configuration, context);
+ return RunMSBuildTarget (monitor, target, configuration, context);
+ }
+
+
+ async Task<TargetEvaluationResult> DoRunTarget (ProgressMonitor monitor, string target, ConfigurationSelector configuration, TargetEvaluationContext context)
+ {
+ if (target == ProjectService.BuildTarget) {
+ SolutionItemConfiguration conf = GetConfiguration (configuration);
+ if (conf != null && conf.CustomCommands.HasCommands (CustomCommandType.Build)) {
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return new TargetEvaluationResult (BuildResult.CreateCancelled ().SetSource (this));
+ if (!await conf.CustomCommands.ExecuteCommand (monitor, this, CustomCommandType.Build, configuration)) {
+ var r = new BuildResult ();
+ r.AddError (GettextCatalog.GetString ("Custom command execution failed"));
+ return new TargetEvaluationResult (r.SetSource (this));
+ }
+ return new TargetEvaluationResult (BuildResult.CreateSuccess ().SetSource (this));
+ }
+ } else if (target == ProjectService.CleanTarget) {
+ SetFastBuildCheckDirty ();
+ SolutionItemConfiguration config = GetConfiguration (configuration);
+ if (config != null && config.CustomCommands.HasCommands (CustomCommandType.Clean)) {
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return new TargetEvaluationResult (BuildResult.CreateCancelled ().SetSource (this));
+ if (!await config.CustomCommands.ExecuteCommand (monitor, this, CustomCommandType.Clean, configuration)) {
+ var r = new BuildResult ();
+ r.AddError (GettextCatalog.GetString ("Custom command execution failed"));
+ return new TargetEvaluationResult (r.SetSource (this));
+ }
+ return new TargetEvaluationResult (BuildResult.CreateSuccess ().SetSource (this));
+ }
+ }
+
+ // Collect last write times for the files generated by this project
+ var fileTimes = new Dictionary<FilePath, DateTime> ();
+ foreach (var f in GetOutputFiles (configuration))
+ fileTimes [f] = File.GetLastWriteTime (f);
+
+ try {
+ var tr = await OnRunTarget (monitor, target, configuration, context);
+ tr.BuildResult.SourceTarget = this;
+ return tr;
+ } finally {
+ // If any of the project generated files changes, notify it
+ foreach (var e in fileTimes) {
+ if (File.GetLastWriteTime (e.Key) != e.Value)
+ FileService.NotifyFileChanged (e.Key);
+ }
+ }
+ }
+
+ async Task<TargetEvaluationResult> RunMSBuildTarget (ProgressMonitor monitor, string target, ConfigurationSelector configuration, TargetEvaluationContext context)
+ {
+ if (CheckUseMSBuildEngine (configuration)) {
+ LogWriter logWriter = new LogWriter (monitor.Log);
+ var configs = GetConfigurations (configuration);
+
+ string [] evaluateItems = context != null ? context.ItemsToEvaluate.ToArray () : new string [0];
+ string [] evaluateProperties = context != null ? context.PropertiesToEvaluate.ToArray () : new string [0];
+
+ var globalProperties = new Dictionary<string, string> ();
+ if (context != null) {
+ var md = (ProjectItemMetadata)context.GlobalProperties;
+ md.SetProject (sourceProject);
+ foreach (var p in md.GetProperties ())
+ globalProperties [p.Name] = p.Value;
+ }
+
+ MSBuildResult result = null;
+ await Task.Run (async delegate {
+
+ TimerCounter buildTimer = null;
+ switch (target) {
+ case "Build": buildTimer = Counters.BuildMSBuildProjectTimer; break;
+ case "Clean": buildTimer = Counters.CleanMSBuildProjectTimer; break;
+ }
+
+ var t1 = Counters.RunMSBuildTargetTimer.BeginTiming (GetProjectEventMetadata (configuration));
+ var t2 = buildTimer != null ? buildTimer.BeginTiming (GetProjectEventMetadata (configuration)) : null;
+
+ bool newBuilderRequested = false;
+
+ RemoteProjectBuilder builder = await GetProjectBuilder ();
+ if (builder.IsBusy) {
+ builder.ReleaseReference ();
+ newBuilderRequested = true;
+ builder = await RequestLockedBuilder ();
+ }
+ else
+ builder.Lock ();
+
+ try {
+ result = await builder.Run (configs, logWriter, MSBuildProjectService.DefaultMSBuildVerbosity, new [] { target }, evaluateItems, evaluateProperties, globalProperties, monitor.CancellationToken);
+ } finally {
+ builder.Unlock ();
+ builder.ReleaseReference ();
+ if (newBuilderRequested) {
+ // Dispose the builder after a while, so that it can be reused
+ #pragma warning disable 4014
+ Task.Delay (10000).ContinueWith (t => builder.Dispose ());
+ #pragma warning restore 4014
+ }
+ t1.End ();
+ if (t2 != null)
+ t2.End ();
+ }
+
+ System.Runtime.Remoting.RemotingServices.Disconnect (logWriter);
+ });
+
+ var br = new BuildResult ();
+ foreach (var err in result.Errors) {
+ FilePath file = null;
+ if (err.File != null)
+ file = Path.Combine (Path.GetDirectoryName (err.ProjectFile), err.File);
+
+ br.Append (new BuildError (file, err.LineNumber, err.ColumnNumber, err.Code, err.Message) {
+ Subcategory = err.Subcategory,
+ EndLine = err.EndLineNumber,
+ EndColumn = err.EndColumnNumber,
+ IsWarning = err.IsWarning,
+ HelpKeyword = err.HelpKeyword,
+ });
+ }
+
+ // Get the evaluated properties
+
+ var properties = new Dictionary<string, IMSBuildPropertyEvaluated> ();
+ foreach (var p in result.Properties)
+ properties [p.Key] = new MSBuildPropertyEvaluated (sourceProject, p.Key, p.Value, p.Value);
+
+ var props = new MSBuildPropertyGroupEvaluated (sourceProject);
+ props.SetProperties (properties);
+
+ // Get the evaluated items
+
+ var evItems = new List<IMSBuildItemEvaluated> ();
+ foreach (var it in result.Items.SelectMany (d => d.Value)) {
+ var eit = new MSBuildItemEvaluated (sourceProject, it.Name, it.ItemSpec, it.ItemSpec);
+ if (it.Metadata.Count > 0) {
+ var imd = (MSBuildPropertyGroupEvaluated)eit.Metadata;
+ properties = new Dictionary<string, IMSBuildPropertyEvaluated> ();
+ foreach (var m in it.Metadata)
+ properties [m.Key] = new MSBuildPropertyEvaluated (sourceProject, m.Key, m.Value, m.Value);
+ imd.SetProperties (properties);
+ }
+ evItems.Add (eit);
+ }
+
+ return new TargetEvaluationResult (br, evItems, props);
+ }
+ else {
+ CleanupProjectBuilder ();
+ if (this is DotNetProject) {
+ var handler = new MonoDevelop.Projects.MD1.MD1DotNetProjectHandler ((DotNetProject)this);
+ return new TargetEvaluationResult (await handler.RunTarget (monitor, target, configuration));
+ }
+ }
+ return null;
+ }
+
+ internal ProjectConfigurationInfo [] GetConfigurations (ConfigurationSelector configuration, bool includeReferencedProjects = true)
+ {
+ var visitedProjects = new HashSet<Project> ();
+ visitedProjects.Add (this);
+ return GetConfigurations (configuration, includeReferencedProjects, visitedProjects);
+ }
+
+ ProjectConfigurationInfo[] GetConfigurations (ConfigurationSelector configuration, bool includeReferencedProjects, HashSet<Project> visited)
+ {
+ var sc = ParentSolution != null ? ParentSolution.GetConfiguration (configuration) : null;
+
+ // Returns a list of project/configuration information for the provided item and all its references
+ List<ProjectConfigurationInfo> configs = new List<ProjectConfigurationInfo> ();
+ var c = GetConfiguration (configuration);
+ configs.Add (new ProjectConfigurationInfo () {
+ ProjectFile = FileName,
+ Configuration = c != null ? c.Name : "",
+ Platform = c != null ? GetExplicitPlatform (c) : "",
+ ProjectGuid = ItemId,
+ Enabled = sc == null || sc.BuildEnabledForItem (this)
+ });
+ if (includeReferencedProjects) {
+ foreach (var refProject in GetReferencedItems (configuration).OfType<Project> ().Where (p => p.SupportsBuild ())) {
+ if (!visited.Add (refProject))
+ continue;
+ // Recursively get all referenced projects. This is necessary if one of the referenced
+ // projects is using the local copy flag.
+ foreach (var rp in refProject.GetConfigurations (configuration, true, visited)) {
+ if (!configs.Any (pc => pc.ProjectFile == rp.ProjectFile))
+ configs.Add (rp);
+ }
+ }
+ }
+ return configs.ToArray ();
+ }
+
+ //for some reason, MD internally handles "AnyCPU" as "", but we need to be explicit when
+ //passing it to the build engine
+ static string GetExplicitPlatform (SolutionItemConfiguration configObject)
+ {
+ if (string.IsNullOrEmpty (configObject.Platform)) {
+ return "AnyCPU";
+ }
+ return configObject.Platform;
+ }
+
+ #region Project builder management
+
+ RemoteProjectBuilder projectBuilder;
+ string lastBuildToolsVersion;
+ string lastBuildRuntime;
+ string lastFileName;
+ string lastSlnFileName;
+ AsyncCriticalSection builderLock = new AsyncCriticalSection ();
+
+ internal async Task<RemoteProjectBuilder> GetProjectBuilder ()
+ {
+ //FIXME: we can't really have per-project runtimes, has to be per-solution
+ TargetRuntime runtime = null;
+ var ap = this as IAssemblyProject;
+ runtime = ap != null ? ap.TargetRuntime : Runtime.SystemAssemblyService.CurrentRuntime;
+
+ var sln = ParentSolution;
+ var slnFile = sln != null ? sln.FileName : null;
+
+ RemoteProjectBuilder result = null;
+
+ using (await builderLock.EnterAsync ()) {
+ bool refAdded = false;
+ if (projectBuilder == null || !(refAdded = projectBuilder.AddReference ()) || lastBuildToolsVersion != ToolsVersion || lastBuildRuntime != runtime.Id || lastFileName != FileName || lastSlnFileName != slnFile) {
+ if (projectBuilder != null && refAdded) {
+ projectBuilder.Shutdown ();
+ projectBuilder.ReleaseReference ();
+ }
+ var pb = await MSBuildProjectService.GetProjectBuilder (runtime, ToolsVersion, FileName, slnFile, 0);
+ pb.AddReference ();
+ pb.Disconnected += delegate {
+ CleanupProjectBuilder ();
+ };
+ projectBuilder = pb;
+ lastBuildToolsVersion = ToolsVersion;
+ lastBuildRuntime = runtime.Id;
+ lastFileName = FileName;
+ lastSlnFileName = slnFile;
+ }
+ if (modifiedInMemory) {
+ try {
+ modifiedInMemory = false;
+ await WriteProjectAsync (new ProgressMonitor ());
+ await projectBuilder.RefreshWithContent (sourceProject.SaveToString ());
+ } catch {
+ projectBuilder.ReleaseReference ();
+ throw;
+ }
+ }
+ result = projectBuilder;
+ }
+ return result;
+ }
+
+ RemoteProjectBuilder GetCachedProjectBuilder ()
+ {
+ var pb = projectBuilder;
+ if (pb != null && pb.AddReference ())
+ return pb;
+ return null;
+ }
+
+ async Task<RemoteProjectBuilder> RequestLockedBuilder ()
+ {
+ TargetRuntime runtime = null;
+ var ap = this as IAssemblyProject;
+ runtime = ap != null ? ap.TargetRuntime : Runtime.SystemAssemblyService.CurrentRuntime;
+
+ var sln = ParentSolution;
+ var slnFile = sln != null ? sln.FileName : null;
+
+ var pb = await MSBuildProjectService.GetProjectBuilder (runtime, ToolsVersion, FileName, slnFile, 0, true);
+ pb.AddReference ();
+ if (modifiedInMemory) {
+ try {
+ await WriteProjectAsync (new ProgressMonitor ());
+ await pb.RefreshWithContent (sourceProject.SaveToString ());
+ } catch {
+ pb.Dispose ();
+ throw;
+ }
+ }
+ return pb;
+ }
+
+ void CleanupProjectBuilder ()
+ {
+ var pb = GetCachedProjectBuilder ();
+ if (pb != null) {
+ pb.Shutdown ();
+ pb.ReleaseReference ();
+ }
+ }
+
+ public Task RefreshProjectBuilder ()
+ {
+ var pb = GetCachedProjectBuilder ();
+ if (pb != null)
+ return pb.Refresh ().ContinueWith (t => pb.ReleaseReference ());
+ return Task.FromResult (true);
+ }
+
+ public void ReloadProjectBuilder ()
+ {
+ CleanupProjectBuilder ();
+ }
+
+ #endregion
+
+ /// <summary>Whether to use the MSBuild engine for the specified item.</summary>
+ internal bool CheckUseMSBuildEngine (ConfigurationSelector sel, bool checkReferences = true)
+ {
+ // if the item mandates MSBuild, always use it
+ if (MSBuildEngineSupport.HasFlag (MSBuildSupport.Required))
+ return true;
+ // if the user has set the option, use the setting
+ if (UseMSBuildEngine.HasValue)
+ return UseMSBuildEngine.Value;
+
+ // If the item type defaults to using MSBuild, only use MSBuild if its direct references also use MSBuild.
+ // This prevents a not-uncommon common error referencing non-MSBuild projects from MSBuild projects
+ // NOTE: This adds about 11ms to the load/build/etc times of the MonoDevelop solution. Doing it recursively
+ // adds well over a second.
+ return MSBuildEngineSupport.HasFlag (MSBuildSupport.Supported) && (
+ !checkReferences || GetReferencedItems (sel).OfType<Project>().All (i => i.CheckUseMSBuildEngine (sel, false))
+ );
+ }
+
/// <summary>
/// Adds a file to the project
/// </summary>
@@ -509,24 +1396,31 @@ namespace MonoDevelop.Projects
//so in order to avoid doing them twice when using the msbuild engine, we special-case them
bool UsingMSBuildEngine (ConfigurationSelector sel)
{
- var msbuildHandler = ItemHandler as MonoDevelop.Projects.Formats.MSBuild.MSBuildProjectHandler;
- return msbuildHandler != null && msbuildHandler.UseMSBuildEngineForItem (this, sel);
+ return CheckUseMSBuildEngine (sel);
}
- protected override BuildResult OnBuild (IProgressMonitor monitor, ConfigurationSelector configuration)
+ protected override async Task<BuildResult> OnBuild (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
+ {
+ return (await RunTarget (monitor, "Build", configuration, new TargetEvaluationContext (operationContext))).BuildResult;
+ }
+
+ async Task<TargetEvaluationResult> RunBuildTarget (ProgressMonitor monitor, ConfigurationSelector configuration, TargetEvaluationContext context)
{
// create output directory, if not exists
ProjectConfiguration conf = GetConfiguration (configuration) as ProjectConfiguration;
if (conf == null) {
BuildResult cres = new BuildResult ();
cres.AddError (GettextCatalog.GetString ("Configuration '{0}' not found in project '{1}'", configuration.ToString (), Name));
- return cres;
+ return new TargetEvaluationResult (cres);
}
StringParserService.Properties["Project"] = Name;
if (UsingMSBuildEngine (configuration)) {
- return DoBuild (monitor, configuration);
+ var result = await RunMSBuildTarget (monitor, "Build", configuration, context);
+ if (!result.BuildResult.Failed)
+ SetFastBuildCheckClean (configuration);
+ return result;
}
string outputDir = conf.OutputDirectory;
@@ -544,7 +1438,7 @@ namespace MonoDevelop.Projects
monitor.Log.WriteLine ("Performing main compilation...");
- BuildResult res = DoBuild (monitor, configuration);
+ BuildResult res = await DoBuild (monitor, configuration);
if (res != null) {
string errorString = GettextCatalog.GetPluralString ("{0} error", "{0} errors", res.ErrorCount, res.ErrorCount);
@@ -553,9 +1447,39 @@ namespace MonoDevelop.Projects
monitor.Log.WriteLine (GettextCatalog.GetString ("Build complete -- ") + errorString + ", " + warningString);
}
- return res;
+ return new TargetEvaluationResult (res);
+ }
+
+ bool disableFastUpToDateCheck;
+
+ //the configuration of the last build that completed successfully
+ //null if any file in the project has since changed
+ string fastUpToDateCheckGoodConfig;
+
+ public bool FastCheckNeedsBuild (ConfigurationSelector configuration)
+ {
+ return ProjectExtension.OnFastCheckNeedsBuild (configuration);
+ }
+
+ protected virtual bool OnFastCheckNeedsBuild (ConfigurationSelector configuration)
+ {
+ if (disableFastUpToDateCheck || fastUpToDateCheckGoodConfig == null)
+ return true;
+ var cfg = GetConfiguration (configuration);
+ return cfg == null || cfg.Id != fastUpToDateCheckGoodConfig;
+ }
+
+ protected void SetFastBuildCheckDirty ()
+ {
+ fastUpToDateCheckGoodConfig = null;
}
+ void SetFastBuildCheckClean (ConfigurationSelector configuration)
+ {
+ var cfg = GetConfiguration (configuration);
+ fastUpToDateCheckGoodConfig = cfg != null ? cfg.Id : null;
+ }
+
/// <summary>
/// Copies the support files to the output directory
/// </summary>
@@ -569,7 +1493,7 @@ namespace MonoDevelop.Projects
/// Copies all support files to the output directory of the given configuration. Support files
/// include: assembly references with the Local Copy flag, data files with the Copy to Output option, etc.
/// </remarks>
- public void CopySupportFiles (IProgressMonitor monitor, ConfigurationSelector configuration)
+ public void CopySupportFiles (ProgressMonitor monitor, ConfigurationSelector configuration)
{
ProjectConfiguration config = (ProjectConfiguration) GetConfiguration (configuration);
@@ -620,7 +1544,7 @@ namespace MonoDevelop.Projects
/// Deletes all support files from the output directory of the given configuration. Support files
/// include: assembly references with the Local Copy flag, data files with the Copy to Output option, etc.
/// </remarks>
- public void DeleteSupportFiles (IProgressMonitor monitor, ConfigurationSelector configuration)
+ public async Task DeleteSupportFiles (ProgressMonitor monitor, ConfigurationSelector configuration)
{
ProjectConfiguration config = (ProjectConfiguration) GetConfiguration (configuration);
@@ -632,7 +1556,7 @@ namespace MonoDevelop.Projects
continue;
try {
- dest.Delete ();
+ await dest.DeleteAsync ();
} catch (IOException ex) {
monitor.ReportError (GettextCatalog.GetString ("Error deleting support file '{0}'.", dest), ex);
}
@@ -674,13 +1598,17 @@ namespace MonoDevelop.Projects
/// </remarks>
internal protected virtual void PopulateSupportFileList (FileCopySet list, ConfigurationSelector configuration)
{
+ ProjectExtension.OnPopulateSupportFileList (list, configuration);
+ }
+ void DoPopulateSupportFileList (FileCopySet list, ConfigurationSelector configuration)
+ {
foreach (ProjectFile pf in Files) {
if (pf.CopyToOutputDirectory == FileCopyMode.None)
continue;
list.Add (pf.FilePath, pf.CopyToOutputDirectory == FileCopyMode.PreserveNewest, pf.ProjectVirtualPath);
}
}
-
+
/// <summary>
/// Gets a list of files generated when building this project
/// </summary>
@@ -716,10 +1644,37 @@ namespace MonoDevelop.Projects
/// </remarks>
internal protected virtual void PopulateOutputFileList (List<FilePath> list, ConfigurationSelector configuration)
{
+ ProjectExtension.OnPopulateOutputFileList (list, configuration);
+ }
+ void DoPopulateOutputFileList (List<FilePath> list, ConfigurationSelector configuration)
+ {
string file = GetOutputFileName (configuration);
if (file != null)
list.Add (file);
- }
+ }
+
+ /// <summary>
+ /// Builds the project
+ /// </summary>
+ /// <param name="monitor">A progress monitor</param>
+ /// <param name="solutionConfiguration">Configuration to use to build the project</param>
+ /// <param name="operationContext">Context information.</param>
+ public Task<BuildResult> Build (ProgressMonitor monitor, ConfigurationSelector solutionConfiguration, ProjectOperationContext operationContext)
+ {
+ return base.Build (monitor, solutionConfiguration, false, operationContext);
+ }
+
+ /// <summary>
+ /// Builds the project
+ /// </summary>
+ /// <param name="monitor">A progress monitor</param>
+ /// <param name="solutionConfiguration">Configuration to use to build the project</param>
+ /// <param name="buildReferences">When set to <c>true</c>, the referenced items will be built before building this item.</param>
+ /// <param name="operationContext">Context information.</param>
+ public Task<BuildResult> Build (ProgressMonitor monitor, ConfigurationSelector solutionConfiguration, bool buildReferences, ProjectOperationContext operationContext)
+ {
+ return base.Build (monitor, solutionConfiguration, buildReferences, operationContext);
+ }
/// <summary>
/// Builds the project.
@@ -737,55 +1692,63 @@ namespace MonoDevelop.Projects
/// This method is invoked to build the project. Support files such as files with the Copy to Output flag will
/// be copied before calling this method.
/// </remarks>
- protected virtual BuildResult DoBuild (IProgressMonitor monitor, ConfigurationSelector configuration)
+ protected virtual Task<BuildResult> DoBuild (ProgressMonitor monitor, ConfigurationSelector configuration)
{
- BuildResult res = ItemHandler.RunTarget (monitor, "Build", configuration);
- return res ?? new BuildResult ();
+ return Task.FromResult (BuildResult.CreateSuccess ());
}
- protected override void OnClean (IProgressMonitor monitor, ConfigurationSelector configuration)
+ protected override async Task<BuildResult> OnClean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
+ {
+ return (await RunTarget (monitor, "Clean", configuration, new TargetEvaluationContext (operationContext))).BuildResult;
+ }
+
+ async Task<TargetEvaluationResult> RunCleanTarget (ProgressMonitor monitor, ConfigurationSelector configuration, TargetEvaluationContext context)
{
ProjectConfiguration config = GetConfiguration (configuration) as ProjectConfiguration;
if (config == null) {
monitor.ReportError (GettextCatalog.GetString ("Configuration '{0}' not found in project '{1}'", configuration, Name), null);
- return;
+ return new TargetEvaluationResult (BuildResult.CreateSuccess ());
}
if (UsingMSBuildEngine (configuration)) {
- DoClean (monitor, config.Selector);
- return;
+ return await RunMSBuildTarget (monitor, "Clean", configuration, context);
}
monitor.Log.WriteLine ("Removing output files...");
-
- // Delete generated files
- foreach (FilePath file in GetOutputFiles (configuration)) {
- if (File.Exists (file)) {
- file.Delete ();
- if (file.ParentDirectory.CanonicalPath != config.OutputDirectory.CanonicalPath && Directory.GetFiles (file.ParentDirectory).Length == 0)
- file.ParentDirectory.Delete ();
+
+ var filesToDelete = GetOutputFiles (configuration).ToArray ();
+
+ await Task.Run (delegate {
+ // Delete generated files
+ foreach (FilePath file in filesToDelete) {
+ if (File.Exists (file)) {
+ file.Delete ();
+ if (file.ParentDirectory.CanonicalPath != config.OutputDirectory.CanonicalPath && Directory.GetFiles (file.ParentDirectory).Length == 0)
+ file.ParentDirectory.Delete ();
+ }
}
- }
+ });
- DeleteSupportFiles (monitor, configuration);
+ await DeleteSupportFiles (monitor, configuration);
- DoClean (monitor, config.Selector);
+ var res = await DoClean (monitor, config.Selector);
monitor.Log.WriteLine (GettextCatalog.GetString ("Clean complete"));
+ return new TargetEvaluationResult (res);
}
- protected virtual void DoClean (IProgressMonitor monitor, ConfigurationSelector configuration)
+ protected virtual Task<BuildResult> DoClean (ProgressMonitor monitor, ConfigurationSelector configuration)
{
- ItemHandler.RunTarget (monitor, "Clean", configuration);
+ return Task.FromResult (BuildResult.CreateSuccess ());
}
- protected internal override void OnExecute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ protected async override Task OnExecute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
{
ProjectConfiguration config = GetConfiguration (configuration) as ProjectConfiguration;
if (config == null) {
monitor.ReportError (GettextCatalog.GetString ("Configuration '{0}' not found in project '{1}'", configuration, Name), null);
return;
}
- DoExecute (monitor, context, configuration);
+ await DoExecute (monitor, context, configuration);
}
/// <summary>
@@ -800,8 +1763,9 @@ namespace MonoDevelop.Projects
/// <param name='configuration'>
/// Configuration to execute.
/// </param>
- protected virtual void DoExecute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ protected virtual Task DoExecute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
{
+ return new Task (delegate {});
}
/// <summary>
@@ -813,16 +1777,28 @@ namespace MonoDevelop.Projects
/// <param name='configuration'>
/// Build configuration.
/// </param>
- public virtual FilePath GetOutputFileName (ConfigurationSelector configuration)
+ public FilePath GetOutputFileName (ConfigurationSelector configuration)
+ {
+ return ProjectExtension.OnGetOutputFileName (configuration);
+ }
+
+ protected virtual FilePath OnGetOutputFileName (ConfigurationSelector configuration)
{
return FilePath.Null;
}
- protected internal override bool OnGetNeedsBuilding (ConfigurationSelector configuration)
+ internal protected override bool OnGetNeedsBuilding (ConfigurationSelector configuration)
{
return CheckNeedsBuild (configuration);
}
+ protected override void OnSetNeedsBuilding (ConfigurationSelector configuration)
+ {
+ var of = GetOutputFileName (configuration);
+ if (File.Exists (of))
+ File.Delete (of);
+ }
+
/// <summary>
/// Checks if the project needs to be built
/// </summary>
@@ -849,7 +1825,7 @@ namespace MonoDevelop.Projects
}
}
- foreach (SolutionItem pref in GetReferencedItems (configuration)) {
+ foreach (SolutionFolderItem pref in GetReferencedItems (configuration)) {
if (pref.GetLastBuildTime (configuration) > tim)
return true;
}
@@ -877,6 +1853,16 @@ namespace MonoDevelop.Projects
return finfo.LastWriteTime;
}
+ void HandleFileChanged (object source, FileEventArgs e)
+ {
+ // File change events are fired asynchronously, so the project might already be
+ // disposed when the event is received.
+ if (Disposed)
+ return;
+
+ OnFileChanged (source, e);
+ }
+
internal virtual void OnFileChanged (object source, FileEventArgs e)
{
foreach (FileEventInfo fi in e) {
@@ -894,27 +1880,55 @@ namespace MonoDevelop.Projects
}
}
- protected internal override List<FilePath> OnGetItemFiles (bool includeReferencedFiles)
+ protected override IEnumerable<FilePath> OnGetItemFiles (bool includeReferencedFiles)
{
- List<FilePath> col = base.OnGetItemFiles (includeReferencedFiles);
+ var baseFiles = base.OnGetItemFiles (includeReferencedFiles);
+
if (includeReferencedFiles) {
+ List<FilePath> col = new List<FilePath> ();
foreach (ProjectFile pf in Files) {
if (pf.Subtype != Subtype.Directory)
col.Add (pf.FilePath);
}
+ baseFiles = baseFiles.Concat (col);
}
- return col;
+ return baseFiles;
+ }
+
+ internal void NotifyItemsAdded (IEnumerable<ProjectItem> objs)
+ {
+ ProjectExtension.OnItemsAdded (objs);
+ }
+
+ internal void NotifyItemsRemoved (IEnumerable<ProjectItem> objs)
+ {
+ ProjectExtension.OnItemsRemoved (objs);
}
- protected internal override void OnItemsAdded (IEnumerable<ProjectItem> objs)
+ protected virtual void OnItemsAdded (IEnumerable<ProjectItem> objs)
{
- base.OnItemsAdded (objs);
+ foreach (var it in objs) {
+ if (it.Project != null)
+ throw new InvalidOperationException (it.GetType ().Name + " already belongs to a project");
+ it.Project = this;
+ }
+
+ NotifyModified ("Items");
+ if (ProjectItemAdded != null)
+ ProjectItemAdded (this, new ProjectItemEventArgs (objs.Select (pi => new ProjectItemEventInfo (this, pi))));
+
NotifyFileAddedToProject (objs.OfType<ProjectFile> ());
}
- protected internal override void OnItemsRemoved (IEnumerable<ProjectItem> objs)
+ protected virtual void OnItemsRemoved (IEnumerable<ProjectItem> objs)
{
- base.OnItemsRemoved (objs);
+ foreach (var it in objs)
+ it.Project = null;
+
+ NotifyModified ("Items");
+ if (ProjectItemRemoved != null)
+ ProjectItemRemoved (this, new ProjectItemEventArgs (objs.Select (pi => new ProjectItemEventInfo (this, pi))));
+
NotifyFileRemovedFromProject (objs.OfType<ProjectFile> ());
}
@@ -941,7 +1955,6 @@ namespace MonoDevelop.Projects
var args = new ProjectFileEventArgs ();
foreach (ProjectFile file in objs) {
- file.SetProject (null);
args.Add (new ProjectFileEventInfo (this, file));
if (DependencyResolutionEnabled) {
unresolvedDeps.Remove (file);
@@ -965,9 +1978,6 @@ namespace MonoDevelop.Projects
var args = new ProjectFileEventArgs ();
foreach (ProjectFile file in objs) {
- if (file.Project != null)
- throw new InvalidOperationException ("ProjectFile already belongs to a project");
- file.SetProject (this);
args.Add (new ProjectFileEventInfo (this, file));
ResolveDependencies (file);
}
@@ -1024,6 +2034,805 @@ namespace MonoDevelop.Projects
}
}
+ IPropertySet mainGroupProperties;
+
+ void ReadProject (ProgressMonitor monitor, MSBuildProject msproject)
+ {
+ ProjectExtension.OnReadProjectHeader (monitor, msproject);
+ modifiedInMemory = false;
+ msbuildUpdatePending = false;
+ ProjectExtension.OnReadProject (monitor, msproject);
+ NeedsReload = false;
+ }
+
+ AsyncCriticalSection writeProjectLock = new AsyncCriticalSection ();
+
+ internal async Task WriteProjectAsync (ProgressMonitor monitor)
+ {
+ using (await writeProjectLock.EnterAsync ().ConfigureAwait (false)) {
+ await Task.Run (() => {
+ WriteProject (monitor);
+ }).ConfigureAwait (false);
+ }
+ }
+
+ void WriteProject (ProgressMonitor monitor)
+ {
+ if (saving) {
+ LoggingService.LogError ("WriteProject called while the project is already being written");
+ return;
+ }
+
+ saving = true;
+
+ try {
+ msbuildUpdatePending = false;
+ sourceProject.FileName = FileName;
+
+ OnWriteProjectHeader (monitor, sourceProject);
+ ProjectExtension.OnWriteProject (monitor, sourceProject);
+
+ var globalGroup = sourceProject.GetGlobalPropertyGroup ();
+ globalGroup.PurgeDefaultProperties ();
+ globalGroup.ResetIsNewFlags ();
+
+ if (sourceProject.IsNewProject) {
+ // If the project is new, the evaluated properties lists are empty. Now that the project is saved,
+ // those lists can be filled, so that the project is left in the same state it would have if it
+ // was just loaded.
+ sourceProject.Evaluate ();
+ InitMainGroupProperties (globalGroup);
+ foreach (ProjectConfiguration conf in Configurations)
+ InitConfiguration (conf);
+ }
+
+ sourceProject.IsNewProject = false;
+ } finally {
+ saving = false;
+ }
+ }
+
+ bool saving;
+
+ class ConfigData
+ {
+ public ConfigData (string conf, string plt, IMSBuildPropertySet grp)
+ {
+ Config = conf;
+ Platform = plt;
+ Group = grp;
+ }
+
+ public string Config;
+ public string Platform;
+ public IMSBuildPropertySet Group;
+ public bool Exists;
+ public bool IsNew; // The group did not exist in the original file
+ }
+
+ const string Unspecified = null;
+ ITimeTracker timer;
+
+ protected virtual void OnReadProjectHeader (ProgressMonitor monitor, MSBuildProject msproject)
+ {
+ timer = Counters.ReadMSBuildProject.BeginTiming ();
+
+ ToolsVersion = msproject.ToolsVersion;
+ if (string.IsNullOrEmpty (ToolsVersion))
+ ToolsVersion = "2.0";
+
+ productVersion = msproject.EvaluatedProperties.GetValue ("ProductVersion");
+ schemaVersion = msproject.EvaluatedProperties.GetValue ("SchemaVersion");
+
+ // Get the project ID
+
+ string itemGuid = msproject.EvaluatedProperties.GetValue ("ProjectGuid");
+ if (itemGuid == null)
+ throw new UserException ("Project file doesn't have a valid ProjectGuid");
+
+ // Workaround for a VS issue. VS doesn't include the curly braces in the ProjectGuid
+ // of shared projects.
+ if (!itemGuid.StartsWith ("{", StringComparison.Ordinal))
+ itemGuid = "{" + itemGuid + "}";
+
+ ItemId = itemGuid.ToUpper ();
+
+ // Get the project GUIDs
+
+ string projectTypeGuids = msproject.EvaluatedProperties.GetValue ("ProjectTypeGuids");
+
+ var subtypeGuids = new List<string> ();
+ if (projectTypeGuids != null) {
+ foreach (string guid in projectTypeGuids.Split (';')) {
+ string sguid = guid.Trim ();
+ if (sguid.Length > 0 && string.Compare (sguid, TypeGuid, StringComparison.OrdinalIgnoreCase) != 0)
+ subtypeGuids.Add (guid);
+ }
+ }
+ flavorGuids = subtypeGuids.ToArray ();
+
+ if (!CheckAllFlavorsSupported ()) {
+ var guids = new [] { TypeGuid };
+ var projectInfo = MSBuildProjectService.GetUnknownProjectTypeInfo (guids.Concat (flavorGuids).ToArray (), FileName);
+ IsUnsupportedProject = true;
+ if (projectInfo != null)
+ UnsupportedProjectMessage = projectInfo.GetInstructions ();
+ }
+
+ // Common properties
+
+ Description = msproject.EvaluatedProperties.GetValue ("Description", "");
+ baseIntermediateOutputPath = msproject.EvaluatedProperties.GetPathValue ("BaseIntermediateOutputPath", defaultValue:BaseDirectory.Combine ("obj"), relativeToProject:true);
+ disableFastUpToDateCheck = msproject.EvaluatedProperties.GetValue ("DisableFastUpToDateCheck", false);
+
+ msproject.EvaluatedProperties.ReadObjectProperties (this, GetType (), true);
+
+ RemoveDuplicateItems (msproject);
+ }
+
+ protected virtual void OnReadProject (ProgressMonitor monitor, MSBuildProject msproject)
+ {
+ timer.Trace ("Read project items");
+ LoadProjectItems (msproject, ProjectItemFlags.None, usedMSBuildItems);
+
+ timer.Trace ("Read configurations");
+
+ List<ConfigData> configData = GetConfigData (msproject, true);
+
+ foreach (var cgrp in configData)
+ LoadConfiguration (monitor, cgrp, cgrp.Config, cgrp.Platform);
+
+ // Read extended properties
+
+ timer.Trace ("Read extended properties");
+
+ msproject.ReadExternalProjectProperties (this, GetType (), true);
+
+ // Read available item types
+
+ loadedAvailableItemNames = msproject.EvaluatedItems.Where (i => i.Name == "AvailableItemName").Select (i => i.Include).ToArray ();
+ }
+
+ List<ConfigData> GetConfigData (MSBuildProject msproject, bool includeEvaluated)
+ {
+ List<ConfigData> configData = new List<ConfigData> ();
+ foreach (MSBuildPropertyGroup cgrp in msproject.PropertyGroups) {
+ string conf, platform;
+ if (ParseConfigCondition (cgrp.Condition, out conf, out platform) && conf != null && platform != null) {
+ // If a group for this configuration already was found, set the new group. If there are changes we want to modify the last group.
+ var existing = configData.FirstOrDefault (cd => cd.Config == conf && cd.Platform == platform);
+ if (existing == null)
+ configData.Add (new ConfigData (conf, platform, cgrp));
+ else
+ existing.Group = cgrp;
+ }
+ }
+ if (includeEvaluated) {
+ var confValues = msproject.ConditionedProperties.GetCombinedPropertyValues ("Configuration");
+ var platValues = msproject.ConditionedProperties.GetCombinedPropertyValues ("Platform");
+ var confPlatValues = msproject.ConditionedProperties.GetCombinedPropertyValues ("Configuration", "Platform");
+
+ // First of all, add configurations that have been specified using both the Configuration and Platform properties.
+ foreach (var co in confPlatValues) {
+ var c = co.GetValue ("Configuration");
+ var ep = co.GetValue ("Platform");
+ ep = ep == "AnyCPU" ? "" : ep;
+ if (!configData.Any (cd => cd.Config == c && cd.Platform == ep))
+ configData.Add (new ConfigData (c, ep, null));
+ }
+
+ // Now add configurations for which a platform has not been specified, but only if no other configuration
+ // exists with the same name. Combine them with individually specified platforms, if available
+ foreach (var c in confValues.Select (v => v.GetValue ("Configuration"))) {
+ if (platValues.Count > 0) {
+ foreach (var plat in platValues.Select (v => v.GetValue ("Platform"))) {
+ var ep = plat == "AnyCPU" ? "" : plat;
+ if (!configData.Any (cd => cd.Config == c && cd.Platform == ep))
+ configData.Add (new ConfigData (c, ep, null));
+ }
+ } else {
+ if (!configData.Any (cd => cd.Config == c))
+ configData.Add (new ConfigData (c, "", null));
+ }
+ }
+ }
+
+ return configData;
+ }
+
+ bool ParseConfigCondition (string cond, out string config, out string platform)
+ {
+ config = platform = Unspecified;
+ int i = cond.IndexOf ("==", StringComparison.Ordinal);
+ if (i == -1)
+ return false;
+ if (cond.Substring (0, i).Trim () == "'$(Configuration)|$(Platform)'") {
+ if (!ExtractConfigName (cond.Substring (i + 2), out cond))
+ return false;
+ i = cond.IndexOf ('|');
+ if (i != -1) {
+ config = cond.Substring (0, i);
+ platform = cond.Substring (i+1);
+ } else {
+ // Invalid configuration
+ return false;
+ }
+ if (platform == "AnyCPU")
+ platform = string.Empty;
+ return true;
+ }
+ else if (cond.Substring (0, i).Trim () == "'$(Configuration)'") {
+ if (!ExtractConfigName (cond.Substring (i + 2), out config))
+ return false;
+ platform = Unspecified;
+ return true;
+ }
+ else if (cond.Substring (0, i).Trim () == "'$(Platform)'") {
+ config = Unspecified;
+ if (!ExtractConfigName (cond.Substring (i + 2), out platform))
+ return false;
+ if (platform == "AnyCPU")
+ platform = string.Empty;
+ return true;
+ }
+ return false;
+ }
+
+ bool ExtractConfigName (string name, out string config)
+ {
+ config = name.Trim (' ');
+ if (config.Length <= 2)
+ return false;
+ if (config [0] != '\'' || config [config.Length - 1] != '\'')
+ return false;
+ config = config.Substring (1, config.Length - 2);
+ return config.IndexOf ('\'') == -1;
+ }
+
+ void LoadConfiguration (ProgressMonitor monitor, ConfigData cgrp, string conf, string platform)
+ {
+ ProjectConfiguration config = (ProjectConfiguration) CreateConfiguration (conf + "|" + (platform != "AnyCPU" ? platform : ""));
+ if (cgrp.Group != null)
+ config.MainPropertyGroup = (MSBuildPropertyGroup) cgrp.Group;
+ config.MainPropertyGroup.ResetIsNewFlags ();
+ InitConfiguration (config);
+ projectExtension.OnReadConfiguration (monitor, config, config.Properties);
+ Configurations.Add (config);
+ }
+
+ MSBuildProjectInstance CreateProjectInstaceForConfiguration (string conf, string platform, bool onlyEvaluateProperties = true)
+ {
+ var pi = PrepareProjectInstaceForConfiguration (conf, platform, onlyEvaluateProperties);
+ pi.Evaluate ();
+ return pi;
+ }
+
+ async Task<MSBuildProjectInstance> CreateProjectInstaceForConfigurationAsync (string conf, string platform, bool onlyEvaluateProperties = true)
+ {
+ var pi = PrepareProjectInstaceForConfiguration (conf, platform, onlyEvaluateProperties);
+ await pi.EvaluateAsync ();
+ return pi;
+ }
+
+ MSBuildProjectInstance PrepareProjectInstaceForConfiguration (string conf, string platform, bool onlyEvaluateProperties)
+ {
+ var pi = sourceProject.CreateInstance ();
+ pi.SetGlobalProperty ("BuildingInsideVisualStudio", "true");
+ if (conf != null)
+ pi.SetGlobalProperty ("Configuration", conf);
+ if (platform != null) {
+ if (platform == string.Empty)
+ pi.SetGlobalProperty ("Platform", "AnyCPU");
+ else
+ pi.SetGlobalProperty ("Platform", platform);
+ }
+ pi.OnlyEvaluateProperties = onlyEvaluateProperties;
+ return pi;
+ }
+
+ protected virtual void OnReadConfiguration (ProgressMonitor monitor, ProjectConfiguration config, IPropertySet grp)
+ {
+ config.Read (grp);
+ }
+
+ void RemoveDuplicateItems (MSBuildProject msproject)
+ {
+/* timer.Trace ("Checking for duplicate items");
+
+ var uniqueIncludes = new Dictionary<string,object> ();
+ var toRemove = new List<MSBuildItem> ();
+ foreach (MSBuildItem bi in msproject.GetAllItems ()) {
+ object existing;
+ string key = bi.Name + "<" + bi.Include;
+ if (!uniqueIncludes.TryGetValue (key, out existing)) {
+ uniqueIncludes[key] = bi;
+ continue;
+ }
+ var exBi = existing as MSBuildItem;
+ if (exBi != null) {
+ if (exBi.Condition != bi.Condition || exBi.Element.InnerXml != bi.Element.InnerXml) {
+ uniqueIncludes[key] = new List<MSBuildItem> { exBi, bi };
+ } else {
+ toRemove.Add (bi);
+ }
+ continue;
+ }
+
+ var exList = (List<MSBuildItem>)existing;
+ bool found = false;
+ foreach (var m in (exList)) {
+ if (m.Condition == bi.Condition && m.Element.InnerXml == bi.Element.InnerXml) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ exList.Add (bi);
+ } else {
+ toRemove.Add (bi);
+ }
+ }
+ if (toRemove.Count == 0)
+ return;
+
+ timer.Trace ("Removing duplicate items");
+
+ foreach (var t in toRemove)
+ msproject.RemoveItem (t);*/
+ }
+
+ internal void LoadProjectItems (MSBuildProject msproject, ProjectItemFlags flags, HashSet<MSBuildItem> loadedItems)
+ {
+ if (loadedItems != null)
+ loadedItems.Clear ();
+
+ foreach (var buildItem in msproject.EvaluatedItemsIgnoringCondition) {
+ if (buildItem.IsImported)
+ continue;
+ if (BuildAction.ReserverIdeActions.Contains (buildItem.Name))
+ continue;
+ ProjectItem it = ReadItem (buildItem);
+ if (it == null)
+ continue;
+ it.Flags = flags;
+ Items.Add (it);
+ if (loadedItems != null)
+ loadedItems.Add (buildItem.SourceItem);
+ }
+ }
+
+ protected override void OnSetFormat (MSBuildFileFormat format)
+ {
+ base.OnSetFormat (format);
+ InitFormatProperties ();
+ }
+
+ void InitFormatProperties ()
+ {
+ ToolsVersion = FileFormat.DefaultToolsVersion;
+ schemaVersion = FileFormat.DefaultSchemaVersion;
+
+ // Don't change the product version if it is already set. We don't really use this,
+ // and we can avoid unnecessary changes in the proj file.
+ if (string.IsNullOrEmpty (productVersion))
+ productVersion = FileFormat.DefaultProductVersion;
+ }
+
+ internal ProjectItem ReadItem (IMSBuildItemEvaluated buildItem)
+ {
+ var item = CreateProjectItem (buildItem);
+ item.Read (this, buildItem);
+ item.BackingItem = buildItem.SourceItem;
+ item.BackingEvalItem = buildItem;
+ return item;
+ }
+
+ struct MergedPropertyValue
+ {
+ public readonly string XmlValue;
+ public readonly MSBuildValueType ValueType;
+ public readonly bool IsDefault;
+
+ public MergedPropertyValue (string xmlValue, MSBuildValueType valueType, bool isDefault)
+ {
+ this.XmlValue = xmlValue;
+ this.ValueType = valueType;
+ this.IsDefault = isDefault;
+ }
+ }
+
+ protected virtual void OnWriteProjectHeader (ProgressMonitor monitor, MSBuildProject msproject)
+ {
+ if (string.IsNullOrEmpty (sourceProject.DefaultTargets) && SupportsBuild ())
+ sourceProject.DefaultTargets = "Build";
+
+ IMSBuildPropertySet globalGroup = msproject.GetGlobalPropertyGroup ();
+ if (globalGroup == null)
+ globalGroup = msproject.AddNewPropertyGroup (false);
+
+ if (Configurations.Count > 0) {
+ // Set the default configuration of the project.
+ // First of all get the properties that define the default configuration and platform
+ var defaultConfProp = globalGroup.GetProperties ().FirstOrDefault (p => p.Name == "Configuration" && IsDefaultSetter (p));
+ var defaultPlatProp = globalGroup.GetProperties ().FirstOrDefault (p => p.Name == "Platform" && IsDefaultSetter (p));
+
+ if (msproject.IsNewProject || (defaultConfProp != null && defaultPlatProp != null)) {
+ // If there is no config property, or if the config doesn't exist anymore, give it a new value
+ if (defaultConfProp == null || !Configurations.Any<SolutionItemConfiguration> (c => c.Name == defaultConfProp.UnevaluatedValue)) {
+ ItemConfiguration conf = Configurations.FirstOrDefault<ItemConfiguration> (c => c.Name == "Debug");
+ if (conf == null) conf = Configurations [0];
+ string platform = conf.Platform.Length == 0 ? "AnyCPU" : conf.Platform;
+ globalGroup.SetValue ("Configuration", conf.Name, condition: " '$(Configuration)' == '' ");
+ globalGroup.SetValue ("Platform", platform, condition: " '$(Platform)' == '' ");
+ } else if (defaultPlatProp == null || !Configurations.Any<SolutionItemConfiguration> (c => c.Name == defaultConfProp.UnevaluatedValue && c.Platform == defaultPlatProp.UnevaluatedValue)) {
+ ItemConfiguration conf = Configurations.FirstOrDefault<ItemConfiguration> (c => c.Name == defaultConfProp.UnevaluatedValue);
+ string platform = conf.Platform.Length == 0 ? "AnyCPU" : conf.Platform;
+ globalGroup.SetValue ("Platform", platform, condition: " '$(Platform)' == '' ");
+ }
+ }
+ }
+
+ if (TypeGuid == MSBuildProjectService.GenericItemGuid) {
+ DataType dt = MSBuildProjectService.DataContext.GetConfigurationDataType (GetType ());
+ globalGroup.SetValue ("ItemType", dt.Name);
+ }
+
+ globalGroup.SetValue ("ProductVersion", productVersion);
+ globalGroup.SetValue ("SchemaVersion", schemaVersion);
+
+ globalGroup.SetValue ("ProjectGuid", ItemId, valueType:MSBuildValueType.Guid);
+
+ if (flavorGuids.Length > 0) {
+ string gg = string.Join (";", flavorGuids);
+ gg += ";" + TypeGuid;
+ globalGroup.SetValue ("ProjectTypeGuids", gg.ToUpper (), preserveExistingCase:true);
+ } else if (!string.Equals (globalGroup.GetValue ("ProjectTypeGuids"), TypeGuid, StringComparison.OrdinalIgnoreCase)) {
+ // Keep the property if it already was there with the same value, remove otherwise
+ globalGroup.RemoveProperty ("ProjectTypeGuids");
+ }
+
+ // having no ToolsVersion is equivalent to 2.0, roundtrip that correctly
+ if (ToolsVersion != "2.0")
+ msproject.ToolsVersion = ToolsVersion;
+ else if (string.IsNullOrEmpty (msproject.ToolsVersion))
+ msproject.ToolsVersion = null;
+ else
+ msproject.ToolsVersion = "2.0";
+
+ msproject.GetGlobalPropertyGroup ().SetValue ("Description", Description, "");
+ msproject.GetGlobalPropertyGroup ().SetValue ("BaseIntermediateOutputPath", BaseIntermediateOutputPath, defaultValue:BaseDirectory.Combine ("obj"), relativeToProject:true);
+ msproject.GetGlobalPropertyGroup ().SetValue ("DisableFastUpToDateCheck", disableFastUpToDateCheck, false);
+
+ globalGroup.WriteObjectProperties (this, GetType (), true);
+ }
+
+ protected virtual void OnWriteProject (ProgressMonitor monitor, MSBuildProject msproject)
+ {
+ IMSBuildPropertySet globalGroup = msproject.GetGlobalPropertyGroup ();
+
+ // Configurations
+
+ if (Configurations.Count > 0) {
+
+ List<ConfigData> configData = GetConfigData (msproject, false);
+
+ // Write configuration data, creating new property groups if necessary
+
+ foreach (ProjectConfiguration conf in Configurations) {
+
+ MSBuildPropertyGroup pg = conf.MainPropertyGroup;
+ ConfigData cdata = configData.FirstOrDefault (cd => cd.Group == pg);
+
+ if (cdata == null) {
+ // Try to keep the groups in the same order as the config list
+ MSBuildObject nextConf = null;
+ int i = Configurations.IndexOf (conf);
+ if (i != -1 && i + 1 < Configurations.Count)
+ nextConf = ((ProjectConfiguration)Configurations [i + 1]).MainPropertyGroup;
+
+ msproject.AddPropertyGroup (pg, true, nextConf);
+ pg.Condition = BuildConfigCondition (conf.Name, conf.Platform);
+ cdata = new ConfigData (conf.Name, conf.Platform, pg);
+ cdata.IsNew = true;
+ configData.Add (cdata);
+ } else {
+ // The configuration name may have changed
+ if (cdata.Config != conf.Name || cdata.Platform != conf.Platform) {
+ ((MSBuildPropertyGroup)cdata.Group).Condition = BuildConfigCondition (conf.Name, conf.Platform);
+ cdata.Config = conf.Name;
+ cdata.Platform = conf.Platform;
+ }
+ }
+
+ cdata.Exists = true;
+ ProjectExtension.OnWriteConfiguration (monitor, conf, conf.Properties);
+ }
+
+ // Find the properties in all configurations that have the MergeToProject flag set
+ var mergeToProjectProperties = new HashSet<MergedProperty> (GetMergeToProjectProperties (configData));
+ var mergeToProjectPropertyValues = new Dictionary<string, MergedPropertyValue> ();
+
+ foreach (ProjectConfiguration conf in Configurations) {
+ ConfigData cdata = FindPropertyGroup (configData, conf);
+ var propGroup = (MSBuildPropertyGroup)cdata.Group;
+
+ // Get properties wit the MergeToProject flag, and check that the value they have matches the
+ // value all the other groups have so far. If one of the groups have a different value for
+ // the same property, then the property is discarded as mergeable to parent.
+ CollectMergetoprojectProperties (propGroup, mergeToProjectProperties, mergeToProjectPropertyValues);
+
+ // Remove properties that have been modified and have the default value. Usually such properties
+ // would be removed when assigning the value, but we set IgnoreDefaultValues=false so that
+ // we can collect MergeToProject properties, so in this case properties are not removed.
+ propGroup.PurgeDefaultProperties ();
+ }
+
+ // Move properties with common values from configurations to the main
+ // property group
+ foreach (KeyValuePair<string, MergedPropertyValue> prop in mergeToProjectPropertyValues) {
+ if (!prop.Value.IsDefault)
+ globalGroup.SetValue (prop.Key, prop.Value.XmlValue, valueType: prop.Value.ValueType);
+ else {
+ // if the value is default, only remove the property if it was not already the default to avoid unnecessary project file churn
+ globalGroup.SetValue (prop.Key, prop.Value.XmlValue, defaultValue: prop.Value.XmlValue, valueType: prop.Value.ValueType);
+ }
+ }
+ foreach (SolutionItemConfiguration conf in Configurations) {
+ var propGroup = FindPropertyGroup (configData, conf).Group;
+ foreach (string mp in mergeToProjectPropertyValues.Keys)
+ propGroup.RemoveProperty (mp);
+ }
+
+ // Remove groups corresponding to configurations that have been removed
+ // or groups which don't have any property and did not already exist
+ foreach (ConfigData cd in configData) {
+ if (!cd.Exists || (cd.IsNew && !cd.Group.GetProperties ().Any ()))
+ msproject.Remove ((MSBuildPropertyGroup)cd.Group);
+ }
+
+ foreach (ProjectConfiguration config in Configurations)
+ config.MainPropertyGroup.ResetIsNewFlags ();
+ }
+
+ SaveProjectItems (monitor, msproject, usedMSBuildItems);
+
+ if (msproject.IsNewProject) {
+ foreach (var im in DefaultImports)
+ msproject.AddNewImport (im);
+ }
+
+ foreach (var im in importsAdded) {
+ if (msproject.GetImport (im.Name, im.Condition) == null)
+ msproject.AddNewImport (im.Name, im.Condition);
+ }
+ foreach (var im in importsRemoved) {
+ var i = msproject.GetImport (im.Name, im.Condition);
+ if (i != null)
+ msproject.RemoveImport (i);
+ }
+ importsAdded.Clear ();
+ importsRemoved.Clear ();
+ msproject.WriteExternalProjectProperties (this, GetType (), true);
+ }
+
+ protected virtual void OnWriteConfiguration (ProgressMonitor monitor, ProjectConfiguration config, IPropertySet pset)
+ {
+ config.Write (pset);
+ }
+
+ IEnumerable<MergedProperty> GetMergeToProjectProperties (List<ConfigData> configData)
+ {
+ Dictionary<string,MergedProperty> mergeProps = new Dictionary<string, MergedProperty> ();
+ foreach (var cd in configData) {
+ foreach (var prop in cd.Group.GetProperties ()) {
+ if (!prop.MergeToMainGroup) {
+ mergeProps [prop.Name] = null;
+ } else if (!mergeProps.ContainsKey (prop.Name))
+ mergeProps [prop.Name] = prop.CreateMergedProperty ();
+ }
+ }
+ return mergeProps.Values.Where (p => p != null);
+ }
+
+ void CollectMergetoprojectProperties (IMSBuildPropertySet pgroup, HashSet<MergedProperty> properties, Dictionary<string,MergedPropertyValue> mergeToProjectProperties)
+ {
+ // This method checks every property in pgroup which has the MergeToProject flag.
+ // If the value of this property is the same as the one stored in mergeToProjectProperties
+ // it means that the property can be merged to the main project property group (so far).
+
+ foreach (var pinfo in new List<MergedProperty> (properties)) {
+ MSBuildProperty prop = pgroup.GetProperty (pinfo.Name);
+
+ MergedPropertyValue mvalue;
+ if (!mergeToProjectProperties.TryGetValue (pinfo.Name, out mvalue)) {
+ if (prop != null) {
+ // This is the first time the value is checked. Just assign it.
+ mergeToProjectProperties.Add (pinfo.Name, new MergedPropertyValue (prop.Value, pinfo.ValueType, pinfo.IsDefault));
+ continue;
+ }
+ // If there is no value, it can't be merged
+ }
+ else if (prop != null && mvalue.ValueType.Equals (prop.Value, mvalue.XmlValue))
+ // Same value. It can be merged.
+ continue;
+
+ // The property can't be merged because different configurations have different
+ // values for it. Remove it from the list.
+ properties.Remove (pinfo);
+ mergeToProjectProperties.Remove (pinfo.Name);
+ }
+ }
+
+ bool IsDefaultSetter (MSBuildProperty prop)
+ {
+ var val = prop.Condition;
+ int i = val.IndexOf ("==");
+ if (i == -1)
+ return false;
+ return val.Substring (0, i).Trim () == "'$(" + prop.Name + ")'" && val.Substring (i + 2).Trim () == "''";
+ }
+
+ class ExpandedItemList: List<ExpandedItemInfo>
+ {
+ public bool Modified { get; set; }
+ }
+
+ class ExpandedItemInfo
+ {
+ public ProjectItem ProjectItem;
+ public MSBuildItem MSBuildItem;
+ }
+
+ HashSet<MSBuildItem> usedMSBuildItems = new HashSet<MSBuildItem> ();
+
+ internal virtual void SaveProjectItems (ProgressMonitor monitor, MSBuildProject msproject, HashSet<MSBuildItem> loadedItems, string pathPrefix = null)
+ {
+ HashSet<MSBuildItem> unusedItems = new HashSet<MSBuildItem> (loadedItems);
+ Dictionary<MSBuildItem,ExpandedItemList> expandedItems = new Dictionary<MSBuildItem, ExpandedItemList> ();
+
+ // Add the new items
+
+ foreach (ProjectItem ob in Items.Where (it => !it.Flags.HasFlag (ProjectItemFlags.DontPersist)))
+ SaveProjectItem (monitor, msproject, ob, expandedItems, unusedItems, loadedItems, pathPrefix);
+
+ // Process items generated from wildcards
+
+ foreach (var itemInfo in expandedItems) {
+ if (itemInfo.Value.Modified || msproject.EvaluatedItemsIgnoringCondition.Where (i => i.SourceItem == itemInfo.Key).Count () != itemInfo.Value.Count) {
+ // Expand the list
+ unusedItems.Add (itemInfo.Key);
+ foreach (var it in itemInfo.Value) {
+ it.ProjectItem.BackingItem = it.MSBuildItem;
+ msproject.AddItem (it.MSBuildItem);
+ }
+ }
+ }
+
+ // Remove unused items
+
+ foreach (var it in unusedItems) {
+ if (it.ParentGroup != null) // It may already have been deleted
+ msproject.RemoveItem (it);
+ loadedItems.Remove (it);
+ }
+ }
+
+ void SaveProjectItem (ProgressMonitor monitor, MSBuildProject msproject, ProjectItem item, Dictionary<MSBuildItem,ExpandedItemList> expandedItems, HashSet<MSBuildItem> unusedItems, HashSet<MSBuildItem> loadedItems, string pathPrefix = null)
+ {
+ if (item.IsFromWildcardItem) {
+ // Store the item in the list of expanded items
+ ExpandedItemList items;
+ if (!expandedItems.TryGetValue (item.BackingItem, out items))
+ items = expandedItems [item.BackingItem] = new ExpandedItemList ();
+
+ // We need to check if the item has changed, in which case all the items included by the wildcard
+ // must be individually included
+ var bitem = msproject.CreateItem (item.ItemName, GetPrefixedInclude (pathPrefix, item.Include));
+ item.Write (this, bitem);
+ items.Add (new ExpandedItemInfo {
+ ProjectItem = item,
+ MSBuildItem = bitem
+ });
+
+ unusedItems.Remove (item.BackingItem);
+
+ if (!items.Modified && (item.Metadata.PropertyCountHasChanged || !ItemsAreEqual (bitem, item.BackingEvalItem)))
+ items.Modified = true;
+ return;
+ }
+
+ var include = GetPrefixedInclude (pathPrefix, item.UnevaluatedInclude ?? item.Include);
+
+ MSBuildItem buildItem;
+ if (item.BackingItem != null && item.BackingItem.Name == item.ItemName) {
+ buildItem = item.BackingItem;
+ } else {
+ buildItem = msproject.AddNewItem (item.ItemName, include);
+ item.BackingItem = buildItem;
+ item.BackingEvalItem = null;
+ }
+
+ loadedItems.Add (buildItem);
+ unusedItems.Remove (buildItem);
+
+ item.Write (this, buildItem);
+ if (buildItem.Include != include)
+ buildItem.Include = include;
+ }
+
+ bool ItemsAreEqual (MSBuildItem item, IMSBuildItemEvaluated evalItem)
+ {
+ // Compare only metadata, since item name and include can't change
+
+ var n = 0;
+ foreach (var p in item.Metadata.GetProperties ()) {
+ var p2 = evalItem.Metadata.GetProperty (p.Name);
+ if (p2 == null)
+ return false;
+ if (!p.ValueType.Equals (p.Value, p2.UnevaluatedValue))
+ return false;
+ n++;
+ }
+ if (evalItem.SourceItem.Metadata.GetProperties ().Count () != n)
+ return false;
+ return true;
+ }
+
+ string GetPrefixedInclude (string pathPrefix, string include)
+ {
+ if (pathPrefix != null && !include.StartsWith (pathPrefix))
+ return pathPrefix + include;
+ else
+ return include;
+ }
+
+ ConfigData FindPropertyGroup (List<ConfigData> configData, SolutionItemConfiguration config)
+ {
+ foreach (ConfigData data in configData) {
+ if (data.Config == config.Name && data.Platform == config.Platform)
+ return data;
+ }
+ return null;
+ }
+
+ string BuildConfigCondition (string config, string platform)
+ {
+ if (platform.Length == 0)
+ platform = "AnyCPU";
+ return " '$(Configuration)|$(Platform)' == '" + config + "|" + platform + "' ";
+ }
+
+ bool IsMergeToProjectProperty (ItemProperty prop)
+ {
+ foreach (object at in prop.CustomAttributes) {
+ if (at is MergeToProjectAttribute)
+ return true;
+ }
+ return false;
+ }
+
+ public void AddImportIfMissing (string name, string condition)
+ {
+ importsAdded.Add (new DotNetProjectImport (name, condition));
+ }
+
+ public void RemoveImport (string name)
+ {
+ importsRemoved.Add (new DotNetProjectImport (name));
+ }
+
+ List <DotNetProjectImport> importsAdded = new List<DotNetProjectImport> ();
+
+ internal IList<DotNetProjectImport> ImportsAdded {
+ get { return importsAdded; }
+ }
+
+ List <DotNetProjectImport> importsRemoved = new List<DotNetProjectImport> ();
+
+ internal IList<DotNetProjectImport> ImportsRemoved {
+ get { return importsRemoved; }
+ }
+
internal void NotifyFileRenamedInProject (ProjectFileRenamedEventArgs args)
{
NotifyModified ("Files");
@@ -1035,6 +2844,10 @@ namespace MonoDevelop.Projects
/// </summary>
protected virtual void OnFileRemovedFromProject (ProjectFileEventArgs e)
{
+ ProjectExtension.OnFileRemovedFromProject (e);
+ }
+ void DoOnFileRemovedFromProject (ProjectFileEventArgs e)
+ {
buildActions = null;
if (FileRemovedFromProject != null) {
FileRemovedFromProject (this, e);
@@ -1046,43 +2859,63 @@ namespace MonoDevelop.Projects
/// </summary>
protected virtual void OnFileAddedToProject (ProjectFileEventArgs e)
{
+ ProjectExtension.OnFileAddedToProject (e);
+ }
+ void DoOnFileAddedToProject (ProjectFileEventArgs e)
+ {
buildActions = null;
if (FileAddedToProject != null) {
FileAddedToProject (this, e);
}
}
-
+
/// <summary>
/// Raises the FileChangedInProject event.
/// </summary>
protected virtual void OnFileChangedInProject (ProjectFileEventArgs e)
{
+ ProjectExtension.OnFileChangedInProject (e);
+ }
+ void DoOnFileChangedInProject (ProjectFileEventArgs e)
+ {
if (FileChangedInProject != null) {
FileChangedInProject (this, e);
}
}
-
+
/// <summary>
/// Raises the FilePropertyChangedInProject event.
/// </summary>
protected virtual void OnFilePropertyChangedInProject (ProjectFileEventArgs e)
{
+ ProjectExtension.OnFilePropertyChangedInProject (e);
+ }
+ void DoOnFilePropertyChangedInProject (ProjectFileEventArgs e)
+ {
buildActions = null;
if (FilePropertyChangedInProject != null) {
FilePropertyChangedInProject (this, e);
}
}
-
+
/// <summary>
/// Raises the FileRenamedInProject event.
/// </summary>
protected virtual void OnFileRenamedInProject (ProjectFileRenamedEventArgs e)
{
+ ProjectExtension.OnFileRenamedInProject (e);
+ }
+ void DoOnFileRenamedInProject (ProjectFileRenamedEventArgs e)
+ {
if (FileRenamedInProject != null) {
FileRenamedInProject (this, e);
}
}
+ public event EventHandler<ProjectItemEventArgs> ProjectItemAdded;
+
+ public event EventHandler<ProjectItemEventArgs> ProjectItemRemoved;
+
/// <summary>
/// Occurs when a file is removed from this project.
/// </summary>
@@ -1107,6 +2940,161 @@ namespace MonoDevelop.Projects
/// Occurs when a file of this project has been renamed
/// </summary>
public event ProjectFileRenamedEventHandler FileRenamedInProject;
+
+
+ class DefaultMSBuildProjectExtension: ProjectExtension
+ {
+ internal protected override bool SupportsFlavor (string guid)
+ {
+ return false;
+ }
+
+ internal protected override bool OnGetIsCompileable (string fileName)
+ {
+ return Project.OnGetIsCompileable (fileName);
+ }
+
+ internal protected override bool OnGetIsCompileBuildAction (string buildAction)
+ {
+ return Project.OnGetIsCompileBuildAction (buildAction);
+ }
+
+ internal protected override void OnGetTypeTags (HashSet<string> types)
+ {
+ Project.OnGetTypeTags (types);
+ }
+
+ internal protected override Task<TargetEvaluationResult> OnRunTarget (ProgressMonitor monitor, string target, ConfigurationSelector configuration, TargetEvaluationContext context)
+ {
+ return Project.DoRunTarget (monitor, target, configuration, context);
+ }
+
+ internal protected override bool OnGetSupportsTarget (string target)
+ {
+ return Project.OnGetSupportsTarget (target);
+ }
+
+ internal protected override string OnGetDefaultBuildAction (string fileName)
+ {
+ return Project.OnGetDefaultBuildAction (fileName);
+ }
+
+ internal protected override IEnumerable<string> OnGetStandardBuildActions ()
+ {
+ return Project.OnGetStandardBuildActions ();
+ }
+
+ internal protected override IList<string> OnGetCommonBuildActions ()
+ {
+ return Project.OnGetCommonBuildActions ();
+ }
+
+ internal protected override ProjectItem OnCreateProjectItem (IMSBuildItemEvaluated item)
+ {
+ return Project.OnCreateProjectItem (item);
+ }
+
+ internal protected override void OnPopulateSupportFileList (FileCopySet list, ConfigurationSelector configuration)
+ {
+ Project.DoPopulateSupportFileList (list, configuration);
+ }
+
+ internal protected override void OnPopulateOutputFileList (List<FilePath> list, ConfigurationSelector configuration)
+ {
+ Project.DoPopulateOutputFileList (list, configuration);
+ }
+
+ internal protected override FilePath OnGetOutputFileName (ConfigurationSelector configuration)
+ {
+ return Project.OnGetOutputFileName (configuration);
+ }
+
+ internal protected override string[] SupportedLanguages {
+ get {
+ return Project.OnGetSupportedLanguages ();
+ }
+ }
+
+ internal protected override void OnFileRemovedFromProject (ProjectFileEventArgs e)
+ {
+ Project.DoOnFileRemovedFromProject (e);
+ }
+
+ internal protected override void OnFileAddedToProject (ProjectFileEventArgs e)
+ {
+ Project.DoOnFileAddedToProject (e);
+ }
+
+ internal protected override void OnFileChangedInProject (ProjectFileEventArgs e)
+ {
+ Project.DoOnFileChangedInProject (e);
+ }
+
+ internal protected override void OnFilePropertyChangedInProject (ProjectFileEventArgs e)
+ {
+ Project.DoOnFilePropertyChangedInProject (e);
+ }
+
+ internal protected override void OnFileRenamedInProject (ProjectFileRenamedEventArgs e)
+ {
+ Project.DoOnFileRenamedInProject (e);
+ }
+
+ internal protected override void OnReadProjectHeader (ProgressMonitor monitor, MSBuildProject msproject)
+ {
+ Project.OnReadProjectHeader (monitor, msproject);
+ }
+
+ internal protected override void OnReadProject (ProgressMonitor monitor, MSBuildProject msproject)
+ {
+ Project.OnReadProject (monitor, msproject);
+ }
+
+ internal protected override void OnWriteProject (ProgressMonitor monitor, MSBuildProject msproject)
+ {
+ Project.OnWriteProject (monitor, msproject);
+ }
+
+ internal protected override void OnReadConfiguration (ProgressMonitor monitor, ProjectConfiguration config, IPropertySet grp)
+ {
+ Project.OnReadConfiguration (monitor, config, grp);
+ }
+
+ internal protected override void OnWriteConfiguration (ProgressMonitor monitor, ProjectConfiguration config, IPropertySet grp)
+ {
+ Project.OnWriteConfiguration (monitor, config, grp);
+ }
+
+ internal protected override void OnGetDefaultImports (List<string> imports)
+ {
+ Project.OnGetDefaultImports (imports);
+ }
+
+ internal protected override void OnPrepareForEvaluation (MSBuildProject project)
+ {
+ Project.OnPrepareForEvaluation (project);
+ }
+
+ internal protected override bool OnFastCheckNeedsBuild (ConfigurationSelector configuration)
+ {
+ return Project.OnFastCheckNeedsBuild (configuration);
+ }
+
+ internal protected override Task<ProjectFile []> OnGetSourceFiles (ProgressMonitor monitor, ConfigurationSelector configuration)
+ {
+ return Project.OnGetSourceFiles (monitor, configuration);
+ }
+
+ internal protected override void OnItemsAdded (IEnumerable<ProjectItem> objs)
+ {
+ Project.OnItemsAdded (objs);
+ }
+
+ internal protected override void OnItemsRemoved (IEnumerable<ProjectItem> objs)
+ {
+ Project.OnItemsRemoved (objs);
+ }
+ }
}
public delegate void ProjectEventHandler (Object sender, ProjectEventArgs e);
@@ -1191,4 +3179,17 @@ namespace MonoDevelop.Projects
}
}
}
+
+ public static class ProjectExtensions
+ {
+ /// <summary>
+ /// Given a project, if the project implements the specified flavor type, this
+ /// method returns the flavor instance. It returns null if the project is null or
+ /// if the project doesn't implement the flavor.
+ /// </summary>
+ public static T AsFlavor<T> (this Project project) where T:ProjectExtension
+ {
+ return project != null ? project.GetFlavor<T> () : null;
+ }
+ }
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectConfiguration.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectConfiguration.cs
index 1db4404892..2610230c1b 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectConfiguration.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectConfiguration.cs
@@ -29,33 +29,153 @@
using System;
using MonoDevelop.Core;
using System.IO;
-using MonoDevelop.Core.Serialization;
using System.Collections.Generic;
using MonoDevelop.Core.StringParsing;
+using System.Xml.Linq;
+using MonoDevelop.Projects.MSBuild;
+using System.Linq;
namespace MonoDevelop.Projects
{
public class ProjectConfiguration : SolutionItemConfiguration
{
+ bool debugTypeWasNone;
+ IPropertySet properties;
+ MSBuildPropertyGroup mainPropertyGroup;
- public ProjectConfiguration ()
+ public ProjectConfiguration (string id) : base(id)
{
}
- public ProjectConfiguration (string name) : base(name)
+ internal protected virtual void Read (IPropertySet pset)
{
+ properties = pset;
+
+ intermediateOutputDirectory = pset.GetPathValue ("IntermediateOutputPath");
+ outputDirectory = pset.GetPathValue ("OutputPath", defaultValue:"." + Path.DirectorySeparatorChar);
+ debugMode = pset.GetValue<bool> ("DebugSymbols", false);
+ pauseConsoleOutput = pset.GetValue ("ConsolePause", true);
+ externalConsole = pset.GetValue<bool> ("ExternalConsole");
+ commandLineParameters = pset.GetValue ("Commandlineparameters", "");
+ runWithWarnings = pset.GetValue ("RunWithWarnings", true);
+
+ // Special case: when DebugType=none, xbuild returns an empty string
+ debugType = pset.GetValue ("DebugType");
+ if (string.IsNullOrEmpty (debugType)) {
+ debugType = "none";
+ debugTypeReadAsEmpty = true;
+ }
+ debugTypeWasNone = debugType == "none";
+
+ var svars = pset.GetValue ("EnvironmentVariables");
+ ParseEnvironmentVariables (svars, environmentVariables);
+
+ // Kep a clone of the loaded env vars, so we can check if they have changed when saving
+ loadedEnvironmentVariables = new Dictionary<string, string> (environmentVariables);
+
+ pset.ReadObjectProperties (this, GetType (), true);
+ }
+
+ void ParseEnvironmentVariables (string xml, Dictionary<string, string> dict)
+ {
+ if (string.IsNullOrEmpty (xml)) {
+ dict.Clear ();
+ return;
+ }
+ var vars = XElement.Parse (xml);
+ if (vars != null) {
+ foreach (var val in vars.Elements (XName.Get ("Variable", MSBuildProject.Schema))) {
+ var name = (string)val.Attribute ("name");
+ if (name != null)
+ dict [name] = (string)val.Attribute ("value");
+ }
+ }
+ }
+
+ internal protected virtual void Write (IPropertySet pset)
+ {
+ pset.SetPropertyOrder ("DebugSymbols", "DebugType", "Optimize", "OutputPath", "DefineConstants", "ErrorReport");
+
+ FilePath defaultImPath;
+ if (!string.IsNullOrEmpty (Platform))
+ defaultImPath = ParentItem.BaseIntermediateOutputPath.Combine (Platform, Name);
+ else
+ defaultImPath = ParentItem.BaseIntermediateOutputPath.Combine (Name);
+
+ pset.SetValue ("IntermediateOutputPath", IntermediateOutputDirectory, defaultImPath);
+
+ // xbuild returns 'false' for DebugSymbols if DebugType==none, no matter which value is defined
+ // in the project file. Here we avoid overwriting the value if it has not changed.
+ if (debugType != "none" || !debugTypeWasNone)
+ pset.SetValue ("DebugSymbols", debugMode, false);
+
+ pset.SetValue ("OutputPath", outputDirectory, defaultValue:new FilePath ("." + Path.DirectorySeparatorChar));
+ pset.SetValue ("ConsolePause", pauseConsoleOutput, true);
+ pset.SetValue ("ExternalConsole", externalConsole, false);
+ pset.SetValue ("Commandlineparameters", commandLineParameters, "");
+ pset.SetValue ("RunWithWarnings", runWithWarnings, true);
+
+ if (debugType != "none" || !debugTypeReadAsEmpty)
+ pset.SetValue ("DebugType", debugType, "");
+
+ // Save the env vars only if the dictionary has changed.
+
+ if (loadedEnvironmentVariables == null || loadedEnvironmentVariables.Count != environmentVariables.Count || loadedEnvironmentVariables.Any (e => !environmentVariables.ContainsKey (e.Key) || environmentVariables[e.Key] != e.Value)) {
+ if (environmentVariables.Count > 0) {
+ XElement e = new XElement (XName.Get ("EnvironmentVariables", MSBuildProject.Schema));
+ foreach (var v in environmentVariables) {
+ var val = new XElement (XName.Get ("Variable", MSBuildProject.Schema));
+ val.SetAttributeValue ("name", v.Key);
+ val.SetAttributeValue ("value", v.Value);
+ e.Add (val);
+ }
+ pset.SetValue ("EnvironmentVariables", e.ToString (SaveOptions.DisableFormatting));
+ } else
+ pset.RemoveProperty ("EnvironmentVariables");
+ loadedEnvironmentVariables = new Dictionary<string, string> (environmentVariables);
+ }
+
+ pset.WriteObjectProperties (this, GetType (), true);
+ }
+
+ /// <summary>
+ /// Property set where the properties for this configuration are defined.
+ /// </summary>
+ public IPropertySet Properties {
+ get {
+ return properties ?? MainPropertyGroup;
+ }
+ internal set {
+ properties = value;
+ }
+ }
+
+ internal MSBuildPropertyGroup MainPropertyGroup {
+ get {
+ if (mainPropertyGroup == null) {
+ if (ParentItem == null)
+ mainPropertyGroup = new MSBuildPropertyGroup ();
+ else
+ mainPropertyGroup = ParentItem.MSBuildProject.CreatePropertyGroup ();
+ mainPropertyGroup.IgnoreDefaultValues = true;
+ }
+ return mainPropertyGroup;
+ }
+ set {
+ mainPropertyGroup = value;
+ mainPropertyGroup.IgnoreDefaultValues = true;
+ }
}
- [ProjectPathItemProperty("IntermediateOutputPath")]
- private FilePath intermediateOutputDirectory;
+ internal MSBuildProjectInstance ProjectInstance { get; set; }
+
+ FilePath intermediateOutputDirectory = FilePath.Empty;
public virtual FilePath IntermediateOutputDirectory {
get {
if (!intermediateOutputDirectory.IsNullOrEmpty)
return intermediateOutputDirectory;
- if (!string.IsNullOrEmpty (Platform))
- return ParentItem.BaseIntermediateOutputPath.Combine (Platform, Name);
- return ParentItem.BaseIntermediateOutputPath.Combine (Name);
+ return DefaultIntermediateOutputDirectory;
}
set {
if (value.IsNullOrEmpty)
@@ -66,46 +186,55 @@ namespace MonoDevelop.Projects
}
}
- [ProjectPathItemProperty("OutputPath")]
- private FilePath outputDirectory = "." + Path.DirectorySeparatorChar;
+ string DefaultIntermediateOutputDirectory {
+ get {
+ if (ParentItem == null)
+ return string.Empty;
+ if (!string.IsNullOrEmpty (Platform))
+ return ParentItem.BaseIntermediateOutputPath.Combine (Platform, Name);
+ return ParentItem.BaseIntermediateOutputPath.Combine (Name);
+ }
+ }
+
+ FilePath outputDirectory = "." + Path.DirectorySeparatorChar;
public virtual FilePath OutputDirectory {
get { return outputDirectory; }
set { outputDirectory = value; }
}
- [ItemProperty("DebugSymbols", DefaultValue = false)]
- private bool debugMode = false;
- public bool DebugMode {
+ bool debugMode = false;
+ public bool DebugSymbols {
get { return debugMode; }
set { debugMode = value; }
}
- [ItemProperty("ConsolePause", DefaultValue = true)]
- private bool pauseConsoleOutput = true;
+ bool pauseConsoleOutput = true;
public bool PauseConsoleOutput {
get { return pauseConsoleOutput; }
set { pauseConsoleOutput = value; }
}
- [ItemProperty("Externalconsole", DefaultValue = false)]
- private bool externalConsole = false;
+ bool externalConsole = false;
public bool ExternalConsole {
get { return externalConsole; }
set { externalConsole = value; }
}
- [ItemProperty("Commandlineparameters", DefaultValue = "")]
- private string commandLineParameters = "";
+ string commandLineParameters = "";
public string CommandLineParameters {
get { return commandLineParameters; }
set { commandLineParameters = value; }
}
- [ItemProperty("EnvironmentVariables", SkipEmpty = true)]
- [ItemProperty("Variable", Scope = "item")]
- [ItemProperty("name", Scope = "key")]
- [ItemProperty("value", Scope = "value")]
- private Dictionary<string, string> environmentVariables = new Dictionary<string, string> ();
+ bool debugTypeReadAsEmpty;
+ string debugType = "";
+ public string DebugType {
+ get { return debugType; }
+ set { debugType = value; }
+ }
+
+ Dictionary<string, string> loadedEnvironmentVariables;
+ Dictionary<string, string> environmentVariables = new Dictionary<string, string> ();
public Dictionary<string, string> EnvironmentVariables {
get { return environmentVariables; }
}
@@ -122,25 +251,41 @@ namespace MonoDevelop.Projects
return vars;
}
- [ItemProperty("RunWithWarnings", DefaultValue = true)]
- private bool runWithWarnings = true;
+ bool runWithWarnings = true;
public virtual bool RunWithWarnings {
get { return runWithWarnings; }
set { runWithWarnings = value; }
}
- public override void CopyFrom (ItemConfiguration conf)
+ protected override void OnCopyFrom (ItemConfiguration configuration, bool isRename)
{
- base.CopyFrom (conf);
+ base.OnCopyFrom (configuration, isRename);
+
+ ProjectConfiguration projectConf = configuration as ProjectConfiguration;
- ProjectConfiguration projectConf = conf as ProjectConfiguration;
+ if (isRename && projectConf.IntermediateOutputDirectory == projectConf.DefaultIntermediateOutputDirectory)
+ intermediateOutputDirectory = null;
+ else
+ intermediateOutputDirectory = projectConf.intermediateOutputDirectory;
- intermediateOutputDirectory = projectConf.intermediateOutputDirectory;
outputDirectory = projectConf.outputDirectory;
+
+ if (isRename && outputDirectory != null) {
+ var ps = outputDirectory.ToString ().Split (Path.DirectorySeparatorChar);
+ int i = Array.IndexOf (ps, configuration.Name);
+ if (i != -1) {
+ ps [i] = Name;
+ outputDirectory = string.Join (Path.DirectorySeparatorChar.ToString (), ps);
+ }
+ }
+
debugMode = projectConf.debugMode;
pauseConsoleOutput = projectConf.pauseConsoleOutput;
externalConsole = projectConf.externalConsole;
commandLineParameters = projectConf.commandLineParameters;
+ debugType = projectConf.debugType;
+ debugTypeWasNone = projectConf.debugTypeWasNone;
+ debugTypeReadAsEmpty = projectConf.debugTypeReadAsEmpty;
environmentVariables.Clear ();
foreach (KeyValuePair<string, string> el in projectConf.environmentVariables) {
@@ -148,6 +293,8 @@ namespace MonoDevelop.Projects
}
runWithWarnings = projectConf.runWithWarnings;
+
+ MainPropertyGroup.CopyFrom (projectConf.MainPropertyGroup);
}
public new Project ParentItem {
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectConvertTool.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectConvertTool.cs
index 6bedef9308..dddda00224 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectConvertTool.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectConvertTool.cs
@@ -31,12 +31,15 @@ using System.IO;
using System.Collections.Generic;
using MonoDevelop.Core;
using MonoDevelop.Core.ProgressMonitoring;
+using MonoDevelop.Projects.MSBuild;
+using System.Linq;
+using System.Threading.Tasks;
namespace MonoDevelop.Projects
{
class ProjectConvertTool: IApplication
{
- public int Run (string[] arguments)
+ public async Task<int> Run (string[] arguments)
{
if (arguments.Length == 0 || arguments [0] == "--help") {
Console.WriteLine ("");
@@ -99,7 +102,7 @@ namespace MonoDevelop.Projects
object item;
if (Services.ProjectService.IsWorkspaceItemFile (projectFile)) {
- item = Services.ProjectService.ReadWorkspaceItem (monitor, projectFile);
+ item = await Services.ProjectService.ReadWorkspaceItem (monitor, projectFile);
if (projects.Count > 0) {
Solution sol = item as Solution;
if (sol == null) {
@@ -127,17 +130,17 @@ namespace MonoDevelop.Projects
Console.WriteLine ("The -p option can't be used when exporting a single project");
return 1;
}
- item = Services.ProjectService.ReadSolutionItem (monitor, projectFile);
+ item = await Services.ProjectService.ReadSolutionItem (monitor, projectFile);
}
- FileFormat[] formats = Services.ProjectService.FileFormats.GetFileFormatsForObject (item);
+ var formats = MSBuildFileFormat.GetSupportedFormats ().ToArray ();
if (formats.Length == 0) {
Console.WriteLine ("Can't convert file to any format: " + projectFile);
return 1;
}
- FileFormat format = null;
+ MSBuildFileFormat format = null;
if (formatName == null || formatList) {
Console.WriteLine ();
@@ -163,7 +166,7 @@ namespace MonoDevelop.Projects
format = formats [op - 1];
}
else {
- foreach (FileFormat f in formats) {
+ foreach (var f in formats) {
if (f.Name == formatName)
format = f;
}
@@ -177,7 +180,8 @@ namespace MonoDevelop.Projects
destPath = Path.GetDirectoryName (projectFile);
destPath = FileService.GetFullPath (destPath);
- string ofile = Services.ProjectService.Export (monitor, projectFile, itemsToExport, destPath, format);
+ string ofile = await Services.ProjectService.Export (monitor, projectFile, itemsToExport, destPath, format);
+
if (ofile != null) {
Console.WriteLine ("Saved file: " + ofile);
return 0;
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectCreateInformation.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectCreateInformation.cs
index 38bfd3ec4f..316dda8010 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectCreateInformation.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectCreateInformation.cs
@@ -26,6 +26,7 @@
// THE SOFTWARE.
using MonoDevelop.Core;
+using MonoDevelop.Core.StringParsing;
namespace MonoDevelop.Projects
{
@@ -81,29 +82,5 @@ namespace MonoDevelop.Projects
ActiveConfiguration = projectCreateInformation.ActiveConfiguration;
Parameters = projectCreateInformation.Parameters;
}
-
- public bool ShouldCreate (string createCondition)
- {
- if (string.IsNullOrWhiteSpace (createCondition))
- return true;
-
- createCondition = createCondition.Trim ();
-
- string parameter = GetNotConditionParameterName (createCondition);
- if (parameter != null) {
- return !Parameters.GetBoolean (parameter);
- }
-
- return Parameters.GetBoolean (createCondition);
- }
-
- static string GetNotConditionParameterName (string createCondition)
- {
- if (createCondition.StartsWith ("!")) {
- return createCondition.Substring (1).TrimStart ();
- }
-
- return null;
- }
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectCreateParameters.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectCreateParameters.cs
index e3f718aeb2..27f4f88873 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectCreateParameters.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectCreateParameters.cs
@@ -44,13 +44,6 @@ namespace MonoDevelop.Projects
parameters = new Dictionary<string, string> (StringComparer.OrdinalIgnoreCase);
}
- public void MergeTo (IDictionary<string, string> other)
- {
- foreach (KeyValuePair<string, string> parameter in parameters) {
- other [parameter.Key] = parameter.Value;
- }
- }
-
public string this [string name] {
get {
string result;
@@ -64,18 +57,6 @@ namespace MonoDevelop.Projects
}
}
- public bool GetBoolean (string name, bool defaultValue = false)
- {
- string value = this [name];
- if (!string.IsNullOrEmpty (value)) {
- bool result;
- if (bool.TryParse (value, out result)) {
- return result;
- }
- }
- return defaultValue;
- }
-
object IStringTagModel.GetValue (string name)
{
string result;
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs
new file mode 100644
index 0000000000..57e1ca1830
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectExtension.cs
@@ -0,0 +1,233 @@
+//
+// MSBuildProjectExtension.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using MonoDevelop.Core;
+using System.Threading.Tasks;
+using MonoDevelop.Projects.MSBuild;
+using Mono.Addins;
+using System.Linq;
+using System.Collections.Immutable;
+
+namespace MonoDevelop.Projects
+{
+ public class ProjectExtension: SolutionItemExtension
+ {
+ ProjectExtension next;
+
+ public Project Project {
+ get { return (Project) base.Item; }
+ }
+
+ internal protected override void InitializeChain (ChainedExtension next)
+ {
+ base.InitializeChain (next);
+ this.next = FindNextImplementation<ProjectExtension> (next);
+ }
+
+ internal protected override bool SupportsObject (WorkspaceObject item)
+ {
+ return item is Project && base.SupportsObject (item);
+ }
+
+ internal protected virtual bool SupportsFlavor (string guid)
+ {
+ if (FlavorGuid != null && guid.Equals (FlavorGuid, StringComparison.OrdinalIgnoreCase))
+ return true;
+ return next.SupportsFlavor (guid);
+ }
+
+ internal protected virtual Task<TargetEvaluationResult> OnRunTarget (ProgressMonitor monitor, string target, ConfigurationSelector configuration, TargetEvaluationContext context)
+ {
+ return next.OnRunTarget (monitor, target, configuration, context);
+ }
+
+ internal protected virtual bool OnGetSupportsTarget (string target)
+ {
+ return next.OnGetSupportsTarget (target);
+ }
+
+ internal protected virtual void OnGetDefaultImports (List<string> imports)
+ {
+ next.OnGetDefaultImports (imports);
+ }
+
+ internal protected virtual void OnGetTypeTags (HashSet<string> types)
+ {
+ next.OnGetTypeTags (types);
+ if (TypeAlias != null)
+ types.Add (TypeAlias);
+ }
+
+ /// <summary>
+ /// Called just after the MSBuild project is loaded but before it is evaluated.
+ /// </summary>
+ /// <param name="project">The project</param>
+ /// <remarks>
+ /// Subclasses can override this method to transform the MSBuild project before it is evaluated.
+ /// For example, it can be used to add or remove imports, or to set custom values for properties.
+ /// Changes done in the MSBuild files are not saved.
+ /// </remarks>
+ internal protected virtual void OnPrepareForEvaluation (MSBuildProject project)
+ {
+ next.OnPrepareForEvaluation (project);
+ }
+
+ internal protected virtual void OnReadProjectHeader (ProgressMonitor monitor, MSBuildProject msproject)
+ {
+ next.OnReadProjectHeader (monitor, msproject);
+ }
+
+ internal protected virtual void OnReadProject (ProgressMonitor monitor, MSBuildProject msproject)
+ {
+ next.OnReadProject (monitor, msproject);
+ msproject.GetGlobalPropertyGroup ().ReadObjectProperties (this, GetType (), true);
+ msproject.ReadExternalProjectProperties (this, GetType (), true);
+ }
+
+ internal protected virtual void OnReadConfiguration (ProgressMonitor monitor, ProjectConfiguration config, IPropertySet pset)
+ {
+ next.OnReadConfiguration (monitor, config, pset);
+ }
+
+ internal protected virtual void OnWriteProject (ProgressMonitor monitor, MSBuildProject msproject)
+ {
+ next.OnWriteProject (monitor, msproject);
+ msproject.GetGlobalPropertyGroup ().WriteObjectProperties (this, GetType (), true);
+ msproject.WriteExternalProjectProperties (this, GetType (), true);
+ }
+
+ internal protected virtual void OnWriteConfiguration (ProgressMonitor monitor, ProjectConfiguration config, IPropertySet pset)
+ {
+ next.OnWriteConfiguration (monitor, config, pset);
+ }
+
+ internal protected virtual Task<ProjectFile []> OnGetSourceFiles (ProgressMonitor monitor, ConfigurationSelector configuration)
+ {
+ return next.OnGetSourceFiles (monitor, configuration);
+ }
+
+ #region Building
+
+ internal protected virtual bool OnGetIsCompileable (string fileName)
+ {
+ return next.OnGetIsCompileable (fileName);
+ }
+
+ internal protected virtual bool OnGetIsCompileBuildAction (string buildAction)
+ {
+ return next.OnGetIsCompileBuildAction (buildAction);
+ }
+
+ internal protected virtual string OnGetDefaultBuildAction (string fileName)
+ {
+ return next.OnGetDefaultBuildAction (fileName);
+ }
+
+ internal protected virtual IEnumerable<string> OnGetStandardBuildActions ()
+ {
+ return next.OnGetStandardBuildActions ();
+ }
+
+ internal protected virtual IList<string> OnGetCommonBuildActions ()
+ {
+ return next.OnGetCommonBuildActions ();
+ }
+
+ internal protected virtual ProjectItem OnCreateProjectItem (IMSBuildItemEvaluated item)
+ {
+ return next.OnCreateProjectItem (item);
+ }
+
+ internal protected virtual void OnPopulateSupportFileList (FileCopySet list, ConfigurationSelector configuration)
+ {
+ next.OnPopulateSupportFileList (list, configuration);
+ }
+
+ internal protected virtual void OnPopulateOutputFileList (List<FilePath> list, ConfigurationSelector configuration)
+ {
+ next.OnPopulateOutputFileList (list, configuration);
+ }
+
+ internal protected virtual FilePath OnGetOutputFileName (ConfigurationSelector configuration)
+ {
+ return next.OnGetOutputFileName (configuration);
+ }
+
+ internal protected virtual string[] SupportedLanguages {
+ get {
+ return next?.SupportedLanguages;
+ }
+ }
+
+ internal protected virtual bool OnFastCheckNeedsBuild (ConfigurationSelector configuration)
+ {
+ return next.OnFastCheckNeedsBuild (configuration);
+ }
+
+ #endregion
+
+ #region Events
+
+ internal protected virtual void OnItemsAdded (IEnumerable<ProjectItem> objs)
+ {
+ next.OnItemsAdded (objs);
+ }
+
+ internal protected virtual void OnItemsRemoved (IEnumerable<ProjectItem> objs)
+ {
+ next.OnItemsRemoved (objs);
+ }
+
+ internal protected virtual void OnFileRemovedFromProject (ProjectFileEventArgs e)
+ {
+ next.OnFileRemovedFromProject (e);
+ }
+
+ internal protected virtual void OnFileAddedToProject (ProjectFileEventArgs e)
+ {
+ next.OnFileAddedToProject (e);
+ }
+
+ internal protected virtual void OnFileChangedInProject (ProjectFileEventArgs e)
+ {
+ next.OnFileChangedInProject (e);
+ }
+
+ internal protected virtual void OnFilePropertyChangedInProject (ProjectFileEventArgs e)
+ {
+ next.OnFilePropertyChangedInProject (e);
+ }
+
+ internal protected virtual void OnFileRenamedInProject (ProjectFileRenamedEventArgs e)
+ {
+ next.OnFileRenamedInProject (e);
+ }
+
+ #endregion
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFeature.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFeature.cs
new file mode 100644
index 0000000000..75ac1a1b7e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFeature.cs
@@ -0,0 +1,39 @@
+//
+// ProjectFeature.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Projects
+{
+ [Flags]
+ public enum ProjectFeatures
+ {
+ None = 0,
+ Build = 1,
+ Execute = 2,
+ Configurations = 4
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFile.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFile.cs
index a06690fdca..5e12fb87b1 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFile.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFile.cs
@@ -37,6 +37,8 @@ using MonoDevelop.Core;
using MonoDevelop.Core.Serialization;
using MonoDevelop.Projects;
using MonoDevelop.Projects.Extensions;
+using MonoDevelop.Projects.MSBuild;
+using MonoDevelop.Projects.Policies;
namespace MonoDevelop.Projects
{
@@ -55,40 +57,109 @@ namespace MonoDevelop.Projects
{
}
- public ProjectFile (string filename)
+ public ProjectFile (string filename): this (filename, MonoDevelop.Projects.BuildAction.Compile)
{
- this.filename = FileService.GetFullPath (filename);
- subtype = Subtype.Code;
- buildaction = MonoDevelop.Projects.BuildAction.Compile;
}
public ProjectFile (string filename, string buildAction)
{
this.filename = FileService.GetFullPath (filename);
subtype = Subtype.Code;
- buildaction = buildAction;
+ BuildAction = buildAction;
+ }
+
+ public override string Include {
+ get {
+ if (Project != null) {
+ string path = MSBuildProjectService.ToMSBuildPath (Project.ItemDirectory, FilePath);
+ if (path.Length > 0) {
+ //directory paths must end with '/'
+ if ((Subtype == Subtype.Directory) && path [path.Length - 1] != '\\')
+ path = path + "\\";
+ return path;
+ }
+ }
+ return base.Include;
+ }
+ protected set {
+ base.Include = value;
+ }
+ }
+
+ internal protected override void Read (Project project, IMSBuildItemEvaluated buildItem)
+ {
+ base.Read (project, buildItem);
+
+ if (buildItem.Name == "Folder") {
+ // Read folders
+ string path = MSBuildProjectService.FromMSBuildPath (project.ItemDirectory, buildItem.Include);
+ Name = Path.GetDirectoryName (path);
+ Subtype = Subtype.Directory;
+ return;
+ }
+
+ Name = MSBuildProjectService.FromMSBuildPath (project.ItemDirectory, buildItem.Include);
+ BuildAction = buildItem.Name;
+
+ DependsOn = buildItem.Metadata.GetPathValue ("DependentUpon", relativeToPath:FilePath.ParentDirectory);
+
+ string copy = buildItem.Metadata.GetValue ("CopyToOutputDirectory");
+ if (!string.IsNullOrEmpty (copy)) {
+ switch (copy) {
+ case "None": break;
+ case "Always": CopyToOutputDirectory = FileCopyMode.Always; break;
+ case "PreserveNewest": CopyToOutputDirectory = FileCopyMode.PreserveNewest; break;
+ default:
+ LoggingService.LogWarning (
+ "Unrecognised value {0} for CopyToOutputDirectory MSBuild property",
+ copy);
+ break;
+ }
+ }
+
+ Visible = buildItem.Metadata.GetValue ("Visible", true);
+ resourceId = buildItem.Metadata.GetValue ("LogicalName");
+ contentType = buildItem.Metadata.GetValue ("SubType");
+ generator = buildItem.Metadata.GetValue ("Generator");
+ customToolNamespace = buildItem.Metadata.GetValue ("CustomToolNamespace");
+ lastGenOutput = buildItem.Metadata.GetValue ("LastGenOutput");
+ Link = buildItem.Metadata.GetPathValue ("Link", relativeToProject:false);
+ }
+
+ internal protected override void Write (Project project, MSBuildItem buildItem)
+ {
+ base.Write (project, buildItem);
+
+ buildItem.Metadata.SetValue ("DependentUpon", DependsOn, FilePath.Empty, relativeToPath:FilePath.ParentDirectory);
+ buildItem.Metadata.SetValue ("SubType", ContentType, "");
+ buildItem.Metadata.SetValue ("Generator", Generator, "");
+ buildItem.Metadata.SetValue ("CustomToolNamespace", CustomToolNamespace, "");
+ buildItem.Metadata.SetValue ("LastGenOutput", LastGenOutput, "");
+ buildItem.Metadata.SetValue ("Link", Link, FilePath.Empty, relativeToProject:false);
+ buildItem.Metadata.SetValue ("CopyToOutputDirectory", CopyToOutputDirectory.ToString (), "None");
+ buildItem.Metadata.SetValue ("Visible", Visible, true);
+
+ var resId = ResourceId;
+
+ // For EmbeddedResource, emit LogicalName only when it does not match the default msbuild resource Id
+ if (project is DotNetProject && BuildAction == MonoDevelop.Projects.BuildAction.EmbeddedResource && ((DotNetProject)project).GetDefaultMSBuildResourceId (this) == resId)
+ resId = "";
+
+ buildItem.Metadata.SetValue ("LogicalName", resId, "");
}
- [ItemProperty("subtype")]
+
Subtype subtype;
public Subtype Subtype {
get { return subtype; }
set {
subtype = value;
+ if (subtype == Subtype.Directory)
+ ItemName = "Folder";
OnChanged ("Subtype");
}
}
- [ItemProperty("data", DefaultValue = "")]
- string data = "";
- public string Data {
- get { return data; }
- set {
- data = value;
- OnChanged ("Data");
- }
- }
-
public string Name {
get { return filename; }
@@ -109,31 +180,35 @@ namespace MonoDevelop.Projects
if (IsLink && Link.FileName == oldPath.FileName)
link = Path.Combine (Path.GetDirectoryName (link), filename.FileName);
+ // If a file that belongs to a project is being renamed, update the value of UnevaluatedInclude
+ // since that is used when saving
+ if (Project != null)
+ UnevaluatedInclude = Include;
+
OnPathChanged (oldPath, filename, oldVirtualPath, ProjectVirtualPath);
- if (project != null)
- project.NotifyFileRenamedInProject (new ProjectFileRenamedEventArgs (project, this, oldPath));
+ if (Project != null)
+ Project.NotifyFileRenamedInProject (new ProjectFileRenamedEventArgs (Project, this, oldPath));
}
}
-
- [ItemProperty("buildaction")]
- string buildaction = MonoDevelop.Projects.BuildAction.None;
public string BuildAction {
- get { return buildaction; }
+ get { return ItemName; }
set {
- buildaction = string.IsNullOrEmpty (value) ? MonoDevelop.Projects.BuildAction.None : value;
+ ItemName = string.IsNullOrEmpty (value) ? MonoDevelop.Projects.BuildAction.None : value;
OnChanged ("BuildAction");
}
}
- [ItemProperty("resource_id", DefaultValue = "")]
string resourceId = String.Empty;
- internal string GetResourceId (IResourceHandler resourceHandler)
+ /// <summary>
+ /// Gets the resource id of this file for the provided policy
+ /// </summary>
+ internal string GetResourceId (ResourceNamePolicy policy)
{
- if (string.IsNullOrEmpty (resourceId))
- return resourceHandler.GetDefaultResourceId (this);
+ if (string.IsNullOrEmpty (resourceId) && (Project is DotNetProject))
+ return ((DotNetProject)Project).GetDefaultResourceIdForPolicy (this, policy);
return resourceId;
}
@@ -147,15 +222,6 @@ namespace MonoDevelop.Projects
}
/// <summary>
- /// Set to true if this ProjectFile was created at load time by
- /// a ProjectFile containing wildcards. If true, this instance
- /// should not be saved to a csproj file.
- /// </summary>
- internal bool IsOriginatedFromWildcard {
- get; set;
- }
-
- /// <summary>
/// The file should be treated as effectively having this relative path within the project. If the file is
/// a link or outside the project root, this will not be the same as the physical file.
/// </summary>
@@ -163,8 +229,8 @@ namespace MonoDevelop.Projects
get {
if (!Link.IsNullOrEmpty)
return Link;
- if (project != null) {
- var rel = project.GetRelativeChildPath (FilePath);
+ if (Project != null) {
+ var rel = Project.GetRelativeChildPath (FilePath);
if (!rel.ToString ().StartsWith ("..", StringComparison.Ordinal))
return rel;
}
@@ -173,22 +239,15 @@ namespace MonoDevelop.Projects
}
- Project project;
- public Project Project {
- get { return project; }
- }
-
- [ItemProperty("SubType")]
- string contentType = String.Empty;
+ string contentType;
public string ContentType {
- get { return contentType; }
+ get { return contentType ?? ""; }
set {
contentType = value;
OnChanged ("ContentType");
}
}
- [ItemProperty("Visible", DefaultValue = true)]
bool visible = true;
/// <summary>
@@ -204,14 +263,13 @@ namespace MonoDevelop.Projects
}
}
- [ItemProperty("Generator", DefaultValue = "")]
string generator;
/// <summary>
/// The ID of a custom code generator.
/// </summary>
public string Generator {
- get { return generator; }
+ get { return generator ?? ""; }
set {
if (generator != value) {
generator = value;
@@ -220,14 +278,13 @@ namespace MonoDevelop.Projects
}
}
- [ItemProperty("CustomToolNamespace", DefaultValue = "")]
string customToolNamespace;
/// <summary>
/// Overrides the namespace in which the custom code generator should generate code.
/// </summary>
public string CustomToolNamespace {
- get { return customToolNamespace; }
+ get { return customToolNamespace ?? ""; }
set {
if (customToolNamespace != value) {
customToolNamespace = value;
@@ -237,14 +294,13 @@ namespace MonoDevelop.Projects
}
- [ItemProperty("LastGenOutput", DefaultValue = "")]
string lastGenOutput;
/// <summary>
/// The file most recently generated by the custom tool. Relative to this file's parent directory.
/// </summary>
public string LastGenOutput {
- get { return lastGenOutput; }
+ get { return lastGenOutput ?? ""; }
set {
if (lastGenOutput != value) {
lastGenOutput = value;
@@ -253,8 +309,6 @@ namespace MonoDevelop.Projects
}
}
-
- [RelativeProjectPathItemProperty("Link", DefaultValue = "")]
string link;
/// <summary>
@@ -262,11 +316,11 @@ namespace MonoDevelop.Projects
/// within the project root. Use ProjectVirtualPath to read the effective virtual path for any file.
/// </summary>
public FilePath Link {
- get { return link; }
+ get { return link ?? ""; }
set {
if (link != value) {
if (value.IsAbsolute || value.ToString ().StartsWith ("..", StringComparison.Ordinal))
- throw new ArgumentException ("value");
+ throw new ArgumentException ("Invalid value for Link property");
var oldLink = link;
link = value;
@@ -282,7 +336,7 @@ namespace MonoDevelop.Projects
/// </summary>
public bool IsLink {
get {
- return !Link.IsNullOrEmpty || (project != null && !FilePath.IsChildPathOf (project.BaseDirectory));
+ return !Link.IsNullOrEmpty || (Project != null && !FilePath.IsChildPathOf (Project.BaseDirectory));
}
}
@@ -291,12 +345,11 @@ namespace MonoDevelop.Projects
/// </summary>
public bool IsExternalToProject {
get {
- return !FilePath.IsChildPathOf (project.BaseDirectory);
+ return !FilePath.IsChildPathOf (Project.BaseDirectory);
}
}
- [ItemProperty("copyToOutputDirectory", DefaultValue = FileCopyMode.None)]
- FileCopyMode copyToOutputDirectory;
+ FileCopyMode copyToOutputDirectory = FileCopyMode.None;
public FileCopyMode CopyToOutputDirectory {
get { return copyToOutputDirectory; }
set {
@@ -310,7 +363,7 @@ namespace MonoDevelop.Projects
#region File grouping
string dependsOn;
public string DependsOn {
- get { return dependsOn; }
+ get { return dependsOn ?? ""; }
set {
if (dependsOn != value) {
@@ -324,8 +377,8 @@ namespace MonoDevelop.Projects
dependsOnFile = null;
}
- if (project != null && value != null)
- project.UpdateDependency (this, oldPath);
+ if (Project != null && value != null)
+ Project.UpdateDependency (this, oldPath);
OnChanged ("DependsOn");
}
@@ -367,7 +420,7 @@ namespace MonoDevelop.Projects
internal bool ResolveParent ()
{
- if (dependsOnFile == null && (!string.IsNullOrEmpty (dependsOn) && project != null)) {
+ if (dependsOnFile == null && (!string.IsNullOrEmpty (dependsOn) && Project != null)) {
//NOTE also that the dependent files are always assumed to be in the same directory
//This matches VS behaviour
var parentPath = DependencyPath;
@@ -376,12 +429,12 @@ namespace MonoDevelop.Projects
if (parentPath == FilePath) {
LoggingService.LogWarning (
"Cyclic dependency in project '{0}': file '{1}' depends on '{2}'",
- project == null ? "(none)" : project.Name, FilePath, parentPath
+ Project == null ? "(none)" : Project.Name, FilePath, parentPath
);
return true;
}
- dependsOnFile = project.Files.GetFile (parentPath);
+ dependsOnFile = Project.Files.GetFile (parentPath);
if (dependsOnFile != null) {
if (dependsOnFile.dependentChildren == null)
dependsOnFile.dependentChildren = new List<ProjectFile> ();
@@ -399,8 +452,9 @@ namespace MonoDevelop.Projects
// FIXME: rename this to LogicalName for a better mapping to the MSBuild property
public string ResourceId {
get {
- if (BuildAction == MonoDevelop.Projects.BuildAction.EmbeddedResource && string.IsNullOrEmpty (resourceId) && project is DotNetProject)
- return ((DotNetProject)project).ResourceHandler.GetDefaultResourceId (this);
+ // If the resource id is not set, return the project's default
+ if (BuildAction == MonoDevelop.Projects.BuildAction.EmbeddedResource && string.IsNullOrEmpty (resourceId) && Project is DotNetProject)
+ return ((DotNetProject)Project).GetDefaultResourceId (this);
return resourceId;
}
@@ -414,11 +468,10 @@ namespace MonoDevelop.Projects
}
}
- internal void SetProject (Project project)
+ protected override void OnProjectSet ()
{
- this.project = project;
-
- if (project != null)
+ base.OnProjectSet ();
+ if (Project != null)
OnVirtualPathChanged (FilePath.Null, ProjectVirtualPath);
}
@@ -432,9 +485,10 @@ namespace MonoDevelop.Projects
ProjectFile pf = (ProjectFile)MemberwiseClone ();
pf.dependsOnFile = null;
pf.dependentChildren = null;
- pf.project = null;
+ pf.Project = null;
pf.VirtualPathChanged = null;
pf.PathChanged = null;
+ pf.BackingItem = null;
return pf;
}
@@ -464,8 +518,8 @@ namespace MonoDevelop.Projects
protected virtual void OnChanged (string property)
{
- if (project != null)
- project.NotifyFilePropertyChangedInProject (this, property);
+ if (Project != null)
+ Project.NotifyFilePropertyChangedInProject (this, property);
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFileCollection.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFileCollection.cs
index 5b5bfd3d22..27fd0914c6 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFileCollection.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFileCollection.cs
@@ -31,6 +31,7 @@ using System.Linq;
using System.Collections.Generic;
using MonoDevelop.Core;
+using System.Collections.Immutable;
namespace MonoDevelop.Projects
{
@@ -113,12 +114,12 @@ namespace MonoDevelop.Projects
[Serializable()]
public class ProjectFileCollection : ProjectItemCollection<ProjectFile>
{
- Dictionary<FilePath, ProjectFile> files;
+ ImmutableDictionary<FilePath, ProjectFile> files;
ProjectFileNode root;
public ProjectFileCollection ()
{
- files = new Dictionary<FilePath, ProjectFile> ();
+ files = ImmutableDictionary<FilePath, ProjectFile>.Empty;
root = new ProjectFileNode ();
}
@@ -142,9 +143,10 @@ namespace MonoDevelop.Projects
void FilePathChanged (object sender, ProjectFilePathChangedEventArgs e)
{
+ AssertCanWrite ();
ProjectVirtualPathChanged (sender, e);
- files.Remove (e.OldPath);
- files[e.NewPath] = e.ProjectFile;
+ files = files.Remove (e.OldPath);
+ files = files.SetItem (e.NewPath, e.ProjectFile);
}
void AddProjectFile (ProjectFile item)
@@ -158,7 +160,7 @@ namespace MonoDevelop.Projects
node.ProjectFile = item;
}
- files[item.FilePath] = item;
+ files = files.SetItem (item.FilePath, item);
}
void PruneEmptyParents (ProjectFileNode node)
@@ -178,37 +180,25 @@ namespace MonoDevelop.Projects
PruneEmptyParents (node.Parent);
}
- files.Remove (item.FilePath);
+ files = files.Remove (item.FilePath);
item.VirtualPathChanged -= ProjectVirtualPathChanged;
item.PathChanged -= FilePathChanged;
}
#region ItemCollection<T>
- protected override void OnItemAdded (ProjectFile item)
+ protected override void OnItemsAdded (IEnumerable<ProjectFile> items)
{
- AddProjectFile (item);
- base.OnItemAdded (item);
+ foreach (var item in items)
+ AddProjectFile (item);
+ base.OnItemsAdded (items);
}
- protected override void OnItemRemoved (ProjectFile item)
+ protected override void OnItemsRemoved (IEnumerable<ProjectFile> items)
{
- RemoveProjectFile (item);
- base.OnItemRemoved (item);
- }
- #endregion
-
- #region ProjectItemCollection<T>
- protected override void AddItem (ProjectFile item)
- {
- AddProjectFile (item);
- base.AddItem (item);
- }
-
- protected override void RemoveItem (ProjectFile item)
- {
- RemoveProjectFile (item);
- base.RemoveItem (item);
+ foreach (var item in items)
+ RemoveProjectFile (item);
+ base.OnItemsRemoved (items);
}
#endregion
@@ -254,7 +244,7 @@ namespace MonoDevelop.Projects
public ProjectFile[] GetFilesInPath (FilePath path)
{
List<ProjectFile> list = new List<ProjectFile> ();
- foreach (ProjectFile file in Items) {
+ foreach (ProjectFile file in this) {
if (file.FilePath.IsChildPathOf (path))
list.Add (file);
}
@@ -265,7 +255,7 @@ namespace MonoDevelop.Projects
{
fileName = FileService.GetFullPath (fileName);
for (int n = 0; n < Count; n++) {
- if (Items[n].Name == fileName) {
+ if (this[n].Name == fileName) {
RemoveAt (n);
break;
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItem.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItem.cs
index 8c5a7303fa..cdfd4f90a7 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItem.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItem.cs
@@ -26,14 +26,34 @@
using System;
using System.Collections;
+using System.Collections.Generic;
using MonoDevelop.Core.Serialization;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.Projects
{
public class ProjectItem: IExtendedDataItem
{
+ Project project;
Hashtable extendedProperties;
-
+ ProjectItemMetadata metadata;
+ static Dictionary<Type,HashSet<string>> knownMetadataCache = new Dictionary<Type, HashSet<string>> ();
+
+ public ProjectItem ()
+ {
+ ItemName = MSBuildProjectService.GetNameForProjectItem (GetType());
+ }
+
+ public Project Project {
+ get {
+ return project;
+ }
+ internal set {
+ project = value;
+ OnProjectSet ();
+ }
+ }
+
public IDictionary ExtendedProperties {
get {
if (extendedProperties == null)
@@ -41,19 +61,123 @@ namespace MonoDevelop.Projects
return extendedProperties;
}
}
-
+
+ MSBuildItem backingItem;
+ internal MSBuildItem BackingItem {
+ get {
+ return backingItem;
+ }
+ set {
+ backingItem = value;
+ UnevaluatedInclude = backingItem?.Include;
+ }
+ }
+
+ internal IMSBuildItemEvaluated BackingEvalItem { get; set; }
+
+ internal bool IsFromWildcardItem {
+ get {
+ return BackingItem != null && BackingItem.IsWildcardItem;
+ }
+ }
+
internal string Condition { get; set; }
+ public string ItemName { get; protected set; }
+
+ public virtual string Include { get; protected set; }
+
+ public string UnevaluatedInclude { get; protected set; }
+
public ProjectItemFlags Flags { get; set; }
+
+ public ProjectItemMetadata Metadata {
+ get {
+ if (metadata == null)
+ metadata = new ProjectItemMetadata ();
+ return metadata;
+ }
+ }
+
+ public bool IsHidden {
+ get { return (Flags & ProjectItemFlags.Hidden) == ProjectItemFlags.Hidden; }
+ }
+
+ internal protected virtual void Read (Project project, IMSBuildItemEvaluated buildItem)
+ {
+ ItemName = buildItem.Name;
+ Include = buildItem.Include;
+ UnevaluatedInclude = buildItem.UnevaluatedInclude;
+ Condition = buildItem.Condition;
+ metadata = null;
+
+ if (buildItem.SourceItem != null) {
+ HashSet<string> knownProps = GetKnownMetadata ();
+ foreach (var prop in buildItem.SourceItem.Metadata.GetProperties ()) {
+ if (!knownProps.Contains (prop.Name)) {
+ if (metadata == null)
+ metadata = new ProjectItemMetadata (project.MSBuildProject);
+ // Get the evaluated value for the original metadata property
+ var p = new ItemMetadataProperty (prop.Name, buildItem.Metadata.GetValue (prop.Name), prop.UnevaluatedValue);
+ p.ParentProject = project.MSBuildProject;
+ metadata.AddProperty (p);
+ }
+ }
+ if (metadata != null)
+ metadata.OnLoaded ();
+ }
+ buildItem.Metadata.ReadObjectProperties (this, GetType (), true);
+ }
+
+ internal protected virtual void Write (Project project, MSBuildItem buildItem)
+ {
+ buildItem.Condition = Condition;
+ buildItem.Metadata.WriteObjectProperties (this, GetType(), true);
+
+ if (metadata != null) {
+ metadata.SetProject (buildItem.ParentProject);
+ foreach (var prop in metadata.GetProperties ()) {
+ // Use the UnevaluatedValue because if the property has changed, UnevaluatedValue will contain
+ // the new value, and if not, it will contain the old unevaluated value
+ buildItem.Metadata.SetValue (prop.Name, prop.UnevaluatedValue);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets a list of metadata properties which are read and written by this item, so they don't
+ /// have to be stored in the generic Metadata dictionary
+ /// </summary>
+ /// <returns>The known metadata properties.</returns>
+ protected virtual IEnumerable<string> GetKnownMetadataProperties ()
+ {
+ DataSerializer ser = new DataSerializer (Services.ProjectService.DataContext);
+ var props = Services.ProjectService.DataContext.GetProperties (ser.SerializationContext, this);
+ foreach (var prop in props)
+ if (!prop.IsExternal)
+ yield return prop.Name;
+ }
+
+ HashSet<string> GetKnownMetadata ()
+ {
+ HashSet<string> mset;
+ lock (knownMetadataCache) {
+ if (!knownMetadataCache.TryGetValue (GetType (), out mset))
+ knownMetadataCache [GetType()] = mset = new HashSet<string> (GetKnownMetadataProperties ());
+ }
+ return mset;
+ }
+
+ /// <summary>
+ /// Invoked when the project to which the item belongs changes.
+ /// </summary>
+ protected virtual void OnProjectSet ()
+ {
+ }
}
public class UnknownProjectItem: ProjectItem
{
- public string ItemName { get; private set; }
-
- [ItemProperty ("Include")]
- public string Include { get; private set; }
-
public UnknownProjectItem (string name, string include)
{
this.ItemName = name;
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItemCollection.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItemCollection.cs
index cfdbd848dc..429acb33b3 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItemCollection.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItemCollection.cs
@@ -37,7 +37,7 @@ namespace MonoDevelop.Projects
{
}
- internal ProjectItemCollection (SolutionEntityItem parent): base (parent)
+ internal ProjectItemCollection (Project parent): base (parent)
{
}
}
@@ -51,11 +51,11 @@ namespace MonoDevelop.Projects
public class ProjectItemCollection<T>: ItemCollection<T>, IItemListHandler where T: ProjectItem
{
- SolutionEntityItem parent;
+ Project parent;
IItemListHandler parentCollection;
List<IItemListHandler> subCollections;
- internal ProjectItemCollection (SolutionEntityItem parent)
+ internal ProjectItemCollection (Project parent)
{
this.parent = parent;
}
@@ -64,34 +64,9 @@ namespace MonoDevelop.Projects
{
}
- protected virtual void AddItem (T item)
- {
- Items.Add (item);
- }
-
- public void AddRange (IEnumerable<T> items)
- {
- foreach (var item in items)
- AddItem (item);
- NotifyAdded (items, false);
- NotifyAdded (items, true);
- }
-
- protected virtual void RemoveItem (T item)
- {
- Items.Remove (item);
- }
-
- public void RemoveRange (IEnumerable<T> items)
- {
- foreach (var item in items)
- RemoveItem (item);
- NotifyRemoved (items, false);
- NotifyRemoved (items, true);
- }
-
public void Bind<U> (ProjectItemCollection<U> subCollection) where U:T
{
+ AssertCanWrite ();
if (subCollections == null)
subCollections = new List<IItemListHandler> ();
subCollections.Add (subCollection);
@@ -116,33 +91,43 @@ namespace MonoDevelop.Projects
}
}
- protected override void OnItemAdded (T item)
+ protected override void OnItemsAdded (IEnumerable<T> items)
{
- var items = new T [] { item };
- NotifyAdded (items, true);
- NotifyAdded (items, false);
+ if (!ignoreChangeEvents) {
+ NotifyAdded (items, true);
+ NotifyAdded (items, false);
+ }
}
- protected override void OnItemRemoved (T item)
+ protected override void OnItemsRemoved (IEnumerable<T> items)
{
- var items = new T [] { item };
- NotifyRemoved (items, true);
- NotifyRemoved (items, false);
+ if (!ignoreChangeEvents) {
+ NotifyRemoved (items, true);
+ NotifyRemoved (items, false);
+ }
}
-
+
+ bool ignoreChangeEvents;
+
void IItemListHandler.InternalAdd (IEnumerable<ProjectItem> items, bool comesFromParent)
{
- foreach (var item in items)
- AddItem ((T) item);
-
+ try {
+ ignoreChangeEvents = true;
+ AddRange (items.Cast<T> ());
+ } finally {
+ ignoreChangeEvents = false;
+ }
NotifyAdded (items, comesFromParent);
}
void IItemListHandler.InternalRemove (IEnumerable<ProjectItem> items, bool comesFromParent)
{
- foreach (var item in items)
- RemoveItem ((T) item);
-
+ try {
+ ignoreChangeEvents = true;
+ RemoveRange (items.Cast<T> ());
+ } finally {
+ ignoreChangeEvents = false;
+ }
NotifyRemoved (items, comesFromParent);
}
@@ -162,7 +147,7 @@ namespace MonoDevelop.Projects
if (parentCollection != null)
parentCollection.InternalAdd (items, false);
if (parent != null)
- parent.OnItemsAdded (items);
+ parent.NotifyItemsAdded (items);
}
}
@@ -177,7 +162,7 @@ namespace MonoDevelop.Projects
if (parentCollection != null)
parentCollection.InternalRemove (items, false);
if (parent != null)
- parent.OnItemsRemoved (items);
+ parent.NotifyItemsRemoved (items);
}
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItemEventArgs.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItemEventArgs.cs
index 50cbb2dd8e..8c0eb53205 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItemEventArgs.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItemEventArgs.cs
@@ -25,6 +25,8 @@
// THE SOFTWARE.
using System;
using MonoDevelop.Core;
+using System.Collections;
+using System.Collections.Generic;
namespace MonoDevelop.Projects
{
@@ -33,8 +35,13 @@ namespace MonoDevelop.Projects
public ProjectItemEventArgs ()
{
}
-
- public ProjectItemEventArgs (SolutionEntityItem solutionItem, ProjectItem item)
+
+ public ProjectItemEventArgs (IEnumerable<ProjectItemEventInfo> infos)
+ {
+ AddRange (infos);
+ }
+
+ public ProjectItemEventArgs (SolutionItem solutionItem, ProjectItem item)
{
Add (new ProjectItemEventInfo (solutionItem, item));
}
@@ -43,15 +50,15 @@ namespace MonoDevelop.Projects
public class ProjectItemEventInfo
{
ProjectItem item;
- SolutionEntityItem solutionItem;
+ SolutionItem solutionItem;
- public ProjectItemEventInfo (SolutionEntityItem solutionItem, ProjectItem item)
+ public ProjectItemEventInfo (SolutionItem solutionItem, ProjectItem item)
{
this.item = item;
this.solutionItem = solutionItem;
}
- public SolutionEntityItem SolutionItem {
+ public SolutionItem SolutionItem {
get {
return solutionItem;
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItemMetadata.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItemMetadata.cs
new file mode 100644
index 0000000000..918c7d28a0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectItemMetadata.cs
@@ -0,0 +1,361 @@
+//
+// ProjectItemMetadata.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core;
+using MonoDevelop.Projects.MSBuild;
+using System.Collections.Generic;
+using System.Xml;
+using System.Linq;
+
+namespace MonoDevelop.Projects
+{
+ public class ProjectItemMetadata: IPropertySet
+ {
+ Dictionary<string,MSBuildProperty> properties;
+ List<MSBuildProperty> propertyList = new List<MSBuildProperty> ();
+ int initialMetadataCount;
+ MSBuildProject project;
+
+ internal ProjectItemMetadata ()
+ {
+ }
+
+ internal ProjectItemMetadata (MSBuildProject project)
+ {
+ this.project = project;
+ }
+
+ internal ProjectItemMetadata (ProjectItemMetadata other)
+ {
+ this.project = other.project;
+ if (other.properties != null) {
+ properties = new Dictionary<string, MSBuildProperty> (other.properties.Count);
+ foreach (var p in other.propertyList) {
+ var pc = p.Clone ();
+ propertyList.Add (pc);
+ properties [p.Name] = pc;
+ }
+ }
+ initialMetadataCount = other.initialMetadataCount;
+ }
+
+ internal void OnLoaded ()
+ {
+ initialMetadataCount = propertyList.Count;
+ }
+
+ internal void SetProject (MSBuildProject project)
+ {
+ foreach (var p in propertyList) {
+ p.ParentProject = project;
+ p.ResolvePath ();
+ }
+ }
+
+/* internal void LoadProperties (XmlElement element)
+ {
+ foreach (var pelem in element.ChildNodes.OfType<XmlElement> ()) {
+ MSBuildProperty prevSameName;
+ if (properties != null && properties.TryGetValue (pelem.Name, out prevSameName))
+ prevSameName.Overwritten = true;
+
+ if (properties == null) {
+ properties = new Dictionary<string,MSBuildProperty> ();
+ propertyList = new List<MSBuildProperty> ();
+ }
+
+ var prop = new MSBuildProperty (project, pelem);
+ propertyList.Add (prop);
+ properties [pelem.Name] = prop; // If a property is defined more than once, we only care about the last registered value
+ }
+ initialMetadataCount = properties.Count;
+ }*/
+
+ internal bool PropertyCountHasChanged {
+ get { return initialMetadataCount != (properties != null ? properties.Count : 0); }
+ }
+
+ public IMetadataProperty GetProperty (string name)
+ {
+ if (properties == null)
+ return null;
+ MSBuildProperty prop;
+ properties.TryGetValue (name, out prop);
+ return prop;
+ }
+
+ public IEnumerable<IMetadataProperty> GetProperties ()
+ {
+ if (propertyList == null)
+ return new IMetadataProperty [0];
+ return propertyList.Where (p => !p.Overwritten);
+ }
+
+ public string GetValue (string name, string defaultValue = null)
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.Value;
+ else
+ return defaultValue;
+ }
+
+ public FilePath GetPathValue (string name, FilePath defaultValue = default(FilePath), bool relativeToProject = true, FilePath relativeToPath = default(FilePath))
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.GetPathValue (relativeToProject, relativeToPath);
+ else
+ return defaultValue;
+ }
+
+ public bool TryGetPathValue (string name, out FilePath value, FilePath defaultValue = default(FilePath), bool relativeToProject = true, FilePath relativeToPath = default(FilePath))
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.TryGetPathValue (out value, relativeToProject, relativeToPath);
+ else {
+ value = defaultValue;
+ return value != default(FilePath);
+ }
+ }
+
+ public T GetValue<T> (string name)
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.GetValue<T> ();
+ else
+ return default(T);
+ }
+
+ public T GetValue<T> (string name, T defaultValue)
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.GetValue<T> ();
+ else
+ return defaultValue;
+ }
+
+ public object GetValue (string name, Type type, object defaultValue)
+ {
+ var prop = GetProperty (name);
+ if (prop != null)
+ return prop.GetValue (type);
+ else
+ return defaultValue;
+ }
+
+ MSBuildProperty AddProperty (string name, string condition = null)
+ {
+ if (properties == null) {
+ properties = new Dictionary<string, MSBuildProperty> ();
+ propertyList = new List<MSBuildProperty> ();
+ }
+ int i = propertyOrder != null ? propertyOrder.IndexOf (name) : -1;
+ int insertIndex = -1;
+ if (i != -1) {
+ var foundProp = FindExistingProperty (i - 1, -1);
+ if (foundProp != null) {
+ insertIndex = propertyList.IndexOf (foundProp) + 1;
+ } else {
+ foundProp = FindExistingProperty (i + 1, 1);
+ if (foundProp != null)
+ insertIndex = propertyList.IndexOf (foundProp) - 1;
+ }
+ }
+
+ var prop = new ItemMetadataProperty (name);
+ prop.ParentProject = project;
+ properties [name] = prop;
+
+ if (insertIndex != -1)
+ propertyList.Insert (insertIndex, prop);
+ else
+ propertyList.Add (prop);
+ return prop;
+ }
+
+ internal void AddProperty (ItemMetadataProperty prop)
+ {
+ if (properties == null) {
+ properties = new Dictionary<string, MSBuildProperty> ();
+ propertyList = new List<MSBuildProperty> ();
+ }
+ prop.ParentProject = project;
+ properties [prop.Name] = prop;
+ propertyList.Add (prop);
+ }
+
+ MSBuildProperty FindExistingProperty (int index, int inc)
+ {
+ while (index >= 0 && index < propertyOrder.Count) {
+ var ep = (MSBuildProperty) GetProperty (propertyOrder[index]);
+ if (ep != null)
+ return ep;
+ index += inc;
+ }
+ return null;
+ }
+
+ void IPropertySet.SetValue (string name, string value, string defaultValue, bool preserveExistingCase, bool mergeToMainGroup, string condition, MSBuildValueType valueType)
+ {
+ SetValue (name, value, defaultValue, preserveExistingCase, valueType);
+ }
+
+ public void SetValue (string name, string value, string defaultValue = null, bool preserveExistingCase = false, MSBuildValueType valueType = null)
+ {
+ // If no value type is specified, use the default
+ if (valueType == null)
+ valueType = preserveExistingCase ? MSBuildValueType.DefaultPreserveCase : MSBuildValueType.Default;
+
+ if (value == null && defaultValue == "")
+ value = "";
+ var prop = (MSBuildProperty) GetProperty (name);
+ var isDefault = value == defaultValue;
+ if (isDefault) {
+ // if the value is default, only remove the property if it was not already the default
+ // to avoid unnecessary project file churn
+ if (prop != null && (defaultValue == null || !valueType.Equals (defaultValue, prop.Value)))
+ RemoveProperty (prop);
+ return;
+ }
+ if (prop == null)
+ prop = AddProperty (name);
+ prop.SetValue (value, valueType:valueType);
+ prop.HasDefaultValue = isDefault;
+ }
+
+ void IPropertySet.SetValue (string name, FilePath value, FilePath defaultValue, bool relativeToProject, FilePath relativeToPath, bool mergeToMainGroup, string condition)
+ {
+ SetValue (name, value, defaultValue, relativeToProject, relativeToPath);
+ }
+
+ public void SetValue (string name, FilePath value, FilePath defaultValue = default(FilePath), bool relativeToProject = true, FilePath relativeToPath = default(FilePath))
+ {
+ var prop = (MSBuildProperty) GetProperty (name);
+ var isDefault = value.CanonicalPath == defaultValue.CanonicalPath;
+ if (isDefault) {
+ // if the value is default, only remove the property if it was not already the default
+ // to avoid unnecessary project file churn
+ if (prop != null && (defaultValue == null || defaultValue != prop.GetPathValue (relativeToProject, relativeToPath)))
+ RemoveProperty (prop);
+ return;
+ }
+ if (prop == null)
+ prop = AddProperty (name);
+ prop.SetValue (value, relativeToProject, relativeToPath);
+ prop.HasDefaultValue = isDefault;
+ }
+
+ void IPropertySet.SetValue (string name, object value, object defaultValue, bool mergeToMainGroup, string condition)
+ {
+ SetValue (name, value, defaultValue);
+ }
+
+ public void SetValue (string name, object value, object defaultValue = null)
+ {
+ var prop = (MSBuildProperty) GetProperty (name);
+ var isDefault = object.Equals (value, defaultValue);
+ if (isDefault) {
+ // if the value is default, only remove the property if it was not already the default
+ // to avoid unnecessary project file churn
+ if (prop != null && (defaultValue == null || !object.Equals (defaultValue, prop.GetValue (defaultValue.GetType ()))))
+ RemoveProperty (prop);
+ return;
+ }
+ if (prop == null)
+ prop = AddProperty (name);
+ prop.SetValue (value);
+ prop.HasDefaultValue = isDefault;
+ }
+
+ public bool RemoveProperty (string name)
+ {
+ MSBuildProperty prop = (MSBuildProperty) GetProperty (name);
+ if (prop != null) {
+ RemoveProperty (prop);
+ return true;
+ }
+ return false;
+ }
+
+ public void RemoveProperty (MSBuildProperty prop)
+ {
+ if (properties != null) {
+ properties.Remove (prop.Name);
+ propertyList.Remove (prop);
+ }
+ }
+
+ public override string ToString()
+ {
+ string s = "[ProjectItemMetadata:";
+ foreach (MSBuildProperty prop in GetProperties ())
+ s += " " + prop.Name + "=" + prop.Value;
+ return s + "]";
+ }
+
+ public bool HasProperty (string name)
+ {
+ return properties != null && properties.ContainsKey (name);
+ }
+
+ List<string> propertyOrder;
+
+ public void SetPropertyOrder (params string[] propertyNames)
+ {
+ if (propertyOrder == null)
+ propertyOrder = new List<string> ();
+ int i = 0;
+ foreach (var name in propertyNames) {
+ if (i < propertyOrder.Count) {
+ var pos = propertyOrder.IndexOf (name, i);
+ if (pos != -1) {
+ i = pos + 1;
+ continue;
+ } else {
+ propertyOrder.Insert (i, name);
+ i++;
+ continue;
+ }
+ }
+ propertyOrder.Add (name);
+ i++;
+ }
+ }
+
+ public void RemoveAllProperties ()
+ {
+ if (properties != null) {
+ properties.Clear ();
+ propertyList.Clear ();
+ }
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectOperationContext.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectOperationContext.cs
index fee8155f60..e166be5c9d 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectOperationContext.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectOperationContext.cs
@@ -25,7 +25,6 @@
// THE SOFTWARE.
using System;
-using System.Collections.Generic;
namespace MonoDevelop.Projects
{
@@ -33,7 +32,7 @@ namespace MonoDevelop.Projects
{
public ProjectOperationContext ()
{
- GlobalProperties = new Dictionary<string,string> ();
+ GlobalProperties = new ProjectItemMetadata ();
}
public ProjectOperationContext (OperationContext other): this ()
@@ -42,14 +41,14 @@ namespace MonoDevelop.Projects
CopyFrom (other);
}
- public Dictionary<string,string> GlobalProperties { get; private set; }
+ public IPropertySet GlobalProperties { get; private set; }
public override void CopyFrom (OperationContext other)
{
base.CopyFrom (other);
var o = other as ProjectOperationContext;
if (o != null)
- GlobalProperties = new Dictionary<string,string> (o.GlobalProperties);
+ GlobalProperties = new ProjectItemMetadata ((ProjectItemMetadata) o.GlobalProperties);
}
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectParameters.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectParameters.cs
deleted file mode 100644
index 457111b18d..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectParameters.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// ProjectParameters.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using MonoDevelop.Core.Serialization;
-using MonoDevelop.Projects.Extensions;
-
-namespace MonoDevelop.Projects
-{
- [DataItem (FallbackType=typeof(UnknownProjectParameters))]
- public class ProjectParameters: ILoadController
- {
- DotNetProject parentProject;
-
- public ProjectParameters ()
- {
- ProjectExtensionUtil.LoadControl (this);
- }
-
- public virtual ProjectParameters Clone ()
- {
- return (ProjectParameters) MemberwiseClone ();
- }
-
- #region ILoadController implementation
- void ILoadController.BeginLoad ()
- {
- OnBeginLoad ();
- }
-
- void ILoadController.EndLoad ()
- {
- OnEndLoad ();
- }
- #endregion
-
- public DotNetProject ParentProject {
- get { return parentProject; }
- internal set { parentProject = value; }
- }
-
- protected virtual void OnBeginLoad ()
- {
- }
-
- protected virtual void OnEndLoad ()
- {
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectReference.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectReference.cs
index 17c21549e2..ccef1741a0 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectReference.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectReference.cs
@@ -37,6 +37,7 @@ using System.ComponentModel;
using MonoDevelop.Projects;
using MonoDevelop.Core.Serialization;
using MonoDevelop.Core.Assemblies;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.Projects
{
@@ -52,13 +53,13 @@ namespace MonoDevelop.Projects
/// <summary>
/// This class represent a reference information in an Project object.
/// </summary>
- [DataItem (FallbackType=typeof(UnknownProjectReference))]
public class ProjectReference : ProjectItem, ICloneable
{
ReferenceType referenceType = ReferenceType.Custom;
DotNetProject ownerProject;
string reference = String.Empty;
bool? localCopy;
+ string projectGuid;
// A project may reference assemblies which are not available
// in the system where it is opened. For example, opening
@@ -73,18 +74,23 @@ namespace MonoDevelop.Projects
string package;
SystemPackage cachedPackage;
string customError;
- string hintPath;
-
+ FilePath hintPath;
+ bool hasBeenRead;
+
+ string originalMSBuildReferenceHintPath;
+
public event EventHandler StatusChanged;
- [ItemProperty ("Package", DefaultValue="")]
+ [ItemProperty ("Package", DefaultValue=null)]
internal string packageName {
get {
+ if (!string.IsNullOrEmpty (package))
+ return package;
SystemPackage sp = Package;
if (sp != null && !sp.IsGacPackage)
return sp.Name;
else
- return string.Empty;
+ return null;
}
set {
package = value;
@@ -100,12 +106,73 @@ namespace MonoDevelop.Projects
ownerProject = project;
UpdatePackageReference ();
}
+
+ public sealed override string Include {
+ get {
+ if (referenceType == ReferenceType.Project && OwnerProject != null) {
+ Project refProj = OwnerProject.ParentSolution != null ? ResolveProject (OwnerProject.ParentSolution) : null;
+ if (refProj != null)
+ return MSBuildProjectService.ToMSBuildPath (OwnerProject.ItemDirectory, refProj.FileName);
+ else
+ return Reference;
+ }
+ return base.Include;
+ }
+ protected set { base.Include = value; }
+ }
+
+ ProjectReference (ReferenceType referenceType, string reference, string hintPath)
+ {
+ Init (referenceType, reference, hintPath);
+ }
- public ProjectReference (ReferenceType referenceType, string reference): this (referenceType, reference, null)
+ ProjectReference (Project referencedProject)
+ {
+ Init (ReferenceType.Project, referencedProject.Name, null, referencedProject.ItemId);
+ specificVersion = true;
+ }
+
+ ProjectReference (SystemAssembly asm)
+ {
+ Init (ReferenceType.Package, asm.FullName, null);
+ if (asm.Package.IsFrameworkPackage)
+ specificVersion = false;
+ if (!asm.Package.IsGacPackage)
+ package = asm.Package.Name;
+ UpdatePackageReference ();
+ }
+
+ public static ProjectReference CreateCustomReference (ReferenceType referenceType, string reference, string hintPath = null)
{
+ return new ProjectReference (referenceType, reference, hintPath);
}
- public ProjectReference (ReferenceType referenceType, string reference, string hintPath)
+ public static ProjectReference CreateAssemblyReference (SystemAssembly asm)
+ {
+ return new ProjectReference (asm);
+ }
+
+ public static ProjectReference CreateAssemblyReference (string assemblyName, string hintPath = null)
+ {
+ return new ProjectReference (ReferenceType.Package, assemblyName, hintPath);
+ }
+
+ public static ProjectReference CreateAssemblyFileReference (FilePath path)
+ {
+ return new ProjectReference (ReferenceType.Assembly, path, null);
+ }
+
+ public static ProjectReference CreateProjectReference (Project project)
+ {
+ return new ProjectReference (project);
+ }
+
+ public static ProjectReference CreateProjectReference (FilePath projectFile)
+ {
+ return new ProjectReference (ReferenceType.Project, projectFile.FileNameWithoutExtension, null);
+ }
+
+ void Init (ReferenceType referenceType, string reference, string hintPath, string projectGuid = null)
{
if (referenceType == ReferenceType.Assembly) {
specificVersion = false;
@@ -113,32 +180,158 @@ namespace MonoDevelop.Projects
hintPath = reference;
reference = Path.GetFileNameWithoutExtension (reference);
}
+
+ if (Include == null) {
+ if (File.Exists (HintPath)) {
+ try {
+ var aname = System.Reflection.AssemblyName.GetAssemblyName (HintPath);
+ if (SpecificVersion) {
+ Include = aname.FullName;
+ } else {
+ Include = aname.Name;
+ }
+ } catch (Exception ex) {
+ string msg = string.Format ("Could not get full name for assembly '{0}'.", Reference);
+ LoggingService.LogError (msg, ex);
+ }
+ }
+ if (Include == null)
+ Include = Path.GetFileNameWithoutExtension (hintPath);
+ }
+ }
+
+ switch (referenceType) {
+ case ReferenceType.Package:
+ case ReferenceType.Assembly:
+ ItemName = "Reference";
+ break;
+ case ReferenceType.Project:
+ ItemName = "ProjectReference";
+ break;
}
this.referenceType = referenceType;
this.reference = reference;
this.hintPath = hintPath;
+ this.projectGuid = projectGuid;
UpdatePackageReference ();
+
+ if (Include == null)
+ Include = reference;
}
-
- public ProjectReference (Project referencedProject)
+
+ internal protected override void Read (Project project, IMSBuildItemEvaluated buildItem)
{
- referenceType = ReferenceType.Project;
- reference = referencedProject.Name;
- specificVersion = true;
+ base.Read (project, buildItem);
+
+ if (buildItem.Name == "Reference")
+ ReadReference (project, buildItem);
+ else if (buildItem.Name == "ProjectReference")
+ ReadProjectReference (project, buildItem);
+
+ localCopy = buildItem.Metadata.GetValue<bool?> ("Private", null);
+ ReferenceOutputAssembly = buildItem.Metadata.GetValue ("ReferenceOutputAssembly", true);
}
-
- public ProjectReference (SystemAssembly asm)
+
+ void ReadReference (Project project, IMSBuildItemEvaluated buildItem)
{
- referenceType = ReferenceType.Package;
- reference = asm.FullName;
- if (asm.Package.IsFrameworkPackage)
- specificVersion = false;
- if (!asm.Package.IsGacPackage)
- package = asm.Package.Name;
- UpdatePackageReference ();
+ if (buildItem.Metadata.HasProperty ("HintPath")) {
+ FilePath path;
+ var p = buildItem.Metadata.GetProperty ("HintPath");
+ if (p != null)
+ originalMSBuildReferenceHintPath = p.UnevaluatedValue;
+ if (!buildItem.Metadata.TryGetPathValue ("HintPath", out path)) {
+ var hp = buildItem.Metadata.GetValue ("HintPath");
+ Init (ReferenceType.Assembly, hp, null);
+ SetInvalid (GettextCatalog.GetString ("Invalid file path"));
+ } else {
+ var type = File.Exists (path) ? ReferenceType.Assembly : ReferenceType.Package;
+ Init (type, buildItem.Include, path);
+ }
+ } else {
+ string asm = buildItem.Include;
+ // This is a workaround for a VS bug. Looks like it is writing this assembly incorrectly
+ if (asm == "System.configuration")
+ asm = "System.Configuration";
+ else if (asm == "System.XML")
+ asm = "System.Xml";
+ else if (asm == "system")
+ asm = "System";
+ Init (ReferenceType.Package, asm, null);
+ }
+
+ string specificVersion = buildItem.Metadata.GetValue ("SpecificVersion");
+ if (string.IsNullOrWhiteSpace (specificVersion)) {
+ // If the SpecificVersion element isn't present, check if the Assembly Reference specifies a Version
+ SpecificVersion = ReferenceStringHasVersion (buildItem.Include);
+ }
+ else {
+ bool value;
+ // if we can't parse the value, default to false which is more permissive
+ SpecificVersion = bool.TryParse (specificVersion, out value) && value;
+ }
+ hasBeenRead = true;
}
-
+
+ void ReadProjectReference (Project project, IMSBuildItemEvaluated buildItem)
+ {
+ // Get the project name from the path, since the Name attribute may other stuff other than the name
+ string path = MSBuildProjectService.FromMSBuildPath (project.ItemDirectory, buildItem.Include);
+ string name = buildItem.Metadata.GetValue ("Name", Path.GetFileNameWithoutExtension (path));
+ string projectGuid = buildItem.Metadata.GetValue ("Project");
+ Init (ReferenceType.Project, name, null, projectGuid);
+ }
+
+ internal protected override void Write (Project project, MSBuildItem buildItem)
+ {
+ // If the project is not supported, don't try to update any metadata of the property,
+ // just leave what was read
+ if (OwnerProject.IsUnsupportedProject)
+ return;
+
+ base.Write (project, buildItem);
+
+ if (ReferenceType == ReferenceType.Assembly) {
+ if (!hasBeenRead && !HintPath.IsNullOrEmpty)
+ buildItem.Metadata.SetValue ("HintPath", HintPath);
+
+ buildItem.Metadata.SetValue ("SpecificVersion", SpecificVersion || !ReferenceStringHasVersion (Include), true);
+ }
+ else if (ReferenceType == ReferenceType.Package) {
+ buildItem.Metadata.SetValue ("SpecificVersion", SpecificVersion || !ReferenceStringHasVersion (Include), true);
+
+ //RequiredTargetFramework is undocumented, maybe only a hint for VS. Only seems to be used for .NETFramework
+ var dnp = OwnerProject as DotNetProject;
+ IList supportedFrameworks = project.FileFormat.SupportedFrameworks;
+ if (supportedFrameworks != null && dnp != null && Package != null
+ && dnp.TargetFramework.Id.Identifier == TargetFrameworkMoniker.ID_NET_FRAMEWORK
+ && Package.IsFrameworkPackage && supportedFrameworks.Contains (Package.TargetFramework)
+ && Package.TargetFramework.Version != "2.0" && supportedFrameworks.Count > 1)
+ {
+ TargetFramework fx = Runtime.SystemAssemblyService.GetTargetFramework (Package.TargetFramework);
+ buildItem.Metadata.SetValue ("RequiredTargetFramework", fx.Id.Version);
+ } else {
+ buildItem.Metadata.RemoveProperty ("RequiredTargetFramework");
+ }
+ }
+ else if (ReferenceType == ReferenceType.Project) {
+ Project refProj = OwnerProject.ParentSolution != null ? ResolveProject (OwnerProject.ParentSolution) : null;
+ if (refProj != null) {
+ buildItem.Metadata.SetValue ("Project", refProj.ItemId, preserveExistingCase:true);
+ buildItem.Metadata.SetValue ("Name", refProj.Name);
+ buildItem.Metadata.SetValue ("ReferenceOutputAssembly", ReferenceOutputAssembly, true);
+ }
+ }
+
+ buildItem.Metadata.SetValue ("Private", LocalCopy, DefaultLocalCopy);
+ }
+
+ bool ReferenceStringHasVersion (string asmName)
+ {
+ int commaPos = asmName.IndexOf (',');
+ return commaPos >= 0 && asmName.IndexOf ("Version", commaPos) >= 0;
+ }
+
protected void InitCustomReference (string reference)
{
Reference = reference;
@@ -149,6 +342,7 @@ namespace MonoDevelop.Projects
{
ProjectReference newRef = (ProjectReference) pref.MemberwiseClone ();
newRef.reference = newReference;
+ newRef.Include = newReference;
return newRef;
}
@@ -267,8 +461,7 @@ namespace MonoDevelop.Projects
if (notFound) {
if (ownerProject != null) {
bool isDefaultRuntime = Runtime.SystemAssemblyService.DefaultRuntime == TargetRuntime;
- var hintPath = ExtendedProperties ["_OriginalMSBuildReferenceHintPath"] as string;
- bool probablyFrameworkAssembly = string.IsNullOrEmpty (hintPath);
+ bool probablyFrameworkAssembly = string.IsNullOrEmpty (originalMSBuildReferenceHintPath);
if (TargetRuntime.IsInstalled (TargetFramework) || !probablyFrameworkAssembly) {
if (isDefaultRuntime)
@@ -287,7 +480,7 @@ namespace MonoDevelop.Projects
}
} else if (ReferenceType == ReferenceType.Project) {
if (ownerProject != null && ownerProject.ParentSolution != null && ReferenceOutputAssembly) {
- DotNetProject p = ownerProject.ParentSolution.FindProjectByName (reference) as DotNetProject;
+ DotNetProject p = ResolveProject (ownerProject.ParentSolution) as DotNetProject;
if (p != null) {
if (!ownerProject.TargetFramework.CanReferenceAssembliesTargetingFramework (p.TargetFramework))
return GettextCatalog.GetString ("Incompatible target framework ({0})", p.TargetFramework.Name);
@@ -318,7 +511,7 @@ namespace MonoDevelop.Projects
}
}
- public string HintPath {
+ public FilePath HintPath {
get { return hintPath; }
}
@@ -345,12 +538,14 @@ namespace MonoDevelop.Projects
if (!string.IsNullOrEmpty (hintPath) && File.Exists (hintPath)) {
var res = (ProjectReference) MemberwiseClone ();
res.referenceType = ReferenceType.Assembly;
+ res.Project = null;
return res;
}
} else if (ReferenceType == ReferenceType.Assembly) {
if (!string.IsNullOrEmpty (hintPath) && !File.Exists (hintPath)) {
var res = (ProjectReference) MemberwiseClone ();
res.referenceType = ReferenceType.Package;
+ res.Project = null;
return res;
}
}
@@ -371,10 +566,10 @@ namespace MonoDevelop.Projects
string file = AssemblyContext.GetAssemblyLocation (Reference, package, ownerProject != null? ownerProject.TargetFramework : null);
return file == null ? reference : file;
case ReferenceType.Project:
- if (ownerProject != null) {
- if (ownerProject.ParentSolution != null) {
- Project p = ownerProject.ParentSolution.FindProjectByName (reference);
- if (p != null) return p.GetOutputFileName (configuration);
+ if (ownerProject != null && ownerProject.ParentSolution != null) {
+ var p = ResolveProject (ownerProject.ParentSolution);
+ if (p != null) {
+ return p.GetOutputFileName (configuration);
}
}
return null;
@@ -435,6 +630,14 @@ namespace MonoDevelop.Projects
reference = cref;
}
cachedPackage = null;
+
+ SystemPackage pkg = Package;
+ if (pkg != null && pkg.IsFrameworkPackage) {
+ int i = Include.IndexOf (',');
+ if (i != -1)
+ Include = Include.Substring (0, i).Trim ();
+ }
+
OnStatusChanged ();
}
}
@@ -471,9 +674,12 @@ namespace MonoDevelop.Projects
if (referenceType == ReferenceType.Package) {
if (cachedPackage != null)
return cachedPackage;
-
- if (package != null)
- return AssemblyContext.GetPackage (package);
+
+ if (!string.IsNullOrEmpty (package)) {
+ var p = AssemblyContext.GetPackage (package);
+ if (p != null)
+ return p;
+ }
// No package is specified, get any of the registered assemblies, giving priority to gaced assemblies
// (because non-gac assemblies should have a package name set)
@@ -549,6 +755,12 @@ namespace MonoDevelop.Projects
throw new ArgumentNullException ("inSolution");
if (ReferenceType != ReferenceType.Project)
throw new InvalidOperationException ("ResolveProject is only definied for Project reference type.");
+ if (!string.IsNullOrEmpty (projectGuid)) {
+ var project = inSolution.GetSolutionItem (projectGuid) as Project;
+ if (project != null) {
+ return project;
+ }
+ }
return inSolution.FindProjectByName (Reference);
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs
index ab4ca63590..8c0dc3ec33 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs
@@ -26,41 +26,31 @@
using System;
using System.Collections;
-using System.Collections.Specialized;
using System.Collections.Generic;
-using System.Diagnostics;
using System.IO;
using System.Xml;
-using System.CodeDom.Compiler;
-using System.Threading;
using MonoDevelop.Projects;
using MonoDevelop.Core.Serialization;
using MonoDevelop.Core;
using Mono.Addins;
-using MonoDevelop.Core;
using MonoDevelop.Core.ProgressMonitoring;
using MonoDevelop.Core.Execution;
using MonoDevelop.Core.Assemblies;
using MonoDevelop.Core.Instrumentation;
using MonoDevelop.Projects.Extensions;
using Mono.Unix;
-using MonoDevelop.Core.StringParsing;
using System.Linq;
-using MonoDevelop.Projects.Formats.MSBuild;
+using MonoDevelop.Projects.MSBuild;
+using System.Threading.Tasks;
namespace MonoDevelop.Projects
{
public class ProjectService
{
DataContext dataContext = new DataContext ();
- ArrayList projectBindings = new ArrayList ();
- ProjectServiceExtension defaultExtensionChain;
- DefaultProjectServiceExtension extensionChainTerminator = new DefaultProjectServiceExtension ();
-
- FileFormatManager formatManager = new FileFormatManager ();
- FileFormat defaultFormat;
+
TargetFramework defaultTargetFramework;
string defaultPlatformTarget = "x86";
@@ -69,99 +59,36 @@ namespace MonoDevelop.Projects
public const string BuildTarget = "Build";
public const string CleanTarget = "Clean";
- const string FileFormatsExtensionPath = "/MonoDevelop/ProjectModel/FileFormats";
const string SerializableClassesExtensionPath = "/MonoDevelop/ProjectModel/SerializableClasses";
- const string ExtendedPropertiesExtensionPath = "/MonoDevelop/ProjectModel/ExtendedProperties";
const string ProjectBindingsExtensionPath = "/MonoDevelop/ProjectModel/ProjectBindings";
-
+ const string WorkspaceObjectReadersPath = "/MonoDevelop/ProjectModel/WorkspaceObjectReaders";
+
+ internal const string ProjectModelExtensionsPath = "/MonoDevelop/ProjectModel/ProjectModelExtensions";
+
internal event EventHandler DataContextChanged;
- class ExtensionChainInfo
- {
- public ExtensionContext ExtensionContext;
- public ItemTypeCondition ItemTypeCondition;
- public ProjectLanguageCondition ProjectLanguageCondition;
- }
-
internal ProjectService ()
{
- AddinManager.AddExtensionNodeHandler (FileFormatsExtensionPath, OnFormatExtensionChanged);
AddinManager.AddExtensionNodeHandler (SerializableClassesExtensionPath, OnSerializableExtensionChanged);
- AddinManager.AddExtensionNodeHandler (ExtendedPropertiesExtensionPath, OnPropertiesExtensionChanged);
- AddinManager.AddExtensionNodeHandler (ProjectBindingsExtensionPath, OnProjectsExtensionChanged);
- AddinManager.ExtensionChanged += OnExtensionChanged;
-
- defaultFormat = formatManager.GetFileFormat (MSBuildProjectService.DefaultFormat);
}
public DataContext DataContext {
get { return dataContext; }
}
- public FileFormatManager FileFormats {
- get { return formatManager; }
- }
-
- internal ProjectServiceExtension GetExtensionChain (IBuildTarget target)
+ IEnumerable<WorkspaceObjectReader> GetObjectReaders ()
{
- ProjectServiceExtension chain;
- if (target != null) {
- lock (target) {
- ExtensionChainInfo einfo = (ExtensionChainInfo)target.ExtendedProperties [typeof(ExtensionChainInfo)];
- if (einfo == null) {
- einfo = new ExtensionChainInfo ();
- ExtensionContext ctx = AddinManager.CreateExtensionContext ();
- einfo.ExtensionContext = ctx;
- einfo.ItemTypeCondition = new ItemTypeCondition (target.GetType ());
- einfo.ProjectLanguageCondition = new ProjectLanguageCondition (target);
- ctx.RegisterCondition ("ItemType", einfo.ItemTypeCondition);
- ctx.RegisterCondition ("ProjectLanguage", einfo.ProjectLanguageCondition);
- target.ExtendedProperties [typeof(ExtensionChainInfo)] = einfo;
- } else {
- einfo.ItemTypeCondition.ObjType = target.GetType ();
- einfo.ProjectLanguageCondition.TargetProject = target;
- }
- ProjectServiceExtension[] extensions = einfo.ExtensionContext.GetExtensionObjects<ProjectServiceExtension> ("/MonoDevelop/ProjectModel/ProjectServiceExtensions");
- chain = CreateExtensionChain (extensions);
-
- // After creating the chain there is no need to keep the reference to the target
- einfo.ProjectLanguageCondition.TargetProject = null;
- }
- }
- else {
- if (defaultExtensionChain == null) {
- ExtensionContext ctx = AddinManager.CreateExtensionContext ();
- ctx.RegisterCondition ("ItemType", new ItemTypeCondition (typeof(UnknownItem)));
- ctx.RegisterCondition ("ProjectLanguage", new ProjectLanguageCondition (UnknownItem.Instance));
- ProjectServiceExtension[] extensions = ctx.GetExtensionObjects<ProjectServiceExtension> ("/MonoDevelop/ProjectModel/ProjectServiceExtensions");
- defaultExtensionChain = CreateExtensionChain (extensions);
- }
- chain = defaultExtensionChain;
- target = UnknownItem.Instance;
- }
-
- if (chain.SupportsItem (target))
- return chain;
- else
- return chain.GetNext (target);
+ return AddinManager.GetExtensionObjects<WorkspaceObjectReader> (WorkspaceObjectReadersPath);
}
-
- ProjectServiceExtension CreateExtensionChain (ProjectServiceExtension[] extensions)
- {
- var first = new CustomCommandExtension ();
-
- for (int n=0; n<extensions.Length - 1; n++)
- extensions [n].Next = extensions [n + 1];
- if (extensions.Length > 0) {
- extensions [extensions.Length - 1].Next = extensionChainTerminator;
- first.Next = extensions [0];
- } else {
- first.Next = extensionChainTerminator;
- }
- return first;
+ WorkspaceObjectReader GetObjectReaderForFile (FilePath file, Type type)
+ {
+ foreach (var r in GetObjectReaders ())
+ if (r.CanRead (file, type))
+ return r;
+ return null;
}
-
+
public string DefaultPlatformTarget {
get { return defaultPlatformTarget; }
set { defaultPlatformTarget = value; }
@@ -178,181 +105,112 @@ namespace MonoDevelop.Projects
}
}
- public FileFormat DefaultFileFormat {
- get { return defaultFormat; }
- }
-
- internal FileFormat GetDefaultFormat (object ob)
+ public async Task<SolutionItem> ReadSolutionItem (ProgressMonitor monitor, string file)
{
- if (defaultFormat.CanWrite (ob))
- return defaultFormat;
- FileFormat[] formats = FileFormats.GetFileFormatsForObject (ob);
- if (formats.Length == 0)
- throw new InvalidOperationException ("Can't handle objects of type '" + ob.GetType () + "'");
- return formats [0];
+ using (var ctx = new SolutionLoadContext (null))
+ return await ReadSolutionItem (monitor, file, null, null, null, ctx);
}
- public SolutionEntityItem ReadSolutionItem (IProgressMonitor monitor, string file)
+ public Task<SolutionItem> ReadSolutionItem (ProgressMonitor monitor, string file, MSBuildFileFormat format, string typeGuid = null, string itemGuid = null, SolutionLoadContext ctx = null)
{
- file = Path.GetFullPath (file);
- using (Counters.ReadSolutionItem.BeginTiming ("Read project " + file)) {
- file = GetTargetFile (file);
- SolutionEntityItem loadedItem = GetExtensionChain (null).LoadSolutionItem (monitor, file, delegate {
- FileFormat format;
- SolutionEntityItem item = ReadFile (monitor, file, typeof(SolutionEntityItem), out format) as SolutionEntityItem;
- if (item != null)
- item.FileFormat = format;
- else
- throw new InvalidOperationException ("Invalid file format: " + file);
- return item;
- });
- loadedItem.NeedsReload = false;
- return loadedItem;
- }
+ return Runtime.RunInMainThread (async delegate {
+ if (!File.Exists (file))
+ throw new IOException (GettextCatalog.GetString ("File not found: {0}", file));
+ file = Path.GetFullPath (file);
+ using (Counters.ReadSolutionItem.BeginTiming ("Read project " + file)) {
+ file = GetTargetFile (file);
+ var r = GetObjectReaderForFile (file, typeof(SolutionItem));
+ if (r == null)
+ throw new UnknownSolutionItemTypeException ();
+ SolutionItem loadedItem = await r.LoadSolutionItem (monitor, ctx, file, format, typeGuid, itemGuid);
+ if (loadedItem != null)
+ loadedItem.NeedsReload = false;
+ return loadedItem;
+ }
+ });
}
-
- public SolutionItem ReadSolutionItem (IProgressMonitor monitor, SolutionItemReference reference, params WorkspaceItem[] workspaces)
+
+ public Task<SolutionFolderItem> ReadSolutionItem (ProgressMonitor monitor, SolutionItemReference reference, params WorkspaceItem[] workspaces)
{
- if (reference.Id == null) {
- FilePath file = reference.Path.FullPath;
- foreach (WorkspaceItem workspace in workspaces) {
- foreach (SolutionEntityItem eitem in workspace.GetAllSolutionItems<SolutionEntityItem> ())
- if (file == eitem.FileName)
- return eitem;
- }
- return ReadSolutionItem (monitor, reference.Path);
- }
- else {
- Solution sol = null;
- if (workspaces.Length > 0) {
+ return Runtime.RunInMainThread (async delegate {
+ if (reference.Id == null) {
FilePath file = reference.Path.FullPath;
foreach (WorkspaceItem workspace in workspaces) {
- foreach (Solution item in workspace.GetAllSolutions ()) {
- if (item.FileName.FullPath == file) {
- sol = item;
- break;
+ foreach (SolutionItem eitem in workspace.GetAllItems<Solution>().SelectMany (s => s.GetAllSolutionItems ()))
+ if (file == eitem.FileName)
+ return eitem;
+ }
+ return await ReadSolutionItem (monitor, reference.Path);
+ } else {
+ Solution sol = null;
+ if (workspaces.Length > 0) {
+ FilePath file = reference.Path.FullPath;
+ foreach (WorkspaceItem workspace in workspaces) {
+ foreach (Solution item in workspace.GetAllItems<Solution>()) {
+ if (item.FileName.FullPath == file) {
+ sol = item;
+ break;
+ }
}
+ if (sol != null)
+ break;
}
- if (sol != null)
- break;
}
+ if (sol == null)
+ sol = await ReadWorkspaceItem (monitor, reference.Path) as Solution;
+
+ if (reference.Id == ":root:")
+ return sol.RootFolder;
+ else
+ return sol.GetSolutionItem (reference.Id);
}
- if (sol == null)
- sol = ReadWorkspaceItem (monitor, reference.Path) as Solution;
-
- if (reference.Id == ":root:")
- return sol.RootFolder;
- else
- return sol.GetSolutionItem (reference.Id);
- }
+ });
}
- public WorkspaceItem ReadWorkspaceItem (IProgressMonitor monitor, FilePath file)
- {
- string fullpath = file.ResolveLinks ().FullPath;
- using (Counters.ReadWorkspaceItem.BeginTiming ("Read solution " + file)) {
- fullpath = GetTargetFile (fullpath);
- WorkspaceItem item = GetExtensionChain (null).LoadWorkspaceItem (monitor, fullpath) as WorkspaceItem;
- if (item != null)
- item.NeedsReload = false;
- else
- throw new InvalidOperationException ("Invalid file format: " + file);
- return item;
- }
- }
-
- internal void InternalWriteSolutionItem (IProgressMonitor monitor, FilePath file, SolutionEntityItem item)
+ public Task<WorkspaceItem> ReadWorkspaceItem (ProgressMonitor monitor, FilePath file)
{
- var newFile = WriteFile (monitor, file, item, null);
- if (newFile != null)
- item.FileName = newFile;
- else
- throw new InvalidOperationException ("FileFormat not provided for solution item '" + item.Name + "'");
- }
-
- internal WorkspaceItem InternalReadWorkspaceItem (string file, IProgressMonitor monitor)
- {
- FileFormat format;
- WorkspaceItem item = ReadFile (monitor, file, typeof(WorkspaceItem), out format) as WorkspaceItem;
-
- if (item == null)
- throw new InvalidOperationException ("Invalid file format: " + file);
-
- if (!item.FormatSet)
- item.ConvertToFormat (format, false);
-
- return item;
- }
-
- internal void InternalWriteWorkspaceItem (IProgressMonitor monitor, FilePath file, WorkspaceItem item)
- {
- var newFile = WriteFile (monitor, file, item, item.FileFormat);
- if (newFile != null)
- item.FileName = newFile;
- else
- throw new InvalidOperationException ("FileFormat not provided for workspace item '" + item.Name + "'");
- }
-
- object ReadFile (IProgressMonitor monitor, string file, Type expectedType, out FileFormat format)
- {
- FileFormat[] formats = formatManager.GetFileFormats (file, expectedType);
-
- if (formats.Length == 0)
- throw new InvalidOperationException ("Unknown file format: " + file);
-
- format = formats [0];
- object obj = format.Format.ReadFile (file, expectedType, monitor);
- if (obj == null)
- throw new InvalidOperationException ("Invalid file format: " + file);
-
- return obj;
- }
-
- FilePath WriteFile (IProgressMonitor monitor, FilePath file, object item, FileFormat format)
- {
- if (format == null) {
- if (defaultFormat.CanWrite (item))
- format = defaultFormat;
- else {
- FileFormat[] formats = formatManager.GetFileFormatsForObject (item);
- format = formats.Length > 0 ? formats [0] : null;
+ return Runtime.RunInMainThread (async delegate {
+ if (!File.Exists (file))
+ throw new IOException (GettextCatalog.GetString ("File not found: {0}", file));
+ string fullpath = file.ResolveLinks ().FullPath;
+ using (Counters.ReadWorkspaceItem.BeginTiming ("Read solution " + file)) {
+ fullpath = GetTargetFile (fullpath);
+ var r = GetObjectReaderForFile (file, typeof(WorkspaceItem));
+ if (r == null)
+ throw new InvalidOperationException ("Invalid file format: " + file);
+ WorkspaceItem item = await r.LoadWorkspaceItem (monitor, fullpath);
+ if (item != null)
+ item.NeedsReload = false;
+ else
+ throw new InvalidOperationException ("Invalid file format: " + file);
+ return item;
}
-
- if (format == null)
- return null;
-
- file = format.GetValidFileName (item, file);
- }
-
- FileService.RequestFileEdit (file);
-
- format.Format.WriteFile (file, item, monitor);
- return file;
+ });
}
- public string Export (IProgressMonitor monitor, string rootSourceFile, string targetPath, FileFormat format)
+ public Task<string> Export (ProgressMonitor monitor, string rootSourceFile, string targetPath, MSBuildFileFormat format)
{
rootSourceFile = GetTargetFile (rootSourceFile);
return Export (monitor, rootSourceFile, null, targetPath, format);
}
- public string Export (IProgressMonitor monitor, string rootSourceFile, string[] includedChildIds, string targetPath, FileFormat format)
+ public async Task<string> Export (ProgressMonitor monitor, string rootSourceFile, string[] includedChildIds, string targetPath, MSBuildFileFormat format)
{
- IWorkspaceFileObject obj;
+ IMSBuildFileObject obj = null;
if (IsWorkspaceItemFile (rootSourceFile)) {
- obj = ReadWorkspaceItem (monitor, rootSourceFile) as Solution;
- } else {
- obj = ReadSolutionItem (monitor, rootSourceFile);
- if (obj == null)
- throw new InvalidOperationException ("File is not a solution or project.");
+ obj = (await ReadWorkspaceItem (monitor, rootSourceFile)) as IMSBuildFileObject;
+ } else if (IsSolutionItemFile (rootSourceFile)) {
+ obj = await ReadSolutionItem (monitor, rootSourceFile);
}
+ if (obj == null)
+ throw new InvalidOperationException ("File is not a solution or project.");
using (obj) {
- return Export (monitor, obj, includedChildIds, targetPath, format);
+ return await Export (monitor, obj, includedChildIds, targetPath, format);
}
}
- string Export (IProgressMonitor monitor, IWorkspaceFileObject obj, string[] includedChildIds, string targetPath, FileFormat format)
+ async Task<string> Export (ProgressMonitor monitor, IMSBuildFileObject obj, string[] includedChildIds, string targetPath, MSBuildFileFormat format)
{
string rootSourceFile = obj.FileName;
string sourcePath = Path.GetFullPath (Path.GetDirectoryName (rootSourceFile));
@@ -364,17 +222,17 @@ namespace MonoDevelop.Projects
string newFile = Path.Combine (targetPath, Path.GetFileName (rootSourceFile));
if (IsWorkspaceItemFile (rootSourceFile))
- obj = ReadWorkspaceItem (monitor, newFile);
+ obj = (Solution) await ReadWorkspaceItem (monitor, newFile);
else
- obj = (SolutionEntityItem) ReadSolutionItem (monitor, newFile);
+ obj = await ReadSolutionItem (monitor, newFile);
using (obj) {
- List<FilePath> oldFiles = obj.GetItemFiles (true);
+ var oldFiles = obj.GetItemFiles (true).ToList ();
ExcludeEntries (obj, includedChildIds);
if (format != null)
- obj.ConvertToFormat (format, true);
- obj.Save (monitor);
- List<FilePath> newFiles = obj.GetItemFiles (true);
+ obj.ConvertToFormat (format);
+ await obj.SaveAsync (monitor);
+ var newFiles = obj.GetItemFiles (true);
var resolvedTargetPath = new FilePath (targetPath).ResolveLinks ().FullPath;
foreach (FilePath f in newFiles) {
@@ -410,8 +268,8 @@ namespace MonoDevelop.Projects
using (obj) {
ExcludeEntries (obj, includedChildIds);
if (format != null)
- obj.ConvertToFormat (format, true);
- obj.Save (monitor);
+ obj.ConvertToFormat (format);
+ await obj.SaveAsync (monitor);
return obj.FileName;
}
}
@@ -427,14 +285,14 @@ namespace MonoDevelop.Projects
foreach (string it in includedChildIds)
childIds [it] = it;
- foreach (SolutionItem item in sol.GetAllSolutionItems<SolutionItem> ()) {
+ foreach (SolutionFolderItem item in sol.GetAllItems<SolutionFolderItem> ()) {
if (!childIds.ContainsKey (item.ItemId) && item.ParentFolder != null)
item.ParentFolder.Items.Remove (item);
}
}
}
- bool CopyFiles (IProgressMonitor monitor, IWorkspaceFileObject obj, IEnumerable<FilePath> files, FilePath targetBasePath, bool ignoreExternalFiles)
+ bool CopyFiles (ProgressMonitor monitor, IWorkspaceFileObject obj, IEnumerable<FilePath> files, FilePath targetBasePath, bool ignoreExternalFiles)
{
FilePath baseDir = obj.BaseDirectory.FullPath;
foreach (FilePath file in files) {
@@ -467,121 +325,69 @@ namespace MonoDevelop.Projects
return true;
}
- public bool CanCreateSingleFileProject (string file)
+ public DotNetProject CreateDotNetProject (string language, params string[] flavorGuids)
{
- foreach (ProjectBindingCodon projectBinding in projectBindings) {
- if (projectBinding.ProjectBinding.CanCreateSingleFileProject (file))
- return true;
- }
- return false;
+ string typeGuid = MSBuildProjectService.GetLanguageGuid (language);
+ return (DotNetProject) MSBuildProjectService.CreateProject (typeGuid, flavorGuids);
}
-
- public Project CreateSingleFileProject (string file)
+
+ public Project CreateProject (string typeGuid, params string[] flavorGuids)
{
- foreach (ProjectBindingCodon projectBinding in projectBindings) {
- if (projectBinding.ProjectBinding.CanCreateSingleFileProject (file)) {
- return projectBinding.ProjectBinding.CreateSingleFileProject (file);
- }
- }
- return null;
+ return MSBuildProjectService.CreateProject (typeGuid, flavorGuids);
}
-
- public Project CreateProject (string type, ProjectCreateInformation info, XmlElement projectOptions)
+
+ public Project CreateProject (string typeAlias, ProjectCreateInformation info, XmlElement projectOptions, params string[] flavorGuids)
{
- foreach (ProjectBindingCodon projectBinding in projectBindings) {
- if (projectBinding.ProjectBinding.Name == type) {
- Project project = projectBinding.ProjectBinding.CreateProject (info, projectOptions);
- return project;
- }
- }
- throw new InvalidOperationException ("Project type '" + type + "' not found");
+ return MSBuildProjectService.CreateProject (typeAlias, info, projectOptions, flavorGuids);
}
- public bool CanCreateProject (string type)
+ public bool CanCreateProject (string typeAlias, params string[] flavorGuids)
{
- foreach (ProjectBindingCodon projectBinding in projectBindings) {
- if (projectBinding.ProjectBinding.Name == type)
- return true;
- }
- return false;
+ return MSBuildProjectService.CanCreateProject (typeAlias, flavorGuids);
+ }
+
+ public bool CanCreateSolutionItem (string typeAlias, ProjectCreateInformation info, XmlElement projectOptions)
+ {
+ return MSBuildProjectService.CanCreateSolutionItem (typeAlias, info, projectOptions);
}
//TODO: find solution that contains the project if possible
- public Solution GetWrapperSolution (IProgressMonitor monitor, string filename)
+ public async Task<Solution> GetWrapperSolution (ProgressMonitor monitor, string filename)
{
// First of all, check if a solution with the same name already exists
- FileFormat[] formats = Services.ProjectService.FileFormats.GetFileFormats (filename, typeof(SolutionEntityItem));
- if (formats.Length == 0)
- formats = new [] { DefaultFileFormat };
-
- Solution tempSolution = new Solution ();
-
- FileFormat solutionFileFormat = formats.FirstOrDefault (f => f.CanWrite (tempSolution)) ?? DefaultFileFormat;
-
- string solFileName = solutionFileFormat.GetValidFileName (tempSolution, filename);
+ string solFileName = Path.ChangeExtension (filename, ".sln");
if (File.Exists (solFileName)) {
- return (Solution) Services.ProjectService.ReadWorkspaceItem (monitor, solFileName);
+ return (Solution) await Services.ProjectService.ReadWorkspaceItem (monitor, solFileName);
}
else {
// Create a temporary solution and add the project to the solution
- tempSolution.SetLocation (Path.GetDirectoryName (filename), Path.GetFileNameWithoutExtension (filename));
- SolutionEntityItem sitem = Services.ProjectService.ReadSolutionItem (monitor, filename);
- tempSolution.ConvertToFormat (solutionFileFormat, false);
+ SolutionItem sitem = await Services.ProjectService.ReadSolutionItem (monitor, filename);
+ Solution tempSolution = new Solution ();
+ tempSolution.FileName = solFileName;
+ tempSolution.ConvertToFormat (sitem.FileFormat);
tempSolution.RootFolder.Items.Add (sitem);
tempSolution.CreateDefaultConfigurations ();
- tempSolution.Save (monitor);
+ await tempSolution.SaveAsync (monitor);
return tempSolution;
}
}
- public bool IsSolutionItemFile (FilePath file)
- {
- return IsSolutionItemFileImpl (file.ToString ());
- }
-
- [Obsolete ("Use IsSolutionItemFile (FilePath file)")]
- public bool IsSolutionItemFile (string filename)
+ public bool FileIsObjectOfType (FilePath file, Type type)
{
- if (filename.StartsWith ("file://"))
- filename = new Uri(filename).LocalPath;
- return IsSolutionItemFileImpl (filename);
+ var filename = GetTargetFile (file);
+ return GetObjectReaderForFile (filename, type) != null;
}
- private bool IsSolutionItemFileImpl (string filename)
+ public bool IsSolutionItemFile (FilePath file)
{
- filename = GetTargetFile (filename);
- return GetExtensionChain (null).IsSolutionItemFile (filename);
+ return FileIsObjectOfType (file, typeof(SolutionItem));
}
public bool IsWorkspaceItemFile (FilePath file)
{
- return IsWorkspaceItemFileImpl (file.ToString ());
- }
-
- [Obsolete ("Use IsWorkspaceItemFile (FilePath file)")]
- public bool IsWorkspaceItemFile (string filename)
- {
- if (filename.StartsWith ("file://"))
- filename = new Uri(filename).LocalPath;
- return IsWorkspaceItemFileImpl (filename);
- }
-
- private bool IsWorkspaceItemFileImpl (string filename)
- {
- filename = GetTargetFile (filename);
- return GetExtensionChain (null).IsWorkspaceItemFile (filename);
- }
-
- internal bool IsSolutionItemFileInternal (string filename)
- {
- return formatManager.GetFileFormats (filename, typeof(SolutionItem)).Length > 0;
- }
-
- internal bool IsWorkspaceItemFileInternal (string filename)
- {
- return formatManager.GetFileFormats (filename, typeof(WorkspaceItem)).Length > 0;
+ return FileIsObjectOfType (file, typeof(WorkspaceItem));
}
internal void InitializeDataContext (DataContext ctx)
@@ -589,20 +395,8 @@ namespace MonoDevelop.Projects
foreach (DataTypeCodon dtc in AddinManager.GetExtensionNodes (SerializableClassesExtensionPath)) {
ctx.IncludeType (dtc.Addin, dtc.TypeName, dtc.ItemName);
}
- foreach (ItemPropertyCodon cls in AddinManager.GetExtensionNodes (ExtendedPropertiesExtensionPath)) {
- ctx.RegisterProperty (cls.Addin, cls.TypeName, cls.PropertyName, cls.PropertyTypeName, cls.External, cls.SkipEmpty);
- }
}
- void OnFormatExtensionChanged (object s, ExtensionNodeEventArgs args)
- {
- FileFormatNode node = (FileFormatNode) args.ExtensionNode;
- if (args.Change == ExtensionChange.Add)
- formatManager.RegisterFileFormat ((IFileFormat) args.ExtensionObject, node.Id, node.Name, node.CanDefault);
- else
- formatManager.UnregisterFileFormat ((IFileFormat) args.ExtensionObject);
- }
-
void OnSerializableExtensionChanged (object s, ExtensionNodeEventArgs args)
{
if (args.Change == ExtensionChange.Add) {
@@ -614,36 +408,7 @@ namespace MonoDevelop.Projects
if (DataContextChanged != null)
DataContextChanged (this, EventArgs.Empty);
}
-
- void OnPropertiesExtensionChanged (object s, ExtensionNodeEventArgs args)
- {
- if (args.Change == ExtensionChange.Add) {
- ItemPropertyCodon cls = (ItemPropertyCodon) args.ExtensionNode;
- DataContext.RegisterProperty (cls.Addin, cls.TypeName, cls.PropertyName, cls.PropertyTypeName, cls.External, cls.SkipEmpty);
- }
- else {
- ItemPropertyCodon cls = (ItemPropertyCodon) args.ExtensionNode;
- DataContext.UnregisterProperty (cls.Addin, cls.TypeName, cls.PropertyName);
- }
-
- if (DataContextChanged != null)
- DataContextChanged (this, EventArgs.Empty);
- }
-
- void OnProjectsExtensionChanged (object s, ExtensionNodeEventArgs args)
- {
- if (args.Change == ExtensionChange.Add)
- projectBindings.Add (args.ExtensionNode);
- else if (args.Change == ExtensionChange.Remove)
- projectBindings.Remove (args.ExtensionNode);
- }
-
- void OnExtensionChanged (object s, ExtensionEventArgs args)
- {
- if (args.PathChanged ("/MonoDevelop/ProjectModel/ProjectServiceExtensions"))
- defaultExtensionChain = null;
- }
-
+
string GetTargetFile (string file)
{
if (!Platform.IsWindows) {
@@ -658,194 +423,6 @@ namespace MonoDevelop.Projects
}
}
- internal class DefaultProjectServiceExtension: ProjectServiceExtension
- {
- Dictionary <SolutionItem,bool> needsBuildingCache;
-
- public override object GetService (SolutionItem item, Type type)
- {
- return item.OnGetService (type);
- }
-
- public override object GetService (WorkspaceItem item, Type type)
- {
- return item.OnGetService (type);
- }
-
- public override void Save (IProgressMonitor monitor, SolutionEntityItem entry)
- {
- FileService.RequestFileEdit (entry.GetItemFiles (false));
- entry.OnSave (monitor);
- }
-
- public override void Save (IProgressMonitor monitor, WorkspaceItem entry)
- {
- entry.OnSave (monitor);
- }
-
- public override List<FilePath> GetItemFiles (SolutionEntityItem entry, bool includeReferencedFiles)
- {
- return entry.OnGetItemFiles (includeReferencedFiles);
- }
-
- public override bool IsSolutionItemFile (string filename)
- {
- return Services.ProjectService.IsSolutionItemFileInternal (filename);
- }
-
- public override bool IsWorkspaceItemFile (string filename)
- {
- return Services.ProjectService.IsWorkspaceItemFileInternal (filename);
- }
-
- internal override SolutionEntityItem LoadSolutionItem (IProgressMonitor monitor, string fileName, ItemLoadCallback callback)
- {
- return callback (monitor, fileName);
- }
-
- public override WorkspaceItem LoadWorkspaceItem (IProgressMonitor monitor, string fileName)
- {
- return Services.ProjectService.InternalReadWorkspaceItem (fileName, monitor);
- }
-
- public override BuildResult RunTarget (IProgressMonitor monitor, IBuildTarget item, string target, ConfigurationSelector configuration)
- {
- BuildResult res;
- if (item is WorkspaceItem) {
- res = ((WorkspaceItem)item).OnRunTarget (monitor, target, configuration);
- }
- else if (item is SolutionItem)
- res = ((SolutionItem)item).OnRunTarget (monitor, target, configuration);
- else
- throw new InvalidOperationException ("Unknown item type: " + item);
-
- if (res != null)
- res.SourceTarget = item;
- return res;
- }
-
- public override bool SupportsTarget (IBuildTarget item, string target)
- {
- if (item is WorkspaceItem)
- return ((WorkspaceItem)item).OnGetSupportsTarget (target);
- else if (item is SolutionItem)
- return ((SolutionItem)item).OnGetSupportsTarget (target);
- else
- throw new InvalidOperationException ("Unknown item type: " + item);
- }
-
- public override bool SupportsExecute (IBuildTarget item)
- {
- if (item is WorkspaceItem)
- return ((WorkspaceItem)item).OnGetSupportsExecute ();
- else if (item is SolutionItem)
- return ((SolutionItem)item).OnGetSupportsExecute ();
- else
- throw new InvalidOperationException ("Unknown item type: " + item);
- }
-
- public override void Execute (IProgressMonitor monitor, IBuildTarget item, ExecutionContext context, ConfigurationSelector configuration)
- {
- if (item is SolutionEntityItem) {
- SolutionEntityItem entry = (SolutionEntityItem) item;
- SolutionItemConfiguration conf = entry.GetConfiguration (configuration) as SolutionItemConfiguration;
- if (conf != null && conf.CustomCommands.HasCommands (CustomCommandType.Execute)) {
- conf.CustomCommands.ExecuteCommand (monitor, entry, CustomCommandType.Execute, context, configuration);
- return;
- }
- entry.OnExecute (monitor, context, configuration);
- }
- else if (item is WorkspaceItem) {
- ((WorkspaceItem)item).OnExecute (monitor, context, configuration);
- }
- else if (item is SolutionItem)
- ((SolutionItem)item).OnExecute (monitor, context, configuration);
- else
- throw new InvalidOperationException ("Unknown item type: " + item);
- }
-
- public override bool CanExecute (IBuildTarget item, ExecutionContext context, ConfigurationSelector configuration)
- {
- if (item is SolutionEntityItem) {
- SolutionEntityItem entry = (SolutionEntityItem) item;
- SolutionItemConfiguration conf = entry.GetConfiguration (configuration) as SolutionItemConfiguration;
- if (conf != null && conf.CustomCommands.HasCommands (CustomCommandType.Execute))
- return conf.CustomCommands.CanExecute (entry, CustomCommandType.Execute, context, configuration);
- return entry.OnGetCanExecute (context, configuration);
- }
- else if (item is WorkspaceItem) {
- return ((WorkspaceItem)item).OnGetCanExecute (context, configuration);
- }
- else if (item is SolutionItem)
- return ((SolutionItem)item).OnGetCanExecute (context, configuration);
- else
- throw new InvalidOperationException ("Unknown item type: " + item);
- }
-
- public override IEnumerable<ExecutionTarget> GetExecutionTargets (IBuildTarget item, ConfigurationSelector configuration)
- {
- if (item is WorkspaceItem) {
- return ((WorkspaceItem)item).OnGetExecutionTargets (configuration);
- }
- else if (item is SolutionItem)
- return ((SolutionItem)item).OnGetExecutionTargets (configuration);
- else
- throw new InvalidOperationException ("Unknown item type: " + item);
- }
-
- public override bool GetNeedsBuilding (IBuildTarget item, ConfigurationSelector configuration)
- {
- if (item is SolutionItem) {
- SolutionItem entry = (SolutionItem) item;
- // This is a cache to avoid unneeded recursive calls to GetNeedsBuilding.
- bool cleanCache = false;
- if (needsBuildingCache == null) {
- needsBuildingCache = new Dictionary <SolutionItem,bool> ();
- cleanCache = true;
- } else {
- bool res;
- if (needsBuildingCache.TryGetValue (entry, out res))
- return res;
- }
-
- bool nb = entry.OnGetNeedsBuilding (configuration);
-
- needsBuildingCache [entry] = nb;
- if (cleanCache)
- needsBuildingCache = null;
- return nb;
- }
- else if (item is WorkspaceItem) {
- return ((WorkspaceItem)item).OnGetNeedsBuilding (configuration);
- }
- else
- throw new InvalidOperationException ("Unknown item type: " + item);
- }
-
- public override void SetNeedsBuilding (IBuildTarget item, bool val, ConfigurationSelector configuration)
- {
- if (item is SolutionItem) {
- SolutionItem entry = (SolutionItem) item;
- entry.OnSetNeedsBuilding (val, configuration);
- }
- else if (item is WorkspaceItem) {
- ((WorkspaceItem)item).OnSetNeedsBuilding (val, configuration);
- }
- else
- throw new InvalidOperationException ("Unknown item type: " + item);
- }
-
- internal override BuildResult Compile(IProgressMonitor monitor, SolutionEntityItem item, BuildData buildData, ItemCompileCallback callback)
- {
- return callback (monitor, item, buildData);
- }
-
- public override IEnumerable<string> GetReferencedAssemblies (DotNetProject project, ConfigurationSelector configuration, bool includeProjectReferences)
- {
- return project.OnGetReferencedAssemblies (configuration, includeProjectReferences);
- }
- }
-
internal static class Counters
{
public static Counter ItemsInMemory = InstrumentationService.CreateCounter ("Projects in memory", "Project Model");
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs
deleted file mode 100644
index 476081baf6..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectServiceExtension.cs
+++ /dev/null
@@ -1,468 +0,0 @@
-// ProjectServiceExtension.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2007 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-
-using System;
-using System.Collections.Generic;
-using MonoDevelop.Core;
-using MonoDevelop.Projects.Extensions;
-using MonoDevelop.Core.Execution;
-
-namespace MonoDevelop.Projects
-{
- public class ProjectServiceExtension
- {
- internal ProjectServiceExtension Next;
-
- Stack<ItemLoadCallback> loadCallbackStack = new Stack<ItemLoadCallback> ();
- Stack<ItemCompileCallback> compileCallbackStack = new Stack<ItemCompileCallback> ();
-
- internal ProjectServiceExtension GetNext (IBuildTarget item)
- {
- if (Next.SupportsItem (item))
- return Next;
- else
- return Next.GetNext (item);
- }
-
- public virtual bool SupportsItem (IBuildTarget item)
- {
- return true;
- }
-
- public virtual object GetService (SolutionItem item, Type type)
- {
- if (type.IsInstanceOfType (this))
- return this;
- else
- return GetNext (item).GetService (item, type);
- }
-
- public virtual object GetService (WorkspaceItem item, Type type)
- {
- if (type.IsInstanceOfType (this))
- return this;
- else
- return GetNext (item).GetService (item, type);
- }
-
- public virtual void Save (IProgressMonitor monitor, SolutionEntityItem item)
- {
- GetNext (item).Save (monitor, item);
- }
-
- public virtual void Save (IProgressMonitor monitor, WorkspaceItem item)
- {
- GetNext (item).Save (monitor, item);
- }
-
- public virtual List<FilePath> GetItemFiles (SolutionEntityItem item, bool includeReferencedFiles)
- {
- return GetNext (item).GetItemFiles (item, includeReferencedFiles);
- }
-
- public virtual bool IsSolutionItemFile (string fileName)
- {
- return GetNext (UnknownItem.Instance).IsSolutionItemFile (fileName);
- }
-
- public virtual bool IsWorkspaceItemFile (string fileName)
- {
- return GetNext (UnknownItem.Instance).IsWorkspaceItemFile (fileName);
- }
-
- internal virtual SolutionEntityItem LoadSolutionItem (IProgressMonitor monitor, string fileName, ItemLoadCallback callback)
- {
- loadCallbackStack.Push (callback);
- try {
- SolutionEntityItem res = LoadSolutionItem (monitor, fileName);
- return res;
- } finally {
- loadCallbackStack.Pop ();
- }
- }
-
- protected virtual SolutionEntityItem LoadSolutionItem (IProgressMonitor monitor, string fileName)
- {
- return GetNext (UnknownItem.Instance).LoadSolutionItem (monitor, fileName, loadCallbackStack.Peek ());
- }
-
- public virtual WorkspaceItem LoadWorkspaceItem (IProgressMonitor monitor, string fileName)
- {
- return GetNext (UnknownItem.Instance).LoadWorkspaceItem (monitor, fileName);
- }
-
- public virtual BuildResult RunTarget (IProgressMonitor monitor, IBuildTarget item, string target, ConfigurationSelector configuration)
- {
- if (target == ProjectService.BuildTarget)
- return Build (monitor, item, configuration);
- else if (target == ProjectService.CleanTarget) {
- Clean (monitor, item, configuration);
- return null;
- }
- else
- return GetNext (item).RunTarget (monitor, item, target, configuration);
- }
-
- public virtual bool SupportsTarget (IBuildTarget item, string target)
- {
- if (item is SolutionEntityItem)
- return SupportsTarget ((SolutionEntityItem)item, target);
- else if (item is WorkspaceItem)
- return SupportsTarget ((WorkspaceItem) item, target);
- else
- return GetNext (item).SupportsTarget (item, target);
- }
-
- protected virtual bool SupportsTarget (SolutionEntityItem item, string target)
- {
- return GetNext (item).SupportsTarget ((IBuildTarget) item, target);
- }
-
- protected virtual bool SupportsTarget (Solution solution, string target)
- {
- return GetNext (solution).SupportsTarget ((IBuildTarget) solution, target);
- }
-
- protected virtual bool SupportsTarget (WorkspaceItem item, string target)
- {
- if (item is Solution)
- return SupportsTarget ((Solution) item, target);
- else
- return GetNext (item).SupportsTarget ((IBuildTarget) item, target);
- }
-
- public virtual bool SupportsExecute (IBuildTarget item)
- {
- if (item is SolutionEntityItem)
- return SupportsExecute ((SolutionEntityItem)item);
- else if (item is WorkspaceItem)
- return SupportsExecute ((WorkspaceItem) item);
- else
- return GetNext (item).SupportsExecute (item);
- }
-
- protected virtual bool SupportsExecute (SolutionEntityItem item)
- {
- return GetNext (item).SupportsExecute ((IBuildTarget) item);
- }
-
- protected virtual bool SupportsExecute (Solution solution)
- {
- return GetNext (solution).SupportsExecute ((IBuildTarget) solution);
- }
-
- protected virtual bool SupportsExecute (WorkspaceItem item)
- {
- if (item is Solution)
- return SupportsExecute ((Solution) item);
- else
- return GetNext (item).SupportsExecute ((IBuildTarget) item);
- }
-
- protected virtual void Clean (IProgressMonitor monitor, IBuildTarget item, ConfigurationSelector configuration)
- {
- if (item is SolutionEntityItem)
- Clean (monitor, (SolutionEntityItem) item, configuration);
- else if (item is WorkspaceItem)
- Clean (monitor, (WorkspaceItem) item, configuration);
- else
- GetNext (item).RunTarget (monitor, item, ProjectService.CleanTarget, configuration);
- }
-
- protected virtual void Clean (IProgressMonitor monitor, SolutionEntityItem item, ConfigurationSelector configuration)
- {
- GetNext (item).RunTarget (monitor, item, ProjectService.CleanTarget, configuration);
- }
-
- protected virtual void Clean (IProgressMonitor monitor, Solution item, ConfigurationSelector configuration)
- {
- GetNext (item).RunTarget (monitor, item, ProjectService.CleanTarget, configuration);
- }
-
- protected virtual void Clean (IProgressMonitor monitor, WorkspaceItem item, ConfigurationSelector configuration)
- {
- if (item is Solution)
- Clean (monitor, (Solution) item, configuration);
- else
- GetNext (item).RunTarget (monitor, item, ProjectService.CleanTarget, configuration);
- }
-
- protected virtual BuildResult Build (IProgressMonitor monitor, IBuildTarget item, ConfigurationSelector configuration)
- {
- if (item is SolutionEntityItem)
- return Build (monitor, (SolutionEntityItem) item, configuration);
- if (item is WorkspaceItem)
- return Build (monitor, (WorkspaceItem) item, configuration);
- return GetNext (item).RunTarget (monitor, item, ProjectService.BuildTarget, configuration);
- }
-
- protected virtual BuildResult Build (IProgressMonitor monitor, SolutionEntityItem item, ConfigurationSelector configuration)
- {
- return GetNext (item).RunTarget (monitor, item, ProjectService.BuildTarget, configuration);
- }
-
- protected virtual BuildResult Build (IProgressMonitor monitor, WorkspaceItem item, ConfigurationSelector configuration)
- {
- if (item is Solution)
- return Build (monitor, (Solution) item, configuration);
- return GetNext (item).RunTarget (monitor, item, ProjectService.BuildTarget, configuration);
- }
-
- protected virtual BuildResult Build (IProgressMonitor monitor, Solution solution, ConfigurationSelector configuration)
- {
- return GetNext (solution).RunTarget (monitor, solution, ProjectService.BuildTarget, configuration);
- }
-
- public virtual void Execute (IProgressMonitor monitor, IBuildTarget item, ExecutionContext context, ConfigurationSelector configuration)
- {
- if (item is SolutionEntityItem)
- Execute (monitor, (SolutionEntityItem)item, context, configuration);
- else if (item is WorkspaceItem)
- Execute (monitor, (WorkspaceItem) item, context, configuration);
- else
- GetNext (item).Execute (monitor, item, context, configuration);
- }
-
- protected virtual void Execute (IProgressMonitor monitor, SolutionEntityItem item, ExecutionContext context, ConfigurationSelector configuration)
- {
- GetNext (item).Execute (monitor, (IBuildTarget) item, context, configuration);
- }
-
- protected virtual void Execute (IProgressMonitor monitor, Solution solution, ExecutionContext context, ConfigurationSelector configuration)
- {
- GetNext (solution).Execute (monitor, (IBuildTarget) solution, context, configuration);
- }
-
- protected virtual void Execute (IProgressMonitor monitor, WorkspaceItem item, ExecutionContext context, ConfigurationSelector configuration)
- {
- if (item is Solution)
- Execute (monitor, (Solution) item, context, configuration);
- else
- GetNext (item).Execute (monitor, (IBuildTarget) item, context, configuration);
- }
-
- public virtual bool CanExecute (IBuildTarget item, ExecutionContext context, ConfigurationSelector configuration)
- {
- if (item is SolutionEntityItem)
- return CanExecute ((SolutionEntityItem)item, context, configuration);
- else if (item is WorkspaceItem)
- return CanExecute ((WorkspaceItem) item, context, configuration);
- else
- return GetNext (item).CanExecute (item, context, configuration);
- }
-
- protected virtual bool CanExecute (SolutionEntityItem item, ExecutionContext context, ConfigurationSelector configuration)
- {
- return GetNext (item).CanExecute ((IBuildTarget) item, context, configuration);
- }
-
- protected virtual bool CanExecute (Solution solution, ExecutionContext context, ConfigurationSelector configuration)
- {
- return GetNext (solution).CanExecute ((IBuildTarget) solution, context, configuration);
- }
-
- protected virtual bool CanExecute (WorkspaceItem item, ExecutionContext context, ConfigurationSelector configuration)
- {
- if (item is Solution)
- return CanExecute ((Solution) item, context, configuration);
- else
- return GetNext (item).CanExecute ((IBuildTarget) item, context, configuration);
- }
-
- public virtual IEnumerable<ExecutionTarget> GetExecutionTargets (IBuildTarget item, ConfigurationSelector configuration)
- {
- if (item is SolutionEntityItem)
- return GetExecutionTargets ((SolutionEntityItem)item, configuration);
- else if (item is WorkspaceItem)
- return GetExecutionTargets ((WorkspaceItem) item, configuration);
- else
- return GetNext (item).GetExecutionTargets (item, configuration);
- }
-
- protected virtual IEnumerable<ExecutionTarget> GetExecutionTargets (SolutionEntityItem item, ConfigurationSelector configuration)
- {
- return GetNext (item).GetExecutionTargets ((IBuildTarget) item, configuration);
- }
-
- protected virtual IEnumerable<ExecutionTarget> GetExecutionTargets (Solution solution, ConfigurationSelector configuration)
- {
- return GetNext (solution).GetExecutionTargets ((IBuildTarget) solution, configuration);
- }
-
- protected virtual IEnumerable<ExecutionTarget> GetExecutionTargets (WorkspaceItem item, ConfigurationSelector configuration)
- {
- if (item is Solution)
- return GetExecutionTargets ((Solution) item, configuration);
- else
- return GetNext (item).GetExecutionTargets ((IBuildTarget) item, configuration);
- }
-
- public virtual bool GetNeedsBuilding (IBuildTarget item, ConfigurationSelector configuration)
- {
- if (item is SolutionEntityItem)
- return GetNeedsBuilding ((SolutionEntityItem) item, configuration);
- if (item is WorkspaceItem)
- return GetNeedsBuilding ((WorkspaceItem) item, configuration);
- return GetNext (item).GetNeedsBuilding (item, configuration);
- }
-
- protected virtual bool GetNeedsBuilding (SolutionEntityItem item, ConfigurationSelector configuration)
- {
- return GetNext (item).GetNeedsBuilding ((IBuildTarget) item, configuration);
- }
-
- protected virtual bool GetNeedsBuilding (Solution item, ConfigurationSelector configuration)
- {
- return GetNext (item).GetNeedsBuilding ((IBuildTarget) item, configuration);
- }
-
- protected virtual bool GetNeedsBuilding (WorkspaceItem item, ConfigurationSelector configuration)
- {
- if (item is Solution)
- return GetNeedsBuilding ((Solution) item, configuration);
- return GetNext (item).GetNeedsBuilding ((IBuildTarget) item, configuration);
- }
-
- public virtual void SetNeedsBuilding (IBuildTarget item, bool val, ConfigurationSelector configuration)
- {
- if (item is SolutionEntityItem)
- SetNeedsBuilding ((SolutionEntityItem) item, val, configuration);
- else if (item is WorkspaceItem)
- SetNeedsBuilding ((WorkspaceItem) item, val, configuration);
- else
- GetNext (item).SetNeedsBuilding (item, val, configuration);
- }
-
- protected virtual void SetNeedsBuilding (SolutionEntityItem item, bool val, ConfigurationSelector configuration)
- {
- GetNext (item).SetNeedsBuilding ((IBuildTarget) item, val, configuration);
- }
-
- protected virtual void SetNeedsBuilding (Solution item, bool val, ConfigurationSelector configuration)
- {
- GetNext (item).SetNeedsBuilding ((IBuildTarget) item, val, configuration);
- }
-
- protected virtual void SetNeedsBuilding (WorkspaceItem item, bool val, ConfigurationSelector configuration)
- {
- if (item is Solution)
- SetNeedsBuilding ((Solution) item, val, configuration);
- else
- GetNext (item).SetNeedsBuilding ((IBuildTarget) item, val, configuration);
- }
-
- internal virtual BuildResult Compile (IProgressMonitor monitor, SolutionEntityItem item, BuildData buildData, ItemCompileCallback callback)
- {
- compileCallbackStack.Push (callback);
- try {
- BuildResult res = Compile (monitor, item, buildData);
- return res;
- } finally {
- compileCallbackStack.Pop ();
- }
- }
-
- protected virtual BuildResult Compile (IProgressMonitor monitor, SolutionEntityItem item, BuildData buildData)
- {
- return GetNext (item).Compile (monitor, item, buildData, compileCallbackStack.Peek ());
- }
-
- public virtual IEnumerable<string> GetReferencedAssemblies (DotNetProject project, ConfigurationSelector configuration, bool includeProjectReferences)
- {
- return GetNext (project).GetReferencedAssemblies (project, configuration, includeProjectReferences);
- }
- }
-
- public class BuildData
- {
- public ProjectItemCollection Items { get; internal set; }
- public DotNetProjectConfiguration Configuration { get; internal set; }
- public ConfigurationSelector ConfigurationSelector { get; internal set; }
- }
-
- class UnknownItem: IBuildTarget
- {
- public static UnknownItem Instance = new UnknownItem ();
-
- public BuildResult RunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration)
- {
- return new BuildResult ();
- }
-
- public void Execute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
- {
- throw new System.NotImplementedException();
- }
-
- public bool CanExecute (ExecutionContext context, ConfigurationSelector configuration)
- {
- return false;
- }
-
- public bool SupportsTarget (string target)
- {
- return false;
- }
-
- public bool NeedsBuilding (ConfigurationSelector configuration)
- {
- return false;
- }
-
- public void SetNeedsBuilding (bool needsBuilding, ConfigurationSelector configuration)
- {
- }
-
- public void Save (IProgressMonitor monitor)
- {
- }
-
- public string Name {
- get { return "Unknown"; }
- set { }
- }
-
-
- public FilePath ItemDirectory {
- get { return FilePath.Empty; }
- }
-
- public FilePath BaseDirectory {
- get { return FilePath.Empty; }
- set { }
- }
-
- public void Dispose ()
- {
- }
-
- public System.Collections.IDictionary ExtendedProperties {
- get { return null; }
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SimpleProjectItem.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SimpleProjectItem.cs
deleted file mode 100644
index 633e82f83d..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SimpleProjectItem.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// SimpleProjectItem.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using MonoDevelop.Core.Serialization;
-
-namespace MonoDevelop.Projects
-{
- public class SimpleProjectItem: ProjectItem
- {
- [ItemProperty ("Include")]
- public string Include { get; set; }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Solution.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Solution.cs
index 5b8217ddfa..05a406c308 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Solution.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Solution.cs
@@ -36,18 +36,23 @@ using MonoDevelop.Core;
using MonoDevelop.Core.ProgressMonitoring;
using MonoDevelop.Core.StringParsing;
using MonoDevelop.Projects.Policies;
+using MonoDevelop.Core.Execution;
+using System.Threading.Tasks;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.Projects
{
[ProjectModelDataItem]
- public class Solution: WorkspaceItem, IConfigurationTarget, IPolicyProvider
+ public class Solution: WorkspaceItem, IConfigurationTarget, IPolicyProvider, IBuildTarget, IMSBuildFileObject
{
internal object MemoryProbe = Counters.SolutionsInMemory.CreateMemoryProbe ();
SolutionFolder rootFolder;
string defaultConfiguration;
-
- SolutionEntityItem startupItem;
- List<SolutionEntityItem> startupItems;
+ MSBuildFileFormat format;
+ bool loadingFromConstructor;
+
+ SolutionItem startupItem;
+ List<SolutionItem> startupItems;
bool singleStartup = true;
// Used for serialization only
@@ -56,6 +61,8 @@ namespace MonoDevelop.Projects
ReadOnlyCollection<SolutionItem> solutionItems;
SolutionConfigurationCollection configurations;
+
+ MSBuildEngineManager msbuildEngineManager = new MSBuildEngineManager ();
[ItemProperty ("description", DefaultValue = "")]
string description;
@@ -66,12 +73,55 @@ namespace MonoDevelop.Projects
[ProjectPathItemProperty ("outputpath")]
string outputdir = null;
- public Solution ()
+ public Solution (): this (false)
{
+ }
+
+ internal Solution (bool loading)
+ {
+ loadingFromConstructor = loading;
Counters.SolutionsLoaded++;
configurations = new SolutionConfigurationCollection (this);
+ format = MSBuildFileFormat.DefaultFormat;
+ Initialize (this);
}
-
+
+ public override FilePath FileName {
+ [ThreadSafe] get {
+ return base.FileName;
+ }
+ set {
+ AssertMainThread ();
+ if (FileFormat != null)
+ value = FileFormat.GetValidFormatName (this, value);
+ base.FileName = value;
+ }
+ }
+
+ internal HashSet<string> LoadedProjects {
+ get;
+ set;
+ }
+
+ protected override void OnExtensionChainInitialized ()
+ {
+ itemExtension = ExtensionChain.GetExtension<SolutionExtension> ();
+ base.OnExtensionChainInitialized ();
+
+ if (!loadingFromConstructor)
+ NotifyItemReady ();
+ }
+
+ SolutionExtension itemExtension;
+
+ SolutionExtension SolutionExtension {
+ get {
+ if (itemExtension == null)
+ AssertExtensionChainCreated ();
+ return itemExtension;
+ }
+ }
+
public SolutionFolder RootFolder {
get {
if (rootFolder == null) {
@@ -85,6 +135,10 @@ namespace MonoDevelop.Projects
}
}
+ internal MSBuildEngineManager MSBuildEngineManager {
+ get { return msbuildEngineManager; }
+ }
+
/// <summary>
/// Folder where to add solution files, when none is created
/// </summary>
@@ -103,18 +157,13 @@ namespace MonoDevelop.Projects
// Does not include solution folders
public ReadOnlyCollection<SolutionItem> Items {
get {
- if (solutionItems == null) {
- List<SolutionItem> list = new List<SolutionItem> ();
- foreach (SolutionItem item in GetAllSolutionItems ())
- if (!(item is SolutionFolder))
- list.Add (item);
- solutionItems = list.AsReadOnly ();
- }
+ if (solutionItems == null)
+ solutionItems = GetAllSolutionItems ().ToList().AsReadOnly ();
return solutionItems;
}
}
- public SolutionEntityItem StartupItem {
+ public SolutionItem StartupItem {
get {
if (startItemFileName != null) {
startupItem = FindSolutionItem (startItemFileName);
@@ -122,8 +171,8 @@ namespace MonoDevelop.Projects
singleStartup = true;
}
if (startupItem == null && singleStartup) {
- ReadOnlyCollection<SolutionEntityItem> its = GetAllSolutionItems<SolutionEntityItem> ();
- if (its.Count > 0)
+ var its = GetAllItems<SolutionItem> ();
+ if (its.Any ())
startupItem = its.FirstOrDefault (it => it.SupportsExecute ());
}
return startupItem;
@@ -161,12 +210,12 @@ namespace MonoDevelop.Projects
}
}
- public List<SolutionEntityItem> MultiStartupItems {
+ public List<SolutionItem> MultiStartupItems {
get {
if (multiStartupItems != null) {
- startupItems = new List<SolutionEntityItem> ();
+ startupItems = new List<SolutionItem> ();
foreach (string file in multiStartupItems) {
- SolutionEntityItem it = FindSolutionItem (file);
+ SolutionItem it = FindSolutionItem (file);
if (it != null)
startupItems.Add (it);
}
@@ -174,7 +223,7 @@ namespace MonoDevelop.Projects
singleStartup = false;
}
else if (startupItems == null)
- startupItems = new List<SolutionEntityItem> ();
+ startupItems = new List<SolutionItem> ();
return startupItems;
}
}
@@ -197,7 +246,7 @@ namespace MonoDevelop.Projects
if (multiStartupItems != null)
return multiStartupItems;
List<string> files = new List<string> ();
- foreach (SolutionEntityItem item in MultiStartupItems)
+ foreach (SolutionItem item in MultiStartupItems)
files.Add (item.FileName);
return files;
}
@@ -232,15 +281,20 @@ namespace MonoDevelop.Projects
}
}
- protected override void OnEndLoad ()
+ internal protected override async Task OnEndLoad ()
{
- base.OnEndLoad ();
+ await base.OnEndLoad ();
LoadItemProperties (UserProperties, RootFolder, "MonoDevelop.Ide.ItemProperties");
}
- public override void LoadUserProperties ()
+ internal protected override Task OnSave (ProgressMonitor monitor)
{
- base.LoadUserProperties ();
+ return FileFormat.WriteFile (FileName, this, monitor);
+ }
+
+ protected override async Task OnLoadUserProperties ()
+ {
+ await base.OnLoadUserProperties ();
var sitem = UserProperties.GetValue<string> ("StartupItem");
if (!string.IsNullOrEmpty (sitem))
startItemFileName = GetAbsoluteChildPath (sitem);
@@ -250,7 +304,7 @@ namespace MonoDevelop.Projects
multiStartupItems = sitems.Select (p => (string) GetAbsoluteChildPath (p)).ToList ();
}
- public override void SaveUserProperties ()
+ protected override async Task OnSaveUserProperties ()
{
UserProperties.SetValue ("StartupItem", (string) GetRelativeChildPath (StartupItemFileName));
if (MultiStartupItemFileNames != null) {
@@ -259,34 +313,34 @@ namespace MonoDevelop.Projects
UserProperties.RemoveValue ("StartupItems");
CollectItemProperties (UserProperties, RootFolder, "MonoDevelop.Ide.ItemProperties");
- base.SaveUserProperties ();
+ await base.OnSaveUserProperties ();
CleanItemProperties (UserProperties, RootFolder, "MonoDevelop.Ide.ItemProperties");
}
- void CollectItemProperties (PropertyBag props, SolutionItem item, string path)
+ void CollectItemProperties (PropertyBag props, SolutionFolderItem item, string path)
{
if (!item.UserProperties.IsEmpty && item.ParentFolder != null)
props.SetValue (path, item.UserProperties);
SolutionFolder sf = item as SolutionFolder;
if (sf != null) {
- foreach (SolutionItem ci in sf.Items)
+ foreach (SolutionFolderItem ci in sf.Items)
CollectItemProperties (props, ci, path + "." + ci.Name);
}
}
- void CleanItemProperties (PropertyBag props, SolutionItem item, string path)
+ void CleanItemProperties (PropertyBag props, SolutionFolderItem item, string path)
{
props.RemoveValue (path);
SolutionFolder sf = item as SolutionFolder;
if (sf != null) {
- foreach (SolutionItem ci in sf.Items)
+ foreach (SolutionFolderItem ci in sf.Items)
CleanItemProperties (props, ci, path + "." + ci.Name);
}
}
- void LoadItemProperties (PropertyBag props, SolutionItem item, string path)
+ void LoadItemProperties (PropertyBag props, SolutionFolderItem item, string path)
{
PropertyBag info = props.GetValue<PropertyBag> (path);
if (info != null) {
@@ -296,14 +350,14 @@ namespace MonoDevelop.Projects
SolutionFolder sf = item as SolutionFolder;
if (sf != null) {
- foreach (SolutionItem ci in sf.Items)
+ foreach (SolutionFolderItem ci in sf.Items)
LoadItemProperties (props, ci, path + "." + ci.Name);
}
}
public void CreateDefaultConfigurations ()
{
- foreach (SolutionEntityItem item in Items.Where (it => it.SupportsBuild ())) {
+ foreach (SolutionItem item in Items.Where (it => it.SupportsBuild ())) {
foreach (ItemConfiguration conf in item.Configurations) {
SolutionConfiguration sc = Configurations [conf.Id];
if (sc == null) {
@@ -315,17 +369,17 @@ namespace MonoDevelop.Projects
}
}
- ItemConfiguration IConfigurationTarget.CreateConfiguration (string name)
+ ItemConfiguration IConfigurationTarget.CreateConfiguration (string name, ConfigurationKind kind)
{
return new SolutionConfiguration (name);
}
- public SolutionConfiguration AddConfiguration (string name, bool createConfigForItems)
+ public SolutionConfiguration AddConfiguration (string id, bool createConfigForItems)
{
- SolutionConfiguration conf = new SolutionConfiguration (name);
- foreach (SolutionEntityItem item in Items.Where (it => it.SupportsBuild())) {
- if (createConfigForItems && item.GetConfiguration (new ItemConfigurationSelector (name)) == null) {
- SolutionItemConfiguration newc = item.CreateConfiguration (name);
+ SolutionConfiguration conf = new SolutionConfiguration (id);
+ foreach (SolutionItem item in Items.Where (it => it.SupportsBuild())) {
+ if (createConfigForItems && item.GetConfiguration (new ItemConfigurationSelector (id)) == null) {
+ SolutionItemConfiguration newc = item.CreateConfiguration (id);
if (item.DefaultConfiguration != null)
newc.CopyFrom (item.DefaultConfiguration);
item.Configurations.Add (newc);
@@ -344,20 +398,20 @@ namespace MonoDevelop.Projects
return configs.AsReadOnly ();
}
- public virtual SolutionConfiguration GetConfiguration (ConfigurationSelector configuration)
+ public SolutionConfiguration GetConfiguration (ConfigurationSelector configuration)
{
return (SolutionConfiguration) configuration.GetConfiguration (this) ?? DefaultConfiguration;
}
- public SolutionItem GetSolutionItem (string itemId)
+ public SolutionFolderItem GetSolutionItem (string itemId)
{
- foreach (SolutionItem item in Items)
+ foreach (SolutionFolderItem item in Items)
if (item.ItemId == itemId)
return item;
return null;
}
- public override SolutionEntityItem FindSolutionItem (string fileName)
+ public SolutionItem FindSolutionItem (string fileName)
{
return RootFolder.FindSolutionItem (fileName);
}
@@ -367,11 +421,31 @@ namespace MonoDevelop.Projects
return RootFolder.FindProjectByName (name);
}
- public override ReadOnlyCollection<T> GetAllSolutionItems<T> ()
+ public IEnumerable<SolutionItem> GetAllSolutionItems ()
{
- return RootFolder.GetAllItems<T> ();
+ return GetAllItems<SolutionItem> ();
}
-
+
+ public IEnumerable<Project> GetAllProjects ()
+ {
+ return GetAllItems<Project> ();
+ }
+
+ public IEnumerable<Project> GetAllProjectsWithFlavor<T> () where T:ProjectExtension
+ {
+ return GetAllItems<Project> ().Where (p => p.HasFlavor<T> ());
+ }
+
+ /// <summary>
+ /// Returns all flavor instances of the specified type that are implemented in projects of the solution
+ /// </summary>
+ /// <returns>All project flavors</returns>
+ /// <typeparam name="T">Type of the flavor</typeparam>
+ public IEnumerable<T> GetAllProjectFlavors<T> () where T:ProjectExtension
+ {
+ return GetAllItems<Project> ().Select (p => p.GetFlavor<T> ()).Where (p => p != null);
+ }
+
public ReadOnlyCollection<T> GetAllSolutionItemsWithTopologicalSort<T> (ConfigurationSelector configuration) where T: SolutionItem
{
return RootFolder.GetAllItemsWithTopologicalSort<T> (configuration);
@@ -382,28 +456,27 @@ namespace MonoDevelop.Projects
return RootFolder.GetAllProjectsWithTopologicalSort (configuration);
}
- [Obsolete("Use GetProjectsContainingFile() (plural) instead")]
- public override Project GetProjectContainingFile (FilePath fileName)
- {
- return RootFolder.GetProjectContainingFile (fileName);
- }
-
public override IEnumerable<Project> GetProjectsContainingFile (FilePath fileName)
{
return RootFolder.GetProjectsContainingFile (fileName);
}
- public override bool ContainsItem (IWorkspaceObject obj)
+ public override bool ContainsItem (WorkspaceObject obj)
{
if (base.ContainsItem (obj))
return true;
- foreach (SolutionItem it in GetAllSolutionItems<SolutionItem> ()) {
+ foreach (SolutionFolderItem it in GetAllItems<SolutionFolderItem> ()) {
if (it == obj)
return true;
}
return false;
}
+
+ protected override IEnumerable<WorkspaceObject> OnGetChildren ()
+ {
+ yield return RootFolder;
+ }
public string Description {
get {
@@ -491,7 +564,7 @@ namespace MonoDevelop.Projects
}
[ItemProperty ("Policies", IsExternal = true, SkipEmpty = true)]
- public MonoDevelop.Projects.Policies.PolicyBag Policies {
+ public PolicyBag Policies {
get { return RootFolder.Policies; }
//this is for deserialisation
internal set { RootFolder.Policies = value; }
@@ -509,18 +582,19 @@ namespace MonoDevelop.Projects
}
set {
version = value;
- foreach (SolutionEntityItem item in GetAllSolutionItems<SolutionEntityItem> ()) {
+ foreach (SolutionItem item in GetAllItems<SolutionItem> ()) {
if (item.SyncVersionWithSolution)
item.Version = value;
}
}
}
- public override void Dispose ()
+ protected override void OnDispose ()
{
- base.Dispose ();
RootFolder.Dispose ();
Counters.SolutionsLoaded--;
+ msbuildEngineManager.Dispose ();
+ base.OnDispose ();
}
internal bool IsSolutionItemEnabled (string solutionItemPath)
@@ -530,7 +604,7 @@ namespace MonoDevelop.Projects
return list == null || !list.Contains (solutionItemPath);
}
- public void SetSolutionItemEnabled (string solutionItemPath, bool enabled)
+ internal void SetSolutionItemEnabled (string solutionItemPath, bool enabled)
{
solutionItemPath = GetRelativeChildPath (Path.GetFullPath (solutionItemPath));
var list = UserProperties.GetValue<List<string>> ("DisabledProjects");
@@ -558,25 +632,100 @@ namespace MonoDevelop.Projects
}
}
}
-
- protected override BuildResult OnBuild (IProgressMonitor monitor, ConfigurationSelector configuration)
+
+ bool IBuildTarget.CanBuild (ConfigurationSelector configuration)
{
- return RootFolder.Build (monitor, configuration);
+ return true;
}
-
- protected override void OnClean (IProgressMonitor monitor, ConfigurationSelector configuration)
+
+ public Task<BuildResult> Clean (ProgressMonitor monitor, string configuration)
+ {
+ return Clean (monitor, (SolutionConfigurationSelector) configuration);
+ }
+
+ public async Task<BuildResult> Clean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext = null)
+ {
+ return await SolutionExtension.Clean (monitor, configuration, operationContext);
+ }
+
+ public async Task<BuildResult> Build (ProgressMonitor monitor, string configuration, OperationContext operationContext = null)
+ {
+ return await SolutionExtension.Build (monitor, (SolutionConfigurationSelector) configuration, operationContext);
+ }
+
+ Task<BuildResult> IBuildTarget.Build (ProgressMonitor monitor, ConfigurationSelector configuration, bool buildReferencedTargets, OperationContext operationContext)
+ {
+ return Build (monitor, configuration, operationContext);
+ }
+
+ public async Task<BuildResult> Build (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext = null)
+ {
+ return await SolutionExtension.Build (monitor, configuration, operationContext);
+ }
+
+ public bool NeedsBuilding (ConfigurationSelector configuration)
+ {
+ return SolutionExtension.NeedsBuilding (configuration);
+ }
+
+ public Task Execute (ProgressMonitor monitor, ExecutionContext context, string configuration)
+ {
+ return Execute (monitor, context, (SolutionConfigurationSelector) configuration);
+ }
+
+ public Task Execute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ {
+ return SolutionExtension.Execute (monitor, context, configuration);
+ }
+
+ public Task PrepareExecution (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ {
+ return SolutionExtension.PrepareExecution (monitor, context, configuration);
+ }
+
+ public bool CanExecute (ExecutionContext context, string configuration)
+ {
+ return CanExecute (context, (SolutionConfigurationSelector) configuration);
+ }
+
+ public bool CanExecute (ExecutionContext context, ConfigurationSelector configuration)
+ {
+ return SolutionExtension.CanExecute (context, configuration);
+ }
+
+ public IEnumerable<ExecutionTarget> GetExecutionTargets (string configuration)
+ {
+ return GetExecutionTargets ((SolutionConfigurationSelector) configuration);
+ }
+
+ public IEnumerable<ExecutionTarget> GetExecutionTargets (ConfigurationSelector configuration)
+ {
+ return SolutionExtension.GetExecutionTargets (this, configuration);
+ }
+
+ /*protected virtual*/ Task<BuildResult> OnBuild (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
+ {
+ return RootFolder.Build (monitor, configuration, operationContext:operationContext);
+ }
+
+ /*protected virtual*/ bool OnGetNeedsBuilding (ConfigurationSelector configuration)
+ {
+ return RootFolder.NeedsBuilding (configuration);
+ }
+
+ /*protected virtual*/ Task<BuildResult> OnClean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
- RootFolder.Clean (monitor, configuration);
+ return RootFolder.Clean (monitor, configuration, operationContext);
}
- protected internal override bool OnGetCanExecute(ExecutionContext context, ConfigurationSelector configuration)
+ /*protected virtual*/ bool OnGetCanExecute(ExecutionContext context, ConfigurationSelector configuration)
{
if (SingleStartup) {
if (StartupItem == null)
return false;
return StartupItem.CanExecute (context, configuration);
} else {
- foreach (SolutionEntityItem it in MultiStartupItems) {
+ foreach (SolutionItem it in MultiStartupItems) {
if (it.CanExecute (context, configuration))
return true;
}
@@ -584,73 +733,91 @@ namespace MonoDevelop.Projects
}
}
- protected internal override void OnExecute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ /*protected virtual*/ async Task OnExecute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
{
if (SingleStartup) {
if (StartupItem == null) {
monitor.ReportError (GettextCatalog.GetString ("Startup item not set"), null);
return;
}
- StartupItem.Execute (monitor, context, configuration);
+ await StartupItem.Execute (monitor, context, configuration);
} else {
- List<IAsyncOperation> list = new List<IAsyncOperation> ();
+ var tasks = new List<Task> ();
+ var monitors = new List<AggregatedProgressMonitor> ();
monitor.BeginTask ("Executing projects", 1);
- SynchronizedProgressMonitor syncMonitor = new SynchronizedProgressMonitor (monitor);
-
- foreach (SolutionEntityItem it in MultiStartupItems) {
+ foreach (SolutionItem it in MultiStartupItems) {
if (!it.CanExecute (context, configuration))
continue;
AggregatedProgressMonitor mon = new AggregatedProgressMonitor ();
- mon.AddSlaveMonitor (syncMonitor, MonitorAction.ReportError | MonitorAction.ReportWarning | MonitorAction.SlaveCancel);
- list.Add (mon.AsyncOperation);
- SolutionEntityItem cit = it;
-
- Thread t = new Thread (delegate () {
- try {
- using (mon) {
- cit.Execute (mon, context, configuration);
- }
- } catch (Exception ex) {
- LoggingService.LogError ("Project execution failed", ex);
- }
- });
- t.Name = "Project execution";
- t.IsBackground = true;
- t.Start ();
+ mon.AddFollowerMonitor (monitor, MonitorAction.ReportError | MonitorAction.ReportWarning | MonitorAction.FollowerCancel);
+ monitors.Add (mon);
+ tasks.Add (it.Execute (mon, context, configuration));
}
- foreach (IAsyncOperation op in list)
- op.WaitForCompleted ();
-
+ try {
+ await Task.WhenAll (tasks);
+ } catch (Exception ex) {
+ LoggingService.LogError ("Project execution failed", ex);
+ } finally {
+ foreach (var m in monitors)
+ m.Dispose ();
+ }
+
monitor.EndTask ();
}
}
- protected virtual void OnStartupItemChanged(EventArgs e)
+ /*protected virtual*/ Task OnPrepareExecution (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ {
+ return Task.FromResult (0);
+ }
+
+ /*protected virtual*/ void OnStartupItemChanged(EventArgs e)
{
if (StartupItemChanged != null)
StartupItemChanged (this, e);
}
-
- public override void ConvertToFormat (FileFormat format, bool convertChildren)
+
+ [ThreadSafe]
+ public MSBuildFileFormat FileFormat {
+ get {
+ return format;
+ }
+ internal set {
+ format = value;
+ }
+ }
+
+ public void ConvertToFormat (MSBuildFileFormat format)
{
- base.ConvertToFormat (format, convertChildren);
- foreach (SolutionItem item in GetAllSolutionItems<SolutionItem> ())
- ConvertToSolutionFormat (item, convertChildren);
+ SolutionExtension.OnSetFormat (format);
}
-
- public override bool SupportsFormat (FileFormat format)
+
+ [ThreadSafe]
+ public bool SupportsFormat (MSBuildFileFormat format)
{
- if (!base.SupportsFormat (format))
- return false;
- return GetAllSolutionItems<SolutionEntityItem> ().All (p => p.SupportsFormat (format));
+ return true;
+ }
+
+ void OnSetFormat (MSBuildFileFormat format)
+ {
+ this.format = format;
+ if (!string.IsNullOrEmpty (FileName))
+ FileName = format.GetValidFormatName (this, FileName);
+ foreach (SolutionItem item in GetAllItems<SolutionItem> ())
+ item.ConvertToFormat (format);
+ }
+
+ bool OnGetSupportsFormat (MSBuildFileFormat format)
+ {
+ return GetAllItems<SolutionItem> ().All (p => p.SupportsFormat (format));
}
- public override List<FilePath> GetItemFiles (bool includeReferencedFiles)
+ protected override IEnumerable<FilePath> OnGetItemFiles (bool includeReferencedFiles)
{
- List<FilePath> files = base.GetItemFiles (includeReferencedFiles);
+ List<FilePath> files = base.OnGetItemFiles (includeReferencedFiles).ToList ();
if (includeReferencedFiles) {
- foreach (SolutionEntityItem item in GetAllSolutionItems<SolutionEntityItem> ())
+ foreach (SolutionItem item in GetAllItems<SolutionItem> ())
files.AddRange (item.GetItemFiles (true));
}
return files;
@@ -658,13 +825,16 @@ namespace MonoDevelop.Projects
#region Notifications from children
- internal protected virtual void OnSolutionItemAdded (SolutionItemChangeEventArgs args)
+ internal /*protected virtual*/ void OnSolutionItemAdded (SolutionItemChangeEventArgs args)
{
+ if (IsShared)
+ args.Solution.SetShared ();
+
solutionItems = null;
SolutionFolder sf = args.SolutionItem as SolutionFolder;
if (sf != null) {
- foreach (SolutionItem eitem in sf.GetAllItems<SolutionItem> ())
+ foreach (SolutionFolderItem eitem in sf.GetAllItems<SolutionFolderItem> ())
SetupNewItem (eitem, null);
}
else {
@@ -675,12 +845,11 @@ namespace MonoDevelop.Projects
SolutionItemAdded (this, args);
}
- void SetupNewItem (SolutionItem item, SolutionItem replacedItem)
+ void SetupNewItem (SolutionFolderItem item, SolutionFolderItem replacedItem)
{
- ConvertToSolutionFormat (item, false);
-
- SolutionEntityItem eitem = item as SolutionEntityItem;
+ SolutionItem eitem = item as SolutionItem;
if (eitem != null) {
+ eitem.ConvertToFormat (FileFormat);
eitem.NeedsReload = false;
if (eitem.SupportsConfigurations () || replacedItem != null) {
if (replacedItem == null) {
@@ -693,11 +862,11 @@ namespace MonoDevelop.Projects
} else {
// Reuse the configuration information of the replaced item
foreach (SolutionConfiguration conf in Configurations)
- conf.ReplaceItem ((SolutionEntityItem)replacedItem, eitem);
+ conf.ReplaceItem ((SolutionItem)replacedItem, eitem);
if (StartupItem == replacedItem)
StartupItem = eitem;
else {
- int i = MultiStartupItems.IndexOf ((SolutionEntityItem)replacedItem);
+ int i = MultiStartupItems.IndexOf ((SolutionItem)replacedItem);
if (i != -1)
MultiStartupItems [i] = eitem;
}
@@ -706,27 +875,17 @@ namespace MonoDevelop.Projects
}
}
- void ConvertToSolutionFormat (SolutionItem item, bool force)
- {
- SolutionEntityItem eitem = item as SolutionEntityItem;
- if (force || !FileFormat.Format.SupportsMixedFormats || eitem == null || !eitem.IsSaved) {
- this.FileFormat.Format.ConvertToFormat (item);
- if (eitem != null)
- eitem.InstallFormat (this.FileFormat);
- }
- }
-
- internal protected virtual void OnSolutionItemRemoved (SolutionItemChangeEventArgs args)
+ internal /*protected virtual*/ void OnSolutionItemRemoved (SolutionItemChangeEventArgs args)
{
solutionItems = null;
SolutionFolder sf = args.SolutionItem as SolutionFolder;
if (sf != null) {
- foreach (SolutionEntityItem eitem in sf.GetAllItems<SolutionEntityItem> ())
+ foreach (SolutionItem eitem in sf.GetAllItems<SolutionItem> ())
DetachItem (eitem, args.Reloading);
}
else {
- SolutionEntityItem item = args.SolutionItem as SolutionEntityItem;
+ SolutionItem item = args.SolutionItem as SolutionItem;
if (item != null)
DetachItem (item, args.Reloading);
}
@@ -735,7 +894,7 @@ namespace MonoDevelop.Projects
SolutionItemRemoved (this, args);
}
- void DetachItem (SolutionEntityItem item, bool reloading)
+ void DetachItem (SolutionItem item, bool reloading)
{
item.NeedsReload = false;
if (!reloading) {
@@ -759,7 +918,7 @@ namespace MonoDevelop.Projects
if (projectToRemove == null)
return;
- foreach (DotNetProject project in GetAllSolutionItems <DotNetProject>()) {
+ foreach (DotNetProject project in GetAllItems <DotNetProject>()) {
if (project == projectToRemove)
continue;
@@ -775,67 +934,142 @@ namespace MonoDevelop.Projects
}
}
}
+
+ SolutionLoadContext currentLoadContext;
+
+ internal void ReadSolution (ProgressMonitor monitor)
+ {
+ var sln = new SlnFile ();
+ sln.Read (this.FileName);
+
+ using (currentLoadContext = new SolutionLoadContext (this))
+ SolutionExtension.OnReadSolution (monitor, sln);
+ currentLoadContext = null;
+ }
+
+ /*protected virtual*/ void OnReadSolution (ProgressMonitor monitor, SlnFile file)
+ {
+ FileFormat.SlnFileFormat.LoadSolution (this, file, monitor, currentLoadContext);
+ var s = file.Sections.GetSection ("MonoDevelopProperties", SlnSectionType.PreProcess);
+ if (s != null)
+ s.ReadObjectProperties (this);
+ }
+
+ internal void ReadConfigurationData (ProgressMonitor monitor, SlnPropertySet properties, SolutionConfiguration configuration)
+ {
+ SolutionExtension.OnReadConfigurationData (monitor, properties, configuration);
+ }
+
+ /*protected virtual*/ void OnReadConfigurationData (ProgressMonitor monitor, SlnPropertySet properties, SolutionConfiguration configuration)
+ {
+ // Do nothing by default
+ }
+
+ internal void ReadSolutionFolderItemData (ProgressMonitor monitor, SlnPropertySet properties, SolutionFolderItem item)
+ {
+ SolutionExtension.OnReadSolutionFolderItemData (monitor, properties, item);
+ }
+
+ /*protected virtual*/ void OnReadSolutionFolderItemData (ProgressMonitor monitor, SlnPropertySet properties, SolutionFolderItem item)
+ {
+ if (item is SolutionItem)
+ ((SolutionItem)item).ReadSolutionData (monitor, properties);
+ }
+
+ internal void WriteSolution (ProgressMonitor monitor, SlnFile file)
+ {
+ SolutionExtension.OnWriteSolution (monitor, file);
+ }
+ /*protected virtual*/ void OnWriteSolution (ProgressMonitor monitor, SlnFile file)
+ {
+ FileFormat.SlnFileFormat.WriteFileInternal (file, this, monitor);
+ var s = file.Sections.GetOrCreateSection ("MonoDevelopProperties", SlnSectionType.PreProcess);
+ s.SkipIfEmpty = true;
+ s.WriteObjectProperties (this);
+ }
+
+ internal void WriteConfigurationData (ProgressMonitor monitor, SlnPropertySet properties, SolutionConfiguration configuration)
+ {
+ SolutionExtension.OnWriteConfigurationData (monitor, properties, configuration);
+ }
+
+ /*protected virtual*/ void OnWriteConfigurationData (ProgressMonitor monitor, SlnPropertySet properties, SolutionConfiguration configuration)
+ {
+ // Do nothing by default
+ }
+
+ internal void WriteSolutionFolderItemData (ProgressMonitor monitor, SlnPropertySet properties, SolutionFolderItem item)
+ {
+ SolutionExtension.OnWriteSolutionFolderItemData (monitor, properties, item);
+ }
+
+ /*protected virtual*/ void OnWriteSolutionFolderItemData (ProgressMonitor monitor, SlnPropertySet properties, SolutionFolderItem item)
+ {
+ if (item is SolutionItem)
+ ((SolutionItem)item).WriteSolutionData (monitor, properties);
+ }
+
internal void NotifyConfigurationsChanged ()
{
OnConfigurationsChanged ();
}
- internal protected virtual void OnFileAddedToProject (ProjectFileEventArgs args)
+ internal /*protected virtual*/ void OnFileAddedToProject (ProjectFileEventArgs args)
{
if (FileAddedToProject != null)
FileAddedToProject (this, args);
}
- internal protected virtual void OnFileRemovedFromProject (ProjectFileEventArgs args)
+ internal /*protected virtual*/ void OnFileRemovedFromProject (ProjectFileEventArgs args)
{
if (FileRemovedFromProject != null)
FileRemovedFromProject (this, args);
}
- internal protected virtual void OnFileChangedInProject (ProjectFileEventArgs args)
+ internal /*protected virtual*/ void OnFileChangedInProject (ProjectFileEventArgs args)
{
if (FileChangedInProject != null)
FileChangedInProject (this, args);
}
- internal protected virtual void OnFilePropertyChangedInProject (ProjectFileEventArgs args)
+ internal /*protected virtual*/ void OnFilePropertyChangedInProject (ProjectFileEventArgs args)
{
if (FilePropertyChangedInProject != null)
FilePropertyChangedInProject (this, args);
}
- internal protected virtual void OnFileRenamedInProject (ProjectFileRenamedEventArgs args)
+ internal /*protected virtual*/ void OnFileRenamedInProject (ProjectFileRenamedEventArgs args)
{
if (FileRenamedInProject != null)
FileRenamedInProject (this, args);
}
- internal protected virtual void OnReferenceAddedToProject (ProjectReferenceEventArgs args)
+ internal /*protected virtual*/ void OnReferenceAddedToProject (ProjectReferenceEventArgs args)
{
if (ReferenceAddedToProject != null)
ReferenceAddedToProject (this, args);
}
- internal protected virtual void OnReferenceRemovedFromProject (ProjectReferenceEventArgs args)
+ internal /*protected virtual*/ void OnReferenceRemovedFromProject (ProjectReferenceEventArgs args)
{
if (ReferenceRemovedFromProject != null)
ReferenceRemovedFromProject (this, args);
}
- internal protected virtual void OnEntryModified (SolutionItemModifiedEventArgs args)
+ internal /*protected virtual*/ void OnEntryModified (SolutionItemModifiedEventArgs args)
{
if (EntryModified != null)
EntryModified (this, args);
}
- internal protected virtual void OnEntrySaved (SolutionItemEventArgs args)
+ internal /*protected virtual*/ void OnEntrySaved (SolutionItemEventArgs args)
{
if (EntrySaved != null)
EntrySaved (this, args);
}
- internal protected virtual void OnItemReloadRequired (SolutionItemEventArgs args)
+ /*protected virtual*/ void OnItemReloadRequired (SolutionItemEventArgs args)
{
if (ItemReloadRequired != null)
ItemReloadRequired (this, args);
@@ -858,6 +1092,94 @@ namespace MonoDevelop.Projects
public event SolutionItemModifiedEventHandler EntryModified;
public event SolutionItemEventHandler EntrySaved;
public event EventHandler<SolutionItemEventArgs> ItemReloadRequired;
+
+ protected override IEnumerable<WorkspaceObjectExtension> CreateDefaultExtensions ()
+ {
+ return base.CreateDefaultExtensions ().Concat (Enumerable.Repeat (new DefaultSolutionExtension (), 1));
+ }
+
+ internal class DefaultSolutionExtension: SolutionExtension
+ {
+ internal protected override IEnumerable<FilePath> GetItemFiles (bool includeReferencedFiles)
+ {
+ return Solution.OnGetItemFiles (includeReferencedFiles);
+ }
+
+ internal protected override Task<BuildResult> Build (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
+ {
+ return Solution.OnBuild (monitor, configuration, operationContext);
+ }
+
+ internal protected override bool NeedsBuilding (ConfigurationSelector configuration)
+ {
+ return Solution.OnGetNeedsBuilding (configuration);
+ }
+
+ internal protected override Task<BuildResult> Clean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
+ {
+ return Solution.OnClean (monitor, configuration, operationContext);
+ }
+
+ internal protected override Task Execute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ {
+ return Solution.OnExecute (monitor, context, configuration);
+ }
+
+ internal protected override Task PrepareExecution (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ {
+ return Solution.OnPrepareExecution (monitor, context, configuration);
+ }
+
+ internal protected override bool CanExecute (ExecutionContext context, ConfigurationSelector configuration)
+ {
+ return Solution.OnGetCanExecute (context, configuration);
+ }
+
+ internal protected override void OnReadSolution (ProgressMonitor monitor, SlnFile file)
+ {
+ Solution.OnReadSolution (monitor, file);
+ }
+
+ internal protected override void OnWriteSolution (ProgressMonitor monitor, SlnFile file)
+ {
+ Solution.OnWriteSolution (monitor, file);
+ }
+
+ internal protected override void OnWriteSolutionFolderItemData (ProgressMonitor monitor, SlnPropertySet properties, SolutionFolderItem item)
+ {
+ Solution.OnWriteSolutionFolderItemData (monitor, properties, item);
+ }
+
+ internal protected override void OnWriteConfigurationData (ProgressMonitor monitor, SlnPropertySet properties, SolutionConfiguration configuration)
+ {
+ Solution.OnWriteConfigurationData (monitor, properties, configuration);
+ }
+
+ internal protected override void OnReadConfigurationData (ProgressMonitor monitor, SlnPropertySet properties, SolutionConfiguration configuration)
+ {
+ Solution.OnReadConfigurationData (monitor, properties, configuration);
+ }
+
+ internal protected override void OnReadSolutionFolderItemData (ProgressMonitor monitor, SlnPropertySet properties, SolutionFolderItem item)
+ {
+ Solution.OnReadSolutionFolderItemData (monitor, properties, item);
+ }
+
+ internal protected override IEnumerable<ExecutionTarget> GetExecutionTargets (Solution solution, ConfigurationSelector configuration)
+ {
+ yield break;
+ }
+
+ internal protected override bool OnGetSupportsFormat (MSBuildFileFormat format)
+ {
+ return Solution.OnGetSupportsFormat (format);
+ }
+
+ internal protected override void OnSetFormat (MSBuildFileFormat value)
+ {
+ Solution.OnSetFormat (value);
+ }
+ }
}
[Mono.Addins.Extension]
@@ -881,4 +1203,22 @@ namespace MonoDevelop.Projects
throw new NotSupportedException ();
}
}
+
+ public class SolutionLoadContext: IDisposable
+ {
+ public SolutionLoadContext (Solution solution)
+ {
+ Solution = solution;
+ }
+
+ public event EventHandler LoadCompleted;
+
+ public Solution Solution { get; private set; }
+
+ void IDisposable.Dispose ()
+ {
+ if (LoadCompleted != null)
+ LoadCompleted (this, EventArgs.Empty);
+ }
+ }
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionConfiguration.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionConfiguration.cs
index dfa4bc6832..28fddf654e 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionConfiguration.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionConfiguration.cs
@@ -42,16 +42,12 @@ using MonoDevelop.Core;
namespace MonoDevelop.Projects
{
- public class SolutionConfiguration : ItemConfiguration
+ public sealed class SolutionConfiguration : ItemConfiguration
{
Solution parentSolution;
List<SolutionConfigurationEntry> configurations = new List<SolutionConfigurationEntry> ();
- public SolutionConfiguration ()
- {
- }
-
public SolutionConfiguration (string id): base (id)
{
}
@@ -73,7 +69,7 @@ namespace MonoDevelop.Projects
get { return configurations.AsReadOnly (); }
}
- public bool BuildEnabledForItem (SolutionEntityItem item)
+ public bool BuildEnabledForItem (SolutionItem item)
{
foreach (SolutionConfigurationEntry entry in configurations) {
if (entry.Item == item)
@@ -82,7 +78,7 @@ namespace MonoDevelop.Projects
return false;
}
- public string GetMappedConfiguration (SolutionEntityItem item)
+ public string GetMappedConfiguration (SolutionItem item)
{
foreach (SolutionConfigurationEntry entry in configurations) {
if (entry.Item == item)
@@ -91,7 +87,7 @@ namespace MonoDevelop.Projects
return null;
}
- public SolutionConfigurationEntry GetEntryForItem (SolutionEntityItem item)
+ public SolutionConfigurationEntry GetEntryForItem (SolutionItem item)
{
foreach (SolutionConfigurationEntry entry in configurations) {
if (entry.Item == item)
@@ -100,13 +96,13 @@ namespace MonoDevelop.Projects
return null;
}
- public SolutionConfigurationEntry AddItem (SolutionEntityItem item)
+ public SolutionConfigurationEntry AddItem (SolutionItem item)
{
string conf = FindMatchingConfiguration (item);
return AddItem (item, conf != null, conf);
}
- string FindMatchingConfiguration (SolutionEntityItem item)
+ string FindMatchingConfiguration (SolutionItem item)
{
SolutionItemConfiguration startupConfiguration = null;
@@ -153,7 +149,7 @@ namespace MonoDevelop.Projects
return item.Configurations [0].Id;
}
- public SolutionConfigurationEntry AddItem (SolutionEntityItem item, bool build, string itemConfiguration)
+ public SolutionConfigurationEntry AddItem (SolutionItem item, bool build, string itemConfiguration)
{
if (itemConfiguration == null)
itemConfiguration = Name;
@@ -166,7 +162,7 @@ namespace MonoDevelop.Projects
return conf;
}
- public void RemoveItem (SolutionEntityItem item)
+ public void RemoveItem (SolutionItem item)
{
for (int n=0; n<configurations.Count; n++) {
if (configurations [n].Item == item) {
@@ -176,7 +172,7 @@ namespace MonoDevelop.Projects
}
}
- internal void ReplaceItem (SolutionEntityItem oldItem, SolutionEntityItem newItem)
+ internal void ReplaceItem (SolutionItem oldItem, SolutionItem newItem)
{
foreach (var e in configurations.Where (ce => ce.Item == oldItem))
e.Item = newItem;
@@ -184,9 +180,9 @@ namespace MonoDevelop.Projects
parentSolution.UpdateDefaultConfigurations ();
}
- public override void CopyFrom (ItemConfiguration configuration)
+ protected override void OnCopyFrom (ItemConfiguration configuration, bool isRename)
{
- base.CopyFrom (configuration);
+ base.OnCopyFrom (configuration, isRename);
SolutionConfiguration conf = (SolutionConfiguration) configuration;
if (parentSolution == null)
@@ -203,7 +199,7 @@ namespace MonoDevelop.Projects
public class SolutionConfigurationEntry
{
- SolutionEntityItem item;
+ SolutionItem item;
SolutionConfiguration parentConfig;
[ItemProperty ("name")]
@@ -227,7 +223,7 @@ namespace MonoDevelop.Projects
this.deploy = other.deploy;
}
- internal SolutionConfigurationEntry (SolutionConfiguration parentConfig, SolutionEntityItem item)
+ internal SolutionConfigurationEntry (SolutionConfiguration parentConfig, SolutionItem item)
{
this.parentConfig = parentConfig;
this.item = item;
@@ -258,12 +254,12 @@ namespace MonoDevelop.Projects
set { deploy = value; }
}
- public SolutionEntityItem Item {
+ public SolutionItem Item {
get {
if (item == null && parentConfig != null) {
Solution sol = parentConfig.ParentSolution;
if (sol != null)
- item = sol.GetSolutionItem (itemId) as SolutionEntityItem;
+ item = sol.GetSolutionItem (itemId) as SolutionItem;
}
return item;
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionConfigurationCollection.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionConfigurationCollection.cs
index ecb8d59d36..c36a4e72ae 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionConfigurationCollection.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionConfigurationCollection.cs
@@ -47,22 +47,24 @@ namespace MonoDevelop.Projects
this.parentSolution = parentSolution;
}
- protected override void OnItemAdded (SolutionConfiguration conf)
+ protected override void OnItemsAdded (IEnumerable<SolutionConfiguration> confs)
{
if (parentSolution != null) {
- conf.ParentSolution = parentSolution;
+ foreach (var conf in confs)
+ conf.ParentSolution = parentSolution;
parentSolution.NotifyConfigurationsChanged ();
}
- base.OnItemAdded (conf);
+ base.OnItemsAdded (confs);
}
- protected override void OnItemRemoved (SolutionConfiguration conf)
+ protected override void OnItemsRemoved (IEnumerable<SolutionConfiguration> confs)
{
if (parentSolution != null) {
- conf.ParentSolution = null;
+ foreach (var conf in confs)
+ conf.ParentSolution = null;
parentSolution.NotifyConfigurationsChanged ();
}
- base.OnItemRemoved (conf);
+ base.OnItemsRemoved (confs);
}
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionConfigurationSelector.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionConfigurationSelector.cs
index 04beb91589..d85ee84db2 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionConfigurationSelector.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionConfigurationSelector.cs
@@ -26,7 +26,7 @@
namespace MonoDevelop.Projects
{
- public class SolutionConfigurationSelector: ConfigurationSelector
+ public sealed class SolutionConfigurationSelector: ConfigurationSelector
{
public string Id { get; private set; }
@@ -48,9 +48,9 @@ namespace MonoDevelop.Projects
public override ItemConfiguration GetConfiguration (IConfigurationTarget target)
{
ItemConfiguration sconf;
- if (target is SolutionEntityItem) {
+ if (target is SolutionItem) {
// Get the mapped configuration
- SolutionEntityItem item = (SolutionEntityItem) target;
+ SolutionItem item = (SolutionItem) target;
if (item.ParentSolution != null) {
SolutionConfiguration config = item.ParentSolution.Configurations [Id];
if (config != null) {
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionDataSectionAttribute.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionDataSectionAttribute.cs
new file mode 100644
index 0000000000..98e1d282eb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionDataSectionAttribute.cs
@@ -0,0 +1,44 @@
+//
+// SolutionDataSectionAttribute.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Projects.MSBuild;
+
+namespace MonoDevelop.Projects
+{
+ public class SolutionDataSectionAttribute: Attribute
+ {
+ public SolutionDataSectionAttribute (string sectionName, SlnSectionType processOrder = SlnSectionType.PostProcess)
+ {
+ SectionName = sectionName;
+ ProcessOrder = processOrder;
+ }
+
+ public string SectionName { get; set; }
+
+ public SlnSectionType ProcessOrder { get; set; }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionEntityItem.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionEntityItem.cs
deleted file mode 100644
index 12a6eb76c1..0000000000
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionEntityItem.cs
+++ /dev/null
@@ -1,654 +0,0 @@
-// SolutionEntityItem.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.Linq;
-using System.Xml;
-using System.IO;
-using System.Collections;
-using System.Collections.ObjectModel;
-using System.Collections.Specialized;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Diagnostics;
-using System.CodeDom.Compiler;
-
-using MonoDevelop.Core;
-using MonoDevelop.Projects;
-using MonoDevelop.Core.Serialization;
-using MonoDevelop.Projects.Extensions;
-using MonoDevelop.Core.StringParsing;
-
-namespace MonoDevelop.Projects
-{
- [ProjectModelDataItem (FallbackType = typeof(UnknownSolutionItem))]
- public abstract class SolutionEntityItem : SolutionItem, IConfigurationTarget, IWorkspaceFileObject
- {
- internal object MemoryProbe = Counters.ItemsInMemory.CreateMemoryProbe ();
-
- ProjectItemCollection items;
- ProjectItemCollection wildcardItems;
- ItemCollection<SolutionEntityItem> dependencies = new ItemCollection<SolutionEntityItem> ();
-
- SolutionItemEventArgs thisItemArgs;
-
- FileStatusTracker<SolutionItemEventArgs> fileStatusTracker;
-
- FilePath fileName;
- string name;
-
- FileFormat fileFormat;
-
- SolutionItemConfiguration activeConfiguration;
- SolutionItemConfigurationCollection configurations;
-
- public event EventHandler ConfigurationsChanged;
- public event ConfigurationEventHandler DefaultConfigurationChanged;
- public event ConfigurationEventHandler ConfigurationAdded;
- public event ConfigurationEventHandler ConfigurationRemoved;
- public event EventHandler<ProjectItemEventArgs> ProjectItemAdded;
- public event EventHandler<ProjectItemEventArgs> ProjectItemRemoved;
-
- public SolutionEntityItem ()
- {
- items = new ProjectItemCollection (this);
- wildcardItems = new ProjectItemCollection (this);
- thisItemArgs = new SolutionItemEventArgs (this);
- configurations = new SolutionItemConfigurationCollection (this);
- configurations.ConfigurationAdded += new ConfigurationEventHandler (OnConfigurationAddedToCollection);
- configurations.ConfigurationRemoved += new ConfigurationEventHandler (OnConfigurationRemovedFromCollection);
- Counters.ItemsLoaded++;
- fileStatusTracker = new FileStatusTracker<SolutionItemEventArgs> (this, OnReloadRequired, new SolutionItemEventArgs (this));
- }
-
- public override void Dispose ()
- {
- if (Disposed)
- return;
-
- Counters.ItemsLoaded--;
-
- foreach (var item in items.Concat (wildcardItems)) {
- IDisposable disp = item as IDisposable;
- if (disp != null)
- disp.Dispose ();
- }
-
- // items = null;
- // wildcardItems = null;
- // thisItemArgs = null;
- // fileStatusTracker = null;
- // fileFormat = null;
- // activeConfiguration = null;
- // configurations = null;
-
- base.Dispose ();
- }
-
- protected override void OnBoundToSolution ()
- {
- base.OnBoundToSolution ();
- ParentSolution.SolutionItemRemoved += HandleSolutionItemRemoved;
- ParentSolution.SolutionItemAdded += HandleSolutionItemAdded;
- }
-
- protected override void OnUnboundFromSolution ()
- {
- base.OnUnboundFromSolution ();
- ParentSolution.SolutionItemAdded -= HandleSolutionItemAdded;
- ParentSolution.SolutionItemRemoved -= HandleSolutionItemRemoved;
- }
-
- void HandleSolutionItemAdded (object sender, SolutionItemChangeEventArgs e)
- {
- if (e.Reloading && dependencies.Count > 0 && (e.SolutionItem is SolutionEntityItem) && (e.ReplacedItem is SolutionEntityItem)) {
- int i = dependencies.IndexOf ((SolutionEntityItem)e.ReplacedItem);
- if (i != -1)
- dependencies [i] = (SolutionEntityItem) e.SolutionItem;
- }
- }
-
- void HandleSolutionItemRemoved (object sender, SolutionItemChangeEventArgs e)
- {
- if (!e.Reloading && (e.SolutionItem is SolutionEntityItem))
- dependencies.Remove ((SolutionEntityItem)e.SolutionItem);
- }
-
-
- internal override void SetItemHandler (ISolutionItemHandler handler)
- {
- string oldName = Name;
- string oldFile = FileName;
-
- base.SetItemHandler (handler);
-
- // This will update the name if needed, when SyncFileName is true
- Name = oldName;
- if (!string.IsNullOrEmpty (oldFile))
- FileName = oldFile;
- }
-
- [ItemProperty ("ReleaseVersion", DefaultValue="0.1")]
- string releaseVersion = "0.1";
-
- [ItemProperty ("SynchReleaseVersion", DefaultValue = true)]
- bool syncReleaseVersion = true;
-
- public string Version {
- get {
- // If syncReleaseVersion is set, releaseVersion will already contain the solution's version
- // That's because the version must be up to date even when loading the project individually
- return releaseVersion;
- }
- set {
- releaseVersion = value;
- NotifyModified ("Version");
- }
- }
-
- public bool SyncVersionWithSolution {
- get {
- return syncReleaseVersion;
- }
- set {
- syncReleaseVersion = value;
- if (syncReleaseVersion && ParentSolution != null)
- Version = ParentSolution.Version;
- NotifyModified ("SyncVersionWithSolution");
- }
- }
-
- [ItemProperty ("name")]
- public override string Name {
- get {
- return name ?? string.Empty;
- }
- set {
- if (name == value)
- return;
- string oldName = name;
- name = value;
- if (!Loading && ItemHandler.SyncFileName) {
- if (string.IsNullOrEmpty (fileName))
- FileName = value;
- else {
- string ext = fileName.Extension;
- FileName = fileName.ParentDirectory.Combine (value) + ext;
- }
- }
- OnNameChanged (new SolutionItemRenamedEventArgs (this, oldName, name));
- }
- }
-
- public virtual FilePath FileName {
- get {
- return fileName;
- }
- set {
- fileName = value;
- if (FileFormat != null)
- fileName = FileFormat.GetValidFileName (this, fileName);
- if (ItemHandler.SyncFileName)
- Name = fileName.FileNameWithoutExtension;
- NotifyModified ("FileName");
- }
- }
-
- public bool Enabled {
- get { return ParentSolution != null ? ParentSolution.IsSolutionItemEnabled (FileName) : true; }
- set {
- if (ParentSolution != null)
- ParentSolution.SetSolutionItemEnabled (FileName, value);
- }
- }
-
- public FileFormat FileFormat {
- get {
- if (ParentSolution != null) {
- if (ParentSolution.FileFormat.Format.SupportsMixedFormats && fileFormat != null)
- return fileFormat;
- return ParentSolution.FileFormat;
- }
- if (fileFormat == null)
- fileFormat = Services.ProjectService.GetDefaultFormat (this);
- return fileFormat;
- }
- set {
- if (ParentSolution != null && !ParentSolution.FileFormat.Format.SupportsMixedFormats)
- throw new InvalidOperationException ("The file format can't be changed when the item belongs to a solution.");
- InstallFormat (value);
- fileFormat.Format.ConvertToFormat (this);
- NeedsReload = false;
- NotifyModified ("FileFormat");
- }
- }
-
- public virtual bool SupportsConfigurations ()
- {
- return SupportsBuild ();
- }
-
- public ProjectItemCollection Items {
- get { return items; }
- }
-
- internal ProjectItemCollection WildcardItems {
- get { return wildcardItems; }
- }
-
- /// <summary>
- /// Projects that need to be built before building this one
- /// </summary>
- /// <value>The dependencies.</value>
- public ItemCollection<SolutionEntityItem> ItemDependencies {
- get { return dependencies; }
- }
-
- public override IEnumerable<SolutionItem> GetReferencedItems (ConfigurationSelector configuration)
- {
- return base.GetReferencedItems (configuration).Concat (dependencies);
- }
-
- void IWorkspaceFileObject.ConvertToFormat (FileFormat format, bool convertChildren)
- {
- this.FileFormat = format;
- }
-
- public virtual bool SupportsFormat (FileFormat format)
- {
- return true;
- }
-
- internal void InstallFormat (FileFormat format)
- {
- fileFormat = format;
- if (fileName != FilePath.Null)
- fileName = fileFormat.GetValidFileName (this, fileName);
- }
-
- protected override void InitializeItemHandler ()
- {
- Services.ProjectService.GetDefaultFormat (this).Format.ConvertToFormat (this);
- }
-
- protected override FilePath GetDefaultBaseDirectory ( )
- {
- return FileName.IsNullOrEmpty ? FilePath.Empty : FileName.ParentDirectory;
- }
-
- public void Save (FilePath fileName, IProgressMonitor monitor)
- {
- FileName = fileName;
- Save (monitor);
- }
-
- public override void Save (IProgressMonitor monitor)
- {
- if (string.IsNullOrEmpty (FileName))
- throw new InvalidOperationException ("Project does not have a file name");
-
- try {
- fileStatusTracker.BeginSave ();
- Services.ProjectService.GetExtensionChain (this).Save (monitor, this);
- OnSaved (thisItemArgs);
- } finally {
- fileStatusTracker.EndSave ();
- }
- FileService.NotifyFileChanged (FileName);
- }
-
- protected override void OnEndLoad ()
- {
- base.OnEndLoad ();
- fileStatusTracker.ResetLoadTimes ();
-
- if (syncReleaseVersion && ParentSolution != null)
- releaseVersion = ParentSolution.Version;
- }
-
-
- internal bool IsSaved {
- get {
- return !string.IsNullOrEmpty (FileName) && File.Exists (FileName);
- }
- }
-
- public override bool NeedsReload {
- get { return fileStatusTracker.NeedsReload; }
- set { fileStatusTracker.NeedsReload = value; }
- }
-
- public virtual bool ItemFilesChanged {
- get { return fileStatusTracker.ItemFilesChanged; }
- }
-
- internal protected override BuildResult OnRunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration)
- {
- if (target == ProjectService.BuildTarget) {
- SolutionItemConfiguration conf = GetConfiguration (configuration) as SolutionItemConfiguration;
- if (conf != null && conf.CustomCommands.HasCommands (CustomCommandType.Build)) {
- conf.CustomCommands.ExecuteCommand (monitor, this, CustomCommandType.Build, configuration);
- return new BuildResult ();
- }
- } else if (target == ProjectService.CleanTarget) {
- SetFastBuildCheckDirty ();
- SolutionItemConfiguration config = GetConfiguration (configuration) as SolutionItemConfiguration;
- if (config != null && config.CustomCommands.HasCommands (CustomCommandType.Clean)) {
- config.CustomCommands.ExecuteCommand (monitor, this, CustomCommandType.Clean, configuration);
- return new BuildResult ();
- }
- }
-
- var result = base.OnRunTarget (monitor, target, configuration);
- if (!result.Failed && target == ProjectService.BuildTarget)
- SetFastBuildCheckClean (configuration);
- return result;
- }
-
- protected internal virtual void OnSave (IProgressMonitor monitor)
- {
- ItemHandler.Save (monitor);
- }
-
- [Obsolete ("This method will be removed in future releases")]
- public void SetNeedsBuilding (bool value)
- {
- // Nothing to be done
- }
-
- public FilePath GetAbsoluteChildPath (FilePath relPath)
- {
- return relPath.ToAbsolute (BaseDirectory);
- }
-
- public FilePath GetRelativeChildPath (FilePath absPath)
- {
- return absPath.ToRelative (BaseDirectory);
- }
-
- public List<FilePath> GetItemFiles (bool includeReferencedFiles)
- {
- return Services.ProjectService.GetExtensionChain (this).GetItemFiles (this, includeReferencedFiles);
- }
-
- internal protected virtual List<FilePath> OnGetItemFiles (bool includeReferencedFiles)
- {
- List<FilePath> col = FileFormat.Format.GetItemFiles (this);
- if (!string.IsNullOrEmpty (FileName) && !col.Contains (FileName))
- col.Add (FileName);
- return col;
- }
-
- protected override void OnNameChanged (SolutionItemRenamedEventArgs e)
- {
- Solution solution = this.ParentSolution;
-
- if (solution != null) {
- foreach (DotNetProject project in solution.GetAllSolutionItems<DotNetProject>()) {
- if (project == this)
- continue;
-
- project.RenameReferences (e.OldName, e.NewName);
- }
- }
- fileStatusTracker.ResetLoadTimes ();
- base.OnNameChanged (e);
- }
-
-
- #pragma warning disable 169
- [ItemProperty ("DisableFastUpToDateCheck", DefaultValue=false)]
- bool disableFastUpToDateCheck;
- #pragma warning restore 169
-
- //the configuration of the last build that completed successfully
- //null if any file in the project has since changed
- string fastUpToDateCheckGoodConfig;
-
- public virtual bool FastCheckNeedsBuild (ConfigurationSelector configuration)
- {
- if (disableFastUpToDateCheck || fastUpToDateCheckGoodConfig == null)
- return true;
- var cfg = GetConfiguration (configuration);
- return cfg == null || cfg.Id != fastUpToDateCheckGoodConfig;
- }
-
- protected void SetFastBuildCheckDirty ()
- {
- fastUpToDateCheckGoodConfig = null;
- }
-
- void SetFastBuildCheckClean (ConfigurationSelector configuration)
- {
- var cfg = GetConfiguration (configuration);
- fastUpToDateCheckGoodConfig = cfg != null ? cfg.Id : null;
- }
-
- protected virtual void OnSaved (SolutionItemEventArgs args)
- {
- SetFastBuildCheckDirty ();
-
- if (Saved != null)
- Saved (this, args);
- }
-
- public virtual string[] SupportedPlatforms {
- get {
- return new string [0];
- }
- }
-
- public virtual SolutionItemConfiguration GetConfiguration (ConfigurationSelector configuration)
- {
- return (SolutionItemConfiguration) configuration.GetConfiguration (this) ?? DefaultConfiguration;
- }
-
- ItemConfiguration IConfigurationTarget.DefaultConfiguration {
- get { return DefaultConfiguration; }
- set { DefaultConfiguration = (SolutionItemConfiguration) value; }
- }
-
- public SolutionItemConfiguration DefaultConfiguration {
- get {
- if (activeConfiguration == null && configurations.Count > 0) {
- return configurations[0];
- }
- return activeConfiguration;
- }
- set {
- if (activeConfiguration != value) {
- activeConfiguration = value;
- NotifyModified ("DefaultConfiguration");
- OnDefaultConfigurationChanged (new ConfigurationEventArgs (this, value));
- }
- }
- }
-
- public string DefaultConfigurationId {
- get {
- if (DefaultConfiguration != null)
- return DefaultConfiguration.Id;
- else
- return null;
- }
- set {
- DefaultConfiguration = GetConfiguration (new ItemConfigurationSelector (value));
- }
- }
-
- public virtual ReadOnlyCollection<string> GetConfigurations ()
- {
- List<string> configs = new List<string> ();
- foreach (SolutionItemConfiguration conf in Configurations)
- configs.Add (conf.Id);
- return configs.AsReadOnly ();
- }
-
- [ItemProperty ("Configurations")]
- [ItemProperty ("Configuration", ValueType=typeof(SolutionItemConfiguration), Scope="*")]
- public SolutionItemConfigurationCollection Configurations {
- get {
- return configurations;
- }
- }
-
- IItemConfigurationCollection IConfigurationTarget.Configurations {
- get {
- return Configurations;
- }
- }
-
- public SolutionItemConfiguration AddNewConfiguration (string name)
- {
- SolutionItemConfiguration config = CreateConfiguration (name);
- Configurations.Add (config);
- return config;
- }
-
- ItemConfiguration IConfigurationTarget.CreateConfiguration (string name)
- {
- return CreateConfiguration (name);
- }
-
- public virtual SolutionItemConfiguration CreateConfiguration (string name)
- {
- return new SolutionItemConfiguration (name);
- }
-
- void OnConfigurationAddedToCollection (object ob, ConfigurationEventArgs args)
- {
- NotifyModified ("Configurations");
- OnConfigurationAdded (new ConfigurationEventArgs (this, args.Configuration));
- if (ConfigurationsChanged != null)
- ConfigurationsChanged (this, EventArgs.Empty);
- if (activeConfiguration == null)
- DefaultConfigurationId = args.Configuration.Id;
- }
-
- void OnConfigurationRemovedFromCollection (object ob, ConfigurationEventArgs args)
- {
- if (activeConfiguration == args.Configuration) {
- if (Configurations.Count > 0)
- DefaultConfiguration = Configurations [0];
- else
- DefaultConfiguration = null;
- }
- NotifyModified ("Configurations");
- OnConfigurationRemoved (new ConfigurationEventArgs (this, args.Configuration));
- if (ConfigurationsChanged != null)
- ConfigurationsChanged (this, EventArgs.Empty);
- }
-
- public override StringTagModelDescription GetStringTagModelDescription (ConfigurationSelector conf)
- {
- StringTagModelDescription model = base.GetStringTagModelDescription (conf);
- SolutionItemConfiguration config = GetConfiguration (conf);
- if (config != null)
- model.Add (config.GetType ());
- else
- model.Add (typeof(SolutionItemConfiguration));
- return model;
- }
-
- public override StringTagModel GetStringTagModel (ConfigurationSelector conf)
- {
- StringTagModel source = base.GetStringTagModel (conf);
- SolutionItemConfiguration config = GetConfiguration (conf);
- if (config != null)
- source.Add (config);
- return source;
- }
-
- internal protected virtual void OnItemsAdded (IEnumerable<ProjectItem> objs)
- {
- NotifyModified ("Items");
- var args = new ProjectItemEventArgs ();
- args.AddRange (objs.Select (pi => new ProjectItemEventInfo (this, pi)));
- if (ProjectItemAdded != null)
- ProjectItemAdded (this, args);
- }
-
- internal protected virtual void OnItemsRemoved (IEnumerable<ProjectItem> objs)
- {
- NotifyModified ("Items");
- var args = new ProjectItemEventArgs ();
- args.AddRange (objs.Select (pi => new ProjectItemEventInfo (this, pi)));
- if (ProjectItemRemoved != null)
- ProjectItemRemoved (this, args);
- }
-
- protected virtual void OnDefaultConfigurationChanged (ConfigurationEventArgs args)
- {
- if (DefaultConfigurationChanged != null)
- DefaultConfigurationChanged (this, args);
- }
-
- protected virtual void OnConfigurationAdded (ConfigurationEventArgs args)
- {
- if (ConfigurationAdded != null)
- ConfigurationAdded (this, args);
- }
-
- protected virtual void OnConfigurationRemoved (ConfigurationEventArgs args)
- {
- if (ConfigurationRemoved != null)
- ConfigurationRemoved (this, args);
- }
-
- protected virtual void OnReloadRequired (SolutionItemEventArgs args)
- {
- fileStatusTracker.FireReloadRequired (args);
- }
-
- public event SolutionItemEventHandler Saved;
-
-/* public event EventHandler<SolutionItemEventArgs> ReloadRequired {
- add { fileStatusTracker.ReloadRequired += value; }
- remove { fileStatusTracker.ReloadRequired -= value; }
- }
-*/ }
-
- [Mono.Addins.Extension]
- class SolutionEntityItemTagProvider: StringTagProvider<SolutionEntityItem>, IStringTagProvider
- {
- public override IEnumerable<StringTagDescription> GetTags ()
- {
- yield return new StringTagDescription ("ProjectFile", "Project File");
- }
-
- public override object GetTagValue (SolutionEntityItem item, string tag)
- {
- switch (tag) {
- case "ITEMFILE":
- case "PROJECTFILE":
- case "PROJECTFILENAME":
- return item.FileName;
- }
- throw new NotSupportedException ();
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionExtension.cs
new file mode 100644
index 0000000000..1907ade73c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionExtension.cs
@@ -0,0 +1,156 @@
+//
+// SolutionExtension.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Execution;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using MonoDevelop.Projects.MSBuild;
+
+namespace MonoDevelop.Projects
+{
+ public class SolutionExtension: WorkspaceItemExtension
+ {
+ SolutionExtension next;
+
+ internal protected override void InitializeChain (ChainedExtension next)
+ {
+ base.InitializeChain (next);
+ this.next = FindNextImplementation<SolutionExtension> (next);
+ }
+
+ protected Solution Solution {
+ get { return (Solution) base.Item; }
+ }
+
+ internal protected override bool SupportsItem (WorkspaceItem item)
+ {
+ return item is Solution;
+ }
+
+ internal protected virtual Task<BuildResult> Build (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
+ {
+ return next.Build (monitor, configuration, operationContext);
+ }
+
+ internal protected virtual Task<BuildResult> Clean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
+ {
+ return next.Clean (monitor, configuration, operationContext);
+ }
+
+ internal protected virtual Task Execute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ {
+ return next.Execute (monitor, context, configuration);
+ }
+
+ internal protected virtual Task PrepareExecution (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ {
+ return next.PrepareExecution (monitor, context, configuration);
+ }
+
+ internal protected virtual bool CanExecute (ExecutionContext context, ConfigurationSelector configuration)
+ {
+ return next.CanExecute (context, configuration);
+ }
+
+ internal protected virtual IEnumerable<ExecutionTarget> GetExecutionTargets (Solution solution, ConfigurationSelector configuration)
+ {
+ return next.GetExecutionTargets (solution, configuration);
+ }
+
+ internal protected virtual bool NeedsBuilding (ConfigurationSelector configuration)
+ {
+ return next.NeedsBuilding (configuration);
+ }
+
+ internal protected virtual void OnReadSolution (ProgressMonitor monitor, SlnFile file)
+ {
+ var secAttribute = (SolutionDataSectionAttribute) Attribute.GetCustomAttribute (GetType(), typeof(SolutionDataSectionAttribute));
+ if (secAttribute != null && secAttribute.ProcessOrder == SlnSectionType.PreProcess) {
+ var sec = file.Sections.GetSection (secAttribute.SectionName, SlnSectionType.PreProcess);
+ if (sec != null)
+ sec.ReadObjectProperties (this);
+ }
+
+ next.OnReadSolution (monitor, file);
+
+ if (secAttribute != null && secAttribute.ProcessOrder == SlnSectionType.PostProcess) {
+ var sec = file.Sections.GetSection (secAttribute.SectionName, SlnSectionType.PostProcess);
+ if (sec != null)
+ sec.ReadObjectProperties (this);
+ }
+ }
+
+ internal protected virtual void OnReadSolutionFolderItemData (ProgressMonitor monitor, SlnPropertySet properties, SolutionFolderItem item)
+ {
+ next.OnReadSolutionFolderItemData (monitor, properties, item);
+ }
+
+ internal protected virtual void OnReadConfigurationData (ProgressMonitor monitor, SlnPropertySet properties, SolutionConfiguration configuration)
+ {
+ next.OnReadConfigurationData (monitor, properties, configuration);
+ }
+
+ internal protected virtual void OnWriteSolution (ProgressMonitor monitor, SlnFile file)
+ {
+ var secAttribute = (SolutionDataSectionAttribute) Attribute.GetCustomAttribute (GetType(), typeof(SolutionDataSectionAttribute));
+ if (secAttribute != null && secAttribute.ProcessOrder == SlnSectionType.PreProcess) {
+ var sec = file.Sections.GetOrCreateSection (secAttribute.SectionName, SlnSectionType.PreProcess);
+ sec.SkipIfEmpty = true;
+ sec.WriteObjectProperties (this);
+ }
+
+ next.OnWriteSolution (monitor, file);
+
+ if (secAttribute != null && secAttribute.ProcessOrder == SlnSectionType.PostProcess) {
+ var sec = file.Sections.GetOrCreateSection (secAttribute.SectionName, SlnSectionType.PostProcess);
+ sec.SkipIfEmpty = true;
+ sec.WriteObjectProperties (this);
+ }
+ }
+
+ internal protected virtual void OnWriteSolutionFolderItemData (ProgressMonitor monitor, SlnPropertySet properties, SolutionFolderItem item)
+ {
+ next.OnWriteSolutionFolderItemData (monitor, properties, item);
+ }
+
+ internal protected virtual void OnWriteConfigurationData (ProgressMonitor monitor, SlnPropertySet properties, SolutionConfiguration configuration)
+ {
+ next.OnWriteConfigurationData (monitor, properties, configuration);
+ }
+
+ internal protected virtual void OnSetFormat (MSBuildFileFormat value)
+ {
+ next.OnSetFormat (value);
+ }
+
+ internal protected virtual bool OnGetSupportsFormat (MSBuildFileFormat format)
+ {
+ return OnGetSupportsFormat (format);
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolder.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolder.cs
index edda72101a..4e7fb71428 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolder.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolder.cs
@@ -27,29 +27,23 @@
using System;
-using System.Xml;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
-using System.Globalization;
-using System.Reflection;
-using System.Diagnostics;
-using System.CodeDom.Compiler;
-using System.ComponentModel;
-using System.Threading;
using MonoDevelop.Core;
-using MonoDevelop.Core.ProgressMonitoring;
using MonoDevelop.Projects;
using MonoDevelop.Projects.Extensions;
using MonoDevelop.Core.Serialization;
+using System.Threading.Tasks;
+using System.Collections.Immutable;
namespace MonoDevelop.Projects
{
[DataInclude (typeof(SolutionConfiguration))]
- public class SolutionFolder : SolutionItem
+ public sealed class SolutionFolder : SolutionFolderItem, IBuildTarget
{
SolutionFolderItemCollection items;
SolutionFolderFileCollection files;
@@ -67,6 +61,11 @@ namespace MonoDevelop.Projects
}
}
+ protected override IEnumerable<WorkspaceObject> OnGetChildren ()
+ {
+ return Items;
+ }
+
internal SolutionFolderItemCollection GetItemsWithoutCreating ()
{
return items;
@@ -82,26 +81,25 @@ namespace MonoDevelop.Projects
}
}
- public virtual bool IsRoot {
+ public bool IsRoot {
get { return ParentFolder == null; }
}
- public override string Name {
- get {
- if (ParentFolder == null && ParentSolution != null)
- return ParentSolution.Name;
- else
- return name;
- }
- set {
- if (value != name) {
- string oldName = name;
- name = value;
- OnNameChanged (new SolutionItemRenamedEventArgs (this, oldName, name));
- }
- }
- }
-
+ [ThreadSafe]
+ protected override string OnGetName ()
+ {
+ var parent = ParentFolder == null && ParentSolution != null ? ParentSolution : null;
+ if (parent != null)
+ return parent.Name;
+ else
+ return name;
+ }
+
+ protected override void OnSetName (string value)
+ {
+ name = value;
+ }
+
protected override FilePath GetDefaultBaseDirectory ( )
{
// Since solution folders don't are not bound to a specific directory, we have to guess it.
@@ -139,7 +137,7 @@ namespace MonoDevelop.Projects
{
FilePath path = null;
- foreach (SolutionItem it in Items) {
+ foreach (SolutionFolderItem it in Items) {
FilePath subdir;
if (it is SolutionFolder) {
SolutionFolder sf = (SolutionFolder) it;
@@ -187,56 +185,47 @@ namespace MonoDevelop.Projects
else
return null;
}
-
- internal override IDictionary InternalGetExtendedProperties {
- get {
- if (ParentSolution != null && ParentFolder == null)
- return ParentSolution.ExtendedProperties;
- else
- return base.InternalGetExtendedProperties;
- }
- }
-
- protected override void InitializeItemHandler ()
+
+ internal override IDictionary OnGetExtendedProperties ()
{
- SetItemHandler (new DummySolutionFolderHandler (this));
+ if (ParentSolution != null && ParentFolder == null)
+ return ParentSolution.ExtendedProperties;
+ else
+ return base.OnGetExtendedProperties ();
}
-
- public override void Dispose()
+
+ protected override void OnDispose ()
{
if (items != null) {
- foreach (SolutionItem e in items)
+ foreach (SolutionFolderItem e in items)
e.Dispose ();
items = null;
}
files = null;
- base.Dispose ();
+ base.OnDispose ();
}
- public SolutionItem ReloadItem (IProgressMonitor monitor, SolutionItem sitem)
+ public async Task<SolutionFolderItem> ReloadItem (ProgressMonitor monitor, SolutionFolderItem sitem)
{
if (Items.IndexOf (sitem) == -1)
throw new InvalidOperationException ("Solution item '" + sitem.Name + "' does not belong to folder '" + Name + "'");
- SolutionEntityItem item = sitem as SolutionEntityItem;
+ SolutionItem item = sitem as SolutionItem;
if (item != null) {
// Load the new item
- SolutionEntityItem newItem;
+ SolutionItem newItem;
try {
- if (ParentSolution.IsSolutionItemEnabled (item.FileName))
- newItem = Services.ProjectService.ReadSolutionItem (monitor, item.FileName);
+ if (ParentSolution.IsSolutionItemEnabled (item.FileName)) {
+ using (var ctx = new SolutionLoadContext (ParentSolution))
+ newItem = await Services.ProjectService.ReadSolutionItem (monitor, item.FileName, null, ctx: ctx);
+ }
else {
UnknownSolutionItem e = new UnloadedSolutionItem () {
FileName = item.FileName
};
- var ch = item.GetItemHandler () as MonoDevelop.Projects.Formats.MSBuild.MSBuildHandler;
- if (ch != null) {
- var h = new MonoDevelop.Projects.Formats.MSBuild.MSBuildHandler (ch.TypeGuid, ch.ItemId) {
- Item = e,
- };
- e.SetItemHandler (h);
- }
+ e.ItemId = item.ItemId;
+ e.TypeGuid = item.TypeGuid;
newItem = e;
}
} catch (Exception ex) {
@@ -252,12 +241,13 @@ namespace MonoDevelop.Projects
newItem.Dispose ();
// Find the replacement if it exists
- return Items.OfType<SolutionEntityItem> ().FirstOrDefault (it => it.FileName == item.FileName);
+ return Items.OfType<SolutionItem> ().FirstOrDefault (it => it.FileName == item.FileName);
}
// Replace in the file list
Items.Replace (item, newItem);
-
+
+ item.ParentFolder = null;
DisconnectChildEntryEvents (item);
ConnectChildEntryEvents (newItem);
@@ -272,7 +262,7 @@ namespace MonoDevelop.Projects
return sitem;
}
- internal void NotifyItemAdded (SolutionItem item, bool newToSolution)
+ internal void NotifyItemAdded (SolutionFolderItem item, bool newToSolution)
{
ConnectChildEntryEvents (item);
@@ -280,7 +270,7 @@ namespace MonoDevelop.Projects
OnItemAdded (new SolutionItemChangeEventArgs (item, ParentSolution, false), newToSolution);
}
- void ConnectChildEntryEvents (SolutionItem item)
+ void ConnectChildEntryEvents (SolutionFolderItem item)
{
if (item is Project) {
Project project = item as Project;
@@ -306,42 +296,38 @@ namespace MonoDevelop.Projects
folder.ReferenceAddedToProject += NotifyReferenceAddedToProject;
}
- if (item is SolutionEntityItem) {
- ((SolutionEntityItem)item).Saved += NotifyItemSaved;
+ if (item is SolutionItem) {
+ ((SolutionItem)item).Saved += NotifyItemSaved;
// ((SolutionEntityItem)item).ReloadRequired += NotifyItemReloadRequired;
}
item.Modified += NotifyItemModified;
}
- public override void Save (IProgressMonitor monitor)
- {
- foreach (SolutionItem item in Items)
- item.Save (monitor);
- }
-
- public SolutionEntityItem AddItem (IProgressMonitor monitor, string filename)
+ public Task<SolutionItem> AddItem (ProgressMonitor monitor, string filename)
{
return AddItem (monitor, filename, false);
}
- public SolutionEntityItem AddItem (IProgressMonitor monitor, string filename, bool createSolutionConfigurations)
+ public async Task<SolutionItem> AddItem (ProgressMonitor monitor, string filename, bool createSolutionConfigurations)
{
- if (monitor == null) monitor = new NullProgressMonitor ();
- SolutionEntityItem entry = Services.ProjectService.ReadSolutionItem (monitor, filename);
- AddItem (entry, createSolutionConfigurations);
- return entry;
+ if (monitor == null) monitor = new ProgressMonitor ();
+ using (var ctx = new SolutionLoadContext (ParentSolution)) {
+ var entry = await Services.ProjectService.ReadSolutionItem (monitor, filename, null, ctx: ctx);
+ AddItem (entry, createSolutionConfigurations);
+ return entry;
+ }
}
- public void AddItem (SolutionItem item)
+ public void AddItem (SolutionFolderItem item)
{
AddItem (item, false);
}
- public void AddItem (SolutionItem item, bool createSolutionConfigurations)
+ public void AddItem (SolutionFolderItem item, bool createSolutionConfigurations)
{
Items.Add (item);
- SolutionEntityItem eitem = item as SolutionEntityItem;
+ SolutionItem eitem = item as SolutionItem;
if (eitem != null && createSolutionConfigurations && eitem.SupportsBuild ()) {
// Create new solution configurations for item configurations
foreach (ItemConfiguration iconf in eitem.Configurations) {
@@ -355,7 +341,7 @@ namespace MonoDevelop.Projects
if (!found) {
SolutionConfiguration sconf = new SolutionConfiguration (iconf.Id);
// Add all items to the new configuration
- foreach (var it in ParentSolution.GetAllSolutionItems<SolutionEntityItem> ())
+ foreach (var it in ParentSolution.GetAllItems<SolutionItem> ())
sconf.AddItem (it);
ParentSolution.Configurations.Add (sconf);
}
@@ -363,14 +349,14 @@ namespace MonoDevelop.Projects
}
}
- internal void NotifyItemRemoved (SolutionItem item, bool removedFromSolution)
+ internal void NotifyItemRemoved (SolutionFolderItem item, bool removedFromSolution)
{
DisconnectChildEntryEvents (item);
NotifyModified ("Items");
OnItemRemoved (new SolutionItemChangeEventArgs (item, ParentSolution, false), removedFromSolution);
}
- void DisconnectChildEntryEvents (SolutionItem entry)
+ void DisconnectChildEntryEvents (SolutionFolderItem entry)
{
if (entry is Project) {
Project pce = entry as Project;
@@ -396,35 +382,40 @@ namespace MonoDevelop.Projects
cce.ReferenceAddedToProject -= NotifyReferenceAddedToProject;
}
- if (entry is SolutionEntityItem) {
- ((SolutionEntityItem)entry).Saved -= NotifyItemSaved;
+ if (entry is SolutionItem) {
+ ((SolutionItem)entry).Saved -= NotifyItemSaved;
// ((SolutionEntityItem)entry).ReloadRequired -= NotifyItemReloadRequired;
}
entry.Modified -= NotifyItemModified;
}
- protected internal override void OnExecute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ public Task Execute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
{
+ return Task.FromResult (false);
}
-
- /// <remarks>
- /// Returns a collection containing all entries in this folder and
- /// undercombines
- /// </remarks>
- public ReadOnlyCollection<SolutionItem> GetAllItems ()
+
+ public bool CanExecute (ExecutionContext context, ConfigurationSelector configuration)
{
- return GetAllItems<SolutionItem> ();
+ return false;
}
-
+
+ public Task PrepareExecution (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ {
+ return Task.FromResult (false);
+ }
+
+ public IEnumerable<IBuildTarget> GetExecutionDependencies ()
+ {
+ yield break;
+ }
+
/// <remarks>
- /// Returns a collection containing all entries of the given type in this folder and
+ /// Returns a collection containing all entries in this folder and
/// undercombines
/// </remarks>
- public ReadOnlyCollection<T> GetAllItems<T> () where T: SolutionItem
+ public IEnumerable<SolutionFolderItem> GetAllItems ()
{
- List<T> list = new List<T> ();
- GetAllItems<T> (list, this);
- return list.AsReadOnly ();
+ return GetAllItems<SolutionFolderItem> ();
}
public ReadOnlyCollection<T> GetAllItemsWithTopologicalSort<T> (ConfigurationSelector configuration) where T: SolutionItem
@@ -450,24 +441,24 @@ namespace MonoDevelop.Projects
return SolutionItem.TopologicalSort<Project> (list, configuration);
}
- void GetAllItems<T> (List<T> list, SolutionItem item) where T: SolutionItem
+ void GetAllItems<T> (List<T> list, SolutionFolderItem item) where T: SolutionFolderItem
{
if (item is T) {
list.Add ((T)item);
}
if (item is SolutionFolder) {
- foreach (SolutionItem ce in ((SolutionFolder)item).Items)
+ foreach (SolutionFolderItem ce in ((SolutionFolder)item).Items)
GetAllItems<T> (list, ce);
}
}
public ReadOnlyCollection<SolutionItem> GetAllBuildableEntries (ConfigurationSelector configuration, bool topologicalSort, bool includeExternalReferences)
{
- List<SolutionItem> list = new List<SolutionItem> ();
+ var list = new List<SolutionItem> ();
GetAllBuildableEntries (list, configuration, includeExternalReferences);
if (topologicalSort)
- return TopologicalSort<SolutionItem> (list, configuration);
+ return SolutionItem.TopologicalSort<SolutionItem> (list, configuration);
else
return list.AsReadOnly ();
}
@@ -485,22 +476,25 @@ namespace MonoDevelop.Projects
if (conf == null)
return;
- foreach (SolutionItem item in Items) {
+ foreach (SolutionFolderItem item in Items) {
if (item is SolutionFolder)
((SolutionFolder)item).GetAllBuildableEntries (list, configuration, includeExternalReferences);
- else if ((item is SolutionEntityItem) && conf.BuildEnabledForItem ((SolutionEntityItem) item) && item.SupportsBuild ())
- GetAllBuildableReferences (list, item, configuration, includeExternalReferences);
+ else if ((item is SolutionItem) && conf.BuildEnabledForItem ((SolutionItem) item) && ((SolutionItem)item).SupportsBuild ())
+ GetAllBuildableReferences (list, (SolutionItem)item, configuration, conf, includeExternalReferences, false);
}
}
- void GetAllBuildableReferences (List<SolutionItem> list, SolutionItem item, ConfigurationSelector configuration, bool includeExternalReferences)
+ void GetAllBuildableReferences (List<SolutionItem> list, SolutionItem item, ConfigurationSelector configuration, SolutionConfiguration conf, bool includeExternalReferences, bool isDirectReference)
{
- if (list.Contains (item))
+ if (list.Contains (item) || !conf.BuildEnabledForItem (item))
+ return;
+ // Skip unsupported projects which are not directly referenced by other (supported) projects
+ if (!isDirectReference && item.IsUnsupportedProject)
return;
list.Add (item);
if (includeExternalReferences) {
- foreach (SolutionItem it in item.GetReferencedItems (configuration))
- GetAllBuildableReferences (list, it, configuration, includeExternalReferences);
+ foreach (var it in item.GetReferencedItems (configuration))
+ GetAllBuildableReferences (list, it, configuration, conf, includeExternalReferences, true);
}
}
@@ -541,19 +535,19 @@ namespace MonoDevelop.Projects
}
}
- public SolutionEntityItem FindSolutionItem (string fileName)
+ public SolutionItem FindSolutionItem (string fileName)
{
string path = Path.GetFullPath (fileName);
- foreach (SolutionItem it in Items) {
+ foreach (SolutionFolderItem it in Items) {
if (it is SolutionFolder) {
- SolutionEntityItem r = ((SolutionFolder)it).FindSolutionItem (fileName);
+ SolutionItem r = ((SolutionFolder)it).FindSolutionItem (fileName);
if (r != null)
return r;
}
- else if (it is SolutionEntityItem) {
- SolutionEntityItem se = (SolutionEntityItem) it;
+ else if (it is SolutionItem) {
+ SolutionItem se = (SolutionItem) it;
if (!string.IsNullOrEmpty (se.FileName) && path == Path.GetFullPath (se.FileName))
- return (SolutionEntityItem) it;
+ return (SolutionItem) it;
}
}
return null;
@@ -561,7 +555,7 @@ namespace MonoDevelop.Projects
public Project FindProjectByName (string name)
{
- foreach (SolutionItem it in Items) {
+ foreach (SolutionFolderItem it in Items) {
if (it is SolutionFolder) {
Project r = ((SolutionFolder)it).FindProjectByName (name);
if (r != null)
@@ -575,85 +569,46 @@ namespace MonoDevelop.Projects
return null;
}
- protected internal override BuildResult OnRunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration)
+ bool IBuildTarget.CanBuild (ConfigurationSelector configuration)
{
- if (target == ProjectService.BuildTarget)
- return OnBuild (monitor, configuration);
- else if (target == ProjectService.CleanTarget) {
- OnClean (monitor, configuration);
+ return true;
+ }
+
+ public async Task<BuildResult> Clean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext = null)
+ {
+ if (ParentSolution == null)
return new BuildResult ();
- }
-
+ SolutionConfiguration conf = ParentSolution.GetConfiguration (configuration);
+ if (conf == null)
+ return new BuildResult ();
+
ReadOnlyCollection<SolutionItem> allProjects;
-
try {
allProjects = GetAllBuildableEntries (configuration, true, true);
} catch (CyclicDependencyException) {
monitor.ReportError (GettextCatalog.GetString ("Cyclic dependencies are not supported."), null);
return new BuildResult ("", 1, 1);
}
-
- try {
- monitor.BeginTask (GettextCatalog.GetString ("Building Solution: {0} ({1})", Name, configuration.ToString ()), allProjects.Count);
-
- BuildResult cres = new BuildResult ();
- cres.BuildCount = 0;
- HashSet<SolutionItem> failedItems = new HashSet<SolutionItem> ();
-
- foreach (SolutionItem item in allProjects) {
- if (monitor.IsCancelRequested)
- break;
- if (!item.ContainsReferences (failedItems, configuration)) {
- BuildResult res = item.RunTarget (monitor, target, configuration);
- if (res != null) {
- cres.Append (res);
- if (res.ErrorCount > 0)
- failedItems.Add (item);
- }
- } else
- failedItems.Add (item);
- monitor.Step (1);
- }
- return cres;
- } finally {
- monitor.EndTask ();
- }
- }
-
- protected override void OnClean (IProgressMonitor monitor, ConfigurationSelector configuration)
- {
- if (ParentSolution == null)
- return;
- SolutionConfiguration conf = ParentSolution.GetConfiguration (configuration);
- if (conf == null)
- return;
-
+ monitor.BeginTask (GettextCatalog.GetString ("Cleaning Solution: {0} ({1})", Name, configuration.ToString ()), allProjects.Count);
try {
- monitor.BeginTask (GettextCatalog.GetString ("Cleaning Solution: {0} ({1})", Name, configuration.ToString ()), Items.Count);
-
- foreach (SolutionItem item in Items) {
- if (item is SolutionFolder)
- item.Clean (monitor, configuration);
- else if (item is SolutionEntityItem) {
- SolutionEntityItem si = (SolutionEntityItem) item;
- // ce can be null if you add items to the root solution folder which
- // causes them to be placed in an autogenerated 'Project Items' folder
- SolutionConfigurationEntry ce = conf.GetEntryForItem (si);
- if (ce != null && ce.Build)
- si.Clean (monitor, ce.ItemConfigurationSelector);
- } else {
- item.Clean (monitor, configuration);
- }
- monitor.Step (1);
- }
+ return await RunParallelBuildOperation (monitor, configuration, allProjects, (ProgressMonitor m, SolutionItem item) => {
+ return item.Clean (m, configuration, operationContext);
+ }, false);
}
finally {
monitor.EndTask ();
}
}
-
- protected override BuildResult OnBuild (IProgressMonitor monitor, ConfigurationSelector configuration)
+
+ class BuildStatus
+ {
+ public bool Failed;
+ public Task Task;
+ public BuildResult Result;
+ }
+
+ public async Task<BuildResult> Build (ProgressMonitor monitor, ConfigurationSelector configuration, bool buildReferencedTargets = false, OperationContext operationContext = null)
{
ReadOnlyCollection<SolutionItem> allProjects;
@@ -663,35 +618,88 @@ namespace MonoDevelop.Projects
monitor.ReportError (GettextCatalog.GetString ("Cyclic dependencies are not supported."), null);
return new BuildResult ("", 1, 1);
}
-
+
try {
- List<SolutionItem> toBuild = new List<SolutionItem> (allProjects);
- monitor.BeginTask (GettextCatalog.GetString ("Building Solution: {0} ({1})", Name, configuration.ToString ()), toBuild.Count);
+ monitor.BeginTask (GettextCatalog.GetString ("Building Solution: {0} ({1})", Name, configuration.ToString ()), allProjects.Count);
- BuildResult cres = new BuildResult ();
- cres.BuildCount = 0;
- HashSet<SolutionItem> failedItems = new HashSet<SolutionItem> ();
-
- foreach (SolutionItem item in toBuild) {
- if (monitor.IsCancelRequested)
- break;
+ return await RunParallelBuildOperation (monitor, configuration, allProjects, (ProgressMonitor m, SolutionItem item) => {
+ return item.Build (m, configuration, false, operationContext);
+ }, false);
- if (!item.ContainsReferences (failedItems, configuration)) {
- BuildResult res = item.Build (monitor, configuration, false);
- if (res != null) {
- cres.Append (res);
- if (res.ErrorCount > 0)
- failedItems.Add (item);
- }
- } else
- failedItems.Add (item);
- monitor.Step (1);
- }
- return cres;
} finally {
monitor.EndTask ();
}
+ }
+
+ internal static async Task<BuildResult> RunParallelBuildOperation (ProgressMonitor monitor, ConfigurationSelector configuration, IEnumerable<SolutionItem> sortedItems, Func<ProgressMonitor,SolutionItem,Task<BuildResult>> buildAction, bool ignoreFailed)
+ {
+ List<SolutionItem> toBuild = new List<SolutionItem> (sortedItems);
+ BuildResult cres = new BuildResult ();
+ cres.BuildCount = 0;
+
+ // Create a dictionary with the status objects of all items
+
+ var buildStatus = ImmutableDictionary<SolutionItem, BuildStatus>.Empty;
+ foreach (var it in toBuild)
+ buildStatus = buildStatus.Add (it, new BuildStatus ());
+
+ // Start the build tasks for all itemsw
+
+ foreach (var itemToBuild in toBuild) {
+ if (monitor.CancellationToken.IsCancellationRequested)
+ break;
+
+ var item = itemToBuild;
+
+ var myStatus = buildStatus [item];
+
+ var myMonitor = monitor.BeginAsyncStep (1);
+
+ // Get a list of the status objects for all items on which this one depends
+
+ var refStatus = item.GetReferencedItems (configuration).Select (it => {
+ BuildStatus bs;
+ buildStatus.TryGetValue (it, out bs);
+ return bs;
+ }).Where (t => t != null).ToArray ();
+
+ // Build the item when all its dependencies have been built
+
+ var refTasks = refStatus.Select (bs => bs.Task);
+
+ myStatus.Task = Task.WhenAll (refTasks).ContinueWith (async t => {
+ if (!ignoreFailed && (refStatus.Any (bs => bs.Failed) || t.IsFaulted)) {
+ myStatus.Failed = true;
+ } else {
+ myStatus.Result = await buildAction (myMonitor, item);
+ myStatus.Failed = myStatus.Result != null && myStatus.Result.ErrorCount > 0;
+ }
+ myMonitor.Dispose ();
+ }, Runtime.MainTaskScheduler).Unwrap ();
+
+ if (!Runtime.Preferences.ParallelBuild.Value)
+ await myStatus.Task;
+ }
+
+ // Wait for all tasks to end
+
+ await Task.WhenAll (buildStatus.Values.Select (bs => bs.Task));
+
+ // Generate the errors in the order they were supposed to build
+
+ foreach (var it in toBuild) {
+ BuildStatus bs;
+ if (buildStatus.TryGetValue (it, out bs) && bs.Result != null)
+ cres.Append (bs.Result);
+ }
+
+ return cres;
+ }
+
+ public bool NeedsBuilding (ConfigurationSelector configuration)
+ {
+ return Items.OfType<IBuildTarget>().Any (t => t.NeedsBuilding (configuration));
}
protected internal override DateTime OnGetLastBuildTime (ConfigurationSelector configuration)
@@ -699,7 +707,7 @@ namespace MonoDevelop.Projects
// Return the min value, since that the last time all items in the
// folder were built
DateTime tim = DateTime.MaxValue;
- foreach (SolutionItem it in Items) {
+ foreach (SolutionFolderItem it in Items) {
DateTime t = it.GetLastBuildTime (configuration);
if (t < tim)
tim = t;
@@ -874,7 +882,7 @@ namespace MonoDevelop.Projects
OnItemAdded (e);
}
- protected virtual void OnItemAdded (SolutionItemChangeEventArgs e)
+ void OnItemAdded (SolutionItemChangeEventArgs e)
{
if (ItemAdded != null)
ItemAdded (this, e);
@@ -886,13 +894,13 @@ namespace MonoDevelop.Projects
NotifyItemRemovedFromFolder (this, e, removedFromSolution);
}
- protected virtual void OnItemRemoved (SolutionItemChangeEventArgs e)
+ void OnItemRemoved (SolutionItemChangeEventArgs e)
{
if (ItemRemoved != null)
ItemRemoved (this, e);
}
- protected virtual void OnFileRemovedFromProject (ProjectFileEventArgs e)
+ void OnFileRemovedFromProject (ProjectFileEventArgs e)
{
if (ParentFolder == null && ParentSolution != null)
ParentSolution.OnFileRemovedFromProject (e);
@@ -901,7 +909,7 @@ namespace MonoDevelop.Projects
}
}
- protected virtual void OnFileChangedInProject (ProjectFileEventArgs e)
+ void OnFileChangedInProject (ProjectFileEventArgs e)
{
if (ParentFolder == null && ParentSolution != null)
ParentSolution.OnFileChangedInProject (e);
@@ -910,7 +918,7 @@ namespace MonoDevelop.Projects
}
}
- protected virtual void OnFilePropertyChangedInProject (ProjectFileEventArgs e)
+ void OnFilePropertyChangedInProject (ProjectFileEventArgs e)
{
if (ParentFolder == null && ParentSolution != null)
ParentSolution.OnFilePropertyChangedInProject (e);
@@ -919,7 +927,7 @@ namespace MonoDevelop.Projects
}
}
- protected virtual void OnFileAddedToProject (ProjectFileEventArgs e)
+ void OnFileAddedToProject (ProjectFileEventArgs e)
{
if (ParentFolder == null && ParentSolution != null)
ParentSolution.OnFileAddedToProject (e);
@@ -928,7 +936,7 @@ namespace MonoDevelop.Projects
}
}
- protected virtual void OnFileRenamedInProject (ProjectFileRenamedEventArgs e)
+ void OnFileRenamedInProject (ProjectFileRenamedEventArgs e)
{
if (ParentFolder == null && ParentSolution != null)
ParentSolution.OnFileRenamedInProject (e);
@@ -937,7 +945,7 @@ namespace MonoDevelop.Projects
}
}
- protected virtual void OnReferenceRemovedFromProject (ProjectReferenceEventArgs e)
+ void OnReferenceRemovedFromProject (ProjectReferenceEventArgs e)
{
if (ParentFolder == null && ParentSolution != null)
ParentSolution.OnReferenceRemovedFromProject (e);
@@ -946,7 +954,7 @@ namespace MonoDevelop.Projects
}
}
- protected virtual void OnReferenceAddedToProject (ProjectReferenceEventArgs e)
+ void OnReferenceAddedToProject (ProjectReferenceEventArgs e)
{
if (ParentFolder == null && ParentSolution != null)
ParentSolution.OnReferenceAddedToProject (e);
@@ -955,7 +963,7 @@ namespace MonoDevelop.Projects
}
}
- protected virtual void OnItemModified (SolutionItemModifiedEventArgs e)
+ void OnItemModified (SolutionItemModifiedEventArgs e)
{
if (ParentFolder == null && ParentSolution != null)
ParentSolution.OnEntryModified (e);
@@ -963,7 +971,7 @@ namespace MonoDevelop.Projects
ItemModified (this, e);
}
- protected virtual void OnItemSaved (SolutionItemEventArgs e)
+ void OnItemSaved (SolutionItemEventArgs e)
{
if (ParentFolder == null && ParentSolution != null)
ParentSolution.OnEntrySaved (e);
@@ -971,13 +979,13 @@ namespace MonoDevelop.Projects
ItemSaved (this, e);
}
- protected virtual void OnSolutionItemFileAdded (SolutionItemFileEventArgs args)
+ void OnSolutionItemFileAdded (SolutionItemFileEventArgs args)
{
if (SolutionItemFileAdded != null)
SolutionItemFileAdded (this, args);
}
- protected virtual void OnSolutionItemFileRemoved (SolutionItemFileEventArgs args)
+ void OnSolutionItemFileRemoved (SolutionItemFileEventArgs args)
{
if (SolutionItemFileRemoved != null)
SolutionItemFileRemoved (this, args);
@@ -1010,7 +1018,7 @@ namespace MonoDevelop.Projects
// public event EventHandler<SolutionItemEventArgs> ItemReloadRequired;
}
- class DummySolutionFolderHandler: ISolutionItemHandler
+ class DummySolutionFolderHandler
{
SolutionFolder folder;
@@ -1023,12 +1031,12 @@ namespace MonoDevelop.Projects
get { return folder.Name; }
}
- public BuildResult RunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration)
+ public Task<BuildResult> RunTarget (ProgressMonitor monitor, string target, ConfigurationSelector configuration)
{
throw new NotImplementedException ();
}
- public void Save (IProgressMonitor monitor)
+ public Task Save (ProgressMonitor monitor)
{
throw new NotImplementedException ();
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolderItem.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolderItem.cs
new file mode 100644
index 0000000000..3421f40c46
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolderItem.cs
@@ -0,0 +1,512 @@
+// SolutionItem.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+using System;
+using System.Collections;
+using System.Xml;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Serialization;
+using MonoDevelop.Projects.Extensions;
+using MonoDevelop.Core.StringParsing;
+using MonoDevelop.Projects.Policies;
+using System.Collections.Generic;
+using MonoDevelop.Projects.MSBuild;
+
+namespace MonoDevelop.Projects
+{
+ public abstract class SolutionFolderItem: WorkspaceObject, IPolicyProvider
+ {
+ SolutionFolder parentFolder;
+ Solution parentSolution;
+ SolutionFolder internalChildren;
+ string typeGuid;
+
+ [ProjectPathItemProperty ("BaseDirectory", DefaultValue=null)]
+ string baseDirectory;
+
+ [ItemProperty ("Policies", IsExternal = true, SkipEmpty = true)]
+ PolicyBag policies;
+
+ [ItemProperty ("UseMSBuildEngine", DefaultValue = null)]
+ public bool? UseMSBuildEngine { get; set; }
+
+ PropertyBag userProperties;
+
+ internal List<string> UnresolvedProjectDependencies { get; set; }
+
+ public new string Name {
+ get {
+ return base.Name;
+ }
+ set {
+ AssertMainThread ();
+ if (value != Name) {
+ var oldName = Name;
+ OnSetName (value);
+ OnNameChanged (new SolutionItemRenamedEventArgs (this, oldName, Name));
+ }
+ }
+ }
+
+ public string TypeGuid {
+ get {
+ return this.typeGuid;
+ }
+ set {
+ AssertMainThread ();
+ typeGuid = value;
+ }
+ }
+
+ protected abstract void OnSetName (string value);
+
+ /// <summary>
+ /// Gets the solution to which this item belongs
+ /// </summary>
+ public Solution ParentSolution {
+ get {
+ if (parentFolder != null)
+ return parentFolder.ParentSolution;
+ return parentSolution;
+ }
+ internal set {
+ if (parentSolution != null && parentSolution != value)
+ NotifyUnboundFromSolution (true);
+ parentSolution = value;
+ NotifyBoundToSolution (true);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the base directory of this solution item
+ /// </summary>
+ /// <value>
+ /// The base directory.
+ /// </value>
+ /// <remarks>
+ /// The base directory is the directory where files belonging to this project
+ /// are placed. Notice that this directory may be different than the directory
+ /// where the project file is placed.
+ /// </remarks>
+ public new FilePath BaseDirectory {
+ get {
+ if (baseDirectory == null) {
+ FilePath dir = GetDefaultBaseDirectory ();
+ if (dir.IsNullOrEmpty)
+ dir = ".";
+ return dir.FullPath;
+ }
+ else
+ return baseDirectory;
+ }
+ set {
+ AssertMainThread ();
+ FilePath def = GetDefaultBaseDirectory ();
+ if (value != FilePath.Null && def != FilePath.Null && value.FullPath == def.FullPath)
+ baseDirectory = null;
+ else if (string.IsNullOrEmpty (value))
+ baseDirectory = null;
+ else
+ baseDirectory = value.FullPath;
+ NotifyModified ("BaseDirectory");
+ }
+ }
+
+ protected override string OnGetBaseDirectory ()
+ {
+ return BaseDirectory;
+ }
+
+ protected sealed override string OnGetItemDirectory ()
+ {
+ FilePath dir = GetDefaultBaseDirectory ();
+ if (string.IsNullOrEmpty (dir))
+ dir = ".";
+ return dir.FullPath;
+ }
+
+ internal bool HasCustomBaseDirectory {
+ get { return baseDirectory != null; }
+ }
+
+ /// <summary>
+ /// Gets the default base directory.
+ /// </summary>
+ /// <remarks>
+ /// The base directory is the directory where files belonging to this project
+ /// are placed. Notice that this directory may be different than the directory
+ /// where the project file is placed.
+ /// </remarks>
+ protected virtual FilePath GetDefaultBaseDirectory ( )
+ {
+ return ParentSolution.BaseDirectory;
+ }
+
+ /// <summary>
+ /// Gets the identifier of this solution item
+ /// </summary>
+ /// <remarks>
+ /// The identifier is unique inside the solution
+ /// </remarks>
+ public string ItemId {
+ get {
+ if (itemId == null)
+ itemId = "{" + Guid.NewGuid ().ToString ().ToUpper () + "}";
+ return itemId;
+ }
+ set {
+ AssertMainThread ();
+ itemId = value;
+ }
+ }
+
+ string itemId;
+
+ /// <summary>
+ /// Gets policies.
+ /// </summary>
+ /// <remarks>
+ /// Returns a policy container which can be used to query policies specific for this
+ /// solution item. If a policy is not defined for this item, the inherited value will be returned.
+ /// </remarks>
+ public PolicyBag Policies {
+ get {
+ //newly created (i.e. not deserialised) SolutionItems may have a null PolicyBag
+ if (policies == null)
+ policies = new MonoDevelop.Projects.Policies.PolicyBag ();
+ //this is the easiest reliable place to associate a deserialised Policybag with its owner
+ policies.Owner = this;
+ return policies;
+ }
+ //setter so that a solution can deserialise the PropertyBag on its RootFolder
+ internal set {
+ policies = value;
+ }
+ }
+
+ PolicyContainer IPolicyProvider.Policies {
+ get {
+ return Policies;
+ }
+ }
+
+ /// <summary>
+ /// Gets solution item properties specific to the current user
+ /// </summary>
+ /// <remarks>
+ /// These properties are not stored in the project file, but in a separate file which is not to be shared
+ /// with other users.
+ /// User properties are only loaded when the project is loaded inside the IDE.
+ /// </remarks>
+ public PropertyBag UserProperties {
+ get {
+ if (userProperties == null)
+ userProperties = new PropertyBag ();
+ return userProperties;
+ }
+ }
+
+ /// <summary>
+ /// Initializes the user properties of the item
+ /// </summary>
+ /// <param name='properties'>
+ /// Properties to be set
+ /// </param>
+ /// <exception cref='InvalidOperationException'>
+ /// The user properties have already been set
+ /// </exception>
+ /// <remarks>
+ /// This method is used by the IDE to initialize the user properties when a project is loaded.
+ /// </remarks>
+ public void LoadUserProperties (PropertyBag properties)
+ {
+ if (userProperties != null)
+ throw new InvalidOperationException ("User properties already loaded.");
+ userProperties = properties;
+ }
+
+ /// <summary>
+ /// Gets the parent solution folder.
+ /// </summary>
+ public SolutionFolder ParentFolder {
+ get {
+ return parentFolder;
+ }
+ internal set {
+ AssertMainThread ();
+ if (parentFolder != null && parentFolder.ParentSolution != null && (value == null || value.ParentSolution != parentFolder.ParentSolution))
+ NotifyUnboundFromSolution (false);
+
+ parentFolder = value;
+ if (internalChildren != null) {
+ internalChildren.ParentFolder = value;
+ }
+ if (value != null && value.ParentSolution != null) {
+ NotifyBoundToSolution (false);
+ }
+ }
+ }
+
+ // Normally, the ParentFolder setter fires OnBoundToSolution. However, when deserializing, child
+ // ParentFolder hierarchies can become connected before the ParentSolution becomes set. This method
+ // enables us to recursively fire the OnBoundToSolution call in those cases.
+ void NotifyBoundToSolution (bool includeInternalChildren)
+ {
+ var folder = this as SolutionFolder;
+ if (folder != null) {
+ var items = folder.GetItemsWithoutCreating ();
+ if (items != null) {
+ foreach (var item in items) {
+ item.NotifyBoundToSolution (true);
+ }
+ }
+ }
+ if (includeInternalChildren && internalChildren != null) {
+ internalChildren.NotifyBoundToSolution (true);
+ }
+ OnBoundToSolution ();
+ }
+
+ void NotifyUnboundFromSolution (bool includeInternalChildren)
+ {
+ var folder = this as SolutionFolder;
+ if (folder != null) {
+ var items = folder.GetItemsWithoutCreating ();
+ if (items != null) {
+ foreach (var item in items) {
+ item.NotifyUnboundFromSolution (true);
+ }
+ }
+ }
+ if (includeInternalChildren && internalChildren != null) {
+ internalChildren.NotifyUnboundFromSolution (true);
+ }
+ OnUnboundFromSolution ();
+ }
+
+ protected override void OnDispose ()
+ {
+ base.OnDispose ();
+
+ if (userProperties != null) {
+ ((IDisposable)userProperties).Dispose ();
+ userProperties = null;
+ }
+
+ // parentFolder = null;
+ // parentSolution = null;
+ // internalChildren = null;
+ // policies = null;
+ }
+
+ /// <summary>
+ /// Gets the time of the last build
+ /// </summary>
+ /// <returns>
+ /// The last build time.
+ /// </returns>
+ /// <param name='configuration'>
+ /// Configuration for which to get the last build time.
+ /// </param>
+ public DateTime GetLastBuildTime (ConfigurationSelector configuration)
+ {
+ return OnGetLastBuildTime (configuration);
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this <see cref="MonoDevelop.Projects.SolutionItem"/> needs to be reload due to changes in project or solution file
+ /// </summary>
+ /// <value>
+ /// <c>true</c> if needs reload; otherwise, <c>false</c>.
+ /// </value>
+ public virtual bool NeedsReload {
+ get {
+ if (ParentSolution != null)
+ return ParentSolution.NeedsReload;
+ else
+ return false;
+ }
+ set {
+ }
+ }
+
+ /// <summary>
+ /// Registers an internal child item.
+ /// </summary>
+ /// <param name='item'>
+ /// An item
+ /// </param>
+ /// <remarks>
+ /// Some kind of projects may be composed of several child projects.
+ /// By registering those child projects using this method, the child
+ /// projects will be plugged into the parent solution infrastructure
+ /// (so for example, the ParentSolution property for those projects
+ /// will return the correct value)
+ /// </remarks>
+ protected void RegisterInternalChild (SolutionFolderItem item)
+ {
+ AssertMainThread ();
+ if (internalChildren == null) {
+ internalChildren = new SolutionFolder ();
+ internalChildren.ParentFolder = parentFolder;
+ }
+ internalChildren.Items.Add (item);
+ }
+
+ /// <summary>
+ /// Unregisters an internal child item.
+ /// </summary>
+ /// <param name='item'>
+ /// The item
+ /// </param>
+ protected void UnregisterInternalChild (SolutionFolderItem item)
+ {
+ AssertMainThread ();
+ if (internalChildren != null)
+ internalChildren.Items.Remove (item);
+ }
+
+ protected override StringTagModelDescription OnGetStringTagModelDescription (ConfigurationSelector conf)
+ {
+ var model = base.OnGetStringTagModelDescription (conf);
+ model.Add (GetType ());
+ if (ParentSolution != null)
+ model.Add (typeof(Solution));
+ return model;
+ }
+
+ protected override StringTagModel OnGetStringTagModel (ConfigurationSelector conf)
+ {
+ StringTagModel source = base.OnGetStringTagModel (conf);
+ if (ParentSolution != null)
+ source.Add (ParentSolution.GetStringTagModel ());
+ return source;
+ }
+
+ /// <summary>
+ /// Gets the author information for this solution item, inherited from the solution and global settings.
+ /// </summary>
+ public AuthorInformation AuthorInformation {
+ get {
+ if (ParentSolution != null)
+ return ParentSolution.AuthorInformation;
+ else
+ return AuthorInformation.Default;
+ }
+ }
+
+ internal MSBuildFileFormat SolutionFormat { get; private set; }
+
+ /// <summary>
+ /// Notifies that this solution item has been modified
+ /// </summary>
+ /// <param name='hint'>
+ /// Hint about which part of the solution item has been modified. This will typically be the property name.
+ /// </param>
+ public void NotifyModified (string hint)
+ {
+ OnModified (new SolutionItemModifiedEventArgs (this, hint));
+ }
+
+ /// <summary>
+ /// Raises the modified event.
+ /// </summary>
+ /// <param name='args'>
+ /// Arguments.
+ /// </param>
+ protected virtual void OnModified (SolutionItemModifiedEventArgs args)
+ {
+ AssertMainThread ();
+ if (Modified != null && !Disposed)
+ Modified (this, args);
+ }
+
+ /// <summary>
+ /// Raises the name changed event.
+ /// </summary>
+ /// <param name='e'>
+ /// Arguments.
+ /// </param>
+ protected virtual void OnNameChanged (SolutionItemRenamedEventArgs e)
+ {
+ NotifyModified ("Name");
+ if (NameChanged != null && !Disposed)
+ NameChanged (this, e);
+ }
+
+ /// <summary>
+ /// Initializes the item handler.
+ /// </summary>
+ /// <remarks>
+ /// This method is called the first time an item handler is requested.
+ /// Subclasses should override this method use SetItemHandler to
+ /// assign a handler to this item.
+ /// </remarks>
+ protected virtual void InitializeItemHandler ()
+ {
+ }
+
+ /// <summary>
+ /// Gets the time of the last build
+ /// </summary>
+ /// <returns>
+ /// The last build time.
+ /// </returns>
+ /// <param name='configuration'>
+ /// Configuration for which to get the last build time.
+ /// </param>
+ internal protected virtual DateTime OnGetLastBuildTime (ConfigurationSelector configuration)
+ {
+ return DateTime.MinValue;
+ }
+
+ /// <summary>
+ /// Called just after this item is bound to a solution
+ /// </summary>
+ protected virtual void OnBoundToSolution ()
+ {
+ }
+
+ /// <summary>
+ /// Called just before this item is removed from a solution (ParentSolution is still valid when this method is called)
+ /// </summary>
+ protected virtual void OnUnboundFromSolution ()
+ {
+ }
+
+ /// <summary>
+ /// Occurs when the name of the item changes
+ /// </summary>
+ public event SolutionItemRenamedEventHandler NameChanged;
+
+ /// <summary>
+ /// Occurs when the item is modified.
+ /// </summary>
+ public event SolutionItemModifiedEventHandler Modified;
+ }
+
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolderItemCollection.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolderItemCollection.cs
index e6704c7a57..5bd93f3f24 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolderItemCollection.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolderItemCollection.cs
@@ -27,10 +27,11 @@
using System;
using System.Collections.ObjectModel;
+using System.Collections.Generic;
namespace MonoDevelop.Projects
{
- public class SolutionFolderItemCollection: ItemCollection<SolutionItem>
+ public class SolutionFolderItemCollection: ItemCollection<SolutionFolderItem>
{
SolutionFolder parentFolder;
@@ -43,53 +44,52 @@ namespace MonoDevelop.Projects
this.parentFolder = parentFolder;
}
- internal void Replace (SolutionItem item, SolutionItem newItem)
+ internal void Replace (SolutionFolderItem item, SolutionFolderItem newItem)
{
int i = IndexOf (item);
- Items [i] = newItem;
+ List = List.SetItem (i, newItem);
newItem.ParentFolder = parentFolder;
}
- protected override void OnItemAdded (SolutionItem item)
+ protected override void OnItemsAdded (IEnumerable<SolutionFolderItem> items)
{
if (parentFolder != null) {
- // If the item belongs to another solution, remove it from there.
- // If it belongs to the same solution, just move the item, avoiding
- // the global item added/removed events.
- if (item.ParentFolder != null && item.ParentSolution != null) {
- if (item.ParentSolution != parentFolder.ParentSolution)
- item.ParentFolder.Items.Remove (item);
- else {
- SolutionFolder oldFolder = item.ParentFolder;
- item.ParentFolder = null;
- oldFolder.Items.InternalRemove (item);
- oldFolder.NotifyItemRemoved (item, false);
- item.ParentFolder = parentFolder;
- parentFolder.NotifyItemAdded (item, false);
- return;
+ foreach (var item in items) {
+ // If the item belongs to another solution, remove it from there.
+ // If it belongs to the same solution, just move the item, avoiding
+ // the global item added/removed events.
+ if (item.ParentFolder != null && item.ParentSolution != null) {
+ if (item.ParentSolution != parentFolder.ParentSolution)
+ item.ParentFolder.Items.Remove (item);
+ else {
+ SolutionFolder oldFolder = item.ParentFolder;
+ item.ParentFolder = null;
+ oldFolder.Items.InternalRemove (item);
+ oldFolder.NotifyItemRemoved (item, false);
+ item.ParentFolder = parentFolder;
+ parentFolder.NotifyItemAdded (item, false);
+ return;
+ }
}
+ item.ParentFolder = parentFolder;
+ parentFolder.NotifyItemAdded (item, true);
}
- item.ParentFolder = parentFolder;
- parentFolder.NotifyItemAdded (item, true);
}
}
- protected override void OnItemRemoved (SolutionItem item)
+ protected override void OnItemsRemoved (IEnumerable<SolutionFolderItem> items)
{
if (parentFolder != null) {
- item.ParentFolder = null;
- parentFolder.NotifyItemRemoved (item, true);
+ foreach (var item in items) {
+ item.ParentFolder = null;
+ parentFolder.NotifyItemRemoved (item, true);
+ }
}
}
-
- internal void InternalAdd (SolutionItem item)
- {
- Items.Add (item);
- }
-
- internal void InternalRemove (SolutionItem item)
+
+ internal void InternalRemove (SolutionFolderItem item)
{
- Items.Remove (item);
+ List = List.Remove (item);
}
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItem.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItem.cs
index 10902703ab..76b8ae90a7 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItem.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItem.cs
@@ -1,4 +1,4 @@
-// SolutionItem.cs
+// SolutionEntityItem.cs
//
// Author:
// Lluis Sanchez Gual <lluis@novell.com>
@@ -26,441 +26,339 @@
//
using System;
+using System.Linq;
+using System.Xml;
+using System.IO;
using System.Collections;
-using System.Collections.Generic;
using System.Collections.ObjectModel;
-using System.Xml;
+using System.Collections.Specialized;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Diagnostics;
using System.CodeDom.Compiler;
+
using MonoDevelop.Core;
+using MonoDevelop.Projects;
using MonoDevelop.Core.Serialization;
-using MonoDevelop.Projects.Extensions;
-using MonoDevelop.Core.Collections;
+using MonoDevelop.Projects.Extensions;
using MonoDevelop.Core.StringParsing;
-using MonoDevelop.Core.Instrumentation;
-using MonoDevelop.Projects.Policies;
using MonoDevelop.Core.Execution;
+using Mono.Addins;
+using MonoDevelop.Core.Instrumentation;
+using MonoDevelop.Core.Collections;
+using System.Threading.Tasks;
+using MonoDevelop.Projects.MSBuild;
+using System.Collections.Immutable;
namespace MonoDevelop.Projects
{
- public abstract class SolutionItem: IExtendedDataItem, IBuildTarget, ILoadController, IPolicyProvider
+ public abstract class SolutionItem : SolutionFolderItem, IWorkspaceFileObject, IConfigurationTarget, IBuildTarget, IMSBuildFileObject
{
- SolutionFolder parentFolder;
- Solution parentSolution;
- ISolutionItemHandler handler;
+ internal object MemoryProbe = Counters.ItemsInMemory.CreateMemoryProbe ();
+
int loading;
- SolutionFolder internalChildren;
-
- [ProjectPathItemProperty ("BaseDirectory", DefaultValue=null)]
- string baseDirectory;
+ ItemCollection<SolutionItem> dependencies = new ItemCollection<SolutionItem> ();
+ SolutionItemEventArgs thisItemArgs;
+ FileStatusTracker<SolutionItemEventArgs> fileStatusTracker;
+ FilePath fileName;
+ string name;
+ SolutionItemExtension itemExtension;
+ MSBuildFileFormat fileFormat;
- Hashtable extendedProperties;
-
- [ItemProperty ("Policies", IsExternal = true, SkipEmpty = true)]
- MonoDevelop.Projects.Policies.PolicyBag policies;
+ SolutionItemConfiguration activeConfiguration;
+ SolutionItemConfigurationCollection configurations;
- [ItemProperty ("UseMSBuildEngine")]
- public bool? UseMSBuildEngine { get; set; }
-
- PropertyBag userProperties;
+ public event EventHandler ConfigurationsChanged;
+ public event ConfigurationEventHandler DefaultConfigurationChanged;
+ public event ConfigurationEventHandler ConfigurationAdded;
+ public event ConfigurationEventHandler ConfigurationRemoved;
+
+ // When set, it means this item is saved as part of a global solution save operation
+ internal bool SavingSolution { get; set; }
- /// <summary>
- /// Initializes a new instance of the <see cref="MonoDevelop.Projects.SolutionItem"/> class.
- /// </summary>
- public SolutionItem()
+ public SolutionItem ()
{
- ProjectExtensionUtil.LoadControl (this);
+ TypeGuid = MSBuildProjectService.GetTypeGuidForItem (this);
+
+ fileFormat = MSBuildFileFormat.DefaultFormat;
+ thisItemArgs = new SolutionItemEventArgs (this);
+ configurations = new SolutionItemConfigurationCollection (this);
+ configurations.ConfigurationAdded += OnConfigurationAddedToCollection;
+ configurations.ConfigurationRemoved += OnConfigurationRemovedFromCollection;
+ Counters.ItemsLoaded++;
+ fileStatusTracker = new FileStatusTracker<SolutionItemEventArgs> (this, OnReloadRequired, new SolutionItemEventArgs (this));
}
-
- /// <summary>
- /// Initializes a new instance of this item, using an xml element as template
- /// </summary>
- /// <param name='template'>
- /// The template
- /// </param>
- public virtual void InitializeFromTemplate (XmlElement template)
+
+ protected override void OnExtensionChainInitialized ()
{
+ itemExtension = ExtensionChain.GetExtension<SolutionItemExtension> ();
+ base.OnExtensionChainInitialized ();
}
-
- /// <summary>
- /// Gets the handler for this solution item
- /// </summary>
- /// <value>
- /// The solution item handler.
- /// </value>
- /// <exception cref='InvalidOperationException'>
- /// Is thrown if there isn't a ISolutionItemHandler for this solution item
- /// </exception>
- protected internal ISolutionItemHandler ItemHandler {
+
+ SolutionItemExtension ItemExtension {
get {
- if (handler == null) {
- InitializeItemHandler ();
- if (handler == null)
- throw new InvalidOperationException ("No handler found for solution item of type: " + GetType ());
- }
- return handler;
+ if (itemExtension == null)
+ AssertExtensionChainCreated ();
+ return itemExtension;
}
}
-
- /// <summary>
- /// Sets the handler for this solution item
- /// </summary>
- /// <param name='handler'>
- /// A handler.
- /// </param>
- internal virtual void SetItemHandler (ISolutionItemHandler handler)
+
+ protected override IEnumerable<WorkspaceObjectExtension> CreateDefaultExtensions ()
{
- if (this.handler != null)
- this.handler.Dispose ();
- this.handler = handler;
+ foreach (var e in base.CreateDefaultExtensions ())
+ yield return e;
+ yield return new DefaultMSBuildItemExtension ();
}
-
- internal ISolutionItemHandler GetItemHandler ()
+
+ internal protected virtual IEnumerable<string> GetItemTypeGuids ()
{
- // Used to get the handler without lazy loading it
- return this.handler;
+ yield return TypeGuid;
}
-
- /// <summary>
- /// Gets the author information for this solution item, inherited from the solution and global settings.
- /// </summary>
- public AuthorInformation AuthorInformation {
- get {
- if (ParentSolution != null)
- return ParentSolution.AuthorInformation;
- else
- return AuthorInformation.Default;
+
+ protected override void OnDispose ()
+ {
+ if (Disposing != null)
+ Disposing (this, EventArgs.Empty);
+
+ base.OnDispose ();
+ Counters.ItemsLoaded--;
+
+ // items = null;
+ // wildcardItems = null;
+ // thisItemArgs = null;
+ // fileStatusTracker = null;
+ // fileFormat = null;
+ // activeConfiguration = null;
+ // configurations = null;
+ }
+
+ void HandleSolutionItemAdded (object sender, SolutionItemChangeEventArgs e)
+ {
+ if (e.Reloading && dependencies.Count > 0 && (e.SolutionItem is SolutionItem) && (e.ReplacedItem is SolutionItem)) {
+ int i = dependencies.IndexOf ((SolutionItem)e.ReplacedItem);
+ if (i != -1)
+ dependencies [i] = (SolutionItem) e.SolutionItem;
}
}
-
- /// <summary>
- /// Gets a service instance of a given type
- /// </summary>
- /// <returns>
- /// The service.
- /// </returns>
- /// <typeparam name='T'>
- /// Type of the service
- /// </typeparam>
- /// <remarks>
- /// This method looks for an imlpementation of a service of the given type.
- /// </remarks>
- public T GetService<T> () where T: class
+
+ void HandleSolutionItemRemoved (object sender, SolutionItemChangeEventArgs e)
{
- return (T) GetService (typeof(T));
+ if (!e.Reloading && (e.SolutionItem is SolutionItem))
+ dependencies.Remove ((SolutionItem)e.SolutionItem);
}
- /// <summary>
- /// Gets a service instance of a given type
- /// </summary>
- /// <returns>
- /// The service.
- /// </returns>
- /// <param name='t'>
- /// Type of the service
- /// </param>
- /// <remarks>
- /// This method looks for an imlpementation of a service of the given type.
- /// </remarks>
- public virtual object GetService (Type t)
+ internal void BeginLoad ()
{
- return Services.ProjectService.GetExtensionChain (this).GetService (this, t);
+ loading++;
+ OnBeginLoad ();
+ ItemExtension.BeginLoad ();
}
-
- /// <summary>
- /// Gets the solution to which this item belongs
- /// </summary>
- public Solution ParentSolution {
- get {
- if (parentFolder != null)
- return parentFolder.ParentSolution;
- return parentSolution;
- }
- internal set {
- if (parentSolution != null && parentSolution != value)
- NotifyUnboundFromSolution (true);
- parentSolution = value;
- NotifyBoundToSolution (true);
- }
+
+ internal void EndLoad ()
+ {
+ loading--;
+ ItemExtension.EndLoad ();
+ OnEndLoad ();
}
/// <summary>
- /// Gets a value indicating whether this item is currently being loaded from a file
+ /// Called when an item has been fully created and/or loaded
/// </summary>
- /// <remarks>
- /// While an item is loading, some events such as project file change events may be fired.
- /// This flag can be used to check if change events are caused by data being loaded.
+ /// <remarks>>
+ /// This method is invoked when all operations required for creating or loading this item have finished.
+ /// If the item is being created in memory, this method will be called just after OnExtensionChainInitialized.
+ /// If the item is being loaded from a file, it will be called after OnEndLoad.
+ /// If the item is being created from a template, it will be called after InitializeNew
/// </remarks>
- public bool Loading {
- get { return loading > 0; }
+ protected virtual void OnItemReady ()
+ {
}
-
+
+ internal void NotifyItemReady ()
+ {
+ ItemExtension.ItemReady ();
+ OnItemReady ();
+ }
+
+ protected override void OnSetShared ()
+ {
+ base.OnSetShared ();
+ configurations.SetShared ();
+ }
+
+
/// <summary>
- /// Saves the solution item
+ /// Called when a load operation for this solution item has started
/// </summary>
- /// <param name='monitor'>
- /// A progress monitor.
- /// </param>
- public abstract void Save (IProgressMonitor monitor);
-
+ protected virtual void OnBeginLoad ()
+ {
+ }
+
/// <summary>
- /// Name of the solution item
+ /// Called when a load operation for this solution item has finished
/// </summary>
- public abstract string Name { get; set; }
+ protected virtual void OnEndLoad ()
+ {
+ fileStatusTracker.ResetLoadTimes ();
+
+ if (syncReleaseVersion && ParentSolution != null)
+ releaseVersion = ParentSolution.Version;
+ }
+
+ [ItemProperty ("ReleaseVersion", DefaultValue="0.1")]
+ string releaseVersion = "0.1";
- /// <summary>
- /// Gets or sets the base directory of this solution item
- /// </summary>
- /// <value>
- /// The base directory.
- /// </value>
- /// <remarks>
- /// The base directory is the directory where files belonging to this project
- /// are placed. Notice that this directory may be different than the directory
- /// where the project file is placed.
- /// </remarks>
- public FilePath BaseDirectory {
+ [ItemProperty ("SynchReleaseVersion", DefaultValue = true)]
+ bool syncReleaseVersion = true;
+
+ public string Version {
get {
- if (baseDirectory == null) {
- FilePath dir = GetDefaultBaseDirectory ();
- if (dir.IsNullOrEmpty)
- dir = ".";
- return dir.FullPath;
- }
- else
- return baseDirectory;
- }
- set {
- FilePath def = GetDefaultBaseDirectory ();
- if (value != FilePath.Null && def != FilePath.Null && value.FullPath == def.FullPath)
- baseDirectory = null;
- else if (string.IsNullOrEmpty (value))
- baseDirectory = null;
- else
- baseDirectory = value.FullPath;
- NotifyModified ("BaseDirectory");
+ // If syncReleaseVersion is set, releaseVersion will already contain the solution's version
+ // That's because the version must be up to date even when loading the project individually
+ return releaseVersion;
+ }
+ set {
+ AssertMainThread ();
+ releaseVersion = value;
+ NotifyModified ("Version");
}
}
- /// <summary>
- /// Gets the directory where this solution item is placed
- /// </summary>
- public FilePath ItemDirectory {
- get {
- FilePath dir = GetDefaultBaseDirectory ();
- if (string.IsNullOrEmpty (dir))
- dir = ".";
- return dir.FullPath;
+ public bool SyncVersionWithSolution {
+ get {
+ return syncReleaseVersion;
+ }
+ set {
+ AssertMainThread ();
+ syncReleaseVersion = value;
+ if (syncReleaseVersion && ParentSolution != null)
+ Version = ParentSolution.Version;
+ NotifyModified ("SyncVersionWithSolution");
}
}
- internal bool HasCustomBaseDirectory {
- get { return baseDirectory != null; }
- }
-
- /// <summary>
- /// Gets the default base directory.
- /// </summary>
- /// <remarks>
- /// The base directory is the directory where files belonging to this project
- /// are placed. Notice that this directory may be different than the directory
- /// where the project file is placed.
- /// </remarks>
- protected virtual FilePath GetDefaultBaseDirectory ( )
+ [ThreadSafe]
+ protected override string OnGetName ()
{
- return ParentSolution.BaseDirectory;
+ return name ?? string.Empty;
}
- /// <summary>
- /// Gets the identifier of this solution item
- /// </summary>
- /// <remarks>
- /// The identifier is unique inside the solution
- /// </remarks>
- public string ItemId {
- get { return ItemHandler.ItemId; }
- }
-
- /// <summary>
- /// Gets extended properties.
- /// </summary>
- /// <remarks>
- /// This dictionary can be used by add-ins to store arbitrary information about this solution item.
- /// Keys and values can be of any type.
- /// If a value implements IDisposable, the value will be disposed when this solution item is disposed.
- /// Values in this dictionary won't be serialized, unless they are registered as serializable using
- /// the /MonoDevelop/ProjectModel/ExtendedProperties extension point.
- /// </remarks>
- public IDictionary ExtendedProperties {
- get { return InternalGetExtendedProperties; }
+ protected override void OnSetName (string value)
+ {
+ name = value;
+ if (!Loading) {
+ if (string.IsNullOrEmpty (fileName))
+ FileName = value;
+ else {
+ string ext = fileName.Extension;
+ FileName = fileName.ParentDirectory.Combine (value) + ext;
+ }
+ }
}
-
- /// <summary>
- /// Gets policies.
- /// </summary>
- /// <remarks>
- /// Returns a policy container which can be used to query policies specific for this
- /// solution item. If a policy is not defined for this item, the inherited value will be returned.
- /// </remarks>
- public MonoDevelop.Projects.Policies.PolicyBag Policies {
+
+ public virtual FilePath FileName {
get {
- //newly created (i.e. not deserialised) SolutionItems may have a null PolicyBag
- if (policies == null)
- policies = new MonoDevelop.Projects.Policies.PolicyBag ();
- //this is the easiest reliable place to associate a deserialised Policybag with its owner
- policies.Owner = this;
- return policies;
- }
- //setter so that a solution can deserialise the PropertyBag on its RootFolder
- internal set {
- policies = value;
+ return fileName;
+ }
+ set {
+ if (FileFormat != null)
+ value = FileFormat.GetValidFormatName (this, value);
+ if (value != fileName) {
+ fileName = value;
+ Name = fileName.FileNameWithoutExtension;
+ NotifyModified ("FileName");
+ }
}
}
-
- PolicyContainer IPolicyProvider.Policies {
- get {
- return Policies;
+
+ public bool Enabled {
+ get { return ParentSolution != null ? ParentSolution.IsSolutionItemEnabled (FileName) : true; }
+ set {
+ if (ParentSolution != null)
+ ParentSolution.SetSolutionItemEnabled (FileName, value);
}
}
-
- /// <summary>
- /// Gets solution item properties specific to the current user
- /// </summary>
- /// <remarks>
- /// These properties are not stored in the project file, but in a separate file which is not to be shared
- /// with other users.
- /// User properties are only loaded when the project is loaded inside the IDE.
- /// </remarks>
- public PropertyBag UserProperties {
+
+ public MSBuildFileFormat FileFormat {
get {
- if (userProperties == null)
- userProperties = new PropertyBag ();
- return userProperties;
+ if (ParentSolution != null)
+ return ParentSolution.FileFormat;
+ return fileFormat;
+ }
+ internal set {
+ fileFormat = value;
}
}
-
+
/// <summary>
- /// Initializes the user properties of the item
+ /// Changes the format of this item. This method doesn't save the item, it only does in memory-changes.
/// </summary>
- /// <param name='properties'>
- /// Properties to be set
- /// </param>
- /// <exception cref='InvalidOperationException'>
- /// The user properties have already been set
- /// </exception>
- /// <remarks>
- /// This method is used by the IDE to initialize the user properties when a project is loaded.
- /// </remarks>
- public void LoadUserProperties (PropertyBag properties)
+ public void ConvertToFormat (MSBuildFileFormat format)
{
- if (userProperties != null)
- throw new InvalidOperationException ("User properties already loaded.");
- userProperties = properties;
+ if (format == fileFormat)
+ return;
+
+ if (ParentSolution != null && ParentSolution.FileFormat != format)
+ throw new InvalidOperationException ("The file format can't be changed when the item belongs to a solution.");
+ InternalConvertToFormat (format);
}
-
- /// <summary>
- /// Gets the parent solution folder.
- /// </summary>
- public SolutionFolder ParentFolder {
- get {
- return parentFolder;
- }
- internal set {
- if (parentFolder != null && parentFolder.ParentSolution != null && (value == null || value.ParentSolution != parentFolder.ParentSolution))
- NotifyUnboundFromSolution (false);
- parentFolder = value;
- if (internalChildren != null) {
- internalChildren.ParentFolder = value;
- }
- if (value != null && value.ParentSolution != null) {
- NotifyBoundToSolution (false);
- }
- }
+ internal void InternalConvertToFormat (MSBuildFileFormat format)
+ {
+ ItemExtension.OnSetFormat (format);
+ NeedsReload = false;
+ NotifyModified ("FileFormat");
}
- // Normally, the ParentFolder setter fires OnBoundToSolution. However, when deserializing, child
- // ParentFolder hierarchies can become connected before the ParentSolution becomes set. This method
- // enables us to recursively fire the OnBoundToSolution call in those cases.
- void NotifyBoundToSolution (bool includeInternalChildren)
+ protected virtual void OnSetFormat (MSBuildFileFormat format)
{
- var folder = this as SolutionFolder;
- if (folder != null) {
- var items = folder.GetItemsWithoutCreating ();
- if (items != null) {
- foreach (var item in items) {
- item.NotifyBoundToSolution (true);
- }
- }
- }
- if (includeInternalChildren && internalChildren != null) {
- internalChildren.NotifyBoundToSolution (true);
- }
- OnBoundToSolution ();
+ fileFormat = format;
+ if (fileName != FilePath.Null)
+ fileName = fileFormat.GetValidFormatName (this, fileName);
}
- void NotifyUnboundFromSolution (bool includeInternalChildren)
+ public bool SupportsFormat (MSBuildFileFormat format)
{
- var folder = this as SolutionFolder;
- if (folder != null) {
- var items = folder.GetItemsWithoutCreating ();
- if (items != null) {
- foreach (var item in items) {
- item.NotifyUnboundFromSolution (true);
- }
- }
- }
- if (includeInternalChildren && internalChildren != null) {
- internalChildren.NotifyUnboundFromSolution (true);
- }
- OnUnboundFromSolution ();
+ return ItemExtension.OnGetSupportsFormat (format);
+ }
+
+ protected virtual bool OnGetSupportsFormat (MSBuildFileFormat format)
+ {
+ return true;
+ }
+
+ protected override object OnGetService (Type t)
+ {
+ return null;
}
/// <summary>
- /// Gets a value indicating whether this <see cref="MonoDevelop.Projects.SolutionItem"/> has been disposed.
+ /// Projects that need to be built before building this one
/// </summary>
- /// <value>
- /// <c>true</c> if disposed; otherwise, <c>false</c>.
- /// </value>
- internal protected bool Disposed { get; private set; }
+ /// <value>The dependencies.</value>
+ public ItemCollection<SolutionItem> ItemDependencies {
+ get { return dependencies; }
+ }
/// <summary>
- /// Releases all resource used by the <see cref="MonoDevelop.Projects.SolutionItem"/> object.
+ /// Gets a value indicating whether this item is currently being loaded from a file
/// </summary>
/// <remarks>
- /// Call <see cref="Dispose"/> when you are finished using the <see cref="MonoDevelop.Projects.SolutionItem"/>. The
- /// <see cref="Dispose"/> method leaves the <see cref="MonoDevelop.Projects.SolutionItem"/> in an unusable state.
- /// After calling <see cref="Dispose"/>, you must release all references to the
- /// <see cref="MonoDevelop.Projects.SolutionItem"/> so the garbage collector can reclaim the memory that the
- /// <see cref="MonoDevelop.Projects.SolutionItem"/> was occupying.
+ /// While an item is loading, some events such as project file change events may be fired.
+ /// This flag can be used to check if change events are caused by data being loaded.
/// </remarks>
- public virtual void Dispose ()
+ public bool Loading {
+ get { return loading > 0; }
+ }
+
+ public IEnumerable<IBuildTarget> GetExecutionDependencies ()
{
- if (Disposing != null)
- Disposing (this, EventArgs.Empty);
-
- Disposed = true;
-
- if (extendedProperties != null) {
- foreach (object ob in extendedProperties.Values) {
- IDisposable disp = ob as IDisposable;
- if (disp != null)
- disp.Dispose ();
- }
- extendedProperties = null;
- }
- if (handler != null) {
- handler.Dispose ();
- // handler = null;
- }
- if (userProperties != null) {
- ((IDisposable)userProperties).Dispose ();
- userProperties = null;
- }
-
- // parentFolder = null;
- // parentSolution = null;
- // internalChildren = null;
- // policies = null;
+ return ItemExtension.OnGetExecutionDependencies ();
+ }
+
+ protected virtual IEnumerable<IBuildTarget> OnGetExecutionDependencies ()
+ {
+ yield break;
}
/// <summary>
@@ -472,94 +370,182 @@ namespace MonoDevelop.Projects
/// <param name='configuration'>
/// Configuration for which to get the referenced items
/// </param>
- public virtual IEnumerable<SolutionItem> GetReferencedItems (ConfigurationSelector configuration)
+ public IEnumerable<SolutionItem> GetReferencedItems (ConfigurationSelector configuration)
{
- return new SolutionItem [0];
+ return ItemExtension.OnGetReferencedItems (configuration);
}
-
+
+ protected virtual IEnumerable<SolutionItem> OnGetReferencedItems (ConfigurationSelector configuration)
+ {
+ return dependencies;
+ }
+
/// <summary>
- /// Runs a build or execution target.
+ /// Initializes a new instance of this item, using an xml element as template
/// </summary>
- /// <returns>
- /// The result of the operation
- /// </returns>
- /// <param name='monitor'>
- /// A progress monitor
- /// </param>
- /// <param name='target'>
- /// Name of the target
- /// </param>
- /// <param name='configuration'>
- /// Configuration to use to run the target
+ /// <param name='template'>
+ /// The template
/// </param>
- public BuildResult RunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration)
+ public void InitializeFromTemplate (ProjectCreateInformation projectCreateInfo, XmlElement template)
+ {
+ // TODO NPM: should be internal
+ ItemExtension.OnInitializeFromTemplate (projectCreateInfo, template);
+ }
+
+ protected virtual void OnInitializeFromTemplate (ProjectCreateInformation projectCreateInfo, XmlElement template)
+ {
+ }
+
+ protected sealed override FilePath GetDefaultBaseDirectory ( )
+ {
+ var file = FileName;
+ return file.IsNullOrEmpty ? FilePath.Empty : file.ParentDirectory;
+ }
+
+ internal Task LoadAsync (ProgressMonitor monitor, FilePath fileName, MSBuildFileFormat format)
+ {
+ fileFormat = format;
+ FileName = fileName;
+ Name = Path.GetFileNameWithoutExtension (fileName);
+ return ItemExtension.OnLoad (monitor);
+ }
+
+ public Task SaveAsync (ProgressMonitor monitor, FilePath fileName)
+ {
+ FileName = fileName;
+ return SaveAsync (monitor);
+ }
+
+ public Task SaveAsync (ProgressMonitor monitor)
{
- return Services.ProjectService.GetExtensionChain (this).RunTarget (monitor, this, target, configuration);
+ return BindTask (ct => Runtime.RunInMainThread (async () => {
+ using (await WriteLock ()) {
+ monitor = monitor.WithCancellationToken (ct);
+ await ItemExtension.OnSave (monitor);
+
+ if (ItemExtension.OnCheckHasSolutionData () && !SavingSolution && ParentSolution != null) {
+ // The project has data that has to be saved in the solution, but the solution is not being saved. Do it now.
+ await SolutionFormat.SlnFileFormat.WriteFile (ParentSolution.FileName, ParentSolution, false, monitor);
+ ParentSolution.NeedsReload = false;
+ }
+ }
+ }));
}
- public bool SupportsTarget (string target)
+ async Task DoSave (ProgressMonitor monitor)
+ {
+ if (string.IsNullOrEmpty (FileName))
+ throw new InvalidOperationException ("Project does not have a file name");
+
+ try {
+ fileStatusTracker.BeginSave ();
+ await OnSave (monitor);
+ OnSaved (thisItemArgs);
+ } finally {
+ fileStatusTracker.EndSave ();
+ }
+ FileService.NotifyFileChanged (FileName);
+ }
+
+ internal bool IsSaved {
+ get {
+ return !string.IsNullOrEmpty (FileName) && File.Exists (FileName);
+ }
+ }
+
+ public override bool NeedsReload {
+ get { return fileStatusTracker.NeedsReload; }
+ set { fileStatusTracker.NeedsReload = value; }
+ }
+
+ public bool ItemFilesChanged {
+ get { return ItemExtension.ItemFilesChanged; }
+ }
+
+ bool BaseItemFilesChanged {
+ get { return fileStatusTracker.ItemFilesChanged; }
+ }
+
+ bool IBuildTarget.CanBuild (ConfigurationSelector configuration)
{
- return Services.ProjectService.GetExtensionChain (this).SupportsTarget (this, target);
+ return SupportsBuild ();
}
public bool SupportsBuild ()
{
- return SupportsTarget (ProjectService.BuildTarget);
+ return ItemExtension.OnGetSupportedFeatures ().HasFlag (ProjectFeatures.Build);
}
public bool SupportsExecute ()
{
- return Services.ProjectService.GetExtensionChain (this).SupportsExecute (this);
+ return ItemExtension.OnGetSupportedFeatures ().HasFlag (ProjectFeatures.Execute);
+ }
+
+ public bool SupportsConfigurations ()
+ {
+ return ItemExtension.OnGetSupportedFeatures ().HasFlag (ProjectFeatures.Configurations);
+ }
+
+ protected virtual ProjectFeatures OnGetSupportedFeatures ()
+ {
+ if (IsUnsupportedProject)
+ return ProjectFeatures.Configurations;
+ else
+ return ProjectFeatures.Execute | ProjectFeatures.Build | ProjectFeatures.Configurations;
}
/// <summary>
- /// Cleans the files produced by this solution item
+ /// Gets a value indicating whether this project is supported.
/// </summary>
- /// <param name='monitor'>
- /// A progress monitor
- /// </param>
- /// <param name='configuration'>
- /// Configuration to use to clean the project
- /// </param>
- public void Clean (IProgressMonitor monitor, ConfigurationSelector configuration)
+ /// <remarks>
+ /// Unsupported projects are shown in the solution pad, but operations such as building on executing won't be available.
+ /// </remarks>
+ public bool IsUnsupportedProject { get; protected set; }
+
+ /// <summary>
+ /// Gets a message that explain why the project is not supported (when IsUnsupportedProject returns true)
+ /// </summary>
+ public string UnsupportedProjectMessage {
+ get { return IsUnsupportedProject ? (loadError ?? GettextCatalog.GetString ("Unknown project type")) : ""; }
+ set { loadError = value; }
+ }
+ string loadError;
+
+ [Obsolete ("This method will be removed in future releases")]
+ public bool NeedsBuilding (ConfigurationSelector configuration)
{
- ITimeTracker tt = Counters.CleanProjectTimer.BeginTiming ("Cleaning " + Name, GetProjectEventMetadata (configuration));
- try {
- //SolutionFolder handles the begin/end task itself, don't duplicate
- if (this is SolutionFolder) {
- RunTarget (monitor, ProjectService.CleanTarget, configuration);
- return;
- }
-
- try {
- SolutionEntityItem it = this as SolutionEntityItem;
- SolutionItemConfiguration iconf = it != null ? it.GetConfiguration (configuration) : null;
- string confName = iconf != null ? iconf.Id : configuration.ToString ();
- monitor.BeginTask (GettextCatalog.GetString ("Cleaning: {0} ({1})", Name, confName), 1);
- RunTarget (monitor, ProjectService.CleanTarget, configuration);
- } finally {
- monitor.EndTask ();
- }
- }
- finally {
- tt.End ();
- }
+ return ItemExtension.OnNeedsBuilding (configuration);
}
-
+
+ internal protected virtual bool OnGetNeedsBuilding (ConfigurationSelector configuration)
+ {
+ return false;
+ }
+
+ [Obsolete ("This method will be removed in future releases")]
+ public void SetNeedsBuilding (ConfigurationSelector configuration)
+ {
+ OnSetNeedsBuilding (configuration);
+ }
+
+ protected virtual void OnSetNeedsBuilding (ConfigurationSelector configuration)
+ {
+ }
+
/// <summary>
/// Builds the solution item
/// </summary>
/// <param name='monitor'>
/// A progress monitor
/// </param>
- /// <param name='configuration'>
+ /// <param name='solutionConfiguration'>
/// Configuration to use to build the project
/// </param>
- public BuildResult Build (IProgressMonitor monitor, ConfigurationSelector configuration)
+ public Task<BuildResult> Build (ProgressMonitor monitor, ConfigurationSelector solutionConfiguration)
{
- return Build (monitor, configuration, false);
+ return Build (monitor, solutionConfiguration, false);
}
-
+
/// <summary>
/// Builds the solution item
/// </summary>
@@ -572,283 +558,198 @@ namespace MonoDevelop.Projects
/// <param name='buildReferences'>
/// When set to <c>true</c>, the referenced items will be built before building this item
/// </param>
- public BuildResult Build (IProgressMonitor monitor, ConfigurationSelector solutionConfiguration, bool buildReferences)
+ public Task<BuildResult> Build (ProgressMonitor monitor, ConfigurationSelector solutionConfiguration, bool buildReferences)
+ {
+ return BindTask (ct => BuildTask (monitor.WithCancellationToken (ct), solutionConfiguration, buildReferences, new OperationContext ()));
+ }
+
+ public Task<BuildResult> Build (ProgressMonitor monitor, ConfigurationSelector solutionConfiguration, bool buildReferences, OperationContext operationContext)
+ {
+ return BindTask (ct => BuildTask (monitor.WithCancellationToken (ct), solutionConfiguration, buildReferences, operationContext));
+ }
+
+ async Task<BuildResult> BuildTask (ProgressMonitor monitor, ConfigurationSelector solutionConfiguration, bool buildReferences, OperationContext operationContext)
{
if (!buildReferences) {
- //SolutionFolder's OnRunTarget handles the begin/end task itself, don't duplicate
- if (this is SolutionFolder) {
- return RunTarget (monitor, ProjectService.BuildTarget, solutionConfiguration);
- }
-
try {
- SolutionEntityItem it = this as SolutionEntityItem;
- SolutionItemConfiguration iconf = it != null ? it.GetConfiguration (solutionConfiguration) : null;
+ SolutionItemConfiguration iconf = GetConfiguration (solutionConfiguration);
string confName = iconf != null ? iconf.Id : solutionConfiguration.ToString ();
monitor.BeginTask (GettextCatalog.GetString ("Building: {0} ({1})", Name, confName), 1);
-
+
using (Counters.BuildProjectTimer.BeginTiming ("Building " + Name, GetProjectEventMetadata (solutionConfiguration))) {
- // This will end calling OnBuild ()
- return RunTarget (monitor, ProjectService.BuildTarget, solutionConfiguration);
+ return await InternalBuild (monitor, solutionConfiguration, operationContext);
}
-
+
} finally {
monitor.EndTask ();
}
}
-
+
ITimeTracker tt = Counters.BuildProjectAndReferencesTimer.BeginTiming ("Building " + Name, GetProjectEventMetadata (solutionConfiguration));
try {
// Get a list of all items that need to be built (including this),
// and build them in the correct order
-
- List<SolutionItem> referenced = new List<SolutionItem> ();
- Set<SolutionItem> visited = new Set<SolutionItem> ();
+
+ var referenced = new List<SolutionItem> ();
+ var visited = new Set<SolutionItem> ();
GetBuildableReferencedItems (visited, referenced, this, solutionConfiguration);
-
- ReadOnlyCollection<SolutionItem> sortedReferenced = SolutionFolder.TopologicalSort (referenced, solutionConfiguration);
-
- BuildResult cres = new BuildResult ();
- cres.BuildCount = 0;
- HashSet<SolutionItem> failedItems = new HashSet<SolutionItem> ();
-
- monitor.BeginTask (null, sortedReferenced.Count);
- foreach (SolutionItem p in sortedReferenced) {
- if (!p.ContainsReferences (failedItems, solutionConfiguration)) {
- BuildResult res = p.Build (monitor, solutionConfiguration, false);
- cres.Append (res);
- if (res.ErrorCount > 0)
- failedItems.Add (p);
- } else
- failedItems.Add (p);
- monitor.Step (1);
- if (monitor.IsCancelRequested)
- break;
- }
- monitor.EndTask ();
- return cres;
+
+ var sortedReferenced = TopologicalSort (referenced, solutionConfiguration);
+
+ SolutionItemConfiguration iconf = GetConfiguration (solutionConfiguration);
+ string confName = iconf != null ? iconf.Id : solutionConfiguration.ToString ();
+ monitor.BeginTask (GettextCatalog.GetString ("Building: {0} ({1})", Name, confName), sortedReferenced.Count);
+
+ return await SolutionFolder.RunParallelBuildOperation (monitor, solutionConfiguration, sortedReferenced, (ProgressMonitor m, SolutionItem item) => {
+ return item.Build (m, solutionConfiguration, false, operationContext);
+ }, false);
} finally {
+ monitor.EndTask ();
tt.End ();
}
}
- public BuildResult Build (IProgressMonitor monitor, ConfigurationSelector solutionConfiguration, bool buildReferences, ProjectOperationContext context)
+ async Task<BuildResult> InternalBuild (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
- try {
- System.Runtime.Remoting.Messaging.CallContext.SetData ("MonoDevelop.Projects.ProjectOperationContext", context);
- return Build (monitor, solutionConfiguration, buildReferences);
- } finally {
- System.Runtime.Remoting.Messaging.CallContext.SetData ("MonoDevelop.Projects.ProjectOperationContext", null);
+ if (IsUnsupportedProject) {
+ var r = new BuildResult ();
+ r.AddError (UnsupportedProjectMessage);
+ return r;
}
- }
- internal bool ContainsReferences (HashSet<SolutionItem> items, ConfigurationSelector conf)
- {
- foreach (SolutionItem it in GetReferencedItems (conf))
- if (items.Contains (it))
- return true;
- return false;
+ SolutionItemConfiguration conf = GetConfiguration (configuration) as SolutionItemConfiguration;
+ if (conf != null) {
+ if (conf.CustomCommands.CanExecute (this, CustomCommandType.BeforeBuild, null, configuration)) {
+ if (!await conf.CustomCommands.ExecuteCommand (monitor, this, CustomCommandType.BeforeBuild, configuration)) {
+ var r = new BuildResult ();
+ r.AddError (GettextCatalog.GetString ("Custom command execution failed"));
+ return r;
+ }
+ }
+ }
+
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return new BuildResult (new CompilerResults (null), "");
+
+ BuildResult res = await ItemExtension.OnBuild (monitor, configuration, operationContext);
+
+ if (conf != null && !monitor.CancellationToken.IsCancellationRequested && !res.Failed) {
+ if (conf.CustomCommands.CanExecute (this, CustomCommandType.AfterBuild, null, configuration)) {
+ if (!await conf.CustomCommands.ExecuteCommand (monitor, this, CustomCommandType.AfterBuild, configuration))
+ res.AddError (GettextCatalog.GetString ("Custom command execution failed"));
+ }
+ }
+
+ return res;
}
/// <summary>
- /// Gets the time of the last build
+ /// Builds the solution item
/// </summary>
- /// <returns>
- /// The last build time.
- /// </returns>
+ /// <param name='monitor'>
+ /// A progress monitor
+ /// </param>
/// <param name='configuration'>
- /// Configuration for which to get the last build time.
+ /// Configuration to use to build the project
/// </param>
- public DateTime GetLastBuildTime (ConfigurationSelector configuration)
+ protected virtual Task<BuildResult> OnBuild (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
- return OnGetLastBuildTime (configuration);
+ return Task.FromResult (BuildResult.CreateSuccess ());
}
-
+
void GetBuildableReferencedItems (Set<SolutionItem> visited, List<SolutionItem> referenced, SolutionItem item, ConfigurationSelector configuration)
- {
+ {
if (!visited.Add(item))
return;
-
+
referenced.Add (item);
- foreach (SolutionItem ritem in item.GetReferencedItems (configuration))
+ foreach (var ritem in item.GetReferencedItems (configuration))
GetBuildableReferencedItems (visited, referenced, ritem, configuration);
}
-
+
+ internal bool ContainsReferences (HashSet<SolutionItem> items, ConfigurationSelector conf)
+ {
+ foreach (var it in GetReferencedItems (conf))
+ if (items.Contains (it))
+ return true;
+ return false;
+ }
+
/// <summary>
- /// Executes this solution item
+ /// Cleans the files produced by this solution item
/// </summary>
/// <param name='monitor'>
/// A progress monitor
/// </param>
- /// <param name='context'>
- /// An execution context
- /// </param>
/// <param name='configuration'>
- /// Configuration to use to execute the item
+ /// Configuration to use to clean the project
/// </param>
- public void Execute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ public Task<BuildResult> Clean (ProgressMonitor monitor, ConfigurationSelector configuration)
{
- Services.ProjectService.GetExtensionChain (this).Execute (monitor, this, context, configuration);
+ return BindTask (ct => CleanTask (monitor.WithCancellationToken (ct), configuration, new OperationContext ()));
}
-
- /// <summary>
- /// Determines whether this solution item can be executed using the specified context and configuration.
- /// </summary>
- /// <returns>
- /// <c>true</c> if this instance can be executed; otherwise, <c>false</c>.
- /// </returns>
- /// <param name='context'>
- /// An execution context
- /// </param>
- /// <param name='configuration'>
- /// Configuration to use to execute the item
- /// </param>
- public bool CanExecute (ExecutionContext context, ConfigurationSelector configuration)
+
+ public Task<BuildResult> Clean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
- return Services.ProjectService.GetExtensionChain (this).CanExecute (this, context, configuration);
+ return BindTask (ct => CleanTask (monitor.WithCancellationToken (ct), configuration, operationContext));
}
- /// <summary>
- /// Gets the execution targets.
- /// </summary>
- /// <returns>The execution targets.</returns>
- /// <param name="configuration">The configuration.</param>
- public IEnumerable<ExecutionTarget> GetExecutionTargets (ConfigurationSelector configuration)
+ async Task<BuildResult> CleanTask (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
- return Services.ProjectService.GetExtensionChain (this).GetExecutionTargets (this, configuration);
- }
+ ITimeTracker tt = Counters.BuildProjectTimer.BeginTiming ("Cleaning " + Name, GetProjectEventMetadata (configuration));
+ try {
+ try {
+ SolutionItemConfiguration iconf = GetConfiguration (configuration);
+ string confName = iconf != null ? iconf.Id : configuration.ToString ();
+ monitor.BeginTask (GettextCatalog.GetString ("Cleaning: {0} ({1})", Name, confName), 1);
- public event EventHandler ExecutionTargetsChanged;
+ SolutionItemConfiguration conf = GetConfiguration (configuration);
+ if (conf != null) {
+ if (conf.CustomCommands.CanExecute (this, CustomCommandType.BeforeClean, null, configuration)) {
+ if (!await conf.CustomCommands.ExecuteCommand (monitor, this, CustomCommandType.BeforeClean, configuration)) {
+ var r = new BuildResult ();
+ r.AddError (GettextCatalog.GetString ("Custom command execution failed"));
+ return r;
+ }
+ }
+ }
- protected virtual void OnExecutionTargetsChanged ()
- {
- if (ExecutionTargetsChanged != null)
- ExecutionTargetsChanged (this, EventArgs.Empty);
- }
-
- /// <summary>
- /// Checks if this solution item has modified files and has to be built
- /// </summary>
- /// <returns>
- /// <c>true</c> if the solution item has to be built
- /// </returns>
- /// <param name='configuration'>
- /// Configuration for which to do the check
- /// </param>
- [Obsolete ("This method will be removed in future releases")]
- public bool NeedsBuilding (ConfigurationSelector configuration)
- {
- return true;
- }
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return BuildResult.CreateSuccess ();
- internal bool InternalCheckNeedsBuild (ConfigurationSelector configuration)
- {
- using (Counters.NeedsBuildingTimer.BeginTiming ("NeedsBuilding check for " + Name)) {
- return Services.ProjectService.GetExtensionChain (this).GetNeedsBuilding (this, configuration);
+ var res = await ItemExtension.OnClean (monitor, configuration, operationContext);
+
+ if (conf != null && !monitor.CancellationToken.IsCancellationRequested) {
+ if (conf.CustomCommands.CanExecute (this, CustomCommandType.AfterClean, null, configuration)) {
+ if (!await conf.CustomCommands.ExecuteCommand (monitor, this, CustomCommandType.AfterClean, configuration))
+ res.AddError (GettextCatalog.GetString ("Custom command execution failed"));
+ }
+ }
+ return res;
+
+ } finally {
+ monitor.EndTask ();
+ }
+ } finally {
+ tt.End ();
}
}
/// <summary>
- /// States whether this solution item needs to be built or not
+ /// Cleans the files produced by this solution item
/// </summary>
- /// <param name='value'>
- /// Whether this solution item needs to be built or not
+ /// <param name='monitor'>
+ /// A progress monitor
/// </param>
/// <param name='configuration'>
- /// Configuration for which to set the flag
- /// </param>
- [Obsolete ("This method will be removed in future releases")]
- public void SetNeedsBuilding (bool value, ConfigurationSelector configuration)
- {
- // Nothing to be done.
- }
-
- /// <summary>
- /// Gets or sets a value indicating whether this <see cref="MonoDevelop.Projects.SolutionItem"/> needs to be reload due to changes in project or solution file
- /// </summary>
- /// <value>
- /// <c>true</c> if needs reload; otherwise, <c>false</c>.
- /// </value>
- public virtual bool NeedsReload {
- get {
- if (ParentSolution != null)
- return ParentSolution.NeedsReload;
- else
- return false;
- }
- set {
- }
- }
-
- /// <summary>
- /// Registers an internal child item.
- /// </summary>
- /// <param name='item'>
- /// An item
- /// </param>
- /// <remarks>
- /// Some kind of projects may be composed of several child projects.
- /// By registering those child projects using this method, the child
- /// projects will be plugged into the parent solution infrastructure
- /// (so for example, the ParentSolution property for those projects
- /// will return the correct value)
- /// </remarks>
- protected void RegisterInternalChild (SolutionItem item)
- {
- if (internalChildren == null) {
- internalChildren = new SolutionFolder ();
- internalChildren.ParentFolder = parentFolder;
- }
- internalChildren.Items.Add (item);
- }
-
- /// <summary>
- /// Unregisters an internal child item.
- /// </summary>
- /// <param name='item'>
- /// The item
- /// </param>
- protected void UnregisterInternalChild (SolutionItem item)
- {
- if (internalChildren != null)
- internalChildren.Items.Remove (item);
- }
-
- /// <summary>
- /// Gets the string tag model description for this solution item
- /// </summary>
- /// <returns>
- /// The string tag model description
- /// </returns>
- /// <param name='conf'>
- /// Configuration for which to get the string tag model description
- /// </param>
- public virtual StringTagModelDescription GetStringTagModelDescription (ConfigurationSelector conf)
- {
- StringTagModelDescription model = new StringTagModelDescription ();
- model.Add (GetType ());
- model.Add (typeof(Solution));
- return model;
- }
-
- /// <summary>
- /// Gets the string tag model for this solution item
- /// </summary>
- /// <returns>
- /// The string tag model
- /// </returns>
- /// <param name='conf'>
- /// Configuration for which to get the string tag model
+ /// Configuration to use to clean the project
/// </param>
- public virtual StringTagModel GetStringTagModel (ConfigurationSelector conf)
+ protected virtual Task<BuildResult> OnClean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext buildSession)
{
- StringTagModel source = new StringTagModel ();
- source.Add (this);
- if (ParentSolution != null)
- source.Add (ParentSolution.GetStringTagModel ());
- return source;
+ return Task.FromResult (BuildResult.CreateSuccess ());
}
-
+
/// <summary>
/// Sorts a collection of solution items, taking into account the dependencies between them
/// </summary>
@@ -871,7 +772,7 @@ namespace MonoDevelop.Projects
allItems = items as IList<T>;
if (allItems == null)
allItems = new List<T> (items);
-
+
List<T> sortedEntries = new List<T> ();
bool[] inserted = new bool[allItems.Count];
bool[] triedToInsert = new bool[allItems.Count];
@@ -881,18 +782,18 @@ namespace MonoDevelop.Projects
}
return sortedEntries.AsReadOnly ();
}
-
+
static void Insert<T> (int index, IList<T> allItems, List<T> sortedItems, bool[] inserted, bool[] triedToInsert, ConfigurationSelector solutionConfiguration) where T: SolutionItem
{
if (triedToInsert[index]) {
throw new CyclicDependencyException ();
}
triedToInsert[index] = true;
- SolutionItem insertItem = allItems[index];
-
- foreach (SolutionItem reference in insertItem.GetReferencedItems (solutionConfiguration)) {
+ var insertItem = allItems[index];
+
+ foreach (var reference in insertItem.GetReferencedItems (solutionConfiguration)) {
for (int j=0; j < allItems.Count; ++j) {
- SolutionItem checkItem = allItems[j];
+ SolutionFolderItem checkItem = allItems[j];
if (reference == checkItem) {
if (!inserted[j])
Insert (j, allItems, sortedItems, inserted, triedToInsert, solutionConfiguration);
@@ -900,18 +801,10 @@ namespace MonoDevelop.Projects
}
}
}
- sortedItems.Add ((T)insertItem);
+ sortedItems.Add (insertItem);
inserted[index] = true;
}
- internal virtual IDictionary InternalGetExtendedProperties {
- get {
- if (extendedProperties == null)
- extendedProperties = new Hashtable ();
- return extendedProperties;
- }
- }
-
public IDictionary<string, string> GetProjectEventMetadata (ConfigurationSelector configurationSelector)
{
var data = new Dictionary<string, string> ();
@@ -930,135 +823,86 @@ namespace MonoDevelop.Projects
{
}
- void ILoadController.BeginLoad ()
- {
- loading++;
- OnBeginLoad ();
- }
-
- void ILoadController.EndLoad ()
- {
- loading--;
- OnEndLoad ();
- }
-
/// <summary>
- /// Called when a load operation for this solution item has started
- /// </summary>
- protected virtual void OnBeginLoad ()
- {
- }
-
- /// <summary>
- /// Called when a load operation for this solution item has finished
- /// </summary>
- protected virtual void OnEndLoad ()
- {
- }
-
- /// <summary>
- /// Notifies that this solution item has been modified
+ /// Executes this solution item
/// </summary>
- /// <param name='hint'>
- /// Hint about which part of the solution item has been modified. This will typically be the property name.
+ /// <param name='monitor'>
+ /// A progress monitor
/// </param>
- internal protected void NotifyModified (string hint)
- {
- if (!Loading)
- ItemHandler.OnModified (hint);
- OnModified (new SolutionItemModifiedEventArgs (this, hint));
- }
-
- /// <summary>
- /// Raises the modified event.
- /// </summary>
- /// <param name='args'>
- /// Arguments.
+ /// <param name='context'>
+ /// An execution context
/// </param>
- protected virtual void OnModified (SolutionItemModifiedEventArgs args)
- {
- if (Modified != null && !Disposed)
- Modified (this, args);
- }
-
- /// <summary>
- /// Raises the name changed event.
- /// </summary>
- /// <param name='e'>
- /// Arguments.
+ /// <param name='configuration'>
+ /// Configuration to use to execute the item
/// </param>
- protected virtual void OnNameChanged (SolutionItemRenamedEventArgs e)
+ public async Task Execute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
{
- NotifyModified ("Name");
- if (NameChanged != null && !Disposed)
- NameChanged (this, e);
+ SolutionItemConfiguration conf = GetConfiguration (configuration) as SolutionItemConfiguration;
+ if (conf != null) {
+ ExecutionContext localContext = new ExecutionContext (Runtime.ProcessService.DefaultExecutionHandler, context.ConsoleFactory, context.ExecutionTarget);
+
+ if (conf.CustomCommands.CanExecute (this, CustomCommandType.BeforeExecute, localContext, configuration)) {
+ if (!await conf.CustomCommands.ExecuteCommand (monitor, this, CustomCommandType.BeforeExecute, localContext, configuration))
+ return;
+ }
+ }
+
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return;
+
+ await ItemExtension.OnExecute (monitor, context, configuration);
+
+ if (conf != null && !monitor.CancellationToken.IsCancellationRequested) {
+ ExecutionContext localContext = new ExecutionContext (Runtime.ProcessService.DefaultExecutionHandler, context.ConsoleFactory, context.ExecutionTarget);
+
+ if (conf.CustomCommands.CanExecute (this, CustomCommandType.AfterExecute, localContext, configuration))
+ await conf.CustomCommands.ExecuteCommand (monitor, this, CustomCommandType.AfterExecute, localContext, configuration);
+ }
}
-
+
/// <summary>
- /// Initializes the item handler.
+ /// Prepares the target for execution
/// </summary>
- /// <remarks>
- /// This method is called the first time an item handler is requested.
- /// Subclasses should override this method use SetItemHandler to
- /// assign a handler to this item.
- /// </remarks>
- protected virtual void InitializeItemHandler ()
+ /// <returns>The execution.</returns>
+ /// <param name="monitor">Monitor for tracking progress</param>
+ /// <param name="context">Execution context</param>
+ /// <param name="configuration">Configuration to execute</param>
+ /// <remarks>This method can be called (it is not mandatory) before Execute() to give the target a chance
+ /// to asynchronously prepare the execution that is going to be done later on. It can be used for example
+ /// to start the simulator that is going to be used for execution. Calling this method is optional, and
+ /// there is no guarantee that Execute() will actually be called.</remarks>
+ public Task PrepareExecution (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
{
+ return BindTask (ct => ItemExtension.OnPrepareExecution (monitor.WithCancellationToken (ct), context, configuration));
}
-
+
/// <summary>
- /// Runs a build or execution target.
+ /// Determines whether this solution item can be executed using the specified context and configuration.
/// </summary>
/// <returns>
- /// The result of the operation
+ /// <c>true</c> if this instance can be executed; otherwise, <c>false</c>.
/// </returns>
- /// <param name='monitor'>
- /// A progress monitor
- /// </param>
- /// <param name='target'>
- /// Name of the target
+ /// <param name='context'>
+ /// An execution context
/// </param>
/// <param name='configuration'>
- /// Configuration to use to run the target
+ /// Configuration to use to execute the item
/// </param>
- /// <remarks>
- /// Subclasses can override this method to provide a custom implementation of project operations such as
- /// build or clean. The default implementation delegates the execution to the more specific OnBuild
- /// and OnClean methods, or to the item handler for other targets.
- /// </remarks>
- internal protected virtual BuildResult OnRunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration)
+ public bool CanExecute (ExecutionContext context, ConfigurationSelector configuration)
{
- if (target == ProjectService.BuildTarget)
- return OnBuild (monitor, configuration);
- else if (target == ProjectService.CleanTarget) {
- OnClean (monitor, configuration);
- return new BuildResult ();
+ return !IsUnsupportedProject && ItemExtension.OnGetCanExecute (context, configuration);
+ }
+
+ async Task DoExecute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ {
+ SolutionItemConfiguration conf = GetConfiguration (configuration) as SolutionItemConfiguration;
+ if (conf != null && conf.CustomCommands.HasCommands (CustomCommandType.Execute)) {
+ await conf.CustomCommands.ExecuteCommand (monitor, this, CustomCommandType.Execute, context, configuration);
+ return;
}
- return ItemHandler.RunTarget (monitor, target, configuration) ?? new BuildResult ();
+ await OnExecute (monitor, context, configuration);
}
-
- /// <summary>
- /// Cleans the files produced by this solution item
- /// </summary>
- /// <param name='monitor'>
- /// A progress monitor
- /// </param>
- /// <param name='configuration'>
- /// Configuration to use to clean the project
- /// </param>
- protected abstract void OnClean (IProgressMonitor monitor, ConfigurationSelector configuration);
-
- /// <summary>
- /// Builds the solution item
- /// </summary>
- /// <param name='monitor'>
- /// A progress monitor
- /// </param>
- /// <param name='configuration'>
- /// Configuration to use to build the project
- /// </param>
- protected abstract BuildResult OnBuild (IProgressMonitor monitor, ConfigurationSelector configuration);
-
+
/// <summary>
/// Executes this solution item
/// </summary>
@@ -1071,57 +915,33 @@ namespace MonoDevelop.Projects
/// <param name='configuration'>
/// Configuration to use to execute the item
/// </param>
- internal protected abstract void OnExecute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration);
-
- /// <summary>
- /// Checks if this solution item has modified files and has to be built
- /// </summary>
- /// <returns>
- /// <c>true</c> if the solution item has to be built
- /// </returns>
- /// <param name='configuration'>
- /// Configuration for which to do the check
- /// </param>
- internal protected virtual bool OnGetNeedsBuilding (ConfigurationSelector configuration)
+ protected virtual Task OnExecute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
{
- return true;
+ return Task.FromResult (0);
}
-
- /// <summary>
- /// States whether this solution item needs to be built or not
- /// </summary>
- /// <param name='val'>
- /// Whether this solution item needs to be built or not
- /// </param>
- /// <param name='configuration'>
- /// Configuration for which to set the flag
- /// </param>
- internal protected virtual void OnSetNeedsBuilding (bool val, ConfigurationSelector configuration)
- {
- }
-
+
/// <summary>
- /// Gets the time of the last build
+ /// Prepares the target for execution
/// </summary>
- /// <returns>
- /// The last build time.
- /// </returns>
- /// <param name='configuration'>
- /// Configuration for which to get the last build time.
- /// </param>
- internal protected virtual DateTime OnGetLastBuildTime (ConfigurationSelector configuration)
+ /// <returns>The execution.</returns>
+ /// <param name="monitor">Monitor for tracking progress</param>
+ /// <param name="context">Execution context</param>
+ /// <param name="configuration">Configuration to execute</param>
+ /// <remarks>This method can be called (it is not mandatory) before Execute() to give the target a chance
+ /// to asynchronously prepare the execution that is going to be done later on. It can be used for example
+ /// to start the simulator that is going to be used for execution. Calling this method is optional, and
+ /// there is no guarantee that Execute() will actually be called.</remarks>
+ protected virtual Task OnPrepareExecution (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
{
- return DateTime.MinValue;
- }
-
- internal protected virtual bool OnGetSupportsTarget (string target)
- {
- return true;
+ return Task.FromResult (true);
}
- internal protected virtual bool OnGetSupportsExecute ()
+ protected virtual bool DoGetCanExecute (ExecutionContext context, ConfigurationSelector configuration)
{
- return true;
+ SolutionItemConfiguration conf = GetConfiguration (configuration) as SolutionItemConfiguration;
+ if (conf != null && conf.CustomCommands.HasCommands (CustomCommandType.Execute))
+ return conf.CustomCommands.CanExecute (this, CustomCommandType.Execute, context, configuration);
+ return OnGetCanExecute (context, configuration);
}
/// <summary>
@@ -1136,51 +956,517 @@ namespace MonoDevelop.Projects
/// <param name='configuration'>
/// Configuration to use to execute the item
/// </param>
- internal protected virtual bool OnGetCanExecute (ExecutionContext context, ConfigurationSelector configuration)
+ protected virtual bool OnGetCanExecute (ExecutionContext context, ConfigurationSelector configuration)
{
+ SolutionItemConfiguration conf = GetConfiguration (configuration) as SolutionItemConfiguration;
+ if (conf != null && conf.CustomCommands.HasCommands (CustomCommandType.Execute))
+ return conf.CustomCommands.CanExecute (this, CustomCommandType.Execute, context, configuration);
return false;
}
- internal protected virtual IEnumerable<ExecutionTarget> OnGetExecutionTargets (ConfigurationSelector configuration)
+ /// <summary>
+ /// Gets the execution targets.
+ /// </summary>
+ /// <returns>The execution targets.</returns>
+ /// <param name="configuration">The configuration.</param>
+ public IEnumerable<ExecutionTarget> GetExecutionTargets (ConfigurationSelector configuration)
{
- yield break;
+ return ItemExtension.OnGetExecutionTargets (configuration);
}
- /// <summary>
- /// Called just after this item is bound to a solution
- /// </summary>
- protected virtual void OnBoundToSolution ()
+ protected void NotifyExecutionTargetsChanged ()
+ {
+ ItemExtension.OnExecutionTargetsChanged ();
+ }
+
+ public event EventHandler ExecutionTargetsChanged;
+
+ protected virtual void OnExecutionTargetsChanged ()
+ {
+ if (ExecutionTargetsChanged != null)
+ ExecutionTargetsChanged (this, EventArgs.Empty);
+ }
+
+ protected virtual Task OnLoad (ProgressMonitor monitor)
+ {
+ return Task.FromResult (0);
+ }
+
+ protected internal virtual Task OnSave (ProgressMonitor monitor)
{
+ return Task.FromResult (0);
+ }
+
+ public FilePath GetAbsoluteChildPath (FilePath relPath)
+ {
+ return relPath.ToAbsolute (BaseDirectory);
+ }
+
+ public FilePath GetRelativeChildPath (FilePath absPath)
+ {
+ return absPath.ToRelative (BaseDirectory);
+ }
+
+ public IEnumerable<FilePath> GetItemFiles (bool includeReferencedFiles)
+ {
+ return ItemExtension.OnGetItemFiles (includeReferencedFiles);
+ }
+
+ protected virtual IEnumerable<FilePath> OnGetItemFiles (bool includeReferencedFiles)
+ {
+ if (!FileName.IsNullOrEmpty)
+ yield return FileName;
+ }
+
+ protected override void OnNameChanged (SolutionItemRenamedEventArgs e)
+ {
+ Solution solution = this.ParentSolution;
+
+ if (solution != null) {
+ foreach (DotNetProject project in solution.GetAllItems<DotNetProject>()) {
+ if (project == this)
+ continue;
+
+ project.RenameReferences (e.OldName, e.NewName);
+ }
+ }
+ fileStatusTracker.ResetLoadTimes ();
+ base.OnNameChanged (e);
+ }
+
+ protected virtual void OnSaved (SolutionItemEventArgs args)
+ {
+ if (Saved != null)
+ Saved (this, args);
+ }
+
+ public SolutionItemConfiguration GetConfiguration (ConfigurationSelector configuration)
+ {
+ return (SolutionItemConfiguration) configuration.GetConfiguration (this) ?? DefaultConfiguration;
+ }
+
+ ItemConfiguration IConfigurationTarget.DefaultConfiguration {
+ get { return DefaultConfiguration; }
+ set { DefaultConfiguration = (SolutionItemConfiguration) value; }
+ }
+
+ public SolutionItemConfiguration DefaultConfiguration {
+ get {
+ if (activeConfiguration == null && configurations.Count > 0) {
+ return configurations[0];
+ }
+ return activeConfiguration;
+ }
+ set {
+ if (activeConfiguration != value) {
+ activeConfiguration = value;
+ NotifyModified ("DefaultConfiguration");
+ OnDefaultConfigurationChanged (new ConfigurationEventArgs (this, value));
+ }
+ }
+ }
+
+ public string DefaultConfigurationId {
+ get {
+ if (DefaultConfiguration != null)
+ return DefaultConfiguration.Id;
+ else
+ return null;
+ }
+ set {
+ DefaultConfiguration = GetConfiguration (new ItemConfigurationSelector (value));
+ }
+ }
+
+ public ReadOnlyCollection<string> GetConfigurations ()
+ {
+ List<string> configs = new List<string> ();
+ foreach (SolutionItemConfiguration conf in Configurations)
+ configs.Add (conf.Id);
+ return configs.AsReadOnly ();
+ }
+
+ public SolutionItemConfigurationCollection Configurations {
+ get {
+ return configurations;
+ }
+ }
+
+ IItemConfigurationCollection IConfigurationTarget.Configurations {
+ get {
+ return Configurations;
+ }
+ }
+
+ public SolutionItemConfiguration AddNewConfiguration (string name, ConfigurationKind kind = ConfigurationKind.Blank)
+ {
+ SolutionItemConfiguration config = CreateConfiguration (name, kind);
+ Configurations.Add (config);
+ return config;
+ }
+
+ ItemConfiguration IConfigurationTarget.CreateConfiguration (string id, ConfigurationKind kind)
+ {
+ return CreateConfiguration (id, kind);
+ }
+
+ public SolutionItemConfiguration CreateConfiguration (string name, string platform, ConfigurationKind kind = ConfigurationKind.Blank)
+ {
+ return ItemExtension.OnCreateConfiguration (name + "|" + platform, kind);
+ }
+
+ public SolutionItemConfiguration CreateConfiguration (string id, ConfigurationKind kind = ConfigurationKind.Blank)
+ {
+ return ItemExtension.OnCreateConfiguration (id, kind);
+ }
+
+ public SolutionItemConfiguration CloneConfiguration (SolutionItemConfiguration configuration, string newName, string newPlatform)
+ {
+ return CloneConfiguration (configuration, newName + "|" + newPlatform);
+ }
+
+ public SolutionItemConfiguration CloneConfiguration (SolutionItemConfiguration configuration, string newId)
+ {
+ var clone = CreateConfiguration (newId);
+ clone.CopyFrom (configuration, true);
+ return clone;
+ }
+
+ protected virtual SolutionItemConfiguration OnCreateConfiguration (string id, ConfigurationKind kind = ConfigurationKind.Blank)
+ {
+ return new SolutionItemConfiguration (id);
+ }
+
+ void OnConfigurationAddedToCollection (object ob, ConfigurationEventArgs args)
+ {
+ NotifyModified ("Configurations");
+ OnConfigurationAdded (new ConfigurationEventArgs (this, args.Configuration));
+ if (ConfigurationsChanged != null)
+ ConfigurationsChanged (this, EventArgs.Empty);
+ if (activeConfiguration == null)
+ DefaultConfigurationId = args.Configuration.Id;
+ }
+
+ void OnConfigurationRemovedFromCollection (object ob, ConfigurationEventArgs args)
+ {
+ if (activeConfiguration == args.Configuration) {
+ if (Configurations.Count > 0)
+ DefaultConfiguration = Configurations [0];
+ else
+ DefaultConfiguration = null;
+ }
+ NotifyModified ("Configurations");
+ OnConfigurationRemoved (new ConfigurationEventArgs (this, args.Configuration));
+ if (ConfigurationsChanged != null)
+ ConfigurationsChanged (this, EventArgs.Empty);
+ }
+
+ protected override StringTagModelDescription OnGetStringTagModelDescription (ConfigurationSelector conf)
+ {
+ StringTagModelDescription model = base.OnGetStringTagModelDescription (conf);
+ SolutionItemConfiguration config = GetConfiguration (conf);
+ if (config != null)
+ model.Add (config.GetType ());
+ else
+ model.Add (typeof(SolutionItemConfiguration));
+ return model;
+ }
+
+ protected override StringTagModel OnGetStringTagModel (ConfigurationSelector conf)
+ {
+ var source = base.OnGetStringTagModel (conf);
+ SolutionItemConfiguration config = GetConfiguration (conf);
+ if (config != null)
+ source.Add (config);
+ return source;
+ }
+
+ internal protected override DateTime OnGetLastBuildTime (ConfigurationSelector configuration)
+ {
+ return ItemExtension.OnGetLastBuildTime (configuration);
+ }
+
+ DateTime DoGetLastBuildTime (ConfigurationSelector configuration)
+ {
+ return base.OnGetLastBuildTime (configuration);
+ }
+
+ protected virtual void OnDefaultConfigurationChanged (ConfigurationEventArgs args)
+ {
+ ItemExtension.OnDefaultConfigurationChanged (args);
+ }
+
+ void DoOnDefaultConfigurationChanged (ConfigurationEventArgs args)
+ {
+ if (DefaultConfigurationChanged != null)
+ DefaultConfigurationChanged (this, args);
+ }
+
+ protected virtual void OnConfigurationAdded (ConfigurationEventArgs args)
+ {
+ AssertMainThread ();
+ ItemExtension.OnConfigurationAdded (args);
+ }
+
+ void DoOnConfigurationAdded (ConfigurationEventArgs args)
+ {
+ if (ConfigurationAdded != null)
+ ConfigurationAdded (this, args);
+ }
+
+ protected virtual void OnConfigurationRemoved (ConfigurationEventArgs args)
+ {
+ AssertMainThread ();
+ ItemExtension.OnConfigurationRemoved (args);
+ }
+
+ void DoOnConfigurationRemoved (ConfigurationEventArgs args)
+ {
+ if (ConfigurationRemoved != null)
+ ConfigurationRemoved (this, args);
+ }
+
+ protected virtual void OnReloadRequired (SolutionItemEventArgs args)
+ {
+ ItemExtension.OnReloadRequired (args);
+ }
+
+ void DoOnReloadRequired (SolutionItemEventArgs args)
+ {
+ fileStatusTracker.FireReloadRequired (args);
+ }
+
+ protected override void OnBoundToSolution ()
+ {
+ ParentSolution.SolutionItemRemoved += HandleSolutionItemRemoved;
+ ParentSolution.SolutionItemAdded += HandleSolutionItemAdded;
+ ItemExtension.OnBoundToSolution ();
+ }
+
+ void DoOnBoundToSolution ()
+ {
+ base.OnBoundToSolution ();
+ }
+
+ protected override void OnUnboundFromSolution ()
+ {
+ ParentSolution.SolutionItemAdded -= HandleSolutionItemAdded;
+ ParentSolution.SolutionItemRemoved -= HandleSolutionItemRemoved;
+ ItemExtension.OnUnboundFromSolution ();
+ }
+
+ void DoOnUnboundFromSolution ()
+ {
+ base.OnUnboundFromSolution ();
}
/// <summary>
- /// Called just before this item is removed from a solution (ParentSolution is still valid when this method is called)
+ /// Override to return True if this class needs to store project related data in the solution file
/// </summary>
- protected virtual void OnUnboundFromSolution ()
+ protected virtual bool OnCheckHasSolutionData ()
{
+ return false;
}
- internal protected virtual object OnGetService (Type t)
+ internal void ReadSolutionData (ProgressMonitor monitor, SlnPropertySet properties)
{
- return ItemHandler.GetService (t);
+ ItemExtension.OnReadSolutionData (monitor, properties);
}
/// <summary>
- /// Occurs when the name of the item changes
+ /// Override to read project related information stored in the solution file
/// </summary>
- public event SolutionItemRenamedEventHandler NameChanged;
-
+ protected virtual void OnReadSolutionData (ProgressMonitor monitor, SlnPropertySet properties)
+ {
+ // Do nothing by default
+ }
+
+ internal void WriteSolutionData (ProgressMonitor monitor, SlnPropertySet properties)
+ {
+ ItemExtension.OnWriteSolutionData (monitor, properties);
+ }
+
/// <summary>
- /// Occurs when the item is modified.
+ /// Override to store project related information in the solution file
/// </summary>
- public event SolutionItemModifiedEventHandler Modified;
+ protected virtual void OnWriteSolutionData (ProgressMonitor monitor, SlnPropertySet properties)
+ {
+ // Do nothing by default
+ }
+
+ public event SolutionItemEventHandler Saved;
/// <summary>
/// Occurs when the object is being disposed
/// </summary>
public event EventHandler Disposing;
- }
+ class DefaultMSBuildItemExtension: SolutionItemExtension
+ {
+ internal protected override void OnInitializeFromTemplate (ProjectCreateInformation projectCreateInfo, XmlElement template)
+ {
+ Item.OnInitializeFromTemplate (projectCreateInfo, template);
+ }
+
+ internal protected override IEnumerable<IBuildTarget> OnGetExecutionDependencies ()
+ {
+ return Item.OnGetExecutionDependencies ();
+ }
+
+ internal protected override IEnumerable<SolutionItem> OnGetReferencedItems (ConfigurationSelector configuration)
+ {
+ return Item.OnGetReferencedItems (configuration);
+ }
+
+ internal protected override void OnSetFormat (MSBuildFileFormat format)
+ {
+ Item.OnSetFormat (format);
+ }
+
+ internal protected override bool OnGetSupportsFormat (MSBuildFileFormat format)
+ {
+ return Item.OnGetSupportsFormat (format);
+ }
+
+ internal protected override IEnumerable<FilePath> OnGetItemFiles (bool includeReferencedFiles)
+ {
+ return Item.OnGetItemFiles (includeReferencedFiles);
+ }
+
+ internal protected override SolutionItemConfiguration OnCreateConfiguration (string id, ConfigurationKind kind)
+ {
+ return Item.OnCreateConfiguration (id, kind);
+ }
+
+ internal protected override DateTime OnGetLastBuildTime (ConfigurationSelector configuration)
+ {
+ return Item.DoGetLastBuildTime (configuration);
+ }
+
+ internal protected override Task OnLoad (ProgressMonitor monitor)
+ {
+ return Item.OnLoad (monitor);
+ }
+
+ internal protected override Task OnSave (ProgressMonitor monitor)
+ {
+ return Item.DoSave (monitor);
+ }
+
+ internal protected override ProjectFeatures OnGetSupportedFeatures ()
+ {
+ return Item.OnGetSupportedFeatures ();
+ }
+
+ internal protected override Task OnExecute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ {
+ return Item.DoExecute (monitor, context, configuration);
+ }
+
+ internal protected override Task OnPrepareExecution (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ {
+ return Item.OnPrepareExecution (monitor, context, configuration);
+ }
+
+ internal protected override bool OnGetCanExecute (ExecutionContext context, ConfigurationSelector configuration)
+ {
+ return Item.DoGetCanExecute (context, configuration);
+ }
+
+ internal protected override IEnumerable<ExecutionTarget> OnGetExecutionTargets (ConfigurationSelector configuration)
+ {
+ yield break;
+ }
+
+ internal protected override void OnExecutionTargetsChanged ()
+ {
+ Item.OnExecutionTargetsChanged ();
+ }
+
+ internal protected override void OnReloadRequired (SolutionItemEventArgs args)
+ {
+ Item.DoOnReloadRequired (args);
+ }
+
+ internal protected override void OnDefaultConfigurationChanged (ConfigurationEventArgs args)
+ {
+ Item.DoOnDefaultConfigurationChanged (args);
+ }
+
+ internal protected override void OnBoundToSolution ()
+ {
+ Item.DoOnBoundToSolution ();
+ }
+
+ internal protected override void OnUnboundFromSolution ()
+ {
+ Item.DoOnUnboundFromSolution ();
+ }
+
+ internal protected override void OnConfigurationAdded (ConfigurationEventArgs args)
+ {
+ Item.DoOnConfigurationAdded (args);
+ }
+
+ internal protected override void OnConfigurationRemoved (ConfigurationEventArgs args)
+ {
+ Item.DoOnConfigurationRemoved (args);
+ }
+
+ internal protected override void OnModified (SolutionItemModifiedEventArgs args)
+ {
+ Item.OnModified (args);
+ }
+
+ internal protected override void OnNameChanged (SolutionItemRenamedEventArgs e)
+ {
+ Item.OnNameChanged (e);
+ }
+
+ internal protected override IconId StockIcon {
+ get {
+ return "md-project";
+ }
+ }
+
+ internal protected override bool ItemFilesChanged {
+ get {
+ return Item.BaseItemFilesChanged;
+ }
+ }
+
+ internal protected override Task<BuildResult> OnBuild (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
+ {
+ return Item.OnBuild (monitor, configuration, operationContext);
+ }
+
+ internal protected override Task<BuildResult> OnClean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext buildSession)
+ {
+ return Item.OnClean (monitor, configuration, buildSession);
+ }
+
+ internal protected override bool OnNeedsBuilding (ConfigurationSelector configuration)
+ {
+ return Item.OnGetNeedsBuilding (configuration);
+ }
+
+ internal protected override void OnWriteSolutionData (ProgressMonitor monitor, SlnPropertySet properties)
+ {
+ Item.OnWriteSolutionData (monitor, properties);
+ }
+
+ internal protected override void OnReadSolutionData (ProgressMonitor monitor, SlnPropertySet properties)
+ {
+ Item.OnReadSolutionData (monitor, properties);
+ }
+
+ internal protected override bool OnCheckHasSolutionData ()
+ {
+ return Item.OnCheckHasSolutionData ();
+ }
+ }
+ }
+
[Mono.Addins.Extension]
class SolutionItemTagProvider: StringTagProvider<SolutionItem>, IStringTagProvider
{
@@ -1193,32 +1479,37 @@ namespace MonoDevelop.Projects
yield return new StringTagDescription ("AuthorCopyright", "Project Author Copyright");
yield return new StringTagDescription ("AuthorCompany", "Project Author Company");
yield return new StringTagDescription ("AuthorTrademark", "Project Trademark");
+ yield return new StringTagDescription ("ProjectFile", "Project File");
}
-
+
public override object GetTagValue (SolutionItem item, string tag)
{
switch (tag) {
- case "ITEMNAME":
- case "PROJECTNAME":
- return item.Name;
- case "AUTHORCOPYRIGHT":
- AuthorInformation authorInfo = item.AuthorInformation ?? AuthorInformation.Default;
- return authorInfo.Copyright;
- case "AUTHORCOMPANY":
- authorInfo = item.AuthorInformation ?? AuthorInformation.Default;
- return authorInfo.Company;
- case "AUTHORTRADEMARK":
- authorInfo = item.AuthorInformation ?? AuthorInformation.Default;
- return authorInfo.Trademark;
- case "AUTHOREMAIL":
- authorInfo = item.AuthorInformation ?? AuthorInformation.Default;
- return authorInfo.Email;
- case "AUTHORNAME":
- authorInfo = item.AuthorInformation ?? AuthorInformation.Default;
- return authorInfo.Name;
- case "ITEMDIR":
- case "PROJECTDIR":
- return item.BaseDirectory;
+ case "ITEMNAME":
+ case "PROJECTNAME":
+ return item.Name;
+ case "AUTHORCOPYRIGHT":
+ AuthorInformation authorInfo = item.AuthorInformation ?? AuthorInformation.Default;
+ return authorInfo.Copyright;
+ case "AUTHORCOMPANY":
+ authorInfo = item.AuthorInformation ?? AuthorInformation.Default;
+ return authorInfo.Company;
+ case "AUTHORTRADEMARK":
+ authorInfo = item.AuthorInformation ?? AuthorInformation.Default;
+ return authorInfo.Trademark;
+ case "AUTHOREMAIL":
+ authorInfo = item.AuthorInformation ?? AuthorInformation.Default;
+ return authorInfo.Email;
+ case "AUTHORNAME":
+ authorInfo = item.AuthorInformation ?? AuthorInformation.Default;
+ return authorInfo.Name;
+ case "ITEMDIR":
+ case "PROJECTDIR":
+ return item.BaseDirectory;
+ case "ITEMFILE":
+ case "PROJECTFILE":
+ case "PROJECTFILENAME":
+ return item.FileName;
}
throw new NotSupportedException ();
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemConfiguration.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemConfiguration.cs
index 8ec16e80e2..3ff754e803 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemConfiguration.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemConfiguration.cs
@@ -37,17 +37,13 @@ namespace MonoDevelop.Projects
[DataItem (FallbackType=typeof(UnknownConfiguration))]
public class SolutionItemConfiguration : ItemConfiguration
{
- SolutionEntityItem parentItem;
-
- public SolutionItemConfiguration ()
- {
- }
+ SolutionItem parentItem;
public SolutionItemConfiguration (string id): base (id)
{
}
- public SolutionEntityItem ParentItem {
+ public SolutionItem ParentItem {
get { return parentItem; }
}
@@ -58,7 +54,7 @@ namespace MonoDevelop.Projects
?? configs.FirstOrDefault (c => Name == c.Name && (c.Platform == "" || c.Platform == "Any CPU"));
}
- internal void SetParentItem (SolutionEntityItem item)
+ internal void SetParentItem (SolutionItem item)
{
parentItem = item;
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemConfigurationCollection.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemConfigurationCollection.cs
index a470671b40..5eddb0d447 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemConfigurationCollection.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemConfigurationCollection.cs
@@ -38,29 +38,33 @@ namespace MonoDevelop.Projects
{
public class SolutionItemConfigurationCollection : ItemConfigurationCollection<SolutionItemConfiguration>
{
- SolutionEntityItem parentItem;
+ SolutionItem parentItem;
public SolutionItemConfigurationCollection ()
{
}
- internal SolutionItemConfigurationCollection (SolutionEntityItem parentItem)
+ internal SolutionItemConfigurationCollection (SolutionItem parentItem)
{
this.parentItem = parentItem;
}
- protected override void OnItemAdded (SolutionItemConfiguration conf)
+ protected override void OnItemsAdded (IEnumerable<SolutionItemConfiguration> confs)
{
- if (parentItem != null)
- conf.SetParentItem (parentItem);
- base.OnItemAdded (conf);
+ if (parentItem != null) {
+ foreach (var conf in confs)
+ conf.SetParentItem (parentItem);
+ }
+ base.OnItemsAdded (confs);
}
- protected override void OnItemRemoved (SolutionItemConfiguration conf)
+ protected override void OnItemsRemoved (IEnumerable<SolutionItemConfiguration> confs)
{
- if (parentItem != null)
- conf.SetParentItem (null);
- base.OnItemRemoved (conf);
+ if (parentItem != null) {
+ foreach (var conf in confs)
+ conf.SetParentItem (null);
+ }
+ base.OnItemsRemoved (confs);
}
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemEventArgs.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemEventArgs.cs
index d9b34ca114..0ca212bfdd 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemEventArgs.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemEventArgs.cs
@@ -36,10 +36,10 @@ namespace MonoDevelop.Projects
public class SolutionItemEventArgs : EventArgs
{
- SolutionItem entry;
+ SolutionFolderItem entry;
Solution solution;
- public SolutionItem SolutionItem {
+ public SolutionFolderItem SolutionItem {
get {
return entry;
}
@@ -51,12 +51,12 @@ namespace MonoDevelop.Projects
}
}
- public SolutionItemEventArgs (SolutionItem entry)
+ public SolutionItemEventArgs (SolutionFolderItem entry)
{
this.entry = entry;
}
- public SolutionItemEventArgs (SolutionItem entry, Solution solution)
+ public SolutionItemEventArgs (SolutionFolderItem entry, Solution solution)
{
this.solution = solution;
this.entry = entry;
@@ -69,7 +69,7 @@ namespace MonoDevelop.Projects
{
bool reloading;
- public SolutionItemChangeEventArgs (SolutionItem item, Solution parentSolution, bool reloading): base (item, parentSolution)
+ public SolutionItemChangeEventArgs (SolutionFolderItem item, Solution parentSolution, bool reloading): base (item, parentSolution)
{
this.reloading = reloading;
}
@@ -82,14 +82,14 @@ namespace MonoDevelop.Projects
/// When Reloading is true, it returns the original solution item that is being reloaded
/// </summary>
/// <value>The replaced item.</value>
- public SolutionItem ReplacedItem { get; internal set; }
+ public SolutionFolderItem ReplacedItem { get; internal set; }
}
public delegate void SolutionItemModifiedEventHandler (object sender, SolutionItemModifiedEventArgs e);
public class SolutionItemModifiedEventArgs: EventArgsChain<SolutionItemModifiedEventInfo>
{
- public SolutionItemModifiedEventArgs (SolutionItem item, string hint)
+ public SolutionItemModifiedEventArgs (SolutionFolderItem item, string hint)
{
Add (new SolutionItemModifiedEventInfo (item, hint));
}
@@ -99,7 +99,7 @@ namespace MonoDevelop.Projects
{
string hint;
- public SolutionItemModifiedEventInfo (SolutionItem item, string hint): base (item)
+ public SolutionItemModifiedEventInfo (SolutionFolderItem item, string hint): base (item)
{
this.hint = hint;
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemExtension.cs
new file mode 100644
index 0000000000..ee20bd4c5a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemExtension.cs
@@ -0,0 +1,285 @@
+//
+// SolutionItemExtension.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using MonoDevelop.Core;
+using MonoDevelop.Core.StringParsing;
+using MonoDevelop.Core.Execution;
+using System.Xml;
+using MonoDevelop.Projects.MSBuild;
+using MonoDevelop.Projects.Extensions;
+using System.Threading.Tasks;
+using System.Linq;
+using System.Collections.Immutable;
+
+namespace MonoDevelop.Projects
+{
+ public class SolutionItemExtension: WorkspaceObjectExtension
+ {
+ SolutionItemExtension next;
+
+ internal string FlavorGuid { get; set; }
+ internal string TypeAlias { get; set; }
+
+ internal protected override void InitializeChain (ChainedExtension next)
+ {
+ base.InitializeChain (next);
+ this.next = FindNextImplementation<SolutionItemExtension> (next);
+ }
+
+ internal protected override bool SupportsObject (WorkspaceObject item)
+ {
+ var p = item as SolutionItem;
+ if (p == null)
+ return false;
+
+ return FlavorGuid == null || p.GetItemTypeGuids ().Any (id => id.Equals (FlavorGuid, StringComparison.OrdinalIgnoreCase));
+ }
+
+ public SolutionItem Item {
+ get { return (SolutionItem) Owner; }
+ }
+
+ internal protected virtual void OnInitializeFromTemplate (ProjectCreateInformation projectCreateInfo, XmlElement template)
+ {
+ next.OnInitializeFromTemplate (projectCreateInfo, template);
+ }
+
+ internal void ItemReady ()
+ {
+ OnItemReady ();
+ if (next != null)
+ next.ItemReady ();
+ }
+
+ protected virtual void OnItemReady ()
+ {
+ }
+
+ internal void BeginLoad ()
+ {
+ OnBeginLoad ();
+ if (next != null)
+ next.BeginLoad ();
+ }
+
+ internal void EndLoad ()
+ {
+ OnEndLoad ();
+ if (next != null)
+ next.EndLoad ();
+ }
+
+ #region Project properties
+
+ internal protected virtual IconId StockIcon {
+ get {
+ return next.StockIcon;
+ }
+ }
+ #endregion
+
+ #region Project model
+
+ internal protected virtual IEnumerable<IBuildTarget> OnGetExecutionDependencies ()
+ {
+ return next.OnGetExecutionDependencies ();
+ }
+
+ internal protected virtual IEnumerable<SolutionItem> OnGetReferencedItems (ConfigurationSelector configuration)
+ {
+ return next.OnGetReferencedItems (configuration);
+ }
+
+ internal protected virtual void OnSetFormat (MSBuildFileFormat format)
+ {
+ next.OnSetFormat (format);
+ }
+
+ internal protected virtual bool OnGetSupportsFormat (MSBuildFileFormat format)
+ {
+ return next.OnGetSupportsFormat (format);
+ }
+
+ internal protected virtual IEnumerable<FilePath> OnGetItemFiles (bool includeReferencedFiles)
+ {
+ return next.OnGetItemFiles (includeReferencedFiles);
+ }
+
+ internal protected virtual bool ItemFilesChanged {
+ get {
+ return next.ItemFilesChanged;
+ }
+ }
+
+ internal protected virtual SolutionItemConfiguration OnCreateConfiguration (string id, ConfigurationKind kind)
+ {
+ return next.OnCreateConfiguration (id, kind);
+ }
+
+ internal protected virtual ProjectFeatures OnGetSupportedFeatures ()
+ {
+ return next.OnGetSupportedFeatures ();
+ }
+
+ #endregion
+
+ #region Building
+
+ internal protected virtual Task<BuildResult> OnClean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
+ {
+ return next.OnClean (monitor, configuration, operationContext);
+ }
+
+ internal protected virtual bool OnNeedsBuilding (ConfigurationSelector configuration)
+ {
+ return next.OnNeedsBuilding (configuration);
+ }
+
+ internal protected virtual Task<BuildResult> OnBuild (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
+ {
+ return next.OnBuild (monitor, configuration, operationContext);
+ }
+
+ internal protected virtual DateTime OnGetLastBuildTime (ConfigurationSelector configuration)
+ {
+ return next.OnGetLastBuildTime (configuration);
+ }
+
+ #endregion
+
+ #region Load / Save
+
+ internal protected virtual Task OnLoad (ProgressMonitor monitor)
+ {
+ return next.OnLoad (monitor);
+ }
+
+ internal protected virtual Task OnSave (ProgressMonitor monitor)
+ {
+ return next.OnSave (monitor);
+ }
+
+ protected virtual void OnBeginLoad ()
+ {
+ }
+
+ protected virtual void OnEndLoad ()
+ {
+ }
+
+ internal protected virtual void OnReadSolutionData (ProgressMonitor monitor, SlnPropertySet properties)
+ {
+ next.OnReadSolutionData (monitor, properties);
+ }
+
+ internal protected virtual void OnWriteSolutionData (ProgressMonitor monitor, SlnPropertySet properties)
+ {
+ next.OnWriteSolutionData (monitor, properties);
+ }
+
+ internal protected virtual bool OnCheckHasSolutionData ()
+ {
+ return next.OnCheckHasSolutionData ();
+ }
+
+ #endregion
+
+ #region Execution
+
+ internal protected virtual Task OnPrepareExecution (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ {
+ return next.OnPrepareExecution (monitor, context, configuration);
+ }
+
+ internal protected virtual Task OnExecute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ {
+ return next.OnExecute (monitor, context, configuration);
+ }
+
+ internal protected virtual bool OnGetCanExecute (ExecutionContext context, ConfigurationSelector configuration)
+ {
+ return next.OnGetCanExecute (context, configuration);
+ }
+
+ internal protected virtual IEnumerable<ExecutionTarget> OnGetExecutionTargets (ConfigurationSelector configuration)
+ {
+ return next.OnGetExecutionTargets (configuration);
+ }
+
+ internal protected virtual void OnExecutionTargetsChanged ()
+ {
+ next.OnExecutionTargetsChanged ();
+ }
+
+ #endregion
+
+ #region Events
+
+ internal protected virtual void OnReloadRequired (SolutionItemEventArgs args)
+ {
+ next.OnReloadRequired (args);
+ }
+
+ internal protected virtual void OnDefaultConfigurationChanged (ConfigurationEventArgs args)
+ {
+ next.OnDefaultConfigurationChanged (args);
+ }
+
+ internal protected virtual void OnBoundToSolution ()
+ {
+ next.OnBoundToSolution ();
+ }
+
+ internal protected virtual void OnUnboundFromSolution ()
+ {
+ next.OnUnboundFromSolution ();
+ }
+
+ internal protected virtual void OnConfigurationAdded (ConfigurationEventArgs args)
+ {
+ next.OnConfigurationAdded (args);
+ }
+
+ internal protected virtual void OnConfigurationRemoved (ConfigurationEventArgs args)
+ {
+ next.OnConfigurationRemoved (args);
+ }
+
+ internal protected virtual void OnModified (SolutionItemModifiedEventArgs args)
+ {
+ next.OnModified (args);
+ }
+
+ internal protected virtual void OnNameChanged (SolutionItemRenamedEventArgs e)
+ {
+ next.OnNameChanged (e);
+ }
+
+ #endregion
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemFactory.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemFactory.cs
new file mode 100644
index 0000000000..9237ae7de1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemFactory.cs
@@ -0,0 +1,36 @@
+//
+// SolutionItemFactory.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Projects
+{
+ public abstract class SolutionItemFactory
+ {
+ public abstract Task<SolutionItem> CreateItem (string fileName, string typeGuid);
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemReference.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemReference.cs
index d50f388d81..23abcf8f56 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemReference.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemReference.cs
@@ -43,10 +43,10 @@ namespace MonoDevelop.Projects
{
}
- public SolutionItemReference (SolutionItem item)
+ public SolutionItemReference (SolutionFolderItem item)
{
- if (item is SolutionEntityItem) {
- path = ((SolutionEntityItem)item).FileName;
+ if (item is SolutionItem) {
+ path = ((SolutionItem)item).FileName;
} else {
path = item.ParentSolution.FileName;
if ((item is SolutionFolder) && ((SolutionFolder)item).IsRoot)
@@ -78,7 +78,7 @@ namespace MonoDevelop.Projects
public override bool Equals (object o)
{
SolutionItemReference sr = o as SolutionItemReference;
- if (o == null)
+ if (sr == null)
return false;
return (path == sr.path) && (id == sr.id);
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/TargetEvaluationResult.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/TargetEvaluationResult.cs
index e825dac507..aaff7ecbab 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/TargetEvaluationResult.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/TargetEvaluationResult.cs
@@ -25,22 +25,22 @@
// THE SOFTWARE.
using System;
using System.Collections.Generic;
-using MonoDevelop.Projects.Formats.MSBuild;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.Projects
{
public class TargetEvaluationResult
{
- BuildResult buildResult;
- readonly Dictionary<string,string> properties;
- readonly IEnumerable<MSBuildEvaluatedItem> items;
+ readonly BuildResult buildResult;
+ readonly IReadOnlyPropertySet properties;
+ readonly IEnumerable<IMSBuildItemEvaluated> items;
public TargetEvaluationResult (BuildResult buildResult)
{
this.buildResult = buildResult;
}
- public TargetEvaluationResult (BuildResult buildResult, IEnumerable<MSBuildEvaluatedItem> items, Dictionary<string,string> properties)
+ public TargetEvaluationResult (BuildResult buildResult, IEnumerable<IMSBuildItemEvaluated> items, IReadOnlyPropertySet properties)
{
this.buildResult = buildResult;
this.items = items;
@@ -49,14 +49,13 @@ namespace MonoDevelop.Projects
public BuildResult BuildResult {
get { return buildResult; }
- internal set { buildResult = value; }
}
- public IEnumerable<MSBuildEvaluatedItem> Items {
+ public IEnumerable<IMSBuildItemEvaluated> Items {
get { return items; }
}
- public Dictionary<string,string> Properties {
+ public IReadOnlyPropertySet Properties {
get { return properties; }
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ThreadSafeAttribute.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ThreadSafeAttribute.cs
new file mode 100644
index 0000000000..ccbc660fba
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ThreadSafeAttribute.cs
@@ -0,0 +1,34 @@
+//
+// ThreadSafeAttribute.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Projects
+{
+ public class ThreadSafeAttribute: Attribute
+ {
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownConfiguration.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownConfiguration.cs
index 7ce90e1fc9..e7048d0e7d 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownConfiguration.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownConfiguration.cs
@@ -33,9 +33,8 @@ namespace MonoDevelop.Projects
{
public class UnknownConfiguration: SolutionItemConfiguration
{
- public UnknownConfiguration ()
+ public UnknownConfiguration (): base ("Unknown Configuration")
{
- Name = "Unknown Configuration";
}
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownProject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownProject.cs
index f3680668f7..e37bd6b611 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownProject.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownProject.cs
@@ -1,4 +1,4 @@
-//
+//
// UnknownProject.cs
//
// Author:
@@ -26,38 +26,33 @@
using System;
using MonoDevelop.Core;
using System.Collections.Generic;
+using System.Threading.Tasks;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.Projects
{
public class UnknownProject: Project
{
- string loadError = string.Empty;
- bool unloaded;
-
// Store the file name locally to avoid the file format to change it
FilePath fileName;
public UnknownProject ()
{
- NeedsReload = false;
- loadError = GettextCatalog.GetString ("Unknown project type");
+ Initialize (this);
+ IsUnsupportedProject = true;
}
- public UnknownProject (FilePath file, string loadError): this ()
+ protected override void OnExtensionChainInitialized ()
{
+ base.OnExtensionChainInitialized ();
NeedsReload = false;
- FileName = file;
- this.loadError = loadError;
}
- public override bool SupportsConfigurations ()
- {
- return true;
- }
-
- public override IEnumerable<string> GetProjectTypes ()
+ public UnknownProject (FilePath file, string loadError): this ()
{
- yield return "";
+ NeedsReload = false;
+ FileName = file;
+ UnsupportedProjectMessage = loadError;
}
public override FilePath FileName {
@@ -72,58 +67,39 @@ namespace MonoDevelop.Projects
}
}
-
- public string LoadError {
- get { return unloaded ? GettextCatalog.GetString ("Unavailable") : loadError; }
- set { loadError = value; }
- }
-
- public bool UnloadedEntry {
- get { return unloaded; }
- set { unloaded = value; }
- }
-
- public override string Name {
- get {
- if (!FileName.IsNullOrEmpty)
- return FileName.FileNameWithoutExtension;
- else
- return GettextCatalog.GetString ("Unknown entry");
- }
- set { }
+ protected override string OnGetName ()
+ {
+ if (!FileName.IsNullOrEmpty)
+ return FileName.FileNameWithoutExtension;
+ else
+ return GettextCatalog.GetString ("Unknown entry");
}
- internal protected override bool OnGetSupportsTarget (string target)
+ protected override bool OnGetSupportsTarget (string target)
{
// We can't do anything with unsupported projects, other than display them in the solution pad
return false;
}
- protected override void OnClean (IProgressMonitor monitor, ConfigurationSelector configuration)
+ protected override Task<BuildResult> OnClean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
+ return Task.FromResult (BuildResult.CreateSuccess ());
}
- protected override BuildResult OnBuild (IProgressMonitor monitor, ConfigurationSelector configuration)
+ protected override Task<BuildResult> OnBuild (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
var r = new BuildResult ();
- r.AddError (loadError);
- return r;
- }
-
- protected internal override void OnExecute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
- {
- }
-
- protected internal override bool OnGetNeedsBuilding (ConfigurationSelector configuration)
- {
- return false;
+ r.AddError (UnsupportedProjectMessage);
+ return Task.FromResult (r);
}
- protected internal override void OnSetNeedsBuilding (bool value, ConfigurationSelector configuration)
+ protected override Task OnExecute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
{
+ return new Task (delegate {
+ });
}
- public override SolutionItemConfiguration CreateConfiguration (string name)
+ protected override SolutionItemConfiguration OnCreateConfiguration (string name, ConfigurationKind kind)
{
return new ProjectConfiguration (name);
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownSolutionItem.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownSolutionItem.cs
index eb59179f5e..e718d5e03c 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownSolutionItem.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownSolutionItem.cs
@@ -28,10 +28,11 @@
using System;
using MonoDevelop.Core;
+using System.Threading.Tasks;
namespace MonoDevelop.Projects
{
- public class UnknownSolutionItem: SolutionEntityItem
+ public class UnknownSolutionItem: SolutionItem
{
string loadError = string.Empty;
bool unloaded;
@@ -41,15 +42,16 @@ namespace MonoDevelop.Projects
public UnknownSolutionItem ()
{
- NeedsReload = false;
+ Initialize (this);
+ IsUnsupportedProject = true;
}
- public override bool SupportsConfigurations ()
+ protected override void OnExtensionChainInitialized ()
{
- // The item is unknown, but we still want to read/write its configurations
- return true;
+ base.OnExtensionChainInitialized ();
+ NeedsReload = false;
}
-
+
public override FilePath FileName {
get { return fileName; }
set {
@@ -76,48 +78,30 @@ namespace MonoDevelop.Projects
loadError = GettextCatalog.GetString ("Unavailable");
}
}
-
- public override string Name {
- get {
- if (!FileName.IsNullOrEmpty)
- return FileName.FileNameWithoutExtension;
- else
- return GettextCatalog.GetString ("Unknown entry");
- }
- set { }
- }
- internal protected override bool OnGetSupportsTarget (string target)
+ protected override string OnGetName ()
{
- return false;
+ if (!FileName.IsNullOrEmpty)
+ return FileName.FileNameWithoutExtension;
+ else
+ return GettextCatalog.GetString ("Unknown entry");
}
-
- protected override void OnClean (IProgressMonitor monitor, ConfigurationSelector configuration)
+
+ protected override Task<BuildResult> OnClean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
+ return Task.FromResult (BuildResult.CreateSuccess ());
}
- protected override BuildResult OnBuild (IProgressMonitor monitor, ConfigurationSelector configuration)
+ protected override Task<BuildResult> OnBuild (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
var r = new BuildResult ();
r.AddError ("Project unavailable");
- return r;
- }
-
- protected internal override void OnExecute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
- {
- }
-
- protected internal override bool OnGetNeedsBuilding (ConfigurationSelector configuration)
- {
- return false;
- }
-
- protected internal override void OnSetNeedsBuilding (bool value, ConfigurationSelector configuration)
- {
+ return Task.FromResult (r);
}
- protected internal override void OnSave (IProgressMonitor monitor)
+ protected internal override Task OnSave (ProgressMonitor monitor)
{
+ return Task.FromResult (0);
}
}
@@ -125,6 +109,7 @@ namespace MonoDevelop.Projects
{
public UnloadedSolutionItem ()
{
+ Initialize (this);
UnloadedEntry = true;
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownWorkspaceItem.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownWorkspaceItem.cs
index a80b990f9c..efeff51730 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownWorkspaceItem.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/UnknownWorkspaceItem.cs
@@ -27,6 +27,7 @@
using System;
using MonoDevelop.Core;
+using System.Threading.Tasks;
namespace MonoDevelop.Projects
{
@@ -39,6 +40,13 @@ namespace MonoDevelop.Projects
public UnknownWorkspaceItem ()
{
+ Initialize (this);
+ Name = GettextCatalog.GetString ("Unknown entry");
+ }
+
+ protected override void OnExtensionChainInitialized ()
+ {
+ base.OnExtensionChainInitialized ();
NeedsReload = false;
}
@@ -52,19 +60,15 @@ namespace MonoDevelop.Projects
set { unloaded = value; }
}
- protected internal override void OnSave (IProgressMonitor monitor)
- {
- Services.ProjectService.InternalWriteWorkspaceItem (monitor, FileName, this);
- }
-
- public override string Name {
+ public override FilePath FileName {
get {
+ return base.FileName;
+ }
+ set {
+ base.FileName = value;
if (!FileName.IsNullOrEmpty)
- return FileName.FileNameWithoutExtension;
- else
- return GettextCatalog.GetString ("Unknown entry");
+ Name = FileName.FileNameWithoutExtension;
}
- set { }
}
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Workspace.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Workspace.cs
index a59cdab116..528872fadb 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Workspace.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Workspace.cs
@@ -33,21 +33,91 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using MonoDevelop.Core;
using MonoDevelop.Core.Serialization;
+using System.Linq;
+using System.Threading.Tasks;
+using MonoDevelop.Projects.MD1;
namespace MonoDevelop.Projects
{
[ProjectModelDataItem]
- public class Workspace: WorkspaceItem, ICustomDataItem
+ public sealed class Workspace: WorkspaceItem, ICustomDataItem, IBuildTarget
{
WorkspaceItemCollection items;
+
+ public Workspace ()
+ {
+ Initialize (this);
+ items = new WorkspaceItemCollection (this);
+ }
+
+ public override void SetLocation (FilePath baseDirectory, string name)
+ {
+ FileName = baseDirectory.Combine (name + ".mdw");
+ }
+
+ internal protected override Task OnSave (ProgressMonitor monitor)
+ {
+ return MD1FileFormat.Instance.WriteFile (FileName, this, monitor);
+ }
+
+ protected override void OnSetShared ()
+ {
+ base.OnSetShared ();
+ items.SetShared ();
+ }
- public override void Dispose ()
+ protected override void OnDispose ()
{
- base.Dispose ();
foreach (WorkspaceItem it in Items)
it.Dispose ();
+ base.OnDispose ();
+ }
+
+ bool IBuildTarget.CanBuild (ConfigurationSelector configuration)
+ {
+ return true;
+ }
+
+ [ThreadSafe]
+ public async Task<BuildResult> Build (ProgressMonitor monitor, ConfigurationSelector configuration, bool buildReferencedTargets = false, OperationContext operationContext = null)
+ {
+ var res = new BuildResult { BuildCount = 0 };
+ foreach (var bt in Items.OfType<IBuildTarget> ())
+ res.Append (await bt.Build (monitor, configuration, operationContext:operationContext));
+ return res;
+ }
+
+ [ThreadSafe]
+ public async Task<BuildResult> Clean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext = null)
+ {
+ AssertMainThread ();
+ var res = new BuildResult { BuildCount = 0 };
+ foreach (var bt in Items.OfType<IBuildTarget> ())
+ res.Append (await bt.Clean (monitor, configuration, operationContext));
+ return res;
+ }
+
+ public Task Execute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ {
+ throw new NotSupportedException ();
+ }
+
+ public Task PrepareExecution (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ {
+ throw new NotSupportedException ();
+ }
+
+ public bool CanExecute (ExecutionContext context, ConfigurationSelector configuration)
+ {
+ return false;
+ }
+
+ public bool NeedsBuilding (ConfigurationSelector configuration)
+ {
+ return Items.OfType<IBuildTarget> ().Any (t => t.NeedsBuilding (configuration));
}
+ [ThreadSafe]
public override ReadOnlyCollection<string> GetConfigurations ()
{
List<string> configs = new List<string> ();
@@ -60,53 +130,20 @@ namespace MonoDevelop.Projects
return configs.AsReadOnly ();
}
+ [ThreadSafe]
public WorkspaceItemCollection Items {
get {
- if (items == null)
- items = new WorkspaceItemCollection (this);
return items;
}
}
-
- public override ReadOnlyCollection<T> GetAllItems<T> ()
- {
- List<T> list = new List<T> ();
- GetAllItems<T> (list, this);
- return list.AsReadOnly ();
- }
-
- void GetAllItems<T> (List<T> list, WorkspaceItem item) where T: WorkspaceItem
- {
- if (item is T)
- list.Add ((T) item);
-
- if (item is Workspace) {
- foreach (WorkspaceItem citem in ((Workspace)item).Items)
- GetAllItems<T> (list, citem);
- }
- }
-
- public override SolutionEntityItem FindSolutionItem (string fileName)
- {
- foreach (WorkspaceItem it in Items) {
- SolutionEntityItem si = it.FindSolutionItem (fileName);
- if (si != null)
- return si;
- }
- return null;
- }
- [Obsolete("Use GetProjectsContainingFile() (plural) instead")]
- public override Project GetProjectContainingFile (FilePath fileName)
+ [ThreadSafe]
+ protected override IEnumerable<WorkspaceObject> OnGetChildren ()
{
- foreach (WorkspaceItem it in Items) {
- Project p = it.GetProjectContainingFile (fileName);
- if (p != null)
- return p;
- }
- return null;
+ return Items;
}
-
+
+ [ThreadSafe]
public override IEnumerable<Project> GetProjectsContainingFile (FilePath fileName)
{
foreach (WorkspaceItem it in Items) {
@@ -116,7 +153,8 @@ namespace MonoDevelop.Projects
}
}
- public override bool ContainsItem (IWorkspaceObject obj)
+ [ThreadSafe]
+ public override bool ContainsItem (WorkspaceObject obj)
{
if (base.ContainsItem (obj))
return true;
@@ -128,84 +166,41 @@ namespace MonoDevelop.Projects
return false;
}
-
- public override ReadOnlyCollection<T> GetAllSolutionItems<T> ()
+ [ThreadSafe]
+ public Task<WorkspaceItem> ReloadItem (ProgressMonitor monitor, WorkspaceItem item)
{
- List<T> list = new List<T> ();
- foreach (WorkspaceItem it in Items) {
- list.AddRange (it.GetAllSolutionItems<T> ());
- }
- return list.AsReadOnly ();
- }
-
- public override void ConvertToFormat (FileFormat format, bool convertChildren)
- {
- base.ConvertToFormat (format, convertChildren);
- if (convertChildren) {
- foreach (WorkspaceItem it in Items)
- it.ConvertToFormat (format, true);
- }
- }
+ return Runtime.RunInMainThread (async delegate {
+ if (Items.IndexOf (item) == -1)
+ throw new InvalidOperationException ("Item '" + item.Name + "' does not belong to workspace '" + Name + "'");
-
- internal protected override BuildResult OnRunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration)
- {
- BuildResult result = null;
- monitor.BeginTask (null, Items.Count);
- try {
- foreach (WorkspaceItem it in Items) {
- BuildResult res = it.RunTarget (monitor, target, configuration);
- if (res != null) {
- if (result == null) {
- result = new BuildResult ();
- result.BuildCount = 0;
- }
- result.Append (res);
- }
- monitor.Step (1);
+ // Load the new item
+
+ WorkspaceItem newItem;
+ try {
+ newItem = await Services.ProjectService.ReadWorkspaceItem (monitor, item.FileName);
+ } catch (Exception ex) {
+ UnknownWorkspaceItem e = new UnknownWorkspaceItem ();
+ e.LoadError = ex.Message;
+ e.FileName = item.FileName;
+ newItem = e;
}
- } finally {
- monitor.EndTask ();
- }
- return result;
- }
-
- protected internal override void OnExecute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
- {
- throw new NotImplementedException ();
- }
-
- public WorkspaceItem ReloadItem (IProgressMonitor monitor, WorkspaceItem item)
- {
- if (Items.IndexOf (item) == -1)
- throw new InvalidOperationException ("Item '" + item.Name + "' does not belong to workspace '" + Name + "'");
-
- // Load the new item
-
- WorkspaceItem newItem;
- try {
- newItem = Services.ProjectService.ReadWorkspaceItem (monitor, item.FileName);
- } catch (Exception ex) {
- UnknownWorkspaceItem e = new UnknownWorkspaceItem ();
- e.LoadError = ex.Message;
- e.FileName = item.FileName;
- newItem = e;
- }
-
- // Replace in the file list
- Items.Replace (item, newItem);
-
- NotifyModified ();
- NotifyItemRemoved (new WorkspaceItemChangeEventArgs (item, true));
- NotifyItemAdded (new WorkspaceItemChangeEventArgs (newItem, true));
-
- item.Dispose ();
- return newItem;
+
+ // Replace in the file list
+ Items.Replace (item, newItem);
+
+ NotifyModified ();
+ NotifyItemRemoved (new WorkspaceItemChangeEventArgs (item, true));
+ NotifyItemAdded (new WorkspaceItemChangeEventArgs (newItem, true));
+
+ item.Dispose ();
+ return newItem;
+ });
}
- public override List<FilePath> GetItemFiles (bool includeReferencedFiles)
+ [ThreadSafe]
+ protected override IEnumerable<FilePath> OnGetItemFiles (bool includeReferencedFiles)
{
- List<FilePath> list = base.GetItemFiles (includeReferencedFiles);
+ List<FilePath> list = base.OnGetItemFiles (includeReferencedFiles).ToList ();
if (includeReferencedFiles) {
foreach (WorkspaceItem it in Items)
list.AddRange (it.GetItemFiles (true));
@@ -216,31 +211,33 @@ namespace MonoDevelop.Projects
internal void NotifyItemAdded (WorkspaceItemChangeEventArgs args)
{
+ AssertMainThread ();
OnItemAdded (args);
OnConfigurationsChanged ();
}
internal void NotifyItemRemoved (WorkspaceItemChangeEventArgs args)
{
+ AssertMainThread ();
OnItemRemoved (args);
OnConfigurationsChanged ();
}
- protected virtual void OnItemAdded (WorkspaceItemChangeEventArgs args)
+ /*protected virtual*/ void OnItemAdded (WorkspaceItemChangeEventArgs args)
{
if (ItemAdded != null)
ItemAdded (this, args);
OnDescendantItemAdded (args);
}
- protected virtual void OnItemRemoved (WorkspaceItemChangeEventArgs args)
+ /*protected virtual*/ void OnItemRemoved (WorkspaceItemChangeEventArgs args)
{
if (ItemRemoved != null)
ItemRemoved (this, args);
OnDescendantItemRemoved (args);
}
- protected virtual void OnDescendantItemAdded (WorkspaceItemChangeEventArgs args)
+ /*protected virtual*/ void OnDescendantItemAdded (WorkspaceItemChangeEventArgs args)
{
if (DescendantItemAdded != null)
DescendantItemAdded (this, args);
@@ -248,7 +245,7 @@ namespace MonoDevelop.Projects
ParentWorkspace.OnDescendantItemAdded (args);
}
- protected virtual void OnDescendantItemRemoved (WorkspaceItemChangeEventArgs args)
+ /*protected virtual*/ void OnDescendantItemRemoved (WorkspaceItemChangeEventArgs args)
{
if (DescendantItemRemoved != null)
DescendantItemRemoved (this, args);
@@ -275,16 +272,16 @@ namespace MonoDevelop.Projects
{
DataItem items = (DataItem) data.Extract ("Items");
handler.Deserialize (this, data);
- IProgressMonitor monitor = handler.SerializationContext.ProgressMonitor;
+ ProgressMonitor monitor = handler.SerializationContext.ProgressMonitor;
if (monitor == null)
- monitor = new MonoDevelop.Core.ProgressMonitoring.NullProgressMonitor ();
+ monitor = new ProgressMonitor ();
if (items != null) {
string baseDir = Path.GetDirectoryName (handler.SerializationContext.BaseFile);
monitor.BeginTask (null, items.ItemData.Count);
try {
foreach (DataValue item in items.ItemData) {
string file = Path.Combine (baseDir, item.Value);
- WorkspaceItem it = Services.ProjectService.ReadWorkspaceItem (monitor, file);
+ WorkspaceItem it = Services.ProjectService.ReadWorkspaceItem (monitor, file).Result;
if (it != null)
Items.Add (it);
monitor.Step (1);
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceItem.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceItem.cs
index 6886189d8a..c0d02ffd33 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceItem.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceItem.cs
@@ -41,53 +41,50 @@ using MonoDevelop.Core.Serialization;
using MonoDevelop.Core.StringParsing;
using MonoDevelop.Core.Execution;
using MonoDevelop.Projects.Extensions;
+using Mono.Addins;
+using System.Linq;
+using System.Threading.Tasks;
+using MonoDevelop.Projects.MD1;
namespace MonoDevelop.Projects
{
- public abstract class WorkspaceItem : IBuildTarget, IWorkspaceFileObject, ILoadController
+ public abstract class WorkspaceItem : WorkspaceObject, IWorkspaceFileObject
{
Workspace parentWorkspace;
- FileFormat format;
- internal bool FormatSet;
- Hashtable extendedProperties;
FilePath fileName;
- int loading;
PropertyBag userProperties;
FileStatusTracker<WorkspaceItemEventArgs> fileStatusTracker;
[ProjectPathItemProperty ("BaseDirectory", DefaultValue=null)]
FilePath baseDirectory;
-
+
+ internal WorkspaceItem ()
+ {
+ userProperties = new PropertyBag ();
+ fileStatusTracker = new FileStatusTracker<WorkspaceItemEventArgs> (this, OnReloadRequired, new WorkspaceItemEventArgs (this));
+ }
+
public Workspace ParentWorkspace {
get { return parentWorkspace; }
- internal set { parentWorkspace = value; }
- }
-
- public IDictionary ExtendedProperties {
- get {
- if (extendedProperties == null)
- extendedProperties = new Hashtable ();
- return extendedProperties;
+ internal set {
+ parentWorkspace = value;
+ ParentObject = value;
}
}
// User properties are only loaded when the project is loaded in the IDE.
public virtual PropertyBag UserProperties {
get {
- if (userProperties == null)
- userProperties = new PropertyBag ();
return userProperties;
}
}
- public virtual string Name {
- get {
- if (fileName.IsNullOrEmpty)
- return string.Empty;
- else
- return fileName.FileNameWithoutExtension;
+ public new string Name {
+ get {
+ return base.Name;
}
set {
+ AssertMainThread ();
if (fileName.IsNullOrEmpty)
SetLocation (FilePath.Empty, value);
else {
@@ -97,41 +94,44 @@ namespace MonoDevelop.Projects
}
}
}
+
+ [ThreadSafe]
+ protected override string OnGetName ()
+ {
+ var fname = fileName;
+ if (fname.IsNullOrEmpty)
+ return string.Empty;
+ else
+ return fname.FileNameWithoutExtension;
+ }
public virtual FilePath FileName {
- get {
+ [ThreadSafe] get {
return fileName;
}
set {
+ AssertMainThread ();
string oldName = Name;
fileName = value;
- if (FileFormat != null)
- fileName = FileFormat.GetValidFileName (this, fileName);
if (oldName != Name)
OnNameChanged (new WorkspaceItemRenamedEventArgs (this, oldName, Name));
NotifyModified ();
-
- // Load the user properties after the file name has been set.
- if (Loading)
- LoadUserProperties ();
}
}
- public void SetLocation (FilePath baseDirectory, string name)
+ public virtual void SetLocation (FilePath baseDirectory, string name)
{
// Add a dummy extension to the file name.
// It will be replaced by the correct one, depending on the format
FileName = baseDirectory.Combine (name) + ".x";
}
- public FilePath BaseDirectory {
+ public new FilePath BaseDirectory {
get {
- if (baseDirectory.IsNull)
- return FileName.ParentDirectory.FullPath;
- else
- return baseDirectory;
+ return base.BaseDirectory;
}
set {
+ AssertMainThread ();
if (!value.IsNull && !FileName.IsNull && FileName.ParentDirectory.FullPath == value.FullPath)
baseDirectory = null;
else if (value.IsNullOrEmpty)
@@ -141,252 +141,83 @@ namespace MonoDevelop.Projects
NotifyModified ();
}
}
-
- public FilePath ItemDirectory {
- get { return FileName.ParentDirectory.FullPath; }
- }
-
- protected bool Loading {
- get { return loading > 0; }
- }
-
- public WorkspaceItem ()
- {
- MonoDevelop.Projects.Extensions.ProjectExtensionUtil.LoadControl (this);
- fileStatusTracker = new FileStatusTracker<WorkspaceItemEventArgs> (this, OnReloadRequired, new WorkspaceItemEventArgs (this));
- }
-
- public T GetService<T> () where T: class
- {
- return (T) GetService (typeof(T));
- }
-
- public virtual object GetService (Type t)
- {
- return Services.ProjectService.GetExtensionChain (this).GetService (this, t);
- }
-
- public virtual List<FilePath> GetItemFiles (bool includeReferencedFiles)
- {
- List<FilePath> col = FileFormat.Format.GetItemFiles (this);
- if (!string.IsNullOrEmpty (FileName) && !col.Contains (FileName))
- col.Add (FileName);
- return col;
- }
-
- public virtual SolutionEntityItem FindSolutionItem (string fileName)
- {
- return null;
- }
-
- public virtual bool ContainsItem (IWorkspaceObject obj)
- {
- return this == obj;
- }
-
- public ReadOnlyCollection<SolutionItem> GetAllSolutionItems ()
- {
- return GetAllSolutionItems<SolutionItem> ();
- }
-
- public virtual ReadOnlyCollection<T> GetAllSolutionItems<T> () where T: SolutionItem
- {
- return new List<T> ().AsReadOnly ();
- }
-
- public ReadOnlyCollection<Project> GetAllProjects ()
- {
- return GetAllSolutionItems<Project> ();
- }
-
- public virtual ReadOnlyCollection<Solution> GetAllSolutions ()
- {
- return GetAllItems<Solution> ();
- }
-
- public ReadOnlyCollection<WorkspaceItem> GetAllItems ()
- {
- return GetAllItems<WorkspaceItem> ();
- }
-
- public virtual ReadOnlyCollection<T> GetAllItems<T> () where T: WorkspaceItem
- {
- List<T> list = new List<T> ();
- if (this is T)
- list.Add ((T)this);
- return list.AsReadOnly ();
- }
-
- [Obsolete("Use GetProjectsContainingFile() (plural) instead")]
- public virtual Project GetProjectContainingFile (FilePath fileName)
- {
- return null;
- }
- public virtual IEnumerable<Project> GetProjectsContainingFile (FilePath fileName)
+ [ThreadSafe]
+ protected sealed override string OnGetBaseDirectory ()
{
- yield break;
- }
-
- public virtual ReadOnlyCollection<string> GetConfigurations ()
- {
- return new ReadOnlyCollection<string> (new string [0]);
- }
-
- protected internal virtual void OnSave (IProgressMonitor monitor)
- {
- Services.ProjectService.InternalWriteWorkspaceItem (monitor, FileName, this);
- }
-
- internal void SetParentWorkspace (Workspace workspace)
- {
- parentWorkspace = workspace;
- }
-
- public BuildResult RunTarget (IProgressMonitor monitor, string target, string configuration)
- {
- return RunTarget (monitor, target, (SolutionConfigurationSelector) configuration);
+ var dir = baseDirectory;
+ if (dir.IsNull)
+ return FileName.ParentDirectory.FullPath;
+ else
+ return dir;
}
- public BuildResult RunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration)
+ [ThreadSafe]
+ protected sealed override string OnGetItemDirectory ()
{
- return Services.ProjectService.GetExtensionChain (this).RunTarget (monitor, this, target, configuration);
+ return FileName.ParentDirectory.FullPath;
}
- public bool SupportsBuild ()
+ protected override void OnExtensionChainInitialized ()
{
- return SupportsTarget (ProjectService.BuildTarget);
- }
+ itemExtension = ExtensionChain.GetExtension<WorkspaceItemExtension> ();
+ base.OnExtensionChainInitialized ();
+ }
+
+ WorkspaceItemExtension itemExtension;
- public void Clean (IProgressMonitor monitor, string configuration)
- {
- Clean (monitor, (SolutionConfigurationSelector) configuration);
- }
-
- public void Clean (IProgressMonitor monitor, ConfigurationSelector configuration)
- {
- Services.ProjectService.GetExtensionChain (this).RunTarget (monitor, this, ProjectService.CleanTarget, configuration);
- }
-
- public bool SupportsTarget (string target)
- {
- return Services.ProjectService.GetExtensionChain (this).SupportsTarget (this, target);
+ WorkspaceItemExtension ItemExtension {
+ get {
+ if (itemExtension == null)
+ AssertExtensionChainCreated ();
+ return itemExtension;
+ }
}
- public bool SupportsExecute ()
+ protected override IEnumerable<WorkspaceObjectExtension> CreateDefaultExtensions ()
{
- return Services.ProjectService.GetExtensionChain (this).SupportsExecute (this);
+ foreach (var e in base.CreateDefaultExtensions ())
+ yield return e;
+ yield return new DefaultWorkspaceItemExtension ();
}
- public BuildResult Build (IProgressMonitor monitor, string configuration)
+ [ThreadSafe]
+ public IEnumerable<FilePath> GetItemFiles (bool includeReferencedFiles)
{
- return InternalBuild (monitor, (SolutionConfigurationSelector) configuration);
+ return ItemExtension.GetItemFiles (includeReferencedFiles);
}
- public BuildResult Build (IProgressMonitor monitor, ConfigurationSelector configuration)
+ [ThreadSafe]
+ protected virtual IEnumerable<FilePath> OnGetItemFiles (bool includeReferencedFiles)
{
- return InternalBuild (monitor, configuration);
- }
-
- public BuildResult Build (IProgressMonitor monitor, string configuration, ProjectOperationContext context)
- {
- return Build (monitor, (SolutionConfigurationSelector) configuration, context);
+ if (!FileName.IsNullOrEmpty)
+ yield return FileName;
}
- public BuildResult Build (IProgressMonitor monitor, ConfigurationSelector solutionConfiguration, ProjectOperationContext context)
+ [ThreadSafe]
+ public virtual bool ContainsItem (WorkspaceObject obj)
{
- try {
- System.Runtime.Remoting.Messaging.CallContext.SetData ("MonoDevelop.Projects.ProjectOperationContext", context);
- return Build (monitor, solutionConfiguration);
- } finally {
- System.Runtime.Remoting.Messaging.CallContext.SetData ("MonoDevelop.Projects.ProjectOperationContext", null);
- }
- }
-
- public void Execute (IProgressMonitor monitor, ExecutionContext context, string configuration)
- {
- Execute (monitor, context, (SolutionConfigurationSelector) configuration);
- }
-
- public void Execute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
- {
- Services.ProjectService.GetExtensionChain (this).Execute (monitor, this, context, configuration);
+ return this == obj;
}
- public bool CanExecute (ExecutionContext context, string configuration)
+ [ThreadSafe]
+ public virtual IEnumerable<Project> GetProjectsContainingFile (FilePath fileName)
{
- return CanExecute (context, (SolutionConfigurationSelector) configuration);
+ yield break;
}
- public bool CanExecute (ExecutionContext context, ConfigurationSelector configuration)
- {
- return Services.ProjectService.GetExtensionChain (this).CanExecute (this, context, configuration);
- }
-
- public IEnumerable<ExecutionTarget> GetExecutionTargets (string configuration)
+ [ThreadSafe]
+ public virtual ReadOnlyCollection<string> GetConfigurations ()
{
- return GetExecutionTargets ((SolutionConfigurationSelector) configuration);
+ return new ReadOnlyCollection<string> (new string [0]);
}
- public IEnumerable<ExecutionTarget> GetExecutionTargets (ConfigurationSelector configuration)
+ internal void SetParentWorkspace (Workspace workspace)
{
- return Services.ProjectService.GetExtensionChain (this).GetExecutionTargets (this, configuration);
+ AssertMainThread ();
+ parentWorkspace = workspace;
}
- [Obsolete ("This method will be removed in future releases")]
- public bool NeedsBuilding (string configuration)
- {
- return true;
- }
-
- [Obsolete ("This method will be removed in future releases")]
- public bool NeedsBuilding (ConfigurationSelector configuration)
- {
- return true;
- }
-
- [Obsolete ("This method will be removed in future releases")]
- public void SetNeedsBuilding (bool value)
- {
- }
-
- [Obsolete ("This method will be removed in future releases")]
- public void SetNeedsBuilding (bool needsBuilding, string configuration)
- {
- }
-
- [Obsolete ("This method will be removed in future releases")]
- public void SetNeedsBuilding (bool needsBuilding, ConfigurationSelector configuration)
- {
- }
-
- public virtual FileFormat FileFormat {
- get {
- if (format == null) {
- format = Services.ProjectService.GetDefaultFormat (this);
- }
- return format;
- }
- }
-
- public virtual bool SupportsFormat (FileFormat format)
- {
- return true;
- }
-
- public virtual void ConvertToFormat (FileFormat format, bool convertChildren)
- {
- FormatSet = true;
- this.format = format;
- if (!string.IsNullOrEmpty (FileName))
- FileName = format.GetValidFileName (this, FileName);
- }
-
- internal virtual BuildResult InternalBuild (IProgressMonitor monitor, ConfigurationSelector configuration)
- {
- return Services.ProjectService.GetExtensionChain (this).RunTarget (monitor, this, ProjectService.BuildTarget, configuration);
- }
-
protected virtual void OnConfigurationsChanged ()
{
if (ConfigurationsChanged != null)
@@ -395,27 +226,40 @@ namespace MonoDevelop.Projects
ParentWorkspace.OnConfigurationsChanged ();
}
- public void Save (FilePath fileName, IProgressMonitor monitor)
+ public Task SaveAsync (FilePath fileName, ProgressMonitor monitor)
{
+ AssertMainThread ();
FileName = fileName;
- Save (monitor);
+ return SaveAsync (monitor);
}
-
- public void Save (IProgressMonitor monitor)
- {
- try {
- fileStatusTracker.BeginSave ();
- Services.ProjectService.GetExtensionChain (this).Save (monitor, this);
- SaveUserProperties ();
- OnSaved (new WorkspaceItemEventArgs (this));
+
+ [ThreadSafe]
+ public Task SaveAsync (ProgressMonitor monitor)
+ {
+ return Runtime.RunInMainThread (async delegate {
+ using (await WriteLock ()) {
+ foreach (var f in GetItemFiles (false))
+ FileService.RequestFileEdit (f);
+ try {
+ fileStatusTracker.BeginSave ();
+ await ItemExtension.Save (monitor);
+ await OnSaveUserProperties (); // Call the virtual to avoid the lock
+ OnSaved (new WorkspaceItemEventArgs (this));
- // Update save times
- } finally {
- fileStatusTracker.EndSave ();
- }
- FileService.NotifyFileChanged (FileName);
+ // Update save times
+ } finally {
+ fileStatusTracker.EndSave ();
+ }
+ }
+ FileService.NotifyFileChanged (FileName);
+ });
}
-
+
+ protected internal virtual Task OnSave (ProgressMonitor monitor)
+ {
+ return Task.FromResult (0);
+ }
+
public virtual bool NeedsReload {
get {
return fileStatusTracker.NeedsReload;
@@ -425,138 +269,134 @@ namespace MonoDevelop.Projects
}
}
- public virtual bool ItemFilesChanged {
+ [ThreadSafe]
+ public bool ItemFilesChanged {
get {
return fileStatusTracker.ItemFilesChanged;
}
}
- internal protected virtual BuildResult OnRunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration)
- {
- if (target == ProjectService.BuildTarget)
- return OnBuild (monitor, configuration);
- else if (target == ProjectService.CleanTarget) {
- OnClean (monitor, configuration);
- return null;
- }
- return null;
- }
-
- internal protected virtual bool OnGetSupportsTarget (string target)
- {
- return true;
- }
-
+ [ThreadSafe]
internal protected virtual bool OnGetSupportsExecute ()
{
return true;
}
- protected virtual void OnClean (IProgressMonitor monitor, ConfigurationSelector configuration)
- {
- }
-
- protected virtual BuildResult OnBuild (IProgressMonitor monitor, ConfigurationSelector configuration)
+ [ThreadSafe]
+ public IEnumerable<IBuildTarget> GetExecutionDependencies ()
{
- return null;
+ yield break;
}
-
- internal protected virtual void OnExecute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+
+ protected bool Loading { get; private set; }
+
+ /// <summary>
+ /// Called when a load operation for this item has started
+ /// </summary>
+ internal protected async virtual Task OnBeginLoad ()
{
+ Loading = true;
+ await LoadUserProperties ();
}
- internal protected virtual bool OnGetCanExecute (ExecutionContext context, ConfigurationSelector configuration)
+ /// <summary>
+ /// Called when a load operation for this item has finished
+ /// </summary>
+ internal protected virtual Task OnEndLoad ()
{
- return true;
+ Loading = false;
+ fileStatusTracker.ResetLoadTimes ();
+ return Task.FromResult (true);
}
- internal protected virtual IEnumerable<ExecutionTarget> OnGetExecutionTargets (ConfigurationSelector configuration)
+ /// <summary>
+ /// Called when an item has been fully created and/or loaded
+ /// </summary>
+ /// <remarks>>
+ /// This method is invoked when all operations required for creating or loading this item have finished.
+ /// If the item is being created in memory, this method will be called just after OnExtensionChainInitialized.
+ /// If the item is being loaded from a file, it will be called after OnEndLoad.
+ /// If the item is being created from a template, it will be called after InitializeNew
+ /// </remarks>
+ protected virtual void OnItemReady ()
{
- yield break;
}
- internal protected virtual bool OnGetNeedsBuilding (ConfigurationSelector configuration)
- {
- return true;
- }
-
- internal protected virtual void OnSetNeedsBuilding (bool val, ConfigurationSelector configuration)
+ internal void NotifyItemReady ()
{
+ ItemExtension.ItemReady ();
+ OnItemReady ();
}
-
- void ILoadController.BeginLoad ()
- {
- loading++;
- OnBeginLoad ();
- }
-
- void ILoadController.EndLoad ()
+
+ public async Task LoadUserProperties ()
{
- loading--;
- fileStatusTracker.ResetLoadTimes ();
- OnEndLoad ();
+ using (await ReadLock ())
+ await OnLoadUserProperties ();
}
-
- protected virtual void OnBeginLoad ()
+
+ protected virtual async Task OnLoadUserProperties ()
{
+ userProperties.Dispose ();
+ userProperties = new PropertyBag ();
+
+ string preferencesFileName = GetPreferencesFileName ();
+
+ await Task.Run (() => {
+ if (!File.Exists (preferencesFileName))
+ return;
+
+ using (var streamReader = new StreamReader (preferencesFileName)) {
+ XmlTextReader reader = new XmlTextReader (streamReader);
+ try {
+ reader.MoveToContent ();
+ if (reader.LocalName != "Properties")
+ return;
+
+ XmlDataSerializer ser = new XmlDataSerializer (new DataContext ());
+ ser.SerializationContext.BaseFile = preferencesFileName;
+ userProperties = (PropertyBag)ser.Deserialize (reader, typeof(PropertyBag));
+ } catch (Exception e) {
+ LoggingService.LogError ("Exception while loading user solution preferences.", e);
+ return;
+ } finally {
+ reader.Close ();
+ }
+ }
+ });
}
- protected virtual void OnEndLoad ()
+ public async Task SaveUserProperties ()
{
+ using (await WriteLock ())
+ await OnSaveUserProperties ();
}
-
- public virtual void LoadUserProperties ()
+
+ protected virtual Task OnSaveUserProperties ()
{
- if (userProperties != null)
- userProperties.Dispose ();
- userProperties = null;
-
- string preferencesFileName = GetPreferencesFileName ();
- if (!File.Exists (preferencesFileName))
- return;
+ string file = GetPreferencesFileName ();
+ var userProps = userProperties;
- using (var streamReader = new StreamReader (preferencesFileName)) {
- XmlTextReader reader = new XmlTextReader (streamReader);
+ return Task.Run (() => {
+ if (userProps == null || userProps.IsEmpty) {
+ if (File.Exists (file))
+ File.Delete (file);
+ return;
+ }
+
+ XmlTextWriter writer = null;
try {
- reader.MoveToContent ();
- if (reader.LocalName != "Properties")
- return;
-
+ writer = new XmlTextWriter (file, System.Text.Encoding.UTF8);
+ writer.Formatting = Formatting.Indented;
XmlDataSerializer ser = new XmlDataSerializer (new DataContext ());
- ser.SerializationContext.BaseFile = preferencesFileName;
- userProperties = (PropertyBag)ser.Deserialize (reader, typeof(PropertyBag));
+ ser.SerializationContext.BaseFile = file;
+ ser.Serialize (writer, userProps, typeof(PropertyBag));
} catch (Exception e) {
- LoggingService.LogError ("Exception while loading user solution preferences.", e);
- return;
+ LoggingService.LogWarning ("Could not save solution preferences: " + file, e);
} finally {
- reader.Close ();
+ if (writer != null)
+ writer.Close ();
}
- }
- }
-
- public virtual void SaveUserProperties ()
- {
- string file = GetPreferencesFileName ();
-
- if (userProperties == null || userProperties.IsEmpty) {
- if (File.Exists (file))
- File.Delete (file);
- return;
- }
-
- XmlTextWriter writer = null;
- try {
- writer = new XmlTextWriter (file, System.Text.Encoding.UTF8);
- writer.Formatting = Formatting.Indented;
- XmlDataSerializer ser = new XmlDataSerializer (new DataContext ());
- ser.SerializationContext.BaseFile = file;
- ser.Serialize (writer, userProperties, typeof(PropertyBag));
- } catch (Exception e) {
- LoggingService.LogWarning ("Could not save solution preferences: " + GetPreferencesFileName (), e);
- } finally {
- if (writer != null)
- writer.Close ();
- }
+ });
}
string GetPreferencesFileName ()
@@ -588,17 +428,11 @@ namespace MonoDevelop.Projects
return absPath.ToRelative (BaseDirectory);
}
- public virtual void Dispose()
+ protected override void OnDispose ()
{
- if (extendedProperties != null) {
- foreach (object ob in extendedProperties.Values) {
- IDisposable disp = ob as IDisposable;
- if (disp != null)
- disp.Dispose ();
- }
- }
if (userProperties != null)
userProperties.Dispose ();
+ base.OnDispose ();
}
protected virtual void OnNameChanged (WorkspaceItemRenamedEventArgs e)
@@ -609,11 +443,6 @@ namespace MonoDevelop.Projects
NameChanged (this, e);
}
- internal protected virtual object OnGetService (Type t)
- {
- return null;
- }
-
protected void NotifyModified ()
{
OnModified (new WorkspaceItemEventArgs (this));
@@ -649,6 +478,19 @@ namespace MonoDevelop.Projects
fileStatusTracker.ReloadRequired -= value;
}
}*/
+
+ internal class DefaultWorkspaceItemExtension: WorkspaceItemExtension
+ {
+ internal protected override IEnumerable<FilePath> GetItemFiles (bool includeReferencedFiles)
+ {
+ return Item.OnGetItemFiles (includeReferencedFiles);
+ }
+
+ internal protected override Task Save (ProgressMonitor monitor)
+ {
+ return Item.OnSave (monitor);
+ }
+ }
}
class FileStatusTracker<TEventArgs> where TEventArgs:EventArgs
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceItemCollection.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceItemCollection.cs
index e7604fbe92..a8aac77b22 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceItemCollection.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceItemCollection.cs
@@ -31,7 +31,7 @@ using System.Collections;
namespace MonoDevelop.Projects
{
- public class WorkspaceItemCollection: Collection<WorkspaceItem>
+ public class WorkspaceItemCollection: ItemCollection<WorkspaceItem>
{
Workspace parent;
@@ -39,26 +39,15 @@ namespace MonoDevelop.Projects
{
}
- public WorkspaceItemCollection (IList<WorkspaceItem> list) : base(list)
- {
- }
-
internal WorkspaceItemCollection (Workspace parent)
{
this.parent = parent;
}
-
- public WorkspaceItem[] ToArray ()
- {
- WorkspaceItem[] arr = new WorkspaceItem [Count];
- CopyTo (arr, 0);
- return arr;
- }
-
+
internal void Replace (WorkspaceItem item, WorkspaceItem newItem)
{
int i = IndexOf (item);
- Items [i] = newItem;
+ List = List.SetItem (i, newItem);
if (parent != null) {
item.ParentWorkspace = null;
newItem.ParentWorkspace = parent;
@@ -67,47 +56,26 @@ namespace MonoDevelop.Projects
// Don't notify the parent workspace here since Replace is only
// used internally when reloading items
}
-
- protected override void ClearItems ()
+
+ protected override void OnItemsRemoved (IEnumerable<WorkspaceItem> items)
{
+ base.OnItemsRemoved (items);
if (parent != null) {
- List<WorkspaceItem> items = new List<WorkspaceItem> (this);
foreach (WorkspaceItem it in items) {
it.ParentWorkspace = null;
parent.NotifyItemRemoved (new WorkspaceItemChangeEventArgs (it, false));
}
}
- else
- base.ClearItems ();
}
-
- protected override void InsertItem (int index, WorkspaceItem item)
- {
- base.InsertItem (index, item);
- if (parent != null) {
- item.ParentWorkspace = parent;
- parent.NotifyItemAdded (new WorkspaceItemChangeEventArgs (item, false));
- }
- }
-
- protected override void RemoveItem (int index)
- {
- WorkspaceItem item = this [index];
- base.RemoveItem (index);
- if (parent != null) {
- item.ParentWorkspace = parent;
- parent.NotifyItemRemoved (new WorkspaceItemChangeEventArgs (item, false));
- }
- }
-
- protected override void SetItem (int index, WorkspaceItem item)
+
+ protected override void OnItemsAdded (IEnumerable<WorkspaceItem> items)
{
- WorkspaceItem oldItem = this [index];
- base.SetItem (index, item);
+ base.OnItemsAdded (items);
if (parent != null) {
- item.ParentWorkspace = parent;
- parent.NotifyItemRemoved (new WorkspaceItemChangeEventArgs (oldItem, false));
- parent.NotifyItemAdded (new WorkspaceItemChangeEventArgs (item, false));
+ foreach (var item in items) {
+ item.ParentWorkspace = parent;
+ parent.NotifyItemAdded (new WorkspaceItemChangeEventArgs (item, false));
+ }
}
}
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceItemExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceItemExtension.cs
new file mode 100644
index 0000000000..9e41d12e2d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceItemExtension.cs
@@ -0,0 +1,79 @@
+//
+// WorkspaceItemExtension.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using MonoDevelop.Core;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Projects
+{
+ public class WorkspaceItemExtension: WorkspaceObjectExtension
+ {
+ WorkspaceItemExtension next;
+
+ internal protected override bool SupportsObject (WorkspaceObject item)
+ {
+ return item is WorkspaceItem;
+ }
+
+ internal protected override void InitializeChain (ChainedExtension next)
+ {
+ base.InitializeChain (next);
+ this.next = FindNextImplementation<WorkspaceItemExtension> (next);
+ }
+
+ protected WorkspaceItem Item {
+ get { return (WorkspaceItem) base.Owner; }
+ }
+
+ internal protected virtual bool SupportsItem (WorkspaceItem item)
+ {
+ return next.SupportsItem (item);
+ }
+
+ internal void ItemReady ()
+ {
+ OnItemReady ();
+ if (next != null)
+ next.OnItemReady ();
+ }
+
+ protected virtual void OnItemReady ()
+ {
+ }
+
+ internal protected virtual Task Save (ProgressMonitor monitor)
+ {
+ return next.Save (monitor);
+ }
+
+ internal protected virtual IEnumerable<FilePath> GetItemFiles (bool includeReferencedFiles)
+ {
+ return next.GetItemFiles (includeReferencedFiles);
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceObject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceObject.cs
new file mode 100644
index 0000000000..65cbfbc2b3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceObject.cs
@@ -0,0 +1,615 @@
+// IWorkspaceObject.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+using System;
+using System.Collections.Generic;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Serialization;
+using System.Collections;
+using MonoDevelop.Projects.Extensions;
+using Mono.Addins;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Runtime.Remoting.Messaging;
+using MonoDevelop.Core.StringParsing;
+using System.Threading;
+
+
+namespace MonoDevelop.Projects
+{
+ public abstract class WorkspaceObject: IExtendedDataItem, IFolderItem, IDisposable
+ {
+ Hashtable extendedProperties;
+ bool initializeCalled;
+ bool isShared;
+ object localLock = new object ();
+ ExtensionContext extensionContext;
+ CancellationTokenSource disposeCancellation = new CancellationTokenSource ();
+ HashSet<Task> activeTasks = new HashSet<Task> ();
+
+ internal protected void Initialize<T> (T instance)
+ {
+ if (instance.GetType () != typeof(T))
+ return;
+ var delayedInitialize = CallContext.LogicalGetData ("MonoDevelop.DelayItemInitialization");
+ if (delayedInitialize != null && (bool)delayedInitialize)
+ return;
+ EnsureInitialized ();
+ }
+
+ internal void EnsureInitialized ()
+ {
+ if (!initializeCalled) {
+ initializeCalled = true;
+
+ extensionContext = AddinManager.CreateExtensionContext ();
+ extensionContext.RegisterCondition ("ItemType", new ItemTypeCondition (GetType ()));
+
+ OnInitialize ();
+ InitializeExtensionChain ();
+ OnExtensionChainInitialized ();
+ }
+ }
+
+ protected void AssertMainThread ()
+ {
+ if (isShared)
+ Runtime.AssertMainThread ();
+ }
+
+ /// <summary>
+ /// This CancellationTokenSource is used to cancel all async operations when the object is disposed.
+ /// </summary>
+ protected CancellationToken InstanceCancellationToken {
+ get { return disposeCancellation.Token; }
+ }
+
+ /// <summary>
+ /// Binds a task to this object. The object will track the task execution and if the object is disposed,
+ /// it will try to cancel the task and will wait for the task to end.
+ /// </summary>
+ /// <returns>The task returned by the provided lambda.</returns>
+ /// <param name="f">A lambda that takes a CancellationToken token as argument and returns the task
+ /// to be tracked. The provided CancellationToken will be signalled when the object is disposed.</param>
+ /// <typeparam name="T">Task return type</typeparam>
+ public Task<T> BindTask<T> (Func<CancellationToken, Task<T>> f)
+ {
+ var t = f (disposeCancellation.Token);
+ lock (activeTasks)
+ activeTasks.Add (t);
+ t.ContinueWith (tr => {
+ lock (activeTasks)
+ activeTasks.Remove (t);
+ });
+ return t;
+ }
+
+ /// <summary>
+ /// Binds a task to this object. The object will track the task execution and if the object is disposed,
+ /// it will try to cancel the task and will wait for the task to end.
+ /// </summary>
+ /// <returns>The task returned by the provided lambda.</returns>
+ /// <param name="f">A lambda that takes a CancellationToken token as argument and returns the task
+ /// to be tracked. The provided CancellationToken will be signalled when the object is disposed.</param>
+ public Task BindTask (Func<CancellationToken, Task> f)
+ {
+ var t = f (disposeCancellation.Token);
+ lock (activeTasks)
+ activeTasks.Add (t);
+ t.ContinueWith (tr => {
+ lock (activeTasks)
+ activeTasks.Remove (t);
+ });
+ return t;
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether this instance is shared.
+ /// </summary>
+ /// <remarks>Shared objects can only be modified in the main thread</remarks>
+ public bool IsShared {
+ get { return isShared; }
+ }
+
+ /// <summary>
+ /// Sets this object as shared, which means that it is accessible from several threads for reading,
+ /// but it can only be modified in the main thread
+ /// </summary>
+ public void SetShared ()
+ {
+ OnSetShared ();
+ }
+
+ protected virtual void OnSetShared ()
+ {
+ isShared = true;
+ ItemExtension.NotifyShared ();
+ }
+
+ public string Name {
+ get { return OnGetName (); }
+ }
+
+ public FilePath ItemDirectory {
+ get { return OnGetItemDirectory (); }
+ }
+
+ public FilePath BaseDirectory {
+ get { return OnGetBaseDirectory (); }
+ }
+
+ public WorkspaceObject ParentObject { get; protected set; }
+
+ public IEnumerable<WorkspaceObject> GetChildren ()
+ {
+ return OnGetChildren ();
+ }
+
+ public IEnumerable<T> GetAllItems<T> () where T: WorkspaceObject
+ {
+ if (this is T)
+ yield return (T)this;
+ foreach (var c in OnGetChildren ()) {
+ foreach (var r in c.GetAllItems<T> ())
+ yield return r;
+ }
+ }
+
+ /// <summary>
+ /// Gets extended properties.
+ /// </summary>
+ /// <remarks>
+ /// This dictionary can be used by add-ins to store arbitrary information about this solution item.
+ /// Keys and values can be of any type.
+ /// If a value implements IDisposable, the value will be disposed when this item is disposed.
+ /// </remarks>
+ public IDictionary ExtendedProperties {
+ get {
+ return OnGetExtendedProperties ();
+ }
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether this <see cref="MonoDevelop.Projects.SolutionItem"/> has been disposed.
+ /// </summary>
+ /// <value>
+ /// <c>true</c> if disposed; otherwise, <c>false</c>.
+ /// </value>
+ internal protected bool Disposed { get; private set; }
+
+ public void Dispose ()
+ {
+ AssertMainThread ();
+
+ if (Disposed)
+ return;
+
+ Disposed = true;
+
+ disposeCancellation.Cancel ();
+
+ Task[] allTasks;
+
+ lock (activeTasks)
+ allTasks = activeTasks.ToArray ();
+
+ if (allTasks.Length > 0)
+ Task.WhenAll (allTasks).ContinueWith (t => OnDispose (), TaskScheduler.FromCurrentSynchronizationContext ());
+ else
+ OnDispose ();
+ }
+
+ protected virtual void OnDispose ()
+ {
+ if (extensionChain != null) {
+ extensionChain.Dispose ();
+ extensionChain = null;
+ }
+
+ if (extendedProperties != null) {
+ foreach (object ob in extendedProperties.Values) {
+ IDisposable disp = ob as IDisposable;
+ if (disp != null)
+ disp.Dispose ();
+ }
+ extendedProperties = null;
+ }
+ }
+
+ /// <summary>
+ /// Gets a service instance of a given type
+ /// </summary>
+ /// <returns>
+ /// The service.
+ /// </returns>
+ /// <typeparam name='T'>
+ /// Type of the service
+ /// </typeparam>
+ /// <remarks>
+ /// This method looks for an imlpementation of a service of the given type.
+ /// </remarks>
+ public T GetService<T> ()
+ {
+ return (T) GetService (typeof(T));
+ }
+
+ /// <summary>
+ /// Gets a service instance of a given type
+ /// </summary>
+ /// <returns>
+ /// The service.
+ /// </returns>
+ /// <param name='t'>
+ /// Type of the service
+ /// </param>
+ /// <remarks>
+ /// This method looks for an imlpementation of a service of the given type.
+ /// </remarks>
+ public object GetService (Type t)
+ {
+ return ItemExtension.GetService (t);
+ }
+
+ public StringTagModelDescription GetStringTagModelDescription (ConfigurationSelector conf)
+ {
+ return ItemExtension.OnGetStringTagModelDescription (conf);
+ }
+
+ protected virtual StringTagModelDescription OnGetStringTagModelDescription (ConfigurationSelector conf)
+ {
+ var m = new StringTagModelDescription ();
+ m.Add (GetType ());
+ return m;
+ }
+
+ /// <summary>
+ /// Gets the string tag model for this solution item
+ /// </summary>
+ /// <returns>
+ /// The string tag model
+ /// </returns>
+ /// <param name='conf'>
+ /// Configuration for which to get the string tag model
+ /// </param>
+ public StringTagModel GetStringTagModel (ConfigurationSelector conf)
+ {
+ return ItemExtension.OnGetStringTagModel (conf);
+ }
+
+ protected virtual StringTagModel OnGetStringTagModel (ConfigurationSelector conf)
+ {
+ var m = new StringTagModel ();
+ m.Add (this);
+ return m;
+ }
+
+ /// <summary>
+ /// Gets a value indicating whether the extension chain for this object has already been created and initialized
+ /// </summary>
+ protected bool IsExtensionChainCreated {
+ get { return extensionChain != null; }
+ }
+
+ ExtensionChain extensionChain;
+ protected ExtensionChain ExtensionChain {
+ get {
+ AssertExtensionChainCreated ();
+ return extensionChain;
+ }
+ }
+
+ protected void AssertExtensionChainCreated ()
+ {
+ if (extensionChain == null) {
+ if (!initializeCalled)
+ throw new InvalidOperationException ("The constructor of type " + GetType () + " must call Initialize(this)");
+ else
+ throw new InvalidOperationException ("The extension chain can't be used before OnExtensionChainInitialized() method is called");
+ }
+ }
+
+ public ExtensionContext ExtensionContext {
+ get {
+ return this.extensionContext;
+ }
+ }
+
+ WorkspaceObjectExtension itemExtension;
+
+ WorkspaceObjectExtension ItemExtension {
+ get {
+ if (itemExtension == null)
+ AssertExtensionChainCreated ();
+ return itemExtension;
+ }
+ }
+
+ public void AttachExtension (WorkspaceObjectExtension ext)
+ {
+ AssertMainThread ();
+ ExtensionChain.AddExtension (ext);
+ ext.Init (this);
+ }
+
+ public void DetachExtension (WorkspaceObjectExtension ext)
+ {
+ AssertMainThread ();
+ ExtensionChain.RemoveExtension (ext);
+ }
+
+ void InitializeExtensionChain ()
+ {
+ // Create an initial empty extension chain. This avoid crashes in case a call to SupportsObject ends
+ // calling methods from the extension
+
+ var tempExtensions = new List<WorkspaceObjectExtension> ();
+ tempExtensions.AddRange (CreateDefaultExtensions ().Reverse ());
+ extensionChain = ExtensionChain.Create (tempExtensions.ToArray ());
+ foreach (var e in tempExtensions)
+ e.Init (this);
+
+ // Collect extensions that support this object
+
+ var extensions = new List<WorkspaceObjectExtension> ();
+ foreach (ProjectModelExtensionNode node in GetModelExtensions (extensionContext)) {
+ if (node.CanHandleObject (this)) {
+ var ext = node.CreateExtension ();
+ if (ext.SupportsObject (this))
+ extensions.Add (ext);
+ else
+ ext.Dispose ();
+ }
+ }
+
+ foreach (var e in tempExtensions)
+ e.Dispose ();
+
+ // Now create the final extension chain
+
+ extensions.Reverse ();
+ extensions.AddRange (CreateDefaultExtensions ().Reverse ());
+ extensionChain = ExtensionChain.Create (extensions.ToArray ());
+ foreach (var e in extensions)
+ e.Init (this);
+
+ itemExtension = ExtensionChain.GetExtension<WorkspaceObjectExtension> ();
+
+ foreach (var e in extensions)
+ e.OnExtensionChainCreated ();
+ }
+
+ static ProjectModelExtensionNode[] modelExtensions;
+
+ internal static IEnumerable<ProjectModelExtensionNode> GetModelExtensions (ExtensionContext ctx)
+ {
+ if (ctx != null) {
+ return Runtime.RunInMainThread (() => ctx.GetExtensionNodes (ProjectService.ProjectModelExtensionsPath).Cast<ProjectModelExtensionNode> ().Concat (customNodes).ToArray ()).Result;
+ }
+ else {
+ if (modelExtensions == null)
+ Runtime.RunInMainThread ((Action)InitExtensions).Wait ();
+ return modelExtensions;
+ }
+ }
+
+ static void InitExtensions ()
+ {
+ AddinManager.ExtensionChanged += OnExtensionsChanged;
+ LoadExtensions ();
+ }
+
+ static void OnExtensionsChanged (object sender, ExtensionEventArgs args)
+ {
+ if (args.Path == ProjectService.ProjectModelExtensionsPath)
+ LoadExtensions ();
+ }
+
+ static void LoadExtensions ()
+ {
+ modelExtensions = AddinManager.GetExtensionNodes<ProjectModelExtensionNode> (ProjectService.ProjectModelExtensionsPath).Concat (customNodes).ToArray ();
+ }
+
+ static List<ProjectModelExtensionNode> customNodes = new List<ProjectModelExtensionNode> ();
+
+ internal static void RegisterCustomExtension (ProjectModelExtensionNode node)
+ {
+ customNodes.Add (node);
+ LoadExtensions ();
+ }
+
+ internal static void UnregisterCustomExtension (ProjectModelExtensionNode node)
+ {
+ customNodes.Remove (node);
+ LoadExtensions ();
+ }
+
+ protected virtual IEnumerable<WorkspaceObjectExtension> CreateDefaultExtensions ()
+ {
+ yield return new DefaultWorkspaceObjectExtension ();
+ }
+
+ /// <summary>
+ /// Called after the object is created, but before the extension chain has been created.
+ /// </summary>
+ protected virtual void OnInitialize ()
+ {
+ }
+
+ /// <summary>
+ /// Called when the extension chain for this object has been created. This method can be overriden
+ /// to do initializations on the object that require access to the extension chain
+ /// </summary>
+ protected virtual void OnExtensionChainInitialized ()
+ {
+ }
+
+ internal virtual IDictionary OnGetExtendedProperties ()
+ {
+ lock (localLock) {
+ if (extendedProperties == null)
+ extendedProperties = new Hashtable ();
+ return extendedProperties;
+ }
+ }
+
+ protected virtual IEnumerable<WorkspaceObject> OnGetChildren ()
+ {
+ yield break;
+ }
+
+ protected virtual object OnGetService (Type t)
+ {
+ return t.IsInstanceOfType (this) ? this : null;
+ }
+
+ protected abstract string OnGetName ();
+
+ protected abstract string OnGetItemDirectory ();
+
+ protected abstract string OnGetBaseDirectory ();
+
+ internal class DefaultWorkspaceObjectExtension: WorkspaceObjectExtension
+ {
+ internal protected override object GetService (Type t)
+ {
+ return Owner.OnGetService (t);
+ }
+
+ internal protected override StringTagModelDescription OnGetStringTagModelDescription (ConfigurationSelector conf)
+ {
+ return Owner.OnGetStringTagModelDescription (conf);
+ }
+
+ internal protected override StringTagModel OnGetStringTagModel (ConfigurationSelector conf)
+ {
+ return Owner.OnGetStringTagModel (conf);
+ }
+ }
+
+ protected Task<IDisposable> ReadLock ()
+ {
+ lock (lockLock) {
+ var ts = new TaskCompletionSource<IDisposable> ();
+ var ol = new ObjectLock { Object = this, IsWriteLock = false, TaskSource = ts };
+ if (writeLockTaken) {
+ if (lockRequests == null)
+ lockRequests = new Queue<ObjectLock> ();
+ lockRequests.Enqueue (ol);
+ } else {
+ readLocksTaken++;
+ ts.SetResult (ol);
+ }
+ return ts.Task;
+ }
+ }
+
+ protected Task<IDisposable> WriteLock ()
+ {
+ lock (lockLock) {
+ var ts = new TaskCompletionSource<IDisposable> ();
+ var ol = new ObjectLock { Object = this, IsWriteLock = true, TaskSource = ts };
+ if (writeLockTaken || readLocksTaken > 0) {
+ if (lockRequests == null)
+ lockRequests = new Queue<ObjectLock> ();
+ lockRequests.Enqueue (ol);
+ } else {
+ writeLockTaken = true;
+ ts.SetResult (ol);
+ }
+ return ts.Task;
+ }
+ }
+
+ void ReleaseLock (bool isWriteLock)
+ {
+ lock (lockLock) {
+ if (!isWriteLock) {
+ // If there are readers still running, we can't release the lock
+ if (--readLocksTaken > 0)
+ return;
+ }
+
+ while (lockRequests != null && lockRequests.Count > 0) {
+ // If readers have been awakened, we can't awaken a writer
+ if (readLocksTaken > 0 && lockRequests.Peek ().IsWriteLock)
+ return;
+ var next = lockRequests.Dequeue ();
+ if (next.IsWriteLock) {
+ // Only one writer at a time
+ next.TaskSource.SetResult (next);
+ return;
+ } else {
+ // All readers can be awakened at once
+ writeLockTaken = false;
+ readLocksTaken++;
+ next.TaskSource.SetResult (next);
+ }
+ }
+ writeLockTaken = false;
+ }
+ }
+
+ class ObjectLock: IDisposable
+ {
+ public WorkspaceObject Object;
+ public bool IsWriteLock;
+ public TaskCompletionSource<IDisposable> TaskSource;
+
+ public void Dispose ()
+ {
+ Object.ReleaseLock (IsWriteLock);
+ }
+ }
+
+ Queue<ObjectLock> lockRequests;
+
+ int readLocksTaken;
+ bool writeLockTaken;
+
+ object lockLock = new object ();
+ }
+
+ public static class WorkspaceObjectExtensions
+ {
+ public static T As<T> (this WorkspaceObject ob) where T:class
+ {
+ return ob != null ? ob.GetService<T> () : null;
+ }
+ }
+
+ public interface IWorkspaceFileObject: IFileItem, IDisposable
+ {
+ IEnumerable<FilePath> GetItemFiles (bool includeReferencedFiles);
+ new FilePath FileName { get; set; }
+ bool NeedsReload { get; set; }
+ bool ItemFilesChanged { get; }
+ Task SaveAsync (ProgressMonitor monitor);
+ string Name { get; set; }
+ FilePath BaseDirectory { get; }
+ FilePath ItemDirectory { get; }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceObjectExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceObjectExtension.cs
new file mode 100644
index 0000000000..a1a5dbc03b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceObjectExtension.cs
@@ -0,0 +1,100 @@
+//
+// WorkspaceObjectExtension.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Mono.Addins;
+using MonoDevelop.Core.StringParsing;
+
+namespace MonoDevelop.Projects
+{
+ public class WorkspaceObjectExtension: ChainedExtension
+ {
+ WorkspaceObjectExtension next;
+
+ internal protected override void InitializeChain (ChainedExtension next)
+ {
+ base.InitializeChain (next);
+ this.next = FindNextImplementation<WorkspaceObjectExtension> (next);
+ }
+
+ protected WorkspaceObject Owner { get; private set; }
+
+ internal protected virtual bool SupportsObject (WorkspaceObject item)
+ {
+ return true;
+ }
+
+ internal void Init (WorkspaceObject item)
+ {
+ Owner = item;
+ Initialize ();
+ }
+
+ /// <summary>
+ /// Invoked just after creation the extension chain of the object
+ /// </summary>
+ internal protected virtual void Initialize ()
+ {
+ }
+
+ /// <summary>
+ /// Invoked after all extensions have been initialized
+ /// </summary>
+ internal protected virtual void OnExtensionChainCreated ()
+ {
+ }
+
+ internal protected virtual object GetService (Type t)
+ {
+ return t.IsInstanceOfType (this) ? this : next.GetService (t);
+ }
+
+ internal void NotifyShared ()
+ {
+ OnSetShared ();
+ if (next != null)
+ next.OnSetShared ();
+ }
+
+ protected virtual void OnSetShared ()
+ {
+ }
+
+ internal protected virtual StringTagModelDescription OnGetStringTagModelDescription (ConfigurationSelector conf)
+ {
+ var m = next.OnGetStringTagModelDescription (conf);
+ m.Add (GetType ());
+ return m;
+ }
+
+ internal protected virtual StringTagModel OnGetStringTagModel (ConfigurationSelector conf)
+ {
+ var m = next.OnGetStringTagModel (conf);
+ m.Add (this);
+ return m;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceObjectReader.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceObjectReader.cs
new file mode 100644
index 0000000000..9c0a453544
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceObjectReader.cs
@@ -0,0 +1,67 @@
+// ProjectServiceExtension.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+
+using System;
+using MonoDevelop.Core;
+using System.Threading.Tasks;
+using MonoDevelop.Projects.MSBuild;
+
+namespace MonoDevelop.Projects
+{
+ public abstract class WorkspaceObjectReader
+ {
+ internal WorkspaceObjectReader Next;
+
+ public abstract bool CanRead (FilePath file, Type expectedType);
+
+ public virtual Task<SolutionItem> LoadSolutionItem (ProgressMonitor monitor, SolutionLoadContext ctx, string fileName, MSBuildFileFormat expectedFormat, string typeGuid, string itemGuid)
+ {
+ throw new NotSupportedException ();
+ }
+
+ public virtual Task<WorkspaceItem> LoadWorkspaceItem (ProgressMonitor monitor, string fileName)
+ {
+ throw new NotSupportedException ();
+ }
+ }
+
+ class DummyWorkspaceObjectReader: WorkspaceObjectReader
+ {
+ public override bool CanRead (FilePath file, Type expectedType)
+ {
+ return false;
+ }
+ }
+
+ public class BuildData
+ {
+ public ProjectItemCollection Items { get; internal set; }
+ public DotNetProjectConfiguration Configuration { get; internal set; }
+ public ConfigurationSelector ConfigurationSelector { get; internal set; }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceSerializationExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceSerializationExtension.cs
new file mode 100644
index 0000000000..3076efafc3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceSerializationExtension.cs
@@ -0,0 +1,79 @@
+//
+// WorkspaceSerializationExtension.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.IO;
+using System.Threading.Tasks;
+using MonoDevelop.Core;
+using System.Xml;
+using MonoDevelop.Core.Serialization;
+using MonoDevelop.Projects.MD1;
+
+namespace MonoDevelop.Projects
+{
+ class WorkspaceSerializationExtension: WorkspaceObjectReader
+ {
+ public override bool CanRead (FilePath file, Type expectedType)
+ {
+ if (expectedType.IsAssignableFrom (typeof(Workspace))) {
+ string ext = Path.GetExtension (file).ToLower ();
+ if (ext == ".mdw")
+ return true;
+ }
+ return false;
+ }
+
+ public override Task<WorkspaceItem> LoadWorkspaceItem (ProgressMonitor monitor, string fileName)
+ {
+ return Task.Run (async () => {
+ var workspaceItem = ReadWorkspaceItemFile (fileName, monitor);
+ await workspaceItem.LoadUserProperties ();
+ return workspaceItem;
+ });
+ }
+
+ WorkspaceItem ReadWorkspaceItemFile (FilePath fileName, ProgressMonitor monitor)
+ {
+ XmlTextReader reader = new XmlTextReader (new StreamReader (fileName));
+ try {
+ monitor.BeginTask (string.Format (GettextCatalog.GetString ("Loading workspace item: {0}"), fileName), 1);
+ reader.MoveToContent ();
+ XmlDataSerializer ser = new XmlDataSerializer (MD1ProjectService.DataContext);
+ ser.SerializationContext.BaseFile = fileName;
+ ser.SerializationContext.ProgressMonitor = monitor;
+ WorkspaceItem entry = (WorkspaceItem)ser.Deserialize (reader, typeof(WorkspaceItem));
+ entry.FileName = fileName;
+ return entry;
+ } catch (Exception ex) {
+ monitor.ReportError (string.Format (GettextCatalog.GetString ("Could not load solution item: {0}"), fileName), ex);
+ throw;
+ } finally {
+ monitor.EndTask ();
+ reader.Close ();
+ }
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Core/packages.config b/main/src/core/MonoDevelop.Core/packages.config
index 19c5e2c394..5183296a3b 100644
--- a/main/src/core/MonoDevelop.Core/packages.config
+++ b/main/src/core/MonoDevelop.Core/packages.config
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
-</packages> \ No newline at end of file
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
+</packages>
diff --git a/main/src/core/MonoDevelop.Ide/AssemblyInfo.cs b/main/src/core/MonoDevelop.Ide/AssemblyInfo.cs
index 84ab363a6f..b775eeea6d 100644
--- a/main/src/core/MonoDevelop.Ide/AssemblyInfo.cs
+++ b/main/src/core/MonoDevelop.Ide/AssemblyInfo.cs
@@ -15,7 +15,20 @@ using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("MonoDevelop.DesignerSupport")]
[assembly: InternalsVisibleTo("Ide.Tests")]
[assembly: InternalsVisibleTo("UnitTests")]
+[assembly: InternalsVisibleTo("MonoDevelop.SourceEditor")]
+[assembly: InternalsVisibleTo("Xamarin.OSXEditor")]
[assembly: InternalsVisibleTo("MonoDevelop.Refactoring")]
+[assembly: InternalsVisibleTo("MonoDevelop.CSharpBinding")]
+[assembly: InternalsVisibleTo("FSharpBinding")]
+[assembly: InternalsVisibleTo("MonoDevelop.Xml")]
+[assembly: InternalsVisibleTo("MonoDevelop.AspNet")]
[assembly: InternalsVisibleTo("Xamarin.Ide")]
[assembly: InternalsVisibleTo("MonoDevelop.SourceEditor")]
[assembly: InternalsVisibleTo("MonoDevelop.SourceEditor2")]
+[assembly: InternalsVisibleTo("MonoDevelop.AssemblyBrowser")]
+[assembly: InternalsVisibleTo("MonoDevelop.AspNet")]
+[assembly: InternalsVisibleTo("Xamarin.Sketches")]
+[assembly: InternalsVisibleTo("MonoDevelop.CSharpBinding.AspNet")]
+[assembly: InternalsVisibleTo("MonoDevelop.GtkCore")]
+[assembly: InternalsVisibleTo("MonoDevelop.PackageManagement")]
+[assembly: InternalsVisibleTo("Xamarin.Forms.Addin.Tests")]
diff --git a/main/src/core/MonoDevelop.Ide/ChangeLog b/main/src/core/MonoDevelop.Ide/ChangeLog
deleted file mode 100644
index ea589b1d82..0000000000
--- a/main/src/core/MonoDevelop.Ide/ChangeLog
+++ /dev/null
@@ -1,19649 +0,0 @@
-2010-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide/RootWorkspace.cs:
- * MonoDevelop.Ide.Gui/AuthorInformation.cs:
- * MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/AuthorInformationPanel.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/GlobalAuthorInformationPanel.cs:
- Moved AuthorInformation to MD.Projects. Use the new
- AuthorInformation added to Solution and SolutionItem. Track
- api changes.
-
-2010-08-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide/RootWorkspace.cs: Pick a good default
- configuration when loading a solution for the first time.
- Fixes bug 627297 - Projects from VS.NET solution are not
- build.
-
-2010-07-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs:
- Don't show the project count in the solution node. That
- space can be used for more useful things.
-
-2010-07-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/EditCommands.cs:
- * MonoDevelop.Ide.Commands/ViewCommands.cs: Use delegation
- methods.
-
-2010-07-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Use the parser service
- parser queue to update parse documents (=> fewer threads &
- fixes a possible dead lock)
-
-2010-07-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide/RootWorkspace.cs:
- * MonoDevelop.Ide/ProjectOperations.cs: Changed document
- parsing/text file provider now returns texteditordata
- provider.
-
-2010-07-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Be more carefully when
- updating parsed documents.
-
-2010-07-20 Levi Bard <levi@unity3d.com>
-
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- Ensure that results are displayed once they come in for
- mutable completion lists.
-
-2010-07-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.ProgressMonitoring/BaseProgressMonitor.cs:
- Better fix for Bug 617276 - MonoDevelop crashes when
- clicking on a script error in Unity3d.
-
-2010-07-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide/Ide.cs:
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide/RootWorkspace.cs:
- * MonoDevelop.Ide/DesktopService.cs:
- * MonoDevelop.Ide.Desktop/RecentItem.cs:
- * MonoDevelop.Ide.Desktop/RecentOpen.cs:
- * MonoDevelop.Ide.Commands/FileCommands.cs:
- * MonoDevelop.Ide.Desktop/PlatformService.cs:
- * MonoDevelop.Ide.Desktop/RecentFileStorage.cs: Moved recent
- files/projects lists to the desktopservice/platformservice
- so it can be made platform-dependent.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Tasks/CommentTasksView.cs: Track API
- changes.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/TextEditor.cs:
- * MonoDevelop.Ide.FindInFiles/Scope.cs:
- * MonoDevelop.Ide.Commands/EditCommands.cs:
- * MonoDevelop.Ide.Commands/ViewCommands.cs:
- * MonoDevelop.Ide.Tasks/CommentTasksView.cs:
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs:
- * MonoDevelop.Ide.FindInFiles/FileProvider.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs:
- * MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:
- * MonoDevelop.Ide.Commands/CustomStringTagProvider.cs:
- * MonoDevelop.Ide.Navigation/NavigationHistoryService.cs:
- * MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingCommands.cs:
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Replaced old text editor reminders with mono.texteditor &
- renamed the texteditordata property to editor.
-
-2010-07-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Text editor extensions are now based on the mono.texteditor
- infrastructure.
-
-2010-07-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide/ImageService.cs: Scale images when they
- don't fit when composing icons (Bug 609979 - Icon size
- errors).
-
-2010-07-15 Levi Bard <levi@unity3d.com>
-
- * MonoDevelop.Ide/RootWorkspace.cs:
- Don't second-guess NeedsReload logic.
-
-2010-07-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/TextEditor.cs:
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs:
- * MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:
- * MonoDevelop.Ide.CodeCompletion/ICompletionWidget.cs:
- * MonoDevelop.Ide.CodeCompletion/IParameterDataProvider.cs:
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- * MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs:
- Worked on 'Bug 621658 - Parameter hints disappear
- afterkeystroke'.
-
-2010-07-14 Levi Bard <levi@unity3d.com>
-
- * MonoDevelop.Ide/Ide.cs:
- * MonoDevelop.Ide/IdeStartup.cs:
- Don't open projects as source files.
-
-2010-07-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Components/SearchEntry.cs: Fixed potential issue
- in search entry when reparenting.
-
-2010-07-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Better comments
- about OS X hacks.
-
-2010-07-13 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Components/DropDownBox.cs:
- * MonoDevelop.Components/DropDownBoxListWindow.cs: Moved
- dropdown box to components.
-
-2010-07-13 Levi Bard <levi@unity3d.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- Restore previous window state at launch on OSX.
-
-2010-07-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Extensions/TextEditorExtensionNode.cs:
- Case-insensitive file extension comparison.
-
-2010-07-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Track
- ProjectDomService/Parser API.
-
-2010-07-12 Levi Bard <levi@unity3d.com>
-
- * MonoDevelop.Ide.ProgressMonitoring/BaseProgressMonitor.cs:
- Fix #617276: MD crashes when clicking a script error in Unity3d.
-
-2010-07-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs: ':'
- now automatically only filters files.
-
-2010-07-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Projects.OptionPanels/NamespaceSynchronisationPanel.cs:
- Naming policies panel should be shown for all items that
- contain DotNetProject, not just DotNetProject.
-
-2010-07-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic: Flsuh.
-
- * Makefile.am:
- * gtk-gui/objects.xml: Removed objects.xml from the
- Makefile.am since it's not in the project file and was
- breaking the build when MD added a resource ID to the
- makefile.
-
-2010-07-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: The "navigate forward/back"
- commands now use the Xcode binding, and a similar binding on
- Windows so they no longer block the subword navigation. Also
- add a Mac binding for "move selection up/down"
-
-2010-07-09 Levi Bard <levi@unity3d.com>
-
- * MonoDevelop.Ide/RootWorkspace.cs:
- Implement less disk-intensive project autoupdate.
-
-2010-07-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Components/SearchEntry.cs: taken out event
- handler on destroy.
-
-2010-07-08 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Components.Diff/Diff.cs:
- * MonoDevelop.Components/DropDownBoxListWindow.cs: Worked on
- version control gui.
-
-2010-07-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Removed unused
- event handler (deletetolineend is handled by the text
- editor).
-
-2010-07-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Components/PathBar.cs: Changed redrawing.
-
-2010-07-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Components/PathBar.cs: Added bounds check.
-
-2010-07-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Components/PathBar.cs: Improved resizing
- behavior.
-
-2010-07-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Components/PathBar.cs: fixed multi monitor
- support.
-
-2010-07-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Components/PathBar.cs: Path bar now supports a
- right hand side.
-
-2010-07-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/TextEditor.cs:
- * MonoDevelop.Ide.Gui/IBaseViewContent.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs:
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs:
- * MonoDevelop.Ide.Gui/AbstractBaseViewContent.cs: Worked on
- navigation panel/content interface.
-
-2010-07-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Components/PathBar.cs: Added the ability to show
- a separator inside a path.
-
-2010-07-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/ListWindow.cs: Fixed 'Bug
- 619800 - Auto-complete of nothing shouldn't auto-complete as
- void'.
-
-2010-07-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Components/PathBar.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs:
- * MonoDevelop.Ide.Gui.Content/IPathedDocument.cs: Worked on
- pathed document subsystem.
-
-2010-06-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/IWorkbenchWindow.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs:
- * MonoDevelop.Ide.Gui/HiddenWorkbenchWindow.cs: Addeds subview
- contents to the interface.
-
-2010-06-29 Carlo Kok <ck@remobjects.com>
-
- * MonoDevelop.Ide.Extensions/MimeTypeOptionsPanelNode.cs: Make
- the label localizable.
-
-2010-06-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Exposed workbench window.
-
-2010-06-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Navigation/NavigationHistoryService.cs: When
- clearing the navigation history, don't reuse the current
- item since it is destroyed by the clear method. Should fix
- bug #606557 - Invalid items in history service.
-
-2010-06-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components.Docking/DockItemContainer.cs: Added
- missing null checks. Fixes bug #613437 - Null Reference
- Exception on loading a project.
-
-2010-06-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components.Docking/DockBarItem.cs: Don't hide
- the item if the mouse pointer is inside the window. Fixes
- bug #565714 - Autohidden pads hide when viewing treeview
- tooltips.
-
-2010-06-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Fixed 'Bug 617382 - Parameter list tooltip is not hidden
- when pressing ctrl+left arrow'.
-
-2010-06-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/CompletionData.cs:
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- Fixed 'Bug 616653 - "import symbol" does not resolve full
- typenames'.
-
-2010-06-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/CustomStringTagProvider.cs: Add
- string tag for the config directory. Implements 615677 -
- Make the config folder variable available in custom
- commands.
-
-2010-06-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Only update
- changed lines.
-
-2010-06-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Fixed 'Bug
- 615831 - Texteditor is not invalidated after remove trailing
- wihte spaces action'.
-
-2010-06-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Components.Commands/KeyBindingManager.cs: Move
- the consumed shift modifier restoration to a more
- appropriate place. Add a better comment.
-
-2010-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide/RootWorkspace.cs: Disabled
- OnRunProjectChecks timeout because it churns disk, wastes
- power on laptop.
-
-2010-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/ListWidget.cs:
- * MonoDevelop.Ide.CodeCompletion/ListWindow.cs: when there are
- no matches, display a message to indicate that the
- completion list is still handling input
-
-2010-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Set icon for the default code
- formatting policies panel group to match the per-item one.
-
- * MonoDevelop.Ide.Desktop/PlatformService.cs: Handle icon for
- text/plain mimetype.
-
-2010-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Desktop/PlatformService.cs: Add a
- description for the text/plain mimetype.
-
-2010-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Remove nonexistent icon.
-
-2010-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Projects.OptionPanels/CodeFormattingPanel.cs:
- Only show mimetypes with policies.
-
-2010-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- Remove debug writelines. Disable
- process-enter-on-exact-match behaviour change or now.
-
-2010-06-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components.DockToolbars/DockToolbar.cs: Reset
- custom size requests before calculating the real size
- request. Fixes issue when getting the default size.
-
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Ensure the default
- layout is set after loading the workbench memento.
-
-2010-06-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * icons/SplashScreen.png: Updated.
-
-2010-06-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: Add new
- contributors.
-
-2010-06-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * BuildVariables.cs: Bump MD version.
-
-2010-06-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/ListWidget.cs: Fixed 'Bug
- 613539 - DOBa does not complete to DynamicObjectBase'.
-
-2010-06-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/CompletionData.cs:
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- Fixed 'Bug 613830 - Aggressive auto-complete list matching
- of keywords interferes with typing'.
-
-2010-06-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide/DesktopService.cs:
- * MonoDevelop.Ide.Desktop/PlatformService.cs: Added
- CanOpenTerminal/OpenInTerminal.
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FileOperationsBuilderExtension.cs:
- Use platform service CanOpenTerminal/OpenInTerminal instead
- of hardcoded gnome-terminal.
-
-2010-06-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs: Use
- List<FileTemplate> not ArrayList.
-
- * MonoDevelop.Ide.Projects/NewFileDialog.cs: Sort the template
- list by name.
-
-2010-06-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Always use the original identifier for ${Name}, not the new
- constructed filename. Makes things easier in templates that
- produce multiple files.
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs: Track
- SingleFileDescription template API.
-
-2010-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/ToolsCommands.cs: Use the correct
- tag model when parsing the working directory and command.
-
-2010-06-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs: Fix GTK
- warnings.
-
-2010-06-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components.Docking/DockFrame.cs:
- * MonoDevelop.Components.Docking/DockBarItem.cs: Resize the
- autohide frame when the main frame size changes. Fixes bug
- #611071 - Resizing while output window is open doesn't
- resizie the output window.
-
-2010-06-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components.DockToolbars/DockToolbar.cs: Don't
- enable the arrow button by default. This is handled by
- DockToolbarPanel.
-
- * MonoDevelop.Components.DockToolbars/DockToolbarPanel.cs:
- Improved toolbar resizing algorithm in PackRow. Instead of
- reducing size in all toolbars pixel by pixel, it will now
- reduce button by button. Fixes bug #545746 - Toolbar on
- small screens.
-
-2010-06-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components.DockToolbars/DockToolbar.cs: Disable
- custom drawing on the toolbar background since it hides the
- arrow button.
-
-2010-06-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/ProjectTemplate.cs:
- * MonoDevelop.Ide.Templates/SolutionDescriptor.cs:
- * MonoDevelop.Ide.Templates/SolutionItemDescriptor.cs: Lookup
- solution types through the add-in instance. Fixes bug
- #610150 - Unable to create Packaging Project.
-
-2010-06-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components.Commands/CommandManager.cs: Disable
- data item check in the default command handler since it may
- cause regressions.
-
-2010-06-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Bypass the
- cut/copy/paste commands if the current view doesn't support
- it.
-
-2010-06-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components.AutoTest/AutoTestSession.cs: The
- current object is now always the active widget unless some
- other specific object is set.
-
- * MonoDevelop.Components.AutoTest/AutoTestService.cs: Added
- basic support for recording a test session.
-
- * MonoDevelop.Components.Commands/CommandInfo.cs:
- * MonoDevelop.Components.Commands/CommandManager.cs:
- * MonoDevelop.Components.Commands/CommandArrayInfo.cs: Notofy
- key presses through the new KeyPressed event. Include the
- selected data item in the CommandActivated event args.
- Properly notify CommandActivated event when running the
- default handler of a command.
-
- * MonoDevelop.Components.Commands/ActionCommand.cs: Removed
- DispatchCommand and UpdateCommandInfo virtuals. They are not
- used and makes things more complex in the command manager.
-
- * MonoDevelop.Ide.Desktop/RecentItem.cs: Implemented Equals.
-
-2010-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/AlertDialog.cs: Allow selecting
- text.
-
-2010-05-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/SearchResult.cs: Fixed 'Bug
- 610092 - Navigate to dialog'.
-
-2010-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Execution/ExecutionModeCommandService.cs:
- Don't show the parameterization options if none of the
- supported execution modes is parameterizable. Fixes bug
- #609679 - Unable to Set Custom Execution Commands for
- ASP.NET projects.
-
-2010-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide/ProjectOperations.cs:
- * MonoDevelop.Ide.Gui.Components/ProjectFileEntry.cs:
- * MonoDevelop.Ide.Projects/ProjectFileSelectorDialog.cs: Fix
- incorrect use of ShowCustomDialog/RunCustomDialog.
-
-2010-05-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs: using
- fast match for member searches.
-
-2010-05-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/ListWidget.cs: Added bounds
- check.
-
-2010-05-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/ListWindow.cs:
- * MonoDevelop.Ide.CodeCompletion/ListWidget.cs:
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- Fixed 'Bug 601737 - Scrollbar range on completion list often
- incorrect'.
-
-2010-05-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- Fixed 'Bug 608058 - Completion list deselects if file was
- reparsed'.
-
-2010-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs:
- Properly store the selected tags list. Fixes bug #605218 -
- Cannot modify Task List in preferences.
-
-2010-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs:
- Use ShowCustomDialog (which destroys the dialog when done)
- instead of RunCustomDialog (which doesn't).
-
-2010-05-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Commands/FileCommands.cs:
- * MonoDevelop.Ide.Projects/AddFileDialog.cs:
- * MonoDevelop.Components/SelectFileDialog.cs:
- * MonoDevelop.Components/SelectFolderDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/OpenFileDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs:
- * MonoDevelop.Components.Extensions/ISelectFileDialog.cs:
- Improved the platform dialog abstractions. Unified and
- tidied code, factored code from OpenFileDialog, improved
- support for file filters.
-
- * MonoDevelop.Ide.Gui/Document.cs: Use platform dialog for
- OpenFile.
-
-2010-05-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/SearchResult.cs:
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs: It's
- now possible to search for fully qualified member names.
-
-2010-05-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.ProgressMonitoring/MessageDialogProgressMonitor.cs:
- * MonoDevelop.Ide.ProgressMonitoring/MultiTaskDialogProgressMonitor.cs:
- Dialog placement.
-
-2010-05-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Commands/FileCommands.cs: Use platform
- dialog, and dialog placement cleanup.
-
- * MonoDevelop.Ide.Gui.Dialogs/MultiMessageDialog.cs: More
- dialog placement cleanup.
-
-2010-05-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide/RootWorkspace.cs:
- * MonoDevelop.Ide/ProjectOperations.cs:
- * MonoDevelop.Ide.Commands/ViewCommands.cs:
- * MonoDevelop.Ide.Projects/AddFileDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/OpenFileDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/AddinLoadErrorDialog.cs:
- * MonoDevelop.Components.Extensions/ISelectFileDialog.cs:
- * MonoDevelop.Ide.Execution/ExecutionModeCommandService.cs:
- * MonoDevelop.Ide.Execution/MonoExecutionParametersWidget.cs:
- * MonoDevelop.Ide.Projects.OptionPanels/CodeFormattingPanel.cs:
- * MonoDevelop.Ide.Execution/CustomExecutionModeManagerDialog.cs:
- * MonoDevelop.Components.PropertyGrid.Editors/TextEditorDialog.cs:
- * MonoDevelop.Ide.Projects.OptionPanels/SolutionItemConfigurationsPanel.cs:
- More dialog placement cleanup.
-
- * MonoDevelop.Ide.Gui.OptionPanels/MonoRuntimePanel.cs:
- * MonoDevelop.Ide.Projects.OptionPanels/CustomCommandWidget.cs:
- Use platform dialog.
-
-2010-05-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/DocumentSwitcher.cs: Mark window as a
- popup, so the command manger doesn't intercept keystroke.
-
-2010-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components.Commands/CommandManager.cs: In
- GetCommandInfo, reset the bypass flag before calling the
- default handler.
-
-2010-05-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Components.Commands/KeyBindingManager.cs: Make
- MapRawKeys public.
-
-2010-05-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/DocumentSwitcher.cs: Map keys.
-
-2010-05-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Components/PangoCairoHelper.cs: Pre-emptively
- fix calling conventions for pangocairo on Windows.
-
-2010-05-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/objects.xml: Flush.
-
- * MonoDevelop.Ide/MessageService.cs:
- * MonoDevelop.Ide/ProjectOperations.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs:
- * MonoDevelop.Components.Commands/LinkCommandEntry.cs:
- * MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs:
- * MonoDevelop.Components.PropertyGrid.Editors/FlagsSelectorDialog.cs:
- More dialog placing.
-
-2010-05-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide/ProjectOperations.cs: Don't destroy
- references dialog.
-
-2010-05-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/NavigateToCommand.cs:
- Dialog placement.
-
-2010-05-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs: Revert
- show/hide changes as they make the panels behave weirdly.
-
-2010-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide/MessageService.cs:
- * MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs:
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs: Mac dialog
- placement tweaks.
-
-2010-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ProjectFileEntry.cs: Don't
- null the value if the file doesn't exist in the project,
- since this may wipe existing bad values. Add an
- VerifyFileExistsInProject property to opt into the old
- behaviour.
-
-2010-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Projects/ProjectFileSelectorDialog.cs: Added
- docs and convenience API.
-
- * gtk-gui/MonoDevelop.Ide.Projects.ConfirmProjectDeleteDialog.cs:
- Flush.
-
- * MonoDevelop.Components.Extensions/ISelectFileDialog.cs:
- Added ability to set filters in the dialogs.
-
- * MonoDevelop.Components/FolderDialog.cs:
- * MonoDevelop.Components/FileSelector.cs: Make internal.
- People should be using the platform file dialog API.
-
- * MonoDevelop.Ide.Projects/AddFileDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/OpenFileDialog.cs: Use file
- filters.
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:
- Track dialog API.
-
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide/ProjectOperations.cs: Clean up dialog
- placement.
-
- * MonoDevelop.Ide/MessageService.cs: New APIs for
- showing/running dialogs, and placing dialogs.
-
-2010-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Components/MenuButton.cs: Fix the View Conflicts
- button.
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs:
- Fix the View Conflicts button, and focus issues.
-
- * gtk-gui/objects.xml: Flush.
-
-2010-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Commands/EditCommands.cs: Forward the delete
- key to gtk if not processed.
-
-2010-05-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Components.Commands/KeyBindingManager.cs: More
- shift-tab fixage.
-
-2010-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/EditCommands.cs: Set bypass flag if
- Copy/Cut/Paste can't be handled, so that gtk can handle it.
-
- * MonoDevelop.Components.Commands/CommandManager.cs: When
- executing a command from a shortcut, don't forward the key
- press to gtk if the command was disabled, but do it if the
- bypass flag was set. With this change, the F10 key won't
- activate the main menu anymore when the step over command is
- disabled.
-
-2010-05-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Tasks/TaskService.cs: made informjumptotask
- internal.
-
-2010-05-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Tasks/Task.cs:
- * MonoDevelop.Ide.Tasks/TaskStore.cs:
- * MonoDevelop.Ide.Tasks/TaskService.cs: Added event to the
- task service that informs of a jump to task command.
-
-2010-05-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Components.Commands/KeyBindingManager.cs: Fix
- shift-tab brokenness.
-
-2010-05-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * icons/SplashScreen.png: Updated.
-
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs: Hide
- the dialog separator. Not needed.
-
-2010-05-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * BuildVariables.cs: Updated.
-
-2010-05-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * options/KeyBindingSchemeEmacs.xml: Fix keybindings.
-
-2010-05-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Fix keybindings.
-
-2010-05-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Components.Commands/KeyBindingManager.cs: Better
- handling of mapping raw keys to commands. We now use the
- keymap to consume shift keys when possible, except for
- letters. This means commands should remain sane across
- different keyboards, and will always be stored and displayed
- concisely.
-
-2010-05-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Components/TooltipWindow.cs: Try to fix
- criticals.
-
-2010-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components/GtkUtil.cs: Hide the tooltip when the
- tree is hidden. Made the code more robust. Fixes bug #606191
- - Null reference "Unhandled Exception" caused by auto-hide
- panel hiding while tooltip shows.
-
-2010-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Set the
- active location list every time a search is started.
-
-2010-05-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateCompletionData.cs:
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Make code template insertion API less confusing.
-
-2010-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/TransactedTreeBuilder.cs: In
- CommitChanges, mark children of a node as deleted if the
- node has been reset. Should fix bug #553903 - Solution pad
- treeview crash.
-
-2010-05-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide/Ide.cs: Track api change.
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide/IdePreferences.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/MaintenanceOptionsPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.MaintenanceOptionsPanelWidget.cs:
- Added option for enabling automated testing.
-
-2010-05-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components.AutoTest/AutoTestSession.cs:
- * MonoDevelop.Components.AutoTest/AutoTestService.cs:
- * MonoDevelop.Components.AutoTest/AutoTestClientSession.cs:
- Allow attaching to a running test service.
-
-2010-05-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components.AutoTest\AutoTestService.cs:
- * MonoDevelop.Components.AutoTest\AutoTestClientSession.cs:
- Access to the test server using an interface.
-
-2010-05-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Components/TooltipWindow.cs:
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- * MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs:
- Improved multi monitor support.-
-
-2010-05-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- Fixed 'Bug 490010 - Completion window hangs off bottom of
- the screen w/ dual-head "stretched desktop"'
-
-2010-05-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/ListWindow.cs:
- * MonoDevelop.Ide.CodeCompletion/ListWidget.cs: Fixed 'Bug
- 604997 - Inconsistent behaviour in completion list'.
-
-2010-05-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide/Ide.cs:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Components.AutoTest:
- * MonoDevelop.Components.Commands/CommandManager.cs:
- * MonoDevelop.Components.AutoTest/AutoTestSession.cs:
- * MonoDevelop.Components.AutoTest/AutoTestService.cs:
- * MonoDevelop.Components.AutoTest/AutoTestClientSession.cs:
- Added some experimental and basic support for automated gui
- testing.
-
-2010-05-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Emit the Closed
- event before disposing the view. In this way other
- extensions can properly unsubsribe events bound to the view.
-
-2010-05-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- Fixed 'Bug 605872 - Completion tooltips are never dismissed
- if the completion list is hidden too quickly'.
-
-2010-05-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/ListWidget.cs: Don't use
- expose clipbox as the window width. Fixes redrawing issue.
- Also cache Allocation and GCs to avoid wasteful transitions
- and allocations.
-
- * MonoDevelop.Components/ListView.cs: Draw on the expose
- event's Window. Also cache Allocation and GCs to avoid
- wasteful transitions and allocations.
-
-2010-05-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Projects/NewProjectDialog.cs: Added new
- GetDefaultTargetPlatform virtual to DotNetProject. It is
- overriden in DotNetAssemblyProject to set the default
- configuration for exes (x86).
-
-2010-05-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs:
- If a folder can't be deleted, show the error and just remove
- it from the project. Added support for 'apply to all' in the
- confirmation dialog.
-
-2010-05-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Don't dispose the
- command manager until we know for sure that we are exiting.
- Should fix bug #605393 - Error while building code.
-
-2010-05-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Navigation/HistoryList.cs:
- * MonoDevelop.Ide.Navigation/NavigationPoint.cs:
- * MonoDevelop.Ide.Navigation/NavigationHistoryItem.cs:
- Improved handling of disposal of navigation points. Avoid
- creating event handlers.
-
-2010-05-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Navigation/NavigationHistoryItem.cs:
- Intercept dispose event and change the sender so the
- HistoryList doesn't explode.
-
-2010-05-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Change 'Browse Next/Previous'
- command names to 'Show Next/Previous' to match the name that
- the search and error pads set.
-
-2010-05-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: (Revert revision 157026)
-
-2010-05-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.Navigation:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Tasks/TaskStore.cs:
- * MonoDevelop.Ide.Gui.Content/INavigable.cs:
- * MonoDevelop.Ide.Gui.Content/ILocationList.cs:
- * MonoDevelop.Ide.Commands/NavigationCommands.cs:
- * MonoDevelop.Ide.Gui/DocumentNavigationPoint.cs:
- * MonoDevelop.Ide.Gui/TextFileNavigationPoint.cs:
- * MonoDevelop.Ide.Gui/NavigationHistoryService.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Moved
- navigation service to a new namespace.
-
- * MonoDevelop.Ide.Navigation/HistoryList.cs:
- * MonoDevelop.Ide.Navigation/NavigationPoint.cs:
- * MonoDevelop.Ide.Navigation/NavigationHistoryItem.cs:
- * MonoDevelop.Ide.Navigation/TextFileNavigationPoint.cs:
- * MonoDevelop.Ide.Navigation/DocumentNavigationPoint.cs:
- * MonoDevelop.Ide.Navigation/NavigationHistoryService.cs:
- Properly dispose navigation points.
-
-2010-05-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- * MonoDevelop.Ide.CodeCompletion/DeclarationViewWindow.cs:
- Fixed 'Bug 604824 - Overloads tooltip should display
- non-obsolete overloads first'.
-
-2010-05-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/DocumentNavigationPoint.cs:
- * MonoDevelop.Ide.Gui/TextFileNavigationPoint.cs:
- * MonoDevelop.Ide.Gui/NavigationHistoryService.cs: Disable nav
- point snippets as they currently aren't used - and they
- should really be created lazily.
-
-2010-05-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/CompletionDataList.cs: fixed
- warning/removed unecessary method.
-
-2010-05-11 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.CodeCompletion/DisplayFlags.cs:
- * MonoDevelop.Ide.CodeCompletion/CompletionData.cs:
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs:
- * MonoDevelop.Ide.CodeCompletion/ICompletionData.cs:
- * MonoDevelop.Ide.CodeCompletion/CompletionDataList.cs:
- * MonoDevelop.Ide.CodeCompletion/CompletionCategory.cs:
- * MonoDevelop.Ide.CodeCompletion/MemberCompletionData.cs:
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- * MonoDevelop.Ide.CodeCompletion/IMemberCompletionData.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateCompletionData.cs:
- Made the code completion system a more consistent (Removed
- interfaces, provided common base class - easier to extend),
- ActionCompletionData in conjunction with completion history
- now works correctly. Custom CompletionData now has access to
- the list window as well (Required for more complex insert
- actions).
-
-2010-05-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs: filter
- matches.
-
-2010-05-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs:
- disabled the ListWidget.Matches usage.
-
-2010-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs: When
- converting an acronym match to a substring match, include
- the original acronym char in the current substring. Fixes
- bug #485376 - Go-to-file acronym matching inconsistent.
-
-2010-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components.Docking/DockGroup.cs: In
- RestoreAllocation, make a copy of the items list because
- RestoreAllocation can fire events such as VisibleChanged,
- and subscribers may do changes in the list. Should fix bug
- #600869 - Exception while switching layout from 'Solution'
- to 'Default' using the tool bar.
-
-
-2010-05-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide/IdeStartup.cs: Add command line argument to
- enable instrumentation service logging.
-
- * MonoDevelop.Ide.Gui/DockItemToolbarLoader.cs:
- * MonoDevelop.Components.Commands/CommandMenu.cs:
- * MonoDevelop.Components.Commands/CommandManager.cs:
- * MonoDevelop.Components.Commands/CommandToolbar.cs:
- * MonoDevelop.Components.Commands/CommandMenuItem.cs:
- * MonoDevelop.Components.Commands/ICommandUserItem.cs:
- * MonoDevelop.Components.Commands/CommandToolButton.cs:
- * MonoDevelop.Components.Commands/CommandCheckMenuItem.cs:
- * MonoDevelop.Components.Commands/CommandToggleToolButton.cs:
- Added CommandTargetRoute type, which will be used to cache
- information command target chains.
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Improved
- handling of status icons. Avoid creating too many images
- when animating.
-
-2010-05-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Changed some mac shortcuts.
-
-2010-05-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Changed the key for shownext/prev
- on mac.
-
-2010-05-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Search
- results now have exacter navigation points.
-
-2010-05-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide/ImageService.cs: When creating internal ids
- for icons loaded from resources, take into account the
- requested size, since the same resource may be used to
- create icons for different sizes. Fixes bug #603709 -
- Missing Debug Icon.
-
-2010-05-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide/RootWorkspace.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Don't close
- documents when closing the workspace, since they are closed
- later on. Fixes bug #603720 - quiting edited project -- MD
- asks twice to quit.
-
-2010-05-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs: Update
- zoom commands according to the zoom status.
-
-2010-05-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide/ProjectOperations.cs: Fixed 'Bug 604040 - Go
- to declaration doesn't work for a property which is from a
- base partial class'.
-
-2010-05-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- * MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs:
- Fixed 'Bug 603987 - Parameters tooltip shows over completion
- list'/parameter list now doesn't jump anymore.
-
-2010-05-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/FileScout.cs: Fix incorrect check
- when setting the sensitivity of the Go Up button.
-
-2010-05-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/ListWindow.cs: only use
- history for small partial words.
-
-2010-05-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: added null check.
-
-2010-05-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- Fixed 'Bug 602061 - Completion list tooltips should hide
- when selected item scrolled out of view'.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs: Added Dom
- property to document. This is the safest way to get the Dom
- assoziated with an open document. It NEVER returns null. It
- creates a special file only dom for files that are not bound
- to a project.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/ListWidget.cs: Fix 'Bug
- 603344 - Matching in completion list'.
-
-2010-05-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.csproj: Disable overflow checks.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide/Ide.cs:
- * MonoDevelop.Ide/ProjectOperations.cs: Delay project service
- loading.
-
-2010-05-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide/ProjectOperations.cs: Fixed 'Bug 603119 -
- Go-to-definition doesn't work with locals'.
-
-2010-05-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Components/CompactScrolledWindow.cs: Shrink
- spacing more.
-
-2010-05-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs: Fix
- cmd-scroll zoom on Mac. Use more conventional direction for
- zooming.
-
-2010-05-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Removed some event
- handlers on close.
-
-2010-05-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/NavigationHistoryService.cs: Take out
- event handler.
-
-2010-05-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Components/TooltipWindow.cs: FIX leak caused by
- transparency decorators.
-
-2010-05-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.CustomTools/CustomToolService.cs: Better
- warning message.
-
-2010-05-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.CustomTools/CustomToolService.cs: Cancel
- running tasks before re-running generator on same file.
-
-2010-05-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.CustomTools/CustomTool.cs:
- * MonoDevelop.Ide.CustomTools/CustomToolService.cs:
- * MonoDevelop.Ide.Extensions/CustomToolExtensionNode.cs: Make
- custom tools cancellable, and add an output pad for viewing
- their output and cancelling them.
-
-2010-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * templates/Workspace.xpt.xml: Set correct assembly name for
- the Workspace type. Fixes bug #602522 - Can't create a
- workspace.
-
-2010-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/FileBrowser.cs: Properly
- start the file browser. Fixes bug #484598 - Attempting to
- open folder with Nautilus in XFCE.
-
-2010-05-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Components.Commands/CommandManager.cs: Remove
- unnecessary fix for the IntPtr problem.
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Status bar
- status boxes are no longer overwriting each other & fixed
- little status bar leak.
-
-2010-05-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.Gui.Dialogs/NewLayoutDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs:
- Show validation messages for new layout names.
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Remove unused
- variable.
-
- * gtk-gui/objects.xml: Flush.
-
-2010-05-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Fix hiding toolbars
- in full view mode, and destroying of toolbar layouts.
-
-2010-05-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Commands/ViewCommands.cs: Simplify.
-
- * MonoDevelop.Components.DockToolbars/DockToolbarFrame.cs: Use
- generics. Add API for removing layouts.
-
- * MonoDevelop.Ide.Gui.Dialogs/NewLayoutDialog.cs: Restrict the
- names users can give layouts.
-
- * MonoDevelop.Ide.Gui/LayoutComboBox.cs: Track API, don't call
- costly property multiple times.
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Tweak API.
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Fix full view mode
- switching. Hide toolbars in full view mode. Destroy full
- view layouts after use so they don't diverge from the normal
- layouts.
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Components/FixedWidthWrapLabel.cs: Dispose
- pango.layout.
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Components.Commands/CommandManager.cs: Remove
- event handler on toolbar destroy.
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide/ImageService.cs:
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Dispose created
- pixbufs.
-
-2010-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.StandardHeader/GPL2LicencePolicy.xml:
- * MonoDevelop.Ide.StandardHeader/GPL3LicencePolicy.xml:
- * MonoDevelop.Ide.StandardHeader/LGPL3LicencePolicy.xml:
- * MonoDevelop.Ide.CodeFormatting/MonoTextStylePolicy.xml:
- * MonoDevelop.Ide.StandardHeader/NewBSDLicencePolicy.xml:
- * MonoDevelop.Ide.StandardHeader/MITX11LicencePolicy.xml:
- * MonoDevelop.Ide.StandardHeader/Apache2LicencePolicy.xml:
- * MonoDevelop.Ide.StandardHeader/LGPL2-1LicencePolicy.xml:
- * MonoDevelop.Ide.CodeFormatting/VisualStudioTextStylePolicy.xml:
- Added attribute to explicitly allow differential
- serialization for a policy (which is disabled by default).
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Components.Docking/DockItemContainer.cs: Destroy
- allocated pattern.
-
-2010-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: On Windows, show the global
- options command in the Tools menu.
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Components.Docking/ShadedContainer.cs: Call
- Destroy instead of Dispose - dispose seems not to be
- available for windows.
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/SplashScreen.cs: Correctly
- release splash-screen resources.
-
-2010-05-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Components.Docking/ShadedContainer.cs: Dispose
- pattern after use.
-
-2010-04-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/ListWindow.cs: Add = to the
- chars that can commit the selection.
-
-2010-04-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Fix destroy
- order.
-
-2010-04-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/TextFileNavigationPoint.cs:
- * MonoDevelop.Ide.Gui/NavigationHistoryService.cs: Navigation
- point log fixes.
-
-2010-04-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components/PathBar.cs:
- * MonoDevelop.Components/SearchEntry.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.CodeCompletion/ListWindow.cs:
- * MonoDevelop.Ide.CustomTools/CustomToolService.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Components/StringTagSelectorButton.cs:
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Fix warnings.
-
-2010-04-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Tasks/TaskStore.cs: Don't generate
- navigation points for tasks which don't have a file name.
-
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/DocumentNavigationPoint.cs: Revert check
- for return value of Show, since it should always work.
-
- * MonoDevelop.Ide.Gui/TextFileNavigationPoint.cs:
- * MonoDevelop.Ide.Gui/NavigationHistoryService.cs: Improved
- navigation point logging logic.
-
- * MonoDevelop.Ide.Gui/TextEditor.cs: New event.
-
-2010-04-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Custom completion lists now support trigger words.
-
-2010-04-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/ListWidget.cs: Did some
- performance optimizations on the completion list.
-
-2010-04-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/ListWindow.cs: Fixed 'Bug
- 601167 - IntelliSense keeps picking the wrong entry'.
-
-2010-04-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/DocumentNavigationPoint.cs: Unbreak
- document navigation.
-
-2010-04-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:
- Track AddFilesToProject API.
-
- * MonoDevelop.Ide/ProjectOperations.cs: Handle adding link
- files to subdirectories of a project in AddFilesToProject
- method. Tidy up a lot.
-
-2010-04-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Components.Commands/KeyBindingManager.cs: Remove
- underscores from Page_Up/Page_Down when displaying.
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs:
- Use some generic API.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/AbstractBaseViewContent.cs: ViewContent
- widgets are now destroyed by the workspace window.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Manually call
- 'box.Destroy ()' (work around for the IntPtr bug).
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Components.Commands/CommandManager.cs: Try to
- fix an IntPtr exception caused by accessing a invalid
- FocusChild.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/DocumentNavigationPoint.cs:
- * MonoDevelop.Ide.Gui/NavigationHistoryService.cs: found
- better fix for 'Bug 600657 - "Show Previous Warning/Error"
- fails when there are warnings without file offsets'.
-
-2010-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/DocumentNavigationPoint.cs: Fixed 'Bug
- 600657 - "Show Previous Warning/Error" fails when there are
- warnings without file offsets'.
-
-2010-04-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Desktop/PlatformService.cs: Track API, build
- build.
-
-2010-04-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * BuildVariables.cs: Require Mono 2.6.1. Updated version
- label.
-
-2010-04-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide\IdeStartup.cs: Add missing unchecked block.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/ListWidget.cs:
- * MonoDevelop.Ide.CodeCompletion/ListWindow.cs: Optimized
- performance a bit.
-
-2010-04-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs: Don't
- use FontDesc to change the font of the text renderer, since
- it overrides the font weight specified using markup. Fixes
- bug #595975 - Start project is no longer highlighted.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs:
- * MonoDevelop.Ide.NavigateToDialog/ResultsDataSource.cs:
- Ensured that the workers are working on a non-shared state.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/ListWindow.cs:
- * MonoDevelop.Ide.CodeCompletion/ListWidget.cs:
- * MonoDevelop.Ide.CodeCompletion/CompletionData.cs:
- * MonoDevelop.Ide.CodeCompletion/ICompletionData.cs:
- * MonoDevelop.Ide.NavigateToDialog/ResultsDataSource.cs:
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs: code
- completion list now can show descriptions & code completion
- list now has a width resize for long items.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/ListWidget.cs: Improved
- completion filtering.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs: Fixed 'Bug
- 599684 - Wrong text link in the 2,3,etc lines of the
- template'.
-
-2010-04-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Execution/ExecutionModeCommandService.cs:
- Added missing null check.
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Workaround for
- gtk-sharp bug #600463. The OnPageAdded override makes MD
- crash on windows.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- It's now possible to do custom code completion popups.
-
-2010-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Changed shortcut.
-
-2010-04-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Components.Docking/ShadedContainer.cs: Optimize
- rendering of the shaded background.
-
-2010-04-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs: Show a
- message while searching. Remove debug code.
-
-2010-04-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Execution/ParameterizedExecutionHandler.cs:
- Make IProcessAsyncOperation IDisposable.
-
-2010-04-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.Projects/NewFileDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Projects.NewFileDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Projects.NewProjectDialog.cs:
- * gtk-gui/MonoDevelop.Ide.NavigateToDialog.NavigateToDialog.cs:
- Improved look of the New File dialog.
-
-2010-04-27 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs:
- * gtk-gui/MonoDevelop.Ide.NavigateToDialog.NavigateToDialog.cs:
- made the default size of the navigate to dialog bigger.
-
-2010-04-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Changed
- destroying order. (tab label is used during the Close event
- chain).
-
-2010-04-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Destroying the
- tabLabel with destroy and not with dispose.
-
-2010-04-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/SearchResult.cs:
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs:
- * MonoDevelop.Ide.NavigateToDialog/ResultsDataSource.cs:
- Optimized ambience.GetString calls.
-
-2010-04-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Removed the
- box.Remove (control needs to be in the destroy chain).
-
-2010-04-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/SearchResult.cs: Corrected
- full name type highlighting.
-
-2010-04-27 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.NavigateToDialog/SearchResult.cs:
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs:
- * MonoDevelop.Ide.NavigateToDialog/ResultsDataSource.cs: Moved
- the navigate to threading model from semaphores to
- background workers.
-
-2010-04-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs:
- navigate to dialog now remembers the window size.
-
-2010-04-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs: Don't
- include the project folder in the relative name.
-
-2010-04-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs: Order
- by rank.
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs: Show
- file path in the description. if it's truncated from the
- match.
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Components.Commands/CommandManager.cs: Try to
- fix a intptr exception alan had.
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs:
- Corrected use full name for types.
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs: Worked
- on navigate to dialog.
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs:
- changed file search behavior to the old one.
-
-2010-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide/DesktopService.cs: Track last minute change.
-
-2010-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Desktop/PlatformService.cs: External console
- processes are now wrapped by a IProcessAsyncOperation
- interface, instead of a Process instance. In this way it is
- possible to create external consoles which are not directly
- bound to a process.
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Set document tag.
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: changed navigate to mac shortcut.
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- Fixed 'Bug 598828 – Completion window should not move
- relative to caret as it shrinks'.
-
-2010-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs: Remove
- unnecessary check that forces the loading of the class.
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Set navigate to shortcut key.
-
-2010-04-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs:
- Corrected member filtering.
-
-2010-04-23 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.NavigateToDialog:
- * MonoDevelop.Components/ListView.cs:
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs:
- * MonoDevelop.Ide.Commands/SearchCommands.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.GoToDialog.cs:
- * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs:
- * MonoDevelop.Ide.NavigateToDialog/NavigateToCommand.cs:
- * gtk-gui/MonoDevelop.Ide.NavigateToDialog.NavigateToDialog.cs:
- Worked on go to dialog. (go to file/type are unaffected in
- function - only the gui changed). Added 'Navigate To'
- command which allows to navigate to any file/type/member.
-
-2010-04-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolder.cs: Use
- canonical paths when comparing paths.
-
-2010-04-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Don't update
- cursor/mode labels when they're already empty.
-
-2010-04-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide/DispatchService.cs: Added new
- BackgroundDispatchAndWait method.
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Add support for
- progress bar with auto-pulse.
-
-2010-04-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/ListWindow.cs: Fixed 'Bug
- 598728 - Code completion does not commit on generics >'.
-
-2010-04-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide/Ide.cs:
- * MonoDevelop.Ide/IdeStartup.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/StartupInfo.cs: Remove unnecessary
- static data. Clean up some API.
-
-2010-04-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide/ProjectOperations.cs: Make 'quit while
- running' question dialog clearer.
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Don't follow
- through with quitting if the workspace cancelled the close
- request.
-
-2010-04-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/TaskListPad.cs:
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs:
- * MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs:
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs:
- * MonoDevelop.Components.PropertyGrid/PropertyGridTree.cs:
- Free up wasted space between scrollbars and treeview
- contents.
-
- * MonoDevelop.Components/CompactScrolledWindow.cs: New widget,
- ScrolledWindow with style overridden to have less padding
- inside.
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj: Added file.
-
-2010-04-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingCommands.cs:
- * MonoDevelop.Ide.CodeCompletion/CompletionWindowManager.cs:
- * MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs:
- Fixed 'Bug 598199 - Parameters tooltip shows over completion
- list'.
-
-2010-04-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs: Add null check
- when adding type results. It may happen if the type failed
- to load for some reason. Added a timer.
-
-2010-04-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide/DispatchService.cs:
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs: Don't queue
- gui calls if the current thread is already the gui thread.
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Fix dock item
- removal. It was unregistered too early.
-
-2010-04-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components.Docking/ShadedContainer.cs: Don't
- store screen coordinates because those may change if the
- main window is moved. Should fix bug #595192 - Pad shadow
- rendering issues.
-
-2010-04-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs: Remove
- duplicate log write.
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Draw the resize
- grip using the shaded background color.
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: The resize grip
- must always be visible in Mac. On other platforms show it
- only when not maximized.
-
-2010-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs:
- * MonoDevelop.Ide.Gui.Components/LogView.cs:
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs:
- * MonoDevelop.Ide.Gui/StatusProgressMonitor.cs:
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs:
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs:
- * MonoDevelop.Ide.FindInFiles/SearchProgressMonitor.cs: When
- clicking over the status bar, activate the pad that
- generated the status message being shown. For example, if
- the status bar shows "Build: 1 error", show the errors pad
- when clicking on that.
-
- * MonoDevelop.Ide/ProjectOperations.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:
- Fix warning.
-
- * MonoDevelop.Ide.Gui.Pads/TaskListPad.cs: Fix nullref.
-
-2010-04-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide/IdePreferences.cs: Added command to turn off
- message bubbles by default.
-
-2010-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components/GtkUtil.cs: Remove timers when the
- tree is destroyed.
-
-2010-04-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Components/SearchEntry.cs: Fixed 'Bug 596635 -
- Missing icon error on OS X when showing search'.
-
-2010-04-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Components.Docking/DockItemContainer.cs: Remove
- the horizontal gradient on the docked pad header, as it
- clashes with the vertical gradient on the pad toolbars.
-
-2010-04-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/DockItemToolbarLoader.cs:
- * MonoDevelop.Components.Commands/CommandMenuItem.cs:
- * MonoDevelop.Components.Commands/CommandToolButton.cs:
- * MonoDevelop.Components.Commands/CommandCheckMenuItem.cs:
- * MonoDevelop.Components.Commands/CommandToggleToolButton.cs:
- Pass source type to command dispatch.
-
- * MonoDevelop.Components.Commands/CommandManager.cs: Add
- command dispatch events, and source type parameter and
- overloads.
-
-2010-04-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/ConfigurationComboBox.cs: Fix font size
- with small toolbar.
-
-2010-04-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/ListWindow.cs: Give priority
- to items that have the match closer to the beginning of the
- string (see Bug 595240 - Completion list filtering should
- match on words not just at start).
-
- * MonoDevelop.Ide.CodeCompletion/DeclarationViewWindow.cs:
- Added bounds check.
-
-2010-04-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Fixed 'Bug 596511 - Code completion removes block selection
- and only affects 1 line'.
-
-2010-04-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components/GtkUtil.cs: Propagate the scroll
- event. Don't show the tooltip when clicking on the tree.
- Fixes issue with double click.
-
-2010-04-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- Don't show empty tooltips.
-
-2010-04-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Fixed possible null
- reference exception.
-
-2010-04-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide/ProjectOperations.cs: Properly check if an
- execution session has to be stopped when closing the current
- solution. Missed the RootWorkspace case.
-
-2010-04-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:
- * MonoDevelop.Ide.Gui.Content/DocumentStateTracker.cs: It's
- now possible to get the TextEditorData object from the
- Document.
-
-2010-04-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/ListWidget.cs: Implemented
- 'Bug 595240 - Completion list filtering should match on
- words not just at start'.
-
-2010-04-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs: Text
- editor extensions are now disposing correctly.
-
-2010-04-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components.PropertyGrid/PropertyGrid.cs: If the
- tree is re-populated while a value is being edited, the
- focus that the value editor had is not returned back to the
- tree. We need to explicitly get it.
-
-2010-04-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ConfigurationComboBox.cs: Don't show
- mnemonics for configuration and runtime names.
-
-2010-04-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Commands/TextEditorCommands.cs: Implemented
- command for 'Bug 595228 - Block selection should be usable
- from keyboard'
-
-
-2010-04-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Gui/Pad.cs: Show all pad categories in the
- View menu.
-
-2010-04-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components/TreeViewState.cs: When restoring
- state, if a node was selected and it now has been deleted,
- try to select an adjacent node. Fixes bug 595176 - Next
- breakpoint in BP pad should be selected after deleting a BP
- and similar bugs in other views using TreeStateView.
-
-2010-04-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- * MonoDevelop.Ide.CodeCompletion/DeclarationViewWindow.cs:
- Fixed declaration tooltip shows too much bug.
-
-2010-04-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide/ProjectOperations.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderFileNodeBuilder.cs:
- Add support for adding files to solution folders.
-
- * MonoDevelop.Ide/MessageService.cs:
- * MonoDevelop.Ide.Gui.Dialogs/AlertDialog.cs: Introduced the
- MessageDescription hierarchy of classes, which allow setting
- all message dialog settings in an object. It also adds
- support for the Apply to All option and other custom
- options.
-
- * MonoDevelop.Ide.Gui.Components/TreeBuilder.cs:
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs:
- * MonoDevelop.Ide.Gui.Components/TransactedTreeBuilder.cs:
- While in a transaction, make sure the OnNodeAdded event is
- fired when the node is added, not when the transaction is
- committed.
-
-2010-04-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide/Services.cs:
- * MonoDevelop.Ide/ProjectOperations.cs: Added build timers.
-
-2010-04-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Commands/EditCommands.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs: Added
- DeleteKey command, which can be used to easily bind the
- Delete key to command handlers.
-
-2010-04-08 Aaron Bockover <abockover@novell.com>
-
- * MonoDevelop.Components/SearchEntry.cs: Render the entry
- background flat box style "entry_bg" to properly draw the
- full entry (we were previously only drawing the shadow),
- which fixes a rendering bug in some themes - fix ported
- from Banshee
-
-2010-04-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.CodeCompletion/ListWindow.cs:
- * MonoDevelop.Ide.Commands/TextEditorCommands.cs:
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- * MonoDevelop.Ide.CodeCompletion/CompletionWindowManager.cs:
- Implemented 'Bug 572067 - Shortcut for toggling between
- completion and suggestion mode'.
-
-2010-04-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs:
- Add missing root folder check.
-
-2010-04-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Fixed
- 'Bug 559804 - Strings in search result pad are
- near-invisible'
-
-2010-04-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Fix
- build.
-
-2010-04-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Handle
- null ref in data func.
-
-2010-04-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components.Docking/DockContainer.cs: Partial fix
- dor bug 578531 - MD 2.2.1 Splitters only work if you move
- reeaaallllyyyy slooowwwllly on OSX.
-
-2010-04-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Commands/SearchCommands.cs: Added use
- selection for find/replace commands (for mac specific
- behavior).
-
-2010-04-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs: Fix
- spelling, and make fade-in quicker.
-
-2010-04-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components/GtkUtil.cs: Properly free the
- allocated event.
-
-2010-04-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/ListWidget.cs:
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- Handled possible null reference.
-
-2010-04-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs:
- worked on 'Bug 593232 - Intense flickering in OSX with
- help/autocompletion on OSX'.
-
-2010-04-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs: Implemented
- 'Bug 591436 - Cannot add the "$" symbol to the custom
- template text'.
-
-2010-04-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide/IdePreferences.cs: Changed message bubble
- property keys.
-
- * gtk-gui/objects.xml:
-
-2010-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide/DesktopService.cs:
- * MonoDevelop.Ide.Desktop/PlatformService.cs: Moved external
- console creation to the platform service.
-
-2010-03-29 Levi Bard <levi@unity3d.com>
-
- * MonoDevelop.Ide/IdeStartup.cs: Remove debug logging.
-
-2010-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs: Fixed bug
- #591785 - Unable to cast object of type 'Gtk.Alignment' to
- type 'Gtk.Image'.
-
-2010-03-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide/DispatchService.cs: Strongly type queues,
- and use an event instead of an active wait.
-
-2010-03-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide/Ide.cs: Exit returns bool indicating whether
- user cancelled.
-
-2010-03-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Components.DockToolbars/DockToolbarPanel.cs:
- Worked around toolbar background rendering issues on Mac.
-
-2010-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/FileProvider.cs: Don't save the
- file if nothing has been replaced.
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- * MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs:
- HashtableToStringArray is not necessary. The string parser
- service can directly handle a string dictionary.
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * gtk-gui/objects.xml:
- * MonoDevelop.Ide/Ide.cs:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Commands/ToolsCommands.cs:
- * MonoDevelop.Ide.ExternalTools/ExternalTool.cs:
- * MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs:
- * MonoDevelop.Ide.Commands/CustomStringTagProvider.cs:
- * MonoDevelop.Ide.Gui.Components/StringTagSelectorButton.cs:
- * MonoDevelop.Ide.Projects.OptionPanels/CustomCommandPanel.cs:
- * MonoDevelop.Ide.Projects.OptionPanels/CustomCommandWidget.cs:
- * gtk-gui/MonoDevelop.Ide.ExternalTools.ExternalToolPanelWidget.cs:
- * MonoDevelop.Ide.Projects.OptionPanels/CustomCommandPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Components.StringTagSelectorButton.cs:
- * gtk-gui/MonoDevelop.Ide.Projects.OptionPanels.CustomCommandWidget.cs:
- Use the new string tag model. Added a new
- StringTagSelectorButton class.
-
- * MonoDevelop.Ide.Projects.OptionPanels/CombineConfigurationPanel.cs:
- Sort the configurations list.
-
-2010-03-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide/MessageService.cs: Use 'Ok' in error dialogs
- for consistency with warning and info dialogs.
-
-2010-03-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Desktop/DesktopApplication.cs: Properly
- invoke the application process.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Components.Docking/DockItem.cs: Set the focus to
- the child widget instead of the docking container. Fixes bug
- #561512 - Selecting floating pad from doc/pad switcher does
- not focus it.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/ProjectCommands.cs: Ask before
- restarting the execution of the solution. Fixes bug #561693
- - Usability issues in debugger commands.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Revert last change.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Use corrent layout
- configuration file name.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * BuildVariables.cs:
- * MonoDevelop.Ide.addin.xml: Bumped MD version.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs: Make the dialog
- non-sensitive after pressing ok. Make sure the locations
- list is not modified after getting it (should not happen
- anymore after the previous change, but just in case). Fixes
- bug #586575 - Goto dialog is not thread safe.
-
-2010-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Added
- some code to prevent 'Bug 589661 - Null ref aborting a
- search'.
-
-2010-03-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj: Updated.
-
- * MonoDevelop.Ide/Ide.cs:
- * MonoDevelop.Ide.Gui/StatusProgressMonitor.cs: Use the new
- status bar model.
-
- * MonoDevelop.Ide/ImageService.cs:
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Show error and
- warning icons in grayscale when there are no
- errors/warnings.
-
- * MonoDevelop.Ide.Commands/ViewCommands.cs: Don't sort layouts
- by name. Use the order in the extension point.
-
- * MonoDevelop.Components.Docking/DockGroup.cs:
- * MonoDevelop.Components.Docking/DockObject.cs:
- * MonoDevelop.Components.Docking/DockGroupItem.cs: Impoved the
- logic that selects a dock bar where to show an autohide item
- by default.
-
- * MonoDevelop.Components.Docking/DockItem.cs:
- * MonoDevelop.Components.Docking/DockFrame.cs:
- * MonoDevelop.Components.Docking/DockContainer.cs: Allow
- setting the dock location of an item.
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Extensions/LayoutExtensionNode.cs: Added
- extension point for registering stock layous. Assigned
- default layouts for existing pads.
-
- * gtk-gui/objects.xml:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs:
- Flush.
-
- * MonoDevelop.Ide.Gui/InternalLog.cs:
- * MonoDevelop.Ide.Gui/AddinUpdateHandler.cs:
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs:
- * MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs: New status
- bar model. The status bar widget is hidden behind an
- interface. Added support for status bar contexts. Status
- information displayed through a context is cleaned up when
- the context is disposed.
-
- * MonoDevelop.Ide.Gui/Pad.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/IPadContainer.cs:
- * MonoDevelop.Ide.Gui/WorkbenchMemento.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Merged
- SdiWorkspaceLayout into DefaultWorkbench. Removed support
- for workbench contexts.
-
- * MonoDevelop.Ide.Codons/PadCodon.cs: Allow setting the
- default layout of a pad.
-
- * MonoDevelop.Ide.Codons/WorkbenchContextCondition.cs: Not
- required anymore.
-
- * MonoDevelop.Ide.Tasks/TaskStore.cs: Show a better status
- message when the end of the task list is reached.
-
-2010-03-18 Levi Bard <levi@unity3d.com>
-
- * MonoDevelop.Ide/Ide.cs:
- * MonoDevelop.Ide/IdeStartup.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/StartupInfo.cs: Pass position
- information to OpenFiles.
-
-2010-03-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Optimized
- status bar update.
-
-2010-03-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs: Fixed 'Bug
- 589148 - Focus does not return to Find/Replace in Files
- dialog'.
-
- * gtk-gui/objects.xml:
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide/Services.cs:
- * MonoDevelop.Ide.Extensions/MimeTypeNode.cs:
- * MonoDevelop.Ide.Extensions/StockIconCodon.cs:
- * MonoDevelop.Ide.Extensions/OptionsPanelNode.cs:
- * MonoDevelop.Components.Extensions/MimeTypeNode.cs:
- * MonoDevelop.Ide.Extensions/OptionsDialogSection.cs:
- * MonoDevelop.Components.Extensions/StockIconCodon.cs:
- * MonoDevelop.Components.Extensions/OptionsPanelNode.cs:
- * MonoDevelop.Ide.Extensions/MimeTypeOptionsPanelNode.cs:
- * MonoDevelop.Components.Extensions/OptionsDialogSection.cs:
- * MonoDevelop.Ide.Projects.OptionPanels/CodeFormattingPanel.cs:
- * MonoDevelop.Components.Extensions/MimeTypeOptionsPanelNode.cs:
- Moved to correct directory. Fixed namespace for
- MimeTypeOptionsPanelNode.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- Merged MD.Projects into MD.Core, and MD.Projects.Gui,
- MD.Core.Gui and MD.Components into MD.Ide.
-
-2010-03-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs:
- Implemented 'Bug 588618 - Find in Files: "Directories"
- pattern should warn about non-existant path'.
-
-2010-03-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/IdePreferences.cs:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Changed the
- default error handling to: bubbles for errors & warnings,
- never show error list automatically & jump to first error.
-
-2010-03-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide.Commands/ToolsCommands.cs: Use new api for
- starting the monitor.
-
-2010-03-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs: Use
- command-scroll instead of control-scroll on Mac, because
- control-scroll is used by the window manager.
-
-2010-03-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.CustomTools:
- * MonoDevelop.Ide.CustomTools/CustomTool.cs:
- * MonoDevelop.Ide.CustomTools/CustomToolService.cs:
- * MonoDevelop.Ide.Extensions/CustomToolExtensionNode.cs: Added
- custom tools service.
-
- * MonoDevelop.Ide.Gui/Ide.cs: Init the custom tools service at
- startup.
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Allow setting generator.
-
-2010-03-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/DragOperation.cs:
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs:
- * MonoDevelop.Ide.Gui.Components/NodeCommandHandler.cs: Added
- DropPosition parameter to the drop methods.
-
-2010-03-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Moved code for loading
- user preferences to MD.Projects. Added some time counters.
-
-2010-03-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide/Services.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/IdeStartup.cs:
- * MonoDevelop.Ide.Commands/ToolsCommands.cs: Use the new
- timing counters.
-
-2010-03-12 Levi Bard <levi@unity3d.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Implement TCP IPC.
-
-2010-03-12 Levi Bard <levi@unity3d.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Implement TCP IPC.
-
-2010-03-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs:
- Properly compare data objects.
-
-2010-03-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs: Added
- deadlock insanity check
-
- * MonoDevelop.Ide.Gui/TextEditor.cs: improved string/escape
- char handling.
-
-2010-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/ILocationList.cs: Add missing
- file.
-
-2010-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj: Remove unused files from project.
-
-2010-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/Scope.cs:
- * MonoDevelop.Ide.FindInFiles/FindReplace.cs:
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs: Make
- better use of progress monitors. Use it to log the
- directories being searched.
-
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Tasks/TaskStore.cs:
- * MonoDevelop.Ide.Tasks/TaskService.cs:
- * MonoDevelop.Ide.Commands/ViewCommands.cs:
- * MonoDevelop.Ide.Gui.Pads/ILocationListPad.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultPad.cs:
- * MonoDevelop.Ide.Gui/TextFileNavigationPoint.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Improved
- Show Next/Previous command (F4). The list on which the
- command works now has to be explicitly set using the
- IdeApp.Workbench.ActiveLocationList.
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj: Added new files.
-
- * MonoDevelop.Ide.Commands/NavigationCommands.cs: Some api
- changes.
-
- * MonoDevelop.Ide.Gui.Pads/FileScout.cs:
- * MonoDevelop.Ide.Tasks/ITaskListView.cs:
- * MonoDevelop.Ide.Tasks/UserTasksView.cs:
- * MonoDevelop.Ide.Gui.Pads/TaskListPad.cs:
- * MonoDevelop.Ide.Tasks/CommentTasksView.cs:
- * MonoDevelop.Ide.Gui.Pads/InternalLogPad.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPad.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPadWidget.cs:
- Use the new DockItemToolbar for showing toolbar commands.
-
- * MonoDevelop.Ide.Gui.Components/LogView.cs:
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs: Factorized
- the widget which shows log from an IProgressMonitor from
- DefaultMonitorPad into the new LogView widget.
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Use the new
- DockItemToolbar for showing toolbar commands. Integrated the
- output pad into the errors list pad.
-
- * MonoDevelop.Ide.Gui/IdePreferences.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs:
- Added option for selection the GUI compactness.
-
- * MonoDevelop.Ide.Gui.OptionPanels/BuildMessagePanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildMessagePanelWidget.cs:
- Removed option for showing the build output pad, since it is
- now integrated into the errors pad.
-
- * MonoDevelop.Ide.addin.xml: Show the errors pad minimized by
- default.
-
- * gtk-gui/gui.stetic: Updated.
-
- * MonoDevelop.Ide.Gui/HiddenWorkbenchWindow.cs: Fix warning.
-
- * MonoDevelop.Ide.Gui/OutputProgressMonitor.cs: Factorized
- into the new LogView widget.
-
- * MonoDevelop.Ide.Gui/DocumentNavigationPoint.cs:
- * MonoDevelop.Ide.Gui/NavigationHistoryService.cs: Changed the
- api to be able to make the NavigationPoint class more
- reusable. It is now being used by the Show Next/Previous
- infrastructure.
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Embed the
- bottom dock bar.
-
- * MonoDevelop.Ide.Gui/IPadContainer.cs: Added flags for
- setting a pad as Working, HasErrors and HasNewData.
-
- * MonoDevelop.Ide.Gui/IWorkbench.cs:
- * MonoDevelop.Ide.Gui/IWorkbenchLayout.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Removed IWorkbech
- and IWorkbenchLayout interfaces, which are internal and not
- required anymore.
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Track misc api
- changes. Implement the new IPadWindow.IsWorking, HasErrors
- and HasNewData properties.
-
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs: By default,
- autohide dynamically created output pads. The build progress
- monitor now shows the log in the errors list pad. Don't use
- spaces in the output pad ids, since it may break
- serialization into xml.
-
- * MonoDevelop.Ide.Gui/Pad.cs: Track class name changes.
-
- * MonoDevelop.Ide.Gui/DockItemToolbarLoader.cs: New utility
- class with extension methods which allows loading a docking
- toolbar from a command entry set.
-
- * MonoDevelop.Ide.Codons/PadCodon.cs: Allow setting a default
- status for a pad (e.g. auto hide). Allow setting a custom
- widget as label to show when the pad is in autohide mode.
-
- * MonoDevelop.Ide.Gui/SideBar.cs: New layout switcher. Not yet
- used.
-
- * MonoDevelop.Ide.Gui/WorkbenchWindow.cs: New base class for
- the root workbench window.
-
- * MonoDevelop.Ide.Gui/WorkbenchContext.cs: File renamed from
- IWorkspace.
-
-2010-03-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.Gui/IdeStartup.cs:
- * MonoDevelop.Ide.Gui.Dialogs/TipOfTheDay.cs:
- * MonoDevelop.Ide.Gui.Dialogs/AddinLoadErrorDialog.cs: Use
- Mono.Options instead of Mono.GetOptions.
-
-2010-03-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Fixed 'Bug
- 585668 - Exception in statusbar caused by
- CompletionWindowManager'.
-
-2010-03-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs: Implement
- custom output pad font support.
-
-2010-03-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/IdePreferences.cs: Remove duplicate
- CustomPadFont property key migration; there's already
- migration code in Ide.cs and only the actual usages were not
- updated.
-
-2010-03-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs: Handle
- style change events and respect both zoom and custom fonts.
-
-2010-03-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/PadFontChanger.cs:
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs: Fix
- the custom pad font support. Apparently someone changed the
- property key name without changing the things that used it.
-
- * MonoDevelop.Ide.Gui/IdePreferences.cs: Migrate the old pad
- font size properties.
-
-2010-03-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Codons/PadCodon.cs:
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs: Fix pad
- initialization issue.
-
-2010-03-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Codons/PadCodon.cs:
- * MonoDevelop.Ide.Gui/IPadContainer.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Make sure pads
- are properly initialized when accessing them through the Pad
- wrapper object.
-
-2010-03-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs:
- * MonoDevelop.Ide.Codons/SolutionPadCodon.cs: Delay the
- initialization of the pad until the padWindow has been
- attached to it. Propagate the pad Id.
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs: Added
- support for zooming with control+wheel. Implemented the Zoom
- in/out/reset commands.
-
-2010-03-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Handle Link files
- in TransferFiles.
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs:
- Handle Link files.
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/LinkedFilesFolder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/LinkedFilesFolderNodeBuilder.cs:
- Not needed now we have proper Link file support.
-
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs: Handle Link
- files, fix spelling.
-
- * MonoDevelop.Ide.addin.xml: Remove LinkedFilesNodesBuilder
- now links are in the main directory tree.
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj: Removed files.
-
-2010-03-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Added message
- for describing the category mode keyboard switch when the
- code completion window is shown.
-
-2010-03-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Gui.Content/ITextEditorResolver.cs:
- Refactored text editor resolve providers. Language bindings
- now can provide own providers.
-
-2010-03-02 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Toggle code completion category is now toggled by the
- ShowCompletionWindow command, when the window is visible.
-
-2010-02-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs: Fix
- Gtk type warnings by converting icon id to string for store.
-
-2010-02-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Overwrite question buttons
- were reversed.
-
-2010-02-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Commands/TextEditorCommands.cs: Add Mac
- bindings for Ctrl-{T,L,O,K} and corresponding command
- definitions.
-
- * MonoDevelop.Ide.addin.xml: Add Mac bindings for
- Ctrl-{T,L,O,K} and corresponding commands definitions if
- needed.
-
-2010-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:
- * MonoDevelop.Ide.Gui.Content/IExtensibleTextEditor.cs:
- Changed API for 'Bug 429265 - #region reindentation does not
- work with autocompletion'.
-
-2010-02-23 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs:
- * gtk-gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs:
- Added some error messages for 'Bug 540891 - NRE when
- launching Find In Files search (whole solution)'.
-
-2010-02-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/ProjectDescriptor.cs: Fix nullref.
-
-2010-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/TextEditor.cs: Fixed new file template
- creation bug.
-
-2010-02-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs: set
- default for find in files to case insensitive.
-
-2010-02-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs: Added missing
- getstring call.
-
-2010-02-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateCompletionData.cs:
- Added missing getstring call.
-
-2010-02-18 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs:
- Edit references title is now translateable.
-
-2010-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/DocumentSwitcher.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs:
- * MonoDevelop.Ide.Commands/FileCommands.cs:
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs:
- * MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/IncludeNewFilesDialog.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/OverridesImplementsDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/ConfirmProjectDeleteDialog.cs:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanelWidget.cs:
- Track api changes.
-
- * MonoDevelop.Ide.Gui/Pad.cs:
- * MonoDevelop.Ide.Codons/PadCodon.cs:
- * MonoDevelop.Ide.Gui/IPadContainer.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs:
- * MonoDevelop.Ide.Templates/FileTemplate.cs:
- * MonoDevelop.Ide.Gui/AbstractPadContent.cs:
- * MonoDevelop.Ide.Templates/ProjectTemplate.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.Gui.Components/TreeViewItem.cs: Use the new
- IconId type.
-
-2010-02-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/ProjectReferencePanel.cs: Avoid
- stack overflow when there's a cyclic project dependency in
- the sln.
-
-2010-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/TextEditor.cs:
- * MonoDevelop.Ide.Commands/EditCommands.cs:
- * MonoDevelop.Ide.Tasks/CommentTasksView.cs:
- * MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs:
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Implemented a new method for getting comment tags. It is
- going to replace some properties of ILanguageBinding.
-
-2010-02-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Fix path bar
- detaching.
-
-2010-02-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: MD now creates a new
- layout by default: 'Solution'. This layout is enabled when a
- solution is opened. The old 'Default' layout is shown when
- MD is started, and has all pads minimized.
-
- * MonoDevelop.Ide.Gui/Pad.cs:
- * MonoDevelop.Ide.Gui/IPadContainer.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Added AutoHide
- property to Pad.
-
-2010-02-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Don't share text editor
- extension instance between editors or things end up in the
- wrong editor.
-
-2010-02-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Extensions/TextEditorExtensionNode.cs: Allow
- specifyings the file extensions to which a
- TextEditorExtension applies in the add-in manifest. In this
- way we can delay the loading of such extensions.
-
-2010-02-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: More tracing.
-
- * MonoDevelop.Ide.Gui/Ide.cs: Don't put help service init in a
- timeout, it stops MD from being closed before timeout runs.
-
-2010-02-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs: Delay help service
- initialization.
-
-2010-02-09 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs:
- * MonoDevelop.Ide.Gui/StartupInfo.cs: Allow users to specify
- file line and column at launch.
-
-2010-02-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Add startup trace calls.
-
-2010-02-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs:
- * MonoDevelop.Ide.Gui.Dialogs/SplashScreen.cs:
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/IncludeNewFilesDialog.cs:
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/OverridesImplementsDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/ConfirmProjectDeleteDialog.cs:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanelWidget.cs:
- Track API changes for lazy loading images.
-
-2010-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs: Add startup trace calls.
-
-2010-02-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Commands/FileCommands.cs:
- * MonoDevelop.Ide.Gui.Content/IPrintable.cs: Implement a Page
- Setup command.
-
-2010-02-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Commands/FileCommands.cs:
- * MonoDevelop.Ide.Gui.Content/IPrintable.cs: Add CanPrint
- method to IPrintable.
-
-2010-02-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/TextEditor.cs:
- * MonoDevelop.Ide.Gui.Content/IEditableTextBuffer.cs:
- * MonoDevelop.Ide.Gui/HiddenTextEditorViewContent.cs: Added
- method to check whether text editor has input focus.
-
- * MonoDevelop.Ide.Commands/EditCommands.cs: Only enable
- "Insert standard header" command when text editor has input
- focus.
-
- * MonoDevelop.Ide.addin.xml: Improve ordering of edit menu.
-
-2010-02-05 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs: Don't
- show Close Workspace checkbox on save.
-
-2010-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Execution/ExecutionModeCommandService.cs:
- Make sure the Run With menu is hidden when there are no
- handlers that can run a project. Fixes bug #575657 - Crash
- is custom execution modes.
-
-2010-01-28 Scott Willeke <scott@willeke.com>
- * MonoDevelop.Ide.Commands/FileCommands.cs
- Catching exception to prevent lock on load due to no permission
- to recently used file.
-
-
-2010-01-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/ISolutionItemFeature.cs:
- * MonoDevelop.Ide.Gui.Dialogs/CombineEntryFeatureSelector.cs:
- Add different levels of support for project features.
-
-2010-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/DisplayBinding.cs:
- * MonoDevelop.Ide.Codons/IDisplayBinding.cs:
- * MonoDevelop.Ide.Gui/DisplayBindingService.cs:
- * MonoDevelop.Ide.Gui/DefaultDisplayBinding.cs: Added a
- mechanism for display bindings to be marked as 'non-default-
- so they can only be opened explicitly, not automatically.
-
-2010-01-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/HelpOperations.cs: Use the HelpService's
- cache root dir for launched MonoDoc instances. Moved
- GetHelpUrl to the HelpService.
-
- * MonoDevelop.Ide.Gui/Ide.cs: Track HelpService API.
-
-2010-01-22 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.FindInFiles/FilterOptions.cs: fixed bug in
- whole words only search.
-
-2010-01-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Add missing files.
-
-2010-01-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.Extensions:
- * MonoDevelop.Ide.Gui.Dialogs\AddFileDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs\OpenFileDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs\FileSelectorDialog.cs:
- * MonoDevelop.Ide.Extensions\IAddFileDialogHandler.cs:
- * MonoDevelop.Ide.Extensions\IOpenFileDialogHandler.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad\FolderNodeBuilder.cs:
- Add support for platform-specific dialogs for adding files
- and for opening files.
-
-2010-01-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs:
- Fix typo in UI string.
-
-2010-01-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/HelpOperations.cs: Remove debug code.
-
-2010-01-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/HelpOperations.cs: On Mac, use open -a
- MonoDoc.app $URL to open MonoDoc urls.
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj: Ref System.Web for UrlEncode method.
-
-2010-01-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs:
- * MonoDevelop.Ide.Gui/IdePreferences.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs:
- Allow setting a custom gtk theme for MD.
-
-2010-01-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide.Gui/IdePreferences.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs:
- Add option for selecting the language for the user
- interface.
-
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.Ide.DocumentSwitcher.cs:
- * gtk-gui/MonoDevelop.Ide.SelectEncodingsDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.GoToDialog.cs:
- * gtk-gui/MonoDevelop.Ide.OverridesImplementsDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * gtk-gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ExportProjectDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.IncludeNewFilesDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.FeatureSelectorDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TasksPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AddInsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.LoadSavePanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Components.ExecutionModeComboBox.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CustomExecutionModeDialog.cs:
- * gtk-gui/MonoDevelop.Ide.ExternalTools.ExternalToolPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CustomExecutionModeWidget.cs:
- * gtk-gui/MonoDevelop.Ide.CodeTemplates.CodeTemplatePanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ConfirmProjectDeleteDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CombineEntryFeatureSelector.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.MonoRuntimePanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildMessagePanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.MonoExecutionParametersWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.MonoExecutionParametersPreview.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AssemblyFoldersPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TextStylePolicyPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CustomExecutionModeManagerDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AuthorInformationPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.CodeFormattingPolicyPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.StandardHeader.StandardHeaderPolicyPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.MaintenanceOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.GlobalAuthorInformationPanelWidget.cs:
- Flush.
-
-2010-01-19 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * MonoDevelop.Ide.FindInFiles/Scope.cs:
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs:
- * gtk-gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs:
- * gtk-gui/MonoDevelop.Ide.FindInFiles.SearchResultWidget.cs:
- Implemented 'Bug 552017 - Saner and new default options for
- Find in Files -> Directories dialog'.
-
-2010-01-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Added null check for policies.
-
-2010-01-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.CodeFormatting/InvariantTextStylePolicy.xml:
- Define invariant text style policy.
-
-2010-01-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Track api changes.
-
-2010-01-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingCommands.cs:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanelWidget.cs:
- Track api changes in the text service.
-
- * templates/Workspace.xpt.xml:
- * templates/BlankCombine.xpt.xml:
- * templates/GenericProject.xpt.xml: Updated categories.
-
- * MonoDevelop.Ide.addin.xml: Use new visual style icon.
-
-2010-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs:
- Only strip blank lines from C#, not all languages.
-
-2010-01-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs:
- strip blank lines in CodeDOM output.
-
-2010-01-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs:
- Improve error message. Fixes bug #570188 - Incorrect
- description of options in delete dialog.
-
-2010-01-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs: Added
- left/right as collapse/expand keys.
-
-2010-01-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: fixed 'Bug
- 569665 - Moving entire lines of code with Alt + Up/Down
- causes the editor to behave erratically.'.
-
-2010-01-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs:
- fixed 'Bug 569548 - [Windows] New files are marked as
- autogenerated'.
-
-2010-01-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Commit fix for
- "Bug 569588 - Pressing 'escape' in the Delete Project dialog
- removes the project" from Chris Wright <dhasenan@gmail.com>.
-
-2010-01-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Tasks/CommentTasksView.cs: Fix memory leak
- where the comments task list could hold onto references to
- projects after they were closed. Also handle loading all
- comment tasks for the open workspaces if the view is first
- shown after loading.
-
-2010-01-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs:
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Templates now take care of line ending conventions.
-
-2010-01-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextStylePolicy.cs: Added helper
- method to convert eol markers to a string.
-
-2010-01-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Tasks/CommentTasksView.cs: Clean up the
- display of comment tags.
-
-2010-01-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: New path bar
- widget has reached feature parity wth the old version, so
- enable it.
-
-2010-01-04 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateCodon.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs:
- implemented 'Bug 562124 - Add ability to create custom built
- templates for AddIn'.
-
-2010-01-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: fixed
- 'Bug 561609 - Unhandled exception searching in my project'.
-
-2010-01-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/DragNotebook.cs: Don't shrink the tab
- border with the windows theme, because it looks ugly.
-
-2009-12-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide.Gui/IdePreferences.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs:
- Allow changing output pad fonts. Added new properties for
- setting custom fonts.
-
-2009-12-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Ide.SelectEncodingsDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * gtk-gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs:
- Updated.
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: Improved
- GUI.
-
-2009-12-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/PadTreeView.cs: Enable
- AutoTooltips on all PadTreeViews.
-
-2009-12-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide.Gui/IdePreferences.cs: When setting the
- current runtime as default, don't store the actual runtime
- id, but a marker saying that we want the current. In this
- way we'll stay current even if the current Mono version is
- upgraded. Handle upgrade from MD 2.2-, which didn't have
- this behavior.
-
-2009-12-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.Gui/DocumentSwitcher.cs:
- * gtk-gui/MonoDevelop.Ide.DocumentSwitcher.cs: Make widget
- internal. Add a note re. getting keybindings from commands.
-
-2009-12-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Fix the HasToplevelFocus
- behaviour with floating pads.
-
-2009-12-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Commands/WindowCommands.cs: Make the
- document switcher into a pair of commands, instead of
- hardcoding it into the main view, so it can be triggered
- from floating pads.
-
-2009-12-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Added new property,
- HasToplevelFocus, which return true if the main window or
- any floating pads have toplevel focus.
-
-2009-12-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: When calling
- SelectWindow, make sure to grab focus, because it may have
- lost focus to a pad.
-
-2009-12-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/DocumentSwitcher.cs: When destroying the
- document switcher, don't present the IDE main window.
- Instead Gdk.Window.Focus on the toplevel of the selected
- item. Fixes selecting floating pads, and avoids Mac issues
- with Gtk.Window.Present.
-
-2009-12-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs: Use
- proper enums for IndentStyle values instead of letting them
- get cached as strings, so they don't break the editor's
- property change handler.
-
-2009-12-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: Fix
- trailing comma when list has odd number of items.
-
-2009-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: Add Jakub
- Steiner.
-
-2009-12-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Use some of the new icons.
-
-2009-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * icons/SplashScreen.png:
- * MonoDevelop.Ide.Gui.Dialogs/SplashScreen.cs: Update splash.
-
-2009-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * icons/tools-external-tools-24.png:
- * icons/tools-external-tools-16.png: Add new icons.
-
-2009-12-11 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Fix jump-to
- regression.
-
-2009-12-10 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Allow resorting by
- severity.
-
-2009-12-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * templates/EmptyHTMLFile.xft.xml: Sane casing on HTML tags.
-
-2009-12-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Use Workbench.Present so
- that we can special-case for different platforms. Ignore
- Present on Mac since GTK+ is broken there.
-
- * MonoDevelop.Ide.Gui/Ide.cs: Use Workbench.Present so that we
- can special-case for different platforms.
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Use Workbench.Present so
- that we can special-case for different platforms. Also
- better logging of crashes.
-
- * MonoDevelop.Ide.Gui/DocumentSwitcher.cs: Ignore Present on
- Mac since GTK+ is broken there.
-
-2009-12-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Execution/ExecutionModeCommandService.cs:
- Avoid appending '...' to commands that already end with
- '...'.
-
-2009-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/IncludeNewFilesDialog.cs: Add
- missing null check. Fixes bug #560768.
-
-2009-12-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Add some sanity checks for
- DesktopApplication.
-
-2009-12-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: The error pad auto
- show/hide is more intelligent now.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs:
- * MonoDevelop.Ide.Gui/AddinUpdateHandler.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPadWidget.cs:
- Name threads to make debugging easier.
-
-2009-12-02 David Makovský <yakeen@sannyas-on.net>
-
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs:
- updating generated file
-
- * gtk-gui/gui.stetic: make button "View Conflicts"
- translatable
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Fix NRE.
-
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Don't
- create a syntax style every time we render a row. Instead,
- save one, and make sure it's updated when the GTK style
- chnages. Fixes leak and perf issues.
-
-2009-12-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs: Use the new
- automatic overflow tooltips.
-
-2009-12-01 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.Gui/HiddenWorkbenchWindow.cs:
- * MonoDevelop.Ide.Gui/HiddenTextEditorViewContent.cs: Added
- hidden text editor view content infrastructure, to support
- fast non gui implementation of these interfaces for testing
- & 'code behind').
-
-2009-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/IdePreferences.cs: By default, don't
- show output pad when after building.
-
-2009-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Commands/ProjectCommands.cs:
- * MonoDevelop.Ide.Gui/ConfigurationComboBox.cs:
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs:
- Introduced the ConfigurationSelector class to all methods
- that previously took a configuration name as string. This
- eliminates the ambiguity between solution configuration
- names and project configuration names.
-
-2009-11-25 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.Gui.OptionPanels/BuildMessagePanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildMessagePanelWidget.cs:
- Worked on build message panel.
-
-2009-11-25 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Tasks/TaskStore.cs:
- * MonoDevelop.Ide.Gui/IdePreferences.cs:
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs:
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * gtk-gui/MonoDevelop.Ide.DocumentSwitcher.cs:
- * MonoDevelop.Ide.Gui/OutputProgressMonitor.cs:
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs:
- * gtk-gui/MonoDevelop.Ide.SelectEncodingsDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.GoToDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs:
- * gtk-gui/MonoDevelop.Ide.OverridesImplementsDialog.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/BuildMessagePanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs:
- * gtk-gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * gtk-gui/MonoDevelop.Ide.FindInFiles.SearchResultWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ExportProjectDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.FeatureSelectorDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.IncludeNewFilesDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TasksPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AddInsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Components.ExecutionModeComboBox.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.LoadSavePanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.ExternalTools.ExternalToolPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CustomExecutionModeWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CustomExecutionModeDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeTemplates.CodeTemplatePanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ConfirmProjectDeleteDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CombineEntryFeatureSelector.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.MonoRuntimePanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildMessagePanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.MonoExecutionParametersWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.MonoExecutionParametersPreview.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AssemblyFoldersPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TextStylePolicyPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CustomExecutionModeManagerDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AuthorInformationPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.MaintenanceOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.CodeFormattingPolicyPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.StandardHeader.StandardHeaderPolicyPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.GlobalAuthorInformationPanelWidget.cs:
- Added build message panel, some build options & overworked
- error list pad a bit.
-
-2009-11-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs: Improve
- logging.
-
-2009-11-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Tasks/TaskStore.cs: Fixed memory hole in
- task service.
-
-2009-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.csproj: Fix references.
-
-2009-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Fix build.
-
-2009-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Use correct Mono.Cairo reference.
-
-2009-11-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/IBookmarkBuffer.cs: Separated
- bookmarks from text buffer.
-
-2009-11-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs: Fixed 'Bug 555997
- - "Go to Type" list is empty'.
-
-2009-11-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Catch, log and display
- AppDomain.UnhandledException. Remove relection code that's
- unneeded now that we depend on recent GTK+. Set process name
- and pass args to GTK.
-
-2009-11-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs: Don't include
- folders in the file list.
-
-2009-11-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Added new overload for creating content, which provides the
- project and tags as arguments. Allow namespaces with empty
- name.
-
- * MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs:
- * MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs:
- After generating the compilation unit, strip the implicit
- namspace from al CodeNamespaces. Required for VB.
-
-2009-11-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/MonoRuntimePanel.cs:
- Properly remove runtimes.
-
-2009-11-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: (Revert revision
- 145499)
-
-2009-11-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components\TransactedTreeBuilder.cs:
- Report an error when a node can't be committed because of an
- invalid node.
-
-2009-11-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs: Fixed 'Bug
- 552014 - Find in files dialog (with Directories option)
- makes MD unresponsive for a long time'.
-
-2009-11-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Disable the
- resize grip on Mac, because it breaks Mac window resizing.
-
-2009-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Use the ReloadRequired
- event to track changes in solutions.
-
- * MonoDevelop.Ide.Gui/Ide.cs: Improve error message.
-
-2009-11-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- fixed 'Bug 552331 - Parameter insight does not hide when
- ending method call.'.
-
-2009-11-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Move code templates panel under
- Text Editor section.
-
-2009-11-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/Scope.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Worked on
- 'Bug 552017 - Saner and new default options for Find in
- Files -> Directories dialog'.
-
-2009-11-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Added
- some error handling code for 'Bug 552014 - Find in files
- dialog (with Directories option) makes MD unresponsive for a
- long time'.
-
-2009-11-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Execution/ParameterizedExecutionHandler.cs:
- Provide a dummy execution mode when executing a
- parameterized handler directly.
-
-2009-11-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: When activating a
- pad using a keyboard shortcut, set the focus to it. Fixes
- bug #544135.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * BuildVariables.cs:
- * MonoDevelop.Ide.addin.xml: Bump MD version.
-
-2009-10-30 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/CustomExecutionModeDialog.cs:
- add existing editor to dictionary instead of creating a new one.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Execution/IExecutionCommandCustomizer.cs:
- * MonoDevelop.Ide.Execution/ParameterizedExecutionHandler.cs:
- * MonoDevelop.Ide.Execution/IExecutionConfigurationEditor.cs:
- Add some docs.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj: Reference the mono-cairo package.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: New overload for
- OpenDocument.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs:
- Show an error message when displaying an unknown project.
-
-2009-10-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml:
- Name the caught exception in try template.
-
-2009-10-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml: Fix
- duplicate try shortcut.
-
-2009-10-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.Ide.DocumentSwitcher.cs:
- * gtk-gui/MonoDevelop.Ide.SelectEncodingsDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.GoToDialog.cs:
- * gtk-gui/MonoDevelop.Ide.OverridesImplementsDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs:
- * gtk-gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * gtk-gui/MonoDevelop.Ide.FindInFiles.SearchResultWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ExportProjectDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.FeatureSelectorDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.IncludeNewFilesDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TasksPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AddInsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Components.ExecutionModeComboBox.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.LoadSavePanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CustomExecutionModeDialog.cs:
- * gtk-gui/MonoDevelop.Ide.ExternalTools.ExternalToolPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.CodeTemplates.CodeTemplatePanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CustomExecutionModeWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ConfirmProjectDeleteDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.MonoRuntimePanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CombineEntryFeatureSelector.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.MonoExecutionParametersWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.MonoExecutionParametersPreview.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AssemblyFoldersPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TextStylePolicyPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CustomExecutionModeManagerDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AuthorInformationPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.CodeFormattingPolicyPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.StandardHeader.StandardHeaderPolicyPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.MaintenanceOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.GlobalAuthorInformationPanelWidget.cs:
- Flush.
-
-2009-10-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Improve Copy
- command. Fixes bug #548942.
-
-2009-10-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/ProjectDescriptor.cs: Revert
- r138616. It doesn't seem to be necessary any more, as after
- removing it, I couldn't reproduce the bug it purported to
- fix. Also, it broke Moonlight projects' default references
- when the Moonlight desktop assemblies' package was
- installed.
-
-2009-10-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Added new overload for
- opendocument.
-
-2009-10-22 Luciano N. Callero <lnc19@hotmail.com>
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs: Fixed NullReferenceException
- when Context Key pressed without node selected.
-
-2009-10-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Added option to turn off parameter insight.
-
-2009-10-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/TransactedTreeBuilder.cs: Fix
- build.
-
-2009-10-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/TransactedTreeBuilder.cs:
- Improve handling of deleted nodes. Avoid deleting a children
- if a parent node has already been deleted.
-
-2009-10-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/TreeBuilder.cs:
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs: Moved
- RemoveChildren method to the tree view, to make it reusable.
-
- * MonoDevelop.Ide.Gui.Components/TransactedTreeBuilder.cs:
- When deleting a node, unregister and remove all its children
- too.
-
-2009-10-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Moved Format Document command to
- the Edit category.
-
-2009-10-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs: Fix
- build.
-
-2009-10-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs:
- Improve conflict detection. Fixes bug #547993 - composite
- keybinding hide more simple keybindings.
-
-2009-10-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/IdePreferences.cs: Make
- ShowOutputPadWhenBuildStarts false by default.
-
-2009-10-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Filter out keystrokes that contain alt/meta/super as well as
- control.
-
-2009-10-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/SplashScreen.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/LinkedFilesFolderNodeBuilder.cs:
- Handled icon loading error.
-
-2009-10-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Commands/ProjectCommands.cs: Add a menu
- command for setting the active configuration and runtime.
-
-2009-10-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs: Fix
- changing keybindings with the filtered model.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Don't highlight caret
- line on first open.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui.Content/IEditableTextBuffer.cs: Added
- caret line highlighting when position is set.
-
-2009-10-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Added DocumentEventArgs.
-
-2009-10-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs:
- Implement a filter entry for the keybindings panel.
-
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs:
- Flush.
-
-2009-10-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Commands/ProjectCommands.cs: Implemented Run
- Entry With command.
-
- * MonoDevelop.Ide.Execution/CustomExecutionMode.cs:
- * MonoDevelop.Ide.Execution/CommandExecutionContext.cs:
- * MonoDevelop.Ide.Execution/ExecutionModeCommandService.cs:
- Generalized a bit. Custom modes can now be stored for any
- SolutionEntityItem.
-
- * MonoDevelop.Ide.csproj: Fix typo in file name.
-
-2009-10-13 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.FindInFiles/HslColor.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Moved hsl
- color & brightness into the text edior. (removed brightness
- * 1e-3, it correctly ranges now 0.0-1.0);
-
-2009-10-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs: Escape
- markup to fix GTK errors and list misrendering.
-
-2009-10-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingCommands.cs:
- fixed 'Bug 545883 - Editor problem when using "Format
- document"'.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml:
- Fixed 'Bug 545652 - Surround with 'lock' is not setting
- focus in 'lock' itself to add the lock object'.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateCompletionData.cs:
- Added icon for code surround with templates.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Commands/TextEditorCommands.cs:
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Merged insert templates/surround with commands.
-
-2009-10-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/FileCommands.cs: In OpenFile, get
- the encoding from the dialog before destroying it.
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Fix warning.
-
-2009-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultPad.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Select
- first search result, if pad is auto focused.
-
-2009-10-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs: Only
- changed templates are saved by the panel.
-
-2009-10-08 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.csproj: Add options/* as "Data" items,
- and add a "AfterBuild" target to copy them to build\data.
- This matches the makefile behavior.
-
-2009-10-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: Add a tab
- with the contents of the buildinfo file, if it exists. Fixed
- some accents on names.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Fixed monodevelop
- --version.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Ide.addin.xml: Update license.
-
-2009-10-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPadWidget.cs:
- fixed 'Bug 541730 - Classbrowser gives crash'.
-
-2009-10-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingCommands.cs:
- Fixed 'Bug 544395 - Format document operation should be an
- atomic undo'.
-
-2009-10-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Track API
- changes.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: Updated
- authors list.
-
- * MonoDevelop.Ide.Gui.Dialogs/AboutMonoDevelopTabPage.cs:
- Updated license. MD is now LGPL.
-
-2009-10-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs: Took
- out dispose overwrite.
-
-2009-10-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs:
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs: Fixed
- some leaks.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * BuildVariables.cs:
- * MonoDevelop.Ide.addin.xml: Bump MD version.
-
-2009-10-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/AbstractBaseViewContent.cs: Call Destroy
- (), Dispose () is broken for gtk widgets.
-
-2009-10-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ReferenceNodeBuilder.cs:
- Track API changes.
-
-2009-10-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: When adding
- a project to an existing solution, try to guess the best
- platform for the new project, based on the existing
- configurations.
-
-2009-10-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: Fix logic
- for filtering out workspace templates. Fixes bug #543941 -
- Can't create a new workspace.
-
-2009-10-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs: Explicitly initialize the dom
- service.
-
-2009-10-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs: Include
- the "save current file" checkbox in the controls that are
- made insensitive when the is no selected tool. Fix some GTK
- warnings.
-
-2009-10-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Ensure that the
- child is removed in the event box, before set & dispose
- gtk.images.
-
-2009-10-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Handled an
- exception that could happen, when the code completion
- database is corrupted.
-
-2009-10-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs: added focuspad
- option for new search monitors.
-
-2009-10-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs: Added grabFocus
- option to GetSearchProgressMonitor.
-
-2009-10-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: Added
- andrea to the about dialog.
-
-2009-10-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs: Fix
- infinite recursion that hung MD on ctrl-space in
- XML/HTML/ASP.NET files.
-
-2009-10-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Added some strings
- to the translation database.
-
-2009-10-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: fixed typo
-
-2009-10-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Fixed tooltip.
-
-2009-10-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: No longer set
- status texts if they're not updated (=> fewer expose
- events).
-
-2009-10-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs:
- Save the solution after changing the startup project. Fixes
- bug #542054 - MonoDevelop does not remember 'startup
- project'.
-
-2009-10-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs:
- Ask for permission before closing or removing a project.
- Used for example to close a running project before closing.
-
-2009-10-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Added a small
- padding for the event box.
-
-2009-10-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Added clear
- caret state method to status bar.
-
-2009-10-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Event box has
- now a fixed position - no more reordering. Fixed status bar
- memory leak.
-
-2009-10-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Removed the
- shadow from the status bar.
-
-2009-09-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Worked on
- status bar.
-
-2009-09-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Using a real
- status bar widget for displaying the status bar instead of a
- hbox.
-
-2009-09-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: fixed "Bug
- 542686 - Mark-up text not correctly rendered on status bar".
-
-2009-09-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Added 'Run With' commands to
- project context menu.
-
-2009-09-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs: Use markup in the statusbar only
- when really necessary.
-
-2009-09-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs: Fixed 'Bug 542686 - Mark-up text
- not correctly rendered on status bar'.
-
-2009-09-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanelWidget.cs:
- Use the new DotNetAssemblyProject class instead of
- DotNetProject, which is now abstract.
-
-2009-09-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/IWorkbenchLayout.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Fixed some
- settitle bugs.
-
-2009-09-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs:
- Eliminate the property grid's System.Windows.Forms
- dependency, because it hurts Mac cold startup time.
-
-2009-09-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs: Disable
- edit/remove buttons when there is not a selected template.
- Fixes some NREs.
-
-2009-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide/Services.cs: Added some counters.
-
-2009-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui\Workbench.cs: Add null check.
-
-2009-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Removed all
- sorting code. Errors will now be shown in the order that the
- compiler generated them. Fixes bug #540465 - MonoDevelop's
- error list gratuitously sorts messages, it should not.
-
-2009-09-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/Scope.cs:
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs: Fixed 'Bug
- 540891 - NRE when launching Find In Files search (whole
- solution)'.
-
-2009-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/HelpOperations.cs:
- * MonoDevelop.Ide.Commands/HelpCommands.cs: Don't try to show
- help using Monodoc. It is not supported on Windows.
-
-2009-09-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Renamed
- IDomVisitable -> INode
-
-2009-09-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Add Mac shortcuts for cycling
- between tabs.
-
-2009-09-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/AuthorInformationPanel.cs:
- Fix error removing author info when there is no info.
-
-2009-09-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs: Fixed
- possible null reference.
-
-2009-09-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs: Fixed
- generics in component types.
-
- * MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml:
- Made foreach template more intelligent.
-
-2009-09-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj: Add ref to SWF for propgrid enum.
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs: Fix GTK
- warning.
-
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateListDataProvider.cs:
- Track API.
-
- * MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs: Use the
- PropertyGrid for displaying variables, as this allows them
- to be edited.
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateVariable.cs: Mark
- up with attributes for the propgrid. Use a custom class for
- the value pairs so we can name the values and mark it up
- too.
-
-2009-09-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs: Make file
- template loading failures also not fatal, and improve error
- message.
-
-2009-09-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/ProjectTemplate.cs: Downgrade
- "fatal" error when loading templates to a normal error. Add
- more information to the error string.
-
-2009-09-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- No longer trying to turn on code completion on action keys
- (like cursor keys) - should speed things up on slower
- machines.
-
-2009-09-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml:
- Fixed eventargs template.
-
-2009-09-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Don't close the
- workspace if the users click on Cancel when asked to save a
- file. Fixes bug #538371 - Canceling the closing of a
- solution with unsaved files open does not work.
-
-2009-09-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateCompletionData.cs:
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Track API changes.
-
-2009-09-11 Christian Hergert <chris@dronelabs.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs: Fix exception
- when selecting "Add to project" on new file dialog and there
- is no project type selected.
-
-2009-09-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Added DocumentParsed event.
-
-2009-09-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs: Worked on
- template formatting.
-
-2009-09-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Execution/MonoExecutionParameters.cs: Added
- some localized descriptons for some property values.
-
-2009-09-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Execution/MonoExecutionParameters.cs: Using
- localizable attributes for mono execution parameters.
-
-2009-09-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/CustomExecutionModeDialog.cs:
- Added missing getstring call.
-
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs:
- Fixed translation.
-
-2009-09-09 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.Gui.Dialogs/EncapsulateFieldDialog.cs: Fixed
- dialog title.
-
-2009-09-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Added missing "..." to menu
- items.
-
-2009-09-08 Christian Hergert <chris@dronelabs.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs:
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/MonoRuntimePanel.cs:
- * MonoDevelop.Ide.Commands/ViewCommands.cs:
- * MonoDevelop.Ide.Commands/FileCommands.cs:
- * MonoDevelop.Ide.Commands/ToolsCommands.cs:
- * MonoDevelop.Ide.Commands/HelpCommands.cs:
- * MonoDevelop.Ide.Execution/ExecutionModeCommandService.cs:
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs:
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/RootWorkspace.cs:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Gui/StatusProgressMonitor.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Fix dialogs to be transient
- to the root window or parent dialog.
-
-2009-09-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs: Removed
- debug message.
-
-2009-09-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Fixed "Bug 537195 - Can't select a 'Surround With' template
- by typing the name".
-
-2009-09-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Fixed "Bug 537192 - Surround With command not properly
- indenting text".
-
-2009-09-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs: Add support for
- multi-selection. Patch by Zach Lute.
-
-2009-09-02 Christian Hergert <chris@dronelabs.com>
-
- * MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml: Add
- python templates.
-
-2009-09-02 Christian Hergert <chris@dronelabs.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateVariable.cs: Add
- IsIdentifier that descrives if the variable has restricted
- input.
-
- * MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml:
- IsIdentifier defaults to false as suggested. Update
- templates that require Identifier semantics.
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs: Propagate
- whether the link is an Identifier meaning it has restricted
- input.
-
-2009-09-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultPad.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Fixed
- "Bug 536011 - Show Next/Previous not working for the search
- results pad".
-
-2009-09-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Pad.cs: Always call activate on
- padwindow.
-
-2009-09-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Pad.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/IPadContainer.cs:
- * MonoDevelop.Ide.Gui/DocumentSwitcher.cs:
- * MonoDevelop.Ide.Gui/IWorkbenchLayout.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Commands/ViewCommands.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs:
- Fixed "Bug 489819 - Building the project removes focus from
- the texteditor".
-
-2009-09-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs: Now using
- (the more correct) shorten type name method from compilation
- unit.
-
-2009-08-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * BuildVariables.cs:
- * icons/SplashScreen.png:
- * MonoDevelop.Ide.Gui.Dialogs/SplashScreen.cs: Updated splash
- window.
-
-2009-08-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Revert lazy
- loading of pads, since it is causing issues. It has to be
- fixed in DockItem.
-
-2009-08-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Added notify
- shown.
-
-2009-08-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Fixed typo
-
-2009-08-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Adding infinite
- loop fix.
-
-2009-08-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/ViewCommands.cs: Fixed output
- strings.
-
-2009-08-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/ViewCommands.cs: Fixed output
- string.
-
-2009-08-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Commands/ProjectCommands.cs: Fixed "Bug
- 501684 - Newly created build configurations cannot be
- activated".
-
-2009-08-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Created identifier for full name.
-
-2009-08-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Only call Show
- instead of ShowAll for lazy pad creation.
-
-2009-08-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs:
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Fixed 'Bug 502880 - Cannot create file with hypen in the
- name'.
-
-2009-08-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Fixed "Bug 479196 - "add test fixture" adds refs to
- nunit.core and nunit.framework from "Package".
-
-2009-08-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/ViewCommands.cs: Pad titles may
- have markup.
-
-2009-08-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Don't allow running MD
- with the QtCurve theme. It is known to make MD crash.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/TreeBuilder.cs:
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs:
- Speeded up the AddChildren function.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/TreeBuilder.cs:
- * MonoDevelop.Ide.Gui.Components/ITreeBuilder.cs:
- * MonoDevelop.Ide.Gui.Components/TransactedTreeBuilder.cs:
- Fixed typo.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/TreeBuilder.cs:
- * MonoDevelop.Ide.Gui.Components/ITreeBuilder.cs:
- * MonoDevelop.Ide.Gui.Components/TransactedTreeBuilder.cs:
- Added AddChilds method to tree builder.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs:
- * MonoDevelop.Ide.Tasks/UserTasksView.cs:
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs:
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs:
- * MonoDevelop.Ide.Gui.Pads/InternalLogPad.cs:
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs:
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Fixed
- warnings.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Codons/PadCodon.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Optimized startup
- speed a bit.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Codons/PadCodon.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: No need to lazy
- initalize pre created pads.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Pads are now
- created on demand.
-
-2009-08-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs:
- * MonoDevelop.Ide.Templates/ProjectTemplate.cs:
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: Only
- request the composed icon in the desired size. See (Bug
- 534499 - ImageService tries to compose icons at too many
- sizes).
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Update gtk# dependency.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.csproj: Updated dependencies. We now depend
- on gtk# 2.12.8, Mono 2.4, and Mono.Addins 0.4.
-
-2009-08-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/FindReplace.cs: The search
- algorithm can now be used from outside.
-
-2009-08-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Optimized
- the search result widget.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Fix windows
- build.
-
-2009-08-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs: Formatted
- output correctly.
-
-2009-08-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/Scope.cs:
- * MonoDevelop.Ide.FindInFiles/FindReplace.cs:
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Fixed
- "Bug 523423 - Find dialog doesn't show its searching".
-
-2009-08-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Changed the
- remove trailing whitespace algorihtm to use the
- Mono.TextEditor data structures - they're not suffering from
- extensive caret movement.
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Removed unused
- event listener.
-
-2009-08-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Commands/EditCommands.cs:
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Added remove
- trailing whitespace command from David Makovský
- <yakeen@sannyas-on.net> & did some optimizations.
-
-2009-08-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/ToolsCommands.cs: Document.Save can
- only be called from the gui thread.
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Before building,
- don't autosave files which don't belong to a project. Fixes
- bug #498686 - Compiling a solution/project with a file that
- doesn't belong to any project MD ask for write the file.
-
-2009-08-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Track api changes.
-
-2009-08-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Properly reset the
- project of a document when reloading.
-
-2009-08-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/RootWorkspace.cs:
- * MonoDevelop.Ide.Gui.Content/ISupportsProjectReload.cs: Added
- support for re-binding an open file to a project. This is
- used when reloading a project.
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Show a warning
- when trying to save a project whose files have changed since
- the last save.
-
-2009-08-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs: Update project
- association when checkbox is toggled.
-
-2009-08-20 Christian Hergert <chris@dronelabs.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs: Make the add
- files dialog transient for the workbench.
-
-2009-08-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs:
- * MonoDevelop.Ide.Gui.Components/ITreeBuilderContext.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs:
- When a project is disabled in the active configuration, show
- it grayed.
-
-2009-08-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/ProjectTemplate.cs: Fix template
- categorization issue. The main C# category was added as a
- child of C#.
-
-2009-08-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: Fix
- category insertion.
-
-2009-08-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/IWorkbench.cs:
- * MonoDevelop.Ide.Gui/IWorkbenchLayout.cs: Updated license
- header. The original code has been relicensed as LGPL in
- #develop 2.0.
-
-2009-08-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/SolutionDescriptor.cs: Update
- license header. This file has been rewritten.
-
-2009-08-19 Viktoria Dudka <viktoriad@remobjects.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: Rewritten the
- GPL parts.
-
-2009-08-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Added a fix from ki9a - he
- encountered an exception while loading.
-
-2009-08-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/RootWorkspace.cs:
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs:
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs:
- * MonoDevelop.Ide.FindInFiles/FileProvider.cs:
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs:
- * MonoDevelop.Ide.Gui/TextFileNavigationPoint.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultPad.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs:
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/CustomExecutionModeDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/CustomExecutionModeWidget.cs:
- * MonoDevelop.Ide.Gui.Dialogs/ConfirmProjectDeleteDialog.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanelWidget.cs:
- Fix warnings.
-
- * MonoDevelop.Ide.Templates/SolutionDescriptor.cs: Properly
- initialize the startup item.
-
-2009-08-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/ProjectDescriptor.cs: Fix project
- name truncation issue.
-
-2009-08-18 Viktoria Dudka <viktoriad@remobjects.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs: Rewritten the gpl parts.
-
-2009-08-18 Viktoria Dudka <viktoriad@remobjects.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: Rewritten GPL parts.
-
-2009-08-18 Viktoria Dudka <viktoriad@remobjects.com>
-
- * MonoDevelop.Ide.Gui.Pads/FileList.cs: Rewritten the GPL parts.
-
-2009-08-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/AssemblyReferencePanel.cs:
- Updated license header. The file was rewritten long time
- ago.
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Gui.OptionPanels/CodeGenerationPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.CodeGenerationPanelWidget.cs:
- Removed unused pad.
-
-2009-08-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/SelectReferenceDialog.cs:
- Updated license header. The file was rewritten long time
- ago. Minor fix.
-
- * MonoDevelop.Ide.Gui.Dialogs/ProjectReferencePanel.cs:
- Improved performance of cyclic reference check. Improve the
- way cyclic reference messages are shown. Show a message for
- incompatible framework.
-
-2009-08-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/ProjectReferencePanel.cs:
- Updated license header. The file was rewritten long time
- ago.
-
-2009-08-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs: Fixed
- crash in UnregisterNode. Should fix bug #530499 - Crash when
- working with project tree view.
-
-2009-08-07 Viktoria Dudka <viktoriad@remobjects.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/SharpDevelopAboutPanels.cs: removed
- * MonoDevelop.Ide.Gui.Dialogs/AboutMonoDevelopTabPage.cs:
- * MonoDevelop.Ide.Templates/VersionInformationTabPage.cs: Rewritten from scratch
- to make it non-GPL.
-
-2009-08-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/ProjectTemplate.cs: Categorise all
- templates by language. Fixes regression from
- de-gpl-ification.
-
-2009-08-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Gui.OptionPanels/AssemblyFoldersPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AssemblyFoldersPanelWidget.cs:
- Added options panel which allows defining paths where MD
- should look for assemblies and .pc files.
-
-2009-08-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLog:
- * MonoDevelop.Ide.Gui.Dialogs/GacReferencePanel.cs: Rewritten
- the gpl parts.
-
-2009-08-17 Viktoria Dudka <viktoriad@remobjects.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GacReferencePanel.cs: Rewritten the gpl parts.
-
-2009-08-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Tasks/TaskStore.cs: Don't send unnecessary
- task removal events.
-
-2009-08-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Templates/ProjectDescriptor.cs:
- * MonoDevelop.Ide.Gui.Dialogs/GacReferencePanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/SelectReferenceDialog.cs:
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Use the new AssemblyContext class to query and resolve
- assemblies.
-
-2009-08-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.csproj: Set correct encoding.
-
-2009-08-12 Christian Hergert <chris@dronelabs.com>
-
- * MonoDevelop.Ide.Commands/FileCommands.cs: Make sure the open
- file dialog is transient for the main window.
-
-2009-08-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Try some different Mac keyboard
- mappings for build and run commands.
-
-2009-08-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Tasks/TaskService.cs: Add ShowErrors method.
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs:
- Remove unused usings.
-
-2009-08-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.Gui\Ide.cs:
- * MonoDevelop.Ide\Services.cs:
- * MonoDevelop.Ide.Tasks\Task.cs:
- * MonoDevelop.Ide.Gui\Document.cs:
- * MonoDevelop.Ide.Tasks\UserTask.cs:
- * MonoDevelop.Ide.Tasks\TaskStore.cs:
- * MonoDevelop.Ide.Tasks\TaskService.cs:
- * MonoDevelop.Ide.Tasks\UserTasksView.cs:
- * MonoDevelop.Ide.Gui\ProjectOperations.cs:
- * MonoDevelop.Ide.Gui.Pads\ErrorListPad.cs:
- * MonoDevelop.Ide.Tasks\CommentTasksView.cs: Reimplemented the
- task service. It should now be more efficient.
-
-2009-08-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/AbstractPadContent.cs:
- * MonoDevelop.Ide.Gui/AbstractViewContent.cs:
- * MonoDevelop.Ide.Gui/AbstractBaseViewContent.cs: Rewritten.
- Patch by Viktoria Dudka.
-
-
-2009-08-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Original #D code
- in this file was relicensed to LGPL in #D 2.0.
-
-2009-08-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs:
- When renaming a file, save only the project containing the
- file, not the whole workspace.
-
-2009-08-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Updated license.
- Most of the file has been rewritten, and the remaining
- original code is licensed as LGPL in SD2.
-
-2009-08-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.StandardHeader/GPL3LicencePolicy.xml:
- * MonoDevelop.Ide.StandardHeader/GPL2LicencePolicy.xml:
- * MonoDevelop.Ide.StandardHeader/LGPL3LicencePolicy.xml:
- * MonoDevelop.Ide.StandardHeader/LGPL2-1LicencePolicy.xml:
- Added author name to gpl licences. Added LGPL 3. Fixed LGPL
- 2.
-
-2009-08-07 Viktoria Dudka <viktoriad@remobjects.com>
-
- * MonoDevelop.Ide.Gui/IWorkbenchWindow.cs: Rewritten from scratch
- to make it non-GPL.
- * MonoDevelop.Ide.Gui/IPadContent.cs: Rewritten from scratch
- to make it non-GPL.
- * MonoDevelop.Ide.Gui/IBaseViewContent.cs: Rewritten from scratch
- to make it non-GPL.
- * MonoDevelop.Ide.Gui/IViewContent.cs: Rewritten from scratch
- to make it non-GPL.
-
-2009-08-07 Viktoria Dudka <viktoriad@remobjects.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/TipOfTheDay.cs: Rewritten from scratch
- * MonoDevelop.Ide.Gui/TipOfTheDayStartupHandler.cs: Deleted
- * MonoDevelop.Ide.addin.xml: moved auto-start to a different location
-
-2009-08-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide/Services.cs:
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/IdeStartup.cs:
- * MonoDevelop.Ide.Codons/PadCodon.cs:
- * MonoDevelop.Ide.Gui/IdePreferences.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs:
- * MonoDevelop.Ide.Commands/ToolsCommands.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/MaintenanceOptionsPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.MaintenanceOptionsPanelWidget.cs:
- Add support for the instrumentation service. Added a new
- command for showing the viewer. Added an options panel for
- enabling it. Added some counters.
-
- * gtk-gui/MonoDevelop.Ide.FindInFiles.SearchResultWidget.cs:
- Flush.
-
-2009-08-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Execution\ExecutionModeCommandService.cs:
- Improve command label.
-
- * MonoDevelop.Ide.Gui.Components\ExtensibleTreeView.cs: Fix
- TreeIter comparison issues.
-
-2009-08-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Don't
- disconnect the model from the list while searching, so
- matches are shown as they are found.
-
- * MonoDevelop.Ide.FindInFiles/SearchResultPad.cs: Remove
- unused attribute.
-
- * MonoDevelop.Ide.Commands/ProjectCommands.cs: Fix nullref
- when the active document is not buildable.
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Ide.FindInFiles.SearchResultWidget.cs:
- Adjust padding of the message label in the search results
- pad.
-
-2009-08-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs:
- Removed debug messages.
-
-2009-08-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Took back the on
- demand change.
-
-2009-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs:
- When updating the solution node due to the removal of an
- item, use the solution object provided in the args, since
- the ParentSolution property of the item will return null.
- Fixes bug #527406 - Deletion of project fails.
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Don't allow
- public creation of status bars.
-
-2009-08-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Error list pad is
- now created on demand (it locked monodevelop on load
- sometimes).
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Pads are now
- created on demand.
-
-2009-08-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/SplashScreen.cs: Instead of
- looping on Application.EventsPending, use
- DispatchService.RunPendingvents which limits the number of
- iterations.
-
-2009-08-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/ProjectCommands.cs: Rewritten.
- Patch by Viktoria Dudka.
-
-2009-08-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/IWorkbenchWindow.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: When closing a
- document which is not currently active, don't try to select
- the last active document. Just leave the selection to the
- current document.
-
-2009-08-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs: only set
- search in current document when search was == selection and
- no line span is selected.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Tcp channel for
- connecting to external processes is not supported anymore.
-
-2009-07-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml:
- Applied "Bug 526961 - [PATCH] 'prop' template has double
- whitespace" from Paul Lange <palango@gmx.de>.
-
- * MonoDevelop.Ide.FindInFiles/Commands.cs:
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs: Ensured
- that only one find in files dialog is open at a time.
-
-2009-07-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.Gui/IdePreferences.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs:
- Added an option to enable building with xbuild.
-
-2009-07-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/Scope.cs:
- * MonoDevelop.Ide.FindInFiles/FindReplace.cs:
- * MonoDevelop.Ide.FindInFiles/FileProvider.cs:
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs: Applied
- search&replace patch from Daniel Newton
- <djpnewton@gmail.com> with slight modifications.
-
- * ChangeLog:
-
-2009-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs: Worked on
- search&replace dialog. After a discussion in the monodevelop
- mailing list most users said it should stay open after a
- search.
-
-2009-07-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Fix XML tags so that
- search/replace in files commands have descriptions.
-
-2009-07-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/ProjectDescriptor.cs: Reformatted.
- It was using spaces instead of tabs for indenting.
-
-2009-07-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/ProjectDescriptor.cs: If the new
- project can't be written using the current solution format,
- try to change the target framework.
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Use a load progress
- monitor when reloading a project.
-
-2009-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Gui.Dialogs/SelectFileFormatDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs:
- When trying to save a project using a format which is not
- supported by the current settings of the project, show a
- dialog which allows choosing a new format.
-
-2009-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs:
- Properly support moving items between solution folders of
- the same solution (the ItemAddedToSolution is not fired
- anymore in this case).
-
-2009-07-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml:
- Changed exception template to fix a compiler warning.
- (protected member in sealed class)
-
-2009-07-29 Daniel Newton <djpnewton@gmail.com>
-
- * MonoDevelop.Ide.FindInFiles/FileProvider.cs:
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs:
- * MonoDevelop.Ide.FindInFiles/FindReplace.cs:
- * MonoDevelop.Ide.FindInFiles/Scope.cs:
- Added current document and current selection to search
- and replace options.
-
-2009-07-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/AuthorInformationPanel.cs:
- Preferences are now always saved when closing the options
- panel.
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/WorkspaceNodeBuilder.cs:
- When renaming a project or solution, rename the underlying
- file too.
-
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs:
- Flush.
-
-2009-07-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/ProjectDescriptor.cs: When
- creating a project, make sure that the GAC references added
- to the project actually exist. If they don't, use the
- closest installed version. Fixes bug #483981 - [Regression]
- C# Library projects have a bad reference to the System
- library.
-
-2009-07-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.Templates/ProjectTemplate.cs:
- * MonoDevelop.Ide.Templates/CombineDescriptor.cs:
- * MonoDevelop.Ide.Templates/SolutionDescriptor.cs:
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: Rewrite of
- CombineDescriptor, now renamed to SolutionDescriptor. Patch
- by Viktoria Dudka.
-
-2009-07-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/ProjectDescriptor.cs: Rewriten.
- Patch by Viktoria Dudka.
-
-2009-07-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs:
- Properly escape error text, since it may contain markup
- chars.
-
-2009-07-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Dialogs/ConfirmProjectDeleteDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ConfirmProjectDeleteDialog.cs:
- When removing a project from a solution, show an option
- which allows physically deleting the project files.
-
-2009-07-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/Scope.cs: Search in files now
- support more than one file mask seperated by comma or
- semicolon.
-
-2009-07-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Fixed
- "Bug 523941 - Highlighted strings in search results are
- invisible".
-
-2009-07-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/Commands.cs:
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs: Fixed 'Bug
- 523851 - Find in Files dialog should not be modal'.
-
-2009-07-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/AuthorInformationPanel.cs:
- Save preferences after changing author info.
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Set the preferences
- for the root workspace item after loading.
-
-2009-07-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Notify file creations when
- focusing MD.
-
-2009-07-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Keep track of file changes
- when MD loses/gains the focus.
-
-2009-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Execution/MonoExecutionParameters.cs:
- * MonoDevelop.Ide.Execution/MonoExecutionCustomizer.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * MonoDevelop.Ide.Gui.Dialogs/MonoExecutionParametersWidget.cs:
- * MonoDevelop.Ide.Gui.Dialogs/MonoExecutionParametersPreview.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CustomExecutionModeDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.MonoExecutionParametersWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.MonoExecutionParametersPreview.cs:
- Added Mono Options customizer.
-
-2009-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * options/KeyBindingSchemeVisualStudio.xml: Set correct
- shortcuts for folding commands. Fixes bug #522255 - Key
- shortcuts for code folding have inconsistent behaviour under
- "Visual Studio" Key Bindings.
-
-2009-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/CustomStringTagProvider.cs: Return
- the correct path for the ProjectDir and SolutionDir
- variables. Patch by Federico Di Gregorio. Fixes bug #521864
- - Setting External Tools working directory breaks the tool.
-
-2009-07-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Commands/ViewCommands.cs: Implemented "Bug
- 445699 - key binding for focusing text editor from
- controls".
-
-2009-07-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs: Fixed "Bug
- 520269 - Stop button is now useless".
-
-2009-07-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Track API changes.
-
-2009-07-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Fixed dispose of completion texteditor extension.
-
-2009-07-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Fixed "Bug 518548 - Completion is very annoying on lambda
- parameters".
-
-2009-07-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/FindReplace.cs:
- * MonoDevelop.Ide.FindInFiles/FileProvider.cs: Fixed "replace"
- feature.
-
-2009-07-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Commands/ProjectCommands.cs:
- * MonoDevelop.Ide.Execution/CustomExecutionMode.cs:
- * MonoDevelop.Ide.Execution/IExecutionModeEditor.cs:
- * MonoDevelop.Ide.Execution/CustomArgsCustomizer.cs:
- * MonoDevelop.Ide.Execution/CommandExecutionContext.cs:
- * MonoDevelop.Ide.Execution/CustomArgsExecutionMode.cs:
- * MonoDevelop.Ide.Gui.Components/ExecutionModeComboBox.cs:
- * MonoDevelop.Ide.Gui.Dialogs/CustomExecutionModeWidget.cs:
- * MonoDevelop.Ide.Gui.Dialogs/CustomExecutionModeDialog.cs:
- * MonoDevelop.Ide.Execution/ExecutionModeCommandService.cs:
- * MonoDevelop.Ide.Execution/IExecutionCommandCustomizer.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * MonoDevelop.Ide.Execution/IExecutionConfigurationEditor.cs:
- * MonoDevelop.Ide.Execution/ParameterizedExecutionHandler.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Components.ExecutionModeComboBox.cs:
- * MonoDevelop.Ide.Gui.Dialogs/CustomExecutionModeManagerDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CustomExecutionModeWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CustomExecutionModeDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CustomExecutionModeManagerDialog.cs:
- Finished support for custom execution modes.
-
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Use the shared
- default execution handler.
-
-2009-07-02 Viktoria Dudka <viktoriad@remobjects.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs:
- * MonoDevelop.Ide.Templates/ProjectTemplate.cs: Rewritten from scratch
- to make it non-GPL.
-
-2009-07-01 Viktoria Dudka <viktoriad@remobjects.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs: rewritten GPL parts
- rest based on monodevelop-only changes.
-
-2009-07-01 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj: Removed unused references &
- corrected gui.stetic.
-
-2009-07-01 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Refactoring:
- * MonoDevelop.Ide.Refactoring/Rename.cs:
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs:
- * MonoDevelop.Ide.Refactoring/RenameItemDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Refactoring.RenameItemDialog.cs:
- * MonoDevelop.Ide.Refactoring/RefactoringPreviewDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Refactoring.RefactoringPreviewDialog.cs:
- Moved refactoring support to an own assembly.
-
-2009-07-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Execution:
- * MonoDevelop.Ide.Gui/RootWorkspace.cs:
- * MonoDevelop.Ide.Commands/ProjectCommands.cs:
- * MonoDevelop.Ide.Execution/IExecutionModeEditor.cs:
- * MonoDevelop.Ide.Execution/CommandExecutionContext.cs:
- * MonoDevelop.Ide.Execution/CustomArgsExecutionMode.cs:
- * MonoDevelop.Ide.Gui.Dialogs/CustomExecutionModeDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/CustomExecutionModeWidget.cs:
- * MonoDevelop.Ide.Execution/ExecutionModeCommandService.cs:
- * MonoDevelop.Ide.Execution/ParameterizedExecutionHandler.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CustomExecutionModeDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CustomExecutionModeWidget.cs:
- Initial support for parameterized execution modes.
-
-2009-06-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs:
- Allow making a copy of a file in the same directory by
- appending a 'copy' tag to the target file name. Fixes bug
- #442041 - should be able to copy and paste a file within a
- directory.
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: TransferFiles now
- considers that the target path includes the target directory
- or file name. In this way it is possible to make copies of
- files or directories in the same folder.
-
-2009-06-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Refactoring/RefactoringPreviewDialog.cs:
- added file names for the diff.
-
-2009-06-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ClassNodeBuilder.cs: Add
- option for showing public+protected members only.
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPadWidget.cs:
- Removed relief from toolbar buttons.
-
-2009-06-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Commands/FileCommands.cs: Implemented New
- Workspace command. Improved label of the Close Solution
- command. Use improved icons for new project and solution.
- All this fixes bug #401403.
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Fix cast exception.
-
-2009-06-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs:
- * MonoDevelop.Ide.Commands/SearchCommands.cs: If something is
- selected in the editor when invoking the search type
- command, use the text as initial search text.
-
-2009-06-26 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Refactoring:
- * MonoDevelop.Ide.Refactoring/.svn:
- * MonoDevelop.Ide.Refactoring/Rename.cs:
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs:
- * MonoDevelop.Ide.Refactoring/RenameItemDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/RenameItemDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.RenameItemDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Refactoring.RenameItemDialog.cs:
- * MonoDevelop.Ide.Refactoring/RefactoringPreviewDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Refactoring.RefactoringPreviewDialog.cs:
- Worked on refactoring.
-
-2009-06-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:
- Allow dropping files from nautilus/explorer to the project
- pad.
-
-2009-06-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide.Gui/IdePreferences.cs: Get the default
- msbuild file format from a const property.
-
-2009-06-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs: Upgrade to latest msbuild
- version when a new MD version is installed.
-
-2009-06-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/IdePreferences.cs: Changed default
- format to VS2008.
-
-2009-06-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs:
- Use new project reference icons.
-
-2009-06-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/AuthorInformationPanel.cs:
- Use the new api for accessing user properties of a solution.
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Load/Save user
- properties for projects and solutions.
-
-2009-06-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/IdeStartup.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Gui/DocumentSwitcher.cs:
- * MonoDevelop.Ide.Gui.Pads/FileListItem.cs:
- * MonoDevelop.Ide.Commands/FileCommands.cs:
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs:
- * MonoDevelop.Ide.Gui/AddinUpdateHandler.cs:
- * MonoDevelop.Ide.Templates/FileTemplate.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs:
- * MonoDevelop.Ide.FindInFiles/FileProvider.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs:
- * MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs:
- * MonoDevelop.Ide.Gui.Dialogs/IncludeNewFilesDialog.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingCommands.cs:
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs:
- Use the new DesktopService instead of PlatformService.
-
-2009-06-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/WorkbenchMemento.cs: Update header. The
- file is not derived from SD anymore.
-
-2009-06-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ConfigurationComboBox.cs: Use a fixed
- width.
-
-2009-06-22 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.Ide.Gui/DragNotebook.cs:
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs:
- Reduce unnecessary whitespace.
-
-2009-06-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Commands/ProjectCommands.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs:
- Refresh project reference nodes if the status of the
- reference changes. Added command for toggling the 'specific
- version' property.
-
-2009-06-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingCommands.cs:
- Disable the format command for documents which are not
- formattable. Fixes bug #514756.
-
- * MonoDevelop.Ide.addin.xml: Moved Format Buffer command to
- Edit/Format menu.
-
-2009-06-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs: Fixed
- template insertion.
-
-2009-06-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Templates are now formatted using the pretty print engine.
-
-2009-06-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Show a gradient
- background when there are no documents opened.
-
-2009-06-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui\IdeStartup.cs: Restored incorrectly
- removed BeginTask call.
-
-2009-06-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.CodeFormattingPolicyPanelWidget.cs:
- Changed the layout of the formatting panel. We use now an
- VPaned instead of an HPaned. Also adde checkboxes for the
- boolean options.
-
-2009-06-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanelWidget.cs:
- Worked on formatting panel.
-
-2009-06-16 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.CodeFormattingPolicyPanelWidget.cs:
- Worked on code format panel.
-
-2009-06-16 Viktoria Dudka <viktoriad@remobjects.com>
- * MonoDevelop.Ide.Commands\ToolsCommands.cs: Rewritten from scratch to make it non-GPL.
-
-2009-06-16 Viktoria Dudka <viktoriad@remobjects.com>
- * MonoDevelop.Ide.Commands\WindowCommands.cs: Rewritten from scratch to make it non-GPL.
-
-2009-06-18 Viktoria Dudka <viktoriad@remobjects.com>
-
- * MonoDevelop.Ide.Gui/CustomStringTagParser.cs: Rewritten from scratch to make it non-GPL.
-
-2009-06-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Fixed "Bug 513383
- - Going to declaration of extension method of
- System.Drawing.Bitmap crashes MD badly".
-
-2009-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GacReferencePanel.cs: Fix hiding
- of mscorlib assemblies.
-
-2009-06-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Track assembly lookup APIs.
-
-2009-06-01 Carlo Kok <ck@remobjects.com>
-
- * MonoDevelop.Ide.Commands\HelpCommands.cs:
- * MonoDevelop.Ide.Commands\ViewCommands.cs: rewritten from scratch to make it non-GPL.
-
-2009-06-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs\FileSelectorDialog.cs: Fix gtk
- warning.
-
- * MonoDevelop.Ide.Gui\DragNotebook.cs: For some reason
- Pointer.IsGrabbed always returns false on windows.
-
-2009-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Fix location of the formatting
- policies panel in the policies dialog.
-
-2009-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.Gui/ViewContentEventHandler.cs: Removed
- unused file.
-
-2009-06-09 Carlo Kok <ck@remobjects.com>
-
- * MonoDevelop.Ide.Commands\FileCommands.cs: Rewritten from scratch to make it non-GPL.
-
-2009-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingCommands.cs:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanelWidget.cs:
- Add support for per-mimetype policies.
-
-2009-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Track api changes.
-
- * MonoDevelop.Ide.Gui.OptionPanels/TextStylePolicyPanel.cs:
- Use the new dialog for mime-type formatting policies.
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.GoToDialog.cs:
- * gtk-gui/MonoDevelop.Ide.OverridesImplementsDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.OverrideTextSettingsPolicyWidget.cs:
- Removed unused dialog.
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.CodeFormatting/MonoTextStylePolicy.xml:
- * MonoDevelop.Ide.CodeFormatting/VisualStudioTextStylePolicy.xml:
- Register new policies.
-
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanelWidget.cs:
- The default text settings are now provided by its own
- mime-type formatting panel.
-
-2009-06-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Fixed "Bug
- 510773 - NRE when looking for derived classes".
-
-2009-06-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Fixed "Bug 510319
- – Search / Show Previous (Error List) (Shift-F4) is broken".
-
-2009-06-05 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.CodeFormatting/AddPolicyDialog.cs:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingCommands.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.AddPolicyDialog.cs:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanel.cs:
- * gtk-gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs:
- * MonoDevelop.Ide.CodeFormatting/EditFormattingPolicyDialog.cs:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.EditFormattingPolicyDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.CodeFormattingPolicyPanelWidget.cs:
- Worked on C# formatter it should now fit better in the
- policy system.
-
-2009-06-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Fixed "Bug 507065 - Edit / Insert
- Template and Edit / Insert Standard Header have the same
- keyboard shortcut (I)".
-
-2009-06-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui\DefaultWorkbench.cs: Use all available
- sizes for the main window icon.
-
-2009-06-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui\DefaultWorkbench.cs: Use new stock icon.
-
-2009-06-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/TransactedTreeBuilder.cs:
- Don't crash if the icon of the node is not set.
-
-2009-06-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.ExternalTools/ExternalToolService.cs:
- XmlTextWriter.Settings is not initialized by default on
- Windows. Patch by Carlo Kok.
-
-2009-05-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs\FileSelectorDialog.cs: Fix glib
- warning on windows.
-
-2009-05-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui\IdePreferences.cs:
- * MonoDevelop.Ide.Gui\DefaultWorkbench.cs:
- * MonoDevelop.Ide.Gui.OptionPanels\IDEStyleOptionsPanel.cs:
- Factorized access to ToolbarSize preference. Use small
- toolbar by default.
-
- * MonoDevelop.Ide.Gui\RootWorkspace.cs: Fix issue when setting
- the default runtime.
-
- * MonoDevelop.Ide.Gui\IdeStartup.cs: Theme api initialization
- hack is not required anymore. That's now fixed in gtk#.
-
-2009-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs: Don't
- try to remove invalid iters from the nodeOptions hash, since
- invalid iters can't generate a hash.
-
- * MonoDevelop.Ide.Gui/DisplayBindingService.cs: Fix null ref.
-
-2009-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Avoid throwing
- some exceptions using preventive checks. Patch by Carlo Kok.
-
-2009-05-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs: Fixed "Bug
- 504553 - Tyring to insert CW text snippet via double click
- causes an unhandled exception.".
-
-2009-05-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeFormatting/EditFormattingPolicyDialog.cs:
- Fixed 'Bug 501345 - Editing code format profile results in
- uncaught exception'.
-
-2009-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui\MonoDevelopStatusBar.cs: Removed the
- borders of the panel sections.
-
- * MonoDevelop.Ide.Gui\IdeStartup.cs: Removed duplicate
- BeginTask call.
-
-2009-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- * MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs:
- Use a typed dictionary to store tags. Fixes bug #505760.
-
-2009-05-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads\ErrorListPad.cs:
- * MonoDevelop.Ide.Gui.Pads\MonodocTreePad.cs:
- * MonoDevelop.Ide.Gui.Components\TreeNodeNavigator.cs:
- * MonoDevelop.Ide.Gui.OptionPanels\MonoRuntimePanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs\SelectEncodingsDialog.cs:
- * MonoDevelop.Ide.Gui.Components\ExtensibleTreeView.cs:
- * MonoDevelop.Ide.Gui.Components\TransactedTreeBuilder.cs:
- Don't use Gtk.TreeIter.Equals, since it's broken. Compare
- TreePaths instead.
-
- * MonoDevelop.Ide.Tasks\TaskService.cs:
- CommentTaskChangedEventArgs now provides the project of the
- file. Use it instead of looking for it in the ide.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Yet another FilePath comparison fix.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Tasks/TaskService.cs:
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs:
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs:
- * MonoDevelop.Ide.Gui/DocumentNavigationPoint.cs:
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Workaround for what seems to be a mcs bug. Looks like it
- can't properly resolve the implicit conversion of null to
- string.
-
-2009-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Tasks\Task.cs:
- * MonoDevelop.Ide.Gui\Document.cs:
- * MonoDevelop.Ide.Gui\Workbench.cs:
- * MonoDevelop.Ide.Tasks\TaskService.cs:
- * MonoDevelop.Ide.Gui\RootWorkspace.cs:
- * MonoDevelop.Ide.Gui\ProjectOperations.cs:
- * MonoDevelop.Ide.Gui\DocumentNavigationPoint.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad\SystemFile.cs:
- * MonoDevelop.Ide.Gui.Content\TextEditorExtension.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad\ProjectFolder.cs:
- * MonoDevelop.Ide.Templates\SingleFileDescriptionTemplate.cs:
- Use the new FilePath class for handling file and directory
- paths.
-
-2009-05-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/TextEditor.cs:
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs:
- * MonoDevelop.Ide.Gui.Content/IEditableTextBuffer.cs: Fixed
- "Bug 502586 - Edit / Format / Join Lines does not join blank
- lines".
-
-2009-05-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Added null check.
-
-2009-05-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/MonoRuntimePanel.cs: Don't
- allow removing autodetected runtimes.
-
-2009-05-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: More Mac shortcuts.
-
-2009-05-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Set the
- path column as default sort column.
-
-2009-05-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs: Fixed bug
- in find in files dialog.
-
-2009-05-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs: Worked on
- find in files dialog.
-
-2009-05-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs: Worked on
- find in files dialog.
-
-2009-05-05 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * gtk-gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs:
- Worked on find in files dialog.
-
-2009-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Make sure glib threading
- is initialized in win32.
-
-2009-05-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Fixed "Bug 442022
- - CTRL+W should switch between files in same order as they
- were opened".
-
-2009-04-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Commands/TextEditorCommands.cs: Add subword
- commands.
-
-2009-04-30 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * gtk-gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs:
- Worked on find in files dialog.
-
-2009-04-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/DisplayBindingService.cs: Work around
- Mono 2.0 compiler bug.
-
-2009-04-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/HslColor.cs: Fix build with csc.
- See mcs bug 421838 - CS0188 is not triggered by property
- setters.
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/DisplayBindingService.cs: Merged the get
- binding uri/mime type call (otherwise the display binding
- order isn't respected correctly).
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Codons/IDisplayBinding.cs:
- * MonoDevelop.Ide.Gui/DefaultDisplayBinding.cs:
- * MonoDevelop.Ide.Gui/DisplayBindingService.cs:
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Display bindings can now "choose" if they want handle files
- & file names or mime types.
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/IWorkbenchWindow.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs:
- * MonoDevelop.Ide.Gui.BrowserDisplayBinding:
- * MonoDevelop.Ide.Codons/IDisplayBinding.cs:
- * MonoDevelop.Ide.Gui/DisplayBindingService.cs:
- * MonoDevelop.Ide.Gui/DefaultDisplayBinding.cs:
- * MonoDevelop.Ide.Gui/IAttachableViewContent.cs:
- * MonoDevelop.Ide.Codons/IBaseDisplayBinding.cs:
- * MonoDevelop.Ide.Codons/DisplayBindingCodon.cs:
- * MonoDevelop.Ide.Codons/IAttachableDisplayBinding.cs:
- * MonoDevelop.Ide.Gui/AbstractAttachableViewContent.cs:
- * MonoDevelop.Ide.Gui.BrowserDisplayBinding/HtmlViewPane.cs:
- * MonoDevelop.Ide.Gui.BrowserDisplayBinding/BrowserDisplayBinding.cs:
- Added attachable view contents. These are view contents that
- are displayed in the same document as notebook (like
- designers). Cleaned up some naming.
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/FileViewer.cs:
- * MonoDevelop.Ide.Gui/IWorkbenchWindow.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs:
- * MonoDevelop.Ide.Codons/IDisplayBinding.cs:
- * MonoDevelop.Ide.Codons/FileFilterCodon.cs:
- * MonoDevelop.Ide.Codons/ISubDisplayBinding.cs:
- * MonoDevelop.Ide.Gui/ISecondaryViewContent.cs:
- * MonoDevelop.Ide.Gui/DisplayBindingService.cs:
- * MonoDevelop.Ide.Gui/DefaultDisplayBinding.cs:
- * MonoDevelop.Ide.Codons/DisplayBindingCodon.cs:
- * MonoDevelop.Ide.Gui/AbstractSecondaryViewContent.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- Removed some unused code (subview bindings. They were ment
- to be used by 'designers' like stetic. But stetic doesn't
- use it.). Reworked the display binding subsystem (updated
- display binding service to static class model).
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.Gui/RootWorkspace.cs:
- * MonoDevelop.Ide.Gui.Dialogs/IncludeFilesDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/IncludeNewFilesDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.IncludeFilesDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.IncludeNewFilesDialog.cs:
- Fixed "Bug 491107 - Unexpected behavior of "Automatically
- include found files" from project options". Replaced the old
- GPLed inclutde new files dialog with a new version.
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Fixed "Bug 498901 - Missing
- keybindings for Expand Selection To Next/Prev word".
-
-2009-04-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs: Only call
- GetString for != null values.
-
-2009-04-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFile.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs:
- Added ParentWorkspaceObject to SystemFile and ProjectFolder,
- which replaces the old Project property. It is required
- because now it is possible to show hiddem folders and files
- as children of a solution.
-
-2009-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs: Added missing
- getstring call.
-
-2009-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs: Added
- missing gettext call.
-
-2009-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs: Added
- missing Gettext call.
-
-2009-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/DocumentSwitcher.cs:
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs:
- * MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPadWidget.cs:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanel.cs:
- * MonoDevelop.Ide.CodeFormatting/EditFormattingPolicyDialog.cs:
- Removed some delegate methods and added explicit event
- handlers.
-
-2009-04-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs: Added
- missing translation string.
-
-2009-04-27 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.FindInFiles/HslColor.cs:
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs:
- * gtk-gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs:
- Worked on find in files dialog.
-
-2009-04-27 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.FindInFiles/HslColor.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs:
- Worked on search result box theming. Should now work with
- more gtk+ styles and color sheme combinations. Removed the
- UseEditorTheme 'feature' (the new one should work as
- expected).
-
-2009-04-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/EditCommands.cs:
- * MonoDevelop.Ide.Templates/FileTemplate.cs:
- * MonoDevelop.Ide.Templates/ProjectTemplate.cs:
- * MonoDevelop.Ide.Gui.Dialogs/RenameItemDialog.cs:
- * MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs:
- * MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs:
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Reimplemented language binding service.
-
-2009-04-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Initialize the
- ImageService before showing the GUI so that it can register
- stock icons for GTK before they get requested by the
- toolbars, etc. Fixes invisible icon bug.
-
-2009-04-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Commands/ProjectCommands.cs: Add default
- handler for Edit References command.
-
-2009-04-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: On Windows, touch Win32
- before GTK, to make sure GTK native theme is inited
- correctly.
-
-2009-04-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: More Mac shortcuts. Add "Edit
- references" command to the Project menu. Fix Search menu ID
- typo.
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs: Search is
- now the default button.
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: File name
- column is now resizable.
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Codons/WindowOpenCondition.cs:
- * MonoDevelop.Ide.Codons/ProjectOpenCondition.cs:
- * MonoDevelop.Ide.Codons/WindowActiveCondition.cs: Removed
- some old unused code.
-
-2009-04-24 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.Gui.Content/IParsableContent.cs: Removed
- unused interface.
-
-2009-04-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs: Fix Bug 497833 - When loading
- .sln from command line: MonoDevelop failed to start:
- Collection is read-only.
-
-2009-04-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs: Track
- KeyBindingManager API.
-
-2009-04-23 Federico Di Gregorio <fog@initd.org>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceFolderNodeBuilder.cs:
- Show Edit References dialog when double-clicking on the
- References folder.
-
-2009-04-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Commands/TextEditorCommands.cs: Add commands
- for ScrollPageDown and ScrollPageUp.
-
- * MonoDevelop.Ide.addin.xml: Add commands for ScrollPageDown
- and ScrollPageUp. Add some Mac shortcuts.
-
-2009-04-23 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Ide.DocumentSwitcher.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs:
- * gtk-gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ExportProjectDialog.cs:
- * gtk-gui/MonoDevelop.Ide.ExternalTools.ExternalToolPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.CodeFormattingPolicyPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.GlobalAuthorInformationPanelWidget.cs:
- Added an option to set search result pad theming.
-
-2009-04-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Handled
- use theme color change.
-
-2009-04-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Worked on
- color adjustment.
-
-2009-04-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Added
- simple color adjustment to handle the 'oblivion' problem.
-
-2009-04-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Search
- result widget is now themed.
-
-2009-04-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/FindReplace.cs:
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs: Replaced
- search algorithm implementation (The old one didn't work as
- expected). FileMask is now preserved.
-
-2009-04-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs: Fixed bug
- in find in files dialog.
-
-2009-04-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/FindReplace.cs:
- * MonoDevelop.Ide.FindInFiles/FilterOptions.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Respect
- case sensitive & search whole words only options.
-
-2009-04-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.FindInFiles/FindReplace.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Now using
- Boyer-Moore searching algorithm for pattern matching.
-
-2009-04-23 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Gui.Search:
- * MonoDevelop.Ide.Gui.Search/IFind.cs:
- * MonoDevelop.Ide.FindInFiles/Scope.cs:
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs:
- * MonoDevelop.Ide.FindInFiles/Commands.cs:
- * MonoDevelop.Ide.Gui.Search/DefaultFind.cs:
- * MonoDevelop.Ide.Commands/SearchCommands.cs:
- * MonoDevelop.Ide.Gui.Search/SearchResult.cs:
- * MonoDevelop.Ide.FindInFiles/FindReplace.cs:
- * MonoDevelop.Ide.Gui.Search/ITextIterator.cs:
- * gtk-gui/MonoDevelop.Ide.DocumentSwitcher.cs:
- * MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs:
- * MonoDevelop.Ide.FindInFiles/FileProvider.cs:
- * MonoDevelop.Ide.Gui.Search/SearchOptions.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResult.cs:
- * MonoDevelop.Ide.FindInFiles/FilterOptions.cs:
- * MonoDevelop.Ide.Gui.Search/ISearchStrategy.cs:
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultPad.cs:
- * MonoDevelop.Ide.Gui.Search/IDocumentIterator.cs:
- * MonoDevelop.Ide.Gui.Search/KMPSearchStrategy.cs:
- * MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs:
- * MonoDevelop.Ide.Gui.Search/RegExSearchStrategy.cs:
- * MonoDevelop.Ide.Gui.Search/DefaultSearchResult.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs:
- * MonoDevelop.Ide.Gui.Search/IDocumentInformation.cs:
- * MonoDevelop.Ide.Gui.Search/ExtendedStreamReader.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs:
- * MonoDevelop.Ide.Gui.Search/FilesDocumentIterator.cs:
- * MonoDevelop.Ide.Gui.Search/SearchProgressMonitor.cs:
- * MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs:
- * MonoDevelop.Ide.Gui.Search/ISearchProgressMonitor.cs:
- * MonoDevelop.Ide.Gui.Search/WildcardSearchStrategy.cs:
- * MonoDevelop.Ide.FindInFiles/SearchProgressMonitor.cs:
- * MonoDevelop.Ide.Gui.Search/SearchReplaceUtilities.cs:
- * MonoDevelop.Ide.Gui.Search/ForwardTextFileIterator.cs:
- * MonoDevelop.Ide.FindInFiles/ISearchProgressMonitor.cs:
- * MonoDevelop.Ide.Gui.Search/FileDocumentInformation.cs:
- * MonoDevelop.Ide.Gui.Search/AllOpenDocumentIterator.cs:
- * MonoDevelop.Ide.Gui.Search/BruteForceSearchStrategy.cs:
- * MonoDevelop.Ide.Gui.Search/DirectoryDocumentIterator.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * gtk-gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/SolutionNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Search/SearchReplaceInFilesManager.cs:
- * gtk-gui/MonoDevelop.Ide.FindInFiles.SearchResultWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ExportProjectDialog.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Search/WholeCombineDocumentIterator.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ReplaceInFilesDialog.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/WorkspaceNodeBuilder.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.FeatureSelectorDialog.cs:
- * MonoDevelop.Ide.Gui.Search/CurrentProjectDocumentIterator.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs:
- * gtk-gui/MonoDevelop.Ide.ExternalTools.ExternalToolPanelWidget.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FileOperationsBuilderExtension.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.CodeFormattingPolicyPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.GlobalAuthorInformationPanelWidget.cs:
- Worked on search & replace in files feature.
-
-2009-04-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Commands/WindowCommands.cs: Use
- PropertyService.IsMac.
-
-2009-04-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Tasks/CommentTasksView.cs: Track comment tag
- API.
-
- * MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs: Add
- support for multi-line comments when the langauge doesn't
- support single-line comments.
-
-2009-04-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.StandardHeader/StandardHeaderPolicyPanel.cs:
- Revert change that broke equality checking.
-
-2009-04-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.csproj: Added new files.
-
- * MonoDevelop.Ide.Commands/ProjectCommands.cs: Implemented new
- "Run With" command which allows running a project using a
- special execution mode.
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.Gui.OptionPanels/MonoRuntimePanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.MonoRuntimePanelWidget.cs:
- Implemented new panel for registering parallel mono
- enivornments.
-
- * MonoDevelop.Ide.addin.xml: Registered new options panel and
- new command.
-
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs:
- Flush.
-
- * Makefile.am: Updated.
-
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Added some
- overloads to the Run command.
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs:
- * MonoDevelop.Ide.Gui/IdePreferences.cs: Allow selecting the
- active runtime to be used for building and running the
- project.
-
- * MonoDevelop.Ide.Gui/ConfigurationComboBox.cs: The project
- configuration combo box now also allows selecting the active
- runtime.
-
- * MonoDevelop.Ide.Gui/Ide.cs: Initialize the preferences
- object before the workspace, since it may be required before
- any other object.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/InternalLog.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Gui/DocumentSwitcher.cs:
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs:
- * MonoDevelop.Ide.Gui/AddinUpdateHandler.cs:
- * MonoDevelop.Ide.Templates/FileTemplate.cs:
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs:
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs:
- * MonoDevelop.Ide.Templates/ProjectTemplate.cs:
- * MonoDevelop.Ide.Gui/StatusProgressMonitor.cs:
- * MonoDevelop.Ide.Gui.Components/TreeBuilder.cs:
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs:
- * MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs:
- * MonoDevelop.Ide.Gui.Dialogs/ProjectReferencePanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/OverridesImplementsDialog.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPadWidget.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateListDataProvider.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/LinkedFilesFolderNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs:
- Renamed PixbufService to ImageService.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.StandardHeader/StandardHeaderPolicyPanel.cs:
- Fixed "Bug 491090 - Standard Header doesn't work".
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/TextEditor.cs:
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Track API
- changes.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide/Services.cs:
- * MonoDevelop.Ide.Gui/InternalLog.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Gui/DocumentSwitcher.cs:
- * MonoDevelop.Ide.Gui/AddinUpdateHandler.cs:
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs:
- * MonoDevelop.Ide.Templates/FileTemplate.cs:
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs:
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs:
- * MonoDevelop.Ide.Templates/ProjectTemplate.cs:
- * MonoDevelop.Ide.Gui/StatusProgressMonitor.cs:
- * MonoDevelop.Ide.Gui.Components/TreeBuilder.cs:
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs:
- * MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs:
- * MonoDevelop.Ide.Gui.Dialogs/ProjectReferencePanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/OverridesImplementsDialog.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPadWidget.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateListDataProvider.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/LinkedFilesFolderNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs:
- Track API changes.
-
-2009-04-17 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.Ide.csproj: don't require gtk-sharp specific version.
- * MonoDevelop.Ide.Gui/Ide.cs: fix a csc unitialized var error.
-
-2009-04-17 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide/Services.cs:
- * MonoDevelop.Ide.Gui/IdeStartup.cs:
- * MonoDevelop.Ide.Gui/DocumentSwitcher.cs:
- * MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs:
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs:
- * MonoDevelop.Ide.Gui.Components/TreeBuilder.cs:
- * MonoDevelop.Ide.Gui.Dialogs/ProjectReferencePanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/SelectReferenceDialog.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs:
- Removed icon service.
-
-2009-04-17 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
-
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui.Content/ICustomizedCommands.cs: Removed
- unused interface.
-
-2009-04-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Changed
- IMementoCapable interface.
-
-2009-04-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Commands/FileCommands.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- Worked on recent open.
-
-2009-04-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs: Use new
- Node.PublicUrl property when possible (Mono 2.6+).
-
-2009-04-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs: Add an OpenFiles method.
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Avoid unnecessary
- SplashScreen creation.
-
-2009-04-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Don't show the splash
- screen on Mac, so that we get the dock "bounce" while it
- starts up. Force platform services to initialise ASAP, right
- after the runtime, so that the Mac platform can subscribe to
- file-open events. When splash screen isn't shown, use a
- console progress monitor instead.
-
-2009-04-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/DocumentSwitcher.cs: Present the parent
- window is after switching, since some windows managers
- (Mac!) may not restore focus automatically.
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Commands/WindowCommands.cs: Use Mac command
- key for numbered tab switching.
-
-2009-04-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Remove the www prexfix
- from the MD homepage URL.Thanks to Grzegorz Sobanski for the
- patch.
-
-2009-04-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs:
- Worked on edit template dialog.
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
-
-2009-04-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Gui.Dialogs/GacReferencePanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/SelectReferenceDialog.cs: Moved
- SystemAssemblyService and related classes to the namespace
- MonoDevelop.Core.Assemblies.
-
-2009-04-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs: Handled
- null icon for background progress. (Bug 495375 - Exception
- while trying to rename a field.)
-
-2009-04-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs: Use
- BindingToDisplayLabel to format the commands in a
- platform-specific way. Do KeyBindingManager to do the
- captures, since it handle platform-specific issues.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * BuildVariables.cs:
- * MonoDevelop.Ide.addin.xml: Bump MD version.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Gui.Dialogs/GacReferencePanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/SelectReferenceDialog.cs:
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Track api changes to support multiple target runtimes.
-
-2009-04-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Added patch from Levi Bard
- <taktaktaktaktaktaktaktaktaktak@gmail.com>: Perform initial
- parse asynchronously.
-
-
-2009-04-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Made the 'undo' of code completion operations more
- intelligent.
-
-2009-04-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Fixed error
- in resolve command.
-
-2009-04-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Fixed bug in
- resolve type feature.
-
-2009-04-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs: handled
- strings in GetLenghtOrCount expansion method.
-
-2009-04-07 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.Gui.Dialogs/RenameItemDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.RenameItemDialog.cs:
- implemented Bug 414735 - Rename refactoring should not allow
- invalid names
-
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
-
-2009-04-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Commands/TextEditorCommands.cs: Implemented
- "Bug 492675 - New line & ; at end of line".
-
-2009-04-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Commands/TextEditorCommands.cs: Added
- ctrl+return/shift+return commands.
-
-2009-04-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Change the
- platform service method for installing the global menu so
- that it uses a command path instead of a GTK menu.
-
-2009-04-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Added
- "resolve namespace" feature.
-
-2009-03-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: fixed "Bug
- 489051 - Textcursor malplaced 3 lines when moving lines of
- code with alt+arrow".
-
-2009-03-23 Mike Krüger <mkrueger@novell.com>
-
- * options/KeyBindingSchemeVisualStudio.xml: fixed "Bug 487424
- - Ctrl + L doesn't delete the current line in VS profile".
-
-2009-03-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs: added
- comment
-
-2009-03-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs:
- Filtered expression templates from code completion.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs: Set link for
- fallback data.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs: Handled
- empty/invalid function result.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs:
- * MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml:
- Added template versioning.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml:
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Added support for contextual templates.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs:
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateListDataProvider.cs:
- Cleaned up some source.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/IUndoHandler.cs:
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs:
- * MonoDevelop.Ide.CodeFormatting/AddPolicyDialog.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs:
- * MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateVariable.cs:
- * MonoDevelop.Ide.CodeFormatting/CodeFormatterService.cs:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanel.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateCompletionData.cs:
- * MonoDevelop.Ide.CodeFormatting/EditFormattingPolicyDialog.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateListDataProvider.cs:
- * MonoDevelop.Ide.CodeFormatting/OverrideTextSettingsPolicyWidget.cs:
- Fixed headers.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateListDataProvider.cs:
- Track api changes.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateListDataProvider.cs:
- Changed list provider interface.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- removed debug message.
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs: Worked on
- "surround with" indenting.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs: removed
- debug message.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Commands/TextEditorCommands.cs:
- * MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml:
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Added show code template command.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs:
- * MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateVariable.cs:
- * MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateListDataProvider.cs:
- Added icons to the template completion list.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs:
- * MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml:
- Worked on templates.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs: Handled
- single file case.
-
-2009-03-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs: Fixed
- resolve position for GetCountOrLength
-
-2009-03-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs: Worked on
- template callbacks.
-
-2009-03-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs: Worked on
- multi item callback.
-
-2009-03-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs: Set standard
- values.
-
-2009-03-21 Mike Krüger <mkrueger@novell.com>
-
- * options/KeyBindingSchemeMonoDevelop2.xml: Set the help tree
- key to alt+shift+f1. ctrl+f1 conflicts with the tooltip
- popup key.
-
-2009-03-20 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs:
- Changed edit template dialog.
-
-2009-03-20 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs:
- * MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs:
- * MonoDevelop.Ide.CodeTemplates/EditVariablesDialog.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateVariable.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * gtk-gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeTemplates.EditVariablesDialog.cs:
- Worked on code template edit dialog.
-
-2009-03-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateVariable.cs:
- * MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml:
- Templates can now specify a set of values.
-
-2009-03-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/IWorkbenchWindow.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs:
- * MonoDevelop.Ide.Gui.Content/ITextEditorResolver.cs:
- * MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateCompletionData.cs:
- Implemented template function callbacks.
-
-2009-03-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateCompletionData.cs:
- Added ICodeTemplateWidget interface.
-
-2009-03-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs: Worked on
- text link edit mode.
-
-2009-03-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Avoid using
- IdeApp.Workbench.ProgressMonitors because it is a gui sync
- object, and it's an unnecessary thread transition.
-
-2009-03-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs: Make sure
- BackgroundProgressMonitor is fully asynchronous. Should fix
- deadlock in the parser service, which uses this progress
- monitor to notify parsing progress.
-
-2009-03-19 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.Commands/TextEditorCommands.cs:
- * gtk-gui/MonoDevelop.Ide.SelectEncodingsDialog.cs:
- * MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateGroup.cs:
- * MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs:
- * MonoDevelop.Ide.CodeTemplates/EditVariablesDialog.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateVariable.cs:
- * MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml:
- * MonoDevelop.Ide.CodeTemplates/EditTemplateGroupDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs:
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateCompletionData.cs:
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- * gtk-gui/MonoDevelop.Ide.CodeTemplates.EditVariablesDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeTemplates.CodeTemplatePanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.EditFormattingPolicyDialog.cs:
- Worked on code template system, added surround templates.
- (Edit template mode still missing in the text editor, but
- the templates should be already more useful than before.)
-
-2009-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: Add
- missing mike.
-
-2009-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: Updated
- authors list.
-
-2009-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * icons/AboutImage.png:
- * icons/SplashScreen.png:
- * MonoDevelop.Ide.csproj:
- * icons/AboutImageSep.png:
- * MonoDevelop.Ide.Gui.Dialogs/SplashScreen.cs:
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: New art
- for the splash window and about dialog.
-
- * MonoDevelop.Ide.Gui/HelpOperations.cs: Added null check.
-
-2009-03-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeFormatting/EditFormattingPolicyDialog.cs:
- Worked on formatting policy dialog.
-
-2009-03-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeFormatting/EditFormattingPolicyDialog.cs:
- Worked on edit formatting dialog.
-
-2009-03-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeFormatting/EditFormattingPolicyDialog.cs:
- worked on edit formatting policy dialog.
-
-2009-03-13 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Correct string
- messages.
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * MonoDevelop.Ide.CodeFormatting/EditFormattingPolicyDialog.cs:
- * MonoDevelop.Ide.CodeFormatting/OverrideTextSettingsPolicyWidget.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.OverrideTextSettingsPolicyWidget.cs:
- Added code format widget.
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeFormatting/EditFormattingPolicyDialog.cs:
- Removed debug message.
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * MonoDevelop.Ide.CodeFormatting/EditFormattingPolicyDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.EditFormattingPolicyDialog.cs:
- Worked on code formatting.
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * gtk-gui/MonoDevelop.Ide.DocumentSwitcher.cs:
- * gtk-gui/MonoDevelop.Ide.SelectEncodingsDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ExportProjectDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AddInsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.EditFormattingPolicyDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.CodeFormattingPolicyPanelWidget.cs:
-
-
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanel.cs:
- * MonoDevelop.Ide.CodeFormatting/EditFormattingPolicyDialog.cs:
- Using Mono.TextEditor in code format panels.
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
-
- * gtk-gui/MonoDevelop.Ide.DocumentSwitcher.cs:
- * gtk-gui/MonoDevelop.Ide.SelectEncodingsDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ExportProjectDialog.cs:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AddInsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.CodeFormattingPolicyPanelWidget.cs:
- Worked on code format panel.
-
-2009-03-13 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.addin.xml:
-
- * MonoDevelop.Ide.CodeFormatting/AddPolicyDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.AddPolicyDialog.cs:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanel.cs:
- * MonoDevelop.Ide.CodeFormatting/EditFormattingPolicyDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.EditFormattingPolicyDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.CodeFormattingPolicyPanelWidget.cs:
- Worked on code formatting.
-
-2009-03-12 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.CodeFormatting/AddPolicyDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.AddPolicyDialog.cs:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanel.cs:
- * MonoDevelop.Ide.CodeFormatting/EditFormattingPolicyDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.EditFormattingPolicyDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.CodeFormattingPolicyPanelWidget.cs:
- Worked on code formatter.
-
-2009-03-11 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.CodeFormatting/AddPolicyDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.AddPolicyDialog.cs:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanel.cs:
- * MonoDevelop.Ide.CodeFormatting/EditFormattingPolicyDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.FeatureSelectorDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.CodeFormattingPolicyPanel.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.EditFormattingPolicyDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.CodeFormattingPolicyPanelWidget.cs:
- Worked on code formatting.
-
-2009-03-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/TreeViewItem.cs: Fix
- potential cast exception.
-
-2009-03-10 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.FeatureSelectorDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.CodeFormattingPolicyPanel.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.EditFormattingPolicyDialog.cs:
- Removed text editor reference.
-
-2009-03-10 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.CodeFormatting:
- * MonoDevelop.Ide.CodeFormatting/CodeFormatterService.cs:
- * MonoDevelop.Ide.CodeFormatting/CodeFormattingPolicyPanel.cs:
- * MonoDevelop.Ide.CodeFormatting/EditFormattingPolicyDialog.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.CodeFormattingPolicyPanel.cs:
- * gtk-gui/MonoDevelop.Ide.CodeFormatting.EditFormattingPolicyDialog.cs:
- Added code formatting panels.
-
-2009-03-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs: Don't try to
- fill the tree when there is no help tree.
-
-2009-03-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs: Possible fix for
- bug #483723 - Gtk-criticals infinite loop.
-
-2009-03-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/IUndoHandler.cs: corrected code
- style.
-
-2009-03-09 Mike Krüger <mkrueger@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
-
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs:
- * MonoDevelop.Ide.Gui.Content/IUndoHandler.cs:
- * MonoDevelop.Ide.Gui.Content/IEditableTextBuffer.cs: Moved
- undo/redo function to an own interface.
-
-2009-03-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: Added silk
- icons to about dialog.
-
-2009-03-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs:
- * MonoDevelop.Ide.Gui.Components/TransactedTreeBuilder.cs:
- Reset the transaction store field of the tree before
- committing, since while committing there may be further
- changes in the tree, and those should not be done using the
- current store. Fixes bugs #481179 and #479158.
-
-2009-03-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Removed dead web page link from
- main menu, added new ones.
-
-2009-03-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs: Make
- use of template icon.
-
-2009-03-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/DocumentSwitcher.cs: Fixed "Bug 444416 -
- CTRL+TAB should switch between files in same order as they
- were opened". Taken the patch from David Goemans
- <dgoemans@gmail.com> and many good ideas from Michael
- Hutchinson (but not all ^^).
-
-2009-03-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/FilesDocumentIterator.cs:
- * MonoDevelop.Ide.Gui.Search/DirectoryDocumentIterator.cs:
- Skip over files that aren't text files.
-
-2009-03-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/CurrentProjectDocumentIterator.cs:
- Saner implementation. Don't add duplicate files.
-
-2009-03-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs: Partial
- workaround for results that have a bad encoding.
-
-2009-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic: Remove unused dialog.
-
-2009-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.Gui.Dialogs/BreakpointPropertiesDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.BreakpointPropertiesDialog.cs:
- Breakpoint properties dialog moved to MD.Debugger.
-
-2009-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Fixed NRE when the current
- view does not have a file name.
-
-2009-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/NodeCommandHandler.cs: Make
- sure the default implementation of CanDeleteMultipleItems is
- used if CanDeleteItem is overriden.
-
-2009-02-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Better message for
- saving before building. Thanks to Bálint Kriván.
-
-2009-02-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs:
- Flush.
-
-2009-02-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/DirectoryTemplate.cs: Only add the
- directory if it's explicit, i.e. when there are no inner
- contents.
-
-2009-02-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs:
- Handle directories that are explicitly included in the
- project.
-
-2009-02-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Translation fixes. Patch from
- Kriván Bálint.
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs:
- Make the show hidden files work for all folder items.
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs:
- If the reference is not valid, display the validation error
- message.
-
-2009-02-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/ProjectDescriptor.cs: Add the
- ability to set SpecificVersion in templates.
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs:
- * MonoDevelop.Ide.Gui/StartupInfo.cs: Show the splash window
- while the runtime is being initialized.
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Use the active
- configuration by default when opening the project options.
- Fixes bug #479535.
-
-2009-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs:
- Worked on property pad translation.
-
-2009-02-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Fix translatable strings.
-
-2009-02-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/PadTreeView.cs: Dispose is
- not guaranteed to be called when a widget is destroyed. Use
- OnDestroyed instead.
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/SharpDevelopAboutPanels.cs:
- Changed override Destroy --> override OnDestroyed.
-
-2009-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/SharpDevelopAboutPanels.cs:
- Worked on ressource de-allocation.
-
-2009-02-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs:
- Partial reversion of last patch. Don't double-translate, but
- still include "other" in the sort.
-
-2009-02-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs:
- Translate categories. Sort on translated category names.
-
-2009-02-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj: Added new files.
-
- * MonoDevelop.Ide.Gui/Ide.cs: When registering for the
- Initialized event, fire it if the IDE has already been
- initialized.
-
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs:
- * MonoDevelop.Ide.Gui.Pads/SolutionPad.cs:
- * MonoDevelop.Ide.Codons/SolutionPadCodon.cs:
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs:
- * MonoDevelop.Ide.Gui.Components/NodeCommandHandler.cs:
- * MonoDevelop.Ide.Codons/PadContextMenuExtensionNode.cs: Allow
- setting the default context menu to be used when none is
- specified for a node type.
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Codons/ProjectActiveCondition.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFile.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolder.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/SolutionNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectSolutionPad.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/WorkspaceNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FileOperationsBuilderExtension.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceFolderNodeBuilder.cs:
- Merged all project pad context menus in a single extension
- point.
-
-2009-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: removed f11 shortcut.
-
-2009-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Fullscreen set to F11 shortuct
- (same as gnome terminal).
-
-2009-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: fixed "Bug 478483
- - go to declaration + assembly browser = NRE".
-
-2009-02-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Don't add duplicate files to a project.
-
-2009-02-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs: Track API.
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- CreateFile doesn't create a file, it just returns a stream
- of content, so rename it to CreateFileContent and remove
- redundant file-exists check.
-
-2009-02-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- In AddFileToProject, don't throw an exception if a file with
- the name is already in the project, since SaveFile already
- asks the user if they want to overwrite the file if it
- exists. Prevents problems creating files when grouped files
- get added automatically.
-
- * MonoDevelop.Ide.Templates/FileTemplateReference.cs: Allow
- suppressing whether the file auto-opens.
-
-2009-02-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Templates/DirectoryTemplate.cs: Add a
- FileTemplateType for creating directories, which can contain
- files and can be nested.
-
-2009-02-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs:
- Changed extensible tree view api a bit.
-
-2009-02-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs:
- Better error messages for file rename. Fixes 'Bug 473688 -
- Reports problem about "already in use" when it should report
- non-existance'.
-
-2009-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/WorkbenchMemento.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Gui/IWorkbenchLayout.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Reset the toolbar
- positions the first time MD is executed, in this way they
- will take all available space.
-
-2009-02-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/TextStylePolicyPanel.cs:
- changed translation string.
-
-2009-02-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: fixed "Bug
- 402388 - Several refactory commands are not aware of partial
- classes".
-
-2009-02-18 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Add a hook for
- handling global menu installation.
-
-2009-02-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: fixed "Bug
- 445462 - For interfaces, the refactor command "Find derived
- classes" should be renamed".
-
-2009-02-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Track api changes.
-
-2009-02-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/ExportProjectDialog.cs: Suggest
- the item's physical directory as target directory.
-
-2009-02-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GacReferencePanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/ProjectReferencePanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/SelectReferenceDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/AssemblyReferencePanel.cs: When
- selecting a package reference, include the package name in
- the reference, so it will be stored when saving the project.
-
-2009-02-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: small change
- to constructor refactoring menu.
-
-2009-02-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/TextEditor.cs: Added LineCount property.
-
- * MonoDevelop.Ide.addin.xml: Removed ctrl+shift+u shortcut for
- uppercase selection. ctrl+shift+u is used for unicode text
- input.
-
-2009-02-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Added method to get an
- updated parsed document.
-
-2009-02-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: fixed compiler
- error.
-
-2009-02-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Worked on
- preventing InvalidCastException reported in "Bug 475797 -
- text corruption on screen with folding on in build 126778".
-
-2009-02-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: fixed "Bug
- 476148 - Bad handling of partial classes".
-
-2009-02-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: fixed
- constructor refactoring context menu.
-
- * MonoDevelop.Ide.Gui.Dialogs/RenameItemDialog.cs: rename file
- option now works.
-
-2009-02-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: fixed "Bug
- 391066 - Rename not offered for generic classes".
-
-2009-02-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: fixed "Bug
- 350810 - [PATCH] Duplicate entries in context menu for
- refactoring operations".
-
-2009-02-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: error underlining & folding
- now works on untitled files.
-
-2009-02-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/TransactedTreeBuilder.cs:
- Make sure insert callbacks are called when committing a
- transaction. Fixes bug 442123 - When folder is added to
- solution it no longer renames automatically.
-
-2009-02-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: Fixed Bug
- 447428 - About dialog is completely unreadable when using a
- dark theme.
-
-2009-02-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Properly refresh
- on line changes.
-
-2009-02-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/HelpOperations.cs: Add an API for
- looking up valid help URLs from a ResolveResult.
-
-2009-02-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Fix crash.
-
-2009-02-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj:
- * MonoDevelop.Ide.Gui/HelpViewer.cs:
- * MonoDevelop.Ide.Gui/HelpOperations.cs:
- * MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs: Remove internal
- help viewer, as it is no longer maintained, and requires a
- browser addin.
-
-2009-02-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs:
- Show a warning icon when a reference is invalid.
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Show the project
- name in the error list.
-
- * MonoDevelop.Ide.Tasks/Task.cs: When jumping to a task's
- file, if there is no file found, select the owner project in
- the solution pad.
-
-2009-02-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/DragNotebook.cs:
- * MonoDevelop.Ide.Gui.Dialogs/CombineEntryFeatureSelector.cs:
- Dispose Gdk cursors, else finalisers destroy them outside of
- the GUI thread and often crash MD due to X asserts resulting
- in _XCBUnlockDisplay errors.
-
-2009-02-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/RootWorkspace.cs:
- * MonoDevelop.Ide.Gui/IWorkbenchWindow.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: When a project is
- reloaded, close all open documents bound to that project.
- Fixes bug #464272.
-
-2009-02-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs: Add inner types
- to the list. Improved disambiguation string for types and
- files. When matching the full file name, match only the
- relative path to the project.
-
-2009-02-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Tasks/UserTasksView.cs:
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs:
- * MonoDevelop.Ide.Tasks/CommentTasksView.cs:
- * MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs:
- * MonoDevelop.Ide.Gui.Pads/InternalLogPad.cs:
- * MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs: Use pad font.
-
-2009-02-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs:
- Unsubscibe from property service events when destroyed.
-
-2009-02-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/FileScout.cs: Use pad font.
-
-2009-02-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.csproj: Updated.
-
- * MonoDevelop.Ide.Gui.Pads/FileList.cs: Expose method for
- setting custom font.
-
-2009-02-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/PadFontChanger.cs:
- * MonoDevelop.Ide.Gui.Components/PadTreeView.cs: Utility
- classes for handling pad font changes.
-
-2009-02-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextStylePolicy.cs: Rename
- EolMarker.Default to EolMarker.Native. Finish updating
- TextStylePolicy.
-
- * MonoDevelop.Ide.Gui.OptionPanels/TextStylePolicyPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TextStylePolicyPanelWidget.cs:
- Enable editing of line ending policy.
-
- * gtk-gui/gui.stetic: Updated.
-
-2009-02-11 Mike Kestner <mkestner@novell.com>
-
- * gtk-gui/gui.stetic: mark the treeview scroller horiz policy
- NEVER. [Fixes #474463] Also kill a G_WARNING for spinbutton.
- * gtk-gui/*.cs: regen
-
-2009-02-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.Gui.Pads/SolutionPad.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs:
- Removed unused option.
-
- * MonoDevelop.Ide.Tasks/TaskService.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs: Use
- the new special comment tags api.
-
- * gtk-gui/MonoDevelop.Ide.DocumentSwitcher.cs:
- * gtk-gui/MonoDevelop.Ide.ExternalTools.ExternalToolPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs:
- Updated.
-
-2009-02-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: added
- refactoring support for aggregated resolve results.
-
-2009-02-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextStylePolicy.cs: Added
- EolMarker property to text style policies.
-
-2009-02-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- templates are now using formatters.
-
-2009-02-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs:
- * MonoDevelop.Ide.Commands/CustomStringTagProvider.cs: fixed
- 'Bug 474094 - External Tools initial directory does not
- work'.
-
-2009-02-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.StandardHeader/StandardHeaderPolicyPanel.cs:
- Don't let the text be null, as this breaks the serialiser.
- Fixes "Bug 473754 - In the solution policy, if the license
- field is empty, you cannot change save changes".
-
-2009-02-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs:
- * MonoDevelop.Ide.Commands/FileCommands.cs:
- * MonoDevelop.Ide.Gui/DocumentNavigationPoint.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceData.cs:
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Properly fix warning.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.csproj: Don't local-copy other addins' dlls.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * BuildVariables.cs: Include in svn so that autotools isn't
- required to build MD.
-
-2009-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide/Services.cs:
- * MonoDevelop.Ide.Gui/HelpViewer.cs:
- * MonoDevelop.Ide.Gui/IdeStartup.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs:
- * MonoDevelop.Ide.Commands/FileCommands.cs:
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs:
- * MonoDevelop.Ide.Gui/DocumentNavigationPoint.cs:
- * MonoDevelop.Ide.Gui/NavigationHistoryService.cs:
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceData.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs:
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Fixed compiler warnings.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Exclude project files
- when looking for new files to add to a project.
-
- * MonoDevelop.Ide.Gui.Dialogs/IncludeFilesDialog.cs: Save the
- changed project only, not the whole workspace.
-
-2009-02-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:
- Hide the completion window if the buffer&cursor change by
- more than one char while base is handling the keystroke.
- Hacks around C# indenter issues.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp:
- * MonoDevelop.Ide.csproj: Migrated to MSBuild file format.
-
-2009-02-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GacReferencePanel.cs: Internal
- packages now show a "Provided by MD" message next to the
- name, to make more evident that they are not installed in
- the system.
-
-2009-02-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs: Avoid duplicates
- in search results. Fixes bug 470393 - Some items show up
- twice in go-to-file dialog.
-
- * MonoDevelop.Ide.Gui.Search/WholeCombineDocumentIterator.cs:
- Avoid duplicates in search results. Fixes bug 448849 -
- Search for "Project" on MonoDevelop solution finds
- duplicates matches.
-
-2009-02-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/TextEditor.cs: fixed "Bug 472714 -
- MonoDevelop automatic indentation does not follow "Convert
- tabs to spaces" option".
-
-2009-02-03 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.Ide.addin.xml: fixed typo
-
-2009-02-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Don't expect
- markup in status bar messages by default.
-
- * MonoDevelop.Ide.Gui/StatusProgressMonitor.cs: Remove
- unnecessary markup escaping.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Added Report Bug link.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs:
- * MonoDevelop.Ide.addin.xml: Bump MD version.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp: Flush.
-
-2009-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Move standard header and text
- style panels to Source Code category.
-
-2009-02-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs:
- Add space between the comment (//) and the licence text.
-2009-02-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextStylePolicy.cs: Add a
- policy object for text styles.
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.Gui.OptionPanels/TextStylePolicyPanel.cs:
- *
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TextStylePolicyPanelWidget.cs:
- Add a panel for editing TextStylePolicy objects.
-
- * MonoDevelop.Ide.addin.xml: Register TextStylePolicy panels.
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp: Updated.
-
-2009/02/01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/GlobalAuthorInformationPanel.cs:
- Store default author info correctly.
-
- * MonoDevelop.Ide.Gui/AuthorInformation.cs: Load copyright
- value correctly.
-
-2009-01-31 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * MonoDevelop.Ide/MonoDevelop.Ide.Debugging:
- * MonoDevelop.Ide/MonoDevelop.Ide.WindowSwitcher: Removed empty
- unused folders.
-
-2009-01-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.StandardHeader/GPL3LicencePolicy.xml:
- * MonoDevelop.Ide.StandardHeader/GPL2LicencePolicy.xml:
- * MonoDevelop.Ide.StandardHeader/NewBSDLicencePolicy.xml:
- * MonoDevelop.Ide.StandardHeader/LGPL2-1LicencePolicy.xml:
- * MonoDevelop.Ide.StandardHeader/Apache2LicencePolicy.xml:
- * MonoDevelop.Ide.StandardHeader/StandardHeaderTemplates.xml: Transfer
- stock license standard headers to the new policy system.
-
-2009-01-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp:
- * gtk-gui/objects.xml: Objects.xml file is empty and unnecessary so
- remove it.
-
-2009-01-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic: Stetic did something odd to the widget file.
- Hopefully this restores it.
-
-2009-01-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs:
- * MonoDevelop.Ide.Templates/ProjectTemplate.cs:
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs:
- * MonoDevelop.Ide.Templates/ProjectDescriptor.cs:
- * MonoDevelop.Ide.Templates/CombineDescriptor.cs:
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs:
- * MonoDevelop.Ide.Templates/FileTemplateReference.cs:
- * MonoDevelop.Ide.Templates/SolutionItemDescriptor.cs:
- * MonoDevelop.Ide.Templates/ISolutionItemDescriptor.cs:
- * MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs:
- * MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs:
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- * MonoDevelop.Ide.Templates/ResourceFileDescriptionTemplate.cs:
- * MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs:
- Propagate a policy parent SolutionItem through project/file creation
- so that policies can always be resolved correctly.
-
-2009-01-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.mdp:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.StandardHeader/StandardHeaderPanel.cs:
- * MonoDevelop.Ide.StandardHeader/NewHeaderTemplateDialog.cs:
- * gtk-gui/MonoDevelop.Ide.StandardHeaders.StandardHeaderPanel.cs:
- * gtk-gui/MonoDevelop.Ide.StandardHeaders.NewHeaderTemplateDialog.cs:
- Remove old standard header panels.
-
- * MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs: Use the
- standard headers policy.
-
- * MonoDevelop.Ide.Commands/EditCommands.cs:
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs: Track API.
-
-2009-01-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Register standard header policy panel as a
- default policy panel. Add command for showing default policies
- dialog.
-
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Commands/EditCommands.cs: Add command for showing
- default policies dialog.
-
-2009-01-30 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/DocumentStateTracker.cs: State tracker can
- now be updated to custom positions.
-
-2009-01-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.mdp:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Gui/RootWorkspace.cs:
- * MonoDevelop.Ide.Gui/UserInformation.cs:
- * MonoDevelop.Ide.Gui/AuthorInformation.cs:
- * MonoDevelop.Ide.StandardHeader/MITX11LicencePolicy.xml:
- * MonoDevelop.Ide.Gui.OptionPanels/UserInformationPanel.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/AuthorInformationPanel.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/GlobalUserInformationPanel.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/GlobalAuthorInformationPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.UserInformationPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AuthorInformationPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.GlobalUserInformationPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.GlobalAuthorInformationPanelWidget.cs:
- Rename UserInformation to AuthorInformation, and change other strings
- correspondingly. Add Copyright holder string to AuthorInformation.
-
- * gtk-gui/objects.xml: Updated.
-
-2009-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/CustomStringTagProvider.cs: Track api
- changes.
-
-2009-01-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: worked on bug "Bug 469629 - NREs
- caused by null document in TextEditorExtension".
-
-2009-01-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Handled exception on text editor
- extension dispose.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.mdp: Flush project format changes.
-
-2009-01-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp: Updated.
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.StandardHeader/MITX11LicencePolicy.xml: Add a named
- policy for MIT/X11 licenses.
-
- * MonoDevelop.Ide.StandardHeader/StandardHeaderPanel.cs: Remove
- unnecessary toolbox attributes.
-
-2009-01-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.mdp:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.StandardHeader/StandardHeaderPolicyPanel.cs:
- * gtk-gui/MonoDevelop.Ide.StandardHeader.StandardHeaderPolicyPanelWidget.cs:
- Add a policy and a panel for per-solution/project standard headers.
-
-2009-01-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs: Fix bug #460162 -
- Find In Files dialog doesn't retain settings
-
-2009-01-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Enable UserInformation panels.
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Add a GetUserInformation
- overload for getting user information from a project.
-
- * MonoDevelop.Ide.Gui/UserInformation.cs: Add IsValid convenience
- property.
-
-2009-01-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/objects.xml:
- * gtk-gui/MonoDevelop.Ide.SelectEncodingsDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs:
- * gtk-gui/MonoDevelop.Ide.OverridesImplementsDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.IncludeFilesDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ExportProjectDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TasksPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AddInsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.CodeTemplates.CodeTemplatePanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.BreakpointPropertiesDialog.cs:
- Updated.
-
-2009-01-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs: In file
- templates, allow specifying assembly references required for building
- the file. Those references will be added to the project when adding
- the file template.
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: If the solution has been
- modified when changing the project options, save it.
-
-2009-01-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Add user info panels and refactory
- commands, currently commented out.
-
- * MonoDevelop.Ide.Gui/UserInformation.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/UserInformationPanel.cs: Tidy.
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Fix custom user prefs storage;
- it was discarding all custom data at load time.
-
-2009-01-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp: Updated.
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.Gui/RootWorkspace.cs:
- * MonoDevelop.Ide.Gui/UserInformation.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/UserInformationPanel.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/GlobalUserInformationPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.UserInformationPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.GlobalUserInformationPanelWidget.cs:
- Added panels and a mechanism for storing user information (name,
- email) globally or per-solution. Panels not visible yet, as nothing
- uses the information.
-
-2009-01-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs: Revert last change, the
- full name is required for opening the file.
-
-2009-01-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs: Show relative paths in the
- file list.
-
-2009-01-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs: Use a faster comparer when
- sorting the results.
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ClassData.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ClassNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceNodeBuilder.cs:
- Optimizations. Don't update the whole project tree when a file
- changes. Instead, locate the class that has changed and update it.
-
-2009-01-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ClassNodeBuilder.cs: Added missing
- markup flag. Patch by Szczepan Holyszewski. Fixes bug #465197 -
- Semi-garbage labels of generic class nodes in Classes tree.
-
-2009-01-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Added support for reusable view
- contents.
-
-2009-01-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Improved fix of bug #464891.
-
-2009-01-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: When opening a document, if
- BringToFront is requested, make sure the main window has the focus.
- Fixes bug #464891 - Double clicking on error in Floating Error List
- doesn't focus IDE preventing keyboard interaction.
-
-2009-01-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/DocumentSwitcher.cs: BringToFront already gives
- focus to the pad, there is no need anymore to explicitly do it.
-
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs: Properly translate the title
- of dynamically created pads.
-
-2009-01-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Dispose workspace items when
- closing them.
-
-2009-01-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.Gui/DocumentSwitcher.cs: Let gtk+ ellipsize the file
- name.
-
- * MonoDevelop.Ide.Templates/CombineDescriptor.cs: Allow using "Solution"
- instead of "Combine" in solution templates.
-
-2009-01-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.Gui/FileNavigationPoint.cs:
- * MonoDevelop.Ide.Gui/TextFileNavigationPoint.cs:
- * MonoDevelop.Ide.Gui/DocumentNavigationPoint.cs:
- * MonoDevelop.Ide.Gui/NavigationHistoryService.cs: Track Name/FileName
- changes. Handle untitled documents correctly.
-
-2009-01-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs: Don't use
- IsValidFileName to check the file name since it will fail if the name
- contains wildcards.
-
-2009-01-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs:
- * MonoDevelop.Ide.Gui.Content/ITextEditorResolver.cs: Worked on on the
- fly type resolving.
-
-2009-01-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: fixed "Bug 443771 - Go
- to declaration not working for base () calls".
-
-2009-01-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/DefaultFind.cs:
- * MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs:
- * MonoDevelop.Ide.Gui.Search/SearchOptions.cs:
- * MonoDevelop.Ide.Gui.Search/KMPSearchStrategy.cs:
- * MonoDevelop.Ide.Gui.Search/BruteForceSearchStrategy.cs: Fixed 'Bug
- 456429 - Search and replace broken again'.
-
-2009-01-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: worked on "Bug 456372 -
- Exception in refactoring of a class name from missed reference".
-
-2009-01-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/DocumentSwitcher.cs: fixed "Bug 462848 -
- Monodevelop crash when Alt-Tab with Welcome page opened".
-
-2009-01-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs:
- * MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs: Use
- IsValidFilePath instead of IsValidFileName when checking a path.
-
-2008-12-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Fix overzealous suppression
- of unnecessary events that caused active window change events not to
- be fired when tabs were closed. Fixes "Bug 461826 - Recurring
- exception related to Document outline" and a few other previously
- unnoticed bugs.
-
-2008-12-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs: Improved
- logic for checking if project names are valid. Patch by Bryce Covert.
- Fixes bug #457847.
-
-2008-12-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/IPadContainer.cs:
- * MonoDevelop.Ide.Gui/IWorkbenchLayout.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Added ContentVisible
- property to Pad. Works like the one in DockItem.
-
-2008-12-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Type the ActiveView property, and
- expose the PrimaryView. Make GetContent<T> fall back to the primary
- view if it's not the active view.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/objects.xml:
- * MonoDevelop.Ide.mdp:
- * gtk-gui/generated.cs:
- * gtk-gui/MonoDevelop.Ide.DocumentSwitcher.cs:
- * gtk-gui/MonoDevelop.Ide.SelectEncodingsDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.GoToDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs:
- * gtk-gui/MonoDevelop.Ide.OverridesImplementsDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.RenameItemDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.IncludeFilesDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ExportProjectDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ReplaceInFilesDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.FeatureSelectorDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TasksPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AddInsPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs:
- * gtk-gui/MonoDevelop.Ide.StandardHeaders.StandardHeaderPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.LoadSavePanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.ExternalTools.ExternalToolPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.CodeTemplates.CodeTemplatePanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.BreakpointPropertiesDialog.cs:
- * gtk-gui/MonoDevelop.Ide.StandardHeaders.NewHeaderTemplateDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CombineEntryFeatureSelector.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.CodeGenerationPanelWidget.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs:
- Flush.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp: Set correct target framework.
-
-2008-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.mdp:
- * MonoDevelop.Ide.Gui/StatusProgressMonitor.cs:
- * MonoDevelop.Ide.Gui.Dialogs/ProgressMonitorResultDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ProgressMonitorResultDialog.cs:
- Moved dialog for showing multiple messages at once to MD.Core.Gui.
-
-2008-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Gui.Dialogs/GacReferencePanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/ProjectReferencePanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/SelectReferenceDialog.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs:
- * MonoDevelop.Ide.Templates/ClrVersionFileTemplateCondition.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs:
- Use the new TargetFramework api to filter assemblies in the
- references dialog. Deal with changes in the TargetFramework of a
- project.
-
-2008-12-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: GetContent should look in the
- ActiveViewContent (which may be a secondary view), not the
- ViewContent (which is the primary view, even if it's not active).
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp: Don't require a specific version of Mono.Addins.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs: If a number is specified
- just after the file name, use that as target line number.
-
-2008-12-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Fix nullref.
-
-2008-12-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs: Added some missing null
- checks and fields initializations.
-
-2008-12-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.mdp:
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.GoToDialog.cs: Use the new
- ListView for showing the results. Implemented a new matching
- algorithm which supports acronyms.
-
-2008-12-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/DocumentSwitcher.cs:
- * MonoDevelop.Ide.Commands/EditCommands.cs:
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs:
- * MonoDevelop.Ide.Commands/ProjectCommands.cs:
- * MonoDevelop.Ide.Commands/CustomStringTagProvider.cs:
- * MonoDevelop.Ide.Gui.Search/AllOpenDocumentIterator.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectSolutionPad.cs: Track api
- changes.
-
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs: Only search in open
- documents which are files.
-
- * MonoDevelop.Ide.Gui/Document.cs: Reduced the properties returning
- names to two: FileName, which returns the file name if the document
- is a phisical file, and Name, which always returns a name (even if it
- is not a file or unsaved file).
-
-2008-12-04 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui.Search/CurrentProjectDocumentIterator.cs: Fix for
- bug#456670.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: F5 is now for debug.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * gtk-gui/objects.xml:
- * MonoDevelop.Ide.Gui/IdePreferences.cs:
- * MonoDevelop.Ide.Commands/ProjectCommands.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs: Added
- BuildBeforeRun and RunWithWarnings options.
-
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Use new api for getting
- preferences.
-
-2008-12-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Commands/ViewCommands.cs: Register a command for each
- pad which activates the pad. This allows defining shortcuts for
- switching between pads.
-
- * gtk-gui/gui.stetic:
- * gtk-gui/objects.xml:
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs: Improved
- conflict checking. Show the name of the current scheme if there
- aren't custom binding definitions.
-
- * options/KeyBindingSchemeEmacs.xml:
- * options/KeyBindingSchemeVisualStudio.xml: Fixed bindings.
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp:
- * MonoDevelop.Ide.addin.xml:
- * options/KeyBindingSchemeMonoDevelop2.xml: Added key bindings for MD
- 2.0.
-
- * MonoDevelop.Ide.Gui/Ide.cs:
- * options/MonoDevelopProperties.xml: Added properties for checking if MD
- is running for the first time after install or after an upgrade.
-
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Added methods for checking
- if a file can be executed.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp: Fix Makefile integration for AssemblyInfo.cs
- files.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * AssemblyInfo.cs:
- * AssemblyInfo.cs.in:
- * MonoDevelop.Ide.mdp:
- * BuildVariables.cs.in: Add AssemblyInfo.cs files that are autogenerated
- from the addin manifests.
-
-2008-12-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/StartupInfo.cs: Get the full path of provided file
- names. Fixes bug #450999 - Version control add-in fails to work
- properly if solution loaded using "monodevelop mysolution.mds" (run
- from the directory containing the solution).
-
-2008-12-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs: Show the context
- menu when pressing the menu key. Patch by Lucian0.
-
-2008-11-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/FieldNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/EventNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/MethodNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/PropertyNodeBuilder.cs: Refactored
- ambiences/domoutputvisitor.
-
-2008-11-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Remove debug execution handler since it's
- moved to the debugger addin. Fixes exception in options dialog.
-
-2008-11-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Remove double mnemonic on command label.
-
-2008-11-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Remove no-longer-valid commands from
- solution pad context menu.
-
-2008-11-25 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/BreakpointPropertiesDialog.cs: Fix typo.
-
-2008-11-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.mdp:
- * gtk-gui/objects.xml:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Commands/DebugCommands.cs:
- * MonoDevelop.Ide.Commands/ProjectCommands.cs:
- * MonoDevelop.Ide.Debugging/DebuggingService.cs:
- * MonoDevelop.Ide.Gui.Dialogs/AttachToProcessDialog.cs:
- * MonoDevelop.Ide.Debugging/DebugExecutionHandlerFactory.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.AttachToProcessDialog.cs: Moved
- all debugging stuff to MonoDevelop.Debugger.
-
- * MonoDevelop.Ide.Gui.Dialogs/AddinLoadErrorDialog.cs: Improve error
- message.
-
-2008-11-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/SearchProgressMonitor.cs: Improve error
- reporting.
-
- * MonoDevelop.Ide.Gui.Search/RegExSearchStrategy.cs: Don't recreate
- document string for successive matches. Improved performance 12x in a
- typical test case.
-
- * MonoDevelop.Ide.Gui.Search/ForwardTextFileIterator.cs: Track interface
- changes.
-
- * MonoDevelop.Ide.Gui.Search/IDocumentInformation.cs: Move GetLineText
- away from since it makes more sense to take it from the open file
- than to open/close the file again (fixes file sharing conflicts).
-
- * MonoDevelop.Ide.Gui.Search/SearchResult.cs: Capture line text.
-
- * MonoDevelop.Ide.Gui.Search/ITextIterator.cs: Remove ReadToEnd method;
- replace with a GetWholeDocument method that caches the string. Move
- GetLineText here since it makes more sense to take it from the open
- file than to open/close the file again (fixes file sharing
- conflicts).
-
- * MonoDevelop.Ide.Gui.Search/SearchReplaceInFilesManager.cs: Add timing
- debug messages. Don't capture line text; take it from the result
- object.
-
- * MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs: Fix AddPosition's
- handling of multiple results on a line. Improve error reporting of
- problems caused by invalid/overlapping results.
-
-2008-11-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/FileDocumentInformation.cs:
- * MonoDevelop.Ide.Gui.Search/ForwardTextFileIterator.cs: Use
- FileShare.None instead of FileShare.Read, as file sharing seems to
- cause prohibitively expensive thread sync/locking. Speeds up searches
- by a factor of ~6. Fixes Bug 448335 - Searching is really slow.
-
-2008-11-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/ForwardTextFileIterator.cs: Remove unneeded
- code.
-
-2008-11-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/AllOpenDocumentIterator.cs:
- * MonoDevelop.Ide.Gui.Search/DirectoryDocumentIterator.cs:
- * MonoDevelop.Ide.Gui.Search/WholeCombineDocumentIterator.cs:
- * MonoDevelop.Ide.Gui.Search/CurrentProjectDocumentIterator.cs: Fix
- string punctuation to fit with " - matches found" suffix.
-
-2008-11-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/ForwardTextFileIterator.cs: Revert broken
- reimplementation. Many problems -- Close () doesn't make a backup
- when it writes. It deletes and rewrites ALL files even if they're not
- modified, e.g. in a search (not replace) operation. Replace
- operations will be doing huge string concats.
-
-2008-11-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/SearchOptions.cs: Activated KMP search.
-
-2008-11-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs: Escape markup in the
- surrounding text as well as the actual matches. Fixes GTK warnings
- and misdisplay of search results.
-
-2008-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.FindInFiles:
- * MonoDevelop.Ide.Gui/RootWorkspace.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResult.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultPad.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Restored folder. I
- though it was old unused code, but turns out it is actually new code.
-
-2008-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs:
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs:
- * MonoDevelop.Ide.Gui.Search/SearchProgressMonitor.cs:
- * MonoDevelop.Ide.Gui.Search/ISearchProgressMonitor.cs:
- * MonoDevelop.Ide.Gui.Search/SearchReplaceInFilesManager.cs: Highlight
- matches in the search-in-files results list. Show all matches in a
- line in a single row. Fixes bug #341224 - Find results for the same
- line should have only one entry.
-
-2008-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp:
- * MonoDevelop.Ide.FindInFiles:
- * MonoDevelop.Ide.FindInFiles/SearchResult.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultPad.cs:
- * MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs: Remove unused code.
-
- * gtk-gui/gui.stetic: Flush.
-
-2008-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs: Make sure
- something is always selected when filling the tree. Fixes bug #446906
- - Can't run a C / C++ project without opening a file from the project
- first.
-
-2008-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs: Fix bug #Bug
- 431791 - Opening multiple files doesn't work.
-
-2008-11-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/IDocumentIterator.cs:
- * MonoDevelop.Ide.Gui.Search/FilesDocumentIterator.cs:
- * MonoDevelop.Ide.Gui.Search/AllOpenDocumentIterator.cs:
- * MonoDevelop.Ide.Gui.Search/DirectoryDocumentIterator.cs:
- * MonoDevelop.Ide.Gui.Search/SearchReplaceInFilesManager.cs:
- * MonoDevelop.Ide.Gui.Search/WholeCombineDocumentIterator.cs:
- * MonoDevelop.Ide.Gui.Search/CurrentProjectDocumentIterator.cs: Make
- searc/replace status messages specific to the file iterator type.
- Fixes Bug 440909 - Find in Files reports wrong project path.
-
-2008-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp:
- * MonoDevelop.Ide.Gui/StatusProgressMonitor.cs:
- * MonoDevelop.Ide.Gui.Dialogs/ProgressMonitorResultDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ProgressMonitorResultDialog.cs:
- When presenting the results of an operation in a dialog, show them
- inside a scrolled window, to avoid huge windows when there are many
- errors or warnings. Fixes bug #443164 - Too large dialog when the
- load of a solution yields a lot of warnings.
-
- * gtk-gui/objects.xml:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs: Flush.
-
- * gtk-gui/gui.stetic: Added new dialog and removed some old ones.
-
-2008-11-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/CombineDescriptor.cs: Use SetLocation to set
- the path of the new solution. We can't use FileName because we don't
- know the file name yet. Fixes bug #Bug 445119 - File names != from
- solution/project names.
-
-2008-11-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs: fixed 'Bug 446871
- - [Regression] Autoindent doesn't indent far enough'.
-
-2008-11-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: fixed "Bug 443771 - Go
- to declaration not working for base () calls".
-
-2008-11-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/DefaultFind.cs: added patch for "Bug 444455
- - NRE when using Find in files".
-
-2008-11-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/IFind.cs:
- * MonoDevelop.Ide.Gui.Search/DefaultFind.cs:
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs:
- * MonoDevelop.Ide.Gui.Search/SearchResult.cs:
- * MonoDevelop.Ide.Gui.Search/SearchOptions.cs:
- * MonoDevelop.Ide.Gui.Search/ISearchResult.cs:
- * MonoDevelop.Ide.Gui.Dialogs/ReplaceDialog.cs:
- * MonoDevelop.Ide.Gui.Search/ISearchStrategy.cs:
- * MonoDevelop.Ide.Gui.Dialogs/GotoLineDialog.cs:
- * MonoDevelop.Ide.Gui.Search/KMPSearchStrategy.cs:
- * MonoDevelop.Ide.Gui.Search/RegExSearchStrategy.cs:
- * MonoDevelop.Ide.Gui.Search/ForwardTextIterator.cs:
- * MonoDevelop.Ide.Gui.Search/SearchReplaceManager.cs:
- * MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs:
- * MonoDevelop.Ide.Gui.Search/SearchReplaceUtilities.cs:
- * MonoDevelop.Ide.Gui.Search/WildcardSearchStrategy.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ReplaceDialog.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.GotoLineDialog.cs:
- * MonoDevelop.Ide.Gui.Search/CurrentDocumentIterator.cs:
- * MonoDevelop.Ide.Gui.Search/ReverseDocumentIterator.cs:
- * MonoDevelop.Ide.Gui.Search/BruteForceSearchStrategy.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/SolutionNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Search/SearchReplaceInFilesManager.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/WorkspaceNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs:
- fixed "Bug 444916 - Buggy Find in Files". Did some renamings. Removed
- old unused code.
-
-2008-11-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic:
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs:
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs: Sort the
- commands in the list. When entering a shortcut, show a warning if it
- is already bound to another command.
-
- * options/KeyBindingSchemeEmacs.xml:
- * options/KeyBindingSchemeVisualStudio.xml:
- * options/KeyBindingSchemeMonoDevelop1.xml: Cleaned up the schemes.
- Leave only the bindings which differ from the default.
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp:
- * options/KeyBindingSchemeDefault.xml: Removed default scheme. It is now
- automatically generated.
-
- * MonoDevelop.Ide.addin.xml: Remove duplicate shortcut.
-
-2008-11-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/HelpViewer.cs:
- * MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs: Don't crash if the
- documentation tree has not been loaded.
-
-2008-11-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Tasks/TaskService.cs: Avoid unneeded calls to
- GetFullPath.
-
-2008-11-13 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/SearchReplaceInFilesManager.cs: Send the
- exception to the loggingService (this way we give more clues to fix
- #444455).
-
-2008-11-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs: Fix accidental
- infinite recursion.
-
-2008-11-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs: Move template
- completion code to MonoDevelop.Ide.
-
-2008-11-12 Mike Krüger <mkrueger@novell.com>
-
- * options/MonoDevelop-templates.xml: renamed templates *again*
-
-2008-11-12 Mike Krüger <mkrueger@novell.com>
-
- * options/MonoDevelop-templates.xml: changed some default templates.
-
-2008-11-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp:
- * icons/AboutImage.png:
- * icons/Icons.AboutImage:
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: Make the about box
- display properly with big fonts.
-
-2008-11-11 Mike Krüger <mike@icsharpcode.net>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: fixed bug in go to
- definition for types in referenced assemblies.
-
-2008-11-10 Mike Krüger <mike@icsharpcode.net>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: impl. enh. "Bug 442022 -
- Improve annoying behaviour of the MD notebook".
-
-2008-11-10 Mike Krüger <mike@icsharpcode.net>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs: Added enable auto
- completion option.
-
-2008-11-07 Eric Butler <eric@extremeboredom.net>
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Set toolbar variables to
- null when window is closing so that EnsureToolbarBoxSeparator won't
- try to do anything.
-
-2008-11-07 Eric Butler <eric@extremeboredom.net>
-
- * MonoDevelop.Ide.Gui.BrowserDisplayBinding/HtmlViewPane.cs: Show
- "Preview" instead of "Web Browser" if a secondary view, remove
- outdated/broken hack for GTK+ 2.4, and don't allow user to un-check
- buttons.
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Move separator to end of
- toolbar after adding a button if one already exists.
-
-2008-11-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Gui.Dialogs/IncludeFilesDialog.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs: Use
- new default build action API.
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs: Use
- default build action when template does not have an explicit build
- action set, instead of assuming BuildAction.Compile. Fixes Bug 427508
- - adding a 'Empty HTML File' to web site is included in build by
- default.
-
-2008-11-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/TransactedTreeBuilder.cs: AddChild
- should not trigger the filling of the parent. If the parent is not
- filled, just do nothing. The new child will be shown when the parent
- is expanded.
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs: Add
- dependent files under the files they depend upon. Fixes bug #436774 -
- Moving aspx with codebehind between directories is incorrect.
-
-2008-11-06 Mike Krüger <mike@icsharpcode.net>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs:
- * MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs: Worked on code
- templates.
-
-2008-11-06 Mike Krüger <mike@icsharpcode.net>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs: fixed
- possible threading problem with class pad update.
-
-2008-11-06 Mike Krüger <mike@icsharpcode.net>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: fixed 'Bug 442047 - 'Go
- to declaration' missing for vars'.
-
-2008-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Bump MD version.
-
-2008-11-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Add null check.
-
-2008-11-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp:
- * MonoDevelop.Ide.Gui/TextEditor.cs:
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs:
- * MonoDevelop.Ide.Gui.Content/ICodeStyleOperations.cs: Remove
- ICodeStyleOperations. Text editors and extensions can handle the
- commands directly with more flexibility.
-
-2008-11-04 Mike Krüger <mike@icsharpcode.net>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: fixed parameter name
- display in refactory commands.
-
-2008-11-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Don't present the errors
- list when tasks are removed. Fixes bug #439919 - Error list popups
- and grab focus.
-
-2008-10-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Fix in TransferFiles. Make a
- copy of the original project files before moving, since MoveDirectory
- will automatically remove the from the project.
-
-2008-10-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: When browsing errors, show
- the activated error message in the status bar. Fixes bug #430493.
-
- * MonoDevelop.Ide.Gui/Pad.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/IWorkbench.cs:
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Gui/IWorkbenchLayout.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Show the build output pad
- in the view list, so it can be made visible even before building a
- project.
-
-2008-10-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp: Fix assembly references.
-
-2008-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Don't crash if the project
- preferences files can't be created.
-
-2008-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/ForwardTextFileIterator.cs: Notify changes
- done in files. Fixes bug 434693 - Status icon doesn't update when
- find/replace is done.
-
-2008-10-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/TextEditor.cs:
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs: Fixed
- 'Bug 436669 - function hints (tooltip) hides typing when typing a
- multi-line function'.
-
-2008-10-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/DebugCommands.cs: Fix the build.
-
-2008-10-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/DebugCommands.cs:
- * MonoDevelop.Ide.Commands/ProjectCommands.cs: Disable the Run and Debug
- commands if the current solution or project can't be executed.
-
-2008-10-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Disable the Run command if
- the current solution or project can't be executed.
-
-2008-10-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: moved ambience extension node to project
- model.
-
-2008-10-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: fixed 'Bug 399737 - Code completion busted
- for referenced assemblies that are not in GAC, are outside of the
- solution, and which are referenced by other non-GAC outside
- referenced assemblies'.
-
-2008-10-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/TextEditor.cs: Added SearchChar function.
-
-2008-10-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Added gui lock/unlock events.
-
-2008-10-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs: fixed
- Bug 434717 - No completion for nullable types.
-
-2008-10-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/NodeCommandHandler.cs: Done some
- changes to allow using command handlers in contexts other than the
- extensible tree.
-
-2008-10-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/StatusProgressMonitor.cs: Escape messages shown in
- dialogs and the status bar. Fixes bug #432287 - Empty warning message
- when trying to open a badly formatted .csproj file.
-
-2008-10-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Commands/FileCommands.cs: Remove unnecessary check.
-
-2008-10-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Commands/FileCommands.cs: Correct >/<= mistake. Fixes
- recent solutions list.
-
-2008-10-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Commands/FileCommands.cs: Add error handling for
- recent solution not existing. Fixes "Bug 437120 - Recent solutions
- list does not handle DirectoryNotFoundException gracefully".
-
-2008-10-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: fixed 'Bug 436871 -
- Automatically inserted text cannot be undone in one move'.
-
-2008-10-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Stored last error free document in
- document.
-
-2008-10-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp: Updated.
-
- * MonoDevelop.Ide.Gui.Content/ISmartIndenter.cs: Sketch out an API for
- smart indent.
-
- * MonoDevelop.Ide.Gui.Content/SmartIndenter.cs: Removed.
-
-2008-10-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/DefaultFind.cs: fixed 'Bug 432845 - Find
- and replace doesn't work'.
-
-2008-10-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs: Track
- APIs.
-
-2008-10-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/TemplateCompletionDataProvider.cs:
- Unused & GPL => remove.
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp: Updated.
-
-2008-10-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Gui.Content/IUrlHandler.cs: Jump to declaration now is
- able to handle dom objects defined in assemblies.
-
-2008-10-08 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/TemplateCompletionDataProvider.cs:
- Implement ICompletionData.Sink and remove CompareTo.
-
-2008-10-08 Andreia Gaita <avidigal@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs: Don't
- show the code completion dialog on keypress if the
- EnableCodeCompletion option is false. (fixes #433288)
-
-2008-10-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/OverridesImplementsDialog.cs: Remove
- unnecessary runtime cast that caused exception.
-
-2008-10-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: delegates are now
- recognized by context menu.
-
-2008-10-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: fixed 'Bug 432856 - Creation and
- editing broken for unsaved files'.
-
-2008-10-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Document doesn't hook up to the
- parser document update anymore.
-
-2008-10-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/IViewHistory.cs,
- MonoDevelop.Ide.Gui/TextNavigationPoint.cs,
- MonoDevelop.Ide.Gui/NavigationHistory.cs,
- MonoDevelop.Ide.Gui/DefaultNavigationPoint.cs,
- MonoDevelop.Ide.Gui/NavigationService.cs,
- MonoDevelop.Ide.Gui/INavigationPoint.cs: Removed old history
- system.
- * MonoDevelop.Ide.Commands/NavigationCommands.cs,
- MonoDevelop.Ide.addin.xml, MonoDevelop.Ide.mdp, Makefile.am,
- MonoDevelop.Ide.Gui/TextFileNavigationPoint.cs,
- MonoDevelop.Ide.Gui/FileNavigationPoint.cs,
- MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/NavigationHistoryService.cs,
- MonoDevelop.Ide.Gui.Content/INavigable.cs: New navigation history
- system. Fixes "Bug 412296 - [PATCH] Make history navigation more
- reliable and intuitive".
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Escape text correctly.
-
-2008-10-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs, MonoDevelop.Ide.Gui/IdeStartup.cs,
- MonoDevelop.Ide/Services.cs: Track removal of service APIs.
-
-2008-10-01 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/ResourceFileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/ProjectDescriptor.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Dialogs/IncludeFilesDialog.cs,
- templates/EmptyTextFile.xft.xml, templates/EmptyXMLFile.xft.xml,
- MonoDevelop.Ide.Gui/RootWorkspace.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs: Track API.
- * MonoDevelop.Ide.Commands/FileCommands.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs,
- MonoDevelop.Ide.addin.xml: Implement solution pad context commands
- for setting properties, setting build action, and showing property
- grid. Includes multi-select support.
-
-2008-09-30 Peter Johanson <peter@peterjohanson.com>
-
- * MonoDevelop.Ide.Commands/EditCommands.cs:
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs:
- * MonoDevelop.Ide.addin.xml: Add a shortcut for joining lines,
- with inspiration from vim's "J" command.
-
-2008-09-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/TemplateCompletionDataProvider.cs:
- implemented IComparer
-
-2008-09-25 Peter Johanson <peter@peterjohanson.com>
-
- * MonoDevelop.Ide.Gui/DocumentSwitcher.cs: Make sure the next document
- is property focused when initially showing the document switcher.
-
-2008-09-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Tasks/TaskService.cs: fixed 'Bug 427433 - Comment
- tags not shown in the task list'.
-
-2008-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/IPadContainer.cs,
- MonoDevelop.Ide.Gui/IWorkbenchLayout.cs,
- MonoDevelop.Ide.Gui/Pad.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Added support for sticky
- dock property.
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs: Dynamically created pads are
- now sticky, so they won't be hidden when switching layouts.
-
-2008-09-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/MethodNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/EventNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/FieldNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/PropertyNodeBuilder.cs: Added
- emitmarkup flag to the class browser entries.
-
-2008-09-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui/Workbench.cs: Handled some possible null
- references.
-
-2008-09-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs: fixed
- code completion issue with empty files.
-
-2008-09-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs: When
- renaming a folder, update the modified project, not the whole
- workspace.
- * MonoDevelop.Ide.Gui/Document.cs: Parse the file after closing the
- document, so unsaved changes are discarded.
- * gtk-gui/gui.stetic: Updated.
-
-2008-09-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/NodeCommandHandler.cs: Fix check for
- availability of multiple delete operation.
-
-2008-09-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: fixed 'Bug 397930 -
- Navigation to generic method not working correctly'.
-
-2008-09-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs: fixed
- 'Bug 427326 – Code Completion: ctrl + S displays the completion
- window'.
-
-2008-09-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/TemplateCompletionDataProvider.cs:
- fixed "Bug 427286 - Code Completion: completion done without
- showing the completion list".
-
-2008-09-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Dom.Parser,
- MonoDevelop.Ide.Dom.Parser/AbstractParser.cs,
- MonoDevelop.Ide.Dom.Parser/ProjectParserService.cs,
- MonoDevelop.Ide.Dom.Parser/IParser.cs,
- MonoDevelop.Ide.Dom.Parser/ProjectDomEventArgs.cs,
- MonoDevelop.Ide.Dom.Parser/ITypeResolveContext.cs,
- MonoDevelop.Ide.Dom.Output,
- MonoDevelop.Ide.Dom.Output/OutputFlags.cs,
- MonoDevelop.Ide.Dom.Output/Ambience.cs,
- MonoDevelop.Ide.Dom.Output/AmbienceService.cs,
- MonoDevelop.Ide.Dom.Output/CsharpAmbience.cs,
- MonoDevelop.Ide.Dom.Output/NetAmbience.cs, MonoDevelop.Ide.Dom,
- MonoDevelop.Ide.Dom/IMember.cs,
- MonoDevelop.Ide.Dom/DomReturnType.cs,
- MonoDevelop.Ide.Dom/DomType.cs,
- MonoDevelop.Ide.Dom/ParameterModifiers.cs,
- MonoDevelop.Ide.Dom/TypeParameter.cs,
- MonoDevelop.Ide.Dom/DomRegion.cs, MonoDevelop.Ide.Dom/DomUsing.cs,
- MonoDevelop.Ide.Dom/IMethod.cs, MonoDevelop.Ide.Dom/Error.cs,
- MonoDevelop.Ide.Dom/IProperty.cs, MonoDevelop.Ide.Dom/IUsing.cs,
- MonoDevelop.Ide.Dom/Comment.cs,
- MonoDevelop.Ide.Dom/DomAttribute.cs,
- MonoDevelop.Ide.Dom/ClassType.cs,
- MonoDevelop.Ide.Dom/IDomVisitor.cs,
- MonoDevelop.Ide.Dom/IAttribute.cs,
- MonoDevelop.Ide.Dom/CompilationUnit.cs,
- MonoDevelop.Ide.Dom/DomMethod.cs,
- MonoDevelop.Ide.Dom/DomParameter.cs,
- MonoDevelop.Ide.Dom/Modifiers.cs, MonoDevelop.Ide.Dom/DomEvent.cs,
- MonoDevelop.Ide.Dom/DomField.cs,
- MonoDevelop.Ide.Dom/DomProperty.cs,
- MonoDevelop.Ide.Dom/ICompilationUnit.cs,
- MonoDevelop.Ide.Dom/IParameter.cs, MonoDevelop.Ide.Dom/IType.cs,
- MonoDevelop.Ide.Dom/IReturnType.cs, MonoDevelop.Ide.Dom/IEvent.cs,
- MonoDevelop.Ide.Dom/AbstractMember.cs,
- MonoDevelop.Ide.Dom/IField.cs, MonoDevelop.Ide.Dom/CommentType.cs,
- MonoDevelop.Ide.Dom/AstLocation.cs,
- MonoDevelop.Ide.Dom/AttributeTarget.cs: Removed dead code.
-
-2008-09-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs: Remove
- debug code.
- * MonoDevelop.Ide.Gui/Document.cs: Don't parse the whole document at
- every key press, do it after a small delay to improve performance.
-
-2008-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp: Updated projects.
-
-2008-09-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Some changes required for unit
- tests.
-
-2008-09-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Don't show refactoring
- commands that modify classes unless the refactoring menu is being
- shown for the file where the class is implemented. Fixes bug
- #402323 - Automatic override/implementation behaves unintuitively.
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs: Save the project after
- adding the file. Fixes bug #420919 - Adding New File To Solution Is
- *NOT* Included In Next Opening of Solution.
-
-2008-09-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs,
- MonoDevelop.Ide.Gui/Document.cs: Prepared code completion unit
- tests.
-
-2008-09-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/TransactedTreeBuilder.cs: Make sure
- the current navigator position is restored when a move operation
- fails.
-
-2008-09-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: changed document update.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Ide.SelectEncodingsDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ExportProjectDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.GoToDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ReplaceDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.BreakpointPropertiesDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TasksPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.CodeGenerationPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs,
- gtk-gui/MonoDevelop.Ide.CodeTemplates.CodeTemplatePanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs,
- gtk-gui/gui.stetic, gtk-gui/MonoDevelop.Ide.DocumentSwitcher.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.AttachToProcessDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.IncludeFilesDialog.cs,
- gtk-gui/objects.xml,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.GotoLineDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs,
- gtk-gui/MonoDevelop.Ide.ExternalTools.ExternalToolPanelWidget.cs,
- gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.Ide.StandardHeaders.NewHeaderTemplateDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ReplaceInFilesDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.RenameItemDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.LoadSavePanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CombineEntryFeatureSelector.cs,
- gtk-gui/MonoDevelop.Ide.OverridesImplementsDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.FeatureSelectorDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AddInsPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.StandardHeaders.StandardHeaderPanel.cs:
- Updated.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs,
- MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs,
- MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPadWidget.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceData.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui/Document.cs, MonoDevelop.Ide.Gui/Ide.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs,
- MonoDevelop.Ide.Gui/RootWorkspace.cs: Track api changes.
- * MonoDevelop.Ide.Gui.Dialogs/EncapsulateFieldDialog.cs: Fix warning.
-
-2008-09-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Worked on fold information update.
-
-2008-09-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui/Document.cs: Changed compilation unit/document
- meta information interface.
-
-2008-09-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.Ide.Gui.Pads.ClassBrowser.ClassBrowserPadWidget.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPadWidget.cs:
- De-uglify new class pad.
- * gtk-gui/objects.xml, Makefile.am, MonoDevelop.Ide.mdp: Updated.
-
-2008-09-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ClassNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/MemberNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/MethodNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/EventNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/FieldNodeBuilder.cs: Worked on
- class pad.
-
-2008-09-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ReferenceNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ClassNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceData.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ClassData.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceNodeBuilder.cs: Worked
- on class pad.
-
-2008-09-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ClassNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/MemberNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/MethodNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPad.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/EventNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ClassData.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/FieldNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/PropertyNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPadWidget.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceNodeBuilder.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs: Worked on class pad
-
-2008-09-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs,
- MonoDevelop.Ide.Gui.Components/TransactedTreeBuilder.cs,
- MonoDevelop.Ide.Gui.Components/NodeCommandHandler.cs,
- MonoDevelop.Ide.Gui.Components/ITreeNavigator.cs,
- MonoDevelop.Ide.Gui.Components/NodeState.cs,
- MonoDevelop.Ide.Gui.Components/TreeBuilder.cs, MonoDevelop.Ide.mdp,
- Makefile.am, MonoDevelop.Ide.Gui.Components/TreeNodeNavigator.cs:
- Implemented support for update locking. When a command is executed,
- all updates to the tree will be postponed until the command
- execution has completed. It avoids crashes due to the tree being
- modified while the command is still iterating on the nodes.
-
-2008-09-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Add some spacing back.
-
-2008-09-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Add a separator between
- the path bar and the secondary view buttions.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am, MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs,
- MonoDevelop.Ide.Gui.Components/TreeBuilder.cs,
- MonoDevelop.Ide.Gui.Components/TreeNodeNavigator.cs,
- MonoDevelop.Ide.Gui.Components/TreeOptions.cs, MonoDevelop.Ide.mdp:
- Move some tree view classes to its own file.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs,
- MonoDevelop.Ide.Gui.Components/NodeState.cs: Missed some class
- renames.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am, MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs,
- MonoDevelop.Ide.Gui.Components/ITreeBuilderContext.cs,
- MonoDevelop.Ide.Gui.Components/MonoDevelopTreeView.cs,
- MonoDevelop.Ide.Gui.Components/NodeCommandHandler.cs,
- MonoDevelop.Ide.Gui.Components/NodeState.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/ClassBrowserPadWidget.cs,
- MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs, MonoDevelop.Ide.mdp:
- Renamed MonoDevelopTreeView to ExtensibleTreeView.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/DocumentStateTracker.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/OverridesImplementsDialog.cs,
- MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs,
- MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs,
- MonoDevelop.Ide.Gui/RootWorkspace.cs,
- MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Tasks/TaskService.cs: Fix warnings.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Added new overload for
- saving lists of workspace items. Fix warnings.
- * MonoDevelop.Ide.Gui.Pads.ClassBrowser/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/WorkspaceNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Components/NodeCommandHandler.cs,
- MonoDevelop.Ide.Gui.Components/MonoDevelopTreeView.cs: Solution pad
- multi-selection fixes and improvements.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/TreePadOption.cs,
- MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs,
- MonoDevelop.Ide.Gui.Pads/ITreeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads/NodeCommandHandler.cs,
- MonoDevelop.Ide.Gui.Pads/ITreeNavigator.cs,
- MonoDevelop.Ide.Gui.Pads/ITreeBuilderContext.cs,
- MonoDevelop.Ide.Gui.Pads/ITreeOptions.cs,
- MonoDevelop.Ide.Gui.Pads/NodeState.cs,
- MonoDevelop.Ide.Gui.Pads/NodeBuilderExtension.cs,
- MonoDevelop.Ide.Gui.Pads/NodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads/NodeAttributes.cs,
- MonoDevelop.Ide.Gui.Pads/DragOperation.cs,
- MonoDevelop.Ide.Gui.Pads/TypeNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads/SolutionPad.cs,
- MonoDevelop.Ide.Gui.Pads/TreeViewItem.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/ClassBrowserPad.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/TypeNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/ClassBrowserPadWidget.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/MemberNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/SolutionNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/ProjectNamespaceBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/MethodNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/EventNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/FieldNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/PropertyNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ClassNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/MemberNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/SolutionNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/MemberNodeCommandHandler.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/WorkspaceNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectSolutionPad.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/LinkedFilesFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Components,
- MonoDevelop.Ide.Gui.Components/NodeAttributes.cs,
- MonoDevelop.Ide.Gui.Components/NodeBuilder.cs,
- MonoDevelop.Ide.Gui.Components/TreePadOption.cs,
- MonoDevelop.Ide.Gui.Components/DragOperation.cs,
- MonoDevelop.Ide.Gui.Components/TypeNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Components/ITreeBuilder.cs,
- MonoDevelop.Ide.Gui.Components/MonoDevelopTreeView.cs,
- MonoDevelop.Ide.Gui.Components/NodeCommandHandler.cs,
- MonoDevelop.Ide.Gui.Components/ITreeNavigator.cs,
- MonoDevelop.Ide.Gui.Components/ITreeBuilderContext.cs,
- MonoDevelop.Ide.Gui.Components/ITreeOptions.cs,
- MonoDevelop.Ide.Gui.Components/NodeState.cs,
- MonoDevelop.Ide.Gui.Components/NodeBuilderExtension.cs,
- MonoDevelop.Ide.Gui.Components/TreeViewItem.cs,
- MonoDevelop.Ide.mdp, Makefile.am,
- MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs,
- MonoDevelop.Ide.Codons/NodeBuilderCodon.cs,
- MonoDevelop.Ide.Codons/PadOptionCodon.cs,
- MonoDevelop.Ide.Codons/SolutionPadCodon.cs: Moved the extensible
- tree view to its own directory.
-
-2008-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Debugging/DebuggingService.cs: Added proper license
- info.
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads/NodeCommandHandler.cs,
- MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs: Some initial support
- for multi-selection in the solution tree.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Added method for saving
- several items at once. Switch to Debug layout when starting a debug
- session.
-
-2008-08-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Debugging/DebuggingService.cs,
- MonoDevelop.Ide.addin.xml: Added debugger factory extension. Moved
- from Mono.Debugging.
- * MonoDevelop.Ide.Gui/ConfigurationComboBox.cs: If the active
- configuration can be found in the combo, set a new valid active
- configuration.
-
-2008-08-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp: Updated.
- * MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs: Handle asterisk as
- expand-all key. Don't leave the tree handle it since it crashes due
- to the lazy loading it does. Fixes bug #401253. Other minor fixes.
-
-2008-08-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Commands/ProjectCommands.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ResourceFolder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ResourceFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs,
- MonoDevelop.Ide.addin.xml, MonoDevelop.Ide.mdp, Makefile.am: Remove
- the "resources folder" feature. Resources are now shown in the
- solution tree like any other files. For a detailed explanation see
- "Bug 381430 - [PATCH] Display resource files in main project tree".
-
-2008-08-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs,
- MonoDevelop.Ide.Gui.Dialogs/RenameItemDialog.cs: Fixed some null
- ref bugs in refactory commands.
-
-2008-08-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs:
- Fix logic in GetParentObject.
- * gtk-gui/objects.xml: Updated.
-
-2008-09-07 Alfonso Santos Luaces <asantosluaces@gmail.com>
- * MonoDevelop.Ide.Gui.Dialogs/ExpressionEvaluatorDialog.cs: Implemented
- basic functionality for an expression evaluator.
-
-2008-08-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs: Remove the workaround for
- "Bug 398353 - Solution pad's state is not restored correctly when
- opening a solution/workspace" now that it's properly fixed by the
- deserialisation fixes in r110397.
-
-2008-08-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/NodeState.cs: Use current node name rather
- than "Node". Along with changes to XmlReadHelper, fixes errors
- restoring solution state "Unknown end node: State valid end nodes
- are: Node".
-
-2008-08-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs: Better workaround for
- "Bug 398353 - Solution pad's state is not restored correctly when
- opening a solution/workspace".
-
-2008-08-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Load documents after restoring pad
- states. Partially works around "Bug 398353 - Solution tree starts
- collapsed regardless of selection".
-
-2008-08-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.mdp, Makefile.am: Renamed file. Fixed
- GetParentObject: GetParentObject should return the solution for
- root folders.
-
-2008-08-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/OverridesImplementsDialog.cs: Fix issue
- with enumerator returned by GetCheckedSiblings. The enumerator
- can't be reused after calling MoveNext.
-
-2008-08-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs,
- MonoDevelop.Ide.Gui.Dialogs/RenameItemDialog.cs: Worked on
- refactory commands.
-
-2008-08-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/DebugCommands.cs, MonoDevelop.Ide.addin.xml:
- Added new breakpoint commands.
- * MonoDevelop.Ide.Debugging/DebuggingService.cs,
- MonoDevelop.Ide.Gui.Dialogs/BreakpointPropertiesDialog.cs,
- MonoDevelop.Ide.mdp,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.BreakpointPropertiesDialog.cs,
- gtk-gui/gui.stetic, Makefile.am: Moved breakpoint properties dialog
- from the debugger add-in. More stuff likely to come here.
-
-2008-08-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Worked on dom.
-
-2008-08-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Added some missing icons to commands.
-
-2008-08-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Debugging/DebuggingService.cs: Fix some warnings. Add
- ActiveThread property.
-
-2008-08-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs,
- MonoDevelop.Ide.Gui.Dialogs/CombineEntryFeatureSelector.cs,
- MonoDevelop.Ide.StandardHeader/StandardHeaderPanel.cs,
- MonoDevelop.Ide.mdp, gtk-gui/objects.xml: Updated.
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs: Don't crash MD if there is
- an exception in the go to dialog.
- * MonoDevelop.Ide.Gui/Document.cs: Request file edit permission when
- saving a document.
-
-2008-08-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: worked on refactory
- commands.
-
-2008-08-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Changed parser
- interface.
-
-2008-07-31 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Escape < so it doesn't get
- handled as GMarkup. Incomplete, but enough for now.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: removed documentation dep.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: fixed todo in
- refactory commands.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide/Services.cs,
- MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/SolutionNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/ProjectNamespaceBuilder.cs,
- MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs,
- MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/MethodNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/EventNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ClassData.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/FieldNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/PropertyNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ClassNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/MemberNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceData.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/MemberNodeCommandHandler.cs,
- MonoDevelop.Ide.Gui.Dialogs/OverridesImplementsDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs,
- MonoDevelop.Ide.Gui/RootWorkspace.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs,
- MonoDevelop.Ide.Gui/Ide.cs, MonoDevelop.Ide.Gui/HelpViewer.cs,
- MonoDevelop.Ide.Tasks/TaskService.cs: Translated old code to new
- dom.
-
-2008-07-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs,
- MonoDevelop.Ide.Gui.Dialogs/OverridesImplementsDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/EncapsulateFieldDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/RenameItemDialog.cs,
- MonoDevelop.Ide.Gui/RootWorkspace.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs: Changes for converted
- refactoring infrastructure.
-
-2008-07-28 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/CurrentProjectDocumentIterator.cs: Be more
- stacktrace friendly (wrt to exception line number).
-
-2008-07-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/ClassBrowserPadWidget.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/MemberNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/ProjectNamespaceBuilder.cs,
- MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs,
- MonoDevelop.Ide.Gui/Document.cs,
- MonoDevelop.Ide.Gui/RootWorkspace.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs: Worked on code
- completion/new dom.
-
-2008-07-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/SmartIndenter.cs: Missed a file. It's not
- used yet, but my local copy of DocumentStateTracker has code
- stubbed using the Indent type from this file, and I've accidentally
- committed it twice already. Hopefully by committing this I can
- avoid breaking the build again...
- * MonoDevelop.Ide.mdp, Makefile.am: Updated.
- * MonoDevelop.Ide.Gui.Pads.ClassBrowser/ClassBrowserPadWidget.cs: Avoid
- unnecessary empty string instantiations.
-
-2008-07-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/DocumentStateTracker.cs: Make consumers
- supply the initial parser object.
-
-2008-07-21 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassBrowser/ClassBrowserPadWidget.cs:
- Ugh, use System.EventArgs in the delegate - current mono svn seems
- to break on this :(
-
- * MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs (Dispose): Override
- Gtk.Object.Dispose().
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs,
- MonoDevelop.Ide.Gui/WorkbenchMemento.cs: Moved serialization engine
- to MonoDevelop.Core. Use new syntax for specifying attribute scope.
-
-2008-07-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Debugging/DebuggingService.cs: Remove test
- catchpoint.
-
-2008-07-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Debugging/DebuggingService.cs: Store breakpoints in
- the user preferences file.
-
-2008-07-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/DebugCommands.cs: Track api changes.
- * MonoDevelop.Ide.Debugging/DebuggingService.cs: Track api changes. Use
- GuiDispatch instead of Invoke to make sure events are delivered in
- the correct order.
- * MonoDevelop.Ide.Gui.Dialogs/AttachToProcessDialog.cs,
- gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.AttachToProcessDialog.cs: Added
- a filter entry to the attach dialog.
-
-2008-07-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs: Worked
- on completion.
-
-2008-07-08 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Commands/ProjectCommands: Disable Run/Debug commands
- for workspaces.
-
-2008-07-08 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Commands/ProjectCommands: Rename "Resume" command to
- "Continue".
-
-2008-07-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/CurrentProjectDocumentIterator.cs: Fixed
- bug in currentprojectdocument iterator.
-
-2008-07-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: reverted some changes.
-
-2008-07-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs,
- MonoDevelop.Ide.Gui/RootWorkspace.cs: Reverted some changes.
-
-2008-07-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs,
- MonoDevelop.Ide.Gui/RootWorkspace.cs: Worked on new dom.
-
-2008-07-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/DebugCommands.cs,
- MonoDevelop.Ide.Debugging/DebuggingService.cs,
- MonoDevelop.Ide.addin.xml: Added ShowDisassembly command.
-
-2008-07-02 Ankit Jain <jankit@novell.com>
-
- * DebugCommands.cs (EnableDisableBreakpointHandler): Disable if there is
- no active document.
-
-2008-07-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/DebugCommands.cs, MonoDevelop.Ide.addin.xml:
- Implemented new debug commands.
- * MonoDevelop.Ide.Debugging/DebuggingService.cs: Update breakpoint
- locations when lines are inserted or removed.
- * MonoDevelop.Ide.mdp: Updated.
-
-2008-06-24 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.Ide.Gui.Pads.ClassBrowser.ClassBrowserPadWidget.cs:
- Removed unused labels.
-
-2008-06-23 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs: Add a
- protected method for subclasses to show the completion window.
-
-2008-06-23 Andrés G. Aragoneses <aaragoneses@novell.com>
-
- Implements feature in bug#323396 (reviewed by Mike Krueger).
-
- * MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs: Use new search
- pattern.
- * MonoDevelop.Ide.mdp, Makefile.am: Updated.
- * MonoDevelop.Ide.Gui.Search/FilesDocumentIterator.cs: Abstract class
- which contains common code for patterns which search in many files
- (contents copied from WholeProjectDocumentIterator).
- * MonoDevelop.Ide.Gui.Search/WholeProjectDocumentIterator.cs: New
- iterator for new search pattern.
- * MonoDevelop.Ide.Gui.Search/CurrentProjectDocumentIterator.cs: New
- file.
- * MonoDevelop.Ide.Gui.Search/WholeCombineDocumentIterator.cs: New file,
- renamed from WholeProjectDocumentIterator, and moved all common
- code with new iterator to FilesDocumentIterator.
- * MonoDevelop.Ide.Gui.Search/SearchReplaceManager.cs: New search
- pattern.
- * MonoDevelop.Ide.Gui.Search/SearchReplaceUtilities.cs: Use the new
- iterator classes.
-
-2008-06-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs: Added tab ==
- reindent option.
-
-2008-06-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/OverridesImplementsDialog.cs: Use new
- bulk implementation interfaces to avoid lots of reparses, and to
- implement interfaces in regions.
-
-2008-06-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/DebugCommands.cs,
- MonoDevelop.Ide.Debugging/DebuggingService.cs,
- MonoDevelop.Ide.addin.xml: Implemented detach.
-
-2008-06-20 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.Ide.Commands/FileCommands.cs: Spelling fix.
-
-2008-06-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/DebugCommands.cs,
- MonoDevelop.Ide.Debugging/DebuggingService.cs,
- MonoDevelop.Ide.Debugging/DebugExecutionHandlerFactory.cs,
- MonoDevelop.Ide.Gui.Dialogs/AttachToProcessDialog.cs,
- MonoDevelop.Ide.addin.xml, MonoDevelop.Ide.mdp, gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.AttachToProcessDialog.cs,
- Makefile.am, MonoDevelop.Ide.Gui/ProjectOperations.cs: Implemented
- attach to process. Some api improvements.
-
-2008-06-20 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/OverridesImplementsDialog.cs:
- Make name column resizable, ellipisize. Show type names as
- "Name (Namespace)"
-
-2008-06-20 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/OverridesImplementsDialog.cs:
- Show members names in the form - "MemberName : Return type"
-
-2008-06-20 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/OverridesImplementsDialog.cs
- (PopulateTreeView): Properly stringify type names also.
-
-2008-06-20 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/EncapsulateFieldDialog.cs: Make
- Field/Property name columns expandable.
-
-2008-06-20 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/OverridesImplementsDialog.cs: New.
- * gtk-gui/MonoDevelop.Ide.OverridesImplementsDialog.cs: New.
- * gtk-gui/gui.stetic: Update.
- * RefactoryCommands.cs (OverrideOrImplementMembers): New.
- * Makefile.am:
- * MonoDevelop.Ide.mdp: Update.
-
-2008-06-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/IdePreferences.cs: Use msbuild as default file
- format.
-
-2008-06-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplateReference.cs: Provide a valid
- .NET identifier from the project name for templating file names.
-
-2008-06-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/NodeCommandHandler.cs,
- MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs: Handle delete commands
- in the base node command handler instead of the tree view, so that
- subclassed command handlers can override them properly.
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs: Don't
- allow deleting child files. Fix bad casting pattern.
- * MonoDevelop.Ide.Tasks/TaskService.cs: Avoid an exception on closing
- solutions without user tasks.
-
-2008-06-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.mdp, Makefile.am: Fixed makefile.
-
-2008-06-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassBrowser/ClassBrowserPadWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Pads.ClassBrowser.ClassBrowserPadWidget.cs:
- Changed class browser widget.
-
-2008-06-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs: Fix
- nullref (bug #400317).
-
-2008-06-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Debugging/DebuggingService.cs: Dispose the debug
- session when done.
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: Track api changes.
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs:
- Updated.
- * Makefile.am: Removed unneeded reference.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Track api changes. Don't
- switch worbench context when debugging.
- * MonoDevelop.Ide.Gui/Workbench.cs: If a file can't be loaded, show an
- error, don't try to open it using an arbitrary display binding.
-
-2008-06-12 Atsushi Enomoto <atsushi@ximian.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs : fixed
- message format string (found by translation).
-
-2008-06-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs: added set for
- indentstyle property.
-
-2008-06-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs: fixed 'Bug
- 393610 - Tab always indents the line and never inserts a tab
- character'.
-
-2008-06-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ResourceFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs: Handle
- adding, removing, drag-n-drop etc for grouped/dependent files.
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs: Allow
- templates to define name of dependency parent.
-
-2008-06-10 Andres G. Aragoneses <aaragoneses@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/ProjectReferencePanel.cs: Implement
- feature to allow unmanaged project references in a managed project
- (bug#397490).
-
-2008-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Fix bug 398179 - Loading
- project with "Solution" tab collapsed to side, exception when
- running.
-
-2008-06-06 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/EncapsulateFieldDialog.cs: More usability
- fixes.
-
-2008-06-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs: Fix potential issue with
- invalidated iters.
-
-2008-06-06 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/EncapsulateFieldDialog.cs: Usability
- improvements suggested by lluis.
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs: Update.
- * gtk-gui/gui.stetic: Update.
-
-2008-06-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs: When handling the Delete
- command, run DeleteItem for only one command handle, since the node
- will probably be gone after that method is called. Should fix Bug
- 396566 - Deleting items in the solution pad often segfaults.
-
-2008-06-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs.in,
- MonoDevelop.Ide.Gui.Dialogs/SharpDevelopAboutPanels.cs,
- MonoDevelop.Ide.Gui.Dialogs/SplashScreen.cs: Show version label in
- the splash and in the about box. Version label is the friendly name
- of the package version.
-
-2008-06-05 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/EncapsulateFieldDialog.cs: Left-align the
- 'read-only' column.
-
-2008-06-05 Ankit Jain <jankit@novell.com>
-
- * EncapsulateFieldDialog.cs (OnOKClicked): Fix order of arguments.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs: Added
- local handling of FindInFile command.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Add missing dependency.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Bump MD version.
-
-2008-06-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/FileCommands.cs: Use destroy to dispose the
- dialog.
-
-2008-06-04 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs
- (BuildRefactoryMenuForItem): Add a "Encapsulate fields" command to the Class
- menu.
- (EncapsulateField): Handle invokation from class menu also.
- * MonoDevelop.Ide.Gui.Dialogs/EncapsulateFieldDialog.cs: Show a list of
- all fields and allow generating properties for multiple fields.
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs: Update.
- * gtk-gui/gui.stetic: Update.
-
-2008-06-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/SplashScreen.cs,
- MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs: Use the OnDestroyed event
- instead of Dispose, since with the latest changes in gtk#, Dispose
- is not called anymore when a widget is destroyed.
-
-2008-06-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs: Make sure the pad
- can't be reused once the monitor operation has started.
- * MonoDevelop.Ide.Debugging/DebugExecutionHandlerFactory.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/SolutionNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs,
- MonoDevelop.Ide.Gui/RootWorkspace.cs: Track api changes.
- StartupItem is now handled by solutions.
- * MonoDevelop.Ide.addin.xml: Register debug execution mode.
-
-2008-06-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Debugging/DebuggingService.cs: Fix current frame
- selection.
-
-2008-05-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Debugging/DebuggingService.cs: Fixes in backtrace
- handling.
-
-2008-05-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs: When the
- Modified event of a project is fired, update the whole tree only if
- it is a change of the base directory. Fixes bug #395670 - Every
- addition to the current project crashes MD.
- * MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs: Made ITreeNavigator more
- reliable against tree changes. Every method now checks if the
- internal iterator is valid, and if it is not, it tries to get a new
- one.
-
-2008-05-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/CombineDescriptor.cs,
- MonoDevelop.Ide.Templates/SolutionItemDescriptor.cs,
- MonoDevelop.Ide.Templates/ProjectTemplate.cs,
- MonoDevelop.Ide.Templates/ISolutionItemDescriptor.cs,
- MonoDevelop.Ide.Templates/ProjectDescriptor.cs: Split solution item
- creation in two steps: creation of the instance, and
- initialization. In this way the new project dialog can create a new
- instance of the project to check availability of features without
- having to expand the whole template.
- * MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs: Fix node
- label.
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: When adding a
- project to an existing solution, always use the solution's format.
- Skip the 'project features' page if there are no features available
- for that kind of project.
-
-2008-05-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs: Fix a
- NRE.
- * MonoDevelop.Ide.Templates/ProjectDescriptor.cs: Log some messages as
- well as throwing up dialog boxes.
-
-2008-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/ITreeNavigator.cs,
- MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs: Implemented
- MoveToNextObject in ITreeNavigator, which moves the navigator to
- the next node containing the same object.
- * MonoDevelop.Ide.Gui/Workbench.cs: When looking for a project to which
- to bind a file being opened, look first in the active projects and
- solutions. Fixes bug 370333 - Wrong file highlighted/selected when
- using external files feature.
-
-2008-05-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs,
- MonoDevelop.Ide.Gui/OutputProgressMonitor.cs: Implement support for
- console logging.
-
-2008-05-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Deactivated on the fly parsing with
- the new dom.
-
-2008-05-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Debugging/DebuggingService.cs: Write debugger output
- to the console. Properly implement Exit().
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs: Updated.
-
-2008-05-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Fixed dispose source
- editor widget bug.
-
-2008-05-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/SolutionNodeBuilder.cs,
- MonoDevelop.Ide.addin.xml, MonoDevelop.Ide.mdp, Makefile.am,
- MonoDevelop.Ide.Gui/RootWorkspace.cs: Disabled the new class
- browser.
-
-2008-05-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Fixed some bugs in the new dom
- parsing.
-
-2008-05-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassBrowser/TypeNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/ClassBrowserPadWidget.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/MemberNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/ProjectNamespaceBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/SolutionNodeBuilder.cs,
- MonoDevelop.Ide.addin.xml, MonoDevelop.Ide.mdp, gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.Ide.Gui.Pads.ClassBrowser.ClassBrowserPadWidget.cs,
- Makefile.am, MonoDevelop.Ide.Gui/Document.cs,
- MonoDevelop.Ide.Gui/RootWorkspace.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs: Added new dom & new class
- browser.
-
-2008-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs: Fix bug
- 362783 - 'Add new file' dialog doesn't handle spaces in names
- propertly.
-
-2008-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs,
- MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/ResourceFileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/FileTemplateReference.cs: Properly
- propagate file creation errors. Fixes bug 361349 - Choosing "No" to
- overwriting an existing file pops up "Invalid file name" dialog.
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs,
- gtk-gui/gui.stetic: Avoid auto-closing of the dialog when clicking
- on OK. This is handled manually.
-
-2008-05-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Avoid crashing if there is a
- problem when loading a parser database. Fixes bug 358124 - Code
- completion prevents project loading.
-
-2008-05-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Moved code for getting a
- wrapper solution (when opening a single project) to ProjectService.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Fix bug 393671 - Creating
- a new empty text file from a freshly loaded MD (no projects loaded)
- throws a NRE.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs: Refresh
- the project when any property changes.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml, MonoDevelop.Ide.Gui/ProjectOperations.cs:
- Show the "Options" command for solution folders, and make sure the
- solution is saved when the options are changed.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Merged the extension points
- for project and solution option panels into a single extension
- point. A single extension point will now be used for all kinds of
- items. Extension conditions can be used to make panels visible only
- for some specific item types.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Track api changes.
-
-2008-05-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs,
- MonoDevelop.Ide.Gui/RootWorkspace.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs,
- MonoDevelop.Ide.Tasks/Task.cs,
- MonoDevelop.Ide.Tasks/CommentTasksView.cs,
- MonoDevelop.Ide.Tasks/TaskService.cs: Replaced
- ICompilerResult/DefaultCompilerResult/CompilerResults by a new
- BuildResult class, which has owner information at error level, so
- it is possible to know which project generated an error when
- building a solution. Updated Task and TaskService to use the new
- owner information.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/IPadContainer.cs,
- MonoDevelop.Ide.Gui/Workbench.cs, MonoDevelop.Ide.Gui/Pad.cs: Avoid
- creating hidden pads when storing workspace preferences.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Fix bug 361084 -
- Dragging a tab to a different position doesn't change its position
- in the tab order.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs: Use the property to access
- ParserDatabase since it lazily creates the object.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Tasks/TaskService.cs: Improved task count updating.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/RootWorkspace.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs: Always try to set a valid
- startup project when the workspace solutions change.
- * MonoDevelop.Ide.Gui/Workbench.cs: Ensure the MD options panel is
- properly destroyed.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateGroup.cs: Fix bug 372041 -
- Additional code template groups are not loaded after a restart.
- Patch by Levi Bard.
-
-2008-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/CombineDescriptor.cs,
- MonoDevelop.Ide.Templates/ISolutionItemFeature.cs,
- MonoDevelop.Ide.Templates/ParentProjectFileTemplateCondition.cs,
- MonoDevelop.Ide.Templates/SolutionItemDescriptor.cs,
- MonoDevelop.Ide.Templates/ProjectTemplate.cs,
- MonoDevelop.Ide.Templates/ISolutionItemDescriptor.cs,
- MonoDevelop.Ide.Templates/ProjectDescriptor.cs,
- MonoDevelop.Ide.Commands/RefactoryCommands.cs,
- MonoDevelop.Ide.Commands/FileCommands.cs,
- MonoDevelop.Ide.Commands/EditCommands.cs,
- MonoDevelop.Ide.Commands/SearchCommands.cs,
- MonoDevelop.Ide.Commands/CustomStringTagProvider.cs,
- MonoDevelop.Ide.Commands/ProjectCommands.cs,
- MonoDevelop.Ide/Services.cs,
- MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs,
- MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs,
- MonoDevelop.Ide.Gui.Pads/FileScout.cs,
- MonoDevelop.Ide.Gui.Pads/SolutionPad.cs,
- MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/ClassBrowserPadWidget.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/SolutionNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs,
- MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/SolutionNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/WorkspaceNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectSolutionPad.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ResourceFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/LinkedFilesFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Dialogs/CombineEntryFeatureSelector.cs,
- MonoDevelop.Ide.Gui.Dialogs/FeatureSelectorDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/SelectReferenceDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/IncludeFilesDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/EncapsulateFieldDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/ExportProjectDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/ProjectReferencePanel.cs,
- MonoDevelop.Ide.Gui.Dialogs/RenameItemDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs,
- MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs,
- MonoDevelop.Ide.Dom.Parser/ProjectParserService.cs,
- MonoDevelop.Ide.addin.xml,
- MonoDevelop.Ide.Dom.Output/NetAmbience.cs, MonoDevelop.Ide.mdp,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ExportProjectDialog.cs,
- gtk-gui/gui.stetic, gtk-gui/objects.xml,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.LoadSavePanelWidget.cs,
- Makefile.am, MonoDevelop.Ide.Gui/Document.cs,
- MonoDevelop.Ide.Gui/IdePreferences.cs,
- MonoDevelop.Ide.Gui/ConfigurationComboBox.cs,
- MonoDevelop.Ide.Gui/RootWorkspace.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs,
- MonoDevelop.Ide.Gui/NavigationService.cs,
- MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/IdeStartup.cs,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs,
- MonoDevelop.Ide.Gui/Ide.cs,
- MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs,
- MonoDevelop.Ide.Gui/WorkbenchMemento.cs,
- MonoDevelop.Ide.Gui/AddEntryEventHandler.cs,
- MonoDevelop.Ide.Codons/ProjectOpenCondition.cs,
- MonoDevelop.Ide.Codons/CombineOpenCondition.cs,
- MonoDevelop.Ide.Tasks/UserTasksView.cs,
- MonoDevelop.Ide.Tasks/UserTask.cs, MonoDevelop.Ide.Tasks/Task.cs,
- MonoDevelop.Ide.Tasks/CommentTasksView.cs,
- MonoDevelop.Ide.Tasks/TaskService.cs,
- MonoDevelop.Ide.Gui.Search/WholeProjectDocumentIterator.cs: New
- project model changes.
-
-2008-05-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: More descriptive
- method name.
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs: Store last selected
- category for each different project and language type.
-
-2008-05-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: Implement restoring
- selection of child categories.
-
-2008-05-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: Restore
- functionality to auto-select last selected category, defaulting to
- C#. Fixes "Bug 392561 - Should default to C# language -> empty
- project when creating new solution/project".
-
-2008-05-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Remove unnecessary
- operation, fixing a Gtk-Warning.
-
-2008-05-20 Zach Lute <zach.lute@gmail.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs: Fixed a NPE if the
- GoToDialog was closed while populating the tree. (Bug #391091)
-
-2008-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Fix bug #375128 - Not all menu items in
- Proper Case. Patch by Gabriel Burt.
-
-2008-05-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/ViewCommands.cs, MonoDevelop.Ide.addin.xml,
- MonoDevelop.Ide.mdp, Makefile.am,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs,
- MonoDevelop.Ide.Gui/Pad.cs, MonoDevelop.Ide.Codons/CategoryNode.cs:
- Added support for view pad categories. When a pad is assigned to a
- category, it will be shown in a submenu in the view menu.
- * MonoDevelop.Ide.Debugging/DebuggingService.cs: Added support for
- changing the current frame of the stack. Added Started event.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Disabled workbench context
- switching when debugging an app.
-
-2008-05-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Fixed 'Bug 387448 - New
- text editor always show same value for "col" and "ch"'
-
-2008-05-01 Aaron Bockover <abockover@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs: Fully reset the thread state
- just to be thorough even though it shouldn't matter because the dialog
- doesn't get reused
-
-2008-05-01 Aaron Bockover <abockover@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs: Got rid of absolutely insane
- threading; previously a thread would be spawned by every single character
- change in the search, also the previous thread would first be _aborted_;
- this caused frequent complete lockups (often leading to data loss),
- excessive resource drain, and suboptimal performance
-
- Replaced with a single thread that uses an AutoResetEvent to wait until
- search work is requested, and never abort this thread - allow search
- iterations to exit safely and return to the wait; also destroy the dialog
- and exit the single thread safely when the dialog is dismissed instead
- of just hiding and reusing it - there's no reason for that other than
- wasting resources and increasing code complexity; some general clean up
-
- * MonoDevelop.Ide.Commands/SearchCommands.cs: Reflected to use the new
- .Run method, what used to be .Show
-
-2008-04-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.mdp: Fix GTK# version to 2.8.
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Use GTK 2.8 API, not 2.10.
-
-2008-04-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/InternalLogPad.cs,
- MonoDevelop.Ide.Gui/InternalLog.cs: Avoid re-registering ILoggers.
-
-2008-04-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/IPathedDocument.cs: Add API for path bar
- * MonoDevelop.Ide.mdp, Makefile.am: Updated.
- * MonoDevelop.Ide.Gui/Document.cs: Use path bar if document supports
- it. Fix looking up content types in text editor extensions.
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Implement path bar.
-
-2008-04-24 Michael Hutchinson <mhutchinson@novell.com>
-
- * gtk-gui/gui.stetic, gtk-gui/MonoDevelop.Ide.DocumentSwitcher.cs,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs,
- MonoDevelop.Ide.Gui/DocumentSwitcher.cs: Fix several GLib warnings
- in the document switcher. Fix the parenting and hinting so it's
- positioned correctly on Compiz. Draw a border so it stands out on
- Metacity and other "flat" window managers.
-
-2008-04-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassBrowser,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/TypeNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/ClassBrowserPad.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/ClassBrowserPadWidget.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/MemberNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/SolutionNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassBrowser/ProjectNamespaceBuilder.cs,
- MonoDevelop.Ide.Dom.Parser/ProjectParserService.cs,
- MonoDevelop.Ide.Dom.Parser/ProjectDomEventArgs.cs,
- MonoDevelop.Ide.Dom.Parser/ITypeResolveContext.cs,
- MonoDevelop.Ide.Dom/IMember.cs,
- MonoDevelop.Ide.Dom/DomReturnType.cs,
- MonoDevelop.Ide.Dom/DomType.cs, MonoDevelop.Ide.Dom/DomMethod.cs,
- MonoDevelop.Ide.Dom/DomParameter.cs,
- MonoDevelop.Ide.Dom/DomEvent.cs, MonoDevelop.Ide.Dom/DomField.cs,
- MonoDevelop.Ide.Dom/DomProperty.cs, MonoDevelop.Ide.Dom/IType.cs,
- MonoDevelop.Ide.Dom/AbstractMember.cs,
- MonoDevelop.Ide.Dom/AstLocation.cs, MonoDevelop.Ide.mdp,
- gtk-gui/MonoDevelop.Ide.Gui.Pads.ClassBrowser.ClassBrowserPadWidget.cs:
- Worked on mcs integration/class browser
-
-2008-04-21 Rafael Teixeira <monoman@gmail.com>
- * MonoDevelop.Ide.Gui.Content/DocumentStateTracker.cs: Make ConsoleWrite
- more robust, because it was causing MonoDevelop to bomb on any keypress.
- Also fixed the specific bad call that was doing MD bomb this time (line 117).
-
-2008-04-17 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/DocumentStateTracker.cs: Move document
- state tracking logic from CSharpBinding to MonoDevelop.Ide.
- * Makefile.am, MonoDevelop.Ide.mdp: Updated.
-
-2008-04-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs: Track
- API change. Remove char code translation hack.
- * MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs: Track API change.
-
-2008-04-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs: Add
- ability for HandleCodeCompletion to alter the trigger word length.
- Allows completions to 'grab' text behind them, including the
- character that was typed.
-
-2008-04-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Dom/DomRegion.cs, MonoDevelop.Ide.Dom/AstLocation.cs:
- Changed the region/location model.
-
-2008-04-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Dom/DomType.cs, MonoDevelop.Ide.Dom/DomMethod.cs,
- MonoDevelop.Ide.Dom/DomField.cs,
- MonoDevelop.Ide.Dom/DomProperty.cs: Worked on some dom classes.
-
-2008-04-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads/FileListItem.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Track api changes.
-
-2008-04-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs: Removed some
- debug code.
-
-2008-04-10 Andres G. Aragoneses <aaragoneses@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs: Improved string
- (redo r66359: http://lists.ximian.com/pipermail/mono-patches/2006-October/081256.html ).
-
-2008-04-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Dom.Parser/ProjectParserService.cs,
- MonoDevelop.Ide.addin.xml: Added extension point for parsers.
-
-2008-04-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs: Fix for "Bug 377810 -
- Many errors when expanding MonoDevelop treeviews with keyboard".
- Also remove debug code.
-
-2008-04-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Dom.Parser/ProjectParserService.cs,
- MonoDevelop.Ide.Dom.Parser/IParser.cs: Changed parser interface a
- bit.
-
-2008-04-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Remove debug code.
-
-2008-04-01 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs: fixed Bug 375387 -
- Sigsegv when 'reloading file'
-
-2008-03-31 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.Ide.DocumentSwitcher.cs,
- MonoDevelop.Ide.Gui/DocumentSwitcher.cs: Worked on document
- switcher. (373578)
-
-2008-03-29 Zach Lute <zach.lute@gmail.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Added support for
- 'Find references' for local variables and parameters. (Bug #351015)
-
-2008-03-21 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Hook GLib/Gtk errors into logging
- service, and remove redundant code.
-
-2008-03-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs,
- MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Fix error CS0165 with csc
- (its flow analysis isn't good enough; the code is fine).
-
-2008-03-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/TextEditor.cs: Add a convenience method for
- discovering the newline style.
- * MonoDevelop.Ide.Gui/Document.cs: Make GetContent search through
- TextEditorExtensions too.
-
-2008-03-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: fixed typo
-
-2008-03-14 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Tasks/Task.cs: Make Task.JumpToPosition() virtual.
- Fixes Gettext addin build.
-
-2008-03-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Dom/IMember.cs,
- MonoDevelop.Ide.Dom/AbstractMember.cs: Added IsObsolete flag to the
- new dom (Bug 367716 - Code completion shows obsolete functions).
-
-2008-03-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/SearchCommands.cs,
- MonoDevelop.Ide.addin.xml: Added emacs like find next/prev.
-
-2008-03-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * options/TipsOfTheDay.xml: Add tips.
-
-2008-03-10 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * MonoDevelop.Ide.StandardHeader/StandardHeaderPanel.cs: Workaround for bug
- in Mono 1.2.4 where usings are ignored in anonymous methods.
-
-2008-03-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/CombineDescriptor.cs,
- MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/CombineEntryDescriptor.cs,
- MonoDevelop.Ide.Templates/ProjectDescriptor.cs,
- MonoDevelop.Ide.Commands/ViewCommands.cs,
- MonoDevelop.Ide.Commands/FileCommands.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs,
- MonoDevelop.Ide.StandardHeader/StandardHeaderPanel.cs,
- MonoDevelop.Ide.Gui.Pads/FileList.cs,
- MonoDevelop.Ide.Gui/Document.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs,
- MonoDevelop.Ide.Gui.Search/SearchReplaceInFilesManager.cs: Use the
- new MessageService.Confirm method instead of AskQuestion where
- possible.
-
-2008-03-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp: Updated.
-
-2008-03-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/ViewCommands.cs,
- MonoDevelop.Ide.Commands/FileCommands.cs,
- MonoDevelop.Ide.Commands/ProjectCommands.cs,
- MonoDevelop.Ide.Commands/WindowCommands.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs: Set
- better descriptions for dynamically generated menu items.
- * MonoDevelop.Ide.addin.xml: Updated command descriptions.
- * MonoDevelop.Ide.Gui/Ide.cs: Show menu item descriptions in the status
- bar.
-
-2008-03-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * icons/navigate-previous*.png:
- * icons/navigate-next*.png:
- * Makefile.am: Sharpen up the prev/next icons for 16x16 px menus.
-
-2008-03-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: Remove redundant
- AsyncDispatchAttributes, and add GUI thread asserts, as the class
- that this replaced was a GuiSyncObject. It probably doesn't need to
- be thread safe, as most out-of-GUI-thread accesses will come from
- StatusProgressMonitor, which is a GuiSyncObject. Anyhow, the
- asserts should catch any problems.
- * MonoDevelop.Ide.Gui.BrowserDisplayBinding/HtmlViewPane.cs: Remove
- redundant field.
-
-2008-03-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/WordCountDialog.cs,
- MonoDevelop.Ide.Gui/ViewCommandHandlers.cs,
- MonoDevelop.Ide.addin.xml,
- MonoDevelop.Ide.Commands/EditCommands.cs: Removed word count
- dialog.
-
-2008-03-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/AddInsOptionsPanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/CodeGenerationPanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs,
- MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs,
- MonoDevelop.Ide.StandardHeader/StandardHeaderPanel.cs,
- MonoDevelop.Ide.addin.xml,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs,
- gtk-gui/gui.stetic, gtk-gui/objects.xml,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ReplaceInFilesDialog.cs,
- MonoDevelop.Ide.Gui/Workbench.cs: Use the new options dialog
- infrastructure.
- * MonoDevelop.Ide.mdp, Makefile.am, icons/text-editor-16.png,
- icons/keyboard-shortcuts-22.png, icons/keyboard-shortcuts-16.png,
- icons/text-editor-22.png: Added new icons.
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TasksPanelWidget.cs: This
- class doesn't need to be public.
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Remove debug code.
-
-2008-03-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs: Changed
- remove file alert.
-
-2008-03-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs: Log
- some info when a template is unparseable.
- * MonoDevelop.Ide.Templates/FileTemplateReference.cs: Allow basic string
- substitutions in the present name in a FileTemplateReference.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Changed file menu for hig.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs,
- MonoDevelop.Ide.Gui/Workbench.cs: Fixed some dialogs for hig compliance.
-
-2008-03-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs,
- MonoDevelop.Ide.Templates/CombineDescriptor.cs,
- MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/CombineEntryDescriptor.cs,
- MonoDevelop.Ide.Templates/ProjectDescriptor.cs,
- MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs,
- MonoDevelop.Ide/Services.cs, MonoDevelop.Ide.Commands/ViewCommands.cs,
- MonoDevelop.Ide.Commands/FileCommands.cs,
- MonoDevelop.Ide.Commands/ToolsCommands.cs,
- MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ResourceFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Dialogs/CombineEntryFeatureSelector.cs,
- MonoDevelop.Ide.Gui.Dialogs/AssemblyReferencePanel.cs,
- MonoDevelop.Ide.Gui.Dialogs/DeleteFileDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/WordCountDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs,
- MonoDevelop.Ide.StandardHeader/StandardHeaderPanel.cs,
- MonoDevelop.Ide.Gui.Pads/FileList.cs, MonoDevelop.Ide.mdp,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.DeleteFileDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs,
- gtk-gui/gui.stetic, gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs, Makefile.am,
- MonoDevelop.Ide.Gui/Document.cs,
- MonoDevelop.Ide.Gui/ViewCommandHandlers.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs,
- MonoDevelop.Ide.Gui/StatusProgressMonitor.cs,
- MonoDevelop.Ide.Gui/Workbench.cs, MonoDevelop.Ide.Gui/IdeStartup.cs,
- MonoDevelop.Ide.Gui/HelpOperations.cs, MonoDevelop.Ide.Gui/Ide.cs,
- MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs,
- MonoDevelop.Ide.Gui.Search/SearchReplaceManager.cs,
- MonoDevelop.Ide.Gui.Search/SearchReplaceInFilesManager.cs: Worked on
- gnome hig compliant alerts.
-
-2008-03-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Enabled clipoard handler
- commands.
- * MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs: Shift+F10 now works for
- context menu
-
-2008-03-02 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * MonoDevelop.Ide.Gui/DocumentSwitcher.cs: Workaraound a bug in mono 1.2.4
- where anonymous delegates ignore usings.
-
-2008-02-29 Zach Lute <zach.lute@gmail.com>
-
- * MonoDevelop.Ide.Commands/FileCommands.cs,
- MonoDevelop.Ide.Commands/SearchCommands.cs,
- options/KeyBindingSchemeEmacs.xml,
- options/KeyBindingSchemeMonoDevelop1.xml,
- options/KeyBindingSchemeVisualStudio.xml,
- options/KeyBindingSchemeDefault.xml, MonoDevelop.Ide.addin.xml: Changed
- OpenFileInSolution command to GoToFile command and moved it into the
- search menu where it rightfully belongs.
- * MonoDevelop.Ide.Gui.Dialogs/GoToDialog.cs: "Go to File" and "Go to Type"
- can now jump to any file or type in the workspace, not just those in the
- currently open solution.
- * MonoDevelop.Ide.Gui.Dialogs/OpenFileInSolutionDialog.cs,
- MonoDevelop.Ide.mdp, gtk-gui/MonoDevelop.Ide.Gui.Dialogs.GoToDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.OpenFileInSolutionDialog.cs,
- gtk-gui/gui.stetic, Makefile.am: Renamed OpenFileInSolutionDialog to
- GoToDialog to better match its usage.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/IEditableTextBuffer.cs,
- MonoDevelop.Ide.Gui.Content/IEditable.cs,
- MonoDevelop.Ide.Gui.Content/ITextBuffer.cs,
- MonoDevelop.Ide.Gui.Content/IPositionable.cs,
- MonoDevelop.Ide.Gui.Content/IClipboardHandler.cs,
- MonoDevelop.Ide.Gui.Dialogs/GotoLineDialog.cs, MonoDevelop.Ide.mdp,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs, Makefile.am,
- MonoDevelop.Ide.Gui/ViewCommandHandlers.cs,
- MonoDevelop.Ide.Gui/TextEditor.cs, MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Refactored content interfaces
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/ISplittable.cs,
- MonoDevelop.Ide.Commands/WindowCommands.cs, MonoDevelop.Ide.addin.xml:
- Added command for switching between splits.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Added many shortcuts.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/IZoomable.cs,
- MonoDevelop.Ide.Commands/ViewCommands.cs, MonoDevelop.Ide.addin.xml:
- Added zoom commands to main menu.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Changed the reload file command to match the
- gnome hig.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Workbench now handles the
- alt+number key for window switching.
-
-2008-02-29 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: changed one menu entry.
-
-2008-02-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/FileCommands.cs,
- MonoDevelop.Ide.Commands/ProjectCommands.cs,
- MonoDevelop.Ide.Commands/WindowCommands.cs, MonoDevelop.Ide.addin.xml,
- MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Worked on main menu: Added
- many missing shortcuts, splitting/printing is now done with a handler
- (no
-
- need to focus the document anymore).
-
-2008-02-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Added missing keyboard shortcut.
-
-2008-02-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs: Fixed
- duplicate error string.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs: Fixed wrong string.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs: removed debug message.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
-
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/gui.stetic: Removed documentswitcher window title.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/SelectStylePanel.cs,
- MonoDevelop.Ide.addin.xml, MonoDevelop.Ide.mdp,
- MonoDevelop.Ide.WindowSwitcher/WindowSwitcher.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs,
- gtk-gui/gui.stetic, gtk-gui/MonoDevelop.Ide.DocumentSwitcher.cs,
- gtk-gui/MonoDevelop.Ide.WindowSwitcher.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.SelectStylePanelWidget.cs,
- Makefile.am, MonoDevelop.Ide.Gui/DefaultWorkbench.cs,
- MonoDevelop.Ide.Gui/DocumentSwitcher.cs: Added an option to turn of the
- new document switcher. Redone the SelectStylePanel.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Dom.Output/Ambience.cs,
- MonoDevelop.Ide.WindowSwitcher/WindowSwitcher.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs,
- gtk-gui/MonoDevelop.Ide.WindowSwitcher.cs,
- MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/IWorkbenchWindow.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Worked on document switcher
- (Ctrl+Tab).
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.mdp, gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.Ide.WindowSwitcher.cs, Makefile.am,
- MonoDevelop.Ide.Gui/DefaultStatusBarService.cs,
- MonoDevelop.Ide.Gui/IStatusBarService.cs,
- MonoDevelop.Ide.Gui/IStatusIcon.cs,
- MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs,
- MonoDevelop.Ide.Gui/InternalLog.cs,
- MonoDevelop.Ide.Gui/StatusProgressMonitor.cs,
- MonoDevelop.Ide.Gui/AddinUpdateHandler.cs,
- MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs,
- MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs,
- MonoDevelop.Ide.Gui/SdStatusBar.cs, MonoDevelop.Ide.Gui/HelpViewer.cs,
- MonoDevelop.Ide.Gui.BrowserDisplayBinding/HtmlViewPane.cs: Refactored
- status bar.
-
-2008-02-27 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Fixed a bug (I accidentally broke some
- view bindings like the assembly browser).
-
-2008-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: fixed tab broken bug.
-
-2008-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/TextNavigationPoint.cs,
- MonoDevelop.Ide.Gui/NavigationService.cs,
- MonoDevelop.Ide.Gui/Workbench.cs: Fixed Bug 364913 - Navigate
- Next/Previous not working.
-
-2008-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Added tab+control,
- tab+shift+control commands for next/prev window.
-
-2008-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Dom/CompilationUnit.cs,
- MonoDevelop.Ide.Dom/ICompilationUnit.cs: Added typecount property.
-
-2008-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/SearchReplaceInFilesManager.cs: Make sure
- end of search events are fired in the gui thread.
-
-2008-02-26 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Added missing _ shortcut.
-
-2008-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: Fixed an error message
- that appeared twice in the translation sheme. (one whitespace
- difference).
-
-2008-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml, MonoDevelop.Ide.Gui/SdStatusBar.cs: Changed 2
- strings.
-
-2008-02-25 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Dom/IMember.cs, MonoDevelop.Ide.Dom/DomType.cs,
- MonoDevelop.Ide.Dom/CompilationUnit.cs,
- MonoDevelop.Ide.Dom/DomMethod.cs, MonoDevelop.Ide.Dom/DomEvent.cs,
- MonoDevelop.Ide.Dom/DomField.cs, MonoDevelop.Ide.Dom/DomProperty.cs,
- MonoDevelop.Ide.Dom/AbstractMember.cs,
- MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs: Worked on assembly browser.
-
-2008-02-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Dom.Output/NetAmbience.cs,
- MonoDevelop.Ide.Dom/DomReturnType.cs, MonoDevelop.Ide.Dom/DomRegion.cs,
- MonoDevelop.Ide.Dom/IProperty.cs, MonoDevelop.Ide.Dom/DomParameter.cs,
- MonoDevelop.Ide.Dom/DomMethod.cs, MonoDevelop.Ide.Dom/DomEvent.cs,
- MonoDevelop.Ide.Dom/DomField.cs, MonoDevelop.Ide.Dom/DomProperty.cs,
- MonoDevelop.Ide.Dom/AbstractMember.cs: Worked on assembly browser.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/ProjectCommands.cs,
- MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs,
- MonoDevelop.Ide.Gui/SdStatusBar.cs: Needed some changes for the nunit
- pad.
-
-2008-02-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/SelectReferenceDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/SelectEncodingsDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/ReplaceDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/AddinLoadErrorDialog.cs,
- MonoDevelop.Ide.mdp,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs,
- gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.FeatureSelectorDialog.cs,
- Makefile.am: Removed some unused glade and gnome-sharp references (only
- the unused). But I'll continue to remove glade, we need to lower the
- dependency tree a bit.
-
-2008-02-22 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/IWorkbenchWindow.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: It's now possible to ovrride
- the multiple view in a single window logic with a custom version.
-
-2008-02-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Added shortcuts for find/replace in files.
-
-2008-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads/NodeCommandHandler.cs,
- MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs: Handle the delete key in
- TreeViewPad, so it will work event if the shortcut is not defined.
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/ProjectCommands.cs, MonoDevelop.Ide.addin.xml:
- Implemented run again command.
-
-2008-02-19 Mike Krüger <mkrueger@novell.com>
-
- * options/KeyBindingSchemeEmacs.xml,
- options/KeyBindingSchemeMonoDevelop1.xml,
- options/KeyBindingSchemeVisualStudio.xml,
- options/KeyBindingSchemeDefault.xml, MonoDevelop.Ide.addin.xml: Removed
- delete key in all keybindings (fixing #363035). Added MonoDevelop 1.0
- key binding.
-
-2008-02-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs: If there are several valid
- node type builders for a type, make sure to pick the most specific one.
-
-2008-02-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs: Fixed tabs2spaces
- option.
-
-2008-02-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs: Completion
- editor extension no longer passes keys throug it processed.
-
-2008-02-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Set some hotkeys to the gnome application
- 'standard' hotkeys.
-
-2008-02-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Dom.Output/Ambience.cs: changed visibility of format
- method
-
-2008-02-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/ExternalToolPanel.cs,
- MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs,
- MonoDevelop.Ide.Dom/DomType.cs, MonoDevelop.Ide.Dom/IType.cs,
- MonoDevelop.Ide.Dom/AbstractMember.cs: Worked on Dom.
- * gtk-gui/MonoDevelop.Ide.ExternalTools.ExternalToolPanelWidget.cs: Moved
- external tool pane.
-
-2008-02-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Dom/IMember.cs, MonoDevelop.Ide.Dom/DomType.cs,
- MonoDevelop.Ide.Dom/IDomItem.cs, MonoDevelop.Ide.Dom/AbstractDomItem.cs,
- MonoDevelop.Ide.Dom/IType.cs, MonoDevelop.Ide.Dom/AbstractMember.cs:
- Refactored dom layer.
-
-2008-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/TextEditorCommands.cs, MonoDevelop.Ide.addin.xml:
- Added new editor commands.
-
-2008-02-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs,
- MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs,
- MonoDevelop.Ide.Gui.Pads/FileScout.cs,
- MonoDevelop.Ide.Gui/StartupInfo.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs, MonoDevelop.Ide.mdp: Use
- Environment.GetFolderPath to get the home directory. Fixes bug #361880.
-
-2008-02-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Allowed to bypass the delete
- event.
-
-2008-02-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Delete action is not longer bound to the delete
- key.
-
-2008-02-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Dispose options dialog when done
- with it. Fixes "Bug 358361 - Have to hit esc twice to close the file/new
- file dialog".
-
-2008-02-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Dom.Output/Ambience.cs,
- MonoDevelop.Ide.Dom.Output/NetAmbience.cs,
- MonoDevelop.Ide.Dom/DomType.cs, MonoDevelop.Ide.Dom/IMethod.cs,
- MonoDevelop.Ide.Dom/IProperty.cs, MonoDevelop.Ide.Dom/IUsing.cs,
- MonoDevelop.Ide.Dom/IDomItem.cs, MonoDevelop.Ide.Dom/IDomVisitor.cs,
- MonoDevelop.Ide.Dom/IAttribute.cs,
- MonoDevelop.Ide.Dom/CompilationUnit.cs,
- MonoDevelop.Ide.Dom/DomMethod.cs, MonoDevelop.Ide.Dom/DomEvent.cs,
- MonoDevelop.Ide.Dom/AbstractDomItem.cs, MonoDevelop.Ide.Dom/DomField.cs,
- MonoDevelop.Ide.Dom/DomProperty.cs,
- MonoDevelop.Ide.Dom/ICompilationUnit.cs,
- MonoDevelop.Ide.Dom/IParameter.cs, MonoDevelop.Ide.Dom/IEvent.cs,
- MonoDevelop.Ide.Dom/IType.cs, MonoDevelop.Ide.Dom/IReturnType.cs,
- MonoDevelop.Ide.Dom/IField.cs: Worked on Dom, added some functions,
- ambiences now using the visitor pattern.
-
-2008-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Dom.Output/Ambience.cs: Fixed ambience format bug.
-
-2008-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Dom.Output/Ambience.cs,
- MonoDevelop.Ide.Dom.Output/NetAmbience.cs: Added ambient comment
- function.
-
-2008-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Dom.Output/OutputFlags.cs,
- MonoDevelop.Ide.Dom.Output/Ambience.cs,
- MonoDevelop.Ide.Dom.Output/NetAmbience.cs: Worked on Dom output.
-
-2008-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs,
- MonoDevelop.Ide.addin.xml: Assembly browser can now be used to open
- referenced assemblies.
-
-2008-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/ITreeNavigator.cs,
- MonoDevelop.Ide.Dom.Output/OutputFlags.cs,
- MonoDevelop.Ide.Dom.Output/Ambience.cs,
- MonoDevelop.Ide.Dom.Output/NetAmbience.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs,
- gtk-gui/gui.stetic, MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs: Worked
- on assembly browser.
-
-2008-02-07 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Dom.Output/OutputFlags.cs,
- MonoDevelop.Ide.Dom.Output/Ambience.cs,
- MonoDevelop.Ide.Dom.Output/AmbienceService.cs,
- MonoDevelop.Ide.Dom.Output/NetAmbience.cs,
- MonoDevelop.Ide.Dom/DomType.cs, MonoDevelop.Ide.Dom/ClassType.cs,
- MonoDevelop.Ide.Dom/Modifiers.cs, MonoDevelop.Ide.Dom/IType.cs: Worked
- on Dom output.
-
-2008-02-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/NodeState.cs,
- MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs: Changed some accessibilities
- to internal.
-
-2008-02-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectSolutionPad.cs,
- MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs,
- MonoDevelop.Ide.Gui.Pads/NodeCommandHandler.cs,
- MonoDevelop.Ide.Gui.Pads/ITreeBuilderContext.cs,
- MonoDevelop.Ide.Gui.Pads/NodeState.cs,
- MonoDevelop.Ide.Gui.Pads/SolutionPad.cs,
- MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs,
- MonoDevelop.Ide.Codons/SolutionPadCodon.cs: Splitted TreeViewPad into
- pad and widget. (I needed the widget elsewhere too.)
-
-2008-02-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/DisplayBindingService.cs: Fixed bug in display binding
- service.
-
-2008-02-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: End build and run operations
- when the solution is closed (which includes closing MD). Fixes "Bug
- 358367 - MD hangs on exit if XSP is still running" and "Bug 356837 -
- Built app doesn't close when solution closes".
-
-2008-02-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/IFoldable.cs,
- MonoDevelop.Ide.Commands/EditCommands.cs, MonoDevelop.Ide.addin.xml,
- MonoDevelop.Ide.mdp, Makefile.am,
- MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Added some folding commands.
-
-2008-02-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Fixed a label.
-
-2008-02-04 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Commands/FileCommands.cs: Dispose new file dialog. Fixes
- "Bug 358361 - Have to hit esc twice to close the file/new file dialog".
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs, gtk-gui/gui.stetic:
- Set title on "New File" window window. Partial workaround for "Bug
- 358370 - Add new file dialog says "unknown" in the window title".
-
-2008-02-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/ICodeStyleOperations.cs,
- MonoDevelop.Ide.Commands/EditCommands.cs, MonoDevelop.Ide.addin.xml,
- MonoDevelop.Ide.Gui/ViewCommandHandlers.cs,
- MonoDevelop.Ide.Gui/TextEditor.cs: Converted comment/uncomment to the
- more common toggle comment logic.
-
-2008-02-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Structured main menu.
-
-2008-02-04 Mike Krüger <mkrueger@novell.com>
-
- * options/KeyBindingSchemeEmacs.xml,
- options/KeyBindingSchemeVisualStudio.xml,
- options/KeyBindingSchemeDefault.xml: Fixed key binding sheme.
-
-2008-02-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/IEditable.cs,
- MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Implemented Bug 323946 -
- Undo/Redo functionality are not context sensitive.
- * MonoDevelop.Ide.mdp: Renamed MonoDevelop.Dom namespace to
- MonoDevelop.Ide.Dom
-
-2008-02-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Dom.Parser/AbstractParser.cs,
- MonoDevelop.Dom.Parser/ProjectParserService.cs,
- MonoDevelop.Dom.Parser/IParser.cs, MonoDevelop.Dom.Parser/ITypeResolveContext.cs,
- MonoDevelop.Dom.Output/Ambience.cs,
- MonoDevelop.Dom.Output/NetAmbience.cs, MonoDevelop.Dom/IMember.cs,
- MonoDevelop.Dom/DomReturnType.cs, MonoDevelop.Dom/DomType.cs,
- MonoDevelop.Dom/TypeParameter.cs, MonoDevelop.Dom/ParameterModifiers.cs,
- MonoDevelop.Dom/DomRegion.cs, MonoDevelop.Dom/DomUsing.cs,
- MonoDevelop.Dom/Error.cs, MonoDevelop.Dom/IMethod.cs,
- MonoDevelop.Dom/IProperty.cs, MonoDevelop.Dom/IUsing.cs,
- MonoDevelop.Dom/Comment.cs, MonoDevelop.Dom/DomAttribute.cs,
- MonoDevelop.Dom/IDomItem.cs, MonoDevelop.Dom/ClassType.cs,
- MonoDevelop.Dom/IDomVisitor.cs, MonoDevelop.Dom/IAttribute.cs,
- MonoDevelop.Dom/DomMethod.cs, MonoDevelop.Dom/DomParameter.cs,
- MonoDevelop.Dom/Modifiers.cs, MonoDevelop.Dom/DomEvent.cs,
- MonoDevelop.Dom/AbstractDomItem.cs, MonoDevelop.Dom/DomField.cs,
- MonoDevelop.Dom/DomProperty.cs, MonoDevelop.Dom/ICompilationUnit.cs,
- MonoDevelop.Dom/IParameter.cs, MonoDevelop.Dom/IReturnType.cs,
- MonoDevelop.Dom/IType.cs, MonoDevelop.Dom/IEvent.cs,
- MonoDevelop.Dom/AbstractMember.cs, MonoDevelop.Dom/IField.cs,
- MonoDevelop.Dom/CommentType.cs, MonoDevelop.Dom/AttributeTarget.cs,
- Makefile.am: Renamed MonoDevelop.Dom namespace to MonoDevelop.Ide.Dom
-
-2008-02-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/ISplittable.cs,
- MonoDevelop.Ide.Gui.Content/IPrintable.cs,
- MonoDevelop.Ide.Commands/FileCommands.cs, MonoDevelop.Ide.addin.xml,
- MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Moved print infrastructure
- to MonoDevelop.Ide.
-
-2008-02-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/ISplittable.cs,
- MonoDevelop.Ide.Commands/WindowCommands.cs, MonoDevelop.Ide.addin.xml,
- MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Added splitting
- infrastructure.
-
-2008-02-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Dom.Parser, MonoDevelop.Dom.Parser/AbstractParser.cs,
- MonoDevelop.Dom.Parser/ProjectParserService.cs,
- MonoDevelop.Dom.Parser/IParser.cs, MonoDevelop.Dom.Parser/ITypeResolveContext.cs,
- MonoDevelop.Dom.Output, MonoDevelop.Dom.Output/Ambience.cs,
- MonoDevelop.Dom.Output/NetAmbience.cs, MonoDevelop.Dom/DomType.cs,
- MonoDevelop.Dom/ClassType.cs, MonoDevelop.Dom/ICompilationUnit.cs,
- MonoDevelop.Dom/IType.cs: Added simple dom parser infrastructure.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Parser database is now loaded on
- demand (slightly improving startup speed).
-
-2008-02-02 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Dom: Added a new dom layer (currently unused - will be for a
- while, I need somithing to test out the new managed text editor).
-
-2008-01-29 Michael Hutchinson <mhutchinson@novell.com>
-
- * icons/navigate-next.png:
- * icons/navigate-previous.png: Pad to 24px so that MD's toolbar
- doesn't stretch them.
-
- * MonoDevelop.Ide.Gui.Dialogs/SharpDevelopAboutPanels.cs: Update
- copyright year to 2008.
-
-2008-01-29 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GotoLineDialog.cs: Small workaround to be able
- to build in mono 1.2.4 (mono 1.2.4 ignores usings in anon delegates).
-
-2008-01-28 Mike Krüger <mkrueger@novell.com>
-
-
-
-2008-01-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/TextEditorCommands.cs,
- MonoDevelop.Ide.Commands/SearchCommands.cs,
- MonoDevelop.Ide.Gui.Dialogs/GotoLineDialog.cs,
- MonoDevelop.Ide.addin.xml, MonoDevelop.Ide.Gui/ViewCommandHandlers.cs,
- MonoDevelop.Ide.Gui/TextEditor.cs: Moved some text editor commands to
- the ide: bookmarks, goto line number and goto matching brace.
-
-2008-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Update MD version.
-
-2008-01-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/FileCommands.cs: Disable the OpenFileInSolution
- command if no solution is open.
- * MonoDevelop.Ide.Gui.Dialogs/OpenFileInSolutionDialog.cs: Disable the open
- button if no row is selected.
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.OpenFileInSolutionDialog.cs,
- gtk-gui/gui.stetic: Updated.
-
-2008-01-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/WordCountDialog.cs: Fix crash when counting
- words in a solution with a translation project. Changed the order of the
- buttons. Execute should be the rightmost.
-
-2008-01-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs: Initialize the resource service before
- initializing the workbench.
-
-2008-01-22 Zach Lute <zach.lute@gmail.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Added --newwindow option to force MD to
- open a new instance instead of passing to a running one. This option is
- forced if opening a combine from the commandline. (Bug #350361)
-
-2008-01-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Use GTK fullscreen icon (was added in 2.8).
-
-2008-01-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs: Force resource service to load so that it
- registers GTK stock icons before the IDE loads. Fixes "Bug 353157 - Many
- toolbar icons aren't showing up".
-
-2008-01-22 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs: Grammar fix.
-
-2008-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs: If a project is selected in
- the solution tree, activate the 'add to project' option by default.
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Added missing null check.
-
-2008-01-20 Ankit Jain <jankit@novell.com>
-
- * templates/EmptyXMLFile.xft.xml:
- * templates/EmptyTextFile.xft.xml: Set BuildAction to Nothing.
-
-2008-01-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Dispose the command manager when
- closing MD. Should fix bug #349484.
-
-2008-01-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp, gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ReplaceDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TasksPanelWidget.cs: Updated.
-
-2008-01-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs: Queue.Peek returns the head
- of the queue, not the tail. Use a field to store the last text write
- request. Made buffer bigger and reduced timeout for updating the
- textview.
- * MonoDevelop.Ide.Gui/OutputProgressMonitor.cs: Make it subclass
- NullProgessMonitor since this class is now gui thread safe.
-
-2008-01-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/OutputProgressMonitor.cs: Avoid going through the gui
- thread to get some simple property values. Fixes bug #354061.
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs: Add missing
- length check.
-
-2008-01-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Remove dead code.
-
-2008-01-15 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs,
- MonoDevelop.Ide.Templates/ProjectTemplate.cs,
- templates/EmptyEnum.xft.xml, templates/EmptyHTMLFile.xft.xml,
- templates/EmptyStruct.xft.xml, templates/EmptyTextFile.xft.xml,
- templates/EmptyClass.xft.xml, templates/AppConfigFile.xft.xml,
- templates/EmptyResourceFile.xft.xml, templates/Workspace.xpt.xml,
- templates/GenericProject.xpt.xml, templates/BlankCombine.xpt.xml,
- templates/EmptyInterface.xft.xml, templates/EmptyXMLFile.xft.xml: Make
- template categories translatable.
- * MonoDevelop.Ide.Templates/CombineEntryDescriptor.cs,
- MonoDevelop.Ide.Templates/ProjectDescriptor.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs: Correct
- grammar.
- * MonoDevelop.Ide.Commands/ViewCommands.cs: Translate layout name, in case
- it's one of the built-in defaults.
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TasksPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs,
- gtk-gui/gui.stetic: Make New Layout window title translatable, and
- correct "underline" to "underscore".
- * MonoDevelop.Ide.Gui/HelpOperations.cs: Make string translatable.
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Make default layout name
- translatable.
-
-2008-01-14 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs: Make strings
- translatable
-
-2008-01-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Fixed 353008: Build command is available
- for Welcome Page but fails.
-
-2008-01-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs: More fixes in transient pad
- management.
-
-2008-01-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs: Really fix placement of
- dynamically created pads.
-
-2008-01-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs: When dynamically creating output
- or search pads, create them next to existing output/search pads.
-
-2008-01-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs,
- MonoDevelop.Ide.Gui.Search/ISearchProgressMonitor.cs,
- MonoDevelop.Ide.Gui.Search/SearchProgressMonitor.cs,
- MonoDevelop.Ide.Gui.Search/SearchReplaceInFilesManager.cs: Improve
- handling of search status messages. Fixes bug #352531.
-
-2008-01-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/SharpDevelopAboutPanels.cs,
- AssemblyInfo.cs.in: Show the complete MD version number in the about
- box. Fixes bug #350625.
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: Updated authors list.
-
-2008-01-09 Marek Safar <marek.safar@gmail.com>
-
- * MonoDevelop.Ide.Tasks/CommentTasksView.cs,
- MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Fixed System.Action ambiguity.
-
-2008-01-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs,
- MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs: Added new method
- for checking if a file template supports a given project.
-
-2008-01-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs:
- Allow creating files where the name is a language keyword, using keyword
- escaping. Fixes some VB.NET ASP.NET templates. Code in templates should
- use ${EscapedIdentifier} instead of ${Name}, or they may create invalid
- code.
-
-2007-12-28 Paul Lange <palango@gmx.de>
-
- * MonoDevelop.Ide.addin.xml: Fix 'Bug 350395 - Use of "New Project/
- Solution" terminology is inconsistent'.
-
-2007-12-28 Zach Lute <zach.lute@gmail.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Methods will no longer show
- up twice in the menu if they are their own enclosing item. (Bug #350810)
-
-2007-12-28 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs,
- MonoDevelop.Ide.Gui/OutputProgressMonitor.cs: More avoiding remoting
- calls, and also dropping excess text before it reaches the TextView.
- Reduce log to 20kb and increase update timeout to 500ms. Now memory use
- is pretty much constant, at least compared to the leak we had before,
- and the UI stays responsive enough to be able to end the child process.
- Statistical profiling indicates that MD is mainly Pango/Gtk/libc6-bound
- now, so we're unlikely to be able to make it much better without
- replacing the output rendering widget.
-
-2007-12-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs,
- MonoDevelop.Ide.Gui/OutputProgressMonitor.cs: Avoid another remoted
- field. Improve comments. Avoid excessively re-launching output handler.
-
-2007-12-27 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs,
- MonoDevelop.Ide.Gui/OutputProgressMonitor.cs: Make the GUI monitor pad
- thread safe for certain operations, with optimisations for large
- quantities raw text. The progress monitor can now avoid two remoting
- calls per line of output to context switch into the GUI thread. This
- also reduces pad updates on the GUI thread to maximum of one per 100ms.
- Fixes "Bug 350611 - MonoDevelop hangs when running program that dumps
- large amounts of output to console". This might be leaking memory, but
- I'm not certain, as it may be fragmentation instead. Either way it's
- better than a hang.
-
-2007-12-20 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplateReference.cs (AddToProject): Use
- 'this.name' instead of 'nameNotUsed' as the filename. Fixes creation of
- asp.net projects.
-
-2007-12-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplateReference.cs: Don't call Create in
- AddToProject because Create opens the files in the editor.
-
-2007-12-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/HelpCommands.cs, MonoDevelop.Ide.addin.xml: Added
- default handler for the help command that starts Monodoc.
-
-2007-12-17 Aaron Bockover <abockover@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: If the monodevelop icon is
- in the default icon theme, make it the default window icon for any of
- the process' windows, otherwise just set the window icon to the old
- resource
-
-2007-12-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/FileCommands.cs: Moved Freedesktop.RecentFiles
- classes to MonoDevelop.Core.Gui namespace.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: By adding new pads just before
- __top/__bottom/__left/__right, the pads will be added in order from left
- to right.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp: Updated project files. The order of extended
- properties won't change anymore.
-
-2007-12-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/EditCommands.cs, MonoDevelop.Ide.addin.xml,
- MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Implemented default handler
- for SelectAll. Disable Edit commands if the selected control is not
- editable. Fixes bug #348599.
-
-2007-12-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Use Home for unindent command and End for
- indent, as it's more intuitive this way. Fixes "Bug 325446 - Strange
- keybindings for indention".
-
-2007-12-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Add unique ids for the CodeDom templates and
- fix an XML typo.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs,
- MonoDevelop.Ide.Templates/FileTemplate.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads/FileList.cs,
- MonoDevelop.Ide.Gui.Pads/FileListItem.cs,
- MonoDevelop.Ide.Gui/DisplayBindingService.cs,
- MonoDevelop.Ide.Gui/ViewCommandHandlers.cs,
- MonoDevelop.Ide.Gui/FileViewer.cs, MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs, MonoDevelop.Ide.Gui/Ide.cs,
- MonoDevelop.Ide.Gui.BrowserDisplayBinding/HtmlViewPane.cs,
- MonoDevelop.Ide.Gui.BrowserDisplayBinding/BrowserDisplayBinding.cs:
- Moved PlatformService to MD.Core.Gui. Removed old FileIconService class,
- which is now implemented in PlatformService.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/EditTemplateGroupDialog.cs,
- MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs,
- MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs,
- MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/LinkedFilesFolder.cs,
- MonoDevelop.Ide.StandardHeader/NewHeaderTemplateDialog.cs,
- MonoDevelop.Ide.StandardHeader/StandardHeaderPanel.cs,
- MonoDevelop.Ide.mdp,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs,
- gtk-gui/gui.stetic, gtk-gui/objects.xml,
- gtk-gui/MonoDevelop.Ide.StandardHeaders.NewHeaderTemplateDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs,
- gtk-gui/MonoDevelop.Ide.NewHeaderTemplateDialog.cs,
- gtk-gui/MonoDevelop.Ide.StandardHeaders.StandardHeaderPanel.cs,
- Makefile.am, MonoDevelop.Ide.Gui/IdeStartup.cs,
- MonoDevelop.Ide.Gui/ExitEventHandler.cs,
- MonoDevelop.Ide.Gui/HelpViewer.cs: API cleanup.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.Ide.CodeTemplates.CodeTemplatePanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CombineEntryFeatureSelector.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.IncludeFilesDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.OpenFileInSolutionDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.ExternalToolPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs,
- gtk-gui/MonoDevelop.Ide.StandardHeaders.StandardHeaderPanel.cs: Updated.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp: Remove unneeded reference.
- * MonoDevelop.Ide.Gui/Ide.cs: Load the previous combine at startup only
- after everything has been properly initialized. Also, don't continue
- until the combine has been fully loaded. Fixes bug #347438.
-
-2007-12-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/TaskListPad.cs,
- MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs,
- MonoDevelop.Ide.Gui.Pads/InternalLogPad.cs: Don't draw shadows in pads
- (the new docking library does that already).
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Bump add-in versions.
-
-2007-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs: Updated.
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Add property to know when the IDE has
- been initialized.
-
-2007-12-11 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs: Remove a debug
- message.
- * MonoDevelop.Ide.Gui.Pads/InternalLogPad.cs: The internal pad's ILogger
- needs to be thread-safe.
-
-2007-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * ChangeLog, MonoDevelop.Ide.Gui.Dialogs/OpenFileInSolutionDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.OpenFileInSolutionDialog.cs,
- gtk-gui/gui.stetic: Minor improvements to OpenFileInSolutionDialog.
- Makes the OpenFileInSolutionDialog taller by default to show more rows.
- Matches types against FullyQualifiedName instead of simply Name. Patch
- by Zach Lute.
-
-2007-12-08 Zach Lute <zach.lute@gmail.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/OpenFileInSolutionDialog.cs: Type searches now
- match against FullyQualifiedName.
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.OpenFileInSolutionDialog.cs,
- gtk-gui/gui.stetic: Made window slightly larger by default.
-
-2007-12-06 Geoff Norton <gnorton@novell.com>
-
- * MonoDevelop.Ide.Gui/DisplayBindingService.cs:
- * MonoDevelop.Ide.Gui/IdeStartup.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui.BrowserDisplayBinding/HtmlViewPane.cs:
- * MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs:
- * MonoDevelop.Ide.Templates/FileTemplate.cs: Access Font/Vfs/Mime information
- from the PlatformService instead of Gnome directly.
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Call Gtk.Application.Init so we can
- remove the dependency on Gnome.Program.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp, Makefile.am: Directory reorganization.
-
-2007-12-03 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs: Make logging call more
- verbose.
- * MonoDevelop.Ide.mdp, MonoDevelop.Ide.Gui/HelpOperations.cs,
- MonoDevelop.Ide.Gui/HelpViewer.cs: Port to IWebBrowser to remove GtkHtml
- dependency. Doesn't yet handle images.
-
-2007-12-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Use gtk icons instead of old gnomeui icons.
- Patch by Michael Monreal.
-
-2007-12-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/HelpViewer.cs: Fixed bug #319086: Can't copy text from
- help view
-
-2007-12-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/EditCommands.cs: Implemented new Insert Header
- command.
- * MonoDevelop.Ide.Gui.Dialogs/CombineEntryFeatureSelector.cs: Avoid showing
- hidden checkboxes.
- * MonoDevelop.Ide.addin.xml: Registered new help and insert header commands.
- * MonoDevelop.Ide.mdp, Makefile.am: Added new files.
- * gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TasksPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs,
- gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.SelectStylePanelWidget.cs:
- Updated.
- * MonoDevelop.Ide.Gui/NavigationHistory.cs: The navigation widget is now a
- MenuToolButton, in this way the command handler can directly add it to
- the toolbar and will be aware of toolbar style changes.
- * MonoDevelop.Ide.Gui/ToolbarComboBox.cs,
- MonoDevelop.Ide.Gui/ConfigurationComboBox.cs,
- MonoDevelop.Ide.Gui/LayoutComboBox.cs: Update the configuration and
- layout combos when the the size of the toolbar changes.
-
-2007-11-30 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.BrowserDisplayBinding/HtmlViewPane.cs,
- MonoDevelop.Ide.Gui.BrowserDisplayBinding/BrowserDisplayBinding.cs: Use
- abstracted BrowserService instead of Mozilla/GeckoSharp.
-
-2007-11-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.BrowserDisplayBinding/BrowserDisplayBinding.cs,
- MonoDevelop.Ide.Gui.BrowserDisplayBinding/HtmlViewPane.cs,
- MonoDevelop.Ide.Gui.Content/IClipboardHandler.cs,
- MonoDevelop.Ide.Gui.Search/BruteForceSearchStrategy.cs,
- MonoDevelop.Ide.Gui.Search/SearchOptions.cs,
- MonoDevelop.Ide.Gui.Search/WildcardSearchStrategy.cs: Remove reference
- to old namespace.
-
-2007-11-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs,
- MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- StandardHeaderService now takes care of replacing variables used in the
- header.
-
-2007-11-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am, MonoDevelop.Ide.Gui.BrowserDisplayBinding/HTMLInterfaces.cs,
- MonoDevelop.Ide.Gui.Dialogs/AddWebReferenceDialog.cs,
- MonoDevelop.Ide.Gui.Undo,
- MonoDevelop.Ide.Gui.Undo/IUndoableOperation.cs,
- MonoDevelop.Ide.Gui.Undo/UndoQueue.cs,
- MonoDevelop.Ide.Gui.Undo/UndoStack.cs, templates/Workspace.xpt.xml,
- MonoDevelop.Ide.mdp: Removed unused files. Added Workspace template.
-
-2007-11-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/ExternalToolPanel.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs,
- MonoDevelop.Ide.Gui.Pads/FileListItem.cs,
- MonoDevelop.Ide.Gui.Pads/FileScout.cs,
- MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs,
- MonoDevelop.Ide.Gui.Pads/TreeViewItem.cs,
- MonoDevelop.Ide.Gui.Search/ExtendedStreamReader.cs,
- MonoDevelop.Ide.Gui.Search/ForwardTextFileIterator.cs,
- MonoDevelop.Ide.Gui.Search/IDocumentInformation.cs,
- MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/ICombineEntryFeature.cs,
- MonoDevelop.Ide.Templates/INewFileCreator.cs: Added missing license
- headers.
-
-2007-11-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Codons/CombineOpenCondition.cs,
- MonoDevelop.Ide.Codons/ProjectActiveCondition.cs: Changed license
- header. This class was reimplemented after migration to Mono.Addins.
- * MonoDevelop.Ide.Codons/LanguageActiveCondition.cs,
- MonoDevelop.Ide.Codons/WorkbenchContextCondition.cs,
- MonoDevelop.Ide.Commands/DebugCommands.cs,
- MonoDevelop.Ide.Commands/NavigationCommands.cs,
- MonoDevelop.Ide.Commands/TextEditorCommands.cs,
- MonoDevelop.Ide.Gui.Content/ICodeStyleOperations.cs,
- MonoDevelop.Ide.Gui.Content/IExtensibleTextEditor.cs,
- MonoDevelop.Ide.Gui.Content/IndentStyle.cs,
- MonoDevelop.Ide.Gui.Content/IViewHistory.cs,
- MonoDevelop.Ide.Gui.Dialogs/CombineEntryFeatureSelector.cs,
- MonoDevelop.Ide.Gui.Dialogs/DeleteFileDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/EncapsulateFieldDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/ExportProjectDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/FeatureSelectorDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/RenameItemDialog.cs,
- MonoDevelop.Ide.Gui/AddEntryEventHandler.cs,
- MonoDevelop.Ide.Gui/DefaultDisplayBinding.cs,
- MonoDevelop.Ide.Gui/DragNotebook.cs, MonoDevelop.Ide.Gui/FileViewer.cs,
- MonoDevelop.Ide.Gui/HelpViewer.cs,
- MonoDevelop.Ide.Gui/OutputProgressMonitor.cs,
- MonoDevelop.Ide.Gui/TextEditor.cs, MonoDevelop.Ide/Services.cs: Added
- missing header.
- * MonoDevelop.Ide.Commands/FileCommands.cs: Remove old namespace.
- * MonoDevelop.Ide.Gui/Ide.cs: Removed old namespace.
-
-2007-11-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Capture previous value of
- MONO_MANAGED_WATCHER in the case where MD overrides it, and assign the
- old value to processes launched from MD. Fixes "Bug 342965 - When
- running my program from monodevelop (F5) MONO_MANAGED_WATCHER is
- enabled".
-
-2007-11-19 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/InternalLog.cs: Fix error notification
- configurability.
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Remove unused field.
-
-2007-11-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Codons/FileFilterCodon.cs,
- MonoDevelop.Ide.Codons/PadOptionCodon.cs,
- MonoDevelop.Ide.Codons/PadCodon.cs,
- MonoDevelop.Ide.Codons/TaskListViewCodon.cs: Made some extension node
- attributes serializable.
- * MonoDevelop.Ide.Templates/FileTemplate.cs,
- MonoDevelop.Ide.Templates/ProjectTemplate.cs: Use the add-in localizer
- to localize template names and descriptions.
-
-2007-11-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/InternalLogPad.cs: Log pad buttons' sensitive
- status and tooltips now reflect whether the relevant logging levels are
- enabled.
-
-2007-11-13 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/InternalLogPad.cs: Track LogLevel enum split.
- * MonoDevelop.Ide.Gui/InternalLog.cs: Track LogLevel enum split. Override
- GetHashcode to suppress warning. Use environment variable to set logging
- level.
-
-2007-11-13 Zach Lute <zach.lute@gmail.com>
-
- * MonoDevelop.Ide.Gui/AbstractViewContent.cs: Fix for Bug #338594 - MD title
- does not display first 2 characters of any source file.
-
-2007-11-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs,
- MonoDevelop.Ide.Gui.Search/SearchReplaceInFilesManager.cs: Fixed "Bug
- 325408 - 'Stop' button is never insensitive".
-
-2007-11-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectSolutionPad.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs: Added property for getting the
- current selected item in the project solution.
-
-2007-11-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs: In the
- Include Folder to Project command, don't include hidden subfolders.
- Fixes bug #339444.
-
-2007-11-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs: Removed some unneeded
- shadows.
- * MonoDevelop.Ide.Gui.Pads/FileListItem.cs: Make file and folder icons
- smaller.
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Use new ContentRequired event
- to lazily create the pads. Track api changes.
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Run refactoring operations
- in an atomic undo change.
-
-2007-11-09 Zach Lute <zach.lute@gmail.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs: Select the search
- pattern in the ReplaceInFilesDialog on open for quick replacement.
-
-2007-11-09 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs,
- MonoDevelop.Ide.Templates/ProjectTemplate.cs,
- MonoDevelop.Ide.ExternalTools/ExternalToolService.cs,
- MonoDevelop.Ide.Gui.Dialogs/AssemblyReferencePanel.cs,
- MonoDevelop.Ide.Gui.Dialogs/SelectEncodingsDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs,
- MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs,
- MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs,
- MonoDevelop.Ide.Gui.Pads/TaskListPad.cs,
- MonoDevelop.Ide.Gui.Pads/NodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs,
- MonoDevelop.Ide.Gui.Pads/InternalLogPad.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs,
- MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs,
- MonoDevelop.Ide.Gui/InternalLog.cs,
- MonoDevelop.Ide.Gui/NavigationService.cs,
- MonoDevelop.Ide.Gui/IdeStartup.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs, MonoDevelop.Ide.Gui/Ide.cs,
- MonoDevelop.Ide.Gui/HelpViewer.cs, MonoDevelop.Ide.Tasks/TaskService.cs,
- MonoDevelop.Ide.Gui.BrowserDisplayBinding/HtmlViewPane.cs,
- MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs: Track
- LoggingService API changes.
- * MonoDevelop.Ide.mdp, Makefile.am: Remove log4net dependency.
-
-2007-11-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs,
- MonoDevelop.Ide.Gui.Pads/FileScout.cs,
- MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Remove some shadows and
- frames.
- * MonoDevelop.Ide.mdp, Makefile.am: Updated.
- * MonoDevelop.Ide.Gui/DragNotebook.cs: Moved from old docking lib.
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Removed old namespace
- references.
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Removed unused code.
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Use the new docking library.
- * MonoDevelop.Ide.Gui/Ide.cs: Make sure all properties are saved when
- exiting MD.
-
-2007-11-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Fix crash opening a file when there is
- no solution open.
-
-2007-11-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/IEditable.cs: TextChanged event now reports
- character offsets.
- * MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs: Add TextChanged
- handler.
- * MonoDevelop.Ide.Gui/TextEditor.cs,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Track API change.
-
-2007-11-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Make sure that
- IncludeFilesDialog is constructed in the GUI thread. Fixes "Bug 338268 -
- Automatic search for new files dialog segfaults MD".
-
-2007-11-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.StandardHeader/StandardHeaderTemplates.xml: Added GPLv3 to
- the standard headers.
-
-2007-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ResourceFolderNodeBuilder.cs: Set a
- better title for the Add Resource dialog.
-
-2007-11-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Don't display the "Find
- References" command for sealed classes, enums, structs and delegates.
- Fixes bug #338385.
-
-2007-11-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/CustomStringTagProvider.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/ProjectReferencePanel.cs: Use RootCombine
- instead of CurrentOpenCombine when possible.
- * MonoDevelop.Ide.Gui/Workbench.cs: Factorized some code.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Bump MD version.
-
-2007-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs: ScrollToIter is based on
- heights computed in an idle handler, so it doesn't work here because it
- is called before the height computations. Use ScrollToMark instead,
- which does not have this problem.
-
-2007-10-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.BrowserDisplayBinding/HtmlViewPane.cs,
- MonoDevelop.Ide.Gui/HelpViewer.cs: Destroy the view widget when the view
- is disposed.
-
-2007-10-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs,
- templates/EmptyEnum.xft.xml, templates/EmptyStruct.xft.xml,
- templates/EmptyClass.xft.xml, templates/EmptyInterface.xft.xml: Use
- tango file icons.
-
-2007-10-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs,
- MonoDevelop.Ide.addin.xml: Track api changes.
- * templates/GenericProject.xpt.xml, templates/BlankCombine.xpt.xml: Use new
- icon names.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/ICombineEntryFeature.cs,
- MonoDevelop.Ide.Gui.Dialogs/CombineEntryFeatureSelector.cs: Show a
- description of each feature to make it more clear what can it be used
- for.
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs,
- gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs: Updated.
-
-2007-10-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/OpenFileInSolutionDialog.cs: Fixed "Bug 324943
- - PageUp/PageDown not working in Open File in Project dialog".
-
-2007-10-23 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs: Changed the behaviour of
- the output pads (Bug 325492 - application output buggy). Autoscrolling
- is now enabled when scrolling to the bottom of the output.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/ProjectReferencePanel.cs: Fix sorting of the
- project list. Fixes bug #335575.
-
-2007-10-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceNodeBuilder.cs: Some tree
- update fixes. If a new class is added, don't show it if the namespace
- branch is not expanded.
- * MonoDevelop.Ide.mdp: Updated.
-
-2007-10-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Some command category fixes.
-
-2007-10-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Added shortcuts for navigate back/forward.
-
-2007-10-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/FileList.cs: File list should not be reorderable.
- Fixes bug #323471.
- * gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs: Updated.
-
-2007-10-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs: Fixed "Bug 325492 -
- application output buggy".
-
-2007-10-15 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs: Fixed "Bug 326313 -
- MD does not remember my Find in Files settings".
-
-2007-10-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: The HIG states that for dialogs that don't need
- user interaction for the action to complete (Preferences, About, Plugin
- managers etc), we don't need ellipses in the menu name. Also, removed
- the "MonoDevelop" from "MonoDevelop Preferences" in the preferences tree
- (not the title). The application name has no use there and leads to the
- treeview needing a horizontal scrollbar, which looks bad. Patch by
- Michael Monreal.
-
-2007-10-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/ExternalToolPanel.cs,
- MonoDevelop.Ide.Templates/FileTemplate.cs,
- MonoDevelop.Ide.Templates/CombineDescriptor.cs,
- MonoDevelop.Ide.Templates/TextTemplate.cs,
- MonoDevelop.Ide.Templates/ProjectDescriptor.cs,
- MonoDevelop.Ide.Commands/ProjectCommands.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolder.cs,
- MonoDevelop.Ide.Gui.Dialogs/IncludeFilesDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/RenameItemDialog.cs,
- MonoDevelop.Ide.Gui.Pads/FileList.cs,
- MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs,
- MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs,
- MonoDevelop.Ide.Gui/Document.cs,
- MonoDevelop.Ide.Gui/AbstractViewContent.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs,
- MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs, MonoDevelop.Ide.Gui/Ide.cs,
- MonoDevelop.Ide.Tasks/CommentTasksView.cs: Applied changes that were
- neccassary for to the new FileService.
-
-2007-10-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Templates/CombineDescriptor.cs,
- MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/CombineEntryDescriptor.cs,
- MonoDevelop.Ide.Templates/ProjectDescriptor.cs,
- MonoDevelop.Ide.Commands/ToolsCommands.cs,
- MonoDevelop.Ide.Commands/CustomStringTagProvider.cs,
- MonoDevelop.Ide.Gui.Dialogs/TipOfTheDay.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs,
- MonoDevelop.Ide.Gui/DefaultStatusBarService.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs, MonoDevelop.Ide.Gui/Ide.cs,
- MonoDevelop.Ide.Codons/FileFilterCodon.cs: Changed calls for the new
- StringParser.
-
-2007-10-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/SelectStylePanel.cs, gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.SelectStylePanelWidget.cs:
- Allow selecting Menu size for toolbars.
-
-2007-10-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/SelectStylePanel.cs,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Fixed "bug 324758 -
- Configurable size of toolbar icons".
-
-2007-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Refactory commands are now
- using ambiences.
-
-2007-10-09 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: added method to project
- operations.
-
-2007-10-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Fixed Bug 325223 -
- Interface refactory doesn't implement correctly (4 bugs).
-
-2007-10-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.StandardHeader/StandardHeaderPanel.cs: Overworked the
- standard header panel, fixing issue "Bug 331657 - Standard header
- settings are not saved".
-
-2007-10-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs,
- MonoDevelop.Ide.Templates/TextFileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs: fixed bug
- 328817 - New created file use Tab with Convert Tab to spaces enabled.
-
-2007-10-05 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Commands/ProjectCommands.cs
- (ExportProjectHandler.Update): Use CurrentSelectedCombineEntry instead
- of CurrentOpenCombine.
-
-2007-10-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Show 'go to base' command
- only for classes. Fixes bug #325461.
-
-2007-10-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs: Save the project
- after adding a folder. Fixes bug #325467.
-
-2007-10-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Tasks/TaskService.cs: Fixed bug 325537 - Task Pad not
- clearing
-
-2007-10-03 Zach Lute <zach.lute@gmail.com>
-
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs,
- gtk-gui/gui.stetic: "New" button now returns "OK" response so new
- layout will actually be created. (Bug #330104)
-
-2007-10-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Avoid crash in ShowNext/Previous when
- the provided location does not have a valid file name.
-
-2007-10-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs,
- MonoDevelop.Ide.Commands/TextEditorCommands.cs,
- MonoDevelop.Ide.addin.xml: Implemented the "Show Parameter List"
- command. Added some overridables to CompletionTextEditorExtension to
- support it.
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Fix warning.
-
-2007-10-02 Ben Motmans <ben.motmans@gmail.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs: Disable the
- Delete command if the root combine is selected
-
-2007-10-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs: Never insert
- the namespace name of the class when completing a class from the
- ctrl+space list. Fixes bug #328804.
-
-2007-09-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/CombineEntryFeatureSelector.cs: Make sure
- project features enabled by default are properly applied.
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Remove debug code.
-
-2007-09-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp: Fix warning level.
- * MonoDevelop.Ide.Gui/Workbench.cs: Use the TextEditorProperties class to
- get the Properties object for the editor. Save the properties just after
- closing the options dialog.
-
-2007-09-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * icons/Icons.AboutImage, icons/SplashScreen.png: New logo.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Bump MD version.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs: Revert last change, it's causing
- a regression.
-
-2007-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs: Always check HasChildNodes before
- calling BuildChildNodes. Notice that extensions may add new nodes, even
- if the original node builder returns HasChildNodes=false.
-
-2007-09-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/OpenFileInSolutionDialog.cs: Make sure icons
- are constructed in the gui thread (just in case). UpdateList doesn't
- need to perform the search if the dialog is not visible. Fixes a crash
- when hidding and showing the dialog.
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Print unhandled exception to the
- output.
-
-2007-09-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Added an Other section in the MD property
- dialog and moved some options there to avoid too many branches.
-
-2007-09-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/OutputProgressMonitor.cs,
- MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs: Show output errors in
- red.
-
-2007-09-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs: Make ILocationListPad
- implementation work again. GetSelected doesn't work for multi-selection
- lists.
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Make sure GetNextLocation
- returns the first row after a compilation. Looks like when the pad is
- focused, the first row is automatically selected, so we need a flag to
- ignore that selection if the list has been cleared out.
-
-2007-09-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.DeleteFileDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.CodeGenerationPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.IncludeFilesDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.ExternalToolPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.LoadSavePanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.FeatureSelectorDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.SelectStylePanelWidget.cs:
- Updated.
- * MonoDevelop.Ide.Gui/Workbench.cs: In SaveAll, make a copy of the documents
- list, since it may change.
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Registered exception handler in
- GLib.ExceptionManager.
-
-2007-09-15 Jérémie Laval <jeremie.laval@gmail.com>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs: Added Properties property
- that return the private Properties object to allow other class to suscribe to
- the PropertyChanged event.
-
-2007-09-15 Andrés G. Aragoneses <knocte@gmail.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs: align
- message style with rest of similar messages.
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs: fix typo.
- * MonoDevelop.Ide.addin.xml: corrected bogus label, for l10n.
- * gtk-gui/gui.stetic: Fix typo in message, don't translate "page#" or "button#"
- texts, removed bogus labels from l10n.
- * MonoDevelop.Ide.mdp: Replace Gtk#2.10 with 2.8 references.
-
-2007-09-15 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs (IdeApp.Initialized): Rename this property
- to IsInitialized. And add new event named Initialized.
-
-2007-09-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.DeleteFileDialog.cs,
- gtk-gui/MonoDevelop.Ide.SelectEncodingsDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ExportProjectDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ReplaceDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TasksPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.CodeGenerationPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.OpenFileInSolutionDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs,
- gtk-gui/MonoDevelop.Ide.CodeTemplates.CodeTemplatePanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.IncludeFilesDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.ExternalToolPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs,
- gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ReplaceInFilesDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.RenameItemDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs,
- gtk-gui/MonoDevelop.Ide.NewHeaderTemplateDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.LoadSavePanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CombineEntryFeatureSelector.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.FeatureSelectorDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.SelectStylePanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AddInsPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.StandardHeaders.StandardHeaderPanel.cs: Updated.
-
-2007-09-14 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Fixed 82823: Can't go to
- class declaration.
-
-2007-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/LinkedFilesFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs: Make sure
- GetParentObject works for files external to projects. Fixes bug #82804.
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui/IdeStartup.cs: Fix warnings.
-
-2007-09-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Implemented 82241: Can't
- navigate to the base method.
-
-2007-09-10 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs: Add additional check to
- IsValidName.
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs: Add some more
- substitution tags. New AddStandardHeader attribute can be used to enable
- stanadrd headers; it defaults to disabled.
- * MonoDevelop.Ide.Templates/ParentProjectFileTemplateCondition.cs: Replace
- RelativePath filter with ExcludedCreationPaths, PermittedCreationPaths,
- RequiredFiles and ExcludedFiles filters.
- * MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs: Set
- AddStandardHeader to true if unset (these templates are always code
- files).
- * MonoDevelop.Ide.Templates/PartialTypeFileTemplateCondition.cs: Add a FIXME
- note.
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs: Fix missing null assignment
- bug that made text field uneditable after selecting template with
- IsFixedName set to true.
-
-2007-09-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: When restoring the active file
- after opening a solution, make sure the document is not already
- disposed. Should fix bug #82538. Also, store line/column information of
- open files in the solution user preferences.
-
-2007-09-10 <>
-
- * MonoDevelop.Ide.Tasks/UserTasksView.cs,
- MonoDevelop.Ide.Tasks/CommentTasksView.cs: Worked on 82733: Tasklist
- showing empty.
-
-2007-09-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/PartialTypeFileTemplateCondition.cs: Add a
- "Disabled" option to PartialTypeRequirement.
-
-2007-09-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs,
- MonoDevelop.Ide.Templates/FileTemplateCondition.cs,
- MonoDevelop.Ide.Templates/ParentProjectFileTemplateCondition.cs,
- MonoDevelop.Ide.Templates/ClrVersionFileTemplateCondition.cs,
- MonoDevelop.Ide.Templates/PartialTypeFileTemplateCondition.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs, MonoDevelop.Ide.addin.xml:
- Add support for file templates with fixed names and for suggesting
- default filenames. Add support for filtering on selected project
- directory. Remove defunct FileTemplate.FileOptions element.
- * MonoDevelop.Ide.mdp, Makefile.am: Updated.
-
-2007-09-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs,
- MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs, MonoDevelop.Ide.mdp,
- Makefile.am: Split TextEditorExtension in two. All code related to code
- completion has been moved to the new subclass
- CompletionTextEditorExtension.
- * MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs: Fix
- warning.
-
-2007-09-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs: Set the correct title
- when not in replace mode. Fixes bug #82698.
-
-2007-09-06 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs,
- MonoDevelop.Ide.Templates/FileTemplateCondition.cs,
- MonoDevelop.Ide.addin.xml,
- MonoDevelop.Ide.Codons/FileTemplateConditionTypeCodon.cs: Moved
- project/language filtering code from NewFileDialog into file template
- classes. Added an extension point (FileTemplateCondition) for extending
- the filters.
- * MonoDevelop.Ide.Templates/ClrVersionFileTemplateCondition.cs: New
- FileTemplateCondition to filter templates on project CLR version and on
- whether partial types are supported.
- * MonoDevelop.Ide.Templates/PartialTypeFileTemplateCondition.cs: New
- FileTemplateCondition to filter templates on whether partial types are
- supported by the project.
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs: Move filtering code from the
- dialog into the templates. Switch to generic collections. Re-enable
- persisting selected category.
- * Makefile.am, MonoDevelop.Ide.mdp: Updated.
-
-2007-09-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs,
- MonoDevelop.Ide.Gui.Pads/NodeBuilder.cs: Made the tree view pad safer
- against exceptions thrown by node builders implemented in add-ins.
-
-2007-09-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs: Add a property
- to enable suppressing auto-opening the file (for CodeBehind).
-
-2007-09-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs: Add GetTemplateByID internal
- method. Convert to generic collections.
- * MonoDevelop.Ide.Templates/FileTemplateReference.cs: New file template
- class which allows project and file templates to reference existing file
- templates by ID.
- * MonoDevelop.Ide.addin.xml, MonoDevelop.Ide.mdp, Makefile.am: Updated.
-
-2007-09-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/NodeState.cs: Fix build.
-
-2007-09-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/NodeState.cs: Fixed little issue in NodeState.
-
-2007-09-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs,
- MonoDevelop.Ide.Gui.Pads/NodeState.cs, MonoDevelop.Ide.Gui/Document.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Updated to the
- ICustomXmlSerializer infrastructure.
-
-2007-09-05 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs: Add
- support for displaying the CodeDom autogeneration notice (useful for
- designer-maintained partial classes).
-
-2007-09-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/NodeState.cs: Option values must be loaded as
- boolean.
-
-2007-09-04 Michael Hutchinson <MHutchinson@novell.com>
-
- * MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs: Use
- non-deprecated CodeDom parse API. Some refactoring.
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs: Updated.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Show warnings.
-
-2007-09-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/NodeState.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs: Fixed a bug in user
- preferences file persistence.
-
-2007-09-04 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Userpref errors are now catched
- silently.
- * MonoDevelop.Ide.Tasks/Task.cs, MonoDevelop.Ide.Tasks/TaskService.cs: Fixed
- remaining issue with bug 82282.
-
-2007-09-03 Eric Butler <eric@extremeboredom.net>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs,
- MonoDevelop.Ide.addin.xml:
- Add "Include To Project" menu item to Folders that recursively adds
- files.
-
-2007-09-03 Eric Butler <eric@extremeboredom.net>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs:
- Highlight missing files and directories
-
-2007-09-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Removed some debug code.
-
-2007-09-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Added null check. Should fix
- bug #82553.
-
-2007-08-31 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs,
- MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs,
- MonoDevelop.Ide.CodeTemplates/TemplateCompletionDataProvider.cs,
- MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs,
- MonoDevelop.Ide.Gui.OptionPanels/AddInsOptionsPanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/ExternalToolPanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/SelectStylePanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/CodeGenerationPanel.cs,
- MonoDevelop.Ide.Templates/FileTemplate.cs,
- MonoDevelop.Ide.Templates/TextTemplate.cs,
- MonoDevelop.Ide.Templates/ProjectTemplate.cs,
- MonoDevelop.Ide.Commands/ViewCommands.cs,
- MonoDevelop.Ide.Commands/FileCommands.cs,
- MonoDevelop.Ide.Commands/ToolsCommands.cs,
- MonoDevelop.Ide.Commands/EditCommands.cs,
- MonoDevelop.Ide.Commands/CustomStringTagProvider.cs,
- MonoDevelop.Ide.Commands/DebugCommands.cs,
- MonoDevelop.Ide.Commands/WindowCommands.cs,
- MonoDevelop.Ide.Commands/HelpCommands.cs,
- MonoDevelop.Ide.ExternalTools/ExternalToolService.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectSolutionPad.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Dialogs/TipOfTheDay.cs,
- MonoDevelop.Ide.Gui.Dialogs/IncludeFilesDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/ReplaceDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/WordCountDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs,
- MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs,
- MonoDevelop.Ide.Gui.Pads/FileList.cs,
- MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs,
- MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs,
- MonoDevelop.Ide.Gui.Pads/TaskListPad.cs,
- MonoDevelop.Ide.Gui.Pads/NodeState.cs,
- MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs,
- MonoDevelop.Ide.Gui.Pads/FileListItem.cs,
- MonoDevelop.Ide.Gui.Pads/FileScout.cs,
- MonoDevelop.Ide.Gui.Pads/SolutionPad.cs,
- MonoDevelop.Ide.Gui.Pads/InternalLogPad.cs,
- MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs,
- MonoDevelop.Ide.Gui/Document.cs,
- MonoDevelop.Ide.Gui/ViewCommandHandlers.cs,
- MonoDevelop.Ide.Gui/OutputProgressMonitor.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs,
- MonoDevelop.Ide.Gui/AddinUpdateHandler.cs,
- MonoDevelop.Ide.Gui/Workbench.cs, MonoDevelop.Ide.Gui/IdeStartup.cs,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs,
- MonoDevelop.Ide.Gui/ProgressMonitors.cs, MonoDevelop.Ide.Gui/Ide.cs,
- MonoDevelop.Ide.Gui/TipOfTheDayStartupHandler.cs,
- MonoDevelop.Ide.Gui/WorkbenchMemento.cs,
- MonoDevelop.Ide.Codons/FileFilterCodon.cs,
- MonoDevelop.Ide.Tasks/UserTasksView.cs,
- MonoDevelop.Ide.Tasks/CommentTasksView.cs,
- MonoDevelop.Ide.Tasks/TaskService.cs,
- MonoDevelop.Ide.Gui.BrowserDisplayBinding/HtmlViewPane.cs,
- MonoDevelop.Ide.Gui.BrowserDisplayBinding/BrowserDisplayBinding.cs,
- MonoDevelop.Ide.Gui.Search/SearchOptions.cs,
- MonoDevelop.Ide.Gui.Search/SearchProgressMonitor.cs,
- MonoDevelop.Ide.Gui.Search/WildcardSearchStrategy.cs,
- MonoDevelop.Ide.Gui.Search/BruteForceSearchStrategy.cs: Changes due to
- new property infrastructure. Optimized the combine preferences routines.
-
-2007-08-31 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs (Load): Add
- support for a 'BuildAction' attribute.
-
-2007-08-28 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/AbstractBaseViewContent.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Fixed 81660+82491: Crash when
- opening the Welcome-Page manually.
-
-2007-08-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: Fixed 82554: Creating new
- project doesn't open it.
-
-2007-08-21 Mike Krüger <mkrueger@novell.com>
-
- * gtk-gui/MonoDevelop.Ide.StandardHeaders.StandardHeaderPanel.cs: Changed
- standard header panel.
-
-2007-08-21 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Tasks/TaskService.cs: Fixed 82496: Opening files causes
- sigabrt.
-
-2007-08-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs, MonoDevelop.Ide.Tasks/Task.cs,
- MonoDevelop.Ide.Tasks/TaskService.cs: Fixed bug 82282:Error list pad
- should take into account line changes done in files.
-
-2007-08-17 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs,
- MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs,
- MonoDevelop.Ide.Gui.OptionPanels/ExternalToolPanel.cs,
- MonoDevelop.Ide.Commands/ToolsCommands.cs,
- MonoDevelop.Ide.ExternalTools/ExternalTool.cs,
- MonoDevelop.Ide.ExternalTools/ExternalToolService.cs,
- MonoDevelop.Ide.ExternalTools/ToolLoader.cs: Fixed bug 75807: Save
- file for external tools. Re-wrote external tools subsystem, fixed
- some possible issues in the code templates.
-
-2007-08-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/objects.xml: Assigned a better category to custom widgets.
-
-2007-08-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Redirection to the
- ViewCommandHandlers object is now done in the notebook instead of in
- SdiWorkspaceWindow. In this way those commands will be enabled even if
- the focus is not in the editor (it can be in the notebook label). Fixes
- bug #82217.
-
-2007-08-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/StatusProgressMonitor.cs: Properly update the status
- bar when multiple status progress monitors are running at the same time.
- Fixes bug #82251.
-
-2007-08-16 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/FileCommands.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs,
- MonoDevelop.Ide.addin.xml: Implemented Wish 82213: New command for
- context menu: Open containing folder.
-
- Added open in terminal option too (for folders).
-
-2007-08-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Document.cs,
- MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Implemented Reload command
- in Document.
- * MonoDevelop.Ide.Gui/Workbench.cs: Added helper method for getting a
- document from a file name. The documents collection must be read-only in
- the client api.
-
-2007-08-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml, MonoDevelop.Ide.mdp, Makefile.am,
- MonoDevelop.Ide.Codons/FileFilterCodon.cs: Moved FileFilterCodon from
- MD.Projects to MD.Ide (where the extension point is actually defined).
-
-2007-08-14 Ankit Jain <jankit@novell.com>
-
- Fix bug #82253.
- * MonoDevelop.Ide.Gui/Workbench.cs (DeleteLayout): Invoke event handlers
- for LayoutChanged.
- * gtk-gui/gui.stetic: Set ResponseId to OK for New button of NewLayoutDialog.
- * gtk-gui/*: Update.
-
-2007-08-14 Ankit Jain <jankit@novell.com>
-
- Fix bug #82280.
- * MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs: Add context menu with
- Open, Copy and SelectAll commands.
-
-2007-08-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs,
- options/KeyBindingSchemeEmacs.xml,
- options/KeyBindingSchemeVisualStudio.xml,
- options/KeyBindingSchemeDefault.xml, MonoDevelop.Ide.addin.xml,
- MonoDevelop.Ide.mdp, Makefile.am, MonoDevelop.Ide.Gui/Ide.cs: Load key
- bindings from an extension point. Moved key bindings files from
- MD.Components to here.
-
-2007-08-08 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/ReplaceDialog.cs,
- gtk-gui/gui.stetic: Change Entry for Find/Replace dialogs to ComboBoxEntry.
-
-2007-08-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/RenameItemDialog.cs, gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.RenameItemDialog.cs: When perform
- refactoring Rename on public class add posibility to rename file that
- contains this class (interface). Patch by Sergey Shebanin.
-
-2007-08-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs: Make the search results list
- sortable. Fixes bug #82375.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs,
- MonoDevelop.Ide.addin.xml, MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs, MonoDevelop.Ide.Gui/Ide.cs:
- Removed the CommandService class. Everything is done directly with
- CommandManager. Moved all extension node types to MD.Components.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs, gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs: The folder
- entry in the new project dialog can now be loaded by stetic, no need to
- create it from code.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs,
- MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/ICombineEntryFeature.cs,
- MonoDevelop.Ide.Templates/ProjectTemplate.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/MethodNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/EventNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/FieldNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/PropertyNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ClassNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ResourceFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs,
- MonoDevelop.Ide.Gui.Pads/TaskListPad.cs, MonoDevelop.Ide.addin.xml,
- MonoDevelop.Ide.mdp, gtk-gui/gui.stetic, Makefile.am,
- MonoDevelop.Ide.Gui/Document.cs,
- MonoDevelop.Ide.Gui/DisplayBindingService.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs,
- MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs, MonoDevelop.Ide.Gui/Ide.cs:
- Reorganized the extension point hierarchy. Embedded all add-in manifests
- as resources.
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs: Updated.
-
-2007-08-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/CombineDescriptor.cs,
- MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs,
- MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs: Avoid using the
- ServiceManager for classes that are not registered as services.
-
-2007-08-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide/Services.cs, MonoDevelop.Ide.addin.xml,
- MonoDevelop.Ide.Gui/DisplayBindingService.cs,
- MonoDevelop.Ide.Gui/DefaultStatusBarService.cs,
- MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs,
- MonoDevelop.Ide.Gui/StatusProgressMonitor.cs,
- MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs, MonoDevelop.Ide.Gui/Ide.cs,
- MonoDevelop.Ide.Gui/HelpViewer.cs, MonoDevelop.Ide.Tasks/TaskService.cs,
- MonoDevelop.Ide.Gui.BrowserDisplayBinding/HtmlViewPane.cs: API cleanup.
- Converted core services into regular classes.
-
-2007-08-02 Ben Motmans <ben.motmans@gmail.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ClassNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/EventNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/FieldNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/MethodNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/PropertyNodeBuilder.cs,
- MonoDevelop.Ide.addin.xml: added context menu extension points
-
-2007-08-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/ToolsCommands.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectSolutionPad.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs,
- MonoDevelop.Ide.Gui.Dialogs/OpenFileInSolutionDialog.cs,
- MonoDevelop.Ide.Gui.Pads/FileList.cs,
- MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs,
- MonoDevelop.Ide.Gui.Pads/FileScout.cs,
- MonoDevelop.Ide.Gui.Pads/SolutionPad.cs,
- MonoDevelop.Ide.Gui.Pads/InternalLogPad.cs,
- MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs,
- MonoDevelop.Ide.Gui/ConfigurationComboBox.cs,
- MonoDevelop.Ide.Gui/LayoutComboBox.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs,
- MonoDevelop.Ide.Gui/AddinUpdateHandler.cs,
- MonoDevelop.Ide.Gui/StatusProgressMonitor.cs,
- MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs, MonoDevelop.Ide.Gui/Ide.cs,
- MonoDevelop.Ide.Tasks/UserTasksView.cs,
- MonoDevelop.Ide.Tasks/TaskService.cs,
- MonoDevelop.Ide.Tasks/CommentTasksView.cs,
- MonoDevelop.Ide.Gui.Search/SearchReplaceInFilesManager.cs: Converted
- DispatchService to a static class.
-
-2007-08-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.DeleteFileDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ExportProjectDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.FeatureSelectorDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.IncludeFilesDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.OpenFileInSolutionDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.RenameItemDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ReplaceDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ReplaceInFilesDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs,
- gtk-gui/MonoDevelop.Ide.NewHeaderTemplateDialog.cs,
- gtk-gui/MonoDevelop.Ide.SelectEncodingsDialog.cs: Fix dialog
- spacing.
-
-2007-07-29 Zach Lute <zach.lute@gmail.com>
-
- * MonoDevelop.Ide.addin.xml,
- MonoDevelop.Ide.Commands/TextEditorCommands.cs,
- MonoDevelop.Ide.Gui/ViewCommandHandlers.cs:
- Added MoveBlockUp and MoveBlockDown commands.
-
-2007-07-30 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/AssemblyReferencePanel.cs:
- Changed assembly filters to match mixed-case extensions
- e.g. Dll, eXe
-
-2007-08-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs, MonoDevelop.Ide.mdp,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewFileDialog.cs,
- gtk-gui/gui.stetic, Makefile.am: Implemented the New File dialog
- using Stetic.
- * gtk-gui/MonoDevelop.Ide.SelectEncodingsDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TasksPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.OpenFileInSolutionDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs,
- gtk-gui/MonoDevelop.Ide.CodeTemplates.CodeTemplatePanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.IncludeFilesDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.ExternalToolPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs: Updated.
-
-2007-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/AddInsOptionsPanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/ExternalToolPanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/SelectStylePanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/CodeGenerationPanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs, Base.glade,
- MonoDevelop.Ide.Commands/ViewCommands.cs,
- MonoDevelop.Ide.Gui.Dialogs/SelectReferenceDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/AssemblyReferencePanel.cs,
- MonoDevelop.Ide.Gui.Dialogs/TipOfTheDay.cs,
- MonoDevelop.Ide.Gui.Dialogs/IncludeFilesDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/SelectEncodingsDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/ReplaceDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewLayoutDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/AddinLoadErrorDialog.cs,
- MonoDevelop.Ide.mdp,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.DeleteFileDialog.cs,
- gtk-gui/MonoDevelop.Ide.SelectEncodingsDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.IncludeFilesDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ExportProjectDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ReplaceDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.ExternalToolPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.TasksPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.CodeGenerationPanelWidget.cs,
- gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.OpenFileInSolutionDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ReplaceInFilesDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.RenameItemDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs,
- gtk-gui/MonoDevelop.Ide.NewHeaderTemplateDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.LoadSavePanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.FeatureSelectorDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.SelectStylePanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.CodeTemplates.CodeTemplatePanelWidget.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectReferenceDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs,
- gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.AddInsPanelWidget.cs,
- gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.Ide.StandardHeaders.StandardHeaderPanel.cs,
- Makefile.am, MonoDevelop.Ide.Gui.Search/SearchReplaceManager.cs,
- MonoDevelop.Ide.Gui.Search/SearchReplaceInFilesManager.cs: Migrated
- all dialogs and windows to Stetic.
-
-2007-07-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Leave dragging mode when
- changing the current layout, to avoid probles du to widget
- relocation.
-
-2007-07-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/InternalLogPad.cs: Fix nullref.
-
-2007-07-25 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs (OpenEvent): Check
- that okButton is sensititive. Fixes bug #82176.
-
-2007-07-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/InternalLogPad.cs: Update the message log
- only when it is visible.
- * MonoDevelop.Ide.mdp, Makefile.am: Updated.
-
-2007-07-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs,
- MonoDevelop.Ide.StandardHeader/StandardHeaderPanel.cs,
- MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs,
- gtk-gui/MonoDevelop.Ide.StandardHeaders.StandardHeaderPanel.cs:
- Worked on bug 82171: Unable to edit Standadr Headers contents.
-
-2007-07-24 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Commands/FileCommands.cs,
- MonoDevelop.Ide.Commands/FileTabCommands.cs,
- MonoDevelop.Ide.addin.xml, MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Added context menu for
- the open documents in the file notebook.
-
-2007-07-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/IEditable.cs,
- MonoDevelop.Ide.Gui/TextEditor.cs: Added methods for grouping
- editing operations in an atomic undo unit.
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Keep cursor position when
- deleting a line. Fix some undo/redo issues. Fixes bug #82153.
-
-2007-07-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/ViewCommands.cs: Minor fix.
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs,
- MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs,
- MonoDevelop.Ide.Gui/OutputProgressMonitor.cs,
- MonoDevelop.Ide.Gui/ProgressMonitors.cs,
- MonoDevelop.Ide.Gui.Search/SearchProgressMonitor.cs: Allow
- 'pinning' output and search result pads. Pinned pads won't be
- reused (so they will keep the original results) until unpinned.
- * MonoDevelop.Ide.addin.xml, MonoDevelop.Ide.mdp, Makefile.am,
- icons/pindown.png, icons/pinup.png: Added pushpin icons.
- * MonoDevelop.Ide.Gui/IPadContainer.cs: Fix bug in show/hide event
- notification. Added Destroyed event, needed by the workbench so it
- can properly update the pad list.
- * MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: When a pad is closed,
- update the workbench pad list.
- * MonoDevelop.Ide.Gui/Pad.cs: The new destroy method allow removing a
- pad from the workbench.
-
-2007-07-19 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs: Clear status text on
- pad clear.
-
-2007-07-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs: Generate
- comments by default.
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Fix nullref.
-
-2007-07-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs: Show command
- icons in the list.
- * MonoDevelop.Ide.Commands/ViewCommands.cs: The pad list doesn't show
- checkboxes anymore. Instead, clicking on an option always brings
- the pad to front.
- * MonoDevelop.Ide.Gui.Pads/TaskListPad.cs,
- MonoDevelop.Ide.Gui.Pads/FileScout.cs: Pad icons are set in the xml
- file.
- * MonoDevelop.Ide.addin.xml: Updated some pad icons.
- * MonoDevelop.Ide.mdp, Makefile.am, icons/system-file-manager.png: New
- icon for the file pad.
- * MonoDevelop.Ide.Gui/Workbench.cs: Minor fix.
- * MonoDevelop.Ide.Gui/Pad.cs: Added icon property.
-
-2007-07-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs,
- MonoDevelop.Ide.Templates/ProjectTemplate.cs: Support reading
- templates from files, not only from resources.
- * MonoDevelop.Ide.addin.xml: Removed use of FileTemplateCodon. Removed
- a bunch of obsolete attributes.
- * MonoDevelop.Ide.mdp, Makefile.am,
- MonoDevelop.Ide.Codons/FileTemplateCodon.cs: Removed unused file.
- * MonoDevelop.Ide.Codons/ProjectTemplateCodon.cs: Rewritten to support
- templates stored in files.
-
-2007-07-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/TextEditorCommands.cs,
- MonoDevelop.Ide.addin.xml,
- MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Added new editor
- commands.
- * MonoDevelop.Ide.Commands/HelpCommands.cs: New help command.
- * MonoDevelop.Ide.Gui/TextEditor.cs: Added new helper methods.
-
-2007-07-18 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs (Load): Only
- add the key/value pair to the user-defined templates if it is not the
- default. Also, set header = headerText when it /is/ the default rather
- than setting it to reader.Read () since that will return empty string
- once the header text had already been read.
-
-2007-07-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/IExtensibleTextEditor.cs,
- MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs,
- MonoDevelop.Ide.Commands/TextEditorCommands.cs,
- MonoDevelop.Ide.addin.xml, MonoDevelop.Ide.mdp, Makefile.am,
- MonoDevelop.Ide.Gui/Document.cs,
- MonoDevelop.Ide.Gui/ViewCommandHandlers.cs,
- MonoDevelop.Ide.Gui/TextEditor.cs,
- MonoDevelop.Ide.Gui/Workbench.cs: Included text editor extensions
- in the commad route, so extensions can now implement command
- handlers. Implemented the ShowCompletionWindow as a command.
-
-2007-07-17 Jeffrey Stedfast <fejj@gnome.org>
-
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs: Use cmd.Id
- as the key.
-
-2007-07-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs,
- MonoDevelop.Ide.addin.xml: Added support for command categories.
- * MonoDevelop.Ide.Commands/ToolsCommands.cs,
- MonoDevelop.Ide.Gui.Pads/FileList.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Removed debug code.
- * MonoDevelop.Ide.Gui.Dialogs/SelectEncodingsDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Use the log service for
- logging errors.
- * MonoDevelop.Ide.Gui.Pads/InternalLogPad.cs: Fix warning.
- * MonoDevelop.Ide.Gui/InternalLog.cs: Only fatal errors are notified in
- the status bar.
-
-2007-07-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/InternalLogPad.cs,
- MonoDevelop.Ide.Gui/InternalLog.cs: Ignore debug messages for now.
-
-2007-07-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/InternalLogPad.cs,
- MonoDevelop.Ide.addin.xml, MonoDevelop.Ide.mdp, Makefile.am,
- MonoDevelop.Ide.Gui/InternalLog.cs, MonoDevelop.Ide.Gui/Ide.cs:
- Implemented a pad which shows the log messages generated by
- MonoDevelop.
- * MonoDevelop.Ide.Gui/IdeStartup.cs: If the inotify watch handle limit
- is too low, switch to managed watcher, to make sure watching works
- even if it is slow.
-
-2007-07-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/ExternalToolPanel.cs,
- MonoDevelop.Ide.Gui.Dialogs/EncapsulateFieldDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/RenameItemDialog.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Fix warnings.
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: No refactoring
- commands for unsaved documents. Better than a crash.
- * MonoDevelop.Ide.Gui/ConfigurationComboBox.cs: Removed debug message.
- * MonoDevelop.Ide.Gui.Search/SearchReplaceManager.cs: ShowMessage
- requires escaped text.
-
-2007-07-17 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs: New OptionPanel
- to allow customizing key bindings.
-
-2007-07-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs: When showing the
- completion window with ctrl+space, calculate the length of the text
- to be replaced and store it in the completion context. Fixes bug
- #82033.
-
-2007-07-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Fixed bug
- 81349:double-click src tab => maximize.
-
-2007-07-13 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Fixed bug 82073: Window
- panes vanish permanently
-
-2007-07-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/HelpViewer.cs: Don't crash if Gtk.HTML can't be
- loaded. Fixes bug #81989.
-
-2007-07-12 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Worked on Bugzilla Bug
- 81349. (toolbars and status bar are now shown).
-
-2007-07-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs: Fix
- warnings.
- * Base.glade: Fixed some dialog titles.
- * MonoDevelop.Ide.Commands/ViewCommands.cs,
- MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs,
- MonoDevelop.Ide.Gui.Pads/ILocationListPad.cs,
- MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs,
- MonoDevelop.Ide.addin.xml, MonoDevelop.Ide.Gui/IPadContainer.cs,
- MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs,
- MonoDevelop.Ide.Gui/Pad.cs: Implemented ShowNext and ShowPrevious
- commands, which allows browsing through the list of errors or the
- list of search results.
- * MonoDevelop.Ide.Gui.Dialogs/ReplaceDialog.cs: Removed the option for
- searching through all files of the project, since it's already
- implemented in "Find in Files".
- * MonoDevelop.Ide.mdp, Makefile.am: New file.
-
-2007-07-10 Marcos David Marín Amador <MarcosMarin@gmail.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide/MonoDevelop.Ide.addin.xml: Added a context menu
- for the project node.
-
-2007-07-11 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs: fixed bug
- 81996:Sharing violation of header template.
-
-2007-07-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs: When adding
- a folder, expand the parent folder so the new subfolder is shown.
- It should fix bug #81984.
-
-2007-07-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Fix GetPad.
-
-2007-07-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp: Updated.
- * MonoDevelop.Ide.Gui/Document.cs: Set the correct default directory
- when running the Save As command.
-
-2007-07-06 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs: The
- ${FileName} tag in headers gives now back the file name without the
- path. New tags: ${FullFileName} gives back the fully qualified
- name, ${Directory} gives back the directory the new file is created
- in, ${FileNameWithoutExtension} gives back the file name without
- extension.
-
-2007-07-05 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Differentiate
- between Class, Enum, and Struct.
-
-2007-07-05 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs,
- MonoDevelop.Ide.Gui.Pads/SolutionPad.cs,
- MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Tasks/UserTasksView.cs,
- MonoDevelop.Ide.Tasks/CommentTasksView.cs,
- MonoDevelop.Ide.Tasks/TaskService.cs: Changed source a bit due to
- core refactorings.
-
-2007-07-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateLoader.cs,
- MonoDevelop.Ide.CodeTemplates/EditTemplateGroupDialog.cs,
- MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs,
- MonoDevelop.Ide.CodeTemplates/CodeTemplateGroup.cs,
- MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs,
- MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs,
- MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs,
- MonoDevelop.Ide.CodeTemplates/TemplateCompletionDataProvider.cs,
- MonoDevelop.Ide.Gui.Dialogs/EditTemplateDialog.cs,
- MonoDevelop.Ide.addin.xml: Refactored the code templates: They were
- scattered over 3 places, now the code template feature is at one
- place. Re-wrote the code template loading/saving (No slow
- XmlDocument anymore).
-
-2007-07-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs,
- MonoDevelop.Ide.Gui/IWorkbench.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Moved the view and pad
- collections to read only in the public api.
-
-2007-07-03 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.mdp, MonoDevelop.Ide.Gui/ProjectOperations.cs,
- MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs,
- MonoDevelop.Ide.Gui/IWorkbench.cs,
- MonoDevelop.Ide.Tasks/TaskService.cs: Refactoring - removed some
- custom collections and used generic collections instead.
-
-2007-07-02 Balaji Rao <balajirrao@gmail.com>
-
- * Monodevelop.Ide.Gui/ProjectOperations.cs:
- Fixed and improved JumpToDeclaration method to support partial classes
- * MonoDevelop.Ide.Gui.Pads.ClassPad/MemberNodeCommandHandler.cs:
- Uses ProjectOperation.JumpToDeclaration() inplace of
- ProjectOperation.OpenDocument directly.
-
-2007-07-02 Ben Motmans <ben.motmans@gmail.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- Added overloads for Execute and ExecuteFile with ExecutionContext parameter
-
-2007-06-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/SelectReferenceDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/GacReferencePanel.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs: Some changes to make the
- select reference dialog easier to reuse.
- * MonoDevelop.Ide.mdp: Fix gtk versions.
- * Makefile.am: Flush.
-
-2007-06-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/SelectReferenceDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/GacReferencePanel.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs: Some changes to make the
- select reference dialog easier to reuse.
- * MonoDevelop.Ide.mdp: Fix gtk versions.
- * Makefile.am: Flush.
-
-2007-06-22 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.addin.xml: Adds Shift+Ctrl+F shortcut to "Find in
- Files" and fixes two typos. Fixes bug #81821.
-
-2007-06-22 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Removed code duplication.
-
-2007-06-22 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Use the new CloseClicked
- event of TabLabel. Fixes bug #81890.
-
-2007-06-22 Mike Krüger <mkrueger@novell.com>
-
- Added MIT license to standard headers.
-
-2007-06-20 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.Ide.StandardHeader/NewHeaderTemplateDialog.cs,
- MonoDevelop.Ide.StandardHeader/StandardHeaderPanel.cs: Work around
- compiler bug(?) in Mono 1.2.4 where anonymous delegate scopes don't
- respect 'using' statements. Use explicit namespaces to avoid this.
-
-2007-06-20 Mike Krüger <mkrueger@novell.com>
-
- Worked on the standard header feature.
-
-2007-06-19 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * templates/EmptyEnum.xft.xml,
- templates/EmptyStruct.xft.xml: Fixed typos.
-
-2007-06-19 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * Base.glade: Fixed casing of label text.
-
-2007-06-18 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui.Pads/FileScout.cs: Use the configured
- default new project path as startup path. Fixes bug #79393.
-
-2007-06-18 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Implemented maximize
- editing area when double clicking on a tab.
-
- Described in http://bugzilla.ximian.com/show_bug.cgi?id=81349.
-
-2007-06-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs: Reduce spacing between rows.
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs: Subscribing the EndBuild
- event in ErrorListPad to show the error list after building doesn't
- work anymore since pads are lazily loaded now.
- * gtk-gui/generated.cs: Made IconLoader internal.
- * gtk-gui/objects.xml: Updated.
-
-2007-06-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Show the help pad in the left by default.
-
-2007-06-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/AbstractPadContent.cs: Removed unused property.
-
-2007-06-06 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs (projectsByPath):
- Remove, unused.
- * MonoDevelop.Ide.Gui.Pads/ProjectPad/ShowAllFilesBuilderExtension.cs (projects):
- Change type from ArrayList to strongly typed List<Project>.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs (CloseCombine): Remove handlers
- on the closed combine.
-
-2007-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/CombineEntryFeatureSelector.cs: Show a
- message when there are no available features for a project.
- * MonoDevelop.Ide.mdp: Remove useless deploy data.
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.DeleteFileDialog.cs,
- gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.OpenFileInSolutionDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.RenameItemDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ExportProjectDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.EncapsulateFieldDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.FeatureSelectorDialog.cs,
- gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs: Updated.
-
-2007-05-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Use the new
- IType.SourceProject property to know if an IType can be changed
- or not. CanJumpTo is not reliable since now MD allows jumping to
- source code files taken from debug info of assemblies.
- * MonoDevelop.Ide.Gui/Workbench.cs: (OpenDocument) Columns are 1 based.
-
-2007-05-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: In the refactoring
- menu, show type and member names in bold.
-
-2007-05-25 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/EncapsulateFieldDialog.cs: Moved the
- logic that constructed the CodeDom property object into the
- IRefactorer implementation instead, allowing us to take advantage
- of the new code I wrote to generate a CodeTypeReference given an
- IReturnType.
-
-2007-05-25 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs
- (ImplementInterface): Moved the bulk of the logic to
- CodeRefactorer.
-
-2007-05-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs,
- MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/ProjectTemplate.cs,
- MonoDevelop.Ide.Gui/DisplayBindingService.cs: Properly handle
- add-in unload events.
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs,
- MonoDevelop.Ide.Gui/IWorkbenchLayout.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Added support for
- removing pads (needed for add-in unloading).
-
-2007-05-23 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorProperties.cs: Moved here
- from MonoDevelop.SourceEditor.Properties
-
- * MonoDevelop.Ide.Gui.Content/IndentStyle.cs: Moved here from
- MonoDevelop.SourceEditor.Gui
-
- * MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs:
- Check the TextEditorProperties settings for spaces vs tabs for
- indenting and how many spaces to use for an indent string.
-
-2007-05-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs: Handle exceptions thrown
- when renaming items. Fixes bug #81716.
-
-2007-05-22 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.Ide.addin.xml: Register new stock icons.
- * MonoDevelop.Ide.mdp, Makefile.am, icons/navigate-previous.png,
- icons/navigate-next.png: Added icons.
- * MonoDevelop.Ide.Gui/NavigationHistory.cs: Use new icons.
-
-2007-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: When it's not possible to connect
- to a running MD instance using the socket, just delete the socket
- file so a new session can be properly started. Removed connection
- check in the socket listener which was always returning false. All
- this fixes bug #81648.
-
-2007-05-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs: When validating
- data, don't use the DocumentIteratorType property before it is set.
- Fixes bug #81593.
- * MonoDevelop.Ide.addin.xml: Move the IDE to 'MonoDevelop Core'
- category
- * MonoDevelop.Ide.Gui.Search/ForwardTextIterator.cs: Make sure this
- class always runs in the GUI thread. Removed useless Assert which
- is causing a null ref.
- * MonoDevelop.Ide.Gui.Search/AllOpenDocumentIterator.cs: Make sure this
- class always runs in the GUI thread. Use Document.GetContent to get
- content interfaces.
-
-2007-05-21 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Commands/HelpCommands.cs:
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs:
- Ensure that Dialogs are Destroy()'ed.
-
-2007-05-21 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ResourceFolderNodeBuilder.cs:
- (AskFiles): Ensure that Destroy is called. Also, SetCurrentFolder.
-
-2007-05-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs: Moved the code for adding
- new files to a project from the solution tree to ProjectOperations,
- so it can be reused.
-
-2007-05-18 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Commands/ProjectCommands.cs
- (ExportProjectHandler.Update): Override. Should be enabled only if
- there is an open combine.
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs (Export): Ensure that
- Destroy is called.
-
-2007-05-17 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/EncapsulateFieldDialog.cs
- (OnOKClicked): Updated to pass the updateInternalRefs argument.
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs (Update): Pass the
- editor.Text into UpdateFile() to fix a bug preventing the editor
- state from auto-updating and catching new fields as the user types
- them. Also fixed a bug which would show IMember, IType, IMember,
- IType (which looks odd).
- (BuildRefactoryMenuForItem): Keep a canJumpTo bool so we don't
- have to check it multiple times. Also check canJumpTo when adding
- an "Encapsulate Field" item (can't encapsulate it unless we have
- access to its declaration).
- (ImplementInterface): I was wrong, these still need to be in
- reverse order afterall.
-
-2007-05-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs: If a node is being edited,
- don't delegate commands to the node builders, since what's selected
- is not the node, but the node label. In this way commands such as
- Delete will be handled by the node Entry.
-
-2007-05-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/SolutionPad.cs: Fill the tree if there is an
- open combine when the pad is shown for the first time.
-
-2007-05-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: A pad may already be
- initialized but not yet added to the dock. So, a better way to know
- when a pad needs to be added to the dock is just to check if the
- dock already has a child or not.
- * MonoDevelop.Ide.Codons/PadCodon.cs: Removed duplicate property.
-
-2007-05-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Workaround to what seems
- to be a gtk/gtk# bug.
-
-2007-05-16 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs
- (ImplementInterface): Don't add items in reverse order anymore,
- the bug that caused items to appear in reverse order has now been
- fixed. Also, always update our klass variable to reference the
- most recent revision after each AddMember() call so that this
- works.
- (EscapeName): New method to help escape _'s in strings that will
- be used in a Gtk.Label so that they aren't interpreted by
- Gtk.Label as accels.
- (BuildRefactoryMenuForItem): Escape menu item names.
-
-2007-05-16 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/EncapsulateFieldDialog.cs
- (OnOKClicked): Updated to call refactorer.EncapsulateField() so
- that the get/set methods get filled-in approprietly for each
- language.
-
-2007-05-16 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/EncapsulateFieldDialog.cs: New
- dialog for encapsulating a single field.
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs
- (BuildRefactoryMenuForItem): Add an "Encapsulate Field" menu item
- for all fiends.
- (EncapsulateField): Open an EncapsulateFieldDialog.
-
-2007-05-15 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs
- (ImplementInterface): When implementing explicitly, trim what we
- can from the explicit name depending on the namespace and/or using
- statements the file contains.
-
-2007-05-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/SplashScreen.cs: Make the splash screen a
- toplevel instead of popup, it's less intrusive.
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: Always add the
- generated combine entry to the solution. Disable the 'next' button
- if the solution path entry is empty.
-
-2007-05-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Use the Expose event to
- get notified the first time a pad is shown. The Realized even can
- be fired sometimes even if the widget has not yet been shown.
-
-2007-05-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp, Makefile.am,
- MonoDevelop.Ide.Gui/PadContentCollection.cs: Removed unused file.
- * MonoDevelop.Ide.Gui/IPadContent.cs, MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/ProgressMonitors.cs,
- MonoDevelop.Ide.Gui/Pad.cs: Added ID paremeter to
- Workbench.ShowPad. The ID is not part of IPadContent anymore. It
- must be specified either in the addin.xml file or when calling
- ShowPad.
- * MonoDevelop.Ide.Gui/IPadContainer.cs: Added Id property.
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs,
- MonoDevelop.Ide.Codons/PadCodon.cs: Added PadId property to
- PadCodon. This property is the id set in the extension node, or one
- specified by the user when calling ShowPad.
-
-2007-05-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Fix incorrect type check
- in CreatePadContent. The pad codon can't be a widget, the check
- must be done for the content pad. Restore the code that updates the
- pad label when the title changes.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Don't save the combine when
- opening a new one.
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceFolderNodeBuilder.cs:
- Allow creating project references by dropping a project to the
- references folder. Added check for cyclic references.
- * MonoDevelop.Ide.Gui.Dialogs/CombineEntryFeatureSelector.cs: Don't
- allow unchecking features which are enabled by default.
- * MonoDevelop.Ide.addin.xml: Removed unused attributes.
- * MonoDevelop.Ide.Gui.Dialogs/DeleteFileDialog.cs,
- MonoDevelop.Ide.Commands/RefactoryCommands.cs: Fix warning.
- * MonoDevelop.Ide.Commands/DebugCommands.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui/Document.cs: Destroy file selector when done.
-
-2007-05-11 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs (Update): If an
- interface was selected, find the class it is being implemented on
- to pass to BuildRefactoryMenuForItem().
- (BuildRefactoryMenuForItem): Now takes an IType argument for
- toplevel interface items so that we know which IType to implement
- the interface members on if the user requests to do so.
- (ImplementInterface): Implemented.
-
-2007-05-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs: Don't
- crash if the header file can't be found.
-
-2007-05-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: Use modal dialogs
- for error messages.
- * MonoDevelop.Ide.mdp, Makefile.am: Updated.
-
-2007-05-10 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs,
- MonoDevelop.Ide.Gui/ProgressMonitors.cs,
- MonoDevelop.Ide.Codons/PadCodon.cs:
- Fixed bug in pad loading.
-2007-05-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp, Makefile.am: Reference shared assemblies from
- the correct location.
-
-2007-05-09 Mike Krüger <mkrueger@novell.com>
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs,
- MonoDevelop.Ide.addin.xml,
- MonoDevelop.Ide.Gui/IPadContent.cs,
- MonoDevelop.Ide.Gui/IPadContainer.cs,
- MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs,
- MonoDevelop.Ide.Gui/IWorkbenchLayout.cs,
- MonoDevelop.Ide.Gui/IWorkbench.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs,
- MonoDevelop.Ide.Gui/Pad.cs,
- MonoDevelop.Ide.Codons/SolutionPadCodon.cs,
- MonoDevelop.Ide.Codons/PadCodon.cs:
- Worked on lazy loading of pads.
-
-2007-05-08 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Ide.StandardHeader/StandardHeaderPanel.cs,
- MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs,
- MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs: Added
- standard header feature.
-
-2007-05-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Added some missing dispose
- calls in backgroundLoadCombine.
-
-2007-05-08 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/RenameItemDialog.cs (OnOKClicked):
- Simplified and fixed to work where the param is not an IMethod
- param.
-
-2007-05-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Codons/TaskListViewCodon.cs,
- MonoDevelop.Ide.Codons/NodeBuilderCodon.cs,
- MonoDevelop.Ide.Codons/PadOptionCodon.cs,
- MonoDevelop.Ide.Codons/DisplayBindingCodon.cs,
- MonoDevelop.Ide.Codons/SolutionPadCodon.cs,
- MonoDevelop.Ide.Codons/ProjectTemplateCodon.cs,
- MonoDevelop.Ide.Codons/PadCodon.cs,
- MonoDevelop.Ide.Codons/ContextPadCodon.cs,
- MonoDevelop.Ide.Codons/FileTemplateCodon.cs,
- MonoDevelop.Ide.Codons/FileTemplateTypeCodon.cs,
- MonoDevelop.Ide.Codons/WorkbenchContextCodon.cs: Use the
- Mono.Addins attributes to provide extension documentation.
-
-2007-05-06 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.Ide.Codons/LanguageActiveCondition.cs: Check using
- Project.SupportedLanguages instead of DotNetProject.LanguageName
- so it works with non-.NET languages.
-
-2007-05-04 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs (Export): Removed
- unused variable.
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs
- (BuildRefactoryMenuForItem): Don't recurse for IMembers anymore,
- this is now handled elsewhere. Also moved the Rename item to below
- the "Find references" action and changed the IField and IParameter
- label format.
- (Update): Flatten the menu tree a bit by moving IMember refactory
- items to the toplevel menu and also eliminate adding
- duplicate-named items in the menu due to one being the base-class
- implementation of a method the user selected.
-
-2007-05-04 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Don't look for
- references to private fields in whole solution.
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/AddInsOptionsPanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/SelectStylePanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/CodeGenerationPanel.cs,
- MonoDevelop.Ide.Templates/FileTemplate.cs,
- MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/ICombineEntryFeature.cs,
- MonoDevelop.Ide.Templates/ProjectTemplate.cs,
- MonoDevelop.Ide.Commands/ViewCommands.cs,
- MonoDevelop.Ide.Commands/FileCommands.cs,
- MonoDevelop.Ide.Commands/ToolsCommands.cs,
- MonoDevelop.Ide.Commands/EditCommands.cs,
- MonoDevelop.Ide.Commands/CustomStringTagProvider.cs,
- MonoDevelop.Ide.Commands/DebugCommands.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/AddinLoadErrorDialog.cs,
- MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs,
- MonoDevelop.Ide.Gui.Pads/TaskListPad.cs, MonoDevelop.Ide.addin.xml,
- MonoDevelop.Ide.mdp, Makefile.am,
- MonoDevelop.Ide.Gui/IViewContent.cs,
- MonoDevelop.Ide.Gui/Document.cs,
- MonoDevelop.Ide.Gui/DisplayBindingService.cs,
- MonoDevelop.Ide.Gui/AbstractViewContent.cs,
- MonoDevelop.Ide.Gui/ViewCommandHandlers.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs,
- MonoDevelop.Ide.Gui/AddinUpdateHandler.cs,
- MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/IdeStartup.cs,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs,
- MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs,
- MonoDevelop.Ide.Gui/Ide.cs,
- MonoDevelop.Ide.Codons/TaskListViewCodon.cs,
- MonoDevelop.Ide.Codons/NodeBuilderCodon.cs,
- MonoDevelop.Ide.Codons/PadOptionCodon.cs,
- MonoDevelop.Ide.Codons/DisplayBindingCodon.cs,
- MonoDevelop.Ide.Codons/SolutionPadCodon.cs,
- MonoDevelop.Ide.Codons/ProjectTemplateCodon.cs,
- MonoDevelop.Ide.Codons/LanguageActiveCondition.cs,
- MonoDevelop.Ide.Codons/PadCodon.cs,
- MonoDevelop.Ide.Codons/ContextPadCodon.cs,
- MonoDevelop.Ide.Codons/WorkbenchContextCondition.cs,
- MonoDevelop.Ide.Codons/FileTemplateCodon.cs,
- MonoDevelop.Ide.Codons/ProjectOpenCondition.cs,
- MonoDevelop.Ide.Codons/WindowOpenCondition.cs,
- MonoDevelop.Ide.Codons/FileTemplateTypeCodon.cs,
- MonoDevelop.Ide.Codons/CombineOpenCondition.cs,
- MonoDevelop.Ide.Codons/ProjectActiveCondition.cs,
- MonoDevelop.Ide.Codons/WindowActiveCondition.cs,
- MonoDevelop.Ide.Codons/WorkbenchContextCodon.cs: Migration to
- Mono.Addins.
-
-2007-05-03 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs: Port menu to actions api,
- added Jump to command and customization of columns.
- * MonoDevelop.Ide.Tasks/CommentTasksView.cs: Use SelectedTask
- everywhere.
-
-2007-05-03 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs
- (BuildRefactoryMenuForItem): Fixed logic for deciding if an item
- could be renamed.
-
- * MonoDevelop.Ide.Gui.Dialogs/RenameItemDialog.cs (OnOKClicked):
- Allow renaming of LocalVariables and IParameters.
-
-2007-05-03 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.Ide.Tasks/CommentTasksView.cs: Port menu to action based,
- add go to and delete commands. Added customization of columns
- visibility.
- * MonoDevelop.Ide.Tasks/TaskService.cs: use .Net 2.0 style Split for
- safer behaviour
-
-2007-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects/Combine.cs,
- MonoDevelop.Projects/CombineEntryEventArgs.cs,
- MonoDevelop.Projects.Parser/DefaultParserService.cs: Added a
- Reloading property to the argument of the entry add/remove events
- of Combine, which is set to true if the entry is being only
- reloaded, not actually removed/added to the combine.
-
-2007-05-02 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/RenameItemDialog.cs: Connect to the
- "activated" signal on the GtkEntry box and make it "click" the OK
- button.
-
-2007-05-01 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs (CodeRefactorer): Set
- the TextFileProfider for the refactoer to the
- OpenDocumentFileProvider.
- (OpenDocumentFileProvider): Copied here from another
- location... really need to consolidate the two.
-
- * MonoDevelop.Ide.Tasks/CommentTasksView.cs: Removed unused
- solutionLoaded variable.
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Got rid of unused guiLock
- variable.
-
- * MonoDevelop.Ide.Gui.Dialogs/RenameItemDialog.cs: New dialog
- class for renaming an item (be it a class, interface, whatever).
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs (Rename):
- Implemented.
-
-2007-04-27 Mike Kestner <mkestner@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: can't destroy after
- dispose. Just Destroy.
-
-2007-04-27 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: Added my name too
-
-2007-04-26 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/SharpDevelopAboutPanels.cs: Updated
- the (c) year to include 2007.
-
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: Added my name
- to the list of contributors :)
-
-2007-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/ICombineEntryFeature.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewProjectDialog.cs:
- Implemented the new project dialog using stetic. Implemented
- support for 'project features'.
- * MonoDevelop.Ide.Commands/FileCommands.cs: Moved new project dialog
- creation to ProjectOperations.NewProject().
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs: Use
- the desktop file icon for files which don't have one assigned in
- MD.
- * MonoDevelop.Ide.Gui.Dialogs/CombineEntryFeatureSelector.cs,
- MonoDevelop.Ide.Gui.Dialogs/FeatureSelectorDialog.cs,
- gtk-gui/objects.xml,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.CombineEntryFeatureSelector.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.FeatureSelectorDialog.cs:
- Implemented new project feature selector widget, used in the new
- project dialog.
- * MonoDevelop.Ide.addin.xml,
- MonoDevelop.Ide.Gui/DefaultDisplayBinding.cs: Added new
- ProjectFeatures extension point. Added a default display binding to
- be used as reference when registering other display bindings (so
- they can be added before the default binding if needed).
- * MonoDevelop.Ide.mdp, Makefile.am: Added new files.
- * gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.OpenFileInSolutionDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ExportProjectDialog.cs,
- gtk-gui/gui.stetic: Updated.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Implemented the NewProject
- command. In CreateCombineEntry, moved the code that adds the new
- entry to the combine to the NewProjectDialog.
-
-2007-04-25 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui/NavigationService.cs (LogNavPoint): Don't
- allow the history list to grow larger than 100 navpoints - if we
- try to add more, begin removing the oldest nav points.
-
-2007-04-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/FileCommands.cs: Properly destroy the file
- selector dialog.
-
-2007-04-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs: Show the
- options dialog when double-clicking on a project or solution.
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ResourceFolderNodeBuilder.cs:
- Allow setting a project file as resource when dragged to the
- resources folder.
-
-2007-04-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Track api changes.
-
-2007-04-20 Ben Motmans <ben.motmans@gmail.com>
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs:
- Include a "show error reference" item in the popup menu
- * MonoDevelop.Ide.Tasks/Task.cs: store the ErrorNumber
-
-2007-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/CombineEntryDescriptor.cs: Track api
- changes.
- * MonoDevelop.Ide.Commands/ProjectCommands.cs,
- MonoDevelop.Ide.addin.xml: Moved deploy commands definition to the
- deploy add-in. Registered new export command.
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectSolutionPad.cs: Properly
- update the currently selected combine entry.
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs: Allow
- removing unknown combine entries.
- * MonoDevelop.Ide.Gui.Dialogs/ExportProjectDialog.cs,
- MonoDevelop.Ide.mdp,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.ExportProjectDialog.cs,
- gtk-gui/gui.stetic, Makefile.am: Added project export dialog.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Keep track of the currently
- selected combine entry. Implemented project export command. Added
- method for saving generic combine entries. Removed old deploy code.
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs: Added null check.
-
-2007-04-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs:
- Changed the label of the Delete command to "Remove", since that
- command does not delete files, it removes files from a project.
-
-2007-04-18 Ankit Jain <jankit@novell.com>
-
- Add new DeleteFileDialog.
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs (RemoveItem): Use the new
- DeleteFileDialog.
- * MonoDevelop.Ide.Gui.Dialogs/DeleteFileDialog.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.DeleteFileDialog.cs: New.
- * MonoDevelop.Ide.mdp, Makefile.am: Updated.
- * gtk-gui/gui.stetic: Updated to add the new dialog.
-
-2007-04-13 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs
- (BuildRefactoryMenuForItem): If we can jump to the definition of
- any member, we can also rename it - so add a Rename menu item. If
- an interface is selected, add 2 menu items: "Implement Interface
- (implicit)" and "Implement Interface (explicit)". If a class is
- selected, add the same 2 menu items as we do for interfaces, but
- attach submenus to those items listing the possible interfaces to
- implement.
-
-2007-04-11 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui/IViewHistory.cs: Moved to
- MonoDevelop.Ide.Gui.Content
-
-2007-04-10 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs (OpenDocument): Don't log the
- NavPoint here, it's unnecessary afaict (and no longer easily done
- anyway, since IViewContent no longer contains BuildNavPoint()).
-
- * MonoDevelop.Ide.Gui/NavigationService.cs: Removed unused helper
- methods.
-
- * MonoDevelop.Ide.Gui/AbstractViewContent.cs: Removed
- BuildNavPoint()
-
- * MonoDevelop.Ide.Gui/IViewHistory.cs: New interface for
- BuildNavPoint()
-
- * MonoDevelop.Ide.Gui/IViewContent.cs: Removed BuildNavPoint()
-
- * MonoDevelop.Ide.Gui/DefaultNavigationPoint.cs: Removed unused
- methods and properties (and the generic object navigation data).
-
- * MonoDevelop.Ide.Gui/INavigationPoint.cs: Removed unused
- methods/properties.
-
- * MonoDevelop.Ide.Gui/NavigationHistory.cs: Add a "Clear History"
- menu item in the Forward navigation menu too.
- (UpdateHistory): (Forward/Back) As we progress thru history, group
- /sequential/ points sharing the same filename into submenus (as
- opposed to /all/ points sharing the same filename).
-
-2007-04-09 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/SelectStylePanel.cs: Provide
- a UI for setting a custom font for the treeview pads.
-
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs: Allow using a custom
- font for the Pads.
-
-2007-04-04 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui/NavigationService.cs: Defer logging until
- the timeout has expired unless there has been a file change.
-
-2007-04-03 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui/NavigationService.cs: Only log new points if
- the time interval has been >= 1 second.
-
- * MonoDevelop.Ide.Gui/NavigationHistory.cs: Don't include the
- current navpoint in the menus.
-
-2007-04-02 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui/NavigationHistory.cs: Implement
- NavigationHistoryForward class.
-
- * MonoDevelop.Ide.Gui/NavigationService.cs: After jumping to the
- new point, emit the HistoryChanged event.
-
- * MonoDevelop.Ide.addin.xml: The Forward button now uses the same
- custom widget.
-
-2007-03-30 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui/NavigationHistory.cs: New widget
- implementing the Back (and someday Forward?) custom
- history navigation widget.
-
- * MonoDevelop.Ide.addin.xml: Changed the info for the NavigateBack
- button, it is now a custom widget.
-
-2007-03-29 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs (OpenDocument): Log the
- NavigationPoint.
-
- * MonoDevelop.Ide.Gui/ViewContentEventHandler.cs: New source file.
-
- * MonoDevelop.Ide.Gui/NavigationService.cs: New Navigation Service.
-
- * MonoDevelop.Ide.Gui/IViewContent.cs: Added a BuildNavPoint() method.
-
- * MonoDevelop.Ide.Gui/INavigationPoint.cs: New source file describing
- the NavigationPoint interface.
-
- * MonoDevelop.Ide.Gui/DefaultNavigationPoint.cs: New source file
- implementing the default NavigationPoint interface.
-
- * MonoDevelop.Ide.Gui/AbstractViewContent.cs: Added a BuildNavPoint()
- virtual method.
-
- * MonoDevelop.Ide.Commands/NavigationCommands.cs: New source file
- implementing the code navigation commands.
-
-2007-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/ProjectCommands.cs: Track api changes.
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.OpenFileInSolutionDialog.cs,
- Makefile.am: Flush.
-
-2007-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/CombineEntryDescriptor.cs: Track api
- changes.
-
-2007-03-22 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs (Update): We always
- want a separator after any items we add to the menu.
- (BuildRefactoryMenuForItem): Rearranged some code a bit to group
- like-items together and also added accel keys. If the item is really
- an interface, say so in the menu item rather than naming it "Class {0}"
- which was a little confusing.
-
-2007-03-21 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Templates/ProjectTemplate.cs (Initialize): Different
- instances of ProjectTemplate cannot share the XmlDocument.
-
-2007-03-19 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui/TextEditor.cs (GetCharAt): Now that
- ITextFile has GetCharAt(), use that instead of implementing it
- ourselves.
-
-2007-03-14 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs
- (InitializeComponents): Don't crash if no project is selected in
- the solution.
- (InitializeDialog): Clear the iconView.
-
-2007-03-13 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs
- (AddToProjectToggled): Change the sensitivity of the "Path:" label
- as well.
- (InitializeComponents): Keep a reference tot he Path label so we
- can change its sensitivity as well.
-
-2007-03-13 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs (InitializeDialog):
- New method to init projectLangs, categories, etc and to
- InitializeView if updating (e.g. after the user picks a project to
- add it to).
- (InitializeTemplates): Only use parentProject if it is the project
- the user has chosen to add his/her new file to.
- (AddTemplate): Same.
- (AddToProjectToggled): Update the view by calling InitializeDialog().
- (AddToProjectComboChanged): Same.
-
-2007-03-12 Jeffrey Stedfast <fejj@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs (OpenEvent): If the
- user has chosen to add the file to a project, use the chosen
- project and path variables.
- (InitializeComponents): If the parentProject is null, add UI
- elements to enable the user to choose which project (and what
- path) he'd like to add the new source file to (or not).
- (InitializeComponents): Add a Activated signal handler to the
- nameEntry widget which will emit the Clicked event on the
- okButton.
- (AddToProjectComboChanged): ComboBox.ActiveText does not exist in
- Gtk-2.4. Also, don't change basePath if the user has manually
- changed it.
- (InitializeComponents): Connect to the PathChanged signal on the
- Add-to-Project FolderEntry to listen for changes typed manually.
-
-2007-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.GotoTypeDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/GotoTypeDialog.cs: Merged with
- OpenFileInSolutionDialog.
- * MonoDevelop.Ide.mdp: Updated.
-
-2007-03-07 Zach Lute <zach.lute@gmail.com>
-
- * MonoDevelop.Ide.addin.xml,
- * MonoDevelop.Ide.Commands/FileCommands.cs: Added OpenFileInSolution
- command and appropriate handler.
- * MonoDevelop.Ide.mdp, Makefile.am, gtk-gui/gui.stetic,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.OpenFileInSolutionDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/OpenFileInSolutionDialog.cs:
- Added OpenFileInSolutionDialog for rapid opening of files in the
- currently open solution.
- * gtk-gui/MonoDevelop.Ide.Gui.Dialogs.GotoTypeDialog.cs: Generated
- data from gui.stetic apparently changed slightly.
-
-2007-03-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs,
- MonoDevelop.Ide.addin.xml: Added some marker extensions to the
- TextEditorExtension chain, to allow relative positioning of
- extensions.
- * MonoDevelop.Ide.mdp: Don't local-copy references.
-
-2007-03-03 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.Ide.Commands/EditCommands.cs: don't allow paste into readonly tet view
-
-2007-02-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/IExtensibleTextEditor.cs: Completion
- widget is now implemented as a view interface.
- * MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs: Make the Editor
- property return a TextEditor, which is more functional than a
- IEditableTextBuffer.
- * MonoDevelop.Ide.mdp, Makefile.am, MonoDevelop.Ide.Gui/TextEditor.cs:
- New TextEditor class which wraps several editor interfaces.
- * MonoDevelop.Ide.Gui/Document.cs: Added a TextEditor property.
-
-2007-02-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Fix compatible version number.
-
-2007-02-21 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs (AddReferenceToProject): Ensure
- that the dialog is closed even in case of exception being thrown.
-
-2007-02-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs: Added missing
- null check.
-
-2007-02-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Don't remove the child
- when disposing, it will be destroyed with the parent.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs:
- Track api changes.
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs: Use
- ProjectOperations.SaveProject to save projects.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Lock the gui when
- saving/loading a project. When showing the options dialog, only
- save the combine if the user clicks on OK.
- * MonoDevelop.Ide.Gui/StatusProgressMonitor.cs: Optionally lock the gui
- while the progress monitor is active.
- * MonoDevelop.Ide.Gui/Workbench.cs: Added methods for locking/unlocking
- the gui.
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs: Allow locking the main
- window on saving/loading operations.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Change add-in versions to 0.13.
- * MonoDevelop.Ide.Gui/IdeStartup.cs,
- MonoDevelop.Ide.Gui.Search/ForwardTextFileIterator.cs: Don't use
- the file service for temporary file deletes, since it may have side
- effects.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/TreeViewItem.cs: Fix incorrect cast.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp: Disabled building through makefile. Added
- missing file.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/ProjectCommands.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.addin.xml: Added new Reload command.
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs: Show
- combine entries which could not be loaded in the project pad.
- * MonoDevelop.Ide.Gui.Pads/FileList.cs: Dispatch file watcher events
- through the gui thread.
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs: Implemented new type for
- showing arbitrary strings in a TreeViewPad.
- * MonoDevelop.Ide.Gui.Pads/TreeViewItem.cs: New type for showing
- arbitrary strings in a TreeViewPad.
- * MonoDevelop.Ide.mdp, Makefile.am: Added new files.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Track changes in combine
- entry files, and reload them when they change. Make sure the
- CombineOpened event is fired in the gui thread.
-
-2007-02-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Allow jumping to
- declaration of nested classes. Fixes bug #79763.
-
-2007-02-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs: Return
- the correct parent object for resources. Fixes bug #80705.
-
-2007-02-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Don't show the go to
- base command if the selected class does not have a base class, or
- we can't jump to it.
-
-2007-02-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs: Added
- null check.
- * MonoDevelop.Ide.Templates/ProjectTemplate.cs: Don't crash if some
- properties of a template are not set.
- * Base.glade: Made the references dialog a bit bigger by default. Also
- removed the expander, since there is now an VPaned which can be
- used to shrink the refs list.
- * MonoDevelop.Ide.Gui.Dialogs/AssemblyReferencePanel.cs: Show the
- project path by default in the file browser.
- * MonoDevelop.Ide.Gui.Dialogs/SelectReferenceDialog.cs: Show an icon
- for each selected reference.
- * MonoDevelop.Ide.Gui.Dialogs/GacReferencePanel.cs: Show an icon
- together with the name of the reference.
- * MonoDevelop.Ide.Gui.Dialogs/ProjectReferencePanel.cs: Make sure the
- cyclic reference warning is shown at the end of the list.
- * MonoDevelop.Ide.mdp, Makefile.am: Synchronized mdp project with
- makefile.
- * MonoDevelop.Ide.Gui/SdStatusBar.cs: Make sure the status bar is at
- least hight enough to show an icon of Menu size.
-
-2007-02-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Fix variable name.
-
-2007-02-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp, Makefile.am: Synchronized the MD project and the
- Makefile
-
-2007-02-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/ProjectDescriptor.cs: Don't require a
- default language (not needed for generic projects).
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Don't save the combine
- after opening it.
-
-2007-02-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/ProjectCommands.cs,
- MonoDevelop.Ide.addin.xml: Show the list of custom project commands
- in the context menu and in the project menu.
- * templates/GenericProject.xpt.xml, MonoDevelop.Ide.mdp, Makefile.am:
- Added new generic project template.
- * gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.GotoTypeDialog.cs: Updated.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Added new method for
- cleaning combine entries.
-
-2007-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs: Integrate support
- for the parameter information window.
-
-2007-02-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs: Avoid
- using IDotNetLanguageBinding where ILanguageBinding can be used.
- * MonoDevelop.Ide.Commands/FileCommands.cs: Allow opening combine entry
- files in the editor.
- * MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs: Allow selecting
- the file viewer to use when opening a file.
- * MonoDevelop.Ide.Gui/Document.cs: Added title property.
- * MonoDevelop.Ide.Gui/FileViewer.cs: Allow providing an encoding to the
- OpenFile method.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Check for the
- IsCancelRequested flag when loading a combine.
-
-2006-02-02 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.Ide.addin.xml: added icon to select-all action
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/WholeProjectDocumentIterator.cs: When
- searching look into all kind of files, not only in those that are
- going to be compiled.
-
-2007-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: The Move call will delete
- the file from the project, so get the old ProjectFile object before
- doing the move.
-
-2007-02-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/EditCommands.cs: Fix warning.
-
-2007-01-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/EditCommands.cs,
- MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs, MonoDevelop.Ide.addin.xml,
- MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Assigned the Delete
- accelerator to the delete command. Implemented default handlers for
- Delete, Copy, Cut and paste, which now will work for any editable
- widget in the workbench.
-
-2007-01-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Changed confusing field
- name. Added property for getting the list of pads valid for the
- active context. Use that when showing the pad list in the view
- menu.
-
-2007-01-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs: Properly
- update the parent combine when the last entry is removed.
- * MonoDevelop.Ide.Gui/Document.cs: When a project is removed, reset the
- project documents of all opened files which belong to that project.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Added new events which are
- fired when an entry is added to the combine hierarchy.
-
-2007-01-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateLoader.cs,
- MonoDevelop.Ide.CodeTemplates/CodeTemplateGroup.cs,
- MonoDevelop.Ide.Templates/FileTemplate.cs,
- MonoDevelop.Ide.Templates/TextTemplate.cs,
- MonoDevelop.Ide.ExternalTools/ToolLoader.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs: Allow comments in the
- loaded xml. Patch by atsushi@ximian.com (Atsushi Enomoto). Fixes
- bug #80474.
-
-2007-01-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs,
- MonoDevelop.Ide.Tasks/TaskService.cs,
- MonoDevelop.Ide.Tasks/CommentTasksView.cs: Improved the error pad
- performance when adding messages, by implementing an Add method
- which takes blocks of tasks.
-
-2007-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs,
- MonoDevelop.Ide.Commands/CustomStringTagProvider.cs,
- MonoDevelop.Ide.Gui/Document.cs, MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs,
- MonoDevelop.Ide.Gui.BrowserDisplayBinding/HtmlViewPane.cs,
- MonoDevelop.Ide.Gui.BrowserDisplayBinding/BrowserDisplayBinding.cs,
- MonoDevelop.Ide.Gui.Search/SearchReplaceManager.cs: Use the new
- GetContent method instead of casting the view to the required
- interface.
-
-2007-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs,
- MonoDevelop.Ide.Commands/RefactoryCommands.cs,
- MonoDevelop.Ide.Gui/ViewCommandHandlers.cs,
- MonoDevelop.Ide.Codons/WindowActiveCondition.cs,
- MonoDevelop.Ide.Gui.Search/CurrentDocumentIterator.cs,
- MonoDevelop.Ide.Gui.Search/SearchReplaceManager.cs,
- MonoDevelop.Ide.Gui.Search/SearchReplaceUtilities.cs,
- MonoDevelop.Ide.Gui.Search/SearchReplaceInFilesManager.cs: Track
- api changes in Document class.
- * MonoDevelop.Ide.Gui/Document.cs,
- MonoDevelop.Ide.Gui/IBaseViewContent.cs,
- MonoDevelop.Ide.Gui/AbstractBaseViewContent.cs: Added a GetContent
- method for getting a specific interface implementation from a view.
- It's better than just casting the view to a specific interface
- because the view can in this way implement interfaces in classes
- other the main view. It simplifies the work in views which are
- composed by multiple views.
-
-2007-01-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/TemplateCompletionDataProvider.cs:
- Track api changes.
- * MonoDevelop.Ide.Gui.Content/IExtensibleTextEditor.cs,
- MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs,
- MonoDevelop.Ide.addin.xml, MonoDevelop.Ide.Gui/Document.cs,
- MonoDevelop.Ide.Gui/Workbench.cs: Implemented new extension point,
- which allows providing custom support for code completion to
- editors.
- * MonoDevelop.Ide.Gui.Dialogs/GotoTypeDialog.cs, gtk-gui/generated.cs,
- gtk-gui/MonoDevelop.Ide.Gui.Dialogs.GotoTypeDialog.cs,
- gtk-gui/gui.stetic: Use the new partial class model.
- * MonoDevelop.Ide.mdp, Makefile.am: Updated.
-
-2007-01-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/FileCommands.cs,
- MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs: Don't allow
- opening remote files.
-
-2007-01-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs:
- Allow deleting folders which don't belong to a project.
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Dispose all views before
- shutting down.
-
-2007-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs: Dispose
- projects and combines after removing them.
-
-2007-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/TaskListPad.cs: Fixed warnings.
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Fix crash that happens when
- the view list changes while closing the views.
-
-2007-01-19 Marek Sieradzki <marek.sieradzki@gmail.com>
-
- * MonoDevelop.Ide.Templates/CombineDescriptor.cs,
- MonoDevelop.Ide.Templates/FileTemplate.cs,
- MonoDevelop.Ide.Templates/CombineEntryDescriptor.cs,
- MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs,
- MonoDevelop.Ide.Templates/ProjectTemplate.cs,
- MonoDevelop.Ide.Templates/ProjectDescriptor.cs,
- MonoDevelop.Ide.Commands/FileCommands.cs,
- MonoDevelop.Ide.Commands/ToolsCommands.cs,
- MonoDevelop.Ide.Commands/ProjectCommands.cs,
- MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ResourceFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Dialogs/IncludeFilesDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/SharpDevelopAboutPanels.cs,
- MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs,
- MonoDevelop.Ide.Gui/Document.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs,
- MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/SdStatusBar.cs,
- MonoDevelop.Ide.Gui.Search/SearchReplaceInFilesManager.cs:
- Removed redundant String.Format ().
-
-2007-01-16 Lluis Sanchez Gual <lluis@novell.com>
-
- Added check for null file names.
-
-2007-01-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs: Made IsValidForProject
- protected, so it can be overriden by FileTemplate subclasses.
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs:
- Fixed minor bug that avoids showing files that don't exist in the
- project pad.
-
-2007-01-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Base.glade: Fixed some layout problems in the new project dialog.
-
-2007-01-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp: Updated.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Use the new
- ReadCombineEntry method.
-
-2006-12-22 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Add "MonoDevelop" to file filter names
- "Solution Files" and "Project Files" .
-
-2006-12-20 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Gui/HelpOperations.cs (CheckExternalMonodoc): New. Check
- whether the available monodoc is recent version (supports --remote-mode).
- This check is done on the first call to ShowHelp. If its unsuccesful,
- then it falls back to use the integrated HelpViewer.
- (ShowHelpExternal): New. Show help using the external monodoc. Fall back
- on HelpViewer in case of any errors.
-
-2006-12-17 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * options/MonoDevelop-templates.xml: Use standard keywords
- for some of the templates and added a template for foreach.
- Fixes bug #80125.
-
-2006-12-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs: Track changes in
- FileService API. Make some attributes optional. Added better error
- checks for mandatory attributes.
- * MonoDevelop.Ide.Templates/CombineDescriptor.cs,
- MonoDevelop.Ide.Templates/TextTemplate.cs,
- MonoDevelop.Ide.Templates/ProjectDescriptor.cs,
- MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs,
- MonoDevelop.Ide.Gui.OptionPanels/ExternalToolPanel.cs,
- MonoDevelop.Ide.Commands/ProjectCommands.cs,
- MonoDevelop.Ide/Services.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs,
- MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolder.cs,
- MonoDevelop.Ide.Gui.Dialogs/IncludeFilesDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs,
- MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs,
- MonoDevelop.Ide.Gui.Pads/FileList.cs,
- MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs,
- MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs,
- MonoDevelop.Ide.Gui/Document.cs,
- MonoDevelop.Ide.Gui/AbstractViewContent.cs,
- MonoDevelop.Ide.Gui/ProjectOperations.cs,
- MonoDevelop.Ide.Gui/Workbench.cs,
- MonoDevelop.Ide.Gui/IdeStartup.cs,
- MonoDevelop.Ide.Gui/DefaultWorkbench.cs,
- MonoDevelop.Ide.Gui/Ide.cs,
- MonoDevelop.Ide.Tasks/CommentTasksView.cs,
- MonoDevelop.Ide.Gui.Search/ForwardTextFileIterator.cs: Track
- changes in FileService API.
-
-2006-12-14 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/WordCountDialog.cs:
- Fixed sorting and removed a lot of unnecessary code.
-
-2006-12-13 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Commands/WindowCommands.cs: Ensure that
- filenames containing underscores are escape correctly.
- Fixes bug #79766. Thanks to John Millikin.
-
-2006-12-13 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * Base.glade: Added a VPaned to the Edit References dialog.
-
-2006-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs,
- MonoDevelop.Ide.Gui/AddEntryEventHandler.cs: Provide the combine
- when firing the AddingEntryToCombine event.
-
-2006-12-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp, Makefile.am,
- MonoDevelop.Ide.Gui/AddEntryEventHandler.cs: Added file
- AddEntryEventHandler.cs.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Fire the
- AddingEntryToCombine event just before adding the entry.
-
-2006-12-05 Ankit Jain <jankit@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs (backgroundLoadCombine): Try
- to load the corresponding .mds only if loading a .mdp
-
-2006-12-01 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * gtk-gui/generated.cs:
- * gtk-gui/gui.stetic:
- Changed goto to go to.
-
-2006-12-01 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.addin.xml: Changed goto to go to.
-
-2006-11-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.mdp: Added some missing resources.
- * MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs: Added some null
- checks.
- * MonoDevelop.Ide.Tasks/Task.cs, MonoDevelop.Ide.Tasks/TaskService.cs:
- Avoid relative path names in the task service.
- * MonoDevelop.Ide.Gui.Search/SearchReplaceManager.cs: Fix endless loop
- issue. Fixes bug #79526.
-
-2006-11-28 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Commands/SearchCommands.cs:
- * MonoDevelop.Ide.Gui.Dialogs/GotoClassDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/GotoTypeDialog.cs:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.mdp:
- * gtk-gui/generated.cs:
- * gtk-gui/gui.stetic:
- * Makefile.am:
- Renamed Goto Class to Goto Type.
-
-2006-11-27 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs:
- Re-enabled "Find All References" functionality.
-
-2006-11-26 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.Ide.Gui/LayoutComboBox.cs: added
- * MonoDevelop.Ide.Gui/Workbench.cs: defined LayoutChanged event and firing
- * MonoDevelop.Ide.Commands/ViewCommands.cs: added LayoutSelector to ViewCommands enum
- * MonoDevelop.Ide.addin.xml: new LayoutSelector action and added layout toolbar
- * MonoDevelop.Ide/Makefile.am:
- * MonoDevelop.Ide/MonoDevelop.Ide.mdp: newly added file
-
-2006-11-22 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs: remember last used filter
-
-2006-11-21 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.Ide.Tasks/CommentTasksView.cs: fixed casting
-
-2006-11-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/EditCommands.cs,
- MonoDevelop.Ide.Gui/Workbench.cs: Created new method for showing
- the global preferences, with a parameter which allows showing a
- specific page.
-
-2006-11-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Tasks/TaskService.cs: Use global events to keep track
- of renamed and removed files, instead of subscribing to a
- particular combine. Update the comment tags only if the
- TaskListTokens property changes. Added default values for the
- TaskListTokens property.
-
-2006-11-15 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.Ide.Tasks/TaskService.cs: re-enabling handlers
-
-2006-11-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/LinkedFilesFolderNodeBuilder.cs:
- Fix warning.
- * MonoDevelop.Ide.Tasks/UserTasksView.cs: Don't use CellRendererCombo
- since it's gtk 2.6.
- * MonoDevelop.Ide.Tasks/TaskService.cs: Disabled loading of tasks
- since it hangs when loading the MD solution. Fixed warning.
- Make sure OnCommentTasksChanged is called asynchronously to
- avoid deadlocks in the parser service.
-
-2006-11-13 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.Ide.Tasks/CommentTasksView.cs:
- * MonoDevelop.Ide.Tasks/UserTasksView.cs: added
-
-2006-11-13 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp:
- * Base.glade: updated
- * MonoDevelop.Ide.addin.xml: renamed Task List pad -> Error List pad, added Task List pad, added User and Comments Task List Pad Views
- * MonoDevelop.Ide.Gui.Pads/OpenTaskView.cs: removed (renamed to ErrorView)
- * MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs:
- * MonoDevelop.Ide.Gui.Pads/TaskListPad.cs:
- * MonoDevelop.Ide.Codons/TaskListViewCodon.cs:
- * MonoDevelop.Ide.Tasks/UserTask.cs:
- * MonoDevelop.Ide.Tasks/ITaskListView.cs:
- * MonoDevelop.Ide.Tasks/TaskPriority.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs: added
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: track API changes
- * MonoDevelop.Ide.Tasks/Task.cs: changed TaskType enum, added Priority property, new Constructors
- * MonoDevelop.Ide.Tasks/TaskService.cs: refactored, added User Tasks and Comment Tasks functionality
-
-2006-11-11 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * /MonoDevelop.Ide.Commands/FileCommands.cs: fix for bug 79410
-
-2006-10-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/LinkedFilesFolderNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/LinkedFilesFolder.cs:
- * icons/Icons.16x16.LinkOverlay.png:
- * MonoDevelop.Ide.addin.xml:
- Implemented support for files outside of a project directory.
- Fixes bug #79296. FolderNodeBuilder.cs code contributed by Chris Morgan.
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp: Updated.
-
-2006-10-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Make sure combine events
- are dispatched in the GUI thread.
-
-2006-10-06 Andrés G. Aragoneses <knocte@gmail.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/ReplaceDialog.cs: Improved string.
-
-2006-09-26 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Commands/ViewCommands.cs:
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs:
- * MonoDevelop.Ide.addin.xml:
- Added functionality to expand all nodes.
-
-2006-09-25 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs:
- Re-enabled "Find Derived Classes" functionality.
-
-2006-09-24 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs:
- * MonoDevelop.Ide.Gui.Search/SearchReplaceManager.cs:
- * MonoDevelop.Ide.Gui.Search/SearchReplaceInFilesManager.cs:
- Fixed some pluralization issues.
-
-2006-09-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/OpenTaskView.cs: Track API changes.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Fire the
- Begin/End build events in the GUI thread.
-
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Fire the OnExiting
- and OnExited events when closing the IDE.
-
-2006-09-19 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GotoClassDialog.cs:
- Added caching of icons. Removed namespace column
- and added the namespace to the class column instead.
-
-2006-09-19 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GotoClassDialog.cs:
- Added icons.
-
-2006-09-19 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GotoClassDialog.cs:
- Fixed problem which occurred when the main solution
- has multiple subsolutions.
-
-2006-09-19 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * .: Added svn:ignore for MonoDevelop.Ide.pidb
-
- * gtk-gui/generated.cs:
- * gtk-gui/gui.stetic:
- GUI code for GotoClassDialog.
-
- * MonoDevelop.Ide.mdp:
- * Makefile.am:
- Added GotoClassDialog.
-
- * MonoDevelop.Ide.Commands/SearchCommands.cs:
- Added GotoClassCommand.
-
- * MonoDevelop.Ide.Gui.Dialogs/GotoClassDialog.cs:
- The GotoClassDialog.
-
- * MonoDevelop.Ide.addin.xml:
- Added menu item for the GotoClassDialog.
-
-2006-09-12 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Win32 URI workaround.
- * MonoDevelop.Ide.Gui/Workbench.cs: Win32 URI workaround.
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Autoinitialize VFS, TCP IPC fixes.
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Win32 URI workaround.
-
-2006-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs:
- Don't show files which are not under the project directory.
-
-2006-09-11 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.addin.xml: A few minor HIG updates.
-
-2006-09-07 Andrés G. Aragoneses <knocte@gmail.com>
-
- * MonoDevelop.Ide.Templates/CombineDescriptor.cs:
- * MonoDevelop.Ide.Templates/CombineEntryDescriptor.cs:
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- * MonoDevelop.Ide.Templates/ProjectDescriptor.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Gui/Workbench.cs: Improved strings and fixed typo.
-
-2006-08-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/SearchReplaceManager.cs: Fix the build.
-
-2006-08-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Properly report file open errors.
- * MonoDevelop.Ide.Gui.Search/SearchReplaceManager.cs: Don't crash if
- a file can't be opened.
-
- * MonoDevelop.Ide.Gui.Search/FileDocumentInformation.cs:
- * MonoDevelop.Ide.Gui.Search/ForwardTextFileIterator.cs: Use Read file
- share for reading the file.
-
-2006-08-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/OpenTaskView.cs: Make the toolbar smaller
- and add some spacing.
- * MonoDevelop.Ide.mdp: Removed unused file.
- * MonoDevelop.Ide.Gui/Document.cs: Unsubscribe ActiveViewContentChanged
- event when the window is closed.
- * MonoDevelop.Ide.Gui/Workbench.cs: Fixed error message.
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Added some missing Destroys().
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Unsubscribe events to avoid
- memory leaks.
-
-2006-08-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceNodeBuilder.cs: Fixed
- exception when trying to update an empty tree.
- * MonoDevelop.Ide.Gui/Workbench.cs: Don't crash if a file load fails.
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Route commands through
- the view, before routing to the parent.
-
- * MonoDevelop.Ide.Gui.Dialogs/SelectReferenceDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/AssemblyReferencePanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/GacReferencePanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/ProjectReferencePanel.cs: Several fixes
- and code refactoring that closes bug #79099.
-
-2006-08-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs: Don't show
- the encoding selector when a folder is selected.
-
-2006-08-10 Scott Ellington <scott.ellington@gmail.com>
-
- * MonoDevelop.Ide.Gui/IViewContent.cs: add StockIconId property
- * MonoDevelop.Ide.Gui/AbstractViewContent.cs: implement ^^
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: use StockIconId
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: use StockIconId
-
-2006-08-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/ProjectCommands.cs: Added deploy command.
- Build the project before deploying.
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs: Set the pad as command
- target when showing the context menu. Fixes bug #76141.
- * MonoDevelop.Ide.Gui.Pads/OpenTaskView.cs: Added null check.
- * MonoDevelop.Ide.addin.xml: Added deploy command.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Added Deploy method.
-
-2006-08-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/IEncodedTextContent.cs: New interface.
- * Base.glade: Added dialog for managing encodings.
- * MonoDevelop.Ide.Commands/FileCommands.cs: Moved most of the code
- to FileSelectorDialog.
- * MonoDevelop.Ide.Gui/FileViewer.cs: Track api changes.
-
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/Document.cs: Implemented support for saving
- and loading files using a specific text encoding.
-
- * MonoDevelop.Ide.Gui.BrowserDisplayBinding/BrowserDisplayBinding.cs:
- Track api changes. CreateContentForFile should only create the
- view, not load it.
-
-2006-07-30 Matej Urbas <matej.urbas@gmail.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ClassNodeBuilder.cs: Removed a trace
- message.
-
-2006-07-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ClassData.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceData.cs:
- Added some null checks.
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs:
- In OnEntryAdded, delay the tree update a bit, since the parser
- database is updated using the same event, so we have to wait
- until it is updated.
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:
- When adding files, set the current selected folder as
- default directory.
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs: Removed unused column.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: When adding a combine
- entry to a combine, use the combine folder as default directory.
-
-2006-07-21 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Improve name file generation. Use defaultExtension for filenames
- that specify neither a language nor a name pattern.
- * MonoDevelop.Ide.Gui.BrowserDisplayBinding/BrowserDisplayBinding.cs:
- Make browser preview more robust (missed earlier).
-
-2006-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs: Don't ctash
- for file which don't have a language.
- method to ProjectOperations.
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs: When disposing the dialog,
- destroy it.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Moved GoToDeclaration
-
-2006-07-20 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.Ide.Gui.BrowserDisplayBinding/HtmlViewPane.cs: Make
- independent of SourceEditor by using ITextBuffer instead; re-enable
- live secondary view of html pages.
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Re-enable and re-work
- support for secondary ViewContents.
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs:
- * MonoDevelop.Ide.Gui/IWorkbenchWindow.cs: Add an event to detect when
- the active ViewContent changes.
-
- * MonoDevelop.Ide.Gui/IBaseViewContent.cs:
- * MonoDevelop.Ide.Gui/AbstractBaseViewContent.cs:
- * MonoDevelop.Ide.Gui/AbstractViewContent.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs: New method bool CanReuseView (string
- fileName), used to determine whether an existing ViewContent can be
- used instead of re-opening a file.
-
- * MonoDevelop.Ide.Gui/IBaseViewContent.cs:
- * MonoDevelop.Ide.Gui/ISecondaryViewContent.cs:
- * MonoDevelop.Ide.Gui/IViewContent.cs: Move TabPageLabel back into into
- the base interface, as it is duplicated in both deriving interfaces.
-
- * MonoDevelop.Ide.Gui/Document.cs: Add a property to retrieve the active
- IViewContent, and an event to detect when it changes.
-
-2006-07-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:
- Removed call to StealFocus, since StartLabelEdit already does it.
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs: Removed StealFocus
- method and merged into StartLabelEdit.
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Removed workaround
- for showing a dock item, since it now works.
-
-2006-07-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Fix some problems
- with tab reordering.
-
-2006-07-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- In IsValidName, don't crash if the language name is not provided.
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs:
- The IncludeInDeploy command now sets the new BuildAction.FileCopy flag.
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs: Removed
- unused command.
- * MonoDevelop.Ide.Gui.Dialogs/GacReferencePanel.cs: Track api changes.
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs: Removed unused treeview.
- Renamed some fields for clarity. Catch some exceptions.
- * MonoDevelop.Ide.mdp: Updated.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Removed unused method.
-
-2006-07-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Base.glade: Fix some accelerators in the new project dialog.
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Add support for
- "Go to declaration" for local variables.
- * MonoDevelop.Ide.Commands/ProjectCommands.cs: Added command for
- configuring deploy targets.
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs: Moved
- handling of command ProjectCommands.Options to a global handler,
- so it can be used in the main menu.
-
- * MonoDevelop.Ide.addin.xml: Added new ConfigureDeployTargets command.
- Renamed Run menu to Project, which I think makes more sense.
- Commented out currently unused debugger commands.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: In ShowOptions, support
- showing a specific options panel.
-
-2006-07-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs: Show startup
- projects in bold.
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs: Update the
- tree when the startup project changes.
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs: Use the LeftMargin
- property for indenting, this fixes bug #78387.
-
-2006-07-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/AssemblyReferencePanel.cs: Show errors
- in a modal dialog.
- * MonoDevelop.Ide.Gui.Dialogs/SelectReferenceDialog.cs: Added getter
- for the window.
-
-2006-07-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/ProjectReferencePanel.cs: Don't allow
- selecting projects which can cause cyclic dependencies.
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Remove debug message.
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: When loading a layout,
- make sure the documents dock item is always shown.
- * MonoDevelop.Ide.Tasks/Task.cs: Added null check.
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs: Fix
- warning. Use a darker color for the label.
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs:
- * MonoDevelop.Ide.Gui.Dialogs/AssemblyReferencePanel.cs: Fix warnings.
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.addin.xml: Added icon for background parsing.
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp: Updated.
-
-2006-07-10 Alejandro Serrano <trupill@yahoo.es>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ClassNodeBuilder.cs:
- Show generic parameters on class nodes.
-
-2006-07-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs:
- Show system files in grey color.
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs:
- Show a warning message in the label when a language binding
- of a project can't be found.
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs: Allow markup in a tree view.
-
-2006-07-05 Michael Hutchinson <m.j.hutchinson@gmail.com
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs: Fix name
- generation for templates that don't have "name" attribute but have
- "DefaultName" attribute set.
-
-2006-07-05 Matej Urbas <matej.urbas@gmail.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Updated to use ReturnType
- as BaseTypes in IType instances.
-
-2006-07-04 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * Core/src/MonoDevelop.Ide/MonoDevelop.Ide.addin.xml:
- * Core/src/MonoDevelop.Ide/Makefile.am:
- * Core/src/MonoDevelop.Ide/MonoDevelop.Ide.mdp:
- * MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs:
- New file. Template translates source code from any CodeDom-parseable
- language to any CodeDom language.
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs: Add support
- for templated filenames. Reduced complexity of name determination code.
-
-2006-07-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/AbstractPadContent.cs: Made Initialize
- method virtual.
- * MonoDevelop.Ide.Gui/IPadContainer.cs: Don't fire the PadShown
- and PadHidden events here, the workspace layuot takes care
- of that now.
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Fire the PadShown
- and PadHidden events.
- * MonoDevelop.Ide.Gui/Pad.cs: Change visibility of the pad
- using the internal IPadWindow.
-
-2006-07-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/ProjectTemplate.cs:
- * MonoDevelop.Ide.Templates/CombineDescriptor.cs: Added support
- for Combine sublasses in templates.
-
- * MonoDevelop.Ide.addin.xml:
- Updated add-in and references versions.
- * MonoDevelop.Ide.Commands/ViewCommands.cs:
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs: Implemented Refresh
- command for tree pads. Allow changing the set of node builders
- at run time (to support run-time assembly loading).
-
- * MonoDevelop.Ide.Commands/ProjectCommands.cs: Run the deploy
- command in a background thread.
-
- * MonoDevelop.Ide.Commands/HelpCommands.cs: Destroy the about
- dialog when done.
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFile.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs: Added
- flag to SystemFile to make the semi-transparent icon optional.
-
- * MonoDevelop.Ide.Gui.Dialogs/SelectReferenceDialog.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs:
- Track api changes in ProjectReference.
-
- * MonoDevelop.Ide.Gui.Dialogs/SplashScreen.cs: Destroy the dialog
- when done.
- * MonoDevelop.Ide.Gui/Workbench.cs: Avoid switching layout when not
- necessary.
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Explicitely route commands
- coming from pads to the main frame. It makes commands work for detached
- pads.
- * MonoDevelop.Ide.Codons/SolutionPadCodon.cs: Update tree pads when loading
- assemblies which add new node builders.
-
-2006-06-29 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs:
- * MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs:
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Add IsValidName hook for new file dialogue to check filename validity.
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Add virtual ModifyTags method for deriving classes to hook into tag
- substitution.
- Make GetFileName virtual, correct extension-checking logic.
-
- * MonoDevelop.Ide.Templates/ProjectTemplate.cs:
- Allow project templates to specify multiple supported languages (comma-
- separated, with "*" as a wildcard for all .NET langauges.
- Logic is a little odd, but public API is unchanged.
-
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs:
- Allow file templates to specify multiple supported languages (comma-
- separated, with "*" as a wildcard for all .NET langauges.
- Use tempates' IsValidName method to check for valid filenames.
-
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs:
- Fix build command -- current SVN mcs seems to treat monitorId++ as null.
-
- *MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: Add my name.
-
-2006-06-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Commands/ProjectCommands.cs: Implemented
- DeployTargetList command.
-
-2006-06-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/DisplayBindingService.cs:
- * MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs:
- * MonoDevelop.Ide.Templates/ProjectTemplate.cs:
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide.Templates/FileTemplate.cs: Use the new extension
- listeners to read extensions.
-
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs: Added null check.
-
- * MonoDevelop.Ide.Gui/AddinUpdateHandler.cs: After running the
- add-in manager, load newly activated add-ins.
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Create new toolbars and
- main menu when new items are added by add-ins.
-
-2006-06-08 Matej Urbas <matej.urbas@gmail.com>
-
- * Monodevelop.Ide.Gui/Document.cs: Fixed the way ViewOnly documents
- influence save operations. One cannot save ViewOnly documents anymore.
- * Monodevelop.Ide.Gui/ViewCommandHandlers.cs: Added OnUpdateSaveFileAs
- handler and fixed OnUpdateSaveFile.
-
-2006-06-05 Scott Ellington <scott.ellington@gmail.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs:
- Added my name.
-
-2006-06-03 John Luke <john.luke@gmail.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs:
- use Path.GetInvalidPathChars to fix obsolete warning
-
-2006-06-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/StatusProgressMonitor.cs: Added an option
- for not showing the task titles in the status bar (will always
- show the initial title in this case).
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs: Use the previous option
- for the save progress monitor.
-
-2006-05-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs: Moved field initialization to
- the Initialize method, to make sure child objects are
- not created before the whole infrastructure is ready.
-
-2006-05-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/ViewCommands.cs:
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs:
- Implemented OpenWith command for project files.
-
- * MonoDevelop.Ide.Gui/DisplayBindingService.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs: Implemented GetFileViewers
- command, which returns all available viewers (internal or
- external) for a file.
-
- * MonoDevelop.Ide.Codons/IDisplayBinding.cs:
- * MonoDevelop.Ide.Gui.BrowserDisplayBinding/BrowserDisplayBinding.cs:
- Added DisplayName property to IDisplayBinding.
-
- * MonoDevelop.Ide.mdp:
- * Makefile.am: Updated.
-
-2006-05-29 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.Ide.Gui.Content/ICodeStyleOperations.cs: reverted interface changes
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: implemented upper/lower functionality here
-
-2006-05-23 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.Ide.Gui.Content/ICodeStyleOperations.cs: enhanced interface for new editor actions
- * MonoDevelop.Ide.Commands/EditCommands.cs: added new enum members for these actions
- * MonoDevelop.Ide.addin.xml: included in edit menu
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: default handlers
-
-2006-05-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Track api changes.
-
-2006-05-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Codons/WorkbenchContextCodon.cs:
- * MonoDevelop.Ide.Codons/SolutionPadCodon.cs: Use the new ChildCodons
- attribute instead of Category.
- * MonoDevelop.Ide.addin.xml: Added application description.
-
-2006-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Updated versions.
- * MonoDevelop.Ide.mdp: Updated.
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Do check for bug 77135 only
- in suse 10.
-
-2006-04-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/GacReferencePanel.cs:
- * MonoDevelop.Ide.Gui.Dialogs/SelectReferenceDialog.cs:
- Show only assemblies valid for the target runtime version
- of the project.
-
-2006-04-20 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Save solution
- preferences in the actual solution directory instead of in
- .config/MonoDevelop/CombinePreferences. Fixed bug #78036.
-
-2006-04-19 Andrés G. Aragoneses <knocte@gmail.com>
-
- * Base.glade: improved string.
-
-2006-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs: When
- adding files to a project, don't save the project until
- all files have been added. Also show a progress monitor
- when adding many files.
-
-2006-04-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs: Fixed crash after
- renaming a folder (bug #78134).
-
-2006-04-18 Andrés G. Aragoneses <knocte@gmail.com>
-
- * MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs:
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs: Added strings to l10n.
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Fixed typo.
-
-2006-04-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- If the template provides a file name with extension, don't
- replace it. Fixes bug #78040.
-
-2006-04-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/SplashScreen.cs: Don't create the
- splash window in the static initializer, since it may be created
- before GTK is initialized.
-
-2006-04-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.BrowserDisplayBinding/BrowserDisplayBinding.cs:
- Fix null ref exception in Ubuntu. Fix by Sebastian Dröge.
-
-2006-04-17 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * Base.glade: Fixed typo.
-
-2006-04-07 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.Ide.Commands/FileCommands.cs: Added filtering in File dialog
- * MonoDevelop.Ide.addin.xml: renamed attribute in FileFilter Extension
-
-2006-04-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Codons/NodeBuilderCodon.cs:
- * MonoDevelop.Ide.Codons/PadOptionCodon.cs:
- * MonoDevelop.Ide.Codons/DisplayBindingCodon.cs:
- * MonoDevelop.Ide.Codons/SolutionPadCodon.cs:
- * MonoDevelop.Ide.Codons/ProjectTemplateCodon.cs:
- * MonoDevelop.Ide.Codons/PadCodon.cs:
- * MonoDevelop.Ide.Codons/ContextPadCodon.cs:
- * MonoDevelop.Ide.Codons/FileTemplateCodon.cs:
- * MonoDevelop.Ide.Codons/FileTemplateTypeCodon.cs:
- * MonoDevelop.Ide.Codons/WorkbenchContextCodon.cs:
- * MonoDevelop.Ide.addin.xml: Add documentation.
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp: Removed unused file.
-
-2006-04-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: Minor fix.
-
-2006-04-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/AllOpenDocumentIterator.cs:
- Skip documents which are not text buffers while iterating
- through all open files.
-
-2006-04-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Removed cshrp.net.
- * icons/SplashScreen.png: Minor update.
-
-2006-04-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/SharpDevelopAboutPanels.cs:
- Add some spacing and make the first column of the
- assembly list rezisable.
- * MonoDevelop.Ide.Gui.Dialogs/SplashScreen.cs: Embed the
- progress bar into the bitmap.
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: Improved.
- * Makefile.am: Added new bitmap.
- * icons/Icons.AboutImage:
- * icons/SplashScreen.png: Use the current logo for the about
- box and splash window.
-
-2006-03-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Break compatibility
- with old versions.
-
-2006-03-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Added option for
- using the tcp channel for IPC, instead of the unix channel.
-
-2006-03-29 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.mdp:
- * Makefile.am:
- * MonoDevelop.Ide.Gui/TipOfTheDayStartupHandler.cs:
- Added a startup handler to ensure that the tip of the day
- window is showed at startup if configured to do so.
-
-2006-03-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/ProjectDescriptor.cs: ProjectReference
- doesn't have a setter for ReferenceType anymore.
- * Makefile.am: Removed unused file.
-
-2006-03-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/SelectReferenceDialog.cs:
- Renamed the GAC tab to Packages tab. The references dialog don't
- show assemblies in the gac, but from properly registered packages.
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Added a better explanation for
- a common crash.
-
-2006-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/AddinLoadErrorDialog.cs:
- Don't show the stack trace for exceptions of type
- MissingDependencyException.
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Added a check for
- bug #77135.
-
-2006-03-21 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/CodeGenerationPanel.cs:
- Apply one Glade.Widget per field. Fixes bug 77715.
-
-2006-03-16 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: If a pad
- is iconified remember to uniconify it before showing it.
- Fixes bug 77604.
-
-2006-03-16 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide/Services.cs:
- * MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs:
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide.Gui/HelpViewer.cs:
- Use new DocumentationService.
-
-2006-03-12 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * Base.glade: Marking some strings not to be translated. Not include
- balast in pot file.
-
-2006-03-14 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.Ide.Gui.Search/SearchReplaceInFilesManager.cs: Trim
- search results. Also strip ^M from source.
-
-2006-03-14 Michael Hutchinson <m.j.hutchinson@gmail.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/IncludeFilesDialog.cs:
- Make sure that Glade looks for the resource file in
- the correct assembly
-
-2006-03-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Don't show
- the enclosing item if it is the same as the identified item.
- Implemented FindDerivedClasses.
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs:
- Update the entry count when solution entries change.
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs: Update the node
- label after renaming.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Added CodeRefactorer
- property.
-
-2006-03-07 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui.Pads/OpenTaskView.cs: Added fix for
- bug 77449. Thanks to David Makovský.
-
-2006-03-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- * MonoDevelop.Ide.Templates/ResourceFileDescriptionTemplate.cs:
- Implemented template for adding resources to a project.
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ResourceFolderNodeBuilder.cs:
- When adding a resource to a project, if the file is already
- present in the project, just change the build action.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs: Update
- the tree when the properties of a project file change.
- * MonoDevelop.Ide.addin.xml: Registered some templates moved
- from the c# binding.
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp: Updated.
-
-2006-03-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs: If text editing
- is cancelled, restore the original text. Also avoid
- editing the name if it is already being edited.
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/Ide.cs: Don't exit if the user cancels
- the operation.
-
-2006-03-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs:
-
-2006-03-03 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui.Pads/FileScout.cs: Added fix for
- bug 77600. Thanks to Levi Bard.
-
-2006-03-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ClassNodeBuilder.cs: Wrap
- inner classes with a ClassData object when adding them to the
- tree. Fixes bug #77695.
-
-2006-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/IViewContent.cs:
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/AbstractViewContent.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs:
- * MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs:
- Removed HasProject property from IViewContent.
-
-2006-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/ProjectDescriptor.cs:
- * MonoDevelop.Ide.Templates/FileTemplate.cs: Added
- directory parameter to AddToProject.
-
- * MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs:
- Same as previous. Also added Show method.
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- Create the file in the correct directory. Implemented Show ().
-
-2006-02-28 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: Updated
- authors.
-
-2006-02-28 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui.Pads/OpenTaskView.cs: Fixed update
- of buttons.
-
-2006-02-28 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Fixed plural
- issues.
-
-2006-02-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs: Changed
- the extensio model for file templates. Now all work
- is done by FileDescriptionTemplate.
- * MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs:
- this is now a base class for different types of file
- templates. It has several overridable methods for
- generating file content.
- * MonoDevelop.Ide.Templates/ProjectDescriptor.cs:
- Most of the funcionality of creating and adding files
- to the project has been moved to FileDescriptionTemplate.
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Added
- null check.
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ClassNodeBuilder.cs:
- Don't show members for classes of type Delegate.
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs: Track
- api changes.
-
- * templates/EmptyStruct.xft.xml:
- * templates/EmptyClass.xft.xml:
- * templates/EmptyInterface.xft.xml:
- * templates/EmptyEnum.xft.xml: Use the new syntax for
- specifying CodeDom file templates.
-
- * MonoDevelop.Ide.addin.xml: Added new extension point
- for registering new FileDescriptorTemplates.
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp: Updated.
-
- * MonoDevelop.Ide.Codons/IDisplayBinding.cs:
- * MonoDevelop.Ide.Gui.BrowserDisplayBinding/BrowserDisplayBinding.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs: Use a Stream paramenter
- instead of a String for providing the content for a document.
-
- * MonoDevelop.Ide.Templates/TextFileDescriptionTemplate.cs:
- * MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs:
- * MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:
- * MonoDevelop.Ide.Codons/FileTemplateTypeCodon.cs: New files.
-
-2006-02-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: Use one
- line per field, in order to get attributes properly applied.
-
-2006-02-19 Andrés G. Aragoneses <knocte@gmail.com>
-
- * Base.glade: improved a string.
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: fixed a
- typo in a comment.
- * MonoDevelop.Ide.addin.xml: improved some strings and
- added other ones to l10n (changed to fix bug #77516).
-
-2006-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectSolutionPad.cs:
- Delay file selection in the tree when switching documents.
- * MonoDevelop.Ide.Gui/Document.cs: Notify file changes when
- saving documents.
- * MonoDevelop.Ide.Gui/Ide.cs: Added new Services member to
- IdeApp which provides access to most of services used in
- the Ide.
-
-2006-02-14 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui.Pads/OpenTaskView.cs: Fixed plural
- issues with labels. Removed code duplication.
-
-2006-02-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs: Honor the
- AllowRename flag.
- * MonoDevelop.Ide.Gui.OptionPanels/ExternalToolPanel.cs:
- * MonoDevelop.Ide.Gui/SdStatusBar.cs: Remove Gnome reference.
-
-2006-02-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads/OpenTaskView.cs: Implement filtering
- in tasklist by item types. Patch by David Makovský.
-
-2006-01-31 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui/Document.cs: Make sure that a null ContentName
- is handled in IsBuildTarget. Fixes bug 77361.
-
-2006-01-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/RefactoryCommands.cs: When selecting
- a field or property, add refactoring submenu for the member type.
-
- * MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs: Track
- changes in parser api.
-
-2006-01-25 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * Base.glade: Fixed spelling of add-in.
-
-2006-01-25 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs:
- Make sure the correct tab is removed. Fixes bug 76900.
-
-2006-01-24 Muthiah Annamalai <gnumuthu@users.sf.net>
-
- * Monodevelop.Core.Gui.Dialogs/NewFileDialog.cs:
- Added double-click response to expand category tree or
- collapse tree, a toggle effect.
-
-2006-01-24 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * Base.glade: Fixed spelling mistake.
-
-2006-01-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/CombineDescriptor.cs: Added getter for
- the list of entry descriptors. Take the combine name from the new
- ProjectCreateInformation.CombineName property.
- * MonoDevelop.Ide.Templates/ProjectTemplate.cs: Added Id property
- (taken from the codon ID). Added CreateCombine method, which does
- what CreateProject was doing until now. CreateProject now creates
- a project but not a combine.
-
- * Base.glade:
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: Some improvements
- in the new project dialog.
-
- * MonoDevelop.Ide.addin.xml: Use some new icons for new project and
- new solution. Moved here the BlankSolution template from the CSharpBinding.
- * Makefile.am: Added BlankSolution.
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Commands/FileCommands.cs: Track api changes.
-
-2006-01-23 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Codons/PadOptionCodon.cs:
- * MonoDevelop.Ide.Codons/PadCodon.cs:
- Added internationalization.
-
-2006-01-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: In CloseAllDocuments,
- the active document is now the last one to close. It avoids firing too
- many ActiveDocumentChanged events.
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs:
- * MonoDevelop.Ide.Gui/IWorkbenchWindow.cs: Removed unused events.
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: Make sure the active
- window changed event is fired only when really necessary.
-
-2006-01-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/ProjectCommands.cs: Disable build and
- run commands if the current file is not a valid build target.
- * MonoDevelop.Ide.Gui/Document.cs: Added IsBuildTarget property.
-
-2006-01-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs: Added an Id property,
- which stores the codon Id.
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceFolderNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ResourceFolderNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:
- On project specific commands, save the affected project, not the
- whole combine.
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Added SaveProject method.
- Added a CreateProjectFile overload with a parameter that can be
- the id of the template to select by default in the new file dialog.
-
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs: Allow selecting
- a template.
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Added null check.
-
-2006-01-14 Andrés G. Aragoneses <knocte@gmail.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: Replaced 'Combine'
- by 'Solution'.
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Replaced 'Combine' by
- 'Solution'.
-
-2006-01-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: WrapDocument() does not create
- a Document if it already exists. In ActiveDocument use WrapDocument
- instead of FindDocument since the document may not yet exist.
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs: Set the name of the file
- as a tooltip of the tab.
-
-2006-01-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Templates/FileTemplate.cs: Make FileTemplate public
- since now it can be subclassed. LoadFileTemplate is now static.
- Split the Create method in several overridable methods.
- * MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs: Made public for
- the same reason.
- * MonoDevelop.Ide.Templates/INewFileCreator.cs: The only method is
- now CreateItem.
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs: Catch and show error
- messages.
-
- * MonoDevelop.Ide.Gui/DisplayBindingService.cs: Made public some of its
- methods.
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: When closing the combine, close
- only open files that belong to the combine.
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Added getter for
- the DisplayBindingService.
-
-2006-01-04 Alexandre Miguel Pedro Gomes <alexmipego@gmail.com>
-
- * MonoDevelop.Ide.addin.xml: Added icons to (un)comment lines,
- (un)indent and reload file.
-
-2005-12-16 John Luke <john.luke@gmail.com>
-
- * templates/Empty*.xft.xml:
- * Makefile.am:
- * MonoDevelop.Ide.addin.xml: add EmptyInterface, EmptyStruct, and
- EmptyEnum templates
-
-2005-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/IEditable.cs: Renamed to IEditableTextBuffer.
- This interface now inherits from IEditableTextFile. Removed some methods
- that are now inherited.
- * MonoDevelop.Ide.Gui.Content/ITextBuffer.cs: This interface now inherits
- from ITextFile. Moved some methods to the base interface. Removed the
- concept of 'position'. Now everything is handled with offsets.
- * MonoDevelop.Ide.Gui.Content/IBookmarkBuffer.cs: Removed the
- concept of 'position'. Now everything is handled with offsets.
-
- * MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs:
- * MonoDevelop.Ide.Templates/FileTemplate.cs: Added support for CodeDom
- based file templates.
-
- * MonoDevelop.Ide.Gui.Dialogs/NewFileDialog.cs:
- * MonoDevelop.Ide.Commands/FileCommands.cs:
- Group language specific templates in its own tree branch. Added an entry
- for the file name. Templates are now filtered according to the current
- project type and language.
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs: New files
- already have a name, so no need to rename them in the tree.
-
- * MonoDevelop.Ide/MonoDevelop.Ide.addin.xml: Added empty class template.
- * MonoDevelop.Ide/MonoDevelop.Ide.mdp: Updated.
-
- * MonoDevelop.Ide.Codons/IDisplayBinding.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui.BrowserDisplayBinding/BrowserDisplayBinding.cs:
- * MonoDevelop.Ide.Gui/DisplayBindingService.cs: Display bindings are now
- per mime type, not per language.
-
- * MonoDevelop.Ide.Gui.Search/SearchReplaceManager.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs: Track changes in IEditable.
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: Simplified CreateProjectFile,
- since now the file comes with a real name and path.
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs:
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs:
- * MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs:
- Properly show the name of newly created files, since now they have a name.
-
-2005-12-05 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs:
- Handle empty directories and empty search patterns appropriately.
- Removed redundant fileMask check.
- Do not call SetupSearchReplaceInFilesManager when stopping a search.
-
-2005-12-03 John Luke <john.luke@gmail.com>
-
- * AssemblyInfo.cs.in: add back --help output with Mono.GetOptions
-
-2005-12-02 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui.Search/SearchReplaceManager.cs:
- Fixed typo.
-
-2005-11-30 David Makovský <yakeen@sannyas-on.net>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs: Make some strings translatable.
-
-2005-11-28 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/SplashScreen.cs:
- Make sure the size of the progress bar stays the same
-
-2005-11-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/SharpDevelopAboutPanels.cs:
- * MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs: Make some strings
- translatable. Patch by David Makovský.
-
-2005-11-22 John Luke <john.luke@gmail.com>
-
- * MonoDevelop.Ide.Gui/DisplayBindingService.cs:
- percent escape files before getting the mimetype,
- fixes bug #75256
- * MonoDevelop.Ide.Gui/Workbench.cs: unescape some files
- before opening them
-
-2005-11-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs: Make some
- sentences more translatable.
-
-2005-11-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Added separator in context menu.
-
-2005-11-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs: Save the
- project after including a file.
- * MonoDevelop.Ide.Gui.Search/SearchReplaceManager.cs: Fixed bug in Replace.
-
-2005-11-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.CodeTemplates/CodeTemplateLoader.cs:
- * MonoDevelop.Ide.ExternalTools/ToolLoader.cs:
- * MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs:
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- Removed useless Observed* calls.
-
- * MonoDevelop.Ide.Gui.Search/ForwardTextIterator.cs: Place the position
- after the replaced text. Fixes bug #76728.
-
-2005-11-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * options/DefaultEditingLayout.xml: Updated with the new pad names.
-
-2005-11-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml:
- * AddInsOptionsPanel.cs:
- * Base.glade: Added options dialog for the add-in manager.
-
- * MonoDevelop.Ide.Commands/ToolsCommands.cs: Moved some code to
- AddinUpdateHandler.
- * MonoDevelop.Ide.Gui/AddinUpdateHandler.cs: Take into account the
- update check periodicity configured by the user.
-
- * Makefile.am:
- * MonoDevelop.Ide.mdp: Added new file.
-
- * MonoDevelop.Ide.Gui/Document.cs:
- * MonoDevelop.Ide.Gui/ViewCommandHandlers.cs:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Gui/IPadContainer.cs:
- * MonoDevelop.Ide.Gui/PadCollection.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs:
- * MonoDevelop.Ide.Gui/IdeStartup.cs:
- * MonoDevelop.Ide.Gui/DocumentCollection.cs:
- * MonoDevelop.Ide.Gui/HelpOperations.cs:
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs:
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide.Gui/Pad.cs: Added some missing license headers.
-
-2005-11-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: Catch and show
- errors raised while creating the project.
-
-2005-11-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Search/SearchReplaceInFilesManager.cs:
- * MonoDevelop.Ide.Commands/SearchCommands.cs: Factorized some code
- into SearchReplaceInFilesManager.
-
- * MonoDevelop.Ide.Gui.Dialogs/ReplaceInFilesDialog.cs: Created method
- for loading search options in the dialog.
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/CombineNodeBuilder.cs:
- Added Find In Files option in the context menu of the project pad,
- which takes the selected folder as search directory.
-
-2005-11-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/IEditable.cs:
- * MonoDevelop.Ide.Gui.Content/ITextBuffer.cs: Added some new methods.
- * MonoDevelop.Ide.Gui.Dialogs/SelectReferenceDialog.cs: Don't crash if
- a project is not found.
- * MonoDevelop.Ide.addin.xml: Added undo/redo to the toolbar.
- * MonoDevelop.Ide.Gui/Document.cs: Added Closed and Saved events.
- * MonoDevelop.Ide.Gui/StatusProgressMonitor.cs: Make sure the status
- bar is updated.
-
-2005-11-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Content/IEditable.cs: Added InsertText method.
- * MonoDevelop.Ide.Gui.Content/ITextBuffer.cs: Added
- GetPositionFromLineColumn method.
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs:
- * MonoDevelop.Ide.Gui.Dialogs/SplashScreen.cs:
- * MonoDevelop.Ide.Gui.OptionPanels/ExternalToolPanel.cs: Fixed warnings.
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Fix NRE when opening a file in an
- external editor.
-
-2005-10-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Workbench.cs: Don't show the main window until
- all stored sizes have been restored.
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Remove unnecessary progress steps.
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs: It is not the responsibility
- of the layout to Show the workbench. Don't load the stored layout when
- attaching, since the pads won't restore to the correct size if the
- workbench does not already have the original size.
- * MonoDevelop.Ide.Gui/Ide.cs: Minor progress monitoring fixes.
- * MonoDevelop.Ide.Gui.Dialogs/SplashScreen.cs: Update the current task
- name in IProgressMonitor.EndTask ().
-
-2005-10-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Use icons-only toolbars in
- the IDE. There are too many buttons for icons-and-text.
-
-2005-10-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.OptionPanels/ExternalToolPanel.cs: Get the
- command name directly from the Gtk.Entry, since GNome.FileEntry
- adds the default namespace to it. Also update the tool data when
- the command changes. This fixes bug #75627.
-
-2005-10-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Commands/ProjectCommands.cs:
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs:
- * MonoDevelop.Ide.addin.xml:
- Added LocalCopyReference command for toggling the Local Copy property
- of references. Fixes bug #75409.
-
-2005-10-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Dialogs/NewProjectDialog.cs: Create the solution
- in the same folder as the project. Fixes bug #60314.
-
-2005-10-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/Ide.cs: Execute auto-start commands.
-
- * MonoDevelop.Ide.addin.xml:
- * MonoDevelop.Ide.Commands/ToolsCommands.cs: Added command
- for showing the Add-in manager.
-
- * Makefile.am:
- * MonoDevelop.Ide/MonoDevelop.Ide.mdp: Added new files.
-
- * MonoDevelop.Ide.Gui/DefaultStatusBarService.cs:
- * MonoDevelop.Ide.Gui/IStatusBarService.cs:
- * MonoDevelop.Ide.Gui/IStatusIcon.cs:
- * MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs:
- * MonoDevelop.Ide.Gui/SdStatusBar.cs:
- Icons are now hiden by calling Dispose.
- Added SetAlarmMode to make icons blink in the status bar.
- Use Pixbuf insted of Image for icons.
-
- * MonoDevelop.Ide.Gui/AddinUpdateHandler.cs: New auto-start
- handler that checks for add-in updates.
-
-2005-10-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs:
- When moving or copying a file that is open and modified in
- the text editor, ask whether it should be saved or not.
- Fixes bug #76209.
-
-2005-10-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProjectOperations.cs: In CreateCombineEntry,
- only open the combine if we are creating a root combine.
-
-2005-10-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Fixed incorrect class name.
-
-2005-10-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.addin.xml: Fixed addin header information.
- Use "id" attribuet instead of "name" to identify addins.
- * MonoDevelop.Ide.Gui/IdeStartup.cs: MessageService is now registered
- in the config file.
-
-2005-10-10 John Luke <john.luke@gmail.com>
-
- * MonoDevelop.Ide.Gui/IdeStartup.cs: remove call to
- Gdk.Threads.Init
-
-2005-10-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs:
- * MonoDevelop.Ide.Gui/ProjectOperations.cs:
- * MonoDevelop.Ide.Commands/EditCommands.cs:
- * MonoDevelop.Ide.Templates/ProjectTemplate.cs:
- * MonoDevelop.Ide.Templates/FileTemplate.cs: Use the new addin API.
-
- * Base.glade: Moved the addin load error dialog here from
- MonoDevelop.Startup.
- * MonoDevelop.Ide.Gui/IdeStartup.cs: Moved here startup code from
- MonoDevelop.Startup.
-
- * MonoDevelop.Ide.Gui.Dialogs/SplashScreen.cs: Make it implement
- IProgressMonitor.
- * MonoDevelop.Ide.Gui.Dialogs/AddinLoadErrorDialog.cs: Fixed namespace
- name.
- * MonoDevelop.Ide.addin.xml: Added addin dependencies. Registered
- the IDE application.
- * Makefile.am: Added new files.
-
- * MonoDevelop.Ide.Gui/DefaultStatusBarService.cs:
- * MonoDevelop.Ide.Gui/DisplayBindingService.cs: Moved initialization
- code to InitializeService ().
-
- * MonoDevelop.Ide.Gui/Ide.cs:
- * MonoDevelop.Ide.Gui/Workbench.cs: Report progress while initializing
- the workbench.
-
-2005-10-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Install the assembly in the AddIns directory.
-
-2005-10-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Ide.Gui/ProgressMonitors.cs: Fixed wrong cast on
- find in files.
- * MonoDevelop.Ide.Gui.Pads/SearchResultPad.cs: Properly restore the
- tab title. Remove unused code.
- * MonoDevelop.Ide.Gui/Document.cs: Don't save the file if it has not
- been modified.
- * MonoDevelop.Ide.Gui/Workbench.cs: Use the new method for initializing
- the layout.
- * MonoDevelop.Ide.Gui/IWorkbench.cs:
- * MonoDevelop.Ide.Gui/DefaultWorkbench.cs: Merged the setter for
- WorkbenchLayout and UpdateViews in a single method, which does all
- work in the correct order. Layout restore should work again.
-
-2005-09-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * Renamed to MonoDevelop.Ide. Changed internal organization of files.
- Many files moved to MonoDevelop.Core.Gui, MonoDevelop.Projects and
- MonoDevelop.Projects.Gui.
-
-2005-09-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/File/DefaultFileService.cs: In OpenFile, properly select the
- window when the requested file has not yet been saved.
-
-2005-09-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/DispatchService/DispatchService.cs:
- * MonoDevelop.Base/Internal/ProgressMonitoring/BaseProgressMonitor.cs:
- Added new RunPendingEvents method in DispatchService.
-
-2005-09-13 Todd Berman <tberman@off.net>
-
- * Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs:
- Patch from Brion Vibber <brion AT pobox DOT com> to fix bug
- #76080. Automagically adds references from the
- AssemblyReferencePanel's FileChooser in a sane fashion.
-
-2005-09-10 John Luke <john.luke@gmail.com>
-
- * Makefile.am: remove old reference to perl
-
-2005-09-05 Todd Berman <tberman@off.net>
-
- * Services/MessageService.cs: Add a new overload that allows a parent
- Window to be passed in.
- * Gui/Dialogs/NewProjectDialog.cs: Fix bug #75981
-
-2005-08-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/Dialogs/CommonAboutDialog.c: Load the image for the About dialog
- from resources.
- * Gui/Pads/ProjectPad/ProjectFolderNodeBuilder.cs:
- * Gui/Pads/ProjectPad/ProjectFolder.cs: do not subscribe to the
- file change events by default. Only do it when the new TrackChanges
- property is set to true. This avoids unneeded subscriptions when using
- temporary ProjectFolder objects.
- * Gui/CommandService.cs: Enable idle toolbar update for the main
- command manager.
- * Makefile.am: Added about image resource.
-
-2005-08-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * Commands/ViewCommands.cs: Implemented delete layout command.
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs: Properly load saved
- layouts. Added DeleteLayout method.
- * Gui/IWorkbenchLayout.cs: Added DeleteLayout method.
- * MonoDevelopCore.addin.xml: Added Delete Layout command.
-
-2005-08-20 John Luke <john.luke@gmail.com>
-
- * Gui/Pads/OpenTaskView.cs:
- * Gui/Pads/FileScout/FileList.cs: fix some warnings
- with the new gtk#
-
-2005-08-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/Completion/CompletionListWindow.cs: Improved the declaration
- window. Now it will wrap the member declaration if it doesn't fit in
- the screen.
- * Gui/Completion/DeclarationViewWindow.cs: Indent the member declaration
- if it doesn't fit one line. Reduced the size of the the documentation
- text.
-
-2005-08-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/Completion/CompletionListWindow.cs: Avoid crash is something
- goes wrong while showing the completion window.
-
-2005-08-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * Internal/Codons/Commands/LinkItemCodon.cs:
- * Gui/Dialogs/WordCountDialog.cs:
- * Gui/Dialogs/NewProjectDialog.cs:
- * Gui/Dialogs/NewFileDialog.cs:
- * Services/Project/ProjectService.cs: Use stock icon id instead of
- file name.
-
- * Gui/Pads/ProjectPad/ProjectFolderNodeBuilder.cs: Track changes
- in Stock.cs.
-
- * Services/ResourceService.cs: Add stock icons registered in the addin
- extension file.
-
- * Internal/Codons/Commands/CommandCodon.cs:
- * Internal/Codons/Commands/ItemSetCodon.cs:
- * Services/IconService.cs: Provide the AddIn when calling GetStockId,
- so resource icons are properly loaded.
-
- * Makefile.am: Embed icon and templates as resources.
-
- * Internal/Templates/FileTemplate.cs:
- * Internal/Templates/ProjectTemplates/ProjectTemplate.cs:
- * Internal/Codons/Templates/FileTemplateCodon.cs:
- * Internal/Codons/Templates/ProjectTemplateCodon.cs: templates are now
- loaded from resources.
-
- * MonoDevelopCore.addin.xml: Register base stock icons. Always use stock
- icon id instead of file name.
-
- * Services/ParserService/DefaultParserService.cs: Fix potential deadlock
- in UnloadDatabase.
-
-2005-08-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * Internal/Project/Project/ProjectReference.cs: Find referenced projects
- looking at the root combine that contain this reference.
- * Internal/Project/Project/Collections/ProjectReferenceCollection.cs:
- Set the owner project of the references being added.
- * Internal/Project/Combine/Combine.cs: Added method for finding projects
- in the combine hierarchy.
- * Internal/Project/Combine/CombineEntry.cs: Added property for getting
- the root combine of a project.
- * Internal/Project/Project/Project.cs: Make sure to always set the
- owner project to the references collection.
- Use RootCombine to find referenced projects, instead of the project
- service. Perform a topological sort of the referenced projects to build.
- * Internal/Project/Combine/CombineEntryCollection.cs: Added Contains
- method.
-
-2005-08-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * Commands/EditCommands.cs:
- * Services/Project/ProjectService.cs:
- * Gui/Dialogs/ProjectOptionsDialog.cs:
- * Gui/Dialogs/TreeViewOptions.cs:
- * Gui/Dialogs/CombineOptionsDialog.cs: TreeViewOptions now takes the
- parent window as first parameter of the constructor.
-
- * Services/Language/LanguageService.cs: Commented out some unused stuff.
-
-2005-08-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/ProcessService/ProcessHostController.cs: Avoid unneeded
- reference to GLib. Added id parameter that is added as argument
- to the process. This helps identifying the process in the
- process list.
- * Services/ProcessService/ProcessService.cs: Provide a meaningful
- id to the ProcessHostController instances.
-
-2005-08-10 Peter Johanson <latexer@gentoo.org>
-
- * Services/ILoggingService.cs:
- * Services/DefaultLoggingService.cs: Add support for for logging to
- arbitrarily named loggers. Allows for easy filtering/control of
- logging.
- * Services/ResourceService.cs: Report to logger named by service type.
-
-2005-08-10 Ben Motmans <ben.motmans@gmail.com>
-
- * MonoDevelop.Base.mdp: references update + missing/added files
-
-2005-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopCore.addin.xml:
- * Commands/AutostartCommands.cs: Remove useless autostart command.
-
- * Services/Project/IProjectService.cs:
- * Services/Project/ProjectService.cs: Added a parser database to store
- information about the opened combine.
-
- * Internal/Project/Project/ProjectReference.cs:
- * Services/SystemAssemblyService.cs: Added GetAssemblyLocation method,
- which returns the path to an assembly by loading it out-of-process.
-
- * Internal/Parser/IParser.cs:
- * Services/ParserService/IParserService.cs:
- * Services/ParserService/CodeCompletionDatabase.cs:
- * Services/ParserService/AssemblyCodeCompletionDatabase.cs:
- * Services/ParserService/SimpleCodeCompletionDatabase.cs:
- * Gui/Pads/ClassPad/ProjectNodeBuilder.cs:
- * Gui/Pads/ClassPad/NamespaceNodeBuilder.cs:
- * Services/ParserService/DefaultParserService.cs:
- * Services/ParserService/ProjectCodeCompletionDatabase.cs:
- Use the new IParserContext API.
-
- * Gui/ContentInterfaces/IEditable.cs: Added TextChanged event.
- * Gui/Workbench/DefaultWorkbench.cs: Reparse the active file when
- the text changes.
-
- * Gui/Completion/CommentCompletionDataProvider.cs:
- * Gui/Completion/ICompletionDataProvider.cs:
- * Gui/Completion/CodeCompletionDataProvider.cs:
- * Gui/Completion/TemplateCompletionDataProvider.cs:
- * Gui/Completion/CompletionListWindow.cs: Project and FileName have
- now been moved into ICompletionDataProvider, so there is no need
- to pass them to all methods.
-
-2005-08-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/File/DefaultFileService.cs: Properly jump to the requested
- line after opening a file.
- * Services/DispatchService/SyncContextAttribute.cs: Some optimizations.
- * Internal/ProgressMonitoring/BaseProgressMonitor.cs: Apply the
- FreeDispatch attribute to the Log getter.
-
- * Services/ProcessService/ProcessHostController.cs: Send the object
- reference using the process pipe. No more huge base64 strings in
- the process command line.
-
- * Services/Project/ProjectService.cs:
- * Services/DebuggerService/IDebuggerService.cs: Moved implementation of
- DebugExecutionHandlerFactory to the debugger addin.
-
- * Gui/Components/MenuButtonEntry.cs: Fix warnings.
- * Search/DocumentIterator/DirectoryDocumentIterator.cs: Don't get the
- whole directory structure at the beginning. Do it incrementally.
-
- * Services/Tasks/ISearchProgressMonitor.cs:
- * Services/Tasks/SearchProgressMonitor.cs:
- * Gui/Pads/SearchResultPad.cs:
- * Gui/Search/SearchReplaceInFilesManager.cs:
- * Services/Tasks/TaskService.cs: Added progress monitor and Pad specific
- for search results.
-
-2005-08-06 John Luke <john.luke@gmail.com>
-
- * MonoDevelop.Base.mdp: update
-
-2005-08-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Base.mdp: Removed unused file.
- * Services/MessageService.cs:
- * Gui/Dialogs/ErrorDialog.cs: Added Show method. Removed debug code.
-
-2005-08-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/Search/SearchOptions.cs: Store options at the correct property set.
-
- * Gui/Pads/SolutionPad/TreeViewPad.cs:
- * Gui/Dialogs/OptionPanels/ExternalToolPanel.cs:
- * Gui/Dialogs/ProjectOptionsDialog.cs:
- * Commands/HelpCommands.cs:
- * Commands/VBConverter/ConvertBuffer.cs:
- * Commands/VBConverter/ConvertProject.cs: Use the new command system.
-
- * Gui/CommandService.cs: Added method for showing context menus.
- * Gui/GuiService.cs: Removed Old menu and toolbar services.
-
- * Gui/Dialogs/TreeViewOptions.cs: Provide a CommandManager that can
- be used to show a context menu.
- * Internal/Codons/Commands/CommandCodon.cs: Allow commands that use
- a string as ID (prefixed with @).
-
- * Internal/CollectionUtilities/Comparers.cs:
- * Gui/Components/SdMenu.cs:
- * Gui/Components/SdMenuCheckBox.cs:
- * Gui/Components/SdMenuCommand.cs:
- * Gui/Components/SdToolbarCommand.cs:
- * Gui/Components/SdMenuSeparator.cs:
- * Gui/Pads/PropertyPad/PropertyPadCommands.cs:
- * Gui/Pads/TreeViewMemento.cs:
- * Services/Toolbar/ToolbarService.cs:
- * Services/MenuService/MenuService.cs:
- * Commands/ProjectOptionsCommands.cs:
- * Internal/Codons/MenuItems/AbstractCheckableMenuCommand.cs:
- * Internal/Codons/MenuItems/ISubmenuBuilder.cs:
- * Internal/Codons/MenuItems/IMenuCommand.cs:
- * Internal/Codons/MenuItems/AbstractMenuCommand.cs:
- * Internal/Codons/MenuItems/ICheckableMenuCommand.cs:
- * Internal/Codons/MenuItems/MenuItemCodon.cs: Removed old code.
-
- * MonoDevelopCore.addin.xml: Removed old elements.
-
-2005-07-30 John Luke <john.luke@gmail.com>
-
- * Services/MessageService.cs: remove two unused variables
-
-2005-07-29 John Luke <john.luke@gmail.com>
-
- * MonoDevelop.Base.mdp: add new files to the project
-
-2005-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/Tasks/OutputProgressMonitor.cs: Implement the IConsole
- interface.
- * Services/Tasks/TaskService.cs: Implement IConsoleFactory interface.
-
- * Services/ProcessService/IConsole.cs: New interface.
- * Services/ProcessService/NativePlatformExecutionHandler.cs: Execution
- handler for native applications.
- * Services/ProcessService/ProcessWrapper.cs: make the class implement
- the IProcessAsyncOperation interface.
- * Services/ProcessService/ExternalConsoleFactory.cs: Factory for
- xterm consoles.
- * Services/ProcessService/MintPlatformExecutionHandler.cs: Execution
- handler for running managed applications on the mono interpreter.
- * Services/ProcessService/DefaultExecutionHandlerFactory.cs: The
- execution handler factory for normal non-debug executions.
- * Services/ProcessService/MonoPlatformExecutionHandler.cs: Execution
- handler for running managed applications on the mono jit.
- * Services/ProcessService/ProcessService.cs: Modified StartConsoleProcess
- which now takes a generic IConsole as parameter.
- * Services/ProcessService/DebugExecutionHandlerFactory.cs: The
- execution handler factory for debug executions.
- * Services/ProcessService/ExecutionContext.cs: New class.
- * Internal/Codons/ExecutionHandlerCodon.cs: New codon for registering
- execution handlers.
-
- * Services/ProcessService/IExecutionHandlerFactory.cs:
- * Services/ProcessService/IConsoleFactory.cs:
- * Services/ProcessService/IExecutionHandler.cs:
- * Services/ProcessService/IProcessAsyncOperation.cs: New interfaces.
-
- * Services/DebuggerService/IDebuggerService.cs: It now takes an
- IConsole as parameter.
-
- * Internal/Project/Project/DotNetProject.cs:
- * Internal/Project/Project/Project.cs:
- * Internal/Project/Combine/Combine.cs:
- * Internal/Project/Combine/CombineEntry.cs:
- * Services/Project/ProjectService.cs: Removed the Debug method.
- The Execute method now has a ExecutionContext parameter that can be
- used to specify a debugging context or any other kind of execution
- context.
-
- * MonoDevelop.Base/Base.glade:
- * Gui/Dialogs/ErrorDialog.cs:
- * Services/MessageService.cs: GUI improvements.
-
- * Gui/Pads/ClassPad/NamespaceNodeBuilder.cs:
- * Gui/Pads/ClassPad/ProjectNodeBuilder.cs:
- * Gui/Pads/ClassPad/ClassNodeBuilder.cs: Added "Show public members only"
- options.
-
- * Gui/Pads/FileScout/FileScout.cs: Fix warning.
-
- * Internal/ProgressMonitoring/SynchronizedProgressMonitor.cs: New class.
- * Internal/ProgressMonitoring/MessageDialogProgressMonitor.cs: New class.
- * Internal/ProgressMonitoring/AggregatedOperationMonitor.cs: New class.
-
- * Internal/ProgressMonitoring/BaseProgressMonitor.cs:
- * Internal/ProgressMonitoring/NullProgressMonitor.cs:
- * Internal/ProgressMonitoring/IProgressMonitor.cs: Added SyncRoot
- property, to support synchronized progress monitors.
-
- * Internal/ProgressMonitoring/AggregatedProgressMonitor.cs: Support
- filtering of monitor actions to propagate.
-
- * MonoDevelopCore.addin.xml: Registered new execution handlers.
-
-2005-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * Fix warnings.
-
-2005-07-22 John Luke <john.luke@gmail.com>
-
- * MonoDevelop.Base.mdp: add Gui/Completion/* to the project
-
-2005-07-20 John Luke <john.luke@gmail.com>
-
- * Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs:
- don't display useless Path column and mark it with FIXME
- sort list of gac assemblies by name then version for
- consistency, thanks to Rafael Teixeira for noticing
-
-2005-07-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Made internal lots of classes that don't really need to
- be public.
-
-2005-07-20 Peter Johanson <latexer@gentoo.org>
-
- * Gui/Completion/*.cs: Migrated here from MonoDevelop.SourceEditor.
- Includes new ICompletionWidget API for completing arbitrary widgets.
- * Makefile.am: Changes for imported completion files.
- * Services/ParserService/DefaultParserService.cs: Connect to events
- for individual Projects, rather than using the project service events.
-
-2005-07-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/Pads/ProjectPad/ProjectFolderNodeBuilder.cs: When a folder is
- renamed, update the whole tree branch starting from the parent node.
- * Gui/Pads/ProjectPad/ProjectFolder.cs: Don't update the path of the
- folder when receiving the Renamed event. Just signal that the name
- has changed.
- * Gui/Pads/ProjectPad/FolderNodeBuilder.cs: ProjectFile objects that
- represent a folder generate ProjectFolder nodes, so the renaming callback
- must be attached to a ProjectFolder object.
-
-2005-07-20 Lluis Sanchez Gual <lluis@novell.com>
-
- * Commands/SearchCommands.cs:
- * Gui/Search/DocumentIterator/AllOpenDocumentIterator.cs:
- * Gui/Search/SearchStrategy/KMPSearchStrategy.cs:
- * Gui/Search/SearchStrategy/ISearchStrategy.cs:
- * Gui/Search/SearchStrategy/WildcardSearchStrategy.cs:
- * Gui/Search/SearchStrategy/RegExSearchStrategy.cs:
- * Gui/Search/DefaultFind.cs:
- * Gui/Search/IFind.cs:
- * Gui/ContentInterfaces/ITextBuffer.cs:
- * Gui/Search/SearchReplaceManager.cs: Added support for backward search.
-
- * Gui/Search/TextIterator/ForwardTextFileIterator.cs:
- * Gui/Search/SearchStrategy/BruteForceSearchStrategy.cs: Added support
- for backward search and for native search method when available.
-
- * Gui/Search/TextIterator/ITextIterator.cs:
- * Gui/Search/TextIterator/ForwardTextIterator.cs:
- * Gui/Search/SearchReplaceInFilesManager.cs:
- * Gui/Search/SearchResult/DefaultSearchResult.cs:
- * Gui/Search/SearchResult/ISearchResult.cs: Added DocumentOffset
- property to ISearchResult and ITextIterator.
-
- * MonoDevelopCore.addin.xml: Added FindPreviousSelection command.
-
-2005-07-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/Project/ProjectService.cs: Don't fire CurrentProjectChanged
- when setting CurrentProject to the same current project. The same
- for CurrentSelectedCombineChanged.
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs: Removed duplicate
- event subscription to tabControl.SwitchPage.
- * Gui/Workbench/Layouts/SdiWorkspaceWindow.cs: There is no need to
- fire the ActiveMdiChanged event in SetTitleEvent, since the active
- window is not changing.
-
- * Gui/Pads/SolutionPad/TypeNodeBuilder.cs: New optional override:
- GetParentObject().
- * Gui/Pads/SolutionPad/TreeViewPad.cs: Added an GetNodeAtObject which
- provides a way of locating a node in the tree, even if the parent nodes
- have not been expanded and filled.
- * Gui/Pads/SolutionPad/SolutionPad.cs: Removed old code.
-
- * Gui/Pads/ProjectPad/CombineNodeBuilder.cs:
- * Gui/Pads/ProjectPad/FolderNodeBuilder.cs:
- * Gui/Pads/ProjectPad/ProjectFileNodeBuilder.cs:
- * Gui/Pads/ProjectPad/ProjectNodeBuilder.cs:
- * Gui/Pads/ProjectPad/ProjectFolder.cs:
- * Gui/Pads/ProjectPad/ProjectFolderNodeBuilder.cs:
- Implement GetParentObject().
-
- * Gui/Pads/ProjectPad/ProjectSolutionPad.cs: Select the active file in
- the tree.
-
-2005-07-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Internal/Project/Combine/Combine.cs: Make sure StartupEntry returns
- the correct value after the deserialization of startEntryName.
-
-2005-07-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/Dialogs/NewProjectDialog.cs: Don't continue with project creation
- if the project directory can't be created.
-
-2005-07-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/Pads/ProjectPad/FolderNodeBuilder.cs: When adding an existing
- file to the project ask if it needs to be replaced.
-
-2005-07-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Internal/ProgressMonitoring/BaseProgressMonitor.cs: Store the
- last reported exception object. Added ErrorException property.
- * Services/Tasks/StatusProgressMonitor.cs: Include the exception when
- showing the error dialog.
- * Gui/Dialogs/ErrorDialog.cs: Don't make it modal. There are some
- issues with that.
-
-2005-07-16 John Luke <john.luke@gmail.com>
-
- * Gui/Dialogs/ReferenceDialog/ProjectReferencePanel.cs:
- sort by Projet name
-
-2005-07-14 Ben Motmans <ben.motmans@gmail.com>
-
- * Gui/Pads/ProjectPad/FolderNodeBuilder.cs:
- #73772, 'remember action' in add files dialog
-
- * Gui/Pads/OpenTaskView.cs:
- show warnings after errors + sortable column based on task type
-
- * Services/File/RecentOpen.cs: emit correct event
-
- * Gui/Pads/SolutionPad/TreeViewPad.cs:
- make sure the parent node of the currently edited node is expanded
-
- * Services/DefaultLoggingService.cs: make sure log4net is always
- configured, even if the .config file doesn't exist
-
-2005-07-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs:
- * Gui/Workbench/Layouts/SdiWorkspaceWindow.cs:
- * Gui/Workbench/DefaultWorkbench.cs:
- * Commands/AutostartCommands.cs: Don't abuse ShowAll().
-
- * Gui/Dialogs/NewProjectDialog.cs: Use a default icon for the template
- if none is provided.
-
- * Gui/Dialogs/CombineOptionsDialog.cs:
- * Gui/Dialogs/ProjectOptionsDialog.cs: IConfiguration can't be renamed
- anymore, so to change the name, a copy has to be made.
-
- * Gui/Pads/SolutionPad/TreeViewPad.cs: ExpandToNode should not expand
- the current node, only the parents.
-
- * Gui/Pads/SolutionPad/NodeState.cs: Save/restore the selected node in the
- node state tree.
-
- * Gui/Pads/HelpBrowser/HelpViewer.cs:
- * Gui/Pads/HelpBrowser/MonodocTreePad.cs:
- * Gui/Pads/DefaultMonitorPad.cs:
- * Gui/Pads/TerminalPad.cs:
- * Gui/Pads/OpenTaskView.cs: The responsibility of showing the widgets of
- a pad is for the pad. The workbench won't ShowAll any more.
-
- * Gui/ToolWidgets/ConfigurationComboBox.cs: Update the combo when
- configurations are added or removed.
-
- * Internal/Project/Project/IConfiguration.cs: Don't allow renaming of
- configurations.
-
- * Internal/Project/Project/AbstractConfiguration.cs: Make Clone work
- for classes with no default constructor.
-
- * Internal/Project/Combine/Combine.cs: Ignore the
- ActiveConfigurationChanged event while deserializing.
-
- * Internal/Project/Combine/ConfigurationCollection.cs:
- * Internal/Project/Combine/CombineEntry.cs: Added ConfigurationAdded
- and ConfigurationRemoved events.
-
- * Internal/Templates/ProjectTemplates/ICombineEntryDescriptor.cs:
- * Internal/Templates/ProjectTemplates/CombineEntryDescriptor.cs:
- * Internal/Templates/ProjectTemplates/CombineDescriptor.cs:
- * Internal/Templates/ProjectTemplates/ProjectTemplate.cs:
- * Internal/Templates/ProjectTemplates/ProjectDescriptor.cs:
- Added template support for generic CombineEntry subclasses, which don't
- need to be Projects.
-
-2005-07-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/File/IFileService.cs:
- * Services/File/DefaultFileService.cs: Added OpenFile overload to open
- a file at place the cursor at a given line at column.
-
- * Services/ProcessService/ProcessService.cs: Provide the assembly location
- when creating an out of process object.
-
- * Services/Project/ProjectService.cs: Use the new combine options dialog.
- Store and restore the active configuration of the root combine.
-
- * Gui/Dialogs/CombineConfiguration/CombineConfigurationPanel.cs:
- Implemented.
- * Gui/Dialogs/CombineConfiguration/CombineEntryConfigurationsPanel.cs:
- new option panel that shows the list of configurations of a combine.
-
- * Gui/Dialogs/TreeViewOptions.cs: Added new overridable methods to
- make costumization easier.
- * Gui/Dialogs/CombineOptionsDialog.cs: New dialog that shows the options
- for a combine.
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs: Include the IPadContent
- in the command route.
- * Gui/Pads/SolutionPad/TreeViewPad.cs: Use the new ICommandDelegatorRouter
- interface. Made some methods virtual. The key for GetComposedIcon is now
- an object, instead of an string.
-
- * Gui/Pads/SolutionPad/ITreeBuilderContext.cs:The key for GetComposedIcon
- is now an object, instead of an string.
-
- * Gui/ToolWidgets/ConfigurationComboBox.cs: Toolbar widget that shows
- the active configuration.
-
- * Base.glade: Added new combine configuration dialogs.
- * MonoDevelopCore.addin.xml: Added the ConfigurationSelector command and
- the new combine configuration panels.
-
-2005-07-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Internal/Codons/Commands/CommandCodon.cs: Set the text and description
- for custom commands.
- * Internal/Codons/LanguageBinding/ILanguageBinding.cs:
- CreateCompilationParameters now returns an ICloneable.
-
- * Internal/Project/IConfiguration.cs: Added CopyFrom method.
- * Internal/Project/AbstractConfiguration.cs:
- * Internal/Project/AbstractProjectConfiguration.cs
- * Internal/Project/DotNetProjectConfiguration.cs: Implement CopyFrom.
-
- * Internal/Combine/Combine.cs: Added CreateConfiguration method.
- When the active configuration is changed, propagate the change to all
- children entries. When building a combine, build the child entries which
- have the build flag in the active configuration.
- * Internal/Project/DotNetProject.cs: CreateConfiguration is now defined
- in CombineEntry.
- * Internal/Combine/CombineEntry.cs: Make it extensible by implementing
- IExtendedDataItem. Use the new ConfigurationCollection collection.
- Added CreateConfiguration abtract method. Added ActiveConfigurationChanged
- event. Moved CombineEntryCollection to its own file.
- * Internal/Combine/ConfigurationCollection.cs: New class.
- * Internal/Combine/CombineConfiguration.cs: Renamed the Config class to
- CombineConfigurationEntry and made it public. Implemented CopyFrom.
- * Internal/Combine/ConfigurationEventHandler.cs: New handler.
- * Internal/Combine/CombineEntryCollection.cs: Moved from CombineEntry.cs.
-
- * Internal/Serialization/ClassDataType.cs: Properties dynamically added
- to a class must also be added to its subclasses.
- * Internal/Serialization/ItemProperty.cs: Avoid crash in HasSetter for
- properties not linked to a member (extended properties).
-
-2005-07-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/ParserService/AssemblyCodeCompletionDatabase.cs:
- Load referenced assemblies in an external process. gtk# 1.0 projects
- should work again.
- * Services/ParserService/IParserService.cs:
- * Services/ParserService/DefaultParserService.cs: Added GetProjectContents
- method.
- * Services/ParserService/CodeCompletionDatabase.cs: Added GetClassList
- method (to support GetProjectContents).
-
-2005-07-08 John Luke <john.luke@gmail.com>
-
- * Makefile.am: remove MONO_POSIX_OEE defines
- * Internal/Project/Combine/Combine.cs: just use Mono.Unix now
-
-2005-07-01 Joshua Tauberer <tauberer@for.net>
-
- * Internal/Project/Project/Project.cs: Pre/Post build tasks
- set up the ProcessStartInfo through the same function, set
- the working directory to the project base path.
-
-2005-07-01 Jacob Ils Christensen <jacobilsoe@gmail.com>
-
- * Services/Tasks/Task.cs:
- * Gui/Pads/OpenTaskView.cs:
- * Gui/Pads/ClassPad/ClassNodeBuilder.cs:
- * Gui/Pads/ClassPad/MemberNodeCommandHandler.cs:
- * Gui/Search/SearchResult/DefaultSearchResult.cs:
- Make lines and columns 1-based.
-
-2005-06-30 John Luke <john.luke@gmail.com>
-
- * Services/ParserService/AssembyInformation.cs: fix possible nullref
- patch from shoehn@web.de (Sebastian)
- fixes bug #75418
-
-2005-06-28 Raja R Harinath <rharinath@novell.com>
-
- * Makefile.am (FILES): Move AssemblyInfo.cs ...
- (GENERATED_FILES): ... here.
-
-2005-06-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/ParserService/DefaultParserService.cs: Don't get the current
- file text if we are not going to be able to parse it.
- * Gui/Search/*.cs: Moved here search/replace stuff from the editor addin.
- * Gui/ContentInterfaces.cs:
- * Base.glade: Added search/replace dialogs.
- * Makefile.am: Added new files.
- * MonoDevelopCore.addin.xml: Registered search/replace commands.
-
-2005-06-15 John Luke <john.luke@gmail.com>
-
- * Services/File/RecentFiles.cs: catch exception when writing to
- ~/.recently-used, fixes bug #75305
-
-2005-06-15 John Luke <john.luke@gmail.com>
-
- * MonoDevelopCore.addin.xml: add EditCommands.Rename to F2
- shortcut, fixes bug# 73774
-
-2005-06-15 John Luke <john.luke@gmail.com>
-
- * Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs:
- start at $HOME dir
- filter on *.exe and *.dll
-
-2005-06-15 John Luke <john.luke@gmail.com>
-
- * Base.glade (AddReferenceDialog):
- change title to Edit References to match menu
- put the selected references section in an expander
-
-2005-06-15 John Luke <john.luke@gmail.com>
-
- * Services/Project/ProjectService.cs: don't recreate SelectReferenceDialog
- every time, just set the project instead
- * Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs: allow it to be
- reused and just change the project to show the correct info
- * Gui/Dialogs/ReferenceDialog/ProjectReferencePanel.cs: add a SetProject
- that updates the info appropriately, remove old code
- * Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs: add Reset method
- to update the info for a new project
-
-2005-06-10 Jacob Ils Christensen <jacobilsoe@gmail.com>
-
- * Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs: Make sure
- that projects are correctly marked as selected.
-
-2005-06-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Commands/AutostartCommands.cs: Use IWorkbench.CreateMemento to create
- the default memento.
- * Gui/Workbench/WorkbenchMemento.cs:
- * Gui/Workbench/DefaultWorkbench.cs:
- * Gui/IWorkbenchLayout.cs:
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs: Use dockable toolbars.
- Load/Save the toolbar layout when starting/exiting. Added support for
- IMementoCapable to IWorkbenchLayout.
-
- * Gui/CommandService.cs: Added CommandManager property.
-
- * Internal/Codons/Commands/CommandCodon.cs: Make sure that configuration
- commands defined by the command system can be found.
-
- * MonoDevelopCore.addin.xml: Added names to the toolbars. Added the
- ToolbarList command.
-
-2005-06-07 Jacob Ils Christensen <jacobilsoe@gmail.com>
-
- * Core/src/MonoDevelop.Base/Internal/Project/Project/Project.cs:
- * Core/src/MonoDevelop.Base/Internal/Project/Combine/CombineEntry.cs:
- When a project is renamed make sure that references to it are updated.
-
-2005-06-04 John Luke <john.luke@gmail.com>
-
- * MonoDevelopCore.addin.xml: remove workaround
- for Shift|F8 as the dock handles it now
-
-2005-06-03 Jacob Ils Christensen <jacobilsoe@gmail.com>
-
- * Internal/Project/Combine/Combine.cs: Remove references
- to a project when it is removed from a combine (57782)
-
-2005-06-02 John Luke <john.luke@gmail.com>
-
- * MonoDevelopCore.addin.xml: add Shift|F8 shortcut
- for tip of the day from yvind Neuman (spam@agurk.com)
- workaround for bug 61113
-
-2005-06-02 John Luke <john.luke@gmail.com>
-
- * Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs:
- check GetIterFirst return value to avoid gtk+ assertions
- might fix bug 74445
-
-2005-06-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/Pads/SolutionPad/TreeViewPad.cs: Fix warning.
- * Internal/Project/Combine/CombineEntry.cs: Added ParentCombine property.
-
-2005-06-01 John Luke <john.luke@gmail.com>
-
- * Core/src/MonoDevelop.Base/Services/ResourceService.cs: remove
- DllImport workaround for rendering an icon
- * Core/src/MonoDevelop.Base/MonoDevelop.Base.dll.config.in: remove
- as we no longer p/invoke
- * Core/src/MonoDevelop.Base/Makefile.am: updated for above
-
-2005-06-01 John Luke <john.luke@gmail.com>
-
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs:
- * Gui/Workbench/Layouts/SdiWorkspaceWindow.cs:
- * Gui/Pads/FileScout/FileListItem.cs: adjust to
- FileIconLoader changes
-
-2005-06-01 Jacob Ils Christensen <jacobilsoe@gmail.com>
-
- * Services/MessageService.cs: Added methods to ask a question
- with a cancel option.
- * Gui/Workbench/Layouts/SdiWorkspaceWindow.cs: Added a cancel
- option when trying to close a modified file.
-
-2005-06-01 Jacob Ils Christensen <jacobilsoe@gmail.com>
-
- * Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs:
- * Gui/Dialogs/ReferenceDialog/ProjectReferencePanel.cs:
- * Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs:
- Prevent a project from referencing itself.
-
-2005-05-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/StatusBar/DefaultStatusBarService.cs: Added null checks.
- * Services/MessageService.cs: Use a more convenient dialog for
- displaying errors.
- * Gui/Dialogs/ErrorDialog.cs: New error dialog.
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs: Added null checks.
-
- * Base.glade:
- * Gui/Pads/SolutionPad/NodeCommandHandler.cs:
- * Gui/Pads/SolutionPad/TreeViewPad.cs: Notify node command handlers
- when a node is selected.
-
- * Gui/CommandService.cs: Use the Runtime.MessageService api to show
- errors in command execution.
- * Makefile.am: Added ErrorDialog.cs.
-
-2005-05-26 John Luke <john.luke@gmail.com>
-
- * Gui/Dialogs/OptionPanels/ProjectOptions/CompileFileProjectOptions.cs:
- don't forget to save the list file in the files to compile list,
- remove some unneccessary code, fixes bug 75043
-
-2005-05-19 Jacob Ils Christensen <jacobilsoe@gmail.com>
-
- * Gui/Dialogs/WordCountDialog.cs: Fixed problem that numbers were not shown till moused over.
-
-2005-05-17 Jacob Ils Christensen <jacobilsoe@gmail.com>
-
- * Gui/IWorkbenchLayout.cs:
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs:
- Added methods to go to next/previous tab page.
-
-2005-05-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/File/DefaultFileService.cs: Make the service GUI thread safe.
- * Gui/Dialogs/ReferenceDialog: Cleaned up the dialog.
- * Gui/Workbench/Layouts/SdiWorkspaceWindow.cs: Added IntPtr constructor
- to make gtk# happy.
- * Gui/Pads/DefaultMonitorPad.cs: Don't indent when a task has a null name.
- * Base.glade: Many fixes to make the dialogs more conforming to the HIG.
- * Internal/Project/Project/DotNetProjectConfiguration.cs: Added
- SourceDirectory property.
- * Internal/Project/Project/DotNetProject.cs: Set the sources path before
- building.
- * Internal/Project/Project/Project.cs: In CopyReferencesToOutputPath, copy
- refereces of referenced projects. They are not needed for compiling, but
- they are for running. The Build method now also builds required references.
-
-2005-05-09 Jacob Ils Christensen <jacobilsoe@gmail.com>
-
- * Gui/Pads/OpenTaskView.cs: Fixed Gtk warnings by using Clipboard.Text
-
-2005-05-08 John Luke <john.luke@gmail.com>
-
- * /Gui/Pads/SolutionPad/TreeViewPad.cs: use DefaultSortFunc property
-
-2005-05-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * Commands/ProjectCommands.cs: The Build command should compile the
- current file before running.
-
- * Services/Tasks/TaskService.cs:
- * Gui/Workbench/DefaultWorkbench.cs:
- * Gui/Pads/SolutionPad/TreeViewPad.cs:
- * Gui/Pads/OpenTaskView.cs:
- * Gui/Pads/TerminalPad.cs:
- * Gui/Pads/DefaultMonitorPad.cs:
- * Gui/Pads/FileScout/FileScout.cs:
- * Gui/AbstractPadContent.cs:
- * Gui/IWorkbench.cs:
- * Gui/IPadContent.cs:
- Removed BringToFront from IPadContent, and moved to IWorkbench.
-
- * Services/SystemAssemblyService.cs: Lazy load system assembly
- information. This speeds up MD startup time.
-
- * Services/ProcessService/ProcessService.cs:
- * Services/ProcessService/IProcessHost.cs:
- * Services/ProcessService/IProcessHostController.cs:
- * Services/ProcessService/ProcessHostController.cs:
- * Services/ProcessService/RemoteProcessObject.cs:
- * Makefile.am:
- Added new api for creating out-of-process objects.
-
- * Gui/Pads/FileScout/FileList.cs: Fix warnings.
-
- * Internal/Project/Project/DotNetProjectBinding.cs: Set the correct
- paths for single file projects.
-
-2005-04-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * Commands/ProjectCommands.cs: Added new build and run commands.
- * Services/DebuggerService/IDebuggerService.cs: Added some methods.
- * Services/Project/ProjectService.cs: Allow building a project even
- if there isn't an open combine.
- * Gui/Workbench/DefaultWorkbench.cs: Gui safe subscription to debugger
- events.
- * Makefile.am: added DebugCommands.
- * MonoDevelopCore.addin.xml: Added some missing descriptions. Registered
- new project and debug commands.
-
-2005-04-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * Commands/ViewCommands.cs: Use markup for the view list menu.
- * Commands/ProjectCommands.cs: Implemented Debug Application command.
- * Services/File/DefaultFileService.cs: In OpenFile, don't create a
- progress monitor if the file is already open.
- * Services/DebuggerService/IDebuggerService.cs: Added events that notify
- when breakpoints are added/removed. Added methods for getting the
- active breakpoints.
-
- * MonoDevelopCore.addin.xml:
- * Services/Project/IProjectService.cs:
- * Services/Project/ProjectService.cs:
- Added DebugApplication method. In the Debug methods, make sure the
- context switch is done in the gui thread.
-
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs: Don't use ShowItem() to
- show a hidden pad, since it is not working properly.
-
- * Gui/Workbench/DefaultWorkbench.cs: Removed most of code related to
- debugging, since it is handled by the editor itself.
-
- * Makefile.am: Added some new files.
-
-2005-04-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am
- * Services/DebuggerService/IDebuggerService.cs:
- Moved IDebuggerService.cs to its own directory.
-
-2005-04-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * Commands/MenuItemBuilders.cs: Removed. Menu builders are now
- implemented as command arrays and handled in the following files.
- * Commands/RunCommands.cs: Removed. Moved to ProjectCommands.
- * Commands/EditCommands.cs: Most of code moved to
- MonoDevelop.Gui.ViewCommandHandlers.
-
- * Commands/ClassBrowserCommands/ClassBrowserCommands.cs
- * ProjectBrowserCommands/*:
- Removed. Handlers for tree commands are handled by NodeCommandHandler
- objects.
-
- * Commands/FileCommands.cs:
- * ProjectCommands.cs:
- * WindowCommands.cs:
- * HelpCommands.cs:
- * ViewCommands.cs:
- Added enums with IDs for the commands.
- Use the new CommandHandler base class for global commands.
- Removed commands that are not global.
-
- * Gui/ViewCommandHandlers.cs: Implements edit commands for workspace
- windows.
-
- * Services/File/IFileService.cs:
- * Services/File/DefaultFileService.cs: Moved here the code that shows
- the UI for saving files.
-
- * Services/IDebuggerService.cs: The Run method now takes a progress
- monitor, and will (should) stop if the monitor notifies a cancel request.
-
- * Services/Project/IProjectService.cs:
- * Services/Project/ProjectService.cs:
- Factorized the Build* methods into a single Build method which takes
- as parameter what you want to build. The same for Execute* methods.
- Moved here several operations previously implemeted in commands, to
- make it easier to reuse code. This includes: Debug(), Deploy(),
- ShowOptions(), CreateProject(), CreateCombine(),
- AddCombineEntry(), CreateProjectFile(), AddReferenceToProject().
-
- * Gui/Dialogs/NewFileDialog.cs:
- * Gui/Dialogs/NewProjectDialog.cs: Added Run method to show the window
- as a modal dialog.
-
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs:
- * Gui/IWorkbench.cs:
- * Gui/Dialogs/TreeViewOptions.cs: Removed old menu code.
-
- * Gui/Workbench/Layouts/SdiWorkspaceWindow.cs: Removed obsolete code.
- Plug the handler class for generic Edit commands into the window.
-
- * Gui/Workbench/DefaultWorkbench.cs: Use the new command service.
-
- * Gui/Components/SdMenu.cs: Moved here the ISubmenuItem interface,
- which was implemented in MenuItemBuilders.cs.
-
- * Gui/Pads/SolutionPad/NodeCommandHandler.cs:
- * Gui/Pads/SolutionPad/TreeViewPad.cs: Plug node command handlers into
- the new command system.
-
- * Gui/Pads/SolutionPad/NodeBuilder.cs: Don't reuse command handlers
- since they may store command state information.
- * Gui/Pads/SolutionPad/SolutionPad.cs: Made OnOpenCombine and
- OnCloseCombine virtual.
- * Gui/Pads/ProjectPad/ProjectSolutionPad.cs: Subclass of SolutionPad
- which keeps track of the current selected project.
-
- * Gui/Pads/ProjectPad/*:
- Moved here the handlers for commands previously implemented in
- MonoDevelop.Commands.
-
- * Gui/CommandService.cs:
- * Gui/GuiService.cs: Added the new command service.
-
- * Internal/Codons/Pads/SolutionPadCodon.cs: Subclasses of SolutionPad
- can now be specified in the "class" attribute.
-
- * Internal/Project/Project/DotNetProject.cs: Made the Debug method
- synchronous.
-
- * Internal/Conditions/WorkbenchContextCondition.cs: Set the correct
- class name.
-
- * Internal/Codons/Commands/*: Codons for the new command infrastructure.
-
- * MonoDevelopCore.addin.xml: Defined the new menu and toolbar
- structure.
-
-2005-04-25 John Luke <john.luke@gmail.com>
-
- * Gui/Dialogs/NewProjectDialog.cs
- * Gui/Dialogs/NewFileDialog.cs: disambiguate IconView
- in gtk# head, based on patch by Fredrik Nilsson <jymdman@home.se>
-
-2005-04-19 Ben Motmans <ben.motmans@gmail.com>
-
- * Gui/Pads/DefaultMonitorPad.cs
- * Services/StatusBar/DefaultStatusBarService.cs:
- Clear the output when a combine closes.
- * GUI/Pads/OpenTaskView.cs
- Reorder of some columns for better view on small resolutions.
-
-2005-04-17 John Luke <john.luke@gmail.com>
-
- * Makefile.am: fix distcheck
-
-2005-04-17 John Luke <john.luke@gmail.com>
-
- * Gui/Pads/SolutionPad/TreeViewPad.cs: use new AppendNode
- and SetDefaultSortFunc API
-
-2005-04-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Internal/ProgressMonitoring/BaseProgressMonitor.cs: Don't crash
- when reporting an error with a null exception.
-
-2005-04-10 John Luke <john.luke@gmail.com>
-
- * Internal/Project/Project/AbstractProjectConfiguration.cs:
- set RunWithWarnings = true by default, because newer compiler
- versions may add warnings, etc.
- * options/MonoDevelopProperties.xml: remove a bunch of old SharpDevelop
- prefs and add some defaults for what we use
-
-2005-04-09 Christian Hergert <christian.hergert@gmail.com>
-
- * Services/DefaultLoggingService.cs: Fix the log4net error by
- checking for the .config before configuring.
-
-2005-04-08 Christian Hergert <christian.hergert@gmail.com>
-
- * Services/DefaultLoggingService.cs: Add missing event firing for Error
- method. Attempt to fix the constructor to be more like log4net examples.
-
-2005-04-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Commands/ProjectBrowserCommands/FolderNodeCommands.cs: Implemented
- IncludeFileToProject command.
- * Commands/ProjectBrowserCommands/GeneralNodeCommands.cs:
- New copy/cut/paste commands for tree nodes.
- * Services/File/DefaultFileService.cs:
- IFileService.cs: Use a progress monitor when opening files. OpenFile now
- return an IAsyncOperation object that can be used to track the status
- of the operation. Added methods for copying and moving files.
- * Services/DispatchService/DispatchService.cs: Dispatch all pending
- messages at once in the GUI thread. It gives better performance.
- * Services/Tasks/Task.cs: Track changes in IFileService.
-
- * Services/Project/IProjectService.cs:
- * Services/Project/ProjectService.cs: Implemented method for copying
- files between projects.
-
- * Gui/Pads/SolutionPad/TreeViewPad.cs: Implemented support for
- drag&drop and copy/paste. Some other internal improvements.
- * Gui/Pads/SolutionPad/ITreeNavigator.cs,
- * Gui/Pads/SolutionPad/TypeNodeBuilder.cs: Some API adjustments.
- * Gui/Pads/SolutionPad/NodeState.cs: New class that can store the
- status of a tree.
-
- * Gui/Pads/ProjectPad/ProjectFolder.cs:
- * Gui/Pads/ProjectPad/ProjectNodeBuilder.cs:
- * Gui/Pads/ProjectPad/ProjectFolderNodeBuilder.cs:
- * Gui/Pads/ProjectPad/ProjectFileNodeBuilder.cs:
- * Gui/Pads/ProjectPad/FolderNodeBuilder.cs:
- * MonoDevelopCore.addin.xml:
- Implemented support for drag&drop of files and folders. Moved all code
- that handles the ShowAllFiles option to its own node builder extension.
-
- * Gui/Pads/ProjectPad/SystemFile.cs:
- * Gui/Pads/ProjectPad/ShowAllFilesBuilderExtension.cs:
- * Gui/Pads/ProjectPad/SystemFileNodeBuilder.cs:
- New classes that implement the ShowAllFiles option.
-
- * Gui/Pads/ProjectPad/CombineNodeBuilder.cs:
- * Gui/Pads/ProjectPad/ProjectReferenceNodeBuilder.cs:
- * Gui/Pads/ProjectPad/ResourceFolderNodeBuilder.cs:
- * Gui/Pads/ProjectPad/ProjectReferenceFolderNodeBuilder.cs:
- * Gui/Pads/ClassPad/ClassNodeBuilder.cs:
- * Gui/Pads/ClassPad/ProjectNodeBuilder.cs:
- * Gui/Pads/ClassPad/MemberNodeBuilder.cs:
- * Gui/Pads/ClassPad/CombineNodeBuilder.cs:
- * Gui/Pads/ClassPad/NamespaceNodeBuilder.cs:
- * Gui/Pads/ClassPad/MemberNodeCommandHandler.cs:
- * Gui/Pads/ClassPad/EventNodeBuilder.cs: Track api changes.
-
- * Gui/Pads/ProjectPad/ResourceFolder.cs: Implemented Equals().
-
- * Internal/Project/Project/Project.cs: Set the project as dirty when its
- files change.
-
- * Internal/Project/Project/Collections/ProjectFileCollection.cs: new
- method for getting all files in a path.
-
- * Commands/MenuItemBuilders.cs: Removed debug code.
-
-2005-04-06 Chris Toshok <toshok@ximian.com>
-
- * Services/IDebuggerService.cs: remove the CurrentFrame property,
- as it's only used by the stuff inside the DebuggerAddIn anyway,
- and the object typed property was bogus.
-
-2005-05-04 John Luke <john.luke@gmail.com>
-
- * Internal/Conditions/WorkbenchContextCondition.cs:
- use Id so we can see the debugger menu again, it was
- comparing the wrong thing
-
-2005-04-01 Christian Hergert <christian.hergert@gmail.com>
-
- * Commands/FileCommands.cs: Add Andrew's patch to ask if we want to
- overwrite an existing file before actually doing it.
-
-2005-04-01 Christian Hergert <christian.hergert@gmail.com>
-
- * Services/ILoggingService.cs: Update the LogAppendedArgs and remove the
- category.
- * Services/DefaultLoggingService.cs: Remove the need for the StackTrace.
- We dont really need that in depth of information currently. Will look to
- find this feature directly in log4net and update soon.
-
-2005-04-01 Christian Hergert <christian.hergert@gmail.com>
-
- * Commands/VBConverter/ConvertBuffer.cs: Convert to use new Logging
- framework.
- * Commands/MenuItemBuilders.cs
- * Commands/AutostartCommands.cs
- * Services/DefaultLoggingService.cs
- * Services/DispatchService/DispatchService.cs
- * Services/ILoggingService.cs: New logging service to help make debugging
- and information logging easy.
- * Services/Runtime.cs: Add logging service to Runtime.
- * Services/DisplayBinding/DisplayBindingService.cs: Convert to new Logging
- framework.
- * Services/ResourceService.cs
- * Services/ParserService/DefaultParserService.cs
- * Services/ParserService/AssemblyInformation.cs
- * Services/ParserService/AssemblyCodeCompletionDatabase.cs
- * Services/ParserService/CodeCompletionDatabase.cs
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
- * Gui/Workbench/DefaultWorkbench.cs
- * Gui/Dialogs/Wizard/WizardDialog.cs
- * Gui/Dialogs/Wizard/AbstractWizardPanel.cs
- * Gui/Dialogs/WordCountDialog.cs
- * Gui/Dialogs/NewFileDialog.cs
- * Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs
- * Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs
- * Gui/Pads/SolutionPad/TreeViewPad.cs
- * Gui/Pads/PropertyPad/PropertyPad.cs
- * Gui/Pads/ProjectBrowser/BrowserNode/ProjectBrowserNode.cs
- * Gui/Pads/ProjectBrowser/BrowserNode/DirectoryNode.cs
- * Gui/Pads/ProjectBrowser/NodeBuilder/DefaultDotNetNodeBuilder.cs
- * Gui/Pads/HelpBrowser/MonodocTreePad.cs
- * Gui/Pads/HelpBrowser/HelpViewer.cs
- * Gui/Pads/FileScout/FileList.cs
- * Gui/BrowserDisplayBinding/HtmlViewPane.cs
- * Gui/HtmlControl/HtmlControl.cs
- * Gui/HtmlControl/MozillaControl.cs
- * Makefile.am: Add new LoggingService files to build files
- * Internal/ExternalTool/ToolLoader.cs: Update to new Logging Service
- framework.
- * Internal/Project/Project/DotNetProject.cs
- * Internal/Project/Project/IncludeFilesDialog.cs
- * Internal/Project/Project/Project.cs
- * Internal/Project/Combine/Combine.cs
- * Internal/ProgressMonitoring/ConsoleProgressMonitor.cs
- * Internal/ProgressMonitoring/BaseProgressMonitor.cs
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyParameter.cs
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyMethod.cs
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyReturnType.cs
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyEvent.cs
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyAttribute.cs
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyField.cs
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyProperty.cs
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyClass.cs
- * Internal/Templates/CodeTemplateLoader.cs
-
-2005-03-31 Christian Hergert <christian.hergert@gmail.com>
-
- * MonoDevelopCore.addin.xml: Use proper stock icon names for
- solution and class pads.
-
-2005-03-22 John Luke <john.luke@gmail.com>
-
- * Internal/Project/Project/DotNetProject.cs: Release configuration
- should not enable debugmode
- * Internal/Project/Combine/CombineConfiguration.cs: no need to have
- configurationname on the Entry node, build=true by default
-
-2005-03-20 Todd Berman <tberman@off.net>
-
- * Gui/Pads/FileScout/FileScout.cs: dispatch to the gui thread.
-
-2005-03-19 Christian Hergert <christian.hergert@gmail.com>
-
- * /Gui/Pads/FileScout/FileScout.cs: Change directories in the FileScout
- to the base directory of a opened combine. Return to home directory
- upon close of the combine.
-
-2005-03-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Commands/MenuItemBuilders.cs: Fixed Include/Compile and Deploy options.
- * Commands/ProjectOptionsCommands.cs:
- * Commands/ClassBrowserCommands/ClassBrowserCommands.cs:
- * Internal/CollectionUtilities/Comparers.cs:
- Removed reference to old project pad.
- * Commands/ProjectBrowserCommands/ProjectNodeCommands.cs:
- * Gui/Dialogs/CombineConfiguration/CombineStartupPanel.cs:
- Use new StartupEntry property instead of SingleStartProjectName.
- * Gui/Pads/ProjectPad/ProjectFileNodeBuilder.cs: Use the correct
- menu path.
- * Makefile.am: Removed old solution pads.
- * Internal/Project/Combine/Combine.cs: Added StartupEntry property
- which replaces SingleStartProjectName. Storing the name made project
- renaming complex to handle.
- * Internal/Project/Combine/CombineExecuteDefinition.cs:
- * Internal/Project/Combine/CombineConfiguration.cs: Serialize the
- real entry name, which may have changed.
-
-2005-03-19 Lluis Sanchez Gual <lluis@novell.com>
-
- * Commands/MenuItemBuilders.cs: Removed wrong check.
- * Gui/Pads/SolutionPad/NodeBuilder.cs: Removed unused method.
-
-2005-03-15 John Luke <john.luke@gmail.com>
-
- * Gui/Workbench/Layout/SdiWorkspaceLayout.cs: add NoGrip flags
- to the documents section to match new dock API
-
-2005-03-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * Pads/SolutionPad/TreeViewPad.cs: implemented ITreeBuilder.UpdateAll()
- method in TreeBuilder.
- * Pads/SolutionPad/ITreeBuilder.cs: Added UpdateAll method and some
- documentation.
- * Pads/ProjectPad/ProjectNodeBuilder.cs: Don't remove files from the
- tree if ShowAllFiles option is set.
- * Pads/ProjectPad/ProjectFileNodeBuilder.cs: Removed unused class.
- * Pads/ProjectPad/FolderNodeBuilder.cs: When adding a file, don't
- duplicate nodes if ShowAllFiles option is set.
- * Internal/Project/Project/Collections/ProjectFileCollection.cs:
- When removing a file, unset the ProjectFile's project. Removed
- indexer setter. Nobody uses it and it adds complexity.
-
-2005-03-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Commands/MenuItemBuilders.cs
- * Gui/Components/SdMenuCheckBox.cs
- * Gui/Components/SdMenuCommand.cs:
- Avoid subscribing self events since it can be a source of memory leaks.
-
- * Commands/ProjectBrowserCommands/ResourceFolderNodeCommands.cs,
- Commands/ProjectBrowserCommands/ProjectNodeCommands.cs,
- Commands/ProjectBrowserCommands/ReferenceFolderNodeCommands.cs,
- Commands/ProjectBrowserCommands/FolderNodeCommands.cs,
- Commands/ProjectBrowserCommands/CombineNodeCommands.cs,
- Commands/ProjectBrowserCommands/GeneralNodeCommands.cs:
- Modified to use the new tree navigation api.
-
- * Services/Project/ProjectService.cs: call RestoreCombinePreferences
- in the gui thread.
- * IconService.cs: Added helper method for changing the alpha of a pixbuf.
- * PadContentCollection.cs: Pads now have an Id. Use it.
- * SelectReferenceDialog.cs: Use a ProjectReferenceCollection instead
- of an array list to return the results.
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs: Name dock items after
- pad's ids. Read the list of pads for the context from the addin xm
- file. Use the new IPadContent.DefaultPlacement property to put pads
- in the right place.
- * Gui/Workbench/Layouts/SdiWorkspaceWindow.cs: Properly dispose the
- window.
- * Gui/Workbench/DefaultWorkbench.cs: Read pads declarations from the
- new addin tree path, and using the new codons.
- * Gui/AbstractPadContent.cs: Added Id and DefaultPlacement properties.
-
- * Gui/Pads/SolutionPad/*: The new generic solution pad.
- * Gui/Pads/ClassPad/*: Node builders for the new class pad.
- * Gui/Pads/ProjectPad/*: Node builders for the new project pad.
-
- * Gui/Pads/ClassScout/ClassScout.cs:
- * Gui/Pads/OpenTaskView.cs:
- * Gui/Pads/TerminalPad.cs:
- * Gui/Pads/DefaultMonitorPad.cs:
- * Gui/Pads/ProjectBrowser/ProjectBrowserView.cs:
- * Gui/Pads/FileScout/FileScout.cs:
- Track API changes.
-
- * Gui/IWorkbench.cs: WorkbenchContext is now a class instad of an
- enum. New context can be dynamically created.
- * Gui/IPadContent.cs: Added Id and DefaultPlacement properties.
- * options/DefaultEditingLayout.xml: Use new pad Ids.
-
- * Internal/Codons/ContextPadCodon.cs: New codon for defining pads
- in a workbench context.
- * Internal/Codons/Pads/NodeBuilderCodon.cs: New codon for defining
- node builders.
- * Internal/Codons/Pads/PadOptionCodon.cs: New codon for defining
- pad options.
- * Internal/Codons/Pads/SolutionPadCodon.cs: New codon for defining
- solution pads.
- * Internal/Codons/Pads/PadCodon.cs: New codon for defining
- pads.
- * Internal/Codons/WorkbenchContextCodon.cs: New codon for defining
- workbench contexts.
-
- * Internal/Project/Project/ProjectReference.cs: Implemented Equals().
- * Internal/Project/Project/IncludeFilesDialog.cs: Doesn't need to be modal.
- * Internal/Project/Project/Project.cs: Enable include files dialog.
- * Internal/Project/Combine/Combine.cs: Fixed some wrong events.
-
- * MonoDevelopCore.addin.xml: Use the new codons for defining pads and
- contexts.
-
-2005-03-13 Todd Berman <tberman@off.net>
-
- * Gui/Workbench/Layouts/SdiWorkspaceWindow.cs: Don't use a dock, this
- is insane, and it always was.
-
-2005-03-12 John Luke <john.luke@gmail.com>
-
- * Makefile.am: use MonoDevelop.Dock.dll
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs:
- minor API changes for C# version of dock
-
-2005-03-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Internal/Project/Combine/Combine.cs: Fixed wrong event subscriptions.
-
-2005-03-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/Project/ProjectService.cs: Search for new files after the
- whole combine has been loaded.
- * Internal/Project/Project/Project.cs: Don't show the include file
- dialog because it doesn't work. It will work with the new solution
- pad. All this partially fixes bug #71688.
-
-2005-03-10 Todd Berman <tberman@off.net>
-
- * Gui/Dialogs/SplashScreen.cs: Use an alignment, not labels.
-
-2005-03-10 Christian Hergert <christian.hergert@gmail.com>
-
- * Gui/Dialogs/SplashScreen.cs: Add progress bar with status
- message support. Will help users with slow initial startup
- times.
-
-2005-03-09 John Luke <john.luke@gmail.com>
-
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs:
- remove toolbarContainer that was causing an assertion
- and was no longer used
-
-2005-03-08 Todd Berman <tberman@off.net>
-
- * Gui/AbstractViewContent.cs: only emit an event when the name
- actually changes.
-
-2005-03-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Commands/MenuItemBuilders.cs: Added null check.
-
- * Services/MenuService/MenuService.cs: Added new ShowContextMenu
- method.
- * Services/Tasks/OutputProgressMonitor.cs: Fixed namespace.
- * Services/Tasks/TaskService.cs: The id of output pads are now
- like "OutputPad1".
-
- * Services/Project/IProjectService.cs,
- * Services/Project/ProjectService.cs: Added FileRenamedInProject event.
-
- * Services/ParserService/ClassInformationEventHandler.cs: Added a
- Project property to ClassInformationEventArgs.
-
- * Services/ParserService/ProjectCodeCompletionDatabase.cs: Handle the
- new FileRenamedInProject event.
-
- * Services/ParserService/DefaultParserService.cs,
- * Services/ParserService/CodeCompletionDatabase.cs,
- * Services/ParserService/IParserService.cs: Added GetClassList method
- and added a new includeReferences parameter to GetNamespaceList.
-
- * Gui/Workbench/Layouts/SdiWorkspaceWindow.cs: Avoid memory leaks.
- * Gui/Pads/DefaultMonitorPad.cs: Set the correct namespace.
- * Internal/Project/Project/ProjectFileEventArgs.cs: Added new
- handler for file rename events.
- * Internal/Project/Project/ProjectFile.cs: Use the new file renamed
- event. Fixed RelativePath property.
- * Internal/Project/Project/Project.cs: Use the new file renamed event.
- Moved find code to ProjectFileCollection.
- * Internal/Project/Project/Collections/ProjectReferenceCollection.cs:
- improved handling of events.
- * Internal/Project/Project/Collections/ProjectFileCollection.cs:
- Added file find method.
- * Internal/Project/Combine/Combine.cs: Use the new file renamed event.
- Other minor fixes.
- * Internal/Project/Combine/CombineEntry.cs: Notify the combine when
- an entry is removed.
-
-2005-03-04 Christian Hergert <christian.hergert@gmail.com>
-
- * Gui/Pads/FileScout/FileScout.cs: Fix race condition when adding files
- to the pad.
-
-2005-02-26 Poul Andersen <pba@mailme.dk>
- * Services/MessageService.cs: Added ShowMessage(string message, Gtk.Window parent )
- to ensure modal messagebox as window on top.
-
-2005-02-20 John Luke <john.luke@gmail.com>
-
- * Gui/Components/SharpMessageBox.cs
- * Gui/Components/StatusBar/AxStatusBarPanel.cs
- * Gui/Components/StatusBar/AxStatusBar.cs
- * Gui/Components/SideBar
- * Gui/Components/SideBar/AxSideBar.cs
- * Gui/Components/SideBar/AxSideTabItem.cs
- * Gui/Components/SideBar/AxSideTab.cs
- * Gui/Components/SideBar/SharpDevelopSideBar.cs
- * Gui/Components/SideBar/SharpDevelopSideTabItem.cs
- * Commands/SideBarCommands.cs:
- * Gui/Pads/SideBarView.cs:
- * Gui/ErrorDialogs:
- * Gui/ErrorDialogs/LoadingError.cs:
- * Makefile.am: remove unused stuff from SD
-
-2005-02-11 Todd Berman <tberman@off.net>
-
- * Services/Project/ProjectService.cs:
- * Internal/Project/Combine/CombineEntry.cs:
- Make sure the filename is valid for the format.
-
-2005-02-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/Project/ProjectService.cs: Fix default file formats.
-
-2005-02-11 Ben Motmans <ben.motmans@gmail.com>
-
- * Internal/ProgressMonitoring/BaseProgressMonitor.cs:
- moved cancelRequestedEvent inside MbrWrapper
- * Services/Tasks/TaskService.cs
- * Services/Tasks/OutputProgressMonitor
- * Services/ProcessService/ProcessService.cs
- * Gui/Pads/DefaultMonitorPad.cs:
- Added kill and clear button
-
-2005-02-10 Todd Berman <tberman@off.net>
-
- * Internal/Project/Combine/Combine.cs: Don't generate makefiles on
- Save.
-
-2005-02-10 Todd Berman <tberman@off.net>
-
- * Services/Project/DefaultProjectService.cs: Moved, see below.
- * Services/Project/ProjectService.cs:
- * Makefile.am:
- * MonoDevelopCore.addin.xml:
-
- Moved DefaultProjectService to ProjectService.
-
-2005-02-10 Todd Berman <tberman@off.net>
-
- * Commands/FileCommands.cs:
- * Services/Project/DefaultProjectService.cs:
- * Services/IconService.cs:
- * Gui/Dialogs/NewProjectDialog.cs:
- * Makefile.am:
- * Internal/Project/PrjxFileFormat.cs:
- * Internal/Project/MdsFileFormat.cs:
- * Internal/Project/Project/Project.cs:
- * Internal/Project/CmbxFileFormat.cs:
- * Internal/Project/Combine/Combine.cs:
- * Internal/Project/MdpFileFormat.cs:
- * Internal/Templates/ProjectTemplates/CombineDescriptor.cs:
- * Internal/Templates/ProjectTemplates/ProjectDescriptor.cs:
- * MonoDevelopCore.addin.xml:
-
- Changes to make the default file extensions .mds and .mdp. Your
- projects will be converted to this fileformat by default.
-
- Also a lot of misc changes across the codebase to make this work
- properly with other bad code that checks for .CMBX and .PRJX.
-
-2005-02-09 John Luke <john.luke@gmail.com>
-
- * Gui/Dialogs/TreeViewOptions.cs
- * Gui/Dialogs/NewFileDialog.cs: dont ref XmlForms
-
- * Gui/Dialogs/TabbedOptions.cs
- * Gui/Dialogs/InputBox.cs
- * Gui/Dialogs/FusionNative.cs
- * Gui/XmlForms
- * Gui/XmlForms/BaseSharpDevelopForm.cs
- * Gui/XmlForms/SharpDevelopPropertyValueCreator.cs
- * Gui/XmlForms/SharpDevelopObjectCreator.cs
- * Gui/XmlForms/SharpDevelopStringValueFilter.cs
- * Gui/XmlForms/BaseSharpDevelopUserControl.cs
- * Makefile.am: kill some unused stuff
-
-2005-02-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/Dialogs/CombineConfiguration/CombineStartupPanel.cs:
- Fix nullref exception when saving. 'store' wasn't being set.
-
-2005-02-02 John Luke <john.luke@gmail.com>
-
- * Commands/MenuItemBuilders.cs: only use RecentItem.Private
- if it contains something, should fix disappearing labels
-
-2005-02-02 John Luke <john.luke@gmail.com>
-
- * Gui/Dialogs/CombineConfiguration/CombineBuildOptions.cs
- * Gui/Dialogs/OptionPanels/ProjectOptions/OutputOptionsPanel.cs
- * Gui/Dialogs/OptionPanels/ProjectOptions/DeployFileOptions.cs
- * Gui/Dialogs/OptionPanels/ExternalToolPanel.cs
- * Gui/Dialogs/OptionPanels/IDEOptions/LoadSavePanel.cs
- * Base.glade: use Gnome.FileEntry where appropriate
- remove disabled line endings prefs
- a few other spacing, spelling, capitalization improvements
-
-2005-02-02 John Luke <john.luke@gmail.com>
-
- * Parser/ICompilationUnitBase.cs:
- * Parser/Implementations/AbstractCompilationUnit.cs: adjust to ErrorInfo
-
-2005-01-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/Project/DefaultProjectService.cs: In BuildActiveCombine(),
- show the output window even if compilation is not needed.
- Register file formats defined in the configuration file.
-
- * Services/ParserService/CodeCompletionDatabase.cs:
- * Services/ParserService/ProjectCodeCompletionDatabase.cs: Use project
- events to detect when project files are modified/added/removed.
- * Services/ParserService/DefaultParserService.cs: Remove subscription
- to projectService.FileAddedToProject. This is now handled in the
- ProjectCodeCompletionDatabase.
-
- * Gui/Components/SdMenuSeparator.cs: Separators are visible by default.
- * Gui/Components/SdMenuCommand.cs: If the command is not visible,
- avoid the ShowAll() call at the end.
- * Services/MenuService/MenuService.cs: Don't use ShowAll() to show
- the menu since it will also show hidden menu items.
-
- * Gui/Pads/OpenTaskView.cs: The Description, Path and File columns
- are now resizable.
-
- * Gui/Pads/DefaultMonitorPad.cs: Only reposition the cursor when a line
- of text is complete.
-
- * Makefile.am: Added new file format codon.
-
- * Internal/Project/Project/ProjectFile.cs: Removed the
- FileSystemWatcher from ProjectFile. File changes are now detected at
- project level. This saves lots of resources for big projects.
-
- * Internal/Project/Project/Project.cs: Properly detect when a project
- needs to be built.
-
- * Internal/Project/Combine/CombineEntry.cs:
- * Internal/Project/Combine/Combine.cs: Removed GetOutputFileName()
- method. It does not make sense in Combine.
-
- * Internal/ProgressMonitoring/LogTextWriter.cs: Added method for
- chaining several text writers.
-
- * MonoDevelopCore.addin.xml: Defined extension path for custom
- file formats.
-
-2005-01-31 John Luke <john.luke@gmail.com>
-
- * Gui/Components/SdToolbarCommand.cs:
- * Services/Toolbar/ToolbarService.cs:
- use newer gtk toolbar API, and simplify it a little
-
-2005-01-30 John Luke <john.luke@gmail.com>
-
- * Internal/Project/Project/DotNetProject.cs: pass fileName
- to the LangaugeBinding to determine if it is compilable
- fixes bug# 71694
-
-2005-01-28 John Luke <john.luke@gmail.com>
-
- * Services/ParserService/DefaultParserService.cs:
- * Parser/IParser: use CanParse () instead of HandlesFileExtension
- to be consistent with what SD did upstream
-
-2005-01-27 John Luke <john.luke@gmail.com>
-
- * Gui/Dialogs/CommonAboutDialog.cs: use a timeout
- to make scrolling a more constant speed
- * Gui/Dialogs/SharpDevelopAboutPanels.cs: remove
- a bunch of stale code
-
-2005-01-27 John Luke <john.luke@gmail.com>
-
- * Base.glade: update to newer glade format
-
- * Commands/ToolsCommands.cs:
- * Commands/FileCommands.cs:
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs:
- * Gui/Dialogs/CombineConfiguration/CombineStartupPanel.cs:
- * Gui/Dialogs/OptionPanels/IDEOptions/SelectStylePanel.cs:
- * Base.glade:
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyAttribute.cs:
- * Internal/Templates/ProjectTemplates/ProjectTemplate.cs:
- use ComboBox instead of OptioMenu and fix a bunch of little warnings
-
-2005-01-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/ParserService/CodeCompletionDatabase.cs: Moved classes to
- their own files, which are the following:
-
- * Services/ParserService/AssemblyCodeCompletionDatabase.cs:
- * Services/ParserService/ClassEntry.cs:
- * Services/ParserService/FileEntry.cs:
- * Services/ParserService/NamespaceEntry.cs:
- * Services/ParserService/ProjectCodeCompletionDatabase.cs:
- * Services/ParserService/SimpleCodeCompletionDatabase.cs:
- * Services/ParserService/ReferenceEntry.cs: New files.
-
-2005-01-27 Christian Hergert <chris@mosaix.net>
-
- * Gui/Pads/HelpBrowser/MonodocTreePad.cs: Fix to use new ShowView in
- DefaultWorkbench.
-
-2005-01-27 John Luke <john.luke@gmail.com>
-
- * Makefile.am:
- * Services/File/RecentOpen.cs:
- * Services/File/DefaultFileService.cs:
- * Gui/BrowserDisplayBinding/BrowserDisplayBinding.cs: use Gnome.Vfs
-
-2005-01-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/IWorkbench.cs:
- * Gui/Workbench/DefaultWorkbench.cs:
- * Services/File/IFileService.cs:
- * Services/File/DefaultFileService.cs: Added BringToFront parameter
- in OpenFile.
-
- * IProjectService.cs:
- * Services/Project/DefaultProjectService.cs: Return IAsyncOperation
- in OpenCombine, so the load operation can be controlled.
- Use the new BringToFront parameter set to false when opening the
- files of a combine. No more window dances.
-
- * Internal/Templates/ProjectTemplates/ProjectTemplate.cs: Wait for
- the combine to be completely loaded before opening the project
- files. This fixes #61028.
-
-2005-01-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/Tasks/StatusProgressMonitor.cs: Forgot to save the
- showErrorDialogs parameter.
- * Services/Project/DefaultProjectService.cs: Catch and report combine
- load errors.
- * Internal/Project/CmbxFileFormat.cs:
- * Internal/Project/PrjxFileFormat.cs: Version '1' is the same as '1.0.
- * Internal/Project/Project/UnknownProjectVersionException.cs: Improved
- error message.
- * Internal/ProgressMonitoring/BaseProgressMonitor.cs: \n is not nice
- in the status bar.
-
-2005-01-25 Todd Berman <tberman@off.net>
-
- * Gui/Workbench/Layouts/SdiWorkspaceWindow.cs: Add ShowNotification
- and use it to make the tablabel blue.
- * Gui/Components/SdMenuCheckBox.cs: Use markup instead of text, this
- will allow the view menu item builder to show things properly.
- * Gui/IWorkbenchWindow.cs: Add ShowNotification get; set;
- * Commands/MenuItemBuilders.cs: Use ShowNotification to properly show
- the open contents menu.
-
-2005-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * Internal/Project/Project/Project.cs: Honor ExternalConsole option
- when running an execution script.
-
-2005-01-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/DispatchService/DispatchService.cs: Don't set the gui sync
- context here. The default context won't be always a safe context.
- * Services/DispatchService/SyncContextAttribute.cs: Set the target
- context when switching to a new context.
- * Internal/ProgressMonitoring/BaseProgressMonitor.cs:
- * Services/Tasks/OutputProgressMonitor.cs: OnWriteLog is now only called
- internally, so no need for async.
- * Services/ProcessService/ProcessService.cs: Added parameter to
- StartConsoleProcess to allow running a console process inside MD.
- * Services/ProcessService/ProcessWrapper.cs: More than one thread may
- want to wait for the process, so use ManualResetEvent instead of
- AutoResetEvent.
- * Services/Project/DefaultProjectService.cs: Don't use output monitors
- for project execution, since the project will create the output panel
- when needed.
- * Internal/Project/Project/DotNetProject.cs: Start processes using the
- new StartConsoleProcess method.
- * Internal/Project/Combine/Combine.cs: For multiple startup combines, run
- all projects in parallel.
- * Internal/ProgressMonitoring/NullProgressMonitor.cs: Set the wait event
- when all is done.
-
- * Commands/ProjectBrowserCommands/ReferenceFolderNodeCommands.cs:
- * Commands/ProjectBrowserCommands/FolderNodeCommands.cs:
- * Commands/HelpCommands.cs:
- * Services/ParserService/DefaultParserService.cs:
- * Services/ParserService/CodeCompletionDatabase.cs:
- * Gui/Dialogs/DirtyFilesDialog.cs:
- * Gui/Dialogs/ProjectOptionsDialog.cs:
- * Gui/Dialogs/OptionPanels/ProjectOptions/CompileFileProjectOptions.cs:
- * Gui/Dialogs/OptionPanels/ProjectOptions/DeployFileOptions.cs:
- * Gui/Dialogs/NewFileDialog.cs:
- * Gui/Dialogs/ReferenceDialog/WebReference.cs:
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs:
- * Gui/Pads/ClassScout/NodeBuilder/DefaultDotNetClassScoutNodeBuilder.cs:
- * Gui/Pads/HelpBrowser/MonodocTreePad.cs:
- * Internal/Project/Project/IncludeFilesDialog.cs:
- * Internal/Project/Project/Project.cs:
- * Internal/ProgressMonitoring/ConsoleProgressMonitor.cs:
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyMethod.cs:
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyField.cs:
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyAttribute.cs:
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyProperty.cs:
- * Internal/Serialization/DataCollection.cs:
- * Internal/Serialization/ItemProperty.cs: Fix warnings.
-
-2005-01-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/Project/DefaultProjectService.cs: Don't raise the combine
- opened event until all is done.
- * Internal/ProgressMonitoring/BaseProgressMonitor.cs: Add the exception
- message to the log.
- * Internal/Project/Project/DotNetProject.cs: Execute mono through sh.
- This is a workaround to what seems like a bug in mono.
-
-2005-01-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/ParserService/DefaultParserService.cs:
- * Services/ParserService/CodeCompletionDatabase.cs:
- * Commands/ProjectBrowserCommands/CombineNodeCommands.cs:
- * Gui/Pads/TerminalPad.cs:
- * Gui/BrowserDisplayBinding/HtmlViewPane.cs:
- * Internal/Codons/LanguageBinding/ILanguageBinding.cs:
- * Internal/Project/PrjxFileFormat.cs:
- * Internal/Project/CmbxFileFormat.cs:
- * Internal/Project/IFileFormat.cs:
- * Internal/Project/Project/DotNetProject.cs:
- * Internal/Project/Project/Project.cs:
- * Internal/Project/Combine/Combine.cs:
- * Internal/Project/Combine/CombineEntry.cs:
- * Internal/Templates/ProjectTemplates/CombineDescriptor.cs:
- * Internal/Templates/ProjectTemplates/ProjectDescriptor.cs:
- * Commands/MenuItemBuilders.cs: Use the new progress monitor API.
-
- * Internal/ProcessMonitoring/*: New progress monitoring classes.
-
- * Commands/RunCommands.cs: Factorized a lot of common code into
- ProjectService.cs.
-
- * Services/DispatchService/DispatchService.cs: Added new ThreadDispatch
- method, which dispatches the call in a new thread (and does not queue the
- call, like BackgroundDispatch).
-
- * Services/ProcessService/ProcessService.cs: StartProcess now returns
- a reference to the started process. Added a StartProcess methods that
- writes the output in a text writer.
- Added StartConsoleProcess method which runs a process in an xterm.
-
- * Services/ProcessService/ProcessWrapper.cs: Added WaitForOutput method
- which blocks until all process output has been read.
-
- * Services/Project/DefaultProjectService.cs: Use the new progress
- monitor API. Factorized here some methods from RunCommands.cs.
-
- * IProjectService.cs: Added new methods for building and running projects.
- Removed some event methods that are now handled internally.
-
- * Services/StatusBar/IStatusBarService.cs:
- * Services/StatusBar/DefaultStatusBarService.cs: Simplified. All progress
- monitoring is now done by TaskService. Added API for managing the progress
- bar and showing and hiding the icons.
-
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs: Allow dynamic addition of
- new pads.
-
- * Gui/Workbench/Layouts/SdiWorkspaceWindow.cs: Sanity fix.
-
- * Base.glade:
- * Internal/Project/Project/AbstractProjectConfiguration.cs:
- * Gui/Dialogs/OptionPanels/ProjectOptions/OutputOptionsPanel.cs: Added
- option for chosing bewteen internal or external output window.
-
- * Gui/Components/StatusBar/SdStatusBar.cs: Don't use AppBar any more, and
- use something that allows more flexibility. Added support for icons.
-
- * Internal/Codons/LanguageBinding/DefaultCompilerResult.cs: Added new
- properties: WarningCount, ErrorCount, BuildCount, FailedBuildCount.
-
- * Internal/Project/ProjectPathItemPropertyAttribute.cs: Minor fix.
-
- * Internal/Project/Project/ProjectReference.cs: Added new useful
- constructors.
-
- * Gui/Pads/ProjectBrowser/BrowserNode/FileNode.cs:
- * Gui/Pads/ProjectBrowser/ProjectBrowserView.cs:
- * Gui/Pads/ProjectBrowser/NodeBuilder/DefaultDotNetNodeBuilder.cs:
- * Gui/Pads/OpenTaskView.cs: Fix warnings.
-
- * Makefile.am: Added new files.
-
-2005-01-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Internal/Project/CmbxFileFormat.cs: Fix hang when the entry list
- is empty.
-
-2005-01-17 Todd Berman <tberman@off.net>
-
- * Gui/Pads/FileScout/FileList.cs: This is a ListStore, not a
- TreeStore.
-
-2005-01-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Internal/Serialization/ItemProperty.cs: Added workaround for a bug
- in mono 1.0 (enum values are encoded as ints in attributes).
-
-2005-01-14 Christian Hergert <chris@mosaix.net>
-
- * Commands/FileCommands.cs: Added a Close All menu item.
- * Gui/Dialogs/CommonAboutDialog.cs: Added Christian to authors array.
- * MonoDevelopCore.addin.xml: Removed Close Solution shortcut. Added Close File
- shortcut.
-
-2005-01-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am, AbstractProject.cs, Project.cs: Renamed AbstractProject.cs.
- * Internal/Project/ProjectPathItemPropertyAttribute.cs: Ignore empty paths.
-
-2005-01-13 Todd Berman <tberman@off.net>
-
- * Internal/Project/Project/AbstractProject.cs: Actually start the
- Execute Script.
-
-2005-01-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/Project/DefaultProjectService.cs: Added support for custom
- file formats and project types.
-
- * Gui/Dialogs/OptionPanels/ProjectOptions/OutputOptionsPanel.cs:
- * Base.glade: Moved here the OutputOptionsPanel dialog from the c#
- binding.
-
- * Internal/Codons/LanguageBinding/ILanguageBinding.cs: Moved some methods
- to the new IProjectBinding interface, since they are language independent.
- Actually, ILanguageBinding is now a "dot net language binding". Support for
- non-.net languages should be implemented by extending IProjectBinding.
-
- * Internal/Project/Project/AbstractProjectConfiguration.cs: Moved some
- properties to the new DotNetProjectConfiguration, and added some others
- from the language bindings.
-
- * Internal/Project/Project/AbstractProject.cs: The IProject interface
- is not used anymore. All serialization code has been removed and
- reimplemented in PrjxFileFormat. Some methods have been moved to the
- new base class CombineEntry, and some others to the DotNetProject
- subclass.
-
- * Internal/Project/Combine/Combine.cs: It is now a subclass of
- CombineEntry. All serialization code has been removed and
- reimplemented in CmbxFileFormat. The class interface has been simplified.
-
- * Internal/Project/Combine/CombineEntry.cs: It is now the base class
- for Combine and Project. Some common properties have been factorized
- here.
-
- * Internal/Templates/ProjectTemplates/ProjectTemplate.cs: LanguageName
- is optional.
- * Internal/Templates/ProjectTemplates/ProjectDescriptor.cs: Use the new
- project type model.
- * MonoDevelopCore.addin.xml: Added extension path for project types.
-
- * Services/Project/FileFormatManager.cs: New file. Class that allows
- to register new types of combine entry files.
- * Internal/Conditions/LanguageActiveCondition.cs: New file. Condition
- that checks the language of the current project.
- * Internal/Codons/ProjectBinding/IProjectBinding.cs: New file.
- Interface that represents a project binding.
- * Internal/Codons/ProjectBinding/ProjectBindingCodon.cs: new codon for
- project bindings.
- * Internal/Project/Attributes/*: Removed. Equivalent funcionality is
- now provided by MonoDevelop.Internal.Serialization.
-
- * Internal/Project/IFileFormat.cs: Base interface for file format
- implementations.
- * Internal/Project/PrjxFileFormat.cs: Implements serialization into the
- prjx file format.
- * Internal/Project/CmbxFileFormat.cs: Implements serialization into the
- cmbx file format.
-
- * Internal/Project/Project/DotNetProject.cs:
- * Internal/Project/Project/DotNetProjectBinding.cs:
- * Internal/Project/Project/DotNetProjectConfiguration.cs: A basic .net
- project implementation.
-
- * Internal/Project/Project/IProject.cs: Removed. Not needed anymore.
- * Internal/Project/Combine/CombineEntryRenamedEventArgs.cs: New file.
-
- * Internal/Serialization/*: A generic data serializer.
-
- * Other files: Follow architecture changes.
-
-2004-01-03 Todd Berman <tberman@off.net>
-
- * Commands/RunCommands.cs:
- * Services/Project/DefaultProjectService.cs:
- * Services/Project/IProjectService.cs:
- * Gui/Pads/OpenTaskView.cs:
- * Makefile.am:
- * Internal/Project/Project/ProjectCompileEventHandler.cs:
- Change ProjectService.EndBuild to emit a bool variable to denote the
- success or failure of the combine build. Add a new delegate. Patch
- various uses to properly use new delegate.
-
-2004-12-26 Sander Rijken <sr+ximianbugs@d-90.nl>
-
- * Services/ProcessService/ProcessService: Set property
- "EnableRaisingEvents" to true, to be able to catch the Process.Exited
- event.
- * Internal/ExternalTool/ExternalTool.cs: Load the UseOutputPad setting
- from config file.
-
-2004-12-21 Todd Berman <tberman@off.net>
-
- * Services/Toolbar/ToolbarService.cs:
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs:
- * Gui/Dialogs/CommonAboutDialog.cs:
- * Gui/Pads/ProjectBrowser/ProjectBrowserView.cs:
- * Gui/BrowserDisplayBinding/HtmlViewPane.cs:
- * Internal/Project/Project/ConvertXml.cs:
- * Internal/Project/Combine/CombineEntry.cs: Remove/Fix code causing
- warnings.
-
-2004-12-21 Sander Rijken <sr+ximianbugs@d-90.nl>
-
- * Services/ProcessService/ProcessService.cs:
- * Services/ProcessService/ProcessWrapper.cs:
- * Services/Runtime.cs: Add new ProcessService property.
- * Makefile.am: Add new files.
- * Commands/MenuItemBuilders.cs: Wire the console output of external
- tools to the output pad.
-
-2004-12-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/DispatchService/DispatchService.cs: Removed unneded check
- for empty queue in QueueMessage. Not needed since all changes are now
- done inside a lock.
- * Services/DispatchService/SyncContext.cs: Fixed the delegate generator.
- The implementation was wrong. Also added a sample generated class to
- help understand what it does.
- * Gui/Pads/OpenTaskView.cs: Keep track of added tasks. TaskService
- events can be sent asynchronously, so when the event is handled,
- there is no guarantee that the state of the task service is the same
- as when the event was raised.
-
-2004-12-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/DispatchService/SyncContext.cs: Dispatch delegate calls
- asynchronously, no minimize the risk of deadlocks.
-
-2004-12-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/DispatchService/DispatchService.cs: added a locks for accessing
- the message queue. In synchronous calls, don't use gui dispatch if the
- calling thread is already the gui thread.
- * Services/ParserService/DefaultParserService.cs: Removed unneeded lock
- that was causing deadlocks.
-
-2004-12-15 Sander Rijken <sr+ximianbugs@d-90.nl>
-
- * Commands/CustomStringTagProvider.cs: Patch to have COMBINEDIR return
- the actual directory instead of the filename, COMBINEFILENAME already
- does that.
-
-2004-12-14 John Luke <john.luke@gmail.com>
-
- * Gui/Dialogs/CommonAboutDialog.cs:
- only redraw the right-half on scrolling
- use an array and a stringbuilder to build CreditText
- remove the old SD quotes
-
-2004-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/BrowserDisplayBinding/HtmlViewPane.cs:
- StatusBarService.ProgressMonitor is not a StatusBar widget any more.
-
-2004-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/StatusBar/DefaultStatusBarService.cs: Made it gui thread safe.
-
-2004-12-11 Alexandre Gomes <alexmipego@hotmail.com>
-
- * Commands/EditCommands.cs,
- * Gui/ContentInterfaces/ICodeStyleOperations.cs: Added support and menu
- entries for the already implemented Indent and UnIndent selection.
-
-2004-12-09 Todd Berman <tberman@off.net>
-
- * Gui/Pads/HelpBrowser/HelpViewer.cs: gtk# API changed again (thanks
- mikey!)
-
-2004-12-08 Everaldo Canuto <everaldo_canuto@yahoo.com.br>
-
- * Internal/Project/Combine/Combine.cs: Add support to multiple runtime
- in Makefiles generated by MonoDevelop.
-
-2004-12-07 Alexandre Gomes <alexmipego@hotmail.com>
-
- * Gui/ContentInterfaces/ICodeStyleOperations.cs: Added to rule style changes in code like (Un)Comment Code
- * Commands/EditCommands.cs: Changed to handle (Un)CommentCode menu options
- * Internal/Codons/LanguageBinding/ILanguageBinding.cs: Added CommentTag to all language bindings
- * MakeFile.am: Added reference to Gui/ContentInterfaces/ICodeStyleOperations.cs
-
-2004-12-07 Todd Berman <tberman@off.net>
-
- * Gui/Pads/HelpBrowser/HelpViewer.cs: Update to new gtk# api.
-
-2004-12-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/DispatchService/DispatchService.cs: Made some method non-static.
- * Services/DispatchService/GuiSyncContext.cs: Minor fix.
- * Services/Tasks/TaskService.cs: Added ShowTasks method, which brings
- to the front the task view.
- * Services/Project/DefaultProjectService.cs: It is the resposibility
- of the subscriber to handle the event in the right thread.
- * Services/MessageService.cs: Handle gui-thread transitions automatically
- by deriving from GuiSyncAbstractService.
- * Gui/Workbench/DefaultWorkbench.cs,
- * Gui/Pads/OpenTaskView.cs,
- * Gui/Pads/TerminalPad.cs,
- * Gui/Pads/ProjectBrowser/ProjectBrowserView.cs,
- * Gui/Pads/ClassScout/ClassScout.cs: Subscribe to service events using
- gui-thread aware delegates.
- * Makefile.am: New file.
-
-2004-12-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/DispatchService/DispatchService.cs: Added support for
- synchronous dispatch to the gui thread.
- * Services/DispatchService/AsyncDispatchAttribute.cs:
- * Services/DispatchService/SyncContext.cs:
- * Services/DispatchService/SyncObject.cs:
- * Services/DispatchService/FreeDispatchAttribute.cs:
- * Services/DispatchService/SyncContextAttribute.cs:
- * Services/DispatchService/GuiSyncContext.cs:
- * Services/DispatchService/GuiSyncObject.cs: New classes that support
- some new dispatch features.
-
-2004-12-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * *.cs: Removed remaining calls to ServiceManager.GetService.
-
-2004-12-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * Services/Runtime.cs: Root class that gives access to all services.
- * Gui/GuiService.cs: Root class that gives access to some gui-related
- services.
- * Services/ClassBrowserIcons/ClassBrowserIconsService.cs: Moved to
- IconService.cs.
- * Services/ResourceService.cs: Format.
- * Services/IconService.cs: Moved here methods from ClassBrowserIcons.
- * Makefile.am: Added new files.
- * *.cs: Removed all calls to ServiceManager.GetService (some files
- are still missing).
-
-2004-12-05 John BouAntoun <jba-mono@optusnet.com.au>
-
- * Internal/Project/Combine/Combine.cs: made it work with mono svn head Posix OEE
-
-2004-12-03 John Luke <john.luke@cfl.rr.com>
-
- * Commands/MenuItemBuilders.cs:
- * Gui/Components/SdMenuCommand.cs: use AccelMap instead of Accel.Map*
- * Gui/Dialogs/SharpDevelopAboutPanels.cs:
- * Gui/Dialogs/CommonAboutDialog.cs:
- * Gui/Dialogs/WordCountDialog.cs:
- * Gui/Pads/FileScout/FileList.cs:
- * Gui/BrowserDisplayBinding/HtmlViewPane.cs: remove obsolete GType stuff,
- use ComboBox instead of obsolete OptionMenu
-
-2004-12-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * Gui/Pads/ClassScout/NodeBuilder/DefaultDotNetClassScoutNodeBuilder.cs:
- UpdateClassTree: Changed parameter parentNode to projectNode,
- since this is what it is. DropPhantomNamespaces now deletes
- unexpanded namespaces if they are empty. This fixes bug #70149.
-
-2004-12-01 John Luke <john.luke@gmail.com>
-
- * Gui/Pads/FileScout.cs: use ShadowType.In so the
- FileBrowser doesn't look funny when it is the only pad
-
-2004-11-16 Todd Berman <tberman@off.net>
-
- * Internal/Project/Project/AbstractProject.cs: Make sure that
- references of references are copied in properly. This code needs to
- be refactored. However, this does work. We should basically be walking
- through the references, for Project references, and calling out
- to a helper function. I will rewrite this soon to be more robust
- and less insane.
-
-2004-11-12 Todd Berman <tberman@off.net>
-
- * Gui/HtmlControl/MozillaControl: No gtype registration, fixes
- jba's bug.
-
-2004-11-11 Todd Berman <tberman@off.net>
-
- * Makefile.am: Add $(MONO_POSIX_OEE)
- * Internal/Project/Combine/Combine.cs: #ifdef around
- FileMode using. This should fix cvs HEAD users.
-
-2004-11-05 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Internal/Parser/IParser.cs: Added
- HandlesFileExtension() for selection among multiple parsers
- * Services/ParserService/DefaultParserService.cs: Added
- parser selection using IParser.HandlesFileExtension()
-
-2004-11-02 John Luke <john.luke@gmail.com>
-
- * Services/File/RecentOpen.cs: use simpler RecentFiles AddWithLimit
- * Services/File/RecentFiles.cs: sort and return items in the right order
- among some other incremental improvements, should also fix bug #68999
- * Commands/AutoStartCommands.cs: revert Todds workaround from yesterday
-
- * Services/File/RecentOpen.cs:
- * Services/Project/DefaultProjectService:
- * Commands/MenuItemBuilders.cs: display project name for projects
-
- * Services/File/DefaultFileService.cs:
- * Services/File/RecentOpen.cs:
- * Commands/MenuItemBuilders.cs:
- * Commands/FileCommand.cs: display File [Project] or just File
-
-2004-11-01 Fawad Halim <fawad@fawad.net>
-
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyParameter.cs
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyMethod.cs
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyReturnType.cs
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyEvent.cs
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyAttribute.cs
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyField.cs
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyProperty.cs:
- Added using aliases for AssemblyReader and SharpCustomAttribute
- to allow compilation with mono HEAD
-
-2004-11-01 Todd Berman <tberman@off.net>
-
- * Commands/AutoStartCommands.cs: Open the real last project.
-
-2004-11-01 Todd Berman <tberman@off.net>
-
- * Services/File/RecentOpen.cs: Properly handle if the renaming occurs
- on a Directory, or if it is using SourceFile instead of FileName.
-
- Need to investigate why SourceFile and FileName both exist.
-
-2004-10-29 Todd Berman <tberman@off.net>
-
- * Commands/FileCommands: Fix SaveAs.
-
-2004-10-29 Todd Berman <tberman@off.net>
-
- * Commands/FileCommands.cs: Patch from Valters Svabe
- <valters@inbox.lv> to close bug #62300
-
-2004-10-28 Todd Berman <tberman@off.net>
-
- * Services/File/RecentFiles.cs: Remove C.WL
-
-2004-10-27 Todd Berman <tberman@off.net>
-
- * Commands/AutoStartCommands.cs: Fix the Load Previous Project on
- Startup option.
-
-2004-10-27 John Luke <john.luke@gmail.com>
-
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyParameter.cs
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyMethod.cs
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyReturnType.cs
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyEvent.cs
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyAttribute.cs
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyField.cs
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyProperty.cs:
- Add a using alias for SharpAssembly so we can compile with mcs HEAD
- we were taking advantage of a mcs bug it seems
-
-2004-10-27 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * Services/ParserService/DefaultParserService.cs: comment out code
- to select the VB parser, because we dont actually have one yet.
-
-2004-10-22 Chris Toshok <toshok@ximian.com>
-
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs: add
- DebuggerThreadPad.
-
-2004-10-22 Chris Toshok <toshok@ximian.com>
-
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs: add
- MonoDevelop.SourceEditor.Gui.DebuggerStackTracePad to the
- debugPads.
-
-2004-10-21 Chris Toshok <toshok@ximian.com>
-
- * Gui/Workbench/DefaultWorkbench.cs: don't try to open
- cur_dbgFilename if it's String.Empty.
-
-2004-10-20 John Luke <john.luke@gmail.com>
-
- * Commands/MenuItemBuilders.cs:
- * Commands/FileCommands.cs:
- * Commands/AutostartCommands.cs:
- * Services/File/RecentOpen.cs:
- * Services/File/DefaultFileService.cs:
- * Services/Project/DefaultProjectService.cs: enable new Recent Files stuff,
- and small adjustments for it.
-
-2004-10-20 John Luke <john.luke@gmail.com>
-
- * Services/File/RecentFiles.cs: fix a bunch of bugs
-
-2004-10-20 John Luke <john.luke@gmail.com>
-
- * Makefile.am: remove RingBuffer, add RecentFiles (not used yet)
- * Services/File/FdoRecentFiles.cs
- * Services/File/RecentItem.cs
- * Services/File/RingBuffer.cs: remove old unused stuff
- * Services/File/RecentFiles.cs: new in-progress implementation
-
-2004-10-15 Todd Berman <tberman@off.net>
-
- * Internal/Project/Combine/CombineEntry.cs: Before running, copy
- all dependant output assemblies to the proper place.
-
-2004-10-12 Gert Driesen <drieseng@users.sourceforge.net>
-
- * Internal/Parser/SharpAssemblyLayer/SharpAssemblyClass.cs:
- use alias to workaround mcs change
-
-2004-10-07 Todd Berman <tberman@off.net>
-
- * Internal/Project/Project/AbstractProject.cs: Make sure to copy the
- .mdb file if it exists when pushing the new dll into the AppBase of
- the executing assembly. This gives debug info for supporting dlls
- under 1.1.x and HEAD when you click 'Run'.
-
-2004-10-07 Todd Berman <tberman@off.net>
-
- * Servers/MessageService.cs: Fix a little (but important) bug with
- ShowMessage not properly working. Now you can actually *close* the
- window. Pretty good.
-
-2004-10-06 Todd Berman <tberman@off.net>
-
- * Services/ParserService/CodeCompletionDatabase.cs: Check to see if
- the namespace is already in the list before adding.
-
-2004-09-26 Todd Berman <tberman@off.net>
-
- * Gui/Components/SdMenu.cs: this should fix i18n for menus
-
-2004-09-25 Peter Johanson <latexer@gentoo.org>
-
- * Gui/Components/SdMenuCheckBox.cs: Workaround released gtk# 1.0.2
- interaction with 1.1.1.
-
-2004-08-10 Todd Berman <tberman@off.net>
-
- * Gui/Dialogs/CombineConfiguration/CombineStartupPanel.cs: fix left
- over ${RES:} strings.
-
-2004-08-10 Todd Berman <tberman@off.net>
-
- * Gui/Dialogs/NewProjectDialog.cs:
- * Gui/Dialogs/OptionPanels/IDEOptions/LoadSavePanel.cs: Patch from
- Samuel Kaufman to change the default project location to ~/Projects.
- <emrysk AT comcast net>
-
-2004-08-09 Todd Berman <tberman@off.net>
-
- * Services/SystemAssemblyService.cs: Work w/ cvs HEAD and 1.0.x
-
-2004-08-07 Todd Berman <tberman@off.net>
-
- * AssemblyInfo.cs.in: Use new ASSEMBLY_VERSION variable.
-
-2004-07-28 Fawad Halim <fawad@fawad.net>
-
- * Services/File/DefaultFileService.cs: Added inner class FileInformation as a container for File Opening information. Overloaded OpenFile to accept a delegate to call after File Opening.
- * Services/File/IFileService.cs: Added a delegate FileOpeningFinished for use after File Opening.
- * Services/Tasks/Task.cs: Use OpenFile, having call OnFileOpened after completion.
- * Gui/Pads/ClassScout/ClassScout.cs: Use OpenFile on node activation, having call OnFileOpened after completion.
-
-2004-07-12 John Luke <jluke@cfl.rr.com>
-
- * Gui/Dialogs/NewProjectDialog.cs: catch an IOException when
- creating a project with the name of an existing file
- should fix bug #61034
-
-2004-07-05 Todd Berman <tberman@off.net>
-
- * Commands/MenuItemBuilders.cs: properly escape filename with
- underscores in them.
-
-2004-07-05 Todd Berman <tberman@off.net>
-
- * Gui/Pads/HelpBrowser/HelpViewer.cs: enable images in monodoc.
-
-2004-07-05 Todd Berman <tberman@off.net>
-
- * Internal/Codons/MenuItems/MenuItemCodon.cs: allow menuitems with
- a submenu to be translated properly.
-
-2004-07-04 John Luke <jluke@cfl.rr.com>
-
- * Gui/Dialogs/OptionPanels/ProjectOptions/DeployFileOptions.cs:
- * Gui/Pads/ProjectBrowser/ProjectBrowserView.cs:
- * Gui/Pads/ProjectBrowser/BrowserNode/AbstractBrowserNode.cs:
- * Gui/Pads/ProjectBrowser/BrowserNode/ReferenceNode.cs:
- * Gui/Pads/ProjectBrowser/BrowserNode/FileNode.cs:
- * Gui/Pads/ProjectBrowser/BrowserNode/CombineBrowserNode.cs:
- * Gui/Pads/ProjectBrowser/BrowserNode/DirectoryNode.cs:
- * Gui/Pads/ProjectBrowser/NodeBuilder/DefaultDotNetNodeBuilder.cs:
- * Internal/Project/Project/IncludeFilesDialog.cs:
- Use the MessageService everywhere, and cleanup these files a bit
-
-2004-07-02 Todd Berman <tberman@off.net>
-
- * Services/MessageService.cs: Convert most of these to be threadsafe.
- Need to do AskQuestion, but this fixes a bug, so I will commit now.
-
-2004-07-02 Todd Berman <tberman@off.net>
-
- * Commands/FileCommands.cs: Dont use the FileFilters, as there are
- not functional at the moment.
- * Services/File/DefaultFileService.cs: don't attempt to load a
- directory, as its never valid.
-
-2004-07-01 John Luke <jluke@cfl.rr.com>
-
- * Commands/AutoStartCommands.cs: remove old Code generation,
- assembly preload, and tip of the day on start, because they
- are no longer used, and I believe no longer will be
- someone correct me if I am wrong
-
-2004-07-01 Todd Berman <tberman@off.net>
-
- * Gui/Worbench/Layouts/SdiWorkspaceLayout.cs: Remove the code that
- hides the tabs when there is only one item.
-
-2004-07-01 Todd Berman <tberman@off.net>
-
- * Services/ResourceService.cs: Remove a lot of code associated with
- loading resources at runtime, etc.
-
-2004-06-29 Todd Berman <tberman@off.net>
-
- * Internal/Codons/Templates/ProjectTemplateCodon.cs: new codon for
- project templates.
- * Internal/Templates/ProjectTemplates/ProjectTemplate.cs: convert to
- using new codon based system.
- * Makefile.am: add new file.
-
-2004-06-28 Todd Berman <tberman@off.net>
-
- * Gui/Workbench/Layouts/SdiWorkspaceWindow.cs: make sure everything is
- being disposed on close.
- * Gui/AbstractViewContent.cs: work around small virtual bug, will file
- this when i can replicate in a smaller test case.
-
-2004-06-28 Todd Berman <tberman@off.net>
-
- * Services/Project/DefaultProjectService.cs:
- * Services/Project/IProjectService.cs:
- * Internal/Project/Project/IProject.cs:
- * Internal/Project/Project/AbstractProject.cs:
- * Internal/Project/Project/ProjectFile.cs:
- * Internal/Project/Combine/Combine.cs:
- Patch from Ray Molenkamp <ray@yarvje.dyndns.org> to add a FSW that
- monitors for external changes to any file in a project and emits an
- event on the project service for it.
-
-2004-06-28 Todd Berman <tberman@off.net>
-
- * Internal/Codons/Templates/FileTemplateCodon.cs: add new codon for
- handling file templates.
- * Internal/Templates/FileTemplate.cs: Use the new codon based system
- instead of the old find files that end in .xft system. This means
- that you can now specify file templates in the addin.xml files and
- it brings us one step closer to being able to split off the backend
- bindings properly. (You will only see templates for bindings you have
- installed).
-
-2004-06-26 Todd Berman <tberman@off.net>
-
- * Gui/Dialogs/DirtyFilesDialog.cs: small layout fixes.
-
-2004-06-26 Lluis Sanchez Gual <lluis@ximian.com>
-
- * Commands/RunCommands.cs, Services/Project/DefaultProjectService.cs,
- Internal/Project/Combine/CombineEntry.cs:
- reflect changes in the TaskService.
- * Services/Tasks/Task.cs: Set comment type if the task do not refer to
- a file.
- * Services/Tasks/TaskService.cs: Don't allow direct manipulation of the
- task list, everything must be done through the TaskService api.
- Added new TaskAdded event.
- * Gui/Pads/OpenTaskView.cs: Use the new TaskAdded event, instead of loading
- the full list at every change.
-
-2004-06-25 Todd Berman <tberman@off.net>
-
- * Services/Project/DefaultProjectService.cs: When restoring combine
- preferences, if xml document is invalid, just return, closes bug
- #60417.
-
-2004-06-25 Todd Berman <tberman@off.net>
-
- * Gui/Dialogs/SharpDevelopAboutPanels.cs: Removing ASP mention at
- the request of Mike Krueger.
-
-2004-06-25 Todd Berman <tberman@off.net>
-
- * Gui/AbstractViewContent.cs: Make PathRelativeToProject not store in
- a string, and always be correct, no matter if the file is new, or has
- been moved since being loaded.
- * Gui/Dialogs/DirtyFilesDialog.cs: New dialog to use on close, should
- be working perfectly.
- * Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs: formatting fixes.
- * Gui/IViewContent.cs: No longer all PathRelativeToProject to be set.
- * Gui/Workbench/DefaultWorkbench.cs: remove the old closing code, and
- use the new dirty files dialog.
- * Services/File/FileService.cs: Fix LoadWrapperClass to not set the
- path relative to project, as that is handled differently now. Remove
- a method to make a path relative as there is no need for it now.
-
-2004-06-24 Todd Berman <tberman@off.net>
-
- * Commands/ProjectBrowserCommands/CombineNodeCommands.cs: set dialog
- to null after we are done with it.
-
-2004-06-24 Todd Berman <tberman@off.net>
-
- * Gui/Dialogs/NewSolutionDialog.cs:
- * Commands/ProjectBrowserCommands/CombineNodeCommands.cs:
- * Commands/FileCommands.cs: convert to using new async dispatcher
- stuff.
-
-2004-06-23 Todd Berman <tberman@off.net>
-
- * Gui/Dialogs/NewFileDialog.cs: add an event for when Ok is pressed.
- * Commands/ProjectBrowserCommands/FolderNodeCommands.cs: fix
- new file dialog from here.
-
-2004-06-23 Todd Berman <tberman@off.net>
-
- * Gui/CompletionDatabaseWizard: removed directory, as its unused.
- * Makefile.am: updated to reflect above.
-
-2004-06-23 Todd Berman <tberman@off.net>
-
- * Services/Project/DefaultProjectService.cs: make solution loading take
- place without any gui locks.
- * Service/File/DefaultFileService.cs: proxy OpenFile to a real method
- that gets called in the idle handler.
-
-2004-06-23 Todd Berman <tberman@off.net>
-
- * Services/DispatchService/DispatchService.cs: change up a bit
- to allow a void blah () delegate and a void blah (object) delegate.
- Added overloads to hit those.
- * Gui/Pads/ClassScout/ClassScout.cs: Update to new DispatchService
- API.
- * Gui/Dialogs/NewFileDialog.cs: Update to new DispatchService API.
-
-2004-06-23 Todd Berman <tberman@off.net>
-
- * Commands/FileCommands.cs: Cleanup a bit, move some code around.
- * Gui/Dialogs/NewFileDialog.cs: Convert to using DispatchService.
- This also tests the BackgroundDispatch method, which seems to be
- working fine. Now New File will no longer lock up the GUI at all.
- Also cleanup misc code, and unused pieces.
-
-2004-06-23 Todd Berman <tberman@off.net>
-
- * Gui/Pads/ClassScout/ClassScout.cs: use DispatchService instead of
- IdleWork stuff.
- * Services/DispatchService/DispatchService.cs: new service, used to
- pass messages to the gui, or a background thread. The gui stuff has
- been tested by the ClassScout above, the background thread dispatching
- has yet to be tested.
- * Makefile.am: Add DispatchService.cs
-
-2004-06-21 John Luke <jluke@cfl.rr.com>
-
- * Gui/Dialogs/OptionPanels/ProjectOptions/CompileFileProjectOptions.cs:
- use the messageservice for a the error dialog
- don't skip the first item when storing whether files should be
- included, fixes bug # 60363
- * Commands/ProjectBrowserCommands/FolderNodeCommands.cs:
- Change the title of Add Files to Add Files, so it will be clearer
- you can select more than one file
- put the name of the file in the Copy or Move dialog when adding
- an external file, fixes bug # 59516
-
-2004-06-21 Todd Berman <tberman@off.net>
-
- * Commands/AutostartCommands.cs: workaround icewm issue, dont show
- tip of the day dialog automatically under any circumstance.
-
-2004-06-21 John Luke <jluke@cfl.rr.com>
-
- * Gui/Pads/OpenTaskView.cs: implement a popup menu for copying
- a task to the clipboard, bug #56817
-
-2004-06-20 Todd Berman <tberman@off.net>
-
- * Services/ParserService/CodeCompletionDatabase.cs: fix nullref in
- file types that dont have a parser.
-
-2004-06-20 Todd Berman <tberman@off.net>
-
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs: fix bug #60352.
-
-2004-06-18 Todd Berman <tberman@off.net>
-
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs: cleanups, and a small
- icon related fixup.
-
-2004-06-18 Todd Berman <tberman@off.net>
-
- * Commands/MenuItemBuilders.cs: clean up accel path code.
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs: reduce code complexity
- by removing the extra ArrayList. Also properly use the tab reordering
- event, closes bug #60356.
-
-2004-06-17 John Luke <jluke@cfl.rr.com>
-
- * Commands/ProjectBrowserCommands/ResourceFolderNodeCommands.cs:
- * Commands/ProjectBrowserCommands/FolderNodeCommands.cs:
- * Commands/ProjectBrowserCommands/CombineNodeCommands.cs:
- * Commands/FileCommands.cs:
- * Gui/Dialogs/OptionPanels/ExternalToolPanel.cs:
- * Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs:
- * Internal/Project/Project/AbstractProject.cs:
- * Internal/Project/Combine/Combine.cs:
- * Gui/Dialogs/OptionPanels/ProjectOptions/DeployFileOptions.cs:
- use MonoDevelop.Gui.Widgets.FileSelector instead of Gtk.FileSelection
-
- * Gui/Pads/HelpBrowser/HelpViewer.cs: set IsViewOnly property to true
- so we don't crash on save
-
- * Gui/Pads/ProjectBrowser/BrowserNode/FileNode.cs:
- do not force an extension on renamed files
- fixes bug # 59677
-
- * Commands/FileCommands.cs: workaround for #59731
-
-2004-06-16 John Luke <jluke@cfl.rr.com>
-
- * Gui/Dialogs/NewProjectDialog.cs: guard against unauthorized
- exception when creating the project directory, and display an error
- message and allow the user to fix it.
- fixes bug # 60001
-
-2004-06-13 Todd Berman <tberman@sevenl.net>
-
- * Internal/Project/Project/Deployment/ScriptDeploy.cs: string fix
-
-2004-06-11 Todd Berman <tberman@sevenl.net>
-
- * Services/SystemAssemblyService.cs: Dont scan the same path twice.
-
-2004-06-10 Lluis Sanchez Gual <lluis@ximian.com>
-
- * Commands/ProjectBrowserCommands/FolderNodeCommands.cs: Set the project of
- newly added files.
- * Services/ParserService/DefaultParserService.cs: Generate and cache code
- completion databases for opened files that do not belong to any project.
- * Services/ParserService/CodeCompletionDatabase.cs: Added Clear method.
- Made Write() virtual.
- Added new SimpleCodeCompletionDatabase, for storing information for a
- single file.
- * Internal/Project/Project/AbstractProject.cs: Ignore members with the
- xml name set to null.
- * Internal/Project/Project/ProjectFile.cs: Added project filed. Notify
- the project when the file name changes.
- * Internal/Project/Project/Collections/ProjectFileCollection.cs: assign
- the project to the files in the collection.
-
-2004-06-06 John Luke <jluke@cfl.rr.com>
-
- * Gui/Dialogs/CommonAboutDialog.cs: make the scrollbox not expand
- fixes bug #59652
-
-2004-06-02 Todd Berman <tberman@sevenl.net>
-
- * Commands/ProjectBrowserCommands/FolderNodeCommands.cs: call new func.
- * Gui/Dialogs/NewFileDialog.cs: remove dead code
- * Gui/Pads/ProjectBrowser/ProjectBrowserView.cs: add function that
- worksaround the gtk+ 2.4 regression workaround.
-
-2004-06-02 Todd Berman <tberman@sevenl.net>
-
- * Gui/Dialogs/CommonAboutDialog.cs: This is actually how translator
- credits are supposed to work. Update the po and go ahead and
- translate the string "translator_credits" to include what you want
- it to include. It will then show up properly.
-
-2004-06-02 Todd Berman <tberman@sevenl.net>
-
- * MonoDevelop.Base.prjx: fixed ICSharpCode.SharpZipLib reference and
- added new file.
- * Gui/Dialogs/CombineConfiguration/CombineBuildOptions.cs: new dialog
- for the .mdsx relative output build path.
- * Makefile.am: add new file.
- * Internal/Project/Combine/Combine.cs: Add BaseDirectory property.
- * Makefile.MonoDevelop.Base: automagic updates to reflect new file
- (This is good to see).
-
-2004-05-30 Todd Berman <tberman@sevenl.net>
-
- * Commands/AutostartCommands: Remove some dead code.
- * Services/ParserService/DefaultParserService.cs: Properly setup
- the pathing so it works without an existing setup.
-
-2004-05-30 Lluis Sanchez Gual <lluis@ximian.com>
-
- * Services/ParserService/DefaultParserService.cs: Don't use the "Gac:"
- prefix to reference gac assemblies, they are handled internally by
- AssemblyCodeCompletionDatabase.
- When locating an assembly database, take into account partial names,
- and avoid loading the same db twice.
- Perform the modified file check taking into account dependencies
- between databases. This increases the posibility of resolving all classes
- of a database in the first parse cycle (since its dependecies will be
- already parsed).
- Added parameter to GetClass which allows deep search of a class in all
- project references.
- In ResolveTypes, added out parameter to inform if all types could be
- resolved.
- In ClassInheritanceEnumerator, use a reference deep search to get base
- classes.
-
- * IParserService.cs: Added parameter to GetClass which allows deep search of
- a class in all project references.
-
- * CodeCompletionDatabase.cs: Increased db version, since the format has
- changed a bit. Added an easy way for derived classes to serialize data
- together with the index.
- When writing the db, make a byte copy from the old file to the new one
- for classes not loaded.
- In ProjectCodeCompletionDatabase, if a file can't be fully resolved,
- schedule a reparse.
- In GetClass() support lookup of inner classes. Improved some internal
- methods to support this.
-
-2004-05-29 Todd Berman <tberman@sevenl.net>
-
- * Services/Project/DefaultProjectService.cs: try catch around
- generate makefiles, as some bindings toss exceptions.
-
-2004-05-28 Todd Berman <tberman@sevenl.net>
-
- * Gui/Dialogs/CombineConfiguration/CombineStartupPanel.cs:
- * Gui/Dialogs/OptionPanels/ProjectOptions/CompileFileProjectOptions.cs:
- * Gui/Dialogs/OptionPanels/ProjectOptions/DeployFileOptions.cs:
- * Gui/Dialogs/OptionPanels/ExternalToolPanel.cs:
- * Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs:
- * Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs:
- * Gui/Pads/HelpBrowser/MonodocTreePad.cs:
- * Internal/Project/Project/IncludeFilesDialog.cs: update to reflect
- gtk-sharp api out -> ref change
-
-2004-05-27 Todd Berman <tberman@sevenl.net>
-
- * Services/Project/DefaultProjectService.cs: fix removing files
- from projects via the project browser.
-
-2004-05-27 Todd Berman <tberman@sevenl.net>
-
- * Internal/Project/Project/Combine.cs: properly handle spaces in the
- solution and project names.
- * Gui/Pads/ProjectBrowser/BrowserNode/CombineBrowserNode.cs: check
- for invalid characters.
-
-2004-05-27 Todd Berman <tberman@sevenl.net>
-
- * Internal/Project/Project/AbstractProject.cs: Properly ignore
- .svn and CVS directories.
- * Gui/Pads/ClassScout/ClassScout.cs: Properly work around potential
- exceptions until we figure out why they are happening.
- * Commands/ProjectBrowserCommands/FolderNodeCommands.cs: start
- the add file dialog in the proper place.
-
-2004-05-26 Todd Berman <tberman@sevenl.net>
-
- * Internal/Project/Combine/Combine.cs: fix nullref when you dont
- have a valid single startup project name set.
-
-2004-05-26 Todd Berman <tberman@sevenl.net>
-
- * Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs: fix up
- per edd's suggestions. Now we select a valid node if possible when
- you remove, and the remove button is only sensitive when an iter is
- selected.
-
-2004-05-26 Todd Berman <tberman@sevenl.net>
-
- * Services/ProjectService/DefaultProjectService.cs: move the call to
- GenerateMakefiles when the solution is closed to somewhere that
- actually generates a makefile.
-
-2004-05-26 Todd Berman <tberman@sevenl.net>
-
- * Internal/Project/Combine/Combine.cs: actually tested with a solution
- with 2 projects in it, one that references the other. It works now,
- building, cleaning, running, etc.
- * Internal/Templates/ProjectTemplates/CombineDescriptor.cs: setup
- OutputDirectory properly by default.
-
-2004-05-26 Todd Berman <tberman@sevenl.net>
-
- * Internal/Project/Project/AbstractProject.cs: ignore .pidb, .mdsx and
- make.sh.
-
-2004-05-26 Todd Berman <tberman@sevenl.net>
-
- * Services/Project/DefaultProjectService.cs: auto-generate makefiles
- on changes. I think i hit all the needed events, lets see.
-
-2004-05-26 Todd Berman <tberman@sevenl.net>
-
- * Services/ParserService/DefaultParserService.cs: Update Monodoc
- and IsAs resolvers.
- * Services/ParserService/IParserService.cs: Expose new search type
- method for use in Monodoc and IsAs resolvers.
- * Internal/Parser/IParser.cs: Update Monodoc and IsAs resolvers.
- * Gui/Pads/ClassScout/ClassScout.cs: add a null check to workaround
- a *strange* nullref that keeps popping up.
-
-2004-05-26 Lluis Sanchez Gual <lluis@ximian.com>
-
- * Services/ParserService/DefaultParserService.cs: Type names for fields,
- parameters, base classes and so on come unresolved from the parser
- (without namespace information). They must be resolved before adding them
- to the database. This is done through the method ResolveTypes.
- * CodeCompletionDatabase.cs: Resolve type names before adding the class to
- the database.
- * PersistentIndexer.cs, PersistentParameter.cs, PersistentMethod.cs,
- PersistentReturnType.cs, PersistentEvent.cs, PersistentField.cs,
- PersistentProperty.cs, PersistentClass.cs: Added method for resolving
- the type names.
-
-2004-05-25 Todd Berman <tberman@sevenl.net>
-
- * Services/ParserService/DefaultParserService.cs: create the directory
- if it doesnt exist.
-
-2004-05-25 Lluis Sanchez Gual <lluis@ximian.com>
-
- * Services/File/DefaultFileService.cs: Enabled database regeneration for
- modified assemblies.
-
-2004-05-25 Lluis Sanchez Gual <lluis@ximian.com>
-
- * Commands/ProjectBrowserCommands/ReferenceFolderNodeCommands.cs:
- Removed call to IParserService.AddReferenceToCompletionLookup. The parser
- service now receives an event when a reference is added.
-
- * Commands/AutostartCommands.cs: Disabled generation of initial code
- completion database.
-
- * Services/File/DefaultFileService.cs: In LoadFileWrapper, use IProject
- reference instead of project name.
-
- * Services/Project/DefaultProjectService.cs: Added ReferenceAddedToProject
- and ReferenceRemovedFromProject events. Changed how event are handled.
- Now the service just forwards the events received from the open combine.
- The file events now use a new ProjectFileEventHandler delegate, which
- provide information about the source project in the args.
-
- * Services/Project/IProjectService.cs: Added new reference events.
-
- * ParserService/DefaultParserService.cs: Mostly reimplemented. The new
- implementation uses a unified data structure for storing information
- from projects and assemblies.
-
- * Services/ParserService/AssemblyInformation.cs: Added FileName property.
-
- * Services/ParserService/IParserService.cs: Added IProject parameter to
- most of methods. Added SearchNamespace, SearchType methods (moved
- from AbstractUnit), and GetClassInheritanceTree (moved from
- AbstractClass).
- Removed ParseInformationAdded and ParseInformationRemoved, and added a
- new ClassInformationChanged event that provides all change information
- at once.
-
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs: Take the name of the project
- from view's IProject property.
-
- * Gui/IViewContent.cs: Changed ProjectName property to IProject Project
- property.
-
- * Gui/Pads/ClassScout/NodeBuilder/DefaultDotNetClassScoutNodeBuilder.cs
- * Gui/Pads/ClassScout/ClassScout.cs: Use the new events and data structures
- from of parser service. Now, class data is not fully loaded when opening
- the project, but it is loaded under demand as project nodes are expanded.
-
- * Gui/Pads/ClassScout/NodeBuilder/IClassScoutNodeBuilder.cs: Use a single
- method to update the tree from parse event args.
-
- * Gui/Pads/ProjectBrowser/BrowserNode/ProjectBrowserNode.cs,
- Gui/Pads/ProjectBrowser/BrowserNode/CombineBrowserNode.cs:
- Use Combine.RemoveEntry to remove projects from a combine.
-
- * Gui/AbstractViewContent.cs: Implement new Project property.
-
- * Makefile.am: Added new files:
- Services/ParserService/CodeCompletionDatabase.cs,
- Services/ParserService/ClassInformationEventHandler.cs,
- Internal/Project/Project/ProjectReferenceEventArgs.cs,
- Internal/Project/Project/ProjectFileEventArgs.cs,
- Internal/Project/Combine/CombineEntryEventArgs.cs.
-
- * Internal/Project/Project/IProject.cs: Added new events for changes in
- files and references.
-
- * Internal/Project/Project/Collections/ProjectReferenceCollection.cs
- Internal/Project/Project/Collections/ProjectFileCollection.cs,
- AbstractProject.cs,
- Internal/Project/Combine/Combine.cs:
- Added support for new events.
-
- * Internal/Project/Combine/CombineEntry.cs: Created CombineEntryCollection.
-
- * Internal/Parser/PersistenceLayer/PersistentIndexer.cs,
- Internal/Parser/PersistenceLayer/PersistentParameter.cs,
- Internal/Parser/PersistenceLayer/PersistentMethod.cs,
- Internal/Parser/PersistenceLayer/PersistentReturnType.cs,
- Internal/Parser/PersistenceLayer/PersistentEvent.cs,
- Internal/Parser/PersistenceLayer/PersistentField.cs,
- Internal/Parser/PersistenceLayer/PersistentProperty.cs,
- Internal/Parser/PersistenceLayer/PersistentClass.cs,
- New implementation of read and write methods based on static methods. In
- this way it can be used to write instances of any IType and not only
- PersistentClass. Also use new helper methods for writing strings and
- object references.
-
- * Internal/Parser/IType.cs: Moved ClassInheritanceTree to IParserService.
-
- * Internal/Parser/ReflectionLayer/ReflectionClass.cs: Added Null check for
- MonodocService.
-
- * Internal/Parser/IRegion.cs: Added FileName property.
-
- * Internal/Parser/Implementations/AbstractUsing.cs,
- Internal/Parser/IUsing.cs: Moved SearchType and SearchNamespace to
- IParserService.
-
- * Internal/Parser/Implementations/AbstractDecoration.cs,
- Internal/Parser/Implementations/AbstractNamedEntity.cs,
- Internal/Parser/Implementations/AbstractReturnType.cs: Fixed usage of
- documentation hashtable. GetHashCode() do not return unique values!
-
- * Internal/Parser/Implementations/DefaultRegion.cs: Implemented FileName
- property.
-
- * Internal/Parser/Implementations/AbstractClass.cs:
- Moved ClassInheritanceTree to IParserService.
-
- * Internal/Parser/Implementations/AbstractParameter.cs: Added null check.
-
- * Internal/Parser/IParser.cs: Added Project parameter to some methods.
-
-2004-05-25 Todd Berman <tberman@sevenl.net>
-
- * Internal/Project/Combine/Combine.cs: more makefile magic for
- building, outputting semi-properly, and a make run setup.
- * Internal/Project/Combine/CombineEntry.cs: pass the Combine to the
- makefile being generated.
- * Internal/Codons/LanguageBinding/ILanguageBinding.cs: pass the Combine
- on down.
- * Makefile.am: Add Mono.Posix to the build.
-
-2004-05-24 Todd Berman <tberman@sevenl.net>
-
- * Gui/Workbench/DefaultWorkbench.cs: Setup text/uri-list DnD.
- Tested with single and multiple files/projects from nautilus.
- * Internal/Parser/ReflectionLayer/ReflectionClass.cs: workaround
- potential nullref.
- * Commands/AutostartCommands.cs: fix focus issue.
-
-2004-05-22 Todd Berman <tberman@sevenl.net>
-
- * Gui/Dialogs/NewProjectDialog.cs: Sort properly.
-
-2004-05-19 Todd Berman <tberman@sevenl.net>
-
- * Services/ParserService/DefaultParserService.cs: potential nullref
- removed.
-
-2004-05-20 Pawel Rozanski <tokugawa@afn.no-ip.org>
-
- * Services/Tasks/Task.cs: add a "COMMENT" ErrorNumber in order to
- show TaskType.Comment in Task List.
-
-2004-05-18 Todd Berman <tberman@sevenl.net>
-
- * Internal/Project/Combine/Combine.cs: load/save a new property
- 'RelativeOutputPath' on the solution level. Much hilarity ensues.
-
-2004-05-17 Todd Berman <tberman@sevenl.net>
-
- * Commands/ProjectBrowserCommands/CombineNodeCommands.cs:
- * Commands/FileCommands.cs:
- * Gui/Dialogs/NewProjectDialog.cs:
- * Gui/Dialogs/OptionPanels/IDEOptions/LoadSavePanel.cs: change from
- SpecialFolder.Personal to getenv ("HOME").
-
-2004-05-16 Todd Berman <tberman@sevenl.net>
-
- * Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs: fix to use
- the new SystemAssemblySerivce.
- * Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs: ^^
- * Gui/Components/SdMenuCommand.cs: remove useless code, use the proper
- overload.
- * Gui/Pads/ClassScout/ClassScout.cs: revert semi-fix of r1600 and add
- a new fix that might or might not work, but will not cause the speed
- issues of the previous fix.
- * Gui/Pads/ClassScout/NodeBuilder/DefaultDotNetClassScoutNodeBuiler.cs:
- ^^
- * Gui/Pads/HelpBrowser/HelpViewer.cs: indenting fix.
- * Services/SystemAssemblyService.cs: new service for identifying
- system assemblies (mono installed + pc'd assemblies)
- * Services/ParserService/DefaultParserService.cs:
- * Services/ParserService/IParserService.cs: passthrough for monodoc
- resolver.
- * Makefile.am: add SystemAssemblyService
- * Internal/Project/Project/ProjectReference.cs: proper reference
- information.
- * Internal/Project/Project/AbstractProject.cs: remove windows .ToUpper
- hack.
- * Internal/Project/Combine/Combine.cs: start of solution level
- makefiles.
- * Internal/Parser/IParser.cs: monodoc resolver addition.
-
-2004-05-10 Todd Berman <tberman@sevenl.net>
-
- * Gui/Workbench/DefaultWorkbench.cs: Attempt non-metacity toplevel fix
- * Gui/Dialogs/SplashScreen.cs: explicity set this to popup
-
-2004-05-09 Todd Berman <tberman@sevenl.net>
-
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs: use DragNotebook
-
-2004-05-07 Todd Berman <tberman@sevenl.net>
-
- * Gui/Pads/ClassScout/ClassScout.cs: adding a lock.
-
-2004-05-06 Todd Berman <tberman@sevenl.net>
-
- * Gui/Pads/ClassScout/ClassScout.cs: try catch to prevent potentialy
- strange threading interactions.
-
-2004-05-04 John Luke <jluke@cfl.rr.com>
-
- * Makefile.am: make Services/StockIcons.cs regen properly
- and pass make distcheck
-
-2004-05-04 Pawel Rozanski <tokugawa@afn.no-ip.org>
-
- * Makefile.am: Services/StockIcons.cs update is triggered by a changes
- in build/data/resources/icons dir
-
-2004-05-03 Francisco "Paco" Martinez <paco@mfcon.com>
-
- * Gui/Dialogs/CommonAboutDialog.cs: Added Paco Martinez name to the
- list of authors
-
-2004-05-02 Todd Berman <tberman@sevenl.net>
-
- * Services/Project/IProjectService.cs
- * Services/Project/DefaultProjectService.cs: Add events for Files being
- added and removed.
- * Gui/Pads/ClassScout/ClassScout.cs: Properly update on files added
- and removed.
-
-2004-05-02 Todd Berman <tberman@sevenl.net>
-
- * Services/ParserService/DefaultParserService.cs: expose gac lib
- location finder
- * Services/ParserService/AssemblyInformation.cs: remove previous fix
- * Services/ParserService/IParserService.cs: expose gac lib location
- finder
- * Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs: sort properly
- * Internal/Project/Project/ProjectReference.cs: Use parser method to
- find gac lib location.
-
-2004-05-01 Todd Berman <tberman@sevenl.net>
-
- * Gui/Dialogs/TreeViewOptions.cs: notify main window that gui effecting
- changes may have occured, update the menu.
-
-2004-05-01 Todd Berman <tberman@sevenl.net>
-
- * Gui/Pads/OpenTaskView.cs: Fix gtk+2.4 regression.
- * Services/ParserService/DefaultParserService.cs: load assemblies
- out of the GAC for indexing.
-
-2004-04-30 Todd Berman <tberman@sevenl.net>
-
- * Gui/Pads/HelpBrowser/MonodocTreePad.cs: Hide doc nodes without
- any docs. This is an ugly ugly solution, but it works. Feel free
- to replace it with something better that looks nice.
-
-2004-04-29 Todd Berman <tberman@sevenl.net>
-
- * Services/ParserService/DefaultParserService.cs: commenting out
- a GC.Collect () per lluis' instructions, this results in monodevelops
- cpu usage at idle going from 20% to 2%. Good stuff :)
-
-2004-04-29 Todd Berman <tberman@sevenl.net>
-
- * Gui/Dialogs/OptionPanels/ExternalToolPanel.cs: fix up to match gtk#
- from cvs.
- * Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs:
- * Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs:
- Now we actually pull assemblies from the gac.
- NOTE: Until gtk-sharp, and other libraries actually start using the gac
- it will not be possible to add a proper gac reference to them.
- This will be fixed on their end by beta1 however.
-
-2004-04-28 Todd Berman <tberman@sevenl.net>
-
- * Internal/Project/Project/AbstractProject.cs: Actually make that check
- and the others like it work.
-
-2004-04-28 Todd Berman <tberman@sevenl.net>
-
- * Internal/Project/Project/AbstractProject.cs: For now, dont ask
- to add new Makefiles.
-
-2004-04-28 Todd Berman <tberman@sevenl.net>
-
- * Commands/RunCommands.c:
- * Services/Project/DefaultProjectService.cs:
- * Services/Project/IProjectService.cs:
- * Internal/Codons/LanguageBinding/ILanguageBinding.cs:
- * Internal/Project/Project/IncludeFilesDialog.cs:
- * Internal/Project/Combine/Combine.cs:
- * Internal/Project/Combine/CombineEntry.cs:
-
- Commit basically sets up the skeleton for the GenerateMakefiles stuff.
- Right now all the real code is in the LanguageBinding, where it
- should be (I think). Anyone looking to add this functionality to their
- LanguageBinding is welcome too, however the api and setup may change
- while the C# implementation is being written, so there are no
- promises at all.
-
-
-2004-04-27 Todd Berman <tberman@sevenl.net>
-
- * Gui/Pads/HelpBrowser/MonodocTreePad.cs: Select the content window
- when you render new docs.
-
-2004-04-27 John Luke <jluke@cfl.rr.com>
-
- * Gui/Pads/FileScout.cs: kill
- * Gui/Pads/FileScout/FileScout.cs
- * Gui/Pads/FileScout/FileList.cs
- * Gui/Pads/FileScout/FileListItem.cs: split these up, remove
- unneeded/used code, implement File.Delete popup
- * Makefile.am: account for new files
-
-2004-04-25 John Luke <jluke@cfl.rr.com>
-
- * Gui/Dialogs/WordCountDialog.cs: use ShadowType.in
- * Gui/Pads/ClassScout/ClassScout.cs:
- * Gui/Pads/ProjectBrowser/ProjectBrowserView.cs:
- implement PopupMenu to show ContextMenus
-
-2004-04-25 Pawel Rozanski <tokugawa@afn.no-ip.org>
-
- * Gui/Dialogs/CommonAboutDialog.cs: fixed my very Polish name.
-
-2004-04-25 John Luke <jluke@cfl.rr.com>
-
- * Gui/Dialogs/CommonAboutDialog.cs:
- update contributors and adjust the scroll slightly
-
-2004-04-24 Todd Berman <tberman@sevenl.net>
-
- * Services/ParserService/DefaultParserService.cs:
- * Services/ParserService/IParserService.cs:
- * Internal/Parser/IParser.cs: add stubbing for IsAsResolver
-
-2004-04-22 Todd Berman <tberman@sevenl.net>
-
- * Gui/Components/SdMenu.cs: check for children, if none, hide menu.
- * Gui/Components/SdMenuCheckBox.cs: small change for gtk-sharp from
- future cvs, should work with current cvs though.
-
-2004-04-20 Todd Berman <tberman@sevenl.net>
-
- * Commands/AutostartCommands.cs: Move stuff around so workbench memento
- works.
- * Gui/Workbench/DefaultWorkbench.cs: Same as above.
-
-2004-04-19 Todd Berman <tberman@sevenl.net>
-
- * Commands/AutostartCommands.cs: Match new ReflectionLayer api.
- * Services/MonodocService.cs: uncomment GetHelpXml
- * Services/AmbienceService/AmbienceReflectionDecorator.cs: match api.
- * Services/ParserService/AssemblyInformation.cs: match api.
- * Internal/Parser/ReflectionLayer/Reflection*.cs:
- Add the start of documentation integration into the actual IDE.
- Now the docs show up on code completion tooltips, just the summary.
- Potentially we should enable the entire doc for the class/method,
- but I havnt seen how it looks yet, as it will most likely be large
- for some methods/classes.
-
- **NOTE: To get this documentation integration, you have to rebuild
- your code completion database.
-
-2004-04-17 Todd Berman <tberman@sevenl.net>
-
- * Services/Toolbar/ToolbarService.cs:
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs:
- * Gui/Workbench/DefaultWorkbench.cs:
- * Gui/Components/SdToolbarCommand.cs:
- Fixup the entire toolbar scheme to actually *work* properly.
- This is only temporary, as the entire toolbar setup is going to be
- rewritten again to support arbitrary widgetry, proper saving/loading of
- toolbars tied to layouts, etc, etc.
-
-2004-04-17 Todd Berman <tberman@sevenl.net>
-
- * Gui/Components/SdMenu.cs:
- * Commands/MenuItemBuilders.cs:
- Fix the menu system so we dont rebuild the menu's from scratch every
- time you use them. This should speed using the menu's up a lot.
- The only trick is new SubmenuItemBuilders need to create menu types
- with the ISubmenuItem interface so we can tell that they are built
- and not static.
-
-2004-04-16 John Luke <jluke@cfl.rr.com>
-
- * Gui/Dialogs/SharpDevelopAboutPanels.cs: align the labels to
- the left and space them a little better
-
-2004-04-14 John Luke <jluke@cfl.rr.com>
-
- * Gui/Dialogs/CommonAboutDialog.cs: chain to base (GType)
- so Gtk# cvs is happy
-
-2004-04-14 Nick Drochak <ndrochak@gol.com>
-
- * Gui/Pads/ProjectBrowser/ProjectBrowserView.cs: When file is added,
- put it under the correct folder.
-
-2004-04-14 Pawel Rozanski <tokugawa@afn.no-ip.org>
-
- * Commands/RunCommands.cs:
- * Internal/Project/Combine/Combine.cs:
- fix bug #56864.
-
-2004-04-13 John Luke <jluke@cfl.rr.com>
-
- * Gui/BrowserDisplayBinding/HtmlViewPane.cs: use Navbar control,
- use StatusBarService for messages and a Progress monitor
-
-2004-04-11 Todd Berman <tberman@sevenl.net>
-
- * Gui/Workbench/WorkbenchMemento.cs: ugh, check for valid data too.
-
-2004-04-11 Todd Berman <tberman@sevenl.net>
-
- * Gui/Workbench/WorkbenchMemento.cs: fix potential nullrefs.
-
-2004-04-11 Todd Berman <tberman@sevenl.net>
-
- * Commands/AutostartCommands.cs: reorganize the SetMemento so it works
- better.
- * Gui/Workbench/WorkbenchMemento.cs: readd windowstate.
- * Gui/Workbench/DefaultWorkbench.cs: now we restore from maximized
- properly.
-
-2004-04-10 Todd Berman <tberman@sevenl.net>
-
- * Internal/Project/Project/AbstractProject.cs: fix potentiall nullref
-
-2004-04-10 Todd Berman <tberman@sevenl.net>
-
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs:
- * Gui/Workbench/Layouts/SdiWorkspaceWindow.cs:
- * Gui/IWorkbenchLayout.cs:
- fix bug #56769.
-
-2004-04-09 John Luke <jluke@cfl.rr.com>
-
- * Commands/AutostartCommands: remove dead code
- * Gui/Pads/TerminalPad.cs: update and rename from 'Output' to 'Terminal'
- * Gui/HtmlControl/MozillaControl.cs: remove CWL
-
-2004-04-09 Todd Berman <tberman@sevenl.net>
-
- * Gui/Dialogs/SharpDevelopAboutPanels.cs: closing per bug #55955.
-
-2004-04-09 Todd Berman <tberman@sevenl.net>
-
- * Gui/Components/SdStatusBar.cs: Add pulsing.
-
-2004-04-09 Pawel Rozanski <tokugawa@afn.no-ip.org>
-
- * Services/Tasks/Task.cs: don't show "()" when error.ErrorNumber is
- empty
-
-2004-04-07 John Luke <jluke@cfl.rr.com>
-
- * Gui/Dialogs/CommonAboutDialog.cs:
- * Gui/Dialogs/SharpDevelopAboutPanels.cs: rearrange the copyright,
- license, sponsorship, and version information. Add back info about
- SharpDevelop and AlphaSierraPapa
- * Gui/Dialogs/TipOfTheDay.cs: remove IDisposable and call Hide and
- Dispose instead of Destroy on the window, remove some unneccesary
- public things
- * Commands/HelpCommand.cs: revert addition of using () {} to
- tipoftheday
- * Gui/Workbench/DefaultWorkbench.cs: uncomment memento restoring code
-
-2004-04-07 Todd Berman <tberman@sevenl.net>
-
- * Commands/ProjectBrowserCommands/FolderNodeCommands: Incorporate bug
- fix for bug #56275 based on a patch from eddie tejeda
- <eddie AT nailchipper DOT com>. Also fix an exception that could
- occur when the file already exists in the target directory.
-
-2004-04-07 Nick Drochak <ndrochak@gol.com>
-
- * Gui/Pads/ProjectBrowser/ProjectBrowserView.cs: Before the actual edit
- have node un-munge the text it wraps around the combine name.
- * Gui/Pads/ProjectBrowser/BrowserNode/CombineBrowserNode.cs: Re-munge
- name with number of entries after the combine name changes.
-
-2004-04-06 Todd Berman <tberman@sevenl.net>
-
- * Commands/FileCommands.cs: Combine the open solution/file into one
- open... command
- * Gui/Pads/FileScout.cs: add .ToUpper () to catch .pRjx, etc.
-
-2004-04-06 Todd Berman <tberman@sevenl.net>
-
- * Commands/MenuItemBuilders.cs: change to use alt instead of control
- for a more 'gnomey' feel.
-
-2004-04-06 Todd Berman <tberman@sevenl.net>
-
- * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs: update the menu
- after a context switch.
- * Gui/Components/SdMenu.cs: remove some junk.
- * Internal/Conditions/WorkbenchContextCondition.cs: new condition
- to allow conditionals on current context state.
- * Makefile.am: add above file to build
-
-2004-04-06 Todd Berman <tberman@sevenl.net>
-
- * Commands/ProjectBrowserCommands/CombineNodeCommands.cs: fix bug
- #56429.
-
-2004-04-06 Todd Berman <tberman@sevenl.net>
-
- * Gui/Workbench/DefaultWorkbench.cs: register gtype. add message about
- using proper ctor.
- * Gui/BrowserDisplayBinding/HtmlViewPane.cs: remove useless event
- box.
-
-2004-04-04 John Luke <jluke@cfl.rr.com>
-
- * Gui/BrowserDisplayBinding/HtmlViewPane.cs:
- * Gui/BrowserDisplayBinding/BrowserDisplayBinding.cs: small cleanups
- * Commands/HelpCommands.cs: make sure dispose is called on the
- tip of the day, about and viewgpl dialogs
- * Commands/ToolsCommands.cs: make sure dispose is called for the
- NewLayoutDialog
- * Gui/Dialogs/NewLayoutDialog.cs: implement IDisposable
- * Gui/Dialogs/ViewGplDialog.cs: implement IDisposable
- * Gui/Dialogs/TipOfTheDayDialog.cs: implement IDisposable
-
-2004-04-04 Todd Berman <tberman@sevenl.net>
-
- * Services/ParserService/AssemblyInformation.cs: workaround mono bug
- with Assembly.Load (byte[]). (this fixes radek's bug)
- * Gui/Dialogs/NewProjectDialog.cs: proper string
-
-2004-04-04 Todd Berman <tberman@sevenl.net>
-
- * Services/ParserService/DefaultParserService.cs: fix nullref
-
-2004-04-04 John Luke <jluke@cfl.rr.com>
-
- * Gui/Pads/FileScout.cs: use Gtk.Stock.Open for the icon
- * Gui/Dialogs/SharpDevelopAboutPanels.cs: call Path.GetFullPath
- on assembly location to get rid of '../AddIn/..' stuff
- send the text to the X clipboard also
- * Gui/BrowserDisplayBinding/HtmlViewPane.cs: register the GType
- to fix weirdness
-
-2004-04-04 Todd Berman <tberman@sevenl.net>
-
- * Internal/Codons/MenuItems/MenuItemCodon.cs:
- * Internal/Codons/DialogPanelCodon.cs: change label to _label and
- gettext it
-
-2004-04-04 Nick Drochak <ndrochak@gol.com>
-
- * Gui/Dialogs/NewProjectDialog.cs: On double click of icon when there
- is an illegal or empty solution name, do not hide dialog.
-
-2004-04-03 Todd Berman <tberman@sevenl.net>
-
- * Gui/Workbench/Layous/SdiWorkspaceLayout.cs: set pref height and width
- on the Documents dockitem to -2 to make gdl-dock attempt to give it
- greedy resizing as much as possible.
-
-2004-04-03 Todd Berman <tberman@sevenl.net>
-
- * Services/GettextCatalog.cs: moved to .Core.
- * Makefile.am: reflect above change.
-
-2004-04-02 Todd Berman <tberman@sevenl.net>
-
- * Services/File/DefaultFileService.cs:
- * Services/ResourceNotFoundException.cs:
- * Services/DisplayBinding/DisplayBindingService.cs:
- * Services/Project/DefaultProjectService.cs:
- * Services/StatusBar/DefaultStatusBarService.cs:
- * Services/MessageService.cs:
- * Services/ParserService/DefaultParserService.cs:
- Finished gettextifyin the base dll.
-
-2004-04-02 Todd Berman <tberman@sevenl.net>
-
- * Gui/Pads/ProjectBrowser/BrowserNode/NamedFolderNode.cs:
- * Gui/Pads/ProjectBrowser/NodeBuilder/DefaultDotNetNodeBuilder.cs:
- phantom commit, no one saw this
-
-2004-04-02 Todd Berman <tberman@sevenl.net>
-
- * Commands/RunCommands.cs:
- * Commands/FileCommands.cs:
- * Gui/Pads/ProjectBrowser/NodeBuilder/DefaultDotNetNodeBuilder.cs:
- * Internal/ExternalTool/ExternalTool.cs:
- * Internal/ExternalTool/ToolLoader.cs:
- * Internal/Project/Project/Deployment/FileDeploy.cs:
- * Internal/Project/Project/Deployment/AssemblyDeploy.cs:
- * Internal/Project/Project/Deployment/ScriptDeploy.cs:
- * Internal/Project/Project/IncludeFilesDialog.cs:
- * Internal/Project/Project/AbstractProject.cs:
- * Internal/Project/Combine/Combine.cs:
- * Internal/Project/Combine/CombineEntry.cs:
- * Internal/Templates/FileTemplate.cs:
- * Internal/Templates/CodeTemplateLoader.cs:
- * Internal/Templates/ProjectTemplates/CombineDescriptor.cs:
- * Internal/Templates/ProjectTemplates/ProjectDescriptor.cs:
- gettextify, and actually COMPILE it before checking in this time...
-
-2004-04-02 Todd Berman <tberman@sevenl.net>
-
- * Commands/MenuItemBuilders.cs:
- * Commands/RunCommands.cs:
- * Commands/ClassBrowserCommands/ClassBrowserCommands.cs:
- * Commands/ProjectCommands.cs:
- * Commands/ProjectBrowserCommands/ResourceFolderNodeCommands.cs:
- * Commands/ProjectBrowserCommands/FolderNodeCommands.cs:
- * Commands/ProjectBrowserCommands/CombineNodeCommands.cs:
- * Commands/FileCommands.cs:
- * Commands/HelpCommands.cs:
- gettextify all of the in-use Commands/
-
-
-2004-04-02 Todd Berman <tberman@sevenl.net>
-
- * Gui/Dialogs/SharpDevelopAboutPanels.cs:
- * Gui/Dialogs/ProjectOptionsDialog.cs:
- * Gui/Dialogs/WordCountDialog.cs:
- * Gui/Dialogs/TreeViewOptions.cs:
- * Gui/Dialogs/OptionPanels/ProjectOptions/CompileFileProjectOptions.cs:
- * Gui/Dialogs/OptionPanels/ProjectOptions/GeneralProjectOptions.cs:
- * Gui/Dialogs/OptionPanels/ProjectOptions/DeployFileOptions.cs:
- * Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs:
- * Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs:
- * Gui/Dialogs/ReferenceDialog/ProjectReferencePanel.cs:
- * Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs:
- gettextify, this finishes Gui/Dialogs/* that we use currently i think.
-
-
-2004-04-02 Todd Berman <tberman@sevenl.net>
-
- * Gui/Dialogs/OptionPanels/ExternalToolPanel.cs:
- * Gui/Dialogs/OptionPanels/IDEOptions/LoadSavePanel.cs:
- * Gui/Dialogs/OptionPanels/IDEOptions/BuildPanel.cs:
- * Gui/Dialogs/OptionPanels/IDEOptions/CodeGenerationPanel.cs:
- * Gui/Dialogs/OptionPanels/IDEOptions/ProjectAndCombinePanel.cs:
- gettextify
-
-
-2004-04-02 Todd Berman <tberman@sevenl.net>
-
- * Gui/Dialogs/NewProjectDialog.cs:
- * Gui/Dialogs/CommonAboutDialog.cs:
- * Gui/Dialogs/OptionPanels/EditTemplateDialog.cs:
- * Gui/Dialogs/NewFileDialog.cs: gettextified
-
-2004-04-02 Todd Berman <tberman@sevenl.net>
-
- * Services/GettextCatalog.cs: changed to use static methods.
- * Gui/Dialogs/CommonAboutDialog.cs: reflecting above change.
-
-2004-04-02 Todd Berman <tberman@sevenl.net>
-
- * Makefile.am: Added GettextCatalog.cs
- * Services/GettextCatalog.cs: imported from muine, modified a bit.
- * Gui/Dialogs/CommonAboutDialog.cs: added gettext translatable title
- to test .cs translations.
- * Gui/Dialogs/OptionPanels/IDEOptions/LoadSavePanel.cs: modified to
- test .glade translations
-
-2004-04-01 John Luke <jluke@cfl.rr.com>
-
- * Internal/ExternalTool/ExternalTool.cs:
- store UseOutputPad in xml file
-
-2004-04-01 Todd Berman <tberman@sevenl.net>
-
- * Gui/Dialogs/TipOfTheDay.cs: make same change here.
-
-2004-04-01 Todd Berman <tberman@sevenl.net>
-
- * Commands/AutostartCommands.cs: default to false for ShowToTD
-
-2004-03-31 Todd Berman <tberman@sevenl.net>
-
- * Gui/Dialogs/CommonAboutDialog.cs: fixing the string stuff.
- * Makefile.am: adding -codepage:utf8
-
-2004-03-31 Todd Berman <tberman@sevenl.net>
-
- * Gui/Dialogs/CommonAboutDialog.cs: adding miguel :)
-
-2004-03-31 Todd Berman <tberman@sevenl.net>
-
- * Internal/Project/AbstractProject.cs: dont include *.swp, *~ or .* in
- search for new files. closes bug #56282.
-
-2004-03-31 Todd Berman <tberman@sevenl.net>
-
- * Gui/Pads/ProjectBrowser/ProjectBrowserView.cs: fix bug #56273, rename
- Projects tab to Combine.
-
-2004-03-31 John Luke <jluke@cfl.rr.com>
-
- * Commands/ProjectBrowserCommands/FolderNodeCommands.cs:
- use stock buttons and put the MessageDialog in a using {}
-
-2004-03-30 Todd Berman <tberman@sevenl.net>
-
- * Gui/Pads/ClassScout/ClassScout.cs: stop using Gdk.Threads.Enter and
- .Leave, as they can cause deadlocks, using a GLib.IdleHandler instead.
- Closes bug #56260
-
-2004-03-29 Todd Berman <tberman@sevenl.net>
-
- * Gui/Pads/ClassScout/ClassScout.cs: partial fix to bug with double
- clicking not setting focus properly.
-
-2004-03-29 Todd Berman <tberman@sevenl.net>
-
- * Commands/RunCommands.cs: When you run, you need to make sure the
- compile completed properly.
- * Gui/Workbench/Layouts/SdiWorkspaceWindow.cs: Mark file/project dirty
- if it becomes dirty, relying on unsaved files is not acceptable.
-
-2004-03-28 Todd Berman <tberman@sevenl.net>
-
- * Services/ParserService/DefaultParserService.cs: re-add try catch to
- prevent exceptions from percolating up and blowing up. closes bug
- #56128
-
-2004-03-28 John Luke <jluke@cfl.rr.com>
-
- * Services/ParserService/DefaultParserService.cs:
- if filename == null don't switch on it
- * Gui/Pads/TerminalPad.cs: add but dont build yet
-
-2004-03-27 Todd Berman <tberman@sevenl.net>
-
- * Commands/FileCommands: remove save as notification, as its useless
- closes bug #56126
-
-2004-03-27 Todd Berman <tberman@sevenl.net>
-
- * Internal/Parser/*: update to new parser from upstream.
- * Gui/ContentInterfaces/IParseInformationListener.cs: update.
- * Gui/Pads/ClassScout/NodeBuilder/DefaultDotNetClassScoutNodeBuilder.cs:
- rework to use SortUtilities and a TreeNodeComparer for removal
- this should fix 99% of those strange class browser bugs.
- * Gui/CompletionDatabaseWizard/CreateDBGenerator.cs:
- update to reflect new parser changes.
- * Services/ParserService/*: update from upstream, add some of our mods
- * Services/ProjectService/ParseInformationEventHandler.cs:
- * Services/ClassBrowserIcons/ClassBrowserIconsService.cs:
- * Services/AmbienceService/*:
- * Commands/AutostartCommands.cs: update to reflect other changes.
- * Makefile.am: update with new files.
-
-2004-03-26 John Luke <jluke@cfl.rr.com>
-
- * Gui/Dialogs/SharpDevelopAboutPanels.cs:
- enable copy button for assembly version info
- fixes bug #55955
- * Gui/Pads/ProjectBrowser/BrowserNode/FileNode.cs:
- workaround/fix for #55185, a confusing message when
- removing a file from a project, need to revisit it later
- * Gui/Pads/HelpBrowser/MonodocTreePad.cs:
- expand the first row by default
- * Gui/Pads/ProjectBrowser/ProjectBrowserView.cs:
- expand the first row by default
-
-2004-03-25 Todd Berman <tberman@sevenl.net>
-
- * Makefile.am:
- * Gui/HtmlControl/MozillaControl.cs:
- * Gui/BrowserDisplayBinding/HtmlViewPane.cs: updated for gecko-sharp
-
-2004-03-25 Todd Berman <tberman@sevenl.net>
-
- * Services/File/DefaultFileService.cs: adding a new method of external
- app launching based on gnome vfs stuff, works around broken gnome
- installs.
-
-2004-03-21 John Luke <jluke@cfl.rr.com>
-
- * Commands/ProjectBrowserCommands/FolderNodeCommands.cs:
- set the default of the FileSelector to ~/MonoDevelopProjects
- closes bug #55188
-
-2004-03-21 Todd Berman <tberman@sevenl.net>
-
- * Commands/FileCommands: fix bug #55869.
-
-2004-03-21 Todd Berman <tberman@sevenl.net>
-
- * Commands/VBConverter/ConvertProject.cs:
- * Commands/VBConverter/ConvertBuffer.cs: Changed to use new parser
diff --git a/main/src/core/MonoDevelop.Ide/ExtensionModel/Commands.addin.xml b/main/src/core/MonoDevelop.Ide/ExtensionModel/Commands.addin.xml
index 3b0e686d93..92213ef624 100644
--- a/main/src/core/MonoDevelop.Ide/ExtensionModel/Commands.addin.xml
+++ b/main/src/core/MonoDevelop.Ide/ExtensionModel/Commands.addin.xml
@@ -121,7 +121,7 @@
_label = "_Lowercase Selection" />
<Command id = "MonoDevelop.Ide.Commands.EditCommands.RemoveTrailingWhiteSpaces"
description = "Remove trailing whitespace"
- _label = "_Remove trailing whitespace" />
+ _label = "_Remove Trailing Whitespace" />
<Command id = "MonoDevelop.Ide.Commands.EditCommands.JoinWithNextLine"
shortcut = "Control|Shift|J"
_description = "Join the current line with the next line"
@@ -129,9 +129,6 @@
<Command id = "MonoDevelop.Ide.Commands.EditCommands.SortSelectedLines"
_description = "Sort the selected lines"
_label = "_Sort Lines" />
- <Command id = "MonoDevelop.Ide.Commands.EditCommands.WordCount"
- _label = "_Word Count..."
- description = "Count words in a text file"/>
<Command id = "MonoDevelop.Ide.Commands.EditCommands.InsertGuid"
_label = "_Insert Guid"
description = "Inserts a Guid at caret position"/>
@@ -179,9 +176,6 @@
defaultHandler = "MonoDevelop.Ide.CodeFormatting.FormatBufferHandler"
_label = "_Format Document"
macShortcut = "Control|I" />
- <Command id = "MonoDevelop.Ide.CodeFormatting.CodeFormattingCommands.FormatSelection"
- defaultHandler = "MonoDevelop.Ide.CodeFormatting.FormatSelectionHandler"
- _label = "_Format Selection" />
</Category>
<!-- ProjectCommands -->
@@ -193,7 +187,8 @@
icon = "md-new-project" />
<Command id = "MonoDevelop.Ide.Commands.ProjectCommands.AddNewWorkspace"
_label = "_Add New Workspace..."
- _description = "Add a new child workspace to the selected workspace" />
+ _description = "Add a new child workspace to the selected workspace"
+ icon = "md-new-workspace" />
<Command id = "MonoDevelop.Ide.Commands.ProjectCommands.AddNewSolution"
_label = "_Add New Solution..."
_description = "Add a new child solution to the selected workspace"
@@ -218,15 +213,18 @@
_description = "Show options window" />
<Command id = "MonoDevelop.Ide.Commands.ProjectCommands.SolutionOptions"
defaultHandler = "MonoDevelop.Ide.Commands.SolutionOptionsHandler"
+ icon = "gtk-preferences"
_label = "_Solution Options"
_description = "Show solution options window" />
<Command id = "MonoDevelop.Ide.Commands.ProjectCommands.ProjectOptions"
defaultHandler = "MonoDevelop.Ide.Commands.ProjectOptionsHandler"
+ icon = "gtk-preferences"
_label = "Project _Options"
_description = "Show project options window" />
<Command id = "MonoDevelop.Ide.Commands.ProjectCommands.AddReference"
_description = "Add and remove project references"
+ icon = "md-reference"
_label = "_Edit References..."
defaultHandler = "MonoDevelop.Ide.Commands.EditReferencesHandler" />
<Command id = "MonoDevelop.Ide.Commands.ProjectCommands.AddNewFiles"
@@ -246,10 +244,10 @@
<Command id = "MonoDevelop.Ide.Commands.ProjectCommands.NewFolder"
_label = "New _Folder"
_description = "Create a new folder"
- icon = "md-new-folder-icon" />
+ icon = "md-new-folder" />
<Command id = "MonoDevelop.Ide.Commands.ProjectCommands.IncludeToProject"
_description = "Add existing file to the project"
- _label = "_Include To Project" />
+ _label = "_Include in Project" />
<Command id = "MonoDevelop.Ide.Commands.ProjectCommands.BuildSolution"
defaultHandler = "MonoDevelop.Ide.Commands.BuildSolutionHandler"
_label = "_Build All"
@@ -340,7 +338,7 @@
<Command id = "MonoDevelop.Ide.Commands.ProjectCommands.ExportSolution"
defaultHandler = "MonoDevelop.Ide.Commands.ExportSolutionHandler"
_description = "Convert selected solution to another format"
- _label = "_Export..." />
+ _label = "Convert solution format..." />
<Command id = "MonoDevelop.Ide.Commands.ProjectCommands.SelectActiveConfiguration"
type = "radio|array"
defaultHandler = "MonoDevelop.Ide.Commands.SelectActiveConfigurationHandler"
@@ -380,7 +378,7 @@
shortcut = "Control|N"
macShortcut = "Meta|N"
_description = "Create a new file"
- icon = "gtk-new" />
+ icon = "md-regular-file" />
<Command id = "MonoDevelop.Ide.Commands.FileCommands.Save"
icon = "gtk-save"
shortcut = "Control|S"
@@ -404,7 +402,8 @@
<Command id = "MonoDevelop.Ide.Commands.FileCommands.NewWorkspace"
defaultHandler = "MonoDevelop.Ide.Commands.NewWorkspaceHandler"
_label = "_Workspace..."
- _description = "Create a new workspace"/>
+ _description = "Create a new workspace"
+ icon = "md-new-workspace" />
<Command id = "MonoDevelop.Ide.Commands.FileCommands.CloseFile"
defaultHandler = "MonoDevelop.Ide.Commands.CloseFileHandler"
_label = "_Close File"
@@ -423,7 +422,10 @@
defaultHandler = "MonoDevelop.Ide.Commands.CloseWorkspaceHandler"
_label = "C_lose Workspace"
_description = "Close all solutions open in the current workspace"
- icon = "md-close-combine-icon" />
+ icon = "md-close-combine-icon"
+ shortcut = "Control|Alt|W"
+ macShortcut = "Meta|Alt|W"
+ />
<Command id = "MonoDevelop.Ide.Commands.FileCommands.CloseWorkspaceItem"
defaultHandler = "MonoDevelop.Ide.Commands.CloseWorkspaceHandler"
_label = "C_lose"
@@ -432,11 +434,9 @@
<Command id = "MonoDevelop.Ide.Commands.FileCommands.ReloadFile"
_label = "_Revert"
_description = "Revert to a saved version of the file"
- macShortcut = "Meta|U"
- icon = "gtk-revert-to-saved" />
+ macShortcut = "Meta|U" />
<Command id = "MonoDevelop.Ide.Commands.FileCommands.SaveAs"
_label = "Save _As..."
- icon = "gtk-save-as"
_description = "Save the current file with a different name" />
<Command id = "MonoDevelop.Ide.Commands.FileCommands.PrintDocument"
defaultHandler = "MonoDevelop.Ide.Commands.PrintHandler"
@@ -449,13 +449,11 @@
defaultHandler = "MonoDevelop.Ide.Commands.PrintPreviewHandler"
_label = "Print Previe_w"
_description = "Show print preview"
- icon = "gtk-print-preview"
shortcut = "Shift|Control|P" />
<Command id = "MonoDevelop.Ide.Commands.FileCommands.PrintPageSetup"
defaultHandler = "MonoDevelop.Ide.Commands.PrintPageSetupHandler"
_label = "Page Set_up"
- _description = "Show page setup"
- icon = "gtk-page-setup" />
+ _description = "Show page setup" />
<Command id = "MonoDevelop.Ide.Commands.FileCommands.RecentFileList"
defaultHandler = "MonoDevelop.Ide.Commands.RecentFileListHandler"
type="array"
@@ -477,7 +475,6 @@
<Command id = "MonoDevelop.Ide.Commands.FileCommands.Exit"
defaultHandler = "MonoDevelop.Ide.Commands.ExitHandler"
_label = "_Quit"
- icon = "gtk-quit"
_description = "Quit MonoDevelop"
macShortcut = "Meta|Q"
shortcut = "Control|Q" />
@@ -495,13 +492,13 @@
<Condition id="Platform" value="mac">
<Command id = "MonoDevelop.Ide.Commands.FileCommands.OpenContainingFolder"
_label = "Reveal in Finder"
- _description = "Reveals the file in Finder."/>
+ _description = "Reveals the file in Finder"/>
</Condition>
<Command id = "MonoDevelop.Ide.Commands.FileCommands.SetBuildAction"
type="radio|array"
_label = "Build action" />
<Command id = "MonoDevelop.Ide.Commands.FileCommands.ShowProperties"
- icon="gtk-properties"
+ icon="gtk-preferences"
_label = "_Properties" />
<Command id = "MonoDevelop.Ide.Commands.FileCommands.CopyToOutputDirectory"
type = "check"
@@ -520,10 +517,10 @@
<Command id = "MonoDevelop.Ide.Commands.FileTabCommands.CopyPathName"
defaultHandler = "MonoDevelop.Ide.Commands.CopyPathNameHandler"
_description = "Copy the file path to the clipboard"
- _label = "C_opy file path/name"/>
+ _label = "C_opy File Path"/>
<Command id = "MonoDevelop.Ide.Commands.FileTabCommands.ToggleMaximize"
defaultHandler = "MonoDevelop.Ide.Commands.ToggleMaximizeHandler"
- _label = "S_witch maximize/normal view"/>
+ _label = "S_witch Maximized/Normal View"/>
<Command id = "MonoDevelop.Ide.Commands.FileTabCommands.ReopenClosedTab"
defaultHandler = "MonoDevelop.Ide.Commands.ReopenClosedTabHandler"
_label = "Reopen Closed Tab"
@@ -634,17 +631,20 @@
_label = "_Normal Size"
icon = "gtk-zoom-100"
shortcut = "Control|0"
+ macShortcut = "Meta|0"
_description = "Resets zoom to default" />
<Command id = "MonoDevelop.Ide.Commands.ViewCommands.SideBySideMode"
defaultHandler = "MonoDevelop.Ide.Commands.SideBySideModeHandler"
_label = "2 Columns"
shortcut = "Control|Shift|2"
- macShortcut = "Alt|Meta|2"/>
+ macShortcut = "Alt|Meta|2"
+ icon = "md-columns-two" />
<Command id = "MonoDevelop.Ide.Commands.ViewCommands.SingleMode"
defaultHandler = "MonoDevelop.Ide.Commands.SingleModeHandler"
_label = "1 Column"
shortcut = "Control|Shift|1"
- macShortcut = "Alt|Meta|1"/>
+ macShortcut = "Alt|Meta|1"
+ icon = "md-columns-one" />
<Command id = "MonoDevelop.Ide.Commands.ViewCommands.NextNotebook"
defaultHandler = "MonoDevelop.Ide.Commands.NextNotebookHandler"
_label = "Move to Next Notebook"
@@ -671,9 +671,9 @@
<Command id = "MonoDevelop.Ide.Commands.ToolCommands.AddinManager"
defaultHandler = "MonoDevelop.Ide.Commands.AddinManagerHandler"
- icon = "md-updates"
+ icon = "gtk-plugin"
_description = "Manage add-ins"
- _label = "_Add-in Manager" />
+ _label = "_Add-ins..." />
<Command id = "MonoDevelop.Ide.Commands.ToolCommands.ToolList"
defaultHandler = "MonoDevelop.Ide.Commands.ToolListHandler"
type="array"
@@ -760,21 +760,21 @@
<Command id = "MonoDevelop.Ide.Commands.HelpCommands.TipOfTheDay"
defaultHandler = "MonoDevelop.Ide.Commands.TipOfTheDayHandler"
_label = "_Tip of the Day"
- icon = "gtk-dialog-info"
_description = "Show tip of the day" />
<Command id = "MonoDevelop.Ide.Commands.HelpCommands.OpenLogDirectory"
defaultHandler = "MonoDevelop.Ide.Commands.OpenLogDirectoryHandler"
_label = "Open Log Directory"
- icon = "gtk-dialog-info"
+ icon = "md-open-folder"
_description = "Opens the directory where the diagnostic logs are stored" />
<Command id = "MonoDevelop.Ide.Commands.HelpCommands.About"
defaultHandler = "MonoDevelop.Ide.Commands.AboutHandler"
_label = "_About"
- icon = "gtk-about"
+ icon = "md-about"
_description = "Show about dialog" />
<Command id = "MonoDevelop.Ide.Updater.UpdateCommands.CheckForUpdates"
defaultHandler = "MonoDevelop.Ide.Updater.CheckForUpdatesHandler"
_label = "_Check for Updates..."
+ icon = "md-updates"
_description = "Check for updates to MonoDevelop and packages it requires" />
<Command id = "MonoDevelop.Ide.Commands.HelpCommands.SendFeedback"
defaultHandler = "MonoDevelop.Ide.Commands.SendFeedbackHandler"
@@ -801,22 +801,24 @@
<Command id = "MonoDevelop.Ide.Commands.SearchCommands.FindNext"
_label = "Find _Next"
- icon = "md-find-next-icon"
+ icon = "md-find-next"
_description = "Search forwards for the same text"
shortcut = "Control|G"
macShortcut = "Meta|G" />
<Command id = "MonoDevelop.Ide.Commands.SearchCommands.FindPrevious"
_label = "Find _Previous"
+ icon = "md-find-prev"
_description = "Search backwards for the same text"
shortcut = "Control|Shift|G"
macShortcut = "Meta|Shift|G" />
<Command id = "MonoDevelop.Ide.Commands.SearchCommands.EmacsFindNext"
_label = "Find _Next (Emacs behavior)"
- icon = "md-find-next-icon"
+ icon = "md-find-next"
_description = "Search forwards for the same text with emacs behavior"/>
<Command id = "MonoDevelop.Ide.Commands.SearchCommands.EmacsFindPrevious"
_label = "Find _Previous (Emacs behavior)"
+ icon = "md-find-prev"
_description = "Search backwards for the same text with emacs behavior"/>
<Command id = "MonoDevelop.Ide.Commands.SearchCommands.FindNextSelection"
@@ -832,14 +834,12 @@
<Command id = "MonoDevelop.Ide.Commands.SearchCommands.FindInFiles"
defaultHandler = "MonoDevelop.Ide.FindInFiles.FindInFilesHandler"
_label = "F_ind in Files..."
- icon = "md-find-in-files"
shortcut = "Control|Shift|F"
macShortcut = "Meta|Shift|F"
_description = "Search for text in all files of a directory" />
<Command id = "MonoDevelop.Ide.Commands.SearchCommands.ReplaceInFiles"
defaultHandler = "MonoDevelop.Ide.FindInFiles.ReplaceInFilesHandler"
_label = "R_eplace in Files..."
- icon = "md-replace-in-files"
shortcut = "Control|Shift|H"
macShortcut = "Alt|Meta|Shift|F"
_description = "Search for and replace text in all files of a directory" />
@@ -855,41 +855,39 @@
_label = "Go to File..."
shortcut = "Alt|Shift|O"
macShortcut = "Meta|Shift|D"
- _description = "Jump to a file in the current workspace"
- icon = "gtk-open" />
+ _description = "Jump to a file in the current workspace" />
<Command id = "MonoDevelop.Components.MainToolbar.Commands.NavigateTo"
defaultHandler = "MonoDevelop.Components.MainToolbar.NavigateToHandler"
_label = "Navigate To..."
_description = "Jump to a item in the current workspace"
shortcut = "Control|,"
- macShortcut = "Meta|."
- icon = "gtk-open" />
+ macShortcut = "Meta|." />
<Command id = "MonoDevelop.Ide.Commands.SearchCommands.ToggleBookmark"
- icon = "md-toggle-bookmark"
+ icon = "md-bookmark-toggle"
shortcut = "Control|F2"
_description = "Toggle bookmark"
_label = "_Toggle Bookmark" />
<Command id = "MonoDevelop.Ide.Commands.SearchCommands.PrevBookmark"
- icon = "md-goto-prevbookmark"
+ icon = "md-bookmark-prev"
shortcut = "Shift|F2"
_description = "Go to previous bookmark"
_label = "Pre_vious Bookmark" />
<Command id = "MonoDevelop.Ide.Commands.SearchCommands.NextBookmark"
- icon = "md-goto-nextbookmark"
+ icon = "md-bookmark-next"
shortcut = "F2"
_description = "Go to next bookmark"
_label = "Ne_xt Bookmark" />
<Command id = "MonoDevelop.Ide.Commands.SearchCommands.ClearBookmarks"
- icon = "md-clear-all-bookmarks"
+ icon = "md-bookmark-clear-all"
_description = "Clear bookmarks"
_label = "_Clear Bookmarks" />
<Command id = "MonoDevelop.Ide.Commands.SearchCommands.GotoLineNumber"
_label = "_Go to Line..."
+ icon = "md-go-to-line"
_description = "Go to a specific line"
shortcut = "Control|I"
- macShortcut = "Meta|L"
- icon = "gtk-jump-to" />
+ macShortcut = "Meta|L" />
<Command id = "MonoDevelop.Ide.Commands.SearchCommands.UseSelectionForFind"
_label = "Use Selection for Find"
_description = "Uses the current selection as find string"/>
@@ -914,9 +912,9 @@
_description="Inserts a template or when something is selected surrounds selection with a template"
_label = "I_nsert Template..."/>
<Command id = "MonoDevelop.Ide.Commands.TextEditorCommands.LineEnd"
- _label = "Go to end of line" macShortcut = "End"/>
+ _label = "Go to end of line" macShortcut = "Meta+Right"/>
<Command id = "MonoDevelop.Ide.Commands.TextEditorCommands.LineStart"
- _label = "Go to beginning of line" macShortcut = "Home"/>
+ _label = "Go to beginning of line" macShortcut = "Meta+Left"/>
<Command id = "MonoDevelop.Ide.Commands.TextEditorCommands.DeleteLeftChar"
_label = "Delete left character" />
<Command id = "MonoDevelop.Ide.Commands.TextEditorCommands.DeleteRightChar"
@@ -970,6 +968,7 @@
shortcut = "Control|Shift|space" />
<Command id = "MonoDevelop.Ide.Commands.TextEditorCommands.GotoMatchingBrace"
_label = "Go to Matching _Brace"
+ icon = "md-go-to-matching-brace"
description = "Go to Matching Brace"
shortcut = "Control|B" />
<Command id = "MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMoveLeft"
@@ -1044,11 +1043,31 @@
_description = "Scrolls the editor so that the caret is centered"
macShortcut = "Control|L" />
<Command id = "MonoDevelop.Ide.Commands.TextEditorCommands.ToggleBlockSelectionMode"
- _label = "Toggle block selection mode"/>
+ _label = "Toggle Block Selection Mode"/>
<Command id = "MonoDevelop.Ide.Commands.TextEditorCommands.DuplicateLine"
_label = "Duplicate line"/>
+ <Command id = "MonoDevelop.Ide.Commands.TextEditorCommands.DynamicAbbrev"
+ defaultHandler = "MonoDevelop.Ide.Editor.DynamicAbbrevHandler"
+ _label = "Dynamic abbrev"
+ _description = "Cycles completing the current word from matching words in all open files"
+ macShortcut = "Ctrl|/"
+ shortcut = "Alt|/" />
+ <Command id = "MonoDevelop.Ide.Commands.TextEditorCommands.PulseCaret"
+ _label = "Find caret"
+ _description = "Animates the text editor caret to help find it"
+ shortcut = "Ctrl||"
+ macShortcut = "Meta||" />
+
+ <Command id = "MonoDevelop.Ide.Editor.MessageBubbleCommands.Toggle"
+ _label = "Toggle message bubble"
+ _description = "Toggles message bubble on/off"/>
+ <Command id = "MonoDevelop.Ide.Editor.MessageBubbleCommands.HideIssues"
+ defaultHandler = "MonoDevelop.Ide.Editor.HideIssuesHandler"
+ _label = "_Hide Issues"/>
+ <Command id = "MonoDevelop.Ide.Editor.MessageBubbleCommands.ToggleIssues"
+ defaultHandler = "MonoDevelop.Ide.Editor.ToggleIssuesHandler"
+ _label = "Toggle Issues"
+ type="array"/>
</Category>
-
</Extension>
-
</ExtensionModel>
diff --git a/main/src/core/MonoDevelop.Ide/ExtensionModel/DefaultPolicyPanels.addin.xml b/main/src/core/MonoDevelop.Ide/ExtensionModel/DefaultPolicyPanels.addin.xml
index 87421f4d48..6f1cfbf553 100644
--- a/main/src/core/MonoDevelop.Ide/ExtensionModel/DefaultPolicyPanels.addin.xml
+++ b/main/src/core/MonoDevelop.Ide/ExtensionModel/DefaultPolicyPanels.addin.xml
@@ -18,7 +18,7 @@
<Panel id = "NamespaceSynchronisationPanel" class = "MonoDevelop.Ide.Projects.OptionPanels.NamespaceSynchronisationPanel" />
</Section>
<Section id="CodeFormattingPolicies" _label="Code Formatting" fill="true" class="MonoDevelop.Ide.Projects.OptionPanels.CodeFormattingPanel" icon="md-prefs-code-formatting" />
- <Section id="DefaultStandardHeader" _label="Standard Header" fill="true" class="MonoDevelop.Ide.StandardHeader.StandardHeaderPolicyPanel" icon="md-prefs-standard-header" />
+ <Section id="DefaultStandardHeader" _label="Standard Header" fill="true" class="MonoDevelop.Ide.StandardHeader.StandardHeaderPolicyPanel" icon="md-prefs-header" />
</Section>
<Section id="VersionControl" _label="Version Control" />
</Extension>
diff --git a/main/src/core/MonoDevelop.Ide/ExtensionModel/GlobalOptionsDialog.addin.xml b/main/src/core/MonoDevelop.Ide/ExtensionModel/GlobalOptionsDialog.addin.xml
index b84b6ecaf3..1f6a88d7bf 100644
--- a/main/src/core/MonoDevelop.Ide/ExtensionModel/GlobalOptionsDialog.addin.xml
+++ b/main/src/core/MonoDevelop.Ide/ExtensionModel/GlobalOptionsDialog.addin.xml
@@ -7,10 +7,8 @@
<Extension path = "/MonoDevelop/Ide/GlobalOptionsDialog">
<Section id = "Preferences" _label = "Environment">
+ <Section id = "Style" _label = "Visual Style" fill="true" class = "MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanel" />
<Section id = "GeneralAuthorInfo" _label = "Author Information" fill="true" class = "MonoDevelop.Ide.Gui.OptionPanels.GlobalAuthorInformationPanel" icon="md-prefs-author-information" />
- <Section id = "Language" _label = "Language" class = "MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanel" icon="md-prefs-language">
- <!-- <Panel _label = "Welcome Page" class = "MonoDevelop.Ide.WelcomePage.WelcomePageOptionPanel" />-->
- </Section>
<Section id = "KeyBindings" _label = "Key Bindings" fill="true" class = "MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel" icon="md-prefs-key-bindings" />
<Section id = "Fonts" _label = "Fonts" fill="true" class = "MonoDevelop.Ide.Fonts.FontChooserPanel" icon = "md-prefs-fonts" />
<Section id = "Updates" _label = "Updates" class = "MonoDevelop.Ide.Gui.OptionPanels.AddInsOptionsPanel" icon="md-prefs-updates" />
@@ -38,7 +36,7 @@
<Panel id = "NamespaceSynchronisationPanel" class = "MonoDevelop.Ide.Projects.OptionPanels.NamespaceSynchronisationPanel" />
</Section>
<Section id="CodeFormattingPolicies" _label="Code Formatting" fill="true" class="MonoDevelop.Ide.Projects.OptionPanels.CodeFormattingPanel" icon="md-prefs-code-formatting" />
- <Section id="DefaultStandardHeader" _label="Standard Header" fill="true" class="MonoDevelop.Ide.StandardHeader.StandardHeaderPolicyPanel" icon="md-prefs-standard-header" />
+ <Section id="DefaultStandardHeader" _label="Standard Header" fill="true" class="MonoDevelop.Ide.StandardHeader.StandardHeaderPolicyPanel" icon="md-prefs-header" />
</Section>
<Section id = "VersionControl" _label = "Version Control" />
diff --git a/main/src/core/MonoDevelop.Ide/ExtensionModel/ItemOptionPanels.addin.xml b/main/src/core/MonoDevelop.Ide/ExtensionModel/ItemOptionPanels.addin.xml
index b2ef35477c..79e05c3eb6 100644
--- a/main/src/core/MonoDevelop.Ide/ExtensionModel/ItemOptionPanels.addin.xml
+++ b/main/src/core/MonoDevelop.Ide/ExtensionModel/ItemOptionPanels.addin.xml
@@ -6,8 +6,11 @@
<ConditionType id="ItemType" type="MonoDevelop.Projects.Extensions.ItemTypeCondition">
<Description>Type of the item. If no namespace is provided, MonoDevelop.Projects is assumed.</Description>
</ConditionType>
- <ConditionType id="ActiveLanguage" type="MonoDevelop.Projects.Extensions.ProjectLanguageCondition">
- <Description>Language of the project. It will evaluate to false if the project is not a .NET project.</Description>
+ <ConditionType id="FlavorType" type="MonoDevelop.Projects.Extensions.FlavorTypeCondition">
+ <Description>Type of a flavor that a project must have. If no namespace is provided, MonoDevelop.Projects is assumed.</Description>
+ </ConditionType>
+ <ConditionType id="ProjectTypeId" type="MonoDevelop.Projects.Extensions.ProjectTypeIdCondition">
+ <Description>The id can be a project type guid or a flavor guid, or the corresponding type alias</Description>
</ConditionType>
<ConditionType id="SupportsTarget" type="MonoDevelop.Projects.Extensions.SupportsTargetCondition">
<Description>MSBuild Target that a project must have.</Description>
@@ -38,11 +41,11 @@
</Section>
<Section id="Build" _label="Build">
<Section id="General" _label="General" icon="md-prefs-build">
- <Condition id="ItemType" value="DotNetAssemblyProject">
+ <Condition id="ItemType" value="DotNetProject">
<Panel id = "RuntimeOptionsPanel" _label = "Runtime Options" class = "MonoDevelop.Ide.Projects.OptionPanels.RuntimeOptionsPanel"/>
</Condition>
- <Condition id="ItemType" value="PortableDotNetProject">
- <Panel id = "PortableRuntimeOptionsPanel" _label = "Runtime Options" class = "MonoDevelop.Ide.Projects.OptionPanels.PortableRuntimeOptionsPanel"/>
+ <Condition id="FlavorType" value="PortableDotNetProjectFlavor">
+ <Panel id = "PortableRuntimeOptionsPanel" replaces="RuntimeOptionsPanel" _label = "Runtime Options" class = "MonoDevelop.Ide.Projects.OptionPanels.PortableRuntimeOptionsPanel"/>
</Condition>
<Condition id="ItemType" value="Solution">
<Panel id = "SolutionGeneral" _label = "Build" class = "MonoDevelop.Ide.Projects.OptionPanels.CombineBuildOptions"/>
@@ -51,7 +54,7 @@
<Panel id = "MSBuildOptionsPanel" _label = "Build" class = "MonoDevelop.Ide.Projects.OptionPanels.CombineMSBuildOptions"/>
</Condition>
</Section>
- <Condition id="ItemType" value="SolutionEntityItem">
+ <Condition id="ItemType" value="SolutionItem">
<Section id = "CustomCommands" _label = "Custom Commands" fill = "true" class = "MonoDevelop.Ide.Projects.OptionPanels.BuildCustomCommandPanel" icon = "md-prefs-generic" />
</Condition>
<Condition id="ItemType" value="Project">
@@ -83,7 +86,7 @@
<Condition id="ItemType" value="Solution">
<Section id = "StartupOptionsPanel" _label = "Startup Project" fill = "true" class = "MonoDevelop.Ide.Projects.OptionPanels.StartupOptionsPanel"/>
</Condition>
- <Condition id="ItemType" value="SolutionEntityItem">
+ <Condition id="ItemType" value="SolutionItem">
<Section id = "CustomCommands" _label = "Custom Commands" fill = "true" class = "MonoDevelop.Ide.Projects.OptionPanels.ExecutionCustomCommandPanel" />
</Condition>
</Section>
@@ -92,17 +95,17 @@
<Condition id="ItemType" value="Solution">
<Panel id = "NamespaceSynchronisationPanel" class = "MonoDevelop.Ide.Projects.OptionPanels.NamespaceSynchronisationPanel" />
</Condition>
- <Condition id="ItemType" value="SolutionItem">
+ <Condition id="ItemType" value="SolutionFolderItem">
<Panel id = "NamespaceSynchronisationPanel" class = "MonoDevelop.Ide.Projects.OptionPanels.NamespaceSynchronisationPanel" />
</Condition>
</Section>
<Condition id="ItemType" value="Solution">
<Section id="CodeFormattingPolicies" _label="Code Formatting" fill="true" class="MonoDevelop.Ide.Projects.OptionPanels.CodeFormattingPanel" icon="md-prefs-code-formatting" />
- <Section id="DefaultStandardHeader" _label="Standard Header" fill="true" class= "MonoDevelop.Ide.StandardHeader.StandardHeaderPolicyPanel" icon="md-prefs-standard-header" />
+ <Section id="DefaultStandardHeader" _label="Standard Header" fill="true" class= "MonoDevelop.Ide.StandardHeader.StandardHeaderPolicyPanel" icon="md-prefs-header" />
</Condition>
- <Condition id="ItemType" value="SolutionItem">
+ <Condition id="ItemType" value="SolutionFolderItem">
<Section id="CodeFormattingPolicies" _label="Code Formatting" fill="true" class="MonoDevelop.Ide.Projects.OptionPanels.CodeFormattingPanel" icon="md-prefs-code-formatting" />
- <Section id="DefaultStandardHeader" _label="Standard Header" fill="true" class="MonoDevelop.Ide.StandardHeader.StandardHeaderPolicyPanel" icon="md-prefs-standard-header" />
+ <Section id="DefaultStandardHeader" _label="Standard Header" fill="true" class="MonoDevelop.Ide.StandardHeader.StandardHeaderPolicyPanel" icon="md-prefs-header" />
</Condition>
</Section>
</Extension>
diff --git a/main/src/core/MonoDevelop.Ide/ExtensionModel/MainMenu.addin.xml b/main/src/core/MonoDevelop.Ide/ExtensionModel/MainMenu.addin.xml
index 28e93193d0..9383f6237a 100644
--- a/main/src/core/MonoDevelop.Ide/ExtensionModel/MainMenu.addin.xml
+++ b/main/src/core/MonoDevelop.Ide/ExtensionModel/MainMenu.addin.xml
@@ -71,7 +71,6 @@
<ItemSet id = "Format" _label = "_Format">
<CommandItem id = "MonoDevelop.Ide.CodeFormatting.CodeFormattingCommands.FormatBuffer" />
- <CommandItem id = "MonoDevelop.Ide.CodeFormatting.CodeFormattingCommands.FormatSelection" />
<SeparatorItem id ="FormatSeparator" />
<CommandItem id = "MonoDevelop.Ide.Commands.EditCommands.UppercaseSelection" />
<CommandItem id = "MonoDevelop.Ide.Commands.EditCommands.LowercaseSelection" />
@@ -97,7 +96,6 @@
<CommandItem id = "MonoDevelop.Ide.Commands.TextEditorCommands.ShowParameterCompletionWindow" />
<CommandItem id = "MonoDevelop.Ide.Commands.TextEditorCommands.ShowCodeTemplateWindow" />
<SeparatorItem id = "Separator5" />
- <CommandItem id = "MonoDevelop.Ide.Commands.EditCommands.WordCount" />
<CommandItem id = "MonoDevelop.Ide.Commands.EditCommands.InsertStandardHeader" />
<SeparatorItem id = "Separator6" />
<CommandItem id = "MonoDevelop.Ide.Commands.TextEditorCommands.ToggleBlockSelectionMode" />
@@ -115,6 +113,12 @@
<CommandItem id = "MonoDevelop.Ide.Commands.ViewCommands.DeleteCurrentLayout" />
<SeparatorItem id = "ViewSeparator2" />
<CommandItem id = "MonoDevelop.Ide.Commands.ViewCommands.ViewList" />
+ <ItemSet id = "MessageBubbles" _label = "_Message Bubbles">
+ <CommandItem id = "MonoDevelop.Ide.Editor.MessageBubbleCommands.Toggle" />
+ <CommandItem id = "MonoDevelop.Ide.Editor.MessageBubbleCommands.HideIssues" />
+ <SeparatorItem id = "Separator1" />
+ <CommandItem id = "MonoDevelop.Ide.Editor.MessageBubbleCommands.ToggleIssues" />
+ </ItemSet>
<SeparatorItem id = "ViewSeparator3" />
<SeparatorItem id = "ViewItemsSeparator" />
<CommandItem id = "MonoDevelop.Ide.Commands.ViewCommands.ZoomIn" />
@@ -128,6 +132,7 @@
<CommandItem id = "MonoDevelop.Ide.Commands.ViewCommands.FocusCurrentDocument" />
<CommandItem id = "MonoDevelop.Ide.Commands.ViewCommands.ShowWelcomePage" />
<CommandItem id = "MonoDevelop.Ide.Commands.ViewCommands.FullScreen" />
+
</ItemSet>
<ItemSet id = "Search" _label = "_Search">
diff --git a/main/src/core/MonoDevelop.Ide/ExtensionModel/MimeTypes.addin.xml b/main/src/core/MonoDevelop.Ide/ExtensionModel/MimeTypes.addin.xml
index b27e0cb69b..4e4ead5842 100644
--- a/main/src/core/MonoDevelop.Ide/ExtensionModel/MimeTypes.addin.xml
+++ b/main/src/core/MonoDevelop.Ide/ExtensionModel/MimeTypes.addin.xml
@@ -19,12 +19,21 @@
<MimeType id="application/xml" _description="XML document" icon="md-xml-file-icon" isText="true">
<File pattern="*.xml" />
</MimeType>
+ <MimeType id="application/png" _description="PNG resource" icon="md-file-image">
+ <File pattern="*.png" />
+ </MimeType>
+ <MimeType id="text/css" _description="CSS document" icon="md-file-css" isText="true">
+ <File pattern="*.css" />
+ </MimeType>
<MimeType id="application/config+xml" _description="Configuration File" baseType="application/xml">
<File pattern="*.config" />
</MimeType>
<MimeType id="application/glade+xml" _description="Glade File" baseType="application/xml">
<File pattern="*.glade" />
</MimeType>
+ <MimeType id="application/manifest+xml" _description="Manifest File" baseType="application/xml">
+ <File pattern="*.manifest" />
+ </MimeType>
<MimeType id="text/x-changelog" _description="ChangeLog document" isText="true">
<File pattern="ChangeLog|Changelog|CHANGELOG|Changelog"/>
</MimeType>
diff --git a/main/src/core/MonoDevelop.Ide/ExtensionModel/MonoDevelop.Ide.addin.xml b/main/src/core/MonoDevelop.Ide/ExtensionModel/MonoDevelop.Ide.addin.xml
index 171a70a939..c657d97264 100644
--- a/main/src/core/MonoDevelop.Ide/ExtensionModel/MonoDevelop.Ide.addin.xml
+++ b/main/src/core/MonoDevelop.Ide/ExtensionModel/MonoDevelop.Ide.addin.xml
@@ -75,7 +75,7 @@
<ExtensionNode name="FileFilter" type="MonoDevelop.Ide.Codons.FileFilterCodon"/>
</ExtensionPoint>
- <ExtensionPoint path = "/MonoDevelop/Ide/TextEditorExtensions" name = "Text editor extensions">
+ <ExtensionPoint path = "/MonoDevelop/Ide/TextEditorExtensions" name = "Text editor extensions" defaultInsertAfter = "MidStep">
<Description>Extensions to the text editor. Classes must be a subclass of TextEditorExtension.</Description>
<ExtensionNode name="Class" type="MonoDevelop.Ide.Extensions.TextEditorExtensionNode"/>
</ExtensionPoint>
@@ -151,15 +151,53 @@
<ExtensionNode name="Parser" type="MonoDevelop.Ide.Extensions.MimeTypeExtensionNode"/>
</ExtensionPoint>
- <ExtensionPoint path = "/MonoDevelop/TypeSystem/Ambiences" name = "Language ambiences">
+ <ExtensionPoint path = "/MonoDevelop/TypeSystem/AmbienceTooltipProviders" name = "Language ambiences">
<Description>Language ambiences. Specified classes must implement IAmbience.</Description>
- <ExtensionNode name="Ambience" type="MonoDevelop.Ide.Extensions.MimeTypeExtensionNode" />
+ <ExtensionNode name="Provider" type="MonoDevelop.Ide.Extensions.MimeTypeExtensionNode" />
</ExtensionPoint>
<ExtensionPoint path = "/MonoDevelop/TypeSystem/CodeGenerators">
<ExtensionNode name="Generator" type="MonoDevelop.Ide.Extensions.MimeTypeExtensionNode"/>
</ExtensionPoint>
+ <ExtensionPoint path = "/MonoDevelop/SourceEditor2/SyntaxModes" name = "Text editor syntax modes">
+ <Description>Syntax modes</Description>
+ <ExtensionNode name="Templates" type="MonoDevelop.Ide.Editor.Highlighting.TemplateCodon"/>
+ </ExtensionPoint>
+
+ <ExtensionPoint path = "/MonoDevelop/SourceEditor2/Styles" name = "Text editor styles">
+ <Description>Styles</Description>
+ <ExtensionNode name="Templates" type="MonoDevelop.Ide.Editor.Highlighting.TemplateCodon"/>
+ </ExtensionPoint>
+
+ <ExtensionPoint path = "/MonoDevelop/SourceEditor2/CustomModes" name = "Text editor custom syntax modes">
+ <Description>Styles</Description>
+ <ExtensionNode name="SyntaxMode" type="MonoDevelop.Ide.Editor.Highlighting.SyntaxModeCodon"/>
+ </ExtensionPoint>
+
+ <ExtensionPoint path = "/MonoDevelop/SourceEditor2/EditorFactory" name = "Editor factories">
+ <Description>Allows providing a platform-specific implementation for the text editor</Description>
+ <ExtensionNode name="Class" />
+ </ExtensionPoint>
+
+ <ExtensionPoint path = "/MonoDevelop/SourceEditor2/TooltipProviders" name = "Tooltip providers">
+ <Description>Tooltip providers. Classes must implement ITooltipProvider.</Description>
+ <ExtensionNode name="Class" type="MonoDevelop.Ide.Editor.TooltipExtensionNode" />
+ <ConditionType id="FileType" type="MonoDevelop.Ide.Extensions.FileTypeCondition">
+ <Description>Type of the file being edited.</Description>
+ </ConditionType>
+ </ExtensionPoint>
+
+ <ExtensionPoint path = "/MonoDevelop/Ide/BraceMatcher" name = "Brace matcher">
+ <Description>Algorithm for providing matching braces in a file.</Description>
+ <ExtensionNode name="Class"/>
+ </ExtensionPoint>
+
+ <ExtensionPoint path = "/MonoDevelop/Ide/AutoInsertBracketHandler" name = "Automatic bracket handler">
+ <Description>Algorithm for providing automatic bracket insertion.</Description>
+ <ExtensionNode name="Class"/>
+ </ExtensionPoint>
+
<!-- Extensions -->
<Extension path = "/MonoDevelop/Core/Applications">
@@ -175,6 +213,8 @@
<Extension path = "/MonoDevelop/Ide/DisplayBindings">
<DisplayBinding id = "DefaultDisplayBinding"
class = "MonoDevelop.Ide.Gui.DefaultDisplayBinding"/>
+ <DisplayBinding id = "TextEditor"
+ class = "MonoDevelop.Ide.Editor.TextEditorDisplayBinding" />
</Extension>
<Extension path = "/MonoDevelop/Ide/StartupHandlers">
@@ -224,9 +264,14 @@
</Extension>
<Extension path = "/MonoDevelop/Ide/TextEditorExtensions">
- <Class id="InitialStep" class = "MonoDevelop.Ide.Gui.Content.TextEditorExtensionMarker" />
- <Class id="MidStep" class = "MonoDevelop.Ide.Gui.Content.TextEditorExtensionMarker" />
- <Class id="FinalStep" class = "MonoDevelop.Ide.Gui.Content.TextEditorExtensionMarker" />
+ <Class id="InitialStep" class = "MonoDevelop.Ide.Editor.Extension.TextEditorExtensionMarker" />
+ <Class id="MidStep" class = "MonoDevelop.Ide.Editor.Extension.TextEditorExtensionMarker" />
+ <Class class = "MonoDevelop.Ide.Editor.Extension.BraceMatcherTextEditorExtension" />
+ <Class class = "MonoDevelop.Ide.Editor.Extension.DefaultCommandTextEditorExtension" />
+ <Class class = "MonoDevelop.Ide.Editor.Extension.FoldingTextEditorExtension" />
+ <Class class = "MonoDevelop.Ide.Editor.Extension.ErrorHandlerTextEditorExtension" />
+ <Class class = "MonoDevelop.Ide.Editor.Extension.AutoInsertBracketTextEditorExtension" />
+ <Class id="FinalStep" class = "MonoDevelop.Ide.Editor.Extension.TextEditorExtensionMarker" />
</Extension>
<Extension path = "/MonoDevelop/Ide/ContextMenu/DocumentTab">
@@ -293,10 +338,5 @@
<Extension path = "/MonoDevelop/Ide/CompletionCharacters">
<Complete id="Other" language="Other" commitOnSpace="True" commitChars="{}[]().,:;+-*/%&amp;|^!~=&lt;&gt;?@#'&quot;\"/>
</Extension>
-
- <Extension path = "/MonoDevelop/ProjectModel/ExtendedProperties">
- <ItemProperty class = "MonoDevelop.Projects.DotNetProjectConfiguration"
- name = "RunCodeAnalysis" type = "System.Boolean" defaultValue="false" />
- </Extension>
</ExtensionModel>
diff --git a/main/src/core/MonoDevelop.Ide/ExtensionModel/Pads.addin.xml b/main/src/core/MonoDevelop.Ide/ExtensionModel/Pads.addin.xml
index f03351a835..294d0dd946 100644
--- a/main/src/core/MonoDevelop.Ide/ExtensionModel/Pads.addin.xml
+++ b/main/src/core/MonoDevelop.Ide/ExtensionModel/Pads.addin.xml
@@ -40,10 +40,10 @@
<Pad id = "MonoDevelop.Ide.Gui.Pads.HelpTree"
defaultPlacement = "Left"
_label = "Help"
- icon="gtk-help"
+ icon="md-help-pad"
class = "MonoDevelop.Ide.Gui.Pads.HelpTree"/>
- <SolutionPad id = "ProjectPad" _label = "Solution" icon = "md-solution" class = "MonoDevelop.Ide.Gui.Pads.ProjectPad.ProjectSolutionPad" defaultLayout="*" defaultPlacement = "Left">
+ <SolutionPad id = "ProjectPad" _label = "Solution" icon = "md-solution-pad" class = "MonoDevelop.Ide.Gui.Pads.ProjectPad.ProjectSolutionPad" defaultLayout="*" defaultPlacement = "Left">
<ContextMenu path="/MonoDevelop/Ide/ContextMenu/ProjectPad" />
<PadOption id = "ShowAllFiles" _label = "Show All Files" defaultValue = "False" />
<NodeBuilder class = "MonoDevelop.Ide.Gui.Pads.ProjectPad.WorkspaceNodeBuilder"/>
@@ -63,7 +63,7 @@
<NodeBuilder class = "MonoDevelop.Ide.Gui.Pads.ProjectPad.ImplicitFrameworkAssemblyReferenceNodeBuilder"/>
</SolutionPad>
- <SolutionPad id = "ClassPad" _label = "Classes" icon = "md-class" class = "MonoDevelop.Ide.Gui.Pads.ClassBrowser.ClassBrowserPad" defaultPlacement = "Left" defaultStatus="AutoHide">
+ <SolutionPad id = "ClassPad" _label = "Classes" icon = "md-classes-pad" class = "MonoDevelop.Ide.Gui.Pads.ClassBrowser.ClassBrowserPad" defaultPlacement = "Left" defaultStatus="AutoHide">
<PadOption id = "NestedNamespaces" _label = "Nested namespaces" defaultValue = "True" />
<PadOption id = "ShowProjects" _label = "Show project structure" defaultValue = "True" />
<PadOption id = "GroupByAccess" _label = "Group members by access" defaultValue = "False" />
diff --git a/main/src/core/MonoDevelop.Ide/ExtensionModel/StockIcons.addin.xml b/main/src/core/MonoDevelop.Ide/ExtensionModel/StockIcons.addin.xml
index 854507c358..d8ef0cd808 100644
--- a/main/src/core/MonoDevelop.Ide/ExtensionModel/StockIcons.addin.xml
+++ b/main/src/core/MonoDevelop.Ide/ExtensionModel/StockIcons.addin.xml
@@ -7,80 +7,92 @@
<Extension path="/MonoDevelop/Core/StockIcons">
<Condition id="Platform" value="!windows">
- <StockIcon stockid="md-closed-folder" resource="folder-generic-mac-16.png" size="Menu" />
- <StockIcon stockid="md-closed-reference-folder" resource="folder-special-mac-16.png" size="Menu" />
- <StockIcon stockid="md-closed-resource-folder" resource="folder-special-mac-16.png" size="Menu" />
- <StockIcon stockid="md-solution-folder-closed" resource="folder-special-mac-16.png" size="Menu" />
- <StockIcon stockid="md-component-folder-closed" resource="folder-special-mac-16.png" size="Menu" />
-
- <StockIcon stockid="md-open-folder" resource="folder-generic-mac-16.png" size="Menu" />
- <StockIcon stockid="md-open-reference-folder" resource="folder-special-mac-16.png" size="Menu" />
- <StockIcon stockid="md-open-resource-folder" resource="folder-special-mac-16.png" size="Menu" />
- <StockIcon stockid="md-solution-folder-open" resource="folder-special-mac-16.png" size="Menu" />
- <StockIcon stockid="md-component-folder-open" resource="folder-special-mac-16.png" size="Menu" />
+ <StockIcon stockid="md-searchbox-search" resource="searchbox-search-mac-16.png" size="Menu" />
+ <StockIcon stockid="md-searchbox-clear" resource="searchbox-clear-mac-16.png" size="Menu" />
</Condition>
-
+
<Condition id="Platform" value="windows">
- <StockIcon stockid="md-closed-folder" resource="folder-generic-win-16.png" size="Menu" />
- <StockIcon stockid="md-closed-reference-folder" resource="folder-special-win-16.png" size="Menu" />
- <StockIcon stockid="md-closed-resource-folder" resource="folder-special-win-16.png" size="Menu" />
- <StockIcon stockid="md-solution-folder-closed" resource="folder-special-win-16.png" size="Menu" />
- <StockIcon stockid="md-component-folder-closed" resource="folder-special-win-16.png" size="Menu" />
-
- <StockIcon stockid="md-open-folder" resource="folder-generic-win-16.png" size="Menu" />
- <StockIcon stockid="md-open-reference-folder" resource="folder-special-win-16.png" size="Menu" />
- <StockIcon stockid="md-open-resource-folder" resource="folder-special-win-16.png" size="Menu" />
- <StockIcon stockid="md-solution-folder-open" resource="folder-special-win-16.png" size="Menu" />
- <StockIcon stockid="md-component-folder-open" resource="folder-special-win-16.png" size="Menu" />
+ <StockIcon stockid="md-searchbox-search" resource="searchbox-search-win-24.png" size="Menu" />
+ <StockIcon stockid="md-searchbox-clear" resource="searchbox-clear-win-24.png" size="Menu" />
</Condition>
- <!-- GTK icons redefined -->
+ <!-- GTK icons redefined -->
+ <StockIcon stockid="gtk-about" resource="about-md-16.png" size="Menu" />
<StockIcon stockid="gtk-add" resource="add-16.png" size="Menu" />
<StockIcon stockid="gtk-apply" resource="done-16.png" size="Menu" />
- <StockIcon stockid="gtk-cancel" resource="remove-16.png" size="Menu" />
+ <StockIcon stockid="gtk-cancel" resource="error-16.png" size="Menu" />
<StockIcon stockid="gtk-clear" resource="clear-16.png" size="Menu" />
<StockIcon stockid="gtk-close" resource="remove-16.png" size="Menu" />
<StockIcon stockid="gtk-copy" resource="copy-16.png" size="Menu" />
+ <StockIcon stockid="gtk-cut" resource="cut-16.png" size="Menu" />
<StockIcon stockid="gtk-delete" resource="remove-16.png" size="Menu" />
<StockIcon stockid="gtk-edit" resource="edit-16.png" size="Menu" />
+ <StockIcon stockid="gtk-execute" resource="execute-16.png" size="Menu" />
<StockIcon stockid="gtk-find" resource="find-16.png" size="Menu" />
<StockIcon stockid="gtk-find-and-replace" resource="find-and-replace-16.png" size="Menu" />
+ <StockIcon stockid="gtk-fullscreen" resource="fullscreen-16.png" size="Menu" />
<StockIcon stockid="gtk-go-back" resource="go-back-16.png" size="Menu" />
<StockIcon stockid="gtk-go-down" resource="go-down-16.png" size="Menu" />
<StockIcon stockid="gtk-go-forward" resource="go-forward-16.png" size="Menu" />
<StockIcon stockid="gtk-go-up" resource="go-up-16.png" size="Menu" />
+ <StockIcon stockid="gtk-help" resource="help-16.png" size="Menu" />
<StockIcon stockid="gtk-home" resource="home-16.png" size="Menu" />
+ <StockIcon stockid="gtk-indent" resource="indent-16.png" size="Menu" />
<StockIcon stockid="gtk-jump-to" resource="jump-to-16.png" size="Menu" />
- <StockIcon stockid="gtk-media-play" resource="media-play-16.png" size="Menu" />
+ <StockIcon stockid="gtk-info" resource="information-16.png" size="Menu" />
<StockIcon stockid="gtk-missing-image" resource="missing-image-16.png" size="Menu" />
+ <StockIcon stockid="gtk-missing-image" resource="missing-image-32.png" size="Dnd" />
+ <StockIcon stockid="gtk-missing-image" resource="missing-image-48.png" size="Dialog" />
<StockIcon stockid="gtk-new" resource="add-16.png" size="Menu" />
<StockIcon stockid="gtk-ok" resource="done-16.png" size="Menu" />
<StockIcon stockid="gtk-open" resource="open-16.png" size="Menu" />
- <StockIcon stockid="gtk-properties" resource="properties-16.png" size="Menu" />
+ <StockIcon stockid="gtk-paste" resource="paste-16.png" size="Menu" />
+ <StockIcon stockid="gtk-plugin" resource="plugin-menu-16.png" size="Menu" />
+ <StockIcon stockid="gtk-preferences" resource="preferences-16.png" size="Menu" />
+ <StockIcon stockid="gtk-print" resource="print-16.png" size="Menu" />
+ <StockIcon stockid="gtk-redo" resource="redo-16.png" size="Menu" />
<StockIcon stockid="gtk-refresh" resource="refresh-16.png" size="Menu" />
<StockIcon stockid="gtk-remove" resource="remove-16.png" size="Menu" />
+ <StockIcon stockid="gtk-revert-to-saved" resource="revert-16.png" size="Menu" />
<StockIcon stockid="gtk-save" resource="save-16.png" size="Menu" />
+ <StockIcon stockid="gtk-save-as" resource="save-16.png" size="Menu" />
<StockIcon stockid="gtk-stop" resource="stop-16.png" size="Menu" />
<StockIcon stockid="gtk-undo" resource="undo-16.png" size="Menu" />
+ <StockIcon stockid="gtk-unindent" resource="unindent-16.png" size="Menu" />
+ <StockIcon stockid="gtk-zoom-100" resource="zoom-actual-16.png" size="Menu" />
<StockIcon stockid="gtk-zoom-in" resource="zoom-in-16.png" size="Menu" />
<StockIcon stockid="gtk-zoom-out" resource="zoom-out-16.png" size="Menu" />
- <!-- MD icons -->
+ <!-- MD icons -->
+ <StockIcon stockid="md-about" resource="about-md-16.png" size="Menu" />
<StockIcon stockid="md-add" resource="add-16.png" size="Menu" />
- <StockIcon stockid="md-assembly-project" resource="assembly-project-16.png" size="Menu" />
- <StockIcon stockid="md-breadcrumb-next" resource="breadcrumb-next-normal-16.png" size="Menu" />
- <StockIcon stockid="md-breadcrumb-prev" resource="breadcrumb-previous-normal-16.png" size="Menu" />
+ <StockIcon stockid="md-add-namespace" resource="new-namespace-16.png" />
+ <StockIcon stockid="md-assembly-project" resource="project-assembly-16.png" size="Menu" />
+ <StockIcon stockid="md-bookmark-clear-all" resource="bookmark-clear-all-16.png" size="Menu" />
+ <StockIcon stockid="md-bookmark-next" resource="bookmark-next-16.png" size="Menu" />
+ <StockIcon stockid="md-bookmark-prev" resource="bookmark-prev-16.png" size="Menu" />
+ <StockIcon stockid="md-bookmark-toggle" resource="bookmark-toggle-16.png" size="Menu" />
+ <StockIcon stockid="md-breadcrumb-next" resource="breadcrumb-next-16.png" size="Menu" />
+ <StockIcon stockid="md-breadcrumb-prev" resource="breadcrumb-prev-16.png" size="Menu" />
<StockIcon stockid="md-breakpoint" resource="breakpoint-16.png" size="Menu" />
<StockIcon stockid="md-breakpoint-disable-all" resource="breakpoint-disable-all-16.png" size="Menu" />
<StockIcon stockid="md-breakpoint-disabled" resource="breakpoint-disabled-16.png" size="Menu" />
<StockIcon stockid="md-breakpoint-invalid" resource="breakpoint-invalid-16.png" size="Menu" />
<StockIcon stockid="md-breakpoint-new" resource="breakpoint-new-16.png" size="Menu" />
<StockIcon stockid="md-breakpoint-on-off" resource="breakpoint-on-off-16.png" size="Menu" />
+ <StockIcon stockid="md-bug" resource="bug-16.png" size="Menu" />
<StockIcon stockid="md-catchpoint" resource="catchpoint-16.png" size="Menu" />
+ <StockIcon stockid="md-catchpoint-new" resource="catchpoint-new-16.png" size="Menu" />
<StockIcon stockid="md-catchpoint-disabled" resource="catchpoint-disabled-16.png" size="Menu" />
<StockIcon stockid="md-class" resource="element-class-16.png" size="Menu" />
+ <StockIcon stockid="md-classes-pad" resource="pad-classes-16.png" size="Menu" />
+ <StockIcon stockid="md-class-file" resource="file-class-16.png" size="Menu" />
<StockIcon stockid="md-class-file" resource="file-class-32.png" size="Dnd" />
<StockIcon stockid="md-clear" resource="clear-16.png" size="Menu" />
+ <StockIcon stockid="md-close-all-documents" resource="close-all-documents-16.png" size="Menu" />
+ <StockIcon stockid="md-close-combine-icon" resource="close-solution-16.png" size="Menu" />
+ <StockIcon stockid="md-columns-one" resource="columns-one-16.png" size="Menu" />
+ <StockIcon stockid="md-columns-two" resource="columns-two-16.png" size="Menu" />
<StockIcon stockid="md-command" resource="command-16.png" size="Menu" />
<StockIcon stockid="md-comment" resource="comment-16.png" size="Menu" />
<StockIcon stockid="md-console" resource="pad-application-output-16.png" size="Menu" />
@@ -89,54 +101,88 @@
<StockIcon stockid="md-disclose-arrow-down" resource="disclose-arrow-down-16.png" size="Menu" />
<StockIcon stockid="md-disclose-arrow-up" resource="disclose-arrow-up-16.png" size="Menu" />
<StockIcon stockid="md-done" resource="done-16.png" size="Menu" />
+ <StockIcon stockid="md-empty" resource="empty-16.png" size="Menu" />
<StockIcon stockid="md-empty-file-icon" resource="file-generic-16.png" size="Menu" />
- <StockIcon stockid="md-enum" resource="element-enumeration-16.png" size="Menu" />
- <StockIcon stockid="md-enum-file" resource="file-enumeration-32.png" size="Dnd" />
+ <StockIcon stockid="md-enum" resource="element-enum-16.png" size="Menu" />
+ <StockIcon stockid="md-enum-file" resource="file-enum-16.png" size="Menu" />
+ <StockIcon stockid="md-enum-file" resource="file-enum-32.png" size="Dnd" />
<StockIcon stockid="md-errors-list" resource="pad-error-list-16.png" size="Menu" />
<StockIcon stockid="md-errors-list-has-errors" resource="pad-error-list-errors-16.png" size="Menu" />
<StockIcon stockid="md-errors-list-has-warnings" resource="pad-error-list-warnings-16.png" size="Menu" />
<StockIcon stockid="md-event" resource="element-event-16.png" size="Menu" />
<StockIcon stockid="md-exception" resource="element-exception-16.png" size="Menu" />
+ <StockIcon stockid="md-execute-all" resource="execute-all-16.png" size="Menu" />
<StockIcon stockid="md-extensionmethod" resource="element-extensionmethod-16.png" size="Menu" />
<StockIcon stockid="md-feedback" resource="feedback-16.png" size="Menu" />
<StockIcon stockid="md-field" resource="element-field-16.png" size="Menu" />
+ <StockIcon stockid="md-file-css" resource="file-css-16.png" size="Menu" />
+ <StockIcon stockid="md-file-css" resource="file-css-32.png" size="Dnd" />
<StockIcon stockid="md-file-header" resource="file-header-16.png" size="Menu" />
<StockIcon stockid="md-file-header" resource="file-header-32.png" size="Dnd" />
+ <StockIcon stockid="md-file-image" resource="file-image-16.png" size="Menu" />
+ <StockIcon stockid="md-file-image" resource="file-image-32.png" size="Dnd" />
+ <StockIcon stockid="md-file-information" resource="file-information-16.png" size="Menu" />
+ <StockIcon stockid="md-file-information" resource="file-information-32.png" size="Dnd" />
<StockIcon stockid="md-file-source" resource="file-source-16.png" size="Menu" />
<StockIcon stockid="md-file-source" resource="file-source-32.png" size="Dnd" />
+ <StockIcon stockid="md-file-unit-test" resource="file-unit-test-16.png" size="Menu" />
<StockIcon stockid="md-file-unit-test" resource="file-unit-test-32.png" size="Dnd" />
- <StockIcon stockid="md-folder-overlay" resource="assembly-reference-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-find-next" resource="find-next-16.png" size="Menu" />
+ <StockIcon stockid="md-find-prev" resource="find-prev-16.png" size="Menu" />
+ <StockIcon stockid="md-folder-assets" resource="folder-assets-16.png" size="Menu" />
+ <StockIcon stockid="md-reference-assembly" resource="reference-assembly-16.png" size="Menu" />
+ <StockIcon stockid="md-reference-folder" resource="reference-assembly-16.png" size="Menu" />
<StockIcon stockid="md-fs-field" resource="element-fs-field-16.png" size="Menu" />
- <StockIcon stockid="md-generic-pad" resource="pad-generic-pad-16.png" size="Menu" />
+ <StockIcon stockid="md-generic-pad" resource="pad-generic-16.png" size="Menu" />
+ <StockIcon stockid="md-go-to-line" resource="go-to-line-16.png" size="Menu" />
+ <StockIcon stockid="md-go-to-matching-brace" resource="go-to-matching-brace-16.png" size="Menu" />
<StockIcon stockid="md-group-by-category" resource="group-by-category-16.png" size="Menu" />
+ <StockIcon stockid="md-gui-file" resource="file-gtk-16.png" size="Menu" />
<StockIcon stockid="md-gui-file" resource="file-gtk-32.png" size="Dnd" />
- <StockIcon stockid="md-help" resource="pad-help-16.png" size="Menu" />
+ <StockIcon stockid="md-help-pad" resource="pad-help-16.png" size="Menu" />
+ <StockIcon stockid="md-help" resource="help-16.png" size="Menu" />
<StockIcon stockid="md-html-file-icon" resource="file-web-16.png" size="Menu" />
<StockIcon stockid="md-html-file-icon" resource="file-web-32.png" size="Dnd" />
<StockIcon stockid="md-interface" resource="element-interface-16.png" size="Menu" />
+ <StockIcon stockid="md-interface-file" resource="file-interface-16.png" size="Menu" />
<StockIcon stockid="md-interface-file" resource="file-interface-32.png" size="Dnd" />
<StockIcon stockid="md-keyword" resource="element-keyword-16.png" size="Menu" />
<StockIcon stockid="md-library-overlay" resource="project-library-overlay-32.png" size="Dnd" />
<StockIcon stockid="md-link-overlay" resource="link-overlay-16.png" size="Menu" />
<StockIcon stockid="md-literal" resource="element-constant-16.png" size="Menu" />
- <StockIcon stockid="md-magnify" resource="pad-search-results-16.png" size="Menu" />
+ <StockIcon stockid="md-live" resource="live-16.png" size="Menu" />
+ <StockIcon stockid="md-magnify" resource="pad-search-16.png" size="Menu" />
<StockIcon stockid="md-message-log" resource="pad-application-output-16.png" size="Menu" />
<StockIcon stockid="md-method" resource="element-method-16.png" size="Menu" />
<StockIcon stockid="md-misc-files" resource="file-generic-16.png" size="Menu" />
<StockIcon stockid="md-module" resource="element-module-16.png" size="Menu" />
+ <StockIcon stockid="md-monodevelop" resource="monodevelop-16.png" size="Menu" />
+ <StockIcon stockid="md-monodevelop" resource="monodevelop-22.png" />
+ <StockIcon stockid="md-monodevelop" resource="monodevelop-22.png" size="Button" />
+ <StockIcon stockid="md-monodevelop" resource="monodevelop-32.png" size="Dnd" />
+ <StockIcon stockid="md-monodevelop" resource="monodevelop-48.png" size="Dialog" />
<StockIcon stockid="md-name-space" resource="element-namespace-16.png" size="Menu" />
+ <StockIcon stockid="md-navigate-back" resource="breadcrumb-prev-16.png" size="Menu" />
+ <StockIcon stockid="md-navigate-forward" resource="breadcrumb-next-16.png" size="Menu" />
<StockIcon stockid="md-newmethod" resource="element-method-new-16.png" size="Menu" />
+ <StockIcon stockid="md-new-folder" resource="new-folder-16.png" size="Menu" />
+ <StockIcon stockid="md-new-project" resource="new-project-16.png" size="Menu" />
+ <StockIcon stockid="md-new-solution" resource="new-solution-16.png" size="Menu" />
+ <StockIcon stockid="md-new-solution-folder" resource="new-solution-folder-16.png" size="Menu" />
+ <StockIcon stockid="md-new-workspace" resource="new-workspace-16.png" size="Menu" />
<StockIcon stockid="md-nunit-overlay" resource="project-nunit-overlay-32.png" size="Dnd" />
<StockIcon stockid="md-other-declaration" resource="element-other-declaration-16.png" size="Menu" />
<StockIcon stockid="md-output-icon" resource="pad-application-output-16.png" size="Menu" />
<StockIcon stockid="md-package-source" resource="package-source-16.png" size="Menu" />
<StockIcon stockid="md-pin-down" resource="pin-down-16.png" size="Menu" />
<StockIcon stockid="md-pin-up" resource="pin-up-16.png" size="Menu" />
- <StockIcon stockid="md-platform-android" resource="platform-android-light-16.png" size="Menu" />
- <StockIcon stockid="md-platform-cross-platform" resource="platform-cross-platform-light-16.png" size="Menu" />
- <StockIcon stockid="md-platform-ios" resource="platform-ios-light-16.png" size="Menu" />
- <StockIcon stockid="md-platform-mac" resource="platform-mac-light-16.png" size="Menu" />
- <StockIcon stockid="md-platform-other" resource="platform-other-light-16.png" size="Menu" />
+ <StockIcon stockid="md-platform-android" resource="platform-android-16.png" size="Menu" />
+ <StockIcon stockid="md-platform-crossplatform" resource="platform-crossplatform-16.png" size="Menu" />
+ <StockIcon stockid="md-platform-ios" resource="platform-ios-16.png" size="Menu" />
+ <StockIcon stockid="md-platform-tvos" resource="platform-tvos-16.png" size="Menu" />
+ <StockIcon stockid="md-platform-mac" resource="platform-mac-16.png" size="Menu" />
+ <StockIcon stockid="md-platform-watchos" resource="platform-watchos-16.png" size="Menu" />
+ <StockIcon stockid="md-platform-other" resource="platform-other-16.png" size="Menu" />
<StockIcon stockid="md-popup-close" resource="popup-close-16.png" size="Menu" />
<StockIcon stockid="md-popup-close-hover" resource="popup-close-hover-16.png" size="Menu" />
<StockIcon stockid="md-preferences" resource="preferences-16.png" size="Menu" />
@@ -144,7 +190,7 @@
<StockIcon stockid="md-prefs-build" resource="prefs-build-16.png" size="Menu" />
<StockIcon stockid="md-prefs-code-formatting" resource="prefs-code-formatting-16.png" size="Menu" />
<StockIcon stockid="md-prefs-code-templates" resource="prefs-code-templates-16.png" size="Menu" />
- <StockIcon stockid="md-prefs-csharp" resource="prefs-csharp-16.png" size="Menu" />
+ <StockIcon stockid="md-prefs-source" resource="prefs-source-16.png" size="Menu" />
<StockIcon stockid="md-prefs-dotnet-naming-policies" resource="prefs-dotnet-naming-policies-16.png" size="Menu" />
<StockIcon stockid="md-prefs-external-tools" resource="prefs-external-tools-16.png" size="Menu" />
<StockIcon stockid="md-prefs-fonts" resource="prefs-fonts-16.png" size="Menu" />
@@ -155,35 +201,38 @@
<StockIcon stockid="md-prefs-name-conventions" resource="prefs-name-conventions-16.png" size="Menu" />
<StockIcon stockid="md-prefs-play" resource="prefs-play-16.png" size="Menu" />
<StockIcon stockid="md-prefs-sdk-locations" resource="prefs-sdk-locations-16.png" size="Menu" />
- <StockIcon stockid="md-prefs-standard-header" resource="prefs-standard-header-16.png" size="Menu" />
+ <StockIcon stockid="md-prefs-header" resource="prefs-header-16.png" size="Menu" />
<StockIcon stockid="md-prefs-task-list" resource="prefs-task-list-16.png" size="Menu" />
<StockIcon stockid="md-prefs-updates" resource="prefs-updates-16.png" size="Menu" />
<StockIcon stockid="md-preview-active" resource="preview-active-16.png" size="Menu" />
<StockIcon stockid="md-preview-hover" resource="preview-hover-16.png" size="Menu" />
- <StockIcon stockid="md-preview-normal" resource="preview-normal-16.png" size="Menu" />
- <StockIcon stockid="md-preview-selected" resource="preview-selected-16.png" size="Menu" />
+ <StockIcon stockid="md-preview-normal" resource="preview-16.png" size="Menu" />
+ <StockIcon stockid="md-preview-selected" resource="preview-16~sel.png" size="Menu" />
<StockIcon stockid="md-project" resource="project-16.png" size="Menu" />
<StockIcon stockid="md-project" resource="project-32.png" size="Dnd" />
- <StockIcon stockid="md-project-status-information" resource="project-status-information-16.png" size="Menu" />
- <StockIcon stockid="md-project-status-warning" resource="project-status-warning-16.png" size="Menu" />
- <StockIcon stockid="md-project-status-error" resource="project-status-error-16.png" size="Menu" />
- <StockIcon stockid="md-project-overlay" resource="project-reference-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-properties" resource="properties-16.png" size="Menu" />
+ <StockIcon stockid="md-project-web" resource="project-web-32.png" size="Dnd" />
+ <StockIcon stockid="md-reference-project" resource="reference-project-16.png" size="Menu" />
+ <StockIcon stockid="md-reference-invalid" resource="reference-invalid-16.png" size="Menu" />
+ <StockIcon stockid="md-reference-warning" resource="reference-invalid-16.png" size="Menu" />
<StockIcon stockid="md-property" resource="element-property-16.png" size="Menu" />
<StockIcon stockid="md-reference" resource="reference-16.png" size="Menu" />
+ <StockIcon stockid="md-reference-package" resource="reference-16.png" size="Menu" />
+ <StockIcon stockid="md-region" resource="region-16.png" size="Menu" />
<StockIcon stockid="md-regular-file" resource="file-generic-16.png" size="Menu" />
<StockIcon stockid="md-resource-file-icon" resource="file-resource-16.png" size="Menu" />
<StockIcon stockid="md-resource-file-icon" resource="file-resource-32.png" size="Dnd" />
+ <StockIcon stockid="md-run-unit-tests" resource="run-unit-tests-16.png" size="Menu" />
<StockIcon stockid="md-save-all" resource="save-all-16.png" size="Menu" />
<StockIcon stockid="md-script-file-icon" resource="file-script-16.png" size="Menu" />
<StockIcon stockid="md-script-file-icon" resource="file-script-32.png" size="Dnd" />
- <StockIcon stockid="md-searchbox-clear" resource="searchbox-clear-16.png" size="Menu" />
- <StockIcon stockid="md-searchbox-search" resource="searchbox-search-16.png" size="Menu" />
+ <StockIcon stockid="md-select-all" resource="select-all-16.png" size="Menu" />
<StockIcon stockid="md-solution" resource="solution-16.png" size="Menu" />
<StockIcon stockid="md-solution" resource="solution-32.png" size="Dnd" />
+ <StockIcon stockid="md-solution-pad" resource="pad-solution-16.png" size="Menu" />
<StockIcon stockid="md-sort-alphabetically" resource="sort-alphabetically-16.png" size="Menu" />
<StockIcon stockid="md-stop" resource="stop-16.png" size="Menu" />
- <StockIcon stockid="md-struct" resource="element-structure-16.png" size="Menu" />
+ <StockIcon stockid="md-struct" resource="element-struct-16.png" size="Menu" />
+ <StockIcon stockid="md-struct-file" resource="file-struct-16.png" size="Menu" />
<StockIcon stockid="md-struct-file" resource="file-struct-32.png" size="Dnd" />
<StockIcon stockid="md-task-list" resource="pad-task-list-16.png" size="Menu" />
<StockIcon stockid="md-template" resource="element-template-16.png" size="Menu" />
@@ -192,12 +241,22 @@
<StockIcon stockid="md-text-file-icon" resource="file-text-32.png" size="Dnd" />
<StockIcon stockid="md-type" resource="element-type-16.png" size="Menu" />
<StockIcon stockid="md-variable" resource="element-variable-16.png" size="Menu" />
- <StockIcon stockid="md-warning-overlay" resource="invalid-reference-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-web-overlay" resource="project-web-overlay-32.png" size="Dnd" />
+ <StockIcon stockid="md-warning-overlay" resource="reference-invalid-16.png" size="Menu" />
<StockIcon stockid="md-workspace" resource="workspace-16.png" size="Menu" />
<StockIcon stockid="md-workspace" resource="workspace-32.png" size="Dnd" />
<StockIcon stockid="md-xml-file-icon" resource="file-xml-16.png" size="Menu" />
<StockIcon stockid="md-xml-file-icon" resource="file-xml-32.png" size="Dnd" />
+ <StockIcon stockid="md-closed-folder" resource="folder-generic-16.png" size="Menu" />
+ <StockIcon stockid="md-closed-reference-folder" resource="folder-component-16.png" size="Menu" />
+ <StockIcon stockid="md-closed-resource-folder" resource="folder-resource-16.png" size="Menu" />
+ <StockIcon stockid="md-solution-folder-closed" resource="folder-solution-16.png" size="Menu" />
+ <StockIcon stockid="md-component-folder-closed" resource="folder-component-16.png" size="Menu" />
+ <StockIcon stockid="md-open-folder" resource="folder-generic-16.png" size="Menu" />
+ <StockIcon stockid="md-open-reference-folder" resource="folder-component-16.png" size="Menu" />
+ <StockIcon stockid="md-open-resource-folder" resource="folder-resource-16.png" size="Menu" />
+ <StockIcon stockid="md-solution-folder-open" resource="folder-solution-16.png" size="Menu" />
+ <StockIcon stockid="md-component-folder-open" resource="folder-component-16.png" size="Menu" />
+ <StockIcon stockid="md-web-search" resource="web-search-16.png" size="Menu" />
<!-- All sizes icons -->
<StockIcon stockid="gtk-dialog-error" resource="error-16.png" />
@@ -257,160 +316,119 @@
<StockIcon stockid="md-warning" resource="warning-48.png" size="Dialog" />
<!-- Unprocessed icons -->
- <StockIcon stockid="md-add-namespace" resource="add-namespace-16.png" />
<StockIcon stockid="md-build-combine" resource="build-solution-16.png" size="Menu" />
<StockIcon stockid="md-build-current-selected-project" resource="build-project-16.png" size="Menu" />
- <StockIcon stockid="md-clear-all-bookmarks" resource="clear-all-bookmarks-16.png" size="Menu" />
- <StockIcon stockid="md-close-all-documents" resource="close-all-documents-16.png" size="Menu" />
- <StockIcon stockid="md-close-combine-icon" resource="close-solution-16.png" size="Menu" />
- <StockIcon stockid="md-empty" resource="empty-16.png" size="Menu" />
- <StockIcon stockid="md-find-in-files" resource="find-in-files-16.png" size="Menu" />
- <StockIcon stockid="md-find-next-icon" resource="edit-find-next-16.png" size="Menu" />
- <StockIcon stockid="md-goto-nextbookmark" resource="goto-next-bookmark-16.png" size="Menu" />
- <StockIcon stockid="md-goto-prevbookmark" resource="goto-prev-bookmark-16.png" size="Menu" />
- <StockIcon stockid="md-monodevelop" resource="monodevelop-16.png" size="Menu" />
- <StockIcon stockid="md-monodevelop" resource="monodevelop-22.png" />
- <StockIcon stockid="md-monodevelop" resource="monodevelop-22.png" size="Button" />
- <StockIcon stockid="md-monodevelop" resource="monodevelop-32.png" size="Dnd" />
- <StockIcon stockid="md-monodevelop" resource="monodevelop-48.png" size="Dialog" />
- <StockIcon stockid="md-navigate-back" resource="navigate-previous-16.png" size="Menu" />
- <StockIcon stockid="md-navigate-forward" resource="navigate-next-16.png" size="Menu" />
- <StockIcon stockid="md-new-folder-icon" resource="folder-new-16.png" size="Menu" />
- <StockIcon stockid="md-new-project" resource="project-new-16.png" size="Menu" />
- <StockIcon stockid="md-new-solution" resource="solution-new-16.png" size="Menu" />
- <StockIcon stockid="md-new-solution-folder" resource="solution-folder-new-16.png" size="Menu" />
- <StockIcon stockid="md-replace-in-files" resource="replace-in-files-16.png" size="Menu" />
- <StockIcon stockid="md-select-all" resource="edit-select-all-16.png" size="Menu" />
- <StockIcon stockid="md-toggle-bookmark" resource="toggle-bookmark-16.png" size="Menu" />
- <StockIcon stockid="md-web-search-icon" resource="web-search-16.png" size="Menu" />
<!-- Status icons -->
- <Condition id="Platform" value="mac">
- <StockIcon stockid="md-status-build" animation="res:status-building-1-16.png;res:status-building-2-16.png;res:status-building-3-16.png;res:status-building-4-16.png;res:status-building-5-16.png" size="Menu" />
- <StockIcon stockid="md-status-download" animation="res:status-pulling-1-16.png;res:status-pulling-2-16.png;res:status-pulling-3-16.png;res:status-pulling-4-16.png;res:status-pulling-5-16.png;res:status-pulling-6-16.png" size="Menu" />
- <StockIcon stockid="md-status-upload" animation="res:status-pushing-1-16.png;res:status-pushing-2-16.png;res:status-pushing-3-16.png;res:status-pushing-4-16.png;res:status-pushing-5-16.png;res:status-pushing-6-16.png" size="Menu" />
- <StockIcon stockid="md-status-open" animation="res:status-opening-1-16.png;res:status-opening-2-16.png;res:status-opening-3-16.png;res:status-opening-4-16.png;res:status-opening-5-16.png;res:status-opening-6-16.png" size="Menu" />
- <StockIcon stockid="md-status-search" animation="res:status-searching-1-16.png;res:status-searching-2-16.png;res:status-searching-3-16.png;res:status-searching-4-16.png" size="Menu" />
- <StockIcon stockid="md-status-connecting" animation="res:status-connecting-1-16.png;res:status-connecting-2-16.png;res:status-connecting-3-16.png;res:status-connecting-4-16.png;res:status-connecting-5-16.png;res:status-connecting-6-16.png" size="Menu" />
- <StockIcon stockid="md-status-waiting" animation="res:status-waiting-1-16.png;res:status-waiting-2-16.png;res:status-waiting-3-16.png;res:status-waiting-4-16.png;res:status-waiting-5-16.png" size="Menu" />
- <StockIcon stockid="md-status-steady" resource="status-ready-16.png" size="Menu" />
- <StockIcon stockid="md-status-success" resource="status-success-16.png" size="Menu" />
- <StockIcon stockid="md-status-warning" resource="status-warning-16.png" size="Menu" />
- <StockIcon stockid="md-status-error" resource="status-error-16.png" size="Menu" />
- <StockIcon stockid="md-status-updates-downloading" animation="res:status-updates-downloading-1-16.png;500;res:status-updates-downloading-2-16.png;33;res:status-updates-downloading-3-16.png;33;res:status-updates-downloading-4-16.png;33;res:status-updates-downloading-5-16.png;33;res:status-updates-downloading-6-16.png;33" size="Menu" />
- <StockIcon stockid="md-status-updates-paused" resource="status-updates-paused-16.png" size="Menu" />
- <StockIcon stockid="md-status-warning-count" resource="status-warning-count-16.png" size="Menu" />
- <StockIcon stockid="md-status-error-count" resource="status-error-count-16.png" size="Menu" />
- <StockIcon stockid="md-updates" resource="status-updates-ready-16.png" size="Menu" />
- <StockIcon stockid="md-parser" resource="status-parsing-16.png" size="Menu" />
- </Condition>
- <Condition id="Platform" value="!mac">
- <StockIcon stockid="md-status-build" animation="res:status-building-1-14.png;res:status-building-2-14.png;res:status-building-3-14.png;res:status-building-4-14.png;res:status-building-5-14.png" size="Menu" />
- <StockIcon stockid="md-status-download" animation="res:status-pulling-1-14.png;res:status-pulling-2-14.png;res:status-pulling-3-14.png;res:status-pulling-4-14.png;res:status-pulling-5-14.png;res:status-pulling-6-14.png" size="Menu" />
- <StockIcon stockid="md-status-upload" animation="res:status-pushing-1-14.png;res:status-pushing-2-14.png;res:status-pushing-3-14.png;res:status-pushing-4-14.png;res:status-pushing-5-14.png;res:status-pushing-6-14.png" size="Menu" />
- <StockIcon stockid="md-status-open" animation="res:status-opening-1-14.png;res:status-opening-2-14.png;res:status-opening-3-14.png;res:status-opening-4-14.png;res:status-opening-5-14.png;res:status-opening-6-14.png" size="Menu" />
- <StockIcon stockid="md-status-search" animation="res:status-searching-1-14.png;res:status-searching-2-14.png;res:status-searching-3-14.png;res:status-searching-4-14.png" size="Menu" />
- <StockIcon stockid="md-status-connecting" animation="res:status-connecting-1-14.png;res:status-connecting-2-14.png;res:status-connecting-3-14.png;res:status-connecting-4-14.png;res:status-connecting-5-14.png;res:status-connecting-6-14.png" size="Menu" />
- <StockIcon stockid="md-status-waiting" animation="res:status-waiting-1-14.png;res:status-waiting-2-14.png;res:status-waiting-3-14.png;res:status-waiting-4-14.png;res:status-waiting-5-14.png" size="Menu" />
- <StockIcon stockid="md-status-steady" resource="status-ready-14.png" size="Menu" />
- <StockIcon stockid="md-status-success" resource="status-success-14.png" size="Menu" />
- <StockIcon stockid="md-status-warning" resource="status-warning-14.png" size="Menu" />
- <StockIcon stockid="md-status-error" resource="status-failure-14.png" size="Menu" />
- <StockIcon stockid="md-updates" resource="updates-16.png" size="Menu" />
- <StockIcon stockid="md-parser" resource="parser-16.png" size="Menu" />
- </Condition>
+ <StockIcon stockid="md-status-build" animation="res:status-building-1-16.png;res:status-building-2-16.png;res:status-building-3-16.png;res:status-building-4-16.png;res:status-building-5-16.png" size="Menu" />
+ <StockIcon stockid="md-status-download" animation="res:status-pulling-1-16.png;res:status-pulling-2-16.png;res:status-pulling-3-16.png;res:status-pulling-4-16.png;res:status-pulling-5-16.png;res:status-pulling-6-16.png" size="Menu" />
+ <StockIcon stockid="md-status-upload" animation="res:status-pushing-1-16.png;res:status-pushing-2-16.png;res:status-pushing-3-16.png;res:status-pushing-4-16.png;res:status-pushing-5-16.png;res:status-pushing-6-16.png" size="Menu" />
+ <StockIcon stockid="md-status-open" animation="res:status-opening-1-16.png;res:status-opening-2-16.png;res:status-opening-3-16.png;res:status-opening-4-16.png;res:status-opening-5-16.png;res:status-opening-6-16.png" size="Menu" />
+ <StockIcon stockid="md-status-search" animation="res:status-searching-1-16.png;res:status-searching-2-16.png;res:status-searching-3-16.png;res:status-searching-4-16.png" size="Menu" />
+ <StockIcon stockid="md-status-connecting" animation="res:status-connecting-1-16.png;res:status-connecting-2-16.png;res:status-connecting-3-16.png;res:status-connecting-4-16.png;res:status-connecting-5-16.png;res:status-connecting-6-16.png" size="Menu" />
+ <StockIcon stockid="md-status-waiting" animation="res:status-waiting-1-16.png;res:status-waiting-2-16.png;res:status-waiting-3-16.png;res:status-waiting-4-16.png;res:status-waiting-5-16.png" size="Menu" />
+ <StockIcon stockid="md-status-steady" resource="status-ready-16.png" size="Menu" />
+ <StockIcon stockid="md-status-success" resource="status-success-16.png" size="Menu" />
+ <StockIcon stockid="md-status-warning" resource="status-warning-16.png" size="Menu" />
+ <StockIcon stockid="md-status-error" resource="status-error-16.png" size="Menu" />
+ <StockIcon stockid="md-status-updates-downloading" animation="res:status-updates-downloading-1-16.png;500;res:status-updates-downloading-2-16.png;33;res:status-updates-downloading-3-16.png;33;res:status-updates-downloading-4-16.png;33;res:status-updates-downloading-5-16.png;33;res:status-updates-downloading-6-16.png;33" size="Menu" />
+ <StockIcon stockid="md-status-updates-paused" resource="status-updates-paused-16.png" size="Menu" />
+ <StockIcon stockid="md-status-warning-count" resource="status-warning-count-16.png" size="Menu" />
+ <StockIcon stockid="md-status-error-count" resource="status-error-count-16.png" size="Menu" />
+ <StockIcon stockid="md-updates" resource="status-updates-ready-16.png" size="Menu" />
+ <StockIcon stockid="md-parser" resource="status-parsing-16.png" size="Menu" />
+ <StockIcon stockid="md-status-instrumentation" resource="status-instrumentation-16.png" size="Menu" />
<!-- Spinners -->
<StockIcon stockid="md-spinner-14" animation="res:spinner-14-1.png;60;res:spinner-14-2.png;60;res:spinner-14-3.png;60;res:spinner-14-4.png;60;res:spinner-14-5.png;60" size="Menu" />
- <StockIcon stockid="md-spinner-normal-16" animation="res:spinner-normal-1-16.png;60;res:spinner-normal-2-16.png;60;res:spinner-normal-3-16.png;60;res:spinner-normal-4-16.png;60;res:spinner-normal-5-16.png;60" size="Menu" />
- <StockIcon stockid="md-spinner-selected-16" animation="res:spinner-selected-1-16.png;60;res:spinner-selected-2-16.png;60;res:spinner-selected-3-16.png;60;res:spinner-selected-4-16.png;60;res:spinner-selected-5-16.png;60" size="Menu" />
+ <StockIcon stockid="md-spinner-16" animation="res:spinner-16-1.png;60;res:spinner-16-2.png;60;res:spinner-16-3.png;60;res:spinner-16-4.png;60;res:spinner-16-5.png;60" size="Menu" />
<StockIcon stockid="md-spinner-18" animation="res:spinner-18-1.png;60;res:spinner-18-2.png;60;res:spinner-18-3.png;60;res:spinner-18-4.png;60;res:spinner-18-5.png;60" size="Button" />
<!-- Overlays -->
- <StockIcon stockid="md-internal-class" icon="res:element-class-16.png|res:element-visibility-internal-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-internal-delegate" icon="res:element-delegate-16.png|res:element-visibility-internal-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-internal-enum" icon="res:element-enumeration-16.png|res:element-visibility-internal-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-internal-event" icon="res:element-event-16.png|res:element-visibility-internal-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-internal-extensionmethod" icon="res:element-extensionmethod-16.png|res:element-visibility-internal-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-internal-field" icon="res:element-field-16.png|res:element-visibility-internal-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-internal-interface" icon="res:element-interface-16.png|res:element-visibility-internal-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-internal-method" icon="res:element-method-16.png|res:element-visibility-internal-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-internal-property" icon="res:element-property-16.png|res:element-visibility-internal-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-internal-static-event" icon="res:element-event-16.png|res:element-visibility-static-overlay-16.png|res:element-visibility-internal-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-internal-static-field" icon="res:element-field-16.png|res:element-visibility-static-overlay-16.png|res:element-visibility-internal-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-internal-static-method" icon="res:element-method-16.png|res:element-visibility-static-overlay-16.png|res:element-visibility-internal-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-internal-static-property" icon="res:element-property-16.png|res:element-visibility-static-overlay-16.png|res:element-visibility-internal-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-internal-struct" icon="res:element-structure-16.png|res:element-visibility-internal-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-InternalAndProtected-class" icon="res:element-class-16.png|res:element-visibility-internal-an-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-InternalAndProtected-delegate" icon="res:element-delegate-16.png|res:element-visibility-internal-an-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-InternalAndProtected-enum" icon="res:element-enumeration-16.png|res:element-visibility-internal-an-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-InternalAndProtected-event" icon="res:element-event-16.png|res:element-visibility-internal-an-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-InternalAndProtected-extensionmethod" icon="res:element-extensionmethod-16.png|res:element-visibility-internal-an-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-InternalAndProtected-field" icon="res:element-field-16.png|res:element-visibility-internal-an-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-InternalAndProtected-interface" icon="res:element-interface-16.png|res:element-visibility-internal-an-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-InternalAndProtected-method" icon="res:element-method-16.png|res:element-visibility-internal-an-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-InternalAndProtected-property" icon="res:element-property-16.png|res:element-visibility-internal-an-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-InternalAndProtected-static-event" icon="res:element-event-16.png|res:element-visibility-static-overlay-16.png|res:element-visibility-internal-an-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-InternalAndProtected-static-field" icon="res:element-field-16.png|res:element-visibility-static-overlay-16.png|res:element-visibility-internal-an-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-InternalAndProtected-static-method" icon="res:element-method-16.png|res:element-visibility-static-overlay-16.png|res:element-visibility-internal-an-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-InternalAndProtected-static-property" icon="res:element-property-16.png|res:element-visibility-static-overlay-16.png|res:element-visibility-internal-an-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-InternalAndProtected-struct" icon="res:element-structure-16.png|res:element-visibility-internal-an-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-private-class" icon="res:element-class-16.png|res:element-visibility-private-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-private-delegate" icon="res:element-delegate-16.png|res:element-visibility-private-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-private-enum" icon="res:element-enumeration-16.png|res:element-visibility-private-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-private-event" icon="res:element-event-16.png|res:element-visibility-private-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-private-extensionmethod" icon="res:element-extensionmethod-16.png|res:element-visibility-private-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-private-field" icon="res:element-field-16.png|res:element-visibility-private-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-private-interface" icon="res:element-interface-16.png|res:element-visibility-private-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-private-method" icon="res:element-method-16.png|res:element-visibility-private-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-private-property" icon="res:element-property-16.png|res:element-visibility-private-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-private-static-event" icon="res:element-event-16.png|res:element-visibility-static-overlay-16.png|res:element-visibility-private-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-private-static-field" icon="res:element-field-16.png|res:element-visibility-private-overlay-16.png|res:element-visibility-static-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-private-static-method" icon="res:element-method-16.png|res:element-visibility-static-overlay-16.png|res:element-visibility-private-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-private-static-property" icon="res:element-property-16.png|res:element-visibility-static-overlay-16.png|res:element-visibility-private-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-private-struct" icon="res:element-structure-16.png|res:element-visibility-private-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-internal-class" icon="res:element-class-16.png|res:element-visibility-internal-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-internal-delegate" icon="res:element-delegate-16.png|res:element-visibility-internal-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-internal-enum" icon="res:element-enum-16.png|res:element-visibility-internal-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-internal-event" icon="res:element-event-16.png|res:element-visibility-internal-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-internal-extensionmethod" icon="res:element-extensionmethod-16.png|res:element-visibility-internal-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-internal-field" icon="res:element-field-16.png|res:element-visibility-internal-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-internal-interface" icon="res:element-interface-16.png|res:element-visibility-internal-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-internal-method" icon="res:element-method-16.png|res:element-visibility-internal-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-internal-property" icon="res:element-property-16.png|res:element-visibility-internal-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-internal-static-event" icon="res:element-event-16.png|res:element-visibility-internal-square-overlay-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-internal-static-field" icon="res:element-field-16.png|res:element-visibility-internal-square-overlay-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-internal-static-method" icon="res:element-method-16.png|res:element-visibility-internal-square-overlay-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-internal-static-property" icon="res:element-property-16.png|res:element-visibility-internal-square-overlay-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-internal-struct" icon="res:element-struct-16.png|res:element-visibility-internal-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-internal-literal" icon="res:element-constant-16.png|res:element-visibility-internal-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-InternalAndProtected-class" icon="res:element-class-16.png|res:element-visibility-internal-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-InternalAndProtected-delegate" icon="res:element-delegate-16.png|res:element-visibility-internal-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-InternalAndProtected-enum" icon="res:element-enum-16.png|res:element-visibility-internal-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-InternalAndProtected-event" icon="res:element-event-16.png|res:element-visibility-internal-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-InternalAndProtected-extensionmethod" icon="res:element-extensionmethod-16.png|res:element-visibility-internal-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-InternalAndProtected-field" icon="res:element-field-16.png|res:element-visibility-internal-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-InternalAndProtected-interface" icon="res:element-interface-16.png|res:element-visibility-internal-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-InternalAndProtected-method" icon="res:element-method-16.png|res:element-visibility-internal-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-InternalAndProtected-property" icon="res:element-property-16.png|res:element-visibility-internal-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-InternalAndProtected-static-event" icon="res:element-event-16.png|res:element-visibility-internal-square-overlay-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-InternalAndProtected-static-field" icon="res:element-field-16.png|res:element-visibility-internal-square-overlay-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-InternalAndProtected-static-method" icon="res:element-method-16.png|res:element-visibility-internal-square-overlay-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-InternalAndProtected-static-property" icon="res:element-property-16.png|res:element-visibility-internal-square-overlay-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-InternalAndProtected-struct" icon="res:element-struct-16.png|res:element-visibility-internal-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-InternalAndProtected-literal" icon="res:element-constant-16.png|res:element-visibility-internal-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-private-class" icon="res:element-class-16.png|res:element-visibility-private-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-private-delegate" icon="res:element-delegate-16.png|res:element-visibility-private-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-private-enum" icon="res:element-enum-16.png|res:element-visibility-private-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-private-event" icon="res:element-event-16.png|res:element-visibility-private-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-private-extensionmethod" icon="res:element-extensionmethod-16.png|res:element-visibility-private-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-private-field" icon="res:element-field-16.png|res:element-visibility-private-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-private-interface" icon="res:element-interface-16.png|res:element-visibility-private-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-private-method" icon="res:element-method-16.png|res:element-visibility-private-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-private-property" icon="res:element-property-16.png|res:element-visibility-private-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-private-static-event" icon="res:element-event-16.png|res:element-visibility-private-square-overlay-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-private-static-field" icon="res:element-field-16.png|res:element-visibility-private-square-overlay-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-private-static-method" icon="res:element-method-16.png|res:element-visibility-private-square-overlay-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-private-static-property" icon="res:element-property-16.png|res:element-visibility-private-square-overlay-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-private-struct" icon="res:element-struct-16.png|res:element-visibility-private-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-private-literal" icon="res:element-constant-16.png|res:element-visibility-private-square-overlay-16.png" size="Menu" />
<StockIcon stockid="md-project-console" icon="md-project|res:project-console-overlay-32.png" size="Dnd" />
- <StockIcon stockid="md-project-gui" icon="md-project|res:project-gui-overlay-32.png" size="Dnd" />
+ <StockIcon stockid="md-project-gui" icon="md-project|res:project-gtk2-overlay-32.png" size="Dnd" />
<StockIcon stockid="md-project-library" icon="md-project|md-library-overlay" size="Dnd" />
<StockIcon stockid="md-project-package" icon="md-project|res:project-package-overlay-32.png" size="Dnd" />
<StockIcon stockid="md-project-shared-assets" icon="md-project|res:project-shared-assets-overlay-32.png" size="Dnd" />
- <StockIcon stockid="md-project-web" icon="md-project|md-web-overlay" size="Dnd" />
- <StockIcon stockid="md-protected-class" icon="res:element-class-16.png|res:element-visibility-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-protected-delegate" icon="res:element-delegate-16.png|res:element-visibility-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-protected-enum" icon="res:element-enumeration-16.png|res:element-visibility-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-protected-event" icon="res:element-event-16.png|res:element-visibility-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-protected-extensionmethod" icon="res:element-extensionmethod-16.png|res:element-visibility-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-protected-field" icon="res:element-field-16.png|res:element-visibility-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-protected-interface" icon="res:element-interface-16.png|res:element-visibility-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-protected-method" icon="res:element-method-16.png|res:element-visibility-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-protected-property" icon="res:element-property-16.png|res:element-visibility-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-protected-static-event" icon="res:element-event-16.png|res:element-visibility-static-overlay-16.png|res:element-visibility-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-protected-static-field" icon="res:element-field-16.png|res:element-visibility-static-overlay-16.png|res:element-visibility-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-protected-static-method" icon="res:element-method-16.png|res:element-visibility-static-overlay-16.png|res:element-visibility-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-protected-static-property" icon="res:element-property-16.png|res:element-visibility-static-overlay-16.png|res:element-visibility-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-protected-struct" icon="res:element-structure-16.png|res:element-visibility-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-ProtectedOrInternal-class" icon="res:element-class-16.png|res:element-visibility-internal-or-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-ProtectedOrInternal-delegate" icon="res:element-delegate-16.png|res:element-visibility-internal-or-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-ProtectedOrInternal-enum" icon="res:element-enumeration-16.png|res:element-visibility-internal-or-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-ProtectedOrInternal-event" icon="res:element-event-16.png|res:element-visibility-internal-or-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-ProtectedOrInternal-extensionmethod" icon="res:element-extensionmethod-16.png|res:element-visibility-internal-or-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-ProtectedOrInternal-field" icon="res:element-field-16.png|res:element-visibility-internal-or-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-ProtectedOrInternal-interface" icon="res:element-interface-16.png|res:element-visibility-internal-or-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-ProtectedOrInternal-method" icon="res:element-method-16.png|res:element-visibility-internal-or-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-ProtectedOrInternal-property" icon="res:element-property-16.png|res:element-visibility-internal-or-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-ProtectedOrInternal-static-event" icon="res:element-event-16.png|res:element-visibility-static-overlay-16.png|res:element-visibility-internal-or-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-ProtectedOrInternal-static-field" icon="res:element-field-16.png|res:element-visibility-static-overlay-16.png|res:element-visibility-internal-or-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-ProtectedOrInternal-static-method" icon="res:element-method-16.png|res:element-visibility-static-overlay-16.png|res:element-visibility-internal-or-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-ProtectedOrInternal-static-property" icon="res:element-property-16.png|res:element-visibility-static-overlay-16.png|res:element-visibility-internal-or-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-ProtectedOrInternal-struct" icon="res:element-structure-16.png|res:element-visibility-internal-or-protected-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-reference-folder" icon="md-reference|md-folder-overlay" size="Menu" />
- <StockIcon stockid="md-reference-package" icon="md-reference" size="Menu" />
- <StockIcon stockid="md-reference-project" icon="md-reference|md-project-overlay" size="Menu" />
- <StockIcon stockid="md-reference-warning" icon="md-reference|res:invalid-reference-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-static-event" icon="res:element-event-16.png|res:element-visibility-static-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-static-field" icon="res:element-field-16.png|res:element-visibility-static-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-static-method" icon="res:element-method-16.png|res:element-visibility-static-overlay-16.png" size="Menu" />
- <StockIcon stockid="md-static-property" icon="res:element-property-16.png|res:element-visibility-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-protected-class" icon="res:element-class-16.png|res:element-visibility-protected-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-protected-delegate" icon="res:element-delegate-16.png|res:element-visibility-protected-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-protected-enum" icon="res:element-enum-16.png|res:element-visibility-protected-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-protected-event" icon="res:element-event-16.png|res:element-visibility-protected-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-protected-extensionmethod" icon="res:element-extensionmethod-16.png|res:element-visibility-protected-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-protected-field" icon="res:element-field-16.png|res:element-visibility-protected-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-protected-interface" icon="res:element-interface-16.png|res:element-visibility-protected-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-protected-method" icon="res:element-method-16.png|res:element-visibility-protected-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-protected-property" icon="res:element-property-16.png|res:element-visibility-protected-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-protected-static-event" icon="res:element-event-16.png|res:element-visibility-protected-square-overlay-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-protected-static-field" icon="res:element-field-16.png|res:element-visibility-protected-square-overlay-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-protected-static-method" icon="res:element-method-16.png|res:element-visibility-protected-square-overlay-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-protected-static-property" icon="res:element-property-16.png|res:element-visibility-protected-square-overlay-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-protected-struct" icon="res:element-struct-16.png|res:element-visibility-protected-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-protected-literal" icon="res:element-constant-16.png|res:element-visibility-protected-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-ProtectedOrInternal-class" icon="res:element-class-16.png|res:element-visibility-internal-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-ProtectedOrInternal-delegate" icon="res:element-delegate-16.png|res:element-visibility-internal-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-ProtectedOrInternal-enum" icon="res:element-enum-16.png|res:element-visibility-internal-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-ProtectedOrInternal-event" icon="res:element-event-16.png|res:element-visibility-internal-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-ProtectedOrInternal-extensionmethod" icon="res:element-extensionmethod-16.png|res:element-visibility-internal-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-ProtectedOrInternal-field" icon="res:element-field-16.png|res:element-visibility-internal-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-ProtectedOrInternal-interface" icon="res:element-interface-16.png|res:element-visibility-internal-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-ProtectedOrInternal-method" icon="res:element-method-16.png|res:element-visibility-internal-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-ProtectedOrInternal-property" icon="res:element-property-16.png|res:element-visibility-internal-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-ProtectedOrInternal-static-event" icon="res:element-event-16.png|res:element-visibility-internal-square-overlay-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-ProtectedOrInternal-static-field" icon="res:element-field-16.png|res:element-visibility-internal-square-overlay-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-ProtectedOrInternal-static-method" icon="res:element-method-16.png|res:element-visibility-internal-square-overlay-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-ProtectedOrInternal-static-property" icon="res:element-property-16.png|res:element-visibility-internal-square-overlay-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-ProtectedOrInternal-struct" icon="res:element-struct-16.png|res:element-visibility-internal-diamond-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-ProtectedOrInternal-literal" icon="res:element-constant-16.png|res:element-visibility-internal-square-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-static-event" icon="res:element-event-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-static-field" icon="res:element-field-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-static-method" icon="res:element-method-16.png|res:element-static-overlay-16.png" size="Menu" />
+ <StockIcon stockid="md-static-property" icon="res:element-property-16.png|res:element-static-overlay-16.png" size="Menu" />
</Extension>
</ExtensionModel>
diff --git a/main/src/core/MonoDevelop.Ide/ExtensionModel/Templates.addin.xml b/main/src/core/MonoDevelop.Ide/ExtensionModel/Templates.addin.xml
index d53bd4470a..fa6c2893f8 100644
--- a/main/src/core/MonoDevelop.Ide/ExtensionModel/Templates.addin.xml
+++ b/main/src/core/MonoDevelop.Ide/ExtensionModel/Templates.addin.xml
@@ -69,11 +69,16 @@
<FileTemplate id = "EmptyResourceFile" resource = "EmptyResourceFile.xft.xml"/>
<FileTemplate id = "EmptyTextFile" resource = "EmptyTextFile.xft.xml"/>
<FileTemplate id = "EmptyXMLFile" resource = "EmptyXMLFile.xft.xml"/>
+
+ <Condition id="Platform" value="windows">
+ <FileTemplate id = "AppManifest" resource = "AppManifest.xft.xml"/>
+ </Condition>
</Extension>
<Extension path = "/MonoDevelop/Ide/FileTemplateTypes">
<FileTemplateType name = "File" class = "MonoDevelop.Ide.Templates.TextFileDescriptionTemplate"/>
<FileTemplateType name = "RawFile" class = "MonoDevelop.Ide.Templates.RawFileDescriptionTemplate"/>
+ <FileTemplateType name = "Property" class = "MonoDevelop.Ide.Templates.PropertyDescriptionTemplate"/>
<FileTemplateType name = "CodeDomFile" class = "MonoDevelop.Ide.Templates.CodeDomFileDescriptionTemplate"/>
<FileTemplateType name = "ProjectResource" class = "MonoDevelop.Ide.Templates.ResourceFileDescriptionTemplate"/>
<FileTemplateType name = "CodeTranslationFile" class = "MonoDevelop.Ide.Templates.CodeTranslationFileDescriptionTemplate"/>
@@ -94,7 +99,7 @@
</Extension>
<Extension path="/MonoDevelop/Ide/ProjectTemplateCategories">
- <Category id="multiplat" name="Multi-platform" icon="md-platform-cross-platform">
+ <Category id="multiplat" name="Multiplatform" icon="md-platform-crossplatform">
<Category id="library" name="Library">
<Category id="general" name="General" mappedCategories="crossplat/library/general" />
</Category>
@@ -119,8 +124,8 @@
</Extension>
<Extension path="/MonoDevelop/Ide/TemplateImages">
- <Image id="md-generic-project" resource="generic-project.png" />
- <Image id="md-blank-solution" resource="blank-solution.png" />
+ <Image id="md-generic-project" resource="project.png" />
+ <Image id="md-blank-solution" resource="solution.png" />
<Image id="md-console-project" resource="console-project.png" />
<Image id="md-library-project" resource="library-project.png" />
<Image id="md-pcl-project" resource="pcl-project.png" />
diff --git a/main/src/core/MonoDevelop.Ide/Makefile.am b/main/src/core/MonoDevelop.Ide/Makefile.am
index 4fa387040f..76417ba6d3 100644
--- a/main/src/core/MonoDevelop.Ide/Makefile.am
+++ b/main/src/core/MonoDevelop.Ide/Makefile.am
@@ -3,6 +3,6 @@ include $(top_srcdir)/xbuild.include
EXTRA_DIST += \
gtkrc \
gtkrc.mac \
- gtkrc.mac-yosemite \
+ gtkrc.mac-dark \
gtkrc.win32 \
- gtkrc.win32-vista
+ gtkrc.win32-dark
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkNotebookResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkNotebookResult.cs
index 53ec341408..f2ee0c1f87 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkNotebookResult.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkNotebookResult.cs
@@ -32,10 +32,9 @@ namespace MonoDevelop.Components.AutoTest.Results
public class GtkNotebookResult : GtkWidgetResult
{
Notebook noteBook;
- Label toBeSelectedLabel;
int toBeSelected = -1;
- public GtkNotebookResult (Widget notebookWidget) : base (notebookWidget)
+ internal GtkNotebookResult (Widget notebookWidget) : base (notebookWidget)
{
noteBook = notebookWidget as Notebook;
}
@@ -51,7 +50,6 @@ namespace MonoDevelop.Components.AutoTest.Results
var iTab = noteBook.GetNthPage (i);
var label = noteBook.GetTabLabelText (iTab);
if (CheckForText (label, text, exact)) {
- toBeSelectedLabel = noteBook.GetTabLabel (iTab) as Label;
toBeSelected = i;
return this;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkTreeModelResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkTreeModelResult.cs
index bf7a4fd98b..c9158a7980 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkTreeModelResult.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkTreeModelResult.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System;
using System.Collections.Generic;
+using System.Reflection;
using Gtk;
using System.Linq;
@@ -38,14 +39,14 @@ namespace MonoDevelop.Components.AutoTest.Results
TreeIter? resultIter;
string DesiredText;
- public GtkTreeModelResult (Widget parent, TreeModel treeModel, int column) : base (parent)
+ internal GtkTreeModelResult (Widget parent, TreeModel treeModel, int column) : base (parent)
{
ParentWidget = parent;
TModel = treeModel;
Column = column;
}
- public GtkTreeModelResult (Widget parent, TreeModel treeModel, int column, TreeIter iter) : base (parent)
+ internal GtkTreeModelResult (Widget parent, TreeModel treeModel, int column, TreeIter iter) : base (parent)
{
ParentWidget = parent;
TModel = treeModel;
@@ -121,7 +122,7 @@ namespace MonoDevelop.Components.AutoTest.Results
public override AppResult Property (string propertyName, object value)
{
- if (resultIter != null && resultIter.HasValue) {
+ if (resultIter.HasValue) {
var objectToCompare = TModel.GetValue (resultIter.Value, Column);
return MatchProperty (propertyName, objectToCompare, value);
}
@@ -131,7 +132,7 @@ namespace MonoDevelop.Components.AutoTest.Results
public override ObjectProperties Properties ()
{
- if (resultIter != null && resultIter.HasValue) {
+ if (resultIter.HasValue) {
var objectForProperties = TModel.GetValue (resultIter.Value, Column);
return base.GetProperties (objectForProperties);
}
@@ -272,6 +273,15 @@ namespace MonoDevelop.Components.AutoTest.Results
}
return false;
}
+
+ public override void SetProperty (string propertyName, object value)
+ {
+ if (resultIter.HasValue) {
+ var modelValue = TModel.GetValue ((TreeIter)resultIter, Column);
+
+ SetProperty (modelValue, propertyName, value);
+ }
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkWidgetResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkWidgetResult.cs
index 50d4f4b082..629a3e2eeb 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkWidgetResult.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkWidgetResult.cs
@@ -37,7 +37,7 @@ namespace MonoDevelop.Components.AutoTest.Results
{
Widget resultWidget;
- public GtkWidgetResult (Widget widget)
+ internal GtkWidgetResult (Widget widget)
{
resultWidget = widget;
}
@@ -76,7 +76,7 @@ namespace MonoDevelop.Components.AutoTest.Results
return this;
}
- Window window = resultWidget as Window;
+ var window = resultWidget as Gtk.Window;
if (window != null) {
if (window.Title != null && window.Title.IndexOf (mark) > -1) {
return this;
@@ -473,6 +473,11 @@ namespace MonoDevelop.Components.AutoTest.Results
return true;
});
}
+
+ public override void SetProperty (string propertyName, object value)
+ {
+ SetProperty (resultWidget, propertyName, value);
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs
index e12c8ab3ed..bcd17d7f81 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs
@@ -41,7 +41,7 @@ namespace MonoDevelop.Components.AutoTest.Results
{
NSObject ResultObject;
- public NSObjectResult (NSObject resultObject)
+ internal NSObjectResult (NSObject resultObject)
{
ResultObject = resultObject;
}
@@ -244,6 +244,11 @@ namespace MonoDevelop.Components.AutoTest.Results
}
+ public override void SetProperty (string propertyName, object value)
+ {
+ SetProperty (ResultObject, propertyName, value);
+ }
+
#region MacPlatform.MacIntegration.MainToolbar.SelectorView
public override bool SetActiveConfiguration (string configurationName)
{
@@ -295,4 +300,4 @@ namespace MonoDevelop.Components.AutoTest.Results
}
}
-#endif \ No newline at end of file
+#endif
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/ObjectResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/ObjectResult.cs
index 683b697037..fc276a5394 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/ObjectResult.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/ObjectResult.cs
@@ -122,5 +122,10 @@ namespace MonoDevelop.Components.AutoTest.Results
{
}
+
+ public override void SetProperty (string propertyName, object newValue)
+ {
+ SetProperty (value, propertyName, newValue);
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AppQuery.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AppQuery.cs
index fc08c971db..6cbfbd1600 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AppQuery.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AppQuery.cs
@@ -243,42 +243,42 @@ namespace MonoDevelop.Components.AutoTest
public AppQuery Button ()
{
- return CheckType (typeof(Button), "Button");
+ return CheckType (typeof(Gtk.Button), "Button");
}
public AppQuery Textfield ()
{
- return CheckType (typeof(Entry), "Textfield");
+ return CheckType (typeof(Gtk.Entry), "Textfield");
}
public AppQuery CheckButton ()
{
- return CheckType (typeof(CheckButton), "CheckButton");
+ return CheckType (typeof(Gtk.CheckButton), "CheckButton");
}
public AppQuery RadioButton ()
{
- return CheckType (typeof(RadioButton), "RadioButton");
+ return CheckType (typeof(Gtk.RadioButton), "RadioButton");
}
public AppQuery TreeView ()
{
- return CheckType (typeof(TreeView), "TreeView");
+ return CheckType (typeof(Gtk.TreeView), "TreeView");
}
public AppQuery Window ()
{
- return CheckType (typeof(Window), "Window");
+ return CheckType (typeof(Gtk.Window), "Window");
}
public AppQuery TextView ()
{
- return CheckType (typeof(TextView), "TextView");
+ return CheckType (typeof(Gtk.TextView), "TextView");
}
public AppQuery Notebook ()
{
- return CheckType (typeof(Notebook), "Notebook");
+ return CheckType (typeof(Gtk.Notebook), "Notebook");
}
public AppQuery Text (string text)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AppResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AppResult.cs
index 20a71e2df5..df759e541b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AppResult.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AppResult.cs
@@ -64,6 +64,7 @@ namespace MonoDevelop.Components.AutoTest
public abstract bool EnterText (string text);
public abstract bool Toggle (bool active);
public abstract void Flash ();
+ public abstract void SetProperty (string propertyName, object value);
// More specific actions for complicated widgets
@@ -105,6 +106,17 @@ namespace MonoDevelop.Components.AutoTest
return children;
}
+ public void SetProperty (object o, string propertyName, object value)
+ {
+ // Find the property for the name
+ PropertyInfo propertyInfo = o.GetType().GetProperty(propertyName,
+ BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
+
+ if (propertyInfo != null && propertyInfo.CanRead && !propertyInfo.GetIndexParameters ().Any ()) {
+ propertyInfo.SetValue (o, value);
+ }
+ }
+
/// <summary>
/// Convenience function to add an attribute to an element
/// </summary>
@@ -140,7 +152,7 @@ namespace MonoDevelop.Components.AutoTest
var propertiesObject = new ObjectProperties ();
if (resultObject != null) {
var properties = resultObject.GetType ().GetProperties (
- BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static);
+ BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
foreach (var property in properties) {
try {
var value = GetPropertyValue (property.Name, resultObject);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs
index 56047273c4..e3251563aa 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs
@@ -127,7 +127,7 @@ namespace MonoDevelop.Components.AutoTest
else
try {
process.Kill ();
- } catch (InvalidOperationException invalidExp) {
+ } catch (InvalidOperationException) {
Console.WriteLine ("Process has already exited");
}
}
@@ -213,6 +213,11 @@ namespace MonoDevelop.Components.AutoTest
return session.ErrorCount (severity);
}
+ public List<TaskListEntryDTO> GetErrors (TaskSeverity severity)
+ {
+ return session.GetErrors (severity);
+ }
+
public void WaitForEvent (string name)
{
WaitForEvent (name, defaultEventWaitTimeout);
@@ -363,6 +368,14 @@ namespace MonoDevelop.Components.AutoTest
}
}
+ public void SetProperty (Func<AppQuery, AppQuery> query, string propertyName, object value)
+ {
+ AppResult[] results = Query (query);
+ foreach (var result in results) {
+ session.SetProperty (result, propertyName, value);
+ }
+ }
+
public bool SetActiveConfiguration (Func<AppQuery, AppQuery> query, string configuration)
{
AppResult[] results = Query (query);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestService.cs
index 64b48200c2..0ecdb78e83 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestService.cs
@@ -197,7 +197,7 @@ namespace MonoDevelop.Components.AutoTest
public abstract void Replay (AutoTestSession testSession);
}
- public class KeyPressEvent: RecordEvent
+ internal class KeyPressEvent: RecordEvent
{
public Gdk.Key Key { get; set; }
public Gdk.ModifierType Modifiers { get; set; }
@@ -238,7 +238,7 @@ namespace MonoDevelop.Components.AutoTest
}
}
- public class StringEvent: RecordEvent
+ internal class StringEvent: RecordEvent
{
internal string Text;
internal Gdk.ModifierType Modifiers { get; set; }
@@ -278,7 +278,7 @@ namespace MonoDevelop.Components.AutoTest
}
}
- public class CommandEvent: RecordEvent
+ internal class CommandEvent: RecordEvent
{
public object CommandId { get; set; }
public int DataItemIndex { get; set; }
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestSession.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestSession.cs
index a4fb16bb70..66072db1b4 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestSession.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestSession.cs
@@ -108,7 +108,7 @@ namespace MonoDevelop.Components.AutoTest
object res = null;
Exception error = null;
- if (DispatchService.IsGuiThread) {
+ if (Runtime.IsMainThread) {
res = del ();
return safe ? SafeObject (res) : res;
}
@@ -182,7 +182,7 @@ namespace MonoDevelop.Components.AutoTest
public void TakeScreenshot (string screenshotPath)
{
#if MAC
- DispatchService.GuiDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
try {
IntPtr handle = CGDisplayCreateImage (MainDisplayID ());
CoreGraphics.CGImage screenshot = ObjCRuntime.Runtime.GetINativeObject <CoreGraphics.CGImage> (handle, true);
@@ -242,6 +242,17 @@ namespace MonoDevelop.Components.AutoTest
return TaskService.Errors.Count (x => x.Severity == severity);
}
+ public List<TaskListEntryDTO> GetErrors (TaskSeverity severity)
+ {
+ return TaskService.Errors.Where (x => x.Severity == severity).Select (x => new TaskListEntryDTO () {
+ Line = x.Line,
+ Description = x.Description,
+ File = x.FileName.FileName,
+ Path = x.FileName.FullPath,
+ Project = x.WorkspaceObject.Name
+ }).ToList ();
+ }
+
object SafeObject (object ob)
{
if (ob == null)
@@ -325,7 +336,7 @@ namespace MonoDevelop.Components.AutoTest
public void ExecuteOnIdle (Action idleFunc, bool wait = true, int timeout = 20000)
{
- if (DispatchService.IsGuiThread) {
+ if (Runtime.IsMainThread) {
idleFunc ();
return;
}
@@ -558,6 +569,15 @@ namespace MonoDevelop.Components.AutoTest
}
}
+ public void SetProperty (AppResult result, string name, object o)
+ {
+ try {
+ ExecuteOnIdle (() => result.SetProperty (name, o));
+ } catch (TimeoutException e) {
+ ThrowOperationTimeoutException ("SetProperty", result.SourceQuery, result, e);
+ }
+ }
+
public bool SetActiveConfiguration (AppResult result, string configuration)
{
bool success = false;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/DataTransferObjects.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/DataTransferObjects.cs
new file mode 100644
index 0000000000..acd6e94e2e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/DataTransferObjects.cs
@@ -0,0 +1,60 @@
+//
+// DataTransferObjects.cs
+//
+// Author:
+// kylewhite <kyle.white@xamarin.com>
+//
+// Copyright (c) 2016 kylewhite
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.Components.AutoTest
+{
+ [Serializable]
+ public class TaskListEntryDTO
+ {
+ public string Description {
+ get;
+ set;
+ }
+
+ public string File {
+ get;
+ set;
+ }
+
+ public string Path {
+ get;
+ set;
+ }
+
+ public int Line {
+ get;
+ set;
+ }
+
+ public string Project {
+ get;
+ set;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/Axis.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/Axis.cs
index d0e5f2d008..1a3100ff3b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/Axis.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/Axis.cs
@@ -33,7 +33,7 @@ namespace MonoDevelop.Components.Chart
public abstract class Axis
{
int tickSize = 6;
- internal BasicChart Owner;
+ internal ChartWidget Owner;
AxisPosition position;
AxisDimension dim;
bool showLabels = true;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs
index 28366ed5eb..f7caa76582 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/BasicChart.cs
@@ -28,14 +28,132 @@
using System;
using System.Collections;
-using System.Collections.Generic;
using Gtk;
using Gdk;
-using Mono.TextEditor;
+using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.Components.Chart
{
- public class BasicChart: DrawingArea
+ public class BasicChart: Control
+ {
+ ChartWidget widget;
+
+ public BasicChart ()
+ {
+ widget = new ChartWidget ();
+ }
+
+ protected override object CreateNativeWidget<T> ()
+ {
+ return widget;
+ }
+
+ protected internal virtual void OnSelectionChanged ()
+ {
+ if (SelectionChanged != null)
+ SelectionChanged (this, EventArgs.Empty);
+ }
+
+ public event EventHandler SelectionChanged;
+
+ public bool AllowSelection {
+ get { return widget.AllowSelection; }
+ set { widget.AllowSelection = value; }
+ }
+
+ public ChartCursor SelectionStart {
+ get { return widget.SelectionStart; }
+ }
+
+ public ChartCursor SelectionEnd {
+ get { return widget.SelectionEnd; }
+ }
+
+ public ChartCursor ActiveCursor {
+ get { return widget.ActiveCursor; }
+ }
+ public bool ReverseXAxis {
+ get { return widget.ReverseXAxis; }
+ set { widget.ReverseXAxis = value; }
+ }
+
+ public bool ReverseYAxis {
+ get { return widget.ReverseYAxis; }
+ set { widget.ReverseYAxis = value; }
+ }
+
+ public double OriginX {
+ get { return widget.OriginX; }
+ set { widget.OriginX = value; }
+ }
+
+ public double OriginY {
+ get { return widget.OriginY; }
+ set { widget.OriginY = value; }
+ }
+
+ public double StartX {
+ get { return widget.StartX; }
+ set { widget.StartX = value; }
+ }
+
+ public double EndX {
+ get { return widget.EndX; }
+ set { widget.EndX = value; }
+ }
+
+ public double StartY {
+ get { return widget.StartY; }
+ set { widget.StartY = value; }
+ }
+
+ public double EndY {
+ get { return widget.EndY; }
+ set { widget.EndY = value; }
+ }
+
+ public void Reset ()
+ {
+ widget.Reset ();
+ }
+
+ public void AddAxis (Axis ax, AxisPosition position)
+ {
+ widget.AddAxis (ax, position);
+ }
+
+ public void AddSerie (Serie serie)
+ {
+ widget.AddSerie (serie);
+ }
+
+ public void RemoveSerie (Serie serie)
+ {
+ widget.RemoveSerie (serie);
+ }
+
+ public void AddCursor (ChartCursor cursor, AxisDimension dimension)
+ {
+ widget.AddCursor (cursor, dimension);
+ }
+
+ public void RemoveCursor (ChartCursor cursor)
+ {
+ widget.RemoveCursor (cursor);
+ }
+
+ public void SetAutoScale (AxisDimension ad, bool autoStart, bool autoEnd)
+ {
+ widget.SetAutoScale (ad, autoStart, autoEnd);
+ }
+
+ public void Clear ()
+ {
+ widget.Clear ();
+ }
+ }
+
+ class ChartWidget : DrawingArea
{
double startX, endX;
double startY, endY;
@@ -69,8 +187,9 @@ namespace MonoDevelop.Components.Chart
ChartCursor selectionStart;
ChartCursor selectionEnd;
-
- public BasicChart ()
+ BasicChart chart;
+
+ public ChartWidget ()
{
this.Events = EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask;
selectionStart = new ChartCursor ();
@@ -82,9 +201,12 @@ namespace MonoDevelop.Components.Chart
selectionStart.ValueChanged += new EventHandler (OnSelectionCursorChanged);
selectionEnd.ValueChanged += new EventHandler (OnSelectionCursorChanged);
}
-
- public event EventHandler SelectionChanged;
-
+
+ internal void Initialize (BasicChart owner)
+ {
+ chart = owner;
+ }
+
public bool AllowSelection {
get {
return enableSelection;
@@ -409,6 +531,8 @@ namespace MonoDevelop.Components.Chart
if (backgroundDisplay == BackgroundDisplay.Gradient) {
ctx.Rectangle (left - 1, top - 1, width + 2, height + 2);
+
+ // FIXME: VV: Remove gradient features
using (var pat = new Cairo.LinearGradient (left - 1, top - 1, left - 1, height + 2)) {
pat.AddColorStop (0, backroundColor);
Cairo.Color endc = new Cairo.Color (1,1,1);
@@ -506,7 +630,7 @@ namespace MonoDevelop.Components.Chart
if (showLabels) {
layout = new Pango.Layout (this.PangoContext);
- layout.FontDescription = Pango.FontDescription.FromString ("Tahoma 8");
+ layout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11);
}
bool isX = pos == AxisPosition.Top || pos == AxisPosition.Bottom;
@@ -577,9 +701,9 @@ namespace MonoDevelop.Components.Chart
win.DrawLine (gc, px, top + height, px, top + height - tick);
}
}
- else {
- if (Math.Abs ((long)lastPos - (long)py) < minTickStep || py < top || py > top + height)
- continue;
+ else {
+ if (Math.Abs ((long)lastPos - (long)py) < minTickStep || py < top || py > top + height)
+ continue;
lastPos = py;
bool labelFits = false;
@@ -642,7 +766,7 @@ namespace MonoDevelop.Components.Chart
{
int max = 0;
Pango.Layout layout = new Pango.Layout (this.PangoContext);
- layout.FontDescription = Pango.FontDescription.FromString ("Tahoma 8");
+ layout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11);
double start = GetStart (ad);
double end = GetEnd (ad);
@@ -753,7 +877,7 @@ namespace MonoDevelop.Components.Chart
if (text != null && text.Length > 0) {
Pango.Layout layout = new Pango.Layout (this.PangoContext);
- layout.FontDescription = Pango.FontDescription.FromString ("Tahoma 8");
+ layout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11);
layout.SetMarkup (text);
int tw, th;
@@ -780,32 +904,32 @@ namespace MonoDevelop.Components.Chart
}
void GetPoint (double wx, double wy, out double x, out double y)
- {
- unchecked {
- if (reverseXAxis)
- x = left + width - (((wx - startX) * ((double) width)) / (endX - startX));
- else
- x = left + (((wx - startX) * ((double) width)) / (endX - startX));
-
- if (reverseYAxis)
- y = top + ((wy - startY) * ((double) height) / (endY - startY));
- else
- y = top + height - ((wy - startY) * ((double) height) / (endY - startY));
+ {
+ unchecked {
+ if (reverseXAxis)
+ x = left + width - (((wx - startX) * ((double) width)) / (endX - startX));
+ else
+ x = left + (((wx - startX) * ((double) width)) / (endX - startX));
+
+ if (reverseYAxis)
+ y = top + ((wy - startY) * ((double) height) / (endY - startY));
+ else
+ y = top + height - ((wy - startY) * ((double) height) / (endY - startY));
}
}
void GetValue (int x, int y, out double wx, out double wy)
- {
- unchecked {
- if (reverseXAxis)
- wx = startX + ((double) (left + width - 1 - x)) * (endX - startX) / (double) width;
- else
- wx = startX + ((double) (x - left)) * (endX - startX) / (double) width;
-
- if (reverseYAxis)
- wy = startY + ((double) (top + y)) * (endY - startY) / (double) height;
- else
- wy = startY + ((double) (top + height - y - 1)) * (endY - startY) / (double) height;
+ {
+ unchecked {
+ if (reverseXAxis)
+ wx = startX + ((double) (left + width - 1 - x)) * (endX - startX) / (double) width;
+ else
+ wx = startX + ((double) (x - left)) * (endX - startX) / (double) width;
+
+ if (reverseYAxis)
+ wy = startY + ((double) (top + y)) * (endY - startY) / (double) height;
+ else
+ wy = startY + ((double) (top + height - y - 1)) * (endY - startY) / (double) height;
}
}
@@ -832,7 +956,10 @@ namespace MonoDevelop.Components.Chart
selectionStart = selectionEnd;
selectionEnd = tmp;
}
- OnSelectionChanged ();
+
+ if (chart != null) {
+ chart.OnSelectionChanged ();
+ }
}
}
@@ -914,12 +1041,6 @@ namespace MonoDevelop.Components.Chart
yrangeChanged = true;
base.OnSizeAllocated (rect);
}
-
- protected virtual void OnSelectionChanged ()
- {
- if (SelectionChanged != null)
- SelectionChanged (this, EventArgs.Empty);
- }
}
public enum BackgroundDisplay
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/Serie.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/Serie.cs
index 45475ee559..16869cfc03 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/Serie.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Chart/Serie.cs
@@ -37,7 +37,7 @@ namespace MonoDevelop.Components.Chart
string title;
List<Data> dataArray = new List<Data> ();
bool visible = true;
- internal BasicChart Owner;
+ internal ChartWidget Owner;
Cairo.Color color;
bool extendBoundingValues;
DisplayMode mode;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands.ExtensionNodes/LinkItemCodon.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands.ExtensionNodes/LinkItemCodon.cs
index c4b35fde16..9f6e479a98 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands.ExtensionNodes/LinkItemCodon.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands.ExtensionNodes/LinkItemCodon.cs
@@ -53,7 +53,7 @@ namespace MonoDevelop.Components.Commands.ExtensionNodes
public override object CreateInstance ()
{
// FIXME: Use internal resource
- return new LinkCommandEntry (label, link, "md-web-search-icon");
+ return new LinkCommandEntry (label, link, "md-web-search");
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandEntry.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandEntry.cs
index 00d9cb82ef..b908b5078f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandEntry.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandEntry.cs
@@ -76,7 +76,7 @@ namespace MonoDevelop.Components.Commands
set { disabledVisible = value; }
}
- public CommandEntryDisplayType DispayType {
+ public CommandEntryDisplayType DisplayType {
get;
set;
}
@@ -92,12 +92,12 @@ namespace MonoDevelop.Components.Commands
return manager.GetCommand (cmdId);
}
- internal protected virtual Gtk.MenuItem CreateMenuItem (CommandManager manager)
+ internal virtual Gtk.MenuItem CreateMenuItem (CommandManager manager)
{
return CreateMenuItem (manager, GetCommand (manager), cmdId, true, overrideLabel, disabledVisible);
}
- internal protected virtual Gtk.ToolItem CreateToolItem (CommandManager manager)
+ internal virtual Gtk.ToolItem CreateToolItem (CommandManager manager)
{
if (cmdId == CommandManager.ToCommandId (Command.Separator))
return new Gtk.SeparatorToolItem ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandEntrySet.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandEntrySet.cs
index 40647d07a6..2514b416bc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandEntrySet.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandEntrySet.cs
@@ -112,7 +112,7 @@ namespace MonoDevelop.Components.Commands
get { return cmds.Count; }
}
- internal protected override Gtk.MenuItem CreateMenuItem (CommandManager manager)
+ internal override Gtk.MenuItem CreateMenuItem (CommandManager manager)
{
Gtk.MenuItem mi;
if (autoHide)
@@ -123,7 +123,7 @@ namespace MonoDevelop.Components.Commands
return mi;
}
- internal protected override Gtk.ToolItem CreateToolItem (CommandManager manager)
+ internal override Gtk.ToolItem CreateToolItem (CommandManager manager)
{
Gtk.Menu menu = manager.CreateMenu (this);
return new MenuToolButton (menu, icon);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandFrame.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandFrame.cs
index 836250a967..d29c426593 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandFrame.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandFrame.cs
@@ -26,50 +26,15 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
-using Mono.Addins;
-using MonoDevelop.Components.DockToolbars;
-using Mono.TextEditor;
+using Gtk;
namespace MonoDevelop.Components.Commands
{
- public class CommandFrame: DockToolbarFrame
+ class CommandFrame: EventBox
{
- CommandManager manager;
-
public CommandFrame (CommandManager manager)
{
- this.manager = manager;
manager.RegisterGlobalHandler (this);
}
-
- [CommandHandler (CommandSystemCommands.ToolbarList)]
- protected void OnViewToolbar (object ob)
- {
- IDockToolbar bar = (IDockToolbar) ob;
- bar.Visible = !bar.Visible;
- }
-
- [CommandUpdateHandler (CommandSystemCommands.ToolbarList)]
- protected void OnUpdateViewToolbar (CommandArrayInfo info)
- {
- foreach (IDockToolbar bar in Toolbars) {
- CommandInfo cmd = new CommandInfo (bar.Title);
- cmd.Checked = bar.Visible;
- cmd.Description = AddinManager.CurrentLocalizer.GetString ("Show toolbar '{0}'", bar.Title);
- info.Add (cmd, bar);
- }
- }
-
- protected override void OnPanelClick (Gdk.EventButton e, Placement placement)
- {
- if (e.TriggersContextMenu ()) {
- CommandEntrySet opset = new CommandEntrySet ();
- opset.AddItem (CommandSystemCommands.ToolbarList);
- Gtk.Menu menu = manager.CreateMenu (opset);
- menu.Popup (null, null, null, 0, e.Time);
- }
- base.OnPanelClick (e, placement);
- }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandHandler.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandHandler.cs
index af0bb209c3..d754979491 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandHandler.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandHandler.cs
@@ -32,11 +32,6 @@ namespace MonoDevelop.Components.Commands
{
public abstract class CommandHandler
{
- internal void InternalRun ()
- {
- Run ();
- }
-
internal void InternalRun (object dataItem)
{
Run (dataItem);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs
index 12296f22e9..922553141d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs
@@ -31,10 +31,10 @@ using System;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using MonoDevelop.Components.Commands.ExtensionNodes;
-using Mono.TextEditor;
using Mono.Addins;
using MonoDevelop.Core;
using MonoDevelop.Ide;
@@ -61,8 +61,6 @@ namespace MonoDevelop.Components.Commands
LinkedList<Gtk.Window> topLevelWindows = new LinkedList<Gtk.Window> ();
Stack delegatorStack = new Stack ();
- List<Gtk.Window> activeWindowStack = new List<Gtk.Window> ();
-
HashSet<object> visitedTargets = new HashSet<object> ();
bool disposed;
@@ -85,9 +83,10 @@ namespace MonoDevelop.Components.Commands
{
}
- public CommandManager (Gtk.Window root)
+ public CommandManager (Window root)
{
- rootWidget = root;
+ if (root != null)
+ rootWidget = root;
bindings = new KeyBindingManager ();
ActionCommand c = new ActionCommand (CommandSystemCommands.ToolbarList, "Toolbar List", null, null, ActionType.Check);
c.CommandArray = true;
@@ -134,38 +133,13 @@ namespace MonoDevelop.Components.Commands
/// <summary>
/// Creates a menu bar from the menu definition at the provided extension path
/// </summary>
- public Gtk.MenuBar CreateMenuBar (string addinPath)
+ internal Gtk.MenuBar CreateMenuBar (string addinPath)
{
CommandEntrySet cset = CreateCommandEntrySet (addinPath);
return CreateMenuBar (addinPath, cset);
}
/// <summary>
- /// Creates a set of toolbars from the provided extension path
- /// </summary>
- public Gtk.Toolbar[] CreateToolbarSet (string addinPath)
- {
- ArrayList bars = new ArrayList ();
-
- CommandEntrySet cset = CreateCommandEntrySet (addinPath);
- foreach (CommandEntry ce in cset) {
- CommandEntrySet ces = ce as CommandEntrySet;
- if (ces != null)
- bars.Add (CreateToolbar (addinPath + "/" + ces.CommandId, ces));
- }
- return (Gtk.Toolbar[]) bars.ToArray (typeof(Gtk.Toolbar));
- }
-
- /// <summary>
- /// Creates a toolbar from the provided extension path
- /// </summary>
- public Gtk.Toolbar CreateToolbar (string addinPath)
- {
- CommandEntrySet cset = CreateCommandEntrySet (addinPath);
- return CreateToolbar (addinPath, cset);
- }
-
- /// <summary>
/// Creates a menu from the provided extension path
/// </summary>
public Gtk.Menu CreateMenu (string addinPath)
@@ -186,7 +160,7 @@ namespace MonoDevelop.Components.Commands
/// <param name='addinPath'>
/// Extension path to the definition of the menu
/// </param>
- public void ShowContextMenu (Gtk.Widget parent, Gdk.EventButton evt, string addinPath)
+ public void ShowContextMenu (Control parent, Gdk.EventButton evt, string addinPath)
{
ShowContextMenu (parent, evt, CreateCommandEntrySet (addinPath));
}
@@ -206,7 +180,7 @@ namespace MonoDevelop.Components.Commands
/// <param name='addinPath'>
/// Extension path to the definition of the menu
/// </param>
- public void ShowContextMenu (Gtk.Widget parent, Gdk.EventButton evt,
+ public void ShowContextMenu (Control parent, Gdk.EventButton evt,
ExtensionContext ctx, string addinPath)
{
ShowContextMenu (parent, evt, CreateCommandEntrySet (ctx, addinPath));
@@ -354,6 +328,19 @@ namespace MonoDevelop.Components.Commands
e.RetVal = ProcessKeyEvent (e.Event);
}
+ [GLib.ConnectBefore]
+ void OnKeyReleased (object o, Gtk.KeyReleaseEventArgs e)
+ {
+ bool complete;
+ // KeyboardShortcut[] accels =
+ KeyBindingManager.AccelsFromKey (e.Event, out complete);
+
+ if (!complete) {
+ // incomplete accel
+ NotifyIncompleteKeyReleased (e.Event);
+ }
+ }
+
internal bool ProcessKeyEvent (Gdk.EventKey ev)
{
if (!IsEnabled)
@@ -366,6 +353,7 @@ namespace MonoDevelop.Components.Commands
if (!complete) {
// incomplete accel
+ NotifyIncompleteKeyPressed (ev);
return true;
}
@@ -434,11 +422,23 @@ namespace MonoDevelop.Components.Commands
if (KeyPressed != null)
KeyPressed (this, new KeyPressArgs () { Key = ev.Key, KeyValue = ev.KeyValue, Modifiers = ev.State });
}
+
+ void NotifyIncompleteKeyPressed (Gdk.EventKey ev)
+ {
+ if (IncompleteKeyPressed != null)
+ IncompleteKeyPressed (this, new KeyPressArgs () { Key = ev.Key, KeyValue = ev.KeyValue, Modifiers = ev.State });
+ }
+
+ void NotifyIncompleteKeyReleased (Gdk.EventKey ev)
+ {
+ if (IncompleteKeyReleased != null)
+ IncompleteKeyReleased (this, new KeyPressArgs () { Key = ev.Key, KeyValue = ev.KeyValue, Modifiers = ev.State });
+ }
/// <summary>
/// Sets the root window. The manager will start the command route at this window, if no other is active.
/// </summary>
- public void SetRootWindow (Gtk.Window root)
+ public void SetRootWindow (Window root)
{
if (rootWidget != null)
rootWidget.KeyPressEvent -= OnKeyPressed;
@@ -470,6 +470,7 @@ namespace MonoDevelop.Components.Commands
} else {
topLevelWindows.AddFirst (win);
win.KeyPressEvent += OnKeyPressed;
+ win.KeyReleaseEvent += OnKeyReleased;
win.ButtonPressEvent += HandleButtonPressEvent;
win.Destroyed += TopLevelDestroyed;
}
@@ -488,6 +489,7 @@ namespace MonoDevelop.Components.Commands
Gtk.Window w = (Gtk.Window) o;
w.Destroyed -= TopLevelDestroyed;
w.KeyPressEvent -= OnKeyPressed;
+ w.KeyReleaseEvent -= OnKeyReleased;
w.ButtonPressEvent -= HandleButtonPressEvent;
topLevelWindows.Remove (w);
if (w == lastFocused)
@@ -637,6 +639,8 @@ namespace MonoDevelop.Components.Commands
public void UnregisterCommandTargetVisitor (ICommandTargetVisitor visitor)
{
visitors.Remove (visitor);
+
+ StopStatusUpdaterIfNeeded ();
}
/// <summary>
@@ -694,7 +698,7 @@ namespace MonoDevelop.Components.Commands
/// <param name='entrySet'>
/// Entry set with the definition of the commands to be included in the menu bar
/// </param>
- public Gtk.MenuBar CreateMenuBar (string name, CommandEntrySet entrySet)
+ internal Gtk.MenuBar CreateMenuBar (string name, CommandEntrySet entrySet)
{
Gtk.MenuBar topMenu = new CommandMenuBar (this);
foreach (CommandEntry entry in entrySet) {
@@ -725,7 +729,7 @@ namespace MonoDevelop.Components.Commands
/// <param name='menu'>
/// The menu where to add the commands
/// </param>
- public Gtk.Menu CreateMenu (CommandEntrySet entrySet, CommandMenu menu)
+ internal Gtk.Menu CreateMenu (CommandEntrySet entrySet, CommandMenu menu)
{
foreach (CommandEntry entry in entrySet) {
Gtk.MenuItem mi = entry.CreateMenuItem (this);
@@ -878,7 +882,7 @@ namespace MonoDevelop.Components.Commands
/// <param name='initialCommandTarget'>
/// Initial command route target. The command handler will start looking for command handlers in this object.
/// </param>
- public bool ShowContextMenu (Gtk.Widget parent, Gdk.EventButton evt, CommandEntrySet entrySet,
+ public bool ShowContextMenu (Control parent, Gdk.EventButton evt, CommandEntrySet entrySet,
object initialCommandTarget = null)
{
return ShowContextMenu (parent, evt, entrySet, initialCommandTarget, null);
@@ -902,11 +906,11 @@ namespace MonoDevelop.Components.Commands
/// <param name='closeHandler'>
/// An event handler which will be called when the menu closes
/// </param>
- public bool ShowContextMenu (Gtk.Widget parent, Gdk.EventButton evt, CommandEntrySet entrySet,
+ public bool ShowContextMenu (Control parent, Gdk.EventButton evt, CommandEntrySet entrySet,
object initialCommandTarget, EventHandler closeHandler)
{
#if MAC
- var menu = CreateNSMenu (entrySet, initialCommandTarget, closeHandler);
+ var menu = CreateNSMenu (entrySet, initialCommandTarget ?? parent, closeHandler);
ContextMenuExtensionsMac.ShowContextMenu (parent, evt, menu);
#else
var menu = CreateMenu (entrySet, closeHandler);
@@ -925,11 +929,11 @@ namespace MonoDevelop.Components.Commands
/// <param name="y">The y coordinate.</param>
/// <param name="entrySet">Entry set with the command definitions</param>
/// <param name="initialCommandTarget">Initial command target.</param>
- public bool ShowContextMenu (Gtk.Widget parent, int x, int y, CommandEntrySet entrySet,
+ public bool ShowContextMenu (Control parent, int x, int y, CommandEntrySet entrySet,
object initialCommandTarget = null)
{
#if MAC
- var menu = CreateNSMenu (entrySet, initialCommandTarget);
+ var menu = CreateNSMenu (entrySet, initialCommandTarget ?? parent);
ContextMenuExtensionsMac.ShowContextMenu (parent, x, y, menu);
#else
var menu = CreateMenu (entrySet);
@@ -955,107 +959,27 @@ namespace MonoDevelop.Components.Commands
/// <param name='initialCommandTarget'>
/// Initial command route target. The command handler will start looking for command handlers in this object.
/// </param>
- public void ShowContextMenu (Gtk.Widget parent, Gdk.EventButton evt, Gtk.Menu menu,
+ public void ShowContextMenu (Control parent, Gdk.EventButton evt, Gtk.Menu menu,
object initialCommandTarget = null)
{
if (menu is CommandMenu) {
((CommandMenu)menu).InitialCommandTarget = initialCommandTarget ?? parent;
}
-
- Mono.TextEditor.GtkWorkarounds.ShowContextMenu (menu, parent, evt);
+
+ MonoDevelop.Components.GtkWorkarounds.ShowContextMenu (menu, parent, evt);
}
- public void ShowContextMenu (Gtk.Widget parent, int x, int y, Gtk.Menu menu,
+ public void ShowContextMenu (Control parent, int x, int y, Gtk.Menu menu,
object initialCommandTarget = null)
{
if (menu is CommandMenu) {
((CommandMenu)menu).InitialCommandTarget = initialCommandTarget ?? parent;
}
- Mono.TextEditor.GtkWorkarounds.ShowContextMenu (menu, parent, x, y);
+ MonoDevelop.Components.GtkWorkarounds.ShowContextMenu (menu, parent, x, y);
}
/// <summary>
- /// Creates a toolbar.
- /// </summary>
- /// <returns>
- /// The toolbar.
- /// </returns>
- /// <param name='entrySet'>
- /// Entry with the command definitions
- /// </param>
- public Gtk.Toolbar CreateToolbar (CommandEntrySet entrySet)
- {
- return CreateToolbar ("", entrySet, null);
- }
-
- /// <summary>
- /// Creates a toolbar.
- /// </summary>
- /// <returns>
- /// The toolbar.
- /// </returns>
- /// <param name='entrySet'>
- /// Entry with the command definitions
- /// </param>
- /// <param name='initialTarget'>
- /// Initial command route target. The command handler will start looking for command handlers in this object.
- /// </param>
- public Gtk.Toolbar CreateToolbar (CommandEntrySet entrySet, object initialTarget)
- {
- return CreateToolbar ("", entrySet, initialTarget);
- }
-
- /// <summary>
- /// Creates a toolbar.
- /// </summary>
- /// <returns>
- /// The toolbar.
- /// </returns>
- /// <param name='id'>
- /// Identifier of the toolbar
- /// </param>
- /// <param name='entrySet'>
- /// Entry with the command definitions
- /// </param>
- public Gtk.Toolbar CreateToolbar (string id, CommandEntrySet entrySet)
- {
- return CreateToolbar (id, entrySet, null);
- }
-
- /// <summary>
- /// Creates a toolbar.
- /// </summary>
- /// <returns>
- /// The toolbar.
- /// </returns>
- /// <param name='id'>
- /// Identifier of the toolbar
- /// </param>
- /// <param name='entrySet'>
- /// Entry with the command definitions
- /// </param>
- /// <param name='initialTarget'>
- /// Initial command route target. The command handler will start looking for command handlers in this object.
- /// </param>
- public Gtk.Toolbar CreateToolbar (string id, CommandEntrySet entrySet, object initialTarget)
- {
- CommandToolbar toolbar = new CommandToolbar (this, id, entrySet.Name);
- toolbar.InitialCommandTarget = initialTarget;
-
- foreach (CommandEntry entry in entrySet) {
- Gtk.ToolItem ti = entry.CreateToolItem (this);
- CustomItem ci = ti.Child as CustomItem;
- if (ci != null)
- ci.SetToolbarStyle (toolbar);
- toolbar.Add (ti);
- }
- ToolbarTracker tt = new ToolbarTracker ();
- tt.Track (toolbar);
- return toolbar;
- }
-
- /// <summary>
/// Dispatches a command.
/// </summary>
/// <returns>
@@ -1410,6 +1334,8 @@ namespace MonoDevelop.Components.Commands
info.Visible = true;
return info;
}
+ if (info.Enabled && !info.Bypass)
+ return info;
continue;
}
else if (!bypass && typeInfo.GetCommandHandler (commandId) != null) {
@@ -1770,7 +1696,7 @@ namespace MonoDevelop.Components.Commands
cmdTarget = null;
if (cmdTarget == null || !visitedTargets.Add (cmdTarget)) {
- if (delegatorStack.Count > 0) {
+ while (delegatorStack.Count > 0) {
var del = delegatorStack.Pop ();
if (del is ICommandDelegatorRouter)
cmdTarget = ((ICommandDelegatorRouter)del).GetNextCommandTarget ();
@@ -1820,7 +1746,7 @@ namespace MonoDevelop.Components.Commands
}
}
}
-
+
lastFocused = newFocused;
UpdateAppFocusStatus (hasFocus, lastFocusedExists);
@@ -1934,6 +1860,8 @@ namespace MonoDevelop.Components.Commands
newWait = 500;
else if (secs < 30)
newWait = 700;
+ else if (appHasFocus)
+ newWait = 2000;
else {
// The application seems to be idle. Stop the status updater and
// start a pasive wait for user interaction
@@ -1962,6 +1890,14 @@ namespace MonoDevelop.Components.Commands
toolbarUpdaterRunning = true;
}
}
+
+ void StopStatusUpdaterIfNeeded ()
+ {
+ if (toolbars.Count != 0 || visitors.Count != 0)
+ return;
+
+ StopStatusUpdater ();
+ }
void StopStatusUpdater ()
{
@@ -1978,8 +1914,10 @@ namespace MonoDevelop.Components.Commands
waitingForUserInteraction = true;
toolbarUpdaterRunning = false;
- foreach (var win in topLevelWindows)
+ foreach (var win in topLevelWindows) {
win.MotionNotifyEvent += HandleWinMotionNotifyEvent;
+ win.FocusInEvent += HandleFocusInEventHandler;
+ }
}
void EndWaitingForUserInteraction ()
@@ -1987,8 +1925,10 @@ namespace MonoDevelop.Components.Commands
if (!waitingForUserInteraction)
return;
waitingForUserInteraction = false;
- foreach (var win in topLevelWindows)
+ foreach (var win in topLevelWindows) {
win.MotionNotifyEvent -= HandleWinMotionNotifyEvent;
+ win.FocusInEvent -= HandleFocusInEventHandler;
+ }
StartStatusUpdater ();
}
@@ -2001,6 +1941,11 @@ namespace MonoDevelop.Components.Commands
}
}
+ void HandleFocusInEventHandler (object o, Gtk.FocusInEventArgs args)
+ {
+ RegisterUserInteraction ();
+ }
+
void HandleWinMotionNotifyEvent (object o, Gtk.MotionNotifyEventArgs args)
{
RegisterUserInteraction ();
@@ -2023,6 +1968,8 @@ namespace MonoDevelop.Components.Commands
public void UnregisterCommandBar (ICommandBar commandBar)
{
toolbars.Remove (commandBar);
+
+ StopStatusUpdaterIfNeeded ();
}
void UpdateToolbars ()
@@ -2145,6 +2092,16 @@ namespace MonoDevelop.Components.Commands
public event EventHandler<KeyPressArgs> KeyPressed;
/// <summary>
+ /// Occurs when incomplete key is pressed.
+ /// </summary>
+ public event EventHandler<KeyPressArgs> IncompleteKeyPressed;
+
+ /// <summary>
+ /// Occurs when incomplete key is released.
+ /// </summary>
+ public event EventHandler<KeyPressArgs> IncompleteKeyReleased;
+
+ /// <summary>
/// Occurs when active widget (the current command target) changes
/// </summary>
public event EventHandler<ActiveWidgetEventArgs> ActiveWidgetChanged;
@@ -2153,8 +2110,8 @@ namespace MonoDevelop.Components.Commands
public class ActiveWidgetEventArgs: EventArgs
{
- public Gtk.Widget OldActiveWidget { get; internal set; }
- public Gtk.Widget NewActiveWidget { get; internal set; }
+ public Control OldActiveWidget { get; internal set; }
+ public Control NewActiveWidget { get; internal set; }
}
internal class HandlerTypeInfo
@@ -2289,24 +2246,24 @@ namespace MonoDevelop.Components.Commands
if (customHandlerChain != null) {
info.UpdateHandlerData = Method;
- DateTime t = DateTime.Now;
+ var sw = Stopwatch.StartNew ();
customHandlerChain.CommandUpdate (cmdTarget, info);
- var time = DateTime.Now - t;
- if (time.TotalMilliseconds > CommandManager.SlowCommandWarningTime)
- LoggingService.LogWarning ("Slow command update ({0}ms): Command:{1}, CustomUpdater:{2}", (int)time.TotalMilliseconds, CommandId, customHandlerChain);
+ sw.Stop ();
+ if (sw.ElapsedMilliseconds > CommandManager.SlowCommandWarningTime)
+ LoggingService.LogWarning ("Slow command update ({0}ms): Command:{1}, CustomUpdater:{2}, CommandTargetType:{3}", (int)sw.ElapsedMilliseconds, CommandId, customHandlerChain, cmdTarget.GetType ());
} else {
if (Method == null)
throw new InvalidOperationException ("Invalid custom update handler. An implementation of ICommandUpdateHandler was expected.");
if (isArray)
throw new InvalidOperationException ("Invalid signature for command update handler: " + Method.DeclaringType + "." + Method.Name + "()");
- DateTime t = DateTime.Now;
+ var sw = Stopwatch.StartNew ();
Method.Invoke (cmdTarget, new object[] {info} );
- var time = DateTime.Now - t;
- if (time.TotalMilliseconds > CommandManager.SlowCommandWarningTime)
- LoggingService.LogWarning ("Slow command update ({0}ms): Command:{1}, Method:{2}", (int)time.TotalMilliseconds, CommandId, Method.DeclaringType + "." + Method.Name);
+ sw.Stop ();
+ if (sw.ElapsedMilliseconds > CommandManager.SlowCommandWarningTime)
+ LoggingService.LogWarning ("Slow command update ({0}ms): Command:{1}, Method:{2}, CommandTargetType:{3}", (int)sw.ElapsedMilliseconds, CommandId, Method.DeclaringType + "." + Method.Name, cmdTarget.GetType ());
}
}
@@ -2321,13 +2278,13 @@ namespace MonoDevelop.Components.Commands
if (!isArray)
throw new InvalidOperationException ("Invalid signature for command update handler: " + Method.DeclaringType + "." + Method.Name + "()");
- DateTime t = DateTime.Now;
+ var sw = Stopwatch.StartNew ();
- Method.Invoke (cmdTarget, new object[] {info} );
-
- var time = DateTime.Now - t;
- if (time.TotalMilliseconds > CommandManager.SlowCommandWarningTime)
- LoggingService.LogWarning ("Slow command update ({0}ms): Command:{1}, Method:{2}", (int)time.TotalMilliseconds, CommandId, Method.DeclaringType + "." + Method.Name);
+ Method.Invoke (cmdTarget, new object[] {info} );
+
+ sw.Stop ();
+ if (sw.ElapsedMilliseconds > CommandManager.SlowCommandWarningTime)
+ LoggingService.LogWarning ("Slow command update ({0}ms): Command:{1}, Method:{2}, CommandTargetType:{3}", (int)sw.ElapsedMilliseconds, CommandId, Method.DeclaringType + "." + Method.Name, cmdTarget.GetType ());
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenu.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenu.cs
index dacd57d56a..22abd3aa5f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenu.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenu.cs
@@ -30,7 +30,7 @@ using System;
namespace MonoDevelop.Components.Commands
{
- public class CommandMenu: Gtk.Menu
+ class CommandMenu: Gtk.Menu
{
CommandEntrySet commandEntrySet;
CommandManager manager;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs
index 3030a5dcbc..3302f8da77 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuBar.cs
@@ -26,15 +26,11 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using Gtk;
-using Gdk;
-using MonoDevelop.Ide.Gui;
-using Mono.TextEditor;
namespace MonoDevelop.Components.Commands
{
- public class CommandMenuBar: Gtk.MenuBar
+ class CommandMenuBar: Gtk.MenuBar
{
CommandManager manager;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuItem.cs
index 4f9a63b7d2..040c278780 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuItem.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandMenuItem.cs
@@ -32,7 +32,7 @@ using MonoDevelop.Core;
namespace MonoDevelop.Components.Commands
{
- public class CommandMenuItem: Gtk.ImageMenuItem, ICommandMenuItem
+ class CommandMenuItem: Gtk.ImageMenuItem, ICommandMenuItem
{
CommandManager commandManager;
object commandId;
@@ -229,7 +229,7 @@ namespace MonoDevelop.Components.Commands
this.Visible = cmdInfo.Visible && (disabledVisible || cmdInfo.Enabled);
if (!cmdInfo.Icon.IsNull && cmdInfo.Icon != lastIcon) {
- Image = new Gtk.Image (cmdInfo.Icon, Gtk.IconSize.Menu);
+ Image = new ImageView (cmdInfo.Icon, Gtk.IconSize.Menu);
lastIcon = cmdInfo.Icon;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandRouterContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandRouterContainer.cs
index d6693f379e..bc9b1c1d7c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandRouterContainer.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandRouterContainer.cs
@@ -47,11 +47,13 @@ namespace MonoDevelop.Components.Commands
{
this.continueToParent = continueToParent;
}
-
- public CommandRouterContainer (Gtk.Widget child, object target, bool continueToParent) : this (continueToParent)
+
+ public CommandRouterContainer (Control child, object target, bool continueToParent) : this (continueToParent)
{
- if (child != null)
+ if (child != null) {
PackStart (child, true, true, 0);
+ child = null;
+ }
Delegated = target;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToggleToolButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToggleToolButton.cs
index f8b8ddf6a5..eb7d7d60ee 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToggleToolButton.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToggleToolButton.cs
@@ -31,7 +31,7 @@ using MonoDevelop.Core;
namespace MonoDevelop.Components.Commands
{
- public class CommandToggleToolButton: Gtk.ToggleToolButton, ICommandUserItem
+ class CommandToggleToolButton: Gtk.ToggleToolButton, ICommandUserItem
{
CommandManager commandManager;
object commandId;
@@ -74,6 +74,7 @@ namespace MonoDevelop.Components.Commands
}
IconId stockId = null;
+ ImageView iconWidget;
void Update (CommandInfo cmdInfo)
{
@@ -99,8 +100,10 @@ namespace MonoDevelop.Components.Commands
Label = cmdInfo.Text;
if (cmdInfo.Icon != stockId) {
stockId = cmdInfo.Icon;
- this.IconWidget = new Gtk.Image (cmdInfo.Icon, Gtk.IconSize.Menu);
+ this.IconWidget = iconWidget = new ImageView (cmdInfo.Icon, Gtk.IconSize.Menu);
}
+ if (IconWidget != null && cmdInfo.Enabled != Sensitive)
+ iconWidget.Image = iconWidget.Image.WithStyles (cmdInfo.Enabled ? "" : "disabled").WithAlpha (cmdInfo.Enabled ? 1.0 : 0.4);
if (cmdInfo.Enabled != Sensitive)
Sensitive = cmdInfo.Enabled;
if (cmdInfo.Visible != Visible)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolButton.cs
index e0577f0692..26e3d98df1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolButton.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolButton.cs
@@ -31,7 +31,7 @@ using MonoDevelop.Core;
namespace MonoDevelop.Components.Commands
{
- public class CommandToolButton: Gtk.ToolButton, ICommandUserItem
+ class CommandToolButton: Gtk.ToolButton, ICommandUserItem
{
CommandManager commandManager;
object commandId;
@@ -73,6 +73,7 @@ namespace MonoDevelop.Components.Commands
}
IconId stockId = null;
+ ImageView iconWidget;
void Update (CommandInfo cmdInfo)
{
@@ -91,8 +92,10 @@ namespace MonoDevelop.Components.Commands
Label = cmdInfo.Text;
if (cmdInfo.Icon != stockId) {
stockId = cmdInfo.Icon;
- this.IconWidget = new Gtk.Image (cmdInfo.Icon, Gtk.IconSize.Menu);
+ this.IconWidget = iconWidget = new ImageView (cmdInfo.Icon, Gtk.IconSize.Menu);
}
+ if (IconWidget != null && cmdInfo.Enabled != Sensitive)
+ iconWidget.Image = iconWidget.Image.WithStyles (cmdInfo.Enabled ? "" : "disabled").WithAlpha (cmdInfo.Enabled ? 1.0 : 0.4);
if (cmdInfo.Enabled != Sensitive)
Sensitive = cmdInfo.Enabled;
if (cmdInfo.Visible != Visible)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolbar.cs
deleted file mode 100644
index 320ebedb6e..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandToolbar.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// CommandToolbar.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using MonoDevelop.Components.DockToolbars;
-
-namespace MonoDevelop.Components.Commands
-{
- public class CommandToolbar: DockToolbar, ICommandBar
- {
- object initialCommandTarget;
-
- public CommandToolbar (CommandManager manager, string id, string title): base (id, title)
- {
- manager.RegisterCommandBar (this);
- }
-
- internal object InitialCommandTarget {
- get { return initialCommandTarget; }
- set { initialCommandTarget = value; }
- }
-
- protected override void OnShown ()
- {
- base.OnShown ();
- ((ICommandBar)this).Update (null);
- }
-
- void ICommandBar.Update (object defaultTarget)
- {
- if (!Visible)
- return;
-
- if (initialCommandTarget != null)
- defaultTarget = initialCommandTarget;
-
- CommandTargetRoute targetRoute = new CommandTargetRoute (defaultTarget);
- foreach (Gtk.Widget item in Children) {
- if (item is ICommandUserItem)
- ((ICommandUserItem)item).Update (targetRoute);
- else
- item.Show ();
- }
- }
-
- public void SetEnabled (bool enabled)
- {
- foreach (Gtk.Widget item in Children) {
- if (item.GetType () == typeof(Gtk.ToolItem))
- item.Sensitive = enabled;
- }
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/KeyBindingManager.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/KeyBindingManager.cs
index b4a590202b..3b460a0198 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/KeyBindingManager.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/KeyBindingManager.cs
@@ -26,10 +26,8 @@
//
using System;
-using System.Collections;
using System.Collections.Generic;
-using Mono.TextEditor;
// Terminology:
// chord: A 'chord' is a key binding prefix / modifier meant to allow a
@@ -84,15 +82,15 @@ namespace MonoDevelop.Components.Commands
#region Platform-dependent selection modifiers
//FIXME: these should be named for what they do, not what they are
- public static Gdk.ModifierType SelectionModifierAlt {
+ internal static Gdk.ModifierType SelectionModifierAlt {
get; private set;
}
- public static Gdk.ModifierType SelectionModifierControl {
+ internal static Gdk.ModifierType SelectionModifierControl {
get; private set;
}
- public static Gdk.ModifierType SelectionModifierSuper {
+ internal static Gdk.ModifierType SelectionModifierSuper {
get; private set;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/LinkCommandEntry.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/LinkCommandEntry.cs
index ec3c49e921..81b363675e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/LinkCommandEntry.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/LinkCommandEntry.cs
@@ -73,10 +73,10 @@ namespace MonoDevelop.Components.Commands
}
}
- internal protected override Gtk.MenuItem CreateMenuItem (CommandManager manager)
+ internal override Gtk.MenuItem CreateMenuItem (CommandManager manager)
{
Gtk.ImageMenuItem item = new Gtk.ImageMenuItem (text != null ? text : url);
- item.Image = new Gtk.Image (icon, Gtk.IconSize.Menu);
+ item.Image = new ImageView (icon, Gtk.IconSize.Menu);
item.Activated += new EventHandler (HandleActivation);
item.Selected += delegate {
CommandInfo ci = new CommandInfo (Text);
@@ -90,7 +90,7 @@ namespace MonoDevelop.Components.Commands
return item;
}
- internal protected override Gtk.ToolItem CreateToolItem (CommandManager manager)
+ internal override Gtk.ToolItem CreateToolItem (CommandManager manager)
{
Gtk.ToolButton item = new Gtk.ToolButton (text);
item.StockId = icon;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/MenuToolButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/MenuToolButton.cs
index 1524a03214..737c3694ea 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/MenuToolButton.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/MenuToolButton.cs
@@ -30,7 +30,7 @@ using System;
namespace MonoDevelop.Components.Commands
{
- public class MenuToolButton: Gtk.ToolButton
+ internal class MenuToolButton: Gtk.ToolButton
{
Gtk.Menu menu;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
index c293fd3b81..cb54ea9035 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
@@ -52,6 +52,7 @@ namespace MonoDevelop.Components.DockNotebook
static List<DockNotebook> allNotebooks = new List<DockNotebook> ();
public static event EventHandler ActiveNotebookChanged;
+ public static event EventHandler NotebookChanged;
enum TargetList {
UriList = 100
@@ -237,7 +238,6 @@ namespace MonoDevelop.Components.DockNotebook
void OnDragDataReceived (object o, Gtk.DragDataReceivedArgs args)
{
- Console.WriteLine ("received");
if (args.Info != (uint) TargetList.UriList)
return;
string fullData = System.Text.Encoding.UTF8.GetString (args.SelectionData.Data);
@@ -315,6 +315,8 @@ namespace MonoDevelop.Components.DockNotebook
if (PageAdded != null)
PageAdded (this, EventArgs.Empty);
+ NotebookChanged?.Invoke (this, EventArgs.Empty);
+
return tab;
}
@@ -349,6 +351,8 @@ namespace MonoDevelop.Components.DockNotebook
if (PageRemoved != null)
PageRemoved (this, EventArgs.Empty);
+
+ NotebookChanged?.Invoke (this, EventArgs.Empty);
}
internal void ReorderTab (DockNotebookTab tab, DockNotebookTab targetTab)
@@ -395,6 +399,7 @@ namespace MonoDevelop.Components.DockNotebook
protected override void OnDestroyed ()
{
allNotebooks.Remove (this);
+
if (ActiveNotebook == this)
ActiveNotebook = null;
if (fleurCursor != null) {
@@ -404,4 +409,13 @@ namespace MonoDevelop.Components.DockNotebook
base.OnDestroyed ();
}
}
+
+ class DockNotebookChangedArgs : EventArgs
+ {
+ public DockNotebook Notebook { get; private set; }
+ public DockNotebookChangedArgs (DockNotebook notebook)
+ {
+ Notebook = notebook;
+ }
+ }
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebookTab.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebookTab.cs
index acb889234c..0fb5f62cab 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebookTab.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebookTab.cs
@@ -40,7 +40,7 @@ namespace MonoDevelop.Components.DockNotebook
Widget content;
internal Gdk.Rectangle Allocation;
- internal Gdk.Rectangle CloseButtonAllocation;
+ internal Cairo.Rectangle CloseButtonActiveArea;
public DockNotebook Notebook { get { return notebook; } }
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockWindow.cs
index d525e048d8..a7a1b158d7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockWindow.cs
@@ -27,7 +27,6 @@
using Gdk;
using Gtk;
using MonoDevelop.Components.Docking;
-using Mono.TextEditor;
using MonoDevelop.Ide;
using System.Collections.Generic;
using MonoDevelop.Ide.Gui;
@@ -36,7 +35,7 @@ using System.Linq;
namespace MonoDevelop.Components.DockNotebook
{
- class DockWindow : Gtk.Window
+ class DockWindow : IdeWindow
{
static List<DockWindow> allWindows = new List<DockWindow> ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs
index bf874ce3a7..756d2b672f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/PlaceholderWindow.cs
@@ -27,7 +27,6 @@
using Gdk;
using Gtk;
using MonoDevelop.Components.Docking;
-using Mono.TextEditor;
using MonoDevelop.Ide;
using System.Collections.Generic;
using MonoDevelop.Ide.Gui;
@@ -52,7 +51,7 @@ namespace MonoDevelop.Components.DockNotebook
var doc = IdeApp.Workbench.ActiveDocument;
if (doc == null)
return;
- var rootWindow = doc.Window.ActiveViewContent.Control.Toplevel as DockWindow;
+ var rootWindow = doc.Window.ActiveViewContent.Control.GetNativeWidget<Gtk.Widget> ().Toplevel as DockWindow;
if (rootWindow == null)
return;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs
index 90a8668d8e..f67851d652 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs
@@ -28,7 +28,6 @@ using System.Linq;
using Gdk;
using Gtk;
using System;
-using Mono.TextEditor;
using System.Collections.Generic;
using Cairo;
using MonoDevelop.Components;
@@ -43,6 +42,11 @@ namespace MonoDevelop.Components.DockNotebook
{
static Xwt.Drawing.Image tabbarPrevImage = Xwt.Drawing.Image.FromResource ("tabbar-prev-12.png");
static Xwt.Drawing.Image tabbarNextImage = Xwt.Drawing.Image.FromResource ("tabbar-next-12.png");
+ static Xwt.Drawing.Image tabActiveBackImage = Xwt.Drawing.Image.FromResource ("tabbar-active.9.png");
+ static Xwt.Drawing.Image tabBackImage = Xwt.Drawing.Image.FromResource ("tabbar-inactive.9.png");
+ static Xwt.Drawing.Image tabbarBackImage = Xwt.Drawing.Image.FromResource ("tabbar-back.9.png");
+ static Xwt.Drawing.Image tabCloseImage = Xwt.Drawing.Image.FromResource ("tab-close-9.png");
+ static Xwt.Drawing.Image tabDirtyImage = Xwt.Drawing.Image.FromResource ("tab-dirty-9.png");
List<Widget> children = new List<Widget> ();
readonly DockNotebook notebook;
@@ -70,23 +74,20 @@ namespace MonoDevelop.Components.DockNotebook
public MenuButton DropDownButton;
static readonly double PixelScale = GtkWorkarounds.GetPixelScale ();
- static readonly int TopBarPadding = (int)(3 * PixelScale);
- static readonly int BottomBarPadding = (int)(3 * PixelScale);
- static readonly int LeftRightPadding = (int)(10 * PixelScale);
- static readonly int TopPadding = (int)(8 * PixelScale);
- static readonly int BottomPadding = (int)(8 * PixelScale);
- static readonly int LeftBarPadding = (int)(58 * PixelScale);
+ static readonly int TotalHeight = (int)(32 * PixelScale);
+ static readonly Xwt.WidgetSpacing TabPadding;
+ static readonly Xwt.WidgetSpacing TabActivePadding;
+ static readonly int LeftBarPadding = (int)(44 * PixelScale);
+ static readonly int RightBarPadding = (int)(22 * PixelScale);
static readonly int VerticalTextSize = (int)(11 * PixelScale);
- const int TabSpacing = -1;
- const int Radius = 2;
- const int LeanWidth = 18;
- const int CloseButtonSize = 14;
+ // static readonly int ButtonSize = (int)(16 * PixelScale);
+ const int TabSpacing = 0;
+ const int LeanWidth = 12;
+ const double CloseButtonMarginRight = 0;
+ const double CloseButtonMarginBottom = -1.0;
const int TextOffset = 1;
- // Vertically aligns the close image(s) with the tab label.
- const int CloseImageTopOffset = 3;
-
int TabWidth { get; set; }
int LastTabWidthAdjustment { get; set; }
@@ -126,6 +127,26 @@ namespace MonoDevelop.Components.DockNotebook
}
}
+ static TabStrip ()
+ {
+ Xwt.Drawing.NinePatchImage tabBackImage9;
+ if (tabBackImage is Xwt.Drawing.ThemedImage) {
+ var img = ((Xwt.Drawing.ThemedImage)tabBackImage).GetImage (Xwt.Drawing.Context.GlobalStyles);
+ tabBackImage9 = img as Xwt.Drawing.NinePatchImage;
+ } else
+ tabBackImage9 = tabBackImage as Xwt.Drawing.NinePatchImage;
+ TabPadding = tabBackImage9.Padding;
+
+
+ Xwt.Drawing.NinePatchImage tabActiveBackImage9;
+ if (tabActiveBackImage is Xwt.Drawing.ThemedImage) {
+ var img = ((Xwt.Drawing.ThemedImage)tabActiveBackImage).GetImage (Xwt.Drawing.Context.GlobalStyles);
+ tabActiveBackImage9 = img as Xwt.Drawing.NinePatchImage;
+ } else
+ tabActiveBackImage9 = tabBackImage as Xwt.Drawing.NinePatchImage;
+ TabActivePadding = tabActiveBackImage9.Padding;
+ }
+
public TabStrip (DockNotebook notebook)
{
if (notebook == null)
@@ -142,22 +163,25 @@ namespace MonoDevelop.Components.DockNotebook
var arr = new Xwt.ImageView (tabbarPrevImage);
arr.HeightRequest = arr.WidthRequest = 10;
- var alignment = new Alignment (0.5f, 0.5f, 0.0f, 0.0f);
+ var alignment = new Alignment (0.5f, 1, 0.0f, 0.0f);
alignment.Add (arr.ToGtkWidget ());
PreviousButton = new Button (alignment);
+ PreviousButton.TooltipText = Core.GettextCatalog.GetString ("Switch to previous document");
PreviousButton.Relief = ReliefStyle.None;
PreviousButton.CanDefault = PreviousButton.CanFocus = false;
arr = new Xwt.ImageView (tabbarNextImage);
arr.HeightRequest = arr.WidthRequest = 10;
- alignment = new Alignment (0.5f, 0.5f, 0.0f, 0.0f);
+ alignment = new Alignment (0.5f, 1, 0.0f, 0.0f);
alignment.Add (arr.ToGtkWidget ());
NextButton = new Button (alignment);
+ NextButton.TooltipText = Core.GettextCatalog.GetString ("Switch to next document");
NextButton.Relief = ReliefStyle.None;
NextButton.CanDefault = NextButton.CanFocus = false;
DropDownButton = new MenuButton ();
+ DropDownButton.TooltipText = Core.GettextCatalog.GetString ("Document List");
DropDownButton.Relief = ReliefStyle.None;
DropDownButton.CanDefault = DropDownButton.CanFocus = false;
@@ -250,10 +274,8 @@ namespace MonoDevelop.Components.DockNotebook
} else {
tabStartX = LeanWidth / 2;
}
- tabEndX = allocation.Width - DropDownButton.SizeRequest ().Width;
- var height = allocation.Height - BottomBarPadding;
- if (height < 0)
- height = 0;
+ tabEndX = allocation.Width - RightBarPadding;
+ var height = allocation.Height;
PreviousButton.SizeAllocate (new Gdk.Rectangle (
0, // allocation.X,
@@ -293,28 +315,20 @@ namespace MonoDevelop.Components.DockNotebook
Update ();
}
- int totalHeight;
-
protected override void OnSizeRequested (ref Requisition requisition)
{
base.OnSizeRequested (ref requisition);
- requisition.Height = totalHeight;
+ requisition.Height = TotalHeight;
requisition.Width = 0;
}
internal void InitSize ()
{
- Pango.Layout la = CreateSizedLayout ();
- la.SetText ("H");
- int w, h;
- la.GetPixelSize (out w, out h);
-
- totalHeight = h + TopPadding + BottomPadding;
- la.Dispose ();
+ return;
}
public int BarHeight {
- get { return totalHeight - BottomBarPadding + 1; }
+ get { return TotalHeight; }
}
int lastDragX;
@@ -466,7 +480,7 @@ namespace MonoDevelop.Components.DockNotebook
dragX = (int)evnt.X - dragOffset;
QueueDraw ();
- var t = FindTab ((int)evnt.X, TopPadding + 3);
+ var t = FindTab ((int)evnt.X, (int)TabPadding.Top + 3);
if (t == null) {
var last = (DockNotebookTab)notebook.Tabs.Last ();
if (dragX > last.Allocation.Right)
@@ -584,30 +598,26 @@ namespace MonoDevelop.Components.DockNotebook
DockNotebookTab FindTab (int x, int y)
{
- // we will not actually draw anything, just do bounds checking
- using (var context = CairoHelper.Create (GdkWindow)) {
- var current = notebook.CurrentTab as DockNotebookTab;
- if (current != null) {
- LayoutTabBorder (context, Allocation, current.Allocation.Width, current.Allocation.X, 0, false);
- if (context.InFill (x, y))
- return current;
- }
+ var current = notebook.CurrentTab as DockNotebookTab;
+ if (current != null) {
+ var allocWithLean = current.Allocation;
+ allocWithLean.X -= LeanWidth / 2;
+ allocWithLean.Width += LeanWidth;
+ if (allocWithLean.Contains (x, y))
+ return current;
+ }
- context.NewPath ();
- for (int n = 0; n < notebook.Tabs.Count; n++) {
- var tab = (DockNotebookTab)notebook.Tabs [n];
- LayoutTabBorder (context, Allocation, tab.Allocation.Width, tab.Allocation.X, 0, false);
- if (context.InFill (x, y))
- return tab;
- context.NewPath ();
- }
+ for (int n = 0; n < notebook.Tabs.Count; n++) {
+ var tab = (DockNotebookTab)notebook.Tabs [n];
+ if (tab.Allocation.Contains (x, y))
+ return tab;
}
return null;
}
static bool IsOverCloseButton (DockNotebookTab tab, int x, int y)
{
- return tab != null && tab.CloseButtonAllocation.Contains (x, y);
+ return tab != null && tab.CloseButtonActiveArea.Contains (x, y);
}
public void Update ()
@@ -641,29 +651,6 @@ namespace MonoDevelop.Components.DockNotebook
return Math.Max (min, Math.Min (max, val));
}
- void DrawBackground (Context ctx, Gdk.Rectangle region)
- {
- var h = region.Height;
- ctx.Rectangle (0, 0, region.Width, h);
- using (var gr = new LinearGradient (0, 0, 0, h)) {
- if (isActiveNotebook) {
- gr.AddColorStop (0, Styles.TabBarActiveGradientStartColor);
- gr.AddColorStop (1, Styles.TabBarActiveGradientEndColor);
- } else {
- gr.AddColorStop (0, Styles.TabBarGradientStartColor);
- gr.AddColorStop (1, Styles.TabBarGradientEndColor);
- }
- ctx.SetSource (gr);
- ctx.Fill ();
- }
-
- ctx.MoveTo (region.X, 0.5);
- ctx.LineTo (region.Right + 1, 0.5);
- ctx.LineWidth = 1;
- ctx.SetSourceColor (Styles.TabBarGradientShadowColor);
- ctx.Stroke ();
- }
-
int GetRenderOffset ()
{
int tabArea = tabEndX - tabStartX;
@@ -734,7 +721,7 @@ namespace MonoDevelop.Components.DockNotebook
if (active) {
int tmp = x;
- drawActive = c => DrawTab (c, tab, Allocation, new Gdk.Rectangle (tmp, y, width, Allocation.Height), true, true, draggingTab, CreateTabLayout (tab));
+ drawActive = c => DrawTab (c, tab, Allocation, new Gdk.Rectangle (tmp, y, width, Allocation.Height), true, true, draggingTab, CreateTabLayout (tab, true));
tab.Allocation = new Gdk.Rectangle (tmp, Allocation.Y, width, Allocation.Height);
} else {
int tmp = x;
@@ -756,14 +743,14 @@ namespace MonoDevelop.Components.DockNotebook
drawCommands.Add (DrawClosingTab (n, new Gdk.Rectangle (x, y, 0, allocation.Height), out tabWidth));
drawCommands.Reverse ();
- DrawBackground (ctx, allocation);
+ ctx.DrawImage (this, tabbarBackImage.WithSize (allocation.Width, allocation.Height), 0, 0);
// Draw breadcrumb bar header
- if (notebook.Tabs.Count > 0) {
- ctx.Rectangle (0, allocation.Height - BottomBarPadding, allocation.Width, BottomBarPadding);
- ctx.SetSourceColor (Styles.BreadcrumbBackgroundColor);
- ctx.Fill ();
- }
+// if (notebook.Tabs.Count > 0) {
+// ctx.Rectangle (0, allocation.Height - BottomBarPadding, allocation.Width, BottomBarPadding);
+// ctx.SetSourceColor (Styles.BreadcrumbBackgroundColor);
+// ctx.Fill ();
+// }
ctx.Rectangle (tabStartX - LeanWidth / 2, allocation.Y, tabArea + LeanWidth, allocation.Height);
ctx.Clip ();
@@ -785,70 +772,6 @@ namespace MonoDevelop.Components.DockNotebook
return base.OnExposeEvent (evnt);
}
- static void DrawCloseButton (Context context, Gdk.Point center, bool hovered, double opacity, double animationProgress)
- {
- if (hovered) {
- const double radius = 6;
- context.Arc (center.X, center.Y, radius, 0, Math.PI * 2);
- context.SetSourceRGBA (.6, .6, .6, opacity);
- context.Fill ();
-
- context.SetSourceRGBA (0.95, 0.95, 0.95, opacity);
- context.LineWidth = 2;
-
- context.MoveTo (center.X - 3, center.Y - 3);
- context.LineTo (center.X + 3, center.Y + 3);
- context.MoveTo (center.X - 3, center.Y + 3);
- context.LineTo (center.X + 3, center.Y - 3);
- context.Stroke ();
- } else {
- double lineColor = .63 - .1 * animationProgress;
- const double fillColor = .74;
-
- double heightMod = Math.Max (0, 1.0 - animationProgress * 2);
- context.MoveTo (center.X - 3, center.Y - 3 * heightMod);
- context.LineTo (center.X + 3, center.Y + 3 * heightMod);
- context.MoveTo (center.X - 3, center.Y + 3 * heightMod);
- context.LineTo (center.X + 3, center.Y - 3 * heightMod);
-
- context.LineWidth = 2;
- context.SetSourceRGBA (lineColor, lineColor, lineColor, opacity);
- context.Stroke ();
-
- if (animationProgress > 0.5) {
- double partialProg = (animationProgress - 0.5) * 2;
- context.MoveTo (center.X - 3, center.Y);
- context.LineTo (center.X + 3, center.Y);
-
- context.LineWidth = 2 - partialProg;
- context.SetSourceRGBA (lineColor, lineColor, lineColor, opacity);
- context.Stroke ();
-
- double radius = partialProg * 3.5;
-
- // Background
- context.Arc (center.X, center.Y, radius, 0, Math.PI * 2);
- context.SetSourceRGBA (fillColor, fillColor, fillColor, opacity);
- context.Fill ();
-
- // Inset shadow
- using (var lg = new LinearGradient (0, center.Y - 5, 0, center.Y)) {
- context.Arc (center.X, center.Y + 1, radius, 0, Math.PI * 2);
- lg.AddColorStop (0, new Cairo.Color (0, 0, 0, 0.2 * opacity));
- lg.AddColorStop (1, new Cairo.Color (0, 0, 0, 0));
- context.SetSource (lg);
- context.Stroke ();
- }
-
- // Outline
- context.Arc (center.X, center.Y, radius, 0, Math.PI * 2);
- context.SetSourceRGBA (lineColor, lineColor, lineColor, opacity);
- context.Stroke ();
-
- }
- }
- }
-
void DrawTab (Context ctx, DockNotebookTab tab, Gdk.Rectangle allocation, Gdk.Rectangle tabBounds, bool highlight, bool active, bool dragging, Pango.Layout la)
{
// This logic is stupid to have here, should be in the caller!
@@ -856,141 +779,100 @@ namespace MonoDevelop.Components.DockNotebook
tabBounds.X = (int)(tabBounds.X + (dragX - tabBounds.X) * dragXProgress);
tabBounds.X = Clamp (tabBounds.X, tabStartX, tabEndX - tabBounds.Width);
}
- int padding = LeftRightPadding;
- padding = (int)(padding * Math.Min (1.0, Math.Max (0.5, (tabBounds.Width - 30) / 70.0)));
+ double rightPadding = (active ? TabActivePadding.Right : TabPadding.Right) - (LeanWidth / 2);
+ rightPadding = (rightPadding * Math.Min (1.0, Math.Max (0.5, (tabBounds.Width - 30) / 70.0)));
+ double leftPadding = (active ? TabActivePadding.Left : TabPadding.Left) - (LeanWidth / 2);
+ leftPadding = (leftPadding * Math.Min (1.0, Math.Max (0.5, (tabBounds.Width - 30) / 70.0)));
+ double bottomPadding = active ? TabActivePadding.Bottom : TabPadding.Bottom;
- ctx.LineWidth = 1;
- LayoutTabBorder (ctx, allocation, tabBounds.Width, tabBounds.X, 0, active);
- ctx.ClosePath ();
- using (var gr = new LinearGradient (tabBounds.X, TopBarPadding, tabBounds.X, allocation.Bottom)) {
- if (active) {
- gr.AddColorStop (0, Styles.BreadcrumbGradientStartColor.MultiplyAlpha (tab.Opacity));
- gr.AddColorStop (1, Styles.BreadcrumbBackgroundColor.MultiplyAlpha (tab.Opacity));
- } else {
- gr.AddColorStop (0, CairoExtensions.ParseColor ("f4f4f4").MultiplyAlpha (tab.Opacity));
- gr.AddColorStop (1, CairoExtensions.ParseColor ("cecece").MultiplyAlpha (tab.Opacity));
- }
- ctx.SetSource (gr);
- }
- ctx.Fill ();
-
- ctx.SetSourceColor (new Cairo.Color (1, 1, 1, .5).MultiplyAlpha (tab.Opacity));
- LayoutTabBorder (ctx, allocation, tabBounds.Width, tabBounds.X, 1, active);
- ctx.Stroke ();
+ DrawTabBackground (this, ctx, allocation, tabBounds.Width, tabBounds.X, active);
- ctx.SetSourceColor (Styles.BreadcrumbBorderColor.MultiplyAlpha (tab.Opacity));
- LayoutTabBorder (ctx, allocation, tabBounds.Width, tabBounds.X, 0, active);
- ctx.StrokePreserve ();
+ ctx.LineWidth = 1;
+ ctx.NewPath ();
- if (tab.GlowStrength > 0) {
- Gdk.Point mouse = tracker.MousePosition;
- using (var rg = new RadialGradient (mouse.X, tabBounds.Bottom, 0, mouse.X, tabBounds.Bottom, 100)) {
- rg.AddColorStop (0, new Cairo.Color (1, 1, 1, 0.4 * tab.Opacity * tab.GlowStrength));
- rg.AddColorStop (1, new Cairo.Color (1, 1, 1, 0));
+ // Render Close Button (do this first so we can tell how much text to render)
- ctx.SetSource (rg);
- ctx.Fill ();
- }
- } else {
- ctx.NewPath ();
- }
+ var closeButtonAlloation = new Cairo.Rectangle (tabBounds.Right - rightPadding - (tabCloseImage.Width / 2) - CloseButtonMarginRight,
+ tabBounds.Height - bottomPadding - tabCloseImage.Height - CloseButtonMarginBottom,
+ tabCloseImage.Width, tabCloseImage.Height);
+
+ tab.CloseButtonActiveArea = closeButtonAlloation.Inflate (2, 2);
- // Render Close Button (do this first so we can tell how much text to render)
+ bool closeButtonHovered = tracker.Hovered && tab.CloseButtonActiveArea.Contains (tracker.MousePosition);
+ bool tabHovered = tracker.Hovered && tab.Allocation.Contains (tracker.MousePosition);
+ bool drawCloseButton = active || tabHovered;
- var ch = allocation.Height - TopBarPadding - BottomBarPadding + CloseImageTopOffset;
- var crect = new Gdk.Rectangle (tabBounds.Right - padding - CloseButtonSize + 3,
- tabBounds.Y + TopBarPadding + (ch - CloseButtonSize) / 2,
- CloseButtonSize, CloseButtonSize);
- tab.CloseButtonAllocation = crect;
- tab.CloseButtonAllocation.Inflate (2, 2);
-
- bool closeButtonHovered = tracker.Hovered && tab.CloseButtonAllocation.Contains (tracker.MousePosition) && tab.WidthModifier >= 1.0f;
- bool drawCloseButton = tabBounds.Width > 60 || highlight || closeButtonHovered;
- if (drawCloseButton) {
- DrawCloseButton (ctx, new Gdk.Point (crect.X + crect.Width / 2, crect.Y + crect.Height / 2), closeButtonHovered, tab.Opacity, tab.DirtyStrength);
+ if (!closeButtonHovered && tab.DirtyStrength > 0.5) {
+ ctx.DrawImage (this, tabDirtyImage, closeButtonAlloation.X, closeButtonAlloation.Y);
+ drawCloseButton = false;
}
+ if (drawCloseButton)
+ ctx.DrawImage (this, tabCloseImage.WithAlpha ((closeButtonHovered ? 1.0 : 0.5) * tab.Opacity), closeButtonAlloation.X, closeButtonAlloation.Y);
+
// Render Text
- int w = tabBounds.Width - (padding * 2 + CloseButtonSize);
- if (!drawCloseButton)
- w += CloseButtonSize;
+ double tw = tabBounds.Width - (leftPadding + rightPadding);
+ if (drawCloseButton || tab.DirtyStrength > 0.5)
+ tw -= closeButtonAlloation.Width / 2;
- int textStart = tabBounds.X + padding;
+ double tx = tabBounds.X + leftPadding;
+ var baseline = la.GetLine (0).Layout.GetPixelBaseline ();
+ double ty = tabBounds.Height - bottomPadding - baseline;
- ctx.MoveTo (textStart, tabBounds.Y + TopPadding + TextOffset + VerticalTextSize);
+ ctx.MoveTo (tx, ty);
if (!MonoDevelop.Core.Platform.IsMac && !MonoDevelop.Core.Platform.IsWindows) {
// This is a work around for a linux specific problem.
// A bug in the proprietary ATI driver caused TAB text not to draw.
// If that bug get's fixed remove this HACK asap.
la.Ellipsize = Pango.EllipsizeMode.End;
- la.Width = (int)(w * Pango.Scale.PangoScale);
- ctx.SetSourceColor (tab.Notify ? new Cairo.Color (0, 0, 1) : Styles.TabBarActiveTextColor);
- Pango.CairoHelper.ShowLayoutLine (ctx, la.GetLine (0));
+ la.Width = (int)(tw * Pango.Scale.PangoScale);
+ ctx.SetSourceColor ((tab.Notify ? Styles.TabBarNotifyTextColor : (active ? Styles.TabBarActiveTextColor : Styles.TabBarInactiveTextColor)).ToCairoColor ());
+ Pango.CairoHelper.ShowLayout (ctx, la.GetLine (0).Layout);
} else {
// ellipses are for space wasting ..., we cant afford that
- using (var lg = new LinearGradient (textStart + w - 5, 0, textStart + w + 3, 0)) {
- var color = tab.Notify ? new Cairo.Color (0, 0, 1) : Styles.TabBarActiveTextColor;
+ using (var lg = new LinearGradient (tx + tw - 10, 0, tx + tw, 0)) {
+ var color = (tab.Notify ? Styles.TabBarNotifyTextColor : (active ? Styles.TabBarActiveTextColor : Styles.TabBarInactiveTextColor)).ToCairoColor ();
color = color.MultiplyAlpha (tab.Opacity);
lg.AddColorStop (0, color);
color.A = 0;
lg.AddColorStop (1, color);
ctx.SetSource (lg);
- Pango.CairoHelper.ShowLayoutLine (ctx, la.GetLine (0));
+ Pango.CairoHelper.ShowLayout (ctx, la.GetLine (0).Layout);
}
}
la.Dispose ();
}
- static void LayoutTabBorder (Context ctx, Gdk.Rectangle allocation, int contentWidth, int px, int margin, bool active = true)
+ static void DrawTabBackground (Widget widget, Context ctx, Gdk.Rectangle allocation, int contentWidth, int px, bool active = true)
{
- double x = 0.5 + (double)px;
- double y = (double)allocation.Height + 0.5 - BottomBarPadding + margin;
- double height = allocation.Height - TopBarPadding - BottomBarPadding;
+ int lean = Math.Min (LeanWidth, contentWidth / 2);
+ int halfLean = lean / 2;
- x += TabSpacing + margin;
- contentWidth -= (TabSpacing + margin) * 2;
+ double x = px + TabSpacing - halfLean;
+ double y = 0;
+ double height = allocation.Height;
+ double width = contentWidth - (TabSpacing * 2) + lean;
- double rightx = x + contentWidth;
+ var image = active ? tabActiveBackImage : tabBackImage;
+ image = image.WithSize (width, height);
- int lean = Math.Min (LeanWidth, contentWidth / 2);
- int halfLean = lean / 2;
- const int smoothing = 2;
- if (active) {
- ctx.MoveTo (0, y + 0.5);
- ctx.LineTo (0, y);
- ctx.LineTo (x - halfLean, y);
- } else {
- ctx.MoveTo (x - halfLean, y + 0.5);
- ctx.LineTo (x - halfLean, y);
- }
- ctx.CurveTo (new PointD (x + smoothing, y),
- new PointD (x - smoothing, y - height),
- new PointD (x + halfLean, y - height));
- ctx.LineTo (rightx - halfLean, y - height);
- ctx.CurveTo (new PointD (rightx + smoothing, y - height),
- new PointD (rightx - smoothing, y),
- new PointD (rightx + halfLean, y));
-
- if (active) {
- ctx.LineTo (allocation.Width, y);
- ctx.LineTo (allocation.Width, y + 0.5);
- } else {
- ctx.LineTo (rightx + halfLean, y + 0.5);
- }
+ ctx.DrawImage (widget, image, x, y);
}
- Pango.Layout CreateSizedLayout ()
+ Pango.Layout CreateSizedLayout (bool active)
{
var la = new Pango.Layout (PangoContext);
- la.FontDescription = Pango.FontDescription.FromString ("normal");
+ la.FontDescription = Ide.Fonts.FontService.SansFont.Copy ();
+ if (!Core.Platform.IsWindows)
+ la.FontDescription.Weight = Pango.Weight.Bold;
la.FontDescription.AbsoluteSize = Pango.Units.FromPixels (VerticalTextSize);
return la;
}
- Pango.Layout CreateTabLayout (DockNotebookTab tab)
+ Pango.Layout CreateTabLayout (DockNotebookTab tab, bool active = false)
{
- Pango.Layout la = CreateSizedLayout ();
+ Pango.Layout la = CreateSizedLayout (active);
if (!string.IsNullOrEmpty (tab.Markup))
la.SetMarkup (tab.Markup);
else if (!string.IsNullOrEmpty (tab.Text))
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/ArrowWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/ArrowWindow.cs
deleted file mode 100644
index 8d02dc185d..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/ArrowWindow.cs
+++ /dev/null
@@ -1,136 +0,0 @@
-//
-// ArrowWindow.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using Gtk;
-using Gdk;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- internal class ArrowWindow: Gtk.Window
- {
- const int LineWidth = 3;
- const int LineLength = 9;
- const int PointerWidth = 13;
- const int PointerLength = 6;
-
- Direction direction;
- Point[] arrow;
- int width, height;
-
- Gdk.GC redgc;
-
- // Where does the arrow point to
- public new enum Direction {
- Up, Down, Left, Right
- }
-
- public ArrowWindow (DockToolbarFrame frame, Direction dir): base (Gtk.WindowType.Popup)
- {
- SkipTaskbarHint = true;
- Decorated = false;
- TransientFor = frame.TopWindow;
-
- direction = dir;
- arrow = CreateArrow ();
- if (direction == Direction.Up || direction == Direction.Down) {
- width = PointerWidth;
- height = LineLength + PointerLength + 1;
- } else {
- height = PointerWidth;
- width = LineLength + PointerLength + 1;
- }
-
- // Create the mask for the arrow
-
- Gdk.Color black, white;
- black = new Gdk.Color (0, 0, 0);
- black.Pixel = 1;
- white = new Gdk.Color (255, 255, 255);
- white.Pixel = 0;
-
- Gdk.Pixmap pm = new Pixmap (this.GdkWindow, width, height, 1);
- Gdk.GC gc = new Gdk.GC (pm);
- gc.Background = white;
- gc.Foreground = white;
- pm.DrawRectangle (gc, true, 0, 0, width, height);
-
- gc.Foreground = black;
- pm.DrawPolygon (gc, false, arrow);
- pm.DrawPolygon (gc, true, arrow);
-
- this.ShapeCombineMask (pm, 0, 0);
-
- Realize ();
-
- redgc = new Gdk.GC (GdkWindow);
- redgc.RgbFgColor = new Gdk.Color (255, 0, 0);
-
- Resize (width, height);
- }
-
- public int Width {
- get { return width; }
- }
-
- public int Height {
- get { return height; }
- }
-
- Point[] CreateArrow ()
- {
- Point[] ps = new Point [8];
- ps [0] = GetPoint (0, (PointerWidth/2) - (LineWidth/2));
- ps [1] = GetPoint (LineLength, (PointerWidth/2) - (LineWidth/2));
- ps [2] = GetPoint (LineLength, 0);
- ps [3] = GetPoint (PointerLength + LineLength, (PointerWidth/2));
- ps [4] = GetPoint (LineLength, PointerWidth - 1);
- ps [5] = GetPoint (LineLength, (PointerWidth/2) + (LineWidth/2));
- ps [6] = GetPoint (0, (PointerWidth/2) + (LineWidth/2));
- ps [7] = ps [0];
- return ps;
- }
-
- Point GetPoint (int x, int y)
- {
- switch (direction) {
- case Direction.Right: return new Point (x, y);
- case Direction.Left: return new Point ((PointerLength + LineLength) - x, y);
- case Direction.Down: return new Point (y, x);
- default: return new Point (y, (PointerLength + LineLength) - x);
- }
- }
-
- protected override bool OnExposeEvent (Gdk.EventExpose args)
- {
- GdkWindow.DrawPolygon (redgc, false, arrow);
- GdkWindow.DrawPolygon (redgc, true, arrow);
- return true;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockGrip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockGrip.cs
deleted file mode 100644
index 716763dee1..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockGrip.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-//
-// DockGrip.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using Gtk;
-using Gdk;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- internal class DockGrip: ToolItem
- {
- static int GripSize = MonoDevelop.Core.Platform.IsWindows? 4 : 6; //wimp theme engine looks ugly with width 6
- const int MarginLeft = 1;
- const int MarginRight = 3;
-
- public DockGrip ()
- {
- }
-
- protected override void OnSizeRequested (ref Requisition req)
- {
- if (Orientation == Orientation.Horizontal) {
- req.Width = GripSize + MarginLeft + MarginRight;
- req.Height = 0;
- } else {
- req.Width = 0;
- req.Height = GripSize + MarginLeft + MarginRight;
- }
- }
-
- protected override bool OnExposeEvent (Gdk.EventExpose args)
- {
- Rectangle rect = Allocation;
- if (Orientation == Orientation.Horizontal) {
- rect.Width = GripSize;
- rect.X += MarginLeft;
- } else {
- rect.Height = GripSize;
- rect.Y += MarginLeft;
- }
-
- Gtk.Orientation or = Orientation == Gtk.Orientation.Horizontal ? Gtk.Orientation.Vertical : Gtk.Orientation.Horizontal;
- Gtk.Style.PaintHandle (this.Style, this.ParentWindow, this.State, Gtk.ShadowType.None, args.Area, this, "grip", rect.X, rect.Y, rect.Width, rect.Height, or);
- return true;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbar.cs
deleted file mode 100644
index 4e7c905e0f..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbar.cs
+++ /dev/null
@@ -1,411 +0,0 @@
-//
-// DockToolbar.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using Gtk;
-using Gdk;
-using Mono.TextEditor;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- public class DockToolbar: Toolbar, IDockToolbar
- {
- DockGrip grip;
- DockToolbarFrame parentFrame;
- bool dragging;
- FloatingDock floatingDock;
- string id;
- string title;
-
- int row;
- int offset;
- int shiftOffset = -1;
-
- // Offset requested by the user. It is used to know where the
- // toolbar is expected to move when the window is expanded.
- int anchorOffset;
-
- Animation animation;
- DockToolbarPosition lastPosition;
- DockToolbarStatus defaultStatus;
-
- int defaultSize;
- int defaultHeight;
- bool gotSize = false;
- bool gettingSize;
- Dictionary<Gtk.Widget,int> calculatedSizes = new Dictionary<Gtk.Widget, int> ();
-
- public DockToolbar (string id, string title)
- {
- grip = new DockGrip ();
- Add (grip);
- grip.Hide ();
- this.id = id;
- this.title = title;
- ShowArrow = false;
- }
-
- internal void SetParentFrame (DockToolbarFrame frame)
- {
- parentFrame = frame;
- grip.Show ();
- }
-
- public string Id {
- get { return id; }
- }
-
- public string Title {
- get { return title; }
- }
-
- public bool Floating {
- get { return floatingDock != null; }
- }
-
- bool IDockToolbar.Visible {
- get { return Parent != null; }
- set {
- if (value == ((IDockToolbar)this).Visible)
- return;
-
- if (value) {
- if (lastPosition != null)
- lastPosition.RestorePosition (parentFrame, this);
- else
- defaultStatus.Position.RestorePosition (parentFrame, this);
- } else {
- lastPosition = DockToolbarPosition.Create (this);
- if (Floating) {
- FloatingDock win = FloatingDock;
- win.Detach ();
- win.Destroy ();
- }
- else
- DockPanel.RemoveBar (this);
- }
- }
- }
-
- internal DockToolbarPosition Position {
- get {
- if (((IDockToolbar)this).Visible) return DockToolbarPosition.Create (this);
- else if (lastPosition != null) return lastPosition;
- else return defaultStatus.Position;
- }
- }
-
- internal DockToolbarStatus Status {
- get {
- return new DockToolbarStatus (id, ((IDockToolbar)this).Visible, Position);
- }
- set {
- if (value.Visible) {
- ((IDockToolbar)this).Visible = false;
- lastPosition = value.Position;
- ((IDockToolbar)this).Visible = true;
- } else {
- ((IDockToolbar)this).Visible = false;
- lastPosition = value.Position;
- }
- }
-
- }
-
- internal DockToolbarStatus DefaultStatus {
- get { return defaultStatus; }
- set { defaultStatus = value; }
- }
-
- internal int DockRow {
- get { return row; }
- set { row = value; }
- }
-
- /// <summary>
- /// The current offset of the toolbar
- /// </summary>
- internal int DockOffset {
- get { return offset; }
- set { offset = value; }
- }
-
- internal int DockShiftOffset {
- get { return shiftOffset; }
- set { shiftOffset = value; }
- }
-
- /// <summary>
- /// The ideal offset of the toolbar. It may not be the real offset if the
- /// toolbar has been forced to move to make room for other toolbars
- /// </summary>
- internal int AnchorOffset {
- get { return anchorOffset; }
- set { anchorOffset = value; }
- }
-
- internal int DefaultSize {
- get {
- if (!gotSize) CalcSizes ();
- return defaultSize;
- }
- }
-
- public int DefaultHeight {
- get {
- if (!gotSize) CalcSizes ();
- return defaultHeight;
- }
- }
-
- internal void CalcSizes ()
- {
- // Calculates the real size of the toolbar. ShowArrow=false is
- // needed, since SizeRequest reports 0 size requested if not.
-
- gettingSize = true;
- bool olda = ShowArrow;
- int oldw = WidthRequest;
- int oldh = HeightRequest;
- WidthRequest = -1;
- HeightRequest = -1;
-
- ShowArrow = false;
- Requisition r = SizeRequest ();
- if (Orientation == Orientation.Horizontal) {
- defaultSize = r.Width;
- defaultHeight = r.Height;
- }
- else {
- defaultSize = r.Height;
- defaultHeight = r.Width;
- }
-
- calculatedSizes.Clear ();
- foreach (Widget w in Children) {
- if (!w.Visible)
- continue;
- if (Orientation == Orientation.Horizontal)
- calculatedSizes [w] = w.Allocation.Width;
- else
- calculatedSizes [w] = w.Allocation.Height;
- }
-
- WidthRequest = oldw;
- HeightRequest = oldh;
- ShowArrow = olda;
- gotSize = true;
- gettingSize = false;
- }
-
- internal bool CanDockTo (DockToolbarPanel panel)
- {
- return true;
- }
-
- internal FloatingDock FloatingDock {
- get { return floatingDock; }
- set { floatingDock = value; }
- }
-
- internal DockToolbarPanel DockPanel {
- get { return Parent as DockToolbarPanel; }
- }
-
- internal Animation Animation {
- get { return animation; }
- set { animation = value; }
- }
-
- protected override bool OnButtonPressEvent (EventButton e)
- {
- if (parentFrame != null && e.Button == 1 && !e.TriggersContextMenu ()) {
- if (Orientation == Orientation.Horizontal && e.X <= 10) {
- dragging = true;
- parentFrame.StartDragBar (this, (int)e.X, (int)e.Y, e.Time);
- return true;
- }
- else if (Orientation == Orientation.Vertical && e.Y <= 10) {
- dragging = true;
- parentFrame.StartDragBar (this, (int)e.X, (int)e.Y, e.Time);
- return true;
- }
- }
- return base.OnButtonPressEvent (e);
- }
-
- protected override bool OnButtonReleaseEvent (EventButton e)
- {
- if (e.Button == 1 && dragging) {
- dragging = false;
- parentFrame.EndDragBar (this, e.Time);
- }
- return base.OnButtonReleaseEvent (e);
- }
-
- protected override bool OnExposeEvent (EventExpose evnt)
- {
- //HACK: the WIMP theme engine's rendering is a bit off, need to force it to render wider
- if (MonoDevelop.Core.Platform.IsWindows && Orientation == Orientation.Horizontal) {
- int widen = 1;
- var shadowType = (ShadowType)StyleGetProperty ("shadow-type");
- Style.PaintBox (Style, evnt.Window, State, shadowType, evnt.Area, this, "toolbar",
- Allocation.X - widen, Allocation.Y, Allocation.Width + widen + widen, Allocation.Height);
-
- foreach (Widget child in Children) {
- PropagateExpose (child, evnt);
- }
- return true;
- }
-
- return base.OnExposeEvent (evnt);
- }
-
- bool firstRealized;
- protected override void OnRealized ()
- {
- base.OnRealized ();
- if (!firstRealized) {
- OnItemChange (null, null);
- firstRealized = true;
- }
- }
-
-
- internal void ResetSize ()
- {
- WidthRequest = -1;
- HeightRequest = -1;
- ShowArrow = false;
- }
-
- public int Size {
- set {
- if (Orientation == Orientation.Horizontal) {
- if (value >= DefaultSize)
- WidthRequest = -1;
- else
- WidthRequest = value;
- }
- else {
- if (value >= DefaultSize)
- HeightRequest = -1;
- else
- HeightRequest = value;
- HeightRequest = value;
- }
- }
- get {
- if (Orientation == Orientation.Horizontal)
- return SizeRequest ().Width;
- else
- return SizeRequest ().Height;
- }
- }
-
- public new Orientation Orientation {
- get {
- return base.Orientation;
- }
- set {
- if (value == base.Orientation)
- return;
-
- if (FloatingDock != null) {
- // I create a new dock window because resizing the
- // current one has lots of issues (mainly synchronization
- // problems between the size change of the window and
- // the toolbar).
-
- int x,y;
- FloatingDock w = FloatingDock;
- w.GetPosition (out x, out y);
- w.Detach ();
-
- base.Orientation = value;
-
- FloatingDock fdock = new FloatingDock (parentFrame);
- fdock.Move (x, y);
- fdock.Attach (this);
- w.Destroy ();
- } else
- base.Orientation = value;
- gotSize = false;
- }
- }
-
- protected override void OnAdded (Widget w)
- {
- base.OnAdded (w);
- gotSize = false;
- if (DefaultSizeChanged != null)
- DefaultSizeChanged (this, EventArgs.Empty);
- w.Shown += OnItemChange;
- w.Hidden += OnItemChange;
- w.SizeAllocated += OnItemSizeChange;
- }
-
- protected override void OnRemoved (Widget w)
- {
- base.OnRemoved (w);
- gotSize = false;
- if (DefaultSizeChanged != null)
- DefaultSizeChanged (this, EventArgs.Empty);
- w.Shown -= OnItemChange;
- w.Hidden -= OnItemChange;
- w.SizeAllocated -= OnItemSizeChange;
- }
-
- void OnItemSizeChange (object o, SizeAllocatedArgs args)
- {
- if (gettingSize || !gotSize)
- return;
- int os;
- if (calculatedSizes.TryGetValue ((Gtk.Widget) o, out os)) {
- int ns = (Orientation == Orientation.Horizontal ? args.Allocation.Width : args.Allocation.Height);
- if (os != ns) {
- Gtk.Application.Invoke (delegate {
- OnItemChange (null, null);
- });
- }
- }
- }
-
- void OnItemChange (object o, EventArgs args)
- {
- // This notifies changes in the size of the toolbar
- gotSize = false;
- if (DefaultSizeChanged != null)
- DefaultSizeChanged (this, EventArgs.Empty);
- }
-
- internal event EventHandler DefaultSizeChanged;
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrame.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrame.cs
deleted file mode 100644
index 791bb12428..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrame.cs
+++ /dev/null
@@ -1,400 +0,0 @@
-//
-// DockToolbarFrame.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using Gtk;
-using Gdk;
-using System.Collections;
-using System.Xml;
-using System.Xml.Serialization;
-using System.Collections.Generic;
-using Mono.TextEditor;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- public class DockToolbarFrame: EventBox
- {
- DockToolbarPanel[] panels;
- DockToolbarPanel targetPanel;
- VBox vbox;
- VBox contentBox;
- DockToolbar dragBar;
- int xDragDif, yDragDif;
- List<DockToolbar> bars = new List<DockToolbar> ();
-
- Dictionary<string,DockToolbarStatus[]> layouts = new Dictionary<string,DockToolbarStatus[]> ();
- string currentLayout = "";
-
- Cursor handCursor = new Cursor (CursorType.Fleur);
-
- public DockToolbarFrame ()
- {
- vbox = new VBox ();
- Add (vbox);
-
- DockToolbarPanel topPanel = new DockToolbarPanel (this, Placement.Top);
- DockToolbarPanel bottomPanel = new DockToolbarPanel (this, Placement.Bottom);
- DockToolbarPanel leftPanel = new DockToolbarPanel (this, Placement.Left);
- DockToolbarPanel rightPanel = new DockToolbarPanel (this, Placement.Right);
-
- panels = new DockToolbarPanel [4];
- panels [(int)Placement.Top] = topPanel;
- panels [(int)Placement.Bottom] = bottomPanel;
- panels [(int)Placement.Left] = leftPanel;
- panels [(int)Placement.Right] = rightPanel;
-
- vbox.PackStart (topPanel, false, false, 0);
-
- HBox hbox = new HBox ();
- contentBox = new VBox ();
-
- hbox.PackStart (leftPanel, false, false, 0);
- hbox.PackStart (contentBox, true, true, 0);
- hbox.PackStart (rightPanel, false, false, 0);
-
- vbox.PackStart (hbox, true, true, 0);
- vbox.PackStart (bottomPanel, false, false, 0);
-
- this.Events = EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask;
- ShowAll ();
- }
-
- public void AddContent (Widget w)
- {
- contentBox.PackStart (w, true, true, 0);
- }
-
- public void RemoveContent (Widget w)
- {
- contentBox.Remove (w);
- }
-
- public string CurrentLayout {
- get { return currentLayout; }
- set {
- if (value != currentLayout) {
- SaveCurrentLayout ();
- RestoreLayout (value);
- }
- }
- }
-
- public DockToolbarFrameStatus GetStatus ()
- {
- SaveCurrentLayout ();
- DockToolbarFrameStatus col = new DockToolbarFrameStatus ();
- col.Version = DockToolbarFrameStatus.CurrentVersion;
-
- foreach (var layout in layouts) {
- col.Status.Add (new DockToolbarFrameLayout () {
- Id = layout.Key,
- Bars = layout.Value,
- });
- }
- return col;
- }
-
- public void SetStatus (DockToolbarFrameStatus status)
- {
- layouts.Clear ();
- if (status != null && status.Status != null) {
- foreach (DockToolbarFrameLayout c in status.Status) {
- if (status.Version < 2) {
- // Convert from old to new toolbar id
- foreach (DockToolbarStatus ts in c.Bars)
- ts.BarId = ConvertToolbarId (ts.BarId);
- }
- layouts [c.Id] = c.Bars;
- }
- }
- RestoreLayout ("");
- }
-
- public void SaveStatus (XmlWriter writer)
- {
- XmlSerializer ser = new XmlSerializer (typeof(DockToolbarFrameStatus));
- ser.Serialize (writer, GetStatus ());
- }
-
- public void LoadStatus (XmlReader reader)
- {
- layouts.Clear ();
- XmlSerializer ser = new XmlSerializer (typeof(DockToolbarFrameStatus));
- DockToolbarFrameStatus col = (DockToolbarFrameStatus) ser.Deserialize (reader);
- SetStatus (col);
- }
-
- string ConvertToolbarId (string id)
- {
- // Old MD versions include the display name of the toolbar in the id.
- // New MD versions use a different id composition.
- // This method translates the id from the old to the new format (when possible)
-
- int i = id.LastIndexOf ('/');
- if (i == -1)
- return id;
-
- string baseId = id.Substring (0, i + 1);
-
- foreach (DockToolbar t in bars) {
- if (t.Id == id)
- return id;
- if (baseId + t.Title == id)
- return t.Id;
- }
- return id;
- }
-
- public IDockToolbar AddBar (DockToolbar bar)
- {
- return AddBar (bar, Placement.Top, true);
- }
-
- public IDockToolbar AddBar (DockToolbar bar, Placement defaultPanel, bool defaultVisible)
- {
- bar.SetParentFrame (this);
- bars.Add (bar);
-
- DockToolbarPosition pos = new DockedPosition (defaultPanel);
- DockToolbarStatus s = new DockToolbarStatus (bar.Id, defaultVisible, pos);
- bar.DefaultStatus = s;
- bar.Status = s;
-
- return bar;
- }
-
- public void RemoveToolbar(DockToolbar bar)
- {
- IDockToolbar db = (IDockToolbar)bar;
- db.Visible = false;
- bar.Destroy();
- bars.Remove(bar);
- }
-
- public void ClearToolbars ()
- {
- foreach (DockToolbar bar in bars) {
- IDockToolbar db = (IDockToolbar) bar;
- db.Visible = false;
- bar.Destroy ();
- }
- bars.Clear ();
- }
-
- public IDockToolbar GetBar (string id)
- {
- foreach (DockToolbar bar in bars)
- if (bar.Id == id) return bar;
- return null;
- }
-
- public ICollection<DockToolbar> Toolbars {
- get { return bars; }
- }
-
- public void ResetToolbarPositions ()
- {
- foreach (DockToolbarPanel panel in panels)
- panel.ResetBarPositions (false);
- }
-
- void SaveCurrentLayout ()
- {
- DockToolbarStatus[] status = SaveStatus ();
- layouts [currentLayout] = status;
- }
-
- void RestoreLayout (string layout)
- {
- DockToolbarStatus[] status;
- layouts.TryGetValue (layout, out status);
- RestoreStatus (status);
- currentLayout = layout;
- }
-
- internal void DeleteLayout (string layout)
- {
- if (layouts.ContainsKey (layout))
- layouts.Remove (layout);
- }
-
- DockToolbarStatus[] SaveStatus ()
- {
- DockToolbarStatus[] status = new DockToolbarStatus [bars.Count];
- for (int n=0; n<bars.Count; n++) {
- DockToolbar bar = (DockToolbar) bars [n];
- status [n] = bar.Status;
- }
- return status;
- }
-
- void RestoreStatus (DockToolbarStatus[] status)
- {
- foreach (IDockToolbar b in bars)
- b.Visible = false;
-
- if (status == null) {
- foreach (DockToolbar bar in bars)
- bar.Status = bar.DefaultStatus;
- } else {
- foreach (DockToolbarStatus s in status) {
- DockToolbar bar = (DockToolbar) GetBar (s.BarId);
- if (bar != null)
- bar.Status = s;
- }
- }
- }
-
- internal int DockMargin {
- get { return 7; }
- }
-
- internal void DockToolbar (DockToolbar bar, Placement placement, int offset, int row)
- {
- DockToolbarPanel p = GetPanel (placement);
- if (row != -1)
- p.AddDockToolbar (bar, offset, row);
- else
- p.AddDockToolbar (bar);
- }
-
- internal void FloatBar (DockToolbar bar, Orientation orientation, int x, int y)
- {
- FloatingDock fdock = new FloatingDock (this);
- fdock.Move (x, y);
- bar.ResetSize ();
- fdock.Attach (bar);
- bar.Orientation = orientation;
- }
-
- internal Gtk.Window TopWindow {
- get {
- Widget w = Parent;
- while (w != null && !(w is Gtk.Window))
- w = w.Parent;
- return (Gtk.Window) w;
- }
- }
-
- DockToolbarPanel GetPanel (Placement o)
- {
- return panels [(int)o];
- }
-
- protected override bool OnMotionNotifyEvent (EventMotion e)
- {
- if (dragBar != null) {
- int sx,sy;
- this.GdkWindow.GetOrigin (out sx, out sy);
- int rx = (int)e.XRoot - sx;
- int ry = (int)e.YRoot - sy;
-
- if (dragBar.Floating) {
- bool foundPanel = false;
- dragBar.FloatingDock.Move ((int)e.XRoot + xDragDif, (int)e.YRoot + yDragDif);
- Rectangle barRect = new Rectangle (rx + xDragDif, ry + yDragDif, dragBar.Allocation.Width, dragBar.DefaultHeight);
- foreach (DockToolbarPanel p in panels) {
- if (p.Allocation.IntersectsWith (barRect)) {
- if (targetPanel != null && targetPanel != p)
- targetPanel.EndDragBar (dragBar);
- p.Reposition (dragBar, rx, ry, xDragDif, yDragDif);
- targetPanel = p;
- foundPanel = true;
- break;
- }
- }
- if (!foundPanel && targetPanel != null)
- targetPanel.EndDragBar (dragBar);
- } else {
- DockToolbarPanel panel = (DockToolbarPanel) dragBar.Parent;
- panel.Reposition (dragBar, rx, ry, xDragDif, yDragDif);
- }
- }
- return base.OnMotionNotifyEvent (e);
- }
-
- internal void StartDragBar (DockToolbar bar, int x, int y, uint time)
- {
- dragBar = bar;
- xDragDif = -x;
- yDragDif = -y;
- Pointer.Grab (this.GdkWindow, false, EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask, null, handCursor, time);
- if (!bar.Floating) {
- DockToolbarPanel panel = (DockToolbarPanel) dragBar.Parent;
- panel.StartDragBar (bar);
- }
- }
-
- internal void EndDragBar (DockToolbar bar, uint time)
- {
- Pointer.Ungrab (time);
- if (targetPanel != null) {
- targetPanel.DropDragBar (bar);
- targetPanel.EndDragBar (bar);
- }
- dragBar = null;
- }
-
- protected override bool OnButtonReleaseEvent (EventButton e)
- {
- if (dragBar != null)
- EndDragBar (dragBar, e.Time);
-
- return base.OnButtonReleaseEvent (e);
- }
-
- protected override bool OnButtonPressEvent (Gdk.EventButton e)
- {
- if (e.TriggersContextMenu ()) {
- int sx,sy;
- this.GdkWindow.GetOrigin (out sx, out sy);
- int rx = (int)e.XRoot - sx;
- int ry = (int)e.YRoot - sy;
-
- foreach (DockToolbarPanel p in panels) {
- if (p.Allocation.Contains (rx, ry))
- OnPanelClick (e, p.Placement);
- }
- }
- return base.OnButtonPressEvent (e);
- }
-
- protected virtual void OnPanelClick (Gdk.EventButton e, Placement placement)
- {
- }
-
- protected override void OnDestroyed ()
- {
- if (handCursor != null) {
- handCursor.Dispose ();
- handCursor = null;
- }
- base.OnDestroyed ();
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrameLayout.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrameLayout.cs
deleted file mode 100644
index 1330a6aa25..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrameLayout.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// DockToolbarFrameLayout.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Xml.Serialization;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- public class DockToolbarFrameLayout
- {
- [XmlAttribute ("id")]
- public string Id;
-
- [XmlElement ("dockbar")]
- public DockToolbarStatus[] Bars;
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrameStatus.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrameStatus.cs
deleted file mode 100644
index 95d34d70b0..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarFrameStatus.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// DockToolbarFrameStatus.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Xml.Serialization;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- public class DockToolbarFrameStatus
- {
- internal const int CurrentVersion = 2;
-
- [XmlElement ("version")]
- public int Version = 1;
-
- [XmlElement ("layout", typeof(DockToolbarFrameLayout))]
- public ArrayList Status = new ArrayList ();
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarPanel.cs
deleted file mode 100644
index dcbec75139..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarPanel.cs
+++ /dev/null
@@ -1,1034 +0,0 @@
-//
-// DockToolbarPanel.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using Gtk;
-using Gdk;
-using System.Collections;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- internal class DockToolbarPanel: FixedPanel
- {
- DockToolbarFrame parentFrame;
- ArrayList bars = new ArrayList ();
- Orientation orientation;
-
- ArrowWindow placeholderArrow1;
- ArrowWindow placeholderArrow2;
- PlaceholderWindow placeholder;
- bool currentPlaceholderHorz;
-
- int dropOffset;
- int dropRow = -1;
- bool dropNewRow;
- bool enableAnimations = true;
-
- public DockToolbarPanel (DockToolbarFrame parentFrame, Placement placement)
- {
- // ResizeMode = ResizeMode.Immediate;
- Placement = placement;
- switch (placement) {
- case Placement.Top:
- this.orientation = Orientation.Horizontal;
- break;
- case Placement.Bottom:
- this.orientation = Orientation.Horizontal;
- break;
- case Placement.Left:
- this.orientation = Orientation.Vertical;
- break;
- case Placement.Right:
- this.orientation = Orientation.Vertical;
- break;
- }
-
- this.parentFrame = parentFrame;
- }
-
- public Orientation Orientation {
- get { return orientation; }
- }
-
- public void AddDockToolbar (DockToolbar bar)
- {
- bool ea = EnableAnimation (false);
-
- Put (bar, 0, 0);
- bar.Orientation = orientation;
-
- if (bars.Count > 0 && IsRealized) {
- DockToolbar last = (DockToolbar) bars [bars.Count - 1];
- int width = bar.DefaultSize;
- int lastx = last.DockOffset + last.DefaultSize;
-
- if (lastx + width <= PanelWidth)
- MoveBar (bar, lastx, last.DockRow, false);
- else
- MoveBar (bar, 0, last.DockRow + 1, false);
- bar.AnchorOffset = bar.DockOffset;
- InternalAdd (bar);
- SortBars ();
- } else {
- MoveBar (bar, 0, 0);
- bar.AnchorOffset = bar.DockOffset;
- InternalAdd (bar);
- }
-
- EnableAnimation (ea);
- }
-
- public void AddDockToolbar (DockToolbar bar, int offset, int row)
- {
- bool ea = EnableAnimation (false);
- InternalAdd (bar);
- Put (bar, 0, 0);
- bar.Orientation = orientation;
- MoveBar (bar, offset, row, false);
- bar.AnchorOffset = offset;
- SortBars ();
- UpdateRowSizes (bar.DockRow);
- EnableAnimation (ea);
- }
-
- void InternalAdd (DockToolbar bar)
- {
- bars.Add (bar);
- bar.DefaultSizeChanged += new EventHandler (OnBarSizeChanged);
- }
-
- public void RemoveBar (DockToolbar bar)
- {
- if (IsSingleBarRow (bar))
- RemoveRow (bar.DockRow);
-
- Remove (bar);
- bars.Remove (bar);
- bar.DefaultSizeChanged -= new EventHandler (OnBarSizeChanged);
-
- UpdateRowHeight (bar.DockRow);
- PackBars ();
- }
-
- protected override void OnRealized ()
- {
- base.OnRealized ();
- ResetBarPositions (false);
- }
-
- public void ResetBarPositions (bool animate)
- {
- int x=0, row=0;
- int width = PanelWidth;
-
- bool ea = EnableAnimation (animate);
-
- foreach (DockToolbar b in bars) {
- int barw = GetChildWidth (b);
- if (x + barw < width)
- MoveBar (b, x, row);
- else {
- row++;
- x = 0;
- MoveBar (b, 0, row);
- }
- x += barw;
- }
- SortBars ();
- EnableAnimation (ea);
- }
-
- void SetPlaceholder (DockToolbar bar, int offset, int row)
- {
- if (dropRow != row && dropRow != -1)
- RestoreShiftedBars (dropRow);
-
- ShowPlaceholder (bar, false, offset, GetRowTop (row), GetChildWidth (bar), GetRowSize (row));
-
- dropOffset = offset;
- dropRow = row;
- dropNewRow = false;
- }
-
- void SetNewRowPlaceholder (DockToolbar bar, int offset, int toprow)
- {
- if (dropRow != -1)
- RestoreShiftedBars (dropRow);
-
- int y = GetRowTop (toprow) - parentFrame.DockMargin;
- int h = parentFrame.DockMargin * 2;
- ShowPlaceholder (bar, true, offset, y, GetChildWidth (bar), h);
-
- dropOffset = offset;
- dropRow = toprow;
- dropNewRow = true;
- }
-
- void ShowPlaceholder (DockToolbar bar, bool horz, int x, int y, int w, int h)
- {
- if (orientation != Orientation.Horizontal)
- horz = !horz;
-
- PanelToWindow (x, y, w, h, out x, out y, out w, out h);
-
- bool created = false;
-
- if (placeholder == null || horz != currentPlaceholderHorz) {
- HidePlaceholder ();
- placeholder = new PlaceholderWindow (parentFrame);
- placeholderArrow1 = new ArrowWindow (parentFrame, horz ? ArrowWindow.Direction.Right : ArrowWindow.Direction.Down);
- placeholderArrow2 = new ArrowWindow (parentFrame, horz ? ArrowWindow.Direction.Left : ArrowWindow.Direction.Up);
- currentPlaceholderHorz = horz;
- created = true;
- }
-
- int sx, sy;
- this.GdkWindow.GetOrigin (out sx, out sy);
- sx += x;
- sy += y;
-
- int mg = -4;
- placeholder.Move (sx - mg, sy - mg);
- placeholder.Resize (w + mg*2, h + mg * 2);
-
- if (horz) {
- placeholderArrow1.Move (sx - placeholderArrow1.Width, sy + (h/2) - placeholderArrow1.Height/2);
- placeholderArrow2.Move (sx + w, sy + (h/2) - placeholderArrow1.Height/2);
- } else {
- int px = sx + w/2 - placeholderArrow1.Width/2;
- if (px < 0) px = 0;
- placeholderArrow1.Move (px, sy - placeholderArrow1.Height);
- placeholderArrow2.Move (px, sy + h);
- }
-
- if (created) {
- placeholder.Show ();
- placeholder.Present ();
- if (bar.FloatingDock != null)
- bar.FloatingDock.Present ();
- placeholderArrow1.Present ();
- placeholderArrow2.Present ();
- }
- }
-
- void HidePlaceholder ()
- {
- if (placeholder == null) return;
- placeholder.Destroy ();
- placeholder = null;
- placeholderArrow1.Destroy ();
- placeholderArrow1 = null;
- placeholderArrow2.Destroy ();
- placeholderArrow2 = null;
-
- if (dropRow != -1 && !dropNewRow) {
- RestoreShiftedBars (dropRow);
- dropRow = -1;
- }
- }
-
- bool IsPlaceHolderVisible {
- get { return placeholder != null; }
- }
-
- public void StartDragBar (DockToolbar bar)
- {
- }
-
- public void DropDragBar (DockToolbar bar)
- {
- if (!IsPlaceHolderVisible) return;
-
- foreach (DockToolbar b in bars) {
- if (b.DockRow == dropRow && b.DockShiftOffset != -1) {
- b.DockShiftOffset = -1;
- b.AnchorOffset = b.DockRow;
- }
- }
-
- if (dropRow != -1) {
- if (dropNewRow)
- InsertRow (bar, dropOffset, dropRow);
- else {
- MoveBar (bar, dropOffset, dropRow);
- UpdateRowHeight (dropRow);
- }
- SortBars ();
- dropRow = -1;
- }
- }
-
- public void EndDragBar (DockToolbar bar)
- {
- if (IsPlaceHolderVisible) {
- HidePlaceholder ();
- }
- }
-
- void RestoreShiftedBars (int row)
- {
- foreach (DockToolbar b in bars) {
- if (b.DockRow == row && b.DockShiftOffset != -1) {
- MoveBar (b, b.DockShiftOffset, b.DockRow, false);
- b.DockShiftOffset = -1;
- }
- }
- }
-
- public void Reposition (DockToolbar bar, int xcursor, int ycursor, int difx, int dify)
- {
- if (!bar.CanDockTo (this))
- return;
-
- bar.Orientation = orientation;
-
- int x, y;
- WindowToPanel (xcursor + difx, ycursor + dify, bar.Allocation.Width, bar.Allocation.Height, out x, out y);
- WindowToPanel (xcursor, ycursor, 0, 0, out xcursor, out ycursor);
-
- RepositionInternal (bar, x, y, xcursor, ycursor);
- }
-
- void RepositionInternal (DockToolbar bar, int x, int y, int xcursor, int ycursor)
- {
- int width = GetChildWidth (bar);
-
- ycursor = y + bar.DefaultHeight / 2;
-
- if (bars.Count == 0 && bar.Floating) {
- SetNewRowPlaceholder (bar, x, 0);
- return;
- }
-
- int dx = (x + width) - PanelWidth;
- if (dx > parentFrame.DockMargin && !bar.Floating) {
- HidePlaceholder ();
- FloatBar (bar, x, y);
- return;
- }
- else if (dx > 0)
- x -= dx;
- else if (x < -parentFrame.DockMargin && !bar.Floating) {
- HidePlaceholder ();
- FloatBar (bar, x, y);
- return;
- }
- else if (x < 0)
- x = 0;
-
- int nx = x;
- int row = -1;
-
- // Get the old bar y position
-
- int panelBottom = GetPanelBottom ();
-
- if (ycursor < - parentFrame.DockMargin || ycursor > panelBottom + parentFrame.DockMargin) {
- HidePlaceholder ();
- FloatBar (bar, x, y);
- return;
- }
-
- int rtop = 0;
- int prevtop = 0;
- row = 0;
- while (ycursor >= rtop) {
- prevtop = rtop;
- row++;
- if (rtop >= panelBottom) break;
- rtop += GetRowSize (row - 1);
- }
-
- row--;
- int ry = ycursor - prevtop;
-
- if (ry <= parentFrame.DockMargin && ry >= 0) {
- SetNewRowPlaceholder (bar, x, row);
- FloatBar (bar, x, y);
- return;
- } else if (ry >= (GetRowSize(row) - parentFrame.DockMargin) || (ry < 0 && -ry < parentFrame.DockMargin)) {
- SetNewRowPlaceholder (bar, x, row + 1);
- FloatBar (bar, x, y);
- return;
- }
-
- // Can't create a new row. Try to fit the bar in the current row
- // Find the first bar in the row:
-
- int ns = -1;
- for (int n=0; n<bars.Count; n++) {
- DockToolbar b = (DockToolbar)bars[n];
-
- // Ignore the bar being moved
- if (b == bar) continue;
-
- if (b.DockRow == row) {
- ns = n;
- break;
- }
- }
-
- if (ns == -1) {
- // There are no other bars, no problem then
- if (bar.Floating) {
- SetPlaceholder (bar, nx, row);
- return;
- }
-
- if ((nx == bar.DockOffset && row == bar.DockRow) || (row != bar.DockRow)) {
- SetPlaceholder (bar, nx, row);
- FloatBar (bar, x, y);
- return;
- }
-
- HidePlaceholder ();
- MoveBar (bar, nx, row);
- return;
- }
-
- // Compute the available space, and find the bars at the
- // left and the right of the bar being moved
-
- int gapsTotal = 0;
- int lastx = 0;
- int leftIndex=-1, rightIndex = -1;
- int gapsLeft = 0, gapsRight = 0;
-
- for (int n=ns; n<bars.Count; n++) {
- DockToolbar b = (DockToolbar)bars[n];
-
- // Ignore the bar being moved
- if (b == bar) continue;
-
- if (b.DockRow != row) break;
- int bx = b.DockOffset;
-
- if (bx > x && (rightIndex == -1))
- rightIndex = n;
- else if (bx <= x)
- leftIndex = n;
-
- if (bx < x)
- gapsLeft += bx - lastx;
- else {
- if (lastx < x) {
- gapsLeft += x - lastx;
- gapsRight += bx - x;
- } else
- gapsRight += bx - lastx;
- }
-
- gapsTotal += bx - lastx;
- lastx = GetChildRightOffset (b);
- }
-
- if (lastx < x) {
- gapsLeft += x - lastx;
- gapsRight += PanelWidth - x;
- } else {
- gapsRight += PanelWidth - lastx;
- }
-
- gapsTotal += PanelWidth - lastx;
-
- // Is there room for the bar?
- if (gapsTotal < width) {
- HidePlaceholder ();
- FloatBar (bar, x, y);
- return;
- }
-
- // Shift the bars at the left and the right
-
- int oversizeLeft = 0;
- int oversizeRight = 0;
-
- if (leftIndex != -1) {
- int r = GetChildRightOffset ((DockToolbar) bars [leftIndex]);
- oversizeLeft = r - nx;
- }
-
- if (rightIndex != -1) {
- int r = ((DockToolbar) bars [rightIndex]).DockOffset;
- oversizeRight = (nx + width) - r;
- }
-
- if (oversizeLeft > gapsLeft)
- oversizeRight += (oversizeLeft - gapsLeft);
- else if (oversizeRight > gapsRight)
- oversizeLeft += (oversizeRight - gapsRight);
-
- if (leftIndex != -1 && oversizeLeft > 0) {
- ShiftBar (leftIndex, -oversizeLeft);
- nx = GetChildRightOffset ((DockToolbar) bars [leftIndex]);
- }
-
- if (rightIndex != -1 && oversizeRight > 0) {
- ShiftBar (rightIndex, oversizeRight);
- nx = ((DockToolbar) bars [rightIndex]).DockOffset - width;
- }
-
-
- if (bar.Floating) {
- SetPlaceholder (bar, nx, row);
- return;
- }
-
- if ((nx == bar.DockOffset && row == bar.DockRow) || (row != bar.DockRow)) {
- if (bar.Floating) {
- SetPlaceholder (bar, nx, row);
- FloatBar (bar, x, y);
- }
- return;
- }
-
- HidePlaceholder ();
- MoveBar (bar, nx, row);
- }
-
- void FloatBar (DockToolbar bar, int x, int y)
- {
- if (bar.Floating) return;
-
- int wx,wy,w,h;
- PanelToWindow (x, y, GetChildWidth (bar), bar.DefaultHeight, out x, out y, out w, out h);
-
- this.GdkWindow.GetOrigin (out wx, out wy);
- RemoveBar (bar);
- parentFrame.FloatBar (bar, orientation, wx + x, wy + y);
- }
-
- void ShiftBar (int index, int size)
- {
- DockToolbar bar = (DockToolbar) bars [index];
- if (bar.DockShiftOffset == -1)
- bar.DockShiftOffset = bar.DockOffset;
-
- if (size > 0) {
- int rp = GetChildRightOffset (bar);
- int gap = PanelWidth - rp;
- if (index + 1 < bars.Count) {
- DockToolbar obar = (DockToolbar) bars [index + 1];
- if (bar.DockRow == obar.DockRow) {
- gap = obar.DockOffset - rp;
- if (gap < size) {
- ShiftBar (index + 1, size - gap);
- gap = obar.DockOffset - rp;
- }
- }
- }
- if (gap > size)
- gap = size;
- if (gap > 0)
- MoveBar (bar, bar.DockOffset + gap, bar.DockRow, false);
- } else {
- size = -size;
- int lp = bar.DockOffset;
- int gap = lp;
- if (index > 0) {
- DockToolbar obar = (DockToolbar) bars [index - 1];
- if (bar.DockRow == obar.DockRow) {
- gap = lp - GetChildRightOffset (obar);
- if (gap < size) {
- ShiftBar (index - 1, gap - size);
- gap = lp - GetChildRightOffset (obar);
- }
- }
- }
-
- if (gap > size)
- gap = size;
- if (gap > 0)
- MoveBar (bar, bar.DockOffset - gap, bar.DockRow, false);
- }
- }
-
- void MoveBar (DockToolbar bar, int x, int row)
- {
- MoveBar (bar, x, row, true);
- }
-
- void MoveBar (DockToolbar bar, int x, int row, bool setAnchorOffset)
- {
- int rt = GetRowTop (row);
-
- bar.DockRow = row;
- bar.DockOffset = x;
-
- if (bar.Floating) {
- FloatingDock win = bar.FloatingDock;
- win.Detach ();
- win.Destroy ();
-
- InternalAdd (bar);
- Put (bar, x, rt);
- SortBars ();
- ResetAnchorOffsets (row);
-
- } else {
- if (setAnchorOffset)
- ResetAnchorOffsets (row);
-
- InternalMove (bar, x, rt, true);
- }
- }
-
- void ResetAnchorOffsets (int row)
- {
- for (int n=0; n<bars.Count; n++) {
- DockToolbar b = (DockToolbar) bars [n];
- if (b.DockRow < row) continue;
- if (b.DockRow > row) return;
- b.AnchorOffset = b.DockOffset;
- }
- }
-
- void UpdateRowHeight (int row)
- {
- int nr = row + 1;
- bool ea = EnableAnimation (false);
- for (int n=0; n<bars.Count; n++) {
- DockToolbar b = (DockToolbar) bars [n];
- if (b.DockRow < nr) continue;
- MoveBar (b, b.DockOffset, b.DockRow);
- }
- EnableAnimation (ea);
- }
-
- void OnBarSizeChanged (object s, EventArgs e)
- {
- if (IsRealized)
- UpdateRowSizes (((DockToolbar)s).DockRow);
- }
-
- void UpdateRowSizes (int row)
- {
- int lastx = 0;
- for (int n=0; n<bars.Count; n++) {
- DockToolbar b = (DockToolbar) bars [n];
- if (b.DockRow < row) continue;
- if (b.DockRow > row) break;
- if (b.AnchorOffset < lastx)
- b.AnchorOffset = lastx;
- lastx = b.AnchorOffset + b.DefaultSize;
- }
- PackBars ();
- }
-
- protected override void OnSizeAllocated (Rectangle rect)
- {
- Rectangle oldRect = Allocation;
- base.OnSizeAllocated (rect);
-
- if (!rect.Equals (oldRect))
- PackBars ();
- }
-
- void PackBars ()
- {
- bool ea = EnableAnimation (false);
- int n=0;
- while (n < bars.Count)
- n = PackRow (n);
- EnableAnimation (ea);
- }
-
- int PackRow (int sn)
- {
- // The 'sn' parameter is the index if the first toolbar of the row.
- // It returns the index of the first toolbar of the next row
-
- int n = sn;
- int row = ((DockToolbar)bars[n]).DockRow;
- int lastx = 0;
- int gaps = 0;
-
- // Calculates the free space in the row
-
- while (n < bars.Count) {
- DockToolbar bar = (DockToolbar) bars [n];
- if (bar.DockRow != row) break;
-
- if (bar.AnchorOffset > lastx)
- gaps += bar.AnchorOffset - lastx;
-
- lastx = bar.AnchorOffset + bar.DefaultSize;
- n++;
- }
-
- if (lastx <= PanelWidth) {
- for (int i=sn; i<n; i++) {
- DockToolbar b = (DockToolbar) bars[i];
- if (b.AnchorOffset != b.DockOffset)
- MoveBar (b, b.AnchorOffset, b.DockRow, false);
- if (b.Size != b.DefaultSize) {
- b.ShowArrow = false;
- b.Size = b.DefaultSize;
- }
- }
- return n;
- }
-
- int barsSize = lastx - gaps;
- double gapShrink = 0;
-
- int[] sizeReduction = new int [n - sn];
-
- if (barsSize > PanelWidth) {
- int remSize = barsSize - PanelWidth;
- while (remSize > 0) {
- int oldRemSize = remSize;
- for (int k=n-1; k >= sn; k--) {
- int pos = k - sn;
- DockToolbar bar = (DockToolbar) bars [k];
- int newReduction = GetBarReduction (bar, remSize, sizeReduction [pos]);
- sizeReduction [pos] += newReduction;
- remSize -= newReduction;
- }
- if (oldRemSize == remSize)
- break;
- }
- }
- else
- gapShrink = ((double)(PanelWidth - barsSize)) / (double)gaps;
-
- lastx = 0;
- int newlastx = 0;
- for (int i=sn; i < n; i++) {
- DockToolbar bar = (DockToolbar) bars [i];
- int gap = bar.AnchorOffset - lastx;
- lastx = bar.AnchorOffset + bar.DefaultSize;
-
- int nx = (int)(newlastx + ((double)gap * gapShrink));
- if (nx != bar.DockOffset)
- MoveBar (bar, nx, bar.DockRow, false);
-
- int nw = bar.DefaultSize - sizeReduction [i - sn];
- if (nw != bar.Size) {
- bar.ShowArrow = nw != bar.DefaultSize;
- bar.Size = nw;
- }
- newlastx = bar.DockOffset + nw;
- }
-
- return n;
- }
-
- int GetBarReduction (DockToolbar bar, int sizeToReduce, int currentReduction)
- {
- Gtk.Widget[] children = bar.Children;
- int w = bar.DefaultSize;
- int arrowSize = 0;
- bar.Forall (delegate (Gtk.Widget wa) {
- if (wa is ToggleButton) {
- arrowSize = bar.Orientation == Orientation.Horizontal ? wa.SizeRequest ().Width : wa.SizeRequest ().Height;
- }
- });
- for (int n=children.Length - 1; n >= 1; n--) {
- if (!children [n].Visible)
- continue;
- int x;
- if (bar.Orientation == Orientation.Horizontal)
- x = children [n].Allocation.X - bar.Allocation.X;
- else
- x = children [n].Allocation.Y - bar.Allocation.Y;
- int rightSize = w - x - 1;
- if (rightSize > currentReduction) {
- int prevRequest = Orientation == Orientation.Horizontal ? children [n-1].SizeRequest ().Width : children [n-1].SizeRequest ().Height;
- if (prevRequest > arrowSize*2)
- continue;
- int newReduction = rightSize - currentReduction;
- if (newReduction > sizeToReduce)
- newReduction = sizeToReduce;
-
- int minSize = Orientation == Orientation.Horizontal ? children[0].SizeRequest ().Width : children[0].SizeRequest ().Height;
- minSize += arrowSize + 6;
- if (bar.DefaultSize - (currentReduction + newReduction) < minSize)
- newReduction = (bar.DefaultSize - minSize) - currentReduction;
-
- return newReduction;
- }
- }
- return 0;
- }
-
- int GetPanelBottom ()
- {
- if (bars.Count > 0) {
- DockToolbar bar = (DockToolbar) bars [bars.Count - 1];
- return GetRowTop (bar.DockRow + 1);
- }
- else
- return 0;
- }
-
- bool IsSingleBarRow (DockToolbar bar)
- {
- int row = bar.DockRow;
- foreach (DockToolbar b in bars) {
- if (bar != b && b.DockRow == row)
- return false;
- }
- return true;
- }
-
- void InsertRow (DockToolbar ibar, int offset, int row)
- {
- MoveBar (ibar, offset, row);
- foreach (DockToolbar bar in bars) {
- if (ibar != bar && bar.DockRow >= row)
- bar.DockRow++;
- }
- SortBars ();
- UpdateRowHeight (row);
- }
-
- void RemoveRow (int row)
- {
- foreach (DockToolbar bar in bars) {
- if (bar.DockRow >= row)
- MoveBar (bar, bar.DockOffset, bar.DockRow - 1, false);
- }
- }
-
- int GetChildRightOffset (DockToolbar bar)
- {
- return bar.DockOffset + bar.Size;
- }
-
- int GetRowSize (int row)
- {
- int max = 0;
- for (int n=0; n<bars.Count; n++) {
- DockToolbar b = (DockToolbar) bars [n];
- if (b.DockRow < row) continue;
- if (b.DockRow > row) return max;
- max = Math.Max (b.DefaultHeight, max);
- }
- return max;
- }
-
- int GetRowTop (int row)
- {
- int t = 0;
- for (int n=0; n < row; n++)
- t += GetRowSize (n);
- return t;
- }
-
- int MaxRow {
- get {
- var lastBar = (DockToolbar)bars[bars.Count -1];
- return lastBar.DockRow;
- }
- }
-
- void SortBars ()
- {
- bars.Sort (DocBarComparer.Instance);
- }
-
- void InternalMove (DockToolbar bar, int x, int y, bool animate)
- {
- if (bar.Animation != null) {
- bar.Animation.Cancel ();
- bar.Animation = null;
- }
-
- if (animate && enableAnimations) {
- bar.Animation = new MoveAnimation (this, bar, x, y);
- bar.Animation.Start ();
- }
- else
- Move (bar, x, y);
- }
-
- bool EnableAnimation (bool enable)
- {
- bool r = enableAnimations;
- enableAnimations = enable;
- return r;
- }
-
- protected override bool OnExposeEvent (EventExpose evnt)
- {
- //leave this plain unless there are horizontal children, so that the panel matches the toolbars
- //see DockToolbar.OnExposeEvent
- if (bars.Count == 0 || this.Orientation != Orientation.Horizontal)
- return base.OnExposeEvent (evnt);
-
- // get a proper GTK+ toolbar style by using one of the children, i.e. a DockToolbar, a subclass of GtkToolbar
- var styleProvider = (Widget)bars[0];
- var shadowType = (ShadowType) styleProvider.StyleGetProperty ("shadow-type");
-
- //render each row separately, so the theme treats each as a row, and they match the individual toolbars' themed painting
- int row = MaxRow;
- for (int i = bars.Count - 1; i >= 0; i--) {
- var bar = (DockToolbar) bars[i];
- if (bar.DockRow == row) {
- row--;
- //HACK: On Mac, PaintBox seems to fill the whole area instead of using it for clipping
- //so we create a new area for the row, to stop it overpainting other rows
- //otoh this could improve performance when only single rows are repainted, because we can intersect with invalidated area
- var rowArea = new Rectangle (Allocation.X, bar.Allocation.Y, Allocation.Width, bar.Allocation.Height);
- var invalidated = Gdk.Rectangle.Intersect (evnt.Area, rowArea);
- Style.PaintBox (bar.Style, evnt.Window, State, shadowType, invalidated, bar, "toolbar",
- rowArea.X, rowArea.Y, rowArea.Width, rowArea.Height);
- }
- }
-
- foreach (DockToolbar bar in bars)
- this.PropagateExpose (bar, evnt);
- return true;
- }
-
- //ensures that all widgets in each row have consistent allocation
- public override Requisition GetChildRequisition (Widget w)
- {
- var r = w.ChildRequisition;
- var t = (DockToolbar) w;
- var size = GetRowSize (t.DockRow);
- if (orientation == Orientation.Horizontal) {
- r.Height = size;
- } else {
- r.Width = size;
- }
- return r;
- }
- }
-
-
- internal class DocBarComparer: IComparer
- {
- internal static DocBarComparer Instance = new DocBarComparer ();
-
- public int Compare (object a, object b)
- {
- DockToolbar b1 = (DockToolbar) a;
- DockToolbar b2 = (DockToolbar) b;
-
- if (b1.DockRow < b2.DockRow) return -1;
- else if (b1.DockRow > b2.DockRow) return 1;
- else if (b1.DockOffset < b2.DockOffset) return -1;
- else if (b1.DockOffset > b2.DockOffset) return 1;
- else return 0;
- }
- }
-
- internal abstract class AnimationManager
- {
- static ArrayList anims = new ArrayList ();
- static int s = 0;
-
- public static void Animate (Animation a)
- {
- if (anims.Count == 0)
- GLib.Timeout.Add (10, new GLib.TimeoutHandler (Animate));
- anims.Add (a);
- }
-
- public static void CancelAnimation (Animation a)
- {
- anims.Remove (a);
- }
-
- public static bool Animate ()
- {
- s++;
- ArrayList toDelete = new ArrayList ();
- foreach (Animation a in anims)
- if (!a.Run ())
- toDelete.Add (a);
-
- foreach (object ob in toDelete)
- anims.Remove (ob);
-
- return anims.Count != 0;
- }
- }
-
- internal abstract class Animation
- {
- protected Widget widget;
-
- public Animation (Widget w)
- {
- widget = w;
- }
-
- public void Start ()
- {
- AnimationManager.Animate (this);
- }
-
- public void Cancel ()
- {
- AnimationManager.CancelAnimation (this);
- }
-
- internal protected abstract bool Run ();
- }
-
- internal class MoveAnimation: Animation
- {
- FixedPanel panel;
- float destx, desty;
- float curx, cury;
-
- public MoveAnimation (FixedPanel f, Widget w, int destx, int desty): base (w)
- {
- panel = f;
- int x, y;
- f.GetPosition (w, out x, out y);
- curx = (float)x;
- cury = (float)y;
- this.destx = (float) destx;
- this.desty = (float) desty;
- }
-
- internal protected override bool Run ()
- {
- float dx = destx - curx;
- float dy = desty - cury;
-
- dx = dx / 4;
- dy = dy / 4;
-
- curx += dx;
- cury += dy;
-
- panel.Move (widget, (int)curx, (int)cury);
-
- if(Math.Abs (dx) < 0.1 && Math.Abs (dy) < 0.1) {
- panel.Move (widget, (int)destx, (int)desty);
- return false;
- } else
- return true;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarPosition.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarPosition.cs
deleted file mode 100644
index dbf9121040..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarPosition.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// DockToolbarPosition.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using Gtk;
-using Gdk;
-using System.Collections;
-using System.Xml;
-using System.Xml.Serialization;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- [XmlInclude (typeof(DockedPosition))]
- [XmlInclude (typeof(FloatingPosition))]
- public class DockToolbarPosition
- {
- internal virtual void RestorePosition (DockToolbarFrame frame, DockToolbar bar) {}
-
- internal static DockToolbarPosition Create (DockToolbar bar)
- {
- if (bar.Floating)
- return new FloatingPosition (bar);
- else
- return new DockedPosition (bar);
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarStatus.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarStatus.cs
deleted file mode 100644
index 6db8ebd857..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockToolbarStatus.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// DockToolbarStatus.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Xml.Serialization;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- [XmlType ("dockBar")]
- public class DockToolbarStatus
- {
- bool visible;
- DockToolbarPosition position;
- string id;
-
- public DockToolbarStatus ()
- {
- }
-
- public DockToolbarStatus (string id, bool visible, DockToolbarPosition position)
- {
- this.visible = visible;
- this.position = position;
- this.id = id;
- }
-
- [XmlAttribute ("id")]
- public string BarId {
- get { return id; }
- set { id = value; }
- }
-
- [XmlElement ("visible")]
- public bool Visible {
- get { return visible; }
- set { visible = value; }
- }
-
- [XmlElement ("dockedPosition", typeof(DockedPosition))]
- [XmlElement ("floatingPosition", typeof(FloatingPosition))]
- public DockToolbarPosition Position {
- get { return position; }
- set { position = value; }
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockedPosition.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockedPosition.cs
deleted file mode 100644
index a3b3132c22..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/DockedPosition.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// DockedPosition.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Xml.Serialization;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- [XmlType ("dockedPosition")]
- public class DockedPosition: DockToolbarPosition
- {
- Placement placement;
- int dockOffset;
- int dockRow;
-
- public DockedPosition ()
- {
- }
-
- internal DockedPosition (DockToolbar bar)
- {
- dockOffset = bar.AnchorOffset;
- dockRow = bar.DockRow;
- placement = ((DockToolbarPanel)bar.Parent).Placement;
- }
-
- internal DockedPosition (Placement placement)
- {
- this.placement = placement;
- dockRow = -1;
- }
-
- [XmlAttribute ("offset")]
- public int DockOffset {
- get { return dockOffset; }
- set { dockOffset = value; }
- }
-
- [XmlAttribute ("row")]
- public int DockRow {
- get { return dockRow; }
- set { dockRow = value; }
- }
-
- [XmlAttribute ("placement")]
- public Placement Placement {
- get { return placement; }
- set { placement = value; }
- }
-
- internal override void RestorePosition (DockToolbarFrame frame, DockToolbar bar)
- {
- frame.DockToolbar (bar, placement, dockOffset, dockRow);
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FixedPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FixedPanel.cs
deleted file mode 100644
index ab3daa2305..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FixedPanel.cs
+++ /dev/null
@@ -1,270 +0,0 @@
-//
-// FixedPanel.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using Gtk;
-using Gdk;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- public enum Placement
- {
- Top, Bottom, Left, Right
- }
-
- public class FixedPanel: Container
- {
- ArrayList widgets = new ArrayList ();
- Placement placement = Placement.Top;
-
- public FixedPanel ()
- {
- Mono.TextEditor.GtkWorkarounds.FixContainerLeak (this);
-
- WidgetFlags |= WidgetFlags.NoWindow;
- }
-
- public Placement Placement {
- get { return placement; }
- set { placement = value; }
- }
-
- public override GLib.GType ChildType ()
- {
- return Widget.GType;
- }
-
- public void Put (Widget w, int x, int y)
- {
- WidgetPosition wpos = new WidgetPosition ();
- wpos.X = x;
- wpos.Y = y;
- wpos.Widget = w;
- widgets.Add (wpos);
- w.Parent = this;
- QueueResize ();
- }
-
- public void Move (Widget w, int x, int y)
- {
- int n = GetWidgetPosition (w);
- if (n != -1) {
- WidgetPosition wpos = (WidgetPosition) widgets [n];
- if (wpos.X == x && wpos.Y == y) return;
- wpos.X = x;
- wpos.Y = y;
- QueueResize ();
- }
- }
-
- public bool GetPosition (Widget w, out int x, out int y)
- {
- int n = GetWidgetPosition (w);
- if (n != -1) {
- WidgetPosition wpos = (WidgetPosition) widgets [n];
- x = wpos.X;
- y = wpos.Y;
- return true;
- }
- x = y = 0;
- return false;
- }
-
- public virtual Requisition GetChildRequisition (Widget w)
- {
- return w.ChildRequisition;
- }
-
- public int GetChildWidth (Widget w)
- {
- // ResizeChildren ();
- if (placement == Placement.Top || placement == Placement.Bottom)
- return w.Allocation.Width;
- else
- return w.Allocation.Height;
- }
-
- public int GetChildHeight (Widget w)
- {
- if (placement == Placement.Top || placement == Placement.Bottom)
- return w.Allocation.Height;
- else
- return w.Allocation.Width;
- }
-
- public int PanelWidth {
- get {
- if (placement == Placement.Top || placement == Placement.Bottom)
- return Allocation.Width;
- else
- return Allocation.Height;
- }
- }
-
- public void WindowToPanel (int x, int y, int w, int h, out int rx, out int ry)
- {
- switch (placement) {
- case Placement.Top:
- rx = x - Allocation.X;
- ry = y - Allocation.Y;
- break;
- case Placement.Bottom:
- rx = x - Allocation.X;
- ry = Allocation.Bottom - y - h - 1;
- break;
- case Placement.Left:
- rx = y - Allocation.Y;
- ry = x - Allocation.X;
- break;
- default:
- rx = y - Allocation.Y;
- ry = Allocation.Right - x - w - 1;
- break;
- }
- }
-
- public void PanelToWindow (int x, int y, int w, int h, out int rx, out int ry, out int rw, out int rh)
- {
- switch (placement) {
- case Placement.Top:
- rx = x + Allocation.X;
- ry = y + Allocation.Y;
- rw = w;
- rh = h;
- break;
- case Placement.Bottom:
- rx = x + Allocation.X;
- ry = Allocation.Bottom - y - h - 1;
- rw = w;
- rh = h;
- break;
- case Placement.Left:
- rx = y + Allocation.X;
- ry = x + Allocation.Y;
- rw = h;
- rh = w;
- break;
- default:
- rx = Allocation.Right - y - h - 1;
- ry = x + Allocation.Y;
- rw = h;
- rh = w;
- break;
- }
- }
-
- protected override void OnAdded (Widget w)
- {
- Put (w, 0, 0);
- }
-
- protected override void OnRemoved (Widget w)
- {
- int i = GetWidgetPosition (w);
- if (i != -1) {
- widgets.RemoveAt (i);
- w.Unparent ();
- QueueResize ();
- }
- }
-
- int GetWidgetPosition (Widget w)
- {
- for (int n=0; n<widgets.Count; n++)
- if (((WidgetPosition)widgets[n]).Widget == w)
- return n;
- return -1;
- }
-
- protected override void OnSizeRequested (ref Requisition req)
- {
- req.Width = req.Height = 0;
- foreach (WidgetPosition pos in widgets) {
- Requisition wreq = pos.Widget.SizeRequest ();
- if (placement == Placement.Top || placement == Placement.Bottom) {
- if (pos.X + wreq.Width > req.Width)
- req.Width = pos.X + wreq.Width;
- if (pos.Y + wreq.Height > req.Height)
- req.Height = pos.Y + wreq.Height;
- } else {
- if (pos.Y + wreq.Width > req.Width)
- req.Width = pos.Y + wreq.Width;
- if (pos.X + wreq.Height > req.Height)
- req.Height = pos.X + wreq.Height;
- }
- }
- if (placement == Placement.Top || placement == Placement.Bottom)
- req.Width = 0;
- else
- req.Height = 0;
- }
-
- protected override void OnSizeAllocated (Gdk.Rectangle rect)
- {
- base.OnSizeAllocated (rect);
- foreach (WidgetPosition pos in widgets) {
- Requisition req = GetChildRequisition (pos.Widget);
- Rectangle crect = new Rectangle (pos.X, pos.Y, req.Width, req.Height);
- switch (placement) {
- case Placement.Top:
- break;
- case Placement.Bottom:
- crect.Y = Allocation.Height - crect.Y - crect.Height;
- break;
- case Placement.Left: {
- int t = crect.X; crect.X=crect.Y; crect.Y=t;
- break;
- }
- case Placement.Right: {
- int t = crect.X; crect.X=crect.Y; crect.Y=t;
- crect.X = Allocation.Width - crect.X - crect.Width;
- break;
- }
- }
- crect.X += Allocation.X;
- crect.Y += Allocation.Y;
- pos.Widget.SizeAllocate (crect);
- }
- }
-
- protected override void ForAll (bool include_internals, Gtk.Callback callback)
- {
- WidgetPosition[] positions = (WidgetPosition[]) widgets.ToArray (typeof (WidgetPosition));
- foreach (WidgetPosition pos in positions)
- callback (pos.Widget);
- }
- }
-
- class WidgetPosition
- {
- public int X;
- public int Y;
- public Widget Widget;
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FloatingDock.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FloatingDock.cs
deleted file mode 100644
index 2cf64c9985..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FloatingDock.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// FloatingDock.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using Gtk;
-using Gdk;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- internal class FloatingDock: Gtk.Window
- {
- DockToolbar bar;
-
- public FloatingDock (DockToolbarFrame frame): base (Gtk.WindowType.Toplevel)
- {
- SkipTaskbarHint = true;
- Decorated = false;
- TransientFor = frame.TopWindow;
- }
-
- public void Attach (DockToolbar bar)
- {
- this.bar = bar;
- bar.FloatingDock = this;
- Frame f = new Frame ();
- f.Shadow = ShadowType.Out;
- f.Add (bar);
- Add (f);
- f.Show ();
- bar.Show ();
- Show ();
- }
-
- public void Detach ()
- {
- bar.FloatingDock = null;
- ((Frame)bar.Parent).Remove (bar);
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FloatingPosition.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FloatingPosition.cs
deleted file mode 100644
index 56261d72e8..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/FloatingPosition.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// FloatingPosition.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using Gtk;
-using System.Xml.Serialization;
-
-namespace MonoDevelop.Components.DockToolbars
-{
- [XmlType ("floatingPosition")]
- public class FloatingPosition: DockToolbarPosition
- {
- Orientation orientation;
- int x;
- int y;
-
- public FloatingPosition ()
- {
- }
-
- internal FloatingPosition (DockToolbar bar)
- {
- orientation = bar.Orientation;
- bar.FloatingDock.GetPosition (out x, out y);
- }
-
- [XmlAttribute ("x")]
- public int X {
- get { return x; }
- set { x = value; }
- }
-
- [XmlAttribute ("y")]
- public int Y {
- get { return y; }
- set { y = value; }
- }
-
- [XmlAttribute ("orientation")]
- public Orientation Orientation {
- get { return orientation; }
- set { orientation = value; }
- }
-
- internal override void RestorePosition (DockToolbarFrame frame, DockToolbar bar)
- {
- frame.FloatBar (bar, orientation, x, y);
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/IDockBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/IDockBar.cs
deleted file mode 100644
index 121347720d..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/IDockBar.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//
-// IDockToolbar.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace MonoDevelop.Components.DockToolbars
-{
- public interface IDockToolbar
- {
- string Id { get; }
- string Title { get; }
- bool Visible { get; set; }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/PlaceholderWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/PlaceholderWindow.cs
deleted file mode 100644
index 9ed4fd72de..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockToolbars/PlaceholderWindow.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// PlaceholderWindow.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace MonoDevelop.Components.DockToolbars
-{
- internal class PlaceholderWindow: Gtk.Window
- {
- Gdk.GC redgc;
-
- public PlaceholderWindow (DockToolbarFrame frame): base (Gtk.WindowType.Toplevel)
- {
- SkipTaskbarHint = true;
- Decorated = false;
- TransientFor = frame.TopWindow;
- Realize ();
- redgc = new Gdk.GC (GdkWindow);
- redgc.RgbFgColor = new Gdk.Color (255, 0, 0);
- }
-
- protected override bool OnExposeEvent (Gdk.EventExpose args)
- {
- base.OnExposeEvent (args);
- int w, h;
- this.GetSize (out w, out h);
- this.GdkWindow.DrawRectangle (redgc, false, 0, 0, w-1, h-1);
- return true;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs
index b3d5cf4779..0ad3d05024 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/AutoHideBox.cs
@@ -30,10 +30,8 @@
//#define ANIMATE_DOCKING
-using System;
using Gtk;
using Gdk;
-using Mono.TextEditor;
namespace MonoDevelop.Components.Docking
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs
index c3d7ae3c1a..d269d7b6f1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBar.cs
@@ -31,13 +31,11 @@
using System;
using Gtk;
-using System.Collections.Generic;
using MonoDevelop.Ide.Gui;
-using Mono.TextEditor;
namespace MonoDevelop.Components.Docking
{
- public class DockBar: Gtk.EventBox
+ class DockBar: Gtk.EventBox
{
Gtk.PositionType position;
Box box;
@@ -215,29 +213,8 @@ namespace MonoDevelop.Components.Docking
var alloc = Allocation;
using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) {
ctx.Rectangle (alloc.X, alloc.Y, alloc.X + alloc.Width, alloc.Y + alloc.Height);
- Cairo.LinearGradient gr;
- if (Orientation == Gtk.Orientation.Vertical)
- gr = new Cairo.LinearGradient (alloc.X, alloc.Y, alloc.X + alloc.Width, alloc.Y);
- else
- gr = new Cairo.LinearGradient (alloc.X, alloc.Y, alloc.X, alloc.Y + alloc.Height);
- using (gr) {
- gr.AddColorStop (0, Styles.DockBarBackground1);
- gr.AddColorStop (1, Styles.DockBarBackground2);
- ctx.SetSource (gr);
- }
+ ctx.SetSourceColor (Styles.DockBarBackground.ToCairoColor ());
ctx.Fill ();
-
- // Light shadow
- double offs = ShowBorder ? 1.5 : 0.5;
- switch (Position) {
- case PositionType.Left:ctx.MoveTo (alloc.X + alloc.Width - offs, alloc.Y); ctx.RelLineTo (0, Allocation.Height); break;
- case PositionType.Right: ctx.MoveTo (alloc.X + offs, alloc.Y); ctx.RelLineTo (0, Allocation.Height); break;
- case PositionType.Top: ctx.MoveTo (alloc.X, alloc.Y + alloc.Height - offs); ctx.RelLineTo (Allocation.Width, 0); break;
- case PositionType.Bottom: ctx.MoveTo (alloc.X, alloc.Y + offs); ctx.RelLineTo (Allocation.Width, 0); break;
- }
- ctx.LineWidth = 1;
- ctx.SetSourceColor (Styles.DockBarSeparatorColorLight);
- ctx.Stroke ();
}
if (Child != null)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs
index 4efd300406..b4cb07dfd6 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockBarItem.cs
@@ -31,11 +31,12 @@
using System;
using Gtk;
-using Mono.TextEditor;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Components;
using Xwt.Motion;
using Animations = Xwt.Motion.AnimationExtensions;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.Components.Docking
{
@@ -149,6 +150,8 @@ namespace MonoDevelop.Components.Docking
else
crossfade.ShowPrimary ();
};
+
+ Styles.Changed += UpdateStyle;
}
void IAnimatable.BatchBegin () { }
@@ -179,6 +182,7 @@ namespace MonoDevelop.Components.Docking
{
base.OnDestroyed ();
bar.Frame.SizeAllocated -= HandleBarFrameSizeAllocated;
+ Ide.Gui.Styles.Changed -= UpdateStyle;
}
@@ -208,50 +212,62 @@ namespace MonoDevelop.Components.Docking
if (bar.Orientation == Gtk.Orientation.Horizontal) {
box = new HBox ();
if (bar.AlignToEnd)
- mainBox.SetPadding (3, 3, 11, 9);
+ mainBox.SetPadding (5, 5, 11, 9);
else
- mainBox.SetPadding (3, 3, 9, 11);
+ mainBox.SetPadding (5, 5, 9, 11);
}
else {
box = new VBox ();
if (bar.AlignToEnd)
- mainBox.SetPadding (11, 9, 3, 3);
+ mainBox.SetPadding (11, 9, 5, 5);
else
- mainBox.SetPadding (9, 11, 3, 3);
+ mainBox.SetPadding (9, 11, 5, 5);
}
- Gtk.Widget customLabel = null;
- if (it.DockLabelProvider != null)
- customLabel = it.DockLabelProvider.CreateLabel (bar.Orientation);
-
- if (customLabel != null) {
- customLabel.ShowAll ();
- box.PackStart (customLabel, true, true, 0);
+ if (it.Icon != null) {
+ var desat = it.Icon.WithAlpha (0.5);
+ crossfade = new CrossfadeIcon (desat, it.Icon);
+ box.PackStart (crossfade, false, false, 0);
+ desat.Dispose ();
}
- else {
- if (it.Icon != null) {
- var desat = it.Icon.WithAlpha (0.5);
- crossfade = new CrossfadeIcon (desat, it.Icon);
- box.PackStart (crossfade, false, false, 0);
- desat.Dispose ();
+
+ if (!string.IsNullOrEmpty (it.Label)) {
+ label = new Label (it.Label);
+ label.UseMarkup = true;
+ label.ModifyFont (FontService.SansFont.CopyModified (Styles.FontScale11));
+
+ if (bar.Orientation == Orientation.Vertical)
+ label.Angle = 270;
+
+ // fine-tune label alignment issues
+ if (Platform.IsMac) {
+ if (bar.Orientation == Orientation.Horizontal)
+ label.SetAlignment (0, 0.5f);
+ else
+ label.SetAlignment (0.6f, 0);
+ } else {
+ if (bar.Orientation == Orientation.Vertical)
+ label.SetAlignment (1, 0);
}
-
- if (!string.IsNullOrEmpty (it.Label)) {
- label = new Gtk.Label (it.Label);
- label.UseMarkup = true;
- if (bar.Orientation == Gtk.Orientation.Vertical)
- label.Angle = 270;
- box.PackStart (label, true, true, 0);
- } else
- label = null;
- }
+ // TODO: VV: Test Linux
+
+ box.PackStart (label, true, true, 0);
+ } else
+ label = null;
box.Spacing = 2;
mainBox.Add (box);
mainBox.ShowAll ();
Add (mainBox);
+ UpdateStyle (this, null);
QueueDraw ();
}
+
+ void UpdateStyle (object sender, EventArgs e)
+ {
+ if (label != null)
+ label.ModifyFg (StateType.Normal, Styles.DockBarLabelColor.ToGdkColor ());
+ }
public MonoDevelop.Components.Docking.DockItem DockItem {
get {
@@ -451,6 +467,8 @@ namespace MonoDevelop.Components.Docking
using (var context = Gdk.CairoHelper.Create (evnt.Window)) {
var alloc = Allocation;
+ // TODO: VV: Remove preflight gradient features and replace with a flat color
+
Cairo.LinearGradient lg;
if (bar.Orientation == Orientation.Horizontal) {
@@ -460,7 +478,7 @@ namespace MonoDevelop.Components.Docking
}
using (lg) {
- Cairo.Color primaryColor = Styles.DockBarPrelightColor;
+ Cairo.Color primaryColor = Styles.DockBarPrelightColor.ToCairoColor ();
primaryColor.A = hoverProgress;
Cairo.Color transparent = primaryColor;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs
index b02b654ba6..02d677b87b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs
@@ -56,7 +56,7 @@ namespace MonoDevelop.Components.Docking
public DockContainer (DockFrame frame)
{
- Mono.TextEditor.GtkWorkarounds.FixContainerLeak (this);
+ GtkWorkarounds.FixContainerLeak (this);
this.Events = EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.PointerMotionMask | EventMask.LeaveNotifyMask;
this.frame = frame;
@@ -224,6 +224,13 @@ namespace MonoDevelop.Components.Docking
needsRelayout = true;
QueueResize ();
}
+
+ public void ReloadStyles ()
+ {
+ foreach (var item in Items)
+ item.SetRegionStyle (frame.GetRegionStyleForItem (item));
+ RelayoutWidgets ();
+ }
void LayoutWidgets ()
{
@@ -363,7 +370,7 @@ namespace MonoDevelop.Components.Docking
//GdkWindow.SetBackPixmap (null, true);
- ModifyBase (StateType.Normal, Styles.DockFrameBackground);
+ ModifyBase (StateType.Normal, Styles.DockFrameBackground.ToGdkColor ());
}
protected override void OnUnrealized ()
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs
index 6022b195bc..5ce3c7a7e7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs
@@ -40,8 +40,10 @@ using MonoDevelop.Core;
namespace MonoDevelop.Components.Docking
{
- public class DockFrame: HBox, IAnimatable
+ class DockFrame: HBox, IAnimatable
{
+ public event EventHandler<EventArgs> LayoutChanged;
+
internal const double ItemDockCenterArea = 0.4;
internal const int GroupDockSeparatorSize = 40;
@@ -68,7 +70,7 @@ namespace MonoDevelop.Components.Docking
public DockFrame ()
{
- Mono.TextEditor.GtkWorkarounds.FixContainerLeak (this);
+ GtkWorkarounds.FixContainerLeak (this);
dockBarTop = new DockBar (this, Gtk.PositionType.Top);
dockBarBottom = new DockBar (this, Gtk.PositionType.Bottom);
@@ -667,6 +669,7 @@ namespace MonoDevelop.Components.Docking
while (reader.NodeType != XmlNodeType.EndElement) {
if (reader.NodeType == XmlNodeType.Element) {
DockLayout layout = DockLayout.Read (this, reader);
+ layout.AllocationChanged += LayoutAllocationChanged;
layouts.Add (layout.Name, layout);
}
else
@@ -677,6 +680,11 @@ namespace MonoDevelop.Components.Docking
container.RelayoutWidgets ();
}
+ void LayoutAllocationChanged (object sender, EventArgs e)
+ {
+ LayoutChanged?.Invoke (this, EventArgs.Empty);
+ }
+
internal void UpdateTitle (DockItem item)
{
DockGroupItem gitem = container.FindDockGroupItem (item.Id);
@@ -690,6 +698,11 @@ namespace MonoDevelop.Components.Docking
dockBarRight.UpdateTitle (item);
}
+ internal void UpdateStyles ()
+ {
+ container.ReloadStyles ();
+ }
+
internal void UpdateStyle (DockItem item)
{
DockGroupItem gitem = container.FindDockGroupItem (item.Id);
@@ -861,7 +874,7 @@ namespace MonoDevelop.Components.Docking
w.Y = y;
if (UseWindowsForTopLevelFrames) {
- var win = new Gtk.Window (Gtk.WindowType.Toplevel);
+ var win = new IdeWindow (Gtk.WindowType.Toplevel);
win.SkipTaskbarHint = true;
win.Decorated = false;
win.TypeHint = Gdk.WindowTypeHint.Toolbar;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroup.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroup.cs
index 51b415811c..324c62f945 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroup.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroup.cs
@@ -140,11 +140,10 @@ namespace MonoDevelop.Components.Docking
gitem.ParentGroup = this;
return gitem;
}
-
+
DockGroupItem Split (DockGroupType newType, bool addFirst, DockItem obj, int npos)
{
DockGroupItem item = new DockGroupItem (Frame, obj);
-
if (npos == -1 || type == DockGroupType.Tabbed) {
if (ParentGroup != null && ParentGroup.Type == newType) {
// No need to split. Just add the new item as a sibling of this one.
@@ -189,7 +188,7 @@ namespace MonoDevelop.Components.Docking
}
return item;
}
-
+
internal DockGroup FindGroupContaining (string id)
{
DockGroupItem it = FindDockGroupItem (id);
@@ -454,7 +453,8 @@ namespace MonoDevelop.Components.Docking
for (int n=0; n<VisibleObjects.Count; n++) {
DockObject ob = VisibleObjects [n];
- int ins = (int) Math.Truncate (ob.Size);
+ double obSize = double.IsNaN (ob.Size) ? 10.0 : ob.Size;
+ int ins = (int) Math.Truncate (obSize);
if (n == VisibleObjects.Count - 1)
ins = realSize - ts;
@@ -872,7 +872,7 @@ namespace MonoDevelop.Components.Docking
if (areasList == null && oper == DrawSeparatorOperation.Draw) {
hgc = new Gdk.GC (Frame.Container.GdkWindow);
- hgc.RgbFgColor = Styles.DockFrameBackground;
+ hgc.RgbFgColor = Styles.DockFrameBackground.ToGdkColor ();
}
for (int n=0; n<VisibleObjects.Count; n++) {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroupItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroupItem.cs
index bd754980fb..00108eb7d8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroupItem.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockGroupItem.cs
@@ -260,7 +260,7 @@ namespace MonoDevelop.Components.Docking
if (floatRect.Equals (Gdk.Rectangle.Zero)) {
int x, y;
item.Widget.TranslateCoordinates (item.Widget.Toplevel, 0, 0, out x, out y);
- Gtk.Window win = Frame.Toplevel as Window;
+ Gtk.Window win = Frame.Toplevel as Gtk.Window;
if (win != null) {
int wx, wy;
win.GetPosition (out wx, out wy);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItem.cs
index 913edeebc1..c1054eec77 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItem.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItem.cs
@@ -30,15 +30,14 @@
using System;
using System.Xml;
-using Gtk;
using Mono.Unix;
-using Mono.TextEditor;
namespace MonoDevelop.Components.Docking
{
public class DockItem
{
- Widget content;
+ Control content;
+ Gtk.Widget gtkContent;
DockItemContainer widget;
string defaultLocation;
bool defaultVisible = true;
@@ -58,7 +57,6 @@ namespace MonoDevelop.Components.Docking
bool gettingContent;
bool isPositionMarker;
bool stickyVisible;
- IDockItemLabelProvider dockLabelProvider;
DockItemToolbar toolbarTop;
DockItemToolbar toolbarBottom;
DockItemToolbar toolbarLeft;
@@ -81,11 +79,6 @@ namespace MonoDevelop.Components.Docking
currentVisualStyle = regionStyle = frame.GetRegionStyleForItem (this);
}
- internal DockItem (DockFrame frame, Widget w, string id): this (frame, id)
- {
- content = w;
- }
-
public string Id {
get { return id; }
}
@@ -144,11 +137,6 @@ namespace MonoDevelop.Components.Docking
}
}
- public IDockItemLabelProvider DockLabelProvider {
- get { return this.dockLabelProvider; }
- set { this.dockLabelProvider = value; }
- }
-
internal DockItemContainer Widget {
get {
if (widget == null) {
@@ -211,35 +199,36 @@ namespace MonoDevelop.Components.Docking
UpdateContentVisibleStatus ();
}
- public Widget Content {
+ public Control Content {
get {
return content;
}
set {
content = value;
+ gtkContent = content.GetNativeWidget<Gtk.Widget> ();
if (!gettingContent && widget != null)
widget.UpdateContent ();
}
}
- public DockItemToolbar GetToolbar (PositionType position)
+ public DockItemToolbar GetToolbar (DockPositionType position)
{
switch (position) {
- case PositionType.Top:
- if (toolbarTop == null)
- toolbarTop = new DockItemToolbar (this, PositionType.Top);
+ case DockPositionType.Top:
+ if (toolbarTop == null)
+ toolbarTop = new DockItemToolbar (this, DockPositionType.Top);
return toolbarTop;
- case PositionType.Bottom:
+ case DockPositionType.Bottom:
if (toolbarBottom == null)
- toolbarBottom = new DockItemToolbar (this, PositionType.Bottom);
+ toolbarBottom = new DockItemToolbar (this, DockPositionType.Bottom);
return toolbarBottom;
- case PositionType.Left:
+ case DockPositionType.Left:
if (toolbarLeft == null)
- toolbarLeft = new DockItemToolbar (this, PositionType.Left);
+ toolbarLeft = new DockItemToolbar (this, DockPositionType.Left);
return toolbarLeft;
- case PositionType.Right:
+ case DockPositionType.Right:
if (toolbarRight == null)
- toolbarRight = new DockItemToolbar (this, PositionType.Right);
+ toolbarRight = new DockItemToolbar (this, DockPositionType.Right);
return toolbarRight;
default: throw new ArgumentException ();
}
@@ -351,20 +340,20 @@ namespace MonoDevelop.Components.Docking
internal void SetFocus ()
{
- SetFocus (Content);
+ SetFocus (gtkContent);
}
- internal static void SetFocus (Widget w)
+ internal static void SetFocus (Gtk.Widget w)
{
- w.ChildFocus (DirectionType.Down);
+ w.ChildFocus (Gtk.DirectionType.Down);
- Window win = w.Toplevel as Gtk.Window;
+ Gtk.Window win = w.Toplevel as Gtk.Window;
if (win == null)
return;
// Make sure focus is not given to internal children
if (win.Focus != null) {
- Container c = win.Focus.Parent as Container;
+ Gtk.Container c = win.Focus.Parent as Gtk.Container;
if (c.Children.Length == 0)
win.Focus = c;
}
@@ -416,15 +405,15 @@ namespace MonoDevelop.Components.Docking
ResetMode ();
SetRegionStyle (frame.GetRegionStyleForItem (this));
- floatingWindow = new DockFloatingWindow ((Window)frame.Toplevel, GetWindowTitle ());
+ floatingWindow = new DockFloatingWindow ((Gtk.Window)frame.Toplevel, GetWindowTitle ());
Ide.IdeApp.CommandService.RegisterTopWindow (floatingWindow);
- VBox box = new VBox ();
+ Gtk.VBox box = new Gtk.VBox ();
box.Show ();
box.PackStart (TitleTab, false, false, 0);
box.PackStart (Widget, true, true, 0);
floatingWindow.Add (box);
- floatingWindow.DeleteEvent += delegate (object o, DeleteEventArgs a) {
+ floatingWindow.DeleteEvent += delegate (object o, Gtk.DeleteEventArgs a) {
if (behavior == DockItemBehavior.CantClose)
Status = DockItemStatus.Dockable;
else
@@ -541,34 +530,34 @@ namespace MonoDevelop.Components.Docking
internal void ShowDockPopupMenu (uint time)
{
- Menu menu = new Menu ();
+ Gtk.Menu menu = new Gtk.Menu ();
// Hide menuitem
if ((Behavior & DockItemBehavior.CantClose) == 0) {
- MenuItem mitem = new MenuItem (Catalog.GetString("Hide"));
+ Gtk.MenuItem mitem = new Gtk.MenuItem (Catalog.GetString("Hide"));
mitem.Activated += delegate { Visible = false; };
menu.Append (mitem);
}
- MenuItem citem;
+ Gtk.MenuItem citem;
// Auto Hide menuitem
if ((Behavior & DockItemBehavior.CantAutoHide) == 0 && Status != DockItemStatus.AutoHide) {
- citem = new MenuItem (Catalog.GetString("Minimize"));
+ citem = new Gtk.MenuItem (Catalog.GetString("Minimize"));
citem.Activated += delegate { Status = DockItemStatus.AutoHide; };
menu.Append (citem);
}
if (Status != DockItemStatus.Dockable) {
// Dockable menuitem
- citem = new MenuItem (Catalog.GetString("Dock"));
+ citem = new Gtk.MenuItem (Catalog.GetString("Dock"));
citem.Activated += delegate { Status = DockItemStatus.Dockable; };
menu.Append (citem);
}
// Floating menuitem
if ((Behavior & DockItemBehavior.NeverFloating) == 0 && Status != DockItemStatus.Floating) {
- citem = new MenuItem (Catalog.GetString("Undock"));
+ citem = new Gtk.MenuItem (Catalog.GetString("Undock"));
citem.Activated += delegate { Status = DockItemStatus.Floating; };
menu.Append (citem);
}
@@ -595,18 +584,14 @@ namespace MonoDevelop.Components.Docking
// See BXC9883 - Xamarin Studio hides when there is a nonmodal floating window and it loses focus
// https://bugzilla.xamarin.com/show_bug.cgi?id=9883
//
- class DockFloatingWindow : Window
+ class DockFloatingWindow : Gtk.Window
{
- public DockFloatingWindow (Window dockParent, string title) : base (title)
+ public DockFloatingWindow (Gtk.Window dockParent, string title) : base (title)
{
+ this.ApplyTheme ();
this.DockParent = dockParent;
}
- public Window DockParent { get; private set; }
- }
-
- public interface IDockItemLabelProvider
- {
- Gtk.Widget CreateLabel (Orientation orientation);
+ public Gtk.Window DockParent { get; private set; }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs
index 6fef6b1d98..933d1bcf6f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemContainer.cs
@@ -30,9 +30,6 @@
using System;
using Gtk;
-using Mono.Unix;
-using Mono.TextEditor;
-using MonoDevelop.Ide.Gui;
namespace MonoDevelop.Components.Docking
{
@@ -56,21 +53,21 @@ namespace MonoDevelop.Components.Docking
ShowAll ();
- mainBox.PackStart (item.GetToolbar (PositionType.Top).Container, false, false, 0);
+ mainBox.PackStart (item.GetToolbar (DockPositionType.Top).Container, false, false, 0);
HBox hbox = new HBox ();
hbox.Show ();
- hbox.PackStart (item.GetToolbar (PositionType.Left).Container, false, false, 0);
+ hbox.PackStart (item.GetToolbar (DockPositionType.Left).Container, false, false, 0);
contentBox = new HBox ();
contentBox.Show ();
hbox.PackStart (contentBox, true, true, 0);
- hbox.PackStart (item.GetToolbar (PositionType.Right).Container, false, false, 0);
+ hbox.PackStart (item.GetToolbar (DockPositionType.Right).Container, false, false, 0);
mainBox.PackStart (hbox, true, true, 0);
- mainBox.PackStart (item.GetToolbar (PositionType.Bottom).Container, false, false, 0);
+ mainBox.PackStart (item.GetToolbar (DockPositionType.Bottom).Container, false, false, 0);
}
DockVisualStyle visualStyle;
@@ -122,10 +119,15 @@ namespace MonoDevelop.Components.Docking
if (widget != null)
SetTreeStyle (widget);
- item.GetToolbar (PositionType.Top).SetStyle (VisualStyle);
- item.GetToolbar (PositionType.Left).SetStyle (VisualStyle);
- item.GetToolbar (PositionType.Right).SetStyle (VisualStyle);
- item.GetToolbar (PositionType.Bottom).SetStyle (VisualStyle);
+ item.GetToolbar (DockPositionType.Top).SetStyle (VisualStyle);
+ item.GetToolbar (DockPositionType.Left).SetStyle (VisualStyle);
+ item.GetToolbar (DockPositionType.Right).SetStyle (VisualStyle);
+ item.GetToolbar (DockPositionType.Bottom).SetStyle (VisualStyle);
+
+ if (VisualStyle.TabStyle == DockTabStyle.Normal)
+ ModifyBg (StateType.Normal, VisualStyle.PadBackgroundColor.Value.ToGdkColor ());
+ else
+ ModifyBg (StateType.Normal, Style.Background(StateType.Normal));
}
}
@@ -150,8 +152,8 @@ namespace MonoDevelop.Components.Docking
{
var w = (Gtk.TreeView)sender;
if (VisualStyle.TreeBackgroundColor != null) {
- w.ModifyBase (StateType.Normal, VisualStyle.TreeBackgroundColor.Value);
- w.ModifyBase (StateType.Insensitive, VisualStyle.TreeBackgroundColor.Value);
+ w.ModifyBase (StateType.Normal, VisualStyle.TreeBackgroundColor.Value.ToGdkColor ());
+ w.ModifyBase (StateType.Insensitive, VisualStyle.TreeBackgroundColor.Value.ToGdkColor ());
} else {
w.ModifyBase (StateType.Normal, Parent.Style.Base (StateType.Normal));
w.ModifyBase (StateType.Insensitive, Parent.Style.Base (StateType.Insensitive));
@@ -162,7 +164,7 @@ namespace MonoDevelop.Components.Docking
{
if (VisualStyle.TabStyle == DockTabStyle.Normal) {
Gdk.GC gc = new Gdk.GC (GdkWindow);
- gc.RgbFgColor = VisualStyle.PadBackgroundColor.Value;
+ gc.RgbFgColor = VisualStyle.PadBackgroundColor.Value.ToGdkColor ();
evnt.Window.DrawRectangle (gc, true, Allocation);
gc.Dispose ();
}
@@ -184,7 +186,8 @@ namespace MonoDevelop.Components.Docking
int rightPadding;
Gdk.Color backgroundColor;
- bool backgroundColorSet;
+ Gdk.Color borderColor;
+ bool backgroundColorSet, borderColorSet;
public CustomFrame ()
{
@@ -194,6 +197,13 @@ namespace MonoDevelop.Components.Docking
{
SetMargins (topMargin, bottomMargin, leftMargin, rightMargin);
}
+
+ protected override void OnStyleSet (Style previous_style)
+ {
+ base.OnStyleSet (previous_style);
+ if (!borderColorSet)
+ borderColor = Style.Dark (Gtk.StateType.Normal);
+ }
public void SetMargins (int topMargin, int bottomMargin, int leftMargin, int rightMargin)
{
@@ -217,6 +227,11 @@ namespace MonoDevelop.Components.Docking
get { return backgroundColor; }
set { backgroundColor = value; backgroundColorSet = true; }
}
+
+ public Gdk.Color BorderColor {
+ get { return borderColor; }
+ set { borderColor = value; borderColorSet = true; }
+ }
protected override void OnAdded (Widget widget)
{
@@ -275,6 +290,8 @@ namespace MonoDevelop.Components.Docking
cr.RelLineTo (-rect.Width, 0);
cr.RelLineTo (0, -rect.Height);
cr.ClosePath ();
+
+ // FIXME: VV: Remove gradient features
using (Cairo.Gradient pat = new Cairo.LinearGradient (rect.X, rect.Y, rect.X, bottom)) {
pat.AddColorStop (0, bcolor.ToCairoColor ());
Xwt.Drawing.Color gcol = bcolor.ToXwtColor ();
@@ -298,7 +315,7 @@ namespace MonoDevelop.Components.Docking
base.OnExposeEvent (evnt);
using (Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window)) {
- cr.SetSourceColor (Style.Dark (Gtk.StateType.Normal).ToCairoColor ());
+ cr.SetSourceColor (BorderColor.ToCairoColor ());
double y = rect.Y + topMargin / 2d;
cr.LineWidth = topMargin;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs
index 652b1f725b..f28e569089 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemTitleTab.cs
@@ -32,20 +32,23 @@ using MonoDevelop.Ide.Gui;
using System.Linq;
using MonoDevelop.Core;
using MonoDevelop.Ide;
-using Mono.TextEditor;
using MonoDevelop.Components;
+using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.Components.Docking
{
class DockItemTitleTab: Gtk.EventBox
{
+ static Xwt.Drawing.Image dockTabActiveBackImage = Xwt.Drawing.Image.FromResource ("padbar-active.9.png");
+ static Xwt.Drawing.Image dockTabBackImage = Xwt.Drawing.Image.FromResource ("padbar-inactive.9.png");
+
bool active;
Gtk.Widget page;
ExtendedLabel labelWidget;
int labelWidth;
DockVisualStyle visualStyle;
- Gtk.Widget tabIcon;
+ ImageView tabIcon;
DockFrame frame;
string label;
ImageButton btnDock;
@@ -54,6 +57,8 @@ namespace MonoDevelop.Components.Docking
bool allowPlaceholderDocking;
bool mouseOver;
+ IDisposable subscribedLeaveEvent;
+
static Gdk.Cursor fleurCursor = new Gdk.Cursor (Gdk.CursorType.Fleur);
static Xwt.Drawing.Image pixClose;
@@ -62,18 +67,31 @@ namespace MonoDevelop.Components.Docking
static double PixelScale = GtkWorkarounds.GetPixelScale ();
- const int TopPadding = 5;
- const int BottomPadding = 7;
- const int TopPaddingActive = 5;
- const int BottomPaddingActive = 7;
- const int LeftPadding = 11;
- const int RightPadding = 9;
+ static readonly Xwt.WidgetSpacing TabPadding;
+ static readonly Xwt.WidgetSpacing TabActivePadding;
static DockItemTitleTab ()
{
pixClose = Xwt.Drawing.Image.FromResource ("pad-close-9.png");
pixAutoHide = Xwt.Drawing.Image.FromResource ("pad-minimize-9.png");
pixDock = Xwt.Drawing.Image.FromResource ("pad-dock-9.png");
+
+ Xwt.Drawing.NinePatchImage tabBackImage9;
+ if (dockTabBackImage is Xwt.Drawing.ThemedImage) {
+ var img = ((Xwt.Drawing.ThemedImage)dockTabBackImage).GetImage (Xwt.Drawing.Context.GlobalStyles);
+ tabBackImage9 = img as Xwt.Drawing.NinePatchImage;
+ } else
+ tabBackImage9 = dockTabBackImage as Xwt.Drawing.NinePatchImage;
+ TabPadding = tabBackImage9.Padding;
+
+
+ Xwt.Drawing.NinePatchImage tabActiveBackImage9;
+ if (dockTabActiveBackImage is Xwt.Drawing.ThemedImage) {
+ var img = ((Xwt.Drawing.ThemedImage)dockTabActiveBackImage).GetImage (Xwt.Drawing.Context.GlobalStyles);
+ tabActiveBackImage9 = img as Xwt.Drawing.NinePatchImage;
+ } else
+ tabActiveBackImage9 = dockTabActiveBackImage as Xwt.Drawing.NinePatchImage;
+ TabActivePadding = tabActiveBackImage9.Padding;
}
public DockItemTitleTab (DockItem item, DockFrame frame)
@@ -89,7 +107,7 @@ namespace MonoDevelop.Components.Docking
KeyPressEvent += HeaderKeyPress;
KeyReleaseEvent += HeaderKeyRelease;
- this.SubscribeLeaveEvent (OnLeave);
+ subscribedLeaveEvent = this.SubscribeLeaveEvent (OnLeave);
}
public DockVisualStyle VisualStyle {
@@ -101,8 +119,21 @@ namespace MonoDevelop.Components.Docking
}
}
+ protected override void OnDestroyed ()
+ {
+ subscribedLeaveEvent.Dispose ();
+ base.OnDestroyed ();
+ }
+
void UpdateVisualStyle ()
{
+ double inactiveIconAlpha;
+
+ if (IdeApp.Preferences == null || IdeApp.Preferences.UserInterfaceSkin == Skin.Light)
+ inactiveIconAlpha = 0.8;
+ else
+ inactiveIconAlpha = 0.6;
+
if (labelWidget != null && label != null) {
if (visualStyle.UppercaseTitles.Value)
labelWidget.Text = label.ToUpper ();
@@ -116,12 +147,17 @@ namespace MonoDevelop.Components.Docking
labelWidget.Xalign = 0;
}
- if (tabIcon != null)
+ if (tabIcon != null) {
+ tabIcon.Image = tabIcon.Image.WithAlpha (active ? 1.0 : inactiveIconAlpha);
tabIcon.Visible = visualStyle.ShowPadTitleIcon.Value;
- if (IsRealized) {
- if (labelWidget != null)
- labelWidget.ModifyFg (StateType.Normal, visualStyle.PadTitleLabelColor.Value);
}
+ if (IsRealized && labelWidget != null) {
+ var font = FontService.SansFont.CopyModified (null, Pango.Weight.Bold);
+ font.AbsoluteSize = Pango.Units.FromPixels (11);
+ labelWidget.ModifyFont (font);
+ labelWidget.ModifyText (StateType.Normal, (active ? visualStyle.PadTitleLabelColor.Value : visualStyle.InactivePadTitleLabelColor.Value).ToGdkColor ());
+ }
+
var r = WidthRequest;
WidthRequest = -1;
labelWidth = SizeRequest ().Width + 1;
@@ -142,20 +178,23 @@ namespace MonoDevelop.Components.Docking
}
Gtk.HBox box = new HBox ();
- box.Spacing = 2;
+ box.Spacing = -2;
- if (icon != null) {
- tabIcon = new Xwt.ImageView (icon).ToGtkWidget ();
- tabIcon.Show ();
- box.PackStart (tabIcon, false, false, 0);
- } else
- tabIcon = null;
+ if (icon == null)
+ icon = ImageService.GetIcon ("md-empty");
+
+ tabIcon = new ImageView (icon);
+ tabIcon.Show ();
+ box.PackStart (tabIcon, false, false, 3);
if (!string.IsNullOrEmpty (label)) {
labelWidget = new ExtendedLabel (label);
- labelWidget.DropShadowVisible = true;
labelWidget.UseMarkup = true;
- box.PackStart (labelWidget, true, true, 0);
+ var alignLabel = new Alignment (0.0f, 0.5f, 1, 1);
+ alignLabel.BottomPadding = 0;
+ alignLabel.RightPadding = 15;
+ alignLabel.Add (labelWidget);
+ box.PackStart (alignLabel, false, false, 0);
} else {
labelWidget = null;
}
@@ -180,14 +219,12 @@ namespace MonoDevelop.Components.Docking
};
btnClose.ButtonPressEvent += (o, args) => args.RetVal = true;
- Gtk.Alignment al = new Alignment (0, 0, 1, 1);
- HBox btnBox = new HBox (false, 3);
- btnBox.PackStart (btnDock, false, false, 0);
- btnBox.PackStart (btnClose, false, false, 0);
+ Gtk.Alignment al = new Alignment (0, 0.5f, 1, 1);
+ HBox btnBox = new HBox (false, 0);
+ btnBox.PackStart (btnDock, false, false, 3);
+ btnBox.PackStart (btnClose, false, false, 1);
al.Add (btnBox);
- al.LeftPadding = 3;
- al.TopPadding = 1;
- box.PackEnd (al, false, false, 0);
+ box.PackEnd (al, false, false, 3);
Add (box);
@@ -219,7 +256,8 @@ namespace MonoDevelop.Components.Docking
set {
if (active != value) {
active = value;
- this.QueueResize ();
+ UpdateVisualStyle ();
+ QueueResize ();
QueueDraw ();
UpdateBehavior ();
}
@@ -360,11 +398,11 @@ namespace MonoDevelop.Components.Docking
{
if (Child != null) {
req = Child.SizeRequest ();
- req.Width += LeftPadding + RightPadding;
+ req.Width += (int)(TabPadding.Left + TabPadding.Right);
if (active)
- req.Height += TopPaddingActive + BottomPaddingActive;
+ req.Height += (int)(TabActivePadding.Top + TabActivePadding.Bottom);
else
- req.Height += TopPadding + BottomPadding;
+ req.Height += (int)(TabPadding.Top + TabPadding.Bottom);
}
}
@@ -372,8 +410,8 @@ namespace MonoDevelop.Components.Docking
{
base.OnSizeAllocated (rect);
- int leftPadding = LeftPadding;
- int rightPadding = RightPadding;
+ int leftPadding = (int)TabPadding.Left;
+ int rightPadding = (int)TabPadding.Right;
if (rect.Width < labelWidth) {
int red = (labelWidth - rect.Width) / 2;
leftPadding -= red;
@@ -384,16 +422,17 @@ namespace MonoDevelop.Components.Docking
rect.X += leftPadding;
rect.Width -= leftPadding + rightPadding;
+ if (rect.Width < 1) {
+ rect.Width = 1;
+ }
if (Child != null) {
- if (active) {
- rect.Y += TopPaddingActive;
- rect.Height = Child.SizeRequest ().Height;
- }
- else {
- rect.Y += TopPadding;
- rect.Height = Child.SizeRequest ().Height;
- }
+ var bottomPadding = active ? (int)TabActivePadding.Bottom : (int)TabPadding.Bottom;
+ var topPadding = active ? (int)TabActivePadding.Top : (int)TabPadding.Top;
+ int centerY = topPadding + ((rect.Height - bottomPadding - topPadding) / 2);
+ var height = Child.SizeRequest ().Height;
+ rect.Y += centerY - (height / 2);
+ rect.Height = height;
Child.SizeAllocate (rect);
}
}
@@ -409,41 +448,28 @@ namespace MonoDevelop.Components.Docking
void DrawAsBrowser (Gdk.EventExpose evnt)
{
- var alloc = Allocation;
-
- Gdk.GC bgc = new Gdk.GC (GdkWindow);
- var c = VisualStyle.PadBackgroundColor.Value.ToXwtColor ();
- c.Light *= 0.7;
- bgc.RgbFgColor = c.ToGdkColor ();
bool first = true;
bool last = true;
- TabStrip tabStrip = null;
+
if (Parent is TabStrip.TabStripBox) {
var tsb = (TabStrip.TabStripBox) Parent;
var cts = tsb.Children;
first = cts[0] == this;
last = cts[cts.Length - 1] == this;
- tabStrip = tsb.TabStrip;
}
- if (Active || (first && last)) {
- Gdk.GC gc = new Gdk.GC (GdkWindow);
- gc.RgbFgColor = VisualStyle.PadBackgroundColor.Value;
- evnt.Window.DrawRectangle (gc, true, alloc);
- if (!first)
- evnt.Window.DrawLine (bgc, alloc.X, alloc.Y, alloc.X, alloc.Y + alloc.Height - 1);
- if (!(last && first) && !(tabStrip != null && tabStrip.VisualStyle.ExpandedTabs.Value && last))
- evnt.Window.DrawLine (bgc, alloc.X + alloc.Width - 1, alloc.Y, alloc.X + alloc.Width - 1, alloc.Y + alloc.Height - 1);
- gc.Dispose ();
+ using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) {
+ if (first && last) {
+ ctx.Rectangle (Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height);
+ ctx.SetSourceColor (VisualStyle.PadBackgroundColor.Value.ToCairoColor ());
+ ctx.Fill ();
+ } else {
+ var image = Active ? dockTabActiveBackImage : dockTabBackImage;
+ image = image.WithSize (Allocation.Width, Allocation.Height);
- } else {
- Gdk.GC gc = new Gdk.GC (GdkWindow);
- gc.RgbFgColor = tabStrip != null ? tabStrip.VisualStyle.InactivePadBackgroundColor.Value : frame.DefaultVisualStyle.InactivePadBackgroundColor.Value;
- evnt.Window.DrawRectangle (gc, true, alloc);
- gc.Dispose ();
- evnt.Window.DrawLine (bgc, alloc.X, alloc.Y + alloc.Height - 1, alloc.X + alloc.Width - 1, alloc.Y + alloc.Height - 1);
+ ctx.DrawImage (this, image, Allocation.X, Allocation.Y);
+ }
}
- bgc.Dispose ();
}
void DrawNormal (Gdk.EventExpose evnt)
@@ -453,30 +479,12 @@ namespace MonoDevelop.Components.Docking
var y = Allocation.Y;
ctx.Rectangle (x, y + 1, Allocation.Width, Allocation.Height - 1);
- using (var g = new Cairo.LinearGradient (x, y + 1, x, y + Allocation.Height - 1)) {
- g.AddColorStop (0, Styles.DockTabBarGradientStart);
- g.AddColorStop (1, Styles.DockTabBarGradientEnd);
- ctx.SetSource (g);
- ctx.Fill ();
- }
-
- ctx.MoveTo (x + 0.5, y + 0.5);
- ctx.LineTo (x + Allocation.Width - 0.5d, y + 0.5);
- ctx.SetSourceColor (Styles.DockTabBarGradientTop);
- ctx.Stroke ();
+ ctx.SetSourceColor (Styles.DockBarBackground.ToCairoColor ());
+ ctx.Fill ();
+ /*
if (active) {
-
- ctx.Rectangle (x, y + 1, Allocation.Width, Allocation.Height - 1);
- using (var g = new Cairo.LinearGradient (x, y + 1, x, y + Allocation.Height - 1)) {
- g.AddColorStop (0, new Cairo.Color (0, 0, 0, 0.01));
- g.AddColorStop (0.5, new Cairo.Color (0, 0, 0, 0.08));
- g.AddColorStop (1, new Cairo.Color (0, 0, 0, 0.01));
- ctx.SetSource (g);
- ctx.Fill ();
- }
-
-/* double offset = Allocation.Height * 0.25;
+ double offset = Allocation.Height * 0.25;
var rect = new Cairo.Rectangle (x - Allocation.Height + offset, y, Allocation.Height, Allocation.Height);
var cg = new Cairo.RadialGradient (rect.X + rect.Width / 2, rect.Y + rect.Height / 2, 0, rect.X, rect.Y + rect.Height / 2, rect.Height / 2);
cg.AddColorStop (0, Styles.DockTabBarShadowGradientStart);
@@ -491,8 +499,9 @@ namespace MonoDevelop.Components.Docking
cg.AddColorStop (1, Styles.DockTabBarShadowGradientEnd);
ctx.Pattern = cg;
ctx.Rectangle (rect);
- ctx.Fill ();*/
+ ctx.Fill ();
}
+ */
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemToolbar.cs
index aa6c502e4f..3f162a292c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemToolbar.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItemToolbar.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System;
+using System.Linq;
using Gtk;
namespace MonoDevelop.Components.Docking
@@ -34,11 +35,11 @@ namespace MonoDevelop.Components.Docking
DockItem parentItem;
Gtk.Widget frame;
Box box;
- PositionType position;
+ DockPositionType position;
bool empty = true;
CustomFrame topFrame;
- internal DockItemToolbar (DockItem parentItem, PositionType position)
+ internal DockItemToolbar (DockItem parentItem, DockPositionType position)
{
this.parentItem = parentItem;
@@ -65,7 +66,7 @@ namespace MonoDevelop.Components.Docking
}*/
this.position = position;
- if (position == PositionType.Top || position == PositionType.Bottom)
+ if (position == DockPositionType.Top || position == DockPositionType.Bottom)
box = new HBox (false, 3);
else
box = new VBox (false, 3);
@@ -79,7 +80,7 @@ namespace MonoDevelop.Components.Docking
internal void SetStyle (DockVisualStyle style)
{
- topFrame.BackgroundColor = style.PadBackgroundColor.Value;
+ topFrame.BackgroundColor = style.PadBackgroundColor.Value.ToGdkColor ();
}
public DockItem DockItem {
@@ -90,29 +91,30 @@ namespace MonoDevelop.Components.Docking
get { return frame; }
}
- public PositionType Position {
+ public DockPositionType Position {
get { return this.position; }
}
- public void Add (Widget widget)
+ public void Add (Control widget)
{
Add (widget, false);
}
- public void Add (Widget widget, bool fill)
+ public void Add (Control widget, bool fill)
{
Add (widget, fill, -1);
}
- public void Add (Widget widget, bool fill, int padding)
+ public void Add (Control widget, bool fill, int padding)
{
Add (widget, fill, padding, -1);
}
- void Add (Widget widget, bool fill, int padding, int index)
+ void Add (Control control, bool fill, int padding, int index)
{
int defaultPadding = 3;
-
+
+ Widget widget = control;
if (widget is Button) {
((Button)widget).Relief = ReliefStyle.None;
((Button)widget).FocusOnClick = false;
@@ -141,12 +143,12 @@ namespace MonoDevelop.Components.Docking
}
}
- public void Insert (Widget w, int index)
+ public void Insert (Control w, int index)
{
Add (w, false, 0, index);
}
- public void Remove (Widget widget)
+ public void Remove (Control widget)
{
box.Remove (widget);
}
@@ -170,25 +172,85 @@ namespace MonoDevelop.Components.Docking
frame.ShowAll ();
}
- public Widget[] Children {
- get { return box.Children; }
+ public Control[] Children {
+ get { return box.Children.Select (child => (Control)child).ToArray (); }
}
}
- public class DockToolButton: Gtk.Button
+ public class DockToolButton : Control
{
- public DockToolButton (string stockId)
+ public ImageView Image {
+ get { return (ImageView)button.Image; }
+ set { button.Image = value; }
+ }
+
+ public string TooltipText {
+ get { return button.TooltipText; }
+ set { button.TooltipText = value; }
+ }
+
+ public string Label {
+ get { return button.Label; }
+ set { button.Label = value; }
+ }
+
+ public bool Sensitive {
+ get { return button.Sensitive; }
+ set { button.Sensitive = value; }
+ }
+
+ Gtk.Button button;
+
+ public DockToolButton (string stockId) : this (stockId, null)
{
- Image = new Gtk.Image (stockId, IconSize.Menu);
- Image.Show ();
}
public DockToolButton (string stockId, string label)
{
+ button = new Button ();
Label = label;
- Image = new Gtk.Image (stockId, IconSize.Menu);
+
+ Image = new ImageView (stockId, IconSize.Menu);
Image.Show ();
}
+
+ protected override object CreateNativeWidget<T> ()
+ {
+ return button;
+ }
+
+ public event EventHandler Clicked {
+ add {
+ button.Clicked += value;
+ }
+ remove {
+ button.Clicked -= value;
+ }
+ }
+
+ public class DockToolButtonImage : Control
+ {
+ ImageView image;
+ internal DockToolButtonImage (ImageView image)
+ {
+ this.image = image;
+ }
+
+ protected override object CreateNativeWidget<T> ()
+ {
+ return image;
+ }
+
+ public static implicit operator Gtk.Widget (DockToolButtonImage d)
+ {
+ return d.GetNativeWidget<Gtk.Widget> ();
+ }
+
+ public static implicit operator DockToolButtonImage (ImageView d)
+ {
+ return new DockToolButtonImage (d);
+ }
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockObject.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockObject.cs
index f2e3b61af6..858ca63bd6 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockObject.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockObject.cs
@@ -38,6 +38,8 @@ namespace MonoDevelop.Components.Docking
{
internal abstract class DockObject
{
+ public event EventHandler<EventArgs> AllocationChanged;
+
DockGroup parentGroup;
DockFrame frame;
Gdk.Rectangle rect;
@@ -144,7 +146,7 @@ namespace MonoDevelop.Components.Docking
return rect;
}
set {
- rect = value;
+ rect = value;
}
}
@@ -154,6 +156,7 @@ namespace MonoDevelop.Components.Docking
}
set {
allocSize = value;
+ OnAllocationChanged ();
}
}
@@ -282,5 +285,14 @@ namespace MonoDevelop.Components.Docking
return false;
return ParentGroup.IsChildNextToMargin (margin, this, visibleOnly);
}
+
+ protected void OnAllocationChanged ()
+ {
+ if (ParentGroup != null) {
+ ParentGroup.OnAllocationChanged ();
+ } else {
+ AllocationChanged?.Invoke (this, EventArgs.Empty);
+ }
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockPositionType.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockPositionType.cs
new file mode 100644
index 0000000000..0191134cec
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockPositionType.cs
@@ -0,0 +1,39 @@
+//
+// DockPositionType.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+
+namespace MonoDevelop.Components.Docking
+{
+ public enum DockPositionType
+ {
+ Left,
+ Right,
+ Top,
+ Bottom
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockVisualStyle.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockVisualStyle.cs
index 195aea35ad..d69bef84d7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockVisualStyle.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockVisualStyle.cs
@@ -29,14 +29,15 @@ namespace MonoDevelop.Components.Docking
{
public sealed class DockVisualStyle
{
- public Gdk.Color? PadBackgroundColor { get; set; }
- public Gdk.Color? PadTitleLabelColor { get; set; }
+ public Xwt.Drawing.Color? PadBackgroundColor { get; set; }
+ public Xwt.Drawing.Color? PadTitleLabelColor { get; set; }
+ public Xwt.Drawing.Color? InactivePadTitleLabelColor { get; set; }
public DockTabStyle? TabStyle { get; set; }
- public Gdk.Color? TreeBackgroundColor { get; set; }
+ public Xwt.Drawing.Color? TreeBackgroundColor { get; set; }
public bool? ShowPadTitleIcon { get; set; }
public bool? UppercaseTitles { get; set; }
public bool? ExpandedTabs { get; set; }
- public Gdk.Color? InactivePadBackgroundColor { get; set; }
+ public Xwt.Drawing.Color? InactivePadBackgroundColor { get; set; }
public int? PadTitleHeight { get; set; }
// When set, pads in a region with this style can't be stacked horizontally
@@ -60,6 +61,8 @@ namespace MonoDevelop.Components.Docking
PadBackgroundColor = style.PadBackgroundColor;
if (style.PadTitleLabelColor != null)
PadTitleLabelColor = style.PadTitleLabelColor;
+ if (style.InactivePadTitleLabelColor != null)
+ InactivePadTitleLabelColor = style.InactivePadTitleLabelColor;
if (style.TabStyle != null)
TabStyle = style.TabStyle;
if (style.TreeBackgroundColor != null)
@@ -83,14 +86,15 @@ namespace MonoDevelop.Components.Docking
public static DockVisualStyle CreateDefaultStyle ()
{
DockVisualStyle s = new DockVisualStyle ();
- s.PadBackgroundColor = new Gdk.Color (0,0,0);
- s.PadTitleLabelColor = new Gdk.Color (0,0,0);
+ s.PadBackgroundColor = new Xwt.Drawing.Color (0,0,0);
+ s.PadTitleLabelColor = new Xwt.Drawing.Color (0,0,0);
+ s.InactivePadTitleLabelColor = new Xwt.Drawing.Color (0,0,0);
s.TabStyle = DockTabStyle.Normal;
s.TreeBackgroundColor = null;
s.ShowPadTitleIcon = true;
s.UppercaseTitles = false;
s.ExpandedTabs = false;
- s.InactivePadBackgroundColor = new Gdk.Color (0,0,0);
+ s.InactivePadBackgroundColor = new Xwt.Drawing.Color (0,0,0);
s.PadTitleHeight = -1;
s.SingleRowMode = false;
s.SingleColumnMode = false;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/PlaceholderWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/PlaceholderWindow.cs
index ff99bf3c61..faf3966c12 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/PlaceholderWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/PlaceholderWindow.cs
@@ -110,7 +110,7 @@ namespace MonoDevelop.Components.Docking
public void Relocate (int x, int y, int w, int h, bool animate)
{
- Gdk.Rectangle geometry = Mono.TextEditor.GtkWorkarounds.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtPoint (x, y));
+ Gdk.Rectangle geometry = GtkWorkarounds.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtPoint (x, y));
if (x < geometry.X)
x = geometry.X;
if (x + w > geometry.Right)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/TabStrip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/TabStrip.cs
index ab5b7f8dfd..e2d758f363 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/TabStrip.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/TabStrip.cs
@@ -139,6 +139,14 @@ namespace MonoDevelop.Components.Docking
}
}
}
+
+ internal DockItemTitleTab CurrentTitleTab {
+ get {
+ if (currentTab != -1)
+ return (DockItemTitleTab)box.Children [currentTab];
+ return null;
+ }
+ }
new public Gtk.Widget CurrentPage {
get {
@@ -269,22 +277,14 @@ namespace MonoDevelop.Components.Docking
internal class TabStripBox: HBox
{
public TabStrip TabStrip;
+ static Xwt.Drawing.Image tabbarBackImage = Xwt.Drawing.Image.FromResource ("tabbar-back.9.png");
protected override bool OnExposeEvent (Gdk.EventExpose evnt)
{
if (TabStrip.VisualStyle.TabStyle == DockTabStyle.Normal) {
- var alloc = Allocation;
- Gdk.GC gc = new Gdk.GC (GdkWindow);
- gc.RgbFgColor = TabStrip.VisualStyle.InactivePadBackgroundColor.Value;
- evnt.Window.DrawRectangle (gc, true, alloc);
- gc.Dispose ();
-
- Gdk.GC bgc = new Gdk.GC (GdkWindow);
- var c = TabStrip.VisualStyle.PadBackgroundColor.Value.ToXwtColor ();
- c.Light *= 0.7;
- bgc.RgbFgColor = c.ToGdkColor ();
- evnt.Window.DrawLine (bgc, alloc.X, alloc.Y + alloc.Height - 1, alloc.X + alloc.Width - 1, alloc.Y + alloc.Height - 1);
- bgc.Dispose ();
+ using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) {
+ ctx.DrawImage (this, tabbarBackImage.WithSize (Allocation.Width, Allocation.Height), 0, 0);
+ }
}
return base.OnExposeEvent (evnt);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-close-9.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-close-9.png
index 9714a9af82..13e13896ae 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-close-9.png
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-close-9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-close-9@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-close-9@2x.png
index ecb78f9522..b33f4ca909 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-close-9@2x.png
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-close-9@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-close-9~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-close-9~dark.png
new file mode 100644
index 0000000000..f3fadb1ad9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-close-9~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-close-9~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-close-9~dark@2x.png
new file mode 100644
index 0000000000..d27ac42628
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-close-9~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-dock-9.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-dock-9.png
index 56aece42f4..b2b9338e08 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-dock-9.png
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-dock-9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-dock-9@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-dock-9@2x.png
index 88706d902d..094949add8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-dock-9@2x.png
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-dock-9@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-dock-9~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-dock-9~dark.png
new file mode 100644
index 0000000000..100ce40fd6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-dock-9~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-dock-9~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-dock-9~dark@2x.png
new file mode 100644
index 0000000000..4f31e73a26
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-dock-9~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-minimize-9.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-minimize-9.png
index fbbef55ef7..b3fcafdabf 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-minimize-9.png
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-minimize-9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-minimize-9@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-minimize-9@2x.png
index 99dc4978e6..e1a710cc5e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-minimize-9@2x.png
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-minimize-9@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-minimize-9~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-minimize-9~dark.png
new file mode 100644
index 0000000000..618f04a433
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-minimize-9~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-minimize-9~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-minimize-9~dark@2x.png
new file mode 100644
index 0000000000..4bc9ff7701
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/icons/pad-minimize-9~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/ErrorDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/ErrorDialog.cs
deleted file mode 100644
index c93c8376a9..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/ErrorDialog.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// ErrorDialog.cs
-//
-// Author:
-// Michael Hutchinson <mhutchinson@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using MonoDevelop.Ide;
-
-namespace MonoDevelop.Components.Extensions
-{
- public interface IExceptionDialogHandler : IDialogHandler<ExceptionDialogData>
- {
- }
-
- public class ExceptionDialogData : PlatformDialogData
- {
- public AlertButton[] Buttons { get; set; }
- public string Message { get; set; }
- public Exception Exception { get; set; }
- public AlertButton ResultButton { get; set; }
- }
-
- public class ExceptionDialog : PlatformDialog<ExceptionDialogData>
- {
- public AlertButton[] Buttons {
- get { return data.Buttons; }
- set { data.Buttons = value; }
- }
-
- public string Message {
- get { return data.Message; }
- set { data.Message = value; }
- }
-
- public Exception Exception {
- get { return data.Exception; }
- set { data.Exception = value; }
- }
-
- public AlertButton ResultButton {
- get { return data.ResultButton; }
- private set { data.ResultButton = value; }
- }
-
- protected override bool RunDefault ()
- {
- using (var errorDialog = new MonoDevelop.Ide.Gui.Dialogs.GtkErrorDialog (TransientFor, Title, Message, Buttons)) {
- errorDialog.AddDetails (Exception.ToString (), false);
- int result = MonoDevelop.Ide.MessageService.ShowCustomDialog (errorDialog);
- ResultButton = result >= 0 ? Buttons [result] : null;
- }
- return true;
- }
- }
-} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarDialogBackend.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarDialogBackend.cs
index 8818409edd..7fdb8a317f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarDialogBackend.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarDialogBackend.cs
@@ -34,7 +34,7 @@ namespace MonoDevelop.Components.Extensions
void SetHeaderContent (IWidgetBackend backend);
}
- class GtkExtendedTitleBarDialogBackend: DialogBackend, IExtendedTitleBarDialogBackend
+ class GtkExtendedTitleBarDialogBackend: ThemedGtkDialogBackend, IExtendedTitleBarDialogBackend
{
HeaderBox toolbar;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarWindowBackend.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarWindowBackend.cs
index 316b133285..dda0af1d64 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarWindowBackend.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/IExtendedTitleBarWindowBackend.cs
@@ -34,7 +34,7 @@ namespace MonoDevelop.Components.Extensions
void SetHeaderContent (IWidgetBackend backend);
}
- class GtkExtendedTitleBarWindowBackend: WindowBackend, IExtendedTitleBarWindowBackend
+ class GtkExtendedTitleBarWindowBackend: ThemedGtkWindowBackend, IExtendedTitleBarWindowBackend
{
HeaderBox toolbar;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/PlatformDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/PlatformDialog.cs
index a1a9b55c2b..4b3c1fd7b4 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/PlatformDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/PlatformDialog.cs
@@ -35,7 +35,7 @@ namespace MonoDevelop.Components.Extensions
public class PlatformDialogData
{
public string Title { get; set; }
- public Gtk.Window TransientFor { get; set; }
+ public Window TransientFor { get; set; }
}
public interface IDialogHandler<T> where T: PlatformDialogData
@@ -84,7 +84,7 @@ namespace MonoDevelop.Components.Extensions
/// <summary>
/// Parent window.
/// </summary>
- public Gtk.Window TransientFor {
+ public Window TransientFor {
get { return data.TransientFor; }
set { data.TransientFor = value; }
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/TextQuestionDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/TextQuestionDialog.cs
index 043010872f..f9fe9d90b9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/TextQuestionDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/TextQuestionDialog.cs
@@ -65,9 +65,9 @@ namespace MonoDevelop.Components.Extensions
protected override bool RunDefault ()
{
- Dialog md = null;
+ Gtk.Dialog md = null;
try {
- md = new Dialog (Caption, TransientFor, DialogFlags.Modal | DialogFlags.DestroyWithParent) {
+ md = new Gtk.Dialog (Caption, TransientFor, DialogFlags.Modal | DialogFlags.DestroyWithParent) {
HasSeparator = false,
BorderWidth = 6,
};
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/CommandSearchCategory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/CommandSearchCategory.cs
index c91e2e0e59..bd2f9c96fb 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/CommandSearchCategory.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/CommandSearchCategory.cs
@@ -43,113 +43,54 @@ namespace MonoDevelop.Components.MainToolbar
{
class CommandSearchCategory : SearchCategory
{
- Widget widget;
+ static readonly List<Tuple<Command, string>> allCommands;
- public CommandSearchCategory (Widget widget) : base (GettextCatalog.GetString("Commands"))
+ static CommandSearchCategory ()
{
- this.widget = widget;
- this.lastResult = new WorkerResult (widget);
+ allCommands = IdeApp.CommandService.GetCommands ().Select(cmd =>
+ Tuple.Create (cmd, cmd.Text.Replace ("_", ""))
+ ).ToList();
}
- WorkerResult lastResult;
- string[] validTags = new [] { "cmd", "command" };
-
- public override bool IsValidTag (string tag)
+ public CommandSearchCategory () : base (GettextCatalog.GetString("Commands"))
{
- return validTags.Any (t => t == tag);
}
- public override Task<ISearchDataSource> GetResults (SearchPopupSearchPattern searchPattern, int resultsCount, CancellationToken token)
- {
- // NOTE: This is run on the UI thread as checking whether or not a command is enabled is not thread-safe
- return Task.Factory.StartNew (delegate {
- try {
- if (searchPattern.Tag != null && !validTags.Contains (searchPattern.Tag) || searchPattern.HasLineNumber)
- return null;
- WorkerResult newResult = new WorkerResult (widget);
- newResult.pattern = searchPattern.Pattern;
-
- newResult.matcher = StringMatcher.GetMatcher (searchPattern.Pattern, false);
- newResult.FullSearch = true;
+ string[] validTags = new [] { "cmd", "command", "c" };
-
- AllResults (lastResult, newResult, token);
- newResult.results.SortUpToN (new DataItemComparer (token), resultsCount);
- lastResult = newResult;
- return (ISearchDataSource)newResult.results;
- } catch {
- token.ThrowIfCancellationRequested ();
- throw;
- }
- }, token, TaskCreationOptions.None, Xwt.Application.UITaskScheduler);
+ public override string [] Tags {
+ get {
+ return validTags;
+ }
}
- void AllResults (WorkerResult lastResult, WorkerResult newResult, CancellationToken token)
+ public override bool IsValidTag (string tag)
{
- CommandTargetRoute route = new CommandTargetRoute (MainToolbar.LastCommandTarget);
- newResult.filteredCommands = new List<Command> ();
- bool startsWithLastFilter = lastResult != null && lastResult.pattern != null && newResult.pattern.StartsWith (lastResult.pattern) && lastResult.filteredCommands != null;
- IEnumerable<Command> allCommands = startsWithLastFilter ? lastResult.filteredCommands : IdeApp.CommandService.GetCommands ();
- foreach (Command cmd in allCommands) {
- token.ThrowIfCancellationRequested ();
- SearchResult curResult = newResult.CheckCommand (cmd, route);
- if (curResult != null) {
- newResult.filteredCommands.Add (cmd);
- newResult.results.AddResult (curResult);
- }
- }
+ return validTags.Any (t => t == tag);
}
-
- class WorkerResult
+
+ public override Task GetResults (ISearchResultCallback searchResultCallback, SearchPopupSearchPattern pattern, CancellationToken token)
{
- public List<Command> filteredCommands = null;
- public string pattern = null;
- public ResultsDataSource results;
- public bool FullSearch;
- public StringMatcher matcher = null;
-
- public WorkerResult (Widget widget)
- {
- results = new ResultsDataSource (widget);
- }
-
- internal SearchResult CheckCommand (Command c, CommandTargetRoute route)
- {
- ActionCommand cmd = c as ActionCommand;
- if (cmd == null || cmd.CommandArray)
- return null;
+ return Task.Run (delegate {
+ try {
+ if (pattern.HasLineNumber)
+ return;
+ CommandTargetRoute route = new CommandTargetRoute (MainToolbar.LastCommandTarget);
+ var matcher = StringMatcher.GetMatcher (pattern.Pattern, false);
+
+ foreach (var cmdTuple in allCommands) {
+ if (token.IsCancellationRequested)
+ break;
+ var cmd = cmdTuple.Item1;
+ var matchString = cmdTuple.Item2;
+ int rank;
- int rank;
- string matchString = cmd.Text.Replace ("_", "");
- if (MatchName (matchString, out rank)) {
- try {
- var ci = IdeApp.CommandService.GetCommandInfo (cmd.Id, route);
- if (ci.Enabled && ci.Visible)
- return new CommandResult (cmd, ci, route, pattern, matchString, rank);
- } catch (Exception ex) {
- LoggingService.LogError ("Failure while checking command: " + cmd.Id, ex);
+ if (matcher.CalcMatchRank (matchString, out rank))
+ searchResultCallback.ReportResult (new CommandResult (cmd, null, route, pattern.Pattern, matchString, rank));
}
+ } catch (OperationCanceledException) {
}
- return null;
- }
-
- Dictionary<string, MatchResult> savedMatches = new Dictionary<string, MatchResult> ();
- bool MatchName (string name, out int matchRank)
- {
- if (name == null) {
- matchRank = -1;
- return false;
- }
- MatchResult savedMatch;
- if (!savedMatches.TryGetValue (name, out savedMatch)) {
- bool doesMatch = matcher.CalcMatchRank (name, out matchRank);
- savedMatches[name] = savedMatch = new MatchResult (doesMatch, matchRank);
- }
-
- matchRank = savedMatch.Rank;
- return savedMatch.Match;
- }
+ }, token);
}
}
-}
-
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ConfigurationMerger.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ConfigurationMerger.cs
index 965ed07fe2..e5e44ae752 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ConfigurationMerger.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ConfigurationMerger.cs
@@ -307,7 +307,7 @@ namespace MonoDevelop.Components.MainToolbar
bool ConfigurationEquals (Solution sol, SolutionConfiguration s1, SolutionConfiguration s2)
{
- foreach (var p in sol.GetAllSolutionItems<SolutionEntityItem> ()) {
+ foreach (var p in sol.GetAllItems<SolutionItem> ()) {
var c1 = s1.GetEntryForItem (p);
var c2 = s2.GetEntryForItem (p);
if (c1 == null && c2 == null)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/FileSearchCategory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/FileSearchCategory.cs
index 34b1968ba3..b5204a2e27 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/FileSearchCategory.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/FileSearchCategory.cs
@@ -32,165 +32,125 @@ using MonoDevelop.Core.Instrumentation;
using MonoDevelop.Projects;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Core.Text;
using Gtk;
using System.Linq;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.Components.MainToolbar
{
class FileSearchCategory : SearchCategory
{
- Widget widget;
- public FileSearchCategory (Widget widget) : base (GettextCatalog.GetString("Files"))
+ public FileSearchCategory () : base (GettextCatalog.GetString ("Files"))
{
- this.widget = widget;
- this.lastResult = new WorkerResult (widget);
}
- IEnumerable<ProjectFile> files {
- get {
- foreach (Document doc in IdeApp.Workbench.Documents) {
- // We only want to check it here if it's not part
- // of the open combine. Otherwise, it will get
- // checked down below.
- if (doc.Project == null && doc.IsFile)
- yield return new ProjectFile (doc.Name);
+ static FileSearchCategory ()
+ {
+ IdeApp.Workspace.SolutionLoaded += delegate { allFilesCache = null; };
+ IdeApp.Workspace.SolutionUnloaded += delegate { allFilesCache = null; };
+ IdeApp.Workspace.ItemAddedToSolution += delegate { allFilesCache = null; };
+ IdeApp.Workspace.ItemRemovedFromSolution += delegate { allFilesCache = null; };
+ IdeApp.Workspace.FileAddedToProject += delegate { allFilesCache = null; };
+ IdeApp.Workspace.FileRemovedFromProject += delegate { allFilesCache = null; };
+ IdeApp.Workspace.FileRenamedInProject += delegate { allFilesCache = null; };
+ IdeApp.Workbench.DocumentOpened += delegate { allFilesCache = null; };
+ IdeApp.Workbench.DocumentClosed += delegate { allFilesCache = null; };
+ }
+
+ List<Tuple<string, string, ProjectFile>> GenerateAllFiles ()
+ {
+ //Slowest thing here is GetRelProjectPath, hence Tuple<,,> needs to be cached
+ var list = new List<Tuple<string, string, ProjectFile>> ();
+ foreach (var doc in IdeApp.Workbench.Documents) {
+ // We only want to check it here if it's not part
+ // of the open combine. Otherwise, it will get
+ // checked down below.
+ if (doc.Project == null && doc.IsFile) {
+ var pf = new ProjectFile (doc.Name);
+ list.Add (new Tuple<string, string, ProjectFile> (System.IO.Path.GetFileName (pf.FilePath), FileSearchResult.GetRelProjectPath (pf), pf));
}
-
- var projects = IdeApp.Workspace.GetAllProjects ();
+ }
+
+ var projects = IdeApp.Workspace.GetAllProjects ();
- foreach (Project p in projects) {
- foreach (ProjectFile file in p.Files) {
- if (file.Subtype != Subtype.Directory && (file.Flags & ProjectItemFlags.Hidden) != ProjectItemFlags.Hidden)
- yield return file;
+ foreach (var p in projects) {
+ foreach (ProjectFile pf in p.Files) {
+ if (pf.Subtype != Subtype.Directory && (pf.Flags & ProjectItemFlags.Hidden) != ProjectItemFlags.Hidden) {
+ list.Add (new Tuple<string, string, ProjectFile> (System.IO.Path.GetFileName (pf.FilePath), FileSearchResult.GetRelProjectPath (pf), pf));
}
}
}
+ return list;
}
- WorkerResult lastResult;
- string[] validTags = new [] { "file"};
+ string [] validTags = new [] { "file", "f" };
+
+ public override string [] Tags {
+ get {
+ return validTags;
+ }
+ }
public override bool IsValidTag (string tag)
{
return validTags.Any (t => t == tag);
}
- public override Task<ISearchDataSource> GetResults (SearchPopupSearchPattern searchPattern, int resultsCount, CancellationToken token)
- {
- return Task.Factory.StartNew (delegate {
- if (searchPattern.Tag != null && !validTags.Contains (searchPattern.Tag))
- return null;
- try {
- var newResult = new WorkerResult (widget);
- newResult.pattern = searchPattern.Pattern;
- newResult.IncludeFiles = true;
- newResult.IncludeTypes = true;
- newResult.IncludeMembers = true;
-
- string toMatch = searchPattern.Pattern;
- newResult.matcher = StringMatcher.GetMatcher (toMatch, false);
- newResult.FullSearch = true;
+ static List<Tuple<string, string, ProjectFile>> allFilesCache;
+ static object allFilesLock = new object ();
- AllResults (lastResult, newResult, token);
- newResult.results.SortUpToN (new DataItemComparer (token), resultsCount);
- lastResult = newResult;
- return (ISearchDataSource)newResult.results;
- } catch {
- token.ThrowIfCancellationRequested ();
- throw;
- }
- }, token);
- }
-
- void AllResults (WorkerResult lastResult, WorkerResult newResult, CancellationToken token)
+ public override Task GetResults (ISearchResultCallback searchResultCallback, SearchPopupSearchPattern pattern, CancellationToken token)
{
- // Search files
- if (newResult.IncludeFiles) {
- newResult.filteredFiles = new List<ProjectFile> ();
- bool startsWithLastFilter = lastResult != null && lastResult.pattern != null && newResult.pattern.StartsWith (lastResult.pattern) && lastResult.filteredFiles != null;
- IEnumerable<ProjectFile> allFiles = startsWithLastFilter ? lastResult.filteredFiles : files;
- foreach (ProjectFile file in allFiles) {
- token.ThrowIfCancellationRequested ();
- SearchResult curResult = newResult.CheckFile (file);
- if (curResult != null) {
- newResult.filteredFiles.Add (file);
- newResult.results.Add (curResult);
+ return Task.Run (delegate {
+ List<Tuple<string, string, ProjectFile>> files;
+ //This lock is here in case user quickly types 5 letters which triggers 5 threads
+ //we don't want to use all CPU doing same thing, instead 1st one will create cache, others will wait here
+ //and then all will use cached version...
+ lock (allFilesLock) {
+ files = allFilesCache = allFilesCache ?? GenerateAllFiles ();
+ }
+ var matcher = StringMatcher.GetMatcher (pattern.Pattern, false);
+ var savedMatches = new Dictionary<string, MatchResult> ();
+ foreach (var file in files) {
+ if (token.IsCancellationRequested)
+ break;
+ int rank1;
+ int rank2;
+ var match1 = MatchName (savedMatches, matcher, file.Item1, out rank1);
+ var match2 = MatchName (savedMatches, matcher, file.Item2, out rank2);
+ if (match1 && match2) {
+ if (rank1 > rank2 || (rank1 == rank2 && String.CompareOrdinal (file.Item1, file.Item2) > 0)) {
+ searchResultCallback.ReportResult (new FileSearchResult (pattern.Pattern, file.Item1, rank1, file.Item3));
+ } else {
+ searchResultCallback.ReportResult (new FileSearchResult (pattern.Pattern, file.Item2, rank2, file.Item3));
+ }
+ } else if (match1) {
+ searchResultCallback.ReportResult (new FileSearchResult (pattern.Pattern, file.Item1, rank1, file.Item3));
+ } else if (match2) {
+ searchResultCallback.ReportResult (new FileSearchResult (pattern.Pattern, file.Item2, rank2, file.Item3));
}
}
- }
+ }, token);
}
-
- class WorkerResult
+
+ static bool MatchName (Dictionary<string, MatchResult> savedMatches, StringMatcher matcher, string name, out int matchRank)
{
- public List<ProjectFile> filteredFiles = null;
- public List<ITypeDefinition> filteredTypes = null;
- public List<IMember> filteredMembers = null;
-
- public string pattern = null;
- public bool isGotoFilePattern;
- public ResultsDataSource results;
-
- public bool FullSearch;
-
- public bool IncludeFiles, IncludeTypes, IncludeMembers;
-
- public Ambience ambience;
-
- public StringMatcher matcher = null;
-
- public WorkerResult (Widget widget)
- {
- results = new ResultsDataSource (widget);
+ if (name == null) {
+ matchRank = -1;
+ return false;
}
-
- internal SearchResult CheckFile (ProjectFile file)
- {
- int rank;
- string matchString = System.IO.Path.GetFileName (file.FilePath);
- if (MatchName (matchString, out rank))
- return new FileSearchResult (pattern, matchString, rank, file, true);
-
- if (!FullSearch)
- return null;
- matchString = FileSearchResult.GetRelProjectPath (file);
- if (MatchName (matchString, out rank))
- return new FileSearchResult (pattern, matchString, rank, file, false);
-
- return null;
- }
-
- internal SearchResult CheckType (ITypeDefinition type)
- {
- int rank;
- if (MatchName (type.Name, out rank))
- return new TypeSearchResult (pattern, type.Name, rank, type, false) { Ambience = ambience };
- if (!FullSearch)
- return null;
- if (MatchName (type.FullName, out rank))
- return new TypeSearchResult (pattern, type.FullName, rank, type, true) { Ambience = ambience };
- return null;
- }
-
- Dictionary<string, MatchResult> savedMatches = new Dictionary<string, MatchResult> ();
- bool MatchName (string name, out int matchRank)
- {
- if (name == null) {
- matchRank = -1;
- return false;
- }
- MatchResult savedMatch;
- if (!savedMatches.TryGetValue (name, out savedMatch)) {
- bool doesMatch = matcher.CalcMatchRank (name, out matchRank);
- savedMatches[name] = savedMatch = new MatchResult (doesMatch, matchRank);
- }
-
- matchRank = savedMatch.Rank;
- return savedMatch.Match;
+ MatchResult savedMatch;
+ if (!savedMatches.TryGetValue (name, out savedMatch)) {
+ bool doesMatch = matcher.CalcMatchRank (name, out matchRank);
+ savedMatches [name] = savedMatch = new MatchResult (doesMatch, matchRank);
}
+
+ matchRank = savedMatch.Rank;
+ return savedMatch.Match;
}
+
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ISearchDataSource.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ISearchDataSource.cs
index b1a90a607b..30f1e69670 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ISearchDataSource.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ISearchDataSource.cs
@@ -26,8 +26,8 @@
using System.Threading;
using System.Threading.Tasks;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Core.Text;
namespace MonoDevelop.Components.MainToolbar
{
@@ -39,10 +39,12 @@ namespace MonoDevelop.Components.MainToolbar
Xwt.Drawing.Image GetIcon (int item);
string GetMarkup (int item, bool isSelected);
string GetDescriptionMarkup (int item, bool isSelected);
- TooltipInformation GetTooltip (int item);
+ Task<TooltipInformation> GetTooltip (CancellationToken token, int item);
double GetWeight (int item);
- DomRegion GetRegion (int item);
+ ISegment GetRegion (int item);
+ string GetFileName (int item);
+
bool CanActivate (int item);
void Activate (int item);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ISearchResultCallback.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ISearchResultCallback.cs
new file mode 100644
index 0000000000..9e475d72e0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ISearchResultCallback.cs
@@ -0,0 +1,36 @@
+//
+// ISearchResultCallback.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Components.MainToolbar
+{
+ public interface ISearchResultCallback
+ {
+ void ReportResult (SearchResult result);
+
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs
index 751ebc8329..1c2d601edf 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs
@@ -30,7 +30,6 @@ using MonoDevelop.Ide;
using MonoDevelop.Ide.Commands;
using MonoDevelop.Core;
using System.Linq;
-using MonoDevelop.Core.Assemblies;
using MonoDevelop.Components;
using Cairo;
using MonoDevelop.Projects;
@@ -38,15 +37,12 @@ using System.Collections.Generic;
using Mono.Addins;
using MonoDevelop.Components.Commands.ExtensionNodes;
using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Execution;
using MonoDevelop.Core.Execution;
using MonoDevelop.Ide.TypeSystem;
using System.Threading;
-using ICSharpCode.NRefactory.TypeSystem;
-using Mono.TextEditor;
+using MonoDevelop.Ide.Editor;
using System.Text;
-
namespace MonoDevelop.Components.MainToolbar
{
class MainToolbar: Gtk.EventBox, IMainToolbarView
@@ -210,7 +206,6 @@ namespace MonoDevelop.Components.MainToolbar
matchEntry.Ready = true;
matchEntry.Visible = true;
matchEntry.IsCheckMenu = true;
- matchEntry.Entry.ModifyBase (StateType.Normal, Style.White);
matchEntry.WidthRequest = 240;
if (!Platform.IsMac && !Platform.IsWindows)
matchEntry.Entry.ModifyFont (Pango.FontDescription.FromString ("Sans 9")); // TODO: VV: "Segoe UI 9"
@@ -268,7 +263,7 @@ namespace MonoDevelop.Components.MainToolbar
protected override bool OnButtonPressEvent (Gdk.EventButton evnt)
{
if (evnt.Button == 1 && evnt.Window == GdkWindow) {
- var window = (Window)Toplevel;
+ var window = (Gtk.Window)Toplevel;
if (!DesktopService.GetIsFullscreen (window)) {
window.BeginMoveDrag (1, (int)evnt.XRoot, (int)evnt.YRoot, evnt.Time);
return true;
@@ -297,8 +292,7 @@ namespace MonoDevelop.Components.MainToolbar
void HandleSearchEntryChanged (object sender, EventArgs e)
{
- if (SearchEntryActivated != null)
- SearchEntryChanged (sender, e);
+ SearchEntryChanged?.Invoke (sender, e);
}
void HandleSearchEntryActivated (object sender, EventArgs e)
@@ -360,14 +354,8 @@ namespace MonoDevelop.Components.MainToolbar
}
context.MoveTo (0, Allocation.Height - 0.5);
context.RelLineTo (Allocation.Width, 0);
- context.SetSourceColor (Styles.ToolbarBottomBorderColor);
- context.Stroke ();
-
- context.MoveTo (0, Allocation.Height - 1.5);
- context.RelLineTo (Allocation.Width, 0);
- context.SetSourceColor (Styles.ToolbarBottomGlowColor);
+ context.SetSourceColor (Styles.ToolbarBottomBorderColor.ToCairoColor ());
context.Stroke ();
-
}
return base.OnExposeEvent (evnt);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs
index 9b36617840..c6fd6fd3c2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs
@@ -35,6 +35,7 @@ using Mono.Addins;
using MonoDevelop.Projects;
using MonoDevelop.Core.Execution;
using System.Text;
+using MonoDevelop.Ide.TypeSystem;
namespace MonoDevelop.Components.MainToolbar
{
@@ -52,7 +53,7 @@ namespace MonoDevelop.Components.MainToolbar
get { return ToolbarView.StatusBar; }
}
- readonly PropertyWrapper<bool> searchForMembers = new PropertyWrapper<bool> ("MainToolbar.Search.IncludeMembers", true);
+ readonly ConfigurationProperty<bool> searchForMembers = ConfigurationProperty.Create ("MainToolbar.Search.IncludeMembers", true);
bool SearchForMembers {
get { return searchForMembers; }
set { searchForMembers.Value = value; }
@@ -62,7 +63,7 @@ namespace MonoDevelop.Components.MainToolbar
int ignoreConfigurationChangedCount, ignoreRuntimeChangedCount;
Solution currentSolution;
bool settingGlobalConfig;
- SolutionEntityItem currentStartupProject;
+ SolutionItem currentStartupProject;
EventHandler executionTargetsChanged;
public MainToolbarController (IMainToolbarView toolbarView)
@@ -95,7 +96,7 @@ namespace MonoDevelop.Components.MainToolbar
UpdateSearchEntryLabel ();
};
- executionTargetsChanged = DispatchService.GuiDispatch (new EventHandler ((sender, e) => UpdateCombos ()));
+ executionTargetsChanged = (sender, e) => UpdateCombos ();
IdeApp.Workspace.LastWorkspaceItemClosed += (sender, e) => StatusBar.ShowReady ();
IdeApp.Workspace.ActiveConfigurationChanged += (sender, e) => UpdateCombos ();
@@ -341,7 +342,7 @@ namespace MonoDevelop.Components.MainToolbar
bool SelectActiveRuntime (ref bool selected, ref ExecutionTarget defaultTarget, ref int defaultIter)
{
var runtimes = ToolbarView.RuntimeModel.Cast<RuntimeModel> ().ToList ();
- string lastRuntimeForProject = currentStartupProject != null ? currentStartupProject.UserProperties.GetValue<string> ("PreferredExecutionTarget", defaultValue: null) : null;
+ string lastRuntimeForProject = currentStartupProject?.UserProperties.GetValue<string> ("PreferredExecutionTarget", defaultValue: null);
var activeTarget = IdeApp.Workspace.ActiveExecutionTarget;
var activeTargetId = activeTarget != null ? activeTarget.Id : null;
@@ -400,6 +401,15 @@ namespace MonoDevelop.Components.MainToolbar
}
UpdateBuildConfiguration ();
}
+
+ if (currentStartupProject == null) {
+ return;
+ }
+
+ var runtime = (RuntimeModel)ToolbarView.ActiveRuntime;
+ if (runtime != null && runtime.Command == null) {
+ currentStartupProject.UserProperties.SetValue<string> ("PreferredExecutionTarget", runtime.TargetId);
+ }
}
} finally {
ignoreRuntimeChangedCount--;
@@ -443,9 +453,6 @@ namespace MonoDevelop.Components.MainToolbar
void TrackStartupProject ()
{
if (currentStartupProject != null && ((currentSolution != null && currentStartupProject != currentSolution.StartupItem) || currentSolution == null)) {
- var runtime = (RuntimeModel)ToolbarView.ActiveRuntime;
- if (runtime != null && runtime.Command == null)
- currentStartupProject.UserProperties.SetValue<string> ("PreferredExecutionTarget", runtime.TargetId);
currentStartupProject.ExecutionTargetsChanged -= executionTargetsChanged;
currentStartupProject.Saved -= HandleUpdateCombos;
}
@@ -482,7 +489,7 @@ namespace MonoDevelop.Components.MainToolbar
{
var info = IdeApp.CommandService.GetCommand (Commands.NavigateTo);
ToolbarView.SearchPlaceholderMessage = !string.IsNullOrEmpty (info.AccelKey) ?
- GettextCatalog.GetString ("Press '{0}' to search", KeyBindingManager.BindingToDisplayLabel (info.AccelKey, false)) :
+ GettextCatalog.GetString ("Press \u2018{0}\u2019 to search", KeyBindingManager.BindingToDisplayLabel (info.AccelKey, false)) :
GettextCatalog.GetString ("Search solution");
}
@@ -516,6 +523,9 @@ namespace MonoDevelop.Components.MainToolbar
void HandleSearchEntryChanged (object sender, EventArgs e)
{
+ if (!string.IsNullOrEmpty (ToolbarView.SearchText))
+ lastSearchText = ToolbarView.SearchText;
+
if (string.IsNullOrEmpty (ToolbarView.SearchText)){
DestroyPopup ();
return;
@@ -553,9 +563,9 @@ namespace MonoDevelop.Components.MainToolbar
var doc = IdeApp.Workbench.ActiveDocument;
if (doc != null && doc.Editor != null) {
doc.Select ();
- doc.Editor.Caret.Location = new Mono.TextEditor.DocumentLocation (pattern.LineNumber, pattern.Column > 0 ? pattern.Column : 1);
+ doc.Editor.CaretLocation = new MonoDevelop.Ide.Editor.DocumentLocation (pattern.LineNumber, pattern.Column > 0 ? pattern.Column : 1);
doc.Editor.CenterToCaret ();
- doc.Editor.Parent.StartCaretPulseAnimation ();
+ doc.Editor.StartCaretPulseAnimation ();
}
return;
}
@@ -565,10 +575,10 @@ namespace MonoDevelop.Components.MainToolbar
void HandleSearchEntryKeyPressed (object sender, Xwt.KeyEventArgs e)
{
- if (e.Key == Xwt.Key.Escape) {
+ if (e.Key == Xwt.Key.Escape) {
+ DestroyPopup();
var doc = IdeApp.Workbench.ActiveDocument;
if (doc != null) {
- DestroyPopup ();
doc.Select ();
}
return;
@@ -578,9 +588,19 @@ namespace MonoDevelop.Components.MainToolbar
}
}
+ string lastSearchText = string.Empty;
public void FocusSearchBar ()
{
IdeApp.Workbench.Present ();
+ var text = lastSearchText;
+ var actDoc = IdeApp.Workbench.ActiveDocument;
+ if (actDoc != null && actDoc.Editor.IsSomethingSelected) {
+ string selected = actDoc.Editor.SelectedText;
+ int whitespaceIndex = selected.TakeWhile (c => !char.IsWhiteSpace (c)).Count ();
+ text = selected.Substring (0, whitespaceIndex);
+ }
+
+ ToolbarView.SearchText = text;
ToolbarView.FocusSearchBar ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ProjectSearchCategory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ProjectSearchCategory.cs
deleted file mode 100644
index 3af7fa2545..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ProjectSearchCategory.cs
+++ /dev/null
@@ -1,357 +0,0 @@
-//
-// ProjectSearchCategory.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-using MonoDevelop.Core;
-using System.Collections.Generic;
-using MonoDevelop.Core.Instrumentation;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Ide.TypeSystem;
-using MonoDevelop.Core.Text;
-using Gtk;
-using System.Linq;
-
-namespace MonoDevelop.Components.MainToolbar
-{
- class ProjectSearchCategory : SearchCategory
- {
- SearchPopupWindow widget;
-
- public ProjectSearchCategory (SearchPopupWindow widget) : base (GettextCatalog.GetString("Solution"))
- {
- this.widget = widget;
- this.lastResult = new WorkerResult (widget);
- }
-
- static TimerCounter getMembersTimer = InstrumentationService.CreateTimerCounter ("Time to get all members", "NavigateToDialog");
-
-
- static TimerCounter getTypesTimer = InstrumentationService.CreateTimerCounter ("Time to get all types", "NavigateToDialog");
-
- IEnumerable<ITypeDefinition> types {
- get {
- getTypesTimer.BeginTiming ();
- try {
- foreach (Document doc in IdeApp.Workbench.Documents) {
- // We only want to check it here if it's not part
- // of the open combine. Otherwise, it will get
- // checked down below.
- if (doc.Project == null && doc.IsFile) {
- var info = doc.ParsedDocument;
- if (info != null) {
- var ctx = doc.Compilation;
- foreach (var type in ctx.MainAssembly.GetAllTypeDefinitions ()) {
- yield return type;
- }
- }
- }
- }
-
- var projects = IdeApp.Workspace.GetAllProjects ();
-
- foreach (Project p in projects) {
- var pctx = TypeSystemService.GetCompilation (p);
- foreach (var type in pctx.MainAssembly.GetAllTypeDefinitions ())
- yield return type;
- }
- } finally {
- getTypesTimer.EndTiming ();
- }
- }
- }
-
- WorkerResult lastResult;
- string[] typeTags = new [] { "type", "c", "s", "i", "e", "d"};
- string[] memberTags = new [] { "member", "m", "p", "f", "evt"};
-
- public override bool IsValidTag (string tag)
- {
- return typeTags.Any (t => t == tag) || memberTags.Any (t => t == tag);
- }
-
- public override Task<ISearchDataSource> GetResults (SearchPopupSearchPattern searchPattern, int resultsCount, CancellationToken token)
- {
- return Task.Factory.StartNew (delegate {
- if (searchPattern.Tag != null && !(typeTags.Contains (searchPattern.Tag) || memberTags.Contains (searchPattern.Tag)) || searchPattern.HasLineNumber)
- return null;
- try {
- var newResult = new WorkerResult (widget);
- newResult.pattern = searchPattern.Pattern;
- newResult.IncludeFiles = true;
- newResult.Tag = searchPattern.Tag;
- newResult.IncludeTypes = searchPattern.Tag == null || typeTags.Contains (searchPattern.Tag) ;
- newResult.IncludeMembers = searchPattern.Tag == null || memberTags.Contains (searchPattern.Tag);
- var firstType = types.FirstOrDefault ();
- newResult.ambience = firstType != null ? AmbienceService.GetAmbienceForFile (firstType.Region.FileName) : AmbienceService.DefaultAmbience;
-
- string toMatch = searchPattern.Pattern;
- newResult.matcher = StringMatcher.GetMatcher (toMatch, false);
- newResult.FullSearch = toMatch.IndexOf ('.') > 0;
- var oldLastResult = lastResult;
- if (newResult.FullSearch && oldLastResult != null && !oldLastResult.FullSearch)
- oldLastResult = new WorkerResult (widget);
-// var now = DateTime.Now;
-
- AllResults (oldLastResult, newResult, token);
- newResult.results.SortUpToN (new DataItemComparer (token), resultsCount);
- lastResult = newResult;
-// Console.WriteLine ((now - DateTime.Now).TotalMilliseconds);
- return (ISearchDataSource)newResult.results;
- } catch {
- token.ThrowIfCancellationRequested ();
- throw;
- }
- }, token);
- }
-
- void AllResults (WorkerResult lastResult, WorkerResult newResult, CancellationToken token)
- {
- if (newResult.isGotoFilePattern)
- return;
- uint x = 0;
- // Search Types
- if (newResult.IncludeTypes && (newResult.Tag == null || typeTags.Any (t => t == newResult.Tag))) {
- newResult.filteredTypes = new List<ITypeDefinition> ();
- bool startsWithLastFilter = lastResult.pattern != null && newResult.pattern.StartsWith (lastResult.pattern, StringComparison.Ordinal) && lastResult.filteredTypes != null;
- var allTypes = startsWithLastFilter ? lastResult.filteredTypes : types;
- foreach (var type in allTypes) {
- if (unchecked(x++) % 100 == 0 && token.IsCancellationRequested)
- return;
-
- if (newResult.Tag != null) {
- if (newResult.Tag == "c" && type.Kind != TypeKind.Class)
- continue;
- if (newResult.Tag == "s" && type.Kind != TypeKind.Struct)
- continue;
- if (newResult.Tag == "i" && type.Kind != TypeKind.Interface)
- continue;
- if (newResult.Tag == "e" && type.Kind != TypeKind.Enum)
- continue;
- if (newResult.Tag == "d" && type.Kind != TypeKind.Delegate)
- continue;
- }
- SearchResult curResult = newResult.CheckType (type);
- if (curResult != null) {
- newResult.filteredTypes.Add (type);
- newResult.results.AddResult (curResult);
- }
- }
- }
-
- // Search members
- if (newResult.IncludeMembers && (newResult.Tag == null || memberTags.Any (t => t == newResult.Tag))) {
- newResult.filteredMembers = new List<Tuple<ITypeDefinition, IUnresolvedMember>> ();
- bool startsWithLastFilter = lastResult.pattern != null && newResult.pattern.StartsWith (lastResult.pattern, StringComparison.Ordinal) && lastResult.filteredMembers != null;
- if (startsWithLastFilter) {
- foreach (var t in lastResult.filteredMembers) {
- if (unchecked(x++) % 100 == 0 && token.IsCancellationRequested)
- return;
- var member = t.Item2;
- if (newResult.Tag != null) {
- if (newResult.Tag == "m" && member.SymbolKind != SymbolKind.Method)
- continue;
- if (newResult.Tag == "p" && member.SymbolKind != SymbolKind.Property)
- continue;
- if (newResult.Tag == "f" && member.SymbolKind != SymbolKind.Field)
- continue;
- if (newResult.Tag == "evt" && member.SymbolKind != SymbolKind.Event)
- continue;
- }
- SearchResult curResult = newResult.CheckMember (t.Item1, member);
- if (curResult != null) {
- newResult.filteredMembers.Add (t);
- newResult.results.AddResult (curResult);
- }
- }
- } else {
- Func<IUnresolvedMember, bool> mPred = member => {
- if (newResult.Tag != null) {
- if (newResult.Tag == "m" && member.SymbolKind != SymbolKind.Method)
- return false;
- if (newResult.Tag == "p" && member.SymbolKind != SymbolKind.Property)
- return false;
- if (newResult.Tag == "f" && member.SymbolKind != SymbolKind.Field)
- return false;
- if (newResult.Tag == "evt" && member.SymbolKind != SymbolKind.Event)
- return false;
- }
- return newResult.IsMatchingMember (member);
- };
-
- getMembersTimer.BeginTiming ();
- try {
- foreach (var type in types) {
- if (type.Kind == TypeKind.Delegate)
- continue;
- foreach (var p in type.Parts) {
- foreach (var member in p.Members.Where (mPred)) {
- if (unchecked(x++) % 100 == 0 && token.IsCancellationRequested)
- return;
- SearchResult curResult = newResult.CheckMember (type, member);
- if (curResult != null) {
- newResult.filteredMembers.Add (Tuple.Create (type, member));
- newResult.results.AddResult (curResult);
- }
- }
- }
- }
- } finally {
- getMembersTimer.EndTiming ();
- }
- }
- }
- }
-
- class WorkerResult
- {
- public string Tag {
- get;
- set;
- }
-
- public List<ProjectFile> filteredFiles;
- public List<ITypeDefinition> filteredTypes;
- public List<Tuple<ITypeDefinition, IUnresolvedMember>> filteredMembers;
- string pattern2;
- char firstChar;
- char[] firstChars;
- public string pattern {
- get {
- return pattern2;
- }
- set {
- pattern2 = value;
- if (pattern2.Length == 1) {
- firstChar = pattern2[0];
- firstChars = new [] { char.ToUpper (firstChar), char.ToLower (firstChar) };
- } else {
- firstChars = null;
- }
- }
- }
- public bool isGotoFilePattern;
- public ResultsDataSource results;
- public bool FullSearch;
- public bool IncludeFiles, IncludeTypes, IncludeMembers;
- public Ambience ambience;
- public StringMatcher matcher;
-
- public WorkerResult (Widget widget)
- {
- results = new ResultsDataSource (widget);
- }
-
- internal SearchResult CheckFile (ProjectFile file)
- {
- int rank;
- string matchString = System.IO.Path.GetFileName (file.FilePath);
- if (MatchName (matchString, out rank))
- return new FileSearchResult (pattern, matchString, rank, file, true);
-
- if (!FullSearch)
- return null;
- matchString = FileSearchResult.GetRelProjectPath (file);
- if (MatchName (matchString, out rank))
- return new FileSearchResult (pattern, matchString, rank, file, false);
-
- return null;
- }
-
- internal SearchResult CheckType (ITypeDefinition type)
- {
- int rank;
- if (MatchName (TypeSearchResult.GetPlainText (type, false), out rank)) {
- if (type.DeclaringType != null)
- rank--;
- return new TypeSearchResult (pattern, TypeSearchResult.GetPlainText (type, false), rank, type, false) { Ambience = ambience };
- }
- if (!FullSearch)
- return null;
- if (MatchName (TypeSearchResult.GetPlainText (type, true), out rank)) {
- if (type.DeclaringType != null)
- rank--;
- return new TypeSearchResult (pattern, TypeSearchResult.GetPlainText (type, true), rank, type, true) { Ambience = ambience };
- }
- return null;
- }
-
- internal SearchResult CheckMember (ITypeDefinition declaringType, IUnresolvedMember member)
- {
- int rank;
- bool useDeclaringTypeName = member is IUnresolvedMethod && (((IUnresolvedMethod)member).IsConstructor || ((IUnresolvedMethod)member).IsDestructor);
- string memberName = useDeclaringTypeName ? member.DeclaringTypeDefinition.Name : member.Name;
- if (MatchName (memberName, out rank))
- return new MemberSearchResult (pattern, memberName, rank, declaringType, member, false) { Ambience = ambience };
- return null;
- }
-
- internal bool IsMatchingMember (IUnresolvedMember member)
- {
- int rank;
- bool useDeclaringTypeName = member is IUnresolvedMethod && (((IUnresolvedMethod)member).IsConstructor || ((IUnresolvedMethod)member).IsDestructor);
- string memberName = useDeclaringTypeName ? member.DeclaringTypeDefinition.Name : member.Name;
- return MatchName (memberName, out rank);
- }
-
- Dictionary<string, MatchResult> savedMatches = new Dictionary<string, MatchResult> (StringComparer.Ordinal);
-
- bool MatchName (string name, out int matchRank)
- {
- if (name == null) {
- matchRank = -1;
- return false;
- }
-
- bool doesMatch;
- if (firstChars != null) {
- int idx = name.IndexOfAny (firstChars);
- doesMatch = idx >= 0;
- if (doesMatch) {
- matchRank = int.MaxValue - (name.Length - 1) * 10 - idx;
- if (name[idx] != firstChar)
- matchRank /= 2;
- return true;
- } else {
- matchRank = -1;
- }
- return false;
- }
- MatchResult savedMatch;
- if (!savedMatches.TryGetValue (name, out savedMatch)) {
- doesMatch = matcher.CalcMatchRank (name, out matchRank);
- savedMatches [name] = savedMatch = new MatchResult (doesMatch, matchRank);
- }
-
- matchRank = savedMatch.Rank;
- return savedMatch.Match;
- }
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ResultsDataSource.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ResultsDataSource.cs
index 5de97bdd00..5812694d83 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ResultsDataSource.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/ResultsDataSource.cs
@@ -38,20 +38,19 @@ using MonoDevelop.Core.Instrumentation;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Components.MainToolbar;
-using ICSharpCode.NRefactory.TypeSystem;
+using MonoDevelop.Core.Text;
+using System.Threading.Tasks;
namespace MonoDevelop.Components.MainToolbar
{
class ResultsDataSource: List<SearchResult>, ISearchDataSource
{
-
- Gtk.Widget widget;
+
SearchResult bestResult;
int bestRank = int.MinValue;
- public ResultsDataSource (Gtk.Widget widget)
+ public ResultsDataSource ()
{
- this.widget = widget;
}
public void SortUpToN (MonoDevelop.Components.MainToolbar.SearchCategory.DataItemComparer comparison, int n)
@@ -124,20 +123,26 @@ namespace MonoDevelop.Components.MainToolbar
{
if (isSelected)
return GLib.Markup.EscapeText (this [item].PlainText);
- return this [item].GetMarkupText (widget);
+ return this [item].GetMarkupText (isSelected);
}
string ISearchDataSource.GetDescriptionMarkup (int item, bool isSelected)
{
if (isSelected)
return GLib.Markup.EscapeText (this [item].Description);
- return this [item].GetDescriptionMarkupText (widget);
+ return this [item].GetDescriptionMarkupText ();
+ }
+
+ ISegment ISearchDataSource.GetRegion (int item)
+ {
+ var result = this [item];
+ return new TextSegment (result.Offset, result.Length);
}
- ICSharpCode.NRefactory.TypeSystem.DomRegion ISearchDataSource.GetRegion (int item)
+ string ISearchDataSource.GetFileName (int item)
{
var result = this [item];
- return new DomRegion (result.File, result.Row, result.Column, result.Row, result.Column);
+ return result.File;
}
bool ISearchDataSource.CanActivate (int item)
@@ -163,9 +168,9 @@ namespace MonoDevelop.Components.MainToolbar
}
}
- TooltipInformation ISearchDataSource.GetTooltip (int item)
+ Task<TooltipInformation> ISearchDataSource.GetTooltip (CancellationToken token, int item)
{
- return this [item].TooltipInformation;
+ return this [item].GetTooltipInformation (token);
}
#endregion
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/RoundButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/RoundButton.cs
index 4a7bd9074a..4d3a4d70bb 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/RoundButton.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/RoundButton.cs
@@ -30,8 +30,6 @@ using MonoDevelop.Components;
using Cairo;
using MonoDevelop.Ide;
using System.Reflection;
-using Mono.TextEditor;
-
namespace MonoDevelop.Components.MainToolbar
{
@@ -45,7 +43,7 @@ namespace MonoDevelop.Components.MainToolbar
Cairo.Color fill2Color;
Cairo.Color fill3Color;*/
- Xwt.Drawing.Image btnNormal/*, btnInactive, btnHover, btnPressed*/;
+ Xwt.Drawing.Image btnNormal, btnInactive, btnHover, btnPressed;
Xwt.Drawing.Image iconRunNormal, iconRunDisabled;
Xwt.Drawing.Image iconStopNormal, iconStopDisabled;
@@ -59,9 +57,9 @@ namespace MonoDevelop.Components.MainToolbar
SetSizeRequest (height, height);
btnNormal = Xwt.Drawing.Image.FromResource (GetType (), "btn-execute-normal-32.png");
-// btnInactive = new LazyImage ("btn-execute-disabled-32.png");
-// btnPressed = new LazyImage ("btn-execute-pressed-32.png");
-// btnHover = new LazyImage ("btn-execute-hover-32.png");
+ btnInactive = Xwt.Drawing.Image.FromResource (GetType (), "btn-execute-disabled-32.png");
+ btnPressed = Xwt.Drawing.Image.FromResource (GetType (), "btn-execute-pressed-32.png");
+ btnHover = Xwt.Drawing.Image.FromResource (GetType (), "btn-execute-hover-32.png");
iconRunNormal = Xwt.Drawing.Image.FromResource (GetType (), "ico-execute-normal-32.png");
iconRunDisabled = Xwt.Drawing.Image.FromResource (GetType (), "ico-execute-disabled-32.png");
@@ -73,7 +71,7 @@ namespace MonoDevelop.Components.MainToolbar
iconBuildDisabled = Xwt.Drawing.Image.FromResource (GetType (), "ico-build-disabled-32.png");
}
- StateType hoverState = StateType.Normal;
+ StateType hoverState = StateType.Prelight;
protected override bool OnMotionNotifyEvent (EventMotion evnt)
{
@@ -156,43 +154,23 @@ namespace MonoDevelop.Components.MainToolbar
void DrawBackground (Cairo.Context context, Gdk.Rectangle region, int radius, StateType state)
{
- double rad = radius - 0.5;
- int centerX = region.X + region.Width / 2;
- int centerY = region.Y + region.Height / 2;
-
- context.MoveTo (centerX + rad, centerY);
- context.Arc (centerX, centerY, rad, 0, Math.PI * 2);
+ int x = region.X + region.Width / 2;
+ int y = region.Y + region.Height / 2;
- double high;
- double low;
+ var img = btnNormal;
switch (state) {
- case StateType.Selected:
- high = 0.85;
- low = 1.0;
- break;
- case StateType.Prelight:
- high = 1.0;
- low = 0.9;
- break;
case StateType.Insensitive:
- high = 0.95;
- low = 0.83;
- break;
- default:
- high = 1.0;
- low = 0.85;
- break;
- }
- using (var lg = new LinearGradient (0, centerY - rad, 0, centerY +rad)) {
- lg.AddColorStop (0, new Cairo.Color (high, high, high));
- lg.AddColorStop (1, new Cairo.Color (low, low, low));
- context.SetSource (lg);
- context.FillPreserve ();
+ img = btnInactive; break;
+ case StateType.Prelight:
+ img = btnHover; break;
+ case StateType.Selected:
+ img = btnPressed; break;
}
- context.SetSourceRGBA (0, 0, 0, 0.4);
- context.LineWidth = 1;
- context.Stroke ();
+ x -= (int) img.Width / 2;
+ y -= (int) img.Height / 2;
+
+ context.DrawImage (this, img, x, y);
}
public event EventHandler Clicked;
@@ -213,6 +191,21 @@ namespace MonoDevelop.Components.MainToolbar
btnNormal = null;
}
+ if (btnInactive != null) {
+ btnInactive.Dispose ();
+ btnInactive = null;
+ }
+
+ if (btnPressed != null) {
+ btnPressed.Dispose ();
+ btnPressed = null;
+ }
+
+ if (btnHover != null) {
+ btnHover.Dispose ();
+ btnHover = null;
+ }
+
if (iconRunNormal != null) {
iconRunNormal.Dispose ();
iconRunNormal = null;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchCategory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchCategory.cs
index 7c15d26c6f..a685eacaa8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchCategory.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchCategory.cs
@@ -28,38 +28,23 @@ using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
-using ICSharpCode.NRefactory.TypeSystem;
namespace MonoDevelop.Components.MainToolbar
{
- public abstract class SearchCategory
+ public abstract class SearchCategory : IComparable<SearchCategory>
{
+ protected const int FirstCategory = -1000;
+ protected int sortOrder = 0;
+
internal class DataItemComparer : IComparer<SearchResult>
{
- CancellationToken Token {
- get; set;
- }
-
- public DataItemComparer ()
- {
- }
-
- public DataItemComparer (CancellationToken token)
- {
- Token = token;
- }
-
- static uint compareTick;
public int Compare (SearchResult o1, SearchResult o2)
{
- if (unchecked(compareTick++) % 100 == 0)
- Token.ThrowIfCancellationRequested ();
-
var r = o2.Rank.CompareTo (o1.Rank);
if (r == 0)
r = o1.SearchResultType.CompareTo (o2.SearchResultType);
if (r == 0)
- return String.CompareOrdinal (o1.MatchedString, o2.MatchedString);
+ return string.CompareOrdinal (o1.MatchedString, o2.MatchedString);
return r;
}
}
@@ -81,6 +66,9 @@ namespace MonoDevelop.Components.MainToolbar
set;
}
+ public abstract string[] Tags {
+ get;
+ }
public SearchCategory (string name)
{
@@ -89,6 +77,16 @@ namespace MonoDevelop.Components.MainToolbar
public abstract bool IsValidTag (string tag);
- public abstract Task<ISearchDataSource> GetResults (SearchPopupSearchPattern searchPattern, int resultsCount, CancellationToken token);
+ public abstract Task GetResults (ISearchResultCallback searchResultCallback, SearchPopupSearchPattern pattern, CancellationToken token);
+
+ public virtual void Initialize (PopoverWindow popupWindow)
+ {
+
+ }
+
+ public int CompareTo (SearchCategory other)
+ {
+ return sortOrder.CompareTo (other.sortOrder);
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchInSolutionSearchCategory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchInSolutionSearchCategory.cs
index cd1a9c87e5..a76ccc18ed 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchInSolutionSearchCategory.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchInSolutionSearchCategory.cs
@@ -30,6 +30,10 @@ using MonoDevelop.Core;
using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.FindInFiles;
using System.Linq;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Ide;
namespace MonoDevelop.Components.MainToolbar
@@ -40,15 +44,25 @@ namespace MonoDevelop.Components.MainToolbar
{
}
- public override Task<ISearchDataSource> GetResults (SearchPopupSearchPattern searchPattern, int resultsCount, CancellationToken token)
+ public override Task GetResults (ISearchResultCallback searchResultCallback, SearchPopupSearchPattern pattern, CancellationToken token)
{
- if (IdeApp.ProjectOperations.CurrentSelectedSolution != null) {
- return Task.Factory.StartNew (delegate {
- return (ISearchDataSource)new SearchInSolutionDataSource (searchPattern);
- });
- }
+ if (IdeApp.ProjectOperations.CurrentSelectedSolution != null)
+ searchResultCallback.ReportResult (new SearchInSolutionSearchResult (pattern));
+ return SpecializedTasks.EmptyTask;
+ }
- return Task.FromResult<ISearchDataSource> (default(ISearchDataSource));
+ //public override Task<ISearchDataSource> GetResults (SearchPopupSearchPattern searchPattern, int resultsCount, CancellationToken token)
+ //{
+ // return Task.Factory.StartNew (delegate {
+ // return (ISearchDataSource)new SearchInSolutionDataSource (searchPattern);
+ // });
+ //}
+ static readonly string[] tags = { "search" };
+
+ public override string[] Tags {
+ get {
+ return tags;
+ }
}
public override bool IsValidTag (string tag)
@@ -56,67 +70,33 @@ namespace MonoDevelop.Components.MainToolbar
return tag == "search";
}
- class SearchInSolutionDataSource : ISearchDataSource
+ class SearchInSolutionSearchResult : SearchResult
{
- readonly SearchPopupSearchPattern searchPattern;
-
- public SearchInSolutionDataSource (SearchPopupSearchPattern searchPattern)
- {
- this.searchPattern = searchPattern;
- }
+ SearchPopupSearchPattern pattern;
- #region ISearchDataSource implementation
-
- Xwt.Drawing.Image ISearchDataSource.GetIcon (int item)
- {
- return null;
- }
-
- string ISearchDataSource.GetMarkup (int item, bool isSelected)
- {
- return GettextCatalog.GetString ("Search in Solution");
- }
-
- string ISearchDataSource.GetDescriptionMarkup (int item, bool isSelected)
- {
- return null;
- }
-
- MonoDevelop.Ide.CodeCompletion.TooltipInformation ISearchDataSource.GetTooltip (int item)
- {
- return null;
- }
-
- double ISearchDataSource.GetWeight (int item)
- {
- return 0;
- }
-
- DomRegion ISearchDataSource.GetRegion (int item)
- {
- return DomRegion.Empty;
+ public override bool CanActivate {
+ get {
+ return true;
+ }
}
- bool ISearchDataSource.CanActivate (int item)
+ public SearchInSolutionSearchResult (SearchPopupSearchPattern pattern) : base ("", "", 0)
{
- return true;
+ this.pattern = pattern;
}
- void ISearchDataSource.Activate (int item)
+ public override void Activate ()
{
var options = new FilterOptions ();
if (PropertyService.Get ("AutoSetPatternCasing", true))
- options.CaseSensitive = searchPattern.Pattern.Any (c => char.IsUpper (c));
- FindInFilesDialog.SearchReplace (searchPattern.Pattern, null, new WholeSolutionScope (), options, null);
+ options.CaseSensitive = pattern.Pattern.Any (c => char.IsUpper (c));
+ FindInFilesDialog.SearchReplace (pattern.Pattern, null, new WholeSolutionScope (), options, null, null);
}
- int ISearchDataSource.ItemCount {
- get {
- return 1;
- }
+ public override string GetMarkupText (bool selected)
+ {
+ return GettextCatalog.GetString ("Search in Solution...");
}
- #endregion
}
}
-}
-
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupSearchPattern.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupSearchPattern.cs
index 1d77e7ec8b..46722b1ba4 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupSearchPattern.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupSearchPattern.cs
@@ -34,6 +34,7 @@ using System.Linq;
using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide;
using MonoDevelop.Ide.CodeCompletion;
+using System.Text.RegularExpressions;
namespace MonoDevelop.Components.MainToolbar
{
@@ -65,8 +66,44 @@ namespace MonoDevelop.Components.MainToolbar
UnparsedPattern = unparsedPattern;
}
+ static readonly Regex githubRegex = new Regex ("((?<tag>.*):)?(?<pattern>[^#]+)#L(?<line>\\d+)$", RegexOptions.Compiled); // for example: ExceptionCaughtDialog.cs#L510
+ static readonly Regex lineRegex = new Regex ("((?<tag>[^:]*\\S)\\s*:)?\\s*(?<pattern>[^0-:][^:\\s]*)\\s*:[a-zA-Z]*\\s*(?<line>\\d+)$", RegexOptions.Compiled); // for example: ExceptionCaughtDialog.cs:line 510
+
public static SearchPopupSearchPattern ParsePattern (string searchPattern)
{
+ var githubMatch = githubRegex.Match (searchPattern);
+ if (githubMatch.Success) {
+ int parsedLine;
+ try {
+ parsedLine = int.Parse (githubMatch.Groups ["line"].Value);
+ } catch (Exception) {
+ parsedLine = -1;
+ }
+ return new SearchPopupSearchPattern (githubMatch.Groups["tag"].Success ? githubMatch.Groups["tag"].Value : null,
+ githubMatch.Groups["pattern"].Success ? githubMatch.Groups["pattern"].Value : null,
+ parsedLine,
+ -1,
+ searchPattern);
+
+ }
+
+
+ var lineRegexMatch = lineRegex.Match (searchPattern);
+ if (lineRegexMatch.Success) {
+ int parsedLine;
+ try {
+ parsedLine = int.Parse (lineRegexMatch.Groups ["line"].Value);
+ } catch (Exception) {
+ parsedLine = -1;
+ }
+ return new SearchPopupSearchPattern (lineRegexMatch.Groups["tag"].Success ? lineRegexMatch.Groups["tag"].Value : null,
+ lineRegexMatch.Groups["pattern"].Value,
+ parsedLine,
+ -1,
+ searchPattern);
+
+ }
+
string tag = null;
string pattern = null;
int lineNumber = -1;
@@ -124,7 +161,7 @@ namespace MonoDevelop.Components.MainToolbar
lineNumber = 0;
break;
}
- return new SearchPopupSearchPattern (tag, pattern, lineNumber, column, searchPattern);
+ return new SearchPopupSearchPattern (tag, pattern?.Trim (), lineNumber, column, searchPattern);
}
static bool TryParseLineColumn (string str, ref int lineNumber, ref int columnNumber)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupWindow.cs
index b84db63c31..f18bdb998f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupWindow.cs
@@ -30,11 +30,12 @@ using MonoDevelop.Core;
using System.Collections.Generic;
using Gtk;
using System.Linq;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide;
using MonoDevelop.Ide.CodeCompletion;
using Mono.Addins;
-using Mono.TextEditor;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Core.Text;
+using System.Collections.Immutable;
namespace MonoDevelop.Components.MainToolbar
{
@@ -42,15 +43,15 @@ namespace MonoDevelop.Components.MainToolbar
{
const int yMargin = 0;
const int xMargin = 6;
- const int itemSeparatorHeight = 2;
+ const int itemSeparatorHeight = 0;
const int marginIconSpacing = 4;
const int iconTextSpacing = 6;
const int categorySeparatorHeight = 8;
const int headerMarginSize = 100;
+ const int itemPadding = 4;
List<SearchCategory> categories = new List<SearchCategory> ();
- List<Tuple<SearchCategory, ISearchDataSource>> results = new List<Tuple<SearchCategory, ISearchDataSource>> ();
- List<Tuple<SearchCategory, ISearchDataSource>> incompleteResults = new List<Tuple<SearchCategory, ISearchDataSource>> ();
+ List<Tuple<SearchCategory, IReadOnlyList<SearchResult>>> results = new List<Tuple<SearchCategory, IReadOnlyList<SearchResult>>> ();
Pango.Layout layout, headerLayout;
CancellationTokenSource src;
Cairo.Color headerColor;
@@ -76,7 +77,7 @@ namespace MonoDevelop.Components.MainToolbar
{
throw new NotImplementedException ();
}
- TooltipInformation ISearchDataSource.GetTooltip (int item)
+ Task<TooltipInformation> ISearchDataSource.GetTooltip (CancellationToken token, int item)
{
throw new NotImplementedException ();
}
@@ -84,7 +85,13 @@ namespace MonoDevelop.Components.MainToolbar
{
throw new NotImplementedException ();
}
- DomRegion ISearchDataSource.GetRegion (int item)
+
+ ISegment ISearchDataSource.GetRegion (int item)
+ {
+ throw new NotImplementedException ();
+ }
+
+ string ISearchDataSource.GetFileName (int item)
{
throw new NotImplementedException ();
}
@@ -105,11 +112,11 @@ namespace MonoDevelop.Components.MainToolbar
}
public SearchPopupWindow ()
{
- headerColor = CairoExtensions.ParseColor ("8c8c8c");
- separatorLine = CairoExtensions.ParseColor ("dedede");
- lightSearchBackground = CairoExtensions.ParseColor ("ffffff");
- darkSearchBackground = CairoExtensions.ParseColor ("f7f7f7");
- selectionBackgroundColor = CairoExtensions.ParseColor ("cccccc");
+ headerColor = Styles.GlobalSearch.HeaderTextColor.ToCairoColor ();
+ separatorLine = Styles.GlobalSearch.SeparatorLineColor.ToCairoColor ();
+ lightSearchBackground = Styles.GlobalSearch.HeaderBackgroundColor.ToCairoColor ();
+ darkSearchBackground = Styles.GlobalSearch.BackgroundColor.ToCairoColor ();
+ selectionBackgroundColor = Styles.GlobalSearch.SelectionBackgroundColor.ToCairoColor ();
TypeHint = Gdk.WindowTypeHint.Combo;
this.SkipTaskbarHint = true;
this.SkipPagerHint = true;
@@ -117,12 +124,15 @@ namespace MonoDevelop.Components.MainToolbar
this.AllowShrink = false;
this.AllowGrow = false;
- categories.Add (new ProjectSearchCategory (this));
- categories.Add (new FileSearchCategory (this));
- categories.Add (new CommandSearchCategory (this));
-
+ categories.Add (new FileSearchCategory ());
+ categories.Add (new CommandSearchCategory ());
categories.Add (new SearchInSolutionSearchCategory ());
- categories.AddRange (AddinManager.GetExtensionObjects<SearchCategory> ("/MonoDevelop/Ide/SearchCategories"));
+ foreach (var cat in AddinManager.GetExtensionObjects<SearchCategory> ("/MonoDevelop/Ide/SearchCategories")) {
+ categories.Add (cat);
+ cat.Initialize (this);
+ }
+
+ categories.Sort ();
layout = new Pango.Layout (PangoContext);
headerLayout = new Pango.Layout (PangoContext);
@@ -132,20 +142,6 @@ namespace MonoDevelop.Components.MainToolbar
Events = Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonMotionMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.ExposureMask | Gdk.EventMask.PointerMotionMask;
ItemActivated += (sender, e) => OpenFile ();
- /*
- SizeRequested += delegate(object o, SizeRequestedArgs args) {
- if (inResize)
- return;
- if (args.Requisition.Width != Allocation.Width || args.Requisition.Height != Allocation.Height) {
- inResize = true;
-// Visible = false;
- Resize (args.Requisition.Width, args.Requisition.Height);
-// Visible = true;
- if (!Visible)
- Visible = true;
- inResize = false;
- }
- };*/
}
bool inResize = false;
@@ -161,33 +157,41 @@ namespace MonoDevelop.Components.MainToolbar
src.Cancel ();
HideTooltip ();
this.declarationviewwindow.Destroy ();
+ selectedItem = topItem = null;
+ currentTooltip = null;
base.OnDestroyed ();
}
- internal void OpenFile ()
+ internal async void OpenFile ()
{
- if (selectedItem == null || selectedItem.Item < 0 || selectedItem.Item >= selectedItem.DataSource.ItemCount)
+ if (selectedItem == null || selectedItem.Item < 0 || selectedItem.Item >= selectedItem.DataSource.Count)
return;
- if (selectedItem.DataSource.CanActivate (selectedItem.Item)) {
+ if (selectedItem.DataSource[selectedItem.Item].CanActivate) {
+ selectedItem.DataSource[selectedItem.Item].Activate ();
Destroy ();
- selectedItem.DataSource.Activate (selectedItem.Item);
}
else {
var region = SelectedItemRegion;
- Destroy ();
-
- if (string.IsNullOrEmpty (region.FileName))
+ if (string.IsNullOrEmpty (SelectedItemFileName)) {
+ Destroy ();
return;
- if (region.Begin.IsEmpty) {
+ }
+
+ if (region.Length <= 0) {
if (Pattern.LineNumber == 0) {
- IdeApp.Workbench.OpenDocument (region.FileName);
+ await IdeApp.Workbench.OpenDocument (SelectedItemFileName, project: null);
} else {
- IdeApp.Workbench.OpenDocument (region.FileName, Pattern.LineNumber, Pattern.HasColumn ? Pattern.Column : 1);
+ await IdeApp.Workbench.OpenDocument (SelectedItemFileName, null, Pattern.LineNumber, Pattern.HasColumn ? Pattern.Column : 1);
}
} else {
- IdeApp.Workbench.OpenDocument (region.FileName, region.BeginLine, region.BeginColumn);
+ await IdeApp.Workbench.OpenDocument (new FileOpenInformation (SelectedItemFileName, null) {
+ Offset = region.Offset
+ });
}
+ Destroy ();
+
+
}
}
SearchPopupSearchPattern pattern;
@@ -197,6 +201,60 @@ namespace MonoDevelop.Components.MainToolbar
return pattern;
}
}
+ static readonly SearchCategory.DataItemComparer cmp = new SearchCategory.DataItemComparer ();
+
+ class SearchResultCollector : ISearchResultCallback
+ {
+ List<SearchResult> searchResults = new List<SearchResult> (maxItems);
+
+ public IReadOnlyList<SearchResult> Results {
+ get {
+ return searchResults;
+ }
+ }
+
+ public SearchCategory Category { get; private set;}
+
+ public SearchResultCollector (SearchCategory cat)
+ {
+ this.Category = cat;
+ }
+
+ public Task Task { get; set; }
+
+ #region ISearchResultCallback implementation
+ void ISearchResultCallback.ReportResult (SearchResult result)
+ {
+ if (maxItems == searchResults.Count) {
+ int i = searchResults.Count;
+ while (i > 0) {
+ if (cmp.Compare (result, searchResults [i - 1]) > 0)
+ break;
+ i--;
+ }
+ if (i == maxItems) {
+ return;//this means it's worse then current worst
+ } else {
+ if (!result.IsValid)
+ return;
+ searchResults.RemoveAt (maxItems - 1);
+ searchResults.Insert (i, result);
+ }
+ } else {
+ if (!result.IsValid)
+ return;
+ int i = searchResults.Count;
+ while (i > 0) {
+ if (cmp.Compare (result, searchResults [i - 1]) > 0)
+ break;
+ i--;
+ }
+ searchResults.Insert (i, result);
+ }
+ }
+
+ #endregion
+ }
public void Update (SearchPopupSearchPattern pattern)
{
@@ -209,63 +267,71 @@ namespace MonoDevelop.Components.MainToolbar
this.pattern = pattern;
if (src != null)
src.Cancel ();
-
HideTooltip ();
src = new CancellationTokenSource ();
isInSearch = true;
if (results.Count == 0) {
QueueDraw ();
}
- incompleteResults.Clear ();
+ var collectors = new List<SearchResultCollector> ();
+ var token = src.Token;
foreach (var _cat in categories) {
var cat = _cat;
- var token = src.Token;
- cat.GetResults (pattern, maxItems, token).ContinueWith (t => {
- if (t.IsCanceled)
+ if (!string.IsNullOrEmpty (pattern.Tag) && !cat.IsValidTag (pattern.Tag))
+ continue;
+ var col = new SearchResultCollector (_cat);
+ collectors.Add (col);
+ col.Task = cat.GetResults (col, pattern, token);
+ }
+
+ Task.WhenAll (collectors.Select (c => c.Task)).ContinueWith (t => {
+ Application.Invoke (delegate {
+ if (token.IsCancellationRequested)
return;
- if (t.IsFaulted) {
- LoggingService.LogError ("Error getting search results", t.Exception);
- } else {
- Application.Invoke (delegate {
- ShowResult (cat, t.Result ?? new NullDataSource ());
- });
+ var newResults = new List<Tuple<SearchCategory, IReadOnlyList<SearchResult>>> (collectors.Count);
+ foreach (var col in collectors) {
+ if (col.Task.IsCanceled) {
+ continue;
+ } else if (col.Task.IsFaulted) {
+ LoggingService.LogError ($"Error getting search results for {col.Category}", col.Task.Exception);
+ } else {
+ newResults.Add (Tuple.Create (col.Category, col.Results));
+ }
}
- }, token);
- }
+ ShowResults (newResults);
+ isInSearch = false;
+ AnimatedResize ();
+ });
+ }, token);
}
- void ShowResult (SearchCategory cat, ISearchDataSource result)
+ void ShowResults (List<Tuple<SearchCategory, IReadOnlyList<SearchResult>>> newResults)
{
- incompleteResults.Add (Tuple.Create (cat, result));
+ results = newResults;
+ List<Tuple<SearchCategory, IReadOnlyList<SearchResult>>> failedResults = null;
+ topItem = null;
- incompleteResults.Sort ((x, y) => {
- return categories.IndexOf (x.Item1).CompareTo (categories.IndexOf (y.Item1));
- }
- );
-
- if (incompleteResults.Count == categories.Count) {
- results.Clear ();
- results.AddRange (incompleteResults);
- topItem = null;
-
- for (int i = 0; i < results.Count; i++) {
- var tuple = results [i];
- try {
- if (tuple.Item2.ItemCount == 0)
- continue;
- if (topItem == null || topItem.DataSource.GetWeight (topItem.Item) < tuple.Item2.GetWeight (0))
- topItem = new ItemIdentifier(tuple.Item1, tuple.Item2, 0);
- } catch (Exception e) {
- LoggingService.LogError ("Error while showing result " + i, e);
+ for (int i = 0; i < results.Count; i++) {
+ var tuple = results [i];
+ try {
+ if (tuple.Item2.Count == 0)
continue;
- }
+ if (topItem == null || topItem.DataSource [topItem.Item].Weight < tuple.Item2 [0].Weight)
+ topItem = new ItemIdentifier (tuple.Item1, tuple.Item2, 0);
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while showing result " + i, e);
+ if (failedResults == null)
+ failedResults = new List<Tuple<SearchCategory, IReadOnlyList<SearchResult>>> ();
+ failedResults.Add (results [i]);
+ continue;
}
- selectedItem = topItem;
-
- ShowTooltip ();
- isInSearch = false;
- AnimatedResize ();
}
+ selectedItem = topItem;
+
+ if (failedResults != null)
+ failedResults.ForEach (failedResult => results.Remove (failedResult));
+
+ ShowTooltip ();
}
int calculatedItems;
@@ -274,32 +340,32 @@ namespace MonoDevelop.Components.MainToolbar
Gdk.Size retVal = new Gdk.Size ();
int ox, oy;
GetPosition (out ox, out oy);
- Gdk.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtPoint (ox, oy));
- var maxHeight = geometry.Height * 4 / 5;
+ Xwt.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen.Number, Screen.GetMonitorAtPoint (ox, oy));
+ int maxHeight = (int)geometry.Height * 4 / 5;
double startY = yMargin + ChildAllocation.Y;
double y = startY;
calculatedItems = 0;
foreach (var result in results) {
var dataSrc = result.Item2;
- if (dataSrc.ItemCount == 0)
+ if (dataSrc.Count == 0)
continue;
- for (int i = 0; i < maxItems && i < dataSrc.ItemCount; i++) {
- layout.SetMarkup (GetRowMarkup (dataSrc, i));
+ for (int i = 0; i < maxItems && i < dataSrc.Count; i++) {
+ layout.SetMarkup (GetRowMarkup (dataSrc[i]));
int w, h;
layout.GetPixelSize (out w, out h);
- if (y + h + itemSeparatorHeight > maxHeight)
+ if (y + h + itemSeparatorHeight + itemPadding * 2 > maxHeight)
break;
- y += h + itemSeparatorHeight;
+ y += h + itemSeparatorHeight + itemPadding * 2;
calculatedItems++;
}
}
- retVal.Width = Math.Min (geometry.Width * 4 / 5, 480);
+ retVal.Width = Math.Min ((int)geometry.Width * 4 / 5, 480);
if (Math.Abs (y - startY) < 1) {
layout.SetMarkup (GettextCatalog.GetString ("No matches"));
int w, h;
layout.GetPixelSize (out w, out h);
- var realHeight = h + itemSeparatorHeight + 4;
+ var realHeight = h + itemSeparatorHeight + 4 + itemPadding * 2;
y += realHeight;
} else {
y -= itemSeparatorHeight;
@@ -307,7 +373,7 @@ namespace MonoDevelop.Components.MainToolbar
var calculatedHeight = Math.Min (
maxHeight,
- (int)y + yMargin + results.Count (res => res.Item2.ItemCount > 0) * categorySeparatorHeight
+ (int)y + yMargin + results.Count (res => res.Item2.Count > 0) * categorySeparatorHeight
);
retVal.Height = calculatedHeight;
return retVal;
@@ -329,10 +395,10 @@ namespace MonoDevelop.Components.MainToolbar
{
double y = ChildAllocation.Y + yMargin;
if (topItem != null){
- layout.SetMarkup (GetRowMarkup (topItem.DataSource, topItem.Item));
+ layout.SetMarkup (GetRowMarkup (topItem.DataSource[topItem.Item]));
int w, h;
layout.GetPixelSize (out w, out h);
- y += h + itemSeparatorHeight;
+ y += h + itemSeparatorHeight + itemPadding * 2;
if (y > py)
return new ItemIdentifier (topItem.Category, topItem.DataSource, topItem.Item);
}
@@ -340,25 +406,25 @@ namespace MonoDevelop.Components.MainToolbar
var category = result.Item1;
var dataSrc = result.Item2;
int itemsAdded = 0;
- for (int i = 0; i < maxItems && i < dataSrc.ItemCount; i++) {
+ for (int i = 0; i < maxItems && i < dataSrc.Count; i++) {
if (topItem != null && topItem.DataSource == dataSrc && topItem.Item == i)
continue;
- layout.SetMarkup (GetRowMarkup (dataSrc, i));
+ layout.SetMarkup (GetRowMarkup (dataSrc[i]));
int w, h;
layout.GetPixelSize (out w, out h);
- y += h + itemSeparatorHeight;
+ y += h + itemSeparatorHeight + itemPadding * 2;
if (y > py){
return new ItemIdentifier (category, dataSrc, i);
}
- var region = dataSrc.GetRegion (i);
- if (!region.Begin.IsEmpty) {
- layout.SetMarkup (region.BeginLine.ToString ());
- int w2, h2;
- layout.GetPixelSize (out w2, out h2);
- w += w2;
- }
+// var region = dataSrc.GetRegion (i);
+// if (!region.IsEmpty) {
+// layout.SetMarkup (region.BeginLine.ToString ());
+// int w2, h2;
+// layout.GetPixelSize (out w2, out h2);
+// w += w2;
+// }
itemsAdded++;
}
if (itemsAdded > 0)
@@ -420,20 +486,20 @@ namespace MonoDevelop.Components.MainToolbar
selectedItem = new ItemIdentifier (
results [i].Item1,
results [i].Item2,
- Math.Min (maxItems, results [i].Item2.ItemCount) - 1
+ Math.Min (maxItems, results [i].Item2.Count) - 1
);
if (selectedItem.Category == topItem.Category && selectedItem.Item == topItem.Item && i > 0) {
i--;
selectedItem = new ItemIdentifier (
results [i].Item1,
results [i].Item2,
- Math.Min (maxItems, results [i].Item2.ItemCount) - 1
+ Math.Min (maxItems, results [i].Item2.Count) - 1
);
}
- } while (i > 0 && selectedItem.DataSource.ItemCount <= 0);
+ } while (i > 0 && selectedItem.DataSource.Count <= 0);
- if (selectedItem.DataSource.ItemCount <= 0) {
+ if (selectedItem.DataSource.Count <= 0) {
selectedItem = topItem;
}
}
@@ -449,7 +515,7 @@ namespace MonoDevelop.Components.MainToolbar
if (selectedItem.Equals (topItem)) {
for (int j = 0; j < results.Count; j++) {
- if (results[j].Item2.ItemCount == 0 || results[j].Item2.ItemCount == 1 && topItem.DataSource == results[j].Item2)
+ if (results[j].Item2.Count == 0 || results[j].Item2.Count == 1 && topItem.DataSource == results[j].Item2)
continue;
selectedItem = new ItemIdentifier (
results [j].Item1,
@@ -471,21 +537,21 @@ namespace MonoDevelop.Components.MainToolbar
if (selectedItem != null) {
var curAbsoluteIndex = selectedItem == topItem ? 1 : 0;
for (int j = 0; j < i; j++) {
- curAbsoluteIndex += Math.Min (maxItems, results [j].Item2.ItemCount);
+ curAbsoluteIndex += Math.Min (maxItems, results [j].Item2.Count);
}
curAbsoluteIndex += selectedItem.Item + 1;
if (curAbsoluteIndex + 1 > calculatedItems)
return;
}
- var upperBound = Math.Min (maxItems, selectedItem.DataSource.ItemCount);
+ var upperBound = Math.Min (maxItems, selectedItem.DataSource.Count);
if (selectedItem.Item + 1 < upperBound) {
if (topItem.DataSource == selectedItem.DataSource && selectedItem.Item == upperBound - 1)
return;
selectedItem = new ItemIdentifier (selectedItem.Category, selectedItem.DataSource, selectedItem.Item + 1);
} else {
for (int j = i + 1; j < results.Count; j++) {
- if (results[j].Item2.ItemCount == 0 || results[j].Item2.ItemCount == 1 && topItem.DataSource == results[j].Item2)
+ if (results[j].Item2.Count == 0 || results[j].Item2.Count == 1 && topItem.DataSource == results[j].Item2)
continue;
selectedItem = new ItemIdentifier (
results [j].Item1,
@@ -508,39 +574,27 @@ namespace MonoDevelop.Components.MainToolbar
}
TooltipInformationWindow declarationviewwindow = new TooltipInformationWindow ();
- uint declarationViewTimer, declarationViewWindowOpacityTimer;
- void RemoveDeclarationViewTimer ()
- {
- if (declarationViewWindowOpacityTimer != 0) {
- GLib.Source.Remove (declarationViewWindowOpacityTimer);
- declarationViewWindowOpacityTimer = 0;
- }
- if (declarationViewTimer != 0) {
- GLib.Source.Remove (declarationViewTimer);
- declarationViewTimer = 0;
- }
- }
+ TooltipInformation currentTooltip;
void HideTooltip ()
{
- RemoveDeclarationViewTimer ();
if (declarationviewwindow != null) {
declarationviewwindow.Hide ();
- declarationviewwindow.Opacity = 0;
}
if (tooltipSrc != null)
tooltipSrc.Cancel ();
}
CancellationTokenSource tooltipSrc = null;
- void ShowTooltip ()
+ async void ShowTooltip ()
{
- HideTooltip ();
var currentSelectedItem = selectedItem;
- if (currentSelectedItem == null || currentSelectedItem.DataSource == null)
+ if (currentSelectedItem == null || currentSelectedItem.DataSource == null) {
+ HideTooltip ();
return;
+ }
var i = currentSelectedItem.Item;
- if (i < 0 || i >= currentSelectedItem.DataSource.ItemCount)
+ if (i < 0 || i >= currentSelectedItem.DataSource.Count)
return;
if (tooltipSrc != null)
@@ -548,69 +602,29 @@ namespace MonoDevelop.Components.MainToolbar
tooltipSrc = new CancellationTokenSource ();
var token = tooltipSrc.Token;
- ThreadPool.QueueUserWorkItem (delegate {
- TooltipInformation tooltip;
- try {
- tooltip = currentSelectedItem.DataSource.GetTooltip (i);
- } catch (Exception e) {
- LoggingService.LogError ("Error while creating search popup window tooltip", e);
- return;
- }
- if (tooltip == null || string.IsNullOrEmpty (tooltip.SignatureMarkup) || token.IsCancellationRequested)
- return;
- Application.Invoke (delegate {
- if (token.IsCancellationRequested)
- return;
- declarationviewwindow.Clear ();
- declarationviewwindow.AddOverload (tooltip);
- declarationviewwindow.CurrentOverload = 0;
- declarationViewTimer = GLib.Timeout.Add (250, DelayedTooltipShow);
- });
- });
-
- }
-
- bool DelayedTooltipShow ()
- {
- declarationviewwindow.ShowArrow = true;
- var rect = SelectedItemRectangle;
-
- declarationviewwindow.ShowPopup (this, new Gdk.Rectangle (0, (int)rect.Y, Allocation.Width, (int)rect.Height), PopupPosition.Right);
- if (declarationViewWindowOpacityTimer != 0)
- GLib.Source.Remove (declarationViewWindowOpacityTimer);
- declarationViewWindowOpacityTimer = GLib.Timeout.Add (50, new OpacityTimer (this).Timer);
- declarationViewTimer = 0;
- return false;
- }
-
- class OpacityTimer
- {
- public double Opacity { get; private set; }
-
- SearchPopupWindow window;
- // static int num = 0;
- // int id;
- public OpacityTimer (SearchPopupWindow window)
- {
- // id = num++;
- this.window = window;
- Opacity = 0.0;
- window.declarationviewwindow.Opacity = Opacity;
+ try {
+ currentTooltip = await currentSelectedItem.DataSource [i].GetTooltipInformation (token);
+ } catch (OperationCanceledException) {
+ HideTooltip ();
+ return;
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while creating search popup window tooltip", e);
+ HideTooltip ();
+ return;
}
-
- public bool Timer ()
- {
- Opacity = System.Math.Min (1.0, Opacity + 0.33);
- window.declarationviewwindow.Opacity = Opacity;
- bool result = Math.Round (Opacity * 10.0) < 10;
- if (!result)
- window.declarationViewWindowOpacityTimer = 0;
- return result;
+ if (currentTooltip == null || string.IsNullOrEmpty (currentTooltip.SignatureMarkup) || token.IsCancellationRequested) {
+ HideTooltip ();
+ return;
}
+
+ declarationviewwindow.Clear ();
+ declarationviewwindow.AddOverload (currentTooltip);
+ declarationviewwindow.CurrentOverload = 0;
+ declarationviewwindow.ShowArrow = true;
+ var rect = SelectedItemRectangle;
+ declarationviewwindow.ShowPopup (this, new Gdk.Rectangle (0, (int)rect.Y - 5, Allocation.Width, (int)rect.Height), PopupPosition.Right);
}
-
-
void SelectNextCategory ()
{
if (selectedItem == null)
@@ -625,7 +639,7 @@ namespace MonoDevelop.Components.MainToolbar
);
} else {
- if (topItem.DataSource.ItemCount > 1) {
+ if (topItem.DataSource.Count > 1) {
selectedItem = new ItemIdentifier (
results [0].Item1,
results [0].Item2,
@@ -640,7 +654,7 @@ namespace MonoDevelop.Components.MainToolbar
}
}
} else {
- while (i < results.Count - 1 && results [i + 1].Item2.ItemCount == 0)
+ while (i < results.Count - 1 && results [i + 1].Item2.Count == 0)
i++;
if (i < results.Count - 1) {
selectedItem = new ItemIdentifier (
@@ -650,6 +664,7 @@ namespace MonoDevelop.Components.MainToolbar
);
}
}
+ ShowTooltip ();
QueueDraw ();
}
@@ -665,7 +680,7 @@ namespace MonoDevelop.Components.MainToolbar
0
);
if (selectedItem.Equals (topItem)) {
- if (topItem.DataSource.ItemCount > 1) {
+ if (topItem.DataSource.Count> 1) {
selectedItem = new ItemIdentifier (
results [i - 1].Item1,
results [i - 1].Item2,
@@ -682,25 +697,28 @@ namespace MonoDevelop.Components.MainToolbar
} else {
selectedItem = topItem;
}
+ ShowTooltip ();
QueueDraw ();
}
void SelectFirstCategory ()
{
selectedItem = topItem;
+ ShowTooltip ();
QueueDraw ();
}
void SelectLastCatgory ()
{
- var r = results.LastOrDefault (r2 => r2.Item2.ItemCount > 0 && !(r2.Item2.ItemCount == 1 && topItem.Category == r2.Item1));
+ var r = results.LastOrDefault (r2 => r2.Item2.Count > 0 && !(r2.Item2.Count == 1 && topItem.Category == r2.Item1));
if (r == null)
return;
selectedItem = new ItemIdentifier (
r.Item1,
r.Item2,
- r.Item2.ItemCount - 1
+ r.Item2.Count - 1
);
+ ShowTooltip ();
QueueDraw ();
}
@@ -711,15 +729,17 @@ namespace MonoDevelop.Components.MainToolbar
if (state.HasFlag (Xwt.ModifierKeys.Command))
goto case Xwt.Key.PageUp;
if (state.HasFlag (Xwt.ModifierKeys.Control))
- goto case Xwt.Key.Home;
- SelectItemUp ();
+ SelectFirstCategory ();
+ else
+ SelectItemUp ();
return true;
case Xwt.Key.Down:
if (state.HasFlag (Xwt.ModifierKeys.Command))
goto case Xwt.Key.PageDown;
if (state.HasFlag (Xwt.ModifierKeys.Control))
- goto case Xwt.Key.End;
- SelectItemDown ();
+ SelectLastCatgory ();
+ else
+ SelectItemDown ();
return true;
case (Xwt.Key)Gdk.Key.KP_Page_Down:
case Xwt.Key.PageDown:
@@ -729,12 +749,6 @@ namespace MonoDevelop.Components.MainToolbar
case Xwt.Key.PageUp:
SelectPrevCategory ();
return true;
- case Xwt.Key.Home:
- SelectFirstCategory ();
- return true;
- case Xwt.Key.End:
- SelectLastCatgory ();
- return true;
case Xwt.Key.Return:
OnItemActivated (EventArgs.Empty);
return true;
@@ -751,20 +765,28 @@ namespace MonoDevelop.Components.MainToolbar
handler (this, e);
}
- public DomRegion SelectedItemRegion {
+ public ISegment SelectedItemRegion {
get {
- if (selectedItem == null || selectedItem.Item < 0 || selectedItem.Item >= selectedItem.DataSource.ItemCount)
- return DomRegion.Empty;
- return selectedItem.DataSource.GetRegion (selectedItem.Item);
+ if (selectedItem == null || selectedItem.Item < 0 || selectedItem.Item >= selectedItem.DataSource.Count)
+ return TextSegment.Invalid;
+ return selectedItem.DataSource[selectedItem.Item].Segment;
+ }
+ }
+
+ public string SelectedItemFileName {
+ get {
+ if (selectedItem == null || selectedItem.Item < 0 || selectedItem.Item >= selectedItem.DataSource.Count)
+ return null;
+ return selectedItem.DataSource[selectedItem.Item].File;
}
}
class ItemIdentifier {
public SearchCategory Category { get; private set; }
- public ISearchDataSource DataSource { get; private set; }
+ public IReadOnlyList<SearchResult> DataSource { get; private set; }
public int Item { get; private set; }
- public ItemIdentifier (SearchCategory category, ISearchDataSource dataSource, int item)
+ public ItemIdentifier (SearchCategory category, IReadOnlyList<SearchResult> dataSource, int item)
{
this.Category = category;
this.DataSource = dataSource;
@@ -792,7 +814,7 @@ namespace MonoDevelop.Components.MainToolbar
public override string ToString ()
{
- return string.Format ("[ItemIdentifier: Category={0}, DataSource=#{1}, Item={2}]", Category.Name, DataSource.ItemCount, Item);
+ return string.Format ("[ItemIdentifier: Category={0}, DataSource=#{1}, Item={2}]", Category.Name, DataSource.Count, Item);
}
}
@@ -805,36 +827,36 @@ namespace MonoDevelop.Components.MainToolbar
double y = ChildAllocation.Y + yMargin;
if (topItem != null){
- layout.SetMarkup (GetRowMarkup (topItem.DataSource, topItem.Item));
+ layout.SetMarkup (GetRowMarkup (topItem.DataSource[topItem.Item]));
int w, h;
layout.GetPixelSize (out w, out h);
if (topItem.Category == selectedItem.Category && topItem.Item == selectedItem.Item)
- return new Cairo.Rectangle (0, y, Allocation.Width, h + itemSeparatorHeight);
- y += h + itemSeparatorHeight;
+ return new Cairo.Rectangle (0, y, Allocation.Width, h + itemSeparatorHeight + itemPadding * 2);
+ y += h + itemSeparatorHeight + itemPadding * 2;
}
foreach (var result in results) {
var category = result.Item1;
var dataSrc = result.Item2;
int itemsAdded = 0;
- for (int i = 0; i < maxItems && i < dataSrc.ItemCount; i++) {
+ for (int i = 0; i < maxItems && i < dataSrc.Count; i++) {
if (topItem != null && topItem.DataSource == dataSrc && topItem.Item == i)
continue;
- layout.SetMarkup (GetRowMarkup (dataSrc, i));
+ layout.SetMarkup (GetRowMarkup (dataSrc[i]));
int w, h;
layout.GetPixelSize (out w, out h);
if (selectedItem.Category == category && selectedItem.DataSource == dataSrc && selectedItem.Item == i)
- return new Cairo.Rectangle (0, y, Allocation.Width, h + itemSeparatorHeight);
- y += h + itemSeparatorHeight;
-
- var region = dataSrc.GetRegion (i);
- if (!region.Begin.IsEmpty) {
- layout.SetMarkup (region.BeginLine.ToString ());
- int w2, h2;
- layout.GetPixelSize (out w2, out h2);
- w += w2;
- }
+ return new Cairo.Rectangle (0, y, Allocation.Width, h + itemSeparatorHeight + itemPadding * 2);
+ y += h + itemSeparatorHeight + itemPadding * 2;
+
+// var region = dataSrc.GetRegion (i);
+// if (!region.IsEmpty) {
+// layout.SetMarkup (region.BeginLine.ToString ());
+// int w2, h2;
+// layout.GetPixelSize (out w2, out h2);
+// w += w2;
+// }
itemsAdded++;
}
if (itemsAdded > 0)
@@ -850,7 +872,7 @@ namespace MonoDevelop.Components.MainToolbar
var alloc = ChildAllocation;
var adjustedMarginSize = alloc.X - Allocation.X + headerMarginSize;
- var r = results.Where (res => res.Item2.ItemCount > 0).ToArray ();
+ var r = results.Where (res => res.Item2.Count > 0).ToArray ();
if (r.Any ()) {
context.SetSourceColor (lightSearchBackground);
context.Rectangle (Allocation.X, Allocation.Y, adjustedMarginSize, Allocation.Height);
@@ -864,7 +886,7 @@ namespace MonoDevelop.Components.MainToolbar
context.SetSourceColor (separatorLine);
context.Stroke ();
} else {
- context.SetSourceRGB (1, 1, 1);
+ context.SetSourceColor (darkSearchBackground);
context.Rectangle (Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height);
context.Fill ();
}
@@ -874,104 +896,112 @@ namespace MonoDevelop.Components.MainToolbar
if (topItem != null) {
headerLayout.SetText (GettextCatalog.GetString ("Top Result"));
headerLayout.GetPixelSize (out w, out h);
- context.MoveTo (alloc.Left + headerMarginSize - w - xMargin, y);
+ context.MoveTo (alloc.Left + headerMarginSize - w - xMargin, y + itemPadding);
context.SetSourceColor (headerColor);
Pango.CairoHelper.ShowLayout (context, headerLayout);
var category = topItem.Category;
var dataSrc = topItem.DataSource;
var i = topItem.Item;
+ var isSelected = selectedItem != null && selectedItem.Category == category && selectedItem.Item == i;
double x = alloc.X + xMargin + headerMarginSize;
context.SetSourceRGB (0, 0, 0);
- layout.SetMarkup (GetRowMarkup (dataSrc, i));
+ layout.SetMarkup (GetRowMarkup (dataSrc[i], isSelected));
layout.GetPixelSize (out w, out h);
- if (selectedItem != null && selectedItem.Category == category && selectedItem.Item == i) {
+ if (isSelected) {
context.SetSourceColor (selectionBackgroundColor);
- context.Rectangle (alloc.X + headerMarginSize, y, Allocation.Width - adjustedMarginSize, h);
+ context.Rectangle (alloc.X + headerMarginSize + 1, y, Allocation.Width - adjustedMarginSize - 1, h + itemPadding * 2);
context.Fill ();
context.SetSourceRGB (1, 1, 1);
}
- var px = dataSrc.GetIcon (i);
+ var px = dataSrc[i].Icon;
if (px != null) {
- context.DrawImage (this, px, (int)x + marginIconSpacing, (int)y + (h - px.Height) / 2);
+ if (isSelected)
+ px = px.WithStyles ("sel");
+ context.DrawImage (this, px, (int)x + marginIconSpacing, (int)(y + itemPadding));
x += px.Width + iconTextSpacing + marginIconSpacing;
}
- context.MoveTo (x, y);
+ context.MoveTo (x, y + itemPadding);
context.SetSourceRGB (0, 0, 0);
Pango.CairoHelper.ShowLayout (context, layout);
- y += h + itemSeparatorHeight;
+ y += h + itemSeparatorHeight + itemPadding * 2;
}
foreach (var result in r) {
var category = result.Item1;
var dataSrc = result.Item2;
- if (dataSrc.ItemCount == 0)
+ if (dataSrc.Count == 0)
continue;
- if (dataSrc.ItemCount == 1 && topItem != null && topItem.DataSource == dataSrc)
+ if (dataSrc.Count == 1 && topItem != null && topItem.DataSource == dataSrc)
continue;
headerLayout.SetText (category.Name);
headerLayout.GetPixelSize (out w, out h);
- if (y + h > Allocation.Height)
+ if (y + h + itemPadding * 2 > Allocation.Height)
break;
- context.MoveTo (alloc.X + headerMarginSize - w - xMargin, y);
+ context.MoveTo (alloc.X + headerMarginSize - w - xMargin, y + itemPadding);
context.SetSourceColor (headerColor);
Pango.CairoHelper.ShowLayout (context, headerLayout);
layout.Width = Pango.Units.FromPixels (Allocation.Width - adjustedMarginSize - 35);
- for (int i = 0; i < maxItems && i < dataSrc.ItemCount; i++) {
+ for (int i = 0; i < maxItems && i < dataSrc.Count; i++) {
if (topItem != null && topItem.Category == category && topItem.Item == i)
continue;
+ var isSelected = selectedItem != null && selectedItem.Category == category && selectedItem.Item == i;
double x = alloc.X + xMargin + headerMarginSize;
context.SetSourceRGB (0, 0, 0);
- layout.SetMarkup (GetRowMarkup (dataSrc, i));
+ layout.SetMarkup (GetRowMarkup (dataSrc[i], isSelected));
layout.GetPixelSize (out w, out h);
- if (y + h + itemSeparatorHeight > Allocation.Height)
+ if (y + h + itemSeparatorHeight + itemPadding * 2 > Allocation.Height)
break;
- if (selectedItem != null && selectedItem.Category == category && selectedItem.Item == i) {
+ if (isSelected) {
context.SetSourceColor (selectionBackgroundColor);
- context.Rectangle (alloc.X + headerMarginSize, y, Allocation.Width - adjustedMarginSize, h);
+ context.Rectangle (alloc.X + headerMarginSize + 1, y, Allocation.Width - adjustedMarginSize - 1, h + itemPadding * 2);
context.Fill ();
context.SetSourceRGB (1, 1, 1);
}
- var px = dataSrc.GetIcon (i);
+ var px = dataSrc[i].Icon;
if (px != null) {
- context.DrawImage (this, px, (int)x + marginIconSpacing, (int)y + (h - px.Height) / 2);
+ if (isSelected)
+ px = px.WithStyles ("sel");
+ context.DrawImage (this, px, (int)x + marginIconSpacing, (int)(y + itemPadding));
x += px.Width + iconTextSpacing + marginIconSpacing;
}
- context.MoveTo (x, y);
+ context.MoveTo (x, y + itemPadding);
context.SetSourceRGB (0, 0, 0);
Pango.CairoHelper.ShowLayout (context, layout);
- y += h + itemSeparatorHeight;
+ y += h + itemSeparatorHeight + itemPadding * 2;
}
if (result != r.Last ()) {
y += categorySeparatorHeight;
}
}
if (y == alloc.Y + yMargin) {
- context.SetSourceRGB (0, 0, 0);
+ context.SetSourceColor (Styles.GlobalSearch.ResultTextColor.ToCairoColor ());
layout.SetMarkup (isInSearch ? GettextCatalog.GetString ("Searching...") : GettextCatalog.GetString ("No matches"));
context.MoveTo (alloc.X + xMargin, y);
Pango.CairoHelper.ShowLayout (context, layout);
}
}
- string GetRowMarkup (ISearchDataSource dataSrc, int i)
+ string GetRowMarkup (SearchResult result, bool selected = false)
{
- string txt = "<span foreground=\"#606060\">" + dataSrc.GetMarkup (i, false) +"</span>";
- string desc = dataSrc.GetDescriptionMarkup (i, false);
+ var resultFgColor = selected ? Styles.GlobalSearch.SelectedResultTextColor : Styles.GlobalSearch.ResultTextColor;
+ var descFgColor = selected ? Styles.GlobalSearch.SelectedResultDescriptionTextColor : Styles.GlobalSearch.ResultDescriptionTextColor;
+ string txt = "<span foreground=\"" + Styles.ColorGetHex (resultFgColor) + "\">" + result.GetMarkupText(selected) +"</span>";
+ string desc = result.GetDescriptionMarkupText ();
if (!string.IsNullOrEmpty (desc))
- txt += "<span foreground=\"#8F8F8F\" size=\"small\">\n" + desc + "</span>";
+ txt += "<span foreground=\"" + Styles.ColorGetHex (descFgColor) + "\" size=\"small\">\n" + desc + "</span>";
return txt;
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchResult.cs
index 4d67e179ff..fdab266827 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchResult.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchResult.cs
@@ -31,52 +31,67 @@ using Gtk;
using MonoDevelop.Core;
using MonoDevelop.Core.Text;
using MonoDevelop.Projects;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Ide;
+using Microsoft.CodeAnalysis;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using MonoDevelop.Ide.Gui;
namespace MonoDevelop.Components.MainToolbar
{
public enum SearchResultType
{
+ Unknown,
File,
Type,
Member,
Command
}
- abstract class SearchResult
+ public abstract class SearchResult
{
protected string match;
- public virtual string GetMarkupText (Widget widget)
+ public virtual string GetMarkupText (bool selected)
{
- return HighlightMatch (widget, PlainText, match);
+ return HighlightMatch (PlainText, match, selected);
}
- public virtual string GetDescriptionMarkupText (Widget widget)
+ public virtual string GetDescriptionMarkupText ()
{
- return AmbienceService.EscapeText (Description);
+ return Ambience.EscapeText (Description);
}
- public abstract SearchResultType SearchResultType { get; }
- public abstract string PlainText { get; }
+ public virtual SearchResultType SearchResultType { get { return SearchResultType.Unknown; } }
+ public virtual string PlainText { get { return null; } }
public int Rank { get; private set; }
- public virtual int Row { get { return -1; } }
- public virtual int Column { get { return -1; } }
+ public double Weight {
+ get;
+ set;
+ }
+
+ public virtual int Offset { get { return -1; } }
+ public virtual int Length { get { return -1; } }
- public abstract string File { get; }
- public abstract Xwt.Drawing.Image Icon { get; }
+ public virtual string File { get { return null;} }
+ public virtual Xwt.Drawing.Image Icon { get { return null; } }
- public abstract string Description { get; }
+ public virtual string Description { get { return null;} }
public string MatchedString { get; private set;}
- public abstract TooltipInformation TooltipInformation { get; }
+ public ISegment Segment { get { return new TextSegment (Offset, Length); } }
+
+ public virtual Task<TooltipInformation> GetTooltipInformation (CancellationToken token)
+ {
+ return TaskUtil.Default<TooltipInformation> ();
+ }
public SearchResult (string match, string matchedString, int rank)
{
@@ -85,7 +100,7 @@ namespace MonoDevelop.Components.MainToolbar
Rank = rank;
}
- protected static string HighlightMatch (Widget widget, string text, string toMatch)
+ protected static string HighlightMatch (string text, string toMatch, bool selected)
{
var lane = StringMatcher.GetMatcher (toMatch, true).GetMatch (text);
StringBuilder result = new StringBuilder ();
@@ -95,7 +110,8 @@ namespace MonoDevelop.Components.MainToolbar
int pos = lane[n];
if (pos - lastPos > 0)
MarkupUtilities.AppendEscapedString (result, text.Substring (lastPos, pos - lastPos));
- result.Append ("<span foreground=\"#4d4d4d\" font_weight=\"bold\">");
+ var matchColor = selected ? Styles.GlobalSearch.SelectedResultMatchTextColor : Styles.GlobalSearch.ResultMatchTextColor;
+ result.Append ("<span foreground=\"" + Styles.ColorGetHex (matchColor) + "\" font_weight=\"bold\">");
MarkupUtilities.AppendEscapedString (result, text[pos].ToString ());
result.Append ("</span>");
lastPos = pos + 1;
@@ -115,145 +131,50 @@ namespace MonoDevelop.Components.MainToolbar
public virtual void Activate ()
{
}
- }
-
- class TypeSearchResult : MemberSearchResult
- {
- ITypeDefinition type;
-
- public override SearchResultType SearchResultType { get { return SearchResultType.Type; } }
- public override string File {
- get { return type.Region.FileName; }
- }
-
- public override Xwt.Drawing.Image Icon {
- get {
- return ImageService.GetIcon (type.GetStockIcon (false), IconSize.Menu);
- }
- }
-
- public override int Row {
- get { return type.Region.BeginLine; }
- }
-
- public override int Column {
- get { return type.Region.BeginColumn; }
- }
-
- public static string GetPlainText (ITypeDefinition type, bool useFullName)
- {
- if (type.TypeParameterCount == 0)
- return useFullName ? type.FullName : type.Name;
- StringBuilder sb = new StringBuilder (useFullName ? type.FullName : type.Name);
- sb.Append ("<");
- for (int i = 0; i < type.TypeParameterCount; i++) {
- if (i > 0)
- sb.Append (", ");
- sb.Append (type.TypeParameters [i].Name);
- }
- sb.Append (">");
- return sb.ToString ();
- }
-
- public override string PlainText {
- get {
- return GetPlainText (type, false);
- }
- }
-
- public override MonoDevelop.Ide.CodeCompletion.TooltipInformation TooltipInformation {
- get {
- return Ambience.GetTooltip (type);
- }
- }
-
- public override string Description {
- get {
- string loc;
- MonoDevelop.Projects.Project project;
- if (type.TryGetSourceProject (out project)) {
- loc = GettextCatalog.GetString ("project {0}", project.Name);
- } else {
- loc = GettextCatalog.GetString ("file {0}", type.Region.FileName);
- }
-
- switch (type.Kind) {
- case TypeKind.Interface:
- return GettextCatalog.GetString ("interface ({0})", loc);
- case TypeKind.Struct:
- return GettextCatalog.GetString ("struct ({0})", loc);
- case TypeKind.Delegate:
- return GettextCatalog.GetString ("delegate ({0})", loc);
- case TypeKind.Enum:
- return GettextCatalog.GetString ("enumeration ({0})", loc);
- default:
- return GettextCatalog.GetString ("class ({0})", loc);
- }
- }
- }
-
- public override string GetMarkupText (Widget widget)
- {
- return HighlightMatch (widget, GetPlainText (type, useFullName), match);
- }
-
- public TypeSearchResult (string match, string matchedString, int rank, ITypeDefinition type, bool useFullName) : base (match, matchedString, rank, null, null, useFullName)
- {
- this.type = type;
+ public virtual bool IsValid {
+ get { return true; }
}
}
-
- class FileSearchResult: SearchResult
+
+ class FileSearchResult : SearchResult
{
ProjectFile file;
- bool useFileName;
public override SearchResultType SearchResultType { get { return SearchResultType.File; } }
public override string PlainText {
get {
- if (useFileName)
- return System.IO.Path.GetFileName (file.FilePath);
- return GetRelProjectPath (file);
+ return System.IO.Path.GetFileName (file.FilePath);
}
}
-
+
public override string File {
get {
return file.FilePath;
}
}
-
+
public override Xwt.Drawing.Image Icon {
get {
return DesktopService.GetIconForFile (file.FilePath, IconSize.Menu);
}
}
- public override MonoDevelop.Ide.CodeCompletion.TooltipInformation TooltipInformation {
- get {
- return null;
- }
- }
-
public override string Description {
get {
- if (useFileName)
- return file.Project != null
- ? GettextCatalog.GetString ("file \"{0}\" in project \"{1}\"", GetRelProjectPath (file), file.Project.Name)
- : GettextCatalog.GetString ("file \"{0}\"", GetRelProjectPath (file));
- return file.Project != null ? GettextCatalog.GetString ("file in project \"{0}\"", file.Project.Name) : "";
+ return file.Project != null
+ ? GettextCatalog.GetString ("file \"{0}\" in project \"{1}\"", GetRelProjectPath (file), file.Project.Name)
+ : GettextCatalog.GetString ("file \"{0}\"", GetRelProjectPath (file));
}
}
-
- public FileSearchResult (string match, string matchedString, int rank, ProjectFile file, bool useFileName)
+
+ public FileSearchResult (string match, string matchedString, int rank, ProjectFile file)
: base (match, matchedString, rank)
{
this.file = file;
- this.useFileName = useFileName;
}
-
+
internal static string GetRelProjectPath (ProjectFile file)
{
if (file.Project != null)
@@ -261,99 +182,6 @@ namespace MonoDevelop.Components.MainToolbar
return file.FilePath;
}
}
-
- class MemberSearchResult : SearchResult
- {
- protected bool useFullName;
- protected IUnresolvedMember member;
- protected ITypeDefinition declaringType;
-
- public override SearchResultType SearchResultType { get { return SearchResultType.Member; } }
-
- protected virtual OutputFlags Flags {
- get {
- return OutputFlags.IncludeParameters | OutputFlags.IncludeGenerics
- | (useFullName ? OutputFlags.UseFullName : OutputFlags.None);
- }
- }
-
- public override string PlainText {
- get {
- return member.Name;
- }
- }
-
- public override MonoDevelop.Ide.CodeCompletion.TooltipInformation TooltipInformation {
- get {
- var ctx = member.DeclaringTypeDefinition.CreateResolveContext (new SimpleTypeResolveContext (declaringType));
- return Ambience.GetTooltip (member.Resolve (ctx));
- }
- }
-
- public override string File {
- get { return member.DeclaringTypeDefinition.Region.FileName; }
- }
-
- public override Xwt.Drawing.Image Icon {
- get {
- return ImageService.GetIcon (member.GetStockIcon (false), IconSize.Menu);
- }
- }
-
- public override int Row {
- get { return member.Region.BeginLine; }
- }
-
- public override int Column {
- get { return member.Region.BeginColumn; }
- }
-
- public override string Description {
- get {
- string loc = GettextCatalog.GetString ("type \"{0}\"", member.DeclaringTypeDefinition.Name);
-
- switch (member.SymbolKind) {
- case SymbolKind.Field:
- return GettextCatalog.GetString ("field ({0})", loc);
- case SymbolKind.Property:
- return GettextCatalog.GetString ("property ({0})", loc);
- case SymbolKind.Indexer:
- return GettextCatalog.GetString ("indexer ({0})", loc);
- case SymbolKind.Event:
- return GettextCatalog.GetString ("event ({0})", loc);
- case SymbolKind.Method:
- return GettextCatalog.GetString ("method ({0})", loc);
- case SymbolKind.Operator:
- return GettextCatalog.GetString ("operator ({0})", loc);
- case SymbolKind.Constructor:
- return GettextCatalog.GetString ("constructor ({0})", loc);
- case SymbolKind.Destructor:
- return GettextCatalog.GetString ("destructor ({0})", loc);
- default:
- throw new NotSupportedException (member.SymbolKind + " is not supported.");
- }
- }
- }
-
- public MemberSearchResult (string match, string matchedString, int rank, ITypeDefinition declaringType, IUnresolvedMember member, bool useFullName) : base (match, matchedString, rank)
- {
- this.declaringType = declaringType;
- this.member = member;
- this.useFullName = useFullName;
- }
-
- public override string GetMarkupText (Widget widget)
- {
- if (useFullName)
- return HighlightMatch (widget, member.SymbolKind == SymbolKind.Constructor ? member.DeclaringTypeDefinition.FullName : member.FullName, match);
- return HighlightMatch (widget, member.SymbolKind == SymbolKind.Constructor ? member.DeclaringTypeDefinition.Name : member.Name, match);
- }
-
- internal Ambience Ambience {
- get;
- set;
- }
- }
class CommandResult: SearchResult
{
@@ -392,12 +220,6 @@ namespace MonoDevelop.Components.MainToolbar
}
}
- public override MonoDevelop.Ide.CodeCompletion.TooltipInformation TooltipInformation {
- get {
- return null;
- }
- }
-
public override string Description {
get {
string desc = "";
@@ -417,9 +239,9 @@ namespace MonoDevelop.Components.MainToolbar
}
}
- public override string GetMarkupText (Widget widget)
+ public override string GetMarkupText (bool selected)
{
- return HighlightMatch (widget, MatchedString, match);
+ return HighlightMatch (MatchedString, match, selected);
}
public override bool CanActivate {
@@ -432,5 +254,20 @@ namespace MonoDevelop.Components.MainToolbar
{
IdeApp.CommandService.DispatchCommand (command.Id, null, route.InitialTarget, CommandSource.MainToolbar);
}
+
+ public override bool IsValid {
+ get {
+ if (ci == null) {
+ //GetCommandInfo throws exception if GetActionCommand returns null
+ if (CommandManager.ToCommandId (IdeApp.CommandService.GetActionCommand (command.Id)) == null) {
+ return false;
+ }
+ Runtime.RunInMainThread (delegate {
+ ci = IdeApp.CommandService.GetCommandInfo (command.Id, new CommandTargetRoute (MainToolbar.LastCommandTarget));
+ }).Wait ();
+ }
+ return ci.Enabled && ci.Visible;
+ }
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs
index bf0070f28a..ea19780ab4 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusArea.cs
@@ -1,21 +1,21 @@
-//
+//
// StatusArea.cs
-//
+//
// Author:
// Mike Krüger <mkrueger@xamarin.com>
-//
+//
// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
+//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
-//
+//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
-//
+//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -35,8 +35,6 @@ using System.Collections.Generic;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Components;
-using Mono.TextEditor;
-
using StockIcons = MonoDevelop.Ide.Gui.Stock;
using Xwt.Motion;
using MonoDevelop.Ide.Fonts;
@@ -107,8 +105,10 @@ namespace MonoDevelop.Components.MainToolbar
StatusBarContextHandler ctxHandler;
bool progressBarVisible;
+ string currentApplicationName = String.Empty;
+
Queue<Message> messageQueue;
-
+
public StatusBar MainContext {
get { return ctxHandler.MainContext; }
}
@@ -127,7 +127,7 @@ namespace MonoDevelop.Components.MainToolbar
label.Wrap = true;
label.WidthRequest = messageBox.Allocation.Width;
-
+
e.Tooltip.Custom = label;
e.RetVal = true;
} else {
@@ -148,7 +148,7 @@ namespace MonoDevelop.Components.MainToolbar
statusIconBox.BorderWidth = 0;
statusIconBox.Spacing = 3;
- Action<bool> animateProgressBar =
+ Action<bool> animateProgressBar =
showing => this.Animate ("ProgressBarFade",
val => renderArg.ProgressBarAlpha = val,
renderArg.ProgressBarAlpha,
@@ -162,7 +162,7 @@ namespace MonoDevelop.Components.MainToolbar
QueueDraw ();
animateProgressBar (true);
};
-
+
ProgressEnd += delegate {
renderArg.ShowProgressBar = false;
// StopBuildAnimation ();
@@ -236,7 +236,7 @@ namespace MonoDevelop.Components.MainToolbar
theme.Dispose ();
base.OnDestroyed ();
}
-
+
void IAnimatable.BatchBegin () { }
void IAnimatable.BatchCommit () { QueueDraw (); }
@@ -297,27 +297,27 @@ namespace MonoDevelop.Components.MainToolbar
else
box = new VBox ();
box.Spacing = 3;
-
+
var errorIcon = ImageService.GetIcon (StockIcons.Error).WithSize (Xwt.IconSize.Small);
var warningIcon = ImageService.GetIcon (StockIcons.Warning).WithSize (Xwt.IconSize.Small);
var errorImage = new Xwt.ImageView (errorIcon);
var warningImage = new Xwt.ImageView (warningIcon);
-
+
box.PackStart (errorImage.ToGtkWidget (), false, false, 0);
Label errors = new Gtk.Label ();
box.PackStart (errors, false, false, 0);
-
+
box.PackStart (warningImage.ToGtkWidget (), false, false, 0);
Label warnings = new Gtk.Label ();
box.PackStart (warnings, false, false, 0);
box.NoShowAll = true;
box.Show ();
-
+
TaskEventHandler updateHandler = delegate {
int ec=0, wc=0;
- foreach (Task t in TaskService.Errors) {
+ foreach (TaskListEntry t in TaskService.Errors) {
if (t.Severity == TaskSeverity.Error)
ec++;
else if (t.Severity == TaskSeverity.Warning)
@@ -325,7 +325,7 @@ namespace MonoDevelop.Components.MainToolbar
}
- using (var font = FontService.SansFont.CopyModified (0.8d)) {
+ using (var font = FontService.SansFont.CopyModified (MonoDevelop.Ide.Gui.Styles.FontScale11)) {
errors.Visible = ec > 0;
errors.ModifyFont (font);
errors.Text = ec.ToString ();
@@ -341,15 +341,19 @@ namespace MonoDevelop.Components.MainToolbar
UpdateSeparators ();
};
-
+
updateHandler (null, null);
-
+
TaskService.Errors.TasksAdded += updateHandler;
TaskService.Errors.TasksRemoved += updateHandler;
+
+ currentApplicationName = BrandingService.ApplicationLongName;
+ BrandingService.ApplicationNameChanged += ApplicationNameChanged;
box.Destroyed += delegate {
TaskService.Errors.TasksAdded -= updateHandler;
TaskService.Errors.TasksRemoved -= updateHandler;
+ BrandingService.ApplicationNameChanged -= ApplicationNameChanged;
};
ebox.VisibleWindow = false;
@@ -368,6 +372,16 @@ namespace MonoDevelop.Components.MainToolbar
return ebox;
}
+ void ApplicationNameChanged (object sender, EventArgs e)
+ {
+ if (renderArg.CurrentText == currentApplicationName) {
+ LoadText (BrandingService.ApplicationLongName, false);
+ LoadPixbuf (null);
+ QueueDraw ();
+ }
+ currentApplicationName = BrandingService.ApplicationLongName;
+ }
+
protected override void OnRealized ()
{
base.OnRealized ();
@@ -399,13 +413,13 @@ namespace MonoDevelop.Components.MainToolbar
public StatusBarIcon ShowStatusIcon (Xwt.Drawing.Image pixbuf)
{
- DispatchService.AssertGuiThread ();
+ Runtime.AssertMainThread ();
StatusIcon icon = new StatusIcon (this, pixbuf);
statusIconBox.PackEnd (icon.box);
statusIconBox.ShowAll ();
return icon;
}
-
+
void HideStatusIcon (StatusIcon icon)
{
statusIconBox.Remove (icon.EventBox);
@@ -443,7 +457,7 @@ namespace MonoDevelop.Components.MainToolbar
Xwt.Drawing.Image icon;
uint animation;
Xwt.ImageView image;
-
+
int astep;
Xwt.Drawing.Image[] images;
TooltipPopoverWindow tooltipWindow;
@@ -451,7 +465,7 @@ namespace MonoDevelop.Components.MainToolbar
uint tipShowTimeoutId;
DateTime scheduledTipTime;
const int TooltipTimeout = 350;
-
+
public StatusIcon (StatusArea statusBar, Xwt.Drawing.Image icon)
{
if (!icon.HasFixedSize)
@@ -485,21 +499,21 @@ namespace MonoDevelop.Components.MainToolbar
});
};
}
-
+
[GLib.ConnectBefore]
void HandleLeaveNotifyEvent (object o, LeaveNotifyEventArgs args)
{
mouseOver = false;
HideTooltip ();
}
-
+
[GLib.ConnectBefore]
void HandleEnterNotifyEvent (object o, EnterNotifyEventArgs args)
{
mouseOver = true;
ShowTooltip ();
}
-
+
void ShowTooltip ()
{
scheduledTipTime = DateTime.Now + TimeSpan.FromMilliseconds (TooltipTimeout);
@@ -530,7 +544,7 @@ namespace MonoDevelop.Components.MainToolbar
}
return false;
}
-
+
void HideTooltip ()
{
if (tooltipWindow != null) {
@@ -538,7 +552,7 @@ namespace MonoDevelop.Components.MainToolbar
tooltipWindow = null;
}
}
-
+
public void Dispose ()
{
HideTooltip ();
@@ -553,7 +567,7 @@ namespace MonoDevelop.Components.MainToolbar
animation = 0;
}
}
-
+
public string ToolTip {
get { return tip; }
set {
@@ -567,11 +581,11 @@ namespace MonoDevelop.Components.MainToolbar
ShowTooltip ();
}
}
-
+
public EventBox EventBox {
get { return box; }
}
-
+
public Xwt.Drawing.Image Image {
get { return icon; }
set {
@@ -581,24 +595,24 @@ namespace MonoDevelop.Components.MainToolbar
image.Image = icon;
}
}
-
+
public void SetAlertMode (int seconds)
{
astep = 0;
alertEnd = DateTime.Now.AddSeconds (seconds);
-
+
if (animation != 0)
GLib.Source.Remove (animation);
-
+
animation = GLib.Timeout.Add (60, new GLib.TimeoutHandler (AnimateIcon));
-
+
if (images == null) {
images = new Xwt.Drawing.Image [10];
for (int n=0; n<10; n++)
images [n] = icon.WithAlpha (((double)(9-n))/10.0);
}
}
-
+
bool AnimateIcon ()
{
if (DateTime.Now >= alertEnd && astep == 0) {
@@ -610,14 +624,14 @@ namespace MonoDevelop.Components.MainToolbar
image.Image = images [astep];
else
image.Image = images [20 - astep - 1];
-
+
astep = (astep + 1) % 20;
return true;
}
public event EventHandler<StatusBarIconClickedEventArgs> Clicked;
}
-
+
#endregion
#region StatusBarContextBase implementation
@@ -659,7 +673,7 @@ namespace MonoDevelop.Components.MainToolbar
void ShowMessageInner (IconId image, string message, bool isMarkup)
{
- DispatchService.AssertGuiThread ();
+ Runtime.AssertMainThread ();
if (image == StockIcons.StatusError) {
// If the application doesn't have the focus, trigger the animation
@@ -681,10 +695,10 @@ namespace MonoDevelop.Components.MainToolbar
}
animPauseHandle = 0;
return false;
- });
+ });
});
*/
- this.Animate ("Text",
+ this.Animate ("Text",
x => renderArg.TextAnimationProgress = x,
easing: Easing.SinInOut,
finished: (x, b) => { animPauseHandle = GLib.Timeout.Add (1000, () => {
@@ -694,7 +708,7 @@ namespace MonoDevelop.Components.MainToolbar
}
animPauseHandle = 0;
return false;
- });
+ });
});
@@ -707,7 +721,7 @@ namespace MonoDevelop.Components.MainToolbar
void LoadText (string message, bool isMarkup)
{
if (string.IsNullOrEmpty(message))
- message = BrandingService.ApplicationName;
+ message = BrandingService.ApplicationLongName;
message = message ?? "";
renderArg.LastText = renderArg.CurrentText;
@@ -740,13 +754,13 @@ namespace MonoDevelop.Components.MainToolbar
// load image now
if (ImageService.IsAnimation (image, Gtk.IconSize.Menu)) {
iconAnimation = ImageService.GetAnimatedIcon (image, Gtk.IconSize.Menu);
- renderArg.CurrentPixbuf = iconAnimation.FirstFrame.WithSize (14,14);
+ renderArg.CurrentPixbuf = iconAnimation.FirstFrame.WithSize (16,16);
currentIconAnimation = iconAnimation.StartAnimation (delegate (Xwt.Drawing.Image p) {
- renderArg.CurrentPixbuf = p.WithSize (14,14);
+ renderArg.CurrentPixbuf = p.WithSize (16,16);
QueueDraw ();
});
} else {
- renderArg.CurrentPixbuf = ImageService.GetIcon (image).WithSize (14,14);
+ renderArg.CurrentPixbuf = ImageService.GetIcon (image).WithSize (16,16);
}
iconLoaded = true;
@@ -757,45 +771,45 @@ namespace MonoDevelop.Components.MainToolbar
#region Progress Monitor implementation
public static event EventHandler ProgressBegin, ProgressEnd, ProgressPulse;
public static event EventHandler<FractionEventArgs> ProgressFraction;
-
+
public sealed class FractionEventArgs : EventArgs
{
public double Work { get; private set; }
-
+
public FractionEventArgs (double work)
{
this.Work = work;
}
}
-
+
static void OnProgressBegin (EventArgs e)
{
var handler = ProgressBegin;
if (handler != null)
handler (null, e);
}
-
+
static void OnProgressEnd (EventArgs e)
{
var handler = ProgressEnd;
if (handler != null)
handler (null, e);
}
-
+
static void OnProgressPulse (EventArgs e)
{
var handler = ProgressPulse;
if (handler != null)
handler (null, e);
}
-
+
static void OnProgressFraction (FractionEventArgs e)
{
var handler = ProgressFraction;
if (handler != null)
handler (null, e);
}
-
+
public void BeginProgress (string name)
{
ShowMessage (name);
@@ -804,7 +818,7 @@ namespace MonoDevelop.Components.MainToolbar
OnProgressBegin (EventArgs.Empty);
}
}
-
+
public void BeginProgress (IconId image, string name)
{
ShowMessage (image, name);
@@ -813,13 +827,13 @@ namespace MonoDevelop.Components.MainToolbar
OnProgressBegin (EventArgs.Empty);
}
}
-
+
public void SetProgressFraction (double work)
{
- DispatchService.AssertGuiThread ();
+ Runtime.AssertMainThread ();
OnProgressFraction (new FractionEventArgs (work));
}
-
+
public void EndProgress ()
{
if (!progressBarVisible)
@@ -829,18 +843,18 @@ namespace MonoDevelop.Components.MainToolbar
OnProgressEnd (EventArgs.Empty);
AutoPulse = false;
}
-
+
public void Pulse ()
{
- DispatchService.AssertGuiThread ();
+ Runtime.AssertMainThread ();
OnProgressPulse (EventArgs.Empty);
}
-
+
uint autoPulseTimeoutId;
public bool AutoPulse {
get { return autoPulseTimeoutId != 0; }
set {
- DispatchService.AssertGuiThread ();
+ Runtime.AssertMainThread ();
if (value) {
if (autoPulseTimeoutId == 0) {
autoPulseTimeoutId = GLib.Timeout.Add (100, delegate {
@@ -867,6 +881,8 @@ namespace MonoDevelop.Components.MainToolbar
var alloc = Allocation;
//alloc.Inflate (0, -2);
ctx.Rectangle (alloc.X, alloc.Y, 1, alloc.Height);
+
+ // FIXME: VV: Remove gradient features
using (Cairo.LinearGradient gr = new LinearGradient (alloc.X, alloc.Y, alloc.X, alloc.Y + alloc.Height)) {
gr.AddColorStop (0, new Cairo.Color (0, 0, 0, 0));
gr.AddColorStop (0.5, new Cairo.Color (0, 0, 0, 0.2));
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusAreaBuildTheme.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusAreaBuildTheme.cs
index a86dc68ade..ce58e8d373 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusAreaBuildTheme.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusAreaBuildTheme.cs
@@ -27,7 +27,6 @@ using MonoDevelop.Components;
using Cairo;
using StockIcons = MonoDevelop.Ide.Gui.Stock;
-using Mono.TextEditor;
namespace MonoDevelop.Components.MainToolbar
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusAreaTheme.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusAreaTheme.cs
index 8de5c8ebff..45da0b1667 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusAreaTheme.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/StatusAreaTheme.cs
@@ -37,7 +37,6 @@ using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Components;
using StockIcons = MonoDevelop.Ide.Gui.Stock;
-using Mono.TextEditor;
namespace MonoDevelop.Components.MainToolbar
{
@@ -78,9 +77,11 @@ namespace MonoDevelop.Components.MainToolbar
context.Clip ();
int x1 = arg.Allocation.X + arg.MousePosition.X - 200;
int x2 = x1 + 400;
+
+ // FIXME: VV: Remove gradient features
using (Cairo.LinearGradient gradient = new LinearGradient (x1, 0, x2, 0))
{
- Cairo.Color targetColor = Styles.StatusBarFill1Color;
+ Cairo.Color targetColor = Styles.StatusBarFill1Color.ToCairoColor ();
Cairo.Color transparentColor = targetColor;
targetColor.A = .7;
transparentColor.A = 0;
@@ -202,12 +203,12 @@ namespace MonoDevelop.Components.MainToolbar
{
LayoutRoundedRectangle (context, region, -1, -1);
context.LineWidth = 1;
- context.SetSourceColor (Styles.StatusBarInnerColor);
+ context.SetSourceColor (Styles.StatusBarInnerColor.ToCairoColor ());
context.Stroke ();
LayoutRoundedRectangle (context, region);
context.LineWidth = 1;
- context.SetSourceColor (Styles.StatusBarBorderColor);
+ context.SetSourceColor (Styles.StatusBarBorderColor.ToCairoColor ());
context.StrokePreserve ();
}
@@ -217,8 +218,8 @@ namespace MonoDevelop.Components.MainToolbar
context.ClipPreserve ();
using (LinearGradient lg = new LinearGradient (region.X, region.Y, region.X, region.Y + region.Height)) {
- lg.AddColorStop (0, Styles.StatusBarFill1Color);
- lg.AddColorStop (1, Styles.StatusBarFill4Color);
+ lg.AddColorStop (0, Styles.StatusBarFill1Color.ToCairoColor ());
+ lg.AddColorStop (1, Styles.StatusBarFill4Color.ToCairoColor ());
context.SetSource (lg);
context.FillPreserve ();
@@ -230,8 +231,8 @@ namespace MonoDevelop.Components.MainToolbar
context.Translate (midX, midY);
using (RadialGradient rg = new RadialGradient (0, 0, 0, 0, 0, region.Height * 1.2)) {
- rg.AddColorStop (0, Styles.StatusBarFill1Color);
- rg.AddColorStop (1, Styles.WithAlpha (Styles.StatusBarFill1Color, 0));
+ rg.AddColorStop (0, Styles.StatusBarFill1Color.ToCairoColor ());
+ rg.AddColorStop (1, Styles.StatusBarFill1Color.WithAlpha (0).ToCairoColor ());
context.Scale (region.Width / (double)region.Height, 1.0);
context.SetSource (rg);
@@ -240,8 +241,8 @@ namespace MonoDevelop.Components.MainToolbar
context.Restore ();
using (LinearGradient lg = new LinearGradient (0, region.Y, 0, region.Y + region.Height)) {
- lg.AddColorStop (0, Styles.StatusBarShadowColor1);
- lg.AddColorStop (1, Styles.WithAlpha (Styles.StatusBarShadowColor1, Styles.StatusBarShadowColor1.A * 0.2));
+ lg.AddColorStop (0, Styles.StatusBarShadowColor1.ToCairoColor ());
+ lg.AddColorStop (1, Styles.StatusBarShadowColor1.WithAlpha (Styles.StatusBarShadowColor1.Alpha * 0.2).ToCairoColor ());
LayoutRoundedRectangle (context, region, 0, -1);
context.LineWidth = 1;
@@ -250,8 +251,8 @@ namespace MonoDevelop.Components.MainToolbar
}
using (LinearGradient lg = new LinearGradient (0, region.Y, 0, region.Y + region.Height)) {
- lg.AddColorStop (0, Styles.StatusBarShadowColor2);
- lg.AddColorStop (1, Styles.WithAlpha (Styles.StatusBarShadowColor2, Styles.StatusBarShadowColor2.A * 0.2));
+ lg.AddColorStop (0, Styles.StatusBarShadowColor2.ToCairoColor ());
+ lg.AddColorStop (1, Styles.StatusBarShadowColor2.WithAlpha (Styles.StatusBarShadowColor2.Alpha * 0.2).ToCairoColor ());
LayoutRoundedRectangle (context, region, 0, -2);
context.LineWidth = 1;
@@ -286,10 +287,10 @@ namespace MonoDevelop.Components.MainToolbar
draw: (c, o) => {
// The smaller the pixel range of our gradient the less error there will be in it.
using (var lg = new LinearGradient (surfaceWidth - 250, 0, surfaceWidth, 0)) {
- lg.AddColorStop (0.00, Styles.WithAlpha (Styles.StatusBarErrorColor, 0.15 * o));
- lg.AddColorStop (0.10, Styles.WithAlpha (Styles.StatusBarErrorColor, 0.15 * o));
- lg.AddColorStop (0.88, Styles.WithAlpha (Styles.StatusBarErrorColor, 0.30 * o));
- lg.AddColorStop (1.00, Styles.WithAlpha (Styles.StatusBarErrorColor, 0.00 * o));
+ lg.AddColorStop (0.00, Styles.StatusBarErrorColor.WithAlpha (0.15 * o).ToCairoColor ());
+ lg.AddColorStop (0.10, Styles.StatusBarErrorColor.WithAlpha (0.15 * o).ToCairoColor ());
+ lg.AddColorStop (0.88, Styles.StatusBarErrorColor.WithAlpha (0.30 * o).ToCairoColor ());
+ lg.AddColorStop (1.00, Styles.StatusBarErrorColor.WithAlpha (0.00 * o).ToCairoColor ());
c.SetSource (lg);
c.Paint ();
@@ -304,12 +305,12 @@ namespace MonoDevelop.Components.MainToolbar
context.Clip ();
LayoutRoundedRectangle (context, bounding, 0, 0, 1);
- context.SetSourceColor (Styles.WithAlpha (Styles.StatusBarProgressBackgroundColor, Styles.StatusBarProgressBackgroundColor.A * arg.ProgressBarAlpha));
+ context.SetSourceColor (Styles.StatusBarProgressBackgroundColor.WithAlpha (Styles.StatusBarProgressBackgroundColor.Alpha * arg.ProgressBarAlpha).ToCairoColor ());
context.FillPreserve ();
context.ResetClip ();
- context.SetSourceColor (Styles.WithAlpha (Styles.StatusBarProgressOutlineColor, Styles.StatusBarProgressOutlineColor.A * arg.ProgressBarAlpha));
+ context.SetSourceColor (Styles.StatusBarProgressOutlineColor.WithAlpha (Styles.StatusBarProgressOutlineColor.Alpha * arg.ProgressBarAlpha).ToCairoColor ());
context.LineWidth = 1;
context.Stroke ();
}
@@ -322,7 +323,7 @@ namespace MonoDevelop.Components.MainToolbar
protected virtual Cairo.Color FontColor ()
{
- return Styles.StatusBarTextColor;
+ return Styles.StatusBarTextColor.ToCairoColor ();
}
void DrawString (string text, bool isMarkup, Cairo.Context context, int x, int y, int width, double opacity, Pango.Context pango, StatusArea.RenderArg arg)
@@ -348,7 +349,7 @@ namespace MonoDevelop.Components.MainToolbar
// Subtract off remainder instead of drop to prefer higher centering when centering an odd number of pixels
context.MoveTo (x, y - h / 2 - (h % 2));
- context.SetSourceColor (Styles.WithAlpha (FontColor (), opacity));
+ context.SetSourceColor (CairoExtensions.WithAlpha (FontColor (), opacity));
Pango.CairoHelper.ShowLayout (context, pl);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-left-cap-normal~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-left-cap-normal~dark.png
new file mode 100644
index 0000000000..1262d11685
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-left-cap-normal~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-left-cap-normal~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-left-cap-normal~dark@2x.png
new file mode 100644
index 0000000000..ccd32e2219
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-left-cap-normal~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-left-cap-pressed~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-left-cap-pressed~dark.png
new file mode 100644
index 0000000000..b7526e13ff
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-left-cap-pressed~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-left-cap-pressed~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-left-cap-pressed~dark@2x.png
new file mode 100644
index 0000000000..4444cd3aba
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-left-cap-pressed~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-middle-cap-normal~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-middle-cap-normal~dark.png
new file mode 100644
index 0000000000..0176a9b36a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-middle-cap-normal~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-middle-cap-normal~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-middle-cap-normal~dark@2x.png
new file mode 100644
index 0000000000..629d0f463e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-middle-cap-normal~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-middle-cap-pressed~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-middle-cap-pressed~dark.png
new file mode 100644
index 0000000000..2ed1c20870
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-middle-cap-pressed~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-middle-cap-pressed~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-middle-cap-pressed~dark@2x.png
new file mode 100644
index 0000000000..40b3867fc4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-middle-cap-pressed~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-right-cap-normal~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-right-cap-normal~dark.png
new file mode 100644
index 0000000000..903044c014
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-right-cap-normal~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-right-cap-normal~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-right-cap-normal~dark@2x.png
new file mode 100644
index 0000000000..c7d54ed3d2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-right-cap-normal~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-right-cap-pressed~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-right-cap-pressed~dark.png
new file mode 100644
index 0000000000..9f05eaad6d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-right-cap-pressed~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-right-cap-pressed~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-right-cap-pressed~dark@2x.png
new file mode 100644
index 0000000000..c394ca0ca6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-debug-base-right-cap-pressed~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-disabled-32~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-disabled-32~dark.png
new file mode 100644
index 0000000000..bde5309a85
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-disabled-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-disabled-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-disabled-32~dark@2x.png
new file mode 100644
index 0000000000..a0969f9b16
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-disabled-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-hover-32~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-hover-32~dark.png
new file mode 100644
index 0000000000..153164be09
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-hover-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-hover-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-hover-32~dark@2x.png
new file mode 100644
index 0000000000..2f265b499a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-hover-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-normal-32~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-normal-32~dark.png
new file mode 100644
index 0000000000..153164be09
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-normal-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-normal-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-normal-32~dark@2x.png
new file mode 100644
index 0000000000..2f265b499a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-normal-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-pressed-32~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-pressed-32~dark.png
new file mode 100644
index 0000000000..5111ee1ea6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-pressed-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-pressed-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-pressed-32~dark@2x.png
new file mode 100644
index 0000000000..448ad8dd0d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/assets/btn-execute-pressed-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-build-disabled-32~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-build-disabled-32~dark.png
new file mode 100644
index 0000000000..2e21aaa4a7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-build-disabled-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-build-disabled-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-build-disabled-32~dark@2x.png
new file mode 100644
index 0000000000..d4061bf491
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-build-disabled-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-build-normal-32~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-build-normal-32~dark.png
new file mode 100644
index 0000000000..aed2f4b32e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-build-normal-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-build-normal-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-build-normal-32~dark@2x.png
new file mode 100644
index 0000000000..27da48eeb2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-build-normal-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-execute-disabled-32~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-execute-disabled-32~dark.png
new file mode 100644
index 0000000000..5dfbfb3247
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-execute-disabled-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-execute-disabled-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-execute-disabled-32~dark@2x.png
new file mode 100644
index 0000000000..5556c38450
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-execute-disabled-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-execute-normal-32~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-execute-normal-32~dark.png
new file mode 100644
index 0000000000..779bc8ce54
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-execute-normal-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-execute-normal-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-execute-normal-32~dark@2x.png
new file mode 100644
index 0000000000..f9ea0d838e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-execute-normal-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-stop-disabled-32~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-stop-disabled-32~dark.png
new file mode 100644
index 0000000000..8c439b0be9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-stop-disabled-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-stop-disabled-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-stop-disabled-32~dark@2x.png
new file mode 100644
index 0000000000..e9baec8f3a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-stop-disabled-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-stop-normal-32~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-stop-normal-32~dark.png
new file mode 100644
index 0000000000..4caf506f9c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-stop-normal-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-stop-normal-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-stop-normal-32~dark@2x.png
new file mode 100644
index 0000000000..496a272721
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/icons/ico-stop-normal-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/BooleanEditorCell.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/BooleanEditorCell.cs
index 30ff63b038..1ae1306146 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/BooleanEditorCell.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/BooleanEditorCell.cs
@@ -31,39 +31,62 @@ using System.ComponentModel;
namespace MonoDevelop.Components.PropertyGrid.PropertyEditors
{
- [PropertyEditorType (typeof (bool))]
+ [PropertyEditorType (typeof (bool))]
public class BooleanEditorCell : PropertyEditorCell
{
static int indicatorSize;
static int indicatorSpacing;
-
+ static Gtk.Style style;
+
static BooleanEditorCell ()
{
- Gtk.CheckButton cb = new Gtk.CheckButton ();
- indicatorSize = (int) cb.StyleGetProperty ("indicator-size");
- indicatorSpacing = (int) cb.StyleGetProperty ("indicator-spacing");
+ // reinit style
+ MonoDevelop.Ide.Gui.Styles.Changed += (sender, e) => style = null;
+ }
+
+ // we can't override Initialize () or use the default constructor for this,
+ // because a valid Gdk.Window is required for full Gtk.Style initialization
+ static void InitializeStyle (Gtk.Widget container)
+ {
+ if (style == null && container.GdkWindow != null) {
+ Gtk.CheckButton cb = new BooleanEditor ();
+ cb.GdkWindow = container.GdkWindow;
+ cb.Parent = container;
+ cb.Realize ();
+ style = cb.Style;
+ style.Attach (container.GdkWindow);
+ indicatorSize = (int) cb.StyleGetProperty ("indicator-size");
+ indicatorSpacing = (int) cb.StyleGetProperty ("indicator-spacing");
+ style.Detach ();
+ cb.Dispose ();
+ }
}
public override void GetSize (int availableWidth, out int width, out int height)
{
- width = 20;
- height = 20;
+ width = indicatorSize;
+ height = indicatorSize;
}
public override void Render (Gdk.Drawable window, Cairo.Context ctx, Gdk.Rectangle bounds, Gtk.StateType state)
{
+ if (style == null)
+ InitializeStyle (Container);
+
Gtk.ShadowType sh = (bool) Value ? Gtk.ShadowType.In : Gtk.ShadowType.Out;
+
int s = indicatorSize - 1;
if (s > bounds.Height)
s = bounds.Height;
if (s > bounds.Width)
s = bounds.Width;
- Gtk.Style.PaintCheck (Container.Style, window, state, sh, bounds, Container, "checkbutton", bounds.X + indicatorSpacing - 1, bounds.Y + (bounds.Height - s)/2, s, s);
+
+ Gtk.Style.PaintCheck (style, window, state, sh, bounds, Container, "checkbutton", bounds.X + indicatorSpacing - 1, bounds.Y + (bounds.Height - s)/2, s, s);
}
protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, Gtk.StateType state)
{
- return new BooleanEditor ();
+ return new BooleanEditor { State = state };
}
}
@@ -73,6 +96,7 @@ namespace MonoDevelop.Components.PropertyGrid.PropertyEditors
{
if (session.Property.PropertyType != typeof(bool))
throw new ApplicationException ("Boolean editor does not support editing values of type " + session.Property.PropertyType);
+ Sensitive = !session.Property.IsReadOnly;
}
public object Value {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs
index 35a1754f2e..a4070bdd75 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/CollectionEditor.cs
@@ -87,13 +87,14 @@ namespace MonoDevelop.Components.PropertyGrid.PropertyEditors
TreeIter previousIter = TreeIter.Zero;
//dialogue and buttons
- Dialog dialog = new Dialog () {
+ var dialog = new Gtk.Dialog () {
Title = displayName + " Editor",
Modal = true,
AllowGrow = true,
AllowShrink = true,
};
- var toplevel = this.Container.Toplevel as Window;
+ IdeTheme.ApplyTheme (dialog);
+ var toplevel = this.Container.GetNativeWidget<Gtk.Widget> ().Toplevel as Gtk.Window;
if (toplevel != null)
dialog.TransientFor = toplevel;
@@ -118,17 +119,17 @@ namespace MonoDevelop.Components.PropertyGrid.PropertyEditors
hBox.PackEnd (buttonBox, false, false, 5);
//add/remove buttons
- Button addButton = new Button (new Image (Stock.Add, IconSize.Button));
+ Button addButton = new Button (new ImageView (Stock.Add, IconSize.Button));
buttonBox.PackStart (addButton, false, false, 0);
if (types [0].IsAbstract)
addButton.Sensitive = false;
- Button removeButton = new Button (new Gtk.Image (Stock.Remove, IconSize.Button));
+ Button removeButton = new Button (new ImageView (Stock.Remove, IconSize.Button));
buttonBox.PackStart (removeButton, false, false, 0);
//sorting buttons
- Button upButton = new Button (new Image (Stock.GoUp, IconSize.Button));
+ Button upButton = new Button (new ImageView (Stock.GoUp, IconSize.Button));
buttonBox.PackStart (upButton, false, false, 0);
- Button downButton = new Button (new Image (Stock.GoDown, IconSize.Button));
+ Button downButton = new Button (new ImageView (Stock.GoDown, IconSize.Button));
buttonBox.PackStart (downButton, false, false, 0);
//Third column has list (TreeView) in a ScrolledWindow
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/ColorEditorCell.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/ColorEditorCell.cs
index f5242c009c..6a1b998f5e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/ColorEditorCell.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/ColorEditorCell.cs
@@ -63,7 +63,7 @@ namespace MonoDevelop.Components.PropertyGrid.PropertyEditors
gc.RgbFgColor = GetColor ();
int yd = (bounds.Height - ColorBoxSize) / 2;
window.DrawRectangle (gc, true, bounds.X, bounds.Y + yd, ColorBoxSize - 1, ColorBoxSize - 1);
- window.DrawRectangle (Container.Style.BlackGC, false, bounds.X, bounds.Y + yd, ColorBoxSize - 1, ColorBoxSize - 1);
+ window.DrawRectangle (Container.GetNativeWidget<Gtk.Widget> ().Style.BlackGC, false, bounds.X, bounds.Y + yd, ColorBoxSize - 1, ColorBoxSize - 1);
bounds.X += ColorBoxSize + ColorBoxSpacing;
bounds.Width -= ColorBoxSize + ColorBoxSpacing;
base.Render (window, ctx, bounds, state);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/ExpandableObjectEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/ExpandableObjectEditor.cs
new file mode 100644
index 0000000000..a172e7b4d3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/ExpandableObjectEditor.cs
@@ -0,0 +1,61 @@
+/*
+ * ExpandableObjectEditor.cs - Temporary editor until we get expandable object support in main grid
+ *
+ * Part of PropertyGrid - A Gtk# widget that displays and allows
+ * editing of all of an object's public properties
+ *
+ * Authors:
+ * Michael Hutchinson <m.j.hutchinson@gmail.com>
+ * Lluis Sanchez Gual
+ *
+ * Copyright (C) 2005 Michael Hutchinson
+ *
+ * This sourcecode is licenced under The MIT License:
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to permit
+ * persons to whom the Software is furnished to do so, subject to the
+ * following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+using Gtk;
+
+namespace MonoDevelop.Components.PropertyGrid.PropertyEditors
+{
+ class ExpandableObjectEditor : PropertyEditorCell
+ {
+ protected override string GetValueMarkup ()
+ {
+ string val;
+ if (Property.Converter.CanConvertTo (Context, typeof(string)))
+ val = Property.Converter.ConvertToString (Context, Value);
+ else
+ val = Value != null ? Value.ToString () : "";
+
+ return "<b>" + GLib.Markup.EscapeText (val) + "</b>";
+ }
+
+ protected override IPropertyEditor CreateEditor (Gdk.Rectangle cell_area, StateType state)
+ {
+ if (Property.Converter.CanConvertTo (Context, typeof(string)) && Property.Converter.CanConvertFrom (Context, typeof(string)))
+ return new PropertyTextEditor ();
+ else
+ return null;
+ }
+
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/FlagsSelectorDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/FlagsSelectorDialog.cs
index 925bf269e9..76facbfeaa 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/FlagsSelectorDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/FlagsSelectorDialog.cs
@@ -53,6 +53,7 @@ namespace MonoDevelop.Components.PropertyGrid.PropertyEditors
sc.Add (treeView);
dialog = new Gtk.Dialog ();
+ IdeTheme.ApplyTheme (dialog);
dialog.VBox.Add (sc);
dialog.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel);
dialog.AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/PropertyTextEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/PropertyTextEditor.cs
new file mode 100644
index 0000000000..e8956709d0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/PropertyTextEditor.cs
@@ -0,0 +1,306 @@
+//
+// TextEditor.cs
+//
+// Author:
+// Lluis Sanchez Gual
+// Michael Hutchinson
+//
+// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.ComponentModel;
+
+using Gtk;
+using Gdk;
+
+namespace MonoDevelop.Components.PropertyGrid.PropertyEditors
+{
+ [PropertyEditorType (typeof (string))]
+ public class PropertyTextEditor: Gtk.HBox, IPropertyEditor
+ {
+ EditSession session;
+ bool disposed;
+ string initialText;
+ object currentValue;
+ Entry entry;
+ ComboBox combo;
+ ListStore store;
+ bool changed;
+
+ public void Initialize (EditSession session)
+ {
+ this.session = session;
+
+ //if standard values are supported by the converter, then
+ //we list them in a combo
+ if (session.Property.Converter.GetStandardValuesSupported (session))
+ {
+ store = new ListStore (typeof(string), typeof(object));
+
+ //if converter doesn't allow nonstandard values, or can't convert from strings, don't have an entry
+ if (session.Property.Converter.GetStandardValuesExclusive (session) || !session.Property.Converter.CanConvertFrom (session, typeof(string))) {
+ combo = new ComboBox (store);
+ var crt = new CellRendererText ();
+ combo.PackStart (crt, true);
+ combo.AddAttribute (crt, "text", 0);
+ } else {
+ combo = new ComboBoxEntry (store, 0);
+ entry = ((ComboBoxEntry)combo).Entry;
+ entry.HeightRequest = combo.SizeRequest ().Height;
+ }
+
+ PackStart (combo, true, true, 0);
+ combo.Changed += TextChanged;
+
+ //fill the list
+ foreach (object stdValue in session.Property.Converter.GetStandardValues (session)) {
+ store.AppendValues (session.Property.Converter.ConvertToString (session, stdValue), ObjectBox.Box (stdValue));
+ }
+
+ //a value of "--" gets rendered as a --, if typeconverter marked with UsesDashesForSeparator
+ object[] atts = session.Property.Converter.GetType ()
+ .GetCustomAttributes (typeof (StandardValuesSeparatorAttribute), true);
+ if (atts.Length > 0) {
+ string separator = ((StandardValuesSeparatorAttribute)atts[0]).Separator;
+ combo.RowSeparatorFunc = (model, iter) => separator == ((string)model.GetValue (iter, 0));
+ }
+ }
+ // no standard values, so just use an entry
+ else {
+ entry = new Entry ();
+ entry.IsEditable = !session.Property.IsReadOnly;
+ PackStart (entry, true, true, 0);
+ }
+
+ //if we have an entry, fix it up a little
+ if (entry != null) {
+ entry.HasFrame = false;
+ entry.Changed += TextChanged;
+ entry.FocusOutEvent += FirePendingChangeEvent;
+ if (!entry.IsEditable)
+ entry.ModifyText (StateType.Normal, entry.Style.Text (Gtk.StateType.Insensitive));
+ }
+
+ if (entry != null && ShouldShowDialogButton () && entry.IsEditable) {
+ var button = new Button ("...");
+ PackStart (button, false, false, 0);
+ button.Clicked += ButtonClicked;
+ }
+
+ Spacing = 3;
+ ShowAll ();
+ }
+
+ protected virtual bool ShouldShowDialogButton ()
+ {
+ //if the object's Localizable, show a dialog, since the text's likely to be more substantial
+ var at = (LocalizableAttribute) session.Property.Attributes [typeof(LocalizableAttribute)];
+ return (at != null && at.IsLocalizable);
+ }
+
+ void ButtonClicked (object s, EventArgs a)
+ {
+ using (var dlg = new TextEditorDialog ()) {
+ dlg.TransientFor = Toplevel as Gtk.Window;
+ dlg.Text = entry.Text;
+ if (dlg.Run () == (int) ResponseType.Ok) {
+ entry.Text = dlg.Text;
+ TextChanged (null, null);
+ }
+ }
+ }
+
+ bool GetValue (out object value, out bool isStandard)
+ {
+ isStandard = false;
+
+ //combo box, just find the active value
+ if (store != null && entry == null) {
+ TreeIter it;
+ if (combo.GetActiveIter (out it)) {
+ value = ObjectBox.Unbox (store.GetValue (it, 1));
+ isStandard = true;
+ return true;
+ }
+ value = null;
+ return false;
+ }
+
+ var text = entry.Text;
+
+ // combo plus entry, try to find matching value
+ if (store != null) {
+ TreeIter it;
+ if (store.GetIterFirst (out it)) {
+ do {
+ if ((string)store.GetValue (it, 0) == text) {
+ value = ObjectBox.Unbox (store.GetValue (it, 1));
+ isStandard = true;
+ return true;
+ }
+ } while (store.IterNext (ref it));
+ }
+ }
+
+ //finally, convert the value
+ try {
+ value = session.Property.Converter.ConvertFromString (session, entry.Text);
+ return true;
+ } catch {
+ // Invalid format
+ value = null;
+ return false;
+ }
+ }
+
+ void TextChanged (object s, EventArgs a)
+ {
+ //ignore if nothing changed
+ if (entry != null) {
+ if (initialText == entry.Text) {
+ return;
+ }
+ initialText = entry.Text;
+ }
+
+ object val;
+ bool isStandard;
+ if (GetValue (out val, out isStandard)) {
+ currentValue = val;
+ if (entry != null)
+ entry.ModifyFg (StateType.Normal);
+ } else {
+ entry.ModifyFg (StateType.Normal, new Color (255, 0, 0));
+ }
+
+ //if it's a standard value, fire the event immediately
+ //else defer till the entry loses focus
+ changed = true;
+ if (isStandard) {
+ FirePendingChangeEvent (null, null);
+ }
+ }
+
+ void FirePendingChangeEvent (object s, EventArgs a)
+ {
+ if (changed) {
+ if (ValueChanged != null) {
+ ValueChanged (this, EventArgs.Empty);
+ }
+ changed = false;
+ }
+ }
+
+ // Gets/Sets the value of the editor. If the editor supports
+ // several value types, it is the responsibility of the editor
+ // to return values with the expected type.
+ public object Value {
+ get { return currentValue; }
+ set {
+ currentValue = value;
+ if (combo != null) {
+ int index;
+ if (FindComboValue (value, out index)) {
+ combo.Active = index;
+ initialText = combo.ActiveText;
+ return;
+ }
+ }
+ if (entry != null) {
+ string val = session.Property.Converter.ConvertToString (session, value);
+ entry.Text = val ?? string.Empty;
+ initialText = entry.Text;
+ }
+ }
+ }
+
+ bool FindComboValue (object val, out int index)
+ {
+ index = 0;
+ TreeIter it;
+ if (!store.GetIterFirst (out it)) {
+ return false;
+ }
+ do {
+ if (object.Equals (ObjectBox.Unbox (store.GetValue (it, 1)), val)) {
+ return true;
+ }
+ index++;
+ } while (store.IterNext (ref it));
+ return false;
+ }
+
+ protected override void OnDestroyed ()
+ {
+ base.OnDestroyed ();
+ ((IDisposable)this).Dispose ();
+ }
+
+ void IDisposable.Dispose ()
+ {
+ if (disposed)
+ return;
+
+ if (entry != null) {
+ TextChanged (null, null);
+ FirePendingChangeEvent (null, null);
+ }
+ disposed = true;
+ }
+
+ // To be fired when the edited value changes.
+ public event EventHandler ValueChanged;
+
+ //GTK# doesn't like it when you put a string in a column of type Object
+ class ObjectBox
+ {
+ public object Value;
+ public static object Box (object o)
+ {
+ if (o is string)
+ return new ObjectBox { Value = o };
+ return o;
+ }
+ public static object Unbox (object o)
+ {
+ var b = o as ObjectBox;
+ if (b == null)
+ return o;
+ return b.Value;
+ }
+ }
+
+ }
+
+ public class StandardValuesSeparatorAttribute : Attribute
+ {
+ readonly string separator;
+
+ public string Separator { get { return separator; } }
+
+ public StandardValuesSeparatorAttribute (string separator)
+ {
+ this.separator = separator;
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/TextEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/TextEditor.cs
deleted file mode 100644
index a553b2d48c..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/TextEditor.cs
+++ /dev/null
@@ -1,306 +0,0 @@
-//
-// TextEditor.cs
-//
-// Author:
-// Lluis Sanchez Gual
-// Michael Hutchinson
-//
-// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.ComponentModel;
-
-using Gtk;
-using Gdk;
-
-namespace MonoDevelop.Components.PropertyGrid.PropertyEditors
-{
- [PropertyEditorType (typeof (string))]
- public class TextEditor: HBox, IPropertyEditor
- {
- EditSession session;
- bool disposed;
- string initialText;
- object currentValue;
- Entry entry;
- ComboBox combo;
- ListStore store;
- bool changed;
-
- public void Initialize (EditSession session)
- {
- this.session = session;
-
- //if standard values are supported by the converter, then
- //we list them in a combo
- if (session.Property.Converter.GetStandardValuesSupported (session))
- {
- store = new ListStore (typeof(string), typeof(object));
-
- //if converter doesn't allow nonstandard values, or can't convert from strings, don't have an entry
- if (session.Property.Converter.GetStandardValuesExclusive (session) || !session.Property.Converter.CanConvertFrom (session, typeof(string))) {
- combo = new ComboBox (store);
- var crt = new CellRendererText ();
- combo.PackStart (crt, true);
- combo.AddAttribute (crt, "text", 0);
- } else {
- combo = new ComboBoxEntry (store, 0);
- entry = ((ComboBoxEntry)combo).Entry;
- entry.HeightRequest = combo.SizeRequest ().Height;
- }
-
- PackStart (combo, true, true, 0);
- combo.Changed += TextChanged;
-
- //fill the list
- foreach (object stdValue in session.Property.Converter.GetStandardValues (session)) {
- store.AppendValues (session.Property.Converter.ConvertToString (session, stdValue), ObjectBox.Box (stdValue));
- }
-
- //a value of "--" gets rendered as a --, if typeconverter marked with UsesDashesForSeparator
- object[] atts = session.Property.Converter.GetType ()
- .GetCustomAttributes (typeof (StandardValuesSeparatorAttribute), true);
- if (atts.Length > 0) {
- string separator = ((StandardValuesSeparatorAttribute)atts[0]).Separator;
- combo.RowSeparatorFunc = (model, iter) => separator == ((string)model.GetValue (iter, 0));
- }
- }
- // no standard values, so just use an entry
- else {
- entry = new Entry ();
- entry.IsEditable = !session.Property.IsReadOnly;
- PackStart (entry, true, true, 0);
- }
-
- //if we have an entry, fix it up a little
- if (entry != null) {
- entry.HasFrame = false;
- entry.Changed += TextChanged;
- entry.FocusOutEvent += FirePendingChangeEvent;
- if (!entry.IsEditable)
- entry.ModifyText (StateType.Normal, entry.Style.Text (Gtk.StateType.Insensitive));
- }
-
- if (entry != null && ShouldShowDialogButton () && entry.IsEditable) {
- var button = new Button ("...");
- PackStart (button, false, false, 0);
- button.Clicked += ButtonClicked;
- }
-
- Spacing = 3;
- ShowAll ();
- }
-
- protected virtual bool ShouldShowDialogButton ()
- {
- //if the object's Localizable, show a dialog, since the text's likely to be more substantial
- var at = (LocalizableAttribute) session.Property.Attributes [typeof(LocalizableAttribute)];
- return (at != null && at.IsLocalizable);
- }
-
- void ButtonClicked (object s, EventArgs a)
- {
- using (var dlg = new TextEditorDialog ()) {
- dlg.TransientFor = Toplevel as Gtk.Window;
- dlg.Text = entry.Text;
- if (dlg.Run () == (int) ResponseType.Ok) {
- entry.Text = dlg.Text;
- TextChanged (null, null);
- }
- }
- }
-
- bool GetValue (out object value, out bool isStandard)
- {
- isStandard = false;
-
- //combo box, just find the active value
- if (store != null && entry == null) {
- TreeIter it;
- if (combo.GetActiveIter (out it)) {
- value = ObjectBox.Unbox (store.GetValue (it, 1));
- isStandard = true;
- return true;
- }
- value = null;
- return false;
- }
-
- var text = entry.Text;
-
- // combo plus entry, try to find matching value
- if (store != null) {
- TreeIter it;
- if (store.GetIterFirst (out it)) {
- do {
- if ((string)store.GetValue (it, 0) == text) {
- value = ObjectBox.Unbox (store.GetValue (it, 1));
- isStandard = true;
- return true;
- }
- } while (store.IterNext (ref it));
- }
- }
-
- //finally, convert the value
- try {
- value = session.Property.Converter.ConvertFromString (session, entry.Text);
- return true;
- } catch {
- // Invalid format
- value = null;
- return false;
- }
- }
-
- void TextChanged (object s, EventArgs a)
- {
- //ignore if nothing changed
- if (entry != null) {
- if (initialText == entry.Text) {
- return;
- }
- initialText = entry.Text;
- }
-
- object val;
- bool isStandard;
- if (GetValue (out val, out isStandard)) {
- currentValue = val;
- if (entry != null)
- entry.ModifyFg (StateType.Normal);
- } else {
- entry.ModifyFg (StateType.Normal, new Color (255, 0, 0));
- }
-
- //if it's a standard value, fire the event immediately
- //else defer till the entry loses focus
- changed = true;
- if (isStandard) {
- FirePendingChangeEvent (null, null);
- }
- }
-
- void FirePendingChangeEvent (object s, EventArgs a)
- {
- if (changed) {
- if (ValueChanged != null) {
- ValueChanged (this, EventArgs.Empty);
- }
- changed = false;
- }
- }
-
- // Gets/Sets the value of the editor. If the editor supports
- // several value types, it is the responsibility of the editor
- // to return values with the expected type.
- public object Value {
- get { return currentValue; }
- set {
- currentValue = value;
- if (combo != null) {
- int index;
- if (FindComboValue (value, out index)) {
- combo.Active = index;
- initialText = combo.ActiveText;
- return;
- }
- }
- if (entry != null) {
- string val = session.Property.Converter.ConvertToString (session, value);
- entry.Text = val ?? string.Empty;
- initialText = entry.Text;
- }
- }
- }
-
- bool FindComboValue (object val, out int index)
- {
- index = 0;
- TreeIter it;
- if (!store.GetIterFirst (out it)) {
- return false;
- }
- do {
- if (object.Equals (ObjectBox.Unbox (store.GetValue (it, 1)), val)) {
- return true;
- }
- index++;
- } while (store.IterNext (ref it));
- return false;
- }
-
- protected override void OnDestroyed ()
- {
- base.OnDestroyed ();
- ((IDisposable)this).Dispose ();
- }
-
- void IDisposable.Dispose ()
- {
- if (disposed)
- return;
-
- if (entry != null) {
- TextChanged (null, null);
- FirePendingChangeEvent (null, null);
- }
- disposed = true;
- }
-
- // To be fired when the edited value changes.
- public event EventHandler ValueChanged;
-
- //GTK# doesn't like it when you put a string in a column of type Object
- class ObjectBox
- {
- public object Value;
- public static object Box (object o)
- {
- if (o is string)
- return new ObjectBox { Value = o };
- return o;
- }
- public static object Unbox (object o)
- {
- var b = o as ObjectBox;
- if (b == null)
- return o;
- return b.Value;
- }
- }
-
- }
-
- public class StandardValuesSeparatorAttribute : Attribute
- {
- readonly string separator;
-
- public string Separator { get { return separator; } }
-
- public StandardValuesSeparatorAttribute (string separator)
- {
- this.separator = separator;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/TextEditorDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/TextEditorDialog.cs
index b7cb6a3f82..be86d5b542 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/TextEditorDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/TextEditorDialog.cs
@@ -48,6 +48,7 @@ namespace MonoDevelop.Components.PropertyGrid.PropertyEditors
sc.Add (textview);
dialog = new Gtk.Dialog ();
+ IdeTheme.ApplyTheme (dialog);
dialog.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel);
dialog.AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok);
dialog.VBox.Add (sc);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/EditorManager.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/EditorManager.cs
index 918ec9865a..19202cda26 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/EditorManager.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/EditorManager.cs
@@ -5,7 +5,7 @@
* editing of all of an object's public properties
*
* Authors:
- * Michael Hutchinson <m.j.hutchinson@gmail.com>
+ * Michael Hutchinson <m.j.hutchinson@gmail.com>
* Lluis Sanchez Gual
*
* Copyright (C) 2005 Michael Hutchinson
@@ -42,11 +42,11 @@ namespace MonoDevelop.Components.PropertyGrid
{
class EditorManager
{
- readonly Dictionary<Type,Type> editors = new Dictionary<Type,Type> ();
+ readonly Dictionary<Type,Type> editors = new Dictionary<Type,Type> ();
readonly Dictionary<Type,Type> inheritingEditors = new Dictionary<Type, Type>();
readonly Dictionary<Type,Type> surrogates = new Dictionary<Type,Type> ();
- static readonly PropertyEditorCell Default = new PropertyEditorCell ();
- static readonly Dictionary<Type,PropertyEditorCell> cellCache = new Dictionary<Type,PropertyEditorCell> ();
+ static readonly PropertyEditorCell Default = new PropertyEditorCell ();
+ static readonly Dictionary<Type,PropertyEditorCell> cellCache = new Dictionary<Type,PropertyEditorCell> ();
public EditorManager ()
{
@@ -57,12 +57,12 @@ namespace MonoDevelop.Components.PropertyGrid
{
foreach (Type t in editorAssembly.GetTypes ()) {
foreach (Attribute currentAttribute in Attribute.GetCustomAttributes (t)) {
- if (currentAttribute.GetType() == typeof (PropertyEditorTypeAttribute)) {
+ if (currentAttribute.GetType() == typeof (PropertyEditorTypeAttribute)) {
var peta = (PropertyEditorTypeAttribute)currentAttribute;
Type editsType = peta.Type;
- if (t.IsSubclassOf (typeof (PropertyEditorCell)))
- if (peta.Inherits)
- inheritingEditors.Add (editsType, t);
+ if (t.IsSubclassOf (typeof (PropertyEditorCell)))
+ if (peta.Inherits)
+ inheritingEditors.Add (editsType, t);
else
editors.Add (editsType, t);
}
@@ -75,105 +75,105 @@ namespace MonoDevelop.Components.PropertyGrid
}
public PropertyEditorCell GetEditor (ITypeDescriptorContext context)
- {
- var cell = context.PropertyDescriptor.GetEditor (typeof(PropertyEditorCell)) as PropertyEditorCell;
- if (cell != null)
- return cell;
-
- Type editorType = GetEditorType (context);
- if (editorType == null)
- return Default;
-
- if (typeof(IPropertyEditor).IsAssignableFrom (editorType)) {
- if (!typeof(Gtk.Widget).IsAssignableFrom (editorType))
- throw new Exception ("The property editor '" + editorType + "' must be a Gtk Widget");
- return Default;
+ {
+ var cell = context.PropertyDescriptor.GetEditor (typeof(PropertyEditorCell)) as PropertyEditorCell;
+ if (cell != null)
+ return cell;
+
+ Type editorType = GetEditorType (context);
+ if (editorType == null)
+ return Default;
+
+ if (typeof(IPropertyEditor).IsAssignableFrom (editorType)) {
+ if (!typeof(Gtk.Widget).IsAssignableFrom (editorType))
+ throw new Exception ("The property editor '" + editorType + "' must be a Gtk Widget");
+ return Default;
}
-
- if (cellCache.TryGetValue (editorType, out cell)) {
+
+ if (cellCache.TryGetValue (editorType, out cell)) {
return cell;
- }
-
- if (!typeof(PropertyEditorCell).IsAssignableFrom (editorType))
- throw new Exception ("The property editor '" + editorType + "' must be a subclass of Stetic.PropertyEditorCell or implement Stetic.IPropertyEditor");
-
- cell = (PropertyEditorCell) Activator.CreateInstance (editorType);
- cellCache [editorType] = cell;
- return cell;
+ }
+
+ if (!typeof(PropertyEditorCell).IsAssignableFrom (editorType))
+ throw new Exception ("The property editor '" + editorType + "' must be a subclass of Stetic.PropertyEditorCell or implement Stetic.IPropertyEditor");
+
+ cell = (PropertyEditorCell) Activator.CreateInstance (editorType);
+ cellCache [editorType] = cell;
+ return cell;
}
-
+
public Type GetEditorType (ITypeDescriptorContext context)
{
var pd = context.PropertyDescriptor;
-
+
//try to find a custom editor
//TODO: Find a way to provide a IWindowsFormsEditorService so this can work directly
//for now, substitute GTK#-based editors
- /*
+ /*
UITypeEditor UITypeEd = (UITypeEditor) pd.GetEditor(typeof (System.Drawing.Design.UITypeEditor));//first, does it have custom editors?
if (UITypeEd != null)
if (surrogates.Contains(UITypeEd.GetType ()))
- return instantiateEditor((Type) surrogates[UITypeEd.GetType()], parentRow);
+ return instantiateEditor((Type) surrogates[UITypeEd.GetType()], parentRow);
*/
//does a registered GTK# editor support this natively?
Type editType = pd.PropertyType;
if (editors.ContainsKey (editType))
- return editors [editType];
-
+ return editors [editType];
+
//editors that edit derived types
- //TODO: find most derived type?
- foreach (var kvp in inheritingEditors)
+ //TODO: find most derived type?
+ foreach (var kvp in inheritingEditors)
if (editType.IsSubclassOf (kvp.Key))
return kvp.Value;
-
- if (pd.PropertyType.IsEnum) {
+
+ if (pd.PropertyType.IsEnum) {
if (pd.PropertyType.IsDefined (typeof(FlagsAttribute), true))
- return typeof(FlagsEditorCell);
- return typeof(EnumerationEditorCell);
- }
-
+ return typeof(FlagsEditorCell);
+ return typeof(EnumerationEditorCell);
+ }
+
//collections with items of single type that aren't just objects
- if (typeof(System.Collections.IList).IsAssignableFrom (editType)) {
- // Iterate through all properties since there may be more than one indexer.
- if (GetCollectionItemType (editType) != null)
- return typeof (CollectionEditor);
- }
+ if (typeof(System.Collections.IList).IsAssignableFrom (editType)) {
+ // Iterate through all properties since there may be more than one indexer.
+ if (GetCollectionItemType (editType) != null)
+ return typeof (CollectionEditor);
+ }
//TODO: support simple SWF collection editor derivatives that just override Types available
// and reflect protected Type[] NewItemTypes {get;} to get types
//if (UITypeEd is System.ComponentModel.Design.CollectionEditor)
- // ((System.ComponentModel.Design.CollectionEditor)UITypeEd).
-
- //can we use a type converter with a built-in editor?
+ // ((System.ComponentModel.Design.CollectionEditor)UITypeEd).
+
+ //can we use a type converter with a built-in editor?
TypeConverter tc = pd.Converter;
//TODO: find best match, not first
foreach (var kvp in editors)
if (tc.CanConvertFrom (kvp.Key) && tc.CanConvertTo (kvp.Key))
- return kvp.Value;
-
- foreach (var kvp in inheritingEditors)
+ return kvp.Value;
+
+ foreach (var kvp in inheritingEditors)
if (tc.CanConvertFrom (kvp.Key) && tc.CanConvertTo (kvp.Key))
return kvp.Value;
if (tc.CanConvertTo (typeof(string)) || tc.GetStandardValuesSupported (context)) {
- return typeof(TextEditor);
+ return typeof(PropertyTextEditor);
}
//nothing found - just display type
return null;
- }
-
- public static Type GetCollectionItemType (Type colType)
- {
- foreach (PropertyInfo member in colType.GetProperties ()) {
- if (member.Name == "Item") {
+ }
+
+ public static Type GetCollectionItemType (Type colType)
+ {
+ foreach (PropertyInfo member in colType.GetProperties ()) {
+ if (member.Name == "Item") {
if (member.PropertyType != typeof (object))
- return member.PropertyType;
- }
- }
+ return member.PropertyType;
+ }
+ }
return null;
}
}
-}
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs
index c727deb565..31ac852af2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyEditorCell.cs
@@ -30,7 +30,7 @@ using System;
using System.ComponentModel;
using Gdk;
using Gtk;
-using Mono.TextEditor;
+using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.Components.PropertyGrid
{
@@ -53,7 +53,7 @@ namespace MonoDevelop.Components.PropertyGrid
get { return context; }
}
- public Widget Container {
+ public Control Container {
get { return container; }
}
@@ -68,9 +68,7 @@ namespace MonoDevelop.Components.PropertyGrid
layout = new Pango.Layout (container.PangoContext);
layout.Width = -1;
-
- Pango.FontDescription des = container.Style.FontDescription.Copy();
- layout.FontDescription = des;
+ layout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11);
this.context = context;
Initialize ();
@@ -161,27 +159,27 @@ namespace MonoDevelop.Components.PropertyGrid
}
}
- /// <summary>
- /// Whether the editor should show a button.
- /// </summary>
- public virtual bool DialogueEdit {
- get { return false; }
- }
-
- /// <summary>
- /// If the property is read-only, is is usually not edited. If the editor
- /// can edit sub-properties of a read-only complex object, this must return true.
- /// <remarks>The default value is false.</remarks>
- /// </summary>
- /// <returns>True if the editor can edit read-only properties</returns>
- public virtual bool EditsReadOnlyObject {
- get { return false; }
- }
-
- public virtual void LaunchDialogue ()
- {
+ /// <summary>
+ /// Whether the editor should show a button.
+ /// </summary>
+ public virtual bool DialogueEdit {
+ get { return false; }
+ }
+
+ /// <summary>
+ /// If the property is read-only, is is usually not edited. If the editor
+ /// can edit sub-properties of a read-only complex object, this must return true.
+ /// <remarks>The default value is false.</remarks>
+ /// </summary>
+ /// <returns>True if the editor can edit read-only properties</returns>
+ public virtual bool EditsReadOnlyObject {
+ get { return false; }
+ }
+
+ public virtual void LaunchDialogue ()
+ {
if (DialogueEdit)
- throw new NotImplementedException ();
+ throw new NotImplementedException ();
}
}
@@ -256,7 +254,7 @@ namespace MonoDevelop.Components.PropertyGrid
get { return context.PropertyDescriptor; }
}
- public Widget Container {
+ public Control Container {
get { return container; }
}
@@ -358,15 +356,15 @@ namespace MonoDevelop.Components.PropertyGrid
this.cell = cell;
Spacing = 3;
PackStart (new CellRendererWidget (cell, context), true, true, 0);
- Label buttonLabel = new Label ();
- buttonLabel.UseMarkup = true;
- buttonLabel.Xpad = 0; buttonLabel.Ypad = 0;
- buttonLabel.Markup = "<span size=\"small\">...</span>";
- Button dialogueButton = new Button (buttonLabel);
- dialogueButton.Clicked += DialogueButtonClicked;
+ Label buttonLabel = new Label ();
+ buttonLabel.UseMarkup = true;
+ buttonLabel.Xpad = 0; buttonLabel.Ypad = 0;
+ buttonLabel.Markup = "<span size=\"small\">...</span>";
+ Button dialogueButton = new Button (buttonLabel);
+ dialogueButton.Clicked += DialogueButtonClicked;
PackStart (dialogueButton, false, false, 0);
this.ModifyBg (StateType.Normal, this.Style.White);
- ShowAll ();
+ ShowAll ();
}
void DialogueButtonClicked (object s, EventArgs args)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs
index b3914cc0ec..14b676134e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs
@@ -44,6 +44,7 @@ using MonoDevelop.Core;
using MonoDevelop.Components.PropertyGrid.PropertyEditors;
using System.Collections.Generic;
using System.Linq;
+using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.Components.PropertyGrid
{
@@ -88,25 +89,27 @@ namespace MonoDevelop.Components.PropertyGrid
base.PackStart (tb, false, false, 0);
toolbar = tb;
- catButton = new RadioButton ((Gtk.RadioButton)null);
+ catButton = new RadioButton ((Gtk.RadioButton)null);
+ catButton.Name = "MonoDevelop.PropertyGridToolbar.GtkRadioButton";
catButton.DrawIndicator = false;
catButton.Relief = ReliefStyle.None;
- catButton.Image = new Gtk.Image (MonoDevelop.Ide.Gui.Stock.GroupByCategory, IconSize.Menu);
+ catButton.Image = new ImageView (MonoDevelop.Ide.Gui.Stock.GroupByCategory, IconSize.Menu);
catButton.Image.Show ();
catButton.TooltipText = GettextCatalog.GetString ("Sort in categories");
catButton.Toggled += new EventHandler (toolbarClick);
toolbar.Insert (catButton, 0);
alphButton = new RadioButton (catButton);
+ alphButton.Name = "MonoDevelop.PropertyGridToolbar.GtkRadioButton";
alphButton.DrawIndicator = false;
alphButton.Relief = ReliefStyle.None;
- alphButton.Image = new Gtk.Image (MonoDevelop.Ide.Gui.Stock.SortAlphabetically, IconSize.Menu);
+ alphButton.Image = new ImageView (MonoDevelop.Ide.Gui.Stock.SortAlphabetically, IconSize.Menu);
alphButton.Image.Show ();
alphButton.TooltipText = GettextCatalog.GetString ("Sort alphabetically");
alphButton.Clicked += new EventHandler (toolbarClick);
toolbar.Insert (alphButton, 1);
- catButton.Active = true;
+ catButton.Active = true;
#endregion
@@ -270,7 +273,7 @@ namespace MonoDevelop.Components.PropertyGrid
void UpdateTabs ()
{
bool visible = currentObject != null && toolbar.Children.OfType<TabRadioToolButton> ().Count (but => but.Tab.CanExtend (currentObject)) > 1;
- foreach (var w in toolbar.Children.OfType<TabRadioToolButton> ())
+ foreach (var w in toolbar.Children.OfType<TabRadioToolButton> ())
w.Visible = visible;
if (tabSectionSeparator != null)
tabSectionSeparator.Visible = visible;
@@ -279,7 +282,8 @@ namespace MonoDevelop.Components.PropertyGrid
//TODO: add more intelligence for editing state etc. Maybe need to know which property has changed, then
//just update that
public void Refresh ()
- {
+ {
+ Update ();
QueueDraw ();
}
@@ -376,11 +380,8 @@ namespace MonoDevelop.Components.PropertyGrid
descTextView.HeightRequest = 70;
descTextView.Editable = false;
descTextView.LeftMargin = 5;
- descTextView.RightMargin = 5;
-
- Pango.FontDescription font = Style.FontDescription.Copy ();
- font.Size = (font.Size * 8) / 10;
- descTextView.ModifyFont (font);
+ descTextView.RightMargin = 5;
+ descTextView.ModifyFont (FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11));
textScroll.Add (descTextView);
@@ -449,6 +450,7 @@ namespace MonoDevelop.Components.PropertyGrid
DrawIndicator = false;
Relief = ReliefStyle.None;
NoShowAll = true;
+ Name = "MonoDevelop.PropertyGridToolbar.GtkRadioButton";
}
public PropertyTab Tab;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs
index f6e785dec9..30feb1e47f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs
@@ -30,8 +30,8 @@ using System.ComponentModel;
using System.Collections.Generic;
using Cairo;
using System.Linq;
-using Mono.TextEditor;
using MonoDevelop.Core;
+using MonoDevelop.Ide.Gui;
namespace MonoDevelop.Components.PropertyGrid
{
@@ -54,9 +54,6 @@ namespace MonoDevelop.Components.PropertyGrid
const int PropertyLeftPadding = 8;
const int PropertyContentLeftPadding = 8;
const int PropertyIndent = 8;
- static readonly Cairo.Color LabelBackgroundColor = new Cairo.Color (250d/255d, 250d/255d, 250d/255d);
- static readonly Cairo.Color DividerColor = new Cairo.Color (217d/255d, 217d/255d, 217d/255d);
- static readonly Cairo.Color CategoryLabelColor = new Cairo.Color (128d/255d, 128d/255d, 128d/255d);
const uint animationTimeSpan = 10;
const int animationStepSize = 20;
@@ -448,15 +445,12 @@ namespace MonoDevelop.Components.PropertyGrid
using (Cairo.Context ctx = CairoHelper.Create (evnt.Window)) {
int dx = (int)((double)Allocation.Width * dividerPosition);
ctx.LineWidth = 1;
- ctx.Rectangle (0, 0, dx, Allocation.Height);
- ctx.SetSourceColor (LabelBackgroundColor);
- ctx.Fill ();
- ctx.Rectangle (dx, 0, Allocation.Width - dx, Allocation.Height);
- ctx.SetSourceRGB (1, 1, 1);
+ ctx.Rectangle (0, 0, Allocation.Width, Allocation.Height);
+ ctx.SetSourceColor (Styles.PropertyPadLabelBackgroundColor.ToCairoColor ());
ctx.Fill ();
ctx.MoveTo (dx + 0.5, 0);
ctx.RelLineTo (0, Allocation.Height);
- ctx.SetSourceColor (DividerColor);
+ ctx.SetSourceColor (Styles.PropertyPadDividerColor.ToCairoColor ());
ctx.Stroke ();
int y = 0;
@@ -482,12 +476,8 @@ namespace MonoDevelop.Components.PropertyGrid
if (r.IsCategory) {
var rh = h + CategoryTopBottomPadding*2;
ctx.Rectangle (0, y, Allocation.Width, rh);
- using (var gr = new LinearGradient (0, y, 0, rh)) {
- gr.AddColorStop (0, new Cairo.Color (248d/255d, 248d/255d, 248d/255d));
- gr.AddColorStop (1, new Cairo.Color (240d/255d, 240d/255d, 240d/255d));
- ctx.SetSource (gr);
- ctx.Fill ();
- }
+ ctx.SetSourceColor (Styles.PadCategoryBackgroundColor.ToCairoColor ());
+ ctx.Fill ();
if (lastCategory == null || lastCategory.Expanded || lastCategory.AnimatingExpand) {
ctx.MoveTo (0, y + 0.5);
@@ -495,11 +485,11 @@ namespace MonoDevelop.Components.PropertyGrid
}
ctx.MoveTo (0, y + rh - 0.5);
ctx.LineTo (Allocation.Width, y + rh - 0.5);
- ctx.SetSourceColor (DividerColor);
+ ctx.SetSourceColor (Styles.PadCategoryBorderColor.ToCairoColor ());
ctx.Stroke ();
ctx.MoveTo (x, y + CategoryTopBottomPadding);
- ctx.SetSourceColor (CategoryLabelColor);
+ ctx.SetSourceColor (Styles.PadCategoryLabelColor.ToCairoColor ());
Pango.CairoHelper.ShowLayout (ctx, layout);
var img = r.Expanded ? discloseUp : discloseDown;
@@ -557,10 +547,10 @@ namespace MonoDevelop.Components.PropertyGrid
// Repaing the background because the cairo clip doesn't work for gdk primitives
int dx = (int)((double)Allocation.Width * dividerPosition);
ctx.Rectangle (0, y, dx, Allocation.Height - y);
- ctx.SetSourceColor (LabelBackgroundColor);
+ ctx.SetSourceColor (Styles.PropertyPadLabelBackgroundColor.ToCairoColor ());
ctx.Fill ();
ctx.Rectangle (dx + 1, y, Allocation.Width - dx - 1, Allocation.Height - y);
- ctx.SetSourceRGB (1, 1, 1);
+ ctx.SetSourceColor (Styles.BrowserPadBackground.ToCairoColor());
ctx.Fill ();
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkColors.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkColors.cs
index 8cc8de1800..b8f578ff10 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkColors.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkColors.cs
@@ -43,7 +43,7 @@ namespace MonoDevelop.Components.Theming
Foreground
}
- public class GtkColors
+ class GtkColors
{
private Cairo.Color[] gtk_colors;
private Widget widget;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs
index 95af7f02ab..a59672a7cc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/GtkTheme.cs
@@ -29,11 +29,10 @@
using System;
using Cairo;
using Gtk;
-using Mono.TextEditor;
namespace MonoDevelop.Components.Theming
{
- public class GtkTheme : Theme
+ class GtkTheme : Theme
{
private Cairo.Color rule_color;
private Cairo.Color border_color;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/Theme.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/Theme.cs
index 9c9e23af08..123786d761 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/Theme.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/Theme.cs
@@ -41,7 +41,7 @@ namespace MonoDevelop.Components.Theming
Descending
}
- public abstract class Theme
+ abstract class Theme
{
private static Cairo.Color black = new Cairo.Color (0, 0, 0);
private Stack<ThemeContext> contexts = new Stack<ThemeContext> ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/ThemeContext.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/ThemeContext.cs
index 2ab2799458..2ac3a795ec 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/ThemeContext.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/ThemeContext.cs
@@ -31,7 +31,7 @@ using Cairo;
namespace MonoDevelop.Components.Theming
{
- public class ThemeContext
+ class ThemeContext
{
private double radius = 3.0;
public double Radius {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/ThemeEngine.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/ThemeEngine.cs
index 044079e17b..d600082cd9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/ThemeEngine.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Theming/ThemeEngine.cs
@@ -28,7 +28,7 @@ using System;
namespace MonoDevelop.Components.Theming
{
- public static class ThemeEngine
+ static class ThemeEngine
{
private static Type theme_type;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ButtonEvent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ButtonEvent.cs
new file mode 100644
index 0000000000..7896d1ec4d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ButtonEvent.cs
@@ -0,0 +1,63 @@
+//
+// ButtonEventArgs.cs
+//
+// Author:
+// therzok <marius.ungureanu@xamarin.com>
+//
+// Copyright (c) 2015 therzok
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Components
+{
+ public class ButtonEvent : Xwt.ButtonEventArgs
+ {
+ public ButtonEvent ()
+ {
+ }
+
+ Gdk.EventButton native;
+ new bool Handled { get; set; }
+
+ public static implicit operator ButtonEvent (Gdk.EventButton args)
+ {
+ int numPress;
+ if (args.Type == Gdk.EventType.TwoButtonPress)
+ numPress = 2;
+ else if (args.Type == Gdk.EventType.ThreeButtonPress)
+ numPress = 3;
+ else
+ numPress = 1;
+ return new ButtonEvent {
+ native = args,
+ X = args.X,
+ Y = args.Y,
+ Button = (Xwt.PointerButton)args.Button,
+ MultiplePress = numPress,
+ };
+ }
+
+ public static implicit operator Gdk.EventButton (ButtonEvent args)
+ {
+ return args.native;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CairoExtensions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CairoExtensions.cs
index 0b948cd7d0..6fe1fceea4 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CairoExtensions.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CairoExtensions.cs
@@ -33,7 +33,6 @@ using System.Runtime.InteropServices;
using Gdk;
using Cairo;
using MonoDevelop.Core;
-using Mono.TextEditor;
namespace MonoDevelop.Components
{
@@ -543,6 +542,11 @@ namespace MonoDevelop.Components
return img;
}
+ public static Cairo.Color WithAlpha (Cairo.Color c, double alpha)
+ {
+ return new Cairo.Color (c.R, c.G, c.B, alpha);
+ }
+
public static Cairo.Color MultiplyAlpha (this Cairo.Color self, double alpha)
{
return new Cairo.Color (self.R, self.G, self.B, self.A * alpha);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererComboBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererComboBox.cs
index 687fc81019..860f96ca4a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererComboBox.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererComboBox.cs
@@ -42,7 +42,7 @@ namespace MonoDevelop.Components
{
Mode |= Gtk.CellRendererMode.Editable;
Gtk.ComboBox dummyEntry = Gtk.ComboBox.NewText ();
- rowHeight = dummyEntry.SizeRequest ().Height;
+ rowHeight = dummyEntry.SizeRequest ().Height + (2 * dummyEntry.Style?.YThickness ?? 0);
Ypad = 0;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs
index 3cd15e12d5..cf03ee4150 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CellRendererImage.cs
@@ -42,7 +42,7 @@ namespace MonoDevelop.Components
/// Image to be used to represent "no image". This is necessary since GLib.Value can't hold
/// null values for object that are not of subclasses of GLib.Object
/// </summary>
- public static readonly Xwt.Drawing.Image NullImage = ImageService.GetIcon ("md-empty");
+ public static readonly Xwt.Drawing.Image NullImage = ImageService.GetIcon ("md-empty", Gtk.IconSize.Menu);
public CellRendererImage ()
{
@@ -133,6 +133,11 @@ namespace MonoDevelop.Components
if (img == null)
return;
+ if ((flags & Gtk.CellRendererState.Selected) != 0)
+ img = img.WithStyles ("sel");
+ if (!img.HasFixedSize)
+ img = img.WithSize (Gtk.IconSize.Menu);
+
using (var ctx = Gdk.CairoHelper.Create (window)) {
var x = cell_area.X + cell_area.Width / 2 - (int)(img.Width / 2);
var y = cell_area.Y + cell_area.Height / 2 - (int)(img.Height / 2);
@@ -156,14 +161,18 @@ namespace MonoDevelop.Components
{
var img = GetImage ();
if (img != null) {
- width = (int)img.Width;
- height = (int)img.Height;
+ if (img.HasFixedSize) {
+ width = (int)img.Width;
+ height = (int)img.Height;
+ } else
+ Gtk.IconSize.Menu.GetSize(out width, out height);
} else
width = height = 0;
width += (int)Xpad * 2;
height += (int)Ypad * 2;
- x_offset = y_offset = 0;
+ x_offset = (int)(cell_area.Width / 2 - (width / 2));
+ y_offset = (int)(cell_area.Height / 2 - (height / 2));
}
Image GetImage ()
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactDialog.cs
index ac218f22ec..1f2a461cea 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactDialog.cs
@@ -28,7 +28,7 @@ using Gtk;
namespace MonoDevelop.Components
{
- public class CompactDialog: Dialog
+ public class CompactDialog: Gtk.Dialog
{
public CompactDialog ()
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs
index aef0dcf873..e6f0c23f4b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/CompactScrolledWindow.cs
@@ -25,7 +25,6 @@
// THE SOFTWARE.
using System;
-using Mono.TextEditor;
namespace MonoDevelop.Components
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenu.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenu.cs
index 1067df0aa6..6cacbc4ff9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenu.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenu.cs
@@ -34,7 +34,7 @@ namespace MonoDevelop.Components
public ContextMenu ()
{
- items = new ContextMenuItemCollection (this);
+ items = new ContextMenuItemCollection ();
}
public ContextMenuItemCollection Items {
@@ -62,14 +62,48 @@ namespace MonoDevelop.Components
public void Show (Gtk.Widget parent, Gdk.EventButton evt)
{
+ Show (parent, evt, null);
+ }
+
+ public void Show (Gtk.Widget parent, Gdk.EventButton evt, Action closeHandler)
+ {
+ #if MAC
+ if (Platform.IsMac) {
+ ContextMenuExtensionsMac.ShowContextMenu (parent, evt, this, closeHandler);
+ return;
+ }
+ #endif
+
+ ContextMenuExtensionsGtk.ShowContextMenu (parent, evt, this, closeHandler);
+ }
+
+ public void Show (Gtk.Widget parent, int x, int y, Action closeHandler, bool selectFirstItem = false)
+ {
#if MAC
if (Platform.IsMac) {
- ContextMenuExtensionsMac.ShowContextMenu (parent, evt, this);
+ int tx, ty;
+
+ // x, y are in gtk coordinates, so they need to be translated for Cocoa.
+ parent.TranslateCoordinates (parent.Toplevel, x, y, out tx, out ty);
+ ContextMenuExtensionsMac.ShowContextMenu (parent, tx, ty, this, closeHandler, selectFirstItem);
return;
}
#endif
- ContextMenuExtensionsGtk.ShowContextMenu (parent, evt, this);
+ ContextMenuExtensionsGtk.ShowContextMenu (parent, x, y, this, closeHandler, selectFirstItem);
+ }
+
+
+ public void Show (Gtk.Widget parent, int x, int y)
+ {
+ Show (parent, x, y, null);
+ }
+
+
+
+ public void Add (ContextMenuItem menuItem)
+ {
+ items.Add (menuItem);
}
}
} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs
index 1e4f383f88..468b09d7d5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsGtk.cs
@@ -53,7 +53,7 @@ namespace MonoDevelop.Components
ShowContextMenu (parent, x, y, menu, null);
}
- public static void ShowContextMenu (Gtk.Widget parent, int x, int y, ContextMenu menu, Action closeHandler)
+ public static void ShowContextMenu (Gtk.Widget parent, int x, int y, ContextMenu menu, Action closeHandler, bool selectFirstItem = false)
{
if (parent == null)
throw new ArgumentNullException ("parent");
@@ -62,6 +62,8 @@ namespace MonoDevelop.Components
var gtkMenu = FromMenu (menu, closeHandler);
gtkMenu.ShowAll ();
+ if (selectFirstItem && gtkMenu.Children.Length > 0)
+ gtkMenu.SelectItem (gtkMenu.Children[0]);
ShowContextMenu (parent, x, y, gtkMenu);
}
@@ -72,7 +74,7 @@ namespace MonoDevelop.Components
if (menu == null)
throw new ArgumentNullException ("menu");
- Mono.TextEditor.GtkWorkarounds.ShowContextMenu (menu, parent, evt);
+ GtkWorkarounds.ShowContextMenu (menu, parent, evt);
}
public static void ShowContextMenu (Gtk.Widget parent, int x, int y, Gtk.Menu menu)
@@ -82,7 +84,7 @@ namespace MonoDevelop.Components
if (menu == null)
throw new ArgumentNullException ("menu");
- Mono.TextEditor.GtkWorkarounds.ShowContextMenu (menu, parent, x, y, parent.Allocation);
+ GtkWorkarounds.ShowContextMenu (menu, parent, x, y, parent.Allocation);
}
static Gtk.MenuItem CreateMenuItem (ContextMenuItem item)
@@ -125,7 +127,7 @@ namespace MonoDevelop.Components
var img = new ImageView (item.Image);
img.ShowAll ();
imageItem.Image = img;
- GtkWorkarounds.ForceImageOnMenuItem (imageItem);
+ Xwt.GtkBackend.GtkWorkarounds.ForceImageOnMenuItem (imageItem);
}
}
@@ -148,4 +150,4 @@ namespace MonoDevelop.Components
return result;
}
}
-} \ No newline at end of file
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsMac.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsMac.cs
index 3fd766ba13..5f3223ac92 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsMac.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsMac.cs
@@ -27,6 +27,7 @@
using System;
#if MAC
using AppKit;
+using Foundation;
#endif
namespace MonoDevelop.Components
@@ -34,24 +35,34 @@ namespace MonoDevelop.Components
#if MAC
static class ContextMenuExtensionsMac
{
- public static void ShowContextMenu (Gtk.Widget parent, Gdk.EventButton evt, ContextMenu menu)
+ public static void ShowContextMenu (Gtk.Widget parent, Gdk.EventButton evt, ContextMenu menu, Action closeHandler)
{
if (parent == null)
throw new ArgumentNullException ("parent");
if (menu == null)
throw new ArgumentNullException ("menu");
- var nsMenu = FromMenu (menu);
+ var nsMenu = FromMenu (menu, closeHandler);
ShowContextMenu (parent, evt, nsMenu);
}
+ public static void ShowContextMenu (Gtk.Widget parent, Gdk.EventButton evt, ContextMenu menu)
+ {
+ ShowContextMenu (parent, evt, menu, null);
+ }
+
+ public static void ShowContextMenu (Gtk.Widget parent, int x, int y, ContextMenu menu, Action closeHandler, bool selectFirstItem = false)
+ {
+ var nsMenu = FromMenu (menu, closeHandler);
+ ShowContextMenu (parent, x, y, nsMenu, selectFirstItem);
+ }
+
public static void ShowContextMenu (Gtk.Widget parent, int x, int y, ContextMenu menu)
{
- var nsMenu = FromMenu (menu);
- ShowContextMenu (parent, x, y, nsMenu);
+ ShowContextMenu (parent, x, y, menu, null);
}
- public static void ShowContextMenu (Gtk.Widget parent, int x, int y, NSMenu menu)
+ public static void ShowContextMenu (Gtk.Widget parent, int x, int y, NSMenu menu, bool selectFirstItem = false)
{
if (parent == null)
throw new ArgumentNullException ("parent");
@@ -78,15 +89,21 @@ namespace MonoDevelop.Components
titleBarOffset = MonoDevelop.Components.Mac.GtkMacInterop.GetTitleBarHeight () + 12;
}
- var pt = new CoreGraphics.CGPoint (x, nswindow.Frame.Height - y - titleBarOffset);
+ if (selectFirstItem) {
+ var pt = new CoreGraphics.CGPoint (x, y);
+ menu.PopUpMenu (menu.ItemAt (0), pt, nsview);
+ } else {
+ var pt = new CoreGraphics.CGPoint (x, nswindow.Frame.Height - y - titleBarOffset);
+
+ var tmp_event = NSEvent.MouseEvent (NSEventType.LeftMouseDown,
+ pt,
+ 0, 0,
+ nswindow.WindowNumber,
+ null, 0, 0, 0);
+ NSMenu.PopUpContextMenu (menu, tmp_event, nsview);
+ }
- var tmp_event = NSEvent.MouseEvent (NSEventType.LeftMouseDown,
- pt,
- 0, 0,
- nswindow.WindowNumber,
- null, 0, 0, 0);
- NSMenu.PopUpContextMenu (menu, tmp_event, nsview);
});
}
@@ -105,7 +122,7 @@ namespace MonoDevelop.Components
return NSMenuItem.SeparatorItem;
}
- var menuItem = new NSMenuItem (item.Label, (s, e) => item.Click ());
+ var menuItem = new NSMenuItem (item.Label.Replace ("_",""), (s, e) => item.Click ());
menuItem.Hidden = !item.Visible;
menuItem.Enabled = item.Sensitive;
@@ -120,15 +137,29 @@ namespace MonoDevelop.Components
}
if (item.SubMenu != null && item.SubMenu.Items.Count > 0) {
- menuItem.Submenu = FromMenu (item.SubMenu);
+ menuItem.Submenu = FromMenu (item.SubMenu, null);
}
return menuItem;
}
- static NSMenu FromMenu (ContextMenu menu)
+ class ContextMenuDelegate : NSObject
+ {
+ public Action CloseHandler { get; set; }
+
+ [Export ("menuDidClose:")]
+ void MenuDidClose (NSMenu menu)
+ {
+ if (CloseHandler != null) {
+ CloseHandler ();
+ }
+ }
+ }
+
+ static NSMenu FromMenu (ContextMenu menu, Action closeHandler)
{
var result = new NSMenu () { AutoEnablesItems = false };
+ result.WeakDelegate = new ContextMenuDelegate { CloseHandler = closeHandler };
foreach (var menuItem in menu.Items) {
var item = CreateMenuItem (menuItem);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuItem.cs
index cf5666dccc..37d843cbbd 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuItem.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuItem.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System;
+using MonoDevelop.Core;
namespace MonoDevelop.Components
{
@@ -64,7 +65,11 @@ namespace MonoDevelop.Components
public ContextMenuItem (string label) : this()
{
+ #if MAC
+ Label = label.Replace ("_", "");
+ #else
Label = label;
+ #endif
}
public bool IsSeparator {
@@ -120,7 +125,11 @@ namespace MonoDevelop.Components
internal void Click ()
{
- DoClick ();
+ try {
+ DoClick ();
+ } catch (Exception ex) {
+ LoggingService.LogError ("Exception in context menu", ex);
+ }
}
protected virtual void DoClick ()
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuItemCollection.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuItemCollection.cs
index 9e3b472014..848b7970b1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuItemCollection.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuItemCollection.cs
@@ -31,11 +31,8 @@ namespace MonoDevelop.Components
{
public class ContextMenuItemCollection: Collection<ContextMenuItem>
{
- readonly ContextMenu parent;
-
- internal ContextMenuItemCollection (ContextMenu parent)
+ internal ContextMenuItemCollection ()
{
- this.parent = parent;
}
}
} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuTreeView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuTreeView.cs
index b6fce1f1b5..c1ec98b799 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuTreeView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuTreeView.cs
@@ -24,7 +24,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using Mono.TextEditor;
namespace MonoDevelop.Components
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs
index dda73fc351..930a6875db 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Control.cs
@@ -24,6 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using System.Collections.Generic;
using MonoDevelop.Components.Commands;
#if MAC
@@ -33,25 +34,24 @@ using MonoDevelop.Components.Mac;
namespace MonoDevelop.Components
{
- public class Control: IDisposable
+ public class Control : IDisposable, ICommandRouter
{
- object nativeWidget;
+ internal static Dictionary<object, WeakReference<Control>> cache = new Dictionary<object, WeakReference<Control>> ();
+ internal object nativeWidget;
protected Control ()
{
}
- public Control (object widget)
+ Control (object widget)
{
+ if (widget == null)
+ throw new ArgumentNullException (nameof (widget));
this.nativeWidget = widget;
+ cache.Add (nativeWidget, new WeakReference<Control> (this));
}
- ~Control ()
- {
- Dispose (false);
- }
-
- protected virtual object CreateNativeWidget ()
+ protected virtual object CreateNativeWidget<T> ()
{
throw new NotSupportedException ();
}
@@ -59,20 +59,34 @@ namespace MonoDevelop.Components
public T GetNativeWidget<T> ()
{
if (nativeWidget == null) {
- var w = CreateNativeWidget ();
- if (!(w is T))
- w = ConvertToType (typeof(T), w);
+ var toCache = this;
+ var w = CreateNativeWidget<T> ();
+ if (!(w is T)) {
+ var temp = w as Control;
+ while (temp != null) {
+ w = temp.GetNativeWidget<T> ();
+ temp = w as Control;
+ }
+ w = ConvertToType (typeof (T), w);
+ }
if (w is Gtk.Widget) {
- var c = new CommandRouterContainer ((Gtk.Widget)w, this, true);
+ var gtkWidget = (Gtk.Widget)w;
+ var c = new CommandRouterContainer (gtkWidget, this, true);
+ c.FocusChain = new [] { gtkWidget };
c.Show ();
nativeWidget = c;
- c.Destroyed += delegate {
- GC.SuppressFinalize (this);
- Dispose (true);
- };
- }
- else
+ c.Destroyed += OnGtkDestroyed;
+ toCache = c;
+ } else {
nativeWidget = w;
+ }
+ WeakReference<Control> cached;
+ Control target;
+ if (cache.TryGetValue (nativeWidget, out cached) && cached.TryGetTarget (out target)) {
+ if (target != toCache)
+ throw new Exception ();
+ } else
+ cache.Add (nativeWidget, new WeakReference<Control> (toCache));
}
if (nativeWidget is T)
return (T)nativeWidget;
@@ -80,32 +94,81 @@ namespace MonoDevelop.Components
throw new NotSupportedException ();
}
+ void OnGtkDestroyed (object sender, EventArgs args)
+ {
+ GC.SuppressFinalize (this);
+ Dispose (true);
+ }
+
static object ConvertToType (Type t, object w)
{
if (t.IsInstanceOfType (w))
return w;
- #if MAC
- if (w is NSView && t == typeof(Gtk.Widget)) {
+#if MAC
+ if (w is NSView && t == typeof (Gtk.Widget)) {
var ww = GtkMacInterop.NSViewToGtkWidget ((NSView)w);
ww.Show ();
return ww;
}
- if (w is Gtk.Widget && t == typeof(NSView)) {
+ if (w is Gtk.Widget && t == typeof (NSView)) {
return new GtkEmbed ((Gtk.Widget)w);
}
- #endif
+#endif
throw new NotSupportedException ();
}
+#if MAC
+ public static implicit operator NSView (Control d)
+ {
+ return d.GetNativeWidget<NSView> ();
+ }
+
+ public static implicit operator Control (NSView d)
+ {
+ if (d == null)
+ return null;
+
+ return GetImplicit<Control, NSView> (d) ?? new Control (d);
+ }
+#endif
+
public static implicit operator Gtk.Widget (Control d)
{
- return d.GetNativeWidget<Gtk.Widget> ();
+ return d?.GetNativeWidget<Gtk.Widget> ();
}
public static implicit operator Control (Gtk.Widget d)
{
- return new Control (d);
+ if (d == null)
+ return null;
+
+ var control = GetImplicit<Control, Gtk.Widget>(d);
+ if (control == null) {
+ control = new Control (d);
+ d.Destroyed += delegate {
+ GC.SuppressFinalize (control);
+ control.Dispose (true);
+ };
+ }
+ return control;
+ }
+
+ internal static T GetImplicit<T, U> (U native) where T : Control where U : class
+ {
+ WeakReference<Control> cached;
+ Control target;
+
+ if (cache.TryGetValue (native, out cached)) {
+ if (cached.TryGetTarget (out target)) {
+ var ret = target as T;
+ if (ret != null)
+ return ret;
+ }
+
+ cache.Remove (native);
+ }
+ return null;
}
public void GrabFocus ()
@@ -113,23 +176,51 @@ namespace MonoDevelop.Components
// TODO
}
+
+ public bool HasFocus {
+ get
+ {
+ // TODO
+ if (nativeWidget is Gtk.Widget)
+ return ((Gtk.Widget)nativeWidget).HasFocus;
+ return false;
+ }
+ }
+
public void Dispose ()
{
- if (nativeWidget is Gtk.Widget) {
- ((Gtk.Widget)nativeWidget).Destroy ();
- return;
+ var gtkWidget = nativeWidget as Gtk.Widget;
+ if (gtkWidget != null) {
+ gtkWidget.Destroy ();
+ gtkWidget.Dispose ();
}
- #if MAC
+#if MAC
else if (nativeWidget is NSView)
((NSView)nativeWidget).Dispose ();
- #endif
+#endif
- GC.SuppressFinalize (this);
Dispose (true);
}
protected virtual void Dispose (bool disposing)
{
+ if (nativeWidget != null)
+ cache.Remove (nativeWidget);
+
+ var gtkWidget = nativeWidget as Gtk.Widget;
+ if (gtkWidget != null) {
+ gtkWidget.Destroyed -= OnGtkDestroyed;
+ }
+ }
+
+ protected virtual object GetNextCommandTarget ()
+ {
+ return nativeWidget;
+ }
+
+ object ICommandRouter.GetNextCommandTarget ()
+ {
+ return GetNextCommandTarget ();
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Dialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Dialog.cs
new file mode 100644
index 0000000000..8b70e3bf4b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Dialog.cs
@@ -0,0 +1,67 @@
+//
+// Dialog.cs
+//
+// Author:
+// therzok <marius.ungureanu@xamarin.com>
+//
+// Copyright (c) 2015 therzok
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Components
+{
+ public class Dialog : Window
+ {
+ protected Dialog ()
+ {
+ }
+
+ Dialog (object widget)
+ {
+ if (widget == null)
+ throw new ArgumentNullException (nameof (widget));
+
+ this.nativeWidget = widget;
+ cache.Add (widget, new WeakReference<Control> (this));
+ }
+
+ public static implicit operator Gtk.Dialog (Dialog d)
+ {
+ return d?.GetNativeWidget<Gtk.Dialog> ();
+ }
+
+ public static implicit operator Dialog (Gtk.Dialog d)
+ {
+ if (d == null)
+ return null;
+
+ var dialog = GetImplicit<Dialog, Gtk.Dialog>(d);
+ if (dialog == null) {
+ dialog = new Dialog (d);
+ d.Destroyed += delegate {
+ GC.SuppressFinalize (dialog);
+ dialog.Dispose (true);
+ };
+ }
+ return dialog;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs
index 1f02fdce8a..9c950c757a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBox.cs
@@ -29,7 +29,6 @@ using System.ComponentModel;
using Gtk;
using MonoDevelop.Ide;
-using Mono.TextEditor;
namespace MonoDevelop.Components
{
@@ -142,12 +141,12 @@ namespace MonoDevelop.Components
window.WidthRequest = Allocation.Width;
int width, height;
window.GetSizeRequest (out width, out height);
- Gdk.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtPoint (dx, dy));
+ Xwt.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen.Number, Screen.GetMonitorAtPoint (dx, dy));
if (dy + height > geometry.Bottom)
dy = oy + this.Allocation.Y - height;
if (dx + width > geometry.Right)
- dx = geometry.Right - width;
+ dx = (int)geometry.Right - width;
window.Move (dx, dy);
window.ShowAll ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs
index e34fee447f..d04a69c2d8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/DropDownBoxListWindow.cs
@@ -28,10 +28,11 @@ using System;
using MonoDevelop.Ide;
using Gtk;
using System.Text;
+using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.Components
{
- public class DropDownBoxListWindow : Window
+ public class DropDownBoxListWindow : Gtk.Window
{
readonly ScrolledWindow vScrollbar;
internal ListWidget list;
@@ -58,7 +59,15 @@ namespace MonoDevelop.Components
set {
list.MaxVisibleRows = value;
list.CalcVisibleRows ();
- SetSizeRequest (list.WidthRequest, list.HeightRequest);
+ SetSizeRequest (list.WidthRequest + WidthModifier, list.HeightRequest);
+ }
+ }
+
+ const int padding = 5;
+
+ int WidthModifier {
+ get {
+ return padding + 2 * (int)BorderWidth;
}
}
@@ -81,7 +90,7 @@ namespace MonoDevelop.Components
Destroy ();
}
};
- SetSizeRequest (list.WidthRequest, list.HeightRequest);
+ SetSizeRequest (list.WidthRequest + WidthModifier, list.HeightRequest);
vScrollbar = new ScrolledWindow ();
vScrollbar.VScrollbar.SizeAllocated += (o, args) => {
var minWidth = list.WidthRequest + args.Allocation.Width;
@@ -200,8 +209,9 @@ namespace MonoDevelop.Components
internal class ListWidget: DrawingArea
{
- const int margin = 0;
+ const int leftXAlignment = 1;
const int padding = 4;
+ const int iconTextDistance = 4;
int listWidth = 300;
Pango.Layout layout;
readonly DropDownBoxListWindow win;
@@ -378,12 +388,12 @@ namespace MonoDevelop.Components
int winWidth, winHeight;
GdkWindow.GetSize (out winWidth, out winHeight);
- int lineWidth = winWidth - margin * 2;
- const int xpos = margin + padding;
+ int lineWidth = winWidth - leftXAlignment * 2;
+ const int xpos = leftXAlignment + padding;
int n = (int)(vAdjustment.Value / rowHeight);
- int ypos = (int)(margin + n * rowHeight - vAdjustment.Value);
- while (ypos < winHeight - margin && n < win.DataProvider.IconCount) {
+ int ypos = (int)(leftXAlignment + n * rowHeight - vAdjustment.Value);
+ while (ypos < winHeight - leftXAlignment && n < win.DataProvider.IconCount) {
string text = win.DataProvider.GetMarkup (n) ?? "&lt;null&gt;";
var icon = win.DataProvider.GetIcon (n);
@@ -391,7 +401,7 @@ namespace MonoDevelop.Components
int iconWidth = icon != null ? (int)icon.Width : 0;
layout.Ellipsize = Pango.EllipsizeMode.End;
- layout.Width = (Allocation.Width - xpos - iconWidth - 2) * (int)Pango.Scale.PangoScale;
+ layout.Width = (Allocation.Width - xpos - iconWidth - iconTextDistance) * (int)Pango.Scale.PangoScale;
layout.SetMarkup (PathBar.GetFirstLineFromMarkup (text));
int wi, he, typos, iypos;
@@ -402,18 +412,20 @@ namespace MonoDevelop.Components
if (n == selection) {
if (!disableSelection) {
GdkWindow.DrawRectangle (Style.BaseGC (StateType.Selected),
- true, margin, ypos, lineWidth, rowHeight);
+ true, leftXAlignment, ypos, lineWidth, rowHeight);
GdkWindow.DrawLayout (Style.TextGC (StateType.Selected),
- xpos + iconWidth + 2, typos, layout);
+ xpos + iconWidth + iconTextDistance, typos, layout);
+ if (icon != null)
+ icon = icon.WithStyles ("sel");
} else {
GdkWindow.DrawRectangle (Style.BaseGC (StateType.Selected),
- false, margin, ypos, lineWidth, rowHeight);
+ false, leftXAlignment, ypos, lineWidth, rowHeight);
GdkWindow.DrawLayout (Style.TextGC (StateType.Normal),
- xpos + iconWidth + 2, typos, layout);
+ xpos + iconWidth + iconTextDistance, typos, layout);
}
} else
GdkWindow.DrawLayout (Style.TextGC (StateType.Normal),
- xpos + iconWidth + 2, typos, layout);
+ xpos + iconWidth + iconTextDistance, typos, layout);
if (icon != null) {
using (var ctx = Gdk.CairoHelper.Create (this.GdkWindow))
@@ -454,8 +466,8 @@ namespace MonoDevelop.Components
return;
int newHeight;
newHeight = win.DataProvider.IconCount > MaxVisibleRows ?
- (rowHeight * MaxVisibleRows) + margin * 2 :
- (rowHeight * win.DataProvider.IconCount) + margin * 2;
+ (rowHeight * MaxVisibleRows) + leftXAlignment * 2 :
+ (rowHeight * win.DataProvider.IconCount) + leftXAlignment * 2;
newHeight += 2;
listWidth = Math.Min (450, CalcWidth ());
SetSizeRequest (listWidth, newHeight);
@@ -476,14 +488,16 @@ namespace MonoDevelop.Components
}
}
layout.SetMarkup (win.DataProvider.GetMarkup (longest) ?? "&lt;null&gt;");
- int w, h;
- layout.GetPixelSize (out w, out h);
+ Pango.Rectangle inkRec, logRect;
+ layout.GetExtents (out inkRec, out logRect);
var icon = win.DataProvider.GetIcon (longest);
int iconWidth = icon != null ? (int) icon.Width : 24;
- w += iconWidth + 2 + padding * 2 + margin;
- return w;
+ return iconWidth + iconTextDistance + padding * 2 + leftXAlignment +
+ (int)(inkRec.Width / Pango.Scale.PangoScale);
}
+
+
void SetBounds ()
{
if (vAdjustment == null)
@@ -501,7 +515,6 @@ namespace MonoDevelop.Components
protected override void OnSizeAllocated (Gdk.Rectangle allocation)
{
base.OnSizeAllocated (allocation);
-
hAdjustment.SetBounds (0, allocation.Width, 0, 0, allocation.Width);
SetBounds ();
@@ -522,7 +535,7 @@ namespace MonoDevelop.Components
layout.Dispose ();
layout = new Pango.Layout (PangoContext);
layout.Wrap = Pango.WrapMode.Char;
- layout.FontDescription = Style.FontDescription.Copy ();
+ layout.FontDescription = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11);
CalcRowHeight ();
CalcVisibleRows ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ExtendedLabel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ExtendedLabel.cs
index f31d401c26..222c1a3ab3 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ExtendedLabel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ExtendedLabel.cs
@@ -24,13 +24,13 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using Cairo;
+using Gdk;
namespace MonoDevelop.Components
{
class ExtendedLabel: Gtk.Label
{
- bool dropShadowVisible;
-
public ExtendedLabel ()
{
}
@@ -38,20 +38,9 @@ namespace MonoDevelop.Components
public ExtendedLabel (string text): base (text)
{
}
-
- public bool DropShadowVisible {
- get { return dropShadowVisible; }
- set {
- dropShadowVisible = value;
- QueueDraw ();
- }
- }
protected override bool OnExposeEvent (Gdk.EventExpose evnt)
{
- if (!dropShadowVisible)
- return base.OnExposeEvent (evnt);
-
Pango.Layout la = new Pango.Layout (PangoContext);
int w, h;
if (UseMarkup)
@@ -63,8 +52,31 @@ namespace MonoDevelop.Components
int tx = Allocation.X + (int) Xpad + (int) ((float)(Allocation.Width - (int)(Xpad*2) - w) * Xalign);
int ty = Allocation.Y + (int) Ypad + (int) ((float)(Allocation.Height - (int)(Ypad*2) - h) * Yalign);
-
- GdkWindow.DrawLayout (Style.TextGC (State), tx, ty, la);
+
+ using (var ctx = CairoHelper.Create (evnt.Window)) {
+ ctx.SetSourceColor (Style.Text (State).ToCairoColor ());
+ ctx.MoveTo (tx, ty);
+
+ // In order to get the same result as in MonoDevelop.Components.DockNotebook.TabStrip.DrawTab()
+ // (document tabs) we need to draw using a LinearGradient (because of issues below),
+ // but we don't want to mask the actual text here, like in the doc tabs.
+ // Therefore we use a LinearGradient and mask only the last vertical pixel line
+ // of the label with 0.99 alpha, which forces Cairo to render the whole layout
+ // in the desired way.
+
+ // Semi-transparent gradient disables sub-pixel rendering of the label (reverting to grayscale antialiasing).
+ // As Mac sub-pixel font rendering looks stronger than grayscale rendering, the label used in pad tabs
+ // looked different. We need to simulate same gradient treatment as we have in document tabs.
+
+ using (var lg = new LinearGradient (tx + w - 1, 0, tx + w, 0)) {
+ var color = Style.Text (State).ToCairoColor ();
+ lg.AddColorStop (0, color);
+ color.A = 0.99;
+ lg.AddColorStop (1, color);
+ ctx.SetSource (lg);
+ Pango.CairoHelper.ShowLayout (ctx, la);
+ }
+ }
la.Dispose ();
return true;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileChooserAction.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileChooserAction.cs
index 280379a4a8..1136f7bde7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileChooserAction.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileChooserAction.cs
@@ -53,7 +53,6 @@ namespace MonoDevelop.Components
return Gtk.FileChooserAction.Save;
else
throw new NotSupportedException ();
-
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileSelector.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileSelector.cs
index 6149980115..1928260e5a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileSelector.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileSelector.cs
@@ -29,6 +29,7 @@ using System;
using Gtk;
using MonoDevelop.Core;
+using MonoDevelop.Ide;
namespace MonoDevelop.Components
{
@@ -80,7 +81,7 @@ namespace MonoDevelop.Components
this.SetCurrentFolder (Environment.GetFolderPath (Environment.SpecialFolder.Personal));
// add default project path as a MD bookmark
- string pathName = PropertyService.Get ("MonoDevelop.Core.Gui.Dialogs.NewProjectDialog.DefaultPath", Environment.GetFolderPath (Environment.SpecialFolder.Personal));
+ string pathName = IdeApp.Preferences.ProjectsDefaultPath;
if (FileService.IsDirectory (pathName)) {
try {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FixedWidthWrapLabel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FixedWidthWrapLabel.cs
index ba06864d99..f7c12d9134 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FixedWidthWrapLabel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FixedWidthWrapLabel.cs
@@ -42,6 +42,7 @@ namespace MonoDevelop.Components
bool use_markup = false;
Pango.Layout layout;
int indent;
+ int spacing;
int width = int.MaxValue;
bool breakOnPunctuation;
@@ -87,6 +88,7 @@ namespace MonoDevelop.Components
if (FontDescription != null)
layout.FontDescription = FontDescription;
layout.Indent = (int) (indent * Pango.Scale.PangoScale);
+ layout.Spacing = (int) (spacing * Pango.Scale.PangoScale);
layout.Wrap = wrapMode;
if (width >= 0)
layout.Width = (int)(width * Pango.Scale.PangoScale);
@@ -204,6 +206,17 @@ namespace MonoDevelop.Components
}
}
}
+
+ public int Spacing {
+ get { return spacing; }
+ set {
+ spacing = value;
+ if (layout != null) {
+ layout.Spacing = (int) (spacing * Pango.Scale.PangoScale);
+ QueueResize ();
+ }
+ }
+ }
public bool BreakOnPunctuation {
get { return breakOnPunctuation; }
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkGestures.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkGestures.cs
new file mode 100644
index 0000000000..a819fc0f74
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkGestures.cs
@@ -0,0 +1,252 @@
+//
+// GtkGestures.cs
+//
+// Author:
+// Michael Hutchinson <mhutch@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Runtime.InteropServices;
+using Gdk;
+
+namespace MonoDevelop.Components
+{
+ public static class GtkGestures
+ {
+ const int GDK_GESTURE_MAGNIFY = 37;
+ const int GDK_GESTURE_ROTATE = 38;
+ const int GDK_GESTURE_SWIPE = 39;
+
+ [DllImport (PangoUtil.LIBGDK, CallingConvention = CallingConvention.Cdecl)]
+ static extern bool gdk_quartz_supports_gesture_events ();
+
+ static bool isSupported;
+
+ static GtkGestures ()
+ {
+ if (MonoDevelop.Core.Platform.IsMac) {
+ try {
+ isSupported = gdk_quartz_supports_gesture_events ();
+ } catch (EntryPointNotFoundException) {
+ }
+ }
+ }
+
+ public static bool IsSupported { get { return isSupported; } }
+
+ public static void AddGestureMagnifyHandler (this Gtk.Widget widget, EventHandler<GestureMagnifyEventArgs> handler)
+ {
+ if (!isSupported)
+ throw new NotSupportedException ();
+ var signal = GLib.Signal.Lookup (widget, "gesture-magnify-event", typeof(GestureMagnifyEventArgs));
+ signal.AddDelegate (new EventHandler<GestureMagnifyEventArgs> (handler));
+ }
+
+ public static void AddGestureRotateHandler (this Gtk.Widget widget, EventHandler<GestureRotateEventArgs> handler)
+ {
+ if (!isSupported)
+ throw new NotSupportedException ();
+ var signal = GLib.Signal.Lookup (widget, "gesture-rotate-event", typeof(GestureRotateEventArgs));
+ signal.AddDelegate (new EventHandler<GestureRotateEventArgs> (handler));
+ }
+
+ public static void AddGestureSwipeHandler (this Gtk.Widget widget, EventHandler<GestureSwipeEventArgs> handler)
+ {
+ if (!isSupported)
+ throw new NotSupportedException ();
+ var signal = GLib.Signal.Lookup (widget, "gesture-swipe-event", typeof(GestureSwipeEventArgs));
+ signal.AddDelegate (new EventHandler<GestureSwipeEventArgs> (handler));
+ }
+ }
+
+ public unsafe class GestureMagnifyEventArgs : GLib.SignalArgs
+ {
+ //have to force pack=4, or Mono aligns doubles to 8 bytes
+ [StructLayout (LayoutKind.Sequential, Pack=4)]
+ struct GdkEventGestureMagnify
+ {
+ public Gdk.EventType type;
+ public IntPtr window;
+ public sbyte send_event;
+ public uint time;
+ public double x, y;
+ public uint state;
+ public double magnification;
+ public IntPtr device;
+ public double x_root, y_root;
+ }
+
+ // I tried to mimic the GTK# pattern of having a subclassed Event object on the EventArgs, but I gave up on
+ // figuring out how to get GTK# to marshal the event to a custom GestureMagnifyEvent class. Instead we just
+ // lift all the accessors up to the args class and dereference the handle directly.
+ GdkEventGestureMagnify *evt {
+ get {
+ var handle = ((Event)Args[0]).Handle;
+ return (GdkEventGestureMagnify *) handle;
+ }
+ }
+
+ public Gdk.Window Window {
+ get {
+ return (Gdk.Window) GLib.Object.GetObject (evt->window);
+ }
+ }
+
+ public Device Device {
+ get {
+ return (Device) GLib.Object.GetObject (evt->device);
+ }
+ }
+
+ public uint Time { get { return evt->time; } }
+ public double X { get { return evt->x; } }
+ public double Y { get { return evt->y; } }
+ public ModifierType State { get { return (ModifierType) evt->state; } }
+ public double Magnification { get { return evt->magnification; } }
+ public double XRoot { get { return evt->x_root; } }
+ public double YRoot { get { return evt->y_root; } }
+ }
+
+ public unsafe class GestureRotateEventArgs : GLib.SignalArgs
+ {
+ [StructLayout (LayoutKind.Sequential, Pack=4)]
+ struct GdkEventGestureRotate
+ {
+ public Gdk.EventType type;
+ public IntPtr window;
+ public sbyte send_event;
+ public uint time;
+ public double x, y;
+ public uint state;
+ public double rotation;
+ public IntPtr device;
+ public double x_root, y_root;
+ }
+
+ GdkEventGestureRotate *evt {
+ get {
+ var handle = ((Event)Args[0]).Handle;
+ return (GdkEventGestureRotate *) handle;
+ }
+ }
+
+ public Gdk.Window Window {
+ get {
+ return (Gdk.Window) GLib.Object.GetObject (evt->window);
+ }
+ }
+
+ public Device Device {
+ get {
+ return (Device) GLib.Object.GetObject (evt->device);
+ }
+ }
+
+ public uint Time { get { return evt->time; } }
+ public double X { get { return evt->x; } }
+ public double Y { get { return evt->y; } }
+ public ModifierType State { get { return (ModifierType) evt->state; } }
+ public double Rotation { get { return evt->rotation; } }
+ public double XRoot { get { return evt->x_root; } }
+ public double YRoot { get { return evt->y_root; } }
+ }
+
+ public unsafe class GestureSwipeEventArgs : GLib.SignalArgs
+ {
+ [StructLayout (LayoutKind.Sequential, Pack=4)]
+ struct GdkEventGestureSwipe
+ {
+ public Gdk.EventType type;
+ public IntPtr window;
+ public sbyte send_event;
+ public uint time;
+ public double x, y;
+ public uint state;
+ public double delta_x, delta_y;
+ public IntPtr device;
+ public double x_root, y_root;
+ }
+
+ GdkEventGestureSwipe *evt {
+ get {
+ var handle = ((Event)Args[0]).Handle;
+ return (GdkEventGestureSwipe *) handle;
+ }
+ }
+
+ public Gdk.Window Window {
+ get {
+ return (Gdk.Window) GLib.Object.GetObject (evt->window);
+ }
+ }
+
+ public Device Device {
+ get {
+ return (Device) GLib.Object.GetObject (evt->device);
+ }
+ }
+
+ public uint Time { get { return evt->time; } }
+ public double X { get { return evt->x; } }
+ public double Y { get { return evt->y; } }
+ public ModifierType State { get { return (ModifierType) evt->state; } }
+ public double DeltaX { get { return evt->delta_x; } }
+ public double DeltaY { get { return evt->delta_y; } }
+ public double XRoot { get { return evt->x_root; } }
+ public double YRoot { get { return evt->y_root; } }
+ }
+
+ /*
+ void PrintOffsets ()
+ {
+ GdkEventGestureMagnify *v = (GdkEventGestureMagnify *)0;
+ Console.WriteLine ("type {0}", (int)&(v->type));
+ Console.WriteLine ("window {0}", (int)&(v->window));
+ Console.WriteLine ("send_event {0}", (int)&(v->send_event));
+ Console.WriteLine ("time {0}", (int)&(v->time));
+ Console.WriteLine ("x {0}", (int)&(v->x));
+ Console.WriteLine ("y {0}", (int)&(v->y));
+ Console.WriteLine ("state {0}", (int)&(v->state));
+ Console.WriteLine ("magnification {0}", (int)&(v->magnification));
+ Console.WriteLine ("x_root {0}", (int)&(v->x_root));
+ Console.WriteLine ("y_root {0}", (int)&(v->y_root));
+ }
+
+ // gcc -m32 test.c `pkg-config --cflags gtk+-2.0`
+ #include <gtk/gtk.h>
+
+ int main (int argc, char* argv)
+ {
+ GdkEventGestureMagnify *v = (GdkEventGestureMagnify *)0;
+ printf ("type %d\n", (int)&(v->type));
+ printf ("window %d\n", (int)&(v->window));
+ printf ("send_event %d\n", (int)&(v->send_event));
+ printf ("time %d\n", (int)&(v->time));
+ printf ("x %d\n", (int)&(v->x));
+ printf ("y %d\n", (int)&(v->y));
+ printf ("state %d\n", (int)&(v->state));
+ printf ("magnification %d\n", (int)&(v->magnification));
+ printf ("x_root %d\n", (int)&(v->x_root));
+ printf ("y_root %d\n", (int)&(v->y_root));
+ }
+ */
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs
index 7a8aa1529f..13e9a1419f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkUtil.cs
@@ -39,7 +39,15 @@ namespace MonoDevelop.Components
{
static Dictionary<TreeView, TreeViewTooltipsData> treeData = new Dictionary<TreeView, TreeViewTooltipsData> ();
- static readonly Xwt.Toolkit gtkToolkit = Xwt.Toolkit.Load (Xwt.ToolkitType.Gtk);
+ static Xwt.Toolkit gtkToolkit;
+
+ internal static Xwt.Toolkit GtkToolkit {
+ get {
+ if (gtkToolkit == null)
+ gtkToolkit = Xwt.Toolkit.LoadedToolkits.FirstOrDefault (t => t.Type == Xwt.ToolkitType.Gtk);
+ return gtkToolkit;
+ }
+ }
public static Cairo.Color ToCairoColor (this Gdk.Color color)
{
@@ -55,6 +63,11 @@ namespace MonoDevelop.Components
(double)color.Blue / ushort.MaxValue);
}
+ public static string GetHex (this Gdk.Color color)
+ {
+ return String.Format("#{0:x2}{1:x2}{2:x2}", (byte)(color.Red), (byte)(color.Green), (byte)(color.Blue));
+ }
+
public static Gdk.Color ToGdkColor (this Cairo.Color color)
{
return new Gdk.Color ((byte)(color.R * 255d), (byte)(color.G * 255d), (byte)(color.B * 255d));
@@ -89,6 +102,19 @@ namespace MonoDevelop.Components
return c.ToGdkColor ();
}
+ /// <summary>
+ /// Makes a color lighter or darker
+ /// </summary>
+ /// <param name='lightAmount'>
+ /// Amount of lightness to add. If the value is positive, the color will be lighter,
+ /// if negative it will be darker. Value must be between 0 and 1.
+ /// </param>
+ public static HslColor AddLight (this HslColor color, double lightAmount)
+ {
+ color.L += lightAmount;
+ return color;
+ }
+
public static Cairo.Color AddLight (this Cairo.Color color, double lightAmount)
{
var c = color.ToXwtColor ();
@@ -96,64 +122,70 @@ namespace MonoDevelop.Components
return c.ToCairoColor ();
}
+ /// <summary>
+ /// Makes a color lighter or darker
+ /// </summary>
+ /// <param name='lightAmount'>
+ /// Amount of lightness to add. If the value is positive, the color will be lighter,
+ /// if negative it will be darker. Value must be between 0 and 1.
+ /// </param>
+ public static Xwt.Drawing.Color AddLight (this Xwt.Drawing.Color color, double lightAmount)
+ {
+ color.Light += lightAmount;
+ return color;
+ }
+
public static Xwt.Drawing.Context CreateXwtContext (this Gtk.Widget w)
{
var c = Gdk.CairoHelper.Create (w.GdkWindow);
- return gtkToolkit.WrapContext (w, c);
+ return GtkToolkit.WrapContext (w, c);
}
public static Gtk.Widget ToGtkWidget (this Xwt.Widget widget)
{
- return (Gtk.Widget) gtkToolkit.GetNativeWidget (widget);
+ return (Gtk.Widget) GtkToolkit.GetNativeWidget (widget);
}
public static void DrawImage (this Cairo.Context s, Gtk.Widget widget, Xwt.Drawing.Image image, double x, double y)
{
- gtkToolkit.RenderImage (widget, s, image, x, y);
+ GtkToolkit.RenderImage (widget, s, image, x, y);
}
public static Xwt.Drawing.Image ToXwtImage (this Gdk.Pixbuf pix)
{
- return gtkToolkit.WrapImage (pix);
+ return GtkToolkit.WrapImage (pix);
}
public static Gdk.Pixbuf ToPixbuf (this Xwt.Drawing.Image image)
{
- return (Gdk.Pixbuf)gtkToolkit.GetNativeImage (image);
+ return (Gdk.Pixbuf)GtkToolkit.GetNativeImage (image);
}
public static Gdk.Pixbuf ToPixbuf (this Xwt.Drawing.Image image, Gtk.IconSize size)
{
- return (Gdk.Pixbuf)gtkToolkit.GetNativeImage (image.WithSize (size));
+ return (Gdk.Pixbuf)GtkToolkit.GetNativeImage (image.WithSize (size));
}
public static Xwt.Drawing.Image WithSize (this Xwt.Drawing.Image image, Gtk.IconSize size)
{
int w, h;
- if (!Gtk.Icon.SizeLookup (size, out w, out h))
- return image;
- if (size == IconSize.Menu)
- w = h = 16;
+ size.GetSize (out w, out h);
return image.WithSize (w, h);
}
- public static Xwt.Drawing.Image GetImageResource (this RuntimeAddin addin, string resource)
+ public static Xwt.Size GetSize (this IconSize size)
{
- using (var s = addin.GetResource (resource)) {
- var img = Xwt.Drawing.Image.FromStream (s);
- int i = resource.LastIndexOf ('.');
- if (i != -1) {
- var resource2x = resource.Substring (0, i) + "@2x" + resource.Substring (i);
- var s2x = addin.GetResource (resource2x);
- if (s2x != null) {
- using (s2x) {
- var img2x = Xwt.Drawing.Image.FromStream (s2x);
- return Xwt.Drawing.Image.CreateMultiSizeIcon (new Xwt.Drawing.Image[] {img, img2x});
- }
- }
- }
- return img;
- }
+ int w, h;
+ size.GetSize (out w, out h);
+ return new Xwt.Size (w, h);
+ }
+
+ public static void GetSize (this IconSize size, out int width, out int height)
+ {
+ if (!Icon.SizeLookup (size, out width, out height))
+ return;
+ if (size == IconSize.Menu)
+ width = height = 16;
}
public static Gdk.Point GetScreenCoordinates (this Gtk.Widget w, Gdk.Point p)
@@ -187,10 +219,7 @@ namespace MonoDevelop.Components
tree.ScrollEvent += HandleTreeScrollEvent;
tree.Hidden += HandleTreeHidden;
tree.Unrealized += HandleTreeHidden;
- tree.Destroyed += delegate {
- ResetTooltip (tree);
- treeData.Remove (tree);
- };
+ tree.Destroyed += HandleTreeDestroyed;
}
static void ResetTooltip (Gtk.TreeView tree)
@@ -211,6 +240,14 @@ namespace MonoDevelop.Components
ResetTooltip ((Gtk.TreeView) sender);
}
+ static void HandleTreeDestroyed (object sender, EventArgs e)
+ {
+ var tree = (Gtk.TreeView)sender;
+
+ ResetTooltip (tree);
+ treeData.Remove (tree);
+ }
+
[GLib.ConnectBeforeAttribute]
static void HandleTreeScrollEvent (object o, ScrollEventArgs args)
{
@@ -221,18 +258,32 @@ namespace MonoDevelop.Components
static void HandleLeaveNotifyEvent(object o, LeaveNotifyEventArgs args)
{
TreeView tree = (TreeView) o;
+ ScheduleHideTooltip (tree);
+ }
+
+ internal static void ScheduleHideTooltip (TreeView tree)
+ {
TreeViewTooltipsData data;
if (!treeData.TryGetValue (tree, out data))
return;
data.LeaveTimer = GLib.Timeout.Add (50, delegate {
data.LeaveTimer = 0;
- if (data != null && data.Tooltip != null && data.Tooltip.MouseIsOver)
- return false;
HideTooltip (tree);
return false;
});
}
+ internal static void UnscheduleHideTooltip (TreeView tree)
+ {
+ TreeViewTooltipsData data;
+ if (!treeData.TryGetValue (tree, out data))
+ return;
+ if (data.LeaveTimer != 0) {
+ GLib.Source.Remove (data.LeaveTimer);
+ data.LeaveTimer = 0;
+ }
+ }
+
internal static void HideTooltip (TreeView tree)
{
TreeViewTooltipsData data;
@@ -243,6 +294,10 @@ namespace MonoDevelop.Components
data.ShowTimer = 0;
return;
}
+ if (data.LeaveTimer != 0) {
+ GLib.Source.Remove (data.LeaveTimer);
+ data.LeaveTimer = 0;
+ }
if (data.Tooltip != null) {
data.Tooltip.Destroy ();
data.Tooltip = null;
@@ -299,6 +354,21 @@ namespace MonoDevelop.Components
}
}
+ public static bool GetCellForegroundSet (this Gtk.CellRendererText cell)
+ {
+ GLib.Value property = cell.GetProperty ("foreground-set");
+ bool result = (bool)property;
+ property.Dispose ();
+ return result;
+ }
+
+ public static void SetCellForegroundSet (this Gtk.CellRendererText cell, bool value)
+ {
+ GLib.Value val = new GLib.Value (value);
+ cell.SetProperty ("foreground-set", val);
+ val.Dispose ();
+ }
+
public static Gdk.Rectangle ToScreenCoordinates (Gtk.Widget widget, Gdk.Window w, Gdk.Rectangle rect)
{
return new Gdk.Rectangle (ToScreenCoordinates (widget, w, rect.X, rect.Y), rect.Size);
@@ -307,14 +377,14 @@ namespace MonoDevelop.Components
public static Gdk.Point ToScreenCoordinates (Gtk.Widget widget, Gdk.Window w, int x, int y)
{
int ox, oy;
- w.GetOrigin (out ox, out oy);
- //Bug 31032 - this is workaround bug in GTK on Windows OS which has widget.Allocation.X/Y
- //relative to widget.GdkWindow.Toplevel instead to widget.GdkWindow which is GdkWindow decicated
- //to TreeView so widget.Allocation.X/Y should always be 0,0(which is true on Mac)
- //hence skipping adding Allocation.X/Y since they should always be 0,0 anyway
- if (!(widget is TreeView)) {
- ox += widget.Allocation.X;
- oy += widget.Allocation.Y;
+ w.GetOrigin (out ox, out oy);
+ //Bug 31032 - this is workaround bug in GTK on Windows OS which has widget.Allocation.X/Y
+ //relative to widget.GdkWindow.Toplevel instead to widget.GdkWindow which is GdkWindow decicated
+ //to TreeView so widget.Allocation.X/Y should always be 0,0(which is true on Mac)
+ //hence skipping adding Allocation.X/Y since they should always be 0,0 anyway
+ if (!(widget is TreeView)) {
+ ox += widget.Allocation.X;
+ oy += widget.Allocation.Y;
}
return new Gdk.Point (ox + x, oy + y);
}
@@ -494,11 +564,18 @@ namespace MonoDevelop.Components
#if MAC
var entries = window.FindAllChildWidgets ().OfType<Gtk.Entry> ();
foreach (var entry in entries) {
- entry.ButtonPressEvent += EntryButtonPressHandler;
+ entry.UseNativeContextMenus ();
}
#endif
}
+ public static void UseNativeContextMenus (this Gtk.Entry entry)
+ {
+ #if MAC
+ entry.ButtonPressEvent += EntryButtonPressHandler;
+ #endif
+ }
+
static void ShowNativeContextMenu (this Gtk.Entry entry, Gdk.EventButton evt)
{
var context_menu = new ContextMenu ();
@@ -515,10 +592,14 @@ namespace MonoDevelop.Components
paste.Clicked += PasteClicked;
context_menu.Items.Add (paste);
+ context_menu.Items.Add (new SeparatorContextMenuItem ());
+
var delete = new ContextMenuItem { Label = GettextCatalog.GetString ("Delete"), Context = entry };
delete.Clicked += DeleteClicked;
context_menu.Items.Add (delete);
+ context_menu.Items.Add (new SeparatorContextMenuItem ());
+
var select_all = new ContextMenuItem { Label = GettextCatalog.GetString ("Select All"), Context = entry };
select_all.Clicked += SelectAllClicked;
context_menu.Items.Add (select_all);
@@ -737,8 +818,6 @@ namespace MonoDevelop.Components
TreeView tree;
TreeIter iter;
- public bool MouseIsOver;
-
public CellTooltipWindow (TreeView tree, TreeViewColumn col, TreePath path)
{
this.tree = tree;
@@ -780,6 +859,7 @@ namespace MonoDevelop.Components
Gdk.Rectangle expose = Allocation;
Gdk.Color save = Gdk.Color.Zero;
+ bool hasFgColor = false;
int x = 1;
col.CellSetCellData (tree.Model, iter, false, false);
@@ -789,6 +869,7 @@ namespace MonoDevelop.Components
continue;
if (cr is CellRendererText) {
+ hasFgColor = ((CellRendererText)cr).GetCellForegroundSet ();
save = ((CellRendererText)cr).ForegroundGdk;
((CellRendererText)cr).ForegroundGdk = Style.Foreground (State);
}
@@ -805,6 +886,7 @@ namespace MonoDevelop.Components
if (cr is CellRendererText) {
((CellRendererText)cr).ForegroundGdk = save;
+ ((CellRendererText)cr).SetCellForegroundSet (hasFgColor);
}
}
@@ -886,14 +968,16 @@ namespace MonoDevelop.Components
protected override bool OnLeaveNotifyEvent (Gdk.EventCrossing evnt)
{
- MouseIsOver = false;
- GtkUtil.HideTooltip (tree);
+ // While showing a window, if the cursor is in the area of the new window, sometimes we get several Enter/Leave events
+ // in sequence, until the window is fully visible. To avoid hiding the window too early, we schedule here a tooltip
+ // hide, which will be canceled if we get a new Enter event.
+ GtkUtil.ScheduleHideTooltip (tree);
return base.OnLeaveNotifyEvent (evnt);
}
protected override bool OnEnterNotifyEvent (Gdk.EventCrossing evnt)
{
- MouseIsOver = true;
+ GtkUtil.UnscheduleHideTooltip (tree);
return base.OnEnterNotifyEvent (evnt);
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs
new file mode 100644
index 0000000000..668a592c9b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/GtkWorkarounds.cs
@@ -0,0 +1,1365 @@
+//
+// GtkWorkarounds.cs
+//
+// Authors: Jeffrey Stedfast <jeff@xamarin.com>
+//
+// Copyright (C) 2011 Xamarin Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using System;
+using System.Drawing;
+using System.Runtime.InteropServices;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Reflection.Emit;
+using Gtk;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Editor.Highlighting;
+using System.Text.RegularExpressions;
+
+#if MAC
+using AppKit;
+using MonoDevelop.Components.Mac;
+#endif
+
+namespace MonoDevelop.Components
+{
+ public static class GtkWorkarounds
+ {
+ const string LIBOBJC ="/usr/lib/libobjc.dylib";
+ const string USER32DLL = "User32.dll";
+
+ [DllImport (LIBOBJC, EntryPoint = "sel_registerName")]
+ static extern IntPtr sel_registerName (string selector);
+
+ [DllImport (LIBOBJC, EntryPoint = "objc_getClass")]
+ static extern IntPtr objc_getClass (string klass);
+
+ [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")]
+ static extern IntPtr objc_msgSend_IntPtr (IntPtr klass, IntPtr selector);
+
+ [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")]
+ static extern void objc_msgSend_void_bool (IntPtr klass, IntPtr selector, bool arg);
+
+ [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")]
+ static extern bool objc_msgSend_bool (IntPtr klass, IntPtr selector);
+
+ [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")]
+ static extern int objc_msgSend_NSInt32_NSInt32 (IntPtr klass, IntPtr selector, int arg);
+
+ [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")]
+ static extern long objc_msgSend_NSInt64_NSInt64 (IntPtr klass, IntPtr selector, long arg);
+
+ [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")]
+ static extern uint objc_msgSend_NSUInt32 (IntPtr klass, IntPtr selector);
+
+ [DllImport (LIBOBJC, EntryPoint = "objc_msgSend")]
+ static extern ulong objc_msgSend_NSUInt64 (IntPtr klass, IntPtr selector);
+
+ [DllImport (LIBOBJC, EntryPoint = "objc_msgSend_stret")]
+ static extern void objc_msgSend_CGRect32 (out CGRect32 rect, IntPtr klass, IntPtr selector);
+
+ [DllImport (LIBOBJC, EntryPoint = "objc_msgSend_stret")]
+ static extern void objc_msgSend_CGRect64 (out CGRect64 rect, IntPtr klass, IntPtr selector);
+
+ [DllImport (PangoUtil.LIBQUARTZ)]
+ static extern IntPtr gdk_quartz_window_get_nswindow (IntPtr window);
+
+ [DllImport (PangoUtil.LIBQUARTZ)]
+ static extern bool gdk_window_has_embedded_nsview_focus (IntPtr window);
+
+ struct CGRect32
+ {
+ public float X, Y, Width, Height;
+ }
+
+ struct CGRect64
+ {
+ public double X, Y, Width, Height;
+
+ public CGRect64 (CGRect32 rect32)
+ {
+ X = rect32.X;
+ Y = rect32.Y;
+ Width = rect32.Width;
+ Height = rect32.Height;
+ }
+ }
+
+ static IntPtr cls_NSScreen;
+ static IntPtr sel_screens, sel_objectEnumerator, sel_nextObject, sel_frame, sel_visibleFrame,
+ sel_requestUserAttention, sel_setHasShadow, sel_invalidateShadow;
+ static IntPtr sharedApp;
+ static IntPtr cls_NSEvent;
+ static IntPtr sel_modifierFlags;
+
+ const int NSCriticalRequest = 0;
+ const int NSInformationalRequest = 10;
+
+ static System.Reflection.MethodInfo glibObjectGetProp, glibObjectSetProp;
+
+ public static int GtkMinorVersion = 12, GtkMicroVersion = 0;
+ static bool oldMacKeyHacks = false;
+
+ static GtkWorkarounds ()
+ {
+ if (Platform.IsMac) {
+ InitMac ();
+ }
+
+ var flags = System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic;
+ glibObjectSetProp = typeof (GLib.Object).GetMethod ("SetProperty", flags);
+ glibObjectGetProp = typeof (GLib.Object).GetMethod ("GetProperty", flags);
+
+ foreach (int i in new [] { 24, 22, 20, 18, 16, 14 }) {
+ if (Gtk.Global.CheckVersion (2, (uint)i, 0) == null) {
+ GtkMinorVersion = i;
+ break;
+ }
+ }
+
+ for (int i = 1; i < 20; i++) {
+ if (Gtk.Global.CheckVersion (2, (uint)GtkMinorVersion, (uint)i) == null) {
+ GtkMicroVersion = i;
+ } else {
+ break;
+ }
+ }
+
+ //opt into the fixes on GTK+ >= 2.24.8
+ if (Platform.IsMac) {
+ try {
+ gdk_quartz_set_fix_modifiers (true);
+ } catch (EntryPointNotFoundException) {
+ oldMacKeyHacks = true;
+ }
+ }
+
+ keymap.KeysChanged += delegate {
+ mappedKeys.Clear ();
+ };
+ }
+
+ static void InitMac ()
+ {
+ cls_NSScreen = objc_getClass ("NSScreen");
+ cls_NSEvent = objc_getClass ("NSEvent");
+ sel_screens = sel_registerName ("screens");
+ sel_objectEnumerator = sel_registerName ("objectEnumerator");
+ sel_nextObject = sel_registerName ("nextObject");
+ sel_visibleFrame = sel_registerName ("visibleFrame");
+ sel_frame = sel_registerName ("frame");
+ sel_requestUserAttention = sel_registerName ("requestUserAttention:");
+ sel_modifierFlags = sel_registerName ("modifierFlags");
+ sel_setHasShadow = sel_registerName ("setHasShadow:");
+ sel_invalidateShadow = sel_registerName ("invalidateShadow");
+ sharedApp = objc_msgSend_IntPtr (objc_getClass ("NSApplication"), sel_registerName ("sharedApplication"));
+ }
+
+ static Gdk.Rectangle MacGetUsableMonitorGeometry (Gdk.Screen screen, int monitor)
+ {
+ IntPtr array = objc_msgSend_IntPtr (cls_NSScreen, sel_screens);
+ IntPtr iter = objc_msgSend_IntPtr (array, sel_objectEnumerator);
+ Gdk.Rectangle ygeometry = screen.GetMonitorGeometry (monitor);
+ Gdk.Rectangle xgeometry = screen.GetMonitorGeometry (0);
+ IntPtr scrn;
+ int i = 0;
+
+ while ((scrn = objc_msgSend_IntPtr (iter, sel_nextObject)) != IntPtr.Zero && i < monitor)
+ i++;
+
+ if (scrn == IntPtr.Zero)
+ return screen.GetMonitorGeometry (monitor);
+
+ CGRect64 visible, frame;
+
+ if (IntPtr.Size == 8) {
+ objc_msgSend_CGRect64 (out visible, scrn, sel_visibleFrame);
+ objc_msgSend_CGRect64 (out frame, scrn, sel_frame);
+ } else {
+ CGRect32 visible32, frame32;
+ objc_msgSend_CGRect32 (out visible32, scrn, sel_visibleFrame);
+ objc_msgSend_CGRect32 (out frame32, scrn, sel_frame);
+ visible = new CGRect64 (visible32);
+ frame = new CGRect64 (frame32);
+ }
+
+ // Note: Frame and VisibleFrame rectangles are relative to monitor 0, but we need absolute
+ // coordinates.
+ visible.X += xgeometry.X;
+ frame.X += xgeometry.X;
+
+ // VisibleFrame.Y is the height of the Dock if it is at the bottom of the screen, so in order
+ // to get the menu height, we just figure out the difference between the visibleFrame height
+ // and the actual frame height, then subtract the Dock height.
+ //
+ // We need to swap the Y offset with the menu height because our callers expect the Y offset
+ // to be from the top of the screen, not from the bottom of the screen.
+ double x, y, width, height;
+
+ if (visible.Height < frame.Height) {
+ double dockHeight = visible.Y - frame.Y;
+ double menubarHeight = (frame.Height - visible.Height) - dockHeight;
+
+ height = frame.Height - menubarHeight - dockHeight;
+ y = ygeometry.Y + menubarHeight;
+ } else {
+ height = frame.Height;
+ y = ygeometry.Y;
+ }
+
+ // Takes care of the possibility of the Dock being positioned on the left or right edge of the screen.
+ width = System.Math.Min (visible.Width, frame.Width);
+ x = System.Math.Max (visible.X, frame.X);
+
+ return new Gdk.Rectangle ((int) x, (int) y, (int) width, (int) height);
+ }
+
+ static void MacRequestAttention (bool critical)
+ {
+ int kind = critical? NSCriticalRequest : NSInformationalRequest;
+ if (IntPtr.Size == 8) {
+ objc_msgSend_NSInt64_NSInt64 (sharedApp, sel_requestUserAttention, kind);
+ } else {
+ objc_msgSend_NSInt32_NSInt32 (sharedApp, sel_requestUserAttention, kind);
+ }
+ }
+
+ // Note: we can't reuse RectangleF because the layout is different...
+ [StructLayout (LayoutKind.Sequential)]
+ struct Rect {
+ public int Left;
+ public int Top;
+ public int Right;
+ public int Bottom;
+
+ public int X { get { return Left; } }
+ public int Y { get { return Top; } }
+ public int Width { get { return Right - Left; } }
+ public int Height { get { return Bottom - Top; } }
+ }
+
+ const int MonitorInfoFlagsPrimary = 0x01;
+
+ [StructLayout (LayoutKind.Sequential)]
+ unsafe struct MonitorInfo {
+ public int Size;
+ public Rect Frame; // Monitor
+ public Rect VisibleFrame; // Work
+ public int Flags;
+ public fixed byte Device[32];
+ }
+
+ [UnmanagedFunctionPointer (CallingConvention.Winapi)]
+ delegate int EnumMonitorsCallback (IntPtr hmonitor, IntPtr hdc, IntPtr prect, IntPtr user_data);
+
+ [DllImport (USER32DLL)]
+ extern static int EnumDisplayMonitors (IntPtr hdc, IntPtr clip, EnumMonitorsCallback callback, IntPtr user_data);
+
+ [DllImport (USER32DLL)]
+ extern static int GetMonitorInfoA (IntPtr hmonitor, ref MonitorInfo info);
+
+ static Gdk.Rectangle WindowsGetUsableMonitorGeometry (Gdk.Screen screen, int monitor_id)
+ {
+ Gdk.Rectangle geometry = screen.GetMonitorGeometry (monitor_id);
+ List<MonitorInfo> screens = new List<MonitorInfo> ();
+
+ EnumDisplayMonitors (IntPtr.Zero, IntPtr.Zero, delegate (IntPtr hmonitor, IntPtr hdc, IntPtr prect, IntPtr user_data) {
+ var info = new MonitorInfo ();
+
+ unsafe {
+ info.Size = sizeof (MonitorInfo);
+ }
+
+ GetMonitorInfoA (hmonitor, ref info);
+
+ // In order to keep the order the same as Gtk, we need to put the primary monitor at the beginning.
+ if ((info.Flags & MonitorInfoFlagsPrimary) != 0)
+ screens.Insert (0, info);
+ else
+ screens.Add (info);
+
+ return 1;
+ }, IntPtr.Zero);
+
+ MonitorInfo monitor = screens[monitor_id];
+ Rect visible = monitor.VisibleFrame;
+ Rect frame = monitor.Frame;
+
+ // Rebase the VisibleFrame off of Gtk's idea of this monitor's geometry (since they use different coordinate systems)
+ int x = geometry.X + (visible.Left - frame.Left);
+ int width = visible.Width;
+
+ int y = geometry.Y + (visible.Top - frame.Top);
+ int height = visible.Height;
+
+ return new Gdk.Rectangle (x, y, width, height);
+ }
+
+ public static Gdk.Rectangle GetUsableMonitorGeometry (this Gdk.Screen screen, int monitor)
+ {
+ if (Platform.IsWindows)
+ return WindowsGetUsableMonitorGeometry (screen, monitor);
+
+ if (Platform.IsMac)
+ return MacGetUsableMonitorGeometry (screen, monitor);
+
+ return screen.GetMonitorGeometry (monitor);
+ }
+
+ public static int RunDialogWithNotification (Gtk.Dialog dialog)
+ {
+ if (Platform.IsMac)
+ MacRequestAttention (dialog.Modal);
+
+ return dialog.Run ();
+ }
+
+ public static void PresentWindowWithNotification (this Gtk.Window window)
+ {
+ window.Present ();
+
+ if (Platform.IsMac) {
+ var dialog = window as Gtk.Dialog;
+ MacRequestAttention (dialog == null? false : dialog.Modal);
+ }
+ }
+
+ public static GLib.Value GetProperty (this GLib.Object obj, string name)
+ {
+ return (GLib.Value) glibObjectGetProp.Invoke (obj, new object[] { name });
+ }
+
+ public static void SetProperty (this GLib.Object obj, string name, GLib.Value value)
+ {
+ glibObjectSetProp.Invoke (obj, new object[] { name, value });
+ }
+
+ public static bool TriggersContextMenu (this Gdk.EventButton evt)
+ {
+ return evt.Type == Gdk.EventType.ButtonPress && IsContextMenuButton (evt);
+ }
+
+ public static bool IsContextMenuButton (this Gdk.EventButton evt)
+ {
+ if (evt.Button == 3 &&
+ (evt.State & (Gdk.ModifierType.Button1Mask | Gdk.ModifierType.Button2Mask)) == 0)
+ return true;
+
+ if (Platform.IsMac) {
+ if (!oldMacKeyHacks &&
+ evt.Button == 1 &&
+ (evt.State & Gdk.ModifierType.ControlMask) != 0 &&
+ (evt.State & (Gdk.ModifierType.Button2Mask | Gdk.ModifierType.Button3Mask)) == 0)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public static Gdk.ModifierType GetCurrentKeyModifiers ()
+ {
+ if (Platform.IsMac) {
+ Gdk.ModifierType mtype = Gdk.ModifierType.None;
+ ulong mod;
+ if (IntPtr.Size == 8) {
+ mod = objc_msgSend_NSUInt64 (cls_NSEvent, sel_modifierFlags);
+ } else {
+ mod = objc_msgSend_NSUInt32 (cls_NSEvent, sel_modifierFlags);
+ }
+ if ((mod & (1 << 17)) != 0)
+ mtype |= Gdk.ModifierType.ShiftMask;
+ if ((mod & (1 << 18)) != 0)
+ mtype |= Gdk.ModifierType.ControlMask;
+ if ((mod & (1 << 19)) != 0)
+ mtype |= Gdk.ModifierType.Mod1Mask; // Alt key
+ if ((mod & (1 << 20)) != 0)
+ mtype |= Gdk.ModifierType.Mod2Mask; // Command key
+ return mtype;
+ }
+ else {
+ Gdk.ModifierType mtype;
+ Gtk.Global.GetCurrentEventState (out mtype);
+ return mtype;
+ }
+ }
+
+ public static void GetPageScrollPixelDeltas (this Gdk.EventScroll evt, double pageSizeX, double pageSizeY,
+ out double deltaX, out double deltaY)
+ {
+ if (!GetEventScrollDeltas (evt, out deltaX, out deltaY)) {
+ var direction = evt.Direction;
+ deltaX = deltaY = 0;
+ if (pageSizeY != 0 && (direction == Gdk.ScrollDirection.Down || direction == Gdk.ScrollDirection.Up)) {
+ deltaY = System.Math.Pow (pageSizeY, 2.0 / 3.0);
+ deltaX = 0.0;
+ if (direction == Gdk.ScrollDirection.Up)
+ deltaY = -deltaY;
+ } else if (pageSizeX != 0) {
+ deltaX = System.Math.Pow (pageSizeX, 2.0 / 3.0);
+ deltaY = 0.0;
+ if (direction == Gdk.ScrollDirection.Left)
+ deltaX = -deltaX;
+ }
+ }
+ }
+
+ public static void AddValueClamped (this Gtk.Adjustment adj, double value)
+ {
+ adj.Value = System.Math.Max (adj.Lower, System.Math.Min (adj.Value + value, adj.Upper - adj.PageSize));
+ }
+
+ [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)]
+ extern static bool gdk_event_get_scroll_deltas (IntPtr eventScroll, out double deltaX, out double deltaY);
+ static bool scrollDeltasNotSupported;
+
+ public static bool GetEventScrollDeltas (Gdk.EventScroll evt, out double deltaX, out double deltaY)
+ {
+ if (!scrollDeltasNotSupported) {
+ try {
+ return gdk_event_get_scroll_deltas (evt.Handle, out deltaX, out deltaY);
+ } catch (EntryPointNotFoundException) {
+ scrollDeltasNotSupported = true;
+ }
+ }
+ deltaX = deltaY = 0;
+ return false;
+ }
+
+ static void ShowContextMenuInternal (Gtk.Menu menu, Gtk.Widget parent, int ix, int iy, Gdk.Rectangle caret, Gdk.Window window, uint time, uint button)
+ {
+ Gtk.MenuPositionFunc posFunc = null;
+
+ if (parent != null) {
+ menu.AttachToWidget (parent, null);
+ menu.Hidden += (sender, e) => {
+ if (menu.AttachWidget != null)
+ menu.Detach ();
+ };
+ posFunc = delegate (Gtk.Menu m, out int x, out int y, out bool pushIn) {
+ x = ix;
+ y = iy;
+
+ Gtk.Requisition request = m.SizeRequest ();
+ var screen = parent.Screen;
+ Gdk.Rectangle geometry = GetUsableMonitorGeometry (screen, screen.GetMonitorAtPoint (x, y));
+
+ //whether to push or flip menus that would extend offscreen
+ //FIXME: this is the correct behaviour for mac, check other platforms
+ bool flip_left = true;
+ bool flip_up = false;
+
+ if (x + request.Width > geometry.X + geometry.Width) {
+ if (flip_left) {
+ x -= request.Width;
+ } else {
+ x = geometry.X + geometry.Width - request.Width;
+ }
+
+ if (x < geometry.Left)
+ x = geometry.Left;
+ }
+
+ if (y + request.Height > geometry.Y + geometry.Height) {
+ if (flip_up) {
+ y -= request.Height;
+ } else {
+ y = geometry.Y + geometry.Height - request.Height;
+ }
+
+ if (y < geometry.Top)
+ y = geometry.Top;
+ }
+
+ pushIn = false;
+ };
+ }
+
+ menu.Popup (null, null, posFunc, button, time);
+ }
+
+ public static void ShowContextMenu (Gtk.Menu menu, Gtk.Widget parent, Gdk.EventButton evt, Gdk.Rectangle caret)
+ {
+ int x, y;
+ uint time, button;
+
+ var window = evt != null ? evt.Window : parent.GdkWindow;
+
+ if (window == null)
+ return;
+
+ window.GetOrigin (out x, out y);
+
+ if (evt == null) {
+ evt = Global.CurrentEvent as Gdk.EventButton;
+ }
+
+ if (evt != null) {
+ button = evt.Button;
+ time = evt.Time;
+ x += (int)evt.X;
+ y += (int)evt.Y;
+ } else {
+ button = 3;
+ time = 0;
+ x += caret.X;
+ y += caret.Y;
+ }
+
+ ShowContextMenuInternal (menu, parent, x, y, caret, window, time, button);
+ }
+
+ public static void ShowContextMenu (Gtk.Menu menu, Gtk.Widget parent, int ix, int iy, Gdk.Rectangle caret)
+ {
+ int x, y;
+ var window = parent.GdkWindow;
+ var alloc = parent.Allocation;
+
+ window.GetOrigin (out x, out y);
+ x += ix;
+ y += iy;
+
+ if (caret.X >= alloc.X && caret.Y >= alloc.Y) {
+ x += caret.X;
+ y += caret.Y;
+ } else {
+ x += alloc.X;
+ y += alloc.Y;
+ }
+
+ ShowContextMenuInternal (menu, parent, x, y, caret, window, Gtk.Global.CurrentEventTime, 0);
+ }
+
+ public static void ShowContextMenu (Gtk.Menu menu, Gtk.Widget parent, Gdk.EventButton evt)
+ {
+ ShowContextMenu (menu, parent, evt, Gdk.Rectangle.Zero);
+ }
+
+ public static void ShowContextMenu (Gtk.Menu menu, Gtk.Widget parent, int x, int y)
+ {
+ ShowContextMenu (menu, parent, x, y, Gdk.Rectangle.Zero);
+ }
+
+ public static void ShowContextMenu (Gtk.Menu menu, Gtk.Widget parent, Gdk.Rectangle caret)
+ {
+ ShowContextMenu (menu, parent, null, caret);
+ }
+
+ struct MappedKeys
+ {
+ public Gdk.Key Key;
+ public Gdk.ModifierType State;
+ public KeyboardShortcut[] Shortcuts;
+ }
+
+ //introduced in GTK 2.20
+ [DllImport (PangoUtil.LIBGDK, CallingConvention = CallingConvention.Cdecl)]
+ extern static bool gdk_keymap_add_virtual_modifiers (IntPtr keymap, ref Gdk.ModifierType state);
+
+ //Custom patch in Mono Mac w/GTK+ 2.24.8+
+ [DllImport (PangoUtil.LIBGDK, CallingConvention = CallingConvention.Cdecl)]
+ extern static bool gdk_quartz_set_fix_modifiers (bool fix);
+
+ static Gdk.Keymap keymap = Gdk.Keymap.Default;
+ static Dictionary<ulong,MappedKeys> mappedKeys = new Dictionary<ulong,MappedKeys> ();
+
+ /// <summary>Map raw GTK key input to work around platform bugs and decompose accelerator keys</summary>
+ /// <param name='evt'>The raw key event</param>
+ /// <param name='key'>The composed key</param>
+ /// <param name='state'>The composed modifiers</param>
+ /// <param name='shortcuts'>All the key/modifier decompositions that can be used as accelerators</param>
+ public static void MapKeys (Gdk.EventKey evt, out Gdk.Key key, out Gdk.ModifierType state,
+ out KeyboardShortcut[] shortcuts)
+ {
+ //this uniquely identifies the raw key
+ ulong id;
+ unchecked {
+ id = (((ulong)(uint)evt.State) | (((ulong)evt.HardwareKeycode) << 32) | (((ulong)evt.Group) << 48));
+ }
+
+ bool remapKey = Platform.IsWindows && evt.HardwareKeycode == 0;
+ MappedKeys mapped;
+ if (remapKey || !mappedKeys.TryGetValue (id, out mapped))
+ mappedKeys[id] = mapped = MapKeys (evt);
+
+ shortcuts = mapped.Shortcuts;
+ state = mapped.State;
+ key = mapped.Key;
+
+ if (remapKey) {
+ key = (Gdk.Key)evt.KeyValue;
+ }
+ }
+
+ static MappedKeys MapKeys (Gdk.EventKey evt)
+ {
+ MappedKeys mapped;
+ Gdk.ModifierType modifier = evt.State;
+ byte grp = evt.Group;
+
+ if (GtkMinorVersion >= 20) {
+ gdk_keymap_add_virtual_modifiers (keymap.Handle, ref modifier);
+ }
+
+ //full key mapping
+ uint keyval;
+ int effectiveGroup, level;
+ Gdk.ModifierType consumedModifiers;
+ TranslateKeyboardState (evt, modifier, grp, out keyval, out effectiveGroup,
+ out level, out consumedModifiers);
+ mapped.Key = (Gdk.Key)keyval;
+ mapped.State = FixMacModifiers (evt.State & ~consumedModifiers, grp);
+
+ //decompose the key into accel combinations
+ var accelList = new List<KeyboardShortcut> ();
+
+ const Gdk.ModifierType accelMods = Gdk.ModifierType.ShiftMask | Gdk.ModifierType.Mod1Mask
+ | Gdk.ModifierType.ControlMask | Gdk.ModifierType.SuperMask |Gdk.ModifierType.MetaMask;
+
+ //all accels ignore the lock key
+ modifier &= ~Gdk.ModifierType.LockMask;
+
+ //fully decomposed
+ TranslateKeyboardState (evt, Gdk.ModifierType.None, 0,
+ out keyval, out effectiveGroup, out level, out consumedModifiers);
+ accelList.Add (new KeyboardShortcut ((Gdk.Key)keyval, FixMacModifiers (modifier, grp) & accelMods));
+
+ //with shift composed
+ if ((modifier & Gdk.ModifierType.ShiftMask) != 0) {
+ keymap.TranslateKeyboardState (evt.HardwareKeycode, Gdk.ModifierType.ShiftMask, 0,
+ out keyval, out effectiveGroup, out level, out consumedModifiers);
+
+ if (Platform.IsWindows && evt.HardwareKeycode == 0) {
+ keyval = (ushort)evt.KeyValue;
+ }
+
+ // Prevent consumption of non-Shift modifiers (that we didn't even provide!)
+ consumedModifiers &= Gdk.ModifierType.ShiftMask;
+
+ var m = FixMacModifiers ((modifier & ~consumedModifiers), grp) & accelMods;
+ AddIfNotDuplicate (accelList, new KeyboardShortcut ((Gdk.Key)keyval, m));
+ }
+
+ //with group 1 composed
+ if (grp == 1) {
+ TranslateKeyboardState (evt, modifier & ~Gdk.ModifierType.ShiftMask, 1,
+ out keyval, out effectiveGroup, out level, out consumedModifiers);
+
+ // Prevent consumption of Shift modifier (that we didn't even provide!)
+ consumedModifiers &= ~Gdk.ModifierType.ShiftMask;
+
+ var m = FixMacModifiers ((modifier & ~consumedModifiers), 0) & accelMods;
+ AddIfNotDuplicate (accelList, new KeyboardShortcut ((Gdk.Key)keyval, m));
+ }
+
+ //with group 1 and shift composed
+ if (grp == 1 && (modifier & Gdk.ModifierType.ShiftMask) != 0) {
+ TranslateKeyboardState (evt, modifier, 1,
+ out keyval, out effectiveGroup, out level, out consumedModifiers);
+ var m = FixMacModifiers ((modifier & ~consumedModifiers), 0) & accelMods;
+ AddIfNotDuplicate (accelList, new KeyboardShortcut ((Gdk.Key)keyval, m));
+ }
+
+ //and also allow the fully mapped key as an accel
+ AddIfNotDuplicate (accelList, new KeyboardShortcut (mapped.Key, mapped.State & accelMods));
+
+ mapped.Shortcuts = accelList.ToArray ();
+ return mapped;
+ }
+
+ // Workaround for bug "Bug 688247 - Ctrl+Alt key not work on windows7 with bootcamp on a Mac Book Pro"
+ // Ctrl+Alt should behave like right alt key - unfortunately TranslateKeyboardState doesn't handle it.
+ static void TranslateKeyboardState (Gdk.EventKey evt, Gdk.ModifierType state, int group, out uint keyval,
+ out int effective_group, out int level, out Gdk.ModifierType consumed_modifiers)
+ {
+ uint hardware_keycode = evt.HardwareKeycode;
+
+ if (Platform.IsWindows) {
+ const Gdk.ModifierType ctrlAlt = Gdk.ModifierType.ControlMask | Gdk.ModifierType.Mod1Mask;
+ if ((state & ctrlAlt) == ctrlAlt) {
+ state = (state & ~ctrlAlt) | Gdk.ModifierType.Mod2Mask;
+ group = 1;
+ }
+ // Case: Caps lock on + shift + key
+ // See: Bug 8069 - [UI Refresh] If caps lock is on, holding the shift key prevents typed characters from appearing
+ if (state.HasFlag (Gdk.ModifierType.ShiftMask)) {
+ state &= ~Gdk.ModifierType.ShiftMask;
+ }
+ }
+
+ keymap.TranslateKeyboardState (hardware_keycode, state, group, out keyval, out effective_group,
+ out level, out consumed_modifiers);
+
+ if (Platform.IsWindows && hardware_keycode == 0) {
+ keyval = evt.KeyValue;
+ }
+ }
+
+ static Gdk.ModifierType FixMacModifiers (Gdk.ModifierType mod, byte grp)
+ {
+ if (!oldMacKeyHacks)
+ return mod;
+
+ // Mac GTK+ maps the command key to the Mod1 modifier, which usually means alt/
+ // We map this instead to meta, because the Mac GTK+ has mapped the cmd key
+ // to the meta key (yay inconsistency!). IMO super would have been saner.
+ if ((mod & Gdk.ModifierType.Mod1Mask) != 0) {
+ mod ^= Gdk.ModifierType.Mod1Mask;
+ mod |= Gdk.ModifierType.MetaMask;
+ }
+
+ //some versions of GTK map opt as mod5, which converts to the virtual super modifier
+ if ((mod & (Gdk.ModifierType.Mod5Mask | Gdk.ModifierType.SuperMask)) != 0) {
+ mod ^= (Gdk.ModifierType.Mod5Mask | Gdk.ModifierType.SuperMask);
+ mod |= Gdk.ModifierType.Mod1Mask;
+ }
+
+ // When opt modifier is active, we need to decompose this to make the command appear correct for Mac.
+ // In addition, we can only inspect whether the opt/alt key is pressed by examining
+ // the key's "group", because the Mac GTK+ treats opt as a group modifier and does
+ // not expose it as an actual GDK modifier.
+ if (grp == (byte) 1) {
+ mod |= Gdk.ModifierType.Mod1Mask;
+ }
+
+ return mod;
+ }
+
+ static void AddIfNotDuplicate<T> (List<T> list, T item) where T : IEquatable<T>
+ {
+ for (int i = 0; i < list.Count; i++) {
+ if (list[i].Equals (item))
+ return;
+ }
+ list.Add (item);
+ }
+
+ [System.Runtime.InteropServices.DllImport (PangoUtil.LIBGDK, CallingConvention = CallingConvention.Cdecl)]
+ static extern IntPtr gdk_win32_drawable_get_handle (IntPtr drawable);
+
+ enum DwmWindowAttribute
+ {
+ NcRenderingEnabled = 1,
+ NcRenderingPolicy,
+ TransitionsForceDisabled,
+ AllowNcPaint,
+ CaptionButtonBounds,
+ NonClientRtlLayout,
+ ForceIconicRepresentation,
+ Flip3DPolicy,
+ ExtendedFrameBounds,
+ HasIconicBitmap,
+ DisallowPeek,
+ ExcludedFromPeek,
+ Last,
+ }
+
+ struct Win32Rect
+ {
+ public int Left, Top, Right, Bottom;
+
+ public Win32Rect (int left, int top, int right, int bottom)
+ {
+ this.Left = left;
+ this.Top = top;
+ this.Right = right;
+ this.Bottom = bottom;
+ }
+ }
+
+ [DllImport ("dwmapi.dll")]
+ static extern int DwmGetWindowAttribute (IntPtr hwnd, DwmWindowAttribute attribute, out Win32Rect value, int valueSize);
+
+ [DllImport ("dwmapi.dll")]
+ static extern int DwmIsCompositionEnabled (out bool enabled);
+
+ [DllImport (USER32DLL)]
+ static extern bool GetWindowRect (IntPtr hwnd, out Win32Rect rect);
+
+ public static void SetImCursorLocation (Gtk.IMContext ctx, Gdk.Window clientWindow, Gdk.Rectangle cursor)
+ {
+ // work around GTK+ Bug 663096 - Windows IME position is wrong when Aero glass is enabled
+ // https://bugzilla.gnome.org/show_bug.cgi?id=663096
+ if (Platform.IsWindows && System.Environment.OSVersion.Version.Major >= 6) {
+ bool enabled;
+ if (DwmIsCompositionEnabled (out enabled) == 0 && enabled) {
+ var hwnd = gdk_win32_drawable_get_handle (clientWindow.Toplevel.Handle);
+ Win32Rect rect;
+ // this module gets the WINVER=6 version of GetWindowRect, which returns the correct value
+ if (GetWindowRect (hwnd, out rect)) {
+ int x, y;
+ clientWindow.Toplevel.GetPosition (out x, out y);
+ cursor.X = cursor.X - x + rect.Left;
+ cursor.Y = cursor.Y - y + rect.Top - cursor.Height;
+ }
+ }
+ }
+ ctx.CursorLocation = cursor;
+ }
+
+ /// <summary>X coordinate of the pixels inside the right edge of the rectangle</summary>
+ /// <remarks>Workaround for inconsistency of Right property between GTK# versions</remarks>
+ public static int RightInside (this Gdk.Rectangle rect)
+ {
+ return rect.X + rect.Width - 1;
+ }
+
+ /// <summary>Y coordinate of the pixels inside the bottom edge of the rectangle</summary>
+ /// <remarks>Workaround for inconsistency of Bottom property between GTK# versions#</remarks>
+ public static int BottomInside (this Gdk.Rectangle rect)
+ {
+ return rect.Y + rect.Height - 1;
+ }
+
+ /// <summary>
+ /// Shows or hides the shadow of the window rendered by the native toolkit
+ /// </summary>
+ public static void ShowNativeShadow (Gtk.Window window, bool show)
+ {
+ if (Platform.IsMac) {
+ var ptr = gdk_quartz_window_get_nswindow (window.GdkWindow.Handle);
+ objc_msgSend_void_bool (ptr, sel_setHasShadow, show);
+ }
+ }
+
+ public static void UpdateNativeShadow (Gtk.Window window)
+ {
+ if (!Platform.IsMac)
+ return;
+
+ var ptr = gdk_quartz_window_get_nswindow (window.GdkWindow.Handle);
+ objc_msgSend_IntPtr (ptr, sel_invalidateShadow);
+ }
+
+ public static bool HasNSTextFieldFocus (Gdk.Window window)
+ {
+ if (Platform.IsMac) {
+ try {
+ return gdk_window_has_embedded_nsview_focus (window.Handle);
+ } catch (Exception) {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ [DllImport (PangoUtil.LIBGTKGLUE, CallingConvention = CallingConvention.Cdecl)]
+ static extern void gtksharp_container_leak_fixed_marker ();
+
+ static HashSet<Type> fixedContainerTypes;
+ static Dictionary<IntPtr,ForallDelegate> forallCallbacks;
+ static bool containerLeakFixed;
+
+ // Works around BXC #3801 - Managed Container subclasses are incorrectly resurrected, then leak.
+ // It does this by registering an alternative callback for gtksharp_container_override_forall, which
+ // ignores callbacks if the wrapper no longer exists. This means that the objects no longer enter a
+ // finalized->release->dispose->re-wrap resurrection cycle.
+ // We use a dynamic method to access internal/private GTK# API in a performant way without having to track
+ // per-instance delegates.
+ public static void FixContainerLeak (Gtk.Container c)
+ {
+ if (containerLeakFixed) {
+ return;
+ }
+
+ FixContainerLeak (c.GetType ());
+ }
+
+ static void FixContainerLeak (Type t)
+ {
+ if (containerLeakFixed) {
+ return;
+ }
+
+ if (fixedContainerTypes == null) {
+ try {
+ gtksharp_container_leak_fixed_marker ();
+ containerLeakFixed = true;
+ return;
+ } catch (EntryPointNotFoundException) {
+ }
+ fixedContainerTypes = new HashSet<Type>();
+ forallCallbacks = new Dictionary<IntPtr, ForallDelegate> ();
+ }
+
+ if (!fixedContainerTypes.Add (t)) {
+ return;
+ }
+
+ //need to fix the callback for the type and all the managed supertypes
+ var lookupGType = typeof (GLib.Object).GetMethod ("LookupGType", BindingFlags.Static | BindingFlags.NonPublic);
+ do {
+ var gt = (GLib.GType) lookupGType.Invoke (null, new[] { t });
+ var cb = CreateForallCallback (gt.Val);
+ forallCallbacks[gt.Val] = cb;
+ gtksharp_container_override_forall (gt.Val, cb);
+ t = t.BaseType;
+ } while (fixedContainerTypes.Add (t) && t.Assembly != typeof (Gtk.Container).Assembly);
+ }
+
+ static ForallDelegate CreateForallCallback (IntPtr gtype)
+ {
+ var dm = new DynamicMethod (
+ "ContainerForallCallback",
+ typeof(void),
+ new Type[] { typeof(IntPtr), typeof(bool), typeof(IntPtr), typeof(IntPtr) },
+ typeof(GtkWorkarounds).Module,
+ true);
+
+ var invokerType = typeof(Gtk.Container.CallbackInvoker);
+
+ //this was based on compiling a similar method and disassembling it
+ ILGenerator il = dm.GetILGenerator ();
+ var IL_002b = il.DefineLabel ();
+ var IL_003f = il.DefineLabel ();
+ var IL_0060 = il.DefineLabel ();
+ var label_return = il.DefineLabel ();
+
+ var loc_container = il.DeclareLocal (typeof(Gtk.Container));
+ var loc_obj = il.DeclareLocal (typeof(object));
+ var loc_invoker = il.DeclareLocal (invokerType);
+ var loc_ex = il.DeclareLocal (typeof(Exception));
+
+ //check that the type is an exact match
+ // prevent stack overflow, because the callback on a more derived type will handle everything
+ il.Emit (OpCodes.Ldarg_0);
+ il.Emit (OpCodes.Call, typeof(GLib.ObjectManager).GetMethod ("gtksharp_get_type_id", BindingFlags.Static | BindingFlags.NonPublic));
+
+ il.Emit (OpCodes.Ldc_I8, gtype.ToInt64 ());
+ il.Emit (OpCodes.Newobj, typeof (IntPtr).GetConstructor (new Type[] { typeof (Int64) }));
+ il.Emit (OpCodes.Call, typeof (IntPtr).GetMethod ("op_Equality", BindingFlags.Static | BindingFlags.Public));
+ il.Emit (OpCodes.Brfalse, label_return);
+
+ il.BeginExceptionBlock ();
+ il.Emit (OpCodes.Ldnull);
+ il.Emit (OpCodes.Stloc, loc_container);
+ il.Emit (OpCodes.Ldsfld, typeof (GLib.Object).GetField ("Objects", BindingFlags.Static | BindingFlags.NonPublic));
+ il.Emit (OpCodes.Ldarg_0);
+ il.Emit (OpCodes.Box, typeof (IntPtr));
+ il.Emit (OpCodes.Callvirt, typeof (System.Collections.Hashtable).GetProperty ("Item").GetGetMethod ());
+ il.Emit (OpCodes.Stloc, loc_obj);
+ il.Emit (OpCodes.Ldloc, loc_obj);
+ il.Emit (OpCodes.Brfalse, IL_002b);
+
+ var tref = typeof (GLib.Object).Assembly.GetType ("GLib.ToggleRef");
+ il.Emit (OpCodes.Ldloc, loc_obj);
+ il.Emit (OpCodes.Castclass, tref);
+ il.Emit (OpCodes.Callvirt, tref.GetProperty ("Target").GetGetMethod ());
+ il.Emit (OpCodes.Isinst, typeof (Gtk.Container));
+ il.Emit (OpCodes.Stloc, loc_container);
+
+ il.MarkLabel (IL_002b);
+ il.Emit (OpCodes.Ldloc, loc_container);
+ il.Emit (OpCodes.Brtrue, IL_003f);
+
+ il.Emit (OpCodes.Ldarg_0);
+ il.Emit (OpCodes.Ldarg_1);
+ il.Emit (OpCodes.Ldarg_2);
+ il.Emit (OpCodes.Ldarg_3);
+ il.Emit (OpCodes.Call, typeof (Gtk.Container).GetMethod ("gtksharp_container_base_forall", BindingFlags.Static | BindingFlags.NonPublic));
+ il.Emit (OpCodes.Br, IL_0060);
+
+ il.MarkLabel (IL_003f);
+ il.Emit (OpCodes.Ldloca_S, 2);
+ il.Emit (OpCodes.Ldarg_2);
+ il.Emit (OpCodes.Ldarg_3);
+ il.Emit (OpCodes.Call, invokerType.GetConstructor (
+ BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[] { typeof (IntPtr), typeof (IntPtr) }, null));
+ il.Emit (OpCodes.Ldloc, loc_container);
+ il.Emit (OpCodes.Ldarg_1);
+ il.Emit (OpCodes.Ldloc, loc_invoker);
+ il.Emit (OpCodes.Box, invokerType);
+ il.Emit (OpCodes.Ldftn, invokerType.GetMethod ("Invoke"));
+ il.Emit (OpCodes.Newobj, typeof (Gtk.Callback).GetConstructor (
+ BindingFlags.Instance | BindingFlags.Public, null, new Type[] { typeof (object), typeof (IntPtr) }, null));
+ var forallMeth = typeof (Gtk.Container).GetMethod ("ForAll",
+ BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[] { typeof (bool), typeof (Gtk.Callback) }, null);
+ il.Emit (OpCodes.Callvirt, forallMeth);
+
+ il.MarkLabel (IL_0060);
+
+ il.BeginCatchBlock (typeof (Exception));
+ il.Emit (OpCodes.Stloc, loc_ex);
+ il.Emit (OpCodes.Ldloc, loc_ex);
+ il.Emit (OpCodes.Ldc_I4_0);
+ il.Emit (OpCodes.Call, typeof (GLib.ExceptionManager).GetMethod ("RaiseUnhandledException"));
+ il.Emit (OpCodes.Leave, label_return);
+ il.EndExceptionBlock ();
+
+ il.MarkLabel (label_return);
+ il.Emit (OpCodes.Ret);
+
+ return (ForallDelegate) dm.CreateDelegate (typeof (ForallDelegate));
+ }
+
+ [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
+ delegate void ForallDelegate (IntPtr container, bool include_internals, IntPtr cb, IntPtr data);
+
+ [DllImport(PangoUtil.LIBGTKGLUE, CallingConvention = CallingConvention.Cdecl)]
+ static extern void gtksharp_container_override_forall (IntPtr gtype, ForallDelegate cb);
+
+ const string urlRegexStr = @"(http|ftp)s?\:\/\/[\w\d\.,;_/\-~%@()+:?&^=#!]*[\w\d/]";
+ static readonly Regex UrlRegex = new Regex (urlRegexStr, RegexOptions.Compiled | RegexOptions.ExplicitCapture);
+
+ public static string MarkupLinks (string text)
+ {
+ if (GtkMinorVersion < 18)
+ return text;
+ return UrlRegex.Replace (text, MatchToUrl);
+ }
+
+ static string MatchToUrl (System.Text.RegularExpressions.Match m)
+ {
+ var s = m.ToString ();
+ return String.Format ("<a href='{0}'>{1}</a>", s, s.Replace ("_", "__"));
+ }
+
+ public static void SetLinkHandler (this Gtk.Label label, Action<string> urlHandler)
+ {
+ if (GtkMinorVersion >= 18)
+ new UrlHandlerClosure (urlHandler).ConnectTo (label);
+ }
+
+ //create closure manually so we can apply ConnectBefore
+ class UrlHandlerClosure
+ {
+ Action<string> urlHandler;
+
+ public UrlHandlerClosure (Action<string> urlHandler)
+ {
+ this.urlHandler = urlHandler;
+ }
+
+ [GLib.ConnectBefore]
+ void HandleLink (object sender, ActivateLinkEventArgs args)
+ {
+ urlHandler (args.Url);
+ args.RetVal = true;
+ }
+
+ public void ConnectTo (Gtk.Label label)
+ {
+ var signal = GLib.Signal.Lookup (label, "activate-link", typeof(ActivateLinkEventArgs));
+ signal.AddDelegate (new EventHandler<ActivateLinkEventArgs> (HandleLink));
+ }
+
+ class ActivateLinkEventArgs : GLib.SignalArgs
+ {
+ public string Url { get { return (string)base.Args [0]; } }
+ }
+ }
+
+ static bool canSetOverlayScrollbarPolicy = true;
+
+ [DllImport (PangoUtil.LIBQUARTZ)]
+ static extern void gtk_scrolled_window_set_overlay_policy (IntPtr sw, Gtk.PolicyType hpolicy, Gtk.PolicyType vpolicy);
+
+ [DllImport (PangoUtil.LIBQUARTZ)]
+ static extern void gtk_scrolled_window_get_overlay_policy (IntPtr sw, out Gtk.PolicyType hpolicy, out Gtk.PolicyType vpolicy);
+
+ public static void SetOverlayScrollbarPolicy (Gtk.ScrolledWindow sw, Gtk.PolicyType hpolicy, Gtk.PolicyType vpolicy)
+ {
+ if (!canSetOverlayScrollbarPolicy) {
+ return;
+ }
+ try {
+ gtk_scrolled_window_set_overlay_policy (sw.Handle, hpolicy, vpolicy);
+ return;
+ } catch (DllNotFoundException) {
+ } catch (EntryPointNotFoundException) {
+ }
+ }
+
+ public static void GetOverlayScrollbarPolicy (Gtk.ScrolledWindow sw, out Gtk.PolicyType hpolicy, out Gtk.PolicyType vpolicy)
+ {
+ if (!canSetOverlayScrollbarPolicy) {
+ hpolicy = vpolicy = 0;
+ return;
+ }
+ try {
+ gtk_scrolled_window_get_overlay_policy (sw.Handle, out hpolicy, out vpolicy);
+ return;
+ } catch (DllNotFoundException) {
+ } catch (EntryPointNotFoundException) {
+ }
+ hpolicy = vpolicy = 0;
+ canSetOverlayScrollbarPolicy = false;
+ }
+
+ [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)]
+ static extern bool gtk_tree_view_get_tooltip_context (IntPtr raw, ref int x, ref int y, bool keyboard_tip, out IntPtr model, out IntPtr path, IntPtr iter);
+
+ //the GTK# version of this has 'out' instead of 'ref', preventing passing the x,y values in
+ public static bool GetTooltipContext (this TreeView tree, ref int x, ref int y, bool keyboardTip,
+ out TreeModel model, out TreePath path, out Gtk.TreeIter iter)
+ {
+ IntPtr intPtr = Marshal.AllocHGlobal (Marshal.SizeOf (typeof(TreeIter)));
+ IntPtr handle;
+ IntPtr intPtr2;
+ bool result = gtk_tree_view_get_tooltip_context (tree.Handle, ref x, ref y, keyboardTip, out handle, out intPtr2, intPtr);
+ model = TreeModelAdapter.GetObject (handle, false);
+ path = intPtr2 == IntPtr.Zero ? null : ((TreePath)GLib.Opaque.GetOpaque (intPtr2, typeof(TreePath), false));
+ iter = TreeIter.New (intPtr);
+ Marshal.FreeHGlobal (intPtr);
+ return result;
+ }
+
+ static bool supportsHiResIcons = true;
+
+ [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)]
+ static extern void gtk_icon_source_set_scale (IntPtr source, double scale);
+
+ [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)]
+ static extern void gtk_icon_source_set_scale_wildcarded (IntPtr source, bool setting);
+
+ [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)]
+ static extern double gtk_widget_get_scale_factor (IntPtr widget);
+
+ [DllImport (PangoUtil.LIBGDK, CallingConvention = CallingConvention.Cdecl)]
+ static extern double gdk_screen_get_monitor_scale_factor (IntPtr widget, int monitor);
+
+ [DllImport (PangoUtil.LIBGOBJECT, CallingConvention = CallingConvention.Cdecl)]
+ static extern IntPtr g_object_get_data (IntPtr source, string name);
+
+ [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)]
+ static extern IntPtr gtk_icon_set_render_icon_scaled (IntPtr handle, IntPtr style, int direction, int state, int size, IntPtr widget, IntPtr intPtr, ref double scale);
+
+ public static bool SetSourceScale (Gtk.IconSource source, double scale)
+ {
+ if (!supportsHiResIcons)
+ return false;
+
+ try {
+ gtk_icon_source_set_scale (source.Handle, scale);
+ return true;
+ } catch (DllNotFoundException) {
+ } catch (EntryPointNotFoundException) {
+ }
+ supportsHiResIcons = false;
+ return false;
+ }
+
+ public static bool SetSourceScaleWildcarded (Gtk.IconSource source, bool setting)
+ {
+ if (!supportsHiResIcons)
+ return false;
+
+ try {
+ gtk_icon_source_set_scale_wildcarded (source.Handle, setting);
+ return true;
+ } catch (DllNotFoundException) {
+ } catch (EntryPointNotFoundException) {
+ }
+ supportsHiResIcons = false;
+ return false;
+ }
+
+ public static Gdk.Pixbuf Get2xVariant (Gdk.Pixbuf px)
+ {
+ if (!supportsHiResIcons)
+ return null;
+
+ try {
+ IntPtr res = g_object_get_data (px.Handle, "gdk-pixbuf-2x-variant");
+ if (res != IntPtr.Zero && res != px.Handle)
+ return (Gdk.Pixbuf) GLib.Object.GetObject (res);
+ else
+ return null;
+ } catch (DllNotFoundException) {
+ } catch (EntryPointNotFoundException) {
+ }
+ supportsHiResIcons = false;
+ return null;
+ }
+
+ public static void Set2xVariant (Gdk.Pixbuf px, Gdk.Pixbuf variant2x)
+ {
+ }
+
+ public static double GetScaleFactor (Gtk.Widget w)
+ {
+ if (!supportsHiResIcons)
+ return 1;
+
+ try {
+ return gtk_widget_get_scale_factor (w.Handle);
+ } catch (DllNotFoundException) {
+ } catch (EntryPointNotFoundException) {
+ }
+ supportsHiResIcons = false;
+ return 1;
+ }
+
+ public static double GetScaleFactor (this Gdk.Screen screen, int monitor)
+ {
+ if (!supportsHiResIcons)
+ return 1;
+
+ try {
+ return gdk_screen_get_monitor_scale_factor (screen.Handle, monitor);
+ } catch (DllNotFoundException) {
+ } catch (EntryPointNotFoundException) {
+ }
+ supportsHiResIcons = false;
+ return 1;
+ }
+
+ public static double GetScaleFactor ()
+ {
+ return GetScaleFactor (Gdk.Screen.Default, 0);
+ }
+
+ public static double GetPixelScale ()
+ {
+ if (Platform.IsWindows)
+ return GetScaleFactor ();
+ else
+ return 1d;
+ }
+
+ public static int ConvertToPixelScale (int size)
+ {
+ double scale = GetPixelScale ();
+
+ return (int)(size * scale);
+ }
+
+ public static Gdk.Pixbuf RenderIcon (this Gtk.IconSet iconset, Gtk.Style style, Gtk.TextDirection direction, Gtk.StateType state, Gtk.IconSize size, Gtk.Widget widget, string detail, double scale)
+ {
+ if (scale == 1d)
+ return iconset.RenderIcon (style, direction, state, size, widget, detail);
+
+ if (!supportsHiResIcons)
+ return null;
+
+ try {
+ IntPtr intPtr = GLib.Marshaller.StringToPtrGStrdup (detail);
+ IntPtr o = gtk_icon_set_render_icon_scaled (iconset.Handle, (style != null) ? style.Handle : IntPtr.Zero, (int)direction, (int)state, (int)size, (widget != null) ? widget.Handle : IntPtr.Zero, intPtr, ref scale);
+ Gdk.Pixbuf result = (Gdk.Pixbuf) GLib.Object.GetObject (o);
+ GLib.Marshaller.Free (intPtr);
+ return result;
+ } catch (DllNotFoundException) {
+ } catch (EntryPointNotFoundException) {
+ }
+ supportsHiResIcons = false;
+ return null;
+ }
+
+ [DllImport (PangoUtil.LIBGTK, CallingConvention = CallingConvention.Cdecl)]
+ static extern void gtk_object_set_data (IntPtr raw, IntPtr key, IntPtr data);
+
+ public static void SetData<T> (Gtk.Object gtkobject, string key, T data) where T: struct
+ {
+ IntPtr pkey = GLib.Marshaller.StringToPtrGStrdup (key);
+ IntPtr pdata = Marshal.AllocHGlobal(Marshal.SizeOf(data));
+ Marshal.StructureToPtr(data, pdata, false);
+ gtk_object_set_data (gtkobject.Handle, pkey, pdata);
+ Marshal.FreeHGlobal(pdata);
+ GLib.Marshaller.Free (pkey);
+ gtkobject.Data [key] = data;
+ }
+
+ public static void SetTransparentBgHint (this Widget widget, bool enable)
+ {
+ SetData (widget, "transparent-bg-hint", enable);
+ }
+
+#if MAC
+ static void OnMappedDisableButtons (object sender, EventArgs args)
+ {
+ var window = (Gtk.Window)sender;
+
+ DisableButtonsInternal (window);
+
+ window.Mapped -= OnMappedDisableButtons;
+ }
+
+ static void DisableButtonsInternal (Gtk.Window window)
+ {
+ // GtkQuartz appears to ignore any attempts to set the window's type hint or window functions to disable
+ // minimize/maximize buttons. This may be because on Cocoa these are set at window creation and can only
+ // be changed afterwards by directly accessing the window button and disabling it like so.
+ NSWindow nsWindow = GtkMacInterop.GetNSWindow (window);
+
+ nsWindow.StandardWindowButton (NSWindowButton.MiniaturizeButton).Enabled = false;
+ nsWindow.StandardWindowButton (NSWindowButton.ZoomButton).Enabled = false;
+ }
+#endif
+
+ public static void DisableMinimizeMaximizeButtons (Gtk.Window window)
+ {
+#if MAC
+ if (window.IsMapped) {
+ DisableButtonsInternal (window);
+ return;
+ }
+
+ window.Mapped += OnMappedDisableButtons;
+#endif
+ }
+ }
+
+ public struct KeyboardShortcut : IEquatable<KeyboardShortcut>
+ {
+ public static readonly KeyboardShortcut Empty = new KeyboardShortcut ((Gdk.Key) 0, (Gdk.ModifierType) 0);
+
+ Gdk.ModifierType modifier;
+ Gdk.Key key;
+
+ public KeyboardShortcut (Gdk.Key key, Gdk.ModifierType modifier)
+ {
+ this.modifier = modifier;
+ this.key = key;
+ }
+
+ public Gdk.Key Key {
+ get { return key; }
+ }
+
+ public Gdk.ModifierType Modifier {
+ get { return modifier; }
+ }
+
+ public bool IsEmpty {
+ get { return Key == (Gdk.Key) 0; }
+ }
+
+ public override bool Equals (object obj)
+ {
+ return obj is KeyboardShortcut && this.Equals ((KeyboardShortcut) obj);
+ }
+
+ public override int GetHashCode ()
+ {
+ //FIXME: we're only using a few bits of mod and mostly the lower bits of key - distribute it better
+ return (int) Key ^ (int) Modifier;
+ }
+
+ public bool Equals (KeyboardShortcut other)
+ {
+ return other.Key == Key && other.Modifier == Modifier;
+ }
+ }
+
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs
index d1de2f1c9f..6ad66fed98 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HPanedThin.cs
@@ -37,7 +37,7 @@ namespace MonoDevelop.Components
public HPanedThin ()
{
- Mono.TextEditor.GtkWorkarounds.FixContainerLeak (this);
+ GtkWorkarounds.FixContainerLeak (this);
handle = new CustomPanedHandle (this);
handle.Parent = this;
}
@@ -78,7 +78,7 @@ namespace MonoDevelop.Components
if (Child1 != null && Child1.Visible && Child2 != null && Child2.Visible) {
var gc = new Gdk.GC (evnt.Window);
- gc.RgbFgColor = Styles.ThinSplitterColor;
+ gc.RgbFgColor = Styles.ThinSplitterColor.ToGdkColor ();
var x = Child1.Allocation.X + Child1.Allocation.Width;
evnt.Window.DrawLine (gc, x, Allocation.Y, x, Allocation.Y + Allocation.Height);
gc.Dispose ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs
index 6edbdf9213..ec21b26c1b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HeaderBox.cs
@@ -25,7 +25,6 @@
// THE SOFTWARE.
using System;
using Gtk;
-using Mono.TextEditor;
namespace MonoDevelop.Components
{
@@ -171,6 +170,8 @@ namespace MonoDevelop.Components
cr.RelLineTo (-rect.Width, 0);
cr.RelLineTo (0, -rect.Height);
cr.ClosePath ();
+
+ // FIXME: VV: Remove gradient features
using (Cairo.Gradient pat = new Cairo.LinearGradient (rect.X, rect.Y, rect.X, rect.Bottom)) {
pat.AddColorStop (0, gcol.ToCairoColor ());
gcol.Light -= 0.1;
@@ -214,6 +215,7 @@ namespace MonoDevelop.Components
GdkWindow.DrawLine (borderColor, rect.Right - n, rect.Y, rect.Right - n, rect.Bottom);
if (showTopShadow) {
+ // FIXME: VV: Remove gradient features
using (Cairo.Context cr = Gdk.CairoHelper.Create (GdkWindow)) {
cr.Rectangle (Allocation.X, Allocation.Y, Allocation.Width, shadowSize);
using (Cairo.Gradient pat = new Cairo.LinearGradient (rect.X, rect.Y, rect.X, rect.Y + shadowSize)) {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HelperMethods.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HelperMethods.cs
new file mode 100644
index 0000000000..c4e6d316eb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HelperMethods.cs
@@ -0,0 +1,163 @@
+// HelperMethods.cs
+//
+// Cut & paste from PangoCairoHelper.
+//
+// Author:
+// Aaron Bockover <abockover@novell.com>
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using System;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Components
+{
+ public static class HelperMethods
+ {
+ [DllImport(PangoUtil.LIBPANGOCAIRO, CallingConvention=CallingConvention.Cdecl)]
+ static extern void pango_cairo_show_layout (IntPtr cr, IntPtr layout);
+
+ public static void ShowLayout (this Cairo.Context cr, Pango.Layout layout)
+ {
+ pango_cairo_show_layout (cr == null ? IntPtr.Zero : cr.Handle, layout == null ? IntPtr.Zero : layout.Handle);
+ }
+
+ [DllImport(PangoUtil.LIBPANGOCAIRO, CallingConvention=CallingConvention.Cdecl)]
+ static extern IntPtr pango_cairo_create_layout (IntPtr cr);
+
+ public static Pango.Layout CreateLayout (this Cairo.Context cr)
+ {
+ IntPtr raw_ret = pango_cairo_create_layout (cr == null ? IntPtr.Zero : cr.Handle);
+ return GLib.Object.GetObject (raw_ret) as Pango.Layout;
+ }
+
+ [DllImport(PangoUtil.LIBPANGOCAIRO, CallingConvention=CallingConvention.Cdecl)]
+ static extern void pango_cairo_layout_path (IntPtr cr, IntPtr layout);
+
+ public static void LayoutPath (this Cairo.Context cr, Pango.Layout layout)
+ {
+ pango_cairo_layout_path (cr == null ? IntPtr.Zero : cr.Handle, layout == null ? IntPtr.Zero : layout.Handle);
+ }
+
+ [DllImport(PangoUtil.LIBPANGOCAIRO, CallingConvention=CallingConvention.Cdecl)]
+ static extern void pango_cairo_context_set_resolution (IntPtr pango_context, double dpi);
+
+ public static void ContextSetResolution (this Pango.Context context, double dpi)
+ {
+ pango_cairo_context_set_resolution (context == null ? IntPtr.Zero : context.Handle, dpi);
+ }
+
+ [DllImport(PangoUtil.LIBPANGOCAIRO, CallingConvention=CallingConvention.Cdecl)]
+ static extern IntPtr pango_layout_get_context (IntPtr layout);
+
+ public static string GetColorString (Gdk.Color color)
+ {
+ return string.Format ("#{0:X02}{1:X02}{2:X02}", color.Red / 256, color.Green / 256, color.Blue / 256);
+ }
+
+ public static Pango.Context LayoutGetContext (this Pango.Layout layout)
+ {
+ IntPtr handle = pango_layout_get_context (layout.Handle);
+ return handle.Equals (IntPtr.Zero) ? null : GLib.Object.GetObject (handle) as Pango.Context;
+ }
+
+ public static double GetPixelBaseline (this Pango.Layout layout)
+ {
+ return layout.Iter.Baseline / Pango.Scale.PangoScale;
+ }
+
+ public static void DrawLine (this Cairo.Context cr, Cairo.Color color, double x1, double y1, double x2, double y2)
+ {
+ cr.SetSourceColor (color);
+ cr.MoveTo (x1, y1);
+ cr.LineTo (x2, y2);
+ cr.Stroke ();
+ }
+
+ public static void Line (this Cairo.Context cr, double x1, double y1, double x2, double y2)
+ {
+ cr.MoveTo (x1, y1);
+ cr.LineTo (x2, y2);
+ }
+
+ public static void SharpLineX (this Cairo.Context cr, double x1, double y1, double x2, double y2)
+ {
+ cr.MoveTo (x1 + 0.5, y1);
+ cr.LineTo (x2 + 0.5, y2);
+ }
+
+ public static void SharpLineY (this Cairo.Context cr, double x1, double y1, double x2, double y2)
+ {
+ cr.MoveTo (x1, y1 + 0.5);
+ cr.LineTo (x2, y2 + 0.5);
+ }
+
+ public static void SetSourceColor (this Cairo.Context cr, Cairo.Color color)
+ {
+ cr.SetSourceRGBA (color.R, color.G, color.B, color.A);
+ }
+
+ public static bool Contains (this Cairo.Rectangle rect, Gdk.Point point)
+ {
+ return ((point.X >= rect.X) && (point.X < (rect.X + rect.Width)) &&
+ (point.Y >= rect.Y) && (point.Y < (rect.Y + rect.Height)));
+ }
+
+ public static bool Contains (this Cairo.Rectangle rect, double x, double y)
+ {
+ return ((x >= rect.X) && (x < (rect.X + rect.Width)) &&
+ (y >= rect.Y) && (y < (rect.Y + rect.Height)));
+ }
+
+ public static Cairo.Rectangle Inflate (this Cairo.Rectangle rect, double width, double height)
+ {
+ return new Cairo.Rectangle(
+ rect.X - width,
+ rect.Y - height,
+ rect.Width + (width * 2),
+ rect.Height + (height * 2)
+ );
+ }
+
+ //this is needed for building against old Mono.Cairo versions
+ [Obsolete]
+ public static void SetSource (this Cairo.Context cr, Cairo.Pattern pattern)
+ {
+ cr.Pattern = pattern;
+ }
+
+ [Obsolete]
+ public static Cairo.Surface GetTarget (this Cairo.Context cr)
+ {
+ return cr.Target;
+ }
+
+ [Obsolete]
+ public static void Dispose (this Cairo.Context cr)
+ {
+ ((IDisposable)cr).Dispose ();
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HslColor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HslColor.cs
new file mode 100644
index 0000000000..7e56d747d1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HslColor.cs
@@ -0,0 +1,292 @@
+//
+// HslColor.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Gdk;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Components
+{
+ public struct HslColor
+ {
+ public double H {
+ get;
+ set;
+ }
+
+ public double S {
+ get;
+ set;
+ }
+
+ public double L {
+ get;
+ set;
+ }
+
+ public double Alpha {
+ get;
+ set;
+ }
+
+ void ToRgb(out double r, out double g, out double b)
+ {
+ if (L == 0) {
+ r = g = b = 0;
+ return;
+ }
+
+ if (S == 0) {
+ r = g = b = L;
+ } else {
+ double temp2 = L <= 0.5 ? L * (1.0 + S) : L + S -(L * S);
+ double temp1 = 2.0 * L - temp2;
+
+ double[] t3 = new double[] { H + 1.0 / 3.0, H, H - 1.0 / 3.0};
+ double[] clr= new double[] { 0, 0, 0};
+ for (int i = 0; i < 3; i++) {
+ if (t3[i] < 0)
+ t3[i] += 1.0;
+ if (t3[i] > 1)
+ t3[i]-=1.0;
+ if (6.0 * t3[i] < 1.0)
+ clr[i] = temp1 + (temp2 - temp1) * t3[i] * 6.0;
+ else if (2.0 * t3[i] < 1.0)
+ clr[i] = temp2;
+ else if (3.0 * t3[i] < 2.0)
+ clr[i] = (temp1 + (temp2 - temp1) * ((2.0 / 3.0) - t3[i]) * 6.0);
+ else
+ clr[i] = temp1;
+ }
+
+ r = clr[0];
+ g = clr[1];
+ b = clr[2];
+ }
+ }
+
+ public static implicit operator Color (HslColor hsl)
+ {
+ double r = 0, g = 0, b = 0;
+ hsl.ToRgb (out r, out g, out b);
+ return new Color ((byte)(255 * r),
+ (byte)(255 * g),
+ (byte)(255 * b));
+ }
+
+ public static implicit operator Cairo.Color (HslColor hsl)
+ {
+ double r = 0, g = 0, b = 0;
+ hsl.ToRgb (out r, out g, out b);
+ return new Cairo.Color (r, g, b, hsl.Alpha);
+ }
+
+ public static implicit operator HslColor (Color color)
+ {
+ return new HslColor (color);
+ }
+
+ public static implicit operator HslColor (Cairo.Color color)
+ {
+ return new HslColor (color);
+ }
+
+ #if MAC
+
+ public static implicit operator HslColor (AppKit.NSColor color)
+ {
+ return new HslColor ((double)color.RedComponent, (double)color.GreenComponent, (double)color.BlueComponent);
+ }
+
+ public static implicit operator AppKit.NSColor (HslColor hsl)
+ {
+ double r = 0, g = 0, b = 0;
+ hsl.ToRgb (out r, out g, out b);
+ return AppKit.NSColor.FromDeviceRgba ((nfloat)r, (nfloat)g, (nfloat)b, (nfloat)hsl.Alpha);
+ }
+
+
+ public static implicit operator CoreGraphics.CGColor (HslColor hsl)
+ {
+ double r = 0, g = 0, b = 0;
+ hsl.ToRgb (out r, out g, out b);
+ return new CoreGraphics.CGColor ((nfloat)r, (nfloat)g, (nfloat)b, (nfloat)hsl.Alpha);
+ }
+ #endif
+
+
+ public static HslColor FromHsl (double h, double s, double l)
+ {
+ return new HslColor {
+ H = h,
+ S = s,
+ L = l,
+ Alpha = 1.0d
+ };
+ }
+
+ public uint ToPixel ()
+ {
+ double r, g, b;
+ ToRgb(out r, out g, out b);
+ uint rv = (uint)(r * 255);
+ uint gv = (uint)(g * 255);
+ uint bv = (uint)(b * 255);
+ return rv << 16 | gv << 8 | bv;
+ }
+
+ public static HslColor FromPixel (uint pixel)
+ {
+ var r = ((pixel >> 16) & 0xFF) / 255.0;
+ var g = ((pixel >> 8) & 0xFF) / 255.0;
+ var b = (pixel & 0xFF) / 255.0;
+ return new HslColor (r, g, b);
+ }
+
+ public HslColor (double r, double g, double b, double a = 1.0) : this ()
+ {
+ double v = System.Math.Max (r, g);
+ v = System.Math.Max (v, b);
+
+ double m = System.Math.Min (r, g);
+ m = System.Math.Min (m, b);
+
+ this.L = (m + v) / 2.0;
+ if (this.L <= 0.0)
+ return;
+ double vm = v - m;
+ this.S = vm;
+
+ if (this.S > 0.0) {
+ this.S /= (this.L <= 0.5) ? (v + m) : (2.0 - v - m);
+ } else {
+ return;
+ }
+
+ double r2 = (v - r) / vm;
+ double g2 = (v - g) / vm;
+ double b2 = (v - b) / vm;
+
+ if (r == v) {
+ this.H = (g == m ? 5.0 + b2 : 1.0 - g2);
+ } else if (g == v) {
+ this.H = (b == m ? 1.0 + r2 : 3.0 - b2);
+ } else {
+ this.H = (r == m ? 3.0 + g2 : 5.0 - r2);
+ }
+ this.H /= 6.0;
+
+ this.Alpha = a;
+ }
+
+ public HslColor (Color color) : this (color.Red / (double)ushort.MaxValue, color.Green / (double)ushort.MaxValue, color.Blue / (double)ushort.MaxValue)
+ {
+ Alpha = 1.0;
+ }
+
+ public HslColor (Cairo.Color color) : this (color.R, color.G, color.B, color.A)
+ {
+ }
+
+ public static HslColor Parse (string color)
+ {
+ Gdk.Color col = new Gdk.Color (0, 0, 0);
+ Gdk.Color.Parse (color, ref col);
+ return (HslColor)col;
+ }
+
+ public static double Brightness (HslColor c)
+ {
+ return Brightness ((Cairo.Color)c);
+ }
+
+ public static double Brightness (Cairo.Color c)
+ {
+ double r = c.R;
+ double g = c.G;
+ double b = c.B;
+ return System.Math.Sqrt (r * .241 + g * .691 + b * .068);
+ }
+
+ public static double Brightness (Gdk.Color c)
+ {
+ double r = c.Red / (double)ushort.MaxValue;
+ double g = c.Green / (double)ushort.MaxValue;
+ double b = c.Blue / (double)ushort.MaxValue;
+ return System.Math.Sqrt (r * .241 + g * .691 + b * .068);
+ }
+
+ public static List<HslColor> GenerateHighlightColors (HslColor backGround, HslColor foreGround, int n)
+ {
+ double bgH = (backGround.H == 0 && backGround.S == 0) ? 2 / 3.0 : backGround.H;
+ var result = new List<HslColor> ();
+ for (int i = 0; i < n; i++) {
+ double h = bgH + (i + 1.0) / (double)n;
+
+ // for monochromatic backround the h value doesn't matter
+ if (i + 1 == n && !(backGround.H == 0 && backGround.S == 0))
+ h = bgH + 0.5;
+
+ if (h > 1.0)
+ h -= 1.0;
+
+ double s = 0.85;
+ double l = 0.5;
+ if (backGround.H == 0 && backGround.S == 0 && backGround.L < 0.5)
+ l = 0.8;
+ result.Add (HslColor.FromHsl (h, s, l));
+ }
+ return result;
+ }
+
+ public override string ToString ()
+ {
+ return string.Format ("[HslColor: H={0}, S={1}, L={2}, A={3}]", H, S, L, Alpha);
+ }
+
+ public string ToPangoString ()
+ {
+ var resultColor = (Cairo.Color)this;
+ return string.Format ("#{0:x2}{1:x2}{2:x2}",
+ (int)(resultColor.R * 255),
+ (int)(resultColor.G * 255),
+ (int)(resultColor.B * 255));
+ }
+
+
+ public string ToMarkup ()
+ {
+ if (Alpha == 1.0)
+ return ToPangoString ();
+ var resultColor = (Cairo.Color)this;
+ return string.Format ("#{0:x2}{1:x2}{2:x2}{3:x2}",
+ (int)(resultColor.R * 255),
+ (int)(resultColor.G * 255),
+ (int)(resultColor.B * 255),
+ (int)(resultColor.A * 255));
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeDialog.cs
new file mode 100644
index 0000000000..eb920c151f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeDialog.cs
@@ -0,0 +1,46 @@
+//
+// IdeDialog.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Gtk;
+using MonoDevelop.Components.Theming;
+
+namespace MonoDevelop.Components
+{
+ public class IdeDialog: Gtk.Dialog
+ {
+ public IdeDialog ()
+ {
+ IdeTheme.ApplyTheme (this);
+ GtkWorkarounds.DisableMinimizeMaximizeButtons (this);
+ }
+
+ public IdeDialog (string title, Gtk.Window parentWindow, DialogFlags flags): base (title, parentWindow, flags)
+ {
+ IdeTheme.ApplyTheme (this);
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs
new file mode 100644
index 0000000000..11c939e6a5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeTheme.cs
@@ -0,0 +1,367 @@
+//
+// ThemeExtensions.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.IO;
+using MonoDevelop.Core;
+using MonoDevelop.Ide;
+using MonoDevelop.Ide.Gui;
+using System.Linq;
+
+#if MAC
+using AppKit;
+using Foundation;
+using MonoDevelop.Components.Mac;
+#endif
+
+namespace MonoDevelop.Components
+{
+ public static class IdeTheme
+ {
+ internal static string DefaultTheme;
+ internal static string DefaultGtkDataFolder;
+ internal static string DefaultGtk2RcFiles;
+
+ public static Skin UserInterfaceSkin { get; private set; }
+
+ static IdeTheme ()
+ {
+ DefaultGtkDataFolder = Environment.GetEnvironmentVariable ("GTK_DATA_PREFIX");
+ DefaultGtk2RcFiles = Environment.GetEnvironmentVariable ("GTK2_RC_FILES");
+ // FIXME: Immediate theme switching disabled, until:
+ // MAC: NSAppearance issues are fixed
+ // WIN: spradic Gtk crashes on theme realoding are fixed
+ //IdeApp.Preferences.UserInterfaceTheme.Changed += (sender, e) => UpdateGtkTheme ();
+ }
+
+ internal static void InitializeGtk (string progname, ref string[] args)
+ {
+ if (Gtk.Settings.Default != null)
+ throw new InvalidOperationException ("Gtk already initialized!");
+
+ //HACK: we must initilize some Gtk rc before Gtk.Application is initialized on Mac/Windows
+ // otherwise it will not be loaded correctly and theme switching won't work.
+ if (!Platform.IsLinux)
+ UpdateGtkTheme ();
+
+ Gtk.Application.Init (BrandingService.ApplicationName, ref args);
+
+ // Reset our environment after initialization on Mac
+ if (Platform.IsMac)
+ Environment.SetEnvironmentVariable ("GTK2_RC_FILES", DefaultGtk2RcFiles);
+ }
+
+ internal static void SetupXwtTheme ()
+ {
+ Xwt.Drawing.Context.RegisterStyles ("dark", "disabled");
+
+ if (Core.Platform.IsMac) {
+ Xwt.Drawing.Context.RegisterStyles ("mac", "sel");
+ Xwt.Drawing.Context.SetGlobalStyle ("mac");
+ } else if (Core.Platform.IsWindows) {
+ Xwt.Drawing.Context.RegisterStyles ("win");
+ Xwt.Drawing.Context.SetGlobalStyle ("win");
+ } else if (Core.Platform.IsLinux) {
+ Xwt.Drawing.Context.RegisterStyles ("linux");
+ Xwt.Drawing.Context.SetGlobalStyle ("linux");
+ }
+
+ Xwt.Toolkit.CurrentEngine.RegisterBackend <Xwt.Backends.IWindowBackend, ThemedGtkWindowBackend>();
+ Xwt.Toolkit.CurrentEngine.RegisterBackend <Xwt.Backends.IDialogBackend, ThemedGtkDialogBackend>();
+ }
+
+ internal static void SetupGtkTheme ()
+ {
+ if (Gtk.Settings.Default == null)
+ return;
+
+ if (Platform.IsLinux) {
+ DefaultTheme = Gtk.Settings.Default.ThemeName;
+ string theme = IdeApp.Preferences.UserInterfaceTheme;
+ if (string.IsNullOrEmpty (theme))
+ theme = DefaultTheme;
+ ValidateGtkTheme (ref theme);
+ if (theme != DefaultTheme)
+ Gtk.Settings.Default.ThemeName = theme;
+ LoggingService.LogInfo ("GTK: Using Gtk theme from {0}", Path.Combine (Gtk.Rc.ThemeDir, Gtk.Settings.Default.ThemeName));
+ } else
+ DefaultTheme = "Light";
+
+ // HACK: on Windows we have to load the theme twice on startup. During the first run we
+ // set the environment variables from InitializeGtk() and after Gtk initialization
+ // we set the active theme from here. Otherwise Gtk will preload the default theme with
+ // the Wimp engine, which can break our own configs.
+ if (Platform.IsWindows)
+ UpdateGtkTheme ();
+ }
+
+ internal static void UpdateGtkTheme ()
+ {
+ if (DefaultTheme == null)
+ SetupGtkTheme ();
+
+ string current_theme = IdeApp.Preferences.UserInterfaceTheme;
+
+ if (!Platform.IsLinux) {
+ UserInterfaceSkin = IdeApp.Preferences.UserInterfaceTheme == "Dark" ? Skin.Dark : Skin.Light;
+ if (current_theme != UserInterfaceSkin.ToString ()) // Only Skin names allowed on Win/Mac
+ current_theme = UserInterfaceSkin.ToString ();
+ }
+
+ var use_bundled_theme = false;
+
+
+ // Use the bundled gtkrc only if the Xamarin theme is installed
+ if (File.Exists (Path.Combine (Gtk.Rc.ModuleDir, "libxamarin.so")) || File.Exists (Path.Combine (Gtk.Rc.ModuleDir, "libxamarin.dll")))
+ use_bundled_theme = true;
+ // on Windows we can't rely on Gtk.Rc.ModuleDir to be valid
+ // and test additionally the default installation dir
+ if (!use_bundled_theme && Platform.IsWindows) {
+ var gtkBasePath = Environment.GetEnvironmentVariable ("GTK_BASEPATH");
+ if (String.IsNullOrEmpty (gtkBasePath))
+ gtkBasePath = "C:\\Program Files (x86)\\GtkSharp\\2.12\\";
+ if (File.Exists (Path.Combine (gtkBasePath, "lib\\gtk-2.0\\2.10.0\\engines\\libxamarin.dll")))
+ use_bundled_theme = true;
+ }
+
+ if (use_bundled_theme) {
+
+ if (!Directory.Exists (UserProfile.Current.ConfigDir))
+ Directory.CreateDirectory (UserProfile.Current.ConfigDir);
+
+ if (Platform.IsWindows) {
+ // HACK: Gtk Bug: Rc.ReparseAll () and the include "[rcfile]" gtkrc statement are broken on Windows.
+ // We must provide our own XDG folder structure to switch bundled themes.
+ var rc_themes = UserProfile.Current.ConfigDir.Combine ("share", "themes");
+ var rc_theme_light = rc_themes.Combine ("Light", "gtk-2.0", "gtkrc");
+ var rc_theme_dark = rc_themes.Combine ("Dark", "gtk-2.0", "gtkrc");
+ if (!Directory.Exists (rc_theme_light.ParentDirectory))
+ Directory.CreateDirectory (rc_theme_light.ParentDirectory);
+ if (!Directory.Exists (rc_theme_dark.ParentDirectory))
+ Directory.CreateDirectory (rc_theme_dark.ParentDirectory);
+
+ string gtkrc = PropertyService.EntryAssemblyPath.Combine ("gtkrc");
+ File.Copy (gtkrc + ".win32", rc_theme_light, true);
+ File.Copy (gtkrc + ".win32-dark", rc_theme_dark, true);
+
+ var themeDir = UserProfile.Current.ConfigDir;
+ if (!themeDir.IsAbsolute)
+ themeDir = themeDir.ToAbsolute (Environment.CurrentDirectory);
+ Environment.SetEnvironmentVariable ("GTK_DATA_PREFIX", themeDir);
+
+ // set the actual theme and reset the environment only after Gtk has been fully
+ // initialized. See SetupGtkTheme ().
+ if (Gtk.Settings.Default != null) {
+ LoggingService.LogInfo ("GTK: Using Gtk theme from {0}", Path.Combine (Gtk.Rc.ThemeDir, current_theme));
+ Gtk.Settings.Default.ThemeName = current_theme;
+ Environment.SetEnvironmentVariable ("GTK_DATA_PREFIX", DefaultGtkDataFolder);
+ }
+
+ } else if (Platform.IsMac) {
+
+ var gtkrc = "gtkrc.mac";
+ if (IdeApp.Preferences.UserInterfaceSkin == Skin.Dark)
+ gtkrc += "-dark";
+ gtkrc = PropertyService.EntryAssemblyPath.Combine (gtkrc);
+
+ LoggingService.LogInfo ("GTK: Using gtkrc from {0}", gtkrc);
+
+ // Generate a dummy rc file and use that to include the real rc. This allows changing the rc
+ // on the fly. All we have to do is rewrite the dummy rc changing the include and call ReparseAll
+ var rcFile = UserProfile.Current.ConfigDir.Combine ("gtkrc");
+ File.WriteAllText (rcFile, "include \"" + gtkrc + "\"");
+ Environment.SetEnvironmentVariable ("GTK2_RC_FILES", rcFile);
+
+ Gtk.Rc.ReparseAll ();
+
+ // reset the environment only after Gtk has been fully initialized. See SetupGtkTheme ().
+ if (Gtk.Settings.Default != null)
+ Environment.SetEnvironmentVariable ("GTK2_RC_FILES", DefaultGtk2RcFiles);
+ }
+
+ } else if (Gtk.Settings.Default != null && current_theme != Gtk.Settings.Default.ThemeName) {
+ LoggingService.LogInfo ("GTK: Using Gtk theme from {0}", Path.Combine (Gtk.Rc.ThemeDir, current_theme));
+ Gtk.Settings.Default.ThemeName = current_theme;
+ }
+
+ // let Gtk realize the new theme
+ // Style is being updated by DefaultWorkbench.OnStyleSet ()
+ // This ensures that the theme and all styles have been loaded when
+ // the Styles.Changed event is raised.
+ //GLib.Timeout.Add (50, delegate { UpdateStyles(); return false; });
+ }
+
+ internal static void UpdateStyles ()
+ {
+ if (Platform.IsLinux) {
+ var defaultStyle = Gtk.Rc.GetStyle (IdeApp.Workbench.RootWindow);
+ var bgColor = defaultStyle.Background (Gtk.StateType.Normal);
+ UserInterfaceSkin = HslColor.Brightness (bgColor) < 0.5 ? Skin.Dark : Skin.Light;
+ }
+
+ if (UserInterfaceSkin == Skin.Dark)
+ Xwt.Drawing.Context.SetGlobalStyle ("dark");
+ else
+ Xwt.Drawing.Context.ClearGlobalStyle ("dark");
+
+ Styles.LoadStyle ();
+ #if MAC
+ UpdateMacWindows ();
+ #endif
+ }
+
+ internal static string[] gtkThemeFallbacks = new string[] {
+ "Xamarin",// the best!
+ "Gilouche", // SUSE
+ "Mint-X", // MINT
+ "Radiance", // Ubuntu 'light' theme (MD looks better with the light theme in 4.0 - if that changes switch this one)
+ "Clearlooks" // GTK theme
+ };
+
+ static void ValidateGtkTheme (ref string theme)
+ {
+ if (!MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.IsBadGtkTheme (theme))
+ return;
+
+ var themes = MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.InstalledThemes;
+
+ string fallback = gtkThemeFallbacks
+ .Select (fb => themes.FirstOrDefault (t => string.Compare (fb, t, StringComparison.OrdinalIgnoreCase) == 0))
+ .FirstOrDefault (t => t != null);
+
+ string message = "Theme Not Supported";
+
+ string detail;
+ if (themes.Count > 0) {
+ detail =
+ "Your system is using the '{0}' GTK+ theme, which is known to be very unstable. MonoDevelop will " +
+ "now switch to an alternate GTK+ theme.\n\n" +
+ "This message will continue to be shown at startup until you set a alternate GTK+ theme as your " +
+ "default in the GTK+ Theme Selector or MonoDevelop Preferences.";
+ } else {
+ detail =
+ "Your system is using the '{0}' GTK+ theme, which is known to be very unstable, and no other GTK+ " +
+ "themes appear to be installed. Please install another GTK+ theme.\n\n" +
+ "This message will continue to be shown at startup until you install a different GTK+ theme and " +
+ "set it as your default in the GTK+ Theme Selector or MonoDevelop Preferences.";
+ }
+
+ MessageService.GenericAlert (Gtk.Stock.DialogWarning, message, BrandingService.BrandApplicationName (detail), AlertButton.Ok);
+
+ theme = fallback ?? themes.FirstOrDefault () ?? theme;
+ }
+
+#if MAC
+ static Dictionary<NSWindow, NSObject> nsWindows = new Dictionary<NSWindow, NSObject> ();
+
+ public static void ApplyTheme (NSWindow window)
+ {
+ if (!nsWindows.ContainsKey(window)) {
+ nsWindows [window] = NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.WillCloseNotification, OnClose, window);
+ SetTheme (window);
+ }
+ }
+
+ static void SetTheme (NSWindow window)
+ {
+ if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light)
+ window.Appearance = NSAppearance.GetAppearance (NSAppearance.NameAqua);
+ else
+ window.Appearance = NSAppearance.GetAppearance (NSAppearance.NameVibrantDark);
+
+ if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light) {
+ window.StyleMask &= ~NSWindowStyle.TexturedBackground;
+ return;
+ }
+
+ if (window is NSPanel || window.ContentView.Class.Name != "GdkQuartzView")
+ window.BackgroundColor = MonoDevelop.Ide.Gui.Styles.BackgroundColor.ToNSColor ();
+ else {
+ object[] platforms = Mono.Addins.AddinManager.GetExtensionObjects ("/MonoDevelop/Core/PlatformService");
+ if (platforms.Length > 0) {
+ var platformService = (MonoDevelop.Ide.Desktop.PlatformService)platforms [0];
+ var image = Xwt.Drawing.Image.FromResource (platformService.GetType().Assembly, "maintoolbarbg.png");
+
+ window.IsOpaque = false;
+ window.BackgroundColor = NSColor.FromPatternImage (image.ToBitmap().ToNSImage());
+ }
+ }
+ window.StyleMask |= NSWindowStyle.TexturedBackground;
+ }
+
+ static void OnClose (NSNotification note)
+ {
+ var w = (NSWindow)note.Object;
+ NSNotificationCenter.DefaultCenter.RemoveObserver(nsWindows[w]);
+ nsWindows.Remove (w);
+ }
+
+ static void UpdateMacWindows ()
+ {
+ foreach (var w in nsWindows.Keys)
+ SetTheme (w);
+ }
+
+ static void OnGtkWindowRealized (object s, EventArgs a)
+ {
+ var nsw = MonoDevelop.Components.Mac.GtkMacInterop.GetNSWindow ((Gtk.Window) s);
+ if (nsw != null)
+ ApplyTheme (nsw);
+ }
+#endif
+
+ public static void ApplyTheme (this Gtk.Window window)
+ {
+ #if MAC
+ window.Realized += OnGtkWindowRealized;
+ if (window.IsRealized) {
+ var nsw = MonoDevelop.Components.Mac.GtkMacInterop.GetNSWindow (window);
+ if (nsw != null)
+ ApplyTheme (nsw);
+ }
+ #endif
+ }
+ }
+
+ public class ThemedGtkWindowBackend : Xwt.GtkBackend.WindowBackend
+ {
+ public override void Initialize ()
+ {
+ base.Initialize ();
+ IdeTheme.ApplyTheme (Window);
+ }
+ }
+
+ public class ThemedGtkDialogBackend : Xwt.GtkBackend.DialogBackend
+ {
+ public override void Initialize ()
+ {
+ base.Initialize ();
+ IdeTheme.ApplyTheme (Window);
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeWindow.cs
new file mode 100644
index 0000000000..1c1e232952
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/IdeWindow.cs
@@ -0,0 +1,38 @@
+//
+// IdeWindow.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Components
+{
+ public class IdeWindow: Gtk.Window
+ {
+ public IdeWindow (Gtk.WindowType type): base (type)
+ {
+ IdeTheme.ApplyTheme (this);
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs
index 5851edf92f..efe7bf474f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ImageView.cs
@@ -28,9 +28,12 @@ using Gdk;
namespace MonoDevelop.Components
{
- public class ImageView: Gtk.DrawingArea
+ [System.ComponentModel.ToolboxItem (true)]
+ public class ImageView: Gtk.Misc
{
Xwt.Drawing.Image image;
+ string iconId;
+ Gtk.IconSize? size;
public ImageView ()
{
@@ -42,6 +45,13 @@ namespace MonoDevelop.Components
this.image = image;
}
+ public ImageView (string iconId, Gtk.IconSize size): this ()
+ {
+ this.iconId = iconId;
+ this.size = size;
+ image = MonoDevelop.Ide.ImageService.GetIcon (iconId, size);
+ }
+
public Xwt.Drawing.Image Image {
get { return image; }
set {
@@ -51,45 +61,75 @@ namespace MonoDevelop.Components
}
}
- float xalign = 0.5f;
- public float Xalign {
- get { return xalign; }
+ public void SetIcon (string iconId, Gtk.IconSize size)
+ {
+ this.iconId = iconId;
+ this.size = size;
+ Image = MonoDevelop.Ide.ImageService.GetIcon (iconId, size);
+ }
+
+ public Gtk.IconSize IconSize {
+ get {
+ return size.HasValue ? size.Value : Gtk.IconSize.Invalid;
+ }
set {
- xalign = (float)(value * IconScale);
- QueueDraw ();
+ size = value;
+ if (iconId != null)
+ Image = MonoDevelop.Ide.ImageService.GetIcon (iconId, size.Value);
}
}
- float yalign = 0.5f;
- public float Yalign {
- get { return yalign; }
+ public string IconId {
+ get {
+ return iconId;
+ }
set {
- yalign = (float)(value * IconScale);
- QueueDraw ();
+ iconId = value;
+ if (size.HasValue)
+ Image = MonoDevelop.Ide.ImageService.GetIcon (iconId, size.Value);
}
}
double IconScale {
- get { return Mono.TextEditor.GtkWorkarounds.GetPixelScale (); }
+ get { return GtkWorkarounds.GetPixelScale (); }
}
protected override void OnSizeRequested (ref Gtk.Requisition requisition)
{
+ requisition.Width = Xpad * 2;
+ requisition.Height = Ypad * 2;
if (image != null) {
- requisition.Width = (int)(image.Width * IconScale);
- requisition.Height = (int)(image.Height * IconScale);
+ requisition.Width += (int)(image.Width * IconScale);
+ requisition.Height += (int)(image.Height * IconScale);
+ }
+ }
+
+ bool IsParentDisabled ()
+ {
+ var parent = Parent;
+ if (parent != null) {
+ if (!parent.Sensitive)
+ return true;
+ // special case: Buttons with image and label align children with HBox and Alignment
+ // Button -> Alignment -> HBox -> [ImageView|Label]
+ parent = parent.Parent.Parent as Gtk.Button;
+ if (parent != null && !parent.Sensitive)
+ return true;
}
+ return false;
}
protected override bool OnExposeEvent (Gdk.EventExpose evnt)
{
if (image != null) {
+ var alloc = Allocation;
+ alloc.Inflate (-Xpad, -Ypad);
using (var ctx = CairoHelper.Create (evnt.Window)) {
- var x = Math.Round (Allocation.X + (Allocation.Width - image.Width * IconScale) * Xalign);
- var y = Math.Round (Allocation.Y + (Allocation.Height - image.Height * IconScale) * Yalign);
+ var x = Math.Round (alloc.X + (alloc.Width - image.Width * IconScale) * Xalign);
+ var y = Math.Round (alloc.Y + (alloc.Height - image.Height * IconScale) * Yalign);
ctx.Save ();
ctx.Scale (IconScale, IconScale);
- ctx.DrawImage (this, image, x / IconScale, y / IconScale);
+ ctx.DrawImage (this, IsParentDisabled () ? image.WithAlpha (0.4) : image, x / IconScale, y / IconScale);
ctx.Restore ();
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/InfoBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/InfoBar.cs
index ba09473f9f..ede744ca50 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/InfoBar.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/InfoBar.cs
@@ -36,7 +36,7 @@ namespace MonoDevelop.Components
/// </summary>
public class InfoBar : HBox
{
- Image img;
+ ImageView img;
MessageType messageType;
HBox messageHBox = new HBox ();
public InfoBar () : this (MessageType.Other)
@@ -83,11 +83,11 @@ namespace MonoDevelop.Components
}
if (img == null) {
- img = new Gtk.Image (iconName, IconSize.Dialog);
+ img = new ImageView (iconName, IconSize.Dialog);
messageHBox.PackEnd (img, false, false, 12);
img.SetAlignment (0.5f, 0.5f);
} else {
- img.IconName = iconName;
+ img.IconId = iconName;
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Mac/MDMenu.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Mac/MDMenu.cs
index 938193c855..e667692bb6 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Mac/MDMenu.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Mac/MDMenu.cs
@@ -56,7 +56,6 @@ namespace MonoDevelop.Components.Mac
AutoEnablesItems = false;
Title = (ces.Name ?? "").Replace ("_", "");
-
foreach (CommandEntry ce in ces) {
if (ce.CommandId == Command.Separator) {
AddItem (NSMenuItem.SeparatorItem);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Mac/Util.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Mac/Util.cs
index 67d1c0ad12..6edfe3894e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Mac/Util.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Mac/Util.cs
@@ -99,6 +99,27 @@ namespace MonoDevelop.Components.Mac
return NSColor.FromDeviceRgba ((float)col.Red, (float)col.Green, (float)col.Blue, (float)col.Alpha);
}
+ public static NSColor ToNSColor (this Cairo.Color col)
+ {
+ return NSColor.FromDeviceRgba ((float)col.R, (float)col.G, (float)col.B, (float)col.A);
+ }
+
+ static readonly CoreGraphics.CGColorSpace DeviceRgbColorSpace = CoreGraphics.CGColorSpace.CreateDeviceRGB ();
+
+ public static CoreGraphics.CGColor ToCGColor (this Cairo.Color col)
+ {
+ return new CoreGraphics.CGColor (DeviceRgbColorSpace, new nfloat[] {
+ (nfloat)col.R, (nfloat)col.G, (nfloat)col.B, (nfloat)col.A
+ });
+ }
+
+ public static CoreGraphics.CGColor ToCGColor (this Color col)
+ {
+ return new CoreGraphics.CGColor (DeviceRgbColorSpace, new nfloat[] {
+ (nfloat)col.Red, (nfloat)col.Green, (nfloat)col.Blue, (nfloat)col.Alpha
+ });
+ }
+
static Selector applyFontTraits = new Selector ("applyFontTraits:range:");
public static NSAttributedString ToAttributedString (this FormattedText ft)
@@ -139,7 +160,7 @@ namespace MonoDevelop.Components.Mac
else if (att is LinkTextAttribute) {
var xa = (LinkTextAttribute)att;
ns.AddAttribute (NSStringAttributeKey.Link, new NSUrl (xa.Target.ToString ()), r);
- ns.AddAttribute (NSStringAttributeKey.ForegroundColor, NSColor.Blue, r);
+ ns.AddAttribute (NSStringAttributeKey.ForegroundColor, Ide.Gui.Styles.LinkForegroundColor.ToNSColor (), r);
ns.AddAttribute (NSStringAttributeKey.UnderlineStyle, NSNumber.FromInt32 ((int)NSUnderlineStyle.Single), r);
}
else if (att is StrikethroughTextAttribute) {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButton.cs
index 50443ef77c..842770df79 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButton.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MenuButton.cs
@@ -40,7 +40,7 @@ namespace MonoDevelop.Components
MenuCreator creator;
ContextMenuCreator contextMenuCreator;
Label label;
- Image image;
+ ImageView image;
Arrow arrow;
bool isOpen;
@@ -51,7 +51,7 @@ namespace MonoDevelop.Components
box.Spacing = 6;
Add (box);
- image = new Image ();
+ image = new ImageView ();
image.NoShowAll = true;
box.PackStart (image, false, false, 0);
label = new Label ();
@@ -103,8 +103,9 @@ namespace MonoDevelop.Components
Gdk.Rectangle rect = this.Allocation;
+ this.GrabFocus ();
// Offset the menu by the height of the rect
- ContextMenuExtensionsGtk.ShowContextMenu (this, 0, rect.Height, menu, () => MenuClosed (oldRelief));
+ menu.Show (this, 0, rect.Height, () => MenuClosed (oldRelief));
return;
}
@@ -200,7 +201,7 @@ namespace MonoDevelop.Components
public string StockImage {
set {
- image.Pixbuf = RenderIcon (value, IconSize.Button, null);
+ image.SetIcon (value, IconSize.Button);
image.Show ();
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MiniButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MiniButton.cs
index 34a646b8e4..29a8b3ca9c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MiniButton.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/MiniButton.cs
@@ -26,7 +26,6 @@
using System;
using Gtk;
-using Mono.TextEditor;
namespace MonoDevelop.Components
{
@@ -60,7 +59,7 @@ namespace MonoDevelop.Components
public MiniButton (string text, string icon): this ()
{
HBox box = new HBox (false, 3);
- Image img = new Image (icon, IconSize.Menu);
+ ImageView img = new ImageView (icon, IconSize.Menu);
box.PackStart (img, false, false, 0);
Label label = new Label (text);
label.Xalign = 0;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs
new file mode 100644
index 0000000000..86de702f7f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PangoUtil.cs
@@ -0,0 +1,260 @@
+//
+// PangoUtils.cs
+//
+// Author:
+// Michael Hutchinson <mhutchinson@novell.com>
+//
+// Copyright (c) 2010 Novell, Inc. (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Gtk;
+using System.Runtime.InteropServices;
+
+namespace MonoDevelop.Components
+{
+ public static class PangoUtil
+ {
+ internal const string LIBGTK = "libgtk-win32-2.0-0.dll";
+ internal const string LIBATK = "libatk-1.0-0.dll";
+ internal const string LIBGLIB = "libglib-2.0-0.dll";
+ internal const string LIBGDK = "libgdk-win32-2.0-0.dll";
+ internal const string LIBGOBJECT = "libgobject-2.0-0.dll";
+ internal const string LIBPANGO = "libpango-1.0-0.dll";
+ internal const string LIBPANGOCAIRO = "libpangocairo-1.0-0.dll";
+ internal const string LIBQUARTZ = "libgtk-quartz-2.0.dylib";
+ internal const string LIBGTKGLUE = "gtksharpglue-2";
+
+ /// <summary>
+ /// This doesn't leak Pango layouts, unlike some other ways to create them in GTK# &lt;= 2.12.11
+ /// </summary>
+ public static Pango.Layout CreateLayout (Widget widget)
+ {
+ var ptr = gtk_widget_create_pango_layout (widget.Handle, IntPtr.Zero);
+ return ptr == IntPtr.Zero? null : new Pango.Layout (ptr);
+ }
+
+ public static Pango.Layout CreateLayout (Widget widget, string text)
+ {
+ IntPtr textPtr = text == null? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (text);
+
+ var ptr = gtk_widget_create_pango_layout (widget.Handle, textPtr);
+
+ if (textPtr != IntPtr.Zero)
+ GLib.Marshaller.Free (textPtr);
+
+ return ptr == IntPtr.Zero? null : new Pango.Layout (ptr);
+ }
+
+ public static Pango.Layout CreateLayout (PrintContext context)
+ {
+ var ptr = gtk_print_context_create_pango_layout (context.Handle);
+ return ptr == IntPtr.Zero? null : new Pango.Layout (ptr);
+ }
+
+ [DllImport (LIBGTK, CallingConvention=CallingConvention.Cdecl)]
+ static extern IntPtr gtk_widget_create_pango_layout (IntPtr widget, IntPtr text);
+
+ [DllImport (LIBGTK, CallingConvention=CallingConvention.Cdecl)]
+ static extern IntPtr gtk_print_context_create_pango_layout (IntPtr context);
+ }
+
+ /// <summary>
+ /// This creates a Pango list and applies attributes to it with *much* less overhead than the GTK# version.
+ /// </summary>
+ class FastPangoAttrList : IDisposable
+ {
+ IntPtr list;
+
+ public FastPangoAttrList ()
+ {
+ list = pango_attr_list_new ();
+ }
+
+ public void AddStyleAttribute (Pango.Style style, uint start, uint end)
+ {
+ Add (pango_attr_style_new (style), start, end);
+ }
+
+ public void AddWeightAttribute (Pango.Weight weight, uint start, uint end)
+ {
+ Add (pango_attr_weight_new (weight), start, end);
+ }
+
+ public void AddForegroundAttribute (Gdk.Color color, uint start, uint end)
+ {
+ Add (pango_attr_foreground_new (color.Red, color.Green, color.Blue), start, end);
+ }
+
+ public void AddBackgroundAttribute (Gdk.Color color, uint start, uint end)
+ {
+ Add (pango_attr_background_new (color.Red, color.Green, color.Blue), start, end);
+ }
+
+ public void AddUnderlineAttribute (Pango.Underline underline, uint start, uint end)
+ {
+ Add (pango_attr_underline_new (underline), start, end);
+ }
+
+ void Add (IntPtr attribute, uint start, uint end)
+ {
+ unsafe {
+ PangoAttribute *attPtr = (PangoAttribute *) attribute;
+ attPtr->start_index = start;
+ attPtr->end_index = end;
+ }
+ pango_attr_list_insert (list, attribute);
+ }
+
+ /// <summary>
+ /// Like Splice, except it only offsets/clamps the inserted items, doesn't affect items already in the list.
+ /// </summary>
+ public void InsertOffsetList (Pango.AttrList atts, uint startOffset, uint endOffset)
+ {
+ //HACK: atts.Iterator.Attrs broken (throws NRE), so manually P/Invoke
+ var iter = pango_attr_list_get_iterator (atts.Handle);
+ try {
+ do {
+ IntPtr list = pango_attr_iterator_get_attrs (iter);
+ try {
+ int len = g_slist_length (list);
+ for (uint i = 0; i < len; i++) {
+ IntPtr val = g_slist_nth_data (list, i);
+ AddOffsetCopy (val, startOffset, endOffset);
+ }
+ } finally {
+ g_slist_free (list);
+ }
+ } while (pango_attr_iterator_next (iter));
+ } finally {
+ pango_attr_iterator_destroy (iter);
+ }
+ }
+
+ void AddOffsetCopy (IntPtr attr, uint startOffset, uint endOffset)
+ {
+ var copy = pango_attribute_copy (attr);
+ unsafe {
+ PangoAttribute *attPtr = (PangoAttribute *) copy;
+ attPtr->start_index = startOffset + attPtr->start_index;
+ attPtr->end_index = System.Math.Min (endOffset, startOffset + attPtr->end_index);
+ }
+ pango_attr_list_insert (list, copy);
+ }
+
+ [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)]
+ static extern IntPtr pango_attr_style_new (Pango.Style style);
+
+ [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)]
+ static extern IntPtr pango_attr_stretch_new (Pango.Stretch stretch);
+
+ [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)]
+ static extern IntPtr pango_attr_weight_new (Pango.Weight weight);
+
+ [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)]
+ static extern IntPtr pango_attr_foreground_new (ushort red, ushort green, ushort blue);
+
+ [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)]
+ static extern IntPtr pango_attr_background_new (ushort red, ushort green, ushort blue);
+
+ [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)]
+ static extern IntPtr pango_attr_underline_new (Pango.Underline underline);
+
+ [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)]
+ static extern IntPtr pango_attr_list_new ();
+
+ [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)]
+ static extern void pango_attr_list_unref (IntPtr list);
+
+ [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)]
+ static extern void pango_attr_list_insert (IntPtr list, IntPtr attr);
+
+ [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)]
+ static extern void pango_layout_set_attributes (IntPtr layout, IntPtr attrList);
+
+ [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)]
+ static extern void pango_attr_list_splice (IntPtr attr_list, IntPtr other, Int32 pos, Int32 len);
+
+ [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)]
+ static extern IntPtr pango_attribute_copy (IntPtr attr);
+
+ [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)]
+ static extern IntPtr pango_attr_list_get_iterator (IntPtr list);
+
+ [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)]
+ static extern bool pango_attr_iterator_next (IntPtr iterator);
+
+ [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)]
+ static extern void pango_attr_iterator_destroy (IntPtr iterator);
+
+ [DllImport (PangoUtil.LIBPANGO, CallingConvention=CallingConvention.Cdecl)]
+ static extern IntPtr pango_attr_iterator_get_attrs (IntPtr iterator);
+
+ [DllImport (PangoUtil.LIBGLIB, CallingConvention = CallingConvention.Cdecl)]
+ private static extern int g_slist_length (IntPtr l);
+
+ [DllImport (PangoUtil.LIBGLIB, CallingConvention = CallingConvention.Cdecl)]
+ private static extern IntPtr g_slist_nth_data (IntPtr l, uint n);
+
+ [DllImport (PangoUtil.LIBGLIB, CallingConvention = CallingConvention.Cdecl)]
+ private static extern void g_slist_free (IntPtr l);
+
+ public void Splice (Pango.AttrList attrs, int pos, int len)
+ {
+ pango_attr_list_splice (list, attrs.Handle, pos, len);
+ }
+
+ public void AssignTo (Pango.Layout layout)
+ {
+ pango_layout_set_attributes (layout.Handle, list);
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ struct PangoAttribute
+ {
+ public IntPtr klass;
+ public uint start_index;
+ public uint end_index;
+ }
+
+ public void Dispose ()
+ {
+ if (list != IntPtr.Zero) {
+ GC.SuppressFinalize (this);
+ Destroy ();
+ }
+ }
+
+ //NOTE: the list destroys all its attributes when the ref count reaches zero
+ void Destroy ()
+ {
+ pango_attr_list_unref (list);
+ list = IntPtr.Zero;
+ }
+
+ ~FastPangoAttrList ()
+ {
+ GLib.Idle.Add (delegate {
+ Destroy ();
+ return false;
+ });
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs
index a13f021b63..defe968695 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PathBar.cs
@@ -25,15 +25,14 @@
// THE SOFTWARE.
using System;
-using System.Collections.Generic;
using System.Linq;
using Gtk;
using Gdk;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.Components
{
@@ -150,10 +149,14 @@ namespace MonoDevelop.Components
const int spacing = arrowLeftPadding + arrowRightPadding + arrowSize;
const int minRegionSelectorWidth = 30;
- Func<int, Widget> createMenuForItem;
+ Func<int, Control> createMenuForItem;
Widget menuWidget;
-
- public PathBar (Func<int, Widget> createMenuForItem)
+ bool pressMenuWasVisible;
+ int pressHoverIndex;
+ int menuIndex;
+ uint hideTimeout;
+
+ public PathBar (Func<int, Control> createMenuForItem)
{
this.Events = EventMask.ExposureMask |
EventMask.EnterNotifyMask |
@@ -244,13 +247,8 @@ namespace MonoDevelop.Components
protected override bool OnExposeEvent (EventExpose evnt)
{
using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) {
-
ctx.Rectangle (0, 0, Allocation.Width, Allocation.Height);
- using (var g = new Cairo.LinearGradient (0, 0, 0, Allocation.Height)) {
- g.AddColorStop (0, Styles.BreadcrumbBackgroundColor);
- g.AddColorStop (1, Styles.BreadcrumbGradientEndColor);
- ctx.SetSource (g);
- }
+ ctx.SetSourceColor (Styles.BreadcrumbBackgroundColor.ToCairoColor ());
ctx.Fill ();
if (widths == null)
@@ -285,6 +283,7 @@ namespace MonoDevelop.Components
}
layout.Attributes = (i == activeIndex) ? boldAtts : null;
+ layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11);
layout.SetMarkup (GetFirstLineFromMarkup (leftPath [i].Markup));
ctx.Save ();
@@ -343,6 +342,7 @@ namespace MonoDevelop.Components
}
layout.Attributes = (i == activeIndex) ? boldAtts : null;
+ layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11);
layout.SetMarkup (GetFirstLineFromMarkup (rightPath [i].Markup));
ctx.Save ();
@@ -371,7 +371,7 @@ namespace MonoDevelop.Components
ctx.MoveTo (0, Allocation.Height - 0.5);
ctx.RelLineTo (Allocation.Width, 0);
- ctx.SetSourceColor (Styles.BreadcrumbBottomBorderColor);
+ ctx.SetSourceColor (Styles.BreadcrumbBottomBorderColor.ToCairoColor ());
ctx.LineWidth = 1;
ctx.Stroke ();
}
@@ -385,7 +385,7 @@ namespace MonoDevelop.Components
ctx.LineTo (x + arrowSize, y + size / 2);
ctx.LineTo (x, y + size);
ctx.ClosePath ();
- ctx.SetSourceColor (CairoExtensions.ColorShade (Style.Dark (State).ToCairoColor (), 0.6));
+ ctx.SetSourceColor (Styles.BaseIconColor.ToCairoColor());
ctx.Fill ();
}
@@ -397,13 +397,8 @@ namespace MonoDevelop.Components
double height = Allocation.Height - topPadding - bottomPadding + buttonPadding * 2;
ctx.Rectangle (x, y, width, height);
- ctx.SetSourceColor (Styles.BreadcrumbButtonFillColor);
+ ctx.SetSourceColor (Styles.BreadcrumbButtonFillColor.ToCairoColor ());
ctx.Fill ();
-
- ctx.Rectangle (x + 0.5, y + 0.5, width - 1, height - 1);
- ctx.SetSourceColor (Styles.BreadcrumbButtonBorderColor);
- ctx.LineWidth = 1;
- ctx.Stroke ();
}
int[] ReduceWidths (int overflow)
@@ -435,6 +430,9 @@ namespace MonoDevelop.Components
protected override bool OnButtonPressEvent (EventButton evnt)
{
+ pressMenuWasVisible = menuVisible;
+ pressHoverIndex = menuIndex;
+
HideMenu ();
if (hovering) {
pressed = true;
@@ -448,6 +446,8 @@ namespace MonoDevelop.Components
pressed = false;
if (hovering) {
QueueDraw ();
+ if (pressMenuWasVisible && pressHoverIndex == hoverIndex)
+ return true;
ShowMenu ();
}
return true;
@@ -459,18 +459,18 @@ namespace MonoDevelop.Components
return;
HideMenu ();
-
+ menuIndex = hoverIndex;
menuWidget = createMenuForItem (hoverIndex);
if (menuWidget == null)
return;
menuWidget.Hidden += delegate {
-
menuVisible = false;
QueueDraw ();
//FIXME: for some reason the menu's children don't get activated if we destroy
//directly here, so use a timeout to delay it
- GLib.Timeout.Add (100, delegate {
+ hideTimeout = GLib.Timeout.Add (100, delegate {
+ hideTimeout = 0;
HideMenu ();
return false;
});
@@ -492,6 +492,9 @@ namespace MonoDevelop.Components
public void HideMenu ()
{
+ if (hideTimeout != 0) {
+ GLib.Source.Remove (hideTimeout);
+ }
if (menuWidget != null) {
menuWidget.Destroy ();
menuWidget = null;
@@ -533,18 +536,21 @@ namespace MonoDevelop.Components
int dy = oy + this.Allocation.Bottom;
var req = widget.SizeRequest ();
-
- Gdk.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtPoint (dx, dy));
+
+ Xwt.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen.Number, Screen.GetMonitorAtPoint (dx, dy));
+ int geomWidth = (int)geometry.Width;
+ int geomLeft = (int)geometry.Left;
+ int geomRight = (int)geometry.Right;
int width = System.Math.Max (req.Width, w);
- if (width >= geometry.Width - spacing * 2) {
- width = geometry.Width - spacing * 2;
- dx = geometry.Left + spacing;
+ if (width >= geomWidth - spacing * 2) {
+ width = geomWidth - spacing * 2;
+ dx = geomLeft + spacing;
}
widget.WidthRequest = width;
if (dy + req.Height > geometry.Bottom)
dy = oy + this.Allocation.Y - req.Height;
- if (dx + width > geometry.Right)
- dx = geometry.Right - width;
+ if (dx + width > geomRight)
+ dx = geomRight - width;
(widget as Gtk.Window).Move (dx, dy);
(widget as Gtk.Window).Resize (width, req.Height);
widget.GrabFocus ();
@@ -690,10 +696,10 @@ namespace MonoDevelop.Components
widths = null;
}
-
- public override void Destroy ()
+
+ protected override void OnDestroyed ()
{
- base.Destroy ();
+ base.OnDestroyed ();
styleButton.Destroy ();
KillLayout ();
this.boldAtts.Dispose ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWidget.cs
index bbd72a8e8d..5974852928 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWidget.cs
@@ -173,12 +173,11 @@ namespace MonoDevelop.Components
if (Theme.DrawPager) {
Theme.RenderPager (context,
PangoContext,
- new Gdk.Rectangle (Allocation.X, Allocation.Y, paintSize.Width, paintSize.Height));
+ BorderAllocation);
}
- Theme.RenderBorder (context, BorderAllocation, position);
+ Theme.RenderShadow (context, BorderAllocation, position);
context.Restore ();
-
}
return base.OnExposeEvent (evnt);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWindow.cs
index 04d0d9f32b..2147c668ca 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWindow.cs
@@ -27,7 +27,6 @@ using System;
using Gtk;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui;
-using Mono.TextEditor;
using Gdk;
using Xwt.Motion;
@@ -63,6 +62,7 @@ namespace MonoDevelop.Components
AppPaintable = true;
TypeHint = WindowTypeHint.Tooltip;
CheckScreenColormap ();
+ AddEvents ((int)EventMask.ButtonReleaseMask);
alignment = new Alignment (0, 0, 1f, 1f);
alignment.Show ();
@@ -103,6 +103,8 @@ namespace MonoDevelop.Components
}
}
+ public int CaretSpacing { get; set; }
+
public bool ShowArrow {
get { return Theme.ShowArrow; }
set { Theme.ShowArrow = value; }
@@ -199,7 +201,9 @@ namespace MonoDevelop.Components
set;
}
- public void RepositionWindow (Gdk.Rectangle? newCaret = null)
+ protected PopupPosition CurrentPosition { get { return position; }}
+
+ public virtual void RepositionWindow (Gdk.Rectangle? newCaret = null)
{
if (parent == null)
return;
@@ -229,6 +233,10 @@ namespace MonoDevelop.Components
caret = GtkUtil.ToScreenCoordinates (parent, parent.GdkWindow, caret);
}
+ caret.Inflate (CaretSpacing, CaretSpacing);
+ if (!Core.Platform.IsWindows)
+ caret.Inflate (-1, -1);
+
Gtk.Requisition request = SizeRequest ();
var screen = parent.Screen;
Gdk.Rectangle geometry = GtkWorkarounds.GetUsableMonitorGeometry (screen, screen.GetMonitorAtPoint (caret.X, caret.Y));
@@ -265,14 +273,14 @@ namespace MonoDevelop.Components
switch ((PopupPosition)((int)position & 0x0f)) {
case PopupPosition.Top:
- y = caret.Bottom;
+ y = caret.Bottom + 1;
break;
case PopupPosition.Bottom:
y = caret.Y - request.Height; break;
case PopupPosition.Right:
x = caret.X - request.Width; break;
case PopupPosition.Left:
- x = caret.Right; break;
+ x = caret.Right + 1; break;
}
int offset;
if ((position & PopupPosition.Top) != 0 || (position & PopupPosition.Bottom) != 0) {
@@ -381,12 +389,11 @@ namespace MonoDevelop.Components
if (Theme.DrawPager) {
Theme.RenderPager (context,
PangoContext,
- new Gdk.Rectangle (Allocation.X, Allocation.Y, paintSize.Width, paintSize.Height));
+ BorderAllocation);
}
- Theme.RenderBorder (context, BorderAllocation, position);
+ Theme.RenderShadow (context, BorderAllocation, position);
context.Restore ();
-
}
if (changed)
@@ -403,7 +410,7 @@ namespace MonoDevelop.Components
void UpdatePadding ()
{
uint top,left,bottom,right;
- top = left = bottom = right = (uint)Theme.Padding + 1;
+ top = left = bottom = right = (uint)(Theme.Padding + (Core.Platform.IsWindows ? 1 : 2));
if (ShowArrow) {
if ((position & PopupPosition.Top) != 0)
@@ -459,9 +466,54 @@ namespace MonoDevelop.Components
rect.Width -= Theme.ArrowLength;
}
}
+ if (!Core.Platform.IsWindows) {
+ if ((position & PopupPosition.Top) != 0) {
+ rect.Y += 1;
+ rect.Height -= 1;
+ }
+ else if ((position & PopupPosition.Bottom) != 0) {
+ rect.Height -= 1;
+ }
+ else if ((position & PopupPosition.Left) != 0) {
+ rect.X += 1;
+ rect.Width -= 1;
+ }
+ else if ((position & PopupPosition.Right) != 0) {
+ rect.Width -= 1;
+ }
+ }
return rect;
}
}
+
+ public event EventHandler PagerLeftClicked;
+ public event EventHandler PagerRightClicked;
+
+ protected virtual void OnPagerLeftClicked ()
+ {
+ if (PagerLeftClicked != null)
+ PagerLeftClicked (this, null);
+ }
+
+ protected virtual void OnPagerRightClicked ()
+ {
+ if (PagerRightClicked != null)
+ PagerRightClicked (this, null);
+ }
+
+ protected override bool OnButtonReleaseEvent (EventButton evnt)
+ {
+ if (evnt.Button != 1 || !Theme.DrawPager)
+ return base.OnButtonPressEvent (evnt);
+
+ var retval = false;
+ if (retval = Theme.HitTestPagerLeftArrow (PangoContext, BorderAllocation, new Point ((int)evnt.X, (int)evnt.Y)))
+ OnPagerLeftClicked ();
+ else if (retval = Theme.HitTestPagerRightArrow (PangoContext, BorderAllocation, new Point ((int)evnt.X, (int)evnt.Y)))
+ OnPagerRightClicked ();
+
+ return retval;
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWindowTheme.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWindowTheme.cs
index d477f4700b..fc4bb17539 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWindowTheme.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/PopoverWindowTheme.cs
@@ -27,8 +27,9 @@ using System;
using Gtk;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui;
-using Mono.TextEditor;
using Gdk;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Highlighting;
namespace MonoDevelop.Components
{
@@ -54,9 +55,8 @@ namespace MonoDevelop.Components
int padding;
int arrowWidth;
int arrowLength;
- Cairo.Color topColor;
- Cairo.Color bottomColor;
- Cairo.Color borderColor;
+ Cairo.Color backgroundColor;
+ Cairo.Color shadowColor;
Pango.FontDescription font;
int currentPage;
int pages;
@@ -64,58 +64,37 @@ namespace MonoDevelop.Components
bool pagerVertical;
bool showArrow;
PopupPosition targetPosition;
+ static readonly int pagerArrowPadding = 4;
public event EventHandler RedrawNeeded;
/// <summary>
- /// Gets or sets the color of the top of the gradient used to render the background.
+ /// Gets or sets the color of the background.
/// </summary>
- public Cairo.Color TopColor {
- get { return topColor; }
- set { SetAndEmit (value, topColor, ref topColor); }
+ public Cairo.Color BackgroundColor {
+ get { return backgroundColor; }
+ set { SetAndEmit (value, backgroundColor, ref backgroundColor); }
}
+ Cairo.Color pagerBackgroundColor = CairoExtensions.ParseColor ("ffffff");
/// <summary>
- /// Gets or sets the color of the bottom of the gradient used to render the background.
+ /// Gets or sets the color of the background color of the pager.
/// </summary>
- public Cairo.Color BottomColor {
- get { return bottomColor; }
- set { SetAndEmit (value, bottomColor, ref bottomColor); }
- }
-
- /// <summary>
- /// Gets or sets the color of the border of the entire window. Set to transparent to disable border drawing.
- /// </summary>
- public Cairo.Color BorderColor {
- get { return borderColor; }
- set { SetAndEmit (value, borderColor, ref borderColor); }
- }
-
-
- Cairo.Color pagerBackgroundColorTop = CairoExtensions.ParseColor ("ffffff");
- /// <summary>
- /// Gets or sets the color of the top background color of the pager.
- /// </summary>
- public Cairo.Color PagerBackgroundColorTop {
+ public Cairo.Color PagerBackgroundColor {
get {
- return pagerBackgroundColorTop;
+ return pagerBackgroundColor;
}
set {
- pagerBackgroundColorTop = value;
+ pagerBackgroundColor = value;
}
}
- Cairo.Color pagerBackgroundColorBottom = CairoExtensions.ParseColor ("f5f5f5");
/// <summary>
- /// Gets or sets the color of the bottom background color of the pager.
+ /// Gets or sets the color of the border of the entire window. Set to transparent to disable border drawing.
/// </summary>
- public Cairo.Color PagerBackgroundColorBottom {
- get {
- return pagerBackgroundColorBottom;
- }
- set {
- pagerBackgroundColorBottom = value;
- }
+ public Cairo.Color ShadowColor {
+ get { return shadowColor; }
+ set { SetAndEmit (value, shadowColor, ref shadowColor); }
}
Cairo.Color pagerTriangleColor = CairoExtensions.ParseColor ("737373");
@@ -140,10 +119,11 @@ namespace MonoDevelop.Components
public Cairo.Color PagerTextColor {
get {
if (!pagerColorSet) {
- return new Cairo.Color (BorderColor.R * .7,
- BorderColor.G * .7,
- BorderColor.B * .7,
- BorderColor.A);
+ // FIXME: VV: Sane value!
+ //return new Cairo.Color (BorderColor.R * .7,
+ // BorderColor.G * .7,
+ // BorderColor.B * .7,
+ // BorderColor.A);
}
return pagerTextColor;
}
@@ -243,12 +223,11 @@ namespace MonoDevelop.Components
public int ArrowOffset { private get; set; }
/// <summary>
- /// Convenience method to set the top and bottom color to the same color.
+ /// Set the background color.
/// </summary>
- public void SetFlatColor (Cairo.Color color)
+ public void SetBackgroundColor (Cairo.Color color)
{
- TopColor = color;
- BottomColor = color;
+ BackgroundColor = color;
}
public PopoverWindowTheme ()
@@ -257,21 +236,17 @@ namespace MonoDevelop.Components
Padding = 6;
ArrowWidth = 10;
ArrowLength = 5;
- TopColor = new Cairo.Color (1, 1, 1);
- BottomColor = new Cairo.Color (1, 1, 1);
- BorderColor = new Cairo.Color (0.7, 0.7, 0.7);
+ BackgroundColor = Styles.PopoverWindow.DefaultBackgroundColor.ToCairoColor ();
+ ShadowColor = Styles.PopoverWindow.ShadowColor.ToCairoColor ();
Font = Pango.FontDescription.FromString ("Normal");
}
- public void SetSchemeColors (Mono.TextEditor.Highlighting.ColorScheme scheme)
+ public void SetSchemeColors (ColorScheme scheme)
{
- TopColor = scheme.TooltipText.Background.AddLight (0.03);
- BottomColor = scheme.TooltipText.Background;
- BorderColor = scheme.TooltipBorder.Color;
+ BackgroundColor = scheme.TooltipText.Background;
PagerTextColor = scheme.TooltipPagerText.Color;
- PagerBackgroundColorTop = scheme.TooltipPagerTop.Color;
- PagerBackgroundColorBottom = scheme.TooltipPagerBottom.Color;
+ PagerBackgroundColor = scheme.TooltipPager.Color;
PagerTriangleColor = scheme.TooltipPagerTriangle.Color;
}
@@ -292,11 +267,36 @@ namespace MonoDevelop.Components
public virtual void RenderBorder (Cairo.Context context, Gdk.Rectangle region, PopupPosition arrowPosition)
{
SetBorderPath (context, region, arrowPosition);
- context.SetSourceColor (BorderColor);
+ context.SetSourceColor (BackgroundColor);
context.LineWidth = 1;
context.Stroke ();
}
+ public virtual void RenderShadow (Cairo.Context context, Gdk.Rectangle region, PopupPosition arrowPosition)
+ {
+ RenderBorder (context, region, arrowPosition);
+ double r = CornerRadius;
+ double x = region.X + 0.5, y = region.Y + 0.5, w = region.Width - 1, h = region.Height - 1;
+ context.MoveTo(x + w, y + h - r);
+ context.Arc(x + w - r, y + h - r, r, 0, Math.PI * 0.5);
+ if (ShowArrow && (arrowPosition & PopupPosition.Bottom) != 0) {
+ double apos = ArrowOffset;
+ context.LineTo (x + apos + ArrowWidth / 2, y + h);
+ context.RelLineTo (-ArrowWidth / 2, ArrowLength);
+ context.RelLineTo (-ArrowWidth / 2, -ArrowLength);
+ }
+ context.Arc(x + r, y + h - r, r, Math.PI * 0.5, Math.PI);
+
+ // FIXME: VV: Remove gradient features
+ using (var lg = new Cairo.LinearGradient (0, y + h - r, 0, y + h)) {
+ lg.AddColorStop (0.5, ShadowColor.MultiplyAlpha (0.0));
+ lg.AddColorStop (1, ShadowColor);
+ context.SetSource (lg);
+ context.LineWidth = 1;
+ context.Stroke ();
+ }
+ }
+
object setBorderPathLastArgs;
public virtual bool SetBorderPath (Cairo.Context context, Gdk.Rectangle region, PopupPosition arrowPosition)
{
@@ -352,13 +352,9 @@ namespace MonoDevelop.Components
/// </summary>
public virtual void RenderBackground (Cairo.Context context, Gdk.Rectangle region)
{
- using (var lg = new Cairo.LinearGradient (0, region.Y, 0, region.Y + region.Height)) {
- lg.AddColorStop (0, TopColor);
- lg.AddColorStop (1, BottomColor);
- context.Rectangle (region.X, region.Y, region.Width, region.Height);
- context.SetSource (lg);
- context.Fill ();
- }
+ context.Rectangle (region.X, region.Y, region.Width, region.Height);
+ context.SetSourceColor (BackgroundColor);
+ context.Fill ();
}
/// <summary>
@@ -370,33 +366,60 @@ namespace MonoDevelop.Components
CairoExtensions.RoundedRectangle (context, region.X, region.Y, region.Width, region.Height, CornerRadius);
context.Clip ();
- Pango.Layout layout = SetupPagerText (context, pangoContext);
- int textWidth, textHeight;
- layout.GetPixelSize (out textWidth, out textHeight);
-
- int width = textWidth + Styles.PopoverWindow.PagerTriangleSize * 2 + 20;
- int height = Styles.PopoverWindow.PagerHeight;
+ Pango.Layout layout = SetupPagerText (pangoContext);
+ var boundingBox = GetPagerBounds (layout, region);
- Gdk.Rectangle boundingBox = new Gdk.Rectangle (region.X + region.Width - width, 0, width, height);
RenderPagerBackground (context, boundingBox);
- int arrowPadding = 4;
- Gdk.Rectangle arrowRect = new Gdk.Rectangle (boundingBox.X + arrowPadding,
+ Gdk.Rectangle arrowRect = new Gdk.Rectangle (boundingBox.X + pagerArrowPadding,
boundingBox.Y + (boundingBox.Height - Styles.PopoverWindow.PagerTriangleSize) / 2,
Styles.PopoverWindow.PagerTriangleSize,
Styles.PopoverWindow.PagerTriangleSize);
RenderPagerArrow (context, arrowRect, PagerVertical ? ArrowType.Up : ArrowType.Left);
- arrowRect.X = boundingBox.X + boundingBox.Width - (arrowPadding + Styles.PopoverWindow.PagerTriangleSize);
+ arrowRect.X = boundingBox.X + boundingBox.Width - (pagerArrowPadding + Styles.PopoverWindow.PagerTriangleSize);
RenderPagerArrow (context, arrowRect, PagerVertical ? ArrowType.Down : ArrowType.Right);
RenderPagerText (context, layout, boundingBox);
}
+ Gdk.Rectangle GetPagerBounds (Pango.Layout layout, Gdk.Rectangle region)
+ {
+ int textWidth, textHeight;
+ layout.GetPixelSize (out textWidth, out textHeight);
+
+ int width = textWidth + Styles.PopoverWindow.PagerTriangleSize * 2 + 20;
+ int height = Styles.PopoverWindow.PagerHeight;
+
+ return new Gdk.Rectangle (region.X + region.Width - width, 0, width, height);
+ }
+
+ public bool HitTestPagerLeftArrow (Pango.Context pangoContext, Gdk.Rectangle region, Gdk.Point hitPoint)
+ {
+ Pango.Layout layout = SetupPagerText (pangoContext);
+ var boundingBox = GetPagerBounds (layout, region);
+ Gdk.Rectangle arrowActiveRect = new Gdk.Rectangle (boundingBox.X,
+ boundingBox.Y,
+ Styles.PopoverWindow.PagerTriangleSize + (pagerArrowPadding * 2),
+ boundingBox.Height);
+ return arrowActiveRect.Contains (hitPoint);
+ }
+
+ public bool HitTestPagerRightArrow (Pango.Context pangoContext, Gdk.Rectangle region, Gdk.Point hitPoint)
+ {
+ Pango.Layout layout = SetupPagerText (pangoContext);
+ var boundingBox = GetPagerBounds (layout, region);
+ Gdk.Rectangle arrowActiveRect = new Gdk.Rectangle (boundingBox.X + boundingBox.Width - (pagerArrowPadding * 2 + Styles.PopoverWindow.PagerTriangleSize),
+ boundingBox.Y,
+ Styles.PopoverWindow.PagerTriangleSize + (pagerArrowPadding * 2),
+ boundingBox.Height);
+ return arrowActiveRect.Contains (hitPoint);
+ }
+
/// <summary>
/// Sets the Pango.Layout for pager text as it will be rendered. This will be used to perform sizing on the rest of the pager.
/// </summary>
- protected virtual Pango.Layout SetupPagerText (Cairo.Context context, Pango.Context pangoContext)
+ protected virtual Pango.Layout SetupPagerText (Pango.Context pangoContext)
{
Pango.Layout pl = new Pango.Layout (pangoContext);
pl.SetText (string.Format ("{0} of {1}", CurrentPage + 1, NumPages));
@@ -429,31 +452,15 @@ namespace MonoDevelop.Components
{
// draw background
CairoExtensions.RoundedRectangle (context,
- bounds.X,
- bounds.Y,
- bounds.Width,
- bounds.Height,
- CornerRadius,
- CairoCorners.BottomLeft);
- using (var lg = new Cairo.LinearGradient (0, bounds.Y, 0, bounds.Y + bounds.Height)) {
- lg.AddColorStop (0, PagerBackgroundColorTop);
- lg.AddColorStop (1, PagerBackgroundColorBottom);
-
- context.SetSource (lg);
- context.Fill ();
- }
-
- // draw outline
- CairoExtensions.RoundedRectangle (context,
- bounds.X + .5,
- bounds.Y + .5,
- bounds.Width - 1,
+ bounds.X + 1,
+ bounds.Y + 1,
+ bounds.Width - 2,
bounds.Height - 1,
CornerRadius,
- CairoCorners.BottomLeft);
- context.LineWidth = 1;
- context.SetSourceColor (BorderColor);
- context.Stroke ();
+ CairoCorners.All);
+
+ context.SetSourceColor (PagerBackgroundColor);
+ context.Fill ();
}
/// <summary>
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs
index 597e9dc134..43b4cb2286 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/RoundedFrame.cs
@@ -38,9 +38,6 @@ namespace MonoDevelop.Components
public class RoundedFrame : Bin
{
private Theme theme;
- protected Theme Theme {
- get { return theme; }
- }
private int frame_width = 3;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs
index 44bd4e78ed..98669371fa 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SearchEntry.cs
@@ -30,8 +30,8 @@
using System;
using Gtk;
using MonoDevelop.Core;
+using MonoDevelop.Ide.Fonts;
using MonoDevelop.Ide.Gui;
-using Mono.TextEditor;
namespace MonoDevelop.Components
{
@@ -87,8 +87,21 @@ namespace MonoDevelop.Components
}
public Menu Menu {
- get { return menu; }
- set { menu = value; menu.Deactivated += OnMenuDeactivated; }
+ get {
+ if (menu != null)
+ return menu;
+ return menu = new Menu ();
+ }
+ set {
+ if (menu != null) {
+ menu.Deactivated -= OnMenuDeactivated;
+ menu.Destroy ();
+ }
+ menu = value;
+ if (value != null) {
+ menu.Deactivated += OnMenuDeactivated;
+ }
+ }
}
public Entry Entry {
@@ -121,9 +134,9 @@ namespace MonoDevelop.Components
AppPaintable = true;
BuildWidget ();
- BuildMenu ();
NoShowAll = true;
+ GtkWorkarounds.SetTransparentBgHint (this, true);
}
public Xwt.Drawing.Image FilterButtonPixbuf {
@@ -148,6 +161,8 @@ namespace MonoDevelop.Components
box = new HBox ();
entry = new FramelessEntry (this);
+ entry.UseNativeContextMenus ();
+
filter_button = new HoverImageButton (IconSize.Menu, "md-searchbox-search");
clear_button = new HoverImageButton (IconSize.Menu, "md-searchbox-clear");
@@ -208,12 +223,6 @@ namespace MonoDevelop.Components
activated_event (this, EventArgs.Empty);
}
- private void BuildMenu ()
- {
- menu = new Menu ();
- menu.Deactivated += OnMenuDeactivated;
- }
-
public void PopupFilterMenu ()
{
ShowMenu (0);
@@ -222,18 +231,23 @@ namespace MonoDevelop.Components
void ShowMenu (uint time)
{
OnRequestMenu (EventArgs.Empty);
- if (menu.Children.Length > 0) {
- menu.Popup (null, null, OnPositionMenu, 0, time);
- menu.ShowAll ();
+ if (MenuHasChildren ()) {
+ Menu.Popup (null, null, OnPositionMenu, 0, time);
+ Menu.ShowAll ();
}
}
+ bool MenuHasChildren ()
+ {
+ return menu != null && Menu.Children.Length > 0;
+ }
+
private void ShowHideButtons ()
{
clear_button.Visible = entry.Text.Length > 0;
entryAlignment.RightPadding = (uint) (!clear_button.Visible && roundedShape ? 6 : 0);
- filter_button.Visible = ForceFilterButtonVisible || (menu != null && menu.Children.Length > 0);
+ filter_button.Visible = ForceFilterButtonVisible || MenuHasChildren ();
entryAlignment.LeftPadding = (uint) (!filter_button.Visible && roundedShape ? 6 : 0);
}
@@ -265,7 +279,7 @@ namespace MonoDevelop.Components
toggling = true;
FilterMenuItem item = (FilterMenuItem)o;
- foreach (MenuItem child_item in menu) {
+ foreach (MenuItem child_item in Menu) {
if (!(child_item is FilterMenuItem)) {
continue;
}
@@ -368,6 +382,7 @@ namespace MonoDevelop.Components
protected override void OnDestroyed ()
{
if (menu != null) {
+ menu.Deactivated -= OnMenuDeactivated;
menu.Destroy ();
menu = null;
}
@@ -390,7 +405,10 @@ namespace MonoDevelop.Components
var alloc = new Gdk.Rectangle (alignment.Allocation.X, box.Allocation.Y, alignment.Allocation.Width, box.Allocation.Height);
if (hasFrame && (!roundedShape || (roundedShape && !customRoundedShapeDrawing))) {
- Style.PaintShadow (entry.Style, GdkWindow, StateType.Normal, ShadowType.In,
+ if (Platform.IsLinux)
+ Style.PaintFlatBox (Style, GdkWindow, entry.State, ShadowType.None,
+ evnt.Area, this, "entry_bg", alloc.X + 2, alloc.Y + 2, alloc.Width - 4, alloc.Height - 4);
+ Style.PaintShadow (entry.Style, GdkWindow, entry.State, entry.ShadowType,
evnt.Area, entry, "entry", alloc.X, alloc.Y, alloc.Width, alloc.Height);
/* using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) {
ctx.LineWidth = 1;
@@ -419,7 +437,7 @@ namespace MonoDevelop.Components
if (hasFrame && roundedShape && customRoundedShapeDrawing) {
using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) {
RoundBorder (ctx, alloc.X + 0.5, alloc.Y + 0.5, alloc.Width - 1, alloc.Height - 1);
- ctx.SetSourceColor (Styles.WidgetBorderColor);
+ ctx.SetSourceColor (Styles.WidgetBorderColor.ToCairoColor ());
ctx.LineWidth = 1;
ctx.Stroke ();
}
@@ -479,7 +497,7 @@ namespace MonoDevelop.Components
FilterMenuItem item = new FilterMenuItem (id, label);
item.Toggled += OnMenuItemToggled;
- menu.Append (item);
+ Menu.Append (item);
if (ActiveFilterID < 0) {
item.Toggle ();
@@ -492,20 +510,20 @@ namespace MonoDevelop.Components
public MenuItem AddMenuItem (string label)
{
var item = new MenuItem (label);
- menu.Append (item);
+ Menu.Append (item);
return item;
}
public void AddFilterSeparator ()
{
- menu.Append (new SeparatorMenuItem ());
+ Menu.Append (new SeparatorMenuItem ());
}
public void RemoveFilterOption (int id)
{
FilterMenuItem item = FindFilterMenuItem (id);
if (item != null) {
- menu.Remove (item);
+ Menu.Remove (item);
}
}
@@ -519,7 +537,7 @@ namespace MonoDevelop.Components
private FilterMenuItem FindFilterMenuItem (int id)
{
- foreach (MenuItem item in menu) {
+ foreach (MenuItem item in Menu) {
if (item is FilterMenuItem && ((FilterMenuItem)item).ID == id) {
return (FilterMenuItem)item;
}
@@ -648,6 +666,8 @@ namespace MonoDevelop.Components
parent.StyleSet += OnParentStyleSet;
WidthChars = 1;
+
+ GtkWorkarounds.SetTransparentBgHint (this, true);
}
private void OnParentStyleSet (object o, EventArgs args)
@@ -726,7 +746,7 @@ namespace MonoDevelop.Components
if (layout == null) {
layout = new Pango.Layout (PangoContext);
- layout.FontDescription = PangoContext.FontDescription.Copy ();
+ layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11);
}
int width, height;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs
index 02688602d0..6ea647114b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SectionList.cs
@@ -29,7 +29,6 @@ using System.Collections.Generic;
using Gtk;
using Gdk;
using Cairo;
-using Mono.TextEditor;
namespace MonoDevelop.Components
{
@@ -91,7 +90,7 @@ namespace MonoDevelop.Components
public SectionList ()
{
- Mono.TextEditor.GtkWorkarounds.FixContainerLeak (this);
+ GtkWorkarounds.FixContainerLeak (this);
this.WidgetFlags |= WidgetFlags.NoWindow;
WidthRequest = 100;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SelectFolderDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SelectFolderDialog.cs
index 8f2f7562b2..30485f1ea7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SelectFolderDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SelectFolderDialog.cs
@@ -39,7 +39,7 @@ namespace MonoDevelop.Components
{
public SelectFolderDialog ()
{
- Action = FileChooserAction.SelectFolder;
+ Action = FileChooserAction.SelectFolder | FileChooserAction.CreateFolder;
}
public SelectFolderDialog (string title): this (title, FileChooserAction.SelectFolder)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TabLabel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TabLabel.cs
index b3080ef23b..8e6aeee4e6 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TabLabel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TabLabel.cs
@@ -14,7 +14,7 @@ namespace MonoDevelop.Components
public class TabLabel : HBox
{
private Label title;
- private Gtk.Image icon;
+ private ImageView icon;
private EventBox titleBox;
private static Xwt.Drawing.Image closeImage;
@@ -31,7 +31,7 @@ namespace MonoDevelop.Components
{
}
- public TabLabel (Label label, Gtk.Image icon) : base (false, 0)
+ public TabLabel (Label label, ImageView icon) : base (false, 0)
{
this.title = label;
this.icon = icon;
@@ -71,7 +71,7 @@ namespace MonoDevelop.Components
set { title = value; }
}
- public Gtk.Image Icon
+ public ImageView Icon
{
get { return icon; }
set { icon = value; }
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs
index f2153678da..ac16bee985 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Tabstrip.cs
@@ -30,17 +30,14 @@ using System.ComponentModel;
using System.Drawing.Design;
using Cairo;
using Gtk;
-using Mono.TextEditor;
using System.Linq;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.Components
{
class Tabstrip : DrawingArea
{
- static readonly Cairo.Color BackgroundGradientStart = new Cairo.Color (241d / 255d, 241d / 255d, 241d / 255d);
- static readonly Cairo.Color BackgroundGradientEnd = BackgroundGradientStart;//new Cairo.Color (224d / 255d, 224d / 255d, 224d / 255d);
- internal static readonly Cairo.Color ActiveGradientStart = new Cairo.Color (92d / 255d, 93d / 255d, 94d / 255d);
- internal static readonly Cairo.Color ActiveGradientEnd = new Cairo.Color (134d / 255d, 136d / 255d, 137d / 255d);
readonly List<Tab> tabs = new List<Tab> ();
readonly List<Cairo.PointD> tabSizes = new List<Cairo.PointD> ();
@@ -181,19 +178,9 @@ namespace MonoDevelop.Components
{
using (var cr = Gdk.CairoHelper.Create (evnt.Window)) {
cr.Rectangle (0, 0, Allocation.Width, Allocation.Height);
- using (LinearGradient gr = new LinearGradient (0, 0, 0, Allocation.Height)) {
- gr.AddColorStop (0, BackgroundGradientStart);
- gr.AddColorStop (1, BackgroundGradientEnd);
- cr.SetSource (gr);
- }
+ cr.SetSourceColor (Styles.SubTabBarBackgroundColor.ToCairoColor ());
cr.Fill ();
- cr.MoveTo (0.5, 0.5);
- cr.Line (0.5, 0.5, Allocation.Width - 1, 0.5);
- cr.SetSourceRGB (1,1,1);
- cr.LineWidth = 1;
- cr.Stroke ();
-
for (int i = tabs.Count; i --> 0;) {
if (i == ActiveTab)
continue;
@@ -219,7 +206,7 @@ namespace MonoDevelop.Components
internal static readonly int SpacerWidth = 8;
const int Padding = 6;
Pango.Layout layout;
- Tabstrip parent;
+ //Tabstrip parent;
int w, h;
public string Label {
@@ -273,9 +260,11 @@ namespace MonoDevelop.Components
public Tab (Tabstrip parent, string label, TabPosition tabPosition)
{
- this.parent = parent;
+ //this.parent = parent;
this.Label = label;
+
layout = PangoUtil.CreateLayout (parent);
+ layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11);
layout.SetText (label);
layout.Alignment = Pango.Alignment.Center;
layout.GetPixelSize (out w, out h);
@@ -289,9 +278,9 @@ namespace MonoDevelop.Components
public Cairo.PointD Size {
get {
if (IsSeparator)
- return new Cairo.PointD (w, h + Padding*2);
+ return new Cairo.PointD (w, h + Padding * 2);
else
- return new Cairo.PointD (Math.Max (45, w + SpacerWidth * 2), h + Padding*2);
+ return new Cairo.PointD (Math.Max (45, w + SpacerWidth * 2), h + Padding * 2);
}
}
@@ -303,7 +292,7 @@ namespace MonoDevelop.Components
cr.MoveTo (x, rectangle.Y + 0.5 + 2);
cr.RelLineTo (0, rectangle.Height - 1 - 4);
cr.ClosePath ();
- cr.SetSourceColor (parent.Style.Dark (StateType.Normal).ToCairoColor ());
+ cr.SetSourceColor (Styles.SubTabBarSeparatorColor.ToCairoColor ());
cr.LineWidth = 1;
cr.Stroke ();
return;
@@ -312,50 +301,26 @@ namespace MonoDevelop.Components
if (Active || HoverPosition.X >= 0) {
if (Active) {
cr.Rectangle (rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
- using (var gr = new LinearGradient (rectangle.X, rectangle.Y, rectangle.X, rectangle.Y + rectangle.Height)) {
- gr.AddColorStop (0, Tabstrip.ActiveGradientStart);
- gr.AddColorStop (1, Tabstrip.ActiveGradientEnd);
- cr.SetSource (gr);
- }
+ cr.SetSourceColor (Styles.SubTabBarActiveBackgroundColor.ToCairoColor ());
cr.Fill ();
- cr.Rectangle (rectangle.X + 0.5, rectangle.Y + 0.5, rectangle.Width - 1, rectangle.Height - 1);
- cr.SetSourceRGBA (1, 1, 1, 0.05);
- cr.LineWidth = 1;
- cr.Stroke ();
} else if (HoverPosition.X >= 0) {
cr.Rectangle (rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
- using (var gr = new LinearGradient (rectangle.X, rectangle.Y, rectangle.X, rectangle.Y + rectangle.Height)) {
- var c1 = Tabstrip.ActiveGradientStart;
- var c2 = Tabstrip.ActiveGradientEnd;
- c1.A = 0.2;
- c2.A = 0.2;
- gr.AddColorStop (0, c1);
- gr.AddColorStop (1, c2);
- cr.SetSource (gr);
- }
+ cr.SetSourceColor (Styles.SubTabBarHoverBackgroundColor.ToCairoColor ());
cr.Fill ();
}
}
- if (Active)
- cr.SetSourceRGB (1, 1, 1);
- else
- cr.SetSourceColor (parent.Style.Text (StateType.Normal).ToCairoColor ());
-
- if (layout.Width != (int)rectangle.Width)
- layout.Width = (int)rectangle.Width;
+ if (Active) {
+ cr.SetSourceColor (Styles.SubTabBarActiveTextColor.ToCairoColor ());
+ layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11, Pango.Weight.Bold);
+ } else {
+ cr.SetSourceColor (Styles.SubTabBarTextColor.ToCairoColor ());
+ layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11);
+ }
- #if MAC
- /* On Cocoa, Pango doesn't render text correctly using layout width/height computation.
- * For instance here we need to balance some kind of internal padding by two pixels which
- * only happens on Mac.
- */
- const int verticalOffset = -2;
- #else
- const int verticalOffset = 0;
- #endif
+ layout.Width = (int)rectangle.Width;
- cr.MoveTo (rectangle.X + (int)(rectangle.Width / 2), (rectangle.Height - h) / 2 + verticalOffset);
+ cr.MoveTo (rectangle.X + (int)(rectangle.Width / 2), (rectangle.Height - h) / 2 - 1);
Pango.CairoHelper.ShowLayout (cr, layout);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipPopoverWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipPopoverWindow.cs
index 74847c43f1..ce54d5e15f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipPopoverWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipPopoverWindow.cs
@@ -26,6 +26,7 @@
using System;
using MonoDevelop.Ide.Tasks;
using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.Components
{
@@ -39,8 +40,8 @@ namespace MonoDevelop.Components
public TooltipPopoverWindow ()
{
- Theme.SetFlatColor (Styles.PopoverWindow.DefaultBackgroundColor);
- Theme.BorderColor = Styles.PopoverWindow.DefaultBorderColor;
+ Theme.SetBackgroundColor (Styles.PopoverWindow.DefaultBackgroundColor.ToCairoColor ());
+ Theme.Font = FontService.SansFont.CopyModified (Styles.FontScale11);
ShowArrow = true;
}
@@ -80,38 +81,30 @@ namespace MonoDevelop.Components
if (severity.HasValue) {
Theme.Padding = 3;
Theme.CornerRadius = 3;
- Theme.BorderColor = new Cairo.Color (0, 0, 0, 0);
- alignment.SetPadding (4, 4, 6, 6);
+ alignment.SetPadding (4, 5, 4, 4);
- var f = Style.FontDescription.Copy ();
- f.Size = ((f.Size / (int)Pango.Scale.PangoScale) - 1) * (int)Pango.Scale.PangoScale;
- label.ModifyFont (f);
+ label.ModifyFont (FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11));
switch (severity.Value) {
case TaskSeverity.Information:
- Theme.SetFlatColor (Styles.PopoverWindow.InformationBackgroundColor);
- Theme.BorderColor = Styles.PopoverWindow.InformationBorderColor;
+ Theme.SetBackgroundColor (Styles.PopoverWindow.InformationBackgroundColor.ToCairoColor ());
break;
case TaskSeverity.Comment:
- Theme.SetFlatColor (Styles.PopoverWindow.InformationBackgroundColor);
- Theme.BorderColor = Styles.PopoverWindow.InformationBorderColor;
+ Theme.SetBackgroundColor (Styles.PopoverWindow.InformationBackgroundColor.ToCairoColor ());
break;
case TaskSeverity.Error:
- Theme.SetFlatColor (Styles.PopoverWindow.ErrorBackgroundColor);
- Theme.BorderColor = Styles.PopoverWindow.ErrorBorderColor;
+ Theme.SetBackgroundColor (Styles.PopoverWindow.ErrorBackgroundColor.ToCairoColor ());
return;
case TaskSeverity.Warning:
- Theme.SetFlatColor (Styles.PopoverWindow.WarningBackgroundColor);
- Theme.BorderColor = Styles.PopoverWindow.WarningBorderColor;
+ Theme.SetBackgroundColor (Styles.PopoverWindow.WarningBackgroundColor.ToCairoColor ());
return;
}
} else {
- Theme.SetFlatColor (Styles.PopoverWindow.DefaultBackgroundColor);
- Theme.BorderColor = Styles.PopoverWindow.DefaultBorderColor;
+ Theme.SetBackgroundColor (Styles.PopoverWindow.DefaultBackgroundColor.ToCairoColor ());
}
}
}
@@ -120,8 +113,9 @@ namespace MonoDevelop.Components
{
if (label == null) {
alignment = new Gtk.Alignment (0.5f, 0.5f, 1f, 1f);
- alignment.SetPadding (6, 6, 6, 6);
+ alignment.SetPadding (4, 5, 4, 4);
label = new Gtk.Label ();
+ label.ModifyFont (Theme.Font);
alignment.Add (label);
ContentBox.Add (alignment);
alignment.ShowAll ();
@@ -130,32 +124,29 @@ namespace MonoDevelop.Components
void UpdateLabel ()
{
- if (severity.HasValue) {
- string msg = hasMarkup ? text : GLib.Markup.EscapeText (text);
+ string msg = hasMarkup ? text : GLib.Markup.EscapeText (text);
+ if (severity.HasValue) {
switch (severity.Value) {
case TaskSeverity.Information:
- label.Markup = "<b><span color='" + CairoExtensions.ColorGetHex (Styles.PopoverWindow.InformationTextColor) + "'>" + msg + "</span></b>";
+ label.Markup = "<span font='" + Theme.Font.ToString () + "' color='" + Styles.ColorGetHex (Styles.PopoverWindow.InformationTextColor) + "'>" + msg + "</span>";
return;
case TaskSeverity.Comment:
- label.Markup = "<b><span color='" + CairoExtensions.ColorGetHex (Styles.PopoverWindow.InformationTextColor) + "'>" + msg + "</span></b>";
+ label.Markup = "<span font='" + Theme.Font.ToString () + "' color='" + Styles.ColorGetHex (Styles.PopoverWindow.InformationTextColor) + "'>" + msg + "</span>";
return;
case TaskSeverity.Error:
- label.Markup = "<b><span color='" + CairoExtensions.ColorGetHex (Styles.PopoverWindow.ErrorTextColor) + "'>" + msg + "</span></b>";
+ label.Markup = "<span font='" + Theme.Font.ToString () + "' color='" + Styles.ColorGetHex (Styles.PopoverWindow.ErrorTextColor) + "'>" + msg + "</span>";
return;
case TaskSeverity.Warning:
- label.Markup = "<b><span color='" + CairoExtensions.ColorGetHex (Styles.PopoverWindow.WarningTextColor) + "'>" + msg + "</span></b>";
+ label.Markup = "<span font='" + Theme.Font.ToString () + "' color='" + Styles.ColorGetHex (Styles.PopoverWindow.WarningTextColor) + "'>" + msg + "</span>";
return;
}
}
- if (hasMarkup)
- label.Markup = text;
- else
- label.Text = text;
+ label.Markup = "<span font='" + Theme.Font.ToString () + "' color='" + Styles.ColorGetHex (Styles.PopoverWindow.DefaultTextColor) + "'>" + msg + "</span>";
}
void AdjustSize ()
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs
index e5685f27af..f2cfc14f3a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TooltipWindow.cs
@@ -26,12 +26,10 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using MonoDevelop.Ide;
using Gtk;
using Gdk;
-using Mono.TextEditor.PopupWindow;
namespace MonoDevelop.Components
{
@@ -41,7 +39,7 @@ namespace MonoDevelop.Components
public string LinkColor {
get {
- var color = Mono.TextEditor.HslColor.GenerateHighlightColors (Style.Background (State), Style.Text (State), 3)[2];
+ var color = HslColor.GenerateHighlightColors (Style.Background (State), Style.Text (State), 3)[2];
return color.ToPangoString ();
}
}
@@ -118,19 +116,23 @@ namespace MonoDevelop.Components
// LimitWidth (fittedWidth);
// }
- Gdk.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtPoint (x, y));
+ Xwt.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen.Number, Screen.GetMonitorAtPoint (x, y));
+ int left = (int)geometry.Left;
+ int top = (int)geometry.Top;
+ int width = (int)geometry.Width;
+ int height = (int)geometry.Height;
if (NudgeHorizontal) {
if (allocation.Width <= geometry.Width && x + allocation.Width >= geometry.Left + geometry.Width - edgeGap)
- x = geometry.Left + (geometry.Width - allocation.Width - edgeGap);
- if (x <= geometry.Left + edgeGap)
- x = geometry.Left + edgeGap;
+ x = left + (width - allocation.Width - edgeGap);
+ if (x <= left + edgeGap)
+ x = left + edgeGap;
}
if (NudgeVertical) {
if (allocation.Height <= geometry.Height && y + allocation.Height >= geometry.Top + geometry.Height - edgeGap)
- y = geometry.Top + (geometry.Height - allocation.Height - edgeGap);
- if (y <= geometry.Top + edgeGap)
- y = geometry.Top + edgeGap;
+ y = top + (height - allocation.Height - edgeGap);
+ if (y <= top + edgeGap)
+ y = top + edgeGap;
}
if (y != oldY || x != oldX)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TreeViewCellContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TreeViewCellContainer.cs
index 42b8f16c02..61b4939117 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TreeViewCellContainer.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/TreeViewCellContainer.cs
@@ -41,7 +41,6 @@ namespace MonoDevelop.Components
{
box = new EventBox ();
box.ButtonPressEvent += new ButtonPressEventHandler (OnClickBox);
- box.ModifyBg (StateType.Normal, Style.White);
box.Add (child);
child.Show ();
Show ();
@@ -80,7 +79,12 @@ namespace MonoDevelop.Components
protected override void OnSizeRequested (ref Requisition requisition)
{
base.OnSizeRequested (ref requisition);
- requisition = box.SizeRequest ();
+ if (box.Child != null) {
+ requisition = box.Child.SizeRequest ();
+ requisition.Height += 2 * box.Child.Style?.YThickness ?? 0;
+ }
+ else
+ requisition = box.SizeRequest ();
}
protected override void OnSizeAllocated (Gdk.Rectangle allocation)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/VPanedThin.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/VPanedThin.cs
index 838c04f970..b2d116950b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/VPanedThin.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/VPanedThin.cs
@@ -34,7 +34,7 @@ namespace MonoDevelop.Components
public VPanedThin ()
{
- Mono.TextEditor.GtkWorkarounds.FixContainerLeak (this);
+ GtkWorkarounds.FixContainerLeak (this);
handle = new CustomPanedHandle (this);
handle.Parent = this;
}
@@ -65,7 +65,7 @@ namespace MonoDevelop.Components
if (Child1 != null && Child1.Visible && Child2 != null && Child2.Visible) {
var gc = new Gdk.GC (evnt.Window);
- gc.RgbFgColor = Styles.ThinSplitterColor;
+ gc.RgbFgColor = Styles.ThinSplitterColor.ToGdkColor ();
var y = Child1.Allocation.Y + Child1.Allocation.Height;
evnt.Window.DrawLine (gc, Allocation.X, y, Allocation.X + Allocation.Width, y);
gc.Dispose ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Window.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Window.cs
new file mode 100644
index 0000000000..8ce4da0a59
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Window.cs
@@ -0,0 +1,67 @@
+//
+// Window.cs
+//
+// Author:
+// therzok <marius.ungureanu@xamarin.com>
+//
+// Copyright (c) 2015 therzok
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Components
+{
+ public class Window : Control
+ {
+ protected Window ()
+ {
+ }
+
+ Window (object widget)
+ {
+ if (widget == null)
+ throw new ArgumentNullException (nameof (widget));
+
+ this.nativeWidget = widget;
+ cache.Add (widget, new WeakReference<Control> (this));
+ }
+
+ public static implicit operator Gtk.Window (Window d)
+ {
+ return d?.GetNativeWidget<Gtk.Window> ();
+ }
+
+ public static implicit operator Window (Gtk.Window d)
+ {
+ if (d == null)
+ return null;
+
+ var window = GetImplicit<Window, Gtk.Window>(d);
+ if (window == null) {
+ window = new Window (d);
+ d.Destroyed += delegate {
+ GC.SuppressFinalize (window);
+ window.Dispose (true);
+ };
+ }
+ return window;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/WindowTransparencyDecorator.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/WindowTransparencyDecorator.cs
new file mode 100644
index 0000000000..9b8e8526d8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/WindowTransparencyDecorator.cs
@@ -0,0 +1,116 @@
+//
+// WindowTransparencyDecorator.cs
+//
+// Author:
+// Michael Hutchinson <mhutch@xamarin.com>
+//
+// Based on code derived from Banshee.Widgets.EllipsizeLabel
+// by Aaron Bockover (aaron@aaronbock.net)
+//
+// Copyright (C) 2005-2008 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+using Gtk;
+using Gdk;
+
+namespace MonoDevelop.Components
+{
+ public class WindowTransparencyDecorator
+ {
+ Gtk.Window window;
+ bool semiTransparent;
+ bool snooperInstalled;
+ uint snooperID;
+ const double opacity = 0.2;
+
+ WindowTransparencyDecorator (Gtk.Window window)
+ {
+ this.window = window;
+
+ window.Shown += ShownHandler;
+ window.Hidden += HiddenHandler;
+ window.Destroyed += DestroyedHandler;
+ }
+
+ public static WindowTransparencyDecorator Attach (Gtk.Window window)
+ {
+ return new WindowTransparencyDecorator (window);
+ }
+
+ public void Detach ()
+ {
+ if (window == null)
+ return;
+
+ //remove the snooper
+ HiddenHandler (null, null);
+
+ //annul allreferences between this and the window
+ window.Shown -= ShownHandler;
+ window.Hidden -= HiddenHandler;
+ window.Destroyed -= DestroyedHandler;
+ window = null;
+ }
+
+ void ShownHandler (object sender, EventArgs args)
+ {
+ if (!snooperInstalled)
+ snooperID = Gtk.Key.SnooperInstall (TransparencyKeySnooper);
+ snooperInstalled = true;
+
+ //NOTE: we unset transparency when showing, instead of when hiding
+ //because the latter case triggers a metacity+compositing bug that shows the window again
+ SemiTransparent = false;
+ }
+
+ void HiddenHandler (object sender, EventArgs args)
+ {
+ if (snooperInstalled)
+ Gtk.Key.SnooperRemove (snooperID);
+ snooperInstalled = false;
+ }
+
+ void DestroyedHandler (object sender, EventArgs args)
+ {
+ Detach ();
+ }
+
+ int TransparencyKeySnooper (Gtk.Widget widget, EventKey evnt)
+ {
+ if (evnt != null && evnt.Key == Gdk.Key.Control_L || evnt.Key == Gdk.Key.Control_R)
+ SemiTransparent = (evnt.Type == Gdk.EventType.KeyPress);
+ return 0; //FALSE
+ }
+
+ bool SemiTransparent {
+ set {
+ if (semiTransparent != value) {
+ semiTransparent = value;
+ window.Opacity = semiTransparent? opacity : 1.0;
+ }
+ }
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWPFWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWPFWidget.cs
index 10dd3d4b6e..60370b13db 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWPFWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWPFWidget.cs
@@ -1,96 +1,89 @@
-//
-// GtkWPFWidget.cs
-//
-// Author:
-// Marius Ungureanu <marius.ungureanu@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
+//
+// GtkWPFWidget.cs
+//
+// Author:
+// Marius Ungureanu <marius.ungureanu@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
#if WIN32
using System;
using System.Windows;
using System.Windows.Interop;
using Gtk;
using Gdk;
-
+using System.Threading;
+using System.Runtime.InteropServices;
+
namespace MonoDevelop.Components.Windows
{
public class GtkWPFWidget : Widget
{
- bool fromGtk;
- internal System.Windows.Window wpfWindow {
+ internal System.Windows.Forms.Integration.ElementHost wpfWidgetHost {
get;
private set;
}
public GtkWPFWidget (System.Windows.Controls.Control wpfControl)
{
- wpfWindow = new System.Windows.Window {
- Content = wpfControl,
- AllowsTransparency = true,
- WindowStyle = WindowStyle.None,
- Background = System.Windows.Media.Brushes.Transparent,
- };
- wpfWindow.PreviewKeyDown += (sender, e) => {
- // TODO: Some commands check for toplevels, and this window is not a toplevel.
- var key = e.Key == System.Windows.Input.Key.System ? e.SystemKey : e.Key;
- e.Handled = Ide.IdeApp.CommandService.ProcessKeyEvent (GtkWin32Interop.ConvertKeyEvent (e.KeyboardDevice.Modifiers, key));
- };
-
- wpfWindow.Closed += (sender, e) => {
- if (fromGtk)
+ wpfWidgetHost = new System.Windows.Forms.Integration.ElementHost
+ {
+ BackColor = System.Drawing.Color.Transparent,
+ Child = wpfControl,
+ };
+
+ wpfControl.PreviewKeyDown += (sender, e) => {
+ // TODO: Some commands check for toplevels, and this window is not a toplevel.
+ if (e.Key == System.Windows.Input.Key.Escape)
+ {
+ System.Windows.Input.Keyboard.ClearFocus();
+ MonoDevelop.Ide.IdeApp.Workbench.Present();
return;
+ }
- Ide.IdeApp.Exit ();
- };
- wpfWindow.ShowInTaskbar = false;
+ var key = e.Key == System.Windows.Input.Key.System ? e.SystemKey : e.Key;
+ e.Handled = Ide.IdeApp.CommandService.ProcessKeyEvent (GtkWin32Interop.ConvertKeyEvent (e.KeyboardDevice.Modifiers, key));
+ };
WidgetFlags |= WidgetFlags.NoWindow;
}
void RepositionWpfWindow ()
{
int x, y;
-
- var gtkWnd = Toplevel as Gtk.Window;
- int offset = 0;
- if (gtkWnd.Decorated)
- offset = System.Windows.Forms.SystemInformation.CaptionHeight;
-
- int root_x, root_y;
- gtkWnd.GetPosition (out root_x, out root_y);
- if (TranslateCoordinates (Toplevel, root_x, root_y + offset, out x, out y)) {
- wpfWindow.Left = x;
- wpfWindow.Top = y;
+ if (TranslateCoordinates (Toplevel, 0, 0, out x, out y)) {
+ wpfWidgetHost.Left = x;
+ wpfWidgetHost.Top = y;
} else {
- wpfWindow.Left = Allocation.Left;
- wpfWindow.Top = Allocation.Top;
- }
- wpfWindow.Width = Allocation.Width;
- wpfWindow.Height = Allocation.Height;
+ wpfWidgetHost.Left = Allocation.Left;
+ wpfWidgetHost.Top = Allocation.Top;
+ }
+ wpfWidgetHost.Width = Allocation.Width + 1;
+ wpfWidgetHost.Height = Allocation.Height + 1;
}
protected override void OnRealized ()
{
base.OnRealized ();
+ // Initial size setting.
RepositionWpfWindow ();
}
@@ -98,43 +91,36 @@ namespace MonoDevelop.Components.Windows
{
base.OnSizeAllocated (allocation);
+ // Needed for window full screening.
RepositionWpfWindow ();
}
- protected override void OnDestroyed ()
+ void OnWindowConfigured(object sender, ConfigureEventArgs args)
{
- base.OnDestroyed ();
-
- fromGtk = true;
- wpfWindow.Close ();
+ RepositionWpfWindow();
}
- protected override void OnShown ()
+ protected override void OnDestroyed ()
{
- base.OnShown ();
-
- wpfWindow.Show ();
- AttachWindow ();
- }
-
- void AttachWindow ()
+ base.OnDestroyed ();
+
+ wpfWidgetHost.Dispose();
+ }
+
+ protected override void OnShown ()
{
- IntPtr gtkWindowPtr = GtkWin32Interop.HWndGet (Ide.IdeApp.Workbench.RootWindow.GdkWindow);
- IntPtr wpfWindowPtr = new WindowInteropHelper (wpfWindow).Handle;
- GtkWin32Interop.SetWindowLongPtr (wpfWindowPtr, (int)GtkWin32Interop.GWLParameter.GWL_HWNDPARENT, gtkWindowPtr);
+ base.OnShown ();
+
+ IntPtr gtkWindowPtr = GtkWin32Interop.HWndGet(Ide.IdeApp.Workbench.RootWindow.GdkWindow);
+ IntPtr wpfWindowPtr = wpfWidgetHost.Handle;
+ GtkWin32Interop.SetWindowLongPtr(wpfWindowPtr, (int)GtkWin32Interop.GWLParameter.GWL_HWNDPARENT, gtkWindowPtr);
Ide.IdeApp.Workbench.RootWindow.ConfigureEvent += OnWindowConfigured;
}
- void OnWindowConfigured (object sender, ConfigureEventArgs args)
- {
- RepositionWpfWindow ();
- }
-
protected override void OnHidden ()
{
base.OnHidden ();
-
- wpfWindow.Hide ();
+
Ide.IdeApp.Workbench.RootWindow.ConfigureEvent -= OnWindowConfigured;
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CodeCompletionContextEventArgs.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CodeCompletionContextEventArgs.cs
index a658f30b05..5d455b0bb3 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CodeCompletionContextEventArgs.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CodeCompletionContextEventArgs.cs
@@ -29,7 +29,7 @@ namespace MonoDevelop.Ide.CodeCompletion
{
public class CodeCompletionContextEventArgs : EventArgs
{
- public ICompletionWidget Widget {
+ internal ICompletionWidget Widget {
get;
set;
}
@@ -44,7 +44,7 @@ namespace MonoDevelop.Ide.CodeCompletion
set;
}
- public CodeCompletionContextEventArgs (ICompletionWidget widget, CodeCompletionContext codeCompletionContext, string completedWord)
+ internal CodeCompletionContextEventArgs (ICompletionWidget widget, CodeCompletionContext codeCompletionContext, string completedWord)
{
this.Widget = widget;
this.CodeCompletionContext = codeCompletionContext;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionCategory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionCategory.cs
new file mode 100644
index 0000000000..fc88fd62b2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionCategory.cs
@@ -0,0 +1,50 @@
+//
+// CompletionCategory.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Ide.CodeCompletion
+{
+ public abstract class CompletionCategory : IComparable<CompletionCategory>
+ {
+ public string DisplayText { get; set; }
+
+ public string Icon { get; set; }
+
+ protected CompletionCategory ()
+ {
+ }
+
+ protected CompletionCategory (string displayText, string icon)
+ {
+ this.DisplayText = displayText;
+ this.Icon = icon;
+ }
+
+ public abstract int CompareTo (CompletionCategory other);
+ }
+
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionData.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionData.cs
index 2303d06b5e..d7b25cf2f8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionData.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionData.cs
@@ -29,12 +29,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
using MonoDevelop.Core;
-using ICSharpCode.NRefactory.Completion;
+using MonoDevelop.Ide.Editor.Extension;
namespace MonoDevelop.Ide.CodeCompletion
{
- public class CompletionData : ICompletionData, IComparable
+ public class CompletionData : IComparable
{
protected CompletionData () {}
@@ -43,6 +45,13 @@ namespace MonoDevelop.Ide.CodeCompletion
public virtual string Description { get; set; }
public virtual string CompletionText { get; set; }
+ /// <summary>
+ /// int.MaxValue == highest prioriy,
+ /// -int.MaxValue == lowest priority
+ /// </summary>
+ /// <value>The priority group.</value>
+ public virtual int PriorityGroup { get { return 0; } }
+
public virtual string GetDisplayDescription (bool isSelected)
{
return null;
@@ -56,31 +65,50 @@ namespace MonoDevelop.Ide.CodeCompletion
public virtual CompletionCategory CompletionCategory { get; set; }
public virtual DisplayFlags DisplayFlags { get; set; }
- public virtual TooltipInformation CreateTooltipInformation (bool smartWrap)
+ public virtual Task<TooltipInformation> CreateTooltipInformation (bool smartWrap, CancellationToken cancelToken)
{
var tt = new TooltipInformation ();
if (!string.IsNullOrEmpty (Description))
tt.AddCategory (null, Description);
- return tt;
+ return Task.FromResult (tt);
}
- public virtual bool HasOverloads {
+
+ public ICompletionDataKeyHandler KeyHandler { get; protected set; }
+
+ public virtual bool HasOverloads {
get {
- return false;
+ return overloads != null;
}
}
-
- public virtual IEnumerable<ICompletionData> OverloadedData {
+
+ List<CompletionData> overloads;
+
+ public void AddOverload (CompletionData data)
+ {
+ if (overloads == null)
+ overloads = new List<CompletionData> ();
+ overloads.Add ((CompletionData)data);
+ sorted = null;
+ }
+
+ List<CompletionData> sorted;
+
+ public virtual IReadOnlyList<CompletionData> OverloadedData {
get {
- throw new InvalidOperationException ();
+ if (overloads == null)
+ return new CompletionData[] { this };
+
+ if (sorted == null) {
+ sorted = new List<CompletionData> ();
+ sorted.Add (this);
+ sorted.AddRange (overloads);
+ // sorted.Sort (new OverloadSorter ());
+ }
+ return sorted;
}
}
-
- public virtual void AddOverload (ICompletionData data)
- {
- throw new InvalidOperationException ();
- }
-
+
public CompletionData (string text) : this (text, null, null) {}
public CompletionData (string text, IconId icon) : this (text, icon, null) {}
public CompletionData (string text, IconId icon, string description) : this (text, icon, description, text) {}
@@ -92,19 +120,24 @@ namespace MonoDevelop.Ide.CodeCompletion
this.Description = description;
this.CompletionText = completionText;
}
-
- public static string GetCurrentWord (CompletionListWindow window)
+
+ public static string GetCurrentWord (CompletionListWindow window, MonoDevelop.Ide.Editor.Extension.KeyDescriptor descriptor)
{
int partialWordLength = window.PartialWord != null ? window.PartialWord.Length : 0;
- int replaceLength = window.CodeCompletionContext.TriggerWordLength + partialWordLength - window.InitialWordLength;
- int endOffset = Math.Min (window.CodeCompletionContext.TriggerOffset + replaceLength, window.CompletionWidget.TextLength);
- var result = window.CompletionWidget.GetText (window.CodeCompletionContext.TriggerOffset, endOffset);
+ int replaceLength;
+ if (descriptor.SpecialKey == SpecialKey.Return || descriptor.SpecialKey == SpecialKey.Tab) {
+ replaceLength = window.CodeCompletionContext.TriggerWordLength + partialWordLength - window.InitialWordLength;
+ } else {
+ replaceLength = partialWordLength;
+ }
+ int endOffset = Math.Min (window.StartOffset + replaceLength, window.CompletionWidget.TextLength);
+ var result = window.CompletionWidget.GetText (window.StartOffset, endOffset);
return result;
}
- public virtual void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
+ public virtual void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
- var currentWord = GetCurrentWord (window);
+ var currentWord = GetCurrentWord (window, descriptor);
window.CompletionWidget.SetCompletionText (window.CodeCompletionContext, currentWord, CompletionText);
}
@@ -117,12 +150,12 @@ namespace MonoDevelop.Ide.CodeCompletion
public virtual int CompareTo (object obj)
{
- if (!(obj is ICompletionData))
+ if (!(obj is CompletionData))
return 0;
- return Compare (this, (ICompletionData)obj);
+ return Compare (this, (CompletionData)obj);
}
- public static int Compare (ICompletionData a, ICompletionData b)
+ public static int Compare (CompletionData a, CompletionData b)
{
var result = ((a.DisplayFlags & DisplayFlags.Obsolete) == (b.DisplayFlags & DisplayFlags.Obsolete)) ? StringComparer.OrdinalIgnoreCase.Compare (a.DisplayText, b.DisplayText) : (a.DisplayFlags & DisplayFlags.Obsolete) != 0 ? 1 : -1;
if (result == 0) {
@@ -133,16 +166,63 @@ namespace MonoDevelop.Ide.CodeCompletion
if (aIsImport && !bIsImport)
return 1;
if (aIsImport && bIsImport)
- return StringComparer.Ordinal.Compare (a.Description, b.Description);
+ return StringComparer.Ordinal.Compare (((CompletionData)a).Description, ((CompletionData)b).Description);
var ca = a as CompletionData;
var cb = b as CompletionData;
if (ca != null && cb != null && !ca.Icon.IsNull && !cb.Icon.IsNull) {
- return cb.Icon.Name.CompareTo (ca.Icon.Name);
+ return string.Compare(cb.Icon.Name, ca.Icon.Name, StringComparison.Ordinal);
}
}
return result;
}
#endregion
+
+ protected string ApplyDiplayFlagsFormatting (string markup)
+ {
+ if (!HasOverloads && (DisplayFlags & DisplayFlags.Obsolete) != 0 || HasOverloads && OverloadedData.All (data => (data.DisplayFlags & DisplayFlags.Obsolete) != 0))
+ return "<s>" + markup + "</s>";
+ if ((DisplayFlags & DisplayFlags.MarkedBold) != 0)
+ return "<b>" + markup + "</b>";
+ return markup;
+ }
+
+ public virtual string GetDisplayTextMarkup ()
+ {
+ return ApplyDiplayFlagsFormatting (GLib.Markup.EscapeText (DisplayText));
+ }
+
+ public virtual bool IsOverload (CompletionData other)
+ {
+ return DisplayText == other.DisplayText;
+ }
+ }
+
+ public class ISymbolCompletionData : CompletionData
+ {
+ public virtual Microsoft.CodeAnalysis.ISymbol Symbol {
+ get;
+ protected set;
+ }
+
+ public ISymbolCompletionData ()
+ {
+ }
+
+ public ISymbolCompletionData (string text) : base (text)
+ {
+ }
+
+ public ISymbolCompletionData (string text, MonoDevelop.Core.IconId icon) : base (text, icon)
+ {
+ }
+
+ public ISymbolCompletionData (string text, MonoDevelop.Core.IconId icon, string description) : base (text, icon, description)
+ {
+ }
+
+ public ISymbolCompletionData (string displayText, MonoDevelop.Core.IconId icon, string description, string completionText) : base (displayText, icon, description, completionText)
+ {
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionDataList.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionDataList.cs
index 2311475497..e0c21b8177 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionDataList.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionDataList.cs
@@ -30,12 +30,14 @@ using System;
using System.Collections.Generic;
using System.Linq;
using MonoDevelop.Core;
-using ICSharpCode.NRefactory.Completion;
+using MonoDevelop.Ide.Editor.Extension;
namespace MonoDevelop.Ide.CodeCompletion
{
- public interface ICompletionDataList : IList<ICompletionData>
+ public interface ICompletionDataList : IList<CompletionData>
{
+ int TriggerWordLength { get; }
+
bool IsSorted { get; }
bool AutoCompleteUniqueMatch { get; }
bool AutoCompleteEmptyMatch { get; }
@@ -44,8 +46,8 @@ namespace MonoDevelop.Ide.CodeCompletion
bool AutoSelect { get; }
string DefaultCompletionString { get; }
CompletionSelectionMode CompletionSelectionMode { get; }
- void Sort (Comparison<ICompletionData> comparison);
- void Sort (IComparer<ICompletionData> comparison);
+ void Sort (Comparison<CompletionData> comparison);
+ void Sort (IComparer<CompletionData> comparison);
IEnumerable<ICompletionKeyHandler> KeyHandler { get; }
@@ -56,8 +58,8 @@ namespace MonoDevelop.Ide.CodeCompletion
public interface ICompletionKeyHandler
{
- bool PreProcessKey (CompletionListWindow listWindow, Gdk.Key key, char keyChar, Gdk.ModifierType modifier, out KeyActions keyAction);
- bool PostProcessKey (CompletionListWindow listWindow, Gdk.Key key, char keyChar, Gdk.ModifierType modifier, out KeyActions keyAction);
+ bool PreProcessKey (CompletionListWindow listWindow, KeyDescriptor descriptor, out KeyActions keyAction);
+ bool PostProcessKey (CompletionListWindow listWindow, KeyDescriptor descriptor, out KeyActions keyAction);
}
public enum CompletionSelectionMode {
@@ -65,10 +67,12 @@ namespace MonoDevelop.Ide.CodeCompletion
OwnTextField
}
- public class CompletionDataList : List<ICompletionData>, ICompletionDataList
+ public class CompletionDataList : List<CompletionData>, ICompletionDataList
{
+ public int TriggerWordLength { get; set; }
+
public bool IsSorted { get; set; }
- public IComparer<ICompletionData> Comparer { get; set; }
+ public IComparer<CompletionData> Comparer { get; set; }
public bool AutoCompleteUniqueMatch { get; set; }
public string DefaultCompletionString { get; set; }
@@ -87,7 +91,7 @@ namespace MonoDevelop.Ide.CodeCompletion
this.AutoSelect = true;
}
- public CompletionDataList (IEnumerable<ICompletionData> data) : base(data)
+ public CompletionDataList (IEnumerable<CompletionData> data) : base(data)
{
this.AutoSelect = true;
}
@@ -144,7 +148,7 @@ namespace MonoDevelop.Ide.CodeCompletion
return false;
}
- public void RemoveWhere (Func<ICompletionData,bool> shouldRemove)
+ public void RemoveWhere (Func<CompletionData,bool> shouldRemove)
{
for (int i = 0; i < this.Count;) {
if (shouldRemove (this[i]))
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs
index 224fa14b54..6eec222be8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionListWindow.cs
@@ -32,21 +32,329 @@ using Gtk;
using MonoDevelop.Core;
using MonoDevelop.Components;
using System.Linq;
-using ICSharpCode.NRefactory.Completion;
-using Mono.TextEditor.PopupWindow;
+using MonoDevelop.Ide.Editor.Extension;
+using System.ComponentModel;
+using System.Threading;
+using Xwt.Drawing;
namespace MonoDevelop.Ide.CodeCompletion
{
- public class CompletionListWindow : ListWindow, IListDataProvider
+ public class CompletionListWindow : IListDataProvider
+ {
+ CompletionListWindowGtk window;
+
+ public CompletionListWindow ()
+ {
+ window = new CompletionListWindowGtk (this);
+ }
+
+ CompletionListWindow (Gtk.WindowType type)
+ {
+ window = new CompletionListWindowGtk (this, type);
+ }
+
+ internal static CompletionListWindow CreateAsDialog ()
+ {
+ var w = new CompletionListWindow (Gtk.WindowType.Toplevel);
+ w.window.TypeHint = Gdk.WindowTypeHint.Dialog;
+ w.window.Decorated = false;
+ return w;
+ }
+
+ int IListDataProvider.ItemCount {
+ get {
+ return window.ItemCount;
+ }
+ }
+
+ int IListDataProvider.CompareTo (int n, int m)
+ {
+ return window.CompareTo (n, m);
+ }
+
+ CompletionCategory IListDataProvider.GetCompletionCategory (int n)
+ {
+ return window.GetCompletionCategory (n);
+ }
+
+ CompletionData IListDataProvider.GetCompletionData (int n)
+ {
+ return window.GetCompletionData (n);
+ }
+
+ string IListDataProvider.GetCompletionText (int n)
+ {
+ return window.GetCompletionText (n);
+ }
+
+ string IListDataProvider.GetDescription (int n, bool isSelected)
+ {
+ return window.GetDescription (n, isSelected);
+ }
+
+ Xwt.Drawing.Image IListDataProvider.GetIcon (int n)
+ {
+ return window.GetIcon (n);
+ }
+
+ string IListDataProvider.GetMarkup (int n)
+ {
+ return window.GetMarkup (n);
+ }
+
+ string IListDataProvider.GetRightSideDescription (int n, bool isSelected)
+ {
+ return window.GetRightSideDescription (n, isSelected);
+ }
+
+ string IListDataProvider.GetText (int n)
+ {
+ return window.GetText (n);
+ }
+
+ bool IListDataProvider.HasMarkup (int n)
+ {
+ return window.HasMarkup (n);
+ }
+
+ public ICompletionDataList CompletionDataList {
+ get { return window.CompletionDataList; }
+ set { window.CompletionDataList = value; }
+ }
+
+ public Xwt.Rectangle Allocation {
+ get {
+ var r = window.Allocation;
+ return new Xwt.Rectangle (r.X, r.Y, r.Width, r.Height);
+ }
+ }
+
+ public CodeCompletionContext CodeCompletionContext {
+ get { return window.CodeCompletionContext; }
+ set { window.CodeCompletionContext = value; }
+ }
+
+ internal int StartOffset {
+ get { return window.StartOffset; }
+ set { window.StartOffset = value; }
+ }
+
+ public int EndOffset {
+ get { return window.EndOffset; }
+ set { window.EndOffset = value; }
+ }
+
+ internal ICompletionWidget CompletionWidget {
+ get { return window.CompletionWidget; }
+ set { window.CompletionWidget = value; }
+ }
+
+ public bool Visible {
+ get { return window.Visible; }
+ }
+
+ public int X {
+ get { return window.X; }
+ }
+
+ public int Y {
+ get { return window.Y; }
+ }
+
+ public bool AutoSelect {
+ get { return window.AutoSelect; }
+ set { window.AutoSelect = value; }
+ }
+
+ public bool SelectionEnabled {
+ get { return window.SelectionEnabled; }
+ }
+
+ public bool AutoCompleteEmptyMatch {
+ get { return window.AutoCompleteEmptyMatch; }
+ set { window.AutoCompleteEmptyMatch = value; }
+ }
+
+ public bool AutoCompleteEmptyMatchOnCurlyBrace {
+ get { return window.AutoCompleteEmptyMatchOnCurlyBrace; }
+ set { window.AutoCompleteEmptyMatchOnCurlyBrace = value; }
+ }
+
+ public string CompletionString {
+ get { return window.List.CompletionString; }
+ set { window.List.CompletionString = value; }
+ }
+
+ public string DefaultCompletionString {
+ get { return window.DefaultCompletionString; }
+ set { window.DefaultCompletionString = value; }
+ }
+
+ public bool CloseOnSquareBrackets {
+ get { return window.CloseOnSquareBrackets; }
+ set { window.CloseOnSquareBrackets = value; }
+ }
+
+ public int InitialWordLength {
+ get { return window.InitialWordLength; }
+ }
+
+ public event EventHandler<CodeCompletionContextEventArgs> WordCompleted {
+ add { window.WordCompleted += value; }
+ remove { window.WordCompleted -= value; }
+ }
+
+ /// <summary>
+ /// For unit test purposes.
+ /// </summary>
+ [EditorBrowsableAttribute (EditorBrowsableState.Never)]
+ internal event EventHandler WindowClosed {
+ add { window.WindowClosed += value; }
+ remove { window.WindowClosed -= value; }
+ }
+
+ internal Gtk.Window TransientFor {
+ get { return window.TransientFor; }
+ set { window.TransientFor = value; }
+ }
+
+ public CompletionTextEditorExtension Extension {
+ get { return window.Extension; }
+ set { window.Extension = value; }
+ }
+
+ internal void InitializeListWindow (ICompletionWidget completionWidget, CodeCompletionContext completionContext)
+ {
+ window.InitializeListWindow (completionWidget, completionContext);
+ }
+
+ internal bool ShowListWindow (char firstChar, ICompletionDataList list, ICompletionWidget completionWidget, CodeCompletionContext completionContext)
+ {
+ return window.ShowListWindow (firstChar, list, completionWidget, completionContext);
+ }
+
+ internal bool ShowListWindow (ICompletionDataList list, CodeCompletionContext completionContext)
+ {
+ return window.ShowListWindow (list, completionContext);
+ }
+
+ public void Show ()
+ {
+ window.Show ();
+ DesktopService.RemoveWindowShadow (window);
+ }
+
+ public void Destroy ()
+ {
+ window.Destroy ();
+ }
+
+ public string PartialWord {
+ get {
+ return window.PartialWord;
+ }
+ }
+
+ public string CurrentPartialWord {
+ get {
+ return window.CurrentPartialWord;
+ }
+ }
+
+ public bool IsUniqueMatch {
+ get {
+ return window.IsUniqueMatch;
+ }
+ }
+
+ public bool PreProcessKeyEvent (KeyDescriptor descriptor)
+ {
+ return window.PreProcessKeyEvent (descriptor);
+ }
+
+ public void PostProcessKeyEvent (KeyDescriptor descriptor)
+ {
+ window.PostProcessKeyEvent (descriptor);
+ }
+
+ internal bool IsInCompletion {
+ get {
+ return window.IsInCompletion;
+ }
+ }
+
+ public void UpdateWordSelection ()
+ {
+ window.UpdateWordSelection ();
+ }
+
+ public void RepositionWindow (Xwt.Rectangle? newCaret = null)
+ {
+ var r = newCaret != null ? new Gdk.Rectangle ((int)newCaret.Value.X, (int)newCaret.Value.Y, (int)newCaret.Value.Width, (int)newCaret.Value.Height) : (Gdk.Rectangle?)null;
+ window.RepositionWindow (r);
+ }
+
+ public void HideWindow ()
+ {
+ window.HideWindow ();
+ }
+
+ public void ToggleCategoryMode ()
+ {
+ window.ToggleCategoryMode ();
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating that shift was pressed during enter.
+ /// </summary>
+ /// <value>
+ /// <c>true</c> if was shift pressed; otherwise, <c>false</c>.
+ /// </value>
+ public bool WasShiftPressed {
+ get { return window.WasShiftPressed; }
+ }
+
+ // Used by tests
+ internal void FilterWords ()
+ {
+ window.List.FilterWords ();
+ }
+
+ public void ResetSizes ()
+ {
+ window.ResetSizes ();
+ }
+
+ public List<int> FilteredItems {
+ get {
+ return window.FilteredItems;
+ }
+ }
+
+ internal void ResetState ()
+ {
+ window.ResetState ();
+ }
+
+ public bool CompleteWord ()
+ {
+ return window.CompleteWord ();
+ }
+ }
+
+ class CompletionListWindowGtk : ListWindow
{
const int declarationWindowMargin = 3;
TooltipInformationWindow declarationviewwindow;
- ICompletionData currentData;
+ CompletionData currentData;
+ CancellationTokenSource declarationViewCancelSource;
Widget parsingMessage;
int initialWordLength;
int previousWidth = -1, previousHeight = -1;
-
+
+ CompletionListWindow facade;
+
public CodeCompletionContext CodeCompletionContext {
get;
set;
@@ -60,7 +368,6 @@ namespace MonoDevelop.Ide.CodeCompletion
}
IMutableCompletionDataList mutableList;
- ICompletionDataList completionDataList;
public ICompletionDataList CompletionDataList {
get { return completionDataList; }
set {
@@ -93,7 +400,7 @@ namespace MonoDevelop.Ide.CodeCompletion
List.QueueDraw ();
};
previewEntry.KeyPressEvent += delegate(object o, KeyPressEventArgs args) {
- var keyAction = PreProcessKey (args.Event.Key, (char)args.Event.KeyValue, args.Event.State);
+ var keyAction = PreProcessKey (KeyDescriptor.FromGtk (args.Event.Key, (char)args.Event.KeyValue, args.Event.State));
if (keyAction.HasFlag (KeyActions.Complete))
CompleteWord ();
@@ -121,15 +428,17 @@ namespace MonoDevelop.Ide.CodeCompletion
}
}
- public CompletionListWindow (WindowType type = WindowType.Popup) : base(type)
+ public CompletionListWindowGtk (CompletionListWindow facade, WindowType type = WindowType.Popup) : base(type)
{
+ this.facade = facade;
+
if (IdeApp.Workbench != null)
this.TransientFor = IdeApp.Workbench.RootWindow;
TypeHint = Gdk.WindowTypeHint.Combo;
SizeAllocated += new SizeAllocatedHandler (ListSizeChanged);
Events = Gdk.EventMask.PropertyChangeMask;
WindowTransparencyDecorator.Attach (this);
- DataProvider = this;
+ DataProvider = facade;
HideDeclarationView ();
List.ListScrolled += (object sender, EventArgs e) => {
HideDeclarationView ();
@@ -156,6 +465,7 @@ namespace MonoDevelop.Ide.CodeCompletion
CodeCompletionContext = null;
currentData = null;
Extension = null;
+ List.ResetState ();
}
protected override void OnDestroyed ()
@@ -189,61 +499,81 @@ namespace MonoDevelop.Ide.CodeCompletion
base.OnDestroyed ();
}
- public void PostProcessKeyEvent (Gdk.Key key, char keyChar, Gdk.ModifierType modifier)
+ public void PostProcessKeyEvent (KeyDescriptor descriptor)
{
KeyActions ka = KeyActions.None;
bool keyHandled = false;
- foreach (var handler in CompletionDataList.KeyHandler) {
- if (handler.PostProcessKey (this, key, keyChar, modifier, out ka)) {
- keyHandled = true;
- break;
+ if (CompletionDataList != null) {
+ foreach (var handler in CompletionDataList.KeyHandler) {
+ if (handler.PostProcessKey (facade, descriptor, out ka)) {
+ keyHandled = true;
+ break;
+ }
}
}
if (!keyHandled)
- ka = PostProcessKey (key, keyChar, modifier);
+ ka = PostProcessKey (descriptor);
if ((ka & KeyActions.Complete) != 0)
- CompleteWord (ref ka, key, keyChar, modifier);
- if ((ka & KeyActions.CloseWindow) != 0)
+ CompleteWord (ref ka, descriptor);
+ if ((ka & KeyActions.CloseWindow) != 0) {
CompletionWindowManager.HideWindow ();
+ OnWindowClosed (EventArgs.Empty);
+ }
+ }
+
+ /// <summary>
+ /// For unit test purposes.
+ /// </summary>
+ [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+ internal event EventHandler WindowClosed;
+
+ protected virtual void OnWindowClosed (EventArgs e)
+ {
+ var handler = WindowClosed;
+ if (handler != null)
+ handler (this, e);
}
public void ToggleCategoryMode ()
{
- List.InCategoryMode = !List.InCategoryMode;
+ IdeApp.Preferences.EnableCompletionCategoryMode.Set (!IdeApp.Preferences.EnableCompletionCategoryMode.Value);
+ List.UpdateCategoryMode ();
ResetSizes ();
List.QueueDraw ();
}
- public bool PreProcessKeyEvent (Gdk.Key key, char keyChar, Gdk.ModifierType modifier)
+ public bool PreProcessKeyEvent (KeyDescriptor descriptor)
{
- if (key == Gdk.Key.Escape) {
+ if (descriptor.SpecialKey == SpecialKey.Escape) {
CompletionWindowManager.HideWindow ();
return true;
}
KeyActions ka = KeyActions.None;
bool keyHandled = false;
- foreach (ICompletionKeyHandler handler in CompletionDataList.KeyHandler) {
- if (handler.PreProcessKey (this, key, keyChar, modifier, out ka)) {
- keyHandled = true;
- break;
+ if (CompletionDataList != null) {
+ foreach (ICompletionKeyHandler handler in CompletionDataList.KeyHandler) {
+ if (handler.PreProcessKey (facade, descriptor, out ka)) {
+ keyHandled = true;
+ break;
+ }
}
}
-
if (!keyHandled)
- ka = PreProcessKey (key, keyChar, modifier);
+ ka = PreProcessKey (descriptor);
if ((ka & KeyActions.Complete) != 0)
- CompleteWord (ref ka, key, keyChar, modifier);
+ CompleteWord (ref ka, descriptor);
- if ((ka & KeyActions.CloseWindow) != 0)
+ if ((ka & KeyActions.CloseWindow) != 0) {
CompletionWindowManager.HideWindow ();
+ OnWindowClosed (EventArgs.Empty);
+ }
if ((ka & KeyActions.Ignore) != 0)
return true;
-
if ((ka & KeyActions.Process) != 0) {
- if (key == Gdk.Key.Left || key == Gdk.Key.Right) {
+ if (descriptor.SpecialKey == SpecialKey.Left || descriptor.SpecialKey == SpecialKey.Right) {
// Close if there's a modifier active EXCEPT lock keys and Modifiers
// Makes an exception for Mod1Mask (usually alt), shift, control, meta and super
// This prevents the window from closing if the num/scroll/caps lock are active
@@ -252,19 +582,20 @@ namespace MonoDevelop.Ide.CodeCompletion
// if ((modifier & ~(Gdk.ModifierType.LockMask | (Gdk.ModifierType.ModifierMask & ~(Gdk.ModifierType.ShiftMask | Gdk.ModifierType.Mod1Mask | Gdk.ModifierType.ControlMask | Gdk.ModifierType.MetaMask | Gdk.ModifierType.SuperMask)))) != 0) {
// this version doesn't work for my system - seems that I've a modifier active
// that gdk doesn't know about. How about the 2nd version - should close on left/rigt + shift/mod1/control/meta/super
- if ((modifier & (Gdk.ModifierType.ShiftMask | Gdk.ModifierType.Mod1Mask | Gdk.ModifierType.ControlMask | Gdk.ModifierType.MetaMask | Gdk.ModifierType.SuperMask)) != 0) {
+ if ((descriptor.ModifierKeys & (ModifierKeys.Shift | ModifierKeys.Alt | ModifierKeys.Control | ModifierKeys.Command)) != 0) {
CompletionWindowManager.HideWindow ();
+ OnWindowClosed (EventArgs.Empty);
return false;
}
if (declarationviewwindow != null && declarationviewwindow.Multiple) {
- if (key == Gdk.Key.Left)
+ if (descriptor.SpecialKey == SpecialKey.Left)
declarationviewwindow.OverloadLeft ();
else
declarationviewwindow.OverloadRight ();
- UpdateDeclarationView ();
} else {
CompletionWindowManager.HideWindow ();
+ OnWindowClosed (EventArgs.Empty);
return false;
}
return true;
@@ -284,10 +615,14 @@ namespace MonoDevelop.Ide.CodeCompletion
internal bool ShowListWindow (char firstChar, ICompletionDataList list, ICompletionWidget completionWidget, CodeCompletionContext completionContext)
{
- if (list == null)
- throw new ArgumentNullException ("list");
- if (completionContext == null)
- throw new ArgumentNullException ("completionContext");
+ InitializeListWindow (completionWidget, completionContext);
+ return ShowListWindow (list, completionContext);
+ }
+
+ internal void InitializeListWindow (ICompletionWidget completionWidget, CodeCompletionContext completionContext)
+ {
+ if (completionWidget == null)
+ throw new ArgumentNullException ("completionWidget");
if (completionContext == null)
throw new ArgumentNullException ("completionContext");
if (mutableList != null) {
@@ -297,9 +632,22 @@ namespace MonoDevelop.Ide.CodeCompletion
}
ResetState ();
CompletionWidget = completionWidget;
- CompletionDataList = list;
+ CodeCompletionContext = completionContext;
+ string text = CompletionWidget.GetCompletionText (CodeCompletionContext);
+ initialWordLength = CompletionWidget.SelectedLength > 0 ? 0 : text.Length;
+ StartOffset = CompletionWidget.CaretOffset - initialWordLength;
+ }
+
+ internal bool ShowListWindow (ICompletionDataList list, CodeCompletionContext completionContext)
+ {
+ if (list == null)
+ throw new ArgumentNullException ("list");
+
CodeCompletionContext = completionContext;
+ CompletionDataList = list;
+ ResetState ();
+
mutableList = completionDataList as IMutableCompletionDataList;
PreviewCompletionString = completionDataList.CompletionSelectionMode == CompletionSelectionMode.OwnTextField;
@@ -310,19 +658,20 @@ namespace MonoDevelop.Ide.CodeCompletion
if (mutableList.IsChanging)
OnCompletionDataChanging (null, null);
}
+
if (FillList ()) {
AutoSelect = list.AutoSelect;
AutoCompleteEmptyMatch = list.AutoCompleteEmptyMatch;
AutoCompleteEmptyMatchOnCurlyBrace = list.AutoCompleteEmptyMatchOnCurlyBrace;
CloseOnSquareBrackets = list.CloseOnSquareBrackets;
// makes control-space in midle of words to work
- string text = completionWidget.GetCompletionText (completionContext);
+ string text = CompletionWidget.GetCompletionText (CodeCompletionContext);
DefaultCompletionString = completionDataList.DefaultCompletionString ?? "";
if (text.Length == 0) {
UpdateWordSelection ();
initialWordLength = 0;
//completionWidget.SelectedLength;
- StartOffset = completionWidget.CaretOffset;
+ StartOffset = CompletionWidget.CaretOffset;
ResetSizes ();
ShowAll ();
UpdateWordSelection ();
@@ -336,8 +685,8 @@ namespace MonoDevelop.Ide.CodeCompletion
return true;
}
- initialWordLength = completionWidget.SelectedLength > 0 ? 0 : text.Length;
- StartOffset = completionWidget.CaretOffset - initialWordLength;
+ initialWordLength = CompletionWidget.SelectedLength > 0 ? 0 : text.Length;
+ StartOffset = CompletionWidget.CaretOffset - initialWordLength;
HideWhenWordDeleted = initialWordLength != 0;
ResetSizes ();
UpdateWordSelection ();
@@ -355,9 +704,9 @@ namespace MonoDevelop.Ide.CodeCompletion
return false;
}
- class DataItemComparer : IComparer<ICompletionData>
+ class DataItemComparer : IComparer<CompletionData>
{
- public int Compare (ICompletionData a, ICompletionData b)
+ public int Compare (CompletionData a, CompletionData b)
{
if (a is IComparable && b is IComparable)
return ((IComparable)a).CompareTo (b);
@@ -365,7 +714,7 @@ namespace MonoDevelop.Ide.CodeCompletion
}
}
- IComparer<ICompletionData> GetComparerForCompletionList (ICompletionDataList dataList)
+ IComparer<CompletionData> GetComparerForCompletionList (ICompletionDataList dataList)
{
var concrete = dataList as CompletionDataList;
return concrete != null && concrete.Comparer != null ? concrete.Comparer : new DataItemComparer ();
@@ -375,13 +724,12 @@ namespace MonoDevelop.Ide.CodeCompletion
{
if ((completionDataList.Count == 0) && !IsChanging)
return false;
-
+
Style = CompletionWidget.GtkStyle;
//sort, sinking obsolete items to the bottoms
//the string comparison is ordinal as that makes it an order of magnitude faster, which
//which makes completion triggering noticeably more responsive
- var list = completionDataList as CompletionDataList;
if (!completionDataList.IsSorted)
completionDataList.Sort (GetComparerForCompletionList (completionDataList));
@@ -408,15 +756,15 @@ namespace MonoDevelop.Ide.CodeCompletion
return;
// Note: we add back the TextOffset here in case X and X+TextOffset are on different monitors.
- Gdk.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtPoint (X + TextOffset, Y));
+ Xwt.Rectangle geometry = DesktopService.GetUsableMonitorGeometry (Screen.Number, Screen.GetMonitorAtPoint (X + TextOffset, Y));
previousHeight = h;
previousWidth = w;
if (X + w > geometry.Right)
- X = geometry.Right - w;
+ X = (int)geometry.Right - w;
else if (X < geometry.Left)
- X = geometry.Left;
+ X = (int)geometry.Left;
if (Y + h > geometry.Bottom || yPosition == WindowPositonY.Top) {
// Put the completion-list window *above* the cursor
@@ -443,23 +791,40 @@ namespace MonoDevelop.Ide.CodeCompletion
public bool CompleteWord ()
{
KeyActions ka = KeyActions.None;
- return CompleteWord (ref ka, (Gdk.Key)0, '\0', Gdk.ModifierType.None);
+ return CompleteWord (ref ka, KeyDescriptor.Empty);
}
-
- public bool CompleteWord (ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
+
+ internal bool IsInCompletion { get; set; }
+
+ public bool CompleteWord (ref KeyActions ka, KeyDescriptor descriptor)
{
if (SelectedItem == -1 || completionDataList == null)
return false;
var item = completionDataList [SelectedItem];
if (item == null)
return false;
- // first close the completion list, then insert the text.
- // this is required because that's the logical event chain, otherwise things could be messed up
- CloseCompletionList ();
- ((CompletionData)item).InsertCompletionText (this, ref ka, closeChar, keyChar, modifier);
- AddWordToHistory (PartialWord, item.CompletionText);
- OnWordCompleted (new CodeCompletionContextEventArgs (CompletionWidget, CodeCompletionContext, item.CompletionText));
- return true;
+ IsInCompletion = true;
+ try {
+ // first close the completion list, then insert the text.
+ // this is required because that's the logical event chain, otherwise things could be messed up
+ CloseCompletionList ();
+ /* var cdItem = (CompletionData)item;
+ cdItem.InsertCompletionText (this, ref ka, closeChar, keyChar, modifier);
+ AddWordToHistory (PartialWord, cdItem.CompletionText);
+ OnWordCompleted (new CodeCompletionContextEventArgs (CompletionWidget, CodeCompletionContext, cdItem.CompletionText));
+ */
+ if (item.HasOverloads && declarationviewwindow.CurrentOverload >= 0 && declarationviewwindow.CurrentOverload < item.OverloadedData.Count) {
+ item.OverloadedData[declarationviewwindow.CurrentOverload].InsertCompletionText (facade, ref ka, descriptor);
+ } else {
+ item.InsertCompletionText (facade, ref ka, descriptor);
+ }
+ cache.CommitCompletionData (item);
+ OnWordCompleted (new CodeCompletionContextEventArgs (CompletionWidget, CodeCompletionContext, item.DisplayText));
+ } finally {
+ IsInCompletion = false;
+ CompletionWindowManager.HideWindow ();
+ }
+ return true;
}
protected virtual void OnWordCompleted (CodeCompletionContextEventArgs e)
@@ -479,6 +844,7 @@ namespace MonoDevelop.Ide.CodeCompletion
protected override void OnHidden ()
{
HideDeclarationView ();
+ ReleaseObjects ();
base.OnHidden ();
}
@@ -486,7 +852,6 @@ namespace MonoDevelop.Ide.CodeCompletion
{
Hide ();
HideDeclarationView ();
- ReleaseObjects ();
}
protected override void DoubleClick ()
@@ -534,6 +899,10 @@ namespace MonoDevelop.Ide.CodeCompletion
void HideDeclarationView ()
{
+ if (declarationViewCancelSource != null) {
+ declarationViewCancelSource.Cancel ();
+ declarationViewCancelSource = null;
+ }
RemoveDeclarationViewTimer ();
if (declarationviewwindow != null) {
declarationviewwindow.Hide ();
@@ -556,6 +925,8 @@ namespace MonoDevelop.Ide.CodeCompletion
} else {
declarationviewwindow.SetDefaultScheme ();
}
+ declarationviewwindow.CaretSpacing = Gui.Styles.TooltipInfoSpacing;
+ declarationviewwindow.Theme.SetBackgroundColor (Gui.Styles.CodeCompletion.BackgroundColor.ToCairoColor ());
}
void RepositionDeclarationViewWindow ()
@@ -576,33 +947,52 @@ namespace MonoDevelop.Ide.CodeCompletion
base.GdkWindow.GetOrigin (out ox, out oy);
declarationviewwindow.MaximumYTopBound = oy;
int y = rect.Y + Theme.Padding - (int)List.vadj.Value;
- declarationviewwindow.ShowPopup (this, new Gdk.Rectangle (Gui.Styles.TooltipInfoSpacing, Math.Min (Allocation.Height, Math.Max (0, y)), Allocation.Width, rect.Height), PopupPosition.Left);
+ declarationviewwindow.ShowPopup (this, new Gdk.Rectangle (0, Math.Min (Allocation.Height, Math.Max (0, y)), Allocation.Width, rect.Height), PopupPosition.Left);
declarationViewHidden = false;
}
-
+
bool DelayedTooltipShow ()
{
+ DelayedTooltipShowAsync ();
+ return false;
+ }
+
+ static readonly DataItemComparer overloadComparer = new DataItemComparer ();
+
+
+ async void DelayedTooltipShowAsync ()
+ {
var selectedItem = List.SelectedItem;
if (selectedItem < 0 || selectedItem >= completionDataList.Count)
- return false;
+ return;
+
var data = completionDataList [selectedItem];
- IEnumerable<ICompletionData> filteredOverloads;
+ IEnumerable<CompletionData> filteredOverloads;
if (data.HasOverloads) {
filteredOverloads = data.OverloadedData;
} else {
- filteredOverloads = new ICompletionData[] { data };
+ filteredOverloads = new CompletionData[] { data };
}
EnsureDeclarationViewWindow ();
if (data != currentData) {
declarationviewwindow.Clear ();
- var overloads = new List<ICompletionData> (filteredOverloads);
+ currentData = data;
+ var cs = new CancellationTokenSource ();
+ declarationViewCancelSource = cs;
+ var overloads = new List<CompletionData> (filteredOverloads);
+ overloads.Sort (overloadComparer);
foreach (var overload in overloads) {
- declarationviewwindow.AddOverload ((CompletionData)overload);
+ await declarationviewwindow.AddOverload ((CompletionData)overload, cs.Token);
}
+
+ if (cs.IsCancellationRequested)
+ return;
+
+ if (declarationViewCancelSource == cs)
+ declarationViewCancelSource = null;
- currentData = data;
if (data.HasOverloads) {
for (int i = 0; i < overloads.Count; i++) {
if (!overloads[i].DisplayFlags.HasFlag (DisplayFlags.Obsolete)) {
@@ -615,7 +1005,7 @@ namespace MonoDevelop.Ide.CodeCompletion
if (declarationviewwindow.Overloads == 0) {
HideDeclarationView ();
- return false;
+ return;
}
if (declarationViewHidden && Visible) {
@@ -623,10 +1013,9 @@ namespace MonoDevelop.Ide.CodeCompletion
}
declarationViewTimer = 0;
- return false;
}
- protected override void ResetState ()
+ protected internal override void ResetState ()
{
StartOffset = 0;
previousWidth = previousHeight = -1;
@@ -636,64 +1025,63 @@ namespace MonoDevelop.Ide.CodeCompletion
#region IListDataProvider
- int IListDataProvider.ItemCount
+ internal int ItemCount
{
- get { return completionDataList.Count; }
+ get { return completionDataList != null ? completionDataList.Count : 0; }
}
- CompletionCategory IListDataProvider.GetCompletionCategory (int n)
+ internal CompletionCategory GetCompletionCategory (int n)
{
return completionDataList[n].CompletionCategory;
}
- string IListDataProvider.GetText (int n)
+ internal string GetText (int n)
{
return completionDataList[n].DisplayText;
}
- string IListDataProvider.GetDescription (int n, bool isSelected)
+ internal string GetDescription (int n, bool isSelected)
{
return ((CompletionData)completionDataList[n]).GetDisplayDescription (isSelected);
}
- string IListDataProvider.GetRightSideDescription (int n, bool isSelected)
+ internal string GetRightSideDescription (int n, bool isSelected)
{
return ((CompletionData)completionDataList[n]).GetRightSideDescription (isSelected);
}
- bool IListDataProvider.HasMarkup (int n)
+ internal bool HasMarkup (int n)
{
- return (completionDataList [n].DisplayFlags & (DisplayFlags.Obsolete | DisplayFlags.MarkedBold)) != 0;
+ return true;
}
//NOTE: we only ever return markup for items marked as obsolete
- string IListDataProvider.GetMarkup (int n)
+ internal string GetMarkup (int n)
{
var completionData = completionDataList[n];
- if (!completionData.HasOverloads && (completionData.DisplayFlags & DisplayFlags.Obsolete) != 0 ||
- completionData.HasOverloads && completionData.OverloadedData.All (data => (data.DisplayFlags & DisplayFlags.Obsolete) != 0))
- return "<s>" + GLib.Markup.EscapeText (completionDataList[n].DisplayText) + "</s>";
-
- if ((completionData.DisplayFlags & DisplayFlags.MarkedBold) != 0)
- return "<b>" + GLib.Markup.EscapeText (completionDataList[n].DisplayText) + "</b>";
- return GLib.Markup.EscapeText (completionDataList[n].DisplayText);
+ return completionData.GetDisplayTextMarkup ();
}
- string IListDataProvider.GetCompletionText (int n)
+ internal string GetCompletionText (int n)
{
- return completionDataList[n].CompletionText;
+ return ((CompletionData)completionDataList[n]).CompletionText;
}
- IComparer<ICompletionData> defaultComparer;
+ internal CompletionData GetCompletionData (int n)
+ {
+ return completionDataList[n];
+ }
- int IListDataProvider.CompareTo (int n, int m)
+ IComparer<CompletionData> defaultComparer;
+
+ internal int CompareTo (int n, int m)
{
var item1 = completionDataList [n];
var item2 = completionDataList [m];
return (defaultComparer ?? (defaultComparer = GetComparerForCompletionList (completionDataList))).Compare (item1, item2);
}
- Xwt.Drawing.Image IListDataProvider.GetIcon (int n)
+ internal Xwt.Drawing.Image GetIcon (int n)
{
string iconName = ((CompletionData)completionDataList[n]).Icon;
if (string.IsNullOrEmpty (iconName))
@@ -714,7 +1102,7 @@ namespace MonoDevelop.Ide.CodeCompletion
box.PackStart (new HSeparator (), false, false, 0);
var hbox = new HBox ();
hbox.BorderWidth = 3;
- hbox.PackStart (new Image ("md-parser", IconSize.Menu), false, false, 0);
+ hbox.PackStart (new ImageView ("md-parser", IconSize.Menu), false, false, 0);
var lab = new Label (GettextCatalog.GetString ("Gathering class information..."));
lab.Xalign = 0;
hbox.PackStart (lab, true, true, 3);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionWindowManager.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionWindowManager.cs
index 80c7f67502..b693a28e9f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionWindowManager.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/CompletionWindowManager.cs
@@ -27,16 +27,18 @@
using System;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Ide.Editor.Extension;
namespace MonoDevelop.Ide.CodeCompletion
{
public class CompletionWindowManager
{
static CompletionListWindow wnd;
+ static bool isShowing;
public static bool IsVisible {
get {
- return wnd != null && wnd.Visible;
+ return isShowing || wnd != null && wnd.Visible;
}
}
@@ -62,65 +64,76 @@ namespace MonoDevelop.Ide.CodeCompletion
}
}
- static PropertyWrapper<bool> forceSuggestionMode = PropertyService.Wrap ("ForceCompletionSuggestionMode", false);
- public static bool ForceSuggestionMode {
- get { return forceSuggestionMode; }
- set {
- forceSuggestionMode.Value = value;
- if (wnd != null) {
- wnd.AutoCompleteEmptyMatch = wnd.AutoSelect = !forceSuggestionMode;
- }
- }
- }
-
static CompletionWindowManager ()
{
- if (IdeApp.Workbench != null)
+ if (IdeApp.Workbench != null) {
IdeApp.Workbench.RootWindow.Destroyed += (sender, e) => DestroyWindow ();
+ IdeApp.Workbench.RootWindow.WindowStateEvent += (o, args) => HideWindow ();
+ }
+
+ IdeApp.Preferences.ForceSuggestionMode.Changed += (s,a) => {
+ if (wnd != null)
+ wnd.AutoCompleteEmptyMatch = wnd.AutoSelect = !IdeApp.Preferences.ForceSuggestionMode;
+ };
}
-
+
// ext may be null, but then parameter completion don't work
- public static bool ShowWindow (CompletionTextEditorExtension ext, char firstChar, ICompletionDataList list, ICompletionWidget completionWidget, CodeCompletionContext completionContext)
+ internal static bool ShowWindow (CompletionTextEditorExtension ext, char firstChar, ICompletionDataList list, ICompletionWidget completionWidget, CodeCompletionContext completionContext)
{
- try {
- if (ext != null) {
- int inserted = ext.document.Editor.EnsureCaretIsNotVirtual ();
- if (inserted > 0)
- completionContext.TriggerOffset = ext.document.Editor.Caret.Offset;
- }
- if (wnd == null) {
- wnd = new CompletionListWindow ();
- wnd.WordCompleted += HandleWndWordCompleted;
- }
- if (ext != null) {
- wnd.TransientFor = ext.document.Editor.Parent.Toplevel as Gtk.Window;
- } else {
- var widget = completionWidget as Gtk.Widget;
- if (widget != null) {
- var window = widget.Toplevel as Gtk.Window;
- if (window != null)
- wnd.TransientFor = window;
- }
+ PrepareShowWindow (ext, firstChar, completionWidget, completionContext);
+ return ShowWindow (list, completionContext);
+ }
+
+ // ext may be null, but then parameter completion don't work
+ internal static void PrepareShowWindow (CompletionTextEditorExtension ext, char firstChar, ICompletionWidget completionWidget, CodeCompletionContext completionContext)
+ {
+ isShowing = true;
+
+ if (wnd == null) {
+ wnd = new CompletionListWindow ();
+ wnd.WordCompleted += HandleWndWordCompleted;
+ }
+ if (ext != null) {
+ var widget = ext.Editor.GetNativeWidget<Gtk.Widget> ();
+ wnd.TransientFor = widget?.Parent?.Toplevel as Gtk.Window;
+ } else {
+ var widget = completionWidget as Gtk.Widget;
+ if (widget != null) {
+ var window = widget.Toplevel as Gtk.Window;
+ if (window != null)
+ wnd.TransientFor = window;
}
- wnd.Extension = ext;
- try {
- if (!wnd.ShowListWindow (firstChar, list, completionWidget, completionContext)) {
- if (list is IDisposable)
- ((IDisposable)list).Dispose ();
- HideWindow ();
- return false;
- }
-
- if (ForceSuggestionMode)
- wnd.AutoSelect = false;
- wnd.Show ();
- DesktopService.RemoveWindowShadow (wnd);
- OnWindowShown (EventArgs.Empty);
- return true;
- } catch (Exception ex) {
- LoggingService.LogError (ex.ToString ());
+ }
+ wnd.Extension = ext;
+
+ wnd.InitializeListWindow (completionWidget, completionContext);
+ }
+
+ internal static bool ShowWindow (ICompletionDataList list, CodeCompletionContext completionContext)
+ {
+ if (wnd == null || !isShowing)
+ return false;
+
+ var completionWidget = wnd.CompletionWidget;
+ var ext = wnd.Extension;
+
+ try {
+ isShowing = false;
+ if (!wnd.ShowListWindow (list, completionContext)) {
+ if (list is IDisposable)
+ ((IDisposable)list).Dispose ();
+ HideWindow ();
return false;
}
+
+ if (IdeApp.Preferences.ForceSuggestionMode)
+ wnd.AutoSelect = false;
+ wnd.Show ();
+ OnWindowShown (EventArgs.Empty);
+ return true;
+ } catch (Exception ex) {
+ LoggingService.LogError ("Exception while showing completion window.", ex);
+ return false;
} finally {
ParameterInformationWindowManager.UpdateWindow (ext, completionWidget);
}
@@ -144,39 +157,41 @@ namespace MonoDevelop.Ide.CodeCompletion
OnWindowClosed (EventArgs.Empty);
}
- public static bool PreProcessKeyEvent (Gdk.Key key, char keyChar, Gdk.ModifierType modifier)
+ public static bool PreProcessKeyEvent (KeyDescriptor descriptor)
{
if (!IsVisible)
return false;
- if (keyChar != '\0') {
+ if (descriptor.KeyChar != '\0') {
wnd.EndOffset = wnd.StartOffset + wnd.CurrentPartialWord.Length + 1;
}
- return wnd.PreProcessKeyEvent (key, keyChar, modifier);
+ return wnd.PreProcessKeyEvent (descriptor);
}
public static void UpdateCursorPosition ()
{
if (!IsVisible)
return;
-
+ if (wnd.IsInCompletion || isShowing)
+ return;
var caretOffset = wnd.CompletionWidget.CaretOffset;
- if (caretOffset < wnd.StartOffset || caretOffset > wnd.EndOffset)
+ if (caretOffset < wnd.StartOffset || caretOffset > wnd.EndOffset) {
HideWindow ();
+ }
}
public static void UpdateWordSelection (string text)
{
if (IsVisible) {
- wnd.List.CompletionString = text;
+ wnd.CompletionString = text;
wnd.UpdateWordSelection ();
}
}
- public static void PostProcessKeyEvent (Gdk.Key key, char keyChar, Gdk.ModifierType modifier)
+ public static void PostProcessKeyEvent (KeyDescriptor descriptor)
{
if (!IsVisible)
return;
- wnd.PostProcessKeyEvent (key, keyChar, modifier);
+ wnd.PostProcessKeyEvent (descriptor);
}
public static void RepositionWindow ()
@@ -188,11 +203,12 @@ namespace MonoDevelop.Ide.CodeCompletion
public static void HideWindow ()
{
+ isShowing = false;
if (!IsVisible)
return;
+ if (wnd == null)
+ return;
ParameterInformationWindowManager.UpdateWindow (wnd.Extension, wnd.CompletionWidget);
- if (wnd.Extension != null)
- wnd.Extension.document.Editor.FixVirtualIndentation ();
wnd.HideWindow ();
OnWindowClosed (EventArgs.Empty);
//DestroyWindow ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/DisplayFlags.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/DisplayFlags.cs
new file mode 100644
index 0000000000..0450a0f7d2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/DisplayFlags.cs
@@ -0,0 +1,42 @@
+//
+// DisplayFlags.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+
+namespace MonoDevelop.Ide.CodeCompletion
+{
+ [Flags]
+ public enum DisplayFlags
+ {
+ None = 0,
+ Hidden = 1,
+ Obsolete = 2,
+ DescriptionHasMarkup = 4,
+ NamedArgument = 8,
+ IsImportCompletion = 16,
+ MarkedBold = 32
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ICompletionKeyHandler.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ICompletionKeyHandler.cs
new file mode 100644
index 0000000000..3aa7504dd7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ICompletionKeyHandler.cs
@@ -0,0 +1,55 @@
+//
+// ICompletionKeyHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis.Text;
+
+namespace MonoDevelop.Ide.CodeCompletion
+{
+ public interface ICompletionDataKeyHandler
+ {
+ /// <summary>
+ /// Returns true if the character typed should be used to filter the specified completion
+ /// item. A character will be checked to see if it should filter an item. If not, it will be
+ /// checked to see if it should commit that item. If it does neither, then completion will
+ /// be dismissed.
+ /// </summary>
+ bool IsFilterCharacter(CompletionData completionItem, char ch, string textTypedSoFar);
+
+ /// <summary>
+ /// Returns true if the character is one that can commit the specified completion item. A
+ /// character will be checked to see if it should filter an item. If not, it will be checked
+ /// to see if it should commit that item. If it does neither, then completion will be
+ /// dismissed.
+ /// </summary>
+ bool IsCommitCharacter(CompletionData completionItem, char ch, string textTypedSoFar);
+
+ /// <summary>
+ /// Returns true if the enter key that was typed should also be sent through to the editor
+ /// after committing the provided completion item.
+ /// </summary>
+ bool SendEnterThroughToEditor(CompletionData completionItem, string textTypedSoFar);
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ICompletionWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ICompletionWidget.cs
index 668359506a..29016d2924 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ICompletionWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ICompletionWidget.cs
@@ -28,32 +28,35 @@
using System;
using MonoDevelop.Projects;
using Gtk;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Ide.CodeCompletion
{
- public interface ICompletionWidget
+ interface ICompletionWidget
{
- CodeCompletionContext CurrentCodeCompletionContext {
+ CodeCompletionContext CurrentCodeCompletionContext
+ {
get;
}
- int CaretOffset { get;}
+ int CaretOffset { get; set; }
int TextLength { get; }
int SelectedLength { get; }
string GetText (int startOffset, int endOffset);
-
+
char GetChar (int offset);
-
+
void Replace (int offset, int count, string text);
-
+
Gtk.Style GtkStyle { get; }
+ double ZoomLevel { get; }
CodeCompletionContext CreateCodeCompletionContext (int triggerOffset);
string GetCompletionText (CodeCompletionContext ctx);
void SetCompletionText (CodeCompletionContext ctx, string partial_word, string complete_word);
-
+
void SetCompletionText (CodeCompletionContext ctx, string partial_word, string complete_word, int completeWordOffset);
-
+
event EventHandler CompletionContextChanged;
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs
index 0b607df034..54da3bad1f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWidget.cs
@@ -30,21 +30,25 @@ using System.Linq;
using Gdk;
using Gtk;
using Pango;
-using ICSharpCode.NRefactory.Completion;
-using Mono.TextEditor;
-using Mono.TextEditor.Highlighting;
using MonoDevelop.Components;
using MonoDevelop.Ide.Fonts;
-using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Ide.Editor;
+using System.ComponentModel.Design;
+using MonoDevelop.Ide.Editor.Highlighting;
+using MonoDevelop.Ide.Editor.Extension;
using MonoDevelop.Core;
+using Xwt.Drawing;
+using MonoDevelop.Ide.Gui;
namespace MonoDevelop.Ide.CodeCompletion
{
- public class ListWidget : Gtk.DrawingArea
+ class ListWidget : Gtk.DrawingArea
{
int listWidth = minSize;
- const int minSize = 300;
- const int maxListWidth = 600;
+ const int minSize = 400;
+ const int maxListWidth = 800;
+ const int rows = 13;
Pango.Layout layout, categoryLayout, noMatchLayout;
ListWindow win;
int selection = 0;
@@ -95,26 +99,25 @@ namespace MonoDevelop.Ide.CodeCompletion
public bool CloseOnSquareBrackets {
get;
set;
- }
-
- public readonly static PropertyWrapper<bool> EnableCompletionCategoryMode = PropertyService.Wrap("EnableCompletionCategoryMode", false);
-
+ }
+
public bool InCategoryMode {
- get { return EnableCompletionCategoryMode; }
- set {
- EnableCompletionCategoryMode.Set(value);
+ get { return IdeApp.Preferences.EnableCompletionCategoryMode && categories.Count > 1; }
+ }
- CalcVisibleRows ();
- if (value)
- SelectFirstItemInCategory ();
- }
+ internal void UpdateCategoryMode ()
+ {
+ CalcVisibleRows ();
+ if (InCategoryMode)
+ SelectFirstItemInCategory ();
}
+
public int CategoryCount {
get { return this.categories.Count; }
}
ICompletionWidget completionWidget;
- public ICompletionWidget CompletionWidget {
+ internal ICompletionWidget CompletionWidget {
get {
return completionWidget;
}
@@ -124,12 +127,7 @@ namespace MonoDevelop.Ide.CodeCompletion
}
}
- Cairo.Color backgroundColor;
- Cairo.Color selectionBorderColor, selectionBorderInactiveColor;
- ChunkStyle selectedItemColor, selectedItemInactiveColor;
- Cairo.Color textColor;
- Cairo.Color highlightColor;
- FontDescription itemFont;
+ FontDescription itemFont, noMatchFont, categoryFont;
const int marginIconSpacing = 4;
const int iconTextSpacing = 6;
@@ -139,16 +137,37 @@ namespace MonoDevelop.Ide.CodeCompletion
void SetFont ()
{
// TODO: Add font property to ICompletionWidget;
+
if (itemFont != null)
itemFont.Dispose ();
- itemFont = FontService.GetFontDescription ("Editor").Copy ();
- var provider = CompletionWidget as ITextEditorDataProvider;
- if (provider != null) {
- var newSize = (itemFont.Size * provider.GetTextEditorData ().Options.Zoom);
- if (newSize > 0) {
- itemFont.Size = (int)newSize;
- layout.FontDescription = itemFont;
- }
+
+ if (categoryFont != null)
+ categoryFont.Dispose ();
+
+ if (noMatchFont != null)
+ noMatchFont.Dispose ();
+
+ itemFont = FontService.MonospaceFont.Copy ();
+ categoryFont = FontService.SansFont.CopyModified (Styles.FontScale11);
+ noMatchFont = FontService.SansFont.CopyModified (Styles.FontScale11);
+
+ var newItemFontSize = itemFont.Size;
+ var newCategoryFontSize = categoryFont.Size;
+ var newNoMatchFontSize = noMatchFont.Size;
+
+ if (newItemFontSize > 0) {
+ itemFont.Size = (int)newItemFontSize;
+ layout.FontDescription = itemFont;
+ }
+
+ if (newCategoryFontSize > 0) {
+ categoryFont.Size = (int)newCategoryFontSize;
+ categoryLayout.FontDescription = categoryFont;
+ }
+
+ if (newNoMatchFontSize > 0) {
+ noMatchFont.Size = (int)newNoMatchFontSize;
+ noMatchLayout.FontDescription = noMatchFont;
}
}
@@ -161,16 +180,8 @@ namespace MonoDevelop.Ide.CodeCompletion
noMatchLayout = new Pango.Layout (this.PangoContext);
layout = new Pango.Layout (this.PangoContext);
layout.Wrap = Pango.WrapMode.Char;
- var style = SyntaxModeService.GetColorStyle (IdeApp.Preferences.ColorScheme);
+
SetFont ();
- textColor = style.CompletionText.Foreground;
-
- highlightColor = style.CompletionHighlight.Color;
- backgroundColor = style.CompletionText.Background;
- selectedItemColor = style.CompletionSelectedText;
- selectedItemInactiveColor = style.CompletionSelectedInactiveText;
- selectionBorderColor = style.CompletionBorder.Color;
- selectionBorderInactiveColor = style.CompletionInactiveBorder.Color;
this.Show ();
}
@@ -380,9 +391,17 @@ namespace MonoDevelop.Ide.CodeCompletion
public bool SelectionEnabled {
get {
- return AutoSelect && (AutoCompleteEmptyMatch || !string.IsNullOrEmpty (CompletionString));
+ return AutoSelect && (AutoCompleteEmptyMatch || !IsEmptyMatch (CompletionString));
}
}
+
+ static bool IsEmptyMatch (string completionString)
+ {
+ if (string.IsNullOrEmpty (completionString))
+ return true;
+ var ch = completionString [0];
+ return char.IsDigit (ch);
+ }
protected override bool OnButtonPressEvent (EventButton e)
{
@@ -414,7 +433,7 @@ namespace MonoDevelop.Ide.CodeCompletion
}
string NoMatchesMsg {
- get { return MonoDevelop.Core.GettextCatalog.GetString ("No Completions Found"); }
+ get { return MonoDevelop.Core.GettextCatalog.GetString ("No completions found"); }
}
string NoSuggestionsMsg {
@@ -424,17 +443,19 @@ namespace MonoDevelop.Ide.CodeCompletion
protected override bool OnExposeEvent (Gdk.EventExpose args)
{
using (var context = Gdk.CairoHelper.Create (args.Window)) {
+ var scalef = GtkWorkarounds.GetScaleFactor (this);
context.LineWidth = 1;
var alloc = Allocation;
int width = alloc.Width;
int height = alloc.Height;
context.Rectangle (args.Area.X, args.Area.Y, args.Area.Width, args.Area.Height);
+ var backgroundColor = Styles.CodeCompletion.BackgroundColor.ToCairoColor ();
+ var textColor = Styles.CodeCompletion.TextColor.ToCairoColor ();
+ var categoryColor = Styles.CodeCompletion.CategoryColor.ToCairoColor ();
context.SetSourceColor (backgroundColor);
context.Fill ();
-
int xpos = iconTextSpacing;
int yPos = (int)-vadj.Value;
-
//when there are no matches, display a message to indicate that the completion list is still handling input
if (filteredItems.Count == 0) {
context.Rectangle (0, yPos, width, height - yPos);
@@ -444,7 +465,7 @@ namespace MonoDevelop.Ide.CodeCompletion
int lWidth, lHeight;
noMatchLayout.GetPixelSize (out lWidth, out lHeight);
context.SetSourceColor (textColor);
- context.MoveTo ((width - lWidth) / 2, yPos + (height - lHeight - yPos) / 2 - lHeight);
+ context.MoveTo ((width - lWidth) / 2, yPos + (height - lHeight - yPos) / 2 - lHeight / 2);
Pango.CairoHelper.ShowLayout (context, noMatchLayout);
return false;
}
@@ -468,110 +489,131 @@ namespace MonoDevelop.Ide.CodeCompletion
context.Fill ();
-// layout.SetMarkup ("<span weight='bold' foreground='#AAAAAA'>" + (category.CompletionCategory != null ? category.CompletionCategory.DisplayText : "Uncategorized") + "</span>");
-// window.DrawLayout (textGCInsensitive, x - 1, ypos + 1 + (rowHeight - py) / 2, layout);
-// layout.SetMarkup ("<span weight='bold'>" + (category.CompletionCategory != null ? category.CompletionCategory.DisplayText : "Uncategorized") + "</span>");
+ // layout.SetMarkup ("<span weight='bold' foreground='#AAAAAA'>" + (category.CompletionCategory != null ? category.CompletionCategory.DisplayText : "Uncategorized") + "</span>");
+ // window.DrawLayout (textGCInsensitive, x - 1, ypos + 1 + (rowHeight - py) / 2, layout);
+ // layout.SetMarkup ("<span weight='bold'>" + (category.CompletionCategory != null ? category.CompletionCategory.DisplayText : "Uncategorized") + "</span>");
categoryLayout.SetMarkup ((category.CompletionCategory != null ? category.CompletionCategory.DisplayText : "Uncategorized"));
int px, py;
categoryLayout.GetPixelSize (out px, out py);
context.MoveTo (x, ypos + (rowHeight - py) / 2);
- context.SetSourceColor (textColor);
+ context.SetSourceColor (categoryColor);
Pango.CairoHelper.ShowLayout (context, categoryLayout);
}, delegate (Category curCategory, int item, int itemidx, int ypos) {
- if (ypos >= height)
- return false;
- if (ypos < -rowHeight)
- return true;
- const int categoryModeItemIndenting = 0;
- if (InCategoryMode && curCategory != null && curCategory.CompletionCategory != null) {
- xpos = iconTextSpacing + categoryModeItemIndenting;
- } else {
- xpos = iconTextSpacing;
- }
- string markup = win.DataProvider.HasMarkup (item) ? (win.DataProvider.GetMarkup (item) ?? "&lt;null&gt;") : GLib.Markup.EscapeText (win.DataProvider.GetText (item) ?? "<null>");
- string description = win.DataProvider.GetDescription (item, item == SelectedItem);
-
- if (string.IsNullOrEmpty (description)) {
- layout.SetMarkup (markup);
- } else {
- layout.SetMarkup (markup + " " + description);
- }
-
- string text = win.DataProvider.GetText (item);
-
- if (!string.IsNullOrEmpty (text)) {
- int[] matchIndices = matcher.GetMatch (text);
- if (matchIndices != null) {
- Pango.AttrList attrList = layout.Attributes ?? new Pango.AttrList ();
- for (int newSelection = 0; newSelection < matchIndices.Length; newSelection++) {
- int idx = matchIndices [newSelection];
- var fg = new AttrForeground ((ushort)(highlightColor.R * ushort.MaxValue), (ushort)(highlightColor.G * ushort.MaxValue), (ushort)(highlightColor.B * ushort.MaxValue));
+ if (ypos >= height)
+ return false;
+ if (ypos < -rowHeight)
+ return true;
+ const int categoryModeItemIndenting = 0;
+ if (InCategoryMode && curCategory != null && curCategory.CompletionCategory != null) {
+ xpos = iconTextSpacing + categoryModeItemIndenting;
+ } else {
+ xpos = iconTextSpacing;
+ }
+ string markup = win.DataProvider.HasMarkup (item) ? (win.DataProvider.GetMarkup (item) ?? "&lt;null&gt;") : GLib.Markup.EscapeText (win.DataProvider.GetText (item) ?? "<null>");
+ string description = win.DataProvider.GetDescription (item, item == SelectedItem);
+
+ if (string.IsNullOrEmpty (description)) {
+ layout.SetMarkup (markup);
+ } else {
+ layout.SetMarkup (markup + " " + description);
+ }
+
+ string text = win.DataProvider.GetText (item);
+
+ if (!string.IsNullOrEmpty (text)) {
+ int [] matchIndices = matcher.GetMatch (text);
+ if (matchIndices != null) {
+ Pango.AttrList attrList = layout.Attributes ?? new Pango.AttrList ();
+ for (int newSelection = 0; newSelection < matchIndices.Length; newSelection++) {
+ int idx = matchIndices [newSelection];
+ var bold = new AttrWeight (Weight.Bold);
+
+ bold.StartIndex = (uint)idx;
+ bold.EndIndex = (uint)(idx + 1);
+ attrList.Insert (bold);
+
+ if (item != SelectedItem) {
+ var highlightColor = (item == SelectedItem) ? Styles.CodeCompletion.SelectionHighlightColor : Styles.CodeCompletion.HighlightColor;
+ var fg = new AttrForeground ((ushort)(highlightColor.Red * ushort.MaxValue), (ushort)(highlightColor.Green * ushort.MaxValue), (ushort)(highlightColor.Blue * ushort.MaxValue));
fg.StartIndex = (uint)idx;
fg.EndIndex = (uint)(idx + 1);
attrList.Insert (fg);
}
- layout.Attributes = attrList;
}
+ layout.Attributes = attrList;
}
-
- Xwt.Drawing.Image icon = win.DataProvider.GetIcon (item);
- int iconHeight, iconWidth;
- if (icon != null) {
- iconWidth = (int)icon.Width;
- iconHeight = (int)icon.Height;
- } else if (!Gtk.Icon.SizeLookup (Gtk.IconSize.Menu, out iconWidth, out iconHeight)) {
- iconHeight = iconWidth = 24;
- }
-
- int wi, he, typos, iypos;
- layout.GetPixelSize (out wi, out he);
-
-
- typos = he < rowHeight ? ypos + (rowHeight - he) / 2 : ypos;
- iypos = iconHeight < rowHeight ? ypos + (rowHeight - iconHeight) / 2 : ypos;
- if (item == SelectedItem) {
- context.Rectangle (0, ypos, Allocation.Width, rowHeight / 2);
- context.SetSourceColor (SelectionEnabled ? selectedItemColor.Foreground : selectedItemInactiveColor.Background);
- context.Fill ();
- context.Rectangle (0, ypos + rowHeight / 2, Allocation.Width, rowHeight / 2);
- context.SetSourceColor (SelectionEnabled ? selectedItemColor.Background : selectedItemInactiveColor.Background);
- context.Fill ();
-
- context.Rectangle (0.5, ypos + 0.5, Allocation.Width - 1, rowHeight - 1);
- if (!SelectionEnabled)
- context.SetDash (new double[] {4, 4}, 0);
- context.SetSourceColor (SelectionEnabled ? selectionBorderColor : selectionBorderInactiveColor);
- context.Stroke ();
- }
-
- if (icon != null) {
- context.DrawImage (this, icon, xpos, iypos);
- xpos += iconTextSpacing;
- }
- context.SetSourceColor (textColor);
- var textXPos = xpos + iconWidth + 2;
- context.MoveTo (textXPos, typos);
- layout.Width = (int)((Allocation.Width - textXPos) * Pango.Scale.PangoScale);
- layout.Ellipsize = EllipsizeMode.End;
- Pango.CairoHelper.ShowLayout (context, layout);
- layout.Width = -1;
- layout.Ellipsize = EllipsizeMode.None;
-
- layout.SetMarkup ("");
- if (layout.Attributes != null) {
- layout.Attributes.Dispose ();
- layout.Attributes = null;
- }
+ }
+
+ Xwt.Drawing.Image icon = win.DataProvider.GetIcon (item);
+ int iconHeight, iconWidth;
+ if (icon != null) {
+ if (item == SelectedItem)
+ icon = icon.WithStyles ("sel");
+ iconWidth = (int)icon.Width;
+ iconHeight = (int)icon.Height;
+ } else if (!Gtk.Icon.SizeLookup (IconSize.Menu, out iconWidth, out iconHeight)) {
+ iconHeight = iconWidth = 24;
+ }
+
+ int wi, he, typos, iypos;
+ layout.GetPixelSize (out wi, out he);
+
+
+ typos = he < rowHeight ? ypos + (int)Math.Ceiling ((rowHeight - he) / 2.0) : ypos;
+ if (scalef <= 1.0)
+ typos -= 1; // 1px up on non HiDPI
+ iypos = iconHeight < rowHeight ? ypos + (rowHeight - iconHeight) / 2 : ypos;
+ if (item == SelectedItem) {
+ var barStyle = SelectionEnabled ? Styles.CodeCompletion.SelectionBackgroundColor : Styles.CodeCompletion.SelectionBackgroundInactiveColor;
+
+ context.Rectangle (0, ypos, Allocation.Width, rowHeight);
+ context.SetSourceColor (barStyle.ToCairoColor ());
+ context.Fill ();
+ }
+
+ if (icon != null) {
+ context.DrawImage (this, icon, xpos, iypos);
+ xpos += iconTextSpacing;
+ }
+ context.SetSourceColor ((item == SelectedItem ? Styles.CodeCompletion.SelectionTextColor : Styles.CodeCompletion.TextColor).ToCairoColor ());
+ var textXPos = xpos + iconWidth + 2;
+ context.MoveTo (textXPos, typos);
+ layout.Width = (int)((Allocation.Width - textXPos) * Pango.Scale.PangoScale);
+ layout.Ellipsize = EllipsizeMode.End;
+ Pango.CairoHelper.ShowLayout (context, layout);
+ int textW, textH;
+ layout.GetPixelSize (out textW, out textH);
+ layout.Width = -1;
+ layout.Ellipsize = EllipsizeMode.None;
+
+ layout.SetMarkup ("");
+ if (layout.Attributes != null) {
+ layout.Attributes.Dispose ();
+ layout.Attributes = null;
+ }
- string rightText = win.DataProvider.GetRightSideDescription (item, item == SelectedItem);
+ string rightText = win.DataProvider.GetRightSideDescription (item, item == SelectedItem);
if (!string.IsNullOrEmpty (rightText)) {
layout.SetMarkup (rightText);
+
int w, h;
layout.GetPixelSize (out w, out h);
+ const int leftpadding = 8;
+ const int rightpadding = 3;
+ w += rightpadding;
+ w = Math.Min (w, Allocation.Width - textXPos - textW - leftpadding);
wi += w;
typos = h < rowHeight ? ypos + (rowHeight - h) / 2 : ypos;
+ if (scalef <= 1.0)
+ typos -= 1; // 1px up on non HiDPI
context.MoveTo (Allocation.Width - w, typos);
+ layout.Width = (int)(w * Pango.Scale.PangoScale);
+ layout.Ellipsize = EllipsizeMode.End;
+
Pango.CairoHelper.ShowLayout (context, layout);
+ layout.Width = -1;
+ layout.Ellipsize = EllipsizeMode.None;
+
}
if (Math.Min (maxListWidth, wi + xpos + iconWidth + 2) > listWidth) {
@@ -619,15 +661,16 @@ namespace MonoDevelop.Ide.CodeCompletion
} else {
categories.Insert (0, result);
}
+
return result;
}
-
+
string oldCompletionString = null;
public void FilterWords ()
{
var newCategories = new List<Category> ();
var matcher = CompletionMatcher.CreateCompletionMatcher (CompletionString);
- if (oldCompletionString == null || !CompletionString.StartsWith (oldCompletionString)) {
+ if (oldCompletionString == null || !CompletionString.StartsWith (oldCompletionString, StringComparison.Ordinal)) {
filteredItems.Clear ();
for (int newSelection = 0; newSelection < win.DataProvider.ItemCount; newSelection++) {
if (string.IsNullOrEmpty (CompletionString) || matcher.IsMatch (win.DataProvider.GetText (newSelection))) {
@@ -647,16 +690,64 @@ namespace MonoDevelop.Ide.CodeCompletion
}
}
}
-
filteredItems.Sort (delegate (int left, int right) {
- return win.DataProvider.CompareTo (left, right);
+ int rank1, rank2;
+ var data1 = win.DataProvider.GetCompletionData (left);
+ var data2 = win.DataProvider.GetCompletionData (right);
+ if (data1 == null || data2 == null)
+ return 0;
+ if (data1.PriorityGroup != data2.PriorityGroup)
+ return data2.PriorityGroup.CompareTo (data1.PriorityGroup);
+ if (string.IsNullOrEmpty (CompletionString))
+ return win.DataProvider.CompareTo (left, right);
+
+ if (!matcher.CalcMatchRank (data1.CompletionText, out rank1))
+ return 0;
+ if (!matcher.CalcMatchRank (data2.CompletionText, out rank2))
+ return 0;
+
+ return rank2.CompareTo (rank1);
});
+
+ // put the item from a lower priority group with the highest match rank always to position #2
+ if (filteredItems.Count > 0) {
+ int idx = 0;
+ int rank;
+ var data = win.DataProvider.GetCompletionData (filteredItems [0]);
+ int firstGrp = data.PriorityGroup;
+ matcher.CalcMatchRank (data.CompletionText, out rank);
+ for (int i = 1; i < filteredItems.Count; i++) {
+ var curData = win.DataProvider.GetCompletionData (filteredItems [i]);
+ if (curData.PriorityGroup == firstGrp)
+ continue;
+ int curRank;
+ matcher.CalcMatchRank (curData.CompletionText, out curRank);
+ if (curRank > rank) {
+ idx = i;
+ rank = curRank;
+ }
+ }
+
+ if (idx != 0) {
+ var tmp = filteredItems [idx];
+ for (int i = idx; i > 1; i--) {
+ filteredItems [i] = filteredItems [i - 1];
+ }
+ filteredItems [1] = tmp;
+ }
+ }
+
newCategories.Sort (delegate (Category left, Category right) {
- return left.CompletionCategory != null ? left.CompletionCategory.CompareTo (right.CompletionCategory) : -1;
+ if (left.CompletionCategory == null)
+ return 1;
+ if (right.CompletionCategory == null)
+ return -1;
+
+ return left.CompletionCategory.CompareTo (right.CompletionCategory);
});
categories = newCategories;
- SelectFirstItemInCategory ();
+ //SelectFirstItemInCategory ();
CalcVisibleRows ();
SetAdjustments ();
@@ -666,7 +757,7 @@ namespace MonoDevelop.Ide.CodeCompletion
void SelectFirstItemInCategory ()
{
- if (string.IsNullOrEmpty (CompletionString) && EnableCompletionCategoryMode)
+ if (string.IsNullOrEmpty (CompletionString) && IdeApp.Preferences.EnableCompletionCategoryMode)
selection = categories.First ().Items.First ();
}
@@ -735,20 +826,18 @@ namespace MonoDevelop.Ide.CodeCompletion
void CalcVisibleRows ()
{
+ var icon = ImageService.GetIcon (TypeSystem.Stock.Namespace, IconSize.Menu);
+ rowHeight = Math.Max (1, (int)icon.Height + 2);
- int rowWidth;
- layout.SetText ("F_B");
- layout.GetPixelSize (out rowWidth, out rowHeight);
- rowHeight = Math.Max (1, rowHeight * 3 / 2);
-
- int newHeight = rowHeight * CompletionTextEditorExtension.CompletionListRows;
+ int newHeight = rowHeight * rows;
if (Allocation.Width != listWidth || Allocation.Height != newHeight)
this.SetSizeRequest (listWidth, newHeight);
SetAdjustments ();
}
const int spacing = 2;
-
+ ColorScheme ColorScheme => SyntaxModeService.GetColorStyle (IdeApp.Preferences.ColorScheme);
+
delegate void CategoryAction (Category category, int yPos);
delegate bool ItemAction (Category curCategory, int item, int itemIndex, int yPos);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWindow.cs
index 97f12ae487..de0d57bb5e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ListWindow.cs
@@ -25,21 +25,17 @@
//
//
-using Gtk;
-using Gdk;
-using Pango;
using System;
-using System.Xml;
-using System.Linq;
-using System.Text;
using System.Collections.Generic;
using MonoDevelop.Core.Text;
-using ICSharpCode.NRefactory.Completion;
-using Mono.TextEditor;
using MonoDevelop.Ide.Gui.Content;
+using System.Linq;
+using Gdk;
+using Gtk;
using MonoDevelop.Components;
-using Mono.TextEditor.Highlighting;
-using MonoDevelop.Core;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Highlighting;
+using MonoDevelop.Ide.Editor.Extension;
namespace MonoDevelop.Ide.CodeCompletion
{
@@ -53,14 +49,16 @@ namespace MonoDevelop.Ide.CodeCompletion
Complete = 8
}
- public class ListWindow : PopoverWindow
+ class ListWindow : PopoverWindow
{
- const int WindowWidth = 300;
+ const int WindowWidth = 400;
ListWidget list;
Widget footer;
protected VBox vbox;
-
+ internal MruCache cache = new MruCache();
+ protected ICompletionDataList completionDataList;
+
public CompletionTextEditorExtension Extension {
get;
set;
@@ -91,18 +89,44 @@ namespace MonoDevelop.Ide.CodeCompletion
list.ScrollEvent += new ScrollEventHandler (OnScrolled);
scrollbar = new MonoDevelop.Components.CompactScrolledWindow ();
+ scrollbar.Name = "CompletionScrolledWindow"; // use a different gtkrc style for GtkScrollBar
scrollbar.Child = list;
list.ButtonPressEvent += delegate(object o, ButtonPressEventArgs args) {
if (args.Event.Button == 1 && args.Event.Type == Gdk.EventType.TwoButtonPress)
DoubleClick ();
};
vbox.PackEnd (scrollbar, true, true, 0);
- ContentBox.Add (vbox);
+ var colorBox = new EventBox ();
+ colorBox.Add (vbox);
+ ContentBox.Add (colorBox);
this.AutoSelect = true;
this.TypeHint = WindowTypeHint.Menu;
- Theme.CornerRadius = 4;
- var style = SyntaxModeService.GetColorStyle (IdeApp.Preferences.ColorScheme);
- Theme.SetFlatColor (style.CompletionText.Background);
+ Theme.CornerRadius = 0;
+ Theme.Padding = 0;
+
+ UpdateStyle ();
+ Gui.Styles.Changed += HandleSkinChanged;
+ IdeApp.Preferences.ColorScheme.Changed += HandleSkinChanged;
+ }
+
+ void HandleSkinChanged (object sender, EventArgs e)
+ {
+ UpdateStyle ();
+ }
+
+ void UpdateStyle ()
+ {
+ Theme.SetBackgroundColor (Gui.Styles.CodeCompletion.BackgroundColor.ToCairoColor ());
+ Theme.ShadowColor = Gui.Styles.PopoverWindow.ShadowColor.ToCairoColor ();
+ ContentBox.Child.ModifyBg (StateType.Normal, Gui.Styles.CodeCompletion.BackgroundColor.ToGdkColor ());
+ list.ModifyBg (StateType.Normal, Gui.Styles.CodeCompletion.BackgroundColor.ToGdkColor ());
+ }
+
+ protected override void OnDestroyed ()
+ {
+ base.OnDestroyed ();
+ Gui.Styles.Changed -= HandleSkinChanged;
+ IdeApp.Preferences.ColorScheme.Changed -= HandleSkinChanged;
}
protected virtual void DoubleClick ()
@@ -129,7 +153,7 @@ namespace MonoDevelop.Ide.CodeCompletion
/// This method is used to set the completion window to it's inital state.
/// This is required for re-using the window object.
/// </summary>
- protected virtual void ResetState ()
+ protected internal virtual void ResetState ()
{
HideWhenWordDeleted = false;
lastCommitCharEndoffset = -1;
@@ -145,7 +169,6 @@ namespace MonoDevelop.Ide.CodeCompletion
var allocWidth = Allocation.Width;
if (IsRealized && !Visible) {
allocWidth = list.WidthRequest = WindowWidth;
- Show ();
}
int width = Math.Max (allocWidth, list.WidthRequest + Theme.CornerRadius * 2);
@@ -226,7 +249,7 @@ namespace MonoDevelop.Ide.CodeCompletion
set;
}
- public ICompletionWidget CompletionWidget {
+ internal ICompletionWidget CompletionWidget {
get {
return list.CompletionWidget;
}
@@ -253,7 +276,6 @@ namespace MonoDevelop.Ide.CodeCompletion
public bool IsUniqueMatch {
get {
- list.FilterWords ();
return list.filteredItems.Count == 1;
}
}
@@ -273,21 +295,22 @@ namespace MonoDevelop.Ide.CodeCompletion
private set;
}
- public KeyActions PostProcessKey (Gdk.Key key, char keyChar, Gdk.ModifierType modifier)
+ public KeyActions PostProcessKey (KeyDescriptor descriptor)
{
- if (StartOffset > CompletionWidget.CaretOffset)
+ if (CompletionWidget == null || StartOffset > CompletionWidget.CaretOffset) // CompletionWidget == null may happen in unit tests.
return KeyActions.CloseWindow | KeyActions.Process;
if (HideWhenWordDeleted && StartOffset >= CompletionWidget.CaretOffset)
return KeyActions.CloseWindow | KeyActions.Process;
- switch (key) {
- case Gdk.Key.BackSpace:
+ switch (descriptor.SpecialKey) {
+ case SpecialKey.BackSpace:
ResetSizes ();
UpdateWordSelection ();
return KeyActions.Process;
}
-
- const string commitChars = " <>()[]{}=+-*/%~&^|!.,;:";
+ var keyChar = descriptor.KeyChar;
+
+ const string commitChars = " <>()[]{}=+-*/%~&^|!.,;:?\"'";
if (keyChar == '[' && CloseOnSquareBrackets)
return KeyActions.Process | KeyActions.CloseWindow;
@@ -306,12 +329,12 @@ namespace MonoDevelop.Ide.CodeCompletion
if (!text.ToUpper ().StartsWith (curword.ToUpper (), StringComparison.Ordinal))
match = -1;
}
- if (match >= 0 && !hasMismatches && keyChar != '<') {
+ if (match >= 0 && !hasMismatches && keyChar != '<' && keyChar != ' ') {
ResetSizes ();
UpdateWordSelection ();
return KeyActions.Process;
}
- if (keyChar == '.')
+ if (keyChar == '.' && !list.AutoCompleteEmptyMatch && PartialWord == ".")
list.AutoSelect = list.AutoCompleteEmptyMatch = true;
lastCommitCharEndoffset = CompletionWidget.CaretOffset - 1;
@@ -322,30 +345,48 @@ namespace MonoDevelop.Ide.CodeCompletion
}
return KeyActions.CloseWindow | KeyActions.Process;
}
-
+
+ if (char.IsPunctuation (descriptor.KeyChar) && descriptor.KeyChar != '_') {
+ if (descriptor.KeyChar == ':') {
+ foreach (var item in FilteredItems) {
+ if (DataProvider.GetText (item).EndsWith (descriptor.KeyChar.ToString (), StringComparison.Ordinal)) {
+ list.SelectedItem = item;
+ return KeyActions.Complete | KeyActions.CloseWindow | KeyActions.Ignore;
+ }
+ }
+ } else {
+ var selectedItem = list.SelectedItem;
+ if (selectedItem < 0 || selectedItem >= DataProvider.ItemCount)
+ return KeyActions.CloseWindow;
+ var text = DataProvider.GetText (selectedItem);
+ if (!text.Substring (0, Math.Min (text.Length , CurrentPartialWord.Length)).EndsWith (descriptor.KeyChar.ToString (), StringComparison.Ordinal))
+ return KeyActions.Process | KeyActions.CloseWindow;
+ }
+ }
return KeyActions.Process;
}
- public KeyActions PreProcessKey (Gdk.Key key, char keyChar, Gdk.ModifierType modifier)
+ public KeyActions PreProcessKey (KeyDescriptor descriptor)
{
- switch (key) {
- case Gdk.Key.Home:
- if ((modifier & ModifierType.ShiftMask) == ModifierType.ShiftMask)
+ switch (descriptor.SpecialKey) {
+ case SpecialKey.Home:
+ if ((descriptor.ModifierKeys & ModifierKeys.Shift) == ModifierKeys.Shift)
return KeyActions.Process;
List.SelectionFilterIndex = 0;
return KeyActions.Ignore;
- case Gdk.Key.End:
- if ((modifier & ModifierType.ShiftMask) == ModifierType.ShiftMask)
+ case SpecialKey.End:
+ if ((descriptor.ModifierKeys & ModifierKeys.Shift) == ModifierKeys.Shift)
return KeyActions.Process;
List.SelectionFilterIndex = List.filteredItems.Count - 1;
return KeyActions.Ignore;
- case Gdk.Key.Up:
- if ((modifier & Gdk.ModifierType.ShiftMask) == Gdk.ModifierType.ShiftMask) {
+ case SpecialKey.Up:
+ if ((descriptor.ModifierKeys & ModifierKeys.Shift) == ModifierKeys.Shift) {
if (!SelectionEnabled /*&& !CompletionWindowManager.ForceSuggestionMode*/)
AutoCompleteEmptyMatch = AutoSelect = true;
if (!List.InCategoryMode) {
- List.InCategoryMode = true;
+ IdeApp.Preferences.EnableCompletionCategoryMode.Set (true);
+ List.UpdateCategoryMode ();
return KeyActions.Ignore;
}
List.MoveToCategory (-1);
@@ -360,25 +401,23 @@ namespace MonoDevelop.Ide.CodeCompletion
}
return KeyActions.Ignore;
- case Gdk.Key.Tab:
+ case SpecialKey.Tab:
//tab always completes current item even if selection is disabled
if (!AutoSelect)
AutoSelect = true;
- goto case Gdk.Key.Return;
+ goto case SpecialKey.Return;
- case Gdk.Key.Return:
- case Gdk.Key.ISO_Enter:
- case Gdk.Key.Key_3270_Enter:
- case Gdk.Key.KP_Enter:
+ case SpecialKey.Return:
lastCommitCharEndoffset = CompletionWidget.CaretOffset;
- WasShiftPressed = (modifier & ModifierType.ShiftMask) == ModifierType.ShiftMask;
+ WasShiftPressed = (descriptor.ModifierKeys & ModifierKeys.Shift) == ModifierKeys.Shift;
return KeyActions.Complete | KeyActions.Ignore | KeyActions.CloseWindow;
- case Gdk.Key.Down:
- if ((modifier & Gdk.ModifierType.ShiftMask) == Gdk.ModifierType.ShiftMask) {
+ case SpecialKey.Down:
+ if ((descriptor.ModifierKeys & ModifierKeys.Shift) == ModifierKeys.Shift) {
if (!SelectionEnabled /*&& !CompletionWindowManager.ForceSuggestionMode*/)
AutoCompleteEmptyMatch = AutoSelect = true;
if (!List.InCategoryMode) {
- List.InCategoryMode = true;
+ IdeApp.Preferences.EnableCompletionCategoryMode.Set (true);
+ List.UpdateCategoryMode ();
return KeyActions.Ignore;
}
List.MoveToCategory (1);
@@ -394,8 +433,8 @@ namespace MonoDevelop.Ide.CodeCompletion
}
return KeyActions.Ignore;
- case Gdk.Key.Page_Up:
- if ((modifier & ModifierType.ShiftMask) == ModifierType.ShiftMask)
+ case SpecialKey.PageUp:
+ if ((descriptor.ModifierKeys & ModifierKeys.Shift) == ModifierKeys.Shift)
return KeyActions.Process;
if (list.filteredItems.Count < 2)
return KeyActions.CloseWindow | KeyActions.Process;
@@ -403,8 +442,8 @@ namespace MonoDevelop.Ide.CodeCompletion
list.MoveCursor (-8);
return KeyActions.Ignore;
- case Gdk.Key.Page_Down:
- if ((modifier & ModifierType.ShiftMask) == ModifierType.ShiftMask)
+ case SpecialKey.PageDown:
+ if ((descriptor.ModifierKeys & ModifierKeys.Shift) == ModifierKeys.Shift)
return KeyActions.Process;
if (list.filteredItems.Count < 2)
return KeyActions.CloseWindow | KeyActions.Process;
@@ -412,42 +451,45 @@ namespace MonoDevelop.Ide.CodeCompletion
list.MoveCursor (8);
return KeyActions.Ignore;
- case Gdk.Key.Left:
+ case SpecialKey.Left:
//if (curPos == 0) return KeyActions.CloseWindow | KeyActions.Process;
//curPos--;
return KeyActions.Process;
- case Gdk.Key.Right:
+ case SpecialKey.Right:
//if (curPos == word.Length) return KeyActions.CloseWindow | KeyActions.Process;
//curPos++;
return KeyActions.Process;
- case Gdk.Key.Caps_Lock:
- case Gdk.Key.Num_Lock:
- case Gdk.Key.Scroll_Lock:
- return KeyActions.Ignore;
-
- case Gdk.Key.Control_L:
- case Gdk.Key.Control_R:
- case Gdk.Key.Alt_L:
- case Gdk.Key.Alt_R:
- case Gdk.Key.Shift_L:
- case Gdk.Key.Shift_R:
- case Gdk.Key.ISO_Level3_Shift:
- // AltGr
- return KeyActions.Process;
+// case Gdk.Key.Caps_Lock:
+// case Gdk.Key.Num_Lock:
+// case Gdk.Key.Scroll_Lock:
+// return KeyActions.Ignore;
+//
+// case Gdk.Key.Control_L:
+// case Gdk.Key.Control_R:
+// case Gdk.Key.Alt_L:
+// case Gdk.Key.Alt_R:
+// case Gdk.Key.Shift_L:
+// case Gdk.Key.Shift_R:
+// case Gdk.Key.ISO_Level3_Shift:
+// // AltGr
+// return KeyActions.Process;
}
- if (keyChar == '\0')
+ if (descriptor.KeyChar == '\0')
return KeyActions.Process;
- if (keyChar == ' ' && (modifier & ModifierType.ShiftMask) == ModifierType.ShiftMask)
+ if (descriptor.KeyChar == ' ' && (descriptor.ModifierKeys & ModifierKeys.Shift) == ModifierKeys.Shift)
return KeyActions.CloseWindow | KeyActions.Process;
+ if (char.IsDigit (descriptor.KeyChar) && string.IsNullOrEmpty (CurrentCompletionText))
+ return KeyActions.CloseWindow | KeyActions.Process;
+
// special case end with punctuation like 'param:' -> don't input double punctuation, otherwise we would end up with 'param::'
- if (char.IsPunctuation (keyChar) && keyChar != '_') {
- if (keyChar == ':') {
+ if (char.IsPunctuation (descriptor.KeyChar) && descriptor.KeyChar != '_') {
+ if (descriptor.KeyChar == ':') {
foreach (var item in FilteredItems) {
- if (DataProvider.GetText (item).EndsWith (keyChar.ToString (), StringComparison.Ordinal)) {
+ if (DataProvider.GetText (item).EndsWith (descriptor.KeyChar.ToString (), StringComparison.Ordinal)) {
list.SelectedItem = item;
return KeyActions.Complete | KeyActions.CloseWindow | KeyActions.Ignore;
}
@@ -456,14 +498,12 @@ namespace MonoDevelop.Ide.CodeCompletion
var selectedItem = list.SelectedItem;
if (selectedItem < 0 || selectedItem >= DataProvider.ItemCount)
return KeyActions.CloseWindow;
- if (DataProvider.GetText (selectedItem).EndsWith (keyChar.ToString (), StringComparison.Ordinal)) {
+ if (DataProvider.GetText (selectedItem).EndsWith (descriptor.KeyChar.ToString (), StringComparison.Ordinal)) {
return KeyActions.Complete | KeyActions.CloseWindow | KeyActions.Ignore;
}
}
}
-
-
/* //don't input letters/punctuation etc when non-shift modifiers are active
bool nonShiftModifierActive = ((Gdk.ModifierType.ControlMask | Gdk.ModifierType.MetaMask
| Gdk.ModifierType.Mod1Mask | Gdk.ModifierType.SuperMask)
@@ -544,45 +584,62 @@ namespace MonoDevelop.Ide.CodeCompletion
{
// default - word with highest match rating in the list.
hasMismatches = true;
- if (partialWord == null)
- return -1;
-
int idx = -1;
- var matcher = CompletionMatcher.CreateCompletionMatcher (partialWord);
- string bestWord = null;
- int bestRank = int.MinValue;
- int bestIndex = 0;
+
+ StringMatcher matcher = null;
if (!string.IsNullOrEmpty (partialWord)) {
+ matcher = CompletionMatcher.CreateCompletionMatcher (partialWord);
+ string bestWord = null;
+ int bestRank = int.MinValue;
+ int bestIndex = 0;
+ int bestIndexPriority = int.MinValue;
for (int i = 0; i < list.filteredItems.Count; i++) {
- int index = list.filteredItems[i];
- string text = DataProvider.GetText (index);
+ int index = list.filteredItems [i];
+ var data = DataProvider.GetCompletionData (index);
+ if (bestIndexPriority > data.PriorityGroup)
+ continue;
+ string text = data.DisplayText;
int rank;
if (!matcher.CalcMatchRank (text, out rank))
continue;
- if (rank > bestRank) {
+ if (rank > bestRank || data.PriorityGroup > bestIndexPriority) {
bestWord = text;
bestRank = rank;
bestIndex = i;
+ bestIndexPriority = data.PriorityGroup;
}
}
+
+ if (bestWord != null) {
+ idx = bestIndex;
+ hasMismatches = false;
+ // exact match found.
+ if (string.Compare (bestWord, partialWord ?? "", true) == 0)
+ return idx;
+ }
}
- if (bestWord != null) {
- idx = bestIndex;
- hasMismatches = false;
- // exact match found.
- if (string.Compare (bestWord, partialWord ?? "", true) == 0)
- return idx;
+
+ CompletionData currentData;
+ int bestMruIndex;
+ if (idx >= 0) {
+ currentData = completionDataList [list.filteredItems [idx]];
+ bestMruIndex = cache.GetIndex (currentData);
+ } else {
+ bestMruIndex = int.MaxValue;
+ currentData = null;
}
-
- if (string.IsNullOrEmpty (partialWord) || partialWord.Length <= 2) {
- // Search for history matches.
- string historyWord;
- if (wordHistory.TryGetValue (partialWord, out historyWord)) {
- for (int xIndex = 0; xIndex < list.filteredItems.Count; xIndex++) {
- string currentWord = DataProvider.GetCompletionText (list.filteredItems[xIndex]);
- if (currentWord == historyWord) {
- idx = xIndex;
- break;
+ for (int i = 0; i < list.filteredItems.Count; i++) {
+ var mruData = completionDataList [list.filteredItems [i]];
+ int curMruIndex = cache.GetIndex (mruData);
+ if (curMruIndex == 1)
+ continue;
+ if (curMruIndex < bestMruIndex) {
+ int r1 = 0, r2 = 0;
+ if (currentData == null || matcher != null && matcher.CalcMatchRank (mruData.DisplayText, out r1) && matcher.CalcMatchRank (currentData.DisplayText, out r2)) {
+ if (r1 >= r2 || PartialWord.Length == 0 || PartialWord.Length == 1 && mruData.DisplayText[0] == PartialWord[0]) {
+ bestMruIndex = curMruIndex;
+ idx = i;
+ currentData = mruData;
}
}
}
@@ -590,31 +647,6 @@ namespace MonoDevelop.Ide.CodeCompletion
return idx;
}
- static Dictionary<string,string> wordHistory = new Dictionary<string,string> ();
- static List<string> partalWordHistory = new List<string> ();
- const int maxHistoryLength = 500;
- protected void AddWordToHistory (string partialWord, string word)
- {
- if (!wordHistory.ContainsKey (partialWord)) {
- wordHistory.Add (partialWord, word);
- partalWordHistory.Add (partialWord);
- while (partalWordHistory.Count > maxHistoryLength) {
- string first = partalWordHistory [0];
- partalWordHistory.RemoveAt (0);
- wordHistory.Remove (first);
- }
- } else {
- partalWordHistory.Remove (partialWord);
- partalWordHistory.Add (partialWord);
- wordHistory [partialWord] = word;
- }
- }
- public static void ClearHistory ()
- {
- wordHistory.Clear ();
- partalWordHistory.Clear ();
- }
-
void SelectEntry (int n)
{
if (n >= 0)
@@ -698,6 +730,7 @@ namespace MonoDevelop.Ide.CodeCompletion
CompletionCategory GetCompletionCategory (int n);
bool HasMarkup (int n);
string GetCompletionText (int n);
+ CompletionData GetCompletionData (int n);
string GetDescription (int n, bool isSelected);
string GetRightSideDescription (int n, bool isSelected);
Xwt.Drawing.Image GetIcon (int n);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/MemberCompletionData.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/MemberCompletionData.cs
index f5c3cdc31e..1d33b4ee7b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/MemberCompletionData.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/MemberCompletionData.cs
@@ -25,7 +25,6 @@
// THE SOFTWARE.
using System;
-using ICSharpCode.NRefactory.TypeSystem;
namespace MonoDevelop.Ide.CodeCompletion
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/MruCache.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/MruCache.cs
new file mode 100644
index 0000000000..90e679af3f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/MruCache.cs
@@ -0,0 +1,67 @@
+//
+// MruCache.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Ide.CodeCompletion
+{
+ class MruCache
+ {
+ const int MaxItems = 42;
+
+ readonly List<string> lastItems = new List<string> (MaxItems);
+ readonly object mruLock = new object ();
+
+ public void CommitCompletionData (CompletionData item)
+ {
+ lock (mruLock) {
+ var removed = lastItems.Remove (item.DisplayText);
+ if (!removed && lastItems.Count == MaxItems)
+ lastItems.RemoveAt (0);
+
+ lastItems.Add (item.DisplayText);
+ }
+ }
+
+ /// <summary>
+ /// Lower is better. 1 == not in list.
+ /// </summary>
+ public int GetIndex (CompletionData item)
+ {
+ lock (mruLock) {
+ var index = lastItems.IndexOf (item.DisplayText);
+ return -index;
+ }
+ }
+
+ public void Clear ()
+ {
+ lock (mruLock) {
+ lastItems.Clear ();
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/MutableCompletionDataList.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/MutableCompletionDataList.cs
index 871134a1c8..69488e2d04 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/MutableCompletionDataList.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/MutableCompletionDataList.cs
@@ -61,32 +61,24 @@ namespace MonoDevelop.Ide.CodeCompletion
public event EventHandler Changing {
add {
- if (changing == null)
- TypeSystemService.ParseOperationStarted += HandleParseOperationStarted;
changing += value;
}
remove {
changing -= value;
- if (changing == null)
- TypeSystemService.ParseOperationStarted -= HandleParseOperationStarted;
}
}
public event EventHandler Changed {
add {
- if (changed == null)
- TypeSystemService.ParseOperationFinished += HandleParseOperationFinished;
changed += value;
}
remove {
changed -= value;
- if (changed == null)
- TypeSystemService.ParseOperationFinished -= HandleParseOperationFinished;
}
}
public bool IsChanging {
- get { return TypeSystemService.IsParsing; }
+ get { return false; }
}
protected virtual void OnChanging ()
@@ -117,10 +109,6 @@ namespace MonoDevelop.Ide.CodeCompletion
{
if (!disposed) {
disposed = true;
- if (changing != null)
- TypeSystemService.ParseOperationStarted -= HandleParseOperationStarted;
- if (changed != null)
- TypeSystemService.ParseOperationFinished -= HandleParseOperationFinished;
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterDataProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterDataProvider.cs
deleted file mode 100644
index 3d1b0811b9..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterDataProvider.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// ParameterDataProvider.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using ICSharpCode.NRefactory.Completion;
-
-namespace MonoDevelop.Ide.CodeCompletion
-{
- public abstract class ParameterDataProvider : IParameterDataProvider
- {
- public ParameterDataProvider (int startOffset)
- {
- this.startOffset = startOffset;
- }
-
- public virtual TooltipInformation CreateTooltipInformation (int overload, int currentParameter, bool smartWrap)
- {
- return new TooltipInformation ();
- }
-
- #region IParameterDataProvider implementation
-
- string IParameterDataProvider.GetHeading (int overload, string[] parameterDescription, int currentParameter)
- {
- throw new NotImplementedException ();
- }
-
- string IParameterDataProvider.GetDescription (int overload, int currentParameter)
- {
- throw new NotImplementedException ();
- }
-
- string IParameterDataProvider.GetParameterDescription (int overload, int paramIndex)
- {
- throw new NotImplementedException ();
- }
-
- public abstract int GetParameterCount (int overload);
- public abstract bool AllowParameterList (int overload);
- public abstract string GetParameterName (int overload, int paramIndex);
-
- public abstract int Count {
- get;
- }
-
- readonly int startOffset;
- public int StartOffset {
- get {
- return startOffset;
- }
- }
-
- #endregion
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterHintingData.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterHintingData.cs
new file mode 100644
index 0000000000..638f156bd1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterHintingData.cs
@@ -0,0 +1,67 @@
+//
+// ParameterDataProvider.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using ICSharpCode.NRefactory.Completion;
+using Microsoft.CodeAnalysis;
+using System.Collections.Immutable;
+using System.Linq;
+using System.Collections.Generic;
+using System.Threading;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.Projects;
+using MonoDevelop.Ide.Editor;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Ide.CodeCompletion
+{
+ public abstract class ParameterHintingData
+ {
+ public ISymbol Symbol {
+ get;
+ private set;
+ }
+
+ protected ParameterHintingData (ISymbol symbol)
+ {
+ Symbol = symbol;
+ }
+
+ public abstract int ParameterCount {
+ get;
+ }
+
+ public abstract bool IsParameterListAllowed {
+ get;
+ }
+
+ public abstract string GetParameterName (int parameter);
+
+ public virtual Task<TooltipInformation> CreateTooltipInformation (TextEditor editor, DocumentContext ctx, int currentParameter, bool smartWrap, CancellationToken cancelToken)
+ {
+ return Task.FromResult (new TooltipInformation ());
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterHintingResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterHintingResult.cs
new file mode 100644
index 0000000000..204056c52d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterHintingResult.cs
@@ -0,0 +1,114 @@
+//
+// ParameterHintingResult.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Ide.CodeCompletion
+{
+ public class ParameterHintingResult : IReadOnlyList<ParameterHintingData>
+ {
+ public static readonly ParameterHintingResult Empty = new ParameterHintingResult (new List<ParameterHintingData> (), -1);
+
+ protected readonly List<ParameterHintingData> data;
+ /// <summary>
+ /// Gets the start offset of the parameter expression node.
+ /// </summary>
+ public int StartOffset {
+ get;
+ private set;
+ }
+
+ protected ParameterHintingResult (int startOffset)
+ {
+ this.data = new List<ParameterHintingData> ();
+ this.StartOffset = startOffset;
+ }
+
+ public ParameterHintingResult (List<ParameterHintingData> data, int startOffset)
+ {
+ this.data = data;
+ this.StartOffset = startOffset;
+ }
+
+ public override int GetHashCode ()
+ {
+ return StartOffset ^ data.GetHashCode ();
+ }
+
+ public override bool Equals (object obj)
+ {
+ if (ReferenceEquals (this, obj))
+ return true;
+ var other = obj as ParameterHintingResult;
+ if (other == null)
+ return false;
+ foreach (var thisData in this.data) {
+ var found = false;
+ foreach (var otherData in other.data) {
+ if (thisData.Symbol.Equals (otherData.Symbol)) {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ return false;
+ }
+ return true;
+ }
+
+ #region IEnumerable implementation
+ public IEnumerator<ParameterHintingData> GetEnumerator ()
+ {
+ return data.GetEnumerator ();
+ }
+ #endregion
+
+ #region IEnumerable implementation
+ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator ()
+ {
+ return data.GetEnumerator ();
+ }
+ #endregion
+
+ #region IReadOnlyList implementation
+ public ParameterHintingData this [int index] {
+ get {
+ return data [index];
+ }
+ }
+ #endregion
+
+ #region IReadOnlyCollection implementation
+ public int Count {
+ get {
+ return data.Count;
+ }
+ }
+ #endregion
+ }
+
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindow.cs
index 14c2042e07..9a042f0066 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindow.cs
@@ -25,16 +25,18 @@
//
//
-
using System;
-using System.Text;
using MonoDevelop.Core;
using Gtk;
using MonoDevelop.Components;
-using ICSharpCode.NRefactory.Completion;
using MonoDevelop.Ide.Gui.Content;
-using System.Collections.Generic;
using MonoDevelop.Ide.Fonts;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Highlighting;
+using MonoDevelop.Ide.Editor.Extension;
+using System.Threading.Tasks;
+using System.Threading;
+using MonoDevelop.Ide.Gui;
namespace MonoDevelop.Ide.CodeCompletion
{
@@ -74,12 +76,10 @@ namespace MonoDevelop.Ide.CodeCompletion
this.AllowGrow = false;
this.CanFocus = false;
this.CanDefault = false;
- Mono.TextEditor.PopupWindow.WindowTransparencyDecorator.Attach (this);
+ WindowTransparencyDecorator.Attach (this);
headlabel = new MonoDevelop.Components.FixedWidthWrapLabel ();
headlabel.Indent = -20;
-
- headlabel.FontDescription = FontService.GetFontDescription ("Editor").CopyModified (1.1);
headlabel.Wrap = Pango.WrapMode.WordChar;
headlabel.BreakOnCamelCasing = false;
@@ -92,58 +92,125 @@ namespace MonoDevelop.Ide.CodeCompletion
HBox hb = new HBox (false, 0);
hb.PackStart (vb, true, true, 0);
-
vb2.Spacing = 4;
vb2.PackStart (hb, true, true, 0);
ContentBox.Add (vb2);
- var scheme = Mono.TextEditor.Highlighting.SyntaxModeService.GetColorStyle (IdeApp.Preferences.ColorScheme);
- Theme.SetSchemeColors (scheme);
- foreColor = scheme.PlainText.Foreground;
- headlabel.ModifyFg (StateType.Normal, foreColor.ToGdkColor ());
+ UpdateStyle ();
+ Styles.Changed += HandleSkinChanged;
+ IdeApp.Preferences.ColorScheme.Changed += HandleSkinChanged;
+
ShowAll ();
DesktopService.RemoveWindowShadow (this);
+ }
+
+ void UpdateStyle ()
+ {
+ var scheme = SyntaxModeService.GetColorStyle (IdeApp.Preferences.ColorScheme);
+ if (!scheme.FitsIdeSkin (IdeApp.Preferences.UserInterfaceSkin))
+ scheme = SyntaxModeService.GetDefaultColorStyle (IdeApp.Preferences.UserInterfaceSkin);
+
+ Theme.SetSchemeColors (scheme);
+ Theme.Font = FontService.SansFont.CopyModified (Styles.FontScale11);
+ Theme.ShadowColor = Styles.PopoverWindow.ShadowColor.ToCairoColor ();
+ foreColor = Styles.PopoverWindow.DefaultTextColor.ToCairoColor ();
+
+ headlabel.ModifyFg (StateType.Normal, foreColor.ToGdkColor ());
+ headlabel.FontDescription = FontService.GetFontDescription ("Editor").CopyModified (Styles.FontScale11);
+ if (this.Visible)
+ QueueDraw ();
+ }
+
+ void HandleSkinChanged (object sender, EventArgs e)
+ {
+ UpdateStyle ();
+ }
+
+ protected override void OnDestroyed ()
+ {
+ base.OnDestroyed ();
+ Styles.Changed -= HandleSkinChanged;
+ IdeApp.Preferences.ColorScheme.Changed -= HandleSkinChanged;
}
int lastParam = -2;
- public void ShowParameterInfo (ParameterDataProvider provider, int overload, int _currentParam, int maxSize)
+ TooltipInformation currentTooltipInformation;
+ ParameterHintingResult lastProvider;
+ CancellationTokenSource cancellationTokenSource;
+
+ public async void ShowParameterInfo (ParameterHintingResult provider, int overload, int _currentParam, int maxSize)
{
if (provider == null)
throw new ArgumentNullException ("provider");
- int numParams = System.Math.Max (0, provider.GetParameterCount (overload));
+ int numParams = System.Math.Max (0, provider [overload].ParameterCount);
var currentParam = System.Math.Min (_currentParam, numParams - 1);
if (numParams > 0 && currentParam < 0)
currentParam = 0;
- if (lastParam == currentParam) {
+ if (lastParam == currentParam && (currentTooltipInformation != null) && lastProvider == provider) {
return;
}
+ lastProvider = provider;
lastParam = currentParam;
+ var parameterHintingData = (ParameterHintingData)provider [overload];
+
+ ResetTooltipInformation ();
ClearDescriptions ();
- var o = provider.CreateTooltipInformation (overload, currentParam, false);
+ if (ext == null) {
+ // ext == null means HideParameterInfo was called aka. we are not in valid context to display tooltip anymore
+ lastParam = -2;
+ return;
+ }
+ var ct = new CancellationTokenSource ();
+ try {
+ cancellationTokenSource = ct;
+ currentTooltipInformation = await parameterHintingData.CreateTooltipInformation (ext.Editor, ext.DocumentContext, currentParam, false, ct.Token);
+ } catch (Exception ex) {
+ if (!(ex is TaskCanceledException))
+ LoggingService.LogError ("Error while getting tooltip information", ex);
+ return;
+ }
+
+ if (ct.IsCancellationRequested)
+ return;
+
+ cancellationTokenSource = null;
Theme.NumPages = provider.Count;
Theme.CurrentPage = overload;
+
if (provider.Count > 1) {
Theme.DrawPager = true;
Theme.PagerVertical = true;
}
- headlabel.Markup = o.SignatureMarkup;
+ ShowTooltipInfo ();
+ }
+
+ void ShowTooltipInfo ()
+ {
+ ClearDescriptions ();
+ headlabel.Markup = currentTooltipInformation.SignatureMarkup;
headlabel.Visible = true;
if (Theme.DrawPager)
headlabel.WidthRequest = headlabel.RealWidth + 70;
- foreach (var cat in o.Categories) {
- descriptionBox.PackStart (CreateCategory (cat.Item1, cat.Item2), true, true, 4);
+ foreach (var cat in currentTooltipInformation.Categories) {
+ descriptionBox.PackStart (CreateCategory (TooltipInformationWindow.GetHeaderMarkup (cat.Item1), cat.Item2), true, true, 4);
}
- if (!string.IsNullOrEmpty (o.SummaryMarkup)) {
- descriptionBox.PackStart (CreateCategory (GettextCatalog.GetString ("Summary"), o.SummaryMarkup), true, true, 4);
+ if (!string.IsNullOrEmpty (currentTooltipInformation.SummaryMarkup)) {
+ descriptionBox.PackStart (CreateCategory (TooltipInformationWindow.GetHeaderMarkup (GettextCatalog.GetString ("Summary")), currentTooltipInformation.SummaryMarkup), true, true, 4);
}
descriptionBox.ShowAll ();
QueueResize ();
+ Show ();
+ }
+
+ void CurrentTooltipInformation_Changed (object sender, EventArgs e)
+ {
+ ShowTooltipInfo ();
}
void ClearDescriptions ()
@@ -155,36 +222,38 @@ namespace MonoDevelop.Ide.CodeCompletion
}
}
+ void ResetTooltipInformation ()
+ {
+ if (cancellationTokenSource != null) {
+ cancellationTokenSource.Cancel ();
+ cancellationTokenSource = null;
+ }
+ currentTooltipInformation = null;
+ }
+
VBox CreateCategory (string categoryName, string categoryContentMarkup)
{
- var vbox = new VBox ();
-
- vbox.Spacing = 2;
-
- var catLabel = new MonoDevelop.Components.FixedWidthWrapLabel ();
- catLabel.Text = categoryName;
- catLabel.ModifyFg (StateType.Normal, foreColor.ToGdkColor ());
- catLabel.FontDescription = FontService.GetFontDescription ("Editor");
-
- vbox.PackStart (catLabel, false, true, 0);
-
- var contentLabel = new MonoDevelop.Components.FixedWidthWrapLabel ();
- contentLabel.MaxWidth = Math.Max (440, this.Allocation.Width);
- contentLabel.Wrap = Pango.WrapMode.WordChar;
- contentLabel.BreakOnCamelCasing = true;
- contentLabel.BreakOnPunctuation = true;
- contentLabel.Markup = categoryContentMarkup.Trim ();
- contentLabel.ModifyFg (StateType.Normal, foreColor.ToGdkColor ());
- contentLabel.FontDescription = FontService.GetFontDescription ("Editor");
-
- vbox.PackStart (contentLabel, true, true, 0);
-
- return vbox;
+ return TooltipInformationWindow.CreateCategory (categoryName, categoryContentMarkup, foreColor, Theme.Font);
}
public void ChangeOverload ()
{
lastParam = -2;
+ ResetTooltipInformation ();
+ }
+
+ protected override void OnPagerLeftClicked ()
+ {
+ if (Ext != null && Widget != null)
+ ParameterInformationWindowManager.OverloadUp (Ext, Widget);
+ base.OnPagerRightClicked ();
+ }
+
+ protected override void OnPagerRightClicked ()
+ {
+ if (Ext != null && Widget != null)
+ ParameterInformationWindowManager.OverloadDown (Ext, Widget);
+ base.OnPagerRightClicked ();
}
public void HideParameterInfo ()
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs
index 64c53b4f5f..3949b5b5a6 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/ParameterInformationWindowManager.cs
@@ -31,23 +31,26 @@ using System.Collections;
using System.Collections.Generic;
using Gtk;
using Gdk;
-using ICSharpCode.NRefactory.Completion;
using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Ide.Editor.Extension;
+using System.Threading;
namespace MonoDevelop.Ide.CodeCompletion
{
public class ParameterInformationWindowManager
{
- static List<MethodData> methods = new List<MethodData> ();
+ static MethodData currentMethodGroup;
+
static ParameterInformationWindow window;
public static bool IsWindowVisible {
- get { return methods.Count > 0; }
+ get { return currentMethodGroup != null; }
}
static ParameterInformationWindowManager ()
{
- IdeApp.Workbench.RootWindow.Destroyed += (sender, e) => DestroyWindow ();
+ if (IdeApp.Workbench != null)
+ IdeApp.Workbench.RootWindow.Destroyed += (sender, e) => DestroyWindow ();
}
static void DestroyWindow ()
@@ -60,76 +63,97 @@ namespace MonoDevelop.Ide.CodeCompletion
// Called when a key is pressed in the editor.
// Returns false if the key press has to continue normal processing.
- public static bool ProcessKeyEvent (CompletionTextEditorExtension ext, ICompletionWidget widget, Gdk.Key key, Gdk.ModifierType modifier)
+ internal static bool ProcessKeyEvent (CompletionTextEditorExtension ext, ICompletionWidget widget, KeyDescriptor descriptor)
{
- if (methods.Count == 0)
+ if (currentMethodGroup == null)
return false;
- MethodData cmd = methods [methods.Count - 1];
-
- if (key == Gdk.Key.Down) {
- if (cmd.MethodProvider.Count <= 1)
- return false;
- if (cmd.CurrentOverload < cmd.MethodProvider.Count - 1)
- cmd.CurrentOverload ++;
- else
- cmd.CurrentOverload = 0;
- window.ChangeOverload ();
- UpdateWindow (ext, widget);
- return true;
- } else if (key == Gdk.Key.Up) {
- if (cmd.MethodProvider.Count <= 1)
- return false;
- if (cmd.CurrentOverload > 0)
- cmd.CurrentOverload --;
- else
- cmd.CurrentOverload = cmd.MethodProvider.Count - 1;
- window.ChangeOverload ();
- UpdateWindow (ext, widget);
- return true;
+ if (descriptor.SpecialKey == SpecialKey.Down) {
+ return OverloadDown (ext, widget);
+ } else if (descriptor.SpecialKey == SpecialKey.Up) {
+ return OverloadUp (ext, widget);
}
- else if (key == Gdk.Key.Escape) {
+ else if (descriptor.SpecialKey == SpecialKey.Escape) {
HideWindow (ext, widget);
return true;
}
return false;
}
-
- public static void PostProcessKeyEvent (CompletionTextEditorExtension ext, ICompletionWidget widget, Gdk.Key key, Gdk.ModifierType modifier)
+
+ internal static bool OverloadDown (CompletionTextEditorExtension ext, ICompletionWidget widget)
{
+ if (currentMethodGroup == null)
+ return false;
+ if (currentMethodGroup.MethodProvider.Count <= 1)
+ return false;
+ if (currentMethodGroup.CurrentOverload < currentMethodGroup.MethodProvider.Count - 1)
+ currentMethodGroup.CurrentOverload ++;
+ else
+ currentMethodGroup.CurrentOverload = 0;
+ window.ChangeOverload ();
+ UpdateWindow (ext, widget);
+ return true;
}
- public static void UpdateCursorPosition (CompletionTextEditorExtension ext, ICompletionWidget widget)
- {
+ internal static bool OverloadUp (CompletionTextEditorExtension ext, ICompletionWidget widget)
+ {
+ if (currentMethodGroup == null)
+ return false;
+ if (currentMethodGroup.MethodProvider.Count <= 1)
+ return false;
+ if (currentMethodGroup.CurrentOverload > 0)
+ currentMethodGroup.CurrentOverload --;
+ else
+ currentMethodGroup.CurrentOverload = currentMethodGroup.MethodProvider.Count - 1;
+ window.ChangeOverload ();
+ UpdateWindow (ext, widget);
+ return true;
+ }
+
+ internal static void PostProcessKeyEvent (CompletionTextEditorExtension ext, ICompletionWidget widget, KeyDescriptor descriptor)
+ {
+ }
+
+ static CancellationTokenSource updateSrc = new CancellationTokenSource ();
+ internal static async void UpdateCursorPosition (CompletionTextEditorExtension ext, ICompletionWidget widget)
+ {
+ updateSrc.Cancel ();
+ updateSrc = new CancellationTokenSource ();
+ var token = updateSrc.Token;
// Called after the key has been processed by the editor
- if (methods.Count == 0)
+ if (currentMethodGroup == null)
return;
-
- for (int n=0; n< methods.Count; n++) {
- // If the cursor is outside of any of the methods parameter list, discard the
- // information window for that method.
-
- MethodData md = methods [n];
- int pos = ext.GetCurrentParameterIndex (md.MethodProvider.StartOffset);
- if (pos == -1) {
- methods.RemoveAt (n);
- n--;
+
+ var actualMethodGroup = new MethodData ();
+ actualMethodGroup.CompletionContext = widget.CurrentCodeCompletionContext;
+ actualMethodGroup.MethodProvider = await ext.ParameterCompletionCommand (widget.CurrentCodeCompletionContext);
+ if (actualMethodGroup.MethodProvider != null && (currentMethodGroup == null || !actualMethodGroup.MethodProvider.Equals (currentMethodGroup.MethodProvider)))
+ currentMethodGroup = actualMethodGroup;
+
+ int pos = await ext.GetCurrentParameterIndex (currentMethodGroup.MethodProvider.StartOffset, token);
+ if (pos == -1) {
+ if (actualMethodGroup.MethodProvider == null) {
+ currentMethodGroup = null;
+ } else {
+ pos = await ext.GetCurrentParameterIndex (actualMethodGroup.MethodProvider.StartOffset, token);
+ currentMethodGroup = pos >= 0 ? actualMethodGroup : null;
}
}
+
// If the user enters more parameters than the current overload has,
// look for another overload with more parameters.
- UpdateOverload (ext, widget);
+ UpdateOverload (ext, widget, token);
// Refresh.
UpdateWindow (ext, widget);
}
- public static void RepositionWindow (CompletionTextEditorExtension ext, ICompletionWidget widget)
+ internal static void RepositionWindow (CompletionTextEditorExtension ext, ICompletionWidget widget)
{
UpdateWindow (ext, widget);
}
- public static void ShowWindow (CompletionTextEditorExtension ext, ICompletionWidget widget, CodeCompletionContext ctx, ParameterDataProvider provider)
+ internal static void ShowWindow (CompletionTextEditorExtension ext, ICompletionWidget widget, CodeCompletionContext ctx, ParameterHintingResult provider)
{
if (provider.Count == 0)
return;
@@ -142,14 +166,14 @@ namespace MonoDevelop.Ide.CodeCompletion
md.MethodProvider = provider;
md.CurrentOverload = 0;
md.CompletionContext = ctx;
- methods.Add (md);
- UpdateOverload (ext, widget);
+ currentMethodGroup = md;
+ UpdateOverload (ext, widget, default (CancellationToken));
UpdateWindow (ext, widget);
}
- public static void HideWindow (CompletionTextEditorExtension ext, ICompletionWidget widget)
+ internal static void HideWindow (CompletionTextEditorExtension ext, ICompletionWidget widget)
{
- methods.Clear ();
+ currentMethodGroup = null;
if (window != null)
window.ChangeOverload ();
UpdateWindow (ext, widget);
@@ -157,30 +181,29 @@ namespace MonoDevelop.Ide.CodeCompletion
public static int GetCurrentOverload ()
{
- if (methods.Count == 0)
+ if (currentMethodGroup == null)
return -1;
- return methods [methods.Count - 1].CurrentOverload;
+ return currentMethodGroup.CurrentOverload;
}
- public static IParameterDataProvider GetCurrentProvider ()
+ public static ParameterHintingResult GetCurrentProvider ()
{
- if (methods.Count == 0)
+ if (currentMethodGroup == null)
return null;
- return methods [methods.Count - 1].MethodProvider;
+ return currentMethodGroup.MethodProvider;
}
- static void UpdateOverload (CompletionTextEditorExtension ext, ICompletionWidget widget)
+ static async void UpdateOverload (CompletionTextEditorExtension ext, ICompletionWidget widget, CancellationToken token)
{
- if (methods.Count == 0 || window == null)
+ if (currentMethodGroup == null || window == null)
return;
-
+
// If the user enters more parameters than the current overload has,
// look for another overload with more parameters.
- MethodData md = methods [methods.Count - 1];
- int bestOverload = ext.GuessBestMethodOverload (md.MethodProvider, md.CurrentOverload);
+ int bestOverload = await ext.GuessBestMethodOverload (currentMethodGroup.MethodProvider, currentMethodGroup.CurrentOverload, token);
if (bestOverload != -1) {
- md.CurrentOverload = bestOverload;
+ currentMethodGroup.CurrentOverload = bestOverload;
window.ChangeOverload ();
UpdateWindow (ext, widget);
}
@@ -192,11 +215,11 @@ namespace MonoDevelop.Ide.CodeCompletion
static bool wasVisi;
static int lastW = -1, lastH = -1;
- internal static void UpdateWindow (CompletionTextEditorExtension textEditorExtension, ICompletionWidget completionWidget)
+ internal static async void UpdateWindow (CompletionTextEditorExtension textEditorExtension, ICompletionWidget completionWidget)
{
// Updates the parameter information window from the information
// of the current method overload
- if (methods.Count > 0) {
+ if (currentMethodGroup != null) {
if (window == null) {
window = new ParameterInformationWindow ();
window.Ext = textEditorExtension;
@@ -215,15 +238,13 @@ namespace MonoDevelop.Ide.CodeCompletion
window.Widget = completionWidget;
}
wasAbove = false;
- var lastMethod = methods [methods.Count - 1];
- int curParam = window.Ext != null ? window.Ext.GetCurrentParameterIndex (lastMethod.MethodProvider.StartOffset) : 0;
- var geometry2 = DesktopService.GetUsableMonitorGeometry (window.Screen, window.Screen.GetMonitorAtPoint (X, Y));
- window.ShowParameterInfo (lastMethod.MethodProvider, lastMethod.CurrentOverload, curParam - 1, geometry2.Width);
+ int curParam = window.Ext != null ? await window.Ext.GetCurrentParameterIndex (currentMethodGroup.MethodProvider.StartOffset) : 0;
+ var geometry2 = DesktopService.GetUsableMonitorGeometry (window.Screen.Number, window.Screen.GetMonitorAtPoint (X, Y));
+ window.ShowParameterInfo (currentMethodGroup.MethodProvider, currentMethodGroup.CurrentOverload, curParam - 1, (int)geometry2.Width);
PositionParameterInfoWindow (window.Allocation);
- window.Show ();
}
- if (methods.Count == 0) {
+ if (currentMethodGroup == null) {
if (window != null) {
window.HideParameterInfo ();
// DestroyWindow ();
@@ -237,16 +258,15 @@ namespace MonoDevelop.Ide.CodeCompletion
}
- static void PositionParameterInfoWindow (Rectangle allocation)
+ static async void PositionParameterInfoWindow (Rectangle allocation)
{
lastW = allocation.Width;
lastH = allocation.Height;
wasVisi = CompletionWindowManager.IsVisible;
var ctx = window.Widget.CurrentCodeCompletionContext;
- var md = methods [methods.Count - 1];
- int cparam = window.Ext != null ? window.Ext.GetCurrentParameterIndex (md.MethodProvider.StartOffset) : 0;
+ int cparam = window.Ext != null ? await window.Ext.GetCurrentParameterIndex (currentMethodGroup.MethodProvider.StartOffset) : 0;
- X = md.CompletionContext.TriggerXCoord;
+ X = currentMethodGroup.CompletionContext.TriggerXCoord;
if (CompletionWindowManager.IsVisible) {
// place above
Y = ctx.TriggerYCoord - ctx.TriggerTextHeight - allocation.Height - 10;
@@ -255,12 +275,12 @@ namespace MonoDevelop.Ide.CodeCompletion
Y = ctx.TriggerYCoord;
}
- var geometry = DesktopService.GetUsableMonitorGeometry (window.Screen, window.Screen.GetMonitorAtPoint (X, Y));
+ var geometry = DesktopService.GetUsableMonitorGeometry (window.Screen.Number, window.Screen.GetMonitorAtPoint (X, Y));
- window.ShowParameterInfo (md.MethodProvider, md.CurrentOverload, cparam - 1, geometry.Width);
+ window.ShowParameterInfo (currentMethodGroup.MethodProvider, currentMethodGroup.CurrentOverload, cparam - 1, (int)geometry.Width);
if (X + allocation.Width > geometry.Right)
- X = geometry.Right - allocation.Width;
+ X = (int)geometry.Right - allocation.Width;
if (Y < geometry.Top)
Y = ctx.TriggerYCoord;
if (wasAbove || Y + allocation.Height > geometry.Bottom) {
@@ -269,12 +289,12 @@ namespace MonoDevelop.Ide.CodeCompletion
}
if (CompletionWindowManager.IsVisible) {
- var completionWindow = new Rectangle (CompletionWindowManager.X, CompletionWindowManager.Y, CompletionWindowManager.Wnd.Allocation.Width, CompletionWindowManager.Wnd.Allocation.Height);
- if (completionWindow.IntersectsWith (new Rectangle (X, Y, allocation.Width, allocation.Height))) {
- X = completionWindow.X;
- Y = completionWindow.Y - allocation.Height - 6;
+ var completionWindow = new Xwt.Rectangle (CompletionWindowManager.X, CompletionWindowManager.Y, CompletionWindowManager.Wnd.Allocation.Width, CompletionWindowManager.Wnd.Allocation.Height);
+ if (completionWindow.IntersectsWith (new Xwt.Rectangle (X, Y, allocation.Width, allocation.Height))) {
+ X = (int) completionWindow.X;
+ Y = (int)completionWindow.Y - allocation.Height - 6;
if (Y < 0)
- Y = completionWindow.Bottom + 6;
+ Y = (int)completionWindow.Bottom + 6;
}
}
@@ -284,7 +304,7 @@ namespace MonoDevelop.Ide.CodeCompletion
class MethodData
{
- public ParameterDataProvider MethodProvider;
+ public ParameterHintingResult MethodProvider;
public CodeCompletionContext CompletionContext;
int currentOverload;
public int CurrentOverload {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs
index d9847fb2b9..0891cae652 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/TooltipInformationWindow.cs
@@ -29,8 +29,12 @@ using MonoDevelop.Components;
using System.Collections.Generic;
using MonoDevelop.Core;
using MonoDevelop.Ide.Fonts;
+using MonoDevelop.Ide.Gui;
using System.Linq;
-using Mono.TextEditor.PopupWindow;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Highlighting;
+using System.Threading.Tasks;
+using System.Threading;
namespace MonoDevelop.Ide.CodeCompletion
{
@@ -77,22 +81,28 @@ namespace MonoDevelop.Ide.CodeCompletion
ShowOverload ();
}
- public void AddOverload (CompletionData data)
+ public async Task AddOverload (CompletionData data, CancellationToken cancelToken)
{
- var tooltipInformation = data.CreateTooltipInformation (false);
- if (tooltipInformation.IsEmpty)
- return;
-
- using (var layout = new Pango.Layout (PangoContext)) {
- layout.FontDescription = FontService.GetFontDescription ("Editor");
- layout.SetMarkup (tooltipInformation.SignatureMarkup);
- int w, h;
- layout.GetPixelSize (out w, out h);
- if (w >= Allocation.Width - 10) {
- tooltipInformation = data.CreateTooltipInformation (true);
+ try {
+ var tooltipInformation = await data.CreateTooltipInformation (false, cancelToken);
+ if (tooltipInformation == null || tooltipInformation.IsEmpty || cancelToken.IsCancellationRequested)
+ return;
+
+ using (var layout = new Pango.Layout (PangoContext)) {
+ layout.FontDescription = Theme.Font;
+ layout.SetMarkup (tooltipInformation.SignatureMarkup);
+ int w, h;
+ layout.GetPixelSize (out w, out h);
+ if (w >= Allocation.Width - 10) {
+ tooltipInformation = await data.CreateTooltipInformation (true, cancelToken);
+ }
}
+ if (cancelToken.IsCancellationRequested)
+ return;
+ AddOverload (tooltipInformation);
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while adding overload : " + data, e);
}
- AddOverload (tooltipInformation);
}
protected override void OnSizeRequested (ref Requisition requisition)
@@ -112,8 +122,8 @@ namespace MonoDevelop.Ide.CodeCompletion
headLabel.Visible = !string.IsNullOrEmpty (o.SignatureMarkup);
int x, y;
GetPosition (out x, out y);
- var geometry = DesktopService.GetUsableMonitorGeometry (Screen, Screen.GetMonitorAtPoint (x, y));
- headLabel.MaxWidth = Math.Max (geometry.Width / 5, 480);
+ var geometry = DesktopService.GetUsableMonitorGeometry (Screen.Number, Screen.GetMonitorAtPoint (x, y));
+ headLabel.MaxWidth = Math.Max ((int)geometry.Width / 5, 480);
if (Theme.DrawPager && overloads.Count > 1) {
headLabel.WidthRequest = headLabel.RealWidth + 70;
@@ -121,11 +131,11 @@ namespace MonoDevelop.Ide.CodeCompletion
headLabel.WidthRequest = -1;
}
foreach (var cat in o.Categories) {
- descriptionBox.PackStart (CreateCategory (cat.Item1, cat.Item2), true, true, 4);
+ descriptionBox.PackStart (CreateCategory (GetHeaderMarkup (cat.Item1), cat.Item2, foreColor, Theme.Font), true, true, 4);
}
if (!string.IsNullOrEmpty (o.SummaryMarkup)) {
- descriptionBox.PackStart (CreateCategory (GettextCatalog.GetString ("Summary"), o.SummaryMarkup), true, true, 4);
+ descriptionBox.PackStart (CreateCategory (GetHeaderMarkup (GettextCatalog.GetString ("Summary")), o.SummaryMarkup, foreColor, Theme.Font), true, true, 4);
}
if (!string.IsNullOrEmpty (o.FooterMarkup)) {
@@ -136,7 +146,7 @@ namespace MonoDevelop.Ide.CodeCompletion
contentLabel.MaxWidth = 400;
contentLabel.Markup = o.FooterMarkup.Trim ();
contentLabel.ModifyFg (StateType.Normal, foreColor.ToGdkColor ());
- contentLabel.FontDescription = FontService.GetFontDescription ("Editor");
+ contentLabel.FontDescription = Theme.Font;
descriptionBox.PackEnd (contentLabel, true, true, 4);
}
@@ -147,10 +157,22 @@ namespace MonoDevelop.Ide.CodeCompletion
descriptionBox.ShowAll ();
}
Theme.CurrentPage = current_overload;
- QueueResize ();
+ // if the target is not on the left or top side, we may loose the arrow alignment on our target
+ // and must reposition
+ if (!CurrentPosition.HasFlag (PopupPosition.Left) &&
+ !CurrentPosition.HasFlag (PopupPosition.Top))
+ RepositionWindow ();
+ else
+ QueueResize ();
}
}
+ internal static string GetHeaderMarkup (string headerName)
+ {
+ return headerName;
+ // return "<span foreground=\"#a7a79c\" size=\"larger\">" + headerName + "</span>";
+ }
+
public void OverloadLeft ()
{
if (current_overload == 0) {
@@ -191,30 +213,39 @@ namespace MonoDevelop.Ide.CodeCompletion
current_overload = 0;
}
- VBox CreateCategory (string categoryName, string categoryContentMarkup)
+ internal static VBox CreateCategory (string categoryName, string categoryContentMarkup, Cairo.Color foreColor, Pango.FontDescription font)
{
var vbox = new VBox ();
- vbox.Spacing = 2;
+ vbox.Spacing = 8;
if (categoryName != null) {
var catLabel = new FixedWidthWrapLabel ();
- catLabel.Text = categoryName;
+ catLabel.Markup = categoryName;
catLabel.ModifyFg (StateType.Normal, foreColor.ToGdkColor ());
- catLabel.FontDescription = FontService.GetFontDescription ("Editor");
+ catLabel.FontDescription = font.Copy ();
+ catLabel.FontDescription.Weight = Pango.Weight.Bold;
+ catLabel.FontDescription.Size = catLabel.FontDescription.Size + (int)(1 * Pango.Scale.PangoScale);
vbox.PackStart (catLabel, false, true, 0);
}
var contentLabel = new FixedWidthWrapLabel ();
+ HBox hbox = new HBox ();
+
+ // hbox.PackStart (new Label(), false, true, 10);
+
+
contentLabel.Wrap = Pango.WrapMode.WordChar;
+ contentLabel.Spacing = 1;
contentLabel.BreakOnCamelCasing = false;
contentLabel.BreakOnPunctuation = false;
contentLabel.MaxWidth = 400;
contentLabel.Markup = categoryContentMarkup.Trim ();
contentLabel.ModifyFg (StateType.Normal, foreColor.ToGdkColor ());
- contentLabel.FontDescription = FontService.GetFontDescription ("Editor");
+ contentLabel.FontDescription = font;
- vbox.PackStart (contentLabel, true, true, 0);
+ hbox.PackStart (contentLabel, true, true, 0);
+ vbox.PackStart (hbox, true, true, 0);
return vbox;
}
@@ -225,10 +256,18 @@ namespace MonoDevelop.Ide.CodeCompletion
internal void SetDefaultScheme ()
{
- var scheme = Mono.TextEditor.Highlighting.SyntaxModeService.GetColorStyle (IdeApp.Preferences.ColorScheme);
+ var scheme = SyntaxModeService.GetColorStyle (IdeApp.Preferences.ColorScheme);
+ if (!scheme.FitsIdeSkin (IdeApp.Preferences.UserInterfaceSkin))
+ scheme = SyntaxModeService.GetDefaultColorStyle (IdeApp.Preferences.UserInterfaceSkin);
+
Theme.SetSchemeColors (scheme);
- foreColor = scheme.PlainText.Foreground;
+ foreColor = Styles.PopoverWindow.DefaultTextColor.ToCairoColor ();
headLabel.ModifyFg (StateType.Normal, foreColor.ToGdkColor ());
+ headLabel.FontDescription = FontService.GetFontDescription ("Editor").CopyModified (Styles.FontScale11);
+ Theme.Font = FontService.SansFont.CopyModified (Styles.FontScale11);
+ Theme.ShadowColor = Styles.PopoverWindow.ShadowColor.ToCairoColor ();
+ if (this.Visible)
+ ShowOverload ();
}
public TooltipInformationWindow () : base ()
@@ -244,7 +283,6 @@ namespace MonoDevelop.Ide.CodeCompletion
headLabel = new FixedWidthWrapLabel ();
headLabel.Indent = -20;
- headLabel.FontDescription = FontService.GetFontDescription ("Editor").CopyModified (1.1);
headLabel.Wrap = Pango.WrapMode.WordChar;
headLabel.BreakOnCamelCasing = false;
headLabel.BreakOnPunctuation = false;
@@ -264,10 +302,45 @@ namespace MonoDevelop.Ide.CodeCompletion
vb2.PackStart (hb, true, true, 0);
ContentBox.Add (vb2);
+ vb2.ShowAll ();
SetDefaultScheme ();
+ Styles.Changed += HandleSkinChanged;
+ IdeApp.Preferences.ColorScheme.Changed += HandleSkinChanged;
+ }
- ShowAll ();
- DesktopService.RemoveWindowShadow (this);
+ public override void RepositionWindow(Gdk.Rectangle? newCaret = null)
+ {
+ // Setting the opicity delayed to 1 is a hack to ensure smooth animation popup see "Bug 32046 - Janky animations on tooltips"
+ Opacity = 0;
+ base.RepositionWindow(newCaret);
+ GLib.Timeout.Add (50, delegate {
+ Opacity = 1;
+ return false;
+ });
+ }
+
+ protected override void OnPagerLeftClicked ()
+ {
+ OverloadLeft ();
+ base.OnPagerLeftClicked ();
+ }
+
+ protected override void OnPagerRightClicked ()
+ {
+ OverloadRight ();
+ base.OnPagerRightClicked ();
+ }
+
+ void HandleSkinChanged (object sender, EventArgs e)
+ {
+ SetDefaultScheme ();
+ }
+
+ protected override void OnDestroyed ()
+ {
+ base.OnDestroyed ();
+ Styles.Changed -= HandleSkinChanged;
+ IdeApp.Preferences.ColorScheme.Changed -= HandleSkinChanged;
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/AbstractCodeFormatter.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/AbstractCodeFormatter.cs
new file mode 100644
index 0000000000..a8018e1551
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/AbstractCodeFormatter.cs
@@ -0,0 +1,120 @@
+//
+// CodeFormatter.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Projects.Policies;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.Ide.CodeFormatting
+{
+ public abstract class AbstractCodeFormatter
+ {
+ protected abstract ITextSource FormatImplementation (PolicyContainer policyParent, string mimeType, ITextSource input, int startOffset, int length);
+
+ public ITextSource Format (PolicyContainer policyParent, string mimeType, ITextSource input, int startOffset, int length)
+ {
+ if (startOffset < 0 || startOffset > input.Length)
+ throw new ArgumentOutOfRangeException (nameof (startOffset), "should be >= 0 && < " + input.Length + " was:" + startOffset);
+ if (length < 0 || startOffset + length > input.Length)
+ throw new ArgumentOutOfRangeException (nameof (length), "should be >= 0 && < " + (input.Length - startOffset) + " was:" + length);
+ try {
+ return FormatImplementation (policyParent ?? PolicyService.DefaultPolicies, mimeType, input, startOffset, length);
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while formatting text.", e);
+ }
+ return input.CreateSnapshot (startOffset, length);
+ }
+
+ public ITextSource Format (PolicyContainer policyParent, string mimeType, ITextSource input)
+ {
+ if (input == null)
+ throw new ArgumentNullException (nameof (input));
+ return Format (policyParent ?? PolicyService.DefaultPolicies, mimeType, input, 0, input.Length);
+ }
+
+ public virtual bool SupportsPartialDocumentFormatting { get { return false; } }
+
+ public string FormatText (PolicyContainer policyParent, string mimeType, string input, int fromOffset, int toOffset)
+ {
+ if (input == null)
+ throw new ArgumentNullException (nameof (input));
+ if (mimeType == null)
+ throw new ArgumentNullException (nameof (mimeType));
+ return FormatImplementation (policyParent ?? PolicyService.DefaultPolicies, mimeType, new StringTextSource (input), fromOffset, toOffset - fromOffset).Text;
+ }
+
+ public string FormatText (PolicyContainer policyParent, string mimeType, string input)
+ {
+ if (input == null)
+ throw new ArgumentNullException (nameof (input));
+ return FormatText (policyParent ?? PolicyService.DefaultPolicies, mimeType, input, 0, input.Length);
+ }
+
+ public virtual bool SupportsOnTheFlyFormatting { get { return false; } }
+
+ protected virtual void OnTheFlyFormatImplementation (TextEditor editor, DocumentContext context, int startOffset, int length)
+ {
+ throw new NotSupportedException ("On the fly formatting not supported");
+ }
+
+ public virtual void OnTheFlyFormat (TextEditor editor, DocumentContext context, int startOffset, int length)
+ {
+ if (editor == null)
+ throw new ArgumentNullException (nameof (editor));
+ if (context == null)
+ throw new ArgumentNullException (nameof (context));
+
+ if (startOffset < 0 || startOffset > editor.Length)
+ throw new ArgumentOutOfRangeException (nameof (startOffset), "should be >= 0 && < " + editor.Length + " was:" + startOffset);
+ if (length < 0 || startOffset + length > editor.Length)
+ throw new ArgumentOutOfRangeException (nameof (length), "should be >= 0 && < " + (editor.Length - startOffset) + " was:" + length);
+
+ OnTheFlyFormatImplementation (editor, context, startOffset, length);
+ }
+
+ public virtual bool SupportsCorrectingIndent { get { return false; } }
+
+ protected virtual void CorrectIndentingImplementation (PolicyContainer policyParent, TextEditor editor, int line)
+ {
+ throw new NotSupportedException ("Indent correction not supported");
+ }
+
+ public void CorrectIndenting (PolicyContainer policyParent, TextEditor editor, int line)
+ {
+ if (policyParent == null)
+ throw new ArgumentNullException (nameof (policyParent));
+ if (editor == null)
+ throw new ArgumentNullException (nameof (editor));
+ if (line < 0 || line >= editor.LineCount)
+ throw new ArgumentOutOfRangeException (nameof (line), "should be >= 0 && < " + editor.LineCount + " was:" + line);
+ CorrectIndentingImplementation (policyParent, editor, line);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormatter.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormatter.cs
index 6160c8b056..714df2b465 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormatter.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormatter.cs
@@ -1,4 +1,4 @@
-//
+//
// Formatter.cs
//
// Author:
@@ -26,92 +26,116 @@
using System;
using MonoDevelop.Projects.Policies;
-using Mono.TextEditor;
using System.Collections.Generic;
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.Semantics;
using MonoDevelop.Core;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Gui;
namespace MonoDevelop.Ide.CodeFormatting
{
public sealed class CodeFormatter
{
- ICodeFormatter formatter;
- IList<string> mimeTypeChain;
-
- internal CodeFormatter (IList<string> mimeTypeChain, ICodeFormatter formatter)
+ readonly AbstractCodeFormatter formatter;
+ readonly string mimeType;
+
+ public bool IsDefault {
+ get {
+ return formatter is DefaultCodeFormatter;
+ }
+ }
+
+ public bool SupportsPartialDocumentFormatting { get { return formatter.SupportsPartialDocumentFormatting; } }
+
+ internal CodeFormatter (string mimeType, AbstractCodeFormatter formatter)
{
- this.mimeTypeChain = mimeTypeChain;
+ this.mimeType = mimeType;
this.formatter = formatter;
}
-
- public string FormatText (PolicyContainer policyParent, string input)
+
+ [Obsolete("Use Format (PolicyContainer policyParent, ITextSource input, ISegment segment = null) instead. This function is going to be removed.")]
+ public ITextSource Format (PolicyContainer policyParent, ITextSource input, int fromOffset, int toOffset)
+ {
+ return formatter.Format (policyParent, mimeType, input, fromOffset, toOffset);
+ }
+
+ public ITextSource Format (PolicyContainer policyParent, ITextSource input, ISegment segment = null)
{
try {
- return formatter.FormatText (policyParent ?? PolicyService.DefaultPolicies, mimeTypeChain, input);
+ if (segment == null)
+ return formatter.Format (policyParent, mimeType, input);
+ return formatter.Format (policyParent, mimeType, input, segment.Offset, segment.EndOffset);
} catch (Exception e) {
LoggingService.LogError ("Error while formatting text.", e);
+ if (segment == null)
+ return input;
+ return input.CreateSnapshot (segment.Offset, segment.Length);
}
- return input;
}
-
- /// <summary>Formats a subrange of the input text.</summary>
- /// <returns>The formatted text of the range.</returns>
- /// <exception cref="T:System.ArgumentOutOfRangeException">When the offsets are out of bounds.</exception>
+
+ [Obsolete("Use FormatText (PolicyContainer policyParent, string input, ISegment segment) instead. This function is going to be removed.")]
public string FormatText (PolicyContainer policyParent, string input, int fromOffset, int toOffset)
{
- if (fromOffset < 0 || fromOffset > input.Length)
- throw new ArgumentOutOfRangeException ("fromOffset", "should be >= 0 && < " + input.Length + " was:" + fromOffset);
- if (toOffset < 0 || toOffset > input.Length)
- throw new ArgumentOutOfRangeException ("fromOffset", "should be >= 0 && < " + input.Length + " was:" + toOffset);
+ return formatter.FormatText (policyParent, mimeType, input, fromOffset, toOffset);
+ }
+
+ public string FormatText (PolicyContainer policyParent, string input, ISegment segment = null)
+ {
try {
- return formatter.FormatText (policyParent ?? PolicyService.DefaultPolicies, mimeTypeChain, input, fromOffset, toOffset);
+ if (segment == null)
+ return formatter.FormatText (policyParent, mimeType, input, 0, input.Length);
+ return formatter.FormatText (policyParent, mimeType, input, segment.Offset, segment.EndOffset);
} catch (Exception e) {
LoggingService.LogError ("Error while formatting text.", e);
+ if (segment == null)
+ return input;
+ return input.Substring (segment.Offset, segment.Length);
}
- return input.Substring (fromOffset, toOffset - fromOffset);
}
-
- public bool SupportsOnTheFlyFormatting {
- get {
- var adv = formatter as IAdvancedCodeFormatter;
- return adv != null && adv.SupportsOnTheFlyFormatting;
- }
+
+ public bool SupportsOnTheFlyFormatting { get { return formatter.SupportsOnTheFlyFormatting; } }
+
+ [Obsolete("Use OnTheFlyFormat (TextEditor editor, DocumentContext context, ISegment segment) instead. This function is going to be removed.")]
+ public void OnTheFlyFormat (TextEditor editor, DocumentContext context, int startOffset, int endOffset)
+ {
+ formatter.OnTheFlyFormat (editor, context, startOffset, endOffset - startOffset);
}
-
- public bool SupportsCorrectingIndent {
- get {
- var adv = formatter as IAdvancedCodeFormatter;
- return adv != null && adv.SupportsCorrectingIndent;
+
+ public void OnTheFlyFormat (TextEditor editor, DocumentContext context, ISegment segment = null)
+ {
+ try {
+ if (segment == null) {
+ formatter.OnTheFlyFormat (editor, context, 0, editor.Length);
+ } else {
+ formatter.OnTheFlyFormat (editor, context, segment.Offset, segment.Length);
+ }
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while on the fly format.", e);
}
}
-
- public bool IsDefault {
- get {
- return formatter is DefaultCodeFormatter;
- }
+
+ [Obsolete("Use OnTheFlyFormat (TextEditor editor, DocumentContext context, ISegment segment) instead. This function is going to be removed.")]
+ public void OnTheFlyFormat (Document ideDocument, int startOffset, int endOffset)
+ {
+ formatter.OnTheFlyFormat (ideDocument.Editor, ideDocument, startOffset, endOffset - startOffset);
}
-
- /// <summary>
- /// Formats a text document directly with insert/remove operations.
- /// </summary>
- public void OnTheFlyFormat (MonoDevelop.Ide.Gui.Document doc, int startOffset, int endOffset)
+
+ public bool SupportsCorrectingIndent { get { return formatter.SupportsCorrectingIndent; } }
+
+ public void CorrectIndenting (PolicyContainer policyParent, TextEditor editor, int line)
{
- var adv = formatter as IAdvancedCodeFormatter;
- if (adv == null || !adv.SupportsOnTheFlyFormatting)
- throw new InvalidOperationException ("On the fly formatting not supported");
-
- adv.OnTheFlyFormat (doc, startOffset, endOffset);
+ formatter.CorrectIndenting (policyParent, editor, line);
}
-
- public void CorrectIndenting (PolicyContainer policyParent, TextEditorData data, int line)
+
+ public void CorrectIndenting (PolicyContainer policyParent, TextEditor editor, IDocumentLine line)
{
- var adv = formatter as IAdvancedCodeFormatter;
- if (adv == null || !adv.SupportsCorrectingIndent)
- throw new InvalidOperationException ("Indent correction not supported");
- adv.CorrectIndenting (policyParent ?? PolicyService.DefaultPolicies, mimeTypeChain, data, line);
+ try {
+ if (line == null)
+ throw new ArgumentNullException (nameof (line));
+ formatter.CorrectIndenting (policyParent, editor, line.LineNumber);
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while indenting.", e);
+ }
}
}
-}
-
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormatterExtensionNode.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormatterExtensionNode.cs
index a5e22d90c7..53e1b1e5c1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormatterExtensionNode.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormatterExtensionNode.cs
@@ -37,9 +37,9 @@ namespace MonoDevelop.Ide.CodeFormatting
get { return mimeType; }
}
- public ICodeFormatter GetFormatter ()
+ public AbstractCodeFormatter GetFormatter ()
{
- return (ICodeFormatter) this.GetInstance ();
+ return (AbstractCodeFormatter) this.GetInstance ();
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormatterService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormatterService.cs
index 834881f688..3c028ac631 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormatterService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormatterService.cs
@@ -29,6 +29,8 @@ using System.Linq;
using System.Collections.Generic;
using Mono.Addins;
using MonoDevelop.Projects.Policies;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
namespace MonoDevelop.Ide.CodeFormatting
{
@@ -60,13 +62,31 @@ namespace MonoDevelop.Ide.CodeFormatting
foreach (var mt in chain) {
var node = nodes.FirstOrDefault (f => f.MimeType == mt);
if (node != null)
- return new CodeFormatter (chain, node.GetFormatter ());
+ return new CodeFormatter (mimeType, node.GetFormatter ());
}
if (DesktopService.GetMimeTypeIsText (mimeType))
- return new CodeFormatter (chain, new DefaultCodeFormatter ());
+ return new CodeFormatter (mimeType, new DefaultCodeFormatter ());
return null;
}
+
+ public static void Format (TextEditor editor, DocumentContext ctx, ISegment segment)
+ {
+ if (editor == null)
+ throw new ArgumentNullException ("editor");
+ if (ctx == null)
+ throw new ArgumentNullException ("ctx");
+ if (segment == null)
+ throw new ArgumentNullException ("segment");
+ var fmt = GetFormatter (editor.MimeType);
+ if (fmt == null)
+ return;
+ if (fmt.SupportsOnTheFlyFormatting) {
+ fmt.OnTheFlyFormat (editor, ctx, segment);
+ return;
+ }
+ editor.Text = fmt.FormatText (ctx.HasProject ? ctx.Project.Policies : null, editor.Text, segment);
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormattingCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormattingCommands.cs
index 24f63ac7d1..74c47398ea 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormattingCommands.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormattingCommands.cs
@@ -28,14 +28,14 @@ using System;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Core;
-using Mono.TextEditor;
-using MonoDevelop.Projects.Policies;
-
+using MonoDevelop.Core.Text;
+using MonoDevelop.Projects.Policies;
+using System.Linq;
+
namespace MonoDevelop.Ide.CodeFormatting
{
public enum CodeFormattingCommands {
- FormatBuffer,
- FormatSelection
+ FormatBuffer
}
public class FormatBufferHandler : CommandHandler
@@ -56,6 +56,10 @@ namespace MonoDevelop.Ide.CodeFormatting
Document doc;
var formatter = GetFormatter (out doc);
info.Enabled = formatter != null;
+
+ if (formatter != null && formatter.SupportsPartialDocumentFormatting && doc.Editor.IsSomethingSelected) {
+ info.Text = GettextCatalog.GetString ("_Format Selection");
+ }
}
protected override void Run (object tool)
@@ -64,71 +68,58 @@ namespace MonoDevelop.Ide.CodeFormatting
var formatter = GetFormatter (out doc);
if (formatter == null)
return;
+ var editor = doc.Editor;
+
+ if (editor.IsSomethingSelected && formatter.SupportsPartialDocumentFormatting) {
+ ISegment selection = editor.SelectionRange;
+
+ using (var undo = editor.OpenUndoGroup ()) {
+ var version = editor.Version;
+
+ if (formatter.SupportsOnTheFlyFormatting) {
+ formatter.OnTheFlyFormat (doc.Editor, doc, selection);
+ } else {
+ var pol = doc.Project != null ? doc.Project.Policies : null;
+ try {
+ var editorText = editor.Text;
+ string text = formatter.FormatText (pol, editorText, selection);
+ if (text != null && editorText.Substring (selection.Offset, selection.Length) != text) {
+ editor.ReplaceText (selection.Offset, selection.Length, text);
+ }
+ } catch (Exception e) {
+ LoggingService.LogError ("Error during format.", e);
+ }
+ }
+
+ int newOffset = version.MoveOffsetTo (editor.Version, selection.Offset);
+ int newEndOffset = version.MoveOffsetTo (editor.Version, selection.EndOffset);
+ editor.SetSelection (newOffset, newEndOffset);
+ }
+ return;
+ }
if (formatter.SupportsOnTheFlyFormatting) {
using (var undo = doc.Editor.OpenUndoGroup ()) {
- formatter.OnTheFlyFormat (doc, 0, doc.Editor.Length);
+ formatter.OnTheFlyFormat (doc.Editor, doc, new TextSegment (0, doc.Editor.Length));
}
} else {
- var text = doc.Editor.Text;
+ var text = editor.Text;
+ var oldOffsetWithoutWhitespaces = editor.GetTextBetween (0, editor.CaretOffset).Count (c => !char.IsWhiteSpace (c));
var policies = doc.Project != null ? doc.Project.Policies : PolicyService.DefaultPolicies;
string formattedText = formatter.FormatText (policies, text);
if (formattedText == null || formattedText == text)
return;
-
- doc.Editor.Replace (0, text.Length, formattedText);
- }
- doc.Editor.Document.CommitUpdateAll ();
- }
- }
-
- public class FormatSelectionHandler : CommandHandler
- {
- protected override void Update (CommandInfo info)
- {
- Document doc;
- var formatter = FormatBufferHandler.GetFormatter (out doc);
- info.Enabled = formatter != null && !formatter.IsDefault;
- }
-
- protected override void Run (object tool)
- {
- Document doc;
- var formatter = FormatBufferHandler.GetFormatter (out doc);
- if (formatter == null)
- return;
-
- TextSegment selection;
- var editor = doc.Editor;
- if (editor.IsSomethingSelected) {
- selection = editor.SelectionRange;
- } else {
- selection = editor.GetLine (editor.Caret.Line).Segment;
- }
-
- using (var undo = editor.OpenUndoGroup ()) {
- var version = editor.Version;
-
- if (formatter.SupportsOnTheFlyFormatting) {
- formatter.OnTheFlyFormat (doc, selection.Offset, selection.EndOffset);
- } else {
- var pol = doc.Project != null ? doc.Project.Policies : null;
- try {
- var editorText = editor.Text;
- string text = formatter.FormatText (pol, editorText, selection.Offset, selection.EndOffset);
- if (text != null && editorText.Substring (selection.Offset, selection.Length) != text) {
- editor.Replace (selection.Offset, selection.Length, text);
- }
- } catch (Exception e) {
- LoggingService.LogError ("Error during format.", e);
+
+ editor.ReplaceText (0, text.Length, formattedText);
+ text = editor.Text;
+ var currentOffsetWithoutWhitepspaces = 0;
+ int i = 0;
+ for (; i < text.Length && currentOffsetWithoutWhitepspaces < oldOffsetWithoutWhitespaces; i++) {
+ if (!char.IsWhiteSpace(text [i])) {
+ currentOffsetWithoutWhitepspaces++;
}
}
-
- if (editor.IsSomethingSelected) {
- int newOffset = version.MoveOffsetTo (editor.Version, selection.Offset);
- int newEndOffset = version.MoveOffsetTo (editor.Version, selection.EndOffset);
- editor.SetSelection (newOffset, newEndOffset);
- }
+ editor.SetCaretLocation (editor.OffsetToLocation (i));
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/DefaultCodeFormatter.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/DefaultCodeFormatter.cs
index 2e9509738d..685a03988a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/DefaultCodeFormatter.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/DefaultCodeFormatter.cs
@@ -32,27 +32,32 @@ using MonoDevelop.Projects;
using MonoDevelop.Projects.Text;
using MonoDevelop.Projects.Policies;
using MonoDevelop.Ide;
+using MonoDevelop.Core.Text;
namespace MonoDevelop.Ide.CodeFormatting
{
- public class DefaultCodeFormatter : AbstractCodeFormatter
+ class DefaultCodeFormatter : AbstractCodeFormatter
{
static int GetNextTabstop (int currentColumn, int tabSize)
{
int result = currentColumn - 1 + tabSize;
return 1 + (result / tabSize) * tabSize;
}
-
- public override string FormatText (PolicyContainer policyParent, IEnumerable<string> mimeTypeChain,
- string input, int startOffset, int endOffset)
+
+ public override bool SupportsPartialDocumentFormatting {
+ get {
+ return true;
+ }
+ }
+
+ protected override ITextSource FormatImplementation (PolicyContainer policyParent, string mimeType, ITextSource input, int startOffset, int length)
{
- var currentPolicy = policyParent.Get<TextStylePolicy> (mimeTypeChain);
+ var currentPolicy = policyParent.Get<TextStylePolicy> (mimeType);
- input = input ?? "";
int line = 0, col = 0;
string eolMarker = currentPolicy.GetEolMarker ();
var result = new StringBuilder ();
-
+ var endOffset = startOffset + length;
for (int i = startOffset; i < endOffset && i < input.Length; i++) {
char ch = input[i];
switch (ch) {
@@ -79,7 +84,8 @@ namespace MonoDevelop.Ide.CodeFormatting
break;
}
}
- return result.ToString ();
+
+ return new StringTextSource (result.ToString (), input.Encoding, input.UseBOM);
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/IAdvancedCodeFormatter.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/IAdvancedCodeFormatter.cs
deleted file mode 100644
index 3b5e4321af..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/IAdvancedCodeFormatter.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//
-// IPrettyPrinter.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-using Mono.TextEditor;
-using MonoDevelop.Projects.Policies;
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.Semantics;
-
-namespace MonoDevelop.Ide.CodeFormatting
-{
- public interface IAdvancedCodeFormatter : ICodeFormatter
- {
- bool SupportsOnTheFlyFormatting { get; }
- bool SupportsCorrectingIndent { get; }
-
- void CorrectIndenting (PolicyContainer policyParent, IEnumerable<string> mimeTypeChain, TextEditorData textEditorData, int line);
-
- void OnTheFlyFormat (MonoDevelop.Ide.Gui.Document doc, int startOffset, int endOffset);
-
- }
-
- public abstract class AbstractAdvancedFormatter : AbstractCodeFormatter, IAdvancedCodeFormatter
- {
- public virtual bool SupportsOnTheFlyFormatting { get { return false; } }
- public virtual bool SupportsCorrectingIndent { get { return false; } }
-
- public virtual void OnTheFlyFormat (MonoDevelop.Ide.Gui.Document doc, int startOffset, int endOffset)
- {
- throw new NotSupportedException ();
- }
-
- public virtual void CorrectIndenting (PolicyContainer policyParent, IEnumerable<string> mimeTypeChain,
- TextEditorData data, int line)
- {
- throw new NotSupportedException ();
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/ICodeFormatter.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/ICodeFormatter.cs
deleted file mode 100644
index 902a644fdc..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/ICodeFormatter.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-//
-// IFormatter.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-using MonoDevelop.Projects.Policies;
-
-namespace MonoDevelop.Ide.CodeFormatting
-{
- public interface ICodeFormatter
- {
- string FormatText (PolicyContainer policyParent, IEnumerable<string> mimeTypeChain, string input);
-
- /// <summary>
- /// Formats the text in a range. Returns only the modified range, or null if formatting failed.
- /// </summary>
- string FormatText (PolicyContainer policyParent, IEnumerable<string> mimeTypeChain,
- string input, int startOffset, int endOffset);
- }
-
- public abstract class AbstractCodeFormatter : ICodeFormatter
- {
- public abstract string FormatText (PolicyContainer policyParent, IEnumerable<string> mimeTypeChain,
- string input, int startOffset, int endOffset);
-
- public string FormatText (PolicyContainer policyParent, IEnumerable<string> mimeTypeChain, string input)
- {
- if (string.IsNullOrEmpty (input))
- return input;
- return FormatText (policyParent, mimeTypeChain, input, 0, input.Length);
- }
- }
-} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs
index 6d78400369..9125e48690 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs
@@ -33,9 +33,11 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using MonoDevelop.Core;
-using Mono.TextEditor;
-using Mono.TextEditor.PopupWindow;
using MonoDevelop.Ide.CodeFormatting;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
+using System.Linq;
+using MonoDevelop.Ide.Gui;
namespace MonoDevelop.Ide.CodeTemplates
{
@@ -134,34 +136,47 @@ namespace MonoDevelop.Ide.CodeTemplates
return string.Format("[CodeTemplate: Group={0}, Shortcut={1}, CodeTemplateType={2}, MimeType={3}, Description={4}, Code={5}]", Group, Shortcut, CodeTemplateType, MimeType, Description, Code);
}
- static int FindPrevWordStart (TextEditorData editor, int offset)
+ static int FindPrevWordStart (TextEditor editor, int offset)
{
- while (--offset >= 0 && !Char.IsWhiteSpace (editor.GetCharAt (offset)))
- ;
+ while (--offset >= 0) {
+ var c = editor.GetCharAt (offset);
+ //Only legal characters in template Shortcut
+ //LetterOrDigit make sense
+ //_ to allow underscore naming convention
+ //# is because there are #if templates
+ //~ because disctructor template
+ //@ some Razor templates start with @
+ //in theory we should probably just support LetterOrDigit and _
+ if (!char.IsLetterOrDigit (c) && c != '_' && c != '#' && c != '~' && c != '@') {
+ break;
+ }
+ }
return ++offset;
}
- public static string GetWordBeforeCaret (TextEditorData editor)
+ public static string GetTemplateShortcutBeforeCaret (TextEditor editor)
{
- int offset = editor.Caret.Offset;
- int start = FindPrevWordStart (editor, offset);
+ int offset = editor.CaretOffset;
+ if (offset == 0)
+ return "";
+ int start = FindPrevWordStart (editor, offset - 1);
return editor.GetTextBetween (start, offset);
}
- static int DeleteWordBeforeCaret (TextEditorData editor)
+ static int DeleteTemplateShortcutBeforeCaret (TextEditor editor)
{
- int offset = editor.Caret.Offset;
+ int offset = editor.CaretOffset;
int start = FindPrevWordStart (editor, offset);
- editor.Remove (start, offset - start);
+ editor.RemoveText (start, offset - start);
return start;
}
- static Regex variableRegEx = new Regex ("\\$([^$]*)\\$", RegexOptions.Compiled);
+ static System.Text.RegularExpressions.Regex variableRegEx = new System.Text.RegularExpressions.Regex ("\\$([^$]*)\\$", RegexOptions.Compiled);
public List<string> ParseVariables (string code)
{
var result = new List<string> ();
- foreach (Match match in variableRegEx.Matches (code)) {
+ foreach (System.Text.RegularExpressions.Match match in variableRegEx.Matches (code)) {
string name = match.Groups[1].Value;
if (name == "end" || name == "selected" || string.IsNullOrEmpty (name) || name.Trim ().Length == 0)
continue;
@@ -211,9 +226,9 @@ namespace MonoDevelop.Ide.CodeTemplates
var result = new TemplateResult ();
var sb = new StringBuilder ();
int lastOffset = 0;
- string code = context.Document.Editor.FormatString (context.InsertPosition, context.TemplateCode);
+ string code = context.Editor.FormatString (context.InsertPosition, context.TemplateCode);
result.TextLinks = new List<TextLink> ();
- foreach (Match match in variableRegEx.Matches (code)) {
+ foreach (System.Text.RegularExpressions.Match match in variableRegEx.Matches (code)) {
string name = match.Groups [1].Value;
sb.Append (code.Substring (lastOffset, match.Index - lastOffset));
lastOffset = match.Index + match.Length;
@@ -230,7 +245,7 @@ namespace MonoDevelop.Ide.CodeTemplates
}
if (!variableDecarations.ContainsKey (name))
continue;
- TextLink link = result.TextLinks.Find (l => l.Name == name);
+ var link = result.TextLinks.Find (l => l.Name == name);
bool isNew = link == null;
if (isNew) {
link = new TextLink (name);
@@ -271,13 +286,13 @@ namespace MonoDevelop.Ide.CodeTemplates
sb.Append (code.Substring (lastOffset, code.Length - lastOffset));
// format & indent template code
- var data = new TextEditorData ();
+ var data = TextEditorFactory.CreateNewDocument ();
data.Text = sb.ToString ();
- data.Document.TextReplaced += delegate(object sender, DocumentChangeEventArgs e) {
- int delta = e.ChangeDelta;
+ data.TextChanged += delegate(object sender, MonoDevelop.Core.Text.TextChangeEventArgs e) {
+ int delta = e.InsertionLength - e.RemovalLength;
foreach (var link in result.TextLinks) {
- link.Links = new List<TextSegment> (link.Links.AdjustSegments (e));
+ link.Links = link.Links.AdjustSegments (e).ToList ();
}
if (result.CaretEndOffset > e.Offset)
result.CaretEndOffset += delta;
@@ -285,7 +300,6 @@ namespace MonoDevelop.Ide.CodeTemplates
IndentCode (data, context.LineIndent);
result.Code = data.Text;
- data.Dispose ();
return result;
}
@@ -319,12 +333,12 @@ namespace MonoDevelop.Ide.CodeTemplates
return result.ToString ();
}
- static void IndentCode (TextEditorData data, string lineIndent)
+ static void IndentCode (ITextDocument data, string lineIndent)
{
for (int i = 1; i < data.LineCount; i++) {
var line = data.GetLine (i + 1);
if (line.Length > 0)
- data.Insert (line.Offset, lineIndent);
+ data.InsertText (line.Offset, lineIndent);
}
}
@@ -345,10 +359,10 @@ namespace MonoDevelop.Ide.CodeTemplates
string RemoveIndent (string text, string indent)
{
- var doc = new TextDocument ();
+ var doc = TextEditorFactory.CreateNewDocument ();
doc.Text = text;
var result = new StringBuilder ();
- foreach (DocumentLine line in doc.Lines) {
+ foreach (var line in doc.GetLines ()) {
string curLineIndent = line.GetIndentation (doc);
int offset = Math.Min (curLineIndent.Length, indent.Length);
result.Append (doc.GetTextBetween (line.Offset + offset, line.EndOffsetIncludingDelimiter));
@@ -358,68 +372,74 @@ namespace MonoDevelop.Ide.CodeTemplates
string Reindent (string text, string indent)
{
- var doc = new TextDocument ();
+ var doc = TextEditorFactory.CreateNewDocument ();
doc.Text = text;
var result = new StringBuilder ();
- foreach (DocumentLine line in doc.Lines) {
+ foreach (var line in doc.GetLines ()) {
if (result.Length > 0)
result.Append (indent);
result.Append (doc.GetTextAt (line.SegmentIncludingDelimiter));
}
return result.ToString ();
}
-
+
public void Insert (MonoDevelop.Ide.Gui.Document document)
{
- var handler = document.GetContent<ICodeTemplateHandler> ();
+ Insert (document.Editor, document);
+ }
+
+ public void Insert (TextEditor editor, DocumentContext context)
+ {
+ var handler = context.GetContent<ICodeTemplateHandler> ();
if (handler != null) {
- handler.InsertTemplate (this, document);
+ handler.InsertTemplate (this, editor, context);
} else {
- InsertTemplateContents (document);
+ InsertTemplateContents (editor, context);
}
}
/// <summary>
/// Don't use this unless you're implementing ICodeTemplateWidget. Use Insert instead.
/// </summary>
- public TemplateResult InsertTemplateContents (MonoDevelop.Ide.Gui.Document document)
+ public TemplateResult InsertTemplateContents (TextEditor editor, DocumentContext context)
{
- Mono.TextEditor.TextEditorData data = document.Editor;
+ var data = editor;
- int offset = data.Caret.Offset;
+ int offset = data.CaretOffset;
// string leadingWhiteSpace = GetLeadingWhiteSpace (editor, editor.CursorLine);
- var context = new TemplateContext {
+ var templateCtx = new TemplateContext {
Template = this,
- Document = document,
- ParsedDocument = document.ParsedDocument != null ? document.ParsedDocument.ParsedFile : null,
- InsertPosition = data.Caret.Location,
- LineIndent = data.Document.GetLineIndent (data.Caret.Line),
+ DocumentContext = context,
+ Editor = editor,
+ //ParsedDocument = context.ParsedDocument != null ? context.ParsedDocument.ParsedFile : null,
+ InsertPosition = data.CaretLocation,
+ LineIndent = data.GetLineIndent (data.CaretLocation.Line),
TemplateCode = Code
};
if (data.IsSomethingSelected) {
int start = data.SelectionRange.Offset;
- while (Char.IsWhiteSpace (data.Document.GetCharAt (start))) {
+ while (Char.IsWhiteSpace (data.GetCharAt (start))) {
start++;
}
int end = data.SelectionRange.EndOffset;
- while (Char.IsWhiteSpace (data.Document.GetCharAt (end - 1))) {
+ while (Char.IsWhiteSpace (data.GetCharAt (end - 1))) {
end--;
}
- context.LineIndent = data.Document.GetLineIndent (data.Document.OffsetToLineNumber (start));
- context.SelectedText = RemoveIndent (data.Document.GetTextBetween (start, end), context.LineIndent);
- data.Remove (start, end - start);
+ templateCtx.LineIndent = data.GetLineIndent (data.OffsetToLineNumber (start));
+ templateCtx.SelectedText = RemoveIndent (data.GetTextBetween (start, end), templateCtx.LineIndent);
+ data.RemoveText (start, end - start);
offset = start;
} else {
- string word = GetWordBeforeCaret (data).Trim ();
+ string word = GetTemplateShortcutBeforeCaret (data).Trim ();
if (word.Length > 0)
- offset = DeleteWordBeforeCaret (data);
+ offset = DeleteTemplateShortcutBeforeCaret (data);
}
- TemplateResult template = FillVariables (context);
+ TemplateResult template = FillVariables (templateCtx);
template.InsertPosition = offset;
- document.Editor.Insert (offset, template.Code);
+ editor.InsertText (offset, template.Code);
int newoffset;
if (template.CaretEndOffset >= 0) {
@@ -428,13 +448,14 @@ namespace MonoDevelop.Ide.CodeTemplates
newoffset = offset + template.Code.Length;
}
- document.Editor.Caret.Location = document.Editor.OffsetToLocation (newoffset) ;
+ editor.CaretLocation = editor.OffsetToLocation (newoffset) ;
var prettyPrinter = CodeFormatterService.GetFormatter (data.MimeType);
if (prettyPrinter != null && prettyPrinter.SupportsOnTheFlyFormatting) {
int endOffset = template.InsertPosition + template.Code.Length;
var oldVersion = data.Version;
- prettyPrinter.OnTheFlyFormat (document, template.InsertPosition, endOffset);
+ prettyPrinter.OnTheFlyFormat (editor, context, TextSegment.FromBounds (template.InsertPosition, editor.CaretOffset));
+ prettyPrinter.OnTheFlyFormat (editor, context, TextSegment.FromBounds (editor.CaretOffset, endOffset));
foreach (var textLink in template.TextLinks) {
for (int i = 0; i < textLink.Links.Count; i++) {
var segment = textLink.Links [i];
@@ -446,6 +467,12 @@ namespace MonoDevelop.Ide.CodeTemplates
return template;
}
+ public TemplateResult InsertTemplateContents (Document document)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ return InsertTemplateContents (document.Editor, document);
+ }
#region I/O
public const string Node = "CodeTemplate";
const string HeaderNode = "Header";
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateCodon.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateCodon.cs
index 488387a28d..c4c6f23f42 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateCodon.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateCodon.cs
@@ -32,7 +32,7 @@ using System.IO;
namespace MonoDevelop.Ide.CodeTemplates
{
[ExtensionNode (Description="A template for color and syntax shemes.")]
- public class CodeTemplateCodon : ExtensionNode
+ class CodeTemplateCodon : ExtensionNode
{
[NodeAttribute("resource", "Name of the resource where the template is stored.")]
string resource;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateCompletionData.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateCompletionData.cs
index 3f19b81ce7..f3c254cc0c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateCompletionData.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateCompletionData.cs
@@ -28,20 +28,22 @@ using System;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Core;
+using MonoDevelop.Ide.Editor.Extension;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Ide.CodeTemplates
{
public interface ICodeTemplateHandler
{
- void InsertTemplate (CodeTemplate template, Document document);
+ void InsertTemplate (CodeTemplate template, TextEditor editor, DocumentContext context);
}
- public class CodeTemplateCompletionData : CompletionData
+ class CodeTemplateCompletionData : CompletionData
{
- Document doc;
- CodeTemplate template;
+ readonly TextEditorExtension doc;
+ readonly CodeTemplate template;
- public CodeTemplateCompletionData (Document doc, CodeTemplate template)
+ public CodeTemplateCompletionData (TextEditorExtension doc, CodeTemplate template)
{
this.doc = doc;
this.template = template;
@@ -51,9 +53,9 @@ namespace MonoDevelop.Ide.CodeTemplates
this.Description = template.Shortcut + Environment.NewLine + GettextCatalog.GetString (template.Description);
}
- public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, KeyDescriptor descriptor)
{
- template.Insert (doc);
+ template.Insert (doc.Editor, doc.DocumentContext);
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateListDataProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateListDataProvider.cs
index 1487ce6806..79e29a55cc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateListDataProvider.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateListDataProvider.cs
@@ -24,13 +24,11 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using System;
using System.Collections.Generic;
-using Mono.TextEditor.PopupWindow;
namespace MonoDevelop.Ide.CodeTemplates
{
- public class CodeTemplateListDataProvider : IListDataProvider<string>
+ class CodeTemplateListDataProvider : IListDataProvider<string>
{
List<CodeTemplateVariableValue> itemList;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs
index d86afb3a1a..2a6cf53298 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplatePanel.cs
@@ -31,6 +31,7 @@ using Gtk;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Components;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Ide.CodeTemplates
{
@@ -41,14 +42,14 @@ namespace MonoDevelop.Ide.CodeTemplates
Gtk.TreeStore templateStore;
CellRendererText templateCellRenderer;
CellRendererImage pixbufCellRenderer;
- Mono.TextEditor.TextEditor textEditor = new Mono.TextEditor.TextEditor ();
- Mono.TextEditor.TextEditorOptions options;
-
+ TextEditor textEditor = TextEditorFactory.CreateNewEditor ();
+
public CodeTemplatePanelWidget (OptionsDialog parent)
{
this.Build();
- scrolledwindow1.Add (textEditor);
- textEditor.ShowAll ();
+ Gtk.Widget control = textEditor;
+ scrolledwindow1.Add (control);
+ control.ShowAll ();
templateStore = new TreeStore (typeof (CodeTemplate), typeof (string), typeof (string));
@@ -73,13 +74,9 @@ namespace MonoDevelop.Ide.CodeTemplates
treeviewCodeTemplates.ExpandAll ();
treeviewCodeTemplates.Selection.Changed += HandleChanged;
-
- options = new MonoDevelop.Ide.Gui.CommonTextEditorOptions ();
- options.ShowLineNumberMargin = false;
- options.ShowFoldMargin = false;
- options.ShowIconMargin = false;
- textEditor.Options = options;
- textEditor.Document.ReadOnly = true;
+
+ textEditor.Options = DefaultSourceEditorOptions.PlainEditor;
+ textEditor.IsReadOnly = true;
this.buttonAdd.Clicked += ButtonAddClicked;
this.buttonEdit.Clicked += ButtonEditClicked;
this.buttonRemove.Clicked += ButtonRemoveClicked;
@@ -189,10 +186,10 @@ namespace MonoDevelop.Ide.CodeTemplates
CodeTemplate template = templateStore.GetValue (iter, 0) as CodeTemplate;
if (template != null) {
textEditor.ClearSelection ();
- textEditor.Document.MimeType = template.MimeType;
- textEditor.Document.Text = template.Code;
+ textEditor.MimeType = template.MimeType;
+ textEditor.Text = template.Code;
} else {
- textEditor.Document.Text = "";
+ textEditor.Text = "";
}
}
}
@@ -221,12 +218,12 @@ namespace MonoDevelop.Ide.CodeTemplates
return templateStore.AppendValues (iter, template, template.Shortcut, null);
}
}
-
+
internal class CodeTemplatePane : OptionsPanel
{
CodeTemplatePanelWidget codeTemplatePanelWidget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return codeTemplatePanelWidget = new CodeTemplatePanelWidget (this.ParentDialog);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs
index 90ab1ee87b..5c93ac6cb8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs
@@ -69,20 +69,19 @@ namespace MonoDevelop.Ide.CodeTemplates
{
try {
Templates = LoadTemplates ();
+ AddinManager.AddExtensionNodeHandler ("/MonoDevelop/Ide/CodeTemplates", delegate (object sender, ExtensionNodeEventArgs args) {
+ var codon = (CodeTemplateCodon)args.ExtensionNode;
+ switch (args.Change) {
+ case ExtensionChange.Add:
+ using (XmlReader reader = codon.Open ()) {
+ LoadTemplates (reader).ForEach (t => templates.Add (t));
+ }
+ break;
+ }
+ });
} catch (Exception e) {
LoggingService.LogError ("CodeTemplateService: Exception while loading templates.", e);
}
-
- AddinManager.AddExtensionNodeHandler ("/MonoDevelop/Ide/CodeTemplates", delegate(object sender, ExtensionNodeEventArgs args) {
- var codon = (CodeTemplateCodon)args.ExtensionNode;
- switch (args.Change) {
- case ExtensionChange.Add:
- using (XmlReader reader = codon.Open ()) {
- LoadTemplates (reader).ForEach (t => templates.Add (t));
- }
- break;
- }
- });
}
public static IEnumerable<CodeTemplate> GetCodeTemplates (string mimeType)
@@ -210,31 +209,19 @@ namespace MonoDevelop.Ide.CodeTemplates
static List<CodeTemplate> LoadTemplates ()
{
const string ManifestResourceName = "MonoDevelop-templates.xml";
- List<CodeTemplate> builtinTemplates = LoadTemplates (XmlTextReader.Create (typeof (CodeTemplateService).Assembly.GetManifestResourceStream (ManifestResourceName)));
+ var builtinTemplates = LoadTemplates (XmlReader.Create (typeof (CodeTemplateService).Assembly.GetManifestResourceStream (ManifestResourceName)));
if (Directory.Exists (TemplatePath)) {
- List<CodeTemplate> result = new List<CodeTemplate> ();
+ var result = new List<CodeTemplate> ();
foreach (string templateFile in Directory.GetFiles (TemplatePath, "*.xml")) {
- result.AddRange (LoadTemplates (XmlTextReader.Create (templateFile)));
+ result.AddRange (LoadTemplates (XmlReader.Create (templateFile)));
}
-
// merge user templates with built in templates
for (int i = 0; i < builtinTemplates.Count; i++) {
- CodeTemplate curTemplate = builtinTemplates[i];
- bool found = false;
- for (int j = 0; j < result.Count; j++) {
- CodeTemplate curResultTemplate = result[j];
- if (curTemplate.Shortcut == curResultTemplate.Shortcut) {
- found = true;
- if (curResultTemplate.Version != curTemplate.Version)
- result[j] = curTemplate;
- }
- }
- // template is new, insert it.
- if (!found)
+ var curTemplate = builtinTemplates[i];
+ if (!result.Any (t => t.Shortcut == curTemplate.Shortcut))
result.Add (curTemplate);
}
-
-
+
return result;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs
index f81346e749..2fd8c29936 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/EditTemplateDialog.cs
@@ -32,18 +32,17 @@ using Gtk;
using MonoDevelop.Core;
using Gdk;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
namespace MonoDevelop.Ide.CodeTemplates
{
-
-
- public partial class EditTemplateDialog : Gtk.Dialog
+ partial class EditTemplateDialog : Gtk.Dialog
{
CodeTemplate template;
- Mono.TextEditor.TextEditor textEditor = new Mono.TextEditor.TextEditor ();
- Mono.TextEditor.TextEditorOptions options;
-
+ TextEditor textEditor = TextEditorFactory.CreateNewEditor ();
+
ListStore variablesListStore;
List<CodeTemplateVariable> variables = new List<CodeTemplateVariable> ();
MonoDevelop.Components.PropertyGrid.PropertyGrid grid;
@@ -59,24 +58,20 @@ namespace MonoDevelop.Ide.CodeTemplates
this.comboboxentryGroups.Entry.Text = template.Group ?? "";
this.comboboxentryMime.Entry.Text = template.MimeType ?? "";
this.entryDescription.Text = template.Description ?? "";
- this.textEditor.Document.MimeType = template.MimeType;
- this.textEditor.Document.Text = template.Code;
+ this.textEditor.MimeType = template.MimeType;
+ this.textEditor.Text = template.Code ?? "";
checkbuttonExpansion.Active = (template.CodeTemplateType & CodeTemplateType.Expansion) == CodeTemplateType.Expansion;
checkbuttonSurroundWith.Active = (template.CodeTemplateType & CodeTemplateType.SurroundsWith) == CodeTemplateType.SurroundsWith;
- scrolledwindow1.Child = textEditor;
- textEditor.ShowAll ();
- textEditor.Caret.PositionChanged += CaretPositionChanged;
- options = new Mono.TextEditor.TextEditorOptions ();
- options.ShowLineNumberMargin = false;
- options.ShowFoldMargin = false;
- options.ShowIconMargin = false;
- options.ColorScheme = IdeApp.Preferences.ColorScheme;
- textEditor.Options = options;
-
- HashSet<string> mimeTypes = new HashSet<string> ();
- HashSet<string> groups = new HashSet<string> ();
+ Gtk.Widget control = textEditor;
+ scrolledwindow1.Child = control;
+ control.ShowAll ();
+ textEditor.CaretPositionChanged += CaretPositionChanged;
+ textEditor.Options = DefaultSourceEditorOptions.PlainEditor;
+
+ var mimeTypes = new HashSet<string> ();
+ var groups = new HashSet<string> ();
foreach (CodeTemplate ct in CodeTemplateService.Templates) {
mimeTypes.Add (ct.MimeType);
groups.Add (ct.Group);
@@ -89,7 +84,7 @@ namespace MonoDevelop.Ide.CodeTemplates
foreach (string group in groups) {
comboboxentryGroups.AppendText (group);
}
- textEditor.Document.TextReplaced += DocumentTextReplaced;
+ textEditor.TextChanged += DocumentTextReplaced;
this.buttonOk.Clicked += ButtonOkClicked;
checkbuttonWhiteSpaces.Hide ();
@@ -140,7 +135,7 @@ namespace MonoDevelop.Ide.CodeTemplates
template.Group = this.comboboxentryGroups.Entry.Text;
template.MimeType = this.comboboxentryMime.Entry.Text;
template.Description = this.entryDescription.Text;
- template.Code = this.textEditor.Document.Text;
+ template.Code = this.textEditor.Text;
variables.ForEach (v => template.AddVariable (v));
template.CodeTemplateType = CodeTemplateType.Unknown;
if (checkbuttonExpansion.Active)
@@ -149,9 +144,9 @@ namespace MonoDevelop.Ide.CodeTemplates
template.CodeTemplateType |= CodeTemplateType.SurroundsWith;
}
- void DocumentTextReplaced (object sender, Mono.TextEditor.DocumentChangeEventArgs e)
+ void DocumentTextReplaced (object sender, TextChangeEventArgs e)
{
- List<string> vars = template.ParseVariables (textEditor.Document.Text);
+ List<string> vars = template.ParseVariables (textEditor.Text);
foreach (string var in vars) {
if (!variables.Any (v => v.Name == var) && !template.Variables.Any (v => v.Name == var)) {
variables.Add (new CodeTemplateVariable (var) {
@@ -170,13 +165,13 @@ namespace MonoDevelop.Ide.CodeTemplates
}
- void CaretPositionChanged (object sender, Mono.TextEditor.DocumentLocationEventArgs e)
+ void CaretPositionChanged (object sender, EventArgs e)
{
comboboxVariables.Active = -1;
- int offset = textEditor.Caret.Offset;
+ int offset = textEditor.CaretOffset;
int start = offset;
- while (start >= 0 && start < textEditor.Document.TextLength) { // caret offset may be behind the text
- char ch = textEditor.Document.GetCharAt (start);
+ while (start >= 0 && start < textEditor.Length) { // caret offset may be behind the text
+ char ch = textEditor.GetCharAt (start);
if (ch == '$')
break;
if (!char.IsLetterOrDigit (ch) && ch != '_')
@@ -185,16 +180,16 @@ namespace MonoDevelop.Ide.CodeTemplates
}
int end = offset;
- while (end < textEditor.Document.TextLength) {
- char ch = textEditor.Document.GetCharAt (end);
+ while (end < textEditor.Length) {
+ char ch = textEditor.GetCharAt (end);
if (ch == '$')
break;
if (!char.IsLetterOrDigit (ch) && ch != '_')
return;
end++;
}
- if (start >= 0 && end < textEditor.Document.TextLength) {
- string varName = textEditor.Document.GetTextBetween (start, end).Trim ('$');
+ if (start >= 0 && end < textEditor.Length) {
+ string varName = textEditor.GetTextBetween (start, end).Trim ('$');
TreeIter iter;
if (variablesListStore.GetIterFirst (out iter)) {
int i = -1;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs
index 8a4a88f838..09d33e34a9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/ExpansionObject.cs
@@ -26,17 +26,18 @@
using System;
using System.Collections.Generic;
-using System.Text;
using System.Text.RegularExpressions;
using MonoDevelop.Ide.Gui.Content;
-using Mono.TextEditor.PopupWindow;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.Completion;
using MonoDevelop.Ide.CodeCompletion;
-using ICSharpCode.NRefactory.TypeSystem.Implementation;
+using MonoDevelop.Ide.Tasks;
+using Microsoft.CodeAnalysis;
+using System.Threading.Tasks;
+using System.Linq;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Extension;
+using System.Web.SessionState;
namespace MonoDevelop.Ide.CodeTemplates
{
@@ -47,17 +48,15 @@ namespace MonoDevelop.Ide.CodeTemplates
set;
}
- public ICompilation Compilation {
+ public SemanticModel Compilation {
get {
- return Document.Compilation;
+ var analysisDocument = DocumentContext.ParsedDocument;
+ if (analysisDocument == null)
+ return null;
+ return analysisDocument.GetAst<SemanticModel> ();
}
}
-
- public IUnresolvedFile ParsedDocument {
- get;
- set;
- }
-
+
public DocumentLocation InsertPosition {
get;
set;
@@ -78,7 +77,12 @@ namespace MonoDevelop.Ide.CodeTemplates
set;
}
- public MonoDevelop.Ide.Gui.Document Document {
+ public DocumentContext DocumentContext {
+ get;
+ set;
+ }
+
+ public TextEditor Editor {
get;
set;
}
@@ -93,36 +97,28 @@ namespace MonoDevelop.Ide.CodeTemplates
public string GetCurrentClassName ()
{
- if (CurrentContext.ParsedDocument == null)
+ var compilation = CurrentContext.Compilation;
+ if (compilation == null)
return null;
- IUnresolvedTypeDefinition type = null;
- var provider = CurrentContext.Document.GetContent<ITextEditorMemberPositionProvider>();
- if (provider == null) {
- type = CurrentContext.ParsedDocument.GetInnermostTypeDefinition (CurrentContext.InsertPosition.Line, CurrentContext.InsertPosition.Column);
- } else {
- type = provider.GetTypeAt (CurrentContext.Document.Editor.LocationToOffset (CurrentContext.InsertPosition));
- }
-
- if (type == null)
- return null;
- return type.Name;
+ var enclosingSymbol = compilation.GetEnclosingSymbol (CurrentContext.Editor.CaretOffset);
+
+ if (!(enclosingSymbol is ITypeSymbol))
+ enclosingSymbol = enclosingSymbol.ContainingType;
+
+ return enclosingSymbol != null ? enclosingSymbol.Name : null;
}
public string GetConstructorModifier ()
{
- if (CurrentContext.ParsedDocument == null)
+ var compilation = CurrentContext.Compilation;
+ if (compilation == null)
return null;
- IUnresolvedTypeDefinition type = null;
- var provider = CurrentContext.Document.GetContent<ITextEditorMemberPositionProvider>();
- if (provider == null) {
- type = CurrentContext.ParsedDocument.GetInnermostTypeDefinition (CurrentContext.InsertPosition.Line, CurrentContext.InsertPosition.Column);
- } else {
- type = provider.GetTypeAt (CurrentContext.Document.Editor.LocationToOffset (CurrentContext.InsertPosition));
- }
-
- if (type == null)
- return "";
- return type.IsStatic ? "static " : "public ";
+ var enclosingSymbol = compilation.GetEnclosingSymbol (CurrentContext.Editor.CaretOffset);
+
+ if (!(enclosingSymbol is ITypeSymbol))
+ enclosingSymbol = enclosingSymbol.ContainingType;
+
+ return enclosingSymbol != null && enclosingSymbol.IsStatic ? "static " : "public ";
}
public string GetLengthProperty (Func<string, string> callback, string varName)
@@ -132,101 +128,98 @@ namespace MonoDevelop.Ide.CodeTemplates
string var = callback (varName);
- ITextEditorResolver textEditorResolver = CurrentContext.Document.GetContent <ITextEditorResolver> ();
+ ITextEditorResolver textEditorResolver = CurrentContext.DocumentContext.GetContent <ITextEditorResolver> ();
if (textEditorResolver != null) {
- var result = textEditorResolver.GetLanguageItem (CurrentContext.Document.Editor.Document.LocationToOffset (CurrentContext.InsertPosition), var);
- if (result.Type.IsReferenceType.HasValue && !result.Type.IsReferenceType.Value)
- return "Length";
+ var result = textEditorResolver.GetLanguageItem (CurrentContext.Editor.LocationToOffset (CurrentContext.InsertPosition), var);
+ if (result != null) {
+ var returnType = result.GetReturnType ();
+ if (returnType != null && !returnType.IsReferenceType)
+ return "Length";
+ }
}
return "Count";
}
- IType GetElementType (IType result)
+ ITypeSymbol GetElementType (Compilation compilation, ITypeSymbol type)
{
- IType tmp = null;
- foreach (var baseType in result.GetAllBaseTypes ()) {
- var baseTypeDef = baseType.GetDefinition();
- if (baseTypeDef != null && baseTypeDef.Name == "IEnumerable") {
- if (baseTypeDef.Namespace == "System.Collections.Generic" && baseTypeDef.TypeParameterCount == 1) {
- if (baseType.TypeArguments.Count > 0)
- return baseType.TypeArguments[0];
- } else if (baseTypeDef.Namespace == "System.Collections" && baseTypeDef.TypeParameterCount == 0) {
- tmp = CurrentContext.Compilation.FindType (KnownTypeCode.Object);
+ ITypeSymbol tmp = null;
+ foreach (var baseType in type.AllInterfaces) {
+ if (baseType != null && baseType.Name == "IEnumerable") {
+ if (baseType.TypeArguments.Length > 0) {
+ return baseType.TypeArguments [0];
+ } else if (baseType.ContainingNamespace.ToDisplayString (Ambience.LabelFormat) == "System.Collections") {
+ tmp = compilation.GetSpecialType (SpecialType.System_Object);
}
}
}
- return tmp == null ? new UnknownType ("", "", 0) : tmp;
+ return tmp;
}
-
public string GetComponentTypeOf (Func<string, string> callback, string varName)
{
if (callback == null)
return "var";
-
+ var compilation = CurrentContext.Compilation;
+ if (compilation == null)
+ return null;
+
string var = callback (varName);
- ITextEditorResolver textEditorResolver = CurrentContext.Document.GetContent <ITextEditorResolver> ();
- if (textEditorResolver != null) {
- var result = textEditorResolver.GetLanguageItem (CurrentContext.Document.Editor.Caret.Offset, var);
- if (result != null) {
- var componentType = GetElementType (result.Type);
- if (componentType.Kind != TypeKind.Unknown) {
- var generator = CodeGenerator.CreateGenerator (CurrentContext.Document);
- if (generator != null)
- return generator.GetShortTypeString (CurrentContext.Document, componentType);
- }
- }
- }
-
+
+ var offset = CurrentContext.Editor.CaretOffset;
+ var sym = compilation.LookupSymbols (offset).First (s => s.Name == var);
+ if (sym == null)
+ return "var";
+ var rt = sym.GetReturnType ();
+ if (rt != null)
+ return rt.ToMinimalDisplayString (compilation, offset);
return "var";
}
- MonoDevelop.Ide.CodeCompletion.ICompletionDataList list;
+
+ ICompletionDataList list;
public IListDataProvider<string> GetCollections ()
{
var result = new List<CodeTemplateVariableValue> ();
- var ext = CurrentContext.Document.GetContent <CompletionTextEditorExtension> ();
+ var ext = CurrentContext.DocumentContext.GetContent <CompletionTextEditorExtension> ();
+ var analysisProject = TypeSystemService.GetCodeAnalysisProject (CurrentContext.DocumentContext.Project);
+ var compilation = analysisProject != null ? analysisProject.GetCompilationAsync ().Result : null;
+
if (ext != null) {
if (list == null)
list = ext.CodeCompletionCommand (
- CurrentContext.Document.GetContent <MonoDevelop.Ide.CodeCompletion.ICompletionWidget> ().CurrentCodeCompletionContext);
+ CurrentContext.DocumentContext.GetContent <MonoDevelop.Ide.CodeCompletion.ICompletionWidget> ().CurrentCodeCompletionContext).Result;
- foreach (object o in list) {
- var data = o as IEntityCompletionData;
- if (data == null)
+ foreach (var data in list.OfType<ISymbolCompletionData> ()) {
+ if (data.Symbol == null)
continue;
-
- if (data.Entity is IMember) {
- var m = data.Entity as IMember;
- if (GetElementType (m.ReturnType).Kind != TypeKind.Unknown) {
- if (m is IMethod) {
- if (((IMethod)m).Parameters.Count == 0)
- result.Add (new CodeTemplateVariableValue (m.Name + " ()", ((CompletionData)data).Icon));
- continue;
- }
-
- result.Add (new CodeTemplateVariableValue (m.Name, ((CompletionData)data).Icon));
+ var type = data.Symbol.GetReturnType ();
+ if (type == null)
+ continue;
+ if (GetElementType (compilation, type) != null) {
+ var method = data as IMethodSymbol;
+ if (method != null) {
+ if (method.Parameters.Length == 0)
+ result.Add (new CodeTemplateVariableValue (data.Symbol.Name + " ()", ((CompletionData)data).Icon));
+ continue;
}
+
+ result.Add (new CodeTemplateVariableValue (data.Symbol.Name, ((CompletionData)data).Icon));
}
}
- foreach (object o in list) {
- var data = o as IEntityCompletionData;
- if (data == null)
- continue;
- if (data.Entity is IParameter) {
- var m = data.Entity as IParameter;
- if (GetElementType (m.Type).Kind != TypeKind.Unknown)
+ foreach (var data in list.OfType<ISymbolCompletionData> ()) {
+ var m = data.Symbol as IParameterSymbol;
+ if (m != null) {
+ if (GetElementType (compilation, m.Type) != null)
result.Add (new CodeTemplateVariableValue (m.Name, ((CompletionData)data).Icon));
}
}
- foreach (object o in list) {
- var data = o as IVariableCompletionData;
- if (data == null)
+ foreach (var sym in list.OfType<ISymbolCompletionData> ()) {
+ var m = sym.Symbol as ILocalSymbol;
+ if (m == null)
continue;
- var m = data.Variable;
- if (GetElementType (m.Type).Kind != TypeKind.Unknown)
- result.Add (new CodeTemplateVariableValue (m.Name, ((CompletionData)data).Icon));
+ if (GetElementType (compilation, m.Type) != null)
+ result.Add (new CodeTemplateVariableValue (m.Name, ((CompletionData)sym).Icon));
}
}
return new CodeTemplateListDataProvider (result);
@@ -234,7 +227,8 @@ namespace MonoDevelop.Ide.CodeTemplates
public string GetSimpleTypeName (string fullTypeName)
{
- if (CurrentContext.ParsedDocument == null)
+ var compilation = CurrentContext.Compilation;
+ if (compilation == null)
return fullTypeName.Replace ("#", ".");
string ns = "";
string name = "";
@@ -250,31 +244,21 @@ namespace MonoDevelop.Ide.CodeTemplates
idx = name.IndexOf ('.');
if (idx >= 0) {
- member = name.Substring (idx);
+ member = name.Substring (idx + 1);
name = name.Substring (0, idx);
}
- var type = new GetClassTypeReference (ns, name, 0).Resolve (new SimpleTypeResolveContext (CurrentContext.Document.Compilation.MainAssembly));
- bool stripAttribute = false;
- if (type == null || type.Kind == TypeKind.Unknown) {
- type = new GetClassTypeReference (ns, name + "Attribute", 0).Resolve (
- new SimpleTypeResolveContext (CurrentContext.Document.Compilation.MainAssembly)
- );
- stripAttribute = true;
- }
- if (type == null || type.Kind == TypeKind.Unknown)
- return fullTypeName.Replace ("#", ".");
- var generator = CodeGenerator.CreateGenerator (CurrentContext.Document);
- if (generator != null) {
- var result = generator.GetShortTypeString (CurrentContext.Document, type) + member;
- if (stripAttribute && result.EndsWith ("Attribute", StringComparison.Ordinal))
- result = result.Substring (0, result.Length - "Attribute".Length);
- return result;
+ var metadataName = string.IsNullOrEmpty (ns) ? name : ns + "." + name;
+ var type = compilation.Compilation.GetTypeByMetadataName (metadataName);
+ if (type != null) {
+ var minimalName = type.ToMinimalDisplayString (compilation, CurrentContext.Editor.CaretOffset);
+ return string.IsNullOrEmpty (member) ? minimalName : minimalName + "." + member;
}
return fullTypeName.Replace ("#", ".");
}
- static Regex functionRegEx = new Regex ("([^(]*)\\(([^(]*)\\)", RegexOptions.Compiled);
+
+ static System.Text.RegularExpressions.Regex functionRegEx = new System.Text.RegularExpressions.Regex ("([^(]*)\\(([^(]*)\\)", RegexOptions.Compiled);
// We should use reflection here (but for 5 functions it doesn't hurt) !!! - Mike
@@ -295,7 +279,7 @@ namespace MonoDevelop.Ide.CodeTemplates
public virtual IListDataProvider<string> RunFunction (TemplateContext context, Func<string, string> callback, string function)
{
this.CurrentContext = context;
- Match match = functionRegEx.Match (function);
+ var match = functionRegEx.Match (function);
if (!match.Success)
return null;
string name = match.Groups[1].Value;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/IListDataProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/IListDataProvider.cs
new file mode 100644
index 0000000000..b1d02b8310
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/IListDataProvider.cs
@@ -0,0 +1,51 @@
+//
+// IListDataProvider.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Ide.CodeTemplates
+{
+ public interface IListDataProvider<T>
+ {
+ int Count {
+ get;
+ }
+
+ T this[int index] {
+ get;
+ }
+
+ Xwt.Drawing.Image GetIcon (int index);
+ string GetText (int index);
+ }
+
+ public interface IMarkupListDataProvider<T> : IListDataProvider<T>
+ {
+ bool HasMarkup (int index);
+ string GetMarkup (int index);
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml
index 911fd48dcb..1b3ab54445 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/MonoDevelop-templates.xml
@@ -878,9 +878,9 @@ $selected$$end$
</Variable>
</Variables>
<Code><![CDATA[try {
- $selected$
+ $selected$$end$
} catch ($SystemException$ ex) {
- $end$
+
}]]></Code>
</CodeTemplate>
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/PadCodon.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/PadCodon.cs
index 7dcb3aed97..d8abe37a83 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/PadCodon.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/PadCodon.cs
@@ -43,9 +43,9 @@ using System.IO;
namespace MonoDevelop.Ide.Codons
{
[ExtensionNode ("Pad", "Registers a pad to be shown in the workbench.")]
- public class PadCodon : ExtensionNode, IDockItemLabelProvider
+ public class PadCodon : ExtensionNode
{
- IPadContent content;
+ PadContent content;
string id;
[NodeAttribute("_label", "Display name of the pad.", Localizable=true)]
@@ -70,34 +70,27 @@ namespace MonoDevelop.Ide.Codons
[NodeAttribute ("defaultStatus", "Default status ofthe pad. It can be 'Dockable', 'Floating', 'AutoHide'.")]
DockItemStatus defaultStatus = DockItemStatus.Dockable;
- [NodeAttribute("dockLabelProvider", "Name of a class implementing IDockItemLabelProvider. " +
- "Using this class it is possible to use a custom widget as label when the item" +
- "is docked in auto-hide mode.")]
- string dockLabelProvider = null;
-
[NodeAttribute ("defaultLayout", "Name of the layouts (comma separated list) on which this pad should be visible by default")]
string[] defaultLayouts;
- IDockItemLabelProvider cachedDockLabelProvider;
bool initializeCalled;
- public IPadContent PadContent {
+ public PadContent PadContent {
get {
return content;
}
}
- public IPadContent InitializePadContent (IPadWindow window)
+ public PadContent InitializePadContent (IPadWindow window)
{
if (content == null) {
content = CreatePad ();
- content.Initialize (window);
- ApplyPreferences ();
- } else if (!initializeCalled) {
- content.Initialize (window);
+ }
+ if (!initializeCalled) {
+ content.Init (window);
ApplyPreferences ();
+ initializeCalled = true;
}
- initializeCalled = true;
return content;
}
@@ -148,12 +141,12 @@ namespace MonoDevelop.Ide.Codons
{
}
- public PadCodon (IPadContent content, string id, string label, string defaultPlacement, string icon)
+ public PadCodon (PadContent content, string id, string label, string defaultPlacement, string icon)
: this (content, id, label, defaultPlacement, DockItemStatus.Dockable, icon)
{
}
- public PadCodon (IPadContent content, string id, string label, string defaultPlacement, DockItemStatus defaultStatus, string icon)
+ public PadCodon (PadContent content, string id, string label, string defaultPlacement, DockItemStatus defaultStatus, string icon)
{
this.id = id;
this.content = content;
@@ -163,21 +156,12 @@ namespace MonoDevelop.Ide.Codons
this.defaultStatus = defaultStatus;
}
- protected virtual IPadContent CreatePad ()
+ protected virtual PadContent CreatePad ()
{
Counters.PadsLoaded++;
- return (IPadContent) Addin.CreateInstance (className, true);
+ return (PadContent) Addin.CreateInstance (className, true);
}
- Gtk.Widget IDockItemLabelProvider.CreateLabel (Gtk.Orientation orientation)
- {
- if (dockLabelProvider == null)
- return null;
- if (cachedDockLabelProvider == null)
- cachedDockLabelProvider = (IDockItemLabelProvider) Addin.CreateInstance (dockLabelProvider, true);
- return cachedDockLabelProvider.CreateLabel (orientation);
- }
-
PadUserPrefs preferences = null;
internal void SetPreferences (PadUserPrefs pi)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/ProjectActiveCondition.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/ProjectActiveCondition.cs
index 4c3b9bf860..e91c9edc7d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/ProjectActiveCondition.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/ProjectActiveCondition.cs
@@ -62,7 +62,7 @@ namespace MonoDevelop.Ide.Codons
if (activeproject == "*") {
return project != null;
}
- return project != null && project.GetProjectTypes ().All (p => p != activeproject);
+ return project != null && project.GetTypeTags ().All (p => p != activeproject);
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/SolutionPadCodon.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/SolutionPadCodon.cs
index 634bbcc02f..4c1bd3c34a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/SolutionPadCodon.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Codons/SolutionPadCodon.cs
@@ -73,7 +73,7 @@ namespace MonoDevelop.Ide.Codons
options = (TreePadOption[]) ops.ToArray (typeof(TreePadOption));
}
- protected override IPadContent CreatePad ()
+ protected override PadContent CreatePad ()
{
if (builders == null)
BuildChildren ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/CustomStringTagProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/CustomStringTagProvider.cs
index b39ae14707..15f096ced4 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/CustomStringTagProvider.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/CustomStringTagProvider.cs
@@ -87,17 +87,17 @@ namespace MonoDevelop.Ide.Commands
case "CURLINE":
if (wb.ActiveDocument != null && wb.ActiveDocument.Editor != null)
- return wb.ActiveDocument.Editor.Caret.Line;
+ return wb.ActiveDocument.Editor.CaretLocation.Line;
return null;
case "CURCOLUMN":
if (wb.ActiveDocument != null && wb.ActiveDocument.Editor != null)
- return wb.ActiveDocument.Editor.Caret.Column;
+ return wb.ActiveDocument.Editor.CaretLocation.Column;
return null;
case "CUROFFSET":
if (wb.ActiveDocument != null && wb.ActiveDocument.Editor != null)
- return wb.ActiveDocument.Editor.Caret.Offset;
+ return wb.ActiveDocument.Editor.CaretOffset;
return null;
case "CURTEXT":
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/EditCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/EditCommands.cs
index 1ebdb497bd..22211b010e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/EditCommands.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/EditCommands.cs
@@ -56,7 +56,6 @@ namespace MonoDevelop.Ide.Commands
RemoveTrailingWhiteSpaces,
JoinWithNextLine,
- WordCount,
MonodevelopPreferences,
DefaultPolicies,
InsertStandardHeader,
@@ -157,6 +156,15 @@ namespace MonoDevelop.Ide.Commands
{
protected override void Run ()
{
+ #if WIN32
+ var wintv = System.Windows.Input.Keyboard.FocusedElement;
+ var cmd = System.Windows.Input.ApplicationCommands.Copy;
+ if (wintv != null && cmd.CanExecute (null, wintv)) {
+ cmd.Execute (null, wintv);
+ return;
+ }
+ #endif
+
if (IdeApp.Workbench.RootWindow.HasToplevelFocus) {
Gtk.Editable editable = IdeApp.Workbench.RootWindow.Focus as Gtk.Editable;
if (editable != null) {
@@ -169,24 +177,28 @@ namespace MonoDevelop.Ide.Commands
tv.Buffer.CopyClipboard (clipboard);
return;
}
- #if MAC
+#if MAC
var mactv = AppKit.NSApplication.SharedApplication.KeyWindow.FirstResponder as AppKit.NSText;
if (mactv != null) {
mactv.Copy (mactv);
return;
}
- #endif
+#endif
}
}
-
+
protected override void Update (CommandInfo info)
{
object focus = IdeApp.Workbench.RootWindow.HasToplevelFocus ? IdeApp.Workbench.RootWindow.Focus : null;
info.Enabled = (focus is Gtk.Editable || focus is Gtk.TextView);
- #if MAC
- var macfocus = AppKit.NSApplication.SharedApplication.KeyWindow.FirstResponder;
+#if MAC
+ var macfocus = AppKit.NSApplication.SharedApplication?.KeyWindow?.FirstResponder;
info.Enabled |= macfocus is AppKit.NSText;
- #endif
+#endif
+#if WIN32
+ var winfocus = System.Windows.Input.Keyboard.FocusedElement;
+ info.Enabled |= winfocus != null;
+#endif
info.Bypass = !info.Enabled;
}
}
@@ -195,6 +207,15 @@ namespace MonoDevelop.Ide.Commands
{
protected override void Run ()
{
+ #if WIN32
+ var wintv = System.Windows.Input.Keyboard.FocusedElement;
+ var cmd = System.Windows.Input.ApplicationCommands.Cut;
+ if (wintv != null && cmd.CanExecute(null, wintv)) {
+ cmd.Execute(null, wintv);
+ return;
+ }
+ #endif
+
if (IdeApp.Workbench.RootWindow.HasToplevelFocus) {
Gtk.Editable editable = IdeApp.Workbench.RootWindow.Focus as Gtk.Editable;
if (editable != null) {
@@ -207,16 +228,16 @@ namespace MonoDevelop.Ide.Commands
tv.Buffer.CutClipboard (clipboard, true);
return;
}
- #if MAC
+#if MAC
var mactv = AppKit.NSApplication.SharedApplication.KeyWindow.FirstResponder as AppKit.NSText;
if (mactv != null) {
mactv.Cut (mactv);
return;
}
- #endif
+#endif
}
}
-
+
protected override void Update (CommandInfo info)
{
object focus = IdeApp.Workbench.RootWindow.HasToplevelFocus ? IdeApp.Workbench.RootWindow.Focus : null;
@@ -227,10 +248,15 @@ namespace MonoDevelop.Ide.Commands
else
info.Enabled = false;
- #if MAC
- var macfocus = AppKit.NSApplication.SharedApplication.KeyWindow.FirstResponder;
+#if MAC
+ var macfocus = AppKit.NSApplication.SharedApplication?.KeyWindow?.FirstResponder;
info.Enabled |= macfocus is AppKit.NSText;
- #endif
+#endif
+
+#if WIN32
+ var winfocus = System.Windows.Input.Keyboard.FocusedElement;
+ info.Enabled |= winfocus != null;
+#endif
info.Bypass = !info.Enabled;
}
@@ -240,6 +266,14 @@ namespace MonoDevelop.Ide.Commands
{
protected override void Run ()
{
+ #if WIN32
+ var wintv = System.Windows.Input.Keyboard.FocusedElement;
+ var cmd = System.Windows.Input.ApplicationCommands.Paste;
+ if (wintv != null && cmd.CanExecute (null, wintv)) {
+ cmd.Execute (null, wintv);
+ return;
+ }
+ #endif
if (IdeApp.Workbench.RootWindow.HasToplevelFocus) {
Gtk.Editable editable = IdeApp.Workbench.RootWindow.Focus as Gtk.Editable;
if (editable != null) {
@@ -252,16 +286,16 @@ namespace MonoDevelop.Ide.Commands
tv.Buffer.PasteClipboard (clipboard);
return;
}
- #if MAC
+#if MAC
var mactv = AppKit.NSApplication.SharedApplication.KeyWindow.FirstResponder as AppKit.NSText;
if (mactv != null) {
mactv.Paste (mactv);
return;
}
- #endif
+#endif
}
}
-
+
protected override void Update (CommandInfo info)
{
object focus = IdeApp.Workbench.RootWindow.HasToplevelFocus ? IdeApp.Workbench.RootWindow.Focus : null;
@@ -272,10 +306,15 @@ namespace MonoDevelop.Ide.Commands
else
info.Enabled = false;
- #if MAC
- var macfocus = AppKit.NSApplication.SharedApplication.KeyWindow.FirstResponder;
+#if MAC
+ var macfocus = AppKit.NSApplication.SharedApplication?.KeyWindow?.FirstResponder;
info.Enabled |= macfocus is AppKit.NSText;
- #endif
+#endif
+
+#if WIN32
+ var winfocus = System.Windows.Input.Keyboard.FocusedElement;
+ info.Enabled |= winfocus != null;
+#endif
info.Bypass = !info.Enabled;
}
@@ -287,7 +326,7 @@ namespace MonoDevelop.Ide.Commands
{
Document doc = IdeApp.Workbench.ActiveDocument;
string header = MonoDevelop.Ide.StandardHeader.StandardHeaderService.GetHeader (doc.Project, doc.Name, false);
- doc.Editor.Insert (0, header + "\n");
+ doc.Editor.InsertText (0, header + "\n");
}
protected override void Update (CommandInfo info)
@@ -304,6 +343,14 @@ namespace MonoDevelop.Ide.Commands
{
protected override void Run ()
{
+ #if WIN32
+ var wintv = System.Windows.Input.Keyboard.FocusedElement;
+ var cmd = System.Windows.Input.ApplicationCommands.SelectAll;
+ if (wintv != null && cmd.CanExecute (null, wintv)) {
+ cmd.Execute (null, wintv);
+ return;
+ }
+ #endif
if (IdeApp.Workbench.RootWindow.HasToplevelFocus) {
Gtk.Editable editable = IdeApp.Workbench.RootWindow.Focus as Gtk.Editable;
if (editable != null) {
@@ -315,25 +362,31 @@ namespace MonoDevelop.Ide.Commands
tv.Buffer.SelectRange (tv.Buffer.StartIter, tv.Buffer.EndIter);
return;
}
- #if MAC
+#if MAC
var mactv = AppKit.NSApplication.SharedApplication.KeyWindow.FirstResponder as AppKit.NSText;
if (mactv != null) {
mactv.SelectAll (mactv);
return;
}
- #endif
+#endif
}
}
-
+
protected override void Update (CommandInfo info)
{
object focus = IdeApp.Workbench.RootWindow.HasToplevelFocus ? IdeApp.Workbench.RootWindow.Focus : null;
- info.Enabled = (focus is Gtk.Editable || focus is Gtk.TextView);
+ info.Enabled = (focus is Gtk.Editable || focus is Gtk.TextView);
+ info.Bypass = !IdeApp.Workbench.RootWindow.HasToplevelFocus;
- #if MAC
- var macfocus = AppKit.NSApplication.SharedApplication.KeyWindow.FirstResponder;
+#if MAC
+ var macfocus = AppKit.NSApplication.SharedApplication?.KeyWindow?.FirstResponder;
info.Enabled |= macfocus is AppKit.NSText;
- #endif
+#endif
+
+#if WIN32
+ var winfocus = System.Windows.Input.Keyboard.FocusedElement;
+ info.Enabled |= winfocus != null;
+#endif
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs
index cba2475b4a..dfeea4fe2d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs
@@ -38,6 +38,8 @@ using Gtk;
using MonoDevelop.Ide.Projects;
using MonoDevelop.Ide.Desktop;
using System.Linq;
+using MonoDevelop.Components;
+using MonoDevelop.Components.Extensions;
namespace MonoDevelop.Ide.Commands
{
@@ -293,7 +295,7 @@ namespace MonoDevelop.Ide.Commands
protected override void Run (object dataItem)
{
- IdeApp.Workbench.OpenDocument ((string)dataItem);
+ IdeApp.Workbench.OpenDocument ((string)dataItem, project: null);
}
}
@@ -340,8 +342,8 @@ namespace MonoDevelop.Ide.Commands
try {
if (!File.Exists (ri.FileName))
continue;
- icon = IdeApp.Services.ProjectService.FileFormats.GetFileFormats
- (ri.FileName, typeof(Solution)).Length > 0? "md-solution": "md-workspace";
+
+ icon = IdeApp.Services.ProjectService.FileIsObjectOfType (ri.FileName, typeof(Solution)) ? "md-solution": "md-workspace";
}
catch (UnauthorizedAccessException exAccess) {
LoggingService.LogWarning ("Error building recent solutions list (Permissions)", exAccess);
@@ -374,7 +376,7 @@ namespace MonoDevelop.Ide.Commands
protected override void Run (object dataItem)
{
string filename = (string)dataItem;
- Gdk.ModifierType mtype = Mono.TextEditor.GtkWorkarounds.GetCurrentKeyModifiers ();
+ Gdk.ModifierType mtype = GtkWorkarounds.GetCurrentKeyModifiers ();
bool inWorkspace = (mtype & Gdk.ModifierType.ControlMask) != 0;
IdeApp.Workspace.OpenWorkspaceItem (filename, !inWorkspace);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs
index 20ace23f75..ae70c81ae8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs
@@ -50,7 +50,7 @@ namespace MonoDevelop.Ide.Commands
class CloseAllHandler : CommandHandler
{
- protected virtual IViewContent GetDocumentException ()
+ protected virtual ViewContent GetDocumentException ()
{
return null;
}
@@ -86,7 +86,7 @@ namespace MonoDevelop.Ide.Commands
class CloseAllButThisHandler : CloseAllHandler
{
- protected override IViewContent GetDocumentException ()
+ protected override ViewContent GetDocumentException ()
{
var active = IdeApp.Workbench.ActiveDocument;
return active == null ? null : active.Window.ViewContent;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/HelpCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/HelpCommands.cs
index 623c3d4dd4..7af7b25668 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/HelpCommands.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/HelpCommands.cs
@@ -90,6 +90,12 @@ namespace MonoDevelop.Ide.Commands
{
CommonAboutDialog.ShowAboutDialog ();
}
+
+ protected override void Update (CommandInfo info)
+ {
+ base.Update (info);
+ info.Icon = MonoDevelop.Core.BrandingService.HelpAboutIconId;
+ }
}
class SendFeedbackHandler : CommandHandler
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ProjectCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ProjectCommands.cs
index a121725c3a..5cf0e07f6a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ProjectCommands.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ProjectCommands.cs
@@ -114,7 +114,7 @@ namespace MonoDevelop.Ide.Commands
protected override void Run ()
{
- IdeApp.ProjectOperations.ShowOptions (IdeApp.ProjectOperations.CurrentSelectedBuildTarget);
+ IdeApp.ProjectOperations.ShowOptions (IdeApp.ProjectOperations.CurrentSelectedObject);
}
}
@@ -127,7 +127,7 @@ namespace MonoDevelop.Ide.Commands
protected override void Run ()
{
- IdeApp.ProjectOperations.ShowOptions (IdeApp.ProjectOperations.CurrentSelectedBuildTarget);
+ IdeApp.ProjectOperations.ShowOptions (IdeApp.ProjectOperations.CurrentSelectedObject);
}
}
@@ -143,12 +143,12 @@ namespace MonoDevelop.Ide.Commands
info.Bypass = false;
}
- protected override void Run ()
+ protected override async void Run ()
{
//Edit references
DotNetProject p = IdeApp.ProjectOperations.CurrentSelectedProject as DotNetProject;
if (IdeApp.ProjectOperations.AddReferenceToProject (p))
- IdeApp.ProjectOperations.Save (p);
+ await IdeApp.ProjectOperations.SaveAsync (p);
}
}
@@ -173,7 +173,7 @@ namespace MonoDevelop.Ide.Commands
{
if (IdeApp.Workspace.IsOpen) {
IBuildTarget buildTarget = IdeApp.ProjectOperations.CurrentSelectedBuildTarget;
- info.Enabled = ((buildTarget != null) && (IdeApp.ProjectOperations.CurrentBuildOperation.IsCompleted)) && buildTarget.SupportsTarget (ProjectService.BuildTarget);
+ info.Enabled = (buildTarget != null) && (IdeApp.ProjectOperations.CurrentBuildOperation.IsCompleted) && buildTarget.CanBuild (IdeApp.Workspace.ActiveConfiguration);
if (buildTarget != null) {
info.Text = GettextCatalog.GetString ("B_uild {0}", buildTarget.Name.Replace ("_","__"));
if (buildTarget is SolutionFolder)
@@ -184,24 +184,13 @@ namespace MonoDevelop.Ide.Commands
info.Description = GettextCatalog.GetString ("Build {0}", buildTarget.Name);
}
}
- else {
- info.Enabled = ((IdeApp.Workbench.ActiveDocument != null) && (IdeApp.Workbench.ActiveDocument.IsBuildTarget) && (IdeApp.ProjectOperations.CurrentBuildOperation.IsCompleted));
- if (IdeApp.Workbench.ActiveDocument != null) {
- info.Text = GettextCatalog.GetString ("B_uild {0}", Path.GetFileName (IdeApp.Workbench.ActiveDocument.Name).Replace ("_","__"));
- info.Description = GettextCatalog.GetString ("Build {0}", Path.GetFileName (IdeApp.Workbench.ActiveDocument.Name));
- }
- }
+ else
+ info.Enabled = false;
}
protected override void Run ()
{
- if (IdeApp.Workspace.IsOpen) {
- IdeApp.ProjectOperations.Build (IdeApp.ProjectOperations.CurrentSelectedBuildTarget);
- }
- else {
- IdeApp.Workbench.ActiveDocument.Save ();
- IdeApp.Workbench.ActiveDocument.Build ();
- }
+ IdeApp.ProjectOperations.Build (IdeApp.ProjectOperations.CurrentSelectedBuildTarget);
}
}
@@ -225,30 +214,19 @@ namespace MonoDevelop.Ide.Commands
{
if (IdeApp.Workspace.IsOpen) {
IBuildTarget buildTarget = IdeApp.ProjectOperations.CurrentSelectedBuildTarget;
- info.Enabled = ((buildTarget != null) && (IdeApp.ProjectOperations.CurrentBuildOperation.IsCompleted)) && buildTarget.SupportsTarget (ProjectService.BuildTarget);
+ info.Enabled = (buildTarget != null) && (IdeApp.ProjectOperations.CurrentBuildOperation.IsCompleted) && buildTarget.CanBuild (IdeApp.Workspace.ActiveConfiguration);
if (buildTarget != null) {
info.Text = GettextCatalog.GetString ("R_ebuild {0}", IdeApp.ProjectOperations.CurrentSelectedBuildTarget.Name.Replace ("_","__"));
info.Description = GettextCatalog.GetString ("Rebuild {0}", IdeApp.ProjectOperations.CurrentSelectedBuildTarget.Name);
}
}
- else {
- info.Enabled = ((IdeApp.Workbench.ActiveDocument != null) && (IdeApp.Workbench.ActiveDocument.IsBuildTarget) && (IdeApp.ProjectOperations.CurrentBuildOperation.IsCompleted));
- if (info.Enabled) {
- info.Text = GettextCatalog.GetString ("R_ebuild {0}", IdeApp.Workbench.ActiveDocument.FileName.FileName.Replace ("_","__"));
- info.Description = GettextCatalog.GetString ("Rebuild {0}", IdeApp.Workbench.ActiveDocument.FileName);
- }
- }
+ else
+ info.Enabled = false;
}
protected override void Run ()
{
- if (IdeApp.Workspace.IsOpen) {
- IdeApp.ProjectOperations.Rebuild (IdeApp.ProjectOperations.CurrentSelectedBuildTarget);
- }
- else {
- IdeApp.Workbench.ActiveDocument.Save ();
- IdeApp.Workbench.ActiveDocument.Rebuild ();
- }
+ IdeApp.ProjectOperations.Rebuild (IdeApp.ProjectOperations.CurrentSelectedBuildTarget);
}
}
@@ -273,42 +251,26 @@ namespace MonoDevelop.Ide.Commands
public static bool CanRun (IExecutionHandler executionHandler)
{
- if (IdeApp.Workspace.IsOpen) {
+ if (IdeApp.Workspace.IsOpen) {
var target = GetRunTarget ();
return target != null && IdeApp.ProjectOperations.CanExecute (target, executionHandler);
- }
- else
- return (IdeApp.Workbench.ActiveDocument != null) && (IdeApp.Workbench.ActiveDocument.CanRun (executionHandler));
+ } else
+ return false;
}
- public static void RunMethod (IExecutionHandler executionHandler)
+ public static async void RunMethod (IExecutionHandler executionHandler)
{
if (!IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted) {
if (!MessageService.Confirm (GettextCatalog.GetString ("An application is already running. Do you want to stop it?"), AlertButton.Stop))
return;
StopHandler.StopBuildOperations ();
- IdeApp.ProjectOperations.CurrentRunOperation.WaitForCompleted ();
- }
-
- if (!IdeApp.Workspace.IsOpen) {
- if (!IdeApp.Preferences.BuildBeforeExecuting)
- IdeApp.Workbench.ActiveDocument.Run (executionHandler);
- else {
- IAsyncOperation asyncOperation = IdeApp.Workbench.ActiveDocument.Build ();
- asyncOperation.Completed += delegate {
- if ((asyncOperation.Success) || (IdeApp.Preferences.RunWithWarnings && asyncOperation.SuccessWithWarnings))
- IdeApp.Workbench.ActiveDocument.Run (executionHandler);
- };
- }
- return;
+ await IdeApp.ProjectOperations.CurrentRunOperation.Task;
}
- var target = GetRunTarget ();
- var op = IdeApp.ProjectOperations.CheckAndBuildForExecute (target);
- op.Completed += delegate {
- if (op.Success)
- IdeApp.ProjectOperations.Execute (target, executionHandler);
- };
+ if (IdeApp.Workspace.IsOpen) {
+ var target = GetRunTarget ();
+ IdeApp.ProjectOperations.Execute (target, executionHandler, true);
+ }
}
protected override void Run ()
@@ -350,11 +312,7 @@ namespace MonoDevelop.Ide.Commands
protected override void Run ()
{
var target = IdeApp.ProjectOperations.CurrentSelectedBuildTarget;
- var op = IdeApp.ProjectOperations.CheckAndBuildForExecute (target);
- op.Completed += delegate {
- if (op.Success)
- IdeApp.ProjectOperations.Execute (target);
- };
+ IdeApp.ProjectOperations.Execute (target);
}
}
@@ -362,7 +320,7 @@ namespace MonoDevelop.Ide.Commands
{
protected override void Update (CommandArrayInfo info)
{
- SolutionEntityItem item = IdeApp.ProjectOperations.CurrentSelectedBuildTarget as SolutionEntityItem;
+ SolutionItem item = IdeApp.ProjectOperations.CurrentSelectedBuildTarget as SolutionItem;
if (item != null) {
ExecutionModeCommandService.GenerateExecutionModeCommands (
item,
@@ -380,11 +338,7 @@ namespace MonoDevelop.Ide.Commands
if (h == null || !IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted)
return;
- var op = IdeApp.ProjectOperations.CheckAndBuildForExecute (target);
- op.Completed += delegate {
- if (op.Success)
- IdeApp.ProjectOperations.Execute (target, h);
- };
+ IdeApp.ProjectOperations.Execute (target, h);
}
}
@@ -395,7 +349,7 @@ namespace MonoDevelop.Ide.Commands
if (IdeApp.ProjectOperations.CurrentSelectedBuildTarget == null)
info.Enabled = false;
else {
- info.Enabled = IdeApp.ProjectOperations.CurrentSelectedBuildTarget.SupportsTarget (ProjectService.BuildTarget);
+ info.Enabled = IdeApp.ProjectOperations.CurrentSelectedBuildTarget.CanBuild (IdeApp.Workspace.ActiveConfiguration);
info.Text = GettextCatalog.GetString ("C_lean {0}", IdeApp.ProjectOperations.CurrentSelectedBuildTarget.Name.Replace ("_","__"));
info.Description = GettextCatalog.GetString ("Clean {0}", IdeApp.ProjectOperations.CurrentSelectedBuildTarget.Name);
}
@@ -459,9 +413,9 @@ namespace MonoDevelop.Ide.Commands
protected override void Run (object dataItem)
{
- IWorkspaceObject ce = IdeApp.ProjectOperations.CurrentSelectedBuildTarget;
+ var ce = IdeApp.ProjectOperations.CurrentSelectedBuildTarget as WorkspaceObject;
CustomCommand cmd = (CustomCommand) dataItem;
- IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetRunProgressMonitor ();
+ ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetRunProgressMonitor ();
Thread t = new Thread (
delegate () {
@@ -484,18 +438,18 @@ namespace MonoDevelop.Ide.Commands
protected override void Update (CommandInfo info)
{
// FIXME: Once we fix Workspaces to offer Visual Studio formats (instead of the deprecated MonoDevelop 1.0 format), we can allow exporting of Workspaces as well.
- if (!(IdeApp.ProjectOperations.CurrentSelectedItem is Solution) && !(IdeApp.ProjectOperations.CurrentSelectedItem is SolutionEntityItem))
+ if (!(IdeApp.ProjectOperations.CurrentSelectedItem is Solution) && !(IdeApp.ProjectOperations.CurrentSelectedItem is SolutionItem))
info.Enabled = false;
}
protected override void Run ()
{
- WorkspaceItem workspace;
+ Solution workspace;
if (!(IdeApp.ProjectOperations.CurrentSelectedItem is WorkspaceItem))
- workspace = ((SolutionEntityItem) IdeApp.ProjectOperations.CurrentSelectedItem).ParentSolution;
+ workspace = ((SolutionItem) IdeApp.ProjectOperations.CurrentSelectedItem).ParentSolution;
else
- workspace = (WorkspaceItem) IdeApp.ProjectOperations.CurrentSelectedItem;
+ workspace = (Solution) IdeApp.ProjectOperations.CurrentSelectedItem;
IdeApp.ProjectOperations.Export (workspace, null);
}
@@ -548,8 +502,16 @@ namespace MonoDevelop.Ide.Commands
protected override void Run ()
{
- using (ApplyPolicyDialog dlg = new ApplyPolicyDialog ((IPolicyProvider)IdeApp.ProjectOperations.CurrentSelectedSolutionItem ?? (IPolicyProvider)IdeApp.ProjectOperations.CurrentSelectedSolution))
- MessageService.ShowCustomDialog (dlg);
+ Project project = IdeApp.ProjectOperations.CurrentSelectedProject;
+ Solution solution = IdeApp.ProjectOperations.CurrentSelectedSolution;
+ using (var dlg = new ApplyPolicyDialog ((IPolicyProvider)IdeApp.ProjectOperations.CurrentSelectedSolutionItem ?? (IPolicyProvider)solution)) {
+ if (MessageService.ShowCustomDialog (dlg) == (int)Gtk.ResponseType.Ok) {
+ if (project != null)
+ IdeApp.ProjectOperations.SaveAsync (project);
+ else
+ IdeApp.ProjectOperations.SaveAsync (solution);
+ }
+ }
}
}
@@ -571,17 +533,15 @@ namespace MonoDevelop.Ide.Commands
{
protected override void Update (CommandInfo info)
{
- //TODO: Roslyn, switch back to SupportsTarget check
- //info.Enabled = (IdeApp.ProjectOperations.CurrentSelectedSolution != null) &&
- // (IdeApp.ProjectOperations.CurrentBuildOperation.IsCompleted) &&
- // IdeApp.ProjectOperations.CurrentSelectedSolution.GetAllProjects ().Any (p => p.SupportsTarget ("RunCodeAnalysis"));
- info.Enabled = true;
+ info.Enabled = (IdeApp.ProjectOperations.CurrentSelectedSolution != null) &&
+ (IdeApp.ProjectOperations.CurrentBuildOperation.IsCompleted) &&
+ IdeApp.ProjectOperations.CurrentSelectedSolution.GetAllProjects ().Any (p => p.SupportsTarget ("RunCodeAnalysis"));
}
protected override void Run ()
{
var context = new ProjectOperationContext ();
- context.GlobalProperties.Add ("RunCodeAnalysisOnce", "true");
+ context.GlobalProperties.SetValue ("RunCodeAnalysisOnce", "true");
IdeApp.ProjectOperations.Rebuild (IdeApp.ProjectOperations.CurrentSelectedSolution, context);
}
}
@@ -593,8 +553,7 @@ namespace MonoDevelop.Ide.Commands
if (IdeApp.Workspace.IsOpen) {
var project = IdeApp.ProjectOperations.CurrentSelectedProject;
if (project != null) {
- //TODO: Roslyn, switch back to SupportsTarget check
- info.Enabled = true;//project.SupportsTarget ("RunCodeAnalysis");
+ info.Enabled = project.SupportsTarget ("RunCodeAnalysis");
info.Text = GettextCatalog.GetString ("Run Code Analysis on {0}", project.Name.Replace ("_","__"));
return;
}
@@ -606,7 +565,7 @@ namespace MonoDevelop.Ide.Commands
protected override void Run ()
{
var context = new ProjectOperationContext ();
- context.GlobalProperties.Add ("RunCodeAnalysisOnce", "true");
+ context.GlobalProperties.SetValue ("RunCodeAnalysisOnce", "true");
IdeApp.ProjectOperations.Rebuild (IdeApp.ProjectOperations.CurrentSelectedProject, context);
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/TextEditorCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/TextEditorCommands.cs
index e5682dda1b..d75f35496d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/TextEditorCommands.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/TextEditorCommands.cs
@@ -92,14 +92,18 @@ namespace MonoDevelop.Ide.Commands
DuplicateLine,
ToggleCompletionSuggestionMode,
- ToggleBlockSelectionMode
+ ToggleBlockSelectionMode,
+
+ DynamicAbbrev,
+
+ PulseCaret
}
public class ToggleCompletionSuggestionModeHandler : CommandHandler
{
protected override void Run ()
{
- MonoDevelop.Ide.CodeCompletion.CompletionWindowManager.ForceSuggestionMode = !MonoDevelop.Ide.CodeCompletion.CompletionWindowManager.ForceSuggestionMode;
+ IdeApp.Preferences.ForceSuggestionMode.Value = !IdeApp.Preferences.ForceSuggestionMode;
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ToolsCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ToolsCommands.cs
index 109d363505..6f22f4170a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ToolsCommands.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ToolsCommands.cs
@@ -32,6 +32,7 @@ using MonoDevelop.Core.Execution;
using MonoDevelop.Ide.Gui.Dialogs;
using System;
using MonoDevelop.Ide.Updater;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Commands
{
@@ -84,7 +85,7 @@ namespace MonoDevelop.Ide.Commands
argumentsTool = StringParserService.Parse (customerArguments, IdeApp.Workbench.GetStringTagModel ());
}
- DispatchService.BackgroundDispatch (delegate {
+ Task.Run (delegate {
RunExternalTool (tool, argumentsTool);
});
}
@@ -95,7 +96,7 @@ namespace MonoDevelop.Ide.Commands
string initialDirectoryTool = StringParserService.Parse (tool.InitialDirectory, IdeApp.Workbench.GetStringTagModel ());
//Execute tool
- IProgressMonitor progressMonitor = IdeApp.Workbench.ProgressMonitors.GetRunProgressMonitor ();
+ ProgressMonitor progressMonitor = IdeApp.Workbench.ProgressMonitors.GetRunProgressMonitor ();
try {
progressMonitor.Log.WriteLine (GettextCatalog.GetString ("Running: {0} {1}", (commandTool), (argumentsTool)));
progressMonitor.Log.WriteLine ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ViewCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ViewCommands.cs
index 1c178ec85a..d0d6c5a808 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ViewCommands.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ViewCommands.cs
@@ -379,7 +379,7 @@ namespace MonoDevelop.Ide.Commands
protected override void Run ()
{
- IdeApp.Workbench.ActiveDocument.Editor.SetCaretTo (IdeApp.Workbench.ActiveDocument.Editor.Caret.Line, IdeApp.Workbench.ActiveDocument.Editor.Caret.Column);
+ IdeApp.Workbench.ActiveDocument.Editor.StartCaretPulseAnimation ();
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs
index 3f758fce2e..fecd08e174 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs
@@ -250,8 +250,7 @@ namespace MonoDevelop.Ide.Commands
{
protected static void Switch (bool next)
{
- //FIXME: does this option need to exist?
- if (!PropertyService.Get ("MonoDevelop.Core.Gui.EnableDocumentSwitchDialog", true)) {
+ if (!IdeApp.Preferences.EnableDocumentSwitchDialog) {
IdeApp.CommandService.DispatchCommand (next? WindowCommands.NextDocument : WindowCommands.PrevDocument);
return;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/CustomTool.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/CustomTool.cs
index a3e2731486..e1d15556a8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/CustomTool.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/CustomTool.cs
@@ -28,12 +28,13 @@ using System;
using MonoDevelop.Projects;
using System.CodeDom.Compiler;
using MonoDevelop.Core;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.CustomTools
{
public interface ISingleFileCustomTool
{
- IAsyncOperation Generate (IProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result);
+ Task Generate (ProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result);
}
public class SingleFileCustomToolResult
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/CustomToolService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/CustomToolService.cs
index 6c3e3a6d1e..af1182b763 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/CustomToolService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/CustomToolService.cs
@@ -25,25 +25,33 @@
// THE SOFTWARE.
using System;
-using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.IO;
+using System.CodeDom.Compiler;
+using Task = System.Threading.Tasks.Task;
+using IdeTask = MonoDevelop.Ide.Tasks.TaskListEntry;
using System.Linq;
using System.Threading;
using Mono.Addins;
using MonoDevelop.Core;
-using MonoDevelop.Core.ProgressMonitoring;
using MonoDevelop.Ide.Extensions;
using MonoDevelop.Ide.Tasks;
using MonoDevelop.Projects;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.CustomTools
{
public static class CustomToolService
{
static readonly Dictionary<string,CustomToolExtensionNode> nodes = new Dictionary<string,CustomToolExtensionNode> ();
-
- static readonly Dictionary<string,IAsyncOperation> runningTasks = new Dictionary<string, IAsyncOperation> ();
+
+ class TaskInfo {
+ public Task Task;
+ public CancellationTokenSource CancellationTokenSource;
+ public SingleFileCustomToolResult Result;
+ }
+
+ static readonly Dictionary<string,TaskInfo> runningTasks = new Dictionary<string, TaskInfo> ();
static CustomToolService ()
{
@@ -69,6 +77,14 @@ namespace MonoDevelop.Ide.CustomTools
foreach (ProjectFileEventInfo e in args)
Update (e.ProjectFile, false);
};
+ IdeApp.Workspace.FileRemovedFromProject += delegate (object sender, ProjectFileEventArgs args) {
+ foreach (ProjectFileEventInfo e in args)
+ Update (e.ProjectFile, false);
+ };
+ IdeApp.Workspace.FileAddedToProject += delegate (object sender, ProjectFileEventArgs args) {
+ foreach (ProjectFileEventInfo e in args)
+ Update (e.ProjectFile, false);
+ };
//FIXME: handle the rename
//MonoDevelop.Ide.Gui.IdeApp.Workspace.FileRenamedInProject
}
@@ -102,7 +118,7 @@ namespace MonoDevelop.Ide.CustomTools
return null;
}
- public static void Update (IEnumerable<ProjectFile> files, bool force)
+ public async static Task Update (IEnumerable<ProjectFile> files, bool force)
{
var monitor = IdeApp.Workbench.ProgressMonitors.GetToolOutputProgressMonitor (false);
@@ -116,7 +132,7 @@ namespace MonoDevelop.Ide.CustomTools
monitor.ReportSuccess (GettextCatalog.GetString ("No templates found"));
monitor.Dispose ();
} else {
- Update (monitor, fileEnumerator, force, 0, 0, 0);
+ await Update (monitor, fileEnumerator, force, 0, 0, 0);
}
}
@@ -143,7 +159,7 @@ namespace MonoDevelop.Ide.CustomTools
return false;
}
bool byDefault, require;
- MonoDevelop.Projects.Formats.MSBuild.MSBuildProjectService.CheckHandlerUsesMSBuildEngine (file.Project, out byDefault, out require);
+ MonoDevelop.Projects.MSBuild.MSBuildProjectService.CheckHandlerUsesMSBuildEngine (file.Project, out byDefault, out require);
var usesMSBuild = require || (file.Project.UseMSBuildEngine ?? byDefault);
if (!usesMSBuild) {
return false;
@@ -160,7 +176,7 @@ namespace MonoDevelop.Ide.CustomTools
|| File.GetLastWriteTime (file.FilePath) > File.GetLastWriteTime (genFile.FilePath);
}
- static void Update (IProgressMonitor monitor, IEnumerator<ProjectFile> fileEnumerator, bool force, int succeeded, int warnings, int errors)
+ static async Task Update (ProgressMonitor monitor, IEnumerator<ProjectFile> fileEnumerator, bool force, int succeeded, int warnings, int errors)
{
ProjectFile file = fileEnumerator.Current;
ISingleFileCustomTool tool;
@@ -182,32 +198,30 @@ namespace MonoDevelop.Ide.CustomTools
monitor.BeginTask (GettextCatalog.GetString ("Running generator '{0}' on file '{1}'...", file.Generator, file.Name), 1);
try {
- IAsyncOperation op = tool.Generate (monitor, file, result);
- op.Completed += delegate {
- if (result.Success) {
- monitor.Log.WriteLine (GettextCatalog.GetString ("File '{0}' was generated successfully.", result.GeneratedFilePath));
- succeeded++;
- } else if (result.SuccessWithWarnings) {
- monitor.Log.WriteLine (GettextCatalog.GetString ("File '{0}' was generated with warnings.", result.GeneratedFilePath));
- warnings++;
- } else {
- monitor.Log.WriteLine (GettextCatalog.GetString ("Errors in file '{0}' generation.", result.GeneratedFilePath));
- errors++;
- }
+ await tool.Generate (monitor, file, result);
+ if (!monitor.HasErrors && !monitor.HasWarnings) {
+ monitor.Log.WriteLine (GettextCatalog.GetString ("File '{0}' was generated successfully.", result.GeneratedFilePath));
+ succeeded++;
+ } else if (!monitor.HasErrors) {
+ monitor.Log.WriteLine (GettextCatalog.GetString ("File '{0}' was generated with warnings.", result.GeneratedFilePath));
+ warnings++;
+ } else {
+ monitor.Log.WriteLine (GettextCatalog.GetString ("Errors in file '{0}' generation.", result.GeneratedFilePath));
+ errors++;
+ }
- //check that we can process further. If UpdateCompleted returns `true` this means no errors or non-fatal errors occured
- if (UpdateCompleted (monitor, null, file, genFile, result, true) && fileEnumerator.MoveNext ())
- Update (monitor, fileEnumerator, force, succeeded, warnings, errors);
- else
- WriteSummaryResults (monitor, succeeded, warnings, errors);
- };
+ //check that we can process further. If UpdateCompleted returns `true` this means no errors or non-fatal errors occured
+ if (UpdateCompleted (monitor, file, genFile, result, true) && fileEnumerator.MoveNext ())
+ await Update (monitor, fileEnumerator, force, succeeded, warnings, errors);
+ else
+ WriteSummaryResults (monitor, succeeded, warnings, errors);
} catch (Exception ex) {
result.UnhandledException = ex;
- UpdateCompleted (monitor, null, file, genFile, result, true);
+ UpdateCompleted (monitor, file, genFile, result, true);
}
}
- static void WriteSummaryResults (IProgressMonitor monitor, int succeeded, int warnings, int errors)
+ static void WriteSummaryResults (ProgressMonitor monitor, int succeeded, int warnings, int errors)
{
monitor.Log.WriteLine ();
@@ -235,7 +249,7 @@ namespace MonoDevelop.Ide.CustomTools
monitor.Dispose ();
}
- public static void Update (ProjectFile file, bool force)
+ public static async void Update (ProjectFile file, bool force)
{
ISingleFileCustomTool tool;
ProjectFile genFile;
@@ -245,53 +259,91 @@ namespace MonoDevelop.Ide.CustomTools
TaskService.Errors.ClearByOwner (file);
- //if this file is already being run, cancel it
+ TaskInfo runningTask;
+ TaskCompletionSource<bool> newTask = new TaskCompletionSource<bool> ();
+ var result = new SingleFileCustomToolResult ();
+ Task existingTask = null;
+ CancellationTokenSource cs = new CancellationTokenSource ();
+
+ // if this file is already being run, cancel it
+
lock (runningTasks) {
- IAsyncOperation runningTask;
if (runningTasks.TryGetValue (file.FilePath, out runningTask)) {
- runningTask.Cancel ();
+ runningTask.CancellationTokenSource.Cancel ();
runningTasks.Remove (file.FilePath);
+ existingTask = runningTask.Task;
}
+ runningTask = new TaskInfo { Task = newTask.Task, CancellationTokenSource = cs, Result = result };
+ runningTasks.Add (file.FilePath, runningTask);
}
-
- var monitor = IdeApp.Workbench.ProgressMonitors.GetToolOutputProgressMonitor (false);
- var result = new SingleFileCustomToolResult ();
- var aggOp = new AggregatedOperationMonitor (monitor);
+
+ // If a task was already running, wait for it to finish. Running the same task in parallel may lead
+ // to file sharing violation errors
+
+ if (existingTask != null) {
+ try {
+ await existingTask;
+ } catch {
+ // Ignore exceptions, they are handled elsewhere
+ }
+ }
+
+ // Maybe I was cancelled while I was waiting. In that case, the task has already been removed from
+ // the runningTasks collection
+
+ if (cs.IsCancellationRequested) {
+ newTask.TrySetResult (true);
+ return;
+ }
+
+ // Execute the generator
+
+ Exception error = null;
+ var monitor = IdeApp.Workbench.ProgressMonitors.GetToolOutputProgressMonitor (false).WithCancellationSource (cs);
+
try {
monitor.BeginTask (GettextCatalog.GetString ("Running generator '{0}' on file '{1}'...", file.Generator, file.Name), 1);
- IAsyncOperation op = tool.Generate (monitor, file, result);
- runningTasks.Add (file.FilePath, op);
- aggOp.AddOperation (op);
- op.Completed += delegate {
- lock (runningTasks) {
- IAsyncOperation runningTask;
- if (runningTasks.TryGetValue (file.FilePath, out runningTask) && runningTask == op) {
- runningTasks.Remove (file.FilePath);
- UpdateCompleted (monitor, aggOp, file, genFile, result, false);
- } else {
- //it was cancelled because another was run for the same file, so just clean up
- aggOp.Dispose ();
- monitor.EndTask ();
- monitor.ReportWarning (GettextCatalog.GetString ("Cancelled because generator ran again for the same file"));
- monitor.Dispose ();
- }
+
+ try {
+ await tool.Generate (monitor, file, result);
+ } catch (Exception ex) {
+ error = ex;
+ result.UnhandledException = ex;
+ }
+
+ // Generation has finished. Remove the task from the runningTasks collection
+
+ lock (runningTasks) {
+ TaskInfo registeredTask;
+ if (runningTasks.TryGetValue (file.FilePath, out registeredTask) && registeredTask == runningTask) {
+ runningTasks.Remove (file.FilePath);
+ UpdateCompleted (monitor, file, genFile, result, false);
+ } else {
+ // it was cancelled because another was run for the same file, so just clean up
+ monitor.EndTask ();
+ monitor.ReportWarning (GettextCatalog.GetString ("Cancelled because generator ran again for the same file"));
+ monitor.Dispose ();
}
- };
+ }
} catch (Exception ex) {
result.UnhandledException = ex;
- UpdateCompleted (monitor, aggOp, file, genFile, result, false);
+ UpdateCompleted (monitor, file, genFile, result, false);
+ } finally {
+ if (error == null)
+ newTask.SetResult (true);
+ else {
+ newTask.SetException (error);
+ }
}
}
- static bool UpdateCompleted (IProgressMonitor monitor, AggregatedOperationMonitor aggOp,
+ static bool UpdateCompleted (ProgressMonitor monitor,
ProjectFile file, ProjectFile genFile, SingleFileCustomToolResult result,
bool runMultipleFiles)
{
monitor.EndTask ();
- if (aggOp != null)
- aggOp.Dispose ();
-
- if (monitor.IsCancelRequested) {
+
+ if (monitor.CancellationToken.IsCancellationRequested) {
monitor.ReportError (GettextCatalog.GetString ("Cancelled"), null);
monitor.Dispose ();
return false;
@@ -327,9 +379,9 @@ namespace MonoDevelop.Ide.CustomTools
}
if (result.Errors.Count > 0) {
- DispatchService.GuiDispatch (delegate {
+ Runtime.RunInMainThread (delegate {
foreach (CompilerError err in result.Errors)
- TaskService.Errors.Add (new Task (file.FilePath, err.ErrorText, err.Column, err.Line,
+ TaskService.Errors.Add (new TaskListEntry (file.FilePath, err.ErrorText, err.Column, err.Line,
err.IsWarning? TaskSeverity.Warning : TaskSeverity.Error,
TaskPriority.Normal, file.Project.ParentSolution, file));
});
@@ -358,7 +410,7 @@ namespace MonoDevelop.Ide.CustomTools
FileService.NotifyFileChanged (result.GeneratedFilePath);
// add file to project, update file properties, etc
- Gtk.Application.Invoke (delegate {
+ Gtk.Application.Invoke (async delegate {
bool projectChanged = false;
if (genFile == null) {
genFile = file.Project.AddFile (result.GeneratedFilePath, result.OverrideBuildAction);
@@ -379,7 +431,7 @@ namespace MonoDevelop.Ide.CustomTools
}
if (projectChanged)
- IdeApp.ProjectOperations.Save (file.Project);
+ await IdeApp.ProjectOperations.SaveAsync (file.Project);
});
return true;
@@ -395,50 +447,49 @@ namespace MonoDevelop.Ide.CustomTools
}
}
- public static string GetFileNamespace (ProjectFile file, string outputFile)
+ public static string GetFileNamespace (ProjectFile file, string outputFile, bool useVisualStudioNamingPolicy = false)
{
string ns = file.CustomToolNamespace;
if (!string.IsNullOrEmpty (ns) || string.IsNullOrEmpty (outputFile))
return ns;
var dnfc = file.Project as IDotNetFileContainer;
if (dnfc != null)
- return dnfc.GetDefaultNamespace (outputFile);
+ return dnfc.GetDefaultNamespace (outputFile, useVisualStudioNamingPolicy);
return ns;
}
- public static bool WaitForRunningTools (IProgressMonitor monitor)
+ public static Task WaitForRunningTools (ProgressMonitor monitor)
{
- IAsyncOperation[] operations;
+ TaskInfo[] operations;
lock (runningTasks) {
operations = runningTasks.Values.ToArray ();
}
if (operations.Length == 0)
- return true;
+ return Task.FromResult (true);
monitor.BeginTask ("Waiting for custom tools...", operations.Length);
- var evt = new AutoResetEvent (false);
-
- monitor.CancelRequested += delegate {
- evt.Set ();
- };
+ List<Task> tasks = new List<Task> ();
- OperationHandler checkOp = delegate {
- monitor.Step (1);
- if (operations.All (op => op.IsCompleted))
- evt.Set ();
- };
-
- foreach (var o in operations)
- o.Completed += checkOp;
+ foreach (var t in operations) {
+ tasks.Add (t.Task.ContinueWith (ta => {
+ if (!monitor.CancellationToken.IsCancellationRequested)
+ monitor.Step (1);
+ }));
+ }
- evt.WaitOne ();
+ var cancelTask = new TaskCompletionSource<bool> ();
+ var allDone = Task.WhenAll (tasks);
- monitor.EndTask ();
+ var cancelReg = monitor.CancellationToken.Register (() => {
+ cancelTask.SetResult (true);
+ });
- //the tool operations display warnings themselves
- return operations.Any (op => !op.SuccessWithWarnings);
+ return Task.WhenAny (allDone, cancelTask.Task).ContinueWith (t => {
+ monitor.EndTask ();
+ cancelReg.Dispose ();
+ });
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/MSBuildCustomTool.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/MSBuildCustomTool.cs
index 1edc9e59fc..9aa1db8a5e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/MSBuildCustomTool.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/MSBuildCustomTool.cs
@@ -27,6 +27,10 @@
using MonoDevelop.Core;
using MonoDevelop.Projects;
using System.CodeDom.Compiler;
+using System.Threading.Tasks;
+using System.IO;
+using System.Collections.Generic;
+using System.Linq;
namespace MonoDevelop.Ide.CustomTools
{
@@ -39,16 +43,15 @@ namespace MonoDevelop.Ide.CustomTools
this.targetName = targetName;
}
- public IAsyncOperation Generate (IProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
+ public async Task Generate (ProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
{
- return new ThreadAsyncOperation (() => {
- var buildResult = file.Project.RunTarget (monitor, targetName, IdeApp.Workspace.ActiveConfiguration);
- foreach (var err in buildResult.Errors) {
- result.Errors.Add (new CompilerError (err.FileName, err.Line, err.Column, err.ErrorNumber, err.ErrorText) {
- IsWarning = err.IsWarning
- });
- }
- }, result);
+ var buildResult = await file.Project.PerformGeneratorAsync (monitor, IdeApp.Workspace.ActiveConfiguration, this.targetName);
+
+ foreach (var err in buildResult.BuildResult.Errors) {
+ result.Errors.Add (new CompilerError (err.FileName, err.Line, err.Column, err.ErrorNumber, err.ErrorText) {
+ IsWarning = err.IsWarning
+ });
+ }
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/PublicResXFileCodeGenerator.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/PublicResXFileCodeGenerator.cs
index 48f9679587..82dcd12c3d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/PublicResXFileCodeGenerator.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/PublicResXFileCodeGenerator.cs
@@ -38,14 +38,15 @@ using MonoDevelop.Projects;
using MonoDevelop.Ide.CustomTools;
using System.Resources.Tools;
using System.CodeDom.Compiler;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.CustomTools
{
public class PublicResXFileCodeGenerator : ISingleFileCustomTool
{
- public IAsyncOperation Generate (IProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
+ public Task Generate (ProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
{
- return new ThreadAsyncOperation (ResXFileCodeGenerator.GenerateFile (file, result, false), result);
+ return ResXFileCodeGenerator.GenerateFile (file, result, false);
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/ResXFileCodeGenerator.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/ResXFileCodeGenerator.cs
index 325a4d64f0..a946d40d95 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/ResXFileCodeGenerator.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/ResXFileCodeGenerator.cs
@@ -45,41 +45,60 @@ using MonoDevelop.Core.Assemblies;
using System.Resources;
using System.Collections.Generic;
using System.Collections;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.CustomTools
{
public class ResXFileCodeGenerator : ISingleFileCustomTool
{
- public IAsyncOperation Generate (IProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
+ public Task Generate (ProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result)
{
- return new ThreadAsyncOperation (GenerateFile (file, result, true), result);
+ return GenerateFile (file, result, true);
}
- public static Action GenerateFile (ProjectFile file, SingleFileCustomToolResult result, bool internalClass)
+ public async static Task GenerateFile (ProjectFile file, SingleFileCustomToolResult result, bool internalClass)
{
- return delegate {
- var dnp = file.Project as DotNetProject;
- if (dnp == null) {
- var err = "ResXFileCodeGenerator can only be used with .NET projects";
- result.Errors.Add (new CompilerError (null, 0, 0, null, err));
- return;
- }
+ var dnp = file.Project as DotNetProject;
+ if (dnp == null) {
+ var err = "ResXFileCodeGenerator can only be used with .NET projects";
+ result.Errors.Add (new CompilerError (null, 0, 0, null, err));
+ return;
+ }
- var provider = dnp.LanguageBinding.GetCodeDomProvider ();
- if (provider == null) {
- const string err = "ResXFileCodeGenerator can only be used with languages that support CodeDOM";
- result.Errors.Add (new CompilerError (null, 0, 0, null, err));
- return;
- }
+ var provider = dnp.LanguageBinding.GetCodeDomProvider ();
+ if (provider == null) {
+ const string err = "ResXFileCodeGenerator can only be used with languages that support CodeDOM";
+ result.Errors.Add (new CompilerError (null, 0, 0, null, err));
+ return;
+ }
+
+ var outputfile = file.FilePath.ChangeExtension (".Designer." + provider.FileExtension);
+
+ //use the Visual Studio naming polict, so it matches code generated by VS
+ var codeNamespace = CustomToolService.GetFileNamespace (file, outputfile, true);
- var outputfile = file.FilePath.ChangeExtension (".Designer." + provider.FileExtension);
- var codeNamespace = CustomToolService.GetFileNamespace (file, outputfile);
- var name = provider.CreateValidIdentifier (file.FilePath.FileNameWithoutExtension);
- var resourcesNamespace = dnp.GetDefaultNamespace (outputfile);
+ //no need to escape/cleanup, StronglyTypedResourceBuilder does that
+ var name = file.FilePath.FileNameWithoutExtension;
- var rd = new Dictionary<object, object> ();
- using (var r = new ResXResourceReader (file.FilePath)) {
- r.BasePath = file.FilePath.ParentDirectory;
+ //NOTE: we fix it up later with the real resource ID, this is just a fallback in case that fails
+ var resourcesNamespace = dnp.GetDefaultNamespace (outputfile, true);
+
+ var rd = new Dictionary<object, object> ();
+ var filePath = file.FilePath;
+ var targetsPcl2Framework = TargetsPcl2Framework (dnp);
+
+ //Compute the *real* ID of the embedded resource. It can be affected by LogicalName so might not match the
+ //class name, but StronglyTypedResourceBuilder only accepts a single name for both.
+ //Fix this by patching it into the CodeDOM later.
+ var id = file.ResourceId;
+ const string suffix = ".resources";
+ if (id.Length > suffix.Length && id.EndsWith (suffix, StringComparison.OrdinalIgnoreCase)) {
+ id = id.Substring (0, id.Length - suffix.Length);
+ }
+
+ await Task.Run (() => {
+ using (var r = new ResXResourceReader (filePath)) {
+ r.BasePath = filePath.ParentDirectory;
foreach (DictionaryEntry e in r) {
rd.Add (e.Key, e.Value);
}
@@ -87,21 +106,26 @@ namespace MonoDevelop.Ide.CustomTools
string[] unmatchable;
var ccu = StronglyTypedResourceBuilder.Create (rd, name, codeNamespace, resourcesNamespace, provider, internalClass, out unmatchable);
-
- if (TargetsPcl2Framework (dnp)) {
+
+ if (targetsPcl2Framework) {
FixupPclTypeInfo (ccu);
}
+ FixupEmbeddedResourceID (ccu, id);
+
foreach (var p in unmatchable) {
var msg = string.Format ("Could not generate property for resource ID '{0}'", p);
- result.Errors.Add (new CompilerError (file.FilePath, 0, 0, null, msg));
+ result.Errors.Add (new CompilerError (filePath, 0, 0, null, msg));
}
- using (var w = new StreamWriter (outputfile, false, Encoding.UTF8))
- provider.GenerateCodeFromCompileUnit (ccu, w, new CodeGeneratorOptions ());
+ lock (file) {
+ // Avoid race if ResXFileCodeGenerator is called more than once for the same file
+ using (var w = new StreamWriter (outputfile, false, Encoding.UTF8))
+ provider.GenerateCodeFromCompileUnit (ccu, w, new CodeGeneratorOptions ());
+ }
result.GeneratedFilePath = outputfile;
- };
+ });
}
static bool TargetsPcl2Framework (DotNetProject dnp)
@@ -112,20 +136,36 @@ namespace MonoDevelop.Ide.CustomTools
return asms.Any (a => a.Package != null && a.Package.IsFrameworkPackage && a.Name == "System.Runtime");
}
+ static CodeObjectCreateExpression GetInitExpr (CodeCompileUnit ccu)
+ {
+ ccu.Namespaces [0].Imports.Add (new CodeNamespaceImport ("System.Reflection"));
+ var assignment = ccu.Namespaces [0].Types [0]
+ .Members.OfType<CodeMemberProperty> ().Single (t => t.Name == "ResourceManager")
+ .GetStatements.OfType<CodeConditionStatement> ().Single ()
+ .TrueStatements.OfType<CodeVariableDeclarationStatement> ().Single ();
+ var initExpr = (CodeObjectCreateExpression)assignment.InitExpression;
+ return initExpr;
+ }
+
//works with .NET 4.5.1 and Mono 3.4.0
static void FixupPclTypeInfo (CodeCompileUnit ccu)
{
try {
- ccu.Namespaces [0].Imports.Add (new CodeNamespaceImport ("System.Reflection"));
- var assignment = ccu.Namespaces [0].Types [0]
- .Members.OfType<CodeMemberProperty> ().Single (t => t.Name == "ResourceManager")
- .GetStatements.OfType<CodeConditionStatement> ().Single ()
- .TrueStatements.OfType<CodeVariableDeclarationStatement> ().Single ();
- var initExpr = (CodeObjectCreateExpression) assignment.InitExpression;
- var typeofExpr = (CodePropertyReferenceExpression) initExpr.Parameters [1];
- typeofExpr.TargetObject = new CodeMethodInvokeExpression (typeofExpr.TargetObject, "GetTypeInfo");
+ CodeObjectCreateExpression initExpr = GetInitExpr (ccu);
+ var typeofExpr = (CodePropertyReferenceExpression)initExpr.Parameters [1];
+ typeofExpr.TargetObject = new CodeMethodInvokeExpression (typeofExpr.TargetObject, "GetTypeInfo");
+ } catch (Exception ex) {
+ LoggingService.LogWarning ("Failed to fixup StronglyTypedResourceBuilder output for PCL", ex);
+ }
+ }
+
+ static void FixupEmbeddedResourceID (CodeCompileUnit ccu, string id)
+ {
+ try {
+ CodeObjectCreateExpression initExpr = GetInitExpr (ccu);
+ initExpr.Parameters [0] = new CodePrimitiveExpression (id);
} catch (Exception ex) {
- LoggingService.LogWarning ("Failed to fixup resgen output for PCL", ex);
+ LoggingService.LogWarning ("Failed to fixup StronglyTypedResourceBuilder resource ID", ex);
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/ThreadAsyncOperation.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/ThreadAsyncOperation.cs
deleted file mode 100644
index 83f1de0475..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CustomTools/ThreadAsyncOperation.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// TextTemplatingFileGenerator.cs
-//
-// Author:
-// Michael Hutchinson <mhutchinson@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using MonoDevelop.Ide.CustomTools;
-using MonoDevelop.Core;
-using System.Threading;
-
-namespace MonoDevelop.Ide.CustomTools
-{
- public class ThreadAsyncOperation : IAsyncOperation
- {
- readonly object locker = new object ();
- readonly Thread thread;
- readonly SingleFileCustomToolResult result;
- readonly Action task;
-
- bool cancelled;
- bool isCompleted;
-
- public ThreadAsyncOperation (Action task, SingleFileCustomToolResult result)
- {
- if (result == null)
- throw new ArgumentNullException ("result");
-
- this.task = task;
- this.result = result;
- thread = new Thread (Run);
- thread.Start ();
- }
-
- void Run ()
- {
- try {
- task ();
- } catch (ThreadAbortException ex) {
- result.UnhandledException = ex;
- Thread.ResetAbort ();
- } catch (Exception ex) {
- result.UnhandledException = ex;
- }
-
- OperationHandler c;
- lock (locker) {
- isCompleted = true;
- c = completed;
- completed = null;
- }
-
- if (c != null)
- c (this);
- }
-
- OperationHandler completed;
-
- public event OperationHandler Completed {
- add {
- lock (locker) {
- if (!isCompleted) {
- completed += value;
- return;
- }
- }
- value (this);
- }
- remove {
- lock (locker) {
- if (completed != null)
- completed -= value;
- }
- }
- }
-
- public void Cancel ()
- {
- cancelled = true;
- thread.Abort ();
- }
-
- public void WaitForCompleted ()
- {
- thread.Join ();
- }
-
- public bool IsCompleted {
- get { return isCompleted; }
- }
-
- public bool Success {
- get { return !cancelled && result.Success; }
- }
-
- public bool SuccessWithWarnings {
- get { return !cancelled && result.SuccessWithWarnings; }
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs
index 6f92157347..1a4c3e94d6 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs
@@ -48,7 +48,7 @@ namespace MonoDevelop.Ide.Desktop
public abstract class PlatformService
{
Hashtable iconHash = new Hashtable ();
- const bool UsePlatformFileIcons = false;
+ static readonly bool UsePlatformFileIcons = false;
public abstract string DefaultMonospaceFont { get; }
public virtual string DefaultSansFont { get { return null; } }
@@ -360,7 +360,7 @@ namespace MonoDevelop.Ide.Desktop
}
//must be implemented if CanOpenTerminal returns true
- public virtual IProcessAsyncOperation StartConsoleProcess (
+ public virtual ProcessAsyncOperation StartConsoleProcess (
string command, string arguments, string workingDirectory,
IDictionary<string, string> environmentVariables,
string title, bool pauseWhenFinished)
@@ -424,15 +424,23 @@ namespace MonoDevelop.Ide.Desktop
return new DesktopApplication[0];
}
- public virtual Gdk.Rectangle GetUsableMonitorGeometry (Gdk.Screen screen, int monitor)
+ public virtual Xwt.Rectangle GetUsableMonitorGeometry (int screenNumber, int monitorNumber)
{
- return screen.GetMonitorGeometry (monitor);
+ var screen = Gdk.Display.Default.GetScreen (screenNumber);
+ var rect = screen.GetMonitorGeometry (monitorNumber);
+
+ return new Xwt.Rectangle {
+ X = rect.X,
+ Y = rect.Y,
+ Width = rect.Width,
+ Height = rect.Height,
+ };
}
/// <summary>
/// Grab the desktop focus for the window.
/// </summary>
- public virtual void GrabDesktopFocus (Gtk.Window window)
+ internal virtual void GrabDesktopFocus (Gtk.Window window)
{
if (Platform.IsWindows && window.IsRealized) {
/* On Windows calling Present() will break out of window edge snapping mode. */
@@ -463,9 +471,9 @@ namespace MonoDevelop.Ide.Desktop
toolbarBox.PackStart ((MainToolbar)toolbar, true, true, 0);
}
- public virtual bool GetIsFullscreen (Gtk.Window window)
+ public virtual bool GetIsFullscreen (Window window)
{
- return ((bool?) window.Data ["isFullScreen"]) ?? false;
+ return ((bool?) window.GetNativeWidget <Gtk.Window> ().Data ["isFullScreen"]) ?? false;
}
public virtual bool IsModalDialogRunning ()
@@ -474,26 +482,27 @@ namespace MonoDevelop.Ide.Desktop
return windows.Any (w => w.Modal && w.Visible);
}
- public virtual void SetIsFullscreen (Gtk.Window window, bool isFullscreen)
+ public virtual void SetIsFullscreen (Window window, bool isFullscreen)
{
- window.Data ["isFullScreen"] = isFullscreen;
+ Gtk.Window windowControl = window;
+ windowControl.Data ["isFullScreen"] = isFullscreen;
if (isFullscreen) {
- window.Fullscreen ();
+ windowControl.Fullscreen ();
} else {
- window.Unfullscreen ();
- SetMainWindowDecorations (window);
+ windowControl.Unfullscreen ();
+ SetMainWindowDecorations (windowControl);
}
}
- public virtual void AddChildWindow (Gtk.Window parent, Gtk.Window child)
+ internal virtual void AddChildWindow (Gtk.Window parent, Gtk.Window child)
{
}
- public virtual void RemoveChildWindow (Gtk.Window parent, Gtk.Window child)
+ internal virtual void RemoveChildWindow (Gtk.Window parent, Gtk.Window child)
{
}
- public virtual void PlaceWindow (Gtk.Window window, int x, int y, int width, int height)
+ internal virtual void PlaceWindow (Gtk.Window window, int x, int y, int width, int height)
{
window.Move (x, y);
window.Resize (width, height);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentFileStorage.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentFileStorage.cs
index 362c9cb2ec..a2f3db5129 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentFileStorage.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentFileStorage.cs
@@ -296,9 +296,10 @@ namespace MonoDevelop.Ide.Desktop
void OnRecentFilesChanged (List<RecentItem> cachedItemList)
{
this.cachedItemList = cachedItemList;
- if (changed != null) {
- changed (this, EventArgs.Empty);
- }
+ Runtime.RunInMainThread (() => {
+ if (changed != null)
+ changed (this, EventArgs.Empty);
+ });
}
EventHandler changed;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentOpen.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentOpen.cs
index 8ad57a0cfa..7675e92b7c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentOpen.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentOpen.cs
@@ -53,7 +53,7 @@ namespace MonoDevelop.Ide.Desktop
public FdoRecentFiles (string storageFile)
{
recentFiles = new RecentFileStorage (storageFile);
- recentFiles.RemoveMissingFiles (projGroup, fileGroup);
+ recentFiles.RemoveMissingFiles (fileGroup);
}
public override event EventHandler Changed {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/AbstractBraceMatcher.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/AbstractBraceMatcher.cs
new file mode 100644
index 0000000000..e7eb8471d6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/AbstractBraceMatcher.cs
@@ -0,0 +1,63 @@
+//
+// AbstractBraceMatcher.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Threading;
+using System.Threading.Tasks;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Util;
+using MonoDevelop.Core.Text;
+using System;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public abstract class AbstractBraceMatcher
+ {
+ public abstract bool CanHandle (TextEditor editor);
+ public abstract Task<BraceMatchingResult?> GetMatchingBracesAsync(IReadonlyTextDocument editor, DocumentContext context, int offset, CancellationToken cancellationToken = default(CancellationToken));
+ }
+
+ sealed class DefaultBraceMatcher : AbstractBraceMatcher
+ {
+ public override bool CanHandle (TextEditor editor)
+ {
+ return true;
+ }
+
+ public override Task<BraceMatchingResult?> GetMatchingBracesAsync (IReadonlyTextDocument editor, DocumentContext context, int offset, CancellationToken cancellationToken)
+ {
+ BraceMatchingResult? result = null;
+
+ var matching = SimpleBracketMatcher.GetMatchingBracketOffset (editor, offset, cancellationToken);
+ if (matching >= 0) {
+ int start = Math.Min (offset, matching);
+ int end = Math.Max (offset, matching);
+ result = new BraceMatchingResult (new TextSegment (start, 1), new TextSegment (end, 1), offset == start);
+ }
+
+ return Task.FromResult (result);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/AbstractNavigationExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/AbstractNavigationExtension.cs
new file mode 100644
index 0000000000..7b7d7cf45d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/AbstractNavigationExtension.cs
@@ -0,0 +1,251 @@
+//
+// AbstractNavigationExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using ICSharpCode.NRefactory.Editor;
+using System.Threading;
+using MonoDevelop.Core;
+using Xwt;
+using System.Linq;
+
+namespace MonoDevelop.Ide.Editor.Extension
+{
+ public abstract class AbstractNavigationExtension : TextEditorExtension
+ {
+ uint timerId;
+ CancellationTokenSource src = new CancellationTokenSource ();
+
+ #region Key handling
+ static bool linksShown;
+
+ static bool LinksShown {
+ get {
+ return linksShown;
+ }
+ set {
+ if (value == linksShown)
+ return;
+ linksShown = value;
+ OnLinksShownChanged (EventArgs.Empty);
+ }
+ }
+
+ static void OnLinksShownChanged (EventArgs e)
+ {
+ LinksShownChanged?.Invoke (null, e);
+ }
+
+ public static event EventHandler LinksShownChanged;
+
+ //static uint snooperId;
+
+
+ public class NavigationSegment : ISegment
+ {
+ public int Offset { get; private set; }
+
+ public int Length { get; private set; }
+
+ public int EndOffset {
+ get {
+ return Offset + Length;
+ }
+ }
+
+ public Action Activate { get; private set; }
+
+ public NavigationSegment (int offset, int length, System.Action activate)
+ {
+ this.Offset = offset;
+ this.Length = length;
+ this.Activate = activate;
+ }
+ }
+
+ static AbstractNavigationExtension ()
+ {
+ // snooperId =
+ Gtk.Key.SnooperInstall (TooltipKeySnooper);
+ //if (snooperId != 0)
+ // Gtk.Key.SnooperRemove (snooperId);
+ IdeApp.Workbench.RootWindow.FocusOutEvent += RootWindow_FocusOutEvent;
+ }
+
+ static void RootWindow_FocusOutEvent (object o, Gtk.FocusOutEventArgs args)
+ {
+ LinksShown = false;
+ }
+
+ static int TooltipKeySnooper (Gtk.Widget widget, Gdk.EventKey evnt)
+ {
+ if (evnt != null && evnt.Type == Gdk.EventType.KeyPress) {
+ LinksShown = IsTriggerKey (evnt);
+ }
+ if (evnt != null && evnt.Type == Gdk.EventType.KeyRelease && IsTriggerKey (evnt)) {
+ LinksShown = false;
+ }
+ return 0; //FALSE
+ }
+
+ static bool IsTriggerKey (Gdk.EventKey evnt)
+ {
+#if MAC
+ return evnt.Key == Gdk.Key.Meta_L || evnt.Key == Gdk.Key.Meta_R;
+#else
+ return evnt.Key == Gdk.Key.Control_L || evnt.Key == Gdk.Key.Control_R;
+#endif
+ }
+ #endregion
+
+ #region Extension API
+
+ protected abstract Task<IEnumerable<NavigationSegment>> RequestLinksAsync (int offset, int length, CancellationToken token);
+
+ #endregion
+
+ protected override void Initialize ()
+ {
+ LinksShownChanged += AbstractNavigationExtension_LinksShownChanged;
+ this.DocumentContext.DocumentParsed += DocumentContext_DocumentParsed;
+ this.Editor.MouseMoved += Editor_MouseMoved;
+
+ if (LinksShown)
+ ShowLinks ();
+ }
+
+ void AbstractNavigationExtension_LinksShownChanged (object sender, EventArgs e)
+ {
+ RemoveTimer ();
+ if (LinksShown) {
+ timerId = GLib.Timeout.Add (250, delegate {
+ timerId = 0;
+ ShowLinks ();
+ return false;
+ });
+ } else {
+ HideLinks ();
+ }
+ }
+
+ void DocumentContext_DocumentParsed (object sender, EventArgs e)
+ {
+ if (LinksShown)
+ ShowLinks ();
+ }
+
+ List<ITextSegmentMarker> markers = new List<ITextSegmentMarker> ();
+ List<IDocumentLine> visibleLines = new List<IDocumentLine> ();
+ void ShowLinks ()
+ {
+ HideLinks ();
+ try {
+ Editor_MouseMoved (this, null);
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while retrieving nav links.", e);
+ }
+ }
+
+ double x, y;
+ async void Editor_MouseMoved (object sender, MouseMovedEventArgs e)
+ {
+ if (e != null) {
+ x = e.X;
+ y = e.Y;
+ }
+ CancelRequestLinks ();
+ var token = src.Token;
+ if (LinksShown) {
+ var lineNumber = Editor.PointToLocation (x, y).Line;
+ var line = Editor.GetLine (lineNumber);
+ if (visibleLines.Any (l => l.Equals (line))) {
+ return;
+ }
+ visibleLines.Add (line);
+
+ IEnumerable<NavigationSegment> segments;
+ try {
+ segments = await RequestLinksAsync (line.Offset, line.Length, token).ConfigureAwait (false);
+ } catch (OperationCanceledException) {
+ return;
+ } catch (Exception ex) {
+ LoggingService.LogError ("Error while requestling navigation links", ex);
+ return;
+ }
+ if (segments == null)
+ return;
+ await Runtime.RunInMainThread (delegate {
+ try {
+ foreach (var segment in segments) {
+ if (token.IsCancellationRequested) {
+ return;
+ }
+ var marker = Editor.TextMarkerFactory.CreateLinkMarker (Editor, segment.Offset, segment.Length, delegate { segment.Activate (); });
+ marker.OnlyShowLinkOnHover = true;
+ Editor.AddMarker (marker);
+ markers.Add (marker);
+ }
+ } catch (Exception ex) {
+ LoggingService.LogError ("Error while creating navigation line markers", ex);
+ }
+ });
+ }
+ }
+
+ void CancelRequestLinks ()
+ {
+ src.Cancel ();
+ src = new CancellationTokenSource ();
+ }
+
+ void HideLinks ()
+ {
+ foreach (var m in markers) {
+ Editor.RemoveMarker (m);
+ }
+ markers.Clear ();
+ visibleLines.Clear ();
+ }
+
+ void RemoveTimer ()
+ {
+ if (timerId != 0)
+ GLib.Source.Remove (timerId);
+ }
+
+ public override void Dispose ()
+ {
+ CancelRequestLinks ();
+ LinksShownChanged -= AbstractNavigationExtension_LinksShownChanged;
+ DocumentContext.DocumentParsed -= DocumentContext_DocumentParsed;
+ this.Editor.MouseMoved -= Editor_MouseMoved;
+ HideLinks ();
+ RemoveTimer ();
+ base.Dispose ();
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/AbstractUsagesExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/AbstractUsagesExtension.cs
new file mode 100644
index 0000000000..3383716290
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/AbstractUsagesExtension.cs
@@ -0,0 +1,248 @@
+//
+// AbstractUsagesExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide.Gui.Content;
+using System.Collections.Generic;
+using System.Linq;
+using MonoDevelop.Ide.FindInFiles;
+using System.Threading;
+using System.Threading.Tasks;
+using MonoDevelop.Core;
+using System.Diagnostics.CodeAnalysis;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
+using System.Collections.Immutable;
+
+namespace MonoDevelop.Ide.Editor.Extension
+{
+ public abstract class UsageProviderEditorExtension : TextEditorExtension
+ {
+ public abstract ImmutableArray<Usage> Usages {
+ get;
+ }
+
+ public event EventHandler UsagesUpdated;
+
+ protected void OnUsagesUpdated (EventArgs e)
+ {
+ var handler = UsagesUpdated;
+ if (handler != null)
+ handler (this, e);
+ }
+ }
+
+ /// <summary>
+ /// Provides a base class for implementing highlighting of usages inside the text editor.
+ /// </summary>
+ public abstract class AbstractUsagesExtension<T> : UsageProviderEditorExtension
+ {
+ [SuppressMessage("Microsoft.Design", "CA1000:DoNotDeclareStaticMembersOnGenericTypes")]
+ protected static readonly List<MemberReference> EmptyList = new List<MemberReference> ();
+
+ CancellationTokenSource tooltipCancelSrc = new CancellationTokenSource ();
+ List<ITextSegmentMarker> markers = new List<ITextSegmentMarker> ();
+
+ public IList<ITextSegmentMarker> Markers {
+ get {
+ return markers;
+ }
+ }
+
+ uint popupTimer;
+
+ protected override void Initialize ()
+ {
+ Editor.CaretPositionChanged += HandleTextEditorDataCaretPositionChanged;
+ Editor.TextChanged += HandleTextEditorDataDocumentTextReplaced;
+ Editor.SelectionChanged += HandleTextEditorDataSelectionChanged;
+ }
+
+ void HandleTextEditorDataSelectionChanged (object sender, EventArgs e)
+ {
+ if (Editor.IsSomethingSelected)
+ RemoveMarkers ();
+ }
+
+ void HandleTextEditorDataDocumentTextReplaced (object sender, TextChangeEventArgs e)
+ {
+ RemoveMarkers ();
+ }
+
+ public override void Dispose ()
+ {
+ CancelTooltip ();
+
+ Editor.SelectionChanged -= HandleTextEditorDataSelectionChanged;
+ Editor.CaretPositionChanged -= HandleTextEditorDataCaretPositionChanged;
+ Editor.TextChanged -= HandleTextEditorDataDocumentTextReplaced;
+ RemoveMarkers ();
+ base.Dispose ();
+ RemoveTimer ();
+ }
+
+ public bool IsTimerOnQueue {
+ get {
+ return popupTimer != 0;
+ }
+ }
+
+ public void ForceUpdate ()
+ {
+ RemoveTimer ();
+ DelayedTooltipShow ();
+ }
+
+ /// <summary>
+ /// Tries to resolve inside the current location inside tho document.
+ /// </summary>
+ /// <returns><c>true</c>, if resolve was successful, <c>false</c> otherwise.</returns>
+ /// <param name="token">A cancellation token to cancel the operation.</param>
+ protected abstract Task<T> ResolveAsync (CancellationToken token);
+
+
+ /// <summary>
+ /// Gets all references from a given resolve result. Note that this method is called on a background thread.
+ /// </summary>
+ /// <returns>The references.</returns>
+ /// <param name="resolveResult">The resolve result given in 'TryResolve'.</param>
+ /// <param name="token">A cancellation token to cancel the operation.</param>
+ protected abstract Task<IEnumerable<MemberReference>> GetReferencesAsync (T resolveResult, CancellationToken token);
+
+ async void DelayedTooltipShow ()
+ {
+ try {
+ CancelTooltip ();
+
+ var token = tooltipCancelSrc.Token;
+
+ T result = await ResolveAsync (token);
+ if (token.IsCancellationRequested) {
+ ClearQuickTasks ();
+ return;
+ }
+ var list = await GetReferencesAsync (result, token);
+ if (!token.IsCancellationRequested) {
+ Gtk.Application.Invoke (delegate {
+ if (!token.IsCancellationRequested)
+ ShowReferences (list);
+ });
+ }
+
+ } catch (OperationCanceledException) {
+ } catch (Exception e) {
+ LoggingService.LogError ("Unhandled Exception in HighlightingUsagesExtension", e);
+ } finally {
+ popupTimer = 0;
+ }
+ }
+
+ void RemoveTimer ()
+ {
+ if (popupTimer != 0) {
+ GLib.Source.Remove (popupTimer);
+ popupTimer = 0;
+ }
+ }
+
+ void HandleTextEditorDataCaretPositionChanged (object sender, EventArgs e)
+ {
+ if (!DefaultSourceEditorOptions.Instance.EnableHighlightUsages)
+ return;
+ if (!Editor.IsSomethingSelected && markers.Any (m => m.Contains (Editor.CaretOffset)))
+ return;
+ RemoveMarkers ();
+ RemoveTimer ();
+ if (!Editor.IsSomethingSelected)
+ popupTimer = GLib.Timeout.Add (250, () => { DelayedTooltipShow (); return false; } );
+ }
+
+ void ClearQuickTasks ()
+ {
+ //UsagesSegments.Clear ();
+ if (usages.Length > 0) {
+ usages = ImmutableArray<Usage>.Empty;
+ OnUsagesUpdated (EventArgs.Empty);
+ }
+ }
+
+ void CancelTooltip ()
+ {
+ tooltipCancelSrc.Cancel ();
+ tooltipCancelSrc = new CancellationTokenSource ();
+ }
+
+ void RemoveMarkers ()
+ {
+ if (markers.Count == 0)
+ return;
+ // TextEditorData.Parent.TextViewMargin.AlphaBlendSearchResults = false;
+ foreach (var marker in markers) {
+ Editor.RemoveMarker (marker);
+ }
+ markers.Clear ();
+ }
+
+ void ShowReferences (IEnumerable<MemberReference> references)
+ {
+ RemoveMarkers ();
+ var lineNumbers = new HashSet<int> ();
+ usages = ImmutableArray<Usage>.Empty;
+ var editor = Editor;
+ if (editor != null /*&& editor.TextViewMargin != null*/) {
+ if (references != null) {
+ var builder = ImmutableArray<Usage>.Empty.ToBuilder ();
+ foreach (var r in references) {
+ if (r == null)
+ continue;
+ var start = r.Offset;
+ var end = r.Offset + r.Length;
+ if (end > editor.Length)
+ continue;
+ var usage = new Usage (TextSegment.FromBounds (start, end), r.ReferenceUsageType);
+ builder.Add (usage);
+ var marker = TextMarkerFactory.CreateUsageMarker (editor, usage);
+ markers.Add (marker);
+ lineNumbers.Add (editor.OffsetToLineNumber (start));
+ editor.AddMarker (marker);
+ }
+ usages = builder.ToImmutable ();
+ }
+ }
+ OnUsagesUpdated (EventArgs.Empty);
+ }
+
+ #region IUsageProvider implementation
+
+ ImmutableArray<Usage> usages = ImmutableArray<Usage>.Empty;
+ public override ImmutableArray<Usage> Usages {
+ get {
+ return usages;
+ }
+ }
+ #endregion
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/AutoInsertBracketTextEditorExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/AutoInsertBracketTextEditorExtension.cs
new file mode 100644
index 0000000000..96181de06f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/AutoInsertBracketTextEditorExtension.cs
@@ -0,0 +1,72 @@
+//
+// AutoInsertBracketTextEditorExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Mono.Addins;
+
+namespace MonoDevelop.Ide.Editor.Extension
+{
+ public abstract class AutoInsertBracketHandler
+ {
+ public abstract bool CanHandle (TextEditor editor);
+
+ public abstract bool Handle (TextEditor editor, DocumentContext ctx, KeyDescriptor descriptor);
+ }
+
+ class AutoInsertBracketTextEditorExtension : TextEditorExtension
+ {
+ static List<AutoInsertBracketHandler> allHandlers = new List<AutoInsertBracketHandler> ();
+
+ public AutoInsertBracketTextEditorExtension ()
+ {
+ AddinManager.AddExtensionNodeHandler ("/MonoDevelop/Ide/AutoInsertBracketHandler", delegate (object sender, ExtensionNodeEventArgs args) {
+ var newHandler = (AutoInsertBracketHandler)args.ExtensionObject;
+ switch (args.Change) {
+ case ExtensionChange.Add:
+ allHandlers.Add (newHandler);
+ break;
+ case ExtensionChange.Remove:
+ allHandlers.Remove (newHandler);
+ break;
+ }
+ });
+ }
+
+ public override bool KeyPress (KeyDescriptor descriptor)
+ {
+ var result = base.KeyPress (descriptor);
+
+ if (DefaultSourceEditorOptions.Instance.AutoInsertMatchingBracket && !Editor.IsSomethingSelected) {
+ var handler = allHandlers.FirstOrDefault(h => h.CanHandle (Editor));
+ if (handler != null && handler.Handle (Editor, DocumentContext, descriptor))
+ return false;
+ }
+ return result;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/BraceMatcherTextEditorExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/BraceMatcherTextEditorExtension.cs
new file mode 100644
index 0000000000..456cc91f4e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/BraceMatcherTextEditorExtension.cs
@@ -0,0 +1,154 @@
+//
+// BraceMatcherTextEditorExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Gtk;
+using Mono.Addins;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.Ide.Editor.Extension
+{
+ sealed class BraceMatcherTextEditorExtension : TextEditorExtension
+ {
+ CancellationTokenSource src = new CancellationTokenSource();
+ static List<AbstractBraceMatcher> braceMatcher = new List<AbstractBraceMatcher> ();
+ bool isSubscribed;
+ static BraceMatcherTextEditorExtension()
+ {
+ AddinManager.AddExtensionNodeHandler ("/MonoDevelop/Ide/BraceMatcher", delegate(object sender, ExtensionNodeEventArgs args) {
+ switch (args.Change) {
+ case ExtensionChange.Add:
+ braceMatcher.Add ((AbstractBraceMatcher)args.ExtensionObject);
+ break;
+ case ExtensionChange.Remove:
+ braceMatcher.Remove ((AbstractBraceMatcher)args.ExtensionObject);
+ break;
+ }
+ });
+ braceMatcher.Add (new DefaultBraceMatcher());
+ }
+
+ AbstractBraceMatcher GetBraceMatcher ()
+ {
+ return braceMatcher.First (m => m.CanHandle (Editor));
+ }
+
+ protected override void Initialize ()
+ {
+ if ((Editor.TextEditorType & TextEditorType.Invisible) != 0)
+ return;
+ DefaultSourceEditorOptions.Instance.highlightMatchingBracket.Changed += HighlightMatchingBracket_Changed;
+ HighlightMatchingBracket_Changed (this, EventArgs.Empty);
+ }
+
+ void HighlightMatchingBracket_Changed (object sender, EventArgs e)
+ {
+ if (DefaultSourceEditorOptions.Instance.HighlightMatchingBracket) {
+ if (isSubscribed)
+ return;
+ Editor.CaretPositionChanged += Editor_CaretPositionChanged;
+ DocumentContext.DocumentParsed += HandleDocumentParsed;
+ isSubscribed = true;
+ Editor_CaretPositionChanged (null, null);
+ } else {
+ if (!isSubscribed)
+ return;
+ Editor.CaretPositionChanged -= Editor_CaretPositionChanged;
+ DocumentContext.DocumentParsed -= HandleDocumentParsed;
+ Editor.UpdateBraceMatchingResult (null);
+ isSubscribed = false;
+ }
+ }
+
+ public override void Dispose ()
+ {
+ src.Cancel ();
+ DefaultSourceEditorOptions.Instance.highlightMatchingBracket.Changed -= HighlightMatchingBracket_Changed;
+ if (isSubscribed) {
+ Editor.CaretPositionChanged -= Editor_CaretPositionChanged;
+ DocumentContext.DocumentParsed -= HandleDocumentParsed;
+ isSubscribed = false;
+ }
+ }
+
+ void HandleDocumentParsed (object sender, EventArgs e)
+ {
+ Editor_CaretPositionChanged (sender, e);
+ }
+
+ void Editor_CaretPositionChanged (object sender, EventArgs e)
+ {
+ Editor.UpdateBraceMatchingResult (null);
+ src.Cancel ();
+ src = new CancellationTokenSource ();
+ var token = src.Token;
+ var matcher = GetBraceMatcher ();
+ if (matcher == null)
+ return;
+ var caretOffset = Editor.CaretOffset;
+ var ctx = DocumentContext;
+ var snapshot = Editor.CreateDocumentSnapshot ();
+ Task.Run (async delegate() {
+ BraceMatchingResult? result;
+ try {
+ result = await matcher.GetMatchingBracesAsync (snapshot, ctx, caretOffset - 1, token).ConfigureAwait (false);
+ if (result == null && caretOffset > 0)
+ result = await matcher.GetMatchingBracesAsync (snapshot, ctx, caretOffset, token).ConfigureAwait (false);
+ if (result == null)
+ return;
+ if (result.HasValue) {
+ if (result.Value.LeftSegment.Offset < 0 ||
+ result.Value.LeftSegment.EndOffset > snapshot.Length) {
+ LoggingService.LogError ("bracket matcher left segment invalid:" + result.Value.LeftSegment);
+ return;
+ }
+ if (result.Value.RightSegment.Offset < 0 ||
+ result.Value.RightSegment.EndOffset > snapshot.Length) {
+ LoggingService.LogError ("bracket matcher right segment invalid:" + result.Value.RightSegment);
+ return;
+ }
+ }
+ } catch (OperationCanceledException) {
+ return;
+ } catch (AggregateException ae) {
+ ae.Flatten ().Handle (ex => ex is OperationCanceledException);
+ return;
+ }
+ if (token.IsCancellationRequested)
+ return;
+ Application.Invoke (delegate {
+ if (token.IsCancellationRequested)
+ return;
+ Editor.UpdateBraceMatchingResult (result);
+ });
+ });
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/BraceMatchingResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/BraceMatchingResult.cs
new file mode 100644
index 0000000000..4d79dee578
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/BraceMatchingResult.cs
@@ -0,0 +1,51 @@
+//
+// BraceMatchingResult.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using MonoDevelop.Core.Text;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public struct BraceMatchingResult
+ {
+ public ISegment LeftSegment { get; }
+
+ public ISegment RightSegment { get; }
+
+ public bool IsCaretInLeft { get; }
+
+ public BraceMatchingResult (ISegment leftSegment, ISegment rightSegment, bool isCaretInLeft) : this ()
+ {
+ if (leftSegment == null)
+ throw new ArgumentNullException (nameof (leftSegment));
+ if (rightSegment == null)
+ throw new ArgumentNullException (nameof (rightSegment));
+ LeftSegment = leftSegment;
+ RightSegment = rightSegment;
+ IsCaretInLeft = isCaretInLeft;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/CompletionTextEditorExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/CompletionTextEditorExtension.cs
new file mode 100644
index 0000000000..6c3e766af6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/CompletionTextEditorExtension.cs
@@ -0,0 +1,659 @@
+// CompletionTextEditorExtension.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (c) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+
+using System;
+using MonoDevelop.Projects;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Ide.Commands;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.CodeTemplates;
+using MonoDevelop.Ide.Editor;
+using System.Threading.Tasks;
+using System.Threading;
+using Gtk;
+
+namespace MonoDevelop.Ide.Editor.Extension
+{
+ public class CompletionTextEditorExtension : TextEditorExtension
+ {
+ internal protected CodeCompletionContext CurrentCompletionContext {
+ get;
+ set;
+ }
+
+ // (Settings have been moved to IdeApp.Preferences)
+
+ bool autoHideCompletionWindow = true, autoHideParameterWindow = true;
+
+ ICompletionWidget completionWidget;
+ internal virtual ICompletionWidget CompletionWidget
+ {
+ get { return completionWidget; }
+ set
+ {
+ if (completionWidget != null)
+ completionWidget.CompletionContextChanged -= OnCompletionContextChanged;
+ completionWidget = value;
+ if (completionWidget != null)
+ completionWidget.CompletionContextChanged += OnCompletionContextChanged;
+ }
+ }
+
+
+ public virtual string CompletionLanguage
+ {
+ get
+ {
+ return "Other";
+ }
+ }
+
+ public void ShowCompletion (ICompletionDataList completionList)
+ {
+ CurrentCompletionContext = CompletionWidget.CreateCodeCompletionContext (Editor.CaretOffset);
+ int cpos, wlen;
+ if (!GetCompletionCommandOffset (out cpos, out wlen)) {
+ cpos = Editor.CaretOffset;
+ wlen = 0;
+ }
+ CurrentCompletionContext.TriggerOffset = cpos;
+ CurrentCompletionContext.TriggerWordLength = wlen;
+
+ CompletionWindowManager.ShowWindow (this, '\0', completionList, CompletionWidget, CurrentCompletionContext);
+ }
+
+ CancellationTokenSource completionTokenSrc = new CancellationTokenSource ();
+ CancellationTokenSource parameterHintingSrc = new CancellationTokenSource ();
+
+ // When a key is pressed, and before the key is processed by the editor, this method will be invoked.
+ // Return true if the key press should be processed by the editor.
+ public override bool KeyPress (KeyDescriptor descriptor)
+ {
+ bool res;
+ if (CurrentCompletionContext != null) {
+ if (CompletionWindowManager.PreProcessKeyEvent (descriptor)) {
+ CompletionWindowManager.PostProcessKeyEvent (descriptor);
+ autoHideCompletionWindow = true;
+ // in named parameter case leave the parameter window open.
+ autoHideParameterWindow = descriptor.KeyChar != ':';
+ if (!autoHideParameterWindow && ParameterInformationWindowManager.IsWindowVisible)
+ ParameterInformationWindowManager.PostProcessKeyEvent (this, CompletionWidget, descriptor);
+
+ return false;
+ }
+ autoHideCompletionWindow = autoHideParameterWindow = false;
+ }
+
+ if (ParameterInformationWindowManager.IsWindowVisible) {
+ if (ParameterInformationWindowManager.ProcessKeyEvent (this, CompletionWidget, descriptor))
+ return false;
+ autoHideCompletionWindow = autoHideParameterWindow = false;
+ }
+
+ // int oldPos = Editor.CursorPosition;
+ // int oldLen = Editor.TextLength;
+ char deleteOrBackspaceTriggerChar = '\0';
+ if (descriptor.SpecialKey == SpecialKey.Delete && Editor.CaretOffset < Editor.Length)
+ deleteOrBackspaceTriggerChar = Editor.GetCharAt (Editor.CaretOffset);
+ if (descriptor.SpecialKey == SpecialKey.BackSpace && Editor.CaretOffset > 0)
+ deleteOrBackspaceTriggerChar = Editor.GetCharAt (Editor.CaretOffset - 1);
+
+ res = base.KeyPress (descriptor);
+
+ CompletionWindowManager.PostProcessKeyEvent (descriptor);
+
+ var ignoreMods = ModifierKeys.Control | ModifierKeys.Alt
+ | ModifierKeys.Command;
+ // Handle parameter completion
+ if (ParameterInformationWindowManager.IsWindowVisible) {
+ ParameterInformationWindowManager.PostProcessKeyEvent (this, CompletionWidget, descriptor);
+ }
+
+ if ((descriptor.ModifierKeys & ignoreMods) != 0)
+ return res;
+
+ // don't complete on block selection
+ if (/*!EnableCodeCompletion ||*/ Editor.SelectionMode == MonoDevelop.Ide.Editor.SelectionMode.Block)
+ return res;
+ // Handle code completion
+ if (descriptor.KeyChar != '\0' && CompletionWidget != null && !CompletionWindowManager.IsVisible) {
+ CurrentCompletionContext = CompletionWidget.CurrentCodeCompletionContext;
+ completionTokenSrc.Cancel ();
+ completionTokenSrc = new CancellationTokenSource ();
+ var caretOffset = Editor.CaretOffset;
+ var token = completionTokenSrc.Token;
+ try {
+ var task = HandleCodeCompletionAsync (CurrentCompletionContext, descriptor.KeyChar, token);
+ if (task != null) {
+ // Show the completion window in two steps. The call to PrepareShowWindow creates the window but
+ // it doesn't show it. It is used only to process the keys while the completion data is being retrieved.
+ CompletionWindowManager.PrepareShowWindow (this, descriptor.KeyChar, CompletionWidget, CurrentCompletionContext);
+ EventHandler windowClosed = delegate (object o, EventArgs a) {
+ completionTokenSrc.Cancel ();
+ };
+ CompletionWindowManager.WindowClosed += windowClosed;
+
+ task.ContinueWith (t => {
+ CompletionWindowManager.WindowClosed -= windowClosed;
+ if (token.IsCancellationRequested)
+ return;
+ var result = t.Result;
+ if (result != null) {
+ int triggerWordLength = result.TriggerWordLength + (Editor.CaretOffset - caretOffset);
+
+ if (triggerWordLength > 0 && (triggerWordLength < Editor.CaretOffset
+ || (triggerWordLength == 1 && Editor.CaretOffset == 1))) {
+ CurrentCompletionContext = CompletionWidget.CreateCodeCompletionContext (Editor.CaretOffset - triggerWordLength);
+ CurrentCompletionContext.TriggerWordLength = triggerWordLength;
+ }
+ // Now show the window for real.
+ if (!CompletionWindowManager.ShowWindow (result, CurrentCompletionContext))
+ CurrentCompletionContext = null;
+ } else {
+ CompletionWindowManager.HideWindow ();
+ CurrentCompletionContext = null;
+ }
+ }, Runtime.MainTaskScheduler);
+ } else {
+ CurrentCompletionContext = null;
+ }
+ } catch (TaskCanceledException) {
+ CurrentCompletionContext = null;
+ } catch (AggregateException) {
+ CurrentCompletionContext = null;
+ }
+ }
+
+ if ((descriptor.SpecialKey == SpecialKey.Delete || descriptor.SpecialKey == SpecialKey.BackSpace) && CompletionWidget != null && !CompletionWindowManager.IsVisible) {
+ CurrentCompletionContext = CompletionWidget.CurrentCodeCompletionContext;
+
+ int cpos, wlen;
+ if (!GetCompletionCommandOffset (out cpos, out wlen)) {
+ cpos = Editor.CaretOffset;
+ wlen = 0;
+ }
+ CurrentCompletionContext.TriggerOffset = cpos;
+ CurrentCompletionContext.TriggerWordLength = wlen;
+
+ completionTokenSrc.Cancel ();
+ completionTokenSrc = new CancellationTokenSource ();
+ var caretOffset = Editor.CaretOffset;
+ var token = completionTokenSrc.Token;
+ try {
+ var task = HandleBackspaceOrDeleteCodeCompletionAsync (CurrentCompletionContext, descriptor.SpecialKey, deleteOrBackspaceTriggerChar, token);
+ if (task != null) {
+ // Show the completion window in two steps. The call to PrepareShowWindow creates the window but
+ // it doesn't show it. It is used only to process the keys while the completion data is being retrieved.
+ CompletionWindowManager.PrepareShowWindow (this, descriptor.KeyChar, CompletionWidget, CurrentCompletionContext);
+ EventHandler windowClosed = delegate (object o, EventArgs a) {
+ completionTokenSrc.Cancel ();
+ };
+ CompletionWindowManager.WindowClosed += windowClosed;
+
+ task.ContinueWith (t => {
+ CompletionWindowManager.WindowClosed -= windowClosed;
+ if (token.IsCancellationRequested)
+ return;
+ var result = t.Result;
+ if (result != null) {
+ int triggerWordLength = result.TriggerWordLength + (Editor.CaretOffset - caretOffset);
+
+ if (triggerWordLength > 0 && (triggerWordLength < Editor.CaretOffset
+ || (triggerWordLength == 1 && Editor.CaretOffset == 1))) {
+ CurrentCompletionContext = CompletionWidget.CreateCodeCompletionContext (Editor.CaretOffset - triggerWordLength);
+ CurrentCompletionContext.TriggerWordLength = triggerWordLength;
+ }
+ // Now show the window for real.
+ if (!CompletionWindowManager.ShowWindow (result, CurrentCompletionContext)) {
+ CurrentCompletionContext = null;
+ } else {
+ CompletionWindowManager.Wnd.StartOffset = CurrentCompletionContext.TriggerOffset;
+ CompletionWindowManager.Wnd.EndOffset = Editor.CaretOffset;
+ }
+ } else {
+ CompletionWindowManager.HideWindow ();
+ CurrentCompletionContext = null;
+ }
+ }, Runtime.MainTaskScheduler);
+ } else {
+ CurrentCompletionContext = null;
+ }
+ } catch (TaskCanceledException) {
+ CurrentCompletionContext = null;
+ } catch (AggregateException) {
+ CurrentCompletionContext = null;
+ }
+ }
+
+ if (CompletionWidget != null) {
+ CodeCompletionContext ctx = CompletionWidget.CurrentCodeCompletionContext;
+ parameterHintingSrc.Cancel ();
+ parameterHintingSrc = new CancellationTokenSource ();
+ var token = parameterHintingSrc.Token;
+ try {
+ var task = HandleParameterCompletionAsync (ctx, descriptor.KeyChar, token);
+ if (task != null) {
+ task.ContinueWith (t => {
+ if (!token.IsCancellationRequested && t.Result != null)
+ ParameterInformationWindowManager.ShowWindow (this, CompletionWidget, ctx, t.Result);
+ }, Runtime.MainTaskScheduler);
+ }
+ } catch (TaskCanceledException) {
+ } catch (AggregateException) {
+ }
+
+ }
+ /* autoHideCompletionWindow = true;
+ autoHideParameterWindow = keyChar != ':';*/
+ return res;
+ }
+
+ protected void ShowCompletion (ICompletionDataList completionList, int triggerWordLength, char keyChar)
+ {
+ if (Editor.SelectionMode == SelectionMode.Block)
+ return;
+ if (CompletionWidget != null && CurrentCompletionContext == null) {
+ CurrentCompletionContext = CompletionWidget.CurrentCodeCompletionContext;
+ if (triggerWordLength > 0 && triggerWordLength < Editor.CaretOffset) {
+ CurrentCompletionContext =
+ CompletionWidget.CreateCodeCompletionContext (Editor.CaretOffset - triggerWordLength);
+ CurrentCompletionContext.TriggerWordLength = triggerWordLength;
+ }
+ if (completionList != null)
+ CompletionWindowManager.ShowWindow (this, keyChar, completionList, CompletionWidget, CurrentCompletionContext);
+ else
+ CurrentCompletionContext = null;
+ }
+ autoHideCompletionWindow = autoHideParameterWindow = true;
+ }
+
+ public virtual Task<int> GetCurrentParameterIndex (int startOffset, CancellationToken token = default(CancellationToken))
+ {
+ return Task.FromResult (-1);
+ }
+
+ internal protected virtual void OnCompletionContextChanged (object o, EventArgs a)
+ {
+ if (!IsActiveExtension ())
+ return;
+ if (autoHideCompletionWindow) {
+ CompletionWindowManager.HideWindow ();
+ }
+ if (autoHideParameterWindow)
+ ParameterInformationWindowManager.HideWindow (this, CompletionWidget);
+ ParameterInformationWindowManager.UpdateCursorPosition (this, CompletionWidget);
+ }
+
+ internal protected virtual bool IsActiveExtension ()
+ {
+ return true;
+ }
+
+ [CommandUpdateHandler(TextEditorCommands.ShowCompletionWindow)]
+ internal void OnUpdateCompletionCommand (CommandInfo info)
+ {
+ info.Bypass = !CanRunCompletionCommand () && !CompletionWindowManager.IsVisible;
+ }
+
+ [CommandUpdateHandler(TextEditorCommands.ShowParameterCompletionWindow)]
+ internal void OnUpdateParameterCompletionCommand (CommandInfo info)
+ {
+ info.Bypass = !CanRunParameterCompletionCommand ();
+ }
+
+ [CommandHandler (TextEditorCommands.ShowCompletionWindow)]
+ public virtual async void RunCompletionCommand ()
+ {
+ if (Editor.SelectionMode == SelectionMode.Block)
+ return;
+
+ if (CompletionWindowManager.IsVisible) {
+ CompletionWindowManager.Wnd.ToggleCategoryMode ();
+ return;
+ }
+ ICompletionDataList completionList = null;
+ int cpos, wlen;
+ if (!GetCompletionCommandOffset (out cpos, out wlen)) {
+ cpos = Editor.CaretOffset;
+ wlen = 0;
+ }
+ CurrentCompletionContext = CompletionWidget.CreateCodeCompletionContext (cpos);
+ CurrentCompletionContext.TriggerWordLength = wlen;
+ completionList = await CodeCompletionCommand (CurrentCompletionContext);
+ if (completionList == null || !CompletionWindowManager.ShowWindow (this, (char)0, completionList, CompletionWidget, CurrentCompletionContext)) {
+ CurrentCompletionContext = null;
+ }
+ }
+
+ [CommandHandler(TextEditorCommands.ShowCodeTemplateWindow)]
+ public virtual void RunShowCodeTemplatesWindow ()
+ {
+ ICompletionDataList completionList = null;
+ int cpos, wlen;
+ if (!GetCompletionCommandOffset (out cpos, out wlen)) {
+ cpos = Editor.CaretOffset;
+ wlen = 0;
+ }
+
+ var ctx = CompletionWidget.CreateCodeCompletionContext (cpos);
+ ctx.TriggerWordLength = wlen;
+ completionList = Editor.IsSomethingSelected ? ShowCodeSurroundingsCommand (ctx) : ShowCodeTemplatesCommand (ctx);
+ if (completionList == null) {
+ return;
+ }
+ var wnd = CompletionListWindow.CreateAsDialog ();
+ wnd.Extension = this;
+ wnd.ShowListWindow ((char)0, completionList, CompletionWidget, ctx);
+ }
+
+ [CommandUpdateHandler(TextEditorCommands.ShowCodeTemplateWindow)]
+ internal void OnUpdateShowCodeTemplatesWindow (CommandInfo info)
+ {
+ ICompletionDataList completionList = null;
+ int cpos, wlen;
+ if (!GetCompletionCommandOffset (out cpos, out wlen)) {
+ cpos = Editor.CaretOffset;
+ wlen = 0;
+ }
+ try {
+ var ctx = CompletionWidget.CreateCodeCompletionContext (cpos);
+ ctx.TriggerWordLength = wlen;
+ completionList = Editor.IsSomethingSelected ? ShowCodeSurroundingsCommand (ctx) : ShowCodeTemplatesCommand (ctx);
+
+ info.Bypass = completionList == null;
+ info.Text = Editor.IsSomethingSelected ? GettextCatalog.GetString ("_Surround With...") : GettextCatalog.GetString ("I_nsert Template...");
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while update show code templates window", e);
+ info.Bypass = true;
+ }
+ }
+
+
+ [CommandHandler(TextEditorCommands.ShowParameterCompletionWindow)]
+ public virtual async void RunParameterCompletionCommand ()
+ {
+ if (Editor.SelectionMode == SelectionMode.Block || CompletionWidget == null)
+ return;
+ ParameterHintingResult cp = null;
+ int cpos = Editor.CaretOffset;
+ CodeCompletionContext ctx = CompletionWidget.CreateCodeCompletionContext (cpos);
+ cp = await ParameterCompletionCommand (ctx);
+ if (cp != null) {
+ ParameterInformationWindowManager.ShowWindow (this, CompletionWidget, ctx, cp);
+ ParameterInformationWindowManager.PostProcessKeyEvent (this, CompletionWidget, KeyDescriptor.FromGtk (Gdk.Key.F, 'f', Gdk.ModifierType.None));
+ }
+ }
+
+ public virtual bool CanRunCompletionCommand ()
+ {
+ return (CompletionWidget != null && CurrentCompletionContext == null);
+ }
+
+ public virtual bool CanRunParameterCompletionCommand ()
+ {
+ return (CompletionWidget != null && !ParameterInformationWindowManager.IsWindowVisible);
+ }
+
+ static readonly ICompletionDataList emptyList = new CompletionDataList ();
+
+ public virtual Task<ICompletionDataList> HandleCodeCompletionAsync (CodeCompletionContext completionContext, char completionChar, CancellationToken token = default(CancellationToken))
+ {
+ return Task.FromResult (emptyList);
+ }
+
+ public virtual Task<ICompletionDataList> HandleBackspaceOrDeleteCodeCompletionAsync (CodeCompletionContext completionContext, SpecialKey key, char triggerCharacter, CancellationToken token = default(CancellationToken))
+ {
+ return Task.FromResult (emptyList);
+ }
+
+ public virtual Task<ParameterHintingResult> HandleParameterCompletionAsync (CodeCompletionContext completionContext, char completionChar, CancellationToken token = default(CancellationToken))
+ {
+ return Task.FromResult (ParameterHintingResult.Empty);
+ }
+
+ // return false if completion can't be shown
+ public virtual bool GetCompletionCommandOffset (out int cpos, out int wlen)
+ {
+ cpos = wlen = 0;
+ int pos = Editor.CaretOffset - 1;
+ while (pos >= 0) {
+ char c = Editor.GetCharAt (pos);
+ if (!char.IsLetterOrDigit (c) && c != '_')
+ break;
+ pos--;
+ }
+ if (pos == -1)
+ return false;
+
+ pos++;
+ cpos = pos;
+ int len = Editor.Length;
+
+ while (pos < len) {
+ char c = Editor.GetCharAt (pos);
+ if (!char.IsLetterOrDigit (c) && c != '_')
+ break;
+ pos++;
+ }
+ wlen = pos - cpos;
+ return true;
+ }
+
+
+ public virtual ICompletionDataList ShowCodeSurroundingsCommand (CodeCompletionContext completionContext)
+ {
+ CompletionDataList list = new CompletionDataList ();
+ list.AutoSelect = true;
+ list.AutoCompleteEmptyMatch = true;
+ list.CompletionSelectionMode = CompletionSelectionMode.OwnTextField;
+ var templateWidget = DocumentContext.GetContent<ICodeTemplateContextProvider> ();
+ CodeTemplateContext ctx = CodeTemplateContext.Standard;
+ if (templateWidget != null)
+ ctx = templateWidget.GetCodeTemplateContext ();
+ foreach (CodeTemplate template in CodeTemplateService.GetCodeTemplatesForFile (DocumentContext.Name)) {
+ if ((template.CodeTemplateType & CodeTemplateType.SurroundsWith) == CodeTemplateType.SurroundsWith) {
+ if (ctx == template.CodeTemplateContext)
+ list.Add (new CodeTemplateCompletionData (this, template));
+ }
+ }
+ return list;
+ }
+
+ public virtual ICompletionDataList ShowCodeTemplatesCommand (CodeCompletionContext completionContext)
+ {
+ CompletionDataList list = new CompletionDataList ();
+ list.AutoSelect = true;
+ list.AutoCompleteEmptyMatch = true;
+ list.CompletionSelectionMode = CompletionSelectionMode.OwnTextField;
+ foreach (CodeTemplate template in CodeTemplateService.GetCodeTemplatesForFile (DocumentContext.Name)) {
+ if (template.CodeTemplateType != CodeTemplateType.SurroundsWith) {
+ list.Add (new CodeTemplateCompletionData (this, template));
+ }
+ }
+ return list;
+ }
+
+ public virtual async Task<ICompletionDataList> CodeCompletionCommand (CodeCompletionContext completionContext)
+ {
+ // This default implementation of CodeCompletionCommand calls HandleCodeCompletion providing
+ // the char at the cursor position. If it returns a provider, just return it.
+
+ completionTokenSrc.Cancel ();
+ completionTokenSrc = new CancellationTokenSource ();
+ var ctoken = completionTokenSrc.Token;
+
+ int pos = completionContext.TriggerOffset;
+ if (pos > 0) {
+ char ch = Editor.GetCharAt (pos - 1);
+ try {
+ return await HandleCodeCompletionAsync (completionContext, ch, ctoken);
+ } catch (TaskCanceledException) {
+ } catch (AggregateException) {
+ }
+ }
+ return null;
+ }
+
+ public virtual async Task<ParameterHintingResult> ParameterCompletionCommand (CodeCompletionContext completionContext)
+ {
+ // This default implementation of ParameterCompletionCommand calls HandleParameterCompletion providing
+ // the char at the cursor position. If it returns a provider, just return it.
+
+ int pos = completionContext.TriggerOffset;
+ if (pos <= 0)
+ return null;
+
+ parameterHintingSrc.Cancel ();
+ parameterHintingSrc = new CancellationTokenSource ();
+
+ try {
+ return await HandleParameterCompletionAsync (completionContext, Editor.GetCharAt (pos - 1), parameterHintingSrc.Token);
+ } catch (TaskCanceledException) {
+ } catch (AggregateException) {
+ }
+ return null;
+ }
+
+ public virtual async Task<int> GuessBestMethodOverload (ParameterHintingResult provider, int currentOverload, System.Threading.CancellationToken token)
+ {
+ var currentHintingData = provider [currentOverload];
+ int cparam = await GetCurrentParameterIndex (provider.StartOffset, token).ConfigureAwait (false);
+ if (cparam > currentHintingData.ParameterCount && !currentHintingData.IsParameterListAllowed) {
+ // Look for an overload which has more parameters
+ int bestOverload = -1;
+ int bestParamCount = int.MaxValue;
+ for (int n=0; n<provider.Count; n++) {
+ int pc = provider[n].ParameterCount;
+ if (pc < bestParamCount && pc >= cparam) {
+ bestOverload = n;
+ bestParamCount = pc;
+ }
+ }
+ if (bestOverload == -1) {
+ for (int n=0; n<provider.Count; n++) {
+ if (provider[n].IsParameterListAllowed) {
+ bestOverload = n;
+ break;
+ }
+ }
+ }
+ return bestOverload;
+ }
+ return -1;
+ }
+
+// void HandlePaste (int insertionOffset, string text, int insertedChars)
+// {
+// ParameterInformationWindowManager.HideWindow (this, CompletionWidget);
+// CompletionWindowManager.HideWindow ();
+// }
+//
+ void HandleFocusOutEvent (object sender, EventArgs args)
+ {
+ ParameterInformationWindowManager.HideWindow (this, CompletionWidget);
+ CompletionWindowManager.HideWindow ();
+ }
+
+ protected override void Initialize ()
+ {
+ base.Initialize ();
+ CompletionWindowManager.WindowClosed += HandleWindowClosed;
+ CompletionWidget = DocumentContext.GetContent <ICompletionWidget> () ?? CompletionWidget;
+ Editor.CaretPositionChanged += HandlePositionChanged;
+// document.Editor.Paste += HandlePaste;
+ Editor.FocusLost += HandleFocusOutEvent;
+ }
+
+ internal void InternalInitialize ()
+ {
+ Initialize ();
+ }
+
+ internal protected virtual void HandlePositionChanged (object sender, EventArgs e)
+ {
+ if (!IsActiveExtension ())
+ return;
+ CompletionWindowManager.UpdateCursorPosition ();
+ }
+
+ void HandleWindowClosed (object sender, EventArgs e)
+ {
+ CurrentCompletionContext = null;
+ }
+
+ bool disposed = false;
+ public override void Dispose ()
+ {
+ if (!disposed)
+ {
+ completionTokenSrc.Cancel ();
+ parameterHintingSrc.Cancel ();
+
+ CompletionWindowManager.HideWindow();
+ ParameterInformationWindowManager.HideWindow(this, CompletionWidget);
+
+ disposed = true;
+ Editor.FocusLost -= HandleFocusOutEvent;
+ // document.Editor.Paste -= HandlePaste;
+ Deinitialize();
+ }
+ base.Dispose ();
+ }
+
+ internal void Deinitialize ()
+ {
+ Editor.CaretPositionChanged -= HandlePositionChanged;
+ CompletionWindowManager.WindowClosed -= HandleWindowClosed;
+ CompletionWidget = null;
+ }
+ }
+
+ public interface ITypeNameResolver
+ {
+ string ResolveName (string typeName);
+ }
+
+ class SimpleTypeNameResolver: ITypeNameResolver
+ {
+ // This simple resolver removes the namespace from all class names.
+ // Used in ctrl+space, since all classes shown in the completion list
+ // are in scope
+
+ public static SimpleTypeNameResolver Instance = new SimpleTypeNameResolver ();
+
+ public string ResolveName (string typeName)
+ {
+ int i = typeName.LastIndexOf ('.');
+ if (i == -1)
+ return typeName;
+ else
+ return typeName.Substring (i+1);
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/DefaultCommandTextEditorExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/DefaultCommandTextEditorExtension.cs
new file mode 100644
index 0000000000..11f68e1c2e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/DefaultCommandTextEditorExtension.cs
@@ -0,0 +1,652 @@
+//
+// DefaultCommandTextEditorExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Commands;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace MonoDevelop.Ide.Editor.Extension
+{
+ class DefaultCommandTextEditorExtension : TextEditorExtension
+ {
+ #region Commands
+ void ToggleCodeCommentWithBlockComments ()
+ {
+ var blockStarts = TextEditorFactory.GetSyntaxProperties (Editor.MimeType, "BlockCommentStart");
+ var blockEnds = TextEditorFactory.GetSyntaxProperties (Editor.MimeType, "BlockCommentEnd");
+ if (blockStarts == null || blockEnds == null || blockStarts.Length == 0 || blockEnds.Length == 0)
+ return;
+
+ string blockStart = blockStarts[0];
+ string blockEnd = blockEnds[0];
+
+ using (var undo = Editor.OpenUndoGroup ()) {
+ IDocumentLine startLine;
+ IDocumentLine endLine;
+
+ if (Editor.IsSomethingSelected) {
+ startLine = Editor.GetLineByOffset (Editor.SelectionRange.Offset);
+ endLine = Editor.GetLineByOffset (Editor.SelectionRange.EndOffset);
+
+ // If selection ends at begining of line... This is visible as previous line
+ // is selected, hence we want to select previous line Bug 26287
+ if (endLine.Offset == Editor.SelectionRange.EndOffset)
+ endLine = endLine.PreviousLine;
+ } else {
+ startLine = endLine = Editor.GetLine (Editor.CaretLine);
+ }
+ string startLineText = Editor.GetTextAt (startLine.Offset, startLine.Length);
+ string endLineText = Editor.GetTextAt (endLine.Offset, endLine.Length);
+ if (startLineText.StartsWith (blockStart, StringComparison.Ordinal) && endLineText.EndsWith (blockEnd, StringComparison.Ordinal)) {
+ Editor.RemoveText (endLine.Offset + endLine.Length - blockEnd.Length, blockEnd.Length);
+ Editor.RemoveText (startLine.Offset, blockStart.Length);
+ if (Editor.IsSomethingSelected) {
+ Editor.SelectionAnchorOffset -= blockEnd.Length;
+ }
+ } else {
+ Editor.InsertText (endLine.Offset + endLine.Length, blockEnd);
+ Editor.InsertText (startLine.Offset, blockStart);
+ if (Editor.IsSomethingSelected) {
+ Editor.SelectionAnchorOffset += blockEnd.Length;
+ }
+ }
+ }
+ }
+
+ bool TryGetLineCommentTag (out string commentTag)
+ {
+ var lineComments = TextEditorFactory.GetSyntaxProperties (Editor.MimeType, "LineComment");
+ if (lineComments == null || lineComments.Length == 0) {
+ commentTag = null;
+ return false;
+ }
+ commentTag = lineComments [0];
+ return true;
+ }
+
+ [CommandUpdateHandler (EditCommands.AddCodeComment)]
+ [CommandUpdateHandler (EditCommands.RemoveCodeComment)]
+ [CommandUpdateHandler (EditCommands.ToggleCodeComment)]
+ void OnUpdateToggleComment (CommandInfo info)
+ {
+ var lineComments = TextEditorFactory.GetSyntaxProperties (Editor.MimeType, "LineComment");
+ if (lineComments != null && lineComments.Length > 0) {
+ info.Visible = true;
+ return;
+ }
+ var blockStarts = TextEditorFactory.GetSyntaxProperties (Editor.MimeType, "BlockCommentStart");
+ var blockEnds = TextEditorFactory.GetSyntaxProperties (Editor.MimeType, "BlockCommentEnd");
+ info.Visible = blockStarts != null && blockStarts.Length > 0 && blockEnds != null && blockEnds.Length > 0;
+ }
+
+ [CommandHandler (EditCommands.ToggleCodeComment)]
+ internal void ToggleCodeComment ()
+ {
+ string commentTag;
+ if (!TryGetLineCommentTag (out commentTag))
+ return;
+ bool comment = false;
+ foreach (var line in GetSelectedLines (Editor)) {
+ int startOffset;
+ int offset = line.Offset;
+ if (!StartsWith (Editor, offset, line.Length, commentTag, out startOffset)) {
+ if (startOffset - offset == line.Length) // case: line consists only of white spaces
+ continue;
+ comment = true;
+ break;
+ }
+ }
+
+ if (comment) {
+ AddCodeComment ();
+ } else {
+ RemoveCodeComment ();
+ }
+ }
+
+ static bool StartsWith (ITextSource text, int offset, int length, string commentTag, out int startOffset)
+ {
+ int max = Math.Min (offset + length, text.Length);
+ int i = offset;
+ for (; i < max; i++) {
+ char ch = text.GetCharAt (i);
+ if (ch != ' ' && ch != '\t')
+ break;
+ }
+ startOffset = i;
+ for (int j = 0; j < commentTag.Length && i < text.Length; j++) {
+ if (text.GetCharAt (i) != commentTag [j])
+ return false;
+ i++;
+ }
+
+ return true;
+ }
+
+ static IEnumerable<IDocumentLine> GetSelectedLines (TextEditor Editor)
+ {
+ if (!Editor.IsSomethingSelected) {
+ yield return Editor.GetLine (Editor.CaretLine);
+ yield break;
+ }
+ var selection = Editor.SelectionRegion;
+ var line = Editor.GetLine(selection.EndLine);
+ if (selection.EndColumn == 1)
+ line = line.PreviousLine;
+
+ while (line != null && line.LineNumber >= selection.BeginLine) {
+ yield return line;
+ line = line.PreviousLine;
+ }
+ }
+
+ [CommandHandler (EditCommands.AddCodeComment)]
+ internal void AddCodeComment ()
+ {
+ string commentTag;
+ if (!TryGetLineCommentTag (out commentTag))
+ return;
+
+ using (var undo = Editor.OpenUndoGroup ()) {
+ var wasSelected = Editor.IsSomethingSelected;
+ var lead = Editor.SelectionLeadOffset;
+ var anchor = Editor.SelectionAnchorOffset;
+ var lineAndIndents = new List<Tuple<IDocumentLine, string>>();
+ string indent = null;
+ var oldVersion = Editor.Version;
+ foreach (var line in GetSelectedLines (Editor)) {
+ var curIndent = line.GetIndentation (Editor);
+ if (line.Length == curIndent.Length) {
+ lineAndIndents.Add (Tuple.Create ((IDocumentLine)null, ""));
+ continue;
+ }
+ if (indent == null || curIndent.Length < indent.Length)
+ indent = curIndent;
+ lineAndIndents.Add (Tuple.Create (line, curIndent));
+ }
+
+ foreach (var line in lineAndIndents) {
+ if (line.Item1 == null)
+ continue;
+ Editor.InsertText (line.Item1.Offset + indent.Length, commentTag);
+ }
+ if (wasSelected) {
+ Editor.SelectionAnchorOffset = oldVersion.MoveOffsetTo (Editor.Version, anchor);
+ Editor.SelectionLeadOffset = oldVersion.MoveOffsetTo (Editor.Version, lead);
+ }
+ }
+ }
+
+ [CommandHandler (EditCommands.RemoveCodeComment)]
+ internal void RemoveCodeComment ()
+ {
+ string commentTag;
+ if (!TryGetLineCommentTag (out commentTag))
+ return;
+
+ using (var undo = Editor.OpenUndoGroup ()) {
+ var wasSelected = Editor.IsSomethingSelected;
+ var lead = Editor.SelectionLeadOffset;
+ var anchor = Editor.SelectionAnchorOffset;
+ int lines = 0;
+
+ //IDocumentLine first = null;
+ IDocumentLine last = null;
+ var oldVersion = Editor.Version;
+ foreach (var line in GetSelectedLines (Editor)) {
+ int startOffset;
+ if (StartsWith (Editor, line.Offset, line.Length, commentTag, out startOffset)) {
+ Editor.RemoveText (startOffset, commentTag.Length);
+ lines++;
+ }
+
+ //first = line;
+ if (last == null)
+ last = line;
+ }
+
+ if (wasSelected) {
+ // if (IdeApp.Workbench != null)
+ // CodeFormatterService.Format (Editor, IdeApp.Workbench.ActiveDocument, TextSegment.FromBounds (first.Offset, last.EndOffset));
+
+ Editor.SelectionAnchorOffset = oldVersion.MoveOffsetTo (Editor.Version, anchor);
+ Editor.SelectionLeadOffset = oldVersion.MoveOffsetTo (Editor.Version, lead);
+ }
+ }
+ }
+
+ [CommandHandler (EditCommands.InsertGuid)]
+ void InsertGuid ()
+ {
+ Editor.InsertAtCaret (Guid.NewGuid ().ToString ());
+ }
+
+ [CommandUpdateHandler (MessageBubbleCommands.Toggle)]
+ public void OnUpdateToggleErrorTextMarker (CommandInfo info)
+ {
+ var line = Editor.GetLine (Editor.CaretLine);
+ if (line == null) {
+ info.Visible = false;
+ return;
+ }
+
+ var marker = (IMessageBubbleLineMarker)Editor.GetLineMarkers (line).FirstOrDefault (m => m is IMessageBubbleLineMarker);
+ info.Visible = marker != null;
+ }
+
+ [CommandHandler (MessageBubbleCommands.Toggle)]
+ public void OnToggleErrorTextMarker ()
+ {
+ var line = Editor.GetLine (Editor.CaretLine);
+ if (line == null)
+ return;
+ var marker = (IMessageBubbleLineMarker)Editor.GetLineMarkers (line).FirstOrDefault (m => m is IMessageBubbleLineMarker);
+ if (marker != null) {
+ marker.IsVisible = !marker.IsVisible;
+ }
+ }
+ #endregion
+
+
+ #region Key bindings
+
+ [CommandHandler (TextEditorCommands.LineEnd)]
+ void OnLineEnd ()
+ {
+ EditActions.MoveCaretToLineEnd (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.LineStart)]
+ void OnLineStart ()
+ {
+ EditActions.MoveCaretToLineStart (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.DeleteLeftChar)]
+ void OnDeleteLeftChar ()
+ {
+ EditActions.Backspace (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.DeleteRightChar)]
+ void OnDeleteRightChar ()
+ {
+ EditActions.Delete (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.CharLeft)]
+ void OnCharLeft ()
+ {
+ EditActions.MoveCaretLeft (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.CharRight)]
+ void OnCharRight ()
+ {
+ EditActions.MoveCaretRight (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.LineUp)]
+ void OnLineUp ()
+ {
+ EditActions.MoveCaretUp (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.LineDown)]
+ void OnLineDown ()
+ {
+ EditActions.MoveCaretDown (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.DocumentStart)]
+ void OnDocumentStart ()
+ {
+ EditActions.MoveCaretToDocumentStart (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.DocumentEnd)]
+ void OnDocumentEnd ()
+ {
+ EditActions.MoveCaretToDocumentEnd (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.PageUp)]
+ void OnPageUp ()
+ {
+ EditActions.PageUp (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.PageDown)]
+ void OnPageDown ()
+ {
+ EditActions.PageDown (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.DeleteLine)]
+ void OnDeleteLine ()
+ {
+ EditActions.DeleteCurrentLine (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.DeleteToLineEnd)]
+ void OnDeleteToLineEnd ()
+ {
+ EditActions.DeleteCurrentLineToEnd (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.ScrollLineUp)]
+ void OnScrollLineUp ()
+ {
+ EditActions.ScrollLineUp (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.ScrollLineDown)]
+ void OnScrollLineDown ()
+ {
+ EditActions.ScrollLineDown (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.ScrollPageUp)]
+ void OnScrollPageUp ()
+ {
+ EditActions.ScrollPageUp (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.ScrollPageDown)]
+ void OnScrollPageDown ()
+ {
+ EditActions.ScrollPageDown (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.GotoMatchingBrace)]
+ void OnGotoMatchingBrace ()
+ {
+ EditActions.GotoMatchingBrace (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.SelectionMoveLeft)]
+ void OnSelectionMoveLeft ()
+ {
+ EditActions.SelectionMoveLeft (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.SelectionMoveRight)]
+ void OnSelectionMoveRight ()
+ {
+ EditActions.SelectionMoveRight (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.MovePrevWord)]
+ void OnMovePrevWord ()
+ {
+ EditActions.MovePrevWord (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.MoveNextWord)]
+ void OnMoveNextWord ()
+ {
+ EditActions.MoveNextWord (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.SelectionMovePrevWord)]
+ void OnSelectionMovePrevWord ()
+ {
+ EditActions.SelectionMovePrevWord (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.SelectionMoveNextWord)]
+ void OnSelectionMoveNextWord ()
+ {
+ EditActions.SelectionMoveNextWord (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.MovePrevSubword)]
+ void OnMovePrevSubword ()
+ {
+ EditActions.MovePrevSubWord (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.MoveNextSubword)]
+ void OnMoveNextSubword ()
+ {
+ EditActions.MoveNextSubWord (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.SelectionMovePrevSubword)]
+ void OnSelectionMovePrevSubword ()
+ {
+ EditActions.SelectionMovePrevSubWord (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.SelectionMoveNextSubword)]
+ void OnSelectionMoveNextSubword ()
+ {
+ EditActions.SelectionMoveNextSubWord (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.SelectionMoveUp)]
+ void OnSelectionMoveUp ()
+ {
+ EditActions.SelectionMoveUp (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.SelectionMoveDown)]
+ void OnSelectionMoveDown ()
+ {
+ EditActions.SelectionMoveDown (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.SelectionMoveHome)]
+ void OnSelectionMoveHome ()
+ {
+ EditActions.SelectionMoveLineStart (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.SelectionMoveEnd)]
+ void OnSelectionMoveEnd ()
+ {
+ EditActions.SelectionMoveLineEnd (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.SelectionMoveToDocumentStart)]
+ void OnSelectionMoveToDocumentStart ()
+ {
+ EditActions.SelectionMoveToDocumentStart (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.ExpandSelectionToLine)]
+ void OnExpandSelectionToLine ()
+ {
+ EditActions.ExpandSelectionToLine (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.SelectionMoveToDocumentEnd)]
+ void OnSelectionMoveToDocumentEnd ()
+ {
+ EditActions.SelectionMoveToDocumentEnd (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.SwitchCaretMode)]
+ void OnSwitchCaretMode ()
+ {
+ EditActions.SwitchCaretMode (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.InsertTab)]
+ void OnInsertTab ()
+ {
+ EditActions.InsertTab (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.RemoveTab)]
+ void OnRemoveTab ()
+ {
+ EditActions.RemoveTab (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.InsertNewLine)]
+ void OnInsertNewLine ()
+ {
+ EditActions.InsertNewLine (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.InsertNewLineAtEnd)]
+ void OnInsertNewLineAtEnd ()
+ {
+ EditActions.InsertNewLineAtEnd (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.InsertNewLinePreserveCaretPosition)]
+ void OnInsertNewLinePreserveCaretPosition ()
+ {
+ EditActions.InsertNewLinePreserveCaretPosition (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.CompleteStatement)]
+ void OnCompleteStatement ()
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ var generator = CodeGenerator.CreateGenerator (doc);
+ if (generator != null) {
+ generator.CompleteStatement (doc);
+ }
+ }
+
+ [CommandHandler (TextEditorCommands.DeletePrevWord)]
+ void OnDeletePrevWord ()
+ {
+ EditActions.DeletePreviousWord (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.DeleteNextWord)]
+ void OnDeleteNextWord ()
+ {
+ EditActions.DeleteNextWord (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.DeletePrevSubword)]
+ void OnDeletePrevSubword ()
+ {
+ EditActions.DeletePreviousSubword (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.DeleteNextSubword)]
+ void OnDeleteNextSubword ()
+ {
+ EditActions.DeleteNextSubword (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.SelectionPageDownAction)]
+ void OnSelectionPageDownAction ()
+ {
+ EditActions.SelectionPageDown (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.SelectionPageUpAction)]
+ void OnSelectionPageUpAction ()
+ {
+ EditActions.SelectionPageUp (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.PulseCaret)]
+ void OnPulseCaretCommand ()
+ {
+ EditActions.StartCaretPulseAnimation (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.TransposeCharacters)]
+ void TransposeCharacters ()
+ {
+ EditActions.TransposeCharacters (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.DuplicateLine)]
+ void DuplicateLine ()
+ {
+ EditActions.DuplicateCurrentLine (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.RecenterEditor)]
+ void RecenterEditor ()
+ {
+ EditActions.RecenterEditor (Editor);
+ }
+
+ [CommandHandler (EditCommands.JoinWithNextLine)]
+ void JoinLines ()
+ {
+ EditActions.JoinLines (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.MoveBlockUp)]
+ void OnMoveBlockUp ()
+ {
+ EditActions.MoveBlockUp (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.MoveBlockDown)]
+ void OnMoveBlockDown ()
+ {
+ EditActions.MoveBlockDown (Editor);
+ }
+
+ [CommandHandler (TextEditorCommands.ToggleBlockSelectionMode)]
+ void OnToggleBlockSelectionMode ()
+ {
+ EditActions.ToggleBlockSelectionMode (Editor);
+ }
+
+ [CommandHandler (EditCommands.IndentSelection)]
+ void IndentSelection ()
+ {
+ EditActions.IndentSelection (Editor);
+ }
+
+ [CommandHandler (EditCommands.UnIndentSelection)]
+ void UnIndentSelection ()
+ {
+ EditActions.UnIndentSelection (Editor);
+ }
+
+
+ [CommandHandler (EditCommands.SortSelectedLines)]
+ void SortSelectedLines ()
+ {
+ EditActions.SortSelectedLines (Editor);
+ }
+
+ [CommandUpdateHandler (EditCommands.SortSelectedLines)]
+ void UpdateSortSelectedLines (CommandInfo ci)
+ {
+ var region = Editor.SelectionRegion;
+ ci.Enabled = region.BeginLine != region.EndLine;
+ }
+ #endregion
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/ErrorHandlerTextEditorExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/ErrorHandlerTextEditorExtension.cs
new file mode 100644
index 0000000000..9632185c24
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/ErrorHandlerTextEditorExtension.cs
@@ -0,0 +1,240 @@
+//
+// ErrorHandlerTextEditorExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Threading;
+using System.Threading.Tasks;
+using Gtk;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace MonoDevelop.Ide.Editor.Extension
+{
+ class ErrorHandlerTextEditorExtension: TextEditorExtension, IQuickTaskProvider
+ {
+ CancellationTokenSource src = new CancellationTokenSource ();
+ bool isDisposed;
+
+ protected override void Initialize ()
+ {
+ DocumentContext.DocumentParsed += DocumentContext_DocumentParsed;
+ }
+
+ public override void Dispose ()
+ {
+ if (isDisposed)
+ return;
+ isDisposed = true;
+
+ this.tasks = ImmutableArray<QuickTask>.Empty;
+ OnTasksUpdated (EventArgs.Empty);
+
+ RemoveErrorUnderlines ();
+ RemoveErrorUndelinesResetTimerId ();
+ CancelDocumentParsedUpdate ();
+ DocumentContext.DocumentParsed -= DocumentContext_DocumentParsed;
+ base.Dispose ();
+ }
+
+ void CancelDocumentParsedUpdate ()
+ {
+ src.Cancel ();
+ src = new CancellationTokenSource ();
+ }
+
+ void DocumentContext_DocumentParsed (object sender, EventArgs e)
+ {
+ CancelDocumentParsedUpdate ();
+ var token = src.Token;
+ var caretLocation = Editor.CaretLocation;
+ var parsedDocument = DocumentContext.ParsedDocument;
+ Task.Run (async () => {
+ try {
+ var ctx = DocumentContext;
+ if (ctx == null)
+ return;
+ await UpdateErrorUndelines (ctx, parsedDocument, token);
+ token.ThrowIfCancellationRequested ();
+ await UpdateQuickTasks (ctx, parsedDocument, token);
+ } catch (OperationCanceledException) {
+ // ignore
+ }
+ }, token);
+ }
+
+ #region Error handling
+ List<IErrorMarker> errors = new List<IErrorMarker> ();
+ uint resetTimerId;
+
+ void RemoveErrorUndelinesResetTimerId ()
+ {
+ if (resetTimerId > 0) {
+ GLib.Source.Remove (resetTimerId);
+ resetTimerId = 0;
+ }
+ }
+
+ void RemoveErrorUnderlines ()
+ {
+ errors.ForEach (err => Editor.RemoveMarker (err));
+ errors.Clear ();
+ }
+
+ void UnderLineError (Error info)
+ {
+ var error = TextMarkerFactory.CreateErrorMarker (Editor, info);
+ Editor.AddMarker (error);
+ errors.Add (error);
+ }
+
+ static string [] lexicalError = {
+ "CS0594", // ERR_FloatOverflow
+ "CS0595", // ERR_InvalidReal
+ "CS1009", // ERR_IllegalEscape
+ "CS1010", // ERR_NewlineInConst
+ "CS1011", // ERR_EmptyCharConst
+ "CS1012", // ERR_TooManyCharsInConst
+ "CS1015", // ERR_TypeExpected
+ "CS1021", // ERR_IntOverflow
+ "CS1032", // ERR_PPDefFollowsTokenpp
+ "CS1035", // ERR_OpenEndedComment
+ "CS1039", // ERR_UnterminatedStringLit
+ "CS1040", // ERR_BadDirectivePlacementpp
+ "CS1056", // ERR_UnexpectedCharacter
+ "CS1056", // ERR_UnexpectedCharacter_EscapedBackslash
+ "CS1646", // ERR_ExpectedVerbatimLiteral
+ "CS0078", // WRN_LowercaseEllSuffix
+ "CS1002", // ; expected
+ "CS1519", // Invalid token ';' in class, struct, or interface member declaration
+ "CS1031", // Type expected
+ "CS0106", // The modifier 'readonly' is not valid for this item
+ "CS1576", // The line number specified for #line directive is missing or invalid
+ "CS1513" // } expected
+ };
+
+ async Task UpdateErrorUndelines (DocumentContext ctx, ParsedDocument parsedDocument, CancellationToken token)
+ {
+ if (!DefaultSourceEditorOptions.Instance.UnderlineErrors || parsedDocument == null || isDisposed)
+ return;
+ try {
+ var errors = await parsedDocument.GetErrorsAsync(token).ConfigureAwait (false);
+ Application.Invoke (delegate {
+ if (token.IsCancellationRequested || isDisposed)
+ return;
+ RemoveErrorUndelinesResetTimerId ();
+ const uint timeout = 500;
+ resetTimerId = GLib.Timeout.Add (timeout, delegate {
+ if (token.IsCancellationRequested) {
+ resetTimerId = 0;
+ return false;
+ }
+ RemoveErrorUnderlines ();
+ // Else we underline the error
+ if (errors != null) {
+ foreach (var error in errors) {
+ if (ctx.IsAdHocProject && !lexicalError.Contains (error.Id))
+ continue;
+ UnderLineError (error);
+ }
+ }
+ resetTimerId = 0;
+ return false;
+ });
+ });
+ } catch (OperationCanceledException) {
+ // ignore
+ }
+ }
+ #endregion
+
+ #region IQuickTaskProvider implementation
+ ImmutableArray<QuickTask> tasks = ImmutableArray<QuickTask>.Empty;
+
+ public event EventHandler TasksUpdated;
+
+ protected virtual void OnTasksUpdated (EventArgs e)
+ {
+ TasksUpdated?.Invoke (this, e);
+ }
+
+ public ImmutableArray<QuickTask> QuickTasks {
+ get {
+ return tasks;
+ }
+ }
+
+ async Task UpdateQuickTasks (DocumentContext ctx, ParsedDocument doc, CancellationToken token)
+ {
+ if (isDisposed)
+ return;
+ var newTasks = ImmutableArray<QuickTask>.Empty.ToBuilder ();
+ if (doc != null) {
+ foreach (var cmt in await doc.GetTagCommentsAsync(token).ConfigureAwait (false)) {
+ if (token.IsCancellationRequested)
+ return;
+ int offset;
+ try {
+ offset = Editor.LocationToOffset (cmt.Region.Begin.Line, cmt.Region.Begin.Column);
+ } catch (Exception) {
+ return;
+ }
+ var newTask = new QuickTask (cmt.Text, offset, DiagnosticSeverity.Info);
+ newTasks.Add (newTask);
+ }
+
+ foreach (var error in await doc.GetErrorsAsync(token).ConfigureAwait (false)) {
+ if (token.IsCancellationRequested)
+ return;
+ if (ctx.IsAdHocProject && !lexicalError.Contains (error.Id))
+ continue;
+ int offset;
+ try {
+ offset = Editor.LocationToOffset (error.Region.Begin.Line, error.Region.Begin.Column);
+ } catch (Exception) {
+ return;
+ }
+ var newTask = new QuickTask (error.Message, offset, error.ErrorType == ErrorType.Error ? DiagnosticSeverity.Error : DiagnosticSeverity.Warning);
+ newTasks.Add (newTask);
+ }
+ }
+ if (token.IsCancellationRequested)
+ return;
+ Application.Invoke (delegate {
+ if (token.IsCancellationRequested || isDisposed)
+ return;
+ tasks = newTasks.ToImmutable ();
+ OnTasksUpdated (EventArgs.Empty);
+ });
+ }
+ #endregion
+
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/FoldingTextEditorExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/FoldingTextEditorExtension.cs
new file mode 100644
index 0000000000..c0e0804dbf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/FoldingTextEditorExtension.cs
@@ -0,0 +1,151 @@
+//
+// FoldingTextEditorExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Gtk;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace MonoDevelop.Ide.Editor.Extension
+{
+ class FoldingTextEditorExtension : TextEditorExtension
+ {
+ CancellationTokenSource src = new CancellationTokenSource ();
+ bool isDisposed;
+
+ protected override void Initialize ()
+ {
+ DocumentContext.DocumentParsed += DocumentContext_DocumentParsed;
+ }
+
+ public override void Dispose ()
+ {
+ if (isDisposed)
+ return;
+ isDisposed = true;
+ CancelDocumentParsedUpdate ();
+ DocumentContext.DocumentParsed -= DocumentContext_DocumentParsed;
+ base.Dispose ();
+ }
+
+ void CancelDocumentParsedUpdate ()
+ {
+ src.Cancel ();
+ src = new CancellationTokenSource ();
+ }
+
+ void DocumentContext_DocumentParsed (object sender, EventArgs e)
+ {
+ CancelDocumentParsedUpdate ();
+ var token = src.Token;
+ var caretLocation = Editor.CaretLocation;
+ var parsedDocument = DocumentContext.ParsedDocument;
+ Task.Run (async () => {
+ try {
+ if (!isDisposed)
+ await UpdateFoldings (Editor, parsedDocument, caretLocation, false, token);
+ } catch (OperationCanceledException) {}
+ }, token);
+ }
+
+ internal static async Task UpdateFoldings (TextEditor Editor, ParsedDocument parsedDocument, DocumentLocation caretLocation, bool firstTime = false, CancellationToken token = default (CancellationToken))
+ {
+ if (parsedDocument == null || !Editor.Options.ShowFoldMargin)
+ return;
+ // don't update parsed documents that contain errors - the foldings from there may be invalid.
+ if (parsedDocument.HasErrors)
+ return;
+
+ try {
+ var foldSegments = new List<IFoldSegment> ();
+
+ foreach (FoldingRegion region in await parsedDocument.GetFoldingsAsync (token)) {
+ if (token.IsCancellationRequested)
+ return;
+ var type = FoldingType.Unknown;
+ bool setFolded = false;
+ bool folded = false;
+ //decide whether the regions should be folded by default
+ switch (region.Type) {
+ case FoldType.Member:
+ type = FoldingType.TypeMember;
+ break;
+ case FoldType.Type:
+ type = FoldingType.TypeDefinition;
+ break;
+ case FoldType.UserRegion:
+ type = FoldingType.Region;
+ setFolded = DefaultSourceEditorOptions.Instance.DefaultRegionsFolding;
+ folded = true;
+ break;
+ case FoldType.Comment:
+ type = FoldingType.Comment;
+ setFolded = DefaultSourceEditorOptions.Instance.DefaultCommentFolding;
+ folded = true;
+ break;
+ case FoldType.CommentInsideMember:
+ type = FoldingType.Comment;
+ setFolded = DefaultSourceEditorOptions.Instance.DefaultCommentFolding;
+ folded = false;
+ break;
+ case FoldType.Undefined:
+ setFolded = true;
+ folded = region.IsFoldedByDefault;
+ break;
+ }
+ var start = Editor.LocationToOffset (region.Region.Begin);
+ var end = Editor.LocationToOffset (region.Region.End);
+ var marker = Editor.CreateFoldSegment (start, end - start);
+ foldSegments.Add (marker);
+ marker.CollapsedText = region.Name;
+ marker.FoldingType = type;
+ //and, if necessary, set its fold state
+ if (marker != null && setFolded && firstTime) {
+ // only fold on document open, later added folds are NOT folded by default.
+ marker.IsCollapsed = folded;
+ continue;
+ }
+ if (marker != null && region.Region.Contains (caretLocation.Line, caretLocation.Column))
+ marker.IsCollapsed = false;
+ }
+ if (firstTime) {
+ Editor.SetFoldings (foldSegments);
+ } else {
+ Application.Invoke (delegate {
+ if (!token.IsCancellationRequested)
+ Editor.SetFoldings (foldSegments);
+ });
+ }
+ } catch (Exception ex) {
+ LoggingService.LogError ("Unhandled exception in ParseInformationUpdaterWorkerThread", ex);
+ }
+ }
+
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/IQuickTaskProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/IQuickTaskProvider.cs
new file mode 100644
index 0000000000..53bd9925dc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/IQuickTaskProvider.cs
@@ -0,0 +1,41 @@
+//
+// IQuickTaskProvider.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+
+namespace MonoDevelop.Ide.Editor.Extension
+{
+ public interface IQuickTaskProvider
+ {
+ ImmutableArray<QuickTask> QuickTasks {
+ get;
+ }
+
+ event EventHandler TasksUpdated;
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/IndentationTracker.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/IndentationTracker.cs
new file mode 100644
index 0000000000..744e6e6050
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/IndentationTracker.cs
@@ -0,0 +1,54 @@
+//
+// IndentationTracker.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+
+namespace MonoDevelop.Ide.Editor.Extension
+{
+ [Flags]
+ public enum IndentatitonTrackerFeatures {
+ None = 0,
+ SmartBackspace = 1,
+ All = SmartBackspace
+ }
+
+ /// <summary>
+ /// The indentation tracker is for giving the editor information about virtual line indentations.
+ /// </summary>
+ public abstract class IndentationTracker
+ {
+ public virtual IndentatitonTrackerFeatures SupportedFeatures {
+ get {
+ return IndentatitonTrackerFeatures.All;
+ }
+ }
+
+ /// <summary>
+ /// Gets the indentation string for a given line.
+ /// </summary>
+ public abstract string GetIndentationString (int lineNumber);
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/KeyDescriptor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/KeyDescriptor.cs
new file mode 100644
index 0000000000..5acbceef22
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/KeyDescriptor.cs
@@ -0,0 +1,220 @@
+//
+// KeyDescriptor.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+#if MAC
+using AppKit;
+#endif
+
+namespace MonoDevelop.Ide.Editor.Extension
+{
+ public struct KeyDescriptor
+ {
+ public static KeyDescriptor Empty = new KeyDescriptor (SpecialKey.None, '\0', ModifierKeys.None, null);
+
+ public readonly SpecialKey SpecialKey;
+ public readonly char KeyChar;
+ public readonly ModifierKeys ModifierKeys;
+ public readonly object NativeKeyChar;
+
+ KeyDescriptor (SpecialKey specialKey, char keyChar, ModifierKeys modifierKeys, object nativeKeyChar)
+ {
+ SpecialKey = specialKey;
+ KeyChar = keyChar;
+ ModifierKeys = modifierKeys;
+ NativeKeyChar = nativeKeyChar;
+ }
+
+ public override string ToString ()
+ {
+ return string.Format ("[KeyDescriptor: SpecialKey={0}, KeyChar={1}, ModifierKeys={2}]", SpecialKey, KeyChar, ModifierKeys);
+ }
+
+ #region GTK
+ public static KeyDescriptor FromGtk (Gdk.Key key, char ch, Gdk.ModifierType state)
+ {
+ return new KeyDescriptor (ConvertKey (key), ch, ConvertModifiers (state), Tuple.Create (key, state));
+ }
+
+ static SpecialKey ConvertKey (Gdk.Key key)
+ {
+ switch (key) {
+ case Gdk.Key.BackSpace:
+ return SpecialKey.BackSpace;
+ case Gdk.Key.Tab:
+ case Gdk.Key.KP_Tab:
+ case Gdk.Key.ISO_Left_Tab:
+ return SpecialKey.Tab;
+ case Gdk.Key.Return:
+ case Gdk.Key.KP_Enter:
+ case Gdk.Key.ISO_Enter:
+ return SpecialKey.Return;
+ case Gdk.Key.Escape:
+ return SpecialKey.Escape;
+ case Gdk.Key.space:
+ case Gdk.Key.KP_Space:
+ return SpecialKey.Space;
+ case Gdk.Key.Page_Up:
+ case Gdk.Key.KP_Page_Up:
+ return SpecialKey.PageUp;
+ case Gdk.Key.Page_Down:
+ case Gdk.Key.KP_Page_Down:
+ return SpecialKey.PageDown;
+ case Gdk.Key.End:
+ case Gdk.Key.KP_End:
+ return SpecialKey.End;
+ case Gdk.Key.Home:
+ case Gdk.Key.KP_Home:
+ return SpecialKey.Home;
+ case Gdk.Key.Left:
+ case Gdk.Key.KP_Left:
+ return SpecialKey.Left;
+ case Gdk.Key.Up:
+ case Gdk.Key.KP_Up:
+ return SpecialKey.Up;
+ case Gdk.Key.Right:
+ case Gdk.Key.KP_Right:
+ return SpecialKey.Right;
+ case Gdk.Key.Down:
+ case Gdk.Key.KP_Down:
+ return SpecialKey.Down;
+ case Gdk.Key.Delete:
+ case Gdk.Key.KP_Delete:
+ return SpecialKey.Delete;
+ }
+ return SpecialKey.None;
+ }
+
+ static ModifierKeys ConvertModifiers (Gdk.ModifierType s)
+ {
+ ModifierKeys m = ModifierKeys.None;
+ if ((s & Gdk.ModifierType.ShiftMask) != 0)
+ m |= ModifierKeys.Shift;
+ if ((s & Gdk.ModifierType.ControlMask) != 0)
+ m |= ModifierKeys.Control;
+ if ((s & Gdk.ModifierType.Mod1Mask) != 0)
+ m |= ModifierKeys.Alt;
+ if ((s & Gdk.ModifierType.Mod2Mask) != 0)
+ m |= ModifierKeys.Command;
+ if ((s & Gdk.ModifierType.MetaMask) != 0)
+ m |= ModifierKeys.Command;
+ return m;
+ }
+ #endregion
+
+ #if MAC
+
+ public static KeyDescriptor FromMac (char ch, NSEventModifierMask state)
+ {
+ var specialKey = ConvertKey (ref ch);
+ var keyDescriptor = new KeyDescriptor (specialKey, ch, ConvertModifiers (state), state);
+ return keyDescriptor;
+ }
+
+ static SpecialKey ConvertKey (ref char ch)
+ {
+ if (ch == '\n' || ch == '\r') {
+ ch = '\0';
+ return SpecialKey.Return;
+ }
+ if (ch == '\t') {
+ ch = '\0';
+ return SpecialKey.Tab;
+ }
+ if (ch == '\b' || ch == (char)127) {
+ ch = '\0';
+ return SpecialKey.BackSpace;
+ }
+ if (ch == (char)27) {
+ ch = '\0';
+ return SpecialKey.Escape;
+ }
+ switch ((NSKey)ch) {
+ case NSKey.Delete:
+ ch = '\0';
+ return SpecialKey.BackSpace;
+ case NSKey.Tab:
+ ch = '\0';
+ return SpecialKey.Tab;
+ case NSKey.Return:
+ case NSKey.KeypadEnter:
+ ch = '\0';
+ return SpecialKey.Return;
+ case NSKey.Escape:
+ ch = '\0';
+ return SpecialKey.Escape;
+ case NSKey.Space:
+ ch = '\0';
+ return SpecialKey.Space;
+ case NSKey.PageUp:
+ ch = '\0';
+ return SpecialKey.PageUp;
+ case NSKey.PageDown:
+ ch = '\0';
+ return SpecialKey.PageDown;
+ case NSKey.End:
+ ch = '\0';
+ return SpecialKey.End;
+ case NSKey.Home:
+ ch = '\0';
+ return SpecialKey.Home;
+ case NSKey.LeftArrow:
+ ch = '\0';
+ return SpecialKey.Left;
+ case NSKey.UpArrow:
+ ch = '\0';
+ return SpecialKey.Up;
+ case NSKey.RightArrow:
+ ch = '\0';
+ return SpecialKey.Right;
+ case NSKey.DownArrow:
+ ch = '\0';
+ return SpecialKey.Down;
+ case NSKey.ForwardDelete:
+ ch = '\0';
+ return SpecialKey.Delete;
+ }
+ return SpecialKey.None;
+ }
+
+
+
+ static ModifierKeys ConvertModifiers (NSEventModifierMask e)
+ {
+ var m = ModifierKeys.None;
+ if ((e & NSEventModifierMask.ControlKeyMask) != 0)
+ m |= ModifierKeys.Control;
+ if ((e & NSEventModifierMask.AlternateKeyMask) != 0)
+ m |= ModifierKeys.Alt;
+ if ((e & NSEventModifierMask.CommandKeyMask) != 0)
+ m |= ModifierKeys.Command;
+ if ((e & NSEventModifierMask.ShiftKeyMask) != 0)
+ m |= ModifierKeys.Shift;
+ return m;
+ }
+ #endif
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/ModifierKeys.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/ModifierKeys.cs
new file mode 100644
index 0000000000..4b902cdf0f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/ModifierKeys.cs
@@ -0,0 +1,40 @@
+//
+// ModifierKeys.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Ide.Editor.Extension
+{
+ [Flags]
+ public enum ModifierKeys
+ {
+ None = 0,
+ Alt = 0x1 << 0,
+ Control = 0x1 << 1,
+ Shift = 0x1 << 2,
+ Command = 0x1 << 3
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/QuickTask.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/QuickTask.cs
new file mode 100644
index 0000000000..96162525b1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/QuickTask.cs
@@ -0,0 +1,76 @@
+//
+// QuickTask.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Gtk;
+using System.Collections.Generic;
+using Gdk;
+using MonoDevelop.Core;
+using MonoDevelop.Ide;
+using MonoDevelop.Components.Commands;
+using Microsoft.CodeAnalysis;
+
+namespace MonoDevelop.Ide.Editor.Extension
+{
+ public sealed class QuickTask
+ {
+ Lazy<string> description;
+ public string Description {
+ get {
+ return description.Value;
+ }
+ }
+
+ public int Location {
+ get;
+ private set;
+ }
+
+ public DiagnosticSeverity Severity {
+ get;
+ private set;
+ }
+
+ public QuickTask (Func<string> descriptionFunc, int location, DiagnosticSeverity severity)
+ {
+ this.description = new Lazy<string> (descriptionFunc);
+ this.Location = location;
+ this.Severity = severity;
+ }
+
+ public QuickTask (string description, int location, DiagnosticSeverity severity)
+ {
+ this.description = new Lazy<string> (() => description);
+ this.Location = location;
+ this.Severity = severity;
+ }
+
+ public override string ToString ()
+ {
+ return string.Format ("[QuickTask: Description={0}, Location={1}, Severity={2}]", Description, Location, Severity);
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/SelectionSurroundingProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/SelectionSurroundingProvider.cs
new file mode 100644
index 0000000000..903e05a6ba
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/SelectionSurroundingProvider.cs
@@ -0,0 +1,57 @@
+//
+// ISelectionSurroundingProvider.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Components.PropertyGrid.PropertyEditors;
+
+namespace MonoDevelop.Ide.Editor.Extension
+{
+ /// <summary>
+ /// A selection surrounding provider handles a special handling how the text editor behaves when the user
+ /// types a key with a selection. The selection can be surrounded instead of beeing replaced.
+ /// </summary>
+ public abstract class SelectionSurroundingProvider
+ {
+ /// <summary>
+ /// Gets the selection surroundings for a given unicode key.
+ /// </summary>
+ /// <returns>
+ /// true, if the key is valid for a surrounding action.
+ /// </returns>
+ /// <param name='unicodeKey'>
+ /// The key to handle.
+ /// </param>
+ /// <param name='start'>
+ /// The start of the surrounding
+ /// </param>
+ /// <param name='end'>
+ /// The end of the surrounding
+ /// </param>
+ public abstract bool GetSelectionSurroundings (uint unicodeKey, out string start, out string end);
+
+ public abstract void HandleSpecialSelectionKey (uint unicodeKey);
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/SpecialKey.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/SpecialKey.cs
new file mode 100644
index 0000000000..f16b4d1c99
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/SpecialKey.cs
@@ -0,0 +1,48 @@
+//
+// SpecialKey.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Ide.Editor.Extension
+{
+ public enum SpecialKey
+ {
+ None,
+ BackSpace = 0xff08,
+ Tab = 0xff09,
+ Return = 0xff0d,
+ Escape = 0xff1b,
+ Space = 0x20,
+ PageUp = 0xff55,
+ PageDown = 0xff56,
+ End = 0xff57,
+ Home = 0xff50,
+ Left = 0xff51,
+ Up = 0xff52,
+ Right = 0xff53,
+ Down = 0xff54,
+ Delete = 0xffff
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/TextEditorExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/TextEditorExtension.cs
new file mode 100644
index 0000000000..a6b4cf594c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/TextEditorExtension.cs
@@ -0,0 +1,126 @@
+//
+// AbstractEditorExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide.TypeSystem;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Ide.Editor.Extension
+{
+ public abstract class TextEditorExtension : ICommandRouter, IDisposable
+ {
+ public DocumentContext DocumentContext {
+ get;
+ protected set;
+ }
+
+ public TextEditor Editor {
+ get;
+ protected set;
+ }
+
+ internal TextEditorExtension Next {
+ get;
+ set;
+ }
+
+ protected internal void Initialize (TextEditor editor, DocumentContext context)
+ {
+ if (editor == null)
+ throw new ArgumentNullException ("editor");
+ if (context == null)
+ throw new ArgumentNullException ("context");
+ if (DocumentContext != null)
+ throw new InvalidOperationException ("Extension is already initialized.");
+ DocumentContext = context;
+ Editor = editor;
+ Initialize ();
+ }
+
+ protected virtual void Initialize ()
+ {
+ }
+
+ public virtual bool IsValidInContext (DocumentContext context)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Return true if the key press should be processed by the editor.
+ /// When a key is pressed, and before the key is processed by the editor, this method will be invoked.
+ /// </summary>
+ public virtual bool KeyPress (KeyDescriptor descriptor)
+ {
+ return Next == null || Next.KeyPress (descriptor);
+ }
+
+ public virtual void Dispose ()
+ {
+ Editor = null;
+ DocumentContext = null;
+ }
+
+ void CheckInitialized ()
+ {
+ if (DocumentContext == null)
+ throw new InvalidOperationException ("Editor extension not yet initialized");
+ }
+
+ object ICommandRouter.GetNextCommandTarget ()
+ {
+ return Next;
+ }
+
+ internal protected virtual object OnGetContent (Type type)
+ {
+ if (type.IsInstanceOfType (this))
+ return this;
+ else
+ return null;
+ }
+
+ internal protected virtual IEnumerable<object> OnGetContents (Type type)
+ {
+ var c = OnGetContent (type);
+ if (c != null)
+ yield return c;
+ }
+ }
+
+ class TextEditorExtensionMarker : TextEditorExtension
+ {
+ public override bool IsValidInContext (DocumentContext context)
+ {
+ return false;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/TextPasteHandler.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/TextPasteHandler.cs
new file mode 100644
index 0000000000..ee3518ecc0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/TextPasteHandler.cs
@@ -0,0 +1,64 @@
+//
+// TextPasteHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+
+namespace MonoDevelop.Ide.Editor.Extension
+{
+ /// <summary>
+ /// The text paste handler can do formattings to a text that is about to be pasted
+ /// into the text document.
+ /// </summary>
+ public abstract class TextPasteHandler
+ {
+ /// <summary>
+ /// Formats plain text that is inserted at a specified offset.
+ /// </summary>
+ /// <returns>
+ /// The text that will get inserted at that position.
+ /// </returns>
+ /// <param name="offset">The offset where the text will be inserted.</param>
+ /// <param name="text">The text to be inserted.</param>
+ /// <param name="copyData">Additional data in case the text was copied from a Mono.TextEditor.</param>
+ public abstract string FormatPlainText(int offset, string text, byte[] copyData);
+
+ /// <summary>
+ /// Gets the copy data for a specific segment inside the document. This can contain meta data about the text pasted.
+ /// For example 'text pasted from string'.
+ /// </summary>
+ /// <param name = "offset">The copy offset.</param>
+ /// <param name = "length">The length of the copied text.</param>
+ public abstract byte[] GetCopyData(int offset, int length);
+
+ /// <summary>
+ /// This is called after text was pasted. This is useful for creating an additional undo step for the paste command.
+ /// </summary>
+ /// <param name="offset">The offset the text was pasted at.</param>
+ /// <param name="length">The length of the text pasted.</param>
+ public abstract void PostFomatPastedText (int offset, int length);
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/Usage.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/Usage.cs
new file mode 100644
index 0000000000..ea8dade4d3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/Usage.cs
@@ -0,0 +1,49 @@
+//
+// IUsageProvider.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using ICSharpCode.NRefactory;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.FindInFiles;
+
+namespace MonoDevelop.Ide.Editor.Extension
+{
+ public sealed class Usage : AbstractSegment
+ {
+ public readonly ReferenceUsageType UsageType;
+
+ public Usage (TextSegment segment, ReferenceUsageType usageType) : base (segment.Offset, segment.Length)
+ {
+ UsageType = usageType;
+ }
+
+ public Usage (int offset, int length, ReferenceUsageType usageType) : base (offset, length)
+ {
+ UsageType = usageType;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/AmbientColor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/AmbientColor.cs
new file mode 100644
index 0000000000..39f683371d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/AmbientColor.cs
@@ -0,0 +1,187 @@
+//
+// AmbientColor.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Linq;
+using System.Xml.Linq;
+using System.Xml.XPath;
+using System.Reflection;
+using MonoDevelop.Components;
+
+namespace MonoDevelop.Ide.Editor.Highlighting
+{
+ public sealed class AmbientColor
+ {
+ public string Name { get; private set; }
+ public readonly List<Tuple<string, HslColor>> Colors = new List<Tuple<string, HslColor>> ();
+
+ public HslColor Color {
+ get {
+ return GetColor ("color");
+ }
+ set {
+ for (int i = 0; i < Colors.Count; i++) {
+ var t = Colors [i];
+ if (t.Item1 == "color") {
+ Colors [i] = Tuple.Create ("color", value);
+ return;
+ }
+ }
+ Colors.Add (Tuple.Create ("color", value));
+ }
+ }
+
+ public HslColor SecondColor {
+ get {
+ return GetColor ("secondcolor");
+ }
+ set {
+ for (int i = 0; i < Colors.Count; i++) {
+ var t = Colors [i];
+ if (t.Item1 == "secondcolor") {
+ Colors [i] = Tuple.Create ("secondcolor", value);
+ return;
+ }
+ }
+ Colors.Add (Tuple.Create ("secondcolor", value));
+ }
+ }
+
+ public bool HasSecondColor {
+ get {
+ return Colors.Any (c => c.Item1 == "secondcolor");
+ }
+ }
+
+ public HslColor BorderColor {
+ get {
+ return GetColor ("bordercolor");
+ }
+ set {
+ for (int i = 0; i < Colors.Count; i++) {
+ var t = Colors [i];
+ if (t.Item1 == "bordercolor") {
+ Colors [i] = Tuple.Create ("bordercolor", value);
+ return;
+ }
+ }
+ Colors.Add (Tuple.Create ("bordercolor", value));
+ }
+ }
+
+ public bool HasBorderColor {
+ get {
+ return Colors.Any (c => c.Item1 == "bordercolor");
+ }
+ }
+
+ public HslColor GetColor (string name)
+ {
+ foreach (var color in Colors) {
+ if (color.Item1 == name)
+ return color.Item2;
+ }
+
+ return new HslColor (0, 0, 0);
+ }
+
+ internal static AmbientColor Create (XElement element, Dictionary<string, HslColor> palette)
+ {
+ var result = new AmbientColor ();
+ foreach (var node in element.DescendantNodes ()) {
+ if (node.NodeType == System.Xml.XmlNodeType.Element) {
+ var el = (XElement)node;
+ switch (el.Name.LocalName) {
+ case "name":
+ result.Name = el.Value;
+ break;
+ default:
+ result.Colors.Add (Tuple.Create (el.Name.LocalName, ColorScheme.ParsePaletteColor (palette, el.Value)));
+ break;
+ }
+ }
+ }
+
+ return result;
+ }
+
+ public override bool Equals (object obj)
+ {
+ if (obj == null)
+ return false;
+ if (ReferenceEquals (this, obj))
+ return true;
+ if (obj.GetType () != typeof(AmbientColor))
+ return false;
+ AmbientColor other = (AmbientColor)obj;
+ return Colors.Equals (other.Colors) && Name == other.Name;
+ }
+
+ public override int GetHashCode ()
+ {
+ unchecked {
+ return (Colors != null ? Colors.GetHashCode () : 0) ^ (Name != null ? Name.GetHashCode () : 0);
+ }
+ }
+
+ internal static AmbientColor Import (Dictionary<string, ColorScheme.VSSettingColor> colors, string vsSetting)
+ {
+ var result = new AmbientColor ();
+ var attrs = vsSetting.Split (',');
+ foreach (var attr in attrs) {
+ var info = attr.Split ('=');
+ if (info.Length != 2)
+ continue;
+ var idx = info [1].LastIndexOf ('/');
+ var source = info [1].Substring (0, idx);
+ var dest = info [1].Substring (idx + 1);
+
+ ColorScheme.VSSettingColor color;
+ if (!colors.TryGetValue (source, out color))
+ continue;
+ result.Name = color.Name;
+ string colorString;
+ switch (dest) {
+ case "Foreground":
+ colorString = color.Foreground;
+ break;
+ case "Background":
+ colorString = color.Background;
+ break;
+ default:
+ throw new InvalidDataException ("Invalid attribute source: " + dest);
+ }
+ result.Colors.Add (Tuple.Create (info [0], ColorScheme.ImportVsColor (colorString)));
+ }
+ if (result.Colors.Count == 0)
+ return null;
+ return result;
+ }
+ }
+
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ChunkStyle.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ChunkStyle.cs
new file mode 100644
index 0000000000..e289421edd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ChunkStyle.cs
@@ -0,0 +1,173 @@
+//
+// ChunkStyle.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Xml.Linq;
+using MonoDevelop.Components;
+
+namespace MonoDevelop.Ide.Editor.Highlighting
+{
+ public sealed class ChunkStyle
+ {
+ public string Name { get; set; }
+ public HslColor Foreground { get; set; }
+ public HslColor Background { get; set; }
+
+ public bool TransparentForeground {
+ get {
+ return Foreground.Alpha == 0.0;
+
+ }
+ }
+
+ public bool TransparentBackground {
+ get {
+ return Background.Alpha == 0.0;
+ }
+ }
+
+ public Xwt.Drawing.FontWeight FontWeight { get; set; }
+
+ public Xwt.Drawing.FontStyle FontStyle { get; set; }
+
+ public bool Underline {
+ get; set;
+ }
+
+ public ChunkStyle ()
+ {
+ Foreground = Background = new HslColor (0, 0, 0, 0);
+ FontWeight = Xwt.Drawing.FontWeight.Normal;
+ FontStyle = Xwt.Drawing.FontStyle.Normal;
+ }
+
+ public ChunkStyle (ChunkStyle baseStyle)
+ {
+ this.Name = baseStyle.Name;
+ this.Foreground = baseStyle.Foreground;
+ this.Background = baseStyle.Background;
+ this.FontWeight = baseStyle.FontWeight;
+ this.FontStyle = baseStyle.FontStyle;
+ this.Underline = baseStyle.Underline;
+ }
+
+ public override bool Equals (object obj)
+ {
+ if (obj == null)
+ return false;
+ if (ReferenceEquals (this, obj))
+ return true;
+ if (obj.GetType () != typeof(ChunkStyle))
+ return false;
+ ChunkStyle other = (ChunkStyle)obj;
+ return Name == other.Name && Foreground.Equals (other.Foreground) && Background.Equals (other.Background) && FontWeight == other.FontWeight && FontStyle == other.FontStyle;
+ }
+
+ public override int GetHashCode ()
+ {
+ unchecked {
+ return (Name != null ? Name.GetHashCode () : 0) ^ Foreground.GetHashCode () ^ Background.GetHashCode () ^ FontWeight.GetHashCode () ^ FontStyle.GetHashCode ();
+ }
+ }
+
+ internal static ChunkStyle Create (XElement element, Dictionary<string, HslColor> palette)
+ {
+ var result = new ChunkStyle ();
+
+ foreach (var node in element.DescendantNodes ()) {
+ if (node.NodeType == System.Xml.XmlNodeType.Element) {
+ var el = (XElement)node;
+ switch (el.Name.LocalName) {
+ case "name":
+ result.Name = el.Value;
+ break;
+ case "fore":
+ result.Foreground = ColorScheme.ParsePaletteColor (palette, el.Value);
+ break;
+ case "back":
+ result.Background = ColorScheme.ParsePaletteColor (palette, el.Value);
+ break;
+ case "weight":
+ Xwt.Drawing.FontWeight weight;
+ if (!Enum.TryParse<Xwt.Drawing.FontWeight> (el.Value, true, out weight))
+ throw new InvalidDataException (el.Value + " is no valid text weight values are: " + string.Join (",", Enum.GetNames (typeof(Xwt.Drawing.FontWeight))) );
+ result.FontWeight = weight;
+ break;
+ case "style":
+ Xwt.Drawing.FontStyle style;
+ if (!Enum.TryParse<Xwt.Drawing.FontStyle> (el.Value, true, out style))
+ throw new InvalidDataException (el.Value + " is no valid text weight values are: " + string.Join (",", Enum.GetNames (typeof(Xwt.Drawing.FontStyle))) );
+ result.FontStyle = style;
+ break;
+ default:
+ throw new InvalidDataException ("Invalid element in text color:" + el.Name);
+ }
+ }
+ }
+
+ return result;
+ }
+
+ internal Gdk.GC CreateBgGC (Gdk.Drawable drawable)
+ {
+ return new Gdk.GC (drawable) { RgbBgColor = (HslColor)Foreground, RgbFgColor = (HslColor)Background };
+ }
+
+ internal Gdk.GC CreateFgGC (Gdk.Drawable drawable)
+ {
+ return new Gdk.GC (drawable) { RgbBgColor = (HslColor)Background, RgbFgColor = (HslColor)Foreground };
+ }
+
+ public override string ToString ()
+ {
+ return string.Format ("[ChunkStyle: Name={0}, CairoColor={1}, CairoBackgroundColor={2}, FontWeight={3}, FontStyle={4}]", Name, Foreground, Background, FontWeight, FontStyle);
+ }
+
+ internal static ChunkStyle Import (string name, ColorScheme.VSSettingColor vsc)
+ {
+ var textColor = new ChunkStyle ();
+ textColor.Name = name;
+ if (!string.IsNullOrEmpty (vsc.Foreground) && vsc.Foreground != "0x02000000") {
+ textColor.Foreground = ColorScheme.ImportVsColor (vsc.Foreground);
+ if (textColor.TransparentForeground && name != "Selected Text" && name != "Selected Text(Inactive)")
+ textColor.Foreground = new HslColor (0, 0, 0);
+ }
+ if (!string.IsNullOrEmpty (vsc.Background) && vsc.Background != "0x02000000")
+ textColor.Background = ColorScheme.ImportVsColor (vsc.Background);
+ if (vsc.BoldFont)
+ textColor.FontWeight = Xwt.Drawing.FontWeight.Bold;
+ return textColor;
+ }
+
+ public ChunkStyle Clone ()
+ {
+ return (ChunkStyle)this.MemberwiseClone ();
+ }
+ }
+
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ColorDescriptionAttribute.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ColorDescriptionAttribute.cs
new file mode 100644
index 0000000000..7b600bfe60
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ColorDescriptionAttribute.cs
@@ -0,0 +1,47 @@
+//
+// ColorDescriptionAttribute.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+
+namespace MonoDevelop.Ide.Editor.Highlighting
+{
+ sealed class ColorDescriptionAttribute : Attribute
+ {
+ public string Name { get; private set; }
+ public string Description { get; set; }
+ public string VSSetting { get; set; }
+
+ public ColorDescriptionAttribute (string name)
+ {
+ Name = name;
+ }
+
+ public override string ToString ()
+ {
+ return string.Format ("[ColorDescriptionAttribute: Name={0}, Description={1}, VSSetting={2}]", Name, Description, VSSetting);
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ColorScheme.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ColorScheme.cs
new file mode 100644
index 0000000000..83a9630d7c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ColorScheme.cs
@@ -0,0 +1,1072 @@
+//
+// ColorScheme.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Linq;
+using System.Xml.Linq;
+using System.Xml.XPath;
+using System.Reflection;
+using System.Text;
+using System.Xml;
+using MonoDevelop.Components;
+
+namespace MonoDevelop.Ide.Editor.Highlighting
+{
+ public sealed class ColorScheme
+ {
+ public static string DefaultColorStyle = "Light";
+ public static string DefaultDarkColorStyle = "Dark";
+
+ public string Name { get; set; }
+ public string Description { get; set; }
+ public string Originator { get; set; }
+ public string BaseScheme { get; set; }
+ public string FileName { get; set; }
+
+ #region Ambient Colors
+
+ [ColorDescription("Background(Read Only)",VSSetting="color=Plain Text/Background")]
+ public AmbientColor BackgroundReadOnly { get; private set; }
+
+ [ColorDescription("Search result background")]
+ public AmbientColor SearchResult { get; private set; }
+
+ [ColorDescription("Search result background (highlighted)")]
+ public AmbientColor SearchResultMain { get; private set; }
+
+ [ColorDescription("Fold Square", VSSetting="color=outlining.verticalrule/Foreground")]
+ public AmbientColor FoldLineColor { get; private set; }
+
+ [ColorDescription("Fold Cross", VSSetting="color=outlining.square/Foreground,secondcolor=outlining.square/Background")]
+ public AmbientColor FoldCross { get; private set; }
+
+ [ColorDescription("Indentation Guide")] // not defined
+ public AmbientColor IndentationGuide { get; private set; }
+
+ [ColorDescription("Indicator Margin", VSSetting="color=Indicator Margin/Background")]
+ public AmbientColor IndicatorMargin { get; private set; }
+
+ [ColorDescription("Indicator Margin(Separator)", VSSetting="color=Indicator Margin/Background")]
+ public AmbientColor IndicatorMarginSeparator { get; private set; }
+
+ [ColorDescription("Tooltip Pager Top")]
+ public AmbientColor TooltipPager { get; private set; }
+
+ [ColorDescription("Tooltip Pager Triangle")]
+ public AmbientColor TooltipPagerTriangle { get; private set; }
+
+ [ColorDescription("Tooltip Pager Text")]
+ public AmbientColor TooltipPagerText { get; private set; }
+
+ [ColorDescription("Notification Border")]
+ public AmbientColor NotificationBorder { get; private set; }
+
+ [ColorDescription("Bookmarks")]
+ public AmbientColor Bookmarks { get; private set; }
+
+ [ColorDescription("Underline(Error)", VSSetting="color=Syntax Error/Foreground")]
+ public AmbientColor UnderlineError { get; private set; }
+
+ [ColorDescription("Underline(Warning)", VSSetting="color=Warning/Foreground")]
+ public AmbientColor UnderlineWarning { get; private set; }
+
+ [ColorDescription("Underline(Suggestion)", VSSetting="color=Other Error/Foreground")]
+ public AmbientColor UnderlineSuggestion { get; private set; }
+
+ [ColorDescription("Underline(Hint)", VSSetting="color=Other Error/Foreground")]
+ public AmbientColor UnderlineHint { get; private set; }
+
+ [ColorDescription("Quick Diff(Dirty)")]
+ public AmbientColor QuickDiffDirty { get; private set; }
+
+ [ColorDescription("Quick Diff(Changed)")]
+ public AmbientColor QuickDiffChanged { get; private set; }
+
+ [ColorDescription("Brace Matching(Rectangle)", VSSetting="color=Brace Matching (Rectangle)/Background,secondcolor=Brace Matching (Rectangle)/Foreground")]
+ public AmbientColor BraceMatchingRectangle { get; private set; }
+
+ [ColorDescription("Usages(Rectangle)", VSSetting="color=MarkerFormatDefinition/HighlightedReference/Background,secondcolor=MarkerFormatDefinition/HighlightedReference/Background,bordercolor=MarkerFormatDefinition/HighlightedReference/Background")]
+ public AmbientColor UsagesRectangle { get; private set; }
+
+ [ColorDescription("Changing usages(Rectangle)", VSSetting="color=MarkerFormatDefinition/HighlightedReference/Foreground,secondcolor=MarkerFormatDefinition/HighlightedReference/Foreground,bordercolor=MarkerFormatDefinition/HighlightedReference/Foreground")]
+ public AmbientColor ChangingUsagesRectangle { get; private set; }
+
+ [ColorDescription("Breakpoint Marker", VSSetting = "color=Breakpoint (Enabled)/Background")]
+ public AmbientColor BreakpointMarker { get; private set; }
+
+ [ColorDescription("Breakpoint Marker(Invalid)", VSSetting = "color=Breakpoint (Disabled)/Background")]
+ public AmbientColor BreakpointMarkerInvalid { get; private set; }
+
+ [ColorDescription("Breakpoint Marker(Disabled)")]
+ public AmbientColor BreakpointMarkerDisabled { get; private set; }
+
+ [ColorDescription("Debugger Current Line Marker", VSSetting = "color=Current Statement/Background")]
+ public AmbientColor DebuggerCurrentLineMarker { get; private set; }
+
+ [ColorDescription("Debugger Stack Line Marker")]
+ public AmbientColor DebuggerStackLineMarker { get; private set; }
+
+ [ColorDescription("Primary Link", VSSetting = "color=Refactoring Dependent Field/Background" )]
+ public AmbientColor PrimaryTemplate { get; private set; }
+
+ [ColorDescription("Primary Link(Highlighted)", VSSetting = "color=Refactoring Current Field/Background")]
+ public AmbientColor PrimaryTemplateHighlighted { get; private set; }
+
+ [ColorDescription("Secondary Link")] // not defined
+ public AmbientColor SecondaryTemplate { get; private set; }
+
+ [ColorDescription("Secondary Link(Highlighted)")] // not defined
+ public AmbientColor SecondaryTemplateHighlighted { get; private set; }
+
+ [ColorDescription("Current Line Marker", VSSetting = "color=CurrentLineActiveFormat/Background,secondcolor=CurrentLineActiveFormat/Foreground")]
+ public AmbientColor LineMarker { get; private set; }
+
+ [ColorDescription("Current Line Marker(Inactive)", VSSetting = "color=CurrentLineInactiveFormat/Background,secondcolor=CurrentLineInactiveFormat/Foreground")]
+ public AmbientColor LineMarkerInactive { get; private set; }
+
+ [ColorDescription("Column Ruler")] // not defined
+ public AmbientColor Ruler { get; private set; }
+
+ [ColorDescription("Completion Window", VSSetting = "color=Plain Text/Background")]
+ public AmbientColor CompletionWindow { get; private set; }
+
+ [ColorDescription("Completion Tooltip Window", VSSetting = "color=Plain Text/Background")]
+ public AmbientColor CompletionTooltipWindow { get; private set; }
+
+ [ColorDescription("Completion Selection Bar Border", VSSetting = "color=Selected Text/Background")]
+ public AmbientColor CompletionSelectionBarBorder { get; private set; }
+
+ [ColorDescription("Completion Selection Bar Background", VSSetting = "color=Selected Text/Background,secondcolor=Selected Text/Background")]
+ public AmbientColor CompletionSelectionBarBackground { get; private set; }
+
+ [ColorDescription("Completion Selection Bar Border(Inactive)", VSSetting = "color=Inactive Selected Text/Background")]
+ public AmbientColor CompletionSelectionBarBorderInactive { get; private set; }
+
+ [ColorDescription("Completion Selection Bar Background(Inactive)", VSSetting = "color=Inactive Selected Text/Background,secondcolor=Inactive Selected Text/Background")]
+ public AmbientColor CompletionSelectionBarBackgroundInactive { get; private set; }
+
+ [ColorDescription("Message Bubble Error Marker")]
+ public AmbientColor MessageBubbleErrorMarker { get; private set; }
+
+ [ColorDescription("Message Bubble Error Tag")]
+ public AmbientColor MessageBubbleErrorTag { get; private set; }
+
+ [ColorDescription("Message Bubble Error Tooltip")]
+ public AmbientColor MessageBubbleErrorTooltip { get; private set; }
+
+ [ColorDescription("Message Bubble Error Line")]
+ public AmbientColor MessageBubbleErrorLine { get; private set; }
+
+ [ColorDescription("Message Bubble Error Counter")]
+ public AmbientColor MessageBubbleErrorCounter { get; private set; }
+
+ [ColorDescription("Message Bubble Error IconMargin")]
+ public AmbientColor MessageBubbleErrorIconMargin { get; private set; }
+
+ [ColorDescription("Message Bubble Warning Marker")]
+ public AmbientColor MessageBubbleWarningMarker { get; private set; }
+
+ [ColorDescription("Message Bubble Warning Tag")]
+ public AmbientColor MessageBubbleWarningTag { get; private set; }
+
+ [ColorDescription("Message Bubble Warning Tooltip")]
+ public AmbientColor MessageBubbleWarningTooltip { get; private set; }
+
+ [ColorDescription("Message Bubble Warning Line")]
+ public AmbientColor MessageBubbleWarningLine { get; private set; }
+
+ [ColorDescription("Message Bubble Warning Counter")]
+ public AmbientColor MessageBubbleWarningCounter { get; private set; }
+
+ [ColorDescription("Message Bubble Warning IconMargin")]
+ public AmbientColor MessageBubbleWarningIconMargin { get; private set; }
+
+ [ColorDescription("Link Color")]
+ public AmbientColor LinkColor { get; private set; }
+
+ [ColorDescription("Link Color(Active)")]
+ public AmbientColor ActiveLinkColor { get; private set; }
+ #endregion
+
+ #region Text Colors
+
+ public const string PlainTextKey = "Plain Text";
+
+ [ColorDescription(PlainTextKey, VSSetting = "Plain Text")]
+ public ChunkStyle PlainText { get; private set; }
+
+ public const string SelectedTextKey = "Selected Text";
+ [ColorDescription(SelectedTextKey, VSSetting = "Selected Text")]
+ public ChunkStyle SelectedText { get; private set; }
+
+ public const string SelectedInactiveTextKey = "Selected Text(Inactive)";
+ [ColorDescription(SelectedInactiveTextKey, VSSetting = "Inactive Selected Text")]
+ public ChunkStyle SelectedInactiveText { get; private set; }
+
+ public const string CollapsedTextKey = "Collapsed Text";
+ [ColorDescription(CollapsedTextKey, VSSetting = "Collapsible Text")]
+ public ChunkStyle CollapsedText { get; private set; }
+
+ public const string LineNumbersKey = "Line Numbers";
+ [ColorDescription(LineNumbersKey, VSSetting = "Line Numbers")]
+ public ChunkStyle LineNumbers { get; private set; }
+
+ public const string PunctuationKey = "Punctuation";
+ [ColorDescription(PunctuationKey, VSSetting = "Operator")]
+ public ChunkStyle Punctuation { get; private set; }
+
+ public const string PunctuationForBracketsKey = "Punctuation(Brackets)";
+ [ColorDescription(PunctuationForBracketsKey, VSSetting = "Plain Text")]
+ public ChunkStyle PunctuationForBrackets { get; private set; }
+
+ public const string CommentsSingleLineKey = "Comment(Line)";
+ [ColorDescription(CommentsSingleLineKey, VSSetting = "Comment")]
+ public ChunkStyle CommentsSingleLine { get; private set; }
+
+ public const string CommentsBlockKey = "Comment(Block)";
+ [ColorDescription(CommentsBlockKey, VSSetting = "Comment")]
+ public ChunkStyle CommentsBlock { get; private set; }
+
+ public const string CommentsForDocumentationKey = "Comment(Doc)";
+ [ColorDescription(CommentsForDocumentationKey, VSSetting = "XML Doc Comment")]
+ public ChunkStyle CommentsForDocumentation { get; private set; }
+
+ public const string CommentsForDocumentationTagsKey = "Comment(DocTag)";
+ [ColorDescription(CommentsForDocumentationTagsKey, VSSetting = "XML Doc Tag")]
+ public ChunkStyle CommentsForDocumentationTags { get; private set; }
+
+ public const string CommentTagsKey = "Comment Tag";
+ [ColorDescription(CommentTagsKey, VSSetting = "Comment")]
+ public ChunkStyle CommentTags { get; private set; }
+
+ public const string ExcludedCodeKey = "Excluded Code";
+ [ColorDescription(ExcludedCodeKey, VSSetting = "Excluded Code")]
+ public ChunkStyle ExcludedCode { get; private set; }
+
+ public const string StringKey = "String";
+ [ColorDescription(StringKey, VSSetting = "String")]
+ public ChunkStyle String { get; private set; }
+
+ public const string StringEscapeSequenceKey = "String(Escape)";
+ [ColorDescription(StringEscapeSequenceKey, VSSetting = "String")]
+ public ChunkStyle StringEscapeSequence { get; private set; }
+
+ public const string StringVerbatimKey = "String(C# @ Verbatim)";
+ [ColorDescription(StringVerbatimKey, VSSetting = "String(C# @ Verbatim)")]
+ public ChunkStyle StringVerbatim { get; private set; }
+
+ public const string NumberKey = "Number";
+ [ColorDescription(NumberKey, VSSetting = "Number")]
+ public ChunkStyle Number { get; private set; }
+
+ public const string PreprocessorKey = "Preprocessor";
+ [ColorDescription(PreprocessorKey, VSSetting = "Preprocessor Keyword")]
+ public ChunkStyle Preprocessor { get; private set; }
+
+ public const string PreprocessorRegionNameKey = "Preprocessor(Region Name)";
+ [ColorDescription(PreprocessorRegionNameKey, VSSetting = "Plain Text")]
+ public ChunkStyle PreprocessorRegionName { get; private set; }
+
+ public const string XmlTextKey = "Xml Text";
+ [ColorDescription(XmlTextKey, VSSetting = "XML Text")]
+ public ChunkStyle XmlText { get; private set; }
+
+ public const string XmlDelimiterKey = "Xml Delimiter";
+ [ColorDescription(XmlDelimiterKey, VSSetting = "XML Delimiter")]
+ public ChunkStyle XmlDelimiter { get; private set; }
+
+ public const string XmlNameKey = "Xml Name";
+ [ColorDescription(XmlNameKey, VSSetting ="XML Name")]
+ public ChunkStyle XmlName { get; private set; }
+
+ public const string XmlAttributeKey = "Xml Attribute";
+ [ColorDescription(XmlAttributeKey, VSSetting = "XML Attribute")]
+ public ChunkStyle XmlAttribute { get; private set; }
+
+ public const string XmlAttributeQuotesKey = "Xml Attribute Quotes";
+ [ColorDescription(XmlAttributeQuotesKey, VSSetting = "XML Attribute Quotes")]
+ public ChunkStyle XmlAttributeQuotes { get; private set; }
+
+ public const string XmlAttributeValueKey = "Xml Attribute Value";
+ [ColorDescription(XmlAttributeValueKey, VSSetting = "XML Attribute Value")]
+ public ChunkStyle XmlAttributeValue { get; private set; }
+
+ public const string XmlCommentKey = "Xml Comment";
+ [ColorDescription(XmlCommentKey, VSSetting = "XML Comment")]
+ public ChunkStyle XmlComment { get; private set; }
+
+ public const string XmlCDataSectionKey = "Xml CData Section";
+ [ColorDescription(XmlCDataSectionKey, VSSetting = "XML CData Section")]
+ public ChunkStyle XmlCDataSection { get; private set; }
+
+ public const string TooltipTextKey = "Tooltip Text";
+ [ColorDescription(TooltipTextKey)] // not defined in vs.net
+ public ChunkStyle TooltipText { get; private set; }
+
+ public const string NotificationTextKey = "Notification Text";
+ [ColorDescription(NotificationTextKey)] // not defined in vs.net
+ public ChunkStyle NotificationText { get; private set; }
+
+ public const string CompletionTextKey = "Completion Text";
+ [ColorDescription(CompletionTextKey, VSSetting = "Plain Text")]
+ public ChunkStyle CompletionText { get; private set; }
+
+ public const string CompletionMatchingSubstringKey = "Completion Matching Substring";
+ [ColorDescription(CompletionMatchingSubstringKey, VSSetting = "Keyword")]
+ public ChunkStyle CompletionMatchingSubstring { get; private set; }
+
+ public const string CompletionSelectedTextKey = "Completion Selected Text";
+ [ColorDescription(CompletionSelectedTextKey, VSSetting = "Selected Text")]
+ public ChunkStyle CompletionSelectedText { get; private set; }
+
+ public const string CompletionSelectedMatchingSubstringKey = "Completion Selected Matching Substring";
+ [ColorDescription(CompletionSelectedMatchingSubstringKey, VSSetting = "Keyword")]
+ public ChunkStyle CompletionSelectedMatchingSubstring { get; private set; }
+
+ public const string CompletionSelectedInactiveTextKey = "Completion Selected Text(Inactive)";
+ [ColorDescription(CompletionSelectedInactiveTextKey, VSSetting = "Inactive Selected Text")]
+ public ChunkStyle CompletionSelectedInactiveText { get; private set; }
+
+ public const string CompletionSelectedInactiveMatchingSubstringKey = "Completion Selected Matching Substring(Inactive)";
+ [ColorDescription(CompletionSelectedInactiveMatchingSubstringKey, VSSetting = "Keyword")]
+ public ChunkStyle CompletionSelectedInactiveMatchingSubstring { get; private set; }
+
+ public const string KeywordAccessorsKey = "Keyword(Access)";
+ [ColorDescription(KeywordAccessorsKey, VSSetting = "Keyword")]
+ public ChunkStyle KeywordAccessors { get; private set; }
+
+ public const string KeywordTypesKey = "Keyword(Type)";
+ [ColorDescription(KeywordTypesKey, VSSetting = "Keyword")]
+ public ChunkStyle KeywordTypes { get; private set; }
+
+ public const string KeywordOperatorsKey = "Keyword(Operator)";
+ [ColorDescription(KeywordOperatorsKey, VSSetting = "Keyword")]
+ public ChunkStyle KeywordOperators { get; private set; }
+
+ public const string KeywordSelectionKey = "Keyword(Selection)";
+ [ColorDescription(KeywordSelectionKey, VSSetting = "Keyword")]
+ public ChunkStyle KeywordSelection { get; private set; }
+
+ public const string KeywordIterationKey = "Keyword(Iteration)";
+ [ColorDescription(KeywordIterationKey, VSSetting = "Keyword")]
+ public ChunkStyle KeywordIteration { get; private set; }
+
+ public const string KeywordJumpKey = "Keyword(Jump)";
+ [ColorDescription(KeywordJumpKey, VSSetting = "Keyword")]
+ public ChunkStyle KeywordJump { get; private set; }
+
+ public const string KeywordContextKey = "Keyword(Context)";
+ [ColorDescription(KeywordContextKey, VSSetting = "Keyword")]
+ public ChunkStyle KeywordContext { get; private set; }
+
+ public const string KeywordExceptionKey = "Keyword(Exception)";
+ [ColorDescription(KeywordExceptionKey, VSSetting = "Keyword")]
+ public ChunkStyle KeywordException { get; private set; }
+
+ public const string KeywordModifiersKey = "Keyword(Modifiers)";
+ [ColorDescription(KeywordModifiersKey, VSSetting = "Keyword")]
+ public ChunkStyle KeywordModifiers { get; private set; }
+
+ public const string KeywordConstantsKey = "Keyword(Constants)";
+ [ColorDescription(KeywordConstantsKey, VSSetting = "Keyword")]
+ public ChunkStyle KeywordConstants { get; private set; }
+
+ public const string KeywordVoidKey = "Keyword(Void)";
+ [ColorDescription(KeywordVoidKey, VSSetting = "Keyword")]
+ public ChunkStyle KeywordVoid { get; private set; }
+
+ public const string KeywordNamespaceKey = "Keyword(Namespace)";
+ [ColorDescription(KeywordNamespaceKey, VSSetting = "Keyword")]
+ public ChunkStyle KeywordNamespace { get; private set; }
+
+ public const string KeywordPropertyKey = "Keyword(Property)";
+ [ColorDescription(KeywordPropertyKey, VSSetting = "Keyword")]
+ public ChunkStyle KeywordProperty { get; private set; }
+
+ public const string KeywordDeclarationKey = "Keyword(Declaration)";
+ [ColorDescription(KeywordDeclarationKey, VSSetting = "Keyword")]
+ public ChunkStyle KeywordDeclaration { get; private set; }
+
+ public const string KeywordParameterKey = "Keyword(Parameter)";
+ [ColorDescription(KeywordParameterKey, VSSetting = "Keyword")]
+ public ChunkStyle KeywordParameter { get; private set; }
+
+ public const string KeywordOperatorDeclarationKey = "Keyword(Operator Declaration)";
+ [ColorDescription(KeywordOperatorDeclarationKey, VSSetting = "Keyword")]
+ public ChunkStyle KeywordOperatorDeclaration { get; private set; }
+
+ public const string KeywordOtherKey = "Keyword(Other)";
+ [ColorDescription(KeywordOtherKey, VSSetting = "Keyword")]
+ public ChunkStyle KeywordOther { get; private set; }
+
+ public const string UserTypesKey = "User Types";
+ [ColorDescription(UserTypesKey, VSSetting = "User Types")]
+ public ChunkStyle UserTypes { get; private set; }
+
+ public const string UserTypesEnumsKey = "User Types(Enums)";
+ [ColorDescription(UserTypesEnumsKey, VSSetting = "User Types(Enums)")]
+ public ChunkStyle UserTypesEnums { get; private set; }
+
+ public const string UserTypesInterfacesKey = "User Types(Interfaces)";
+ [ColorDescription(UserTypesInterfacesKey, VSSetting = "User Types(Interfaces)")]
+ public ChunkStyle UserTypesInterfaces { get; private set; }
+
+ public const string UserTypesDelegatesKey = "User Types(Delegates)";
+ [ColorDescription(UserTypesDelegatesKey, VSSetting = "User Types(Delegates)")]
+ public ChunkStyle UserTypesDelegates { get; private set; }
+
+ public const string UserTypesValueTypesKey = "User Types(Value types)";
+ [ColorDescription(UserTypesValueTypesKey, VSSetting = "User Types(Value types)")]
+ public ChunkStyle UserTypesValueTypes { get; private set; }
+
+ public const string UserTypesTypeParametersKey = "User Types(Type parameters)";
+ [ColorDescription(UserTypesTypeParametersKey, VSSetting = "User Types(Type parameters)")]
+ public ChunkStyle UserTypesTypeParameters { get; private set; }
+
+ public const string UserTypesMutableKey = "User Types(Mutable)";
+ [ColorDescription(UserTypesMutableKey, VSSetting = "User Types(Mutable")]
+ public ChunkStyle UserTypesMutable { get; private set; }
+
+ public const string UserFieldUsageKey = "User Field Usage";
+ [ColorDescription(UserFieldUsageKey, VSSetting = "Identifier")]
+ public ChunkStyle UserFieldUsage { get; private set; }
+
+ public const string UserFieldDeclarationKey = "User Field Declaration";
+ [ColorDescription(UserFieldDeclarationKey, VSSetting = "Identifier")]
+ public ChunkStyle UserFieldDeclaration { get; private set; }
+
+ public const string UserPropertyUsageKey = "User Property Usage";
+ [ColorDescription(UserPropertyUsageKey, VSSetting = "Identifier")]
+ public ChunkStyle UserPropertyUsage { get; private set; }
+
+ public const string UserPropertyDeclarationKey = "User Property Declaration";
+ [ColorDescription(UserPropertyDeclarationKey, VSSetting = "Identifier")]
+ public ChunkStyle UserPropertyDeclaration { get; private set; }
+
+ public const string UserEventUsageKey = "User Event Usage";
+ [ColorDescription(UserEventUsageKey, VSSetting = "Identifier")]
+ public ChunkStyle UserEventUsage { get; private set; }
+
+ public const string UserEventDeclarationKey = "User Event Declaration";
+ [ColorDescription(UserEventDeclarationKey, VSSetting = "Identifier")]
+ public ChunkStyle UserEventDeclaration { get; private set; }
+
+ public const string UserMethodUsageKey = "User Method Usage";
+ [ColorDescription(UserMethodUsageKey, VSSetting = "Identifier")]
+ public ChunkStyle UserMethodUsage { get; private set; }
+
+ public const string UserMethodDeclarationKey = "User Method Declaration";
+ [ColorDescription(UserMethodDeclarationKey, VSSetting = "Identifier")]
+ public ChunkStyle UserMethodDeclaration { get; private set; }
+
+ public const string UserParameterUsageKey = "User Parameter Usage";
+ [ColorDescription(UserParameterUsageKey, VSSetting = "Identifier")]
+ public ChunkStyle UserParameterUsage { get; private set; }
+
+ public const string UserParameterDeclarationKey = "User Parameter Declaration";
+ [ColorDescription(UserParameterDeclarationKey, VSSetting = "Identifier")]
+ public ChunkStyle UserParameterDeclaration { get; private set; }
+
+ public const string UserVariableUsageKey = "User Variable Usage";
+ [ColorDescription(UserVariableUsageKey, VSSetting = "Identifier")]
+ public ChunkStyle UserVariableUsage { get; private set; }
+
+ public const string UserVariableDeclarationKey = "User Variable Declaration";
+ [ColorDescription(UserVariableDeclarationKey, VSSetting = "Identifier")]
+ public ChunkStyle UserVariableDeclaration { get; private set; }
+
+ public const string SyntaxErrorKey = "Syntax Error";
+ [ColorDescription(SyntaxErrorKey, VSSetting = "Syntax Error")]
+ public ChunkStyle SyntaxError { get; private set; }
+
+ public const string StringFormatItemsKey = "String Format Items";
+ [ColorDescription(StringFormatItemsKey, VSSetting = "String")]
+ public ChunkStyle StringFormatItems { get; private set; }
+
+ public const string BreakpointTextKey = "Breakpoint Text";
+ [ColorDescription(BreakpointTextKey, VSSetting = "Breakpoint (Enabled)")]
+ public ChunkStyle BreakpointText { get; private set; }
+
+ public const string DebuggerCurrentLineKey = "Debugger Current Statement";
+ [ColorDescription(DebuggerCurrentLineKey, VSSetting = "Current Statement")]
+ public ChunkStyle DebuggerCurrentLine { get; private set; }
+
+ public const string DebuggerStackLineKey = "Debugger Stack Line";
+ [ColorDescription(DebuggerStackLineKey)] // not defined
+ public ChunkStyle DebuggerStackLine { get; private set; }
+
+ public const string DiffLineAddedKey = "Diff Line(Added)";
+ [ColorDescription(DiffLineAddedKey)] //not defined
+ public ChunkStyle DiffLineAdded { get; private set; }
+
+ public const string DiffLineRemovedKey = "Diff Line(Removed)";
+ [ColorDescription(DiffLineRemovedKey)] //not defined
+ public ChunkStyle DiffLineRemoved { get; private set; }
+
+ public const string DiffLineChangedKey = "Diff Line(Changed)";
+ [ColorDescription(DiffLineChangedKey)] //not defined
+ public ChunkStyle DiffLineChanged { get; private set; }
+
+ public const string DiffHeaderKey = "Diff Header";
+ [ColorDescription(DiffHeaderKey)] //not defined
+ public ChunkStyle DiffHeader { get; private set; }
+
+ public const string DiffHeaderSeparatorKey = "Diff Header(Separator)";
+ [ColorDescription(DiffHeaderSeparatorKey)] //not defined
+ public ChunkStyle DiffHeaderSeparator { get; private set; }
+
+ public const string DiffHeaderOldKey = "Diff Header(Old)";
+ [ColorDescription(DiffHeaderOldKey)] //not defined
+ public ChunkStyle DiffHeaderOld { get; private set; }
+
+ public const string DiffHeaderNewKey = "Diff Header(New)";
+ [ColorDescription(DiffHeaderNewKey)] //not defined
+ public ChunkStyle DiffHeaderNew { get; private set; }
+
+ public const string DiffLocationKey = "Diff Location";
+ [ColorDescription(DiffLocationKey)] //not defined
+ public ChunkStyle DiffLocation { get; private set; }
+
+ public const string HtmlAttributeNameKey = "Html Attribute Name";
+ [ColorDescription(HtmlAttributeNameKey, VSSetting="HTML Attribute")]
+ public ChunkStyle HtmlAttributeName { get; private set; }
+
+ public const string HtmlAttributeValueKey = "Html Attribute Value";
+ [ColorDescription(HtmlAttributeValueKey, VSSetting="HTML Attribute Value")]
+ public ChunkStyle HtmlAttributeValue { get; private set; }
+
+ public const string HtmlCommentKey = "Html Comment";
+ [ColorDescription(HtmlCommentKey, VSSetting="HTML Comment")]
+ public ChunkStyle HtmlComment { get; private set; }
+
+ public const string HtmlElementNameKey = "Html Element Name";
+ [ColorDescription(HtmlElementNameKey, VSSetting="HTML Element Name")]
+ public ChunkStyle HtmlElementName { get; private set; }
+
+ public const string HtmlEntityKey = "Html Entity";
+ [ColorDescription(HtmlEntityKey, VSSetting="HTML Entity")]
+ public ChunkStyle HtmlEntity { get; private set; }
+
+ public const string HtmlOperatorKey = "Html Operator";
+ [ColorDescription(HtmlOperatorKey, VSSetting="HTML Operator")]
+ public ChunkStyle HtmlOperator { get; private set; }
+
+ public const string HtmlServerSideScriptKey = "Html Server-Side Script";
+ [ColorDescription(HtmlServerSideScriptKey, VSSetting="HTML Server-Side Script")]
+ public ChunkStyle HtmlServerSideScript { get; private set; }
+
+ public const string HtmlTagDelimiterKey = "Html Tag Delimiter";
+ [ColorDescription(HtmlTagDelimiterKey, VSSetting="HTML Tag Delimiter")]
+ public ChunkStyle HtmlTagDelimiter { get; private set; }
+
+ public const string RazorCodeKey = "Razor Code";
+ [ColorDescription(RazorCodeKey, VSSetting="Razor Code")]
+ public ChunkStyle RazorCode { get; private set; }
+
+ public const string CssCommentKey = "Css Comment";
+ [ColorDescription(CssCommentKey, VSSetting="CSS Comment")]
+ public ChunkStyle CssComment { get; private set; }
+
+ public const string CssPropertyNameKey = "Css Property Name";
+ [ColorDescription(CssPropertyNameKey, VSSetting="CSS Property Name")]
+ public ChunkStyle CssPropertyName { get; private set; }
+
+ public const string CssPropertyValueKey = "Css Property Value";
+ [ColorDescription(CssPropertyValueKey, VSSetting="CSS Property Value")]
+ public ChunkStyle CssPropertyValue { get; private set; }
+
+ public const string CssSelectorKey = "Css Selector";
+ [ColorDescription(CssSelectorKey, VSSetting="CSS Selector")]
+ public ChunkStyle CssSelector { get; private set; }
+
+ public const string CssStringValueKey = "Css String Value";
+ [ColorDescription(CssStringValueKey, VSSetting="CSS String Value")]
+ public ChunkStyle CssStringValue { get; private set; }
+
+ public const string CssKeywordKey = "Css Keyword";
+ [ColorDescription(CssKeywordKey, VSSetting="CSS Keyword")]
+ public ChunkStyle CssKeyword { get; private set; }
+
+ public const string ScriptCommentKey = "Script Comment";
+ [ColorDescription(ScriptCommentKey, VSSetting="Script Comment")]
+ public ChunkStyle ScriptComment { get; private set; }
+
+ public const string ScriptIdentifierKey = "Script Identifier";
+ [ColorDescription(ScriptIdentifierKey, VSSetting="Script Identifier")]
+ public ChunkStyle ScriptIdentifier { get; private set; }
+
+ public const string ScriptKeywordKey = "Script Keyword";
+ [ColorDescription(ScriptKeywordKey, VSSetting="Script Keyword")]
+ public ChunkStyle ScriptKeyword { get; private set; }
+
+ public const string ScriptNumberKey = "Script Number";
+ [ColorDescription(ScriptNumberKey, VSSetting="Script Number")]
+ public ChunkStyle ScriptNumber { get; private set; }
+
+ public const string ScriptOperatorKey = "Script Operator";
+ [ColorDescription(ScriptOperatorKey, VSSetting="Script Operator")]
+ public ChunkStyle ScriptOperator { get; private set; }
+
+ public const string ScriptStringKey = "Script String";
+ [ColorDescription(ScriptStringKey, VSSetting="Script String")]
+ public ChunkStyle ScriptString { get; private set; }
+
+ public const string RegexSetConstructsKey = "String(Regex Set Constructs)";
+ [ColorDescription(RegexSetConstructsKey)]
+ public ChunkStyle RegexSetConstructs { get; private set; }
+
+ public const string RegexCharacterClassKey = "String(Regex Character Class)";
+ [ColorDescription(RegexCharacterClassKey)]
+ public ChunkStyle RegexCharacterClass { get; private set; }
+
+ public const string RegexGroupingConstructsKey = "String(Regex Grouping Constructs)";
+ [ColorDescription(RegexGroupingConstructsKey)]
+ public ChunkStyle RegexGroupingConstructs { get; private set; }
+
+ public const string RegexEscapeCharacterKey = "String(Regex Escape Character)";
+ [ColorDescription(RegexEscapeCharacterKey)]
+ public ChunkStyle RegexEscapeCharacter { get; private set; }
+
+ public const string RegexAltEscapeCharacterKey = "String(Regex Alt Escape Character)";
+ [ColorDescription(RegexAltEscapeCharacterKey)]
+ public ChunkStyle RegexAltEscapeCharacter { get; private set; }
+ #endregion
+
+ internal class PropertyDecsription
+ {
+ public readonly PropertyInfo Info;
+ public readonly ColorDescriptionAttribute Attribute;
+
+ public PropertyDecsription (PropertyInfo info, ColorDescriptionAttribute attribute)
+ {
+ this.Info = info;
+ this.Attribute = attribute;
+ }
+ }
+
+ static Dictionary<string, PropertyDecsription> textColors = new Dictionary<string, PropertyDecsription> ();
+
+ internal static IEnumerable<PropertyDecsription> TextColors {
+ get {
+ return textColors.Values;
+ }
+ }
+
+ static Dictionary<string, PropertyDecsription> ambientColors = new Dictionary<string, PropertyDecsription> ();
+
+ internal static IEnumerable<PropertyDecsription> AmbientColors {
+ get {
+ return ambientColors.Values;
+ }
+ }
+ static ColorScheme ()
+ {
+ foreach (var property in typeof(ColorScheme).GetProperties ()) {
+ var description = property.GetCustomAttributes (false).FirstOrDefault (p => p is ColorDescriptionAttribute) as ColorDescriptionAttribute;
+ if (description == null)
+ continue;
+ if (property.PropertyType == typeof (ChunkStyle)) {
+ textColors.Add (description.Name, new PropertyDecsription (property, description));
+ } else {
+ ambientColors.Add (description.Name, new PropertyDecsription (property, description));
+ }
+ }
+ }
+
+ public ColorScheme Clone ()
+ {
+ var result = new ColorScheme () {
+ Name = this.Name,
+ BaseScheme = this.BaseScheme,
+ Originator = this.Originator,
+ Description = this.Description
+ };
+ result.CopyValues (this);
+ return result;
+ }
+
+ static HslColor ParseColor (string value)
+ {
+ if (value.Length == 9 && value.StartsWith ("#", StringComparison.Ordinal)) {
+ double r = ((double) int.Parse (value.Substring (1,2), System.Globalization.NumberStyles.HexNumber)) / 255;
+ double g = ((double) int.Parse (value.Substring (3,2), System.Globalization.NumberStyles.HexNumber)) / 255;
+ double b = ((double) int.Parse (value.Substring (5,2), System.Globalization.NumberStyles.HexNumber)) / 255;
+ double a = ((double) int.Parse (value.Substring (7,2), System.Globalization.NumberStyles.HexNumber)) / 255;
+ return new HslColor (r, g, b, a);
+ }
+ return HslColor.Parse (value);
+ }
+
+ internal static HslColor ParsePaletteColor (Dictionary<string, HslColor> palette, string value)
+ {
+ HslColor result;
+ if (palette.TryGetValue (value, out result))
+ return result;
+ return ParseColor (value);
+ }
+
+ internal ChunkStyle GetChunkStyle (string color)
+ {
+ if (color == null)
+ return GetChunkStyle ("Plain Text");
+ PropertyDecsription val;
+ if (!textColors.TryGetValue (color, out val)) {
+ Console.WriteLine ("Chunk style : " + color + " is undefined.");
+ return GetChunkStyle ("Plain Text");
+ }
+ return val.Info.GetValue (this, null) as ChunkStyle;
+ }
+
+ void CopyValues (ColorScheme baseScheme)
+ {
+ foreach (var color in textColors.Values)
+ color.Info.SetValue (this, color.Info.GetValue (baseScheme, null), null);
+ foreach (var color in ambientColors.Values)
+ color.Info.SetValue (this, color.Info.GetValue (baseScheme, null), null);
+ }
+
+ internal static ColorScheme LoadFrom (Stream stream)
+ {
+ var result = new ColorScheme ();
+ byte [] bytes;
+ using (var sr = Core.Text.TextFileUtility.OpenStream (stream)) {
+ bytes = System.Text.Encoding.UTF8.GetBytes (sr.ReadToEnd ());
+ }
+
+ var reader = System.Runtime.Serialization.Json.JsonReaderWriterFactory.CreateJsonReader (bytes, new System.Xml.XmlDictionaryReaderQuotas ());
+
+ var root = XElement.Load(reader);
+
+ // The fields we'd like to extract
+ result.Name = root.XPathSelectElement("name").Value;
+
+ if (result.Name != DefaultColorStyle)
+ result.CopyValues (SyntaxModeService.DefaultColorStyle);
+
+ var version = Version.Parse (root.XPathSelectElement("version").Value);
+ if (version.Major != 1)
+ return null;
+ var el = root.XPathSelectElement ("description");
+ if (el != null)
+ result.Description = el.Value;
+ el = root.XPathSelectElement ("originator");
+ if (el != null)
+ result.Originator = el.Value;
+ el = root.XPathSelectElement ("baseScheme");
+ if (el != null)
+ result.BaseScheme = el.Value;
+
+ if (result.BaseScheme != null) {
+ var baseScheme = SyntaxModeService.GetColorStyle (result.BaseScheme);
+ if (baseScheme != null)
+ result.CopyValues (baseScheme);
+ }
+
+ var palette = new Dictionary<string, HslColor> ();
+ foreach (var color in root.XPathSelectElements("palette/*")) {
+ var name = color.XPathSelectElement ("name").Value;
+ if (palette.ContainsKey (name))
+ throw new InvalidDataException ("Duplicate palette color definition for: " + name);
+ palette.Add (
+ name,
+ ParseColor (color.XPathSelectElement ("value").Value)
+ );
+ }
+
+ foreach (var colorElement in root.XPathSelectElements("//colors/*")) {
+ var color = AmbientColor.Create (colorElement, palette);
+ PropertyDecsription info;
+ if (!ambientColors.TryGetValue (color.Name, out info)) {
+ Console.WriteLine ("Ambient color:" + color.Name + " not found.");
+ continue;
+ }
+ info.Info.SetValue (result, color, null);
+ }
+
+ foreach (var textColorElement in root.XPathSelectElements("//text/*")) {
+ var color = ChunkStyle.Create (textColorElement, palette);
+ PropertyDecsription info;
+ if (!textColors.TryGetValue (color.Name, out info)) {
+ Console.WriteLine ("Text color:" + color.Name + " not found.");
+ continue;
+ }
+ info.Info.SetValue (result, color, null);
+ }
+
+ // Check scheme
+ bool valid = true;
+ foreach (var color in textColors.Values) {
+ if (color.Info.GetValue (result, null) == null) {
+ Console.WriteLine (color.Attribute.Name + " == null");
+ valid = false;
+ }
+ }
+ foreach (var color in ambientColors.Values) {
+ if (color.Info.GetValue (result, null) == null) {
+ Console.WriteLine (color.Attribute.Name + " == null");
+ valid = false;
+ }
+ }
+ if (!valid)
+ throw new InvalidDataException ("Scheme " + result.Name + " is not valid.");
+ return result;
+ }
+
+ public static string ColorToMarkup (HslColor color)
+ {
+ return color.ToMarkup ();
+ }
+
+ internal void Save (string fileName)
+ {
+ using (var writer = new StreamWriter (fileName)) {
+ writer.WriteLine ("{");
+ writer.WriteLine ("\t\"name\":\"{0}\",", Name);
+ writer.WriteLine ("\t\"version\":\"1.0\",");
+ if (!string.IsNullOrEmpty (Description))
+ writer.WriteLine ("\t\"description\":\"{0}\",", Description);
+ if (!string.IsNullOrEmpty (Originator))
+ writer.WriteLine ("\t\"originator\":\"{0}\",", Originator);
+ if (!string.IsNullOrEmpty (BaseScheme))
+ writer.WriteLine ("\t\"baseScheme\":\"{0}\",", BaseScheme);
+
+ var baseStyle = SyntaxModeService.GetColorStyle (BaseScheme ?? SyntaxModeService.GetDefaultColorStyleName ());
+
+ writer.WriteLine ("\t\"colors\":[");
+ bool first = true;
+ foreach (var ambient in ambientColors) {
+ var thisValue = ambient.Value.Info.GetValue (this, null) as AmbientColor;
+ if (thisValue == null)
+ continue;
+ var baseValue = ambient.Value.Info.GetValue (baseStyle, null) as AmbientColor;
+ if (thisValue.Equals (baseValue)) {
+ continue;
+ }
+
+ var colorString = new StringBuilder ();
+ foreach (var color in thisValue.Colors) {
+ if (colorString.Length > 0)
+ colorString.Append (", ");
+ colorString.Append (string.Format ("\"{0}\":\"{1}\"", color.Item1, ColorToMarkup (color.Item2)));
+ }
+ if (colorString.Length == 0) {
+ Console.WriteLine ("Invalid ambient color :" + thisValue);
+ continue;
+ }
+ if (!first) {
+ writer.WriteLine (",");
+ } else {
+ first = false;
+ }
+ writer.Write ("\t\t{");
+ writer.Write ("\"name\": \"{0}\", {1}", ambient.Value.Attribute.Name, colorString);
+ writer.Write (" }");
+ }
+
+ writer.WriteLine ("\t],");
+ first = true;
+ writer.WriteLine ("\t\"text\":[");
+ foreach (var textColor in textColors) {
+ var thisValue = textColor.Value.Info.GetValue (this, null) as ChunkStyle;
+ if (thisValue == null)
+ continue;
+ var baseValue = textColor.Value.Info.GetValue (baseStyle, null) as ChunkStyle;
+ if (thisValue.Equals (baseValue)) {
+ continue;
+ }
+ var colorString = new StringBuilder ();
+ if (!thisValue.TransparentForeground)
+ colorString.Append (string.Format ("\"fore\":\"{0}\"", ColorToMarkup (thisValue.Foreground)));
+ if (!thisValue.TransparentBackground) {
+ if (colorString.Length > 0)
+ colorString.Append (", ");
+ colorString.Append (string.Format ("\"back\":\"{0}\"", ColorToMarkup (thisValue.Background)));
+ }
+ if (thisValue.FontWeight != Xwt.Drawing.FontWeight.Normal) {
+ if (colorString.Length > 0)
+ colorString.Append (", ");
+ colorString.Append (string.Format ("\"weight\":\"{0}\"", thisValue.FontWeight));
+ }
+ if (thisValue.FontStyle != Xwt.Drawing.FontStyle.Normal) {
+ if (colorString.Length > 0)
+ colorString.Append (", ");
+ colorString.Append (string.Format ("\"style\":\"{0}\"", thisValue.FontStyle));
+ }
+ if (!first) {
+ writer.WriteLine (",");
+ } else {
+ first = false;
+ }
+ writer.Write ("\t\t{");
+ if (colorString.Length == 0) {
+ writer.Write ("\"name\": \"{0}\"", textColor.Value.Attribute.Name);
+ } else {
+ writer.Write ("\"name\": \"{0}\", {1}", textColor.Value.Attribute.Name, colorString);
+ }
+ writer.Write (" }");
+ }
+ writer.WriteLine ();
+ writer.WriteLine ("\t]");
+
+ writer.WriteLine ("}");
+ }
+ }
+
+ internal static HslColor ImportVsColor (string colorString)
+ {
+ if (colorString == "0x02000000")
+ return new HslColor (0, 0, 0, 0);
+ string color = "#" + colorString.Substring (8, 2) + colorString.Substring (6, 2) + colorString.Substring (4, 2);
+ return HslColor.Parse (color);
+ }
+
+ internal class VSSettingColor
+ {
+ public string Name { get; private set; }
+ public string Foreground { get; private set; }
+ public string Background { get; private set; }
+ public bool BoldFont { get; private set; }
+
+ public static VSSettingColor Create (XmlReader reader)
+ {
+ return new VSSettingColor {
+ Name = reader.GetAttribute ("Name"),
+ Foreground = reader.GetAttribute ("Foreground"),
+ Background = reader.GetAttribute ("Background"),
+ BoldFont = reader.GetAttribute ("BoldFont") == "Yes"
+ };
+ }
+ }
+
+ internal static HslColor AlphaBlend (HslColor fore, HslColor back, double alpha)
+ {
+ var fc = (Cairo.Color)fore;
+ var bc = (Cairo.Color)back;
+ return new HslColor (
+ (1.0 - alpha) * bc.R + alpha * fc.R,
+ (1.0 - alpha) * bc.G + alpha * fc.G,
+ (1.0 - alpha) * bc.B + alpha * fc.B);
+ }
+
+ internal static ColorScheme Import (string fileName, Stream stream)
+ {
+ var result = new ColorScheme ();
+ result.Name = Path.GetFileNameWithoutExtension (fileName);
+ result.Description = "Imported color scheme";
+ result.Originator = "Imported from " + fileName;
+
+ var colors = new Dictionary<string, VSSettingColor> ();
+ using (var reader = XmlReader.Create (stream)) {
+ while (reader.Read ()) {
+ if (reader.LocalName == "Item") {
+ var color = VSSettingColor.Create (reader);
+ if (colors.ContainsKey (color.Name)) {
+ Console.WriteLine ("Warning: {0} is defined twice in vssettings.", color.Name);
+ continue;
+ }
+ colors[color.Name] = color;
+ }
+ }
+ }
+
+
+ HashSet<string> importedAmbientColors = new HashSet<string> ();
+ // convert ambient colors
+ foreach (var ambient in ambientColors.Values) {
+ if (!string.IsNullOrEmpty (ambient.Attribute.VSSetting)) {
+ var import = AmbientColor.Import (colors, ambient.Attribute.VSSetting);
+ if (import != null) {
+ importedAmbientColors.Add (import.Name);
+ ambient.Info.SetValue (result, import, null);
+ continue;
+ }
+ }
+ }
+
+ // convert text colors
+ foreach (var vsc in colors.Values) {
+ bool found = false;
+ foreach (var color in textColors) {
+ if (color.Value.Attribute.VSSetting == null)
+ continue;
+ var split = color.Value.Attribute.VSSetting.Split ('?');
+ foreach (var s in split) {
+ if (s == vsc.Name) {
+ /* if (vsc.Foreground == "0x02000000" && vsc.Background == "0x02000000") {
+ color.Value.Info.SetValue (result, result.PlainText, null);
+ found = true;
+ continue;
+ }*/
+ var textColor = ChunkStyle.Import (color.Value.Attribute.Name, vsc);
+ if (textColor != null) {
+ color.Value.Info.SetValue (result, textColor, null);
+ found = true;
+ }
+ }
+ }
+ }
+ if (!found && !importedAmbientColors.Contains (vsc.Name))
+ Console.WriteLine (vsc.Name + " not imported!");
+ }
+
+ result.IndentationGuide = new AmbientColor ();
+ result.IndentationGuide.Colors.Add (Tuple.Create ("color", AlphaBlend (result.PlainText.Foreground, result.PlainText.Background, 0.3)));
+
+ result.TooltipText = result.PlainText.Clone ();
+ var h = (HslColor)result.TooltipText.Background;
+ h.L += 0.01;
+ result.TooltipText.Background = h;
+
+ result.TooltipPager = new AmbientColor ();
+ result.TooltipPager.Colors.Add (Tuple.Create ("color", result.TooltipText.Background));
+
+ result.TooltipPagerTriangle = new AmbientColor ();
+ result.TooltipPagerTriangle.Colors.Add (Tuple.Create ("color", AlphaBlend (result.PlainText.Foreground, result.PlainText.Background, 0.8)));
+
+ var defaultStyle = SyntaxModeService.GetColorStyle (HslColor.Brightness (result.PlainText.Background) < 0.5 ? DefaultDarkColorStyle : DefaultColorStyle);
+
+ foreach (var color in textColors.Values) {
+ if (color.Info.GetValue (result, null) == null)
+ color.Info.SetValue (result, color.Info.GetValue (defaultStyle, null), null);
+ }
+ foreach (var color in ambientColors.Values) {
+ if (color.Info.GetValue (result, null) == null)
+ color.Info.SetValue (result, color.Info.GetValue (defaultStyle, null), null);
+ }
+ if (result.PlainText.TransparentForeground)
+ result.PlainText.Foreground = new HslColor (0, 0, 0);
+ return result;
+ }
+
+ internal HslColor GetForeground (ChunkStyle chunkStyle)
+ {
+ if (chunkStyle.TransparentForeground)
+ return PlainText.Foreground;
+ return chunkStyle.Foreground;
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ColoredSegment.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ColoredSegment.cs
new file mode 100644
index 0000000000..a5beeea92b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/ColoredSegment.cs
@@ -0,0 +1,64 @@
+//
+// ColoredSegment.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using MonoDevelop.Core.Text;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Ide.Editor.Highlighting
+{
+ /// <summary>
+ /// A colored segment is used in the highlighter to specify a color scheme style to a specfic part of text.
+ /// </summary>
+ public sealed class ColoredSegment : AbstractSegment
+ {
+ readonly string colorStyleKey;
+
+ /// <summary>
+ /// Gets the color style. The style is looked up in the current color scheme.
+ /// </summary>
+ public string ColorStyleKey {
+ get {
+ return colorStyleKey;
+ }
+ }
+
+ public ColoredSegment (int offset, int length, string colorStyleKey) : base (offset, length)
+ {
+ this.colorStyleKey = colorStyleKey;
+ }
+
+ public ColoredSegment (ISegment segment, string colorStyleKey) : base (segment)
+ {
+ this.colorStyleKey = colorStyleKey;
+ }
+
+ public override string ToString ()
+ {
+ return string.Format ("[ColoredSegment: Offset={0}, Length={1},ColorStyleKey={2}]", Offset, Length, ColorStyleKey);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/IStreamProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/IStreamProvider.cs
new file mode 100644
index 0000000000..086402fe69
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/IStreamProvider.cs
@@ -0,0 +1,88 @@
+// IXmlProvider.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+using System.Reflection;
+using System.Xml;
+
+namespace MonoDevelop.Ide.Editor.Highlighting
+{
+ public interface IStreamProvider
+ {
+ Stream Open ();
+ }
+
+ class ResourceStreamProvider : IStreamProvider
+ {
+ Assembly assembly;
+ string manifestResourceName;
+
+ public string ManifestResourceName {
+ get {
+ return manifestResourceName;
+ }
+ }
+
+ public Assembly Assembly {
+ get {
+ return assembly;
+ }
+ }
+
+ public ResourceStreamProvider (Assembly assembly, string manifestResourceName)
+ {
+ this.assembly = assembly;
+ this.manifestResourceName = manifestResourceName;
+ }
+
+ public Stream Open ()
+ {
+ return assembly.GetManifestResourceStream (this.ManifestResourceName);
+ }
+ }
+
+ class UrlStreamProvider : IStreamProvider
+ {
+ string url;
+
+ public string Url {
+ get {
+ return url;
+ }
+ }
+
+ public UrlStreamProvider (string url)
+ {
+ this.url = url;
+ }
+
+ public Stream Open ()
+ {
+ return File.OpenRead (url);
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/SemanticHighlighting.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/SemanticHighlighting.cs
new file mode 100644
index 0000000000..77b4825712
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/SemanticHighlighting.cs
@@ -0,0 +1,76 @@
+//
+// SemanticHighlighting.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Ide.Editor.Highlighting
+{
+ /// <summary>
+ /// Semantic highlighting adds the ability to add highlighting for things that require
+ /// a background parser to be colored. For example type names.
+ /// </summary>
+ public abstract class SemanticHighlighting : IDisposable
+ {
+ protected readonly internal TextEditor editor;
+ protected readonly internal DocumentContext documentContext;
+
+ protected SemanticHighlighting (TextEditor editor, DocumentContext documentContext)
+ {
+ this.editor = editor;
+ this.documentContext = documentContext;
+ this.documentContext.DocumentParsed += HandleDocumentParsed;
+ }
+
+ protected abstract void DocumentParsed ();
+
+ public void NotifySemanticHighlightingUpdate ()
+ {
+ var handler = SemanticHighlightingUpdated;
+ if (handler != null)
+ handler (this, EventArgs.Empty);
+ }
+
+ /// <summary>
+ /// Colorize the specified offset, count and colorizeCallback.
+ /// </summary>
+ /// <param name="segment">The area to run the colorizer in.</param>
+ public abstract IEnumerable<ColoredSegment> GetColoredSegments (ISegment segment);
+
+ void HandleDocumentParsed (object sender, EventArgs e)
+ {
+ if (DefaultSourceEditorOptions.Instance.EnableSemanticHighlighting)
+ DocumentParsed ();
+ }
+
+ public virtual void Dispose ()
+ {
+ documentContext.DocumentParsed -= HandleDocumentParsed;
+ }
+
+ internal event EventHandler SemanticHighlightingUpdated;
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/SyntaxModeService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/SyntaxModeService.cs
new file mode 100644
index 0000000000..d0392f96a8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/SyntaxModeService.cs
@@ -0,0 +1,259 @@
+// SyntaxModeService.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2007 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IO;
+using System.Reflection;
+using System.Threading;
+using System.Xml;
+using System.Xml.Schema;
+using System.Linq;
+using Mono.Addins;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Text;
+
+namespace MonoDevelop.Ide.Editor.Highlighting
+{
+ public static class SyntaxModeService
+ {
+ static Dictionary<string, ColorScheme> styles = new Dictionary<string, ColorScheme> ();
+ static Dictionary<string, IStreamProvider> styleLookup = new Dictionary<string, IStreamProvider> ();
+
+ public static string[] Styles {
+ get {
+ List<string> result = new List<string> ();
+ foreach (string style in styles.Keys) {
+ if (!result.Contains (style))
+ result.Add (style);
+ }
+ foreach (string style in styleLookup.Keys) {
+ if (!result.Contains (style))
+ result.Add (style);
+ }
+ return result.ToArray ();
+ }
+ }
+
+ public static ColorScheme DefaultColorStyle {
+ get {
+ return GetColorStyle (ColorScheme.DefaultColorStyle);
+ }
+ }
+
+ public static ColorScheme GetDefaultColorStyle (this Skin skin)
+ {
+ return GetColorStyle (GetDefaultColorStyleName (skin));
+ }
+
+ public static string GetDefaultColorStyleName ()
+ {
+ return GetDefaultColorStyleName (IdeApp.Preferences.UserInterfaceSkin);
+ }
+
+ public static string GetDefaultColorStyleName (this Skin skin)
+ {
+ switch (skin) {
+ case Skin.Light:
+ return IdePreferences.DefaultLightColorScheme;
+ case Skin.Dark:
+ return IdePreferences.DefaultDarkColorScheme;
+ default:
+ throw new InvalidOperationException ();
+ }
+ }
+
+ public static ColorScheme GetUserColorStyle (this Skin skin)
+ {
+ var schemeName = IdeApp.Preferences.ColorScheme.ValueForSkin (skin);
+ return GetColorStyle (schemeName);
+ }
+
+ public static bool FitsIdeSkin (this ColorScheme scheme, Skin skin)
+ {
+ if (skin == Skin.Dark)
+ return (scheme.PlainText.Background.L <= 0.5);
+ return (scheme.PlainText.Background.L > 0.5);
+ }
+
+ public static ColorScheme GetColorStyle (string name)
+ {
+ if (styleLookup.ContainsKey (name)) {
+ LoadStyle (name);
+ }
+ if (!styles.ContainsKey (name)) {
+ LoggingService.LogWarning ("Color style " + name + " not found, switching to default.");
+ name = GetDefaultColorStyleName ();
+ }
+ if (!styles.ContainsKey (name)) {
+ LoggingService.LogError ("Color style " + name + " not found.");
+ return null;
+ }
+ return styles [name];
+ }
+
+ static IStreamProvider GetProvider (ColorScheme style)
+ {
+ if (styleLookup.ContainsKey (style.Name))
+ return styleLookup[style.Name];
+ return null;
+ }
+
+ static void LoadStyle (string name)
+ {
+ if (!styleLookup.ContainsKey (name))
+ throw new System.ArgumentException ("Style " + name + " not found", "name");
+ var provider = styleLookup [name];
+ styleLookup.Remove (name);
+ var stream = provider.Open ();
+ try {
+ if (provider is UrlStreamProvider) {
+ var usp = provider as UrlStreamProvider;
+ if (usp.Url.EndsWith (".vssettings", StringComparison.Ordinal)) {
+ styles [name] = ColorScheme.Import (usp.Url, stream);
+ } else {
+ styles [name] = ColorScheme.LoadFrom (stream);
+ }
+ styles [name].FileName = usp.Url;
+ } else {
+ styles [name] = ColorScheme.LoadFrom (stream);
+ }
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while loading style :" + name, e);
+ throw new IOException ("Error while loading style :" + name, e);
+ } finally {
+ stream.Close ();
+ }
+ }
+
+
+ static void Remove (ColorScheme style)
+ {
+ if (styleLookup.ContainsKey (style.Name))
+ styleLookup.Remove (style.Name);
+
+ foreach (var kv in styles) {
+ if (kv.Value == style) {
+ styles.Remove (kv.Key);
+ return;
+ }
+ }
+ }
+
+
+ static List<ValidationEventArgs> ValidateStyleFile (string fileName)
+ {
+ List<ValidationEventArgs> result = new List<ValidationEventArgs> ();
+ return result;
+ }
+
+
+ internal static void LoadStylesAndModes (string path)
+ {
+ foreach (string file in Directory.GetFiles (path)) {
+ if (file.EndsWith (".json", StringComparison.Ordinal)) {
+ using (var stream = File.OpenRead (file)) {
+ string styleName = ScanStyle (stream);
+ if (!string.IsNullOrEmpty (styleName)) {
+ styleLookup [styleName] = new UrlStreamProvider (file);
+ } else {
+ Console.WriteLine ("Invalid .json syntax sheme file : " + file);
+ }
+ }
+ } else if (file.EndsWith (".vssettings", StringComparison.Ordinal)) {
+ using (var stream = File.OpenRead (file)) {
+ string styleName = Path.GetFileNameWithoutExtension (file);
+ styleLookup [styleName] = new UrlStreamProvider (file);
+ }
+ }
+ }
+ }
+
+ static void LoadStylesAndModes (Assembly assembly)
+ {
+ foreach (string resource in assembly.GetManifestResourceNames ()) {
+ if (resource.EndsWith ("Style.json", StringComparison.Ordinal)) {
+ using (Stream stream = assembly.GetManifestResourceStream (resource)) {
+ string styleName = ScanStyle (stream);
+ styleLookup [styleName] = new ResourceStreamProvider (assembly, resource);
+ }
+ }
+ }
+ }
+ static System.Text.RegularExpressions.Regex nameRegex = new System.Text.RegularExpressions.Regex ("\\s*\"name\"\\s*:\\s*\"(.*)\"\\s*,");
+
+ static string ScanStyle (Stream stream)
+ {
+ try {
+ var file = TextFileUtility.OpenStream (stream);
+ file.ReadLine ();
+ var nameLine = file.ReadLine ();
+ file.Close ();
+ var match = nameRegex.Match (nameLine);
+ if (!match.Success)
+ return null;
+ return match.Groups[1].Value;
+ } catch (Exception e) {
+ Console.WriteLine ("Error while scanning json:");
+ Console.WriteLine (e);
+ return null;
+ }
+ }
+
+ internal static void AddStyle (ColorScheme style)
+ {
+ styles [style.Name] = style;
+ }
+
+ internal static void AddStyle (IStreamProvider provider)
+ {
+ using (var stream = provider.Open ()) {
+ string styleName = ScanStyle (stream);
+ styleLookup [styleName] = provider;
+ }
+ }
+
+ internal static void RemoveStyle (IStreamProvider provider)
+ {
+ using (var stream = provider.Open ()) {
+ string styleName = ScanStyle (stream);
+ styleLookup.Remove (styleName);
+ }
+ }
+
+ static SyntaxModeService ()
+ {
+ var textEditorAssembly = Assembly.Load ("Mono.TextEditor");
+ if (textEditorAssembly != null) {
+ LoadStylesAndModes (textEditorAssembly);
+ } else {
+ LoggingService.LogError ("Can't lookup Mono.TextEditor assembly. Default styles won't be loaded.");
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/TemplateCodon.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/TemplateCodon.cs
new file mode 100644
index 0000000000..bd57ac22d0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/TemplateCodon.cs
@@ -0,0 +1,64 @@
+// TemplateCodon.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+using System.IO;
+using System;
+using System.Xml;
+
+using Mono.Addins;
+
+namespace MonoDevelop.Ide.Editor.Highlighting
+{
+ [ExtensionNode (Description="A template for color and syntax shemes.")]
+ class TemplateCodon : ExtensionNode, IStreamProvider
+ {
+ [NodeAttribute("resource", "Name of the resource where the template is stored.")]
+ string resource;
+
+ [NodeAttribute("file", "Name of the file where the template is stored.")]
+ string file;
+
+ public TemplateCodon ()
+ {
+ resource = file = null;
+ }
+
+ public Stream Open ()
+ {
+ Stream stream;
+ if (!string.IsNullOrEmpty (file)) {
+ stream = File.OpenRead (Addin.GetFilePath (file));
+ } else if (!string.IsNullOrEmpty (resource)) {
+ stream = Addin.GetResource (resource);
+ if (stream == null)
+ throw new ApplicationException ("Template " + resource + " not found");
+ } else {
+ throw new InvalidOperationException ("Template file or resource not provided");
+ }
+
+ return stream;
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/TemplateExtensionNodeLoader.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/TemplateExtensionNodeLoader.cs
new file mode 100644
index 0000000000..859686c49b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Highlighting/TemplateExtensionNodeLoader.cs
@@ -0,0 +1,55 @@
+// TemplateExtensionNodeLoader.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+using System;
+using Mono.Addins;
+using MonoDevelop.Ide.Editor.Highlighting;
+
+namespace MonoDevelop.Ide.Editor.Highlighting
+{
+ static class TemplateExtensionNodeLoader
+ {
+ static bool initialized = false;
+
+ public static void Init ()
+ {
+ if (initialized)
+ return;
+ initialized = true;
+ AddinManager.AddExtensionNodeHandler ("/MonoDevelop/SourceEditor2/Styles", OnStylesExtensionChanged);
+ }
+
+ static void OnStylesExtensionChanged (object s, ExtensionNodeEventArgs args)
+ {
+ TemplateCodon codon = (TemplateCodon)args.ExtensionNode;
+ if (args.Change == ExtensionChange.Add) {
+ SyntaxModeService.AddStyle (codon);
+ } else {
+ SyntaxModeService.RemoveStyle (codon);
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Util/Diff.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Util/Diff.cs
new file mode 100644
index 0000000000..364b0f2288
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Util/Diff.cs
@@ -0,0 +1,587 @@
+//
+// Diff.cs
+//
+// Author:
+// Matthias Hertel, http://www.mathertel.de//
+// some tweaks made by Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) by Matthias Hertel, http://www.mathertel.de//
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+// diff.cs: A port of the algorythm to C#
+// Copyright (c) by Matthias Hertel, http://www.mathertel.de
+// This work is licensed under a BSD style license. See http://www.mathertel.de/License.aspx
+//
+// This Class implements the Difference Algorithm published in
+// "An O(ND) Difference Algorithm and its Variations" by Eugene Myers
+// Algorithmica Vol. 1 No. 2, 1986, p 251.
+//
+// There are many C, Java, Lisp implementations public available but they all seem to come
+// from the same source (diffutils) that is under the (unfree) GNU public License
+// and cannot be reused as a sourcecode for a commercial application.
+// There are very old C implementations that use other (worse) algorithms.
+// Microsoft also published sourcecode of a diff-tool (windiff) that uses some tree data.
+// Also, a direct transfer from a C source to C# is not easy because there is a lot of pointer
+// arithmetic in the typical C solutions and i need a managed solution.
+// These are the reasons why I implemented the original published algorithm from the scratch and
+// make it avaliable without the GNU license limitations.
+// I do not need a high performance diff tool because it is used only sometimes.
+// I will do some performace tweaking when needed.
+//
+// The algorithm itself is comparing 2 arrays of numbers so when comparing 2 text documents
+// each line is converted into a (hash) number. See DiffText().
+//
+// Some chages to the original algorithm:
+// The original algorithm was described using a recursive approach and comparing zero indexed arrays.
+// Extracting sub-arrays and rejoining them is very performance and memory intensive so the same
+// (readonly) data arrays are passed arround together with their lower and upper bounds.
+// This circumstance makes the LCS and SMS functions more complicate.
+// I added some code to the LCS function to get a fast response on sub-arrays that are identical,
+// completely deleted or inserted.
+//
+// The result from a comparisation is stored in 2 arrays that flag for modified (deleted or inserted)
+// lines in the 2 data arrays. These bits are then analysed to produce a array of Hunk objects.
+//
+// Further possible optimizations:
+// (first rule: don't do it; second: don't do it yet)
+// The arrays DataA and DataB are passed as parameters, but are never changed after the creation
+// so they can be members of the class to avoid the paramter overhead.
+// In SMS is a lot of boundary arithmetic in the for-D and for-k loops that can be done by increment
+// and decrement of local variables.
+// The DownVector and UpVector arrays are alywas created and destroyed each time the SMS gets called.
+// It is possible to reuse tehm when transfering them to members of the class.
+// See TODO: hints.
+//
+// Changes:
+// 2002.09.20 There was a "hang" in some situations.
+// Now I undestand a little bit more of the SMS algorithm.
+// There have been overlapping boxes; that where analyzed partial differently.
+// One return-point is enough.
+// A assertion was added in CreateDiffs when in debug-mode, that counts the number of equal (no modified) lines in both arrays.
+// They must be identical.
+//
+// 2003.02.07 Out of bounds error in the Up/Down vector arrays in some situations.
+// The two vetors are now accessed using different offsets that are adjusted using the start k-Line.
+// A test case is added.
+//
+// 2006.03.05 Some documentation and a direct Diff entry point.
+//
+// 2006.03.08 Refactored the API to static methods on the Diff class to make usage simpler.
+// 2006.03.10 using the standard Debug class for self-test now.
+// compile with: csc /target:exe /out:diffTest.exe /d:DEBUG /d:TRACE /d:SELFTEST Diff.cs
+// 2007.01.06 license agreement changed to a BSD style license.
+// 2007.06.03 added the Optimize method.
+// 2007.09.23 UpVector and DownVector optimization by Jan Stoklasa ().
+// 2008.05.31 Adjusted the testing code that failed because of the Optimize method (not a bug in the diff algorithm).
+// 2008.10.08 Fixing a test case and adding a new test case.
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.RegularExpressions;
+
+namespace MonoDevelop.Ide.Editor.Util
+{
+ /// <summary>
+ /// A DiffHunk represents a single change in a diff between two files.
+ /// </summary>
+ public struct DiffHunk
+ {
+ public static readonly DiffHunk Empty = new DiffHunk (0, 0, 0, 0);
+
+ /// <summary>
+ /// Gets a value indicating whether this instance is empty.
+ /// </summary>
+ /// <value><c>true</c> if this instance is empty; otherwise, <c>false</c>.</value>
+ public bool IsEmpty {
+ get {
+ return InsertStart <= 0;
+ }
+ }
+
+ // TODO: Add option to change this value.
+ internal readonly int Context;
+
+ /// <summary>
+ /// Line number where the insertion starts.
+ /// </summary>
+ public readonly int InsertStart;
+
+ /// <summary>
+ /// Line number where the removal starts.
+ /// </summary>
+ public readonly int RemoveStart;
+
+ /// <summary>
+ /// Number of lines removed.
+ /// </summary>
+ public readonly int Removed;
+
+ /// <summary>
+ /// Number of lines inserted.
+ /// </summary>
+ public readonly int Inserted;
+
+ public DiffHunk (int removeStart, int insertStart, int removed, int inserted)
+ {
+ this.InsertStart = insertStart;
+ this.RemoveStart = removeStart;
+ this.Removed = removed;
+ this.Inserted = inserted;
+ this.Context = 3;
+ }
+
+ public int DistanceTo(DiffHunk other)
+ {
+ return other.RemoveStart - (this.RemoveStart + this.Removed);
+ }
+
+ public bool Overlaps(DiffHunk other)
+ {
+ return DistanceTo (other) < this.Context * 2;
+ }
+
+ public static bool operator ==(DiffHunk left, DiffHunk right)
+ {
+ return left.InsertStart == right.InsertStart && left.RemoveStart == right.RemoveStart &&
+ left.Removed == right.Removed && left.Inserted == right.Inserted;
+ }
+
+ public static bool operator !=(DiffHunk left, DiffHunk right)
+ {
+ return !(left == right);
+ }
+
+ public override bool Equals (object obj)
+ {
+ if (!(obj is DiffHunk))
+ return false;
+ return ((DiffHunk)obj) == this;
+ }
+
+ public override int GetHashCode ()
+ {
+ return InsertStart ^ RemoveStart ^ Inserted ^ Removed;
+ }
+
+ public override string ToString ()
+ {
+ if (IsEmpty)
+ return"[Hunk: Empty]";
+ return string.Format ("[Hunk: InsertStart={0}, RemoveStart={1}, Removed={2}, Inserted={3}]", InsertStart, RemoveStart, Removed, Inserted);
+ }
+ }
+
+ sealed class Diff
+ {
+ /// <summary>
+ /// Shortest Middle Snake Return Data
+ /// </summary>
+ struct SMSRD
+ {
+ internal int x, y;
+ }
+
+ static void Optimize<T> (DiffData<T> data)
+ {
+ int startPos = 0;
+ while (startPos < data.Length) {
+ while (startPos < data.Length && data.Modified[startPos] == false)
+ startPos++;
+ int endPos = startPos;
+ while (endPos < data.Length && data.Modified[endPos] == true)
+ endPos++;
+
+ if (endPos < data.Length && data.Data[startPos].Equals (data.Data[endPos])) {
+ data.Modified[startPos] = false;
+ data.Modified[endPos] = true;
+ } else {
+ startPos = endPos;
+ }
+ }
+ }
+
+ public static IEnumerable<DiffHunk> CharDiff (string left, string right)
+ {
+ return GetDiff (left != null ? left.ToCharArray () : new char[0], right != null ? right.ToCharArray () : new char[0]);
+ }
+
+ public static IEnumerable<DiffHunk> GetDiff<T> (T[] baseArray, T[] changedArray)
+ {
+ // The A-Version of the data (original data) to be compared.
+ var dataA = new DiffData<T> (baseArray);
+
+ // The B-Version of the data (modified data) to be compared.
+ var dataB = new DiffData<T> (changedArray);
+
+ int MAX = dataA.Length + dataB.Length + 1;
+ // vector for the (0,0) to (x,y) search
+ int[] downVector = new int[2 * MAX + 2];
+ // vector for the (u,v) to (N,M) search
+ int[] upVector = new int[2 * MAX + 2];
+
+ LCS (dataA, 0, dataA.Length, dataB, 0, dataB.Length, downVector, upVector);
+ return CreateDiffs (dataA, dataB);
+ }
+
+ /// <summary>Scan the tables of which lines are inserted and deleted,
+ /// producing an edit script in forward order.
+ /// </summary>
+ /// dynamic array
+ static IEnumerable<DiffHunk> CreateDiffs<T> (DiffData<T> baseData, DiffData<T> changedData)
+ {
+ int lineA = 0;
+ int lineB = 0;
+ while (lineA < baseData.Length || lineB < changedData
+ .Length) {
+ if (lineA < baseData.Length && !baseData.Modified[lineA] && lineB < changedData
+ .Length && !changedData
+ .Modified[lineB]) {
+ // equal lines
+ lineA++;
+ lineB++;
+
+ } else {
+ // maybe deleted and/or inserted lines
+ int startA = lineA;
+ int startB = lineB;
+
+ while (lineA < baseData.Length && (lineB >= changedData
+ .Length || baseData.Modified[lineA]))
+ // while (LineA < DataA.Length && DataA.Modified[LineA])
+ lineA++;
+
+ while (lineB < changedData
+ .Length && (lineA >= baseData.Length || changedData
+ .Modified[lineB]))
+ // while (LineB < DataB.Length && DataB.Modified[LineB])
+ lineB++;
+
+ if (startA < lineA || startB < lineB) {
+ // store a new difference-item
+ yield return new DiffHunk (startA + 1, startB + 1, lineA - startA, lineB - startB);
+ }
+ // if
+ }
+ // if
+ }
+ // while
+ }
+
+ /// <summary>
+ /// This is the algorithm to find the Shortest Middle Snake (SMS).
+ /// </summary>
+ /// <param name="dataA">sequence A</param>
+ /// <param name="lowerA">lower bound of the actual range in DataA</param>
+ /// <param name="upperA">upper bound of the actual range in DataA (exclusive)</param>
+ /// <param name="dataB">sequence B</param>
+ /// <param name="lowerB">lower bound of the actual range in DataB</param>
+ /// <param name="upperB">upper bound of the actual range in DataB (exclusive)</param>
+ /// <param name="downVector">a vector for the (0,0) to (x,y) search. Passed as a parameter for speed reasons.</param>
+ /// <param name="upVector">a vector for the (u,v) to (N,M) search. Passed as a parameter for speed reasons.</param>
+ /// <returns>a MiddleSnakeData record containing x,y and u,v</returns>
+ static SMSRD SMS<T> (DiffData<T> dataA, int lowerA, int upperA, DiffData<T> dataB, int lowerB, int upperB, int[] downVector, int[] upVector)
+ {
+ SMSRD ret;
+ int MAX = dataA.Length + dataB.Length + 1;
+
+ int downK = lowerA - lowerB;
+ // the k-line to start the forward search
+ int upK = upperA - upperB;
+ // the k-line to start the reverse search
+ int delta = (upperA - lowerA) - (upperB - lowerB);
+ bool oddDelta = (delta & 1) != 0;
+
+ // The vectors in the publication accepts negative indexes. the vectors implemented here are 0-based
+ // and are access using a specific offset: UpOffset UpVector and DownOffset for DownVektor
+ int downOffset = MAX - downK;
+ int upOffset = MAX - upK;
+
+ int MaxD = ((upperA - lowerA + upperB - lowerB) / 2) + 1;
+
+ // Debug.Write(2, "SMS", String.Format("Search the box: A[{0}-{1}] to B[{2}-{3}]", LowerA, UpperA, LowerB, UpperB));
+
+ // init vectors
+ downVector[downOffset + downK + 1] = lowerA;
+ upVector[upOffset + upK - 1] = upperA;
+
+ for (int D = 0; D <= MaxD; D++) {
+
+ // Extend the forward path.
+ for (int k = downK - D; k <= downK + D; k += 2) {
+ // Debug.Write(0, "SMS", "extend forward path " + k.ToString());
+
+ // find the only or better starting point
+ int x, y;
+ if (k == downK - D) {
+ x = downVector[downOffset + k + 1];
+ // down
+ } else {
+ x = downVector[downOffset + k - 1] + 1;
+ // a step to the right
+ if (k < downK + D && downVector[downOffset + k + 1] >= x)
+ x = downVector[downOffset + k + 1];
+ // down
+ }
+ y = x - k;
+
+ // find the end of the furthest reaching forward D-path in diagonal k.
+ while (x < upperA && y < upperB && dataA.Data[x].Equals (dataB.Data[y])) {
+ x++;
+ y++;
+ }
+ downVector[downOffset + k] = x;
+
+ // overlap ?
+ if (oddDelta && upK - D < k && k < upK + D) {
+ if (upVector[upOffset + k] <= downVector[downOffset + k]) {
+ ret.x = downVector[downOffset + k];
+ ret.y = downVector[downOffset + k] - k;
+ // ret.u = UpVector[UpOffset + k]; // 2002.09.20: no need for 2 points
+ // ret.v = UpVector[UpOffset + k] - k;
+ return (ret);
+ }
+ // if
+ }
+ // if
+ }
+ // for k
+ // Extend the reverse path.
+ for (int k = upK - D; k <= upK + D; k += 2) {
+ // Debug.Write(0, "SMS", "extend reverse path " + k.ToString());
+
+ // find the only or better starting point
+ int x, y;
+ if (k == upK + D) {
+ x = upVector[upOffset + k - 1];
+ // up
+ } else {
+ x = upVector[upOffset + k + 1] - 1;
+ // left
+ if (k > upK - D && upVector[upOffset + k - 1] < x)
+ x = upVector[upOffset + k - 1];
+ // up
+ }
+ // if
+ y = x - k;
+
+ while (x > lowerA && y > lowerB && dataA.Data[x - 1].Equals (dataB.Data[y - 1])) {
+ x--;
+ y--;
+ // diagonal
+ }
+ upVector[upOffset + k] = x;
+
+ // overlap ?
+ if (!oddDelta && downK - D <= k && k <= downK + D) {
+ if (upVector[upOffset + k] <= downVector[downOffset + k]) {
+ ret.x = downVector[downOffset + k];
+ ret.y = downVector[downOffset + k] - k;
+ // ret.u = UpVector[UpOffset + k]; // 2002.09.20: no need for 2 points
+ // ret.v = UpVector[UpOffset + k] - k;
+ return (ret);
+ }
+ // if
+ }
+ // if
+ }
+ // for k
+ }
+ // for D
+ throw new ApplicationException ("the algorithm should never come here.");
+ }
+ // SMS
+
+ /// <summary>
+ /// This is the divide-and-conquer implementation of the longest common-subsequence (LCS)
+ /// algorithm.
+ /// The published algorithm passes recursively parts of the A and B sequences.
+ /// To avoid copying these arrays the lower and upper bounds are passed while the sequences stay constant.
+ /// </summary>
+ /// <param name="dataA">sequence A</param>
+ /// <param name="lowerA">lower bound of the actual range in DataA</param>
+ /// <param name="upperA">upper bound of the actual range in DataA (exclusive)</param>
+ /// <param name="dataB">sequence B</param>
+ /// <param name="lowerB">lower bound of the actual range in DataB</param>
+ /// <param name="upperB">upper bound of the actual range in DataB (exclusive)</param>
+ /// <param name="downVector">a vector for the (0,0) to (x,y) search. Passed as a parameter for speed reasons.</param>
+ /// <param name="upVector">a vector for the (u,v) to (N,M) search. Passed as a parameter for speed reasons.</param>
+ static void LCS<T> (DiffData<T> dataA, int lowerA, int upperA, DiffData<T> dataB, int lowerB, int upperB, int[] downVector, int[] upVector)
+ {
+ // Fast walkthrough equal lines at the start
+ while (lowerA < upperA && lowerB < upperB && dataA.Data[lowerA].Equals (dataB.Data[lowerB])) {
+ lowerA++;
+ lowerB++;
+ }
+
+ // Fast walkthrough equal lines at the end
+ while (lowerA < upperA && lowerB < upperB && dataA.Data[upperA - 1].Equals (dataB.Data[upperB - 1])) {
+ --upperA;
+ --upperB;
+ }
+
+ if (lowerA == upperA) {
+ // mark as inserted lines.
+ while (lowerB < upperB)
+ dataB.Modified[lowerB++] = true;
+
+ } else if (lowerB == upperB) {
+ // mark as deleted lines.
+ while (lowerA < upperA)
+ dataA.Modified[lowerA++] = true;
+
+ } else {
+ // Find the middle snakea and length of an optimal path for A and B
+ SMSRD smsrd = SMS (dataA, lowerA, upperA, dataB, lowerB, upperB, downVector, upVector);
+ // Debug.Write(2, "MiddleSnakeData", String.Format("{0},{1}", smsrd.x, smsrd.y));
+
+ // The path is from LowerX to (x,y) and (x,y) to UpperX
+ LCS (dataA, lowerA, smsrd.x, dataB, lowerB, smsrd.y, downVector, upVector);
+ LCS (dataA, smsrd.x, upperA, dataB, smsrd.y, upperB, downVector, upVector);
+ // 2002.09.20: no need for 2 points
+ }
+ }
+ // LCS()
+
+ static void WriteHunks (Queue<DiffHunk> qh, IReadonlyTextDocument baseDocument, IReadonlyTextDocument changedDocument, StringBuilder sb)
+ {
+ DiffHunk item;
+ int remStart;
+ int insStart;
+ int distance = 0;
+
+ do {
+ item = qh.Dequeue ();
+ remStart = System.Math.Max (1, item.RemoveStart - (distance != 0 ? distance : item.Context));
+ insStart = System.Math.Max (1, item.InsertStart - (distance != 0 ? distance : item.Context));
+
+ for (int i = System.Math.Min (remStart, insStart); i < item.RemoveStart; i++) {
+ sb.AppendLine (" " + baseDocument.GetLineText (i, false));
+ }
+ for (int i = item.RemoveStart; i < item.RemoveStart + item.Removed; i++) {
+ sb.AppendLine ("-" + baseDocument.GetLineText (i, false));
+ }
+ for (int i = item.InsertStart; i < item.InsertStart + item.Inserted; i++) {
+ sb.AppendLine ("+" + changedDocument.GetLineText (i, false));
+ }
+
+ if (qh.Count != 0)
+ distance = item.DistanceTo (qh.Peek ());
+ } while (qh.Count != 0);
+
+ int remEnd = System.Math.Min (baseDocument.LineCount, item.RemoveStart + item.Removed + item.Context);
+ for (int i = item.RemoveStart + item.Removed; i < remEnd; i++) {
+ sb.AppendLine (" " + baseDocument.GetLineText (i, false));
+ }
+ }
+
+ public static string GetDiffString (IReadonlyTextDocument baseDocument, IReadonlyTextDocument changedDocument)
+ {
+ return GetDiffString (baseDocument.GetDiff (changedDocument), baseDocument, changedDocument, baseDocument.FileName, changedDocument.FileName);
+ }
+
+ public static string GetDiffString (IEnumerable<DiffHunk> diff, IReadonlyTextDocument baseDocument, IReadonlyTextDocument changedDocument, string baseFileName, string changedFileName)
+ {
+ if (diff == null)
+ return "";
+
+ StringBuilder sb = new StringBuilder ();
+ IEnumerator<DiffHunk> he = diff.GetEnumerator ();
+ he.MoveNext ();
+
+ Queue<DiffHunk> qh = new Queue<DiffHunk> ();
+ DiffHunk current;
+ DiffHunk next;
+
+ if (he.Current.IsEmpty)
+ return "";
+
+ sb.AppendLine ("--- " + baseFileName);
+ sb.AppendLine ("+++ " + changedFileName);
+
+ current = he.Current;
+
+ qh.Enqueue (current);
+ int remStart = System.Math.Max (1, current.RemoveStart - current.Context);
+ int remEnd = System.Math.Min (baseDocument.LineCount, current.RemoveStart + current.Removed + current.Context);
+ int insStart = System.Math.Max (1, current.InsertStart - current.Context);
+ int insEnd = System.Math.Min (changedDocument.LineCount, current.InsertStart + current.Inserted + current.Context);
+
+ while (he.MoveNext ()) {
+ next = he.Current;
+
+ if (current.Overlaps (next)) {
+ // Change upper bounds.
+ remEnd = System.Math.Min (baseDocument.LineCount, next.RemoveStart + next.Removed + next.Context);
+ insEnd = System.Math.Min (changedDocument.LineCount, next.InsertStart + next.Inserted + next.Context);
+ } else {
+ sb.AppendLine ("@@ -" + remStart + "," + (remEnd - remStart) + " +" + insStart + "," + (insEnd - insStart) + " @@");
+ WriteHunks (qh, baseDocument, changedDocument, sb);
+
+ remStart = System.Math.Max (1, next.RemoveStart - next.Context);
+ remEnd = System.Math.Min (baseDocument.LineCount, next.RemoveStart + next.Removed + next.Context);
+ insStart = System.Math.Max (1, next.InsertStart - next.Context);
+ insEnd = System.Math.Min (changedDocument.LineCount, next.InsertStart + next.Inserted + next.Context);
+ }
+ qh.Enqueue (next);
+
+ current = next;
+ }
+
+ if (qh.Count != 0) {
+ sb.AppendLine ("@@ -" + remStart + "," + (remEnd - remStart) + " +" + insStart + "," + (insEnd - insStart) + " @@");
+ WriteHunks (qh, baseDocument, changedDocument, sb);
+ }
+ return sb.ToString ();
+ }
+ }
+
+ /// <summary>Data on one input file being compared.
+ /// </summary>
+ class DiffData<T>
+ {
+ /// <summary>Number of elements (lines).</summary>
+ public readonly int Length;
+
+ /// <summary>Buffer of numbers that will be compared.</summary>
+ public readonly T[] Data;
+
+ /// <summary>
+ /// Array of booleans that flag for modified data.
+ /// This is the result of the diff.
+ /// This means deletedA in the first Data or inserted in the second Data.
+ /// </summary>
+ public readonly bool[] Modified;
+
+ /// <summary>
+ /// Initialize the Diff-Data buffer.
+ /// </summary>
+ /// <param name="initData">reference to the buffer</param>
+ public DiffData (T[] initData)
+ {
+ Data = initData;
+ Length = initData.Length;
+ Modified = new bool[Length + 2];
+ }
+ // DiffData
+ }
+ // class DiffData
+}
+// namespace
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Util/SimpleBracketMatcher.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Util/SimpleBracketMatcher.cs
new file mode 100644
index 0000000000..2ac82d045a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Util/SimpleBracketMatcher.cs
@@ -0,0 +1,277 @@
+//
+// SimpleBracketMatcher.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using MonoDevelop.Ide.Editor.Highlighting;
+using System.Threading;
+
+namespace MonoDevelop.Ide.Editor.Util
+{
+ static class SimpleBracketMatcher
+ {
+ const string openBrackets = "([{<";
+ const string closingBrackets = ")]}>";
+
+ public static int GetMatchingBracketOffset (IReadonlyTextDocument document, int offset, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (offset < 0 || offset >= document.Length)
+ return -1;
+ char ch = document.GetCharAt (offset);
+ int bracket = openBrackets.IndexOf (ch);
+ int result;
+ if (bracket >= 0) {
+ result = SearchMatchingBracketForward (document, offset + 1, closingBrackets [bracket], openBrackets [bracket], cancellationToken);
+ } else {
+ bracket = closingBrackets.IndexOf (ch);
+ if (bracket >= 0) {
+ result = SearchMatchingBracketBackward (document, offset - 1, openBrackets [bracket], closingBrackets [bracket], cancellationToken);
+ } else {
+ result = -1;
+ }
+ }
+ return result;
+ }
+
+ static readonly string [] emptyList = new string [0];
+ static string [] GetList (IReadonlyTextDocument document, string name)
+ {
+ return TextEditorFactory.GetSyntaxProperties (document.MimeType, name) ?? emptyList;
+ }
+
+ static int StartsWithListMember (IReadonlyTextDocument document, IList<string> list, int offset)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ if (list == null)
+ throw new ArgumentNullException ("list");
+ for (int i = 0; i < list.Count; i++) {
+ string item = list [i];
+ if (offset + item.Length < document.Length) {
+ if (document.GetTextAt (offset, item.Length) == item)
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ static int SearchMatchingBracketForward (IReadonlyTextDocument document, int offset, char openBracket, char closingBracket, CancellationToken cancellationToken)
+ {
+ bool isInBlockComment = false;
+ bool isInLineComment = false;
+ int curStringQuote = -1;
+
+ bool startsInLineComment = StartsInLineComment (document, offset);
+
+ var lineComments = GetList (document, "LineComment");
+ var blockCommentStarts = GetList (document, "BlockCommentStart");
+ var blockCommentEnds = GetList (document, "BlockCommentEnd");
+ var stringQuotes = GetList (document, "StringQuote");
+ int depth = -1;
+ while (offset >= 0 && offset < document.Length) {
+ if (offset % 100 == 0 && cancellationToken.IsCancellationRequested)
+ return -1;
+ if (curStringQuote < 0) {
+ // check line comments
+ if (!isInBlockComment && !isInLineComment)
+ isInLineComment = StartsWithListMember (document, lineComments, offset) >= 0;
+
+ // check block comments
+ if (!isInLineComment) {
+ if (!isInBlockComment) {
+ isInBlockComment = StartsWithListMember (document, blockCommentStarts, offset) >= 0;
+ } else {
+ isInBlockComment = StartsWithListMember (document, blockCommentEnds, offset) < 0;
+ }
+ }
+ }
+
+ if (!isInBlockComment && !isInLineComment) {
+ int i = StartsWithListMember (document, stringQuotes, offset);
+ if (i >= 0) {
+ if (curStringQuote >= 0) {
+ if (curStringQuote == i)
+ curStringQuote = -1;
+ } else {
+ curStringQuote = i;
+ }
+ }
+ }
+
+ char ch = document.GetCharAt (offset);
+ switch (ch) {
+ case '\n':
+ case '\r':
+ if (startsInLineComment)
+ return -1;
+ isInLineComment = false;
+ break;
+ default:
+ if (ch == closingBracket) {
+ if (!(isInLineComment || curStringQuote >= 0 || isInBlockComment))
+ --depth;
+ } else if (ch == openBracket) {
+ if (!(isInLineComment || curStringQuote >= 0 || isInBlockComment)) {
+ ++depth;
+ if (depth == 0)
+ return offset;
+ }
+ }
+ break;
+ }
+ offset++;
+ }
+ return -1;
+ }
+
+ static bool StartsInLineComment (IReadonlyTextDocument document, int offset)
+ {
+ IList<string> lineComments = GetList (document, "LineComment");
+ var line = document.GetLineByOffset (offset);
+ for (int i = line.Offset; i < offset; i++) {
+ if (StartsWithListMember (document, lineComments, i) >= 0)
+ return true;
+ }
+ return false;
+ }
+
+ static int GetLastSourceCodePosition (IReadonlyTextDocument document, int lineOffset)
+ {
+ var line = document.GetLineByOffset (lineOffset);
+ bool isInBlockComment = false;
+ bool isInLineComment = false;
+ int curStringQuote = -1;
+
+ IList<string> lineComments = GetList (document, "LineComment");
+ IList<string> blockCommentStarts = GetList (document, "BlockCommentStart");
+ IList<string> blockCommentEnds = GetList (document, "BlockCommentEnd");
+ IList<string> stringQuotes = GetList (document, "StringQuote");
+
+ for (int i = 0; i < line.Length; i++) {
+ int offset = line.Offset + i;
+ // check line comments
+ if (!isInBlockComment && curStringQuote < 0) {
+ isInLineComment = StartsWithListMember (document, lineComments, offset) >= 0;
+ if (isInLineComment)
+ return System.Math.Min (offset, lineOffset);
+ }
+ // check block comments
+ if (!isInLineComment && curStringQuote < 0) {
+ if (!isInBlockComment) {
+ isInBlockComment = StartsWithListMember (document, blockCommentStarts, offset) >= 0;
+ } else {
+ isInBlockComment = StartsWithListMember (document, blockCommentEnds, offset) < 0;
+ }
+ }
+
+ if (!isInBlockComment && !isInLineComment) {
+ int j = StartsWithListMember (document, stringQuotes, offset);
+ if (j >= 0) {
+ if (curStringQuote >= 0) {
+ if (curStringQuote == j)
+ curStringQuote = -1;
+ } else {
+ curStringQuote = j;
+ }
+ }
+ }
+ }
+ return lineOffset;
+ }
+
+ static int SearchMatchingBracketBackward (IReadonlyTextDocument document, int offset, char openBracket, char closingBracket, CancellationToken cancellationToken)
+ {
+ bool isInBlockComment = false;
+ bool isInLineComment = false;
+ int curStringQuote = -1;
+
+ IList<string> blockCommentStarts = GetList (document, "BlockCommentStart");
+ IList<string> blockCommentEnds = GetList (document, "BlockCommentEnd");
+ IList<string> stringQuotes = GetList (document, "StringQuote");
+
+ bool startsInLineComment = StartsInLineComment (document, offset);
+ int depth = -1;
+
+ if (!startsInLineComment)
+ offset = GetLastSourceCodePosition (document, offset);
+
+ while (offset >= 0 && offset < document.Length) {
+ if (offset % 100 == 0 && cancellationToken.IsCancellationRequested)
+ return -1;
+ char ch = document.GetCharAt (offset);
+
+ // check block comments
+ if (!isInLineComment && curStringQuote < 0) {
+ if (!isInBlockComment) {
+ isInBlockComment = StartsWithListMember (document, blockCommentEnds, offset) >= 0;
+ } else {
+ isInBlockComment = StartsWithListMember (document, blockCommentStarts, offset) < 0;
+ }
+ }
+
+ if (!isInBlockComment && !isInLineComment) {
+ int i = StartsWithListMember (document, stringQuotes, offset);
+ if (i >= 0) {
+ if (curStringQuote >= 0) {
+ if (curStringQuote == i)
+ curStringQuote = -1;
+ } else {
+ curStringQuote = i;
+ }
+ }
+ }
+
+ switch (ch) {
+ case '\n':
+ case '\r':
+ if (startsInLineComment)
+ return -1;
+ offset--;
+ while (offset > 0 && (document.GetCharAt (offset) == '\n' || document.GetCharAt (offset) == '\r')) {
+ offset--;
+ }
+ offset = GetLastSourceCodePosition (document, offset) + 1;
+ break;
+ default:
+ if (ch == closingBracket) {
+ if (!(curStringQuote >= 0 || isInBlockComment))
+ --depth;
+ } else if (ch == openBracket) {
+ if (!(curStringQuote >= 0 || isInBlockComment)) {
+ ++depth;
+ if (depth == 0)
+ return offset;
+ }
+ }
+ break;
+ }
+ offset--;
+ }
+ return -1;
+ }
+ }
+
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Util/SimpleReadonlyDocument.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Util/SimpleReadonlyDocument.cs
new file mode 100644
index 0000000000..0448338147
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Util/SimpleReadonlyDocument.cs
@@ -0,0 +1,421 @@
+//
+// SimpleReadonlyDocument.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using MonoDevelop.Core;
+using System.Threading;
+
+namespace MonoDevelop.Ide.Editor.Util
+{
+ /// <summary>
+ /// A simple and fast implementation for a read only text document.
+ /// </summary>
+ public class SimpleReadonlyDocument : IReadonlyTextDocument
+ {
+ readonly ITextSource textSource;
+ readonly List<Delimiter> delimiters = new List<Delimiter> ();
+
+ SimpleReadonlyDocument (ITextSource readOnlyTextSource, string fileName, string mimeType)
+ {
+ textSource = readOnlyTextSource;
+ FileName = fileName;
+ MimeType = mimeType;
+ Initalize (readOnlyTextSource.Text);
+ }
+
+ /// <summary>
+ /// Creates a new readonly document. Note that the text source is not copied - it needs to be read only.
+ /// </summary>
+ /// <returns>The readonly document async.</returns>
+ /// <param name="readOnlyTextSource">Read only text source.</param>
+ /// <param name="fileName">File name.</param>
+ public static Task<IReadonlyTextDocument> CreateReadonlyDocumentAsync (ITextSource readOnlyTextSource, string fileName = null, string mimeType = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return Task.Run (delegate {
+ return (IReadonlyTextDocument)new SimpleReadonlyDocument (readOnlyTextSource, fileName, mimeType);
+ }, cancellationToken);
+ }
+
+ void Initalize (string text)
+ {
+ int offset = 0;
+ while (true) {
+ var delimiter = NextDelimiter (text, offset);
+ if (delimiter.IsInvalid)
+ break;
+
+ delimiters.Add (delimiter);
+
+ offset = delimiter.EndOffset;
+ }
+ }
+
+ static unsafe Delimiter NextDelimiter (string text, int offset)
+ {
+ fixed (char* start = text) {
+ char* p = start + offset;
+ char* endPtr = start + text.Length;
+
+ while (p < endPtr) {
+ switch (*p) {
+ case NewLine.CR:
+ char* nextp = p + 1;
+ if (nextp < endPtr && *nextp == NewLine.LF)
+ return new Delimiter ((int)(p - start), UnicodeNewline.CRLF);
+ return new Delimiter ((int)(p - start), UnicodeNewline.CR);
+ case NewLine.LF:
+ return new Delimiter ((int)(p - start), UnicodeNewline.LF);
+ case NewLine.NEL:
+ return new Delimiter ((int)(p - start), UnicodeNewline.NEL);
+ case NewLine.VT:
+ return new Delimiter ((int)(p - start), UnicodeNewline.VT);
+ case NewLine.FF:
+ return new Delimiter ((int)(p - start), UnicodeNewline.FF);
+ case NewLine.LS:
+ return new Delimiter ((int)(p - start), UnicodeNewline.LS);
+ case NewLine.PS:
+ return new Delimiter ((int)(p - start), UnicodeNewline.PS);
+ }
+ p++;
+ }
+ return Delimiter.Invalid;
+ }
+ }
+
+ struct Delimiter
+ {
+ public static readonly Delimiter Invalid = new Delimiter (-1, 0);
+
+ public readonly int Offset;
+ public readonly UnicodeNewline UnicodeNewline;
+
+ public int Length {
+ get {
+ return UnicodeNewline == UnicodeNewline.CRLF ? 2 : 1;
+ }
+ }
+
+ public int EndOffset {
+ get { return Offset + Length; }
+ }
+
+ public bool IsInvalid {
+ get {
+ return Offset < 0;
+ }
+ }
+
+ public Delimiter (int offset, UnicodeNewline unicodeNewline)
+ {
+ Offset = offset;
+ UnicodeNewline = unicodeNewline;
+ }
+ }
+
+ int OffsetToLineNumber (int offset)
+ {
+ for (int i = 0; i < delimiters.Count; i++) {
+ var delimiter = delimiters[i];
+ if (offset <= delimiter.Offset)
+ return i + 1;
+ }
+ return delimiters.Count + 1;
+ }
+
+ #region IReadonlyTextDocument implementation
+
+ /// <inheritdoc/>
+ public int LocationToOffset (int line, int column)
+ {
+ if (line > LineCount || line < DocumentLocation.MinLine)
+ return -1;
+ var documentLine = GetLine (line);
+ return Math.Min (Length, documentLine.Offset + Math.Max (0, Math.Min (documentLine.Length, column - 1)));
+ }
+
+ /// <inheritdoc/>
+ public DocumentLocation OffsetToLocation (int offset)
+ {
+ int lineNr = OffsetToLineNumber (offset);
+ if (lineNr < 1)
+ return DocumentLocation.Empty;
+ var line = GetLine (lineNr);
+ var col = Math.Max (1, Math.Min (line.LengthIncludingDelimiter, offset - line.Offset) + 1);
+ return new DocumentLocation (lineNr, col);
+ }
+
+ /// <inheritdoc/>
+ public IDocumentLine GetLine (int number)
+ {
+ number--;
+ if (number < 0)
+ return null;
+ int startOffset = number > 0 ? delimiters[number - 1].EndOffset : 0;
+ int endOffset;
+ UnicodeNewline newLine;
+ if (number < delimiters.Count) {
+ endOffset = delimiters[number].EndOffset;
+ newLine = delimiters[number].UnicodeNewline;
+ } else {
+ endOffset = Length;
+ newLine = UnicodeNewline.Unknown;
+ }
+ return new SimpleLineSegment (this, number + 1, startOffset, endOffset - startOffset, newLine);
+ }
+
+ sealed class SimpleLineSegment : IDocumentLine
+ {
+ readonly SimpleReadonlyDocument splitter;
+
+ public SimpleLineSegment (SimpleReadonlyDocument splitter, int lineNumber, int offset, int length, UnicodeNewline newLine)
+ {
+ this.splitter = splitter;
+ LineNumber = lineNumber;
+ LengthIncludingDelimiter = length;
+ UnicodeNewline = newLine;
+ Offset = offset;
+ }
+
+ #region IDocumentLine implementation
+
+ public int LengthIncludingDelimiter {
+ get;
+ private set;
+ }
+
+ public int EndOffsetIncludingDelimiter {
+ get {
+ return Offset + LengthIncludingDelimiter;
+ }
+ }
+
+ public ISegment SegmentIncludingDelimiter {
+ get {
+ return new TextSegment (Offset, LengthIncludingDelimiter);
+ }
+ }
+
+ public UnicodeNewline UnicodeNewline {
+ get;
+ private set;
+ }
+
+ public int DelimiterLength {
+ get {
+ switch (UnicodeNewline) {
+ case UnicodeNewline.Unknown:
+ return 0;
+ case UnicodeNewline.CRLF:
+ return 2;
+ default:
+ return 1;
+ }
+ }
+ }
+
+ public int LineNumber {
+ get;
+ private set;
+ }
+
+ public IDocumentLine PreviousLine {
+ get {
+ if (LineNumber == 1)
+ return null;
+ return splitter.GetLine (LineNumber - 1);
+ }
+ }
+
+ public IDocumentLine NextLine {
+ get {
+ if (LineNumber >= splitter.LineCount)
+ return null;
+ return splitter.GetLine (LineNumber + 1);
+ }
+ }
+
+ public bool IsDeleted {
+ get {
+ return false;
+ }
+ }
+ #endregion
+
+ #region ISegment implementation
+
+ public int Offset {
+ get;
+ private set;
+ }
+
+ public int Length {
+ get {
+ return LengthIncludingDelimiter - DelimiterLength;
+ }
+ }
+
+ public int EndOffset {
+ get {
+ return Offset + Length;
+ }
+ }
+ #endregion
+ }
+
+ /// <inheritdoc/>
+ public IDocumentLine GetLineByOffset (int offset)
+ {
+ return GetLine (OffsetToLineNumber (offset));
+ }
+
+ /// <inheritdoc/>
+ public bool IsReadOnly {
+ get {
+ return true;
+ }
+ }
+
+ /// <inheritdoc/>
+ public FilePath FileName {
+ get;
+ private set;
+ }
+
+ /// <inheritdoc/>
+ public string MimeType {
+ get;
+ private set;
+ }
+
+ /// <inheritdoc/>
+ public int LineCount {
+ get {
+ return delimiters.Count + 1;
+ }
+ }
+ #endregion
+
+ #region ITextSource implementation
+
+ /// <inheritdoc/>
+ public char GetCharAt (int offset)
+ {
+ return textSource.GetCharAt (offset);
+ }
+
+ public char this [int offset] {
+ get {
+ return textSource.GetCharAt (offset);
+ }
+ }
+
+ /// <inheritdoc/>
+ public string GetTextAt (int offset, int length)
+ {
+ return textSource.GetTextAt (offset, length);
+ }
+
+ /// <inheritdoc/>
+ public System.IO.TextReader CreateReader ()
+ {
+ return textSource.CreateReader ();
+ }
+
+ /// <inheritdoc/>
+ public System.IO.TextReader CreateReader (int offset, int length)
+ {
+ return textSource.CreateReader (offset, length);
+ }
+
+ /// <inheritdoc/>
+ public void WriteTextTo (System.IO.TextWriter writer)
+ {
+ textSource.WriteTextTo (writer);
+ }
+
+ /// <inheritdoc/>
+ public void WriteTextTo (System.IO.TextWriter writer, int offset, int length)
+ {
+ textSource.WriteTextTo (writer, offset, length);
+ }
+
+ /// <inheritdoc/>
+ public ITextSourceVersion Version {
+ get {
+ return textSource.Version;
+ }
+ }
+
+ /// <inheritdoc/>
+ public bool UseBOM {
+ get {
+ return textSource.UseBOM;
+ }
+ }
+
+ /// <inheritdoc/>
+ public System.Text.Encoding Encoding {
+ get {
+ return textSource.Encoding;
+ }
+ }
+
+ /// <inheritdoc/>
+ public int Length {
+ get {
+ return textSource.Length;
+ }
+ }
+
+ /// <inheritdoc/>
+ public string Text {
+ get {
+ return textSource.Text;
+ }
+ }
+
+ public ITextSource CreateSnapshot ()
+ {
+ return this;
+ }
+
+ public ITextSource CreateSnapshot (int offset, int length)
+ {
+ return new StringTextSource (Text.Substring (offset, length));
+ }
+
+ /// <inheritdoc/>
+ public void CopyTo (int sourceIndex, char [] destination, int destinationIndex, int count)
+ {
+ textSource.CopyTo (sourceIndex, destination, destinationIndex, count);
+ }
+
+ #endregion
+
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/AutoSave.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/AutoSave.cs
new file mode 100644
index 0000000000..ebdda80162
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/AutoSave.cs
@@ -0,0 +1,172 @@
+//
+// AutoSave.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading;
+using MonoDevelop.Core;
+using Gtk;
+using MonoDevelop.Core.Text;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Ide.Editor
+{
+ /// <summary>
+ /// This class handles the auto save mechanism for open files.
+ /// It should only be used by editor implementations.
+ /// </summary>
+ static class AutoSave
+ {
+ //FIXME: is this path a good one? wouldn't it be better to put autosaves beside the files anyway?
+ static string autoSavePath = UserProfile.Current.CacheDir.Combine ("AutoSave");
+ static bool autoSaveEnabled;
+
+ static AutoSave ()
+ {
+ try {
+ if (!Directory.Exists (autoSavePath))
+ Directory.CreateDirectory (autoSavePath);
+ } catch (Exception e) {
+ LoggingService.LogError ("Can't create auto save path:" + autoSavePath +". Auto save is disabled.", e);
+ autoSaveEnabled = false;
+ return;
+ }
+ autoSaveEnabled = true;
+ }
+
+ static string GetAutoSaveFileName (string fileName)
+ {
+ if (fileName == null)
+ return null;
+ return Path.Combine (autoSavePath, MonoDevelop.Ide.TypeSystem.PersistenceServiceFactory.GetMD5 (fileName) + ".sav");
+ }
+
+ /// <summary>
+ /// Returns true if an auto save exists for the given file name.
+ /// </summary>
+ public static bool AutoSaveExists (string fileName)
+ {
+ if (!autoSaveEnabled)
+ return false;
+ try {
+ var autoSaveFilename = GetAutoSaveFileName (fileName);
+ bool autoSaveExists = File.Exists (autoSaveFilename);
+ if (autoSaveExists) {
+ if (File.GetLastWriteTimeUtc (autoSaveFilename) < File.GetLastWriteTimeUtc (fileName)) {
+ File.Delete (autoSaveFilename);
+ return false;
+ }
+ }
+ return autoSaveExists;
+ } catch (Exception e) {
+ LoggingService.LogError ("Error in auto save - disableing.", e);
+ DisableAutoSave ();
+ return false;
+ }
+ }
+
+ static void CreateAutoSave (string fileName, ITextSource content)
+ {
+ if (!autoSaveEnabled)
+ return;
+ try {
+ // Directory may have removed/unmounted. Therefore this operation is not guaranteed to work.
+ var autosaveFileName = GetAutoSaveFileName (fileName);
+ if (File.Exists (autosaveFileName))
+ File.Delete (autosaveFileName);
+ content.WriteTextTo (autosaveFileName);
+ Counters.AutoSavedFiles++;
+ } catch (Exception e) {
+ LoggingService.LogError ("Error in auto save while creating: " + fileName +". Disableing auto save.", e);
+ DisableAutoSave ();
+ }
+ }
+
+ #region AutoSave
+
+ /// <summary>
+ /// Loads the content from an auto save file and removes the auto save file.
+ /// </summary>
+ public static ITextSource LoadAndRemoveAutoSave (string fileName)
+ {
+ string autoSaveFileName = GetAutoSaveFileName (fileName);
+ var result = StringTextSource.ReadFrom (autoSaveFileName);
+ AutoSave.RemoveAutoSaveFile (fileName);
+ return result;
+ }
+
+ /// <summary>
+ /// Loads the content from an auto save file.
+ /// </summary>
+ public static ITextSource LoadAutoSave (string fileName)
+ {
+ string autoSaveFileName = GetAutoSaveFileName (fileName);
+ return StringTextSource.ReadFrom (autoSaveFileName);
+ }
+
+ /// <summary>
+ /// Removes the auto save file.
+ /// </summary>
+ /// <param name="fileName">The file name for which the auto save file should be removed.</param>
+ public static void RemoveAutoSaveFile (string fileName)
+ {
+ if (!autoSaveEnabled)
+ return;
+ if (AutoSaveExists (fileName)) {
+ string autoSaveFileName = GetAutoSaveFileName (fileName);
+ try {
+ File.Delete (autoSaveFileName);
+ } catch (Exception e) {
+ LoggingService.LogError ("Can't delete auto save file: " + autoSaveFileName +". Disableing auto save.", e);
+ DisableAutoSave ();
+ }
+ }
+ }
+ static Task finishedTask = Task.FromResult (true);
+ internal static Task InformAutoSaveThread (ITextSource content, string fileName, bool isDirty)
+ {
+ if (content == null)
+ throw new ArgumentNullException (nameof (content));
+ if (!autoSaveEnabled || string.IsNullOrEmpty (fileName))
+ return finishedTask;
+ if (isDirty) {
+ return Task.Run (() => {
+ CreateAutoSave (fileName, content);
+ });
+ } else {
+ RemoveAutoSaveFile (fileName);
+ return finishedTask;
+ }
+ }
+
+ static void DisableAutoSave ()
+ {
+ autoSaveEnabled = false;
+ }
+#endregion
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Commands/DynamicAbbrevHandler.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Commands/DynamicAbbrevHandler.cs
new file mode 100644
index 0000000000..08306da514
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Commands/DynamicAbbrevHandler.cs
@@ -0,0 +1,193 @@
+//
+// DynamicAbbrevHandler.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Linq;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Ide.Gui;
+using System.Collections.Generic;
+using MonoDevelop.Ide;
+
+namespace MonoDevelop.Ide.Editor
+{
+ class DynamicAbbrevHandler : CommandHandler
+ {
+ enum AbbrevState {
+ SearchBackward,
+ SearchForward,
+ SearchOtherBuffers,
+ CycleThroughFoundWords
+ }
+
+ static TextEditor lastView = null;
+ static string lastAbbrev = null;
+ static int lastTriggerOffset = 0;
+ static int lastInsertPos = 0;
+ static List<string> foundWords = new List<string> ();
+ static int lastStartOffset = 0;
+ static AbbrevState curState;
+
+ protected override void Run (object data)
+ {
+ var doc = IdeApp.Workbench.ActiveDocument;
+ if (doc == null)
+ return;
+ var editor = doc.Editor;
+ if (editor == null)
+ return;
+
+ string abbrevWord;
+ int offset;
+ int startOffset;
+
+ if (lastView == editor && editor.CaretOffset == lastTriggerOffset) {
+ abbrevWord = lastAbbrev;
+ offset = lastStartOffset;
+ } else {
+ abbrevWord = GetWordBeforeCaret (editor);
+ lastAbbrev = abbrevWord;
+ offset = editor.CaretOffset - abbrevWord.Length - 1;
+ lastInsertPos = lastTriggerOffset = offset + 1;
+ foundWords.Clear ();
+ foundWords.Add (abbrevWord);
+ curState = AbbrevState.SearchBackward;
+ }
+
+ lastView = editor;
+ switch (curState) {
+ case AbbrevState.SearchBackward:
+ while (offset > 0) {
+ if (IsMatchAt (editor, offset, abbrevWord)) {
+ int endOffset = SearchEndPos (offset, editor);
+ string curWord = editor.GetTextBetween (offset, endOffset);
+ if (foundWords.Contains (curWord)) {
+ offset--;
+ continue;
+ }
+ foundWords.Add (curWord);
+ ReplaceWord (editor, curWord);
+ lastStartOffset = offset - 1;
+ return;
+ }
+ offset--;
+ }
+ offset = editor.CaretOffset;
+ curState = AbbrevState.SearchForward;
+ goto case AbbrevState.SearchForward;
+ case AbbrevState.SearchForward:
+ while (offset < editor.Length) {
+ if (IsMatchAt (editor, offset, abbrevWord)) {
+ int endOffset = SearchEndPos (offset, editor);
+ string curWord = editor.GetTextBetween (offset, endOffset);
+ if (foundWords.Contains (curWord)) {
+ offset++;
+ continue;
+ }
+ foundWords.Add (curWord);
+ ReplaceWord (editor, curWord);
+ lastStartOffset = offset + 1;
+ return;
+ }
+ offset++;
+ }
+ curState = AbbrevState.SearchOtherBuffers;
+ goto case AbbrevState.SearchOtherBuffers;
+ case AbbrevState.SearchOtherBuffers:
+ foreach (Document curDoc in IdeApp.Workbench.Documents) {
+ var otherView = curDoc.GetContent<TextEditor> ();
+ if (curDoc == doc || otherView == null)
+ continue;
+ for (int i = 0; i < otherView.Length; i++) {
+ if (IsMatchAt (otherView, i, abbrevWord)) {
+ int endOffset = SearchEndPos (i, otherView);
+ string curWord = otherView.GetTextBetween (i, endOffset);
+ if (foundWords.Contains (curWord))
+ continue;
+ foundWords.Add (curWord);
+ }
+ }
+ }
+ curState = AbbrevState.CycleThroughFoundWords;
+ goto case AbbrevState.CycleThroughFoundWords;
+ case AbbrevState.CycleThroughFoundWords:
+ int index = foundWords.IndexOf (editor.GetTextAt (lastInsertPos, editor.CaretOffset - lastInsertPos));
+ if (index < 0)
+ break;
+ startOffset = offset;
+ offset = startOffset + foundWords[index].Length;
+ index = (index + foundWords.Count + 1) % foundWords.Count;
+ ReplaceWord (editor, foundWords[index]);
+ break;
+ }
+ }
+
+ public static bool IsIdentifierPart (char ch)
+ {
+ return char.IsLetterOrDigit (ch) || ch == '_';
+ }
+
+ static string GetWordBeforeCaret (TextEditor editor)
+ {
+ int startOffset = editor.CaretOffset;
+ int offset = startOffset - 1;
+ while (offset > 0) {
+ char ch = editor.GetCharAt (offset);
+ if (!IsIdentifierPart (ch)) {
+ offset++;
+ break;
+ }
+ offset--;
+ }
+ if (offset >= startOffset)
+ return "";
+ return editor.GetTextBetween (offset, startOffset);
+ }
+
+ static void ReplaceWord (TextEditor editor, string curWord)
+ {
+ editor.ReplaceText (lastInsertPos, editor.CaretOffset - lastInsertPos, curWord);
+ lastTriggerOffset = editor.CaretOffset;
+ }
+
+ static int SearchEndPos (int offset, TextEditor editor)
+ {
+ while (offset < editor.Length && IsIdentifierPart (editor.GetCharAt (offset))) {
+ offset++;
+ }
+ return offset;
+ }
+
+ static bool IsMatchAt (TextEditor editor, int offset, string abbrevWord)
+ {
+ if (offset + abbrevWord.Length >= editor.Length)
+ return false;
+ if (offset > 0 && IsIdentifierPart (editor.GetCharAt (offset - 1)))
+ return false;
+ if (offset + abbrevWord.Length < editor.Length && !IsIdentifierPart (editor.GetCharAt (offset + abbrevWord.Length)))
+ return false;
+ return editor.GetTextAt (offset, abbrevWord.Length) == abbrevWord;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/CustomEditorOptions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/CustomEditorOptions.cs
new file mode 100644
index 0000000000..f2ea47570f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/CustomEditorOptions.cs
@@ -0,0 +1,192 @@
+//
+// ChangeableEditorOptions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public sealed class CustomEditorOptions : ITextEditorOptions
+ {
+ #region ITextEditorOptions implementation
+ public WordFindStrategy WordFindStrategy {
+ get;
+ set;
+ }
+
+ public bool TabsToSpaces {
+ get;
+ set;
+ }
+
+ public int IndentationSize {
+ get;
+ set;
+ }
+
+ public int TabSize {
+ get;
+ set;
+ }
+
+ public bool ShowIconMargin {
+ get;
+ set;
+ }
+
+ public bool ShowLineNumberMargin {
+ get;
+ set;
+ }
+
+ public bool ShowFoldMargin {
+ get;
+ set;
+ }
+
+ public bool HighlightCaretLine {
+ get;
+ set;
+ }
+
+ public int RulerColumn {
+ get;
+ set;
+ }
+
+ public bool ShowRuler {
+ get;
+ set;
+ }
+
+ public IndentStyle IndentStyle {
+ get;
+ set;
+ }
+
+ public bool OverrideDocumentEolMarker {
+ get;
+ set;
+ }
+
+ public bool EnableSyntaxHighlighting {
+ get;
+ set;
+ }
+
+ public bool RemoveTrailingWhitespaces {
+ get;
+ set;
+ }
+
+ public bool WrapLines {
+ get;
+ set;
+ }
+
+ public string FontName {
+ get;
+ set;
+ }
+
+ public string GutterFontName {
+ get;
+ set;
+ }
+
+ public string ColorScheme {
+ get;
+ set;
+ }
+
+ public string DefaultEolMarker {
+ get;
+ set;
+ }
+
+ public bool GenerateFormattingUndoStep {
+ get;
+ set;
+ }
+
+ public bool EnableSelectionWrappingKeys {
+ get;
+ set;
+ }
+
+ public ShowWhitespaces ShowWhitespaces {
+ get;
+ set;
+ }
+
+ public IncludeWhitespaces IncludeWhitespaces {
+ get;
+ set;
+ }
+ #endregion
+
+ public CustomEditorOptions ()
+ {
+ this.ColorScheme = MonoDevelop.Ide.Editor.Highlighting.ColorScheme.DefaultColorStyle;
+ this.TabSize = this.IndentationSize = 4;
+ this.DefaultEolMarker = "\n";
+ }
+
+ public CustomEditorOptions (ITextEditorOptions initializeFrom)
+ {
+ if (initializeFrom == null)
+ throw new ArgumentNullException (nameof (initializeFrom));
+ WordFindStrategy = initializeFrom.WordFindStrategy;
+ TabsToSpaces = initializeFrom.TabsToSpaces;
+ IndentationSize = initializeFrom.IndentationSize;
+ TabSize = initializeFrom.TabSize;
+ ShowIconMargin = initializeFrom.ShowIconMargin;
+ ShowLineNumberMargin = initializeFrom.ShowLineNumberMargin;
+ ShowFoldMargin = initializeFrom.ShowFoldMargin;
+ HighlightCaretLine = initializeFrom.HighlightCaretLine;
+ RulerColumn = initializeFrom.RulerColumn;
+ ShowRuler = initializeFrom.ShowRuler;
+ IndentStyle = initializeFrom.IndentStyle;
+ OverrideDocumentEolMarker = initializeFrom.OverrideDocumentEolMarker;
+ EnableSyntaxHighlighting = initializeFrom.EnableSyntaxHighlighting;
+ RemoveTrailingWhitespaces = initializeFrom.RemoveTrailingWhitespaces;
+ WrapLines = initializeFrom.WrapLines;
+ FontName = initializeFrom.FontName;
+ GutterFontName = initializeFrom.GutterFontName;
+ ColorScheme = initializeFrom.ColorScheme;
+ DefaultEolMarker = initializeFrom.DefaultEolMarker;
+ GenerateFormattingUndoStep = initializeFrom.GenerateFormattingUndoStep;
+ EnableSelectionWrappingKeys = initializeFrom.EnableSelectionWrappingKeys;
+ ShowWhitespaces = initializeFrom.ShowWhitespaces;
+ IncludeWhitespaces = initializeFrom.IncludeWhitespaces;
+ }
+
+ #region IDisposable implementation
+ public void Dispose ()
+ {
+ }
+ #endregion
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DefaultSourceEditorOptions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DefaultSourceEditorOptions.cs
new file mode 100644
index 0000000000..fa316c9f49
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DefaultSourceEditorOptions.cs
@@ -0,0 +1,777 @@
+//
+// DefaultSourceEditorOptions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Ide.Fonts;
+using MonoDevelop.Ide.Editor.Extension;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public enum WordNavigationStyle
+ {
+ Unix,
+ Windows
+ }
+
+ public enum LineEndingConversion {
+ Ask,
+ LeaveAsIs,
+ ConvertAlways
+ }
+
+ /// <summary>
+ /// This class contains all text editor options from ITextEditorOptions and additional options
+ /// the text editor frontend may use.
+ /// </summary>
+ public sealed class DefaultSourceEditorOptions : ITextEditorOptions
+ {
+ static DefaultSourceEditorOptions instance;
+ //static TextStylePolicy defaultPolicy;
+ static bool inited;
+
+ public static DefaultSourceEditorOptions Instance {
+ get { return instance; }
+ }
+
+ public static ITextEditorOptions PlainEditor {
+ get;
+ private set;
+ }
+
+ static DefaultSourceEditorOptions ()
+ {
+ Init ();
+ }
+
+ public static void Init ()
+ {
+ if (inited)
+ return;
+ inited = true;
+
+ var policy = MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<TextStylePolicy> ("text/plain");
+ instance = new DefaultSourceEditorOptions (policy);
+ MonoDevelop.Projects.Policies.PolicyService.DefaultPolicies.PolicyChanged += instance.HandlePolicyChanged;
+
+ PlainEditor = new PlainEditorOptions ();
+ }
+
+ internal void FireChange ()
+ {
+ OnChanged (EventArgs.Empty);
+ }
+
+ class PlainEditorOptions : ITextEditorOptions
+ {
+ #region IDisposable implementation
+
+ void IDisposable.Dispose ()
+ {
+ // nothing
+ }
+
+ #endregion
+
+ #region ITextEditorOptions implementation
+
+ WordFindStrategy ITextEditorOptions.WordFindStrategy {
+ get {
+ return DefaultSourceEditorOptions.Instance.WordFindStrategy;
+ }
+ }
+
+ bool ITextEditorOptions.TabsToSpaces {
+ get {
+ return DefaultSourceEditorOptions.Instance.TabsToSpaces;
+ }
+ }
+
+ int ITextEditorOptions.IndentationSize {
+ get {
+ return DefaultSourceEditorOptions.Instance.IndentationSize;
+ }
+ }
+
+ int ITextEditorOptions.TabSize {
+ get {
+ return DefaultSourceEditorOptions.Instance.TabSize;
+ }
+ }
+
+ bool ITextEditorOptions.ShowIconMargin {
+ get {
+ return false;
+ }
+ }
+
+ bool ITextEditorOptions.ShowLineNumberMargin {
+ get {
+ return false;
+ }
+ }
+
+ bool ITextEditorOptions.ShowFoldMargin {
+ get {
+ return false;
+ }
+ }
+
+ bool ITextEditorOptions.HighlightCaretLine {
+ get {
+ return DefaultSourceEditorOptions.Instance.HighlightCaretLine;
+ }
+ }
+
+ int ITextEditorOptions.RulerColumn {
+ get {
+ return DefaultSourceEditorOptions.Instance.RulerColumn;
+ }
+ }
+
+ bool ITextEditorOptions.ShowRuler {
+ get {
+ return false;
+ }
+ }
+
+ IndentStyle ITextEditorOptions.IndentStyle {
+ get {
+ return DefaultSourceEditorOptions.Instance.IndentStyle;
+ }
+ }
+
+ bool ITextEditorOptions.OverrideDocumentEolMarker {
+ get {
+ return false;
+ }
+ }
+
+ bool ITextEditorOptions.EnableSyntaxHighlighting {
+ get {
+ return DefaultSourceEditorOptions.Instance.EnableSyntaxHighlighting;
+ }
+ }
+
+ bool ITextEditorOptions.RemoveTrailingWhitespaces {
+ get {
+ return DefaultSourceEditorOptions.Instance.RemoveTrailingWhitespaces;
+ }
+ }
+
+ bool ITextEditorOptions.WrapLines {
+ get {
+ return DefaultSourceEditorOptions.Instance.WrapLines;
+ }
+ }
+
+ string ITextEditorOptions.FontName {
+ get {
+ return DefaultSourceEditorOptions.Instance.FontName;
+ }
+ }
+
+ string ITextEditorOptions.GutterFontName {
+ get {
+ return DefaultSourceEditorOptions.Instance.GutterFontName;
+ }
+ }
+
+ string ITextEditorOptions.ColorScheme {
+ get {
+ return DefaultSourceEditorOptions.Instance.ColorScheme;
+ }
+ }
+
+ string ITextEditorOptions.DefaultEolMarker {
+ get {
+ return DefaultSourceEditorOptions.Instance.DefaultEolMarker;
+ }
+ }
+
+ bool ITextEditorOptions.GenerateFormattingUndoStep {
+ get {
+ return DefaultSourceEditorOptions.Instance.GenerateFormattingUndoStep;
+ }
+ }
+
+ bool ITextEditorOptions.EnableSelectionWrappingKeys {
+ get {
+ return DefaultSourceEditorOptions.Instance.EnableSelectionWrappingKeys;
+ }
+ }
+
+ ShowWhitespaces ITextEditorOptions.ShowWhitespaces {
+ get {
+ return ShowWhitespaces.Never;
+ }
+ }
+
+ IncludeWhitespaces ITextEditorOptions.IncludeWhitespaces {
+ get {
+ return DefaultSourceEditorOptions.Instance.IncludeWhitespaces;
+ }
+ }
+
+ #endregion
+
+
+ }
+
+ void HandlePolicyChanged (object sender, MonoDevelop.Projects.Policies.PolicyChangedEventArgs args)
+ {
+ TextStylePolicy pol = MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<TextStylePolicy> ("text/plain");
+ UpdateStylePolicy (pol);
+ }
+
+ DefaultSourceEditorOptions (TextStylePolicy currentPolicy)
+ {
+ WordNavigationStyle defaultWordNavigation = WordNavigationStyle.Unix;
+ if (Platform.IsWindows) {
+ defaultWordNavigation = WordNavigationStyle.Windows;
+ }
+ wordNavigationStyle = ConfigurationProperty.Create ("WordNavigationStyle", defaultWordNavigation);
+
+ UpdateStylePolicy (currentPolicy);
+ FontService.RegisterFontChangedCallback ("Editor", UpdateFont);
+ FontService.RegisterFontChangedCallback ("MessageBubbles", UpdateFont);
+
+ IdeApp.Preferences.ColorScheme.Changed += OnColorSchemeChanged;
+ }
+
+ void UpdateFont ()
+ {
+ this.OnChanged (EventArgs.Empty);
+ }
+
+ void UpdateStylePolicy (MonoDevelop.Ide.Gui.Content.TextStylePolicy currentPolicy)
+ {
+ defaultEolMarker = TextStylePolicy.GetEolMarker (currentPolicy.EolMarker);
+ tabsToSpaces = currentPolicy.TabsToSpaces; // PropertyService.Get ("TabsToSpaces", false);
+ indentationSize = currentPolicy.TabWidth; //PropertyService.Get ("TabIndent", 4);
+ rulerColumn = currentPolicy.FileWidth; //PropertyService.Get ("RulerColumn", 80);
+ allowTabsAfterNonTabs = !currentPolicy.NoTabsAfterNonTabs; //PropertyService.Get ("AllowTabsAfterNonTabs", true);
+ removeTrailingWhitespaces = currentPolicy.RemoveTrailingWhitespace; //PropertyService.Get ("RemoveTrailingWhitespaces", true);
+ }
+
+ public ITextEditorOptions WithTextStyle (MonoDevelop.Ide.Gui.Content.TextStylePolicy policy)
+ {
+ if (policy == null)
+ throw new ArgumentNullException ("policy");
+ var result = (DefaultSourceEditorOptions)MemberwiseClone ();
+ result.UpdateStylePolicy (policy);
+ result.Changed = null;
+ return result;
+ }
+
+ #region new options
+
+ public bool EnableAutoCodeCompletion {
+ get { return IdeApp.Preferences.EnableAutoCodeCompletion; }
+ set { IdeApp.Preferences.EnableAutoCodeCompletion.Set (value); }
+ }
+
+ ConfigurationProperty<bool> defaultRegionsFolding = ConfigurationProperty.Create ("DefaultRegionsFolding", false);
+ public bool DefaultRegionsFolding {
+ get {
+ return defaultRegionsFolding;
+ }
+ set {
+ if (defaultRegionsFolding.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ ConfigurationProperty<bool> defaultCommentFolding = ConfigurationProperty.Create ("DefaultCommentFolding", true);
+ public bool DefaultCommentFolding {
+ get {
+ return defaultCommentFolding;
+ }
+ set {
+ if (defaultCommentFolding.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ ConfigurationProperty<bool> enableSemanticHighlighting = ConfigurationProperty.Create ("EnableSemanticHighlighting", true);
+ public bool EnableSemanticHighlighting {
+ get {
+ return enableSemanticHighlighting;
+ }
+ set {
+ if (enableSemanticHighlighting.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ ConfigurationProperty<bool> tabIsReindent = ConfigurationProperty.Create ("TabIsReindent", false);
+ public bool TabIsReindent {
+ get {
+ return tabIsReindent;
+ }
+ set {
+ if (tabIsReindent.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ ConfigurationProperty<bool> autoInsertMatchingBracket = ConfigurationProperty.Create ("AutoInsertMatchingBracket", false);
+ public bool AutoInsertMatchingBracket {
+ get {
+ return autoInsertMatchingBracket;
+ }
+ set {
+ if (autoInsertMatchingBracket.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ ConfigurationProperty<bool> smartSemicolonPlacement = ConfigurationProperty.Create ("SmartSemicolonPlacement", false);
+ public bool SmartSemicolonPlacement {
+ get {
+ return smartSemicolonPlacement;
+ }
+ set {
+ if (smartSemicolonPlacement.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ ConfigurationProperty<bool> underlineErrors = ConfigurationProperty.Create ("UnderlineErrors", true);
+ public bool UnderlineErrors {
+ get {
+ return underlineErrors;
+ }
+ set {
+ if (underlineErrors.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ ConfigurationProperty<IndentStyle> indentStyle = ConfigurationProperty.Create ("IndentStyle", IndentStyle.Smart);
+ public IndentStyle IndentStyle {
+ get {
+ return indentStyle;
+ }
+ set {
+ if (indentStyle.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ ConfigurationProperty<bool> enableHighlightUsages = ConfigurationProperty.Create ("EnableHighlightUsages", true);
+ public bool EnableHighlightUsages {
+ get {
+ return enableHighlightUsages;
+ }
+ set {
+ if (enableHighlightUsages.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ ConfigurationProperty<LineEndingConversion> lineEndingConversion = ConfigurationProperty.Create("LineEndingConversion", LineEndingConversion.LeaveAsIs);
+ public LineEndingConversion LineEndingConversion {
+ get {
+ return lineEndingConversion;
+ }
+ set {
+ if (lineEndingConversion.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ #endregion
+
+ ConfigurationProperty<bool> onTheFlyFormatting = ConfigurationProperty.Create ("OnTheFlyFormatting", true);
+ public bool OnTheFlyFormatting {
+ get {
+ return onTheFlyFormatting;
+ }
+ set {
+ if (onTheFlyFormatting.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ #region ITextEditorOptions
+ string defaultEolMarker = Environment.NewLine;
+ public string DefaultEolMarker {
+ get {
+ return defaultEolMarker;
+ }
+ set {
+ if (defaultEolMarker != value) {
+ defaultEolMarker = value;
+ OnChanged (EventArgs.Empty);
+ }
+ }
+ }
+
+ ConfigurationProperty<WordNavigationStyle> wordNavigationStyle;
+ public WordNavigationStyle WordNavigationStyle {
+ get {
+ return wordNavigationStyle;
+ }
+ set {
+ if (wordNavigationStyle.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ public WordFindStrategy WordFindStrategy {
+ get {
+ switch (WordNavigationStyle) {
+ case WordNavigationStyle.Windows:
+ return WordFindStrategy.SharpDevelop;
+ default:
+ return WordFindStrategy.Emacs;
+ }
+ }
+ set {
+ throw new System.NotImplementedException ();
+ }
+ }
+
+ bool allowTabsAfterNonTabs = true;
+ public bool AllowTabsAfterNonTabs {
+ get {
+ return allowTabsAfterNonTabs;
+ }
+ set {
+ if (allowTabsAfterNonTabs != value) {
+ PropertyService.Set ("AllowTabsAfterNonTabs", value);
+ allowTabsAfterNonTabs = value;
+ OnChanged (EventArgs.Empty);
+ }
+ }
+ }
+
+ bool tabsToSpaces = false;
+ public bool TabsToSpaces {
+ get {
+ return tabsToSpaces;
+ }
+ set {
+ if (tabsToSpaces != value) {
+ PropertyService.Set ("TabsToSpaces", value);
+ tabsToSpaces = value;
+ OnChanged (EventArgs.Empty);
+ }
+ }
+ }
+
+ int indentationSize = 4;
+ public int IndentationSize {
+ get {
+ return indentationSize;
+ }
+ set {
+ if (indentationSize != value) {
+ PropertyService.Set ("TabIndent", value);
+ indentationSize = value;
+ OnChanged (EventArgs.Empty);
+ }
+ }
+ }
+
+
+ public string IndentationString {
+ get {
+ return TabsToSpaces ? new string (' ', this.TabSize) : "\t";
+ }
+ }
+
+ public int TabSize {
+ get {
+ return IndentationSize;
+ }
+ set {
+ IndentationSize = value;
+ }
+ }
+
+
+ bool removeTrailingWhitespaces = true;
+ public bool RemoveTrailingWhitespaces {
+ get {
+ return removeTrailingWhitespaces;
+ }
+ set {
+ if (removeTrailingWhitespaces != value) {
+ PropertyService.Set ("RemoveTrailingWhitespaces", value);
+ OnChanged (EventArgs.Empty);
+ removeTrailingWhitespaces = value;
+ }
+ }
+ }
+
+ ConfigurationProperty<bool> showLineNumberMargin = ConfigurationProperty.Create ("ShowLineNumberMargin", true);
+ public bool ShowLineNumberMargin {
+ get {
+ return showLineNumberMargin;
+ }
+ set {
+ if (showLineNumberMargin.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ ConfigurationProperty<bool> showFoldMargin = ConfigurationProperty.Create ("ShowFoldMargin", false);
+ public bool ShowFoldMargin {
+ get {
+ return showFoldMargin;
+ }
+ set {
+ if (showFoldMargin.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ bool showIconMargin = true;
+ public bool ShowIconMargin {
+ get {
+ return showIconMargin;
+ }
+ set {
+ if (showIconMargin != value) {
+ PropertyService.Set ("ShowIconMargin", value);
+ showIconMargin = value;
+ OnChanged (EventArgs.Empty);
+ }
+ }
+ }
+
+ ConfigurationProperty<bool> highlightCaretLine = ConfigurationProperty.Create ("HighlightCaretLine", false);
+ public bool HighlightCaretLine {
+ get {
+ return highlightCaretLine;
+ }
+ set {
+ if (highlightCaretLine.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ ConfigurationProperty<bool> enableSyntaxHighlighting = ConfigurationProperty.Create ("EnableSyntaxHighlighting", true);
+ public bool EnableSyntaxHighlighting {
+ get {
+ return enableSyntaxHighlighting;
+ }
+ set {
+ if (enableSyntaxHighlighting.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ internal ConfigurationProperty<bool> highlightMatchingBracket = ConfigurationProperty.Create ("HighlightMatchingBracket", true);
+ public bool HighlightMatchingBracket {
+ get {
+ return highlightMatchingBracket;
+ }
+ set {
+ if (highlightMatchingBracket.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ int rulerColumn = 80;
+
+ public int RulerColumn {
+ get {
+ return rulerColumn;
+ }
+ set {
+ if (rulerColumn != value) {
+ PropertyService.Set ("RulerColumn", value);
+ rulerColumn = value;
+ OnChanged (EventArgs.Empty);
+ }
+ }
+ }
+
+ ConfigurationProperty<bool> showRuler = ConfigurationProperty.Create ("ShowRuler", true);
+ public bool ShowRuler {
+ get {
+ return showRuler;
+ }
+ set {
+ if (showRuler.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ ConfigurationProperty<bool> enableAnimations = ConfigurationProperty.Create ("EnableAnimations", true);
+ public bool EnableAnimations {
+ get {
+ return enableAnimations;
+ }
+ set {
+ if (enableAnimations.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ ConfigurationProperty<bool> drawIndentationMarkers = ConfigurationProperty.Create ("DrawIndentationMarkers", false);
+ public bool DrawIndentationMarkers {
+ get {
+ return drawIndentationMarkers;
+ }
+ set {
+ if (drawIndentationMarkers.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ ConfigurationProperty<bool> wrapLines = ConfigurationProperty.Create ("WrapLines", false);
+ public bool WrapLines {
+ get {
+ return wrapLines;
+ }
+ set {
+ if (wrapLines.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ ConfigurationProperty<bool> enableQuickDiff = ConfigurationProperty.Create ("EnableQuickDiff", false);
+ public bool EnableQuickDiff {
+ get {
+ return enableQuickDiff;
+ }
+ set {
+ if (enableQuickDiff.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ public string FontName {
+ get {
+ return FontService.FilterFontName (FontService.GetUnderlyingFontName ("Editor"));
+ }
+ set {
+ throw new InvalidOperationException ("Set font through font service");
+ }
+ }
+
+ public string GutterFontName {
+ get {
+ return FontService.FilterFontName (FontService.GetUnderlyingFontName ("Editor"));
+ }
+ set {
+ throw new InvalidOperationException ("Set font through font service");
+ }
+ }
+
+ ConfigurationProperty<string> colorScheme = IdeApp.Preferences.ColorScheme;
+ public string ColorScheme {
+ get {
+ return colorScheme;
+ }
+ set {
+ colorScheme.Set (value);
+ }
+ }
+
+ void OnColorSchemeChanged (object sender, EventArgs e)
+ {
+ OnChanged (EventArgs.Empty);
+ }
+
+ ConfigurationProperty<bool> generateFormattingUndoStep = ConfigurationProperty.Create ("GenerateFormattingUndoStep", false);
+ public bool GenerateFormattingUndoStep {
+ get {
+ return generateFormattingUndoStep;
+ }
+ set {
+ if (generateFormattingUndoStep.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ ConfigurationProperty<bool> enableSelectionWrappingKeys = ConfigurationProperty.Create ("EnableSelectionWrappingKeys", false);
+ public bool EnableSelectionWrappingKeys {
+ get {
+ return enableSelectionWrappingKeys;
+ }
+ set {
+ if (enableSelectionWrappingKeys.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ bool overrideDocumentEolMarker = false;
+ public bool OverrideDocumentEolMarker {
+ get {
+ return overrideDocumentEolMarker;
+ }
+ set {
+ if (overrideDocumentEolMarker != value) {
+ overrideDocumentEolMarker = value;
+ OnChanged (EventArgs.Empty);
+ }
+ }
+ }
+
+ ConfigurationProperty<ShowWhitespaces> showWhitespaces = ConfigurationProperty.Create ("ShowWhitespaces", ShowWhitespaces.Never);
+ public ShowWhitespaces ShowWhitespaces {
+ get {
+ return showWhitespaces;
+ }
+ set {
+ if (showWhitespaces.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+
+ ConfigurationProperty<IncludeWhitespaces> includeWhitespaces = ConfigurationProperty.Create ("IncludeWhitespaces", IncludeWhitespaces.All);
+ public IncludeWhitespaces IncludeWhitespaces {
+ get {
+ return includeWhitespaces;
+ }
+ set {
+ if (includeWhitespaces.Set (value))
+ OnChanged (EventArgs.Empty);
+ }
+ }
+ #endregion
+
+ public void Dispose ()
+ {
+ FontService.RemoveCallback (UpdateFont);
+ IdeApp.Preferences.ColorScheme.Changed -= OnColorSchemeChanged;
+ }
+
+ protected void OnChanged (EventArgs args)
+ {
+ if (Changed != null)
+ Changed (null, args);
+ }
+
+ public event EventHandler Changed;
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DocumentContext.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DocumentContext.cs
new file mode 100644
index 0000000000..0cd3806f2c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DocumentContext.cs
@@ -0,0 +1,170 @@
+//
+// DocumentContext.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Projects;
+using ICSharpCode.NRefactory.TypeSystem;
+using MonoDevelop.Ide.TypeSystem;
+using System.Threading.Tasks;
+using System.Threading;
+using Microsoft.CodeAnalysis.Options;
+using System.Collections.Generic;
+using MonoDevelop.Ide.Editor.Projection;
+
+namespace MonoDevelop.Ide.Editor
+{
+ /// <summary>
+ /// A document context puts a textual document in a semantic context inside a project and gives access
+ /// to the parse information of the textual document.
+ /// </summary>
+ public abstract class DocumentContext
+ {
+ /// <summary>
+ /// The name of the document. It's the file name for files on disc.
+ /// For unsaved files that name is different.
+ /// </summary>
+ public abstract string Name {
+ get;
+ }
+
+ /// <summary>
+ /// Project != null
+ /// </summary>
+ public virtual bool HasProject {
+ get { return Project != null; }
+ }
+
+ internal virtual bool IsAdHocProject {
+ get { return false; }
+ }
+
+ /// <summary>
+ /// Gets the project this context is in.
+ /// </summary>
+ public abstract Project Project {
+ get;
+ }
+
+ WorkspaceId workspaceId = WorkspaceId.Empty;
+
+ public virtual T GetPolicy<T> (IEnumerable<string> types) where T : class, IEquatable<T>, new ()
+ {
+ var project = Project;
+ if (project != null && project.Policies != null) {
+ return project.Policies.Get<T> (types);
+ }
+ return MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<T> (types);
+ }
+
+ public Microsoft.CodeAnalysis.Workspace RoslynWorkspace
+ {
+ get { return TypeSystemService.GetWorkspace (workspaceId); }
+ protected set { workspaceId = ((MonoDevelopWorkspace)value).Id; }
+ }
+
+ /// <summary>
+ /// Returns the roslyn document for this document. This may return <c>null</c> if it's no compileable document.
+ /// Even if it's a C# file.
+ /// </summary>
+ public abstract Microsoft.CodeAnalysis.Document AnalysisDocument
+ {
+ get;
+ }
+
+ /// <summary>
+ /// The parsed document. Contains all syntax information about the text.
+ /// </summary>
+ public abstract ParsedDocument ParsedDocument
+ {
+ get;
+ }
+
+ /// <summary>
+ /// If true, the document is part of the ProjectContent.
+ /// </summary>
+ public virtual bool IsCompileableInProject
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ public virtual T GetContent<T>() where T : class
+ {
+ var t = this as T;
+ if (t != null)
+ return t;
+ return null;
+ }
+
+ public virtual IEnumerable<T> GetContents<T>() where T : class
+ {
+ var t = this as T;
+ if (t != null)
+ yield return t;
+ }
+
+ /// <summary>
+ /// This is called after the ParsedDocument updated.
+ /// </summary>
+ public event EventHandler DocumentParsed;
+
+ protected void OnDocumentParsed (EventArgs e)
+ {
+ var handler = DocumentParsed;
+ if (handler != null)
+ handler (this, e);
+ }
+
+ public abstract void AttachToProject (Project project);
+
+ /// <summary>
+ /// Forces a reparse of the document. This call doesn't block the ui thread.
+ /// The next call to ParsedDocument will give always the current parsed document but may block the UI thread.
+ /// </summary>
+ public abstract void ReparseDocument ();
+
+ public abstract OptionSet GetOptionSet ();
+
+ public abstract Task<ParsedDocument> UpdateParseDocument ();
+
+ // TODO: IMO that needs to be handled differently (this is atm only used in the ASP.NET binding)
+ // Maybe using the file service. Files can be changed/saved w/o beeing opened.
+ public event EventHandler Saved;
+
+ protected virtual void OnSaved (EventArgs e)
+ {
+ var handler = Saved;
+ if (handler != null)
+ handler (this, e);
+ }
+
+ internal virtual Task<IReadOnlyList<Editor.Projection.Projection>> GetPartialProjectionsAsync (CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return null;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DocumentLocation.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DocumentLocation.cs
new file mode 100644
index 0000000000..9e0cf1cdbf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DocumentLocation.cs
@@ -0,0 +1,237 @@
+//
+// DocumentLocation.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.ComponentModel;
+using System.Globalization;
+
+namespace MonoDevelop.Ide.Editor
+{
+ /// <summary>
+ /// A line/column position.
+ /// Text editor lines/columns are counted started from one.
+ /// </summary>
+ [Serializable]
+ [TypeConverter(typeof(DocumentLocationConverter))]
+ public struct DocumentLocation : IComparable<DocumentLocation>, IEquatable<DocumentLocation>
+ {
+ /// <summary>
+ /// Represents no text location (0, 0).
+ /// </summary>
+ public static readonly DocumentLocation Empty = new DocumentLocation(0, 0);
+
+ /// <summary>
+ /// Constant of the minimum line.
+ /// </summary>
+ public const int MinLine = 1;
+
+ /// <summary>
+ /// Constant of the minimum column.
+ /// </summary>
+ public const int MinColumn = 1;
+
+ /// <summary>
+ /// Creates a TextLocation instance.
+ /// </summary>
+ public DocumentLocation(int line, int column)
+ {
+ this.line = line;
+ this.column = column;
+ }
+
+ int column, line;
+
+ /// <summary>
+ /// Gets the line number.
+ /// </summary>
+ public int Line {
+ get { return line; }
+ }
+
+ /// <summary>
+ /// Gets the column number.
+ /// </summary>
+ public int Column {
+ get { return column; }
+ }
+
+ /// <summary>
+ /// Gets whether the TextLocation instance is empty.
+ /// </summary>
+ public bool IsEmpty {
+ get {
+ return column < MinLine && line < MinColumn;
+ }
+ }
+
+ /// <summary>
+ /// Gets a string representation for debugging purposes.
+ /// </summary>
+ public override string ToString()
+ {
+ return string.Format(CultureInfo.InvariantCulture, "(Line {1}, Col {0})", this.column, this.line);
+ }
+
+ /// <summary>
+ /// Gets a hash code.
+ /// </summary>
+ public override int GetHashCode()
+ {
+ return unchecked (column << 20 ^ line);
+ }
+
+ /// <summary>
+ /// Equality test.
+ /// </summary>
+ public override bool Equals(object obj)
+ {
+ if (!(obj is DocumentLocation)) return false;
+ return (DocumentLocation)obj == this;
+ }
+
+ /// <summary>
+ /// Equality test.
+ /// </summary>
+ public bool Equals(DocumentLocation other)
+ {
+ return this == other;
+ }
+
+ /// <summary>
+ /// Equality test.
+ /// </summary>
+ public static bool operator ==(DocumentLocation left, DocumentLocation right)
+ {
+ return left.column == right.column && left.line == right.line;
+ }
+
+ /// <summary>
+ /// Inequality test.
+ /// </summary>
+ public static bool operator !=(DocumentLocation left, DocumentLocation right)
+ {
+ return left.column != right.column || left.line != right.line;
+ }
+
+ /// <summary>
+ /// Compares two text locations.
+ /// </summary>
+ public static bool operator <(DocumentLocation left, DocumentLocation right)
+ {
+ if (left.line < right.line)
+ return true;
+ else if (left.line == right.line)
+ return left.column < right.column;
+ else
+ return false;
+ }
+
+ /// <summary>
+ /// Compares two text locations.
+ /// </summary>
+ public static bool operator >(DocumentLocation left, DocumentLocation right)
+ {
+ if (left.line > right.line)
+ return true;
+ else if (left.line == right.line)
+ return left.column > right.column;
+ else
+ return false;
+ }
+
+ /// <summary>
+ /// Compares two text locations.
+ /// </summary>
+ public static bool operator <=(DocumentLocation left, DocumentLocation right)
+ {
+ return !(left > right);
+ }
+
+ /// <summary>
+ /// Compares two text locations.
+ /// </summary>
+ public static bool operator >=(DocumentLocation left, DocumentLocation right)
+ {
+ return !(left < right);
+ }
+
+ public static implicit operator Microsoft.CodeAnalysis.Text.LinePosition (DocumentLocation location)
+ {
+ return new Microsoft.CodeAnalysis.Text.LinePosition (location.Line - 1, location.Column - 1);
+ }
+
+ public static implicit operator DocumentLocation(Microsoft.CodeAnalysis.Text.LinePosition location)
+ {
+ return new DocumentLocation (location.Line + 1, location.Character + 1);
+ }
+
+ /// <summary>
+ /// Compares two text locations.
+ /// </summary>
+ public int CompareTo(DocumentLocation other)
+ {
+ if (this == other)
+ return 0;
+ if (this < other)
+ return -1;
+ else
+ return 1;
+ }
+ }
+
+ public class DocumentLocationConverter : TypeConverter
+ {
+ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
+ {
+ return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType);
+ }
+
+ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
+ {
+ return destinationType == typeof(DocumentLocation) || base.CanConvertTo(context, destinationType);
+ }
+
+ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ if (value is string) {
+ string[] parts = ((string)value).Split(';', ',');
+ if (parts.Length == 2) {
+ return new DocumentLocation(int.Parse(parts[0]), int.Parse(parts[1]));
+ }
+ }
+ return base.ConvertFrom(context, culture, value);
+ }
+
+ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
+ {
+ if (value is DocumentLocation) {
+ var loc = (DocumentLocation)value;
+ return loc.Line + ";" + loc.Column;
+ }
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DocumentRegion.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DocumentRegion.cs
new file mode 100644
index 0000000000..ff5863936b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/DocumentRegion.cs
@@ -0,0 +1,181 @@
+//
+// DocumentRegion.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+using Microsoft.CodeAnalysis;
+
+namespace MonoDevelop.Ide.Editor
+{
+ /// <summary>
+ /// An (Begin, End) pair representing a document span. It's a TextSegment working with lines &amp; columns instead of offsets.
+ /// </summary>
+ public struct DocumentRegion : IEquatable<DocumentRegion>
+ {
+ public static readonly DocumentRegion Empty = new DocumentRegion (0, 0, 0, 0);
+
+ /// <summary>
+ /// Gets a value indicating whether this DocumentRegion is empty.
+ /// </summary>
+ public bool IsEmpty {
+ get {
+ return beginLine < 1;
+ }
+ }
+
+ readonly int beginLine;
+ public int BeginLine {
+ get {
+ return beginLine;
+ }
+ }
+
+ readonly int beginColumn;
+ public int BeginColumn {
+ get {
+ return beginColumn;
+ }
+ }
+
+ readonly int endLine;
+ public int EndLine {
+ get {
+ return endLine;
+ }
+ }
+
+ readonly int endColumn;
+ public int EndColumn {
+ get {
+ return endColumn;
+ }
+ }
+
+ public DocumentLocation Begin {
+ get {
+ return new DocumentLocation (BeginLine, BeginColumn);
+ }
+ }
+
+ public DocumentLocation End {
+ get {
+ return new DocumentLocation (EndLine, EndColumn);
+ }
+ }
+
+ public DocumentRegion (int beginLine, int beginColumn, int endLine, int endColumn)
+ {
+ this.beginLine = beginLine;
+ this.beginColumn = beginColumn;
+ this.endLine = endLine;
+ this.endColumn = endColumn;
+ }
+
+ public DocumentRegion (DocumentLocation begin, DocumentLocation end)
+ {
+ beginLine = begin.Line;
+ beginColumn = begin.Column;
+ endLine = end.Line;
+ endColumn = end.Column;
+ }
+
+ public bool Contains (DocumentLocation location)
+ {
+ return Begin <= location && location < End;
+ }
+
+ public bool Contains (int line, int column)
+ {
+ return Contains (new DocumentLocation (line, column));
+ }
+
+ public bool IsInside (DocumentLocation location)
+ {
+ return Begin <= location && location <= End;
+ }
+
+ public bool IsInside (int line, int column)
+ {
+ return IsInside (new DocumentLocation (line, column));
+ }
+
+ public override bool Equals (object obj)
+ {
+ return obj is DocumentRegion && Equals ((DocumentRegion)obj);
+ }
+
+ public override int GetHashCode ()
+ {
+ return unchecked (Begin.GetHashCode () ^ End.GetHashCode ());
+ }
+
+ public bool Equals (DocumentRegion other)
+ {
+ return Begin == other.Begin && End == other.End;
+ }
+
+ public static bool operator == (DocumentRegion left, DocumentRegion right)
+ {
+ return left.Equals(right);
+ }
+
+ public static bool operator != (DocumentRegion left, DocumentRegion right)
+ {
+ return !left.Equals(right);
+ }
+
+ public TextSegment GetSegment (TextEditor document)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ var begin = document.LocationToOffset (Begin);
+ var end = document.LocationToOffset (End);
+ return new TextSegment (begin, end - begin);
+ }
+
+ public static implicit operator Microsoft.CodeAnalysis.Text.LinePositionSpan (DocumentRegion location)
+ {
+ return new Microsoft.CodeAnalysis.Text.LinePositionSpan (location.Begin, location.End);
+ }
+
+ public static implicit operator DocumentRegion(Microsoft.CodeAnalysis.Text.LinePositionSpan location)
+ {
+ return new DocumentRegion (location.Start, location.End);
+ }
+
+
+ public static implicit operator DocumentRegion(FileLinePositionSpan location)
+ {
+ return new DocumentRegion (location.StartLinePosition, location.EndLinePosition);
+ }
+
+
+ public override string ToString ()
+ {
+ return string.Format ("[DocumentRegion: Begin={0}, End={1}]", Begin, End);
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/EditActions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/EditActions.cs
new file mode 100644
index 0000000000..a72688c0e2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/EditActions.cs
@@ -0,0 +1,516 @@
+//
+// EditActions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Text;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Editor.Util;
+
+namespace MonoDevelop.Ide.Editor
+{
+ /// <summary>
+ /// This class contains some common actions for the text editor.
+ /// </summary>
+ public static class EditActions
+ {
+ public static void MoveCaretDown (TextEditor editor)
+ {
+ editor.EditorActionHost.MoveCaretDown ();
+ }
+
+ public static void MoveCaretUp (TextEditor editor)
+ {
+ editor.EditorActionHost.MoveCaretUp ();
+ }
+
+ public static void MoveCaretRight (TextEditor editor)
+ {
+ editor.EditorActionHost.MoveCaretRight ();
+ }
+
+ public static void MoveCaretLeft (TextEditor editor)
+ {
+ editor.EditorActionHost.MoveCaretLeft ();
+ }
+
+ public static void MoveCaretToLineEnd (TextEditor editor)
+ {
+ editor.EditorActionHost.MoveCaretToLineEnd ();
+ }
+
+ public static void MoveCaretToLineStart (TextEditor editor)
+ {
+ editor.EditorActionHost.MoveCaretToLineStart ();
+ }
+
+ public static void MoveCaretToDocumentStart (TextEditor editor)
+ {
+ editor.EditorActionHost.MoveCaretToDocumentStart ();
+ }
+
+ public static void MoveCaretToDocumentEnd (TextEditor editor)
+ {
+ editor.EditorActionHost.MoveCaretToDocumentEnd ();
+ }
+
+ public static void Backspace (TextEditor editor)
+ {
+ editor.EditorActionHost.Backspace ();
+ }
+
+ public static void Delete (TextEditor editor)
+ {
+ editor.EditorActionHost.Delete ();
+ }
+
+ public static void ClipboardCopy (TextEditor editor)
+ {
+ editor.EditorActionHost.ClipboardCopy ();
+ }
+
+ public static void ClipboardCut (TextEditor editor)
+ {
+ editor.EditorActionHost.ClipboardCut ();
+ }
+
+ public static void ClipboardPaste (TextEditor editor)
+ {
+ editor.EditorActionHost.ClipboardPaste ();
+ }
+
+
+
+ public static void SelectAll (TextEditor editor)
+ {
+ editor.EditorActionHost.SelectAll ();
+ }
+
+ public static void NewLine (TextEditor editor)
+ {
+ editor.EditorActionHost.NewLine ();
+ }
+
+ public static void PageUp (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.PageUp ();
+ }
+
+ public static void PageDown (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.PageDown ();
+ }
+
+ public static void Undo (TextEditor editor)
+ {
+ editor.EditorActionHost.Undo ();
+ }
+
+ public static void Redo (TextEditor editor)
+ {
+ editor.EditorActionHost.Redo ();
+ }
+
+ public static void DeleteCurrentLine (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.DeleteCurrentLine ();
+ }
+
+ public static void DeleteCurrentLineToEnd (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.DeleteCurrentLineToEnd ();
+ }
+
+ public static void ScrollLineUp (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.ScrollLineUp ();
+ }
+
+ public static void ScrollLineDown (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.ScrollLineDown ();
+ }
+
+ public static void ScrollPageUp (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.ScrollPageUp ();
+ }
+
+ public static void ScrollPageDown (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.ScrollPageDown ();
+ }
+
+ public static void GotoMatchingBrace (TextEditor textEditor)
+ {
+ var offset = SimpleBracketMatcher.GetMatchingBracketOffset (textEditor, textEditor.CaretOffset);
+ if (offset > 0)
+ textEditor.CaretOffset = offset;
+ }
+
+ public static void MovePrevWord (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.MovePrevWord ();
+ }
+
+ public static void MoveNextWord (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.MoveNextWord ();
+ }
+
+ public static void MovePrevSubWord (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.MovePrevSubWord ();
+ }
+
+ public static void MoveNextSubWord (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.MoveNextSubWord ();
+ }
+
+
+ public static void TransposeCharacters (TextEditor textEditor)
+ {
+ // Code from Mono.TextEditor.MiscActions.TransposeCharacters
+ if (textEditor.CaretOffset == 0)
+ return;
+ var line = textEditor.GetLine (textEditor.CaretLine);
+ if (line == null)
+ return;
+ using (var undoGroup = textEditor.OpenUndoGroup ()) {
+ int transposeOffset = textEditor.CaretOffset - 1;
+ char ch;
+ if (textEditor.CaretColumn == 0) {
+ var lineAbove = textEditor.GetLine (textEditor.CaretLine - 1);
+ if (lineAbove.Length == 0 && line.Length == 0)
+ return;
+
+ if (line.Length != 0) {
+ ch = textEditor.GetCharAt (textEditor.CaretOffset);
+ textEditor.RemoveText (textEditor.CaretOffset, 1);
+ textEditor.InsertText (lineAbove.Offset + lineAbove.Length, ch.ToString ());
+ return;
+ }
+
+ int lastCharOffset = lineAbove.Offset + lineAbove.Length - 1;
+ ch = textEditor.GetCharAt (lastCharOffset);
+ textEditor.RemoveText (lastCharOffset, 1);
+ textEditor.InsertAtCaret (ch.ToString ());
+ return;
+ }
+
+ int offset = textEditor.CaretOffset;
+ if (textEditor.CaretColumn >= line.Length + 1) {
+ offset = line.Offset + line.Length - 1;
+ transposeOffset = offset - 1;
+ // case one char in line:
+ if (transposeOffset < line.Offset) {
+ var lineAbove = textEditor.GetLine (textEditor.CaretLine - 1);
+ transposeOffset = lineAbove.Offset + lineAbove.Length;
+ ch = textEditor.GetCharAt (offset);
+ textEditor.RemoveText (offset, 1);
+ textEditor.InsertText (transposeOffset, ch.ToString ());
+ textEditor.CaretOffset = line.Offset;
+ return;
+ }
+ }
+
+ ch = textEditor.GetCharAt (offset);
+ textEditor.ReplaceText (offset, 1, textEditor.GetCharAt (transposeOffset).ToString ());
+ textEditor.ReplaceText (transposeOffset, 1, ch.ToString ());
+ if (textEditor.CaretColumn < line.Length + 1)
+ textEditor.CaretOffset = offset + 1;
+ }
+ }
+
+ public static void DuplicateCurrentLine (TextEditor textEditor)
+ {
+ // Code from Mono.TextEditor.MiscActions.DuplicateLine
+ using (var undoGroup = textEditor.OpenUndoGroup ()) {
+ if (textEditor.IsSomethingSelected) {
+ var selectedText = textEditor.SelectedText;
+ textEditor.ClearSelection ();
+ textEditor.InsertAtCaret (selectedText);
+ } else {
+ var line = textEditor.GetLine (textEditor.CaretLine);
+ if (line == null)
+ return;
+ textEditor.InsertText (line.Offset, textEditor.GetTextAt (line.SegmentIncludingDelimiter));
+ }
+ }
+ }
+
+ public static void JoinLines (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.JoinLines ();
+ }
+
+ public static void RecenterEditor (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.RecenterEditor ();
+ }
+
+ public static void StartCaretPulseAnimation (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.StartCaretPulseAnimation ();
+ }
+
+ public static void DeleteNextSubword (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.DeleteNextSubword ();
+ }
+
+ public static void DeletePreviousSubword (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.DeletePreviousSubword ();
+ }
+
+ public static void DeleteNextWord (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.DeleteNextWord ();
+ }
+
+ public static void DeletePreviousWord (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.DeletePreviousWord ();
+ }
+
+ public static void InsertNewLinePreserveCaretPosition (TextEditor textEditor)
+ {
+ if (textEditor.IsReadOnly)
+ return;
+ using (var undoGroup = textEditor.OpenUndoGroup ()) {
+ var loc = textEditor.CaretLocation;
+ InsertNewLine (textEditor);
+ textEditor.CaretLocation = loc;
+ }
+ }
+
+ public static void InsertNewLineAtEnd (TextEditor textEditor)
+ {
+ if (textEditor.IsReadOnly)
+ return;
+ using (var undoGroup = textEditor.OpenUndoGroup ()) {
+ MoveCaretToLineEnd (textEditor);
+ InsertNewLine (textEditor);
+ }
+ }
+
+ public static void InsertNewLine (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.InsertNewLine ();
+ }
+
+ public static void RemoveTab (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.RemoveTab ();
+ }
+
+ public static void InsertTab (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.InsertTab ();
+ }
+
+ public static void SwitchCaretMode (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.SwitchCaretMode ();
+ }
+
+ public static void MoveBlockUp (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.MoveBlockUp ();
+ }
+
+ public static void MoveBlockDown (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.MoveBlockDown ();
+ }
+
+ public static void ToggleBlockSelectionMode (TextEditor textEditor)
+ {
+ textEditor.EditorActionHost.ToggleBlockSelectionMode ();
+ }
+
+ public static void IndentSelection (TextEditor editor)
+ {
+ editor.EditorActionHost.IndentSelection ();
+ }
+
+ public static void UnIndentSelection (TextEditor editor)
+ {
+ editor.EditorActionHost.UnIndentSelection ();
+ }
+
+ #region SelectionActions
+
+ static void RunSelectionAction (TextEditor textEditor, Action<TextEditor> action)
+ {
+ using (var undo = textEditor.OpenUndoGroup ()) {
+ var anchor = textEditor.IsSomethingSelected ? textEditor.SelectionAnchorOffset : textEditor.CaretOffset;
+ action (textEditor);
+ textEditor.SetSelection (anchor, textEditor.CaretOffset);
+ }
+ }
+
+ public static void SelectionMoveToDocumentEnd (TextEditor textEditor)
+ {
+ RunSelectionAction (textEditor, MoveCaretToDocumentEnd);
+ }
+
+ public static void ExpandSelectionToLine (TextEditor textEditor)
+ {
+ // from Mono.TextEditor.SelectionActions.ExpandSelectionToLine
+ using (var undoGroup = textEditor.OpenUndoGroup ()) {
+ var curLineSegment = textEditor.GetLine (textEditor.CaretLine).SegmentIncludingDelimiter;
+ var range = textEditor.SelectionRange;
+ var selection = TextSegment.FromBounds (
+ System.Math.Min (range.Offset, curLineSegment.Offset),
+ System.Math.Max (range.EndOffset, curLineSegment.EndOffset));
+ textEditor.CaretOffset = selection.EndOffset;
+ textEditor.SelectionRange = selection;
+ }
+ }
+
+ public static void SelectionMoveToDocumentStart (TextEditor textEditor)
+ {
+ RunSelectionAction (textEditor, MoveCaretToDocumentStart);
+ }
+
+ public static void SelectionMoveLineEnd (TextEditor textEditor)
+ {
+ RunSelectionAction (textEditor, MoveCaretToLineEnd);
+ }
+
+ public static void SelectionMoveLineStart (TextEditor textEditor)
+ {
+ RunSelectionAction (textEditor, MoveCaretToLineStart);
+ }
+
+ public static void SelectionMoveDown (TextEditor textEditor)
+ {
+ RunSelectionAction (textEditor, MoveCaretDown);
+ }
+
+ public static void SelectionMoveUp (TextEditor textEditor)
+ {
+ RunSelectionAction (textEditor, MoveCaretUp);
+ }
+
+ public static void SelectionPageUp (TextEditor textEditor)
+ {
+ RunSelectionAction (textEditor, PageUp);
+ }
+
+ public static void SelectionPageDown (TextEditor textEditor)
+ {
+ RunSelectionAction (textEditor, PageDown);
+ }
+
+ public static void SelectionMovePrevSubWord (TextEditor textEditor)
+ {
+ RunSelectionAction (textEditor, MovePrevSubWord);
+ }
+
+ public static void SelectionMoveNextSubWord (TextEditor textEditor)
+ {
+ RunSelectionAction (textEditor, MoveNextSubWord);
+ }
+
+ public static void SelectionMoveLeft (TextEditor textEditor)
+ {
+ RunSelectionAction (textEditor, MoveCaretLeft);
+ }
+
+ public static void SelectionMoveRight (TextEditor textEditor)
+ {
+ RunSelectionAction (textEditor, MoveCaretRight);
+ }
+
+ public static void SelectionMovePrevWord (TextEditor textEditor)
+ {
+ RunSelectionAction (textEditor, MovePrevWord);
+ }
+
+ public static void SelectionMoveNextWord (TextEditor textEditor)
+ {
+ RunSelectionAction (textEditor, MoveNextWord);
+ }
+
+ public static void SortSelectedLines (TextEditor textEditor)
+ {
+ var selectionRegion = textEditor.SelectionRegion;
+ var start = selectionRegion.Begin;
+ var end = selectionRegion.End;
+ var caret = textEditor.CaretLocation;
+
+ int startLine = start.Line;
+ int endLine = end.Line;
+ if (startLine == endLine)
+ return;
+
+ int length = 0;
+ var lines = new string[endLine - startLine + 1];
+ for (int i = startLine; i <= endLine; i++) {
+ //get lines *with* line endings
+ var lineText = textEditor.GetLineText (i, true);
+ lines [i - startLine] = lineText;
+ length += lineText.Length;
+ }
+
+ var linesUnsorted = new string[lines.Length];
+
+ Array.Sort (lines, StringComparer.Ordinal);
+
+ bool changed = false;
+ for (int i = 0; i <= lines.Length; i++) {
+ //can't simply use reference comparison as Array.Sort is not stable
+ if (string.Equals (lines [i], linesUnsorted [i], StringComparison.Ordinal)) {
+ continue;
+ }
+ changed = true;
+ break;
+ }
+ if (!changed)
+ return;
+
+
+ var sb = new StringBuilder ();
+ for (int i = 0; i < lines.Length; i++) {
+ sb.Append (lines [i]);
+ }
+
+ var startOffset = textEditor.LocationToOffset (startLine, 1);
+ textEditor.ReplaceText (startOffset, length, sb.ToString ());
+
+ textEditor.CaretLocation = LimitColumn (textEditor, caret);
+ textEditor.SetSelection (LimitColumn (textEditor, start), LimitColumn (textEditor, end));
+ }
+
+ static DocumentLocation LimitColumn (TextEditor data, DocumentLocation loc)
+ {
+ return new DocumentLocation (loc.Line, System.Math.Min (loc.Column, data.GetLine (loc.Line).Length + 1));
+ }
+ #endregion
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/EditSession.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/EditSession.cs
new file mode 100644
index 0000000000..8d74eb7971
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/EditSession.cs
@@ -0,0 +1,180 @@
+//
+// EditSession.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public abstract class EditSession : IDisposable
+ {
+ private TextEditor editor;
+ ITextSourceVersion version;
+
+ protected int startOffset, endOffset;
+
+ public int StartOffset { get { return version.MoveOffsetTo (editor.Version, startOffset); } }
+
+ public int EndOffset { get { return version.MoveOffsetTo (editor.Version, endOffset); } }
+
+ public TextEditor Editor {
+ get {
+ return editor;
+ }
+ }
+
+ public EditSession()
+ {
+ }
+
+ public EditSession (int startOffset, int endOffset)
+ {
+ this.startOffset = startOffset;
+ this.endOffset = endOffset;
+ }
+
+ internal void SetEditor(TextEditor editor)
+ {
+ if (editor == null)
+ throw new ArgumentNullException (nameof (editor));
+ this.editor = editor;
+ this.version = editor.Version;
+ OnEditorSet ();
+ }
+
+ protected virtual void OnEditorSet ()
+ {
+ }
+
+ protected bool CheckIsValid()
+ {
+ if (editor == null)
+ throw new InvalidOperationException ("Session not yet started.");
+ if (StartOffset > editor.CaretOffset || EndOffset < editor.CaretOffset) {
+ editor.EndSession ();
+ return false;
+ }
+ return true;
+ }
+
+ public virtual void BeforeType(char ch, out bool handledCommand)
+ {
+ handledCommand = false;
+ }
+
+ public virtual void AfterType(char ch)
+ {
+ }
+
+ public virtual void BeforeReturn(out bool handledCommand)
+ {
+ handledCommand = false;
+ }
+
+ public virtual void AfterReturn()
+ {
+ }
+
+ public virtual void BeforeBackspace(out bool handledCommand)
+ {
+ handledCommand = false;
+ }
+
+ public virtual void AfterBackspace()
+ {
+ }
+
+ //public virtual void BeforeTab(out bool handledCommand)
+ //{
+ // handledCommand = false;
+ //}
+
+ //public virtual void AfterTab()
+ //{
+ //}
+
+ public virtual void BeforeDelete(out bool handledCommand)
+ {
+ handledCommand = false;
+ }
+
+ public virtual void AfterDelete()
+ {
+ }
+
+ public virtual void SessionStarted ()
+ {
+ }
+
+ public virtual void Dispose ()
+ {
+ }
+
+ }
+
+ /// <summary>
+ /// Reassembles the old skip char system - shouldn't be used by new features anymore.
+ /// </summary>
+ class SkipCharSession : EditSession
+ {
+ readonly char ch;
+
+ public SkipCharSession (char ch)
+ {
+ this.ch = ch;
+ }
+
+ public override void BeforeType (char ch, out bool handledCommand)
+ {
+ if (CheckIsValid() && ch == this.ch) {
+ Editor.CaretOffset++;
+ handledCommand = true;
+ Editor.EndSession ();
+ return;
+ }
+ handledCommand = false;
+ }
+
+ protected override void OnEditorSet ()
+ {
+ startOffset = Editor.CaretOffset;
+ endOffset = StartOffset + 1;
+ }
+
+ public override void AfterBackspace ()
+ {
+ if (Editor.CaretOffset == StartOffset) {
+ Editor.EndSession ();
+ }
+ }
+
+ public override void AfterDelete ()
+ {
+ if (Editor.CaretOffset == StartOffset) {
+ Editor.EndSession ();
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/FileSettingsStore.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/FileSettingsStore.cs
new file mode 100644
index 0000000000..bec7ddd1b6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/FileSettingsStore.cs
@@ -0,0 +1,73 @@
+//
+// FileSettingsStore.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public static class FileSettingsStore
+ {
+ public class Settings
+ {
+ public int CaretOffset { get; set; }
+
+ public double vAdjustment { get; set; }
+
+ public double hAdjustment { get; set; }
+
+ public Dictionary<int, bool> FoldingStates = new Dictionary<int, bool> ();
+
+ public override string ToString ()
+ {
+ return string.Format ("[Settings: CaretOffset={0}, vAdjustment={1}, hAdjustment={2}]", CaretOffset, vAdjustment, hAdjustment);
+ }
+ }
+
+ static Dictionary<string, Settings> settingStore = new Dictionary<string, Settings> ();
+
+ public static bool TryGetValue (string contentName, out Settings settings)
+ {
+ if (contentName == null)
+ throw new ArgumentNullException ("contentName");
+ return settingStore.TryGetValue (contentName, out settings);
+ }
+
+ public static void Store (string contentName, Settings settings)
+ {
+ if (contentName == null)
+ throw new ArgumentNullException ("contentName");
+ if (settings == null)
+ throw new ArgumentNullException ("settings");
+ settingStore [contentName] = settings;
+ }
+
+ public static void Remove (string fileName)
+ {
+ settingStore.Remove (fileName);
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/FoldSegmentFactory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/FoldSegmentFactory.cs
new file mode 100644
index 0000000000..468defb00f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/FoldSegmentFactory.cs
@@ -0,0 +1,86 @@
+//
+// FoldSegmentFactory.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public static class FoldSegmentFactory
+ {
+ public static IFoldSegment CreateFoldSegment (TextEditor editor, int offset, int length, bool isCollapsed = false, string collapsedText = "...", FoldingType foldingType = FoldingType.Unknown)
+ {
+ if (editor == null)
+ throw new ArgumentNullException ("editor");
+ var result = editor.CreateFoldSegment (offset, length, isCollapsed);
+ result.CollapsedText = collapsedText;
+ result.FoldingType = foldingType;
+ return result;
+ }
+
+ public static IFoldSegment CreateFoldSegment (TextEditor editor, ISegment segment, bool isCollapsed = false, string collapsedText = "...", FoldingType foldingType = FoldingType.Unknown)
+ {
+ if (editor == null)
+ throw new ArgumentNullException ("editor");
+ if (segment == null)
+ throw new ArgumentNullException ("segment");
+ return CreateFoldSegment (editor, segment.Offset, segment.Length, isCollapsed, collapsedText, foldingType);
+ }
+
+ public static IFoldSegment CreateFoldSegment (TextEditor editor, int offset, int length, string collapsedText = "...", FoldingType foldingType = FoldingType.Unknown)
+ {
+ if (editor == null)
+ throw new ArgumentNullException ("editor");
+ return CreateFoldSegment (editor, offset, length, false, collapsedText, foldingType);
+ }
+
+ public static IFoldSegment CreateFoldSegment (TextEditor editor, ISegment segment, string collapsedText = "...", FoldingType foldingType = FoldingType.Unknown)
+ {
+ if (editor == null)
+ throw new ArgumentNullException ("editor");
+ if (segment == null)
+ throw new ArgumentNullException ("segment");
+ return CreateFoldSegment (editor, segment.Offset, segment.Length, false, collapsedText, foldingType);
+ }
+
+ public static IFoldSegment CreateFoldSegment (TextEditor editor, int offset, int length, FoldingType foldingType = FoldingType.Unknown)
+ {
+ if (editor == null)
+ throw new ArgumentNullException ("editor");
+ return CreateFoldSegment (editor, offset, length, false, "...", foldingType);
+ }
+
+ public static IFoldSegment CreateFoldSegment (TextEditor editor, ISegment segment, FoldingType foldingType = FoldingType.Unknown)
+ {
+ if (editor == null)
+ throw new ArgumentNullException ("editor");
+ if (segment == null)
+ throw new ArgumentNullException ("segment");
+ return CreateFoldSegment (editor, segment.Offset, segment.Length, false, "...", foldingType);
+ }
+
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/IDocumentLine.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/IDocumentLine.cs
new file mode 100644
index 0000000000..8bd9388f83
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/IDocumentLine.cs
@@ -0,0 +1,113 @@
+//
+// IDocumentLine.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+using System.Text;
+using MonoDevelop.Ide.Editor.Highlighting;
+
+namespace MonoDevelop.Ide.Editor
+{
+ /// <summary>
+ /// A line inside a <see cref="ITextDocument"/>.
+ /// </summary>
+ public interface IDocumentLine : ISegment
+ {
+ /// <summary>
+ /// Gets the length of the line including the line delimiter.
+ /// </summary>
+ int LengthIncludingDelimiter {
+ get;
+ }
+
+ int EndOffsetIncludingDelimiter {
+ get;
+ }
+
+ /// <summary>
+ /// Gets the text segment of the line including the line delimiter.
+ /// </summary>
+ ISegment SegmentIncludingDelimiter {
+ get;
+ }
+
+ /// <summary>
+ /// Gets the unicode newline for this line. Returns UnicodeNewline.Unknown for no new line (in the last line of the document)
+ /// </summary>EndOffsetIncludingDelimiterEndOffsetIncludingDelimiter
+ UnicodeNewline UnicodeNewline {
+ get;
+ }
+
+ /// <summary>
+ /// Gets the length of the line terminator.
+ /// Returns 1 or 2; or 0 at the end of the document.
+ /// </summary>
+ int DelimiterLength { get; }
+
+ /// <summary>
+ /// Gets the number of this line.
+ /// The first line has the number 1.
+ /// </summary>
+ int LineNumber { get; }
+
+ /// <summary>
+ /// Gets the previous line. Returns null if this is the first line in the document.
+ /// </summary>
+ IDocumentLine PreviousLine { get; }
+
+ /// <summary>
+ /// Gets the next line. Returns null if this is the last line in the document.
+ /// </summary>
+ IDocumentLine NextLine { get; }
+ }
+
+ public static class DocumentLineExt
+ {
+ /// <summary>
+ /// This method gets the line indentation.
+ /// </summary>
+ /// <param name = "line"></param>
+ /// <param name="doc">
+ /// The <see cref="IReadonlyTextDocument"/> the line belongs to.
+ /// </param>
+ /// <returns>
+ /// The indentation of the line (all whitespace chars up to the first non ws char).
+ /// </returns>
+ public static string GetIndentation (this IDocumentLine line, IReadonlyTextDocument doc)
+ {
+ var result = new StringBuilder ();
+ int offset = line.Offset;
+ int max = Math.Min (offset + line.LengthIncludingDelimiter, doc.Length);
+ for (int i = offset; i < max; i++) {
+ char ch = doc.GetCharAt (i);
+ if (ch != ' ' && ch != '\t')
+ break;
+ result.Append (ch);
+ }
+ return result.ToString ();
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/IFoldSegment.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/IFoldSegment.cs
new file mode 100644
index 0000000000..d1708faf36
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/IFoldSegment.cs
@@ -0,0 +1,74 @@
+//
+// IFoldSegment.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+using System.Web.UI.WebControls;
+
+namespace MonoDevelop.Ide.Editor
+{
+ /// <summary>
+ /// Represents the origin for a fold segment
+ /// </summary>
+ public enum FoldingType {
+ Unknown,
+ Region,
+ TypeDefinition,
+ TypeMember,
+ Comment
+ }
+
+ /// <summary>
+ /// A fold segment represents a collapsible region inside the text editor.
+ /// </summary>
+ public interface IFoldSegment : ISegment
+ {
+ /// <summary>
+ /// Gets or sets a value indicating whether this fold segment is collapsed.
+ /// </summary>
+ bool IsCollapsed {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// Gets or sets the collapsed text. This is displayed when the folding is collapsed instead of the collapsed region.
+ /// </summary>
+ string CollapsedText {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// Gets or sets the type of the folding. This type gives some info about where this folding segment
+ /// originates from.
+ /// </summary>
+ FoldingType FoldingType {
+ get;
+ set;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/IReadonlyTextDocument.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/IReadonlyTextDocument.cs
new file mode 100644
index 0000000000..616e2fd1d1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/IReadonlyTextDocument.cs
@@ -0,0 +1,246 @@
+//
+// IReadonlyTextDocument.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using MonoDevelop.Core.Text;
+using System.Collections.Generic;
+using System.Text;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Editor.Util;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public interface IReadonlyTextDocument : ITextSource
+ {
+ bool IsReadOnly { get; }
+
+ FilePath FileName { get; }
+
+ string MimeType { get; }
+
+ /// <summary>
+ /// Gets the number of lines in the document.
+ /// </summary>
+ int LineCount { get; }
+
+ int LocationToOffset (int line, int column);
+
+ DocumentLocation OffsetToLocation (int offset);
+
+ IDocumentLine GetLine (int lineNumber);
+
+ IDocumentLine GetLineByOffset (int offset);
+ }
+
+ public static class ReadonlyTextDocumentExtensions
+ {
+ /// <summary>
+ /// Retrieves the text for a portion of the document.
+ /// </summary>
+ /// <exception cref="ArgumentOutOfRangeException">offset or length is outside the valid range.</exception>
+ public static string GetTextAt(this IReadonlyTextDocument source, ISegment segment)
+ {
+ if (source == null)
+ throw new ArgumentNullException ("source");
+ return source.GetTextAt (segment.Offset, segment.Length);
+ }
+
+ public static IEnumerable<IDocumentLine> GetLines (this IReadonlyTextDocument document)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ return document.GetLinesStartingAt (1);
+ }
+
+ public static IEnumerable<IDocumentLine> GetLinesBetween (this IReadonlyTextDocument document, int startLine, int endLine)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ if (startLine < 1 || startLine > document.LineCount)
+ throw new ArgumentOutOfRangeException ("startLine", startLine, string.Format ("value should be between 1 and {0}", document.LineCount));
+ if (endLine < 1 || endLine > document.LineCount)
+ throw new ArgumentOutOfRangeException ("endLine", endLine, string.Format ("value should be between 1 and {0}", document.LineCount));
+
+ var curLine = document.GetLine (startLine);
+ int count = endLine - startLine;
+ while (curLine != null && count --> 0) {
+ yield return curLine;
+ curLine = curLine.NextLine;
+ }
+ }
+
+ public static IEnumerable<IDocumentLine> GetLinesStartingAt (this IReadonlyTextDocument document, int startLine)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ if (startLine < 1 || startLine > document.LineCount)
+ throw new ArgumentOutOfRangeException ("startLine", startLine, string.Format ("value should be between 1 and {0}", document.LineCount));
+ var curLine = document.GetLine (startLine);
+ while (curLine != null) {
+ yield return curLine;
+ curLine = curLine.NextLine;
+ }
+ }
+
+ public static IEnumerable<IDocumentLine> GetLinesReverseStartingAt (this IReadonlyTextDocument document, int startLine)
+ {
+ if (startLine < 1 || startLine > document.LineCount)
+ throw new ArgumentOutOfRangeException ("startLine", startLine, string.Format ("value should be between 1 and {0}", document.LineCount));
+ var curLine = document.GetLine (startLine);
+ while (curLine != null) {
+ yield return curLine;
+ curLine = curLine.PreviousLine;
+ }
+ }
+
+ public static string GetTextBetween (this IReadonlyTextDocument document, int startLine, int startColumn, int endLine, int endColumn)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ return document.GetTextBetween (new DocumentLocation (startLine, startColumn), new DocumentLocation (endLine, endColumn));
+ }
+
+ public static string GetLineIndent (this IReadonlyTextDocument document, int lineNumber)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ return document.GetLineIndent (document.GetLine (lineNumber));
+ }
+
+ public static string GetLineIndent (this IReadonlyTextDocument document, IDocumentLine segment)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ if (segment == null)
+ throw new ArgumentNullException ("segment");
+ return segment.GetIndentation (document);
+ }
+
+ public static string GetLineText (this IReadonlyTextDocument document, IDocumentLine line, bool includeDelimiter = false)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ if (line == null)
+ throw new ArgumentNullException ("line");
+ return document.GetTextAt (includeDelimiter ? line.SegmentIncludingDelimiter : line);
+ }
+
+ public static string GetLineText (this IReadonlyTextDocument document, int lineNumber, bool includeDelimiter = false)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ var line = document.GetLine (lineNumber);
+ return document.GetTextAt (includeDelimiter ? line.SegmentIncludingDelimiter : line);
+ }
+
+ static int[] GetDiffCodes (IReadonlyTextDocument document, ref int codeCounter, Dictionary<string, int> codeDictionary, bool includeEol)
+ {
+ int i = 0;
+ var result = new int[document.LineCount];
+ foreach (var line in document.GetLinesStartingAt (1)) {
+ string lineText = document.GetTextAt (line.Offset, includeEol ? line.LengthIncludingDelimiter : line.Length);
+ int curCode;
+ if (!codeDictionary.TryGetValue (lineText, out curCode)) {
+ codeDictionary[lineText] = curCode = ++codeCounter;
+ }
+ result[i] = curCode;
+ i++;
+ }
+ return result;
+ }
+
+ public static IEnumerable<DiffHunk> GetDiff (this IReadonlyTextDocument document, IReadonlyTextDocument changedDocument, bool includeEol = true)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ if (changedDocument == null)
+ throw new ArgumentNullException ("changedDocument");
+ var codeDictionary = new Dictionary<string, int> ();
+ int codeCounter = 0;
+ return Diff.GetDiff<int> (GetDiffCodes (document, ref codeCounter, codeDictionary, includeEol),
+ GetDiffCodes (changedDocument, ref codeCounter, codeDictionary, includeEol));
+ }
+
+ public static string GetDiffAsString (this IReadonlyTextDocument document, IReadonlyTextDocument changedDocument, bool includeEol = true)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ if (changedDocument == null)
+ throw new ArgumentNullException ("changedDocument");
+ return Diff.GetDiffString (GetDiff (document, changedDocument, includeEol), document, changedDocument, document.FileName, changedDocument.FileName);
+ }
+
+ public static int OffsetToLineNumber (this IReadonlyTextDocument document, int offset)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ if (offset < 0 || offset > document.Length)
+ throw new ArgumentOutOfRangeException ("offset", string.Format ("offset should be between 0 and <={0} but was {1}.", document.Length, offset));
+ return document.OffsetToLocation (offset).Line;
+ }
+
+ public static int LocationToOffset (this IReadonlyTextDocument document, DocumentLocation location)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ return document.LocationToOffset (location.Line, location.Column);
+ }
+
+ public static string GetTextBetween (this IReadonlyTextDocument document, int startOffset, int endOffset)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ if (startOffset < 0 || startOffset > document.Length)
+ throw new ArgumentNullException ("startOffset");
+ if (endOffset < 0 || endOffset > document.Length)
+ throw new ArgumentNullException ("endOffset");
+ if (startOffset > endOffset)
+ throw new InvalidOperationException ();
+ return document.GetTextAt (startOffset, endOffset - startOffset);
+ }
+
+ public static string GetTextBetween (this IReadonlyTextDocument document, DocumentLocation start, DocumentLocation end)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ return document.GetTextBetween (document.LocationToOffset (start), document.LocationToOffset (end));
+ }
+
+ public static string GetEolMarker (this IReadonlyTextDocument document)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ string eol = null;
+ if (document.LineCount > 0) {
+ var line = document.GetLine (1);
+ if (line.DelimiterLength > 0)
+ eol = document.GetTextAt (line.Length, line.DelimiterLength);
+ }
+
+ return !string.IsNullOrEmpty (eol) ? eol : DefaultSourceEditorOptions.Instance.DefaultEolMarker;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextDocument.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextDocument.cs
new file mode 100644
index 0000000000..b2ed856224
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextDocument.cs
@@ -0,0 +1,140 @@
+//
+// ITextDocument.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using MonoDevelop.Core.Text;
+using System.Text;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public interface ITextDocument : IReadonlyTextDocument
+ {
+ /// <summary>
+ /// Gets/Sets the text of the whole document..
+ /// </summary>
+ new string Text { get; set; } // hides ITextSource.Text to add the setter
+
+ /// <summary>
+ /// Gets or Sets a character at the specified position in the document.
+ /// </summary>
+ /// <paramref name="offset">The index of the character to get.</paramref>
+ /// <exception cref="ArgumentOutOfRangeException">Offset is outside the valid range (0 to TextLength-1).</exception>
+ /// <returns>The character at the specified position.</returns>
+ /// <remarks>This is the same as Text[offset], but is more efficient because
+ /// it doesn't require creating a String object.</remarks>
+ new char this [int offset] { get; set; }
+
+ new bool IsReadOnly { get; set; }
+
+ new FilePath FileName { get; set; }
+
+ new string MimeType { get; set; }
+
+ new bool UseBOM { get; set; }
+
+ new Encoding Encoding { get; set; }
+
+ void InsertText (int offset, string text);
+
+ void InsertText (int offset, ITextSource text);
+
+ void RemoveText (int offset, int length);
+
+ void ReplaceText (int offset, int length, string value);
+
+ void ReplaceText (int offset, int length, ITextSource value);
+
+ bool IsInAtomicUndo {
+ get;
+ }
+
+ IDisposable OpenUndoGroup();
+
+ /// <summary>
+ /// This event is called directly before a change is applied to the document.
+ /// </summary>
+ /// <remarks>
+ /// It is invalid to modify the document within this event handler.
+ /// Aborting the change (by throwing an exception) is likely to cause corruption of data structures
+ /// that listen to the Changing and Changed events.
+ /// </remarks>
+ event EventHandler<TextChangeEventArgs> TextChanging;
+
+ /// <summary>
+ /// This event is called directly after a change is applied to the document.
+ /// </summary>
+ /// <remarks>
+ /// It is invalid to modify the document within this event handler.
+ /// Aborting the event handler (by throwing an exception) is likely to cause corruption of data structures
+ /// that listen to the Changing and Changed events.
+ /// </remarks>
+ event EventHandler<TextChangeEventArgs> TextChanged;
+
+ event EventHandler FileNameChanged;
+ event EventHandler MimeTypeChanged;
+
+ /// <summary>
+ /// Creates an immutable snapshot of this document.
+ /// </summary>
+ IReadonlyTextDocument CreateDocumentSnapshot();
+
+// event EventHandler<LineEventArgs> LineChanged;
+// event EventHandler<LineEventArgs> LineInserted;
+// event EventHandler<LineEventArgs> LineRemoved;
+ }
+
+ public static class DocumentExtensions
+ {
+ public static void RemoveText (this ITextDocument document, ISegment segment)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ document.RemoveText (segment.Offset, segment.Length);
+ }
+
+ public static void ReplaceText (this ITextDocument document, ISegment segment, string value)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ document.ReplaceText (segment.Offset, segment.Length, value);
+ }
+
+ public static void ReplaceText (this ITextDocument document, ISegment segment, ITextSource textSource)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ document.ReplaceText (segment.Offset, segment.Length, textSource);
+ }
+
+ public static void Save (this ITextDocument document)
+ {
+ if (document == null)
+ throw new ArgumentNullException ("document");
+ document.WriteTextTo (document.FileName);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextEditorOptions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextEditorOptions.cs
new file mode 100644
index 0000000000..b2c8655b90
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextEditorOptions.cs
@@ -0,0 +1,125 @@
+//
+// ITextEditorOptions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide.Editor.Highlighting;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public enum IndentStyle
+ {
+ /// <summary>
+ /// No indentation occurs
+ /// </summary>
+ None,
+
+ /// <summary>
+ /// The indentation from the line above will be
+ /// taken to indent the current line
+ /// </summary>
+ Auto,
+
+ /// <summary>
+ /// Intelligent, context sensitive indentation will occur
+ /// </summary>
+ Smart,
+
+ /// <summary>
+ /// Intelligent, context sensitive indentation that minimizes whitespaces will occur
+ /// </summary>
+ Virtual
+ }
+
+ public enum ShowWhitespaces {
+ Never,
+ Selection,
+ Always
+ }
+
+ [Flags]
+ public enum IncludeWhitespaces {
+ None = 0,
+ Space = 1,
+ Tab = 2,
+ LineEndings = 4,
+ All = Space | Tab | LineEndings
+ }
+
+ public interface ITextEditorOptions : IDisposable
+ {
+ WordFindStrategy WordFindStrategy { get; }
+
+ bool TabsToSpaces { get; }
+ int IndentationSize { get; }
+ int TabSize { get; }
+ bool ShowIconMargin { get; }
+ bool ShowLineNumberMargin { get; }
+ bool ShowFoldMargin { get; }
+ bool HighlightCaretLine { get; }
+ int RulerColumn { get; }
+ bool ShowRuler { get; }
+ IndentStyle IndentStyle { get; }
+ bool OverrideDocumentEolMarker { get; }
+ bool EnableSyntaxHighlighting { get; }
+ bool RemoveTrailingWhitespaces { get; }
+
+ bool WrapLines { get; }
+
+ string FontName { get; }
+
+ string GutterFontName { get; }
+
+ string ColorScheme { get; }
+
+ string DefaultEolMarker { get; }
+
+ bool GenerateFormattingUndoStep { get; }
+ bool EnableSelectionWrappingKeys { get; }
+
+ ShowWhitespaces ShowWhitespaces { get; }
+
+ IncludeWhitespaces IncludeWhitespaces { get; }
+ }
+
+ public static class TextEditorOptionsExtension
+ {
+ public static ColorScheme GetColorStyle (this ITextEditorOptions options)
+ {
+ if (options == null)
+ throw new ArgumentNullException ("options");
+ return SyntaxModeService.GetColorStyle (options.ColorScheme);
+ }
+
+ /// <summary>
+ /// Gets the indentation string for a single indent.
+ /// </summary>
+ public static string GetIndentationString (this ITextEditorOptions options)
+ {
+ if (options == null)
+ throw new ArgumentNullException ("options");
+ return options.TabsToSpaces ? new string (' ', options.IndentationSize) : "\t";
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextLineMarker.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextLineMarker.cs
new file mode 100644
index 0000000000..982033e951
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextLineMarker.cs
@@ -0,0 +1,80 @@
+//
+// ITextLineMarker.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public interface ITextLineMarker
+ {
+ IDocumentLine Line {
+ get;
+ }
+
+ bool IsVisible {
+ get;
+ set;
+ }
+
+ object Tag {
+ get;
+ set;
+ }
+ }
+
+ public enum UrlType {
+ Unknown,
+ Url,
+ Email
+ }
+
+ public interface IUrlTextLineMarker : ITextLineMarker
+ {
+ UrlType UrlType {
+ get;
+ }
+
+ string Url {
+ get;
+ }
+ }
+
+ public interface ICurrentDebugLineTextMarker : ITextLineMarker
+ {
+
+ }
+
+ public interface IMessageBubbleLineMarker : ITextLineMarker
+ {
+ int TaskCount { get; }
+
+ MonoDevelop.Ide.Tasks.TaskListEntry PrimaryTask { get; set; }
+
+ IEnumerable<MonoDevelop.Ide.Tasks.TaskListEntry> Tasks { get; }
+
+ void AddTask (MonoDevelop.Ide.Tasks.TaskListEntry task);
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextSegmentMarker.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextSegmentMarker.cs
new file mode 100644
index 0000000000..e1f797135b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/ITextSegmentMarker.cs
@@ -0,0 +1,92 @@
+//
+// ITextSegmentMarker.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Components;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public interface ITextSegmentMarker : ISegment
+ {
+ bool IsVisible {
+ get;
+ set;
+ }
+
+ object Tag {
+ get;
+ set;
+ }
+
+ event EventHandler<TextMarkerMouseEventArgs> MousePressed;
+ event EventHandler<TextMarkerMouseEventArgs> MouseHover;
+ }
+
+ public enum TextSegmentMarkerEffect {
+ /// <summary>
+ /// The region is marked as waved underline.
+ /// </summary>
+ WavedLine,
+
+ /// <summary>
+ /// The region is marked as dotted line.
+ /// </summary>
+ DottedLine,
+
+ /// <summary>
+ /// The text is grayed out.
+ /// </summary>
+ GrayOut
+ }
+
+ public interface IGenericTextSegmentMarker : ITextSegmentMarker
+ {
+ TextSegmentMarkerEffect Effect { get; }
+
+ HslColor Color { get; set; }
+ }
+
+ public interface IErrorMarker : ITextSegmentMarker
+ {
+ Error Error { get; }
+ }
+
+ public interface ISmartTagMarker : ITextSegmentMarker
+ {
+ bool IsInsideSmartTag (double x, double y);
+
+ event EventHandler ShowPopup;
+ event EventHandler CancelPopup;
+ }
+
+ public interface ILinkTextMarker : ITextSegmentMarker
+ {
+ bool OnlyShowLinkOnHover { get; set; }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/IUnitTestMarker.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/IUnitTestMarker.cs
new file mode 100644
index 0000000000..0350ff9839
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/IUnitTestMarker.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public interface IUnitTestMarker : ITextLineMarker
+ {
+ UnitTestLocation UnitTest { get; }
+
+ void UpdateState ();
+ }
+
+ public abstract class UnitTestMarkerHost
+ {
+ public abstract Xwt.Drawing.Image GetStatusIcon (string unitTestIdentifier, string caseId = null);
+ public abstract bool IsFailure (string unitTestIdentifier, string caseId = null);
+ public abstract string GetMessage (string unitTestIdentifier, string caseId = null);
+ public abstract bool HasResult (string unitTestIdentifier, string caseId = null);
+
+ public abstract void PopupContextMenu (UnitTestLocation unitTest, int x, int y);
+ }
+
+ public class UnitTestLocation
+ {
+ public int Offset { get; set; }
+ public bool IsFixture { get; set; }
+ public string UnitTestIdentifier { get; set; }
+ public bool IsIgnored { get; set; }
+
+ public List<string> TestCases = new List<string> ();
+
+ public UnitTestLocation (int offset)
+ {
+ Offset = offset;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InsertionCursorEventArgs.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InsertionCursorEventArgs.cs
new file mode 100644
index 0000000000..2f5996cc6a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InsertionCursorEventArgs.cs
@@ -0,0 +1,51 @@
+//
+// InsertionCursorEventArgs.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Ide.Editor
+{
+ [Serializable]
+ public sealed class InsertionCursorEventArgs : EventArgs
+ {
+ public bool Success {
+ get;
+ private set;
+ }
+
+ public InsertionPoint InsertionPoint {
+ get;
+ private set;
+ }
+
+ public InsertionCursorEventArgs (bool success, InsertionPoint insertionPoint)
+ {
+ Success = success;
+ InsertionPoint = insertionPoint;
+ }
+ }
+
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InsertionModeOptions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InsertionModeOptions.cs
new file mode 100644
index 0000000000..c65e4cea08
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InsertionModeOptions.cs
@@ -0,0 +1,88 @@
+//
+// InsertionModeOptions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Ide.Editor
+{
+ /// <summary>
+ /// This class contains information the editor needs to initiate the insertion mode.
+ /// </summary>
+ public sealed class InsertionModeOptions
+ {
+ /// <summary>
+ /// A user visible string describing this operation.
+ /// </summary>
+ public string Operation {
+ get;
+ private set;
+ }
+
+ /// <summary>
+ /// The list of insertion points that are used for the insertion mode. The caret is only able to move between
+ /// the insertion points.
+ /// </summary>
+ public IList<InsertionPoint> InsertionPoints {
+ get;
+ private set;
+ }
+
+ /// <summary>
+ /// That's the action that is started after the insertion mode ended.
+ /// </summary>
+ public Action<InsertionCursorEventArgs> ModeExitedAction {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// Gets or sets the first selected insertion point. The default value is 0.
+ /// </summary>
+ public int FirstSelectedInsertionPoint {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MonoDevelop.Ide.Editor.InsertionModeOptions"/> class.
+ /// </summary>
+ /// <param name="operation">A user visible string describing this operation.</param>
+ /// <param name="insertionPoints">The list of insertion points that are used for the insertion mode.</param>
+ /// <param name="modeExitedAction">The action that is started after the exit mode ended.</param>
+ public InsertionModeOptions (string operation, IList<InsertionPoint> insertionPoints, Action<InsertionCursorEventArgs> modeExitedAction)
+ {
+ if (operation == null)
+ throw new ArgumentNullException ("operation");
+ if (insertionPoints == null)
+ throw new ArgumentNullException ("insertionPoints");
+ if (modeExitedAction == null)
+ throw new ArgumentNullException ("modeExitedAction");
+ Operation = operation;
+ InsertionPoints = insertionPoints;
+ ModeExitedAction = modeExitedAction;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InsertionPoint.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InsertionPoint.cs
new file mode 100644
index 0000000000..7bf2808146
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InsertionPoint.cs
@@ -0,0 +1,119 @@
+//
+// InsertionPoint.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.CodeFormatting;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public enum NewLineInsertion
+ {
+ None,
+ Eol,
+ BlankLine
+ }
+
+ public sealed class InsertionPoint
+ {
+ public DocumentLocation Location {
+ get;
+ set;
+ }
+
+ public NewLineInsertion LineBefore { get; set; }
+ public NewLineInsertion LineAfter { get; set; }
+
+ public InsertionPoint (DocumentLocation location, NewLineInsertion lineBefore, NewLineInsertion lineAfter)
+ {
+ this.Location = location;
+ this.LineBefore = lineBefore;
+ this.LineAfter = lineAfter;
+ }
+
+ public override string ToString ()
+ {
+ return string.Format ("[InsertionPoint: Location={0}, LineBefore={1}, LineAfter={2}]", Location, LineBefore, LineAfter);
+ }
+
+ public void InsertNewLine (ITextDocument editor, NewLineInsertion insertion, ref int offset)
+ {
+ string str = null;
+ switch (insertion) {
+ case NewLineInsertion.Eol:
+ str = editor.GetEolMarker ();
+ break;
+ case NewLineInsertion.BlankLine:
+ str = editor.GetEolMarker () + editor.GetEolMarker ();
+ break;
+ default:
+ return;
+ }
+
+ editor.InsertText (offset, str);
+ offset += str.Length;
+ }
+
+ public int Insert (TextEditor editor, DocumentContext ctx, string text)
+ {
+ int offset = editor.LocationToOffset (Location);
+ using (var undo = editor.OpenUndoGroup ()) {
+
+ var line = editor.GetLineByOffset (offset);
+ int insertionOffset = line.Offset + Location.Column - 1;
+ offset = insertionOffset;
+ InsertNewLine (editor, LineBefore, ref offset);
+ int result = offset - insertionOffset;
+
+ editor.InsertText (offset, text);
+ offset += text.Length;
+ InsertNewLine (editor, LineAfter, ref offset);
+ CodeFormatterService.Format (editor, ctx, TextSegment.FromBounds (insertionOffset - 1, offset));
+ return result;
+ }
+ }
+
+ public int Insert (ITextDocument editor, string text)
+ {
+ int offset = editor.LocationToOffset (Location);
+ using (var undo = editor.OpenUndoGroup ()) {
+
+ // TODO: Run formatter !!!
+ // text = editor.FormatString (Location, text);
+
+ var line = editor.GetLineByOffset (offset);
+ int insertionOffset = line.Offset + Location.Column - 1;
+ offset = insertionOffset;
+ InsertNewLine (editor, LineBefore, ref offset);
+ int result = offset - insertionOffset;
+
+ editor.InsertText (offset, text);
+ offset += text.Length;
+ InsertNewLine (editor, LineAfter, ref offset);
+ return result;
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/IEditorActionHost.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/IEditorActionHost.cs
new file mode 100644
index 0000000000..f95b0607fe
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/IEditorActionHost.cs
@@ -0,0 +1,123 @@
+//
+// ITextEditor.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+
+namespace MonoDevelop.Ide.Editor
+{
+ interface IEditorActionHost
+ {
+ void SwitchCaretMode ();
+
+ void InsertTab ();
+
+ void RemoveTab ();
+
+ void InsertNewLine ();
+
+ void DeletePreviousWord ();
+
+ void DeleteNextWord ();
+
+ void DeletePreviousSubword ();
+
+ void DeleteNextSubword ();
+
+ void StartCaretPulseAnimation ();
+
+ void RecenterEditor ();
+
+ void JoinLines ();
+
+ void MoveNextSubWord ();
+
+ void MovePrevSubWord ();
+
+ void MoveNextWord ();
+
+ void MovePrevWord ();
+
+ void PageUp ();
+
+ void PageDown ();
+
+ void MoveCaretDown ();
+
+ void MoveCaretUp ();
+
+ void MoveCaretRight ();
+
+ void MoveCaretLeft ();
+
+ void MoveCaretToLineEnd ();
+
+ void MoveCaretToLineStart ();
+
+ void MoveCaretToDocumentStart ();
+
+ void MoveCaretToDocumentEnd ();
+
+ void Backspace ();
+
+ void Delete ();
+
+ void ClipboardCopy ();
+
+ void ClipboardCut ();
+
+ void ClipboardPaste ();
+
+ void SelectAll ();
+
+ void NewLine ();
+
+ void Undo ();
+
+ void Redo ();
+
+ void DeleteCurrentLine ();
+
+ void DeleteCurrentLineToEnd ();
+
+ void ScrollLineUp ();
+
+ void ScrollLineDown ();
+
+ void ScrollPageUp ();
+
+ void ScrollPageDown ();
+
+ void MoveBlockUp ();
+
+ void MoveBlockDown ();
+
+ void ToggleBlockSelectionMode ();
+
+ void IndentSelection ();
+
+ void UnIndentSelection ();
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextEditorFactory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextEditorFactory.cs
new file mode 100644
index 0000000000..4b88445dab
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextEditorFactory.cs
@@ -0,0 +1,44 @@
+//
+// ITextEditorFactory.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using MonoDevelop.Core.Text;
+
+namespace MonoDevelop.Ide.Editor
+{
+ interface ITextEditorFactory
+ {
+ ITextDocument CreateNewDocument ();
+ ITextDocument CreateNewDocument (ITextSource textSource, string fileName, string mimeType);
+
+ IReadonlyTextDocument CreateNewReadonlyDocument (ITextSource textSource, string fileName, string mimeType);
+
+ ITextEditorImpl CreateNewEditor ();
+ ITextEditorImpl CreateNewEditor (IReadonlyTextDocument document);
+
+ string[] GetSyntaxProperties (string mimeType, string name);
+ }
+
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextEditorImpl.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextEditorImpl.cs
new file mode 100644
index 0000000000..01cb63e9ad
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextEditorImpl.cs
@@ -0,0 +1,221 @@
+//
+// ITextEditorImpl.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+using System.Collections.Generic;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide.Editor.Extension;
+using MonoDevelop.Ide.Editor.Highlighting;
+using MonoDevelop.Components;
+using Xwt;
+using System.Collections.Immutable;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public enum EditMode
+ {
+ Edit,
+ TextLink,
+ CursorInsertion
+ }
+
+ interface ITextEditorImpl : IDisposable
+ {
+ ViewContent ViewContent { get; }
+
+ string ContentName { get; set; }
+
+ string ContextMenuPath { get; set; }
+
+ EditMode EditMode { get; }
+
+ ITextEditorOptions Options { get; set; }
+
+ IReadonlyTextDocument Document { get; }
+
+ DocumentLocation CaretLocation { get; set; }
+
+ SemanticHighlighting SemanticHighlighting { get; set; }
+
+ int CaretOffset { get; set; }
+
+ bool IsSomethingSelected { get; }
+
+ SelectionMode SelectionMode { get; }
+
+ ISegment SelectionRange { get; set; }
+ int SelectionAnchorOffset { get; set; }
+ int SelectionLeadOffset { get; set; }
+
+ DocumentRegion SelectionRegion { get; set; }
+
+ void SetSelection (int anchorOffset, int leadOffset);
+
+ event EventHandler SelectionChanged;
+
+ event EventHandler CaretPositionChanged;
+
+ event EventHandler<MouseMovedEventArgs> MouseMoved;
+
+ event EventHandler VAdjustmentChanged;
+
+ event EventHandler HAdjustmentChanged;
+
+ void ClearSelection ();
+
+ void CenterToCaret ();
+
+ void StartCaretPulseAnimation ();
+
+ int EnsureCaretIsNotVirtual ();
+
+ void FixVirtualIndentation ();
+
+ IEditorActionHost Actions { get; }
+
+ ITextMarkerFactory TextMarkerFactory { get; }
+
+ event EventHandler BeginAtomicUndoOperation;
+
+ event EventHandler EndAtomicUndoOperation;
+
+ object CreateNativeControl ();
+
+ void RunWhenLoaded (Action action);
+
+ string FormatString (int offset, string code);
+
+ void StartInsertionMode (InsertionModeOptions insertionModeOptions);
+
+ void StartTextLinkMode (TextLinkModeOptions textLinkModeOptions);
+
+ double LineHeight { get; }
+
+ DocumentLocation PointToLocation (double xp, double yp, bool endAtEol = false);
+
+ Xwt.Point LocationToPoint (int line, int column);
+
+ void AddMarker (IDocumentLine line, ITextLineMarker lineMarker);
+
+ void RemoveMarker (ITextLineMarker lineMarker);
+
+ void ScrollTo (int offset);
+
+ void CenterTo (int offset);
+
+ EditSession CurrentSession {
+ get;
+ }
+
+ void StartSession (EditSession session);
+
+ void EndSession ();
+
+ string GetVirtualIndentationString (int lineNumber);
+
+ IEnumerable<ITextLineMarker> GetLineMarkers (IDocumentLine line);
+
+ #region Text segment markers
+
+ IEnumerable<ITextSegmentMarker> GetTextSegmentMarkersAt (ISegment segment);
+
+ IEnumerable<ITextSegmentMarker> GetTextSegmentMarkersAt (int offset);
+
+ /// <summary>
+ /// Adds a marker to the document.
+ /// </summary>
+ void AddMarker (ITextSegmentMarker marker);
+
+ /// <summary>
+ /// Removes a marker from the document.
+ /// </summary>
+ /// <returns><c>true</c>, if marker was removed, <c>false</c> otherwise.</returns>
+ /// <param name="marker">Marker.</param>
+ bool RemoveMarker (ITextSegmentMarker marker);
+
+ #endregion
+
+ IFoldSegment CreateFoldSegment (int offset, int length, bool isFolded = false);
+
+ void SetFoldings (IEnumerable<IFoldSegment> foldings);
+
+ IEnumerable<IFoldSegment> GetFoldingsContaining (int offset);
+
+ IEnumerable<IFoldSegment> GetFoldingsIn (int offset, int length);
+
+ string GetPangoMarkup (int offset, int length, bool fitIdeStyle = false);
+
+ void SetIndentationTracker (IndentationTracker indentationTracker);
+ void SetSelectionSurroundingProvider (SelectionSurroundingProvider surroundingProvider);
+ void SetTextPasteHandler (TextPasteHandler textPasteHandler);
+
+ event EventHandler<LineEventArgs> LineChanged;
+ event EventHandler<LineEventArgs> LineInserted;
+ event EventHandler<LineEventArgs> LineRemoved;
+
+ #region Internal use only API (do not mirror in TextEditor)
+
+ TextEditorExtension EditorExtension {
+ get;
+ set;
+ }
+
+ IEnumerable<TooltipProvider> TooltipProvider {
+ get;
+ }
+
+ void ClearTooltipProviders ();
+
+ void AddTooltipProvider (TooltipProvider provider);
+
+ void RemoveTooltipProvider (TooltipProvider provider);
+
+ Xwt.Point GetEditorWindowOrigin ();
+
+ Xwt.Rectangle GetEditorAllocation ();
+
+ void InformLoadComplete ();
+
+ void SetUsageTaskProviders (IEnumerable<UsageProviderEditorExtension> providers);
+
+ void SetQuickTaskProviders (IEnumerable<IQuickTaskProvider> providers);
+ #endregion
+
+ double ZoomLevel { get; set; }
+ bool SuppressTooltips { get; set; }
+
+ event EventHandler ZoomLevelChanged;
+
+ void AddOverlay (Control messageOverlayContent, Func<int> sizeFunc);
+ void RemoveOverlay (Control messageOverlayContent);
+ void UpdateBraceMatchingResult (BraceMatchingResult? result);
+
+ IEnumerable<IDocumentLine> VisibleLines { get; }
+
+ event EventHandler<LineEventArgs> LineShown;
+ event EventHandler FocusLost;
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextMarkerFactory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextMarkerFactory.cs
new file mode 100644
index 0000000000..68f0ac8651
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/InternalExtensionAPI/ITextMarkerFactory.cs
@@ -0,0 +1,58 @@
+//
+// ITextMarkerFactory.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Editor.Extension;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public enum LinkRequest
+ {
+ SameView,
+ RequestNewView
+ }
+
+ interface ITextMarkerFactory
+ {
+ #region Line marker
+ IUrlTextLineMarker CreateUrlTextMarker (TextEditor editor, IDocumentLine line, string value, UrlType url, string syntax, int startCol, int endCol);
+ ICurrentDebugLineTextMarker CreateCurrentDebugLineTextMarker (TextEditor editor, int offset, int length);
+ ITextLineMarker CreateAsmLineMarker (TextEditor editor);
+ IUnitTestMarker CreateUnitTestMarker (TextEditor editor, UnitTestMarkerHost host, UnitTestLocation unitTestLocation);
+ IMessageBubbleLineMarker CreateMessageBubbleLineMarker (TextEditor editor);
+ #endregion
+
+ #region Segment marker
+ ITextSegmentMarker CreateUsageMarker (TextEditor editor, Usage usage);
+ ILinkTextMarker CreateLinkMarker (TextEditor editor, int offset, int length, Action<LinkRequest> activateLink);
+
+ IGenericTextSegmentMarker CreateGenericTextSegmentMarker (TextEditor editor, TextSegmentMarkerEffect effect, int offset, int length);
+ ISmartTagMarker CreateSmartTagMarker (TextEditor editor, int offset, DocumentLocation realLocation);
+ IErrorMarker CreateErrorMarker (TextEditor editor, Error info, int offset, int length);
+ #endregion
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/LineEventArgs.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/LineEventArgs.cs
new file mode 100644
index 0000000000..3dd6e0cc56
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/LineEventArgs.cs
@@ -0,0 +1,48 @@
+//
+// LineEventArgs.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public class LineEventArgs : System.EventArgs
+ {
+ readonly IDocumentLine line;
+
+ public IDocumentLine Line {
+ get {
+ return line;
+ }
+ }
+
+ public LineEventArgs (IDocumentLine line)
+ {
+ if (line == null)
+ throw new ArgumentNullException ("line");
+ this.line = line;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/MessageBubbles/MessageBubbleCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/MessageBubbles/MessageBubbleCommands.cs
new file mode 100644
index 0000000000..2e81871cff
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/MessageBubbles/MessageBubbleCommands.cs
@@ -0,0 +1,77 @@
+//
+// MessageBubbleCommands.cs
+//
+// Author:
+// Mike Krüger <mkrueger@novell.com>
+//
+// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.Ide.Editor
+{
+ enum MessageBubbleCommands
+ {
+ Toggle,
+ HideIssues,
+ ToggleIssues
+ }
+
+ class HideIssuesHandler : CommandHandler
+ {
+ protected override void Update (CommandInfo info)
+ {
+ base.Update (info);
+ info.Text = IdeApp.Preferences.DefaultHideMessageBubbles ? GettextCatalog.GetString ("_Show Message Bubbles") : GettextCatalog.GetString ("_Hide Message Bubbles");
+ }
+
+ protected override void Run (object data)
+ {
+ IdeApp.Preferences.DefaultHideMessageBubbles.Value = !IdeApp.Preferences.DefaultHideMessageBubbles.Value;
+ }
+ }
+
+ class ToggleIssuesHandler : CommandHandler
+ {
+ protected override void Run (object data)
+ {
+ Action action = data as Action;
+ if (action != null)
+ action ();
+ }
+
+ protected override void Update (CommandArrayInfo ainfo)
+ {
+ CommandInfo info = ainfo.Add (GettextCatalog.GetString ("_Errors & Warnings"), new Action (delegate {
+ MonoDevelop.Ide.IdeApp.Preferences.ShowMessageBubbles.Value = MonoDevelop.Ide.ShowMessageBubbles.ForErrorsAndWarnings;
+ }));
+ info.Checked = MonoDevelop.Ide.IdeApp.Preferences.ShowMessageBubbles == MonoDevelop.Ide.ShowMessageBubbles.ForErrorsAndWarnings;
+
+ info = ainfo.Add (GettextCatalog.GetString ("E_rrors only"), new Action (delegate {
+ MonoDevelop.Ide.IdeApp.Preferences.ShowMessageBubbles.Value = MonoDevelop.Ide.ShowMessageBubbles.ForErrors;
+ }));
+ info.Checked = MonoDevelop.Ide.IdeApp.Preferences.ShowMessageBubbles.Value == MonoDevelop.Ide.ShowMessageBubbles.ForErrors;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/IProjectionExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/IProjectionExtension.cs
new file mode 100644
index 0000000000..b995eaabe1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/IProjectionExtension.cs
@@ -0,0 +1,39 @@
+//
+// IProjectionExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Ide.Editor.Projection
+{
+ interface IProjectionExtension
+ {
+ IReadOnlyList<Projection> Projections {
+ get;
+ set;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedCompletionExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedCompletionExtension.cs
new file mode 100644
index 0000000000..741fabe3c2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedCompletionExtension.cs
@@ -0,0 +1,465 @@
+//
+// ProjectedCompletionExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using MonoDevelop.Ide.Editor.Extension;
+using System.Collections.Generic;
+using MonoDevelop.Ide.CodeCompletion;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Ide.Editor.Projection
+{
+ sealed class ProjectedCompletionExtension : CompletionTextEditorExtension, IProjectionExtension
+ {
+ DocumentContext ctx;
+ IReadOnlyList<Projection> projections;
+
+ public IReadOnlyList<Projection> Projections {
+ get {
+ return projections;
+ }
+ set {
+ projections = value;
+ }
+ }
+
+ public ProjectedCompletionExtension (DocumentContext ctx, IReadOnlyList<Projection> projections)
+ {
+ if (projections == null)
+ throw new ArgumentNullException ("projections");
+ this.ctx = ctx;
+ this.projections = projections;
+ }
+
+ public override bool IsValidInContext (DocumentContext context)
+ {
+ var pctx = context as ProjectedDocumentContext;
+ if (pctx == null)
+ return false;
+ return pctx.ProjectedEditor.GetContent<CompletionTextEditorExtension> () != null;
+ }
+
+ internal protected override bool IsActiveExtension ()
+ {
+ return IsInProjection ();
+ }
+
+ bool IsInProjection ()
+ {
+ int offset = Editor.CaretOffset;
+ foreach (var p in projections) {
+ foreach (var seg in p.ProjectedSegments) {
+ if (seg.ContainsOriginal (offset))
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ Projection GetProjectionAt (int offset)
+ {
+ foreach (var projection in projections) {
+ foreach (var seg in projection.ProjectedSegments) {
+ if (seg.ContainsOriginal (offset)) {
+ projection.ProjectedEditor.CaretOffset = seg.FromOriginalToProjected (offset);
+ return projection;
+ }
+ }
+ }
+ return null;
+ }
+
+ CompletionTextEditorExtension GetExtensionAt (int offset)
+ {
+ var projection = GetProjectionAt (offset);
+ if (projection != null) {
+ var result = projection.ProjectedEditor.GetContent<CompletionTextEditorExtension> ();
+ if (result != null && CompletionWidget != null) {
+ result.CompletionWidget = new ProjectedCompletionWidget (CompletionWidget, projection);
+ if (result.CurrentCompletionContext == null)
+ result.CurrentCompletionContext = result.CompletionWidget.CurrentCodeCompletionContext;
+ }
+ result.Next = Next;
+ return result;
+ }
+ return null;
+ }
+
+ class ProjectedCompletionWidget : ICompletionWidget
+ {
+ readonly ICompletionWidget completionWidget;
+ readonly Projection projection;
+
+ public ProjectedCompletionWidget (ICompletionWidget completionWidget, Projection projection)
+ {
+ if (completionWidget == null)
+ throw new ArgumentNullException ("completionWidget");
+ if (projection == null)
+ throw new ArgumentNullException ("projection");
+ this.projection = projection;
+ this.completionWidget = completionWidget;
+ }
+
+ #region ICompletionWidget implementation
+ public double ZoomLevel {
+ get {
+ return completionWidget.ZoomLevel;
+ }
+ }
+
+ event EventHandler ICompletionWidget.CompletionContextChanged {
+ add {
+ completionWidget.CompletionContextChanged += value;
+ }
+ remove {
+ completionWidget.CompletionContextChanged -= value;
+ }
+ }
+
+ string ICompletionWidget.GetText (int startOffset, int endOffset)
+ {
+ return completionWidget.GetText(startOffset, endOffset);
+ }
+
+ char ICompletionWidget.GetChar (int offset)
+ {
+ return projection.ProjectedEditor.GetCharAt (offset);
+ }
+
+ void ICompletionWidget.Replace (int offset, int count, string text)
+ {
+ completionWidget.Replace (offset, count, text);
+ }
+
+ int ConvertOffset (int triggerOffset)
+ {
+ int result = triggerOffset;
+ foreach (var seg in projection.ProjectedSegments) {
+ if (seg.ContainsProjected (result)) {
+ result = seg.FromProjectedToOriginal (result);
+ break;
+ }
+ }
+ return result;
+ }
+
+ int ProjectOffset (int offset)
+ {
+ int result = offset;
+ foreach (var seg in projection.ProjectedSegments) {
+ if (seg.ContainsOriginal (result)) {
+ result = seg.FromOriginalToProjected (result);
+ break;
+ }
+ }
+ return result;
+
+ }
+
+ CodeCompletionContext ICompletionWidget.CreateCodeCompletionContext (int triggerOffset)
+ {
+ var originalTriggerOffset = ConvertOffset (triggerOffset);
+ var completionContext = completionWidget.CreateCodeCompletionContext (originalTriggerOffset);
+ return ConvertContext (completionContext, projection);
+ }
+
+ string ICompletionWidget.GetCompletionText (CodeCompletionContext ctx)
+ {
+ return completionWidget.GetCompletionText (ImportContext (ctx, projection));
+ }
+
+ void ICompletionWidget.SetCompletionText (CodeCompletionContext ctx, string partial_word, string complete_word)
+ {
+ completionWidget.SetCompletionText (ImportContext (ctx, projection), partial_word, complete_word);
+ }
+
+ void ICompletionWidget.SetCompletionText (CodeCompletionContext ctx, string partial_word, string complete_word, int completeWordOffset)
+ {
+ completionWidget.SetCompletionText (ImportContext (ctx, projection), partial_word, complete_word, completeWordOffset);
+ }
+
+ CodeCompletionContext ICompletionWidget.CurrentCodeCompletionContext {
+ get {
+ return ConvertContext (completionWidget.CurrentCodeCompletionContext, projection);
+ }
+ }
+
+ int ICompletionWidget.CaretOffset {
+ get {
+ return projection.ProjectedEditor.CaretOffset = ConvertOffset (completionWidget.CaretOffset);
+ }
+ set {
+ completionWidget.CaretOffset = ProjectOffset (value);
+ }
+ }
+
+ int ICompletionWidget.TextLength {
+ get {
+ return projection.ProjectedEditor.Length;
+ }
+ }
+
+ int ICompletionWidget.SelectedLength {
+ get {
+ return completionWidget.SelectedLength;
+ }
+ }
+
+ Gtk.Style ICompletionWidget.GtkStyle {
+ get {
+ return completionWidget.GtkStyle;
+ }
+ }
+ #endregion
+ }
+
+ CompletionTextEditorExtension GetCurrentExtension ()
+ {
+ return GetExtensionAt (Editor.CaretOffset);
+ }
+
+ public override bool CanRunCompletionCommand ()
+ {
+ var projectedExtension = GetCurrentExtension ();
+ if (projectedExtension == null)
+ return false;
+ return projectedExtension.CanRunCompletionCommand ();
+ }
+
+ public override Task<MonoDevelop.Ide.CodeCompletion.ICompletionDataList> CodeCompletionCommand (MonoDevelop.Ide.CodeCompletion.CodeCompletionContext completionContext)
+ {
+ var projectedExtension = GetExtensionAt (completionContext.TriggerOffset);
+ if (projectedExtension == null)
+ return null;
+ return projectedExtension.CodeCompletionCommand (ConvertContext (completionContext));
+ }
+
+ public override bool CanRunParameterCompletionCommand ()
+ {
+ var projectedExtension = GetCurrentExtension ();
+ if (projectedExtension == null)
+ return false;
+ return projectedExtension.CanRunParameterCompletionCommand ();
+ }
+
+ public override string CompletionLanguage {
+ get {
+ var projectedExtension = GetCurrentExtension ();
+ if (projectedExtension == null)
+ return base.CompletionLanguage;
+ return projectedExtension.CompletionLanguage;
+ }
+ }
+
+ public override bool GetCompletionCommandOffset (out int cpos, out int wlen)
+ {
+ var projectedExtension = GetCurrentExtension ();
+ if (projectedExtension == null) {
+ cpos = 0;
+ wlen = 0;
+ return false;
+ }
+ return projectedExtension.GetCompletionCommandOffset (out cpos, out wlen);
+ }
+
+ public override Task<int> GetCurrentParameterIndex (int startOffset, System.Threading.CancellationToken token)
+ {
+ var projectedExtension = GetExtensionAt (startOffset);
+ if (projectedExtension == null)
+ return Task.FromResult (-1);
+ return projectedExtension.GetCurrentParameterIndex (startOffset, token);
+ }
+
+ public override Task<int> GuessBestMethodOverload (ParameterHintingResult provider, int currentOverload, System.Threading.CancellationToken token)
+ {
+ var projectedExtension = GetCurrentExtension ();
+ if (projectedExtension == null)
+ return Task.FromResult (-1);
+ return projectedExtension.GuessBestMethodOverload (provider, currentOverload, token);
+ }
+
+ public override System.Threading.Tasks.Task<MonoDevelop.Ide.CodeCompletion.ICompletionDataList> HandleCodeCompletionAsync (MonoDevelop.Ide.CodeCompletion.CodeCompletionContext completionContext, char completionChar, System.Threading.CancellationToken token)
+ {
+ var projectedExtension = GetExtensionAt (completionContext.TriggerOffset);
+ if (projectedExtension == null)
+ return null;
+
+ return projectedExtension.HandleCodeCompletionAsync (ConvertContext (completionContext), completionChar, token);
+ }
+
+ public override Task<ParameterHintingResult> HandleParameterCompletionAsync (MonoDevelop.Ide.CodeCompletion.CodeCompletionContext completionContext, char completionChar, System.Threading.CancellationToken token)
+ {
+ var projectedExtension = GetExtensionAt (completionContext.TriggerOffset);
+ if (projectedExtension == null)
+ return Task.FromResult<ParameterHintingResult> (null);
+ return projectedExtension.HandleParameterCompletionAsync (ConvertContext (completionContext), completionChar, token);
+ }
+
+ public override bool KeyPress (KeyDescriptor descriptor)
+ {
+ var task = ctx.GetPartialProjectionsAsync ();
+ if (task != null)
+ projections = task.Result;
+ var projectedExtension = GetCurrentExtension();
+ if (projectedExtension != null) {
+ return projectedExtension.KeyPress (descriptor);
+ }
+ return base.KeyPress (descriptor);
+ }
+
+ public override Task<ParameterHintingResult> ParameterCompletionCommand (MonoDevelop.Ide.CodeCompletion.CodeCompletionContext completionContext)
+ {
+ var projectedExtension = GetExtensionAt (completionContext.TriggerOffset);
+ if (projectedExtension == null)
+ return null;
+ return projectedExtension.ParameterCompletionCommand (ConvertContext (completionContext));
+ }
+
+ public override void RunCompletionCommand ()
+ {
+ var projectedExtension = GetCurrentExtension();
+ if (projectedExtension == null)
+ return;
+ projectedExtension.RunCompletionCommand ();
+ }
+
+ public override void RunParameterCompletionCommand ()
+ {
+ var projectedExtension = GetCurrentExtension();
+ if (projectedExtension == null)
+ return;
+
+ projectedExtension.RunParameterCompletionCommand ();
+ }
+
+ public override void RunShowCodeTemplatesWindow ()
+ {
+ var projectedExtension = GetCurrentExtension();
+ if (projectedExtension == null)
+ return;
+ projectedExtension.RunShowCodeTemplatesWindow ();
+ }
+
+ public override MonoDevelop.Ide.CodeCompletion.ICompletionDataList ShowCodeSurroundingsCommand (MonoDevelop.Ide.CodeCompletion.CodeCompletionContext completionContext)
+ {
+ var projectedExtension = GetExtensionAt (completionContext.TriggerOffset);
+ if (projectedExtension == null)
+ return null;
+ return projectedExtension.ShowCodeSurroundingsCommand (ConvertContext (completionContext));
+ }
+
+ public override MonoDevelop.Ide.CodeCompletion.ICompletionDataList ShowCodeTemplatesCommand (MonoDevelop.Ide.CodeCompletion.CodeCompletionContext completionContext)
+ {
+ var projectedExtension = GetExtensionAt (completionContext.TriggerOffset);
+ if (projectedExtension == null)
+ return null;
+ return projectedExtension.ShowCodeTemplatesCommand (ConvertContext (completionContext));
+ }
+
+ CodeCompletionContext ConvertContext (CodeCompletionContext completionContext)
+ {
+ var projection = GetProjectionAt (completionContext.TriggerOffset);
+ return ConvertContext (completionContext, projection);
+ }
+
+ static CodeCompletionContext ConvertContext (CodeCompletionContext completionContext, Projection projection)
+ {
+ int offset = completionContext.TriggerOffset;
+ int line = completionContext.TriggerLine;
+ int lineOffset = completionContext.TriggerLineOffset;
+
+ if (projection != null) {
+ foreach (var seg in projection.ProjectedSegments) {
+ if (seg.ContainsOriginal (offset)) {
+ offset = seg.FromOriginalToProjected (offset);
+ var loc = projection.ProjectedEditor.OffsetToLocation (offset);
+ line = loc.Line;
+ lineOffset = loc.Column - 1;
+ }
+ }
+ }
+
+ return new MonoDevelop.Ide.CodeCompletion.CodeCompletionContext {
+ TriggerOffset = offset,
+ TriggerLine = line,
+ TriggerLineOffset = lineOffset,
+ TriggerXCoord = completionContext.TriggerXCoord,
+ TriggerYCoord = completionContext.TriggerYCoord,
+ TriggerTextHeight = completionContext.TriggerTextHeight,
+ TriggerWordLength = completionContext.TriggerWordLength
+ };
+ }
+
+ static CodeCompletionContext ImportContext (CodeCompletionContext completionContext, Projection projection)
+ {
+ int offset = completionContext.TriggerOffset;
+ int line = completionContext.TriggerLine;
+ int lineOffset = completionContext.TriggerLineOffset;
+
+ if (projection != null) {
+ foreach (var seg in projection.ProjectedSegments) {
+ if (seg.ContainsProjected (offset)) {
+ offset = seg.FromProjectedToOriginal (offset);
+ var loc = projection.ProjectedEditor.OffsetToLocation (offset);
+ line = loc.Line;
+ lineOffset = loc.Column - 1;
+ break;
+ }
+ }
+ }
+
+ return new MonoDevelop.Ide.CodeCompletion.CodeCompletionContext {
+ TriggerOffset = offset,
+ TriggerLine = line,
+ TriggerLineOffset = lineOffset,
+ TriggerXCoord = completionContext.TriggerXCoord,
+ TriggerYCoord = completionContext.TriggerYCoord,
+ TriggerTextHeight = completionContext.TriggerTextHeight,
+ TriggerWordLength = completionContext.TriggerWordLength
+ };
+ }
+
+ internal protected override void OnCompletionContextChanged (object o, EventArgs a)
+ {
+ if (!IsActiveExtension ())
+ return;
+ var ext = GetExtensionAt (Editor.CaretOffset);
+ if (ext != null) {
+ ext.CurrentCompletionContext = ext.CompletionWidget.CurrentCodeCompletionContext;
+ }
+ }
+
+ internal protected override void HandlePositionChanged (object sender, EventArgs e)
+ {
+ if (!IsActiveExtension ())
+ return;
+ var ext = GetExtensionAt (Editor.CaretOffset);
+ if (ext != null)
+ ext.HandlePositionChanged (sender, e);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedDocumentContext.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedDocumentContext.cs
new file mode 100644
index 0000000000..b188468734
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedDocumentContext.cs
@@ -0,0 +1,151 @@
+//
+// ProjectedDocumentContext.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide.Editor;
+using System.Collections.Immutable;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide.TypeSystem;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Ide.Editor.Projection
+{
+
+ class ProjectedDocumentContext : DocumentContext
+ {
+ DocumentContext originalContext;
+ TextEditor projectedEditor;
+ ParsedDocument parsedDocument;
+
+ public TextEditor ProjectedEditor {
+ get {
+ return projectedEditor;
+ }
+ }
+
+ public DocumentContext OriginalContext {
+ get {
+ return originalContext;
+ }
+ }
+
+ Microsoft.CodeAnalysis.Document projectedDocument;
+
+ public ProjectedDocumentContext (TextEditor projectedEditor, DocumentContext originalContext)
+ {
+ if (projectedEditor == null)
+ throw new ArgumentNullException ("projectedEditor");
+ if (originalContext == null)
+ throw new ArgumentNullException ("originalContext");
+ this.projectedEditor = projectedEditor;
+ this.originalContext = originalContext;
+
+ if (originalContext.Project != null) {
+ var originalProjectId = TypeSystemService.GetProjectId (originalContext.Project);
+ if (originalProjectId != null) {
+ var originalProject = TypeSystemService.Workspace.CurrentSolution.GetProject (originalProjectId);
+ if (originalProject != null) {
+ projectedDocument = originalProject.AddDocument (
+ projectedEditor.FileName,
+ projectedEditor
+ );
+ }
+ }
+ }
+
+ projectedEditor.TextChanged += delegate(object sender, TextChangeEventArgs e) {
+ if (projectedDocument != null)
+ projectedDocument = projectedDocument.WithText (projectedEditor);
+ ReparseDocument ();
+ };
+
+ ReparseDocument ();
+ }
+
+ #region implemented abstract members of DocumentContext
+ public override void AttachToProject (MonoDevelop.Projects.Project project)
+ {
+ }
+
+ public override void ReparseDocument ()
+ {
+ ReparseDocumentInternal ();
+ }
+
+ Task ReparseDocumentInternal ()
+ {
+ var options = new ParseOptions {
+ FileName = projectedEditor.FileName,
+ Content = projectedEditor,
+ Project = Project,
+ RoslynDocument = projectedDocument,
+ OldParsedDocument = parsedDocument
+ };
+ return TypeSystemService.ParseFile (options, projectedEditor.MimeType).ContinueWith (t => {
+ parsedDocument = t.Result;
+ base.OnDocumentParsed (EventArgs.Empty);
+ });
+ }
+
+ public override Microsoft.CodeAnalysis.Options.OptionSet GetOptionSet ()
+ {
+ return originalContext.GetOptionSet ();
+ }
+
+ public override async Task<MonoDevelop.Ide.TypeSystem.ParsedDocument> UpdateParseDocument ()
+ {
+ await ReparseDocumentInternal ();
+ return parsedDocument;
+ }
+
+ public override string Name {
+ get {
+ return projectedEditor.FileName;
+ }
+ }
+
+ public override MonoDevelop.Projects.Project Project {
+ get {
+ return originalContext.Project;
+ }
+ }
+
+ public override Microsoft.CodeAnalysis.Document AnalysisDocument {
+ get {
+
+ return projectedDocument;
+ }
+ }
+
+ public override MonoDevelop.Ide.TypeSystem.ParsedDocument ParsedDocument {
+ get {
+ return parsedDocument;
+ }
+ }
+ #endregion
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedFilterCompletionTextEditorExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedFilterCompletionTextEditorExtension.cs
new file mode 100644
index 0000000000..8174b221ce
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedFilterCompletionTextEditorExtension.cs
@@ -0,0 +1,204 @@
+//
+// ProjectedFilterCompletionTextEditorExtension.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using MonoDevelop.Ide.Editor.Extension;
+
+namespace MonoDevelop.Ide.Editor.Projection
+{
+ sealed class ProjectedFilterCompletionTextEditorExtension : CompletionTextEditorExtension, IProjectionExtension
+ {
+ CompletionTextEditorExtension completionTextEditorExtension;
+ IReadOnlyList<Projection> projections;
+
+ IReadOnlyList<Projection> IProjectionExtension.Projections {
+ get {
+ return projections;
+ }
+ set {
+ projections = value;
+ }
+ }
+
+ public ProjectedFilterCompletionTextEditorExtension (CompletionTextEditorExtension completionTextEditorExtension, IReadOnlyList<Projection> projections)
+ {
+ this.completionTextEditorExtension = completionTextEditorExtension;
+ this.projections = projections;
+ }
+
+ internal protected override bool IsActiveExtension ()
+ {
+ return !IsInProjection ();
+ }
+
+ bool IsInProjection ()
+ {
+ int offset = Editor.CaretOffset;
+ foreach (var p in projections) {
+ foreach (var seg in p.ProjectedSegments) {
+ if (seg.ContainsOriginal (offset))
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public override bool KeyPress (KeyDescriptor descriptor)
+ {
+ if (!IsActiveExtension())
+ return Next == null || Next.KeyPress (descriptor);
+ return completionTextEditorExtension.KeyPress (descriptor);
+ }
+
+ public override bool IsValidInContext (DocumentContext context)
+ {
+ if (!IsActiveExtension())
+ return false;
+ return completionTextEditorExtension.IsValidInContext (context);
+ }
+
+ public override Task<int> GetCurrentParameterIndex (int startOffset, System.Threading.CancellationToken token)
+ {
+ if (!IsActiveExtension())
+ return Task.FromResult (-1);
+ return completionTextEditorExtension.GetCurrentParameterIndex (startOffset, token);
+ }
+
+ public override string CompletionLanguage {
+ get {
+ return completionTextEditorExtension.CompletionLanguage;
+ }
+ }
+
+ public override void RunCompletionCommand ()
+ {
+ if (!IsActiveExtension())
+ return;
+ completionTextEditorExtension.RunCompletionCommand ();
+ }
+
+ public override void RunShowCodeTemplatesWindow ()
+ {
+ if (!IsActiveExtension())
+ return;
+ completionTextEditorExtension.RunShowCodeTemplatesWindow ();
+ }
+
+ public override void RunParameterCompletionCommand ()
+ {
+ if (!IsActiveExtension())
+ return;
+ completionTextEditorExtension.RunParameterCompletionCommand ();
+ }
+
+ public override bool CanRunCompletionCommand ()
+ {
+ if (!IsActiveExtension ())
+ return false;
+ return completionTextEditorExtension.CanRunCompletionCommand ();
+ }
+
+ public override bool CanRunParameterCompletionCommand ()
+ {
+ if (!IsActiveExtension ())
+ return false;
+ return completionTextEditorExtension.CanRunParameterCompletionCommand ();
+ }
+
+ public override System.Threading.Tasks.Task<CodeCompletion.ICompletionDataList> HandleCodeCompletionAsync (CodeCompletion.CodeCompletionContext completionContext, char completionChar, System.Threading.CancellationToken token)
+ {
+ return completionTextEditorExtension.HandleCodeCompletionAsync (completionContext, completionChar, token);
+ }
+
+ public override System.Threading.Tasks.Task<CodeCompletion.ParameterHintingResult> HandleParameterCompletionAsync (CodeCompletion.CodeCompletionContext completionContext, char completionChar, System.Threading.CancellationToken token)
+ {
+ return completionTextEditorExtension.HandleParameterCompletionAsync (completionContext, completionChar, token);
+ }
+
+ public override bool GetCompletionCommandOffset (out int cpos, out int wlen)
+ {
+ if (!IsActiveExtension()) {
+ cpos = 0; wlen = 0;
+ return false;
+ }
+ return completionTextEditorExtension.GetCompletionCommandOffset (out cpos, out wlen);
+ }
+
+ public override CodeCompletion.ICompletionDataList ShowCodeSurroundingsCommand (CodeCompletion.CodeCompletionContext completionContext)
+ {
+ if (!IsActiveExtension()) return null;
+ return completionTextEditorExtension.ShowCodeSurroundingsCommand (completionContext);
+ }
+
+ public override CodeCompletion.ICompletionDataList ShowCodeTemplatesCommand (CodeCompletion.CodeCompletionContext completionContext)
+ {
+ if (!IsActiveExtension()) return null;
+ return completionTextEditorExtension.ShowCodeTemplatesCommand (completionContext);
+ }
+
+ public override Task<CodeCompletion.ICompletionDataList> CodeCompletionCommand (CodeCompletion.CodeCompletionContext completionContext)
+ {
+ if (!IsActiveExtension()) return null;
+ return completionTextEditorExtension.CodeCompletionCommand (completionContext);
+ }
+
+ public override Task<CodeCompletion.ParameterHintingResult> ParameterCompletionCommand (CodeCompletion.CodeCompletionContext completionContext)
+ {
+ if (!IsActiveExtension()) return null;
+ return completionTextEditorExtension.ParameterCompletionCommand (completionContext);
+ }
+
+ public override Task<int> GuessBestMethodOverload (CodeCompletion.ParameterHintingResult provider, int currentOverload, System.Threading.CancellationToken token)
+ {
+ if (!IsActiveExtension()) return Task.FromResult (-1);
+ return completionTextEditorExtension.GuessBestMethodOverload (provider, currentOverload, token);
+ }
+
+ internal protected override void OnCompletionContextChanged (object o, EventArgs a)
+ {
+ if (!IsActiveExtension()) return;
+ completionTextEditorExtension.OnCompletionContextChanged (o, a);
+ }
+
+ internal protected override void HandlePositionChanged (object sender, EventArgs e)
+ {
+ if (!IsActiveExtension ())
+ return;
+ completionTextEditorExtension.HandlePositionChanged (sender, e);
+ }
+
+ protected override void Initialize ()
+ {
+ }
+
+ public override void Dispose ()
+ {
+ completionTextEditorExtension.Dispose ();
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedSegment.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedSegment.cs
new file mode 100644
index 0000000000..1453854aff
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedSegment.cs
@@ -0,0 +1,94 @@
+//
+// ProjectedSegment.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+
+namespace MonoDevelop.Ide.Editor.Projection
+{
+ public struct ProjectedSegment
+ {
+ public int Offset {
+ get;
+ private set;
+ }
+
+ public int ProjectedOffset {
+ get;
+ private set;
+ }
+
+ public int Length {
+ get;
+ private set;
+ }
+
+ public ProjectedSegment (int offset, int projectedOffset, int length)
+ : this ()
+ {
+ this.Offset = offset;
+ this.ProjectedOffset = projectedOffset;
+ this.Length = length;
+ }
+
+ public bool ContainsOriginal (int offset)
+ {
+ return Offset <= offset && offset < Offset + Length;
+ }
+
+ public bool ContainsProjected (int offset)
+ {
+ return ProjectedOffset <= offset && offset <= ProjectedOffset + Length;
+ }
+
+ public bool IsInOriginal (ISegment segment)
+ {
+ if (segment == null)
+ throw new ArgumentNullException ("segment");
+
+ return segment.Contains(Offset) && segment.Contains (Offset + Length);
+ }
+
+ public ISegment FromOriginalToProjected (ISegment segment)
+ {
+ return new TextSegment (segment.Offset - Offset + ProjectedOffset, segment.Length);
+ }
+
+ public int FromOriginalToProjected (int offset)
+ {
+ return offset - Offset + ProjectedOffset;
+ }
+
+ public int FromProjectedToOriginal (int offset)
+ {
+ return offset + Offset - ProjectedOffset;
+ }
+
+ public override string ToString ()
+ {
+ return string.Format ("[ProjectedSegment: Offset={0}, ProjectedOffset={1}, Length={2}]", Offset, ProjectedOffset, Length);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedSemanticHighlighting.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedSemanticHighlighting.cs
new file mode 100644
index 0000000000..93da211780
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedSemanticHighlighting.cs
@@ -0,0 +1,106 @@
+//
+// ProjectedSemanticHighlighting.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using MonoDevelop.Ide.Editor.Highlighting;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Ide.Editor.Projection
+{
+ sealed class ProjectedSemanticHighlighting : SemanticHighlighting
+ {
+ List<Projection> projections;
+
+ public ProjectedSemanticHighlighting (TextEditor editor, DocumentContext documentContext, IEnumerable<Projection> projections) : base (editor, documentContext)
+ {
+ this.projections = new List<Projection> (projections);
+ foreach (var p in this.projections) {
+ if (p.ProjectedEditor.SemanticHighlighting == null)
+ continue;
+ p.ProjectedEditor.SemanticHighlighting.SemanticHighlightingUpdated += HandleSemanticHighlightingUpdated;
+ }
+ }
+
+ public void UpdateProjection (IEnumerable<Projection> projections)
+ {
+ foreach (var p in this.projections) {
+ if (p.ProjectedEditor.SemanticHighlighting == null)
+ continue;
+ p.ProjectedEditor.SemanticHighlighting.SemanticHighlightingUpdated -= HandleSemanticHighlightingUpdated;
+ }
+ this.projections = new List<Projection> (projections);
+ foreach (var p in this.projections) {
+ if (p.ProjectedEditor.SemanticHighlighting == null)
+ continue;
+ p.ProjectedEditor.SemanticHighlighting.SemanticHighlightingUpdated += HandleSemanticHighlightingUpdated;
+ }
+ }
+
+ void HandleSemanticHighlightingUpdated (object sender, EventArgs e)
+ {
+ NotifySemanticHighlightingUpdate ();
+ }
+
+ protected override void DocumentParsed ()
+ {
+ NotifySemanticHighlightingUpdate ();
+ }
+
+ public override IEnumerable<ColoredSegment> GetColoredSegments (MonoDevelop.Core.Text.ISegment segment)
+ {
+ foreach (Projection p in projections) {
+ foreach (var seg in p.ProjectedSegments) {
+ if (seg.ContainsOriginal (segment.Offset) ||
+ seg.ContainsOriginal (segment.EndOffset) ||
+ segment.Offset <= seg.Offset && seg.Offset + seg.Length <= segment.EndOffset) {
+ if (p.ProjectedEditor.SemanticHighlighting == null)
+ continue;
+ if (segment.Offset < seg.Offset) {
+ foreach (var cs in GetColoredSegments (MonoDevelop.Core.Text.TextSegment.FromBounds (segment.Offset, seg.Offset - 1)))
+ yield return cs;
+ }
+
+
+ var v = Math.Max (seg.Offset, segment.Offset);
+ var projectedStartOffset = seg.FromOriginalToProjected (v);
+ var projectedEndOffset = Math.Min (seg.FromOriginalToProjected (segment.EndOffset), seg.ProjectedOffset + seg.Length);
+ var originalEndOffset = seg.FromProjectedToOriginal (projectedEndOffset);
+
+ foreach (var cs in p.ProjectedEditor.SemanticHighlighting.GetColoredSegments (MonoDevelop.Core.Text.TextSegment.FromBounds (projectedStartOffset, projectedEndOffset))) {
+ yield return new ColoredSegment (cs.Offset - projectedStartOffset + v, cs.Length, cs.ColorStyleKey);
+ }
+
+ if (originalEndOffset < segment.EndOffset) {
+ foreach (var cs in GetColoredSegments (MonoDevelop.Core.Text.TextSegment.FromBounds (originalEndOffset, segment.EndOffset)))
+ yield return cs;
+ }
+ yield break;
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedTooltipProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedTooltipProvider.cs
new file mode 100644
index 0000000000..322f33f984
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/ProjectedTooltipProvider.cs
@@ -0,0 +1,94 @@
+//
+// ProjectedTooltipProvider.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using MonoDevelop.Components;
+
+namespace MonoDevelop.Ide.Editor.Projection
+{
+ sealed class ProjectedTooltipProvider : TooltipProvider
+ {
+ readonly Projection projection;
+ readonly TooltipProvider projectedTooltipProvider;
+
+ public ProjectedTooltipProvider (Projection projection, TooltipProvider projectedTooltipProvider)
+ {
+ if (projection == null)
+ throw new ArgumentNullException ("projection");
+ if (projectedTooltipProvider == null)
+ throw new ArgumentNullException ("projectedTooltipProvider");
+ this.projectedTooltipProvider = projectedTooltipProvider;
+ this.projection = projection;
+ }
+
+ public override async Task<TooltipItem> GetItem (TextEditor editor, DocumentContext ctx, int offset, CancellationToken token = default(CancellationToken))
+ {
+ foreach (var pseg in projection.ProjectedSegments) {
+ if (pseg.ContainsOriginal (offset)) {
+ var result = await projectedTooltipProvider.GetItem (projection.ProjectedEditor, projection.ProjectedContext, pseg.FromOriginalToProjected (offset));
+ if (result == null)
+ return null;
+ result.Offset = pseg.FromProjectedToOriginal (result.Offset);
+ return result;
+ }
+ }
+ return null;
+ }
+
+ public override bool IsInteractive (TextEditor editor, Control tipWindow)
+ {
+ return projectedTooltipProvider.IsInteractive (editor, tipWindow);
+ }
+
+ public override void ShowTooltipWindow (TextEditor editor, Control tipWindow, TooltipItem item, Xwt.ModifierKeys modifierState, int mouseX, int mouseY)
+ {
+ projectedTooltipProvider.ShowTooltipWindow (editor, tipWindow, item, modifierState, mouseX, mouseY);
+ }
+
+ public override void GetRequiredPosition (TextEditor editor, Control tipWindow, out int requiredWidth, out double xalign)
+ {
+ projectedTooltipProvider.GetRequiredPosition (editor, tipWindow, out requiredWidth, out xalign);
+ }
+
+ public override Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Xwt.ModifierKeys modifierState)
+ {
+ foreach (var pseg in projection.ProjectedSegments) {
+ if (pseg.ContainsOriginal (offset)) {
+ return projectedTooltipProvider.CreateTooltipWindow (projection.ProjectedEditor, projection.ProjectedContext, item, pseg.FromOriginalToProjected (offset), modifierState);
+ }
+ }
+ return null;
+ }
+
+ public override void Dispose ()
+ {
+ projectedTooltipProvider.Dispose ();
+ base.Dispose ();
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/Projection.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/Projection.cs
new file mode 100644
index 0000000000..b1a17b8064
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/Projection/Projection.cs
@@ -0,0 +1,154 @@
+//
+// Projection.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide.Editor;
+using System.Collections.Immutable;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide.TypeSystem;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Ide.Editor.Projection
+{
+ public sealed class Projection
+ {
+ public ITextDocument Document { get; private set; }
+
+ SegmentTree<ProjectedTreeSegment> originalProjections = new SegmentTree<ProjectedTreeSegment> ();
+ SegmentTree<ProjectedTreeSegment> projectedProjections = new SegmentTree<ProjectedTreeSegment> ();
+
+ class ProjectedTreeSegment : TreeSegment
+ {
+ public ProjectedTreeSegment LinkedTo { get; set; }
+
+ public ProjectedTreeSegment (int offset, int length) : base (offset, length)
+ {
+ }
+ }
+
+ public IEnumerable<ProjectedSegment> ProjectedSegments {
+ get {
+ foreach (var treeSeg in originalProjections) {
+ yield return new ProjectedSegment (treeSeg.Offset, treeSeg.LinkedTo.Offset, treeSeg.Length);
+ }
+ }
+ }
+
+ TextEditor projectedEditor;
+
+ internal TextEditor ProjectedEditor
+ {
+ get
+ {
+ return projectedEditor;
+ }
+ }
+
+ ProjectedDocumentContext projectedDocumentContext;
+ TextEditor attachedEditor;
+
+ internal DocumentContext ProjectedContext {
+ get {
+ return projectedDocumentContext;
+ }
+ }
+
+ public TextEditor CreateProjectedEditor (DocumentContext originalContext)
+ {
+ if (projectedEditor == null) {
+ projectedEditor = TextEditorFactory.CreateNewEditor (Document, TextEditorType.Projection);
+ projectedDocumentContext = new ProjectedDocumentContext (projectedEditor, originalContext);
+ projectedEditor.InitializeExtensionChain (projectedDocumentContext);
+ projectedProjections.InstallListener (projectedEditor);
+ }
+ return projectedEditor;
+ }
+
+ public Projection (ITextDocument document, IReadOnlyList<ProjectedSegment> projectedSegments)
+ {
+ if (document == null)
+ throw new ArgumentNullException (nameof (document));
+ this.Document = document;
+
+ for (int i = 0; i < projectedSegments.Count; i++) {
+ var p = projectedSegments [i];
+ var original = new ProjectedTreeSegment (p.Offset, p.Length);
+ var projected = new ProjectedTreeSegment (p.ProjectedOffset, p.Length);
+ original.LinkedTo = projected;
+ projected.LinkedTo = original;
+ originalProjections.Add (original);
+ projectedProjections.Add (projected);
+ }
+ }
+
+ internal void Dettach ()
+ {
+ attachedEditor.TextChanging -= HandleTextChanging;
+ }
+
+ internal void Attach (TextEditor textEditor)
+ {
+ attachedEditor = textEditor;
+ attachedEditor.TextChanging += HandleTextChanging;
+ }
+
+ void HandleTextChanging (object sender, TextChangeEventArgs e)
+ {
+ foreach (var segment in originalProjections) {
+ if (segment.Contains (e.Offset)) {
+ var projectedOffset = e.Offset - segment.Offset + segment.LinkedTo.Offset;
+ projectedEditor.ReplaceText (projectedOffset, e.RemovalLength, e.InsertedText);
+ }
+ }
+
+ originalProjections.UpdateOnTextReplace (sender, e);
+ }
+
+ public bool TryConvertFromProjectionToOriginal (int projectedOffset, out int originalOffset)
+ {
+ foreach (var pseg in ProjectedSegments) {
+ if (pseg.ContainsProjected (projectedOffset)) {
+ originalOffset = pseg.FromProjectedToOriginal (projectedOffset);
+ return true;
+ }
+ }
+ originalOffset = -1;
+ return false;
+ }
+
+ public bool TryConvertFromOriginalToProjection (int originalOffset, out int projectedOffset)
+ {
+ foreach (var pseg in ProjectedSegments) {
+ if (pseg.ContainsOriginal (originalOffset)) {
+ projectedOffset = pseg.FromOriginalToProjected (originalOffset);
+ return true;
+ }
+ }
+ projectedOffset = -1;
+ return false;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/SegmentTree.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/SegmentTree.cs
new file mode 100644
index 0000000000..6c23884dcd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/SegmentTree.cs
@@ -0,0 +1,804 @@
+//
+// SegmentTree.cs
+//
+// Author:
+// mkrueger <mkrueger@novell.com>
+//
+// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using MonoDevelop.Core.Text;
+using System.Text;
+using System.Web.UI.WebControls;
+using System.Diagnostics;
+
+namespace MonoDevelop.Ide.Editor
+{
+ /// <summary>
+ /// A segment tree contains overlapping segments and get all segments overlapping a segment. It's implemented as a augmented interval tree
+ /// described in Cormen et al. (2001, Section 14.3: Interval trees, pp. 311–317).
+ /// </summary>
+ public class SegmentTree<T> : TextSegmentTree, ICollection<T> where T : TreeSegment
+ {
+ readonly RedBlackTree tree = new RedBlackTree ();
+
+ ITextDocument ownerDocument;
+
+ public int Count {
+ get {
+ return tree.Count;
+ }
+ }
+
+ public IEnumerator<T> GetEnumerator ()
+ {
+ var root = tree.Root;
+ if (root == null)
+ yield break;
+ var node = root.OuterLeft;
+ while (node != null) {
+ yield return (T)node;
+ node = node.NextNode;
+ }
+ }
+
+ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator ()
+ {
+ return GetEnumerator ();
+ }
+
+ public bool Contains (T item)
+ {
+ return this.Any (item.Equals);
+ }
+
+ public void CopyTo (T[] array, int arrayIndex)
+ {
+ Debug.Assert (array != null);
+ Debug.Assert (0 <= arrayIndex && arrayIndex < array.Length);
+ int i = arrayIndex;
+ foreach (T value in this)
+ array[i++] = value;
+ }
+
+ bool ICollection<T>.IsReadOnly {
+ get {
+ return false;
+ }
+ }
+
+ public void Add (T item)
+ {
+ InternalAdd (item);
+ }
+
+ public bool Remove (T item)
+ {
+ return InternalRemove (item);
+ }
+
+ public void Clear ()
+ {
+ tree.Clear ();
+ }
+
+ public IEnumerable<T> GetSegmentsAt (int offset)
+ {
+ return GetSegmentsOverlapping (offset, 0);
+ }
+
+ public IEnumerable<T> GetSegmentsOverlapping (ISegment segment)
+ {
+ if (segment.Offset < 0)
+ return Enumerable.Empty<T> ();
+ return GetSegmentsOverlapping (segment.Offset, segment.Length);
+ }
+
+ public IEnumerable<T> GetSegmentsOverlapping (int offset, int length)
+ {
+ if (tree.Root == null)
+ yield break;
+ var intervalStack = new Stack<Interval> ();
+ intervalStack.Push (new Interval (tree.Root, offset, offset + length));
+ while (intervalStack.Count > 0) {
+ var interval = intervalStack.Pop ();
+ if (interval.end < 0)
+ continue;
+
+ var node = interval.node;
+ int nodeStart = interval.start - node.DistanceToPrevNode;
+ int nodeEnd = interval.end - node.DistanceToPrevNode;
+ var leftNode = node.Left;
+ if (leftNode != null) {
+ nodeStart -= leftNode.TotalLength;
+ nodeEnd -= leftNode.TotalLength;
+ }
+
+ if (node.DistanceToMaxEnd < nodeStart)
+ continue;
+
+ if (leftNode != null)
+ intervalStack.Push (new Interval (leftNode, interval.start, interval.end));
+
+ if (nodeEnd < 0)
+ continue;
+
+ if (nodeStart <= node.Length)
+ yield return (T)node;
+
+ var rightNode = node.Right;
+ if (rightNode != null)
+ intervalStack.Push (new Interval (rightNode, nodeStart, nodeEnd));
+ }
+ }
+
+ public void InstallListener (ITextDocument doc)
+ {
+ if (ownerDocument != null)
+ throw new InvalidOperationException ("Segment tree already installed");
+ ownerDocument = doc;
+ doc.TextChanged += UpdateOnTextReplace;
+ }
+
+ public void RemoveListener ()
+ {
+ if (ownerDocument == null)
+ throw new InvalidOperationException ("Segment tree is not installed");
+ ownerDocument.TextChanged -= UpdateOnTextReplace;
+ ownerDocument = null;
+ }
+
+ internal void UpdateOnTextReplace (object sender, TextChangeEventArgs e)
+ {
+ if (e.RemovalLength == 0) {
+ var length = e.InsertionLength;
+ foreach (var segment in GetSegmentsAt (e.Offset).Where (s => s.Offset < e.Offset && e.Offset < s.EndOffset)) {
+ segment.Length += length;
+ segment.UpdateAugmentedData ();
+ }
+ var node = SearchFirstSegmentWithStartAfter (e.Offset);
+ if (node != null) {
+ node.DistanceToPrevNode += length;
+ node.UpdateAugmentedData ();
+ }
+ return;
+ }
+ int delta = e.ChangeDelta;
+ foreach (var segment in new List<T> (GetSegmentsOverlapping (e.Offset, e.RemovalLength))) {
+ if (segment.Offset < e.Offset) {
+ if (segment.EndOffset >= e.Offset + e.RemovalLength) {
+ segment.Length += delta;
+ } else {
+ segment.Length = e.Offset - segment.Offset;
+ }
+ segment.UpdateAugmentedData ();
+ continue;
+ }
+ int remainingLength = segment.EndOffset - (e.Offset + e.RemovalLength);
+ InternalRemove (segment);
+ if (remainingLength > 0) {
+ segment.Offset = e.Offset + e.RemovalLength;
+ segment.Length = remainingLength;
+ InternalAdd (segment);
+ }
+ }
+ var next = SearchFirstSegmentWithStartAfter (e.Offset + 1);
+
+ if (next != null) {
+ next.DistanceToPrevNode += delta;
+ next.UpdateAugmentedData ();
+ }
+ }
+
+ void InternalAdd (TreeSegment node)
+ {
+ if (node == null)
+ throw new ArgumentNullException ("node");
+ if (node.segmentTree != null)
+ throw new InvalidOperationException ("Node already attached.");
+
+ node.segmentTree = this;
+
+
+ int insertionOffset = node.Offset;
+ node.DistanceToMaxEnd = node.Length;
+
+ if (tree.Root == null) {
+ tree.Count = 1;
+ tree.Root = (T)node;
+ node.TotalLength = node.DistanceToPrevNode;
+ return;
+ }
+
+ if (insertionOffset < tree.Root.TotalLength) {
+ var n = SearchNode (ref insertionOffset);
+ node.TotalLength = node.DistanceToPrevNode = insertionOffset;
+ n.DistanceToPrevNode -= insertionOffset;
+ tree.InsertBefore (n, node);
+ return;
+ }
+
+ node.DistanceToPrevNode = node.TotalLength = insertionOffset - tree.Root.TotalLength;
+ tree.InsertRight (tree.Root.OuterRight, node);
+ }
+
+ bool InternalRemove (TreeSegment node)
+ {
+ if (node.segmentTree == null)
+ return false;
+ if (node.segmentTree != this)
+ throw new InvalidOperationException ("Tried to remove tree segment from wrong tree.");
+ var calculatedOffset = node.Offset;
+ var next = node.NextNode;
+ if (next != null)
+ next.DistanceToPrevNode += node.DistanceToPrevNode;
+ tree.Remove (node);
+ if (next != null)
+ next.UpdateAugmentedData ();
+ node.segmentTree = null;
+ node.Parent = node.Left = node.Right = null;
+ node.DistanceToPrevNode = calculatedOffset;
+ return true;
+ }
+
+ TreeSegment SearchFirstSegmentWithStartAfter (int startOffset)
+ {
+ if (tree.Root == null)
+ return null;
+ if (startOffset <= 0)
+ return tree.Root.OuterLeft;
+ var result = SearchNode (ref startOffset);
+ while (startOffset == 0) {
+ var pre = result == null ? tree.Root.OuterRight : result.PrevNode;
+ if (pre == null)
+ return null;
+ startOffset += pre.DistanceToPrevNode;
+ result = pre;
+ }
+ return result;
+ }
+
+ TreeSegment SearchNode (ref int offset)
+ {
+ TreeSegment n = tree.Root;
+ while (true) {
+ if (n.Left != null) {
+ if (offset < n.Left.TotalLength) {
+ n = n.Left;
+ continue;
+ }
+ offset -= n.Left.TotalLength;
+ }
+ if (offset < n.DistanceToPrevNode)
+ return n;
+ offset -= n.DistanceToPrevNode;
+ if (n.Right == null)
+ return null;
+ n = n.Right;
+ }
+ }
+
+ #region TextSegmentTree implementation
+
+ void TextSegmentTree.Add (TreeSegment segment)
+ {
+ InternalAdd (segment);
+ }
+
+ bool TextSegmentTree.Remove (TreeSegment segment)
+ {
+ return InternalRemove (segment);
+ }
+
+ #endregion
+
+ const bool Black = false;
+ const bool Red = true;
+
+ struct Interval
+ {
+ internal TreeSegment node;
+ internal int start, end;
+
+ public Interval (TreeSegment node,int start,int end)
+ {
+ this.node = node;
+ this.start = start;
+ this.end = end;
+ }
+
+ public override string ToString ()
+ {
+ return string.Format ("[Interval: start={0},end={1}]", start, end);
+ }
+ }
+
+ sealed class RedBlackTree
+ {
+ public T Root { get; set; }
+
+ public void InsertBefore (TreeSegment node, TreeSegment newNode)
+ {
+ if (node.Left == null) {
+ InsertLeft (node, newNode);
+ } else {
+ InsertRight (node.Left.OuterRight, newNode);
+ }
+ }
+
+ public void InsertLeft (TreeSegment parentNode, TreeSegment newNode)
+ {
+ parentNode.Left = newNode;
+ newNode.Parent = parentNode;
+ newNode.Color = Red;
+ parentNode.UpdateAugmentedData ();
+ FixTreeOnInsert (newNode);
+ Count++;
+ }
+
+ public void InsertRight (TreeSegment parentNode, TreeSegment newNode)
+ {
+ parentNode.Right = newNode;
+ newNode.Parent = parentNode;
+ newNode.Color = Red;
+ parentNode.UpdateAugmentedData ();
+ FixTreeOnInsert (newNode);
+ Count++;
+ }
+
+ void FixTreeOnInsert (TreeSegment node)
+ {
+ var parent = node.Parent;
+ if (parent == null) {
+ node.Color = Black;
+ return;
+ }
+
+ if (parent.Color == Black)
+ return;
+ var uncle = node.Uncle;
+ TreeSegment grandParent = parent.Parent;
+
+ if (uncle != null && uncle.Color == Red) {
+ parent.Color = Black;
+ uncle.Color = Black;
+ grandParent.Color = Red;
+ FixTreeOnInsert (grandParent);
+ return;
+ }
+
+ if (node == parent.Right && parent == grandParent.Left) {
+ RotateLeft (parent);
+ node = node.Left;
+ } else if (node == parent.Left && parent == grandParent.Right) {
+ RotateRight (parent);
+ node = node.Right;
+ }
+
+ parent = node.Parent;
+ grandParent = parent.Parent;
+
+ parent.Color = Black;
+ grandParent.Color = Red;
+ if (node == parent.Left && parent == grandParent.Left) {
+ RotateRight (grandParent);
+ } else {
+ RotateLeft (grandParent);
+ }
+ }
+
+ void RotateLeft (TreeSegment node)
+ {
+ TreeSegment right = node.Right;
+ Replace (node, right);
+ node.Right = right.Left;
+ if (node.Right != null)
+ node.Right.Parent = node;
+ right.Left = node;
+ node.Parent = right;
+ node.UpdateAugmentedData ();
+ node.Parent.UpdateAugmentedData ();
+ }
+
+ void RotateRight (TreeSegment node)
+ {
+ TreeSegment left = node.Left;
+ Replace (node, left);
+ node.Left = left.Right;
+ if (node.Left != null)
+ node.Left.Parent = node;
+ left.Right = node;
+ node.Parent = left;
+ node.UpdateAugmentedData ();
+ node.Parent.UpdateAugmentedData ();
+ }
+
+ void Replace (TreeSegment oldNode, TreeSegment newNode)
+ {
+ if (newNode != null)
+ newNode.Parent = oldNode.Parent;
+ if (oldNode.Parent == null) {
+ Root = (T)newNode;
+ } else {
+ if (oldNode.Parent.Left == oldNode)
+ oldNode.Parent.Left = newNode;
+ else
+ oldNode.Parent.Right = newNode;
+ oldNode.Parent.UpdateAugmentedData ();
+ }
+ }
+
+ public void Remove (TreeSegment node)
+ {
+ if (node.Left != null && node.Right != null) {
+ var outerLeft = node.Right.OuterLeft;
+ InternalRemove (outerLeft);
+ Replace (node, outerLeft);
+
+ outerLeft.Color = node.Color;
+ outerLeft.Left = node.Left;
+ if (outerLeft.Left != null)
+ outerLeft.Left.Parent = outerLeft;
+
+ outerLeft.Right = node.Right;
+ if (outerLeft.Right != null)
+ outerLeft.Right.Parent = outerLeft;
+ outerLeft.UpdateAugmentedData ();
+ return;
+ }
+ InternalRemove (node);
+ }
+
+ void InternalRemove (TreeSegment node)
+ {
+ if (node.Left != null && node.Right != null) {
+ var outerLeft = node.Right.OuterLeft;
+ InternalRemove (outerLeft);
+ Replace (node, outerLeft);
+
+ outerLeft.Color = node.Color;
+ outerLeft.Left = node.Left;
+ if (outerLeft.Left != null)
+ outerLeft.Left.Parent = outerLeft;
+
+ outerLeft.Right = node.Right;
+ if (outerLeft.Right != null)
+ outerLeft.Right.Parent = outerLeft;
+ outerLeft.UpdateAugmentedData ();
+ return;
+ }
+ Count--;
+ // node has only one child
+ TreeSegment child = node.Left ?? node.Right;
+
+ Replace (node, child);
+
+ if (node.Color == Black && child != null) {
+ if (child.Color == Red) {
+ child.Color = Black;
+ } else {
+ DeleteOneChild (child);
+ }
+ }
+ }
+
+ static bool GetColorSafe (TreeSegment node)
+ {
+ return node != null ? node.Color : Black;
+ }
+
+ void DeleteOneChild (TreeSegment node)
+ {
+ // case 1
+ if (node == null || node.Parent == null)
+ return;
+
+ var parent = node.Parent;
+ var sibling = node.Sibling;
+ if (sibling == null)
+ return;
+
+ // case 2
+ if (sibling.Color == Red) {
+ parent.Color = Red;
+ sibling.Color = Black;
+ if (node == parent.Left) {
+ RotateLeft (parent);
+ } else {
+ RotateRight (parent);
+ }
+ sibling = node.Sibling;
+ if (sibling == null)
+ return;
+ }
+
+ // case 3
+ if (parent.Color == Black && sibling.Color == Black && GetColorSafe (sibling.Left) == Black && GetColorSafe (sibling.Right) == Black) {
+ sibling.Color = Red;
+ DeleteOneChild (parent);
+ return;
+ }
+
+ // case 4
+ if (parent.Color == Red && sibling.Color == Black && GetColorSafe (sibling.Left) == Black && GetColorSafe (sibling.Right) == Black) {
+ sibling.Color = Red;
+ parent.Color = Black;
+ return;
+ }
+
+ // case 5
+ if (node == parent.Left && sibling.Color == Black && GetColorSafe (sibling.Left) == Red && GetColorSafe (sibling.Right) == Black) {
+ sibling.Color = Red;
+ if (sibling.Left != null)
+ sibling.Left.Color = Black;
+ RotateRight (sibling);
+ } else if (node == parent.Right && sibling.Color == Black && GetColorSafe (sibling.Right) == Red && GetColorSafe (sibling.Left) == Black) {
+ sibling.Color = Red;
+ if (sibling.Right != null)
+ sibling.Right.Color = Black;
+ RotateLeft (sibling);
+ }
+
+ // case 6
+ sibling = node.Sibling;
+ if (sibling == null)
+ return;
+ sibling.Color = parent.Color;
+ parent.Color = Black;
+ if (node == parent.Left) {
+ if (sibling.Right != null)
+ sibling.Right.Color = Black;
+ RotateLeft (parent);
+ } else {
+ if (sibling.Left != null)
+ sibling.Left.Color = Black;
+ RotateRight (parent);
+ }
+ }
+
+ public int Count { get; set; }
+
+ public void Clear ()
+ {
+ Root = null;
+ Count = 0;
+ }
+
+ static string GetIndent (int level)
+ {
+ return new String ('\t', level);
+ }
+
+ static void AppendNode (StringBuilder builder, TreeSegment node, int indent)
+ {
+ builder.Append (GetIndent (indent) + "Node (" + (node.Color == Red ? "r" : "b") + "):" + node + Environment.NewLine);
+ builder.Append (GetIndent (indent) + "Left: ");
+ if (node.Left != null) {
+ builder.Append (Environment.NewLine);
+ AppendNode (builder, node.Left, indent + 1);
+ } else {
+ builder.Append ("null");
+ }
+
+ builder.Append (Environment.NewLine);
+ builder.Append (GetIndent (indent) + "Right: ");
+ if (node.Right != null) {
+ builder.Append (Environment.NewLine);
+ AppendNode (builder, node.Right, indent + 1);
+ } else {
+ builder.Append ("null");
+ }
+ }
+
+ public override string ToString ()
+ {
+ if (Root == null)
+ return "<null>";
+ var result = new StringBuilder ();
+ AppendNode (result, Root, 0);
+ return result.ToString ();
+ }
+ }
+ }
+
+ interface TextSegmentTree
+ {
+ void Add (TreeSegment segment);
+ bool Remove (TreeSegment segment);
+ }
+
+ public class TreeSegment : ISegment
+ {
+ public int Offset {
+ get {
+ if (segmentTree == null)
+ return DistanceToPrevNode;
+
+ var curNode = this;
+ int offset = curNode.DistanceToPrevNode;
+ if (curNode.Left != null)
+ offset += curNode.Left.TotalLength;
+ while (curNode.Parent != null) {
+ if (curNode == curNode.Parent.Right) {
+ if (curNode.Parent.Left != null)
+ offset += curNode.Parent.Left.TotalLength;
+ offset += curNode.Parent.DistanceToPrevNode;
+ }
+ curNode = curNode.Parent;
+ }
+ return offset;
+ }
+ set {
+ if (segmentTree != null)
+ segmentTree.Remove (this);
+ DistanceToPrevNode = value;
+ if (segmentTree != null)
+ segmentTree.Add (this);
+ }
+ }
+
+ public int Length {
+ get;
+ set;
+ }
+
+ public int EndOffset {
+ get {
+ return Offset + Length;
+ }
+ }
+
+ protected TreeSegment ()
+ {
+ }
+
+ public TreeSegment (int offset, int length)
+ {
+ Offset = offset;
+ Length = length;
+ }
+
+ public TreeSegment (ISegment segment) : this (segment.Offset, segment.Length)
+ {
+ }
+
+ #region Internal API
+ internal TextSegmentTree segmentTree;
+ internal TreeSegment Parent, Left, Right;
+ internal bool Color;
+
+ // TotalLength = DistanceToPrevNode + Left.DistanceToPrevNode + Right.DistanceToPrevNode
+ internal int TotalLength;
+
+ internal int DistanceToPrevNode;
+
+ // DistanceToMaxEnd = Max (Length, left.DistanceToMaxEnd + Max (left.Offset, right.Offset) - Offset)
+ internal int DistanceToMaxEnd;
+
+ internal void UpdateAugmentedData ()
+ {
+ int totalLength = DistanceToPrevNode;
+ int distanceToMaxEnd = Length;
+
+ var left = Left;
+ if (left != null) {
+ totalLength += left.TotalLength;
+ int leftdistance = left.DistanceToMaxEnd - DistanceToPrevNode;
+ var leftRight = left.Right;
+ if (leftRight != null)
+ leftdistance -= leftRight.TotalLength;
+ if (leftdistance > distanceToMaxEnd)
+ distanceToMaxEnd = leftdistance;
+ }
+
+ var right = Right;
+ if (right != null) {
+ totalLength += right.TotalLength;
+ int rightdistance = right.DistanceToMaxEnd + right.DistanceToPrevNode;
+ var rightLeft = right.Left;
+ if (rightLeft != null)
+ rightdistance += rightLeft.TotalLength;
+ if (rightdistance > distanceToMaxEnd)
+ distanceToMaxEnd = rightdistance;
+ }
+
+ if (TotalLength != totalLength || DistanceToMaxEnd != distanceToMaxEnd) {
+ TotalLength = totalLength;
+ DistanceToMaxEnd = distanceToMaxEnd;
+ Parent?.UpdateAugmentedData ();
+ }
+ }
+
+ internal TreeSegment Sibling {
+ get {
+ if (Parent == null)
+ return null;
+ return this == Parent.Left ? Parent.Right : Parent.Left;
+ }
+ }
+
+ internal TreeSegment OuterLeft {
+ get {
+ TreeSegment result = this;
+ while (result.Left != null)
+ result = result.Left;
+ return result;
+ }
+ }
+
+ internal TreeSegment OuterRight {
+ get {
+ TreeSegment result = this;
+ while (result.Right != null) {
+ result = result.Right;
+ }
+ return result;
+ }
+ }
+
+ internal TreeSegment Grandparent {
+ get {
+ return Parent != null ? Parent.Parent : null;
+ }
+ }
+
+ internal TreeSegment Uncle {
+ get {
+ TreeSegment grandparent = Grandparent;
+ if (grandparent == null)
+ return null;
+ return Parent == grandparent.Left ? grandparent.Right : grandparent.Left;
+ }
+ }
+
+ internal TreeSegment NextNode {
+ get {
+ if (Right == null) {
+ TreeSegment curNode = this;
+ TreeSegment oldNode;
+ do {
+ oldNode = curNode;
+ curNode = curNode.Parent;
+ } while (curNode != null && curNode.Right == oldNode);
+ return curNode;
+ }
+ return Right.OuterLeft;
+ }
+ }
+
+ internal TreeSegment PrevNode {
+ get {
+ if (Left == null) {
+ TreeSegment curNode = this;
+ TreeSegment oldNode;
+ do {
+ oldNode = curNode;
+ curNode = curNode.Parent;
+ } while (curNode != null && curNode.Left == oldNode);
+ return curNode;
+ }
+ return Left.OuterRight;
+ }
+ }
+ #endregion
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/SelectionMode.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/SelectionMode.cs
new file mode 100644
index 0000000000..71b981f189
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/SelectionMode.cs
@@ -0,0 +1,33 @@
+//
+// SelectionMode.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+namespace MonoDevelop.Ide.Editor
+{
+ public enum SelectionMode {
+ Normal,
+ Block
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs
new file mode 100644
index 0000000000..7e3d633814
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditor.cs
@@ -0,0 +1,1427 @@
+//
+// ITextEditor.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+using System.Collections.Generic;
+using System.Text;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide.Editor.Extension;
+using System.IO;
+using MonoDevelop.Ide.Editor.Highlighting;
+using Mono.Addins;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Extensions;
+using System.Linq;
+using MonoDevelop.Components;
+using System.ComponentModel;
+using MonoDevelop.Ide.TypeSystem;
+using System.Threading;
+using MonoDevelop.Ide.Editor.Projection;
+using Xwt;
+using System.Collections.Immutable;
+using MonoDevelop.Components.Commands;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public sealed class TextEditor : Control, ITextDocument, IDisposable
+ {
+ readonly ITextEditorImpl textEditorImpl;
+ IReadonlyTextDocument ReadOnlyTextDocument { get { return textEditorImpl.Document; } }
+ ITextDocument ReadWriteTextDocument { get { return (ITextDocument)textEditorImpl.Document; } }
+
+ public ITextSourceVersion Version {
+ get {
+ return ReadOnlyTextDocument.Version;
+ }
+ }
+
+ public TextEditorType TextEditorType { get; internal set; }
+
+ FileTypeCondition fileTypeCondition = new FileTypeCondition ();
+
+ public event EventHandler SelectionChanged {
+ add { textEditorImpl.SelectionChanged += value; }
+ remove { textEditorImpl.SelectionChanged -= value; }
+ }
+
+ public event EventHandler CaretPositionChanged {
+ add { textEditorImpl.CaretPositionChanged += value; }
+ remove { textEditorImpl.CaretPositionChanged -= value; }
+ }
+
+ public event EventHandler BeginAtomicUndoOperation {
+ add { textEditorImpl.BeginAtomicUndoOperation += value; }
+ remove { textEditorImpl.BeginAtomicUndoOperation -= value; }
+ }
+
+ public event EventHandler EndAtomicUndoOperation {
+ add { textEditorImpl.EndAtomicUndoOperation += value; }
+ remove { textEditorImpl.EndAtomicUndoOperation -= value; }
+ }
+
+ public event EventHandler<TextChangeEventArgs> TextChanging {
+ add { ReadWriteTextDocument.TextChanging += value; }
+ remove { ReadWriteTextDocument.TextChanging -= value; }
+ }
+
+ public event EventHandler<TextChangeEventArgs> TextChanged {
+ add { ReadWriteTextDocument.TextChanged += value; }
+ remove { ReadWriteTextDocument.TextChanged -= value; }
+ }
+
+ public event EventHandler<MouseMovedEventArgs> MouseMoved {
+ add { textEditorImpl.MouseMoved += value; }
+ remove { textEditorImpl.MouseMoved -= value; }
+ }
+
+ internal event EventHandler VAdjustmentChanged {
+ add { textEditorImpl.VAdjustmentChanged += value; }
+ remove { textEditorImpl.VAdjustmentChanged -= value; }
+ }
+
+ internal event EventHandler HAdjustmentChanged {
+ add { textEditorImpl.HAdjustmentChanged += value; }
+ remove { textEditorImpl.HAdjustmentChanged -= value; }
+ }
+
+ public char this[int offset] {
+ get {
+ return ReadOnlyTextDocument [offset];
+ }
+ set {
+ Runtime.AssertMainThread ();
+ ReadWriteTextDocument [offset] = value;
+ }
+ }
+
+// public event EventHandler<LineEventArgs> LineChanged {
+// add { textEditorImpl.LineChanged += value; }
+// remove { textEditorImpl.LineChanged -= value; }
+// }
+//
+// public event EventHandler<LineEventArgs> LineInserted {
+// add { textEditorImpl.LineInserted += value; }
+// remove { textEditorImpl.LineInserted -= value; }
+// }
+//
+// public event EventHandler<LineEventArgs> LineRemoved {
+// add { textEditorImpl.LineRemoved += value; }
+// remove { textEditorImpl.LineRemoved -= value; }
+// }
+
+ public ITextEditorOptions Options {
+ get {
+ return textEditorImpl.Options;
+ }
+ set {
+ Runtime.AssertMainThread ();
+ textEditorImpl.Options = value;
+ OnOptionsChanged (EventArgs.Empty);
+ }
+ }
+
+ public event EventHandler OptionsChanged;
+
+ void OnOptionsChanged (EventArgs e)
+ {
+ var handler = OptionsChanged;
+ if (handler != null)
+ handler (this, e);
+ }
+
+ public EditMode EditMode {
+ get {
+ return textEditorImpl.EditMode;
+ }
+ }
+
+ public DocumentLocation CaretLocation {
+ get {
+ return textEditorImpl.CaretLocation;
+ }
+ set {
+ Runtime.AssertMainThread ();
+ textEditorImpl.CaretLocation = value;
+ }
+ }
+
+ public SemanticHighlighting SemanticHighlighting {
+ get {
+ return textEditorImpl.SemanticHighlighting;
+ }
+ set {
+ textEditorImpl.SemanticHighlighting = value;
+ }
+ }
+
+ public int CaretLine {
+ get {
+ return CaretLocation.Line;
+ }
+ set {
+ CaretLocation = new DocumentLocation (value, CaretColumn);
+ }
+ }
+
+ public int CaretColumn {
+ get {
+ return CaretLocation.Column;
+ }
+ set {
+ CaretLocation = new DocumentLocation (CaretLine, value);
+ }
+ }
+
+ public int CaretOffset {
+ get {
+ return textEditorImpl.CaretOffset;
+ }
+ set {
+ Runtime.AssertMainThread ();
+ textEditorImpl.CaretOffset = value;
+ }
+ }
+
+ public bool IsReadOnly {
+ get {
+ return ReadOnlyTextDocument.IsReadOnly;
+ }
+ set {
+ Runtime.AssertMainThread ();
+ ReadWriteTextDocument.IsReadOnly = value;
+ }
+ }
+
+ public bool IsSomethingSelected {
+ get {
+ return textEditorImpl.IsSomethingSelected;
+ }
+ }
+
+ public SelectionMode SelectionMode {
+ get {
+ return textEditorImpl.SelectionMode;
+ }
+ }
+
+ public ISegment SelectionRange {
+ get {
+ return textEditorImpl.SelectionRange;
+ }
+ set {
+ Runtime.AssertMainThread ();
+ textEditorImpl.SelectionRange = value;
+ }
+ }
+
+ public DocumentRegion SelectionRegion {
+ get {
+ return textEditorImpl.SelectionRegion;
+ }
+ set {
+ Runtime.AssertMainThread ();
+ textEditorImpl.SelectionRegion = value;
+ }
+ }
+
+ public int SelectionAnchorOffset {
+ get {
+ return textEditorImpl.SelectionAnchorOffset;
+ }
+ set {
+ Runtime.AssertMainThread ();
+ textEditorImpl.SelectionAnchorOffset = value;
+ }
+ }
+
+ public int SelectionLeadOffset {
+ get {
+ return textEditorImpl.SelectionLeadOffset;
+ }
+ set {
+ Runtime.AssertMainThread ();
+ textEditorImpl.SelectionLeadOffset = value;
+ }
+ }
+
+ public string SelectedText {
+ get {
+ return IsSomethingSelected ? ReadOnlyTextDocument.GetTextAt (SelectionRange) : null;
+ }
+ set {
+ Runtime.AssertMainThread ();
+ var selection = SelectionRange;
+ ReplaceText (selection, value);
+ SelectionRange = new TextSegment (selection.Offset, value.Length);
+ }
+ }
+
+ public bool IsInAtomicUndo {
+ get {
+ return ReadWriteTextDocument.IsInAtomicUndo;
+ }
+ }
+
+ public double LineHeight {
+ get {
+ return textEditorImpl.LineHeight;
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the type of the MIME.
+ /// </summary>
+ /// <value>The type of the MIME.</value>
+ public string MimeType {
+ get {
+ return ReadOnlyTextDocument.MimeType;
+ }
+ set {
+ Runtime.AssertMainThread ();
+ ReadWriteTextDocument.MimeType = value;
+ }
+ }
+
+ public event EventHandler MimeTypeChanged {
+ add { ReadWriteTextDocument.MimeTypeChanged += value; }
+ remove { ReadWriteTextDocument.MimeTypeChanged -= value; }
+ }
+
+ public string Text {
+ get {
+ return ReadOnlyTextDocument.Text;
+ }
+ set {
+ Runtime.AssertMainThread ();
+ ReadWriteTextDocument.Text = value;
+ }
+ }
+
+ /// <summary>
+ /// Gets the eol marker. On a text editor always use that and not GetEolMarker.
+ /// The EOL marker of the document may get overwritten my the one from the options.
+ /// </summary>
+ public string EolMarker {
+ get {
+ if (Options.OverrideDocumentEolMarker)
+ return Options.DefaultEolMarker;
+ return ReadOnlyTextDocument.GetEolMarker ();
+ }
+ }
+
+ public bool UseBOM {
+ get {
+ return ReadOnlyTextDocument.UseBOM;
+ }
+ set {
+ Runtime.AssertMainThread ();
+ ReadWriteTextDocument.UseBOM = value;
+ }
+ }
+
+ public Encoding Encoding {
+ get {
+ return ReadOnlyTextDocument.Encoding;
+ }
+ set {
+ Runtime.AssertMainThread ();
+ ReadWriteTextDocument.Encoding = value;
+ }
+ }
+
+ public int LineCount {
+ get {
+ return ReadOnlyTextDocument.LineCount;
+ }
+ }
+
+ /// <summary>
+ /// Gets the name of the file the document is stored in.
+ /// Could also be a non-existent dummy file name or null if no name has been set.
+ /// </summary>
+ public FilePath FileName {
+ get {
+ return ReadOnlyTextDocument.FileName;
+ }
+ set {
+ Runtime.AssertMainThread ();
+ ReadWriteTextDocument.FileName = value;
+ }
+ }
+
+ public event EventHandler FileNameChanged {
+ add {
+ ReadWriteTextDocument.FileNameChanged += value;
+ }
+ remove {
+ ReadWriteTextDocument.FileNameChanged -= value;
+ }
+ }
+
+ public int Length {
+ get {
+ return ReadOnlyTextDocument.Length;
+ }
+ }
+
+ public double ZoomLevel {
+ get {
+ return textEditorImpl.ZoomLevel;
+ }
+ set {
+ Runtime.AssertMainThread ();
+ textEditorImpl.ZoomLevel = value;
+ }
+ }
+
+ public event EventHandler ZoomLevelChanged {
+ add {
+ textEditorImpl.ZoomLevelChanged += value;
+ }
+ remove {
+ textEditorImpl.ZoomLevelChanged -= value;
+ }
+ }
+
+ public string ContextMenuPath {
+ get {
+ return textEditorImpl.ContextMenuPath;
+ }
+ set {
+ textEditorImpl.ContextMenuPath = value;
+ }
+ }
+
+ public IDisposable OpenUndoGroup ()
+ {
+ Runtime.AssertMainThread ();
+ return ReadWriteTextDocument.OpenUndoGroup ();
+ }
+
+ public void SetSelection (int anchorOffset, int leadOffset)
+ {
+ Runtime.AssertMainThread ();
+ textEditorImpl.SetSelection (anchorOffset, leadOffset);
+ }
+
+ public void SetSelection (DocumentLocation anchor, DocumentLocation lead)
+ {
+ Runtime.AssertMainThread ();
+ SetSelection (LocationToOffset (anchor), LocationToOffset (lead));
+ }
+
+ public void SetCaretLocation (DocumentLocation location, bool usePulseAnimation = false, bool centerCaret = true)
+ {
+ Runtime.AssertMainThread ();
+ CaretLocation = location;
+ if (centerCaret) {
+ CenterTo (CaretLocation);
+ } else {
+ ScrollTo (CaretLocation);
+ }
+ if (usePulseAnimation)
+ StartCaretPulseAnimation ();
+ }
+
+ public void SetCaretLocation (int line, int col, bool usePulseAnimation = false, bool centerCaret = true)
+ {
+ Runtime.AssertMainThread ();
+ CaretLocation = new DocumentLocation (line, col);
+ if (centerCaret) {
+ CenterTo (CaretLocation);
+ } else {
+ ScrollTo (CaretLocation);
+ }
+ if (usePulseAnimation)
+ StartCaretPulseAnimation ();
+ }
+
+ public void ClearSelection ()
+ {
+ Runtime.AssertMainThread ();
+ textEditorImpl.ClearSelection ();
+ }
+
+ public void CenterToCaret ()
+ {
+ Runtime.AssertMainThread ();
+ textEditorImpl.CenterToCaret ();
+ }
+
+ public void StartCaretPulseAnimation ()
+ {
+ Runtime.AssertMainThread ();
+ textEditorImpl.StartCaretPulseAnimation ();
+ }
+
+ public int EnsureCaretIsNotVirtual ()
+ {
+ Runtime.AssertMainThread ();
+ return textEditorImpl.EnsureCaretIsNotVirtual ();
+ }
+
+ public void FixVirtualIndentation ()
+ {
+ Runtime.AssertMainThread ();
+ textEditorImpl.FixVirtualIndentation ();
+ }
+
+ public void RunWhenLoaded (Action action)
+ {
+ if (action == null)
+ throw new ArgumentNullException (nameof (action));
+ textEditorImpl.RunWhenLoaded (action);
+ }
+
+ public string FormatString (DocumentLocation insertPosition, string code)
+ {
+ return textEditorImpl.FormatString (LocationToOffset (insertPosition), code);
+ }
+
+ public string FormatString (int offset, string code)
+ {
+ return textEditorImpl.FormatString (offset, code);
+ }
+
+ public void StartInsertionMode (InsertionModeOptions insertionModeOptions)
+ {
+ if (insertionModeOptions == null)
+ throw new ArgumentNullException (nameof (insertionModeOptions));
+ Runtime.AssertMainThread ();
+ textEditorImpl.StartInsertionMode (insertionModeOptions);
+ }
+
+ public void StartTextLinkMode (TextLinkModeOptions textLinkModeOptions)
+ {
+ if (textLinkModeOptions == null)
+ throw new ArgumentNullException (nameof (textLinkModeOptions));
+ Runtime.AssertMainThread ();
+ textEditorImpl.StartTextLinkMode (textLinkModeOptions);
+ }
+
+ public void InsertAtCaret (string text)
+ {
+ Runtime.AssertMainThread ();
+ InsertText (CaretOffset, text);
+ }
+
+ public DocumentLocation PointToLocation (double xp, double yp, bool endAtEol = false)
+ {
+ return textEditorImpl.PointToLocation (xp, yp, endAtEol);
+ }
+
+ public Xwt.Point LocationToPoint (DocumentLocation location)
+ {
+ return textEditorImpl.LocationToPoint (location.Line, location.Column);
+ }
+
+ public Xwt.Point LocationToPoint (int line, int column)
+ {
+ return textEditorImpl.LocationToPoint (line, column);
+ }
+
+ public string GetLineText (int line, bool includeDelimiter = false)
+ {
+ var segment = GetLine (line);
+ return GetTextAt (includeDelimiter ? segment.SegmentIncludingDelimiter : segment);
+ }
+
+ public int LocationToOffset (int line, int column)
+ {
+ return ReadOnlyTextDocument.LocationToOffset (new DocumentLocation (line, column));
+ }
+
+ public int LocationToOffset (DocumentLocation location)
+ {
+ return ReadOnlyTextDocument.LocationToOffset (location);
+ }
+
+ public DocumentLocation OffsetToLocation (int offset)
+ {
+ return ReadOnlyTextDocument.OffsetToLocation (offset);
+ }
+
+ public void InsertText (int offset, string text)
+ {
+ Runtime.AssertMainThread ();
+ ReadWriteTextDocument.InsertText (offset, text);
+ }
+
+ public void InsertText (int offset, ITextSource text)
+ {
+ Runtime.AssertMainThread ();
+ ReadWriteTextDocument.InsertText (offset, text);
+ }
+
+ public void RemoveText (int offset, int count)
+ {
+ Runtime.AssertMainThread ();
+ RemoveText (new TextSegment (offset, count));
+ }
+
+ public void RemoveText (ISegment segment)
+ {
+ if (segment == null)
+ throw new ArgumentNullException (nameof (segment));
+ Runtime.AssertMainThread ();
+ ReadWriteTextDocument.RemoveText (segment);
+ }
+
+ public void ReplaceText (int offset, int count, string value)
+ {
+ Runtime.AssertMainThread ();
+ ReadWriteTextDocument.ReplaceText (offset, count, value);
+ }
+
+ public void ReplaceText (int offset, int count, ITextSource value)
+ {
+ Runtime.AssertMainThread ();
+ ReadWriteTextDocument.ReplaceText (offset, count, value);
+ }
+
+ public void ReplaceText (ISegment segment, string value)
+ {
+ if (segment == null)
+ throw new ArgumentNullException (nameof (segment));
+ Runtime.AssertMainThread ();
+ ReadWriteTextDocument.ReplaceText (segment.Offset, segment.Length, value);
+ }
+
+ public void ReplaceText (ISegment segment, ITextSource value)
+ {
+ if (segment == null)
+ throw new ArgumentNullException (nameof (segment));
+ Runtime.AssertMainThread ();
+ ReadWriteTextDocument.ReplaceText (segment.Offset, segment.Length, value);
+ }
+
+ public IDocumentLine GetLine (int lineNumber)
+ {
+ return ReadOnlyTextDocument.GetLine (lineNumber);
+ }
+
+ public IDocumentLine GetLineByOffset (int offset)
+ {
+ return ReadOnlyTextDocument.GetLineByOffset (offset);
+ }
+
+ public int OffsetToLineNumber (int offset)
+ {
+ return ReadOnlyTextDocument.OffsetToLineNumber (offset);
+ }
+
+ public void AddMarker (IDocumentLine line, ITextLineMarker lineMarker)
+ {
+ if (line == null)
+ throw new ArgumentNullException (nameof (line));
+ if (lineMarker == null)
+ throw new ArgumentNullException (nameof (lineMarker));
+ Runtime.AssertMainThread ();
+ textEditorImpl.AddMarker (line, lineMarker);
+ }
+
+ public void AddMarker (int lineNumber, ITextLineMarker lineMarker)
+ {
+ if (lineMarker == null)
+ throw new ArgumentNullException (nameof (lineMarker));
+ Runtime.AssertMainThread ();
+ AddMarker (GetLine (lineNumber), lineMarker);
+ }
+
+ public void RemoveMarker (ITextLineMarker lineMarker)
+ {
+ if (lineMarker == null)
+ throw new ArgumentNullException (nameof (lineMarker));
+ Runtime.AssertMainThread ();
+ textEditorImpl.RemoveMarker (lineMarker);
+ }
+
+ public IEnumerable<ITextLineMarker> GetLineMarkers (IDocumentLine line)
+ {
+ if (line == null)
+ throw new ArgumentNullException (nameof (line));
+ return textEditorImpl.GetLineMarkers (line);
+ }
+
+ public IEnumerable<ITextSegmentMarker> GetTextSegmentMarkersAt (ISegment segment)
+ {
+ if (segment == null)
+ throw new ArgumentNullException (nameof (segment));
+ return textEditorImpl.GetTextSegmentMarkersAt (segment);
+ }
+
+ public IEnumerable<ITextSegmentMarker> GetTextSegmentMarkersAt (int offset, int length)
+ {
+ if (offset < 0 || offset >= Length)
+ throw new ArgumentOutOfRangeException (nameof (offset), "needs to be 0 <= offset < Length=" + this.Length);
+
+ if (offset + length < 0 || offset + length > Length)
+ throw new ArgumentOutOfRangeException (nameof (length), "needs to be 0 <= offset + length (" + length + ") < Length=" + this.Length);
+
+ return textEditorImpl.GetTextSegmentMarkersAt (new TextSegment (offset, length));
+ }
+
+ public IEnumerable<ITextSegmentMarker> GetTextSegmentMarkersAt (int offset)
+ {
+ return textEditorImpl.GetTextSegmentMarkersAt (offset);
+ }
+
+ public void AddMarker (ITextSegmentMarker marker)
+ {
+ if (marker == null)
+ throw new ArgumentNullException (nameof (marker));
+ Runtime.AssertMainThread ();
+ textEditorImpl.AddMarker (marker);
+ }
+
+ public bool RemoveMarker (ITextSegmentMarker marker)
+ {
+ if (marker == null)
+ throw new ArgumentNullException (nameof (marker));
+ Runtime.AssertMainThread ();
+ return textEditorImpl.RemoveMarker (marker);
+ }
+
+ public void SetFoldings (IEnumerable<IFoldSegment> foldings)
+ {
+ if (foldings == null)
+ throw new ArgumentNullException (nameof (foldings));
+ Runtime.AssertMainThread ();
+ textEditorImpl.SetFoldings (foldings);
+ }
+
+
+ public IEnumerable<IFoldSegment> GetFoldingsContaining (int offset)
+ {
+ return textEditorImpl.GetFoldingsContaining (offset);
+ }
+
+ public IEnumerable<IFoldSegment> GetFoldingsIn (ISegment segment)
+ {
+ if (segment == null)
+ throw new ArgumentNullException (nameof (segment));
+ return textEditorImpl.GetFoldingsIn (segment.Offset, segment.Length);
+ }
+
+ /// <summary>
+ /// Gets a character at the specified position in the document.
+ /// </summary>
+ /// <paramref name="offset">The index of the character to get.</paramref>
+ /// <exception cref="ArgumentOutOfRangeException">Offset is outside the valid range (0 to TextLength-1).</exception>
+ /// <returns>The character at the specified position.</returns>
+ /// <remarks>This is the same as Text[offset], but is more efficient because
+ /// it doesn't require creating a String object.</remarks>
+ public char GetCharAt (int offset)
+ {
+ if (offset < 0 || offset >= Length)
+ throw new ArgumentOutOfRangeException (nameof (offset), "offset needs to be >= 0 && < " + Length + ", was :" + offset);
+ return ReadOnlyTextDocument.GetCharAt (offset);
+ }
+
+ public string GetTextAt (int offset, int length)
+ {
+ if (offset < 0 || offset >= Length)
+ throw new ArgumentOutOfRangeException (nameof (offset), "offset needs to be >= 0 && < " + Length + ", was :" + offset);
+ return ReadOnlyTextDocument.GetTextAt (offset, length);
+ }
+
+ public string GetTextAt (ISegment segment)
+ {
+ if (segment == null)
+ throw new ArgumentNullException (nameof (segment));
+ return ReadOnlyTextDocument.GetTextAt (segment);
+ }
+
+ public IReadonlyTextDocument CreateDocumentSnapshot ()
+ {
+ return ReadWriteTextDocument.CreateDocumentSnapshot ();
+ }
+
+ public string GetVirtualIndentationString (int lineNumber)
+ {
+ if (lineNumber < 1 || lineNumber > LineCount)
+ throw new ArgumentOutOfRangeException (nameof (lineNumber));
+ return textEditorImpl.GetVirtualIndentationString (lineNumber);
+ }
+
+ public string GetVirtualIndentationString (IDocumentLine line)
+ {
+ if (line == null)
+ throw new ArgumentNullException (nameof (line));
+ return textEditorImpl.GetVirtualIndentationString (line.LineNumber);
+ }
+
+ public int GetVirtualIndentationColumn (int lineNumber)
+ {
+ if (lineNumber < 1 || lineNumber > LineCount)
+ throw new ArgumentOutOfRangeException (nameof (lineNumber));
+ return 1 + textEditorImpl.GetVirtualIndentationString (lineNumber).Length;
+ }
+
+ public int GetVirtualIndentationColumn (IDocumentLine line)
+ {
+ if (line == null)
+ throw new ArgumentNullException (nameof (line));
+ return 1 + textEditorImpl.GetVirtualIndentationString (line.LineNumber).Length;
+ }
+
+ public TextReader CreateReader ()
+ {
+ return ReadOnlyTextDocument.CreateReader ();
+ }
+
+ public TextReader CreateReader (int offset, int length)
+ {
+ return ReadOnlyTextDocument.CreateReader (offset, length);
+ }
+
+ public ITextSource CreateSnapshot ()
+ {
+ return ReadOnlyTextDocument.CreateSnapshot ();
+ }
+
+ public ITextSource CreateSnapshot (int offset, int length)
+ {
+ return ReadOnlyTextDocument.CreateSnapshot (offset, length);
+ }
+
+ public ITextSource CreateSnapshot (ISegment segment)
+ {
+ if (segment == null)
+ throw new ArgumentNullException (nameof (segment));
+ return ReadOnlyTextDocument.CreateSnapshot (segment.Offset, segment.Length);
+ }
+
+ public void WriteTextTo (TextWriter writer)
+ {
+ if (writer == null)
+ throw new ArgumentNullException (nameof (writer));
+ ReadOnlyTextDocument.WriteTextTo (writer);
+ }
+
+ public void WriteTextTo (TextWriter writer, int offset, int length)
+ {
+ if (writer == null)
+ throw new ArgumentNullException (nameof (writer));
+ ReadOnlyTextDocument.WriteTextTo (writer, offset, length);
+ }
+
+ /// <inheritdoc/>
+ public void CopyTo (int sourceIndex, char [] destination, int destinationIndex, int count)
+ {
+ ReadOnlyTextDocument.CopyTo (sourceIndex, destination, destinationIndex, count);
+ }
+
+ public void ScrollTo (int offset)
+ {
+ Runtime.AssertMainThread ();
+ textEditorImpl.ScrollTo (offset);
+ }
+
+ public void ScrollTo (DocumentLocation loc)
+ {
+ Runtime.AssertMainThread ();
+ ScrollTo (LocationToOffset (loc));
+ }
+
+ public void CenterTo (int offset)
+ {
+ Runtime.AssertMainThread ();
+ textEditorImpl.CenterTo (offset);
+ }
+
+ public void CenterTo (DocumentLocation loc)
+ {
+ Runtime.AssertMainThread ();
+ CenterTo (LocationToOffset (loc));
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ public void SetIndentationTracker (IndentationTracker indentationTracker)
+ {
+ Runtime.AssertMainThread ();
+ textEditorImpl.SetIndentationTracker (indentationTracker);
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ public void SetSelectionSurroundingProvider (SelectionSurroundingProvider surroundingProvider)
+ {
+ Runtime.AssertMainThread ();
+ textEditorImpl.SetSelectionSurroundingProvider (surroundingProvider);
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ public void SetTextPasteHandler (TextPasteHandler textPasteHandler)
+ {
+ Runtime.AssertMainThread ();
+ textEditorImpl.SetTextPasteHandler (textPasteHandler);
+ }
+
+ public EditSession CurrentSession {
+ get {
+ return textEditorImpl.CurrentSession;
+ }
+ }
+
+ public void StartSession (EditSession session)
+ {
+ if (session == null)
+ throw new ArgumentNullException (nameof (session));
+ Runtime.AssertMainThread ();
+ session.SetEditor (this);
+ textEditorImpl.StartSession (session);
+ }
+
+ internal void EndSession ()
+ {
+ if (CurrentSession == null)
+ throw new InvalidOperationException ("No session started.");
+ Runtime.AssertMainThread ();
+ textEditorImpl.EndSession ();
+ }
+
+ bool isDisposed;
+
+ protected override void Dispose (bool disposing)
+ {
+ if (isDisposed)
+ return;
+ isDisposed = true;
+ DetachExtensionChain ();
+ FileNameChanged -= TextEditor_FileNameChanged;
+ MimeTypeChanged -= TextEditor_MimeTypeChanged;
+ foreach (var provider in textEditorImpl.TooltipProvider)
+ provider.Dispose ();
+ textEditorImpl.Dispose ();
+
+ base.Dispose (disposing);
+ }
+
+ protected override object CreateNativeWidget<T> ()
+ {
+ return textEditorImpl.CreateNativeControl ();
+ }
+
+ #region Internal API
+ ExtensionContext extensionContext;
+
+ internal ExtensionContext ExtensionContext {
+ get {
+ return extensionContext;
+ }
+ set {
+ extensionContext = value;
+ }
+ }
+
+ internal IEditorActionHost EditorActionHost {
+ get {
+ return textEditorImpl.Actions;
+ }
+ }
+
+ internal TextEditorExtension TextEditorExtensionChain {
+ get {
+ return textEditorImpl.EditorExtension;
+ }
+ }
+
+ internal ITextMarkerFactory TextMarkerFactory {
+ get {
+ return textEditorImpl.TextMarkerFactory;
+ }
+ }
+
+ static List<TooltipExtensionNode> allProviders = new List<TooltipExtensionNode> ();
+
+ static TextEditor ()
+ {
+ AddinManager.AddExtensionNodeHandler ("/MonoDevelop/SourceEditor2/TooltipProviders", delegate (object sender, ExtensionNodeEventArgs args) {
+ var extNode = (TooltipExtensionNode)args.ExtensionNode;
+ switch (args.Change) {
+ case ExtensionChange.Add:
+ allProviders.Add (extNode);
+ break;
+ case ExtensionChange.Remove:
+ allProviders.Remove (extNode);
+ break;
+ }
+ });
+ }
+
+ internal TextEditor (ITextEditorImpl textEditorImpl, TextEditorType textEditorType)
+ {
+ if (textEditorImpl == null)
+ throw new ArgumentNullException (nameof (textEditorImpl));
+ this.textEditorImpl = textEditorImpl;
+ this.TextEditorType = textEditorType;
+ commandRouter = new InternalCommandRouter (this);
+ fileTypeCondition.SetFileName (FileName);
+ ExtensionContext = AddinManager.CreateExtensionContext ();
+ ExtensionContext.RegisterCondition ("FileType", fileTypeCondition);
+
+ FileNameChanged += TextEditor_FileNameChanged;
+ MimeTypeChanged += TextEditor_MimeTypeChanged;
+ }
+
+ void TextEditor_FileNameChanged (object sender, EventArgs e)
+ {
+ fileTypeCondition.SetFileName (FileName);
+ }
+
+ void TextEditor_MimeTypeChanged (object sender, EventArgs e)
+ {
+ textEditorImpl.ClearTooltipProviders ();
+ foreach (var extensionNode in allProviders) {
+ if (extensionNode.IsValidFor (MimeType))
+ textEditorImpl.AddTooltipProvider ((TooltipProvider)extensionNode.CreateInstance ());
+ }
+ }
+
+ TextEditorViewContent viewContent;
+ internal ViewContent GetViewContent ()
+ {
+ if (viewContent == null) {
+ viewContent = new TextEditorViewContent (this, textEditorImpl);
+ }
+
+ return viewContent;
+ }
+
+ internal IFoldSegment CreateFoldSegment (int offset, int length, bool isFolded = false)
+ {
+ return textEditorImpl.CreateFoldSegment (offset, length, isFolded);
+ }
+ #endregion
+
+ #region Editor extensions
+ InternalCommandRouter commandRouter;
+ class InternalCommandRouter : MonoDevelop.Components.Commands.IMultiCastCommandRouter
+ {
+ readonly TextEditor editor;
+
+ public InternalCommandRouter (TextEditor editor)
+ {
+ this.editor = editor;
+ }
+
+ #region IMultiCastCommandRouter implementation
+
+ System.Collections.IEnumerable MonoDevelop.Components.Commands.IMultiCastCommandRouter.GetCommandTargets ()
+ {
+ yield return editor.textEditorImpl;
+ yield return editor.textEditorImpl.EditorExtension;
+ }
+ #endregion
+ }
+
+ internal object CommandRouter {
+ get {
+ return commandRouter;
+ }
+ }
+
+ protected override object GetNextCommandTarget ()
+ {
+ return commandRouter;
+ }
+
+ DocumentContext documentContext;
+ internal DocumentContext DocumentContext {
+ get {
+ return documentContext;
+ }
+ set {
+ documentContext = value;
+ OnDocumentContextChanged (EventArgs.Empty);
+ }
+ }
+
+ public event EventHandler DocumentContextChanged;
+
+ void OnDocumentContextChanged (EventArgs e)
+ {
+ if (DocumentContext != null) {
+ textEditorImpl.SetQuickTaskProviders (DocumentContext.GetContents<IQuickTaskProvider> ());
+ textEditorImpl.SetUsageTaskProviders (DocumentContext.GetContents<UsageProviderEditorExtension> ());
+ } else {
+ textEditorImpl.SetQuickTaskProviders (Enumerable.Empty<IQuickTaskProvider> ());
+ textEditorImpl.SetUsageTaskProviders (Enumerable.Empty<UsageProviderEditorExtension> ());
+ }
+ var handler = DocumentContextChanged;
+ if (handler != null)
+ handler (this, e);
+ }
+
+ internal void InitializeExtensionChain (DocumentContext documentContext)
+ {
+ if (documentContext == null)
+ throw new ArgumentNullException (nameof (documentContext));
+ DetachExtensionChain ();
+ var extensions = ExtensionContext.GetExtensionNodes ("/MonoDevelop/Ide/TextEditorExtensions", typeof(TextEditorExtensionNode));
+ var mimetypeChain = DesktopService.GetMimeTypeInheritanceChainForFile (FileName).ToArray ();
+ var newExtensions = new List<TextEditorExtension> ();
+
+ foreach (TextEditorExtensionNode extNode in extensions) {
+ if (!extNode.Supports (FileName, mimetypeChain))
+ continue;
+ TextEditorExtension ext;
+ try {
+ var instance = extNode.CreateInstance ();
+ ext = instance as TextEditorExtension;
+ if (ext != null)
+ newExtensions.Add (ext);
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while creating text editor extension :" + extNode.Id + "(" + extNode.Type + ")", e);
+ continue;
+ }
+ }
+ SetExtensionChain (documentContext, newExtensions);
+ }
+
+ internal void SetExtensionChain (DocumentContext documentContext, IEnumerable<TextEditorExtension> extensions)
+ {
+ if (documentContext == null)
+ throw new ArgumentNullException (nameof (documentContext));
+ if (extensions == null)
+ throw new ArgumentNullException (nameof (extensions));
+
+ TextEditorExtension last = null;
+ foreach (var ext in extensions) {
+ if (ext.IsValidInContext (documentContext)) {
+ if (last != null) {
+ last.Next = ext;
+ last = ext;
+ } else {
+ textEditorImpl.EditorExtension = last = ext;
+ }
+ ext.Initialize (this, documentContext);
+ }
+ }
+ DocumentContext = documentContext;
+ }
+
+
+ void DetachExtensionChain ()
+ {
+ var editorExtension = textEditorImpl.EditorExtension;
+ while (editorExtension != null) {
+ try {
+ editorExtension.Dispose ();
+ } catch (Exception ex) {
+ LoggingService.LogError ("Exception while disposing extension:" + editorExtension, ex);
+ }
+ editorExtension = editorExtension.Next;
+ }
+ textEditorImpl.EditorExtension = null;
+ }
+
+ public T GetContent<T>() where T : class
+ {
+ return GetContents<T> ().FirstOrDefault ();
+ }
+
+ public IEnumerable<T> GetContents<T>() where T : class
+ {
+ T result = textEditorImpl as T;
+ if (result != null)
+ yield return result;
+ var ext = textEditorImpl.EditorExtension;
+ while (ext != null) {
+ result = ext as T;
+ if (result != null)
+ yield return result;
+ ext = ext.Next;
+ }
+ }
+
+ public IEnumerable<object> GetContents (Type type)
+ {
+ var res = Enumerable.Empty<object> ();
+ if (type.IsInstanceOfType (textEditorImpl))
+ res = res.Concat (textEditorImpl);
+
+ var ext = textEditorImpl.EditorExtension;
+ while (ext != null) {
+ res = res.Concat (ext.OnGetContents (type));
+ ext = ext.Next;
+ }
+ return res;
+ }
+
+ #endregion
+
+ public string GetPangoMarkup (int offset, int length, bool fitIdeStyle = false)
+ {
+ return textEditorImpl.GetPangoMarkup (offset, length, fitIdeStyle);
+ }
+
+ public string GetPangoMarkup (ISegment segment, bool fitIdeStyle = false)
+ {
+ if (segment == null)
+ throw new ArgumentNullException (nameof (segment));
+ return textEditorImpl.GetPangoMarkup (segment.Offset, segment.Length, fitIdeStyle);
+ }
+
+ public static implicit operator Microsoft.CodeAnalysis.Text.SourceText (TextEditor editor)
+ {
+ return new MonoDevelopSourceText (editor);
+ }
+
+
+ #region Annotations
+ // Annotations: points either null (no annotations), to the single annotation,
+ // or to an AnnotationList.
+ // Once it is pointed at an AnnotationList, it will never change (this allows thread-safety support by locking the list)
+
+ object annotations;
+ sealed class AnnotationList : List<object>, ICloneable
+ {
+ // There are two uses for this custom list type:
+ // 1) it's private, and thus (unlike List<object>) cannot be confused with real annotations
+ // 2) It allows us to simplify the cloning logic by making the list behave the same as a clonable annotation.
+ public AnnotationList (int initialCapacity) : base (initialCapacity)
+ {
+ }
+
+ public object Clone ()
+ {
+ lock (this) {
+ AnnotationList copy = new AnnotationList (Count);
+ for (int i = 0; i < Count; i++) {
+ object obj = this [i];
+ ICloneable c = obj as ICloneable;
+ copy.Add (c != null ? c.Clone () : obj);
+ }
+ return copy;
+ }
+ }
+ }
+
+ public void AddAnnotation (object annotation)
+ {
+ if (annotation == null)
+ throw new ArgumentNullException (nameof (annotation));
+ retry: // Retry until successful
+ object oldAnnotation = Interlocked.CompareExchange (ref annotations, annotation, null);
+ if (oldAnnotation == null) {
+ return; // we successfully added a single annotation
+ }
+ AnnotationList list = oldAnnotation as AnnotationList;
+ if (list == null) {
+ // we need to transform the old annotation into a list
+ list = new AnnotationList (4);
+ list.Add (oldAnnotation);
+ list.Add (annotation);
+ if (Interlocked.CompareExchange (ref annotations, list, oldAnnotation) != oldAnnotation) {
+ // the transformation failed (some other thread wrote to this.annotations first)
+ goto retry;
+ }
+ } else {
+ // once there's a list, use simple locking
+ lock (list) {
+ list.Add (annotation);
+ }
+ }
+ }
+
+ public void RemoveAnnotations<T>() where T : class
+ {
+ retry: // Retry until successful
+ object oldAnnotations = annotations;
+ var list = oldAnnotations as AnnotationList;
+ if (list != null) {
+ lock (list)
+ list.RemoveAll (obj => obj is T);
+ } else if (oldAnnotations is T) {
+ if (Interlocked.CompareExchange (ref annotations, null, oldAnnotations) != oldAnnotations) {
+ // Operation failed (some other thread wrote to this.annotations first)
+ goto retry;
+ }
+ }
+ }
+
+ public T Annotation<T>() where T : class
+ {
+ object annotations = this.annotations;
+ var list = annotations as AnnotationList;
+ if (list != null) {
+ lock (list) {
+ foreach (object obj in list) {
+ T t = obj as T;
+ if (t != null)
+ return t;
+ }
+ return null;
+ }
+ }
+ return annotations as T;
+ }
+
+ /// <summary>
+ /// Gets all annotations stored on this AstNode.
+ /// </summary>
+ public IEnumerable<object> Annotations
+ {
+ get
+ {
+ object annotations = this.annotations;
+ AnnotationList list = annotations as AnnotationList;
+ if (list != null) {
+ lock (list) {
+ return list.ToArray ();
+ }
+ }
+ if (annotations != null)
+ return new [] { annotations };
+ return Enumerable.Empty<object> ();
+ }
+ }
+
+ internal bool SuppressTooltips {
+ get { return textEditorImpl.SuppressTooltips; }
+ set { textEditorImpl.SuppressTooltips = value; }
+ }
+ #endregion
+
+ List<ProjectedTooltipProvider> projectedProviders = new List<ProjectedTooltipProvider> ();
+ IReadOnlyList<Editor.Projection.Projection> projections = null;
+
+ public void SetOrUpdateProjections (DocumentContext ctx, IReadOnlyList<Editor.Projection.Projection> projections, DisabledProjectionFeatures disabledFeatures = DisabledProjectionFeatures.None)
+ {
+ if (ctx == null)
+ throw new ArgumentNullException (nameof (ctx));
+ if (this.projections != null) {
+ foreach (var projection in this.projections) {
+ projection.Dettach ();
+ }
+ }
+ this.projections = projections;
+ if (projections != null) {
+ foreach (var projection in projections) {
+ projection.Attach (this);
+ }
+ }
+
+ if ((disabledFeatures & DisabledProjectionFeatures.SemanticHighlighting) != DisabledProjectionFeatures.SemanticHighlighting) {
+ if (SemanticHighlighting is ProjectedSemanticHighlighting) {
+ ((ProjectedSemanticHighlighting)SemanticHighlighting).UpdateProjection (projections);
+ } else {
+ SemanticHighlighting = new ProjectedSemanticHighlighting (this, ctx, projections);
+ }
+ }
+
+ if ((disabledFeatures & DisabledProjectionFeatures.Tooltips) != DisabledProjectionFeatures.Tooltips) {
+ projectedProviders.ForEach ((obj) => {
+ textEditorImpl.RemoveTooltipProvider (obj);
+ obj.Dispose ();
+ });
+
+ projectedProviders = new List<ProjectedTooltipProvider> ();
+ foreach (var projection in projections) {
+ foreach (var tp in allProviders) {
+ if (!tp.IsValidFor (projection.ProjectedEditor.MimeType))
+ continue;
+ var newProvider = new ProjectedTooltipProvider (projection, (TooltipProvider)tp.CreateInstance ());
+ projectedProviders.Add (newProvider);
+ textEditorImpl.AddTooltipProvider (newProvider);
+ }
+ }
+ }
+ InitializeProjectionExtensions (ctx, disabledFeatures);
+ }
+
+ bool projectionsAdded = false;
+ void InitializeProjectionExtensions (DocumentContext ctx, DisabledProjectionFeatures disabledFeatures)
+ {
+ if (projectionsAdded) {
+ TextEditorExtension ext = textEditorImpl.EditorExtension;
+ while (ext != null && ext.Next != null) {
+ var pext = ext as IProjectionExtension;
+ if (pext != null) {
+ pext.Projections = projections;
+ }
+ ext = ext.Next;
+ }
+ return;
+ }
+
+ if (projections.Count == 0)
+ return;
+
+ // no extensions -> no projections needed
+ if (textEditorImpl.EditorExtension == null)
+ return;
+
+ if ((disabledFeatures & DisabledProjectionFeatures.Completion) != DisabledProjectionFeatures.Completion) {
+ TextEditorExtension lastExtension = textEditorImpl.EditorExtension;
+ while (lastExtension != null && lastExtension.Next != null) {
+ var completionTextEditorExtension = lastExtension.Next as CompletionTextEditorExtension;
+ if (completionTextEditorExtension != null) {
+ var projectedFilterExtension = new ProjectedFilterCompletionTextEditorExtension (completionTextEditorExtension, projections) { Next = completionTextEditorExtension.Next };
+ completionTextEditorExtension.Deinitialize ();
+ lastExtension.Next = projectedFilterExtension;
+ projectedFilterExtension.Initialize (this, DocumentContext);
+ }
+ lastExtension = lastExtension.Next;
+ }
+
+
+ var projectedCompletionExtension = new ProjectedCompletionExtension (ctx, projections);
+ projectedCompletionExtension.Next = textEditorImpl.EditorExtension;
+
+ textEditorImpl.EditorExtension = projectedCompletionExtension;
+ projectedCompletionExtension.Initialize (this, DocumentContext);
+ projectionsAdded = true;
+ }
+ }
+
+ internal void AddOverlay (Control messageOverlayContent, Func<int> sizeFunc)
+ {
+ Runtime.AssertMainThread ();
+ textEditorImpl.AddOverlay (messageOverlayContent, sizeFunc);
+ }
+
+ internal void RemoveOverlay (Control messageOverlayContent)
+ {
+ Runtime.AssertMainThread ();
+ textEditorImpl.RemoveOverlay (messageOverlayContent);
+ }
+
+ internal void UpdateBraceMatchingResult (BraceMatchingResult? result)
+ {
+ Runtime.AssertMainThread ();
+ textEditorImpl.UpdateBraceMatchingResult (result);
+ }
+
+ internal IEnumerable<IDocumentLine> VisibleLines { get { return textEditorImpl.VisibleLines; } }
+ internal event EventHandler<LineEventArgs> LineShown { add { textEditorImpl.LineShown += value; } remove { textEditorImpl.LineShown -= value; } }
+
+ internal ITextEditorImpl Implementation { get { return this.textEditorImpl; } }
+
+ public event EventHandler FocusLost { add { textEditorImpl.FocusLost += value; } remove { textEditorImpl.FocusLost -= value; } }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorDisplayBinding.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorDisplayBinding.cs
new file mode 100644
index 0000000000..5c626bbdab
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorDisplayBinding.cs
@@ -0,0 +1,114 @@
+//
+// TextEditorDisplayBinding.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Gui;
+using System.IO;
+using MonoDevelop.Projects;
+using System.ComponentModel;
+using MonoDevelop.Ide.Editor.Highlighting;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public class TextEditorDisplayBinding : IViewDisplayBinding
+ {
+ static bool IsInitialized = false;
+
+ public static FilePath SyntaxModePath {
+ get {
+ return UserProfile.Current.UserDataRoot.Combine ("HighlightingSchemes");
+ }
+ }
+
+ static TextEditorDisplayBinding ()
+ {
+ InitSourceEditor ();
+ }
+
+ public static void InitSourceEditor ()
+ {
+ if (IsInitialized)
+ return;
+ IsInitialized = true;
+
+ // MonoDevelop.SourceEditor.Extension.TemplateExtensionNodeLoader.Init ();
+ DefaultSourceEditorOptions.Init ();
+ // SyntaxModeService.EnsureLoad ();
+ LoadCustomStylesAndModes ();
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void LoadCustomStylesAndModes ()
+ {
+ bool success = true;
+ if (!Directory.Exists (SyntaxModePath)) {
+ try {
+ Directory.CreateDirectory (SyntaxModePath);
+ } catch (Exception e) {
+ success = false;
+ LoggingService.LogError ("Can't create syntax mode directory", e);
+ }
+ }
+ if (success)
+ SyntaxModeService.LoadStylesAndModes (SyntaxModePath);
+ }
+
+ public string Name {
+ get {
+ return GettextCatalog.GetString ("Source Code Editor");
+ }
+ }
+
+ public bool CanHandle (FilePath fileName, string mimeType, Project ownerProject)
+ {
+ if (fileName != null)
+ return DesktopService.GetFileIsText (fileName, mimeType);
+
+ if (!string.IsNullOrEmpty (mimeType))
+ return DesktopService.GetMimeTypeIsText (mimeType);
+
+ return false;
+ }
+
+ public ViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
+ {
+ var editor = TextEditorFactory.CreateNewEditor ();
+ editor.MimeType = mimeType;
+ editor.GetViewContent ().Project = ownerProject;
+ editor.GetViewContent ().ContentName = fileName;
+ return editor.GetViewContent ();
+ }
+
+ public bool CanHandleFile (string fileName)
+ {
+ return DesktopService.GetFileIsText (fileName);
+ }
+
+ public bool CanUseAsDefault {
+ get { return true; }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorFactory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorFactory.cs
new file mode 100644
index 0000000000..04c8a511d9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorFactory.cs
@@ -0,0 +1,124 @@
+//
+// DocumentFactory.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using MonoDevelop.Core.Text;
+using Mono.Addins;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public static class TextEditorFactory
+ {
+ static ITextEditorFactory currentFactory;
+
+ static TextEditorFactory ()
+ {
+ AddinManager.AddExtensionNodeHandler ("/MonoDevelop/SourceEditor2/EditorFactory", delegate(object sender, ExtensionNodeEventArgs args) {
+ switch (args.Change) {
+ case ExtensionChange.Add:
+ if (currentFactory == null)
+ currentFactory = (ITextEditorFactory)args.ExtensionObject;
+ break;
+ }
+ });
+ }
+
+ public static ITextDocument CreateNewDocument ()
+ {
+ return currentFactory.CreateNewDocument ();
+ }
+
+ public static ITextDocument CreateNewDocument (ITextSource textSource, string fileName, string mimeType = null)
+ {
+ if (textSource == null)
+ throw new System.ArgumentNullException ("textSource");
+ return currentFactory.CreateNewDocument (textSource, fileName, mimeType);
+ }
+
+ public static ITextDocument LoadDocument (string fileName, string mimeType = null)
+ {
+ if (fileName == null)
+ throw new System.ArgumentNullException ("fileName");
+ return currentFactory.CreateNewDocument (StringTextSource.ReadFrom (fileName), fileName, mimeType);
+ }
+
+ public static IReadonlyTextDocument CreateNewReadonlyDocument (ITextSource textSource, string fileName, string mimeType = null)
+ {
+ if (textSource == null)
+ throw new System.ArgumentNullException ("textSource");
+ return currentFactory.CreateNewDocument (textSource, fileName, mimeType);
+ }
+
+ static ConfigurationProperty<double> zoomLevel = ConfigurationProperty.Create ("Editor.ZoomLevel", 1.0d);
+
+ public static TextEditor CreateNewEditor (TextEditorType textEditorType = TextEditorType.Default)
+ {
+ var result = new TextEditor (currentFactory.CreateNewEditor (), textEditorType) {
+ ZoomLevel = zoomLevel
+ };
+ result.ZoomLevelChanged += delegate {
+ zoomLevel.Value = result.ZoomLevel;
+ };
+ return result;
+ }
+
+ public static TextEditor CreateNewEditor (IReadonlyTextDocument document, TextEditorType textEditorType = TextEditorType.Default)
+ {
+ if (document == null)
+ throw new System.ArgumentNullException ("document");
+ var result = new TextEditor (currentFactory.CreateNewEditor (document), textEditorType) {
+ ZoomLevel = zoomLevel
+ };
+ result.ZoomLevelChanged += delegate {
+ zoomLevel.Value = result.ZoomLevel;
+ };
+ return result;
+ }
+
+ public static TextEditor CreateNewEditor (DocumentContext ctx, TextEditorType textEditorType = TextEditorType.Default)
+ {
+ var result = CreateNewEditor (textEditorType);
+ result.InitializeExtensionChain (ctx);
+ return result;
+ }
+
+ public static TextEditor CreateNewEditor (DocumentContext ctx, IReadonlyTextDocument document, TextEditorType textEditorType = TextEditorType.Default)
+ {
+ var result = CreateNewEditor (document, textEditorType);
+ result.InitializeExtensionChain (ctx);
+ return result;
+ }
+
+ public static string[] GetSyntaxProperties (string mimeType, string name)
+ {
+ if (mimeType == null)
+ throw new System.ArgumentNullException ("mimeType");
+ if (name == null)
+ throw new System.ArgumentNullException ("name");
+ return currentFactory.GetSyntaxProperties (mimeType, name);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorType.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorType.cs
new file mode 100644
index 0000000000..882e872411
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorType.cs
@@ -0,0 +1,39 @@
+//
+// ITextEditor.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Ide.Editor
+{
+ [Flags]
+ public enum TextEditorType
+ {
+ Default = 0,
+ Projection = 1,
+
+ Visibile = Default,
+ Invisible = Projection
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs
new file mode 100644
index 0000000000..82e0592c1e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextEditorViewContent.cs
@@ -0,0 +1,330 @@
+//
+// TextEditorViewContent.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Projects;
+using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Ide.Commands;
+using System.Collections;
+using System.Collections.Generic;
+using MonoDevelop.Ide.TypeSystem;
+using System.IO;
+using MonoDevelop.Core.Text;
+using System.Text;
+using Gtk;
+using ICSharpCode.NRefactory.TypeSystem;
+using System.Linq;
+using MonoDevelop.Ide.Editor.Extension;
+using ICSharpCode.NRefactory.Refactoring;
+using MonoDevelop.Components;
+using MonoDevelop.Core;
+using System.Threading.Tasks;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using Gdk;
+using MonoDevelop.Ide.CodeFormatting;
+using System.Collections.Immutable;
+
+namespace MonoDevelop.Ide.Editor
+{
+ /// <summary>
+ /// The TextEditor object needs to be available through BaseViewContent.GetContent therefore we need to insert a
+ /// decorator in between.
+ /// </summary>
+ class TextEditorViewContent : ViewContent, ICommandRouter
+ {
+ readonly TextEditor textEditor;
+ readonly ITextEditorImpl textEditorImpl;
+
+ MonoDevelop.Projects.Policies.PolicyContainer policyContainer;
+
+ public TextEditorViewContent (TextEditor textEditor, ITextEditorImpl textEditorImpl)
+ {
+ if (textEditor == null)
+ throw new ArgumentNullException (nameof (textEditor));
+ if (textEditorImpl == null)
+ throw new ArgumentNullException (nameof (textEditorImpl));
+ this.textEditor = textEditor;
+ this.textEditorImpl = textEditorImpl;
+ this.textEditor.MimeTypeChanged += UpdateTextEditorOptions;
+ DefaultSourceEditorOptions.Instance.Changed += UpdateTextEditorOptions;
+ }
+
+ void HandleDirtyChanged (object sender, EventArgs e)
+ {
+ IsDirty = textEditorImpl.ViewContent.IsDirty;
+ InformAutoSave ();
+ }
+
+ void HandleTextChanged (object sender, TextChangeEventArgs e)
+ {
+ InformAutoSave ();
+ }
+
+ void UpdateTextEditorOptions (object sender, EventArgs e)
+ {
+ UpdateStyleParent (Project, textEditor.MimeType);
+ }
+
+ uint autoSaveTimer = 0;
+ Task autoSaveTask;
+ void InformAutoSave ()
+ {
+ if (isDisposed)
+ return;
+ RemoveAutoSaveTimer ();
+ autoSaveTimer = GLib.Timeout.Add (500, delegate {
+ if (autoSaveTask != null && !autoSaveTask.IsCompleted)
+ return false;
+
+ autoSaveTask = AutoSave.InformAutoSaveThread (textEditor.CreateSnapshot (), textEditor.FileName, IsDirty);
+ autoSaveTimer = 0;
+ return false;
+ });
+ }
+
+
+ void RemoveAutoSaveTimer ()
+ {
+ if (autoSaveTimer == 0)
+ return;
+ GLib.Source.Remove (autoSaveTimer);
+ autoSaveTimer = 0;
+ }
+
+ void RemovePolicyChangeHandler ()
+ {
+ if (policyContainer != null)
+ policyContainer.PolicyChanged -= HandlePolicyChanged;
+ }
+
+ void UpdateStyleParent (MonoDevelop.Projects.Project styleParent, string mimeType)
+ {
+ RemovePolicyChangeHandler ();
+
+ if (string.IsNullOrEmpty (mimeType))
+ mimeType = "text/plain";
+
+ var mimeTypes = DesktopService.GetMimeTypeInheritanceChain (mimeType);
+
+ if (styleParent != null)
+ policyContainer = styleParent.Policies;
+ else
+ policyContainer = MonoDevelop.Projects.Policies.PolicyService.DefaultPolicies;
+ var currentPolicy = policyContainer.Get<TextStylePolicy> (mimeTypes);
+
+ policyContainer.PolicyChanged += HandlePolicyChanged;
+ textEditor.Options = DefaultSourceEditorOptions.Instance.WithTextStyle (currentPolicy);
+ }
+
+ void HandlePolicyChanged (object sender, MonoDevelop.Projects.Policies.PolicyChangedEventArgs args)
+ {
+ var mimeTypes = DesktopService.GetMimeTypeInheritanceChain (textEditor.MimeType);
+ var currentPolicy = policyContainer.Get<TextStylePolicy> (mimeTypes);
+ textEditor.Options = DefaultSourceEditorOptions.Instance.WithTextStyle (currentPolicy);
+ }
+
+ void CancelDocumentParsedUpdate ()
+ {
+ src.Cancel ();
+ src = new CancellationTokenSource ();
+ }
+
+ CancellationTokenSource src = new CancellationTokenSource ();
+
+ async Task RunFirstTimeFoldUpdate (string text)
+ {
+ if (string.IsNullOrEmpty (text))
+ return;
+ ParsedDocument parsedDocument = null;
+
+ var foldingParser = TypeSystemService.GetFoldingParser (textEditor.MimeType);
+ if (foldingParser != null) {
+ parsedDocument = foldingParser.Parse (textEditor.FileName, text);
+ } else {
+ var normalParser = TypeSystemService.GetParser (textEditor.MimeType);
+ if (normalParser != null) {
+ parsedDocument = await normalParser.Parse(
+ new TypeSystem.ParseOptions {
+ FileName = textEditor.FileName,
+ Content = new StringTextSource(text),
+ Project = Project
+ });
+ }
+ }
+ if (parsedDocument != null) {
+ await FoldingTextEditorExtension.UpdateFoldings (textEditor, parsedDocument, textEditor.CaretLocation, true);
+ }
+ }
+
+ protected override void OnContentNameChanged ()
+ {
+ base.OnContentNameChanged ();
+ textEditorImpl.ContentName = ContentName;
+ }
+
+
+ #region IViewFContent implementation
+
+ public override async Task Load (FileOpenInformation fileOpenInformation)
+ {
+ textEditorImpl.ViewContent.DirtyChanged -= HandleDirtyChanged;
+ textEditor.TextChanged -= HandleTextChanged;
+ await textEditorImpl.ViewContent.Load (fileOpenInformation);
+ await RunFirstTimeFoldUpdate (textEditor.Text);
+ textEditorImpl.InformLoadComplete ();
+ textEditor.TextChanged += HandleTextChanged;
+ textEditorImpl.ViewContent.DirtyChanged += HandleDirtyChanged;
+ }
+
+ public override async Task LoadNew (Stream content, string mimeType)
+ {
+ textEditor.MimeType = mimeType;
+ string text = null;
+ if (content != null) {
+ var res = await TextFileUtility.GetTextAsync (content);
+ text = textEditor.Text = res.Text;
+ textEditor.Encoding = res.Encoding;
+ textEditor.UseBOM = res.HasBom;
+ }
+ await RunFirstTimeFoldUpdate (text);
+ textEditorImpl.InformLoadComplete ();
+ }
+
+ public override Task Save (FileSaveInformation fileSaveInformation)
+ {
+ if (!string.IsNullOrEmpty (fileSaveInformation.FileName))
+ AutoSave.RemoveAutoSaveFile (fileSaveInformation.FileName);
+ return textEditorImpl.ViewContent.Save (fileSaveInformation);
+ }
+
+ public override Task Save ()
+ {
+ if (!string.IsNullOrEmpty (textEditorImpl.ContentName))
+ AutoSave.RemoveAutoSaveFile (textEditorImpl.ContentName);
+ return textEditorImpl.ViewContent.Save ();
+ }
+
+ public override void DiscardChanges ()
+ {
+ if (autoSaveTask != null)
+ autoSaveTask.Wait (TimeSpan.FromSeconds (5));
+ RemoveAutoSaveTimer ();
+ if (!string.IsNullOrEmpty (textEditorImpl.ContentName))
+ AutoSave.RemoveAutoSaveFile (textEditorImpl.ContentName);
+ textEditorImpl.ViewContent.DiscardChanges ();
+ }
+
+ protected override void OnSetProject (MonoDevelop.Projects.Project project)
+ {
+ base.OnSetProject (project);
+ textEditorImpl.ViewContent.Project = project;
+ UpdateTextEditorOptions (null, null);
+ }
+
+ public override ProjectReloadCapability ProjectReloadCapability {
+ get {
+ return textEditorImpl.ViewContent.ProjectReloadCapability;
+ }
+ }
+
+ #endregion
+
+ #region BaseViewContent implementation
+
+ protected override IEnumerable<object> OnGetContents (Type type)
+ {
+ var res = base.OnGetContents (type);
+
+ if (type.IsAssignableFrom (typeof (TextEditor)))
+ return res.Concat (textEditor);
+
+ var ext = textEditorImpl.EditorExtension;
+ while (ext != null) {
+ res = res.Concat (ext.OnGetContents (type));
+ ext = ext.Next;
+ }
+ res = res.Concat (textEditorImpl.ViewContent.GetContents (type));
+ return res;
+ }
+
+ protected override void OnWorkbenchWindowChanged ()
+ {
+ base.OnWorkbenchWindowChanged ();
+ textEditorImpl.ViewContent.WorkbenchWindow = WorkbenchWindow;
+ }
+
+ public override Control Control {
+ get {
+ return textEditor;
+ }
+ }
+
+ public override string TabPageLabel {
+ get {
+ return textEditorImpl.ViewContent.TabPageLabel;
+ }
+ }
+
+ #endregion
+
+ #region IDisposable implementation
+ bool isDisposed;
+
+ public override void Dispose ()
+ {
+ if (isDisposed)
+ return;
+
+ base.Dispose ();
+
+ isDisposed = true;
+ CancelDocumentParsedUpdate ();
+ textEditorImpl.ViewContent.DirtyChanged -= HandleDirtyChanged;
+ textEditor.MimeTypeChanged -= UpdateTextEditorOptions;
+ textEditor.TextChanged -= HandleTextChanged;
+
+ DefaultSourceEditorOptions.Instance.Changed -= UpdateTextEditorOptions;
+ RemovePolicyChangeHandler ();
+ RemoveAutoSaveTimer ();
+ }
+
+ #endregion
+
+ #region ICommandRouter implementation
+
+ object ICommandRouter.GetNextCommandTarget ()
+ {
+ return textEditor;
+ }
+
+ #endregion
+
+
+
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextLink.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextLink.cs
new file mode 100644
index 0000000000..f5f25604bb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextLink.cs
@@ -0,0 +1,136 @@
+//
+// TextLink.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Ide.CodeTemplates;
+using MonoDevelop.Core.Text;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public sealed class TextLink : IListDataProvider<string>
+ {
+ public ISegment PrimaryLink {
+ get {
+ if (links.Count == 0)
+ return TextSegment.Invalid;
+ return links [0];
+ }
+ }
+
+ List<ISegment> links = new List<ISegment> ();
+
+ public List<ISegment> Links {
+ get {
+ return links;
+ }
+ set {
+ links = value;
+ }
+ }
+
+ public bool IsIdentifier {
+ get;
+ set;
+ }
+
+ public bool IsEditable {
+ get;
+ set;
+ }
+
+ public string Name {
+ get;
+ set;
+ }
+
+ public string CurrentText {
+ get;
+ set;
+ }
+
+ public string Tooltip {
+ get;
+ set;
+ }
+
+ public IListDataProvider<string> Values {
+ get;
+ set;
+ }
+
+ public Func<Func<string, string>, IListDataProvider<string>> GetStringFunc {
+ get;
+ set;
+ }
+
+ public TextLink (string name)
+ {
+ IsEditable = true;
+ this.Name = name;
+ this.IsIdentifier = false;
+ }
+
+ public override string ToString ()
+ {
+ return string.Format ("[TextLink: Name={0}, Links={1}, IsEditable={2}, Tooltip={3}, CurrentText={4}, Values=({5})]",
+ Name,
+ Links.Count,
+ IsEditable,
+ Tooltip,
+ CurrentText,
+ Values.Count);
+ }
+
+ public void AddLink (ISegment segment)
+ {
+ links.Add (segment);
+ }
+ #region IListDataProvider implementation
+ public string GetText (int n)
+ {
+ return Values != null ? Values.GetText (n) : "";
+ }
+
+ public string this [int n] {
+ get {
+ return Values != null ? Values [n] : "";
+ }
+ }
+
+ public Xwt.Drawing.Image GetIcon (int n)
+ {
+ return Values != null ? Values.GetIcon (n) : null;
+ }
+
+ public int Count {
+ get {
+ return Values != null ? Values.Count : 0;
+ }
+ }
+ #endregion
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextLinkModeEventArgs.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextLinkModeEventArgs.cs
new file mode 100644
index 0000000000..f32d8596c9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextLinkModeEventArgs.cs
@@ -0,0 +1,43 @@
+//
+// TextLinkModeEventArgs.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Ide.Editor
+{
+ [Serializable]
+ public sealed class TextLinkModeEventArgs : EventArgs
+ {
+ public bool Success {
+ get;
+ private set;
+ }
+
+ public TextLinkModeEventArgs (bool success)
+ {
+ this.Success = success;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextLinkModeOptions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextLinkModeOptions.cs
new file mode 100644
index 0000000000..ef20516cf9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextLinkModeOptions.cs
@@ -0,0 +1,66 @@
+//
+// ITextEditorImpl.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Ide.Editor
+{
+ /// <summary>
+ /// This class contains information the editor needs to initiate the text link mode.
+ /// </summary>
+ public sealed class TextLinkModeOptions
+ {
+ /// <summary>
+ /// The text links. Note that this property will change to IReadOnlyList in future versions.
+ /// </summary>
+ public IList<TextLink> Links {
+ get;
+ private set;
+ }
+
+ /// <summary>
+ /// That's the action that is started after the text link mode ended.
+ /// This may be null (in that case no action is started).
+ /// </summary>
+ public Action<TextLinkModeEventArgs> ModeExitedAction {
+ get;
+ private set;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MonoDevelop.Ide.Editor.TextLinkModeOptions"/> class.
+ /// </summary>
+ /// <param name="links">The text links. </param>
+ /// <param name="modeExitedAction">That's the action that is started after the text link mode ended.</param>
+ public TextLinkModeOptions (IList<TextLink> links, Action<TextLinkModeEventArgs> modeExitedAction = null)
+ {
+ if (links == null)
+ throw new ArgumentNullException ("links");
+ Links = links;
+ ModeExitedAction = modeExitedAction;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextMarkerFactory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextMarkerFactory.cs
new file mode 100644
index 0000000000..0a1530f5a1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextMarkerFactory.cs
@@ -0,0 +1,133 @@
+//
+// TextMarkerFactory.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Editor.Extension;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace MonoDevelop.Ide.Editor
+{
+ /// <summary>
+ /// The text marker factory creates line and segment markers for the text editor.
+ /// Note that this is the only valid way of creating markers for the editor.
+ /// </summary>
+ public static class TextMarkerFactory
+ {
+ #region Line marker
+ public static IUrlTextLineMarker CreateUrlTextMarker (TextEditor editor, IDocumentLine line, string value, UrlType url, string syntax, int startCol, int endCol)
+ {
+ return editor.TextMarkerFactory.CreateUrlTextMarker (editor, line, value, url, syntax, startCol, endCol);
+ }
+
+ public static ICurrentDebugLineTextMarker CreateCurrentDebugLineTextMarker (TextEditor editor, int offset, int length)
+ {
+ return editor.TextMarkerFactory.CreateCurrentDebugLineTextMarker (editor, offset, length);
+ }
+
+ public static ITextLineMarker CreateAsmLineMarker (TextEditor editor)
+ {
+ return editor.TextMarkerFactory.CreateAsmLineMarker (editor);
+ }
+
+ public static IUnitTestMarker CreateUnitTestMarker (TextEditor editor, UnitTestMarkerHost host, UnitTestLocation unitTestLocation)
+ {
+ return editor.TextMarkerFactory.CreateUnitTestMarker (editor, host, unitTestLocation);
+ }
+
+ public static IMessageBubbleLineMarker CreateMessageBubbleLineMarker (TextEditor editor)
+ {
+ return editor.TextMarkerFactory.CreateMessageBubbleLineMarker (editor);
+ }
+
+
+ #endregion
+
+ #region Segment marker
+ public static ITextSegmentMarker CreateUsageMarker (TextEditor editor, Usage usage)
+ {
+ return editor.TextMarkerFactory.CreateUsageMarker (editor, usage);
+ }
+
+ public static ILinkTextMarker CreateLinkMarker (TextEditor editor, int offset, int length, Action<LinkRequest> activateLink)
+ {
+ return editor.TextMarkerFactory.CreateLinkMarker (editor, offset, length, activateLink);
+ }
+
+ public static ILinkTextMarker CreateLinkMarker (TextEditor editor, ISegment segment, Action<LinkRequest> activateLink)
+ {
+ if (segment == null)
+ throw new ArgumentNullException ("segment");
+ return editor.TextMarkerFactory.CreateLinkMarker (editor, segment.Offset, segment.Length, activateLink);
+ }
+
+ public static IGenericTextSegmentMarker CreateGenericTextSegmentMarker (TextEditor editor, TextSegmentMarkerEffect effect, int offset, int length)
+ {
+ return editor.TextMarkerFactory.CreateGenericTextSegmentMarker (editor, effect, offset, length);
+ }
+
+ public static IGenericTextSegmentMarker CreateGenericTextSegmentMarker (TextEditor editor, TextSegmentMarkerEffect effect, ISegment segment)
+ {
+ if (segment == null)
+ throw new ArgumentNullException ("segment");
+ return editor.TextMarkerFactory.CreateGenericTextSegmentMarker (editor, effect, segment.Offset, segment.Length);
+ }
+
+ public static ISmartTagMarker CreateSmartTagMarker (TextEditor editor, int offset, DocumentLocation realLocation)
+ {
+ return editor.TextMarkerFactory.CreateSmartTagMarker (editor, offset, realLocation);
+ }
+
+ static bool IsIdentifierPart (char ch)
+ {
+ return char.IsLetterOrDigit (ch) || ch == '_';
+ }
+
+ public static IErrorMarker CreateErrorMarker (TextEditor editor, Error info)
+ {
+ int offset = editor.LocationToOffset (info.Region.BeginLine, info.Region.BeginColumn);
+ int endOffset = editor.LocationToOffset (info.Region.EndLine, info.Region.EndColumn);
+ if (endOffset <= offset) {
+ endOffset = offset + 1;
+ while (endOffset < editor.Length && IsIdentifierPart (editor.GetCharAt (endOffset))) {
+ endOffset++;
+ }
+ if (endOffset == offset + 1) {
+ if (endOffset - 1 < editor.Length) {
+ var c = editor.GetCharAt (endOffset - 1);
+ while ((c == '\n' || c == '\r') && endOffset < editor.Length) {
+ c = editor.GetCharAt (endOffset);
+ endOffset++;
+ }
+ } else {
+ endOffset = editor.Length;
+ }
+ }
+ }
+ return editor.TextMarkerFactory.CreateErrorMarker (editor, info, offset, endOffset - offset);
+ }
+ #endregion
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextMarkerMouseEventArgs.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextMarkerMouseEventArgs.cs
new file mode 100644
index 0000000000..7a66ca5924
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TextMarkerMouseEventArgs.cs
@@ -0,0 +1,49 @@
+//
+// ITextSegmentMarker.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Editor;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public abstract class TextMarkerMouseEventArgs : EventArgs
+ {
+ public abstract double X {
+ get;
+ }
+
+ public abstract double Y {
+ get;
+ }
+
+ public abstract object OverwriteCursor { get; set; }
+
+ public abstract string TooltipMarkup { get; set; }
+
+ public abstract bool TriggersContextMenu ();
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipExtensionNode.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipExtensionNode.cs
new file mode 100644
index 0000000000..d47513e925
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipExtensionNode.cs
@@ -0,0 +1,49 @@
+//
+// TooltipExtensionNode.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Components;
+using MonoDevelop.Ide.CodeCompletion;
+using Mono.Addins;
+
+namespace MonoDevelop.Ide.Editor
+{
+ sealed class TooltipExtensionNode : TypeExtensionNode
+ {
+ [NodeAttribute("mimeType", false, "The mimetype that this tooltip provider can handle.")]
+ string mimeType;
+
+ public string MimeType {
+ get { return mimeType; }
+ }
+
+ internal bool IsValidFor (string mimeType)
+ {
+ return string.IsNullOrEmpty (this.mimeType) || this.mimeType == mimeType;
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs
new file mode 100644
index 0000000000..259bad2056
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/TooltipProvider.cs
@@ -0,0 +1,189 @@
+//
+// TooltipProvider.cs
+//
+// Author:
+// Lluis Sanchez <lluis@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin Inc
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Components;
+using MonoDevelop.Ide.CodeCompletion;
+using System.Threading.Tasks;
+using System.Threading;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public sealed class TooltipItem : ISegment
+ {
+ int offset;
+ int length;
+
+ #region ISegment implementation
+
+ public int Offset {
+ get {
+ return offset;
+ }
+ internal set {
+ offset = value;
+ }
+ }
+
+ public int Length {
+ get {
+ return length;
+ }
+ internal set {
+ length = value;
+ }
+ }
+
+ public int EndOffset {
+ get {
+ return offset + length;
+ }
+ }
+
+ #endregion
+
+ public object Item { get; set; }
+
+ public TooltipItem (object item, ISegment itemSegment)
+ {
+ if (itemSegment == null)
+ throw new ArgumentNullException ("itemSegment");
+ Item = item;
+ this.offset = itemSegment.Offset;
+ this.length = itemSegment.Length;
+ }
+
+ public TooltipItem (object item, int offset, int length)
+ {
+ Item = item;
+ this.offset = offset;
+ this.length = length;
+ }
+ }
+
+ // TODO: Improve tooltip API - that really looks messy
+ public abstract class TooltipProvider : IDisposable
+ {
+ public abstract Task<TooltipItem> GetItem (TextEditor editor, DocumentContext ctx, int offset, CancellationToken token = default(CancellationToken));
+
+ public virtual bool IsInteractive (TextEditor editor, Control tipWindow)
+ {
+ return false;
+ }
+
+ public virtual void GetRequiredPosition (TextEditor editor, Control tipWindow, out int requiredWidth, out double xalign)
+ {
+ requiredWidth = ((Gtk.Widget)tipWindow).SizeRequest ().Width;
+ xalign = 0.5;
+ }
+
+ public virtual Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Xwt.ModifierKeys modifierState)
+ {
+ return null;
+ }
+
+ protected Xwt.Rectangle GetAllocation (TextEditor editor)
+ {
+ return editor.GetContent<ITextEditorImpl> ().GetEditorAllocation ();
+ }
+
+ void ShowTipInfoWindow (TextEditor editor, TooltipInformationWindow tipWindow, TooltipItem item, Xwt.ModifierKeys modifierState, int mouseX, int mouseY)
+ {
+ Gtk.Widget editorWidget = editor;
+
+ var startLoc = editor.OffsetToLocation (item.Offset);
+ var endLoc = editor.OffsetToLocation (item.EndOffset);
+ var p1 = editor.LocationToPoint (startLoc);
+ var p2 = editor.LocationToPoint (endLoc);
+
+ int w = (int)(p2.X - p1.X);
+
+ var caret = new Gdk.Rectangle (
+ (int)p1.X,
+ (int)p1.Y,
+ (int)w,
+ (int)editor.LineHeight
+ );
+
+ tipWindow.ShowPopup (editorWidget, caret, PopupPosition.Top);
+ }
+
+ public virtual void ShowTooltipWindow (TextEditor editor, Control tipWindow, TooltipItem item, Xwt.ModifierKeys modifierState, int mouseX, int mouseY)
+ {
+ if (tipWindow == null)
+ return;
+
+ var tipInfoWindow = ((Gtk.Widget)tipWindow) as TooltipInformationWindow;
+ if (tipInfoWindow != null) {
+ ShowTipInfoWindow (editor, tipInfoWindow, item, modifierState, mouseX, mouseY);
+ return;
+ }
+
+ var origin = editor.GetContent<ITextEditorImpl> ().GetEditorWindowOrigin ();
+
+ int w;
+ double xalign;
+ GetRequiredPosition (editor, tipWindow, out w, out xalign);
+ w += 10;
+
+ var allocation = GetAllocation (editor);
+ int x = (int)(mouseX + origin.X + allocation.X);
+ int y = (int)(mouseY + origin.Y + allocation.Y);
+ Gtk.Widget widget = editor;
+ var geometry = widget.Screen.GetUsableMonitorGeometry (widget.Screen.GetMonitorAtPoint (x, y));
+
+ x -= (int) ((double) w * xalign);
+ y += 10;
+
+ if (x + w >= geometry.X + geometry.Width)
+ x = geometry.X + geometry.Width - w;
+ if (x < geometry.Left)
+ x = geometry.Left;
+
+ var gtkWindow = (Gtk.Window)tipWindow;
+ int h = gtkWindow.SizeRequest ().Height;
+ if (y + h >= geometry.Y + geometry.Height)
+ y = geometry.Y + geometry.Height - h;
+ if (y < geometry.Top)
+ y = geometry.Top;
+
+ gtkWindow.Move (x, y);
+
+ gtkWindow.ShowAll ();
+ }
+
+ protected bool IsDisposed {
+ get;
+ private set;
+ }
+
+ public virtual void Dispose ()
+ {
+ IsDisposed = true;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/WordFindStrategy.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/WordFindStrategy.cs
new file mode 100644
index 0000000000..0c6e923629
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor/WordFindStrategy.cs
@@ -0,0 +1,37 @@
+//
+// WordFindStrategy.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+
+namespace MonoDevelop.Ide.Editor
+{
+ public enum WordFindStrategy
+ {
+ MonoDevelop,
+ Emacs,
+ SharpDevelop
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/CommandExecutionContext.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/CommandExecutionContext.cs
index fe5e859e91..56103a2c2b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/CommandExecutionContext.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/CommandExecutionContext.cs
@@ -33,22 +33,22 @@ namespace MonoDevelop.Ide.Execution
public class CommandExecutionContext
{
CanExecuteDelegate runCheckDelegate;
- SolutionEntityItem project;
+ SolutionItem project;
ExecutionCommand cmd;
- public CommandExecutionContext (SolutionEntityItem project, CanExecuteDelegate runCheckDelegate)
+ public CommandExecutionContext (SolutionItem project, CanExecuteDelegate runCheckDelegate)
{
this.project = project;
this.runCheckDelegate = runCheckDelegate;
}
- public CommandExecutionContext (SolutionEntityItem project, ExecutionCommand cmd)
+ public CommandExecutionContext (SolutionItem project, ExecutionCommand cmd)
{
this.project = project;
this.cmd = cmd;
}
- public SolutionEntityItem Project {
+ public SolutionItem Project {
get { return project; }
}
@@ -81,7 +81,7 @@ namespace MonoDevelop.Ide.Execution
return true;
}
- public IProcessAsyncOperation Execute (MonoDevelop.Core.Execution.ExecutionCommand command, MonoDevelop.Core.Execution.IConsole console)
+ public ProcessAsyncOperation Execute (MonoDevelop.Core.Execution.ExecutionCommand command, MonoDevelop.Core.Execution.OperationConsole console)
{
throw new InvalidOperationException ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/CustomExecutionMode.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/CustomExecutionMode.cs
index ef5b3e77c6..371e8bcef3 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/CustomExecutionMode.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/CustomExecutionMode.cs
@@ -67,7 +67,7 @@ namespace MonoDevelop.Ide.Execution
[ItemProperty (DefaultValue=false)]
public bool PromptForParameters { get; set; }
- public SolutionEntityItem Project { get; set; }
+ public SolutionItem Project { get; set; }
public CustomModeScope Scope { get; set; }
@@ -119,12 +119,12 @@ namespace MonoDevelop.Ide.Execution
return false;
}
- public IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
+ public ProcessAsyncOperation Execute (ExecutionCommand command, OperationConsole console)
{
return Execute (command, console, true, false);
}
- public IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console, bool allowPrompt, bool forcePrompt)
+ public ProcessAsyncOperation Execute (ExecutionCommand command, OperationConsole console, bool allowPrompt, bool forcePrompt)
{
if ((PromptForParameters || forcePrompt) && allowPrompt) {
var ctx = new CommandExecutionContext (Project, command);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/ExecutionModeCommandService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/ExecutionModeCommandService.cs
index cf22ab7176..269960bd81 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/ExecutionModeCommandService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/ExecutionModeCommandService.cs
@@ -61,7 +61,7 @@ namespace MonoDevelop.Ide.Execution
return null;
}
- public static void GenerateExecutionModeCommands (SolutionEntityItem project, CanExecuteDelegate runCheckDelegate, CommandArrayInfo info)
+ public static void GenerateExecutionModeCommands (SolutionItem project, CanExecuteDelegate runCheckDelegate, CommandArrayInfo info)
{
CommandExecutionContext ctx = new CommandExecutionContext (project, runCheckDelegate);
bool supportsParameterization = false;
@@ -242,9 +242,8 @@ namespace MonoDevelop.Ide.Execution
internal static CustomExecutionMode ShowParamtersDialog (CommandExecutionContext ctx, IExecutionMode mode, CustomExecutionMode currentMode)
{
- CustomExecutionMode cmode = null;
-
- DispatchService.GuiSyncDispatch (delegate {
+ return Runtime.RunInMainThread (delegate {
+ CustomExecutionMode cmode = null;
CustomExecutionModeDialog dlg = new CustomExecutionModeDialog ();
try {
dlg.Initialize (ctx, mode, currentMode);
@@ -254,12 +253,12 @@ namespace MonoDevelop.Ide.Execution
if (dlg.Save)
SaveCustomCommand (ctx.Project, cmode);
}
+ return cmode;
} finally {
dlg.Destroy ();
dlg.Dispose ();
}
- });
- return cmode;
+ }).Result;
}
internal class CommandItem
@@ -289,7 +288,7 @@ namespace MonoDevelop.Ide.Execution
}
}
- internal static void SaveCustomCommand (SolutionEntityItem project, CustomExecutionMode cmode)
+ internal static void SaveCustomCommand (SolutionItem project, CustomExecutionMode cmode)
{
CustomExecutionModes modes = GetCustomExecutionModeList (project, cmode.Scope);
bool found = false;
@@ -313,7 +312,7 @@ namespace MonoDevelop.Ide.Execution
IdeApp.Workspace.SavePreferences ();
}
- static CustomExecutionModes GetCustomExecutionModeList (SolutionEntityItem project, CustomModeScope scope)
+ static CustomExecutionModes GetCustomExecutionModeList (SolutionItem project, CustomModeScope scope)
{
CustomExecutionModes modes;
if (scope == CustomModeScope.Global) {
@@ -336,7 +335,7 @@ namespace MonoDevelop.Ide.Execution
return modes;
}
- internal static void RemoveCustomCommand (SolutionEntityItem project, CustomExecutionMode cmode)
+ internal static void RemoveCustomCommand (SolutionItem project, CustomExecutionMode cmode)
{
CustomExecutionModes modes = GetCustomExecutionModeList (project, cmode.Scope);
modes.Data.Remove (cmode);
@@ -464,7 +463,7 @@ namespace MonoDevelop.Ide.Execution
return Mode.ExecutionHandler.CanExecute (command);
}
- public IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
+ public ProcessAsyncOperation Execute (ExecutionCommand command, OperationConsole console)
{
if (Mode is CustomExecutionMode)
return ((CustomExecutionMode)Mode).Execute (command, console, true, true);
@@ -489,7 +488,7 @@ namespace MonoDevelop.Ide.Execution
return Handler.CanExecute (command);
}
- public IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
+ public ProcessAsyncOperation Execute (ExecutionCommand command, OperationConsole console)
{
return Handler.InternalExecute (Context, ParentMode, command, console);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/ParameterizedExecutionHandler.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/ParameterizedExecutionHandler.cs
index fb3464c4fb..cef3ea48d1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/ParameterizedExecutionHandler.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/ParameterizedExecutionHandler.cs
@@ -29,6 +29,7 @@ using MonoDevelop.Projects;
using MonoDevelop.Core;
using MonoDevelop.Core.Execution;
using MonoDevelop.Ide.Gui.Dialogs;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Execution
{
@@ -42,12 +43,12 @@ namespace MonoDevelop.Ide.Execution
{
public abstract bool CanExecute (ExecutionCommand command);
- public IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
+ public ProcessAsyncOperation Execute (ExecutionCommand command, OperationConsole console)
{
return InternalExecute (new CommandExecutionContext (null, command), new ExecutionMode ("", "", this), command, console);
}
- internal IProcessAsyncOperation InternalExecute (CommandExecutionContext ctx, IExecutionMode mode, ExecutionCommand command, IConsole console)
+ internal ProcessAsyncOperation InternalExecute (CommandExecutionContext ctx, IExecutionMode mode, ExecutionCommand command, OperationConsole console)
{
CustomExecutionMode cmode = ExecutionModeCommandService.ShowParamtersDialog (ctx, mode, null);
if (cmode == null)
@@ -71,7 +72,7 @@ namespace MonoDevelop.Ide.Execution
/// <param name="configurationData">
/// Configuration information. Created by the IExecutionConfigurationEditor object.
/// </param>
- public abstract IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console, CommandExecutionContext ctx, object configurationData);
+ public abstract ProcessAsyncOperation Execute (ExecutionCommand command, OperationConsole console, CommandExecutionContext ctx, object configurationData);
/// <summary>
/// Creates an editor to be used to edit the execution handler arguments.
@@ -83,50 +84,11 @@ namespace MonoDevelop.Ide.Execution
}
- class CancelledProcessAsyncOperation: IProcessAsyncOperation
+ class CancelledProcessAsyncOperation: ProcessAsyncOperation
{
- public int ExitCode {
- get {
- return 1;
- }
- }
-
- public int ProcessId {
- get {
- return 0;
- }
- }
-
- #region IAsyncOperation implementation
- public event OperationHandler Completed {
- add {
- value (this);
- }
- remove { }
- }
-
- public void Cancel ()
- {
- }
-
- public void WaitForCompleted ()
+ public CancelledProcessAsyncOperation ()
{
+ ExitCode = 1;
}
-
- public bool IsCompleted {
- get { return true; }
- }
-
- public bool Success {
- get { return false; }
- }
-
- public bool SuccessWithWarnings {
- get { return false; }
- }
-
- #endregion
-
- void IDisposable.Dispose () {}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/TargetedExecutionHandler.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/TargetedExecutionHandler.cs
index 63ba2161d0..3bdd4eb2ee 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/TargetedExecutionHandler.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Execution/TargetedExecutionHandler.cs
@@ -44,7 +44,7 @@ namespace MonoDevelop.Ide.Execution
return Handler.CanExecute (command);
}
- public IProcessAsyncOperation Execute (ExecutionCommand command, IConsole console)
+ public ProcessAsyncOperation Execute (ExecutionCommand command, OperationConsole console)
{
return Handler.Execute (command, console);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Extensions/MimeTypeNode.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Extensions/MimeTypeNode.cs
index 0cfa96e16b..97bdf6ae03 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Extensions/MimeTypeNode.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Extensions/MimeTypeNode.cs
@@ -109,7 +109,7 @@ namespace MonoDevelop.Ide.Extensions
globalPattern.Append ('|');
globalPattern.Append (pattern);
}
- return new Regex (globalPattern.ToString ());
+ return new Regex (globalPattern.ToString (), RegexOptions.IgnoreCase);
}
public bool SupportsFile (string fileName)
{
@@ -140,7 +140,7 @@ namespace MonoDevelop.Ide.Extensions
public bool SupportsFile (string fileName)
{
foreach (var ending in endings)
- if (fileName.EndsWith (ending, StringComparison.Ordinal))
+ if (fileName.EndsWith (ending, StringComparison.OrdinalIgnoreCase))
return true;
return false;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Extensions/OptionsDialogSection.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Extensions/OptionsDialogSection.cs
index b6fe71b785..1c8e0e7f88 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Extensions/OptionsDialogSection.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Extensions/OptionsDialogSection.cs
@@ -35,7 +35,7 @@ namespace MonoDevelop.Ide.Extensions
[ExtensionNodeChild (typeof(OptionsDialogSection))]
[ExtensionNodeChild (typeof(OptionsPanelNode))]
[ExtensionNode ("Section")]
- public class OptionsDialogSection: OptionsPanelNode, ICloneable
+ class OptionsDialogSection: OptionsPanelNode, ICloneable
{
[NodeAttribute]
string icon;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Extensions/OptionsPanelNode.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Extensions/OptionsPanelNode.cs
index 75fd11084f..0ea4b5af02 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Extensions/OptionsPanelNode.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Extensions/OptionsPanelNode.cs
@@ -33,7 +33,7 @@ using MonoDevelop.Core;
namespace MonoDevelop.Ide.Extensions
{
[ExtensionNode ("Panel")]
- public class OptionsPanelNode: TypeExtensionNode
+ class OptionsPanelNode: TypeExtensionNode
{
[NodeAttribute ("class")]
protected string typeName;
@@ -47,6 +47,9 @@ namespace MonoDevelop.Ide.Extensions
[NodeAttribute]
protected bool fill = false;
+ [NodeAttribute]
+ protected string replaces;
+
Type panelType;
public OptionsPanelNode ()
@@ -85,7 +88,7 @@ namespace MonoDevelop.Ide.Extensions
}
}
- public string TypeName {
+ public new string TypeName {
get {
return typeName;
}
@@ -94,6 +97,12 @@ namespace MonoDevelop.Ide.Extensions
internal bool CustomNode {
get { return panelType != null; }
}
+
+ public string Replaces {
+ get {
+ return this.replaces;
+ }
+ }
public virtual IOptionsPanel CreatePanel ()
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs
index 6fde8c756a..6a0ac1acfd 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ExternalTools/ExternalToolPanel.cs
@@ -44,7 +44,7 @@ namespace MonoDevelop.Ide.ExternalTools
{
ExternalToolPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new ExternalToolPanelWidget ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs
index 4d2ee32f6f..23698d4a63 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs
@@ -31,7 +31,8 @@ using MonoDevelop.Ide.Gui;
using System.Text;
using MonoDevelop.Core;
using System;
-using Mono.TextEditor.Utils;
+using MonoDevelop.Core.Text;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.FindInFiles
{
@@ -92,9 +93,16 @@ namespace MonoDevelop.Ide.FindInFiles
if (buffer != null) {
result = buffer.ToString ();
} else {
- var doc = SearchDocument ();
+ Document doc = null;
+
+ var task = SearchDocument ();
+ if (task.Wait (1000))
+ doc = task.Result;
+
if (doc != null && doc.Editor != null) {
result = doc.Editor.Text;
+ encoding = doc.Editor.Encoding;
+ hadBom = doc.Editor.UseBOM;
} else {
try {
if (!File.Exists (FileName))
@@ -113,9 +121,10 @@ namespace MonoDevelop.Ide.FindInFiles
return result;
}
- Document SearchDocument ()
+ async Task<Document> SearchDocument ()
{
- return IdeApp.Workbench.Documents.FirstOrDefault(d => !string.IsNullOrEmpty (d.FileName) && Path.GetFullPath (d.FileName) == Path.GetFullPath (FileName));
+ string fullPath = Path.GetFullPath (FileName);
+ return await Runtime.RunInMainThread (() => IdeApp.Workbench.Documents.FirstOrDefault (d => !string.IsNullOrEmpty (d.FileName) && Path.GetFullPath (d.FileName) == fullPath));
}
Document document;
@@ -125,11 +134,11 @@ namespace MonoDevelop.Ide.FindInFiles
bool hadBom;
Encoding encoding;
- public void BeginReplace (string content)
+ public async void BeginReplace (string content)
{
somethingReplaced = false;
buffer = new StringBuilder (content);
- document = SearchDocument ();
+ document = await SearchDocument ();
if (document != null) {
Gtk.Application.Invoke (delegate {
undoGroup = document.Editor.OpenUndoGroup ();
@@ -145,7 +154,7 @@ namespace MonoDevelop.Ide.FindInFiles
buffer.Insert (offset, replacement);
if (document != null) {
Gtk.Application.Invoke (delegate {
- document.Editor.Replace (offset, length, replacement);
+ document.Editor.ReplaceText (offset, length, replacement);
});
return;
}
@@ -159,14 +168,16 @@ namespace MonoDevelop.Ide.FindInFiles
undoGroup.Dispose ();
undoGroup = null;
}
- document.Editor.Document.CommitUpdateAll (); });
+ /*document.Editor.Document.CommitUpdateAll (); */
+ });
return;
}
if (buffer != null && somethingReplaced) {
object attributes = DesktopService.GetFileAttributes (FileName);
- TextFileUtility.WriteText (FileName, buffer.ToString (), encoding, hadBom);
+ TextFileUtility.WriteText (FileName, buffer.ToString (), encoding ?? Encoding.UTF8, hadBom);
DesktopService.SetFileAttributes (FileName, attributes);
}
+ FileService.NotifyFileChanged (FileName);
buffer = null;
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs
index 51b808b831..e5da586876 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs
@@ -34,6 +34,7 @@ using MonoDevelop.Components;
using Gtk;
using System.Collections.Generic;
using MonoDevelop.Ide.Gui.Content;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.FindInFiles
{
@@ -142,6 +143,7 @@ namespace MonoDevelop.Ide.FindInFiles
FindInFilesDialog (bool showReplace)
{
Build ();
+ IdeTheme.ApplyTheme (this);
properties = PropertyService.Get ("MonoDevelop.FindReplaceDialogs.SearchOptions", new Properties ());
SetButtonIcon (toggleReplaceInFiles, "gtk-find-and-replace");
@@ -172,7 +174,11 @@ namespace MonoDevelop.Ide.FindInFiles
};
buttonSearch.Clicked += HandleSearchClicked;
- buttonClose.Clicked += (sender, e) => Destroy ();
+ buttonClose.Clicked += (sender, e) => {
+ if (resultPad != null)
+ resultPad.Window.Activate (true);
+ Destroy ();
+ };
DeleteEvent += (o, args) => Destroy ();
buttonSearch.GrabDefault ();
@@ -180,7 +186,7 @@ namespace MonoDevelop.Ide.FindInFiles
var scopeStore = new ListStore (typeof(string));
var workspace = IdeApp.Workspace;
- if (workspace != null && workspace.GetAllSolutions ().Count == 1) {
+ if (workspace != null && workspace.GetAllSolutions ().Count() == 1) {
scopeStore.AppendValues (GettextCatalog.GetString ("Whole solution"));
} else {
scopeStore.AppendValues (GettextCatalog.GetString ("All solutions"));
@@ -202,7 +208,7 @@ namespace MonoDevelop.Ide.FindInFiles
toggleFindInFiles.Toggle ();
if (IdeApp.Workbench.ActiveDocument != null) {
- var view = IdeApp.Workbench.ActiveDocument.GetContent<ITextBuffer> ();
+ var view = IdeApp.Workbench.ActiveDocument.Editor;
if (view != null) {
string selectedText = FormatPatternToSelectionOption (view.SelectedText, properties.Get ("RegexSearch", false));
if (!string.IsNullOrEmpty (selectedText)) {
@@ -223,8 +229,16 @@ namespace MonoDevelop.Ide.FindInFiles
comboboxentryFind.GrabFocus ();
DeleteEvent += delegate { Destroy (); };
UpdateStopButton ();
-
+ UpdateSensitivity ();
+ if (!buttonSearch.Sensitive) {
+ comboboxScope.Active = (int)SearchScope.Directories;
+ }
+
Child.Show ();
+ updateTimer = GLib.Timeout.Add (750, delegate {
+ UpdateSensitivity ();
+ return true;
+ });
}
static void TableAddRow (Table table, uint row, Widget column1, Widget column2)
@@ -488,10 +502,10 @@ namespace MonoDevelop.Ide.FindInFiles
searchentryFileMask = null;
labelFileMask = null;
}
-
+
void HandleScopeChanged (object sender, EventArgs e)
{
- switch ((SearchScope) comboboxScope.Active) {
+ switch ((SearchScope)comboboxScope.Active) {
case SearchScope.WholeWorkspace:
HideDirectoryPathUI ();
ShowFileMaskUI ();
@@ -517,12 +531,41 @@ namespace MonoDevelop.Ide.FindInFiles
HideFileMaskUI ();
break;
}
-
+ UpdateSensitivity ();
Requisition req = SizeRequest ();
Resize (req.Width, req.Height);
//this.QueueResize ();
}
+
+ void UpdateSensitivity ()
+ {
+ bool isSensitive = true;
+ switch ((SearchScope)comboboxScope.Active) {
+ case SearchScope.WholeWorkspace:
+ isSensitive = IdeApp.Workspace.IsOpen;
+ break;
+ case SearchScope.CurrentProject:
+ isSensitive = IdeApp.ProjectOperations.CurrentSelectedProject != null;
+ break;
+ case SearchScope.AllOpenFiles:
+ isSensitive = IdeApp.Workbench.Documents.Count > 0;
+ break;
+ case SearchScope.Directories:
+ isSensitive = true;
+ break;
+ case SearchScope.CurrentDocument:
+ isSensitive = IdeApp.Workbench.ActiveDocument != null;
+ break;
+ case SearchScope.Selection:
+ isSensitive = IdeApp.Workbench.ActiveDocument != null;
+ break;
+ }
+ buttonSearch.Sensitive = isSensitive;
+ if (buttonReplace != null)
+ buttonReplace.Sensitive = isSensitive;
+ }
+
protected override void OnSizeRequested (ref Requisition requisition)
{
base.OnSizeRequested (ref requisition);
@@ -542,7 +585,7 @@ namespace MonoDevelop.Ide.FindInFiles
string defaultFolder = comboboxentryPath.Entry.Text;
if (string.IsNullOrEmpty (defaultFolder))
- defaultFolder = IdeApp.ProjectOperations.ProjectsDefaultPath;
+ defaultFolder = IdeApp.Preferences.ProjectsDefaultPath;
if (!string.IsNullOrEmpty (defaultFolder))
dlg.CurrentFolder = defaultFolder;
@@ -559,7 +602,7 @@ namespace MonoDevelop.Ide.FindInFiles
void InitFromProperties ()
{
comboboxScope.Active = properties.Get ("Scope", (int) SearchScope.WholeWorkspace);
-
+
//checkbuttonRecursively.Active = properties.Get ("SearchPathRecursively", true);
//checkbuttonFileMask.Active = properties.Get ("UseFileMask", false);
checkbuttonCaseSensitive.Active = properties.Get ("CaseSensitive", false);
@@ -641,6 +684,10 @@ namespace MonoDevelop.Ide.FindInFiles
protected override void OnDestroyed ()
{
+ if (updateTimer != 0) {
+ GLib.Source.Remove (updateTimer);
+ updateTimer = 0;
+ }
StorePoperties ();
base.OnDestroyed ();
}
@@ -679,24 +726,12 @@ namespace MonoDevelop.Ide.FindInFiles
switch ((SearchScope) comboboxScope.Active) {
case SearchScope.CurrentDocument:
- if (IdeApp.Workbench.ActiveDocument == null) {
- MessageService.ShowError (GettextCatalog.GetString ("Currently there is no open document."));
- return null;
- }
scope = new DocumentScope ();
break;
case SearchScope.Selection:
- if (IdeApp.Workbench.ActiveDocument == null) {
- MessageService.ShowError (GettextCatalog.GetString ("Currently there is no open document."));
- return null;
- }
scope = new SelectionScope ();
break;
case SearchScope.WholeWorkspace:
- if (!IdeApp.Workspace.IsOpen) {
- MessageService.ShowError (GettextCatalog.GetString ("Currently there are no open solutions."));
- return null;
- }
scope = new WholeSolutionScope ();
break;
case SearchScope.CurrentProject:
@@ -705,23 +740,8 @@ namespace MonoDevelop.Ide.FindInFiles
scope = new WholeProjectScope (currentSelectedProject);
break;
}
- if (IdeApp.Workspace.IsOpen && IdeApp.ProjectOperations.CurrentSelectedSolution != null) {
- var question = GettextCatalog.GetString (
- "Currently there is no project selected. Search in the solution instead ?");
- if (MessageService.AskQuestion (question, AlertButton.Yes, AlertButton.No) == AlertButton.Yes) {
- scope = new WholeSolutionScope ();
- break;
- } else {
- return null;
- }
- }
- MessageService.ShowError (GettextCatalog.GetString ("Currently there is no open solution."));
return null;
case SearchScope.AllOpenFiles:
- if (IdeApp.Workbench.Documents.Count == 0) {
- MessageService.ShowError (GettextCatalog.GetString ("Currently there are no open documents."));
- return null;
- }
scope = new AllOpenFilesScope ();
break;
case SearchScope.Directories:
@@ -756,42 +776,42 @@ namespace MonoDevelop.Ide.FindInFiles
static FindReplace find;
void HandleReplaceClicked (object sender, EventArgs e)
{
- SearchReplace (comboboxentryFind.Entry.Text, comboboxentryReplace.Entry.Text ?? "", GetScope (), GetFilterOptions (), () => UpdateStopButton ());
+ SearchReplace (comboboxentryFind.Entry.Text, comboboxentryReplace.Entry.Text ?? "", GetScope (), GetFilterOptions (), () => UpdateStopButton (), UpdateResultPad);
}
void HandleSearchClicked (object sender, EventArgs e)
{
- SearchReplace (comboboxentryFind.Entry.Text, null, GetScope (), GetFilterOptions (), () => UpdateStopButton ());
+ SearchReplace (comboboxentryFind.Entry.Text, null, GetScope (), GetFilterOptions (), () => UpdateStopButton (), UpdateResultPad);
}
- readonly static List<ISearchProgressMonitor> searchesInProgress = new List<ISearchProgressMonitor> ();
+ static CancellationTokenSource searchTokenSource = new CancellationTokenSource ();
+ static Task currentTask;
+ uint updateTimer;
+ SearchResultPad resultPad;
+
void UpdateStopButton ()
{
- buttonStop.Sensitive = searchesInProgress.Count > 0;
+ buttonStop.Sensitive = currentTask != null && !currentTask.IsCompleted;
+ }
+
+ void UpdateResultPad (SearchResultPad pad)
+ {
+ resultPad = pad;
}
void ButtonStopClicked (object sender, EventArgs e)
{
- lock (searchesInProgress) {
- if (searchesInProgress.Count == 0)
- return;
- ISearchProgressMonitor monitor = searchesInProgress[searchesInProgress.Count - 1];
- monitor.AsyncOperation.Cancel ();
- }
+ searchTokenSource.Cancel ();
}
- internal static void SearchReplace (string findPattern, string replacePattern, Scope scope, FilterOptions options, System.Action UpdateStopButton)
+ internal static void SearchReplace (string findPattern, string replacePattern, Scope scope, FilterOptions options, System.Action UpdateStopButton, System.Action<SearchResultPad> UpdateResultPad)
{
if (find != null && find.IsRunning) {
if (!MessageService.Confirm (GettextCatalog.GetString ("There is a search already in progress. Do you want to stop it?"), AlertButton.Stop))
return;
- lock (searchesInProgress) {
- foreach (var mon in searchesInProgress)
- mon.AsyncOperation.Cancel ();
- searchesInProgress.Clear ();
- }
}
-
+ searchTokenSource.Cancel ();
+
if (scope == null)
return;
@@ -809,16 +829,21 @@ namespace MonoDevelop.Ide.FindInFiles
MessageService.ShowError (GettextCatalog.GetString ("Replace pattern is invalid"));
return;
}
-
- ThreadPool.QueueUserWorkItem (delegate {
- using (ISearchProgressMonitor searchMonitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true)) {
+ var cancelSource = new CancellationTokenSource ();
+ searchTokenSource = cancelSource;
+ var token = cancelSource.Token;
+ currentTask = Task.Run (delegate {
+ using (SearchProgressMonitor searchMonitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, cancellationTokenSource:cancelSource)) {
searchMonitor.PathMode = scope.PathMode;
- searchMonitor.ReportStatus (scope.GetDescription (options, pattern, null));
+ if (UpdateResultPad != null) {
+ Application.Invoke (delegate {
+ UpdateResultPad (searchMonitor.ResultPad);
+ });
+ }
- lock (searchesInProgress)
- searchesInProgress.Add (searchMonitor);
+ searchMonitor.ReportStatus (scope.GetDescription (options, pattern, null));
if (UpdateStopButton != null) {
Application.Invoke (delegate {
UpdateStopButton ();
@@ -830,8 +855,8 @@ namespace MonoDevelop.Ide.FindInFiles
try {
var results = new List<SearchResult> ();
- foreach (SearchResult result in find.FindAll (scope, searchMonitor, pattern, replacePattern, options)) {
- if (searchMonitor.IsCancelRequested)
+ foreach (SearchResult result in find.FindAll (scope, searchMonitor, pattern, replacePattern, options, token)) {
+ if (token.IsCancellationRequested)
return;
results.Add (result);
}
@@ -845,7 +870,7 @@ namespace MonoDevelop.Ide.FindInFiles
if (errorMessage != null) {
message = GettextCatalog.GetString ("The search could not be finished: {0}", errorMessage);
searchMonitor.ReportError (message, null);
- } else if (searchMonitor.IsCancelRequested) {
+ } else if (searchMonitor.CancellationToken.IsCancellationRequested) {
message = GettextCatalog.GetString ("Search cancelled.");
searchMonitor.ReportWarning (message);
} else {
@@ -856,7 +881,6 @@ namespace MonoDevelop.Ide.FindInFiles
}
searchMonitor.ReportStatus (message);
searchMonitor.Log.WriteLine (GettextCatalog.GetString ("Search time: {0} seconds."), (DateTime.Now - timer).TotalSeconds);
- searchesInProgress.Remove (searchMonitor);
}
if (UpdateStopButton != null) {
Application.Invoke (delegate {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindReplace.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindReplace.cs
index b0ee5718b8..aaae54a669 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindReplace.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindReplace.cs
@@ -40,17 +40,17 @@ namespace MonoDevelop.Ide.FindInFiles
public class FindReplace
{
Regex regex;
-
+
public bool IsRunning {
get;
set;
}
-
+
public int FoundMatchesCount {
get;
set;
}
-
+
int searchedFilesCount;
public int SearchedFilesCount {
get {
@@ -60,17 +60,17 @@ namespace MonoDevelop.Ide.FindInFiles
searchedFilesCount = value;
}
}
-
+
public FindReplace ()
{
IsRunning = false;
}
-
+
public bool ValidatePattern (FilterOptions filter, string pattern)
{
if (filter.RegexSearch) {
try {
- new Regex (pattern, RegexOptions.Compiled);
+ new Regex (pattern);
return true;
} catch (Exception) {
return false;
@@ -78,8 +78,8 @@ namespace MonoDevelop.Ide.FindInFiles
}
return true;
}
-
- public IEnumerable<SearchResult> FindAll (Scope scope, IProgressMonitor monitor, string pattern, string replacePattern, FilterOptions filter)
+
+ public IEnumerable<SearchResult> FindAll (Scope scope, ProgressMonitor monitor, string pattern, string replacePattern, FilterOptions filter, CancellationToken token)
{
if (filter.RegexSearch) {
RegexOptions regexOptions = RegexOptions.Compiled;
@@ -97,6 +97,8 @@ namespace MonoDevelop.Ide.FindInFiles
var contents = new List<Tuple<FileProvider, string, List<SearchResult>>>();
foreach (var provider in scope.GetFiles (monitor, filter)) {
+ if (token.IsCancellationRequested)
+ return Enumerable.Empty<SearchResult> ();
try {
searchedFilesCount++;
contents.Add(Tuple.Create (provider, provider.ReadString (), new List<SearchResult> ()));
@@ -110,11 +112,16 @@ namespace MonoDevelop.Ide.FindInFiles
var results = new List<SearchResult>();
if (filter.RegexSearch && replacePattern != null) {
foreach (var content in contents) {
+ if (token.IsCancellationRequested)
+ return Enumerable.Empty<SearchResult> ();
results.AddRange (RegexSearch (monitor, content.Item1, content.Item2, replacePattern, filter));
}
} else {
- Parallel.ForEach (contents, content => {
- if (monitor.IsCancelRequested)
+ var options = new ParallelOptions ();
+ options.MaxDegreeOfParallelism = 4;
+ options.CancellationToken = token;
+ Parallel.ForEach (contents, options, content => {
+ if (token.IsCancellationRequested)
return;
try {
Interlocked.Increment (ref searchedFilesCount);
@@ -132,6 +139,8 @@ namespace MonoDevelop.Ide.FindInFiles
if (replacePattern != null) {
foreach (var content in contents) {
+ if (token.IsCancellationRequested)
+ return Enumerable.Empty<SearchResult> ();
if (content.Item3.Count == 0)
continue;
try {
@@ -151,24 +160,24 @@ namespace MonoDevelop.Ide.FindInFiles
IsRunning = false;
}
}
-
- IEnumerable<SearchResult> FindAll (IProgressMonitor monitor, FileProvider provider, string content, string pattern, string replacePattern, FilterOptions filter)
+
+ IEnumerable<SearchResult> FindAll (ProgressMonitor monitor, FileProvider provider, string content, string pattern, string replacePattern, FilterOptions filter)
{
if (string.IsNullOrEmpty (pattern))
return Enumerable.Empty<SearchResult> ();
-
+
if (filter.RegexSearch)
return RegexSearch (monitor, provider, content, replacePattern, filter);
-
+
return Search (provider, content, pattern, filter);
}
-
- IEnumerable<SearchResult> RegexSearch (IProgressMonitor monitor, FileProvider provider, string content, string replacePattern, FilterOptions filter)
+
+ IEnumerable<SearchResult> RegexSearch (ProgressMonitor monitor, FileProvider provider, string content, string replacePattern, FilterOptions filter)
{
var results = new List<SearchResult> ();
if (replacePattern == null) {
foreach (Match match in regex.Matches (content)) {
- if (monitor.IsCancelRequested)
+ if (monitor.CancellationToken.IsCancellationRequested)
break;
if (provider.SelectionStartPosition > -1 && match.Index < provider.SelectionStartPosition)
continue;
@@ -189,7 +198,7 @@ namespace MonoDevelop.Ide.FindInFiles
}
provider.BeginReplace (content);
int delta = 0;
- for (int i = 0; !monitor.IsCancelRequested && i < matches.Count; i++) {
+ for (int i = 0; !monitor.CancellationToken.IsCancellationRequested && i < matches.Count; i++) {
Match match = matches[i];
if (!filter.WholeWordsOnly || FilterOptions.IsWholeWordAt (content, match.Index, match.Length)) {
string replacement = match.Result (replacePattern);
@@ -202,13 +211,12 @@ namespace MonoDevelop.Ide.FindInFiles
}
return results;
}
-
+
public IEnumerable<SearchResult> Search (FileProvider provider, string content, string pattern, FilterOptions filter)
{
if (string.IsNullOrEmpty (content))
yield break;
int idx = provider.SelectionStartPosition < 0 ? 0 : Math.Max (0, provider.SelectionStartPosition);
- int delta = 0;
var comparison = filter.CaseSensitive ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase;
int end = provider.SelectionEndPosition < 0 ? content.Length : Math.Min (content.Length, provider.SelectionEndPosition);
while ((idx = content.IndexOf (pattern, idx, end - idx, comparison)) >= 0) {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/ISearchProgressMonitor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/ISearchProgressMonitor.cs
index 5deb42fee0..43015005c1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/ISearchProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/ISearchProgressMonitor.cs
@@ -32,7 +32,7 @@ using MonoDevelop.Core;
namespace MonoDevelop.Ide.FindInFiles
{
- public interface ISearchProgressMonitor: IProgressMonitor
+ public interface ISearchProgressMonitor
{
void ReportResult (SearchResult result);
void ReportResults (IEnumerable<SearchResult> result);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/MemberCollector.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/MemberCollector.cs
deleted file mode 100644
index ab63fa2d69..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/MemberCollector.cs
+++ /dev/null
@@ -1,236 +0,0 @@
-//
-// MemberCollector.cs
-//
-// Author:
-// Mansheng Yang <lightyang0@gmail.com>
-//
-// Copyright (c) 2012 Mansheng Yang
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem;
-
-namespace MonoDevelop.Ide.FindInFiles
-{
- public static class MemberCollector
- {
- static bool MatchParameters (IMember a, IMember b)
- {
- return MatchParameters (a as IParameterizedMember, b as IParameterizedMember);
- }
-
- static bool MatchParameters (IParameterizedMember a, IParameterizedMember b)
- {
- if (a == null && b == null) return true;
- if (a == null || b == null) return false;
-
- return Equals (a.Compilation, a.Parameters, b.Parameters);
- }
-
- #region Code from NRefactory ParameterListComparer
-
- public static bool Equals(ICompilation comp, IList<IParameter> x, IList<IParameter> y)
- {
- if (x == y)
- return true;
- if (x == null || y == null || x.Count != y.Count)
- return false;
- for (int i = 0; i < x.Count; i++) {
- var a = x[i];
- var b = y[i];
- if (a == null && b == null)
- continue;
- if (a == null || b == null)
- return false;
-
- // We want to consider the parameter lists "Method<T>(T a)" and "Method<S>(S b)" as equal.
- // However, the parameter types are not considered equal, as T is a different type parameter than S.
- // In order to compare the method signatures, we will normalize all method type parameters.
- IType aType = a.Type.AcceptVisitor(normalizationVisitor);
- IType bType = b.Type.AcceptVisitor(normalizationVisitor);
- bType = comp.Import (bType);
- if (!aType.Equals(bType))
- return false;
- }
- return true;
- }
-
- sealed class NormalizeTypeVisitor : TypeVisitor
- {
- public override IType VisitTypeParameter(ITypeParameter type)
- {
- if (type.OwnerType == SymbolKind.Method) {
- return ICSharpCode.NRefactory.TypeSystem.Implementation.DummyTypeParameter.GetMethodTypeParameter(type.Index);
- } else {
- return base.VisitTypeParameter(type);
- }
- }
-
- public override IType VisitTypeDefinition(ITypeDefinition type)
- {
- if (type.KnownTypeCode == KnownTypeCode.Object)
- return SpecialType.Dynamic;
- return base.VisitTypeDefinition(type);
- }
- }
-
- static readonly NormalizeTypeVisitor normalizationVisitor = new NormalizeTypeVisitor();
-
- #endregion
-
- /// <summary>
- /// find all base types(types that are not derived from other types) in the specified types
- /// </summary>
- /// <param name="types"></param>
- /// <returns></returns>
- public static IEnumerable<ITypeDefinition> GetBaseTypes (IEnumerable<ITypeDefinition> types)
- {
- if (types == null)
- yield break;
- types = types.ToList ();
- if (!types.Any ())
- yield break;
-
- var baseType = types.FirstOrDefault ();
- var otherTypes = new List<ITypeDefinition> ();
-
- foreach (var type in types.Skip (1)) {
- if (baseType.IsDerivedFrom (type)) {
- baseType = type;
- } else if (!type.IsDerivedFrom (baseType)) {
- // this type is not directly related to baseType
- otherTypes.Add (type);
- }
- }
- yield return baseType;
- foreach (var type in GetBaseTypes (otherTypes))
- yield return type;
- }
-
- static IEnumerable<IMember> GetMembers (ITypeDefinition type, IMember member, bool ignoreInherited,
- Func<IMember, bool> filter)
- {
- var options = ignoreInherited ? GetMemberOptions.IgnoreInheritedMembers : GetMemberOptions.None;
- var members = type.GetMembers (m => m.Name == member.Name, options);
-
-/* // Filter out shadowed members.
- // class A { public string Foo { get; set; } } class B : A { public string Foo { get; set; } }
- if (member.SymbolKind == SymbolKind.Property || !(member is IParameterizedMember)) {
- members = members.Where (m => m == member || m.DeclaringType.Kind == TypeKind.Interface);
- }*/
- if (filter != null)
- members = members.Where (filter);
- return members;
- }
-
- static IEnumerable<ITypeDefinition> Import (ICompilation compilation, IEnumerable<ITypeDefinition> types)
- {
- return types.Select (t => compilation.Import (t));
- }
-
- /// <summary>
- /// collect members with the same signature/name(if overloads are included) as the specified member
- /// in the inheritance tree
- /// </summary>
- public static IEnumerable<IMember> CollectMembers (Solution solution, IMember member, ReferenceFinder.RefactoryScope scope,
- bool includeOverloads = true, bool matchDeclaringType = false)
- {
- if (solution == null || member.SymbolKind == SymbolKind.Destructor || member.SymbolKind == SymbolKind.Operator)
- return new [] { member };
-
- if (member.SymbolKind == SymbolKind.Constructor) {
- if (includeOverloads)
- return member.DeclaringType.GetMembers (m => m.SymbolKind == SymbolKind.Constructor, GetMemberOptions.IgnoreInheritedMembers);
- return new [] { member };
- }
-
- Func<IMember, bool> memberFilter = null;
- if (member is IParameterizedMember && !includeOverloads)
- memberFilter = m => MatchParameters (m, member);
-
- var declaringType = member.DeclaringTypeDefinition;
- if (declaringType == null)
- return new [] { member };
- // only collect members in declaringType
- if (matchDeclaringType)
- return GetMembers (declaringType, member, true, memberFilter);
-
- if (declaringType.Kind != TypeKind.Class && declaringType.Kind != TypeKind.Interface)
- return GetMembers (declaringType, member, false, memberFilter);
-
- var searchTypes = new List<ITypeDefinition> ();
- if (includeOverloads) {
- var interfaces = from t in declaringType.GetAllBaseTypeDefinitions ()
- where t.Kind == TypeKind.Interface && GetMembers (t, member, true, memberFilter).Any ()
- select t;
- searchTypes.AddRange (GetBaseTypes (interfaces));
- }
-
- if (member.DeclaringType.Kind == TypeKind.Class) {
- var members = GetMembers (declaringType, member, false, memberFilter).ToList ();
- if (members.Any (m => m.IsOverridable))
- searchTypes.AddRange (GetBaseTypes (members.Select (m => m.DeclaringTypeDefinition)));
- else if (searchTypes.Count == 0)
- return members;
- }
-
- IList<ICompilation> compilations;
- if (scope == ReferenceFinder.RefactoryScope.Solution || scope == ReferenceFinder.RefactoryScope.Unknown) {
- var projects = SearchCollector.CollectProjects (solution, searchTypes);
- compilations = projects.Select (TypeSystemService.GetCompilation).ToList ();
- } else {
- compilations = new [] { member.Compilation };
- }
-
- var result = new List<IMember> ();
- var mainAssemblies = new HashSet<string> (compilations.Select (c => c.MainAssembly.AssemblyName));
- var searchedAssemblies = new HashSet<string> ();
- var searchedTypes = new HashSet<string> ();
-
- foreach (var compilation in compilations) {
- var baseTypeImports = Import(compilation, searchTypes).Where (t => t != null).ToList ();
- if (!baseTypeImports.Any ()) continue;
-
- foreach (var assembly in compilation.Assemblies) {
- // search main assemblies in their projects' own compilation, to avoid possible resolving problems
- if ((mainAssemblies.Contains(assembly.AssemblyName) && assembly != compilation.MainAssembly) ||
- !searchedAssemblies.Add (assembly.AssemblyName))
- continue;
-
- foreach (var type in assembly.GetAllTypeDefinitions ()) {
- // members in base types will also be added
- // because IsDerivedFrom return true for a type itself
- if (!searchedTypes.Add (type.ReflectionName) || !baseTypeImports.Any (type.IsDerivedFrom))
- continue;
- result.AddRange (GetMembers (type, member, true, memberFilter));
- }
- }
- }
- if (!result.Contains (member))
- result.Add (member);
- return result;
- }
-
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/MemberReference.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/MemberReference.cs
index 44936f27f4..6501e434d2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/MemberReference.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/MemberReference.cs
@@ -25,16 +25,19 @@
// THE SOFTWARE.
using System;
using ICSharpCode.NRefactory.TypeSystem;
-using Mono.TextEditor.Highlighting;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Highlighting;
namespace MonoDevelop.Ide.FindInFiles
{
[Flags]
public enum ReferenceUsageType {
- Unknown = 0,
- Read = 1,
- Write = 2,
- ReadWrite = Read | Write
+ Unknown = 0,
+ Read = 1,
+ Write = 2,
+ Declariton = 4,
+ Keyword = 8,
+ ReadWrite = Read | Write
}
public class MemberReference : SearchResult
@@ -44,23 +47,24 @@ namespace MonoDevelop.Ide.FindInFiles
return new MonoDevelop.Ide.FindInFiles.FileProvider (FileName);
}
}
-
- public override string FileName {
+ readonly string fileName;
+ public override string FileName {
get {
- return Region.FileName;
+ return fileName;
}
}
public ReferenceUsageType ReferenceUsageType { get; set; }
public object EntityOrVariable { get; private set;}
- public DomRegion Region { get; private set;}
- public MemberReference (object entity, DomRegion region, int offset, int length) : base (offset, length)
+ public MemberReference (object entity, string fileName, int offset, int length) : base (offset, length)
{
if (entity == null)
throw new System.ArgumentNullException ("entity");
+ if (fileName == null)
+ throw new ArgumentNullException ("fileName");
EntityOrVariable = entity;
- Region = region;
+ this.fileName = fileName;
}
public string GetName ()
@@ -79,7 +83,8 @@ namespace MonoDevelop.Ide.FindInFiles
public override AmbientColor GetBackgroundMarkerColor (ColorScheme style)
{
- return (ReferenceUsageType & ReferenceUsageType.Write) != 0 ?
+ return (ReferenceUsageType & ReferenceUsageType.Write) != 0 ||
+ (ReferenceUsageType & ReferenceUsageType.Declariton) != 0?
style.ChangingUsagesRectangle :
style.UsagesRectangle;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/ReferencesFinder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/ReferencesFinder.cs
deleted file mode 100755
index 614fddddbe..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/ReferencesFinder.cs
+++ /dev/null
@@ -1,321 +0,0 @@
-//
-// ReferenceFinder.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Mono.Addins;
-using MonoDevelop.Core;
-using MonoDevelop.Projects;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Ide.TypeSystem;
-using System.Threading.Tasks;
-
-namespace MonoDevelop.Ide.FindInFiles
-{
- public abstract class ReferenceFinder
- {
- public bool IncludeDocumentation {
- get;
- set;
- }
-
- /*
- Project project;
- protected Project Project {
- get {
- if (project == null)
- project = Content.GetProject ();
- return project;
- }
- }*/
-
- static List<ReferenceFinderCodon> referenceFinderCodons = new List<ReferenceFinderCodon> ();
-
- static ReferenceFinder ()
- {
- AddinManager.AddExtensionNodeHandler ("/MonoDevelop/Ide/ReferenceFinder", delegate(object sender, ExtensionNodeEventArgs args) {
- var codon = (ReferenceFinderCodon)args.ExtensionNode;
- switch (args.Change) {
- case ExtensionChange.Add:
- referenceFinderCodons.Add (codon);
- break;
- case ExtensionChange.Remove:
- referenceFinderCodons.Remove (codon);
- break;
- }
- });
- }
-
- static ReferenceFinder GetReferenceFinder (string mimeType)
- {
- var codon = referenceFinderCodons.FirstOrDefault (c => c.SupportedMimeTypes.Any (mt => mt == mimeType));
- return codon != null ? codon.CreateFinder () : null;
- }
-
- public static IEnumerable<MemberReference> FindReferences (object member, bool searchForAllOverloads, IProgressMonitor monitor = null)
- {
- return FindReferences (IdeApp.ProjectOperations.CurrentSelectedSolution, member, searchForAllOverloads, RefactoryScope.Unknown, monitor);
- }
-
- public static IEnumerable<MemberReference> FindReferences (object member, bool searchForAllOverloads, RefactoryScope scope, IProgressMonitor monitor = null)
- {
- return FindReferences (IdeApp.ProjectOperations.CurrentSelectedSolution, member, searchForAllOverloads, scope, monitor);
- }
-
- static SearchCollector.FileList GetFileList (string fileName)
- {
- var doc = IdeApp.Workbench.GetDocument (fileName);
- if (doc != null)
- return new SearchCollector.FileList (doc.Project, doc.ProjectContent, new [] { (FilePath)fileName });
- return null;
- }
-
- static IEnumerable<SearchCollector.FileList> GetFileNames (Solution solution, object node, RefactoryScope scope,
- IProgressMonitor monitor, IEnumerable<object> searchNodes)
- {
- if (!(node is IField) && !(node is IParameter) && node is IVariable || scope == RefactoryScope.File) {
- string fileName;
- if (node is IEntity) {
- fileName = ((IEntity)node).Region.FileName;
- } else if (node is ITypeParameter) {
- fileName = ((ITypeParameter)node).Region.FileName;
- } else {
- fileName = ((IVariable)node).Region.FileName;
- }
- var fileList = GetFileList (fileName);
- if (fileList != null)
- yield return fileList;
- yield break;
- }
-
- if (node is ITypeParameter) {
- var typeParameter = node as ITypeParameter;
- if (typeParameter.Owner != null) {
- yield return SearchCollector.CollectDeclaringFiles (typeParameter.Owner);
- yield break;
- }
- var fileList = GetFileList (typeParameter.Region.FileName);
- if (fileList != null)
- yield return fileList;
- yield break;
- }
- var par = node as IParameter;
- if (par != null) {
- node = par.Owner;
- }
-
- var compilationProvider = (ICompilationProvider)node;
- switch (scope) {
- case RefactoryScope.DeclaringType:
- var entity = (IEntity)compilationProvider;
- if (entity.DeclaringTypeDefinition != null)
- yield return SearchCollector.CollectDeclaringFiles (entity.DeclaringTypeDefinition);
- else
- yield return SearchCollector.CollectDeclaringFiles (entity);
- break;
- case RefactoryScope.Project:
- var sourceProject = TypeSystemService.GetProject (compilationProvider.Compilation.MainAssembly.UnresolvedAssembly.Location);
- foreach (var file in SearchCollector.CollectFiles (sourceProject, searchNodes))
- yield return file;
- break;
- default:
- var files = SearchCollector.CollectFiles (solution, searchNodes).ToList ();
- if (monitor != null)
- monitor.BeginTask (GettextCatalog.GetString ("Searching for references in solution..."), files.Count);
- foreach (var file in files) {
- if (monitor != null && monitor.IsCancelRequested)
- yield break;
- yield return file;
- if (monitor != null)
- monitor.Step (1);
- }
- if (monitor != null)
- monitor.EndTask ();
- break;
- }
- }
-
- public static List<Project> GetAllReferencingProjects (Solution solution, Project sourceProject)
- {
- var projects = new List<Project> ();
- projects.Add (sourceProject);
- foreach (var project in solution.GetAllProjects ()) {
- if (project.GetReferencedItems (ConfigurationSelector.Default).Any (prj => prj == sourceProject))
- projects.Add (project);
- }
- return projects;
- }
-
- public static IEnumerable<MemberReference> FindReferences (Solution solution, object member, bool searchForAllOverloads, RefactoryScope scope = RefactoryScope.Unknown, IProgressMonitor monitor = null)
- {
- if (member == null)
- yield break;
- if (solution == null && member is IEntity) {
- var project = TypeSystemService.GetProject ((member as IEntity).Compilation.MainAssembly.UnresolvedAssembly.Location);
- if (project == null)
- yield break;
- solution = project.ParentSolution;
- }
-
- IList<object> searchNodes = new [] { member };
- if (member is ITypeParameter) {
- // nothing
- } else if (member is IType) {
- searchNodes = CollectMembers ((IType)member).ToList<object> ();
- } else if (member is IEntity) {
- var e = (IEntity)member;
- if (e.SymbolKind == SymbolKind.Destructor) {
- foreach (var r in FindReferences (solution, e.DeclaringType, searchForAllOverloads, scope, monitor)) {
- yield return r;
- }
- yield break;
- }
- if (member is IMember)
- searchNodes = CollectMembers (solution, (IMember)member, scope, searchForAllOverloads).ToList<object> ();
- }
- // prepare references finder
- var preparedFinders = new List<Tuple<ReferenceFinder, Project, IProjectContent, List<FilePath>>> ();
- var curList = new List<FilePath> ();
- int totalFiles = 0;
- foreach (var info in GetFileNames (solution, member, scope, monitor, searchNodes)) {
- string oldMime = null;
- foreach (var file in info.Files) {
- if (monitor != null && monitor.IsCancelRequested)
- yield break;
-
- string mime = DesktopService.GetMimeTypeForUri (file);
- if (mime != oldMime) {
- var finder = GetReferenceFinder (mime);
- if (finder == null)
- continue;
-
- oldMime = mime;
-
- curList = new List<FilePath> ();
- preparedFinders.Add (Tuple.Create (finder, info.Project, info.Content, curList));
- }
- curList.Add (file);
- totalFiles++;
- }
- }
-
- // execute search
- if (monitor != null)
- monitor.BeginTask (GettextCatalog.GetString ("Analyzing files..."), totalFiles);
- var foundOccurrences = new HashSet<Tuple<string, DomRegion>> ();
- foreach (var tuple in preparedFinders) {
- var finder = tuple.Item1;
- foreach (var foundReference in finder.FindReferences (tuple.Item2, tuple.Item3, tuple.Item4, monitor, searchNodes)) {
- if (monitor != null && monitor.IsCancelRequested)
- yield break;
- var tag = Tuple.Create (foundReference.FileName, foundReference.Region);
- if (foundOccurrences.Contains (tag))
- continue;
- foundOccurrences.Add (tag);
- yield return foundReference;
- }
- }
- if (monitor != null)
- monitor.EndTask ();
- }
-
- public abstract IEnumerable<MemberReference> FindReferences (Project project, IProjectContent content, IEnumerable<FilePath> files, IProgressMonitor monitor, IEnumerable<object> searchedMembers);
-
- internal static IEnumerable<IMember> CollectMembers (Solution solution, IMember member, RefactoryScope scope, bool includeOverloads = true)
- {
- return MemberCollector.CollectMembers (solution, member, scope, includeOverloads);
- }
-
- internal static IEnumerable<IEntity> CollectMembers (IType type)
- {
- var typeDefinition = type.GetDefinition ();
- if (typeDefinition == null)
- yield break;
- yield return (IEntity)typeDefinition;
- foreach (var c in typeDefinition.GetMembers (m => m.SymbolKind == SymbolKind.Constructor, GetMemberOptions.IgnoreInheritedMembers)) {
- if (!c.IsSynthetic)
- yield return c;
- }
-
- foreach (var m in type.GetMethods (m => m.IsDestructor, GetMemberOptions.IgnoreInheritedMembers)) {
- yield return m;
- }
- }
-
-
- public enum RefactoryScope{ Unknown, File, DeclaringType, Solution, Project}
-// static RefactoryScope GetScope (object o)
-// {
-// IEntity node = o as IEntity;
-// if (node == null)
-// return RefactoryScope.File;
-//
-// // TODO: RefactoringsScope.Hierarchy
-// switch (node.Accessibility) {
-// case Accessibility.Public:
-// case Accessibility.Protected:
-// case Accessibility.ProtectedOrInternal:
-// if (node.DeclaringTypeDefinition != null) {
-// var scope = GetScope (node.DeclaringTypeDefinition);
-// if (scope != RefactoryScope.Solution)
-// return RefactoryScope.Project;
-// }
-// return RefactoryScope.Solution;
-// case Accessibility.Internal:
-// case Accessibility.ProtectedAndInternal:
-// return RefactoryScope.Project;
-// }
-// return RefactoryScope.DeclaringType;
-// }
- }
-
- [ExtensionNode (Description="A reference finder. The specified class needs to inherit from MonoDevelop.Projects.CodeGeneration.ReferenceFinder")]
- internal class ReferenceFinderCodon : TypeExtensionNode
- {
- [NodeAttribute("supportedmimetypes", "Mime types supported by this binding (to be shown in the Open File dialog)")]
- string[] supportedMimetypes;
-
- public string[] SupportedMimeTypes {
- get {
- return supportedMimetypes;
- }
- set {
- supportedMimetypes = value;
- }
- }
-
- public ReferenceFinder CreateFinder ()
- {
- return (ReferenceFinder)CreateInstance ();
- }
-
- public override string ToString ()
- {
- return string.Format ("[ReferenceFinderCodon: SupportedMimeTypes={0}]", SupportedMimeTypes);
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/Scope.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/Scope.cs
index f6a6a64069..bc5e52830b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/Scope.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/Scope.cs
@@ -49,7 +49,7 @@ namespace MonoDevelop.Ide.FindInFiles
var workspace = IdeApp.Workspace;
var solutions = workspace != null ? workspace.GetAllSolutions () : null;
- if (solutions != null && solutions.Count == 1)
+ if (solutions != null && solutions.Count () == 1)
return PathMode.Relative;
return PathMode.Absolute;
@@ -57,7 +57,7 @@ namespace MonoDevelop.Ide.FindInFiles
}
public abstract int GetTotalWork (FilterOptions filterOptions);
- public abstract IEnumerable<FileProvider> GetFiles (IProgressMonitor monitor, FilterOptions filterOptions);
+ public abstract IEnumerable<FileProvider> GetFiles (ProgressMonitor monitor, FilterOptions filterOptions);
public abstract string GetDescription (FilterOptions filterOptions, string pattern, string replacePattern);
}
@@ -70,9 +70,9 @@ namespace MonoDevelop.Ide.FindInFiles
public override int GetTotalWork (FilterOptions filterOptions)
{
return 1;
- }
-
- public override IEnumerable<FileProvider> GetFiles (IProgressMonitor monitor, FilterOptions filterOptions)
+ }
+
+ public override IEnumerable<FileProvider> GetFiles (ProgressMonitor monitor, FilterOptions filterOptions)
{
monitor.Log.WriteLine (GettextCatalog.GetString ("Looking in '{0}'", IdeApp.Workbench.ActiveDocument.FileName));
yield return new FileProvider(IdeApp.Workbench.ActiveDocument.FileName);
@@ -96,9 +96,9 @@ namespace MonoDevelop.Ide.FindInFiles
public override int GetTotalWork (FilterOptions filterOptions)
{
return 1;
- }
-
- public override IEnumerable<FileProvider> GetFiles (IProgressMonitor monitor, FilterOptions filterOptions)
+ }
+
+ public override IEnumerable<FileProvider> GetFiles (ProgressMonitor monitor, FilterOptions filterOptions)
{
var selection = IdeApp.Workbench.ActiveDocument.Editor.SelectionRange;
yield return new FileProvider(IdeApp.Workbench.ActiveDocument.FileName, null, selection.Offset, selection.EndOffset);
@@ -122,8 +122,8 @@ namespace MonoDevelop.Ide.FindInFiles
result = IdeApp.Workspace.GetAllProjects ().Sum (p => p.Files.Count);
return result;
}
-
- public override IEnumerable<FileProvider> GetFiles (IProgressMonitor monitor, FilterOptions filterOptions)
+
+ public override IEnumerable<FileProvider> GetFiles (ProgressMonitor monitor, FilterOptions filterOptions)
{
if (IdeApp.Workspace.IsOpen) {
var alreadyVisited = new HashSet<string> ();
@@ -140,7 +140,8 @@ namespace MonoDevelop.Ide.FindInFiles
}
foreach (Project project in IdeApp.Workspace.GetAllProjects ()) {
monitor.Log.WriteLine (GettextCatalog.GetString ("Looking in project '{0}'", project.Name));
- foreach (ProjectFile file in project.Files.Where (f => filterOptions.NameMatches (f.Name) && File.Exists (f.Name))) {
+ var conf = project.DefaultConfiguration?.Selector;
+ foreach (ProjectFile file in project.GetSourceFilesAsync (conf).Result.Where (f => filterOptions.NameMatches (f.Name) && File.Exists (f.Name))) {
if ((file.Flags & ProjectItemFlags.Hidden) == ProjectItemFlags.Hidden)
continue;
if (!IncludeBinaryFiles && !DesktopService.GetFileIsText (file.FilePath))
@@ -153,7 +154,7 @@ namespace MonoDevelop.Ide.FindInFiles
}
}
}
-
+
public override string GetDescription (FilterOptions filterOptions, string pattern, string replacePattern)
{
if (replacePattern == null)
@@ -161,30 +162,31 @@ namespace MonoDevelop.Ide.FindInFiles
return GettextCatalog.GetString ("Replacing '{0}' in all projects", pattern);
}
}
-
+
public class WholeProjectScope : Scope
- {
+ {
readonly Project project;
-
+
public override int GetTotalWork (FilterOptions filterOptions)
{
return project.Files.Count;
}
-
+
public WholeProjectScope (Project project)
{
if (project == null)
throw new ArgumentNullException ("project");
-
+
this.project = project;
}
-
- public override IEnumerable<FileProvider> GetFiles (IProgressMonitor monitor, FilterOptions filterOptions)
+
+ public override IEnumerable<FileProvider> GetFiles (ProgressMonitor monitor, FilterOptions filterOptions)
{
if (IdeApp.Workspace.IsOpen) {
monitor.Log.WriteLine (GettextCatalog.GetString ("Looking in project '{0}'", project.Name));
var alreadyVisited = new HashSet<string> ();
- foreach (ProjectFile file in project.Files.Where (f => filterOptions.NameMatches (f.Name) && File.Exists (f.Name))) {
+ var conf = project.DefaultConfiguration?.Selector;
+ foreach (ProjectFile file in project.GetSourceFilesAsync (conf).Result.Where (f => filterOptions.NameMatches (f.Name) && File.Exists (f.Name))) {
if ((file.Flags & ProjectItemFlags.Hidden) == ProjectItemFlags.Hidden)
continue;
if (!IncludeBinaryFiles && !DesktopService.GetFileIsText (file.Name))
@@ -196,7 +198,7 @@ namespace MonoDevelop.Ide.FindInFiles
}
}
}
-
+
public override string GetDescription (FilterOptions filterOptions, string pattern, string replacePattern)
{
if (replacePattern == null)
@@ -204,16 +206,16 @@ namespace MonoDevelop.Ide.FindInFiles
return GettextCatalog.GetString ("Replacing '{0}' in project '{1}'", pattern, project.Name);
}
}
-
-
+
+
public class AllOpenFilesScope : Scope
{
public override int GetTotalWork (FilterOptions filterOptions)
{
return IdeApp.Workbench.Documents.Count;
- }
-
- public override IEnumerable<FileProvider> GetFiles (IProgressMonitor monitor, FilterOptions filterOptions)
+ }
+
+ public override IEnumerable<FileProvider> GetFiles (ProgressMonitor monitor, FilterOptions filterOptions)
{
foreach (Document document in IdeApp.Workbench.Documents) {
monitor.Log.WriteLine (GettextCatalog.GetString ("Looking in '{0}'", document.FileName));
@@ -221,7 +223,7 @@ namespace MonoDevelop.Ide.FindInFiles
yield return new FileProvider (document.FileName);
}
}
-
+
public override string GetDescription (FilterOptions filterOptions, string pattern, string replacePattern)
{
if (replacePattern == null)
@@ -229,11 +231,11 @@ namespace MonoDevelop.Ide.FindInFiles
return GettextCatalog.GetString ("Replacing '{0}' in all open documents", pattern);
}
}
-
-
+
+
public class DirectoryScope : Scope
- {
- readonly string path;
+ {
+ readonly string path;
readonly bool recurse;
public override PathMode PathMode {
@@ -244,19 +246,19 @@ namespace MonoDevelop.Ide.FindInFiles
get;
set;
}
-
+
public override int GetTotalWork (FilterOptions filterOptions)
{
return GetFileNames (null, filterOptions).Count ();
}
-
+
public DirectoryScope (string path, bool recurse)
{
this.path = path;
this.recurse = recurse;
}
-
- IEnumerable<string> GetFileNames (IProgressMonitor monitor, FilterOptions filterOptions)
+
+ IEnumerable<string> GetFileNames (ProgressMonitor monitor, FilterOptions filterOptions)
{
if (monitor != null)
monitor.Log.WriteLine (GettextCatalog.GetString ("Looking in '{0}'", path));
@@ -308,12 +310,12 @@ namespace MonoDevelop.Ide.FindInFiles
}
}
-
- public override IEnumerable<FileProvider> GetFiles (IProgressMonitor monitor, FilterOptions filterOptions)
- {
- return GetFileNames (monitor, filterOptions).Select (file => new FileProvider (file));
- }
-
+
+ public override IEnumerable<FileProvider> GetFiles (ProgressMonitor monitor, FilterOptions filterOptions)
+ {
+ return GetFileNames (monitor, filterOptions).Select (file => new FileProvider (file));
+ }
+
public override string GetDescription (FilterOptions filterOptions, string pattern, string replacePattern)
{
if (replacePattern == null)
@@ -321,4 +323,4 @@ namespace MonoDevelop.Ide.FindInFiles
return GettextCatalog.GetString ("Replacing '{0}' in directory '{1}'", pattern, path);
}
}
-}
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchCollector.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchCollector.cs
deleted file mode 100755
index e33d6099f4..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchCollector.cs
+++ /dev/null
@@ -1,272 +0,0 @@
-//
-// SearchCollector.cs
-//
-// Author:
-// Mansheng Yang <lightyang0@gmail.com>
-//
-// Copyright (c) 2012 Mansheng Yang
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Core;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.TypeSystem;
-
-namespace MonoDevelop.Ide.FindInFiles
-{
- public class SearchCollector
- {
-
- public class FileList
- {
- public Project Project
- {
- get;
- private set;
- }
-
- public IProjectContent Content
- {
- get;
- private set;
- }
-
- public IEnumerable<FilePath> Files
- {
- get;
- private set;
- }
-
- public FileList (Project project, IProjectContent content, IEnumerable<FilePath> files)
- {
- Project = project;
- Content = content;
- Files = files;
- }
- }
-
- public static IEnumerable<Project> CollectProjects (Solution solution, IEnumerable<object> entities)
- {
- return new SearchCollector (solution, null, entities).CollectProjects ();
- }
-
- public static IEnumerable<FileList> CollectFiles (Project project, IEnumerable<object> entities)
- {
- return new SearchCollector (project.ParentSolution, project, entities).CollectFiles ();
- }
-
- public static IEnumerable<FileList> CollectFiles (Solution solution, IEnumerable<object> entities)
- {
- return new SearchCollector (solution, null, entities).CollectFiles ();
- }
-
- static IEnumerable<Project> GetAllReferencingProjects (Solution solution, string assemblyName)
- {
- return solution.GetAllProjects ().Where (
- project => TypeSystemService.GetCompilation (project).Assemblies.Any (a => a.AssemblyName == assemblyName));
- }
-
- static FileList CollectDeclaringFiles (IEntity entity, IEnumerable<string> fileNames)
- {
- var project = TypeSystemService.GetProject (entity);
- var paths = fileNames.Distinct().Select (p => (FilePath)p);
- return new SearchCollector.FileList (project, TypeSystemService.GetProjectContext (project), paths);
- }
-
- public static FileList CollectDeclaringFiles (IEntity entity)
- {
- if (entity is ITypeDefinition)
- return CollectDeclaringFiles (entity, (entity as ITypeDefinition).Parts.Select (p => p.Region.FileName));
- if (entity is IMethod)
- return CollectDeclaringFiles (entity, (entity as IMethod).Parts.Select (p => p.Region.FileName));
- return CollectDeclaringFiles (entity, new [] { entity.Region.FileName });
- }
-
- Project searchProject;
- bool searchProjectAdded; // if the searchProject is added, we can stop collecting
- Solution solution;
- IEnumerable<object> entities;
- bool projectOnly; // only collect projects
-
- IDictionary<Project, ISet<string>> collectedFiles = new Dictionary<Project, ISet<string>> ();
- ISet<Project> collectedProjects = new HashSet<Project> ();
-
- ISet<string> searchedAssemblies = new HashSet<string> ();
- ISet<Project> searchedProjects = new HashSet<Project> ();
-
- /// <param name="searchProject">the project to search. use to null to search the whole solution</param>
- SearchCollector (Solution solution, Project searchProject, IEnumerable<object> entities)
- {
- this.solution = solution;
- this.searchProject = searchProject;
- this.entities = entities;
- }
-
- IEnumerable<Project> CollectProjects ()
- {
- projectOnly = true;
- foreach (var o in entities) {
- var entity = o as IEntity;
- if (entity != null) {
- Collect (TypeSystemService.GetProject (entity), entity);
- continue;
- }
- var par = o as IParameter;
- if (par != null) {
- Collect (TypeSystemService.GetProject (par.Owner), par.Owner);
- continue;
- }
- }
- return collectedProjects;
- }
-
- IEnumerable<FileList> CollectFiles ()
- {
- projectOnly = false;
- foreach (var o in entities) {
- if (o is INamespace) {
- Collect (null, null);
- continue;
- }
-
- var par = o as IParameter;
- if (par != null) {
- if (par.Owner != null) {
- Collect (TypeSystemService.GetProject (par.Owner), par.Owner);
- } else {
- Collect (IdeApp.Workbench.ActiveDocument.Project, null);
- }
- } else {
- var entity = o as IEntity;
- if (entity == null)
- continue;
- Collect (TypeSystemService.GetProject (entity), entity);
- }
-
- if (searchProjectAdded) break;
- }
- foreach (var project in collectedProjects)
- yield return new FileList (project, TypeSystemService.GetProjectContext (project), project.Files.Where (f => f.BuildAction == BuildAction.Compile).Select (f => f.FilePath));
-
- foreach (var files in collectedFiles)
- yield return new FileList (files.Key, TypeSystemService.GetProjectContext (files.Key), files.Value.Select (f => (FilePath)f));
- }
-
- void AddProject (Project project)
- {
- if (project == null)
- throw new ArgumentNullException ("project");
-
- searchProjectAdded = (project == searchProject);
-
- // remove duplicate files
- if (collectedProjects.Add (project))
- collectedFiles.Remove (project);
- }
-
- void AddFiles (Project project, IEnumerable<string> files)
- {
- if (project == null)
- throw new ArgumentNullException ("project");
-
- if (collectedProjects.Contains (project))
- return;
-
- ISet<string> fileSet;
- if (!collectedFiles.TryGetValue (project, out fileSet)) {
- fileSet = new HashSet<string> ();
- collectedFiles[project] = fileSet;
- }
-
- foreach (var file in files)
- fileSet.Add (file);
- }
-
- void Collect (Project sourceProject, IEntity entity, bool searchInProject = false)
- {
- if (searchedProjects.Contains(sourceProject))
- return;
-
- if (searchProject != null && sourceProject != searchProject) {
- // searching for a entity not defined in the project
- AddProject (searchProject);
- return;
- }
-
- if (sourceProject == null) {
- if (entity == null) {
- foreach (var project in solution.GetAllProjects ())
- AddProject (project);
- return;
- }
- // entity is defined in a referenced assembly
- var assemblyName = entity.ParentAssembly.AssemblyName;
- if (!searchedAssemblies.Add (assemblyName))
- return;
- foreach (var project in GetAllReferencingProjects (solution, assemblyName))
- AddProject (project);
-
- return;
- }
-
- if (entity == null) {
- AddProject (sourceProject);
- return;
- }
-
- var declaringType = entity.DeclaringTypeDefinition;
- // TODO: possible optimization for protected
- switch (entity.Accessibility) {
- case Accessibility.Public:
- case Accessibility.Protected:
- case Accessibility.ProtectedOrInternal:
- case Accessibility.Internal:
- case Accessibility.ProtectedAndInternal:
-
- if (declaringType != null)
- Collect (sourceProject, entity.DeclaringTypeDefinition, searchInProject);
- else if (searchProject != null || searchInProject)
- AddProject (sourceProject);
- else {
- foreach (var project in ReferenceFinder.GetAllReferencingProjects (solution, sourceProject)) {
- if (entity.Accessibility == Accessibility.Internal || entity.Accessibility == Accessibility.ProtectedAndInternal) {
- var wrapper = TypeSystemService.GetProjectContentWrapper (project);
- if (wrapper == null)
- continue;
- if (!entity.ParentAssembly.InternalsVisibleTo (wrapper.Compilation.MainAssembly))
- continue;
- }
- AddProject (project);
- }
- }
- break;
- default: // private
- if (projectOnly)
- AddProject (sourceProject);
- else if (declaringType != null)
- AddFiles (sourceProject, declaringType.Parts.Select (p => p.Region.FileName));
- break;
- }
- }
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchProgressMonitor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchProgressMonitor.cs
index e03413c1bf..411cef17c2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchProgressMonitor.cs
@@ -31,68 +31,73 @@ using System.Collections.Generic;
using MonoDevelop.Core;
using MonoDevelop.Ide.ProgressMonitoring;
using MonoDevelop.Ide.Gui;
+using System.Threading;
namespace MonoDevelop.Ide.FindInFiles
{
- class SearchProgressMonitor : BaseProgressMonitor, ISearchProgressMonitor
+ public class SearchProgressMonitor : ProgressMonitor, ISearchProgressMonitor
{
- SearchResultPad outputPad;
- readonly IProgressMonitor statusMonitor;
+ SearchResultPad outputPad;
+
+ internal SearchResultPad ResultPad {
+ get {
+ return outputPad;
+ }
+ }
- public SearchProgressMonitor (Pad pad)
+ internal SearchProgressMonitor (Pad pad, CancellationTokenSource cancellationTokenSource = null): base (Runtime.MainSynchronizationContext, cancellationTokenSource)
{
+ AddFollowerMonitor (IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor (GettextCatalog.GetString ("Searching..."), Stock.StatusSearch, false, true, false, pad));
+
outputPad = (SearchResultPad) pad.Content;
- outputPad.AsyncOperation = AsyncOperation;
+ outputPad.CancellationTokenSource = CancellationTokenSource;
outputPad.BeginProgress (pad.Title);
- statusMonitor = IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor (GettextCatalog.GetString ("Searching..."), Stock.StatusSearch, false, true, false, pad);
- }
-
- [FreeDispatch]
- public bool AllowReuse {
- get { return outputPad.AllowReuse; }
}
public PathMode PathMode {
- set { outputPad.PathMode = value; }
+ set { Runtime.RunInMainThread (delegate { outputPad.PathMode = value; }); }
}
- [AsyncDispatch]
public void ReportResult (SearchResult result)
{
- try {
- outputPad.ReportResult (result);
- } catch (Exception ex) {
- LoggingService.LogError ("Error adding search result for file {0}:{1} to result pad:\n{2}",
- result.FileName, result.Offset, ex.ToString ());
- }
+ Runtime.RunInMainThread (delegate {
+ try {
+ outputPad.ReportResult (result);
+ } catch (Exception ex) {
+ LoggingService.LogError ("Error adding search result for file {0}:{1} to result pad:\n{2}",
+ result.FileName, result.Offset, ex.ToString ());
+ }
+ });
}
- [AsyncDispatch]
public void ReportResults (IEnumerable<SearchResult> results)
{
- try {
- outputPad.ReportResults (results);
- } catch (Exception ex) {
- LoggingService.LogError ("Error adding search results.", ex.ToString ());
- }
+ Runtime.RunInMainThread (delegate {
+ try {
+ outputPad.ReportResults (results);
+ } catch (Exception ex) {
+ LoggingService.LogError ("Error adding search results.", ex.ToString ());
+ }
+ });
}
- [AsyncDispatch]
public void ReportStatus (string resultMessage)
{
- outputPad.ReportStatus (resultMessage);
+ Runtime.RunInMainThread (delegate {
+ outputPad.ReportStatus (resultMessage);
+ });
}
protected override void OnWriteLog (string text)
{
if (outputPad == null) throw GetDisposedException ();
- outputPad.WriteText (text);
+ Runtime.RunInMainThread (delegate {
+ outputPad.WriteText (text);
+ });
}
protected override void OnCompleted ()
{
- statusMonitor.Dispose ();
-
if (outputPad == null) throw GetDisposedException ();
outputPad.WriteText ("\n");
@@ -102,8 +107,8 @@ namespace MonoDevelop.Ide.FindInFiles
foreach (string msg in Warnings)
outputPad.WriteText (msg + "\n");
- foreach (string msg in Errors)
- outputPad.WriteText (msg + "\n");
+ foreach (var msg in Errors)
+ outputPad.WriteText (msg.Message + "\n");
outputPad.EndProgress ();
base.OnCompleted ();
@@ -115,47 +120,5 @@ namespace MonoDevelop.Ide.FindInFiles
{
return new InvalidOperationException ("Search progress monitor already disposed.");
}
-
- public override void ReportError (string message, Exception ex)
- {
- base.ReportError (message, ex);
- statusMonitor.ReportError (message, ex);
- }
-
- public override void ReportSuccess (string message)
- {
- base.ReportSuccess (message);
- statusMonitor.ReportSuccess (message);
- }
-
- public override void ReportWarning (string message)
- {
- base.ReportWarning (message);
- statusMonitor.ReportWarning (message);
- }
-
- public override void Step (int work)
- {
- base.Step (work);
- statusMonitor.Step (work);
- }
-
- public override void BeginStepTask (string name, int totalWork, int stepSize)
- {
- base.BeginStepTask (name, totalWork, stepSize);
- statusMonitor.BeginStepTask (name, totalWork, stepSize);
- }
-
- public override void BeginTask (string name, int totalWork)
- {
- base.BeginTask (name, totalWork);
- statusMonitor.BeginTask (name, totalWork);
- }
-
- public override void EndTask ()
- {
- base.EndTask ();
- statusMonitor.EndTask ();
- }
}
} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResult.cs
index 0c70cd1b08..0c0265becd 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResult.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResult.cs
@@ -26,19 +26,20 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using Mono.TextEditor.Highlighting;
-using MonoDevelop.Projects;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Highlighting;
using System.Collections.Generic;
-using System;
-
+using MonoDevelop.Projects;
+using System;
+
namespace MonoDevelop.Ide.FindInFiles
{
public class SearchResult
{
public virtual FileProvider FileProvider { get; private set; }
- public int Offset { get; set; }
- public int Length { get; set; }
+ public int Offset { get; set; }
+ public int Length { get; set; }
public virtual string FileName {
get {
@@ -47,36 +48,6 @@ namespace MonoDevelop.Ide.FindInFiles
}
#region Cached data
- public int LineNumber {
- get;
- set;
- }
-
- public string Markup {
- get;
- set;
- }
-
- public uint StartIndex {
- get;
- set;
- }
-
- public uint EndIndex {
- get;
- set;
- }
-
- public Xwt.Drawing.Image FileIcon {
- get;
- set;
- }
-
- public Xwt.Drawing.Image ProjectIcon {
- get;
- set;
- }
-
private List<Project> projects;
public List<Project> Projects {
get {
@@ -88,7 +59,6 @@ namespace MonoDevelop.Ide.FindInFiles
}
#endregion
-
protected SearchResult (int offset, int length)
{
Offset = offset;
@@ -111,7 +81,5 @@ namespace MonoDevelop.Ide.FindInFiles
{
return style.SearchResult;
}
-
- internal string PathMarkup, FileNameMarkup, ProjectNameMarkup, TextMarkup;
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultPad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultPad.cs
index d433a6fcd4..5311dca0d1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultPad.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultPad.cs
@@ -24,17 +24,20 @@
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
+//
+
using System.Collections.Generic;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Core;
using MonoDevelop.Components.Commands;
-using MonoDevelop.Ide.Commands;
+using MonoDevelop.Ide.Commands;
+using System.Threading;
+using MonoDevelop.Components;
+using System;
namespace MonoDevelop.Ide.FindInFiles
{
- public class SearchResultPad : AbstractPadContent
+ public class SearchResultPad : PadContent
{
readonly SearchResultWidget widget = new SearchResultWidget ();
@@ -44,18 +47,18 @@ namespace MonoDevelop.Ide.FindInFiles
}
}
- public override Gtk.Widget Control {
+ public override Control Control {
get {
return widget;
}
}
- public IAsyncOperation AsyncOperation {
+ public CancellationTokenSource CancellationTokenSource {
get {
- return widget.AsyncOperation;
+ return widget.CancellationTokenSource;
}
set {
- widget.AsyncOperation = value;
+ widget.CancellationTokenSource = value;
}
}
public bool FocusPad {
@@ -94,11 +97,24 @@ namespace MonoDevelop.Ide.FindInFiles
widget.AddRange (results);
}
- public override void Initialize (IPadWindow window)
+ protected override void Initialize (IPadWindow window)
{
window.Icon = Stock.FindIcon;
+
+ IdeApp.Workspace.LastWorkspaceItemClosed += OnLastWorkspaceItemClosed;
base.Initialize (window);
}
+
+ public override void Dispose ()
+ {
+ IdeApp.Workspace.LastWorkspaceItemClosed -= OnLastWorkspaceItemClosed;
+ base.Dispose ();
+ }
+
+ void OnLastWorkspaceItemClosed (object sender, EventArgs args)
+ {
+ widget.Reset ();
+ }
public void BeginProgress (string title)
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs
index ae2c5513ea..1012420af4 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs
@@ -30,9 +30,7 @@ using System.Linq;
using Gdk;
using Gtk;
-using Mono.TextEditor;
-using Mono.TextEditor.Highlighting;
using System.Collections.Generic;
using MonoDevelop.Core;
using System.Text;
@@ -42,6 +40,11 @@ using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Navigation;
using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.Components;
+using System.Threading;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Editor.Highlighting;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.FindInFiles
{
@@ -56,7 +59,7 @@ namespace MonoDevelop.Ide.FindInFiles
const int SearchResultColumn = 0;
const int DidReadColumn = 1;
- Mono.TextEditor.Highlighting.ColorScheme highlightStyle;
+ ColorScheme highlightStyle;
ScrolledWindow scrolledwindowLogView;
PadTreeView treeviewSearchResults;
@@ -64,6 +67,11 @@ namespace MonoDevelop.Ide.FindInFiles
TextView textviewLog;
TreeViewColumn pathColumn;
+ public CancellationTokenSource CancellationTokenSource {
+ get;
+ set;
+ }
+
private PathMode pathMode;
internal PathMode PathMode {
set {
@@ -73,11 +81,6 @@ namespace MonoDevelop.Ide.FindInFiles
}
}
- public IAsyncOperation AsyncOperation {
- get;
- set;
- }
-
public bool AllowReuse {
get {
return !buttonStop.Sensitive && !buttonPin.Active;
@@ -178,24 +181,24 @@ namespace MonoDevelop.Ide.FindInFiles
treeviewSearchResults.RowActivated += TreeviewSearchResultsRowActivated;
- buttonStop = new ToolButton (Ide.Gui.Stock.Stop) { Sensitive = false };
-
+ buttonStop = new ToolButton (new ImageView (Gui.Stock.Stop, Gtk.IconSize.Menu), null) { Sensitive = false };
buttonStop.Clicked += ButtonStopClicked;
-
buttonStop.TooltipText = GettextCatalog.GetString ("Stop");
toolbar.Insert (buttonStop, -1);
- var buttonClear = new ToolButton (Ide.Gui.Stock.Clear);
+ var buttonClear = new ToolButton (new ImageView (Gui.Stock.Clear, Gtk.IconSize.Menu), null);
buttonClear.Clicked += ButtonClearClicked;
buttonClear.TooltipText = GettextCatalog.GetString ("Clear results");
toolbar.Insert (buttonClear, -1);
- var buttonOutput = new ToggleToolButton (Gui.Stock.OutputIcon);
+ var buttonOutput = new ToggleToolButton ();
+ buttonOutput.IconWidget = new ImageView (Gui.Stock.OutputIcon, Gtk.IconSize.Menu);
buttonOutput.Clicked += ButtonOutputClicked;
buttonOutput.TooltipText = GettextCatalog.GetString ("Show output");
toolbar.Insert (buttonOutput, -1);
- buttonPin = new ToggleToolButton (Gui.Stock.PinUp);
+ buttonPin = new ToggleToolButton ();
+ buttonPin.IconWidget = new ImageView (Gui.Stock.PinUp, Gtk.IconSize.Menu);
buttonPin.Clicked += ButtonPinClicked;
buttonPin.TooltipText = GettextCatalog.GetString ("Pin results pad");
toolbar.Insert (buttonPin, -1);
@@ -206,12 +209,24 @@ namespace MonoDevelop.Ide.FindInFiles
scrolledwindowLogView.Hide ();
treeviewSearchResults.FixedHeightMode = true;
+ UpdateStyles ();
+ IdeApp.Preferences.ColorScheme.Changed += UpdateStyles;
}
-
- protected override void OnRealized ()
+
+ void UpdateStyles (object sender = null, EventArgs e = null)
{
- base.OnRealized ();
highlightStyle = SyntaxModeService.GetColorStyle (IdeApp.Preferences.ColorScheme);
+ if (!highlightStyle.FitsIdeSkin (IdeApp.Preferences.UserInterfaceSkin))
+ highlightStyle = SyntaxModeService.GetDefaultColorStyle (Ide.IdeApp.Preferences.UserInterfaceSkin);
+
+ if (markupCache != null)
+ markupCache = new List<Tuple<SearchResult, string>> ();
+ if (IsRealized) {
+ store.Foreach ((model, path, iter) => {
+ model.EmitRowChanged (path, iter);
+ return false;
+ });
+ }
}
void ButtonPinClicked (object sender, EventArgs e)
@@ -235,8 +250,8 @@ namespace MonoDevelop.Ide.FindInFiles
void ButtonStopClicked (object sender, EventArgs e)
{
- if (AsyncOperation != null)
- AsyncOperation.Cancel ();
+ if (CancellationTokenSource != null)
+ CancellationTokenSource.Cancel ();
}
void TreeviewSearchResultsRowActivated(object o, RowActivatedArgs args)
@@ -252,6 +267,7 @@ namespace MonoDevelop.Ide.FindInFiles
newStore.SetSortFunc (1, CompareProjectFileNames);
newStore.SetSortFunc (2, CompareFileNames);
newStore.SetSortFunc (3, CompareFilePaths);
+ newStore.SetSortColumnId (2, SortType.Ascending);
Reset ();
buttonStop.Sensitive = true;
treeviewSearchResults.FreezeChildNotify ();
@@ -284,10 +300,14 @@ namespace MonoDevelop.Ide.FindInFiles
treeviewSearchResults.ScrollToPoint (0, 0);
ResultCount = 0;
- documents = new Dictionary<string, TextDocument> ();
+ foreach (var doc in documents) {
+ doc.Value.Dispose ();
+ }
+ documents = new Dictionary<string, TextEditor> ();
store.Clear ();
labelStatus.Text = "";
textviewLog.Buffer.Clear ();
+ markupCache = new List<Tuple<SearchResult, string>> ();
}
protected override void OnDestroyed ()
@@ -298,15 +318,15 @@ namespace MonoDevelop.Ide.FindInFiles
static Color AdjustColor (Color baseColor, Color color)
{
- double b1 = Mono.TextEditor.HslColor.Brightness (color);
- double b2 = Mono.TextEditor.HslColor.Brightness (baseColor);
+ double b1 = HslColor.Brightness (color);
+ double b2 = HslColor.Brightness (baseColor);
double delta = Math.Abs (b1 - b2);
if (delta < 0.1) {
- Mono.TextEditor.HslColor color1 = color;
- color1.L -= 0.5;
- if (Math.Abs (Mono.TextEditor.HslColor.Brightness (color1) - b2) < delta) {
+ HslColor color1 = color;
+ color1.L += IdeApp.Preferences.UserInterfaceSkin == Skin.Light ? -0.5 : 0.5;
+ if (Math.Abs (HslColor.Brightness (color1) - b2) < delta) {
color1 = color;
- color1.L += 0.5;
+ color1.L += IdeApp.Preferences.UserInterfaceSkin == Skin.Light ? 0.5 : -0.5;
}
return color1;
}
@@ -338,7 +358,7 @@ namespace MonoDevelop.Ide.FindInFiles
Color color = Color.Zero;
if (Color.Parse(colorStr, ref color))
- colorStr = SyntaxMode.ColorToPangoMarkup(AdjustColor(baseColor, color));
+ colorStr = ColorToPangoMarkup(AdjustColor(baseColor, color));
result.Append (colorStr);
idx = markup.IndexOf ("foreground=\"", idx, StringComparison.Ordinal);
@@ -346,8 +366,11 @@ namespace MonoDevelop.Ide.FindInFiles
result.Append (markup.Substring (offset, markup.Length - offset));
return result.ToString ();
}
-
- void DoPopupMenu (EventButton evt)
+ public static string ColorToPangoMarkup (Gdk.Color color)
+ {
+ return string.Format ("#{0:X2}{1:X2}{2:X2}", color.Red >> 8, color.Green >> 8, color.Blue >> 8);
+ }
+ void DoPopupMenu (Gdk.EventButton evt)
{
IdeApp.CommandService.ShowContextMenu (this.treeviewSearchResults, evt, new CommandEntrySet {
new CommandEntry (ViewCommands.Open),
@@ -369,9 +392,7 @@ namespace MonoDevelop.Ide.FindInFiles
var searchResult = (SearchResult)store.GetValue (iter, SearchResultColumn);
if (searchResult == null)
return;
- if (searchResult.FileIcon == null)
- searchResult.FileIcon = DesktopService.GetIconForFile (searchResult.FileName, IconSize.Menu);
- fileNamePixbufRenderer.Image = searchResult.FileIcon;
+ fileNamePixbufRenderer.Image = DesktopService.GetIconForFile (searchResult.FileName, IconSize.Menu);
}
@@ -390,18 +411,16 @@ namespace MonoDevelop.Ide.FindInFiles
var searchResult = (SearchResult)store.GetValue (iter, SearchResultColumn);
if (searchResult == null)
return;
- string fileNameMarkup = searchResult.FileNameMarkup;
- if (fileNameMarkup == null) {
- if (searchResult.LineNumber <= 0) {
- var doc = GetDocument (searchResult);
- if (doc == null)
- return;
- searchResult.LineNumber = doc.OffsetToLineNumber (searchResult.Offset);
- }
- fileNameMarkup = MarkupText (System.IO.Path.GetFileName (searchResult.FileName) + ":" + searchResult.LineNumber, didRead);
- searchResult.FileNameMarkup = fileNameMarkup;
+ int lineNumber;
+ var doc = GetDocument (searchResult);
+ if (doc == null)
+ return;
+ try {
+ lineNumber = doc.OffsetToLineNumber (searchResult.Offset);
+ } catch (ArgumentOutOfRangeException) {
+ lineNumber = -1;
}
- fileNameRenderer.Markup = fileNameMarkup;
+ fileNameRenderer.Markup = MarkupText (System.IO.Path.GetFileName (searchResult.FileName) + ":" + lineNumber, didRead);
}
int CompareLineNumbers (TreeModel model, TreeIter first, TreeIter second)
@@ -415,14 +434,19 @@ namespace MonoDevelop.Ide.FindInFiles
{
return 0;
}
-
+
static int CompareFileNames (TreeModel model, TreeIter first, TreeIter second)
{
var searchResult1 = (SearchResult)model.GetValue (first, SearchResultColumn);
var searchResult2 = (SearchResult)model.GetValue (second, SearchResultColumn);
if (searchResult1 == null || searchResult2 == null || searchResult1.FileName == null || searchResult2.FileName == null)
return -1;
- return string.Compare (System.IO.Path.GetFileName (searchResult1.FileName), System.IO.Path.GetFileName (searchResult2.FileName), StringComparison.Ordinal);
+ var strCompare = string.Compare (System.IO.Path.GetFileName (searchResult1.FileName), System.IO.Path.GetFileName (searchResult2.FileName), StringComparison.Ordinal);
+ if (strCompare == 0) {
+ return searchResult1.Offset.CompareTo (searchResult2.Offset);
+ } else {
+ return strCompare;
+ }
}
static int CompareProjectFileNames (TreeModel model, TreeIter first, TreeIter second)
@@ -454,25 +478,20 @@ namespace MonoDevelop.Ide.FindInFiles
var searchResult = (SearchResult)store.GetValue (iter, SearchResultColumn);
if (searchResult == null)
return;
- string pathMarkup = searchResult.PathMarkup;
- if (pathMarkup == null) {
- bool didRead = (bool)store.GetValue (iter, DidReadColumn);
-
- var fileName = searchResult.FileName;
- string baseSolutionPath = null;
- if (pathMode == PathMode.Relative) {
- var workspace = IdeApp.Workspace;
- var solutions = workspace != null ? workspace.GetAllSolutions () : null;
- baseSolutionPath = solutions != null && solutions.Count == 1 ? solutions [0].BaseDirectory : null;
- }
- var finalFileName = baseSolutionPath == null ? fileName :
- FileService.AbsoluteToRelativePath (baseSolutionPath, fileName);
- var directory = System.IO.Path.GetDirectoryName (finalFileName);
+ bool didRead = (bool)store.GetValue (iter, DidReadColumn);
- pathMarkup = MarkupText (directory, didRead);
- searchResult.PathMarkup = pathMarkup;
+ var fileName = searchResult.FileName;
+ string baseSolutionPath = null;
+ if (pathMode == PathMode.Relative) {
+ var workspace = IdeApp.Workspace;
+ var solutions = workspace != null ? workspace.GetAllSolutions () : null;
+ baseSolutionPath = solutions != null && solutions.Count () == 1 ? solutions.First ().BaseDirectory : null;
}
- pathRenderer.Markup = pathMarkup;
+ var finalFileName = baseSolutionPath == null ? fileName :
+ FileService.AbsoluteToRelativePath (baseSolutionPath, fileName);
+ var directory = System.IO.Path.GetDirectoryName (finalFileName);
+
+ pathRenderer.Markup = MarkupText (directory, didRead);
}
void ResultProjectIconDataFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
@@ -483,9 +502,11 @@ namespace MonoDevelop.Ide.FindInFiles
var searchResult = (SearchResult)store.GetValue (iter, SearchResultColumn);
if (searchResult == null)
return;
- if (searchResult.ProjectIcon == null && searchResult.Projects.Count > 0)
- searchResult.ProjectIcon = ImageService.GetIcon (searchResult.Projects [0].StockIcon).WithSize (Gtk.IconSize.Menu);
- fileNamePixbufRenderer.Image = searchResult.ProjectIcon;
+ if (searchResult.Projects.Count > 0) {
+ fileNamePixbufRenderer.Image = ImageService.GetIcon (searchResult.Projects [0].StockIcon).WithSize (Gtk.IconSize.Menu);
+ } else {
+ fileNamePixbufRenderer.Image = null;
+ }
}
void ResultProjectDataFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
@@ -497,17 +518,20 @@ namespace MonoDevelop.Ide.FindInFiles
if (searchResult == null)
return;
bool didRead = (bool)store.GetValue (iter, DidReadColumn);
- string projectNameMarkup = searchResult.ProjectNameMarkup;
- if (projectNameMarkup == null) {
- if (searchResult.Projects.Count > 0)
- projectNameMarkup = MarkupText (String.Join (", ", searchResult.Projects.Select (p => p.Name)), didRead);
- else
- projectNameMarkup = "";
- searchResult.ProjectNameMarkup = projectNameMarkup;
- }
+ string projectNameMarkup;
+ if (searchResult.Projects.Count > 0)
+ projectNameMarkup = MarkupText (String.Join (", ", searchResult.Projects.Select (p => p.Name)), didRead);
+ else
+ projectNameMarkup = "";
pathRenderer.Markup = projectNameMarkup;
}
+ static int TranslateIndexToUTF8 (string text, int index)
+ {
+ byte[] bytes = Encoding.UTF8.GetBytes (text);
+ return Encoding.UTF8.GetString (bytes, 0, index).Length;
+ }
+ List<Tuple<SearchResult, string>> markupCache = new List<Tuple<SearchResult, string>> ();
void ResultTextDataFunc (TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
{
if (TreeIter.Zero.Equals (iter))
@@ -518,7 +542,7 @@ namespace MonoDevelop.Ide.FindInFiles
textRenderer.Markup = "Invalid search result";
return;
}
- string textMarkup = searchResult.TextMarkup;
+ string textMarkup = markupCache.FirstOrDefault (t =>t.Item1 == searchResult)?.Item2;
if (textMarkup == null) {
var doc = GetDocument (searchResult);
@@ -527,55 +551,54 @@ namespace MonoDevelop.Ide.FindInFiles
goto end;
}
bool isSelected = treeviewSearchResults.Selection.IterIsSelected (iter);
-
- if (searchResult.Markup == null) {
- if (searchResult.LineNumber <= 0)
- searchResult.LineNumber = doc.OffsetToLineNumber (searchResult.Offset);
- DocumentLine line = doc.GetLine (searchResult.LineNumber);
- if (line == null) {
- textMarkup = "Invalid line number " + searchResult.LineNumber + " from offset: " + searchResult.Offset;
- goto end;
- }
- int indent = line.GetIndentation (doc).Length;
- var data = new Mono.TextEditor.TextEditorData (doc);
- data.ColorStyle = highlightStyle;
- var lineText = doc.GetTextAt (line.Offset + indent, line.Length - indent);
- int col = searchResult.Offset - line.Offset - indent;
- // search result contained part of the indent.
- if (col + searchResult.Length < lineText.Length)
- lineText = doc.GetTextAt (line.Offset, line.Length);
-
- var markup = doc.SyntaxMode != null ?
- data.GetMarkup (line.Offset + indent, line.Length - indent, true, !isSelected, false) :
- GLib.Markup.EscapeText (lineText);
- searchResult.Markup = AdjustColors (markup.Replace ("\t", new string (' ', TextEditorOptions.DefaultOptions.TabSize)));
-
- if (col >= 0) {
- uint start;
- uint end;
- try {
- start = (uint)TextViewMargin.TranslateIndexToUTF8 (lineText, col);
- end = (uint)TextViewMargin.TranslateIndexToUTF8 (lineText, Math.Min (lineText.Length, col + searchResult.Length));
- } catch (Exception e) {
- LoggingService.LogError ("Exception while translating index to utf8 (column was:" + col + " search result length:" + searchResult.Length + " line text:" + lineText + ")", e);
- return;
- }
- searchResult.StartIndex = start;
- searchResult.EndIndex = end;
+ int lineNumber, startIndex = 0, endIndex = 0;
+ try {
+ lineNumber = doc.OffsetToLineNumber (searchResult.Offset);
+ } catch (ArgumentOutOfRangeException) {
+ lineNumber = -1;
+ textMarkup = "Invalid search result offset";
+ goto end;
+ }
+
+ var line = doc.GetLine (lineNumber);
+ if (line == null) {
+ textMarkup = "Invalid line number " + lineNumber + " from offset: " + searchResult.Offset;
+ goto end;
+ }
+ int indent = line.GetIndentation (doc).Length;
+ var lineText = doc.GetTextAt (line.Offset + indent, line.Length - indent);
+ int col = searchResult.Offset - line.Offset - indent;
+ // search result contained part of the indent.
+ if (col + searchResult.Length < lineText.Length)
+ lineText = doc.GetTextAt (line.Offset, line.Length);
+
+ var markup = doc.GetPangoMarkup (line.Offset + indent, line.Length - indent);
+ markup = AdjustColors(markup);
+
+ if (col >= 0) {
+ uint start;
+ uint end;
+ try {
+ start = (uint)TranslateIndexToUTF8 (lineText, col);
+ end = (uint)TranslateIndexToUTF8 (lineText, Math.Min (lineText.Length, col + searchResult.Length));
+ } catch (Exception e) {
+ LoggingService.LogError ("Exception while translating index to utf8 (column was:" + col + " search result length:" + searchResult.Length + " line text:" + lineText + ")", e);
+ return;
}
+ startIndex = (int)start;
+ endIndex = (int)end;
}
-
try {
- textMarkup = searchResult.Markup;
+ textMarkup = markup;
if (!isSelected) {
var searchColor = searchResult.GetBackgroundMarkerColor (highlightStyle).Color;
- double b1 = Mono.TextEditor.HslColor.Brightness (searchColor);
- double b2 = Mono.TextEditor.HslColor.Brightness (AdjustColor (Style.Base (StateType.Normal), (Mono.TextEditor.HslColor)highlightStyle.PlainText.Foreground));
+ double b1 = HslColor.Brightness (searchColor);
+ double b2 = HslColor.Brightness (AdjustColor (Style.Base (StateType.Normal), (HslColor)highlightStyle.PlainText.Foreground));
double delta = Math.Abs (b1 - b2);
if (delta < 0.1) {
- Mono.TextEditor.HslColor color1 = highlightStyle.SearchResult.Color;
+ var color1 = highlightStyle.SearchResult.Color;
if (color1.L + 0.5 > 1.0) {
color1.L -= 0.5;
} else {
@@ -583,15 +606,18 @@ namespace MonoDevelop.Ide.FindInFiles
}
searchColor = color1;
}
- if (searchResult.StartIndex != searchResult.EndIndex) {
- textMarkup = PangoHelper.ColorMarkupBackground (textMarkup, (int)searchResult.StartIndex, (int)searchResult.EndIndex, searchColor);
+ if (startIndex != endIndex) {
+ textMarkup = PangoHelper.ColorMarkupBackground (textMarkup, (int)startIndex, (int)endIndex, searchColor);
}
}
} catch (Exception e) {
- LoggingService.LogError ("Error whil setting the text renderer markup to: " + searchResult.Markup, e);
+ LoggingService.LogError ("Error whil setting the text renderer markup to: " + markup, e);
}
end:
- searchResult.TextMarkup = textMarkup;
+ textMarkup = textMarkup.Replace ("\t", new string (' ', doc.Options.TabSize));
+ markupCache.Add (Tuple.Create(searchResult, textMarkup));
+ if (markupCache.Count > 100)
+ markupCache.RemoveAt (0);
}
textRenderer.Markup = textMarkup;
}
@@ -641,18 +667,18 @@ namespace MonoDevelop.Ide.FindInFiles
- Dictionary<string, TextDocument> documents = new Dictionary<string, TextDocument> ();
+ Dictionary<string, TextEditor> documents = new Dictionary<string, TextEditor> ();
- TextDocument GetDocument (SearchResult result)
+ TextEditor GetDocument (SearchResult result)
{
- TextDocument doc;
+ TextEditor doc;
if (!documents.TryGetValue (result.FileName, out doc)) {
var content = result.FileProvider.ReadString ();
if (content == null)
return null;
- doc = TextDocument.CreateImmutableDocument (content);
- doc.MimeType = DesktopService.GetMimeTypeForUri (result.FileName);
-
+
+ doc = TextEditorFactory.CreateNewEditor (TextEditorFactory.CreateNewReadonlyDocument (new StringTextSource (content), result.FileName, DesktopService.GetMimeTypeForUri (result.FileName)));
+
documents [result.FileName] = doc;
}
return doc;
@@ -687,9 +713,9 @@ namespace MonoDevelop.Ide.FindInFiles
{
var result = store.GetValue (iter, SearchResultColumn) as SearchResult;
if (result != null) {
- DocumentLocation loc = GetLocation (result);
+ var loc = GetLocation (result);
store.SetValue (iter, DidReadColumn, true);
- IdeApp.Workbench.OpenDocument (result.FileName, loc.Line, loc.Column);
+ IdeApp.Workbench.OpenDocument (result.FileName, null, loc.Line, loc.Column);
}
}
@@ -699,7 +725,7 @@ namespace MonoDevelop.Ide.FindInFiles
if (doc == null)
return DocumentLocation.Empty;
int lineNr = doc.OffsetToLineNumber (searchResult.Offset);
- DocumentLine line = doc.GetLine (lineNr);
+ var line = doc.GetLine (lineNr);
if (line == null)
return DocumentLocation.Empty;
return new DocumentLocation (lineNr, searchResult.Offset - line.Offset + 1);
@@ -732,11 +758,11 @@ namespace MonoDevelop.Ide.FindInFiles
var result = store.GetValue (iter, SearchResultColumn) as SearchResult;
if (result == null)
continue;
- DocumentLocation loc = GetLocation (result);
+ var loc = GetLocation (result);
var doc = GetDocument (result);
if (doc == null)
continue;
- DocumentLine line = doc.GetLine (loc.Line);
+ var line = doc.GetLine (loc.Line);
sb.AppendFormat ("{0} ({1}, {2}):{3}", result.FileName, loc.Line, loc.Column, doc.GetTextAt (line.Offset, line.Length));
sb.AppendLine ();
@@ -804,7 +830,7 @@ namespace MonoDevelop.Ide.FindInFiles
var doc = GetDocument (searchResult);
if (doc == null)
return null;
- DocumentLocation location = doc.OffsetToLocation (searchResult.Offset);
+ var location = doc.OffsetToLocation (searchResult.Offset);
return new SearchTextFileNavigationPoint (searchResult.FileName, location.Line, location.Column);
}
@@ -814,17 +840,17 @@ namespace MonoDevelop.Ide.FindInFiles
{
}
- protected override Gui.Document DoShow ()
+ protected override async Task<Gui.Document> DoShow ()
{
- var doc = base.DoShow ();
+ var doc = await base.DoShow ();
if (doc == null)
return null;
- var buf = doc.GetContent<IEditableTextBuffer> ();
+ var buf = doc.Editor;
if (buf != null) {
doc.DisableAutoScroll ();
buf.RunWhenLoaded (() => {
- buf.SetCaretTo (Math.Max (Line, 1), Math.Max (Column, 1));
+ buf.SetCaretLocation (Math.Max (Line, 1), Math.Max (Column, 1));
});
}
@@ -844,7 +870,7 @@ namespace MonoDevelop.Ide.FindInFiles
public static string ColorMarkupBackground (string textMarkup, int startIndex, int endIndex, HslColor searchColor)
{
var markupBuilder = new StringBuilder();
- bool inMarkup = false, inEntity = false, closed = false;
+ bool inMarkup = false, inEntity = false, closed = false, opened = false;
int i = 0;
for (int j = 0; j < textMarkup.Length; j++) {
var ch = textMarkup [j];
@@ -861,8 +887,10 @@ namespace MonoDevelop.Ide.FindInFiles
inMarkup = false;
markupBuilder.Append (ch);
if (i > startIndex && markupBuilder.ToString ().EndsWith("</span>")) {
- if (!closed)
+ if (opened && !closed) {
markupBuilder.Append ("</span>");
+ opened = false;
+ }
markupBuilder.Append (textMarkup.Substring(j + 1));
return ColorMarkupBackground (markupBuilder.ToString (), i, endIndex, searchColor);
}
@@ -872,28 +900,33 @@ namespace MonoDevelop.Ide.FindInFiles
continue;
}
if (i == endIndex) {
- markupBuilder.Append ("</span>");
+ if (opened) {
+ markupBuilder.Append ("</span>");
+ opened = false;
+ }
markupBuilder.Append (textMarkup.Substring (j));
closed = true;
break;
}
- if (ch == '&') {
- inEntity = true;
- markupBuilder.Append (ch);
- continue;
- }
+
if (ch == '<') {
inMarkup = true;
markupBuilder.Append (ch);
continue;
}
if (i == startIndex) {
+ opened = true;
markupBuilder.Append ("<span background=\"" + ColorToPangoMarkup (searchColor) + "\">");
}
+ if (ch == '&') {
+ inEntity = true;
+ markupBuilder.Append (ch);
+ continue;
+ }
markupBuilder.Append (ch);
i++;
}
- if (!closed)
+ if (!closed && !opened)
markupBuilder.Append ("</span>");
return markupBuilder.ToString ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontChooserPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontChooserPanel.cs
index 810820ff66..af8be3166b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontChooserPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontChooserPanel.cs
@@ -24,7 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.Ide.Fonts
@@ -33,7 +33,7 @@ namespace MonoDevelop.Ide.Fonts
{
FontChooserPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new FontChooserPanelWidget ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontChooserPanelWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontChooserPanelWidget.cs
index d8473dcb86..8ed930dad7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontChooserPanelWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontChooserPanelWidget.cs
@@ -86,6 +86,7 @@ namespace MonoDevelop.Ide.Fonts
DestroyWithParent = true,
TransientFor = this.Toplevel as Gtk.Window
};
+ MonoDevelop.Components.IdeTheme.ApplyTheme (selectionDialog);
try {
string fontValue = FontService.FilterFontName (GetFont (desc.Name));
selectionDialog.SetFontName (fontValue);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs
index 3525b2e1a5..100c7cd3f6 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontService.cs
@@ -39,25 +39,19 @@ namespace MonoDevelop.Ide.Fonts
static Dictionary<string, FontDescription> loadedFonts = new Dictionary<string, FontDescription> ();
static Properties fontProperties;
- static string defaultMonospaceFontName, defaultSansFontName;
- static FontDescription defaultMonospaceFont, defaultSansFont;
+ static string defaultMonospaceFontName = String.Empty;
+ static FontDescription defaultMonospaceFont = new FontDescription ();
static void LoadDefaults ()
{
if (defaultMonospaceFont != null) {
defaultMonospaceFont.Dispose ();
- defaultSansFont.Dispose ();
}
#pragma warning disable 618
defaultMonospaceFontName = DesktopService.DefaultMonospaceFont;
defaultMonospaceFont = FontDescription.FromString (defaultMonospaceFontName);
#pragma warning restore 618
-
- var label = new Gtk.Label ("");
- defaultSansFont = label.Style.FontDescription.Copy ();
- label.Destroy ();
- defaultSansFontName = defaultSansFont.ToString ();
}
internal static IEnumerable<FontDescriptionCodon> FontDescriptions {
@@ -91,10 +85,10 @@ namespace MonoDevelop.Ide.Fonts
}
public static FontDescription MonospaceFont { get { return defaultMonospaceFont; } }
- public static FontDescription SansFont { get { return defaultSansFont; } }
+ public static FontDescription SansFont { get { return Gui.Styles.DefaultFont; } }
public static string MonospaceFontName { get { return defaultMonospaceFontName; } }
- public static string SansFontName { get { return defaultSansFontName; } }
+ public static string SansFontName { get { return Gui.Styles.DefaultFontName; } }
[Obsolete ("Use MonospaceFont")]
public static FontDescription DefaultMonospaceFontDescription {
@@ -117,7 +111,7 @@ namespace MonoDevelop.Ide.Fonts
case "_DEFAULT_MONOSPACE":
return defaultMonospaceFontName;
case "_DEFAULT_SANS":
- return defaultSansFontName;
+ return SansFontName;
default:
return name;
}
@@ -181,6 +175,11 @@ namespace MonoDevelop.Ide.Fonts
callbacks.ForEach (c => c ());
}
}
+
+ internal static ConfigurationProperty<FontDescription> GetFontProperty (string name)
+ {
+ return new FontConfigurationProperty (name);
+ }
static Dictionary<string, List<Action>> fontChangeCallbacks = new Dictionary<string, List<Action>> ();
public static void RegisterFontChangedCallback (string fontName, Action callback)
@@ -197,6 +196,28 @@ namespace MonoDevelop.Ide.Fonts
}
}
+ class FontConfigurationProperty: ConfigurationProperty<FontDescription>
+ {
+ string name;
+
+ public FontConfigurationProperty (string name)
+ {
+ this.name = name;
+ FontService.RegisterFontChangedCallback (name, OnChanged);
+ }
+
+ protected override FontDescription OnGetValue ()
+ {
+ return FontService.GetFontDescription (name);
+ }
+
+ protected override bool OnSetValue (FontDescription value)
+ {
+ FontService.SetFont (name, value.ToString ());
+ return true;
+ }
+ }
+
public static class FontExtensions
{
public static FontDescription CopyModified (this FontDescription font, double? scale = null, Pango.Weight? weight = null)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs
index 6f22cda97c..b388534ab5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs
@@ -1,4 +1,4 @@
-//
+//
// ExtensibleTreeView.cs
//
// Author:
@@ -30,15 +30,8 @@
//#define TREE_VERIFY_INTEGRITY
using System;
-using System.IO;
-using System.ComponentModel;
-using System.Drawing;
-using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
-using System.Collections.Specialized;
-using System.Xml;
-using System.Resources;
using System.Text;
using Mono.Addins;
@@ -48,13 +41,12 @@ using MonoDevelop.Ide.Commands;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.Gui.Pads;
using MonoDevelop.Projects.Extensions;
-using Mono.TextEditor;
using System.Linq;
using MonoDevelop.Ide.Tasks;
namespace MonoDevelop.Ide.Gui.Components
{
- public partial class ExtensibleTreeView : CompactScrolledWindow
+ public partial class ExtensibleTreeView : Control, ICommandRouter
{
internal const int NodeInfoColumn = 0;
internal const int DataItemColumn = 1;
@@ -66,6 +58,7 @@ namespace MonoDevelop.Ide.Gui.Components
Dictionary<Type, NodeBuilder[]> builderChains = new Dictionary<Type, NodeBuilder[]> ();
NodeHashtable nodeHash = new NodeHashtable ();
+ ExtensibleTreeViewWidget widget;
ExtensibleTreeViewTree tree;
Gtk.TreeStore store;
Gtk.TreeViewColumn complete_column;
@@ -74,8 +67,6 @@ namespace MonoDevelop.Ide.Gui.Components
TreeBuilderContext builderContext;
Hashtable callbacks = new Hashtable ();
bool editingText = false;
- bool showSelectionPopupButton;
- Gtk.TreeIter? lastPopupButtonIter;
TreePadOption[] options;
TreeOptions globalOptions;
@@ -99,22 +90,90 @@ namespace MonoDevelop.Ide.Gui.Components
set { contextMenuTypeNameAliases = value; }
}
- public Gtk.TreeStore Store {
+ internal Gtk.TreeStore Store {
get {
return this.store;
}
}
- public Gtk.TreeView Tree {
+ internal Gtk.TreeView Tree {
get {
return tree;
}
}
+ public event EventHandler SelectionChanged;
+
+ public bool AllowsMultipleSelection {
+ get {
+ return Tree.Selection.Mode == Gtk.SelectionMode.Multiple;
+ }
+ set {
+ if (value)
+ Tree.Selection.Mode = Gtk.SelectionMode.Multiple;
+ else
+ Tree.Selection.Mode = Gtk.SelectionMode.Single;
+ }
+ }
+
public string Id { get; set; }
+
+ class ExtensibleTreeViewWidget : CompactScrolledWindow, ICommandRouter
+ {
+ ExtensibleTreeView control;
+
+ public ExtensibleTreeViewWidget (ExtensibleTreeView control)
+ {
+ this.control = control;
+ ShadowType = Gtk.ShadowType.None;
+ ShowBorderLine = false;
+ }
+
+ protected override void OnStyleSet (Gtk.Style previous_style)
+ {
+ base.OnStyleSet (previous_style);
+ control.UpdateFont ();
+ }
+
+ protected override bool OnScrollEvent (Gdk.EventScroll evnt)
+ {
+ var modifier = !Platform.IsMac? Gdk.ModifierType.ControlMask
+ //Mac window manager already uses control-scroll, so use command
+ //Command might be either meta or mod1, depending on GTK version
+ : (Gdk.ModifierType.MetaMask | Gdk.ModifierType.Mod1Mask);
+
+ if ((evnt.State & modifier) !=0) {
+ if (evnt.Direction == Gdk.ScrollDirection.Up)
+ control.ZoomIn ();
+ else if (evnt.Direction == Gdk.ScrollDirection.Down)
+ control.ZoomOut ();
+
+ return true;
+ }
+ return base.OnScrollEvent (evnt);
+ }
+
+ protected override void OnDestroyed ()
+ {
+ control.Destroy ();
+ base.OnDestroyed ();
+ }
+
+ public object GetNextCommandTarget ()
+ {
+ return control;
+ }
+ }
+
+ protected override object CreateNativeWidget<T> ()
+ {
+ return widget;
+ }
+
public ExtensibleTreeView ()
{
+ widget = new ExtensibleTreeViewWidget (this);
tree = new ExtensibleTreeViewTree (this);
}
@@ -134,18 +193,12 @@ namespace MonoDevelop.Ide.Gui.Components
tree.ColumnsAutosize ();
}
- protected override void OnStyleSet (Gtk.Style previous_style)
- {
- base.OnStyleSet (previous_style);
- UpdateFont ();
- }
-
- public void Initialize (NodeBuilder[] builders, TreePadOption[] options)
+ public void Initialize (NodeBuilder [] builders, TreePadOption [] options, string contextMenuPath = null)
{
- Initialize (builders, options, null);
+ OnInitialize (builders, options, contextMenuPath);
}
- public virtual void Initialize (NodeBuilder[] builders, TreePadOption[] options, string contextMenuPath)
+ protected virtual void OnInitialize (NodeBuilder[] builders, TreePadOption[] options, string contextMenuPath)
{
this.contextMenuPath = contextMenuPath;
builderContext = new TreeBuilderContext (this);
@@ -171,7 +224,7 @@ namespace MonoDevelop.Ide.Gui.Components
text_render = new CustomCellRendererText (this);
text_render.Ypad = 0;
- IdeApp.Preferences.CustomPadFontChanged += CustomFontPropertyChanged;;
+ IdeApp.Preferences.CustomPadFont.Changed += CustomFontPropertyChanged;
text_render.EditingStarted += HandleEditingStarted;
text_render.Edited += HandleOnEdit;
text_render.EditingCanceled += HandleOnEditCancelled;
@@ -191,7 +244,6 @@ namespace MonoDevelop.Ide.Gui.Components
tree.CursorChanged += OnSelectionChanged;
tree.KeyPressEvent += OnKeyPress;
- tree.ButtonPressEvent += HandleButtonPressEvent;
tree.MotionNotifyEvent += HandleMotionNotifyEvent;
tree.LeaveNotifyEvent += HandleLeaveNotifyEvent;
@@ -208,9 +260,11 @@ namespace MonoDevelop.Ide.Gui.Components
if (!string.IsNullOrEmpty (Id))
Zoom = PropertyService.Get<double> ("MonoDevelop.Ide.ExtensibleTreeView.Zoom." + Id, 1d);
+ else
+ Zoom = 1d;
- this.Add (tree);
- this.ShowAll ();
+ widget.Add (tree);
+ widget.ShowAll ();
#if TREE_VERIFY_INTEGRITY
GLib.Timeout.Add (3000, Checker);
@@ -277,7 +331,6 @@ namespace MonoDevelop.Ide.Gui.Components
cell.TextMarkup = info.Label;
cell.StatusIcon = info.StatusIconInternal;
- cell.ShowPopupButton = (bool)model.GetValue (it, ShowPopupColumn);
}
public void UpdateBuilders (NodeBuilder[] builders, TreePadOption[] options)
@@ -421,18 +474,6 @@ namespace MonoDevelop.Ide.Gui.Components
}
[GLib.ConnectBefore]
- void HandleButtonPressEvent (object o, Gtk.ButtonPressEventArgs args)
- {
- if (ShowSelectionPopupButton && text_render.PointerInButton ((int)args.Event.XRoot, (int)args.Event.YRoot)) {
- text_render.Pushed = true;
- args.RetVal = true;
- var entryset = BuildEntrySet ();
-
- IdeApp.CommandService.ShowContextMenu (tree, args.Event, entryset, this, HandleMenuHidden);
- }
- }
-
- [GLib.ConnectBefore]
void HandleMotionNotifyEvent (object o, Gtk.MotionNotifyEventArgs args)
{
Gtk.TreePath path;
@@ -441,12 +482,6 @@ namespace MonoDevelop.Ide.Gui.Components
bool popupShown = false;
if (tree.GetPathAtPos ((int)args.Event.X, (int)args.Event.Y, out path, out col, out cx, out cy)) {
- if (ShowSelectionPopupButton) {
- text_render.PointerPosition = new Gdk.Point ((int)args.Event.XRoot, (int)args.Event.YRoot);
- var area = tree.GetCellArea (path, tree.Columns [0]);
- tree.QueueDrawArea (area.X, area.Y, area.Width, area.Height);
- }
-
Gtk.TreeIter it;
if (store.GetIter (out it, path)) {
var info = (NodeInfo)store.GetValue (it, NodeInfoColumn);
@@ -511,7 +546,7 @@ namespace MonoDevelop.Ide.Gui.Components
((Gtk.Menu)sender).Hidden -= HandleMenuHidden;
}
text_render.Pushed = false;
- QueueDraw ();
+ widget.QueueDraw ();
}
internal void LockUpdates ()
@@ -547,7 +582,7 @@ namespace MonoDevelop.Ide.Gui.Components
set { builders = value; }
}
- public Gtk.TreeViewColumn CompleteColumn {
+ internal Gtk.TreeViewColumn CompleteColumn {
get {
return complete_column;
}
@@ -559,13 +594,13 @@ namespace MonoDevelop.Ide.Gui.Components
}
}
- public ITreeBuilderContext BuilderContext {
+ internal ITreeBuilderContext BuilderContext {
get {
return builderContext;
}
}
- public object[] CopyObjects {
+ internal object[] CopyObjects {
get {
return copyObjects;
}
@@ -574,7 +609,7 @@ namespace MonoDevelop.Ide.Gui.Components
}
}
- public DragOperation CurrentTransferOperation {
+ internal DragOperation CurrentTransferOperation {
get {
return currentTransferOperation;
}
@@ -800,7 +835,7 @@ namespace MonoDevelop.Ide.Gui.Components
}
}
- internal object GetNextCommandTarget ()
+ internal new object GetNextCommandTarget ()
{
return null;
}
@@ -933,7 +968,12 @@ namespace MonoDevelop.Ide.Gui.Components
}
[CommandHandler (ViewCommands.Open)]
- public virtual void ActivateCurrentItem ()
+ public void ActivateCurrentItem ()
+ {
+ OnActivateCurrentItem ();
+ }
+
+ protected virtual void OnActivateCurrentItem ()
{
try {
LockUpdates ();
@@ -947,13 +987,18 @@ namespace MonoDevelop.Ide.Gui.Components
break;
}
}
- OnCurrentItemActivated (EventArgs.Empty);
+ OnCurrentItemActivated ();
} finally {
UnlockUpdates ();
}
}
- public virtual void DeleteCurrentItem ()
+ public void DeleteCurrentItem ()
+ {
+ OnDeleteCurrentItem ();
+ }
+
+ protected virtual void OnDeleteCurrentItem ()
{
try {
LockUpdates ();
@@ -998,7 +1043,12 @@ namespace MonoDevelop.Ide.Gui.Components
}
[CommandHandler (ViewCommands.RefreshTree)]
- public virtual void RefreshCurrentItem ()
+ public void RefreshCurrentItem ()
+ {
+ OnRefreshCurrentItem ();
+ }
+
+ protected virtual void OnRefreshCurrentItem ()
{
try {
LockUpdates ();
@@ -1021,10 +1071,10 @@ namespace MonoDevelop.Ide.Gui.Components
RefreshTree ();
}
- protected virtual void OnCurrentItemActivated (EventArgs args)
+ protected virtual void OnCurrentItemActivated ()
{
if (CurrentItemActivated != null)
- CurrentItemActivated (this, args);
+ CurrentItemActivated (this, EventArgs.Empty);
}
public event EventHandler CurrentItemActivated;
@@ -1138,7 +1188,7 @@ namespace MonoDevelop.Ide.Gui.Components
}
[CommandUpdateHandler (EditCommands.Copy)]
- protected void UpdateCopyCurrentItem (CommandInfo info)
+ internal void UpdateCopyCurrentItem (CommandInfo info)
{
if (editingText) {
info.Bypass = true;
@@ -1148,7 +1198,7 @@ namespace MonoDevelop.Ide.Gui.Components
}
[CommandUpdateHandler (EditCommands.Cut)]
- protected void UpdateCutCurrentItem (CommandInfo info)
+ internal void UpdateCutCurrentItem (CommandInfo info)
{
if (editingText) {
info.Bypass = true;
@@ -1230,7 +1280,7 @@ namespace MonoDevelop.Ide.Gui.Components
}
[CommandUpdateHandler (EditCommands.Paste)]
- protected void UpdatePasteToCurrentItem (CommandInfo info)
+ internal void UpdatePasteToCurrentItem (CommandInfo info)
{
if (editingText) {
info.Bypass = true;
@@ -1276,7 +1326,7 @@ namespace MonoDevelop.Ide.Gui.Components
return (NodeInfo)store.GetValue (it, NodeInfoColumn);
}
- public void StartLabelEditInternal()
+ void StartLabelEditInternal()
{
if (editingText)
return;
@@ -1480,7 +1530,7 @@ namespace MonoDevelop.Ide.Gui.Components
return (TypeNodeBuilder) chain [0];
}
- public NodeBuilder[] GetBuilderChain (Type type)
+ internal NodeBuilder[] GetBuilderChain (Type type)
{
NodeBuilder[] chain;
builderChains.TryGetValue (type, out chain);
@@ -1725,7 +1775,7 @@ namespace MonoDevelop.Ide.Gui.Components
return nodeHash.ContainsKey (dataObject);
}
- public void NotifyInserted (Gtk.TreeIter it, object dataObject)
+ internal void NotifyInserted (Gtk.TreeIter it, object dataObject)
{
if (callbacks.Count > 0) {
ArrayList list = callbacks [dataObject] as ArrayList;
@@ -1758,7 +1808,7 @@ namespace MonoDevelop.Ide.Gui.Components
return sb.ToString ();
}
- public void RefreshNode (Gtk.TreeIter iter)
+ void RefreshNode (Gtk.TreeIter iter)
{
ITreeBuilder builder = CreateBuilder (iter);
builder.UpdateAll ();
@@ -1818,7 +1868,7 @@ namespace MonoDevelop.Ide.Gui.Components
}
[CommandUpdateHandler (EditCommands.Rename)]
- public void UpdateStartLabelEdit (CommandInfo info)
+ internal void UpdateStartLabelEdit (CommandInfo info)
{
if (editingText || GetSelectedNodes ().Length != 1) {
info.Visible = false;
@@ -1889,7 +1939,7 @@ namespace MonoDevelop.Ide.Gui.Components
}
}
- protected CommandEntrySet BuildEntrySet ()
+ CommandEntrySet BuildEntrySet ()
{
ITreeNavigator tnav = GetSelectedNode ();
if (tnav == null)
@@ -1924,7 +1974,7 @@ namespace MonoDevelop.Ide.Gui.Components
}
[CommandUpdateHandler (ViewCommands.TreeDisplayOptionList)]
- protected void BuildTreeOptionsMenu (CommandArrayInfo info)
+ internal void BuildTreeOptionsMenu (CommandArrayInfo info)
{
foreach (TreePadOption op in options) {
CommandInfo ci = new CommandInfo (op.Label);
@@ -1934,14 +1984,14 @@ namespace MonoDevelop.Ide.Gui.Components
}
[CommandHandler (ViewCommands.TreeDisplayOptionList)]
- protected void OptionToggled (string optionId)
+ internal void OptionToggled (string optionId)
{
globalOptions [optionId] = !globalOptions [optionId];
RefreshRoots ();
}
[CommandHandler (ViewCommands.ResetTreeDisplayOptions)]
- protected void ResetOptions ()
+ public void ResetOptions ()
{
foreach (TreePadOption op in options)
globalOptions [op.Id] = op.DefaultValue;
@@ -1960,7 +2010,7 @@ namespace MonoDevelop.Ide.Gui.Components
} while (store.IterNext (ref it));
}
- protected void RefreshTree ()
+ public void RefreshTree ()
{
foreach (TreeNodeNavigator node in GetSelectedNodes ()) {
Gtk.TreeIter it = node.CurrentPosition._iter;
@@ -1972,19 +2022,11 @@ namespace MonoDevelop.Ide.Gui.Components
}
[CommandHandler (ViewCommands.CollapseAllTreeNodes)]
- protected void CollapseTree ()
+ public void CollapseTree ()
{
tree.CollapseAll();
}
- public bool ShowSelectionPopupButton {
- get { return showSelectionPopupButton; }
- set {
- showSelectionPopupButton = value;
- UpdateSelectionPopupButton ();
- }
- }
-
[GLib.ConnectBefore]
void OnKeyPress (object o, Gtk.KeyPressEventArgs args)
{
@@ -2042,56 +2084,13 @@ namespace MonoDevelop.Ide.Gui.Components
}
}
- protected override bool OnScrollEvent (Gdk.EventScroll evnt)
- {
- var modifier = !Platform.IsMac? Gdk.ModifierType.ControlMask
- //Mac window manager already uses control-scroll, so use command
- //Command might be either meta or mod1, depending on GTK version
- : (Gdk.ModifierType.MetaMask | Gdk.ModifierType.Mod1Mask);
-
- if ((evnt.State & modifier) !=0) {
- if (evnt.Direction == Gdk.ScrollDirection.Up)
- ZoomIn ();
- else if (evnt.Direction == Gdk.ScrollDirection.Down)
- ZoomOut ();
-
- return true;
- }
- return base.OnScrollEvent (evnt);
- }
-
- protected virtual void OnNodeActivated (object sender, Gtk.RowActivatedArgs args)
+ void OnNodeActivated (object sender, Gtk.RowActivatedArgs args)
{
ActivateCurrentItem ();
}
- void UpdateSelectionPopupButton ()
+ void OnSelectionChanged (object sender, EventArgs args)
{
- if (editingText)
- return;
-
- if (lastPopupButtonIter != null) {
- if (store.IterIsValid (lastPopupButtonIter.Value))
- tree.Model.SetValue (lastPopupButtonIter.Value, ShowPopupColumn, false);
- lastPopupButtonIter = null;
- }
-
- if (showSelectionPopupButton) {
- var sel = Tree.Selection.GetSelectedRows ();
- if (sel.Length > 0) {
- Gtk.TreeIter it;
- if (store.GetIter (out it, sel[0])) {
- lastPopupButtonIter = it;
- tree.Model.SetValue (it, ShowPopupColumn, true);
- }
- }
- }
- }
-
- protected virtual void OnSelectionChanged (object sender, EventArgs args)
- {
- UpdateSelectionPopupButton ();
-
TreeNodeNavigator node = (TreeNodeNavigator) GetSelectedNode ();
if (node != null) {
NodeBuilder[] chain = node.NodeBuilderChain;
@@ -2107,11 +2106,18 @@ namespace MonoDevelop.Ide.Gui.Components
node.MoveToPosition (pos);
}
}
+ OnSelectionChanged ();
}
- protected override void OnDestroyed ()
+ protected virtual void OnSelectionChanged ()
{
- IdeApp.Preferences.CustomPadFontChanged -= CustomFontPropertyChanged;;
+ if (SelectionChanged != null)
+ SelectionChanged (this, EventArgs.Empty);
+ }
+
+ void Destroy ()
+ {
+ IdeApp.Preferences.CustomPadFont.Changed -= CustomFontPropertyChanged;
if (pix_render != null) {
pix_render.Destroy ();
pix_render = null;
@@ -2142,26 +2148,11 @@ namespace MonoDevelop.Ide.Gui.Components
builders = null;
}
builderChains.Clear ();
-
- base.OnDestroyed ();
}
- class PopupButton: Gtk.EventBox
+ object ICommandRouter.GetNextCommandTarget ()
{
- public event EventHandler Clicked;
-
- public PopupButton ()
- {
- Gtk.Button b = new Gtk.Button ("...");
- b.CanFocus = false;
- Add (b);
-
- b.Clicked += delegate {
- if (Clicked != null)
- Clicked (this, EventArgs.Empty);
- };
- ShowAll ();
- }
+ return widget.Parent;
}
internal class PadCheckMenuItem: Gtk.CheckMenuItem
@@ -2362,10 +2353,6 @@ namespace MonoDevelop.Ide.Gui.Components
Pango.Layout layout;
Pango.FontDescription scaledFont, customFont;
- static Xwt.Drawing.Image popupIcon;
- static Xwt.Drawing.Image popupIconDown;
- static Xwt.Drawing.Image popupIconHover;
- bool bound;
ExtensibleTreeView parent;
Gdk.Rectangle buttonScreenRect;
Gdk.Rectangle buttonAllocation;
@@ -2391,9 +2378,6 @@ namespace MonoDevelop.Ide.Gui.Components
static CustomCellRendererText ()
{
- popupIcon = Xwt.Drawing.Image.FromResource ("tree-popup-button.png");
- popupIconDown = Xwt.Drawing.Image.FromResource ("tree-popup-button-down.png");
- popupIconHover = Xwt.Drawing.Image.FromResource ("tree-popup-button-hover.png");
}
[GLib.Property ("text-markup")]
@@ -2402,9 +2386,6 @@ namespace MonoDevelop.Ide.Gui.Components
set { Markup = markup = value; }
}
- [GLib.Property ("show-popup-button")]
- public bool ShowPopupButton { get; set; }
-
[GLib.Property ("status-icon")]
public Xwt.Drawing.Image StatusIcon { get; set; }
@@ -2413,13 +2394,37 @@ namespace MonoDevelop.Ide.Gui.Components
this.parent = parent;
}
+ static Xwt.Size defaultIconSize = Gtk.IconSize.Menu.GetSize ();
+
+ static Xwt.Size GetZoomedIconSize (Xwt.Drawing.Image icon, double zoom)
+ {
+ if (icon == null || icon == CellRendererImage.NullImage)
+ return defaultIconSize;
+
+ var size = icon.HasFixedSize ? icon.Size : defaultIconSize;
+
+ if (zoom == 1)
+ return size;
+
+ int w = (int) (zoom * (double) size.Width);
+ int h = (int) (zoom * (double) size.Height);
+ if (w == 0) w = 1;
+ if (h == 0) h = 1;
+ return new Xwt.Size (w, h);
+ }
+
+ static Xwt.Drawing.Image GetResized (Xwt.Drawing.Image icon, double zoom)
+ {
+ var size = GetZoomedIconSize (icon, zoom);
+ return icon.WithSize (size);
+ }
void SetupLayout (Gtk.Widget widget)
{
if (scaledFont == null) {
if (scaledFont != null)
scaledFont.Dispose ();
- scaledFont = (customFont ?? parent.Style.FontDesc).Copy ();
+ scaledFont = (customFont ?? parent.widget.Style.FontDesc).Copy ();
scaledFont.Size = (int)(customFont.Size * Zoom);
if (layout != null)
layout.FontDescription = scaledFont;
@@ -2435,8 +2440,6 @@ namespace MonoDevelop.Ide.Gui.Components
layout.SetMarkup (TextMarkup);
}
- const int iconMode = 0;
-
protected override void Render (Gdk.Drawable window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState flags)
{
Gtk.StateType st = Gtk.StateType.Normal;
@@ -2459,85 +2462,19 @@ namespace MonoDevelop.Ide.Gui.Components
bool hasStatusIcon = StatusIcon != CellRendererImage.NullImage && StatusIcon != null;
- if (hasStatusIcon && iconMode != 2) {
- var x = iconMode == 1 ? tx : tx + w + StatusIconSpacing;
+ if (hasStatusIcon) {
+ var img = GetResized (StatusIcon, zoom);
+ if (st == Gtk.StateType.Selected)
+ img = img.WithStyles ("sel");
+ var x = tx + w + StatusIconSpacing;
using (var ctx = Gdk.CairoHelper.Create (window)) {
- ctx.DrawImage (widget, StatusIcon, x, cell_area.Y + (cell_area.Height - StatusIcon.Height) / 2);
+ ctx.DrawImage (widget, img, x, cell_area.Y + (cell_area.Height - img.Height) / 2);
}
- if (iconMode == 1)
- tx += (int)StatusIcon.Width + StatusIconSpacing;
}
window.DrawLayout (widget.Style.TextGC (st), tx, ty, layout);
- hasStatusIcon &= iconMode == 2;
-
- if (ShowPopupButton || hasStatusIcon) {
- if (!bound) {
- bound = true;
- ((Gtk.ScrolledWindow)widget.Parent).Hadjustment.ValueChanged += delegate {
- foreach (var r in parent.Tree.Selection.GetSelectedRows ()) {
- var rect = parent.Tree.GetCellArea (r, parent.Tree.Columns [0]);
- parent.Tree.QueueDrawArea (rect.X, rect.Y, rect.Width, rect.Height);
- }
- };
- }
-
- var selected = (flags & Gtk.CellRendererState.Selected) != 0;
- if (selected || hasStatusIcon) {
- var icon = Pushed ? popupIconDown : popupIcon;
- var dy = (cell_area.Height - (int)icon.Height) / 2 - 1;
- var y = cell_area.Y + dy;
- var x = cell_area.X + cell_area.Width - (int)icon.Width - dy;
-
- var sw = (Gtk.ScrolledWindow)widget.Parent;
- int ox, oy, ow, oh;
- sw.GdkWindow.GetOrigin (out ox, out oy);
- sw.GdkWindow.GetSize (out ow, out oh);
- ox += sw.Allocation.X;
- oy += sw.Allocation.Y;
- if (sw.VScrollbar.Visible)
- ow -= sw.VScrollbar.Allocation.Width;
-
- int cx, cy, cw, ch;
- ((Gdk.Window)window).GetOrigin (out cx, out cy);
- ((Gdk.Window)window).GetSize (out cw, out ch);
- cx += widget.Allocation.X;
- cy += widget.Allocation.Y;
-
- int rp = ox + ow;
- int diff = rp - (cx + cw);
-
- if (diff < 0) {
- x += diff;
- if (x < cell_area.X + 20)
- x = cell_area.X + 20;
- }
-
- buttonScreenRect = new Gdk.Rectangle (cx + x, cy + y, (int)popupIcon.Width, (int)popupIcon.Height);
-
- buttonAllocation = new Gdk.Rectangle (x, y, (int)popupIcon.Width, (int)popupIcon.Height);
- buttonAllocation = GtkUtil.ToScreenCoordinates (widget, ((Gdk.Window)window), buttonAllocation);
- buttonAllocation = GtkUtil.ToWindowCoordinates (widget, widget.GdkWindow, buttonAllocation);
-
- bool mouseOver = (flags & Gtk.CellRendererState.Prelit) != 0 && buttonScreenRect.Contains (PointerPosition);
- if (mouseOver && !Pushed)
- icon = popupIconHover;
-
- using (var ctx = Gdk.CairoHelper.Create (window)) {
- if (ShowPopupButton && selected) {
- if (hasStatusIcon)
- x -= (int) icon.Width + StatusIconSpacing;
- ctx.DrawImage (widget, icon, x, y);
- if (hasStatusIcon)
- x += (int) icon.Width + StatusIconSpacing;
- }
- if (hasStatusIcon) {
- ctx.DrawImage (widget, StatusIcon, x, y);
- }
- }
- }
- }
+ hasStatusIcon = false;
}
public Gdk.Rectangle GetStatusIconArea (Gtk.Widget widget, Gdk.Rectangle cell_area)
@@ -2547,23 +2484,25 @@ namespace MonoDevelop.Ide.Gui.Components
int w, h;
layout.GetPixelSize (out w, out h);
+ var iconSize = GetZoomedIconSize (StatusIcon, zoom);
int tx = cell_area.X + (int)Xpad;
- if (iconMode == 0) {
- var x = tx + w + StatusIconSpacing;
- return new Gdk.Rectangle (x, cell_area.Y, (int) StatusIcon.Width, (int) cell_area.Height);
- } else if (iconMode == 1) {
- var x = tx;
- return new Gdk.Rectangle (x, cell_area.Y, (int) StatusIcon.Width, (int) cell_area.Height);
- } else {
- return new Gdk.Rectangle (cell_area.Width - (int) StatusIcon.Width, cell_area.Y, (int) StatusIcon.Width, (int) cell_area.Height);
- }
+ var x = tx + w + StatusIconSpacing;
+ return new Gdk.Rectangle (x, cell_area.Y, (int) iconSize.Width, (int) cell_area.Height);
}
public override void GetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height)
{
- base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height);
- if (StatusIcon != CellRendererImage.NullImage && StatusIcon != null)
- width += (int) StatusIcon.Width + StatusIconSpacing;
+ SetupLayout (widget);
+
+ x_offset = y_offset = 0;
+
+ layout.GetPixelSize (out width, out height);
+ width += (int)Xpad * 2;
+
+ if (StatusIcon != CellRendererImage.NullImage && StatusIcon != null) {
+ var iconSize = GetZoomedIconSize (StatusIcon, zoom);
+ width += (int)iconSize.Width + StatusIconSpacing;
+ }
}
public double Zoom {
@@ -2753,19 +2692,21 @@ namespace MonoDevelop.Ide.Gui.Components
if (value == null || value == CellRendererImage.NullImage)
return null;
+ var img = value.HasFixedSize ? value : value.WithSize (Gtk.IconSize.Menu);
+
if (zoom == 1)
- return value;
+ return img;
Xwt.Drawing.Image resized;
- if (resizedCache.TryGetValue (value, out resized))
+ if (resizedCache.TryGetValue (img, out resized))
return resized;
- int w = (int) (zoom * (double) value.Width);
- int h = (int) (zoom * (double) value.Height);
+ int w = (int) (zoom * (double) img.Width);
+ int h = (int) (zoom * (double) img.Height);
if (w == 0) w = 1;
if (h == 0) h = 1;
- resized = value.WithSize (w, h);
- resizedCache [value] = resized;
+ resized = img.WithSize (w, h);
+ resizedCache [img] = resized;
return resized;
}
@@ -2794,15 +2735,25 @@ namespace MonoDevelop.Ide.Gui.Components
if (image == null)
return;
+ bool selected = (flags & Gtk.CellRendererState.Selected) != 0;
+
using (var ctx = Gdk.CairoHelper.Create (window)) {
- if (overlayBottomLeft != null && overlayBottomLeft != NullImage)
- ctx.DrawImage (widget, overlayBottomLeft, x - overlayOverflow, y + image.Height - overlayBottomLeft.Height + overlayOverflow);
- if (overlayBottomRight != null && overlayBottomRight != NullImage)
- ctx.DrawImage (widget, overlayBottomRight, x + image.Width - overlayBottomRight.Width + overlayOverflow, y + image.Height - overlayBottomRight.Height + overlayOverflow);
- if (overlayTopLeft != null && overlayTopLeft != NullImage)
- ctx.DrawImage (widget, overlayTopLeft, x - overlayOverflow, y - overlayOverflow);
- if (overlayTopRight != null && overlayTopRight != NullImage)
- ctx.DrawImage (widget, overlayTopRight, x + image.Width - overlayTopRight.Width + overlayOverflow, y - overlayOverflow);
+ if (overlayBottomLeft != null && overlayBottomLeft != NullImage) {
+ var img = selected ? overlayBottomLeft.WithStyles ("sel") : overlayBottomLeft;
+ ctx.DrawImage (widget, img, x - overlayOverflow, y + image.Height - img.Height + overlayOverflow);
+ }
+ if (overlayBottomRight != null && overlayBottomRight != NullImage) {
+ var img = selected ? overlayBottomRight.WithStyles ("sel") : overlayBottomRight;
+ ctx.DrawImage (widget, img, x + image.Width - img.Width + overlayOverflow, y + image.Height - img.Height + overlayOverflow);
+ }
+ if (overlayTopLeft != null && overlayTopLeft != NullImage) {
+ var img = selected ? overlayTopLeft.WithStyles ("sel") : overlayTopLeft;
+ ctx.DrawImage (widget, img, x - overlayOverflow, y - overlayOverflow);
+ }
+ if (overlayTopRight != null && overlayTopRight != NullImage) {
+ var img = selected ? overlayTopRight.WithStyles ("sel") : overlayTopRight;
+ ctx.DrawImage (widget, img, x + image.Width - img.Width + overlayOverflow, y - overlayOverflow);
+ }
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ITreeNavigator.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ITreeNavigator.cs
index 67b56ba78a..f9d60de665 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ITreeNavigator.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ITreeNavigator.cs
@@ -37,6 +37,7 @@ namespace MonoDevelop.Ide.Gui.Components
string NodeName { get; }
object GetParentDataItem (Type type, bool includeCurrent);
+ T GetParentDataItem<T> (bool includeCurrent);
bool Selected { get; set; }
bool Expanded { get; set; }
void ExpandToNode ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/LogView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/LogView.cs
index 9932f93145..909dccb19f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/LogView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/LogView.cs
@@ -25,7 +25,6 @@
// THE SOFTWARE.
using System;
-using MonoDevelop.Ide.Gui.Pads;
using Gtk;
using Pango;
using System.Collections.Generic;
@@ -38,6 +37,7 @@ using MonoDevelop.Ide.Fonts;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.Commands;
using System.Linq;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui.Components
{
@@ -123,17 +123,23 @@ namespace MonoDevelop.Ide.Gui.Components
[CommandHandler (EditCommands.Cut)]
void CutText ()
{
- if (Buffer.HasSelection) {
+ if (!Buffer.HasSelection)
+ return;
+ if (Editable) {
var clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
Buffer.CutClipboard (clipboard, false);
+ } else {
+ CopyText ();
}
}
[CommandHandler (EditCommands.Paste)]
void PasteText ()
{
- var clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
- Buffer.PasteClipboard (clipboard);
+ if (Editable) {
+ var clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
+ Buffer.PasteClipboard (clipboard);
+ }
}
static readonly Regex lineRegex = new Regex ("\\b.*\\s(?<file>(\\w:)?[/\\\\].*):(\\w+\\s)?(?<line>\\d+)\\.?\\s*$", RegexOptions.Compiled);
@@ -211,16 +217,16 @@ namespace MonoDevelop.Ide.Gui.Components
buffer.TagTable.Add (bold);
errorTag = new TextTag ("error");
- errorTag.Foreground = "#dc3122";
+ errorTag.Foreground = Styles.ErrorForegroundColor.ToHexString (false);
errorTag.Weight = Weight.Bold;
buffer.TagTable.Add (errorTag);
debugTag = new TextTag ("debug");
- debugTag.Foreground = "#256ada";
+ debugTag.Foreground = Styles.InformationForegroundColor.ToHexString (false);
buffer.TagTable.Add (debugTag);
consoleLogTag = new TextTag ("consoleLog");
- consoleLogTag.Foreground = "darkgrey";
+ consoleLogTag.Foreground = Styles.DimTextColor.ToHexString (false);
buffer.TagTable.Add (consoleLogTag);
tag = new TextTag ("0");
@@ -231,7 +237,7 @@ namespace MonoDevelop.Ide.Gui.Components
endMark = buffer.CreateMark ("end-mark", buffer.EndIter, false);
UpdateCustomFont ();
- IdeApp.Preferences.CustomOutputPadFontChanged += HandleCustomFontChanged;
+ IdeApp.Preferences.CustomOutputPadFont.Changed += HandleCustomFontChanged;
outputDispatcher = new GLib.TimeoutHandler (outputDispatchHandler);
@@ -253,7 +259,7 @@ namespace MonoDevelop.Ide.Gui.Components
closeButton = new Button ();
closeButton.CanFocus = true;
closeButton.Relief = ReliefStyle.None;
- closeButton.Image = ImageService.GetImage ("gtk-close", IconSize.Menu);
+ closeButton.Image = new ImageView ("gtk-close", IconSize.Menu);
closeButton.Clicked += delegate {
HideSearchBox ();
};
@@ -263,7 +269,7 @@ namespace MonoDevelop.Ide.Gui.Components
buttonSearchForward.CanFocus = true;
buttonSearchForward.Relief = ReliefStyle.None;
buttonSearchForward.TooltipText = GettextCatalog.GetString ("Find next {0}", GetShortcut (SearchCommands.FindNext));
- buttonSearchForward.Image = ImageService.GetImage ("gtk-go-down", IconSize.Menu);
+ buttonSearchForward.Image = new ImageView ("gtk-go-down", IconSize.Menu);
buttonSearchForward.Clicked += delegate {
FindNext ();
};
@@ -273,7 +279,7 @@ namespace MonoDevelop.Ide.Gui.Components
buttonSearchBackward.CanFocus = true;
buttonSearchBackward.Relief = ReliefStyle.None;
buttonSearchBackward.TooltipText = GettextCatalog.GetString ("Find previous {0}", GetShortcut (SearchCommands.FindPrevious));
- buttonSearchBackward.Image = ImageService.GetImage ("gtk-go-up", IconSize.Menu);
+ buttonSearchBackward.Image = new ImageView ("gtk-go-up", IconSize.Menu);
buttonSearchBackward.Clicked += delegate {
FindPrev ();
};
@@ -429,7 +435,7 @@ namespace MonoDevelop.Ide.Gui.Components
}
#endregion
- public LogViewProgressMonitor GetProgressMonitor ()
+ public OutputProgressMonitor GetProgressMonitor ()
{
return new LogViewProgressMonitor (this);
}
@@ -563,7 +569,13 @@ namespace MonoDevelop.Ide.Gui.Components
else
addQueuedUpdate (new QueuedTextWrite (category + ": " + message, debugTag));
}
-
+
+ bool ShouldAutoScroll ()
+ {
+ // we need to account for the page size as well for some reason
+ return scrollView.Vadjustment.Value + scrollView.Vadjustment.PageSize >= scrollView.Vadjustment.Upper;
+ }
+
protected void UnsafeAddText (string text, TextTag extraTag)
{
//don't allow the pad to hold more than MAX_BUFFER_LENGTH chars
@@ -575,7 +587,8 @@ namespace MonoDevelop.Ide.Gui.Components
buffer.Delete (ref start, ref end);
}
- bool scrollToEnd = scrollView.Vadjustment.Value >= scrollView.Vadjustment.Upper - 2 * scrollView.Vadjustment.PageSize;
+ bool scrollToEnd = ShouldAutoScroll ();
+
TextIter it = buffer.EndIter;
if (extraTag != null)
@@ -619,7 +632,7 @@ namespace MonoDevelop.Ide.Gui.Components
updates.Clear ();
lastTextWrite = null;
}
- IdeApp.Preferences.CustomOutputPadFontChanged -= HandleCustomFontChanged;
+ IdeApp.Preferences.CustomOutputPadFont.Changed -= HandleCustomFontChanged;
}
abstract class QueuedUpdate
@@ -676,109 +689,143 @@ namespace MonoDevelop.Ide.Gui.Components
}
}
- public class LogViewProgressMonitor : NullProgressMonitor, IDebugConsole
+ public class LogViewProgressMonitor : OutputProgressMonitor
{
LogView outputPad;
- event EventHandler stopRequested;
-
- LogTextWriter logger = new LogTextWriter ();
+
LogTextWriter internalLogger = new LogTextWriter ();
- LogTextWriter errorLogger = new LogTextWriter();
NotSupportedTextReader inputReader = new NotSupportedTextReader ();
+ OperationConsole console;
- public LogView LogView {
+ internal LogView LogView {
get { return outputPad; }
}
- public LogViewProgressMonitor (LogView pad)
+ internal LogViewProgressMonitor (LogView pad): base (Runtime.MainSynchronizationContext)
{
outputPad = pad;
outputPad.Clear ();
- logger.TextWritten += outputPad.WriteText;
internalLogger.TextWritten += outputPad.WriteConsoleLogText;
- errorLogger.TextWritten += outputPad.WriteError;
+ console = new LogViewProgressConsole (this);
}
-
- public override void BeginTask (string name, int totalWork)
+
+ public override OperationConsole Console {
+ get { return console; }
+ }
+
+ internal void Cancel ()
+ {
+ CancellationTokenSource.Cancel ();
+ }
+
+ protected override void OnWriteLog (string message)
+ {
+ outputPad.WriteText (message);
+ base.OnWriteLog (message);
+ }
+
+ protected override void OnWriteErrorLog (string message)
+ {
+ outputPad.WriteText (message);
+ base.OnWriteErrorLog (message);
+ }
+
+ protected override void OnBeginTask (string name, int totalWork, int stepWork)
{
if (outputPad == null) throw GetDisposedException ();
outputPad.BeginTask (name, totalWork);
- base.BeginTask (name, totalWork);
+ base.OnBeginTask (name, totalWork, stepWork);
}
-
- public override void EndTask ()
+
+ protected override void OnEndTask (string name, int totalWork, int stepWork)
{
if (outputPad == null) throw GetDisposedException ();
outputPad.EndTask ();
- base.EndTask ();
+ base.OnEndTask (name, totalWork, stepWork);
+ }
+
+ Exception GetDisposedException ()
+ {
+ return new InvalidOperationException ("Output progress monitor already disposed.");
}
protected override void OnCompleted ()
{
if (outputPad == null) throw GetDisposedException ();
outputPad.WriteText ("\n");
-
- foreach (string msg in Messages)
+
+ foreach (string msg in SuccessMessages)
outputPad.WriteText (msg + "\n");
-
+
foreach (string msg in Warnings)
outputPad.WriteText (msg + "\n");
-
+
foreach (ProgressError msg in Errors)
outputPad.WriteError (msg.Message + "\n");
base.OnCompleted ();
-
+
outputPad = null;
+
+ if (Completed != null)
+ Completed (this, EventArgs.Empty);
}
-
- Exception GetDisposedException ()
- {
- return new InvalidOperationException ("Output progress monitor already disposed.");
- }
-
- protected override void OnCancelRequested ()
+
+ public override void Dispose ()
{
- base.OnCancelRequested ();
- if (stopRequested != null)
- stopRequested (this, null);
- }
-
- public override TextWriter Log {
- get { return logger; }
- }
-
- TextWriter IConsole.Log {
- get { return internalLogger; }
+ base.Dispose ();
+ console.Dispose ();
}
-
- TextReader IConsole.In {
- get { return inputReader; }
- }
-
- TextWriter IConsole.Out {
- get { return logger; }
- }
-
- TextWriter IConsole.Error {
- get { return errorLogger; }
- }
- void IDebugConsole.Debug (int level, string category, string message)
+ internal event EventHandler Completed;
+
+ class LogViewProgressConsole: OperationConsole
{
- outputPad.WriteDebug (level, category, message);
- }
-
- bool IConsole.CloseOnDispose {
- get { return false; }
- }
-
- event EventHandler IConsole.CancelRequested {
- add { stopRequested += value; }
- remove { stopRequested -= value; }
+ LogViewProgressMonitor monitor;
+
+ public LogViewProgressConsole (LogViewProgressMonitor monitor)
+ {
+ this.monitor = monitor;
+ CancellationSource = monitor.CancellationTokenSource;
+ }
+
+ public override TextReader In {
+ get {
+ return monitor.inputReader;
+ }
+ }
+ public override TextWriter Out {
+ get {
+ return monitor.Log;
+ }
+ }
+ public override TextWriter Error {
+ get {
+ return monitor.ErrorLog;
+ }
+ }
+ public override TextWriter Log {
+ get {
+ return monitor.internalLogger;
+ }
+ }
+
+ public override void Debug (int level, string category, string message)
+ {
+ monitor.outputPad.WriteDebug (level, category, message);
+ }
+
+ public override void Dispose ()
+ {
+ if (monitor != null) {
+ var m = monitor; // Avoid recursive dispose, since the monitor also disposes this console
+ monitor = null;
+ m.Dispose ();
+ }
+ base.Dispose ();
+ }
}
}
-
class NotSupportedTextReader: TextReader
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/NodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/NodeBuilder.cs
index 43fe8d16e4..76a5e918c7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/NodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/NodeBuilder.cs
@@ -198,13 +198,12 @@ namespace MonoDevelop.Ide.Gui.Components
if (StatusSeverity.HasValue) {
switch (StatusSeverity.Value) {
case TaskSeverity.Error:
- return ImageService.GetIcon ("md-project-status-error");
+ return ImageService.GetIcon ("md-error");
case TaskSeverity.Warning:
- return ImageService.GetIcon ("md-project-status-warning");
+ return ImageService.GetIcon ("md-warning");
case TaskSeverity.Information:
- return ImageService.GetIcon ("md-project-status-information");
case TaskSeverity.Comment:
- return ImageService.GetIcon ("md-project-status-information");
+ return ImageService.GetIcon ("md-information");
}
}
return CellRendererImage.NullImage;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/NodeState.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/NodeState.cs
index 5284ff8788..65cf1e077f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/NodeState.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/NodeState.cs
@@ -37,11 +37,11 @@ namespace MonoDevelop.Ide.Gui.Components
{
public class NodeState : ICustomXmlSerializer
{
- public string NodeName { get; set; }
- public bool Expanded { get; set; }
- public bool Selected { get; set; }
- public bool IsRoot { get { return NodeName == "__root__"; } }
- public List<NodeState> ChildrenState { get; set; }
+ internal string NodeName { get; set; }
+ internal bool Expanded { get; set; }
+ internal bool Selected { get; set; }
+ internal bool IsRoot { get { return NodeName == "__root__"; } }
+ internal List<NodeState> ChildrenState { get; set; }
internal static NodeState CreateRoot ()
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/PadTreeView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/PadTreeView.cs
index f70437425c..9a78dda936 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/PadTreeView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/PadTreeView.cs
@@ -27,7 +27,6 @@
using System;
using System.Collections.Generic;
using Gtk;
-using Mono.TextEditor;
namespace MonoDevelop.Ide.Gui.Components
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ProjectSelectorWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ProjectSelectorWidget.cs
index 69a2ed490a..d58f9d2ff3 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ProjectSelectorWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ProjectSelectorWidget.cs
@@ -37,11 +37,11 @@ namespace MonoDevelop.Ide.Gui.Components
{
TreeStore store;
bool showCheckboxes;
- IBuildTarget rootItem;
- IBuildTarget currentSelection;
- HashSet<IBuildTarget> activeItems = new HashSet<IBuildTarget> ();
+ WorkspaceObject rootItem;
+ WorkspaceObject currentSelection;
+ HashSet<WorkspaceObject> activeItems = new HashSet<WorkspaceObject> ();
HashSet<Type> selectableTypes = new HashSet<Type> ();
- Func<IBuildTarget,bool> selectableFilter;
+ Func<WorkspaceObject,bool> selectableFilter;
public event EventHandler SelectionChanged;
public event EventHandler ActiveChanged;
@@ -76,7 +76,7 @@ namespace MonoDevelop.Ide.Gui.Components
{
TreeIter it;
if (tree.Selection.GetSelected (out it))
- currentSelection = (IBuildTarget) store.GetValue (it, 2);
+ currentSelection = (WorkspaceObject) store.GetValue (it, 2);
else
currentSelection = null;
@@ -84,7 +84,7 @@ namespace MonoDevelop.Ide.Gui.Components
SelectionChanged (this, EventArgs.Empty);
}
- public Func<IBuildTarget,bool> SelectableFilter {
+ public Func<WorkspaceObject,bool> SelectableFilter {
get {
return selectableFilter;
}
@@ -94,7 +94,7 @@ namespace MonoDevelop.Ide.Gui.Components
}
}
- public IBuildTarget SelectedItem {
+ public WorkspaceObject SelectedItem {
get {
if (currentSelection != null && !IsSelectable (currentSelection))
return null;
@@ -107,12 +107,12 @@ namespace MonoDevelop.Ide.Gui.Components
}
}
- public IEnumerable<IBuildTarget> ActiveItems {
+ public IEnumerable<WorkspaceObject> ActiveItems {
get {
return activeItems;
}
set {
- activeItems = new HashSet<IBuildTarget> ();
+ activeItems = new HashSet<WorkspaceObject> ();
activeItems.UnionWith (value);
SetSelection (currentSelection, activeItems);
}
@@ -136,7 +136,7 @@ namespace MonoDevelop.Ide.Gui.Components
public bool CascadeCheckboxSelection { get; set; }
- public IBuildTarget RootItem {
+ public WorkspaceObject RootItem {
get {
return this.rootItem;
}
@@ -148,7 +148,7 @@ namespace MonoDevelop.Ide.Gui.Components
void Fill ()
{
- IBuildTarget sel = SelectedItem;
+ WorkspaceObject sel = SelectedItem;
store.Clear ();
if (rootItem is RootWorkspace) {
foreach (var item in ((RootWorkspace)rootItem).Items)
@@ -161,7 +161,7 @@ namespace MonoDevelop.Ide.Gui.Components
}
}
- void AddEntry (TreeIter iter, IBuildTarget item)
+ void AddEntry (TreeIter iter, WorkspaceObject item)
{
if (!IsVisible (item))
return;
@@ -190,7 +190,7 @@ namespace MonoDevelop.Ide.Gui.Components
if (selected)
tree.ExpandToPath (store.GetPath (iter));
- foreach (IBuildTarget ce in GetChildren (item))
+ foreach (WorkspaceObject ce in GetChildren (item))
AddEntry (iter, ce);
// Expand all root items by default
@@ -198,17 +198,17 @@ namespace MonoDevelop.Ide.Gui.Components
tree.ExpandRow (store.GetPath (iter), false);
}
- void SetSelection (IBuildTarget selected, HashSet<IBuildTarget> active)
+ void SetSelection (WorkspaceObject selected, HashSet<WorkspaceObject> active)
{
TreeIter it;
if (store.GetIterFirst (out it))
SetSelection (it, selected, active);
}
- bool SetSelection (TreeIter it, IBuildTarget selected, HashSet<IBuildTarget> active)
+ bool SetSelection (TreeIter it, WorkspaceObject selected, HashSet<WorkspaceObject> active)
{
do {
- IBuildTarget item = (IBuildTarget) store.GetValue (it, 2);
+ WorkspaceObject item = (WorkspaceObject) store.GetValue (it, 2);
if (selected != null && item == selected) {
tree.Selection.SelectIter (it);
tree.ExpandToPath (store.GetPath (it));
@@ -236,13 +236,13 @@ namespace MonoDevelop.Ide.Gui.Components
{
TreeIter iter;
store.GetIterFromString (out iter, args.Path);
- IBuildTarget ob = (IBuildTarget) store.GetValue (iter, 2);
+ var ob = (WorkspaceObject) store.GetValue (iter, 2);
if (activeItems.Contains (ob)) {
activeItems.Remove (ob);
if (CascadeCheckboxSelection) {
foreach (var i in GetAllChildren (ob))
activeItems.Remove (i);
- SetSelection (iter, null, new HashSet<IBuildTarget> ());
+ SetSelection (iter, null, new HashSet<WorkspaceObject> ());
} else {
store.SetValue (iter, 3, false);
}
@@ -261,13 +261,13 @@ namespace MonoDevelop.Ide.Gui.Components
ActiveChanged (this, EventArgs.Empty);
}
- IEnumerable<IBuildTarget> GetAllChildren (IBuildTarget item)
+ IEnumerable<WorkspaceObject> GetAllChildren (WorkspaceObject item)
{
- IEnumerable<IBuildTarget> res = GetChildren (item);
+ var res = GetChildren (item);
return res.Concat (res.SelectMany (i => GetAllChildren (i)));
}
- IEnumerable<IBuildTarget> GetChildren (IBuildTarget item)
+ IEnumerable<WorkspaceObject> GetChildren (WorkspaceObject item)
{
if (item is SolutionFolder) {
return ((SolutionFolder)item).Items;
@@ -276,27 +276,27 @@ namespace MonoDevelop.Ide.Gui.Components
} else if (item is Workspace) {
return ((Workspace)item).Items;
} else
- return new IBuildTarget [0];
+ return new WorkspaceObject [0];
}
- protected bool IsVisible (IBuildTarget item)
+ protected bool IsVisible (WorkspaceObject item)
{
return true;
}
- protected bool IsCheckboxVisible (IBuildTarget item)
+ protected bool IsCheckboxVisible (WorkspaceObject item)
{
if (!ShowCheckboxes)
return false;
return IsSelectable (item);
}
- bool IsSelectable (IBuildTarget item)
+ bool IsSelectable (WorkspaceObject item)
{
if (SelectableFilter != null && !SelectableFilter (item))
return false;
if (selectableTypes.Count > 0)
- return selectableTypes.Any (t => t.IsAssignableFrom (item.GetType ()));
+ return selectableTypes.Any (t => t.IsInstanceOfType (item));
return true;
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TransactedTreeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TransactedTreeBuilder.cs
index 1a8c0a34bf..92746d7fe7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TransactedTreeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TransactedTreeBuilder.cs
@@ -124,6 +124,11 @@ namespace MonoDevelop.Ide.Gui.Components
}
}
+ public T GetParentDataItem<T> (bool includeCurrent)
+ {
+ return (T)GetParentDataItem (typeof(T), includeCurrent);
+ }
+
public object GetParentDataItem (Type type, bool includeCurrent)
{
if (includeCurrent && type.IsInstanceOfType (DataItem))
@@ -909,7 +914,7 @@ namespace MonoDevelop.Ide.Gui.Components
}
}
- public void ScrollToCell (Gtk.TreePath treePath)
+ internal void ScrollToCell (Gtk.TreePath treePath)
{
Tree.ScrollToCell (treePath, null, true, 0, 0);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeBuilder.cs
index 8c810ff21f..be5a387fe5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeBuilder.cs
@@ -164,7 +164,7 @@ namespace MonoDevelop.Ide.Gui.Components
{
NodeBuilder[] chain = null;
Type oldType = null;
- Gtk.TreeIter oldIter = Gtk.TreeIter.Zero;
+ Gtk.TreeIter oldIter = currentIter;
// DateTime time = DateTime.Now;
int items = 0;
pad.Tree.FreezeChildNotify ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeNodeNavigator.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeNodeNavigator.cs
index b0bf949ed3..e4209d25fd 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeNodeNavigator.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/TreeNodeNavigator.cs
@@ -142,7 +142,7 @@ namespace MonoDevelop.Ide.Gui.Components
public void ScrollToNode ()
{
- tree.ScrollToCell (store.GetPath (currentIter), pad.CompleteColumn, true, 0, 0);
+ tree.ScrollToCell (store.GetPath (currentIter), pad.CompleteColumn, true, 0, -1);
}
public bool MoveToRoot ()
@@ -369,6 +369,11 @@ namespace MonoDevelop.Ide.Gui.Components
}
}
+ public T GetParentDataItem<T> (bool includeCurrent)
+ {
+ return (T)GetParentDataItem (typeof(T), includeCurrent);
+ }
+
public object GetParentDataItem (Type type, bool includeCurrent)
{
if (includeCurrent && type.IsInstanceOfType (DataItem))
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs
deleted file mode 100644
index 87562cd44b..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs
+++ /dev/null
@@ -1,524 +0,0 @@
-// CompletionTextEditorExtension.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (c) 2007 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-
-using System;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.CodeCompletion;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.Ide.Commands;
-using MonoDevelop.Core;
-using MonoDevelop.Ide.CodeTemplates;
-using ICSharpCode.NRefactory.Completion;
-
-namespace MonoDevelop.Ide.Gui.Content
-{
- public class CompletionTextEditorExtension: TextEditorExtension
- {
- CodeCompletionContext currentCompletionContext;
-
- bool autoHideCompletionWindow = true, autoHideParameterWindow = true;
-
- #region Completion related IDE
-// public readonly static PropertyWrapper<bool> EnableCodeCompletion = PropertyService.Wrap ("EnableCodeCompletion", true);
-// public readonly static PropertyWrapper<bool> EnableParameterInsight = PropertyService.Wrap ("EnableParameterInsight", true);
- public readonly static PropertyWrapper<bool> EnableAutoCodeCompletion = PropertyService.Wrap ("EnableAutoCodeCompletion", true);
- public readonly static PropertyWrapper<bool> AddImportedItemsToCompletionList = PropertyService.Wrap ("AddImportedItemsToCompletionList", false);
- public readonly static PropertyWrapper<bool> IncludeKeywordsInCompletionList = PropertyService.Wrap ("IncludeKeywordsInCompletionList", true);
- public readonly static PropertyWrapper<bool> IncludeCodeSnippetsInCompletionList = PropertyService.Wrap ("IncludeCodeSnippetsInCompletionList", true);
- public readonly static PropertyWrapper<bool> AddParenthesesAfterCompletion = PropertyService.Wrap ("AddParenthesesAfterCompletion", false);
- public readonly static PropertyWrapper<bool> AddOpeningOnly = PropertyService.Wrap ("AddOpeningOnly", false);
- public readonly static PropertyWrapper<int> CompletionListRows = PropertyService.Wrap ("CompletionListRows", 7);
-
- public readonly static PropertyWrapper<bool> FilterCompletionListByEditorBrowsable = PropertyService.Wrap ("FilterCompletionListByEditorBrowsable", true);
- public readonly static PropertyWrapper<bool> IncludeEditorBrowsableAdvancedMembers = PropertyService.Wrap ("IncludeEditorBrowsableAdvancedMembers", true);
-
- #endregion
-
- public ICompletionWidget CompletionWidget {
- get;
- set;
- }
-
-
- public virtual string CompletionLanguage {
- get {
- return "Other";
- }
- }
-
- public void ShowCompletion (ICompletionDataList completionList)
- {
- currentCompletionContext = CompletionWidget.CreateCodeCompletionContext (Document.Editor.Caret.Offset);
- int cpos, wlen;
- if (!GetCompletionCommandOffset (out cpos, out wlen)) {
- cpos = Document.Editor.Caret.Offset;
- wlen = 0;
- }
- currentCompletionContext.TriggerOffset = cpos;
- currentCompletionContext.TriggerWordLength = wlen;
-
- CompletionWindowManager.ShowWindow (this, '\0', completionList, CompletionWidget, currentCompletionContext);
- }
-
- // When a key is pressed, and before the key is processed by the editor, this method will be invoked.
- // Return true if the key press should be processed by the editor.
- public override bool KeyPress (Gdk.Key key, char keyChar, Gdk.ModifierType modifier)
- {
- bool res;
- if (currentCompletionContext != null) {
- if (CompletionWindowManager.PreProcessKeyEvent (key, keyChar, modifier)) {
- CompletionWindowManager.PostProcessKeyEvent (key, keyChar, modifier);
- autoHideCompletionWindow = true;
- // in named parameter case leave the parameter window open.
- autoHideParameterWindow = keyChar != ':';
- if (!autoHideParameterWindow && ParameterInformationWindowManager.IsWindowVisible)
- ParameterInformationWindowManager.PostProcessKeyEvent (this, CompletionWidget, key, modifier);
-
- return false;
- }
- autoHideCompletionWindow = autoHideParameterWindow = false;
- }
-
- if (ParameterInformationWindowManager.IsWindowVisible) {
- if (ParameterInformationWindowManager.ProcessKeyEvent (this, CompletionWidget, key, modifier))
- return false;
- autoHideCompletionWindow = autoHideParameterWindow = false;
- }
-
- // int oldPos = Editor.CursorPosition;
- // int oldLen = Editor.TextLength;
- res = base.KeyPress (key, keyChar, modifier);
-
- CompletionWindowManager.PostProcessKeyEvent (key, keyChar, modifier);
-
- var ignoreMods = Gdk.ModifierType.ControlMask | Gdk.ModifierType.MetaMask
- | Gdk.ModifierType.Mod1Mask | Gdk.ModifierType.SuperMask;
- // Handle parameter completion
- if (ParameterInformationWindowManager.IsWindowVisible) {
- ParameterInformationWindowManager.PostProcessKeyEvent (this, CompletionWidget, key, modifier);
- }
-
- if ((modifier & ignoreMods) != 0)
- return res;
-
- // don't complete on block selection
- if (/*!EnableCodeCompletion ||*/ Document.Editor.SelectionMode == Mono.TextEditor.SelectionMode.Block)
- return res;
-
- // Handle code completion
- if (keyChar != '\0' && CompletionWidget != null && !CompletionWindowManager.IsVisible) {
- currentCompletionContext = CompletionWidget.CurrentCodeCompletionContext;
- int triggerWordLength = currentCompletionContext.TriggerWordLength;
- ICompletionDataList completionList = HandleCodeCompletion (currentCompletionContext, keyChar,
- ref triggerWordLength);
- if (triggerWordLength > 0 && (triggerWordLength < Editor.Caret.Offset
- || (triggerWordLength == 1 && Editor.Caret.Offset == 1))) {
- currentCompletionContext
- = CompletionWidget.CreateCodeCompletionContext (Editor.Caret.Offset - triggerWordLength);
- currentCompletionContext.TriggerWordLength = triggerWordLength;
- }
- if (completionList != null) {
- if (!CompletionWindowManager.ShowWindow (this, keyChar, completionList, CompletionWidget, currentCompletionContext))
- currentCompletionContext = null;
- } else {
- currentCompletionContext = null;
- }
- }
-
- if (/*EnableParameterInsight &&*/ CompletionWidget != null) {
- CodeCompletionContext ctx = CompletionWidget.CurrentCodeCompletionContext;
- var paramProvider = HandleParameterCompletion (ctx, keyChar);
- if (paramProvider != null)
- ParameterInformationWindowManager.ShowWindow (this, CompletionWidget, ctx, paramProvider);
- }
-/* autoHideCompletionWindow = true;
- autoHideParameterWindow = keyChar != ':';*/
- return res;
- }
-
- protected void ShowCompletion (ICompletionDataList completionList, int triggerWordLength, char keyChar)
- {
- if (Document.Editor.SelectionMode == Mono.TextEditor.SelectionMode.Block)
- return;
- if (CompletionWidget != null && currentCompletionContext == null) {
- currentCompletionContext = CompletionWidget.CurrentCodeCompletionContext;
- if (triggerWordLength > 0 && triggerWordLength < Editor.Caret.Offset) {
- currentCompletionContext =
- CompletionWidget.CreateCodeCompletionContext (Editor.Caret.Offset - triggerWordLength);
- currentCompletionContext.TriggerWordLength = triggerWordLength;
- }
- if (completionList != null)
- CompletionWindowManager.ShowWindow (this, keyChar, completionList, CompletionWidget, currentCompletionContext);
- else
- currentCompletionContext = null;
- }
- autoHideCompletionWindow = autoHideParameterWindow = true;
- }
-
- public virtual int GetCurrentParameterIndex (int startOffset)
- {
- return -1;
- }
-
-
- protected void OnCompletionContextChanged (object o, EventArgs a)
- {
- if (autoHideCompletionWindow)
- CompletionWindowManager.HideWindow ();
- if (autoHideParameterWindow)
- ParameterInformationWindowManager.HideWindow (this, CompletionWidget);
- ParameterInformationWindowManager.UpdateCursorPosition (this, CompletionWidget);
- }
-
- [CommandUpdateHandler (TextEditorCommands.ShowCompletionWindow)]
- internal void OnUpdateCompletionCommand (CommandInfo info)
- {
- info.Bypass = !CanRunCompletionCommand () && !CompletionWindowManager.IsVisible;
- }
-
- [CommandUpdateHandler (TextEditorCommands.ShowParameterCompletionWindow)]
- internal void OnUpdateParameterCompletionCommand (CommandInfo info)
- {
- info.Bypass = !CanRunParameterCompletionCommand ();
- }
-
- [CommandHandler (TextEditorCommands.ShowCompletionWindow)]
- public virtual void RunCompletionCommand ()
- {
- if (Document.Editor.SelectionMode == Mono.TextEditor.SelectionMode.Block)
- return;
-
- if (CompletionWindowManager.IsVisible) {
- CompletionWindowManager.Wnd.ToggleCategoryMode ();
- return;
- }
- ICompletionDataList completionList = null;
- int cpos, wlen;
- if (!GetCompletionCommandOffset (out cpos, out wlen)) {
- cpos = Editor.Caret.Offset;
- wlen = 0;
- }
- currentCompletionContext = CompletionWidget.CreateCodeCompletionContext (cpos);
- currentCompletionContext.TriggerWordLength = wlen;
- completionList = CodeCompletionCommand (currentCompletionContext);
- if (completionList != null)
- CompletionWindowManager.ShowWindow (this, (char)0, completionList, CompletionWidget, currentCompletionContext);
- else
- currentCompletionContext = null;
- }
-
- [CommandHandler (TextEditorCommands.ShowCodeTemplateWindow)]
- public virtual void RunShowCodeTemplatesWindow ()
- {
- ICompletionDataList completionList = null;
- int cpos, wlen;
- if (!GetCompletionCommandOffset (out cpos, out wlen)) {
- cpos = Editor.Caret.Offset;
- wlen = 0;
- }
-
- var ctx = CompletionWidget.CreateCodeCompletionContext (cpos);
- ctx.TriggerWordLength = wlen;
- completionList = Document.Editor.IsSomethingSelected ? ShowCodeSurroundingsCommand (ctx) : ShowCodeTemplatesCommand (ctx);
- if (completionList == null) {
- return;
- }
- var wnd = new CompletionListWindow (Gtk.WindowType.Toplevel);
- wnd.TypeHint = Gdk.WindowTypeHint.Dialog;
- wnd.SkipPagerHint = true;
- wnd.SkipTaskbarHint = true;
- wnd.Decorated = false;
- wnd.Extension = this;
- wnd.ShowListWindow ((char)0, completionList, CompletionWidget, ctx);
- }
-
- [CommandUpdateHandler (TextEditorCommands.ShowCodeTemplateWindow)]
- internal void OnUpdateShowCodeTemplatesWindow (CommandInfo info)
- {
- ICompletionDataList completionList = null;
- int cpos, wlen;
- if (!GetCompletionCommandOffset (out cpos, out wlen)) {
- cpos = Editor.Caret.Offset;
- wlen = 0;
- }
- try {
- var ctx = CompletionWidget.CreateCodeCompletionContext (cpos);
- ctx.TriggerWordLength = wlen;
- completionList = Document.Editor.IsSomethingSelected ? ShowCodeSurroundingsCommand (ctx) : ShowCodeTemplatesCommand (ctx);
-
- info.Bypass = completionList == null;
- info.Text = Document.Editor.IsSomethingSelected ? GettextCatalog.GetString ("_Surround With...") : GettextCatalog.GetString ("I_nsert Template...");
- } catch (Exception e) {
- LoggingService.LogError ("Error while update show code templates window", e);
- info.Bypass = true;
- }
- }
-
-
- [CommandHandler (TextEditorCommands.ShowParameterCompletionWindow)]
- public virtual void RunParameterCompletionCommand ()
- {
- if (Document.Editor.SelectionMode == Mono.TextEditor.SelectionMode.Block || CompletionWidget == null)
- return;
- ParameterDataProvider cp = null;
- int cpos;
- if (!GetParameterCompletionCommandOffset (out cpos))
- cpos = Editor.Caret.Offset;
- CodeCompletionContext ctx = CompletionWidget.CreateCodeCompletionContext (cpos);
- cp = ParameterCompletionCommand (ctx);
- if (cp != null) {
- ParameterInformationWindowManager.ShowWindow (this, CompletionWidget, ctx, cp);
- ParameterInformationWindowManager.PostProcessKeyEvent (this, CompletionWidget, Gdk.Key.F, Gdk.ModifierType.None);
- }
- }
-
- public virtual bool CanRunCompletionCommand ()
- {
- return (CompletionWidget != null && currentCompletionContext == null);
- }
-
- public virtual bool CanRunParameterCompletionCommand ()
- {
- return (CompletionWidget != null && !ParameterInformationWindowManager.IsWindowVisible);
- }
-
-
- public virtual ICompletionDataList HandleCodeCompletion (CodeCompletionContext completionContext,
- char completionChar, ref int triggerWordLength)
- {
- return null;
- }
-
- public virtual ParameterDataProvider HandleParameterCompletion (CodeCompletionContext completionContext, char completionChar)
- {
- return null;
- }
-
- // return false if completion can't be shown
- public virtual bool GetCompletionCommandOffset (out int cpos, out int wlen)
- {
- cpos = wlen = 0;
- int pos = Editor.Caret.Offset - 1;
- while (pos >= 0) {
- char c = Editor.GetCharAt (pos);
- if (!char.IsLetterOrDigit (c) && c != '_')
- break;
- pos--;
- }
- if (pos == -1)
- return false;
-
- pos++;
- cpos = pos;
- int len = Editor.Length;
-
- while (pos < len) {
- char c = Editor.GetCharAt (pos);
- if (!char.IsLetterOrDigit (c) && c != '_')
- break;
- pos++;
- }
- wlen = pos - cpos;
- return true;
- }
-
- public virtual bool GetParameterCompletionCommandOffset (out int cpos)
- {
- cpos = 0;
- return false;
- }
-
- public virtual ICompletionDataList ShowCodeSurroundingsCommand (CodeCompletionContext completionContext)
- {
- CompletionDataList list = new CompletionDataList ();
- list.AutoSelect = true;
- list.AutoCompleteEmptyMatch = true;
- list.CompletionSelectionMode = CompletionSelectionMode.OwnTextField;
- var templateWidget = Document.GetContent<ICodeTemplateContextProvider> ();
- CodeTemplateContext ctx = CodeTemplateContext.Standard;
- if (templateWidget != null)
- ctx = templateWidget.GetCodeTemplateContext ();
- foreach (CodeTemplate template in CodeTemplateService.GetCodeTemplatesForFile (Document.FileName)) {
- if ((template.CodeTemplateType & CodeTemplateType.SurroundsWith) == CodeTemplateType.SurroundsWith) {
- if (ctx == template.CodeTemplateContext)
- list.Add (new CodeTemplateCompletionData (Document, template));
- }
- }
- return list;
- }
-
- public virtual ICompletionDataList ShowCodeTemplatesCommand (CodeCompletionContext completionContext)
- {
- CompletionDataList list = new CompletionDataList ();
- list.AutoSelect = true;
- list.AutoCompleteEmptyMatch = true;
- list.CompletionSelectionMode = CompletionSelectionMode.OwnTextField;
- foreach (CodeTemplate template in CodeTemplateService.GetCodeTemplatesForFile (Document.FileName)) {
- if (template.CodeTemplateType != CodeTemplateType.SurroundsWith) {
- list.Add (new CodeTemplateCompletionData (Document, template));
- }
- }
- return list;
- }
-
-
- public virtual ICompletionDataList CodeCompletionCommand (CodeCompletionContext completionContext)
- {
- // This default implementation of CodeCompletionCommand calls HandleCodeCompletion providing
- // the char at the cursor position. If it returns a provider, just return it.
-
- int pos = completionContext.TriggerOffset;
- if (pos > 0) {
- char ch = Editor.GetCharAt (pos - 1);
- int triggerWordLength = completionContext.TriggerWordLength;
- ICompletionDataList completionList = HandleCodeCompletion (completionContext, ch, ref triggerWordLength);
- if (completionList != null)
- return completionList;
- }
- return null;
- }
-
- public virtual ParameterDataProvider ParameterCompletionCommand (CodeCompletionContext completionContext)
- {
- // This default implementation of ParameterCompletionCommand calls HandleParameterCompletion providing
- // the char at the cursor position. If it returns a provider, just return it.
-
- int pos = completionContext.TriggerOffset;
- if (pos <= 0)
- return null;
- var cp = HandleParameterCompletion (completionContext, Editor.Document.GetCharAt (pos - 1));
- if (cp != null)
- return cp;
- return null;
- }
-
- public virtual int GuessBestMethodOverload (IParameterDataProvider provider, int currentOverload)
- {
- int cparam = GetCurrentParameterIndex (provider.StartOffset);
-
- if (cparam > provider.GetParameterCount (currentOverload) && !provider.AllowParameterList (currentOverload)) {
- // Look for an overload which has more parameters
- int bestOverload = -1;
- int bestParamCount = int.MaxValue;
- for (int n=0; n<provider.Count; n++) {
- int pc = provider.GetParameterCount (n);
- if (pc < bestParamCount && pc >= cparam) {
- bestOverload = n;
- bestParamCount = pc;
- }
- }
- if (bestOverload == -1) {
- for (int n=0; n<provider.Count; n++) {
- if (provider.AllowParameterList (n)) {
- bestOverload = n;
- break;
- }
- }
- }
- return bestOverload;
- }
- return -1;
- }
-
- void HandlePaste (int insertionOffset, string text, int insertedChars)
- {
- ParameterInformationWindowManager.HideWindow (this, CompletionWidget);
- CompletionWindowManager.HideWindow ();
- }
-
- void HandleFocusOutEvent (object o, Gtk.FocusOutEventArgs args)
- {
- ParameterInformationWindowManager.HideWindow (this, CompletionWidget);
- CompletionWindowManager.HideWindow ();
- }
-
- public override void Initialize ()
- {
- base.Initialize ();
- CompletionWindowManager.WindowClosed += HandleWindowClosed;
- CompletionWidget = Document.GetContent <ICompletionWidget> ();
- if (CompletionWidget != null)
- CompletionWidget.CompletionContextChanged += OnCompletionContextChanged;
- document.Editor.Caret.PositionChanged += HandlePositionChanged;
- document.Editor.Paste += HandlePaste;
- if (document.Editor.Parent != null)
- document.Editor.Parent.TextArea.FocusOutEvent += HandleFocusOutEvent;
- }
-
- void HandlePositionChanged (object sender, Mono.TextEditor.DocumentLocationEventArgs e)
- {
- CompletionWindowManager.UpdateCursorPosition ();
- }
-
- void HandleWindowClosed (object sender, EventArgs e)
- {
- currentCompletionContext = null;
- }
-
- bool disposed = false;
- public override void Dispose ()
- {
- if (!disposed) {
- CompletionWindowManager.HideWindow ();
- ParameterInformationWindowManager.HideWindow (this, CompletionWidget);
-
- disposed = true;
- if (document.Editor.Parent != null)
- document.Editor.Parent.TextArea.FocusOutEvent -= HandleFocusOutEvent;
- document.Editor.Paste -= HandlePaste;
- document.Editor.Caret.PositionChanged -= HandlePositionChanged;
- CompletionWindowManager.WindowClosed -= HandleWindowClosed;
- if (CompletionWidget != null)
- CompletionWidget.CompletionContextChanged -= OnCompletionContextChanged;
- }
- base.Dispose ();
- }
- }
-
- public interface ITypeNameResolver
- {
- string ResolveName (string typeName);
- }
- class SimpleTypeNameResolver: ITypeNameResolver
- {
- // This simple resolver removes the namespace from all class names.
- // Used in ctrl+space, since all classes shown in the completion list
- // are in scope
-
- public static SimpleTypeNameResolver Instance = new SimpleTypeNameResolver ();
-
- public string ResolveName (string typeName)
- {
- int i = typeName.LastIndexOf ('.');
- if (i == -1)
- return typeName;
- else
- return typeName.Substring (i+1);
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/DocumentStateTracker.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/DocumentStateTracker.cs
index 45303e9457..b254fac993 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/DocumentStateTracker.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/DocumentStateTracker.cs
@@ -30,7 +30,8 @@
using System;
using System.Collections.Generic;
-using Mono.TextEditor;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
namespace MonoDevelop.Ide.Gui.Content
{
@@ -40,25 +41,25 @@ namespace MonoDevelop.Ide.Gui.Content
T currentEngine;
Stack<T> cachedEngines = new Stack<T> ();
- TextEditorData editor;
+ TextEditor editor;
- public DocumentStateTracker (T engine, TextEditorData editor)
+ public DocumentStateTracker (T engine, TextEditor editor)
{
this.currentEngine = engine;
this.editor = editor;
- editor.Document.TextReplaced += textChanged;
+ editor.TextChanged += textChanged;
}
public void Dispose ()
{
- editor.Document.TextReplaced -= textChanged;
+ editor.TextChanged -= textChanged;
}
public T Engine {
get { return currentEngine; }
}
- void textChanged (object sender, DocumentChangeEventArgs args)
+ void textChanged (object sender, TextChangeEventArgs args)
{
if (args.Offset< currentEngine.Position)
ResetEngineToPosition (args.Offset);
@@ -85,7 +86,7 @@ namespace MonoDevelop.Ide.Gui.Content
}
public void UpdateEngine ()
{
- UpdateEngine (editor.Caret.Offset);
+ UpdateEngine (editor.CaretOffset);
}
//Makes sure that the smart indent engine's cursor has caught up with the
@@ -112,7 +113,7 @@ namespace MonoDevelop.Ide.Gui.Content
// get the engine caught up
int nextSave = (cachedEngines.Count == 0)? BUFFER_SIZE : cachedEngines.Peek ().Position + BUFFER_SIZE;
if (currentEngine.Position + 1 == position) {
- char ch = editor.Document.GetCharAt (currentEngine.Position);
+ char ch = editor.GetCharAt (currentEngine.Position);
currentEngine.Push (ch);
ConsoleWrite ("pushing character '{0}'", ch);
if (currentEngine.Position == nextSave)
@@ -124,7 +125,7 @@ namespace MonoDevelop.Ide.Gui.Content
int endCut = currentEngine.Position + BUFFER_SIZE;
if (endCut > position)
endCut = position;
- string buffer = editor.Document.GetTextBetween (currentEngine.Position, endCut);
+ string buffer = editor.GetTextBetween (currentEngine.Position, endCut);
ConsoleWrite ("getting buffer between {0} and {1}" /* '{2}'"*/, currentEngine.Position, endCut - 1, buffer);
foreach (char ch in buffer) {
currentEngine.Push (ch);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IEditableTextBuffer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IEditableTextBuffer.cs
deleted file mode 100644
index c606819800..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IEditableTextBuffer.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//
-// IEditableTextBuffer.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using MonoDevelop.Projects.Text;
-
-namespace MonoDevelop.Ide.Gui.Content
-{
- public interface IEditableTextBuffer : ITextBuffer, IEditableTextFile, IUndoHandler
- {
- int LineCount { get; }
- void SetCaretTo (int line, int column);
- void SetCaretTo (int line, int column, bool highlightLine);
- void SetCaretTo (int line, int column, bool highlightLine, bool centerCaret);
- bool HasInputFocus { get; }
-
- void RunWhenLoaded (System.Action action);
-
- event EventHandler CaretPositionSet;
- event EventHandler<TextChangedEventArgs> TextChanged;
- }
-
- public class TextChangedEventArgs : System.EventArgs
- {
- int startIndex;
- public int StartIndex {
- get {
- return startIndex;
- }
- }
-
- int endIndex;
- public int EndIndex {
- get {
- return endIndex;
- }
- }
-
- public TextChangedEventArgs (int startIndex, int endIndex)
- {
- this.startIndex = startIndex;
- this.endIndex = endIndex;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IEncodedTextContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IEncodedTextContent.cs
deleted file mode 100644
index 53f2e681e5..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IEncodedTextContent.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// IEncodedTextContent.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Text;
-
-namespace MonoDevelop.Ide.Gui.Content
-{
- public interface IEncodedTextContent
- {
- void Load (string fileName, Encoding encoding);
- void Save (string fileName, Encoding encoding);
-
- Encoding SourceEncoding { get; }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IExtensibleTextEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IExtensibleTextEditor.cs
deleted file mode 100644
index 94df5d0c11..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IExtensibleTextEditor.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-// IExtensibleTextEditor.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2007 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using MonoDevelop.Ide.CodeCompletion;
-
-namespace MonoDevelop.Ide.Gui.Content
-{
- public interface IExtensibleTextEditor: IEditableTextBuffer
- {
- ITextEditorExtension Extension {
- get;
- }
- // The provided parameter is the first object of the extension chain
- // This method should return the terminator ITextEditorExtension that
- // will execute the default behavior (if any)
- ITextEditorExtension AttachExtension (ITextEditorExtension extension);
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IFoldable.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IFoldable.cs
index 2e163bc941..2775cfd06e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IFoldable.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IFoldable.cs
@@ -30,7 +30,7 @@ using System;
namespace MonoDevelop.Ide.Gui.Content
{
- public interface IFoldable
+ interface IFoldable
{
void ToggleAllFoldings ();
void FoldDefinitions ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IOpenNamedElementHandler.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IOpenNamedElementHandler.cs
index 306e4b4fab..177a533a58 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IOpenNamedElementHandler.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IOpenNamedElementHandler.cs
@@ -30,8 +30,9 @@ using System;
namespace MonoDevelop.Ide.Gui.Content
{
- public interface IOpenNamedElementHandler
+ interface IOpenNamedElementHandler
{
- void Open (ICSharpCode.NRefactory.TypeSystem.INamedElement element);
+ void Open (Microsoft.CodeAnalysis.ISymbol element, bool expandNode = true);
+ void Open (string documentationCommentId, bool openInPublicOnlyMode = true, bool expandNode = true);
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IPathedDocument.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IPathedDocument.cs
index 8491b1fd68..d7df693e08 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IPathedDocument.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/IPathedDocument.cs
@@ -35,7 +35,7 @@ namespace MonoDevelop.Ide.Gui.Content
{
PathEntry[] CurrentPath { get; }
- Gtk.Widget CreatePathWidget (int index);
+ Control CreatePathWidget (int index);
event EventHandler<DocumentPathChangedEventArgs> PathChanged;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ISmartIndenter.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ISmartIndenter.cs
deleted file mode 100644
index dfeb37a083..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ISmartIndenter.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//
-// ISmartIndenter.cs
-//
-// Author:
-// Michael Hutchinson <mhutchinson@novell.com>
-//
-// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace MonoDevelop.Ide.Gui.Content
-{
-
- public interface ISmartIndenter
- {
- Indent GetIndent (int line);
- Indent GetAutoTriggeredReindent (int insertionOffset, int length);
- }
-
- public struct Indent
- {
- int depth, alignment;
- bool isRelative;
-
- public Indent (int depth, int alignment)
- : this (depth, alignment, false)
- {
- }
-
- public Indent (int depth, int alignment, bool isRelative)
- {
- this.depth = depth;
- this.alignment = alignment;
- this.isRelative = isRelative;
- }
-
- public int Depth { get { return depth; } }
- public int Alignment { get { return alignment; } }
- public bool IsRelativeToPreviousLine { get { return isRelative; } }
-
- public bool IsZero { get { return Depth == 0 && Alignment == 0; } }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ISupportsProjectReload.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ISupportsProjectReload.cs
deleted file mode 100644
index c417f56dda..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ISupportsProjectReload.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// ISupportsProjectReload.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using MonoDevelop.Projects;
-
-namespace MonoDevelop.Ide.Gui.Content
-{
- /// <summary>
- /// To be implemented by views which can survive a project or solution reloading
- /// </summary>
- public interface ISupportsProjectReload
- {
- ProjectReloadCapability ProjectReloadCapability { get; }
-
- /// <summary>
- /// Called to update the project bound to the view.
- /// </summary>
- /// <param name="project">
- /// New project to assign to the view. It can be null.
- /// </param>
- void Update (Project project);
- }
-
- public enum ProjectReloadCapability
- {
- None = 0,
-
- /// <summary>
- /// It can keep unsaved data. Some status (such as undo queue) may be lost.
- /// </summary>
- UnsavedData = 1,
-
- /// <summary>
- /// It can keep unsaved data and status.
- /// </summary>
- Full = 2
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ITextBuffer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ITextBuffer.cs
deleted file mode 100644
index 02c2834d25..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ITextBuffer.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// ITextBuffer.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using MonoDevelop.Projects.Text;
-
-namespace MonoDevelop.Ide.Gui.Content
-{
- public interface ITextBuffer: ITextFile
- {
- //FIXME: this should be a method, it's relatively expensive
- string SelectedText { get; set; }
-
- int CursorPosition { get; set; }
-
- int SelectionStartPosition { get; }
- int SelectionEndPosition { get; }
-
- void Select (int startPosition, int endPosition);
- void ShowPosition (int position);
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ITextEditorResolver.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ITextEditorResolver.cs
index 5c1006a192..6d6ec4ab16 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ITextEditorResolver.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/ITextEditorResolver.cs
@@ -26,39 +26,26 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using System.Collections.Generic;
using System.Linq;
-using Mono.TextEditor;
using Mono.Addins;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.Semantics;
-using MonoDevelop.Ide.TypeSystem;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Ide.Gui.Content
{
public interface ITextEditorResolver
{
- ResolveResult GetLanguageItem (int offset);
- ResolveResult GetLanguageItem (int offset, string expression);
+ ISymbol GetLanguageItem (int offset);
+ ISymbol GetLanguageItem (int offset, string expression);
}
public interface ITextEditorResolverProvider
{
- ResolveResult GetLanguageItem (MonoDevelop.Ide.Gui.Document document, int offset, out DomRegion expressionRegion);
- ResolveResult GetLanguageItem (MonoDevelop.Ide.Gui.Document document, int offset, string identifier);
-
- string CreateTooltip (MonoDevelop.Ide.Gui.Document document, int offset, ResolveResult result, string errorInformations, Gdk.ModifierType modifierState);
-
- }
-
- public interface ITextEditorMemberPositionProvider
- {
- IUnresolvedTypeDefinition GetTypeAt (int offset);
- IUnresolvedMember GetMemberAt (int offset);
+ ISymbol GetLanguageItem (Document document, int offset, out DocumentRegion expressionRegion);
+ ISymbol GetLanguageItem (Document document, int offset, string identifier);
}
-
-
+
public static class TextEditorResolverService
{
static List<TextEditorResolverProviderCodon> providers = new List<TextEditorResolverProviderCodon> ();
@@ -85,16 +72,16 @@ namespace MonoDevelop.Ide.Gui.Content
return codon.CreateResolver ();
}
- public static ResolveResult GetLanguageItem (this MonoDevelop.Ide.Gui.Document document, int offset, out DomRegion expressionRegion)
- {
- if (document == null)
+ public static ISymbol GetLanguageItem (this Document document, int offset, out DocumentRegion expressionRegion)
+ {
+ if (document == null)
throw new System.ArgumentNullException ("document");
- var textEditorResolver = TextEditorResolverService.GetProvider (document.Editor.Document.MimeType);
+ var textEditorResolver = TextEditorResolverService.GetProvider (document.Editor.MimeType);
if (textEditorResolver != null) {
return textEditorResolver.GetLanguageItem (document, offset, out expressionRegion);
}
- expressionRegion = DomRegion.Empty;
+ expressionRegion = DocumentRegion.Empty;
return null;
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs
deleted file mode 100644
index 276c61db99..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs
+++ /dev/null
@@ -1,181 +0,0 @@
-// TextEditorExtension.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (c) 2007 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-
-using System;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.CodeCompletion;
-using MonoDevelop.Components.Commands;
-using MonoDevelop.Ide.Commands;
-using MonoDevelop.Core;
-using Mono.TextEditor;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Ide.TypeSystem;
-
-namespace MonoDevelop.Ide.Gui.Content
-{
- public class TextEditorExtension : ITextEditorExtension, ICommandRouter
- {
- internal protected Document document;
-
- public void Initialize (Document document)
- {
- if (this.document != null)
- throw new InvalidOperationException ("Extension is already initialized.");
- this.document = document;
- Initialize ();
- }
-
- public ITextEditorExtension Next {
- get;
- set;
- }
-
- protected Document Document {
- get { return document; }
- }
-
- protected TextEditorData Editor {
- get { return document != null ? document.Editor : null; }
- }
-
- protected FilePath FileName {
- get {
- IViewContent view = document.Window.ViewContent;
- return view.IsUntitled ? view.UntitledName : view.ContentName;
- }
- }
-
- protected IProjectContent GetParserContext ()
- {
- CheckInitialized ();
-
- IViewContent view = document.Window.ViewContent;
- string file = view.IsUntitled ? view.UntitledName : view.ContentName;
- Project project = view.Project;
-
- if (project != null)
- return TypeSystemService.GetProjectContext (project);
- return TypeSystemService.GetContext (file, Document.Editor.Document.MimeType, Document.Editor.Text);
- }
-
- protected Ambience GetAmbience ()
- {
- CheckInitialized ();
-
- IViewContent view = document.Window.ViewContent;
- string file = view.IsUntitled ? view.UntitledName : view.ContentName;
- return AmbienceService.GetAmbienceForFile (file);
- }
-
- public virtual bool ExtendsEditor (Document doc, IEditableTextBuffer editor)
- {
- return true;
- }
-
- // When a key is pressed, and before the key is processed by the editor, this method will be invoked.
- // Return true if the key press should be processed by the editor.
- public virtual bool KeyPress (Gdk.Key key, char keyChar, Gdk.ModifierType modifier)
- {
- CheckInitialized ();
-
- if (Next == null)
- return true;
- else
- return Next.KeyPress (key, keyChar, modifier);
- }
-
- public virtual void CursorPositionChanged ()
- {
- CheckInitialized ();
-
- if (Next != null)
- Next.CursorPositionChanged ();
- }
-
- public virtual void TextChanged (int startIndex, int endIndex)
- {
- if (Next != null)
- Next.TextChanged (startIndex, endIndex);
- }
-
- public virtual void Initialize ()
- {
- CheckInitialized ();
-
- TextEditorExtension next = Next as TextEditorExtension;
- if (next != null)
- next.Initialize ();
- }
-
- public virtual void Dispose ()
- {
- }
-
- void CheckInitialized ()
- {
- if (document == null)
- throw new InvalidOperationException ("Editor extension not yet initialized");
- }
-
- object ITextEditorExtension.GetExtensionCommandTarget ()
- {
- return this;
- }
-
- object ICommandRouter.GetNextCommandTarget ()
- {
- if (Next != null)
- return Next.GetExtensionCommandTarget ();
- else
- return null;
- }
- }
-
- public interface ITextEditorExtension : IDisposable
- {
- ITextEditorExtension Next {
- get;
- }
-
- bool KeyPress (Gdk.Key key, char keyChar, Gdk.ModifierType modifier);
- void CursorPositionChanged ();
- void TextChanged (int startIndex, int endIndex);
-
- // Return the object that is going to process commands, or null
- // if commands don't need custom processing
- object GetExtensionCommandTarget ();
- }
-
- class TextEditorExtensionMarker: TextEditorExtension
- {
- public override bool ExtendsEditor (Document doc, IEditableTextBuffer editor)
- {
- return false;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/AboutMonoDevelopTabPage.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/AboutMonoDevelopTabPage.cs
index 596bef099b..70287f70e0 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/AboutMonoDevelopTabPage.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/AboutMonoDevelopTabPage.cs
@@ -43,11 +43,11 @@ namespace MonoDevelop.Ide.Gui.Dialogs
{
BorderWidth = 0;
- var aboutFile = BrandingService.GetFile ("AboutImage.png");
+ var aboutFile = BrandingService.GetFile (AboutDialogImage.Name);
if (aboutFile != null)
imageSep = Xwt.Drawing.Image.FromFile (aboutFile);
else
- imageSep = Xwt.Drawing.Image.FromResource ("AboutImage.png");
+ imageSep = Xwt.Drawing.Image.FromResource (AboutDialogImage.Name);
PackStart (new ImageView (imageSep), false, false, 0);
@@ -71,16 +71,24 @@ namespace MonoDevelop.Ide.Gui.Dialogs
Text = GettextCatalog.GetString ("License"),
Font = infoBox.Font.WithWeight (Xwt.Drawing.FontWeight.Bold)
});
- infoBox.PackStart (new Xwt.Label () {
- Text = GettextCatalog.GetString ("Released under the GNU Lesser General Public License."),
+ var cbox = new Xwt.HBox () {
+ Spacing = 0,
MarginLeft = 12
+ };
+ cbox.PackStart (new Xwt.Label () {
+ Text = GettextCatalog.GetString ("License is available at ")
});
+ cbox.PackStart (new Xwt.LinkLabel () {
+ Text = string.Format ("http://xamarin.com/xamarin-studio-license"),
+ Uri = new Uri ("http://xamarin.com/xamarin-studio-license")
+ });
+ infoBox.PackStart (cbox);
infoBox.PackStart (new Xwt.Label () {
Text = GettextCatalog.GetString ("Copyright"),
Font = infoBox.Font.WithWeight (Xwt.Drawing.FontWeight.Bold)
});
- var cbox = new Xwt.HBox () {
+ cbox = new Xwt.HBox () {
Spacing = 0,
MarginLeft = 12
};
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/AddinLoadErrorDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/AddinLoadErrorDialog.cs
index 330b87bb08..b7716e200d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/AddinLoadErrorDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/AddinLoadErrorDialog.cs
@@ -33,10 +33,11 @@ using System.Reflection;
using Mono.Addins;
using MonoDevelop.Core;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui.Dialogs
{
- internal partial class AddinLoadErrorDialog: Gtk.Dialog
+ internal partial class AddinLoadErrorDialog: IdeDialog
{
public AddinLoadErrorDialog (AddinError[] errors, bool warning)
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs
index b7a4e7aa90..794eb14c01 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/CommonAboutDialog.cs
@@ -44,15 +44,21 @@ using Pango;
using System.IO;
using Mono.Addins;
using System.Collections.Generic;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui.Dialogs
{
- internal class CommonAboutDialog : Dialog
+ public static class AboutDialogImage
+ {
+ public static string Name = "AboutImage.png";
+ }
+
+ internal class CommonAboutDialog : IdeDialog
{
public CommonAboutDialog ()
{
Name = "wizard_dialog";
- Title = string.Format (GettextCatalog.GetString ("About {0}"), BrandingService.ApplicationName);
+ Title = string.Format (GettextCatalog.GetString ("About {0}"), BrandingService.ApplicationLongName);
TransientFor = IdeApp.Workbench.RootWindow;
AllowGrow = false;
HasSeparator = false;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs
index 85be8e40f3..caceb45d9b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs
@@ -6,10 +6,12 @@ using Gtk;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
+using MonoDevelop.Components;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Gui.Dialogs
{
- internal class DirtyFilesDialog : Gtk.Dialog
+ internal class DirtyFilesDialog : IdeDialog
{
Button btnSaveAndQuit;
Button btnQuit;
@@ -35,7 +37,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
if (!doc.IsDirty)
continue;
- IViewContent viewcontent = doc.Window.ViewContent;
+ ViewContent viewcontent = doc.Window.ViewContent;
if (groupByProject && viewcontent.Project != null) {
TreeIter projIter = TreeIter.Zero;
@@ -121,19 +123,28 @@ namespace MonoDevelop.Ide.Gui.Dialogs
base.OnDestroyed ();
}
- void SaveAndQuit (object o, EventArgs e)
+ async void SaveAndQuit (object o, EventArgs e)
{
+ Sensitive = false;
+
+ List<Task> saveTasks = new List<Task> ();
tsFiles.Foreach (delegate (TreeModel model, TreePath path, TreeIter iter) {
var window = tsFiles.GetValue (iter, 2) as SdiWorkspaceWindow;
if (window == null)
return false;
if ((bool)tsFiles.GetValue (iter, 1)) {
- window.ViewContent.Save (window.ViewContent.ContentName);
+ saveTasks.Add (window.ViewContent.Save (window.ViewContent.ContentName));
} else {
window.ViewContent.DiscardChanges ();
}
return false;
});
+
+ try {
+ await Task.WhenAll (saveTasks);
+ } finally {
+ Sensitive = true;
+ }
Respond (Gtk.ResponseType.Ok);
Hide ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FeedbackDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FeedbackDialog.cs
index 79deec486f..c476a81e6b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FeedbackDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/FeedbackDialog.cs
@@ -28,10 +28,11 @@ using MonoDevelop.Core;
using System.Net;
using System.IO;
using MonoDevelop.Projects;
+using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.Ide.Gui.Dialogs
{
- public class FeedbackDialog: Gtk.Window
+ class FeedbackDialog: Gtk.Window
{
Gtk.VBox mainBox;
EntryWithEmptyMessage mailEntry;
@@ -260,7 +261,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
if (layout == null) {
layout = new Pango.Layout (PangoContext);
- layout.FontDescription = PangoContext.FontDescription.Copy ();
+ layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11);
}
int width, height;
@@ -293,7 +294,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
if (layout == null) {
layout = new Pango.Layout (PangoContext);
- layout.FontDescription = PangoContext.FontDescription.Copy ();
+ layout.FontDescription = FontService.SansFont.CopyModified (Styles.FontScale11);
}
int width, height;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkAlertDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkAlertDialog.cs
index 467d13b680..743114fc34 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkAlertDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkAlertDialog.cs
@@ -136,7 +136,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
newButton.UseUnderline = true;
newButton.UseStock = button.IsStockButton;
if (!String.IsNullOrEmpty (button.Icon))
- newButton.Image = new Image (button.Icon, IconSize.Button);
+ newButton.Image = new ImageView (button.Icon, IconSize.Button);
newButton.Clicked += ButtonClicked;
ActionArea.Add (newButton);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkErrorDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkErrorDialog.cs
deleted file mode 100644
index 70125ca105..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/GtkErrorDialog.cs
+++ /dev/null
@@ -1,185 +0,0 @@
-//
-// ErrorDialog.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using Gtk;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Ide.Gui.Dialogs
-{
- internal partial class GtkErrorDialog : Gtk.Dialog
- {
- TextTag tagWrap, tagNoWrap;
- TextView detailsTextView;
- Expander expander;
-
- public GtkErrorDialog (Window parent, string title, string message, AlertButton[] buttons)
- {
- if (string.IsNullOrEmpty (title))
- throw new ArgumentException ();
- if (buttons == null)
- throw new ArgumentException ();
-
- Title = BrandingService.ApplicationName;
- TransientFor = parent;
- Modal = true;
- WindowPosition = Gtk.WindowPosition.CenterOnParent;
- DefaultWidth = 624;
- DefaultHeight = 142;
-
- this.VBox.BorderWidth = 2;
-
- var hbox = new HBox () {
- Spacing = 6,
- BorderWidth = 12,
- };
-
- var errorImage = new Image (Gtk.Stock.DialogError, IconSize.Dialog) {
- Yalign = 0F,
- };
- hbox.PackStart (errorImage, false, false, 0);
- this.VBox.Add (hbox);
-
- var vbox = new VBox () {
- Spacing = 6,
- };
- hbox.PackEnd (vbox, true, true, 0);
-
- var titleLabel = new Label () {
- Markup = "<b>" + GLib.Markup.EscapeText (title) + "</b>",
- Xalign = 0F,
- };
- vbox.PackStart (titleLabel, false, false, 0);
-
- if (!string.IsNullOrWhiteSpace (message)) {
- message = message.Trim ();
- var descriptionLabel = new Label (message) {
- Xalign = 0F,
- Selectable = true,
- };
- descriptionLabel.LineWrap = true;
- descriptionLabel.WidthRequest = 500;
- descriptionLabel.ModifyBg (StateType.Normal, new Gdk.Color (255,0,0));
- vbox.PackStart (descriptionLabel, false, false, 0);
- }
-
- expander = new Expander (GettextCatalog.GetString ("Details")) {
- CanFocus = true,
- Visible = false,
- };
- vbox.PackEnd (expander, true, true, 0);
-
- var sw = new ScrolledWindow () {
- HeightRequest = 180,
- ShadowType = ShadowType.Out,
- };
- expander.Add (sw);
-
- detailsTextView = new TextView () {
- CanFocus = true,
- };
- detailsTextView.KeyPressEvent += TextViewKeyPressed;
- sw.Add (detailsTextView);
-
- var aa = this.ActionArea;
- aa.Spacing = 10;
- aa.LayoutStyle = ButtonBoxStyle.End;
- aa.BorderWidth = 5;
- aa.Homogeneous = true;
-
- expander.Activated += delegate {
- this.AllowGrow = expander.Expanded;
- GLib.Timeout.Add (100, delegate {
- Resize (DefaultWidth, 1);
- return false;
- });
- };
-
- tagNoWrap = new TextTag ("nowrap");
- tagNoWrap.WrapMode = WrapMode.None;
- detailsTextView.Buffer.TagTable.Add (tagNoWrap);
-
- tagWrap = new TextTag ("wrap");
- tagWrap.WrapMode = WrapMode.Word;
- detailsTextView.Buffer.TagTable.Add (tagWrap);
-
- this.Buttons = buttons;
- for (int i = 0; i < Buttons.Length; i++) {
- Gtk.Button button;
- button = new Gtk.Button (Buttons[i].Label);
- button.ShowAll ();
- AddActionWidget (button, i);
- }
-
- Child.ShowAll ();
- Hide ();
- }
-
- [GLib.ConnectBefore]
- void TextViewKeyPressed (object sender, KeyPressEventArgs args)
- {
- if (args.Event.State.HasFlag (Gdk.ModifierType.ControlMask) &&
- (args.Event.Key == Gdk.Key.c || args.Event.Key == Gdk.Key.C)) {
- TextView tv = (TextView) sender;
-
- Gtk.Clipboard clipboard = Gtk.Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
- Gtk.TextIter start, end;
- string text;
-
- if (!tv.Buffer.GetSelectionBounds (out start, out end) || start.Offset == end.Offset) {
- start = tv.Buffer.StartIter;
- end = tv.Buffer.EndIter;
- }
-
- text = tv.Buffer.GetText (start, end, true);
-
- if (Platform.IsWindows) {
- // Windows specific hack
- text = text.Replace ("\r\n", "\n");
- }
-
- clipboard.Text = text;
-
- args.RetVal = true;
- }
- }
-
- public AlertButton[] Buttons {
- get; private set;
- }
-
- public void AddDetails (string text, bool wrapped)
- {
- TextIter it = detailsTextView.Buffer.EndIter;
- if (wrapped)
- detailsTextView.Buffer.InsertWithTags (ref it, text, tagWrap);
- else
- detailsTextView.Buffer.InsertWithTags (ref it, text, tagNoWrap);
- expander.Visible = true;
- }
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/IOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/IOptionsPanel.cs
index 1dde9bf57f..167195dde8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/IOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/IOptionsPanel.cs
@@ -26,7 +26,7 @@
//
using System;
-using Gtk;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui.Dialogs
{
@@ -34,7 +34,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
{
void Initialize (OptionsDialog dialog, object dataObject);
- Widget CreatePanelWidget ();
+ Control CreatePanelWidget ();
bool IsVisible ();
bool ValidateChanges ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ItemOptionsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ItemOptionsDialog.cs
index 46e7450812..f7b322d16f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ItemOptionsDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ItemOptionsDialog.cs
@@ -27,6 +27,7 @@
using System;
using Mono.Addins;
+using MonoDevelop.Components;
using MonoDevelop.Projects.Extensions;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
@@ -39,7 +40,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
{
}
- public ItemOptionsDialog (Gtk.Window parentWindow, object dataObject)
+ public ItemOptionsDialog (Window parentWindow, object dataObject)
: base (parentWindow, dataObject, "/MonoDevelop/ProjectModel/Gui/ItemOptionPanels")
{
}
@@ -50,7 +51,20 @@ namespace MonoDevelop.Ide.Gui.Dialogs
extensionContext.RegisterCondition ("ItemType", new ItemTypeCondition (DataObject.GetType ()));
extensionContext.RegisterCondition ("ActiveLanguage", new ProjectLanguageCondition (DataObject));
if (DataObject is Project) {
+ extensionContext.RegisterCondition ("FlavorType", new FlavorTypeCondition ((Project)DataObject));
+ extensionContext.RegisterCondition ("ProjectTypeId", new ProjectTypeIdCondition ((Project)DataObject));
extensionContext.RegisterCondition ("SupportsTarget", new SupportsTargetCondition ((Project)DataObject));
+ } else {
+ extensionContext.RegisterCondition ("FlavorType", new FalseCondition ());
+ extensionContext.RegisterCondition ("ProjectTypeId", new FalseCondition ());
+ }
+ }
+
+ class FalseCondition: ConditionType
+ {
+ public override bool Evaluate (NodeElement conditionNode)
+ {
+ return false;
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ItemOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ItemOptionsPanel.cs
index f4f9b40ab3..fb478e3985 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ItemOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ItemOptionsPanel.cs
@@ -34,10 +34,10 @@ namespace MonoDevelop.Ide.Gui.Dialogs
{
public abstract class ItemOptionsPanel: OptionsPanel
{
- SolutionEntityItem solutionItem;
+ SolutionItem solutionItem;
WorkspaceItem workspaceItem;
- public SolutionEntityItem ConfiguredSolutionItem {
+ public SolutionItem ConfiguredSolutionItem {
get {
return solutionItem;
}
@@ -76,7 +76,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
{
base.Initialize (dialog, dataObject);
- solutionItem = dataObject as SolutionEntityItem;
+ solutionItem = dataObject as SolutionItem;
if (solutionItem != null)
workspaceItem = solutionItem.ParentSolution;
else
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MimeTypePolicyOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MimeTypePolicyOptionsPanel.cs
index 3bbff600fd..6745d05f2b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MimeTypePolicyOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MimeTypePolicyOptionsPanel.cs
@@ -96,8 +96,12 @@ namespace MonoDevelop.Ide.Gui.Dialogs
} else if (hasCachedPolicy) {
policyContainer.Set<T> ((T) cachedPolicy, mimeType);
}
+ OnPolicyStored ();
+ }
+
+ protected virtual void OnPolicyStored ()
+ {
}
-
void IMimeTypePolicyOptionsPanel.LoadParentPolicy ()
{
T policy = GetInheritedPolicy (mimeTypeScopes);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MimeTypePolicyOptionsSection.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MimeTypePolicyOptionsSection.cs
index 572534d795..97bd446b68 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MimeTypePolicyOptionsSection.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MimeTypePolicyOptionsSection.cs
@@ -30,12 +30,13 @@ using Gtk;
using System.Linq;
using Mono.Addins;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
using MonoDevelop.Projects.Policies;
using MonoDevelop.Ide.Extensions;
-
+
namespace MonoDevelop.Ide.Gui.Dialogs
{
class MimeTypePolicyOptionsSection: OptionsPanel
@@ -86,7 +87,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
isRoot = false;
}
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
HBox hbox = new HBox (false, 6);
Label label = new Label ();
@@ -112,7 +113,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
warningMessage = new HBox ();
warningMessage.Spacing = 6;
- Image img = new Image (Stock.Warning, IconSize.Menu);
+ var img = new ImageView (Stock.Warning, IconSize.Menu);
warningMessage.PackStart (img, false, false, 0);
Label wl = new Label (GettextCatalog.GetString ("Changes done in this section will only be applied to new projects. " +
"Settings for existing projects can be modified in the project (or solution) options dialog."));
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsDialog.cs
index ff956b9d6f..cd211d5b9f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsDialog.cs
@@ -27,6 +27,7 @@
using System;
using System.Collections.Generic;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
@@ -43,7 +44,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
{
}
- public MultiConfigItemOptionsDialog (Gtk.Window parentWindow, object dataObject): base (parentWindow, dataObject)
+ public MultiConfigItemOptionsDialog (Window parentWindow, object dataObject): base (parentWindow, dataObject)
{
IConfigurationTarget ct = DataObject as IConfigurationTarget;
if (ct == null)
@@ -132,13 +133,13 @@ namespace MonoDevelop.Ide.Gui.Dialogs
ConfigurationData data = new ConfigurationData (entry);
foreach (ItemConfiguration conf in entry.Configurations) {
- ItemConfiguration copy = (ItemConfiguration) conf.Clone ();
+ ItemConfiguration copy = entry.CloneConfiguration (conf, conf.Id);
data.Configurations.Add (copy);
}
if (entry is Solution) {
- foreach (SolutionItem e in ((Solution)entry).Items) {
- if (e is SolutionEntityItem)
- data.children.Add (ConfigurationData.Build ((SolutionEntityItem) e));
+ foreach (SolutionFolderItem e in ((Solution)entry).Items) {
+ if (e is SolutionItem)
+ data.children.Add (Build ((SolutionItem) e));
}
}
return data;
@@ -177,7 +178,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
data.Update (modifiedObjects);
// If configurations have been renamed, update the references in the solution
- SolutionEntityItem item = entry as SolutionEntityItem;
+ SolutionItem item = entry as SolutionItem;
if (item != null && renameData.Count > 0) {
Solution sol = item.ParentSolution;
if (sol != null) {
@@ -196,12 +197,12 @@ namespace MonoDevelop.Ide.Gui.Dialogs
public ItemConfiguration AddConfiguration (string name, string sourceName, bool createChildConfigurations)
{
- ItemConfiguration conf = entry.CreateConfiguration (name);
+ ItemConfiguration conf = entry.CreateConfiguration (name, ConfigurationKind.Blank);
if (sourceName != null) {
ItemConfiguration sc = configurations [sourceName];
if (sc != null)
- conf.CopyFrom (sc);
+ conf.CopyFrom (sc, true);
else
sourceName = null;
}
@@ -211,9 +212,9 @@ namespace MonoDevelop.Ide.Gui.Dialogs
foreach (ConfigurationData data in children) {
SolutionConfigurationEntry ce;
if (sourceName != null)
- ce = cc.GetEntryForItem ((SolutionEntityItem)data.Entry);
+ ce = cc.GetEntryForItem ((SolutionItem)data.Entry);
else
- ce = cc.AddItem ((SolutionEntityItem) data.Entry);
+ ce = cc.AddItem ((SolutionItem) data.Entry);
if (createChildConfigurations) {
ce.ItemConfiguration = name;
if (data.Configurations [name] == null)
@@ -242,13 +243,17 @@ namespace MonoDevelop.Ide.Gui.Dialogs
ConfigurationsChanged (this, null);
}
- public void RenameConfiguration (string oldName, string newName, bool renameChildConfigurations)
+ public ItemConfiguration RenameConfiguration (string oldName, string newName, bool renameChildConfigurations)
{
renameData.Add (new RenameData { OldName = oldName, NewName = newName });
-
+ ItemConfiguration newConf = null;
+
ItemConfiguration cc = configurations [oldName];
if (cc != null) {
- cc.Id = newName;
+ newConf = entry.CreateConfiguration (newName, ConfigurationKind.Blank);
+ newConf.CopyFrom (cc, true);
+ int i = configurations.IndexOf (cc);
+ configurations [i] = newConf;
}
if (renameChildConfigurations) {
if (entry is Solution) {
@@ -264,6 +269,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
}
if (ConfigurationsChanged != null)
ConfigurationsChanged (this, null);
+ return newConf;
}
public event EventHandler ConfigurationsChanged;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs
index 070a3ce134..62fc2913f1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiConfigItemOptionsPanel.cs
@@ -28,9 +28,12 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
+using MonoDevelop.Components.AutoTest;
+using System.ComponentModel;
namespace MonoDevelop.Ide.Gui.Dialogs
{
@@ -38,6 +41,8 @@ namespace MonoDevelop.Ide.Gui.Dialogs
{
MultiConfigItemOptionsDialog dialog;
Gtk.ComboBox configCombo;
+ Gtk.ListStore configListStore;
+ const int configListStoreConfigNameColumn = 1;
Gtk.ComboBox platformCombo;
List<ItemConfiguration> currentConfigs = new List<ItemConfiguration> ();
List<string> platforms = new List<string> ();
@@ -94,16 +99,23 @@ namespace MonoDevelop.Ide.Gui.Dialogs
}
}
- Gtk.Widget IOptionsPanel.CreatePanelWidget ()
+ Control IOptionsPanel.CreatePanelWidget ()
{
Gtk.VBox cbox = new Gtk.VBox (false, 6);
- Gtk.HBox combosBox = new Gtk.HBox (false, 6);
+ Gtk.HBox combosBox = new Gtk.HBox (false, 6) { Name = "panelWidgetCombosBox" };
cbox.PackStart (combosBox, false, false, 0);
combosBox.PackStart (new Gtk.Label (GettextCatalog.GetString ("Configuration:")), false, false, 0);
- configCombo = Gtk.ComboBox.NewText ();
+ configListStore = new Gtk.ListStore (typeof(string), typeof(string));
+ configCombo = new Gtk.ComboBox (configListStore) { Name = "panelWidgetConfigurationCombo" };
+ SemanticModelAttribute modelAttr = new SemanticModelAttribute ("configListStore__DisplayName", "configListStore__ConfigName");
+ TypeDescriptor.AddAttributes (configListStore, modelAttr);
+ var cell = new Gtk.CellRendererText ();
+ configCombo.PackStart (cell, true);
+ configCombo.AddAttribute (cell, "text", 0);
combosBox.PackStart (configCombo, false, false, 0);
combosBox.PackStart (new Gtk.Label (GettextCatalog.GetString ("Platform:")), false, false, 0);
platformCombo = Gtk.ComboBox.NewText ();
+ platformCombo.Name = "panelWidgetPlatformCombo";
combosBox.PackStart (platformCombo, false, false, 0);
cbox.PackStart (new Gtk.HSeparator (), false, false, 0);
cbox.ShowAll ();
@@ -150,19 +162,34 @@ namespace MonoDevelop.Ide.Gui.Dialogs
void FillConfigurations ()
{
loading = true;
- ((Gtk.ListStore)configCombo.Model).Clear ();
+ configListStore.Clear ();
if (allowMixedConfigurations)
- configCombo.AppendText (GettextCatalog.GetString ("All Configurations"));
-
+ AppendComboConfig (GettextCatalog.GetString ("All Configurations"));
+
HashSet<string> configs = new HashSet<string> ();
foreach (ItemConfiguration config in FilterConfigurations (dialog.ConfigurationData.Configurations)) {
if (configs.Add (config.Name))
- configCombo.AppendText (config.Name);
+ AppendComboConfig (config.Name);
}
loading = false;
}
+
+ void AppendComboConfig (string configName)
+ {
+ bool isActive = IdeApp.Workspace.ActiveConfigurationId == configName;
+ AppendComboConfig (configName, isActive);
+ }
+
+ void AppendComboConfig (string configName, bool isActive = false)
+ {
+ string displayName = configName;
+ if (isActive)
+ displayName = configName + " " + GettextCatalog.GetString ("(Active)");
+
+ configListStore.AppendValues (displayName, configName);
+ }
protected virtual bool ConfigurationsAreEqual (IEnumerable<ItemConfiguration> configs)
{
@@ -183,7 +210,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
string configName = null;
if (!allowMixedConfigurations || configCombo.Active > 0)
- configName = configCombo.ActiveText;
+ configName = GetSelectedComboConfig ();
foreach (ItemConfiguration config in FilterConfigurations (dialog.ConfigurationData.Configurations)) {
if ((configName == null || config.Name == configName) && !platforms.Contains (config.Platform)) {
@@ -193,6 +220,15 @@ namespace MonoDevelop.Ide.Gui.Dialogs
}
loading = false;
}
+
+ string GetSelectedComboConfig ()
+ {
+ Gtk.TreeIter iter;
+ if (configCombo.GetActiveIter (out iter)) {
+ return (string)configCombo.Model.GetValue (iter, configListStoreConfigNameColumn);
+ }
+ return null;
+ }
void OnConfigChanged (object s, EventArgs a)
{
@@ -229,7 +265,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
currentConfigs.Clear ();
- string configName = dialog.CurrentConfig = configCombo.ActiveText;
+ string configName = dialog.CurrentConfig = GetSelectedComboConfig ();
if (configName == GettextCatalog.GetString ("All Configurations"))
configName = null;
@@ -290,7 +326,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
Gtk.TreeIter it;
if (configCombo.Model.GetIterFirst (out it)) {
do {
- if (config == (string) configCombo.Model.GetValue (it, 0)) {
+ if (config == (string) configCombo.Model.GetValue (it, configListStoreConfigNameColumn)) {
configCombo.SetActiveIter (it);
break;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiMessageDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiMessageDialog.cs
index edda654d3d..fc762a8b11 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiMessageDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiMessageDialog.cs
@@ -27,13 +27,14 @@
using System;
using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
namespace MonoDevelop.Ide.Gui.Dialogs
{
public partial class MultiMessageDialog : Gtk.Dialog
{
- Image lastImage;
+ ImageView lastImage;
public MultiMessageDialog()
{
@@ -56,13 +57,13 @@ namespace MonoDevelop.Ide.Gui.Dialogs
HSeparator sep = new HSeparator ();
sep.Show ();
msgBox.PackStart (sep, false, false, 0);
- lastImage.IconSize = (int) Gtk.IconSize.Menu;
+ lastImage.IconSize = Gtk.IconSize.Menu;
}
HBox box = new HBox ();
box.Spacing = 12;
Alignment imgBox = new Alignment (0, 0, 0, 0);
- Image img = new Image (icon, lastImage != null ? Gtk.IconSize.Menu : IconSize.Dialog);
+ var img = new ImageView (icon, lastImage != null ? Gtk.IconSize.Menu : IconSize.Dialog);
imgBox.Add (img);
lastImage = img;
box.PackStart (imgBox, false, false, 0);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiTaskProgressDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiTaskProgressDialog.cs
index 8151852824..f4669fe02d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiTaskProgressDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/MultiTaskProgressDialog.cs
@@ -29,6 +29,7 @@ using System;
using System.Collections.Generic;
using Gtk;
using MonoDevelop.Core;
+using System.Threading;
namespace MonoDevelop.Ide.Gui.Dialogs
{
@@ -46,7 +47,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
int ident = 0;
List<TextTag> tags = new List<TextTag> ();
Stack<string> indents = new Stack<string> ();
- IAsyncOperation asyncOperation;
+ CancellationTokenSource asyncOperation;
CellRendererText textRenderer;
CellRendererProgress progressRenderer;
@@ -58,7 +59,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
public MultiTaskProgressDialog (bool allowCancel, bool showDetails, IDictionary<string, string> taskLabelAliases)
{
- DispatchService.AssertGuiThread ();
+ Runtime.AssertMainThread ();
this.Build();
this.allowCancel = allowCancel;
@@ -99,7 +100,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
Resize (w, 1);
}
- public IAsyncOperation AsyncOperation {
+ public CancellationTokenSource CancellationTokenSource {
get { return asyncOperation; }
set { asyncOperation = value; }
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs
index 5f77d5ad4d..3f05a3965c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsDialog.cs
@@ -37,11 +37,10 @@ using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui.Dialogs
{
- public partial class OptionsDialog : Gtk.Dialog
+ public partial class OptionsDialog : IdeDialog
{
Gtk.HBox mainHBox;
Gtk.TreeView tree;
- Xwt.ImageView image;
Gtk.Label labelTitle;
Gtk.HBox pageFrame;
Gtk.Button buttonCancel;
@@ -82,10 +81,10 @@ namespace MonoDevelop.Ide.Gui.Dialogs
{
}
- public OptionsDialog (Gtk.Window parentWindow, object dataObject, string extensionPath) : this (parentWindow, dataObject, extensionPath, true)
+ public OptionsDialog (MonoDevelop.Components.Window parentWindow, object dataObject, string extensionPath) : this (parentWindow, dataObject, extensionPath, true)
{}
- public OptionsDialog (Gtk.Window parentWindow, object dataObject, string extensionPath, bool removeEmptySections)
+ public OptionsDialog (MonoDevelop.Components.Window parentWindow, object dataObject, string extensionPath, bool removeEmptySections)
{
buttonCancel = new Gtk.Button (Gtk.Stock.Cancel);
AddActionWidget (this.buttonCancel, ResponseType.Cancel);
@@ -116,8 +115,6 @@ namespace MonoDevelop.Ide.Gui.Dialogs
var vbox = new VBox ();
mainHBox.PackStart (vbox, true, true, 0);
var headerBox = new HBox (false, 6);
- image = new Xwt.ImageView ();
- // headerBox.PackStart (image, false, false, 0);
labelTitle = new Label ();
labelTitle.Xalign = 0;
@@ -140,6 +137,13 @@ namespace MonoDevelop.Ide.Gui.Dialogs
c.Light += 0.09;
fboxHeader.BackgroundColor = c.ToGdkColor ();
};
+ StyleSet += delegate {
+ if (IsRealized) {
+ var c = Style.Background (Gtk.StateType.Normal).ToXwtColor ();
+ c.Light += 0.09;
+ fboxHeader.BackgroundColor = c.ToGdkColor ();
+ }
+ };
vbox.PackStart (fboxHeader, false, false, 0);
pageFrame = new HBox ();
@@ -190,12 +194,16 @@ namespace MonoDevelop.Ide.Gui.Dialogs
FillTree ();
ExpandCategories ();
+ RestoreLastPanel ();
this.DefaultResponse = Gtk.ResponseType.Ok;
+ buttonOk.CanDefault = true;
+ buttonOk.GrabDefault ();
+
DefaultWidth = 960;
DefaultHeight = 680;
}
-
+
void PixbufCellDataFunc (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
{
TreeIter parent;
@@ -241,7 +249,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
}
}
- protected Gtk.Widget MainBox {
+ protected Control MainBox {
get { return pageFrame; }
}
@@ -275,10 +283,20 @@ namespace MonoDevelop.Ide.Gui.Dialogs
foreach (PanelInstance pi in panels.Values) {
if (pi.Widget != null)
pi.Widget.Destroy ();
+ else {
+ var widget = pi.Panel as Gtk.Widget;
+ if (widget != null) {
+ //TODO: Panels shouldn't inherit/implement view directly
+ //Mostly because it will constrcut some UI(in constrcutor calling this.Build())
+ //on Preferences opening that should be defereded until CreatePanelWidget call
+ widget.Destroy ();
+ }
+ }
IDisposable disp = pi.Panel as IDisposable;
if (disp != null)
disp.Dispose ();
}
+ store.Dispose ();
base.OnDestroyed ();
}
@@ -315,7 +333,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
}
}
- public void AddChildSection (IOptionsPanel parent, OptionsDialogSection section, object dataObject)
+ internal void AddChildSection (IOptionsPanel parent, OptionsDialogSection section, object dataObject)
{
foreach (SectionPage page in pages.Values) {
foreach (PanelInstance pi in page.Panels) {
@@ -328,7 +346,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
throw new InvalidOperationException ("Parent options panel not found in the dialog.");
}
- public void RemoveSection (OptionsDialogSection section)
+ internal void RemoveSection (OptionsDialogSection section)
{
SectionPage page;
if (pages.TryGetValue (section, out page))
@@ -371,12 +389,12 @@ namespace MonoDevelop.Ide.Gui.Dialogs
store.Remove (ref it);
}
- protected TreeIter AddSection (OptionsDialogSection section, object dataObject)
+ internal TreeIter AddSection (OptionsDialogSection section, object dataObject)
{
return AddSection (TreeIter.Zero, section, dataObject);
}
- protected TreeIter AddSection (TreeIter parentIter, OptionsDialogSection section, object dataObject)
+ internal TreeIter AddSection (TreeIter parentIter, OptionsDialogSection section, object dataObject)
{
TreeIter it;
if (parentIter.Equals (TreeIter.Zero)) {
@@ -398,7 +416,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
return it;
}
- protected virtual void AddChildSections (TreeIter parentIter, OptionsDialogSection section, object dataObject)
+ internal virtual void AddChildSections (TreeIter parentIter, OptionsDialogSection section, object dataObject)
{
foreach (ExtensionNode nod in section.ChildNodes) {
if (nod is OptionsDialogSection)
@@ -459,6 +477,8 @@ namespace MonoDevelop.Ide.Gui.Dialogs
if (tree.Selection.GetSelected (out it)) {
OptionsDialogSection section = (OptionsDialogSection) store.GetValue (it, 0);
ShowPage (section);
+
+ this.UseNativeContextMenus ();
}
}
@@ -478,7 +498,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
return false;
}
- public void ShowPage (OptionsDialogSection section)
+ internal void ShowPage (OptionsDialogSection section)
{
if (!IsRealized) {
// Defer this until the dialog is realized due to the sizing logic in CreatePageWidget.
@@ -526,20 +546,6 @@ namespace MonoDevelop.Ide.Gui.Dialogs
imageHeader.Show ();
textHeader.Hide ();
}
-
- //HACK: mimetype panels can't provide stock ID for mimetype images. Give this some awareness of mimetypes.
- var mimeSection = section as MonoDevelop.Ide.Projects.OptionPanels.MimetypeOptionsDialogSection;
- if (mimeSection != null && !string.IsNullOrEmpty (mimeSection.MimeType)) {
- var pix = DesktopService.GetIconForType (mimeSection.MimeType, headerIconSize);
- if (pix != null) {
- image.Image = pix;
- } else {
- image.Image = ImageService.GetIcon (emptyCategoryIcon, headerIconSize);
- }
- } else {
- string icon = section.Icon.IsNull? emptyCategoryIcon : section.Icon.ToString ();
- image.Image = ImageService.GetIcon (icon, headerIconSize);
- }
/* var algn = new HeaderBox ();
algn.SetPadding (12, 12, 12, 12);
@@ -584,7 +590,17 @@ namespace MonoDevelop.Ide.Gui.Dialogs
nodes.Add (node);
}
}
-
+
+ foreach (OptionsPanelNode node in nodes.ToArray ()) {
+ if (!string.IsNullOrEmpty (node.Replaces)) {
+ var replaced = nodes.FindIndex (n => n.Id == node.Replaces);
+ if (replaced != -1) {
+ nodes.Remove (node);
+ nodes [replaced] = node;
+ }
+ }
+ }
+
foreach (OptionsPanelNode node in nodes)
{
PanelInstance pi = null;
@@ -737,13 +753,38 @@ namespace MonoDevelop.Ide.Gui.Dialogs
// Now save
ApplyChanges ();
-
+
+ StoreLastPanel ();
+
if (DataObject != null)
modifiedObjects.Add (DataObject);
this.Respond (ResponseType.Ok);
}
-
+
+ #region Restore
+
+ void RestoreLastPanel ()
+ {
+ string id = PropertyService.Get<string> (extensionPath + "-lastPanel");
+ if (string.IsNullOrEmpty (id)) {
+ return;
+ }
+
+ SelectPanel (id);
+ }
+
+ void StoreLastPanel ()
+ {
+ TreeIter it;
+ if (tree.Selection.GetSelected (out it)) {
+ OptionsDialogSection section = (OptionsDialogSection)store.GetValue (it, 0);
+ PropertyService.Set (extensionPath + "-lastPanel", section.Id);
+ }
+ }
+
+ #endregion
+
class PanelInstance
{
public IOptionsPanel Panel;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsPanel.cs
index 629f8e80b3..231af21a07 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OptionsPanel.cs
@@ -26,7 +26,7 @@
//
using System;
-using Gtk;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui.Dialogs
{
@@ -41,7 +41,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
this.dataObject = dataObject;
}
- public abstract Widget CreatePanelWidget ();
+ public abstract Control CreatePanelWidget ();
public virtual bool IsVisible ()
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/PolicyOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/PolicyOptionsPanel.cs
index c0f9a85b3a..d1034545fe 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/PolicyOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/PolicyOptionsPanel.cs
@@ -31,11 +31,12 @@ using System.Collections.Generic;
using Gtk;
using System.Linq;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
using MonoDevelop.Projects.Policies;
-
+
namespace MonoDevelop.Ide.Gui.Dialogs
{
public abstract class PolicyOptionsPanel<T> : ItemOptionsPanel, IOptionsPanel where T : class, IEquatable<T>, new ()
@@ -56,7 +57,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
{
}
- Widget IOptionsPanel.CreatePanelWidget ()
+ Control IOptionsPanel.CreatePanelWidget ()
{
HBox hbox = new HBox (false, 6);
Label label = new Label ();
@@ -86,7 +87,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
warningMessage = new HBox ();
warningMessage.Spacing = 6;
- Image img = new Image (Stock.Warning, IconSize.LargeToolbar);
+ var img = new ImageView (Stock.Warning, IconSize.LargeToolbar);
warningMessage.PackStart (img, false, false, 0);
Label wl = new Label (GettextCatalog.GetString ("Changes done in this section will only be applied to new projects. " +
"Settings for existing projects can be modified in the project (or solution) options dialog."));
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs
index 0d39dfe617..58586584fe 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/ProgressDialog.cs
@@ -25,9 +25,11 @@
// THE SOFTWARE.
using System;
-using Gtk;
using System.Collections.Generic;
+using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
+using System.Threading;
namespace MonoDevelop.Ide.Gui.Dialogs
{
@@ -40,15 +42,15 @@ namespace MonoDevelop.Ide.Gui.Dialogs
int ident = 0;
List<TextTag> tags = new List<TextTag> ();
Stack<string> indents = new Stack<string> ();
- IAsyncOperation asyncOperation;
- public event EventHandler OperationCancelled;
-
+ CancellationTokenSource cancellationTokenSource;
+
public ProgressDialog (bool allowCancel, bool showDetails): this (null, allowCancel, showDetails)
{
}
- public ProgressDialog (Window parent, bool allowCancel, bool showDetails)
+ public ProgressDialog (MonoDevelop.Components.Window parent, bool allowCancel, bool showDetails)
{
+ MonoDevelop.Components.IdeTheme.ApplyTheme (this);
this.Build ();
this.Title = BrandingService.ApplicationName;
HasSeparator = false;
@@ -74,9 +76,9 @@ namespace MonoDevelop.Ide.Gui.Dialogs
tags.Add (tag);
}
- public IAsyncOperation AsyncOperation {
- get { return asyncOperation; }
- set { asyncOperation = value; }
+ public CancellationTokenSource CancellationTokenSource {
+ get { return cancellationTokenSource; }
+ set { cancellationTokenSource = value; }
}
public string Message {
@@ -168,11 +170,8 @@ namespace MonoDevelop.Ide.Gui.Dialogs
protected void OnBtnCancelClicked (object sender, EventArgs e)
{
- if (asyncOperation != null)
- asyncOperation.Cancel ();
-
- if (OperationCancelled != null)
- OperationCancelled (this, null);
+ if (cancellationTokenSource != null)
+ cancellationTokenSource.Cancel ();
}
bool UpdateSize ()
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SelectFileFormatDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SelectFileFormatDialog.cs
index 2524a84a93..aa2cffd702 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SelectFileFormatDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SelectFileFormatDialog.cs
@@ -28,14 +28,15 @@ using System;
using System.Collections.Generic;
using MonoDevelop.Projects;
using MonoDevelop.Core;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.Ide.Gui.Dialogs
{
- public partial class SelectFileFormatDialog : Gtk.Dialog
+ partial class SelectFileFormatDialog : Gtk.Dialog
{
- List<FileFormat> formats = new List<FileFormat> ();
+ List<MSBuildFileFormat> formats = new List<MSBuildFileFormat> ();
- public SelectFileFormatDialog (IWorkspaceFileObject item)
+ public SelectFileFormatDialog (IMSBuildFileObject item)
{
this.Build ();
string warning = "";
@@ -48,14 +49,14 @@ namespace MonoDevelop.Ide.Gui.Dialogs
labelMessage.Text = string.Format (labelMessage.Text, item.Name);
labelCurrentFormat.Text = item.FileFormat.Name;
- foreach (FileFormat format in Services.ProjectService.FileFormats.GetFileFormatsForObject (item)) {
+ foreach (MSBuildFileFormat format in MSBuildFileFormat.GetSupportedFormats (item)) {
comboNewFormat.AppendText (format.Name);
formats.Add (format);
}
comboNewFormat.Active = 0;
}
- public FileFormat Format {
+ public MSBuildFileFormat Format {
get {
if (comboNewFormat.Active == -1)
return null;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs
index 6c08dcd57c..93d162f65f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/SetupApp.cs
@@ -31,16 +31,17 @@ using Mono.Addins;
using Mono.Addins.Setup;
using Mono.Addins.Gui;
using MonoDevelop.Core;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Gui.Dialogs
{
class SetupApp: IApplication
{
- public int Run (string[] arguments)
+ public Task<int> Run (string[] arguments)
{
Gtk.Application.Init ();
AddinManagerWindow.Run (null);
- return 0;
+ return Task.FromResult (0);
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/TipOfTheDay.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/TipOfTheDay.cs
index 739f2f2394..0df342e63d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/TipOfTheDay.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/TipOfTheDay.cs
@@ -5,12 +5,12 @@ using System.Xml;
using MonoDevelop.Core;
using System.Collections.Generic;
using MonoDevelop.Components.Commands;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui.Dialogs
{
- internal partial class TipOfTheDayWindow : Gtk.Window
+ internal partial class TipOfTheDayWindow : IdeWindow
{
- internal const string ShowTipsAtStartup = "MonoDevelop.Core.Gui.Dialog.TipOfTheDayView.ShowTipsAtStartup";
List<string> tips = new List<string> ();
int currentTip;
@@ -20,9 +20,8 @@ namespace MonoDevelop.Ide.Gui.Dialogs
Build ();
TransientFor = IdeApp.Workbench.RootWindow;
- if (PropertyService.Get (ShowTipsAtStartup, false)) {
+ if (IdeApp.Preferences.ShowTipsAtStartup)
noshowCheckbutton.Active = true;
- }
XmlDocument xmlDocument = new XmlDocument ();
xmlDocument.Load (System.IO.Path.Combine (System.IO.Path.Combine (PropertyService.DataPath, "options"), "TipsOfTheDay.xml"));
@@ -49,7 +48,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
void OnNoShow (object o, EventArgs e)
{
- PropertyService.Set (ShowTipsAtStartup, noshowCheckbutton.Active);
+ IdeApp.Preferences.ShowTipsAtStartup.Value = noshowCheckbutton.Active;
}
void OnNextClicked (object o, EventArgs e)
@@ -75,7 +74,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
class TipOfTheDayStartup : CommandHandler {
protected override void Run ()
{
- if (PropertyService.Get (TipOfTheDayWindow.ShowTipsAtStartup, false)) {
+ if (IdeApp.Preferences.ShowTipsAtStartup) {
new TipOfTheDayWindow ().Show ();
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AddInsOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AddInsOptionsPanel.cs
index c9c80eed25..391e56cc8e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AddInsOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AddInsOptionsPanel.cs
@@ -35,7 +35,6 @@ using MonoDevelop.Core;
using Mono.Addins;
using MonoDevelop.Projects;
-using Gtk;
using MonoDevelop.Components;
using MonoDevelop.Core.Setup;
using MonoDevelop.Ide.Updater;
@@ -51,7 +50,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
return !AddinManager.IsAddinLoaded ("MonoDevelop.Xamarin.Ide");
}
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new AddInsPanelWidget ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AssemblyFoldersPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AssemblyFoldersPanel.cs
index 33344a8e0f..3fb3386763 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AssemblyFoldersPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AssemblyFoldersPanel.cs
@@ -26,7 +26,7 @@
using System;
using System.Collections.Generic;
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
@@ -36,7 +36,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
AssemblyFoldersPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new AssemblyFoldersPanelWidget ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AuthorInformationPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AuthorInformationPanel.cs
index 5be3812412..5794110212 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AuthorInformationPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/AuthorInformationPanel.cs
@@ -27,6 +27,7 @@
//
using System;
+using MonoDevelop.Components;
using MonoDevelop.Projects;
using MonoDevelop.Ide.Projects;
using MonoDevelop.Ide.Gui.Dialogs;
@@ -37,8 +38,8 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
AuthorInformationPanelWidget widget;
Solution solution;
-
- public override Gtk.Widget CreatePanelWidget ()
+
+ public override Control CreatePanelWidget ()
{
return widget = new AuthorInformationPanelWidget (solution.LocalAuthorInformation);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildMessagePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildMessagePanel.cs
index 18d7b93c0d..c833527b69 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildMessagePanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildMessagePanel.cs
@@ -25,9 +25,9 @@
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
-using Gtk;
namespace MonoDevelop.Ide.Gui.OptionPanels
{
@@ -36,7 +36,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
BuildMessagePanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new BuildMessagePanelWidget ();
}
@@ -57,7 +57,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
//comboboxJumpToFirst.AppendText (GettextCatalog.GetString ("Never"));
comboboxJumpToFirst.AppendText (GettextCatalog.GetString ("Error"));
comboboxJumpToFirst.AppendText (GettextCatalog.GetString ("Error or Warning"));
- comboboxJumpToFirst.Active = (int)IdeApp.Preferences.JumpToFirstErrorOrWarning;
+ comboboxJumpToFirst.Active = (int)IdeApp.Preferences.JumpToFirstErrorOrWarning.Value;
/* //comboboxBuildResultsDuring.AppendText (GettextCatalog.GetString ("Never"));
comboboxBuildResultsDuring.AppendText (GettextCatalog.GetString ("Always"));
@@ -76,23 +76,23 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
comboboxErrorPadAfter.AppendText (GettextCatalog.GetString ("Always"));
comboboxErrorPadAfter.AppendText (GettextCatalog.GetString ("On Errors"));
comboboxErrorPadAfter.AppendText (GettextCatalog.GetString ("On Errors or Warnings"));
- comboboxErrorPadAfter.Active = (int)IdeApp.Preferences.ShowErrorPadAfterBuild;
+ comboboxErrorPadAfter.Active = (int)IdeApp.Preferences.ShowErrorPadAfterBuild.Value;
//comboboxMessageBubbles.AppendText (GettextCatalog.GetString ("Never"));
comboboxMessageBubbles.AppendText (GettextCatalog.GetString ("For Errors"));
comboboxMessageBubbles.AppendText (GettextCatalog.GetString ("For Errors and Warnings"));
- comboboxMessageBubbles.Active = (int)IdeApp.Preferences.ShowMessageBubbles;
+ comboboxMessageBubbles.Active = (int)IdeApp.Preferences.ShowMessageBubbles.Value;
this.QueueResize ();
}
public void Store ()
{
- IdeApp.Preferences.JumpToFirstErrorOrWarning = (JumpToFirst)comboboxJumpToFirst.Active;
+ IdeApp.Preferences.JumpToFirstErrorOrWarning.Value = (JumpToFirst)comboboxJumpToFirst.Active;
// IdeApp.Preferences.ShowErrorPadDuringBuild = (BuildResultStates)comboboxErrorPadDuring.Active;
// IdeApp.Preferences.ShowOutputPadDuringBuild = (BuildResultStates)comboboxBuildResultsDuring.Active;
- IdeApp.Preferences.ShowErrorPadAfterBuild = (BuildResultStates)comboboxErrorPadAfter.Active;
- IdeApp.Preferences.ShowMessageBubbles = (ShowMessageBubbles)comboboxMessageBubbles.Active;
+ IdeApp.Preferences.ShowErrorPadAfterBuild.Value = (BuildResultStates)comboboxErrorPadAfter.Active;
+ IdeApp.Preferences.ShowMessageBubbles.Value = (ShowMessageBubbles)comboboxMessageBubbles.Active;
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs
index 2e97cf41a6..0e68a80066 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/BuildPanel.cs
@@ -27,9 +27,9 @@
using System;
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
-using MonoDevelop.Projects.Formats.MSBuild;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.Ide.Gui.OptionPanels
{
@@ -37,7 +37,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
BuildPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return (widget = new BuildPanelWidget ());
}
@@ -59,22 +59,24 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
noSaveRadioButton.Active = action == BeforeCompileAction.Nothing;
runWithWarningsCheckBox.Active = IdeApp.Preferences.RunWithWarnings;
buildBeforeRunCheckBox.Active = IdeApp.Preferences.BuildBeforeExecuting;
- verbosityCombo.Active = (int)IdeApp.Preferences.MSBuildVerbosity;
+ verbosityCombo.Active = (int)IdeApp.Preferences.MSBuildVerbosity.Value;
buildBeforeTestCheckBox.Active = IdeApp.Preferences.BuildBeforeRunningTests;
+ parallelBuildCheckbox.Active = MonoDevelop.Core.Runtime.Preferences.ParallelBuild.Value;
}
public void Store ()
{
- IdeApp.Preferences.RunWithWarnings = runWithWarningsCheckBox.Active;
- IdeApp.Preferences.BuildBeforeExecuting = buildBeforeRunCheckBox.Active;
- IdeApp.Preferences.MSBuildVerbosity = (MSBuildVerbosity) verbosityCombo.Active;
+ IdeApp.Preferences.RunWithWarnings.Value = runWithWarningsCheckBox.Active;
+ IdeApp.Preferences.BuildBeforeExecuting.Value = buildBeforeRunCheckBox.Active;
+ IdeApp.Preferences.MSBuildVerbosity.Value = (MSBuildVerbosity) verbosityCombo.Active;
IdeApp.Preferences.BuildBeforeRunningTests.Value = buildBeforeTestCheckBox.Active;
+ MonoDevelop.Core.Runtime.Preferences.ParallelBuild.Value = parallelBuildCheckbox.Active;
if (saveChangesRadioButton.Active)
- IdeApp.Preferences.BeforeBuildSaveAction = BeforeCompileAction.SaveAllFiles;
+ IdeApp.Preferences.BeforeBuildSaveAction.Value = BeforeCompileAction.SaveAllFiles;
else if (promptChangesRadioButton.Active)
- IdeApp.Preferences.BeforeBuildSaveAction = BeforeCompileAction.PromptForSave;
+ IdeApp.Preferences.BeforeBuildSaveAction.Value = BeforeCompileAction.PromptForSave;
else if (noSaveRadioButton.Active)
- IdeApp.Preferences.BeforeBuildSaveAction = BeforeCompileAction.Nothing;
+ IdeApp.Preferences.BeforeBuildSaveAction.Value = BeforeCompileAction.Nothing;
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/GlobalAuthorInformationPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/GlobalAuthorInformationPanel.cs
index fee15967f5..6f7b9c48e9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/GlobalAuthorInformationPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/GlobalAuthorInformationPanel.cs
@@ -27,6 +27,7 @@
//
using System;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
@@ -36,8 +37,8 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
class GlobalAuthorInformationPanel : OptionsPanel
{
GlobalAuthorInformationPanelWidget widget;
-
- public override Gtk.Widget CreatePanelWidget ()
+
+ public override Control CreatePanelWidget ()
{
return widget = new GlobalAuthorInformationPanelWidget ();
}
@@ -64,11 +65,11 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
public void Save ()
{
- PropertyService.Set ("Author.Name", nameEntry.Text);
- PropertyService.Set ("Author.Email", emailEntry.Text);
- PropertyService.Set ("Author.Copyright", copyrightEntry.Text);
- PropertyService.Set ("Author.Company", companyEntry.Text);
- PropertyService.Set ("Author.Trademark", trademarkEntry.Text);
+ Runtime.Preferences.AuthorName.Value = nameEntry.Text;
+ Runtime.Preferences.AuthorEmail.Value = emailEntry.Text;
+ Runtime.Preferences.AuthorCopyright.Value = copyrightEntry.Text;
+ Runtime.Preferences.AuthorCompany.Value = companyEntry.Text;
+ Runtime.Preferences.AuthorTrademark.Value = trademarkEntry.Text;
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs
index dddc9a3acb..d659f866ec 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/IDEStyleOptionsPanel.cs
@@ -31,11 +31,11 @@ using System;
using System.Collections;
using System.Collections.Generic;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Components.Commands;
using Mono.Addins;
-using Gtk;
using System.Linq;
namespace MonoDevelop.Ide.Gui.OptionPanels
@@ -44,7 +44,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
IDEStyleOptionsPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new IDEStyleOptionsPanelWidget ();
}
@@ -55,8 +55,10 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
}
}
- public partial class IDEStyleOptionsPanelWidget : Gtk.Bin
+ partial class IDEStyleOptionsPanelWidget : Gtk.Bin
{
+ string currentTheme;
+
static Lazy<List<string>> themes = new Lazy<List<string>> (() => {
var searchDirs = new List<string> ();
@@ -70,7 +72,6 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
var themes = FindThemes (searchDirs).ToList ();
- themes.Sort ();
return themes;
});
@@ -86,41 +87,78 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
this.Build();
Load ();
}
-
+
void Load ()
{
- for (int n=1; n < isoCodes.Length; n += 2)
+ currentTheme = IdeApp.Preferences.UserInterfaceTheme;
+
+ for (int n = 1; n < isoCodes.Length; n += 2)
comboLanguage.AppendText (GettextCatalog.GetString (isoCodes [n]));
-
+
int i = Array.IndexOf (isoCodes, IdeApp.Preferences.UserInterfaceLanguage);
if (i == -1) i = 0;
comboLanguage.Active = i / 2;
-
- comboTheme.AppendText (GettextCatalog.GetString ("(Default)"));
+
+ if (Platform.IsLinux)
+ comboTheme.AppendText (GettextCatalog.GetString ("(Default)"));
foreach (string t in InstalledThemes)
comboTheme.AppendText (t);
+
+ var sel = themes.Value.IndexOf (IdeApp.Preferences.UserInterfaceTheme);
+ if (sel == -1)
+ sel = 0;
+ else if (Platform.IsLinux)
+ sel++;
- comboTheme.Active = themes.Value.IndexOf (IdeApp.Preferences.UserInterfaceTheme) + 1;
+ comboTheme.Active = sel;
+ comboTheme.Changed += ComboThemeChanged;
+ }
- labelTheme.Visible = comboTheme.Visible = !Platform.IsMac && !Platform.IsWindows;
+ void ComboThemeChanged (object sender, EventArgs e)
+ {
+ SetTheme ();
}
-
+
+ void SetTheme ()
+ {
+ string theme;
+ if (comboTheme.Active == 0 && Platform.IsLinux)
+ theme = "";
+ else
+ theme = comboTheme.ActiveText;
+ SetTheme (theme);
+ }
+
+ void SetTheme (string theme)
+ {
+ if (theme.Length == 0 && Platform.IsLinux) {
+ currentTheme = "";
+ } else {
+ currentTheme = theme;
+ }
+ }
+
// Code for getting the list of themes based on f-spot
static ICollection<string> FindThemes (IEnumerable<string> themeDirs)
{
var themes = new HashSet<string> ();
- string gtkrc = System.IO.Path.Combine ("gtk-2.0", "gtkrc");
- foreach (string themeDir in themeDirs) {
- if (string.IsNullOrEmpty (themeDir) || !System.IO.Directory.Exists (themeDir))
- continue;
- foreach (FilePath dir in System.IO.Directory.GetDirectories (themeDir)) {
- if (System.IO.File.Exists (dir.Combine (gtkrc))) {
- var themeName = dir.FileName;
- if (!IsBadGtkTheme (themeName))
- themes.Add (themeName);
+ if (Platform.IsLinux) {
+ string gtkrc = System.IO.Path.Combine ("gtk-2.0", "gtkrc");
+ foreach (string themeDir in themeDirs) {
+ if (string.IsNullOrEmpty (themeDir) || !System.IO.Directory.Exists (themeDir))
+ continue;
+ foreach (FilePath dir in System.IO.Directory.GetDirectories (themeDir)) {
+ if (System.IO.File.Exists (dir.Combine (gtkrc))) {
+ var themeName = dir.FileName;
+ if (!IsBadGtkTheme (themeName))
+ themes.Add (themeName);
+ }
}
}
+ } else {
+ themes.Add ("Light");
+ themes.Add ("Dark");
}
return themes;
}
@@ -138,7 +176,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
string lc = isoCodes [comboLanguage.Active * 2];
if (lc != IdeApp.Preferences.UserInterfaceLanguage) {
- IdeApp.Preferences.UserInterfaceLanguage = lc;
+ IdeApp.Preferences.UserInterfaceLanguage.Value = lc;
MessageService.ShowMessage (
GettextCatalog.GetString (
"The user interface language change will take effect the next time you start {0}",
@@ -146,20 +184,18 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
)
);
}
- string theme;
- if (comboTheme.Active == 0) {
- theme = IdeStartup.DefaultTheme;
- IdeApp.Preferences.UserInterfaceTheme = "";
- }
- else {
- theme = comboTheme.ActiveText;
- IdeApp.Preferences.UserInterfaceTheme = theme;
+
+ if (currentTheme != IdeApp.Preferences.UserInterfaceTheme.Value) {
+ IdeApp.Preferences.UserInterfaceTheme.Value = currentTheme;
+ MessageService.ShowMessage (
+ GettextCatalog.GetString (
+ "The user interface theme change will take effect the next time you start {0}",
+ BrandingService.ApplicationName
+ )
+ );
}
-
- if (theme != Gtk.Settings.Default.ThemeName)
- Gtk.Settings.Default.ThemeName = theme;
}
-
+
static string[] isoCodes = new string[] {
"", "(Default)",
"ca", "Catalan",
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs
index f1754c228c..929b749eef 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/KeyBindingsPanel.cs
@@ -217,7 +217,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
KeyBindingService.SaveCurrentBindings ();
}
- public Gtk.Widget CreatePanelWidget ()
+ public Control CreatePanelWidget ()
{
SortedDictionary<string, Command> commands = new SortedDictionary<string, Command> ();
string translatedOther = GettextCatalog.GetString ("Other");
@@ -562,5 +562,12 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
public void Initialize (OptionsDialog dialog, object dataObject)
{
}
+
+ protected override void OnDestroyed ()
+ {
+ keyStore.Dispose ();
+ filterModel.Dispose ();
+ base.OnDestroyed ();
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs
index 49bd123846..2266b7d19b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LoadSavePanel.cs
@@ -36,7 +36,6 @@ using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Projects;
-using Gtk;
using MonoDevelop.Components;
#pragma warning disable 612
@@ -54,7 +53,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
LoadSavePanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new LoadSavePanelWidget ();
}
@@ -77,11 +76,11 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
Build ();
- folderEntry.Path = IdeApp.ProjectOperations.ProjectsDefaultPath;
+ folderEntry.Path = IdeApp.Preferences.ProjectsDefaultPath;
loadUserDataCheckButton.Active = IdeApp.Preferences.LoadDocumentUserProperties;
createBackupCopyCheckButton.Active = IdeApp.Preferences.CreateFileBackupCopies;
- loadPrevProjectCheckButton.Active = IdeApp.Preferences.LoadPrevSolutionOnStartup;
+ loadPrevProjectCheckButton.Active = IdeApp.Preferences.LoadPrevSolutionOnStartup.Value;
}
public bool ValidateChanges ()
@@ -99,10 +98,10 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
public void Store ()
{
- IdeApp.Preferences.LoadPrevSolutionOnStartup = loadPrevProjectCheckButton.Active;
- IdeApp.Preferences.LoadDocumentUserProperties = loadUserDataCheckButton.Active;
- IdeApp.Preferences.CreateFileBackupCopies = createBackupCopyCheckButton.Active;
- IdeApp.ProjectOperations.ProjectsDefaultPath = folderEntry.Path;
+ IdeApp.Preferences.LoadPrevSolutionOnStartup.Value = loadPrevProjectCheckButton.Active;
+ IdeApp.Preferences.LoadDocumentUserProperties.Value = loadUserDataCheckButton.Active;
+ IdeApp.Preferences.CreateFileBackupCopies.Value = createBackupCopyCheckButton.Active;
+ IdeApp.Preferences.ProjectsDefaultPath.Value = folderEntry.Path;
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LogAgentOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LogAgentOptionsPanel.cs
index ba485c2d81..b50e0ea557 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LogAgentOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LogAgentOptionsPanel.cs
@@ -27,6 +27,7 @@
using System;
using Gtk;
using MonoDevelop.Ide.Gui.Dialogs;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Core.LogReporting;
@@ -36,7 +37,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
LogAgentPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new LogAgentPanelWidget ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MaintenanceOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MaintenanceOptionsPanel.cs
index dcf072a13b..39676d4217 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MaintenanceOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MaintenanceOptionsPanel.cs
@@ -25,8 +25,8 @@
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
-using Gtk;
namespace MonoDevelop.Ide.Gui.OptionPanels
{
@@ -34,7 +34,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
MaintenanceOptionsPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new MaintenanceOptionsPanelWidget ();
}
@@ -64,9 +64,9 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
public void ApplyChanges ()
{
if (IdeApp.Preferences.EnableInstrumentation != checkInstr.Active)
- IdeApp.Preferences.EnableInstrumentation = checkInstr.Active;
+ IdeApp.Preferences.EnableInstrumentation.Value = checkInstr.Active;
if (IdeApp.Preferences.EnableAutomatedTesting != checkAutoTest.Active)
- IdeApp.Preferences.EnableAutomatedTesting = checkAutoTest.Active;
+ IdeApp.Preferences.EnableAutomatedTesting.Value = checkAutoTest.Active;
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MonoRuntimePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MonoRuntimePanel.cs
index 0ce5c605d2..fd70f5f9b0 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MonoRuntimePanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/MonoRuntimePanel.cs
@@ -41,7 +41,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
MonoRuntimePanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new MonoRuntimePanelWidget ();
}
@@ -103,12 +103,12 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
object ob = store.GetValue (defaultIter, 1);
MonoRuntimeInfo newDefaultInfo = ob as MonoRuntimeInfo;
if (ob is TargetRuntime)
- IdeApp.Preferences.DefaultTargetRuntime = (TargetRuntime)ob;
+ IdeApp.Preferences.DefaultTargetRuntime.Value = (TargetRuntime)ob;
foreach (var rinfo in newInfos) {
TargetRuntime tr = MonoTargetRuntime.RegisterRuntime (rinfo);
if (rinfo == newDefaultInfo)
- IdeApp.Preferences.DefaultTargetRuntime = tr;
+ IdeApp.Preferences.DefaultTargetRuntime.Value = tr;
}
foreach (var tr in removedRuntimes.OfType<MonoTargetRuntime> ())
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/SdkLocationPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/SdkLocationPanel.cs
index 61f8b7326b..1a4972f73c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/SdkLocationPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/SdkLocationPanel.cs
@@ -39,7 +39,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
SdkLocationWidget w;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return w = new SdkLocationWidget (this);
}
@@ -83,7 +83,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
FolderEntry locationEntry = new FolderEntry ();
Label messageLabel = new Label ();
- Image messageIcon = new Image ();
+ ImageView messageIcon = new ImageView ();
SdkLocationPanel panel;
public SdkLocationWidget (SdkLocationPanel panel) : base (false, 12)
@@ -124,24 +124,24 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
if (!location.IsNullOrEmpty) {
if (panel.ValidateSdkLocation (location)) {
messageLabel.Text = GettextCatalog.GetString ("SDK found at specified location.");
- messageIcon.Stock = Gtk.Stock.Apply;
+ messageIcon.SetIcon (Gtk.Stock.Apply, IconSize.Menu);
return;
}
messageLabel.Text = GettextCatalog.GetString ("No SDK found at specified location.");
- messageIcon.Stock = Gtk.Stock.Cancel;
+ messageIcon.SetIcon (Gtk.Stock.Cancel, IconSize.Menu);
return;
}
foreach (var loc in panel.DefaultSdkLocations) {
if (panel.ValidateSdkLocation (loc)) {
messageLabel.Text = GettextCatalog.GetString ("SDK found at default location.");
- messageIcon.Stock = Gtk.Stock.Apply;
+ messageIcon.SetIcon (Gtk.Stock.Apply, IconSize.Menu);
return;
}
}
messageLabel.Text = GettextCatalog.GetString ("No SDK found at default location.");
- messageIcon.Stock = Gtk.Stock.Cancel;
+ messageIcon.SetIcon (Gtk.Stock.Cancel, IconSize.Menu);
}
FilePath CleanPath (FilePath path)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs
index 4365f85e0a..1f4862e455 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TasksOptionsPanel.cs
@@ -66,6 +66,8 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
buttonChange.Clicked += new EventHandler (ChangeToken);
buttonRemove.Clicked += new EventHandler (RemoveToken);
entryToken.Changed += new EventHandler (Validate);
+
+ Styles.Changed += HandleUserInterfaceSkinChanged;
}
void Validate (object sender, EventArgs args)
@@ -120,7 +122,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
void OnTokenSelectionChanged (object sender, EventArgs args)
{
TreeSelection selection = sender as TreeSelection;
- if (sender != null)
+ if (selection != null)
{
TreeIter iter;
TreeModel model = (TreeModel)tokensStore;
@@ -167,10 +169,20 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
foreach (var ctag in CommentTag.SpecialCommentTags)
tokensStore.AppendValues (ctag.Tag, ctag.Priority);
-
- colorbuttonHighPrio.Color = StringToColor ((string)PropertyService.Get ("Monodevelop.UserTasksHighPrioColor", ""));
- colorbuttonNormalPrio.Color = StringToColor ((string)PropertyService.Get ("Monodevelop.UserTasksNormalPrioColor", ""));
- colorbuttonLowPrio.Color = StringToColor ((string)PropertyService.Get ("Monodevelop.UserTasksLowPrioColor", ""));
+
+ LoadColors ();
+ }
+
+ void HandleUserInterfaceSkinChanged (object sender, EventArgs e)
+ {
+ LoadColors ();
+ }
+
+ public void LoadColors ()
+ {
+ colorbuttonHighPrio.Color = StringToColor (IdeApp.Preferences.UserTasksHighPrioColor);
+ colorbuttonNormalPrio.Color = StringToColor (IdeApp.Preferences.UserTasksNormalPrioColor);
+ colorbuttonLowPrio.Color = StringToColor (IdeApp.Preferences.UserTasksLowPrioColor);
}
public void Store ()
@@ -181,9 +193,9 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
CommentTag.SpecialCommentTags = tags;
- PropertyService.Set ("Monodevelop.UserTasksHighPrioColor", ColorToString (colorbuttonHighPrio.Color));
- PropertyService.Set ("Monodevelop.UserTasksNormalPrioColor", ColorToString (colorbuttonNormalPrio.Color));
- PropertyService.Set ("Monodevelop.UserTasksLowPrioColor", ColorToString (colorbuttonLowPrio.Color));
+ IdeApp.Preferences.UserTasksHighPrioColor.Value = ColorToString (colorbuttonHighPrio.Color);
+ IdeApp.Preferences.UserTasksNormalPrioColor.Value = ColorToString (colorbuttonNormalPrio.Color);
+ IdeApp.Preferences.UserTasksLowPrioColor.Value = ColorToString (colorbuttonLowPrio.Color);
}
static string ColorToString (Gdk.Color color)
@@ -209,13 +221,19 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
}
return color;
}
+
+ public override void Destroy ()
+ {
+ Styles.Changed -= HandleUserInterfaceSkinChanged;
+ base.Destroy ();
+ }
}
internal class TasksOptionsPanel : OptionsPanel
{
TasksPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
widget = new TasksPanelWidget ();
widget.Load ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TextStylePolicyPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TextStylePolicyPanel.cs
index 4135b233d5..d6bd13b7d2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TextStylePolicyPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/TextStylePolicyPanel.cs
@@ -25,6 +25,7 @@
//THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Projects.Policies;
using MonoDevelop.Ide.Projects;
@@ -38,7 +39,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
{
TextStylePolicyPanelWidget widget;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
widget = new TextStylePolicyPanelWidget (this);
widget.Show ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPad.cs
index cce9569a07..6c49cf3f8a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPad.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPad.cs
@@ -32,6 +32,7 @@ using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Projects;
using MonoDevelop.Ide.Gui.Components;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui.Pads.ClassBrowser
{
@@ -39,13 +40,13 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassBrowser
{
ClassBrowserPadWidget widget;
- public override Gtk.Widget Control {
+ public override Control Control {
get {
return widget;
}
}
- public override void Initialize (IPadWindow container)
+ protected override void Initialize (IPadWindow container)
{
base.Initialize (container);
this.widget = new ClassBrowserPadWidget (base.TreeView, container);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPadWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPadWidget.cs
index 770ad15d87..aa98707fe3 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPadWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassBrowserPadWidget.cs
@@ -60,6 +60,14 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassBrowser
this.ShowAll ();
}
+ protected override void OnDestroyed ()
+ {
+ base.OnDestroyed ();
+
+ IdeApp.Workspace.WorkspaceItemOpened -= OnOpenCombine;
+ IdeApp.Workspace.WorkspaceItemClosed -= OnCloseCombine;
+ }
+
void OnOpenCombine (object sender, WorkspaceItemEventArgs e)
{
treeView.LoadTree (e.Item);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassData.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassData.cs
index 5f931f15c0..a2afb95d74 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassData.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassData.cs
@@ -32,52 +32,54 @@ using System.Collections;
using MonoDevelop.Projects;
using MonoDevelop.Core;
-using ICSharpCode.NRefactory.TypeSystem;
+using Microsoft.CodeAnalysis;
+using Project = MonoDevelop.Projects.Project;
+using MonoDevelop.Ide.TypeSystem;
namespace MonoDevelop.Ide.Gui.Pads.ClassPad
{
public class ClassData
{
- ITypeDefinition cls;
+ ITypeSymbol cls;
Project project;
-
- public ClassData (Project p, ITypeDefinition c)
+
+ public ClassData (Project p, ITypeSymbol c)
{
cls = c;
project = p;
}
-
- public ITypeDefinition Class {
+
+ public ITypeSymbol Class {
get { return cls; }
}
-
+
public Project Project {
get { return project; }
}
-
+
internal void UpdateFrom (ClassData cd)
{
cls = cd.cls;
project = cd.project;
}
-
+
public override bool Equals (object ob)
{
ClassData other = ob as ClassData;
- return (other != null && cls.FullName == other.cls.FullName &&
+ return (other != null && cls.GetFullName () == other.cls.GetFullName () &&
project == other.project);
}
-
+
public override int GetHashCode ()
{
if (project == null)
- return cls.FullName.GetHashCode ();
- return (cls.FullName + project.Name).GetHashCode ();
+ return cls.GetFullName ().GetHashCode ();
+ return (cls.GetFullName () + project.Name).GetHashCode ();
}
-
+
public override string ToString ()
{
- return base.ToString () + " [" + cls.FullName + ", " + (project != null ? project.Name : "null")+ "]";
+ return base.ToString () + " [" + cls.GetFullName () + ", " + (project != null ? project.Name : "null") + "]";
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassNodeBuilder.cs
index 033a61ac81..fba7a52efa 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ClassNodeBuilder.cs
@@ -34,20 +34,20 @@ using MonoDevelop.Projects;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Components;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
using System.Linq;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.Ide.Gui.Pads.ClassPad
{
- public class ClassNodeBuilder: TypeNodeBuilder
+ public class ClassNodeBuilder : TypeNodeBuilder
{
public override Type NodeDataType {
- get { return typeof(ClassData); }
+ get { return typeof (ClassData); }
}
-
+
public override Type CommandHandlerType {
- get { return typeof(ClassNodeCommandHandler); }
+ get { return typeof (ClassNodeCommandHandler); }
}
public override string ContextMenuAddinPath {
@@ -56,33 +56,32 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
{
- return ((ClassData)dataObject).Class.FullName;
+ return ((ClassData)dataObject).Class.GetFullName ();
}
+
+ //Same as MonoDevelop.Ide.TypeSystem.Ambience.NameFormat except SymbolDisplayTypeQualificationStyle is NameOnly
+ static readonly SymbolDisplayFormat NameFormat =
+ new SymbolDisplayFormat(
+ globalNamespaceStyle: SymbolDisplayGlobalNamespaceStyle.Omitted,
+ typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameOnly,
+ propertyStyle: SymbolDisplayPropertyStyle.NameOnly,
+ genericsOptions: SymbolDisplayGenericsOptions.IncludeTypeParameters | SymbolDisplayGenericsOptions.IncludeVariance,
+ memberOptions: SymbolDisplayMemberOptions.IncludeParameters | SymbolDisplayMemberOptions.IncludeExplicitInterface,
+ parameterOptions:
+ SymbolDisplayParameterOptions.IncludeParamsRefOut |
+ SymbolDisplayParameterOptions.IncludeExtensionThis |
+ SymbolDisplayParameterOptions.IncludeType |
+ SymbolDisplayParameterOptions.IncludeName,
+ miscellaneousOptions:
+ SymbolDisplayMiscellaneousOptions.EscapeKeywordIdentifiers |
+ SymbolDisplayMiscellaneousOptions.UseSpecialTypes);
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
{
ClassData classData = dataObject as ClassData;
- nodeInfo.Label = AmbienceService.DefaultAmbience.GetString (classData.Class.GetDefinition (), OutputFlags.ClassBrowserEntries | OutputFlags.IncludeMarkup);
+ nodeInfo.Label = Ambience.EscapeText (classData.Class.ToDisplayString (NameFormat));
nodeInfo.Icon = Context.GetIcon (classData.Class.GetStockIcon ());
}
- /*
- private string GetNameWithGenericParameters (IType c)
- {
- if (c.TypeParameters != null && c.TypeParameters.Count > 0)
- {
- StringBuilder builder = new StringBuilder (c.Name);
- builder.Append("&lt;");
- for (int i = 0; i < c.TypeParameters.Count; i++)
- {
- builder.Append(c.TypeParameters[i].Name);
- if (i + 1 < c.TypeParameters.Count) builder.Append(", ");
- }
- builder.Append("&gt;");
- return builder.ToString();
- }
- else
- return c.Name;
- }*/
public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
{
@@ -90,31 +89,36 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
bool publicOnly = builder.Options ["PublicApiOnly"];
bool publicProtectedOnly = builder.Options ["PublicProtectedApiOnly"];
publicOnly |= publicProtectedOnly;
-
+
// Delegates have an Invoke method, which doesn't need to be shown.
- if (classData.Class.Kind == TypeKind.Delegate)
+ if (classData.Class.TypeKind == TypeKind.Delegate)
return;
- foreach (var innerClass in classData.Class.NestedTypes.Where (m => !m.IsSynthetic))
- if (innerClass.IsPublic || (innerClass.IsProtected && publicProtectedOnly) || !publicOnly)
- builder.AddChild (new ClassData (classData.Project, innerClass));
-
- foreach (var method in classData.Class.Methods.Where (m => !m.IsSynthetic)) {
- if (method.IsPublic || (method.IsProtected && publicProtectedOnly) || !publicOnly)
- builder.AddChild (method);
- }
-
- foreach (var property in classData.Class.Properties.Where (m => !m.IsSynthetic))
- if (property.IsPublic || (property.IsProtected && publicProtectedOnly) || !publicOnly)
- builder.AddChild (property);
-
- foreach (var field in classData.Class.Fields.Where (m => !m.IsSynthetic))
- if (field.IsPublic || (field.IsProtected && publicProtectedOnly) || !publicOnly)
- builder.AddChild (field);
-
- foreach (var e in classData.Class.Events.Where (m => !m.IsSynthetic))
- if (e.IsPublic || (e.IsProtected && publicProtectedOnly) || !publicOnly)
- builder.AddChild (e);
+ builder.AddChildren (classData.Class.GetTypeMembers ()
+ .Where (innerClass => innerClass.DeclaredAccessibility == Accessibility.Public ||
+ (innerClass.DeclaredAccessibility == Accessibility.Protected && publicProtectedOnly) ||
+ !publicOnly)
+ .Select (innerClass => new ClassData (classData.Project, innerClass)));
+
+ builder.AddChildren (classData.Class.GetMembers ().OfType<IMethodSymbol> ().Where (m => m.MethodKind != MethodKind.PropertyGet && m.MethodKind != MethodKind.PropertySet)
+ .Where (method => method.DeclaredAccessibility == Accessibility.Public ||
+ (method.DeclaredAccessibility == Accessibility.Protected && publicProtectedOnly) ||
+ !publicOnly));
+
+ builder.AddChildren (classData.Class.GetMembers ().OfType<IPropertySymbol> ()
+ .Where (property => property.DeclaredAccessibility == Accessibility.Public ||
+ (property.DeclaredAccessibility == Accessibility.Protected && publicProtectedOnly) ||
+ !publicOnly));
+
+ builder.AddChildren (classData.Class.GetMembers ().OfType<IFieldSymbol> ()
+ .Where (field => field.DeclaredAccessibility == Accessibility.Public ||
+ (field.DeclaredAccessibility == Accessibility.Protected && publicProtectedOnly) ||
+ !publicOnly));
+
+ builder.AddChildren (classData.Class.GetMembers ().OfType<IEventSymbol> ()
+ .Where (e => e.DeclaredAccessibility == Accessibility.Public ||
+ (e.DeclaredAccessibility == Accessibility.Protected && publicProtectedOnly) ||
+ !publicOnly));
}
public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
@@ -123,7 +127,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
// info from the db, so we always return true here. After all 99% of classes will have members
return true;
}
-
+
public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
{
if (thisNode.DataItem is ClassData)
@@ -132,13 +136,13 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
return 1;
}
}
-
- public class ClassNodeCommandHandler: NodeCommandHandler
+
+ public class ClassNodeCommandHandler : NodeCommandHandler
{
public override void ActivateItem ()
{
ClassData cls = CurrentNode.DataItem as ClassData;
- IdeApp.ProjectOperations.JumpToDeclaration (cls.Class, true);
+ IdeApp.ProjectOperations.JumpToDeclaration (cls.Class, cls.Project);
}
- }
+ }
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs
index 9944f0f4b3..f2f7c8d72a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs
@@ -37,13 +37,6 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
{
public class CombineNodeBuilder: TypeNodeBuilder
{
- SolutionItemRenamedEventHandler combineNameChanged;
-
- public CombineNodeBuilder ()
- {
- combineNameChanged = (SolutionItemRenamedEventHandler) DispatchService.GuiDispatch (new SolutionItemRenamedEventHandler (OnCombineRenamed));
- }
-
public override Type NodeDataType {
get { return typeof(SolutionFolder); }
}
@@ -69,17 +62,16 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
{
SolutionFolder combine = (SolutionFolder) dataObject;
if (builder.Options ["ShowProjects"]) {
- foreach (SolutionItem entry in combine.Items)
- builder.AddChild (entry);
+ builder.AddChildren (combine.Items);
} else {
AddClasses (builder, combine);
}
}
- void AddClasses (ITreeBuilder builder, SolutionItem entry)
+ void AddClasses (ITreeBuilder builder, SolutionFolderItem entry)
{
if (entry is SolutionFolder) {
- foreach (SolutionItem e in ((SolutionFolder)entry).Items)
+ foreach (SolutionFolderItem e in ((SolutionFolder)entry).Items)
AddClasses (builder, e);
} else if (entry is Project) {
ProjectNodeBuilder.BuildChildNodes (builder, entry as Project);
@@ -102,13 +94,13 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
public override void OnNodeAdded (object dataObject)
{
SolutionFolder combine = (SolutionFolder) dataObject;
- combine.NameChanged += combineNameChanged;
+ combine.NameChanged += OnCombineRenamed;
}
public override void OnNodeRemoved (object dataObject)
{
SolutionFolder combine = (SolutionFolder) dataObject;
- combine.NameChanged -= combineNameChanged;
+ combine.NameChanged -= OnCombineRenamed;
}
void OnCombineRenamed (object sender, SolutionItemRenamedEventArgs e)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/EventNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/EventNodeBuilder.cs
index 425527694a..f85c069801 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/EventNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/EventNodeBuilder.cs
@@ -32,34 +32,26 @@ using System.Collections;
using MonoDevelop.Projects;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Components;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.Ide.Gui.Pads.ClassPad
{
- public class EventNodeBuilder: MemberNodeBuilder
+ public class EventNodeBuilder : MemberNodeBuilder
{
public override Type NodeDataType {
- get { return typeof(IEvent); }
+ get { return typeof (IEventSymbol); }
}
public override string ContextMenuAddinPath {
get { return "/MonoDevelop/Ide/ContextMenu/ClassPad/Event"; }
}
-
+
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
{
- IEvent data = dataObject as IEvent;
- nodeInfo.Label = Ambience.GetString (data, OutputFlags.ClassBrowserEntries | OutputFlags.IncludeMarkup);
+ var data = dataObject as IEventSymbol;
+ nodeInfo.Label = Ambience.EscapeText (((ISymbol)dataObject).ToDisplayString (Ambience.NameFormat));
nodeInfo.Icon = Context.GetIcon (data.GetStockIcon ());
}
-
- public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
- {
- if (thisNode.Options ["GroupByType"]) {
-
- }
- return DefaultSort;
- }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/FieldNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/FieldNodeBuilder.cs
index 21e4f8d5e5..2c42f7dda9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/FieldNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/FieldNodeBuilder.cs
@@ -32,25 +32,25 @@ using System.Collections;
using MonoDevelop.Projects;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Components;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.Ide.Gui.Pads.ClassPad
{
- public class FieldNodeBuilder: MemberNodeBuilder
+ public class FieldNodeBuilder : MemberNodeBuilder
{
public override Type NodeDataType {
- get { return typeof(IField); }
+ get { return typeof (IFieldSymbol); }
}
public override string ContextMenuAddinPath {
get { return "/MonoDevelop/Ide/ContextMenu/ClassPad/Field"; }
}
-
+
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
{
- IField data = dataObject as IField;
- nodeInfo.Label = Ambience.GetString (data, OutputFlags.ClassBrowserEntries | OutputFlags.IncludeMarkup);
+ var data = dataObject as IFieldSymbol;
+ nodeInfo.Label = Ambience.EscapeText (((ISymbol)dataObject).ToDisplayString (Ambience.NameFormat));
nodeInfo.Icon = Context.GetIcon (data.GetStockIcon ());
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/MemberNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/MemberNodeBuilder.cs
index bbe1f25eff..d4489fad66 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/MemberNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/MemberNodeBuilder.cs
@@ -32,31 +32,25 @@ using System.Collections;
using MonoDevelop.Projects;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Components;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.Ide.Gui.Pads.ClassPad
{
- public abstract class MemberNodeBuilder: TypeNodeBuilder
+ public abstract class MemberNodeBuilder : TypeNodeBuilder
{
public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
{
- return ((IMember)dataObject).Name;
+ return ((ISymbol)dataObject).ToDisplayString (Ambience.NameFormat);
}
-
- protected Ambience Ambience {
- get {
- return AmbienceService.DefaultAmbience;
- }
- }
-
+
public override Type CommandHandlerType {
- get { return typeof(MemberNodeCommandHandler); }
+ get { return typeof (MemberNodeCommandHandler); }
}
-
+
public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
{
- if (!(otherNode.DataItem is IMember)) return 1;
+ if (!(otherNode.DataItem is ISymbol)) return 1;
if (thisNode.Options ["GroupByType"]) {
int v1 = GetTypeSortValue (thisNode.DataItem);
@@ -65,23 +59,23 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
else if (v1 > v2) return 1;
}
if (thisNode.Options ["GroupByAccess"]) {
- int v1 = GetAccessSortValue (((IEntity)thisNode.DataItem).Accessibility);
- int v2 = GetAccessSortValue (((IEntity)otherNode.DataItem).Accessibility);
+ int v1 = GetAccessSortValue (((ISymbol)thisNode.DataItem).DeclaredAccessibility);
+ int v2 = GetAccessSortValue (((ISymbol)otherNode.DataItem).DeclaredAccessibility);
if (v1 < v2) return -1;
else if (v1 > v2) return 1;
}
return DefaultSort;
}
-
+
int GetTypeSortValue (object member)
{
- if (member is IField) return 0;
- if (member is IEvent) return 1;
- if (member is IProperty) return 2;
- if (member is IMethod) return 3;
+ if (member is IFieldSymbol) return 0;
+ if (member is IEventSymbol) return 1;
+ if (member is IPropertySymbol) return 2;
+ if (member is IMethodSymbol) return 3;
return 4;
}
-
+
int GetAccessSortValue (Accessibility mods)
{
if ((mods & Accessibility.Private) != 0) return 0;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/MemberNodeCommandHandler.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/MemberNodeCommandHandler.cs
index 241ec93aec..acad5b1ec9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/MemberNodeCommandHandler.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/MemberNodeCommandHandler.cs
@@ -28,20 +28,19 @@
using System;
using System.IO;
-
+using Microsoft.CodeAnalysis;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Components;
-using ICSharpCode.NRefactory.TypeSystem;
namespace MonoDevelop.Ide.Gui.Pads.ClassPad
{
- public class MemberNodeCommandHandler: NodeCommandHandler
+ public class MemberNodeCommandHandler : NodeCommandHandler
{
public override void ActivateItem ()
- {
- var member = CurrentNode.DataItem as IEntity;
- IdeApp.ProjectOperations.JumpToDeclaration(member);
+ {
+ var member = CurrentNode.DataItem as ISymbol;
+ IdeApp.ProjectOperations.JumpToDeclaration (member);
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/MethodNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/MethodNodeBuilder.cs
index 8a25619430..7d8aa31541 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/MethodNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/MethodNodeBuilder.cs
@@ -32,25 +32,25 @@ using System.Collections;
using MonoDevelop.Projects;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Components;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.Ide.Gui.Pads.ClassPad
{
- public class MethodNodeBuilder: MemberNodeBuilder
+ public class MethodNodeBuilder : MemberNodeBuilder
{
public override Type NodeDataType {
- get { return typeof(IMethod); }
+ get { return typeof (IMethodSymbol); }
}
public override string ContextMenuAddinPath {
get { return "/MonoDevelop/Ide/ContextMenu/ClassPad/Method"; }
}
-
+
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
{
- IMethod data = dataObject as IMethod;
- nodeInfo.Label = Ambience.GetString (data, OutputFlags.ClassBrowserEntries | OutputFlags.IncludeMarkup);
+ var data = dataObject as IMethodSymbol;
+ nodeInfo.Label = Ambience.EscapeText (((ISymbol)dataObject).ToDisplayString (Ambience.NameFormat));
nodeInfo.Icon = Context.GetIcon (data.GetStockIcon ());
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceData.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceData.cs
index eee3c370b1..04b331b609 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceData.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceData.cs
@@ -34,63 +34,64 @@ using MonoDevelop.Projects;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Components;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
using System.Linq;
+using Microsoft.CodeAnalysis;
+using Project = MonoDevelop.Projects.Project;
namespace MonoDevelop.Ide.Gui.Pads.ClassPad
{
public abstract class NamespaceData
{
- protected INamespace namesp;
-
+ protected INamespaceSymbol namesp;
+
public string Name {
get {
return namesp.Name;
}
}
-
+
public string FullName {
- get { return namesp.FullName; }
+ get { return namesp.GetFullName (); }
}
-
- public NamespaceData (INamespace namesp)
+
+ public NamespaceData (INamespaceSymbol namesp)
{
this.namesp = namesp;
}
-
+
public abstract void AddProjectContent (ITreeBuilder builder);
-
+
public override bool Equals (object ob)
{
var other = ob as NamespaceData;
return (other != null && namesp == other.namesp);
}
-
+
public override int GetHashCode ()
{
return namesp.GetHashCode ();
}
-
+
public override string ToString ()
{
- return base.ToString () + " [" + namesp.FullName + "]";
+ return base.ToString () + " [" + namesp.GetFullName () + "]";
}
}
-
+
public class ProjectNamespaceData : NamespaceData
{
Project project;
-
+
public Project Project {
get { return project; }
}
- public ProjectNamespaceData (Project project, INamespace nspace) : base (nspace)
+ public ProjectNamespaceData (Project project, INamespaceSymbol nspace) : base (nspace)
{
this.project = project;
}
-
+
public override void AddProjectContent (ITreeBuilder builder)
{
if (project != null) {
@@ -101,42 +102,39 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
}
}
}
-
+
void AddProjectContent (ITreeBuilder builder, Project p)
{
- foreach (var ns in namesp.ChildNamespaces) {
- if (!builder.HasChild (ns.Name, typeof(NamespaceData)))
- builder.AddChild (new ProjectNamespaceData (project, ns));
- }
-// bool nestedNs = builder.Options ["NestedNamespaces"];
+ builder.AddChildren (namesp.GetNamespaceMembers ()
+ .Where (ns => !builder.HasChild (ns.Name, typeof (NamespaceData)))
+ .Select (ns => new ProjectNamespaceData (project, ns)));
+ // bool nestedNs = builder.Options ["NestedNamespaces"];
bool publicOnly = builder.Options ["PublicApiOnly"];
-
- foreach (var type in namesp.Types) {
- if (!publicOnly || type.IsPublic)
- builder.AddChild (new ClassData (project, type));
- }
-
+
+ builder.AddChildren (namesp.GetAllTypes ()
+ .Where (type => !publicOnly || type.DeclaredAccessibility == Accessibility.Public)
+ .Select (type => new ClassData (project, type)));
}
-
-
+
+
public override bool Equals (object ob)
{
ProjectNamespaceData other = ob as ProjectNamespaceData;
return (other != null && namesp == other.namesp && project == other.project);
}
-
+
public override int GetHashCode ()
{
if (project != null) return (namesp + project.Name).GetHashCode ();
else return namesp.GetHashCode ();
}
-
+
public override string ToString ()
{
return base.ToString () + " [" + namesp + ", " + (project != null ? project.Name : "no project") + "]";
}
}
-
+
/*
public class CompilationUnitNamespaceData : NamespaceData
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs
index 76e634c035..e5cdb2278e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs
@@ -27,66 +27,58 @@
//
using System;
-using System.IO;
using System.Collections;
using System.Collections.Generic;
+using System.IO;
+using System.Linq;
using System.Text;
-using MonoDevelop.Projects;
+using Microsoft.CodeAnalysis;
using MonoDevelop.Core;
+using MonoDevelop.Projects;
using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem;
-using System.Linq;
+using Project = MonoDevelop.Projects.Project;
namespace MonoDevelop.Ide.Gui.Pads.ClassPad
{
- public class ProjectNodeBuilder: TypeNodeBuilder
+ public class ProjectNodeBuilder : TypeNodeBuilder
{
- SolutionItemRenamedEventHandler projectNameChanged;
-
- public ProjectNodeBuilder ()
- {
- projectNameChanged = (SolutionItemRenamedEventHandler) DispatchService.GuiDispatch (new SolutionItemRenamedEventHandler (OnProjectRenamed));
- }
-
-// EventHandler<TypeUpdateInformationEventArgs> compilationUnitUpdated;
protected override void Initialize ()
{
-// compilationUnitUpdated = (EventHandler<TypeUpdateInformationEventArgs>) DispatchService.GuiDispatch (new EventHandler<TypeUpdateInformationEventArgs> (OnClassInformationChanged));
-// TypeSystemService.TypesUpdated += compilationUnitUpdated;
+ // TypeSystemService.TypesUpdated += OnClassInformationChanged;
}
-
+
public override void Dispose ()
{
-// TypeSystemService.TypesUpdated -= compilationUnitUpdated;
+ // TypeSystemService.TypesUpdated -= OnClassInformationChanged;
}
-
+
public override Type NodeDataType {
- get { return typeof(Project); }
+ get { return typeof (Project); }
}
-
+
public override string ContextMenuAddinPath {
get { return "/MonoDevelop/Ide/ContextMenu/ClassPad/Project"; }
}
-
+
public override void OnNodeAdded (object dataObject)
{
- Project project = (Project) dataObject;
- project.NameChanged += projectNameChanged;
+ Project project = (Project)dataObject;
+ project.NameChanged += OnProjectRenamed;
}
-
+
public override void OnNodeRemoved (object dataObject)
{
- Project project = (Project) dataObject;
- project.NameChanged -= projectNameChanged;
+ Project project = (Project)dataObject;
+ project.NameChanged -= OnProjectRenamed;
}
-
+
public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
{
return ((Project)dataObject).Name;
}
-
+
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
{
Project p = dataObject as Project;
@@ -96,20 +88,22 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
{
- Project project = (Project) dataObject;
+ Project project = (Project)dataObject;
BuildChildNodes (builder, project);
}
-
+
public static void BuildChildNodes (ITreeBuilder builder, Project project)
{
if (project is DotNetProject) {
builder.AddChild (((DotNetProject)project).References);
}
bool publicOnly = builder.Options ["PublicApiOnly"];
- var dom = TypeSystemService.GetCompilation (project);
+ var dom = TypeSystemService.GetCompilationAsync (project).Result;
+ if (dom == null)
+ return;
bool nestedNamespaces = builder.Options ["NestedNamespaces"];
HashSet<string> addedNames = new HashSet<string> ();
- foreach (var ns in dom.MainAssembly.RootNamespace.ChildNamespaces) {
+ foreach (var ns in dom.Assembly.GlobalNamespace.GetNamespaceMembers ()) {
if (nestedNamespaces) {
if (!addedNames.Contains (ns.Name)) {
builder.AddChild (new ProjectNamespaceData (project, ns));
@@ -119,15 +113,14 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
FillNamespaces (builder, project, ns);
}
}
- foreach (var type in dom.MainAssembly.RootNamespace.Types) {
- if (!publicOnly || type.IsPublic)
- builder.AddChild (new ClassData (project, type));
- }
+ builder.AddChildren (dom.Assembly.GlobalNamespace.GetTypeMembers ()
+ .Where (type => !publicOnly || type.DeclaredAccessibility == Accessibility.Public)
+ .Select (type => new ClassData (project, type)));
}
-
- public static void FillNamespaces (ITreeBuilder builder, Project project, INamespace ns)
+
+ public static void FillNamespaces (ITreeBuilder builder, Project project, INamespaceSymbol ns)
{
- var members = ns.Types;
+ var members = ns.GetTypeMembers ();
//IParserContext ctx = IdeApp.Workspace.ParserDatabase.GetProjectParserContext (project);
if (members.Any ()) {
if (builder.Options ["ShowProjects"])
@@ -137,116 +130,116 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
builder.AddChild (new ProjectNamespaceData (null, ns));
}
}
- foreach (var nSpace in ns.ChildNamespaces) {
+ foreach (var nSpace in ns.GetNamespaceMembers ()) {
FillNamespaces (builder, project, nSpace);
}
}
-
+
public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
{
return true;
}
-
+
void OnProjectRenamed (object sender, SolutionItemRenamedEventArgs e)
{
ITreeBuilder tb = Context.GetTreeBuilder (e.SolutionItem);
if (tb != null) tb.Update ();
}
-
-// void OnClassInformationChanged (object sender, TypeUpdateInformationEventArgs e)
-// {
-//// DateTime t = DateTime.Now;
-// Dictionary<object,bool> oldStatus = new Dictionary<object,bool> ();
-// List<string> namespacesToClean = new List<string> ();
-// ITreeBuilder tb = Context.GetTreeBuilder ();
-//
-// foreach (IType cls in e.TypeUpdateInformation.Removed) {
-// if (tb.MoveToObject (new ClassData (e.Project, cls))) {
-// oldStatus [tb.DataItem] = tb.Expanded;
-//
-// ITreeNavigator np = tb.Clone ();
-// np.MoveToParent ();
-// oldStatus [np.DataItem] = np.Expanded;
-//
-// tb.Remove (true);
-// }
-// namespacesToClean.Add (cls.Namespace);
-// }
-//
-// foreach (IType cls in e.TypeUpdateInformation.Modified) {
-// ClassData ucd = new ClassData (e.Project, cls);
-// if (tb.MoveToObject (ucd)) {
-// ClassData cd = (ClassData) tb.DataItem;
-// cd.UpdateFrom (ucd);
-// tb.UpdateAll ();
-// }
-// }
-//
-// foreach (IType cls in e.TypeUpdateInformation.Added) {
-// AddClass (e.Project, cls);
-// }
-//
-// // Clean empty namespaces
-//
-// foreach (string ns in namespacesToClean) {
-// string subns = ns;
-// while (subns != null) {
-// bool found = tb.MoveToObject (new ProjectNamespaceData (e.Project, subns));
-// if (!found) found = tb.MoveToObject (new ProjectNamespaceData (null, subns));
-// if (found) {
-// while (tb.DataItem is NamespaceData && !tb.HasChildren())
-// tb.Remove (true);
-// break;
-// }
-// int i = subns.LastIndexOf ('.');
-// if (i != -1) subns = subns.Substring (0,i);
-// else subns = null;
-// }
-// }
-//
-// // Restore expand status
-//
-// foreach (KeyValuePair<object,bool> de in oldStatus) {
-// if (de.Value && tb.MoveToObject (de.Key)) {
-// tb.ExpandToNode ();
-// tb.Expanded = true;
-// }
-// }
-// }
-
- void AddClass (Project project, ITypeDefinition cls)
+
+ // void OnClassInformationChanged (object sender, TypeUpdateInformationEventArgs e)
+ // {
+ //// DateTime t = DateTime.Now;
+ // Dictionary<object,bool> oldStatus = new Dictionary<object,bool> ();
+ // List<string> namespacesToClean = new List<string> ();
+ // ITreeBuilder tb = Context.GetTreeBuilder ();
+ //
+ // foreach (IType cls in e.TypeUpdateInformation.Removed) {
+ // if (tb.MoveToObject (new ClassData (e.Project, cls))) {
+ // oldStatus [tb.DataItem] = tb.Expanded;
+ //
+ // ITreeNavigator np = tb.Clone ();
+ // np.MoveToParent ();
+ // oldStatus [np.DataItem] = np.Expanded;
+ //
+ // tb.Remove (true);
+ // }
+ // namespacesToClean.Add (cls.Namespace);
+ // }
+ //
+ // foreach (IType cls in e.TypeUpdateInformation.Modified) {
+ // ClassData ucd = new ClassData (e.Project, cls);
+ // if (tb.MoveToObject (ucd)) {
+ // ClassData cd = (ClassData) tb.DataItem;
+ // cd.UpdateFrom (ucd);
+ // tb.UpdateAll ();
+ // }
+ // }
+ //
+ // foreach (IType cls in e.TypeUpdateInformation.Added) {
+ // AddClass (e.Project, cls);
+ // }
+ //
+ // // Clean empty namespaces
+ //
+ // foreach (string ns in namespacesToClean) {
+ // string subns = ns;
+ // while (subns != null) {
+ // bool found = tb.MoveToObject (new ProjectNamespaceData (e.Project, subns));
+ // if (!found) found = tb.MoveToObject (new ProjectNamespaceData (null, subns));
+ // if (found) {
+ // while (tb.DataItem is NamespaceData && !tb.HasChildren())
+ // tb.Remove (true);
+ // break;
+ // }
+ // int i = subns.LastIndexOf ('.');
+ // if (i != -1) subns = subns.Substring (0,i);
+ // else subns = null;
+ // }
+ // }
+ //
+ // // Restore expand status
+ //
+ // foreach (KeyValuePair<object,bool> de in oldStatus) {
+ // if (de.Value && tb.MoveToObject (de.Key)) {
+ // tb.ExpandToNode ();
+ // tb.Expanded = true;
+ // }
+ // }
+ // }
+
+ void AddClass (Project project, ITypeSymbol cls)
{
ITreeBuilder builder = Context.GetTreeBuilder ();
if (!builder.MoveToObject (project)) {
- return; // The project is not there or may not yet be expanded
+ return; // The project is not there or may not yet be expanded
}
-
- if (cls.Namespace == "") {
+
+ if (cls.ContainingNamespace == null) {
builder.AddChild (new ClassData (project, cls));
} else {
-// TODO: Type system conversion.
-/* if (builder.Options ["NestedNamespaces"]) {
- string[] nsparts = cls.Namespace.Split ('.');
- string ns = "";
- foreach (string nsp in nsparts) {
- if (builder.Filled) {
- if (ns.Length > 0) ns += ".";
- ns += nsp;
- if (!builder.MoveToChild (nsp, typeof(NamespaceData))) {
- builder.AddChild (new ProjectNamespaceData (project, ns), true);
- break;
- }
- } else
- break;
- }
- builder.AddChild (new ClassData (project, cls));
- } else {
- if (builder.MoveToChild (cls.Namespace, typeof(NamespaceData)))
- builder.AddChild (new ClassData (project, cls));
- else
- builder.AddChild (new ProjectNamespaceData (project, cls.Namespace));
- }*/
+ // TODO: Type system conversion.
+ /* if (builder.Options ["NestedNamespaces"]) {
+ string[] nsparts = cls.Namespace.Split ('.');
+ string ns = "";
+ foreach (string nsp in nsparts) {
+ if (builder.Filled) {
+ if (ns.Length > 0) ns += ".";
+ ns += nsp;
+ if (!builder.MoveToChild (nsp, typeof(NamespaceData))) {
+ builder.AddChild (new ProjectNamespaceData (project, ns), true);
+ break;
+ }
+ } else
+ break;
+ }
+ builder.AddChild (new ClassData (project, cls));
+ } else {
+ if (builder.MoveToChild (cls.Namespace, typeof(NamespaceData)))
+ builder.AddChild (new ClassData (project, cls));
+ else
+ builder.AddChild (new ProjectNamespaceData (project, cls.Namespace));
+ }*/
}
- }
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/PropertyNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/PropertyNodeBuilder.cs
index 2d8c5bb73f..99f0a4a857 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/PropertyNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/PropertyNodeBuilder.cs
@@ -32,25 +32,25 @@ using System.Collections;
using MonoDevelop.Projects;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Components;
-using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.TypeSystem;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.Ide.Gui.Pads.ClassPad
{
- public class PropertyNodeBuilder: MemberNodeBuilder
+ public class PropertyNodeBuilder : MemberNodeBuilder
{
public override Type NodeDataType {
- get { return typeof(IProperty); }
+ get { return typeof (IPropertySymbol); }
}
public override string ContextMenuAddinPath {
get { return "/MonoDevelop/Ide/ContextMenu/ClassPad/Property"; }
}
-
+
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
{
- IProperty data = dataObject as IProperty;
- nodeInfo.Label = Ambience.GetString (data, OutputFlags.ClassBrowserEntries | OutputFlags.IncludeMarkup);
+ var data = dataObject as IPropertySymbol;
+ nodeInfo.Label = Ambience.EscapeText (((ISymbol)dataObject).ToDisplayString (Ambience.NameFormat));
nodeInfo.Icon = Context.GetIcon (data.GetStockIcon ());
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ReferenceNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ReferenceNodeBuilder.cs
index e6292949ca..ae7b59f8f4 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ReferenceNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ReferenceNodeBuilder.cs
@@ -123,7 +123,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
ProjectReference pref = CurrentNode.DataItem as ProjectReference;
if (pref != null) {
foreach (string fileName in pref.GetReferencedFileNames (IdeApp.Workspace.ActiveConfiguration))
- IdeApp.Workbench.OpenDocument (fileName);
+ IdeApp.Workbench.OpenDocument (fileName, project: null);
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/SolutionNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/SolutionNodeBuilder.cs
index 1cfcbe4eda..4852a7f502 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/SolutionNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/SolutionNodeBuilder.cs
@@ -41,14 +41,8 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
{
public class SolutionNodeBuilder: TypeNodeBuilder
{
- EventHandler<WorkspaceItemRenamedEventArgs> combineNameChanged;
- EventHandler startupChanged;
-
public SolutionNodeBuilder ()
{
- combineNameChanged = (EventHandler<WorkspaceItemRenamedEventArgs>) DispatchService.GuiDispatch (new EventHandler<WorkspaceItemRenamedEventArgs> (OnCombineRenamed));
- startupChanged = (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnStartupChanged));
-
IdeApp.Workspace.ItemAddedToSolution += OnEntryAdded;
IdeApp.Workspace.ItemRemovedFromSolution += OnEntryRemoved;
}
@@ -82,7 +76,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
{
Solution solution = dataObject as Solution;
int count = 0;
- foreach (SolutionItem e in solution.GetAllSolutionItems ())
+ foreach (SolutionFolderItem e in solution.GetAllSolutionItems ())
if (!(e is SolutionFolder))
count++;
@@ -104,8 +98,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
public override void BuildChildNodes (ITreeBuilder ctx, object dataObject)
{
Solution solution = (Solution) dataObject;
- foreach (SolutionItem entry in solution.RootFolder.Items)
- ctx.AddChild (entry);
+ ctx.AddChildren (solution.RootFolder.Items);
}
public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
@@ -121,15 +114,15 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
public override void OnNodeAdded (object dataObject)
{
Solution solution = (Solution) dataObject;
- solution.NameChanged += combineNameChanged;
- solution.StartupItemChanged += startupChanged;
+ solution.NameChanged += OnCombineRenamed;
+ solution.StartupItemChanged += OnStartupChanged;
}
public override void OnNodeRemoved (object dataObject)
{
Solution solution = (Solution) dataObject;
- solution.NameChanged -= combineNameChanged;
- solution.StartupItemChanged -= startupChanged;
+ solution.NameChanged -= OnCombineRenamed;
+ solution.StartupItemChanged -= OnStartupChanged;
}
void OnStartupChanged (object sender, EventArgs args)
@@ -168,7 +161,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
public class SolutionNodeCommandHandler: NodeCommandHandler
{
- public override void RenameItem (string newName)
+ public override async void RenameItem (string newName)
{
if (newName.IndexOfAny (new char [] { '\'', '(', ')', '"', '{', '}', '|' } ) != -1) {
MessageService.ShowError (GettextCatalog.GetString ("Solution name may not contain any of the following characters: {0}", "', (, ), \", {, }, |"));
@@ -177,7 +170,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
Solution sol = (Solution) CurrentNode.DataItem;
sol.Name = newName;
- IdeApp.Workspace.Save();
+ await IdeApp.Workspace.SaveAsync();
}
public override DragOperation CanDragNode ()
@@ -187,7 +180,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
public override bool CanDropNode (object dataObject, DragOperation operation)
{
- return dataObject is SolutionItem;
+ return dataObject is SolutionFolderItem;
}
public override void OnNodeDrop (object dataObject, DragOperation operation)
@@ -201,7 +194,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
}
[CommandHandler (EditCommands.Delete)]
- public void RemoveItem ()
+ public async void RemoveItem ()
{
Solution solution = CurrentNode.DataItem as Solution;
Workspace parent = CurrentNode.GetParentDataItem (typeof(Workspace), false) as Workspace;
@@ -211,7 +204,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
if (res == AlertButton.Remove) {
parent.Items.Remove (solution);
solution.Dispose ();
- IdeApp.Workspace.Save();
+ await IdeApp.Workspace.SaveAsync();
}
}
@@ -226,17 +219,17 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
public void AddNewProjectToSolution ()
{
Solution solution = (Solution) CurrentNode.DataItem;
- SolutionItem ce = IdeApp.ProjectOperations.CreateProject (solution.RootFolder);
+ SolutionFolderItem ce = IdeApp.ProjectOperations.CreateProject (solution.RootFolder);
if (ce == null) return;
Tree.AddNodeInsertCallback (ce, new TreeNodeCallback (OnEntryInserted));
CurrentNode.Expanded = true;
}
[CommandHandler (ProjectCommands.AddProject)]
- public void AddProjectToCombine()
+ public async void AddProjectToCombine()
{
Solution solution = (Solution) CurrentNode.DataItem;
- SolutionItem ce = IdeApp.ProjectOperations.AddSolutionItem (solution.RootFolder);
+ SolutionFolderItem ce = await IdeApp.ProjectOperations.AddSolutionItem (solution.RootFolder);
if (ce == null) return;
Tree.AddNodeInsertCallback (ce, new TreeNodeCallback (OnEntryInserted));
CurrentNode.Expanded = true;
@@ -246,7 +239,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
public void AddFolder()
{
Solution solution = (Solution) CurrentNode.DataItem;
- SolutionItem ce = new SolutionFolder ();
+ var ce = new SolutionFolder ();
ce.Name = GettextCatalog.GetString ("New Folder");
solution.RootFolder.Items.Add (ce);
Tree.AddNodeInsertCallback (ce, OnFolderInserted);
@@ -257,7 +250,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
public void OnReload ()
{
Solution solution = (Solution) CurrentNode.DataItem;
- using (IProgressMonitor m = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
+ using (ProgressMonitor m = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
solution.ParentWorkspace.ReloadItem (m, solution);
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs
index 2d9e6c4a76..dee86e78bb 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs
@@ -71,12 +71,9 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
List<string> folders;
GetFolderContent (project, path, out files, out folders);
-
- foreach (ProjectFile file in files)
- builder.AddChild (file);
-
- foreach (string folder in folders)
- builder.AddChild (new ProjectFolder (folder, project, dataObject));
+
+ builder.AddChildren (files);
+ builder.AddChildren (folders.Select (f => new ProjectFolder (f, project, dataObject)));
}
void GetFolderContent (Project project, string folder, out ProjectFileCollection files, out List<string> folders)
@@ -189,9 +186,9 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
return false;
}
- public override void OnMultipleNodeDrop (object[] dataObjects, DragOperation operation)
+ public override async void OnMultipleNodeDrop (object[] dataObjects, DragOperation operation)
{
- var projectsToSave = new HashSet<SolutionEntityItem> ();
+ var projectsToSave = new HashSet<SolutionItem> ();
var groupedFiles = new HashSet<ProjectFile> ();
foreach (var pf in dataObjects.OfType<ProjectFile> ()) {
@@ -202,10 +199,10 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
foreach (object dataObject in dataObjects)
DropNode (projectsToSave, dataObject, groupedFiles, operation);
- IdeApp.ProjectOperations.Save (projectsToSave);
+ await IdeApp.ProjectOperations.SaveAsync (projectsToSave);
}
- void DropNode (HashSet<SolutionEntityItem> projectsToSave, object dataObject, HashSet<ProjectFile> groupedFiles, DragOperation operation)
+ void DropNode (HashSet<SolutionItem> projectsToSave, object dataObject, HashSet<ProjectFile> groupedFiles, DragOperation operation)
{
FilePath targetDirectory = GetFolderPath (CurrentNode.DataItem);
FilePath source;
@@ -378,7 +375,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
}
[CommandHandler (ProjectCommands.AddFiles)]
- public void AddFilesToProject()
+ public async void AddFilesToProject()
{
Project project = (Project) CurrentNode.GetParentDataItem (typeof(Project), true);
var targetRoot = ((FilePath) GetFolderPath (CurrentNode.DataItem)).CanonicalPath;
@@ -403,18 +400,18 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
IdeApp.ProjectOperations.AddFilesToProject (project, files, baseDirectory, overrideAction);
- IdeApp.ProjectOperations.Save (project);
+ await IdeApp.ProjectOperations.SaveAsync (project);
}
[CommandHandler (ProjectCommands.AddNewFiles)]
- public void AddNewFileToProject()
+ public async void AddNewFileToProject()
{
Project project = (Project) CurrentNode.GetParentDataItem (typeof(Project), true);
IdeApp.ProjectOperations.CreateProjectFile (project, GetFolderPath (CurrentNode.DataItem));
- IdeApp.ProjectOperations.Save (project);
CurrentNode.Expanded = true;
if (IdeApp.Workbench.ActiveDocument != null)
IdeApp.Workbench.ActiveDocument.Window.SelectWindow ();
+ await IdeApp.ProjectOperations.SaveAsync (project);
}
void OnFileInserted (ITreeNavigator nav)
@@ -425,7 +422,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
///<summary>Imports files and folders from a target folder into the current folder</summary>
[CommandHandler (ProjectCommands.AddFilesFromFolder)]
- public void AddFilesFromFolder ()
+ public async void AddFilesFromFolder ()
{
var project = (Project) CurrentNode.GetParentDataItem (typeof(Project), true);
var targetRoot = ((FilePath) GetFolderPath (CurrentNode.DataItem)).CanonicalPath;
@@ -460,13 +457,13 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
var added = IdeApp.ProjectOperations.AddFilesToProject (project, srcFiles.ToArray (), targetFiles.ToArray (), null).Any ();
if (added)
- IdeApp.ProjectOperations.Save (project);
+ await IdeApp.ProjectOperations.SaveAsync (project);
}
}
///<summary>Adds an existing folder to the current folder</summary>
[CommandHandler (ProjectCommands.AddExistingFolder)]
- public void AddExistingFolder ()
+ public async void AddExistingFolder ()
{
var project = (Project) CurrentNode.GetParentDataItem (typeof(Project), true);
var selectedFolder = ((FilePath) GetFolderPath (CurrentNode.DataItem)).CanonicalPath;
@@ -520,12 +517,12 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
}
if (changedProject)
- IdeApp.ProjectOperations.Save (project);
+ await IdeApp.ProjectOperations.SaveAsync (project);
}
}
[CommandHandler (ProjectCommands.NewFolder)]
- public void AddNewFolder ()
+ public async void AddNewFolder ()
{
Project project = CurrentNode.GetParentDataItem (typeof(Project), true) as Project;
@@ -546,10 +543,11 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
ProjectFile newFolder = new ProjectFile (directoryName);
newFolder.Subtype = Subtype.Directory;
project.Files.Add (newFolder);
- IdeApp.ProjectOperations.Save (project);
CurrentNode.Expanded = true;
Tree.AddNodeInsertCallback (new ProjectFolder (directoryName, project), new TreeNodeCallback (OnFileInserted));
+
+ await IdeApp.ProjectOperations.SaveAsync (project);
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ImplicitFrameworkAssemblyReferenceNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ImplicitFrameworkAssemblyReferenceNodeBuilder.cs
index 08233fc98f..e42d8e6dd4 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ImplicitFrameworkAssemblyReferenceNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ImplicitFrameworkAssemblyReferenceNodeBuilder.cs
@@ -74,7 +74,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public override void ActivateItem ()
{
var aref = (ImplicitFrameworkAssemblyReference) CurrentNode.DataItem;
- IdeApp.Workbench.OpenDocument (aref.Assembly.Location);
+ IdeApp.Workbench.OpenDocument (aref.Assembly.Location, project: null);
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/PortableFrameworkSubsetNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/PortableFrameworkSubsetNodeBuilder.cs
index 50e91608c8..5f8ab86709 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/PortableFrameworkSubsetNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/PortableFrameworkSubsetNodeBuilder.cs
@@ -1,42 +1,43 @@
-//
-// ProjectReferencePclNodeBuilder.cs
-//
-// Author:
-// Michael Hutchinson <m.j.hutchinson@gmail.com>
-//
-// Copyright (c) 2013 Xamarin Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
+//
+// ProjectReferencePclNodeBuilder.cs
+//
+// Author:
+// Michael Hutchinson <m.j.hutchinson@gmail.com>
+//
+// Copyright (c) 2013 Xamarin Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
using System;
using MonoDevelop.Ide.Gui.Components;
using MonoDevelop.Core.Assemblies;
using MonoDevelop.Projects;
using MonoDevelop.Core;
using Gdk;
-
+using System.Linq;
+
namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
{
class PortableFrameworkSubset
{
- public PortableDotNetProject Project { get; private set; }
+ public DotNetProject Project { get; private set; }
- public PortableFrameworkSubset (PortableDotNetProject project)
+ public PortableFrameworkSubset (DotNetProject project)
{
this.Project = project;
}
@@ -72,16 +73,16 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
{
- var project = ((PortableFrameworkSubset) dataObject).Project;
+ var project = ((PortableFrameworkSubset) dataObject).Project;
if (!project.TargetRuntime.IsInstalled (project.TargetFramework)) {
string msg = GettextCatalog.GetString ("Framework not installed: {0}", project.TargetFramework.Id);
treeBuilder.AddChild (new TreeViewItem (msg, Stock.Warning));
}
- foreach (var asm in project.TargetRuntime.AssemblyContext.GetAssemblies (project.TargetFramework))
- if (asm.Package.IsFrameworkPackage && asm.Name != "mscorlib")
- treeBuilder.AddChild (new ImplicitFrameworkAssemblyReference (asm));
+ treeBuilder.AddChildren (project.TargetRuntime.AssemblyContext.GetAssemblies (project.TargetFramework)
+ .Where (asm => asm.Package.IsFrameworkPackage && asm.Name != "mscorlib")
+ .Select (asm => new ImplicitFrameworkAssemblyReference (asm)));
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs
index 57608e02bb..c943064680 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs
@@ -86,18 +86,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
if (file.IsLink && nodeInfo.Icon != null) {
var overlay = ImageService.GetIcon ("md-link-overlay").WithSize (Xwt.IconSize.Small);
- var cached = Context.GetComposedIcon (nodeInfo.Icon, overlay);
- if (cached != null)
- nodeInfo.Icon = cached;
- else {
- var ib = new Xwt.Drawing.ImageBuilder (nodeInfo.Icon.Width, nodeInfo.Icon.Height);
- ib.Context.DrawImage (nodeInfo.Icon, 0, 0);
- ib.Context.DrawImage (overlay, 0, 0);
- var res = ib.ToVectorImage ();
- ib.Dispose ();
- Context.CacheComposedIcon (nodeInfo.Icon, overlay, res);
- nodeInfo.Icon = res;
- }
+ nodeInfo.OverlayBottomRight = overlay;
}
}
@@ -154,8 +143,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
base.BuildChildNodes (treeBuilder, dataObject);
ProjectFile file = (ProjectFile) dataObject;
if (file.HasChildren)
- foreach (ProjectFile pf in file.DependentChildren)
- treeBuilder.AddChild (pf);
+ treeBuilder.AddChildren (file.DependentChildren);
}
}
@@ -168,11 +156,16 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
selectionLength = Path.GetFileNameWithoutExtension(name).Length;
}
- public override void RenameItem (string newName)
+ public async override void RenameItem (string newName)
{
ProjectFile newProjectFile = null;
var file = (ProjectFile) CurrentNode.DataItem;
-
+
+ string oldFileName = file.FilePath;
+ string newFileName = Path.Combine (Path.GetDirectoryName (oldFileName), newName);
+ if (oldFileName == newFileName)
+ return;
+
FilePath newPath, newLink = FilePath.Null;
if (file.IsLink) {
var oldLink = file.ProjectVirtualPath;
@@ -186,7 +179,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
if (file.Project != null)
newProjectFile = file.Project.Files.GetFileWithVirtualPath (newPath.ToRelative (file.Project.BaseDirectory));
- if (!FileService.IsValidPath (newPath)) {
+ if (!FileService.IsValidPath (newPath) || ProjectFolderCommandHandler.ContainsDirectorySeparator (newName)) {
MessageService.ShowWarning (GettextCatalog.GetString ("The name you have chosen contains illegal characters. Please choose a different name."));
} else if ((newProjectFile != null && newProjectFile != file) || File.Exists (file.FilePath.ParentDirectory.Combine (newName))) {
// If there is already a file under the newPath which is *different*, then throw an exception
@@ -194,7 +187,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
} else {
FileService.RenameFile (file.FilePath, newName);
if (file.Project != null)
- IdeApp.ProjectOperations.Save (file.Project);
+ await IdeApp.ProjectOperations.SaveAsync (file.Project);
}
} catch (ArgumentException) { // new file name with wildcard (*, ?) characters in it
MessageService.ShowWarning (GettextCatalog.GetString ("The name you have chosen contains illegal characters. Please choose a different name."));
@@ -233,7 +226,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
[AllowMultiSelection]
public override void DeleteMultipleItems ()
{
- var projects = new Set<SolutionEntityItem> ();
+ var projects = new Set<SolutionItem> ();
var files = new List<ProjectFile> ();
bool hasChildren = false;
@@ -300,7 +293,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
FileService.DeleteFile (file.Name);
}
- IdeApp.ProjectOperations.Save (projects);
+ IdeApp.ProjectOperations.SaveAsync (projects);
}
static bool CheckAnyFileExists (IEnumerable<ProjectFile> files)
@@ -378,7 +371,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
[AllowMultiSelection]
public void OnSetBuildAction (object ob)
{
- Set<SolutionEntityItem> projects = new Set<SolutionEntityItem> ();
+ Set<SolutionItem> projects = new Set<SolutionItem> ();
string action = (string)ob;
foreach (ITreeNavigator node in CurrentNodes) {
@@ -386,7 +379,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
file.BuildAction = action;
projects.Add (file.Project);
}
- IdeApp.ProjectOperations.Save (projects);
+ IdeApp.ProjectOperations.SaveAsync (projects);
}
[CommandUpdateHandler (FileCommands.SetBuildAction)]
@@ -452,7 +445,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
}
}
- Set<SolutionEntityItem> projects = new Set<SolutionEntityItem> ();
+ Set<SolutionItem> projects = new Set<SolutionItem> ();
foreach (ITreeNavigator node in CurrentNodes) {
ProjectFile file = (ProjectFile) node.DataItem;
@@ -464,7 +457,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
}
}
- IdeApp.ProjectOperations.Save (projects);
+ IdeApp.ProjectOperations.SaveAsync (projects);
}
[CommandUpdateHandler (FileCommands.CopyToOutputDirectory)]
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolder.cs
index ed643cf77a..187eb0619d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolder.cs
@@ -39,15 +39,15 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public class ProjectFolder: IDisposable, IFolderItem
{
FilePath absolutePath;
- IWorkspaceObject parentWorkspaceObject;
+ WorkspaceObject parentWorkspaceObject;
object parent;
bool trackChanges;
- public ProjectFolder (FilePath absolutePath, IWorkspaceObject parentWorkspaceObject): this (absolutePath, parentWorkspaceObject, null)
+ public ProjectFolder (FilePath absolutePath, WorkspaceObject parentWorkspaceObject): this (absolutePath, parentWorkspaceObject, null)
{
}
- public ProjectFolder (FilePath absolutePath, IWorkspaceObject parentWorkspaceObject, object parent)
+ public ProjectFolder (FilePath absolutePath, WorkspaceObject parentWorkspaceObject, object parent)
{
this.parent = parent;
this.parentWorkspaceObject = parentWorkspaceObject;
@@ -61,9 +61,9 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
if (trackChanges != value) {
trackChanges = value;
if (trackChanges)
- FileService.FileRenamed += new EventHandler<FileCopyEventArgs> (OnFileRenamed);
+ FileService.FileRenamed += OnFileRenamed;
else
- FileService.FileRenamed -= new EventHandler<FileCopyEventArgs> (OnFileRenamed);
+ FileService.FileRenamed -= OnFileRenamed;
}
}
}
@@ -80,7 +80,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
get { return absolutePath.FileName; }
}
- public IWorkspaceObject ParentWorkspaceObject {
+ public WorkspaceObject ParentWorkspaceObject {
get { return parentWorkspaceObject; }
}
@@ -119,7 +119,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public void Dispose ()
{
- FileService.FileRenamed -= new EventHandler<FileCopyEventArgs> (OnFileRenamed);
+ FileService.FileRenamed -= OnFileRenamed;
}
public void Remove ()
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs
index 28c623f1cf..ebe5b7fd6a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs
@@ -47,9 +47,6 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
Xwt.Drawing.Image folderOpenIcon;
Xwt.Drawing.Image folderClosedIcon;
- EventHandler<FileCopyEventArgs> fileRenamedHandler;
- EventHandler<FileEventArgs> fileRemovedHandler;
-
public override Type NodeDataType {
get { return typeof(ProjectFolder); }
}
@@ -74,17 +71,14 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
folderOpenIcon = Context.GetIcon (Stock.OpenFolder);
folderClosedIcon = Context.GetIcon (Stock.ClosedFolder);
-
- fileRenamedHandler = DispatchService.GuiDispatch<EventHandler<FileCopyEventArgs>> (OnFolderRenamed);
- fileRemovedHandler = DispatchService.GuiDispatch<EventHandler<FileEventArgs>> (OnFolderRemoved);
}
public override void OnNodeAdded (object dataObject)
{
base.OnNodeAdded (dataObject);
ProjectFolder folder = (ProjectFolder) dataObject;
- folder.FolderRenamed += fileRenamedHandler;
- folder.FolderRemoved += fileRemovedHandler;
+ folder.FolderRenamed += OnFolderRenamed;
+ folder.FolderRemoved += OnFolderRemoved;
folder.TrackChanges = true;
}
@@ -92,8 +86,8 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
{
base.OnNodeRemoved (dataObject);
ProjectFolder folder = (ProjectFolder) dataObject;
- folder.FolderRenamed -= fileRenamedHandler;
- folder.FolderRemoved -= fileRemovedHandler;
+ folder.FolderRenamed -= OnFolderRenamed;
+ folder.FolderRemoved -= OnFolderRemoved;
folder.Dispose ();
}
@@ -149,7 +143,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
return ((ProjectFolder)dataObject).Path;
}
- public override void RenameItem (string newName)
+ public async override void RenameItem (string newName)
{
ProjectFolder folder = (ProjectFolder) CurrentNode.DataItem as ProjectFolder;
string oldFoldername = folder.Path;
@@ -157,7 +151,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
if (oldFoldername != newFoldername) {
try {
- if (!FileService.IsValidPath (newFoldername)) {
+ if (!FileService.IsValidPath (newFoldername) || ContainsDirectorySeparator (newName)) {
MessageService.ShowWarning (GettextCatalog.GetString ("The name you have chosen contains illegal characters. Please choose a different name."));
return;
}
@@ -174,7 +168,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
FileService.RenameDirectory (oldFoldername, newName);
if (folder.Project != null)
- IdeApp.ProjectOperations.Save (folder.Project);
+ await IdeApp.ProjectOperations.SaveAsync (folder.Project);
} catch (System.ArgumentException) { // new file name with wildcard (*, ?) characters in it
MessageService.ShowWarning (GettextCatalog.GetString ("The name you have chosen contains illegal characters. Please choose a different name."));
@@ -183,10 +177,10 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
}
}
}
-
+
public override void DeleteMultipleItems ()
{
- var projects = new Set<SolutionEntityItem> ();
+ var projects = new Set<SolutionItem> ();
var folders = new List<ProjectFolder> ();
foreach (ITreeNavigator node in CurrentNodes)
folders.Add ((ProjectFolder) node.DataItem);
@@ -273,7 +267,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
}
}
}
- IdeApp.ProjectOperations.Save (projects);
+ IdeApp.ProjectOperations.SaveAsync (projects);
}
static void DeleteFolder (ProjectFolder folder)
@@ -299,7 +293,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
[AllowMultiSelection]
public void IncludeToProject ()
{
- Set<SolutionEntityItem> projects = new Set<SolutionEntityItem> ();
+ Set<SolutionItem> projects = new Set<SolutionItem> ();
foreach (ITreeNavigator node in CurrentNodes) {
Project project = node.GetParentDataItem (typeof(Project), true) as Project;
if (node.HasChildren ()) {
@@ -319,7 +313,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
}
}
}
- IdeApp.ProjectOperations.Save (projects);
+ IdeApp.ProjectOperations.SaveAsync (projects);
}
[CommandUpdateHandler (ProjectCommands.IncludeToProject)]
@@ -376,6 +370,10 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
return true;
return false;
}
-
+
+ internal static bool ContainsDirectorySeparator (string name)
+ {
+ return name.Contains (Path.DirectorySeparatorChar) || name.Contains (Path.AltDirectorySeparatorChar);
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs
index 28ac0a8e8a..275e555542 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs
@@ -45,13 +45,6 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
{
class ProjectNodeBuilder: FolderNodeBuilder
{
- ProjectFileEventHandler fileAddedHandler;
- ProjectFileEventHandler fileRemovedHandler;
- ProjectFileRenamedEventHandler fileRenamedHandler;
- ProjectFileEventHandler filePropertyChangedHandler;
- SolutionItemModifiedEventHandler projectChanged;
- EventHandler<FileEventArgs> deletedHandler;
-
public override Type NodeDataType {
get { return typeof(Project); }
}
@@ -62,43 +55,36 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
protected override void Initialize ()
{
- fileAddedHandler = (ProjectFileEventHandler) DispatchService.GuiDispatch (new ProjectFileEventHandler (OnAddFile));
- fileRemovedHandler = (ProjectFileEventHandler) DispatchService.GuiDispatch (new ProjectFileEventHandler (OnRemoveFile));
- filePropertyChangedHandler = (ProjectFileEventHandler) DispatchService.GuiDispatch (new ProjectFileEventHandler (OnFilePropertyChanged));
- fileRenamedHandler = (ProjectFileRenamedEventHandler) DispatchService.GuiDispatch (new ProjectFileRenamedEventHandler (OnRenameFile));
- projectChanged = (SolutionItemModifiedEventHandler) DispatchService.GuiDispatch (new SolutionItemModifiedEventHandler (OnProjectModified));
- deletedHandler = (EventHandler<FileEventArgs>) DispatchService.GuiDispatch (new EventHandler<FileEventArgs> (OnSystemFileDeleted));
-
- IdeApp.Workspace.FileAddedToProject += fileAddedHandler;
- IdeApp.Workspace.FileRemovedFromProject += fileRemovedHandler;
- IdeApp.Workspace.FileRenamedInProject += fileRenamedHandler;
- IdeApp.Workspace.FilePropertyChangedInProject += filePropertyChangedHandler;
+ IdeApp.Workspace.FileAddedToProject += OnAddFile;
+ IdeApp.Workspace.FileRemovedFromProject += OnRemoveFile;
+ IdeApp.Workspace.FileRenamedInProject += OnRenameFile;
+ IdeApp.Workspace.FilePropertyChangedInProject += OnFilePropertyChanged;
IdeApp.Workspace.ActiveConfigurationChanged += IdeAppWorkspaceActiveConfigurationChanged;
- FileService.FileRemoved += deletedHandler;
+ FileService.FileRemoved += OnSystemFileDeleted;
}
public override void Dispose ()
{
- IdeApp.Workspace.FileAddedToProject -= fileAddedHandler;
- IdeApp.Workspace.FileRemovedFromProject -= fileRemovedHandler;
- IdeApp.Workspace.FileRenamedInProject -= fileRenamedHandler;
- IdeApp.Workspace.FilePropertyChangedInProject -= filePropertyChangedHandler;
+ IdeApp.Workspace.FileAddedToProject -= OnAddFile;
+ IdeApp.Workspace.FileRemovedFromProject -= OnRemoveFile;
+ IdeApp.Workspace.FileRenamedInProject -= OnRenameFile;
+ IdeApp.Workspace.FilePropertyChangedInProject -= OnFilePropertyChanged;
IdeApp.Workspace.ActiveConfigurationChanged -= IdeAppWorkspaceActiveConfigurationChanged;
- FileService.FileRemoved -= deletedHandler;
+ FileService.FileRemoved -= OnSystemFileDeleted;
}
public override void OnNodeAdded (object dataObject)
{
base.OnNodeAdded (dataObject);
Project project = (Project) dataObject;
- project.Modified += projectChanged;
+ project.Modified += OnProjectModified;
}
public override void OnNodeRemoved (object dataObject)
{
base.OnNodeRemoved (dataObject);
Project project = (Project) dataObject;
- project.Modified -= projectChanged;
+ project.Modified -= OnProjectModified;
}
public override string GetNodeName (ITreeNavigator thisNode, object dataObject)
@@ -129,7 +115,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
} else if (p is UnknownProject) {
var up = (UnknownProject)p;
nodeInfo.StatusSeverity = TaskSeverity.Warning;
- nodeInfo.StatusMessage = up.LoadError.TrimEnd ('.');
+ nodeInfo.StatusMessage = up.UnsupportedProjectMessage.TrimEnd ('.');
nodeInfo.Label = escapedProjectName;
nodeInfo.DisabledStyle = true;
nodeInfo.Icon = Context.GetIcon (p.StockIcon);
@@ -177,7 +163,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public override object GetParentObject (object dataObject)
{
- SolutionItem it = (SolutionItem) dataObject;
+ SolutionFolderItem it = (SolutionFolderItem) dataObject;
if (it.ParentFolder == null)
return null;
@@ -381,7 +367,8 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public override void RenameItem (string newName)
{
Project project = (Project) CurrentNode.DataItem;
- IdeApp.ProjectOperations.RenameItem (project, newName);
+ if (project.Name != newName)
+ IdeApp.ProjectOperations.RenameItem (project, newName);
}
public override void ActivateItem ()
@@ -394,23 +381,19 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public void UpdateSetAsStartupProject (CommandInfo ci)
{
Project project = (Project) CurrentNode.DataItem;
-
- // This should check for SupportsExecute only, but we keep the call to CanExecute in order to
- // be backwards compatible with the old behavior.
- // TODO NPM: Remove the CanExecute call
- ci.Visible = project.SupportsExecute () || project.CanExecute (new ExecutionContext (Runtime.ProcessService.DefaultExecutionHandler, null, IdeApp.Workspace.ActiveExecutionTarget), IdeApp.Workspace.ActiveConfiguration);
+ ci.Visible = project.SupportsExecute ();
}
[CommandHandler (ProjectCommands.SetAsStartupProject)]
- public void SetAsStartupProject ()
+ public async void SetAsStartupProject ()
{
Project project = CurrentNode.DataItem as Project;
project.ParentSolution.StartupItem = project;
if (!project.ParentSolution.SingleStartup) {
project.ParentSolution.SingleStartup = true;
- IdeApp.ProjectOperations.Save (project.ParentSolution);
+ await IdeApp.ProjectOperations.SaveAsync (project.ParentSolution);
} else
- project.ParentSolution.SaveUserProperties ();
+ await project.ParentSolution.SaveUserProperties ();
}
public override void DeleteItem ()
@@ -420,11 +403,11 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
}
[CommandHandler (ProjectCommands.AddReference)]
- public void AddReferenceToProject ()
+ public async void AddReferenceToProject ()
{
DotNetProject p = (DotNetProject) CurrentNode.DataItem;
if (IdeApp.ProjectOperations.AddReferenceToProject (p))
- IdeApp.ProjectOperations.Save (p);
+ await IdeApp.ProjectOperations.SaveAsync (p);
}
[CommandUpdateHandler (ProjectCommands.AddReference)]
@@ -437,7 +420,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
[AllowMultiSelection]
public void OnReload ()
{
- using (IProgressMonitor m = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
+ using (ProgressMonitor m = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
m.BeginTask (null, CurrentNodes.Length);
foreach (ITreeNavigator nav in CurrentNodes) {
Project p = (Project) nav.DataItem;
@@ -462,21 +445,21 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
[CommandHandler (ProjectCommands.Unload)]
[AllowMultiSelection]
- public void OnUnload ()
+ public async void OnUnload ()
{
HashSet<Solution> solutions = new HashSet<Solution> ();
- using (IProgressMonitor m = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
+ using (ProgressMonitor m = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
m.BeginTask (null, CurrentNodes.Length);
foreach (ITreeNavigator nav in CurrentNodes) {
Project p = (Project) nav.DataItem;
p.Enabled = false;
- p.ParentFolder.ReloadItem (m, p);
- m.Step (1);
solutions.Add (p.ParentSolution);
+ await p.ParentFolder.ReloadItem (m, p);
+ m.Step (1);
}
m.EndTask ();
}
- IdeApp.ProjectOperations.Save (solutions);
+ await IdeApp.ProjectOperations.SaveAsync (solutions);
}
[CommandUpdateHandler (ProjectCommands.Unload)]
@@ -486,17 +469,18 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
}
[CommandHandler (ProjectCommands.EditSolutionItem)]
+ [AllowMultiSelection]
public void OnEditProject ()
{
- var project = (Project) CurrentNode.DataItem;
- IdeApp.Workbench.OpenDocument (project.FileName, project);
+ foreach (var nav in CurrentNodes) {
+ IdeApp.Workbench.OpenDocument (((Project)nav.DataItem).FileName, (Project)nav.DataItem);
+ }
}
[CommandUpdateHandler (ProjectCommands.EditSolutionItem)]
public void OnEditProjectUpdate (CommandInfo info)
{
- var project = (Project) CurrentNode.DataItem;
- info.Visible = info.Enabled = !string.IsNullOrEmpty (project.FileName) && File.Exists (project.FileName);
+ info.Visible = info.Enabled = CurrentNodes.All (nav => File.Exists (((Project)nav.DataItem).FileName));
}
public override DragOperation CanDragNode ()
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectPadContextMenu.addin.xml b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectPadContextMenu.addin.xml
index 304927aa95..25c1e58947 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectPadContextMenu.addin.xml
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectPadContextMenu.addin.xml
@@ -26,7 +26,7 @@
<!-- Actions Section -->
<SeparatorItem id = "ActionsSectionStart" />
- <Condition id="ItemType" value="ProjectReference|ProjectFile|SystemFile">
+ <Condition id="ItemType" value="ProjectReference|ProjectFile|SystemFile|MonoDevelop.Ide.Gui.Pads.ProjectPad.SolutionFolderFileNode">
<ItemSet id = "OpenWith" _label = "Open _With" autohide="true">
<CommandItem id = "MonoDevelop.Ide.Commands.ViewCommands.OpenWithList" />
</ItemSet>
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceFolderNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceFolderNodeBuilder.cs
index 178ce4413c..1a01f93d4b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceFolderNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceFolderNodeBuilder.cs
@@ -40,9 +40,6 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
{
class ProjectReferenceFolderNodeBuilder: TypeNodeBuilder
{
- ProjectReferenceEventHandler addedHandler;
- ProjectReferenceEventHandler removedHandler;
-
public override Type NodeDataType {
get { return typeof(ProjectReferenceCollection); }
}
@@ -58,17 +55,14 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
protected override void Initialize ()
{
- addedHandler = DispatchService.GuiDispatch<ProjectReferenceEventHandler> (OnAddReference);
- removedHandler = DispatchService.GuiDispatch<ProjectReferenceEventHandler> (OnRemoveReference);
-
- IdeApp.Workspace.ReferenceAddedToProject += addedHandler;
- IdeApp.Workspace.ReferenceRemovedFromProject += removedHandler;
+ IdeApp.Workspace.ReferenceAddedToProject += OnAddReference;
+ IdeApp.Workspace.ReferenceRemovedFromProject += OnRemoveReference;
}
public override void Dispose ()
{
- IdeApp.Workspace.ReferenceAddedToProject -= addedHandler;
- IdeApp.Workspace.ReferenceRemovedFromProject -= removedHandler;
+ IdeApp.Workspace.ReferenceAddedToProject -= OnAddReference;
+ IdeApp.Workspace.ReferenceRemovedFromProject -= OnRemoveReference;
}
public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo)
@@ -81,19 +75,21 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public override void BuildChildNodes (ITreeBuilder ctx, object dataObject)
{
ProjectReferenceCollection refs = (ProjectReferenceCollection) dataObject;
- foreach (ProjectReference pref in refs)
- ctx.AddChild (pref);
+ ctx.AddChildren (refs);
// For portable libraries, add node that represents all framework assemblies
- var project = ctx.GetParentDataItem (typeof(DotNetProject), false) as PortableDotNetProject;
- if (project != null)
+ var project = (DotNetProject) ctx.GetParentDataItem (typeof(DotNetProject), false);
+ if (project != null && project.IsPortableLibrary)
ctx.AddChild (new PortableFrameworkSubset (project));
}
public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
{
- return ((ProjectReferenceCollection) dataObject).Count > 0
- || builder.GetParentDataItem (typeof(DotNetProject), false) is PortableDotNetProject;
+ if (((ProjectReferenceCollection) dataObject).Count > 0)
+ return true;
+
+ var p = (DotNetProject) builder.GetParentDataItem (typeof(DotNetProject), true);
+ return p != null && p.IsPortableLibrary;
}
public override int CompareObjects (ITreeNavigator thisNode, ITreeNavigator otherNode)
@@ -129,14 +125,14 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
return dataObject is ProjectReference || dataObject is Project;
}
- public override void OnNodeDrop (object dataObject, DragOperation operation)
+ public async override void OnNodeDrop (object dataObject, DragOperation operation)
{
// It allows dropping either project references or projects.
// Dropping a project creates a new project reference to that project
DotNetProject project = dataObject as DotNetProject;
if (project != null) {
- ProjectReference pr = new ProjectReference (project);
+ ProjectReference pr = ProjectReference.CreateProjectReference (project);
DotNetProject p = CurrentNode.GetParentDataItem (typeof(DotNetProject), false) as DotNetProject;
// Circular dependencies are not allowed.
if (HasCircularReference (project, p.Name))
@@ -146,7 +142,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
if (ProjectReferencesProject (p, project.Name))
return;
p.References.Add (pr);
- IdeApp.ProjectOperations.Save (p);
+ await IdeApp.ProjectOperations.SaveAsync (p);
return;
}
@@ -166,7 +162,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
// Check if there is a cyclic reference after removing from the source project
if (pref.ReferenceType == ReferenceType.Project) {
- DotNetProject pdest = p.ParentSolution.FindProjectByName (pref.Reference) as DotNetProject;
+ DotNetProject pdest = pref.ResolveProject (p.ParentSolution) as DotNetProject;
if (pdest == null || ProjectReferencesProject (pdest, p2.Name)) {
// Restore the dep
p.References.Add (pref);
@@ -175,15 +171,15 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
}
p2.References.Add (pref);
- IdeApp.ProjectOperations.Save (p);
- IdeApp.ProjectOperations.Save (p2);
+ await IdeApp.ProjectOperations.SaveAsync (p);
+ await IdeApp.ProjectOperations.SaveAsync (p2);
} else {
nav.MoveToParent (typeof(DotNetProject));
DotNetProject p = nav.DataItem as DotNetProject;
// Check for cyclic referencies
if (pref.ReferenceType == ReferenceType.Project) {
- DotNetProject pdest = p.ParentSolution.FindProjectByName (pref.Reference) as DotNetProject;
+ DotNetProject pdest = pref.ResolveProject (p.ParentSolution) as DotNetProject;
if (pdest == null)
return;
if (HasCircularReference (pdest, p.Name))
@@ -194,7 +190,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
return;
}
p.References.Add ((ProjectReference) pref.Clone ());
- IdeApp.ProjectOperations.Save (p);
+ await IdeApp.ProjectOperations.SaveAsync (p);
}
}
@@ -204,12 +200,12 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
}
[CommandHandler (ProjectCommands.AddReference)]
- public void AddReferenceToProject ()
+ public async void AddReferenceToProject ()
{
DotNetProject p = (DotNetProject) CurrentNode.GetParentDataItem (typeof(DotNetProject), false);
if (IdeApp.ProjectOperations.AddReferenceToProject (p)) {
- IdeApp.ProjectOperations.Save (p);
CurrentNode.Expanded = true;
+ await IdeApp.ProjectOperations.SaveAsync (p);
}
}
@@ -227,7 +223,10 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
return true;
foreach (ProjectReference pr in project.References) {
- DotNetProject pref = project.ParentSolution.FindProjectByName (pr.Reference) as DotNetProject;
+ if (pr.ReferenceType != ReferenceType.Project) {
+ continue;
+ }
+ DotNetProject pref = pr.ResolveProject (project.ParentSolution) as DotNetProject;
if (pref != null && ProjectReferencesProject (pref, targetProject))
return true;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs
index 20a03b5aa4..9a4ab8fb22 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectReferenceNodeBuilder.cs
@@ -130,7 +130,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
}
}
- public override void DeleteMultipleItems ()
+ public async override void DeleteMultipleItems ()
{
Dictionary<Project,Project> projects = new Dictionary<Project,Project> ();
foreach (ITreeNavigator nav in CurrentNodes) {
@@ -140,12 +140,12 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
projects [project] = project;
}
foreach (Project p in projects.Values)
- IdeApp.ProjectOperations.Save (p);
+ await IdeApp.ProjectOperations.SaveAsync (p);
}
[CommandHandler (ProjectCommands.LocalCopyReference)]
[AllowMultiSelection]
- public void ChangeLocalReference ()
+ public async void ChangeLocalReference ()
{
var projects = new Dictionary<Project,Project> ();
ProjectReference firstRef = null;
@@ -162,7 +162,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
projects [project] = project;
}
foreach (Project p in projects.Values)
- IdeApp.ProjectOperations.Save (p);
+ await IdeApp.ProjectOperations.SaveAsync (p);
}
[CommandUpdateHandler (ProjectCommands.LocalCopyReference)]
@@ -184,7 +184,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
[CommandHandler (ProjectCommands.SpecificAssemblyVersion)]
[AllowMultiSelection]
- public void RequireSpecificAssemblyVersion ()
+ public async void RequireSpecificAssemblyVersion ()
{
var projects = new Dictionary<Project,Project> ();
ProjectReference firstRef = null;
@@ -201,7 +201,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
projects [project] = project;
}
foreach (Project p in projects.Values)
- IdeApp.ProjectOperations.Save (p);
+ await IdeApp.ProjectOperations.SaveAsync (p);
}
[CommandUpdateHandler (ProjectCommands.SpecificAssemblyVersion)]
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectSolutionPad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectSolutionPad.cs
index f02e12a259..fb573226f2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectSolutionPad.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectSolutionPad.cs
@@ -57,7 +57,6 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
}
return null;
});
- TreeView.ShowSelectionPopupButton = true;
}
protected override void OnSelectionChanged (object sender, EventArgs args)
@@ -67,7 +66,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
if (nav != null) {
WorkspaceItem c = (WorkspaceItem) nav.GetParentDataItem (typeof(WorkspaceItem), true);
IdeApp.ProjectOperations.CurrentSelectedWorkspaceItem = c;
- SolutionItem ce = (SolutionItem) nav.GetParentDataItem (typeof(SolutionItem), true);
+ SolutionFolderItem ce = (SolutionFolderItem) nav.GetParentDataItem (typeof(SolutionFolderItem), true);
IdeApp.ProjectOperations.CurrentSelectedSolutionItem = ce;
IdeApp.ProjectOperations.CurrentSelectedItem = nav.DataItem;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs
index f7dcdfd1d1..ce9ad03088 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ShowAllFilesBuilderExtension.cs
@@ -35,18 +35,12 @@ using MonoDevelop.Projects;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Components;
-
+using System.Linq;
+
namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
{
class ShowAllFilesBuilderExtension: NodeBuilderExtension
{
- ProjectFileEventHandler fileAddedHandler;
- ProjectFileEventHandler fileRemovedHandler;
-
- EventHandler<FileEventArgs> createdHandler;
- EventHandler<FileEventArgs> deletedHandler;
- EventHandler<FileCopyEventArgs> renamedHandler;
-
List<Project> projects = new List<Project> ();
public override bool CanBuildNode (Type dataType)
@@ -63,28 +57,21 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
protected override void Initialize ()
{
- fileAddedHandler = (ProjectFileEventHandler) DispatchService.GuiDispatch (new ProjectFileEventHandler (OnAddFile));
- fileRemovedHandler = (ProjectFileEventHandler) DispatchService.GuiDispatch (new ProjectFileEventHandler (OnRemoveFile));
-
- createdHandler = (EventHandler<FileEventArgs>) DispatchService.GuiDispatch (new EventHandler<FileEventArgs> (OnSystemFileAdded));
- deletedHandler = (EventHandler<FileEventArgs>) DispatchService.GuiDispatch (new EventHandler<FileEventArgs> (OnSystemFileDeleted));
- renamedHandler = (EventHandler<FileCopyEventArgs>) DispatchService.GuiDispatch (new EventHandler<FileCopyEventArgs> (OnSystemFileRenamed));
-
- IdeApp.Workspace.FileAddedToProject += fileAddedHandler;
- IdeApp.Workspace.FileRemovedFromProject += fileRemovedHandler;
+ IdeApp.Workspace.FileAddedToProject += OnAddFile;
+ IdeApp.Workspace.FileRemovedFromProject += OnRemoveFile;
- FileService.FileRenamed += renamedHandler;
- FileService.FileRemoved += deletedHandler;
- FileService.FileCreated += createdHandler;
+ FileService.FileRenamed += OnSystemFileRenamed;
+ FileService.FileRemoved += OnSystemFileDeleted;
+ FileService.FileCreated += OnSystemFileAdded;
}
public override void Dispose ()
{
- IdeApp.Workspace.FileAddedToProject -= fileAddedHandler;
- IdeApp.Workspace.FileRemovedFromProject -= fileRemovedHandler;
- FileService.FileRenamed -= renamedHandler;
- FileService.FileRemoved -= deletedHandler;
- FileService.FileCreated -= createdHandler;
+ IdeApp.Workspace.FileAddedToProject -= OnAddFile;
+ IdeApp.Workspace.FileRemovedFromProject -= OnRemoveFile;
+ FileService.FileRenamed -= OnSystemFileRenamed;
+ FileService.FileRemoved -= OnSystemFileDeleted;
+ FileService.FileCreated -= OnSystemFileAdded;
}
public override void OnNodeAdded (object dataObject)
@@ -149,15 +136,14 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
folderFiles = ((Solution)dataObject).RootFolder.Files;
else if (dataObject is SolutionFolder)
folderFiles = ((SolutionFolder)dataObject).Files;
-
- foreach (string file in Directory.GetFiles (path)) {
- if ((project == null || project.Files.GetFile (file) == null) && (folderFiles == null || !folderFiles.Contains (file)))
- builder.AddChild (new SystemFile (file, project));
- }
-
- foreach (string folder in Directory.GetDirectories (path))
- if (!builder.HasChild (Path.GetFileName (folder), typeof(ProjectFolder)))
- builder.AddChild (new ProjectFolder (folder, project));
+
+ builder.AddChildren (Directory.EnumerateFiles (path)
+ .Where (file => (project == null || project.Files.GetFile (file) == null) && (folderFiles == null || !folderFiles.Contains (file)))
+ .Select (file => new SystemFile (file, project)));
+
+ builder.AddChildren (Directory.EnumerateDirectories (path)
+ .Where (folder => !builder.HasChild (Path.GetFileName (folder), typeof (ProjectFolder)))
+ .Select (folder => new ProjectFolder (folder, project)));
}
}
@@ -366,7 +352,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
if (targetPath == source)
targetPath = ProjectOperations.GetTargetCopyName (targetPath, false);
- using (IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor (GettextCatalog.GetString("Copying files..."), Stock.StatusWorking, true))
+ using (ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor (GettextCatalog.GetString("Copying files..."), Stock.StatusWorking, true))
{
bool move = operation == DragOperation.Move;
IdeApp.ProjectOperations.TransferFiles (monitor, null, source, targetProject, targetPath, move, false);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderFileNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderFileNodeBuilder.cs
index a324c03715..3fa984982e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderFileNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderFileNodeBuilder.cs
@@ -113,19 +113,34 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
}
}
- IdeApp.ProjectOperations.Save (modifiedSolutionsToSave);
+ IdeApp.ProjectOperations.SaveAsync (modifiedSolutionsToSave);
}
public override void ActivateItem ()
{
SolutionFolderFileNode file = (SolutionFolderFileNode) CurrentNode.DataItem;
- IdeApp.Workbench.OpenDocument (file.FileName);
+ IdeApp.Workbench.OpenDocument (file.FileName, project: null);
}
public override DragOperation CanDragNode ()
{
return DragOperation.Copy | DragOperation.Move;
}
+
+ [CommandHandler (ViewCommands.OpenWithList)]
+ public void OnOpenWith (object ob)
+ {
+ var finfo = (SolutionFolderFileNode)CurrentNode.DataItem;
+ ((FileViewer)ob).OpenFile (finfo.FileName);
+ }
+
+ [CommandUpdateHandler (ViewCommands.OpenWithList)]
+ public void OnOpenWithUpdate (CommandArrayInfo info)
+ {
+ var pf = (SolutionFolderFileNode)CurrentNode.DataItem;
+ ProjectFileNodeCommandHandler.PopulateOpenWithViewers (info, null, pf.FileName);
+ }
+
}
class SolutionFolderFileNode: IFileItem
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs
index 21aba0b470..9401cb7182 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionFolderNodeBuilder.cs
@@ -1,32 +1,33 @@
-//
-// SolutionFolderNodeBuilder.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
+//
+// SolutionFolderNodeBuilder.cs
+//
+// Author:
+// Lluis Sanchez Gual
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Linq;
using MonoDevelop.Projects;
using MonoDevelop.Core;
@@ -39,21 +40,6 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
{
class SolutionFolderNodeBuilder: TypeNodeBuilder
{
- SolutionItemRenamedEventHandler nameChanged;
- SolutionItemChangeEventHandler entryAdded;
- SolutionItemChangeEventHandler entryRemoved;
- EventHandler<SolutionItemFileEventArgs> fileAdded;
- EventHandler<SolutionItemFileEventArgs> fileRemoved;
-
- public SolutionFolderNodeBuilder ()
- {
- nameChanged = DispatchService.GuiDispatch<SolutionItemRenamedEventHandler> (OnSolutionFolderRenamed);
- entryAdded = DispatchService.GuiDispatch<SolutionItemChangeEventHandler> (OnEntryAdded);
- entryRemoved = DispatchService.GuiDispatch<SolutionItemChangeEventHandler> (OnEntryRemoved);
- fileAdded = DispatchService.GuiDispatch<EventHandler<SolutionItemFileEventArgs>> (OnFileAdded);
- fileRemoved = DispatchService.GuiDispatch<EventHandler<SolutionItemFileEventArgs>> (OnFileRemoved);
- }
-
public override Type NodeDataType {
get { return typeof(SolutionFolder); }
}
@@ -82,11 +68,9 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public override void BuildChildNodes (ITreeBuilder ctx, object dataObject)
{
- SolutionFolder folder = (SolutionFolder) dataObject;
- foreach (SolutionItem entry in folder.Items)
- ctx.AddChild (entry);
- foreach (FilePath file in folder.Files)
- ctx.AddChild (new SolutionFolderFileNode (file, folder));
+ SolutionFolder folder = (SolutionFolder) dataObject;
+ ctx.AddChildren (folder.Items);
+ ctx.AddChildren (folder.Files.Select (file => new SolutionFolderFileNode (file, folder)));
}
public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
@@ -112,21 +96,21 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public override void OnNodeAdded (object dataObject)
{
SolutionFolder folder = (SolutionFolder) dataObject;
- folder.NameChanged += nameChanged;
- folder.ItemAdded += entryAdded;
- folder.ItemRemoved += entryRemoved;
- folder.SolutionItemFileAdded += fileAdded;
- folder.SolutionItemFileRemoved += fileRemoved;
+ folder.NameChanged += OnSolutionFolderRenamed;
+ folder.ItemAdded += OnEntryAdded;
+ folder.ItemRemoved += OnEntryRemoved;
+ folder.SolutionItemFileAdded += OnFileAdded;
+ folder.SolutionItemFileRemoved += OnFileRemoved;
}
public override void OnNodeRemoved (object dataObject)
{
SolutionFolder folder = (SolutionFolder) dataObject;
- folder.NameChanged -= nameChanged;
- folder.ItemAdded -= entryAdded;
- folder.ItemRemoved -= entryRemoved;
- folder.SolutionItemFileAdded -= fileAdded;
- folder.SolutionItemFileRemoved -= fileRemoved;
+ folder.NameChanged -= OnSolutionFolderRenamed;
+ folder.ItemAdded -= OnEntryAdded;
+ folder.ItemRemoved -= OnEntryRemoved;
+ folder.SolutionItemFileAdded -= OnFileAdded;
+ folder.SolutionItemFileRemoved -= OnFileRemoved;
}
void OnSolutionFolderRenamed (object sender, SolutionItemRenamedEventArgs e)
@@ -135,17 +119,27 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
if (tb != null) tb.Update ();
}
- void OnEntryAdded (object sender, SolutionItemEventArgs e)
+ void OnEntryAdded (object sender, SolutionItemChangeEventArgs e)
{
ITreeBuilder tb = Context.GetTreeBuilder (e.SolutionItem.ParentFolder);
if (tb != null) {
- tb.AddChild (e.SolutionItem, true);
- tb.Expanded = true;
+ if (e.Reloading)
+ // When reloading we ignore the removed event, and we do an UpdateAll here. This will
+ // replace the reloaded instance and will preserve the tree status
+ tb.UpdateAll ();
+ else {
+ tb.AddChild (e.SolutionItem, true);
+ tb.Expanded = true;
+ }
}
}
- void OnEntryRemoved (object sender, SolutionItemEventArgs e)
+ void OnEntryRemoved (object sender, SolutionItemChangeEventArgs e)
{
+ // If reloading, ignore the event. We handle it in OnEntryAdded.
+ if (e.Reloading)
+ return;
+
ITreeBuilder tb = Context.GetTreeBuilder (e.SolutionItem);
if (tb != null)
tb.Remove ();
@@ -178,7 +172,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
CurrentNode.Expanded = !CurrentNode.Expanded;
}
- public override void RenameItem (string newName)
+ public async override void RenameItem (string newName)
{
if (newName.IndexOfAny (new char [] { '\'', '(', ')', '"', '{', '}', '|' } ) != -1) {
MessageService.ShowError (GettextCatalog.GetString ("Solution name may not contain any of the following characters: {0}", "', (, ), \", {, }, |"));
@@ -186,8 +180,10 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
}
SolutionFolder folder = (SolutionFolder) CurrentNode.DataItem;
- folder.Name = newName;
- IdeApp.Workspace.Save();
+ if (folder.Name != newName) {
+ folder.Name = newName;
+ await IdeApp.Workspace.SaveAsync ();
+ }
}
public override DragOperation CanDragNode ()
@@ -199,15 +195,15 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
{
if (dataObject is IFileItem)
return true;
- SolutionItem it = dataObject as SolutionItem;
+ SolutionFolderItem it = dataObject as SolutionFolderItem;
return it != null && operation == DragOperation.Move;
}
- public override void OnNodeDrop (object dataObject, DragOperation operation)
+ public async override void OnNodeDrop (object dataObject, DragOperation operation)
{
SolutionFolder folder = (SolutionFolder) CurrentNode.DataItem;
- if (dataObject is SolutionItem) {
- SolutionItem it = (SolutionItem) dataObject;
+ if (dataObject is SolutionFolderItem) {
+ SolutionFolderItem it = (SolutionFolderItem) dataObject;
if (!MessageService.Confirm (GettextCatalog.GetString ("Are you sure you want to move the item '{0}' to the solution folder '{1}'?", it.Name, folder.Name), AlertButton.Move))
return;
@@ -218,7 +214,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
DropFile (folder, (IFileItem) dataObject, operation);
}
- IdeApp.ProjectOperations.Save (folder.ParentSolution);
+ await IdeApp.ProjectOperations.SaveAsync (folder.ParentSolution);
}
internal static void DropFile (SolutionFolder folder, IFileItem fileItem, DragOperation operation)
@@ -250,7 +246,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
IdeApp.ProjectOperations.ShowOptions (folder);
}
- public override void DeleteItem ()
+ public async override void DeleteItem ()
{
SolutionFolder folder = CurrentNode.DataItem as SolutionFolder;
SolutionFolder parent = folder.ParentFolder;
@@ -261,7 +257,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
Solution sol = folder.ParentSolution;
parent.Items.Remove (folder);
folder.Dispose ();
- IdeApp.ProjectOperations.Save (sol);
+ await IdeApp.ProjectOperations.SaveAsync (sol);
}
}
@@ -269,20 +265,23 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public void AddNewProjectToSolutionFolder()
{
SolutionFolder folder = (SolutionFolder) CurrentNode.DataItem;
- SolutionItem ce = IdeApp.ProjectOperations.CreateProject (folder);
+ SolutionFolderItem ce = IdeApp.ProjectOperations.CreateProject (folder);
if (ce == null) return;
Tree.AddNodeInsertCallback (ce, new TreeNodeCallback (OnEntryInserted));
CurrentNode.Expanded = true;
}
[CommandHandler (ProjectCommands.AddProject)]
- public void AddProjectToSolutionFolder()
+ public async void AddProjectToSolutionFolder()
{
SolutionFolder folder = (SolutionFolder) CurrentNode.DataItem;
- SolutionItem ce = IdeApp.ProjectOperations.AddSolutionItem (folder);
- if (ce == null) return;
- Tree.AddNodeInsertCallback (ce, new TreeNodeCallback (OnEntryInserted));
- CurrentNode.Expanded = true;
+ var item = await IdeApp.ProjectOperations.AddSolutionItem (folder);
+ if (item != null) {
+ Tree.AddNodeInsertCallback (item, new TreeNodeCallback (OnEntryInserted));
+ var node = Tree.GetNodeAtObject (folder);
+ if (node != null)
+ node.Expanded = true;
+ }
}
[CommandHandler (ProjectCommands.AddSolutionFolder)]
@@ -293,14 +292,16 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
ce.Name = GettextCatalog.GetString ("New Folder");
folder.Items.Add (ce);
Tree.AddNodeInsertCallback (ce, OnFolderInserted);
- CurrentNode.Expanded = true;
+ var node = Tree.GetNodeAtObject (folder);
+ if (node != null)
+ node.Expanded = true;
}
[CommandHandler (ProjectCommands.Reload)]
[AllowMultiSelection]
public void OnReload ()
{
- using (IProgressMonitor m = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
+ using (ProgressMonitor m = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
m.BeginTask (null, CurrentNodes.Length);
foreach (ITreeNavigator node in CurrentNodes) {
SolutionFolder folder = (SolutionFolder) node.DataItem;
@@ -334,12 +335,12 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
}*/
[CommandHandler (ProjectCommands.AddFiles)]
- protected void OnAddFiles ()
+ protected async void OnAddFiles ()
{
SolutionFolder folder = (SolutionFolder) CurrentNode.DataItem;
if (IdeApp.ProjectOperations.AddFilesToSolutionFolder (folder)) {
CurrentNode.Expanded = true;
- IdeApp.ProjectOperations.Save (folder.ParentSolution);
+ await IdeApp.ProjectOperations.SaveAsync (folder.ParentSolution);
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs
index c144c2f2ac..6b5fd12c36 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SolutionNodeBuilder.cs
@@ -43,33 +43,17 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
{
class SolutionNodeBuilder: TypeNodeBuilder
{
- SolutionItemChangeEventHandler globalItemAddedRemoved;
- SolutionItemChangeEventHandler combineEntryAdded;
- SolutionItemChangeEventHandler combineEntryRemoved;
- EventHandler<WorkspaceItemRenamedEventArgs> combineNameChanged;
- EventHandler startupChanged;
- EventHandler<SolutionItemFileEventArgs> fileAdded;
- EventHandler<SolutionItemFileEventArgs> fileRemoved;
-
public SolutionNodeBuilder ()
{
- globalItemAddedRemoved = (SolutionItemChangeEventHandler) DispatchService.GuiDispatch (new SolutionItemChangeEventHandler (OnSolutionItemAddedRemoved));
- combineEntryAdded = (SolutionItemChangeEventHandler) DispatchService.GuiDispatch (new SolutionItemChangeEventHandler (OnEntryAdded));
- combineEntryRemoved = (SolutionItemChangeEventHandler) DispatchService.GuiDispatch (new SolutionItemChangeEventHandler (OnEntryRemoved));
- combineNameChanged = (EventHandler<WorkspaceItemRenamedEventArgs>) DispatchService.GuiDispatch (new EventHandler<WorkspaceItemRenamedEventArgs> (OnCombineRenamed));
- startupChanged = (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnStartupChanged));
- fileAdded = (EventHandler<SolutionItemFileEventArgs>) DispatchService.GuiDispatch (new EventHandler<SolutionItemFileEventArgs> (OnFileAdded));
- fileRemoved = (EventHandler<SolutionItemFileEventArgs>) DispatchService.GuiDispatch (new EventHandler<SolutionItemFileEventArgs> (OnFileRemoved));
-
- IdeApp.Workspace.ItemAddedToSolution += globalItemAddedRemoved;
- IdeApp.Workspace.ItemRemovedFromSolution += globalItemAddedRemoved;
+ IdeApp.Workspace.ItemAddedToSolution += OnSolutionItemAddedRemoved;
+ IdeApp.Workspace.ItemRemovedFromSolution += OnSolutionItemAddedRemoved;
}
public override void Dispose ()
{
base.Dispose ();
- IdeApp.Workspace.ItemAddedToSolution -= globalItemAddedRemoved;
- IdeApp.Workspace.ItemRemovedFromSolution -= globalItemAddedRemoved;
+ IdeApp.Workspace.ItemAddedToSolution -= OnSolutionItemAddedRemoved;
+ IdeApp.Workspace.ItemRemovedFromSolution -= OnSolutionItemAddedRemoved;
}
@@ -101,10 +85,8 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public override void BuildChildNodes (ITreeBuilder ctx, object dataObject)
{
Solution solution = (Solution) dataObject;
- foreach (SolutionItem entry in solution.RootFolder.Items)
- ctx.AddChild (entry);
- foreach (FilePath file in solution.RootFolder.Files)
- ctx.AddChild (new SolutionFolderFileNode (file, solution.RootFolder));
+ ctx.AddChildren (solution.RootFolder.Items);
+ ctx.AddChildren (solution.RootFolder.Files.Select (f => new SolutionFolderFileNode (f, solution.RootFolder)));
}
public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
@@ -121,28 +103,28 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public override void OnNodeAdded (object dataObject)
{
Solution solution = (Solution) dataObject;
- solution.NameChanged += combineNameChanged;
- solution.StartupItemChanged += startupChanged;
- solution.RootFolder.ItemAdded += combineEntryAdded;
- solution.RootFolder.ItemRemoved += combineEntryRemoved;
- solution.RootFolder.SolutionItemFileAdded += fileAdded;
- solution.RootFolder.SolutionItemFileRemoved += fileRemoved;
+ solution.NameChanged += OnCombineRenamed;
+ solution.StartupItemChanged += OnStartupChanged;
+ solution.RootFolder.ItemAdded += OnEntryAdded;
+ solution.RootFolder.ItemRemoved += OnEntryRemoved;
+ solution.RootFolder.SolutionItemFileAdded += OnFileAdded;
+ solution.RootFolder.SolutionItemFileRemoved += OnFileRemoved;
}
public override void OnNodeRemoved (object dataObject)
{
Solution solution = (Solution) dataObject;
- solution.NameChanged -= combineNameChanged;
- solution.StartupItemChanged -= startupChanged;
- solution.RootFolder.ItemAdded -= combineEntryAdded;
- solution.RootFolder.ItemRemoved -= combineEntryRemoved;
- solution.RootFolder.SolutionItemFileAdded -= fileAdded;
- solution.RootFolder.SolutionItemFileRemoved -= fileRemoved;
+ solution.NameChanged -= OnCombineRenamed;
+ solution.StartupItemChanged -= OnStartupChanged;
+ solution.RootFolder.ItemAdded -= OnEntryAdded;
+ solution.RootFolder.ItemRemoved -= OnEntryRemoved;
+ solution.RootFolder.SolutionItemFileAdded -= OnFileAdded;
+ solution.RootFolder.SolutionItemFileRemoved -= OnFileRemoved;
}
void OnStartupChanged (object sender, EventArgs args)
{
- foreach (SolutionEntityItem it in IdeApp.Workspace.GetAllSolutionItems<SolutionEntityItem> ()) {
+ foreach (SolutionItem it in IdeApp.Workspace.GetAllSolutionItems ()) {
ITreeBuilder tb = Context.GetTreeBuilder (it);
if (tb != null)
tb.Update ();
@@ -160,13 +142,23 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
{
ITreeBuilder tb = Context.GetTreeBuilder (e.SolutionItem.ParentSolution);
if (tb != null) {
- tb.AddChild (e.SolutionItem, true);
- tb.Expanded = true;
+ if (e.Reloading)
+ // When reloading we ignore the removed event, and we do an UpdateAll here. This will
+ // replace the reloaded instance and will preserve the tree status
+ tb.UpdateAll ();
+ else {
+ tb.AddChild (e.SolutionItem, true);
+ tb.Expanded = true;
+ }
}
}
void OnEntryRemoved (object sender, SolutionItemChangeEventArgs e)
{
+ // If reloading, ignore the event. We handle it in OnEntryAdded.
+ if (e.Reloading)
+ return;
+
ITreeBuilder tb = Context.GetTreeBuilder (e.SolutionItem);
if (tb != null)
tb.Remove ();
@@ -202,7 +194,8 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public override void RenameItem (string newName)
{
Solution sol = (Solution) CurrentNode.DataItem;
- IdeApp.ProjectOperations.RenameItem (sol, newName);
+ if (sol.Name != newName)
+ IdeApp.ProjectOperations.RenameItem (sol, newName);
}
public override DragOperation CanDragNode ()
@@ -212,14 +205,14 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public override bool CanDropNode (object dataObject, DragOperation operation)
{
- return (dataObject is SolutionItem) || (dataObject is IFileItem);
+ return (dataObject is SolutionFolderItem) || (dataObject is IFileItem);
}
public override void OnNodeDrop (object dataObject, DragOperation operation)
{
Solution sol = CurrentNode.DataItem as Solution;
- if (dataObject is SolutionItem) {
- SolutionItem it = (SolutionItem) dataObject;
+ if (dataObject is SolutionFolderItem) {
+ SolutionFolderItem it = (SolutionFolderItem) dataObject;
if (!MessageService.Confirm (GettextCatalog.GetString ("Are you sure you want to move the item '{0}' to the root node of the solution?", it.Name), AlertButton.Move))
return;
@@ -229,7 +222,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
else {
SolutionFolderNodeCommandHandler.DropFile (sol.DefaultSolutionFolder, (IFileItem) dataObject, operation);
}
- IdeApp.ProjectOperations.Save (sol);
+ IdeApp.ProjectOperations.SaveAsync (sol);
}
public override void ActivateMultipleItems ()
@@ -254,7 +247,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
}
}
}
- IdeApp.ProjectOperations.Save (items);
+ IdeApp.ProjectOperations.SaveAsync (items);
}
public override bool CanDeleteItem ()
@@ -267,27 +260,29 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public void AddNewProjectToSolution ()
{
Solution solution = (Solution) CurrentNode.DataItem;
- SolutionItem ce = IdeApp.ProjectOperations.CreateProject (solution.RootFolder);
+ SolutionFolderItem ce = IdeApp.ProjectOperations.CreateProject (solution.RootFolder);
if (ce == null) return;
Tree.AddNodeInsertCallback (ce, new TreeNodeCallback (OnEntryInserted));
CurrentNode.Expanded = true;
}
[CommandHandler (ProjectCommands.AddProject)]
- public void AddProjectToCombine()
+ public async void AddProjectToCombine()
{
Solution solution = (Solution) CurrentNode.DataItem;
- SolutionItem ce = IdeApp.ProjectOperations.AddSolutionItem (solution.RootFolder);
- if (ce == null) return;
- Tree.AddNodeInsertCallback (ce, new TreeNodeCallback (OnEntryInserted));
- CurrentNode.Expanded = true;
+ var res = await IdeApp.ProjectOperations.AddSolutionItem (solution.RootFolder);
+ if (res == null) return;
+ Tree.AddNodeInsertCallback (res, new TreeNodeCallback (OnEntryInserted));
+ var node = Tree.GetNodeAtObject (solution);
+ if (node != null)
+ node.Expanded = true;
}
[CommandHandler (ProjectCommands.AddSolutionFolder)]
public void AddFolder()
{
Solution solution = (Solution) CurrentNode.DataItem;
- SolutionItem ce = new SolutionFolder ();
+ var ce = new SolutionFolder ();
ce.Name = GettextCatalog.GetString ("New Folder");
solution.RootFolder.Items.Add (ce);
Tree.AddNodeInsertCallback (ce, OnFolderInserted);
@@ -298,7 +293,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
[AllowMultiSelection]
public void OnReload ()
{
- using (IProgressMonitor m = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
+ using (ProgressMonitor m = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
m.BeginTask (null, CurrentNodes.Length);
foreach (ITreeNavigator node in CurrentNodes) {
Solution solution = (Solution) node.DataItem;
@@ -325,7 +320,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public void OnEditSolution ()
{
var solution = (Solution) CurrentNode.DataItem;
- IdeApp.Workbench.OpenDocument (solution.FileName);
+ IdeApp.Workbench.OpenDocument (solution.FileName, project:null);
}
[CommandUpdateHandler (ProjectCommands.EditSolutionItem)]
@@ -350,7 +345,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
{
Solution sol = (Solution) CurrentNode.DataItem;
if (IdeApp.ProjectOperations.AddFilesToSolutionFolder (sol.RootFolder))
- IdeApp.ProjectOperations.Save (sol);
+ IdeApp.ProjectOperations.SaveAsync (sol);
}
void OnEntryInserted (ITreeNavigator nav)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFile.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFile.cs
index b604e9d7b9..7291a032fc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFile.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFile.cs
@@ -37,14 +37,14 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public class SystemFile: IFileItem
{
FilePath absolutePath;
- IWorkspaceObject parent;
+ WorkspaceObject parent;
bool showTransparent;
- public SystemFile (FilePath absolutePath, IWorkspaceObject parent): this (absolutePath, parent, true)
+ public SystemFile (FilePath absolutePath, WorkspaceObject parent): this (absolutePath, parent, true)
{
}
- public SystemFile (FilePath absolutePath, IWorkspaceObject parent, bool showTransparent)
+ public SystemFile (FilePath absolutePath, WorkspaceObject parent, bool showTransparent)
{
this.parent = parent;
this.absolutePath = absolutePath;
@@ -63,7 +63,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
get { return System.IO.Path.GetFileName (absolutePath); }
}
- public IWorkspaceObject ParentWorkspaceObject {
+ public WorkspaceObject ParentWorkspaceObject {
get { return parent; }
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs
index 8c93a7ed27..54834f3f25 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/SystemFileNodeBuilder.cs
@@ -100,7 +100,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
string newname = Path.Combine (Path.GetDirectoryName (oldname), newName);
if (newname != oldname) {
try {
- if (!FileService.IsValidPath (newname)) {
+ if (!FileService.IsValidPath (newname) || ProjectFolderCommandHandler.ContainsDirectorySeparator (newName)) {
MessageService.ShowWarning (GettextCatalog.GetString ("The name you have chosen contains illegal characters. Please choose a different name."));
} else if (File.Exists (newname) || Directory.Exists (newname)) {
MessageService.ShowWarning (GettextCatalog.GetString ("File or directory name is already in use. Please choose a different one."));
@@ -118,7 +118,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public override void ActivateItem ()
{
SystemFile file = CurrentNode.DataItem as SystemFile;
- IdeApp.Workbench.OpenDocument (file.Path);
+ IdeApp.Workbench.OpenDocument (file.Path, project: null);
}
public override void DeleteMultipleItems ()
@@ -149,8 +149,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
[AllowMultiSelection]
public void IncludeFileToProject ()
{
- Set<SolutionEntityItem> projects = new Set<SolutionEntityItem> ();
- Set<Solution> solutions = new Set<Solution> ();
+ Set<IWorkspaceFileObject> projects = new Set<IWorkspaceFileObject> ();
var nodesByProject = CurrentNodes.GroupBy (n => n.GetParentDataItem (typeof(Project), true) as Project);
foreach (var projectGroup in nodesByProject) {
@@ -166,21 +165,19 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
SolutionFolder folder = node.GetParentDataItem (typeof(SolutionFolder), true) as SolutionFolder;
if (folder != null) {
folder.Files.Add (file.Path);
- solutions.Add (folder.ParentSolution);
+ projects.Add (folder.ParentSolution);
}
else {
Solution sol = node.GetParentDataItem (typeof(Solution), true) as Solution;
sol.RootFolder.Files.Add (file.Path);
- solutions.Add (sol);
+ projects.Add (sol);
}
}
}
if (newFiles.Count > 0)
project.AddFiles (newFiles);
}
- IdeApp.ProjectOperations.Save (projects);
- foreach (Solution sol in solutions)
- IdeApp.ProjectOperations.Save (sol);
+ IdeApp.ProjectOperations.SaveAsync (projects);
}
[CommandUpdateHandler (ProjectCommands.IncludeToProject)]
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs
index 4e16eed65c..e050b1dfa2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/UnknownEntryNodeBuilder.cs
@@ -94,7 +94,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public void OnReload ()
{
var solutions = new HashSet<Solution> ();
- using (IProgressMonitor m = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
+ using (ProgressMonitor m = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
m.BeginTask (null, CurrentNodes.Length);
foreach (ITreeNavigator node in CurrentNodes) {
UnknownSolutionItem entry = (UnknownSolutionItem) node.DataItem;
@@ -107,7 +107,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
}
m.EndTask ();
}
- IdeApp.ProjectOperations.Save (solutions);
+ IdeApp.ProjectOperations.SaveAsync (solutions);
}
[CommandUpdateHandler (ProjectCommands.Reload)]
@@ -127,18 +127,18 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public void OnUnload ()
{
HashSet<Solution> solutions = new HashSet<Solution> ();
- using (IProgressMonitor m = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
+ using (ProgressMonitor m = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
m.BeginTask (null, CurrentNodes.Length);
foreach (ITreeNavigator nav in CurrentNodes) {
UnknownSolutionItem p = (UnknownSolutionItem) nav.DataItem;
+ solutions.Add (p.ParentSolution);
p.Enabled = false;
p.ParentFolder.ReloadItem (m, p);
m.Step (1);
- solutions.Add (p.ParentSolution);
}
m.EndTask ();
}
- IdeApp.ProjectOperations.Save (solutions);
+ IdeApp.ProjectOperations.SaveAsync (solutions);
}
[CommandUpdateHandler (ProjectCommands.Unload)]
@@ -151,7 +151,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public void OnEditUnknownSolutionItem ()
{
UnknownSolutionItem si = (UnknownSolutionItem) CurrentNode.DataItem;
- IdeApp.Workbench.OpenDocument (si.FileName);
+ IdeApp.Workbench.OpenDocument (si.FileName, project: null);
}
[CommandUpdateHandler (ProjectCommands.EditSolutionItem)]
@@ -174,7 +174,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
if (yes) {
cmb.Items.Remove (item);
item.Dispose ();
- IdeApp.ProjectOperations.Save (cmb.ParentSolution);
+ IdeApp.ProjectOperations.SaveAsync (cmb.ParentSolution);
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/WorkspaceNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/WorkspaceNodeBuilder.cs
index 21292f6530..dcd1c2b6cb 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/WorkspaceNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/WorkspaceNodeBuilder.cs
@@ -41,20 +41,6 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
{
class WorkspaceNodeBuilder: TypeNodeBuilder
{
- EventHandler<WorkspaceItemChangeEventArgs> combineEntryAdded;
- EventHandler<WorkspaceItemChangeEventArgs> combineEntryRemoved;
- EventHandler<WorkspaceItemRenamedEventArgs> combineNameChanged;
-
- public WorkspaceNodeBuilder ()
- {
- combineEntryAdded = OnEntryAdded;
- combineEntryRemoved = OnEntryRemoved;
- combineNameChanged = OnCombineRenamed;
- combineEntryAdded = DispatchService.GuiDispatch (combineEntryAdded);
- combineEntryRemoved = DispatchService.GuiDispatch (combineEntryRemoved);
- combineNameChanged = DispatchService.GuiDispatch (combineNameChanged);
- }
-
public override Type NodeDataType {
get { return typeof(Workspace); }
}
@@ -83,8 +69,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public override void BuildChildNodes (ITreeBuilder ctx, object dataObject)
{
Workspace ws = (Workspace) dataObject;
- foreach (WorkspaceItem entry in ws.Items)
- ctx.AddChild (entry);
+ ctx.AddChildren (ws.Items);
}
public override bool HasChildNodes (ITreeBuilder builder, object dataObject)
@@ -100,17 +85,17 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public override void OnNodeAdded (object dataObject)
{
Workspace ws = (Workspace) dataObject;
- ws.ItemAdded += combineEntryAdded;
- ws.ItemRemoved += combineEntryRemoved;
- ws.NameChanged += combineNameChanged;
+ ws.ItemAdded += OnEntryAdded;
+ ws.ItemRemoved += OnEntryRemoved;
+ ws.NameChanged += OnCombineRenamed;
}
public override void OnNodeRemoved (object dataObject)
{
Workspace ws = (Workspace) dataObject;
- ws.ItemAdded -= combineEntryAdded;
- ws.ItemRemoved -= combineEntryRemoved;
- ws.NameChanged -= combineNameChanged;
+ ws.ItemAdded -= OnEntryAdded;
+ ws.ItemRemoved -= OnEntryRemoved;
+ ws.NameChanged -= OnCombineRenamed;
}
void OnEntryAdded (object sender, WorkspaceItemEventArgs e)
@@ -141,7 +126,8 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
public override void RenameItem (string newName)
{
Workspace sol = (Workspace) CurrentNode.DataItem;
- IdeApp.ProjectOperations.RenameItem (sol, newName);
+ if (sol.Name != newName)
+ IdeApp.ProjectOperations.RenameItem (sol, newName);
}
public override DragOperation CanDragNode ()
@@ -182,7 +168,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
toSave.Add (ws);
}
}
- IdeApp.ProjectOperations.Save (toSave);
+ IdeApp.ProjectOperations.SaveAsync (toSave);
}
public override void ActivateItem ()
@@ -193,7 +179,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
[CommandHandler (EditCommands.Delete)]
[AllowMultiSelection]
- public void RemoveItem ()
+ public async void RemoveItem ()
{
foreach (ITreeNavigator node in CurrentNodes) {
Workspace ws = node.DataItem as Workspace;
@@ -205,7 +191,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
ws.Dispose ();
}
}
- IdeApp.Workspace.Save();
+ await IdeApp.Workspace.SaveAsync ();
}
[CommandUpdateHandler (EditCommands.Delete)]
@@ -222,40 +208,48 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
}
[CommandHandler (ProjectCommands.AddNewSolution)]
- public void AddNewSolutionToWorkspace ()
+ public async void AddNewSolutionToWorkspace ()
{
Workspace ws = (Workspace) CurrentNode.DataItem;
- WorkspaceItem ce = IdeApp.ProjectOperations.AddNewWorkspaceItem (ws);
- if (ce == null) return;
- Tree.AddNodeInsertCallback (ce, new TreeNodeCallback (OnEntryInserted));
- CurrentNode.Expanded = true;
+ var res = await IdeApp.ProjectOperations.AddNewWorkspaceItem (ws);
+ if (res == null)
+ return;
+ Tree.AddNodeInsertCallback (res, new TreeNodeCallback (OnEntryInserted));
+ var node = Tree.GetNodeAtObject (ws);
+ if (node != null)
+ node.Expanded = true;
}
[CommandHandler (ProjectCommands.AddNewWorkspace)]
- public void AddNewWorkspaceToWorkspace ()
+ public async void AddNewWorkspaceToWorkspace ()
{
Workspace ws = (Workspace) CurrentNode.DataItem;
- WorkspaceItem ce = IdeApp.ProjectOperations.AddNewWorkspaceItem (ws, "MonoDevelop.Workspace");
- if (ce == null) return;
- Tree.AddNodeInsertCallback (ce, new TreeNodeCallback (OnEntryInserted));
- CurrentNode.Expanded = true;
+ var res = await IdeApp.ProjectOperations.AddNewWorkspaceItem (ws, "MonoDevelop.Workspace");
+ if (res == null) return;
+ Tree.AddNodeInsertCallback (res, new TreeNodeCallback (OnEntryInserted));
+ var node = Tree.GetNodeAtObject (ws);
+ if (node != null)
+ node.Expanded = true;
}
[CommandHandler (ProjectCommands.AddItem)]
- public void AddProjectToCombine()
+ public async void AddProjectToCombine()
{
Workspace ws = (Workspace) CurrentNode.DataItem;
- WorkspaceItem ce = IdeApp.ProjectOperations.AddWorkspaceItem (ws);
- if (ce == null) return;
- Tree.AddNodeInsertCallback (ce, new TreeNodeCallback (OnEntryInserted));
- CurrentNode.Expanded = true;
+ var res = await IdeApp.ProjectOperations.AddWorkspaceItem (ws);
+ if (res == null)
+ return;
+ Tree.AddNodeInsertCallback (res, new TreeNodeCallback (OnEntryInserted));
+ var node = Tree.GetNodeAtObject (ws);
+ if (node != null)
+ node.Expanded = true;
}
[CommandHandler (ProjectCommands.Reload)]
[AllowMultiSelection]
public void OnReload ()
{
- using (IProgressMonitor m = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
+ using (ProgressMonitor m = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
m.BeginTask (null, CurrentNodes.Length);
foreach (ITreeNavigator node in CurrentNodes) {
Workspace ws = (Workspace) node.DataItem;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs
index e830428697..b0215a6ba2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/DefaultMonitorPad.cs
@@ -40,23 +40,22 @@ using Gtk;
using Pango;
using MonoDevelop.Components.Docking;
using MonoDevelop.Ide.Gui.Components;
+using MonoDevelop.Core.Execution;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui.Pads
{
- internal class DefaultMonitorPad : IPadContent
+ internal class DefaultMonitorPad : PadContent
{
- IPadWindow window;
LogView logView;
Button buttonStop;
ToggleButton buttonPin;
Button buttonClear;
bool progressStarted;
- IAsyncOperation asyncOperation;
LogViewProgressMonitor monitor;
Pad statusSourcePad;
string icon;
- string id;
int instanceNum;
string typeTag;
@@ -72,28 +71,27 @@ namespace MonoDevelop.Ide.Gui.Pads
IdeApp.Workspace.FirstWorkspaceItemOpened += OnCombineOpen;
IdeApp.Workspace.LastWorkspaceItemClosed += OnCombineClosed;
- Control.ShowAll ();
+ logView.ShowAll ();
}
- void IPadContent.Initialize (IPadWindow window)
+ protected override void Initialize (IPadWindow window)
{
- this.window = window;
window.Icon = icon;
- DockItemToolbar toolbar = window.GetToolbar (PositionType.Right);
+ DockItemToolbar toolbar = window.GetToolbar (DockPositionType.Right);
- buttonStop = new Button (new Gtk.Image (Stock.Stop, IconSize.Menu));
+ buttonStop = new Button (new ImageView (Stock.Stop, IconSize.Menu));
buttonStop.Clicked += new EventHandler (OnButtonStopClick);
buttonStop.TooltipText = GettextCatalog.GetString ("Stop");
toolbar.Add (buttonStop);
- buttonClear = new Button (new Gtk.Image (Stock.Broom, IconSize.Menu));
+ buttonClear = new Button (new ImageView (Stock.Broom, IconSize.Menu));
buttonClear.Clicked += new EventHandler (OnButtonClearClick);
buttonClear.TooltipText = GettextCatalog.GetString ("Clear console");
toolbar.Add (buttonClear);
buttonPin = new ToggleButton ();
- buttonPin.Image = new Gtk.Image (Stock.PinUp, IconSize.Menu);
+ buttonPin.Image = new ImageView (Stock.PinUp, IconSize.Menu);
buttonPin.Image.ShowAll ();
buttonPin.Clicked += new EventHandler (OnButtonPinClick);
buttonPin.TooltipText = GettextCatalog.GetString ("Pin output pad");
@@ -105,16 +103,12 @@ namespace MonoDevelop.Ide.Gui.Pads
get { return logView; }
}
- public IPadWindow Window {
- get { return this.window; }
- }
-
public Pad StatusSourcePad {
get { return this.statusSourcePad; }
set { this.statusSourcePad = value; }
}
- internal IProgressMonitor CurrentMonitor {
+ internal OutputProgressMonitor CurrentMonitor {
get { return monitor; }
}
@@ -125,7 +119,7 @@ namespace MonoDevelop.Ide.Gui.Pads
void OnButtonStopClick (object sender, EventArgs e)
{
- asyncOperation.Cancel ();
+ monitor.Cancel ();
}
void OnCombineOpen (object sender, EventArgs e)
@@ -141,31 +135,30 @@ namespace MonoDevelop.Ide.Gui.Pads
void OnButtonPinClick (object sender, EventArgs e)
{
if (buttonPin.Active)
- ((Gtk.Image)buttonPin.Image).Stock = (IconId) "md-pin-down";
+ ((ImageView)buttonPin.Image).SetIcon (Stock.PinDown, IconSize.Menu);
else
- ((Gtk.Image)buttonPin.Image).Stock = (IconId) "md-pin-up";
+ ((ImageView)buttonPin.Image).SetIcon (Stock.PinUp, IconSize.Menu);
}
public bool AllowReuse {
get { return !progressStarted && !buttonPin.Active; }
}
- public IProgressMonitor BeginProgress (string title)
+ public OutputProgressMonitor BeginProgress (string title)
{
progressStarted = true;
logView.Clear ();
- monitor = logView.GetProgressMonitor ();
- asyncOperation = monitor.AsyncOperation;
-
- DispatchService.GuiDispatch (delegate {
- window.HasNewData = false;
- window.HasErrors = false;
- window.IsWorking = true;
+ monitor = (LogViewProgressMonitor) logView.GetProgressMonitor ();
+
+ Runtime.RunInMainThread (delegate {
+ Window.HasNewData = false;
+ Window.HasErrors = false;
+ Window.IsWorking = true;
buttonStop.Sensitive = true;
});
- monitor.AsyncOperation.Completed += delegate {
+ monitor.Completed += delegate {
EndProgress ();
};
@@ -174,24 +167,24 @@ namespace MonoDevelop.Ide.Gui.Pads
public void EndProgress ()
{
- DispatchService.GuiDispatch (delegate {
- if (window != null) {
- window.IsWorking = false;
- if (!asyncOperation.Success)
- window.HasErrors = true;
+ Runtime.RunInMainThread (delegate {
+ if (Window != null) {
+ Window.IsWorking = false;
+ if (monitor.Errors.Length > 0)
+ Window.HasErrors = true;
else
- window.HasNewData = true;
+ Window.HasNewData = true;
}
buttonStop.Sensitive = false;
progressStarted = false;
- if (window == null)
+ if (Window == null)
buttonClear.Sensitive = false;
if (monitor.Errors.Length > 0) {
IdeApp.Workbench.StatusBar.ShowMessage (Stock.Error, monitor.Errors [monitor.Errors.Length - 1].Message);
IdeApp.Workbench.StatusBar.SetMessageSourcePad (statusSourcePad);
- } else if (monitor.Messages.Length > 0) {
- IdeApp.Workbench.StatusBar.ShowMessage (monitor.Messages [monitor.Messages.Length - 1]);
+ } else if (monitor.SuccessMessages.Length > 0) {
+ IdeApp.Workbench.StatusBar.ShowMessage (monitor.SuccessMessages [monitor.SuccessMessages.Length - 1]);
IdeApp.Workbench.StatusBar.SetMessageSourcePad (statusSourcePad);
} else if (monitor.Warnings.Length > 0) {
IdeApp.Workbench.StatusBar.ShowMessage (Stock.Warning, monitor.Warnings [monitor.Warnings.Length - 1]);
@@ -200,15 +193,10 @@ namespace MonoDevelop.Ide.Gui.Pads
});
}
- public virtual Gtk.Widget Control {
+ public override Control Control {
get { return logView; }
}
- public string Id {
- get { return id; }
- set { id = value; }
- }
-
public string DefaultPlacement {
get { return "Bottom"; }
}
@@ -225,15 +213,13 @@ namespace MonoDevelop.Ide.Gui.Pads
}
}
- public virtual void Dispose ()
+ public override void Dispose ()
{
logView.Clear ();
IdeApp.Workspace.FirstWorkspaceItemOpened -= OnCombineOpen;
IdeApp.Workspace.LastWorkspaceItemClosed -= OnCombineClosed;
- }
-
- public void RedrawContent()
- {
+
+ base.Dispose ();
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs
index 5ac9296bad..84af894b25 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs
@@ -50,10 +50,12 @@ using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.Commands;
using MonoDevelop.Components;
using System.Linq;
+using MonoDevelop.Components.AutoTest;
+using System.ComponentModel;
namespace MonoDevelop.Ide.Gui.Pads
{
- class ErrorListPad : IPadContent
+ class ErrorListPad : PadContent
{
HPaned control;
ScrolledWindow sw;
@@ -63,6 +65,7 @@ namespace MonoDevelop.Ide.Gui.Pads
TreeModelFilter filter;
TreeModelSort sort;
ToggleButton errorBtn, warnBtn, msgBtn, logBtn;
+ Label errorBtnLbl, warnBtnLbl, msgBtnLbl, logBtnLbl;
SearchEntry searchEntry;
string currentSearchPattern = null;
Hashtable tasks = new Hashtable ();
@@ -70,7 +73,6 @@ namespace MonoDevelop.Ide.Gui.Pads
int warningCount;
int infoCount;
bool initialLogShow = true;
- IPadWindow window;
Menu menu;
Dictionary<ToggleAction, int> columnsActions = new Dictionary<ToggleAction, int> ();
@@ -80,12 +82,12 @@ namespace MonoDevelop.Ide.Gui.Pads
Xwt.Drawing.Image iconError;
Xwt.Drawing.Image iconInfo;
Xwt.Drawing.Image iconEmpty;
-
- const string showErrorsPropertyName = "SharpDevelop.TaskList.ShowErrors";
- const string showWarningsPropertyName = "SharpDevelop.TaskList.ShowWarnings";
- const string showMessagesPropertyName = "SharpDevelop.TaskList.ShowMessages";
- const string logSeparatorPositionPropertyName = "SharpDevelop.TaskList.LogSeparatorPosition";
- const string outputViewVisiblePropertyName = "SharpDevelop.TaskList.OutputViewVisible";
+
+ public readonly ConfigurationProperty<bool> ShowErrors = ConfigurationProperty.Create ("SharpDevelop.TaskList.ShowErrors", true);
+ public readonly ConfigurationProperty<bool> ShowWarnings = ConfigurationProperty.Create ("SharpDevelop.TaskList.ShowWarnings", true);
+ public readonly ConfigurationProperty<bool> ShowMessages = ConfigurationProperty.Create ("SharpDevelop.TaskList.ShowMessages", true);
+ public readonly ConfigurationProperty<double> LogSeparatorPosition = ConfigurationProperty.Create ("SharpDevelop.TaskList.LogSeparatorPosition", 0.5d);
+ public readonly ConfigurationProperty<bool> OutputViewVisible = ConfigurationProperty.Create ("SharpDevelop.TaskList.OutputViewVisible", false);
static class DataColumns
{
@@ -107,7 +109,7 @@ namespace MonoDevelop.Ide.Gui.Pads
internal const int Category = 7;
}
- public Gtk.Widget Control {
+ public override Control Control {
get {
if (control == null)
CreateControl ();
@@ -115,50 +117,64 @@ namespace MonoDevelop.Ide.Gui.Pads
}
}
- public string Id {
+ public override string Id {
get { return "MonoDevelop.Ide.Gui.Pads.ErrorListPad"; }
}
- void IPadContent.Initialize (IPadWindow window)
+ protected override void Initialize (IPadWindow window)
{
- this.window = window;
window.Title = GettextCatalog.GetString ("Errors");
- DockItemToolbar toolbar = window.GetToolbar (PositionType.Top);
-
+ DockItemToolbar toolbar = window.GetToolbar (DockPositionType.Top);
+
+ var btnBox = new HBox (false, 2);
+ btnBox.PackStart (new ImageView (Stock.Error, Gtk.IconSize.Menu));
+ errorBtnLbl = new Label ();
+ btnBox.PackStart (errorBtnLbl);
+
errorBtn = new ToggleButton { Name = "toggleErrors" };
- errorBtn.Active = (bool)PropertyService.Get (showErrorsPropertyName, true);
- errorBtn.Image = new Gtk.Image (Stock.Error, Gtk.IconSize.Menu);
- errorBtn.Image.Show ();
+ errorBtn.Active = ShowErrors;
+ errorBtn.Child = btnBox;
errorBtn.Toggled += new EventHandler (FilterChanged);
errorBtn.TooltipText = GettextCatalog.GetString ("Show Errors");
UpdateErrorsNum();
toolbar.Add (errorBtn);
-
+
+ btnBox = new HBox (false, 2);
+ btnBox.PackStart (new ImageView (Stock.Warning, Gtk.IconSize.Menu));
+ warnBtnLbl = new Label ();
+ btnBox.PackStart (warnBtnLbl);
+
warnBtn = new ToggleButton { Name = "toggleWarnings" };
- warnBtn.Active = (bool)PropertyService.Get (showWarningsPropertyName, true);
- warnBtn.Image = new Gtk.Image (Stock.Warning, Gtk.IconSize.Menu);
- warnBtn.Image.Show ();
+ warnBtn.Active = ShowWarnings;
+ warnBtn.Child = btnBox;
warnBtn.Toggled += new EventHandler (FilterChanged);
warnBtn.TooltipText = GettextCatalog.GetString ("Show Warnings");
UpdateWarningsNum();
toolbar.Add (warnBtn);
-
+
+ btnBox = new HBox (false, 2);
+ btnBox.PackStart (new ImageView (Stock.Information, Gtk.IconSize.Menu));
+ msgBtnLbl = new Label ();
+ btnBox.PackStart (msgBtnLbl);
+
msgBtn = new ToggleButton { Name = "toggleMessages" };
- msgBtn.Active = (bool)PropertyService.Get (showMessagesPropertyName, true);
- msgBtn.Image = new Gtk.Image (Stock.Information, Gtk.IconSize.Menu);
- msgBtn.Image.Show ();
+ msgBtn.Active = ShowMessages;
+ msgBtn.Child = btnBox;
msgBtn.Toggled += new EventHandler (FilterChanged);
msgBtn.TooltipText = GettextCatalog.GetString ("Show Messages");
UpdateMessagesNum();
toolbar.Add (msgBtn);
toolbar.Add (new SeparatorToolItem ());
-
+
+ btnBox = new HBox (false, 2);
+ btnBox.PackStart (new ImageView ("md-message-log", Gtk.IconSize.Menu));
+ logBtnLbl = new Label (GettextCatalog.GetString ("Build Output"));
+ btnBox.PackStart (logBtnLbl);
+
logBtn = new ToggleButton { Name = "toggleBuildOutput" };
- logBtn.Label = GettextCatalog.GetString ("Build Output");
- logBtn.Image = ImageService.GetImage ("md-message-log", Gtk.IconSize.Menu);
- logBtn.Image.Show ();
+ logBtn.Child = btnBox;
logBtn.TooltipText = GettextCatalog.GetString ("Show build output");
logBtn.Toggled += HandleLogBtnToggled;
toolbar.Add (logBtn);
@@ -189,8 +205,10 @@ namespace MonoDevelop.Ide.Gui.Pads
store = new Gtk.TreeStore (typeof (Xwt.Drawing.Image), // image - type
typeof (bool), // read?
- typeof (Task), // read? -- use Pango weight
+ typeof (TaskListEntry), // read? -- use Pango weight
typeof (string));
+ SemanticModelAttribute modelAttr = new SemanticModelAttribute ("store__Type", "store__Read", "store__Task", "store__Description");
+ TypeDescriptor.AddAttributes (store, modelAttr);
TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc (FilterTasks);
filter = new TreeModelFilter (store, null);
@@ -214,9 +232,9 @@ namespace MonoDevelop.Ide.Gui.Pads
sw = new MonoDevelop.Components.CompactScrolledWindow ();
sw.ShadowType = ShadowType.None;
sw.Add (view);
- TaskService.Errors.TasksRemoved += DispatchService.GuiDispatch<TaskEventHandler> (ShowResults);
- TaskService.Errors.TasksAdded += DispatchService.GuiDispatch<TaskEventHandler> (TaskAdded);
- TaskService.Errors.TasksChanged += DispatchService.GuiDispatch<TaskEventHandler> (TaskChanged);
+ TaskService.Errors.TasksRemoved += ShowResults;
+ TaskService.Errors.TasksAdded += TaskAdded;
+ TaskService.Errors.TasksChanged += TaskChanged;
TaskService.Errors.CurrentLocationTaskChanged += HandleTaskServiceErrorsCurrentLocationTaskChanged;
IdeApp.Workspace.FirstWorkspaceItemOpened += OnCombineOpen;
@@ -234,11 +252,11 @@ namespace MonoDevelop.Ide.Gui.Pads
outputView = new LogView { Name = "buildOutput" };
control.Add2 (outputView);
- Control.ShowAll ();
+ control.ShowAll ();
control.SizeAllocated += HandleControlSizeAllocated;
- bool outputVisible = PropertyService.Get<bool> (outputViewVisiblePropertyName, false);
+ bool outputVisible = OutputViewVisible;
if (outputVisible) {
outputView.Visible = true;
logBtn.Active = true;
@@ -249,18 +267,26 @@ namespace MonoDevelop.Ide.Gui.Pads
sw.SizeAllocated += HandleSwSizeAllocated;
// Load existing tasks
- foreach (Task t in TaskService.Errors) {
+ foreach (TaskListEntry t in TaskService.Errors) {
AddTask (t);
}
control.FocusChain = new Gtk.Widget [] { sw };
}
+
+ public override void Dispose ()
+ {
+ IdeApp.Workspace.FirstWorkspaceItemOpened -= OnCombineOpen;
+ IdeApp.Workspace.LastWorkspaceItemClosed -= OnCombineClosed;
+
+ base.Dispose ();
+ }
void HandleSwSizeAllocated (object o, SizeAllocatedArgs args)
{
if (!initialLogShow && outputView.Visible) {
var val = (double) ((double) control.Position / (double) control.Allocation.Width);
- PropertyService.Set (logSeparatorPositionPropertyName, val);
+ LogSeparatorPosition.Value = val;
}
}
@@ -273,7 +299,7 @@ namespace MonoDevelop.Ide.Gui.Pads
}
}
- public IProgressMonitor GetBuildProgressMonitor ()
+ public ProgressMonitor GetBuildProgressMonitor ()
{
if (control == null)
CreateControl ();
@@ -290,7 +316,7 @@ namespace MonoDevelop.Ide.Gui.Pads
if (!view.Model.GetIterFirst (out it))
return;
do {
- Task t = (Task) view.Model.GetValue (it, DataColumns.Task);
+ TaskListEntry t = (TaskListEntry) view.Model.GetValue (it, DataColumns.Task);
if (t == TaskService.Errors.CurrentLocationTask) {
view.Selection.SelectIter (it);
view.ScrollToCell (view.Model.GetPath (it), view.Columns[0], false, 0, 0);
@@ -300,6 +326,21 @@ namespace MonoDevelop.Ide.Gui.Pads
}
} while (view.Model.IterNext (ref it));
}
+
+ internal void SelectTaskListEntry (TaskListEntry taskListEntry)
+ {
+ TreeIter iter;
+ if (!view.Model.GetIterFirst (out iter))
+ return;
+ do {
+ var t = (TaskListEntry) view.Model.GetValue (iter, DataColumns.Task);
+ if (t == taskListEntry) {
+ view.Selection.SelectIter (iter);
+ view.ScrollToCell (view.Model.GetPath (iter), view.Columns[0], false, 0, 0);
+ return;
+ }
+ } while (view.Model.IterNext (ref iter));
+ }
void LoadColumnsVisibility ()
{
@@ -318,10 +359,6 @@ namespace MonoDevelop.Ide.Gui.Pads
{
PropertyService.Set ("Monodevelop.ErrorListColumns", string.Join (";", view.Columns.Select (c => c.Visible ? "TRUE" : "FALSE")));
}
-
- public void RedrawContent()
- {
- }
Gtk.Menu CreateMenu ()
{
@@ -447,13 +484,13 @@ namespace MonoDevelop.Ide.Gui.Pads
return menu;
}
- Task SelectedTask
+ TaskListEntry SelectedTask
{
get {
TreeModel model;
TreeIter iter;
if (view.Selection.GetSelected (out model, out iter))
- return model.GetValue (iter, DataColumns.Task) as Task;
+ return model.GetValue (iter, DataColumns.Task) as TaskListEntry;
return null; // no one selected
}
}
@@ -466,7 +503,7 @@ namespace MonoDevelop.Ide.Gui.Pads
void OnTaskCopied (object o, EventArgs args)
{
- Task task = SelectedTask;
+ TaskListEntry task = SelectedTask;
if (task != null) {
StringBuilder text = new StringBuilder ();
if (!string.IsNullOrEmpty (task.FileName)) {
@@ -510,7 +547,7 @@ namespace MonoDevelop.Ide.Gui.Pads
bool GetSelectedErrorReference (out string reference)
{
- Task task = SelectedTask;
+ TaskListEntry task = SelectedTask;
if (task != null && !String.IsNullOrEmpty (task.HelpKeyword)) {
reference = task.HelpKeyword;
return true;
@@ -530,7 +567,7 @@ namespace MonoDevelop.Ide.Gui.Pads
if (view.Selection.GetSelected (out model, out iter)) {
iter = filter.ConvertIterToChildIter (sort.ConvertIterToChildIter (iter));
store.SetValue (iter, DataColumns.Read, true);
- Task task = store.GetValue (iter, DataColumns.Task) as Task;
+ TaskListEntry task = store.GetValue (iter, DataColumns.Task) as TaskListEntry;
if (task != null) {
TaskService.ShowStatus (task);
task.JumpToPosition ();
@@ -604,7 +641,7 @@ namespace MonoDevelop.Ide.Gui.Pads
static void ToggleDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
Gtk.CellRendererToggle toggleRenderer = (Gtk.CellRendererToggle)cell;
- Task task = model.GetValue (iter, DataColumns.Task) as Task;
+ TaskListEntry task = model.GetValue (iter, DataColumns.Task) as TaskListEntry;
if (task == null) {
toggleRenderer.Visible = false;
return;
@@ -615,7 +652,7 @@ namespace MonoDevelop.Ide.Gui.Pads
static void LineDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
Gtk.CellRendererText textRenderer = (Gtk.CellRendererText)cell;
- Task task = model.GetValue (iter, DataColumns.Task) as Task;
+ TaskListEntry task = model.GetValue (iter, DataColumns.Task) as TaskListEntry;
if (task == null) {
textRenderer.Text = "";
return;
@@ -626,11 +663,11 @@ namespace MonoDevelop.Ide.Gui.Pads
static void DescriptionDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
var textRenderer = (CellRendererText)cell;
- Task task = model.GetValue (iter, DataColumns.Task) as Task;
+ TaskListEntry task = model.GetValue (iter, DataColumns.Task) as TaskListEntry;
var text = model.GetValue (iter, DataColumns.Description) as string;
if (task == null) {
if (model.IterParent (out iter, iter)) {
- task = model.GetValue (iter, DataColumns.Task) as Task;
+ task = model.GetValue (iter, DataColumns.Task) as TaskListEntry;
if (task == null) {
textRenderer.Text = "";
return;
@@ -646,7 +683,7 @@ namespace MonoDevelop.Ide.Gui.Pads
static void FileDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
Gtk.CellRendererText textRenderer = (Gtk.CellRendererText)cell;
- Task task = model.GetValue (iter, DataColumns.Task) as Task;
+ TaskListEntry task = model.GetValue (iter, DataColumns.Task) as TaskListEntry;
if (task == null) {
textRenderer.Text = "";
return;
@@ -664,7 +701,7 @@ namespace MonoDevelop.Ide.Gui.Pads
SetText (textRenderer, model, iter, task, fileName);
}
- static string GetPath (Task task)
+ static string GetPath (TaskListEntry task)
{
if (task.WorkspaceObject != null)
return FileService.AbsoluteToRelativePath (task.WorkspaceObject.BaseDirectory, task.FileName);
@@ -675,7 +712,7 @@ namespace MonoDevelop.Ide.Gui.Pads
static void ProjectDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
Gtk.CellRendererText textRenderer = (Gtk.CellRendererText)cell;
- Task task = model.GetValue (iter, DataColumns.Task) as Task;
+ TaskListEntry task = model.GetValue (iter, DataColumns.Task) as TaskListEntry;
if (task == null) {
textRenderer.Text = "";
return;
@@ -683,15 +720,15 @@ namespace MonoDevelop.Ide.Gui.Pads
SetText (textRenderer, model, iter, task, GetProject(task));
}
- static string GetProject (Task task)
+ static string GetProject (TaskListEntry task)
{
- return (task != null && task.WorkspaceObject is SolutionItem)? task.WorkspaceObject.Name: string.Empty;
+ return (task != null && task.WorkspaceObject is SolutionFolderItem)? task.WorkspaceObject.Name: string.Empty;
}
static void PathDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
Gtk.CellRendererText textRenderer = (Gtk.CellRendererText)cell;
- Task task = model.GetValue (iter, DataColumns.Task) as Task;
+ TaskListEntry task = model.GetValue (iter, DataColumns.Task) as TaskListEntry;
if (task == null) {
textRenderer.Text = "";
return;
@@ -702,7 +739,7 @@ namespace MonoDevelop.Ide.Gui.Pads
static void CategoryDataFunc (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
Gtk.CellRendererText textRenderer = (Gtk.CellRendererText)cell;
- Task task = model.GetValue (iter, DataColumns.Task) as Task;
+ var task = model.GetValue (iter, DataColumns.Task) as TaskListEntry;
if (task == null) {
textRenderer.Text = "";
return;
@@ -710,7 +747,7 @@ namespace MonoDevelop.Ide.Gui.Pads
SetText (textRenderer, model, iter, task, task.Category ?? "");
}
- static void SetText (CellRendererText textRenderer, TreeModel model, TreeIter iter, Task task, string text)
+ static void SetText (CellRendererText textRenderer, TreeModel model, TreeIter iter, TaskListEntry task, string text)
{
textRenderer.Text = text;
textRenderer.Weight = (int)((bool)model.GetValue (iter, DataColumns.Read) ? Pango.Weight.Normal : Pango.Weight.Bold);
@@ -727,10 +764,6 @@ namespace MonoDevelop.Ide.Gui.Pads
Clear();
}
- public void Dispose ()
- {
- }
-
void OnRowActivated (object o, RowActivatedArgs args)
{
OnTaskJumpto (null, null);
@@ -741,9 +774,9 @@ namespace MonoDevelop.Ide.Gui.Pads
void FilterChanged (object sender, EventArgs e)
{
- PropertyService.Set (showErrorsPropertyName, errorBtn.Active);
- PropertyService.Set (showWarningsPropertyName, warnBtn.Active);
- PropertyService.Set (showMessagesPropertyName, msgBtn.Active);
+ ShowErrors.Value = errorBtn.Active;
+ ShowWarnings.Value = warnBtn.Active;
+ ShowMessages.Value = msgBtn.Active;
filter.Refilter ();
}
@@ -753,7 +786,7 @@ namespace MonoDevelop.Ide.Gui.Pads
bool canShow = false;
try {
- Task task = store.GetValue (iter, DataColumns.Task) as Task;
+ TaskListEntry task = store.GetValue (iter, DataColumns.Task) as TaskListEntry;
if (task == null)
return true;
if (task.Severity == TaskSeverity.Error && errorBtn.Active) canShow = true;
@@ -805,10 +838,10 @@ namespace MonoDevelop.Ide.Gui.Pads
AddTasks (e.Tasks);
}
- public void AddTasks (IEnumerable<Task> tasks)
+ public void AddTasks (IEnumerable<TaskListEntry> tasks)
{
int n = 1;
- foreach (Task t in tasks) {
+ foreach (TaskListEntry t in tasks) {
AddTaskInternal (t);
if ((n++ % 100) == 0) {
// Adding many tasks is a bit slow, so refresh the
@@ -819,13 +852,13 @@ namespace MonoDevelop.Ide.Gui.Pads
filter.Refilter ();
}
- public void AddTask (Task t)
+ public void AddTask (TaskListEntry t)
{
AddTaskInternal (t);
filter.Refilter ();
}
- void AddTaskInternal (Task t)
+ void AddTaskInternal (TaskListEntry t)
{
if (tasks.Contains (t)) return;
@@ -864,37 +897,34 @@ namespace MonoDevelop.Ide.Gui.Pads
void UpdateErrorsNum ()
{
- errorBtn.Label = " " + string.Format(GettextCatalog.GetPluralString("{0} Error", "{0} Errors", errorCount), errorCount);
- errorBtn.Image.Show ();
+ errorBtnLbl.Text = " " + string.Format(GettextCatalog.GetPluralString("{0} Error", "{0} Errors", errorCount), errorCount);
}
void UpdateWarningsNum ()
{
- warnBtn.Label = " " + string.Format(GettextCatalog.GetPluralString("{0} Warning", "{0} Warnings", warningCount), warningCount);
- warnBtn.Image.Show ();
+ warnBtnLbl.Text = " " + string.Format(GettextCatalog.GetPluralString("{0} Warning", "{0} Warnings", warningCount), warningCount);
}
void UpdateMessagesNum ()
{
- msgBtn.Label = " " + string.Format(GettextCatalog.GetPluralString("{0} Message", "{0} Messages", infoCount), infoCount);
- msgBtn.Image.Show ();
+ msgBtnLbl.Text = " " + string.Format(GettextCatalog.GetPluralString("{0} Message", "{0} Messages", infoCount), infoCount);
}
void UpdatePadIcon ()
{
if (errorCount > 0)
- window.Icon = "md-errors-list-has-errors";
+ Window.Icon = "md-errors-list-has-errors";
else if (warningCount > 0)
- window.Icon = "md-errors-list-has-warnings";
+ Window.Icon = "md-errors-list-has-warnings";
else
- window.Icon = "md-errors-list";
+ Window.Icon = "md-errors-list";
}
private void ItemToggled (object o, ToggledArgs args)
{
Gtk.TreeIter iter;
if (store.GetIterFromString (out iter, args.Path)) {
- Task task = (Task)store.GetValue (iter, DataColumns.Task);
+ TaskListEntry task = (TaskListEntry)store.GetValue (iter, DataColumns.Task);
task.Completed = !task.Completed;
TaskService.FireTaskToggleEvent (this, new TaskEventArgs (task));
}
@@ -902,8 +932,8 @@ namespace MonoDevelop.Ide.Gui.Pads
static int SeverityIterSort(TreeModel model, TreeIter a, TreeIter z)
{
- Task aTask = model.GetValue(a, DataColumns.Task) as Task,
- zTask = model.GetValue(z, DataColumns.Task) as Task;
+ TaskListEntry aTask = model.GetValue(a, DataColumns.Task) as TaskListEntry,
+ zTask = model.GetValue(z, DataColumns.Task) as TaskListEntry;
return (aTask != null && zTask != null) ?
aTask.Severity.CompareTo(zTask.Severity) :
@@ -912,8 +942,8 @@ namespace MonoDevelop.Ide.Gui.Pads
static int ProjectIterSort (TreeModel model, TreeIter a, TreeIter z)
{
- Task aTask = model.GetValue (a, DataColumns.Task) as Task,
- zTask = model.GetValue (z, DataColumns.Task) as Task;
+ TaskListEntry aTask = model.GetValue (a, DataColumns.Task) as TaskListEntry,
+ zTask = model.GetValue (z, DataColumns.Task) as TaskListEntry;
return (aTask != null && zTask != null) ?
GetProject (aTask).CompareTo (GetProject (zTask)) :
@@ -922,8 +952,8 @@ namespace MonoDevelop.Ide.Gui.Pads
static int FileIterSort (TreeModel model, TreeIter a, TreeIter z)
{
- Task aTask = model.GetValue (a, DataColumns.Task) as Task,
- zTask = model.GetValue (z, DataColumns.Task) as Task;
+ TaskListEntry aTask = model.GetValue (a, DataColumns.Task) as TaskListEntry,
+ zTask = model.GetValue (z, DataColumns.Task) as TaskListEntry;
return (aTask != null && zTask != null) ?
aTask.FileName.CompareTo (zTask.FileName) :
@@ -933,7 +963,7 @@ namespace MonoDevelop.Ide.Gui.Pads
void HandleLogBtnToggled (object sender, EventArgs e)
{
var visible = logBtn.Active;
- PropertyService.Set (outputViewVisiblePropertyName, visible);
+ OutputViewVisible.Value = visible;
outputView.Visible = visible;
if (initialLogShow && visible && control.IsRealized) {
@@ -944,7 +974,7 @@ namespace MonoDevelop.Ide.Gui.Pads
void SetInitialOutputViewSize (int controlWidth)
{
- double relPos = PropertyService.Get<double> (logSeparatorPositionPropertyName, 0.5d);
+ double relPos = LogSeparatorPosition;
int pos = (int) (controlWidth * relPos);
pos = Math.Max (30, Math.Min (pos, controlWidth - 30));
control.Position = pos;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs
index 0eb985da7d..ac494f3372 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs
@@ -35,18 +35,23 @@ using Monodoc;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Projects;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui.Pads
{
- internal class HelpTree : AbstractPadContent
+ internal class HelpTree : PadContent
{
TreeStore store;
MonoDevelop.Ide.Gui.Components.PadTreeView tree_view;
ScrolledWindow scroller;
TreeIter root_iter;
+
+ public override string Id {
+ get { return "MonoDevelop.Ide.Gui.Pads.HelpTree"; }
+ }
- public HelpTree () : base (GettextCatalog.GetString ("Help"), Stock.Help)
+ public HelpTree ()
{
tree_view = new MonoDevelop.Ide.Gui.Components.PadTreeView ();
@@ -78,7 +83,7 @@ namespace MonoDevelop.Ide.Gui.Pads
} while (store.IterNext (ref child_iter));
}
}
- Control.ShowAll ();
+ scroller.ShowAll ();
}
Hashtable populated = new Hashtable ();
@@ -89,6 +94,7 @@ namespace MonoDevelop.Ide.Gui.Pads
return;
if (populated.ContainsKey (node))
return;
+#pragma warning disable 618
if (node.Nodes == null)
return;
TreeIter iter;
@@ -115,6 +121,7 @@ namespace MonoDevelop.Ide.Gui.Pads
}
}
+#pragma warning disable 618
void PopulateNode (TreeIter parent)
{
Node node = (Node)store.GetValue (parent, 1);
@@ -126,7 +133,7 @@ namespace MonoDevelop.Ide.Gui.Pads
}
}
- public override Gtk.Widget Control {
+ public override Control Control {
get { return scroller; }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TaskListPad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TaskListPad.cs
index 4f7b747dce..0ce44e321e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TaskListPad.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TaskListPad.cs
@@ -41,10 +41,11 @@ using MonoDevelop.Projects;
using Gtk;
using Gdk;
using MonoDevelop.Components.Docking;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui.Pads
{
- class TaskListPad : IPadContent
+ class TaskListPad : PadContent
{
Widget control;
ITaskListView activeView;
@@ -58,31 +59,20 @@ namespace MonoDevelop.Ide.Gui.Pads
//content view
ScrolledWindow sw;
- public Gtk.Widget Control {
+ public override Control Control {
get {
return control;
}
}
- public string Id {
- get { return "MonoDevelop.Ide.Gui.Pads.TaskListPad"; }
- }
-
public string DefaultPlacement {
get { return "Bottom"; }
}
- public void RedrawContent()
- {
- control.QueueDraw ();
- }
-
- public void Dispose ()
- {
- }
-
public TaskListPad ()
- {
+ {
+ Id = "MonoDevelop.Ide.Gui.Pads.TaskListPad";
+
VBox vbox = new VBox ();
switcherComboList = new ListStore (typeof (string), typeof (ITaskListView), typeof (string));
@@ -127,15 +117,14 @@ namespace MonoDevelop.Ide.Gui.Pads
switcherCombo.Active = pos;
}
- void IPadContent.Initialize (IPadWindow window)
+ override protected void Initialize (IPadWindow window)
{
- toolbar = window.GetToolbar (PositionType.Top);
+ separator = new VSeparator ();
+ toolbar = window.GetToolbar (DockPositionType.Top);
toolbar.Add (switcherCombo);
toolbar.ShowAll ();
switcherCombo.Changed += new EventHandler (OnContentSwitched);
OnContentSwitched (null, null);
-
- separator = new VSeparator ();
}
void OnContentSwitched (object obj, EventArgs e)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs
index 421845feda..281911c168 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs
@@ -38,7 +38,7 @@ namespace MonoDevelop.Ide.Gui.Pads
/// <summary>
/// This class implements a project browser.
/// </summary>
- public class TreeViewPad : AbstractPadContent, IMementoCapable, ICommandDelegatorRouter
+ public class TreeViewPad : PadContent, IMementoCapable, ICommandDelegatorRouter
{
internal Action Initializer;
@@ -50,7 +50,7 @@ namespace MonoDevelop.Ide.Gui.Pads
}
}
- public override Gtk.Widget Control {
+ public override Control Control {
get {
return treeView;
}
@@ -62,7 +62,7 @@ namespace MonoDevelop.Ide.Gui.Pads
treeView.Tree.EnableAutoTooltips ();
}
- public override void Initialize (IPadWindow container)
+ protected override void Initialize (IPadWindow container)
{
base.Initialize (container);
TreeView.Id = Id;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractAttachableViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractAttachableViewContent.cs
deleted file mode 100644
index 26ee6fd478..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractAttachableViewContent.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// AbstractAttachableViewContent.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-
-namespace MonoDevelop.Ide.Gui
-{
- public abstract class AbstractAttachableViewContent : AbstractBaseViewContent, IAttachableViewContent
- {
- public virtual void Selected ()
- {
- }
-
- public virtual void Deselected ()
- {
- }
-
- public virtual void BeforeSave ()
- {
- }
-
- public virtual void BaseContentChanged ()
- {
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractBaseViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractBaseViewContent.cs
deleted file mode 100644
index 392f2e6744..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractBaseViewContent.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-// AbstractBaseViewContent.cs
-//
-// Author:
-// Viktoria Dudka (viktoriad@remobjects.com)
-//
-// Copyright (c) 2009 RemObjects Software
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Ide.Gui
-{
- public abstract class AbstractBaseViewContent : IBaseViewContent
- {
- IWorkbenchWindow workbenchWindow = null;
-
- #region IBaseViewContent Members
-
- public abstract Gtk.Widget Control { get; }
-
- public virtual IWorkbenchWindow WorkbenchWindow {
- get { return workbenchWindow; }
- set {
- if (workbenchWindow != value) {
- workbenchWindow = value;
- OnWorkbenchWindowChanged (EventArgs.Empty);
- }
- }
- }
-
- public virtual string TabPageLabel { get { return GettextCatalog.GetString ("Content"); } }
-
- public virtual void RedrawContent ()
- {
- }
-
- public virtual bool CanReuseView (string fileName)
- {
- return false;
- }
-
- public virtual object GetContent (Type type)
- {
- if (type.IsInstanceOfType (this))
- return this;
- else
- return null;
- }
-
- #endregion
-
- #region IDisposable Members
-
- public virtual void Dispose ()
- {
- }
-
- #endregion
-
- public event EventHandler WorkbenchWindowChanged;
-
- protected virtual void OnWorkbenchWindowChanged (EventArgs e)
- {
- if (WorkbenchWindowChanged != null) {
- WorkbenchWindowChanged (this, e);
- }
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractPadContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractPadContent.cs
deleted file mode 100644
index 2000c9c0c4..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractPadContent.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-// AbstractPadContent.cs
-//
-// Author:
-// Viktoria Dudka (viktoriad@remobjects.com)
-//
-// Copyright (c) 2009 RemObjects Software
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Ide.Gui
-{
- public abstract class AbstractPadContent : IPadContent
- {
- protected AbstractPadContent () : this (null, null)
- {
- }
-
- public AbstractPadContent (string title) : this (title, null)
- {
- }
-
- private IconId icon;
- private string title;
- public AbstractPadContent (string title, IconId icon)
- {
- this.Id = GetType ().FullName;
- this.icon = icon;
- this.title = title;
- }
-
- public string Id { get; set; }
-
- private IPadWindow window = null;
- public IPadWindow Window {
- get { return window; }
- }
-
- #region IPadContent Members
-
- public virtual void Initialize (IPadWindow container)
- {
- if (title != null)
- container.Title = title;
-
- if (icon != IconId.Null)
- container.Icon = icon;
-
- window = container;
- }
-
- public abstract Gtk.Widget Control {
- get;
- }
-
- public virtual void RedrawContent ()
- {
- }
-
- #endregion
-
- #region IDisposable Members
-
- public virtual void Dispose ()
- {
- }
-
- #endregion
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractViewContent.cs
deleted file mode 100644
index 00eb11bfa8..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/AbstractViewContent.cs
+++ /dev/null
@@ -1,168 +0,0 @@
-// AbstractViewContent.cs
-//
-// Author:
-// Viktoria Dudka (viktoriad@remobjects.com)
-//
-// Copyright (c) 2009 RemObjects Software
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using MonoDevelop.Core;
-using MonoDevelop.Projects;
-using Xwt;
-
-namespace MonoDevelop.Ide.Gui
-{
- public abstract class AbstractViewContent : AbstractBaseViewContent, IViewContent
- {
- #region IViewContent Members
-
- private string untitledName = "";
- public virtual string UntitledName {
- get { return untitledName; }
- set { untitledName = value; }
- }
-
- private string contentName;
- public virtual string ContentName {
- get { return contentName; }
- set {
- if (value != contentName) {
- contentName = value;
- OnContentNameChanged (EventArgs.Empty);
- }
- }
- }
-
- public bool IsUntitled {
- get { return (contentName == null); }
- }
-
- private bool isDirty;
- public virtual bool IsDirty {
- get { return isDirty; }
- set {
- if (value != isDirty) {
- isDirty = value;
- OnDirtyChanged (EventArgs.Empty);
- }
- }
- }
-
- public virtual bool IsReadOnly {
- get { return false; }
- }
-
-
- public virtual bool IsHidden {
- get { return false; }
- }
-
- public virtual bool IsViewOnly { get; set; }
-
- public virtual bool IsFile {
- get { return true; }
- }
-
- public virtual string StockIconId {
- get { return null; }
- }
-
- public virtual Project Project { get; set; }
-
- public string PathRelativeToProject {
- get { return Project == null ? null : FileService.AbsoluteToRelativePath (Project.BaseDirectory, ContentName); }
- }
-
- public virtual void Save ()
- {
- OnBeforeSave (EventArgs.Empty);
- this.Save (contentName);
- }
-
- public virtual void Save (string fileName)
- {
- throw new NotImplementedException ();
- }
-
- public virtual void DiscardChanges ()
- {
- }
-
- public abstract void Load (string fileName);
-
- public virtual void LoadNew (System.IO.Stream content, string mimeType)
- {
- throw new NotSupportedException ();
- }
-
- public event EventHandler ContentNameChanged;
-
- public event EventHandler DirtyChanged;
-
- public event EventHandler BeforeSave;
-
- public event EventHandler ContentChanged;
-
- #endregion
-
-
- public virtual void OnContentChanged (EventArgs e)
- {
- if (ContentChanged != null)
- ContentChanged (this, e);
- }
-
- public virtual void OnDirtyChanged (EventArgs e)
- {
- if (DirtyChanged != null)
- DirtyChanged (this, e);
- }
-
- public virtual void OnBeforeSave (EventArgs e)
- {
- if (BeforeSave != null)
- BeforeSave (this, e);
- }
-
- public virtual void OnContentNameChanged (EventArgs e)
- {
- if (ContentNameChanged != null)
- ContentNameChanged (this, e);
- }
- }
-
- public abstract class AbstractXwtViewContent :AbstractViewContent
- {
- public override Gtk.Widget Control {
- get {
- return (Gtk.Widget)Toolkit.CurrentEngine.GetNativeWidget (Widget);
- }
- }
-
- public abstract Xwt.Widget Widget {
- get;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs
index 4fa2e70f60..25aac3297a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/BackgroundProgressMonitor.cs
@@ -33,7 +33,7 @@ using Gtk;
namespace MonoDevelop.Ide.Gui
{
- class BackgroundProgressMonitor: SimpleProgressMonitor
+ class BackgroundProgressMonitor: ProgressMonitor
{
string title;
StatusBarIcon icon;
@@ -56,10 +56,10 @@ namespace MonoDevelop.Ide.Gui
if (icon == null)
return;
string tip;
- if (Tracker.UnknownWork)
- tip = string.Format ("{0}\n{1}", title, Tracker.CurrentTask);
+ if (ProgressIsUnknown)
+ tip = string.Format ("{0}\n{1}", title, CurrentTaskName);
else
- tip = string.Format ("{0} ({1}%)\n{2}", title, (int)(Tracker.GlobalWork * 100), Tracker.CurrentTask);
+ tip = string.Format ("{0} ({1}%)\n{2}", title, (int)(Progress * 100), CurrentTaskName);
Application.Invoke (delegate {
if (icon != null)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/BaseViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/BaseViewContent.cs
new file mode 100644
index 0000000000..a879a3d30c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/BaseViewContent.cs
@@ -0,0 +1,166 @@
+// BaseViewContent.cs
+//
+// Author:
+// Viktoria Dudka (viktoriad@remobjects.com)
+//
+// Copyright (c) 2009 RemObjects Software
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using System.Text;
+using MonoDevelop.Components;
+using MonoDevelop.Core;
+using System.Collections.Immutable;
+using MonoDevelop.Projects;
+
+namespace MonoDevelop.Ide.Gui
+{
+ public abstract class BaseViewContent : IDisposable
+ {
+ IWorkbenchWindow workbenchWindow;
+ Project project;
+
+ public abstract Control Control { get; }
+
+ public IWorkbenchWindow WorkbenchWindow {
+ get { return workbenchWindow; }
+ set {
+ if (workbenchWindow != value) {
+ workbenchWindow = value;
+ OnWorkbenchWindowChanged ();
+ }
+ }
+ }
+
+ public virtual string TabPageLabel {
+ get {
+ return GettextCatalog.GetString ("Content");
+ }
+ }
+
+ public virtual bool CanReuseView (string fileName)
+ {
+ return false;
+ }
+
+ public object GetContent (Type type)
+ {
+ return GetContents (type).FirstOrDefault ();
+ }
+
+ public T GetContent<T> () where T : class
+ {
+ return GetContents<T> ().FirstOrDefault ();
+ }
+
+ public IEnumerable<T> GetContents<T> () where T : class
+ {
+ return OnGetContents (typeof (T)).Cast<T> ();
+ }
+
+ public IEnumerable<object> GetContents (Type type)
+ {
+ return OnGetContents (type);
+ }
+
+ protected virtual object OnGetContent (Type type)
+ {
+ if (type.IsInstanceOfType (this))
+ return this;
+ else
+ return null;
+ }
+
+ protected virtual IEnumerable<object> OnGetContents (Type type)
+ {
+ var c = OnGetContent (type);
+ if (c != null)
+ yield return c;
+ }
+
+ public virtual void Dispose ()
+ {
+ }
+
+ protected virtual void OnWorkbenchWindowChanged ()
+ {
+ }
+
+ internal protected virtual void OnSelected ()
+ {
+ }
+
+ internal protected virtual void OnDeselected ()
+ {
+ }
+
+ /// <summary>
+ /// Gets or sets the project bound to the view
+ /// </summary>
+ public Project Project {
+ get {
+ return project;
+ }
+ set {
+ OnSetProject (value);
+ }
+ }
+
+ /// <summary>
+ /// Called to update the project bound to the view.
+ /// </summary>
+ /// <param name="project">
+ /// New project assigned to the view. It can be null.
+ /// </param>
+ protected virtual void OnSetProject (Project project)
+ {
+ this.project = project;
+ }
+
+ /// <summary>
+ /// Gets the capability of this view for being reassigned a project
+ /// </summary>
+ /// <value>The project reload capability.</value>
+ public virtual ProjectReloadCapability ProjectReloadCapability {
+ get {
+ return ProjectReloadCapability.None;
+ }
+ }
+ }
+
+ public enum ProjectReloadCapability
+ {
+ None = 0,
+
+ /// <summary>
+ /// It can keep unsaved data. Some status (such as undo queue) may be lost.
+ /// </summary>
+ UnsavedData = 1,
+
+ /// <summary>
+ /// It can keep unsaved data and status.
+ /// </summary>
+ Full = 2
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/CommonTextEditorOptions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/CommonTextEditorOptions.cs
deleted file mode 100644
index e04a6f9d14..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/CommonTextEditorOptions.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// CommonTextEditorOptions.cs
-//
-// Author:
-// Michael Hutchinson <mhutch@xamarin.com>
-//
-// Copyright (c) 2011 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Fonts;
-
-namespace MonoDevelop.Ide.Gui
-{
- /// <summary>
- /// Text editor options that subscribe to MonoDevelop common settings.
- /// </summary>
- public class CommonTextEditorOptions : Mono.TextEditor.TextEditorOptions
- {
- bool disposed = false;
-
- public CommonTextEditorOptions ()
- {
- PropertyService.PropertyChanged += PropertyServiceChanged;
- base.FontName = PropertyService.Get ("FontName", FontService.MonospaceFontName);
- base.ColorScheme = IdeApp.Preferences.ColorScheme;
- FontService.RegisterFontChangedCallback ("Editor", UpdateFont);
- }
-
- public override void Dispose ()
- {
- if (disposed)
- return;
- disposed = true;
- PropertyService.PropertyChanged -= PropertyServiceChanged;
- FontService.RemoveCallback (UpdateFont);
- }
-
- void UpdateFont ()
- {
- base.FontName = FontName;
- base.GutterFontName = GutterFontName;
- this.OnChanged (EventArgs.Empty);
- }
-
- void PropertyServiceChanged (object sender, PropertyChangedEventArgs e)
- {
- switch (e.Key) {
- case "ColorScheme": {
- string val = (string) e.NewValue;
- if (string.IsNullOrEmpty (val))
- val = "Default";
- base.ColorScheme = val;
- break;
- }
- }
- }
-
- public override string ColorScheme {
- set { throw new InvalidOperationException ("Set via global source editor options"); }
- }
-
- public override string FontName {
- get {
- return FontService.FilterFontName (FontService.GetUnderlyingFontName ("Editor"));
- }
- set {
- throw new InvalidOperationException ("Set via global source editor options");
- }
- }
- }
-} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ConfigurationComboBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ConfigurationComboBox.cs
index fb0a44eaf6..22a61119ec 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ConfigurationComboBox.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ConfigurationComboBox.cs
@@ -33,6 +33,7 @@ using MonoDevelop.Core;
using MonoDevelop.Core.Assemblies;
using MonoDevelop.Projects;
using MonoDevelop.Components.Commands;
+using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.Ide.Gui
{
@@ -82,8 +83,7 @@ namespace MonoDevelop.Ide.Gui
fd = null;
}
if (toolbar.IconSize == Gtk.IconSize.Menu || toolbar.IconSize == Gtk.IconSize.SmallToolbar) {
- fd = Style.FontDescription.Copy ();
- fd.Size = (int) (fd.Size * Pango.Scale.Small);
+ fd = FontService.SansFont.CopyModified (Styles.FontScale11);
}
combo.ModifyLabelFont (fd);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs
index 82a7646774..9cdd1ff266 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs
@@ -25,11 +25,11 @@
using System;
using System.IO;
-using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Drawing;
using System.Diagnostics;
using System.Linq;
+using System.Timers;
using MonoDevelop.Projects;
using Mono.Addins;
@@ -40,11 +40,9 @@ using MonoDevelop.Components.Commands;
using MonoDevelop.Components.Docking;
using GLib;
-using MonoDevelop.Components.DockToolbars;
using Gtk;
using MonoDevelop.Components;
using MonoDevelop.Ide.Extensions;
-using Mono.TextEditor;
using MonoDevelop.Components.MainToolbar;
using MonoDevelop.Components.DockNotebook;
@@ -71,7 +69,7 @@ namespace MonoDevelop.Ide.Gui
List<string> layouts = new List<string> ();
List<PadCodon> padContentCollection = new List<PadCodon> ();
- List<IViewContent> viewContentCollection = new List<IViewContent> ();
+ List<ViewContent> viewContentCollection = new List<ViewContent> ();
Dictionary<PadCodon, IPadWindow> padWindows = new Dictionary<PadCodon, IPadWindow> ();
Dictionary<IPadWindow, PadCodon> padCodons = new Dictionary<IPadWindow, PadCodon> ();
@@ -83,7 +81,7 @@ namespace MonoDevelop.Ide.Gui
Rectangle normalBounds = new Rectangle(0, 0, MinimumWidth, MinimumHeight);
Gtk.Container rootWidget;
- DockToolbarFrame toolbarFrame;
+ CommandFrame toolbarFrame;
DockFrame dock;
SdiDragNotebook tabControl;
Gtk.MenuBar topMenu;
@@ -92,6 +90,8 @@ namespace MonoDevelop.Ide.Gui
MainToolbarController toolbar;
MonoDevelopStatusBar bottomBar;
+ Timer saveTimer;
+
#if DUMMY_STRINGS_FOR_TRANSLATION_DO_NOT_COMPILE
private void DoNotCompile ()
{
@@ -101,6 +101,7 @@ namespace MonoDevelop.Ide.Gui
#endif
public event EventHandler ActiveWorkbenchWindowChanged;
+ public event EventHandler WorkbenchTabsChanged;
public MonoDevelop.Ide.StatusBar StatusBar {
get {
@@ -176,7 +177,7 @@ namespace MonoDevelop.Ide.Gui
var oldLayout = dock.CurrentLayout;
InitializeLayout (value);
- toolbarFrame.CurrentLayout = dock.CurrentLayout = value;
+ dock.CurrentLayout = value;
DestroyFullViewLayouts (oldLayout);
@@ -198,7 +199,7 @@ namespace MonoDevelop.Ide.Gui
}
}
- internal List<IViewContent> InternalViewContentCollection {
+ internal List<ViewContent> InternalViewContentCollection {
get {
Debug.Assert(viewContentCollection != null);
return viewContentCollection;
@@ -207,19 +208,26 @@ namespace MonoDevelop.Ide.Gui
public DefaultWorkbench()
{
- Title = BrandingService.ApplicationName;
+ Title = BrandingService.ApplicationLongName;
LoggingService.LogInfo ("Creating DefaultWorkbench");
WidthRequest = normalBounds.Width;
HeightRequest = normalBounds.Height;
DeleteEvent += new Gtk.DeleteEventHandler (OnClosing);
+ BrandingService.ApplicationNameChanged += ApplicationNameChanged;
SetAppIcons ();
IdeApp.CommandService.SetRootWindow (this);
+ DockNotebook.NotebookChanged += NotebookPagesChanged;
}
-
+
+ void NotebookPagesChanged (object sender, EventArgs e)
+ {
+ WorkbenchTabsChanged?.Invoke (this, EventArgs.Empty);
+ }
+
void SetAppIcons ()
{
//first try to get the icon from the GTK icon theme
@@ -235,7 +243,7 @@ namespace MonoDevelop.Ide.Gui
var iconsEl = BrandingService.GetElement ("ApplicationIcons");
if (iconsEl != null) {
try {
- this.IconList = iconsEl.Elements ("Icon")
+ Gtk.Window.DefaultIconList = iconsEl.Elements ("Icon")
.Select (el => new Gdk.Pixbuf (BrandingService.GetFile ((string)el))).ToArray ();
return;
} catch (Exception ex) {
@@ -246,7 +254,7 @@ namespace MonoDevelop.Ide.Gui
//built-ins
var appIcon = ImageService.GetIcon (MonoDevelop.Ide.Gui.Stock.MonoDevelop);
- this.IconList = new Gdk.Pixbuf[] {
+ Gtk.Window.DefaultIconList = new Gdk.Pixbuf[] {
appIcon.ToPixbuf (Gtk.IconSize.Menu),
appIcon.ToPixbuf (Gtk.IconSize.Button),
appIcon.ToPixbuf (Gtk.IconSize.Dnd),
@@ -257,10 +265,10 @@ namespace MonoDevelop.Ide.Gui
public void InitializeWorkspace()
{
// FIXME: GTKize
- IdeApp.ProjectOperations.CurrentProjectChanged += (ProjectEventHandler) DispatchService.GuiDispatch (new ProjectEventHandler(SetProjectTitle));
+ IdeApp.ProjectOperations.CurrentProjectChanged += (s,a) => SetWorkbenchTitle ();
- FileService.FileRemoved += (EventHandler<FileEventArgs>) DispatchService.GuiDispatch (new EventHandler<FileEventArgs>(CheckRemovedFile));
- FileService.FileRenamed += (EventHandler<FileCopyEventArgs>) DispatchService.GuiDispatch (new EventHandler<FileCopyEventArgs>(CheckRenamedFile));
+ FileService.FileRemoved += CheckRemovedFile;
+ FileService.FileRenamed += CheckRenamedFile;
// TopMenu.Selected += new CommandHandler(OnTopMenuSelected);
// TopMenu.Deselected += new CommandHandler(OnTopMenuDeselected);
@@ -314,7 +322,7 @@ namespace MonoDevelop.Ide.Gui
topMenu = null;
}
- public void CloseContent (IViewContent content)
+ public void CloseContent (ViewContent content)
{
if (viewContentCollection.Contains(content)) {
if (content.Project != null)
@@ -327,8 +335,8 @@ namespace MonoDevelop.Ide.Gui
{
try {
closeAll = true;
- List<IViewContent> fullList = new List<IViewContent>(viewContentCollection);
- foreach (IViewContent content in fullList) {
+ List<ViewContent> fullList = new List<ViewContent>(viewContentCollection);
+ foreach (ViewContent content in fullList) {
IWorkbenchWindow window = content.WorkbenchWindow;
if (window != null)
window.CloseWindow(true);
@@ -339,11 +347,11 @@ namespace MonoDevelop.Ide.Gui
}
}
- private Xwt.Drawing.Image PrepareShowView (IViewContent content)
+ private Xwt.Drawing.Image PrepareShowView (ViewContent content)
{
viewContentCollection.Add (content);
- if (PropertyService.Get ("SharpDevelop.LoadDocumentProperties", true) && content is IMementoCapable) {
+ if (IdeApp.Preferences.LoadDocumentUserProperties && content is IMementoCapable) {
try {
Properties memento = GetStoredMemento(content);
if (memento != null) {
@@ -368,7 +376,7 @@ namespace MonoDevelop.Ide.Gui
return mimeimage;
}
- public virtual void ShowView (IViewContent content, bool bringToFront, DockNotebook notebook = null)
+ public virtual void ShowView (ViewContent content, bool bringToFront, IViewDisplayBinding binding = null, DockNotebook notebook = null)
{
bool isFile = content.IsFile;
if (!isFile) {
@@ -404,6 +412,10 @@ namespace MonoDevelop.Ide.Gui
sdiWorkspaceWindow.TitleChanged += delegate { SetWorkbenchTitle (); };
sdiWorkspaceWindow.Closed += CloseWindowEvent;
sdiWorkspaceWindow.Show ();
+ if (binding != null)
+ DisplayBindingService.AttachSubWindows (sdiWorkspaceWindow, binding);
+
+ sdiWorkspaceWindow.CreateCommandHandler ();
tab.Content = sdiWorkspaceWindow;
if (mimeimage != null)
@@ -527,9 +539,9 @@ namespace MonoDevelop.Ide.Gui
post = "*";
}
if (window.ViewContent.Project != null) {
- return window.ViewContent.Project.Name + " - " + window.ViewContent.PathRelativeToProject + post + " - " + BrandingService.ApplicationName;
+ return window.ViewContent.Project.Name + " - " + window.ViewContent.PathRelativeToProject + post + " - " + BrandingService.ApplicationLongName;
}
- return window.ViewContent.ContentName + post + " - " + BrandingService.ApplicationName;
+ return window.ViewContent.ContentName + post + " - " + BrandingService.ApplicationLongName;
}
void SetWorkbenchTitle ()
@@ -537,7 +549,7 @@ namespace MonoDevelop.Ide.Gui
try {
IWorkbenchWindow window = ActiveWorkbenchWindow;
if (window != null) {
- if (window.ActiveViewContent.Control.Toplevel == this)
+ if (window.ActiveViewContent.Control.GetNativeWidget<Gtk.Widget> ().Toplevel == this)
Title = GetTitle (window);
} else {
Title = GetDefaultTitle ();
@@ -552,11 +564,16 @@ namespace MonoDevelop.Ide.Gui
static string GetDefaultTitle ()
{
if (IdeApp.ProjectOperations.CurrentSelectedProject != null)
- return IdeApp.ProjectOperations.CurrentSelectedProject.Name + " - " + BrandingService.ApplicationName;
- return BrandingService.ApplicationName;
+ return IdeApp.ProjectOperations.CurrentSelectedProject.Name + " - " + BrandingService.ApplicationLongName;
+ return BrandingService.ApplicationLongName;
+ }
+
+ void ApplicationNameChanged (object sender, EventArgs e)
+ {
+ SetWorkbenchTitle ();
}
- public Properties GetStoredMemento (IViewContent content)
+ public Properties GetStoredMemento (ViewContent content)
{
if (content != null && content.ContentName != null) {
string directory = UserProfile.Current.CacheDir.Combine ("temp");
@@ -588,7 +605,6 @@ namespace MonoDevelop.Ide.Gui
}
memento.WindowState = GdkWindow.State;
memento.FullScreen = fullscreen;
- memento.ToolbarStatus = toolbarFrame.GetStatus ();
return memento.ToProperties ();
}
set {
@@ -610,7 +626,6 @@ namespace MonoDevelop.Ide.Gui
}
//GdkWindow.State = memento.WindowState;
FullScreen = memento.FullScreen;
- toolbarFrame.SetStatus (memento.ToolbarStatus);
}
Decorated = true;
}
@@ -618,20 +633,30 @@ namespace MonoDevelop.Ide.Gui
void CheckRemovedFile (object sender, FileEventArgs args)
{
- foreach (FileEventInfo e in args) {
+ foreach (var e in args) {
if (e.IsDirectory) {
- IViewContent[] views = new IViewContent [viewContentCollection.Count];
+ var views = new ViewContent [viewContentCollection.Count];
viewContentCollection.CopyTo (views, 0);
- foreach (IViewContent content in views) {
- if (content.ContentName.StartsWith (e.FileName)) {
- ((SdiWorkspaceWindow)content.WorkbenchWindow).CloseWindow (true, true);
+ foreach (var content in views) {
+ if (content.ContentName.StartsWith (e.FileName, StringComparison.CurrentCulture)) {
+ if (content.IsDirty) {
+ content.UntitledName = content.ContentName;
+ content.ContentName = null;
+ } else {
+ ((SdiWorkspaceWindow)content.WorkbenchWindow).CloseWindow (true, true);
+ }
}
}
} else {
- foreach (IViewContent content in viewContentCollection) {
+ foreach (var content in viewContentCollection) {
if (content.ContentName != null &&
content.ContentName == e.FileName) {
- ((SdiWorkspaceWindow)content.WorkbenchWindow).CloseWindow (true, true);
+ if (content.IsDirty) {
+ content.UntitledName = content.ContentName;
+ content.ContentName = null;
+ } else {
+ ((SdiWorkspaceWindow)content.WorkbenchWindow).CloseWindow (true, true);
+ }
return;
}
}
@@ -643,13 +668,13 @@ namespace MonoDevelop.Ide.Gui
{
foreach (FileCopyEventInfo e in args) {
if (e.IsDirectory) {
- foreach (IViewContent content in viewContentCollection) {
+ foreach (ViewContent content in viewContentCollection) {
if (content.ContentName != null && ((FilePath)content.ContentName).IsChildPathOf (e.SourceFile)) {
content.ContentName = e.TargetFile.Combine (((FilePath) content.ContentName).FileName);
}
}
} else {
- foreach (IViewContent content in viewContentCollection) {
+ foreach (ViewContent content in viewContentCollection) {
if (content.ContentName != null &&
content.ContentName == e.SourceFile) {
content.ContentName = e.TargetFile;
@@ -701,7 +726,7 @@ namespace MonoDevelop.Ide.Gui
bool showDirtyDialog = false;
- foreach (IViewContent content in viewContentCollection)
+ foreach (ViewContent content in viewContentCollection)
{
if (content.IsDirty) {
showDirtyDialog = true;
@@ -721,6 +746,8 @@ namespace MonoDevelop.Ide.Gui
return false;
CloseAllViews ();
+
+ BrandingService.ApplicationNameChanged -= ApplicationNameChanged;
PropertyService.Set ("SharpDevelop.Workbench.WorkbenchMemento", this.Memento);
IdeApp.OnExited ();
@@ -731,11 +758,6 @@ namespace MonoDevelop.Ide.Gui
return true;
}
- void SetProjectTitle(object sender, ProjectEventArgs e)
- {
- SetWorkbenchTitle ();
- }
-
int activeWindowChangeLock = 0;
public void LockActiveWindowChangeEvent ()
@@ -820,10 +842,27 @@ namespace MonoDevelop.Ide.Gui
// Create the docking widget and add it to the window.
dock = new DockFrame ();
-
- dock.CompactGuiLevel = ((int)IdeApp.Preferences.WorkbenchCompactness) + 1;
- IdeApp.Preferences.WorkbenchCompactnessChanged += delegate {
- dock.CompactGuiLevel = ((int)IdeApp.Preferences.WorkbenchCompactness) + 1;
+ dock.LayoutChanged += (o, e) => {
+ if (saveTimer != null) {
+ saveTimer.Stop ();
+ saveTimer.Dispose ();
+ }
+
+ // Save the layout changes after 10 seconds.
+ saveTimer = new Timer (10000);
+ saveTimer.Elapsed += (s, ev) => {
+ Runtime.RunInMainThread (() => {
+ dock.SaveLayouts (configFile);
+ saveTimer.Dispose ();
+ saveTimer = null;
+ });
+ };
+ saveTimer.Start ();
+ };
+
+ dock.CompactGuiLevel = ((int)IdeApp.Preferences.WorkbenchCompactness.Value) + 1;
+ IdeApp.Preferences.WorkbenchCompactness.Changed += delegate {
+ dock.CompactGuiLevel = ((int)IdeApp.Preferences.WorkbenchCompactness.Value) + 1;
};
/* Side bar is experimental. Disabled for now
@@ -840,7 +879,7 @@ namespace MonoDevelop.Ide.Gui
toolbarFrame.AddContent (hbox);
*/
- toolbarFrame.AddContent (dock);
+ toolbarFrame.Add (dock);
// Create the notebook for the various documents.
tabControl = new SdiDragNotebook (this);
@@ -859,7 +898,6 @@ namespace MonoDevelop.Ide.Gui
// correct style (the style of the window). At this point the widget is not yet a child
// of the window, so its style is not yet the correct one.
tabControl.InitSize ();
- var barHeight = tabControl.BarHeight;
// The main document area
documentDockItem = dock.AddItem ("Documents");
@@ -869,32 +907,8 @@ namespace MonoDevelop.Ide.Gui
documentDockItem.Label = GettextCatalog.GetString ("Documents");
documentDockItem.Content = new DockNotebookContainer (tabControl, true);
- DockVisualStyle style = new DockVisualStyle ();
- style.PadTitleLabelColor = Styles.PadLabelColor;
- style.PadBackgroundColor = Styles.PadBackground;
- style.InactivePadBackgroundColor = Styles.InactivePadBackground;
- style.PadTitleHeight = barHeight;
- dock.DefaultVisualStyle = style;
-
- style = new DockVisualStyle ();
- style.PadTitleLabelColor = Styles.PadLabelColor;
- style.PadTitleHeight = barHeight;
- style.ShowPadTitleIcon = false;
- style.UppercaseTitles = false;
- style.ExpandedTabs = true;
- style.PadBackgroundColor = Styles.BrowserPadBackground;
- style.InactivePadBackgroundColor = Styles.InactiveBrowserPadBackground;
- style.TreeBackgroundColor = Styles.BrowserPadBackground;
- dock.SetDockItemStyle ("ProjectPad", style);
- dock.SetDockItemStyle ("ClassPad", style);
-
-// dock.SetRegionStyle ("Documents/Left", style);
- //dock.SetRegionStyle ("Documents/Right", style);
-
-// style = new DockVisualStyle ();
-// style.SingleColumnMode = true;
-// dock.SetRegionStyle ("Documents/Left;Documents/Right", style);
-// dock.SetDockItemStyle ("Documents", style);
+ LoadDockStyles ();
+ Styles.Changed += (sender, e) => LoadDockStyles ();
// Add some hiden items to be used as position reference
DockItem dit = dock.AddItem ("__left");
@@ -945,6 +959,45 @@ namespace MonoDevelop.Ide.Gui
LoggingService.LogError (ex.ToString ());
}
}
+
+ void LoadDockStyles ()
+ {
+ var barHeight = tabControl.BarHeight;
+
+ DockVisualStyle style = new DockVisualStyle ();
+ style.PadTitleLabelColor = Styles.PadLabelColor;
+ style.InactivePadTitleLabelColor = Styles.InactivePadLabelColor;
+ style.PadBackgroundColor = Styles.PadBackground;
+ style.TreeBackgroundColor = Styles.BaseBackgroundColor;
+ style.InactivePadBackgroundColor = Styles.InactivePadBackground;
+ style.PadTitleHeight = barHeight;
+ dock.DefaultVisualStyle = style;
+
+ style = new DockVisualStyle ();
+ style.PadTitleLabelColor = Styles.PadLabelColor;
+ style.InactivePadTitleLabelColor = Styles.InactivePadLabelColor;
+ style.PadTitleHeight = barHeight;
+ // style.ShowPadTitleIcon = false; // VV: Now we want to have icons on all pads
+ style.UppercaseTitles = false;
+ style.ExpandedTabs = true;
+ style.PadBackgroundColor = Styles.BrowserPadBackground;
+ style.InactivePadBackgroundColor = Styles.InactiveBrowserPadBackground;
+ style.TreeBackgroundColor = Styles.BrowserPadBackground;
+ dock.SetDockItemStyle ("ProjectPad", style);
+ dock.SetDockItemStyle ("ClassPad", style);
+
+
+
+ // dock.SetRegionStyle ("Documents/Left", style);
+ //dock.SetRegionStyle ("Documents/Right", style);
+
+ // style = new DockVisualStyle ();
+ // style.SingleColumnMode = true;
+ // dock.SetRegionStyle ("Documents/Left;Documents/Right", style);
+ // dock.SetDockItemStyle ("Documents", style);
+
+ dock.UpdateStyles ();
+ }
void InitializeLayout (string name)
{
@@ -1014,16 +1067,17 @@ namespace MonoDevelop.Ide.Gui
IdeApp.Workbench.ReorderDocuments (oldPlacement, newPlacement);
}
- public void ResetToolbars ()
- {
- toolbarFrame.ResetToolbarPositions ();
- }
-
bool IsInFullViewMode {
get {
return dock.CurrentLayout.EndsWith (fullViewModeTag);
}
}
+
+ protected override void OnStyleSet (Gtk.Style previous_style)
+ {
+ base.OnStyleSet (previous_style);
+ IdeTheme.UpdateStyles ();
+ }
protected override bool OnConfigureEvent (Gdk.EventConfigure evnt)
{
@@ -1060,7 +1114,6 @@ namespace MonoDevelop.Ide.Gui
{
if (oldLayout != null && oldLayout.EndsWith (fullViewModeTag)) {
dock.DeleteLayout (oldLayout);
- toolbarFrame.DeleteLayout (oldLayout);
}
}
@@ -1068,19 +1121,17 @@ namespace MonoDevelop.Ide.Gui
{
if (IsInFullViewMode) {
var oldLayout = dock.CurrentLayout;
- toolbarFrame.CurrentLayout = dock.CurrentLayout = CurrentLayout;
+ dock.CurrentLayout = CurrentLayout;
DestroyFullViewLayouts (oldLayout);
} else {
string fullViewLayout = CurrentLayout + fullViewModeTag;
if (!dock.HasLayout (fullViewLayout))
dock.CreateLayout (fullViewLayout, true);
- toolbarFrame.CurrentLayout = dock.CurrentLayout = fullViewLayout;
+ dock.CurrentLayout = fullViewLayout;
foreach (DockItem it in dock.GetItems ()) {
if (it.Behavior != DockItemBehavior.Locked && it.Visible)
it.Status = DockItemStatus.AutoHide;
}
- foreach (var tb in toolbarFrame.Toolbars)
- tb.Status = new DockToolbarStatus (tb.Id, false, tb.Position);
}
}
@@ -1281,18 +1332,12 @@ namespace MonoDevelop.Ide.Gui
void CreatePadContent (bool force, PadCodon padCodon, PadWindow window, DockItem item)
{
if (force || item.Content == null) {
- IPadContent newContent = padCodon.InitializePadContent (window);
+ PadContent newContent = padCodon.InitializePadContent (window);
- Gtk.Widget pcontent;
- if (newContent is Widget) {
- pcontent = newContent.Control;
- } else {
- PadCommandRouterContainer crc = new PadCommandRouterContainer (window, newContent.Control, newContent, true);
- crc.Show ();
- pcontent = crc;
- }
-
- PadCommandRouterContainer router = new PadCommandRouterContainer (window, pcontent, toolbarFrame, false);
+ Gtk.Widget crc = new PadCommandRouterContainer (window, newContent.Control, newContent, true);
+ crc.Show ();
+
+ Gtk.Widget router = new PadCommandRouterContainer (window, crc, toolbarFrame, false);
router.Show ();
item.Content = router;
}
@@ -1333,7 +1378,6 @@ namespace MonoDevelop.Ide.Gui
item.DefaultLocation = location;
item.DefaultVisible = false;
item.DefaultStatus = defaultStatus;
- item.DockLabelProvider = padCodon;
window.Item = item;
if (padCodon.Initialized) {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DisplayBindingService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DisplayBindingService.cs
index b7e908cc25..527ad99970 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DisplayBindingService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DisplayBindingService.cs
@@ -1,4 +1,4 @@
-// DisplayBindingService.cs
+// DisplayBindingService.cs
//
// Author:
// Mike Krüger <mkrueger@novell.com>
@@ -39,19 +39,37 @@ namespace MonoDevelop.Ide.Gui
{
public static class DisplayBindingService
{
+ private static List<IDisplayBinding> runtimeBindings = new List<IDisplayBinding>();
+
public static IEnumerable<T> GetBindings<T> ()
{
- return AddinManager.GetExtensionObjects ("/MonoDevelop/Ide/DisplayBindings")
- .OfType<T> ();
+ return runtimeBindings.OfType<T>().Concat(AddinManager.GetExtensionObjects ("/MonoDevelop/Ide/DisplayBindings")
+ .OfType<T> ());
}
-
+
+ public static void RegisterRuntimeDisplayBinding(IDisplayBinding binding)
+ {
+ runtimeBindings.Add(binding);
+ }
+
+ public static void DeregisterRuntimeDisplayBinding(IDisplayBinding binding)
+ {
+ runtimeBindings.Remove(binding);
+ }
+
internal static IEnumerable<IDisplayBinding> GetDisplayBindings (FilePath filePath, string mimeType, Project ownerProject)
{
if (mimeType == null && !filePath.IsNullOrEmpty)
mimeType = DesktopService.GetMimeTypeForUri (filePath);
foreach (var b in GetBindings<IDisplayBinding> ()) {
- if (b.CanHandle (filePath, mimeType, ownerProject))
+ bool canHandle = false;
+ try {
+ canHandle = b.CanHandle (filePath, mimeType, ownerProject);
+ } catch (Exception ex) {
+ LoggingService.LogError ("Error while getting display bindings", ex);
+ }
+ if (canHandle)
yield return b;
}
}
@@ -112,7 +130,7 @@ namespace MonoDevelop.Ide.Gui
//dummy binding, anchor point for extension tree
class DefaultDisplayBinding : IViewDisplayBinding
{
- public IViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
+ public ViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject)
{
throw new InvalidOperationException ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DockItemToolbarLoader.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DockItemToolbarLoader.cs
index a8e41c92ed..69c455b327 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DockItemToolbarLoader.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DockItemToolbarLoader.cs
@@ -29,16 +29,17 @@ using System.Drawing;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Codons;
using MonoDevelop.Core;
+using MonoDevelop.Components;
using MonoDevelop.Components.Docking;
using MonoDevelop.Components.Commands;
using Gtk;
using System.Collections.Generic;
-
+
namespace MonoDevelop.Ide.Gui
{
public static class DockItemToolbarLoader
{
- public static void Add (this DockItemToolbar toolbar, CommandEntrySet entrySet, Gtk.Widget commandTarget)
+ public static void Add (this DockItemToolbar toolbar, CommandEntrySet entrySet, Control commandTarget)
{
CommandDockBar dockBar = new CommandDockBar (toolbar, commandTarget);
foreach (CommandEntry entry in entrySet) {
@@ -75,7 +76,7 @@ namespace MonoDevelop.Ide.Gui
{
Widget w = CreateWidget (entry);
if (w is Button) {
- buttons.Add (new ToolButtonStatus (entry.CommandId, (Gtk.Button)w, entry.DispayType));
+ buttons.Add (new ToolButtonStatus (entry.CommandId, (Gtk.Button)w, entry.DisplayType));
((Gtk.Button) w).Clicked += delegate {
IdeApp.CommandService.DispatchCommand (entry.CommandId, null, initialTarget, CommandSource.MainToolbar);
};
@@ -141,6 +142,7 @@ namespace MonoDevelop.Ide.Gui
string stockId;
Button button;
object cmdId;
+ ImageView image;
CommandEntryDisplayType displayType;
public ToolButtonStatus (object cmdId, Button button, CommandEntryDisplayType displayType = CommandEntryDisplayType.Default)
@@ -185,8 +187,10 @@ namespace MonoDevelop.Ide.Gui
if (displayType != CommandEntryDisplayType.TextOnly && cmdInfo.Icon != stockId) {
stockId = cmdInfo.Icon;
- button.Image = new Gtk.Image (cmdInfo.Icon, Gtk.IconSize.Menu);
+ button.Image = image = new ImageView (cmdInfo.Icon, Gtk.IconSize.Menu);
}
+ if (button.Image != null && cmdInfo.Enabled != button.Sensitive)
+ image.Image = image.Image.WithStyles (cmdInfo.Enabled ? "" : "disabled").WithAlpha (cmdInfo.Enabled ? 1.0 : 0.4);
if (cmdInfo.Enabled != button.Sensitive)
button.Sensitive = cmdInfo.Enabled;
if (cmdInfo.Visible != button.Visible)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
index e471350082..5bd13071e7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
@@ -47,23 +47,26 @@ using MonoDevelop.Ide.Extensions;
using System.Linq;
using System.Threading;
using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem.Implementation;
using System.Text;
using System.Collections.ObjectModel;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.Options;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Highlighting;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Components.Extensions;
+using MonoDevelop.Projects.SharedAssetsProjects;
namespace MonoDevelop.Ide.Gui
{
- public class Document : ICSharpCode.NRefactory.AbstractAnnotatable
+
+ public class Document : DocumentContext
{
internal object MemoryProbe = Counters.DocumentsInMemory.CreateMemoryProbe ();
IWorkbenchWindow window;
- TextEditorExtension editorExtension;
ParsedDocument parsedDocument;
- IProjectContent singleFileContext;
- Mono.TextEditor.ITextEditorDataProvider provider = null;
+ Microsoft.CodeAnalysis.DocumentId analysisDocument;
const int ParseDelay = 600;
@@ -75,12 +78,20 @@ namespace MonoDevelop.Ide.Gui
get;
set;
}
-
- public TextEditorExtension EditorExtension {
- get { return this.editorExtension; }
+
+ /// <summary>
+ /// Returns the roslyn document for this document. This may return <c>null</c> if it's no compileable document.
+ /// Even if it's a C# file.
+ /// </summary>
+ public override Microsoft.CodeAnalysis.Document AnalysisDocument {
+ get {
+ if (analysisDocument == null)
+ return null;
+ return TypeSystemService.GetCodeAnalysisDocument (analysisDocument);
+ }
}
- public T GetContent<T> () where T : class
+ public override T GetContent<T> ()
{
if (window == null)
return null;
@@ -97,39 +108,36 @@ namespace MonoDevelop.Ide.Gui
return ret;
}
- //no, so look through the TexteditorExtensions as well
- TextEditorExtension nextExtension = editorExtension;
- while (nextExtension != null) {
- if (typeof(T).IsAssignableFrom (nextExtension.GetType ()))
- return nextExtension as T;
- nextExtension = nextExtension.Next as TextEditorExtension;
+ //If we didn't find in ActiveView or ViewContent... Try in SubViews
+ foreach (var subView in window.SubViewContents) {
+ foreach (var cnt in subView.GetContents<T> ()) {
+ return cnt;
+ }
}
+
return null;
}
-
- public IEnumerable<T> GetContents<T> () where T : class
+
+ internal ProjectReloadCapability ProjectReloadCapability {
+ get {
+ return Window.ViewContent.ProjectReloadCapability;
+ }
+ }
+
+ public override IEnumerable<T> GetContents<T> ()
{
- //check whether the ViewContent can return the type directly
- T ret = (T) Window.ActiveViewContent.GetContent (typeof(T));
- if (ret != null)
- yield return ret;
-
- //check the primary viewcontent
- //not sure if this is the right thing to do, but things depend on this behaviour
- if (Window.ViewContent != Window.ActiveViewContent) {
- ret = (T) Window.ViewContent.GetContent (typeof(T));
- if (ret != null)
- yield return ret;
+ foreach (var cnt in window.ViewContent.GetContents<T> ()) {
+ yield return cnt;
}
-
- //no, so look through the TexteditorExtensions as well
- TextEditorExtension nextExtension = editorExtension;
- while (nextExtension != null) {
- if (typeof(T).IsAssignableFrom (nextExtension.GetType ()))
- yield return nextExtension as T;
- nextExtension = nextExtension.Next as TextEditorExtension;
+
+ foreach (var subView in window.SubViewContents) {
+ foreach (var cnt in subView.GetContents<T> ()) {
+ yield return cnt;
+ }
}
}
+
+
static Document ()
{
if (IdeApp.Workbench != null) {
@@ -155,6 +163,20 @@ namespace MonoDevelop.Ide.Gui
if (window.ViewContent.Project != null)
window.ViewContent.Project.Modified += HandleProjectModified;
window.ViewsChanged += HandleViewsChanged;
+ window.ViewContent.ContentNameChanged += delegate {
+ UnsubscibeAnalysisdocument ();
+ };
+ MonoDevelopWorkspace.LoadingFinished += TypeSystemService_WorkspaceItemLoaded;
+ }
+
+ void TypeSystemService_WorkspaceItemLoaded (object sender, EventArgs e)
+ {
+ UnsubscibeAnalysisdocument ();
+ EnsureAnalysisDocumentIsOpen ().ContinueWith (delegate {
+ if (analysisDocument != null)
+ StartReparseThread ();
+ });
+
}
/* void UpdateRegisteredDom (object sender, ProjectDomEventArgs e)
@@ -182,13 +204,13 @@ namespace MonoDevelop.Ide.Gui
get { return !Window.ViewContent.IsViewOnly && (Window.ViewContent.ContentName == null || Window.ViewContent.IsDirty); }
set { Window.ViewContent.IsDirty = value; }
}
-
- public bool HasProject {
- get { return Window != null ? Window.ViewContent.Project != null : false; }
- }
-
- public Project Project {
- get { return Window != null ? Window.ViewContent.Project : null; }
+
+ FilePath adHocFile;
+ Project adhocProject;
+ Solution adhocSolution;
+
+ public override Project Project {
+ get { return (Window != null ? Window.ViewContent.Project : null); }
/* set {
Window.ViewContent.Project = value;
if (value != null)
@@ -199,7 +221,12 @@ namespace MonoDevelop.Ide.Gui
}*/
}
- public bool IsCompileableInProject {
+ internal override bool IsAdHocProject {
+ get { return adhocProject != null; }
+ }
+
+
+ public override bool IsCompileableInProject {
get {
var project = Project;
if (project == null)
@@ -220,19 +247,15 @@ namespace MonoDevelop.Ide.Gui
}
}
- public IProjectContent ProjectContent {
- get {
- return Project != null ? TypeSystemService.GetProjectContext (Project) : GetProjectContext ();
- }
- }
-
- public virtual ICompilation Compilation {
- get {
- return Project != null ? TypeSystemService.GetCompilation (Project) : GetProjectContext ().CreateCompilation ();
- }
+ public Task<Microsoft.CodeAnalysis.Compilation> GetCompilationAsync(CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var project = TypeSystemService.GetCodeAnalysisProject (adhocProject ?? Project);
+ if (project == null)
+ return new Task<Microsoft.CodeAnalysis.Compilation> (() => null);
+ return project.GetCompilationAsync (cancellationToken);
}
-
- public virtual ParsedDocument ParsedDocument {
+
+ public override ParsedDocument ParsedDocument {
get {
return parsedDocument;
}
@@ -290,7 +313,7 @@ namespace MonoDevelop.Ide.Gui
viewsRO = null;
}
- DocumentView WrapView (IBaseViewContent content)
+ DocumentView WrapView (BaseViewContent content)
{
if (content == null)
return null;
@@ -300,117 +323,132 @@ namespace MonoDevelop.Ide.Gui
return new DocumentView (this, content);
}
- public string Name {
+ public override string Name {
get {
- IViewContent view = Window.ViewContent;
+ ViewContent view = Window.ViewContent;
return view.IsUntitled ? view.UntitledName : view.ContentName;
}
}
- public Mono.TextEditor.TextEditorData Editor {
+ public TextEditor Editor {
get {
- if (provider == null) {
- provider = GetContent <Mono.TextEditor.ITextEditorDataProvider> ();
- if (provider == null)
- return null;
- }
- return provider.GetTextEditorData ();
+ return GetContent <TextEditor> ();
}
}
public bool IsViewOnly {
get { return Window.ViewContent.IsViewOnly; }
}
-
- public void Reload ()
+
+ public Task Reload ()
+ {
+ return ReloadTask ();
+ }
+
+ async Task ReloadTask ()
{
ICustomXmlSerializer memento = null;
IMementoCapable mc = GetContent<IMementoCapable> ();
if (mc != null) {
memento = mc.Memento;
}
- window.ViewContent.Load (window.ViewContent.ContentName);
+ window.ViewContent.DiscardChanges ();
+ await window.ViewContent.Load (new FileOpenInformation (window.ViewContent.ContentName) { IsReloadOperation = true });
if (memento != null) {
mc.Memento = memento;
}
}
-
- public void Save ()
+
+ public Task Save ()
+ {
+ return SaveTask ();
+ }
+
+ async Task SaveTask ()
{
// suspend type service "check all file loop" since we have already a parsed document.
// Or at least one that updates "soon".
- TypeSystemService.TrackFileChanges = false;
try {
+ // Freeze the file change events. There can be several such events, and sending them all together
+ // is more efficient
+ FileService.FreezeEvents ();
+
if (Window.ViewContent.IsViewOnly || !Window.ViewContent.IsDirty)
return;
if (!Window.ViewContent.IsFile) {
- Window.ViewContent.Save ();
+ await Window.ViewContent.Save ();
return;
}
if (Window.ViewContent.ContentName == null) {
- SaveAs ();
+ await SaveAs ();
} else {
- try {
- FileService.RequestFileEdit (Window.ViewContent.ContentName, true);
+ try {
+ FileService.RequestFileEdit ((FilePath)Window.ViewContent.ContentName, true);
} catch (Exception ex) {
MessageService.ShowError (GettextCatalog.GetString ("The file could not be saved."), ex.Message, ex);
}
FileAttributes attr = FileAttributes.ReadOnly | FileAttributes.Directory | FileAttributes.Offline | FileAttributes.System;
- if (!File.Exists (Window.ViewContent.ContentName) || (File.GetAttributes (window.ViewContent.ContentName) & attr) != 0) {
- SaveAs ();
+ if (!File.Exists ((string)Window.ViewContent.ContentName) || (File.GetAttributes ((string)window.ViewContent.ContentName) & attr) != 0) {
+ await SaveAs();
} else {
string fileName = Window.ViewContent.ContentName;
// save backup first
- if ((bool)PropertyService.Get ("SharpDevelop.CreateBackupCopy", false)) {
- Window.ViewContent.Save (fileName + "~");
- FileService.NotifyFileChanged (fileName);
- }
- Window.ViewContent.Save (fileName);
+ if (IdeApp.Preferences.CreateFileBackupCopies) {
+ await Window.ViewContent.Save (fileName + "~");
+ FileService.NotifyFileChanged (fileName + "~");
+ }
+ await Window.ViewContent.Save (fileName);
FileService.NotifyFileChanged (fileName);
- OnSaved (EventArgs.Empty);
+ OnSaved(EventArgs.Empty);
}
}
} finally {
+ // Send all file change notifications
+ FileService.ThawEvents ();
+
// Set the file time of the current document after the file time of the written file, to prevent double file updates.
// Note that the parsed document may be overwritten by a background thread to a more recent one.
var doc = parsedDocument;
- if (doc != null && doc.ParsedFile != null) {
+ if (doc != null) {
string fileName = Window.ViewContent.ContentName;
try {
// filename could be null if the user cancelled SaveAs and this is a new & unsaved file
if (fileName != null)
- doc.ParsedFile.LastWriteTime = File.GetLastWriteTimeUtc (fileName);
+ doc.LastWriteTimeUtc = File.GetLastWriteTimeUtc (fileName);
} catch (Exception e) {
- doc.ParsedFile.LastWriteTime = DateTime.UtcNow;
+ doc.LastWriteTimeUtc = DateTime.UtcNow;
LoggingService.LogWarning ("Exception while getting the write time from " + fileName, e);
}
}
- TypeSystemService.TrackFileChanges = true;
}
}
-
- public void SaveAs ()
+
+ public Task SaveAs ()
{
- SaveAs (null);
+ return SaveAs (null);
}
-
- public void SaveAs (string filename)
+
+ public Task SaveAs (string filename)
+ {
+ return SaveAsTask (filename);
+ }
+
+ async Task SaveAsTask (string filename)
{
if (Window.ViewContent.IsViewOnly || !Window.ViewContent.IsFile)
return;
-
Encoding encoding = null;
- IEncodedTextContent tbuffer = GetContent <IEncodedTextContent> ();
+ var tbuffer = GetContent <ITextSource> ();
if (tbuffer != null) {
- encoding = tbuffer.SourceEncoding;
+ encoding = tbuffer.Encoding;
if (encoding == null)
- encoding = Encoding.Default;
+ encoding = Encoding.UTF8;
}
if (filename == null) {
@@ -422,8 +460,8 @@ namespace MonoDevelop.Ide.Gui
if (Window.ViewContent.IsUntitled)
dlg.InitialFileName = Window.ViewContent.UntitledName;
else {
- dlg.CurrentFolder = Path.GetDirectoryName (Window.ViewContent.ContentName);
- dlg.InitialFileName = Path.GetFileName (Window.ViewContent.ContentName);
+ dlg.CurrentFolder = Path.GetDirectoryName ((string)Window.ViewContent.ContentName);
+ dlg.InitialFileName = Path.GetFileName ((string)Window.ViewContent.ContentName);
}
if (!dlg.Run ())
@@ -444,83 +482,30 @@ namespace MonoDevelop.Ide.Gui
}
// save backup first
- if ((bool)PropertyService.Get ("SharpDevelop.CreateBackupCopy", false)) {
+ if (IdeApp.Preferences.CreateFileBackupCopies) {
if (tbuffer != null && encoding != null)
- tbuffer.Save (filename + "~", encoding);
+ TextFileUtility.WriteText (filename + "~", tbuffer.Text, encoding, tbuffer.UseBOM);
else
- Window.ViewContent.Save (filename + "~");
+ await Window.ViewContent.Save (new FileSaveInformation (filename + "~", encoding));
}
TypeSystemService.RemoveSkippedfile (FileName);
// do actual save
- if (tbuffer != null && encoding != null)
- tbuffer.Save (filename, encoding);
- else
- Window.ViewContent.Save (filename);
-
- FileService.NotifyFileChanged (filename);
+ await Window.ViewContent.Save (new FileSaveInformation (filename, encoding));
DesktopService.RecentFiles.AddFile (filename, (Project)null);
OnSaved (EventArgs.Empty);
- UpdateParseDocument ();
- }
-
- public bool IsBuildTarget
- {
- get
- {
- if (this.IsViewOnly)
- return false;
- if (Window.ViewContent.ContentName != null)
- return Services.ProjectService.CanCreateSingleFileProject(Window.ViewContent.ContentName);
-
- return false;
- }
- }
-
- public IAsyncOperation Build ()
- {
- return IdeApp.ProjectOperations.BuildFile (Window.ViewContent.ContentName);
- }
-
- public IAsyncOperation Rebuild ()
- {
- return Build ();
- }
-
- public void Clean ()
- {
- }
-
- public IAsyncOperation Run ()
- {
- return Run (Runtime.ProcessService.DefaultExecutionHandler);
- }
-
- public IAsyncOperation Run (IExecutionHandler handler)
- {
- return IdeApp.ProjectOperations.ExecuteFile (Window.ViewContent.ContentName, handler);
- }
-
- public bool CanRun ()
- {
- return CanRun (Runtime.ProcessService.DefaultExecutionHandler);
- }
-
- public bool CanRun (IExecutionHandler handler)
- {
- return IsBuildTarget && Window.ViewContent.ContentName != null && IdeApp.ProjectOperations.CanExecuteFile (Window.ViewContent.ContentName, handler);
+ await UpdateParseDocument ();
}
public bool Close ()
{
return ((SdiWorkspaceWindow)Window).CloseWindow (false, true);
}
-
- void OnSaved (EventArgs args)
+
+ protected override void OnSaved (EventArgs e)
{
IdeApp.Workbench.SaveFileStatus ();
- if (Saved != null)
- Saved (this, args);
+ base.OnSaved (e);
}
public void CancelParseTimeout ()
@@ -565,8 +550,8 @@ namespace MonoDevelop.Ide.Gui
internal void DisposeDocument ()
{
- DetachExtensionChain ();
- RemoveAnnotations (typeof(System.Object));
+ UnsubscibeAnalysisdocument ();
+ UnloadAdhocProject ();
if (window is SdiWorkspaceWindow)
((SdiWorkspaceWindow)window).DetachFromPathedDocument ();
window.Closed -= OnClosed;
@@ -578,15 +563,23 @@ namespace MonoDevelop.Ide.Gui
if (window.ViewContent.Project != null)
window.ViewContent.Project.Modified -= HandleProjectModified;
window.ViewsChanged += HandleViewsChanged;
+ MonoDevelopWorkspace.LoadingFinished -= TypeSystemService_WorkspaceItemLoaded;
+
window = null;
parsedDocument = null;
- singleFileContext = null;
- provider = null;
views = null;
viewsRO = null;
}
-#region document tasks
+
+ void UnsubscibeAnalysisdocument ()
+ {
+ if (analysisDocument != null) {
+ TypeSystemService.InformDocumentClose (analysisDocument, FileName);
+ analysisDocument = null;
+ }
+ }
+ #region document tasks
object lockObj = new object ();
void ClearTasks ()
@@ -634,84 +627,44 @@ namespace MonoDevelop.Ide.Gui
void InitializeExtensionChain ()
{
- DetachExtensionChain ();
- var editor = GetContent<IExtensibleTextEditor> ();
-
- ExtensionNodeList extensions = window.ExtensionContext.GetExtensionNodes ("/MonoDevelop/Ide/TextEditorExtensions", typeof(TextEditorExtensionNode));
- editorExtension = null;
- TextEditorExtension last = null;
- var mimetypeChain = DesktopService.GetMimeTypeInheritanceChainForFile (FileName).ToArray ();
- foreach (TextEditorExtensionNode extNode in extensions) {
- if (!extNode.Supports (FileName, mimetypeChain))
- continue;
- TextEditorExtension ext;
- try {
- ext = (TextEditorExtension)extNode.CreateInstance ();
- } catch (Exception e) {
- LoggingService.LogError ("Error while creating text editor extension :" + extNode.Id + "(" + extNode.Type +")", e);
- continue;
- }
- if (ext.ExtendsEditor (this, editor)) {
- if (last != null) {
- ext.Next = last.Next;
- last.Next = ext;
- last = ext;
- } else {
- editorExtension = last = ext;
- last.Next = editor.AttachExtension (editorExtension);
- }
- ext.Initialize (this);
- }
- }
+ Editor.InitializeExtensionChain (this);
+
if (window is SdiWorkspaceWindow)
((SdiWorkspaceWindow)window).AttachToPathedDocument (GetContent<MonoDevelop.Ide.Gui.Content.IPathedDocument> ());
- }
- void DetachExtensionChain ()
- {
- while (editorExtension != null) {
- try {
- editorExtension.Dispose ();
- } catch (Exception ex) {
- LoggingService.LogError ("Exception while disposing extension:" + editorExtension, ex);
- }
- editorExtension = editorExtension.Next as TextEditorExtension;
- }
- editorExtension = null;
}
- void InitializeEditor (IExtensibleTextEditor editor)
+ void InitializeEditor ()
{
- Editor.Document.TextReplaced += (o, a) => {
+ Editor.TextChanged += (o, a) => {
if (parsedDocument != null)
parsedDocument.IsInvalid = true;
- if (Editor.Document.IsInAtomicUndo) {
+ if (Editor.IsInAtomicUndo) {
wasEdited = true;
} else {
StartReparseThread ();
}
};
- Editor.Document.BeginUndo += delegate {
+ Editor.BeginAtomicUndoOperation += delegate {
wasEdited = false;
};
- Editor.Document.EndUndo += delegate {
+ Editor.EndAtomicUndoOperation += delegate {
if (wasEdited)
StartReparseThread ();
};
- Editor.Document.Undone += (o, a) => StartReparseThread ();
- Editor.Document.Redone += (o, a) => StartReparseThread ();
+// Editor.Undone += (o, a) => StartReparseThread ();
+// Editor.Redone += (o, a) => StartReparseThread ();
InitializeExtensionChain ();
}
internal void OnDocumentAttached ()
{
- IExtensibleTextEditor editor = GetContent<IExtensibleTextEditor> ();
- if (editor != null) {
- InitializeEditor (editor);
+ if (Editor != null) {
+ InitializeEditor ();
RunWhenLoaded (delegate { ListenToProjectLoad (Project); });
}
@@ -727,51 +680,39 @@ namespace MonoDevelop.Ide.Gui
public void RunWhenLoaded (System.Action action)
{
var e = Editor;
- if (e == null || e.Document == null) {
+ if (e == null) {
action ();
return;
}
- e.Document.RunWhenLoaded (action);
+ e.RunWhenLoaded (action);
}
- public void AttachToProject (Project project)
+ public override void AttachToProject (Project project)
{
SetProject (project);
}
- TypeSystemService.ProjectContentWrapper currentWrapper;
internal void SetProject (Project project)
{
if (Window == null || Window.ViewContent == null || Window.ViewContent.Project == project)
return;
- DetachExtensionChain ();
- ISupportsProjectReload pr = GetContent<ISupportsProjectReload> ();
- if (pr != null) {
+ UnloadAdhocProject ();
+ if (adhocProject == null)
+ UnsubscibeAnalysisdocument ();
+ if (Window.ViewContent.ProjectReloadCapability != ProjectReloadCapability.None) {
// Unsubscribe project events
if (Window.ViewContent.Project != null)
Window.ViewContent.Project.Modified -= HandleProjectModified;
Window.ViewContent.Project = project;
- pr.Update (project);
}
if (project != null)
project.Modified += HandleProjectModified;
InitializeExtensionChain ();
-
ListenToProjectLoad (project);
}
void ListenToProjectLoad (Project project)
{
- if (currentWrapper != null) {
- currentWrapper.Loaded -= HandleInLoadChanged;
- currentWrapper = null;
- }
- if (project != null) {
- var wrapper = TypeSystemService.GetProjectContentWrapper (project);
- wrapper.Loaded += HandleInLoadChanged;
- currentWrapper = wrapper;
- currentWrapper.RequestLoad ();
- }
StartReparseThread ();
}
@@ -793,18 +734,42 @@ namespace MonoDevelop.Ide.Gui
/// <returns>
/// A <see cref="ParsedDocument"/> that contains the current dom.
/// </returns>
- public ParsedDocument UpdateParseDocument ()
+ public override async Task<ParsedDocument> UpdateParseDocument ()
{
try {
- string currentParseFile = FileName;
+ await EnsureAnalysisDocumentIsOpen ();
+ string currentParseFile = GetCurrentParseFileName();
var editor = Editor;
if (editor == null || string.IsNullOrEmpty (currentParseFile))
return null;
TypeSystemService.AddSkippedFile (currentParseFile);
- string currentParseText = editor.Text;
- this.parsedDocument = TypeSystemService.ParseFile (Project, currentParseFile, editor.Document.MimeType, currentParseText);
- if (Project == null && this.parsedDocument != null) {
- singleFileContext = GetProjectContext ().AddOrUpdateFiles (parsedDocument.ParsedFile);
+ var currentParseText = editor.CreateDocumentSnapshot ();
+ CancelOldParsing();
+ var project = adhocProject ?? Project;
+
+ var options = new ParseOptions {
+ Project = project,
+ Content = currentParseText,
+ FileName = currentParseFile,
+ OldParsedDocument = parsedDocument,
+ RoslynDocument = AnalysisDocument
+ };
+
+ if (project != null && TypeSystemService.CanParseProjections (project, Editor.MimeType, FileName)) {
+ var projectFile = project.GetProjectFile (currentParseFile);
+ if (projectFile != null)
+ options.BuildAction = projectFile.BuildAction;
+
+ var p = await TypeSystemService.ParseProjection (options, editor.MimeType);
+ if (p != null) {
+ this.parsedDocument = p.ParsedDocument;
+ var projections = p.Projections;
+ foreach (var p2 in projections)
+ p2.CreateProjectedEditor (this);
+ Editor.SetOrUpdateProjections (this, projections, p.DisabledProjectionFeatures);
+ }
+ } else {
+ this.parsedDocument = await TypeSystemService.ParseFile (options, editor.MimeType) ?? this.parsedDocument;
}
} finally {
@@ -812,101 +777,190 @@ namespace MonoDevelop.Ide.Gui
}
return this.parsedDocument;
}
+
+ uint parseTimeout = 0;
+ CancellationTokenSource analysisDocumentSrc = new CancellationTokenSource ();
+
+ void CancelEnsureAnalysisDocumentIsOpen ()
+ {
+ analysisDocumentSrc.Cancel ();
+ analysisDocumentSrc = new CancellationTokenSource ();
+ }
+
+ Task EnsureAnalysisDocumentIsOpen ()
+ {
+ if (analysisDocument != null)
+ return SpecializedTasks.EmptyTask;
+ if (Editor == null) {
+ UnsubscibeAnalysisdocument ();
+ return SpecializedTasks.EmptyTask;
+ }
+ if (Project != null && Editor.MimeType == "text/x-csharp" && !IsUnreferencedSharedProject(Project)) {
+ RoslynWorkspace = TypeSystemService.GetWorkspace (this.Project.ParentSolution);
+ analysisDocument = TypeSystemService.GetDocumentId (this.Project, this.FileName);
+ if (analysisDocument != null) {
+ TypeSystemService.InformDocumentOpen (analysisDocument, Editor);
+ }
+ } else {
+ CancelEnsureAnalysisDocumentIsOpen ();
+ lock (adhocProjectLock) {
+ var token = analysisDocumentSrc.Token;
+ if (adhocProject != null) {
+ return SpecializedTasks.EmptyTask;
+ }
+ if (Editor != null && Editor.MimeType == "text/x-csharp") {
+ var newProject = Services.ProjectService.CreateDotNetProject ("C#");
+ this.adhocProject = newProject;
- static readonly Lazy<IUnresolvedAssembly> mscorlib = new Lazy<IUnresolvedAssembly> ( () => new IkvmLoader ().LoadAssemblyFile (typeof (object).Assembly.Location));
- static readonly Lazy<IUnresolvedAssembly> systemCore = new Lazy<IUnresolvedAssembly>( () => new IkvmLoader ().LoadAssemblyFile (typeof (System.Linq.Enumerable).Assembly.Location));
- static readonly Lazy<IUnresolvedAssembly> system = new Lazy<IUnresolvedAssembly>( () => new IkvmLoader ().LoadAssemblyFile (typeof (System.Uri).Assembly.Location));
+ newProject.Name = "InvisibleProject";
+ newProject.References.Add (ProjectReference.CreateAssemblyReference ("mscorlib"));
+ newProject.References.Add (ProjectReference.CreateAssemblyReference ("System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"));
+ newProject.References.Add (ProjectReference.CreateAssemblyReference ("System.Core"));
- static IUnresolvedAssembly Mscorlib { get { return mscorlib.Value; } }
- static IUnresolvedAssembly SystemCore { get { return systemCore.Value; } }
- static IUnresolvedAssembly System { get { return system.Value; } }
+ newProject.FileName = "test.csproj";
+ if (!Window.ViewContent.IsUntitled) {
+ adHocFile = Editor.FileName;
+ } else {
+ adHocFile = (Platform.IsWindows ? "C:\\" : "/") + Window.ViewContent.UntitledName + ".cs";
+ }
- public bool IsProjectContextInUpdate {
- get {
- if (currentWrapper == null)
- return false;
- return !currentWrapper.IsLoaded;
+ newProject.Files.Add (new ProjectFile (adHocFile, BuildAction.Compile));
+
+ adhocSolution = new Solution ();
+ adhocSolution.AddConfiguration ("", true);
+ adhocSolution.DefaultSolutionFolder.AddItem (newProject);
+ return TypeSystemService.Load (adhocSolution, new ProgressMonitor (), token).ContinueWith (task => {
+ if (token.IsCancellationRequested)
+ return;
+ RoslynWorkspace = task.Result.FirstOrDefault(); // 1 solution loaded ->1 workspace as result
+ analysisDocument = TypeSystemService.GetDocumentId (RoslynWorkspace, newProject, adHocFile);
+ TypeSystemService.InformDocumentOpen (RoslynWorkspace, analysisDocument, Editor);
+ });
+ }
+ }
}
+ return SpecializedTasks.EmptyTask;
}
- public virtual IProjectContent GetProjectContext ()
+ bool IsUnreferencedSharedProject (Project project)
{
- if (Project == null) {
- if (singleFileContext == null) {
- singleFileContext = new ICSharpCode.NRefactory.CSharp.CSharpProjectContent ();
- singleFileContext = singleFileContext.AddAssemblyReferences (new [] { Mscorlib, System, SystemCore });
- }
- if (parsedDocument != null)
- return singleFileContext.AddOrUpdateFiles (parsedDocument.ParsedFile);
- return singleFileContext;
+ return project is SharedAssetsProject;
+ }
+
+ object adhocProjectLock = new object();
+
+ void UnloadAdhocProject ()
+ {
+ CancelEnsureAnalysisDocumentIsOpen ();
+ lock (adhocProjectLock) {
+ if (adhocProject == null)
+ return;
+ TypeSystemService.Unload (adhocSolution);
+ adhocSolution.Dispose ();
+ adhocSolution = null;
+ adhocProject = null;
}
-
- return TypeSystemService.GetProjectContext (Project);
}
-
- uint parseTimeout = 0;
- object reparseLock = new object();
+
+ CancellationTokenSource parseTokenSource = new CancellationTokenSource();
+
+ void CancelOldParsing()
+ {
+ parseTokenSource.Cancel ();
+ parseTokenSource = new CancellationTokenSource ();
+ }
+
internal void StartReparseThread ()
{
- lock (reparseLock) {
- if (currentWrapper != null)
- currentWrapper.EnsureReferencesAreLoaded ();
+ string currentParseFile = GetCurrentParseFileName ();
+ if (string.IsNullOrEmpty (currentParseFile))
+ return;
+ CancelParseTimeout ();
- // Don't directly parse the document because doing it at every key press is
- // very inefficient. Do it after a small delay instead, so several changes can
- // be parsed at the same time.
- string currentParseFile = FileName;
- if (string.IsNullOrEmpty (currentParseFile))
- return;
- CancelParseTimeout ();
- if (IsProjectContextInUpdate) {
- return;
- }
- parseTimeout = GLib.Timeout.Add (ParseDelay, delegate {
- var editor = Editor;
- if (editor == null || IsProjectContextInUpdate) {
- parseTimeout = 0;
- return false;
- }
- string currentParseText = editor.Text;
- string mimeType = editor.Document.MimeType;
- ThreadPool.QueueUserWorkItem (delegate {
- if (IsProjectContextInUpdate) {
+ parseTimeout = GLib.Timeout.Add (ParseDelay, delegate {
+ StartReparseThreadDelayed (currentParseFile);
+ parseTimeout = 0;
+ return false;
+ });
+ }
+
+ string GetCurrentParseFileName ()
+ {
+ var editor = Editor;
+ string result = adhocProject != null ? adHocFile : editor?.FileName;
+ return result ?? FileName;
+ }
+
+ async void StartReparseThreadDelayed (FilePath currentParseFile)
+ {
+ var editor = Editor;
+ if (editor == null)
+ return;
+
+ // Don't directly parse the document because doing it at every key press is
+ // very inefficient. Do it after a small delay instead, so several changes can
+ // be parsed at the same time.
+ await EnsureAnalysisDocumentIsOpen ();
+ var currentParseText = editor.CreateSnapshot ();
+ string mimeType = editor.MimeType;
+ CancelOldParsing ();
+ var token = parseTokenSource.Token;
+ var project = adhocProject ?? Project;
+ var projectFile = project?.GetProjectFile (currentParseFile);
+
+ ThreadPool.QueueUserWorkItem (delegate {
+ TypeSystemService.AddSkippedFile (currentParseFile);
+ var options = new ParseOptions {
+ Project = project,
+ Content = currentParseText,
+ FileName = currentParseFile,
+ OldParsedDocument = parsedDocument,
+ RoslynDocument = AnalysisDocument
+ };
+ if (projectFile != null)
+ options.BuildAction = projectFile.BuildAction;
+
+ if (project != null && TypeSystemService.CanParseProjections (project, mimeType, currentParseFile)) {
+ TypeSystemService.ParseProjection (options, mimeType, token).ContinueWith (task => {
+ if (token.IsCancellationRequested)
return;
- }
- TypeSystemService.AddSkippedFile (currentParseFile);
- var currentParsedDocument = TypeSystemService.ParseFile (Project, currentParseFile, mimeType, currentParseText);
Application.Invoke (delegate {
// this may be called after the document has closed, in that case the OnDocumentParsed event shouldn't be invoked.
- if (isClosed)
+ var taskResult = task.Result;
+ if (isClosed || taskResult == null || token.IsCancellationRequested)
return;
- this.parsedDocument = currentParsedDocument;
+ this.parsedDocument = taskResult.ParsedDocument;
+ var projections = taskResult.Projections;
+ foreach (var p2 in projections)
+ p2.CreateProjectedEditor (this);
+ Editor.SetOrUpdateProjections (this, projections, taskResult.DisabledProjectionFeatures);
OnDocumentParsed (EventArgs.Empty);
});
- });
- parseTimeout = 0;
- return false;
- });
- }
+ }, TaskContinuationOptions.OnlyOnRanToCompletion);
+ } else {
+ TypeSystemService.ParseFile (options, mimeType, token).ContinueWith (task => {
+ if (token.IsCancellationRequested)
+ return;
+ Application.Invoke (delegate {
+ // this may be called after the document has closed, in that case the OnDocumentParsed event shouldn't be invoked.
+ if (isClosed || task.Result == null || token.IsCancellationRequested)
+ return;
+ this.parsedDocument = task.Result;
+ OnDocumentParsed (EventArgs.Empty);
+ });
+ }, TaskContinuationOptions.OnlyOnRanToCompletion);
+ }
+ });
}
/// <summary>
/// This method kicks off an async document parser and should be used instead of
/// <see cref="UpdateParseDocument"/> unless you need the parsed document immediately.
/// </summary>
- public void ReparseDocument ()
+ public override void ReparseDocument ()
{
StartReparseThread ();
}
-
- internal object ExtendedCommandTargetChain {
- get {
- // Only go through the text editor chain, if the text editor is selected as subview
- if (Window != null && Window.ActiveViewContent.GetContent (typeof(IExtensibleTextEditor)) != null)
- return editorExtension;
- return null;
- }
- }
void OnEntryRemoved (object sender, SolutionItemEventArgs args)
{
@@ -914,19 +968,10 @@ namespace MonoDevelop.Ide.Gui
window.ViewContent.Project = null;
}
- protected virtual void OnDocumentParsed (EventArgs e)
- {
- EventHandler handler = this.DocumentParsed;
- if (handler != null)
- handler (this, e);
- }
-
public event EventHandler Closed;
- public event EventHandler Saved;
public event EventHandler ViewChanged;
- public event EventHandler DocumentParsed;
-
+
public string[] CommentTags {
get {
if (IsFile)
@@ -940,30 +985,23 @@ namespace MonoDevelop.Ide.Gui
{
//Document doc = IdeApp.Workbench.ActiveDocument;
string loadedMimeType = DesktopService.GetMimeTypeForUri (fileName);
-
- Mono.TextEditor.Highlighting.SyntaxMode mode = null;
- foreach (string mt in DesktopService.GetMimeTypeInheritanceChain (loadedMimeType)) {
- mode = Mono.TextEditor.Highlighting.SyntaxModeService.GetSyntaxMode (null, mt);
- if (mode != null)
- break;
- }
-
- if (mode == null)
- return null;
-
- List<string> ctags;
- if (mode.Properties.TryGetValue ("LineComment", out ctags) && ctags.Count > 0) {
- return new string [] { ctags [0] };
- }
- List<string> tags = new List<string> ();
- if (mode.Properties.TryGetValue ("BlockCommentStart", out ctags))
- tags.Add (ctags [0]);
- if (mode.Properties.TryGetValue ("BlockCommentEnd", out ctags))
- tags.Add (ctags [0]);
- if (tags.Count == 2)
- return tags.ToArray ();
- else
- return null;
+
+ var result = TextEditorFactory.GetSyntaxProperties (loadedMimeType, "LineComment");
+ if (result != null)
+ return result;
+
+ var start = TextEditorFactory.GetSyntaxProperties (loadedMimeType, "BlockCommentStart");
+ var end = TextEditorFactory.GetSyntaxProperties (loadedMimeType, "BlockCommentEnd");
+ if (start != null && end != null)
+ return new [] { start[0], end[0] };
+ return null;
+ }
+
+ public override T GetPolicy<T> (IEnumerable<string> types)
+ {
+ if (adhocProject != null)
+ return MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<T> (types);
+ return base.GetPolicy<T> (types);
}
// public MonoDevelop.Projects.CodeGeneration.CodeGenerator CreateCodeGenerator ()
@@ -979,7 +1017,29 @@ namespace MonoDevelop.Ide.Gui
public void DisableAutoScroll ()
{
if (IsFile)
- Mono.TextEditor.Utils.FileSettingsStore.Remove (FileName);
+ FileSettingsStore.Remove (FileName);
+ }
+
+ public override OptionSet GetOptionSet ()
+ {
+ return TypeSystemService.Workspace.Options;
+ }
+
+ internal override Task<IReadOnlyList<Editor.Projection.Projection>> GetPartialProjectionsAsync (CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var parser = TypeSystemService.GetParser (Editor.MimeType);
+ if (parser == null)
+ return null;
+ var projectFile = Project.GetProjectFile (Editor.FileName);
+ if (projectFile == null)
+ return null;
+ if (!parser.CanGenerateProjection (Editor.MimeType, projectFile.BuildAction, Project.SupportedLanguages))
+ return null;
+ try {
+ return parser.GetPartialProjectionsAsync (this, Editor, parsedDocument, cancellationToken);
+ } catch (NotSupportedException) {
+ return null;
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs
index 46edebf535..ba93f44736 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentSwitcher.cs
@@ -34,7 +34,6 @@ using Gdk;
using Gtk;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Core;
-using Mono.TextEditor;
using MonoDevelop.Components;
namespace MonoDevelop.Ide
@@ -239,7 +238,7 @@ namespace MonoDevelop.Ide
cr.MoveTo (xPos + item.Icon.Width + 2 + itemPadding, yPos + (iconHeight - h) / 2);
layout.SetText (Ellipsize (item.ListTitle ?? item.Title, maxLength));
cr.ShowLayout (layout);
- cr.DrawImage (this, item.Icon, (int)xPos + itemPadding,
+ cr.DrawImage (this, item == ActiveItem ? item.Icon.WithStyles ("sel") : item.Icon, (int)xPos + itemPadding,
(int)(yPos + (iconHeight - item.Icon.Height) / 2));
yPos += iconHeight;
if (++curItem >= maxItems) {
@@ -262,8 +261,8 @@ namespace MonoDevelop.Ide
{
Gdk.Key key;
Gdk.ModifierType mod;
- Mono.TextEditor.KeyboardShortcut[] accels;
- Mono.TextEditor.GtkWorkarounds.MapKeys (evnt, out key, out mod, out accels);
+ KeyboardShortcut[] accels;
+ GtkWorkarounds.MapKeys (evnt, out key, out mod, out accels);
switch (accels [0].Key) {
case Gdk.Key.Left:
@@ -550,7 +549,7 @@ namespace MonoDevelop.Ide
}
}
- internal class DocumentSwitcher : Gtk.Window
+ internal class DocumentSwitcher : IdeWindow
{
List<MonoDevelop.Ide.Gui.Document> documents;
Xwt.ImageView imageTitle = new Xwt.ImageView ();
@@ -574,7 +573,7 @@ namespace MonoDevelop.Ide
this.WindowPosition = Gtk.WindowPosition.CenterOnParent;
this.TypeHint = WindowTypeHint.Dialog;
- this.ModifyBg (StateType.Normal, this.Style.Base (StateType.Normal));
+ this.ModifyBg (StateType.Normal, Styles.BaseBackgroundColor.ToGdkColor ());
VBox vBox = new VBox ();
HBox hBox = new HBox ();
@@ -617,7 +616,7 @@ namespace MonoDevelop.Ide
Title = pad.Title,
Tag = pad
};
- if (pad.Window.Content.Control.HasFocus)
+ if (pad.InternalContent.Initialized && pad.Window.Content.Control.HasFocus)
activeItem = item;
padCategory.AddItem (item);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentToolbar.cs
index 1a2536782a..ca4a8d9350 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentToolbar.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentToolbar.cs
@@ -24,10 +24,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
+using System.Linq;
using Gtk;
using MonoDevelop.Components;
-using Mono.TextEditor;
-
namespace MonoDevelop.Ide.Gui
{
@@ -50,29 +49,30 @@ namespace MonoDevelop.Ide.Gui
frame = al;
}
- internal Widget Container {
+ internal Control Container {
get { return frame; }
}
- public void Add (Widget widget)
+ public void Add (Control widget)
{
Add (widget, false);
}
- public void Add (Widget widget, bool fill)
+ public void Add (Control widget, bool fill)
{
Add (widget, fill, -1);
}
- public void Add (Widget widget, bool fill, int padding)
+ public void Add (Control widget, bool fill, int padding)
{
Add (widget, fill, padding, -1);
}
- void Add (Widget widget, bool fill, int padding, int index)
+ void Add (Control control, bool fill, int padding, int index)
{
int defaultPadding = 3;
+ Gtk.Widget widget = control;
if (widget is Button) {
((Button)widget).Relief = ReliefStyle.None;
((Button)widget).FocusOnClick = false;
@@ -109,8 +109,8 @@ namespace MonoDevelop.Ide.Gui
void ChangeColor (Gtk.Widget w)
{
w.Realized += delegate {
- w.ModifyText (StateType.Normal, Styles.BreadcrumbTextColor);
- w.ModifyFg (StateType.Normal, Styles.BreadcrumbTextColor);
+ w.ModifyText (StateType.Normal, Styles.BreadcrumbTextColor.ToGdkColor ());
+ w.ModifyFg (StateType.Normal, Styles.BreadcrumbTextColor.ToGdkColor ());
};
if (w is Gtk.Container) {
foreach (var c in ((Gtk.Container)w).Children)
@@ -118,12 +118,12 @@ namespace MonoDevelop.Ide.Gui
}
}
- public void Insert (Widget w, int index)
+ public void Insert (Control w, int index)
{
Add (w, false, 0, index);
}
- public void Remove (Widget widget)
+ public void Remove (Control widget)
{
box.Remove (widget);
}
@@ -147,8 +147,8 @@ namespace MonoDevelop.Ide.Gui
frame.ShowAll ();
}
- public Widget[] Children {
- get { return box.Children; }
+ public Control[] Children {
+ get { return box.Children.Select (w => (Control)w).ToArray (); }
}
class ToolbarBox: Gtk.Alignment
@@ -161,16 +161,12 @@ namespace MonoDevelop.Ide.Gui
{
using (var ctx = Gdk.CairoHelper.Create (GdkWindow)) {
ctx.Rectangle (0, 0, Allocation.Width, Allocation.Height);
- using (Cairo.LinearGradient g = new Cairo.LinearGradient (0, 0, 0, Allocation.Height)) {
- g.AddColorStop (0, Styles.BreadcrumbBackgroundColor);
- g.AddColorStop (1, Styles.BreadcrumbGradientEndColor);
- ctx.SetSource (g);
- ctx.Fill ();
- }
+ ctx.SetSourceColor (Styles.BreadcrumbBackgroundColor.ToCairoColor ());
+ ctx.Fill ();
ctx.MoveTo (0.5, Allocation.Height - 0.5);
ctx.RelLineTo (Allocation.Width, 0);
- ctx.SetSourceColor (Styles.BreadcrumbBottomBorderColor);
+ ctx.SetSourceColor (Styles.BreadcrumbBottomBorderColor.ToCairoColor ());
ctx.LineWidth = 1;
ctx.Stroke ();
}
@@ -179,20 +175,74 @@ namespace MonoDevelop.Ide.Gui
}
}
- public class DocumentToolButton: Gtk.Button
+ public class DocumentToolButton : Control
{
- public DocumentToolButton (string stockId)
+ public ImageView Image {
+ get { return (ImageView)button.Image; }
+ set { button.Image = value; }
+ }
+
+ public string TooltipText {
+ get { return button.TooltipText; }
+ set { button.TooltipText = value; }
+ }
+
+ public string Label {
+ get { return button.Label; }
+ set { button.Label = value; }
+ }
+
+ Gtk.Button button;
+
+ public DocumentToolButton (string stockId) : this (stockId, null)
{
- Image = new Gtk.Image (stockId, IconSize.Menu);
- Image.Show ();
}
-
+
public DocumentToolButton (string stockId, string label)
{
+ button = new Button ();
Label = label;
- Image = new Gtk.Image (stockId, IconSize.Menu);
+ Image = new ImageView (stockId, IconSize.Menu);
Image.Show ();
}
+
+ protected override object CreateNativeWidget<T> ()
+ {
+ return button;
+ }
+
+ public event EventHandler Clicked {
+ add {
+ button.Clicked += value;
+ }
+ remove {
+ button.Clicked -= value;
+ }
+ }
+
+ public class DocumentToolButtonImage : Control
+ {
+ ImageView image;
+ internal DocumentToolButtonImage (ImageView image)
+ {
+ this.image = image;
+ }
+
+ protected override object CreateNativeWidget<T> ()
+ {
+ return image;
+ }
+
+ public static implicit operator Gtk.Widget (DocumentToolButtonImage d)
+ {
+ return d.GetNativeWidget<Gtk.Widget> ();
+ }
+
+ public static implicit operator DocumentToolButtonImage (ImageView d)
+ {
+ return new DocumentToolButtonImage (d);
+ }
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentView.cs
index e92d2e985b..d190c1f258 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DocumentView.cs
@@ -29,16 +29,16 @@ namespace MonoDevelop.Ide.Gui
{
public class DocumentView
{
- IBaseViewContent content;
+ BaseViewContent content;
Document document;
- internal DocumentView (Document doc, IBaseViewContent content)
+ internal DocumentView (Document doc, BaseViewContent content)
{
document = doc;
this.content = content;
}
- internal IBaseViewContent BaseContent {
+ internal BaseViewContent BaseContent {
get { return content; }
}
@@ -53,8 +53,8 @@ namespace MonoDevelop.Ide.Gui
public void Select ()
{
- if (content is IAttachableViewContent)
- document.Window.SwitchView ((IAttachableViewContent)content);
+ if (content is BaseViewContent)
+ document.Window.SwitchView ((BaseViewContent)content);
else
document.Window.SwitchView (0);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/FileViewer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/FileViewer.cs
index ea9bbf240d..a39569c75c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/FileViewer.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/FileViewer.cs
@@ -30,6 +30,7 @@ using System;
using MonoDevelop.Ide.Codons;
using MonoDevelop.Ide.Desktop;
using System.Text;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Gui
{
@@ -84,18 +85,18 @@ namespace MonoDevelop.Ide.Gui
return app.GetHashCode ();
}
- public Document OpenFile (string filePath)
+ public Task<Document> OpenFile (string filePath)
{
return OpenFile (filePath, null);
}
- public Document OpenFile (string filePath, Encoding encoding)
+ public Task<Document> OpenFile (string filePath, Encoding encoding)
{
if (binding != null)
- return IdeApp.Workbench.OpenDocument (filePath, -1, -1, OpenDocumentOptions.Default, encoding, binding);
+ return IdeApp.Workbench.OpenDocument (filePath, null, -1, -1, OpenDocumentOptions.Default, encoding, binding);
else {
app.Launch (filePath);
- return null;
+ return Task.FromResult<Document> (null);
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/GtkSynchronizationContext.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/GtkSynchronizationContext.cs
deleted file mode 100644
index 45db9ce08e..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/GtkSynchronizationContext.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// GtkSynchronizationContext.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Threading;
-
-namespace MonoDevelop.Ide.Gui
-{
- public class GtkSynchronizationContext: SynchronizationContext
- {
- public override void Post (SendOrPostCallback d, object state)
- {
- DispatchService.GuiDispatch (delegate {
- d (state);
- });
- }
-
- public override void Send (SendOrPostCallback d, object state)
- {
- DispatchService.GuiSyncDispatch (delegate {
- d (state);
- });
- }
-
- public override SynchronizationContext CreateCopy ()
- {
- return new GtkSynchronizationContext ();
- }
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/GuiSyncContext.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/GuiSyncContext.cs
index 43ffea1bd4..e722f53062 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/GuiSyncContext.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/GuiSyncContext.cs
@@ -35,18 +35,18 @@ namespace MonoDevelop.Ide.Gui
{
public override void Dispatch (StatefulMessageHandler cb, object ob)
{
- if (DispatchService.IsGuiThread)
+ if (Runtime.IsMainThread)
cb (ob);
else
- DispatchService.GuiSyncDispatch (cb, ob);
+ Runtime.RunInMainThread (() => cb (ob)).Wait ();
}
public override void AsyncDispatch (StatefulMessageHandler cb, object ob)
{
- if (DispatchService.IsGuiThread)
+ if (Runtime.IsMainThread)
cb (ob);
else
- DispatchService.GuiDispatch (cb, ob);
+ Runtime.RunInMainThread (() => cb (ob));
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenTextEditorViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenTextEditorViewContent.cs
index b070b93358..0bfd0a0563 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenTextEditorViewContent.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenTextEditorViewContent.cs
@@ -26,16 +26,25 @@
using System;
using MonoDevelop.Ide.Gui.Content;
+using MonoDevelop.Components;
using MonoDevelop.Core;
-using Mono.TextEditor;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Gui
{
- public class HiddenTextEditorViewContent : MonoDevelop.Ide.Gui.AbstractViewContent, IEditableTextBuffer, Mono.TextEditor.ITextEditorDataProvider
+ public class HiddenTextEditorViewContent : MonoDevelop.Ide.Gui.ViewContent, IServiceProvider
{
- Mono.TextEditor.TextEditorData data;
+ readonly TextEditor editor;
+
+ public TextEditor Editor {
+ get {
+ return editor;
+ }
+ }
- public override Gtk.Widget Control {
+ public override Control Control {
get {
return null;
}
@@ -43,15 +52,16 @@ namespace MonoDevelop.Ide.Gui
public HiddenTextEditorViewContent ()
{
- document = new Mono.TextEditor.TextDocument ();
- data = new Mono.TextEditor.TextEditorData (document);
+ editor = TextEditorFactory.CreateNewEditor ();
Name = "";
}
-
- public override void Load (string fileName)
+
+ public HiddenTextEditorViewContent (TextEditor editor)
{
+ this.editor = editor;
+ Name = editor.FileName;
}
-
+
public FilePath Name {
get;
set;
@@ -63,54 +73,53 @@ namespace MonoDevelop.Ide.Gui
public int LineCount {
get {
- return document.LineCount;
+ return editor.LineCount;
}
}
- Mono.TextEditor.TextDocument document;
public string Text {
get {
- return document.Text;
+ return editor.Text;
}
set {
- document.Text = value;
+ editor.Text = value;
}
}
public int InsertText (int position, string text)
{
- document.Insert (position, text);
+ editor.InsertText (position, text);
return text.Length;
}
public void DeleteText (int position, int length)
{
- document.Replace (position, length, "");
+ editor.ReplaceText (position, length, "");
}
public int Length {
get {
- return document.TextLength;
+ return editor.Length;
}
}
public string GetText (int startPosition, int endPosition)
{
- return document.GetTextBetween (startPosition, endPosition);
+ return editor.GetTextBetween (startPosition, endPosition);
}
public char GetCharAt (int position)
{
- return document.GetCharAt (position);
+ return editor.GetCharAt (position);
}
public int GetPositionFromLineColumn (int line, int column)
{
- return document.LocationToOffset (line, column);
+ return editor.LocationToOffset (line, column);
}
public void GetLineColumnFromPosition (int position, out int line, out int column)
{
- Mono.TextEditor.DocumentLocation loc = document.OffsetToLocation (position);
+ var loc = editor.OffsetToLocation (position);
line = loc.Line;
column = loc.Column;
}
@@ -119,32 +128,32 @@ namespace MonoDevelop.Ide.Gui
public int CursorPosition {
get {
- return data.Caret.Offset;
+ return editor.CaretOffset;
}
set {
- data.Caret.Offset = value;
+ editor.CaretOffset = value;
}
}
public int SelectionStartPosition {
get {
- if (!data.IsSomethingSelected)
- return data.Caret.Offset;
- return data.SelectionRange.Offset;
+ if (!editor.IsSomethingSelected)
+ return editor.CaretOffset;
+ return editor.SelectionRange.Offset;
}
}
public int SelectionEndPosition {
get {
- if (!data.IsSomethingSelected)
- return data.Caret.Offset;
- return data.SelectionRange.EndOffset;
+ if (!editor.IsSomethingSelected)
+ return editor.CaretOffset;
+ return editor.SelectionRange.EndOffset;
}
}
public void Select (int startPosition, int endPosition)
{
- data.SelectionRange = new TextSegment (startPosition, endPosition - startPosition);
+ editor.SelectionRange = new TextSegment (startPosition, endPosition - startPosition);
}
public void ShowPosition (int position)
@@ -195,12 +204,33 @@ namespace MonoDevelop.Ide.Gui
{
return new DisposeStub ();
}
-
- public Mono.TextEditor.TextEditorData GetTextEditorData ()
+
+ #region IServiceProvider implementation
+
+ object IServiceProvider.GetService (Type serviceType)
{
- return data;
+ if (serviceType.IsInstanceOfType (editor))
+ return editor;
+ return null;
}
+
+ #endregion
+
public event EventHandler CaretPositionSet;
- public event EventHandler<TextChangedEventArgs> TextChanged;
+
+ protected virtual void OnCaretPositionSet (EventArgs e)
+ {
+ var handler = CaretPositionSet;
+ if (handler != null)
+ handler (this, e);
+ }
+
+ protected override object OnGetContent (Type type)
+ {
+ if (type.IsAssignableFrom (typeof(TextEditor)))
+ return Editor;
+ else
+ return base.OnGetContent (type);
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenWorkbenchWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenWorkbenchWindow.cs
index d5ebb8c29c..34d6fef15f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenWorkbenchWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/HiddenWorkbenchWindow.cs
@@ -61,15 +61,15 @@ namespace MonoDevelop.Ide.Gui
get { return AddinManager.AddinEngine; }
}
- MonoDevelop.Ide.Gui.IViewContent viewContent;
- public MonoDevelop.Ide.Gui.IViewContent ViewContent {
+ MonoDevelop.Ide.Gui.ViewContent viewContent;
+ public MonoDevelop.Ide.Gui.ViewContent ViewContent {
get { return viewContent; }
set { viewContent = value; }
}
- public IEnumerable<IAttachableViewContent> SubViewContents { get { return new IAttachableViewContent[0]; } }
+ public IEnumerable<BaseViewContent> SubViewContents { get { return new BaseViewContent[0]; } }
- public MonoDevelop.Ide.Gui.IBaseViewContent ActiveViewContent {
+ public MonoDevelop.Ide.Gui.BaseViewContent ActiveViewContent {
get { return ViewContent;}
set {}
}
@@ -86,7 +86,7 @@ namespace MonoDevelop.Ide.Gui
public void SwitchView (int viewNumber)
{
}
- public void SwitchView (MonoDevelop.Ide.Gui.IAttachableViewContent subViewContent)
+ public void SwitchView (MonoDevelop.Ide.Gui.BaseViewContent subViewContent)
{
}
@@ -95,26 +95,26 @@ namespace MonoDevelop.Ide.Gui
return -1;
}
- public void AttachViewContent (MonoDevelop.Ide.Gui.IAttachableViewContent subViewContent)
+ public void AttachViewContent (MonoDevelop.Ide.Gui.BaseViewContent subViewContent)
{
}
- public void InsertViewContent (int index, MonoDevelop.Ide.Gui.IAttachableViewContent subViewContent)
+ public void InsertViewContent (int index, MonoDevelop.Ide.Gui.BaseViewContent subViewContent)
{
}
- public DocumentToolbar GetToolbar (IBaseViewContent targetView)
+ public DocumentToolbar GetToolbar (BaseViewContent targetView)
{
return null;
}
public event EventHandler TitleChanged { add {} remove {} }
- public event EventHandler DocumentChanged;
- public event MonoDevelop.Ide.Gui.WorkbenchWindowEventHandler Closing;
- public event MonoDevelop.Ide.Gui.WorkbenchWindowEventHandler Closed;
- public event MonoDevelop.Ide.Gui.ActiveViewContentEventHandler ActiveViewContentChanged;
- public event EventHandler ViewsChanged;
+ public event EventHandler DocumentChanged { add {} remove {} }
+ public event MonoDevelop.Ide.Gui.WorkbenchWindowEventHandler Closing { add {} remove {} }
+ public event MonoDevelop.Ide.Gui.WorkbenchWindowEventHandler Closed { add {} remove {} }
+ public event MonoDevelop.Ide.Gui.ActiveViewContentEventHandler ActiveViewContentChanged { add {} remove {} }
+ public event EventHandler ViewsChanged { add {} remove {} }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IAttachableViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IAttachableViewContent.cs
deleted file mode 100644
index 2d24756c3b..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IAttachableViewContent.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// IAttachableViewContent.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-
-namespace MonoDevelop.Ide.Gui
-{
- public interface IAttachableViewContent : IBaseViewContent
- {
- void Selected ();
- void Deselected ();
-
- void BeforeSave();
-
- void BaseContentChanged ();
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IBaseViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IBaseViewContent.cs
deleted file mode 100644
index c40c6f8525..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IBaseViewContent.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-// IBaseViewContent.cs
-//
-// Author:
-// Viktoria Dudka (viktoriad@remobjects.com)
-//
-// Copyright (c) 2009 RemObjects Software
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using Gtk;
-
-namespace MonoDevelop.Ide.Gui
-{
- public interface IBaseViewContent : IDisposable
- {
- IWorkbenchWindow WorkbenchWindow { get; set; }
- Widget Control { get; }
-
- /// <summary>
- /// The label used for the subview list.
- /// </summary>
- string TabPageLabel { get; }
-
- object GetContent (Type type);
-
- bool CanReuseView (string fileName);
- void RedrawContent ();
- }
-} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IDisplayBinding.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IDisplayBinding.cs
index be4b654032..1ddfa22ac5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IDisplayBinding.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IDisplayBinding.cs
@@ -53,7 +53,7 @@ namespace MonoDevelop.Ide.Gui
///<summary>A display binding that opens a new view within the workspace.</summary>
public interface IViewDisplayBinding : IDisplayBinding
{
- IViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject);
+ ViewContent CreateContent (FilePath fileName, string mimeType, Project ownerProject);
string Name { get; }
}
@@ -66,7 +66,7 @@ namespace MonoDevelop.Ide.Gui
///<summary>A display binding that attaches to an existing view in the workspace.</summary>
public interface IAttachableDisplayBinding
{
- bool CanAttachTo (IViewContent content);
- IAttachableViewContent CreateViewContent (IViewContent viewContent);
+ bool CanAttachTo (ViewContent content);
+ BaseViewContent CreateViewContent (ViewContent viewContent);
}
} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContainer.cs
index debade99dd..87711863d5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContainer.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContainer.cs
@@ -92,17 +92,12 @@ namespace MonoDevelop.Ide.Gui
/// <summary>
/// Interface providing the content widget
/// </summary>
- IPadContent Content { get; }
-
- /// <summary>
- /// Interface providing the widget to be shown in the label of minimized pads
- /// </summary>
- IDockItemLabelProvider DockItemLabelProvider { get; set; }
+ PadContent Content { get; }
/// <summary>
/// Returns a toolbar for the pad.
/// </summary>
- DockItemToolbar GetToolbar (Gtk.PositionType position);
+ DockItemToolbar GetToolbar (DockPositionType position);
/// <summary>
/// Brings the pad to the front.
@@ -142,7 +137,7 @@ namespace MonoDevelop.Ide.Gui
bool isWorking;
bool hasErrors;
bool hasNewData;
- IPadContent content;
+ PadContent content;
PadCodon codon;
DefaultWorkbench workbench;
@@ -156,7 +151,7 @@ namespace MonoDevelop.Ide.Gui
this.icon = codon.Icon;
}
- public IPadContent Content {
+ public PadContent Content {
get {
CreateContent ();
return content;
@@ -245,11 +240,6 @@ namespace MonoDevelop.Ide.Gui
}
}
- public IDockItemLabelProvider DockItemLabelProvider {
- get { return Item.DockLabelProvider; }
- set { Item.DockLabelProvider = value; }
- }
-
public bool ContentVisible {
get { return workbench.IsContentVisible (codon); }
}
@@ -263,7 +253,7 @@ namespace MonoDevelop.Ide.Gui
}
}
- public DockItemToolbar GetToolbar (Gtk.PositionType position)
+ public DockItemToolbar GetToolbar (DockPositionType position)
{
return Item.GetToolbar (position);
}
@@ -289,14 +279,12 @@ namespace MonoDevelop.Ide.Gui
internal void NotifyShown ()
{
- if (PadShown != null)
- PadShown (this, EventArgs.Empty);
+ PadShown?.Invoke (this, EventArgs.Empty);
}
internal void NotifyHidden ()
{
- if (PadHidden != null)
- PadHidden (this, EventArgs.Empty);
+ PadHidden?.Invoke (this, EventArgs.Empty);
}
internal void NotifyContentShown ()
@@ -305,20 +293,18 @@ namespace MonoDevelop.Ide.Gui
HasNewData = false;
if (HasErrors)
HasErrors = false;
- if (PadContentShown != null)
- PadContentShown (this, EventArgs.Empty);
+ PadContentShown?.Invoke (this, EventArgs.Empty);
}
internal void NotifyContentHidden ()
{
- if (PadContentHidden != null)
- PadContentHidden (this, EventArgs.Empty);
+ PadContentHidden?.Invoke (this, EventArgs.Empty);
}
internal void NotifyDestroyed ()
{
- if (PadDestroyed != null)
- PadDestroyed (this, EventArgs.Empty);
+ PadDestroyed?.Invoke (this, EventArgs.Empty);
+ content?.Dispose ();
}
public event EventHandler PadShown;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContent.cs
deleted file mode 100644
index 93fc74c65d..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IPadContent.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-// IPadContent.cs
-//
-// Author:
-// Viktoria Dudka (viktoriad@remobjects.com)
-//
-// Copyright (c) 2009 RemObjects Software
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using Gtk;
-
-namespace MonoDevelop.Ide.Gui
-{
- public interface IPadContent : IDisposable
- {
- Widget Control { get; }
-
- void Initialize (IPadWindow window);
- void RedrawContent ();
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IViewContent.cs
deleted file mode 100644
index 2fbc0c618e..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IViewContent.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-// IViewContent.cs
-//
-// Author:
-// Viktoria Dudka (viktoriad@remobjects.com)
-//
-// Copyright (c) 2009 RemObjects Software
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-//
-
-using System;
-using MonoDevelop.Projects;
-
-namespace MonoDevelop.Ide.Gui
-{
- public interface IViewContent : IBaseViewContent
- {
- Project Project { get; set; }
-
- string PathRelativeToProject { get; }
- string ContentName { get; set; }
- string UntitledName { get; set; }
- string StockIconId { get; }
-
- bool IsUntitled { get; }
- bool IsViewOnly { get; }
- bool IsFile { get; }
- bool IsDirty { get; set; }
- bool IsReadOnly { get; }
-
- void Load (string fileName);
- void LoadNew (System.IO.Stream content, string mimeType);
- void Save (string fileName);
- void Save ();
-
- /// <summary>
- /// Discards all changes. This method is called before a dirty file is closed. It tells the view
- /// content to remove all autosave data of the file.
- /// </summary>
- void DiscardChanges ();
-
- event EventHandler ContentNameChanged;
- event EventHandler ContentChanged;
- event EventHandler DirtyChanged;
- event EventHandler BeforeSave;
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IWorkbenchWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IWorkbenchWindow.cs
index 4548bd5deb..8bcc0cde5c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IWorkbenchWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/IWorkbenchWindow.cs
@@ -35,10 +35,10 @@ namespace MonoDevelop.Ide.Gui
{
public interface IWorkbenchWindow
{
- IViewContent ViewContent { get; }
- IBaseViewContent ActiveViewContent { get; set; }
+ ViewContent ViewContent { get; }
+ BaseViewContent ActiveViewContent { get; set; }
- IEnumerable<IAttachableViewContent> SubViewContents { get; }
+ IEnumerable<BaseViewContent> SubViewContents { get; }
Document Document { get; set; }
string DocumentType { get; set; }
@@ -46,11 +46,11 @@ namespace MonoDevelop.Ide.Gui
bool ShowNotification { get; set; }
ExtensionContext ExtensionContext { get; }
- void AttachViewContent (IAttachableViewContent subViewContent);
- void InsertViewContent (int index, IAttachableViewContent subViewContent);
+ void AttachViewContent (BaseViewContent subViewContent);
+ void InsertViewContent (int index, BaseViewContent subViewContent);
void SwitchView (int index);
- void SwitchView (IAttachableViewContent subViewContent);
+ void SwitchView (BaseViewContent subViewContent);
int FindView <T>();
bool CloseWindow (bool force);
@@ -59,7 +59,7 @@ namespace MonoDevelop.Ide.Gui
/// <summary>
/// Returns a toolbar for the pad.
/// </summary>
- DocumentToolbar GetToolbar (IBaseViewContent targetView);
+ DocumentToolbar GetToolbar (BaseViewContent targetView);
event EventHandler DocumentChanged;
event WorkbenchWindowEventHandler Closed;
@@ -91,12 +91,12 @@ namespace MonoDevelop.Ide.Gui
public delegate void ActiveViewContentEventHandler (object o, ActiveViewContentEventArgs e);
public class ActiveViewContentEventArgs : EventArgs
{
- private IBaseViewContent content = null;
- public IBaseViewContent Content {
+ private BaseViewContent content = null;
+ public BaseViewContent Content {
get { return content; }
}
- public ActiveViewContentEventArgs (IBaseViewContent content)
+ public ActiveViewContentEventArgs (BaseViewContent content)
{
this.content = content;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/InternalLog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/InternalLog.cs
deleted file mode 100644
index 43c5dc3a45..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/InternalLog.cs
+++ /dev/null
@@ -1,178 +0,0 @@
-//
-// InternalLog.cs
-//
-// Author:
-// Lluis Sanchez Gual
-//
-// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Gui.Pads;
-using MonoDevelop.Core.Logging;
-
-namespace MonoDevelop.Ide.Gui
-{
- static class InternalLog
- {
- static StatusBarIcon errorIcon;
- static bool errorNotificationEnabled;
-
- static InternalLogger logger;
- static EnabledLoggingLevel enabledLevel = EnabledLoggingLevel.UpToInfo;
-
- static InternalLog ()
- {
- string logLevelEnv = System.Environment.GetEnvironmentVariable ("MONODEVELOP_LOGGING_PAD_LEVEL");
- if (!string.IsNullOrEmpty (logLevelEnv)) {
- try {
- enabledLevel = (EnabledLoggingLevel) Enum.Parse (typeof (EnabledLoggingLevel), logLevelEnv, true);
- } catch {}
- }
- }
-
- public static void Initialize ()
- {
- if (!Initialized) {
- logger = new InternalLogger ();
- LoggingService.AddLogger (logger);
- }
- }
-
- public static bool Initialized {
- get { return logger != null; }
- }
-
- public static void Dispose ()
- {
- if (Initialized) {
- LoggingService.RemoveLogger (logger.Name);
- logger = null;
- }
- }
-
- public static EnabledLoggingLevel EnabledLoggingLevel {
- get { return enabledLevel; }
- }
-
- static void NotifyError (LogMessage message)
- {
- if (!errorNotificationEnabled)
- return;
- ClearErrorIcon ();
- var pix = ImageService.GetIcon (Gtk.Stock.DialogError, Gtk.IconSize.Menu);
- errorIcon = IdeApp.Workbench.StatusBar.ShowStatusIcon (pix);
- errorIcon.Clicked += delegate {
- ClearErrorIcon ();
- MessageService.ShowError (message.Message);
- };
- errorIcon.SetAlertMode (5);
- errorIcon.ToolTip = message.Message;
- }
-
- public static void ClearErrorIcon ()
- {
- if (errorIcon != null) {
- errorIcon.Dispose ();
- errorIcon = null;
- }
- }
-
- public static void EnableErrorNotification ()
- {
- errorNotificationEnabled = true;
- if (logger.LastError != null)
- NotifyError (logger.LastError);
- }
-
- private class InternalLogger : ILogger
- {
- public LogMessage LastError = null;
-
- public void Log (LogLevel level, string message)
- {
- LogMessage logMessage = new LogMessage (level, message);
-
- if (level == LogLevel.Fatal) {
- if (errorNotificationEnabled) {
- Gtk.Application.Invoke (delegate {
- InternalLog.NotifyError (logMessage);
- });
- }
- else
- LastError = logMessage;
- }
- }
-
- public EnabledLoggingLevel EnabledLevel {
- get { return InternalLog.EnabledLoggingLevel; }
- }
-
- public string Name {
- get { return "MonoDevelop Internal Log"; }
- }
- }
- }
-
- class LogMessage
- {
- LogLevel level;
- string message;
- DateTime timestamp;
-
- public LogLevel Level {
- get { return level; }
- }
-
- public string Message {
- get { return message; }
- }
-
- public DateTime TimeStamp {
- get { return timestamp; }
- }
-
- public LogMessage (LogLevel level, string message)
- {
- this.level = level;
- this.message = message;
- this.timestamp = DateTime.Now;
- }
-
- public override bool Equals (object o)
- {
- LogMessage m = o as LogMessage;
- if (m != null)
- return (m.level == this.level) && (m.timestamp == this.timestamp) && (m.message == this.message);
- return false;
- }
-
- public override int GetHashCode ()
- {
- return (((int)level).ToString () + message + timestamp.Ticks.ToString ()).GetHashCode ();
- }
-
-
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/LayoutComboBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/LayoutComboBox.cs
index 3dce62c49a..a7acc0d79d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/LayoutComboBox.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/LayoutComboBox.cs
@@ -41,7 +41,7 @@ namespace MonoDevelop.Ide.Gui
Combo.Changed += new EventHandler (OnComboChanged);
ShowAll ();
- IdeApp.Workbench.LayoutChanged += (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnConfigurationsChanged));
+ IdeApp.Workbench.LayoutChanged += OnConfigurationsChanged;
}
void OnConfigurationsChanged (object sender, EventArgs e)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs
index 7f08acc146..c0ced3594f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/MonoDevelopStatusBar.cs
@@ -81,7 +81,10 @@ namespace MonoDevelop.Ide
HasResizeGrip = true;
HeaderBox hb = new HeaderBox (1, 0, 0, 0);
- hb.BorderColor = Styles.DockSeparatorColor;
+ hb.StyleSet += (o, args) => {
+ hb.BorderColor = Styles.DockSeparatorColor.ToGdkColor ();
+ hb.BackgroundColor = Styles.DockBarBackground.ToGdkColor ();
+ };
var mainBox = new HBox ();
mainBox.PackStart (new Label (""), true, true, 0);
hb.Add (mainBox);
@@ -124,6 +127,9 @@ namespace MonoDevelop.Ide
// Dock area
CustomFrame dfr = new CustomFrame (0, 0, 1, 0);
+ dfr.StyleSet += (o, args) => {
+ dfr.BorderColor = Styles.DockSeparatorColor.ToGdkColor ();
+ };
dfr.ShowAll ();
DefaultWorkbench wb = (DefaultWorkbench)IdeApp.Workbench.RootWindow;
var dockBar = wb.DockFrame.ExtractDockBar (PositionType.Bottom);
@@ -224,7 +230,7 @@ namespace MonoDevelop.Ide
public void ShowCaretState (int line, int column, int selectedChars, bool isInInsertMode)
{
- DispatchService.AssertGuiThread ();
+ Runtime.AssertMainThread ();
string cursorText = selectedChars > 0 ? String.Format ("{0,3} : {1,-3} - {2}", line, column, selectedChars) : String.Format ("{0,3} : {1,-3}", line, column);
if (cursorLabel.Text != cursorText)
cursorLabel.Text = cursorText;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadContent.cs
new file mode 100644
index 0000000000..e559040477
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadContent.cs
@@ -0,0 +1,81 @@
+// IPadContent.cs
+//
+// Author:
+// Viktoria Dudka (viktoriad@remobjects.com)
+//
+// Copyright (c) 2009 RemObjects Software
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+using System;
+using Gtk;
+using MonoDevelop.Components;
+
+namespace MonoDevelop.Ide.Gui
+{
+ public abstract class PadContent : IDisposable
+ {
+ IPadWindow window;
+ string icon;
+ string title;
+
+ protected PadContent (string title, string icon = null): this()
+ {
+ this.icon = icon;
+ this.title = title;
+ }
+
+ protected PadContent ()
+ {
+ Id = GetType ().FullName;
+ }
+
+ public virtual string Id { get; set; }
+
+ public IPadWindow Window {
+ get { return window; }
+ }
+
+ public abstract Control Control { get; }
+
+ internal void Init (IPadWindow window)
+ {
+ this.window = window;
+
+ if (title != null)
+ window.Title = title;
+
+ if (icon != null)
+ window.Icon = icon;
+
+ Initialize (window);
+ }
+
+ protected virtual void Initialize (IPadWindow window)
+ {
+ }
+
+ public virtual void Dispose ()
+ {
+ Control?.Dispose ();
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadFontChanger.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadFontChanger.cs
index 6e696f28ca..c88b74afbc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadFontChanger.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/PadFontChanger.cs
@@ -26,6 +26,7 @@
using System;
using Pango;
+using MonoDevelop.Components;
using MonoDevelop.Core;
namespace MonoDevelop.Ide.Gui
@@ -38,19 +39,19 @@ namespace MonoDevelop.Ide.Gui
Action<FontDescription> updater;
Action resizer;
- public PadFontChanger (Gtk.Widget styleSource, Action<FontDescription> updater)
+ public PadFontChanger (Control styleSource, Action<FontDescription> updater)
: this (styleSource, updater, null)
{
}
- public PadFontChanger (Gtk.Widget styleSource, Action<FontDescription> updater, Action resizer)
+ public PadFontChanger (Control styleSource, Action<FontDescription> updater, Action resizer)
{
this.styleSource = styleSource;
this.updater = updater;
this.resizer = resizer;
if (styleSource != null) {
- IdeApp.Preferences.CustomPadFontChanged += PropertyChanged;
+ IdeApp.Preferences.CustomPadFont.Changed += PropertyChanged;
}
Update ();
@@ -73,7 +74,7 @@ namespace MonoDevelop.Ide.Gui
public void Dispose ()
{
if (styleSource != null) {
- IdeApp.Preferences.CustomPadFontChanged -= PropertyChanged;
+ IdeApp.Preferences.CustomPadFont.Changed -= PropertyChanged;
styleSource = null;
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProgressMonitors.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProgressMonitors.cs
index 5e50878b93..9605dbc5db 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProgressMonitors.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProgressMonitors.cs
@@ -29,6 +29,7 @@
using System;
using System.Collections;
+using System.Collections.Generic;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Pads;
@@ -37,13 +38,15 @@ using MonoDevelop.Core.Execution;
using MonoDevelop.Core.ProgressMonitoring;
using MonoDevelop.Ide.FindInFiles;
using MonoDevelop.Components.Docking;
+using System.Threading;
+using MonoDevelop.Ide.Gui.Components;
namespace MonoDevelop.Ide.Gui
{
- public class ProgressMonitorManager : GuiSyncObject, IConsoleFactory
+ public class ProgressMonitorManager : GuiSyncObject
{
- ArrayList searchMonitors = new ArrayList ();
- ArrayList outputMonitors = new ArrayList ();
+ List<Pad> searchMonitors = new List<Pad> ();
+ List<Pad> outputMonitors = new List<Pad> ();
/******************************/
@@ -51,96 +54,92 @@ namespace MonoDevelop.Ide.Gui
{
}
- public IProgressMonitor GetBuildProgressMonitor ()
+ public ProgressMonitor GetBuildProgressMonitor ()
{
return GetBuildProgressMonitor (GettextCatalog.GetString ("Building..."));
}
- public IProgressMonitor GetCleanProgressMonitor ()
+ public ProgressMonitor GetCleanProgressMonitor ()
{
return GetBuildProgressMonitor (GettextCatalog.GetString ("Cleaning..."));
}
- public IProgressMonitor GetRebuildProgressMonitor ()
+ public ProgressMonitor GetRebuildProgressMonitor ()
{
return GetBuildProgressMonitor (GettextCatalog.GetString ("Rebuilding..."));
}
- private IProgressMonitor GetBuildProgressMonitor (string statusText)
+ private ProgressMonitor GetBuildProgressMonitor (string statusText)
{
Pad pad = IdeApp.Workbench.GetPad<ErrorListPad> ();
ErrorListPad errorPad = (ErrorListPad) pad.Content;
AggregatedProgressMonitor mon = new AggregatedProgressMonitor (errorPad.GetBuildProgressMonitor ());
- mon.AddSlaveMonitor (GetStatusProgressMonitor (statusText, Stock.StatusBuild, false, true, false, pad));
+ mon.AddFollowerMonitor (GetStatusProgressMonitor (statusText, Stock.StatusBuild, false, true, false, pad));
return mon;
}
- public IProgressMonitor GetRunProgressMonitor ()
+ public OutputProgressMonitor GetRunProgressMonitor ()
{
return GetOutputProgressMonitor ("MonoDevelop.Ide.ApplicationOutput", GettextCatalog.GetString ("Application Output"), Stock.RunProgramIcon, false, true);
}
- public IProgressMonitor GetToolOutputProgressMonitor (bool bringToFront)
+ public OutputProgressMonitor GetToolOutputProgressMonitor (bool bringToFront, CancellationTokenSource cs = null)
{
return GetOutputProgressMonitor ("MonoDevelop.Ide.ToolOutput", GettextCatalog.GetString ("Tool Output"), Stock.RunProgramIcon, bringToFront, true);
}
- public IProgressMonitor GetLoadProgressMonitor (bool lockGui)
+ public ProgressMonitor GetLoadProgressMonitor (bool lockGui)
{
return GetStatusProgressMonitor (GettextCatalog.GetString ("Loading..."), Stock.StatusSolutionOperation, true, false, lockGui);
}
- public IProgressMonitor GetProjectLoadProgressMonitor (bool lockGui)
+ public ProgressMonitor GetProjectLoadProgressMonitor (bool lockGui)
{
return new GtkProjectLoadProgressMonitor (GetLoadProgressMonitor (lockGui));
}
- public IProgressMonitor GetSaveProgressMonitor (bool lockGui)
+ public ProgressMonitor GetSaveProgressMonitor (bool lockGui)
{
return GetStatusProgressMonitor (GettextCatalog.GetString ("Saving..."), Stock.StatusSolutionOperation, true, false, lockGui);
}
- public IConsole CreateConsole (bool closeOnDispose)
+ public OperationConsole CreateConsole (bool closeOnDispose, CancellationToken cancellationToken)
{
- return (IConsole) GetOutputProgressMonitor ("MonoDevelop.Ide.ApplicationOutput", GettextCatalog.GetString ("Application Output"), Stock.MessageLog, false, true);
+ return ((OutputProgressMonitor)GetOutputProgressMonitor ("MonoDevelop.Ide.ApplicationOutput", GettextCatalog.GetString ("Application Output"), Stock.MessageLog, false, true)).Console;
}
-
- /******************************/
-
-
- public IProgressMonitor GetStatusProgressMonitor (string title, IconId icon, bool showErrorDialogs)
- {
- return new StatusProgressMonitor (title, icon, showErrorDialogs, true, false, null);
+
+ CustomConsoleFactory customConsoleFactory = new CustomConsoleFactory ();
+ public OperationConsoleFactory ConsoleFactory {
+ get { return customConsoleFactory; }
}
-
- public IProgressMonitor GetStatusProgressMonitor (string title, IconId icon, bool showErrorDialogs, bool showTaskTitle, bool lockGui)
+
+ class CustomConsoleFactory: OperationConsoleFactory
{
- return new StatusProgressMonitor (title, icon, showErrorDialogs, showTaskTitle, lockGui, null);
+ protected override OperationConsole OnCreateConsole (CreateConsoleOptions options)
+ {
+ return ((OutputProgressMonitor)IdeApp.Workbench.ProgressMonitors.GetOutputProgressMonitor ("MonoDevelop.Ide.ApplicationOutput", GettextCatalog.GetString ("Application Output"), Stock.MessageLog, options.BringToFront, true)).Console;
+ }
}
+
+ /******************************/
+
- public IProgressMonitor GetStatusProgressMonitor (string title, IconId icon, bool showErrorDialogs, bool showTaskTitle, bool lockGui, Pad statusSourcePad)
+ public ProgressMonitor GetStatusProgressMonitor (string title, IconId icon, bool showErrorDialogs, bool showTaskTitle = true, bool lockGui = false, Pad statusSourcePad = null)
{
return new StatusProgressMonitor (title, icon, showErrorDialogs, showTaskTitle, lockGui, statusSourcePad);
}
- public IProgressMonitor GetBackgroundProgressMonitor (string title, IconId icon)
+ public ProgressMonitor GetBackgroundProgressMonitor (string title, IconId icon)
{
return new BackgroundProgressMonitor (title, icon);
}
- public IProgressMonitor GetOutputProgressMonitor (string title, IconId icon, bool bringToFront, bool allowMonitorReuse)
+ public OutputProgressMonitor GetOutputProgressMonitor (string title, IconId icon, bool bringToFront, bool allowMonitorReuse, bool visible = true)
{
- return GetOutputProgressMonitor (null, title, icon, bringToFront, allowMonitorReuse);
+ return GetOutputProgressMonitor (null, title, icon, bringToFront, allowMonitorReuse, visible);
}
- public IProgressMonitor GetOutputProgressMonitor (string id, string title, IconId icon, bool bringToFront, bool allowMonitorReuse)
- {
- Pad pad = CreateMonitorPad (id, title, icon, bringToFront, allowMonitorReuse, true);
- pad.Visible = true;
- return ((DefaultMonitorPad) pad.Content).BeginProgress (title);
- }
-
- public IProgressMonitor GetOutputProgressMonitor (string id, string title, IconId icon, bool bringToFront, bool allowMonitorReuse, bool visible)
+ public OutputProgressMonitor GetOutputProgressMonitor (string id, string title, IconId icon, bool bringToFront, bool allowMonitorReuse, bool visible = true)
{
Pad pad = CreateMonitorPad (id, title, icon, bringToFront, allowMonitorReuse, true);
pad.Visible = visible;
@@ -157,7 +156,7 @@ namespace MonoDevelop.Ide.Gui
/// For example, if you have a monitor 'm' created with a call to GetOutputProgressMonitor,
/// GetPadForMonitor (m) will return the output pad.
/// </remarks>
- public Pad GetPadForMonitor (IProgressMonitor monitor)
+ public Pad GetPadForMonitor (ProgressMonitor monitor)
{
foreach (Pad pad in outputMonitors) {
DefaultMonitorPad p = (DefaultMonitorPad) pad.Content;
@@ -243,12 +242,7 @@ namespace MonoDevelop.Ide.Gui
pad.Destroy ();
}
- public ISearchProgressMonitor GetSearchProgressMonitor (bool bringToFront)
- {
- return GetSearchProgressMonitor (bringToFront, false);
- }
-
- public ISearchProgressMonitor GetSearchProgressMonitor (bool bringToFront, bool focusPad)
+ public SearchProgressMonitor GetSearchProgressMonitor (bool bringToFront, bool focusPad = false, CancellationTokenSource cancellationTokenSource = null)
{
Pad pad = null;
string title = GettextCatalog.GetString ("Search Results");
@@ -269,7 +263,7 @@ namespace MonoDevelop.Ide.Gui
}
if (pad != null) {
if (bringToFront) pad.BringToFront (focusPad);
- return new SearchProgressMonitor (pad);
+ return new SearchProgressMonitor (pad, cancellationTokenSource);
}
instanceNum++;
@@ -284,20 +278,25 @@ namespace MonoDevelop.Ide.Gui
pad = IdeApp.Workbench.ShowPad (monitorPad, newPadId, title, basePadId + "/Center Bottom", Stock.FindIcon);
pad.Sticky = true;
- searchMonitors.Add (pad);
-
- if (searchMonitors.Count > 1) {
- // Additional search pads will be destroyed when hidden
- pad.Window.PadHidden += delegate {
- searchMonitors.Remove (pad);
- pad.Destroy ();
- };
+ lock (searchMonitors) {
+ searchMonitors.Add (pad);
+
+ if (searchMonitors.Count > 1) { // This is needed due to ContextBoundObject not being able to do a reflection access on private fields
+ var searchMonitorsCopy = searchMonitors;
+ // Additional search pads will be destroyed when hidden
+ pad.Window.PadHidden += delegate {
+ lock (searchMonitorsCopy) {
+ searchMonitorsCopy.Remove (pad);
+ }
+ pad.Destroy ();
+ };
+ }
}
if (bringToFront)
pad.BringToFront (focusPad);
- return new SearchProgressMonitor (pad);
+ return new SearchProgressMonitor (pad, cancellationTokenSource);
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProjectLoadProgressMonitor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProjectLoadProgressMonitor.cs
index 7b3c044568..0977dfdd84 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProjectLoadProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProjectLoadProgressMonitor.cs
@@ -29,27 +29,24 @@ using MonoDevelop.Projects.Extensions;
namespace MonoDevelop.Ide.Gui
{
- public class GtkProjectLoadProgressMonitor : WrappedProgressMonitor, IProjectLoadProgressMonitor
+ class GtkProjectLoadProgressMonitor : ProjectLoadProgressMonitor
{
MigrationType? Migration {
get; set;
}
- public MonoDevelop.Projects.Solution CurrentSolution { get; set; }
-
- public GtkProjectLoadProgressMonitor (IProgressMonitor monitor)
- : base (monitor)
+ public GtkProjectLoadProgressMonitor (ProgressMonitor monitor): base (Runtime.MainSynchronizationContext)
{
-
+ AddFollowerMonitor (monitor);
}
- protected override void Dispose (bool disposing)
+ public override void Dispose ()
{
CurrentSolution = null;
- base.Dispose (disposing);
+ base.Dispose ();
}
- public MigrationType ShouldMigrateProject ()
+ public override MigrationType ShouldMigrateProject ()
{
if (!IdeApp.IsInitialized)
return MigrationType.Ignore;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs
index 4b9b418447..5ca86e259b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs
@@ -44,16 +44,16 @@ namespace MonoDevelop.Ide.Gui
internal class SdiWorkspaceWindow : EventBox, IWorkbenchWindow, ICommandDelegatorRouter
{
DefaultWorkbench workbench;
- IViewContent content;
+ ViewContent content;
ExtensionContext extensionContext;
FileTypeCondition fileTypeCondition = new FileTypeCondition ();
- List<IBaseViewContent> viewContents = new List<IBaseViewContent> ();
+ List<BaseViewContent> viewContents = new List<BaseViewContent> ();
Notebook subViewNotebook = null;
Tabstrip subViewToolbar = null;
PathBar pathBar = null;
HBox toolbarBox = null;
- Dictionary<IBaseViewContent,DocumentToolbar> documentToolbars = new Dictionary<IBaseViewContent, DocumentToolbar> ();
+ Dictionary<BaseViewContent,DocumentToolbar> documentToolbars = new Dictionary<BaseViewContent, DocumentToolbar> ();
VBox box;
DockNotebookTab tab;
@@ -89,7 +89,7 @@ namespace MonoDevelop.Ide.Gui
SetDockNotebookTabTitle ();
}
- public SdiWorkspaceWindow (DefaultWorkbench workbench, IViewContent content, DockNotebook tabControl, DockNotebookTab tabLabel) : base ()
+ public SdiWorkspaceWindow (DefaultWorkbench workbench, ViewContent content, DockNotebook tabControl, DockNotebookTab tabLabel) : base ()
{
this.workbench = workbench;
this.tabControl = tabControl;
@@ -115,13 +115,14 @@ namespace MonoDevelop.Ide.Gui
content.ContentNameChanged += new EventHandler(SetTitleEvent);
content.DirtyChanged += HandleDirtyChanged;
- content.BeforeSave += new EventHandler(BeforeSave);
- content.ContentChanged += new EventHandler (OnContentChanged);
box.Show ();
Add (box);
SetTitleEvent(null, null);
+ }
+ internal void CreateCommandHandler ()
+ {
commandHandler = new ViewCommandHandlers (this);
}
@@ -202,15 +203,15 @@ namespace MonoDevelop.Ide.Gui
}
}
- public IEnumerable<IAttachableViewContent> SubViewContents {
+ public IEnumerable<BaseViewContent> SubViewContents {
get {
- return viewContents.OfType<IAttachableViewContent> ();
+ return viewContents.OfType<BaseViewContent> ();
}
}
// caution use activeView with care !!
- IBaseViewContent activeView = null;
- public IBaseViewContent ActiveViewContent {
+ BaseViewContent activeView = null;
+ public BaseViewContent ActiveViewContent {
get {
if (activeView != null)
return activeView;
@@ -230,7 +231,7 @@ namespace MonoDevelop.Ide.Gui
ShowPage (viewNumber);
}
- public void SwitchView (IAttachableViewContent view)
+ public void SwitchView (BaseViewContent view)
{
if (subViewNotebook != null)
ShowPage (viewContents.IndexOf (view));
@@ -356,7 +357,7 @@ namespace MonoDevelop.Ide.Gui
}
}
- public DocumentToolbar GetToolbar (IBaseViewContent targetView)
+ public DocumentToolbar GetToolbar (BaseViewContent targetView)
{
DocumentToolbar toolbar;
if (!documentToolbars.TryGetValue (targetView, out toolbar)) {
@@ -370,15 +371,7 @@ namespace MonoDevelop.Ide.Gui
return toolbar;
}
- void BeforeSave(object sender, EventArgs e)
- {
- IAttachableViewContent secondaryViewContent = ActiveViewContent as IAttachableViewContent;
- if (secondaryViewContent != null) {
- secondaryViewContent.BeforeSave ();
- }
- }
-
- public IViewContent ViewContent {
+ public ViewContent ViewContent {
get {
return content;
}
@@ -416,7 +409,7 @@ namespace MonoDevelop.Ide.Gui
myUntitledTitle = baseName + System.IO.Path.GetExtension (content.UntitledName);
while (found) {
found = false;
- foreach (IViewContent windowContent in workbench.InternalViewContentCollection) {
+ foreach (ViewContent windowContent in workbench.InternalViewContentCollection) {
string title = windowContent.WorkbenchWindow.Title;
if (title.EndsWith("+")) {
title = title.Substring(0, title.Length - 1);
@@ -446,13 +439,6 @@ namespace MonoDevelop.Ide.Gui
}
}
- public void OnContentChanged (object o, EventArgs e)
- {
- foreach (IAttachableViewContent subContent in SubViewContents) {
- subContent.BaseContentChanged ();
- }
- }
-
public bool CloseWindow (bool force)
{
return CloseWindow (force, false);
@@ -471,7 +457,17 @@ namespace MonoDevelop.Ide.Gui
OnClosed (args);
+ // This may happen if the document contains an attached view that is shown by
+ // default. In that case the main view is not added to the notebook and won't
+ // be destroyed.
+ bool destroyMainPage = tabPage != null && tabPage.Parent == null;
+
Destroy ();
+
+ // Destroy after the document is destroyed, since attached views may have references to the main view
+ if (destroyMainPage)
+ tabPage.Destroy ();
+
return true;
}
@@ -481,9 +477,8 @@ namespace MonoDevelop.Ide.Gui
GLib.Source.Remove (present_timeout);
}
- base.OnDestroyed ();
if (viewContents != null) {
- foreach (IAttachableViewContent sv in SubViewContents) {
+ foreach (BaseViewContent sv in SubViewContents) {
sv.Dispose ();
}
viewContents = null;
@@ -492,8 +487,6 @@ namespace MonoDevelop.Ide.Gui
if (content != null) {
content.ContentNameChanged -= new EventHandler(SetTitleEvent);
content.DirtyChanged -= HandleDirtyChanged;
- content.BeforeSave -= new EventHandler(BeforeSave);
- content.ContentChanged -= new EventHandler (OnContentChanged);
content.WorkbenchWindow = null;
content.Dispose ();
content = null;
@@ -508,6 +501,7 @@ namespace MonoDevelop.Ide.Gui
commandHandler = null;
document = null;
extensionContext = null;
+ base.OnDestroyed ();
}
#region lazy UI element creation
@@ -563,8 +557,9 @@ namespace MonoDevelop.Ide.Gui
// may happen before the main content is added to 'box', so we
// have to check if the content is already parented or not
- if (this.ViewContent.Control.Parent != null)
- box.Remove (this.ViewContent.Control);
+ Gtk.Widget viewWidget = ViewContent.Control;
+ if (viewWidget.Parent != null)
+ box.Remove (viewWidget);
subViewNotebook = new Notebook ();
subViewNotebook.TabPos = PositionType.Bottom;
@@ -587,12 +582,12 @@ namespace MonoDevelop.Ide.Gui
#endregion
- public void AttachViewContent (IAttachableViewContent subViewContent)
+ public void AttachViewContent (BaseViewContent subViewContent)
{
InsertViewContent (viewContents.Count, subViewContent);
}
- public void InsertViewContent (int index, IAttachableViewContent subViewContent)
+ public void InsertViewContent (int index, BaseViewContent subViewContent)
{
// need to create child Notebook when first IAttachableViewContent is added
CheckCreateSubViewContents ();
@@ -601,19 +596,17 @@ namespace MonoDevelop.Ide.Gui
subViewContent.WorkbenchWindow = this;
InsertButton (index, subViewContent.TabPageLabel, subViewContent);
- OnContentChanged (null, null);
-
if (ViewsChanged != null)
ViewsChanged (this, EventArgs.Empty);
}
- protected Tab AddButton (string label, IBaseViewContent viewContent)
+ protected Tab AddButton (string label, BaseViewContent viewContent)
{
return InsertButton (viewContents.Count, label, viewContent);
}
bool updating = false;
- protected Tab InsertButton (int index, string label, IBaseViewContent viewContent)
+ protected Tab InsertButton (int index, string label, BaseViewContent viewContent)
{
CheckCreateSubViewToolbar ();
updating = true;
@@ -639,7 +632,7 @@ namespace MonoDevelop.Ide.Gui
addedContent = true;
}
- int page = viewContents.IndexOf ((IBaseViewContent) tab.Tag);
+ int page = viewContents.IndexOf ((BaseViewContent) tab.Tag);
SetCurrentView (page);
QueueDraw ();
};
@@ -720,39 +713,39 @@ namespace MonoDevelop.Ide.Gui
void SetCurrentView (int newIndex)
{
- IAttachableViewContent subViewContent;
+ BaseViewContent subViewContent;
int oldIndex = subViewNotebook.CurrentPage;
subViewNotebook.CurrentPage = newIndex;
if (oldIndex != -1) {
- subViewContent = viewContents[oldIndex] as IAttachableViewContent;
+ subViewContent = viewContents[oldIndex] as BaseViewContent;
if (subViewContent != null)
- subViewContent.Deselected ();
+ subViewContent.OnDeselected ();
}
- subViewContent = viewContents[newIndex] as IAttachableViewContent;
+ subViewContent = viewContents[newIndex] as BaseViewContent;
DetachFromPathedDocument ();
MonoDevelop.Ide.Gui.Content.IPathedDocument pathedDocument;
- if (newIndex < 0 || newIndex == viewContents.IndexOf (ViewContent)) {
- pathedDocument = Document != null ? Document.GetContent<IPathedDocument> () : (IPathedDocument) ViewContent.GetContent (typeof(IPathedDocument));
+ if (newIndex < 0 || newIndex == viewContents.IndexOf ((BaseViewContent)ViewContent)) {
+ pathedDocument = Document != null ? Document.GetContent<IPathedDocument> () : (IPathedDocument)ViewContent.GetContent (typeof(IPathedDocument));
} else {
- pathedDocument = (IPathedDocument) viewContents[newIndex].GetContent (typeof(IPathedDocument));
+ pathedDocument = (IPathedDocument)viewContents[newIndex].GetContent (typeof(IPathedDocument));
}
var toolbarVisible = false;
foreach (var t in documentToolbars) {
toolbarVisible = ActiveViewContent == t.Key;
- t.Value.Container.Visible = toolbarVisible;
+ t.Value.Container.GetNativeWidget<Gtk.Widget> ().Visible = toolbarVisible;
}
if (pathedDocument != null && !toolbarVisible)
AttachToPathedDocument (pathedDocument);
if (subViewContent != null)
- subViewContent.Selected ();
+ subViewContent.OnSelected ();
OnActiveViewContentChanged (new ActiveViewContentEventArgs (this.ActiveViewContent));
}
@@ -772,12 +765,8 @@ namespace MonoDevelop.Ide.Gui
if (((Gtk.Window)Toplevel).HasToplevelFocus)
DockNotebook.ActiveNotebook = (SdiDragNotebook)Parent.Parent;
- Gtk.Widget w = content as Gtk.Widget;
- if (w != this.tabPage) {
- // Route commands to the view
- return ActiveViewContent;
- } else
- return null;
+ // Route commands to the view
+ return ActiveViewContent;
}
void SetDockNotebookTabTitle ()
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SideBar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SideBar.cs
index d18e6c7184..ccabbb926c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SideBar.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SideBar.cs
@@ -227,7 +227,7 @@ namespace MonoDevelop.Ide.Gui
this.orientation = orientation;
if (string.IsNullOrEmpty (icon)) {
-// if (label == "Debug") icon = "md-execute-debug";
+// if (label == "Debug") icon = "md-bug";
// if (label == "Default") icon = "md-solution";
}
this.label = label;
@@ -299,6 +299,8 @@ namespace MonoDevelop.Ide.Gui
else
c2.L *= 0.9;
Cairo.Gradient pat;
+
+ // FIXME: VV: Remove gradient features
pat = new Cairo.LinearGradient (x, y, x+w-2, y);
pat.AddColorStop (0, c2);
pat.AddColorStop (1, c1);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/StartupInfo.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/StartupInfo.cs
index abaa1b0225..9a7e1c5206 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/StartupInfo.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/StartupInfo.cs
@@ -85,7 +85,7 @@ namespace MonoDevelop.Ide.Gui
int.TryParse (fileMatch.Groups["line"].Value, out line);
if (fileMatch.Groups["column"].Success)
int.TryParse (fileMatch.Groups["column"].Value, out column);
- var file = new FileOpenInformation (filename, line, column, OpenDocumentOptions.Default);
+ var file = new FileOpenInformation (filename, null, line, column, OpenDocumentOptions.Default);
requestedFileList.Add (file);
}
} else if (a[0] == '-' || a[0] == '/') {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/StatusProgressMonitor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/StatusProgressMonitor.cs
index 752f262e12..6eb2f26ee2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/StatusProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/StatusProgressMonitor.cs
@@ -34,7 +34,7 @@ using MonoDevelop.Core;
namespace MonoDevelop.Ide.Gui
{
- internal class StatusProgressMonitor: BaseProgressMonitor
+ internal class StatusProgressMonitor: ProgressMonitor
{
string icon;
bool showErrorDialogs;
@@ -44,8 +44,9 @@ namespace MonoDevelop.Ide.Gui
StatusBarContext statusBar;
Pad statusSourcePad;
- public StatusProgressMonitor (string title, string iconName, bool showErrorDialogs, bool showTaskTitles, bool lockGui, Pad statusSourcePad)
+ public StatusProgressMonitor (string title, string iconName, bool showErrorDialogs, bool showTaskTitles, bool lockGui, Pad statusSourcePad): base (Runtime.MainSynchronizationContext)
{
+
this.lockGui = lockGui;
this.showErrorDialogs = showErrorDialogs;
this.showTaskTitles = showTaskTitles;
@@ -62,23 +63,22 @@ namespace MonoDevelop.Ide.Gui
protected override void OnProgressChanged ()
{
if (showTaskTitles)
- statusBar.ShowMessage (icon, CurrentTask);
- if (!UnknownWork) {
- statusBar.SetProgressFraction (GlobalWork);
- DesktopService.SetGlobalProgress (GlobalWork);
+ statusBar.ShowMessage (icon, CurrentTaskName);
+ if (!ProgressIsUnknown) {
+ statusBar.SetProgressFraction (Progress);
+ DesktopService.SetGlobalProgress (Progress);
} else
DesktopService.ShowGlobalProgressIndeterminate ();
- RunPendingEvents ();
}
public void UpdateStatusBar ()
{
if (showTaskTitles)
- statusBar.ShowMessage (icon, CurrentTask);
+ statusBar.ShowMessage (icon, CurrentTaskName);
else
statusBar.ShowMessage (icon, title);
- if (!UnknownWork)
- statusBar.SetProgressFraction (GlobalWork);
+ if (!ProgressIsUnknown)
+ statusBar.SetProgressFraction (Progress);
else
statusBar.SetProgressFraction (0);
}
@@ -91,31 +91,31 @@ namespace MonoDevelop.Ide.Gui
statusBar.EndProgress ();
try {
- if (Errors.Count > 0 || Warnings.Count > 0) {
- if (Errors.Count > 0) {
- statusBar.ShowError (Errors [Errors.Count - 1]);
- } else if (SuccessMessages.Count == 0) {
- statusBar.ShowWarning (Warnings [Warnings.Count - 1]);
+ if (Errors.Length > 0 || Warnings.Length > 0) {
+ if (Errors.Length > 0) {
+ statusBar.ShowError (Errors [Errors.Length - 1].Message);
+ } else if (SuccessMessages.Length == 0) {
+ statusBar.ShowWarning (Warnings [Warnings.Length - 1]);
}
DesktopService.ShowGlobalProgressError ();
base.OnCompleted ();
-
- if (!IsCancelRequested && showErrorDialogs)
- ShowResultDialog ();
+
+ if (!CancellationToken.IsCancellationRequested && showErrorDialogs)
+ this.ShowResultDialog ();
return;
}
-
- if (SuccessMessages.Count > 0)
- statusBar.ShowMessage (MonoDevelop.Ide.Gui.Stock.StatusSuccess, SuccessMessages [SuccessMessages.Count - 1]);
-
+
+ if (SuccessMessages.Length > 0)
+ statusBar.ShowMessage (MonoDevelop.Ide.Gui.Stock.StatusSuccess, SuccessMessages [SuccessMessages.Length - 1]);
+
} finally {
statusBar.StatusSourcePad = statusSourcePad;
statusBar.Dispose ();
}
- DesktopService.SetGlobalProgress (GlobalWork);
+ DesktopService.SetGlobalProgress (Progress);
base.OnCompleted ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/StockIcons.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/StockIcons.cs
index f0c6002c08..fa029271ab 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/StockIcons.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/StockIcons.cs
@@ -33,11 +33,12 @@ namespace MonoDevelop.Ide.Gui
{
public class Stock
{
+ public static readonly IconId AssetsFolder = "md-folder-assets";
public static readonly IconId AddNamespace = "md-add-namespace";
public static readonly IconId BreakPoint = "md-break-point";
public static readonly IconId BuildCombine = "md-build-combine";
public static readonly IconId Class = "md-class";
- public static readonly IconId ClearAllBookmarks = "md-clear-all-bookmarks";
+ public static readonly IconId ClearAllBookmarks = "md-bookmark-clear-all";
public static readonly IconId CloseAllDocuments = "md-close-all-documents";
public static readonly IconId CloseCombine = "md-close-combine-icon";
public static readonly IconId CloseIcon = Gtk.Stock.Close;
@@ -58,11 +59,11 @@ namespace MonoDevelop.Ide.Gui
public static readonly IconId Field = "md-field";
public static readonly IconId FileXmlIcon = "md-file-xml-icon";
public static readonly IconId FindIcon = "md-magnify";
- public static readonly IconId FindInFiles = "md-find-in-files";
- public static readonly IconId FindNextIcon = "md-find-next-icon";
+ public static readonly IconId FindNextIcon = "md-find-next";
+ public static readonly IconId FindPrevIcon = "md-find-prev";
public static readonly IconId FullScreen = Gtk.Stock.Fullscreen;
- public static readonly IconId GotoNextbookmark = "md-goto-nextbookmark";
- public static readonly IconId GotoPrevbookmark = "md-goto-prevbookmark";
+ public static readonly IconId GotoNextbookmark = "md-bookmark-next";
+ public static readonly IconId GotoPrevbookmark = "md-bookmark-prev";
public static readonly IconId Information = "md-information";
public static readonly IconId Interface = "md-interface";
public static readonly IconId InternalClass = "md-internal-class";
@@ -100,6 +101,7 @@ namespace MonoDevelop.Ide.Gui
public static readonly IconId PrivateProperty = "md-private-property";
public static readonly IconId PrivateStruct = "md-private-struct";
public static readonly IconId Property = "md-property";
+ public static readonly IconId Properties = "md-preferences";
public static readonly IconId ProtectedClass = "md-protected-class";
public static readonly IconId ProtectedDelegate = "md-protected-delegate";
public static readonly IconId ProtectedEnum = "md-protected-enum";
@@ -116,8 +118,8 @@ namespace MonoDevelop.Ide.Gui
public static readonly IconId RedoIcon = Gtk.Stock.Redo;
public static readonly IconId Reference = "md-reference";
public static readonly IconId ReferenceWarning = "md-reference-warning";
+ public static readonly IconId Region = "md-region";
public static readonly IconId ReplaceIcon = Gtk.Stock.FindAndReplace;
- public static readonly IconId ReplaceInFiles = "md-replace-in-files";
public static readonly IconId ResourceFileIcon = "md-resource-file-icon";
public static readonly IconId Console = "md-console";
public static readonly IconId RunProgramIcon = Gtk.Stock.Execute;
@@ -129,7 +131,7 @@ namespace MonoDevelop.Ide.Gui
public static readonly IconId Struct = "md-struct";
public static readonly IconId TaskListIcon = "md-task-list";
public static readonly IconId TextFileIcon = "md-text-file-icon";
- public static readonly IconId ToggleBookmark = "md-toggle-bookmark";
+ public static readonly IconId ToggleBookmark = "md-bookmark-toggle";
public static readonly IconId UndoIcon = Gtk.Stock.Undo;
public static readonly IconId Warning = "md-warning";
public static readonly IconId XmlFileIcon = "md-xml-file-icon";
@@ -150,6 +152,7 @@ namespace MonoDevelop.Ide.Gui
public static readonly IconId StatusUpdatesDownloading = "md-status-updates-downloading";
public static readonly IconId StatusUpdatesPaused = "md-status-updates-paused";
public static readonly IconId StatusUpdatesReady = "md-status-updates-ready";
+ public static readonly IconId StatusInstrumentation = "md-status-instrumentation";
public static readonly IconId Broom = "md-clear";
public static readonly IconId Stop = "md-stop";
public static readonly IconId MessageLog = "md-message-log";
@@ -159,5 +162,7 @@ namespace MonoDevelop.Ide.Gui
public static readonly IconId Add = "md-add";
public static readonly IconId Clear = "md-clear";
public static readonly IconId Execute = Gtk.Stock.Execute;
+ public static readonly IconId SearchboxSearch = "md-searchbox-search";
+ public static readonly IconId Updates = "md-updates";
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs
index b4a0005d1f..ccbf870986 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Styles.cs
@@ -1,21 +1,21 @@
-//
+ //
// Styles.cs
-//
+//
// Author:
// Lluis Sanchez <lluis@xamarin.com>
-//
+//
// Copyright (c) 2012 Xamarin Inc
-//
+//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
-//
+//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
-//
+//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -25,106 +25,146 @@
// THE SOFTWARE.
using System;
using MonoDevelop.Components;
+using Xwt.Drawing;
+using System.Security.Policy;
+
+#if MAC
+using AppKit;
+#endif
namespace MonoDevelop.Ide.Gui
{
- static class Styles
+ public static class Styles
{
- public static readonly Cairo.Color BaseBackgroundColor = new Cairo.Color (1, 1, 1);
- public static readonly Cairo.Color BaseForegroundColor = new Cairo.Color (0, 0, 0);
+ public static event EventHandler Changed;
+
+ public static Color BackgroundColor { get; internal set; } // must be the bg color from Gtkrc
+ public static Color BaseBackgroundColor { get; internal set; } // must be the base color from Gtkrc
+ public static Color BaseForegroundColor { get; internal set; } // must be the text color from Gtkrc
+ public static Color BaseSelectionBackgroundColor { get; internal set; }
+ public static Color BaseSelectionTextColor { get; internal set; }
+ public static Color BaseIconColor { get; internal set; }
+ public static Color LinkForegroundColor { get; internal set; }
+
+ public static Color ErrorForegroundColor { get; internal set; }
+ public static Color WarningForegroundColor { get; internal set; }
+ public static Color InformationForegroundColor { get; internal set; }
+
+ public static Color ErrorBoxForegroundColor { get; internal set; }
+ public static Color ErrorBoxBackgroundColor { get; internal set; }
+ public static Color WarningBoxForegroundColor { get; internal set; }
+ public static Color WarningBoxBackgroundColor { get; internal set; }
+ public static Color InformationBoxForegroundColor { get; internal set; }
+ public static Color InformationBoxBackgroundColor { get; internal set; }
+
+ public static Pango.FontDescription DefaultFont { get; internal set; }
+ public static string DefaultFontName { get; internal set; }
+
+ public static double FontScale11 = 0.92308;
+ public static double FontScale12 = 1;
+ public static double FontScale13 = 1.07693;
+ public static double FontScale14 = 1.15385;
+
+ public static Color ThinSplitterColor { get; internal set; }
+ public static Color SeparatorColor { get; internal set; }
+ public static Color PrimaryBackgroundColor { get; internal set; }
+ public static Color SecondaryBackgroundLighterColor { get; internal set; }
+ public static Color SecondaryBackgroundDarkerColor { get; internal set; }
+ public static Color DimTextColor { get; internal set; }
+ public static Color StatusInformationBackgroundColor { get; internal set; }
+ public static Color StatusInformationTextColor { get; internal set; }
+ public static Color StatusWarningBackgroundColor { get; internal set; }
+ public static Color StatusWarningTextColor { get; internal set; }
+ public static Color StatusErrorBackgroundColor { get; internal set; }
+ public static Color StatusErrorTextColor { get; internal set; }
- // General
+ // Document tab bar
- public static readonly Gdk.Color ThinSplitterColor = new Gdk.Color (166, 166, 166);
+ public static Color TabBarBackgroundColor { get; internal set; }
+ public static Color TabBarActiveTextColor { get; internal set; }
+ public static Color TabBarNotifyTextColor { get; internal set; }
+ public static Color TabBarInactiveTextColor { get; internal set; }
- // Document tab bar
+ public static Color BreadcrumbBackgroundColor { get; internal set; }
+ public static Color BreadcrumbTextColor { get; internal set; }
+ public static Color BreadcrumbButtonFillColor { get; internal set; }
+ public static Color BreadcrumbBottomBorderColor { get; internal set; }
+ // Document Subview Tabs
- public static readonly Cairo.Color TabBarBackgroundColor = CairoExtensions.ParseColor ("c2c2c2");
- public static readonly Cairo.Color TabBarActiveTextColor = new Cairo.Color (0, 0, 0);
-
- public static readonly Cairo.Color TabBarActiveGradientStartColor = Shift (TabBarBackgroundColor, 0.92);
- public static readonly Cairo.Color TabBarActiveGradientEndColor = TabBarBackgroundColor;
- public static readonly Cairo.Color TabBarGradientStartColor = Shift (TabBarBackgroundColor, 1.02);
- public static readonly Cairo.Color TabBarGradientEndColor = TabBarBackgroundColor;
- public static readonly Cairo.Color TabBarGradientShadowColor = Shift (TabBarBackgroundColor, 0.8);
- public static readonly Cairo.Color TabBarHoverActiveTextColor = TabBarActiveTextColor;
- public static readonly Cairo.Color TabBarInactiveTextColor = Blend (new Cairo.Color (0, 0, 0), TabBarGradientStartColor, 0.4);
- public static readonly Cairo.Color TabBarHoverInactiveTextColor = new Cairo.Color (0, 0, 0);
-
- public static readonly Cairo.Color BreadcrumbGradientStartColor = CairoExtensions.ParseColor ("FFFFFF");
- public static readonly Cairo.Color BreadcrumbBackgroundColor = Shift (BreadcrumbGradientStartColor, .95);
- public static readonly Cairo.Color BreadcrumbGradientEndColor = Shift (BreadcrumbGradientStartColor, 0.9);
- public static readonly Cairo.Color BreadcrumbBorderColor = Shift (BreadcrumbBackgroundColor, 0.6);
- public static readonly Cairo.Color BreadcrumbInnerBorderColor = WithAlpha (BaseBackgroundColor, 0.1d);
- public static readonly Gdk.Color BreadcrumbTextColor = Shift (BaseForegroundColor, 0.8).ToGdkColor ();
- public static readonly Cairo.Color BreadcrumbButtonBorderColor = Shift (BaseBackgroundColor, 0.8);
- public static readonly Cairo.Color BreadcrumbButtonFillColor = WithAlpha (BaseBackgroundColor, 0.1d);
- public static readonly Cairo.Color BreadcrumbBottomBorderColor = Shift (BreadcrumbBackgroundColor, 0.7d);
- public static readonly bool BreadcrumbInvertedIcons = false;
- public static readonly bool BreadcrumbGreyscaleIcons = false;
+ public static Color SubTabBarBackgroundColor { get; internal set; }
+ public static Color SubTabBarTextColor { get; internal set; }
+ public static Color SubTabBarActiveBackgroundColor { get; internal set; }
+ public static Color SubTabBarActiveTextColor { get; internal set; }
+ public static Color SubTabBarHoverBackgroundColor { get; internal set; }
+ public static Color SubTabBarSeparatorColor { get; internal set; }
// Dock pads
-
- public static readonly Cairo.Color DockTabBarGradientTop = new Cairo.Color (248d / 255d, 248d / 255d, 248d / 255d);
- public static readonly Cairo.Color DockTabBarGradientStart = new Cairo.Color (242d / 255d, 242d / 255d, 242d / 255d);
- public static readonly Cairo.Color DockTabBarGradientEnd = new Cairo.Color (230d / 255d, 230d / 255d, 230d / 255d);
- public static readonly Cairo.Color DockTabBarShadowGradientStart = new Cairo.Color (154d / 255d, 154d / 255d, 154d / 255d, 1);
- public static readonly Cairo.Color DockTabBarShadowGradientEnd = new Cairo.Color (154d / 255d, 154d / 255d, 154d / 255d, 0);
- public static readonly Gdk.Color PadBackground = new Gdk.Color (240, 240, 240);
- public static readonly Gdk.Color InactivePadBackground = ReduceLight (PadBackground, 0.9);
- public static readonly Gdk.Color PadLabelColor = new Gdk.Color (92, 99, 102);
- public static readonly Gdk.Color DockFrameBackground = new Gdk.Color (157, 162, 166);
- public static readonly Gdk.Color DockSeparatorColor = ThinSplitterColor;
+ public static Color PadBackground { get; internal set; }
+ public static Color InactivePadBackground { get; internal set; }
+ public static Color PadLabelColor { get; internal set; }
+ public static Color InactivePadLabelColor { get; internal set; }
+ public static Color DockFrameBackground { get; internal set; }
+ public static Color DockSeparatorColor { get; internal set; }
+ public static Color DockBarBackground { get; internal set; }
+ public static Color DockBarPrelightColor { get; internal set; }
+ public static Color DockBarLabelColor { get; internal set; }
- public static readonly Gdk.Color BrowserPadBackground = new Gdk.Color (225, 228, 232);
- public static readonly Gdk.Color InactiveBrowserPadBackground = new Gdk.Color (240, 240, 240);
+ public static Color BrowserPadBackground { get; internal set; }
+ public static Color InactiveBrowserPadBackground { get; internal set; }
- public static readonly Cairo.Color DockBarBackground1 = PadBackground.ToCairoColor ();
- public static readonly Cairo.Color DockBarBackground2 = Shift (PadBackground.ToCairoColor (), 0.95);
- public static readonly Cairo.Color DockBarSeparatorColorDark = new Cairo.Color (0, 0, 0, 0.2);
- public static readonly Cairo.Color DockBarSeparatorColorLight = new Cairo.Color (1, 1, 1, 0.3);
+ public static Color PadCategoryBackgroundColor { get; internal set; }
+ public static Color PadCategoryBorderColor { get; internal set; }
+ public static Color PadCategoryLabelColor { get; internal set; }
- public static readonly Cairo.Color DockBarPrelightColor = CairoExtensions.ParseColor ("ffffff");
+ public static Color PropertyPadLabelBackgroundColor { get; internal set; }
+ public static Color PropertyPadDividerColor { get; internal set; }
// Status area
- public static readonly Cairo.Color WidgetBorderColor = CairoExtensions.ParseColor ("8c8c8c");
+ public static Color WidgetBorderColor { get; internal set; }
+
+ public static Color StatusBarBorderColor { get; internal set; }
- public static readonly Cairo.Color StatusBarBorderColor = CairoExtensions.ParseColor ("919191");
+ public static Color StatusBarFill1Color { get; internal set; }
+ public static Color StatusBarFill2Color { get; internal set; }
+ public static Color StatusBarFill3Color { get; internal set; }
+ public static Color StatusBarFill4Color { get; internal set; }
- public static readonly Cairo.Color StatusBarFill1Color = CairoExtensions.ParseColor ("f5fafc");
- public static readonly Cairo.Color StatusBarFill2Color = CairoExtensions.ParseColor ("e9f1f3");
- public static readonly Cairo.Color StatusBarFill3Color = CairoExtensions.ParseColor ("d8e7ea");
- public static readonly Cairo.Color StatusBarFill4Color = CairoExtensions.ParseColor ("d1e3e7");
+ public static Color StatusBarErrorColor { get; internal set; }
- public static readonly Cairo.Color StatusBarErrorColor = CairoExtensions.ParseColor ("FF6363");
+ public static Color StatusBarInnerColor { get; internal set; }
+ public static Color StatusBarShadowColor1 { get; internal set; }
+ public static Color StatusBarShadowColor2 { get; internal set; }
+ public static Color StatusBarTextColor { get; internal set; }
+ public static Color StatusBarProgressBackgroundColor { get; internal set; }
+ public static Color StatusBarProgressOutlineColor { get; internal set; }
- public static readonly Cairo.Color StatusBarInnerColor = new Cairo.Color (0,0,0, 0.08);
- public static readonly Cairo.Color StatusBarShadowColor1 = new Cairo.Color (0,0,0, 0.06);
- public static readonly Cairo.Color StatusBarShadowColor2 = new Cairo.Color (0,0,0, 0.02);
- public static readonly Cairo.Color StatusBarTextColor = CairoExtensions.ParseColor ("555555");
- public static readonly Cairo.Color StatusBarProgressBackgroundColor = new Cairo.Color (0, 0, 0, 0.1);
- public static readonly Cairo.Color StatusBarProgressOutlineColor = new Cairo.Color (0, 0, 0, 0.1);
+ public static readonly Pango.FontDescription StatusFont = Pango.FontDescription.FromString ("Normal");
- public static readonly Pango.FontDescription StatusFont = Pango.FontDescription.FromString ("Normal");
-
public static int StatusFontPixelHeight { get { return (int)(11 * PixelScale); } }
public static int ProgressBarHeight { get { return (int)(18 * PixelScale); } }
public static int ProgressBarInnerPadding { get { return (int)(4 * PixelScale); } }
public static int ProgressBarOuterPadding { get { return (int)(4 * PixelScale); } }
- static readonly double PixelScale = Mono.TextEditor.GtkWorkarounds.GetPixelScale ();
+ static double? pixelScale = null;
+
+ static double PixelScale {
+ get {
+ if (!pixelScale.HasValue)
+ pixelScale = GtkWorkarounds.GetPixelScale ();
+ return (double)pixelScale;
+ }
+ }
// Toolbar
- public static readonly Cairo.Color ToolbarBottomBorderColor = new Cairo.Color (0.5, 0.5, 0.5);
- public static readonly Cairo.Color ToolbarBottomGlowColor = new Cairo.Color (1, 1, 1, 0.2);
+ public static Color ToolbarBottomBorderColor { get; internal set; }
// Code Completion
- public static readonly int TooltipInfoSpacing = 1;
+ public static readonly int TooltipInfoSpacing;
// Popover Windows
@@ -133,76 +173,440 @@ namespace MonoDevelop.Ide.Gui
public static readonly int PagerTriangleSize = 6;
public static readonly int PagerHeight = 16;
- public static readonly Cairo.Color DefaultBackgroundColor = CairoExtensions.ParseColor ("f2f2f2");
- public static readonly Cairo.Color ErrorBackgroundColor = CairoExtensions.ParseColor ("E27267");
- public static readonly Cairo.Color WarningBackgroundColor = CairoExtensions.ParseColor ("efd46c");
- public static readonly Cairo.Color InformationBackgroundColor = CairoExtensions.ParseColor ("709DC9");
+ public static Color DefaultBackgroundColor { get; internal set; }
+ public static Color ErrorBackgroundColor { get; internal set; }
+ public static Color WarningBackgroundColor { get; internal set; }
+ public static Color InformationBackgroundColor { get; internal set; }
- public static readonly Cairo.Color DefaultBorderColor = CairoExtensions.ParseColor ("ffeeba");
- public static readonly Cairo.Color ErrorBorderColor = CairoExtensions.ParseColor ("c97968");
- public static readonly Cairo.Color WarningBorderColor = CairoExtensions.ParseColor ("e8c12c");
- public static readonly Cairo.Color InformationBorderColor = CairoExtensions.ParseColor ("6688bc");
+ public static Color DefaultTextColor { get; internal set; }
+ public static Color ErrorTextColor { get; internal set; }
+ public static Color WarningTextColor { get; internal set; }
+ public static Color InformationTextColor { get; internal set; }
- public static readonly Cairo.Color DefaultTextColor = CairoExtensions.ParseColor ("665a36");
- public static readonly Cairo.Color ErrorTextColor = CairoExtensions.ParseColor ("ffffff");
- public static readonly Cairo.Color WarningTextColor = CairoExtensions.ParseColor ("563b00");
- public static readonly Cairo.Color InformationTextColor = CairoExtensions.ParseColor ("ffffff");
+ public static Color ShadowColor { get; internal set; }
public static class ParamaterWindows
{
- public static readonly Cairo.Color GradientStartColor = CairoExtensions.ParseColor ("fffee6");
- public static readonly Cairo.Color GradientEndColor = CairoExtensions.ParseColor ("fffcd1");
+ public static Color GradientStartColor { get; internal set; }
+ public static Color GradientEndColor { get; internal set; }
}
}
+ // Code Completion
+
+ public static class CodeCompletion
+ {
+ public static Color BackgroundColor { get; internal set; }
+ public static Color TextColor { get; internal set; }
+ public static Color CategoryColor { get; internal set; }
+ public static Color HighlightColor { get; internal set; }
+ public static Color SelectionBackgroundColor { get; internal set; }
+ public static Color SelectionBackgroundInactiveColor { get; internal set; }
+ public static Color SelectionTextColor { get; internal set; }
+ public static Color SelectionHighlightColor { get; internal set; }
+ }
+
+ // Global Search
+
+ public static class GlobalSearch
+ {
+ public static Color HeaderTextColor { get; internal set; }
+ public static Color SeparatorLineColor { get; internal set; }
+ public static Color HeaderBackgroundColor { get; internal set; }
+ public static Color BackgroundColor { get; internal set; }
+ public static Color SelectionBackgroundColor { get; internal set; }
+ public static Color ResultTextColor { get; internal set; }
+ public static Color ResultDescriptionTextColor { get; internal set; }
+ public static Color ResultMatchTextColor { get; internal set; }
+ public static Color SelectedResultTextColor { get; internal set; }
+ public static Color SelectedResultDescriptionTextColor { get; internal set; }
+ public static Color SelectedResultMatchTextColor { get; internal set; }
+ }
+
+ // New Project Dialog
+
+ public static class NewProjectDialog
+ {
+ public static Color BannerBackgroundColor { get; internal set; }
+ public static Color BannerLineColor { get; internal set; }
+ public static Color BannerForegroundColor { get; internal set; }
+ public static Color CategoriesBackgroundColor { get; internal set; }
+ public static Color TemplateListBackgroundColor { get; internal set; }
+ public static Color TemplateBackgroundColor { get; internal set; }
+ public static Color TemplateSectionSeparatorColor { get; internal set; }
+ public static Color TemplateLanguageButtonBackground { get; internal set; }
+ public static Color TemplateLanguageButtonTriangle { get; internal set; }
+ public static Color ProjectConfigurationLeftHandBackgroundColor { get; internal set; }
+ public static Color ProjectConfigurationRightHandBackgroundColor { get; internal set; }
+ public static Color ProjectConfigurationPreviewLabelColor { get; internal set; }
+ public static Color ProjectConfigurationSeparatorColor { get; internal set; }
+ }
+
+ // Editor
+
+ public static class Editor
+ {
+ public static Color SmartTagMarkerColorLight { get; internal set; }
+ public static Color SmartTagMarkerColorDark { get; internal set; }
+ public static Color SearchErrorForegroundColor { get; internal set; }
+ }
+
// Helper methods
- internal static Cairo.Color Shift (Cairo.Color color, double factor)
+ internal static Color Shift (Color color, double factor)
+ {
+ return new Color (color.Red * factor, color.Green * factor, color.Blue * factor, color.Alpha);
+ }
+
+ internal static Color MidColor (double factor)
{
- return new Cairo.Color (color.R * factor, color.G * factor, color.B * factor, color.A);
+ return BaseBackgroundColor.BlendWith (BaseForegroundColor, factor);
}
- internal static Cairo.Color WithAlpha (Cairo.Color c, double alpha)
+ internal static Color ReduceLight (Color color, double factor)
{
- return new Cairo.Color (c.R, c.G, c.B, alpha);
+ color.Light *= factor;
+ return color;
}
- internal static Cairo.Color Blend (Cairo.Color color, Cairo.Color targetColor, double factor)
+ internal static Color IncreaseLight (Color color, double factor)
{
- return new Cairo.Color (color.R + ((targetColor.R - color.R) * factor),
- color.G + ((targetColor.G - color.G) * factor),
- color.B + ((targetColor.B - color.B) * factor),
- color.A
- );
+ color.Light += (1 - color.Light) * factor;
+ return color;
}
- internal static Cairo.Color MidColor (double factor)
+ public static string ColorGetHex (Color color, bool withAlpha = false)
{
- return Blend (BaseBackgroundColor, BaseForegroundColor, factor);
+ if (withAlpha) {
+ return String.Format("#{0:x2}{1:x2}{2:x2}{3:x2}", (byte)(color.Red * 255), (byte)(color.Green * 255),
+ (byte)(color.Blue * 255), (byte)(color.Alpha * 255));
+ } else {
+ return String.Format("#{0:x2}{1:x2}{2:x2}", (byte)(color.Red * 255), (byte)(color.Green * 255),
+ (byte)(color.Blue * 255));
+ }
}
- internal static Cairo.Color ReduceLight (Cairo.Color color, double factor)
+ static Styles ()
{
- var c = color.ToXwtColor ();
- c.Light *= factor;
- return c.ToCairoColor ();
+ if (Core.Platform.IsWindows)
+ TooltipInfoSpacing = 0;
+ else
+ TooltipInfoSpacing = -4;
+ LoadStyle ();
}
- internal static Cairo.Color IncreaseLight (Cairo.Color color, double factor)
+ internal static void LoadStyle ()
{
- var c = color.ToXwtColor ();
- c.Light += (1 - c.Light) * factor;
- return c.ToCairoColor ();
+ Gtk.Style defaultStyle;
+ Gtk.Widget styledWidget;
+ if (IdeApp.Workbench == null || IdeApp.Workbench.RootWindow == null) {
+ styledWidget = new Gtk.Label (String.Empty);
+ defaultStyle = styledWidget.Style;
+ } else {
+ styledWidget = IdeApp.Workbench.RootWindow;
+ defaultStyle = Gtk.Rc.GetStyle (styledWidget);
+ }
+
+ BackgroundColor = defaultStyle.Background (Gtk.StateType.Normal).ToXwtColor (); // must be the bg color from Gtkrc
+ BaseBackgroundColor = defaultStyle.Base (Gtk.StateType.Normal).ToXwtColor (); // must be the base color from Gtkrc
+ BaseForegroundColor = defaultStyle.Foreground (Gtk.StateType.Normal).ToXwtColor (); // must be the text color from Gtkrc
+ BaseSelectionBackgroundColor = defaultStyle.Base (Gtk.StateType.Selected).ToXwtColor ();
+ BaseSelectionTextColor = defaultStyle.Text (Gtk.StateType.Selected).ToXwtColor ();
+
+ LinkForegroundColor = ((Gdk.Color)styledWidget.StyleGetProperty ("link-color")).ToXwtColor ();
+ if (LinkForegroundColor == Colors.Black) // the style returs black when not initialized
+ LinkForegroundColor = Colors.Blue; // set the link color to generic blue until initialization is finished
+
+ DefaultFont = defaultStyle.FontDescription.Copy ();
+ DefaultFontName = DefaultFont.ToString ();
+
+ if (IdeApp.Preferences == null || IdeApp.Preferences.UserInterfaceSkin == Skin.Light)
+ LoadLightStyle ();
+ else
+ LoadDarkStyle ();
+
+ // Shared colors
+
+ DockBarLabelColor = BaseIconColor;
+ DockSeparatorColor = DockFrameBackground;
+ PropertyPadLabelBackgroundColor = PrimaryBackgroundColor;
+ PadCategoryBorderColor = SeparatorColor;
+ PadCategoryLabelColor = BaseForegroundColor;
+ PadCategoryBackgroundColor = SecondaryBackgroundLighterColor;
+ PadLabelColor = BaseForegroundColor;
+ SubTabBarActiveBackgroundColor = BaseSelectionBackgroundColor;
+ SubTabBarActiveTextColor = BaseSelectionTextColor;
+ SubTabBarSeparatorColor = SubTabBarTextColor;
+ InactiveBrowserPadBackground = InactivePadBackground;
+
+ // Tabs
+
+ TabBarBackgroundColor = DockFrameBackground;
+ TabBarInactiveTextColor = InactivePadLabelColor;
+ TabBarActiveTextColor = BaseForegroundColor;
+
+ // Breadcrumbs
+
+ BreadcrumbTextColor = BaseForegroundColor;
+
+ // Document Subview Tabs
+
+ SubTabBarTextColor = BaseForegroundColor;
+
+ // Popover Window
+
+ PopoverWindow.InformationBackgroundColor = StatusInformationBackgroundColor;
+ PopoverWindow.InformationTextColor = StatusInformationTextColor;
+ PopoverWindow.WarningBackgroundColor = StatusWarningBackgroundColor;
+ PopoverWindow.WarningTextColor = StatusWarningTextColor;
+ PopoverWindow.ErrorBackgroundColor = StatusErrorBackgroundColor;
+ PopoverWindow.ErrorTextColor = StatusErrorTextColor;
+
+ // Code Completion
+
+ CodeCompletion.SelectionBackgroundColor = BaseSelectionBackgroundColor;
+ CodeCompletion.SelectionTextColor = BaseSelectionTextColor;
+
+ // Global Search
+
+ GlobalSearch.BackgroundColor = PrimaryBackgroundColor;
+ GlobalSearch.HeaderBackgroundColor = SecondaryBackgroundLighterColor;
+ GlobalSearch.HeaderTextColor = DimTextColor;
+ GlobalSearch.SeparatorLineColor = SeparatorColor;
+ GlobalSearch.SelectionBackgroundColor = BaseSelectionBackgroundColor;
+ GlobalSearch.ResultTextColor = BaseForegroundColor;
+ GlobalSearch.ResultDescriptionTextColor = DimTextColor;
+ GlobalSearch.SelectedResultTextColor = BaseSelectionTextColor;
+ GlobalSearch.SelectedResultDescriptionTextColor = BaseSelectionTextColor;
+ GlobalSearch.SelectedResultMatchTextColor = BaseSelectionTextColor;
+
+ // New Project Dialog
+
+ NewProjectDialog.TemplateBackgroundColor = PrimaryBackgroundColor;
+ NewProjectDialog.TemplateLanguageButtonTriangle = BaseIconColor;
+ NewProjectDialog.ProjectConfigurationPreviewLabelColor = BaseForegroundColor;
+ NewProjectDialog.CategoriesBackgroundColor = SecondaryBackgroundDarkerColor;
+ NewProjectDialog.ProjectConfigurationLeftHandBackgroundColor = SecondaryBackgroundDarkerColor;
+ NewProjectDialog.ProjectConfigurationRightHandBackgroundColor = PrimaryBackgroundColor;
+
+ // Editor
+
+ Editor.SmartTagMarkerColorLight = Color.FromName ("#ff70fe").WithAlpha (.5);
+ Editor.SmartTagMarkerColorDark = Color.FromName ("#ffffff").WithAlpha (.5);
+ Editor.SearchErrorForegroundColor = ErrorForegroundColor;
+
+ if (Changed != null)
+ Changed (null, EventArgs.Empty);
}
- internal static Gdk.Color ReduceLight (Gdk.Color color, double factor)
+ internal static void LoadLightStyle ()
{
- return ReduceLight (color.ToCairoColor (), factor).ToGdkColor ();
+ BaseIconColor = Color.FromName ("#575757");
+ ThinSplitterColor = Color.FromName ("#dadada");
+ SeparatorColor = Color.FromName ("#f2f2f4");
+ PrimaryBackgroundColor = BaseBackgroundColor;
+ SecondaryBackgroundDarkerColor = Color.FromName ("#e7eaee");
+ SecondaryBackgroundLighterColor = Color.FromName ("#f9f9fb");
+ DimTextColor = Color.FromName ("#888888");
+ PadBackground = Color.FromName ("#fafafa");
+ InactivePadBackground = Color.FromName ("#e8e8e8");
+ InactivePadLabelColor = Color.FromName ("#777777");
+ DockFrameBackground = Color.FromName ("#bfbfbf");
+ DockBarBackground = Color.FromName ("#dddddd");
+ DockBarPrelightColor = Color.FromName ("#eeeeee");
+ BrowserPadBackground = Color.FromName ("#ebedf0");
+ PropertyPadDividerColor = Color.FromName ("#efefef");
+
+ // these colors need to match colors from status icons
+ StatusInformationBackgroundColor = Color.FromName ("#87b6f0");
+ StatusInformationTextColor = BaseBackgroundColor;
+ InformationBoxBackgroundColor = StatusInformationBackgroundColor;
+ InformationBoxForegroundColor = Color.FromName ("#000000");
+ InformationForegroundColor = Color.FromName ("#5785bd");
+
+ StatusWarningBackgroundColor = Color.FromName ("#f1c40f");
+ StatusWarningTextColor = BaseBackgroundColor;
+ WarningBoxBackgroundColor = StatusWarningBackgroundColor;
+ WarningBoxForegroundColor = Color.FromName ("#000000");
+ WarningForegroundColor = Color.FromName ("#a08000");
+
+ StatusErrorBackgroundColor = Color.FromName ("#f56d4f");
+ StatusErrorTextColor = BaseBackgroundColor;
+ ErrorBoxBackgroundColor = StatusErrorBackgroundColor;
+ ErrorBoxForegroundColor = Color.FromName ("#000000");
+ ErrorForegroundColor = Color.FromName ("#db6246");
+
+ // Tabs
+
+ TabBarNotifyTextColor = Color.FromName ("#1FAECE");
+
+ // Breadcrumb
+
+ BreadcrumbBackgroundColor = PadBackground;
+ BreadcrumbButtonFillColor = BaseSelectionBackgroundColor.WithAlpha (0.2);
+ BreadcrumbBottomBorderColor = DockBarBackground;
+
+ // Document Subview Tabs
+
+ SubTabBarBackgroundColor = PadBackground;
+ SubTabBarHoverBackgroundColor = BaseSelectionBackgroundColor.WithAlpha (0.2);
+
+ // WidgetBorderColor = Color.FromName ("#ff00ff"); // TODO: 8c8c8c - UNUSED (used for custom drawn `SearchEntry` but it isn’t used anymore, so its deprecated)
+
+ // Status area (GTK)
+
+ StatusBarBorderColor = Color.FromName ("#919191");
+ StatusBarFill1Color = Color.FromName ("#fcfcfc");
+ StatusBarFill2Color = Color.FromName ("#f2f2f2");
+ StatusBarFill3Color = Color.FromName ("#ebebeb");
+ StatusBarFill4Color = Color.FromName ("#e8e8e8");
+ StatusBarErrorColor = ErrorForegroundColor;
+ StatusBarInnerColor = Color.FromName ("#000000").WithAlpha (.08);
+ StatusBarShadowColor1 = Color.FromName ("#000000").WithAlpha (.06);
+ StatusBarShadowColor2 = Color.FromName ("#000000").WithAlpha (.02);
+ StatusBarTextColor = BaseForegroundColor;
+ StatusBarProgressBackgroundColor = Color.FromName ("#000000").WithAlpha (.1);
+ StatusBarProgressOutlineColor = Color.FromName ("#000000").WithAlpha (.1);
+
+ // Toolbar
+
+ ToolbarBottomBorderColor = Color.FromName ("#afafaf");
+
+ // Global Search
+
+ GlobalSearch.ResultMatchTextColor = Color.FromName ("#4d4d4d");
+
+ // Popover Window
+
+ PopoverWindow.DefaultBackgroundColor = Color.FromName ("#f2f2f2"); // gtkrc @tooltip_bg_color
+ PopoverWindow.DefaultTextColor = Color.FromName ("#555555");
+ PopoverWindow.ShadowColor = Color.FromName ("#000000").WithAlpha (.05);
+
+ PopoverWindow.ParamaterWindows.GradientStartColor = Color.FromName ("#fffee6");
+ PopoverWindow.ParamaterWindows.GradientEndColor = Color.FromName ("#fffcd1");
+
+ // Code Completion
+
+ CodeCompletion.BackgroundColor = Color.FromName ("#eef1f2");
+ CodeCompletion.TextColor = Color.FromName ("#646566");
+ CodeCompletion.CategoryColor = DimTextColor;
+ CodeCompletion.HighlightColor = Color.FromName ("#ba3373");
+ CodeCompletion.SelectionBackgroundInactiveColor = Color.FromName ("#7e96c0");
+ CodeCompletion.SelectionHighlightColor = CodeCompletion.HighlightColor;
+
+ // New Project Dialog
+
+ NewProjectDialog.BannerBackgroundColor = Color.FromName ("#77828c");
+ NewProjectDialog.BannerLineColor = Color.FromName ("#707a83");
+ NewProjectDialog.BannerForegroundColor = BaseBackgroundColor;
+ NewProjectDialog.TemplateListBackgroundColor = Color.FromName ("#f9f9fa");
+ NewProjectDialog.TemplateSectionSeparatorColor = Color.FromName ("#e2e2e2");
+ NewProjectDialog.TemplateLanguageButtonBackground = BaseBackgroundColor;
+ NewProjectDialog.ProjectConfigurationSeparatorColor = Color.FromName ("#d2d5d9");
}
- internal static Gdk.Color IncreaseLight (Gdk.Color color, double factor)
+ internal static void LoadDarkStyle ()
{
- return IncreaseLight (color.ToCairoColor (), factor).ToGdkColor ();
+ BaseIconColor = Color.FromName ("#bfbfbf");
+ ThinSplitterColor = Color.FromName ("#2e2e2e");
+ SeparatorColor = Color.FromName ("#4b4b4b");
+ PrimaryBackgroundColor = BaseBackgroundColor;
+ SecondaryBackgroundDarkerColor = Color.FromName ("#484848");
+ SecondaryBackgroundLighterColor = SeparatorColor;
+ DimTextColor = Color.FromName ("#777777");
+ PadBackground = Color.FromName ("#525252");
+ InactivePadBackground = Color.FromName ("#474747");
+ InactivePadLabelColor = Color.FromName ("#999999");
+ DockFrameBackground = Color.FromName ("#303030");
+ DockBarBackground = PadBackground;
+ DockBarPrelightColor = Color.FromName ("#666666");
+ BrowserPadBackground = Color.FromName ("#484b55");
+ PropertyPadDividerColor = SeparatorColor;
+
+ // these colors need to match colors from status icons
+ StatusInformationBackgroundColor = Color.FromName ("#8fc1ff");
+ StatusInformationTextColor = Color.FromName ("#394d66");
+ InformationBoxBackgroundColor = StatusInformationBackgroundColor;
+ InformationBoxForegroundColor = Color.FromName ("#000000");
+ InformationForegroundColor = Color.FromName ("#9cc8ff");
+
+ StatusWarningBackgroundColor = Color.FromName ("#ffcf0f");
+ StatusWarningTextColor = Color.FromName ("#665206");
+ WarningBoxBackgroundColor = StatusWarningBackgroundColor;
+ WarningBoxForegroundColor = Color.FromName ("#000000");
+ WarningForegroundColor = Color.FromName ("#ffd21c");
+
+ StatusErrorBackgroundColor = Color.FromName ("#ff7152");
+ StatusErrorTextColor = Color.FromName ("#662d20");
+ ErrorBoxBackgroundColor = StatusErrorBackgroundColor;
+ ErrorBoxForegroundColor = Color.FromName ("#000000");
+ ErrorForegroundColor = Color.FromName ("#ff866b");
+
+ // Tabs
+
+ TabBarNotifyTextColor = Color.FromName ("#4FCAE6");
+
+ // Breadcrumb
+
+ BreadcrumbBackgroundColor = PadBackground;
+ BreadcrumbButtonFillColor = SecondaryBackgroundLighterColor;
+ BreadcrumbBottomBorderColor = BreadcrumbBackgroundColor;
+
+ // Document Subview Tabs
+
+ SubTabBarBackgroundColor = PadBackground;
+ SubTabBarHoverBackgroundColor = SecondaryBackgroundLighterColor;
+
+ // Status area (GTK)
+
+ StatusBarBorderColor = Color.FromName ("#222222");
+ StatusBarFill1Color = Color.FromName ("#282828");
+ StatusBarFill2Color = Color.FromName ("#000000").WithAlpha (0);
+ StatusBarFill3Color = Color.FromName ("#000000").WithAlpha (0);
+ StatusBarFill4Color = Color.FromName ("#222222");
+ StatusBarErrorColor = ErrorForegroundColor;
+ StatusBarInnerColor = Color.FromName ("#000000").WithAlpha (.08);
+ StatusBarShadowColor1 = Color.FromName ("#000000").WithAlpha (.06);
+ StatusBarShadowColor2 = Color.FromName ("#000000").WithAlpha (.02);
+ StatusBarTextColor = BaseForegroundColor;
+ StatusBarProgressBackgroundColor = Color.FromName ("#ffffff").WithAlpha (.1);
+ StatusBarProgressOutlineColor = Color.FromName ("#ffffff").WithAlpha (.1);
+
+ // Toolbar
+
+ ToolbarBottomBorderColor = Color.FromName ("#444444");
+
+ // Global Search
+
+ GlobalSearch.ResultMatchTextColor = BaseSelectionTextColor;
+
+ // Popover window
+
+ PopoverWindow.DefaultBackgroundColor = Color.FromName ("#5e5e5e");
+ PopoverWindow.DefaultTextColor = Color.FromName ("#bdc1c1");
+ PopoverWindow.ShadowColor = Color.FromName ("#000000").WithAlpha (0); // transparent since dark skin doesn't need shadows
+
+ PopoverWindow.ParamaterWindows.GradientStartColor = Color.FromName ("#fffee6");
+ PopoverWindow.ParamaterWindows.GradientEndColor = Color.FromName ("#fffcd1");
+
+ // Code Completion
+
+ CodeCompletion.BackgroundColor = PopoverWindow.DefaultBackgroundColor;
+ CodeCompletion.TextColor = Color.FromName ("#c3c5c6");
+ CodeCompletion.CategoryColor = Color.FromName ("#a1a1a1");
+ CodeCompletion.HighlightColor = Color.FromName ("#f9d33c");
+ CodeCompletion.SelectionBackgroundInactiveColor = Color.FromName ("#7e96c0");
+ CodeCompletion.SelectionHighlightColor = CodeCompletion.HighlightColor;
+
+ // New Project Dialog
+
+ NewProjectDialog.BannerBackgroundColor = Color.FromName ("#6a737e");
+ NewProjectDialog.BannerLineColor = NewProjectDialog.BannerBackgroundColor;
+ NewProjectDialog.BannerForegroundColor = Color.FromName ("#ffffff");
+ NewProjectDialog.TemplateListBackgroundColor = DockBarBackground;
+ NewProjectDialog.TemplateSectionSeparatorColor = ThinSplitterColor;
+ NewProjectDialog.TemplateLanguageButtonBackground = SecondaryBackgroundDarkerColor;
+ NewProjectDialog.ProjectConfigurationSeparatorColor = Color.FromName ("#6e6e6e");
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SyncContext.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SyncContext.cs
index 4491df322c..8db95e7b96 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SyncContext.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SyncContext.cs
@@ -41,11 +41,6 @@ namespace MonoDevelop.Ide.Gui
[ThreadStatic]
static SyncContext context;
- static Hashtable delegateFactories = new Hashtable ();
- static ModuleBuilder module;
- static AssemblyBuilder asmBuilder;
- static int typeCounter;
-
public static void SetContext (SyncContext ctx)
{
context = ctx;
@@ -65,222 +60,7 @@ namespace MonoDevelop.Ide.Gui
{
cb.BeginInvoke (ob, null, null);
}
-
- public Delegate CreateSynchronizedDelegate (Delegate del)
- {
- lock (delegateFactories.SyncRoot)
- {
- Type delType = del.GetType();
- IDelegateFactory factory = delegateFactories [delType] as IDelegateFactory;
- if (factory == null)
- {
- Type t = GetDelegateFactoryType (delType);
- factory = Activator.CreateInstance (t) as IDelegateFactory;
- delegateFactories [delType] = factory;
- }
- return factory.Create (del, this);
- }
- }
-
- Type GetDelegateFactoryType (Type delegateType)
- {
- MethodInfo invoke = delegateType.GetMethod ("Invoke");
- ModuleBuilder module = GetModuleBuilder ();
-
- // *** Data class
- StringBuilder typeNameBuilder = new StringBuilder ();
- typeNameBuilder.Append ("__");
- typeNameBuilder.Append (delegateType.Name);
- Type[] generics = delegateType.GetGenericArguments ();
- if (generics != null) {
- foreach (Type t in generics) {
- typeNameBuilder.Append ("_");
- typeNameBuilder.Append (t.Name);
- }
- }
- TypeBuilder dataTypeBuilder = module.DefineType (typeNameBuilder + "_DelegateData_" + (typeCounter++), TypeAttributes.Public, typeof(object), Type.EmptyTypes);
-
- // Parameters
- ParameterInfo[] pars = invoke.GetParameters ();
- FieldBuilder[] paramFields = new FieldBuilder [pars.Length];
- Type[] paramTypes = new Type[pars.Length];
- for (int n=0; n<pars.Length; n++)
- {
- ParameterInfo pi = pars [n];
- paramFields [n] = dataTypeBuilder.DefineField ("p" + n, pi.ParameterType, FieldAttributes.Public);
- paramTypes [n] = pi.ParameterType;
- }
-
- // Return value
- FieldBuilder returnField = null;
- if (invoke.ReturnType != typeof(void))
- returnField = dataTypeBuilder.DefineField ("ret", invoke.ReturnType, FieldAttributes.Public);
-
- // Constructor
- ConstructorBuilder dataCtor = dataTypeBuilder.DefineConstructor (MethodAttributes.Public, CallingConventions.Standard, Type.EmptyTypes);
- ConstructorInfo baseCtor = typeof(object).GetConstructor (Type.EmptyTypes);
- ILGenerator gen = dataCtor.GetILGenerator();
- gen.Emit (OpCodes.Ldarg_0);
- gen.Emit (OpCodes.Call, baseCtor);
- gen.Emit (OpCodes.Ret);
-
-
- // *** Factory class
-
- TypeBuilder typeBuilder = module.DefineType (typeNameBuilder + "_DelegateFactory_" + typeCounter, TypeAttributes.Public, typeof(object), new Type[] {typeof(IDelegateFactory)});
-
- // Context and target delegate field
-
- FieldBuilder contextField = typeBuilder.DefineField ("context", typeof(SyncContext), FieldAttributes.Public);
- FieldBuilder targetField = typeBuilder.DefineField ("target", delegateType, FieldAttributes.Public);
-
- // Constructor
-
- ConstructorBuilder ctor = typeBuilder.DefineConstructor (MethodAttributes.Public, CallingConventions.Standard, Type.EmptyTypes);
- gen = ctor.GetILGenerator();
- gen.Emit (OpCodes.Ldarg_0);
- gen.Emit (OpCodes.Call, baseCtor);
- gen.Emit (OpCodes.Ret);
-
- // Dispatch method
-
- MethodBuilder methodDispatch = typeBuilder.DefineMethod ("Dispatch", MethodAttributes.Public, typeof(void), new Type[] {typeof(object)});
- gen = methodDispatch.GetILGenerator();
-
- LocalBuilder data = gen.DeclareLocal (dataTypeBuilder);
- gen.Emit (OpCodes.Ldarg_1);
- gen.Emit (OpCodes.Castclass, dataTypeBuilder);
- gen.Emit (OpCodes.Stloc, data);
-
- if (returnField != null)
- gen.Emit (OpCodes.Ldloc, data);
-
- gen.Emit (OpCodes.Ldarg_0);
- gen.Emit (OpCodes.Ldfld, targetField);
-
- for (int n=0; n<pars.Length; n++) {
- gen.Emit (OpCodes.Ldloc, data);
- gen.Emit (OpCodes.Ldfld, paramFields[n]);
- }
- gen.Emit (OpCodes.Callvirt, invoke);
-
- if (returnField != null)
- gen.Emit (OpCodes.Stfld, returnField);
-
- gen.Emit (OpCodes.Ret);
-
- // ProxyCall method
-
- MethodBuilder methodProxyCall = typeBuilder.DefineMethod ("ProxyCall", MethodAttributes.Public, invoke.ReturnType, paramTypes);
- gen = methodProxyCall.GetILGenerator();
-
- data = gen.DeclareLocal (dataTypeBuilder);
- gen.Emit (OpCodes.Newobj, dataCtor);
- gen.Emit (OpCodes.Stloc, data);
-
- for (int n=0; n<paramFields.Length; n++) {
- gen.Emit (OpCodes.Ldloc, data);
- gen.Emit (OpCodes.Ldarg, n+1);
- gen.Emit (OpCodes.Stfld, paramFields[n]);
- }
- gen.Emit (OpCodes.Ldarg_0);
- gen.Emit (OpCodes.Ldfld, contextField);
- gen.Emit (OpCodes.Ldarg_0);
- gen.Emit (OpCodes.Ldftn, methodDispatch);
- gen.Emit (OpCodes.Newobj, typeof(StatefulMessageHandler).GetConstructor (new Type[] {typeof(object), typeof(IntPtr)} ));
- gen.Emit (OpCodes.Ldloc, data);
-
- if (returnField != null) {
- gen.Emit (OpCodes.Callvirt, typeof(SyncContext).GetMethod ("Dispatch"));
- gen.Emit (OpCodes.Ldloc, data);
- gen.Emit (OpCodes.Ldfld, returnField);
- }
- else {
- gen.Emit (OpCodes.Callvirt, typeof(SyncContext).GetMethod ("AsyncDispatch"));
- }
- gen.Emit (OpCodes.Ret);
-
- // Create method
-
- MethodBuilder methodCreate = typeBuilder.DefineMethod ("Create", MethodAttributes.Public | MethodAttributes.Virtual, typeof(Delegate), new Type[] {typeof(Delegate), typeof(SyncContext)});
- gen = methodCreate.GetILGenerator();
- LocalBuilder vthis = gen.DeclareLocal (typeBuilder);
- gen.Emit (OpCodes.Newobj, ctor);
- gen.Emit (OpCodes.Stloc, vthis);
- gen.Emit (OpCodes.Ldloc, vthis);
- gen.Emit (OpCodes.Ldarg_1);
- gen.Emit (OpCodes.Castclass, delegateType);
- gen.Emit (OpCodes.Stfld, targetField);
- gen.Emit (OpCodes.Ldloc, vthis);
- gen.Emit (OpCodes.Ldarg_2);
- gen.Emit (OpCodes.Stfld, contextField);
- gen.Emit (OpCodes.Ldloc, vthis);
- gen.Emit (OpCodes.Ldftn, methodProxyCall);
- gen.Emit (OpCodes.Newobj, delegateType.GetConstructor (new Type[] {typeof(object), typeof(IntPtr)} ));
- gen.Emit (OpCodes.Ret);
- typeBuilder.DefineMethodOverride (methodCreate, typeof(IDelegateFactory).GetMethod ("Create"));
-
- dataTypeBuilder.CreateType ();
- return typeBuilder.CreateType ();
- }
-
- static ModuleBuilder GetModuleBuilder ()
- {
- if (module == null)
- {
- AppDomain myDomain = System.Threading.Thread.GetDomain();
- AssemblyName myAsmName = new AssemblyName();
- myAsmName.Name = "MonoDevelop.DelegateGenerator.GeneratedAssembly";
-
- asmBuilder = myDomain.DefineDynamicAssembly (myAsmName, AssemblyBuilderAccess.RunAndSave);
- module = asmBuilder.DefineDynamicModule ("MonoDevelop.DelegateGenerator.GeneratedAssembly", "MonoDevelop.DelegateGenerator.GeneratedAssembly.dll");
- }
- return module;
- }
}
-
- public interface IDelegateFactory
- {
- Delegate Create (Delegate del, SyncContext ctx);
- }
-
-
- /* Sample class generated for the EventHandler delegate
-
- class __EventHandler_DelegateData
- {
- public object psender;
- public EventArgs pargs;
- }
-
- class __EventHandler_DelegateFactory: IDelegateFactory
- {
- EventHandler target;
- SyncContext context;
-
- public Delegate Create (Delegate del, SyncContext ctx)
- {
- __EventHandler_DelegateFactory vthis = new __EventHandler_DelegateFactory ();
- vthis.target = del;
- vthis.context = ctx;
- return new EventHandler (vthis.ProxyCall);
- }
-
- public void ProxyCall (object sender, EventArgs args)
- {
- __EventHandler_DelegateData data = new __EventHandler_DelegateData ();
- data.psender = sender;
- data.pargs = args;
- StatefulMessageHandler msg = new StatefulMessageHandler (Dispatch);
- context.AsyncDispatch (msg, data);
- }
-
- public void Dispatch (object obj)
- {
- __EventHandler_DelegateData data = (__EventHandler_DelegateData) obj;
- target (data.psender, data.pargs);
- }
- }
-
- */
+
+ public delegate void StatefulMessageHandler (object state);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs
index 4b821b558e..065e41692e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ToolbarComboBox.cs
@@ -30,6 +30,7 @@ using System;
using MonoDevelop.Core;
using MonoDevelop.Projects;
using MonoDevelop.Components.Commands;
+using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.Ide.Gui
{
@@ -65,9 +66,7 @@ namespace MonoDevelop.Ide.Gui
{
if (Style != null) {
if (toolbar.IconSize == Gtk.IconSize.Menu || toolbar.IconSize == Gtk.IconSize.SmallToolbar) {
- Pango.FontDescription fd = Style.FontDescription.Copy ();
- fd.Size = (int) (fd.Size * Pango.Scale.Small);
- ctx.FontDesc = fd;
+ ctx.FontDesc = FontService.SansFont.CopyModified (Ide.Gui.Styles.FontScale11);
} else {
ctx.FontDesc = Style.FontDescription;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs
index 46a5e9712c..51ad28502d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs
@@ -35,10 +35,11 @@ using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.Commands;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Ide.Gui
{
- public class ViewCommandHandlers : ICommandRouter
+ public class ViewCommandHandlers
{
IWorkbenchWindow window;
Document doc;
@@ -54,11 +55,6 @@ namespace MonoDevelop.Ide.Gui
return (T) window.ActiveViewContent.GetContent (typeof(T));
}
- object ICommandRouter.GetNextCommandTarget ()
- {
- return doc.ExtendedCommandTargetChain;
- }
-
[CommandHandler (FileCommands.Save)]
protected void OnSaveFile ()
{
@@ -158,8 +154,13 @@ namespace MonoDevelop.Ide.Gui
[CommandUpdateHandler (EditCommands.Cut)]
protected void OnUpdateCut (CommandInfo info)
{
+ bool inWpf = false;
+ #if WIN32
+ if (System.Windows.Input.Keyboard.FocusedElement != null)
+ inWpf = true;
+ #endif
IClipboardHandler handler = GetContent <IClipboardHandler> ();
- if (handler != null && handler.EnableCut)
+ if (!inWpf && handler != null && handler.EnableCut)
info.Enabled = true;
else
info.Bypass = true;
@@ -176,8 +177,13 @@ namespace MonoDevelop.Ide.Gui
[CommandUpdateHandler (EditCommands.Copy)]
protected void OnUpdateCopy (CommandInfo info)
{
+ bool inWpf = false;
+ #if WIN32
+ if (System.Windows.Input.Keyboard.FocusedElement != null)
+ inWpf = true;
+ #endif
IClipboardHandler handler = GetContent <IClipboardHandler> ();
- if (handler != null && handler.EnableCopy)
+ if (!inWpf && handler != null && handler.EnableCopy)
info.Enabled = true;
else
info.Bypass = true;
@@ -194,8 +200,13 @@ namespace MonoDevelop.Ide.Gui
[CommandUpdateHandler (EditCommands.Paste)]
protected void OnUpdatePaste (CommandInfo info)
{
+ bool inWpf = false;
+ #if WIN32
+ if (System.Windows.Input.Keyboard.FocusedElement != null)
+ inWpf = true;
+ #endif
IClipboardHandler handler = GetContent <IClipboardHandler> ();
- if (handler != null && handler.EnablePaste)
+ if (!inWpf && handler != null && handler.EnablePaste)
info.Enabled = true;
else
info.Bypass = true;
@@ -230,8 +241,13 @@ namespace MonoDevelop.Ide.Gui
[CommandUpdateHandler (EditCommands.SelectAll)]
protected void OnUpdateSelectAll (CommandInfo info)
{
+ bool inWpf = false;
+ #if WIN32
+ if (System.Windows.Input.Keyboard.FocusedElement != null)
+ inWpf = true;
+ #endif
IClipboardHandler handler = GetContent <IClipboardHandler> ();
- if (handler != null)
+ if (!inWpf && handler != null)
info.Enabled = handler.EnableSelectAll;
else
info.Bypass = true;
@@ -240,33 +256,33 @@ namespace MonoDevelop.Ide.Gui
[CommandHandler (EditCommands.UppercaseSelection)]
public void OnUppercaseSelection ()
{
- IEditableTextBuffer buffer = GetContent <IEditableTextBuffer> ();
+ var buffer = GetContent <TextEditor> ();
if (buffer == null)
return;
string selectedText = buffer.SelectedText;
if (string.IsNullOrEmpty (selectedText)) {
- int pos = buffer.CursorPosition;
- string ch = buffer.GetText (pos, pos + 1);
+ int pos = buffer.CaretOffset;
+ string ch = buffer.GetTextAt (pos, pos + 1);
string upper = ch.ToUpper ();
if (upper == ch) {
- buffer.CursorPosition = pos + 1;
+ buffer.CaretOffset = pos + 1;
return;
}
using (var undo = buffer.OpenUndoGroup ()) {
- buffer.DeleteText (pos, 1);
+ buffer.RemoveText (pos, 1);
buffer.InsertText (pos, upper);
- buffer.CursorPosition = pos + 1;
+ buffer.CaretOffset = pos + 1;
}
} else {
string newText = selectedText.ToUpper ();
if (newText == selectedText)
return;
- int startPos = buffer.SelectionStartPosition;
+ int startPos = buffer.SelectionRange.Offset;
using (var undo = buffer.OpenUndoGroup ()) {
- buffer.DeleteText (startPos, selectedText.Length);
+ buffer.RemoveText (startPos, selectedText.Length);
buffer.InsertText (startPos, newText);
- buffer.Select (startPos, startPos + newText.Length);
+ buffer.SetSelection (startPos, startPos + newText.Length);
}
}
}
@@ -274,40 +290,40 @@ namespace MonoDevelop.Ide.Gui
[CommandUpdateHandler (EditCommands.UppercaseSelection)]
protected void OnUppercaseSelection (CommandInfo info)
{
- IEditableTextBuffer buffer = GetContent <IEditableTextBuffer> ();
+ var buffer = GetContent <TextEditor> ();
info.Enabled = buffer != null;
}
[CommandHandler (EditCommands.LowercaseSelection)]
public void OnLowercaseSelection ()
{
- IEditableTextBuffer buffer = GetContent <IEditableTextBuffer> ();
+ var buffer = GetContent <TextEditor> ();
if (buffer == null)
return;
string selectedText = buffer.SelectedText;
if (string.IsNullOrEmpty (selectedText)) {
- int pos = buffer.CursorPosition;
- string ch = buffer.GetText (pos, pos + 1);
+ int pos = buffer.CaretOffset;
+ string ch = buffer.GetTextAt (pos, pos + 1);
string lower = ch.ToLower ();
if (lower == ch) {
- buffer.CursorPosition = pos + 1;
+ buffer.CaretOffset = pos + 1;
return;
};
using (var undo = buffer.OpenUndoGroup ()) {
- buffer.DeleteText (pos, 1);
+ buffer.RemoveText (pos, 1);
buffer.InsertText (pos, lower);
- buffer.CursorPosition = pos + 1;
+ buffer.CaretOffset = pos + 1;
}
} else {
string newText = selectedText.ToLower ();
if (newText == selectedText)
return;
- int startPos = buffer.SelectionStartPosition;
+ int startPos = buffer.SelectionRange.Offset;
using (var undo = buffer.OpenUndoGroup ()) {
- buffer.DeleteText (startPos, selectedText.Length);
+ buffer.RemoveText (startPos, selectedText.Length);
buffer.InsertText (startPos, newText);
- buffer.Select (startPos, startPos + newText.Length);
+ buffer.SetSelection (startPos, startPos + newText.Length);
}
}
}
@@ -315,7 +331,7 @@ namespace MonoDevelop.Ide.Gui
[CommandUpdateHandler (EditCommands.LowercaseSelection)]
protected void OnLowercaseSelection (CommandInfo info)
{
- IEditableTextBuffer buffer = GetContent <IEditableTextBuffer> ();
+ var buffer = GetContent <TextEditor> ();
info.Enabled = buffer != null;
}
@@ -346,69 +362,68 @@ namespace MonoDevelop.Ide.Gui
[CommandHandler (TextEditorCommands.LineEnd)]
protected void OnLineEnd ()
{
- Mono.TextEditor.CaretMoveActions.LineEnd (doc.Editor);
+ doc.Editor.EditorActionHost.MoveCaretToLineEnd ();
}
[CommandHandler (TextEditorCommands.LineStart)]
protected void OnLineStart ()
{
- Mono.TextEditor.CaretMoveActions.LineStart (doc.Editor);
+ doc.Editor.EditorActionHost.MoveCaretToLineStart ();
}
[CommandHandler (TextEditorCommands.DeleteLeftChar)]
protected void OnDeleteLeftChar ()
{
- Mono.TextEditor.CaretMoveActions.Left (doc.Editor);
- Mono.TextEditor.DeleteActions.Delete (doc.Editor);
+ doc.Editor.EditorActionHost.Backspace ();
}
[CommandHandler (TextEditorCommands.DeleteRightChar)]
protected void OnDeleteRightChar ()
{
- Mono.TextEditor.DeleteActions.Delete (doc.Editor);
+ doc.Editor.EditorActionHost.Delete ();
}
[CommandHandler (TextEditorCommands.CharLeft)]
protected void OnCharLeft ()
{
- Mono.TextEditor.CaretMoveActions.Left (doc.Editor);
+ doc.Editor.EditorActionHost.MoveCaretLeft ();
}
[CommandHandler (TextEditorCommands.CharRight)]
protected void OnCharRight ()
{
- Mono.TextEditor.CaretMoveActions.Right (doc.Editor);
+ doc.Editor.EditorActionHost.MoveCaretRight ();
}
[CommandHandler (TextEditorCommands.LineUp)]
protected void OnLineUp ()
{
- Mono.TextEditor.CaretMoveActions.Up (doc.Editor);
+ doc.Editor.EditorActionHost.MoveCaretUp ();
}
[CommandHandler (TextEditorCommands.LineDown)]
protected void OnLineDown ()
{
- Mono.TextEditor.CaretMoveActions.Down (doc.Editor);
+ doc.Editor.EditorActionHost.MoveCaretDown ();
}
[CommandHandler (TextEditorCommands.DocumentStart)]
protected void OnDocumentStart ()
{
- Mono.TextEditor.CaretMoveActions.ToDocumentStart (doc.Editor);
+ doc.Editor.EditorActionHost.MoveCaretToDocumentStart ();
}
[CommandHandler (TextEditorCommands.DocumentEnd)]
protected void OnDocumentEnd ()
{
- Mono.TextEditor.CaretMoveActions.ToDocumentEnd (doc.Editor);
+ doc.Editor.EditorActionHost.MoveCaretToDocumentEnd ();
}
[CommandHandler (TextEditorCommands.DeleteLine)]
protected void OnDeleteLine ()
{
- var line = doc.Editor.Document.GetLine (doc.Editor.Caret.Line);
- doc.Editor.Remove (line.Offset, line.LengthIncludingDelimiter);
+ var line = doc.Editor.GetLine (doc.Editor.CaretLocation.Line);
+ doc.Editor.RemoveText (line.Offset, line.LengthIncludingDelimiter);
}
struct RemoveInfo
@@ -435,7 +450,7 @@ namespace MonoDevelop.Ide.Gui
return ch == ' ' || ch == '\t' || ch == '\v';
}
- public static RemoveInfo GetRemoveInfo (Mono.TextEditor.TextDocument document, ref int pos)
+ public static RemoveInfo GetRemoveInfo (TextEditor document, ref int pos)
{
int len = 0;
while (pos > 0 && IsWhiteSpace (document.GetCharAt (pos))) {
@@ -458,22 +473,22 @@ namespace MonoDevelop.Ide.Gui
[CommandHandler (EditCommands.RemoveTrailingWhiteSpaces)]
public void OnRemoveTrailingWhiteSpaces ()
{
- Mono.TextEditor.TextEditorData data = doc.Editor;
+ var data = doc.Editor;
if (data == null)
return;
System.Collections.Generic.List<RemoveInfo> removeList = new System.Collections.Generic.List<RemoveInfo> ();
- int pos = data.Document.TextLength - 1;
- RemoveInfo removeInfo = RemoveInfo.GetRemoveInfo (data.Document, ref pos);
+ int pos = data.Length - 1;
+ RemoveInfo removeInfo = RemoveInfo.GetRemoveInfo (data, ref pos);
if (!removeInfo.IsEmpty)
removeList.Add (removeInfo);
while (pos >= 0) {
- char ch = data.Document.GetCharAt (pos);
+ char ch = data.GetCharAt (pos);
if (ch == '\n' || ch == '\r') {
- if (RemoveInfo.IsWhiteSpace (data.Document.GetCharAt (pos - 1))) {
+ if (RemoveInfo.IsWhiteSpace (data.GetCharAt (pos - 1))) {
--pos;
- removeInfo = RemoveInfo.GetRemoveInfo (data.Document, ref pos);
+ removeInfo = RemoveInfo.GetRemoveInfo (data, ref pos);
if (!removeInfo.IsEmpty)
removeList.Add (removeInfo);
}
@@ -482,8 +497,7 @@ namespace MonoDevelop.Ide.Gui
}
using (var undo = data.OpenUndoGroup ()) {
foreach (var info in removeList) {
- data.Document.Remove (info.Position, info.Length);
- data.Document.CommitLineUpdate (data.Document.OffsetToLineNumber (info.Position));
+ data.RemoveText (info.Position, info.Length);
}
}
}
@@ -491,13 +505,13 @@ namespace MonoDevelop.Ide.Gui
[CommandUpdateHandler (EditCommands.RemoveTrailingWhiteSpaces)]
protected void OnRemoveTrailingWhiteSpaces (CommandInfo info)
{
- info.Enabled = GetContent <IEditableTextBuffer> () != null;
+ info.Enabled = GetContent <TextEditor> () != null;
}
#region Folding
bool IsFoldMarkerMarginEnabled {
get {
- return PropertyService.Get ("ShowFoldMargin", false);
+ return DefaultSourceEditorOptions.Instance.ShowFoldMargin;
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewContent.cs
new file mode 100644
index 0000000000..e7f69e98e4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewContent.cs
@@ -0,0 +1,166 @@
+// ViewContent.cs
+//
+// Author:
+// Viktoria Dudka (viktoriad@remobjects.com)
+//
+// Copyright (c) 2009 RemObjects Software
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+//
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using MonoDevelop.Components;
+using System.Threading.Tasks;
+using MonoDevelop.Core;
+using MonoDevelop.Projects;
+using Xwt;
+
+namespace MonoDevelop.Ide.Gui
+{
+ public abstract class ViewContent : BaseViewContent
+ {
+ #region ViewContent Members
+
+ string untitledName = "";
+ string contentName;
+ bool isDirty;
+
+ public string UntitledName {
+ get { return untitledName; }
+ set { untitledName = value; }
+ }
+
+ public string ContentName {
+ get { return contentName; }
+ set {
+ if (value != contentName) {
+ contentName = value;
+ OnContentNameChanged ();
+ }
+ }
+ }
+
+ public bool IsUntitled {
+ get { return (contentName == null); }
+ }
+
+ public virtual bool IsDirty {
+ get { return isDirty; }
+ set {
+ if (value != isDirty) {
+ isDirty = value;
+ OnDirtyChanged ();
+ }
+ }
+ }
+
+ public virtual bool IsReadOnly {
+ get { return false; }
+ }
+
+ public virtual bool IsHidden {
+ get { return false; }
+ }
+
+ public virtual bool IsViewOnly {
+ get { return false; }
+ }
+
+ public virtual bool IsFile {
+ get { return true; }
+ }
+
+ public virtual string StockIconId {
+ get { return null; }
+ }
+
+ internal string PathRelativeToProject {
+ get { return Project == null ? null : FileService.AbsoluteToRelativePath (Project.BaseDirectory, ContentName); }
+ }
+
+ public virtual Task Save ()
+ {
+ return Save (contentName);
+ }
+
+ public Task Save (FilePath fileName)
+ {
+ return Save (new FileSaveInformation (fileName));
+ }
+
+ public virtual Task Save (FileSaveInformation fileSaveInformation)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public virtual void DiscardChanges ()
+ {
+ }
+
+ public virtual Task Load (FileOpenInformation fileOpenInformation)
+ {
+ return Task.FromResult (true);
+ }
+
+ public Task Load (FilePath fileName)
+ {
+ return Load (new FileOpenInformation (fileName, null));
+ }
+
+ public virtual Task LoadNew (System.IO.Stream content, string mimeType)
+ {
+ throw new NotSupportedException ();
+ }
+
+ internal event EventHandler ContentNameChanged;
+
+ public event EventHandler DirtyChanged;
+
+ #endregion
+
+
+ protected virtual void OnDirtyChanged ()
+ {
+ if (DirtyChanged != null)
+ DirtyChanged (this, EventArgs.Empty);
+ }
+
+ protected virtual void OnContentNameChanged ()
+ {
+ if (ContentNameChanged != null)
+ ContentNameChanged (this, EventArgs.Empty);
+ }
+ }
+
+ public abstract class AbstractXwtViewContent : ViewContent
+ {
+ public override Control Control {
+ get {
+ return (Gtk.Widget)Toolkit.CurrentEngine.GetNativeWidget (Widget);
+ }
+ }
+
+ public abstract Xwt.Widget Widget {
+ get;
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs
index 58e4750c86..385a017ae2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs
@@ -51,6 +51,10 @@ using MonoDevelop.Ide.Navigation;
using MonoDevelop.Components.Docking;
using MonoDevelop.Components.DockNotebook;
using System.Text;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Components;
+using System.Threading.Tasks;
+using System.Collections.Immutable;
namespace MonoDevelop.Ide.Gui
{
@@ -60,8 +64,7 @@ namespace MonoDevelop.Ide.Gui
public sealed class Workbench
{
readonly ProgressMonitorManager monitors = new ProgressMonitorManager ();
- readonly List<Document> documents = new List<Document> ();
- readonly List<Split> splits = new List<Split> ();
+ ImmutableList<Document> documents = ImmutableList<Document>.Empty;
DefaultWorkbench workbench;
PadCollection pads;
@@ -70,7 +73,7 @@ namespace MonoDevelop.Ide.Gui
public event EventHandler GuiLocked;
public event EventHandler GuiUnlocked;
- internal void Initialize (IProgressMonitor monitor)
+ internal void Initialize (ProgressMonitor monitor)
{
monitor.BeginTask (GettextCatalog.GetString ("Initializing Main Window"), 4);
try {
@@ -88,6 +91,7 @@ namespace MonoDevelop.Ide.Gui
((Gtk.Window)workbench).Visible = false;
workbench.ActiveWorkbenchWindowChanged += OnDocumentChanged;
+ workbench.WorkbenchTabsChanged += WorkbenchTabsChanged;
IdeApp.Workspace.StoringUserPreferences += OnStoringWorkspaceUserPreferences;
IdeApp.Workspace.LoadingUserPreferences += OnLoadingWorkspaceUserPreferences;
@@ -142,8 +146,8 @@ namespace MonoDevelop.Ide.Gui
return workbench.Close();
}
- public ReadOnlyCollection<Document> Documents {
- get { return documents.AsReadOnly (); }
+ public ImmutableList<Document> Documents {
+ get { return documents; }
}
public Document ActiveDocument {
@@ -178,7 +182,7 @@ namespace MonoDevelop.Ide.Gui
}
}
- public WorkbenchWindow RootWindow {
+ public Gtk.Window RootWindow {
get { return workbench; }
}
@@ -342,13 +346,13 @@ namespace MonoDevelop.Ide.Gui
static AlertButton PromptToSaveChanges (Document doc)
{
- return MessageService.GenericAlert (MonoDevelop.Ide.Gui.Stock.Warning,
+ return MessageService.GenericAlert (MonoDevelop.Ide.Gui.Stock.Warning,
GettextCatalog.GetString ("Save the changes to document '{0}' before creating a new solution?",
- doc.Window.ViewContent.IsUntitled
+ (object)(doc.Window.ViewContent.IsUntitled
? doc.Window.ViewContent.UntitledName
- : System.IO.Path.GetFileName (doc.FileName)),
+ : System.IO.Path.GetFileName (doc.Window.ViewContent.ContentName))),
"",
- AlertButton.Cancel, doc.Window.ViewContent.IsUntitled ? AlertButton.SaveAs : AlertButton.Save);
+ AlertButton.Cancel, doc.Window.ViewContent.IsUntitled ? AlertButton.SaveAs : AlertButton.Save);
}
public void CloseAllDocuments (bool leaveActiveDocumentOpen)
@@ -379,58 +383,58 @@ namespace MonoDevelop.Ide.Gui
return WrapPad (content);
}
- public Pad AddPad (IPadContent padContent, string id, string label, string defaultPlacement, IconId icon)
+ public Pad AddPad (PadContent padContent, string id, string label, string defaultPlacement, IconId icon)
{
return AddPad (new PadCodon (padContent, id, label, defaultPlacement, icon));
}
- public Pad AddPad (IPadContent padContent, string id, string label, string defaultPlacement, DockItemStatus defaultStatus, IconId icon)
+ public Pad AddPad (PadContent padContent, string id, string label, string defaultPlacement, DockItemStatus defaultStatus, IconId icon)
{
return AddPad (new PadCodon (padContent, id, label, defaultPlacement, defaultStatus, icon));
}
- public Pad ShowPad (IPadContent padContent, string id, string label, string defaultPlacement, IconId icon)
+ public Pad ShowPad (PadContent padContent, string id, string label, string defaultPlacement, IconId icon)
{
return ShowPad (new PadCodon (padContent, id, label, defaultPlacement, icon));
}
- public Pad ShowPad (IPadContent padContent, string id, string label, string defaultPlacement, DockItemStatus defaultStatus, IconId icon)
+ public Pad ShowPad (PadContent padContent, string id, string label, string defaultPlacement, DockItemStatus defaultStatus, IconId icon)
{
return ShowPad (new PadCodon (padContent, id, label, defaultPlacement, defaultStatus, icon));
}
[Obsolete("Use OpenDocument (FilePath fileName, Project project, bool bringToFront)")]
- public Document OpenDocument (FilePath fileName, bool bringToFront)
+ public Task<Document> OpenDocument (FilePath fileName, bool bringToFront)
{
return OpenDocument (fileName, bringToFront ? OpenDocumentOptions.Default : OpenDocumentOptions.Default & ~OpenDocumentOptions.BringToFront);
}
[Obsolete("Use OpenDocument (FilePath fileName, Project project, OpenDocumentOptions options = OpenDocumentOptions.Default)")]
- public Document OpenDocument (FilePath fileName, OpenDocumentOptions options = OpenDocumentOptions.Default)
+ public Task<Document> OpenDocument (FilePath fileName, OpenDocumentOptions options = OpenDocumentOptions.Default)
{
return OpenDocument (fileName, -1, -1, options, null, null);
}
[Obsolete("Use OpenDocument (FilePath fileName, Project project, Encoding encoding, OpenDocumentOptions options = OpenDocumentOptions.Default)")]
- public Document OpenDocument (FilePath fileName, Encoding encoding, OpenDocumentOptions options = OpenDocumentOptions.Default)
+ public Task<Document> OpenDocument (FilePath fileName, Encoding encoding, OpenDocumentOptions options = OpenDocumentOptions.Default)
{
return OpenDocument (fileName, -1, -1, options, encoding, null);
}
[Obsolete("Use OpenDocument (FilePath fileName, Project project, int line, int column, OpenDocumentOptions options = OpenDocumentOptions.Default)")]
- public Document OpenDocument (FilePath fileName, int line, int column, OpenDocumentOptions options = OpenDocumentOptions.Default)
+ public Task<Document> OpenDocument (FilePath fileName, int line, int column, OpenDocumentOptions options = OpenDocumentOptions.Default)
{
return OpenDocument (fileName, line, column, options, null, null);
}
[Obsolete("Use OpenDocument (FilePath fileName, Project project, int line, int column, Encoding encoding, OpenDocumentOptions options = OpenDocumentOptions.Default)")]
- public Document OpenDocument (FilePath fileName, int line, int column, Encoding encoding, OpenDocumentOptions options = OpenDocumentOptions.Default)
+ public Task<Document> OpenDocument (FilePath fileName, int line, int column, Encoding encoding, OpenDocumentOptions options = OpenDocumentOptions.Default)
{
return OpenDocument (fileName, line, column, options, encoding, null);
}
[Obsolete("Use OpenDocument (FilePath fileName, Project project, int line, int column, OpenDocumentOptions options, Encoding encoding, IViewDisplayBinding binding)")]
- internal Document OpenDocument (FilePath fileName, int line, int column, OpenDocumentOptions options, Encoding encoding, IViewDisplayBinding binding)
+ internal Task<Document> OpenDocument (FilePath fileName, int line, int column, OpenDocumentOptions options, Encoding encoding, IViewDisplayBinding binding)
{
var openFileInfo = new FileOpenInformation (fileName, null) {
Options = options,
@@ -443,32 +447,32 @@ namespace MonoDevelop.Ide.Gui
}
- public Document OpenDocument (FilePath fileName, Project project, bool bringToFront)
+ public Task<Document> OpenDocument (FilePath fileName, Project project, bool bringToFront)
{
return OpenDocument (fileName, project, bringToFront ? OpenDocumentOptions.Default : OpenDocumentOptions.Default & ~OpenDocumentOptions.BringToFront);
}
- public Document OpenDocument (FilePath fileName, Project project, OpenDocumentOptions options = OpenDocumentOptions.Default)
+ public Task<Document> OpenDocument (FilePath fileName, Project project, OpenDocumentOptions options = OpenDocumentOptions.Default)
{
return OpenDocument (fileName, project, -1, -1, options, null, null);
}
- public Document OpenDocument (FilePath fileName, Project project, Encoding encoding, OpenDocumentOptions options = OpenDocumentOptions.Default)
+ public Task<Document> OpenDocument (FilePath fileName, Project project, Encoding encoding, OpenDocumentOptions options = OpenDocumentOptions.Default)
{
return OpenDocument (fileName, project, -1, -1, options, encoding, null);
}
- public Document OpenDocument (FilePath fileName, Project project, int line, int column, OpenDocumentOptions options = OpenDocumentOptions.Default)
+ public Task<Document> OpenDocument (FilePath fileName, Project project, int line, int column, OpenDocumentOptions options = OpenDocumentOptions.Default)
{
return OpenDocument (fileName, project, line, column, options, null, null);
}
- public Document OpenDocument (FilePath fileName, Project project, int line, int column, Encoding encoding, OpenDocumentOptions options = OpenDocumentOptions.Default)
+ public Task<Document> OpenDocument (FilePath fileName, Project project, int line, int column, Encoding encoding, OpenDocumentOptions options = OpenDocumentOptions.Default)
{
return OpenDocument (fileName, project, line, column, options, encoding, null);
}
- internal Document OpenDocument (FilePath fileName, Project project, int line, int column, OpenDocumentOptions options, Encoding encoding, IViewDisplayBinding binding)
+ internal Task<Document> OpenDocument (FilePath fileName, Project project, int line, int column, OpenDocumentOptions options, Encoding encoding, IViewDisplayBinding binding)
{
var openFileInfo = new FileOpenInformation (fileName, project) {
Options = options,
@@ -480,7 +484,24 @@ namespace MonoDevelop.Ide.Gui
return OpenDocument (openFileInfo);
}
- internal Document OpenDocument (FilePath fileName, Project project, int line, int column, OpenDocumentOptions options, Encoding Encoding, IViewDisplayBinding binding, DockNotebook dockNotebook)
+ static void ScrollToRequestedCaretLocation (Document doc, FileOpenInformation info)
+ {
+ var ipos = doc.Editor;
+ if ((info.Line >= 1 || info.Offset >= 0) && ipos != null) {
+ doc.DisableAutoScroll ();
+ doc.RunWhenLoaded (() => {
+ var loc = new DocumentLocation (info.Line, info.Column >= 1 ? info.Column : 1);
+ if (info.Offset >= 0) {
+ loc = ipos.OffsetToLocation (info.Offset);
+ }
+ if (loc.IsEmpty)
+ return;
+ ipos.SetCaretLocation (loc, info.Options.HasFlag (OpenDocumentOptions.HighlightCaretLine), info.Options.HasFlag (OpenDocumentOptions.CenterCaretLine));
+ });
+ }
+ }
+
+ internal Task<Document> OpenDocument (FilePath fileName, Project project, int line, int column, OpenDocumentOptions options, Encoding Encoding, IViewDisplayBinding binding, DockNotebook dockNotebook)
{
var openFileInfo = new FileOpenInformation (fileName, project) {
Options = options,
@@ -494,8 +515,7 @@ namespace MonoDevelop.Ide.Gui
return OpenDocument (openFileInfo);
}
-
- public Document OpenDocument (FileOpenInformation info)
+ public async Task<Document> OpenDocument (FileOpenInformation info)
{
if (string.IsNullOrEmpty (info.FileName))
return null;
@@ -505,7 +525,7 @@ namespace MonoDevelop.Ide.Gui
if (info.Options.HasFlag (OpenDocumentOptions.TryToReuseViewer)) {
Counters.OpenDocumentTimer.Trace ("Look for open document");
foreach (Document doc in Documents) {
- IBaseViewContent vcFound = null;
+ BaseViewContent vcFound = null;
//search all ViewContents to see if they can "re-use" this filename
if (doc.Window.ViewContent.CanReuseView (info.FileName))
@@ -520,18 +540,7 @@ namespace MonoDevelop.Ide.Gui
doc.SetProject (info.Project);
}
- IEditableTextBuffer ipos = (IEditableTextBuffer) vcFound.GetContent (typeof(IEditableTextBuffer));
- if (info.Line >= 1 && ipos != null) {
- doc.DisableAutoScroll ();
- doc.RunWhenLoaded (() =>
- ipos.SetCaretTo (
- info.Line,
- info.Column >= 1 ? info.Column : 1,
- info.Options.HasFlag (OpenDocumentOptions.HighlightCaretLine),
- info.Options.HasFlag (OpenDocumentOptions.CenterCaretLine)
- )
- );
- }
+ ScrollToRequestedCaretLocation (doc, info);
if (info.Options.HasFlag (OpenDocumentOptions.BringToFront)) {
doc.Select ();
@@ -543,7 +552,7 @@ namespace MonoDevelop.Ide.Gui
}
}
Counters.OpenDocumentTimer.Trace ("Initializing monitor");
- IProgressMonitor pm = ProgressMonitors.GetStatusProgressMonitor (
+ ProgressMonitor pm = ProgressMonitors.GetStatusProgressMonitor (
GettextCatalog.GetString ("Opening {0}", info.Project != null ?
info.FileName.ToRelative (info.Project.ParentSolution.BaseDirectory) :
info.FileName),
@@ -551,12 +560,15 @@ namespace MonoDevelop.Ide.Gui
true
);
- RealOpenFile (pm, info);
+ await RealOpenFile (pm, info);
pm.Dispose ();
if (info.NewContent != null) {
Counters.OpenDocumentTimer.Trace ("Wrapping document");
Document doc = WrapDocument (info.NewContent.WorkbenchWindow);
+
+ ScrollToRequestedCaretLocation (doc, info);
+
if (doc != null && info.Options.HasFlag (OpenDocumentOptions.BringToFront)) {
doc.RunWhenLoaded (() => {
if (doc.Window != null)
@@ -569,7 +581,7 @@ namespace MonoDevelop.Ide.Gui
}
}
- IViewContent BatchOpenDocument (IProgressMonitor monitor, FilePath fileName, Project project, int line, int column, DockNotebook dockNotebook)
+ async Task<ViewContent> BatchOpenDocument (ProgressMonitor monitor, FilePath fileName, Project project, int line, int column, DockNotebook dockNotebook)
{
if (string.IsNullOrEmpty (fileName))
return null;
@@ -582,13 +594,13 @@ namespace MonoDevelop.Ide.Gui
DockNotebook = dockNotebook
};
- RealOpenFile (monitor, openFileInfo);
+ await RealOpenFile (monitor, openFileInfo);
return openFileInfo.NewContent;
}
}
- public Document OpenDocument (IViewContent content, bool bringToFront)
+ public Document OpenDocument (ViewContent content, bool bringToFront)
{
workbench.ShowView (content, bringToFront);
if (bringToFront)
@@ -616,7 +628,7 @@ namespace MonoDevelop.Ide.Gui
if (binding == null)
throw new ApplicationException("Can't create display binding for mime type: " + mimeType);
- IViewContent newContent = binding.CreateContent (null, mimeType, null);
+ ViewContent newContent = binding.CreateContent (defaultName, mimeType, null);
using (content) {
newContent.LoadNew (content, mimeType);
}
@@ -627,9 +639,8 @@ namespace MonoDevelop.Ide.Gui
newContent.UntitledName = defaultName;
newContent.IsDirty = true;
- workbench.ShowView (newContent, true);
- DisplayBindingService.AttachSubWindows (newContent.WorkbenchWindow, binding);
-
+ workbench.ShowView (newContent, true, binding);
+
var document = WrapDocument (newContent.WorkbenchWindow);
document.StartReparseThread ();
return document;
@@ -644,7 +655,7 @@ namespace MonoDevelop.Ide.Gui
"MonoDevelop.TextEditor.Document.Document.DefaultDocumentAggregatorProperties",
new Properties()));
- public void ShowGlobalPreferencesDialog (Gtk.Window parentWindow, string panelId, Action<OptionsDialog> configurationAction = null)
+ public void ShowGlobalPreferencesDialog (Window parentWindow, string panelId, Action<OptionsDialog> configurationAction = null)
{
if (parentWindow == null)
parentWindow = IdeApp.Workbench.RootWindow;
@@ -673,12 +684,12 @@ namespace MonoDevelop.Ide.Gui
}
}
- public void ShowDefaultPoliciesDialog (Gtk.Window parentWindow)
+ public void ShowDefaultPoliciesDialog (Window parentWindow)
{
ShowDefaultPoliciesDialog (parentWindow, null);
}
- public void ShowDefaultPoliciesDialog (Gtk.Window parentWindow, string panelId)
+ public void ShowDefaultPoliciesDialog (Window parentWindow, string panelId)
{
if (parentWindow == null)
parentWindow = IdeApp.Workbench.RootWindow;
@@ -766,7 +777,7 @@ namespace MonoDevelop.Ide.Gui
doc = new Document (window);
window.Closing += OnWindowClosing;
window.Closed += OnWindowClosed;
- documents.Add (doc);
+ documents = documents.Add (doc);
doc.OnDocumentAttached ();
OnDocumentOpened (new DocumentEventArgs (doc));
@@ -790,26 +801,27 @@ namespace MonoDevelop.Ide.Gui
return pad;
}
- void OnWindowClosing (object sender, WorkbenchWindowEventArgs args)
+ async void OnWindowClosing (object sender, WorkbenchWindowEventArgs args)
{
- IWorkbenchWindow window = (IWorkbenchWindow) sender;
- if (!args.Forced && window.ViewContent != null && window.ViewContent.IsDirty) {
+ var window = (IWorkbenchWindow) sender;
+ var viewContent = window.ViewContent;
+ if (!args.Forced && viewContent != null && viewContent.IsDirty) {
AlertButton result = MessageService.GenericAlert (Stock.Warning,
GettextCatalog.GetString ("Save the changes to document '{0}' before closing?",
- window.ViewContent.IsUntitled
- ? window.ViewContent.UntitledName
- : System.IO.Path.GetFileName (window.ViewContent.ContentName)),
- GettextCatalog.GetString ("If you don't save, all changes will be permanently lost."),
- AlertButton.CloseWithoutSave, AlertButton.Cancel, window.ViewContent.IsUntitled ? AlertButton.SaveAs : AlertButton.Save);
+ viewContent.IsUntitled
+ ? viewContent.UntitledName
+ : System.IO.Path.GetFileName (viewContent.ContentName)),
+ GettextCatalog.GetString ("If you don't save, all changes will be permanently lost."),
+ AlertButton.CloseWithoutSave, AlertButton.Cancel, viewContent.IsUntitled ? AlertButton.SaveAs : AlertButton.Save);
if (result == AlertButton.Save || result == AlertButton.SaveAs) {
- FindDocument (window).Save ();
- args.Cancel = window.ViewContent.IsDirty;
+ await FindDocument (window).Save ();
+ args.Cancel = viewContent.IsDirty;
if (args.Cancel)
FindDocument (window).Select ();
} else {
args.Cancel |= result != AlertButton.CloseWithoutSave;
if (!args.Cancel)
- window.ViewContent.DiscardChanges ();
+ viewContent.DiscardChanges ();
}
}
OnDocumentClosing (FindDocument (window));
@@ -821,7 +833,7 @@ namespace MonoDevelop.Ide.Gui
var doc = FindDocument (window);
window.Closing -= OnWindowClosing;
window.Closed -= OnWindowClosed;
- documents.Remove (doc);
+ documents = documents.Remove (doc);
OnDocumentClosed (doc);
doc.DisposeDocument ();
}
@@ -838,22 +850,22 @@ namespace MonoDevelop.Ide.Gui
project = IdeApp.ProjectOperations.CurrentSelectedProject;
}
if (project == null && IdeApp.ProjectOperations.CurrentSelectedWorkspaceItem != null) {
- project = IdeApp.ProjectOperations.CurrentSelectedWorkspaceItem.GetProjectContainingFile (fileName);
+ project = IdeApp.ProjectOperations.CurrentSelectedWorkspaceItem.GetProjectsContainingFile (fileName).FirstOrDefault ();
if (project == null) {
WorkspaceItem it = IdeApp.ProjectOperations.CurrentSelectedWorkspaceItem.ParentWorkspace;
while (it != null && project == null) {
- project = it.GetProjectContainingFile (fileName);
+ project = it.GetProjectsContainingFile (fileName).FirstOrDefault ();
it = it.ParentWorkspace;
}
}
}
if (project == null) {
- project = IdeApp.Workspace.GetProjectContainingFile (fileName);
+ project = IdeApp.Workspace.GetProjectsContainingFile (fileName).FirstOrDefault ();
}
return project;
}
- void RealOpenFile (IProgressMonitor monitor, FileOpenInformation openFileInfo)
+ async Task<bool> RealOpenFile (ProgressMonitor monitor, FileOpenInformation openFileInfo)
{
FilePath fileName;
@@ -863,7 +875,7 @@ namespace MonoDevelop.Ide.Gui
if (origName == null) {
monitor.ReportError (GettextCatalog.GetString ("Invalid file name"), null);
- return;
+ return false;
}
fileName = openFileInfo.FileName;
@@ -873,7 +885,7 @@ namespace MonoDevelop.Ide.Gui
//Debug.Assert(FileService.IsValidPath(fileName));
if (FileService.IsDirectory (fileName)) {
monitor.ReportError (GettextCatalog.GetString ("{0} is a directory", fileName), null);
- return;
+ return false;
}
// test, if file fileName exists
@@ -884,14 +896,14 @@ namespace MonoDevelop.Ide.Gui
if (doc.Window.ViewContent.IsUntitled && doc.Window.ViewContent.UntitledName == origName) {
doc.Select ();
openFileInfo.NewContent = doc.Window.ViewContent;
- return;
+ return true;
}
}
}
if (!File.Exists (fileName)) {
monitor.ReportError (GettextCatalog.GetString ("File not found: {0}", fileName), null);
- return;
+ return false;
}
}
@@ -924,7 +936,7 @@ namespace MonoDevelop.Ide.Gui
if (binding != null) {
if (viewBinding != null) {
var fw = new LoadFileWrapper (monitor, workbench, viewBinding, project, openFileInfo);
- fw.Invoke (fileName);
+ await fw.Invoke (fileName);
} else {
var extBinding = (IExternalDisplayBinding)binding;
var app = extBinding.GetApplication (fileName, null, project);
@@ -940,11 +952,14 @@ namespace MonoDevelop.Ide.Gui
} catch (Exception ex) {
LoggingService.LogError ("Error opening file: " + fileName, ex);
MessageService.ShowError (GettextCatalog.GetString ("File '{0}' could not be opened", fileName));
+ return false;
}
}
} catch (Exception ex) {
monitor.ReportError ("", ex);
+ return false;
}
+ return true;
}
void OnStoringWorkspaceUserPreferences (object s, UserPreferencesEventArgs args)
@@ -1020,13 +1035,13 @@ namespace MonoDevelop.Ide.Gui
var dp = new DocumentUserPrefs ();
dp.FileName = FileService.AbsoluteToRelativePath (args.Item.BaseDirectory, document.FileName);
if (document.Editor != null) {
- dp.Line = document.Editor.Caret.Line;
- dp.Column = document.Editor.Caret.Column;
+ dp.Line = document.Editor.CaretLine;
+ dp.Column = document.Editor.CaretColumn;
}
return dp;
}
- void OnLoadingWorkspaceUserPreferences (object s, UserPreferencesEventArgs args)
+ async Task OnLoadingWorkspaceUserPreferences (object s, UserPreferencesEventArgs args)
{
WorkbenchUserPrefs prefs = args.Properties.GetValue<WorkbenchUserPrefs> ("MonoDevelop.Ide.Workbench");
if (prefs == null)
@@ -1036,21 +1051,21 @@ namespace MonoDevelop.Ide.Gui
IdeApp.Workbench.LockActiveWindowChangeEvent ();
NavigationHistoryService.LogActiveDocument ();
- List<Tuple<IViewContent,string>> docViews = new List<Tuple<IViewContent,string>> ();
+ List<Tuple<ViewContent,string>> docViews = new List<Tuple<ViewContent,string>> ();
FilePath baseDir = args.Item.BaseDirectory;
var floatingWindows = new List<DockWindow> ();
- using (IProgressMonitor pm = ProgressMonitors.GetStatusProgressMonitor (GettextCatalog.GetString ("Loading workspace documents"), Stock.StatusSolutionOperation, true)) {
+ using (ProgressMonitor pm = ProgressMonitors.GetStatusProgressMonitor (GettextCatalog.GetString ("Loading workspace documents"), Stock.StatusSolutionOperation, true)) {
var docList = prefs.Files.Distinct (new DocumentUserPrefsFilenameComparer ()).OrderBy (d => d.NotebookId).ToList ();
- OpenDocumentsInContainer (pm, baseDir, docViews, docList, workbench.TabControl.Container);
+ await OpenDocumentsInContainer (pm, baseDir, docViews, docList, workbench.TabControl.Container);
foreach (var fw in prefs.FloatingWindows) {
var dockWindow = new DockWindow ();
dockWindow.Move (fw.X, fw.Y);
dockWindow.Resize (fw.Width, fw.Height);
docList = fw.Files.Distinct (new DocumentUserPrefsFilenameComparer ()).OrderBy (d => d.NotebookId).ToList ();
- OpenDocumentsInContainer (pm, baseDir, docViews, docList, dockWindow.Container);
+ await OpenDocumentsInContainer (pm, baseDir, docViews, docList, dockWindow.Container);
floatingWindows.Add (dockWindow);
}
@@ -1094,7 +1109,7 @@ namespace MonoDevelop.Ide.Gui
}
}
- void OpenDocumentsInContainer (IProgressMonitor pm, FilePath baseDir, List<Tuple<IViewContent,string>> docViews, List<DocumentUserPrefs> list, DockNotebookContainer container)
+ async Task<bool> OpenDocumentsInContainer (ProgressMonitor pm, FilePath baseDir, List<Tuple<ViewContent,string>> docViews, List<DocumentUserPrefs> list, DockNotebookContainer container)
{
int currentNotebook = -1;
DockNotebook nb = container.GetFirstNotebook ();
@@ -1108,14 +1123,15 @@ namespace MonoDevelop.Ide.Gui
currentNotebook = doc.NotebookId;
}
// TODO: Get the correct project.
- var view = IdeApp.Workbench.BatchOpenDocument (pm, fileName, null, doc.Line, doc.Column, nb);
+ var view = await IdeApp.Workbench.BatchOpenDocument (pm, fileName, null, doc.Line, doc.Column, nb);
if (view != null) {
- var t = new Tuple<IViewContent,string> (view, fileName);
+ var t = new Tuple<ViewContent,string> (view, fileName);
docViews.Add (t);
}
}
}
+ return true;
}
internal Document FindDocument (IWorkbenchWindow window)
@@ -1126,7 +1142,7 @@ namespace MonoDevelop.Ide.Gui
return null;
}
- internal Pad FindPad (IPadContent padContent)
+ internal Pad FindPad (PadContent padContent)
{
foreach (Pad pad in Pads)
if (pad.Content == padContent)
@@ -1141,20 +1157,13 @@ namespace MonoDevelop.Ide.Gui
internal void ReorderDocuments (int oldPlacement, int newPlacement)
{
- IViewContent content = workbench.InternalViewContentCollection[oldPlacement];
+ ViewContent content = workbench.InternalViewContentCollection[oldPlacement];
workbench.InternalViewContentCollection.RemoveAt (oldPlacement);
workbench.InternalViewContentCollection.Insert (newPlacement, content);
Document doc = documents [oldPlacement];
- documents.RemoveAt (oldPlacement);
- documents.Insert (newPlacement, doc);
+ documents = documents.RemoveAt (oldPlacement).Insert (newPlacement, doc);
}
-
- internal void ResetToolbars ()
- {
- workbench.ResetToolbars ();
- }
-
internal void LockActiveWindowChangeEvent ()
{
@@ -1180,6 +1189,8 @@ namespace MonoDevelop.Ide.Gui
ThreadPool.QueueUserWorkItem (delegate {
// t = DateTime.Now;
lock (fileStatusLock) {
+ if (fileStatus == null)
+ return;
foreach (FilePath file in files) {
try {
DateTime ft = File.GetLastWriteTimeUtc (file);
@@ -1202,6 +1213,7 @@ namespace MonoDevelop.Ide.Gui
ThreadPool.QueueUserWorkItem (delegate {
lock (fileStatusLock) {
// DateTime t = DateTime.Now;
+
if (fileStatus == null)
return;
List<FilePath> modified = new List<FilePath> (fileStatus.Count);
@@ -1254,9 +1266,7 @@ namespace MonoDevelop.Ide.Gui
void OnDocumentOpened (DocumentEventArgs e)
{
try {
- EventHandler<DocumentEventArgs> handler = this.DocumentOpened;
- if (handler != null)
- handler (this, e);
+ DocumentOpened?.Invoke (this, e);
} catch (Exception ex) {
LoggingService.LogError ("Exception while opening documents", ex);
}
@@ -1266,9 +1276,7 @@ namespace MonoDevelop.Ide.Gui
{
try {
var e = new DocumentEventArgs (doc);
- EventHandler<DocumentEventArgs> handler = this.DocumentClosed;
- if (handler != null)
- handler (this, e);
+ DocumentClosed?.Invoke (this, e);
} catch (Exception ex) {
LoggingService.LogError ("Exception while closing documents", ex);
}
@@ -1278,9 +1286,7 @@ namespace MonoDevelop.Ide.Gui
{
try {
var e = new DocumentEventArgs (doc);
- EventHandler<DocumentEventArgs> handler = this.DocumentClosing;
- if (handler != null)
- handler (this, e);
+ DocumentClosing?.Invoke (this, e);
} catch (Exception ex) {
LoggingService.LogError ("Exception before closing documents", ex);
}
@@ -1297,8 +1303,60 @@ namespace MonoDevelop.Ide.Gui
doc.ReparseDocument ();
}
}
- }
+ System.Timers.Timer tabsChangedTimer = null;
+
+ void DisposeTimerAndSave (object o, EventArgs e)
+ {
+ Runtime.RunInMainThread (() => {
+ tabsChangedTimer.Stop ();
+ tabsChangedTimer.Elapsed -= DisposeTimerAndSave;
+ tabsChangedTimer.Dispose ();
+ tabsChangedTimer = null;
+
+ IdeApp.Workspace.SavePreferences ();
+ });
+ }
+
+ void WorkbenchTabsChanged (object sender, EventArgs ev)
+ {
+ if (tabsChangedTimer != null) {
+ // Timer already started, and we want to allow it to complete
+ // so it can't be interrupted by triggering WorkbenchTabsChanged
+ // every few seconds.
+ return;
+ }
+
+ tabsChangedTimer = new System.Timers.Timer (10000);
+ tabsChangedTimer.AutoReset = false;
+ tabsChangedTimer.Elapsed += DisposeTimerAndSave;
+ tabsChangedTimer.Start ();
+ }
+ }
+
+ public class FileSaveInformation
+ {
+ FilePath fileName;
+ public FilePath FileName {
+ get {
+ return fileName;
+ }
+ set {
+ fileName = value.CanonicalPath;
+ if (fileName.IsNullOrEmpty)
+ LoggingService.LogError ("FileName == null\n" + Environment.StackTrace);
+ }
+ }
+
+ public Encoding Encoding { get; set; }
+
+ public FileSaveInformation (FilePath fileName, Encoding encoding = null)
+ {
+ this.FileName = fileName;
+ this.Encoding = encoding;
+ }
+ }
+
public class FileOpenInformation
{
FilePath fileName;
@@ -1314,12 +1372,28 @@ namespace MonoDevelop.Ide.Gui
}
public OpenDocumentOptions Options { get; set; }
+
+ int offset = -1;
+ public int Offset {
+ get {
+ return offset;
+ }
+ set {
+ offset = value;
+ }
+ }
public int Line { get; set; }
public int Column { get; set; }
public IViewDisplayBinding DisplayBinding { get; set; }
- public IViewContent NewContent { get; set; }
+ public ViewContent NewContent { get; set; }
public Encoding Encoding { get; set; }
public Project Project { get; set; }
+
+ /// <summary>
+ /// Is true when the file is already open and reload is requested.
+ /// </summary>
+ public bool IsReloadOperation { get; set; }
+
internal DockNotebook DockNotebook { get; set; }
[Obsolete("Use FileOpenInformation (FilePath filePath, Project project, int line, int column, OpenDocumentOptions options)")]
@@ -1332,7 +1406,7 @@ namespace MonoDevelop.Ide.Gui
}
- public FileOpenInformation (FilePath filePath, Project project)
+ public FileOpenInformation (FilePath filePath, Project project = null)
{
this.FileName = filePath;
this.Project = project;
@@ -1359,6 +1433,36 @@ namespace MonoDevelop.Ide.Gui
this.Options &= ~OpenDocumentOptions.BringToFront;
}
}
+
+ static FilePath ResolveSymbolicLink (FilePath fileName)
+ {
+ if (fileName.IsEmpty)
+ return fileName;
+ try {
+ var alreadyVisted = new HashSet<FilePath> ();
+ while (true) {
+ if (alreadyVisted.Contains (fileName)) {
+ LoggingService.LogError ("Cyclic links detected: " + fileName);
+ return FilePath.Empty;
+ }
+ alreadyVisted.Add (fileName);
+ var linkInfo = new Mono.Unix.UnixSymbolicLinkInfo (fileName);
+ if (linkInfo.IsSymbolicLink && linkInfo.HasContents) {
+ FilePath contentsPath = linkInfo.ContentsPath;
+ if (contentsPath.IsAbsolute) {
+ fileName = linkInfo.ContentsPath;
+ } else {
+ fileName = fileName.ParentDirectory.Combine (contentsPath);
+ }
+ fileName = fileName.CanonicalPath;
+ continue;
+ }
+ return ResolveSymbolicLink (fileName.ParentDirectory).Combine (fileName.FileName).CanonicalPath;
+ }
+ } catch (Exception) {
+ return fileName;
+ }
+ }
}
class LoadFileWrapper
@@ -1367,10 +1471,10 @@ namespace MonoDevelop.Ide.Gui
Project project;
FileOpenInformation fileInfo;
DefaultWorkbench workbench;
- IProgressMonitor monitor;
- IViewContent newContent;
+ ProgressMonitor monitor;
+ ViewContent newContent;
- public LoadFileWrapper (IProgressMonitor monitor, DefaultWorkbench workbench, IViewDisplayBinding binding, FileOpenInformation fileInfo)
+ public LoadFileWrapper (ProgressMonitor monitor, DefaultWorkbench workbench, IViewDisplayBinding binding, FileOpenInformation fileInfo)
{
this.monitor = monitor;
this.workbench = workbench;
@@ -1378,13 +1482,13 @@ namespace MonoDevelop.Ide.Gui
this.binding = binding;
}
- public LoadFileWrapper (IProgressMonitor monitor, DefaultWorkbench workbench, IViewDisplayBinding binding, Project project, FileOpenInformation fileInfo)
+ public LoadFileWrapper (ProgressMonitor monitor, DefaultWorkbench workbench, IViewDisplayBinding binding, Project project, FileOpenInformation fileInfo)
: this (monitor, workbench, binding, fileInfo)
{
this.project = project;
}
- public void Invoke (string fileName)
+ public async Task<bool> Invoke (string fileName)
{
try {
Counters.OpenDocumentTimer.Trace ("Creating content");
@@ -1396,7 +1500,7 @@ namespace MonoDevelop.Ide.Gui
}
if (newContent == null) {
monitor.ReportError (GettextCatalog.GetString ("The file '{0}' could not be opened.", fileName), null);
- return;
+ return false;
}
if (project != null)
@@ -1404,51 +1508,52 @@ namespace MonoDevelop.Ide.Gui
Counters.OpenDocumentTimer.Trace ("Loading file");
- IEncodedTextContent etc = (IEncodedTextContent) newContent.GetContent (typeof(IEncodedTextContent));
try {
- if (fileInfo.Encoding != null && etc != null)
- etc.Load (fileName, fileInfo.Encoding);
- else
- newContent.Load (fileName);
+ await newContent.Load (fileInfo);
} catch (InvalidEncodingException iex) {
monitor.ReportError (GettextCatalog.GetString ("The file '{0}' could not opened. {1}", fileName, iex.Message), null);
- return;
+ return false;
} catch (OverflowException) {
monitor.ReportError (GettextCatalog.GetString ("The file '{0}' could not opened. File too large.", fileName), null);
- return;
+ return false;
}
} catch (Exception ex) {
monitor.ReportError (GettextCatalog.GetString ("The file '{0}' could not be opened.", fileName), ex);
- return;
+ return false;
}
// content got re-used
if (newContent.WorkbenchWindow != null) {
newContent.WorkbenchWindow.SelectWindow ();
fileInfo.NewContent = newContent;
- return;
+ return true;
}
Counters.OpenDocumentTimer.Trace ("Showing view");
- workbench.ShowView (newContent, fileInfo.Options.HasFlag (OpenDocumentOptions.BringToFront), fileInfo.DockNotebook);
+ workbench.ShowView (newContent, fileInfo.Options.HasFlag (OpenDocumentOptions.BringToFront), binding, fileInfo.DockNotebook);
- DisplayBindingService.AttachSubWindows (newContent.WorkbenchWindow, binding);
newContent.WorkbenchWindow.DocumentType = binding.Name;
- IEditableTextBuffer ipos = (IEditableTextBuffer) newContent.GetContent (typeof(IEditableTextBuffer));
+
+ var ipos = (TextEditor) newContent.GetContent (typeof(TextEditor));
if (fileInfo.Line > 0 && ipos != null) {
- Mono.TextEditor.Utils.FileSettingsStore.Remove (fileName);
+ FileSettingsStore.Remove (fileName);
ipos.RunWhenLoaded (JumpToLine);
}
fileInfo.NewContent = newContent;
+ return true;
}
void JumpToLine ()
{
- IEditableTextBuffer ipos = (IEditableTextBuffer) newContent.GetContent (typeof(IEditableTextBuffer));
- ipos.SetCaretTo (Math.Max(1, fileInfo.Line), Math.Max(1, fileInfo.Column), fileInfo.Options.HasFlag (OpenDocumentOptions.HighlightCaretLine));
+ var ipos = (TextEditor) newContent.GetContent (typeof(TextEditor));
+ var loc = new DocumentLocation (Math.Max(1, fileInfo.Line), Math.Max(1, fileInfo.Column));
+ if (fileInfo.Offset >= 0) {
+ loc = ipos.OffsetToLocation (fileInfo.Offset);
+ }
+ ipos.SetCaretLocation (loc, fileInfo.Options.HasFlag (OpenDocumentOptions.HighlightCaretLine));
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchMemento.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchMemento.cs
index 8203e8ef94..d70c432c54 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchMemento.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchMemento.cs
@@ -34,7 +34,6 @@ using System.Xml;
using MonoDevelop.Core;
using MonoDevelop.Core.Serialization;
-using MonoDevelop.Components.DockToolbars;
namespace MonoDevelop.Ide.Gui
{
@@ -88,15 +87,6 @@ namespace MonoDevelop.Ide.Gui
}
}
- public DockToolbarFrameStatus ToolbarStatus {
- get {
- return properties.Get ("toolbarStatus", new DockToolbarFrameStatus ());
- }
- set {
- properties.Set ("toolbarStatus", value);
- }
- }
-
/// <summary>
/// Creates a new instance of the <code>MdiWorkspaceMemento</code>.
/// </summary>
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchWindow.cs
index 92ed672f84..92309d38ba 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/WorkbenchWindow.cs
@@ -26,16 +26,17 @@
using System;
using System.Collections.Generic;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Gui
{
- public class WorkbenchWindow: Gtk.Window
+ class WorkbenchWindow: Gtk.Window
{
List<TopLevelChild> topLevels = new List<TopLevelChild> ();
public WorkbenchWindow (): base (Gtk.WindowType.Toplevel)
{
- Mono.TextEditor.GtkWorkarounds.FixContainerLeak (this);
+ GtkWorkarounds.FixContainerLeak (this);
this.Role = "workbench";
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/DocumentNavigationPoint.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/DocumentNavigationPoint.cs
index d0f82bfe1e..37939b918b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/DocumentNavigationPoint.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/DocumentNavigationPoint.cs
@@ -28,6 +28,7 @@
//
using System;
+using System.Threading.Tasks;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
@@ -77,12 +78,12 @@ namespace MonoDevelop.Ide.Navigation
get { return doc != null? doc.FileName : fileName; }
}
- public override Document ShowDocument ()
+ public override Task<Document> ShowDocument ()
{
return DoShow ();
}
- protected virtual Document DoShow ()
+ protected virtual async Task<Document> DoShow ()
{
if (doc != null) {
doc.Select ();
@@ -95,7 +96,7 @@ namespace MonoDevelop.Ide.Navigation
break;
}
}
- return IdeApp.Workbench.OpenDocument (new FileOpenInformation (fileName, p, true));
+ return await IdeApp.Workbench.OpenDocument (new FileOpenInformation (fileName, p, true));
}
public override string DisplayName {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs
index c8ff32acb6..be001978cb 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs
@@ -159,7 +159,7 @@ namespace MonoDevelop.Ide.Navigation
return point;
}
- IEditableTextBuffer editBuf = doc.GetContent<IEditableTextBuffer> ();
+ var editBuf = doc.Editor;
if (editBuf != null) {
point = new TextFileNavigationPoint (doc, editBuf);
if (point != null)
@@ -224,10 +224,10 @@ namespace MonoDevelop.Ide.Navigation
get { return closedHistory.Count != 0; }
}
- public static void OpenLastClosedDocument () {
+ public static async void OpenLastClosedDocument () {
if (HasClosedDocuments) {
var tuple = closedHistory.Pop ();
- var doc = tuple.Item1.ShowDocument ();
+ var doc = await tuple.Item1.ShowDocument ();
IdeApp.Workbench.ReorderTab (IdeApp.Workbench.Documents.IndexOf (doc), tuple.Item2);
}
}
@@ -291,8 +291,8 @@ namespace MonoDevelop.Ide.Navigation
currentDoc.Closed += HandleCurrentDocClosed;
if (currentDoc.Editor != null) {
- currentDoc.Editor.Document.TextReplaced += BufferTextChanged;
- currentDoc.Editor.Caret.PositionChanged += BufferCaretPositionChanged;
+ currentDoc.Editor.TextChanged += BufferTextChanged;
+ currentDoc.Editor.CaretPositionChanged += BufferCaretPositionChanged;
}
}
@@ -308,8 +308,8 @@ namespace MonoDevelop.Ide.Navigation
currentDoc.Closed -= HandleCurrentDocClosed;
if (currentDoc.Editor != null) {
- currentDoc.Editor.Document.TextReplaced -= BufferTextChanged;
- currentDoc.Editor.Caret.PositionChanged -= BufferCaretPositionChanged;
+ currentDoc.Editor.TextChanged -= BufferTextChanged;
+ currentDoc.Editor.CaretPositionChanged -= BufferCaretPositionChanged;
}
currentDoc = null;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationPoint.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationPoint.cs
index 7455083ace..a45eb04d53 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationPoint.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationPoint.cs
@@ -26,6 +26,7 @@
// THE SOFTWARE.
using System;
+using System.Threading.Tasks;
using MonoDevelop.Ide.Gui;
namespace MonoDevelop.Ide.Navigation
@@ -35,9 +36,9 @@ namespace MonoDevelop.Ide.Navigation
public abstract string DisplayName { get; }
//public abstract string Tooltip { get; }
- public virtual Document ShowDocument ()
+ public virtual Task<Document> ShowDocument ()
{
- return null;
+ return Task.FromResult<Document> (null);
}
// used for fuzzy matching to decide whether to replace an existing nav point
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/TextFileNavigationPoint.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/TextFileNavigationPoint.cs
index 82087312c9..9fc346329d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/TextFileNavigationPoint.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/TextFileNavigationPoint.cs
@@ -31,6 +31,8 @@ using System;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide.Editor;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Navigation
{
@@ -39,10 +41,12 @@ namespace MonoDevelop.Ide.Navigation
int line;
int column;
- public TextFileNavigationPoint (Document doc, IEditableTextBuffer buffer)
+ public TextFileNavigationPoint (Document doc, TextEditor buffer)
: base (doc)
{
- buffer.GetLineColumnFromPosition (buffer.CursorPosition, out line, out column);
+ var location = buffer.CaretLocation;
+ line = location.Line;
+ column = location.Column;
}
public TextFileNavigationPoint (FilePath file, int line, int column)
@@ -75,15 +79,15 @@ namespace MonoDevelop.Ide.Navigation
}
}
- protected override Document DoShow ()
+ protected override async Task<Document> DoShow ()
{
- Document doc = base.DoShow ();
+ Document doc = await base.DoShow ();
if (doc != null) {
- IEditableTextBuffer buf = doc.GetContent<IEditableTextBuffer> ();
+ var buf = doc.Editor;
if (buf != null) {
doc.DisableAutoScroll ();
buf.RunWhenLoaded (() => {
- buf.SetCaretTo (Math.Max (line, 1), Math.Max (column, 1));
+ buf.SetCaretLocation (Math.Max (line, 1), Math.Max (column, 1));
});
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ProgressMonitoring/BaseProgressMonitor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ProgressMonitoring/BaseProgressMonitor.cs
index c29bd59b59..2adbab10a8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ProgressMonitoring/BaseProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ProgressMonitoring/BaseProgressMonitor.cs
@@ -38,313 +38,23 @@ using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.Ide.ProgressMonitoring
{
- public class BaseProgressMonitor: GuiSyncObject, IProgressMonitor, IAsyncOperation
+ public static class ProgressHelper
{
- class MbrWrapper {
- public ManualResetEvent waitEvent;
-
- //workaround for "** ERROR **: file icall.c: line 2419 (ves_icall_InternalExecute): assertion failed" bug when
- //handling the CancelRequested event
- public event MonitorHandler cancelRequestedEvent;
-
- public void RaiseEvent (IProgressMonitor monitor) {
- if (cancelRequestedEvent != null)
- cancelRequestedEvent (monitor);
- }
- }
-
- MbrWrapper c = new MbrWrapper ();
- ProgressTracker progressTracker;
- LogTextWriter logger;
- bool canceled;
- bool runningPendingEvents;
-
- event OperationHandler completedEvent;
-
- StringCollection errorsMessages = new StringCollection ();
- StringCollection successMessages = new StringCollection ();
- StringCollection warningMessages = new StringCollection ();
- Exception errorException;
-
- public BaseProgressMonitor ()
- {
- progressTracker = new ProgressTracker ();
- logger = new LogTextWriter ();
- logger.TextWritten += new LogTextEventHandler (WriteLogInternal);
- }
-
- [FreeDispatch]
- public object SyncRoot {
- [FreeDispatch]
- get {
- // Dont return 'this'. Locking on proxies doesn't look like a good idea.
- return progressTracker;
- }
- }
-
- [AsyncDispatch]
- public virtual void BeginTask (string name, int totalWork)
- {
- progressTracker.BeginTask (name, totalWork);
- OnProgressChanged ();
- }
-
- [AsyncDispatch]
- public virtual void BeginStepTask (string name, int totalWork, int stepSize)
- {
- progressTracker.BeginStepTask (name, totalWork, stepSize);
- OnProgressChanged ();
- }
-
- [AsyncDispatch]
- public virtual void EndTask ()
- {
- progressTracker.EndTask ();
- }
-
- [AsyncDispatch]
- public virtual void Step (int work)
- {
- progressTracker.Step (work);
- OnProgressChanged ();
- }
-
- public TextWriter Log {
- [FreeDispatch]
- get {
- return logger;
- }
- }
-
- [FreeDispatch]
- public virtual void ReportSuccess (string message)
- {
- successMessages.Add (message);
- }
-
- [FreeDispatch]
- public virtual void ReportWarning (string message)
- {
- warningMessages.Add (message);
- }
-
- [FreeDispatch]
- public virtual void ReportError (string message, Exception ex)
- {
- if (message == null && ex != null) {
- var userEx = ex as UserException;
- if (userEx != null)
- message = string.Format ("{0}{1}{1}{2}", userEx.Message, Environment.NewLine, userEx.Details);
- else
- message = ex.Message;
- } else if (message != null && ex != null) {
- if (!message.EndsWith (".")) message += ".";
- message += " " + ex.Message;
- }
-
- errorsMessages.Add (message);
- if (ex != null) {
- LoggingService.LogError (ex.ToString ());
- errorException = ex;
- }
- }
-
- [FreeDispatch]
- public virtual bool IsCancelRequested {
- [FreeDispatch]
- get { return canceled; }
- }
-
- [AsyncDispatch]
- public virtual void Dispose()
- {
- DispatchService.RunPendingEvents ();
-
- lock (progressTracker) {
- progressTracker.Done ();
- if (c.waitEvent != null)
- c.waitEvent.Set ();
- }
- try {
- OnCompleted ();
- } catch (Exception ex) {
- string msg = "Unhandled exception in monitor cancel event handler";
- LoggingService.LogInternalError (msg, ex);
- }
- }
-
- [FreeDispatch]
- public IAsyncOperation AsyncOperation
- {
- [FreeDispatch]
- get { return this; }
- }
-
- [FreeDispatch]
- void IAsyncOperation.Cancel ()
- {
- OnCancelRequested ();
- }
-
- [FreeDispatch]
- void IAsyncOperation.WaitForCompleted ()
- {
- if (IsCompleted) return;
-
- if (DispatchService.IsGuiThread) {
- while (!IsCompleted) {
- DispatchService.RunPendingEvents ();
- Thread.Sleep (100);
- }
- } else {
- lock (progressTracker) {
- if (!progressTracker.InProgress) return;
- if (c.waitEvent == null)
- c.waitEvent = new ManualResetEvent (false);
- }
- c.waitEvent.WaitOne ();
- }
- }
-
- [FreeDispatch]
- bool IAsyncOperation.Success {
- [FreeDispatch]
- get { return errorsMessages.Count == 0; }
- }
-
- [FreeDispatch]
- bool IAsyncOperation.SuccessWithWarnings {
- [FreeDispatch]
- get { return errorsMessages.Count == 0 && warningMessages.Count > 0; }
- }
-
- public bool IsCompleted {
- [FreeDispatch]
- get { return !progressTracker.InProgress; }
- }
-
- public event OperationHandler Completed {
- add {
- bool alreadyCompleted = false;
- lock (progressTracker) {
- completedEvent += value;
- alreadyCompleted = !progressTracker.InProgress;
- }
- if (alreadyCompleted) value (this);
- }
- remove {
- lock (progressTracker) {
- completedEvent -= value;
- }
- }
- }
-
- public event MonitorHandler CancelRequested {
- [FreeDispatch]
- add {
- bool alreadyCanceled = false;
- lock (progressTracker) {
- c.cancelRequestedEvent += value;
- alreadyCanceled = canceled;
- }
- if (alreadyCanceled) value (this);
- }
- [FreeDispatch]
- remove {
- lock (progressTracker) {
- c.cancelRequestedEvent -= value;
- }
- }
- }
-
- public Exception ErrorException {
- get { return errorException; }
- }
-
- public StringCollection Errors {
- get { return errorsMessages; }
- }
-
- public StringCollection SuccessMessages {
- get { return successMessages; }
- }
-
- public StringCollection Warnings {
- get { return warningMessages; }
- }
-
- protected string CurrentTask {
- get { return progressTracker.CurrentTask; }
- }
-
- protected double CurrentTaskWork {
- get { return progressTracker.CurrentTaskWork; }
- }
-
- protected double GlobalWork {
- get { return progressTracker.GlobalWork; }
- }
-
- protected bool UnknownWork {
- get { return progressTracker.UnknownWork; }
- }
-
- protected virtual void OnCompleted ()
- {
- if (completedEvent != null)
- completedEvent (AsyncOperation);
- }
-
- protected virtual void OnCancelRequested ()
- {
- lock (progressTracker) {
- canceled = true;
- }
-
- c.RaiseEvent(this);
- }
-
- [AsyncDispatch]
- void WriteLogInternal (string text)
- {
- OnWriteLog (text);
- }
-
- protected virtual void OnWriteLog (string text)
- {
- }
-
- protected virtual void OnProgressChanged ()
- {
- }
-
- protected void RunPendingEvents ()
- {
- if (!runningPendingEvents) {
- try {
- runningPendingEvents = true;
- DispatchService.RunPendingEvents ();
- } finally {
- runningPendingEvents = false;
- }
- }
- }
-
- protected void ShowResultDialog ()
+ public static void ShowResultDialog (this ProgressMonitor monitor)
{
- if (Errors.Count == 1 && Warnings.Count == 0) {
- MessageService.ShowError (Errors[0], ErrorException);
+ if (monitor.Errors.Length == 1 && !monitor.HasWarnings) {
+ MessageService.ShowError (monitor.Errors [0].Message, monitor.Errors [0].Exception);
}
- else if (Errors.Count == 0 && Warnings.Count == 1) {
- MessageService.ShowWarning (Warnings[0]);
+ else if (!monitor.HasErrors && monitor.Warnings.Length == 1) {
+ MessageService.ShowWarning (monitor.Warnings[0]);
}
- else if (Errors.Count > 0 || Warnings.Count > 0) {
+ else if (monitor.HasErrors || monitor.HasWarnings) {
using (var resultDialog = new MultiMessageDialog () {
Modal = true,
}) {
- foreach (string m in Errors)
- resultDialog.AddError (m);
- foreach (string m in Warnings)
+ foreach (var m in monitor.Errors)
+ resultDialog.AddError (m.Message);
+ foreach (var m in monitor.Warnings)
resultDialog.AddWarning (m);
MessageService.ShowCustomDialog (resultDialog);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ProgressMonitoring/MessageDialogProgressMonitor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ProgressMonitoring/MessageDialogProgressMonitor.cs
index 8a5304d435..9c0d1bf7a5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ProgressMonitoring/MessageDialogProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ProgressMonitoring/MessageDialogProgressMonitor.cs
@@ -34,7 +34,7 @@ namespace MonoDevelop.Ide.ProgressMonitoring
{
// Progress monitor that reports errors and warnings in message dialogs.
- public class MessageDialogProgressMonitor: BaseProgressMonitor
+ public class MessageDialogProgressMonitor: ProgressMonitor
{
ProgressDialog dialog;
bool hideWhenDone;
@@ -57,94 +57,80 @@ namespace MonoDevelop.Ide.ProgressMonitoring
{
}
- public MessageDialogProgressMonitor (bool showProgress, bool allowCancel, bool showDetails, bool hideWhenDone)
+ public MessageDialogProgressMonitor (bool showProgress, bool allowCancel, bool showDetails, bool hideWhenDone): base (Runtime.MainSynchronizationContext)
{
if (showProgress) {
dialog = new ProgressDialog (MessageService.RootWindow, allowCancel, showDetails);
dialog.Message = "";
MessageService.PlaceDialog (dialog, MessageService.RootWindow);
dialog.Show ();
- dialog.AsyncOperation = AsyncOperation;
- dialog.OperationCancelled += delegate {
- OnCancelRequested ();
- };
- RunPendingEvents ();
+ dialog.CancellationTokenSource = CancellationTokenSource;
+ DispatchService.RunPendingEvents ();
this.hideWhenDone = hideWhenDone;
this.showDetails = showDetails;
}
}
-
+
protected override void OnWriteLog (string text)
{
if (dialog != null) {
dialog.WriteText (text);
- RunPendingEvents ();
+ DispatchService.RunPendingEvents ();
}
}
protected override void OnProgressChanged ()
{
if (dialog != null) {
- dialog.Message = CurrentTask;
- dialog.Progress = GlobalWork;
- RunPendingEvents ();
- }
- }
-
- public override void BeginTask (string name, int totalWork)
- {
- if (dialog != null) {
- dialog.BeginTask (name);
+ dialog.Message = CurrentTaskName;
+ dialog.Progress = Progress;
}
- base.BeginTask (name, totalWork);
}
- public override void BeginStepTask (string name, int totalWork, int stepSize)
+ protected override void OnBeginTask (string name, int totalWork, int stepWork)
{
if (dialog != null) {
dialog.BeginTask (name);
}
- base.BeginStepTask (name, totalWork, stepSize);
}
-
- public override void EndTask ()
+
+ protected override void OnEndTask (string name, int totalWork, int stepWork)
{
if (dialog != null) {
dialog.EndTask ();
}
- base.EndTask ();
- RunPendingEvents ();
+ base.OnEndTask (name, totalWork, stepWork);
+ DispatchService.RunPendingEvents ();
}
-
- public override void ReportWarning (string message)
+
+ protected override void OnWarningReported (string message)
{
- base.ReportWarning (message);
if (dialog != null) {
dialog.WriteText (GettextCatalog.GetString ("WARNING: ") + message + "\n");
- RunPendingEvents ();
+ DispatchService.RunPendingEvents ();
}
+ base.OnWarningReported (message);
}
-
- public override void ReportError (string message, Exception ex)
+
+ protected override void OnErrorReported (string message, Exception exception)
{
- base.ReportError (message, ex);
-
if (dialog != null) {
- dialog.WriteText (GettextCatalog.GetString ("ERROR: ") + Errors [Errors.Count - 1] + "\n");
- RunPendingEvents ();
+ dialog.WriteText (GettextCatalog.GetString ("ERROR: ") + Errors [Errors.Length - 1] + "\n");
+ DispatchService.RunPendingEvents ();
}
+ base.OnErrorReported (message, exception);
}
-
+
protected override void OnCompleted ()
{
- DispatchService.GuiDispatch (new MessageHandler (ShowDialogs));
+ Runtime.RunInMainThread ((Action) ShowDialogs);
base.OnCompleted ();
}
void ShowDialogs ()
{
if (dialog != null) {
- dialog.ShowDone (Warnings.Count > 0, Errors.Count > 0);
+ dialog.ShowDone (Warnings.Length > 0, Errors.Length > 0);
if (hideWhenDone)
dialog.Destroy ();
}
@@ -152,7 +138,7 @@ namespace MonoDevelop.Ide.ProgressMonitoring
if (showDetails)
return;
- ShowResultDialog ();
+ this.ShowResultDialog ();
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ProgressMonitoring/MultiTaskDialogProgressMonitor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ProgressMonitoring/MultiTaskDialogProgressMonitor.cs
index 7e9aaed621..79f23cb525 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ProgressMonitoring/MultiTaskDialogProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ProgressMonitoring/MultiTaskDialogProgressMonitor.cs
@@ -34,12 +34,13 @@ using MonoDevelop.Core;
using MonoDevelop.Core.ProgressMonitoring;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Ide.Gui;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.ProgressMonitoring
{
- public class MultiTaskDialogProgressMonitor : BaseProgressMonitor
+ public class MultiTaskDialogProgressMonitor : ProgressMonitor
{
StringCollection errorsMessages = new StringCollection ();
StringCollection warningMessages = new StringCollection ();
@@ -64,7 +65,7 @@ namespace MonoDevelop.Ide.ProgressMonitoring
{
}
- public MultiTaskDialogProgressMonitor (bool showProgress, bool allowCancel, bool showDetails, IDictionary<string, string> taskLabelAliases)
+ public MultiTaskDialogProgressMonitor (bool showProgress, bool allowCancel, bool showDetails, IDictionary<string, string> taskLabelAliases): base (Runtime.MainSynchronizationContext)
{
if (showProgress) {
var parent = MessageService.GetDefaultModalParent ();
@@ -74,8 +75,8 @@ namespace MonoDevelop.Ide.ProgressMonitoring
TransientFor = parent,
};
MessageService.PlaceDialog (dialog, parent);
- Mono.TextEditor.GtkWorkarounds.PresentWindowWithNotification (dialog);
- dialog.AsyncOperation = AsyncOperation;
+ GtkWorkarounds.PresentWindowWithNotification (dialog);
+ dialog.CancellationTokenSource = CancellationTokenSource;
DispatchService.RunPendingEvents ();
this.showDetails = showDetails;
}
@@ -106,46 +107,38 @@ namespace MonoDevelop.Ide.ProgressMonitoring
protected override void OnProgressChanged ()
{
if (dialog != null) {
- dialog.SetProgress (CurrentTaskWork);
- DispatchService.RunPendingEvents ();
- }
- }
-
- public override void BeginTask (string name, int totalWork)
- {
- if (dialog != null) {
- dialog.BeginTask (name);
+ dialog.SetProgress (Progress);
}
- base.BeginTask (name, totalWork);
}
- public override void BeginStepTask (string name, int totalWork, int stepSize)
+ protected override void OnBeginTask (string name, int totalWork, int stepWork)
{
if (dialog != null) {
dialog.BeginTask (name);
}
- base.BeginStepTask (name, totalWork, stepSize);
+ base.OnBeginTask (name, totalWork, stepWork);
}
-
- public override void EndTask ()
+
+ protected override void OnEndTask (string name, int totalWork, int stepWork)
{
if (dialog != null) {
dialog.EndTask ();
}
- base.EndTask ();
DispatchService.RunPendingEvents ();
+ base.OnEndTask (name, totalWork, stepWork);
}
-
- public override void ReportWarning (string message)
+
+ protected override void OnWarningReported (string message)
{
if (dialog != null) {
dialog.WriteText (GettextCatalog.GetString ("WARNING: ") + message + "\n");
DispatchService.RunPendingEvents ();
}
warningMessages.Add (message);
+ base.OnWarningReported (message);
}
-
- public override void ReportError (string message, Exception ex)
+
+ protected override void OnErrorReported (string message, Exception ex)
{
if (message == null && ex != null)
message = ex.Message;
@@ -153,22 +146,23 @@ namespace MonoDevelop.Ide.ProgressMonitoring
if (!message.EndsWith (".")) message += ".";
message += " " + ex.Message;
}
-
+
errorsMessages.Add (message);
if (ex != null) {
LoggingService.LogError (ex.ToString ());
errorException = ex;
}
-
+
if (dialog != null) {
dialog.WriteText (GettextCatalog.GetString ("ERROR: ") + message + "\n");
DispatchService.RunPendingEvents ();
}
+ base.OnErrorReported (message, ex);
}
protected override void OnCompleted ()
{
- DispatchService.GuiDispatch (new MessageHandler (ShowDialogs));
+ Runtime.RunInMainThread ((Action) ShowDialogs);
base.OnCompleted ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ProgressMonitoring/ProgressBarMonitor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ProgressMonitoring/ProgressBarMonitor.cs
deleted file mode 100644
index 81a3602f34..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.ProgressMonitoring/ProgressBarMonitor.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// ProgressBarMonitor.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Linq;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.Ide.ProgressMonitoring
-{
- [System.ComponentModel.ToolboxItem(true)]
- public partial class ProgressBarMonitor : Gtk.Bin
- {
- public ProgressBarMonitor ()
- {
- this.Build ();
- }
-
- public bool AllowCancel {
- get { return buttonCancel.Visible; }
- set { buttonCancel.Visible = value; }
- }
-
- public bool ShowErrorsDialog { get; set; }
-
- public IProgressMonitor CreateProgressMonitor ()
- {
- return new InternalProgressBarMonitor (this);
- }
-
- class InternalProgressBarMonitor: BaseProgressMonitor
- {
- ProgressBarMonitor widget;
-
- public InternalProgressBarMonitor (ProgressBarMonitor widget)
- {
- this.widget = widget;
- widget.buttonCancel.Clicked += OnCancelClicked;
- }
-
- void OnCancelClicked (object sender, EventArgs e)
- {
- AsyncOperation.Cancel ();
- }
-
- protected override void OnProgressChanged ()
- {
- widget.progressBar.Fraction = GlobalWork;
- RunPendingEvents ();
- }
-
- protected override void OnCompleted ()
- {
- base.OnCompleted ();
- if (!AsyncOperation.Success && widget.ShowErrorsDialog) {
- string err = string.Join ("\n", Errors.Cast<string> ().ToArray ());
- MessageService.ShowError (GettextCatalog.GetString ("Add-in installation failed"), err);
- }
- }
-
- public override void Dispose ()
- {
- widget.buttonCancel.Clicked -= OnCancelClicked;
- base.Dispose ();
- }
- }
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/BaseDirectoryPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/BaseDirectoryPanel.cs
index 09d95ab8a5..8da492a529 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/BaseDirectoryPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/BaseDirectoryPanel.cs
@@ -26,6 +26,7 @@
//
using System;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
@@ -35,7 +36,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
public class BaseDirectoryPanel: IOptionsPanel
{
BaseDirectoryPanelWidget widget;
- IWorkspaceObject obj;
+ WorkspaceObject obj;
public BaseDirectoryPanel()
{
@@ -43,10 +44,10 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
public void Initialize (OptionsDialog dialog, object dataObject)
{
- obj = dataObject as IWorkspaceObject;
+ obj = dataObject as WorkspaceObject;
}
- public Gtk.Widget CreatePanelWidget ()
+ public Control CreatePanelWidget ()
{
widget = new BaseDirectoryPanelWidget ();
widget.BaseDirectory = System.IO.Path.GetFullPath (obj.BaseDirectory);
@@ -69,7 +70,10 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
public void ApplyChanges ()
{
- obj.BaseDirectory = widget.BaseDirectory;
+ if (obj is WorkspaceItem)
+ ((WorkspaceItem)obj).BaseDirectory = widget.BaseDirectory;
+ else if (obj is SolutionFolderItem)
+ ((SolutionFolderItem)obj).BaseDirectory = widget.BaseDirectory;
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/BaseDirectoryPanelWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/BaseDirectoryPanelWidget.cs
index e0d65e589f..520fc66781 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/BaseDirectoryPanelWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/BaseDirectoryPanelWidget.cs
@@ -33,7 +33,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
[System.ComponentModel.Category("MonoDevelop.Projects.Gui")]
[System.ComponentModel.ToolboxItem(true)]
- public partial class BaseDirectoryPanelWidget : Gtk.Bin
+ partial class BaseDirectoryPanelWidget : Gtk.Bin
{
public BaseDirectoryPanelWidget()
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeAnalysisPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeAnalysisPanel.cs
index c461eb2a81..d8c2ad6c9a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeAnalysisPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeAnalysisPanel.cs
@@ -26,13 +26,14 @@
using System;
using System.Collections.Generic;
using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
using MonoDevelop.Core;
namespace MonoDevelop.Ide.Projects.OptionPanels
{
- public class CodeAnalysisPanel : MultiConfigItemOptionsPanel
+ class CodeAnalysisPanel : MultiConfigItemOptionsPanel
{
CodeAnalysisPanelWidget widget;
@@ -46,7 +47,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
return ConfiguredProject is DotNetProject;
}
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return (widget = new CodeAnalysisPanelWidget ());
}
@@ -89,10 +90,11 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
enabledCheckBox = new CheckButton ();
enabledCheckBox.Label = GettextCatalog.GetString ("Enable Code Analysis on Build");
- this.enabledCheckBox.CanFocus = true;
- this.enabledCheckBox.DrawIndicator = true;
- this.enabledCheckBox.UseUnderline = true;
- this.PackStart (enabledCheckBox);
+ enabledCheckBox.CanFocus = true;
+ enabledCheckBox.DrawIndicator = true;
+ enabledCheckBox.UseUnderline = true;
+ enabledCheckBox.Toggled += (s, e) => enabledCheckBox.Inconsistent = false;
+ PackStart (enabledCheckBox);
ShowAll ();
}
@@ -116,7 +118,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
enabled = null;
foreach (DotNetProjectConfiguration conf in configs) {
- var runCodeAnalysisEnabled = conf.ExtendedProperties.Contains ("RunCodeAnalysis") ? (bool)conf.ExtendedProperties ["RunCodeAnalysis"] : false;
+ var runCodeAnalysisEnabled = conf.Properties.HasProperty ("RunCodeAnalysis") ? conf.Properties.GetValue<bool> ("RunCodeAnalysis") : false;
if (!enabled.HasValue) {
enabled = runCodeAnalysisEnabled;
} else if (enabled.Value != runCodeAnalysisEnabled) {
@@ -139,7 +141,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
//If Inconsistent, don't do anything
if (!enabledCheckBox.Inconsistent) {
foreach (DotNetProjectConfiguration conf in configurations) {
- conf.ExtendedProperties ["RunCodeAnalysis"] = enabledCheckBox.Active;
+ conf.Properties.SetValue ("RunCodeAnalysis", enabledCheckBox.Active ? "true" : "false", "false");
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeFormattingPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeFormattingPanel.cs
index 6e0f3cb6f6..ec3ebd79dc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeFormattingPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CodeFormattingPanel.cs
@@ -59,7 +59,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
provider = PolicyService.GetUserDefaultPolicySet ();
policyContainer = provider.Policies;
- if (!(dataObject is SolutionItem) && !(dataObject is Solution)) {
+ if (!(dataObject is SolutionFolderItem) && !(dataObject is Solution)) {
globalMimeTypes = new List<string> ();
string userTypes = PropertyService.Get<string> ("MonoDevelop.Projects.GlobalPolicyMimeTypes", "");
globalMimeTypes.AddRange (userTypes.Split (new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries));
@@ -186,7 +186,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
data.UseParentPolicy = useParentPolicy;
}
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new CodeFormattingPanelWidget (this, ParentDialog);
}
@@ -214,8 +214,8 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
HashSet<string> types = new HashSet<string> ();
if (DataObject is Solution)
GetItemMimeTypes (types, ((Solution)DataObject).RootFolder);
- else if (DataObject is SolutionItem)
- GetItemMimeTypes (types, (SolutionItem)DataObject);
+ else if (DataObject is SolutionFolderItem)
+ GetItemMimeTypes (types, (SolutionFolderItem)DataObject);
else {
types.Add ("application/xml");
foreach (MimeTypeOptionsPanelNode node in AddinManager.GetExtensionNodes ("/MonoDevelop/ProjectModel/Gui/MimeTypePolicyPanels")) {
@@ -232,10 +232,10 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
return globalMimeTypes != null && globalMimeTypes.Contains (type);
}
- void GetItemMimeTypes (HashSet<string> types, SolutionItem item)
+ void GetItemMimeTypes (HashSet<string> types, SolutionFolderItem item)
{
if (item is SolutionFolder) {
- foreach (SolutionItem it in ((SolutionFolder)item).Items)
+ foreach (SolutionFolderItem it in ((SolutionFolder)item).Items)
GetItemMimeTypes (types, it);
}
else if (item is Project) {
@@ -423,5 +423,11 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
}
buttonRemove.Sensitive = buttonEdit.Sensitive = false;
}
+
+ public override void Destroy ()
+ {
+ store.Clear ();
+ base.Destroy ();
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineBuildOptions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineBuildOptions.cs
index 9814002d5a..9cf84eca7b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineBuildOptions.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineBuildOptions.cs
@@ -24,6 +24,7 @@
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
@@ -33,7 +34,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
CombineBuildOptionsWidget widget;
- public override Gtk.Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
return widget = new CombineBuildOptionsWidget (ConfiguredSolution);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineConfigurationPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineConfigurationPanel.cs
index 3a6e6709bb..646ba7b6be 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineConfigurationPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineConfigurationPanel.cs
@@ -41,7 +41,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
CombineConfigurationPanelWidget widget;
- public override Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
return widget = new CombineConfigurationPanelWidget ((MultiConfigItemOptionsDialog) ParentDialog, ConfiguredSolution);
}
@@ -75,7 +75,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
this.parentDialog = parentDialog;
this.solution = solution;
- store = new ListStore (typeof(string), typeof(bool), typeof(SolutionEntityItem));
+ store = new ListStore (typeof(string), typeof(bool), typeof(SolutionItem));
configsList.Model = store;
configsList.HeadersVisible = true;
@@ -104,7 +104,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
configuration = config;
store.Clear ();
- foreach (var it in solution.GetAllSolutionItems ().OfType<SolutionEntityItem> ().Where (s => s.SupportsBuild ())) {
+ foreach (var it in solution.GetAllSolutionItems ().OfType<SolutionItem> ().Where (s => s.SupportsBuild ())) {
var ce = config.GetEntryForItem (it);
store.AppendValues (it.Name, ce != null && ce.Build, it);
}
@@ -112,7 +112,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
void OnSetConfigurationsData (Gtk.TreeViewColumn treeColumn, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
{
- var item = (SolutionEntityItem) store.GetValue (iter, ProjectCol);
+ var item = (SolutionItem) store.GetValue (iter, ProjectCol);
ConfigurationData data = parentDialog.ConfigurationData.FindConfigurationData (item);
CellRendererComboBox comboCell = (CellRendererComboBox) cell;
@@ -126,7 +126,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
comboCell.Markup = escaped;
}
- string GetSelectedConfiguration (SolutionEntityItem item)
+ string GetSelectedConfiguration (SolutionItem item)
{
var entry = configuration.GetEntryForItem (item);
return entry != null ? entry.ItemConfiguration : (item.DefaultConfiguration != null ? item.DefaultConfiguration.Id : "");
@@ -136,7 +136,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
TreeIter iter;
if (store.GetIter (out iter, new TreePath (args.Path))) {
- var item = (SolutionEntityItem) store.GetValue (iter, ProjectCol);
+ var item = (SolutionItem) store.GetValue (iter, ProjectCol);
var entry = configuration.GetEntryForItem (item);
if (entry == null) {
entry = CreateDefaultMapping (item);
@@ -147,7 +147,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
}
}
- SolutionConfigurationEntry CreateDefaultMapping (SolutionEntityItem item)
+ SolutionConfigurationEntry CreateDefaultMapping (SolutionItem item)
{
var conf = GetSelectedConfiguration (item);
var entry = configuration.AddItem (item);
@@ -159,7 +159,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
TreeIter iter;
if (store.GetIter (out iter, new TreePath (args.Path))) {
- var item = (SolutionEntityItem) store.GetValue (iter, ProjectCol);
+ var item = (SolutionItem) store.GetValue (iter, ProjectCol);
var entry = configuration.GetEntryForItem (item);
if (entry == null) {
entry = CreateDefaultMapping (item);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineInformationPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineInformationPanel.cs
index 190e1740f2..766f937ea7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineInformationPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineInformationPanel.cs
@@ -41,7 +41,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
CombineInformationWidget widget;
- public override Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
return widget = new CombineInformationWidget (ConfiguredSolution);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineMSBuildOptions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineMSBuildOptions.cs
index 00ddb8d815..f07659dd82 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineMSBuildOptions.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CombineMSBuildOptions.cs
@@ -25,7 +25,7 @@
// THE SOFTWARE.
using System;
using MonoDevelop.Ide.Gui.Dialogs;
-using MonoDevelop.Projects.Formats.MSBuild;
+using MonoDevelop.Projects.MSBuild;
using MonoDevelop.Core;
using MonoDevelop.Components;
@@ -35,7 +35,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
Xwt.CheckBox checkMSBuild;
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
bool byDefault, require;
MSBuildProjectService.CheckHandlerUsesMSBuildEngine (ConfiguredProject, out byDefault, out require);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CommonAssemblySigningPreferences.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CommonAssemblySigningPreferences.cs
index fa7b64f949..c0a509bfc6 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CommonAssemblySigningPreferences.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CommonAssemblySigningPreferences.cs
@@ -28,6 +28,7 @@
using System;
using System.Collections.Generic;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
using MonoDevelop.Core;
@@ -121,7 +122,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
}
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
AllowMixedConfigurations = true;
return (widget = new CommonAssemblySigningPreferences ());
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandPanel.cs
index 36b031897f..dbe81867ec 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandPanel.cs
@@ -28,6 +28,7 @@
using System;
using System.Collections.Generic;
+using MonoDevelop.Components;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
using MonoDevelop.Core;
@@ -44,7 +45,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
this.supportedTypes = supportedTypes;
}
- public override Gtk.Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return (widget = new CustomCommandPanelWidget ());
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandPanelWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandPanelWidget.cs
index 347b6bd900..1470bf39dc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandPanelWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandPanelWidget.cs
@@ -38,7 +38,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
CustomCommandCollection commands;
CustomCommandWidget lastSlot;
- SolutionEntityItem entry;
+ SolutionItem entry;
ConfigurationSelector configSelector;
CustomCommandType[] supportedTypes;
@@ -48,7 +48,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
label3.LabelProp = MonoDevelop.Core.BrandingService.BrandApplicationName (label3.LabelProp);
}
- public void Load (SolutionEntityItem entry, CustomCommandCollection commands, ConfigurationSelector configSelector, CustomCommandType[] supportedTypes)
+ public void Load (SolutionItem entry, CustomCommandCollection commands, ConfigurationSelector configSelector, CustomCommandType[] supportedTypes)
{
this.entry = entry;
this.commands = commands;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandWidget.cs
index 139aa03ff7..5cb485755e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/CustomCommandWidget.cs
@@ -39,7 +39,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
internal partial class CustomCommandWidget : Gtk.Bin
{
CustomCommand cmd;
- IWorkspaceObject entry;
+ WorkspaceObject entry;
bool updating;
CustomCommandType[] supportedTypes;
@@ -56,7 +56,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
GettextCatalog.GetString ("Custom Command")
};
- public CustomCommandWidget (IWorkspaceObject entry, CustomCommand cmd, ConfigurationSelector configSelector, CustomCommandType[] supportedTypes)
+ public CustomCommandWidget (WorkspaceObject entry, CustomCommand cmd, ConfigurationSelector configSelector, CustomCommandType[] supportedTypes)
{
this.Build();
this.supportedTypes = supportedTypes;
@@ -77,8 +77,8 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
this.WidgetFlags |= Gtk.WidgetFlags.NoShowAll;
StringTagModelDescription tagModel;
- if (entry is SolutionItem)
- tagModel = ((SolutionItem)entry).GetStringTagModelDescription (configSelector);
+ if (entry is SolutionFolderItem)
+ tagModel = ((SolutionFolderItem)entry).GetStringTagModelDescription (configSelector);
else if (entry is WorkspaceItem)
tagModel = ((WorkspaceItem)entry).GetStringTagModelDescription ();
else
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/GeneralProjectOptions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/GeneralProjectOptions.cs
index 5176e25e51..c50c616ec6 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/GeneralProjectOptions.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/GeneralProjectOptions.cs
@@ -26,7 +26,7 @@
using System;
using MonoDevelop.Ide.Gui.Dialogs;
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Projects;
using MonoDevelop.Projects.SharedAssetsProjects;
@@ -36,7 +36,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
GeneralProjectOptionsWidget widget;
- public override Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
return widget = new GeneralProjectOptionsWidget (ConfiguredProject, ParentDialog);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/NamespaceSynchronisationPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/NamespaceSynchronisationPanel.cs
index b78bf266f7..a8e296f91d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/NamespaceSynchronisationPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/NamespaceSynchronisationPanel.cs
@@ -53,10 +53,10 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
return slnFolder.GetAllItems<DotNetProject> ().Any ();
// Global options case
- return !(item is IWorkspaceObject);
+ return !(item is WorkspaceObject);
}
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
widget = new NamespaceSynchronisationPanelWidget (this);
widget.Show ();
@@ -98,15 +98,15 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
base.ApplyChanges ();
- if (widget.ResourceNamingChanged) {
+ if (widget.ResourceNamingChanged && migrateIds) {
if (ConfiguredProject is DotNetProject) {
- ((DotNetProject)ConfiguredProject).UpdateResourceHandler (migrateIds);
+ ((DotNetProject)ConfiguredProject).MigrateResourceIds (widget.InitialResourceNaming);
} else if (DataObject is SolutionFolder) {
foreach (DotNetProject prj in ((SolutionFolder)DataObject).GetAllItems<DotNetProject> ())
- prj.UpdateResourceHandler (migrateIds);
+ prj.MigrateResourceIds (widget.InitialResourceNaming);
} else if (ConfiguredSolution != null) {
- foreach (DotNetProject prj in ConfiguredSolution.GetAllSolutionItems<DotNetProject> ())
- prj.UpdateResourceHandler (migrateIds);
+ foreach (DotNetProject prj in ConfiguredSolution.GetAllItems<DotNetProject> ())
+ prj.MigrateResourceIds (widget.InitialResourceNaming);
}
}
}
@@ -229,6 +229,10 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
: ResourceNamePolicy.FileName);
}
}
+
+ public ResourceNamePolicy InitialResourceNaming {
+ get { return initialResourceNaming; }
+ }
void UpdateNamespaceSensitivity (object sender, EventArgs args)
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/OutputOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/OutputOptionsPanel.cs
index 12e9ba637f..c25deb35ef 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/OutputOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/OutputOptionsPanel.cs
@@ -27,6 +27,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Projects;
@@ -47,7 +48,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
return ConfiguredProject is DotNetProject;
}
- public override Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
return (widget = new OutputOptionsPanelWidget ());
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/PortableRuntimeOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/PortableRuntimeOptionsPanel.cs
index fe57456fb2..2e006bad7e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/PortableRuntimeOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/PortableRuntimeOptionsPanel.cs
@@ -28,22 +28,23 @@ using System.Text;
using System.Linq;
using System.Collections.Generic;
+using MonoDevelop.Components;
using MonoDevelop.Projects;
using MonoDevelop.Core;
using MonoDevelop.Core.Assemblies;
using Gtk;
using MonoDevelop.Ide.Gui.Dialogs;
-
+
namespace MonoDevelop.Ide.Projects.OptionPanels
{
internal class PortableRuntimeOptionsPanel : ItemOptionsPanel
{
PortableRuntimeOptionsPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
- return (widget = new PortableRuntimeOptionsPanelWidget ((PortableDotNetProject) ConfiguredProject, ItemConfigurations));
+ return (widget = new PortableRuntimeOptionsPanelWidget ((DotNetProject) ConfiguredProject, ItemConfigurations));
}
public override void ApplyChanges ()
@@ -53,19 +54,19 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
}
[System.ComponentModel.ToolboxItem(true)]
- public partial class PortableRuntimeOptionsPanelWidget : Gtk.Bin
+ partial class PortableRuntimeOptionsPanelWidget : Gtk.Bin
{
readonly TargetFramework missingFramework;
readonly List<TargetFramework> targetFrameworks;
readonly SortedDictionary<string, List<SupportedFramework>> supportedFrameworks;
readonly List<OptionCombo> options;
- PortableDotNetProject project;
+ DotNetProject project;
TargetFramework target;
HBox warningHBox;
Label warning;
- Image warningImage;
- Image infoImage;
+ ImageView warningImage;
+ ImageView infoImage;
ComboBox selectorCombo;
bool disableEvents;
@@ -103,7 +104,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
}
}
- public PortableRuntimeOptionsPanelWidget (PortableDotNetProject project, IEnumerable<ItemConfiguration> configurations)
+ public PortableRuntimeOptionsPanelWidget (DotNetProject project, IEnumerable<ItemConfiguration> configurations)
{
this.target = project.TargetFramework;
this.project = project;
@@ -413,8 +414,8 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
warning.SetAlignment (0.0f, 0.5f);
warning.Show ();
- infoImage = new Image (GetType ().Assembly, "warning-16.png");
- warningImage = new Image (GetType ().Assembly, "error-16.png");
+ infoImage = new ImageView (Xwt.Drawing.Image.FromResource (GetType ().Assembly, "warning-16.png"));
+ warningImage = new ImageView (Xwt.Drawing.Image.FromResource (GetType ().Assembly, "error-16.png"));
warningHBox = new HBox (false, 6);
warningHBox.PackStart (infoImage, false, false, 0);
@@ -667,7 +668,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
if (target != null && target != project.TargetFramework) {
project.TargetFramework = target;
- IdeApp.ProjectOperations.Save (project);
+ IdeApp.ProjectOperations.SaveAsync (project);
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/RunOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/RunOptionsPanel.cs
index 67a285815a..8a79156c3b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/RunOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/RunOptionsPanel.cs
@@ -42,7 +42,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
RunOptionsPanelWidget widget;
- public override Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
return (widget = new RunOptionsPanelWidget ());
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/RuntimeOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/RuntimeOptionsPanel.cs
index 0aa2fdeb6d..b635d4de5b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/RuntimeOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/RuntimeOptionsPanel.cs
@@ -47,7 +47,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
RuntimeOptionsPanelWidget widget;
- public override Widget CreatePanelWidget()
+ public override Control CreatePanelWidget()
{
return (widget = new RuntimeOptionsPanelWidget ((DotNetProject)ConfiguredProject, ItemConfigurations));
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/SolutionItemConfigurationsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/SolutionItemConfigurationsPanel.cs
index 6ae8eb9397..20a39d965e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/SolutionItemConfigurationsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/SolutionItemConfigurationsPanel.cs
@@ -43,7 +43,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
CombineEntryConfigurationsPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
MultiConfigItemOptionsDialog dlg = (MultiConfigItemOptionsDialog) ParentDialog;
return (widget = new CombineEntryConfigurationsPanelWidget (dlg));
@@ -163,9 +163,10 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
try {
bool done = false;
do {
- if (MessageService.RunCustomDialog (dlg, Toplevel as Window) == (int) Gtk.ResponseType.Ok) {
- configData.RenameConfiguration (cc.Id, dlg.ConfigName, dlg.RenameChildren);
- store.SetValue (iter, 1, cc.Id);
+ if (MessageService.RunCustomDialog (dlg, Toplevel as Gtk.Window) == (int) Gtk.ResponseType.Ok) {
+ var newConf = configData.RenameConfiguration (cc.Id, dlg.ConfigName, dlg.RenameChildren);
+ store.SetValue (iter, 0, newConf);
+ store.SetValue (iter, 1, newConf.Id);
done = true;
} else
done = true;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/StartupOptionsPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/StartupOptionsPanel.cs
index 49c15e72d6..aa31d91c46 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/StartupOptionsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.OptionPanels/StartupOptionsPanel.cs
@@ -28,6 +28,7 @@
using System;
using System.Collections.Generic;
using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Projects;
using MonoDevelop.Core;
using MonoDevelop.Core.Execution;
@@ -41,15 +42,15 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
Solution sol;
ListStore listStore;
- List<SolutionEntityItem> startupItems;
+ List<SolutionItem> startupItems;
public StartupOptionsPanelWidget (Solution sol)
{
this.Build();
this.sol = sol;
- startupItems = new List<SolutionEntityItem> ();
- foreach (SolutionEntityItem it in sol.GetAllSolutionItems<SolutionEntityItem> ()) {
+ startupItems = new List<SolutionItem> ();
+ foreach (SolutionItem it in sol.GetAllItems<SolutionItem> ()) {
// Include in the list if it can run in any of the existing execution modes and configurations
foreach (IExecutionModeSet mset in Runtime.ProcessService.GetExecutionModes ()) {
bool matched = false;
@@ -69,7 +70,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
}
}
- listStore = new ListStore (typeof(SolutionItem), typeof(bool), typeof(string));
+ listStore = new ListStore (typeof(SolutionFolderItem), typeof(bool), typeof(string));
treeItems.Model = listStore;
CellRendererToggle crt = new CellRendererToggle ();
@@ -78,7 +79,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
if (startupItems.Count > 0) {
for (int n=0; n<startupItems.Count; n++) {
- SolutionEntityItem it = startupItems [n];
+ SolutionItem it = startupItems [n];
comboItems.AppendText (it.Name);
listStore.AppendValues (it, sol.MultiStartupItems.Contains (it), it.Name);
if (sol.StartupItem == it)
@@ -175,7 +176,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
if (listStore.GetIterFirst (out it)) {
do {
if ((bool) listStore.GetValue (it, 1))
- sol.MultiStartupItems.Add ((SolutionEntityItem) listStore.GetValue (it, 0));
+ sol.MultiStartupItems.Add ((SolutionItem) listStore.GetValue (it, 0));
} while (listStore.IterNext (ref it));
}
sol.StartupItem = null;
@@ -192,7 +193,7 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
{
StartupOptionsPanelWidget widget;
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
return widget = new StartupOptionsPanelWidget (ConfiguredSolution);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddExternalFileDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddExternalFileDialog.cs
index 111d928081..dd01c1279d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddExternalFileDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddExternalFileDialog.cs
@@ -32,6 +32,7 @@ namespace MonoDevelop.Ide.Projects
{
public AddExternalFileDialog (string file)
{
+ MonoDevelop.Components.IdeTheme.ApplyTheme (this);
HasSeparator = true;
this.Build ();
radioCopy.Active = true;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddMimeTypeDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddMimeTypeDialog.cs
index 5ea7153076..a3510252fe 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddMimeTypeDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddMimeTypeDialog.cs
@@ -84,7 +84,7 @@ namespace MonoDevelop.Ide.Projects
desc = mt;
buttonOk.Sensitive = mimeType != null;
labelDesc.Text = desc ?? string.Empty;
- image.Pixbuf = img.ToPixbuf (Gtk.IconSize.Menu);
+ image.Image = img;
}
string TryGetFileType (string name)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ApplyPolicyDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ApplyPolicyDialog.cs
index e5d8570872..876fd4dc31 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ApplyPolicyDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ApplyPolicyDialog.cs
@@ -30,6 +30,7 @@ using MonoDevelop.Ide;
using MonoDevelop.Core;
using System.Collections.Generic;
using System.Text;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Projects
{
@@ -206,7 +207,7 @@ namespace MonoDevelop.Ide.Projects
return true;
}
- using (var layout = Mono.TextEditor.PangoUtil.CreateLayout (this)) {
+ using (var layout = PangoUtil.CreateLayout (this)) {
layout.SetMarkup ("<i>" + GLib.Markup.EscapeText (message) + "</i>");
int w, h;
layout.GetPixelSize (out w, out h);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs
index 5f84923e08..a87031db12 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs
@@ -52,7 +52,6 @@ namespace MonoDevelop.Ide.Projects
StringMatcher stringMatcher;
List<AssemblyInfo> assemblies = new List<AssemblyInfo> ();
FilePath basePath;
- FilePath baseSolutionPath;
class AssemblyInfo
{
@@ -199,6 +198,11 @@ namespace MonoDevelop.Ide.Projects
this.project = configureProject;
assemblies.Clear ();
+ if (configureProject == null) {
+ Reset ();
+ return;
+ }
+
nugetDir = configureProject.ParentSolution.ItemDirectory.Combine ("packages");
foreach (var asm in selectDialog.GetRecentFileReferences (project.ParentSolution.FileName)) {
@@ -206,7 +210,7 @@ namespace MonoDevelop.Ide.Projects
assemblies.Add (new AssemblyInfo (asm));
}
- foreach (var pr in configureProject.ParentSolution.GetAllSolutionItems<DotNetProject> ().SelectMany (p => p.References).Where (r => r.ReferenceType == ReferenceType.Assembly && !string.IsNullOrEmpty (r.HintPath))) {
+ foreach (var pr in configureProject.ParentSolution.GetAllItems<DotNetProject> ().SelectMany (p => p.References).Where (r => r.ReferenceType == ReferenceType.Assembly && !string.IsNullOrEmpty (r.HintPath))) {
var file = new FilePath (pr.HintPath).CanonicalPath;
if (File.Exists (file) && !IsNuGetAssembly (file) && !assemblies.Any (a => a.File.Equals (file)))
assemblies.Add (new AssemblyInfo (pr.HintPath));
@@ -283,7 +287,7 @@ namespace MonoDevelop.Ide.Projects
{
StringBuilder result = new StringBuilder ();
int lastPos = 0;
- var color = Mono.TextEditor.HslColor.GenerateHighlightColors (widget.Style.Base (StateType.Normal),
+ var color = HslColor.GenerateHighlightColors (widget.Style.Base (StateType.Normal),
widget.Style.Text (StateType.Normal), 3)[2];
for (int n=0; n < matches.Length; n++) {
int pos = matches[n] - startIndex;
@@ -329,7 +333,7 @@ namespace MonoDevelop.Ide.Projects
void AddReference (FilePath path)
{
- selectDialog.AddReference (new ProjectReference (ReferenceType.Assembly, path));
+ selectDialog.AddReference (ProjectReference.CreateAssemblyFileReference (path));
}
void RemoveReference (FilePath path)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/CombineOptionsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/CombineOptionsDialog.cs
index 9218b96190..3d68902157 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/CombineOptionsDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/CombineOptionsDialog.cs
@@ -32,6 +32,7 @@ using System.Collections.Generic;
using System.ComponentModel;
using Mono.Addins;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Projects;
using MonoDevelop.Ide.Gui.Dialogs;
@@ -40,7 +41,7 @@ namespace MonoDevelop.Ide.Projects
{
public class CombineOptionsDialog : MultiConfigItemOptionsDialog
{
- public CombineOptionsDialog (Gtk.Window parentWindow, Solution solution) : base (parentWindow, solution)
+ public CombineOptionsDialog (Window parentWindow, Solution solution) : base (parentWindow, solution)
{
this.Title = GettextCatalog.GetString ("Solution Options") + " - " + solution.Name;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ConfirmProjectDeleteDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ConfirmProjectDeleteDialog.cs
index 83b1c22d89..b9944dc13e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ConfirmProjectDeleteDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ConfirmProjectDeleteDialog.cs
@@ -109,10 +109,10 @@ namespace MonoDevelop.Ide.Projects
}
}
- if (item is SolutionItem) {
- var sol = ((SolutionItem)item).ParentSolution;
+ if (item is SolutionFolderItem) {
+ var sol = ((SolutionFolderItem)item).ParentSolution;
var bdir = item.BaseDirectory;
- if (sol.GetItemFiles (false).Any (f => f.IsChildPathOf (bdir)) || sol.GetAllSolutionItems<SolutionEntityItem> ().Any (it => it != item && it.GetItemFiles (true).Any (f => f.IsChildPathOf (bdir)))) {
+ if (sol.GetItemFiles (false).Any (f => f.IsChildPathOf (bdir)) || sol.GetAllItems<SolutionItem> ().Any (it => it != item && it.GetItemFiles (true).Any (f => f.IsChildPathOf (bdir)))) {
radioDeleteAll.Sensitive = false;
labelProjectDir.Text = GettextCatalog.GetString ("Project directory can't be deleted since it contains files from other projects or solutions");
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs
index b14e549df5..4da5584e7a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs
@@ -53,7 +53,7 @@ namespace MonoDevelop.Ide.Projects
PolicySet currentSet;
bool loading;
- public DefaultPolicyOptionsDialog (Gtk.Window parentWindow)
+ public DefaultPolicyOptionsDialog (MonoDevelop.Components.Window parentWindow)
: base (parentWindow, new PolicySet (),
"/MonoDevelop/ProjectModel/Gui/DefaultPolicyPanels")
{
@@ -260,14 +260,14 @@ namespace MonoDevelop.Ide.Projects
try {
dlg.Title = GettextCatalog.GetString ("Apply to Project");
dlg.RootItem = IdeApp.Workspace;
- dlg.SelectedItem = IdeApp.ProjectOperations.CurrentSelectedBuildTarget;
- dlg.SelectableItemTypes = new Type[] { typeof(Solution), typeof(SolutionItem) };
+ dlg.SelectedItem = IdeApp.ProjectOperations.CurrentSelectedObject;
+ dlg.SelectableItemTypes = new Type[] { typeof(Solution), typeof(SolutionFolderItem) };
if (MessageService.RunCustomDialog (dlg, this) == (int) Gtk.ResponseType.Ok) {
((IPolicyProvider)dlg.SelectedItem).Policies.Import (currentSet, true);
if (dlg.SelectedItem is IWorkspaceFileObject)
- IdeApp.ProjectOperations.Save ((IWorkspaceFileObject)dlg.SelectedItem);
+ IdeApp.ProjectOperations.SaveAsync (dlg.SelectedItem);
else
- IdeApp.ProjectOperations.Save (((SolutionItem)dlg.SelectedItem).ParentSolution);
+ IdeApp.ProjectOperations.SaveAsync (((SolutionFolderItem)dlg.SelectedItem).ParentSolution);
}
} finally {
dlg.Destroy ();
@@ -279,7 +279,7 @@ namespace MonoDevelop.Ide.Projects
{
OpenFileDialog dlg = new OpenFileDialog (GettextCatalog.GetString ("Select Policy File"));
dlg.TransientFor = this;
- dlg.InitialFileName = currentSet.Name + ".mdpolicy";
+ dlg.InitialFileName = currentSet.Id + ".mdpolicy";
dlg.Action = MonoDevelop.Components.FileChooserAction.Save;
dlg.AddFilter (BrandingService.BrandApplicationName (GettextCatalog.GetString ("MonoDevelop policy files")), "*.mdpolicy");
dlg.AddAllFilesFilter ();
@@ -329,9 +329,10 @@ namespace MonoDevelop.Ide.Projects
void UpdateStatus ()
{
+ Gtk.Widget mainBox = MainBox;
if (sets.Count == 0) {
deleteButton.Sensitive = exportButton.Sensitive = false;
- MainBox.Sensitive = false;
+ mainBox.Sensitive = false;
((ListStore)policiesCombo.Model).Clear ();
policiesCombo.Sensitive = false;
policiesCombo.AppendText (GettextCatalog.GetString ("No Selection"));
@@ -339,7 +340,7 @@ namespace MonoDevelop.Ide.Projects
}
else {
deleteButton.Sensitive = exportButton.Sensitive = true;
- MainBox.Sensitive = true;
+ mainBox.Sensitive = true;
policiesCombo.Sensitive = true;
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ExportProjectPolicyDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ExportProjectPolicyDialog.cs
index 58df08302e..d3c485f71b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ExportProjectPolicyDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ExportProjectPolicyDialog.cs
@@ -43,8 +43,8 @@ namespace MonoDevelop.Ide.Projects
fileEntry.Action = FileChooserAction.Save;
fileEntry.DefaultPath = DefaultFileDialogPolicyDir;
- if (policyProvider is SolutionItem)
- fileEntry.Path = ((SolutionItem)policyProvider).Name + ".mdpolicy";
+ if (policyProvider is SolutionFolderItem)
+ fileEntry.Path = ((SolutionFolderItem)policyProvider).Name + ".mdpolicy";
else if (policyProvider is Solution)
fileEntry.Path = ((Solution)policyProvider).Name + ".mdpolicy";
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ExportSolutionDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ExportSolutionDialog.cs
index b3ce373bc7..3a14ecec9a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ExportSolutionDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ExportSolutionDialog.cs
@@ -30,22 +30,25 @@ using System;
using System.IO;
using MonoDevelop.Components;
using MonoDevelop.Projects;
+using MonoDevelop.Projects.MSBuild;
+using System.Linq;
namespace MonoDevelop.Ide.Projects
{
partial class ExportSolutionDialog : Gtk.Dialog
{
- FileFormat[] formats;
+ MSBuildFileFormat[] formats;
- public ExportSolutionDialog (WorkspaceItem item, FileFormat selectedFormat)
+ public ExportSolutionDialog (IMSBuildFileObject item, MSBuildFileFormat selectedFormat)
{
this.Build();
- labelNewFormat.Text = item.FileFormat.Name;
+ labelNewFormat.Text = GetFormatText (item.FileFormat);
- formats = Services.ProjectService.FileFormats.GetFileFormatsForObject (item);
- foreach (FileFormat format in formats)
- comboFormat.AppendText (format.Name);
+ formats = MSBuildFileFormat.GetSupportedFormats (item).ToArray ();
+ foreach (var format in formats) {
+ comboFormat.AppendText (GetFormatText (format));
+ }
int sel = Array.IndexOf (formats, selectedFormat);
if (sel == -1) sel = 0;
@@ -67,8 +70,15 @@ namespace MonoDevelop.Ide.Projects
folderEntry.Path = item.ItemDirectory;
UpdateControls ();
}
+
+ static string GetFormatText (MSBuildFileFormat format)
+ {
+ if (!string.IsNullOrEmpty (format.ProductDescription))
+ return string.Format ("{0} ({1})", format.Name, format.ProductDescription);
+ return format.Name;
+ }
- public FileFormat Format {
+ public MSBuildFileFormat Format {
get {
if (comboFormat == null)
return formats[0];
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/FinalProjectConfigurationPage.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/FinalProjectConfigurationPage.cs
index a535151d68..456006faa0 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/FinalProjectConfigurationPage.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/FinalProjectConfigurationPage.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System;
+using MonoDevelop.Core.StringParsing;
using MonoDevelop.Ide.Templates;
using ProjectCreateParameters = MonoDevelop.Projects.ProjectCreateParameters;
using SolutionFolder = MonoDevelop.Projects.SolutionFolder;
@@ -228,7 +229,7 @@ namespace MonoDevelop.Ide.Projects
public void UpdateFromParameters ()
{
ProjectName = Parameters ["ProjectName"];
- projectNameIsReadOnly = Parameters.GetBoolean ("IsProjectNameReadOnly", false);
+ projectNameIsReadOnly = Parameters.GetBoolValue ("IsProjectNameReadOnly", false);
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs
index 611343c253..335e237d7d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs
@@ -28,20 +28,20 @@ using Gdk;
using Gtk;
using MonoDevelop.Components;
using MonoDevelop.Core;
+using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Templates;
-using Mono.TextEditor;
namespace MonoDevelop.Ide.Projects
{
- partial class GtkNewProjectDialogBackend : Gtk.Dialog
+ partial class GtkNewProjectDialogBackend : IdeDialog
{
- Color bannerBackgroundColor = new Color (119, 130, 140);
- Color bannerLineColor = new Color (112, 122, 131);
- Color whiteColor = new Color (255, 255, 255);
- Color categoriesBackgroundColor = new Color (225, 228, 232);
- Color templateListBackgroundColor = new Color (240, 240, 240);
- Color templateBackgroundColor = new Color (255, 255, 255);
- Color templateSectionSeparatorColor = new Color (208, 208, 208);
+ Color bannerBackgroundColor = Styles.NewProjectDialog.BannerBackgroundColor.ToGdkColor ();
+ Color bannerLineColor = Styles.NewProjectDialog.BannerLineColor.ToGdkColor ();
+ Color whiteColor = Styles.NewProjectDialog.BannerForegroundColor.ToGdkColor ();
+ Color categoriesBackgroundColor = Styles.NewProjectDialog.CategoriesBackgroundColor.ToGdkColor ();
+ Color templateListBackgroundColor = Styles.NewProjectDialog.TemplateListBackgroundColor.ToGdkColor ();
+ Color templateBackgroundColor = Styles.NewProjectDialog.TemplateBackgroundColor.ToGdkColor ();
+ Color templateSectionSeparatorColor = Styles.NewProjectDialog.TemplateSectionSeparatorColor.ToGdkColor ();
VBox centreVBox;
HBox templatesHBox;
@@ -70,6 +70,32 @@ namespace MonoDevelop.Ide.Projects
GtkTemplateCellRenderer templateTextRenderer;
GtkTemplateCategoryCellRenderer categoryTextRenderer;
+ static GtkNewProjectDialogBackend ()
+ {
+ UpdateStyles ();
+ Styles.Changed += (sender, e) => UpdateStyles ();
+ }
+
+ static void UpdateStyles ()
+ {
+ var categoriesBackgroundColorHex = Styles.ColorGetHex (Styles.NewProjectDialog.CategoriesBackgroundColor);
+ var templateListBackgroundColorHex = Styles.ColorGetHex (Styles.NewProjectDialog.TemplateListBackgroundColor);
+
+ string rcstyle = "style \"templateCategoriesTreeView\"\r\n{\r\n" +
+ " base[NORMAL] = \"" + categoriesBackgroundColorHex + "\"\r\n" +
+ " GtkTreeView::even-row-color = \"" + categoriesBackgroundColorHex + "\"\r\n" +
+ "}\r\n";
+ rcstyle += "style \"templatesTreeView\"\r\n{\r\n" +
+ " base[NORMAL] = \"" + templateListBackgroundColorHex + "\"\r\n" +
+ " GtkTreeView::even-row-color = \"" + templateListBackgroundColorHex + "\"" +
+ "\r\n}";
+
+ rcstyle += "widget \"*templateCategoriesTreeView*\" style \"templateCategoriesTreeView\"\r\n";
+ rcstyle += "widget \"*templatesTreeView*\" style \"templatesTreeView\"\r\n";
+
+ Rc.ParseString (rcstyle);
+ }
+
void Build ()
{
BorderWidth = 0;
@@ -106,7 +132,7 @@ namespace MonoDevelop.Ide.Projects
topBannerLabel = new Label ();
topBannerLabel.Name = "topBannerLabel";
- Pango.FontDescription font = topBannerLabel.Style.FontDescription.Copy ();
+ Pango.FontDescription font = topBannerLabel.Style.FontDescription.Copy (); // UNDONE: VV: Use FontService?
font.Size = (int)(font.Size * 1.8);
topBannerLabel.ModifyFont (font);
topBannerLabel.ModifyFg (StateType.Normal, whiteColor);
@@ -128,10 +154,11 @@ namespace MonoDevelop.Ide.Projects
centreVBox.PackEnd (templatesHBox, true, true, 0);
// Template categories.
- var templateCategoriesVBox = new VBox ();
- templateCategoriesVBox.Name = "templateCategoriesVBox";
- templateCategoriesVBox.BorderWidth = 0;
- templateCategoriesVBox.WidthRequest = GtkWorkarounds.ConvertToPixelScale (220);
+ var templateCategoriesBgBox = new EventBox ();
+ templateCategoriesBgBox.Name = "templateCategoriesVBox";
+ templateCategoriesBgBox.BorderWidth = 0;
+ templateCategoriesBgBox.ModifyBg (StateType.Normal, categoriesBackgroundColor);
+ templateCategoriesBgBox.WidthRequest = GtkWorkarounds.ConvertToPixelScale (220);
var templateCategoriesScrolledWindow = new ScrolledWindow ();
templateCategoriesScrolledWindow.Name = "templateCategoriesScrolledWindow";
templateCategoriesScrolledWindow.HscrollbarPolicy = PolicyType.Never;
@@ -142,17 +169,17 @@ namespace MonoDevelop.Ide.Projects
templateCategoriesTreeView.BorderWidth = 0;
templateCategoriesTreeView.HeadersVisible = false;
templateCategoriesTreeView.Model = templateCategoriesListStore;
- templateCategoriesTreeView.ModifyBase (StateType.Normal, categoriesBackgroundColor);
templateCategoriesTreeView.AppendColumn (CreateTemplateCategoriesTreeViewColumn ());
templateCategoriesScrolledWindow.Add (templateCategoriesTreeView);
- templateCategoriesVBox.PackStart (templateCategoriesScrolledWindow, true, true, 0);
- templatesHBox.PackStart (templateCategoriesVBox, false, false, 0);
+ templateCategoriesBgBox.Add (templateCategoriesScrolledWindow);
+ templatesHBox.PackStart (templateCategoriesBgBox, false, false, 0);
// Templates.
- var templatesVBox = new VBox ();
- templatesVBox.Name = "templatesVBox";
- templatesVBox.WidthRequest = GtkWorkarounds.ConvertToPixelScale (400);
- templatesHBox.PackStart (templatesVBox, false, false, 0);
+ var templatesBgBox = new EventBox ();
+ templatesBgBox.ModifyBg (StateType.Normal, templateListBackgroundColor);
+ templatesBgBox.Name = "templatesVBox";
+ templatesBgBox.WidthRequest = GtkWorkarounds.ConvertToPixelScale (400);
+ templatesHBox.PackStart (templatesBgBox, false, false, 0);
var templatesScrolledWindow = new ScrolledWindow ();
templatesScrolledWindow.Name = "templatesScrolledWindow";
templatesScrolledWindow.HscrollbarPolicy = PolicyType.Never;
@@ -162,10 +189,9 @@ namespace MonoDevelop.Ide.Projects
templatesTreeView.Name = "templatesTreeView";
templatesTreeView.HeadersVisible = false;
templatesTreeView.Model = templatesListStore;
- templatesTreeView.ModifyBase (StateType.Normal, templateListBackgroundColor);
templatesTreeView.AppendColumn (CreateTemplateListTreeViewColumn ());
templatesScrolledWindow.Add (templatesTreeView);
- templatesVBox.PackStart (templatesScrolledWindow, true, true, 0);
+ templatesBgBox.Add (templatesScrolledWindow);
// Template
var templateEventBox = new EventBox ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs
index c4570c668d..e7c2b1b2bd 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.cs
@@ -32,6 +32,7 @@ using MonoDevelop.Components;
using MonoDevelop.Components.AutoTest;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.Templates;
+using MonoDevelop.Ide.Gui;
namespace MonoDevelop.Ide.Projects
{
@@ -119,7 +120,7 @@ namespace MonoDevelop.Ide.Projects
}
ClearPopupMenuItems ();
AddLanguageMenuItems (popupMenu, template);
- popupMenu.ModifyBg (StateType.Normal, GtkTemplateCellRenderer.LanguageButtonBackgroundColor);
+ popupMenu.ModifyBg (StateType.Normal, Styles.NewProjectDialog.TemplateLanguageButtonBackground.ToGdkColor ());
popupMenu.ShowAll ();
MenuPositionFunc posFunc = (Menu m, out int x, out int y, out bool pushIn) => {
@@ -202,6 +203,13 @@ namespace MonoDevelop.Ide.Projects
popupMenu.Destroy ();
popupMenu = null;
}
+
+ if (!controller.IsFirstPage)
+ templatesHBox.Destroy ();
+
+ if (!controller.IsLastPage)
+ projectConfigurationWidget.Destroy ();
+
base.Destroy ();
}
@@ -214,7 +222,7 @@ namespace MonoDevelop.Ide.Projects
void AddTopLevelTemplateCategory (TemplateCategory category)
{
- Xwt.Drawing.Image icon = GetIcon (category.IconId, IconSize.Menu);
+ Xwt.Drawing.Image icon = GetIcon (category.IconId ?? "md-platform-other", IconSize.Menu);
categoryTextRenderer.CategoryIconWidth = (int)icon.Width;
templateCategoriesListStore.AppendValues (
@@ -364,6 +372,8 @@ namespace MonoDevelop.Ide.Projects
var currentCategory = templateCategoriesListStore.GetValue (iter, TemplateCategoryColumn) as TemplateCategory;
if (currentCategory == category) {
templateCategoriesTreeView.Selection.SelectIter (iter);
+ TreePath path = templateCategoriesListStore.GetPath (iter);
+ templateCategoriesTreeView.ScrollToCell (path, null, true, 1, 0);
break;
}
}
@@ -395,12 +405,12 @@ namespace MonoDevelop.Ide.Projects
}
}
- void MoveToNextPage ()
+ async void MoveToNextPage ()
{
if (controller.IsLastPage) {
try {
CanMoveToNextPage = false;
- controller.Create ();
+ await controller.Create ();
} finally {
CanMoveToNextPage = true;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectConfigurationWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectConfigurationWidget.cs
index 447a2e822c..a69502c279 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectConfigurationWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectConfigurationWidget.cs
@@ -31,6 +31,7 @@ using Gtk;
using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Tasks;
+using MonoDevelop.Ide.Gui;
namespace MonoDevelop.Ide.Projects
{
@@ -39,8 +40,8 @@ namespace MonoDevelop.Ide.Projects
{
FinalProjectConfigurationPage projectConfiguration;
uint defaultTableRows;
- Gdk.Color separatorColor = new Gdk.Color (176, 178, 181);
- Gdk.Color leftHandBackgroundColor = new Gdk.Color (225, 228, 232);
+ Gdk.Color separatorColor = Styles.NewProjectDialog.ProjectConfigurationSeparatorColor.ToGdkColor ();
+ Gdk.Color leftHandBackgroundColor = Styles.NewProjectDialog.ProjectConfigurationLeftHandBackgroundColor.ToGdkColor ();
DrawingArea extraControlsSeparator;
List<ExtraControlTableRow> extraControlRows = new List<ExtraControlTableRow> ();
@@ -51,7 +52,7 @@ namespace MonoDevelop.Ide.Projects
solutionNameSeparator.ModifyBg (StateType.Normal, separatorColor);
locationSeparator.ModifyBg (StateType.Normal, separatorColor);
- eventBox.ModifyBg (StateType.Normal, new Gdk.Color (255, 255, 255));
+ eventBox.ModifyBg (StateType.Normal, Styles.NewProjectDialog.ProjectConfigurationRightHandBackgroundColor.ToGdkColor ());
leftBorderEventBox.ModifyBg (StateType.Normal, leftHandBackgroundColor);
projectConfigurationRightBorderEventBox.ModifyBg (StateType.Normal, leftHandBackgroundColor);
@@ -178,7 +179,7 @@ namespace MonoDevelop.Ide.Projects
if (startingFolder != null)
dialog.CurrentFolder = startingFolder;
- dialog.TransientFor = Toplevel as Window;
+ dialog.TransientFor = Toplevel as Gtk.Window;
if (dialog.Run ())
return dialog.SelectedFile;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectFolderPreviewWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectFolderPreviewWidget.cs
index ebe0bbce7a..57e94e9b57 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectFolderPreviewWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkProjectFolderPreviewWidget.cs
@@ -30,6 +30,7 @@ using Gtk;
using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Components.AutoTest;
+using MonoDevelop.Ide.Gui;
using System.ComponentModel;
namespace MonoDevelop.Ide.Projects
@@ -53,10 +54,36 @@ namespace MonoDevelop.Ide.Projects
FinalProjectConfigurationPage projectConfiguration;
+ static GtkProjectFolderPreviewWidget ()
+ {
+ UpdateStyles ();
+ Styles.Changed += (sender, e) => UpdateStyles ();
+ }
+
+ static void UpdateStyles ()
+ {
+ var bgColorHex = Styles.ColorGetHex (Styles.NewProjectDialog.ProjectConfigurationRightHandBackgroundColor);
+
+ string rcstyle = "style \"projectFolderPreviewWidget\"\r\n{\r\n" +
+ " base[NORMAL] = \"" + bgColorHex + "\"\r\n" +
+ " GtkTreeView::even-row-color = \"" + bgColorHex + "\"\r\n" +
+ "}\r\n";
+ rcstyle += "widget \"*projectFolderPreviewWidget*\" style \"projectFolderPreviewWidget\"\r\n";
+
+ Rc.ParseString (rcstyle);
+ }
+
public GtkProjectFolderPreviewWidget ()
{
this.Build ();
+ folderTreeView.Name = "projectFolderPreviewWidget";
+
+ previewLabel.LabelProp = String.Format (
+ "<span weight='bold' foreground='{0}'>{1}</span>",
+ Styles.ColorGetHex (Styles.NewProjectDialog.ProjectConfigurationPreviewLabelColor),
+ global::Mono.Unix.Catalog.GetString ("PREVIEW"));
+
CreateFolderTreeViewColumns ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCategoryCellRenderer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCategoryCellRenderer.cs
index bd25408839..b2a1264315 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCategoryCellRenderer.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCategoryCellRenderer.cs
@@ -88,12 +88,14 @@ namespace MonoDevelop.Ide.Projects
Rectangle DrawIcon (Drawable window, Widget widget, Rectangle cell_area, CellRendererState flags)
{
- StateType state = GetState (widget, flags);
int iconY = cell_area.Y + ((cell_area.Height - (int)CategoryIcon.Height) / 2) + topLevelTemplateHeadingYOffset;
var iconRect = new Rectangle (cell_area.X + (int)Xpad, iconY, (int)CategoryIcon.Width, (int)CategoryIcon.Height);
+ var img = CategoryIcon;
+ if ((flags & Gtk.CellRendererState.Selected) != 0)
+ img = img.WithStyles ("sel");
using (var ctx = CairoHelper.Create (window)) {
- ctx.DrawImage (widget, CategoryIcon, iconRect.X, iconRect.Y);
+ ctx.DrawImage (widget, img, iconRect.X, iconRect.Y);
}
return iconRect;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs
index ed5388bc5a..832aa2bcbc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs
@@ -31,16 +31,13 @@ using Gdk;
using Gtk;
using MonoDevelop.Components;
using MonoDevelop.Core;
+using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Templates;
-using Mono.TextEditor;
namespace MonoDevelop.Ide.Projects
{
class GtkTemplateCellRenderer : CellRendererText
{
- public static Color LanguageButtonBackgroundColor = new Color (247, 247, 247);
-
- Color triangleColor = new Color (83, 83, 83);
Rectangle languageRect;
int dropdownTriangleWidth = 8;
int dropdownTriangleHeight = 5;
@@ -125,7 +122,7 @@ namespace MonoDevelop.Ide.Projects
DrawTemplateNameText (window, widget, cell_area, iconRect, languageRect, flags);
RoundBorder (ctx, languageRect.X, languageRect.Y, languageRect.Width, languageRect.Height);
- SetSourceColor (ctx, LanguageButtonBackgroundColor.ToCairoColor ());
+ SetSourceColor (ctx, Styles.NewProjectDialog.TemplateLanguageButtonBackground.ToCairoColor ());
ctx.Fill ();
int languageTextX = languageRect.X + GetLanguageLeftHandPadding (scale);
@@ -184,11 +181,13 @@ namespace MonoDevelop.Ide.Projects
Rectangle DrawIcon (Drawable window, Widget widget, Rectangle cell_area, CellRendererState flags)
{
- StateType state = GetState (widget, flags);
var iconRect = new Rectangle (cell_area.X + (int)Xpad, cell_area.Y + (int)Ypad, (int)TemplateIcon.Width, (int)TemplateIcon.Height);
+ var img = TemplateIcon;
+ if ((flags & Gtk.CellRendererState.Selected) != 0)
+ img = img.WithStyles ("sel");
using (var ctx = CairoHelper.Create (window)) {
- ctx.DrawImage (widget, TemplateIcon, iconRect.X, iconRect.Y);
+ ctx.DrawImage (widget, img, iconRect.X, iconRect.Y);
}
return iconRect;
@@ -281,7 +280,7 @@ namespace MonoDevelop.Ide.Projects
int width = (int)(scale * dropdownTriangleWidth);
int height = (int)(scale * dropdownTriangleHeight);
- SetSourceColor (ctx, triangleColor.ToCairoColor ());
+ SetSourceColor (ctx, Styles.NewProjectDialog.TemplateLanguageButtonTriangle.ToCairoColor ());
ctx.MoveTo (x, y);
ctx.LineTo (x + width, y);
ctx.LineTo (x + (width / 2), y + height);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/INewProjectController.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/INewProjectController.cs
index ebea257ff6..610d32ae6e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/INewProjectController.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/INewProjectController.cs
@@ -28,6 +28,7 @@
using System.Collections.Generic;
using MonoDevelop.Ide.Templates;
using Xwt.Drawing;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Projects
{
@@ -56,7 +57,7 @@ namespace MonoDevelop.Ide.Projects
WizardPage CurrentWizardPage { get; }
- void Create ();
+ Task Create ();
Image GetImage (SolutionTemplate template);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/IdeFileSystemExtensionExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/IdeFileSystemExtensionExtension.cs
index d7a82b8448..1472f82945 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/IdeFileSystemExtensionExtension.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/IdeFileSystemExtensionExtension.cs
@@ -40,38 +40,64 @@ namespace MonoDevelop.Ide.Projects
return !isDirectory;
}
- public override void RequestFileEdit (IEnumerable<FilePath> files)
+ public override void RequestFileEdit (FilePath file)
{
- base.RequestFileEdit (files);
+ base.RequestFileEdit (file);
if (!IdeApp.IsInitialized)
return;
- List<FilePath> readOnlyFiles = new List<FilePath> ();
- foreach (var f in files) {
- if (File.Exists (f) && File.GetAttributes (f).HasFlag (FileAttributes.ReadOnly))
- readOnlyFiles.Add (f);
+ if (!File.Exists (file))
+ return;
+
+#if MAC
+ // detect 'locked' files on OS X
+ var attr = Foundation.NSFileManager.DefaultManager.GetAttributes (file) ;
+ if (attr != null && attr.Immutable.HasValue && attr.Immutable.Value) {
+ throw new UserException (GettextCatalog.GetString ("File '{0}' is locked.", file));
}
- string error;
- if (readOnlyFiles.Count == 1)
- error = GettextCatalog.GetString ("File {0} is read-only", readOnlyFiles [0].FileName);
- else if (readOnlyFiles.Count > 1) {
- var f1 = string.Join (", ", readOnlyFiles.Take (readOnlyFiles.Count - 1).ToArray ());
- var f2 = readOnlyFiles [readOnlyFiles.Count - 1];
- error = GettextCatalog.GetString ("Files {0} and {1} are read-only", f1, f2);
- } else
+#endif
+ var atts = File.GetAttributes (file);
+ if ((atts & FileAttributes.ReadOnly) == 0)
return;
+
+ string error = GettextCatalog.GetString ("File {0} is read-only", file.FileName);
var btn = new AlertButton (GettextCatalog.GetString ("Make Writable"));
var res = MessageService.AskQuestion (error, GettextCatalog.GetString ("Would you like {0} to attempt to make the file writable and try again?", BrandingService.ApplicationName), btn, AlertButton.Cancel);
if (res == AlertButton.Cancel)
throw new UserException (error) { AlreadyReportedToUser = true };
- foreach (var f in readOnlyFiles) {
- var atts = File.GetAttributes (f);
- File.SetAttributes (f, atts & ~FileAttributes.ReadOnly);
+ File.SetAttributes (file, atts & ~FileAttributes.ReadOnly);
+ }
+
+ public override FileWriteableState GetWriteableState (FilePath file)
+ {
+ if (!File.Exists (file))
+ return FileWriteableState.NotExistant;
+
+#if MAC
+ // detect 'locked' files on OS X
+ var attr = Foundation.NSFileManager.DefaultManager.GetAttributes (file) ;
+ if (attr != null && attr.Immutable.HasValue && attr.Immutable.Value) {
+ return FileWriteableState.Locked;
}
+#endif
+
+ var atts = File.GetAttributes (file);
+ if ((atts & FileAttributes.ReadOnly) == FileAttributes.ReadOnly) {
+
+ // try to set/unset file attributes to determine if it's possible to do so.
+ try {
+ File.SetAttributes (file, atts & ~FileAttributes.ReadOnly);
+ File.SetAttributes (file, atts);
+ } catch (Exception) {
+ return FileWriteableState.Locked;
+ }
+
+ return FileWriteableState.ReadOnly;
+ }
+ return FileWriteableState.Writeable;
}
}
-}
-
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ImportProjectPolicyDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ImportProjectPolicyDialog.cs
index 548cf4a916..25f7a20099 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ImportProjectPolicyDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ImportProjectPolicyDialog.cs
@@ -35,7 +35,7 @@ namespace MonoDevelop.Ide.Projects
{
this.Build ();
selector.RootItem = IdeApp.Workspace;
- selector.SelectedItem = IdeApp.ProjectOperations.CurrentSelectedBuildTarget;
+ selector.SelectedItem = IdeApp.ProjectOperations.CurrentSelectedObject;
selector.SelectableItemTypes = new Type[] { typeof(IPolicyProvider) };
UpdateOk ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs
index ac13fb41f0..f3fdccb5f2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewFileDialog.cs
@@ -38,13 +38,15 @@ using Gtk;
using MonoDevelop.Ide.Gui.Components;
using System.Linq;
using MonoDevelop.Components;
+using MonoDevelop.Components.AutoTest;
+using System.ComponentModel;
namespace MonoDevelop.Ide.Projects
{
/// <summary>
/// This class is for creating a new "empty" file
/// </summary>
- internal partial class NewFileDialog : Dialog
+ internal partial class NewFileDialog : Gtk.Dialog
{
List<TemplateItem> alltemplates = new List<TemplateItem> ();
List<Category> categories = new List<Category> ();
@@ -166,10 +168,13 @@ namespace MonoDevelop.Ide.Projects
{
string key = "Dialogs.NewFileDialog.LastSelectedCategory";
if (proj != null) {
- key += "." + proj.GetProjectTypes ().First ();
- var dnp = proj as DotNetProject;
- if (dnp != null)
- key += "." + dnp.LanguageName;
+ string projectType = proj.GetTypeTags ().FirstOrDefault ();
+ if (projectType != null) {
+ key += "." + projectType;
+ var dnp = proj as DotNetProject;
+ if (dnp != null)
+ key += "." + dnp.LanguageName;
+ }
}
return key;
}
@@ -284,22 +289,23 @@ namespace MonoDevelop.Ide.Projects
project = parentProject;
if (project != null) {
+ var catName = GetCategoryForProject (titem.Template.Categories, project);
if ((templateLanguage != "") && (activeLangs.Count > 2)) {
// The template requires a language, but the project does not have a single fixed
// language type (plus empty match), so create a language category
cat = GetCategory (templateLanguage);
- cat = GetCategory (cat.Categories, titem.Template.Category);
+ cat = GetCategory (cat.Categories, catName);
} else {
- cat = GetCategory (titem.Template.Category);
+ cat = GetCategory (catName);
}
} else {
if (templateLanguage != "") {
// The template requires a language, but there is no current language set, so
// create a category for it
cat = GetCategory (templateLanguage);
- cat = GetCategory (cat.Categories, titem.Template.Category);
+ cat = GetCategory (cat.Categories, titem.Template.Categories.First ().Value);
} else {
- cat = GetCategory (titem.Template.Category);
+ cat = GetCategory (titem.Template.Categories.First ().Value);
}
}
@@ -319,6 +325,17 @@ namespace MonoDevelop.Ide.Projects
alltemplates.Add (titem);
}
+ static string GetCategoryForProject (Dictionary<string, string> categories, Project project)
+ {
+ var projectTypes = project.GetTypeTags ();
+ foreach (var type in projectTypes) {
+ if (categories.ContainsKey (type))
+ return categories [type];
+ }
+
+ return categories.ContainsKey (FileTemplate.DefaultCategoryKey) ? categories [FileTemplate.DefaultCategoryKey] : "Misc";
+ }
+
//tree view event handler for double-click
//toggle the expand collapse methods.
void CategoryActivated (object sender, RowActivatedArgs args)
@@ -476,12 +493,12 @@ namespace MonoDevelop.Ide.Projects
return;
} catch (Exception ex) {
LoggingService.LogError ("Error creating file", ex);
- MessageService.ShowException (ex);
+ MessageService.ShowError ("Error creating file", ex);
return;
}
if (project != null)
- IdeApp.ProjectOperations.Save (project);
+ IdeApp.ProjectOperations.SaveAsync (project);
if (OnOked != null)
OnOked (null, null);
@@ -597,19 +614,19 @@ namespace MonoDevelop.Ide.Projects
infoLabel.Text = string.Empty;
labelTemplateTitle.Text = string.Empty;
- ReadOnlyCollection<Project> projects = null;
+ Project[] projects = null;
if (parentProject == null)
- projects = IdeApp.Workspace.GetAllProjects ();
+ projects = IdeApp.Workspace.GetAllProjects ().ToArray ();
- if (projects != null && projects.Count > 0) {
+ if (projects != null && projects.Length > 0) {
Project curProject = IdeApp.ProjectOperations.CurrentSelectedProject;
boxProject.Visible = true;
projectAddCheckbox.Active = curProject != null;
projectAddCheckbox.Toggled += new EventHandler (AddToProjectToggled);
- projectNames = new string[projects.Count];
- projectRefs = new Project[projects.Count];
+ projectNames = new string[projects.Length];
+ projectRefs = new Project[projects.Length];
int i = 0;
bool singleSolution = IdeApp.Workspace.Items.Count == 1 && IdeApp.Workspace.Items[0] is Solution;
@@ -747,6 +764,9 @@ namespace MonoDevelop.Ide.Projects
HeadersVisible = false;
templateStore = new ListStore (typeof(string), typeof(string), typeof(TemplateItem));
Model = templateStore;
+
+ SemanticModelAttribute modelAttr = new SemanticModelAttribute ("templateStore__Icon", "templateStore__Name", "templateStore__Template");
+ TypeDescriptor.AddAttributes (templateStore, modelAttr);
TreeViewColumn col = new TreeViewColumn ();
CellRendererImage crp = new CellRendererImage ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectConfiguration.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectConfiguration.cs
index d7c079e4e2..a3b1176e57 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectConfiguration.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectConfiguration.cs
@@ -42,6 +42,7 @@ namespace MonoDevelop.Ide.Projects
public class NewProjectConfiguration
{
string projectName = String.Empty;
+ string errorMessage;
public NewProjectConfiguration ()
{
@@ -136,24 +137,44 @@ namespace MonoDevelop.Ide.Projects
bool HasErrors ()
{
+ errorMessage = String.Empty;
+
string solution = SolutionName;
string name = ProjectName;
if (!FileService.IsValidPath (Location)) {
+ errorMessage = GettextCatalog.GetString ("Illegal characters used in location.");
return true;
}
if (CreateSolution && !IsValidSolutionName (solution)) {
+ errorMessage = GettextCatalog.GetString ("Illegal solution name.\nOnly use letters, digits, '.' or '_'.");
return true;
} else if (IsNewSolutionWithoutProjects) {
return false;
}
- return !IsValidProjectName (name) ||
- !FileService.IsValidPath (ProjectLocation);
+ if (!IsValidProjectName (name)) {
+ errorMessage = GettextCatalog.GetString ("Illegal project name.\nOnly use letters, digits, '.' or '_'.");
+ return true;
+ }
+
+ if (!FileService.IsValidPath (ProjectLocation)) {
+ errorMessage = GettextCatalog.GetString ("Illegal characters used in project location.");
+ return true;
+ }
+
+ return false;
}
- static readonly char [] InvalidProjectNameCharacters = "&<*;?>%:#|".ToCharArray ();
+ internal string GetErrorMessage ()
+ {
+ if (errorMessage == null) {
+ HasErrors ();
+ }
+
+ return errorMessage;
+ }
public static bool IsValidProjectName (string name)
{
@@ -163,9 +184,23 @@ namespace MonoDevelop.Ide.Projects
public static bool IsValidSolutionName (string name)
{
- return FileService.IsValidPath (name) &&
- FileService.IsValidFileName (name) &&
- name.IndexOfAny (InvalidProjectNameCharacters) < 0;
+ return FileService.IsValidPath (name) &&
+ FileService.IsValidFileName (name) &&
+ HasValidProjectNameCharacters (name);
+ }
+
+ static bool HasValidProjectNameCharacters (string name)
+ {
+ foreach (char c in name.ToCharArray ()) {
+ if (!IsValidProjectNameCharacter (c))
+ return false;
+ }
+ return true;
+ }
+
+ static bool IsValidProjectNameCharacter (char c)
+ {
+ return Char.IsLetterOrDigit (c) || c == '.' || c == '_';
}
bool CreateSeparateSolutionDirectory {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectController.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectController.cs
index 4dafab5fa9..6c787743d5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectController.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectController.cs
@@ -32,14 +32,17 @@
//
using System;
+using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.IO;
using System.Linq;
+using System.Text;
using Mono.Addins;
using MonoDevelop.Core;
using MonoDevelop.Ide.Templates;
using MonoDevelop.Projects;
using Xwt.Drawing;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Projects
{
@@ -251,7 +254,7 @@ namespace MonoDevelop.Ide.Projects
void SetDefaultLocation ()
{
if (BasePath == null)
- BasePath = IdeApp.ProjectOperations.ProjectsDefaultPath;
+ BasePath = IdeApp.Preferences.ProjectsDefaultPath;
projectConfiguration.Location = new FilePath (BasePath).ResolveLinks ();
}
@@ -520,7 +523,7 @@ namespace MonoDevelop.Ide.Projects
IsLastPage = false;
}
- public void Create ()
+ public async Task Create ()
{
if (wizardProvider.HasWizard)
wizardProvider.BeforeProjectIsCreated ();
@@ -548,48 +551,48 @@ namespace MonoDevelop.Ide.Projects
// Make sure the new item is saved before adding. In this way the
// version control add-in will be able to put it under version control.
foreach (SolutionItem currentEntry in currentEntries) {
- var eitem = currentEntry as SolutionEntityItem;
+ var eitem = currentEntry as SolutionItem;
if (eitem != null) {
// Inherit the file format from the solution
- eitem.FileFormat = ParentFolder.ParentSolution.FileFormat;
+ eitem.ConvertToFormat (ParentFolder.ParentSolution.FileFormat);
- // Remove any references to other projects and add them back after the
- // project is saved because a project reference cannot be resolved until
- // the project has a parent solution.
- List<ProjectReference> projectReferences = GetProjectReferences (eitem);
- if (projectReferences.Any ())
- eitem.Items.RemoveRange (projectReferences);
+ var project = eitem as Project;
+ if (project != null) {
+ // Remove any references to other projects and add them back after the
+ // project is saved because a project reference cannot be resolved until
+ // the project has a parent solution.
+ List<ProjectReference> projectReferences = GetProjectReferences (project);
+ if (projectReferences.Any ())
+ project.Items.RemoveRange (projectReferences);
- IdeApp.ProjectOperations.Save (eitem);
+ await IdeApp.ProjectOperations.SaveAsync (eitem);
- if (projectReferences.Any ())
- eitem.Items.AddRange (projectReferences);
+ if (projectReferences.Any ())
+ project.Items.AddRange (projectReferences);
+ }
}
ParentFolder.AddItem (currentEntry, true);
}
}
if (ParentFolder != null)
- IdeApp.ProjectOperations.Save (ParentFolder.ParentSolution);
+ await IdeApp.ProjectOperations.SaveAsync (ParentFolder.ParentSolution);
else
- IdeApp.ProjectOperations.Save (processedTemplate.WorkspaceItems);
+ await IdeApp.ProjectOperations.SaveAsync (processedTemplate.WorkspaceItems);
CreateVersionControlItems ();
if (OpenSolution) {
DisposeExistingNewItems ();
TemplateWizard wizard = wizardProvider.CurrentWizard;
- var op = OpenCreatedSolution (processedTemplate);
- op.Completed += delegate {
- if (op.Success) {
- var sol = IdeApp.Workspace.GetAllSolutions ().FirstOrDefault ();
- if (sol != null) {
- if (wizard != null)
- wizard.ItemsCreated (new [] { sol });
- InstallProjectTemplatePackages (sol);
- }
+ if (await OpenCreatedSolution (processedTemplate)) {
+ var sol = IdeApp.Workspace.GetAllSolutions ().FirstOrDefault ();
+ if (sol != null) {
+ if (wizard != null)
+ wizard.ItemsCreated (new [] { sol });
+ InstallProjectTemplatePackages (sol);
}
- };
+ }
}
else {
// The item is not a solution being opened, so it is going to be added to
@@ -616,7 +619,7 @@ namespace MonoDevelop.Ide.Projects
}
}
- List<ProjectReference> GetProjectReferences (SolutionEntityItem solutionItem)
+ List<ProjectReference> GetProjectReferences (Project solutionItem)
{
return solutionItem.Items.OfType<ProjectReference> ()
.Where (item => item.ReferenceType == ReferenceType.Project)
@@ -626,7 +629,7 @@ namespace MonoDevelop.Ide.Projects
bool CreateProject ()
{
if (!projectConfiguration.IsValid ()) {
- MessageService.ShowError (GettextCatalog.GetString ("Illegal project name.\nOnly use letters, digits, '.' or '_'."));
+ MessageService.ShowError (projectConfiguration.GetErrorMessage ());
return false;
}
@@ -640,6 +643,12 @@ namespace MonoDevelop.Ide.Projects
return false;
}
+ SolutionTemplate template = GetTemplateForProcessing ();
+ if (ProjectNameIsLanguageKeyword (template.Language, projectConfiguration.ProjectName)) {
+ MessageService.ShowError (GettextCatalog.GetString ("Illegal project name.\nName cannot contain a language keyword."));
+ return false;
+ }
+
ProcessedTemplateResult result = null;
try {
@@ -662,16 +671,16 @@ namespace MonoDevelop.Ide.Projects
DisposeExistingNewItems ();
try {
- result = IdeApp.Services.TemplatingService.ProcessTemplate (GetTemplateForProcessing (), projectConfiguration, ParentFolder);
+ result = IdeApp.Services.TemplatingService.ProcessTemplate (template, projectConfiguration, ParentFolder);
if (!result.WorkspaceItems.Any ())
return false;
} catch (UserException ex) {
MessageService.ShowError (ex.Message, ex.Details);
return false;
} catch (Exception ex) {
- MessageService.ShowException (ex, GettextCatalog.GetString ("The project could not be created"));
+ MessageService.ShowError (GettextCatalog.GetString ("The project could not be created"), ex);
return false;
- }
+ }
processedTemplate = result;
return true;
}
@@ -682,7 +691,7 @@ namespace MonoDevelop.Ide.Projects
return false;
string solutionFileName = Path.Combine (projectConfiguration.SolutionLocation, finalConfigurationPage.SolutionFileName);
- return ParentWorkspace.GetAllSolutions ()
+ return ParentWorkspace.GetChildren ().OfType<Solution> ()
.Any (solution => solution.FileName == solutionFileName);
}
@@ -695,6 +704,53 @@ namespace MonoDevelop.Ide.Projects
}
}
+ static bool ProjectNameIsLanguageKeyword (string language, string projectName)
+ {
+ if (String.IsNullOrEmpty (language))
+ return false;
+
+ LanguageBinding binding = LanguageBindingService.GetBindingPerLanguageName (language);
+ if (binding != null) {
+ var codeDomProvider = binding.GetCodeDomProvider ();
+ if (codeDomProvider != null) {
+ projectName = SanitisePotentialNamespace (projectName);
+ if (projectName.Contains ('.')) {
+ return NameIsLanguageKeyword (codeDomProvider, projectName.Split ('.'));
+ }
+ return !codeDomProvider.IsValidIdentifier (projectName);
+ }
+ }
+
+ return false;
+ }
+
+ static bool NameIsLanguageKeyword (CodeDomProvider codeDomProvider, string[] names)
+ {
+ return names.Any (name => !codeDomProvider.IsValidIdentifier (name));
+ }
+
+ /// <summary>
+ /// Taken from DotNetProject. This is needed otherwise an invalid namespace
+ /// can still be used if digits are used as the start of the project name
+ /// (e.g. '2try').
+ /// </summary>
+ static string SanitisePotentialNamespace (string potential)
+ {
+ var sb = new StringBuilder ();
+ foreach (char c in potential) {
+ if (char.IsLetter (c) || c == '_' || (sb.Length > 0 && (char.IsLetterOrDigit (sb[sb.Length - 1]) || sb[sb.Length - 1] == '_') && (c == '.' || char.IsNumber (c)))) {
+ sb.Append (c);
+ }
+ }
+ if (sb.Length > 0) {
+ if (sb[sb.Length - 1] == '.')
+ sb.Remove (sb.Length - 1, 1);
+
+ return sb.ToString ();
+ } else
+ return "Application";
+ }
+
void InstallProjectTemplatePackages (Solution sol)
{
if (!processedTemplate.HasPackages ())
@@ -705,21 +761,19 @@ namespace MonoDevelop.Ide.Projects
}
}
- static IAsyncOperation OpenCreatedSolution (ProcessedTemplateResult templateResult)
+ static async Task<bool> OpenCreatedSolution (ProcessedTemplateResult templateResult)
{
- IAsyncOperation asyncOperation = IdeApp.Workspace.OpenWorkspaceItem (templateResult.SolutionFileName);
- asyncOperation.Completed += delegate {
- if (asyncOperation.Success) {
- RunTemplateActions (templateResult);
- }
- };
- return asyncOperation;
+ if (await IdeApp.Workspace.OpenWorkspaceItem (templateResult.SolutionFileName)) {
+ RunTemplateActions (templateResult);
+ return true;
+ }
+ return false;
}
static void RunTemplateActions (ProcessedTemplateResult templateResult)
{
foreach (string action in templateResult.Actions) {
- IdeApp.Workbench.OpenDocument (Path.Combine (templateResult.ProjectBasePath, action));
+ IdeApp.Workbench.OpenDocument (Path.Combine (templateResult.ProjectBasePath, action), project: null);
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/PackageReferencePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/PackageReferencePanel.cs
index 34bfd45dc6..9bc98e88e1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/PackageReferencePanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/PackageReferencePanel.cs
@@ -112,8 +112,14 @@ namespace MonoDevelop.Ide.Projects
{
selection.Clear ();
configureProject = netProject;
- SetTargetFramework (netProject.AssemblyContext, netProject.TargetFramework);
- Reset ();
+ if (netProject != null) {
+ SetTargetFramework (netProject.AssemblyContext, netProject.TargetFramework);
+ Reset ();
+ } else {
+ targetContext = null;
+ targetVersion = null;
+ store.Clear ();
+ }
}
public void SetFilter (string filter)
@@ -133,106 +139,112 @@ namespace MonoDevelop.Ide.Projects
public void Reset ()
{
- store.Clear ();
-
- bool isPcl = configureProject is PortableDotNetProject;
-
- foreach (SystemAssembly systemAssembly in targetContext.GetAssemblies (targetVersion)) {
- if (systemAssembly.Package.IsFrameworkPackage && (isPcl || systemAssembly.Name == "mscorlib"))
- continue;
-
- bool selected = IsSelected (ReferenceType.Package, systemAssembly.FullName, systemAssembly.Package.Name);
- int matchRank = 0;
- string name, version;
-
- if (stringMatcher != null) {
- string txt = systemAssembly.Name + " " + systemAssembly.Version;
- if (!stringMatcher.CalcMatchRank (txt, out matchRank))
- continue;
- int[] match = stringMatcher.GetMatch (txt);
- name = GetMatchMarkup (treeView, systemAssembly.Name, match, 0);
- version = GetMatchMarkup (treeView, systemAssembly.Version, match, systemAssembly.Name.Length + 1);
- } else {
- name = GLib.Markup.EscapeText (systemAssembly.Name);
- version = GLib.Markup.EscapeText (systemAssembly.Version);
- }
- string pkg = systemAssembly.Package.GetDisplayName ();
- if (systemAssembly.Package.IsInternalPackage)
- pkg += " " + GettextCatalog.GetString ("(Provided by {0})", BrandingService.ApplicationName);
-
- store.AppendValues (name,
- version,
- systemAssembly,
- selected,
- systemAssembly.FullName,
- pkg,
- MonoDevelop.Ide.Gui.Stock.Package,
- matchRank,
- ReferenceType.Package);
- }
-
- if (showAll) {
- Solution openSolution = configureProject.ParentSolution;
- if (openSolution == null)
- return;
-
- Dictionary<DotNetProject,bool> references = new Dictionary<DotNetProject, bool> ();
-
- foreach (Project projectEntry in openSolution.GetAllSolutionItems<Project>()) {
-
- if (projectEntry == configureProject)
- continue;
-
- bool selected = IsSelected (ReferenceType.Project, projectEntry.Name, "");
- int matchRank = 0;
- string name;
-
- if (stringMatcher != null) {
- if (!stringMatcher.CalcMatchRank (projectEntry.Name, out matchRank))
- continue;
- int[] match = stringMatcher.GetMatch (projectEntry.Name);
- name = GetMatchMarkup (treeView, projectEntry.Name, match, 0);
- } else {
- name = GLib.Markup.EscapeText (projectEntry.Name);
- }
-
- DotNetProject netProject = projectEntry as DotNetProject;
- if (netProject != null) {
- if (ProjectReferencePanel.ProjectReferencesProject (references, null, netProject, configureProject.Name))
- continue;
+ try {
+ treeView.FreezeChildNotify ();
+ store.Clear ();
+
+ bool isPcl = configureProject.IsPortableLibrary;
+
+ foreach (SystemAssembly systemAssembly in targetContext.GetAssemblies (targetVersion)) {
+ if (systemAssembly.Package.IsFrameworkPackage && (isPcl || systemAssembly.Name == "mscorlib"))
+ continue;
+
+ bool selected = IsSelected (ReferenceType.Package, systemAssembly.FullName, systemAssembly.Package.Name);
+ int matchRank = 0;
+ string name, version;
+
+ if (stringMatcher != null) {
+ string txt = systemAssembly.Name + " " + systemAssembly.Version;
+ if (!stringMatcher.CalcMatchRank (txt, out matchRank))
+ continue;
+ int [] match = stringMatcher.GetMatch (txt);
+ name = GetMatchMarkup (treeView, systemAssembly.Name, match, 0);
+ version = GetMatchMarkup (treeView, systemAssembly.Version, match, systemAssembly.Name.Length + 1);
+ } else {
+ name = GLib.Markup.EscapeText (systemAssembly.Name);
+ version = GLib.Markup.EscapeText (systemAssembly.Version);
+ }
+ string pkg = systemAssembly.Package.GetDisplayName ();
+ if (systemAssembly.Package.IsInternalPackage)
+ pkg += " " + GettextCatalog.GetString ("(Provided by {0})", BrandingService.ApplicationName);
- string reason;
- if (!configureProject.CanReferenceProject (netProject, out reason))
- continue;
- }
- store.AppendValues (name, "", null, selected, projectEntry.Name, "", projectEntry.StockIcon, matchRank, ReferenceType.Project);
- }
-
- foreach (FilePath file in selectDialog.GetRecentFileReferences ()) {
- bool selected = IsSelected (ReferenceType.Assembly, file, "");
- int matchRank = 0;
- string fname = file.FileName;
- string name;
-
- string version = string.Empty;
- try {
- string sname = SystemAssemblyService.GetAssemblyName (file);
- var aname = SystemAssemblyService.ParseAssemblyName (sname);
- version = aname.Version.ToString ();
- } catch {
- continue;
- }
-
- if (stringMatcher != null) {
- if (!stringMatcher.CalcMatchRank (fname, out matchRank))
- continue;
- int[] match = stringMatcher.GetMatch (fname);
- name = GetMatchMarkup (treeView, fname, match, 0);
- } else {
- name = GLib.Markup.EscapeText (fname);
- }
- store.AppendValues (name, version, null, selected, (string)file, GLib.Markup.EscapeText (file), MonoDevelop.Ide.Gui.Stock.OpenFolder, matchRank, ReferenceType.Assembly);
+ store.InsertWithValues (-1,
+ name,
+ version,
+ systemAssembly,
+ selected,
+ systemAssembly.FullName,
+ pkg,
+ MonoDevelop.Ide.Gui.Stock.Package,
+ matchRank,
+ ReferenceType.Package);
+ }
+
+ if (showAll) {
+ Solution openSolution = configureProject.ParentSolution;
+ if (openSolution == null)
+ return;
+
+ Dictionary<DotNetProject, bool> references = new Dictionary<DotNetProject, bool> ();
+
+ foreach (Project projectEntry in openSolution.GetAllItems<Project> ()) {
+
+ if (projectEntry == configureProject)
+ continue;
+
+ bool selected = IsSelected (ReferenceType.Project, projectEntry.Name, "");
+ int matchRank = 0;
+ string name;
+
+ if (stringMatcher != null) {
+ if (!stringMatcher.CalcMatchRank (projectEntry.Name, out matchRank))
+ continue;
+ int [] match = stringMatcher.GetMatch (projectEntry.Name);
+ name = GetMatchMarkup (treeView, projectEntry.Name, match, 0);
+ } else {
+ name = GLib.Markup.EscapeText (projectEntry.Name);
+ }
+
+ DotNetProject netProject = projectEntry as DotNetProject;
+ if (netProject != null) {
+ if (ProjectReferencePanel.ProjectReferencesProject (references, null, netProject, configureProject.Name))
+ continue;
+
+ string reason;
+ if (!configureProject.CanReferenceProject (netProject, out reason))
+ continue;
+ }
+ store.InsertWithValues(-1, name, "", null, selected, projectEntry.FileName.ToString (), "", projectEntry.StockIcon, matchRank, ReferenceType.Project);
+ }
+
+ foreach (FilePath file in selectDialog.GetRecentFileReferences ()) {
+ bool selected = IsSelected (ReferenceType.Assembly, file, "");
+ int matchRank = 0;
+ string fname = file.FileName;
+ string name;
+
+ string version = string.Empty;
+ try {
+ string sname = SystemAssemblyService.GetAssemblyName (file);
+ var aname = SystemAssemblyService.ParseAssemblyName (sname);
+ version = aname.Version.ToString ();
+ } catch {
+ continue;
+ }
+
+ if (stringMatcher != null) {
+ if (!stringMatcher.CalcMatchRank (fname, out matchRank))
+ continue;
+ int [] match = stringMatcher.GetMatch (fname);
+ name = GetMatchMarkup (treeView, fname, match, 0);
+ } else {
+ name = GLib.Markup.EscapeText (fname);
+ }
+ store.InsertWithValues (-1, name, version, null, selected, (string)file, GLib.Markup.EscapeText (file), MonoDevelop.Ide.Gui.Stock.OpenFolder, matchRank, ReferenceType.Assembly);
+ }
}
+ } finally {
+ treeView.ThawChildNotify ();
}
}
@@ -240,7 +252,7 @@ namespace MonoDevelop.Ide.Projects
{
StringBuilder result = new StringBuilder ();
int lastPos = 0;
- var color = Mono.TextEditor.HslColor.GenerateHighlightColors (widget.Style.Base (StateType.Normal),
+ var color = HslColor.GenerateHighlightColors (widget.Style.Base (StateType.Normal),
widget.Style.Text (StateType.Normal), 3)[2];
for (int n=0; n < matches.Length; n++) {
int pos = matches[n] - startIndex;
@@ -278,11 +290,14 @@ namespace MonoDevelop.Ide.Projects
found = true;
break;
case ReferenceType.Project:
- if ((string)store.GetValue (iter, ColFullName) == refInfo.Reference)
+ var path = (FilePath)(string) store.GetValue (iter, ColFullName);
+ var project = refInfo.ResolveProject (configureProject.ParentSolution);
+ if (project != null && path.CanonicalPath == project.FileName.CanonicalPath)
found = true;
break;
case ReferenceType.Assembly:
- if ((string)store.GetValue (iter, ColFullName) == refInfo.Reference)
+ var file = (FilePath)(string) store.GetValue (iter, ColFullName);
+ if (file.CanonicalPath == refInfo.HintPath.CanonicalPath)
found = true;
break;
}
@@ -333,10 +348,17 @@ namespace MonoDevelop.Ide.Projects
string fullName = (string)store.GetValue (iter, ColFullName);
if ((bool)store.GetValue (iter, ColSelected) == false) {
store.SetValue (iter, ColSelected, true);
- if (rt == ReferenceType.Package)
- selectDialog.AddReference (new ProjectReference ((SystemAssembly)store.GetValue (iter, ColAssembly)));
- else
- selectDialog.AddReference (new ProjectReference (rt, fullName));
+ switch (rt) {
+ case ReferenceType.Package:
+ selectDialog.AddReference (ProjectReference.CreateAssemblyReference ((SystemAssembly)store.GetValue (iter, ColAssembly)));
+ break;
+ case ReferenceType.Assembly:
+ selectDialog.AddReference (ProjectReference.CreateAssemblyFileReference (fullName));
+ break;
+ case ReferenceType.Project:
+ selectDialog.AddReference (ProjectReference.CreateProjectReference (fullName));
+ break;
+ }
}
else {
store.SetValue (iter, ColSelected, false);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectFileSelectorDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectFileSelectorDialog.cs
index 2d7450a840..90cb6deab4 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectFileSelectorDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectFileSelectorDialog.cs
@@ -322,7 +322,7 @@ namespace MonoDevelop.Ide.Projects
IdeApp.ProjectOperations.AddFilesToProject (project,
fileDialog.SelectedFiles, baseDirectory, buildAction);
- IdeApp.ProjectOperations.Save (project);
+ IdeApp.ProjectOperations.SaveAsync (project);
UpdateFileList (sender, e);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectOptionsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectOptionsDialog.cs
index 21eb8b8782..56fb56a48a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectOptionsDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectOptionsDialog.cs
@@ -33,6 +33,7 @@ using System.ComponentModel;
using Mono.Addins;
using MonoDevelop.Core;
using MonoDevelop.Projects;
+using MonoDevelop.Components;
using MonoDevelop.Components.Commands;
using MonoDevelop.Ide.Gui.Dialogs;
@@ -43,7 +44,7 @@ namespace MonoDevelop.Ide.Projects
/// </summary>
public class ProjectOptionsDialog : MultiConfigItemOptionsDialog
{
- public ProjectOptionsDialog (Gtk.Window parentWindow, SolutionEntityItem project) : base (parentWindow, project)
+ public ProjectOptionsDialog (Window parentWindow, SolutionItem project) : base (parentWindow, project)
{
this.Title = GettextCatalog.GetString ("Project Options") + " - " + project.Name;
this.DefaultWidth = 960;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectReferencePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectReferencePanel.cs
index edf0032940..e1dc9b1fef 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectReferencePanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectReferencePanel.cs
@@ -106,8 +106,11 @@ namespace MonoDevelop.Ide.Projects {
selection.Clear ();
store.Clear ();
this.configureProject = configureProject;
- PopulateListView ();
- Show ();
+
+ if (configureProject != null) {
+ PopulateListView ();
+ Show ();
+ }
}
public void SetFilter (string filter)
@@ -127,7 +130,7 @@ namespace MonoDevelop.Ide.Projects {
if ((bool)store.GetValue (iter, ColSelected) == false) {
store.SetValue (iter, ColSelected, true);
- selectDialog.AddReference (new ProjectReference (project));
+ selectDialog.AddReference (ProjectReference.CreateProjectReference (project));
} else {
store.SetValue (iter, ColSelected, false);
@@ -180,7 +183,7 @@ namespace MonoDevelop.Ide.Projects {
Dictionary<DotNetProject,bool> references = new Dictionary<DotNetProject, bool> ();
- foreach (Project projectEntry in openSolution.GetAllSolutionItems<Project>()) {
+ foreach (Project projectEntry in openSolution.GetAllItems<Project>()) {
if (projectEntry == configureProject)
continue;
@@ -235,12 +238,15 @@ namespace MonoDevelop.Ide.Projects {
if (references.TryGetValue (project, out res))
return res;
foreach (ProjectReference pr in project.References) {
+ if (pr.ReferenceType != ReferenceType.Project) {
+ continue;
+ }
if (pr.Reference == targetProject) {
references [project] = true;
return true;
}
-
- DotNetProject pref = project.ParentSolution.FindProjectByName (pr.Reference) as DotNetProject;
+
+ DotNetProject pref = pr.ResolveProject (project.ParentSolution) as DotNetProject;
if (pref != null) {
if (parentDeps == null) {
parentDeps = new HashSet<string> ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectSelectorDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectSelectorDialog.cs
index 3b0d4c1866..c21725ca27 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectSelectorDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ProjectSelectorDialog.cs
@@ -56,12 +56,12 @@ namespace MonoDevelop.Ide.Projects
}
}
- public IBuildTarget SelectedItem {
+ public WorkspaceObject SelectedItem {
get { return selector.SelectedItem; }
set { selector.SelectedItem = value; }
}
- public IEnumerable<IBuildTarget> ActiveItems {
+ public IEnumerable<WorkspaceObject> ActiveItems {
get { return selector.ActiveItems; }
set { selector.ActiveItems = value; }
}
@@ -76,7 +76,7 @@ namespace MonoDevelop.Ide.Projects
set { selector.CascadeCheckboxSelection = value; }
}
- public IBuildTarget RootItem {
+ public WorkspaceObject RootItem {
get { return selector.RootItem; }
set { selector.RootItem = value; }
}
@@ -86,7 +86,7 @@ namespace MonoDevelop.Ide.Projects
set { selector.SelectableItemTypes = value; }
}
- public Func<IBuildTarget,bool> SelectableFilter {
+ public Func<WorkspaceObject,bool> SelectableFilter {
get { return selector.SelectableFilter; }
set { selector.SelectableFilter = value; }
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs
index c8a995266b..f297eeec48 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/SelectReferenceDialog.cs
@@ -30,15 +30,12 @@ using System.Linq;
using MonoDevelop.Projects;
using MonoDevelop.Core;
-using MonoDevelop.Core.Assemblies;
using Gtk;
using System.Collections.Generic;
using MonoDevelop.Components;
-using MonoDevelop.Ide.Commands;
using MonoDevelop.Components.Commands;
using System.IO;
-using Mono.TextEditor;
namespace MonoDevelop.Ide.Projects
{
@@ -99,9 +96,12 @@ namespace MonoDevelop.Ide.Projects
this.configureProject = configureProject;
foreach (var p in panels)
p.SetProject (configureProject);
-
+
((ListStore) ReferencesTreeView.Model).Clear ();
+ if (configureProject == null)
+ return;
+
foreach (ProjectReference refInfo in configureProject.References)
AppendReference (refInfo);
@@ -136,8 +136,8 @@ namespace MonoDevelop.Ide.Projects
{
Solution c = configureProject.ParentSolution;
if (c == null) return TreeIter.Zero;
-
- Project p = c.FindProjectByName (refInfo.Reference);
+
+ Project p = refInfo.ResolveProject (c);
if (p == null) return TreeIter.Zero;
string txt = GLib.Markup.EscapeText (System.IO.Path.GetFileName (refInfo.Reference)) + "\n";
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.StandardHeader/StandardHeaderPolicyPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.StandardHeader/StandardHeaderPolicyPanel.cs
index 3b3f771bad..3bcfbdb9cc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.StandardHeader/StandardHeaderPolicyPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.StandardHeader/StandardHeaderPolicyPanel.cs
@@ -27,7 +27,7 @@
//
using System;
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Core.Serialization;
using MonoDevelop.Projects.Policies;
@@ -45,7 +45,7 @@ namespace MonoDevelop.Ide.StandardHeader
get { return GettextCatalog.GetString ("Standard _Header"); }
}
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
panel = new StandardHeaderPolicyPanelWidget (this);
panel.ShowAll ();
@@ -66,13 +66,49 @@ namespace MonoDevelop.Ide.StandardHeader
partial class StandardHeaderPolicyPanelWidget : Gtk.Bin
{
StandardHeaderPolicyPanel parent;
-
- public StandardHeaderPolicyPanelWidget (StandardHeaderPolicyPanel parent)
+ Gtk.TreeStore store = new Gtk.TreeStore (typeof (string));
+
+ static readonly string [] templates = {
+ "FileName",
+ "FileNameWithoutExtension",
+ "Directory",
+ "FullFileName",
+ "AuthorName",
+ "AuthorEmail",
+ "CopyrightHolder",
+ "Date",
+ "Time",
+ "Year",
+ "Month",
+ "Day",
+ "Hour",
+ "Minute",
+ "Second"
+ };
+
+ internal StandardHeaderPolicyPanelWidget (StandardHeaderPolicyPanel parent)
{
this.parent = parent;
this.Build ();
headerText.Buffer.Changed += NotifyChanged;
includeAutoCheck.Toggled += NotifyChanged;
+ this.treeviewTemplates.AppendColumn (GettextCatalog.GetString ("Templates"), new Gtk.CellRendererText (), "text", 0);
+ foreach (var template in templates) {
+ store.AppendValues ("${"+template+"}");
+ }
+ this.treeviewTemplates.Model = store;
+ treeviewTemplates.RowActivated += TreeviewTemplates_RowActivated;
+ var w4 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.GtkScrolledWindow1]));
+ w4.Expand = false;
+ treeviewTemplates.WidthRequest = 200;
+ treeviewTemplates.QueueResize ();
+ }
+
+ void TreeviewTemplates_RowActivated (object o, Gtk.RowActivatedArgs args)
+ {
+ Gtk.TreeIter iter;
+ store.GetIter (out iter, args.Path);
+ headerText.Buffer.InsertAtCursor ((string)store.GetValue (iter, 0));
}
void NotifyChanged (object sender, EventArgs e)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs
index c34f26b240..f3692a002d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.StandardHeader/StandardHeaderService.cs
@@ -42,7 +42,7 @@ namespace MonoDevelop.Ide.StandardHeader
{
public static class StandardHeaderService
{
- public static string GetHeader (SolutionItem policyParent, string fileName, bool newFile)
+ public static string GetHeader (SolutionFolderItem policyParent, string fileName, bool newFile)
{
StandardHeaderPolicy headerPolicy = policyParent != null ? policyParent.Policies.Get<StandardHeaderPolicy> () : MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<StandardHeaderPolicy> ();
TextStylePolicy textPolicy = policyParent != null ? policyParent.Policies.Get<TextStylePolicy> ("text/plain") : MonoDevelop.Projects.Policies.PolicyService.GetDefaultPolicy<TextStylePolicy> ("text/plain");
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksChangedEventHandler.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksChangedEventHandler.cs
index 514601b9f1..b78ad1bf70 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksChangedEventHandler.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksChangedEventHandler.cs
@@ -31,23 +31,44 @@ using MonoDevelop.Ide.TypeSystem;
namespace MonoDevelop.Ide.Tasks
{
- public class CommentTasksChangedEventArgs : EventArgs
+ public class CommentTaskChange
{
- string filename;
- IList<Tag> tagComments;
- Project project;
-
- public CommentTasksChangedEventArgs (string filename, IList<Tag> tagComments, Project project)
+ readonly string filename;
+ readonly IReadOnlyList<Tag> tagComments;
+ readonly Project project;
+
+ public string FileName { get { return filename; } }
+
+ public IReadOnlyList<Tag> TagComments { get { return tagComments; } }
+
+ public Project Project { get { return project; } }
+
+ public CommentTaskChange (string filename, IReadOnlyList<Tag> tagComments, Project project)
{
this.filename = filename;
this.tagComments = tagComments;
this.project = project;
}
-
- public string FileName { get { return filename; } }
+ }
- public IList<Tag> TagComments { get { return tagComments; } }
+ public class CommentTasksChangedEventArgs : EventArgs
+ {
+ IReadOnlyList<CommentTaskChange> changes;
- public Project Project { get { return project; } }
+ public IReadOnlyList<CommentTaskChange> Changes {
+ get {
+ return changes;
+ }
+ }
+
+ public CommentTasksChangedEventArgs (IReadOnlyList<CommentTaskChange> changes)
+ {
+ this.changes = changes;
+ }
+
+ public CommentTasksChangedEventArgs (string filename, IReadOnlyList<Tag> tagComments, Project project)
+ {
+ changes = new [] { new CommentTaskChange (filename, tagComments, project) };
+ }
}
-}
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksView.cs
index 07e718b0e4..9df4ad07eb 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksView.cs
@@ -32,14 +32,16 @@ using System.Collections;
using System.Collections.Generic;
using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Projects;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Gui;
-using MonoDevelop.Projects.Text;
using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem;
using System.Linq;
+using MonoDevelop.Ide.Editor;
+using System.Threading;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Tasks
{
@@ -83,19 +85,23 @@ namespace MonoDevelop.Ide.Tasks
TaskService.CommentTasksChanged += OnCommentTasksChanged;
CommentTag.SpecialCommentTagsChanged += OnCommentTagsChanged;
- IdeApp.Workspace.WorkspaceItemLoaded += OnWorkspaceItemLoaded;
+
+ MonoDevelopWorkspace.LoadingFinished += OnWorkspaceItemLoaded;
IdeApp.Workspace.WorkspaceItemUnloaded += OnWorkspaceItemUnloaded;
-
- highPrioColor = StringToColor ((string)PropertyService.Get ("Monodevelop.UserTasksHighPrioColor", ""));
- normalPrioColor = StringToColor ((string)PropertyService.Get ("Monodevelop.UserTasksNormalPrioColor", ""));
- lowPrioColor = StringToColor ((string)PropertyService.Get ("Monodevelop.UserTasksLowPrioColor", ""));
+ IdeApp.Workspace.LastWorkspaceItemClosed += LastWorkspaceItemClosed;
+ IdeApp.Workbench.DocumentOpened += WorkbenchDocumentOpened;
+ IdeApp.Workbench.DocumentClosed += WorkbenchDocumentClosed;
+
+ highPrioColor = StringToColor (IdeApp.Preferences.UserTasksHighPrioColor);
+ normalPrioColor = StringToColor (IdeApp.Preferences.UserTasksNormalPrioColor);
+ lowPrioColor = StringToColor (IdeApp.Preferences.UserTasksLowPrioColor);
store = new Gtk.ListStore (
typeof (int), // line
typeof (string), // desc
typeof (string), // file
typeof (string), // path
- typeof (Task), // task
+ typeof (TaskListEntry), // task
typeof (Gdk.Color), // foreground color
typeof (int)); // font weight
@@ -124,38 +130,67 @@ namespace MonoDevelop.Ide.Tasks
col.Resizable = true;
LoadColumnsVisibility ();
-
- comments.BeginTaskUpdates ();
- try {
- foreach (var item in IdeApp.Workspace.Items) {
- LoadWorkspaceItemContents (item);
- }
- } finally {
- comments.EndTaskUpdates ();
- }
- comments.TasksAdded += DispatchService.GuiDispatch<TaskEventHandler> (GeneratedTaskAdded);
- comments.TasksRemoved += DispatchService.GuiDispatch<TaskEventHandler> (GeneratedTaskRemoved);
+ OnWorkspaceItemLoaded (null, EventArgs.Empty);
- PropertyService.PropertyChanged += DispatchService.GuiDispatch<EventHandler<PropertyChangedEventArgs>> (OnPropertyUpdated);
+ comments.TasksAdded += GeneratedTaskAdded;
+ comments.TasksRemoved += GeneratedTaskRemoved;
+
+ IdeApp.Preferences.UserTasksHighPrioColor.Changed += OnPropertyUpdated;
+ IdeApp.Preferences.UserTasksNormalPrioColor.Changed += OnPropertyUpdated;
+ IdeApp.Preferences.UserTasksLowPrioColor.Changed += OnPropertyUpdated;
// Initialize with existing tags.
- foreach (Task t in comments)
+ foreach (TaskListEntry t in comments)
AddGeneratedTask (t);
view.Destroyed += delegate {
view.RowActivated -= OnRowActivated;
TaskService.CommentTasksChanged -= OnCommentTasksChanged;
CommentTag.SpecialCommentTagsChanged -= OnCommentTagsChanged;
- IdeApp.Workspace.WorkspaceItemLoaded -= OnWorkspaceItemLoaded;
+ MonoDevelopWorkspace.LoadingFinished -= OnWorkspaceItemLoaded;
IdeApp.Workspace.WorkspaceItemUnloaded -= OnWorkspaceItemUnloaded;
- comments.TasksAdded -= DispatchService.GuiDispatch<TaskEventHandler> (GeneratedTaskAdded);
- comments.TasksRemoved -= DispatchService.GuiDispatch<TaskEventHandler> (GeneratedTaskRemoved);
+ comments.TasksAdded -= GeneratedTaskAdded;
+ comments.TasksRemoved -= GeneratedTaskRemoved;
- PropertyService.PropertyChanged -= DispatchService.GuiDispatch<EventHandler<PropertyChangedEventArgs>> (OnPropertyUpdated);
+ IdeApp.Preferences.UserTasksHighPrioColor.Changed -= OnPropertyUpdated;
+ IdeApp.Preferences.UserTasksNormalPrioColor.Changed -= OnPropertyUpdated;
+ IdeApp.Preferences.UserTasksLowPrioColor.Changed -= OnPropertyUpdated;
};
}
+ void WorkbenchDocumentClosed (object sender, DocumentEventArgs e)
+ {
+ e.Document.DocumentParsed -= HandleDocumentParsed;
+ }
+
+ void WorkbenchDocumentOpened (object sender, DocumentEventArgs e)
+ {
+ e.Document.DocumentParsed += HandleDocumentParsed;
+ }
+
+ void HandleDocumentParsed (object sender, EventArgs e)
+ {
+ var doc = (Document)sender;
+ var pd = doc.ParsedDocument;
+ var project = doc.Project;
+ if (pd == null || project == null)
+ return;
+ ProjectCommentTags tags;
+ if (!projectTags.TryGetValue (project, out tags))
+ return;
+ var token = src.Token;
+ var file = doc.FileName;
+ Task.Run (async () => {
+ try {
+ tags.UpdateTags (project, file, await pd.GetTagCommentsAsync (token));
+ } catch (TaskCanceledException) {
+ } catch (AggregateException ae) {
+ ae.Flatten ().Handle (x => x is TaskCanceledException);
+ }
+ });
+ }
+
void LoadColumnsVisibility ()
{
string columns = (string)PropertyService.Get ("Monodevelop.CommentTasksColumns", "TRUE;TRUE;TRUE;TRUE");
@@ -181,89 +216,96 @@ namespace MonoDevelop.Ide.Tasks
PropertyService.Set ("Monodevelop.CommentTasksColumns", columns);
}
- void OnWorkspaceItemLoaded (object sender, WorkspaceItemEventArgs e)
+ void OnWorkspaceItemLoaded (object sender, EventArgs e)
{
comments.BeginTaskUpdates ();
try {
- LoadWorkspaceItemContents (e.Item);
+ foreach (var sln in IdeApp.Workspace.GetAllSolutions ())
+ LoadSolutionContents (sln);
}
finally {
comments.EndTaskUpdates ();
}
}
-
- void LoadWorkspaceItemContents (WorkspaceItem wob)
- {
- foreach (var sln in wob.GetAllSolutions ())
- LoadSolutionContents (sln);
- }
- void UpdateCommentTagsForProject (Solution solution, Project project)
+ Dictionary<Project, ProjectCommentTags> projectTags = new Dictionary<Project, ProjectCommentTags> ();
+ CancellationTokenSource src = new CancellationTokenSource ();
+ void UpdateCommentTagsForProject (Solution solution, Project project, CancellationToken token)
{
- var ctx = TypeSystemService.GetProjectContentWrapper (project);
- if (ctx == null)
+ if (token.IsCancellationRequested)
return;
- var tags = ctx.GetExtensionObject<ProjectCommentTags> ();
- if (tags == null) {
+ ProjectCommentTags tags;
+ if (!projectTags.TryGetValue (project, out tags)) {
tags = new ProjectCommentTags ();
- ctx.UpdateExtensionObject (tags);
- tags.Update (ctx.Project);
- } else {
- foreach (var kv in tags.Tags) {
- UpdateCommentTags (solution, kv.Key, kv.Value);
- }
+ projectTags [project] = tags;
}
- }
-
- void HandleSolutionItemAdded (object sender, SolutionItemChangeEventArgs e)
- {
- var newProject = e.SolutionItem as Project;
- if (newProject == null)
- return;
- UpdateCommentTagsForProject (e.Solution, newProject);
+ var files = project.Files.ToArray ();
+ Task.Run (async () => {
+ try {
+ await tags.UpdateAsync (project, files, token);
+ } catch (TaskCanceledException) {
+ } catch (AggregateException ae) {
+ ae.Flatten ().Handle (x => x is TaskCanceledException);
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while updating comment tags.", e);
+ }
+ });
}
void LoadSolutionContents (Solution sln)
{
+ src.Cancel ();
+ src = new CancellationTokenSource ();
+ var token = src.Token;
+
loadedSlns.Add (sln);
- System.Threading.ThreadPool.QueueUserWorkItem (delegate {
- sln.SolutionItemAdded += HandleSolutionItemAdded;
+ Task.Run (delegate {
+ sln.SolutionItemAdded += delegate(object sender, SolutionItemChangeEventArgs e) {
+ var newProject = e.SolutionItem as Project;
+ if (newProject == null)
+ return;
+ UpdateCommentTagsForProject (sln, newProject, token);
+ };
// Load all tags that are stored in pidb files
foreach (Project p in sln.GetAllProjects ()) {
- UpdateCommentTagsForProject (sln, p);
+ UpdateCommentTagsForProject (sln, p, token);
}
});
}
-
- static IEnumerable<Tag> GetSpecialComments (IProjectContent ctx, string name)
+ void OnWorkspaceItemUnloaded (object sender, WorkspaceItemEventArgs e)
{
- var doc = ctx.GetFile (name) as ParsedDocument;
- if (doc == null)
- return Enumerable.Empty<Tag> ();
- return (IEnumerable<Tag>)doc.TagComments;
+ comments.RemoveItemTasks (e.Item, true);
+
+ var solution = e.Item as Solution;
+ if (solution != null) {
+ loadedSlns.Remove (solution);
+
+ foreach (Project p in solution.GetAllProjects ()) {
+ projectTags.Remove (p);
+ }
+ }
}
- void OnWorkspaceItemUnloaded (object sender, WorkspaceItemEventArgs e)
+ void LastWorkspaceItemClosed (object sender, EventArgs e)
{
- foreach (var sln in e.Item.GetAllSolutions ()) {
- if (loadedSlns.Remove (sln))
- sln.SolutionItemAdded -= HandleSolutionItemAdded;
- }
- comments.RemoveItemTasks (e.Item, true);
- }
+ loadedSlns.Clear ();
+ projectTags.Clear ();
+ }
- void OnCommentTasksChanged (object sender, CommentTasksChangedEventArgs e)
+ void OnCommentTasksChanged (object sender, CommentTasksChangedEventArgs args)
{
- //because of parse queueing, it's possible for this event to come in after the solution is closed
- //so we track which solutions are currently open so that we don't leak memory by holding
- // on to references to closed projects
- if (e.Project != null && e.Project.ParentSolution != null && loadedSlns.Contains (e.Project.ParentSolution)) {
- Application.Invoke (delegate {
- UpdateCommentTags (e.Project.ParentSolution, e.FileName, e.TagComments);
- });
- }
+ Application.Invoke (delegate {
+ foreach (var e in args.Changes) {
+ //because of parse queueing, it's possible for this event to come in after the solution is closed
+ //so we track which solutions are currently open so that we don't leak memory by holding
+ // on to references to closed projects
+ if (e.Project != null && e.Project.ParentSolution != null && loadedSlns.Contains (e.Project.ParentSolution)) {
+ UpdateCommentTags (e.Project.ParentSolution, e.FileName, e.TagComments);
+ }
+ }
+ });
}
void OnCommentTagsChanged (object sender, EventArgs e)
@@ -278,7 +320,7 @@ namespace MonoDevelop.Ide.Tasks
fileName = fileName.FullPath;
- List<Task> newTasks = new List<Task> ();
+ List<TaskListEntry> newTasks = new List<TaskListEntry> ();
if (tagComments != null) {
foreach (Tag tag in tagComments) {
TaskPriority priority;
@@ -299,13 +341,13 @@ namespace MonoDevelop.Ide.Tasks
}
}
- Task t = new Task (fileName, desc, tag.Region.BeginColumn, tag.Region.BeginLine,
+ TaskListEntry t = new TaskListEntry (fileName, desc, tag.Region.BeginColumn, tag.Region.BeginLine,
TaskSeverity.Information, priority, wob);
newTasks.Add (t);
}
}
- List<Task> oldTasks = new List<Task> (comments.GetFileTasks (fileName));
+ List<TaskListEntry> oldTasks = new List<TaskListEntry> (comments.GetFileTasks (fileName));
for (int i = 0; i < newTasks.Count; ++i) {
for (int j = 0; j < oldTasks.Count; ++j) {
@@ -341,11 +383,11 @@ namespace MonoDevelop.Ide.Tasks
void GeneratedTaskAdded (object sender, TaskEventArgs e)
{
- foreach (Task t in e.Tasks)
+ foreach (TaskListEntry t in e.Tasks)
AddGeneratedTask (t);
}
- void AddGeneratedTask (Task t)
+ void AddGeneratedTask (TaskListEntry t)
{
FilePath tmpPath = t.FileName;
if (t.WorkspaceObject != null)
@@ -356,25 +398,25 @@ namespace MonoDevelop.Ide.Tasks
void GeneratedTaskRemoved (object sender, TaskEventArgs e)
{
- foreach (Task t in e.Tasks)
+ foreach (TaskListEntry t in e.Tasks)
RemoveGeneratedTask (t);
}
- void RemoveGeneratedTask (Task t)
+ void RemoveGeneratedTask (TaskListEntry t)
{
TreeIter iter = FindTask (store, t);
if (!iter.Equals (TreeIter.Zero))
store.Remove (ref iter);
}
- static TreeIter FindTask (ListStore store, Task task)
+ static TreeIter FindTask (ListStore store, TaskListEntry task)
{
TreeIter iter;
if (!store.GetIterFirst (out iter))
return TreeIter.Zero;
do {
- Task t = store.GetValue (iter, (int)Columns.Task) as Task;
+ TaskListEntry t = store.GetValue (iter, (int)Columns.Task) as TaskListEntry;
if (t == task)
return iter;
}
@@ -468,7 +510,7 @@ namespace MonoDevelop.Ide.Tasks
void OnGenTaskCopied (object o, EventArgs args)
{
- Task task = SelectedTask;
+ TaskListEntry task = SelectedTask;
if (task != null) {
clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
clipboard.Text = task.Description;
@@ -477,14 +519,14 @@ namespace MonoDevelop.Ide.Tasks
}
}
- Task SelectedTask
+ TaskListEntry SelectedTask
{
get {
TreeModel model;
TreeIter iter;
if (view.Selection.GetSelected (out model, out iter))
{
- return (Task)model.GetValue (iter, (int)Columns.Task);
+ return (TaskListEntry)model.GetValue (iter, (int)Columns.Task);
}
else return null; // no one selected
}
@@ -492,7 +534,7 @@ namespace MonoDevelop.Ide.Tasks
void OnGenTaskJumpto (object o, EventArgs args)
{
- Task task = SelectedTask;
+ TaskListEntry task = SelectedTask;
if (task != null)
task.JumpToPosition ();
}
@@ -502,11 +544,11 @@ namespace MonoDevelop.Ide.Tasks
OnGenTaskJumpto (null, null);
}
- void OnGenTaskDelete (object o, EventArgs args)
+ async void OnGenTaskDelete (object o, EventArgs args)
{
- Task task = SelectedTask;
+ TaskListEntry task = SelectedTask;
if (task != null && ! String.IsNullOrEmpty (task.FileName)) {
- Document doc = IdeApp.Workbench.OpenDocument (task.FileName, Math.Max (1, task.Line), Math.Max (1, task.Column));
+ var doc = await IdeApp.Workbench.OpenDocument (task.FileName, null, Math.Max (1, task.Line), Math.Max (1, task.Column));
if (doc != null && doc.HasProject && doc.Project is DotNetProject) {
string[] commentTags = doc.CommentTags;
if (commentTags != null && commentTags.Length == 1) {
@@ -515,10 +557,11 @@ namespace MonoDevelop.Ide.Tasks
string line = doc.Editor.GetLineText (task.Line);
int index = line.IndexOf (commentTags[0]);
if (index != -1) {
- doc.Editor.SetCaretTo (task.Line, task.Column);
+ doc.Editor.CaretLocation = new DocumentLocation (task.Line, task.Column);
+ doc.Editor.StartCaretPulseAnimation ();
line = line.Substring (0, index);
- var ls = doc.Editor.Document.GetLine (task.Line);
- doc.Editor.Replace (ls.Offset, ls.Length, line);
+ var ls = doc.Editor.GetLine (task.Line);
+ doc.Editor.ReplaceText (ls.Offset, ls.Length, line);
comments.Remove (task);
}
});
@@ -569,48 +612,32 @@ namespace MonoDevelop.Ide.Tasks
return color;
}
- void OnPropertyUpdated (object sender, PropertyChangedEventArgs e)
+ void OnPropertyUpdated (object sender, EventArgs e)
{
- bool change = false;
- if (e.Key == "Monodevelop.UserTasksHighPrioColor" && e.NewValue != e.OldValue)
- {
- highPrioColor = StringToColor ((string)e.NewValue);
- change = true;
- }
- if (e.Key == "Monodevelop.UserTasksNormalPrioColor" && e.NewValue != e.OldValue)
- {
- normalPrioColor = StringToColor ((string)e.NewValue);
- change = true;
- }
- if (e.Key == "Monodevelop.UserTasksLowPrioColor" && e.NewValue != e.OldValue)
- {
- lowPrioColor = StringToColor ((string)e.NewValue);
- change = true;
- }
-
- if (change)
+ highPrioColor = StringToColor (IdeApp.Preferences.UserTasksHighPrioColor);
+ normalPrioColor = StringToColor (IdeApp.Preferences.UserTasksNormalPrioColor);
+ lowPrioColor = StringToColor (IdeApp.Preferences.UserTasksLowPrioColor);
+
+ TreeIter iter;
+ if (store.GetIterFirst (out iter))
{
- TreeIter iter;
- if (store.GetIterFirst (out iter))
+ do
{
- do
- {
- Task task = (Task) store.GetValue (iter, (int)Columns.Task);
- store.SetValue (iter, (int)Columns.Foreground, GetColorByPriority (task.Priority));
- } while (store.IterNext (ref iter));
- }
+ TaskListEntry task = (TaskListEntry) store.GetValue (iter, (int)Columns.Task);
+ store.SetValue (iter, (int)Columns.Foreground, GetColorByPriority (task.Priority));
+ } while (store.IterNext (ref iter));
}
}
#region ITaskListView members
- TreeView ITaskListView.Content {
+ Control ITaskListView.Content {
get {
CreateView ();
return view;
}
}
- Widget[] ITaskListView.ToolBarItems {
+ Control[] ITaskListView.ToolBarItems {
get { return null; }
}
#endregion
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/ITaskListView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/ITaskListView.cs
index 89b3fd5f1f..8506888425 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/ITaskListView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/ITaskListView.cs
@@ -27,13 +27,13 @@
//
using System;
-using Gtk;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Tasks
{
public interface ITaskListView
{
- TreeView Content { get; }
- Widget[] ToolBarItems { get; }
+ Control Content { get; }
+ Control[] ToolBarItems { get; }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/ProjectCommentTags.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/ProjectCommentTags.cs
new file mode 100644
index 0000000000..e56b8c3600
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/ProjectCommentTags.cs
@@ -0,0 +1,93 @@
+//
+// ProjectCommentTags.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Concurrent;
+using MonoDevelop.Projects;
+using MonoDevelop.Ide.Tasks;
+using System.Threading;
+using MonoDevelop.Ide.TypeSystem;
+using System.Threading.Tasks;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.Ide.Tasks
+{
+ class ProjectCommentTags
+ {
+ Dictionary<string, IReadOnlyList<Tag>> tags = new Dictionary<string, IReadOnlyList<Tag>> ();
+
+ public IDictionary<string, IReadOnlyList<Tag>> Tags {
+ get {
+ return tags;
+ }
+ }
+
+ public void UpdateTags (Project project, string fileName, IReadOnlyList<Tag> tagComments)
+ {
+ var list = tagComments == null || tagComments.Count == 0 ? null : new List<Tag> (tagComments);
+ lock (tags) {
+ IReadOnlyList<Tag> oldList;
+ tags.TryGetValue (fileName, out oldList);
+ if (list == null && oldList == null)
+ return;
+ tags[fileName] = list;
+ TaskService.InformCommentTasks (new CommentTasksChangedEventArgs (fileName, tagComments, project));
+ }
+ }
+
+ public void RemoveFile (Project project, string fileName)
+ {
+ lock (tags) {
+ if (!tags.ContainsKey (fileName))
+ return;
+ tags[fileName] = null;
+ }
+
+ TaskService.InformCommentTasks (new CommentTasksChangedEventArgs (fileName, null, project));
+ }
+
+ internal async Task UpdateAsync (Project project, ProjectFile[] files, CancellationToken token = default (CancellationToken))
+ {
+ var changes = new List<CommentTaskChange> ();
+ var newTags = new Dictionary<string, IReadOnlyList<Tag>> ();
+ foreach (var file in files) {
+ if (file.BuildAction == BuildAction.None)
+ continue;
+ var pd = await TypeSystemService.ParseFile (project, file.FilePath, token).ConfigureAwait (false);
+ if (pd != null) {
+ var commentTagList = await pd.GetTagCommentsAsync (token).ConfigureAwait (false);
+ changes.Add (new CommentTaskChange (file.FilePath, commentTagList, project));
+ newTags[file.FilePath] = commentTagList;
+ }
+ }
+ await Runtime.RunInMainThread (delegate {
+ this.tags = newTags;
+ TaskService.InformCommentTasks (new CommentTasksChangedEventArgs (changes));
+ }).ConfigureAwait (false);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/Task.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/Task.cs
deleted file mode 100644
index 9e6b541ce6..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/Task.cs
+++ /dev/null
@@ -1,281 +0,0 @@
-//
-// Task.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-
-using System;
-using System.Collections;
-using System.CodeDom.Compiler;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Components;
-using MonoDevelop.Ide.Gui.Pads.ProjectPad;
-using MonoDevelop.Core;
-using MonoDevelop.Core.Serialization;
-
-namespace MonoDevelop.Ide.Tasks
-{
- public class Task
- {
- [ItemProperty]
- FilePath file;
-
- [ItemProperty (DefaultValue = 0)]
- int line;
-
- [ItemProperty (DefaultValue = 0)]
- int column;
-
- [ItemProperty (DefaultValue = "")]
- string description = string.Empty;
-
- [ItemProperty (DefaultValue = "")]
- string code = string.Empty;
-
- [ItemProperty (DefaultValue = "")]
- string helpKeyword = string.Empty;
-
- [ItemProperty (DefaultValue = TaskPriority.Normal)]
- TaskPriority priority = TaskPriority.Normal;
-
- [ItemProperty (DefaultValue = TaskSeverity.Information)]
- TaskSeverity severity = TaskSeverity.Information;
-
- [ItemProperty (DefaultValue = false)]
- bool completed;
-
- [ItemProperty (DefaultValue = "")]
- string category = string.Empty;
-
- object owner;
- IWorkspaceObject parentObject;
- internal int SavedLine;
-
- public Task (FilePath file, string description, int column, int line, TaskSeverity severity)
- : this (file, description, column, line, severity, TaskPriority.Normal, null, null)
- {
- }
-
- public Task (FilePath file, string description, int column, int line, TaskSeverity severity, TaskPriority priority)
- : this (file, description, column, line, severity, priority, null, null)
- {
- }
-
- public Task (FilePath file, string description, int column, int line, TaskSeverity severity, TaskPriority priority, IWorkspaceObject parent)
- : this (file, description, column, line, severity, priority, parent, null)
- {
- }
-
- public Task (FilePath file, string description, int column, int line, TaskSeverity severity, TaskPriority priority, IWorkspaceObject parent, object owner)
- : this (file, description, column, line, severity, priority, parent, owner, null)
- {
- }
-
- public Task (FilePath file, string description, int column, int line, TaskSeverity severity, TaskPriority priority, IWorkspaceObject parent, object owner, string category)
- {
- this.file = file;
- this.description = description;
- this.column = column;
- this.line = line;
- this.severity = severity;
- this.priority = priority;
- this.owner = owner;
- this.parentObject = parent;
- this.category = category;
- }
-
- public Task ()
- {
-
- }
-
- public Task (BuildError error)
- : this (error, null)
- {
- }
-
- public Task (BuildError error, object owner)
- {
- parentObject = error.SourceTarget;
- file = error.FileName;
- this.owner = owner;
- description = error.ErrorText;
- column = error.Column;
- line = error.Line;
- if (!string.IsNullOrEmpty (error.ErrorNumber))
- description += " (" + error.ErrorNumber + ")";
- if (error.IsWarning)
- severity = error.ErrorNumber == "COMMENT" ? TaskSeverity.Information : TaskSeverity.Warning;
- else
- severity = TaskSeverity.Error;
- priority = TaskPriority.Normal;
- code = error.ErrorNumber;
- category = error.Subcategory;
- helpKeyword = error.HelpKeyword;
- }
-
- public int Column {
- get {
- return column;
- }
- }
-
- public bool Completed {
- get {
- return completed;
- }
- set {
- completed = value;
- }
- }
-
- public string Description {
- get {
- return description;
- }
- set {
- description = value;
- }
- }
-
- public string Code {
- get {
- return code;
- }
- }
-
- public string HelpKeyword {
- get {
- return helpKeyword;
- }
- }
-
- public FilePath FileName {
- get {
- return file;
- }
- internal set {
- file = value;
- }
- }
-
- public int Line {
- get {
- return line;
- }
- internal set {
- line = value;
- }
- }
-
- public object Owner {
- get {
- return owner;
- }
- internal set {
- owner = value;
- }
- }
-
- public IWorkspaceObject WorkspaceObject {
- get {
- return parentObject;
- }
- set {
- if (parentObject != null)
- throw new InvalidOperationException ("Owner already set");
- parentObject = value;
- }
- }
-
- public TaskPriority Priority {
- get {
- return priority;
- }
- set {
- priority = value;
- }
- }
-
- public TaskSeverity Severity {
- get {
- return severity;
- }
- }
-
- public string Category {
- get {
- return category;
- }
- set {
- category = value;
- }
- }
-
- public virtual void JumpToPosition()
- {
- if (!file.IsNullOrEmpty) {
- var project = WorkspaceObject as Project;
- IdeApp.Workbench.OpenDocument (file, project, Math.Max (1, line), Math.Max (1, column));
- } else if (parentObject != null) {
- Pad pad = IdeApp.Workbench.GetPad<ProjectSolutionPad> ();
- ProjectSolutionPad spad = pad.Content as ProjectSolutionPad;
- ITreeNavigator nav = spad.TreeView.GetNodeAtObject (parentObject, true);
- if (nav != null) {
- nav.ExpandToNode ();
- nav.Selected = true;
- nav.Expanded = true;
- }
- }
- TaskService.InformJumpToTask (this);
- }
-
- public bool BelongsToItem (IWorkspaceObject item, bool checkHierarchy)
- {
- if (!checkHierarchy)
- return item == parentObject;
-
- IWorkspaceObject cit = parentObject;
- do {
- if (cit == item)
- return true;
- if (cit is SolutionItem) {
- SolutionItem si = (SolutionItem) cit;
- if (si.ParentFolder != null)
- cit = si.ParentFolder;
- else
- cit = si.ParentSolution;
- }
- else if (cit is WorkspaceItem) {
- cit = ((WorkspaceItem)cit).ParentWorkspace;
- }
- else
- cit = null;
- } while (cit != null);
-
- return false;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskListEntry.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskListEntry.cs
new file mode 100644
index 0000000000..769ba00227
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskListEntry.cs
@@ -0,0 +1,292 @@
+//
+// TaskListEntry.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+
+using System;
+using System.Collections;
+using System.CodeDom.Compiler;
+using MonoDevelop.Projects;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide.Gui.Components;
+using MonoDevelop.Ide.Gui.Pads.ProjectPad;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Serialization;
+using MonoDevelop.Ide.Gui.Pads;
+
+namespace MonoDevelop.Ide.Tasks
+{
+ public class TaskListEntry
+ {
+ [ItemProperty]
+ FilePath file;
+
+ [ItemProperty (DefaultValue = 0)]
+ int line;
+
+ [ItemProperty (DefaultValue = 0)]
+ int column;
+
+ [ItemProperty (DefaultValue = "")]
+ string description = string.Empty;
+
+ [ItemProperty (DefaultValue = "")]
+ string code = string.Empty;
+
+ [ItemProperty (DefaultValue = "")]
+ string helpKeyword = string.Empty;
+
+ [ItemProperty (DefaultValue = TaskPriority.Normal)]
+ TaskPriority priority = TaskPriority.Normal;
+
+ [ItemProperty (DefaultValue = TaskSeverity.Information)]
+ TaskSeverity severity = TaskSeverity.Information;
+
+ [ItemProperty (DefaultValue = false)]
+ bool completed;
+
+ [ItemProperty (DefaultValue = "")]
+ string category = string.Empty;
+
+ object owner;
+ WorkspaceObject parentObject;
+ internal int SavedLine;
+
+ public TaskListEntry (FilePath file, string description, int column, int line, TaskSeverity severity)
+ : this (file, description, column, line, severity, TaskPriority.Normal, null, null)
+ {
+ }
+
+ public TaskListEntry (FilePath file, string description, int column, int line, TaskSeverity severity, TaskPriority priority)
+ : this (file, description, column, line, severity, priority, null, null)
+ {
+ }
+
+ public TaskListEntry (FilePath file, string description, int column, int line, TaskSeverity severity, TaskPriority priority, WorkspaceObject parent)
+ : this (file, description, column, line, severity, priority, parent, null)
+ {
+ }
+
+ public TaskListEntry (FilePath file, string description, int column, int line, TaskSeverity severity, TaskPriority priority, WorkspaceObject parent, object owner)
+ : this (file, description, column, line, severity, priority, parent, owner, null)
+ {
+ }
+
+ public TaskListEntry (FilePath file, string description, int column, int line, TaskSeverity severity, TaskPriority priority, WorkspaceObject parent, object owner, string category)
+ {
+ this.file = file;
+ this.description = description;
+ this.column = column;
+ this.line = line;
+ this.severity = severity;
+ this.priority = priority;
+ this.owner = owner;
+ this.parentObject = parent;
+ this.category = category;
+ }
+
+ public TaskListEntry ()
+ {
+
+ }
+
+ public TaskListEntry (BuildError error)
+ : this (error, null)
+ {
+ }
+
+ public TaskListEntry (BuildError error, object owner)
+ {
+ parentObject = error.SourceTarget as WorkspaceObject;
+ file = error.FileName;
+ this.owner = owner;
+ description = error.ErrorText;
+ column = error.Column;
+ line = error.Line;
+ if (!string.IsNullOrEmpty (error.ErrorNumber))
+ description += " (" + error.ErrorNumber + ")";
+ if (error.IsWarning)
+ severity = error.ErrorNumber == "COMMENT" ? TaskSeverity.Information : TaskSeverity.Warning;
+ else
+ severity = TaskSeverity.Error;
+ priority = TaskPriority.Normal;
+ code = error.ErrorNumber;
+ category = error.Subcategory;
+ helpKeyword = error.HelpKeyword;
+ }
+
+ public int Column {
+ get {
+ return column;
+ }
+ }
+
+ public bool Completed {
+ get {
+ return completed;
+ }
+ set {
+ completed = value;
+ }
+ }
+
+ public string Description {
+ get {
+ return description;
+ }
+ set {
+ description = value;
+ }
+ }
+
+ public string Code {
+ get {
+ return code;
+ }
+ }
+
+ public string HelpKeyword {
+ get {
+ return helpKeyword;
+ }
+ }
+
+ public FilePath FileName {
+ get {
+ return file;
+ }
+ internal set {
+ file = value;
+ }
+ }
+
+ public int Line {
+ get {
+ return line;
+ }
+ internal set {
+ line = value;
+ }
+ }
+
+ public object Owner {
+ get {
+ return owner;
+ }
+ internal set {
+ owner = value;
+ }
+ }
+
+ public WorkspaceObject WorkspaceObject {
+ get {
+ return parentObject;
+ }
+ set {
+ if (parentObject != null)
+ throw new InvalidOperationException ("Owner already set");
+ parentObject = value;
+ }
+ }
+
+ public TaskPriority Priority {
+ get {
+ return priority;
+ }
+ set {
+ priority = value;
+ }
+ }
+
+ public TaskSeverity Severity {
+ get {
+ return severity;
+ }
+ }
+
+ public string Category {
+ get {
+ return category;
+ }
+ set {
+ category = value;
+ }
+ }
+
+ public virtual void JumpToPosition()
+ {
+ if (!file.IsNullOrEmpty) {
+ var project = WorkspaceObject as Project;
+ IdeApp.Workbench.OpenDocument (file, project, Math.Max (1, line), Math.Max (1, column));
+ } else if (parentObject != null) {
+ Pad pad = IdeApp.Workbench.GetPad<ProjectSolutionPad> ();
+ ProjectSolutionPad spad = pad.Content as ProjectSolutionPad;
+ ITreeNavigator nav = spad.TreeView.GetNodeAtObject (parentObject, true);
+ if (nav != null) {
+ nav.ExpandToNode ();
+ nav.Selected = true;
+ nav.Expanded = true;
+ }
+ }
+ TaskService.InformJumpToTask (this);
+ }
+
+ public void SelectInPad()
+ {
+ var pad = IdeApp.Workbench.GetPad<ErrorListPad> ();
+ if (pad == null)
+ return;
+ pad.BringToFront ();
+ var errorList = pad.Content as ErrorListPad;
+ errorList?.SelectTaskListEntry (this);
+ }
+
+ public bool BelongsToItem (WorkspaceObject item, bool checkHierarchy)
+ {
+ if (!checkHierarchy)
+ return item == parentObject;
+
+ WorkspaceObject cit = parentObject;
+ do {
+ if (cit == item)
+ return true;
+ if (cit is SolutionFolderItem) {
+ var sfi = (SolutionFolderItem) cit;
+ if (sfi.ParentFolder != null)
+ cit = sfi.ParentFolder;
+ else
+ cit = sfi.ParentSolution;
+ }
+ else if (cit is WorkspaceItem) {
+ cit = ((WorkspaceItem)cit).ParentWorkspace;
+ }
+ else
+ cit = null;
+ } while (cit != null);
+
+ return false;
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskService.cs
index e29aefd2d3..408d4189cb 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskService.cs
@@ -54,8 +54,10 @@ namespace MonoDevelop.Ide.Tasks
static TaskService ()
{
- IdeApp.Workspace.WorkspaceItemLoaded += OnWorkspaceItemLoaded;
- IdeApp.Workspace.WorkspaceItemUnloaded += OnWorkspaceItemUnloaded;
+ if (IdeApp.Workspace != null) {
+ IdeApp.Workspace.WorkspaceItemLoaded += OnWorkspaceItemLoaded;
+ IdeApp.Workspace.WorkspaceItemUnloaded += OnWorkspaceItemUnloaded;
+ }
errors.ItemName = GettextCatalog.GetString ("Warning/Error");
userTasks.ItemName = GettextCatalog.GetString ("User Task");
}
@@ -104,7 +106,7 @@ namespace MonoDevelop.Ide.Tasks
/// <summary>
/// Shows a description of the task in the status bar
/// </summary>
- public static void ShowStatus (Task t)
+ public static void ShowStatus (TaskListEntry t)
{
if (t == null)
IdeApp.Workbench.StatusBar.ShowMessage (GettextCatalog.GetString ("No more errors or warnings"));
@@ -125,8 +127,8 @@ namespace MonoDevelop.Ide.Tasks
// Load User Tasks from xml file
if (File.Exists (fileToLoad)) {
XmlDataSerializer serializer = new XmlDataSerializer (new DataContext ());
- List<Task> ts = (List<Task>) serializer.Deserialize (fileToLoad, typeof(List<Task>));
- foreach (Task t in ts) {
+ List<TaskListEntry> ts = (List<TaskListEntry>) serializer.Deserialize (fileToLoad, typeof(List<TaskListEntry>));
+ foreach (TaskListEntry t in ts) {
t.WorkspaceObject = e.Item;
userTasks.Add (t);
}
@@ -157,11 +159,11 @@ namespace MonoDevelop.Ide.Tasks
return combinePath.Combine (item.FileName.FileNameWithoutExtension + ".usertasks");
}
- internal static void SaveUserTasks (IWorkspaceObject item)
+ internal static void SaveUserTasks (WorkspaceObject item)
{
string fileToSave = GetUserTasksFilename ((WorkspaceItem)item);
try {
- List<Task> utasks = new List<Task> (userTasks.GetItemTasks (item, true));
+ List<TaskListEntry> utasks = new List<TaskListEntry> (userTasks.GetItemTasks (item, true));
if (utasks.Count == 0) {
if (File.Exists (fileToSave))
File.Delete (fileToSave);
@@ -177,7 +179,7 @@ namespace MonoDevelop.Ide.Tasks
public static event EventHandler<TaskEventArgs> JumpedToTask;
- internal static void InformJumpToTask (Task task)
+ internal static void InformJumpToTask (TaskListEntry task)
{
EventHandler<TaskEventArgs> handler = JumpedToTask;
if (handler != null)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs
index dc2da230bc..d2c9276df1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs
@@ -23,17 +23,17 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.3074
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-using System;
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.3074
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using System;
using System.Collections;
using System.Collections.Generic;
using MonoDevelop.Core;
@@ -42,36 +42,40 @@ using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.Navigation;
using MonoDevelop.Ide.TextEditing;
-using MonoDevelop.Ide.Desktop;
-
-namespace MonoDevelop.Ide.Tasks
-{
- public class TaskStore: IEnumerable<Task>, ILocationList
- {
+using MonoDevelop.Ide.Desktop;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Ide.Tasks
+{
+ public class TaskStore: IEnumerable<TaskListEntry>, ILocationList
+ {
int taskUpdateCount;
- List<Task> tasks = new List<Task> ();
- Dictionary<FilePath,Task[]> taskIndex = new Dictionary<FilePath, Task[]> ();
+ List<TaskListEntry> tasks = new List<TaskListEntry> ();
+ Dictionary<FilePath,TaskListEntry[]> taskIndex = new Dictionary<FilePath, TaskListEntry[]> ();
public event TaskEventHandler TasksAdded;
public event TaskEventHandler TasksRemoved;
public event TaskEventHandler TasksChanged;
- List<Task> tasksAdded;
- List<Task> tasksRemoved;
+ List<TaskListEntry> tasksAdded;
+ List<TaskListEntry> tasksRemoved;
- public TaskStore ()
- {
- IdeApp.Workspace.FileRenamedInProject += ProjectFileRenamed;
- IdeApp.Workspace.FileRemovedFromProject += ProjectFileRemoved;
-
+ public TaskStore ()
+ {
+ if (IdeApp.Workspace != null) {
+ IdeApp.Workspace.FileRenamedInProject += ProjectFileRenamed;
+ IdeApp.Workspace.FileRemovedFromProject += ProjectFileRemoved;
+ }
+
TextEditorService.LineCountChangesCommitted += delegate (object sender, TextFileEventArgs args) {
- foreach (Task task in GetFileTasks (args.TextFile.Name.FullPath))
+ foreach (TaskListEntry task in GetFileTasks (args.TextFile.Name.FullPath))
task.SavedLine = -1;
};
TextEditorService.LineCountChangesReset += delegate (object sender, TextFileEventArgs args) {
- Task[] ctasks = GetFileTasks (args.TextFile.Name.FullPath);
- foreach (Task task in ctasks) {
+ Runtime.AssertMainThread ();
+ TaskListEntry[] ctasks = GetFileTasks (args.TextFile.Name.FullPath);
+ foreach (TaskListEntry task in ctasks) {
if (task.SavedLine != -1) {
task.Line = task.SavedLine;
task.SavedLine = -1;
@@ -81,10 +85,11 @@ namespace MonoDevelop.Ide.Tasks
};
TextEditorService.LineCountChanged += delegate (object sender, LineCountEventArgs args) {
+ Runtime.AssertMainThread ();
if (args.TextFile == null || args.TextFile.Name.IsNullOrEmpty)
return;
- Task[] ctasks = GetFileTasks (args.TextFile.Name.FullPath);
- foreach (Task task in ctasks) {
+ TaskListEntry[] ctasks = GetFileTasks (args.TextFile.Name.FullPath);
+ foreach (TaskListEntry task in ctasks) {
if (task.Line > args.LineNumber || (task.Line == args.LineNumber && task.Column >= args.Column)) {
if (task.SavedLine == -1)
task.SavedLine = task.Line;
@@ -95,17 +100,18 @@ namespace MonoDevelop.Ide.Tasks
};
}
- public void Add (Task task)
+ public void Add (TaskListEntry task)
{
+ Runtime.AssertMainThread ();
tasks.Add (task);
OnTaskAdded (task);
}
- public void AddRange (IEnumerable<Task> newTasks)
+ public void AddRange (IEnumerable<TaskListEntry> newTasks)
{
BeginTaskUpdates ();
try {
- foreach (Task t in newTasks) {
+ foreach (TaskListEntry t in newTasks) {
tasks.Add (t);
OnTaskAdded (t);
}
@@ -114,11 +120,11 @@ namespace MonoDevelop.Ide.Tasks
}
}
- public void RemoveRange (IEnumerable<Task> tasks)
+ public void RemoveRange (IEnumerable<TaskListEntry> tasks)
{
BeginTaskUpdates ();
try {
- foreach (Task t in tasks) {
+ foreach (TaskListEntry t in tasks) {
if (this.tasks.Remove (t))
OnTaskRemoved (t);
}
@@ -127,23 +133,24 @@ namespace MonoDevelop.Ide.Tasks
}
}
- public void RemoveItemTasks (IWorkspaceObject parent)
+ public void RemoveItemTasks (WorkspaceObject parent)
{
- RemoveRange (new List<Task> (GetItemTasks (parent)));
+ RemoveRange (new List<TaskListEntry> (GetItemTasks (parent)));
}
- public void RemoveItemTasks (IWorkspaceObject parent, bool checkHierarchy)
+ public void RemoveItemTasks (WorkspaceObject parent, bool checkHierarchy)
{
- RemoveRange (new List<Task> (GetItemTasks (parent, checkHierarchy)));
+ RemoveRange (new List<TaskListEntry> (GetItemTasks (parent, checkHierarchy)));
}
public void RemoveFileTasks (FilePath file)
{
- RemoveRange (new List<Task> (GetFileTasks (file)));
+ RemoveRange (new List<TaskListEntry> (GetFileTasks (file)));
}
- public void Remove (Task task)
+ public void Remove (TaskListEntry task)
{
+ Runtime.AssertMainThread ();
if (tasks.Remove (task))
OnTaskRemoved (task);
}
@@ -152,9 +159,9 @@ namespace MonoDevelop.Ide.Tasks
{
try {
BeginTaskUpdates ();
- List<Task> toRemove = tasks;
- tasks = new List<Task> ();
- foreach (Task t in toRemove)
+ List<TaskListEntry> toRemove = tasks;
+ tasks = new List<TaskListEntry> ();
+ foreach (TaskListEntry t in toRemove)
OnTaskRemoved (t);
} finally {
EndTaskUpdates ();
@@ -165,8 +172,8 @@ namespace MonoDevelop.Ide.Tasks
{
try {
BeginTaskUpdates ();
- List<Task> toRemove = new List<Task> (GetOwnerTasks (owner));
- foreach (Task t in toRemove)
+ List<TaskListEntry> toRemove = new List<TaskListEntry> (GetOwnerTasks (owner));
+ foreach (TaskListEntry t in toRemove)
Remove (t);
} finally {
EndTaskUpdates ();
@@ -177,7 +184,7 @@ namespace MonoDevelop.Ide.Tasks
get { return tasks.Count; }
}
- public IEnumerator<Task> GetEnumerator ()
+ public IEnumerator<TaskListEntry> GetEnumerator ()
{
return tasks.GetEnumerator ();
}
@@ -187,31 +194,31 @@ namespace MonoDevelop.Ide.Tasks
return ((IEnumerable)tasks).GetEnumerator ();
}
- public IEnumerable<Task> GetOwnerTasks (object owner)
+ public IEnumerable<TaskListEntry> GetOwnerTasks (object owner)
{
- foreach (Task t in tasks) {
+ foreach (TaskListEntry t in tasks) {
if (t.Owner == owner)
yield return t;
}
}
-
- public Task[] GetFileTasks (FilePath file)
+
+ public TaskListEntry[] GetFileTasks (FilePath file)
{
- Task[] ta;
+ TaskListEntry[] ta;
if (taskIndex.TryGetValue (file, out ta))
return ta;
else
- return new Task [0];
+ return new TaskListEntry [0];
}
- public IEnumerable<Task> GetItemTasks (IWorkspaceObject parent)
+ public IEnumerable<TaskListEntry> GetItemTasks (WorkspaceObject parent)
{
return GetItemTasks (parent, true);
}
- public IEnumerable<Task> GetItemTasks (IWorkspaceObject parent, bool checkHierarchy)
+ public IEnumerable<TaskListEntry> GetItemTasks (WorkspaceObject parent, bool checkHierarchy)
{
- foreach (Task t in tasks) {
+ foreach (TaskListEntry t in tasks) {
if (t.BelongsToItem (parent, checkHierarchy))
yield return t;
}
@@ -219,18 +226,20 @@ namespace MonoDevelop.Ide.Tasks
public void BeginTaskUpdates ()
{
+ Runtime.AssertMainThread ();
if (taskUpdateCount++ != 0)
return;
- tasksAdded = new List<Task> ();
- tasksRemoved = new List<Task> ();
+ tasksAdded = new List<TaskListEntry> ();
+ tasksRemoved = new List<TaskListEntry> ();
}
public void EndTaskUpdates ()
{
+ Runtime.AssertMainThread ();
if (--taskUpdateCount != 0)
return;
- List<Task> oldAdded = tasksAdded;
- List<Task> oldRemoved = tasksRemoved;
+ List<TaskListEntry> oldAdded = tasksAdded;
+ List<TaskListEntry> oldRemoved = tasksRemoved;
tasksAdded = null;
tasksRemoved = null;
if (oldRemoved.Count > 0)
@@ -239,7 +248,7 @@ namespace MonoDevelop.Ide.Tasks
NotifyTasksAdded (oldAdded);
}
- void NotifyTasksAdded (IEnumerable<Task> ts)
+ void NotifyTasksAdded (IEnumerable<TaskListEntry> ts)
{
try {
if (TasksAdded != null)
@@ -249,7 +258,7 @@ namespace MonoDevelop.Ide.Tasks
}
}
- void NotifyTasksChanged (IEnumerable<Task> ts)
+ void NotifyTasksChanged (IEnumerable<TaskListEntry> ts)
{
try {
if (TasksChanged != null)
@@ -259,7 +268,7 @@ namespace MonoDevelop.Ide.Tasks
}
}
- void NotifyTasksRemoved (IEnumerable<Task> ts)
+ void NotifyTasksRemoved (IEnumerable<TaskListEntry> ts)
{
try {
if (TasksRemoved != null)
@@ -269,28 +278,28 @@ namespace MonoDevelop.Ide.Tasks
}
}
- internal void OnTaskAdded (Task t)
+ void OnTaskAdded (TaskListEntry t)
{
if (t.FileName != FilePath.Null) {
- Task[] ta;
+ TaskListEntry[] ta;
if (taskIndex.TryGetValue (t.FileName, out ta)) {
Array.Resize (ref ta, ta.Length + 1);
ta [ta.Length - 1] = t;
} else {
- ta = new Task [] { t };
+ ta = new TaskListEntry [] { t };
}
taskIndex [t.FileName] = ta;
}
if (tasksAdded != null)
tasksAdded.Add (t);
else
- NotifyTasksAdded (new Task [] { t });
+ NotifyTasksAdded (new TaskListEntry [] { t });
}
- internal void OnTaskRemoved (Task t)
+ void OnTaskRemoved (TaskListEntry t)
{
if (t.FileName != FilePath.Null) {
- Task[] ta;
+ TaskListEntry[] ta;
if (taskIndex.TryGetValue (t.FileName, out ta)) {
if (ta.Length == 1) {
if (ta [0] == t)
@@ -298,7 +307,7 @@ namespace MonoDevelop.Ide.Tasks
} else {
int i = Array.IndexOf (ta, t);
if (i != -1) {
- Task[] newTa = new Task [ta.Length - 1];
+ TaskListEntry[] newTa = new TaskListEntry [ta.Length - 1];
Array.Copy (ta, 0, newTa, 0, i);
Array.Copy (ta, i+1, newTa, i, ta.Length - i - 1);
taskIndex [t.FileName] = newTa;
@@ -309,7 +318,7 @@ namespace MonoDevelop.Ide.Tasks
if (tasksRemoved != null)
tasksRemoved.Add (t);
else
- NotifyTasksRemoved (new Task [] { t });
+ NotifyTasksRemoved (new TaskListEntry [] { t });
}
void ProjectFileRemoved (object sender, ProjectFileEventArgs args)
@@ -317,7 +326,7 @@ namespace MonoDevelop.Ide.Tasks
BeginTaskUpdates ();
try {
foreach (ProjectFileEventInfo e in args) {
- foreach (Task curTask in new List<Task> (GetFileTasks (e.ProjectFile.FilePath))) {
+ foreach (TaskListEntry curTask in new List<TaskListEntry> (GetFileTasks (e.ProjectFile.FilePath))) {
Remove (curTask);
}
}
@@ -331,8 +340,8 @@ namespace MonoDevelop.Ide.Tasks
BeginTaskUpdates ();
try {
foreach (ProjectFileRenamedEventInfo e in args) {
- Task[] ctasks = GetFileTasks (e.OldName);
- foreach (Task curTask in ctasks)
+ TaskListEntry[] ctasks = GetFileTasks (e.OldName);
+ foreach (TaskListEntry curTask in ctasks)
curTask.FileName = e.NewName;
taskIndex.Remove (e.OldName);
taskIndex [e.NewName] = ctasks;
@@ -346,7 +355,7 @@ namespace MonoDevelop.Ide.Tasks
#region ILocationList implementation
- Task currentLocationTask;
+ TaskListEntry currentLocationTask;
TaskSeverity iteratingSeverity;
public void ResetLocationList ()
@@ -357,7 +366,7 @@ namespace MonoDevelop.Ide.Tasks
public event EventHandler CurrentLocationTaskChanged;
- public Task CurrentLocationTask {
+ public TaskListEntry CurrentLocationTask {
get { return currentLocationTask; }
set {
currentLocationTask = value;
@@ -372,16 +381,16 @@ namespace MonoDevelop.Ide.Tasks
class TaskNavigationPoint : TextFileNavigationPoint
{
- Task task;
+ TaskListEntry task;
- public TaskNavigationPoint (Task task) : base (task.FileName, task.Line, task.Column)
+ public TaskNavigationPoint (TaskListEntry task) : base (task.FileName, task.Line, task.Column)
{
this.task = task;
}
- protected override Document DoShow ()
+ protected override async Task<Document> DoShow ()
{
- Document result = base.DoShow ();
+ Document result = await base.DoShow ();
TaskService.InformJumpToTask (task);
return result;
}
@@ -406,7 +415,7 @@ namespace MonoDevelop.Ide.Tasks
(iteratingSeverity != tasks [n].Severity || !IsProjectTaskFile (tasks [n])))
n++;
- Task ct = n != -1 && n < tasks.Count ? tasks [n] : null;
+ TaskListEntry ct = n != -1 && n < tasks.Count ? tasks [n] : null;
if (ct == null) {
if (iteratingSeverity != TaskSeverity.Comment) {
iteratingSeverity++;
@@ -432,7 +441,7 @@ namespace MonoDevelop.Ide.Tasks
/// <summary>
/// Determines whether the task's file should be opened automatically when jumping to the next error.
/// </summary>
- public static bool IsProjectTaskFile (Task t)
+ public static bool IsProjectTaskFile (TaskListEntry t)
{
if (t.FileName.IsNullOrEmpty)
return false;
@@ -480,7 +489,7 @@ namespace MonoDevelop.Ide.Tasks
while (n != -1 && n < tasks.Count && (iteratingSeverity != tasks [n].Severity || string.IsNullOrEmpty (tasks [n].FileName)))
n--;
- Task ct = n != -1 && n < tasks.Count ? tasks [n] : null;
+ TaskListEntry ct = n != -1 && n < tasks.Count ? tasks [n] : null;
if (ct == null) {
if (iteratingSeverity != TaskSeverity.Error) {
iteratingSeverity--;
@@ -503,7 +512,7 @@ namespace MonoDevelop.Ide.Tasks
}
}
- int IndexOfTask (Task t)
+ int IndexOfTask (TaskListEntry t)
{
for (int n=0; n<tasks.Count; n++) {
if (tasks [n] == t)
@@ -517,26 +526,26 @@ namespace MonoDevelop.Ide.Tasks
}
#endregion
- }
+ }
public delegate void TaskEventHandler (object sender, TaskEventArgs e);
public class TaskEventArgs : EventArgs
{
- IEnumerable<Task> tasks;
+ IEnumerable<TaskListEntry> tasks;
- public TaskEventArgs (Task task) : this (new Task[] { task })
+ public TaskEventArgs (TaskListEntry task) : this (new TaskListEntry[] { task })
{
}
- public TaskEventArgs (IEnumerable<Task> tasks)
+ public TaskEventArgs (IEnumerable<TaskListEntry> tasks)
{
this.tasks = tasks;
}
- public IEnumerable<Task> Tasks
+ public IEnumerable<TaskListEntry> Tasks
{
get { return tasks; }
}
}
-}
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs
index 2b58dfc474..cc801626f4 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs
@@ -66,15 +66,15 @@ namespace MonoDevelop.Ide.Tasks
public UserTasksView ()
{
- highPrioColor = StringToColor ((string)PropertyService.Get ("Monodevelop.UserTasksHighPrioColor", ""));
- normalPrioColor = StringToColor ((string)PropertyService.Get ("Monodevelop.UserTasksNormalPrioColor", ""));
- lowPrioColor = StringToColor ((string)PropertyService.Get ("Monodevelop.UserTasksLowPrioColor", ""));
+ highPrioColor = StringToColor (IdeApp.Preferences.UserTasksHighPrioColor);
+ normalPrioColor = StringToColor (IdeApp.Preferences.UserTasksNormalPrioColor);
+ lowPrioColor = StringToColor (IdeApp.Preferences.UserTasksLowPrioColor);
store = new ListStore (
typeof (string), // priority
typeof (bool), // completed
typeof (string), // desc
- typeof (Task), // user task
+ typeof (TaskListEntry), // user task
typeof (Gdk.Color), // foreground color
typeof (int)); // font style
@@ -109,35 +109,38 @@ namespace MonoDevelop.Ide.Tasks
newButton = new Button ();
newButton.Label = GettextCatalog.GetString ("New Task");
- newButton.Image = new Gtk.Image (Gtk.Stock.New, IconSize.Button);
+ newButton.Image = new ImageView (Gtk.Stock.New, IconSize.Menu);
newButton.Image.Show ();
newButton.Clicked += new EventHandler (NewUserTaskClicked);
newButton.TooltipText = GettextCatalog.GetString ("Create New Task");
copyButton = new Button ();
copyButton.Label = GettextCatalog.GetString ("Copy Task");
- copyButton.Image = new Gtk.Image (Gtk.Stock.Copy, IconSize.Button);
+ copyButton.Image = new ImageView (Gtk.Stock.Copy, IconSize.Menu);
copyButton.Image.Show ();
copyButton.Clicked += CopyUserTaskClicked;
copyButton.TooltipText = GettextCatalog.GetString ("Copy Task Description");
delButton = new Button ();
delButton.Label = GettextCatalog.GetString ("Delete Task");
- delButton.Image = new Gtk.Image (Gtk.Stock.Delete, IconSize.Button);
+ delButton.Image = new ImageView (Gtk.Stock.Delete, IconSize.Menu);
delButton.Image.Show ();
delButton.Clicked += new EventHandler (DeleteUserTaskClicked);
delButton.TooltipText = GettextCatalog.GetString ("Delete Task");
- TaskService.UserTasks.TasksChanged += DispatchService.GuiDispatch<TaskEventHandler> (UserTasksChanged);
- TaskService.UserTasks.TasksAdded += DispatchService.GuiDispatch<TaskEventHandler> (UserTasksChanged);
- TaskService.UserTasks.TasksRemoved += DispatchService.GuiDispatch<TaskEventHandler> (UserTasksChanged);
+ TaskService.UserTasks.TasksChanged += UserTasksChanged;
+ TaskService.UserTasks.TasksAdded += UserTasksChanged;
+ TaskService.UserTasks.TasksRemoved += UserTasksChanged;
if (IdeApp.Workspace.IsOpen)
solutionLoaded = true;
IdeApp.Workspace.FirstWorkspaceItemOpened += CombineOpened;
IdeApp.Workspace.LastWorkspaceItemClosed += CombineClosed;
- PropertyService.PropertyChanged += DispatchService.GuiDispatch<EventHandler<PropertyChangedEventArgs>> (OnPropertyUpdated);
+
+ IdeApp.Preferences.UserTasksLowPrioColor.Changed += OnPropertyUpdated;
+ IdeApp.Preferences.UserTasksNormalPrioColor.Changed += OnPropertyUpdated;
+ IdeApp.Preferences.UserTasksHighPrioColor.Changed += OnPropertyUpdated;
ValidateButtons ();
// Initialize with existing tags.
@@ -165,41 +168,26 @@ namespace MonoDevelop.Ide.Tasks
view.ScrollToPoint (0, 0);
store.Clear ();
- foreach (Task task in TaskService.UserTasks) {
+ foreach (TaskListEntry task in TaskService.UserTasks) {
store.AppendValues (GettextCatalog.GetString (Enum.GetName (typeof (TaskPriority), task.Priority)), task.Completed, task.Description, task, GetColorByPriority (task.Priority), task.Completed ? (int)Pango.Weight.Light : (int)Pango.Weight.Bold);
}
ValidateButtons ();
}
- void OnPropertyUpdated (object sender, PropertyChangedEventArgs e)
+ void OnPropertyUpdated (object sender, EventArgs e)
{
- bool change = false;
- if (e.Key == "Monodevelop.UserTasksHighPrioColor" && e.NewValue != e.OldValue)
- {
- highPrioColor = StringToColor ((string)e.NewValue);
- change = true;
- }
- if (e.Key == "Monodevelop.UserTasksNormalPrioColor" && e.NewValue != e.OldValue)
- {
- normalPrioColor = StringToColor ((string)e.NewValue);
- change = true;
- }
- if (e.Key == "Monodevelop.UserTasksLowPrioColor" && e.NewValue != e.OldValue)
- {
- lowPrioColor = StringToColor ((string)e.NewValue);
- change = true;
- }
- if (change)
+ highPrioColor = StringToColor (IdeApp.Preferences.UserTasksHighPrioColor);
+ normalPrioColor = StringToColor (IdeApp.Preferences.UserTasksNormalPrioColor);
+ lowPrioColor = StringToColor (IdeApp.Preferences.UserTasksLowPrioColor);
+
+ TreeIter iter;
+ if (store.GetIterFirst (out iter))
{
- TreeIter iter;
- if (store.GetIterFirst (out iter))
+ do
{
- do
- {
- Task task = (Task) store.GetValue (iter, (int)Columns.UserTask);
- store.SetValue (iter, (int)Columns.Foreground, GetColorByPriority (task.Priority));
- } while (store.IterNext (ref iter));
- }
+ TaskListEntry task = (TaskListEntry) store.GetValue (iter, (int)Columns.UserTask);
+ store.SetValue (iter, (int)Columns.Foreground, GetColorByPriority (task.Priority));
+ } while (store.IterNext (ref iter));
}
}
@@ -216,7 +204,7 @@ namespace MonoDevelop.Ide.Tasks
void NewUserTaskClicked (object obj, EventArgs e)
{
- Task task = new Task ();
+ TaskListEntry task = new TaskListEntry ();
task.WorkspaceObject = IdeApp.ProjectOperations.CurrentSelectedWorkspaceItem;
updating = true;
TaskService.UserTasks.Add (task);
@@ -231,13 +219,13 @@ namespace MonoDevelop.Ide.Tasks
void CopyUserTaskClicked (object o, EventArgs args)
{
- Task task;
+ TaskListEntry task;
TreeModel model;
TreeIter iter;
if (view.Selection.GetSelected (out model, out iter))
{
- task = (Task) model.GetValue (iter, (int)Columns.UserTask);
+ task = (TaskListEntry) model.GetValue (iter, (int)Columns.UserTask);
}
else return; // no one selected
@@ -255,7 +243,7 @@ namespace MonoDevelop.Ide.Tasks
TreeIter iter;
if (store.GetIter (out iter, view.Selection.GetSelectedRows ()[0]))
{
- Task task = (Task) store.GetValue (iter, (int)Columns.UserTask);
+ TaskListEntry task = (TaskListEntry) store.GetValue (iter, (int)Columns.UserTask);
updating = true;
TaskService.UserTasks.Remove (task);
updating = false;
@@ -264,12 +252,14 @@ namespace MonoDevelop.Ide.Tasks
}
}
}
-
+
void UserTaskPriorityEdited (object o, ComboSelectionChangedArgs args)
{
- Gtk.TreeIter iter;
- if (store.GetIterFromString (out iter, args.Path)) {
- Task task = (Task) store.GetValue (iter, (int)Columns.UserTask);
+ Gtk.TreeIter iter, sortedIter;
+
+ if (sortModel.GetIterFromString (out sortedIter, args.Path)) {
+ iter = sortModel.ConvertIterToChildIter (sortedIter);
+ TaskListEntry task = (TaskListEntry) sortModel.GetValue (sortedIter, (int)Columns.UserTask);
if (args.Active == 0)
{
task.Priority = TaskPriority.High;
@@ -288,10 +278,12 @@ namespace MonoDevelop.Ide.Tasks
void UserTaskCompletedToggled (object o, ToggledArgs args)
{
- Gtk.TreeIter iter;
- if (store.GetIterFromString (out iter, args.Path)) {
- bool val = (bool)store.GetValue (iter, (int)Columns.Completed);
- Task task = (Task) store.GetValue (iter, (int)Columns.UserTask);
+ Gtk.TreeIter iter, sortedIter;
+
+ if (sortModel.GetIterFromString (out sortedIter, args.Path)) {
+ iter = sortModel.ConvertIterToChildIter (sortedIter);
+ bool val = (bool)sortModel.GetValue (sortedIter, (int)Columns.Completed);
+ TaskListEntry task = (TaskListEntry) sortModel.GetValue (sortedIter, (int)Columns.UserTask);
task.Completed = !val;
store.SetValue (iter, (int)Columns.Completed, !val);
store.SetValue (iter, (int)Columns.Bold, task.Completed ? (int)Pango.Weight.Light : (int)Pango.Weight.Bold);
@@ -301,9 +293,11 @@ namespace MonoDevelop.Ide.Tasks
void UserTaskDescEdited (object o, EditedArgs args)
{
- Gtk.TreeIter iter;
- if (store.GetIterFromString (out iter, args.Path)) {
- Task task = (Task) store.GetValue (iter, (int)Columns.UserTask);
+ Gtk.TreeIter iter, sortedIter;
+
+ if (sortModel.GetIterFromString (out sortedIter, args.Path)) {
+ iter = sortModel.ConvertIterToChildIter (sortedIter);
+ TaskListEntry task = (TaskListEntry) sortModel.GetValue (sortedIter, (int)Columns.UserTask);
task.Description = args.NewText;
store.SetValue (iter, (int)Columns.Description, args.NewText);
TaskService.SaveUserTasks (task.WorkspaceObject);
@@ -356,8 +350,8 @@ namespace MonoDevelop.Ide.Tasks
}
#region ITaskListView members
- TreeView ITaskListView.Content { get { return view; } }
- Widget[] ITaskListView.ToolBarItems { get { return new Widget[] { newButton, delButton, copyButton }; } }
+ Control ITaskListView.Content { get { return view; } }
+ Control[] ITaskListView.ToolBarItems { get { return new Control[] { newButton, delButton, copyButton }; } }
#endregion
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs
index 3a57928536..90fb04d2fc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CodeDomFileDescriptionTemplate.cs
@@ -35,8 +35,8 @@ using System.CodeDom.Compiler;
using MonoDevelop.Projects;
-using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Core;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Ide.Templates
{
@@ -61,7 +61,7 @@ namespace MonoDevelop.Ide.Templates
if (language == null || language == "")
throw new InvalidOperationException ("Language not defined in CodeDom based template.");
- IDotNetLanguageBinding binding = GetLanguageBinding (language) as IDotNetLanguageBinding;
+ var binding = GetLanguageBinding (language);
CodeDomProvider provider = null;
if (binding != null)
@@ -89,9 +89,9 @@ namespace MonoDevelop.Ide.Templates
static string StripHeaderAndBlankLines (string text, CodeDomProvider provider)
{
- Mono.TextEditor.TextDocument doc = new Mono.TextEditor.TextDocument ();
+ var doc = TextEditorFactory.CreateNewDocument ();
doc.Text = text;
- int realStartLine = 0;
+ int realStartLine = 1;
for (int i = 1; i <= doc.LineCount; i++) {
string lineText = doc.GetTextAt (doc.GetLine (i));
// Microsoft.NET generates "auto-generated" tags where Mono generates "autogenerated" tags.
@@ -106,20 +106,20 @@ namespace MonoDevelop.Ide.Templates
// We reformat the C# generated output to the user's coding style anyway, but the reformatter preserves blank lines
if (provider is Microsoft.CSharp.CSharpCodeProvider) {
for (int i = 1; i <= doc.LineCount; i++) {
- Mono.TextEditor.DocumentLine line = doc.GetLine (i);
+ var line = doc.GetLine (i);
if (IsBlankLine (doc, line) && line.LengthIncludingDelimiter > 0) {
- doc.Remove (line.Offset, line.LengthIncludingDelimiter);
+ doc.RemoveText (line.Offset, line.LengthIncludingDelimiter);
i--;
continue;
}
}
}
- int offset = doc.GetLine (Math.Max(Mono.TextEditor.DocumentLocation.MinLine, realStartLine)).Offset;
- return doc.GetTextAt (offset, doc.TextLength - offset);
+ int offset = doc.GetLine (realStartLine).Offset;
+ return doc.GetTextAt (offset, doc.Length - offset);
}
- static bool IsBlankLine (Mono.TextEditor.TextDocument doc, Mono.TextEditor.DocumentLine line)
+ static bool IsBlankLine (IReadonlyTextDocument doc, IDocumentLine line)
{
for (int i = 0; i < line.Length; i++) {
if (!Char.IsWhiteSpace (doc.GetCharAt (line.Offset + i)))
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs
index f641faee66..c410fe43c8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CodeTranslationFileDescriptionTemplate.cs
@@ -134,7 +134,7 @@ namespace MonoDevelop.Ide.Templates
return txt.Substring (i+1);
}
- public override void ModifyTags (SolutionItem policyParent, Project project, string language, string identifier, string fileName, ref Dictionary<string,string> tags)
+ public override void ModifyTags (SolutionFolderItem policyParent, Project project, string language, string identifier, string fileName, ref Dictionary<string,string> tags)
{
//prevent parser breakage from missing tags, which SingleFile only provides for DotNetProject
//if ((project as DotNetProject) == null)
@@ -156,7 +156,7 @@ namespace MonoDevelop.Ide.Templates
private System.CodeDom.Compiler.CodeDomProvider GetCodeDomProvider (string language)
{
System.CodeDom.Compiler.CodeDomProvider provider = null;
- IDotNetLanguageBinding binding = GetLanguageBinding (language) as IDotNetLanguageBinding;
+ var binding = GetLanguageBinding (language);
if (binding == null)
throw new InvalidOperationException ("No LanguageBinding was found for the language '" + language + "'.");
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CombinedTagModel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CombinedTagModel.cs
new file mode 100644
index 0000000000..dd598b3064
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/CombinedTagModel.cs
@@ -0,0 +1,54 @@
+//
+// CombinedTagModel.cs
+//
+// Author:
+// Vincent Dondain <vincent@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using MonoDevelop.Core.StringParsing;
+using MonoDevelop.Projects;
+
+namespace MonoDevelop.Ide.Templates
+{
+ class CombinedTagModel : IStringTagModel
+ {
+ public IStringTagModel BaseModel;
+ public Dictionary<string, string> OverrideTags = new Dictionary<string, string> (StringComparer.OrdinalIgnoreCase);
+
+ public object GetValue (string name)
+ {
+ string val;
+ if (OverrideTags.TryGetValue (name, out val))
+ return val;
+ return BaseModel != null ? BaseModel.GetValue (name) : null;
+ }
+
+ public static CombinedTagModel GetTagModel (IStringTagModel projectTagModel, SolutionFolderItem policyParent, Project project, string language, string identifier, string fileName)
+ {
+ var model = new CombinedTagModel { BaseModel = projectTagModel };
+ FileTemplateTagsModifier.ModifyTags (policyParent, project, language, identifier, fileName, ref model.OverrideTags);
+ return model;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/DirectoryTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/DirectoryTemplate.cs
index 3b056b2667..be481a9ca5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/DirectoryTemplate.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/DirectoryTemplate.cs
@@ -85,7 +85,7 @@ namespace MonoDevelop.Ide.Templates
t.Show ();
}
- public override bool AddToProject (SolutionItem policyParent, Project project,
+ public override bool AddToProject (SolutionFolderItem policyParent, Project project,
string language, string directory, string name)
{
bool addedSomething = false;
@@ -97,7 +97,8 @@ namespace MonoDevelop.Ide.Templates
}
foreach (FileDescriptionTemplate t in templates) {
- addedSomething |= t.AddToProject (policyParent, project, language, directory, name);
+ if (t.EvaluateCreateCondition ())
+ addedSomething |= t.AddToProject (policyParent, project, language, directory, name);
}
return addedSomething;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs
index d202a07abd..4d6b1fe1ba 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileDescriptionTemplate.cs
@@ -73,7 +73,7 @@ namespace MonoDevelop.Ide.Templates
public abstract string Name { get; }
public abstract void Load (XmlElement filenode, FilePath baseDirectory);
- public abstract bool AddToProject (SolutionItem policyParent, Project project, string language, string directory, string name);
+ public abstract bool AddToProject (SolutionFolderItem policyParent, Project project, string language, string directory, string name);
public abstract void Show ();
internal string CreateCondition { get; private set; }
@@ -112,5 +112,10 @@ namespace MonoDevelop.Ide.Templates
{
ProjectTagModel = tagModel;
}
+
+ internal bool EvaluateCreateCondition ()
+ {
+ return TemplateConditionEvaluator.EvaluateCondition (ProjectTagModel, CreateCondition);
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplate.cs
index c120b9a57b..c7981a49b7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplate.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplate.cs
@@ -46,7 +46,9 @@ namespace MonoDevelop.Ide.Templates
{
class FileTemplate
{
- public string Category { get; private set; } = String.Empty;
+ public const string DefaultCategoryKey = "DefaultKey";
+
+ public Dictionary<string, string> Categories { get; private set; } = new Dictionary<string, string> ();
public List<FileTemplateCondition> Conditions { get; private set; } = new List<FileTemplateCondition> ();
@@ -74,15 +76,17 @@ namespace MonoDevelop.Ide.Templates
public string Originator { get; private set; } = String.Empty;
- public string ProjectType { get; private set; } = String.Empty;
+ public List<string> ProjectTypes { get; private set; } = new List<string> ();
public string WizardPath { get; private set; } = String.Empty;
static FileTemplate LoadFileTemplate (RuntimeAddin addin, ProjectTemplateCodon codon)
{
- XmlDocument xmlDocument = codon.GetTemplate ();
- FilePath baseDirectory = codon.BaseDirectory;
-
+ return LoadFileTemplate (addin, codon.GetTemplate (), codon.BaseDirectory, codon.Id);
+ }
+
+ internal static FileTemplate LoadFileTemplate (RuntimeAddin addin, XmlDocument xmlDocument, FilePath baseDirectory = new FilePath (), string templateId = "")
+ {
//Configuration
XmlElement xmlNodeConfig = xmlDocument.DocumentElement ["TemplateConfiguration"];
@@ -104,13 +108,7 @@ namespace MonoDevelop.Ide.Templates
if (xmlNodeConfig ["_Name"] != null) {
fileTemplate.Name = xmlNodeConfig ["_Name"].InnerText;
} else {
- throw new InvalidOperationException (string.Format ("Missing element '_Name' in file template: {0}", codon.Id));
- }
-
- if (xmlNodeConfig ["_Category"] != null) {
- fileTemplate.Category = xmlNodeConfig ["_Category"].InnerText;
- } else {
- throw new InvalidOperationException (string.Format ("Missing element '_Category' in file template: {0}", codon.Id));
+ throw new InvalidOperationException (string.Format ("Missing element '_Name' in file template: {0}", templateId));
}
if (xmlNodeConfig ["LanguageName"] != null) {
@@ -118,7 +116,28 @@ namespace MonoDevelop.Ide.Templates
}
if (xmlNodeConfig ["ProjectType"] != null) {
- fileTemplate.ProjectType = xmlNodeConfig ["ProjectType"].InnerText;
+ var projectTypeList = new List<string> ();
+ foreach (var item in xmlNodeConfig["ProjectType"].InnerText.Split (','))
+ projectTypeList.Add (item.Trim ());
+ fileTemplate.ProjectTypes = projectTypeList;
+ }
+
+ fileTemplate.Categories = new Dictionary<string, string> ();
+ if (xmlNodeConfig ["_Category"] != null) {
+ foreach (XmlNode xmlNode in xmlNodeConfig.GetElementsByTagName ("_Category")) {
+ if (xmlNode is XmlElement) {
+ string projectType = "";
+ if (xmlNode.Attributes ["projectType"] != null)
+ projectType = xmlNode.Attributes ["projectType"].Value;
+
+ if (!string.IsNullOrEmpty (projectType) && fileTemplate.ProjectTypes.Contains (projectType))
+ fileTemplate.Categories.Add (projectType, xmlNode.InnerText);
+ else if (!fileTemplate.Categories.ContainsKey (DefaultCategoryKey))
+ fileTemplate.Categories.Add (DefaultCategoryKey, xmlNode.InnerText);
+ }
+ }
+ } else {
+ throw new InvalidOperationException (string.Format ("Missing element '_Category' in file template: {0}", templateId));
}
if (xmlNodeConfig ["_Description"] != null) {
@@ -226,7 +245,7 @@ namespace MonoDevelop.Ide.Templates
return null;
}
- public virtual bool Create (SolutionItem policyParent, Project project, string directory, string language, string name)
+ public virtual bool Create (SolutionFolderItem policyParent, Project project, string directory, string language, string name)
{
if (!String.IsNullOrEmpty (WizardPath)) {
return false;
@@ -266,7 +285,7 @@ namespace MonoDevelop.Ide.Templates
return mimeType;
}
- public virtual bool CanCreateUnsavedFiles (FileDescriptionTemplate newfile, SolutionItem policyParent, Project project, string directory, string language, string name)
+ public virtual bool CanCreateUnsavedFiles (FileDescriptionTemplate newfile, SolutionFolderItem policyParent, Project project, string directory, string language, string name)
{
if (project != null) {
return true;
@@ -285,7 +304,7 @@ namespace MonoDevelop.Ide.Templates
}
}
- protected virtual bool CreateFile (FileDescriptionTemplate newfile, SolutionItem policyParent, Project project, string directory, string language, string name)
+ protected virtual bool CreateFile (FileDescriptionTemplate newfile, SolutionFolderItem policyParent, Project project, string directory, string language, string name)
{
if (project != null) {
var model = project.GetStringTagModel (new DefaultConfigurationSelector ());
@@ -337,7 +356,8 @@ namespace MonoDevelop.Ide.Templates
//filter on conditions
if (project != null) {
- if (!string.IsNullOrEmpty (ProjectType) && project.GetProjectTypes ().All (p => p != ProjectType))
+ // When file template's project types don't match the current project's type.
+ if (ProjectTypes.Any () && project.GetTypeTags ().All (p => !ProjectTypes.Contains (p)))
return false;
foreach (FileTemplateCondition condition in Conditions)
@@ -419,9 +439,8 @@ namespace MonoDevelop.Ide.Templates
//Template can match all CodeDom .NET languages with a "*"
if (list.Contains ("*")) {
foreach (var lb in LanguageBindingService.LanguageBindings) {
- var dnlang = lb as IDotNetLanguageBinding;
- if (dnlang != null && dnlang.GetCodeDomProvider () != null)
- list.Add (dnlang.Language);
+ if (lb.GetCodeDomProvider () != null)
+ list.Add (lb.Language);
list.Remove ("*");
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplateReference.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplateReference.cs
index ed75d0bad3..f815ec1c8c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplateReference.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplateReference.cs
@@ -67,7 +67,7 @@ namespace MonoDevelop.Ide.Templates
get { return name;}
}
- public override bool AddToProject (SolutionItem policyParent, Project project, string language, string directory, string entryName)
+ public override bool AddToProject (SolutionFolderItem policyParent, Project project, string language, string directory, string entryName)
{
string[,] customTags = new string[,] {
{"ProjectName", project.Name},
@@ -78,8 +78,10 @@ namespace MonoDevelop.Ide.Templates
string substName = StringParserService.Parse (this.name, customTags);
foreach (FileDescriptionTemplate fdt in innerTemplate.Files) {
- if (!fdt.AddToProject (policyParent, project, language, directory, substName))
- return false;
+ if (fdt.EvaluateCreateCondition ()) {
+ if (!fdt.AddToProject (policyParent, project, language, directory, substName))
+ return false;
+ }
}
return true;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplateTagsModifier.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplateTagsModifier.cs
new file mode 100644
index 0000000000..37bd3d2671
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplateTagsModifier.cs
@@ -0,0 +1,121 @@
+//
+// FileTemplateTagsModifier.cs
+//
+// Author:
+// Vincent Dondain <vincent.dondain@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Projects;
+using System.Collections.Generic;
+using System.IO;
+using MonoDevelop.Core;
+using System.Text;
+
+namespace MonoDevelop.Ide.Templates
+{
+ static class FileTemplateTagsModifier
+ {
+ internal static void ModifyTags (SolutionFolderItem policyParent, Project project, string language, string identifier, string fileName, ref Dictionary<string,string> tags)
+ {
+ //DotNetProject netProject = project as DotNetProject;
+ string languageExtension = "";
+ LanguageBinding binding = null;
+ if (!string.IsNullOrEmpty (language)) {
+ binding = SingleFileDescriptionTemplate.GetLanguageBinding (language);
+ if (binding != null)
+ languageExtension = Path.GetExtension (binding.GetFileName ("Default")).Remove (0, 1);
+ }
+
+ //need a default namespace or if there is no project, substitutions can get very messed up
+ string ns;
+ var dotNetFileContainer = project as IDotNetFileContainer;
+ ns = dotNetFileContainer != null ? dotNetFileContainer.GetDefaultNamespace (fileName) : "Application";
+
+ //need an 'identifier' for tag substitution, e.g. class name or page name
+ //if not given an identifier, use fileName
+ if ((identifier == null) && (fileName != null))
+ identifier = Path.GetFileName (fileName);
+
+ if (identifier != null) {
+ //remove all extensions
+ while (Path.GetExtension (identifier).Length > 0)
+ identifier = Path.GetFileNameWithoutExtension (identifier);
+ identifier = CreateIdentifierName (identifier);
+ tags ["Name"] = identifier;
+ tags ["FullName"] = ns.Length > 0 ? ns + "." + identifier : identifier;
+
+ //some .NET languages may be able to use keywords as identifiers if they're escaped
+ if (binding != null) {
+ System.CodeDom.Compiler.CodeDomProvider provider = binding.GetCodeDomProvider ();
+ if (provider != null) {
+ tags ["EscapedIdentifier"] = provider.CreateEscapedIdentifier (identifier);
+ }
+ }
+ }
+
+ tags ["Namespace"] = ns;
+ if (policyParent != null)
+ tags ["SolutionName"] = policyParent.Name;
+ if (project != null) {
+ tags ["ProjectName"] = project.Name;
+ tags ["SafeProjectName"] = CreateIdentifierName (project.Name);
+ var info = project.AuthorInformation ?? AuthorInformation.Default;
+ tags ["AuthorCopyright"] = info.Copyright;
+ tags ["AuthorCompany"] = info.Company;
+ tags ["AuthorTrademark"] = info.Trademark;
+ tags ["AuthorEmail"] = info.Email;
+ tags ["AuthorName"] = info.Name;
+ }
+ if ((language != null) && (language.Length > 0))
+ tags ["Language"] = language;
+ if (languageExtension.Length > 0)
+ tags ["LanguageExtension"] = languageExtension;
+
+ if (fileName != FilePath.Null) {
+ FilePath fileDirectory = Path.GetDirectoryName (fileName);
+ if (project != null && project.BaseDirectory != FilePath.Null && fileDirectory.IsChildPathOf (project.BaseDirectory))
+ tags ["ProjectRelativeDirectory"] = fileDirectory.ToRelative (project.BaseDirectory);
+ else
+ tags ["ProjectRelativeDirectory"] = fileDirectory;
+
+ tags ["FileNameWithoutExtension"] = Path.GetFileNameWithoutExtension (fileName);
+ tags ["Directory"] = fileDirectory;
+ tags ["FileName"] = fileName;
+ }
+ }
+
+ static string CreateIdentifierName (string identifier)
+ {
+ var result = new StringBuilder ();
+ for (int i = 0; i < identifier.Length; i++) {
+ char ch = identifier[i];
+ if (i != 0 && Char.IsLetterOrDigit (ch) || i == 0 && Char.IsLetter (ch) || ch == '_') {
+ result.Append (ch);
+ } else {
+ result.Append ('_');
+ }
+ }
+ return result.ToString ();
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ISolutionItemDescriptor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ISolutionItemDescriptor.cs
index 9012f7b9ba..13d6804573 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ISolutionItemDescriptor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ISolutionItemDescriptor.cs
@@ -34,7 +34,7 @@ namespace MonoDevelop.Ide.Templates
{
internal interface ISolutionItemDescriptor
{
- SolutionEntityItem CreateItem (ProjectCreateInformation projectCreateInformation, string defaultLanguage);
- void InitializeItem (SolutionItem policyParent, ProjectCreateInformation projectCreateInformation, string defaultLanguage, SolutionEntityItem item);
+ SolutionItem CreateItem (ProjectCreateInformation projectCreateInformation, string defaultLanguage);
+ void InitializeItem (SolutionFolderItem policyParent, ProjectCreateInformation projectCreateInformation, string defaultLanguage, SolutionItem item);
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ParentProjectFileTemplateCondition.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ParentProjectFileTemplateCondition.cs
index 741a8b25de..769e896f5e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ParentProjectFileTemplateCondition.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ParentProjectFileTemplateCondition.cs
@@ -84,7 +84,7 @@ namespace MonoDevelop.Ide.Templates
if (proj == null)
return !requireExists;
- if (projectType != null && proj.GetProjectTypes ().All (p => p != projectType))
+ if (projectType != null && proj.GetTypeTags ().All (p => p != projectType))
return false;
//check for permitted creation paths
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectCreateInformationExtensions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectCreateInformationExtensions.cs
new file mode 100644
index 0000000000..df16a37a0d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectCreateInformationExtensions.cs
@@ -0,0 +1,40 @@
+//
+// ProjectCreateInformationExtensions.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using MonoDevelop.Projects;
+
+namespace MonoDevelop.Ide.Templates
+{
+ static class ProjectCreateInformationExtensions
+ {
+ public static bool ShouldCreate (this ProjectCreateInformation projectCreateInformation, string condition)
+ {
+ return TemplateConditionEvaluator.EvaluateCondition (projectCreateInformation.Parameters, condition);
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectDescriptor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectDescriptor.cs
index 48b6fbf8eb..78a24d98b3 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectDescriptor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectDescriptor.cs
@@ -34,6 +34,7 @@ using System.IO;
using System.Collections.Generic;
using System.Xml;
using System.Linq;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.Ide.Templates
@@ -65,8 +66,6 @@ namespace MonoDevelop.Ide.Templates
projectDescriptor.createCondition = xmlElement.GetAttribute ("if");
projectDescriptor.type = xmlElement.GetAttribute ("type");
- if (String.IsNullOrEmpty (projectDescriptor.type))
- projectDescriptor.type = "DotNet";
if (xmlElement ["Files"] != null) {
foreach (XmlNode xmlNode in xmlElement["Files"].ChildNodes)
@@ -110,24 +109,39 @@ namespace MonoDevelop.Ide.Templates
return projectDescriptor;
}
- public SolutionEntityItem CreateItem (ProjectCreateInformation projectCreateInformation, string defaultLanguage)
+ public SolutionItem CreateItem (ProjectCreateInformation projectCreateInformation, string defaultLanguage)
{
if (string.IsNullOrEmpty (projectOptions.GetAttribute ("language")) && !string.IsNullOrEmpty (defaultLanguage))
projectOptions.SetAttribute ("language", defaultLanguage);
- if (!Services.ProjectService.CanCreateProject (type)) {
- LoggingService.LogError ("Could not create project of type '" + type + "'. Project skipped");
+ var lang = projectOptions.GetAttribute ("language");
+ var splitType = !string.IsNullOrEmpty (type) ? type.Split (new char [] {','}, StringSplitOptions.RemoveEmptyEntries).Select (t => t.Trim()).ToArray() : null;
+ var projectTypes = splitType != null ? splitType : new string[] {lang};
+
+ var projectType = projectTypes [0];
+
+ string[] flavors;
+
+ if (!Services.ProjectService.CanCreateSolutionItem (projectType, projectCreateInformation, projectOptions) && projectType != lang && !string.IsNullOrEmpty (lang)) {
+ // Maybe the type of the template is just a flavor id. In that case try using the language as project type.
+ projectType = lang;
+ flavors = splitType ?? new string[0];
+ } else
+ flavors = projectTypes.Skip (1).ToArray ();
+
+ if (!Services.ProjectService.CanCreateSolutionItem (projectType, projectCreateInformation, projectOptions)) {
+ LoggingService.LogError ("Could not create project of type '" + string.Join (",", projectTypes) + "'. Project skipped");
return null;
}
if (!ShouldCreateProject (projectCreateInformation))
return null;
- Project project = Services.ProjectService.CreateProject (type, projectCreateInformation, projectOptions);
+ Project project = Services.ProjectService.CreateProject (projectType, projectCreateInformation, projectOptions, flavors);
return project;
}
- public void InitializeItem (SolutionItem policyParent, ProjectCreateInformation projectCreateInformation, string defaultLanguage, SolutionEntityItem item)
+ public void InitializeItem (SolutionFolderItem policyParent, ProjectCreateInformation projectCreateInformation, string defaultLanguage, SolutionItem item)
{
MonoDevelop.Projects.Project project = item as MonoDevelop.Projects.Project;
@@ -148,13 +162,14 @@ namespace MonoDevelop.Ide.Templates
var substitution = new string[,] { { "ProjectName", GetProjectNameForSubstitution (projectCreateInformation) } };
foreach (var desc in references) {
if (!projectCreateInformation.ShouldCreate (desc.CreateCondition))
- continue;
- if (desc.ProjectReference.ReferenceType == ReferenceType.Project) {
- string referencedProjectName = ReplaceParameters (desc.ProjectReference.Reference, substitution, projectCreateInformation);
- var parsedReference = ProjectReference.RenameReference (desc.ProjectReference, referencedProjectName);
+ continue;
+ var pr = desc.Create ();
+ if (pr.ReferenceType == ReferenceType.Project) {
+ string referencedProjectName = ReplaceParameters (pr.Reference, substitution, projectCreateInformation);
+ var parsedReference = ProjectReference.RenameReference (pr, referencedProjectName);
dnp.References.Add (parsedReference);
} else
- dnp.References.Add (desc.ProjectReference);
+ dnp.References.Add (pr);
}
}
@@ -203,7 +218,7 @@ namespace MonoDevelop.Ide.Templates
return StringParserService.Parse (updatedText, projectCreateInformation.Parameters);
}
- static void SetClosestSupportedTargetFramework (FileFormat format, DotNetProject project)
+ static void SetClosestSupportedTargetFramework (MSBuildFileFormat format, DotNetProject project)
{
// If the solution format can't write this project due to an unsupported framework, try finding the
// closest valid framework. DOn't worry about whether it's installed, that's up to the user to correct.
@@ -278,23 +293,42 @@ namespace MonoDevelop.Ide.Templates
class ProjectReferenceDescription
{
+ XmlElement elem;
+
public ProjectReferenceDescription (XmlElement elem)
{
+ this.elem = elem;
CreateCondition = elem.GetAttribute ("if");
+ }
+
+ public ProjectReference Create ()
+ {
var refType = elem.GetAttribute ("type");
- ProjectReference = new ProjectReference ((ReferenceType)Enum.Parse (typeof(ReferenceType), refType), elem.GetAttribute ("refto"));
+ var projectReference = ProjectReference.CreateCustomReference ((ReferenceType)Enum.Parse (typeof(ReferenceType), refType), elem.GetAttribute ("refto"));
+ var hintPath = GetMSBuildReferenceHintPath ();
+ if (hintPath != null)
+ projectReference.Metadata.SetValue ("HintPath", hintPath);
+
string specificVersion = elem.GetAttribute ("SpecificVersion");
if (!string.IsNullOrEmpty (specificVersion))
- ProjectReference.SpecificVersion = bool.Parse (specificVersion);
+ projectReference.SpecificVersion = bool.Parse (specificVersion);
string localCopy = elem.GetAttribute ("LocalCopy");
- if (!string.IsNullOrEmpty (localCopy) && ProjectReference.CanSetLocalCopy)
- ProjectReference.LocalCopy = bool.Parse (localCopy);
+ if (!string.IsNullOrEmpty (localCopy) && projectReference.CanSetLocalCopy)
+ projectReference.LocalCopy = bool.Parse (localCopy);
string referenceOutputAssembly = elem.GetAttribute ("ReferenceOutputAssembly");
if (!string.IsNullOrEmpty (referenceOutputAssembly))
- ProjectReference.ReferenceOutputAssembly = bool.Parse (referenceOutputAssembly);
+ projectReference.ReferenceOutputAssembly = bool.Parse (referenceOutputAssembly);
+ return projectReference;
+ }
+
+ string GetMSBuildReferenceHintPath ()
+ {
+ string hintPath = elem.GetAttribute ("HintPath");
+ if (!string.IsNullOrEmpty (hintPath))
+ return hintPath;
+ return null;
}
- public ProjectReference ProjectReference { get; private set; }
public string CreateCondition { get; private set; }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs
index f4d02a4059..1c687a65a9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs
@@ -46,6 +46,7 @@ using MonoDevelop.Ide.Codons;
using MonoDevelop.Projects;
using MonoDevelop.Ide.Gui;
using System.Linq;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Templates
{
@@ -59,7 +60,6 @@ namespace MonoDevelop.Ide.Templates
private string createdSolutionName;
IList<PackageReferencesForCreatedProject> packageReferencesForCreatedProjects = new List<PackageReferencesForCreatedProject> ();
- private ProjectCreateInformation createdProjectInformation = null;
internal string CreatedSolutionName {
get { return createdSolutionName; }
@@ -306,26 +306,11 @@ namespace MonoDevelop.Ide.Templates
{
}
- //methods
- public IAsyncOperation OpenCreatedSolution ()
- {
- IAsyncOperation asyncOperation = IdeApp.Workspace.OpenWorkspaceItem (createdSolutionName);
- asyncOperation.Completed += delegate {
- if (asyncOperation.Success) {
- foreach (string action in actions) {
- IdeApp.Workbench.OpenDocument (Path.Combine (createdProjectInformation.ProjectBasePath, action));
- }
- }
- };
- return asyncOperation;
- }
-
public WorkspaceItem CreateWorkspaceItem (ProjectCreateInformation cInfo)
{
WorkspaceItemCreatedInformation workspaceItemInfo = solutionDescriptor.CreateEntry (cInfo, this.languagename);
this.createdSolutionName = workspaceItemInfo.WorkspaceItem.FileName;
- this.createdProjectInformation = cInfo;
this.packageReferencesForCreatedProjects = workspaceItemInfo.PackageReferencesForCreatedProjects;
var pDesc = this.solutionDescriptor.EntryDescriptors.OfType<ProjectDescriptor> ().ToList ();
@@ -340,19 +325,19 @@ namespace MonoDevelop.Ide.Templates
return workspaceItemInfo.WorkspaceItem;
}
- public IEnumerable<SolutionEntityItem> CreateProjects (SolutionItem policyParent, ProjectCreateInformation cInfo)
+ public IEnumerable<SolutionItem> CreateProjects (SolutionFolderItem policyParent, ProjectCreateInformation cInfo)
{
if (solutionDescriptor.EntryDescriptors.Length == 0)
throw new InvalidOperationException ("Solution template doesn't have any project templates");
- var solutionEntryItems = new List<SolutionEntityItem> ();
+ var solutionEntryItems = new List<SolutionItem> ();
packageReferencesForCreatedProjects = new List<PackageReferencesForCreatedProject> ();
foreach (ISolutionItemDescriptor solutionItemDescriptor in GetItemsToCreate (solutionDescriptor, cInfo)) {
ProjectCreateInformation itemCreateInfo = GetItemSpecificCreateInfo (solutionItemDescriptor, cInfo);
itemCreateInfo = new ProjectTemplateCreateInformation (itemCreateInfo, cInfo.ProjectName);
- SolutionEntityItem solutionEntryItem = solutionItemDescriptor.CreateItem (itemCreateInfo, this.languagename);
+ SolutionItem solutionEntryItem = solutionItemDescriptor.CreateItem (itemCreateInfo, this.languagename);
if (solutionEntryItem != null) {
solutionItemDescriptor.InitializeItem (policyParent, itemCreateInfo, this.languagename, solutionEntryItem);
@@ -370,8 +355,6 @@ namespace MonoDevelop.Ide.Templates
metadata ["Platform"] = pDesc != null ? pDesc.ProjectType : "Unknown";
TemplateCounter.Inc (1, null, metadata);
- createdProjectInformation = cInfo;
-
return solutionEntryItems;
}
@@ -396,7 +379,7 @@ namespace MonoDevelop.Ide.Templates
return cInfo;
}
- void SavePackageReferences (SolutionEntityItem solutionEntryItem, ISolutionItemDescriptor descriptor, ProjectCreateInformation cInfo)
+ void SavePackageReferences (SolutionItem solutionEntryItem, ISolutionItemDescriptor descriptor, ProjectCreateInformation cInfo)
{
if ((solutionEntryItem is Project) && (descriptor is ProjectDescriptor)) {
var projectPackageReferences = new PackageReferencesForCreatedProject (((Project)solutionEntryItem).Name, ((ProjectDescriptor)descriptor).GetPackageReferences (cInfo));
@@ -439,9 +422,8 @@ namespace MonoDevelop.Ide.Templates
//Template can match all CodeDom .NET languages with a "*"
if (list.Contains ("*")) {
foreach (var lb in LanguageBindingService.LanguageBindings) {
- IDotNetLanguageBinding dnlang = lb as IDotNetLanguageBinding;
- if (dnlang != null && dnlang.GetCodeDomProvider () != null)
- list.Add (dnlang.Language);
+ if (lb.GetCodeDomProvider () != null)
+ list.Add (lb.Language);
list.Remove ("*");
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/PropertyDescriptionTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/PropertyDescriptionTemplate.cs
new file mode 100644
index 0000000000..75aa833cb9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/PropertyDescriptionTemplate.cs
@@ -0,0 +1,82 @@
+//
+// PropertyDescriptionTemplate.cs
+//
+// Author:
+// Vincent Dondain <vincent.dondain@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Xml;
+using MonoDevelop.Core;
+using MonoDevelop.Ide.Templates;
+using MonoDevelop.Projects;
+
+namespace MonoDevelop.Ide.Templates
+{
+ class PropertyDescriptionTemplate : FileDescriptionTemplate
+ {
+ XmlAttribute typeAtt;
+ string propertyInnerText;
+ string extension;
+
+ public override string Name {
+ get {
+ return "Property";
+ }
+ }
+
+ public override void Show ()
+ {
+ }
+
+ public override void Load (XmlElement filenode, FilePath baseDirectory)
+ {
+ var extAtt = filenode.GetAttributeNode ("extension");
+ if (extAtt != null)
+ extension = extAtt.Value ?? "";
+
+ propertyInnerText = filenode.InnerText;
+ if (propertyInnerText == null)
+ throw new InvalidOperationException ("Property is missing its inner text");
+
+ typeAtt = filenode.GetAttributeNode ("type");
+ if (typeAtt == null)
+ throw new InvalidOperationException ("Property is missing the type attribute");
+
+ if (String.IsNullOrEmpty (typeAtt.Value))
+ throw new InvalidOperationException ("Property's type attribute is empty");
+
+ if (String.IsNullOrEmpty (filenode.InnerText))
+ throw new InvalidOperationException ("Property is empty");
+ }
+
+ public override bool AddToProject (SolutionFolderItem policyParent, Project project, string language, string directory, string name)
+ {
+ var model = CombinedTagModel.GetTagModel (ProjectTagModel, policyParent, project, language, name, null);
+ var fileName = StringParserService.Parse (name, model);
+
+ project.ProjectProperties.SetValue (typeAtt.Value, string.IsNullOrEmpty (fileName) ? propertyInnerText : string.Concat (fileName, extension));
+
+ return true;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ResourceFileDescriptionTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ResourceFileDescriptionTemplate.cs
index e2cb831041..b52003c6ca 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ResourceFileDescriptionTemplate.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ResourceFileDescriptionTemplate.cs
@@ -53,7 +53,7 @@ namespace MonoDevelop.Ide.Templates
}
}
- public override bool AddToProject (SolutionItem policyParent, Project project, string language, string directory, string name)
+ public override bool AddToProject (SolutionFolderItem policyParent, Project project, string language, string directory, string name)
{
ProjectFile file = template.AddFileToProject (policyParent, project, language, directory, name);
if (file != null) {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs
index cb68a703d1..6be284a7d4 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs
@@ -40,6 +40,7 @@ using MonoDevelop.Ide.StandardHeader;
using System.Text;
using MonoDevelop.Ide.Gui.Content;
using MonoDevelop.Ide.CodeFormatting;
+using MonoDevelop.Ide.Editor;
using MonoDevelop.Projects.SharedAssetsProjects;
using MonoDevelop.Core.StringParsing;
@@ -107,12 +108,12 @@ namespace MonoDevelop.Ide.Templates
set { addStandardHeader = value; }
}
- public sealed override bool AddToProject (SolutionItem policyParent, Project project, string language, string directory, string name)
+ public sealed override bool AddToProject (SolutionFolderItem policyParent, Project project, string language, string directory, string name)
{
return AddFileToProject (policyParent, project, language, directory, name) != null;
}
- public ProjectFile AddFileToProject (SolutionItem policyParent, Project project, string language, string directory, string name)
+ public ProjectFile AddFileToProject (SolutionFolderItem policyParent, Project project, string language, string directory, string name)
{
generatedFile = SaveFile (policyParent, project, language, directory, name);
if (generatedFile != null) {
@@ -120,7 +121,7 @@ namespace MonoDevelop.Ide.Templates
ProjectFile projectFile = project.AddFile (generatedFile, buildAction);
if (!string.IsNullOrEmpty (dependsOn)) {
- var model = GetTagModel (policyParent, project, language, name, generatedFile);
+ var model = CombinedTagModel.GetTagModel (ProjectTagModel, policyParent, project, language, name, generatedFile);
string parsedDepName = StringParserService.Parse (dependsOn, model);
if (projectFile.DependsOn != parsedDepName)
projectFile.DependsOn = parsedDepName;
@@ -136,7 +137,7 @@ namespace MonoDevelop.Ide.Templates
string res = netProject.AssemblyContext.GetAssemblyFullName (aref, netProject.TargetFramework);
res = netProject.AssemblyContext.GetAssemblyNameForVersion (res, netProject.TargetFramework);
if (!ContainsReference (netProject, res))
- netProject.References.Add (new ProjectReference (ReferenceType.Package, aref));
+ netProject.References.Add (ProjectReference.CreateAssemblyReference (aref));
}
}
@@ -184,69 +185,51 @@ namespace MonoDevelop.Ide.Templates
public override void Show ()
{
if (!suppressAutoOpen)
- IdeApp.Workbench.OpenDocument (generatedFile);
+ IdeApp.Workbench.OpenDocument (generatedFile, project: null);
}
// Creates a file and saves it to disk. Returns the path to the new file
// All parameters are optional (can be null)
- public string SaveFile (SolutionItem policyParent, Project project, string language, string baseDirectory, string entryName)
+ public string SaveFile (SolutionFolderItem policyParent, Project project, string language, string baseDirectory, string entryName)
{
string file = GetFileName (policyParent, project, language, baseDirectory, entryName);
+ AlertButton questionResult = null;
if (File.Exists (file)) {
- if (!MessageService.Confirm (GettextCatalog.GetString ("File already exists"),
- GettextCatalog.GetString ("File {0} already exists. Do you want to overwrite\nthe existing file?", file),
- AlertButton.OverwriteFile)) {
+ questionResult = MessageService.AskQuestion (GettextCatalog.GetString ("File already exists"),
+ GettextCatalog.GetString ("File {0} already exists.\nDo you want to overwrite the existing file or add it to the project?", file),
+ AlertButton.Cancel,
+ AlertButton.AddExistingFile,
+ AlertButton.OverwriteFile);
+ if (questionResult == AlertButton.Cancel)
return null;
- }
}
-
+
if (!Directory.Exists (Path.GetDirectoryName (file)))
Directory.CreateDirectory (Path.GetDirectoryName (file));
-
- Stream stream = CreateFileContent (policyParent, project, language, file, entryName);
-
- byte[] buffer = new byte [2048];
- int nr;
- FileStream fs = null;
- try {
- fs = File.Create (file);
- while ((nr = stream.Read (buffer, 0, 2048)) > 0)
- fs.Write (buffer, 0, nr);
- } finally {
- stream.Close ();
- if (fs != null)
- fs.Close ();
- }
- return file;
- }
- class CombinedTagModel : IStringTagModel
- {
- public IStringTagModel BaseModel;
- public Dictionary<string, string> OverrideTags = new Dictionary<string, string> (StringComparer.OrdinalIgnoreCase);
+ if (questionResult == null || questionResult == AlertButton.OverwriteFile) {
+ Stream stream = CreateFileContent (policyParent, project, language, file, entryName);
- public object GetValue (string name)
- {
- string val;
- if (OverrideTags.TryGetValue (name, out val))
- return val;
- if (BaseModel != null)
- return BaseModel.GetValue (name);
- return null;
+ byte [] buffer = new byte [2048];
+ int nr;
+ FileStream fs = null;
+ try {
+ fs = File.Create (file);
+ while ((nr = stream.Read (buffer, 0, 2048)) > 0)
+ fs.Write (buffer, 0, nr);
+ } finally {
+ stream.Close ();
+ if (fs != null)
+ fs.Close ();
+ }
}
- }
-
- CombinedTagModel GetTagModel (SolutionItem policyParent, Project project, string language, string identifier, string fileName)
- {
- var model = new CombinedTagModel { BaseModel = ProjectTagModel };
- ModifyTags (policyParent, project, language, identifier, fileName, ref model.OverrideTags);
- return model;
+ return file;
}
// Returns the name of the file that this template generates.
// All parameters are optional (can be null)
- public virtual string GetFileName (SolutionItem policyParent, Project project, string language, string baseDirectory, string entryName)
+ public virtual string GetFileName (SolutionFolderItem policyParent, Project project, string language, string baseDirectory, string entryName)
{
if (string.IsNullOrEmpty (entryName) && !string.IsNullOrEmpty (defaultName))
entryName = defaultName;
@@ -255,7 +238,7 @@ namespace MonoDevelop.Ide.Templates
//substitute tags
if ((name != null) && (name.Length > 0)) {
- var model = GetTagModel (policyParent, project, language, entryName ?? name, null);
+ var model = CombinedTagModel.GetTagModel (ProjectTagModel, policyParent, project, language, entryName ?? name, null);
fileName = StringParserService.Parse (name, model);
}
@@ -286,9 +269,9 @@ namespace MonoDevelop.Ide.Templates
// Returns a stream with the content of the file.
// project and language parameters are optional
- public virtual Stream CreateFileContent (SolutionItem policyParent, Project project, string language, string fileName, string identifier)
+ public virtual Stream CreateFileContent (SolutionFolderItem policyParent, Project project, string language, string fileName, string identifier)
{
- var model = GetTagModel (policyParent, project, language, identifier, fileName);
+ var model = CombinedTagModel.GetTagModel (ProjectTagModel, policyParent, project, language, identifier, fileName);
//HACK: for API compat, CreateContent just gets the override, not the base model
// but ProcessContent gets the entire model
@@ -297,7 +280,7 @@ namespace MonoDevelop.Ide.Templates
content = ProcessContent (content, model);
string mime = DesktopService.GetMimeTypeForUri (fileName);
- CodeFormatter formatter = !string.IsNullOrEmpty (mime) ? CodeFormatterService.GetFormatter (mime) : null;
+ var formatter = !string.IsNullOrEmpty (mime) ? CodeFormatterService.GetFormatter (mime) : null;
if (formatter != null) {
var formatted = formatter.FormatText (policyParent != null ? policyParent.Policies : null, content);
@@ -317,7 +300,7 @@ namespace MonoDevelop.Ide.Templates
ms.Write (data, 0, data.Length);
}
- Mono.TextEditor.TextDocument doc = new Mono.TextEditor.TextDocument ();
+ var doc = TextEditorFactory.CreateNewDocument ();
doc.Text = content;
TextStylePolicy textPolicy = policyParent != null ? policyParent.Policies.Get<TextStylePolicy> ("text/plain")
@@ -327,7 +310,7 @@ namespace MonoDevelop.Ide.Templates
var tabToSpaces = textPolicy.TabsToSpaces? new string (' ', textPolicy.TabWidth) : null;
- foreach (Mono.TextEditor.DocumentLine line in doc.Lines) {
+ foreach (var line in doc.GetLines ()) {
var lineText = doc.GetTextAt (line.Offset, line.Length);
if (tabToSpaces != null)
lineText = lineText.Replace ("\t", tabToSpaces);
@@ -358,77 +341,10 @@ namespace MonoDevelop.Ide.Templates
// We supply defaults whenever it is possible, to avoid having unsubstituted tags. However,
// do not substitute blanks when a sensible default cannot be guessed, because they result
//in less obvious errors.
- public virtual void ModifyTags (SolutionItem policyParent, Project project, string language,
+ public virtual void ModifyTags (SolutionFolderItem policyParent, Project project, string language,
string identifier, string fileName, ref Dictionary<string,string> tags)
{
- DotNetProject netProject = project as DotNetProject;
- string languageExtension = "";
- ILanguageBinding binding = null;
- if (!string.IsNullOrEmpty (language)) {
- binding = GetLanguageBinding (language);
- if (binding != null)
- languageExtension = Path.GetExtension (binding.GetFileName ("Default")).Remove (0, 1);
- }
-
- //need a default namespace or if there is no project, substitutions can get very messed up
- string ns;
- if (project is IDotNetFileContainer)
- ns = ((IDotNetFileContainer)project).GetDefaultNamespace (fileName);
- else
- ns = "Application";
-
- //need an 'identifier' for tag substitution, e.g. class name or page name
- //if not given an identifier, use fileName
- if ((identifier == null) && (fileName != null))
- identifier = Path.GetFileName (fileName);
-
- if (identifier != null) {
- //remove all extensions
- while (Path.GetExtension (identifier).Length > 0)
- identifier = Path.GetFileNameWithoutExtension (identifier);
- identifier = CreateIdentifierName (identifier);
- tags ["Name"] = identifier;
- tags ["FullName"] = ns.Length > 0 ? ns + "." + identifier : identifier;
-
- //some .NET languages may be able to use keywords as identifiers if they're escaped
- IDotNetLanguageBinding dnb = binding as IDotNetLanguageBinding;
- if (dnb != null) {
- System.CodeDom.Compiler.CodeDomProvider provider = dnb.GetCodeDomProvider ();
- if (provider != null) {
- tags ["EscapedIdentifier"] = provider.CreateEscapedIdentifier (identifier);
- }
- }
- }
-
- tags ["Namespace"] = ns;
- if (policyParent != null)
- tags ["SolutionName"] = policyParent.Name;
- if (project != null) {
- tags ["ProjectName"] = project.Name;
- tags ["SafeProjectName"] = CreateIdentifierName (project.Name);
- var info = project.AuthorInformation ?? AuthorInformation.Default;
- tags ["AuthorCopyright"] = info.Copyright;
- tags ["AuthorCompany"] = info.Company;
- tags ["AuthorTrademark"] = info.Trademark;
- tags ["AuthorEmail"] = info.Email;
- tags ["AuthorName"] = info.Name;
- }
- if ((language != null) && (language.Length > 0))
- tags ["Language"] = language;
- if (languageExtension.Length > 0)
- tags ["LanguageExtension"] = languageExtension;
-
- if (fileName != FilePath.Null) {
- FilePath fileDirectory = Path.GetDirectoryName (fileName);
- if (project != null && project.BaseDirectory != FilePath.Null && fileDirectory.IsChildPathOf (project.BaseDirectory))
- tags ["ProjectRelativeDirectory"] = fileDirectory.ToRelative (project.BaseDirectory);
- else
- tags ["ProjectRelativeDirectory"] = fileDirectory;
-
- tags ["FileNameWithoutExtension"] = Path.GetFileNameWithoutExtension (fileName);
- tags ["Directory"] = fileDirectory;
- tags ["FileName"] = fileName;
- }
+ FileTemplateTagsModifier.ModifyTags (policyParent, project, language, identifier, fileName, ref tags);
}
static string CreateIdentifierName (string identifier)
@@ -446,7 +362,7 @@ namespace MonoDevelop.Ide.Templates
}
- protected ILanguageBinding GetLanguageBinding (string language)
+ internal static LanguageBinding GetLanguageBinding (string language)
{
var binding = LanguageBindingService.GetBindingPerLanguageName (language);
if (binding == null)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SolutionDescriptor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SolutionDescriptor.cs
index 686265ef63..51eebafb51 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SolutionDescriptor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SolutionDescriptor.cs
@@ -42,6 +42,7 @@ using MonoDevelop.Components.Commands;
using System.Collections.Generic;
using System.Xml;
using Mono.Addins;
+using MonoDevelop.Projects.MSBuild;
namespace MonoDevelop.Ide.Templates
{
@@ -157,7 +158,7 @@ namespace MonoDevelop.Ide.Templates
var solutionItemDesc = entryDescriptors[i];
- SolutionEntityItem info = solutionItemDesc.CreateItem (entryProjectCI, defaultLanguage);
+ SolutionItem info = solutionItemDesc.CreateItem (entryProjectCI, defaultLanguage);
if (info == null)
continue;
@@ -185,10 +186,12 @@ namespace MonoDevelop.Ide.Templates
}
}
- if (!workspaceItem.FileFormat.CanWrite (workspaceItem)) {
+ var sol = workspaceItem as Solution;
+
+ if (sol != null && !sol.SupportsFormat (sol.FileFormat)) {
// The default format can't write solutions of this type. Find a compatible format.
- FileFormat f = IdeApp.Services.ProjectService.FileFormats.GetFileFormatsForObject (workspaceItem).First ();
- workspaceItem.ConvertToFormat (f, true);
+ var f = MSBuildFileFormat.GetSupportedFormats ().First (ff => ff.CanWriteFile (sol));
+ sol.ConvertToFormat (f);
}
return workspaceItemCreatedInfo;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SolutionItemDescriptor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SolutionItemDescriptor.cs
index a0a04fc553..5ec29b0146 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SolutionItemDescriptor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SolutionItemDescriptor.cs
@@ -60,7 +60,7 @@ namespace MonoDevelop.Ide.Templates
template = element;
}
- public SolutionEntityItem CreateItem (ProjectCreateInformation projectCreateInformation, string defaultLanguage)
+ public SolutionItem CreateItem (ProjectCreateInformation projectCreateInformation, string defaultLanguage)
{
Type type = addin.GetType (typeName, false);
@@ -68,9 +68,10 @@ namespace MonoDevelop.Ide.Templates
MessageService.ShowError (GettextCatalog.GetString ("Can't create project with type : {0}", typeName));
return null;
}
-
- SolutionEntityItem item = (SolutionEntityItem) Activator.CreateInstance (type);
- item.InitializeFromTemplate (template);
+
+ // TODO NPM: should use the project service
+ SolutionItem item = (SolutionItem) Activator.CreateInstance (type);
+ item.InitializeFromTemplate (projectCreateInformation, template);
string newProjectName = StringParserService.Parse (name, new string[,] {
{"ProjectName", projectCreateInformation.ProjectName}
@@ -82,7 +83,7 @@ namespace MonoDevelop.Ide.Templates
return item;
}
- public void InitializeItem (SolutionItem policyParent, ProjectCreateInformation projectCreateInformation, string defaultLanguage, SolutionEntityItem item)
+ public void InitializeItem (SolutionFolderItem policyParent, ProjectCreateInformation projectCreateInformation, string defaultLanguage, SolutionItem item)
{
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/TemplateConditionEvaluator.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/TemplateConditionEvaluator.cs
new file mode 100644
index 0000000000..2d0b8642b7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/TemplateConditionEvaluator.cs
@@ -0,0 +1,60 @@
+//
+// TemplateConditionEvaluator.cs
+//
+// Author:
+// Michael Hutchinson <m.j.hutchinson@gmail.com>
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2014-2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using MonoDevelop.Core.StringParsing;
+
+namespace MonoDevelop.Ide.Templates
+{
+ static class TemplateConditionEvaluator
+ {
+ public static bool EvaluateCondition (IStringTagModel model, string condition)
+ {
+ if (string.IsNullOrWhiteSpace (condition))
+ return true;
+
+ condition = condition.Trim ();
+
+ string parameter = GetNotConditionParameterName (condition);
+ if (parameter != null) {
+ return !model.GetBoolValue (parameter);
+ }
+
+ return model.GetBoolValue (condition);
+ }
+
+ static string GetNotConditionParameterName (string createCondition)
+ {
+ if (createCondition.StartsWith ("!", StringComparison.Ordinal)) {
+ return createCondition.Substring (1).TrimStart ();
+ }
+
+ return null;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/TextFileDescriptionTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/TextFileDescriptionTemplate.cs
index b674676ff8..eaf02e1b4a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/TextFileDescriptionTemplate.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/TextFileDescriptionTemplate.cs
@@ -103,7 +103,7 @@ namespace MonoDevelop.Ide.Templates
contentSrcFile = contentSrcFile.ToAbsolute (baseDirectory);
}
- public override Stream CreateFileContent (SolutionItem policyParent, Project project, string language,
+ public override Stream CreateFileContent (SolutionFolderItem policyParent, Project project, string language,
string fileName, string identifier)
{
return File.OpenRead (contentSrcFile);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/FileExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/FileExtension.cs
index 03ea1cb117..d0ccd99bc7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/FileExtension.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/FileExtension.cs
@@ -28,7 +28,6 @@
using System;
using System.Linq;
using MonoDevelop.Core;
-using Mono.TextEditor;
using System.Collections.Generic;
using MonoDevelop.Projects.Text;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/FileExtensionEventArgs.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/FileExtensionEventArgs.cs
index 876a9d2581..79d246e707 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/FileExtensionEventArgs.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/FileExtensionEventArgs.cs
@@ -27,7 +27,6 @@
using System;
using System.Linq;
using MonoDevelop.Core;
-using Mono.TextEditor;
using System.Collections.Generic;
using MonoDevelop.Projects.Text;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/FileLineExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/FileLineExtension.cs
index ec22e90aff..b5278f365a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/FileLineExtension.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/FileLineExtension.cs
@@ -27,7 +27,6 @@
using System;
using System.Linq;
using MonoDevelop.Core;
-using Mono.TextEditor;
using System.Collections.Generic;
using MonoDevelop.Projects.Text;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/HorizontalAlignment.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/HorizontalAlignment.cs
index 3863a5ea86..f124f748c7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/HorizontalAlignment.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/HorizontalAlignment.cs
@@ -27,7 +27,6 @@
using System;
using System.Linq;
using MonoDevelop.Core;
-using Mono.TextEditor;
using System.Collections.Generic;
using MonoDevelop.Projects.Text;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/LineCountEventArgs.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/LineCountEventArgs.cs
index bf252a697c..95eb469c54 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/LineCountEventArgs.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/LineCountEventArgs.cs
@@ -27,7 +27,6 @@
using System;
using System.Linq;
using MonoDevelop.Core;
-using Mono.TextEditor;
using System.Collections.Generic;
using MonoDevelop.Projects.Text;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TextEditorService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TextEditorService.cs
index 595db9c80a..74385431b9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TextEditorService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TextEditorService.cs
@@ -27,7 +27,6 @@
using System;
using System.Linq;
using MonoDevelop.Core;
-using Mono.TextEditor;
using System.Collections.Generic;
using MonoDevelop.Projects.Text;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TextFileEventArgs.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TextFileEventArgs.cs
index d2c3a245c5..53c4ed6e41 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TextFileEventArgs.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TextFileEventArgs.cs
@@ -27,7 +27,6 @@
using System;
using System.Linq;
using MonoDevelop.Core;
-using Mono.TextEditor;
using System.Collections.Generic;
using MonoDevelop.Projects.Text;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TextLineMarkerExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TextLineMarkerExtension.cs
index 6126390e80..67dee58ab2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TextLineMarkerExtension.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TextLineMarkerExtension.cs
@@ -27,16 +27,14 @@
using System;
using System.Linq;
using MonoDevelop.Core;
-using Mono.TextEditor;
using System.Collections.Generic;
using MonoDevelop.Projects.Text;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Ide.TextEditing
{
-
public abstract class TextLineMarkerExtension: FileLineExtension
{
- public abstract TextLineMarker CreateMarker ();
- }
-
+ public abstract ITextLineMarker CreateMarker ();
}
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TopLevelWidgetExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TopLevelWidgetExtension.cs
index 6ce7988b5b..1165bf2957 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TopLevelWidgetExtension.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/TopLevelWidgetExtension.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.TextEditing
{
@@ -36,7 +37,7 @@ namespace MonoDevelop.Ide.TextEditing
public int OffsetY { get; set; }
public bool AllowMove { get; set; }
- public abstract Gtk.Widget CreateWidget ();
+ public abstract Control CreateWidget ();
protected TopLevelWidgetExtension ()
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/VerticalAlignment.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/VerticalAlignment.cs
index 47f318f92e..d72bfb9e71 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/VerticalAlignment.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TextEditing/VerticalAlignment.cs
@@ -27,7 +27,6 @@
using System;
using System.Linq;
using MonoDevelop.Core;
-using Mono.TextEditor;
using System.Collections.Generic;
using MonoDevelop.Projects.Text;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/Ambience.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/Ambience.cs
index 65621369b2..bc3a52dc9c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/Ambience.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/Ambience.cs
@@ -30,51 +30,76 @@ using System;
using System.Text;
using System.Collections.Generic;
using MonoDevelop.Core;
-using ICSharpCode.NRefactory.TypeSystem;
using Mono.Cecil;
using System.Linq;
using MonoDevelop.Ide.CodeCompletion;
+using Microsoft.CodeAnalysis;
+using System.Threading;
+using System.Xml;
+using Mono.Addins;
+using MonoDevelop.Ide.Extensions;
+using System.Threading.Tasks;
+using System.IO;
namespace MonoDevelop.Ide.TypeSystem
{
- public abstract class Ambience
- {
- public string Name {
- get;
- private set;
- }
-
-
- public Ambience (string name)
- {
- this.Name = name;
- }
-
- #region To implement
- public abstract string GetIntrinsicTypeName (string reflectionName);
-
- public abstract string SingleLineComment (string text);
- public abstract string GetString (string nameSpace, OutputSettings settings);
-
- protected abstract string GetTypeReferenceString (IType reference, OutputSettings settings);
- protected abstract string GetTypeString (IType type, OutputSettings settings);
- protected abstract string GetMethodString (IMethod method, OutputSettings settings);
- protected abstract string GetConstructorString (IMethod constructor, OutputSettings settings);
- protected abstract string GetDestructorString (IMethod destructor, OutputSettings settings);
- protected abstract string GetOperatorString (IMethod op, OutputSettings settings);
-
- protected abstract string GetFieldString (IField field, OutputSettings settings);
- protected abstract string GetEventString (IEvent evt, OutputSettings settings);
- protected abstract string GetPropertyString (IProperty property, OutputSettings settings);
- protected abstract string GetIndexerString (IProperty property, OutputSettings settings);
- protected abstract string GetParameterString (IParameterizedMember member, IParameter parameter, OutputSettings settings);
-
- #endregion
-
- public virtual TooltipInformation GetTooltip (IEntity entity)
+ public static class Ambience
+ {
+ public static readonly SymbolDisplayFormat LabelFormat =
+ new SymbolDisplayFormat(
+ globalNamespaceStyle: SymbolDisplayGlobalNamespaceStyle.Omitted,
+ typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameAndContainingTypesAndNamespaces,
+ propertyStyle: SymbolDisplayPropertyStyle.NameOnly,
+ genericsOptions: SymbolDisplayGenericsOptions.IncludeTypeParameters | SymbolDisplayGenericsOptions.IncludeVariance,
+ memberOptions: SymbolDisplayMemberOptions.IncludeParameters | SymbolDisplayMemberOptions.IncludeExplicitInterface,
+ parameterOptions:
+ SymbolDisplayParameterOptions.IncludeDefaultValue |
+ SymbolDisplayParameterOptions.IncludeExtensionThis |
+ SymbolDisplayParameterOptions.IncludeType |
+ SymbolDisplayParameterOptions.IncludeName |
+ SymbolDisplayParameterOptions.IncludeParamsRefOut,
+ miscellaneousOptions:
+ SymbolDisplayMiscellaneousOptions.EscapeKeywordIdentifiers |
+ SymbolDisplayMiscellaneousOptions.UseSpecialTypes
+ );
+ /// <summary>
+ /// Standard format for displaying to the user.
+ /// </summary>
+ /// <remarks>
+ /// No return type.
+ /// </remarks>
+ public static readonly SymbolDisplayFormat NameFormat =
+ new SymbolDisplayFormat(
+ globalNamespaceStyle: SymbolDisplayGlobalNamespaceStyle.Omitted,
+ typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameAndContainingTypesAndNamespaces,
+ propertyStyle: SymbolDisplayPropertyStyle.NameOnly,
+ genericsOptions: SymbolDisplayGenericsOptions.IncludeTypeParameters | SymbolDisplayGenericsOptions.IncludeVariance,
+ memberOptions: SymbolDisplayMemberOptions.IncludeParameters | SymbolDisplayMemberOptions.IncludeExplicitInterface,
+ parameterOptions:
+ SymbolDisplayParameterOptions.IncludeParamsRefOut |
+ SymbolDisplayParameterOptions.IncludeExtensionThis |
+ SymbolDisplayParameterOptions.IncludeType |
+ SymbolDisplayParameterOptions.IncludeName,
+ miscellaneousOptions:
+ SymbolDisplayMiscellaneousOptions.EscapeKeywordIdentifiers |
+ SymbolDisplayMiscellaneousOptions.UseSpecialTypes);
+ static Ambience ()
{
- return null;
+ // may not have been initialized in testing environment.
+ if (AddinManager.IsInitialized) {
+ AddinManager.AddExtensionNodeHandler ("/MonoDevelop/TypeSystem/AmbienceTooltipProviders", delegate(object sender, ExtensionNodeEventArgs args) {
+ var node = args.ExtensionNode as MimeTypeExtensionNode;
+ switch (args.Change) {
+ case ExtensionChange.Add:
+ tooltipProviders.Add ((AmbienceTooltipProvider)node.CreateInstance ());
+ break;
+ case ExtensionChange.Remove:
+ tooltipProviders.Remove ((AmbienceTooltipProvider)node.CreateInstance ());
+ break;
+ }
+ });
+ }
}
public static string Format (string str)
@@ -86,104 +111,547 @@ namespace MonoDevelop.Ide.TypeSystem
MarkupUtilities.AppendEscapedString (sb, str);
return sb.ToString ();
}
+
+ #region Documentation
- protected static OutputFlags GetFlags (object settings)
+ public class DocumentationFormatOptions
{
- if (settings is OutputFlags)
- return (OutputFlags)settings;
- return ((OutputSettings)settings).OutputFlags;
+ public static readonly DocumentationFormatOptions Empty = new DocumentationFormatOptions ();
+ public string HighlightParameter {
+ get;
+ set;
+ }
+
+ public int MaxLineLength {
+ get;
+ set;
+ }
+
+ public bool BigHeadings {
+ get;
+ set;
+ }
+
+ public bool BoldHeadings {
+ get;
+ set;
+ }
+
+ public bool SmallText {
+ get;
+ set;
+ }
+
+
+ public DocumentationFormatOptions ()
+ {
+ BoldHeadings = true;
+ }
+
+ public string FormatHeading (string heading)
+ {
+ string result = heading;
+ if (BigHeadings)
+ result = "<big>" + result + "</big>";
+ if (BoldHeadings)
+ result = "<b>" + result + "</b>";
+ return result;
+ }
+
+ public string FormatBody (string body)
+ {
+ var str = body.Trim ();
+ if (string.IsNullOrEmpty (str))
+ return "";
+ return SmallText ? "<small>" + str + Environment.NewLine + "</small>" : str + Environment.NewLine;
+ }
}
-
- protected static OutputSettings GetSettings (object settings)
+
+ public static string GetSummaryMarkup (ISymbol member, CancellationToken cancellationToken = default(CancellationToken))
{
- if (settings is OutputFlags)
- return new OutputSettings ((OutputFlags)settings);
- return (OutputSettings)settings;
+ if (member == null)
+ return null;
+ string documentation = GetDocumentation (member);
+ if (string.IsNullOrEmpty (documentation))
+ return null;
+
+ if (!string.IsNullOrEmpty (documentation)) {
+ int idx1 = documentation.IndexOf ("<summary>", StringComparison.Ordinal);
+ int idx2 = documentation.LastIndexOf ("</summary>", StringComparison.Ordinal);
+ string result;
+ if (idx1 >= 0 && idx2 > idx1) {
+ try {
+ var xmlText = documentation.Substring (idx1, idx2 - idx1 + "</summary>".Length);
+ return ParseBody (member,
+ new XmlTextReader (xmlText, XmlNodeType.Element, null),
+ "summary",
+ DocumentationFormatOptions.Empty
+ );
+ } catch (Exception e) {
+ LoggingService.LogWarning ("Malformed documentation xml detected:" + documentation, e);
+ // may happen on malformed xml.
+ var len = idx2 - idx1 - "</summary>".Length;
+ result = len > 0 ? documentation.Substring (idx1 + "<summary>".Length, len) : documentation;
+ }
+ } else if (idx1 >= 0) {
+ result = documentation.Substring (idx1 + "<summary>".Length);
+ } else if (idx2 >= 0) {
+ result = documentation.Substring (0, idx2 - 1);
+ } else {
+ result = documentation;
+ }
+ return GetDocumentationMarkup (member, CleanEmpty (result));
+ }
+
+ return GetDocumentationMarkup (member, CleanEmpty (documentation));
}
- public string GetString (string nameSpace, OutputFlags flags)
+ static string CleanEmpty (string doc)
{
- return GetString (nameSpace, new OutputSettings (flags));
+ return IsEmptyDocumentation (doc)? null : doc;
}
-
- public string GetString (IEntity entity, OutputSettings settings)
- {
- if (entity == null) {
- string[] trace = Environment.StackTrace.Split (new [] { Environment.NewLine }, StringSplitOptions.None);
- return "null entity: " + (trace != null && trace.Length > 2 ? trace [2] : "unknown location");
- }
- string result = null;
- switch (entity.SymbolKind) {
- case SymbolKind.Constructor:
- result = GetConstructorString ((IMethod)entity, settings);
- break;
- case SymbolKind.Destructor:
- result = GetDestructorString ((IMethod)entity, settings);
- break;
- case SymbolKind.Event:
- result = GetEventString ((IEvent)entity, settings);
- break;
- case SymbolKind.Field:
- result = GetFieldString ((IField)entity, settings);
- break;
- case SymbolKind.Indexer:
- result = GetPropertyString ((IProperty)entity, settings);
- break;
- case SymbolKind.Method:
- result = GetMethodString ((IMethod)entity, settings);
- break;
- case SymbolKind.Operator:
- result = GetMethodString ((IMethod)entity, settings);
- break;
- case SymbolKind.Property:
- result = GetPropertyString ((IProperty)entity, settings);
- break;
- case SymbolKind.TypeDefinition:
- result = GetTypeString ((ITypeDefinition)entity, settings);
- break;
- default:
- throw new ArgumentOutOfRangeException ("SymbolKind", "Unknown entity type:" + entity.SymbolKind);
- }
- result = settings.PostProcess (entity, result);
- return result;
+
+ static bool IsEmptyDocumentation (string documentation)
+ {
+ return string.IsNullOrWhiteSpace (documentation) || documentation.StartsWith ("To be added") || documentation == "we have not entered docs yet";
}
- public string GetString (IType type, OutputSettings settings)
+ public static string GetDocumentation (ISymbol member)
{
- var result = GetTypeString (type, settings);
- return settings.PostProcess (type, result);
+ if (member == null)
+ return null;
+ var documentation = member.GetDocumentationCommentXml ();
+ if (string.IsNullOrEmpty (documentation))
+ documentation = MonoDocDocumentationProvider.GetDocumentation (member);
+ if (documentation != null)
+ return CleanEmpty (documentation);
+ return null;
}
+
+ static string GetCref (ICSharpCode.NRefactory.TypeSystem.ITypeResolveContext ctx, string cref)
+ {
+ if (cref == null)
+ return "";
+
+ if (cref.Length < 2)
+ return cref;
+ try {
+ var entity = new ICSharpCode.NRefactory.Documentation.DocumentationComment ("", ctx).ResolveCref (cref.Replace("<", "{").Replace(">", "}"));
-/* public string GetString (ITypeReference reference, OutputSettings settings)
+ if (entity != null) {
+ var ambience = new ICSharpCode.NRefactory.CSharp.CSharpAmbience ();
+ ambience.ConversionFlags = ICSharpCode.NRefactory.TypeSystem.ConversionFlags.ShowParameterList | ICSharpCode.NRefactory.TypeSystem.ConversionFlags.ShowParameterNames | ICSharpCode.NRefactory.TypeSystem.ConversionFlags.ShowTypeParameterList;
+ return ambience.ConvertSymbol (entity);
+ }
+ } catch (Exception e) {
+ LoggingService.LogWarning ("Invalid cref:" + cref, e);
+ }
+
+ if (cref.Substring (1, 1) == ":")
+ return cref.Substring (2, cref.Length - 2);
+
+ return cref;
+ }
+
+ static bool IsSpecialChar (int charValue)
{
- var result = GetTypeReferenceString (reference, settings);
- return settings.PostProcess (reference, result);
- }*/
+ return
+ 0x01 <= charValue && charValue <= 0x08 ||
+ 0x0B <= charValue && charValue <= 0x0C ||
+ 0x0E <= charValue && charValue <= 0x1F ||
+ 0x7F <= charValue && charValue <= 0x84 ||
+ 0x86 <= charValue && charValue <= 0x9F;
+ }
- public string GetString (IEntity entity, OutputFlags flags)
+ public static string BreakLines (string text, int maxLineLength)
{
- return GetString (entity, new OutputSettings (flags));
+ if (maxLineLength <= 0)
+ return text;
+ StringBuilder result = new StringBuilder ();
+ int lineLength = 0;
+ bool inTag = false;
+ bool inAmp = false;
+ foreach (char ch in text) {
+ switch (ch) {
+ case '<':
+ inTag = true;
+ break;
+ case '>':
+ inTag = false;
+ break;
+ case '&':
+ inAmp = true;
+ break;
+ case ';':
+ inAmp = false;
+ break;
+ case '\n':
+ lineLength = 0;
+ break;
+ case '\r':
+ lineLength = 0;
+ break;
+ }
+
+ result.Append (ch);
+ if (!inTag && !inAmp)
+ lineLength++;
+ if (!Char.IsLetterOrDigit (ch) && lineLength > maxLineLength) {
+ result.AppendLine ();
+ lineLength = 0;
+ }
+ }
+ return result.ToString ();
}
- public string GetString (IType type, OutputFlags flags)
+ public static string EscapeText (string text)
{
- return GetString (type, new OutputSettings (flags));
+ if (text == null)
+ return null;
+ StringBuilder result = new StringBuilder ();
+ foreach (char ch in text) {
+ switch (ch) {
+ case '<':
+ result.Append ("&lt;");
+ break;
+ case '>':
+ result.Append ("&gt;");
+ break;
+ case '&':
+ result.Append ("&amp;");
+ break;
+ case '\'':
+ result.Append ("&apos;");
+ break;
+ case '"':
+ result.Append ("&quot;");
+ break;
+ default:
+ int charValue = (int)ch;
+ if (IsSpecialChar (charValue)) {
+ result.AppendFormat ("&#x{0:X};", charValue);
+ } else {
+ result.Append (ch);
+ }
+ break;
+ }
+ }
+ return result.ToString ();
}
- public string GetString (ITypeDefinition type, OutputFlags flags)
+ public static string UnescapeText (string text)
{
- return GetString ((IEntity)type, new OutputSettings (flags));
+ var sb = new StringBuilder ();
+ for (int i = 0; i < text.Length; i++) {
+ char ch = text[i];
+ if (ch == '&') {
+ int end = text.IndexOf (';', i);
+ if (end == -1)
+ break;
+ string entity = text.Substring (i + 1, end - i - 1);
+ switch (entity) {
+ case "lt":
+ sb.Append ('<');
+ break;
+ case "gt":
+ sb.Append ('>');
+ break;
+ case "amp":
+ sb.Append ('&');
+ break;
+ case "apos":
+ sb.Append ('\'');
+ break;
+ case "quot":
+ sb.Append ('"');
+ break;
+ }
+ i = end;
+ } else {
+ sb.Append (ch);
+ }
+ }
+ return sb.ToString ();
}
- public string GetString (IParameterizedMember member, IParameter parameter, OutputFlags flags)
+ public static string GetDocumentationMarkup (ISymbol member, string doc)
{
- return GetParameterString (member, parameter, new OutputSettings (flags));
+ return GetDocumentationMarkup (member, doc, DocumentationFormatOptions.Empty);
}
- /*
- public string GetString (ITypeReference reference, OutputFlags flags)
+
+ static string ParseBody (ISymbol member, XmlTextReader xml, string endTagName, DocumentationFormatOptions options)
{
- return GetString (reference, new OutputSettings (flags));
- }*/
+ StringBuilder result = new StringBuilder ();
+ bool wasWhiteSpace = true;
+ bool appendSpace = false;
+ string listType = "bullet";
+ int listItem = 1;
+ //ITypeResolveContext ctx = member.Compilation.TypeResolveContext;
+ while (xml.Read ()) {
+ switch (xml.NodeType) {
+ case XmlNodeType.EndElement:
+ if (xml.Name == endTagName)
+ goto end;
+ break;
+ case XmlNodeType.Element:
+ switch (xml.Name.ToLower ()) {
+ case "para":
+ result.AppendLine (ParseBody (member, xml, xml.Name, options));
+ wasWhiteSpace = true;
+ break;
+ case "list":
+ listType = xml ["type"] ?? listType;
+ listItem = 1;
+ result.AppendLine ();
+ result.AppendLine ();
+ break;
+ case "term": {
+ string inner = "<root>" + xml.ReadInnerXml () + "</root>";
+ result.Append ("<i>" + ParseBody (member, new XmlTextReader (new StringReader (inner)), "root", options) + " </i>");
+ break;
+ }
+ case "description": {
+ string inner = "<root>" + xml.ReadInnerXml () + "</root>";
+ result.Append (ParseBody (member, new XmlTextReader (new StringReader (inner)), "root", options));
+ break;
+ }
+ case "listheader": {
+ string inner = "<root>" + xml.ReadInnerXml () + "</root>";
+ string prefix;
+ switch (listType) {
+ case "number":
+ prefix = " ";
+ break;
+ case "table":
+ prefix = " ";
+ break;
+ default: // bullet;
+ prefix = " ";
+ break;
+ }
+ result.AppendLine (prefix + ParseBody (member, new XmlTextReader (new StringReader (inner)), "root", options));
+ break;
+ }
+ case "item": {
+ string inner = "<root>" + xml.ReadInnerXml () + "</root>";
+ string prefix;
+ switch (listType) {
+ case "number":
+ prefix = string.Format (" {0:##}. ", listItem++);
+ break;
+ case "table":
+ prefix = " ";
+ break;
+ default: // bullet;
+ prefix = " \u2022 ";
+ break;
+ }
+ result.AppendLine (prefix + ParseBody (member, new XmlTextReader (new StringReader (inner)), "root", options));
+ break;
+ }
+ case "see":
+ if (!wasWhiteSpace) {
+ result.Append (' ');
+ wasWhiteSpace = true;
+ }
+ result.Append ("<i>");
+ string name = (xml ["cref"] + xml ["langword"]).Trim ();
+ result.Append (EscapeText (FormatCref(name)));
+ result.Append ("</i>");
+ wasWhiteSpace = false;
+ appendSpace = true;
+ break;
+ case "paramref":
+ if (!wasWhiteSpace) {
+ result.Append (' ');
+ wasWhiteSpace = true;
+ }
+ result.Append ("<i>");
+ result.Append (EscapeText (xml ["name"].Trim ()));
+ result.Append ("</i>");
+ appendSpace = true;
+ wasWhiteSpace = false;
+ break;
+ }
+ break;
+ case XmlNodeType.Text:
+ if (IsEmptyDocumentation (xml.Value))
+ break;
+ foreach (char ch in xml.Value) {
+ if (!Char.IsWhiteSpace (ch) && appendSpace) {
+ result.Append (' ');
+ appendSpace = false;
+ }
+ if (Char.IsWhiteSpace (ch) || ch == '\n' || ch == '\r') {
+ if (!wasWhiteSpace) {
+ result.Append (' ');
+ wasWhiteSpace = true;
+ }
+ continue;
+ }
+ wasWhiteSpace = false;
+ result.Append (EscapeText (ch.ToString ()));
+ }
+ break;
+ }
+ }
+ end:
+ return result.ToString ().Trim ();
+ }
+
+ static string FormatCref (string cref)
+ {
+ if (cref.Length > 2 && cref [1] == ':')
+ return cref.Substring (2);
+ return cref;
+ }
+
+ public static string GetDocumentationMarkup (ISymbol member, string doc, DocumentationFormatOptions options)
+ {
+ if (string.IsNullOrEmpty (doc))
+ return null;
+ System.IO.StringReader reader = new System.IO.StringReader ("<docroot>" + doc + "</docroot>");
+ XmlTextReader xml = new XmlTextReader (reader);
+ StringBuilder ret = new StringBuilder (70);
+ StringBuilder parameterBuilder = new StringBuilder ();
+ StringBuilder exceptions = new StringBuilder ();
+ exceptions.AppendLine (options.FormatHeading (GettextCatalog.GetString ("Exceptions:")));
+ // ret.Append ("<small>");
+ int paramCount = 0, exceptionCount = 0, summaryEnd = -1;
+ try {
+ xml.Read ();
+ do {
+ if (xml.NodeType == XmlNodeType.Element) {
+ switch (xml.Name.ToLower ()) {
+ case "para":
+ ret.Append (options.FormatBody (ParseBody (member, xml, xml.Name, options)));
+ if (summaryEnd < 0)
+ summaryEnd = ret.Length;
+ break;
+ case "summary":
+ var summary = options.FormatBody (ParseBody (member, xml, xml.Name, options));
+ if (!IsEmptyDocumentation (summary)) {
+ // ret.AppendLine (GetHeading ("Summary:", options));
+ ret.Append (summary);
+ if (summaryEnd < 0)
+ summaryEnd = ret.Length;
+ }
+ break;
+ case "remarks":
+ if (string.IsNullOrEmpty (options.HighlightParameter)) {
+ ret.AppendLine (options.FormatHeading (GettextCatalog.GetString ("Remarks:")));
+ ret.Append (options.FormatBody (ParseBody (member, xml, xml.Name, options)));
+ if (summaryEnd < 0)
+ summaryEnd = ret.Length;
+ } else {
+ options.FormatBody (ParseBody (member, xml, xml.Name, options));
+ }
+ break;
+ // skip <example>-nodes
+ case "example":
+ xml.Skip ();
+ xml.Skip ();
+ break;
+ case "exception":
+ exceptionCount++;
+ if (options.SmallText)
+ exceptions.Append ("<small>");
+ exceptions.Append ("<b>");
+ exceptions.Append (EscapeText (xml ["cref"]));
+ exceptions.Append (": ");
+ exceptions.Append ("</b>");
+ if (options.SmallText)
+ exceptions.Append ("</small>");
+
+ exceptions.AppendLine (options.FormatBody (ParseBody (member, xml, xml.Name, options)));
+ break;
+ case "returns":
+ if (string.IsNullOrEmpty (options.HighlightParameter)) {
+ ret.AppendLine (options.FormatHeading (GettextCatalog.GetString ("Returns:")));
+ ret.Append (options.FormatBody (ParseBody (member, xml, xml.Name, options)));
+ } else {
+ options.FormatBody (ParseBody (member, xml, xml.Name, options));
+ }
+ break;
+ case "param":
+ string paramName = xml.GetAttribute ("name") != null ? xml ["name"].Trim () : "";
+
+ var body = options.FormatBody (ParseBody (member, xml, xml.Name, options));
+ if (!IsEmptyDocumentation (body)) {
+ paramCount++;
+ parameterBuilder.Append ("<i>");
+ if (options.HighlightParameter == paramName)
+ parameterBuilder.Append ("<b>");
+ if (options.SmallText)
+ parameterBuilder.Append ("<small>");
+ parameterBuilder.Append (EscapeText (paramName));
+ if (options.SmallText)
+ parameterBuilder.Append ("</small>");
+ if (options.HighlightParameter == paramName)
+ parameterBuilder.Append ("</b>");
+ parameterBuilder.Append (":</i> ");
+ parameterBuilder.Append (body);
+ } else {
+ return null;
+ }
+ break;
+ case "value":
+ ret.AppendLine (options.FormatHeading (GettextCatalog.GetString ("Value:")));
+ ret.AppendLine (options.FormatBody (ParseBody (member, xml, xml.Name, options)));
+ break;
+ case "seealso":
+ if (string.IsNullOrEmpty (options.HighlightParameter)) {
+ ret.Append (options.FormatHeading (GettextCatalog.GetString ("See also:")));
+ ret.Append (" " + EscapeText (xml ["cref"] + xml ["langword"]));
+ }
+ break;
+ }
+ }
+ } while (xml.Read ());
+
+ } catch (Exception ex) {
+ MonoDevelop.Core.LoggingService.LogError (ex.ToString ());
+ return EscapeText (doc);
+ }
+
+ if (IsEmptyDocumentation (ret.ToString ()) && IsEmptyDocumentation (parameterBuilder.ToString ()))
+ return EscapeText (doc);
+ if (string.IsNullOrEmpty (options.HighlightParameter) && exceptionCount > 0)
+ ret.Append (exceptions.ToString ());
+
+ string result = ret.ToString ();
+ if (summaryEnd < 0)
+ summaryEnd = result.Length;
+ if (paramCount > 0) {
+ var paramSb = new StringBuilder ();
+ if (result.Length > 0)
+ paramSb.AppendLine ();/*
+ paramSb.Append ("<small>");
+ paramSb.AppendLine (options.FormatHeading (GettextCatalog.GetPluralString ("Parameter:", "Parameters:", paramCount)));
+ paramSb.Append ("</small>");*/
+ paramSb.Append (parameterBuilder.ToString ());
+ result = result.Insert (summaryEnd, paramSb.ToString ());
+ }
+ result = result.Trim ();
+ if (result.EndsWith (Environment.NewLine + "</small>"))
+ result = result.Substring (0, result.Length - (Environment.NewLine + "</small>").Length) + "</small>";
+ return result;
+ }
+ #endregion
+
+ #region Tooltips
+ static List<AmbienceTooltipProvider> tooltipProviders = new List<AmbienceTooltipProvider>();
+
+ public static async Task<TooltipInformation> GetTooltip (CancellationToken token, ISymbol symbol)
+ {
+ foreach (var tp in tooltipProviders) {
+ var result = await tp.GetTooltip (token, symbol);
+ if (result != null)
+ return result;
+ }
+ return null;
+ }
+ #endregion
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/AmbienceService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/AmbienceService.cs
deleted file mode 100644
index 794144d931..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/AmbienceService.cs
+++ /dev/null
@@ -1,559 +0,0 @@
-//
-// AmbienceService.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections.Generic;
-
-using Mono.Addins;
-using System.Xml;
-using System.Text;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Ide;
-using MonoDevelop.Projects;
-using MonoDevelop.Core;
-using MonoDevelop.Ide.Extensions;
-using ICSharpCode.NRefactory.Documentation;
-
-namespace MonoDevelop.Ide.TypeSystem
-{
- public static class AmbienceService
- {
- static Dictionary <string, Ambience> ambiences = new Dictionary <string, Ambience> ();
-
- static AmbienceService ()
- {
- // may not have been initialized in testing environment.
- if (AddinManager.IsInitialized) {
- AddinManager.AddExtensionNodeHandler ("/MonoDevelop/TypeSystem/Ambiences", delegate(object sender, ExtensionNodeEventArgs args) {
- var ambience = args.ExtensionNode as MimeTypeExtensionNode;
- switch (args.Change) {
- case ExtensionChange.Add:
- ambiences[ambience.MimeType] = (Ambience) ambience.CreateInstance ();
- break;
- case ExtensionChange.Remove:
- ambiences.Remove (ambience.MimeType);
- break;
- }
- });
- }
- }
-
- public static Ambience GetAmbience (IMember member)
- {
- return GetAmbienceForFile (member.DeclaringTypeDefinition.Region.FileName) ?? new NetAmbience ();
- }
-
- public static Ambience GetAmbienceForFile (string fileName)
- {
- if (string.IsNullOrEmpty (fileName))
- return DefaultAmbience;
- return GetAmbience (DesktopService.GetMimeTypeForUri (fileName));
- }
-
- public static Ambience GetAmbience (string mimeType)
- {
- Ambience result;
- if (!string.IsNullOrEmpty (mimeType) && ambiences.TryGetValue (mimeType, out result))
- return result;
- return defaultAmbience;
- }
-
- static Ambience defaultAmbience = new NetAmbience ();
-
- public static Ambience DefaultAmbience { get { return defaultAmbience; } }
- #region Documentation
-
- public class DocumentationFormatOptions
- {
- public static readonly DocumentationFormatOptions Empty = new DocumentationFormatOptions ();
- public string HighlightParameter {
- get;
- set;
- }
-
- public int MaxLineLength {
- get;
- set;
- }
-
- public bool BigHeadings {
- get;
- set;
- }
-
- public bool BoldHeadings {
- get;
- set;
- }
-
- public bool SmallText {
- get;
- set;
- }
-
- public Ambience Ambience {
- get;
- set;
- }
-
-
- public DocumentationFormatOptions ()
- {
- BoldHeadings = true;
- }
-
- public string FormatHeading (string heading)
- {
- string result = heading;
- if (BigHeadings)
- result = "<big>" + result + "</big>";
- if (BoldHeadings)
- result = "<b>" + result + "</b>";
- return result;
- }
-
- public string FormatBody (string body)
- {
- var str = body.Trim ();
- if (string.IsNullOrEmpty (str))
- return "";
- return SmallText ? "<small>" + str + Environment.NewLine + "</small>" : str + Environment.NewLine;
- }
- }
-
- public static string GetSummaryMarkup (IEntity member)
- {
- if (member == null || member.Documentation == null)
- return null;
- string documentation = member.Documentation.Xml.Text;
- if (!string.IsNullOrEmpty (documentation)) {
- int idx1 = documentation.IndexOf ("<summary>", StringComparison.Ordinal);
- int idx2 = documentation.LastIndexOf ("</summary>", StringComparison.Ordinal);
- string result;
- if (idx1 >= 0 && idx2 > idx1) {
- try {
- var xmlText = documentation.Substring (idx1, idx2 - idx1 + "</summary>".Length);
- return ParseBody (member,
- new XmlTextReader (xmlText, XmlNodeType.Element, null),
- "summary",
- DocumentationFormatOptions.Empty
- );
- } catch (Exception e) {
- LoggingService.LogWarning ("Malformed documentation xml detected:" + documentation, e);
- // may happen on malformed xml.
- var len = idx2 - idx1 - "</summary>".Length;
- result = len > 0 ? documentation.Substring (idx1 + "<summary>".Length, len) : documentation;
- }
- } else if (idx1 >= 0) {
- result = documentation.Substring (idx1 + "<summary>".Length);
- } else if (idx2 >= 0) {
- result = documentation.Substring (0, idx2 - 1);
- } else {
- result = documentation;
- }
- return GetDocumentationMarkup (member, CleanEmpty (result));
- }
-
- return GetDocumentationMarkup (member, CleanEmpty (documentation));
- }
-
- static string CleanEmpty (string doc)
- {
- return IsEmptyDocumentation (doc)? null : doc;
- }
-
- static bool IsEmptyDocumentation (string documentation)
- {
- return string.IsNullOrWhiteSpace (documentation) || documentation.StartsWith ("To be added") || documentation == "we have not entered docs yet";
- }
-
- public static string GetDocumentation (IEntity member)
- {
- if (member == null)
- return null;
- if (member.Documentation != null)
- return CleanEmpty (member.Documentation);
- return null;
- }
-
- static string GetCref (ITypeResolveContext ctx, string cref)
- {
- if (cref == null)
- return "";
-
- if (cref.Length < 2)
- return cref;
- try {
- var entity = new DocumentationComment ("", ctx).ResolveCref (cref.Replace("<", "{").Replace(">", "}"));
-
- if (entity != null) {
- var ambience = new ICSharpCode.NRefactory.CSharp.CSharpAmbience ();
- ambience.ConversionFlags = ConversionFlags.ShowParameterList | ConversionFlags.ShowParameterNames | ConversionFlags.ShowTypeParameterList;
- return ambience.ConvertSymbol (entity);
- }
- } catch (Exception e) {
- LoggingService.LogWarning ("Invalid cref:" + cref, e);
- }
-
- if (cref.Substring (1, 1) == ":")
- return cref.Substring (2, cref.Length - 2);
-
- return cref;
- }
-
- static bool IsSpecialChar (int charValue)
- {
- return
- 0x01 <= charValue && charValue <= 0x08 ||
- 0x0B <= charValue && charValue <= 0x0C ||
- 0x0E <= charValue && charValue <= 0x1F ||
- 0x7F <= charValue && charValue <= 0x84 ||
- 0x86 <= charValue && charValue <= 0x9F;
- }
-
- public static string BreakLines (string text, int maxLineLength)
- {
- if (maxLineLength <= 0)
- return text;
- StringBuilder result = new StringBuilder ();
- int lineLength = 0;
- bool inTag = false;
- bool inAmp = false;
- foreach (char ch in text) {
- switch (ch) {
- case '<':
- inTag = true;
- break;
- case '>':
- inTag = false;
- break;
- case '&':
- inAmp = true;
- break;
- case ';':
- inAmp = false;
- break;
- case '\n':
- lineLength = 0;
- break;
- case '\r':
- lineLength = 0;
- break;
- }
-
- result.Append (ch);
- if (!inTag && !inAmp)
- lineLength++;
- if (!Char.IsLetterOrDigit (ch) && lineLength > maxLineLength) {
- result.AppendLine ();
- lineLength = 0;
- }
- }
- return result.ToString ();
- }
-
- public static string EscapeText (string text)
- {
- if (text == null)
- return null;
- StringBuilder result = new StringBuilder ();
- foreach (char ch in text) {
- switch (ch) {
- case '<':
- result.Append ("&lt;");
- break;
- case '>':
- result.Append ("&gt;");
- break;
- case '&':
- result.Append ("&amp;");
- break;
- case '\'':
- result.Append ("&apos;");
- break;
- case '"':
- result.Append ("&quot;");
- break;
- default:
- int charValue = (int)ch;
- if (IsSpecialChar (charValue)) {
- result.AppendFormat ("&#x{0:X};", charValue);
- } else {
- result.Append (ch);
- }
- break;
- }
- }
- return result.ToString ();
- }
-
- public static string UnescapeText (string text)
- {
- var sb = new StringBuilder ();
- for (int i = 0; i < text.Length; i++) {
- char ch = text[i];
- if (ch == '&') {
- int end = text.IndexOf (';', i);
- if (end == -1)
- break;
- string entity = text.Substring (i + 1, end - i - 1);
- switch (entity) {
- case "lt":
- sb.Append ('<');
- break;
- case "gt":
- sb.Append ('>');
- break;
- case "amp":
- sb.Append ('&');
- break;
- case "apos":
- sb.Append ('\'');
- break;
- case "quot":
- sb.Append ('"');
- break;
- }
- i = end;
- } else {
- sb.Append (ch);
- }
- }
- return sb.ToString ();
- }
-
-
- public static string GetDocumentationMarkup (IEntity member, string doc)
- {
- return GetDocumentationMarkup (member, doc, DocumentationFormatOptions.Empty);
- }
-
- static string ParseBody (IEntity member, XmlTextReader xml, string endTagName, DocumentationFormatOptions options)
- {
- StringBuilder result = new StringBuilder ();
- bool wasWhiteSpace = true;
- bool appendSpace = false;
- ITypeResolveContext ctx = member.Compilation.TypeResolveContext;
- while (xml.Read ()) {
- switch (xml.NodeType) {
- case XmlNodeType.EndElement:
- if (xml.Name == endTagName)
- goto end;
- break;
- case XmlNodeType.Element:
- switch (xml.Name.ToLower ()) {
- case "para":
- result.AppendLine (ParseBody (member, xml, xml.Name, options));
- wasWhiteSpace = true;
- break;
- case "see":
- if (!wasWhiteSpace) {
- result.Append (' ');
- wasWhiteSpace = true;
- }
- result.Append ("<i>");
- string name = (GetCref (ctx, xml ["cref"]) + xml ["langword"]).Trim ();
- if (options.Ambience != null)
- name = options.Ambience.GetIntrinsicTypeName (name);
- result.Append (EscapeText (name));
- result.Append ("</i>");
- wasWhiteSpace = false;
- appendSpace = true;
- break;
- case "paramref":
- if (!wasWhiteSpace) {
- result.Append (' ');
- wasWhiteSpace = true;
- }
- result.Append ("<i>");
- result.Append (EscapeText (xml ["name"].Trim ()));
- result.Append ("</i>");
- appendSpace = true;
- wasWhiteSpace = false;
- break;
- }
- break;
- case XmlNodeType.Text:
- if (IsEmptyDocumentation (xml.Value))
- break;
- foreach (char ch in xml.Value) {
- if (!Char.IsWhiteSpace (ch) && appendSpace) {
- result.Append (' ');
- appendSpace = false;
- }
- if (Char.IsWhiteSpace (ch) || ch == '\n' || ch == '\r') {
- if (!wasWhiteSpace) {
- result.Append (' ');
- wasWhiteSpace = true;
- }
- continue;
- }
- wasWhiteSpace = false;
- result.Append (EscapeText (ch.ToString ()));
- }
- break;
- }
- }
- end:
- return result.ToString ().Trim ();
- }
-
- public static string GetDocumentationMarkup (IEntity member, string doc, DocumentationFormatOptions options)
- {
- if (string.IsNullOrEmpty (doc))
- return null;
- System.IO.StringReader reader = new System.IO.StringReader ("<docroot>" + doc + "</docroot>");
- XmlTextReader xml = new XmlTextReader (reader);
- StringBuilder ret = new StringBuilder (70);
- StringBuilder parameterBuilder = new StringBuilder ();
- StringBuilder exceptions = new StringBuilder ();
- exceptions.AppendLine (options.FormatHeading (GettextCatalog.GetString ("Exceptions:")));
- // ret.Append ("<small>");
- int paramCount = 0, exceptionCount = 0, summaryEnd = -1;
- try {
- xml.Read ();
- do {
- if (xml.NodeType == XmlNodeType.Element) {
- switch (xml.Name.ToLower ()) {
- case "para":
- ret.Append (options.FormatBody (ParseBody (member, xml, xml.Name, options)));
- if (summaryEnd < 0)
- summaryEnd = ret.Length;
- break;
- case "summary":
- var summary = options.FormatBody (ParseBody (member, xml, xml.Name, options));
- if (!IsEmptyDocumentation (summary)) {
- // ret.AppendLine (GetHeading ("Summary:", options));
- ret.Append (summary);
- if (summaryEnd < 0)
- summaryEnd = ret.Length;
- }
- break;
- case "remarks":
- if (string.IsNullOrEmpty (options.HighlightParameter)) {
- ret.AppendLine (options.FormatHeading (GettextCatalog.GetString ("Remarks:")));
- ret.Append (options.FormatBody (ParseBody (member, xml, xml.Name, options)));
- if (summaryEnd < 0)
- summaryEnd = ret.Length;
- } else {
- options.FormatBody (ParseBody (member, xml, xml.Name, options));
- }
- break;
- // skip <example>-nodes
- case "example":
- xml.Skip ();
- xml.Skip ();
- break;
- case "exception":
- exceptionCount++;
- if (options.SmallText)
- exceptions.Append ("<small>");
- exceptions.Append ("<b>");
- exceptions.Append (EscapeText (GetCref (member.Compilation.TypeResolveContext, xml ["cref"])));
- exceptions.Append (": ");
- exceptions.Append ("</b>");
- if (options.SmallText)
- exceptions.Append ("</small>");
-
- exceptions.AppendLine (options.FormatBody (ParseBody (member, xml, xml.Name, options)));
- break;
- case "returns":
- if (string.IsNullOrEmpty (options.HighlightParameter)) {
- ret.AppendLine (options.FormatHeading (GettextCatalog.GetString ("Returns:")));
- ret.Append (options.FormatBody (ParseBody (member, xml, xml.Name, options)));
- } else {
- options.FormatBody (ParseBody (member, xml, xml.Name, options));
- }
- break;
- case "param":
- string paramName = xml.GetAttribute ("name") != null ? xml ["name"].Trim () : "";
-
- var body = options.FormatBody (ParseBody (member, xml, xml.Name, options));
- if (!IsEmptyDocumentation (body)) {
- paramCount++;
- parameterBuilder.Append ("<i>");
- if (options.HighlightParameter == paramName)
- parameterBuilder.Append ("<b>");
- if (options.SmallText)
- parameterBuilder.Append ("<small>");
- parameterBuilder.Append (EscapeText (paramName));
- if (options.SmallText)
- parameterBuilder.Append ("</small>");
- if (options.HighlightParameter == paramName)
- parameterBuilder.Append ("</b>");
- parameterBuilder.Append (":</i> ");
- parameterBuilder.Append (body);
- } else {
- return null;
- }
- break;
- case "value":
- ret.AppendLine (options.FormatHeading (GettextCatalog.GetString ("Value:")));
- ret.AppendLine (options.FormatBody (ParseBody (member, xml, xml.Name, options)));
- break;
- case "seealso":
- if (string.IsNullOrEmpty (options.HighlightParameter)) {
- ret.Append (options.FormatHeading (GettextCatalog.GetString ("See also:")));
- ret.Append (" " + EscapeText (GetCref (member.Compilation.TypeResolveContext, xml ["cref"]) + xml ["langword"]));
- }
- break;
- }
- }
- } while (xml.Read ());
-
- } catch (Exception ex) {
- MonoDevelop.Core.LoggingService.LogError (ex.ToString ());
- return EscapeText (doc);
- }
-
- if (IsEmptyDocumentation (ret.ToString ()) && IsEmptyDocumentation (parameterBuilder.ToString ()))
- return EscapeText (doc);
- if (string.IsNullOrEmpty (options.HighlightParameter) && exceptionCount > 0)
- ret.Append (exceptions.ToString ());
-
- string result = ret.ToString ();
- if (summaryEnd < 0)
- summaryEnd = result.Length;
- if (paramCount > 0) {
- var paramSb = new StringBuilder ();
- if (result.Length > 0)
- paramSb.AppendLine ();/*
- paramSb.Append ("<small>");
- paramSb.AppendLine (options.FormatHeading (GettextCatalog.GetPluralString ("Parameter:", "Parameters:", paramCount)));
- paramSb.Append ("</small>");*/
- paramSb.Append (parameterBuilder.ToString ());
- result = result.Insert (summaryEnd, paramSb.ToString ());
- }
- result = result.Trim ();
- if (result.EndsWith (Environment.NewLine + "</small>"))
- result = result.Substring (0, result.Length - (Environment.NewLine + "</small>").Length) + "</small>";
- return result;
- }
- #endregion
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/AmbienceTooltipProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/AmbienceTooltipProvider.cs
new file mode 100644
index 0000000000..69bc9d4e65
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/AmbienceTooltipProvider.cs
@@ -0,0 +1,42 @@
+//
+// AmbienceTooltipProvider.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using MonoDevelop.Ide.CodeCompletion;
+using Microsoft.CodeAnalysis;
+using System.Threading.Tasks;
+using System.Threading;
+
+namespace MonoDevelop.Ide.TypeSystem
+{
+ /// <summary>
+ /// Provides tooltips for a roslyn symbol.
+ /// Note: Intentionally part of internal extension API.
+ /// </summary>
+ abstract class AmbienceTooltipProvider
+ {
+ public abstract Task<TooltipInformation> GetTooltip (CancellationToken token, ISymbol symbol);
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/CodeGenerationService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/CodeGenerationService.cs
deleted file mode 100644
index 42d8e0116f..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/CodeGenerationService.cs
+++ /dev/null
@@ -1,580 +0,0 @@
-//
-// CodeGenerationService.cs
-//
-// Author:
-// mkrueger <mkrueger@novell.com>
-//
-// Copyright (c) 2011 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
-using Mono.TextEditor;
-using MonoDevelop.Core;
-using System.CodeDom;
-using MonoDevelop.Projects;
-using System.CodeDom.Compiler;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory;
-using MonoDevelop.Ide.TypeSystem;
-using MonoDevelop.Ide;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
-using System.Threading.Tasks;
-
-namespace MonoDevelop.Ide.TypeSystem
-{
- public static class CodeGenerationService
- {
- public static IUnresolvedMember AddCodeDomMember (Project project, IUnresolvedTypeDefinition type, CodeTypeMember newMember)
- {
- bool isOpen;
- var data = TextFileProvider.Instance.GetTextEditorData (type.Region.FileName, out isOpen);
- var parsedDocument = TypeSystemService.ParseFile (data.Document.FileName, data.Document.MimeType, data.Text);
-
- var insertionPoints = GetInsertionPoints (data, parsedDocument, type);
-
- var suitableInsertionPoint = GetSuitableInsertionPoint (insertionPoints, type, newMember);
-
- var dotNetProject = project as DotNetProject;
- if (dotNetProject == null) {
- LoggingService.LogError ("Only .NET projects are supported.");
- return null;
- }
-
- var generator = dotNetProject.LanguageBinding.GetCodeDomProvider ();
- StringWriter sw = new StringWriter ();
- var options = new CodeGeneratorOptions ();
- options.IndentString = data.GetLineIndent (type.Region.BeginLine) + "\t";
- if (newMember is CodeMemberMethod)
- options.BracingStyle = "C";
- generator.GenerateCodeFromMember (newMember, sw, options);
-
- var code = sw.ToString ();
- if (!string.IsNullOrEmpty (code))
- suitableInsertionPoint.Insert (data, code);
- if (!isOpen) {
- try {
- File.WriteAllText (type.Region.FileName, data.Text);
- } catch (Exception e) {
- LoggingService.LogError (string.Format ("Failed to write file '{0}'.", type.Region.FileName), e);
- MessageService.ShowError (GettextCatalog.GetString ("Failed to write file '{0}'.", type.Region.FileName));
- }
- }
- var newDocument = TypeSystemService.ParseFile (data.FileName, data.MimeType, data.Text);
- return newDocument.ParsedFile.GetMember (suitableInsertionPoint.Location.Line, int.MaxValue);
- }
-
- public static void AddNewMember (ITypeDefinition type, IUnresolvedTypeDefinition part, IUnresolvedMember newMember, bool implementExplicit = false)
- {
- bool isOpen;
- var data = TextFileProvider.Instance.GetTextEditorData (part.Region.FileName, out isOpen);
- var parsedDocument = TypeSystemService.ParseFile (data.FileName, data.MimeType, data.Text);
-
- var insertionPoints = GetInsertionPoints (data, parsedDocument, part);
-
- var suitableInsertionPoint = GetSuitableInsertionPoint (insertionPoints, part, newMember);
-
- var generator = CreateCodeGenerator (data, type.Compilation);
-
- generator.IndentLevel = CalculateBodyIndentLevel (parsedDocument.GetInnermostTypeDefinition (type.Region.Begin));
- var generatedCode = generator.CreateMemberImplementation (type, part, newMember, implementExplicit);
- suitableInsertionPoint.Insert (data, generatedCode.Code);
- if (!isOpen) {
- try {
- File.WriteAllText (type.Region.FileName, data.Text);
- } catch (Exception e) {
- LoggingService.LogError (GettextCatalog.GetString ("Failed to write file '{0}'.", type.Region.FileName), e);
- MessageService.ShowError (GettextCatalog.GetString ("Failed to write file '{0}'.", type.Region.FileName));
- }
- }
- }
-
- public static Task<bool> InsertMemberWithCursor (
- string operation, ITypeDefinition parentType, IUnresolvedTypeDefinition part,
- IUnresolvedMember newMember, bool implementExplicit = false)
- {
- var tcs = new TaskCompletionSource<bool>();
- if (parentType == null)
- return tcs.Task;
- part = part ?? FindCurrentPart (parentType);
- if (part == null)
- return tcs.Task;
- var loadedDocument = IdeApp.Workbench.OpenDocument (part.Region.FileName);
- loadedDocument.RunWhenLoaded (delegate {
- var editor = loadedDocument.Editor;
- var loc = part.Region.Begin;
- var parsedDocument = loadedDocument.UpdateParseDocument ();
- var declaringType = parsedDocument.GetInnermostTypeDefinition (loc);
- var mode = new InsertionCursorEditMode (
- editor.Parent,
- CodeGenerationService.GetInsertionPoints (loadedDocument, declaringType));
- if (mode.InsertionPoints.Count == 0) {
- MessageService.ShowError (
- GettextCatalog.GetString ("No valid insertion point can be found in type '{0}'.", declaringType.Name)
- );
- return;
- }
- var suitableInsertionPoint = GetSuitableInsertionPoint (mode.InsertionPoints, part, newMember);
- if (suitableInsertionPoint != null)
- mode.CurIndex = mode.InsertionPoints.IndexOf (suitableInsertionPoint);
- else
- mode.CurIndex = 0;
-
- var helpWindow = new Mono.TextEditor.PopupWindow.InsertionCursorLayoutModeHelpWindow () {
- TitleText = operation
- };
- mode.HelpWindow = helpWindow;
-
- mode.StartMode ();
- mode.Exited += delegate(object s, InsertionCursorEventArgs iCArgs) {
- if (!iCArgs.Success) {
- tcs.SetResult (false);
- return;
- }
- var generator = CreateCodeGenerator (editor, parentType.Compilation);
- generator.IndentLevel = CalculateBodyIndentLevel (declaringType);
- var generatedCode = generator.CreateMemberImplementation (parentType, part, newMember, implementExplicit);
- mode.InsertionPoints[mode.CurIndex].Insert (editor, generatedCode.Code);
- tcs.SetResult (true);
- };
- });
-
- return tcs.Task;
- }
-
- public static IUnresolvedTypeDefinition FindCurrentPart (ITypeDefinition type)
- {
- var active = IdeApp.Workbench.ActiveDocument;
- if (active != null) {
- var partsInFile = type.Parts.Where (p => p.Region.FileName == active.FileName).ToList ();
-
- foreach (var p in partsInFile) {
- if (p.Region.Contains (active.Editor.Caret.Location))
- return p;
- }
- if (partsInFile.Count > 0)
- return partsInFile[0];
- }
-
- return type.Parts.FirstOrDefault ();
- }
-
- public static Task<bool> InsertMember (
- ITypeDefinition parentType, IUnresolvedTypeDefinition part,
- IUnresolvedMember newMember, bool implementExplicit = false)
- {
- var tcs = new TaskCompletionSource<bool>();
- if (parentType == null)
- return tcs.Task;
- part = part ?? FindCurrentPart (parentType);
- if (part == null)
- return tcs.Task;
-
- var loadedDocument = IdeApp.Workbench.OpenDocument (part.Region.FileName);
- loadedDocument.RunWhenLoaded (delegate {
- var editor = loadedDocument.Editor;
- var loc = part.Region.Begin;
- var parsedDocument = loadedDocument.UpdateParseDocument ();
- var declaringType = parsedDocument.GetInnermostTypeDefinition (loc);
- var insertionPoints = CodeGenerationService.GetInsertionPoints (loadedDocument, declaringType);
- if (insertionPoints.Count == 0) {
- MessageService.ShowError (
- GettextCatalog.GetString ("No valid insertion point can be found in type '{0}'.", declaringType.Name)
- );
- return;
- }
- var suitableInsertionPoint = GetSuitableInsertionPoint (insertionPoints, part, newMember) ?? insertionPoints.First ();
-
- var generator = CreateCodeGenerator (editor, parentType.Compilation);
- generator.IndentLevel = CalculateBodyIndentLevel (declaringType);
- var generatedCode = generator.CreateMemberImplementation (parentType, part, newMember, implementExplicit);
- suitableInsertionPoint.Insert (editor, generatedCode.Code);
- });
-
- return tcs.Task;
- }
-
- public static int CalculateBodyIndentLevel (IUnresolvedTypeDefinition declaringType)
- {
- if (declaringType == null)
- return 0;
- int indentLevel = 1;
- while (declaringType.DeclaringTypeDefinition != null) {
- indentLevel++;
- declaringType = declaringType.DeclaringTypeDefinition;
- }
- var file = declaringType.UnresolvedFile as CSharpUnresolvedFile;
- if (file == null)
- return indentLevel;
- var scope = file.GetUsingScope (declaringType.Region.Begin);
- while (scope != null && !string.IsNullOrEmpty (scope.NamespaceName)) {
- indentLevel++;
- // skip virtual scopes.
- while (scope.Parent != null && scope.Parent.Region == scope.Region)
- scope = scope.Parent;
- scope = scope.Parent;
- }
- return indentLevel;
- }
-
- public static void AddNewMembers (Project project, ITypeDefinition type, IUnresolvedTypeDefinition part, IEnumerable<IUnresolvedMember> newMembers, string regionName = null, Func<IUnresolvedMember, bool> implementExplicit = null)
- {
- IUnresolvedMember firstNewMember = newMembers.FirstOrDefault ();
- if (firstNewMember == null)
- return;
- bool isOpen;
- var data = TextFileProvider.Instance.GetTextEditorData (part.Region.FileName, out isOpen);
- var parsedDocument = TypeSystemService.ParseFile (project, data);
-
- var insertionPoints = GetInsertionPoints (data, parsedDocument, part);
-
-
- var suitableInsertionPoint = GetSuitableInsertionPoint (insertionPoints, part, firstNewMember);
-
- var generator = CreateCodeGenerator (data, type.Compilation);
- generator.IndentLevel = CalculateBodyIndentLevel (parsedDocument.GetInnermostTypeDefinition (part.Region.Begin));
- StringBuilder sb = new StringBuilder ();
- foreach (var newMember in newMembers) {
- if (sb.Length > 0) {
- sb.AppendLine ();
- sb.AppendLine ();
- }
- sb.Append (generator.CreateMemberImplementation (type, part, newMember, implementExplicit != null ? implementExplicit (newMember) : false).Code);
- }
- suitableInsertionPoint.Insert (data, string.IsNullOrEmpty (regionName) ? sb.ToString () : generator.WrapInRegions (regionName, sb.ToString ()));
- if (!isOpen) {
- try {
- File.WriteAllText (type.Region.FileName, data.Text);
- } catch (Exception e) {
- LoggingService.LogError (GettextCatalog.GetString ("Failed to write file '{0}'.", type.Region.FileName), e);
- MessageService.ShowError (GettextCatalog.GetString ("Failed to write file '{0}'.", type.Region.FileName));
- }
- }
- }
-
- public static CodeGenerator CreateCodeGenerator (this Ide.Gui.Document doc)
- {
- return CodeGenerator.CreateGenerator (doc);
- }
-
- public static CodeGenerator CreateCodeGenerator (this TextEditorData data, ICompilation compilation)
- {
- return CodeGenerator.CreateGenerator (data, compilation);
- }
-
- static IUnresolvedTypeDefinition GetMainPart (IType t)
- {
- return t.GetDefinition ().Parts.First ();
- }
-
- #region Insertion Points
- public static List<InsertionPoint> GetInsertionPoints (MonoDevelop.Ide.Gui.Document document, IUnresolvedTypeDefinition type)
- {
- if (document == null)
- throw new ArgumentNullException ("document");
- if (document.ParsedDocument == null)
- return new List<InsertionPoint> ();
- return GetInsertionPoints (document.Editor, document.ParsedDocument, type);
- }
-
- public static List<InsertionPoint> GetInsertionPoints (TextEditorData data, ParsedDocument parsedDocument, IUnresolvedTypeDefinition type)
- {
- if (data == null)
- throw new ArgumentNullException ("data");
- if (parsedDocument == null)
- throw new ArgumentNullException ("parsedDocument");
- if (type == null)
- throw new ArgumentNullException ("type");
-
- // update type from parsed document, since this is always newer.
- //type = parsedDocument.GetInnermostTypeDefinition (type.GetLocation ()) ?? type;
- List<InsertionPoint> result = new List<InsertionPoint> ();
- int offset = data.LocationToOffset (type.Region.Begin);
- if (offset < 0 || type.BodyRegion.IsEmpty)
- return result;
- while (offset < data.Length && data.GetCharAt (offset) != '{') {
- offset++;
- }
- var realStartLocation = data.OffsetToLocation (offset);
- result.Add (GetInsertionPosition (data.Document, realStartLocation.Line, realStartLocation.Column));
- result [0].LineBefore = NewLineInsertion.None;
-
- foreach (var member in type.Members) {
- TextLocation domLocation = member.BodyRegion.End;
- if (domLocation.Line <= 0) {
- DocumentLine lineSegment = data.GetLine (member.Region.BeginLine);
- if (lineSegment == null)
- continue;
- domLocation = new TextLocation (member.Region.BeginLine, lineSegment.Length + 1);
- }
- result.Add (GetInsertionPosition (data.Document, domLocation.Line, domLocation.Column));
- }
-
- foreach (var nestedType in type.NestedTypes) {
- TextLocation domLocation = nestedType.BodyRegion.End;
- if (domLocation.Line <= 0) {
- DocumentLine lineSegment = data.GetLine (nestedType.Region.BeginLine);
- if (lineSegment == null)
- continue;
- domLocation = new TextLocation (nestedType.Region.BeginLine, lineSegment.Length + 1);
- }
- result.Add (GetInsertionPosition (data.Document, domLocation.Line, domLocation.Column));
- }
-
- result [result.Count - 1].LineAfter = NewLineInsertion.None;
- CheckStartPoint (data.Document, result [0], result.Count == 1);
- if (result.Count > 1) {
- result.RemoveAt (result.Count - 1);
- NewLineInsertion insertLine;
- var lineBefore = data.GetLine (type.BodyRegion.EndLine - 1);
- if (lineBefore != null && lineBefore.Length == lineBefore.GetIndentation (data.Document).Length) {
- insertLine = NewLineInsertion.None;
- } else {
- insertLine = NewLineInsertion.Eol;
- }
- // search for line start
- int col = type.BodyRegion.EndColumn - 1;
- var line = data.GetLine (type.BodyRegion.EndLine);
- if (line != null) {
- var lineOffset = line.Offset;
- col = Math.Min (line.Length, col);
- while (lineOffset + col - 2 >= 0 && col > 1 && char.IsWhiteSpace (data.GetCharAt (lineOffset + col - 2)))
- col--;
- }
- result.Add (new InsertionPoint (new DocumentLocation (type.BodyRegion.EndLine, col), insertLine, NewLineInsertion.Eol));
- CheckEndPoint (data.Document, result [result.Count - 1], result.Count == 1);
- }
-
- foreach (var region in parsedDocument.UserRegions.Where (r => type.BodyRegion.IsInside (r.Region.Begin))) {
- result.Add (new InsertionPoint (new DocumentLocation (region.Region.BeginLine + 1, 1), NewLineInsertion.Eol, NewLineInsertion.Eol));
- result.Add (new InsertionPoint (new DocumentLocation (region.Region.EndLine, 1), NewLineInsertion.Eol, NewLineInsertion.Eol));
- result.Add (new InsertionPoint (new DocumentLocation (region.Region.EndLine + 1, 1), NewLineInsertion.Eol, NewLineInsertion.Eol));
- }
- result.Sort ((left, right) => left.Location.CompareTo (right.Location));
-// foreach (var res in result)
-// Console.WriteLine (res);
- return result;
- }
-
- static void CheckEndPoint (TextDocument doc, InsertionPoint point, bool isStartPoint)
- {
- DocumentLine line = doc.GetLine (point.Location.Line);
- if (line == null)
- return;
-
- if (doc.GetLineIndent (line).Length + 1 < point.Location.Column)
- point.LineBefore = NewLineInsertion.BlankLine;
- if (point.Location.Column < line.Length + 1)
- point.LineAfter = NewLineInsertion.Eol;
- }
-
- static void CheckStartPoint (TextDocument doc, InsertionPoint point, bool isEndPoint)
- {
- DocumentLine line = doc.GetLine (point.Location.Line);
- if (line == null)
- return;
- if (doc.GetLineIndent (line).Length + 1 == point.Location.Column) {
- int lineNr = point.Location.Line;
- while (lineNr > 1 && doc.GetLineIndent (lineNr - 1).Length == doc.GetLine (lineNr - 1).Length) {
- lineNr--;
- }
- line = doc.GetLine (lineNr);
- point.Location = new DocumentLocation (lineNr, doc.GetLineIndent (line).Length + 1);
- }
-
- if (doc.GetLineIndent (line).Length + 1 < point.Location.Column)
- point.LineBefore = NewLineInsertion.Eol;
- if (point.Location.Column < line.Length + 1)
- point.LineAfter = isEndPoint ? NewLineInsertion.Eol : NewLineInsertion.BlankLine;
- }
-
- static InsertionPoint GetInsertionPosition (TextDocument doc, int line, int column)
- {
- int bodyEndOffset = doc.LocationToOffset (line, column) + 1;
- DocumentLine curLine = doc.GetLine (line);
- if (curLine != null) {
- if (bodyEndOffset < curLine.Offset + curLine.Length) {
- // case1: positition is somewhere inside the start line
- return new InsertionPoint (new DocumentLocation (line, column + 1), NewLineInsertion.Eol, NewLineInsertion.BlankLine);
- }
- }
-
- // -> if position is at line end check next line
- DocumentLine nextLine = doc.GetLine (line + 1);
- if (nextLine == null) // check for 1 line case.
- return new InsertionPoint (new DocumentLocation (line, column + 1), NewLineInsertion.BlankLine, NewLineInsertion.BlankLine);
-
- for (int i = nextLine.Offset; i < nextLine.EndOffset; i++) {
- char ch = doc.GetCharAt (i);
- if (!char.IsWhiteSpace (ch)) {
- // case2: next line contains non ws chars.
- return new InsertionPoint (new DocumentLocation (line + 1, 1), NewLineInsertion.Eol, NewLineInsertion.BlankLine);
- }
- }
-
- DocumentLine nextLine2 = doc.GetLine (line + 2);
- if (nextLine2 != null) {
- for (int i = nextLine2.Offset; i < nextLine2.EndOffset; i++) {
- char ch = doc.GetCharAt (i);
- if (!char.IsWhiteSpace (ch)) {
- // case3: one blank line
- return new InsertionPoint (new DocumentLocation (line + 1, 1), NewLineInsertion.Eol, NewLineInsertion.Eol);
- }
- }
- }
- // case4: more than 1 blank line
- return new InsertionPoint (new DocumentLocation (line + 1, 1), NewLineInsertion.Eol, NewLineInsertion.None);
- }
-
- static InsertionPoint GetSuitableInsertionPoint (IEnumerable<InsertionPoint> points, IUnresolvedTypeDefinition cls, IUnresolvedMember member)
- {
- var mainPart = cls;
- switch (member.SymbolKind) {
- case SymbolKind.Field:
- return GetNewFieldPosition (points, mainPart);
- case SymbolKind.Method:
- case SymbolKind.Constructor:
- case SymbolKind.Destructor:
- case SymbolKind.Operator:
- return GetNewMethodPosition (points, mainPart);
- case SymbolKind.Event:
- return GetNewEventPosition (points, mainPart);
- case SymbolKind.Property:
- return GetNewPropertyPosition (points, mainPart);
- }
- throw new InvalidOperationException ("Invalid member type: " + member.SymbolKind);
- }
-
- static InsertionPoint GetSuitableInsertionPoint (IEnumerable<InsertionPoint> points, IUnresolvedTypeDefinition cls, CodeTypeMember mem)
- {
- var mainPart = cls;
- if (mem is System.CodeDom.CodeMemberEvent)
- return GetNewEventPosition (points, mainPart);
- if (mem is System.CodeDom.CodeMemberProperty)
- return GetNewPropertyPosition (points, mainPart);
- if (mem is System.CodeDom.CodeMemberField)
- return GetNewFieldPosition (points, mainPart);
- if (mem is System.CodeDom.CodeMemberMethod)
- return GetNewMethodPosition (points, mainPart);
- return GetNewFieldPosition (points, mainPart);
- }
-
- static InsertionPoint GetNewFieldPosition (IEnumerable<InsertionPoint> points, IUnresolvedTypeDefinition cls)
- {
- if (!cls.Fields.Any ())
- return points.FirstOrDefault ();
- var lastField = cls.Fields.Last ();
- return points.FirstOrDefault (p => p.Location.Convert () > lastField.Region.Begin);
- }
-
- static InsertionPoint GetNewMethodPosition (IEnumerable<InsertionPoint> points, IUnresolvedTypeDefinition cls)
- {
- if (!cls.Methods.Any ())
- return GetNewPropertyPosition (points, cls);
- var lastMember = cls.Members.Last ();
- return points.FirstOrDefault (p => p.Location.Convert () > lastMember.Region.Begin);
- }
-
- static InsertionPoint GetNewPropertyPosition (IEnumerable<InsertionPoint> points, IUnresolvedTypeDefinition cls)
- {
- if (!cls.Properties.Any ())
- return GetNewFieldPosition (points, cls);
- var lastProperty = cls.Properties.Last ();
- return points.FirstOrDefault (p => p.Location.Convert () > lastProperty.Region.Begin);
- }
-
- static InsertionPoint GetNewEventPosition (IEnumerable<InsertionPoint> points, IUnresolvedTypeDefinition cls)
- {
- if (!cls.Events.Any ())
- return GetNewMethodPosition (points, cls);
- var lastEvent = cls.Events.Last ();
- return points.FirstOrDefault (p => p.Location.Convert () > lastEvent.Region.Begin);
- }
- #endregion
-
- public static void AddAttribute (ITypeDefinition cls, string name, params object[] parameters)
- {
- bool isOpen;
- string fileName = cls.Region.FileName;
- var buffer = TextFileProvider.Instance.GetTextEditorData (fileName, out isOpen);
-
- var attr = new CodeAttributeDeclaration (name);
- foreach (var parameter in parameters) {
- attr.Arguments.Add (new CodeAttributeArgument (new CodePrimitiveExpression (parameter)));
- }
-
- var type = new CodeTypeDeclaration ("temp");
- type.CustomAttributes.Add (attr);
- Project project;
- if (!cls.TryGetSourceProject (out project)) {
- LoggingService.LogError ("Error can't get source project for:" + cls.FullName);
- }
-
- var provider = ((DotNetProject)project).LanguageBinding.GetCodeDomProvider ();
- var sw = new StringWriter ();
- provider.GenerateCodeFromType (type, sw, new CodeGeneratorOptions ());
- string code = sw.ToString ();
- int start = code.IndexOf ('[');
- int end = code.LastIndexOf (']');
- code = code.Substring (start, end - start + 1) + Environment.NewLine;
-
- int pos = buffer.LocationToOffset (cls.Region.BeginLine, cls.Region.BeginColumn);
-
- code = buffer.GetLineIndent (cls.Region.BeginLine) + code;
- buffer.Insert (pos, code);
- if (!isOpen) {
- File.WriteAllText (fileName, buffer.Text);
- buffer.Dispose ();
- }
-
- }
-
- public static IUnresolvedTypeDefinition AddType (DotNetProject project, string folder, string namspace, CodeTypeDeclaration type)
- {
-
- var unit = new CodeCompileUnit ();
- var ns = new CodeNamespace (namspace);
- ns.Types.Add (type);
- unit.Namespaces.Add (ns);
-
- string fileName = project.LanguageBinding.GetFileName (Path.Combine (folder, type.Name));
- using (var sw = new StreamWriter (fileName)) {
- var provider = project.LanguageBinding.GetCodeDomProvider ();
- var options = new CodeGeneratorOptions ();
- options.IndentString = "\t";
- options.BracingStyle = "C";
-
- provider.GenerateCodeFromCompileUnit (unit, sw, options);
- }
- return TypeSystemService.ParseFile (project, fileName).TopLevelTypeDefinitions.FirstOrDefault ();
- }
-
- }
-
- public static class HelperMethods
- {
- public static TextLocation Convert (this DocumentLocation location)
- {
- return new TextLocation (location.Line, location.Column);
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/CodeGenerator.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/CodeGenerator.cs
index 1b1d6e1310..760496caed 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/CodeGenerator.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/CodeGenerator.cs
@@ -29,12 +29,12 @@ using System.Collections.Generic;
using System.Linq;
using Mono.Addins;
using ICSharpCode.NRefactory.TypeSystem;
-using Mono.TextEditor;
using MonoDevelop.Core.AddIns;
using MonoDevelop.Ide.TypeSystem;
using ICSharpCode.NRefactory;
using MonoDevelop.Projects.Policies;
using MonoDevelop.Ide.Extensions;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Ide.TypeSystem
{
@@ -67,36 +67,39 @@ namespace MonoDevelop.Ide.TypeSystem
set;
}
- public ICompilation Compilation {
- get;
- set;
- }
-
- public static CodeGenerator CreateGenerator (Ide.Gui.Document doc)
+ public static CodeGenerator CreateGenerator (TextEditor editor, DocumentContext documentContext)
{
MimeTypeExtensionNode node;
- if (!generators.TryGetValue (doc.Editor.MimeType, out node))
+ if (!generators.TryGetValue (editor.MimeType, out node))
return null;
var result = (CodeGenerator)node.CreateInstance ();
- result.UseSpaceIndent = doc.Editor.TabsToSpaces;
- result.EolMarker = doc.Editor.EolMarker;
- result.TabSize = doc.Editor.Options.TabSize;
- result.Compilation = doc.Compilation;
+
+ result.UseSpaceIndent = editor.Options.TabsToSpaces;
+ result.EolMarker = editor.EolMarker;
+ result.TabSize = editor.Options.TabSize;
+
return result;
}
-
- public static CodeGenerator CreateGenerator (TextEditorData editor, ICompilation compilation)
+
+ public static CodeGenerator CreateGenerator (Ide.Gui.Document doc)
+ {
+ return CreateGenerator (doc.Editor, doc);
+ }
+
+ public static CodeGenerator CreateGenerator (ITextDocument editor, ICompilation compilation)
{
MimeTypeExtensionNode node;
if (!generators.TryGetValue (editor.MimeType, out node))
return null;
var result = (CodeGenerator)node.CreateInstance ();
- result.UseSpaceIndent = editor.TabsToSpaces;
- result.EolMarker = editor.EolMarker;
- result.TabSize = editor.Options.TabSize;
- result.Compilation = compilation;
+
+ //result.UseSpaceIndent = editor.Options.TabsToSpaces;
+ result.EolMarker = editor.GetEolMarker ();
+ //result.TabSize = editor.Options.TabSize;
+ //result.Compilation = compilation;
+
return result;
}
@@ -154,12 +157,6 @@ namespace MonoDevelop.Ide.TypeSystem
generators.Remove (node.MimeType);
}
- protected void SetIndentTo (IUnresolvedTypeDefinition implementingType)
- {
- if (IndentLevel < 0)
- IndentLevel = AutoIndent ? CodeGenerationService.CalculateBodyIndentLevel (implementingType) : 0;
- }
-
static bool CompareMethods (IMethod interfaceMethod, IMethod typeMethod)
{
if (typeMethod.IsExplicitInterfaceImplementation)
@@ -168,15 +165,26 @@ namespace MonoDevelop.Ide.TypeSystem
}
public abstract string WrapInRegions (string regionName, string text);
- public abstract CodeGeneratorMemberResult CreateMemberImplementation (ITypeDefinition implementingType, IUnresolvedTypeDefinition part, IUnresolvedMember member, bool explicitDeclaration);
- public abstract CodeGeneratorMemberResult CreateMemberImplementation (ITypeDefinition implementingType, IUnresolvedTypeDefinition part, IMember member, bool explicitDeclaration);
- public abstract string CreateFieldEncapsulation (IUnresolvedTypeDefinition implementingType, IField field, string propertyName, Accessibility modifiers, bool readOnly);
+ public abstract void AddGlobalNamespaceImport (TextEditor editor, DocumentContext context, string nsName);
+ public abstract void AddLocalNamespaceImport (TextEditor editor, DocumentContext context, string nsName, TextLocation caretLocation);
+
+ public void AddGlobalNamespaceImport (MonoDevelop.Ide.Gui.Document doc, string nsName)
+ {
+ if (doc == null)
+ throw new ArgumentNullException ("doc");
+ AddGlobalNamespaceImport (doc.Editor, doc, nsName);
+ }
+
+ public void AddLocalNamespaceImport (MonoDevelop.Ide.Gui.Document doc, string nsName, TextLocation caretLocation)
+ {
+ if (doc == null)
+ throw new ArgumentNullException ("doc");
+ AddLocalNamespaceImport (doc.Editor, doc, nsName, caretLocation);
+ }
- public abstract void AddGlobalNamespaceImport (MonoDevelop.Ide.Gui.Document doc, string nsName);
- public abstract void AddLocalNamespaceImport (MonoDevelop.Ide.Gui.Document doc, string nsName, TextLocation caretLocation);
- public abstract string GetShortTypeString (MonoDevelop.Ide.Gui.Document doc, IType type);
+ //public abstract string GetShortTypeString (TextEditor editor, DocumentContext context, IType type);
public abstract void CompleteStatement (MonoDevelop.Ide.Gui.Document doc);
}
@@ -230,4 +238,4 @@ namespace MonoDevelop.Ide.TypeSystem
}
}
}
-} \ No newline at end of file
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/Comment.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/Comment.cs
index 6f615285ba..7dc51de3f2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/Comment.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/Comment.cs
@@ -26,7 +26,8 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
-using ICSharpCode.NRefactory.TypeSystem;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
namespace MonoDevelop.Ide.TypeSystem
{
@@ -55,7 +56,13 @@ namespace MonoDevelop.Ide.TypeSystem
set;
}
- public DomRegion Region {
+ public bool HasRegion {
+ get {
+ return !Region.IsEmpty;
+ }
+ }
+
+ public DocumentRegion Region {
get;
set;
}
@@ -86,7 +93,7 @@ namespace MonoDevelop.Ide.TypeSystem
public override string ToString ()
{
- return string.Format ("[Comment: OpenTag={0}, ClosingTag={1}, Region={3}, IsDocumentation={4}, CommentStartsLine={5}, CommentType={6}]", OpenTag, ClosingTag, Text, Region, IsDocumentation, CommentStartsLine, CommentType);
+ return $"[Comment: OpenTag={OpenTag}, ClosingTag={ClosingTag}, Region={Region}, Text={Text}, IsDocumentation={IsDocumentation}, CommentStartsLine={CommentStartsLine}, CommentType={CommentType}]";
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ConditionalRegion.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ConditionalRegion.cs
deleted file mode 100644
index f0d1bb4c98..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ConditionalRegion.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-// ConditionalRegion.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-using System;
-using System.Collections.Generic;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory;
-
-namespace MonoDevelop.Ide.TypeSystem
-{
- [Serializable]
- public class ConditionBlock
- {
- public string Flag {
- get;
- set;
- }
-
- public DomRegion Region {
- get;
- set;
- }
-
- public TextLocation Start {
- get;
- set;
- }
-
- public TextLocation End {
- get;
- set;
- }
-
- public ConditionBlock (string flag) : this (flag, TextLocation.Empty)
- {
- }
-
- public ConditionBlock (string flag, TextLocation start)
- {
- this.Flag = flag;
- this.Start = start;
- this.Region = DomRegion.Empty;
- }
- }
-
- [Serializable]
- public class ConditionalRegion : ConditionBlock
- {
- public DomRegion ElseBlock {
- get;
- set;
- }
-
- List<ConditionBlock> conditionBlocks = new List<ConditionBlock> ();
-
- public List<ConditionBlock> ConditionBlocks {
- get {
- return conditionBlocks;
- }
- }
-
- public ConditionalRegion (string flag) : base (flag)
- {
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/DocumentTrackingService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/DocumentTrackingService.cs
new file mode 100644
index 0000000000..057f415135
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/DocumentTrackingService.cs
@@ -0,0 +1,59 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis;
+using System.Composition;
+
+namespace MonoDevelop.Ide.TypeSystem
+{
+ //MD is added to name to make it clear this is not IDocumentTrackingService from Microsoft.CodeAnalyis.Features.dll
+ //But it does mimic it's behavior
+ interface IMDDocumentTrackingService : IWorkspaceService
+ {
+ event EventHandler<DocumentId> ActiveDocumentChanged;
+
+ DocumentId GetActiveDocument ();
+ }
+
+// [ExportWorkspaceServiceFactory (typeof(IMDDocumentTrackingService), ServiceLayer.Host), Shared]
+ class MonoDevelopDocumentTrackingServiceFactory : IWorkspaceServiceFactory
+ {
+ private IMDDocumentTrackingService _singleton;
+
+ public IWorkspaceService CreateService (HostWorkspaceServices workspaceServices)
+ {
+ return _singleton ?? (_singleton = new MonoDevelopDocumentTrackingService ());
+ }
+
+ public class MonoDevelopDocumentTrackingService : IMDDocumentTrackingService
+ {
+ public MonoDevelopDocumentTrackingService ()
+ {
+ if (IdeApp.IsInitialized)
+ IdeApp.Workbench.ActiveDocumentChanged += MonoDevelop_Ide_IdeApp_Workbench_ActiveDocumentChanged;
+ }
+
+ #region IDocumentTrackingService implementation
+
+ public event EventHandler<DocumentId> ActiveDocumentChanged;
+
+ public DocumentId GetActiveDocument ()
+ {
+ var document = IdeApp.Workbench?.ActiveDocument;
+ if (document == null)
+ return null;
+ return TypeSystemService.GetDocumentId (document.Project, document.FileName);
+ }
+
+ #endregion
+
+ void MonoDevelop_Ide_IdeApp_Workbench_ActiveDocumentChanged (object sender, EventArgs e)
+ {
+ ActiveDocumentChanged?.Invoke (null, GetActiveDocument ());
+ }
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/Error.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/Error.cs
new file mode 100644
index 0000000000..ca6a00634b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/Error.cs
@@ -0,0 +1,216 @@
+//
+// Error.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 mkrueger
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Core.Text;
+using MonoDevelop.Ide.Editor;
+
+namespace MonoDevelop.Ide.TypeSystem
+{
+ /// <summary>
+ /// Enum that describes the type of an error.
+ /// </summary>
+ public enum ErrorType
+ {
+ Unknown,
+ Error,
+ Warning
+ }
+
+ /// <summary>
+ /// Descibes an error during parsing.
+ /// </summary>
+ [Serializable]
+ public class Error
+ {
+ readonly ErrorType errorType;
+ readonly string message;
+ readonly DocumentRegion region;
+
+ /// <summary>
+ /// The type of the error.
+ /// </summary>
+ public ErrorType ErrorType { get { return errorType; } }
+
+ /// <summary>
+ /// The error description.
+ /// </summary>
+ public string Message { get { return message; } }
+
+ /// <summary>
+ /// The id of the error.
+ /// </summary>
+ public string Id { get; private set; }
+
+ /// <summary>
+ /// The region of the error.
+ /// </summary>
+ public DocumentRegion Region { get { return region; } }
+
+ /// <summary>
+ /// Gets or sets the tag.
+ /// </summary>
+ public object Tag { get; set; }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ICSharpCode.NRefactory.TypeSystem.Error"/> class.
+ /// </summary>
+ /// <param name='errorType'>
+ /// The error type.
+ /// </param>
+ /// <param name='message'>
+ /// The description of the error.
+ /// </param>
+ /// <param name='region'>
+ /// The region of the error.
+ /// </param>
+ public Error (ErrorType errorType, string message, DocumentRegion region)
+ {
+ this.errorType = errorType;
+ this.message = message;
+ this.region = region;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ICSharpCode.NRefactory.TypeSystem.Error"/> class.
+ /// </summary>
+ /// <param name='errorType'>
+ /// The error type.
+ /// </param>
+ /// <param name='message'>
+ /// The description of the error.
+ /// </param>
+ /// <param name='location'>
+ /// The location of the error.
+ /// </param>
+ public Error (ErrorType errorType, string message, DocumentLocation location)
+ {
+ this.errorType = errorType;
+ this.message = message;
+ this.region = new DocumentRegion (location, location);
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ICSharpCode.NRefactory.TypeSystem.Error"/> class.
+ /// </summary>
+ /// <param name='errorType'>
+ /// The error type.
+ /// </param>
+ /// <param name='message'>
+ /// The description of the error.
+ /// </param>
+ public Error (ErrorType errorType, string message, int line, int column) : this (errorType, message, new DocumentLocation (line, column))
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ICSharpCode.NRefactory.TypeSystem.Error"/> class.
+ /// </summary>
+ /// <param name='errorType'>
+ /// The error type.
+ /// </param>
+ /// <param name='message'>
+ /// The description of the error.
+ /// </param>
+ public Error (ErrorType errorType, string message)
+ {
+ this.errorType = errorType;
+ this.message = message;
+ this.region = DocumentRegion.Empty;
+ }
+
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ICSharpCode.NRefactory.TypeSystem.Error"/> class.
+ /// </summary>
+ /// <param name='errorType'>
+ /// The error type.
+ /// </param>
+ /// <param name='message'>
+ /// The description of the error.
+ /// </param>
+ /// <param name='region'>
+ /// The region of the error.
+ /// </param>
+ public Error (ErrorType errorType, string id, string message, DocumentRegion region)
+ {
+ this.errorType = errorType;
+ this.Id = id;
+ this.message = message;
+ this.region = region;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ICSharpCode.NRefactory.TypeSystem.Error"/> class.
+ /// </summary>
+ /// <param name='errorType'>
+ /// The error type.
+ /// </param>
+ /// <param name='message'>
+ /// The description of the error.
+ /// </param>
+ /// <param name='location'>
+ /// The location of the error.
+ /// </param>
+ public Error (ErrorType errorType, string id, string message, DocumentLocation location)
+ {
+ this.errorType = errorType;
+ this.Id = id;
+ this.message = message;
+ this.region = new DocumentRegion (location, location);
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ICSharpCode.NRefactory.TypeSystem.Error"/> class.
+ /// </summary>
+ /// <param name='errorType'>
+ /// The error type.
+ /// </param>
+ /// <param name='message'>
+ /// The description of the error.
+ /// </param>
+ public Error (ErrorType errorType, string id, string message, int line, int column) : this (errorType, id, message, new DocumentLocation (line, column))
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ICSharpCode.NRefactory.TypeSystem.Error"/> class.
+ /// </summary>
+ /// <param name='errorType'>
+ /// The error type.
+ /// </param>
+ /// <param name='message'>
+ /// The description of the error.
+ /// </param>
+ public Error (ErrorType errorType, string id, string message)
+ {
+ this.errorType = errorType;
+ this.Id = id;
+ this.message = message;
+ this.region = DocumentRegion.Empty;
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/FoldingRegion.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/FoldingRegion.cs
index 46f0ffcfea..91f5b99b93 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/FoldingRegion.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/FoldingRegion.cs
@@ -24,7 +24,7 @@
// THE SOFTWARE.
//
using System;
-using ICSharpCode.NRefactory.TypeSystem;
+using MonoDevelop.Ide.Editor;
namespace MonoDevelop.Ide.TypeSystem
{
@@ -38,37 +38,37 @@ namespace MonoDevelop.Ide.TypeSystem
//NOTE: thsi is only respected if the FoldType is set to "Undefined"
public bool IsFoldedByDefault { get; set; }
- public DomRegion Region { get; set; }
+ public DocumentRegion Region { get; set; }
public FoldType Type { get; set; }
- public FoldingRegion (DomRegion region) : this (null, region)
+ public FoldingRegion (DocumentRegion region) : this (null, region)
{
}
- public FoldingRegion (string name, DomRegion region)
+ public FoldingRegion (string name, DocumentRegion region)
{
this.Name = name ?? defaultName;
this.Region = region;
}
- public FoldingRegion (string name, DomRegion region, bool isFoldedByDefault) : this (name, region)
+ public FoldingRegion (string name, DocumentRegion region, bool isFoldedByDefault) : this (name, region)
{
this.IsFoldedByDefault = isFoldedByDefault;
}
- public FoldingRegion (string name, DomRegion region, FoldType type) : this (name, region)
+ public FoldingRegion (string name, DocumentRegion region, FoldType type) : this (name, region)
{
this.Type = type;
}
- public FoldingRegion (string name, DomRegion region, FoldType type, bool isFoldedByDefault) : this (name, region)
+ public FoldingRegion (string name, DocumentRegion region, FoldType type, bool isFoldedByDefault) : this (name, region)
{
this.Type = type;
this.IsFoldedByDefault = isFoldedByDefault;
}
- public FoldingRegion (DomRegion region, FoldType type) : this (null, region, type)
+ public FoldingRegion (DocumentRegion region, FoldType type) : this (null, region, type)
{
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/IFoldingParser.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/IFoldingParser.cs
new file mode 100644
index 0000000000..66ea540bed
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/IFoldingParser.cs
@@ -0,0 +1,41 @@
+//
+// IFoldingParser.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+
+namespace MonoDevelop.Ide.TypeSystem
+{
+ /// <summary>
+ /// The folding parser is used for generating a preliminary parsed document that does not
+ /// contain a full dom - only some basic lexical constructs like comments or pre processor directives.
+ ///
+ /// This is useful for opening a document the first time to have some folding regions as start that are folded by default.
+ /// Otherwise an irritating screen update will occur.
+ /// </summary>
+ public interface IFoldingParser
+ {
+ ParsedDocument Parse (string fileName, string content);
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/IRefactoringContext.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/IRefactoringContext.cs
deleted file mode 100644
index c14b46e8fc..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/IRefactoringContext.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// IRefactoringContext.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-
-namespace MonoDevelop.Ide.TypeSystem
-{
- /// <summary>
- /// Base interface for refactoring contexts
- /// </summary>
- public interface IRefactoringContext
- {
- /// <summary>
- /// Creates a refactoring script.
- /// </summary>
- IDisposable CreateScript ();
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MetadataReferenceCache.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MetadataReferenceCache.cs
new file mode 100644
index 0000000000..216dcb47bb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MetadataReferenceCache.cs
@@ -0,0 +1,177 @@
+//
+// MetadataReferenceCache.cs
+//
+// Author:
+// David Karlaš <david.karlas@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using System.IO;
+using MonoDevelop.Core;
+using System.Threading;
+
+namespace MonoDevelop.Ide.TypeSystem
+{
+ static class MetadataReferenceCache
+ {
+ static Dictionary<string, MetadataReferenceCacheItem> cache = new Dictionary<string, MetadataReferenceCacheItem> ();
+
+ public static MetadataReference LoadReference (ProjectId projectId, string path)
+ {
+ lock (cache) {
+ MetadataReferenceCacheItem result;
+ if (!cache.TryGetValue (path, out result)) {
+ result = new MetadataReferenceCacheItem (path);
+ cache.Add (path, result);
+ }
+ result.InUseBy.Add (projectId);
+ return result.Reference;
+ }
+ }
+
+ //TODO: This should be called when reference is actually removed and not on
+ //project reload because if this is only project that has this reference... Cache will be
+ //invalidated and when reload comes back in few miliseconds it will need to reload reference again
+ public static void RemoveReference (ProjectId projectId, string path)
+ {
+ lock (cache) {
+ MetadataReferenceCacheItem result;
+ if (cache.TryGetValue (path, out result)) {
+ result.InUseBy.Remove (projectId);
+ if (result.InUseBy.Count == 0) {
+ cache.Remove (path);
+ }
+ }
+ }
+ }
+
+ public static void RemoveReferences (ProjectId id)
+ {
+ lock (cache) {
+ var toRemove = new List<string> ();
+ foreach (var val in cache) {
+ val.Value.InUseBy.Remove (id);
+ if (val.Value.InUseBy.Count == 0) {
+ toRemove.Add (val.Key);
+ }
+ }
+ toRemove.ForEach ((k) => cache.Remove (k));
+ }
+ }
+
+ public static void Clear ()
+ {
+ lock (cache) {
+ cache.Clear ();
+ }
+ }
+
+ //static Timer timer;
+
+ static MetadataReferenceCache ()
+ {
+ //timer = new Timer ((o) => CheckForChanges (), null, 10000, 10000);
+ }
+
+ //TODO: Call this method when focus returns to MD or even better use FileSystemWatcher
+ public static void CheckForChanges ()
+ {
+ lock (cache) {
+ foreach (var value in cache.Values) {
+ value.CheckForChange ();
+ }
+ }
+ }
+
+ class MetadataReferenceCacheItem
+ {
+ public HashSet<ProjectId> InUseBy { get; private set; }
+
+ public MetadataReference Reference { get; private set; }
+
+ readonly string path;
+
+ DateTime timeStamp;
+
+ public MetadataReferenceCacheItem (string path)
+ {
+ this.path = path;
+ CreateNewReference ();
+ InUseBy = new HashSet<ProjectId> ();
+ }
+
+ public void CheckForChange ()
+ {
+ if (timeStamp != File.GetLastWriteTimeUtc (path)) {
+ if (Reference != null) {
+ foreach (var solution in IdeApp.Workspace.GetAllSolutions ()) {
+ var workspace = TypeSystemService.GetWorkspace (solution);
+ foreach (var projId in InUseBy) {
+ while (true) {
+ var project = workspace.CurrentSolution.GetProject (projId);
+ if (project == null)
+ break;
+ if (workspace.TryApplyChanges (project.RemoveMetadataReference (Reference).Solution))
+ break;
+ }
+ }
+ }
+ }
+ CreateNewReference ();
+ if (Reference != null) {
+ foreach (var solution in IdeApp.Workspace.GetAllSolutions ()) {
+ var workspace = TypeSystemService.GetWorkspace (solution);
+ foreach (var projId in InUseBy) {
+ while (true) {
+ var project = workspace.CurrentSolution.GetProject (projId);
+ if (project == null)
+ break;
+ if (workspace.TryApplyChanges (project.AddMetadataReference (Reference).Solution))
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ readonly static DateTime NonExistentFile = new DateTime (1601, 1, 1);
+
+ void CreateNewReference ()
+ {
+ timeStamp = File.GetLastWriteTimeUtc (path);
+ if (timeStamp == NonExistentFile) {
+ Reference = null;
+ LoggingService.LogError ("Error while loading reference " + path + ": File doesn't exist");
+ } else {
+ try {
+ Reference = MetadataReference.CreateFromFile (path, MetadataReferenceProperties.Assembly);
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while loading reference " + path + ": " + e.Message, e);
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopPersistentStorageServiceFactory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopPersistentStorageServiceFactory.cs
new file mode 100644
index 0000000000..20cc1bed0b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopPersistentStorageServiceFactory.cs
@@ -0,0 +1,254 @@
+//
+// MonoDevelopPersistentStorageServiceFactory.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Composition;
+using System.IO;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis.Host.Mef;
+using MonoDevelop.Core;
+using System.Text;
+using System.Collections.Generic;
+using System.Security.Cryptography;
+
+namespace MonoDevelop.Ide.TypeSystem
+{
+// [ExportWorkspaceServiceFactory(typeof(IPersistentStorageService), ServiceLayer.Host), Shared]
+ class PersistenceServiceFactory : IWorkspaceServiceFactory
+ {
+ static readonly IPersistentStorage NoOpPersistentStorageInstance = new NoOpPersistentStorage();
+ static readonly IPersistentStorageService singleton = new PersistentStorageService ();
+
+ public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
+ {
+ return singleton;
+ }
+
+ static MD5 md5 = MD5.Create ();
+ public static string GetMD5 (string data)
+ {
+ var result = new StringBuilder();
+ foreach (var b in md5.ComputeHash (Encoding.ASCII.GetBytes (data))) {
+ result.Append(b.ToString("X2"));
+ }
+ return result.ToString();
+ }
+
+ class NoOpPersistentStorage : IPersistentStorage
+ {
+ static Task<Stream> defaultStreamTask = Task.FromResult (default(Stream));
+ static Task<bool> defaultBoolTask = Task.FromResult (false);
+
+ public void Dispose()
+ {
+ }
+
+ public Task<Stream> ReadStreamAsync(Document document, string name, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return defaultStreamTask;
+ }
+
+ public Task<Stream> ReadStreamAsync(Project project, string name, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return defaultStreamTask;
+ }
+
+ public Task<Stream> ReadStreamAsync(string name, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return defaultStreamTask;
+ }
+
+ public Task<bool> WriteStreamAsync(Document document, string name, Stream stream, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return defaultBoolTask;
+ }
+
+ public Task<bool> WriteStreamAsync(Project project, string name, Stream stream, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return defaultBoolTask;
+ }
+
+ public Task<bool> WriteStreamAsync(string name, Stream stream, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return defaultBoolTask;
+ }
+ }
+
+ class PersistentStorageService : IPersistentStorageService
+ {
+ Dictionary<SolutionId, IPersistentStorage> storages = new Dictionary<SolutionId, IPersistentStorage> ();
+ /// <summary>
+ /// threshold to start to use esent (50MB)
+ /// </summary>
+ const int SolutionSizeThreshold = 50 * 1024 * 1024;
+
+ public IPersistentStorage GetStorage(Solution solution)
+ {
+ // check whether the solution actually exist on disk
+ if (!File.Exists(solution.FilePath))
+ return NoOpPersistentStorageInstance;
+
+ // get working folder path
+ string workingFolderPath;
+ lock (getStorageLock) {
+ workingFolderPath = TypeSystemService.GetCacheDirectory (solution.FilePath, true);
+ if (workingFolderPath == null) {
+ // we don't have place to save. don't use caching
+ return NoOpPersistentStorageInstance;
+ }
+ }
+
+ return GetStorage(solution, workingFolderPath);
+ }
+
+ object getStorageLock = new object ();
+ object storageLock = new object ();
+
+ IPersistentStorage GetStorage (Solution solution, string workingFolderPath)
+ {
+ lock (storageLock) {
+ IPersistentStorage storage;
+ if (storages.TryGetValue (solution.Id, out storage))
+ return storage;
+ if (!SolutionSizeAboveThreshold (solution)) {
+ storage = NoOpPersistentStorageInstance;
+ } else {
+ storage = new PersistentStorage (workingFolderPath);
+ }
+ storages.Add (solution.Id, storage);
+ return storage;
+ }
+ }
+
+ bool SolutionSizeAboveThreshold(Solution solution)
+ {
+ var size = SolutionSizeTracker.GetSolutionSizeAsync(solution.Workspace, solution.Id, CancellationToken.None).Result;
+ return size > SolutionSizeThreshold;
+ }
+ }
+
+ class PersistentStorage : IPersistentStorage
+ {
+ static Task<Stream> defaultStreamTask = Task.FromResult (default(Stream));
+
+ string workingFolderPath;
+
+ public PersistentStorage (string workingFolderPath)
+ {
+ this.workingFolderPath = workingFolderPath;
+ }
+
+ public void Dispose()
+ {
+ }
+
+
+ const string dataFileExtension = ".dat";
+
+ static string GetFileName (string name)
+ {
+ return GetMD5 (name) + dataFileExtension;
+ }
+
+ static string GetDocumentDataFileName (Document document, string name)
+ {
+ return GetMD5 (document.FilePath + "_" + name) + dataFileExtension;
+ }
+
+ static string GetProjectDataFileName (Project project, string name)
+ {
+ return GetMD5 (project.FilePath + "_" + name) + dataFileExtension;
+ }
+
+ public Task<Stream> ReadStreamAsync(Document document, string name, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ string fileName = Path.Combine (workingFolderPath, GetDocumentDataFileName (document, name));
+ if (!File.Exists (fileName))
+ return defaultStreamTask;
+ return Task.FromResult ((Stream)File.OpenRead (fileName));
+ }
+
+ public Task<Stream> ReadStreamAsync(Project project, string name, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ string fileName = Path.Combine (workingFolderPath, GetProjectDataFileName (project, name));
+ if (!File.Exists (fileName))
+ return defaultStreamTask;
+ return Task.FromResult ((Stream)File.OpenRead (fileName));
+ }
+
+ public Task<Stream> ReadStreamAsync(string name, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ string fileName = Path.Combine (workingFolderPath, GetFileName (name));
+ if (!File.Exists (fileName))
+ return defaultStreamTask;
+ return Task.FromResult ((Stream)File.OpenRead (fileName));
+ }
+
+ public async Task<bool> WriteStreamAsync(Document document, string name, Stream stream, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ string fileName = Path.Combine (workingFolderPath, GetDocumentDataFileName (document, name));
+ try {
+ using (var newStream = File.OpenWrite (fileName)) {
+ await stream.CopyToAsync (newStream, 81920, cancellationToken);
+ }
+ } catch (IOException) {
+ return false;
+ }
+ return true;
+ }
+
+ public async Task<bool> WriteStreamAsync(Project project, string name, Stream stream, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ string fileName = Path.Combine (workingFolderPath, GetProjectDataFileName (project, name));
+ try {
+ using (var newStream = File.OpenWrite (fileName)) {
+ await stream.CopyToAsync (newStream, 81920, cancellationToken);
+ }
+ } catch (IOException) {
+ return false;
+ }
+ return true;
+ }
+
+ public async Task<bool> WriteStreamAsync(string name, Stream stream, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ string fileName = Path.Combine (workingFolderPath, GetFileName (name));
+ try {
+ using (var newStream = File.OpenWrite (fileName)) {
+ await stream.CopyToAsync (newStream, 81920, cancellationToken);
+ }
+ } catch (IOException) {
+ return false;
+ }
+ return true;
+ }
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopProjectCacheHostServiceFactory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopProjectCacheHostServiceFactory.cs
new file mode 100644
index 0000000000..e342a43861
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopProjectCacheHostServiceFactory.cs
@@ -0,0 +1,134 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis;
+using System.Composition;
+
+namespace MonoDevelop.Ide.TypeSystem
+{
+// [ExportWorkspaceServiceFactory(typeof(IProjectCacheHostService), ServiceLayer.Host)]
+// [Shared]
+/* internal partial class MonoDevelopProjectCacheHostServiceFactory : IWorkspaceServiceFactory
+ {
+ private const int ImplicitCacheTimeoutInMS = 10000;
+
+ public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices)
+ {
+ // we support active document tracking only for visual studio workspace host.
+ if (workspaceServices.Workspace is MonoDevelopWorkspace)
+ {
+ return GetMonoDevelopProjectCache(workspaceServices);
+ }
+
+ return GetMiscProjectCache(workspaceServices);
+ }
+
+ private static IWorkspaceService GetMiscProjectCache(HostWorkspaceServices workspaceServices)
+ {
+ var projectCacheService = new ProjectCacheService(workspaceServices.Workspace, ImplicitCacheTimeoutInMS);
+
+ // Also clear the cache when the solution is cleared or removed.
+ workspaceServices.Workspace.WorkspaceChanged += (s, e) =>
+ {
+ if (e.Kind == WorkspaceChangeKind.SolutionCleared || e.Kind == WorkspaceChangeKind.SolutionRemoved)
+ {
+ projectCacheService.ClearImplicitCache();
+ }
+ };
+
+ return projectCacheService;
+ }
+
+ private static IWorkspaceService GetMonoDevelopProjectCache(HostWorkspaceServices workspaceServices)
+ {
+ var projectCacheService = new ProjectCacheService(workspaceServices.Workspace, ImplicitCacheTimeoutInMS);
+
+ var documentTrackingService = workspaceServices.GetService<IMDDocumentTrackingService>();
+
+ // Subscribe to events so that we can cache items from the active document's project
+ var manager = new ActiveProjectCacheManager(documentTrackingService, projectCacheService);
+
+ // TODO: Roslyn, when VS gets request from operating system that system virutal memory is low
+ // CacheFlushRequested is invoked so caches are cleared to get some memory back...
+
+ // Subscribe to requests to clear the cache
+// var workspaceCacheService = workspaceServices.GetService<IWorkspaceCacheService>();
+// if (workspaceCacheService != null)
+// {
+// workspaceCacheService.CacheFlushRequested += (s, e) => manager.Clear();
+// }
+
+ // Also clear the cache when the solution is cleared or removed.
+ workspaceServices.Workspace.WorkspaceChanged += (s, e) =>
+ {
+ if (e.Kind == WorkspaceChangeKind.SolutionCleared || e.Kind == WorkspaceChangeKind.SolutionRemoved)
+ {
+ manager.Clear();
+ }
+ };
+
+ return projectCacheService;
+ }
+
+ private class ActiveProjectCacheManager
+ {
+ private readonly IMDDocumentTrackingService _documentTrackingService;
+ private readonly ProjectCacheService _projectCacheService;
+ private readonly object _guard = new object();
+
+ private ProjectId _mostRecentActiveProjectId;
+ private IDisposable _mostRecentCache;
+
+ public ActiveProjectCacheManager(IMDDocumentTrackingService documentTrackingService, ProjectCacheService projectCacheService)
+ {
+ _documentTrackingService = documentTrackingService;
+ _projectCacheService = projectCacheService;
+
+ if (documentTrackingService != null)
+ {
+ documentTrackingService.ActiveDocumentChanged += UpdateCache;
+ UpdateCache(null, documentTrackingService.GetActiveDocument());
+ }
+ }
+
+ private void UpdateCache(object sender, DocumentId activeDocument)
+ {
+ lock (_guard)
+ {
+ if (activeDocument != null && activeDocument.ProjectId != _mostRecentActiveProjectId)
+ {
+ ClearMostRecentCache_NoLock();
+ _mostRecentCache = _projectCacheService.EnableCaching(activeDocument.ProjectId);
+ _mostRecentActiveProjectId = activeDocument.ProjectId;
+ }
+ }
+ }
+
+ public void Clear()
+ {
+ lock (_guard)
+ {
+ // clear most recent cache
+ ClearMostRecentCache_NoLock();
+
+ // clear implicit cache
+ _projectCacheService.ClearImplicitCache();
+ }
+ }
+
+ private void ClearMostRecentCache_NoLock()
+ {
+ if (_mostRecentCache != null)
+ {
+ _mostRecentCache.Dispose();
+ _mostRecentCache = null;
+ }
+
+ _mostRecentActiveProjectId = null;
+ }
+ }
+ }*/
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopProjectContent.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopProjectContent.cs
deleted file mode 100644
index bc77935929..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopProjectContent.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-//
-// MonoDevelopProjectContent.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem.Implementation;
-using System.Collections.Generic;
-using MonoDevelop.Projects;
-
-namespace MonoDevelop.Ide.TypeSystem
-{
- [Serializable]
- class MonoDevelopProjectContent : CSharpProjectContent
- {
- [NonSerialized]
- Project project;
-
- public Project Project {
- get {
- return project;
- }
- internal set {
- project = value;
- }
- }
-
- public MonoDevelopProjectContent (Project project)
- {
- this.project = project;
- }
-
- MonoDevelopProjectContent (MonoDevelopProjectContent pc) : base (pc)
- {
- this.project = pc.project;
- }
-
- public override ICompilation CreateCompilation()
- {
- var solutionSnapshot = new DefaultSolutionSnapshot();
- ICompilation compilation = new MonoDevelopCompilation(solutionSnapshot, this, AssemblyReferences);
- solutionSnapshot.AddCompilation(this, compilation);
- return compilation;
- }
-
- protected override CSharpProjectContent Clone()
- {
- return new MonoDevelopProjectContent(this);
- }
-
- public override ICompilation CreateCompilation(ISolutionSnapshot solutionSnapshot)
- {
- return new MonoDevelopCompilation(solutionSnapshot, this, AssemblyReferences);
- }
- }
-
- class MonoDevelopCompilation : SimpleCompilation
- {
- readonly MonoDevelopProjectContent content;
-
- public MonoDevelopCompilation (ISolutionSnapshot solutionSnapshot, MonoDevelopProjectContent content, IEnumerable<IAssemblyReference> assemblyReferences) : base (solutionSnapshot, content, assemblyReferences)
- {
- this.content = content;
- }
-
- public override INamespace GetNamespaceForExternAlias (string alias)
- {
- var netProject = content.Project as DotNetProject;
- if (netProject == null)
- return null;
- foreach (var r in netProject.References) {
- if (r.Aliases == alias) {
- foreach (var refAsm in ReferencedAssemblies) {
- if (refAsm.FullAssemblyName == r.StoredReference) {
- return refAsm.RootNamespace;
- }
-
- }
- }
- }
-
-
- return null;
- }
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceText.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceText.cs
new file mode 100644
index 0000000000..41f2e00834
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceText.cs
@@ -0,0 +1,132 @@
+//
+// MonoDevelopSourceText.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Microsoft.CodeAnalysis;
+using System.Linq;
+using System.IO;
+using MonoDevelop.Core;
+using System.Collections.Generic;
+using System.Threading;
+using System.Reflection;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
+using Microsoft.CodeAnalysis.Text;
+
+namespace MonoDevelop.Ide.TypeSystem
+{
+ sealed class MonoDevelopSourceText : SourceText
+ {
+ readonly ITextSource doc;
+ TextLineCollectionWrapper wrapper;
+
+ public override System.Text.Encoding Encoding {
+ get {
+ return doc.Encoding;
+ }
+ }
+
+ public MonoDevelopSourceText (ITextSource doc)
+ {
+ if (doc == null)
+ throw new ArgumentNullException (nameof (doc));
+ this.doc = doc;
+ }
+
+ protected override TextLineCollection GetLinesCore ()
+ {
+ var textDoc = doc as IReadonlyTextDocument;
+ if (textDoc != null) {
+ if (wrapper == null)
+ wrapper = new TextLineCollectionWrapper (this, textDoc);
+ return wrapper;
+ }
+ return base.GetLinesCore ();
+ }
+
+ class TextLineCollectionWrapper : TextLineCollection
+ {
+ readonly MonoDevelopSourceText parent;
+ readonly IReadonlyTextDocument textDoc;
+
+ public TextLineCollectionWrapper (MonoDevelopSourceText parent, IReadonlyTextDocument textDoc)
+ {
+ this.parent = parent;
+ this.textDoc = textDoc;
+ }
+
+ public override int Count {
+ get {
+ return textDoc.LineCount;
+ }
+ }
+
+ public override TextLine this[int index] {
+ get {
+ var line = textDoc.GetLine (index + 1);
+ return TextLine.FromSpan (parent, new TextSpan(line.Offset, line.Length));
+ }
+ }
+
+ public override TextLine GetLineFromPosition (int position)
+ {
+ var line = textDoc.GetLineByOffset (position);
+ return TextLine.FromSpan (parent, new TextSpan(line.Offset, line.Length));
+ }
+
+ public override LinePosition GetLinePosition (int position)
+ {
+ var loc = textDoc.OffsetToLocation (position);
+ return new LinePosition (loc.Line - 1, loc.Column - 1);
+ }
+
+ public override int IndexOf (int position)
+ {
+ return textDoc.OffsetToLineNumber (position) - 1;
+ }
+ }
+
+ #region implemented abstract members of SourceText
+ public override void CopyTo (int sourceIndex, char[] destination, int destinationIndex, int count)
+ {
+ doc.CopyTo (sourceIndex, destination, destinationIndex, count);
+ }
+
+ public override int Length {
+ get {
+ return doc.Length;
+ }
+ }
+
+ public override char this [int index] {
+ get {
+ return doc.GetCharAt (index);
+ }
+ }
+ #endregion
+ }
+
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceTextContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceTextContainer.cs
new file mode 100644
index 0000000000..0c282f163c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopSourceTextContainer.cs
@@ -0,0 +1,101 @@
+//
+// RoslynTypeSystemService.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis;
+using System.Linq;
+using System.IO;
+using MonoDevelop.Core;
+using System.Collections.Generic;
+using System.Threading;
+using System.Reflection;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
+using Microsoft.CodeAnalysis.Text;
+
+namespace MonoDevelop.Ide.TypeSystem
+{
+ sealed class MonoDevelopSourceTextContainer : SourceTextContainer, IDisposable
+ {
+ readonly ITextDocument document;
+ bool isDisposed;
+ SourceText currentText;
+
+ public DocumentId Id {
+ get;
+ private set;
+ }
+
+ public MonoDevelopSourceTextContainer (DocumentId documentId, ITextDocument document) : this (document)
+ {
+ Id = documentId;
+ }
+
+ public MonoDevelopSourceTextContainer (ITextDocument document)
+ {
+ this.document = document;
+ this.document.TextChanging += HandleTextReplacing;
+ }
+
+ void HandleTextReplacing (object sender, Core.Text.TextChangeEventArgs e)
+ {
+ var handler = TextChanged;
+ if (handler != null) {
+ var oldText = CurrentText;
+ var newText = oldText.Replace (e.Offset, e.RemovalLength, e.InsertedText.Text);
+ currentText = newText;
+ handler (this, new Microsoft.CodeAnalysis.Text.TextChangeEventArgs (oldText, newText, new TextChangeRange(TextSpan.FromBounds (e.Offset, e.Offset + e.RemovalLength), e.InsertionLength)));
+ }
+ }
+
+ public void Dispose ()
+ {
+ if (isDisposed)
+ return;
+ currentText = null;
+ document.TextChanging -= HandleTextReplacing;
+ isDisposed = true;
+ }
+
+ #region implemented abstract members of SourceTextContainer
+ public override SourceText CurrentText {
+ get {
+ if (currentText == null) {
+ currentText = new MonoDevelopSourceText (document.CreateDocumentSnapshot ());
+ }
+ return currentText;
+ }
+ }
+
+ public ITextDocument Document {
+ get {
+ return document;
+ }
+ }
+
+ public override event EventHandler<Microsoft.CodeAnalysis.Text.TextChangeEventArgs> TextChanged;
+ #endregion
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopTemporaryStorageServiceFactory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopTemporaryStorageServiceFactory.cs
new file mode 100644
index 0000000000..ba26660bd0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopTemporaryStorageServiceFactory.cs
@@ -0,0 +1,276 @@
+//
+// MonoDevelopTemporaryStorageServiceFactory.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Composition;
+using System.IO;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis.Host;
+using Microsoft.CodeAnalysis.Host.Mef;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Core.Text;
+using System.Reflection;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.Ide.TypeSystem
+{
+ [ExportWorkspaceServiceFactory (typeof (ITemporaryStorageService), ServiceLayer.Host), Shared]
+ sealed class MonoDevelopTemporaryStorageServiceFactory : IWorkspaceServiceFactory
+ {
+ static IWorkspaceServiceFactory microsoftFactory;
+
+ static MonoDevelopTemporaryStorageServiceFactory ()
+ {
+ if (Core.Platform.IsWindows || IsCompatibleMono()) {
+ try {
+ var asm = Assembly.Load ("Microsoft.CodeAnalysis.Workspaces.Desktop");
+ if (asm != null) {
+ var type = asm.GetType ("Microsoft.CodeAnalysis.Host.TemporaryStorageServiceFactory");
+ if (type != null)
+ microsoftFactory = Activator.CreateInstance (type) as IWorkspaceServiceFactory;
+ }
+ } catch (Exception e) {
+ LoggingService.LogWarning ("MonoDevelopTemporaryStorageServiceFactory: Can't load microsoft temporary storage, fallback to default.", e);
+ }
+ }
+ }
+
+ // remove, if mono >= 4.3 is realeased as stable.
+ static bool IsCompatibleMono ()
+ {
+ try {
+ var type = typeof (System.IO.MemoryMappedFiles.MemoryMappedViewAccessor);
+ return type.GetProperty ("PointerOffset", BindingFlags.Instance | BindingFlags.Public) != null;
+ } catch (Exception) {
+ return false;
+ }
+ }
+
+ public IWorkspaceService CreateService (HostWorkspaceServices workspaceServices)
+ {
+ if (microsoftFactory != null) {
+ return microsoftFactory.CreateService (workspaceServices);
+ }
+ return new TemporaryStorageService ();
+ }
+
+ class TemporaryStorageService : ITemporaryStorageService
+ {
+ public ITemporaryStreamStorage CreateTemporaryStreamStorage (CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return new StreamStorage ();
+ }
+
+ public ITemporaryTextStorage CreateTemporaryTextStorage (CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return new TemporaryTextStorage ();
+ }
+ }
+
+ /*
+ sealed class StreamStorage : ITemporaryStreamStorage
+ {
+ MemoryStream _stream;
+
+ public void Dispose ()
+ {
+ _stream?.Dispose ();
+ _stream = null;
+ }
+
+ public Stream ReadStream (CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (_stream == null) {
+ throw new InvalidOperationException ();
+ }
+
+ _stream.Position = 0;
+ return _stream;
+ }
+
+ public Task<Stream> ReadStreamAsync (CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (_stream == null) {
+ throw new InvalidOperationException ();
+ }
+
+ _stream.Position = 0;
+ return Task.FromResult ((Stream)_stream);
+ }
+
+ public void WriteStream (Stream stream, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var newStream = new MemoryStream ();
+ stream.CopyTo (newStream);
+ _stream = newStream;
+ }
+
+ public async Task WriteStreamAsync (Stream stream, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var newStream = new MemoryStream ();
+ await stream.CopyToAsync (newStream).ConfigureAwait (false);
+ _stream = newStream;
+ }
+ }
+
+ sealed class TemporaryTextStorage : ITemporaryTextStorage
+ {
+ SourceText _sourceText;
+
+ public void Dispose ()
+ {
+ _sourceText = null;
+ }
+
+ public SourceText ReadText (CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return _sourceText;
+ }
+
+ public Task<SourceText> ReadTextAsync (CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return Task.FromResult (ReadText (cancellationToken));
+ }
+
+ public void WriteText (SourceText text, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // This is a trivial implementation, indeed. Note, however, that we retain a strong
+ // reference to the source text, which defeats the intent of RecoverableTextAndVersion, but
+ // is appropriate for this trivial implementation.
+ _sourceText = text;
+ }
+
+ public Task WriteTextAsync (SourceText text, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ WriteText (text, cancellationToken);
+ return Task.FromResult (true);
+ }
+ }
+*/
+ class TemporaryTextStorage : ITemporaryTextStorage
+ {
+ string fileName;
+ Encoding encoding;
+ WeakReference<SourceText> sourceText;
+
+ public void Dispose()
+ {
+ if (fileName == null)
+ return;
+ try {
+ File.Delete (fileName);
+ } catch (Exception) {}
+ }
+
+ public SourceText ReadText(CancellationToken cancellationToken = default(CancellationToken))
+ {
+ SourceText result;
+ if (sourceText == null || !sourceText.TryGetTarget (out result)) {
+ var text = File.ReadAllText (fileName, encoding);
+ result = SourceText.From (text, encoding);
+ sourceText = new WeakReference<SourceText>(result);
+ }
+ return result;
+ }
+
+ public Task<SourceText> ReadTextAsync(CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return Task.Run(delegate { return ReadText (cancellationToken); });
+ }
+
+ object writeTextLocker = new object ();
+
+ public void WriteText(SourceText text, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ lock (writeTextLocker) {
+ if (fileName == null)
+ this.fileName = Path.GetTempFileName ();
+ string tmpPath = Path.Combine (Path.GetDirectoryName (fileName), ".#" + Path.GetFileName (fileName));
+ encoding = text.Encoding ?? Encoding.Default;
+ using (var writer = new StreamWriter (tmpPath, false, encoding))
+ text.Write (writer, cancellationToken);
+ sourceText = new WeakReference<SourceText>(text);
+ FileService.SystemRename (tmpPath, fileName);
+ }
+ }
+
+ Task ITemporaryTextStorage.WriteTextAsync(SourceText text, CancellationToken cancellationToken)
+ {
+ return Task.Run (delegate {
+ WriteText (text, cancellationToken);
+ });
+ }
+ }
+
+ class StreamStorage : ITemporaryStreamStorage
+ {
+ string fileName;
+
+ public StreamStorage ()
+ {
+ }
+
+ public void Dispose()
+ {
+ if (fileName == null)
+ return;
+ try {
+ File.Delete (fileName);
+ } catch (Exception) {}
+ }
+
+ public Stream ReadStream(CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return File.Open (fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
+ }
+
+ public Task<Stream> ReadStreamAsync(CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return Task.FromResult(ReadStream(cancellationToken));
+ }
+
+ public void WriteStream(Stream stream, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (fileName == null)
+ this.fileName = Path.GetTempFileName ();
+ using (var newStream = File.Open (fileName, FileMode.CreateNew, FileAccess.Write, FileShare.Write)) {
+ stream.CopyTo(newStream);
+ }
+ }
+
+ public async Task WriteStreamAsync(Stream stream, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (fileName == null)
+ this.fileName = Path.GetTempFileName ();
+ using (var newStream = File.Open (fileName, FileMode.CreateNew, FileAccess.Write, FileShare.Write)) {
+ await stream.CopyToAsync(newStream).ConfigureAwait(false);
+ }
+ }
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopTextLoader.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopTextLoader.cs
new file mode 100644
index 0000000000..3f766eb3c7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopTextLoader.cs
@@ -0,0 +1,71 @@
+//
+// MonoDevelopTextLoader.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using Microsoft.CodeAnalysis;
+using System.Threading.Tasks;
+using System.Threading;
+using Microsoft.CodeAnalysis.Text;
+using MonoDevelop.Core.Text;
+using System.IO;
+using System.Linq;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.Ide.TypeSystem
+{
+ class MonoDevelopTextLoader : TextLoader
+ {
+ readonly string fileName;
+
+ public MonoDevelopTextLoader (string fileName)
+ {
+ this.fileName = fileName;
+ }
+
+ #region implemented abstract members of TextLoader
+
+ public override async Task<TextAndVersion> LoadTextAndVersionAsync (Workspace workspace, DocumentId documentId, CancellationToken cancellationToken)
+ {
+ cancellationToken.ThrowIfCancellationRequested ();
+ SourceText text;
+ if (IdeApp.Workbench?.Documents.Any (doc => FilePath.PathComparer.Compare (doc.FileName, fileName) == 0) == true) {
+ text = new MonoDevelopSourceText (TextFileProvider.Instance.GetTextEditorData (fileName).CreateDocumentSnapshot ());
+ } else {
+ if (!File.Exists (fileName))
+ return TextAndVersion.Create (SourceText.From (""), VersionStamp.Create ());
+ text = SourceText.From (await TextFileUtility.GetTextAsync (fileName, cancellationToken).ConfigureAwait(false));
+ }
+ return TextAndVersion.Create (text, VersionStamp.Create ());
+ }
+
+ #endregion
+
+ public static TextLoader CreateFromText (string text)
+ {
+ if (text == null)
+ throw new System.ArgumentNullException ("text");
+ return TextLoader.From (TextAndVersion.Create (SourceText.From (text), VersionStamp.Create ()));
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs
new file mode 100644
index 0000000000..bfa4238645
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs
@@ -0,0 +1,1253 @@
+//
+// MonoDevelopWorkspace.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Microsoft.CodeAnalysis;
+using System.Linq;
+using System.IO;
+using MonoDevelop.Core;
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.CodeAnalysis.Text;
+using System.Threading.Tasks;
+using MonoDevelop.Ide.Editor;
+using Microsoft.CodeAnalysis.Host;
+using MonoDevelop.Core.Text;
+using System.Collections.Concurrent;
+using MonoDevelop.Ide.CodeFormatting;
+using Gtk;
+using MonoDevelop.Ide.Editor.Projection;
+using System.Reflection;
+using Microsoft.CodeAnalysis.Host.Mef;
+using System.Text;
+
+namespace MonoDevelop.Ide.TypeSystem
+{
+
+ class MonoDevelopWorkspace : Workspace
+ {
+ readonly static HostServices services;
+ public readonly WorkspaceId Id;
+
+ CancellationTokenSource src = new CancellationTokenSource ();
+ MonoDevelop.Projects.Solution currentMonoDevelopSolution;
+ object addLock = new object();
+ bool added;
+ bool internalChanges;
+
+ public MonoDevelop.Projects.Solution MonoDevelopSolution {
+ get {
+ return currentMonoDevelopSolution;
+ }
+ }
+
+ static string[] mefHostServices = new [] {
+ "Microsoft.CodeAnalysis.Workspaces",
+ "Microsoft.CodeAnalysis.CSharp.Workspaces",
+// "Microsoft.CodeAnalysis.VisualBasic.Workspaces"
+ };
+
+ static MonoDevelopWorkspace ()
+ {
+ List<Assembly> assemblies = new List<Assembly> ();
+ foreach (var asmName in mefHostServices) {
+ try {
+ var asm = Assembly.Load (asmName);
+ if (asm == null)
+ continue;
+ assemblies.Add (asm);
+ } catch (Exception) {
+ LoggingService.LogError ("Error - can't load host service assembly: " + asmName);
+ }
+ }
+ assemblies.Add (typeof(MonoDevelopWorkspace).Assembly);
+ services = Microsoft.CodeAnalysis.Host.Mef.MefHostServices.Create (assemblies);
+ }
+
+ public MonoDevelopWorkspace () : base (services, ServiceLayer.Desktop)
+ {
+ this.Id = WorkspaceId.Next ();
+ if (IdeApp.Workspace != null) {
+ IdeApp.Workspace.ActiveConfigurationChanged += HandleActiveConfigurationChanged;
+ }
+ }
+
+ protected override void Dispose (bool finalize)
+ {
+ base.Dispose (finalize);
+ CancelLoad ();
+ if (IdeApp.Workspace != null) {
+ IdeApp.Workspace.ActiveConfigurationChanged -= HandleActiveConfigurationChanged;
+ }
+ if (currentMonoDevelopSolution != null) {
+ foreach (var prj in currentMonoDevelopSolution.GetAllProjects ()) {
+ UnloadMonoProject (prj);
+ }
+ currentMonoDevelopSolution = null;
+ }
+ }
+
+ internal void InformDocumentTextChange (DocumentId id, SourceText text)
+ {
+ base.ApplyDocumentTextChanged (id, text);
+ }
+
+ void CancelLoad ()
+ {
+ src.Cancel ();
+ src = new CancellationTokenSource ();
+ }
+
+ static StatusBarIcon statusIcon = null;
+ static int workspacesLoading = 0;
+
+ internal static event EventHandler LoadingFinished;
+
+ static void OnLoadingFinished (EventArgs e)
+ {
+ var handler = LoadingFinished;
+ if (handler != null)
+ handler (null, e);
+ }
+
+ internal void HideStatusIcon ()
+ {
+ Gtk.Application.Invoke (delegate {
+ workspacesLoading--;
+ if (workspacesLoading == 0 && statusIcon != null) {
+ statusIcon.Dispose ();
+ statusIcon = null;
+ OnLoadingFinished (EventArgs.Empty);
+ }
+ });
+ }
+
+ internal void ShowStatusIcon ()
+ {
+ Gtk.Application.Invoke (delegate {
+ workspacesLoading++;
+ if (statusIcon != null)
+ return;
+ statusIcon = IdeApp.Workbench?.StatusBar.ShowStatusIcon (ImageService.GetIcon ("md-parser"));
+ });
+ }
+
+ void HandleActiveConfigurationChanged (object sender, EventArgs e)
+ {
+ if (currentMonoDevelopSolution == null)
+ return;
+ ShowStatusIcon ();
+ CancelLoad ();
+ var token = src.Token;
+
+ Task.Run (async delegate {
+ try {
+ var si = await CreateSolutionInfo (currentMonoDevelopSolution, token).ConfigureAwait (false);
+ if (si != null)
+ OnSolutionReloaded (si);
+ } catch (OperationCanceledException) {
+ } catch (AggregateException ae) {
+ ae.Flatten ().Handle (x => x is OperationCanceledException);
+ } catch (Exception ex) {
+ LoggingService.LogError ("Error while reloading solution.", ex);
+ } finally {
+ HideStatusIcon ();
+ }
+ });
+
+ }
+
+ SolutionData solutionData;
+ async Task<SolutionInfo> CreateSolutionInfo (MonoDevelop.Projects.Solution solution, CancellationToken token)
+ {
+ var projects = new ConcurrentBag<ProjectInfo> ();
+ var mdProjects = solution.GetAllProjects ().OfType<MonoDevelop.Projects.DotNetProject> ();
+ projectionList.Clear ();
+ solutionData = new SolutionData ();
+
+ List<Task> allTasks = new List<Task> ();
+ foreach (var proj in mdProjects) {
+ if (token.IsCancellationRequested)
+ return null;
+ if (!proj.SupportsRoslyn)
+ continue;
+ var tp = LoadProject (proj, token).ContinueWith (t => {
+ if (!t.IsCanceled)
+ projects.Add (t.Result);
+ });
+ allTasks.Add (tp);
+ }
+ await Task.WhenAll (allTasks.ToArray ());
+ if (token.IsCancellationRequested)
+ return null;
+ var modifiedWhileLoading = modifiedProjects = new List<MonoDevelop.Projects.DotNetProject> ();
+ var solutionInfo = SolutionInfo.Create (GetSolutionId (solution), VersionStamp.Create (), solution.FileName, projects);
+ foreach (var project in modifiedWhileLoading) {
+ if (solution.ContainsItem (project)) {
+ return await CreateSolutionInfo (solution, token).ConfigureAwait (false);
+ }
+ }
+
+ lock (addLock) {
+ if (!added) {
+ added = true;
+ OnSolutionAdded (solutionInfo);
+ }
+ }
+ return solutionInfo;
+ }
+
+ public Task<SolutionInfo> TryLoadSolution (MonoDevelop.Projects.Solution solution, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ this.currentMonoDevelopSolution = solution;
+ return CreateSolutionInfo (solution, cancellationToken);
+ }
+
+ public void UnloadSolution ()
+ {
+ OnSolutionRemoved ();
+ }
+
+ Dictionary<MonoDevelop.Projects.Solution, SolutionId> solutionIdMap = new Dictionary<MonoDevelop.Projects.Solution, SolutionId> ();
+
+ internal SolutionId GetSolutionId (MonoDevelop.Projects.Solution solution)
+ {
+ if (solution == null)
+ throw new ArgumentNullException ("solution");
+ lock (solutionIdMap) {
+ SolutionId result;
+ if (!solutionIdMap.TryGetValue (solution, out result)) {
+ result = SolutionId.CreateNewId (solution.Name);
+ solutionIdMap [solution] = result;
+ }
+ return result;
+ }
+ }
+
+ ConcurrentDictionary<MonoDevelop.Projects.Project, ProjectId> projectIdMap = new ConcurrentDictionary<MonoDevelop.Projects.Project, ProjectId> ();
+ ConcurrentDictionary<ProjectId, ProjectData> projectDataMap = new ConcurrentDictionary<ProjectId, ProjectData> ();
+
+ internal MonoDevelop.Projects.Project GetMonoProject (Project project)
+ {
+ return GetMonoProject (project.Id);
+ }
+
+ internal MonoDevelop.Projects.Project GetMonoProject (ProjectId projectId)
+ {
+ foreach (var kv in projectIdMap) {
+ if (kv.Value == projectId)
+ return kv.Key;
+ }
+ return null;
+ }
+
+ public bool Contains (ProjectId projectId)
+ {
+ return projectDataMap.ContainsKey (projectId);
+ }
+
+ internal ProjectId GetProjectId (MonoDevelop.Projects.Project p)
+ {
+ lock (projectIdMap) {
+ ProjectId result;
+ if (projectIdMap.TryGetValue (p, out result))
+ return result;
+ return null;
+ }
+ }
+
+ internal ProjectId GetOrCreateProjectId (MonoDevelop.Projects.Project p)
+ {
+ lock (projectIdMap) {
+ ProjectId result;
+ if (!projectIdMap.TryGetValue (p, out result)) {
+ result = ProjectId.CreateNewId (p.Name);
+ projectIdMap [p] = result;
+ }
+ return result;
+ }
+ }
+
+ ProjectData GetProjectData (ProjectId id)
+ {
+ lock (projectIdMap) {
+ ProjectData result;
+
+ if (projectDataMap.TryGetValue (id, out result)) {
+ return result;
+ }
+ return null;
+ }
+ }
+
+ ProjectData GetOrCreateProjectData (ProjectId id)
+ {
+ lock (projectIdMap) {
+ ProjectData result;
+ if (!projectDataMap.TryGetValue (id, out result)) {
+ result = new ProjectData (id);
+ projectDataMap [id] = result;
+ }
+ return result;
+ }
+ }
+
+ class ProjectData
+ {
+ readonly ProjectId projectId;
+ readonly Dictionary<string, DocumentId> documentIdMap;
+
+ public ProjectInfo Info {
+ get;
+ set;
+ }
+
+ public ProjectData (ProjectId projectId)
+ {
+ this.projectId = projectId;
+ documentIdMap = new Dictionary<string, DocumentId> (FilePath.PathComparer);
+ }
+
+ internal DocumentId GetOrCreateDocumentId (string name)
+ {
+ lock (documentIdMap) {
+ DocumentId result;
+ if (!documentIdMap.TryGetValue (name, out result)) {
+ result = DocumentId.CreateNewId (projectId, name);
+ documentIdMap [name] = result;
+ }
+ return result;
+ }
+ }
+
+ public DocumentId GetDocumentId (string name)
+ {
+ DocumentId result;
+ if (!documentIdMap.TryGetValue (name, out result)) {
+ return null;
+ }
+ return result;
+ }
+
+ internal void RemoveDocument (string name)
+ {
+ documentIdMap.Remove (name);
+ }
+ }
+
+ internal DocumentId GetDocumentId (ProjectId projectId, string name)
+ {
+ var data = GetProjectData (projectId);
+ if (data == null)
+ return null;
+ return data.GetDocumentId (name);
+ }
+
+ public override bool CanApplyChange (ApplyChangesKind feature)
+ {
+ return true;
+ }
+
+ void UnloadMonoProject (MonoDevelop.Projects.Project project)
+ {
+ if (project == null)
+ throw new ArgumentNullException (nameof (project));
+ project.FileAddedToProject -= OnFileAdded;
+ project.FileRemovedFromProject -= OnFileRemoved;
+ project.FileRenamedInProject -= OnFileRenamed;
+ project.Modified -= OnProjectModified;
+ }
+
+ Task<ProjectInfo> LoadProject (MonoDevelop.Projects.DotNetProject p, CancellationToken token)
+ {
+ if (!projectIdMap.ContainsKey (p)) {
+ p.FileAddedToProject += OnFileAdded;
+ p.FileRemovedFromProject += OnFileRemoved;
+ p.FileRenamedInProject += OnFileRenamed;
+ p.Modified += OnProjectModified;
+ }
+
+ var projectId = GetOrCreateProjectId (p);
+ var projectData = GetOrCreateProjectData (projectId);
+ return Task.Run (async () => {
+ var references = await CreateMetadataReferences (p, projectId, token).ConfigureAwait (false);
+ if (token.IsCancellationRequested)
+ return null;
+ var config = IdeApp.Workspace != null ? p.GetConfiguration (IdeApp.Workspace.ActiveConfiguration) as MonoDevelop.Projects.DotNetProjectConfiguration : null;
+ MonoDevelop.Projects.DotNetCompilerParameters cp = null;
+ if (config != null)
+ cp = config.CompilationParameters;
+ FilePath fileName = IdeApp.Workspace != null ? p.GetOutputFileName (IdeApp.Workspace.ActiveConfiguration) : (FilePath)"";
+ if (fileName.IsNullOrEmpty)
+ fileName = new FilePath (p.Name + ".dll");
+
+ var sourceFiles = await p.GetSourceFilesAsync (config != null ? config.Selector : null).ConfigureAwait (false);
+
+ var info = ProjectInfo.Create (
+ projectId,
+ VersionStamp.Create (),
+ p.Name,
+ fileName.FileNameWithoutExtension,
+ LanguageNames.CSharp,
+ p.FileName,
+ fileName,
+ cp != null ? cp.CreateCompilationOptions () : null,
+ cp != null ? cp.CreateParseOptions (config) : null,
+ CreateDocuments (projectData, p, token, sourceFiles),
+ CreateProjectReferences (p, token),
+ references
+ );
+ projectData.Info = info;
+ return info;
+ }, token);
+ }
+
+ internal void UpdateProjectionEntry (MonoDevelop.Projects.ProjectFile projectFile, IReadOnlyList<Projection> projections)
+ {
+ foreach (var entry in projectionList) {
+ if (entry.File.FilePath == projectFile.FilePath) {
+ projectionList.Remove (entry);
+ break;
+ }
+ }
+ projectionList.Add (new ProjectionEntry { File = projectFile, Projections = projections});
+
+ }
+
+ internal class SolutionData
+ {
+ public ConcurrentDictionary<string, TextLoader> Files = new ConcurrentDictionary<string, TextLoader> ();
+ }
+
+ internal static Func<SolutionData, string, TextLoader> CreateTextLoader = (data, fileName) => data.Files.GetOrAdd (fileName, a => new MonoDevelopTextLoader (a));
+
+ static DocumentInfo CreateDocumentInfo (SolutionData data, string projectName, ProjectData id, MonoDevelop.Projects.ProjectFile f)
+ {
+ var filePath = f.FilePath;
+ var sourceCodeKind = filePath.Extension == ".sketchcs" ? SourceCodeKind.Script : SourceCodeKind.Regular;
+ return DocumentInfo.Create (
+ id.GetOrCreateDocumentId (filePath),
+ f.FilePath,
+ new [] { projectName }.Concat (f.ProjectVirtualPath.ParentDirectory.ToString ().Split (Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)),
+ sourceCodeKind,
+ CreateTextLoader (data, f.Name),
+ f.Name,
+ false
+ );
+ }
+ List<ProjectionEntry> projectionList = new List<ProjectionEntry>();
+
+ internal IReadOnlyList<ProjectionEntry> ProjectionList {
+ get {
+ return projectionList;
+ }
+ }
+
+ internal class ProjectionEntry
+ {
+ public MonoDevelop.Projects.ProjectFile File;
+ public IReadOnlyList<Projection> Projections;
+ }
+
+ IEnumerable<DocumentInfo> CreateDocuments (ProjectData projectData, MonoDevelop.Projects.Project p, CancellationToken token, MonoDevelop.Projects.ProjectFile [] sourceFiles)
+ {
+ var duplicates = new HashSet<DocumentId> ();
+
+ // use given source files instead of project.Files because there may be additional files added by msbuild targets
+ foreach (var f in sourceFiles) {
+ if (token.IsCancellationRequested)
+ yield break;
+ if (f.Subtype == MonoDevelop.Projects.Subtype.Directory)
+ continue;
+ if (TypeSystemParserNode.IsCompileBuildAction (f.BuildAction)) {
+ if (!duplicates.Add (projectData.GetOrCreateDocumentId (f.Name)))
+ continue;
+ yield return CreateDocumentInfo (solutionData, p.Name, projectData, f);
+ } else {
+ foreach (var projectedDocument in GenerateProjections (f, projectData, p)) {
+ yield return projectedDocument;
+ }
+ }
+ }
+ }
+
+ IEnumerable<DocumentInfo> GenerateProjections (MonoDevelop.Projects.ProjectFile f, ProjectData projectData, MonoDevelop.Projects.Project p, HashSet<DocumentId> duplicates = null)
+ {
+ var mimeType = DesktopService.GetMimeTypeForUri (f.FilePath);
+ var node = TypeSystemService.GetTypeSystemParserNode (mimeType, f.BuildAction);
+ if (node == null || !node.Parser.CanGenerateProjection (mimeType, f.BuildAction, p.SupportedLanguages))
+ yield break;
+ var options = new ParseOptions {
+ FileName = f.FilePath,
+ Project = p,
+ Content = TextFileProvider.Instance.GetReadOnlyTextEditorData (f.FilePath),
+ };
+ var projections = node.Parser.GenerateProjections (options);
+ var entry = new ProjectionEntry ();
+ entry.File = f;
+ var list = new List<Projection> ();
+ entry.Projections = list;
+ foreach (var projection in projections.Result) {
+ list.Add (projection);
+ if (duplicates != null && !duplicates.Add (projectData.GetOrCreateDocumentId (projection.Document.FileName)))
+ continue;
+ var plainName = projection.Document.FileName.FileName;
+ yield return DocumentInfo.Create (
+ projectData.GetOrCreateDocumentId (projection.Document.FileName),
+ plainName,
+ new [] { p.Name }.Concat (f.ProjectVirtualPath.ParentDirectory.ToString ().Split (Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)),
+ SourceCodeKind.Regular,
+ TextLoader.From (TextAndVersion.Create (new MonoDevelopSourceText (projection.Document), VersionStamp.Create (), projection.Document.FileName)),
+ projection.Document.FileName,
+ false
+ );
+ }
+ projectionList.Add (entry);
+ }
+
+ static async Task<List<MetadataReference>> CreateMetadataReferences (MonoDevelop.Projects.DotNetProject netProject, ProjectId projectId, CancellationToken token)
+ {
+ List<MetadataReference> result = new List<MetadataReference> ();
+
+ var configurationSelector = IdeApp.Workspace?.ActiveConfiguration ?? MonoDevelop.Projects.ConfigurationSelector.Default;
+ var hashSet = new HashSet<string> (FilePath.PathComparer);
+
+ try {
+ foreach (string file in await netProject.GetReferencedAssemblies (configurationSelector, false).ConfigureAwait (false)) {
+ if (token.IsCancellationRequested)
+ return result;
+ string fileName;
+ if (!Path.IsPathRooted (file)) {
+ fileName = Path.Combine (Path.GetDirectoryName (netProject.FileName), file);
+ } else {
+ fileName = Path.GetFullPath (file);
+ }
+ if (hashSet.Contains (fileName))
+ continue;
+ hashSet.Add (fileName);
+ if (!File.Exists (fileName)) {
+ LoggingService.LogError ("Error while getting referenced Assembly " + fileName + " for project " + netProject.Name + ": File doesn't exist");
+ continue;
+ }
+ var metadataReference = MetadataReferenceCache.LoadReference (projectId, fileName);
+ if (metadataReference == null)
+ continue;
+ result.Add (metadataReference);
+ }
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while getting referenced assemblies", e);
+ }
+
+ foreach (var pr in netProject.GetReferencedItems (configurationSelector)) {
+ if (token.IsCancellationRequested)
+ return result;
+ var referencedProject = pr as MonoDevelop.Projects.DotNetProject;
+ if (referencedProject == null)
+ continue;
+ if (TypeSystemService.IsOutputTrackedProject (referencedProject)) {
+ var fileName = referencedProject.GetOutputFileName (configurationSelector);
+ if (!File.Exists (fileName)) {
+ LoggingService.LogError ("Error while getting project Reference (" + referencedProject.Name + ") " + fileName + " for project " + netProject.Name + ": File doesn't exist");
+ continue;
+ }
+ var metadataReference = MetadataReferenceCache.LoadReference (projectId, fileName);
+ if (metadataReference != null)
+ result.Add (metadataReference);
+ }
+ }
+ return result;
+ }
+
+ IEnumerable<ProjectReference> CreateProjectReferences (MonoDevelop.Projects.DotNetProject p, CancellationToken token)
+ {
+ foreach (var referencedProject in p.GetReferencedAssemblyProjects (IdeApp.Workspace?.ActiveConfiguration ?? MonoDevelop.Projects.ConfigurationSelector.Default)) {
+ if (token.IsCancellationRequested)
+ yield break;
+ if (TypeSystemService.IsOutputTrackedProject (referencedProject))
+ continue;
+ yield return new ProjectReference (GetOrCreateProjectId (referencedProject));
+ }
+ }
+
+ #region Open documents
+ public override bool CanOpenDocuments {
+ get {
+ return true;
+ }
+ }
+
+ List<MonoDevelopSourceTextContainer> openDocuments = new List<MonoDevelopSourceTextContainer>();
+ internal void InformDocumentOpen (DocumentId documentId, ITextDocument editor)
+ {
+ var document = InternalInformDocumentOpen (documentId, editor);
+ if (document != null) {
+ foreach (var linkedDoc in document.GetLinkedDocumentIds ()) {
+ InternalInformDocumentOpen (linkedDoc, editor);
+ }
+ }
+ }
+
+ Document InternalInformDocumentOpen (DocumentId documentId, ITextDocument editor)
+ {
+ var document = this.GetDocument (documentId);
+ if (document == null || IsDocumentOpen (documentId)) {
+ return document;
+ }
+ var monoDevelopSourceTextContainer = new MonoDevelopSourceTextContainer (documentId, editor);
+ lock (openDocuments) {
+ openDocuments.Add (monoDevelopSourceTextContainer);
+ }
+ OnDocumentOpened (documentId, monoDevelopSourceTextContainer);
+ return document;
+ }
+
+ Dictionary<string, SourceText> changedFiles = new Dictionary<string, SourceText> ();
+ ProjectChanges projectChanges;
+
+ public override bool TryApplyChanges (Solution newSolution)
+ {
+ changedFiles.Clear ();
+ return base.TryApplyChanges (newSolution);
+ }
+
+ protected override void ApplyProjectChanges (ProjectChanges projectChanges)
+ {
+ try {
+ internalChanges = true;
+ this.projectChanges = projectChanges;
+ base.ApplyProjectChanges (projectChanges);
+ } finally {
+ internalChanges = false;
+ }
+ }
+
+ protected override void ApplyAdditionalDocumentAdded (DocumentInfo info, SourceText text)
+ {
+ base.ApplyAdditionalDocumentAdded (info, text);
+ }
+
+ protected override void OnDocumentTextChanged (Document document)
+ {
+ base.OnDocumentTextChanged (document);
+ }
+
+ protected override void OnDocumentClosing (DocumentId documentId)
+ {
+ base.OnDocumentClosing (documentId);
+ lock (openDocuments) {
+ var openDoc = openDocuments.FirstOrDefault (d => d.Id == documentId);
+ if (openDoc != null) {
+ openDoc.Dispose ();
+ openDocuments.Remove (openDoc);
+ }
+ }
+ }
+
+// internal override bool CanChangeActiveContextDocument {
+// get {
+// return true;
+// }
+// }
+
+ public void InformDocumentClose (DocumentId analysisDocument, string filePath)
+ {
+ try {
+ var loader = new MonoDevelopTextLoader (filePath);
+ OnDocumentClosed (analysisDocument, loader);
+ var document = this.GetDocument (analysisDocument);
+ foreach (var linkedDoc in document.GetLinkedDocumentIds ()) {
+ OnDocumentClosed (linkedDoc, loader);
+ }
+ } catch (Exception e) {
+ LoggingService.LogError ("Exception while closing document.", e);
+ }
+ }
+
+ public override void CloseDocument (DocumentId documentId)
+ {
+ }
+
+
+ protected override async void ApplyDocumentTextChanged (DocumentId id, SourceText text)
+ {
+ var document = GetDocument (id);
+ if (document == null)
+ return;
+ bool isOpen;
+ var filePath = document.FilePath;
+
+ Projection projection = null;
+ foreach (var entry in ProjectionList) {
+ var p = entry.Projections.FirstOrDefault (proj => FilePath.PathComparer.Equals (proj.Document.FileName, filePath));
+ if (p != null) {
+ filePath = entry.File.FilePath;
+ projection = p;
+ break;
+ }
+ }
+
+ var data = TextFileProvider.Instance.GetTextEditorData (filePath, out isOpen);
+
+ // Guard against already done changes in linked files.
+ // This shouldn't happen but the roslyn merging seems not to be working correctly in all cases :/
+ if (document.GetLinkedDocumentIds ().Length > 0 && isOpen && !(text.GetType ().FullName == "Microsoft.CodeAnalysis.Text.ChangedText")) {
+ return;
+ }
+ SourceText formerText;
+ if (changedFiles.TryGetValue (filePath, out formerText)) {
+ if (formerText.Length == text.Length && formerText.ToString () == text.ToString ())
+ return;
+ }
+ changedFiles [filePath] = text;
+
+ SourceText oldFile;
+ if (!isOpen || !document.TryGetText (out oldFile)) {
+ oldFile = await document.GetTextAsync ();
+ }
+ var changes = text.GetTextChanges (oldFile).OrderByDescending (c => c.Span.Start).ToList ();
+ int delta = 0;
+
+ if (!isOpen) {
+ delta = ApplyChanges (projection, data, changes);
+ var formatter = CodeFormatterService.GetFormatter (data.MimeType);
+ if (formatter.SupportsPartialDocumentFormatting) {
+ var mp = GetMonoProject (CurrentSolution.GetProject (id.ProjectId));
+ string currentText = data.Text;
+
+ foreach (var change in changes) {
+ delta -= change.Span.Length - change.NewText.Length;
+ var startOffset = change.Span.Start - delta;
+
+ if (projection != null) {
+ int originalOffset;
+ if (projection.TryConvertFromProjectionToOriginal (startOffset, out originalOffset))
+ startOffset = originalOffset;
+ }
+
+ string str;
+ if (change.NewText.Length == 0) {
+ str = formatter.FormatText (mp.Policies, currentText, TextSegment.FromBounds (Math.Max (0, startOffset - 1), Math.Min (data.Length, startOffset + 1)));
+ } else {
+ str = formatter.FormatText (mp.Policies, currentText, new TextSegment (startOffset, change.NewText.Length));
+ }
+ data.ReplaceText (startOffset, change.NewText.Length, str);
+ }
+ }
+ data.Save ();
+ if (projection != null) {
+ await UpdateProjectionsDocuments (document, data);
+ } else {
+ OnDocumentTextChanged (id, new MonoDevelopSourceText (data), PreservationMode.PreserveValue);
+ }
+ FileService.NotifyFileChanged (filePath);
+ } else {
+ var formatter = CodeFormatterService.GetFormatter (data.MimeType);
+ var documentContext = IdeApp.Workbench.Documents.FirstOrDefault (d => FilePath.PathComparer.Compare (d.FileName, filePath) == 0);
+ var root = await projectChanges.NewProject.GetDocument (id).GetSyntaxRootAsync ();
+ var annotatedNode = root.DescendantNodesAndSelf ().FirstOrDefault (n => n.HasAnnotation (TypeSystemService.InsertionModeAnnotation));
+ SyntaxToken? renameTokenOpt = root.GetAnnotatedNodesAndTokens (Microsoft.CodeAnalysis.CodeActions.RenameAnnotation.Kind)
+ .Where (s => s.IsToken)
+ .Select (s => s.AsToken ())
+ .Cast<SyntaxToken?> ()
+ .FirstOrDefault ();
+
+ if (documentContext != null) {
+ var editor = (TextEditor)data;
+ using (var undo = editor.OpenUndoGroup ()) {
+ var oldVersion = editor.Version;
+ delta = ApplyChanges (projection, data, changes);
+ var versionBeforeFormat = editor.Version;
+
+ if (formatter.SupportsOnTheFlyFormatting) {
+ foreach (var change in changes) {
+ delta -= change.Span.Length - change.NewText.Length;
+ var startOffset = change.Span.Start - delta;
+ if (projection != null) {
+ int originalOffset;
+ if (projection.TryConvertFromProjectionToOriginal (startOffset, out originalOffset))
+ startOffset = originalOffset;
+ }
+ if (change.NewText.Length == 0) {
+ formatter.OnTheFlyFormat (editor, documentContext, TextSegment.FromBounds (Math.Max (0, startOffset - 1), Math.Min (data.Length, startOffset + 1)));
+ } else {
+ formatter.OnTheFlyFormat (editor, documentContext, new TextSegment (startOffset, change.NewText.Length));
+ }
+ }
+ }
+ if (annotatedNode != null && GetInsertionPoints != null) {
+ await Runtime.RunInMainThread (async () => {
+ IdeApp.Workbench.Documents.First (d => d.FileName == editor.FileName).Select ();
+ var formattedVersion = editor.Version;
+
+ int startOffset = versionBeforeFormat.MoveOffsetTo (editor.Version, annotatedNode.Span.Start);
+ int endOffset = versionBeforeFormat.MoveOffsetTo (editor.Version, annotatedNode.Span.End);
+
+ // alway whole line start & delimiter
+ var startLine = editor.GetLineByOffset (startOffset);
+ startOffset = startLine.Offset;
+
+ var endLine = editor.GetLineByOffset (endOffset);
+ endOffset = endLine.EndOffsetIncludingDelimiter + 1;
+
+ var insertionCursorSegment = TextSegment.FromBounds (startOffset, endOffset);
+ string textToInsert = editor.GetTextAt (insertionCursorSegment).TrimEnd ();
+ editor.RemoveText (insertionCursorSegment);
+ var insertionPoints = await GetInsertionPoints (editor, editor.CaretOffset);
+ if (insertionPoints.Count == 0) {
+ // Just to get sure if no insertion points -> go back to the formatted version.
+ var textChanges = editor.Version.GetChangesTo (formattedVersion).ToList ();
+ using (var undo2 = editor.OpenUndoGroup ()) {
+ foreach (var v in textChanges) {
+ editor.ReplaceText (v.Offset, v.RemovalLength, v.InsertedText);
+ }
+ }
+ return;
+ }
+ string insertionModeOperation;
+ const int CSharpMethodKind = 8875;
+
+
+ bool isMethod = annotatedNode.RawKind == CSharpMethodKind;
+
+ if (!isMethod) {
+ // atm only for generate field/property : remove all new lines generated & just insert the plain node.
+ // for methods it's not so easy because of "extract code" changes.
+ foreach (var v in editor.Version.GetChangesTo (oldVersion).ToList ()) {
+ editor.ReplaceText (v.Offset, v.RemovalLength, v.InsertedText);
+ }
+ }
+
+ switch (annotatedNode.RawKind) {
+ case 8873: // C# field
+ insertionModeOperation = GettextCatalog.GetString ("Insert Field");
+ break;
+ case CSharpMethodKind:
+ insertionModeOperation = GettextCatalog.GetString ("Insert Method");
+ break;
+ case 8892: // C# property
+ insertionModeOperation = GettextCatalog.GetString ("Insert Property");
+ break;
+ default:
+ insertionModeOperation = GettextCatalog.GetString ("Insert Code");
+ break;
+ }
+
+ var options = new InsertionModeOptions (
+ insertionModeOperation,
+ insertionPoints,
+ point => {
+ if (!point.Success)
+ return;
+ point.InsertionPoint.Insert (editor, textToInsert);
+ }
+ );
+ options.ModeExitedAction += delegate (InsertionCursorEventArgs args) {
+ if (!args.Success) {
+ var textChanges = editor.Version.GetChangesTo (oldVersion).ToList ();
+ using (var undo2 = editor.OpenUndoGroup ()) {
+ foreach (var v in textChanges) {
+ editor.ReplaceText (v.Offset, v.RemovalLength, v.InsertedText);
+ }
+ }
+ }
+ };
+ for (int i = 0; i < insertionPoints.Count; i++) {
+ if (insertionPoints [i].Location.Line < editor.CaretLine) {
+ options.FirstSelectedInsertionPoint = Math.Min (isMethod ? i + 1 : i, insertionPoints.Count - 1);
+ } else {
+ break;
+ }
+ }
+ options.ModeExitedAction += delegate {
+ if (renameTokenOpt.HasValue)
+ StartRenameSession (editor, documentContext, versionBeforeFormat, renameTokenOpt.Value);
+ };
+ editor.StartInsertionMode (options);
+ });
+ }
+ }
+ }
+
+ if (projection != null) {
+ await UpdateProjectionsDocuments (document, data);
+ } else {
+ OnDocumentTextChanged (id, new MonoDevelopSourceText (data.CreateDocumentSnapshot ()), PreservationMode.PreserveValue);
+ }
+ await Runtime.RunInMainThread (() => {
+ if (IdeApp.Workbench != null)
+ foreach (var w in IdeApp.Workbench.Documents)
+ w.StartReparseThread ();
+ });
+ }
+ }
+ internal static Func<TextEditor, int, Task<List<InsertionPoint>>> GetInsertionPoints;
+ internal static Action<TextEditor, DocumentContext, ITextSourceVersion, SyntaxToken?> StartRenameSession;
+
+ async Task UpdateProjectionsDocuments (Document document, ITextDocument data)
+ {
+ var project = TypeSystemService.GetMonoProject (document.Project);
+ var file = project.Files.GetFile (data.FileName);
+ var node = TypeSystemService.GetTypeSystemParserNode (data.MimeType, file.BuildAction);
+ if (node != null && node.Parser.CanGenerateProjection (data.MimeType, file.BuildAction, project.SupportedLanguages)) {
+ var options = new ParseOptions {
+ FileName = file.FilePath,
+ Project = project,
+ Content = TextFileProvider.Instance.GetReadOnlyTextEditorData (file.FilePath),
+ };
+ var projections = await node.Parser.GenerateProjections (options);
+ UpdateProjectionEntry (file, projections);
+ var projectId = GetProjectId (project);
+ var projectdata = GetProjectData (projectId);
+ foreach (var projected in projections) {
+ OnDocumentTextChanged (projectdata.GetDocumentId (projected.Document.FileName), new MonoDevelopSourceText (projected.Document), PreservationMode.PreserveValue);
+ }
+ }
+ }
+
+ static int ApplyChanges (Projection projection, ITextDocument data, List<TextChange> changes)
+ {
+ int delta = 0;
+ foreach (var change in changes) {
+ var offset = change.Span.Start;
+
+ if (projection != null) {
+ int originalOffset;
+ //If change is outside projection segments don't apply it...
+ if (projection.TryConvertFromProjectionToOriginal (offset, out originalOffset)) {
+ offset = originalOffset;
+ data.ReplaceText (offset, change.Span.Length, change.NewText);
+ delta += change.Span.Length - change.NewText.Length;
+ }
+ } else {
+ data.ReplaceText (offset, change.Span.Length, change.NewText);
+ delta += change.Span.Length - change.NewText.Length;
+ }
+ }
+
+ return delta;
+ }
+
+ protected override void ApplyDocumentAdded (DocumentInfo info, SourceText text)
+ {
+ var id = info.Id;
+ MonoDevelop.Projects.Project mdProject = null;
+
+ if (id.ProjectId != null) {
+ var project = CurrentSolution.GetProject (id.ProjectId);
+ mdProject = GetMonoProject (project);
+ if (mdProject == null)
+ LoggingService.LogWarning ("Couldn't find project for newly generated file {0} (Project {1}).", info.Name, info.Id.ProjectId);
+ }
+ var path = DetermineFilePath (info.Id, info.Name, info.FilePath, info.Folders, mdProject?.FileName.ParentDirectory, true);
+
+ string formattedText;
+ var formatter = CodeFormatterService.GetFormatter (DesktopService.GetMimeTypeForUri (path));
+ if (formatter != null && mdProject != null) {
+ formattedText = formatter.FormatText (mdProject.Policies, text.ToString ());
+ } else {
+ formattedText = text.ToString ();
+ }
+
+ var textSource = new StringTextSource (formattedText, text.Encoding ?? System.Text.Encoding.UTF8);
+ try {
+ textSource.WriteTextTo (path);
+ } catch (Exception e) {
+ LoggingService.LogError ("Exception while saving file to " + path, e);
+ }
+
+ if (mdProject != null) {
+ var file = new MonoDevelop.Projects.ProjectFile (path);
+ Application.Invoke (delegate {
+ mdProject.Files.Add (file);
+ IdeApp.ProjectOperations.SaveAsync (mdProject);
+ });
+ }
+ }
+
+ string DetermineFilePath (DocumentId id, string name, string filePath, IReadOnlyList<string> docFolders, string defaultFolder, bool createDirectory = false)
+ {
+ var path = filePath;
+
+ if (string.IsNullOrEmpty (path)) {
+ var monoProject = GetMonoProject (id.ProjectId);
+
+ // If the first namespace name matches the name of the project, then we don't want to
+ // generate a folder for that. The project is implicitly a folder with that name.
+ IEnumerable<string> folders;
+ if (docFolders.FirstOrDefault () == monoProject.Name) {
+ folders = docFolders.Skip (1);
+ } else {
+ folders = docFolders;
+ }
+
+ if (folders.Any ()) {
+ string baseDirectory = Path.Combine (monoProject.BaseDirectory, Path.Combine (folders.ToArray ()));
+ try {
+ if (createDirectory && !Directory.Exists (baseDirectory))
+ Directory.CreateDirectory (baseDirectory);
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while creating directory for a new file : " + baseDirectory, e);
+ }
+ path = Path.Combine (baseDirectory, name);
+ } else {
+ path = Path.Combine (defaultFolder, name);
+ }
+ }
+ return path;
+ }
+ #endregion
+
+ public Document GetDocument (DocumentId documentId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var project = CurrentSolution.GetProject (documentId.ProjectId);
+ if (project == null)
+ return null;
+ return project.GetDocument (documentId);
+ }
+
+ public async void UpdateFileContent (string fileName, string text)
+ {
+ SourceText newText = SourceText.From (text);
+ foreach (var kv in this.projectDataMap) {
+ var projectId = kv.Key;
+ var docId = this.GetDocumentId (projectId, fileName);
+ if (docId != null) {
+ base.OnDocumentTextChanged (docId, newText, PreservationMode.PreserveIdentity);
+ }
+ var monoProject = GetMonoProject (projectId);
+ if (monoProject != null) {
+ var pf = monoProject.GetProjectFile (fileName);
+ if (pf != null) {
+ var mimeType = DesktopService.GetMimeTypeForUri (fileName);
+ if (TypeSystemService.CanParseProjections (monoProject, mimeType, fileName))
+ await TypeSystemService.ParseProjection (new ParseOptions { Project = monoProject, FileName = fileName, Content = new StringTextSource(text), BuildAction = pf.BuildAction }, mimeType).ConfigureAwait (false);
+ }
+ }
+
+ }
+ }
+
+ public void RemoveProject (MonoDevelop.Projects.Project project)
+ {
+ var id = GetProjectId (project);
+ if (id != null) {
+ foreach (var docId in GetOpenDocumentIds (id).ToList ()) {
+ ClearOpenDocument (docId);
+ }
+ ProjectId val;
+ projectIdMap.TryRemove (project, out val);
+ ProjectData val2;
+ projectDataMap.TryRemove (id, out val2);
+ MetadataReferenceCache.RemoveReferences (id);
+
+ UnloadMonoProject (project);
+ }
+ }
+
+ #region Project modification handlers
+
+ void OnFileAdded (object sender, MonoDevelop.Projects.ProjectFileEventArgs args)
+ {
+ if (internalChanges)
+ return;
+ var project = (MonoDevelop.Projects.Project)sender;
+ foreach (MonoDevelop.Projects.ProjectFileEventInfo fargs in args) {
+ var projectFile = fargs.ProjectFile;
+ if (projectFile.Subtype == MonoDevelop.Projects.Subtype.Directory)
+ continue;
+ var projectData = GetProjectData (GetProjectId (project));
+ if (TypeSystemParserNode.IsCompileBuildAction (projectFile.BuildAction)) {
+ var newDocument = CreateDocumentInfo (solutionData, project.Name, projectData, projectFile);
+ OnDocumentAdded (newDocument);
+ } else {
+ foreach (var projectedDocument in GenerateProjections (projectFile, projectData, project)) {
+ OnDocumentAdded (projectedDocument);
+ }
+ }
+
+ }
+ }
+
+ void OnFileRemoved (object sender, MonoDevelop.Projects.ProjectFileEventArgs args)
+ {
+ if (internalChanges)
+ return;
+ var project = (MonoDevelop.Projects.Project)sender;
+ foreach (MonoDevelop.Projects.ProjectFileEventInfo fargs in args) {
+ var projectId = GetProjectId (project);
+ var data = GetProjectData (projectId);
+ var id = data.GetDocumentId (fargs.ProjectFile.FilePath);
+ if (id != null) {
+ ClearDocumentData (id);
+ OnDocumentRemoved (id);
+ data.RemoveDocument (fargs.ProjectFile.FilePath);
+ } else {
+ foreach (var entry in ProjectionList) {
+ if (entry.File == fargs.ProjectFile) {
+ foreach (var projectedDocument in entry.Projections) {
+ id = data.GetDocumentId (projectedDocument.Document.FileName);
+ if (id != null) {
+ ClearDocumentData (id);
+ OnDocumentRemoved (id);
+ data.RemoveDocument (projectedDocument.Document.FileName);
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ void OnFileRenamed (object sender, MonoDevelop.Projects.ProjectFileRenamedEventArgs args)
+ {
+ if (internalChanges)
+ return;
+ var project = (MonoDevelop.Projects.Project)sender;
+ foreach (MonoDevelop.Projects.ProjectFileRenamedEventInfo fargs in args) {
+ var projectFile = fargs.ProjectFile;
+ if (projectFile.Subtype == MonoDevelop.Projects.Subtype.Directory)
+ continue;
+ var projectId = GetProjectId (project);
+ var data = GetProjectData (projectId);
+ if (TypeSystemParserNode.IsCompileBuildAction (projectFile.BuildAction)) {
+ var id = data.GetDocumentId (fargs.OldName);
+ if (id != null) {
+ if (this.IsDocumentOpen (id)) {
+ this.InformDocumentClose (id, fargs.OldName);
+ }
+ OnDocumentRemoved (id);
+ data.RemoveDocument (fargs.OldName);
+ }
+ var newDocument = CreateDocumentInfo (solutionData, project.Name, GetProjectData (projectId), projectFile);
+ OnDocumentAdded (newDocument);
+ } else {
+ foreach (var entry in ProjectionList) {
+ if (entry.File == projectFile) {
+ foreach (var projectedDocument in entry.Projections) {
+ var id = data.GetDocumentId (projectedDocument.Document.FileName);
+ if (id != null) {
+ if (this.IsDocumentOpen (id)) {
+ this.InformDocumentClose (id, projectedDocument.Document.FileName);
+ }
+ OnDocumentRemoved (id);
+ data.RemoveDocument (projectedDocument.Document.FileName);
+ }
+ }
+ break;
+ }
+ }
+
+ foreach (var projectedDocument in GenerateProjections (fargs.ProjectFile, data, project)) {
+ OnDocumentAdded (projectedDocument);
+ }
+ }
+ }
+ }
+
+ List<MonoDevelop.Projects.DotNetProject> modifiedProjects = new List<MonoDevelop.Projects.DotNetProject> ();
+
+ async void OnProjectModified (object sender, MonoDevelop.Projects.SolutionItemModifiedEventArgs args)
+ {
+ if (internalChanges)
+ return;
+ if (!args.Any (x => x.Hint == "TargetFramework" || x.Hint == "References"))
+ return;
+ var project = sender as MonoDevelop.Projects.DotNetProject;
+ if (project == null)
+ return;
+ var projectId = GetProjectId (project);
+ if (CurrentSolution.ContainsProject (projectId)) {
+ OnProjectReloaded (await LoadProject (project, default(CancellationToken)).ConfigureAwait (false));
+ } else {
+ modifiedProjects.Add (project);
+ }
+ }
+
+ #endregion
+
+
+
+ /// <summary>
+ /// Tries the get original file from projection. If the fileName / offset is inside a projection this method tries to convert it
+ /// back to the original physical file.
+ /// </summary>
+ internal bool TryGetOriginalFileFromProjection (string fileName, int offset, out string originalName, out int originalOffset)
+ {
+ foreach (var projectionEntry in ProjectionList) {
+ var projection = projectionEntry.Projections.FirstOrDefault (p => FilePath.PathComparer.Equals (p.Document.FileName, fileName));
+ if (projection != null) {
+ if (projection.TryConvertFromProjectionToOriginal (offset, out originalOffset)) {
+ originalName = projectionEntry.File.FilePath;
+ return true;
+ }
+ }
+ }
+
+ originalName = fileName;
+ originalOffset = offset;
+ return false;
+ }
+ }
+
+// static class MonoDevelopWorkspaceFeatures
+// {
+// static FeaturePack pack;
+//
+// public static FeaturePack Features {
+// get {
+// if (pack == null)
+// Interlocked.CompareExchange (ref pack, ComputePack (), null);
+// return pack;
+// }
+// }
+//
+// static FeaturePack ComputePack ()
+// {
+// var assemblies = new List<Assembly> ();
+// var workspaceCoreAssembly = typeof(Workspace).Assembly;
+// assemblies.Add (workspaceCoreAssembly);
+//
+// LoadAssembly (assemblies, "Microsoft.CodeAnalysis.CSharp.Workspaces");
+// //LoadAssembly (assemblies, "Microsoft.CodeAnalysis.VisualBasic.Workspaces");
+//
+// var catalogs = assemblies.Select (a => new System.ComponentModel.Composition.Hosting.AssemblyCatalog (a));
+//
+// return new MefExportPack (catalogs);
+// }
+//
+// static void LoadAssembly (List<Assembly> assemblies, string assemblyName)
+// {
+// try {
+// var loadedAssembly = Assembly.Load (assemblyName);
+// assemblies.Add (loadedAssembly);
+// } catch (Exception e) {
+// LoggingService.LogWarning ("Couldn't load assembly:" + assemblyName, e);
+// }
+// }
+// }
+
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDocDocumentationProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDocDocumentationProvider.cs
index 67e8fd2bf2..73211e577a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDocDocumentationProvider.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDocDocumentationProvider.cs
@@ -26,29 +26,18 @@
using System;
using System.Collections.Generic;
using System.Xml;
-using ICSharpCode.NRefactory.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem.Implementation;
using MonoDevelop.Core;
-using ICSharpCode.NRefactory.Documentation;
using System.Text;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.Ide.TypeSystem
{
- [Serializable]
- public class MonoDocDocumentationProvider : IDocumentationProvider
+ static class MonoDocDocumentationProvider
{
- [NonSerialized]
- bool hadError;
-
- public MonoDocDocumentationProvider ()
- {
- }
+ static bool hadError;
+ static Dictionary<string, string> commentCache = new Dictionary<string, string> ();
- #region IDocumentationProvider implementation
- [NonSerialized]
- readonly Dictionary<string, DocumentationComment> commentCache = new Dictionary<string, DocumentationComment> ();
-
- public DocumentationComment GetDocumentation (IEntity entity)
+ public static string GetDocumentation (ISymbol entity)
{
if (entity == null)
throw new System.ArgumentNullException ("entity");
@@ -57,8 +46,10 @@ namespace MonoDevelop.Ide.TypeSystem
// shouldn't try it again. A corrupt .zip file could cause long tooltip delays otherwise.
if (hadError)
return null;
- var idString = entity.GetIdString ();
- DocumentationComment result;
+ var idString = entity.GetDocumentationCommentId ();
+ if (string.IsNullOrEmpty (idString))
+ return null;
+ string result;
if (commentCache.TryGetValue (idString, out result))
return result;
XmlDocument doc = null;
@@ -66,21 +57,21 @@ namespace MonoDevelop.Ide.TypeSystem
var helpTree = MonoDevelop.Projects.HelpService.HelpTree;
if (helpTree == null)
return null;
- if (entity.SymbolKind == SymbolKind.TypeDefinition) {
- doc = helpTree.GetHelpXml (idString);
+#pragma warning disable 618
+ if (entity.Kind == SymbolKind.NamedType) {
+ doc = helpTree.GetHelpXml (idString);
} else {
- var parentId = entity.DeclaringTypeDefinition.GetIdString ();
-
+ var containingType = entity.ContainingType;
+ if (containingType == null)
+ return null;
+ var parentId = containingType.GetDocumentationCommentId ();
doc = helpTree.GetHelpXml (parentId);
if (doc == null)
return null;
XmlNode node = SelectNode (doc, entity);
-
if (node != null)
- return commentCache [idString] = new DocumentationComment (node.OuterXml, new SimpleTypeResolveContext (entity));
+ return commentCache [idString] = node.OuterXml;
return null;
-// var node = doc.SelectSingleNode ("/Type/Members/Member")
-// return new DocumentationComment (doc.OuterXml, new SimpleTypeResolveContext (entity));
}
} catch (Exception e) {
hadError = true;
@@ -90,33 +81,34 @@ namespace MonoDevelop.Ide.TypeSystem
commentCache [idString] = null;
return null;
}
- return commentCache [idString] = new DocumentationComment (doc.OuterXml, new SimpleTypeResolveContext (entity));
+ return commentCache [idString] = doc.OuterXml;
}
- public XmlNode SelectNode (XmlDocument doc, IEntity entity)
+ internal static void ClearCommentCache ()
{
- switch (entity.SymbolKind) {
- case SymbolKind.None:
- case SymbolKind.TypeDefinition:
+ commentCache = new Dictionary<string, string> ();
+ }
+
+ static XmlNode SelectNode (XmlDocument doc, ISymbol entity)
+ {
+ switch (entity.Kind) {
+ case SymbolKind.NamedType:
case SymbolKind.Field:
case SymbolKind.Property:
- case SymbolKind.Indexer:
case SymbolKind.Event:
return doc.SelectSingleNode ("/Type/Members/Member[@MemberName='" + entity.Name + "']");
case SymbolKind.Method:
- case SymbolKind.Operator:
- case SymbolKind.Destructor:
- return SelectOverload (doc.SelectNodes ("/Type/Members/Member[@MemberName='" + entity.Name + "']"), (IParameterizedMember)entity);
- case SymbolKind.Constructor:
- return SelectOverload (doc.SelectNodes ("/Type/Members/Member[@MemberName='.ctor']"), (IParameterizedMember)entity);
-
+ var method = (IMethodSymbol)entity;
+ if (method.MethodKind == MethodKind.Constructor)
+ return SelectOverload (doc.SelectNodes ("/Type/Members/Member[@MemberName='.ctor']"), method);
+ return SelectOverload (doc.SelectNodes ("/Type/Members/Member[@MemberName='" + entity.Name + "']"), method);
default:
throw new ArgumentOutOfRangeException ();
}
-
}
- public XmlNode SelectOverload (XmlNodeList nodes, IParameterizedMember entity)
+
+ static XmlNode SelectOverload (XmlNodeList nodes, IMethodSymbol entity)
{
XmlNode node = null;
if (nodes.Count == 1) {
@@ -125,12 +117,12 @@ namespace MonoDevelop.Ide.TypeSystem
var p = entity.Parameters;
foreach (XmlNode curNode in nodes) {
var paramList = curNode.SelectNodes ("Parameters/*");
- if (p.Count == 0 && paramList.Count == 0)
+ if (p.Length == 0 && paramList.Count == 0)
return curNode;
- if (p.Count != paramList.Count)
+ if (p.Length != paramList.Count)
continue;
bool matched = true;
- for (int i = 0; i < p.Count; i++) {
+ for (int i = 0; i < p.Length; i++) {
var idString = GetTypeString (p [i].Type);
if (idString != paramList [i].Attributes ["Type"].Value) {
matched = false;
@@ -148,69 +140,20 @@ namespace MonoDevelop.Ide.TypeSystem
}
return null;
}
-
- static string GetTypeString (IType t)
+ static string GetTypeString (ITypeSymbol t)
{
- if (t.Kind == TypeKind.Unknown)
- return t.Name;
-
- if (t.Kind == TypeKind.TypeParameter)
- return t.FullName;
-
- var typeWithElementType = t as TypeWithElementType;
- if (typeWithElementType != null) {
- var sb = new StringBuilder ();
-
- if (typeWithElementType is PointerType) {
- sb.Append ("*");
- }
- sb.Append (GetTypeString (typeWithElementType.ElementType));
-
- if (typeWithElementType is ArrayType) {
- sb.Append ("[");
- sb.Append (new string (',', ((ArrayType)t).Dimensions - 1));
- sb.Append ("]");
- }
- return sb.ToString ();
- }
-
- ITypeDefinition typeDef = t.GetDefinition ();
- if (typeDef == null)
- return "";
-
- var result = new StringBuilder ();
-
- result.Append (typeDef.Namespace + ".");
-
- if (typeDef.DeclaringTypeDefinition != null) {
- string typeString = GetTypeString (typeDef.DeclaringTypeDefinition);
- result.Append (typeString);
- result.Append (".");
- }
-
- result.Append (typeDef.Name);
-
- if (typeDef.TypeParameterCount > 0) {
- result.Append ("<");
- for (int i = 0; i < typeDef.TypeParameterCount; i++) {
- if (i > 0)
- result.Append (",");
- if (t.TypeArguments.Count > 0) {
- result.Append (GetTypeString (t.TypeArguments [i]));
- } else {
- result.Append (typeDef.TypeParameters [i].FullName);
- }
- }
- result.Append (">");
+ switch (t.TypeKind) {
+ case TypeKind.Array:
+ var arr = (IArrayTypeSymbol)t;
+ return GetTypeString (arr.ElementType) + "[" + new string (',', arr.Rank - 1) + "]";
+ case TypeKind.Pointer:
+ var ptr = (IPointerTypeSymbol)t;
+ return "*" + GetTypeString (ptr.PointedAtType);
+ default:
+ var docComment = t.GetDocumentationCommentId ();
+ return docComment != null && docComment.Length > 2 ? docComment.Substring (2) : t.Name;
}
-
- return result.ToString ();
}
-
- #endregion
-
-
}
}
-
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/NR5CompatibiltyExtensions.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/NR5CompatibiltyExtensions.cs
new file mode 100644
index 0000000000..2636f4c2d2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/NR5CompatibiltyExtensions.cs
@@ -0,0 +1,396 @@
+//
+// NR5CompatibiltyExtensions.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Core;
+
+namespace MonoDevelop.Ide.TypeSystem
+{
+ public static class NR5CompatibiltyExtensions
+ {
+ readonly static Type ISymbolExtensionsTypeInfo;
+ static MethodInfo isAccessibleWithin1Method, isAccessibleWithin2Method;
+
+ static NR5CompatibiltyExtensions ()
+ {
+ ISymbolExtensionsTypeInfo = Type.GetType ("Microsoft.CodeAnalysis.Shared.Extensions.ISymbolExtensions, Microsoft.CodeAnalysis.Workspaces", true);
+
+ isAccessibleWithin1Method = ISymbolExtensionsTypeInfo.GetMethod ("IsAccessibleWithin", BindingFlags.Static | BindingFlags.Public, null, new [] { typeof(ISymbol), typeof(IAssemblySymbol), typeof(ITypeSymbol) }, null);
+ if (isAccessibleWithin1Method == null)
+ LoggingService.LogFatalError ("NR5CompatibiltyExtensions: IsAccessibleWithin(1) method not found");
+ isAccessibleWithin2Method = ISymbolExtensionsTypeInfo.GetMethod ("IsAccessibleWithin", BindingFlags.Static | BindingFlags.Public, null, new [] { typeof(ISymbol), typeof(INamedTypeSymbol), typeof(ITypeSymbol) }, null);
+ if (isAccessibleWithin2Method == null)
+ LoggingService.LogFatalError ("NR5CompatibiltyExtensions: IsAccessibleWithin(2) method not found");
+ }
+
+ /// <summary>
+ /// Gets the full name of the metadata.
+ /// In case symbol is not INamedTypeSymbol it returns raw MetadataName
+ /// Example: Generic type returns T1, T2...
+ /// </summary>
+ /// <returns>The full metadata name.</returns>
+ /// <param name="symbol">Symbol.</param>
+ public static string GetFullMetadataName (this ITypeSymbol symbol)
+ {
+ //This is for comaptibility with NR5 reflection name in case of generic types like T1, T2...
+ var namedTypeSymbol = symbol as INamedTypeSymbol;
+ return namedTypeSymbol != null ? GetFullMetadataName (namedTypeSymbol) : symbol.MetadataName;
+ }
+
+ /// <summary>
+ /// Gets the full MetadataName(ReflectionName in NR5).
+ /// Example: Namespace1.Namespace2.Classs1+NestedClassWithTwoGenericTypes`2+NestedClassWithoutGenerics
+ /// </summary>
+ /// <returns>The full metadata name.</returns>
+ /// <param name="symbol">Symbol.</param>
+ public static string GetFullMetadataName (this INamedTypeSymbol symbol)
+ {
+ var fullName = new StringBuilder (symbol.MetadataName);
+ var parentType = symbol.ContainingType;
+ while (parentType != null) {
+ fullName.Insert (0, '+');
+ fullName.Insert (0, parentType.MetadataName);
+ parentType = parentType.ContainingType;
+ }
+ var ns = symbol.ContainingNamespace;
+ while (ns != null && !ns.IsGlobalNamespace) {
+ fullName.Insert (0, '.');
+ fullName.Insert (0, ns.MetadataName);
+ ns = ns.ContainingNamespace;
+ }
+ return fullName.ToString ();
+ }
+
+ public static IEnumerable<INamedTypeSymbol> GetAllTypes (this INamespaceSymbol namespaceSymbol, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (namespaceSymbol == null)
+ throw new ArgumentNullException (nameof (namespaceSymbol));
+ var stack = new Stack<INamespaceOrTypeSymbol> ();
+ stack.Push (namespaceSymbol);
+
+ while (stack.Count > 0) {
+ if (cancellationToken.IsCancellationRequested)
+ yield break;
+ var current = stack.Pop ();
+ var currentNs = current as INamespaceSymbol;
+ if (currentNs != null) {
+ foreach (var member in currentNs.GetMembers ())
+ stack.Push (member);
+ } else {
+ var namedType = (INamedTypeSymbol)current;
+ foreach (var nestedType in namedType.GetTypeMembers ())
+ stack.Push (nestedType);
+ yield return namedType;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Determines if derived from baseType. Includes itself and all base classes, but does not include interfaces.
+ /// </summary>
+ /// <returns><c>true</c> if is derived from class the specified type baseType; otherwise, <c>false</c>.</returns>
+ /// <param name="type">Type.</param>
+ /// <param name="baseType">Base type.</param>
+ public static bool IsDerivedFromClass (this INamedTypeSymbol type, INamedTypeSymbol baseType)
+ {
+ //NR5 is returning true also for same type
+ for (; type != null; type = type.BaseType) {
+ if (type == baseType) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static IEnumerable<INamedTypeSymbol> GetBaseTypes (this ITypeSymbol type)
+ {
+ var current = type.BaseType;
+ while (current != null) {
+ yield return current;
+ current = current.BaseType;
+ }
+ }
+
+ public static IEnumerable<ITypeSymbol> GetBaseTypesAndThis (this ITypeSymbol type)
+ {
+ var current = type;
+ while (current != null) {
+ yield return current;
+ current = current.BaseType;
+ }
+ }
+
+ public static ITypeSymbol GetReturnType (this ISymbol symbol)
+ {
+ if (symbol == null)
+ throw new ArgumentNullException ("symbol");
+ switch (symbol.Kind) {
+ case SymbolKind.Field:
+ var field = (IFieldSymbol)symbol;
+ return field.Type;
+ case SymbolKind.Method:
+ var method = (IMethodSymbol)symbol;
+ if (method.MethodKind == MethodKind.Constructor)
+ return method.ContainingType;
+ return method.ReturnType;
+ case SymbolKind.Property:
+ var property = (IPropertySymbol)symbol;
+ return property.Type;
+ case SymbolKind.Event:
+ var evt = (IEventSymbol)symbol;
+ return evt.Type;
+ case SymbolKind.Parameter:
+ var param = (IParameterSymbol)symbol;
+ return param.Type;
+ case SymbolKind.Local:
+ var local = (ILocalSymbol)symbol;
+ return local.Type;
+ }
+ return null;
+ }
+
+
+ /// <summary>
+ /// Gets the full name of the namespace.
+ /// </summary>
+ public static string GetFullName (this INamespaceSymbol ns)
+ {
+ return ns.ToDisplayString (SymbolDisplayFormat.CSharpErrorMessageFormat);
+ }
+
+ /// <summary>
+ /// Gets the full name. The full name is no 1:1 representation of a type it's missing generics and it has a poor
+ /// representation for inner types (just dot separated).
+ /// DO NOT use this method unless you're know what you do. It's only implemented for legacy code.
+ /// </summary>
+ public static string GetFullName (this ITypeSymbol type)
+ {
+ return type.ToDisplayString (SymbolDisplayFormat.CSharpErrorMessageFormat);
+ }
+
+ public static IEnumerable<INamedTypeSymbol> GetAllTypesInMainAssembly (this Compilation compilation, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (compilation == null)
+ throw new ArgumentNullException ("compilation");
+ return compilation.Assembly.GlobalNamespace.GetAllTypes (cancellationToken);
+ }
+
+ public static IEnumerable<T> GetAccessibleMembersInThisAndBaseTypes<T>(this ITypeSymbol containingType, ISymbol within) where T : class, ISymbol
+ {
+ if (containingType == null)
+ return Enumerable.Empty<T> ();
+
+ var types = containingType.GetBaseTypesAndThis ();
+ return types.SelectMany (x => x.GetMembers ().OfType<T> ().Where (m => m.IsAccessibleWithin (within)));
+ }
+
+ /// <summary>
+ /// Gets all base classes.
+ /// </summary>
+ /// <returns>The all base classes.</returns>
+ /// <param name="type">Type.</param>
+ public static IEnumerable<INamedTypeSymbol> GetAllBaseClasses (this INamedTypeSymbol type, bool includeSuperType = false)
+ {
+ if (!includeSuperType)
+ type = type.BaseType;
+ while (type != null) {
+ yield return type;
+ type = type.BaseType;
+ }
+ }
+
+ public static bool IsDefinedInMetadata (this ISymbol symbol)
+ {
+ return symbol.Locations.Any (loc => loc.IsInMetadata);
+ }
+
+ public static bool IsDefinedInSource (this ISymbol symbol)
+ {
+ return symbol.Locations.All (loc => loc.IsInSource);
+ }
+
+ //public static DeclarationModifiers GetSymbolModifiers(this ISymbol symbol)
+ //{
+ // // ported from roslyn source - why they didn't use DeclarationModifiers.From (symbol) ?
+ // return DeclarationModifiers.None
+ // .WithIsStatic (symbol.IsStatic)
+ // .WithIsAbstract (symbol.IsAbstract)
+ // .WithIsUnsafe (symbol.IsUnsafe ())
+ // .WithIsVirtual (symbol.IsVirtual)
+ // .WithIsOverride (symbol.IsOverride)
+ // .WithIsSealed (symbol.IsSealed);
+ //}
+
+ public static IEnumerable<SyntaxReference> GetDeclarations (this ISymbol symbol)
+ {
+ return symbol != null
+ ? symbol.DeclaringSyntaxReferences.AsEnumerable ()
+ : Enumerable.Empty<SyntaxReference> ();
+ }
+
+ public static bool IsSameAssemblyOrHasFriendAccessTo (this IAssemblySymbol assembly, IAssemblySymbol toAssembly)
+ {
+ return
+ Equals (assembly, toAssembly) ||
+ (assembly.IsInteractive && toAssembly.IsInteractive) ||
+ toAssembly.GivesAccessTo (assembly);
+ }
+
+ /// <summary>
+ /// Returns the component category.
+ /// [System.ComponentModel.CategoryAttribute (CATEGORY)]
+ /// </summary>
+ /// <param name="symbol">Symbol.</param>
+ public static string GetComponentCategory (this ISymbol symbol)
+ {
+ if (symbol == null)
+ throw new ArgumentNullException ("symbol");
+ var browsableState = symbol.GetAttributes ().FirstOrDefault (attr => attr.AttributeClass.Name == "CategoryAttribute" && attr.AttributeClass.ContainingNamespace.MetadataName == "System.ComponentModel");
+ if (browsableState != null && browsableState.ConstructorArguments.Length == 1) {
+ try {
+ return (string)browsableState.ConstructorArguments [0].Value;
+ } catch {
+ }
+ }
+ return null;
+ }
+
+
+ /// <summary>
+ /// Returns true if the type is public and was tagged with
+ /// [System.ComponentModel.ToolboxItem (true)]
+ /// </summary>
+ /// <returns><c>true</c> if is designer browsable the specified symbol; otherwise, <c>false</c>.</returns>
+ /// <param name="symbol">Symbol.</param>
+ public static bool IsToolboxItem (this ITypeSymbol symbol)
+ {
+ if (symbol == null)
+ throw new ArgumentNullException ("symbol");
+ if (symbol.DeclaredAccessibility != Accessibility.Public)
+ return false;
+ var toolboxItemAttr = symbol.GetAttributes ().FirstOrDefault (attr => attr.AttributeClass.Name == "ToolboxItemAttribute" && attr.AttributeClass.ContainingNamespace.MetadataName == "System.ComponentModel");
+ if (toolboxItemAttr != null && toolboxItemAttr.ConstructorArguments.Length == 1) {
+ try {
+ return (bool)toolboxItemAttr.ConstructorArguments [0].Value;
+ } catch {
+ }
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// Returns true if the symbol wasn't tagged with
+ /// [System.ComponentModel.BrowsableAttribute (false)]
+ /// </summary>
+ /// <returns><c>true</c> if is designer browsable the specified symbol; otherwise, <c>false</c>.</returns>
+ /// <param name="symbol">Symbol.</param>
+ public static bool IsDesignerBrowsable (this ISymbol symbol)
+ {
+ if (symbol == null)
+ throw new ArgumentNullException ("symbol");
+ var browsableState = symbol.GetAttributes ().FirstOrDefault (attr => attr.AttributeClass.Name == "BrowsableAttribute" && attr.AttributeClass.ContainingNamespace.MetadataName == "System.ComponentModel");
+ if (browsableState != null && browsableState.ConstructorArguments.Length == 1) {
+ try {
+ return (bool)browsableState.ConstructorArguments [0].Value;
+ } catch {
+ }
+ }
+ return true;
+ }
+
+ public static INamedTypeSymbol GetEnclosingNamedType(this SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ {
+ return semanticModel.GetEnclosingSymbol<INamedTypeSymbol>(position, cancellationToken);
+ }
+
+ public static TSymbol GetEnclosingSymbol<TSymbol>(this SemanticModel semanticModel, int position, CancellationToken cancellationToken)
+ where TSymbol : ISymbol
+ {
+ for (var symbol = semanticModel.GetEnclosingSymbol(position, cancellationToken);
+ symbol != null;
+ symbol = symbol.ContainingSymbol)
+ {
+ if (symbol is TSymbol)
+ {
+ return (TSymbol)symbol;
+ }
+ }
+
+ return default(TSymbol);
+ }
+
+ /// <summary>
+ /// Checks if 'symbol' is accessible from within 'within'.
+ /// </summary>
+ public static bool IsAccessibleWithin(
+ this ISymbol symbol,
+ ISymbol within,
+ ITypeSymbol throughTypeOpt = null)
+ {
+ if (within is IAssemblySymbol)
+ {
+ return symbol.IsAccessibleWithin((IAssemblySymbol)within, throughTypeOpt);
+ }
+ else if (within is INamedTypeSymbol)
+ {
+ return symbol.IsAccessibleWithin((INamedTypeSymbol)within, throughTypeOpt);
+ }
+ else
+ {
+ throw new ArgumentException();
+ }
+ }
+
+ /// <summary>
+ /// Checks if 'symbol' is accessible from within assembly 'within'.
+ /// </summary>
+ public static bool IsAccessibleWithin(
+ this ISymbol symbol,
+ IAssemblySymbol within,
+ ITypeSymbol throughTypeOpt = null)
+ {
+ return (bool)isAccessibleWithin1Method.Invoke (null, new object [] { symbol, within, throughTypeOpt });
+ }
+
+ /// <summary>
+ /// Checks if 'symbol' is accessible from within name type 'within', with an optional
+ /// qualifier of type "throughTypeOpt".
+ /// </summary>
+ public static bool IsAccessibleWithin(
+ this ISymbol symbol,
+ INamedTypeSymbol within,
+ ITypeSymbol throughTypeOpt = null)
+ {
+ return (bool)isAccessibleWithin2Method.Invoke (null, new object [] { symbol, within, throughTypeOpt });
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/NetAmbience.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/NetAmbience.cs
deleted file mode 100755
index 28b35bc9bb..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/NetAmbience.cs
+++ /dev/null
@@ -1,367 +0,0 @@
-//
-// NetAmbience.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Linq;
-using System.Text;
-using ICSharpCode.NRefactory.TypeSystem;
-using System.Collections.Generic;
-
-namespace MonoDevelop.Ide.TypeSystem
-{
- public class NetAmbience : Ambience
- {
- public NetAmbience () : base ("NET")
- {
- classTypes [TypeKind.Class] = "Class";
- classTypes [TypeKind.Enum] = "Enumeration";
- classTypes [TypeKind.Interface] = "Interface";
- classTypes [TypeKind.Struct] = "Structure";
- classTypes [TypeKind.Delegate] = "Delegate";
- }
-
- public override string SingleLineComment (string text)
- {
- return "// " + text;
- }
-
- #region Type system output
- public override string GetIntrinsicTypeName (string reflectionName)
- {
- return reflectionName;
- }
-
- protected override string GetTypeReferenceString (IType reference, OutputSettings settings)
- {
- return reference.ToString ();
- }
-
- protected override string GetTypeString (IType t, OutputSettings settings)
- {
- ITypeDefinition type = t.GetDefinition ();
- var result = new StringBuilder ();
- if (settings.IncludeModifiers)
- AppendModifiers (result, settings, type);
- if (settings.IncludeKeywords)
- result.Append (settings.EmitKeyword (GetString (type.Kind)));
-
- result.Append (settings.EmitName (type, settings.UseFullName ? type.FullName : type.Name));
-
- int parameterCount = type.TypeParameters.Count;
-
- if (settings.IncludeGenerics && parameterCount > 0) {
- result.Append (settings.Markup ("<"));
- if (!settings.HideGenericParameterNames) {
- for (int i = 0; i < parameterCount; i++) {
- if (i > 0)
- result.Append (settings.Markup (", "));
- result.Append (type.TypeParameters [i].Name);
- }
- }
- result.Append (settings.Markup (">"));
- }
-
- if (settings.IncludeBaseTypes && type.DirectBaseTypes.Any ()) {
- result.Append (settings.Markup (" : "));
- bool first = true;
- foreach (var baseType in type.DirectBaseTypes) {
- if (baseType.Equals (type.Compilation.FindType (KnownTypeCode.Object)))
- continue;
- if (!first)
- result.Append (settings.Markup (", "));
- first = false;
- result.Append (GetTypeReferenceString (baseType, settings));
- }
-
- }
- return result.ToString ();
- }
-
- protected override string GetMethodString (IMethod method, OutputSettings settings)
- {
- var result = new StringBuilder ();
-
- if (settings.IncludeModifiers)
- AppendModifiers (result, settings, method);
-
- result.Append (settings.EmitKeyword ("Method"));
- result.Append (settings.EmitName (method, settings.UseFullName ? method.FullName : method.Name));
-
- if (settings.IncludeParameters) {
- result.Append (settings.Markup ("("));
- bool first = true;
- foreach (var parameter in method.Parameters) {
- if (!first)
- result.Append (settings.Markup (", "));
- result.Append (GetParameterString (method, parameter, settings));
- first = false;
- }
- result.Append (settings.Markup (")"));
- }
-
- if (settings.IncludeReturnType) {
- result.Append (settings.Markup (" : "));
- result.Append (GetTypeReferenceString (method.ReturnType, settings));
- }
- return result.ToString ();
- }
-
- protected override string GetConstructorString (IMethod method, OutputSettings settings)
- {
- var result = new StringBuilder ();
-
- if (settings.IncludeModifiers)
- AppendModifiers (result, settings, method);
-
- result.Append (settings.EmitKeyword ("Constructor"));
- result.Append (settings.EmitName (method, method.DeclaringType.Name));
-
- if (settings.IncludeParameters) {
- result.Append (settings.Markup ("("));
- bool first = true;
- foreach (var parameter in method.Parameters) {
- if (!first)
- result.Append (settings.Markup (", "));
- result.Append (GetParameterString (method, parameter, settings));
- first = false;
- }
- result.Append (settings.Markup (")"));
- }
- return result.ToString ();
- }
-
- protected override string GetDestructorString (IMethod method, OutputSettings settings)
- {
- var result = new StringBuilder ();
- result.Append (settings.EmitKeyword ("Destructor"));
- result.Append (settings.EmitName (method, method.DeclaringType.Name));
- return result.ToString ();
- }
-
- protected override string GetOperatorString (IMethod method, OutputSettings settings)
- {
- var result = new StringBuilder ();
-
- if (settings.IncludeModifiers)
- AppendModifiers (result, settings, method);
-
- result.Append (settings.EmitKeyword ("Operator"));
- result.Append (settings.EmitName (method, settings.UseFullName ? method.FullName : method.Name));
-
- if (settings.IncludeParameters) {
- result.Append (settings.Markup ("("));
- bool first = true;
- foreach (var parameter in method.Parameters) {
- if (!first)
- result.Append (settings.Markup (", "));
- result.Append (GetParameterString (method, parameter, settings));
- first = false;
- }
- result.Append (settings.Markup (")"));
- }
-
- if (settings.IncludeReturnType) {
- result.Append (settings.Markup (" : "));
- result.Append (GetTypeReferenceString (method.ReturnType, settings));
- }
- return result.ToString ();
- }
-
- protected override string GetFieldString (IField field, OutputSettings settings)
- {
- var result = new StringBuilder ();
-
- if (settings.IncludeModifiers)
- AppendModifiers (result, settings, field);
-
- result.Append (settings.EmitKeyword ("Field"));
- result.Append (settings.EmitName (field, field.Name));
-
- if (settings.IncludeReturnType) {
- result.Append (settings.Markup (" : "));
- result.Append (GetTypeReferenceString (field.ReturnType, settings));
- }
- return result.ToString ();
- }
-
- protected override string GetEventString (IEvent evt, OutputSettings settings)
- {
- var result = new StringBuilder ();
-
- if (settings.IncludeModifiers)
- AppendModifiers (result, settings, evt);
-
- result.Append (settings.EmitKeyword ("Event"));
- result.Append (settings.EmitName (evt, evt.Name));
-
- if (settings.IncludeReturnType) {
- result.Append (settings.Markup (" : "));
- result.Append (GetTypeReferenceString (evt.ReturnType, settings));
- }
- return result.ToString ();
- }
-
- protected override string GetPropertyString (IProperty property, OutputSettings settings)
- {
- var result = new StringBuilder ();
- if (settings.IncludeModifiers)
- AppendModifiers (result, settings, property);
- result.Append (settings.EmitKeyword ("Property"));
- result.Append (settings.EmitName (property, property.Name));
- if (settings.IncludeReturnType) {
- result.Append (settings.Markup (" : "));
- result.Append (GetTypeReferenceString (property.ReturnType, settings));
- }
- return result.ToString ();
- }
-
- protected override string GetIndexerString (IProperty property, OutputSettings settings)
- {
- var result = new StringBuilder ();
- if (settings.IncludeModifiers)
- AppendModifiers (result, settings, property);
- result.Append (settings.EmitKeyword ("Indexer"));
- result.Append (settings.EmitName (property, property.Name));
-
- if (settings.IncludeParameters && property.Parameters.Count > 0) {
- result.Append (settings.Markup ("("));
- bool first = true;
- foreach (var parameter in property.Parameters) {
- if (!first)
- result.Append (settings.Markup (", "));
- result.Append (GetParameterString (property, parameter, settings));
- first = false;
- }
- result.Append (settings.Markup (")"));
- }
- if (settings.IncludeReturnType) {
- result.Append (settings.Markup (" : "));
- result.Append (GetTypeReferenceString (property.ReturnType, settings));
- }
- return result.ToString ();
- }
-
- protected override string GetParameterString (IParameterizedMember member, IParameter parameter, OutputSettings settings)
- {
- var result = new StringBuilder ();
- if (settings.IncludeParameterName) {
- result.Append (Format (parameter.Name));
- if (settings.IncludeReturnType) {
- result.Append (settings.Markup (" : "));
- result.Append (GetTypeReferenceString (parameter.Type, settings));
- }
- } else {
- result.Append (GetTypeReferenceString (parameter.Type, settings));
- }
- if (parameter.IsRef || parameter.IsOut)
- result.Append (settings.Markup ("&"));
- return result.ToString ();
- }
- #endregion
-
- void AppendModifiers (StringBuilder result, OutputSettings settings, IEntity entity)
- {
- if (entity.IsStatic)
- result.Append (settings.EmitModifiers ("Static"));
- if (entity.IsSealed)
- result.Append (settings.EmitModifiers ("Sealed"));
- if (entity.IsAbstract)
- result.Append (settings.EmitModifiers ("Abstract"));
- if (entity.IsShadowing)
- result.Append (settings.EmitModifiers ("Shadows"));
- if (entity.IsSynthetic)
- result.Append (settings.EmitModifiers ("Synthetic"));
-
- switch (entity.Accessibility) {
- case Accessibility.Internal:
- result.Append (settings.EmitModifiers ("Internal"));
- break;
- case Accessibility.ProtectedAndInternal:
- result.Append (settings.EmitModifiers ("Protected And Internal"));
- break;
- case Accessibility.ProtectedOrInternal:
- result.Append (settings.EmitModifiers ("Protected Or Internal"));
- break;
- case Accessibility.Protected:
- result.Append (settings.EmitModifiers ("Protected"));
- break;
- case Accessibility.Private:
- result.Append (settings.EmitModifiers ("Private"));
- break;
- case Accessibility.Public:
- result.Append (settings.EmitModifiers ("Public"));
- break;
- }
- }
-
- public override string GetString (string nameSpace, OutputSettings settings)
- {
- var result = new StringBuilder ();
- result.Append (settings.EmitKeyword ("Namespace"));
- result.Append (Format (nameSpace));
- return result.ToString ();
- }
-
- Dictionary<TypeKind, string> classTypes = new Dictionary<TypeKind, string> ();
-
- string GetString (TypeKind classType)
- {
- string res;
- if (classTypes.TryGetValue (classType, out res))
- return res;
- return string.Empty;
- }
-// public string Visit (IAttribute attribute, OutputSettings settings)
-// {
-// StringBuilder result = new StringBuilder ();
-// result.Append (settings.Markup ("["));
-// result.Append (GetString (attribute.AttributeType, settings));
-// result.Append (settings.Markup ("("));
-// bool first = true;
-// if (attribute.PositionalArguments != null) {
-// foreach (object o in attribute.PositionalArguments) {
-// if (!first)
-// result.Append (settings.Markup (", "));
-// first = false;
-// if (o is string) {
-// result.Append (settings.Markup ("\""));
-// result.Append (o);
-// result.Append (settings.Markup ("\""));
-// } else if (o is char) {
-// result.Append (settings.Markup ("\""));
-// result.Append (o);
-// result.Append (settings.Markup ("\""));
-// } else
-// result.Append (o);
-// }
-// }
-// result.Append (settings.Markup (")]"));
-// return result.ToString ();
-// }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/OutputFlags.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/OutputFlags.cs
deleted file mode 100644
index 6ef2920d6d..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/OutputFlags.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// OutputFlags.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace MonoDevelop.Ide.TypeSystem
-{
- [Flags]
- public enum OutputFlags {
- None = 0,
-
- // Flags
- UseFullName = 0x0001,
- IncludeReturnType = 0x0002,
- IncludeParameters = 0x0004,
- IncludeParameterName = 0x0008,
- IncludeMarkup = 0x0010,
- IncludeKeywords = 0x0020,
- IncludeModifiers = 0x0040,
- IncludeBaseTypes = 0x0080,
- IncludeGenerics = 0x0100,
- UseIntrinsicTypeNames = 0x0200,
- HighlightName = 0x0400,
- HideExtensionsParameter = 0x0800,
- HideGenericParameterNames= 0x1000,
- HideArrayBrackets = 0x2000,
- UseNETTypeNames = 0x4000, // print 'System.Int32' intead of 'int'
- UseFullInnerTypeName = 0x8000,
- ReformatDelegates = 0x10000,
- GeneralizeGenerics = 0x20000,
- StaticUsage = 0x40000, // to distinguish static usage for extension methods.
- IncludeConstraints = 0x80000,
- ReturnTypesLast = 0x100000,
- CompletionListFomat = 0x200000, // print "Name : type" instead of "type : Name"
- IncludeAccessor = 0x400000, // print {get;set;} after property name.
-
- ClassBrowserEntries = IncludeReturnType | IncludeParameters | IncludeGenerics,
- AssemblyBrowserDescription = IncludeGenerics | IncludeBaseTypes | IncludeReturnType | IncludeParameters | IncludeParameterName | IncludeMarkup | IncludeKeywords | IncludeModifiers
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/OutputSettings.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/OutputSettings.cs
deleted file mode 100644
index 0071f2b4ac..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/OutputSettings.cs
+++ /dev/null
@@ -1,268 +0,0 @@
-// OutputSettings.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-
-using System;
-using System.Text;
-using MonoDevelop.Projects.Policies;
-using System.Collections.Generic;
-using ICSharpCode.NRefactory.TypeSystem;
-
-namespace MonoDevelop.Ide.TypeSystem
-{
- public class OutputSettings
- {
- public OutputFlags OutputFlags {
- get;
- set;
- }
-
- public PolicyContainer PolicyParent {
- get;
- set;
- }
-
- public OutputSettings (OutputFlags outputFlags)
- {
- this.OutputFlags = outputFlags;
- }
-
- public string Markup (string text)
- {
- if (MarkupCallback != null)
- return MarkupCallback (text);
- return IncludeMarkup ? PangoFormat (text) : text;
- }
-
- public string EmitName (object domVisitable, string text)
- {
- if (EmitNameCallback != null)
- return EmitNameCallback (domVisitable, text);
- return text;
- }
-
- public string EmitModifiers (string text)
- {
- if (!IncludeModifiers)
- return string.Empty;
- if (EmitModifiersCallback != null)
- return EmitModifiersCallback (text) + " ";
- if (IncludeMarkup)
- return "<b>" + PangoFormat (text) + "</b> ";
- return text + " ";
- }
-
- public string EmitKeyword (string text)
- {
- if (EmitKeywordCallback != null)
- return EmitKeywordCallback (text) + " ";
- if (!IncludeKeywords)
- return "";
- if (IncludeMarkup)
- return "<b>" + PangoFormat (text) + "</b> ";
- return text + " ";
- }
-
- public string Highlight (string text)
- {
- if (HighlightCallback != null)
- return HighlightCallback (text);
- if (IncludeMarkup)
- return "<b>" + PangoFormat (text) + "</b>";
- return text;
- }
-
- public string PostProcess (object domVisitable, string outString)
- {
- if (PostProcessCallback != null)
- return PostProcessCallback (domVisitable, outString);
- return outString;
- }
-
- static string PangoFormat (string input)
- {
- StringBuilder result = new StringBuilder ();
- foreach (char ch in input) {
- switch (ch) {
- case '<':
- result.Append ("&lt;");
- break;
- case '>':
- result.Append ("&gt;");
- break;
- case '&':
- result.Append ("&amp;");
- break;
- default:
- result.Append (ch);
- break;
- }
- }
- return result.ToString ();
- }
-
- public bool IncludeMarkup {
- get {
- return (OutputFlags & OutputFlags.IncludeMarkup) == OutputFlags.IncludeMarkup;
- }
- }
-
- public bool IncludeKeywords {
- get {
- return (OutputFlags & OutputFlags.IncludeKeywords) == OutputFlags.IncludeKeywords;
- }
- }
-
- public bool IncludeModifiers {
- get {
- return (OutputFlags & OutputFlags.IncludeModifiers) == OutputFlags.IncludeModifiers;
- }
- }
-
- public bool UseFullName {
- get {
- return (OutputFlags & OutputFlags.UseFullName) == OutputFlags.UseFullName;
- }
- }
-
- public bool UseFullInnerTypeName {
- get {
- return (OutputFlags & OutputFlags.UseFullInnerTypeName) == OutputFlags.UseFullInnerTypeName;
- }
- }
-
- public bool IncludeParameters {
- get {
- return (OutputFlags & OutputFlags.IncludeParameters) == OutputFlags.IncludeParameters;
- }
- }
-
- public bool IncludeReturnType {
- get {
- return (OutputFlags & OutputFlags.IncludeReturnType) == OutputFlags.IncludeReturnType;
- }
- }
-
- public bool IncludeParameterName {
- get {
- return (OutputFlags & OutputFlags.IncludeParameterName) == OutputFlags.IncludeParameterName;
- }
- }
-
- public bool IncludeBaseTypes {
- get {
- return (OutputFlags & OutputFlags.IncludeBaseTypes) == OutputFlags.IncludeBaseTypes;
- }
- }
-
- public bool IncludeGenerics {
- get {
- return (OutputFlags & OutputFlags.IncludeGenerics) == OutputFlags.IncludeGenerics;
- }
- }
-
- public bool HideArrayBrackets {
- get {
- return (OutputFlags & OutputFlags.HideArrayBrackets) == OutputFlags.HideArrayBrackets;
- }
- }
-
- public bool HighlightName {
- get {
- return (OutputFlags & OutputFlags.HighlightName) == OutputFlags.HighlightName;
- }
- }
-
- public bool HideExtensionsParameter {
- get {
- return (OutputFlags & OutputFlags.HideExtensionsParameter) == OutputFlags.HideExtensionsParameter;
- }
- }
-
- public bool HideGenericParameterNames {
- get {
- return (OutputFlags & OutputFlags.HideGenericParameterNames) != 0;
- }
- }
-
- public bool GeneralizeGenerics {
- get {
- return (OutputFlags & OutputFlags.GeneralizeGenerics) != 0;
- }
- }
-
- public bool UseNETTypeNames {
- get {
- return (OutputFlags & OutputFlags.UseNETTypeNames) != 0;
- }
- }
-
- public bool ReformatDelegates {
- get {
- return (OutputFlags & OutputFlags.ReformatDelegates) != 0;
- }
- }
-
- public bool StaticUsage {
- get {
- return (OutputFlags & OutputFlags.StaticUsage) != 0;
- }
- }
-
- public bool IncludeConstraints {
- get {
- return (OutputFlags & OutputFlags.IncludeConstraints) != 0;
- }
- }
-
- public bool CompletionListFomat {
- get {
- return (OutputFlags & OutputFlags.CompletionListFomat) != 0;
- }
- }
-
- public bool ReturnTypesLast {
- get {
- return (OutputFlags & OutputFlags.ReturnTypesLast) != 0;
- }
- }
-
- public bool IncludeAccessor {
- get {
- return (OutputFlags & OutputFlags.IncludeAccessor) == OutputFlags.IncludeAccessor;
- }
- }
-
- public MarkupText EmitModifiersCallback;
- public MarkupText EmitKeywordCallback;
- public MarkupText MarkupCallback;
- public MarkupText HighlightCallback;
- public Func<object, string, string> EmitNameCallback;
-
- public delegate string MarkupText (string text);
-
- public Func<object, string, string> PostProcessCallback;
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ParsedDocument.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ParsedDocument.cs
index 0fdb4a13cd..dddd7641f3 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ParsedDocument.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ParsedDocument.cs
@@ -29,10 +29,8 @@ using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Threading;
-using ICSharpCode.NRefactory;
-using ICSharpCode.NRefactory.Semantics;
-using Mono.TextEditor;
-
+using MonoDevelop.Ide.Editor;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.TypeSystem
{
@@ -43,7 +41,6 @@ namespace MonoDevelop.Ide.TypeSystem
NonSerializable = 1
}
-
public abstract class ParsedDocument
{
DateTime lastWriteTimeUtc = DateTime.UtcNow;
@@ -51,63 +48,8 @@ namespace MonoDevelop.Ide.TypeSystem
get { return lastWriteTimeUtc; }
set { lastWriteTimeUtc = value; }
}
-
- [NonSerialized]
- List<Comment> comments = new List<Comment> ();
-
- public virtual IUnresolvedFile ParsedFile {
- get { return null; }
- set { throw new InvalidOperationException (); }
- }
- public IList<Comment> Comments {
- get {
- return comments;
- }
- }
- /// <summary>
- /// Gets or sets a value indicating whether this instance is invalid and needs to be reparsed.
- /// </summary>
- public bool IsInvalid {
- get;
- set;
- }
-
- List<Tag> tagComments = new List<Tag> ();
- public IList<Tag> TagComments {
- get {
- return tagComments;
- }
- }
-
- IEnumerable<FoldingRegion> foldings = null;
- public virtual IEnumerable<FoldingRegion> Foldings {
- get {
- return foldings ?? Enumerable.Empty<FoldingRegion> ();
- }
- }
-
- public IEnumerable<FoldingRegion> UserRegions {
- get {
- return Foldings.Where (f => f.Type == FoldType.UserRegion);
- }
- }
-
- List<PreProcessorDefine> defines = new List<PreProcessorDefine> ();
- public IList<PreProcessorDefine> Defines {
- get {
- return defines;
- }
- }
-
- List<ConditionalRegion> conditionalRegions = new List<ConditionalRegion> ();
- public IList<ConditionalRegion> ConditionalRegions {
- get {
- return conditionalRegions;
- }
- }
-
[NonSerialized]
ParsedDocumentFlags flags;
public ParsedDocumentFlags Flags {
@@ -128,16 +70,30 @@ namespace MonoDevelop.Ide.TypeSystem
fileName = value;
}
}
-
- public virtual IList<Error> Errors {
- get {
- return new Error[0];
- }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance is invalid and needs to be reparsed.
+ /// </summary>
+ public bool IsInvalid {
+ get;
+ set;
}
-
+
+ public abstract Task<IReadOnlyList<Comment>> GetCommentsAsync (CancellationToken cancellationToken = default(CancellationToken));
+ public abstract Task<IReadOnlyList<Tag>> GetTagCommentsAsync (CancellationToken cancellationToken = default(CancellationToken));
+ public abstract Task<IReadOnlyList<FoldingRegion>> GetFoldingsAsync (CancellationToken cancellationToken = default(CancellationToken));
+
+ public async Task<IEnumerable<FoldingRegion>> GetUserRegionsAsync (CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var foldings = await GetFoldingsAsync (cancellationToken).ConfigureAwait (false);
+ return foldings.Where (f => f.Type == FoldType.UserRegion);
+ }
+
+ public abstract Task<IReadOnlyList<Error>> GetErrorsAsync (CancellationToken cancellationToken = default(CancellationToken));
+
public bool HasErrors {
get {
- return Errors.Any (e => e.ErrorType == ErrorType.Error);
+ return GetErrorsAsync ().Result.Any (e => e.ErrorType == ErrorType.Error);
}
}
@@ -162,236 +118,84 @@ namespace MonoDevelop.Ide.TypeSystem
{
this.fileName = fileName;
}
-
-
- public void Add (Comment comment)
- {
- comments.Add (comment);
- }
-
- public void Add (Tag tagComment)
- {
- tagComments.Add (tagComment);
- }
-
- public void Add (PreProcessorDefine define)
- {
- defines.Add (define);
- }
-
- public void Add (ConditionalRegion region)
+ }
+
+ public class DefaultParsedDocument : ParsedDocument
+ {
+ public DefaultParsedDocument (string fileName) : base (fileName)
{
- conditionalRegions.Add (region);
+ Flags |= ParsedDocumentFlags.NonSerializable;
}
- List<FoldingRegion> EnsureFoldingList ()
- {
- if (this.foldings == null || !(foldings is List<FoldingRegion>))
- this.foldings = new List<FoldingRegion> ();
- return (List<FoldingRegion>)foldings;
- }
-
- public void Add (FoldingRegion region)
+ List<Comment> comments = new List<Comment> ();
+
+ public void Add (Comment comment)
{
- EnsureFoldingList ().Add (region);
+ comments.Add (comment);
}
-
- public void Add (IEnumerable<Comment> comments)
+
+ public void AddRange (IEnumerable<Comment> comments)
{
this.comments.AddRange (comments);
}
-
- public void Add (IEnumerable<Tag> tagComments)
- {
- this.tagComments.AddRange (tagComments);
- }
-
- public void Add (IEnumerable<PreProcessorDefine> defines)
- {
- this.defines.AddRange (defines);
- }
-
- public void Add (IEnumerable<FoldingRegion> folds)
- {
- if (foldings == null) {
- this.foldings = folds;
- return;
- }
- if (foldings != null && !(foldings is List<FoldingRegion>))
- EnsureFoldingList ().AddRange (foldings);
- EnsureFoldingList ().AddRange (folds);
- }
-
- public void Add (IEnumerable<ConditionalRegion> conditionalRegions)
- {
- this.conditionalRegions.AddRange (conditionalRegions);
- }
-
- #region IUnresolvedFile delegation
- public virtual IUnresolvedTypeDefinition GetTopLevelTypeDefinition (TextLocation location)
+
+ public override Task<IReadOnlyList<Comment>> GetCommentsAsync (CancellationToken cancellationToken = default(CancellationToken))
{
- return null;
+ return Task.FromResult<IReadOnlyList<Comment>> (comments);
}
-
- public virtual IUnresolvedTypeDefinition GetInnermostTypeDefinition (TextLocation location)
+
+ List<Tag> tagComments = new List<Tag> ();
+
+ public void Add (Tag tagComment)
{
- return null;
+ tagComments.Add (tagComment);
}
- public virtual IUnresolvedMember GetMember (TextLocation location)
+ public void AddRange (IEnumerable<Tag> tagComments)
{
- return null;
+ this.tagComments.AddRange (tagComments);
}
- public virtual IList<IUnresolvedTypeDefinition> TopLevelTypeDefinitions {
- get {
- return new List<IUnresolvedTypeDefinition> ();
- }
+ public override Task<IReadOnlyList<Tag>> GetTagCommentsAsync (CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return Task.FromResult<IReadOnlyList<Tag>> (tagComments);
}
- #endregion
+ List<FoldingRegion> foldingRegions = new List<FoldingRegion> ();
- public Func<MonoDevelop.Ide.Gui.Document, CancellationToken, IRefactoringContext> CreateRefactoringContext;
- public Func<TextEditorData, object, CancellationToken, IRefactoringContext> CreateRefactoringContextWithEditor;
- }
-
- public class DefaultParsedDocument : ParsedDocument, IUnresolvedFile
- {
-
- public override IUnresolvedFile ParsedFile {
- get { return this; }
- }
-
- List<Error> errors = new List<Error> ();
-
- public override IList<Error> Errors {
- get {
- return errors;
- }
- }
-
- public DefaultParsedDocument (string fileName) : base (fileName)
+ public void Add (FoldingRegion foldingRegion)
{
- Flags |= ParsedDocumentFlags.NonSerializable;
- }
-
- #region IUnresolvedFile implementation
- public override IUnresolvedTypeDefinition GetTopLevelTypeDefinition(TextLocation location)
- {
- return TopLevelTypeDefinitions.FirstOrDefault (t => t.Region.IsInside (location));
+ foldingRegions.Add (foldingRegion);
}
-
- public override IUnresolvedTypeDefinition GetInnermostTypeDefinition(TextLocation location)
+
+ public void AddRange (IEnumerable<FoldingRegion> foldingRegions)
{
- IUnresolvedTypeDefinition parent = null;
- var type = GetTopLevelTypeDefinition(location);
- while (type != null) {
- parent = type;
- type = parent.NestedTypes.FirstOrDefault (t => t.Region.IsInside (location));
- }
- return parent;
+ this.foldingRegions.AddRange (foldingRegions);
}
-
- public override IUnresolvedMember GetMember(TextLocation location)
+
+ public override Task<IReadOnlyList<FoldingRegion>> GetFoldingsAsync (CancellationToken cancellationToken = default(CancellationToken))
{
- var type = GetInnermostTypeDefinition(location);
- if (type == null)
- return null;
- return type.Members.FirstOrDefault (e => e.Region.IsInside(location));
- }
-
- List<IUnresolvedTypeDefinition> types = new List<IUnresolvedTypeDefinition> ();
- public override IList<IUnresolvedTypeDefinition> TopLevelTypeDefinitions {
- get {
- return types;
- }
- }
-
- List<IUnresolvedAttribute> attributes = new List<IUnresolvedAttribute> ();
- public IList<IUnresolvedAttribute> AssemblyAttributes {
- get {
- return attributes;
- }
+ return Task.FromResult<IReadOnlyList<FoldingRegion>> (foldingRegions);
}
- public IList<IUnresolvedAttribute> ModuleAttributes {
- get {
- return new List<IUnresolvedAttribute> ();
- }
- }
- #endregion
-
+ List<Error> errors = new List<Error> ();
+
public void Add (Error error)
{
errors.Add (error);
}
-
- public void Add (IEnumerable<Error> errors)
- {
- this.errors.AddRange (errors);
- }
-
- #region IUnresolvedFile implementation
- DateTime? IUnresolvedFile.LastWriteTime {
- get {
- return LastWriteTimeUtc;
- }
- set {
- LastWriteTimeUtc = value.HasValue ? value.Value : DateTime.UtcNow;
- }
- }
- #endregion
- }
-
- [Serializable]
- public class ParsedDocumentDecorator : ParsedDocument
- {
- IUnresolvedFile parsedFile;
-
- public override IUnresolvedFile ParsedFile {
- get { return parsedFile; }
- set { parsedFile = value; FileName = parsedFile.FileName; }
- }
-
- public override IList<Error> Errors {
- get {
- return parsedFile.Errors;
- }
- }
-
- public ParsedDocumentDecorator (IUnresolvedFile parsedFile) : base (parsedFile.FileName)
- {
- this.parsedFile = parsedFile;
- }
-
- public ParsedDocumentDecorator () : base ("")
- {
- }
-
- #region IUnresolvedFile implementation
- public override IUnresolvedTypeDefinition GetTopLevelTypeDefinition (TextLocation location)
- {
- return parsedFile.GetTopLevelTypeDefinition (location);
- }
- public override IUnresolvedTypeDefinition GetInnermostTypeDefinition (TextLocation location)
+ public void AddRange (IEnumerable<Error> errors)
{
- return parsedFile.GetInnermostTypeDefinition (location);
+ this.errors.AddRange (errors);
}
- public override IUnresolvedMember GetMember (TextLocation location)
+ public override Task<IReadOnlyList<Error>> GetErrorsAsync (CancellationToken cancellationToken = default(CancellationToken))
{
- return parsedFile.GetMember (location);
- }
-
- public override IList<IUnresolvedTypeDefinition> TopLevelTypeDefinitions {
- get {
- return parsedFile.TopLevelTypeDefinitions;
- }
+ return Task.FromResult<IReadOnlyList<Error>> (errors);
}
- #endregion
}
-
+
public static class FoldingUtilities
{
static bool IncompleteOrSingleLine (DomRegion region)
@@ -399,7 +203,7 @@ namespace MonoDevelop.Ide.TypeSystem
return region.BeginLine <= 0 || region.EndLine <= region.BeginLine;
}
- public static IEnumerable<FoldingRegion> ToFolds (this IList<Comment> comments)
+ public static IEnumerable<FoldingRegion> ToFolds (this IReadOnlyList<Comment> comments)
{
for (int i = 0; i < comments.Count; i++) {
Comment comment = comments [i];
@@ -449,7 +253,7 @@ namespace MonoDevelop.Ide.TypeSystem
curLine = curComment.Region.BeginLine;
}
- if (j - i > 1) {
+ if (j - i > 1 || (comment.IsDocumentation && comment.Region.BeginLine < comment.Region.EndLine)) {
string txt;
if (comment.IsDocumentation) {
txt = "/// ...";
@@ -483,7 +287,7 @@ namespace MonoDevelop.Ide.TypeSystem
}
yield return new FoldingRegion (txt,
- new DomRegion (comment.Region.Begin, end),
+ new DocumentRegion (comment.Region.Begin, end),
FoldType.Comment);
i = j - 1;
}
@@ -550,6 +354,23 @@ namespace MonoDevelop.Ide.TypeSystem
}
return false;
}
+
+ static bool IsInsideMember (this DocumentRegion region, IUnresolvedTypeDefinition cl)
+ {
+ if (region.IsEmpty || cl == null || !cl.BodyRegion.IsInside (region.Begin.Line, region.Begin.Column))
+ return false;
+ foreach (var member in cl.Members) {
+ if (member.BodyRegion.IsEmpty)
+ continue;
+ if (member.BodyRegion.IsInside (region.Begin.Line, region.Begin.Column) && member.BodyRegion.IsInside (region.End.Line, region.End.Column))
+ return true;
+ }
+ foreach (var inner in cl.NestedTypes) {
+ if (region.IsInsideMember (inner))
+ return true;
+ }
+ return false;
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ParsedFileEventArgs.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ParsedFileEventArgs.cs
deleted file mode 100644
index 50300be800..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ParsedFileEventArgs.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// ParsedFileEventArgs.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using ICSharpCode.NRefactory.TypeSystem;
-
-namespace MonoDevelop.Ide.TypeSystem
-{
- public class ParsedFileEventArgs : EventArgs
- {
- public IUnresolvedFile File {
- get;
- private set;
- }
-
- public ParsedFileEventArgs (IUnresolvedFile file)
- {
- this.File = file;
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/PreProcessorDefine.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/PreProcessorDefine.cs
deleted file mode 100644
index 45f3b48a2d..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/PreProcessorDefine.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-// PreProcessorDefine.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-//
-using System;
-using ICSharpCode.NRefactory;
-
-namespace MonoDevelop.Ide.TypeSystem
-{
- public class PreProcessorDefine
- {
- public string Define {
- get;
- set;
- }
-
- public TextLocation Location {
- get;
- set;
- }
-
- public PreProcessorDefine ()
- {
- }
-
- public PreProcessorDefine (string define, TextLocation location)
- {
- this.Define = define;
- this.Location = location;
- }
-
- public override string ToString ()
- {
- return string.Format ("[PreProcessorDefine: Define={0}, Location={1}]", Define, Location);
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ProjectCacheService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ProjectCacheService.cs
new file mode 100644
index 0000000000..2e2f9ef262
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ProjectCacheService.cs
@@ -0,0 +1,676 @@
+// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using Microsoft.CodeAnalysis.Host;
+using System.Collections.Generic;
+using Microsoft.CodeAnalysis;
+using System.Collections.Immutable;
+using System.Runtime.CompilerServices;
+using System.Diagnostics.Contracts;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Diagnostics.CodeAnalysis;
+using System.Reflection;
+using System.Diagnostics;
+using System.Collections;
+using System.Linq;
+namespace MonoDevelop.Ide.TypeSystem
+{
+/*
+ class ProjectCacheService : IProjectCacheHostService
+ {
+ internal const int ImplicitCacheSize = 3;
+
+ private readonly object _gate = new object ();
+
+ private readonly Workspace _workspace;
+ private readonly Dictionary<ProjectId, Cache> _activeCaches = new Dictionary<ProjectId, Cache> ();
+
+ private readonly SimpleMRUCache _implicitCache = new SimpleMRUCache ();
+ private readonly ImplicitCacheMonitor _implicitCacheMonitor;
+
+ public ProjectCacheService (Workspace workspace, int implicitCacheTimeout, bool forceCleanup = false)
+ {
+ _workspace = workspace;
+
+ // forceCleanup is for testing
+ if (workspace?.Kind == WorkspaceKind.Host || forceCleanup) {
+ // monitor implicit cache for host
+ _implicitCacheMonitor = new ImplicitCacheMonitor (this, implicitCacheTimeout);
+ }
+ }
+
+ public bool IsImplicitCacheEmpty {
+ get {
+ lock (_gate) {
+ return _implicitCache.Empty;
+ }
+ }
+ }
+
+ public void ClearImplicitCache ()
+ {
+ lock (_gate) {
+ _implicitCache.Clear ();
+ }
+ }
+
+ public void ClearExpiredImplicitCache (DateTime expirationTime)
+ {
+ lock (_gate) {
+ _implicitCache.ClearExpiredItems (expirationTime);
+ }
+ }
+
+ public IDisposable EnableCaching (ProjectId key)
+ {
+ lock (_gate) {
+ Cache cache;
+ if (!_activeCaches.TryGetValue (key, out cache)) {
+ cache = new Cache (this, key);
+ _activeCaches.Add (key, cache);
+ }
+
+ cache.Count++;
+ return cache;
+ }
+ }
+
+ public T CacheObjectIfCachingEnabledForKey<T> (ProjectId key, object owner, T instance) where T : class
+ {
+ lock (_gate) {
+ Cache cache;
+ if (_activeCaches.TryGetValue (key, out cache)) {
+ cache.CreateStrongReference (owner, instance);
+ } else if (!PartOfP2PReferences (key)) {
+ _implicitCache.Touch (instance);
+ _implicitCacheMonitor?.Touch ();
+ }
+
+ return instance;
+ }
+ }
+
+ private bool PartOfP2PReferences (ProjectId key)
+ {
+ if (_activeCaches.Count == 0 || _workspace == null) {
+ return false;
+ }
+
+ var solution = _workspace.CurrentSolution;
+ var graph = solution.GetProjectDependencyGraph ();
+
+ foreach (var projectId in _activeCaches.Keys) {
+ // this should be cheap. graph is cached everytime project reference is updated.
+ var p2pReferences = (ImmutableHashSet<ProjectId>)graph.GetProjectsThatThisProjectTransitivelyDependsOn (projectId);
+ if (p2pReferences.Contains (key)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public T CacheObjectIfCachingEnabledForKey<T> (ProjectId key, ICachedObjectOwner owner, T instance) where T : class
+ {
+ lock (_gate) {
+ Cache cache;
+ if (owner.CachedObject == null && _activeCaches.TryGetValue (key, out cache)) {
+ owner.CachedObject = instance;
+ cache.CreateOwnerEntry (owner);
+ }
+
+ return instance;
+ }
+ }
+
+ private void DisableCaching (ProjectId key, Cache cache)
+ {
+ lock (_gate) {
+ cache.Count--;
+ if (cache.Count == 0) {
+ _activeCaches.Remove (key);
+ cache.FreeOwnerEntries ();
+ }
+ }
+ }
+
+ private class Cache : IDisposable
+ {
+ internal int Count;
+ private readonly ProjectCacheService _cacheService;
+ private readonly ProjectId _key;
+ private readonly ConditionalWeakTable<object, object> _cache = new ConditionalWeakTable<object, object> ();
+ private readonly List<WeakReference<ICachedObjectOwner>> _ownerObjects = new List<WeakReference<ICachedObjectOwner>> ();
+
+ public Cache (ProjectCacheService cacheService, ProjectId key)
+ {
+ _cacheService = cacheService;
+ _key = key;
+ }
+
+ public void Dispose ()
+ {
+ _cacheService.DisableCaching (_key, this);
+ }
+
+ internal void CreateStrongReference (object key, object instance)
+ {
+ object o;
+ if (!_cache.TryGetValue (key, out o)) {
+ _cache.Add (key, instance);
+ }
+ }
+
+ internal void CreateOwnerEntry (ICachedObjectOwner owner)
+ {
+ _ownerObjects.Add (new WeakReference<ICachedObjectOwner> (owner));
+ }
+
+ internal void FreeOwnerEntries ()
+ {
+ foreach (var entry in _ownerObjects) {
+ ICachedObjectOwner owner;
+ if (entry.TryGetTarget (out owner)) {
+ owner.CachedObject = null;
+ }
+ }
+ }
+ }
+
+ private class SimpleMRUCache
+ {
+ private const int CacheSize = 3;
+
+ private readonly Node[] nodes = new Node[CacheSize];
+
+ public bool Empty {
+ get {
+ for (var i = 0; i < nodes.Length; i++) {
+ if (nodes [i].Data != null) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ }
+
+ public void Touch (object instance)
+ {
+ var oldIndex = -1;
+ var oldTime = DateTime.UtcNow;
+
+ for (var i = 0; i < nodes.Length; i++) {
+ if (instance == nodes [i].Data) {
+ nodes [i].LastTouched = DateTime.UtcNow;
+ return;
+ }
+
+ if (oldTime >= nodes [i].LastTouched) {
+ oldTime = nodes [i].LastTouched;
+ oldIndex = i;
+ }
+ }
+
+ Contract.Requires (oldIndex >= 0);
+ nodes [oldIndex] = new Node (instance, DateTime.UtcNow);
+ }
+
+ public void ClearExpiredItems (DateTime expirationTime)
+ {
+ for (var i = 0; i < nodes.Length; i++) {
+ if (nodes [i].Data != null && nodes [i].LastTouched < expirationTime) {
+ nodes [i] = default(Node);
+ }
+ }
+ }
+
+ public void Clear ()
+ {
+ Array.Clear (nodes, 0, nodes.Length);
+ }
+
+ private struct Node
+ {
+ public readonly object Data;
+ public DateTime LastTouched;
+
+ public Node (object data, DateTime lastTouched)
+ {
+ Data = data;
+ LastTouched = lastTouched;
+ }
+ }
+ }
+
+ private class ImplicitCacheMonitor : IdleProcessor
+ {
+ private readonly ProjectCacheService _owner;
+ private readonly SemaphoreSlim _gate;
+
+ public ImplicitCacheMonitor (ProjectCacheService owner, int backOffTimeSpanInMS) :
+ base (//AggregateAsynchronousOperationListener.CreateEmptyListener(),
+ backOffTimeSpanInMS,
+ CancellationToken.None)
+ {
+ _owner = owner;
+ _gate = new SemaphoreSlim (0);
+
+ Start ();
+ }
+
+ protected override Task ExecuteAsync ()
+ {
+ _owner.ClearExpiredImplicitCache (DateTime.UtcNow - TimeSpan.FromMilliseconds (BackOffTimeSpanInMS));
+
+ return SpecializedTasks.EmptyTask;
+ }
+
+ public void Touch ()
+ {
+ UpdateLastAccessTime ();
+
+ if (_gate.CurrentCount == 0) {
+ _gate.Release ();
+ }
+ }
+
+ protected override Task WaitAsync (CancellationToken cancellationToken)
+ {
+ if (_owner.IsImplicitCacheEmpty) {
+ return _gate.WaitAsync (cancellationToken);
+ }
+
+ return SpecializedTasks.EmptyTask;
+ }
+ }
+ }
+
+ internal abstract class IdleProcessor
+ {
+ private const int MinimumDelayInMS = 50;
+
+ // protected readonly IAsynchronousOperationListener Listener;
+ protected readonly CancellationToken CancellationToken;
+ protected readonly int BackOffTimeSpanInMS;
+
+ // points to processor task
+ private Task _processorTask;
+
+ // there is one thread that writes to it and one thread reads from it
+ private int _lastAccessTimeInMS;
+
+ public IdleProcessor (
+// IAsynchronousOperationListener listener,
+ int backOffTimeSpanInMS,
+ CancellationToken cancellationToken)
+ {
+// this.Listener = listener;
+ this.CancellationToken = cancellationToken;
+
+ BackOffTimeSpanInMS = backOffTimeSpanInMS;
+ _lastAccessTimeInMS = Environment.TickCount;
+ }
+
+ protected abstract Task WaitAsync (CancellationToken cancellationToken);
+
+ protected abstract Task ExecuteAsync ();
+
+ protected void Start ()
+ {
+ if (_processorTask == null) {
+ _processorTask = Task.Factory.SafeStartNewFromAsync (ProcessAsync, this.CancellationToken, TaskScheduler.Default);
+ }
+ }
+
+ protected void UpdateLastAccessTime ()
+ {
+ _lastAccessTimeInMS = Environment.TickCount;
+ }
+
+ protected async Task WaitForIdleAsync ()
+ {
+ while (true) {
+ if (this.CancellationToken.IsCancellationRequested) {
+ return;
+ }
+
+ var diffInMS = Environment.TickCount - _lastAccessTimeInMS;
+ if (diffInMS >= BackOffTimeSpanInMS) {
+ return;
+ }
+
+ // TODO: will safestart/unwarp capture cancellation exception?
+ var timeLeft = BackOffTimeSpanInMS - diffInMS;
+ await Task.Delay (Math.Max (MinimumDelayInMS, timeLeft), this.CancellationToken).ConfigureAwait (continueOnCapturedContext: false);
+ }
+ }
+
+ private async Task ProcessAsync ()
+ {
+ while (true) {
+ try {
+ if (this.CancellationToken.IsCancellationRequested) {
+ return;
+ }
+
+ // wait for next item available
+ await WaitAsync (this.CancellationToken).ConfigureAwait (continueOnCapturedContext: false);
+
+// using (this.Listener.BeginAsyncOperation("ProcessAsync"))
+// {
+ // we have items but workspace is busy. wait for idle.
+ await WaitForIdleAsync ().ConfigureAwait (continueOnCapturedContext: false);
+
+ await ExecuteAsync ().ConfigureAwait (continueOnCapturedContext: false);
+// }
+ } catch (OperationCanceledException) {
+ // ignore cancellation exception
+ }
+ }
+ }
+
+ public virtual Task AsyncProcessorTask {
+ get {
+ if (_processorTask == null) {
+ return SpecializedTasks.EmptyTask;
+ }
+
+ return _processorTask;
+ }
+ }
+ }
+*/
+ internal static class SpecializedTasks
+ {
+ public static readonly Task<bool> True = Task.FromResult<bool> (true);
+ public static readonly Task<bool> False = Task.FromResult<bool> (false);
+ public static readonly Task EmptyTask = Empty<object>.Default;
+
+ public static Task<T> Default<T> ()
+ {
+ return Empty<T>.Default;
+ }
+
+ public static Task<ImmutableArray<T>> EmptyImmutableArray<T> ()
+ {
+ return Empty<T>.EmptyImmutableArray;
+ }
+
+ public static Task<T> FromResult<T> (T t) where T : class
+ {
+ return FromResultCache<T>.FromResult (t);
+ }
+
+
+ public static Task<IEnumerable<T>> EmptyEnumerable<T>()
+ {
+ return Empty<T>.EmptyEnumerable;
+ }
+
+ private static class Empty<T>
+ {
+ public static readonly Task<T> Default = Task.FromResult<T> (default(T));
+ public static readonly Task<ImmutableArray<T>> EmptyImmutableArray = Task.FromResult (ImmutableArray<T>.Empty);
+ public static readonly Task<IEnumerable<T>> EmptyEnumerable = Task.FromResult<IEnumerable<T>>(Enumerable.Empty<T> ());
+ }
+
+ private static class FromResultCache<T> where T : class
+ {
+ private static readonly ConditionalWeakTable<T, Task<T>> s_fromResultCache = new ConditionalWeakTable<T, Task<T>> ();
+ private static readonly ConditionalWeakTable<T, Task<T>>.CreateValueCallback s_taskCreationCallback = Task.FromResult<T>;
+
+ public static Task<T> FromResult (T t)
+ {
+ return s_fromResultCache.GetValue (t, s_taskCreationCallback);
+ }
+ }
+ }
+
+ [SuppressMessage ("ApiDesign", "RS0011", Justification = "Matching TPL Signatures")]
+ internal static partial class TaskFactoryExtensions
+ {
+ public static Task SafeStartNew (this TaskFactory factory, Action action, CancellationToken cancellationToken, TaskScheduler scheduler)
+ {
+ return factory.SafeStartNew (action, cancellationToken, TaskCreationOptions.None, scheduler);
+ }
+
+ public static Task SafeStartNew (
+ this TaskFactory factory,
+ Action action,
+ CancellationToken cancellationToken,
+ TaskCreationOptions creationOptions,
+ TaskScheduler scheduler)
+ {
+ Action wrapped = () => {
+ try {
+ action ();
+ } catch (Exception) {
+ throw new InvalidOperationException ("This program location is thought to be unreachable.");
+ }
+ };
+
+ // The one and only place we can call StartNew().
+ return factory.StartNew (wrapped, cancellationToken, creationOptions, scheduler);
+ }
+
+ public static Task<TResult> SafeStartNew<TResult> (this TaskFactory factory, Func<TResult> func, CancellationToken cancellationToken, TaskScheduler scheduler)
+ {
+ return factory.SafeStartNew (func, cancellationToken, TaskCreationOptions.None, scheduler);
+ }
+
+ public static Task<TResult> SafeStartNew<TResult> (
+ this TaskFactory factory,
+ Func<TResult> func,
+ CancellationToken cancellationToken,
+ TaskCreationOptions creationOptions,
+ TaskScheduler scheduler)
+ {
+ Func<TResult> wrapped = () => {
+ try {
+ return func ();
+ } catch (Exception) {
+ throw new InvalidOperationException ("This program location is thought to be unreachable.");
+ }
+ };
+
+ // The one and only place we can call StartNew<>().
+ return factory.StartNew (wrapped, cancellationToken, creationOptions, scheduler);
+ }
+
+ public static Task SafeStartNewFromAsync (this TaskFactory factory, Func<Task> actionAsync, CancellationToken cancellationToken, TaskScheduler scheduler)
+ {
+ return factory.SafeStartNewFromAsync (actionAsync, cancellationToken, TaskCreationOptions.None, scheduler);
+ }
+
+ public static Task SafeStartNewFromAsync (
+ this TaskFactory factory,
+ Func<Task> actionAsync,
+ CancellationToken cancellationToken,
+ TaskCreationOptions creationOptions,
+ TaskScheduler scheduler)
+ {
+ // The one and only place we can call StartNew<>().
+ var task = factory.StartNew (actionAsync, cancellationToken, creationOptions, scheduler).Unwrap ();
+ ReportFatalError (task, actionAsync);
+ return task;
+ }
+
+ public static Task<TResult> SafeStartNewFromAsync<TResult> (this TaskFactory factory, Func<Task<TResult>> funcAsync, CancellationToken cancellationToken, TaskScheduler scheduler)
+ {
+ return factory.SafeStartNewFromAsync (funcAsync, cancellationToken, TaskCreationOptions.None, scheduler);
+ }
+
+ public static Task<TResult> SafeStartNewFromAsync<TResult> (
+ this TaskFactory factory,
+ Func<Task<TResult>> funcAsync,
+ CancellationToken cancellationToken,
+ TaskCreationOptions creationOptions,
+ TaskScheduler scheduler)
+ {
+ // The one and only place we can call StartNew<>().
+ var task = factory.StartNew (funcAsync, cancellationToken, creationOptions, scheduler).Unwrap ();
+ ReportFatalError (task, funcAsync);
+ return task;
+ }
+
+ internal static void ReportFatalError (Task task, object continuationFunction)
+ {
+ task.ContinueWith (ReportFatalErrorWorker, continuationFunction,
+ CancellationToken.None,
+ TaskContinuationOptions.OnlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously,
+ TaskScheduler.Default);
+ }
+
+ [MethodImpl (MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)]
+ private static void ReportFatalErrorWorker (Task task, object continuationFunction)
+ {
+ var exception = task.Exception;
+ var methodInfo = ((Delegate)continuationFunction).GetMethodInfo ();
+ exception.Data ["ContinuationFunction"] = methodInfo.DeclaringType.FullName + "::" + methodInfo.Name;
+
+ // In case of a crash with ExecutionEngineException w/o call stack it might be possible to get the stack trace using WinDbg:
+ // > !threads // find thread with System.ExecutionEngineException
+ // ...
+ // 67 65 4760 692b5d60 1029220 Preemptive CD9AE70C:FFFFFFFF 012ad0f8 0 MTA (Threadpool Worker) System.ExecutionEngineException 03c51108
+ // ...
+ // > ~67s // switch to thread 67
+ // > !dso // dump stack objects
+ FatalError.Report (exception);
+ }
+ }
+
+ internal static class FatalError
+ {
+ private static Action<Exception> s_fatalHandler;
+ private static Action<Exception> s_nonFatalHandler;
+
+ //private static Exception s_reportedException;
+ //private static string s_reportedExceptionMessage;
+
+ /// <summary>
+ /// Set by the host to a fail fast trigger,
+ /// if the host desires to crash the process on a fatal exception.
+ /// </summary>
+ public static Action<Exception> Handler {
+ get {
+ return s_fatalHandler;
+ }
+
+ set {
+ if (s_fatalHandler != value) {
+ Debug.Assert (s_fatalHandler == null, "Handler already set");
+ s_fatalHandler = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Set by the host to a fail fast trigger,
+ /// if the host desires to NOT crash the process on a non fatal exception.
+ /// </summary>
+ public static Action<Exception> NonFatalHandler {
+ get {
+ return s_nonFatalHandler;
+ }
+
+ set {
+ if (s_nonFatalHandler != value) {
+ Debug.Assert (s_nonFatalHandler == null, "Handler already set");
+ s_nonFatalHandler = value;
+ }
+ }
+ }
+
+ // Same as setting the Handler property except that it avoids the assert. This is useful in
+ // test code which needs to verify the handler is called in specific cases and will continually
+ // overwrite this value.
+ public static void OverwriteHandler (Action<Exception> value)
+ {
+ s_fatalHandler = value;
+ }
+
+ /// <summary>
+ /// Use in an exception filter to report a fatal error.
+ /// Unless the exception is <see cref="OperationCanceledException"/>
+ /// it calls <see cref="Handler"/>. The exception is passed through (the method returns false).
+ /// </summary>
+ /// <returns>False to avoid catching the exception.</returns>
+ [DebuggerHidden]
+ public static bool ReportUnlessCanceled (Exception exception)
+ {
+ if (exception is OperationCanceledException) {
+ return false;
+ }
+
+ return Report (exception);
+ }
+
+ /// <summary>
+ /// Use in an exception filter to report a non fatal error.
+ /// Unless the exception is <see cref="OperationCanceledException"/>
+ /// it calls <see cref="NonFatalHandler"/>. The exception isn't passed through (the method returns true).
+ /// </summary>
+ /// <returns>True to catch the exception.</returns>
+ [DebuggerHidden]
+ public static bool ReportWithoutCrashUnlessCanceled (Exception exception)
+ {
+ if (exception is OperationCanceledException) {
+ return false;
+ }
+
+ return ReportWithoutCrash (exception);
+ }
+
+ /// <summary>
+ /// Use in an exception filter to report a fatal error.
+ /// Unless the exception is <see cref="NotImplementedException"/>
+ /// it calls <see cref="Handler"/>. The exception is passed through (the method returns false).
+ /// </summary>
+ /// <returns>False to avoid catching the exception.</returns>
+ [DebuggerHidden]
+ public static bool ReportUnlessNotImplemented (Exception exception)
+ {
+ if (exception is NotImplementedException) {
+ return false;
+ }
+
+ return Report (exception);
+ }
+
+ /// <summary>
+ /// Use in an exception filter to report a fatal error.
+ /// Calls <see cref="Handler"/> and passes the exception through (the method returns false).
+ /// </summary>
+ /// <returns>False to avoid catching the exception.</returns>
+ [DebuggerHidden]
+ public static bool Report (Exception exception)
+ {
+ Report (exception, s_fatalHandler);
+ return false;
+ }
+
+ /// <summary>
+ /// Use in an exception filter to report a non fatal error.
+ /// Calls <see cref="NonFatalHandler"/> and doesn't pass the exception through (the method returns true).
+ /// </summary>
+ /// <returns>True to catch the exception.</returns>
+ [DebuggerHidden]
+ public static bool ReportWithoutCrash (Exception exception)
+ {
+ Report (exception, s_nonFatalHandler);
+ return true;
+ }
+
+ private static void Report (Exception exception, Action<Exception> handler)
+ {
+ // hold onto last exception to make investigation easier
+ //s_reportedException = exception;
+ //s_reportedExceptionMessage = exception.ToString ();
+
+ handler?.Invoke (exception);
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ProjectCommentTags.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ProjectCommentTags.cs
deleted file mode 100644
index c2b33ee0b0..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ProjectCommentTags.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// ProjectCommentTags.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-using System.Collections.Concurrent;
-using MonoDevelop.Projects;
-using MonoDevelop.Ide.Tasks;
-
-namespace MonoDevelop.Ide.TypeSystem
-{
- [Serializable]
- public class ProjectCommentTags
- {
- readonly Dictionary<string, List<Tag>> tags = new Dictionary<string, List<Tag>> ();
-
- public IDictionary<string, List<Tag>> Tags {
- get {
- return tags;
- }
- }
-
- public void UpdateTags (Project project, string fileName, IList<Tag> tagComments)
- {
- var list = tagComments == null || tagComments.Count == 0 ? null : new List<Tag> (tagComments);
- lock (tags) {
- List<Tag> oldList;
- tags.TryGetValue (fileName, out oldList);
- if (list == null && oldList == null)
- return;
- tags[fileName] = list;
- TaskService.InformCommentTasks (new CommentTasksChangedEventArgs (fileName, tagComments, project));
- }
- }
-
- public void RemoveFile (Project project, string fileName)
- {
- lock (tags) {
- if (!tags.ContainsKey (fileName))
- return;
- tags[fileName] = null;
- }
-
- TaskService.InformCommentTasks (new CommentTasksChangedEventArgs (fileName, null, project));
- }
-
- internal void Update (Project project)
- {
- foreach (var file in project.Files) {
- if (file.BuildAction == BuildAction.None)
- continue;
- TypeSystemService.ParseFile (project, file.FilePath);
- }
- }
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ProjectContentEventArgs.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ProjectContentEventArgs.cs
deleted file mode 100644
index 54d31aa138..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ProjectContentEventArgs.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// ProjectContentEventArgs.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2011 Mike Krüger <mkrueger@novell.com>
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using ICSharpCode.NRefactory.TypeSystem;
-using MonoDevelop.Projects;
-
-namespace MonoDevelop.Ide.TypeSystem
-{
- [Serializable]
- public sealed class ProjectContentEventArgs : EventArgs
- {
- public Project Project {
- get;
- private set;
- }
-
- public IProjectContent Content {
- get;
- private set;
- }
-
- public ProjectContentEventArgs (Project project, IProjectContent content)
- {
- this.Project = project;
- this.Content = content;
- }
- }
-}
-
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/SolutionSizeTracker.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/SolutionSizeTracker.cs
new file mode 100644
index 0000000000..c94d1decb3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/SolutionSizeTracker.cs
@@ -0,0 +1,91 @@
+//
+// SolutionSizeTracker.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.IO;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.CodeAnalysis;
+
+namespace MonoDevelop.Ide.TypeSystem
+{
+ sealed class SolutionSizeTracker
+ {
+ public static async Task<long> GetSolutionSizeAsync (Workspace workspace, SolutionId id, CancellationToken cancellationToken)
+ {
+ long result = 0;
+ foreach (var project in workspace.CurrentSolution.Projects) {
+ result += await GetProjectSizeAsync (project, cancellationToken);
+ }
+ return result;
+ }
+
+ static async Task<long> GetProjectSizeAsync (Project project, CancellationToken cancellationToken)
+ {
+ if (project == null)
+ return 0;
+
+ var sum = 0L;
+ foreach (var document in project.Documents)
+ sum += await GetDocumentSizeAsync (document, cancellationToken).ConfigureAwait (false);
+
+ return sum;
+ }
+
+ static async Task<long> GetDocumentSizeAsync (Document document, CancellationToken cancellationToken)
+ {
+ cancellationToken.ThrowIfCancellationRequested ();
+
+ if (document == null)
+ return 0;
+
+ var result = GetFileSize (document.FilePath);
+ if (result >= 0) {
+ return result;
+ }
+
+ // not a physical file, in that case, use text as a fallback.
+ var text = await document.GetTextAsync (CancellationToken.None).ConfigureAwait (false);
+ return text.Length;
+ }
+
+ static long GetFileSize (string filepath)
+ {
+ if (filepath == null)
+ return -1;
+
+ try {
+ // just to reduce exception thrown
+ if (!File.Exists (filepath)) {
+ return -1;
+ }
+
+ return new FileInfo (filepath).Length;
+ } catch {
+ return -1;
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/StockIcons.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/StockIcons.cs
index bd7eea162b..5ff022e63d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/StockIcons.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/StockIcons.cs
@@ -25,246 +25,117 @@
// THE SOFTWARE.
using System;
using MonoDevelop.Core;
-using ICSharpCode.NRefactory.TypeSystem;
using Mono.Cecil;
+using Microsoft.CodeAnalysis;
namespace MonoDevelop.Ide.TypeSystem
{
public static class Stock
{
- static readonly IconId Class = "md-class";
- static readonly IconId Enum = "md-enum";
- static readonly IconId Event = "md-event";
- static readonly IconId Field = "md-field";
- static readonly IconId Interface = "md-interface";
- static readonly IconId Method = "md-method";
- static readonly IconId ExtensionMethod = "md-extensionmethod";
- static readonly IconId Property = "md-property";
- static readonly IconId Struct = "md-struct";
- static readonly IconId Delegate = "md-delegate";
public static readonly IconId Namespace = "md-name-space";
- static readonly IconId InternalClass = "md-internal-class";
- static readonly IconId InternalDelegate = "md-internal-delegate";
- static readonly IconId InternalEnum = "md-internal-enum";
- static readonly IconId InternalEvent = "md-internal-event";
- static readonly IconId InternalField = "md-internal-field";
- static readonly IconId InternalInterface = "md-internal-interface";
- static readonly IconId InternalMethod = "md-internal-method";
- static readonly IconId InternalExtensionMethod = "md-internal-extensionmethod";
- static readonly IconId InternalProperty = "md-internal-property";
- static readonly IconId InternalStruct = "md-internal-struct";
-
- static readonly IconId InternalAndProtectedClass = "md-InternalAndProtected-class";
- static readonly IconId InternalAndProtectedDelegate = "md-InternalAndProtected-delegate";
- static readonly IconId InternalAndProtectedEnum = "md-InternalAndProtected-enum";
- static readonly IconId InternalAndProtectedEvent = "md-InternalAndProtected-event";
- static readonly IconId InternalAndProtectedField = "md-InternalAndProtected-field";
- static readonly IconId InternalAndProtectedInterface = "md-InternalAndProtected-interface";
- static readonly IconId InternalAndProtectedMethod = "md-InternalAndProtected-method";
- static readonly IconId InternalAndProtectedExtensionMethod = "md-InternalAndProtected-extensionmethod";
- static readonly IconId InternalAndProtectedProperty = "md-InternalAndProtected-property";
- static readonly IconId InternalAndProtectedStruct = "md-InternalAndProtected-struct";
-
- static readonly IconId PrivateClass = "md-private-class";
- static readonly IconId PrivateDelegate = "md-private-delegate";
- static readonly IconId PrivateEnum = "md-private-enum";
- static readonly IconId PrivateEvent = "md-private-event";
- static readonly IconId PrivateField = "md-private-field";
- static readonly IconId PrivateInterface = "md-private-interface";
- static readonly IconId PrivateMethod = "md-private-method";
- static readonly IconId PrivateExtensionMethod = "md-private-extensionmethod";
- static readonly IconId PrivateProperty = "md-private-property";
- static readonly IconId PrivateStruct = "md-private-struct";
-
- static readonly IconId ProtectedClass = "md-protected-class";
- static readonly IconId ProtectedDelegate = "md-protected-delegate";
- static readonly IconId ProtectedEnum = "md-protected-enum";
- static readonly IconId ProtectedEvent = "md-protected-event";
- static readonly IconId ProtectedField = "md-protected-field";
- static readonly IconId ProtectedInterface = "md-protected-interface";
- static readonly IconId ProtectedMethod = "md-protected-method";
- static readonly IconId ProtectedExtensionMethod = "md-protected-extensionmethod";
- static readonly IconId ProtectedProperty = "md-protected-property";
- static readonly IconId ProtectedStruct = "md-protected-struct";
-
- static readonly IconId ProtectedOrInternalClass = "md-ProtectedOrInternal-class";
- static readonly IconId ProtectedOrInternalDelegate = "md-ProtectedOrInternal-delegate";
- static readonly IconId ProtectedOrInternalEnum = "md-ProtectedOrInternal-enum";
- static readonly IconId ProtectedOrInternalEvent = "md-ProtectedOrInternal-event";
- static readonly IconId ProtectedOrInternalField = "md-ProtectedOrInternal-field";
- static readonly IconId ProtectedOrInternalInterface = "md-ProtectedOrInternal-interface";
- static readonly IconId ProtectedOrInternalMethod = "md-ProtectedOrInternal-method";
- static readonly IconId ProtectedOrInternalExtensionMethod = "md-ProtectedOrInternal-extensionmethod";
- static readonly IconId ProtectedOrInternalProperty = "md-ProtectedOrInternal-property";
- static readonly IconId ProtectedOrInternalStruct = "md-ProtectedOrInternal-struct";
-
- static IconId[,] typeIconTable = new IconId[,] {
- {Class, PrivateClass, Class, ProtectedClass, InternalClass, ProtectedOrInternalClass, InternalAndProtectedClass}, // class
- {Enum, PrivateEnum, Enum, ProtectedEnum, InternalEnum, ProtectedOrInternalEnum, InternalAndProtectedEnum}, // enum
- {Interface, PrivateInterface, Interface, ProtectedInterface, InternalInterface, ProtectedOrInternalInterface, InternalAndProtectedInterface}, // interface
- {Struct, PrivateStruct, Struct, ProtectedStruct, InternalStruct, ProtectedOrInternalStruct, InternalAndProtectedStruct}, // struct
- {Delegate, PrivateDelegate, Delegate, ProtectedDelegate, InternalDelegate, ProtectedOrInternalDelegate, InternalAndProtectedDelegate} // delegate
- };
- static readonly IconId[] fieldIconTable = {
- Stock.Field, Stock.PrivateField, Stock.Field, Stock.ProtectedField, Stock.InternalField, Stock.ProtectedOrInternalField, Stock.InternalAndProtectedField
- };
- static readonly IconId[] methodIconTable = {
- Stock.Method, Stock.PrivateMethod, Stock.Method, Stock.ProtectedMethod, Stock.InternalMethod, Stock.ProtectedOrInternalMethod, Stock.InternalAndProtectedMethod
- };
- static readonly IconId[] extensionMethodIconTable = {
- Stock.ExtensionMethod, Stock.PrivateExtensionMethod, Stock.ExtensionMethod, Stock.ProtectedExtensionMethod, Stock.InternalExtensionMethod, Stock.ProtectedOrInternalExtensionMethod, Stock.InternalAndProtectedExtensionMethod
- };
- static readonly IconId[] propertyIconTable = {
- Stock.Property, Stock.PrivateProperty, Stock.Property, Stock.ProtectedProperty, Stock.InternalProperty, Stock.ProtectedOrInternalProperty, Stock.InternalAndProtectedProperty
- };
- static readonly IconId[] eventIconTable = {
- Stock.Event, Stock.PrivateEvent, Stock.Event, Stock.ProtectedEvent, Stock.InternalEvent, Stock.ProtectedOrInternalEvent, Stock.InternalAndProtectedEvent
- };
-
- public static string GetStockIcon (this INamedElement element)
- {
- if (element is IType)
- return ((IType)element).GetStockIcon ();
- if (element is ITypeParameter)
- return ((ITypeParameter)element).GetStockIcon ();
- if (element is IUnresolvedEntity)
- return ((IUnresolvedEntity)element).GetStockIcon ();
- return ((IEntity)element).GetStockIcon ();
- }
-
- public static string GetStockIcon (this ITypeDefinition entity)
+ public static IconId GetStockIcon (this Microsoft.CodeAnalysis.ISymbol symbol)
{
- return GetStockIcon ((IType)entity);
+ return "md-" + GetAccess (symbol.DeclaredAccessibility) + GetGlobal (symbol) + GetSource (symbol);
}
-
- public static string GetStockIcon (this IType entity)
+
+ internal static string GetAccess (Accessibility accessibility)
{
- var def = entity.GetDefinition ();
- if (def == null)
- return Class;
- switch (def.Kind) {
- case TypeKind.Class:
- return typeIconTable [0, (int)def.Accessibility];
- case TypeKind.Enum:
- return typeIconTable [1, (int)def.Accessibility];
- case TypeKind.Interface:
- return typeIconTable [2, (int)def.Accessibility];
- case TypeKind.Struct:
- return typeIconTable [3, (int)def.Accessibility];
- case TypeKind.Delegate:
- return typeIconTable [4, (int)def.Accessibility];
+ switch (accessibility) {
+ case Microsoft.CodeAnalysis.Accessibility.NotApplicable:
+ return "";
+ case Microsoft.CodeAnalysis.Accessibility.Private:
+ return "private-";
+ case Microsoft.CodeAnalysis.Accessibility.ProtectedAndInternal:
+ return "ProtectedOrInternal-";
+ case Microsoft.CodeAnalysis.Accessibility.Protected:
+ return "protected-";
+ case Microsoft.CodeAnalysis.Accessibility.Internal:
+ return "internal-";
+ case Microsoft.CodeAnalysis.Accessibility.ProtectedOrInternal:
+ return "ProtectedOrInternal-";
+ case Microsoft.CodeAnalysis.Accessibility.Public:
+ return "";
default:
- return typeIconTable [0, (int)def.Accessibility];
- }
+ throw new ArgumentOutOfRangeException ();
+ }
}
-
- public static string GetStockIcon (this IUnresolvedTypeDefinition def)
+
+ static string GetGlobal (ISymbol symbol)
{
- switch (def.Kind) {
- case TypeKind.Class:
- return typeIconTable [0, (int)def.Accessibility];
- case TypeKind.Enum:
- return typeIconTable [1, (int)def.Accessibility];
- case TypeKind.Interface:
- return typeIconTable [2, (int)def.Accessibility];
- case TypeKind.Struct:
- return typeIconTable [3, (int)def.Accessibility];
- case TypeKind.Delegate:
- return typeIconTable [4, (int)def.Accessibility];
+ switch (symbol.Kind) {
+ case Microsoft.CodeAnalysis.SymbolKind.NamedType:
+ return "";
+ case Microsoft.CodeAnalysis.SymbolKind.Field:
+ var field = (IFieldSymbol)symbol;
+ if (field.IsConst)
+ return "";
+ return symbol.IsStatic ? "static-" : "";
+ case Microsoft.CodeAnalysis.SymbolKind.Event:
+ case Microsoft.CodeAnalysis.SymbolKind.Method:
+ case Microsoft.CodeAnalysis.SymbolKind.Property:
+ return symbol.IsStatic ? "static-" : "";
default:
- return typeIconTable [0, (int)def.Accessibility];
+ return "";
}
}
-
- public static string GetStockIcon (this IField field)
- {
- return GetStockIcon ((IEntity)field);
- }
-
- public static string GetStockIcon (this IVariable variable)
- {
- return Field;
- }
-
- public static string GetStockIcon (this IParameter parameter)
- {
- return Field;
- }
-
- public static string GetStockIcon (this IUnresolvedTypeParameter parameter)
- {
- return Field;
- }
-
- public static string GetStockIcon (this IEntity entity, bool showAccessibility = true)
+
+ static string GetSource(Microsoft.CodeAnalysis.ISymbol symbol)
{
- switch (entity.SymbolKind) {
- case SymbolKind.TypeDefinition:
- return GetStockIcon ((IType)entity);
- case SymbolKind.Field:
- if (showAccessibility)
- return fieldIconTable [(int)entity.Accessibility];
- else
- return fieldIconTable [0];
- case SymbolKind.Method:
- case SymbolKind.Constructor:
- case SymbolKind.Destructor:
- case SymbolKind.Operator:
- if (showAccessibility) {
- if (((IMethod)entity).IsExtensionMethod)
- return extensionMethodIconTable [(int)entity.Accessibility];
- return methodIconTable [(int)entity.Accessibility];
- } else {
- if (((IMethod)entity).IsExtensionMethod)
- return extensionMethodIconTable [0];
- return methodIconTable [0];
+ switch (symbol.Kind) {
+ case Microsoft.CodeAnalysis.SymbolKind.Alias:
+ case Microsoft.CodeAnalysis.SymbolKind.ArrayType:
+ case Microsoft.CodeAnalysis.SymbolKind.Assembly:
+ case Microsoft.CodeAnalysis.SymbolKind.DynamicType:
+ case Microsoft.CodeAnalysis.SymbolKind.ErrorType:
+ case Microsoft.CodeAnalysis.SymbolKind.Label:
+
+ case Microsoft.CodeAnalysis.SymbolKind.NetModule:
+ case Microsoft.CodeAnalysis.SymbolKind.PointerType:
+ case Microsoft.CodeAnalysis.SymbolKind.RangeVariable:
+ case Microsoft.CodeAnalysis.SymbolKind.TypeParameter:
+ case Microsoft.CodeAnalysis.SymbolKind.Preprocessing:
+ return "field";
+ case Microsoft.CodeAnalysis.SymbolKind.Parameter:
+ return "variable";
+ case Microsoft.CodeAnalysis.SymbolKind.Field:
+ var field = (IFieldSymbol)symbol;
+ if (field.IsConst)
+ return "literal";
+ return "field";
+ case Microsoft.CodeAnalysis.SymbolKind.Local:
+ var local = (ILocalSymbol)symbol;
+ if (local.IsConst)
+ return "literal";
+ return "variable";
+ case Microsoft.CodeAnalysis.SymbolKind.NamedType:
+ var namedTypeSymbol = (Microsoft.CodeAnalysis.INamedTypeSymbol)symbol;
+ switch (namedTypeSymbol.TypeKind) {
+ case Microsoft.CodeAnalysis.TypeKind.Class:
+ return "class";
+ case Microsoft.CodeAnalysis.TypeKind.Delegate:
+ return "delegate";
+ case Microsoft.CodeAnalysis.TypeKind.Enum:
+ return "enum";
+ case Microsoft.CodeAnalysis.TypeKind.Interface:
+ return "interface";
+ case Microsoft.CodeAnalysis.TypeKind.Struct:
+ return "struct";
+ default:
+ return "class";
}
- case SymbolKind.Property:
- case SymbolKind.Indexer:
- if (showAccessibility)
- return propertyIconTable [(int)entity.Accessibility];
- else
- return propertyIconTable [0];
- case SymbolKind.Event:
- if (showAccessibility)
- return eventIconTable [(int)entity.Accessibility];
- else
- return eventIconTable [0];
- }
- return "";
- }
- public static string GetStockIcon (this IUnresolvedEntity entity, bool showAccessibility = true)
- {
- switch (entity.SymbolKind) {
- case SymbolKind.TypeDefinition:
- return GetStockIcon ((IUnresolvedTypeDefinition)entity);
- case SymbolKind.Field:
- if (showAccessibility)
- return fieldIconTable [(int)entity.Accessibility];
- else
- return fieldIconTable [0];
- case SymbolKind.Method:
- case SymbolKind.Constructor:
- case SymbolKind.Destructor:
- case SymbolKind.Operator:
- if (showAccessibility)
- return methodIconTable [(int)entity.Accessibility];
- else
- return methodIconTable [0];
- case SymbolKind.Property:
- case SymbolKind.Indexer:
- if (showAccessibility)
- return propertyIconTable [(int)entity.Accessibility];
- else
- return propertyIconTable [0];
- case SymbolKind.Event:
- if (showAccessibility)
- return eventIconTable [(int)entity.Accessibility];
- else
- return eventIconTable [0];
+
+ case Microsoft.CodeAnalysis.SymbolKind.Method:
+ return "method";
+ case Microsoft.CodeAnalysis.SymbolKind.Namespace:
+ return "name-space";
+ case Microsoft.CodeAnalysis.SymbolKind.Property:
+ return "property";
+ case Microsoft.CodeAnalysis.SymbolKind.Event:
+ return "event";
+ default:
+ throw new ArgumentOutOfRangeException ();
}
- return "";
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/Tag.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/Tag.cs
index f45231144b..9f6924a2d0 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/Tag.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/Tag.cs
@@ -51,7 +51,8 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
-using ICSharpCode.NRefactory.TypeSystem;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
namespace MonoDevelop.Ide.TypeSystem
{
@@ -66,16 +67,16 @@ namespace MonoDevelop.Ide.TypeSystem
}
}
- public Tag (string key, DomRegion region)
+ public Tag (string key, DocumentRegion region)
{
this.key = key;
base.Region = region;
}
-
- public Tag (string key, string comment, DomRegion region) : base (comment)
+
+ public Tag (string key, string comment, DocumentRegion region) : base (comment)
{
this.key = key;
base.Region = region;
}
}
-}
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemOutputTrackingNode.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemOutputTrackingNode.cs
new file mode 100644
index 0000000000..0ea3b3bc31
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemOutputTrackingNode.cs
@@ -0,0 +1,61 @@
+//
+// TypeSystemOutputTrackingNode.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Mono.Addins;
+using System.Collections.Generic;
+using System.Linq;
+using MonoDevelop.Core.StringParsing;
+
+namespace MonoDevelop.Ide.TypeSystem
+{
+ class TypeSystemOutputTrackingNode : ExtensionNode
+ {
+ [NodeAttribute (Description="The project type.")]
+ string projectType;
+
+ public string ProjectType {
+ get {
+ return projectType;
+ }
+ set {
+ projectType = value;
+ }
+ }
+
+ [NodeAttribute (Description="The language name.")]
+ string languageName;
+
+ public string LanguageName {
+ get {
+ return languageName;
+ }
+ set {
+ languageName = value;
+ }
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemParser.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemParser.cs
index 7470e8c358..0211fc0e48 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemParser.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemParser.cs
@@ -27,9 +27,65 @@ using System;
using System.IO;
using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Projects;
+using MonoDevelop.Core.Text;
+using Microsoft.CodeAnalysis;
+using System.Threading.Tasks;
+using System.Threading;
+using MonoDevelop.Ide.Editor.Projection;
+using MonoDevelop.Ide.Editor;
+using System.Collections.Generic;
namespace MonoDevelop.Ide.TypeSystem
{
+ public sealed class ParseOptions
+ {
+ string buildAction;
+
+ public string BuildAction {
+ get {
+ return buildAction ?? "Compile";
+ }
+ set {
+ buildAction = value;
+ }
+ }
+
+ public string FileName { get; set; }
+
+ public ITextSource Content { get; set; }
+
+ public MonoDevelop.Projects.Project Project { get; set; }
+
+ public Document RoslynDocument { get; set; }
+ public ParsedDocument OldParsedDocument { get; internal set; }
+ }
+
+ [Flags]
+ public enum DisabledProjectionFeatures {
+ None = 0,
+ Completion = 1 << 0,
+ SemanticHighlighting = 1 << 1,
+ Tooltips = 1 << 2,
+
+ All = Completion | SemanticHighlighting | Tooltips
+ }
+
+ public class ParsedDocumentProjection
+ {
+ public ParsedDocument ParsedDocument { get; private set; }
+
+ public IReadOnlyList<Projection> Projections { get; private set;}
+
+ public DisabledProjectionFeatures DisabledProjectionFeatures { get; private set;}
+
+ public ParsedDocumentProjection (ParsedDocument parsedDocument, IReadOnlyList<Projection> projections, DisabledProjectionFeatures disabledProjectionFeatures = DisabledProjectionFeatures.None)
+ {
+ this.ParsedDocument = parsedDocument;
+ this.Projections = projections;
+ this.DisabledProjectionFeatures = disabledProjectionFeatures;
+ }
+ }
+
/// <summary>
/// A type system parser provides a ParsedDocument (which just adds some more information to a IUnresolvedFile) for
/// a given file. This is required for adding information to the type system service to make the file contents available
@@ -40,36 +96,57 @@ namespace MonoDevelop.Ide.TypeSystem
/// <summary>
/// Parse the specified file. The file content is provided as text reader.
/// </summary>
- /// <param name='storeAst'>
- /// If set to <c>true</c> the ast should be stored in the parsed document.
+ /// <param name='options'>
+ /// The parse options.
/// </param>
- /// <param name='fileName'>
- /// The name of the file.
+ /// <param name='cancellationToken'>
+ /// The cancellation token to cancel the parsing task.
/// </param>
- /// <param name='content'>
- /// A text reader providing the file contents.
- /// </param>
- /// <param name='project'>
- /// The project the file belongs to.
- /// </param>
- public abstract ParsedDocument Parse (bool storeAst, string fileName, TextReader content, Project project = null);
+ public abstract Task<ParsedDocument> Parse (ParseOptions options, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
- /// Parse the specified file. The file content should be read by the type system parser.
+ /// If true projections are possible. A projection transforms a source to a target language and maps certain parts of the file to parts in the projected file.
+ /// That's used for embedded languages for example.
/// </summary>
- /// <param name='storeAst'>
- /// If set to <c>true</c> the ast should be stored in the parsed document.
- /// </param>
- /// <param name='fileName'>
- /// The name of the file.
- /// </param>
- /// <param name='project'>
- /// The project the file belongs to.
- /// </param>
- public virtual ParsedDocument Parse (bool storeAst, string fileName, Project project = null)
+ /// <returns><c>true</c> if this instance can generate projection the specified mimeType buildAction supportedLanguages;
+ /// otherwise, <c>false</c>.</returns>
+ /// <param name="mimeType">MIME type.</param>
+ /// <param name="buildAction">Build action.</param>
+ /// <param name="supportedLanguages">Supported languages.</param>
+ public virtual bool CanGenerateProjection (string mimeType, string buildAction, string[] supportedLanguages)
+ {
+ return false;
+ }
+
+ /// <summary>
+ /// Generates the plain projection. This is used for type system services.
+ /// </summary>
+ /// <returns>The projection.</returns>
+ /// <param name="options">Options.</param>
+ /// <param name="cancellationToken">Cancellation token.</param>
+ public virtual Task<IReadOnlyList<Projection>> GenerateProjections (ParseOptions options, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ throw new NotSupportedException ();
+ }
+
+ /// <summary>
+ /// Generates the parsed document projection. That contains the parsed document and the projection. This is used inside the IDE for the editor.
+ /// That's usually more efficient than calling Parse/GenerateProjection separately.
+ /// </summary>
+ /// <returns>The parsed document projection.</returns>
+ /// <param name="options">Options.</param>
+ /// <param name="cancellationToken">Cancellation token.</param>
+ public virtual Task<ParsedDocumentProjection> GenerateParsedDocumentProjection (ParseOptions options, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ throw new NotSupportedException ();
+ }
+
+ /// <summary>
+ /// Gets an up to date partial projection used by code completion.
+ /// </summary>
+ public virtual Task<IReadOnlyList<Projection>> GetPartialProjectionsAsync (DocumentContext ctx, TextEditor editor, ParsedDocument currentParsedDocument, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var stream = Mono.TextEditor.Utils.TextFileUtility.OpenStream (fileName))
- return Parse (storeAst, fileName, stream, project);
+ throw new NotSupportedException ();
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemParserNode.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemParserNode.cs
index 1cb27e418a..99b6248989 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemParserNode.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemParserNode.cs
@@ -31,7 +31,7 @@ using MonoDevelop.Core.StringParsing;
namespace MonoDevelop.Ide.TypeSystem
{
- public class TypeSystemParserNode : TypeExtensionNode
+ class TypeSystemParserNode : TypeExtensionNode
{
const string ApiDefinitionBuildAction = "ObjcBindingApiDefinition";
@@ -85,34 +85,4 @@ namespace MonoDevelop.Ide.TypeSystem
buildAction == "BMacInputs";
}
}
-
-
- public class TypeSystemOutputTrackingNode : ExtensionNode
- {
- [NodeAttribute (Description="The project type.")]
- string projectType;
-
- public string ProjectType {
- get {
- return projectType;
- }
- set {
- projectType = value;
- }
- }
-
- [NodeAttribute (Description="The language name.")]
- string languageName;
-
- public string LanguageName {
- get {
- return languageName;
- }
- set {
- languageName = value;
- }
- }
- }
-
}
-
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs
index d1cc52adfc..0731b4889a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs
@@ -28,141 +28,29 @@ using System.Collections.Generic;
using System.Linq;
using System.IO;
using MonoDevelop.Projects;
-using ICSharpCode.NRefactory.TypeSystem.Implementation;
-using ICSharpCode.NRefactory.TypeSystem;
using Mono.Addins;
using MonoDevelop.Core;
using MonoDevelop.Ide;
-using Mono.TextEditor;
using System.Threading;
-using MonoDevelop.Core.ProgressMonitoring;
using System.Xml;
using ICSharpCode.NRefactory.Utils;
-using ICSharpCode.NRefactory;
using System.Threading.Tasks;
-using ICSharpCode.NRefactory.Documentation;
-using ICSharpCode.NRefactory.CSharp;
using MonoDevelop.Ide.Extensions;
using MonoDevelop.Core.Assemblies;
using System.Text;
-using ICSharpCode.NRefactory.Completion;
-using System.Diagnostics;
-using MonoDevelop.Projects.SharedAssetsProjects;
-using MonoDevelop.Ide.Templates;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
+using Microsoft.CodeAnalysis.Text;
+using Mono.Posix;
namespace MonoDevelop.Ide.TypeSystem
{
- public static class TypeSystemServiceExt
- {
- /// <summary>
- /// Tries to the get source project for a given type definition. This operation may fall if it was called on an outdated
- /// compilation unit or the correspondening project was unloaded.
- /// </summary>
- /// <returns><c>true</c>, if get source project was found, <c>false</c> otherwise.</returns>
- /// <param name="type">The type definition.</param>
- /// <param name="project">The project or null if it wasn't found.</param>
- public static bool TryGetSourceProject (this ITypeDefinition type, out Project project)
- {
- var location = type.Compilation.MainAssembly.UnresolvedAssembly.Location;
- if (string.IsNullOrEmpty (location)) {
- project = null;
- return false;
- }
- project = TypeSystemService.GetProject (location);
- return project != null;
- }
-
- /// <summary>
- /// Tries to the get source project for a given type. This operation may fall if it was called on an outdated
- /// compilation unit or the correspondening project was unloaded.
- /// </summary>
- /// <returns><c>true</c>, if get source project was found, <c>false</c> otherwise.</returns>
- /// <param name="type">The type.</param>
- /// <param name="project">The project or null if it wasn't found.</param>
- public static bool TryGetSourceProject (this IType type, out Project project)
- {
- var def = type.GetDefinition ();
- if (def == null) {
- project = null;
- return false;
- }
- return def.TryGetSourceProject (out project);
- }
-
-
- internal static Project GetProjectWhereTypeIsDefined (this ITypeDefinition type)
- {
- var location = type.ParentAssembly.UnresolvedAssembly.Location;
- if (string.IsNullOrEmpty (location))
- return null;
- return TypeSystemService.GetProject (location);
- }
-
- internal static Project GetProjectWhereTypeIsDefined (this IType type)
- {
- Project project;
- TryGetSourceProject (type, out project);
- return project;
- }
-
- public static TextLocation GetLocation (this IType type)
- {
- return type.GetDefinition ().Region.Begin;
- }
-
- public static bool IsBaseType (this IType type, IType potentialBase)
- {
- return type.GetAllBaseTypes ().Any (t => t.Equals (potentialBase));
- }
-
- public static bool IsObsolete (this IEntity member)
- {
- return member != null && member.Attributes.Any (a => a.AttributeType.FullName == "System.ObsoleteAttribute");
- }
-
- public static bool IsObsolete (this IEntity member, out string reason)
- {
- if (member == null) {
- reason = null;
- return false;
- }
- var attr = member.Attributes.FirstOrDefault (a => a.AttributeType.FullName == "System.ObsoleteAttribute");
- if (attr == null) {
- reason = null;
- return false;
- }
- reason = attr.PositionalArguments.Count > 0 ? attr.PositionalArguments [0].ConstantValue.ToString () : null;
- return true;
- }
-
- public static IType Resolve (this IUnresolvedTypeDefinition def, Project project)
- {
- if (project == null)
- throw new ArgumentNullException ("project");
- var compilation = TypeSystemService.GetCompilation (project);
- var ctx = new SimpleTypeResolveContext (compilation.MainAssembly);
- var resolvedType = def.Resolve (ctx);
- return resolvedType;
- }
- }
-
- /// <summary>
- /// The folding parser is used for generating a preliminary parsed document that does not
- /// contain a full dom - only some basic lexical constructs like comments or pre processor directives.
- ///
- /// This is useful for opening a document the first time to have some folding regions as start that are folded by default.
- /// Otherwise an irritating screen update will occur.
- /// </summary>
- public interface IFoldingParser
- {
- ParsedDocument Parse (string fileName, string content);
- }
-
- public static class TypeSystemService
+ public static partial class TypeSystemService
{
const string CurrentVersion = "1.1.9";
- static readonly List<TypeSystemParserNode> parsers;
+ static IEnumerable<TypeSystemParserNode> parsers;
static string[] filesSkippedInParseThread = new string[0];
+ public static Microsoft.CodeAnalysis.SyntaxAnnotation InsertionModeAnnotation = new Microsoft.CodeAnalysis.SyntaxAnnotation();
static IEnumerable<TypeSystemParserNode> Parsers {
get {
@@ -184,81 +72,76 @@ namespace MonoDevelop.Ide.TypeSystem
static TypeSystemService ()
{
- parsers = new List<TypeSystemParserNode> ();
+ CleanupCache ();
+ parsers = AddinManager.GetExtensionNodes<TypeSystemParserNode> ("/MonoDevelop/TypeSystem/Parser");
+ bool initialLoad = true;
AddinManager.AddExtensionNodeHandler ("/MonoDevelop/TypeSystem/Parser", delegate (object sender, ExtensionNodeEventArgs args) {
- switch (args.Change) {
- case ExtensionChange.Add:
- parsers.Add ((TypeSystemParserNode)args.ExtensionNode);
- break;
- case ExtensionChange.Remove:
- parsers.Remove ((TypeSystemParserNode)args.ExtensionNode);
- break;
- }
+ //refresh entire list to respect insertbefore/insertafter ordering
+ if (!initialLoad)
+ parsers = AddinManager.GetExtensionNodes<TypeSystemParserNode> ("/MonoDevelop/TypeSystem/Parser");
});
+ initialLoad = false;
- AddinManager.AddExtensionNodeHandler ("/MonoDevelop/TypeSystem/OutputTracking", delegate (object sender, ExtensionNodeEventArgs args) {
- var node = (TypeSystemOutputTrackingNode)args.ExtensionNode;
- switch (args.Change) {
- case ExtensionChange.Add:
- outputTrackedProjects.Add (node);
- break;
- case ExtensionChange.Remove:
- outputTrackedProjects.Remove (node);
- break;
- }
- });
+ try {
+ emptyWorkspace = new MonoDevelopWorkspace ();
+ } catch (Exception e) {
+ LoggingService.LogFatalError ("Can't create roslyn workspace", e);
+ }
FileService.FileChanged += delegate(object sender, FileEventArgs e) {
- if (!TrackFileChanges)
- return;
+ // if (!TrackFileChanges)
+ // return;
+
+ var filesToUpdate = new List<string> ();
foreach (var file in e) {
// Open documents are handled by the Document class itself.
if (IdeApp.Workbench != null && IdeApp.Workbench.GetDocument (file.FileName) != null)
continue;
- //
- lock (projectWrapperUpdateLock) {
- foreach (var wrapper in projectContents.Values) {
- var projectFile = wrapper.Project.Files.GetFile (file.FileName);
- if (projectFile != null)
- QueueParseJob (wrapper, new [] { projectFile });
+
+ foreach (var w in workspaces) {
+ foreach (var p in w.CurrentSolution.ProjectIds) {
+ if (w.GetDocumentId (p, file.FileName) != null) {
+ filesToUpdate.Add (file.FileName);
+ goto found;
+ }
}
- UnresolvedAssemblyProxy ctx;
- if (cachedAssemblyContents.TryGetValue (file.FileName, out ctx))
- CheckModifiedFile (ctx);
}
+ found:;
+
}
+ if (filesToUpdate.Count == 0)
+ return;
- foreach (var content in projectContents.Values.ToArray ()) {
- var files = new List<ProjectFile> ();
- foreach (var file in e) {
- var f = content.Project.GetProjectFile (file.FileName);
- if (f == null || f.BuildAction == BuildAction.None)
- continue;
- files.Add (f);
- }
- if (files.Count > 0)
- QueueParseJob (content, files);
- }
-
+ Task.Run (delegate {
+ try {
+ foreach (var file in filesToUpdate) {
+ var text = MonoDevelop.Core.Text.StringTextSource.ReadFrom (file).Text;
+ foreach (var w in workspaces)
+ w.UpdateFileContent (file, text);
+ Gtk.Application.Invoke (delegate {
+ if (IdeApp.Workbench != null)
+ foreach (var w in IdeApp.Workbench.Documents)
+ w.StartReparseThread ();
+ });
+ }
+ } catch (FileNotFoundException) {}
+ });
};
- if (IdeApp.ProjectOperations != null) {
- IdeApp.ProjectOperations.EndBuild += HandleEndBuild;
- }
- if (IdeApp.Workspace != null) {
- IdeApp.Workspace.ActiveConfigurationChanged += HandleActiveConfigurationChanged;
- }
- }
-
- static void HandleActiveConfigurationChanged (object sender, EventArgs e)
- {
- foreach (var pr in projectContents.ToArray ()) {
- var project = pr.Key as DotNetProject;
- if (project != null)
- CheckProjectOutput (project, true);
- pr.Value.referencesConnected = false;
- }
+ IntitializeTrackedProjectHandling ();
}
+/*
+ AddinManager.AddExtensionNodeHandler ("/MonoDevelop/TypeSystem/OutputTracking", delegate (object sender, ExtensionNodeEventArgs args) {
+ var node = (TypeSystemOutputTrackingNode)args.ExtensionNode;
+ switch (args.Change) {
+ case ExtensionChange.Add:
+ outputTrackedProjects.Add (node);
+ break;
+ case ExtensionChange.Remove:
+ outputTrackedProjects.Remove (node);
+ break;
+ }
+ });
static readonly List<TypeSystemOutputTrackingNode> outputTrackedProjects = new List<TypeSystemOutputTrackingNode> ();
@@ -272,35 +155,7 @@ namespace MonoDevelop.Ide.TypeSystem
return outputTrackedProjects.Any (otp => otp.LanguageName != null && string.Equals (otp.LanguageName, project.LanguageName, StringComparison.OrdinalIgnoreCase));
}
- static void CheckProjectOutput (DotNetProject project, bool autoUpdate)
- {
- if (project == null)
- throw new ArgumentNullException ("project");
- if (IsOutputTracked (project)) {
- var fileName = project.GetOutputFileName (IdeApp.Workspace.ActiveConfiguration);
-
- var wrapper = GetProjectContentWrapper (project);
- if (wrapper == null)
- return;
- bool update = wrapper.UpdateTrackedOutputAssembly (fileName);
- if (autoUpdate && update) {
- wrapper.ReconnectAssemblyReferences ();
-
- // update documents
- foreach (var openDocument in IdeApp.Workbench.Documents) {
- openDocument.ReparseDocument ();
- }
- }
- }
- }
-
- static void HandleEndBuild (object sender, BuildEventArgs args)
- {
- var project = args.SolutionItem as DotNetProject;
- if (project == null)
- return;
- CheckProjectOutput (project, true);
- }
+*/
public static TypeSystemParser GetParser (string mimeType, string buildAction = BuildAction.Compile)
{
@@ -308,7 +163,7 @@ namespace MonoDevelop.Ide.TypeSystem
return n != null ? n.Parser : null;
}
- static TypeSystemParserNode GetTypeSystemParserNode (string mimeType, string buildAction)
+ internal static TypeSystemParserNode GetTypeSystemParserNode (string mimeType, string buildAction)
{
foreach (var mt in DesktopService.GetMimeTypeInheritanceChain (mimeType)) {
var provider = Parsers.FirstOrDefault (p => p.CanParse (mt, buildAction));
@@ -318,172 +173,162 @@ namespace MonoDevelop.Ide.TypeSystem
return null;
}
- static List<MimeTypeExtensionNode> foldingParsers;
-
- static IEnumerable<MimeTypeExtensionNode> FoldingParsers {
- get {
- if (foldingParsers == null) {
- foldingParsers = new List<MimeTypeExtensionNode> ();
- AddinManager.AddExtensionNodeHandler ("/MonoDevelop/TypeSystem/FoldingParser", delegate (object sender, ExtensionNodeEventArgs args) {
- switch (args.Change) {
- case ExtensionChange.Add:
- foldingParsers.Add ((MimeTypeExtensionNode)args.ExtensionNode);
- break;
- case ExtensionChange.Remove:
- foldingParsers.Remove ((MimeTypeExtensionNode)args.ExtensionNode);
- break;
- }
- });
- }
- return foldingParsers;
- }
- }
-
- public static IFoldingParser GetFoldingParser (string mimeType)
+ public static Task<ParsedDocument> ParseFile (Project project, string fileName, CancellationToken cancellationToken = default(CancellationToken))
{
- foreach (var mt in DesktopService.GetMimeTypeInheritanceChain (mimeType)) {
- var node = FoldingParsers.FirstOrDefault (n => n.MimeType == mt);
- if (node != null)
- return node.CreateInstance () as IFoldingParser;
- }
- return null;
- }
+ StringTextSource text;
- public static ParsedDocument ParseFile (Project project, string fileName)
- {
- string text;
-
try {
if (!File.Exists (fileName))
- return null;
- text = Mono.TextEditor.Utils.TextFileUtility.ReadAllText (fileName);
+ return TaskUtil.Default<ParsedDocument>();
+ text = StringTextSource.ReadFrom (fileName);
} catch (Exception) {
- return null;
+ return TaskUtil.Default<ParsedDocument>();
}
-
- return ParseFile (project, fileName, DesktopService.GetMimeTypeForUri (fileName), text);
+
+ return ParseFile (project, fileName, DesktopService.GetMimeTypeForUri (fileName), text, cancellationToken);
}
- static readonly object projectWrapperUpdateLock = new object ();
-
- public static ParsedDocument ParseFile (Project project, string fileName, string mimeType, string content)
+ public static Task<ParsedDocument> ParseFile (ParseOptions options, string mimeType, CancellationToken cancellationToken = default(CancellationToken))
{
- if (fileName == null)
- throw new ArgumentNullException ("fileName");
+ if (options == null)
+ throw new ArgumentNullException ("options");
+ if (options.FileName == null)
+ throw new ArgumentNullException ("options.FileName");
+
var parser = GetParser (mimeType);
if (parser == null)
- return null;
+ return TaskUtil.Default<ParsedDocument>();
- var t = Counters.ParserService.FileParsed.BeginTiming (fileName);
+ var t = Counters.ParserService.FileParsed.BeginTiming (options.FileName);
try {
- var result = parser.Parse (true, fileName, new StringReader (content), project);
- lock (projectWrapperUpdateLock) {
- ProjectContentWrapper wrapper;
- if (project != null) {
- projectContents.TryGetValue (project, out wrapper);
- } else {
- wrapper = null;
- }
- if (wrapper != null && (result.Flags & ParsedDocumentFlags.NonSerializable) != ParsedDocumentFlags.NonSerializable) {
- var oldFile = wrapper._content.GetFile (fileName);
- wrapper.UpdateContent (c => c.AddOrUpdateFiles (result.ParsedFile));
- UpdateProjectCommentTasks (wrapper, result);
- if (oldFile != null)
- wrapper.InformFileRemoved (new ParsedFileEventArgs (oldFile));
- wrapper.InformFileAdded (new ParsedFileEventArgs (result.ParsedFile));
- }
-
- // The parsed file could be included in other projects as well, therefore
- // they need to be updated.
- foreach (var cnt in projectContents.ToArray ()) {
- if (cnt.Key == project)
- continue;
- // Use the project context because file lookup is faster there than in the project class.
- var pcnt = cnt.Value;
- var file = pcnt._content.GetFile (fileName);
- if (file != null) {
- var newResult = parser.Parse (false, fileName, new StringReader (content), pcnt.Project);
- if ((newResult.Flags & ParsedDocumentFlags.NonSerializable) != ParsedDocumentFlags.NonSerializable) {
- pcnt.UpdateContent (c => c.AddOrUpdateFiles (newResult.ParsedFile));
- pcnt.InformFileRemoved (new ParsedFileEventArgs (file));
- pcnt.InformFileAdded (new ParsedFileEventArgs (newResult.ParsedFile));
- }
- }
- }
- }
- return result;
+ var result = parser.Parse (options, cancellationToken);
+ return result ?? TaskUtil.Default<ParsedDocument>();
+ } catch (OperationCanceledException) {
+ return TaskUtil.Default<ParsedDocument>();
} catch (Exception e) {
LoggingService.LogError ("Exception while parsing: " + e);
- return null;
+ return TaskUtil.Default<ParsedDocument>();
} finally {
t.Dispose ();
}
}
- public static ParsedDocument ParseFile (Project project, string fileName, string mimeType, TextReader content)
+ internal static bool CanParseProjections (Project project, string mimeType, string fileName)
+ {
+ var projectFile = project.GetProjectFile (fileName);
+ if (projectFile == null)
+ return false;
+ var parser = GetParser (mimeType, projectFile.BuildAction);
+ if (parser == null)
+ return false;
+ return parser.CanGenerateProjection (mimeType, projectFile.BuildAction, project.SupportedLanguages);
+ }
+
+ public static Task<ParsedDocument> ParseFile (Project project, string fileName, string mimeType, ITextSource content, CancellationToken cancellationToken = default(CancellationToken))
{
- return ParseFile (project, fileName, mimeType, content.ReadToEnd ());
+ return ParseFile (new ParseOptions { FileName = fileName, Project = project, Content = content }, mimeType, cancellationToken);
}
- public static ParsedDocument ParseFile (Project project, TextEditorData data)
+ public static Task<ParsedDocument> ParseFile (Project project, string fileName, string mimeType, TextReader content, CancellationToken cancellationToken = default(CancellationToken))
{
- return ParseFile (project, data.FileName, data.MimeType, data.Text);
+ return ParseFile (project, fileName, mimeType, new StringTextSource (content.ReadToEnd ()), cancellationToken);
}
- public static ParsedDocument ParseFile (string fileName, string mimeType, string text, ProjectContentWrapper wrapper = null)
+ public static Task<ParsedDocument> ParseFile (Project project, IReadonlyTextDocument data, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var reader = new StringReader (text))
- return ParseFile (fileName, mimeType, reader, wrapper);
+ return ParseFile (project, data.FileName, data.MimeType, data, cancellationToken);
}
- public static ParsedDocument ParseFile (string fileName, string mimeType, TextReader content, ProjectContentWrapper wrapper = null)
+ internal static async Task<ParsedDocumentProjection> ParseProjection (ParseOptions options, string mimeType, CancellationToken cancellationToken = default(CancellationToken))
{
- var parser = GetParser (mimeType);
- if (parser == null)
+ if (options == null)
+ throw new ArgumentNullException ("options");
+ if (options.FileName == null)
+ throw new ArgumentNullException ("fileName");
+
+ var parser = GetParser (mimeType, options.BuildAction);
+ if (parser == null || !parser.CanGenerateProjection (mimeType, options.BuildAction, options.Project?.SupportedLanguages))
return null;
- var t = Counters.ParserService.FileParsed.BeginTiming (fileName);
+
+ var t = Counters.ParserService.FileParsed.BeginTiming (options.FileName);
try {
- var result = parser.Parse (true, fileName, content);
- lock (projectWrapperUpdateLock) {
- if (wrapper != null && (result.Flags & ParsedDocumentFlags.NonSerializable) != ParsedDocumentFlags.NonSerializable) {
- var oldFile = wrapper._content.GetFile (fileName);
- wrapper.UpdateContent (c => c.AddOrUpdateFiles (result.ParsedFile));
- UpdateProjectCommentTasks (wrapper, result);
- if (oldFile != null)
- wrapper.InformFileRemoved (new ParsedFileEventArgs (oldFile));
- wrapper.InformFileAdded (new ParsedFileEventArgs (result.ParsedFile));
+ var result = await parser.GenerateParsedDocumentProjection (options, cancellationToken);
+ if (options.Project != null) {
+ var ws = workspaces.First () ;
+ var projectId = ws.GetProjectId (options.Project);
+
+ if (projectId != null) {
+ ws.UpdateProjectionEntry (options.Project.GetProjectFile (options.FileName), result.Projections);
+ foreach (var projection in result.Projections) {
+ var docId = ws.GetDocumentId (projectId, projection.Document.FileName);
+ if (docId != null) {
+ ws.InformDocumentTextChange (docId, new MonoDevelopSourceText (projection.Document));
+ }
+ }
}
}
return result;
+ } catch (AggregateException ae) {
+ ae.Flatten ().Handle (x => x is OperationCanceledException);
+ return null;
+ } catch (OperationCanceledException) {
+ return null;
} catch (Exception e) {
- LoggingService.LogError ("Exception while parsing :" + e);
+ LoggingService.LogError ("Exception while parsing: " + e);
return null;
} finally {
t.Dispose ();
}
}
- public static event EventHandler ParseOperationStarted;
+ internal static Task<ParsedDocumentProjection> ParseProjection (Project project, string fileName, string mimeType, ITextSource content, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return ParseProjection (new ParseOptions { FileName = fileName, Project = project, Content = content }, mimeType, cancellationToken);
+ }
+
+ internal static Task<ParsedDocumentProjection> ParseProjection (Project project, string fileName, string mimeType, TextReader content, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return ParseProjection (project, fileName, mimeType, new StringTextSource (content.ReadToEnd ()), cancellationToken);
+ }
- internal static void StartParseOperation ()
+ internal static Task<ParsedDocumentProjection> ParseProjection (Project project, IReadonlyTextDocument data, CancellationToken cancellationToken = default(CancellationToken))
{
- if ((parseStatus++) == 0) {
- if (ParseOperationStarted != null)
- ParseOperationStarted (null, EventArgs.Empty);
- }
+ return ParseProjection (project, data.FileName, data.MimeType, data, cancellationToken);
}
- public static event EventHandler ParseOperationFinished;
+
+ #region Folding parsers
+ static List<MimeTypeExtensionNode> foldingParsers;
- internal static void EndParseOperation ()
+ static IEnumerable<MimeTypeExtensionNode> FoldingParsers {
+ get {
+ if (foldingParsers == null) {
+ foldingParsers = new List<MimeTypeExtensionNode> ();
+ AddinManager.AddExtensionNodeHandler ("/MonoDevelop/TypeSystem/FoldingParser", delegate (object sender, ExtensionNodeEventArgs args) {
+ switch (args.Change) {
+ case ExtensionChange.Add:
+ foldingParsers.Add ((MimeTypeExtensionNode)args.ExtensionNode);
+ break;
+ case ExtensionChange.Remove:
+ foldingParsers.Remove ((MimeTypeExtensionNode)args.ExtensionNode);
+ break;
+ }
+ });
+ }
+ return foldingParsers;
+ }
+ }
+
+ public static IFoldingParser GetFoldingParser (string mimeType)
{
- if (parseStatus == 0)
- return;
- if (--parseStatus == 0) {
- if (ParseOperationFinished != null)
- ParseOperationFinished (null, EventArgs.Empty);
+ foreach (var mt in DesktopService.GetMimeTypeInheritanceChain (mimeType)) {
+ var node = FoldingParsers.FirstOrDefault (n => n.MimeType == mt);
+ if (node != null)
+ return node.CreateInstance () as IFoldingParser;
}
+ return null;
}
+ #endregion
#region Parser Database Handling
@@ -667,7 +512,7 @@ namespace MonoDevelop.Ide.TypeSystem
static IEnumerable<string> GetPossibleCacheDirNames (string baseName)
{
int i = 0;
- while (i < 4096) {
+ while (i < 999999) {
yield return Path.Combine (baseName, i.ToString ());
i++;
}
@@ -706,7 +551,7 @@ namespace MonoDevelop.Ide.TypeSystem
{
var t = Counters.ParserService.ObjectDeserialized.BeginTiming (path);
try {
- using (var fs = new FileStream (path, FileMode.Open, FileAccess.Read, FileShare.Read, 4096, FileOptions.SequentialScan)) {
+ using (var fs = new FileStream (path, System.IO.FileMode.Open, FileAccess.Read, FileShare.Read, 4096, FileOptions.SequentialScan)) {
using (var reader = new BinaryReaderWith7BitEncodedInts (fs)) {
lock (sharedSerializer) {
return (T)sharedSerializer.Deserialize (reader);
@@ -728,7 +573,7 @@ namespace MonoDevelop.Ide.TypeSystem
var t = Counters.ParserService.ObjectSerialized.BeginTiming (path);
try {
- using (var fs = new FileStream (path, FileMode.Create, FileAccess.Write)) {
+ using (var fs = new FileStream (path, System.IO.FileMode.Create, FileAccess.Write)) {
using (var writer = new BinaryWriterWith7BitEncodedInts (fs)) {
lock (sharedSerializer) {
sharedSerializer.Serialize (writer, obj);
@@ -750,24 +595,30 @@ namespace MonoDevelop.Ide.TypeSystem
static void CleanupCache ()
{
string derivedDataPath = UserProfile.Current.CacheDir.Combine ("DerivedData");
- string[] subDirs;
+ string[] cacheDirectories;
try {
if (!Directory.Exists (derivedDataPath))
return;
- subDirs = Directory.GetDirectories (derivedDataPath);
+ cacheDirectories = Directory.GetDirectories (derivedDataPath);
} catch (Exception e) {
LoggingService.LogError ("Error while getting derived data directories.", e);
return;
}
-
- foreach (var subDir in subDirs) {
+ var now = DateTime.Now;
+ foreach (var cacheDirectory in cacheDirectories) {
try {
- var days = Math.Abs ((DateTime.Now - Directory.GetLastWriteTime (subDir)).TotalDays);
- if (days > 30)
- Directory.Delete (subDir, true);
+ foreach (var subDir in Directory.GetDirectories (cacheDirectory)) {
+ try {
+ var days = Math.Abs ((now - Directory.GetLastWriteTime (subDir)).TotalDays);
+ if (days > 30)
+ Directory.Delete (subDir, true);
+ } catch (Exception e) {
+ LoggingService.LogError ("Error while removing outdated cache " + subDir, e);
+ }
+ }
} catch (Exception e) {
- LoggingService.LogError ("Error while removing outdated cache " + subDir, e);
+ LoggingService.LogError ("Error while getting cache directories " + cacheDirectory, e);
}
}
}
@@ -809,2231 +660,88 @@ namespace MonoDevelop.Ide.TypeSystem
}
}
- static void StoreProjectCache (Project project, ProjectContentWrapper wrapper)
- {
- if (!wrapper.WasChanged)
- return;
- string cacheDir = GetCacheDirectory (project, true);
- string fileName = Path.GetTempFileName ();
-
- SerializeObject (fileName, wrapper.Content.RemoveAssemblyReferences (wrapper.Content.AssemblyReferences));
-
- string cacheFile = Path.Combine (cacheDir, "completion.cache");
-
- try {
- if (File.Exists (cacheFile))
- File.Delete (cacheFile);
- File.Move (fileName, cacheFile);
- } catch (Exception e) {
- LoggingService.LogError ("Error whil saving cache " + cacheFile, e);
- }
-
- foreach (var extensionObject in wrapper.ExtensionObjects) {
- StoreExtensionObject (cacheDir, extensionObject);
- }
- }
-
#endregion
- #region Project loading
-
- public static void Load (WorkspaceItem item)
- {
- using (Counters.ParserService.WorkspaceItemLoaded.BeginTiming ()) {
- InternalLoad (item);
- CleanupCache ();
- }
- }
- static CancellationTokenSource loadCancellationSource = new CancellationTokenSource ();
- static bool loadWs = false;
- static void InternalLoad (WorkspaceItem item)
+ internal static void InformDocumentClose (Microsoft.CodeAnalysis.DocumentId analysisDocument, FilePath fileName)
{
- var ws = item as Workspace;
- if (ws != null) {
- loadWs = true;
- loadCancellationSource.Cancel ();
- loadCancellationSource = new CancellationTokenSource ();
- foreach (WorkspaceItem it in ws.Items)
- InternalLoad (it);
- ws.ItemAdded += OnWorkspaceItemAdded;
- ws.ItemRemoved += OnWorkspaceItemRemoved;
- } else {
- if (!loadWs) {
- loadCancellationSource.Cancel ();
- loadCancellationSource = new CancellationTokenSource ();
- }
- var solution = item as Solution;
- if (solution != null) {
- Parallel.ForEach (solution.GetAllProjects (), project => LoadProject (project));
- var list = projectContents.Values.ToList ();
- Task.Factory.StartNew (delegate {
- foreach (var wrapper in list) {
- CheckModifiedFiles (wrapper.Project, wrapper.Project.Files.ToArray (), wrapper, loadCancellationSource.Token);
- }
- });
-
- solution.SolutionItemAdded += OnSolutionItemAdded;
- solution.SolutionItemRemoved += OnSolutionItemRemoved;
- OnSolutionLoaded (new SolutionEventArgs (solution));
- }
- }
- }
-
- public static event EventHandler<SolutionEventArgs> SolutionLoaded;
-
- static void OnSolutionLoaded (SolutionEventArgs e)
- {
- var handler = SolutionLoaded;
- if (handler != null)
- handler (null, e);
- }
-
- [Serializable]
- public class UnresolvedAssemblyDecorator : IUnresolvedAssembly
- {
- readonly ProjectContentWrapper wrapper;
-
- IUnresolvedAssembly assembly {
- get {
- if (wrapper.OutputAssembly != null)
- return wrapper.OutputAssembly;
- return wrapper.Compilation.MainAssembly.UnresolvedAssembly;
- }
- }
-
- public UnresolvedAssemblyDecorator (ProjectContentWrapper wrapper)
- {
- this.wrapper = wrapper;
- }
-
- #region IUnresolvedAssembly implementation
-
- public string AssemblyName {
- get {
- return assembly.AssemblyName;
- }
- }
-
- public string FullAssemblyName {
- get {
- return assembly.FullAssemblyName;
- }
- }
-
- public string Location {
- get {
- return assembly.Location;
- }
- }
-
- public IEnumerable<IUnresolvedAttribute> AssemblyAttributes {
- get {
- return assembly.AssemblyAttributes;
- }
- }
-
- public IEnumerable<IUnresolvedAttribute> ModuleAttributes {
- get {
- return assembly.ModuleAttributes;
- }
- }
-
- public IEnumerable<IUnresolvedTypeDefinition> TopLevelTypeDefinitions {
- get {
- return assembly.TopLevelTypeDefinitions;
- }
- }
+ foreach (var w in workspaces) {
+ if (w.GetOpenDocumentIds ().Contains (analysisDocument) )
+ w.InformDocumentClose (analysisDocument, fileName);
- #endregion
-
- #region IAssemblyReference implementation
-
- public IAssembly Resolve (ITypeResolveContext context)
- {
- return assembly.Resolve (context);
}
-
- #endregion
-
}
- [Serializable]
- public class ProjectContentWrapper
+ internal static void InformDocumentOpen (Microsoft.CodeAnalysis.DocumentId analysisDocument, TextEditor editor)
{
- readonly Dictionary<Type, object> extensionObjects = new Dictionary<Type, object> ();
- List<ProjectContentWrapper> referencedWrappers = new List<ProjectContentWrapper>();
- List<UnresolvedAssemblyProxy> referencedAssemblies = new List<UnresolvedAssemblyProxy>();
- internal IProjectContent _content;
- internal bool referencesConnected;
-
- /*
- static bool GetReferencesConnected (ProjectContentWrapper pcw, HashSet<ProjectContentWrapper> wrapper)
- {
- if (wrapper.Contains (pcw))
- return true;
- wrapper.Add (pcw);
- return pcw.referencesConnected && pcw.referencedWrappers.All (w => GetReferencesConnected (w, wrapper));
- }*/
-
- public IProjectContent Content {
- get {
- if (!referencesConnected) {
- EnsureReferencesAreLoaded ();
- }
- return _content;
- }
- private set {
- if (value == null)
- throw new InvalidOperationException ("Project content can't be null");
- _content = value;
- }
- }
-
- /// <summary>
- /// Gets the extension objects attached to the content wrapper.
- /// </summary>
- public IEnumerable<object> ExtensionObjects {
- get {
- return extensionObjects.Values;
- }
- }
-
- /// <summary>
- /// Updates an extension object for the wrapper. Note that only one extension object of a certain
- /// type may be stored inside the project content wrapper.
- ///
- /// The extension objects need to be serializable and are stored in the project cache on project unload.
- /// </summary>
- public void UpdateExtensionObject (object ext)
- {
- if (ext == null)
- throw new ArgumentNullException ("ext");
- extensionObjects [ext.GetType ()] = ext;
- }
-
- /// <summary>
- /// Gets a specific extension object. This may lazy load an existing extension object from disk,
- /// if called the first time and a serialized extension object exists.
- /// </summary>
- /// <returns>
- /// The extension object. Or null, if no extension object of the specified type was registered.
- /// </returns>
- /// <typeparam name='T'>
- /// The type of the extension object.
- /// </typeparam>
- public T GetExtensionObject<T> () where T : class
- {
- object result;
- if (extensionObjects.TryGetValue (typeof(T), out result))
- return (T)result;
-
- string cacheDir = GetCacheDirectory (Project);
- if (cacheDir == null)
- return default(T);
-
- try {
- string fileName = Path.Combine (cacheDir, typeof(T).FullName + ".cache");
- if (File.Exists (fileName)) {
- var deserialized = DeserializeObject<T> (fileName);
- extensionObjects [typeof(T)] = deserialized;
- return deserialized;
- }
- } catch (Exception) {
- Console.WriteLine ("Can't deserialize :" + typeof(T).FullName);
- }
-
- return default (T);
- }
-
- List<Action<IProjectContent>> loadActions = new List<Action<IProjectContent>> ();
-
- public void RunWhenLoaded (Action<IProjectContent> act)
- {
- lock (updateContentLock) {
- var lazyProjectLoader = _content as LazyProjectLoader;
- if (loadActions != null) {
- lock (loadActions) {
- if (lazyProjectLoader != null && !lazyProjectLoader.ContextTask.IsCompleted) {
- loadActions.Add (act);
- return;
- }
- }
- }
- }
- act (Content);
- }
-
- void ClearCachedCompilations ()
- {
- // Need to clear this compilation & all compilations that reference this directly or indirectly
- var stack = new Stack<ProjectContentWrapper> ();
- stack.Push (this);
- var cleared = new HashSet<ProjectContentWrapper> ();
- while (stack.Count > 0) {
- var cur = stack.Pop ();
- if (cleared.Contains (cur))
- continue;
- cleared.Add (cur);
- cur.compilation = null;
- foreach (var project in cur.ReferencedProjects) {
- var projectContentWrapper = GetProjectContentWrapper (project);
- if (projectContentWrapper != null)
- stack.Push (projectContentWrapper);
- }
- }
- }
-
- readonly object updateContentLock = new object ();
-
- void RunLoadActions ()
- {
- if (loadActions == null)
+ foreach (var w in workspaces) {
+ if (w.Contains (analysisDocument.ProjectId)) {
+ w.InformDocumentOpen (analysisDocument, editor);
return;
- Action<IProjectContent>[] actions;
- lock (loadActions) {
- actions = loadActions.ToArray ();
- loadActions = null;
- }
- foreach (var action in actions)
- action (Content);
- }
-
- public void UpdateContent (Func<IProjectContent, IProjectContent> updateFunc)
- {
- LazyProjectLoader lazyProjectLoader;
- lock (updateContentLock) {
- lazyProjectLoader = _content as LazyProjectLoader;
- if (lazyProjectLoader != null) {
- lazyProjectLoader.ContextTask.Wait ();
- }
- _content = updateFunc (_content);
- ClearCachedCompilations ();
- WasChanged = true;
- if (lazyProjectLoader != null && !(_content is LazyProjectLoader)) {
- RunLoadActions ();
- }
- }
- }
-
- public void InformFileRemoved (ParsedFileEventArgs e)
- {
- var handler = FileRemoved;
- if (handler != null)
- handler (this, e);
- }
-
- public void InformFileAdded (ParsedFileEventArgs e)
- {
- var handler = FileAdded;
- if (handler != null)
- handler (this, e);
- }
-
- public EventHandler<ParsedFileEventArgs> FileAdded;
- public EventHandler<ParsedFileEventArgs> FileRemoved;
- public bool WasChanged;
- [NonSerialized]
- ICompilation compilation;
- object compilationContentLock = new object ();
-
- public ICompilation Compilation {
- get {
- lock (compilationContentLock) {
- if (compilation == null) {
- compilation = Content.CreateCompilation ();
- }
- return compilation;
- }
}
}
-
- public Project Project {
- get;
- private set;
- }
-
- [NonSerialized]
- int loadOperationDepth = 0;
- [NonSerialized]
- readonly object loadOperationLocker = new object ();
-
- internal void BeginLoadOperation ()
- {
- lock (loadOperationLocker) {
- loadOperationDepth++;
- if (loadOperationDepth == 1)
- UpdateLoadState ();
- }
- }
-
- internal void EndLoadOperation ()
- {
- lock (loadOperationLocker) {
- if (loadOperationDepth > 0) {
- loadOperationDepth--;
- }
- if (loadOperationDepth == 0)
- UpdateLoadState ();
- }
- }
-
- bool isLoaded;
- public bool IsLoaded {
- get {
- return isLoaded;
- }
- }
-
- [NonSerialized]
- CancellationTokenSource src;
-
- internal void CancelLoad ()
- {
- if (src != null)
- src.Cancel ();
- }
-
- void UpdateLoadState ()
- {
- bool wasLoaded = isLoaded;
- isLoaded = loadOperationDepth == 0 && referencesConnected && !referencedAssemblies.Any (a => a.InLoad);
- if (isLoaded && !wasLoaded)
- OnLoad (EventArgs.Empty);
- }
-
- internal void RequestLoad ()
- {
- BeginLoadOperation ();
- EnsureReferencesAreLoaded ();
- CancelLoad ();
- src = new CancellationTokenSource ();
- var token = src.Token;
- //Task.Factory.StartNew (delegate {
- try {
- foreach (var asm in referencedAssemblies.ToArray ()) {
- if (token.IsCancellationRequested)
- break;
- var ctxLoader = asm.CtxLoader;
- if (ctxLoader != null)
- ctxLoader.EnsureAssemblyLoaded ();
- }
- } finally {
- EndLoadOperation ();
- }
- //});
- }
-
- public event EventHandler Loaded;
-
- protected virtual void OnLoad (EventArgs e)
- {
- var handler = Loaded;
- if (handler != null)
- handler (this, e);
- }
-
- [NonSerialized]
- internal LazyAssemblyLoader OutputAssembly;
-
- internal bool UpdateTrackedOutputAssembly (FilePath fileName)
- {
- if (File.Exists (fileName)) {
- OutputAssembly = new LazyAssemblyLoader (fileName, null);
- // a clean operation could remove the assembly, thefore we need to load it.
- OutputAssembly.EnsureAssemblyLoaded ();
- return true;
- }
- return false;
- }
-
- public ProjectContentWrapper (Project project)
- {
- if (project == null)
- throw new ArgumentNullException ("project");
- this.Project = project;
- var lazyProjectLoader = new LazyProjectLoader (this);
- this.Content = lazyProjectLoader;
- }
-
- public IEnumerable<Project> ReferencedProjects {
- get {
- return Project.GetReferencedItems (ConfigurationSelector.Default).OfType<DotNetProject> ();
- }
- }
-
- class LazyProjectLoader : IProjectContent
- {
- readonly ProjectContentWrapper wrapper;
- readonly Task<IProjectContent> contextTask;
-
- public Task<IProjectContent> ContextTask {
- get {
- return contextTask;
- }
- }
- object contentLock = new object ();
- IProjectContent contentWithReferences;
- public IProjectContent Content {
- get {
- lock (contentLock) {
- if (References != null) {
- return contentWithReferences ?? (contentWithReferences = contextTask.Result.AddAssemblyReferences (References));
- }
- return contextTask.Result;
- }
- }
- }
-
- List<IAssemblyReference> references;
- public List<IAssemblyReference> References {
- get {
- return references;
- }
- set {
- lock (contentLock) {
- references = value;
- }
- }
- }
-
- public LazyProjectLoader (ProjectContentWrapper wrapper)
- {
- this.wrapper = wrapper;
- contextTask = Task.Factory.StartNew (delegate {
- try {
- this.wrapper.BeginLoadOperation ();
- var p = this.wrapper.Project;
- var context = LoadProjectCache (p);
-
- var assemblyName = p.ParentSolution != null ? p.GetOutputFileName (p.ParentSolution.DefaultConfigurationSelector).FileNameWithoutExtension : p.Name;
- if (string.IsNullOrEmpty (assemblyName))
- assemblyName = p.Name;
-
- if (context != null) {
- return context.SetAssemblyName (assemblyName) ?? context;
- }
-
- context = new MonoDevelopProjectContent (p);
- context = context.SetLocation (p.FileName);
- context = context.SetAssemblyName (assemblyName);
-
- QueueParseJob (this.wrapper);
- return context;
- } finally {
- this.wrapper.EndLoadOperation ();
- }
- });
- }
-
- static IProjectContent LoadProjectCache (Project project)
- {
- string cacheDir = GetCacheDirectory (project);
- if (cacheDir == null)
- return null;
-
- var cacheFile = Path.Combine (cacheDir, "completion.cache");
- if (!File.Exists (cacheFile))
- return null;
- try {
- var cache = DeserializeObject<IProjectContent> (cacheFile);
- var monoDevelopProjectContent = cache as MonoDevelopProjectContent;
- if (monoDevelopProjectContent != null)
- monoDevelopProjectContent.Project = project;
- return cache;
- } catch (Exception e) {
- LoggingService.LogWarning ("Error while reading completion cache, regenerating", e);
- Directory.Delete (cacheDir, true);
- return null;
- }
- }
-
- #region IAssemblyReference implementation
-
- IAssembly IAssemblyReference.Resolve (ITypeResolveContext context)
- {
- return Content.Resolve (context);
- }
-
- #endregion
-
- #region IUnresolvedAssembly implementation
-
- string IUnresolvedAssembly.AssemblyName {
- get {
- return Content.AssemblyName;
- }
- }
-
- string IUnresolvedAssembly.FullAssemblyName {
- get {
- return Content.FullAssemblyName;
- }
- }
-
- string IUnresolvedAssembly.Location {
- get {
- return Content.Location;
- }
- }
-
- IEnumerable<IUnresolvedAttribute> IUnresolvedAssembly.AssemblyAttributes {
- get {
- return Content.AssemblyAttributes;
- }
- }
-
- IEnumerable<IUnresolvedAttribute> IUnresolvedAssembly.ModuleAttributes {
- get {
- return Content.ModuleAttributes;
- }
- }
-
- IEnumerable<IUnresolvedTypeDefinition> IUnresolvedAssembly.TopLevelTypeDefinitions {
- get {
- return Content.TopLevelTypeDefinitions;
- }
- }
-
- #endregion
-
- #region IProjectContent implementation
-
- string IProjectContent.ProjectFileName { get { return Content.ProjectFileName; } }
-
- IUnresolvedFile IProjectContent.GetFile (string fileName)
- {
- return Content.GetFile (fileName);
- }
-
- ICompilation IProjectContent.CreateCompilation ()
- {
- return Content.CreateCompilation ();
- }
-
- public ICompilation CreateCompilation (ISolutionSnapshot solutionSnapshot)
- {
- return Content.CreateCompilation (solutionSnapshot);
- }
-
- IProjectContent IProjectContent.SetAssemblyName (string newAssemblyName)
- {
- return Content.SetAssemblyName (newAssemblyName);
- }
-
- IProjectContent IProjectContent.SetLocation (string newLocation)
- {
- return Content.SetLocation (newLocation);
- }
-
- IProjectContent IProjectContent.AddAssemblyReferences (IEnumerable<IAssemblyReference> references)
- {
- return Content.AddAssemblyReferences (references);
- }
-
- IProjectContent IProjectContent.AddAssemblyReferences (params IAssemblyReference[] references)
- {
- return Content.AddAssemblyReferences (references);
- }
-
- IProjectContent IProjectContent.RemoveAssemblyReferences (IEnumerable<IAssemblyReference> references)
- {
- return Content.RemoveAssemblyReferences (references);
- }
-
- IProjectContent IProjectContent.RemoveAssemblyReferences (params IAssemblyReference[] references)
- {
- return Content.RemoveAssemblyReferences (references);
- }
- #pragma warning disable 618
- IProjectContent IProjectContent.UpdateProjectContent (IUnresolvedFile oldFile, IUnresolvedFile newFile)
- {
- return Content.UpdateProjectContent (oldFile, newFile);
- }
-
- public IProjectContent UpdateProjectContent (IEnumerable<IUnresolvedFile> oldFiles, IEnumerable<IUnresolvedFile> newFiles)
- {
- return Content.UpdateProjectContent (oldFiles, newFiles);
- }
- #pragma warning restore 618
-
- public IProjectContent AddOrUpdateFiles (IEnumerable<IUnresolvedFile> newFiles)
- {
- return Content.AddOrUpdateFiles (newFiles);
- }
-
- public IProjectContent AddOrUpdateFiles (params IUnresolvedFile[] newFiles)
- {
- return Content.AddOrUpdateFiles (newFiles);
- }
-
- IEnumerable<IUnresolvedFile> IProjectContent.Files {
- get {
- return Content.Files;
- }
- }
-
- IEnumerable<IAssemblyReference> IProjectContent.AssemblyReferences {
- get {
- return Content.AssemblyReferences;
- }
- }
-
- IProjectContent IProjectContent.SetProjectFileName (string newProjectFileName)
- {
- return Content.SetProjectFileName (newProjectFileName);
- }
-
- IProjectContent IProjectContent.RemoveFiles (IEnumerable<string> fileNames)
- {
- return Content.RemoveFiles (fileNames);
- }
-
- IProjectContent IProjectContent.RemoveFiles (params string[] fileNames)
- {
- return Content.RemoveFiles (fileNames);
- }
-
- #endregion
-
- object compilerSettings;
-
- public IProjectContent SetCompilerSettings (object compilerSettings)
- {
- this.compilerSettings = compilerSettings;
- return this;
- }
-
- public object CompilerSettings {
- get {
- return compilerSettings;
- }
- }
- }
-
- bool HasCyclicRefs (ProjectContentWrapper wrapper, HashSet<Project> nonCyclicCache)
- {
- if (nonCyclicCache.Contains (wrapper.Project))
- return false;
- nonCyclicCache.Add (wrapper.Project);
- foreach (var referencedProject in wrapper.ReferencedProjects) {
- ProjectContentWrapper w;
- if (referencedProject == Project || referencedProject == wrapper.Project || projectContents.TryGetValue (referencedProject, out w) && HasCyclicRefs (w, nonCyclicCache)) {
- return true;
- }
- }
- return false;
- }
-
- List<UnresolvedAssemblyProxy> LoadReferencedAssemblies (DotNetProject netProject)
- {
- var newReferencedAssemblies = new List<UnresolvedAssemblyProxy> ();
- try {
- foreach (string file in netProject.GetReferencedAssemblies (IdeApp.IsInitialized ? IdeApp.Workspace.ActiveConfiguration : ConfigurationSelector.Default, false)) {
- string fileName;
- if (!Path.IsPathRooted (file)) {
- fileName = Path.Combine (Path.GetDirectoryName (netProject.FileName), file);
- }
- else {
- fileName = Path.GetFullPath (file);
- }
- var ctx = LoadAssemblyContext (fileName);
- if (ctx != null) {
- newReferencedAssemblies.Add (ctx);
- ctx.Loaded += HandleReferencedProjectInLoadChange;
- }
- else {
- LoggingService.LogWarning ("TypeSystemService: Can't load assembly context for:" + file);
- }
- }
- }
- catch (Exception e) {
- LoggingService.LogError ("Error while getting assembly references", e);
- }
- return newReferencedAssemblies;
- }
-
- public void EnsureReferencesAreLoaded ()
- {
- lock (projectContentLock) {
- if (referencesConnected)
- return;
- compilation = null;
- referencesConnected = true;
- var netProject = Project as DotNetProject;
- if (netProject == null)
- return;
- try {
- var contexts = new List<IAssemblyReference> ();
- var nonCyclicCache = new HashSet<Project> ();
- foreach (var referencedWrapper in referencedWrappers) {
- referencedWrapper.Loaded -= HandleReferencedProjectInLoadChange;
- }
- var newReferencedWrappers = new List<ProjectContentWrapper> ();
- foreach (var referencedProject in ReferencedProjects) {
- ProjectContentWrapper wrapper;
- if (projectContents.TryGetValue (referencedProject, out wrapper)) {
- if (HasCyclicRefs (wrapper, nonCyclicCache))
- continue;
- wrapper.Loaded += HandleReferencedProjectInLoadChange;
- newReferencedWrappers.Add (wrapper);
- contexts.Add (new UnresolvedAssemblyDecorator (wrapper));
- }
- }
- this.referencedWrappers = newReferencedWrappers;
- UnresolvedAssemblyProxy ctx;
- // Add mscorlib reference
- var config = IdeApp.Workspace != null ? netProject.GetConfiguration (IdeApp.Workspace.ActiveConfiguration) as DotNetProjectConfiguration : null;
- bool noStdLib = false;
- if (config != null) {
- var parameters = config.CompilationParameters as DotNetConfigurationParameters;
- if (parameters != null) {
- noStdLib = parameters.NoStdLib;
- }
- }
- if (!noStdLib && netProject.TargetRuntime != null && netProject.TargetRuntime.AssemblyContext != null) {
- var corLibRef = netProject.TargetRuntime.AssemblyContext.GetAssemblyForVersion (typeof(object).Assembly.FullName, null, netProject.TargetFramework);
- if (corLibRef != null) {
- ctx = LoadAssemblyContext (corLibRef.Location);
- if (ctx != null)
- contexts.Add (ctx);
- }
- }
- // Get the assembly references throught the project, since it may have custom references
- foreach (var asm in referencedAssemblies) {
- asm.Loaded += HandleReferencedProjectInLoadChange;
- }
- var newReferencedAssemblies = LoadReferencedAssemblies (netProject);
- contexts.AddRange (newReferencedAssemblies);
- referencedAssemblies = newReferencedAssemblies;
- bool changed = WasChanged;
- var lazyProjectLoader = Content as LazyProjectLoader;
- if (lazyProjectLoader != null) {
- lazyProjectLoader.References = contexts;
- }
- else {
- UpdateContent (c => c.RemoveAssemblyReferences (Content.AssemblyReferences).AddAssemblyReferences (contexts));
- }
- WasChanged = changed;
- } catch (Exception e) {
- if (netProject.TargetRuntime == null) {
- LoggingService.LogError ("Target runtime was null: " + Project.Name);
- } else if (netProject.TargetRuntime.AssemblyContext == null) {
- LoggingService.LogError ("Target runtime assembly context was null: " + Project.Name);
- }
- LoggingService.LogError ("Error while reloading all references of project: " + Project.Name, e);
- } finally {
- UpdateLoadState ();
- }
- }
- }
- static readonly object reconnectLock = new object();
- public void ReconnectAssemblyReferences ()
- {
- var netProject = Project as DotNetProject;
- if (netProject == null)
- return;
- lock (reconnectLock) {
- CancelLoad ();
- this.referencesConnected = false;
- RequestLoad ();
- }
- }
-
- void HandleReferencedProjectInLoadChange (object sender, EventArgs e)
- {
- UpdateLoadState ();
- }
-
- internal void Unload ()
- {
- CancelLoad ();
- foreach (var asm in referencedAssemblies) {
- asm.Loaded -= HandleReferencedProjectInLoadChange;
- }
- foreach (var wrapper in referencedWrappers) {
- wrapper.Loaded -= HandleReferencedProjectInLoadChange;
- }
- loadActions = null;
- foreach (var wrapper in referencedWrappers) {
- wrapper.Loaded -= HandleReferencedProjectInLoadChange;
- }
- referencedWrappers.Clear ();
- referencedAssemblies.Clear ();
- Loaded = null;
- Content = new CSharpProjectContent ();
+ if (!gotDocumentRequestError) {
+ gotDocumentRequestError = true;
+ LoggingService.LogWarning ("Can't open requested document : " + analysisDocument + ":" + editor.FileName);
}
}
- static readonly object projectContentLock = new object ();
- static readonly Dictionary<Project, ProjectContentWrapper> projectContents = new Dictionary<Project, ProjectContentWrapper> ();
-
- public static ProjectContentWrapper LoadProject (Project project)
+ internal static void InformDocumentOpen (Microsoft.CodeAnalysis.Workspace ws, Microsoft.CodeAnalysis.DocumentId analysisDocument, TextEditor editor)
{
- if (IncLoadCount (project) != 1)
- return null;
- lock (projectContentLock) {
- if (projectContents.ContainsKey (project))
- return null;
- try {
- Counters.ParserService.ProjectsLoaded++;
- ProjectContentWrapper wrapper;
- projectContents [project] = wrapper = new ProjectContentWrapper (project);
- var dotNetProject = project as DotNetProject;
- if (dotNetProject != null)
- CheckProjectOutput (dotNetProject, false);
-
- project.FileAddedToProject += OnFileAdded;
- project.FileRemovedFromProject += OnFileRemoved;
- project.FileRenamedInProject += OnFileRenamed;
- project.Modified += OnProjectModified;
-
- if (dotNetProject != null) {
- StartFrameworkLookup (dotNetProject);
- }
- return wrapper;
- } catch (Exception ex) {
- LoggingService.LogError ("Parser database for project '" + project.Name + " could not be loaded", ex);
- }
- return null;
- }
+ ((MonoDevelopWorkspace)ws).InformDocumentOpen (analysisDocument, editor);
}
- public static Project GetProject (IEntity entity)
- {
- if (entity == null)
- throw new ArgumentNullException ("entity");
- return GetProject (entity.ParentAssembly.UnresolvedAssembly.Location);
- }
+ static bool gotDocumentRequestError = false;
- public static Project GetProject (string location)
- {
- foreach (var wrapper in projectContents)
- if (wrapper.Value.Compilation.MainAssembly.UnresolvedAssembly.Location == location)
- return wrapper.Key;
- return null;
- }
-
- #region Project modification handlers
-
- static void OnFileAdded (object sender, ProjectFileEventArgs args)
- {
- var project = (Project)sender;
- foreach (ProjectFileEventInfo fargs in args) {
- QueueParseJob (projectContents [project], new [] { fargs.ProjectFile });
- }
- }
-
- static void OnFileRemoved (object sender, ProjectFileEventArgs args)
- {
- var project = (Project)sender;
- foreach (ProjectFileEventInfo fargs in args) {
- var wrapper = projectContents [project];
- var fileName = fargs.ProjectFile.Name;
- var file = wrapper._content.GetFile (fileName);
- if (file == null)
- continue;
- wrapper.UpdateContent (c => c.RemoveFiles (fileName));
- wrapper.InformFileRemoved (new ParsedFileEventArgs (file));
-
- var tags = wrapper.GetExtensionObject <ProjectCommentTags> ();
- if (tags != null)
- tags.RemoveFile (wrapper.Project, fileName);
- }
- }
-
- static void OnFileRenamed (object sender, ProjectFileRenamedEventArgs args)
- {
- var project = (Project)sender;
- foreach (ProjectFileRenamedEventInfo fargs in args) {
- var content = projectContents [project];
- var file = content._content.GetFile (fargs.OldName);
- if (file == null)
- continue;
- content.UpdateContent (c => c.RemoveFiles (fargs.OldName));
- content.InformFileRemoved (new ParsedFileEventArgs (file));
-
- var tags = content.GetExtensionObject <ProjectCommentTags> ();
- if (tags != null)
- tags.RemoveFile (project, fargs.OldName);
-
- QueueParseJob (content, new [] { fargs.ProjectFile });
- }
- }
-
- static void OnProjectModified (object sender, SolutionItemModifiedEventArgs args)
- {
- if (!args.Any (x => x.Hint == "TargetFramework" || x.Hint == "References"))
- return;
- var project = (Project)sender;
-
- ProjectContentWrapper wrapper;
- projectContents.TryGetValue (project, out wrapper);
- if (wrapper == null)
- return;
- wrapper.ReconnectAssemblyReferences ();
- }
-
- #endregion
-
- internal static void Unload (WorkspaceItem item)
- {
- var ws = item as Workspace;
- TrackFileChanges = false;
- loadCancellationSource.Cancel ();
- if (ws != null) {
- foreach (WorkspaceItem it in ws.Items)
- Unload (it);
- ws.ItemAdded -= OnWorkspaceItemAdded;
- ws.ItemRemoved -= OnWorkspaceItemRemoved;
- projectContents.Clear ();
- loadWs = false;
- } else {
- var solution = item as Solution;
- if (solution != null) {
- foreach (var project in solution.GetAllProjects ()) {
- UnloadProject (project);
- }
- solution.SolutionItemAdded -= OnSolutionItemAdded;
- solution.SolutionItemRemoved -= OnSolutionItemRemoved;
- }
- }
-
- cachedAssemblyContents.Clear ();
- lock (parseQueueLock) {
- parseQueueIndex.Clear ();
- parseQueue.Clear ();
- }
- TrackFileChanges = true;
- }
-
- internal static void UnloadProject (Project project, bool skipProjectSerialization = false)
- {
- if (DecLoadCount (project) != 0)
- return;
- Counters.ParserService.ProjectsLoaded--;
- project.FileAddedToProject -= OnFileAdded;
- project.FileRemovedFromProject -= OnFileRemoved;
- project.FileRenamedInProject -= OnFileRenamed;
- project.Modified -= OnProjectModified;
-
- ProjectContentWrapper wrapper;
- lock (projectWrapperUpdateLock) {
- if (!projectContents.TryGetValue (project, out wrapper))
- return;
- projectContents.Remove (project);
- }
- if (!skipProjectSerialization)
- StoreProjectCache (project, wrapper);
- OnProjectUnloaded (new ProjectUnloadEventArgs (project, wrapper));
- wrapper.Unload ();
- }
-
- public static event EventHandler<ProjectUnloadEventArgs> ProjectUnloaded;
-
- static void OnProjectUnloaded (ProjectUnloadEventArgs e)
- {
- var handler = ProjectUnloaded;
- if (handler != null)
- handler (null, e);
- }
-
- static void OnWorkspaceItemAdded (object s, WorkspaceItemEventArgs args)
- {
- Load (args.Item);
- }
-
- static void OnWorkspaceItemRemoved (object s, WorkspaceItemEventArgs args)
- {
- Unload (args.Item);
- }
-
- static void OnSolutionItemAdded (object sender, SolutionItemChangeEventArgs args)
- {
- var project = args.SolutionItem as Project;
- if (project != null) {
- var wrapper = LoadProject (project);
- if (wrapper != null) {
- var files = wrapper.Project.Files.ToArray ();
- Task.Factory.StartNew (delegate {
- CheckModifiedFiles (wrapper.Project, files, wrapper);
- wrapper.RequestLoad ();
- });
- }
- }
- }
-
- static void OnSolutionItemRemoved (object sender, SolutionItemChangeEventArgs args)
- {
- var project = args.SolutionItem as Project;
- if (project != null)
- UnloadProject (project);
- }
-
- #endregion
-
- #region Reference Counting
-
- static readonly Dictionary<Project,int> loadCount = new Dictionary<Project,int> ();
- static readonly object rwLock = new object ();
-
- static int DecLoadCount (Project ob)
- {
- lock (rwLock) {
- int c;
- if (loadCount.TryGetValue (ob, out c)) {
- c--;
- if (c == 0)
- loadCount.Remove (ob);
- else
- loadCount [ob] = c;
- return c;
- }
- LoggingService.LogError ("DecLoadCount: Object not registered.");
- return 0;
- }
- }
-
- static int IncLoadCount (Project ob)
- {
- lock (rwLock) {
- int c;
- if (loadCount.TryGetValue (ob, out c)) {
- c++;
- loadCount [ob] = c;
- return c;
- }
- loadCount [ob] = 1;
- return 1;
- }
- }
-
- #endregion
-
- static bool GetXml (string baseName, TargetRuntime runtime, out FilePath xmlFileName)
- {
- try {
- xmlFileName = LookupLocalizedXmlDoc (baseName);
- if (!xmlFileName.IsNull)
- return true;
- } catch (Exception e) {
- LoggingService.LogError ("Error while looking up XML docs.", e);
- }
-
- if (MonoDevelop.Core.Platform.IsWindows) {
- string windowsFileName = FindWindowsXmlDocumentation (baseName, runtime);
- if (File.Exists (windowsFileName)) {
- xmlFileName = windowsFileName;
- return true;
- }
- }
-
- xmlFileName = "";
- return false;
- }
-
- #region Lookup XML documentation
-
- // ProgramFilesX86 is broken on 32-bit WinXP, this is a workaround
- static string GetProgramFilesX86 ()
- {
- return Environment.GetFolderPath (IntPtr.Size == 8 ?
- Environment.SpecialFolder.ProgramFilesX86 : Environment.SpecialFolder.ProgramFiles);
- }
-
- static readonly string referenceAssembliesPath = Path.Combine (GetProgramFilesX86 (), @"Reference Assemblies\Microsoft\\Framework");
- static readonly string frameworkPath = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Windows), @"Microsoft.NET\Framework");
-
- static string FindWindowsXmlDocumentation (string assemblyFileName, TargetRuntime runtime)
- {
- string fileName;
- ClrVersion version = runtime != null && runtime.CustomFrameworks.Any () ? runtime.CustomFrameworks.First ().ClrVersion : ClrVersion.Default;
- switch (version) {
-// case "1.0":
-// fileName = LookupLocalizedXmlDoc (Path.Combine (frameworkPath, "v1.0.3705", assemblyFileName));
-// break;
- case ClrVersion.Net_1_1:
- fileName = LookupLocalizedXmlDoc (Path.Combine (frameworkPath, "v1.1.4322", assemblyFileName));
- break;
- case ClrVersion.Net_2_0:
- case ClrVersion.Clr_2_1:
- fileName = LookupLocalizedXmlDoc (Path.Combine (frameworkPath, "v2.0.50727", assemblyFileName))
- ?? LookupLocalizedXmlDoc (Path.Combine (referenceAssembliesPath, "v3.5"))
- ?? LookupLocalizedXmlDoc (Path.Combine (referenceAssembliesPath, "v3.0"))
- ?? LookupLocalizedXmlDoc (Path.Combine (referenceAssembliesPath, @".NETFramework\v3.5\Profile\Client"));
- break;
- default:
- fileName = LookupLocalizedXmlDoc (Path.Combine (referenceAssembliesPath, @".NETFramework\v4.0", assemblyFileName))
- ?? LookupLocalizedXmlDoc (Path.Combine (frameworkPath, "v4.0.30319", assemblyFileName));
- break;
- }
- return fileName;
- }
-
- static string LookupLocalizedXmlDoc (string fileName)
- {
- return XmlDocumentationProvider.LookupLocalizedXmlDoc (fileName);
- }
-
- #endregion
-
- class UnresolvedAssemblyProxy : IUnresolvedAssembly
- {
- public readonly string FileName;
- internal LazyAssemblyLoader CtxLoader;
-
- public IUnresolvedAssembly Ctx {
- get {
- return CtxLoader;
- }
- }
-
- public bool InLoad {
- get {
- return CtxLoader == null || CtxLoader.InLoad;
- }
- }
-
- public event EventHandler Loaded {
- add {
- var ctxLoader = CtxLoader;
- if (ctxLoader != null)
- ctxLoader.Loaded += value;
- }
- remove {
- var ctxLoader = CtxLoader;
- if (ctxLoader != null)
- ctxLoader.Loaded -= value;
- }
- }
-
- public UnresolvedAssemblyProxy (string fileName)
- {
- if (fileName == null)
- throw new ArgumentNullException ("fileName");
- this.FileName = fileName;
- }
-
- #region IUnresolvedAssembly implementation
-
- string IUnresolvedAssembly.AssemblyName {
- get {
- return Ctx.AssemblyName;
- }
- }
-
- string IUnresolvedAssembly.FullAssemblyName {
- get {
- return Ctx.FullAssemblyName;
- }
- }
-
- string IUnresolvedAssembly.Location {
- get {
- return Ctx.Location;
- }
- }
-
- IEnumerable<IUnresolvedAttribute> IUnresolvedAssembly.AssemblyAttributes {
- get {
- return Ctx.AssemblyAttributes;
- }
- }
-
- IEnumerable<IUnresolvedAttribute> IUnresolvedAssembly.ModuleAttributes {
- get {
- return Ctx.ModuleAttributes;
- }
- }
-
- IEnumerable<IUnresolvedTypeDefinition> IUnresolvedAssembly.TopLevelTypeDefinitions {
- get {
- return Ctx.TopLevelTypeDefinitions;
- }
- }
-
- #endregion
-
- #region IAssemblyReference implementation
-
- IAssembly IAssemblyReference.Resolve (ITypeResolveContext context)
- {
- var ctx = Ctx;
- if (ctx == null)
- return null;
- return ctx.Resolve (context);
- }
-
- #endregion
-
- public override string ToString ()
- {
- return string.Format ("[UnresolvedAssemblyProxy: FileName={0}]", FileName);
- }
- }
-
- internal class LazyAssemblyLoader : IUnresolvedAssembly
- {
- class LazyAssembly : IAssembly
- {
- readonly LazyAssemblyLoader loader;
- readonly ITypeResolveContext context;
- IAssembly assembly;
-
- IAssembly Assembly {
- get {
- lock (loader) {
- if (assembly == null) {
- loader.EnsureAssemblyLoaded ();
- assembly = loader.assembly.Resolve (context);
- }
- return assembly;
- }
- }
- }
-
-
- public LazyAssembly (LazyAssemblyLoader loader, ITypeResolveContext context)
- {
- this.loader = loader;
- this.context = context;
- }
-
- #region IAssembly implementation
-
- bool IAssembly.InternalsVisibleTo (IAssembly assembly)
- {
- return Assembly.InternalsVisibleTo (assembly);
- }
-
- ITypeDefinition IAssembly.GetTypeDefinition (TopLevelTypeName typeName)
- {
- return Assembly.GetTypeDefinition (typeName);
- }
-
- IUnresolvedAssembly IAssembly.UnresolvedAssembly {
- get {
- return Assembly.UnresolvedAssembly;
- }
- }
-
- bool IAssembly.IsMainAssembly {
- get {
- return Assembly.IsMainAssembly;
- }
- }
-
- string IAssembly.AssemblyName {
- get {
- return Assembly.AssemblyName;
- }
- }
-
- string IAssembly.FullAssemblyName {
- get {
- return Assembly.FullAssemblyName;
- }
- }
-
- IList<IAttribute> IAssembly.AssemblyAttributes {
- get {
- return Assembly.AssemblyAttributes;
- }
- }
-
- IList<IAttribute> IAssembly.ModuleAttributes {
- get {
- return Assembly.ModuleAttributes;
- }
- }
-
- INamespace IAssembly.RootNamespace {
- get {
- return Assembly.RootNamespace;
- }
- }
-
- IEnumerable<ITypeDefinition> IAssembly.TopLevelTypeDefinitions {
- get {
- return Assembly.TopLevelTypeDefinitions;
- }
- }
-
- #endregion
-
- #region ICompilationProvider implementation
-
- ICompilation ICompilationProvider.Compilation {
- get {
- return Assembly.Compilation;
- }
- }
-
- #endregion
-
- }
-
- #region IAssemblyReference implementation
-
- IAssembly IAssemblyReference.Resolve (ITypeResolveContext context)
- {
- if (assembly != null)
- return assembly.Resolve (context);
- return new LazyAssembly (this, context);
- }
-
- #endregion
-
- #region IUnresolvedAssembly implementation
-
- readonly object assemblyLock = new object ();
-
- string IUnresolvedAssembly.AssemblyName {
- get {
- lock (assemblyLock) {
- EnsureAssemblyLoaded ();
- return assembly.AssemblyName;
- }
- }
- }
-
- string IUnresolvedAssembly.FullAssemblyName {
- get {
- lock (assemblyLock) {
- EnsureAssemblyLoaded ();
- return assembly.FullAssemblyName;
- }
- }
- }
-
- string IUnresolvedAssembly.Location {
- get {
- lock (assemblyLock) {
- EnsureAssemblyLoaded ();
- return assembly.Location;
- }
- }
- }
-
- IEnumerable<IUnresolvedAttribute> IUnresolvedAssembly.AssemblyAttributes {
- get {
- lock (assemblyLock) {
- EnsureAssemblyLoaded ();
- return assembly.AssemblyAttributes;
- }
- }
- }
-
- IEnumerable<IUnresolvedAttribute> IUnresolvedAssembly.ModuleAttributes {
- get {
- lock (assemblyLock) {
- EnsureAssemblyLoaded ();
- return assembly.ModuleAttributes;
- }
- }
- }
-
- IEnumerable<IUnresolvedTypeDefinition> IUnresolvedAssembly.TopLevelTypeDefinitions {
- get {
- lock (assemblyLock) {
- EnsureAssemblyLoaded ();
- return assembly.TopLevelTypeDefinitions;
- }
- }
- }
-
- #endregion
-
- readonly string fileName;
- readonly string cache;
- IUnresolvedAssembly assembly;
-
- readonly object asmLocker = new object ();
- internal void EnsureAssemblyLoaded ()
- {
- lock (asmLocker) {
- if (assembly != null)
- return;
- var loadedAssembly = LoadAssembly ();
- if (loadedAssembly == null) {
- LoggingService.LogWarning ("Assembly " + fileName + " could not be loaded cleanly.");
- assembly = new DefaultUnresolvedAssembly (fileName);
- } else {
- assembly = loadedAssembly;
- }
-
- OnLoad (EventArgs.Empty);
- }
- }
-
- public override string ToString ()
- {
- return string.Format ("[LazyAssemblyLoader: fileName={0}, assembly={1}]", fileName, assembly);
- }
-
- public bool InLoad {
- get {
- return assembly == null;
- }
- }
-
- public event EventHandler Loaded;
-
- protected virtual void OnLoad (EventArgs e)
- {
- var handler = Loaded;
- if (handler != null)
- handler (this, e);
- }
-
- public LazyAssemblyLoader (string fileName, string cache)
- {
- this.fileName = fileName;
- this.cache = cache;
- }
-
-
- IUnresolvedAssembly LoadAssembly ()
- {
- var assemblyPath = cache != null ? Path.Combine (cache, "assembly.data") : null;
- var assemblyTag = cache != null ? Path.Combine (cache, "assembly.tag") : null;
- try {
- if (assemblyPath != null && assemblyTag != null && File.Exists (assemblyPath) && File.Exists (assemblyTag)) {
- var deserializedAssembly = DeserializeObject <IUnresolvedAssembly> (assemblyPath);
- if (deserializedAssembly != null) {
- return deserializedAssembly;
- }
- }
- } catch (Exception) {
- }
- IUnresolvedAssembly result;
- try {
- var loader = new IkvmLoader ();
- loader.IncludeInternalMembers = true;
- loader.DocumentationProvider = new CombinedDocumentationProvider (fileName);
- result = loader.LoadAssemblyFile (fileName);
- } catch (Exception e) {
- LoggingService.LogError ("Can't convert assembly: " + fileName, e);
- return null;
- }
-
- if (cache != null) {
- var writeTime = File.GetLastWriteTimeUtc (fileName);
- SerializeObject (assemblyPath, result);
- SerializeObject (assemblyTag, new AssemblyTag (writeTime));
- }
- return result;
- }
- }
-
- [Serializable]
- class CombinedDocumentationProvider : IDocumentationProvider
- {
- readonly string fileName;
- [NonSerialized]
- IDocumentationProvider baseProvider;
-
- public IDocumentationProvider BaseProvider {
- get {
- if (baseProvider == null) {
- FilePath xmlDocFile;
- if (GetXml (fileName, null, out xmlDocFile)) {
- try {
- baseProvider = new XmlDocumentationProvider (xmlDocFile);
- } catch (Exception ex) {
- LoggingService.LogWarning ("Ignoring error while reading xml doc from " + xmlDocFile, ex);
- }
- }
- if (baseProvider == null)
- baseProvider = new MonoDocDocumentationProvider ();
- }
- return baseProvider;
- }
- }
-
- public CombinedDocumentationProvider (string fileName)
- {
- this.fileName = fileName;
- }
-
- #region IDocumentationProvider implementation
-
- public DocumentationComment GetDocumentation (IEntity entity)
- {
- var provider = BaseProvider;
- return provider != null ? provider.GetDocumentation (entity) : null;
- }
-
- #endregion
-
- }
-
- static readonly object assemblyContextLock = new object ();
-
- static UnresolvedAssemblyProxy LoadAssemblyContext (FilePath fileName)
- {
- CanonicalizePath (ref fileName);
-
- UnresolvedAssemblyProxy loadedContext;
- if (cachedAssemblyContents.TryGetValue (fileName, out loadedContext)) {
- return loadedContext;
- }
- if (!File.Exists (fileName))
- return null;
- lock (assemblyContextLock) {
- if (cachedAssemblyContents.TryGetValue (fileName, out loadedContext)) {
- CheckModifiedFile (loadedContext);
- return loadedContext;
- }
-
- string cache = GetCacheDirectory (fileName, true);
-
- try {
- var result = new UnresolvedAssemblyProxy (fileName);
- result.CtxLoader = new LazyAssemblyLoader (fileName, cache);
- CheckModifiedFile (result);
- var newcachedAssemblyContents = new Dictionary<string, UnresolvedAssemblyProxy> (cachedAssemblyContents);
- newcachedAssemblyContents [fileName] = result;
- cachedAssemblyContents = newcachedAssemblyContents;
- OnAssemblyLoaded (new AssemblyLoadedEventArgs (result.CtxLoader));
- return result;
- } catch (Exception ex) {
- LoggingService.LogError ("Error loading assembly " + fileName, ex);
- return null;
- }
- }
- }
-
- internal static event EventHandler<AssemblyLoadedEventArgs> AssemblyLoaded;
-
- static void OnAssemblyLoaded (AssemblyLoadedEventArgs e)
- {
- var handler = AssemblyLoaded;
- if (handler != null)
- handler (null, e);
- }
-
- public static IUnresolvedAssembly LoadAssemblyContext (TargetRuntime runtime, TargetFramework fx, string fileName)
- {
- if (File.Exists (fileName))
- return LoadAssemblyContext (fileName);
- var corLibRef = runtime.AssemblyContext.GetAssemblyForVersion (fileName, null, fx);
- return corLibRef == null ? null : LoadAssemblyContext (corLibRef.Location);
- }
-
- public static IProjectContent GetProjectContext (Project project)
- {
- if (project == null)
- throw new ArgumentNullException ("project");
- var content = GetProjectContentWrapper (project);
- if (content == null)
- return null;
- return content.Content;
- }
-
- public static ICompilation GetCompilation (Project project)
+ public static Microsoft.CodeAnalysis.ProjectId GetProjectId (MonoDevelop.Projects.Project project)
{
if (project == null)
throw new ArgumentNullException ("project");
- var content = GetProjectContentWrapper (project);
- if (content == null)
- return null;
- return content.Compilation;
- }
-
- public static ICompilation GetCompilation (SystemAssembly assembly, ICompilation compilation)
- {
- var ctx = LoadAssemblyContext (assembly.Location);
- var list = compilation.ReferencedAssemblies.Select (r => r.UnresolvedAssembly).ToList ();
- list.Add (compilation.MainAssembly.UnresolvedAssembly);
- var result = new SimpleCompilation (ctx, list);
- return result;
- }
-
- static IEnumerable<SystemAssembly> GetFrameworkAssemblies (DotNetProject netProject)
- {
- var assemblies = new Dictionary<string, SystemAssembly> ();
- foreach (var assembly in netProject.AssemblyContext.GetAssemblies ()) {
- SystemAssembly existing;
- if (assemblies.TryGetValue (assembly.Name, out existing)) {
- Version v1, v2;
- if (!Version.TryParse (existing.Version, out v1))
- continue;
- if (!Version.TryParse (assembly.Version, out v2))
- continue;
- if (v1 > v2)
- continue;
- }
- assemblies [assembly.Name] = assembly;
- }
- return assemblies.Values;
- }
-
- class FrameworkTask
- {
- public int RetryCount { get; set; }
-
- public Task<FrameworkLookup> Task { get; set; }
- }
-
- readonly static Dictionary<string, FrameworkTask> frameworkLookup = new Dictionary<string, FrameworkTask> ();
-
- static void StartFrameworkLookup (DotNetProject netProject)
- {
- if (netProject == null)
- throw new ArgumentNullException ("netProject");
- lock (frameworkLookup) {
- FrameworkTask result;
- if (netProject.TargetFramework == null)
- return;
- var frameworkName = netProject.TargetFramework.Name;
- if (!frameworkLookup.TryGetValue (frameworkName, out result))
- frameworkLookup [frameworkName] = result = new FrameworkTask ();
- if (result.Task != null)
- return;
- result.Task = Task.Factory.StartNew (delegate {
- return GetFrameworkLookup (netProject);
- });
- }
- }
-
- public static bool TryGetFrameworkLookup (DotNetProject project, out FrameworkLookup lookup)
- {
- lock (frameworkLookup) {
- FrameworkTask result;
- if (frameworkLookup.TryGetValue (project.TargetFramework.Name, out result)) {
- if (!result.Task.IsCompleted) {
- lookup = null;
- return false;
- }
- lookup = result.Task.Result;
- return true;
+ foreach (var w in workspaces) {
+ var projectId = w.GetProjectId (project);
+ if (projectId != null) {
+ return projectId;
}
}
- lookup = null;
- return false;
- }
-
- public static bool RecreateFrameworkLookup (DotNetProject netProject)
- {
- lock (frameworkLookup) {
- FrameworkTask result;
- var frameworkName = netProject.TargetFramework.Name;
- if (!frameworkLookup.TryGetValue (frameworkName, out result))
- return false;
- if (result.RetryCount > 5) {
- LoggingService.LogError ("Can't create framework lookup for:" + frameworkName);
- return false;
- }
- result.RetryCount++;
- LoggingService.LogInfo ("Trying to recreate framework lookup for {0}, try {1}.", frameworkName, result.RetryCount);
- result.Task = null;
- StartFrameworkLookup (netProject);
- return true;
- }
+ return null;
}
- static FrameworkLookup GetFrameworkLookup (DotNetProject netProject)
+ public static Microsoft.CodeAnalysis.Document GetCodeAnalysisDocument (Microsoft.CodeAnalysis.DocumentId docId, CancellationToken cancellationToken = default (CancellationToken))
{
- FrameworkLookup result;
- string fileName;
- var cache = GetCacheDirectory (netProject.TargetFramework);
- fileName = Path.Combine (cache, "FrameworkLookup_" + FrameworkLookup.CurrentVersion + ".dat");
- try {
- if (File.Exists (fileName)) {
- result = FrameworkLookup.Load (fileName);
- if (result != null) {
- return result;
- }
- }
- } catch (Exception e) {
- LoggingService.LogWarning ("Can't read framework cache - recreating...", e);
- }
-
- try {
- using (var creator = FrameworkLookup.Create (fileName)) {
- foreach (var assembly in GetFrameworkAssemblies (netProject)) {
- var ctx = LoadAssemblyContext (assembly.Location);
- foreach (var type in ctx.Ctx.GetAllTypeDefinitions ()) {
- if (!type.IsPublic)
- continue;
- creator.AddLookup (assembly.Package.Name, assembly.FullName, type);
- }
- }
+ if (docId == null)
+ throw new ArgumentNullException ("docId");
+ foreach (var w in workspaces) {
+ var documentId = w.GetDocument (docId, cancellationToken);
+ if (documentId != null) {
+ return documentId;
}
- } catch (Exception e) {
- LoggingService.LogError ("Error while storing framework lookup", e);
- return FrameworkLookup.Empty;
- }
-
- try {
- result = FrameworkLookup.Load (fileName);
- return result;
- } catch (Exception e) {
- LoggingService.LogError ("Error loading framework lookup", e);
- return FrameworkLookup.Empty;
}
+ return null;
}
- public static ProjectContentWrapper GetProjectContentWrapper (Project project)
+ public static MonoDevelop.Projects.Project GetMonoProject (Microsoft.CodeAnalysis.Project project)
{
if (project == null)
throw new ArgumentNullException ("project");
- ProjectContentWrapper content;
- if (projectContents.TryGetValue (project, out content))
- return content;
- // in case of outdated projects try to get the most recent project wrapper.
- foreach (var cnt in projectContents) {
- if (cnt.Key.FileName == project.FileName)
- return cnt.Value;
- }
- return null;
- }
-
- public static IProjectContent GetContext (FilePath file, string mimeType, string text)
- {
- using (var reader = new StringReader (text)) {
- var parsedDocument = ParseFile (file, mimeType, reader);
-
- var content = new CSharpProjectContent ();
- return content.AddOrUpdateFiles (parsedDocument.ParsedFile);
- }
- }
-
- static Dictionary<string, UnresolvedAssemblyProxy> cachedAssemblyContents = new Dictionary<string, UnresolvedAssemblyProxy> ();
-
- /// <summary>
- /// Force the update of a project context. Note: This method blocks the thread.
- /// It was just implemented for use inside unit tests.
- /// </summary>
- public static void ForceUpdate (ProjectContentWrapper context)
- {
- CheckModifiedFiles ();
- while (!context.IsLoaded) {
- Thread.Sleep (10);
- }
- }
-
- #region Parser queue
-
- static bool threadRunning;
-
- public static IProgressMonitorFactory ParseProgressMonitorFactory {
- get;
- set;
- }
-
- class InternalProgressMonitor
- : NullProgressMonitor
- {
- public InternalProgressMonitor ()
- {
- StartParseOperation ();
- }
-
- public override void Dispose ()
- {
- EndParseOperation ();
- }
- }
-
- internal static IProgressMonitor GetParseProgressMonitor ()
- {
- var mon = ParseProgressMonitorFactory != null ? ParseProgressMonitorFactory.CreateProgressMonitor () : new NullProgressMonitor ();
-
- return new AggregatedProgressMonitor (mon, new InternalProgressMonitor ());
- }
-
- static readonly Queue<ParsingJob> parseQueue = new Queue<ParsingJob> ();
-
- class ParsingJob
- {
- public ProjectContentWrapper Context;
- public IEnumerable<ProjectFile> FileList;
- // public Action<string, IProgressMonitor> ParseCallback;
- public void Run (IProgressMonitor monitor, CancellationToken token)
- {
- TypeSystemParserNode node = null;
- TypeSystemParser parser = null;
- var tags = Context.GetExtensionObject <ProjectCommentTags> ();
- try {
- Context.BeginLoadOperation ();
- var parsedFiles = new List<Tuple<ParsedDocument, IUnresolvedFile>> ();
- foreach (var file in (FileList ?? Context.Project.Files)) {
- if (token.IsCancellationRequested)
- return;
- var fileName = file.FilePath;
- if (filesSkippedInParseThread.Any (f => f == fileName)) {
- continue;
- }
- if (node == null || !node.CanParse (fileName, file.BuildAction)) {
- var newNode = GetTypeSystemParserNode (DesktopService.GetMimeTypeForUri (fileName), file.BuildAction);
- var newParser = newNode != null ? newNode.Parser : null;
- if (newParser == null)
- continue;
- node = newNode;
- parser = newParser;
- }
-
- if (parser == null || !File.Exists (fileName))
- continue;
- ParsedDocument parsedDocument;
- try {
- parsedDocument = parser.Parse (false, fileName, Context.Project);
- } catch (Exception e) {
- LoggingService.LogError ("Error while parsing " + fileName, e);
- continue;
- }
- if (token.IsCancellationRequested)
- return;
- if (tags != null)
- tags.UpdateTags (Context.Project, parsedDocument.FileName, parsedDocument.TagComments);
- if (token.IsCancellationRequested)
- return;
- parsedFiles.Add (Tuple.Create (parsedDocument, Context._content.GetFile (fileName)));
- }
- Context.UpdateContent (c => c.AddOrUpdateFiles (parsedFiles.Where (f => (f.Item1.Flags & ParsedDocumentFlags.NonSerializable) != ParsedDocumentFlags.NonSerializable).Select (p => p.Item1.ParsedFile)));
- foreach (var file in parsedFiles) {
- if (token.IsCancellationRequested)
- return;
- if (file.Item2 != null)
- Context.InformFileRemoved (new ParsedFileEventArgs (file.Item2));
- var parsedDocument = file.Item1;
- if ((parsedDocument.Flags & ParsedDocumentFlags.NonSerializable) != ParsedDocumentFlags.NonSerializable)
- Context.InformFileAdded (new ParsedFileEventArgs (parsedDocument.ParsedFile));
- }
- } finally {
- Context.EndLoadOperation ();
- }
- }
- }
-
- static void UpdateProjectCommentTasks (ProjectContentWrapper context, ParsedDocument parsedDocument)
- {
- var tags = context.GetExtensionObject <ProjectCommentTags> ();
- if (tags != null) // When tags are not there they're updated first time the tasks are requested.
- tags.UpdateTags (context.Project, parsedDocument.FileName, parsedDocument.TagComments);
- }
- // public static event EventHandler<ProjectFileEventArgs> FileParsed;
- static readonly object parseQueueLock = new object ();
- static readonly AutoResetEvent parseEvent = new AutoResetEvent (false);
- static readonly ManualResetEvent queueEmptied = new ManualResetEvent (true);
- static bool trackingFileChanges;
-
- public static bool TrackFileChanges {
- get {
- return trackingFileChanges;
- }
- set {
- lock (parseQueueLock) {
- if (value != trackingFileChanges) {
- trackingFileChanges = value;
- if (value)
- StartParserThread ();
- }
- }
- }
- }
-
- static int parseStatus;
-
- public static bool IsParsing {
- get { return parseStatus > 0; }
- }
-
- static readonly Dictionary<ProjectContentWrapper, ParsingJob> parseQueueIndex = new Dictionary<ProjectContentWrapper, ParsingJob> ();
-
- internal static int PendingJobCount {
- get {
- lock (parseQueueLock) {
- return parseQueueIndex.Count;
- }
- }
- }
-
- static void QueueParseJob (ProjectContentWrapper context, IEnumerable<ProjectFile> fileList = null)
- {
- var job = new ParsingJob {
- Context = context,
- FileList = fileList
- };
- lock (parseQueueLock) {
- RemoveParseJob (context);
- context.BeginLoadOperation ();
- parseQueueIndex [context] = job;
- parseQueue.Enqueue (job);
- parseEvent.Set ();
-
- if (parseQueueIndex.Count == 1)
- queueEmptied.Reset ();
- }
- }
-
- static bool WaitForParseJob (int timeout = 5000)
- {
- return parseEvent.WaitOne (timeout, true);
- }
-
- static ParsingJob DequeueParseJob ()
- {
- lock (parseQueueLock) {
- if (parseQueue.Count > 0) {
- var job = parseQueue.Dequeue ();
- parseQueueIndex.Remove (job.Context);
- return job;
- }
- return null;
- }
- }
-
- internal static void WaitForParseQueue ()
- {
- queueEmptied.WaitOne ();
- }
-
- static void RemoveParseJob (ProjectContentWrapper project)
- {
- lock (parseQueueLock) {
- ParsingJob job;
- if (parseQueueIndex.TryGetValue (project, out job)) {
- parseQueueIndex.Remove (project);
- project.EndLoadOperation ();
- }
- }
- }
-
- static void StartParserThread ()
- {
- lock (parseQueueLock) {
- if (!threadRunning) {
- threadRunning = true;
- var t = new Thread (new ThreadStart (ParserUpdateThread));
- t.Name = "Background parser";
- t.IsBackground = true;
- t.Priority = ThreadPriority.AboveNormal;
- t.Start ();
- }
- }
- }
-
- static void ParserUpdateThread ()
- {
- try {
- while (trackingFileChanges) {
- WaitForParseJob ();
-// CheckModifiedFiles ();
- if (trackingFileChanges)
- ConsumeParsingQueue ();
+ foreach (var w in workspaces) {
+ var documentId = w.GetMonoProject (project);
+ if (documentId != null) {
+ return documentId;
}
- } catch (Exception ex) {
- LoggingService.LogError ("Unhandled error in parsing thread", ex);
}
- lock (parseQueueLock) {
- threadRunning = false;
- if (trackingFileChanges)
- StartParserThread ();
- }
- }
-
- static bool IsFileModified (ProjectFile file, IUnresolvedFile parsedFile)
- {
- if (parsedFile == null || !parsedFile.LastWriteTime.HasValue)
- return true;
- try {
- return File.GetLastWriteTimeUtc (file.FilePath) != parsedFile.LastWriteTime;
- } catch (Exception) {
- return true;
- }
- }
-
- static void CheckModifiedFiles (Project project, ProjectFile[] projectFiles, ProjectContentWrapper content, CancellationToken token = default (CancellationToken))
- {
- if (token.IsCancellationRequested) {
- return;
- }
-// Console.WriteLine ("add modified file check for :" + project.Name);
- content.RunWhenLoaded (delegate(IProjectContent cnt) {
- try {
-// Console.WriteLine ("check for " + project.Name);
- content.BeginLoadOperation ();
- var modifiedFiles = new List<ProjectFile> ();
- var oldFileNewFile = new List<Tuple<ProjectFile, IUnresolvedFile>> ();
- foreach (var file in projectFiles) {
- if (token.IsCancellationRequested) {
- return;
- }
- if (file.BuildAction == null)
- continue;
- // if the file is already inside the content a parser exists for it, if not check if it can be parsed.
- var oldFile = cnt.GetFile (file.Name);
- oldFileNewFile.Add (Tuple.Create (file, oldFile));
- }
-
- // This is disk intensive and slow
- oldFileNewFile.RemoveAll (t => !IsFileModified (t.Item1, t.Item2));
-
- foreach (var v in oldFileNewFile) {
- var file = v.Item1;
- var oldFile = v.Item2;
- if (oldFile == null) {
- var parser = TypeSystemService.GetParser (DesktopService.GetMimeTypeForUri (file.Name), file.BuildAction);
- if (parser == null)
- continue;
- }
- modifiedFiles.Add (file);
- }
- var tags = content.GetExtensionObject <ProjectCommentTags> ();
-
- // check if file needs to be removed from project content
- foreach (var file in cnt.Files) {
- if (token.IsCancellationRequested) {
- return;
- }
- if (project.GetProjectFile (file.FileName) == null) {
- content.UpdateContent (c => c.RemoveFiles (file.FileName));
- content.InformFileRemoved (new ParsedFileEventArgs (file));
- if (tags != null)
- tags.RemoveFile (project, file.FileName);
- }
- }
- if (token.IsCancellationRequested) {
- return;
- }
- if (modifiedFiles.Count > 0) {
- QueueParseJob (content, modifiedFiles);
- WaitForParseJob ();
- }
- } catch (Exception e) {
- LoggingService.LogError ("Exception in check modified files.", e);
- } finally {
- content.EndLoadOperation ();
- }
- });
+ return null;
}
- /// <summary>
- /// Used to store meta data information about the assembly.
- /// </summary>
- [Serializable]
- class AssemblyTag
- {
- public DateTime LastWriteTimeUTC { get; set; }
-
- public AssemblyTag (DateTime lastWriteTimeUTC)
- {
- this.LastWriteTimeUTC = lastWriteTimeUTC;
- }
- }
- static void CheckModifiedFile (UnresolvedAssemblyProxy context)
+ public static MonoDevelop.Projects.Project GetMonoProject (Microsoft.CodeAnalysis.DocumentId documentId)
{
- try {
- string cache = GetCacheDirectory (context.FileName);
- if (cache == null)
- return;
- var assemblyDataDirectory = Path.Combine (cache, "assembly.tag");
- var writeTime = File.GetLastWriteTimeUtc (context.FileName);
- var cacheTime = File.Exists (assemblyDataDirectory) ? DeserializeObject<AssemblyTag> (assemblyDataDirectory) : new AssemblyTag (writeTime);
- if (writeTime != cacheTime.LastWriteTimeUTC) {
- cache = GetCacheDirectory (context.FileName);
- if (cache != null) {
- try {
- // Files will be reloaded by the lazy loader
- File.Delete (assemblyDataDirectory);
- File.Delete (Path.Combine (cache, "assembly.data"));
- } catch {
- }
- context.CtxLoader = new LazyAssemblyLoader (context.FileName, cache);
- }
+ foreach (var w in workspaces) {
+ foreach (var p in w.CurrentSolution.Projects) {
+ if (p.GetDocument (documentId) != null)
+ return GetMonoProject (p);
}
- } catch (Exception e) {
- LoggingService.LogError ("Error while updating assembly " + context.FileName, e);
- }
- }
-
- static void CheckModifiedFiles ()
- {
- Queue<KeyValuePair<Project, ProjectContentWrapper>> list;
-
- lock (projectContentLock) {
- list = new Queue<KeyValuePair<Project, ProjectContentWrapper>> (projectContents);
- }
-
- while (list.Count > 0) {
- var readydb = list.Dequeue ();
- var files = readydb.Key.Files.ToArray ();
- CheckModifiedFiles (readydb.Key, files, readydb.Value);
}
-
- var assemblyList = new Queue<KeyValuePair<string, UnresolvedAssemblyProxy>> (cachedAssemblyContents);
-
- while (assemblyList.Count > 0) {
- var readydb = assemblyList.Dequeue ();
- CheckModifiedFile (readydb.Value);
- }
- }
-
- static void ConsumeParsingQueue ()
- {
- int pending = 0;
- IProgressMonitor monitor = null;
- var token = loadCancellationSource.Token;
- StartParseOperation ();
- try {
- do {
- if (pending > 5 && monitor == null) {
- monitor = GetParseProgressMonitor ();
- monitor.BeginTask (GettextCatalog.GetString ("Generating database"), 0);
- }
- var job = DequeueParseJob ();
- if (job != null) {
- try {
- job.Run (monitor, token);
- } catch (Exception ex) {
- if (monitor == null)
- monitor = GetParseProgressMonitor ();
- monitor.ReportError (null, ex);
- } finally {
- job.Context.EndLoadOperation ();
- }
- }
-
- if (token.IsCancellationRequested)
- break;
- pending = PendingJobCount;
- } while (pending > 0);
- queueEmptied.Set ();
- } finally {
- if (monitor != null)
- monitor.Dispose ();
- EndParseOperation ();
- }
- }
-
- #endregion
-
- }
-
- sealed class AssemblyLoadedEventArgs : EventArgs
- {
- public readonly TypeSystemService.LazyAssemblyLoader Assembly;
-
- public AssemblyLoadedEventArgs (TypeSystemService.LazyAssemblyLoader assembly)
- {
- this.Assembly = assembly;
+ return null;
}
- }
-
- public sealed class ProjectUnloadEventArgs : EventArgs
- {
- public readonly Project Project;
- public readonly TypeSystemService.ProjectContentWrapper Wrapper;
- public ProjectUnloadEventArgs (Project project, TypeSystemService.ProjectContentWrapper wrapper)
- {
- this.Project = project;
- this.Wrapper = wrapper;
- }
}
}
-
-
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService_WorkspaceHandling.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService_WorkspaceHandling.cs
new file mode 100644
index 0000000000..81c4aef5bc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService_WorkspaceHandling.cs
@@ -0,0 +1,485 @@
+//
+// TypeSystemService.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2014 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using Microsoft.CodeAnalysis;
+using MonoDevelop.Core;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+using Mono.Addins;
+using MonoDevelop.Projects;
+using System.IO;
+using System.Linq;
+using System.Collections.Immutable;
+using System.Collections.Concurrent;
+
+namespace MonoDevelop.Ide.TypeSystem
+{
+
+// static class MonoDevelopWorkspaceFeatures
+// {
+// static FeaturePack pack;
+//
+// public static FeaturePack Features {
+// get {
+// if (pack == null)
+// Interlocked.CompareExchange (ref pack, ComputePack (), null);
+// return pack;
+// }
+// }
+//
+// static FeaturePack ComputePack ()
+// {
+// var assemblies = new List<Assembly> ();
+// var workspaceCoreAssembly = typeof(Workspace).Assembly;
+// assemblies.Add (workspaceCoreAssembly);
+//
+// LoadAssembly (assemblies, "Microsoft.CodeAnalysis.CSharp.Workspaces");
+// //LoadAssembly (assemblies, "Microsoft.CodeAnalysis.VisualBasic.Workspaces");
+//
+// var catalogs = assemblies.Select (a => new System.ComponentModel.Composition.Hosting.AssemblyCatalog (a));
+//
+// return new MefExportPack (catalogs);
+// }
+//
+// static void LoadAssembly (List<Assembly> assemblies, string assemblyName)
+// {
+// try {
+// var loadedAssembly = Assembly.Load (assemblyName);
+// assemblies.Add (loadedAssembly);
+// } catch (Exception e) {
+// LoggingService.LogWarning ("Couldn't load assembly:" + assemblyName, e);
+// }
+// }
+// }
+
+ public static partial class TypeSystemService
+ {
+ static readonly MonoDevelopWorkspace emptyWorkspace;
+
+ static object workspaceLock = new object();
+ static ImmutableList<MonoDevelopWorkspace> workspaces = ImmutableList<MonoDevelopWorkspace>.Empty;
+
+ public static ImmutableArray<Microsoft.CodeAnalysis.Workspace> AllWorkspaces {
+ get {
+ return workspaces.ToImmutableArray<Microsoft.CodeAnalysis.Workspace> ();
+ }
+ }
+
+
+ internal static MonoDevelopWorkspace GetWorkspace (MonoDevelop.Projects.Solution solution)
+ {
+ if (solution == null)
+ throw new ArgumentNullException ("solution");
+ foreach (var ws in workspaces) {
+ if (ws.MonoDevelopSolution == solution)
+ return ws;
+ }
+ return emptyWorkspace;
+ }
+
+ internal static MonoDevelopWorkspace GetWorkspace (WorkspaceId id)
+ {
+ foreach (var ws in workspaces) {
+ if (ws.Id.Equals (id))
+ return ws;
+ }
+ return emptyWorkspace;
+ }
+
+ public static Microsoft.CodeAnalysis.Workspace Workspace {
+ get {
+ var solution = IdeApp.ProjectOperations?.CurrentSelectedSolution;
+ if (solution == null)
+ return emptyWorkspace;
+ return GetWorkspace (solution);
+ }
+ }
+
+
+ public static void NotifyFileChange (string fileName, string text)
+ {
+ foreach (var ws in workspaces)
+ ws.UpdateFileContent (fileName, text);
+ }
+
+ internal static Task<List<MonoDevelopWorkspace>> Load (WorkspaceItem item, ProgressMonitor progressMonitor, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (Counters.ParserService.WorkspaceItemLoaded.BeginTiming ()) {
+ var wsList = new List<MonoDevelopWorkspace> ();
+ return InternalLoad (wsList, item, progressMonitor, cancellationToken).ContinueWith (t => { t.Wait (); return wsList; });
+ }
+ }
+
+ static Task InternalLoad (List<MonoDevelopWorkspace> list, MonoDevelop.Projects.WorkspaceItem item, ProgressMonitor progressMonitor, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ return Task.Run (async () => {
+ var ws = item as MonoDevelop.Projects.Workspace;
+ if (ws != null) {
+ foreach (var it in ws.Items) {
+ await InternalLoad (list, it, progressMonitor, cancellationToken);
+ }
+ ws.ItemAdded += OnWorkspaceItemAdded;
+ ws.ItemRemoved += OnWorkspaceItemRemoved;
+ } else {
+ var solution = item as MonoDevelop.Projects.Solution;
+ if (solution != null) {
+ var workspace = new MonoDevelopWorkspace ();
+ list.Add (workspace);
+ workspace.ShowStatusIcon ();
+ lock (workspaceLock)
+ workspaces = workspaces.Add (workspace);
+ await workspace.TryLoadSolution (solution, cancellationToken);
+ solution.SolutionItemAdded += OnSolutionItemAdded;
+ solution.SolutionItemRemoved += OnSolutionItemRemoved;
+ workspace.HideStatusIcon ();
+ }
+ }
+ });
+ }
+
+ internal static void Unload (MonoDevelop.Projects.WorkspaceItem item)
+ {
+ var ws = item as MonoDevelop.Projects.Workspace;
+ if (ws != null) {
+ foreach (var it in ws.Items)
+ Unload (it);
+ ws.ItemAdded -= OnWorkspaceItemAdded;
+ ws.ItemRemoved -= OnWorkspaceItemRemoved;
+ MonoDocDocumentationProvider.ClearCommentCache ();
+ } else {
+ var solution = item as MonoDevelop.Projects.Solution;
+ if (solution != null) {
+ MonoDevelopWorkspace result = GetWorkspace (solution);
+ if (result != emptyWorkspace) {
+ lock (workspaceLock)
+ workspaces = workspaces.Remove (result);
+ result.Dispose ();
+ }
+ solution.SolutionItemAdded -= OnSolutionItemAdded;
+ solution.SolutionItemRemoved -= OnSolutionItemRemoved;
+ if (solution.ParentWorkspace == null)
+ MonoDocDocumentationProvider.ClearCommentCache ();
+ }
+ }
+ }
+
+ public static DocumentId GetDocumentId (MonoDevelop.Projects.Project project, string fileName)
+ {
+ if (project == null)
+ throw new ArgumentNullException ("project");
+ if (fileName == null)
+ throw new ArgumentNullException ("fileName");
+ fileName = FileService.GetFullPath (fileName);
+ foreach (var w in workspaces) {
+ var projectId = w.GetProjectId (project);
+ if (projectId != null)
+ return w.GetDocumentId (projectId, fileName);
+ }
+ return null;
+ }
+
+ public static DocumentId GetDocumentId (Microsoft.CodeAnalysis.Workspace workspace, MonoDevelop.Projects.Project project, string fileName)
+ {
+ if (project == null)
+ throw new ArgumentNullException ("project");
+ if (fileName == null)
+ throw new ArgumentNullException ("fileName");
+ fileName = FileService.GetFullPath (fileName);
+ var projectId = ((MonoDevelopWorkspace)workspace).GetProjectId (project);
+ if (projectId != null) {
+ return ((MonoDevelopWorkspace)workspace).GetDocumentId (projectId, fileName);
+ } else {
+ LoggingService.LogWarning ("Warning can't find " + fileName + " in project " + project.Name + "("+ projectId +")");
+ }
+ return null;
+ }
+
+
+ public static DocumentId GetDocumentId (ProjectId projectId, string fileName)
+ {
+ if (projectId == null)
+ throw new ArgumentNullException ("projectId");
+ if (fileName == null)
+ throw new ArgumentNullException ("fileName");
+ foreach (var w in workspaces) {
+ if (w.Contains (projectId))
+ return w.GetDocumentId (projectId, fileName);
+ }
+ return null;
+ }
+
+ public static IEnumerable<DocumentId> GetDocuments (string fileName)
+ {
+ if (fileName == null)
+ throw new ArgumentNullException ("fileName");
+ fileName = FileService.GetFullPath (fileName);
+ foreach (var w in workspaces) {
+ foreach (var projectId in w.CurrentSolution.ProjectIds) {
+ var docId = w.GetDocumentId (projectId, fileName);
+ if (docId != null)
+ yield return docId;
+ }
+ }
+ }
+
+ public static Microsoft.CodeAnalysis.Project GetCodeAnalysisProject (MonoDevelop.Projects.Project project)
+ {
+ if (project == null)
+ throw new ArgumentNullException ("project");
+ foreach (var w in workspaces) {
+ var projectId = w.GetProjectId (project);
+ if (projectId != null)
+ return w.CurrentSolution.GetProject (projectId);
+ }
+ return null;
+ }
+
+ public static Task<Compilation> GetCompilationAsync (MonoDevelop.Projects.Project project, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (project == null)
+ throw new ArgumentNullException ("project");
+ foreach (var w in workspaces) {
+ var projectId = w.GetProjectId (project);
+ if (projectId == null)
+ continue;
+ var roslynProject = w.CurrentSolution.GetProject (projectId);
+ if (roslynProject == null)
+ continue;
+ return roslynProject.GetCompilationAsync (cancellationToken);
+ }
+ return Task.FromResult<Compilation> (null);
+ }
+
+ static void OnWorkspaceItemAdded (object s, MonoDevelop.Projects.WorkspaceItemEventArgs args)
+ {
+ Task.Run (() => TypeSystemService.Load (args.Item, null));
+ }
+
+ static void OnWorkspaceItemRemoved (object s, MonoDevelop.Projects.WorkspaceItemEventArgs args)
+ {
+ Unload (args.Item);
+ }
+
+ static async void OnSolutionItemAdded (object sender, MonoDevelop.Projects.SolutionItemChangeEventArgs args)
+ {
+ var project = args.SolutionItem as MonoDevelop.Projects.Project;
+ if (project != null) {
+ Unload (project.ParentSolution);
+ await Load (project.ParentSolution, new ProgressMonitor());
+ }
+ }
+
+ static void OnSolutionItemRemoved (object sender, MonoDevelop.Projects.SolutionItemChangeEventArgs args)
+ {
+ var project = args.SolutionItem as MonoDevelop.Projects.Project;
+ var solution = sender as MonoDevelop.Projects.Solution;
+ if (project != null) {
+ var ws = GetWorkspace (solution);
+ ws.RemoveProject (project);
+ }
+ }
+
+ #region Tracked project handling
+ static readonly List<string> outputTrackedProjects = new List<string> ();
+
+ static void IntitializeTrackedProjectHandling ()
+ {
+ AddinManager.AddExtensionNodeHandler ("/MonoDevelop/TypeSystem/OutputTracking", delegate (object sender, ExtensionNodeEventArgs args) {
+ var projectType = ((TypeSystemOutputTrackingNode)args.ExtensionNode).ProjectType;
+ switch (args.Change) {
+ case ExtensionChange.Add:
+ outputTrackedProjects.Add (projectType);
+ break;
+ case ExtensionChange.Remove:
+ outputTrackedProjects.Remove (projectType);
+ break;
+ }
+ });
+ if (IdeApp.ProjectOperations != null)
+ IdeApp.ProjectOperations.EndBuild += HandleEndBuild;
+ if (IdeApp.Workspace != null)
+ IdeApp.Workspace.ActiveConfigurationChanged += HandleActiveConfigurationChanged;
+
+
+ }
+
+ static void HandleEndBuild (object sender, BuildEventArgs args)
+ {
+ var project = args.SolutionItem as DotNetProject;
+ if (project == null)
+ return;
+ CheckProjectOutput (project, true);
+ }
+
+ static void HandleActiveConfigurationChanged (object sender, EventArgs e)
+ {
+ if (IdeApp.ProjectOperations.CurrentSelectedSolution != null) {
+ foreach (var pr in IdeApp.ProjectOperations.CurrentSelectedSolution.GetAllProjects ()) {
+ var project = pr as DotNetProject;
+ if (project != null)
+ CheckProjectOutput (project, true);
+ }
+ }
+ }
+
+ internal static bool IsOutputTrackedProject (DotNetProject project)
+ {
+ if (project == null)
+ throw new ArgumentNullException ("project");
+ return project.GetTypeTags ().Any (p => outputTrackedProjects.Contains (p, StringComparer.OrdinalIgnoreCase));
+ }
+
+ static void CheckProjectOutput (DotNetProject project, bool autoUpdate)
+ {
+ if (project == null)
+ throw new ArgumentNullException ("project");
+ if (IsOutputTrackedProject (project)) {
+ var fileName = project.GetOutputFileName (IdeApp.Workspace.ActiveConfiguration);
+ if (!File.Exists (fileName))
+ return;
+ FileService.NotifyFileChanged (fileName);
+ if (autoUpdate) {
+ // update documents
+ foreach (var openDocument in IdeApp.Workbench.Documents) {
+ openDocument.ReparseDocument ();
+ }
+ }
+ }
+ }
+ #endregion
+
+// TODO: Port framework lookup to NR6
+// #region FrameworkLookup
+// class FrameworkTask
+// {
+// public int RetryCount { get; set; }
+//
+// public Task<FrameworkLookup> Task { get; set; }
+// }
+//
+// readonly static Dictionary<string, FrameworkTask> frameworkLookup = new Dictionary<string, FrameworkTask> ();
+//
+// static void StartFrameworkLookup (DotNetProject netProject)
+// {
+// if (netProject == null)
+// throw new ArgumentNullException ("netProject");
+// lock (frameworkLookup) {
+// FrameworkTask result;
+// if (netProject.TargetFramework == null)
+// return;
+// var frameworkName = netProject.TargetFramework.Name;
+// if (!frameworkLookup.TryGetValue (frameworkName, out result))
+// frameworkLookup [frameworkName] = result = new FrameworkTask ();
+// if (result.Task != null)
+// return;
+// result.Task = Task.Factory.StartNew (delegate {
+// return GetFrameworkLookup (netProject);
+// });
+// }
+// }
+//
+// public static bool TryGetFrameworkLookup (DotNetProject project, out FrameworkLookup lookup)
+// {
+// lock (frameworkLookup) {
+// FrameworkTask result;
+// if (frameworkLookup.TryGetValue (project.TargetFramework.Name, out result)) {
+// if (!result.Task.IsCompleted) {
+// lookup = null;
+// return false;
+// }
+// lookup = result.Task.Result;
+// return true;
+// }
+// }
+// lookup = null;
+// return false;
+// }
+//
+// public static bool RecreateFrameworkLookup (DotNetProject netProject)
+// {
+// lock (frameworkLookup) {
+// FrameworkTask result;
+// var frameworkName = netProject.TargetFramework.Name;
+// if (!frameworkLookup.TryGetValue (frameworkName, out result))
+// return false;
+// if (result.RetryCount > 5) {
+// LoggingService.LogError ("Can't create framework lookup for:" + frameworkName);
+// return false;
+// }
+// result.RetryCount++;
+// LoggingService.LogInfo ("Trying to recreate framework lookup for {0}, try {1}.", frameworkName, result.RetryCount);
+// result.Task = null;
+// StartFrameworkLookup (netProject);
+// return true;
+// }
+// }
+//
+// static FrameworkLookup GetFrameworkLookup (DotNetProject netProject)
+// {
+// FrameworkLookup result;
+// string fileName;
+// var cache = GetCacheDirectory (netProject.TargetFramework);
+// fileName = Path.Combine (cache, "FrameworkLookup_" + FrameworkLookup.CurrentVersion + ".dat");
+// try {
+// if (File.Exists (fileName)) {
+// result = FrameworkLookup.Load (fileName);
+// if (result != null) {
+// return result;
+// }
+// }
+// } catch (Exception e) {
+// LoggingService.LogWarning ("Can't read framework cache - recreating...", e);
+// }
+//
+// try {
+// using (var creator = FrameworkLookup.Create (fileName)) {
+// foreach (var assembly in GetFrameworkAssemblies (netProject)) {
+// var ctx = LoadAssemblyContext (assembly.Location);
+// foreach (var type in ctx.Ctx.GetAllTypeDefinitions ()) {
+// if (!type.IsPublic)
+// continue;
+// creator.AddLookup (assembly.Package.Name, assembly.FullName, type);
+// }
+// }
+// }
+// } catch (Exception e) {
+// LoggingService.LogError ("Error while storing framework lookup", e);
+// return FrameworkLookup.Empty;
+// }
+//
+// try {
+// result = FrameworkLookup.Load (fileName);
+// return result;
+// } catch (Exception e) {
+// LoggingService.LogError ("Error loading framework lookup", e);
+// return FrameworkLookup.Empty;
+// }
+// }
+// #endregion
+ }
+
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/WorkspaceId.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/WorkspaceId.cs
new file mode 100644
index 0000000000..e916da8960
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/WorkspaceId.cs
@@ -0,0 +1,70 @@
+//
+// WorkspaceId.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+
+namespace MonoDevelop.Ide.TypeSystem
+{
+ struct WorkspaceId
+ {
+ static uint n = 0;
+
+ public readonly uint Number;
+ public readonly DateTime DateTime;
+
+ public static WorkspaceId Empty = new WorkspaceId (0, default(DateTime));
+
+ WorkspaceId (uint number, DateTime dateTime) : this()
+ {
+ this.Number = number;
+ this.DateTime = dateTime;
+ }
+
+ public static WorkspaceId Next()
+ {
+ return new WorkspaceId (n++, DateTime.UtcNow);
+ }
+
+ public override bool Equals (object obj)
+ {
+ if (obj == null)
+ return false;
+ if (ReferenceEquals (this, obj))
+ return true;
+ if (obj.GetType () != typeof(WorkspaceId))
+ return false;
+ WorkspaceId other = (WorkspaceId)obj;
+ return Number == other.Number && DateTime == other.DateTime;
+ }
+
+ public override int GetHashCode ()
+ {
+ unchecked {
+ return Number.GetHashCode () ^ DateTime.GetHashCode ();
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs
index 29abd4d559..6e7c337024 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/AddinsUpdateHandler.cs
@@ -32,7 +32,8 @@ using Mono.Addins.Gui;
using MonoDevelop.Ide.ProgressMonitoring;
using Mono.Addins;
using MonoDevelop.Core.Setup;
-using Mono.TextEditor;
+using System.Threading.Tasks;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.Updater
{
@@ -42,27 +43,34 @@ namespace MonoDevelop.Ide.Updater
AddinRepositoryEntry[] updates;
static StatusBarIcon updateIcon;
internal static AddinsUpdateHandler Instance;
- IProgressMonitor updateMonitor;
+
+ ProgressMonitor updateMonitor;
+ Task currentTask = null;
public AddinsUpdateHandler ()
{
Instance = this;
}
- public void CheckUpdates (IProgressMonitor monitor, bool automatic)
+ public async Task CheckUpdates (ProgressMonitor monitor, bool automatic)
{
updateMonitor = monitor;
try {
if (UpdateService.UpdateLevel == UpdateLevel.Test)
Runtime.AddinSetupService.RegisterMainRepository (UpdateLevel.Test, true);
- using (ProgressStatusMonitor pm = new ProgressStatusMonitor (monitor)) {
- Runtime.AddinSetupService.Repositories.UpdateAllRepositories (pm);
- updates = Runtime.AddinSetupService.Repositories.GetAvailableUpdates ();
- if (updates.Length > 0)
- DispatchService.GuiDispatch (new MessageHandler (WarnAvailableUpdates));
- }
+
+ currentTask = Task.Run (delegate {
+ using (ProgressStatusMonitor pm = new ProgressStatusMonitor (monitor)) {
+ Runtime.AddinSetupService.Repositories.UpdateAllRepositories (pm);
+ updates = Runtime.AddinSetupService.Repositories.GetAvailableUpdates ();
+ }
+ });
+ await currentTask;
+ if (updates.Length > 0)
+ WarnAvailableUpdates ();
} finally {
updateMonitor = null;
+ currentTask = null;
}
}
@@ -70,8 +78,8 @@ namespace MonoDevelop.Ide.Updater
{
if (!UpdateService.NotifyAddinUpdates)
return;
-
- updateIcon = IdeApp.Workbench.StatusBar.ShowStatusIcon (ImageService.GetIcon ("md-updates", IconSize.Menu));
+
+ updateIcon = IdeApp.Workbench.StatusBar.ShowStatusIcon (ImageService.GetIcon (Gui.Stock.Updates, IconSize.Menu));
string s = GettextCatalog.GetString ("New add-in updates are available:");
for (int n=0; n<updates.Length && n < 10; n++)
s += "\n" + updates [n].Addin.Name;
@@ -86,32 +94,26 @@ namespace MonoDevelop.Ide.Updater
void OnUpdateClicked (object s, StatusBarIconClickedEventArgs args)
{
- if (args.Button != Xwt.PointerButton.Right && args.Button == Xwt.PointerButton.Left) {
+ if (args.Button == Xwt.PointerButton.Left) {
HideAlert ();
AddinManagerWindow.Run (IdeApp.Workbench.RootWindow);
}
}
- public static void ShowManager ()
+ public async static void ShowManager ()
{
- IProgressMonitor m = Instance != null ? Instance.updateMonitor : null;
- if (m != null && !m.AsyncOperation.IsCompleted) {
- AggregatedProgressMonitor monitor = new AggregatedProgressMonitor (m);
- monitor.AddSlaveMonitor (new MessageDialogProgressMonitor (true, true, false));
- monitor.AsyncOperation.WaitForCompleted ();
+ Task t = Instance != null ? Instance.currentTask : null;
+
+ if (t != null && t.IsCompleted) {
+ AggregatedProgressMonitor monitor = new AggregatedProgressMonitor (Instance.updateMonitor);
+ monitor.AddFollowerMonitor (new MessageDialogProgressMonitor (true, true, false));
+ await t;
}
HideAlert ();
AddinManagerWindow.Run (IdeApp.Workbench.RootWindow);
}
- internal void QueryAddinUpdates ()
- {
- IProgressMonitor monitor = updateMonitor;
- if (monitor != null)
- monitor.AsyncOperation.WaitForCompleted ();
- }
-
public static void HideAlert ()
{
if (updateIcon != null) {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/IUpdateHandler.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/IUpdateHandler.cs
index 5b912d6dc4..a4fc5d1889 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/IUpdateHandler.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/IUpdateHandler.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System;
using MonoDevelop.Core;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Updater
{
@@ -40,7 +41,7 @@ namespace MonoDevelop.Ide.Updater
/// 'True' if the check has been automatically started by MD (e.g. when MD starts).
/// 'False' if the check was started explicitly by the user.
/// </param>
- void CheckUpdates (IProgressMonitor monitor, bool automatic);
+ Task CheckUpdates (ProgressMonitor monitor, bool automatic);
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/UpdateService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/UpdateService.cs
index 5c4855320f..7e00179678 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/UpdateService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Updater/UpdateService.cs
@@ -30,6 +30,7 @@ using System;
using Mono.Addins;
using MonoDevelop.Core.ProgressMonitoring;
using System.Threading;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide.Updater
{
@@ -128,22 +129,21 @@ namespace MonoDevelop.Ide.Updater
CheckForUpdates (false);
}
- static void CheckForUpdates (bool automatic)
+ static async void CheckForUpdates (bool automatic)
{
+ if (automatic && !AutoCheckForUpdates)
+ return;
+
PropertyService.Set ("MonoDevelop.Ide.AddinUpdater.LastCheck", DateTime.Now);
PropertyService.SaveProperties ();
var handlers = AddinManager.GetExtensionObjects ("/MonoDevelop/Ide/Updater/UpdateHandlers");
- IProgressMonitor mon = IdeApp.Workbench.ProgressMonitors.GetBackgroundProgressMonitor ("Looking for updates", "md-updates");
+ ProgressMonitor mon = IdeApp.Workbench.ProgressMonitors.GetBackgroundProgressMonitor ("Looking for updates", "md-updates");
- Thread t = new Thread (delegate () {
- CheckUpdates (mon, handlers, automatic);
- });
- t.Name = "Addin updater";
- t.Start ();
+ await CheckUpdates (mon, handlers, automatic);
}
- static void CheckUpdates (IProgressMonitor monitor, object[] handlers, bool automatic)
+ static async Task CheckUpdates (ProgressMonitor monitor, object[] handlers, bool automatic)
{
using (monitor) {
// The handler to use is the last one declared in the extension point
@@ -151,7 +151,7 @@ namespace MonoDevelop.Ide.Updater
return;
try {
IUpdateHandler uh = (IUpdateHandler) handlers [handlers.Length - 1];
- uh.CheckUpdates (monitor, automatic);
+ await uh.CheckUpdates (monitor, automatic);
} catch (Exception ex) {
LoggingService.LogError ("Updates check failed for handler of type '" + handlers [handlers.Length - 1].GetType () + "'", ex);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/DefaultWelcomePage.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/DefaultWelcomePage.cs
index 7966655f10..c07a19f487 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/DefaultWelcomePage.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/DefaultWelcomePage.cs
@@ -29,12 +29,12 @@ using Gtk;
namespace MonoDevelop.Ide.WelcomePage
{
- public class DefaultWelcomePage: WelcomePageWidget
+ class DefaultWelcomePage: WelcomePageWidget
{
protected override void BuildContent (Container parent)
{
- LogoImage = Xwt.Drawing.Image.FromResource ("WelcomePage_Logo.png");
- TopBorderImage = Xwt.Drawing.Image.FromResource ("WelcomePage_TopBorderRepeat.png");
+ LogoImage = Xwt.Drawing.Image.FromResource ("welcome-logo.png");
+ TopBorderImage = Xwt.Drawing.Image.FromResource ("welcome-tile.png");
var mainAlignment = new Gtk.Alignment (0.5f, 0.5f, 0f, 1f);
@@ -43,10 +43,10 @@ namespace MonoDevelop.Ide.WelcomePage
var row1 = new WelcomePageRow ();
row1.PackStart (new WelcomePageButtonBar (
- new WelcomePageBarButton ("MonoDevelop.com", "http://www.monodevelop.com", "link-cloud.png"),
- new WelcomePageBarButton (GettextCatalog.GetString ("Documentation"), "http://www.go-mono.com/docs", "link-info.png"),
- new WelcomePageBarButton (GettextCatalog.GetString ("Support"), "http://monodevelop.com/index.php?title=Help_%26_Contact", "link-heart.png"),
- new WelcomePageBarButton (GettextCatalog.GetString ("Q&A"), "http://stackoverflow.com/questions/tagged/monodevelop", "link-chat.png")
+ new WelcomePageBarButton ("MonoDevelop.com", "http://www.monodevelop.com", "welcome-link-md-16.png"),
+ new WelcomePageBarButton (GettextCatalog.GetString ("Documentation"), "http://www.go-mono.com/docs", "welcome-link-info-16.png"),
+ new WelcomePageBarButton (GettextCatalog.GetString ("Support"), "http://monodevelop.com/index.php?title=Help_%26_Contact", "welcome-link-support-16.png"),
+ new WelcomePageBarButton (GettextCatalog.GetString ("Q&A"), "http://stackoverflow.com/questions/tagged/monodevelop", "welcome-link-chat-16.png")
)
);
mainCol.PackStart (row1, false, false, 0);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/IWelcomePageProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/IWelcomePageProvider.cs
index 5ac8884424..541b690441 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/IWelcomePageProvider.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/IWelcomePageProvider.cs
@@ -25,13 +25,14 @@
// THE SOFTWARE.
using System;
using Mono.Addins;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide.WelcomePage
{
[TypeExtensionPoint]
public interface IWelcomePageProvider
{
- Gtk.Widget CreateWidget ();
+ Control CreateWidget ();
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/Style.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/Style.cs
index 3fa2c6ec1a..d2cbd3b799 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/Style.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/Style.cs
@@ -1,4 +1,5 @@
using System;
+using MonoDevelop.Core;
namespace MonoDevelop.Ide.WelcomePage
{
@@ -6,54 +7,59 @@ namespace MonoDevelop.Ide.WelcomePage
{
public static class WelcomeScreen
{
- public const string FontFamilyMac = "Lucida Grande";
- public const string FontFamilyWindows = "Calibri"; // TODO: VV: "Segoe UI"
- public const int VerticalPadding = 24;
- public const int HorizontalPadding = 50;
- public const string BackgroundTile = "./images/tiny_grid.png";
- public const string InnerShadowColor = "black";
- public const double InnerShadowOpacity = 0.4;
- public const int InnerShadowSize = 10;
- public static int Spacing = 20;
+ public const string FontFamilyMac = "Sans";
+ public const string FontFamilyWindows = "Sans";
+ public const int VerticalPadding = 24; // TODO: VV: Seems to be unused
+ public const int HorizontalPadding = 50; // TODO: VV: Seems to be unused
+ public static string BackgroundColor { get; internal set; }
+ public const string BackgroundTile = "./images/tiny_grid.png"; // TODO: VV: Seems to be unused
+ public static string InnerShadowColor { get; internal set; }
+ public const double InnerShadowOpacity = 0.4; // TODO: VV: Seems to be unused
+ public const int InnerShadowSize = 10; // TODO: VV: Seems to be unused
+ public static int Spacing = 30; // space between header and pads
public static class Links
{
- public const string Color = "#555555";
- public const string HoverColor = "#000000";
- public const int FontSize = 16;
- public const int LinkSeparation = 24;
- public const int BottomMargin = 24;
- public const int IconTextSpacing = 8;
+ public static string Color { get; internal set; }
+ public static string HoverColor { get; internal set; }
+ public const int FontSize = 12;
+ public const int LinkSeparation = 30;
+ public const int BottomMargin = 24; // TODO: VV: Seems to be unused
+ public const int IconTextSpacing = 4;
}
public static class Pad
{
- public const string TitleFontFamilyMac = "Lucida Grande";
- public const string TitleFontFamilyWindows = "Calibri"; // TODO: VV: "Segoe UI"
+ public const string TitleFontFamilyMac = "Sans";
+ public const string TitleFontFamilyWindows = "Sans";
public const int Padding = 20;
- public const string BackgroundColor = "#FFF";
- public const string BorderColor = "#CCC";
- public const string TextColor = "#555555";
- public const string ShadowColor = "#000";
- public const double ShadowOpacity = 0.2;
- public const int ShadowSize = 3;
+ public static string BackgroundColor { get; internal set; }
+ public static string BorderColor { get; internal set; }
+ public static string TextColor { get; internal set; }
+ public static string ShadowColor { get; internal set; }
+ public const double ShadowOpacity = 0.2; // TODO: VV: Seems to be unused
+ public const int ShadowSize = 2;
public const int ShadowVerticalOffset = 1;
- public const int LargeTitleFontSize = 22;
- public const string LargeTitleFontColor = "#444444";
- public const int LargeTitleMarginBottom = 10;
- public const string MediumTitleColor = "#222222";
- public const int MediumTitleFontSize = 15;
- public const int MediumTitleMarginBottom = 2;
- public const string SmallTitleColor = "#777777";
- public const int SmallTitleFontSize = 13;
- public const int SummaryFontSize = 12;
- public const string SummaryFontFamily = "Arial"; // TODO: VV: "Segoe UI"
- public const int SummaryLineHeight = 19;
+
+ public static int LargeTitleFontSize = Platform.IsLinux ? 24 : 22;
+ public static string LargeTitleFontColor { get; internal set; }
+ public const int LargeTitleMarginBottom = 22;
+
+ public static string MediumTitleColor { get; internal set; }
+ public static int MediumTitleFontSize = Platform.IsLinux ? 13 : 12;
+ public const int MediumTitleMarginBottom = 7;
+
+ public static string SmallTitleColor { get; internal set; }
+ public static int SmallTitleFontSize = Platform.IsLinux ? 11 : 10;
+
+ public static int SummaryFontSize = Platform.IsLinux ? 12 : 11;
+ public const string SummaryFontFamily = "Sans";
+ public const int SummaryLineHeight = 19; // TODO: VV: Seems to be unused
public const int SummaryParagraphMarginTop = 8;
public static class FeaturedApp
{
- public const int Width = 400;
+ public const int Width = 370;
public static class Preview
{
@@ -63,13 +69,12 @@ namespace MonoDevelop.Ide.WelcomePage
public static class News
{
- public const int Width = 500;
+ public const int Width = 470;
public static class Item
{
public const int MarginBottom = 26;
- public const string TitleHoverColor = "#0982B3";
- public const int FirstMarginTop = 18;
+ public static string TitleHoverColor { get; internal set; }
}
}
@@ -81,23 +86,80 @@ namespace MonoDevelop.Ide.WelcomePage
{
public const int Width = 260;
public const int Height = 46;
- public const string HoverBackgroundColor = "#f9feff";
- public const string HoverBorderColor = "#dddddd";
+ public static string HoverBackgroundColor { get; internal set; }
+ public static string HoverBorderColor { get; internal set; }
public const int TitleFontSize = 12;
- public const int PathFontSize = 11;
+ public const int PathFontSize = 10;
public const int TextLeftPadding = 38;
- public const int TitleBottomMargin = 0;
+ public const int TitleBottomMargin = 4;
+ // TODO: VV: Seems to be unused
public static class PinButton
{
- public const string NormalImage = "unstar-overlay-16.png";
- public const string NormalHoverImage = "unstar-overlay-hover-16.png";
- public const string PinnedImage = "star-overlay-16.png";
- public const string PinnedHoverImage = "star-overlay-hover-16.png";
+ public const string NormalImage = "unstar-16.png";
+ public const string NormalHoverImage = "unstar-hover-16.png";
+ public const string PinnedImage = "star-16.png";
+ public const string PinnedHoverImage = "star-hover-16.png";
}
}
}
}
+
+ static WelcomeScreen ()
+ {
+ LoadStyles ();
+ MonoDevelop.Ide.Gui.Styles.Changed += (o, e) => LoadStyles ();
+ }
+
+ public static void LoadStyles ()
+ {
+ var bgColor = Gui.Styles.BaseBackgroundColor.ToHexString (false);
+ var fgColor = Gui.Styles.BaseForegroundColor.ToHexString (false);
+ var dimColor = Gui.Styles.DimTextColor.ToHexString (false);
+ var padColor = Gui.Styles.PadBackground.ToHexString (false);
+ var hoverColor = Gui.Styles.DockBarPrelightColor.ToHexString (false);
+
+ if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light) {
+ BackgroundColor = bgColor;
+ InnerShadowColor = bgColor;
+
+ Links.Color = dimColor;
+ Links.HoverColor = fgColor;
+
+ Pad.BackgroundColor = padColor;
+ Pad.BorderColor = padColor;
+ Pad.TextColor = fgColor;
+ Pad.ShadowColor = "#000000";
+ Pad.LargeTitleFontColor = fgColor;
+ Pad.MediumTitleColor = fgColor;
+ Pad.SmallTitleColor = dimColor;
+
+ Pad.News.Item.TitleHoverColor = "#3496d9";
+
+ Pad.Solutions.SolutionTile.HoverBackgroundColor = hoverColor;
+ Pad.Solutions.SolutionTile.HoverBorderColor = hoverColor;
+ } else {
+ // TODO: VV: A beeter background, for some peculiar reason only black works here
+ BackgroundColor = "#000000";
+ InnerShadowColor = "#000000";
+
+ Links.Color = "#868686";
+ Links.HoverColor = fgColor;
+
+ Pad.BackgroundColor = "#222222"; // TODO: VV: We can't use the padColor here because of the BackgroundColor bug, so override
+ Pad.BorderColor = "#222222";
+ Pad.TextColor = fgColor;
+ Pad.ShadowColor = "#000000";
+ Pad.LargeTitleFontColor = fgColor;
+ Pad.MediumTitleColor = fgColor;
+ Pad.SmallTitleColor = dimColor;
+
+ Pad.News.Item.TitleHoverColor = "#5babed";
+
+ Pad.Solutions.SolutionTile.HoverBackgroundColor = "#2b3e50";
+ Pad.Solutions.SolutionTile.HoverBorderColor = "#2b3e50";
+ }
+ }
}
public static string GetFormatString (string fontFace, int fontSize, string color, Pango.Weight weight = Pango.Weight.Normal)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageBarButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageBarButton.cs
index a2a4e777ae..e38918156b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageBarButton.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageBarButton.cs
@@ -74,10 +74,7 @@ namespace MonoDevelop.Ide.WelcomePage
public WelcomePageBarButton (string title, string href, string iconResource = null)
{
- FontFamily = Platform.IsMac ? Styles.WelcomeScreen.FontFamilyMac : Styles.WelcomeScreen.FontFamilyWindows;
- HoverColor = Styles.WelcomeScreen.Links.HoverColor;
- Color = Styles.WelcomeScreen.Links.Color;
- FontSize = Styles.WelcomeScreen.Links.FontSize;
+ UpdateStyle ();
VisibleWindow = false;
this.Text = GettextCatalog.GetString (title);
@@ -98,11 +95,33 @@ namespace MonoDevelop.Ide.WelcomePage
box.ShowAll ();
Add (box);
+ Gui.Styles.Changed += UpdateStyle;
Update ();
Events |= (Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.ButtonReleaseMask);
}
+ void UpdateStyle (object sender = null, EventArgs e = null)
+ {
+ OnUpdateStyle ();
+ if (label != null) {
+ box.Remove (label);
+ box.PackStart (label = CreateLabel ());
+ box.ShowAll ();
+ Update ();
+ }
+ QueueResize ();
+ }
+
+ protected virtual void OnUpdateStyle ()
+ {
+ FontFamily = Platform.IsMac ? Styles.WelcomeScreen.FontFamilyMac : Styles.WelcomeScreen.FontFamilyWindows;
+ HoverColor = Styles.WelcomeScreen.Links.HoverColor;
+ Color = Styles.WelcomeScreen.Links.Color;
+ FontSize = Styles.WelcomeScreen.Links.FontSize;
+ FontWeight = Pango.Weight.Bold;
+ }
+
protected virtual Label CreateLabel ()
{
return new Label ();
@@ -161,6 +180,12 @@ namespace MonoDevelop.Ide.WelcomePage
var color = mouseOver ? HoverColor : Color;
label.Markup = WelcomePageSection.FormatText (FontFamily, FontSize, FontWeight, color, Text);
}
+
+ protected override void OnDestroyed ()
+ {
+ Gui.Styles.Changed -= UpdateStyle;
+ base.OnDestroyed ();
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFeedItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFeedItem.cs
index 566dc900ec..0e62e2707e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFeedItem.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFeedItem.cs
@@ -30,15 +30,16 @@ using MonoDevelop.Core;
using System.Xml.Linq;
using System.Text.RegularExpressions;
using MonoDevelop.Components;
+using System.Text;
namespace MonoDevelop.Ide.WelcomePage
{
class WelcomePageFeedItem : Gtk.EventBox
{
- static readonly string linkUnderlinedFormat;
- static readonly string linkFormat;
- static readonly string descFormat;
- static readonly string subtitleFormat;
+ static string linkUnderlinedFormat;
+ static string linkFormat;
+ static string descFormat;
+ static string subtitleFormat;
Label titleLabel;
Label subtitleLabel;
@@ -55,9 +56,15 @@ namespace MonoDevelop.Ide.WelcomePage
static WelcomePageFeedItem ()
{
+ UpdateStyle ();
+ Gui.Styles.Changed += (sender, e) => UpdateStyle();
+ }
+
+ static void UpdateStyle ()
+ {
var face = Platform.IsMac ? Styles.WelcomeScreen.Pad.TitleFontFamilyMac : Styles.WelcomeScreen.Pad.TitleFontFamilyWindows;
- linkUnderlinedFormat = Styles.GetFormatString (face, Styles.WelcomeScreen.Pad.MediumTitleFontSize, Styles.WelcomeScreen.Pad.News.Item.TitleHoverColor);
- linkFormat = Styles.GetFormatString (face, Styles.WelcomeScreen.Pad.MediumTitleFontSize, Styles.WelcomeScreen.Pad.MediumTitleColor);
+ linkUnderlinedFormat = Styles.GetFormatString (face, Styles.WelcomeScreen.Pad.MediumTitleFontSize, Styles.WelcomeScreen.Pad.News.Item.TitleHoverColor, Pango.Weight.Bold);
+ linkFormat = Styles.GetFormatString (face, Styles.WelcomeScreen.Pad.MediumTitleFontSize, Styles.WelcomeScreen.Pad.MediumTitleColor, Pango.Weight.Bold);
descFormat = Styles.GetFormatString (Styles.WelcomeScreen.Pad.SummaryFontFamily, Styles.WelcomeScreen.Pad.SummaryFontSize, Styles.WelcomeScreen.Pad.TextColor);
subtitleFormat = Styles.GetFormatString (face, Styles.WelcomeScreen.Pad.SmallTitleFontSize, Styles.WelcomeScreen.Pad.SmallTitleColor);
}
@@ -170,6 +177,13 @@ namespace MonoDevelop.Ide.WelcomePage
summaryLabel.Attributes.Insert (rise);
Add (box);
+
+ Gui.Styles.Changed += UpdateStyle;
+ }
+
+ void UpdateStyle (object sender, EventArgs args)
+ {
+ UpdateLabel (false);
}
int allocWidth;
@@ -265,7 +279,39 @@ namespace MonoDevelop.Ide.WelcomePage
{
titleLabel.Markup = string.Format (underlined? linkUnderlinedFormat : linkFormat, GLib.Markup.EscapeText (text));
subtitleLabel.Markup = string.Format (subtitleFormat, GLib.Markup.EscapeText (subtitle ?? ""));
- summaryLabel.Markup = string.Format (descFormat, (desc ?? "").Replace ("\n"," "));
+ summaryLabel.Markup = string.Format (descFormat, SummaryHtmlToPango(desc ?? ""));
+ }
+
+ public static string SummaryHtmlToPango(string summaryHtml)
+ {
+ var result = new StringBuilder ();
+ bool inTag = false;
+ for (int i = 0; i < summaryHtml.Length; i++) {
+ char ch = summaryHtml [i];
+ if (inTag) {
+ if (ch == '>')
+ inTag = false;
+ continue;
+ }
+ switch (ch) {
+ case '\n':
+ result.Append (" ");
+ break;
+ case '<':
+ inTag = true;
+ break;
+ case '\'':
+ result.Append ("&apos;");
+ break;
+ case '"':
+ result.Append ("&quot;");
+ break;
+ default:
+ result.Append (ch);
+ break;
+ }
+ }
+ return result.ToString ();
}
void UpdateImage ()
@@ -332,5 +378,11 @@ namespace MonoDevelop.Ide.WelcomePage
return GettextCatalog.GetString ("Open {0}", link);
}
}
+
+ protected override void OnDestroyed ()
+ {
+ Gui.Styles.Changed -= UpdateStyle;
+ base.OnDestroyed ();
+ }
}
} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFirstRun.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFirstRun.cs
index 2f4d880a34..f9b2b67ea8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFirstRun.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageFirstRun.cs
@@ -31,7 +31,6 @@ using MonoDevelop.Ide.Gui;
using MonoDevelop.Components;
using System.Collections.Generic;
using Xwt.Motion;
-using Mono.TextEditor;
namespace MonoDevelop.Ide.WelcomePage
{
@@ -46,7 +45,6 @@ namespace MonoDevelop.Ide.WelcomePage
static readonly Gdk.Point IconPosition = new Gdk.Point (WidgetSize.Width - 220 - Padding, WidgetSize.Height / 2);
static readonly double PreviewSize = 350;
- Xwt.Drawing.Image starburst;
Xwt.Drawing.Image brandedIcon;
MouseTracker tracker;
@@ -81,7 +79,6 @@ namespace MonoDevelop.Ide.WelcomePage
{
VisibleWindow = false;
SetSizeRequest (WidgetSize.Width, WidgetSize.Height);
- starburst = Xwt.Drawing.Image.FromResource ("starburst.png");
string iconFile = BrandingService.GetString ("ApplicationIcon");
if (iconFile != null) {
@@ -143,16 +140,9 @@ namespace MonoDevelop.Ide.WelcomePage
context.FillPreserve ();
}
- context.Save ();
- context.Translate (IconPosition.X, IconPosition.Y);
- context.Scale (0.75, 0.75);
- context.DrawImage (this, starburst, -starburst.Width / 2, -starburst.Height / 2);
- context.Restore ();
-
context.LineWidth = 1;
context.SetSourceRGB (.29, .47, .67);
context.Stroke ();
-
}
void RenderPreview (Cairo.Context context, Gdk.Point position, double opacity)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageLinkButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageLinkButton.cs
index eb58a182f5..57a108444d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageLinkButton.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageLinkButton.cs
@@ -184,9 +184,9 @@ namespace MonoDevelop.Ide.WelcomePage
void DispatchLink (string uri)
{
try {
- if (uri.StartsWith ("project://")) {
+ if (uri.StartsWith ("project://")) {
string file = uri.Substring ("project://".Length);
- Gdk.ModifierType mtype = Mono.TextEditor.GtkWorkarounds.GetCurrentKeyModifiers ();
+ Gdk.ModifierType mtype = GtkWorkarounds.GetCurrentKeyModifiers ();
bool inWorkspace = (mtype & Gdk.ModifierType.ControlMask) != 0;
IdeApp.Workspace.OpenWorkspaceItem (file, !inWorkspace);
} else if (uri.StartsWith ("monodevelop://")) {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs
index ec6e00a91a..13440f647e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageListButton.cs
@@ -27,7 +27,6 @@ using System;
using MonoDevelop.Core;
using MonoDevelop.Components;
using Gtk;
-using Mono.TextEditor;
namespace MonoDevelop.Ide.WelcomePage
{
@@ -58,93 +57,24 @@ namespace MonoDevelop.Ide.WelcomePage
public int LeftTextPadding { get; set; }
public int InternalPadding { get; set; }
+ public string SmallTitleColor { get; set; }
+ public string MediumTitleColor { get; set; }
- string smallTitleColor = Styles.WelcomeScreen.Pad.SmallTitleColor;
- public string SmallTitleColor {
- get {
- return smallTitleColor;
- }
- set {
- smallTitleColor = value;
- }
- }
-
- string mediumTitleColor = Styles.WelcomeScreen.Pad.MediumTitleColor;
- public string MediumTitleColor {
- get {
- return mediumTitleColor;
- }
- set {
- mediumTitleColor = value;
- }
- }
-
- string titleFontFace = Platform.IsMac ? Styles.WelcomeScreen.Pad.TitleFontFamilyMac : Styles.WelcomeScreen.Pad.TitleFontFamilyWindows;
- public string TitleFontFace {
- get {
- return titleFontFace;
- }
- set {
- titleFontFace = value;
- }
- }
-
- string smallTitleFontFace = Platform.IsMac ? Styles.WelcomeScreen.Pad.TitleFontFamilyMac : Styles.WelcomeScreen.Pad.TitleFontFamilyWindows;
- public string SmallTitleFontFace {
- get {
- return smallTitleFontFace;
- }
- set {
- smallTitleFontFace = value;
- }
- }
+ public string TitleFontFace { get; set; }
+ public string SmallTitleFontFace { get; set; }
- string hoverBackgroundColor = Styles.WelcomeScreen.Pad.Solutions.SolutionTile.HoverBackgroundColor;
- public string HoverBackgroundColor {
- get {
- return hoverBackgroundColor;
- }
- set {
- hoverBackgroundColor = value;
- }
- }
-
- string hoverBorderColor = Styles.WelcomeScreen.Pad.Solutions.SolutionTile.HoverBorderColor;
- public string HoverBorderColor {
- get {
- return hoverBorderColor;
- }
- set {
- hoverBorderColor = value;
- }
- }
-
- int titleFontSize = Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TitleFontSize;
- public int TitleFontSize {
- get {
- return titleFontSize;
- }
- set {
- titleFontSize = value;
- }
- }
+ public string HoverBackgroundColor { get; set; }
+ public string HoverBorderColor { get; set; }
- int smallTitleFontSize = Styles.WelcomeScreen.Pad.Solutions.SolutionTile.PathFontSize;
- public int SmallTitleFontSize {
- get {
- return smallTitleFontSize;
- }
- set {
- smallTitleFontSize = value;
- }
- }
+ public int TitleFontSize { get; set; }
+ public int SmallTitleFontSize { get; set; }
static WelcomePageListButton ()
{
- starNormal = Xwt.Drawing.Image.FromResource ("unstar-overlay-16.png");
- starNormalHover = Xwt.Drawing.Image.FromResource ("unstar-overlay-hover-16.png");
- starPinned = Xwt.Drawing.Image.FromResource ("star-overlay-16.png");
- starPinnedHover = Xwt.Drawing.Image.FromResource ("star-overlay-hover-16.png");
+ starNormal = Xwt.Drawing.Image.FromResource ("unstar-16.png");
+ starNormalHover = Xwt.Drawing.Image.FromResource ("unstar-hover-16.png");
+ starPinned = Xwt.Drawing.Image.FromResource ("star-16.png");
+ starPinnedHover = Xwt.Drawing.Image.FromResource ("star-hover-16.png");
}
public WelcomePageListButton (string title, string subtitle, Xwt.Drawing.Image icon, string actionUrl)
@@ -154,14 +84,37 @@ namespace MonoDevelop.Ide.WelcomePage
this.subtitle = subtitle;
this.icon = icon;
this.actionUrl = actionUrl;
- this.SmallTitleColor = smallTitleColor;
- this.MediumTitleColor = mediumTitleColor;
+
WidthRequest = Styles.WelcomeScreen.Pad.Solutions.SolutionTile.Width;
HeightRequest = Styles.WelcomeScreen.Pad.Solutions.SolutionTile.Height + 2;
Events |= (Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.PointerMotionMask);
LeftTextPadding = Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TextLeftPadding;
InternalPadding = Styles.WelcomeScreen.Pad.Padding;
+
+ Gui.Styles.Changed += UpdateStyle;
+ UpdateStyle ();
+ }
+
+ void UpdateStyle (object sender = null, EventArgs e = null)
+ {
+ OnUpdateStyle ();
+ QueueDraw ();
+ }
+
+ protected virtual void OnUpdateStyle ()
+ {
+ SmallTitleColor = Styles.WelcomeScreen.Pad.SmallTitleColor;
+ MediumTitleColor = Styles.WelcomeScreen.Pad.MediumTitleColor;
+
+ TitleFontFace = Platform.IsMac ? Styles.WelcomeScreen.Pad.TitleFontFamilyMac : Styles.WelcomeScreen.Pad.TitleFontFamilyWindows;
+ SmallTitleFontFace = Platform.IsMac ? Styles.WelcomeScreen.Pad.TitleFontFamilyMac : Styles.WelcomeScreen.Pad.TitleFontFamilyWindows;
+
+ HoverBackgroundColor = Styles.WelcomeScreen.Pad.Solutions.SolutionTile.HoverBackgroundColor;
+ HoverBorderColor = Styles.WelcomeScreen.Pad.Solutions.SolutionTile.HoverBorderColor;
+
+ TitleFontSize = Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TitleFontSize;
+ SmallTitleFontSize = Styles.WelcomeScreen.Pad.Solutions.SolutionTile.PathFontSize;
}
public bool AllowPinning { get; set; }
@@ -296,42 +249,54 @@ namespace MonoDevelop.Ide.WelcomePage
int textWidth = Allocation.Width - LeftTextPadding - InternalPadding * 2;
- Pango.Layout titleLayout = new Pango.Layout (PangoContext);
- titleLayout.Width = Pango.Units.FromPixels (textWidth);
- titleLayout.Ellipsize = Pango.EllipsizeMode.End;
- titleLayout.SetMarkup (WelcomePageSection.FormatText (TitleFontFace, titleFontSize, TitleFontWeight, MediumTitleColor, title));
-
- Pango.Layout subtitleLayout = null;
-
- if (!string.IsNullOrEmpty (subtitle)) {
- subtitleLayout = new Pango.Layout (PangoContext);
- subtitleLayout.Width = Pango.Units.FromPixels (textWidth);
- subtitleLayout.Ellipsize = Pango.EllipsizeMode.Start;
- subtitleLayout.SetMarkup (WelcomePageSection.FormatText (SmallTitleFontFace, smallTitleFontSize, Pango.Weight.Normal, SmallTitleColor, subtitle));
- }
-
- int height = 0;
- int w, h1, h2;
- titleLayout.GetPixelSize (out w, out h1);
- height += h1;
-
- if (subtitleLayout != null) {
- height += Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TitleBottomMargin;
- subtitleLayout.GetPixelSize (out w, out h2);
- height += h2;
- }
-
- int tx = Allocation.X + InternalPadding + LeftTextPadding;
- int ty = Allocation.Y + (Allocation.Height - height) / 2;
- DrawLayout (ctx, titleLayout, TitleFontFace, titleFontSize, TitleFontWeight, MediumTitleColor, tx, ty);
-
- if (subtitleLayout != null) {
- ty += h1 + Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TitleBottomMargin;
- DrawLayout (ctx, subtitleLayout, SmallTitleFontFace, smallTitleFontSize, Pango.Weight.Normal, SmallTitleColor, tx, ty);
+ using (var titleLayout = new Pango.Layout (PangoContext))
+ {
+ titleLayout.Width = Pango.Units.FromPixels (textWidth);
+ titleLayout.Ellipsize = Pango.EllipsizeMode.End;
+ titleLayout.SetMarkup (WelcomePageSection.FormatText (TitleFontFace, TitleFontSize, Pango.Weight.Bold, MediumTitleColor, title));
+
+ Pango.Layout subtitleLayout = null;
+
+ if (!string.IsNullOrEmpty (subtitle))
+ {
+ subtitleLayout = new Pango.Layout (PangoContext);
+ subtitleLayout.Width = Pango.Units.FromPixels (textWidth);
+ subtitleLayout.Ellipsize = Pango.EllipsizeMode.Start;
+ subtitleLayout.SetMarkup (WelcomePageSection.FormatText (SmallTitleFontFace, SmallTitleFontSize, Pango.Weight.Normal, SmallTitleColor, subtitle));
+ }
+
+ int height = 0;
+ int w, h1, h2;
+ titleLayout.GetPixelSize (out w, out h1);
+ height += h1;
+
+ if (subtitleLayout != null)
+ {
+ height += Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TitleBottomMargin;
+ subtitleLayout.GetPixelSize (out w, out h2);
+ height += h2;
+ }
+
+ int tx = Allocation.X + InternalPadding + LeftTextPadding;
+ int ty = Allocation.Y + (Allocation.Height - height) / 2;
+ DrawLayout (ctx, titleLayout, TitleFontFace, TitleFontSize, Pango.Weight.Bold, MediumTitleColor, tx, ty);
+
+ if (subtitleLayout != null)
+ {
+ ty += h1 + Styles.WelcomeScreen.Pad.Solutions.SolutionTile.TitleBottomMargin;
+ DrawLayout (ctx, subtitleLayout, SmallTitleFontFace, SmallTitleFontSize, Pango.Weight.Normal, SmallTitleColor, tx, ty);
+ subtitleLayout.Dispose ();
+ }
}
}
return true;
}
+
+ protected override void OnDestroyed ()
+ {
+ Gui.Styles.Changed -= UpdateStyle;
+ base.OnDestroyed ();
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageOptionPanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageOptionPanel.cs
index 26a87546f1..9640eda8d9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageOptionPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageOptionPanel.cs
@@ -27,18 +27,19 @@
using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.Ide.WelcomePage
{
- public class WelcomePageOptionPanel : OptionsPanel
+ class WelcomePageOptionPanel : OptionsPanel
{
CheckButton showOnStartCheckButton = new CheckButton ();
CheckButton internetUpdateCheckButton = new CheckButton ();
CheckButton closeOnOpenSlnCheckButton = new CheckButton ();
- public override Widget CreatePanelWidget ()
+ public override Control CreatePanelWidget ()
{
VBox vbox = new VBox();
showOnStartCheckButton.Label = GettextCatalog.GetString ("Show welcome page on startup");
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageRecentProjectsList.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageRecentProjectsList.cs
index 6083fef4d7..94b0d737cb 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageRecentProjectsList.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageRecentProjectsList.cs
@@ -37,23 +37,20 @@ namespace MonoDevelop.Ide.WelcomePage
public class WelcomePageRecentProjectsList : WelcomePageSection
{
bool destroyed;
- readonly EventHandler recentChangesHandler;
readonly VBox box;
int itemCount = 10;
readonly Xwt.Drawing.Image openProjectIcon;
readonly Xwt.Drawing.Image newProjectIcon;
-
+
public WelcomePageRecentProjectsList (string title = null, int count = 10): base (title)
{
- openProjectIcon = Xwt.Drawing.Image.FromResource ("open_solution.png");
- newProjectIcon = Xwt.Drawing.Image.FromResource ("new_solution.png");
-
+ openProjectIcon = Xwt.Drawing.Image.FromResource ("welcome-open-solution-16.png");
+ newProjectIcon = Xwt.Drawing.Image.FromResource ("welcome-new-solution-16.png");
box = new VBox ();
itemCount = count;
- recentChangesHandler = DispatchService.GuiDispatch (new EventHandler (RecentFilesChanged));
- DesktopService.RecentFiles.Changed += recentChangesHandler;
+ DesktopService.RecentFiles.Changed += RecentFilesChanged;
RecentFilesChanged (null, null);
SetContent (box);
@@ -66,7 +63,7 @@ namespace MonoDevelop.Ide.WelcomePage
{
destroyed = true;
base.OnDestroyed ();
- DesktopService.RecentFiles.Changed -= recentChangesHandler;
+ DesktopService.RecentFiles.Changed -= RecentFilesChanged;
}
void RecentFilesChanged (object sender, EventArgs e)
@@ -98,8 +95,6 @@ namespace MonoDevelop.Ide.WelcomePage
//TODO: pinned files
foreach (var recent in DesktopService.RecentFiles.GetProjects ().Take (itemCount)) {
var filename = recent.FileName;
- if (!System.IO.File.Exists (filename))
- continue;
var accessed = recent.TimeStamp;
var pixbuf = ImageService.GetIcon (GetIcon (filename), IconSize.Dnd);
@@ -114,17 +109,52 @@ namespace MonoDevelop.Ide.WelcomePage
//};
//button.HasTooltip = true;
button.TooltipText = filename + "\n" + TimeSinceEdited (accessed);
- box.PackStart (button, false, false, 0);
- button.PinClicked += delegate {
- DesktopService.RecentFiles.SetFavoriteFile (filename, button.Pinned);
- };
+ box.PackStart (button, false, false, 0);
+ var pinClickHandler = new PinClickHandler (filename);
+ pinClickHandler.Register (button);
}
-
-
this.ShowAll ();
+ }
+
+ class PinClickHandler : IDisposable
+ {
+ WelcomePageListButton button;
+ string filename;
+
+ public PinClickHandler (string filename)
+ {
+ this.filename = filename;
+ }
+
+ public void Dispose ()
+ {
+ if (button == null)
+ return;
+ button.PinClicked -= Button_PinClicked;
+ button.Destroyed -= Button_Destroyed;
+ button = null;
+ }
+
+ internal void Register (WelcomePageListButton button)
+ {
+ this.button = button;
+ button.PinClicked += Button_PinClicked;
+ button.Destroyed += Button_Destroyed;
+ }
+
+ void Button_PinClicked (object sender, EventArgs e)
+ {
+ DesktopService.RecentFiles.SetFavoriteFile (filename, button.Pinned);
+ }
+
+ void Button_Destroyed (object sender, EventArgs e)
+ {
+ Dispose ();
+ }
}
-
+
+
static string TimeSinceEdited (DateTime prjtime)
{
TimeSpan sincelast = DateTime.UtcNow - prjtime;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageSection.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageSection.cs
index 40aaa15882..507d1a0065 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageSection.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageSection.cs
@@ -28,7 +28,6 @@ using Gtk;
using System.Xml.Linq;
using MonoDevelop.Core;
using MonoDevelop.Components;
-using Mono.TextEditor;
namespace MonoDevelop.Ide.WelcomePage
{
@@ -36,14 +35,21 @@ namespace MonoDevelop.Ide.WelcomePage
{
string title;
- static readonly string headerFormat;
+ static string headerFormat;
+ Label label;
Alignment root = new Alignment (0, 0, 1f, 1f);
protected Gtk.Alignment ContentAlignment { get; private set; }
protected Gtk.Alignment TitleAlignment { get; private set; }
static WelcomePageSection ()
{
+ UpdateStyle ();
+ Gui.Styles.Changed += (sender, e) => UpdateStyle();
+ }
+
+ static void UpdateStyle ()
+ {
var face = Platform.IsMac ? Styles.WelcomeScreen.Pad.TitleFontFamilyMac : Styles.WelcomeScreen.Pad.TitleFontFamilyWindows;
headerFormat = Styles.GetFormatString (face, Styles.WelcomeScreen.Pad.LargeTitleFontSize, Styles.WelcomeScreen.Pad.LargeTitleFontColor);
}
@@ -63,6 +69,15 @@ namespace MonoDevelop.Ide.WelcomePage
TitleAlignment.SetPadding (p, Styles.WelcomeScreen.Pad.LargeTitleMarginBottom, p, p);
ContentAlignment = new Alignment (0f, 0f, 1f, 1f);
ContentAlignment.SetPadding (0, p, p, p);
+
+ Gui.Styles.Changed += UpdateStyle;
+ }
+
+ void UpdateStyle (object sender, EventArgs args)
+ {
+ if (label != null)
+ label.Markup = string.Format (headerFormat, title);
+ QueueDraw ();
}
public void SetContent (Gtk.Widget w)
@@ -76,7 +91,7 @@ namespace MonoDevelop.Ide.WelcomePage
}
var box = new VBox ();
- var label = new Gtk.Label () { Markup = string.Format (headerFormat, title), Xalign = (uint) 0 };
+ label = new Label () { Markup = string.Format (headerFormat, title), Xalign = (uint) 0 };
TitleAlignment.Add (label);
box.PackStart (TitleAlignment, false, false, 0);
box.PackStart (ContentAlignment, false, false, 0);
@@ -128,15 +143,19 @@ namespace MonoDevelop.Ide.WelcomePage
try {
if (uri.StartsWith ("project://")) {
string file = uri.Substring ("project://".Length);
- Gdk.ModifierType mtype = Mono.TextEditor.GtkWorkarounds.GetCurrentKeyModifiers ();
+ Gdk.ModifierType mtype = GtkWorkarounds.GetCurrentKeyModifiers ();
bool inWorkspace = (mtype & Gdk.ModifierType.ControlMask) != 0;
// Notify the RecentFiles that this item does not exist anymore.
// Possible other solution would be to check the recent projects list on focus in
// and update them accordingly.
if (!System.IO.File.Exists (file)) {
- MessageService.ShowError (GettextCatalog.GetString ("File not found {0}", file));
- FileService.NotifyFileRemoved (file);
+ var res = MessageService.AskQuestion (
+ GettextCatalog.GetString ("{0} could not be opened", file),
+ GettextCatalog.GetString ("Do you want to remove the reference to it from the Recent list?"),
+ AlertButton.No, AlertButton.Yes);
+ if (res == AlertButton.Yes)
+ FileService.NotifyFileRemoved (file);
return;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageTipOfTheDaySection.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageTipOfTheDaySection.cs
index 79fca3b031..f1891c7ac0 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageTipOfTheDaySection.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageTipOfTheDaySection.cs
@@ -27,6 +27,7 @@ using System;
using MonoDevelop.Core;
using System.Xml;
using System.Collections.Generic;
+using MonoDevelop.Ide.Fonts;
namespace MonoDevelop.Ide.WelcomePage
{
@@ -56,12 +57,14 @@ namespace MonoDevelop.Ide.WelcomePage
label.Xalign = 0;
label.Wrap = true;
label.WidthRequest = 200;
+ label.ModifyFont (FontService.SansFont.CopyModified (Gui.Styles.FontScale11));
+ label.SetPadding (0, 10);
label.Text = currentTip != -1 ? tips[currentTip] : "";
box.PackStart (label, true, true, 0);
var next = new Gtk.Button (GettextCatalog.GetString ("Next Tip"));
- next.Relief = Gtk.ReliefStyle.None;
+ next.Relief = Gtk.ReliefStyle.Normal;
next.Clicked += delegate {
if (tips.Count == 0)
return;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageWidget.cs
index b4f946bf36..bb189d0ec0 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/WelcomePageWidget.cs
@@ -73,7 +73,7 @@ namespace MonoDevelop.Ide.WelcomePage
ShowScrollbars = true;
VisibleWindow = false;
- BackgroundColor = "white";
+ UpdateTeme (null, null);
LogoHeight = 90;
var background = new WelcomePageWidgetBackground ();
@@ -104,6 +104,12 @@ namespace MonoDevelop.Ide.WelcomePage
IdeApp.Workbench.GuiLocked += OnLock;
IdeApp.Workbench.GuiUnlocked += OnUnlock;
+ MonoDevelop.Ide.Gui.Styles.Changed += UpdateTeme;
+ }
+
+ void UpdateTeme (object sender, EventArgs e)
+ {
+ BackgroundColor = Styles.WelcomeScreen.BackgroundColor;
}
void OnLock (object s, EventArgs a)
@@ -126,6 +132,7 @@ namespace MonoDevelop.Ide.WelcomePage
base.OnDestroyed ();
IdeApp.Workbench.GuiLocked -= OnLock;
IdeApp.Workbench.GuiUnlocked -= OnUnlock;
+ MonoDevelop.Ide.Gui.Styles.Changed -= UpdateTeme;
}
public class WelcomePageWidgetBackground : Gtk.EventBox
@@ -135,13 +142,23 @@ namespace MonoDevelop.Ide.WelcomePage
public double OverdrawOpacity { get; set; }
public int OverdrawOffset { get; set; }
- protected override void OnRealized ()
+ Gdk.Color backgroundColor = Gdk.Color.Zero;
+
+ public WelcomePageWidgetBackground ()
+ {
+ MonoDevelop.Ide.Gui.Styles.Changed += UpdateTeme;
+ }
+
+ void UpdateTeme (object sender, EventArgs e)
{
- Gdk.Color color = Gdk.Color.Zero;
- if (!Gdk.Color.Parse (Owner.BackgroundColor, ref color))
- color = Style.White;
- ModifyBg (StateType.Normal, color);
+ if (!Gdk.Color.Parse (Owner.BackgroundColor, ref backgroundColor) || !Gdk.Color.Parse (Styles.WelcomeScreen.BackgroundColor, ref backgroundColor))
+ backgroundColor = Style.White;
+ ModifyBg (StateType.Normal, backgroundColor);
+ }
+ protected override void OnRealized ()
+ {
+ UpdateTeme (null, null);
base.OnRealized ();
}
@@ -164,7 +181,7 @@ namespace MonoDevelop.Ide.WelcomePage
protected override bool OnExposeEvent (EventExpose evnt)
{
using (var context = CairoHelper.Create (evnt.Window)) {
- context.SetSourceRGB (1, 1, 1);
+ context.SetSourceRGB (backgroundColor.Red, backgroundColor.Green, backgroundColor.Blue);
context.Operator = Cairo.Operator.Source;
context.Paint ();
context.Operator = Cairo.Operator.Over;
@@ -193,6 +210,12 @@ namespace MonoDevelop.Ide.WelcomePage
return true;
}
+
+ protected override void OnDestroyed ()
+ {
+ MonoDevelop.Ide.Gui.Styles.Changed -= UpdateTeme;
+ base.OnDestroyed ();
+ }
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/link-chat.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/link-chat.png
deleted file mode 100644
index 2c97dca82b..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/link-chat.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/link-cloud.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/link-cloud.png
deleted file mode 100644
index c83a739dbd..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/link-cloud.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/link-heart.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/link-heart.png
deleted file mode 100644
index bffca62b12..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/link-heart.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/link-info.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/link-info.png
deleted file mode 100644
index 7bb2eda750..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/link-info.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/new_solution.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/new_solution.png
deleted file mode 100644
index c2197388ab..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/new_solution.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/open_solution.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/open_solution.png
deleted file mode 100644
index 111660560e..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/open_solution.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/starburst.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/starburst.png
deleted file mode 100644
index 857aa26e15..0000000000
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/starburst.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-chat-16.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-chat-16.png
new file mode 100644
index 0000000000..e914d15d5f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-chat-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-chat-16@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-chat-16@2x.png
new file mode 100644
index 0000000000..a72868ad39
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-chat-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-chat-16~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-chat-16~dark.png
new file mode 100644
index 0000000000..b9aaf29306
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-chat-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-chat-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-chat-16~dark@2x.png
new file mode 100644
index 0000000000..98a5f48d16
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-chat-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-info-16.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-info-16.png
new file mode 100644
index 0000000000..46a1683d62
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-info-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-info-16@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-info-16@2x.png
new file mode 100644
index 0000000000..706120e646
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-info-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-info-16~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-info-16~dark.png
new file mode 100644
index 0000000000..5de6e781dd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-info-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-info-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-info-16~dark@2x.png
new file mode 100644
index 0000000000..37ff0fbabc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-info-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-md-16.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-md-16.png
new file mode 100644
index 0000000000..4de7f8aec0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-md-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-md-16@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-md-16@2x.png
new file mode 100644
index 0000000000..54ca319ac4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-md-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-md-16~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-md-16~dark.png
new file mode 100644
index 0000000000..b58e3d6578
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-md-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-md-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-md-16~dark@2x.png
new file mode 100644
index 0000000000..624771d270
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-md-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-support-16.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-support-16.png
new file mode 100644
index 0000000000..d1c51fdef7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-support-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-support-16@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-support-16@2x.png
new file mode 100644
index 0000000000..e559634066
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-support-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-support-16~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-support-16~dark.png
new file mode 100644
index 0000000000..2653e93337
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-support-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-support-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-support-16~dark@2x.png
new file mode 100644
index 0000000000..688f50aba6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-link-support-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-new-solution-16.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-new-solution-16.png
new file mode 100644
index 0000000000..aade182b99
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-new-solution-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-new-solution-16@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-new-solution-16@2x.png
new file mode 100644
index 0000000000..1698e8c62b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-new-solution-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-new-solution-16~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-new-solution-16~dark.png
new file mode 100644
index 0000000000..a7fb210b7d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-new-solution-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-new-solution-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-new-solution-16~dark@2x.png
new file mode 100644
index 0000000000..15b6c627a9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-new-solution-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-open-solution-16.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-open-solution-16.png
new file mode 100644
index 0000000000..f93245df08
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-open-solution-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-open-solution-16@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-open-solution-16@2x.png
new file mode 100644
index 0000000000..d58b179943
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-open-solution-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-open-solution-16~dark.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-open-solution-16~dark.png
new file mode 100644
index 0000000000..0866a5c72e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-open-solution-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-open-solution-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-open-solution-16~dark@2x.png
new file mode 100644
index 0000000000..5802972af0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.WelcomePage/icons/welcome-open-solution-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj
index 03e49acac9..b8d4233ac3 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj
@@ -22,7 +22,7 @@
<Execution clr-version="Net_2_0" />
</Execution>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
- <DefineConstants>DEBUG</DefineConstants>
+ <DefineConstants>DEBUG,LINUX</DefineConstants>
<NoWarn>1591;1573</NoWarn>
<DocumentationFile>..\..\..\build\bin\MonoDevelop.Ide.xml</DocumentationFile>
</PropertyGroup>
@@ -30,6 +30,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>True</Optimize>
<OutputPath>..\..\..\build\bin</OutputPath>
+ <DefineConstants>LINUX</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>3</WarningLevel>
<Execution>
@@ -131,6 +132,7 @@
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Design" />
<Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Runtime.Serialization" />
<Reference Include="Xamarin.Mac" Condition=" '$(Configuration)' == 'DebugMac' Or '$(Configuration)' == 'ReleaseMac' ">
<HintPath>..\..\..\external\Xamarin.Mac.dll</HintPath>
</Reference>
@@ -138,7 +140,26 @@
<Reference Include="PresentationCore" Condition=" '$(Configuration)' == 'DebugWin32' Or '$(Configuration)' == 'ReleaseWin32' " />
<Reference Include="PresentationFramework" Condition=" '$(Configuration)' == 'DebugWin32' Or '$(Configuration)' == 'ReleaseWin32' " />
<Reference Include="WindowsBase" Condition=" '$(Configuration)' == 'DebugWin32' Or '$(Configuration)' == 'ReleaseWin32' " />
+ <Reference Include="WindowsFormsIntegration" Condition=" '$(Configuration)' == 'DebugWin32' Or '$(Configuration)' == 'ReleaseWin32' " />
<Reference Include="System.Xaml" />
+ <Reference Include="System.Reflection.Metadata">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Reflection.Metadata.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Composition.AttributedModel">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Composition.AttributedModel.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Collections.Immutable">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Collections.Immutable.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis.Workspaces">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.Workspaces.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.CodeAnalysis">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\Microsoft.CodeAnalysis.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Composition.Runtime">
+ <HintPath>..\..\..\external\roslyn\Binaries\Release\System.Composition.Runtime.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MonoDevelop.Core\MonoDevelop.Core.csproj">
@@ -146,11 +167,6 @@
<Name>MonoDevelop.Core</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\Mono.Texteditor\Mono.TextEditor.csproj">
- <Project>{A2329308-3751-4DBD-9A75-5F7B8B024625}</Project>
- <Name>Mono.TextEditor</Name>
- <Private>False</Private>
- </ProjectReference>
<ProjectReference Include="..\MonoDevelop.Projects.Formats.MSBuild\MonoDevelop.Projects.Formats.MSBuild.csproj">
<Project>{A437F1A3-78DF-4F00-8053-D32A8B1EB679}</Project>
<Name>MonoDevelop.Projects.Formats.MSBuild</Name>
@@ -159,12 +175,10 @@
<ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj">
<Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project>
<Name>ICSharpCode.NRefactory</Name>
- <Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory.CSharp\ICSharpCode.NRefactory.CSharp.csproj">
<Project>{53DCA265-3C3C-42F9-B647-F72BA678122B}</Project>
<Name>ICSharpCode.NRefactory.CSharp</Name>
- <Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\external\xwt\Xwt\Xwt.csproj">
<Project>{92494904-35FA-4DC9-BDE9-3A3E87AC49D3}</Project>
@@ -205,6 +219,14 @@
<Project>{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}</Project>
<Name>IKVM.Reflection</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory.Cecil\ICSharpCode.NRefactory.Cecil.csproj">
+ <Project>{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}</Project>
+ <Name>ICSharpCode.NRefactory.Cecil</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\external\RefactoringEssentials\RefactoringEssentials\RefactoringEssentials.csproj">
+ <Project>{C465A5DC-AD28-49A2-89C0-F81838814A7E}</Project>
+ <Name>RefactoringEssentials</Name>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="templates\AppConfigFile.xft.xml">
@@ -237,23 +259,101 @@
<EmbeddedResource Include="templates\EmptyXMLFile.xft.xml">
<LogicalName>EmptyXMLFile.xft.xml</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\assembly-reference-overlay-16.png">
- <LogicalName>assembly-reference-overlay-16.png</LogicalName>
+ <EmbeddedResource Include="icons\reference-assembly-16.png">
+ <LogicalName>reference-assembly-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-assembly-16%402x.png">
+ <LogicalName>reference-assembly-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-assembly-16~dark.png">
+ <LogicalName>reference-assembly-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-assembly-16~dark%402x.png">
+ <LogicalName>reference-assembly-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-assembly-16~sel.png">
+ <LogicalName>reference-assembly-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-assembly-16~sel%402x.png">
+ <LogicalName>reference-assembly-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-assembly-16~dark~sel.png">
+ <LogicalName>reference-assembly-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-assembly-16~dark~sel%402x.png">
+ <LogicalName>reference-assembly-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-invalid-16.png">
+ <LogicalName>reference-invalid-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-invalid-16%402x.png">
+ <LogicalName>reference-invalid-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-invalid-16~dark.png">
+ <LogicalName>reference-invalid-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-invalid-16~dark%402x.png">
+ <LogicalName>reference-invalid-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-invalid-16~sel.png">
+ <LogicalName>reference-invalid-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-invalid-16~sel%402x.png">
+ <LogicalName>reference-invalid-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-invalid-16~dark~sel.png">
+ <LogicalName>reference-invalid-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-invalid-16~dark~sel%402x.png">
+ <LogicalName>reference-invalid-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\assembly-reference-overlay-16%402x.png">
- <LogicalName>assembly-reference-overlay-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\reference-project-16.png">
+ <LogicalName>reference-project-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\invalid-reference-overlay-16.png">
- <LogicalName>invalid-reference-overlay-16.png</LogicalName>
+ <EmbeddedResource Include="icons\reference-project-16%402x.png">
+ <LogicalName>reference-project-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\invalid-reference-overlay-16%402x.png">
- <LogicalName>invalid-reference-overlay-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\reference-project-16~dark.png">
+ <LogicalName>reference-project-16~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\project-reference-overlay-16.png">
- <LogicalName>project-reference-overlay-16.png</LogicalName>
+ <EmbeddedResource Include="icons\reference-project-16~dark%402x.png">
+ <LogicalName>reference-project-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\project-reference-overlay-16%402x.png">
- <LogicalName>project-reference-overlay-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\reference-project-16~sel.png">
+ <LogicalName>reference-project-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-project-16~sel%402x.png">
+ <LogicalName>reference-project-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-project-16~dark~sel.png">
+ <LogicalName>reference-project-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-project-16~dark~sel%402x.png">
+ <LogicalName>reference-project-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\revert-16.png">
+ <LogicalName>revert-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\revert-16%402x.png">
+ <LogicalName>revert-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\revert-16~dark.png">
+ <LogicalName>revert-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\revert-16~dark%402x.png">
+ <LogicalName>revert-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\revert-16~disabled.png">
+ <LogicalName>revert-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\revert-16~disabled%402x.png">
+ <LogicalName>revert-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\revert-16~dark~disabled.png">
+ <LogicalName>revert-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\revert-16~dark~disabled%402x.png">
+ <LogicalName>revert-16~dark~disabled@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="templates\GenericProject.xpt.xml">
<LogicalName>GenericProject.xpt.xml</LogicalName>
@@ -261,18 +361,81 @@
<EmbeddedResource Include="gtk-gui\gui.stetic">
<LogicalName>gui.stetic</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="gtk-gui\objects.xml">
+ <LogicalName>objects.xml</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\pin-down-16.png">
<LogicalName>pin-down-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\pin-down-16%402x.png">
<LogicalName>pin-down-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\pin-down-16~dark.png">
+ <LogicalName>pin-down-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pin-down-16~dark%402x.png">
+ <LogicalName>pin-down-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pin-down-16~sel.png">
+ <LogicalName>pin-down-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pin-down-16~sel%402x.png">
+ <LogicalName>pin-down-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pin-down-16~dark~sel.png">
+ <LogicalName>pin-down-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pin-down-16~dark~sel%402x.png">
+ <LogicalName>pin-down-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pin-down-16~disabled.png">
+ <LogicalName>pin-down-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pin-down-16~disabled%402x.png">
+ <LogicalName>pin-down-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pin-down-16~dark~disabled.png">
+ <LogicalName>pin-down-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pin-down-16~dark~disabled%402x.png">
+ <LogicalName>pin-down-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\pin-up-16.png">
<LogicalName>pin-up-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\pin-up-16%402x.png">
<LogicalName>pin-up-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\pin-up-16~dark.png">
+ <LogicalName>pin-up-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pin-up-16~dark%402x.png">
+ <LogicalName>pin-up-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pin-up-16~sel.png">
+ <LogicalName>pin-up-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pin-up-16~sel%402x.png">
+ <LogicalName>pin-up-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pin-up-16~dark~sel.png">
+ <LogicalName>pin-up-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pin-up-16~dark~sel%402x.png">
+ <LogicalName>pin-up-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pin-up-16~disabled.png">
+ <LogicalName>pin-up-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pin-up-16~disabled%402x.png">
+ <LogicalName>pin-up-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pin-up-16~dark~disabled.png">
+ <LogicalName>pin-up-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pin-up-16~dark~disabled%402x.png">
+ <LogicalName>pin-up-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="options\KeyBindingSchemeEmacs.xml">
<LogicalName>KeyBindingSchemeEmacs.xml</LogicalName>
</EmbeddedResource>
@@ -285,12 +448,6 @@
<EmbeddedResource Include="options\KeyBindingSchemeMonoDevelop1.xml">
<LogicalName>KeyBindingSchemeMonoDevelop1.xml</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\navigate-next-16.png">
- <LogicalName>navigate-next-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\navigate-previous-16.png">
- <LogicalName>navigate-previous-16.png</LogicalName>
- </EmbeddedResource>
<EmbeddedResource Include="options\KeyBindingSchemeMonoDevelop2.xml">
<LogicalName>KeyBindingSchemeMonoDevelop2.xml</LogicalName>
</EmbeddedResource>
@@ -327,14 +484,41 @@
<EmbeddedResource Include="MonoDevelop.Ide.CodeFormatting\InvariantTextStylePolicy.xml">
<LogicalName>InvariantTextStylePolicy.xml</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\add-namespace-16.png">
- <LogicalName>add-namespace-16.png</LogicalName>
+ <EmbeddedResource Include="icons\new-namespace-16.png">
+ <LogicalName>new-namespace-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-namespace-16%402x.png">
+ <LogicalName>new-namespace-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-namespace-16~dark.png">
+ <LogicalName>new-namespace-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-namespace-16~dark%402x.png">
+ <LogicalName>new-namespace-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-assembly-16.png">
+ <LogicalName>project-assembly-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-assembly-16%402x.png">
+ <LogicalName>project-assembly-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-assembly-16~dark.png">
+ <LogicalName>project-assembly-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-assembly-16~dark%402x.png">
+ <LogicalName>project-assembly-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\assembly-project-16.png">
- <LogicalName>assembly-project-16.png</LogicalName>
+ <EmbeddedResource Include="icons\project-assembly-16~sel.png">
+ <LogicalName>project-assembly-16~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\assembly-project-16%402x.png">
- <LogicalName>assembly-project-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\project-assembly-16~sel%402x.png">
+ <LogicalName>project-assembly-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-assembly-16~dark~sel.png">
+ <LogicalName>project-assembly-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-assembly-16~dark~sel%402x.png">
+ <LogicalName>project-assembly-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\breakpoint-16.png">
<LogicalName>breakpoint-16.png</LogicalName>
@@ -342,65 +526,299 @@
<EmbeddedResource Include="icons\breakpoint-16%402x.png">
<LogicalName>breakpoint-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-16~dark.png">
+ <LogicalName>breakpoint-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-16~dark%402x.png">
+ <LogicalName>breakpoint-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-16~disabled.png">
+ <LogicalName>breakpoint-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-16~disabled%402x.png">
+ <LogicalName>breakpoint-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-16~dark~disabled.png">
+ <LogicalName>breakpoint-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-16~dark~disabled%402x.png">
+ <LogicalName>breakpoint-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\breakpoint-disable-all-16.png">
<LogicalName>breakpoint-disable-all-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\breakpoint-disable-all-16%402x.png">
<LogicalName>breakpoint-disable-all-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-disable-all-16~dark.png">
+ <LogicalName>breakpoint-disable-all-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-disable-all-16~dark%402x.png">
+ <LogicalName>breakpoint-disable-all-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-disable-all-16~disabled.png">
+ <LogicalName>breakpoint-disable-all-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-disable-all-16~disabled%402x.png">
+ <LogicalName>breakpoint-disable-all-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-disable-all-16~dark~disabled.png">
+ <LogicalName>breakpoint-disable-all-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-disable-all-16~dark~disabled%402x.png">
+ <LogicalName>breakpoint-disable-all-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\breakpoint-disabled-16.png">
<LogicalName>breakpoint-disabled-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\breakpoint-disabled-16%402x.png">
<LogicalName>breakpoint-disabled-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-disabled-16~dark.png">
+ <LogicalName>breakpoint-disabled-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-disabled-16~dark%402x.png">
+ <LogicalName>breakpoint-disabled-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-disabled-16~disabled.png">
+ <LogicalName>breakpoint-disabled-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-disabled-16~disabled%402x.png">
+ <LogicalName>breakpoint-disabled-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-disabled-16~dark~disabled.png">
+ <LogicalName>breakpoint-disabled-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-disabled-16~dark~disabled%402x.png">
+ <LogicalName>breakpoint-disabled-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\breakpoint-invalid-16.png">
<LogicalName>breakpoint-invalid-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\breakpoint-invalid-16%402x.png">
<LogicalName>breakpoint-invalid-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-invalid-16~dark.png">
+ <LogicalName>breakpoint-invalid-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-invalid-16~dark%402x.png">
+ <LogicalName>breakpoint-invalid-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-invalid-16~disabled.png">
+ <LogicalName>breakpoint-invalid-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-invalid-16~disabled%402x.png">
+ <LogicalName>breakpoint-invalid-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-invalid-16~dark~disabled.png">
+ <LogicalName>breakpoint-invalid-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-invalid-16~dark~disabled%402x.png">
+ <LogicalName>breakpoint-invalid-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\breakpoint-new-16.png">
<LogicalName>breakpoint-new-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\breakpoint-new-16%402x.png">
<LogicalName>breakpoint-new-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-new-16~dark.png">
+ <LogicalName>breakpoint-new-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-new-16~dark%402x.png">
+ <LogicalName>breakpoint-new-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-new-16~disabled.png">
+ <LogicalName>breakpoint-new-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-new-16~disabled%402x.png">
+ <LogicalName>breakpoint-new-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-new-16~dark~disabled.png">
+ <LogicalName>breakpoint-new-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-new-16~dark~disabled%402x.png">
+ <LogicalName>breakpoint-new-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\catchpoint-new-16.png">
+ <LogicalName>catchpoint-new-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\catchpoint-new-16%402x.png">
+ <LogicalName>catchpoint-new-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\catchpoint-new-16~dark.png">
+ <LogicalName>catchpoint-new-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\catchpoint-new-16~dark%402x.png">
+ <LogicalName>catchpoint-new-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\catchpoint-new-16~disabled.png">
+ <LogicalName>catchpoint-new-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\catchpoint-new-16~disabled%402x.png">
+ <LogicalName>catchpoint-new-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\catchpoint-new-16~dark~disabled.png">
+ <LogicalName>catchpoint-new-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\catchpoint-new-16~dark~disabled%402x.png">
+ <LogicalName>catchpoint-new-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\breakpoint-on-off-16.png">
<LogicalName>breakpoint-on-off-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\breakpoint-on-off-16%402x.png">
<LogicalName>breakpoint-on-off-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-on-off-16~dark.png">
+ <LogicalName>breakpoint-on-off-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-on-off-16~dark%402x.png">
+ <LogicalName>breakpoint-on-off-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-on-off-16~disabled.png">
+ <LogicalName>breakpoint-on-off-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-on-off-16~disabled%402x.png">
+ <LogicalName>breakpoint-on-off-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-on-off-16~dark~disabled.png">
+ <LogicalName>breakpoint-on-off-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breakpoint-on-off-16~dark~disabled%402x.png">
+ <LogicalName>breakpoint-on-off-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\build-project-16.png">
<LogicalName>build-project-16.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\build-project-16%402x.png">
+ <LogicalName>build-project-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\build-project-16~dark.png">
+ <LogicalName>build-project-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\build-project-16~dark%402x.png">
+ <LogicalName>build-project-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\build-solution-16.png">
<LogicalName>build-solution-16.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\build-solution-16%402x.png">
+ <LogicalName>build-solution-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\build-solution-16~dark.png">
+ <LogicalName>build-solution-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\build-solution-16~dark%402x.png">
+ <LogicalName>build-solution-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\element-template-16.png">
<LogicalName>element-template-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\element-template-16%402x.png">
<LogicalName>element-template-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\element-template-16~dark.png">
+ <LogicalName>element-template-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-template-16~dark%402x.png">
+ <LogicalName>element-template-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-template-16~sel.png">
+ <LogicalName>element-template-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-template-16~sel%402x.png">
+ <LogicalName>element-template-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-template-16~dark~sel.png">
+ <LogicalName>element-template-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-template-16~dark~sel%402x.png">
+ <LogicalName>element-template-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\element-template-surroundwith-16.png">
<LogicalName>element-template-surroundwith-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\element-template-surroundwith-16%402x.png">
<LogicalName>element-template-surroundwith-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\element-template-surroundwith-16~dark.png">
+ <LogicalName>element-template-surroundwith-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-template-surroundwith-16~dark%402x.png">
+ <LogicalName>element-template-surroundwith-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-template-surroundwith-16~sel.png">
+ <LogicalName>element-template-surroundwith-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-template-surroundwith-16~sel%402x.png">
+ <LogicalName>element-template-surroundwith-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-template-surroundwith-16~dark~sel.png">
+ <LogicalName>element-template-surroundwith-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-template-surroundwith-16~dark~sel%402x.png">
+ <LogicalName>element-template-surroundwith-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\comment-16.png">
<LogicalName>comment-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\comment-16%402x.png">
<LogicalName>comment-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\edit-find-next-16.png">
- <LogicalName>edit-find-next-16.png</LogicalName>
+ <EmbeddedResource Include="icons\comment-16~dark.png">
+ <LogicalName>comment-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\comment-16~dark%402x.png">
+ <LogicalName>comment-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-next-16.png">
+ <LogicalName>find-next-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-next-16%402x.png">
+ <LogicalName>find-next-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\edit-select-all-16.png">
- <LogicalName>edit-select-all-16.png</LogicalName>
+ <EmbeddedResource Include="icons\find-next-16~dark.png">
+ <LogicalName>find-next-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-next-16~dark%402x.png">
+ <LogicalName>find-next-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-prev-16.png">
+ <LogicalName>find-prev-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-prev-16%402x.png">
+ <LogicalName>find-prev-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-prev-16~dark.png">
+ <LogicalName>find-prev-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-prev-16~dark%402x.png">
+ <LogicalName>find-prev-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\select-all-16.png">
+ <LogicalName>select-all-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\select-all-16%402x.png">
+ <LogicalName>select-all-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\select-all-16~dark.png">
+ <LogicalName>select-all-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\select-all-16~dark%402x.png">
+ <LogicalName>select-all-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\select-all-16~disabled.png">
+ <LogicalName>select-all-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\select-all-16~disabled%402x.png">
+ <LogicalName>select-all-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\select-all-16~dark~disabled.png">
+ <LogicalName>select-all-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\select-all-16~dark~disabled%402x.png">
+ <LogicalName>select-all-16~dark~disabled@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\element-class-16.png">
<LogicalName>element-class-16.png</LogicalName>
@@ -408,17 +826,71 @@
<EmbeddedResource Include="icons\element-class-16%402x.png">
<LogicalName>element-class-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\element-class-16~dark.png">
+ <LogicalName>element-class-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-class-16~dark%402x.png">
+ <LogicalName>element-class-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-class-16~sel.png">
+ <LogicalName>element-class-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-class-16~sel%402x.png">
+ <LogicalName>element-class-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-class-16~dark~sel.png">
+ <LogicalName>element-class-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-class-16~dark~sel%402x.png">
+ <LogicalName>element-class-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\element-delegate-16.png">
<LogicalName>element-delegate-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\element-delegate-16%402x.png">
<LogicalName>element-delegate-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\element-enumeration-16.png">
- <LogicalName>element-enumeration-16.png</LogicalName>
+ <EmbeddedResource Include="icons\element-delegate-16~dark.png">
+ <LogicalName>element-delegate-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-delegate-16~dark%402x.png">
+ <LogicalName>element-delegate-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-delegate-16~sel.png">
+ <LogicalName>element-delegate-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-delegate-16~sel%402x.png">
+ <LogicalName>element-delegate-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-delegate-16~dark~sel.png">
+ <LogicalName>element-delegate-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-delegate-16~dark~sel%402x.png">
+ <LogicalName>element-delegate-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-enum-16.png">
+ <LogicalName>element-enum-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-enum-16%402x.png">
+ <LogicalName>element-enum-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-enum-16~dark.png">
+ <LogicalName>element-enum-16~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\element-enumeration-16%402x.png">
- <LogicalName>element-enumeration-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\element-enum-16~dark%402x.png">
+ <LogicalName>element-enum-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-enum-16~sel.png">
+ <LogicalName>element-enum-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-enum-16~sel%402x.png">
+ <LogicalName>element-enum-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-enum-16~dark~sel.png">
+ <LogicalName>element-enum-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-enum-16~dark~sel%402x.png">
+ <LogicalName>element-enum-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\element-event-16.png">
<LogicalName>element-event-16.png</LogicalName>
@@ -426,59 +898,263 @@
<EmbeddedResource Include="icons\element-event-16%402x.png">
<LogicalName>element-event-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\element-event-16~dark.png">
+ <LogicalName>element-event-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-event-16~dark%402x.png">
+ <LogicalName>element-event-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-event-16~sel.png">
+ <LogicalName>element-event-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-event-16~sel%402x.png">
+ <LogicalName>element-event-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-event-16~dark~sel.png">
+ <LogicalName>element-event-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-event-16~dark~sel%402x.png">
+ <LogicalName>element-event-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\element-extensionmethod-16.png">
<LogicalName>element-extensionmethod-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\element-extensionmethod-16%402x.png">
<LogicalName>element-extensionmethod-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\element-extensionmethod-16~dark.png">
+ <LogicalName>element-extensionmethod-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-extensionmethod-16~dark%402x.png">
+ <LogicalName>element-extensionmethod-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-extensionmethod-16~sel.png">
+ <LogicalName>element-extensionmethod-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-extensionmethod-16~sel%402x.png">
+ <LogicalName>element-extensionmethod-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-extensionmethod-16~dark~sel.png">
+ <LogicalName>element-extensionmethod-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-extensionmethod-16~dark~sel%402x.png">
+ <LogicalName>element-extensionmethod-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\element-field-16.png">
<LogicalName>element-field-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\element-field-16%402x.png">
<LogicalName>element-field-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\element-field-16~dark.png">
+ <LogicalName>element-field-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-field-16~dark%402x.png">
+ <LogicalName>element-field-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-field-16~sel.png">
+ <LogicalName>element-field-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-field-16~sel%402x.png">
+ <LogicalName>element-field-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-field-16~dark~sel.png">
+ <LogicalName>element-field-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-field-16~dark~sel%402x.png">
+ <LogicalName>element-field-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\element-interface-16.png">
<LogicalName>element-interface-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\element-interface-16%402x.png">
<LogicalName>element-interface-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\element-interface-16~dark.png">
+ <LogicalName>element-interface-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-interface-16~dark%402x.png">
+ <LogicalName>element-interface-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-interface-16~sel.png">
+ <LogicalName>element-interface-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-interface-16~sel%402x.png">
+ <LogicalName>element-interface-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-interface-16~dark~sel.png">
+ <LogicalName>element-interface-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-interface-16~dark~sel%402x.png">
+ <LogicalName>element-interface-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\element-constant-16.png">
<LogicalName>element-constant-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\element-constant-16%402x.png">
<LogicalName>element-constant-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\element-constant-16~dark.png">
+ <LogicalName>element-constant-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-constant-16~dark%402x.png">
+ <LogicalName>element-constant-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-constant-16~sel.png">
+ <LogicalName>element-constant-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-constant-16~sel%402x.png">
+ <LogicalName>element-constant-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-constant-16~dark~sel.png">
+ <LogicalName>element-constant-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-constant-16~dark~sel%402x.png">
+ <LogicalName>element-constant-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\element-method-16.png">
<LogicalName>element-method-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\element-method-16%402x.png">
<LogicalName>element-method-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\element-method-16~dark.png">
+ <LogicalName>element-method-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-method-16~dark%402x.png">
+ <LogicalName>element-method-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-method-16~sel.png">
+ <LogicalName>element-method-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-method-16~sel%402x.png">
+ <LogicalName>element-method-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-method-16~dark~sel.png">
+ <LogicalName>element-method-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-method-16~dark~sel%402x.png">
+ <LogicalName>element-method-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\element-method-new-16.png">
<LogicalName>element-method-new-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\element-method-new-16%402x.png">
<LogicalName>element-method-new-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\element-method-new-16~dark.png">
+ <LogicalName>element-method-new-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-method-new-16~dark%402x.png">
+ <LogicalName>element-method-new-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-method-new-16~sel.png">
+ <LogicalName>element-method-new-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-method-new-16~sel%402x.png">
+ <LogicalName>element-method-new-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-method-new-16~dark~sel.png">
+ <LogicalName>element-method-new-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-method-new-16~dark~sel%402x.png">
+ <LogicalName>element-method-new-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\element-namespace-16.png">
<LogicalName>element-namespace-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\element-namespace-16%402x.png">
<LogicalName>element-namespace-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\element-namespace-16~dark.png">
+ <LogicalName>element-namespace-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-namespace-16~dark%402x.png">
+ <LogicalName>element-namespace-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-namespace-16~sel.png">
+ <LogicalName>element-namespace-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-namespace-16~sel%402x.png">
+ <LogicalName>element-namespace-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-namespace-16~dark~sel.png">
+ <LogicalName>element-namespace-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-namespace-16~dark~sel%402x.png">
+ <LogicalName>element-namespace-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\element-property-16.png">
<LogicalName>element-property-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\element-property-16%402x.png">
<LogicalName>element-property-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\element-structure-16.png">
- <LogicalName>element-structure-16.png</LogicalName>
+ <EmbeddedResource Include="icons\element-property-16~dark.png">
+ <LogicalName>element-property-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-property-16~dark%402x.png">
+ <LogicalName>element-property-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\element-structure-16%402x.png">
- <LogicalName>element-structure-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\element-property-16~sel.png">
+ <LogicalName>element-property-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-property-16~sel%402x.png">
+ <LogicalName>element-property-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-property-16~dark~sel.png">
+ <LogicalName>element-property-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-property-16~dark~sel%402x.png">
+ <LogicalName>element-property-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-struct-16.png">
+ <LogicalName>element-struct-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-struct-16%402x.png">
+ <LogicalName>element-struct-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-struct-16~dark.png">
+ <LogicalName>element-struct-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-struct-16~dark%402x.png">
+ <LogicalName>element-struct-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-struct-16~sel.png">
+ <LogicalName>element-struct-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-struct-16~sel%402x.png">
+ <LogicalName>element-struct-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-struct-16~dark~sel.png">
+ <LogicalName>element-struct-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-struct-16~dark~sel%402x.png">
+ <LogicalName>element-struct-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-class-16.png">
+ <LogicalName>file-class-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-class-16%402x.png">
+ <LogicalName>file-class-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-class-16~dark.png">
+ <LogicalName>file-class-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-class-16~dark%402x.png">
+ <LogicalName>file-class-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-class-16~sel.png">
+ <LogicalName>file-class-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-class-16~sel%402x.png">
+ <LogicalName>file-class-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-class-16~dark~sel.png">
+ <LogicalName>file-class-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-class-16~dark~sel%402x.png">
+ <LogicalName>file-class-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-class-32.png">
<LogicalName>file-class-32.png</LogicalName>
@@ -486,11 +1162,95 @@
<EmbeddedResource Include="icons\file-class-32%402x.png">
<LogicalName>file-class-32@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\file-enumeration-32.png">
- <LogicalName>file-enumeration-32.png</LogicalName>
+ <EmbeddedResource Include="icons\file-class-32~dark.png">
+ <LogicalName>file-class-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-class-32~dark%402x.png">
+ <LogicalName>file-class-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-class-32~sel.png">
+ <LogicalName>file-class-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-class-32~sel%402x.png">
+ <LogicalName>file-class-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-class-32~dark~sel.png">
+ <LogicalName>file-class-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-class-32~dark~sel%402x.png">
+ <LogicalName>file-class-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-enum-16.png">
+ <LogicalName>file-enum-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-enum-16%402x.png">
+ <LogicalName>file-enum-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-enum-16~dark.png">
+ <LogicalName>file-enum-16~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\file-enumeration-32%402x.png">
- <LogicalName>file-enumeration-32@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\file-enum-16~dark%402x.png">
+ <LogicalName>file-enum-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-enum-16~sel.png">
+ <LogicalName>file-enum-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-enum-16~sel%402x.png">
+ <LogicalName>file-enum-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-enum-16~dark~sel.png">
+ <LogicalName>file-enum-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-enum-16~dark~sel%402x.png">
+ <LogicalName>file-enum-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-enum-32.png">
+ <LogicalName>file-enum-32.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-enum-32%402x.png">
+ <LogicalName>file-enum-32@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-enum-32~dark.png">
+ <LogicalName>file-enum-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-enum-32~dark%402x.png">
+ <LogicalName>file-enum-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-enum-32~sel.png">
+ <LogicalName>file-enum-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-enum-32~sel%402x.png">
+ <LogicalName>file-enum-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-enum-32~dark~sel.png">
+ <LogicalName>file-enum-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-enum-32~dark~sel%402x.png">
+ <LogicalName>file-enum-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-interface-16.png">
+ <LogicalName>file-interface-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-interface-16%402x.png">
+ <LogicalName>file-interface-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-interface-16~dark.png">
+ <LogicalName>file-interface-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-interface-16~dark%402x.png">
+ <LogicalName>file-interface-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-interface-16~sel.png">
+ <LogicalName>file-interface-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-interface-16~sel%402x.png">
+ <LogicalName>file-interface-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-interface-16~dark~sel.png">
+ <LogicalName>file-interface-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-interface-16~dark~sel%402x.png">
+ <LogicalName>file-interface-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-interface-32.png">
<LogicalName>file-interface-32.png</LogicalName>
@@ -498,38 +1258,179 @@
<EmbeddedResource Include="icons\file-interface-32%402x.png">
<LogicalName>file-interface-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\file-interface-32~dark.png">
+ <LogicalName>file-interface-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-interface-32~dark%402x.png">
+ <LogicalName>file-interface-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-interface-32~sel.png">
+ <LogicalName>file-interface-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-interface-32~sel%402x.png">
+ <LogicalName>file-interface-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-interface-32~dark~sel.png">
+ <LogicalName>file-interface-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-interface-32~dark~sel%402x.png">
+ <LogicalName>file-interface-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-struct-16.png">
+ <LogicalName>file-struct-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-struct-16%402x.png">
+ <LogicalName>file-struct-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-struct-16~dark.png">
+ <LogicalName>file-struct-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-struct-16~dark%402x.png">
+ <LogicalName>file-struct-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-struct-16~sel.png">
+ <LogicalName>file-struct-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-struct-16~sel%402x.png">
+ <LogicalName>file-struct-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-struct-16~dark~sel.png">
+ <LogicalName>file-struct-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-struct-16~dark~sel%402x.png">
+ <LogicalName>file-struct-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\file-struct-32.png">
<LogicalName>file-struct-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-struct-32%402x.png">
<LogicalName>file-struct-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\file-struct-32~dark.png">
+ <LogicalName>file-struct-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-struct-32~dark%402x.png">
+ <LogicalName>file-struct-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-struct-32~sel.png">
+ <LogicalName>file-struct-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-struct-32~sel%402x.png">
+ <LogicalName>file-struct-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-struct-32~dark~sel.png">
+ <LogicalName>file-struct-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-struct-32~dark~sel%402x.png">
+ <LogicalName>file-struct-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\file-xml-16.png">
<LogicalName>file-xml-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-xml-16%402x.png">
<LogicalName>file-xml-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\file-xml-16~dark.png">
+ <LogicalName>file-xml-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-xml-16~dark%402x.png">
+ <LogicalName>file-xml-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-xml-16~sel.png">
+ <LogicalName>file-xml-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-xml-16~sel%402x.png">
+ <LogicalName>file-xml-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-xml-16~dark~sel.png">
+ <LogicalName>file-xml-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-xml-16~dark~sel%402x.png">
+ <LogicalName>file-xml-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\file-xml-32.png">
<LogicalName>file-xml-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-xml-32%402x.png">
<LogicalName>file-xml-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\file-xml-32~dark.png">
+ <LogicalName>file-xml-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-xml-32~dark%402x.png">
+ <LogicalName>file-xml-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-xml-32~sel.png">
+ <LogicalName>file-xml-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-xml-32~sel%402x.png">
+ <LogicalName>file-xml-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-xml-32~dark~sel.png">
+ <LogicalName>file-xml-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-xml-32~dark~sel%402x.png">
+ <LogicalName>file-xml-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\file-script-16.png">
<LogicalName>file-script-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-script-16%402x.png">
<LogicalName>file-script-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\file-script-16~dark.png">
+ <LogicalName>file-script-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-script-16~dark%402x.png">
+ <LogicalName>file-script-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-script-16~sel.png">
+ <LogicalName>file-script-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-script-16~sel%402x.png">
+ <LogicalName>file-script-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-script-16~dark~sel.png">
+ <LogicalName>file-script-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-script-16~dark~sel%402x.png">
+ <LogicalName>file-script-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\file-script-32.png">
<LogicalName>file-script-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-script-32%402x.png">
<LogicalName>file-script-32@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\folder-new-16.png">
- <LogicalName>folder-new-16.png</LogicalName>
+ <EmbeddedResource Include="icons\file-script-32~dark.png">
+ <LogicalName>file-script-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-script-32~dark%402x.png">
+ <LogicalName>file-script-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-script-32~sel.png">
+ <LogicalName>file-script-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-script-32~sel%402x.png">
+ <LogicalName>file-script-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-script-32~dark~sel.png">
+ <LogicalName>file-script-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-script-32~dark~sel%402x.png">
+ <LogicalName>file-script-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-folder-16.png">
+ <LogicalName>new-folder-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-folder-16%402x.png">
+ <LogicalName>new-folder-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-folder-16~dark.png">
+ <LogicalName>new-folder-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-folder-16~dark%402x.png">
+ <LogicalName>new-folder-16~dark@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\element-keyword-16.png">
<LogicalName>element-keyword-16.png</LogicalName>
@@ -537,6 +1438,24 @@
<EmbeddedResource Include="icons\element-keyword-16%402x.png">
<LogicalName>element-keyword-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\element-keyword-16~dark.png">
+ <LogicalName>element-keyword-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-keyword-16~dark%402x.png">
+ <LogicalName>element-keyword-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-keyword-16~sel.png">
+ <LogicalName>element-keyword-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-keyword-16~sel%402x.png">
+ <LogicalName>element-keyword-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-keyword-16~dark~sel.png">
+ <LogicalName>element-keyword-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-keyword-16~dark~sel%402x.png">
+ <LogicalName>element-keyword-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\monodevelop-16.png">
<LogicalName>monodevelop-16.png</LogicalName>
</EmbeddedResource>
@@ -555,53 +1474,215 @@
<EmbeddedResource Include="icons\package-16%402x.png">
<LogicalName>package-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\package-16~dark.png">
+ <LogicalName>package-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-16~dark%402x.png">
+ <LogicalName>package-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-16~sel.png">
+ <LogicalName>package-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-16~sel%402x.png">
+ <LogicalName>package-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-16~dark~sel.png">
+ <LogicalName>package-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-16~dark~sel%402x.png">
+ <LogicalName>package-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\package-24.png">
<LogicalName>package-24.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\package-24%402x.png">
<LogicalName>package-24@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\package-24~dark.png">
+ <LogicalName>package-24~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-24~dark%402x.png">
+ <LogicalName>package-24~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-24~sel.png">
+ <LogicalName>package-24~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-24~sel%402x.png">
+ <LogicalName>package-24~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-24~dark~sel.png">
+ <LogicalName>package-24~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-24~dark~sel%402x.png">
+ <LogicalName>package-24~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\package-32.png">
<LogicalName>package-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\package-32%402x.png">
<LogicalName>package-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\package-32~dark.png">
+ <LogicalName>package-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-32~dark%402x.png">
+ <LogicalName>package-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-32~sel.png">
+ <LogicalName>package-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-32~sel%402x.png">
+ <LogicalName>package-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-32~dark~sel.png">
+ <LogicalName>package-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-32~dark~sel%402x.png">
+ <LogicalName>package-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\package-48.png">
<LogicalName>package-48.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\package-48%402x.png">
<LogicalName>package-48@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\package-48~dark.png">
+ <LogicalName>package-48~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-48~dark%402x.png">
+ <LogicalName>package-48~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-48~sel.png">
+ <LogicalName>package-48~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-48~sel%402x.png">
+ <LogicalName>package-48~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-48~dark~sel.png">
+ <LogicalName>package-48~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-48~dark~sel%402x.png">
+ <LogicalName>package-48~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\pad-task-list-16.png">
<LogicalName>pad-task-list-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\pad-task-list-16%402x.png">
<LogicalName>pad-task-list-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-task-list-16~dark.png">
+ <LogicalName>pad-task-list-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-task-list-16~dark%402x.png">
+ <LogicalName>pad-task-list-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-task-list-16~sel.png">
+ <LogicalName>pad-task-list-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-task-list-16~sel%402x.png">
+ <LogicalName>pad-task-list-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-task-list-16~dark~sel.png">
+ <LogicalName>pad-task-list-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-task-list-16~dark~sel%402x.png">
+ <LogicalName>pad-task-list-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\project-16.png">
<LogicalName>project-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\project-16%402x.png">
<LogicalName>project-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\project-16~dark.png">
+ <LogicalName>project-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-16~dark%402x.png">
+ <LogicalName>project-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-16~sel.png">
+ <LogicalName>project-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-16~sel%402x.png">
+ <LogicalName>project-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-16~dark~sel.png">
+ <LogicalName>project-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-16~dark~sel%402x.png">
+ <LogicalName>project-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\project-32.png">
<LogicalName>project-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\project-32%402x.png">
<LogicalName>project-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\project-32~dark.png">
+ <LogicalName>project-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-32~dark%402x.png">
+ <LogicalName>project-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-32~sel.png">
+ <LogicalName>project-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-32~sel%402x.png">
+ <LogicalName>project-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-32~dark~sel.png">
+ <LogicalName>project-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-32~dark~sel%402x.png">
+ <LogicalName>project-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\project-console-overlay-32.png">
<LogicalName>project-console-overlay-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\project-console-overlay-32%402x.png">
<LogicalName>project-console-overlay-32@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\project-gui-overlay-32.png">
- <LogicalName>project-gui-overlay-32.png</LogicalName>
+ <EmbeddedResource Include="icons\project-console-overlay-32~dark.png">
+ <LogicalName>project-console-overlay-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-console-overlay-32~dark%402x.png">
+ <LogicalName>project-console-overlay-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-console-overlay-32~sel.png">
+ <LogicalName>project-console-overlay-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-console-overlay-32~sel%402x.png">
+ <LogicalName>project-console-overlay-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-console-overlay-32~dark~sel.png">
+ <LogicalName>project-console-overlay-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-console-overlay-32~dark~sel%402x.png">
+ <LogicalName>project-console-overlay-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-gtk2-overlay-32.png">
+ <LogicalName>project-gtk2-overlay-32.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\project-gui-overlay-32%402x.png">
- <LogicalName>project-gui-overlay-32@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\project-gtk2-overlay-32%402x.png">
+ <LogicalName>project-gtk2-overlay-32@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-gtk2-overlay-32~dark.png">
+ <LogicalName>project-gtk2-overlay-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-gtk2-overlay-32~dark%402x.png">
+ <LogicalName>project-gtk2-overlay-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-gtk2-overlay-32~sel.png">
+ <LogicalName>project-gtk2-overlay-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-gtk2-overlay-32~sel%402x.png">
+ <LogicalName>project-gtk2-overlay-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-gtk2-overlay-32~dark~sel.png">
+ <LogicalName>project-gtk2-overlay-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-gtk2-overlay-32~dark~sel%402x.png">
+ <LogicalName>project-gtk2-overlay-32~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\project-library-overlay-32.png">
<LogicalName>project-library-overlay-32.png</LogicalName>
@@ -609,20 +1690,95 @@
<EmbeddedResource Include="icons\project-library-overlay-32%402x.png">
<LogicalName>project-library-overlay-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\project-library-overlay-32~dark.png">
+ <LogicalName>project-library-overlay-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-library-overlay-32~dark%402x.png">
+ <LogicalName>project-library-overlay-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-library-overlay-32~sel.png">
+ <LogicalName>project-library-overlay-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-library-overlay-32~sel%402x.png">
+ <LogicalName>project-library-overlay-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-library-overlay-32~dark~sel.png">
+ <LogicalName>project-library-overlay-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-library-overlay-32~dark~sel%402x.png">
+ <LogicalName>project-library-overlay-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\project-shared-assets-overlay-32.png">
<LogicalName>project-shared-assets-overlay-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\project-shared-assets-overlay-32%402x.png">
<LogicalName>project-shared-assets-overlay-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\project-shared-assets-overlay-32~dark.png">
+ <LogicalName>project-shared-assets-overlay-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-shared-assets-overlay-32~dark%402x.png">
+ <LogicalName>project-shared-assets-overlay-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-shared-assets-overlay-32~sel.png">
+ <LogicalName>project-shared-assets-overlay-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-shared-assets-overlay-32~sel%402x.png">
+ <LogicalName>project-shared-assets-overlay-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-shared-assets-overlay-32~dark~sel.png">
+ <LogicalName>project-shared-assets-overlay-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-shared-assets-overlay-32~dark~sel%402x.png">
+ <LogicalName>project-shared-assets-overlay-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\project-package-overlay-32.png">
<LogicalName>project-package-overlay-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\project-package-overlay-32%402x.png">
<LogicalName>project-package-overlay-32@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\project-new-16.png">
- <LogicalName>project-new-16.png</LogicalName>
+ <EmbeddedResource Include="icons\project-package-overlay-32~dark.png">
+ <LogicalName>project-package-overlay-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-package-overlay-32~dark%402x.png">
+ <LogicalName>project-package-overlay-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-package-overlay-32~sel.png">
+ <LogicalName>project-package-overlay-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-package-overlay-32~sel%402x.png">
+ <LogicalName>project-package-overlay-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-package-overlay-32~dark~sel.png">
+ <LogicalName>project-package-overlay-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-package-overlay-32~dark~sel%402x.png">
+ <LogicalName>project-package-overlay-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-project-16.png">
+ <LogicalName>new-project-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-project-16%402x.png">
+ <LogicalName>new-project-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-project-16~dark.png">
+ <LogicalName>new-project-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-project-16~dark%402x.png">
+ <LogicalName>new-project-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-workspace-16.png">
+ <LogicalName>new-workspace-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-workspace-16%402x.png">
+ <LogicalName>new-workspace-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-workspace-16~dark.png">
+ <LogicalName>new-workspace-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-workspace-16~dark%402x.png">
+ <LogicalName>new-workspace-16~dark@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\package-source-16.png">
<LogicalName>package-source-16.png</LogicalName>
@@ -630,83 +1786,311 @@
<EmbeddedResource Include="icons\package-source-16%402x.png">
<LogicalName>package-source-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\package-source-16~dark.png">
+ <LogicalName>package-source-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-source-16~dark%402x.png">
+ <LogicalName>package-source-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-source-16~sel.png">
+ <LogicalName>package-source-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-source-16~sel%402x.png">
+ <LogicalName>package-source-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-source-16~dark~sel.png">
+ <LogicalName>package-source-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\package-source-16~dark~sel%402x.png">
+ <LogicalName>package-source-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\reference-16.png">
<LogicalName>reference-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\reference-16%402x.png">
<LogicalName>reference-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-16~dark.png">
+ <LogicalName>reference-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-16~dark%402x.png">
+ <LogicalName>reference-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-16~sel.png">
+ <LogicalName>reference-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-16~sel%402x.png">
+ <LogicalName>reference-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-16~dark~sel.png">
+ <LogicalName>reference-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\reference-16~dark~sel%402x.png">
+ <LogicalName>reference-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\solution-16.png">
<LogicalName>solution-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\solution-16%402x.png">
<LogicalName>solution-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\solution-16~dark.png">
+ <LogicalName>solution-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\solution-16~dark%402x.png">
+ <LogicalName>solution-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\solution-16~sel.png">
+ <LogicalName>solution-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\solution-16~sel%402x.png">
+ <LogicalName>solution-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\solution-16~dark~sel.png">
+ <LogicalName>solution-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\solution-16~dark~sel%402x.png">
+ <LogicalName>solution-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\solution-32.png">
<LogicalName>solution-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\solution-32%402x.png">
<LogicalName>solution-32@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\solution-64.png">
- <LogicalName>solution-64.png</LogicalName>
+ <EmbeddedResource Include="icons\solution-32~dark.png">
+ <LogicalName>solution-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\solution-32~dark%402x.png">
+ <LogicalName>solution-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\solution-32~sel.png">
+ <LogicalName>solution-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\solution-32~sel%402x.png">
+ <LogicalName>solution-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\solution-32~dark~sel.png">
+ <LogicalName>solution-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\solution-32~dark~sel%402x.png">
+ <LogicalName>solution-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-solution-folder-16.png">
+ <LogicalName>new-solution-folder-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-solution-folder-16%402x.png">
+ <LogicalName>new-solution-folder-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-solution-folder-16~dark.png">
+ <LogicalName>new-solution-folder-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-solution-folder-16~dark%402x.png">
+ <LogicalName>new-solution-folder-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-solution-16.png">
+ <LogicalName>new-solution-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-solution-16%402x.png">
+ <LogicalName>new-solution-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-solution-16~dark.png">
+ <LogicalName>new-solution-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\new-solution-16~dark%402x.png">
+ <LogicalName>new-solution-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-private-diamond-overlay-16.png">
+ <LogicalName>element-visibility-private-diamond-overlay-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-private-diamond-overlay-16%402x.png">
+ <LogicalName>element-visibility-private-diamond-overlay-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-private-diamond-overlay-16~dark.png">
+ <LogicalName>element-visibility-private-diamond-overlay-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-private-diamond-overlay-16~dark%402x.png">
+ <LogicalName>element-visibility-private-diamond-overlay-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\solution-64%402x.png">
- <LogicalName>solution-64@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\element-visibility-private-diamond-overlay-16~sel.png">
+ <LogicalName>element-visibility-private-diamond-overlay-16~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\solution-128.png">
- <LogicalName>solution-128.png</LogicalName>
+ <EmbeddedResource Include="icons\element-visibility-private-diamond-overlay-16~sel%402x.png">
+ <LogicalName>element-visibility-private-diamond-overlay-16~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\solution-128%402x.png">
- <LogicalName>solution-128@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\element-visibility-private-diamond-overlay-16~dark~sel.png">
+ <LogicalName>element-visibility-private-diamond-overlay-16~dark~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\solution-folder-new-16.png">
- <LogicalName>solution-folder-new-16.png</LogicalName>
+ <EmbeddedResource Include="icons\element-visibility-private-diamond-overlay-16~dark~sel%402x.png">
+ <LogicalName>element-visibility-private-diamond-overlay-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\solution-new-16.png">
- <LogicalName>solution-new-16.png</LogicalName>
+ <EmbeddedResource Include="icons\element-visibility-private-square-overlay-16.png">
+ <LogicalName>element-visibility-private-square-overlay-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\element-visibility-internal-overlay-16.png">
- <LogicalName>element-visibility-internal-overlay-16.png</LogicalName>
+ <EmbeddedResource Include="icons\element-visibility-private-square-overlay-16%402x.png">
+ <LogicalName>element-visibility-private-square-overlay-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\element-visibility-internal-overlay-16%402x.png">
- <LogicalName>element-visibility-internal-overlay-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\element-visibility-private-square-overlay-16~dark.png">
+ <LogicalName>element-visibility-private-square-overlay-16~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\element-visibility-private-overlay-16.png">
- <LogicalName>element-visibility-private-overlay-16.png</LogicalName>
+ <EmbeddedResource Include="icons\element-visibility-private-square-overlay-16~dark%402x.png">
+ <LogicalName>element-visibility-private-square-overlay-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\element-visibility-private-overlay-16%402x.png">
- <LogicalName>element-visibility-private-overlay-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\element-visibility-private-square-overlay-16~sel.png">
+ <LogicalName>element-visibility-private-square-overlay-16~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\element-visibility-protected-overlay-16.png">
- <LogicalName>element-visibility-protected-overlay-16.png</LogicalName>
+ <EmbeddedResource Include="icons\element-visibility-private-square-overlay-16~sel%402x.png">
+ <LogicalName>element-visibility-private-square-overlay-16~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\element-visibility-protected-overlay-16%402x.png">
- <LogicalName>element-visibility-protected-overlay-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\element-visibility-private-square-overlay-16~dark~sel.png">
+ <LogicalName>element-visibility-private-square-overlay-16~dark~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\element-visibility-internal-an-protected-overlay-16.png">
- <LogicalName>element-visibility-internal-an-protected-overlay-16.png</LogicalName>
+ <EmbeddedResource Include="icons\element-visibility-private-square-overlay-16~dark~sel%402x.png">
+ <LogicalName>element-visibility-private-square-overlay-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\element-visibility-internal-an-protected-overlay-16%402x.png">
- <LogicalName>element-visibility-internal-an-protected-overlay-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\element-visibility-protected-diamond-overlay-16.png">
+ <LogicalName>element-visibility-protected-diamond-overlay-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\element-visibility-internal-or-protected-overlay-16.png">
- <LogicalName>element-visibility-internal-or-protected-overlay-16.png</LogicalName>
+ <EmbeddedResource Include="icons\element-visibility-protected-diamond-overlay-16%402x.png">
+ <LogicalName>element-visibility-protected-diamond-overlay-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\element-visibility-internal-or-protected-overlay-16%402x.png">
- <LogicalName>element-visibility-internal-or-protected-overlay-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\element-visibility-protected-diamond-overlay-16~dark.png">
+ <LogicalName>element-visibility-protected-diamond-overlay-16~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\element-visibility-static-overlay-16.png">
- <LogicalName>element-visibility-static-overlay-16.png</LogicalName>
+ <EmbeddedResource Include="icons\element-visibility-protected-diamond-overlay-16~dark%402x.png">
+ <LogicalName>element-visibility-protected-diamond-overlay-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\element-visibility-static-overlay-16%402x.png">
- <LogicalName>element-visibility-static-overlay-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\element-visibility-protected-diamond-overlay-16~sel.png">
+ <LogicalName>element-visibility-protected-diamond-overlay-16~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\project-web-overlay-32.png">
- <LogicalName>project-web-overlay-32.png</LogicalName>
+ <EmbeddedResource Include="icons\element-visibility-protected-diamond-overlay-16~sel%402x.png">
+ <LogicalName>element-visibility-protected-diamond-overlay-16~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\project-web-overlay-32%402x.png">
- <LogicalName>project-web-overlay-32@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\element-visibility-protected-diamond-overlay-16~dark~sel.png">
+ <LogicalName>element-visibility-protected-diamond-overlay-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-protected-diamond-overlay-16~dark~sel%402x.png">
+ <LogicalName>element-visibility-protected-diamond-overlay-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-protected-square-overlay-16.png">
+ <LogicalName>element-visibility-protected-square-overlay-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-protected-square-overlay-16%402x.png">
+ <LogicalName>element-visibility-protected-square-overlay-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-protected-square-overlay-16~dark.png">
+ <LogicalName>element-visibility-protected-square-overlay-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-protected-square-overlay-16~dark%402x.png">
+ <LogicalName>element-visibility-protected-square-overlay-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-protected-square-overlay-16~sel.png">
+ <LogicalName>element-visibility-protected-square-overlay-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-protected-square-overlay-16~sel%402x.png">
+ <LogicalName>element-visibility-protected-square-overlay-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-protected-square-overlay-16~dark~sel.png">
+ <LogicalName>element-visibility-protected-square-overlay-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-protected-square-overlay-16~dark~sel%402x.png">
+ <LogicalName>element-visibility-protected-square-overlay-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-internal-diamond-overlay-16.png">
+ <LogicalName>element-visibility-internal-diamond-overlay-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-internal-diamond-overlay-16%402x.png">
+ <LogicalName>element-visibility-internal-diamond-overlay-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-internal-diamond-overlay-16~dark.png">
+ <LogicalName>element-visibility-internal-diamond-overlay-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-internal-diamond-overlay-16~dark%402x.png">
+ <LogicalName>element-visibility-internal-diamond-overlay-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-internal-diamond-overlay-16~sel.png">
+ <LogicalName>element-visibility-internal-diamond-overlay-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-internal-diamond-overlay-16~sel%402x.png">
+ <LogicalName>element-visibility-internal-diamond-overlay-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-internal-diamond-overlay-16~dark~sel.png">
+ <LogicalName>element-visibility-internal-diamond-overlay-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-internal-diamond-overlay-16~dark~sel%402x.png">
+ <LogicalName>element-visibility-internal-diamond-overlay-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-internal-square-overlay-16.png">
+ <LogicalName>element-visibility-internal-square-overlay-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-internal-square-overlay-16%402x.png">
+ <LogicalName>element-visibility-internal-square-overlay-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-internal-square-overlay-16~dark.png">
+ <LogicalName>element-visibility-internal-square-overlay-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-internal-square-overlay-16~dark%402x.png">
+ <LogicalName>element-visibility-internal-square-overlay-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-internal-square-overlay-16~sel.png">
+ <LogicalName>element-visibility-internal-square-overlay-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-internal-square-overlay-16~sel%402x.png">
+ <LogicalName>element-visibility-internal-square-overlay-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-internal-square-overlay-16~dark~sel.png">
+ <LogicalName>element-visibility-internal-square-overlay-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-visibility-internal-square-overlay-16~dark~sel%402x.png">
+ <LogicalName>element-visibility-internal-square-overlay-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-static-overlay-16.png">
+ <LogicalName>element-static-overlay-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-static-overlay-16%402x.png">
+ <LogicalName>element-static-overlay-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-static-overlay-16~dark.png">
+ <LogicalName>element-static-overlay-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-static-overlay-16~dark%402x.png">
+ <LogicalName>element-static-overlay-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-static-overlay-16~sel.png">
+ <LogicalName>element-static-overlay-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-static-overlay-16~sel%402x.png">
+ <LogicalName>element-static-overlay-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-static-overlay-16~dark~sel.png">
+ <LogicalName>element-static-overlay-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-static-overlay-16~dark~sel%402x.png">
+ <LogicalName>element-static-overlay-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-web-32.png">
+ <LogicalName>project-web-32.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-web-32%402x.png">
+ <LogicalName>project-web-32@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-web-32~dark.png">
+ <LogicalName>project-web-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-web-32~dark%402x.png">
+ <LogicalName>project-web-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-web-32~sel.png">
+ <LogicalName>project-web-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-web-32~sel%402x.png">
+ <LogicalName>project-web-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-web-32~dark~sel.png">
+ <LogicalName>project-web-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\project-web-32~dark~sel%402x.png">
+ <LogicalName>project-web-32~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\workspace-16.png">
<LogicalName>workspace-16.png</LogicalName>
@@ -714,30 +2098,84 @@
<EmbeddedResource Include="icons\workspace-16%402x.png">
<LogicalName>workspace-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\workspace-16~dark.png">
+ <LogicalName>workspace-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\workspace-16~dark%402x.png">
+ <LogicalName>workspace-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\workspace-16~sel.png">
+ <LogicalName>workspace-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\workspace-16~sel%402x.png">
+ <LogicalName>workspace-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\workspace-16~dark~sel.png">
+ <LogicalName>workspace-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\workspace-16~dark~sel%402x.png">
+ <LogicalName>workspace-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\workspace-32.png">
<LogicalName>workspace-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\workspace-32%402x.png">
<LogicalName>workspace-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\workspace-32~dark.png">
+ <LogicalName>workspace-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\workspace-32~dark%402x.png">
+ <LogicalName>workspace-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\workspace-32~sel.png">
+ <LogicalName>workspace-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\workspace-32~sel%402x.png">
+ <LogicalName>workspace-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\workspace-32~dark~sel.png">
+ <LogicalName>workspace-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\workspace-32~dark~sel%402x.png">
+ <LogicalName>workspace-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.Docking\icons\pad-minimize-9.png">
<LogicalName>pad-minimize-9.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.Docking\icons\pad-minimize-9%402x.png">
<LogicalName>pad-minimize-9@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.Docking\icons\pad-minimize-9~dark.png">
+ <LogicalName>pad-minimize-9~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.Docking\icons\pad-minimize-9~dark%402x.png">
+ <LogicalName>pad-minimize-9~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.Docking\icons\pad-close-9.png">
<LogicalName>pad-close-9.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.Docking\icons\pad-close-9%402x.png">
<LogicalName>pad-close-9@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.Docking\icons\pad-close-9~dark.png">
+ <LogicalName>pad-close-9~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.Docking\icons\pad-close-9~dark%402x.png">
+ <LogicalName>pad-close-9~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.Docking\icons\pad-dock-9.png">
<LogicalName>pad-dock-9.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.Docking\icons\pad-dock-9%402x.png">
<LogicalName>pad-dock-9@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.Docking\icons\pad-dock-9~dark.png">
+ <LogicalName>pad-dock-9~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.Docking\icons\pad-dock-9~dark%402x.png">
+ <LogicalName>pad-dock-9~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Ide.Gui.Pads.ProjectPad\ProjectPadContextMenu.addin.xml">
<LogicalName>ProjectPadContextMenu.addin.xml</LogicalName>
</EmbeddedResource>
@@ -789,185 +2227,476 @@
<EmbeddedResource Include="icons\feedback-16%402x.png">
<LogicalName>feedback-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\feedback-16~dark.png">
+ <LogicalName>feedback-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\feedback-16~dark%402x.png">
+ <LogicalName>feedback-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\feedback-16~disabled.png">
+ <LogicalName>feedback-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\feedback-16~disabled%402x.png">
+ <LogicalName>feedback-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\feedback-16~dark~disabled.png">
+ <LogicalName>feedback-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\feedback-16~dark~disabled%402x.png">
+ <LogicalName>feedback-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\updates-16.png">
<LogicalName>updates-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\updates-16%402x.png">
<LogicalName>updates-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="branding\WelcomePage_Logo.png">
- <LogicalName>WelcomePage_Logo.png</LogicalName>
+ <EmbeddedResource Include="icons\updates-16~dark.png">
+ <LogicalName>updates-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\updates-16~dark%402x.png">
+ <LogicalName>updates-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\updates-16~disabled.png">
+ <LogicalName>updates-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\updates-16~disabled%402x.png">
+ <LogicalName>updates-16~disabled@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="branding\WelcomePage_TopBorderRepeat.png">
- <LogicalName>WelcomePage_TopBorderRepeat.png</LogicalName>
+ <EmbeddedResource Include="icons\updates-16~dark~disabled.png">
+ <LogicalName>updates-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\updates-16~dark~disabled%402x.png">
+ <LogicalName>updates-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="branding\welcome-logo.png">
+ <LogicalName>welcome-logo.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="branding\welcome-logo%402x.png">
+ <LogicalName>welcome-logo@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="branding\welcome-tile.png">
+ <LogicalName>welcome-tile.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="branding\welcome-tile%402x.png">
+ <LogicalName>welcome-tile@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="branding\AboutImage.png">
<LogicalName>AboutImage.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="branding\AboutImage%402x.png">
+ <LogicalName>AboutImage@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\popup-close-16.png">
<LogicalName>popup-close-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\popup-close-16%402x.png">
<LogicalName>popup-close-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\popup-close-16~dark.png">
+ <LogicalName>popup-close-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\popup-close-16~dark%402x.png">
+ <LogicalName>popup-close-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\popup-close-hover-16.png">
<LogicalName>popup-close-hover-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\popup-close-hover-16%402x.png">
<LogicalName>popup-close-hover-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\popup-close-hover-16~dark.png">
+ <LogicalName>popup-close-hover-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\popup-close-hover-16~dark%402x.png">
+ <LogicalName>popup-close-hover-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-left-cap-normal.png">
<LogicalName>btn-debug-base-left-cap-normal.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-left-cap-normal%402x.png">
<LogicalName>btn-debug-base-left-cap-normal@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-left-cap-normal~dark.png">
+ <LogicalName>btn-debug-base-left-cap-normal~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-left-cap-normal~dark%402x.png">
+ <LogicalName>btn-debug-base-left-cap-normal~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-left-cap-pressed.png">
<LogicalName>btn-debug-base-left-cap-pressed.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-left-cap-pressed%402x.png">
<LogicalName>btn-debug-base-left-cap-pressed@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-left-cap-pressed~dark.png">
+ <LogicalName>btn-debug-base-left-cap-pressed~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-left-cap-pressed~dark%402x.png">
+ <LogicalName>btn-debug-base-left-cap-pressed~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-middle-cap-normal.png">
<LogicalName>btn-debug-base-middle-cap-normal.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-middle-cap-normal%402x.png">
<LogicalName>btn-debug-base-middle-cap-normal@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-middle-cap-normal~dark.png">
+ <LogicalName>btn-debug-base-middle-cap-normal~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-middle-cap-normal~dark%402x.png">
+ <LogicalName>btn-debug-base-middle-cap-normal~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-middle-cap-pressed.png">
<LogicalName>btn-debug-base-middle-cap-pressed.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-middle-cap-pressed%402x.png">
<LogicalName>btn-debug-base-middle-cap-pressed@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-middle-cap-pressed~dark.png">
+ <LogicalName>btn-debug-base-middle-cap-pressed~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-middle-cap-pressed~dark%402x.png">
+ <LogicalName>btn-debug-base-middle-cap-pressed~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-right-cap-normal.png">
<LogicalName>btn-debug-base-right-cap-normal.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-right-cap-normal%402x.png">
<LogicalName>btn-debug-base-right-cap-normal@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-right-cap-normal~dark.png">
+ <LogicalName>btn-debug-base-right-cap-normal~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-right-cap-normal~dark%402x.png">
+ <LogicalName>btn-debug-base-right-cap-normal~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-right-cap-pressed.png">
<LogicalName>btn-debug-base-right-cap-pressed.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-right-cap-pressed%402x.png">
<LogicalName>btn-debug-base-right-cap-pressed@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-right-cap-pressed~dark.png">
+ <LogicalName>btn-debug-base-right-cap-pressed~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-debug-base-right-cap-pressed~dark%402x.png">
+ <LogicalName>btn-debug-base-right-cap-pressed~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-execute-disabled-32.png">
<LogicalName>btn-execute-disabled-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-execute-disabled-32%402x.png">
<LogicalName>btn-execute-disabled-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-execute-disabled-32~dark.png">
+ <LogicalName>btn-execute-disabled-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-execute-disabled-32~dark%402x.png">
+ <LogicalName>btn-execute-disabled-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-execute-hover-32.png">
<LogicalName>btn-execute-hover-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-execute-hover-32%402x.png">
<LogicalName>btn-execute-hover-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-execute-hover-32~dark.png">
+ <LogicalName>btn-execute-hover-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-execute-hover-32~dark%402x.png">
+ <LogicalName>btn-execute-hover-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-execute-normal-32.png">
<LogicalName>btn-execute-normal-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-execute-normal-32%402x.png">
<LogicalName>btn-execute-normal-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-execute-normal-32~dark.png">
+ <LogicalName>btn-execute-normal-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-execute-normal-32~dark%402x.png">
+ <LogicalName>btn-execute-normal-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-execute-pressed-32.png">
<LogicalName>btn-execute-pressed-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-execute-pressed-32%402x.png">
<LogicalName>btn-execute-pressed-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-execute-pressed-32~dark.png">
+ <LogicalName>btn-execute-pressed-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\assets\btn-execute-pressed-32~dark%402x.png">
+ <LogicalName>btn-execute-pressed-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-execute-disabled-32.png">
<LogicalName>ico-execute-disabled-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-execute-disabled-32%402x.png">
<LogicalName>ico-execute-disabled-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-execute-disabled-32~dark.png">
+ <LogicalName>ico-execute-disabled-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-execute-disabled-32~dark%402x.png">
+ <LogicalName>ico-execute-disabled-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-execute-normal-32.png">
<LogicalName>ico-execute-normal-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-execute-normal-32%402x.png">
<LogicalName>ico-execute-normal-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-execute-normal-32~dark.png">
+ <LogicalName>ico-execute-normal-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-execute-normal-32~dark%402x.png">
+ <LogicalName>ico-execute-normal-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-stop-disabled-32.png">
<LogicalName>ico-stop-disabled-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-stop-disabled-32%402x.png">
<LogicalName>ico-stop-disabled-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-stop-disabled-32~dark.png">
+ <LogicalName>ico-stop-disabled-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-stop-disabled-32~dark%402x.png">
+ <LogicalName>ico-stop-disabled-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-stop-normal-32.png">
<LogicalName>ico-stop-normal-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-stop-normal-32%402x.png">
<LogicalName>ico-stop-normal-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-stop-normal-32~dark.png">
+ <LogicalName>ico-stop-normal-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-stop-normal-32~dark%402x.png">
+ <LogicalName>ico-stop-normal-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\disclose-arrow-down-16.png">
<LogicalName>disclose-arrow-down-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\disclose-arrow-down-16%402x.png">
<LogicalName>disclose-arrow-down-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\disclose-arrow-down-16~dark.png">
+ <LogicalName>disclose-arrow-down-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\disclose-arrow-down-16~dark%402x.png">
+ <LogicalName>disclose-arrow-down-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\disclose-arrow-up-16.png">
<LogicalName>disclose-arrow-up-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\disclose-arrow-up-16%402x.png">
<LogicalName>disclose-arrow-up-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\pad-search-results-16.png">
- <LogicalName>pad-search-results-16.png</LogicalName>
+ <EmbeddedResource Include="icons\disclose-arrow-up-16~dark.png">
+ <LogicalName>disclose-arrow-up-16~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\pad-search-results-16%402x.png">
- <LogicalName>pad-search-results-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\disclose-arrow-up-16~dark%402x.png">
+ <LogicalName>disclose-arrow-up-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\searchbox-clear-16.png">
- <LogicalName>searchbox-clear-16.png</LogicalName>
+ <EmbeddedResource Include="icons\pad-search-16.png">
+ <LogicalName>pad-search-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\searchbox-clear-16%402x.png">
- <LogicalName>searchbox-clear-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\pad-search-16%402x.png">
+ <LogicalName>pad-search-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\searchbox-search-16.png">
- <LogicalName>searchbox-search-16.png</LogicalName>
+ <EmbeddedResource Include="icons\pad-search-16~dark.png">
+ <LogicalName>pad-search-16~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\searchbox-search-16%402x.png">
- <LogicalName>searchbox-search-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\pad-search-16~dark%402x.png">
+ <LogicalName>pad-search-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\tree-popup-button.png">
- <LogicalName>tree-popup-button.png</LogicalName>
+ <EmbeddedResource Include="icons\pad-search-16~sel.png">
+ <LogicalName>pad-search-16~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\tree-popup-button%402x.png">
- <LogicalName>tree-popup-button@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\pad-search-16~sel%402x.png">
+ <LogicalName>pad-search-16~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\tree-popup-button-hover.png">
- <LogicalName>tree-popup-button-hover.png</LogicalName>
+ <EmbeddedResource Include="icons\pad-search-16~dark~sel.png">
+ <LogicalName>pad-search-16~dark~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\tree-popup-button-hover%402x.png">
- <LogicalName>tree-popup-button-hover@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\pad-search-16~dark~sel%402x.png">
+ <LogicalName>pad-search-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\tree-popup-button-down.png">
- <LogicalName>tree-popup-button-down.png</LogicalName>
+ <EmbeddedResource Include="icons\pad-solution-16.png">
+ <LogicalName>pad-solution-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\tree-popup-button-down%402x.png">
- <LogicalName>tree-popup-button-down@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\pad-solution-16%402x.png">
+ <LogicalName>pad-solution-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\clear-all-bookmarks-16.png">
- <LogicalName>clear-all-bookmarks-16.png</LogicalName>
+ <EmbeddedResource Include="icons\pad-solution-16~dark.png">
+ <LogicalName>pad-solution-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-solution-16~dark%402x.png">
+ <LogicalName>pad-solution-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-solution-16~sel.png">
+ <LogicalName>pad-solution-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-solution-16~sel%402x.png">
+ <LogicalName>pad-solution-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-solution-16~dark~sel.png">
+ <LogicalName>pad-solution-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-solution-16~dark~sel%402x.png">
+ <LogicalName>pad-solution-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\searchbox-clear-mac-16.png">
+ <LogicalName>searchbox-clear-mac-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\searchbox-clear-mac-16%402x.png">
+ <LogicalName>searchbox-clear-mac-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\searchbox-clear-mac-16~dark.png">
+ <LogicalName>searchbox-clear-mac-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\searchbox-clear-mac-16~dark%402x.png">
+ <LogicalName>searchbox-clear-mac-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\searchbox-clear-win-24.png">
+ <LogicalName>searchbox-clear-win-24.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\searchbox-clear-win-24~dark.png">
+ <LogicalName>searchbox-clear-win-24~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\searchbox-clear-win-24~hover.png">
+ <LogicalName>searchbox-clear-win-24~hover.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\searchbox-clear-win-24~hover~dark.png">
+ <LogicalName>searchbox-clear-win-24~hover~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\searchbox-clear-win-24~pressed.png">
+ <LogicalName>searchbox-clear-win-24~pressed.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\searchbox-clear-win-24~pressed~dark.png">
+ <LogicalName>searchbox-clear-win-24~pressed~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\searchbox-search-mac-16.png">
+ <LogicalName>searchbox-search-mac-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\searchbox-search-mac-16%402x.png">
+ <LogicalName>searchbox-search-mac-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\searchbox-search-mac-16~dark.png">
+ <LogicalName>searchbox-search-mac-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\searchbox-search-mac-16~dark%402x.png">
+ <LogicalName>searchbox-search-mac-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\searchbox-search-win-24.png">
+ <LogicalName>searchbox-search-win-24.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\searchbox-search-win-24~dark.png">
+ <LogicalName>searchbox-search-win-24~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\searchbox-search-win-24~hover.png">
+ <LogicalName>searchbox-search-win-24~hover.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\searchbox-search-win-24~hover~dark.png">
+ <LogicalName>searchbox-search-win-24~hover~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\searchbox-search-win-24~pressed.png">
+ <LogicalName>searchbox-search-win-24~pressed.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\searchbox-search-win-24~pressed~dark.png">
+ <LogicalName>searchbox-search-win-24~pressed~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\bookmark-clear-all-16.png">
+ <LogicalName>bookmark-clear-all-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\bookmark-clear-all-16%402x.png">
+ <LogicalName>bookmark-clear-all-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\bookmark-clear-all-16~dark.png">
+ <LogicalName>bookmark-clear-all-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\bookmark-clear-all-16~dark%402x.png">
+ <LogicalName>bookmark-clear-all-16~dark@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\close-all-documents-16.png">
<LogicalName>close-all-documents-16.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\close-all-documents-16%402x.png">
+ <LogicalName>close-all-documents-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\close-all-documents-16~dark.png">
+ <LogicalName>close-all-documents-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\close-all-documents-16~dark%402x.png">
+ <LogicalName>close-all-documents-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\close-solution-16.png">
<LogicalName>close-solution-16.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\close-solution-16%402x.png">
+ <LogicalName>close-solution-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\close-solution-16~dark.png">
+ <LogicalName>close-solution-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\close-solution-16~dark%402x.png">
+ <LogicalName>close-solution-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\columns-one-16.png">
+ <LogicalName>columns-one-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\columns-one-16%402x.png">
+ <LogicalName>columns-one-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\columns-one-16~dark.png">
+ <LogicalName>columns-one-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\columns-one-16~dark%402x.png">
+ <LogicalName>columns-one-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\columns-two-16.png">
+ <LogicalName>columns-two-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\columns-two-16%402x.png">
+ <LogicalName>columns-two-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\columns-two-16~dark.png">
+ <LogicalName>columns-two-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\columns-two-16~dark%402x.png">
+ <LogicalName>columns-two-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\empty-16.png">
<LogicalName>empty-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\find-in-files-16.png">
- <LogicalName>find-in-files-16.png</LogicalName>
+ <EmbeddedResource Include="icons\bookmark-next-16.png">
+ <LogicalName>bookmark-next-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\bookmark-next-16%402x.png">
+ <LogicalName>bookmark-next-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\bookmark-next-16~dark.png">
+ <LogicalName>bookmark-next-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\bookmark-next-16~dark%402x.png">
+ <LogicalName>bookmark-next-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\bookmark-prev-16.png">
+ <LogicalName>bookmark-prev-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\bookmark-prev-16%402x.png">
+ <LogicalName>bookmark-prev-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\goto-next-bookmark-16.png">
- <LogicalName>goto-next-bookmark-16.png</LogicalName>
+ <EmbeddedResource Include="icons\bookmark-prev-16~dark.png">
+ <LogicalName>bookmark-prev-16~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\goto-prev-bookmark-16.png">
- <LogicalName>goto-prev-bookmark-16.png</LogicalName>
+ <EmbeddedResource Include="icons\bookmark-prev-16~dark%402x.png">
+ <LogicalName>bookmark-prev-16~dark@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\pad-application-output-16.png">
<LogicalName>pad-application-output-16.png</LogicalName>
@@ -975,20 +2704,95 @@
<EmbeddedResource Include="icons\pad-application-output-16%402x.png">
<LogicalName>pad-application-output-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-application-output-16~dark.png">
+ <LogicalName>pad-application-output-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-application-output-16~dark%402x.png">
+ <LogicalName>pad-application-output-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-application-output-16~sel.png">
+ <LogicalName>pad-application-output-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-application-output-16~sel%402x.png">
+ <LogicalName>pad-application-output-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-application-output-16~dark~sel.png">
+ <LogicalName>pad-application-output-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-application-output-16~dark~sel%402x.png">
+ <LogicalName>pad-application-output-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-classes-16.png">
+ <LogicalName>pad-classes-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-classes-16%402x.png">
+ <LogicalName>pad-classes-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-classes-16~dark.png">
+ <LogicalName>pad-classes-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-classes-16~dark%402x.png">
+ <LogicalName>pad-classes-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-classes-16~sel.png">
+ <LogicalName>pad-classes-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-classes-16~sel%402x.png">
+ <LogicalName>pad-classes-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-classes-16~dark~sel.png">
+ <LogicalName>pad-classes-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-classes-16~dark~sel%402x.png">
+ <LogicalName>pad-classes-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\pad-immediate-16.png">
<LogicalName>pad-immediate-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\pad-immediate-16%402x.png">
<LogicalName>pad-immediate-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\pad-generic-pad-16.png">
- <LogicalName>pad-generic-pad-16.png</LogicalName>
+ <EmbeddedResource Include="icons\pad-immediate-16~dark.png">
+ <LogicalName>pad-immediate-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-immediate-16~dark%402x.png">
+ <LogicalName>pad-immediate-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-immediate-16~sel.png">
+ <LogicalName>pad-immediate-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-immediate-16~sel%402x.png">
+ <LogicalName>pad-immediate-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-immediate-16~dark~sel.png">
+ <LogicalName>pad-immediate-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-immediate-16~dark~sel%402x.png">
+ <LogicalName>pad-immediate-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-generic-16.png">
+ <LogicalName>pad-generic-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\pad-generic-pad-16%402x.png">
- <LogicalName>pad-generic-pad-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\pad-generic-16%402x.png">
+ <LogicalName>pad-generic-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\replace-in-files-16.png">
- <LogicalName>replace-in-files-16.png</LogicalName>
+ <EmbeddedResource Include="icons\pad-generic-16~dark.png">
+ <LogicalName>pad-generic-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-generic-16~dark%402x.png">
+ <LogicalName>pad-generic-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-generic-16~sel.png">
+ <LogicalName>pad-generic-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-generic-16~sel%402x.png">
+ <LogicalName>pad-generic-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-generic-16~dark~sel.png">
+ <LogicalName>pad-generic-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-generic-16~dark~sel%402x.png">
+ <LogicalName>pad-generic-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-resource-16.png">
<LogicalName>file-resource-16.png</LogicalName>
@@ -996,65 +2800,299 @@
<EmbeddedResource Include="icons\file-resource-16%402x.png">
<LogicalName>file-resource-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\file-resource-16~dark.png">
+ <LogicalName>file-resource-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-resource-16~dark%402x.png">
+ <LogicalName>file-resource-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-resource-16~sel.png">
+ <LogicalName>file-resource-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-resource-16~sel%402x.png">
+ <LogicalName>file-resource-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-resource-16~dark~sel.png">
+ <LogicalName>file-resource-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-resource-16~dark~sel%402x.png">
+ <LogicalName>file-resource-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\file-resource-32.png">
<LogicalName>file-resource-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-resource-32%402x.png">
<LogicalName>file-resource-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\file-resource-32~dark.png">
+ <LogicalName>file-resource-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-resource-32~dark%402x.png">
+ <LogicalName>file-resource-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-resource-32~sel.png">
+ <LogicalName>file-resource-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-resource-32~sel%402x.png">
+ <LogicalName>file-resource-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-resource-32~dark~sel.png">
+ <LogicalName>file-resource-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-resource-32~dark~sel%402x.png">
+ <LogicalName>file-resource-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\file-text-32.png">
<LogicalName>file-text-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-text-32%402x.png">
<LogicalName>file-text-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\file-text-32~dark.png">
+ <LogicalName>file-text-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-text-32~dark%402x.png">
+ <LogicalName>file-text-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-text-32~sel.png">
+ <LogicalName>file-text-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-text-32~sel%402x.png">
+ <LogicalName>file-text-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-text-32~dark~sel.png">
+ <LogicalName>file-text-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-text-32~dark~sel%402x.png">
+ <LogicalName>file-text-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\file-text-16.png">
<LogicalName>file-text-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-text-16%402x.png">
<LogicalName>file-text-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\toggle-bookmark-16.png">
- <LogicalName>toggle-bookmark-16.png</LogicalName>
+ <EmbeddedResource Include="icons\file-text-16~dark.png">
+ <LogicalName>file-text-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-text-16~dark%402x.png">
+ <LogicalName>file-text-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-text-16~sel.png">
+ <LogicalName>file-text-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-text-16~sel%402x.png">
+ <LogicalName>file-text-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-text-16~dark~sel.png">
+ <LogicalName>file-text-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-text-16~dark~sel%402x.png">
+ <LogicalName>file-text-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\bookmark-toggle-16.png">
+ <LogicalName>bookmark-toggle-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\bookmark-toggle-16%402x.png">
+ <LogicalName>bookmark-toggle-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\bookmark-toggle-16~dark.png">
+ <LogicalName>bookmark-toggle-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\bookmark-toggle-16~dark%402x.png">
+ <LogicalName>bookmark-toggle-16~dark@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\web-search-16.png">
<LogicalName>web-search-16.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\web-search-16%402x.png">
+ <LogicalName>web-search-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\web-search-16~dark.png">
+ <LogicalName>web-search-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\web-search-16~dark%402x.png">
+ <LogicalName>web-search-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\web-search-16~disabled.png">
+ <LogicalName>web-search-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\web-search-16~disabled%402x.png">
+ <LogicalName>web-search-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\web-search-16~dark~disabled.png">
+ <LogicalName>web-search-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\web-search-16~dark~disabled%402x.png">
+ <LogicalName>web-search-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\file-generic-16.png">
<LogicalName>file-generic-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-generic-16%402x.png">
<LogicalName>file-generic-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\file-generic-16~dark.png">
+ <LogicalName>file-generic-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-generic-16~dark%402x.png">
+ <LogicalName>file-generic-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-generic-16~sel.png">
+ <LogicalName>file-generic-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-generic-16~sel%402x.png">
+ <LogicalName>file-generic-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-generic-16~dark~sel.png">
+ <LogicalName>file-generic-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-generic-16~dark~sel%402x.png">
+ <LogicalName>file-generic-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\file-generic-32.png">
<LogicalName>file-generic-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-generic-32%402x.png">
<LogicalName>file-generic-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\file-generic-32~dark.png">
+ <LogicalName>file-generic-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-generic-32~dark%402x.png">
+ <LogicalName>file-generic-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-generic-32~sel.png">
+ <LogicalName>file-generic-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-generic-32~sel%402x.png">
+ <LogicalName>file-generic-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-generic-32~dark~sel.png">
+ <LogicalName>file-generic-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-generic-32~dark~sel%402x.png">
+ <LogicalName>file-generic-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\tabbar-prev-12.png">
<LogicalName>tabbar-prev-12.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\tabbar-prev-12%402x.png">
<LogicalName>tabbar-prev-12@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\tabbar-prev-12~dark.png">
+ <LogicalName>tabbar-prev-12~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tabbar-prev-12~dark%402x.png">
+ <LogicalName>tabbar-prev-12~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tabbar-prev-hover-12.png">
+ <LogicalName>tabbar-prev-hover-12.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tabbar-prev-hover-12%402x.png">
+ <LogicalName>tabbar-prev-hover-12@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tabbar-prev-hover-12~dark.png">
+ <LogicalName>tabbar-prev-hover-12~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tabbar-prev-hover-12~dark%402x.png">
+ <LogicalName>tabbar-prev-hover-12~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\tabbar-next-12.png">
<LogicalName>tabbar-next-12.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\tabbar-next-12%402x.png">
<LogicalName>tabbar-next-12@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\breadcrumb-previous-normal-16.png">
- <LogicalName>breadcrumb-previous-normal-16.png</LogicalName>
+ <EmbeddedResource Include="icons\tabbar-next-12~dark.png">
+ <LogicalName>tabbar-next-12~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tabbar-next-12~dark%402x.png">
+ <LogicalName>tabbar-next-12~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tabbar-next-hover-12.png">
+ <LogicalName>tabbar-next-hover-12.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tabbar-next-hover-12%402x.png">
+ <LogicalName>tabbar-next-hover-12@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tabbar-next-hover-12~dark.png">
+ <LogicalName>tabbar-next-hover-12~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tabbar-next-hover-12~dark%402x.png">
+ <LogicalName>tabbar-next-hover-12~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tab-close-9.png">
+ <LogicalName>tab-close-9.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tab-close-9%402x.png">
+ <LogicalName>tab-close-9@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tab-close-9~dark.png">
+ <LogicalName>tab-close-9~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tab-close-9~dark%402x.png">
+ <LogicalName>tab-close-9~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\breadcrumb-previous-normal-16%402x.png">
- <LogicalName>breadcrumb-previous-normal-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\tab-dirty-9.png">
+ <LogicalName>tab-dirty-9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\breadcrumb-next-normal-16.png">
- <LogicalName>breadcrumb-next-normal-16.png</LogicalName>
+ <EmbeddedResource Include="icons\tab-dirty-9%402x.png">
+ <LogicalName>tab-dirty-9@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\breadcrumb-next-normal-16%402x.png">
- <LogicalName>breadcrumb-next-normal-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\tab-dirty-9~dark.png">
+ <LogicalName>tab-dirty-9~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tab-dirty-9~dark%402x.png">
+ <LogicalName>tab-dirty-9~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tabbar-menu-12.png">
+ <LogicalName>tabbar-menu-12.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tabbar-menu-12%402x.png">
+ <LogicalName>tabbar-menu-12@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tabbar-menu-12~dark.png">
+ <LogicalName>tabbar-menu-12~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tabbar-menu-12~dark%402x.png">
+ <LogicalName>tabbar-menu-12~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tabbar-menu-hover-12.png">
+ <LogicalName>tabbar-menu-hover-12.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tabbar-menu-hover-12%402x.png">
+ <LogicalName>tabbar-menu-hover-12@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tabbar-menu-hover-12~dark.png">
+ <LogicalName>tabbar-menu-hover-12~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\tabbar-menu-hover-12~dark%402x.png">
+ <LogicalName>tabbar-menu-hover-12~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breadcrumb-prev-16.png">
+ <LogicalName>breadcrumb-prev-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breadcrumb-prev-16%402x.png">
+ <LogicalName>breadcrumb-prev-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breadcrumb-prev-16~dark.png">
+ <LogicalName>breadcrumb-prev-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breadcrumb-prev-16~dark%402x.png">
+ <LogicalName>breadcrumb-prev-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breadcrumb-next-16.png">
+ <LogicalName>breadcrumb-next-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breadcrumb-next-16%402x.png">
+ <LogicalName>breadcrumb-next-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breadcrumb-next-16~dark.png">
+ <LogicalName>breadcrumb-next-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\breadcrumb-next-16~dark%402x.png">
+ <LogicalName>breadcrumb-next-16~dark@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\information-16.png">
<LogicalName>information-16.png</LogicalName>
@@ -1062,95 +3100,359 @@
<EmbeddedResource Include="icons\information-16%402x.png">
<LogicalName>information-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\information-16~dark.png">
+ <LogicalName>information-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\information-16~dark%402x.png">
+ <LogicalName>information-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\information-16~sel.png">
+ <LogicalName>information-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\information-16~sel%402x.png">
+ <LogicalName>information-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\information-16~dark~sel.png">
+ <LogicalName>information-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\information-16~dark~sel%402x.png">
+ <LogicalName>information-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\information-24.png">
<LogicalName>information-24.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\information-24%402x.png">
<LogicalName>information-24@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\information-24~dark.png">
+ <LogicalName>information-24~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\information-24~dark%402x.png">
+ <LogicalName>information-24~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\information-24~sel.png">
+ <LogicalName>information-24~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\information-24~sel%402x.png">
+ <LogicalName>information-24~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\information-24~dark~sel.png">
+ <LogicalName>information-24~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\information-24~dark~sel%402x.png">
+ <LogicalName>information-24~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\information-32.png">
<LogicalName>information-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\information-32%402x.png">
<LogicalName>information-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\information-32~dark.png">
+ <LogicalName>information-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\information-32~dark%402x.png">
+ <LogicalName>information-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\information-32~sel.png">
+ <LogicalName>information-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\information-32~sel%402x.png">
+ <LogicalName>information-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\information-32~dark~sel.png">
+ <LogicalName>information-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\information-32~dark~sel%402x.png">
+ <LogicalName>information-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\information-48.png">
<LogicalName>information-48.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\information-48%402x.png">
<LogicalName>information-48@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\information-48~dark.png">
+ <LogicalName>information-48~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\information-48~dark%402x.png">
+ <LogicalName>information-48~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\information-48~sel.png">
+ <LogicalName>information-48~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\information-48~sel%402x.png">
+ <LogicalName>information-48~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\information-48~dark~sel.png">
+ <LogicalName>information-48~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\information-48~dark~sel%402x.png">
+ <LogicalName>information-48~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\question-16.png">
<LogicalName>question-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\question-16%402x.png">
<LogicalName>question-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\question-16~dark.png">
+ <LogicalName>question-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\question-16~dark%402x.png">
+ <LogicalName>question-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\question-16~sel.png">
+ <LogicalName>question-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\question-16~sel%402x.png">
+ <LogicalName>question-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\question-16~dark~sel.png">
+ <LogicalName>question-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\question-16~dark~sel%402x.png">
+ <LogicalName>question-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\question-24.png">
<LogicalName>question-24.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\question-24%402x.png">
<LogicalName>question-24@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\question-24~dark.png">
+ <LogicalName>question-24~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\question-24~dark%402x.png">
+ <LogicalName>question-24~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\question-24~sel.png">
+ <LogicalName>question-24~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\question-24~sel%402x.png">
+ <LogicalName>question-24~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\question-24~dark~sel.png">
+ <LogicalName>question-24~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\question-24~dark~sel%402x.png">
+ <LogicalName>question-24~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\question-32.png">
<LogicalName>question-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\question-32%402x.png">
<LogicalName>question-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\question-32~dark.png">
+ <LogicalName>question-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\question-32~dark%402x.png">
+ <LogicalName>question-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\question-32~sel.png">
+ <LogicalName>question-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\question-32~sel%402x.png">
+ <LogicalName>question-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\question-32~dark~sel.png">
+ <LogicalName>question-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\question-32~dark~sel%402x.png">
+ <LogicalName>question-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\question-48.png">
<LogicalName>question-48.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\question-48%402x.png">
<LogicalName>question-48@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\question-48~dark.png">
+ <LogicalName>question-48~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\question-48~dark%402x.png">
+ <LogicalName>question-48~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\question-48~sel.png">
+ <LogicalName>question-48~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\question-48~sel%402x.png">
+ <LogicalName>question-48~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\question-48~dark~sel.png">
+ <LogicalName>question-48~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\question-48~dark~sel%402x.png">
+ <LogicalName>question-48~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\command-16.png">
<LogicalName>command-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\command-16%402x.png">
<LogicalName>command-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\command-16~dark.png">
+ <LogicalName>command-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\command-16~dark%402x.png">
+ <LogicalName>command-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\command-16~sel.png">
+ <LogicalName>command-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\command-16~sel%402x.png">
+ <LogicalName>command-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\command-16~dark~sel.png">
+ <LogicalName>command-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\command-16~dark~sel%402x.png">
+ <LogicalName>command-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-build-disabled-32.png">
<LogicalName>ico-build-disabled-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-build-disabled-32%402x.png">
<LogicalName>ico-build-disabled-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-build-disabled-32~dark.png">
+ <LogicalName>ico-build-disabled-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-build-disabled-32~dark%402x.png">
+ <LogicalName>ico-build-disabled-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-build-normal-32.png">
<LogicalName>ico-build-normal-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-build-normal-32%402x.png">
<LogicalName>ico-build-normal-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-build-normal-32~dark.png">
+ <LogicalName>ico-build-normal-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Components.MainToolbar\icons\ico-build-normal-32~dark%402x.png">
+ <LogicalName>ico-build-normal-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\stop-16.png">
<LogicalName>stop-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\stop-16%402x.png">
<LogicalName>stop-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\stop-16~dark.png">
+ <LogicalName>stop-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\stop-16~dark%402x.png">
+ <LogicalName>stop-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\stop-16~disabled.png">
+ <LogicalName>stop-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\stop-16~disabled%402x.png">
+ <LogicalName>stop-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\stop-16~dark~disabled.png">
+ <LogicalName>stop-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\stop-16~dark~disabled%402x.png">
+ <LogicalName>stop-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\clear-16.png">
<LogicalName>clear-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\clear-16%402x.png">
<LogicalName>clear-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\link-chat.png">
- <LogicalName>link-chat.png</LogicalName>
+ <EmbeddedResource Include="icons\clear-16~dark.png">
+ <LogicalName>clear-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\clear-16~dark%402x.png">
+ <LogicalName>clear-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\clear-16~disabled.png">
+ <LogicalName>clear-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\clear-16~disabled%402x.png">
+ <LogicalName>clear-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\clear-16~dark~disabled.png">
+ <LogicalName>clear-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\clear-16~dark~disabled%402x.png">
+ <LogicalName>clear-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-link-chat-16.png">
+ <LogicalName>welcome-link-chat-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-link-chat-16%402x.png">
+ <LogicalName>welcome-link-chat-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-link-chat-16~dark.png">
+ <LogicalName>welcome-link-chat-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-link-chat-16~dark%402x.png">
+ <LogicalName>welcome-link-chat-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-link-md-16.png">
+ <LogicalName>welcome-link-md-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-link-md-16%402x.png">
+ <LogicalName>welcome-link-md-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-link-md-16~dark.png">
+ <LogicalName>welcome-link-md-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-link-md-16~dark%402x.png">
+ <LogicalName>welcome-link-md-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\link-cloud.png">
- <LogicalName>link-cloud.png</LogicalName>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-link-support-16.png">
+ <LogicalName>welcome-link-support-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\link-heart.png">
- <LogicalName>link-heart.png</LogicalName>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-link-support-16%402x.png">
+ <LogicalName>welcome-link-support-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\link-info.png">
- <LogicalName>link-info.png</LogicalName>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-link-support-16~dark.png">
+ <LogicalName>welcome-link-support-16~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\new_solution.png">
- <LogicalName>new_solution.png</LogicalName>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-link-support-16~dark%402x.png">
+ <LogicalName>welcome-link-support-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\open_solution.png">
- <LogicalName>open_solution.png</LogicalName>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-link-info-16.png">
+ <LogicalName>welcome-link-info-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-link-info-16%402x.png">
+ <LogicalName>welcome-link-info-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-link-info-16~dark.png">
+ <LogicalName>welcome-link-info-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-link-info-16~dark%402x.png">
+ <LogicalName>welcome-link-info-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-new-solution-16.png">
+ <LogicalName>welcome-new-solution-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-new-solution-16%402x.png">
+ <LogicalName>welcome-new-solution-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-new-solution-16~dark.png">
+ <LogicalName>welcome-new-solution-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-new-solution-16~dark%402x.png">
+ <LogicalName>welcome-new-solution-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-open-solution-16.png">
+ <LogicalName>welcome-open-solution-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-open-solution-16%402x.png">
+ <LogicalName>welcome-open-solution-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-open-solution-16~dark.png">
+ <LogicalName>welcome-open-solution-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\welcome-open-solution-16~dark%402x.png">
+ <LogicalName>welcome-open-solution-16~dark@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\link-overlay-16.png">
<LogicalName>link-overlay-16.png</LogicalName>
@@ -1158,26 +3460,119 @@
<EmbeddedResource Include="icons\link-overlay-16%402x.png">
<LogicalName>link-overlay-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\link-overlay-16~dark.png">
+ <LogicalName>link-overlay-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\link-overlay-16~dark%402x.png">
+ <LogicalName>link-overlay-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\link-overlay-16~sel.png">
+ <LogicalName>link-overlay-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\link-overlay-16~sel%402x.png">
+ <LogicalName>link-overlay-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\link-overlay-16~dark~sel.png">
+ <LogicalName>link-overlay-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\link-overlay-16~dark~sel%402x.png">
+ <LogicalName>link-overlay-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\pad-error-list-16.png">
<LogicalName>pad-error-list-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\pad-error-list-16%402x.png">
<LogicalName>pad-error-list-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-16~dark.png">
+ <LogicalName>pad-error-list-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-16~dark%402x.png">
+ <LogicalName>pad-error-list-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-16~sel.png">
+ <LogicalName>pad-error-list-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-16~sel%402x.png">
+ <LogicalName>pad-error-list-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-16~dark~sel.png">
+ <LogicalName>pad-error-list-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-16~dark~sel%402x.png">
+ <LogicalName>pad-error-list-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\pad-error-list-errors-16.png">
<LogicalName>pad-error-list-errors-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\pad-error-list-errors-16%402x.png">
<LogicalName>pad-error-list-errors-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-errors-16~dark.png">
+ <LogicalName>pad-error-list-errors-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-errors-16~dark%402x.png">
+ <LogicalName>pad-error-list-errors-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-errors-16~disabled.png">
+ <LogicalName>pad-error-list-errors-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-errors-16~disabled%402x.png">
+ <LogicalName>pad-error-list-errors-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-errors-16~dark~disabled.png">
+ <LogicalName>pad-error-list-errors-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-errors-16~dark~disabled%402x.png">
+ <LogicalName>pad-error-list-errors-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-errors-16~sel.png">
+ <LogicalName>pad-error-list-errors-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-errors-16~sel%402x.png">
+ <LogicalName>pad-error-list-errors-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-errors-16~dark~sel.png">
+ <LogicalName>pad-error-list-errors-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-errors-16~dark~sel%402x.png">
+ <LogicalName>pad-error-list-errors-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\pad-error-list-warnings-16.png">
<LogicalName>pad-error-list-warnings-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\pad-error-list-warnings-16%402x.png">
<LogicalName>pad-error-list-warnings-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="MonoDevelop.Ide.WelcomePage\icons\starburst.png">
- <LogicalName>starburst.png</LogicalName>
+ <EmbeddedResource Include="icons\pad-error-list-warnings-16~dark.png">
+ <LogicalName>pad-error-list-warnings-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-warnings-16~dark%402x.png">
+ <LogicalName>pad-error-list-warnings-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-warnings-16~disabled.png">
+ <LogicalName>pad-error-list-warnings-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-warnings-16~disabled%402x.png">
+ <LogicalName>pad-error-list-warnings-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-warnings-16~dark~disabled.png">
+ <LogicalName>pad-error-list-warnings-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-warnings-16~dark~disabled%402x.png">
+ <LogicalName>pad-error-list-warnings-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-warnings-16~sel.png">
+ <LogicalName>pad-error-list-warnings-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-warnings-16~sel%402x.png">
+ <LogicalName>pad-error-list-warnings-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-warnings-16~dark~sel.png">
+ <LogicalName>pad-error-list-warnings-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-error-list-warnings-16~dark~sel%402x.png">
+ <LogicalName>pad-error-list-warnings-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\element-variable-16.png">
<LogicalName>element-variable-16.png</LogicalName>
@@ -1185,131 +3580,623 @@
<EmbeddedResource Include="icons\element-variable-16%402x.png">
<LogicalName>element-variable-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\element-variable-16~dark.png">
+ <LogicalName>element-variable-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-variable-16~dark%402x.png">
+ <LogicalName>element-variable-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-variable-16~sel.png">
+ <LogicalName>element-variable-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-variable-16~sel%402x.png">
+ <LogicalName>element-variable-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-variable-16~dark~sel.png">
+ <LogicalName>element-variable-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-variable-16~dark~sel%402x.png">
+ <LogicalName>element-variable-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\element-exception-16.png">
<LogicalName>element-exception-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\element-exception-16%402x.png">
<LogicalName>element-exception-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\element-exception-16~dark.png">
+ <LogicalName>element-exception-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-exception-16~dark%402x.png">
+ <LogicalName>element-exception-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-exception-16~sel.png">
+ <LogicalName>element-exception-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-exception-16~sel%402x.png">
+ <LogicalName>element-exception-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-exception-16~dark~sel.png">
+ <LogicalName>element-exception-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-exception-16~dark~sel%402x.png">
+ <LogicalName>element-exception-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\element-fs-field-16.png">
<LogicalName>element-fs-field-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\element-fs-field-16%402x.png">
<LogicalName>element-fs-field-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\element-fs-field-16~dark.png">
+ <LogicalName>element-fs-field-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-fs-field-16~dark%402x.png">
+ <LogicalName>element-fs-field-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-fs-field-16~sel.png">
+ <LogicalName>element-fs-field-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-fs-field-16~sel%402x.png">
+ <LogicalName>element-fs-field-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-fs-field-16~dark~sel.png">
+ <LogicalName>element-fs-field-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-fs-field-16~dark~sel%402x.png">
+ <LogicalName>element-fs-field-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\element-module-16.png">
<LogicalName>element-module-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\element-module-16%402x.png">
<LogicalName>element-module-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\element-module-16~dark.png">
+ <LogicalName>element-module-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-module-16~dark%402x.png">
+ <LogicalName>element-module-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-module-16~sel.png">
+ <LogicalName>element-module-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-module-16~sel%402x.png">
+ <LogicalName>element-module-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-module-16~dark~sel.png">
+ <LogicalName>element-module-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-module-16~dark~sel%402x.png">
+ <LogicalName>element-module-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\element-other-declaration-16.png">
<LogicalName>element-other-declaration-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\element-other-declaration-16%402x.png">
<LogicalName>element-other-declaration-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\element-other-declaration-16~dark.png">
+ <LogicalName>element-other-declaration-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-other-declaration-16~dark%402x.png">
+ <LogicalName>element-other-declaration-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-other-declaration-16~sel.png">
+ <LogicalName>element-other-declaration-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-other-declaration-16~sel%402x.png">
+ <LogicalName>element-other-declaration-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-other-declaration-16~dark~sel.png">
+ <LogicalName>element-other-declaration-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-other-declaration-16~dark~sel%402x.png">
+ <LogicalName>element-other-declaration-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\element-type-16.png">
<LogicalName>element-type-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\element-type-16%402x.png">
<LogicalName>element-type-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\element-type-16~dark.png">
+ <LogicalName>element-type-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-type-16~dark%402x.png">
+ <LogicalName>element-type-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-type-16~sel.png">
+ <LogicalName>element-type-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-type-16~sel%402x.png">
+ <LogicalName>element-type-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-type-16~dark~sel.png">
+ <LogicalName>element-type-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\element-type-16~dark~sel%402x.png">
+ <LogicalName>element-type-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\file-source-16.png">
<LogicalName>file-source-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-source-16%402x.png">
<LogicalName>file-source-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\file-source-16~dark.png">
+ <LogicalName>file-source-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-source-16~dark%402x.png">
+ <LogicalName>file-source-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-source-16~sel.png">
+ <LogicalName>file-source-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-source-16~sel%402x.png">
+ <LogicalName>file-source-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-source-16~dark~sel.png">
+ <LogicalName>file-source-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-source-16~dark~sel%402x.png">
+ <LogicalName>file-source-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\file-source-32.png">
<LogicalName>file-source-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-source-32%402x.png">
<LogicalName>file-source-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\file-source-32~dark.png">
+ <LogicalName>file-source-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-source-32~dark%402x.png">
+ <LogicalName>file-source-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-source-32~sel.png">
+ <LogicalName>file-source-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-source-32~sel%402x.png">
+ <LogicalName>file-source-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-source-32~dark~sel.png">
+ <LogicalName>file-source-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-source-32~dark~sel%402x.png">
+ <LogicalName>file-source-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-css-16.png">
+ <LogicalName>file-css-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-css-16%402x.png">
+ <LogicalName>file-css-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-css-16~dark.png">
+ <LogicalName>file-css-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-css-16~dark%402x.png">
+ <LogicalName>file-css-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-css-16~sel.png">
+ <LogicalName>file-css-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-css-16~sel%402x.png">
+ <LogicalName>file-css-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-css-16~dark~sel.png">
+ <LogicalName>file-css-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-css-16~dark~sel%402x.png">
+ <LogicalName>file-css-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-css-32.png">
+ <LogicalName>file-css-32.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-css-32%402x.png">
+ <LogicalName>file-css-32@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-css-32~dark.png">
+ <LogicalName>file-css-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-css-32~dark%402x.png">
+ <LogicalName>file-css-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-css-32~sel.png">
+ <LogicalName>file-css-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-css-32~sel%402x.png">
+ <LogicalName>file-css-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-css-32~dark~sel.png">
+ <LogicalName>file-css-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-css-32~dark~sel%402x.png">
+ <LogicalName>file-css-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\file-header-16.png">
<LogicalName>file-header-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-header-16%402x.png">
<LogicalName>file-header-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\file-header-16~dark.png">
+ <LogicalName>file-header-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-header-16~dark%402x.png">
+ <LogicalName>file-header-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-header-16~sel.png">
+ <LogicalName>file-header-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-header-16~sel%402x.png">
+ <LogicalName>file-header-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-header-16~dark~sel.png">
+ <LogicalName>file-header-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-header-16~dark~sel%402x.png">
+ <LogicalName>file-header-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\file-header-32.png">
<LogicalName>file-header-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-header-32%402x.png">
<LogicalName>file-header-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\file-header-32~dark.png">
+ <LogicalName>file-header-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-header-32~dark%402x.png">
+ <LogicalName>file-header-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-header-32~sel.png">
+ <LogicalName>file-header-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-header-32~sel%402x.png">
+ <LogicalName>file-header-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-header-32~dark~sel.png">
+ <LogicalName>file-header-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-header-32~dark~sel%402x.png">
+ <LogicalName>file-header-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-image-16.png">
+ <LogicalName>file-image-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-image-16%402x.png">
+ <LogicalName>file-image-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-image-16~dark.png">
+ <LogicalName>file-image-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-image-16~dark%402x.png">
+ <LogicalName>file-image-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-image-16~sel.png">
+ <LogicalName>file-image-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-image-16~sel%402x.png">
+ <LogicalName>file-image-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-image-16~dark~sel.png">
+ <LogicalName>file-image-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-image-16~dark~sel%402x.png">
+ <LogicalName>file-image-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-image-32.png">
+ <LogicalName>file-image-32.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-image-32%402x.png">
+ <LogicalName>file-image-32@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-image-32~dark.png">
+ <LogicalName>file-image-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-image-32~dark%402x.png">
+ <LogicalName>file-image-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-image-32~sel.png">
+ <LogicalName>file-image-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-image-32~sel%402x.png">
+ <LogicalName>file-image-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-image-32~dark~sel.png">
+ <LogicalName>file-image-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-image-32~dark~sel%402x.png">
+ <LogicalName>file-image-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-information-16.png">
+ <LogicalName>file-information-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-information-16%402x.png">
+ <LogicalName>file-information-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-information-16~dark.png">
+ <LogicalName>file-information-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-information-16~dark%402x.png">
+ <LogicalName>file-information-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-information-16~sel.png">
+ <LogicalName>file-information-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-information-16~sel%402x.png">
+ <LogicalName>file-information-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-information-16~dark~sel.png">
+ <LogicalName>file-information-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-information-16~dark~sel%402x.png">
+ <LogicalName>file-information-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-information-32.png">
+ <LogicalName>file-information-32.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-information-32%402x.png">
+ <LogicalName>file-information-32@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-information-32~dark.png">
+ <LogicalName>file-information-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-information-32~dark%402x.png">
+ <LogicalName>file-information-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-information-32~sel.png">
+ <LogicalName>file-information-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-information-32~sel%402x.png">
+ <LogicalName>file-information-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-information-32~dark~sel.png">
+ <LogicalName>file-information-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-information-32~dark~sel%402x.png">
+ <LogicalName>file-information-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-unit-test-16.png">
+ <LogicalName>file-unit-test-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-unit-test-16%402x.png">
+ <LogicalName>file-unit-test-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-unit-test-16~dark.png">
+ <LogicalName>file-unit-test-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-unit-test-16~dark%402x.png">
+ <LogicalName>file-unit-test-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-unit-test-16~sel.png">
+ <LogicalName>file-unit-test-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-unit-test-16~sel%402x.png">
+ <LogicalName>file-unit-test-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-unit-test-16~dark~sel.png">
+ <LogicalName>file-unit-test-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-unit-test-16~dark~sel%402x.png">
+ <LogicalName>file-unit-test-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\file-unit-test-32.png">
<LogicalName>file-unit-test-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-unit-test-32%402x.png">
<LogicalName>file-unit-test-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\file-unit-test-32~dark.png">
+ <LogicalName>file-unit-test-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-unit-test-32~dark%402x.png">
+ <LogicalName>file-unit-test-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-unit-test-32~sel.png">
+ <LogicalName>file-unit-test-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-unit-test-32~sel%402x.png">
+ <LogicalName>file-unit-test-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-unit-test-32~dark~sel.png">
+ <LogicalName>file-unit-test-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-unit-test-32~dark~sel%402x.png">
+ <LogicalName>file-unit-test-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\file-web-16.png">
<LogicalName>file-web-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-web-16%402x.png">
<LogicalName>file-web-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\file-web-16~dark.png">
+ <LogicalName>file-web-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-web-16~dark%402x.png">
+ <LogicalName>file-web-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-web-16~sel.png">
+ <LogicalName>file-web-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-web-16~sel%402x.png">
+ <LogicalName>file-web-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-web-16~dark~sel.png">
+ <LogicalName>file-web-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-web-16~dark~sel%402x.png">
+ <LogicalName>file-web-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\file-web-32.png">
<LogicalName>file-web-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-web-32%402x.png">
<LogicalName>file-web-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\file-web-32~dark.png">
+ <LogicalName>file-web-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-web-32~dark%402x.png">
+ <LogicalName>file-web-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-web-32~sel.png">
+ <LogicalName>file-web-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-web-32~sel%402x.png">
+ <LogicalName>file-web-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-web-32~dark~sel.png">
+ <LogicalName>file-web-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-web-32~dark~sel%402x.png">
+ <LogicalName>file-web-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-gtk-16.png">
+ <LogicalName>file-gtk-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-gtk-16%402x.png">
+ <LogicalName>file-gtk-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-gtk-16~dark.png">
+ <LogicalName>file-gtk-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-gtk-16~dark%402x.png">
+ <LogicalName>file-gtk-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-gtk-16~sel.png">
+ <LogicalName>file-gtk-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-gtk-16~sel%402x.png">
+ <LogicalName>file-gtk-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-gtk-16~dark~sel.png">
+ <LogicalName>file-gtk-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-gtk-16~dark~sel%402x.png">
+ <LogicalName>file-gtk-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\file-gtk-32.png">
<LogicalName>file-gtk-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\file-gtk-32%402x.png">
<LogicalName>file-gtk-32@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\folder-component-mac-16.png">
- <LogicalName>folder-component-mac-16.png</LogicalName>
+ <EmbeddedResource Include="icons\file-gtk-32~dark.png">
+ <LogicalName>file-gtk-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-gtk-32~dark%402x.png">
+ <LogicalName>file-gtk-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-gtk-32~sel.png">
+ <LogicalName>file-gtk-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-gtk-32~sel%402x.png">
+ <LogicalName>file-gtk-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-gtk-32~dark~sel.png">
+ <LogicalName>file-gtk-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\file-gtk-32~dark~sel%402x.png">
+ <LogicalName>file-gtk-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-component-16.png">
+ <LogicalName>folder-component-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-component-16%402x.png">
+ <LogicalName>folder-component-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-component-16~dark.png">
+ <LogicalName>folder-component-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-component-16~dark%402x.png">
+ <LogicalName>folder-component-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-component-16~sel.png">
+ <LogicalName>folder-component-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-component-16~sel%402x.png">
+ <LogicalName>folder-component-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-component-16~dark~sel.png">
+ <LogicalName>folder-component-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-component-16~dark~sel%402x.png">
+ <LogicalName>folder-component-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-generic-16.png">
+ <LogicalName>folder-generic-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-generic-16%402x.png">
+ <LogicalName>folder-generic-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-generic-16~dark.png">
+ <LogicalName>folder-generic-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-generic-16~dark%402x.png">
+ <LogicalName>folder-generic-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\folder-component-mac-16%402x.png">
- <LogicalName>folder-component-mac-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-generic-16~sel.png">
+ <LogicalName>folder-generic-16~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\folder-component-win-16.png">
- <LogicalName>folder-component-win-16.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-generic-16~sel%402x.png">
+ <LogicalName>folder-generic-16~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\folder-component-win-16%402x.png">
- <LogicalName>folder-component-win-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-generic-16~dark~sel.png">
+ <LogicalName>folder-generic-16~dark~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\folder-generic-mac-16.png">
- <LogicalName>folder-generic-mac-16.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-generic-16~dark~sel%402x.png">
+ <LogicalName>folder-generic-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\folder-generic-mac-16%402x.png">
- <LogicalName>folder-generic-mac-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-resource-16.png">
+ <LogicalName>folder-resource-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\folder-generic-win-16.png">
- <LogicalName>folder-generic-win-16.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-resource-16%402x.png">
+ <LogicalName>folder-resource-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\folder-generic-win-16%402x.png">
- <LogicalName>folder-generic-win-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-resource-16~dark.png">
+ <LogicalName>folder-resource-16~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\folder-special-mac-16.png">
- <LogicalName>folder-special-mac-16.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-resource-16~dark%402x.png">
+ <LogicalName>folder-resource-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\folder-special-mac-16%402x.png">
- <LogicalName>folder-special-mac-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-resource-16~sel.png">
+ <LogicalName>folder-resource-16~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\folder-special-win-16.png">
- <LogicalName>folder-special-win-16.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-resource-16~sel%402x.png">
+ <LogicalName>folder-resource-16~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\folder-special-win-16%402x.png">
- <LogicalName>folder-special-win-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-resource-16~dark~sel.png">
+ <LogicalName>folder-resource-16~dark~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\folder-web-reference-mac-16.png">
- <LogicalName>folder-web-reference-mac-16.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-resource-16~dark~sel%402x.png">
+ <LogicalName>folder-resource-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\folder-web-reference-mac-16%402x.png">
- <LogicalName>folder-web-reference-mac-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-solution-16.png">
+ <LogicalName>folder-solution-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\folder-web-reference-win-16.png">
- <LogicalName>folder-web-reference-win-16.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-solution-16%402x.png">
+ <LogicalName>folder-solution-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\folder-web-reference-win-16%402x.png">
- <LogicalName>folder-web-reference-win-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-solution-16~dark.png">
+ <LogicalName>folder-solution-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-solution-16~dark%402x.png">
+ <LogicalName>folder-solution-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-solution-16~sel.png">
+ <LogicalName>folder-solution-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-solution-16~sel%402x.png">
+ <LogicalName>folder-solution-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-solution-16~dark~sel.png">
+ <LogicalName>folder-solution-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\folder-solution-16~dark~sel%402x.png">
+ <LogicalName>folder-solution-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\pad-help-16.png">
<LogicalName>pad-help-16.png</LogicalName>
@@ -1317,41 +4204,83 @@
<EmbeddedResource Include="icons\pad-help-16%402x.png">
<LogicalName>pad-help-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-help-16~dark.png">
+ <LogicalName>pad-help-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-help-16~dark%402x.png">
+ <LogicalName>pad-help-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-help-16~sel.png">
+ <LogicalName>pad-help-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-help-16~sel%402x.png">
+ <LogicalName>pad-help-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-help-16~dark~sel.png">
+ <LogicalName>pad-help-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\pad-help-16~dark~sel%402x.png">
+ <LogicalName>pad-help-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\preferences-16.png">
<LogicalName>preferences-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\preferences-16%402x.png">
<LogicalName>preferences-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\preferences-16~dark.png">
+ <LogicalName>preferences-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\preferences-16~dark%402x.png">
+ <LogicalName>preferences-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\sort-alphabetically-16.png">
<LogicalName>sort-alphabetically-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\sort-alphabetically-16%402x.png">
<LogicalName>sort-alphabetically-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\sort-alphabetically-16~dark.png">
+ <LogicalName>sort-alphabetically-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\sort-alphabetically-16~dark%402x.png">
+ <LogicalName>sort-alphabetically-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\group-by-category-16.png">
<LogicalName>group-by-category-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\group-by-category-16%402x.png">
<LogicalName>group-by-category-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\group-by-category-16~dark.png">
+ <LogicalName>group-by-category-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\group-by-category-16~dark%402x.png">
+ <LogicalName>group-by-category-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\add-16.png">
<LogicalName>add-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\add-16%402x.png">
<LogicalName>add-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\warning-overlay-9.png">
- <LogicalName>warning-overlay-9.png</LogicalName>
+ <EmbeddedResource Include="icons\add-16~dark.png">
+ <LogicalName>add-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\add-16~dark%402x.png">
+ <LogicalName>add-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\warning-overlay-9%402x.png">
- <LogicalName>warning-overlay-9@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\add-16~disabled.png">
+ <LogicalName>add-16~disabled.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\warning-8.png">
- <LogicalName>warning-8.png</LogicalName>
+ <EmbeddedResource Include="icons\add-16~disabled%402x.png">
+ <LogicalName>add-16~disabled@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\warning-8%402x.png">
- <LogicalName>warning-8@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\add-16~dark~disabled.png">
+ <LogicalName>add-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\add-16~dark~disabled%402x.png">
+ <LogicalName>add-16~dark~disabled@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\warning-16.png">
<LogicalName>warning-16.png</LogicalName>
@@ -1359,119 +4288,431 @@
<EmbeddedResource Include="icons\warning-16%402x.png">
<LogicalName>warning-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-16~dark.png">
+ <LogicalName>warning-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-16~dark%402x.png">
+ <LogicalName>warning-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-16~sel.png">
+ <LogicalName>warning-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-16~sel%402x.png">
+ <LogicalName>warning-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-16~dark~sel.png">
+ <LogicalName>warning-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-16~dark~sel%402x.png">
+ <LogicalName>warning-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\warning-24.png">
<LogicalName>warning-24.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\warning-24%402x.png">
<LogicalName>warning-24@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-24~dark.png">
+ <LogicalName>warning-24~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-24~dark%402x.png">
+ <LogicalName>warning-24~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-24~sel.png">
+ <LogicalName>warning-24~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-24~sel%402x.png">
+ <LogicalName>warning-24~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-24~dark~sel.png">
+ <LogicalName>warning-24~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-24~dark~sel%402x.png">
+ <LogicalName>warning-24~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\warning-32.png">
<LogicalName>warning-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\warning-32%402x.png">
<LogicalName>warning-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-32~dark.png">
+ <LogicalName>warning-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-32~dark%402x.png">
+ <LogicalName>warning-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-32~sel.png">
+ <LogicalName>warning-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-32~sel%402x.png">
+ <LogicalName>warning-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-32~dark~sel.png">
+ <LogicalName>warning-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-32~dark~sel%402x.png">
+ <LogicalName>warning-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\warning-48.png">
<LogicalName>warning-48.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\warning-48%402x.png">
<LogicalName>warning-48@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-48~dark.png">
+ <LogicalName>warning-48~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-48~dark%402x.png">
+ <LogicalName>warning-48~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-48~sel.png">
+ <LogicalName>warning-48~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-48~sel%402x.png">
+ <LogicalName>warning-48~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-48~dark~sel.png">
+ <LogicalName>warning-48~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\warning-48~dark~sel%402x.png">
+ <LogicalName>warning-48~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\error-16.png">
<LogicalName>error-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\error-16%402x.png">
<LogicalName>error-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\error-16~dark.png">
+ <LogicalName>error-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\error-16~dark%402x.png">
+ <LogicalName>error-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\error-16~sel.png">
+ <LogicalName>error-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\error-16~sel%402x.png">
+ <LogicalName>error-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\error-16~dark~sel.png">
+ <LogicalName>error-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\error-16~dark~sel%402x.png">
+ <LogicalName>error-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\error-24.png">
<LogicalName>error-24.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\error-24%402x.png">
<LogicalName>error-24@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\error-24~dark.png">
+ <LogicalName>error-24~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\error-24~dark%402x.png">
+ <LogicalName>error-24~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\error-24~sel.png">
+ <LogicalName>error-24~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\error-24~sel%402x.png">
+ <LogicalName>error-24~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\error-24~dark~sel.png">
+ <LogicalName>error-24~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\error-24~dark~sel%402x.png">
+ <LogicalName>error-24~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\error-32.png">
<LogicalName>error-32.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\error-32%402x.png">
<LogicalName>error-32@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\error-32~dark.png">
+ <LogicalName>error-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\error-32~dark%402x.png">
+ <LogicalName>error-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\error-32~sel.png">
+ <LogicalName>error-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\error-32~sel%402x.png">
+ <LogicalName>error-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\error-32~dark~sel.png">
+ <LogicalName>error-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\error-32~dark~sel%402x.png">
+ <LogicalName>error-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\error-48.png">
<LogicalName>error-48.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\error-48%402x.png">
<LogicalName>error-48@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\error-48~dark.png">
+ <LogicalName>error-48~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\error-48~dark%402x.png">
+ <LogicalName>error-48~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\error-48~sel.png">
+ <LogicalName>error-48~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\error-48~sel%402x.png">
+ <LogicalName>error-48~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\error-48~dark~sel.png">
+ <LogicalName>error-48~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\error-48~dark~sel%402x.png">
+ <LogicalName>error-48~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute-16.png">
+ <LogicalName>execute-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute-16%402x.png">
+ <LogicalName>execute-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute-16~dark.png">
+ <LogicalName>execute-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute-16~dark%402x.png">
+ <LogicalName>execute-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute-16~disabled.png">
+ <LogicalName>execute-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute-16~disabled%402x.png">
+ <LogicalName>execute-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute-16~dark~disabled.png">
+ <LogicalName>execute-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute-16~dark~disabled%402x.png">
+ <LogicalName>execute-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute-all-16.png">
+ <LogicalName>execute-all-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute-all-16%402x.png">
+ <LogicalName>execute-all-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute-all-16~dark.png">
+ <LogicalName>execute-all-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute-all-16~dark%402x.png">
+ <LogicalName>execute-all-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute-all-16~disabled.png">
+ <LogicalName>execute-all-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute-all-16~disabled%402x.png">
+ <LogicalName>execute-all-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute-all-16~dark~disabled.png">
+ <LogicalName>execute-all-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\execute-all-16~dark~disabled%402x.png">
+ <LogicalName>execute-all-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\done-16.png">
<LogicalName>done-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\done-16%402x.png">
<LogicalName>done-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\done-16~dark.png">
+ <LogicalName>done-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-16~dark%402x.png">
+ <LogicalName>done-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-16~sel.png">
+ <LogicalName>done-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-16~sel%402x.png">
+ <LogicalName>done-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-16~dark~sel.png">
+ <LogicalName>done-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-16~dark~sel%402x.png">
+ <LogicalName>done-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-24.png">
+ <LogicalName>done-24.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-24%402x.png">
+ <LogicalName>done-24@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-24~dark.png">
+ <LogicalName>done-24~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-24~dark%402x.png">
+ <LogicalName>done-24~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-24~sel.png">
+ <LogicalName>done-24~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-24~sel%402x.png">
+ <LogicalName>done-24~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-24~dark~sel.png">
+ <LogicalName>done-24~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-24~dark~sel%402x.png">
+ <LogicalName>done-24~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-32.png">
+ <LogicalName>done-32.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-32%402x.png">
+ <LogicalName>done-32@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-32~dark.png">
+ <LogicalName>done-32~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-32~dark%402x.png">
+ <LogicalName>done-32~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-32~sel.png">
+ <LogicalName>done-32~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-32~sel%402x.png">
+ <LogicalName>done-32~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-32~dark~sel.png">
+ <LogicalName>done-32~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-32~dark~sel%402x.png">
+ <LogicalName>done-32~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-48.png">
+ <LogicalName>done-48.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-48%402x.png">
+ <LogicalName>done-48@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-48~dark.png">
+ <LogicalName>done-48~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-48~dark%402x.png">
+ <LogicalName>done-48~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-48~sel.png">
+ <LogicalName>done-48~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-48~sel%402x.png">
+ <LogicalName>done-48~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-48~dark~sel.png">
+ <LogicalName>done-48~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\done-48~dark~sel%402x.png">
+ <LogicalName>done-48~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\edit-16.png">
<LogicalName>edit-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\edit-16%402x.png">
<LogicalName>edit-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\edit-16~dark.png">
+ <LogicalName>edit-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\edit-16~dark%402x.png">
+ <LogicalName>edit-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\edit-16~disabled.png">
+ <LogicalName>edit-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\edit-16~disabled%402x.png">
+ <LogicalName>edit-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\edit-16~dark~disabled.png">
+ <LogicalName>edit-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\edit-16~dark~disabled%402x.png">
+ <LogicalName>edit-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\star-16.png">
<LogicalName>star-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\star-16%402x.png">
<LogicalName>star-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\star-16~dark.png">
+ <LogicalName>star-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\star-16~dark%402x.png">
+ <LogicalName>star-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\star-hover-16.png">
<LogicalName>star-hover-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\star-hover-16%402x.png">
<LogicalName>star-hover-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\star-overlay-16.png">
- <LogicalName>star-overlay-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\star-overlay-16%402x.png">
- <LogicalName>star-overlay-16@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\star-overlay-hover-16.png">
- <LogicalName>star-overlay-hover-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\star-overlay-hover-16%402x.png">
- <LogicalName>star-overlay-hover-16@2x.png</LogicalName>
- </EmbeddedResource>
<EmbeddedResource Include="icons\unstar-16.png">
<LogicalName>unstar-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\unstar-16%402x.png">
<LogicalName>unstar-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\unstar-16~dark.png">
+ <LogicalName>unstar-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\unstar-16~dark%402x.png">
+ <LogicalName>unstar-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\unstar-hover-16.png">
<LogicalName>unstar-hover-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\unstar-hover-16%402x.png">
<LogicalName>unstar-hover-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\unstar-overlay-16.png">
- <LogicalName>unstar-overlay-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\unstar-overlay-16%402x.png">
- <LogicalName>unstar-overlay-16@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\unstar-overlay-hover-16.png">
- <LogicalName>unstar-overlay-hover-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\unstar-overlay-hover-16%402x.png">
- <LogicalName>unstar-overlay-hover-16@2x.png</LogicalName>
- </EmbeddedResource>
<EmbeddedResource Include="icons\remove-16.png">
<LogicalName>remove-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\remove-16%402x.png">
<LogicalName>remove-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\properties-16.png">
- <LogicalName>properties-16.png</LogicalName>
+ <EmbeddedResource Include="icons\remove-16~dark.png">
+ <LogicalName>remove-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\remove-16~dark%402x.png">
+ <LogicalName>remove-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\remove-16~disabled.png">
+ <LogicalName>remove-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\remove-16~disabled%402x.png">
+ <LogicalName>remove-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\remove-16~dark~disabled.png">
+ <LogicalName>remove-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\remove-16~dark~disabled%402x.png">
+ <LogicalName>remove-16~dark~disabled@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\properties-16%402x.png">
- <LogicalName>properties-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\run-unit-tests-16.png">
+ <LogicalName>run-unit-tests-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\run-unit-tests-16%402x.png">
+ <LogicalName>run-unit-tests-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\run-unit-tests-16~dark.png">
+ <LogicalName>run-unit-tests-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\run-unit-tests-16~dark%402x.png">
+ <LogicalName>run-unit-tests-16~dark@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-load-save-16.png">
<LogicalName>prefs-load-save-16.png</LogicalName>
@@ -1479,89 +4720,359 @@
<EmbeddedResource Include="icons\prefs-load-save-16%402x.png">
<LogicalName>prefs-load-save-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-load-save-16~dark.png">
+ <LogicalName>prefs-load-save-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-load-save-16~dark%402x.png">
+ <LogicalName>prefs-load-save-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-load-save-16~sel.png">
+ <LogicalName>prefs-load-save-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-load-save-16~sel%402x.png">
+ <LogicalName>prefs-load-save-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-load-save-16~dark~sel.png">
+ <LogicalName>prefs-load-save-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-load-save-16~dark~sel%402x.png">
+ <LogicalName>prefs-load-save-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-code-formatting-16.png">
<LogicalName>prefs-code-formatting-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-code-formatting-16%402x.png">
<LogicalName>prefs-code-formatting-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-formatting-16~dark.png">
+ <LogicalName>prefs-code-formatting-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-formatting-16~dark%402x.png">
+ <LogicalName>prefs-code-formatting-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-formatting-16~sel.png">
+ <LogicalName>prefs-code-formatting-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-formatting-16~sel%402x.png">
+ <LogicalName>prefs-code-formatting-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-formatting-16~dark~sel.png">
+ <LogicalName>prefs-code-formatting-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-formatting-16~dark~sel%402x.png">
+ <LogicalName>prefs-code-formatting-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-language-16.png">
<LogicalName>prefs-language-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-language-16%402x.png">
<LogicalName>prefs-language-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-language-16~dark.png">
+ <LogicalName>prefs-language-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-language-16~dark%402x.png">
+ <LogicalName>prefs-language-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-language-16~dark~sel.png">
+ <LogicalName>prefs-language-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-language-16~dark~sel%402x.png">
+ <LogicalName>prefs-language-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-language-16~sel.png">
+ <LogicalName>prefs-language-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-language-16~sel%402x.png">
+ <LogicalName>prefs-language-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-key-bindings-16.png">
<LogicalName>prefs-key-bindings-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-key-bindings-16%402x.png">
<LogicalName>prefs-key-bindings-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-key-bindings-16~dark.png">
+ <LogicalName>prefs-key-bindings-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-key-bindings-16~dark%402x.png">
+ <LogicalName>prefs-key-bindings-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-key-bindings-16~sel.png">
+ <LogicalName>prefs-key-bindings-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-key-bindings-16~sel%402x.png">
+ <LogicalName>prefs-key-bindings-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-key-bindings-16~dark~sel.png">
+ <LogicalName>prefs-key-bindings-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-key-bindings-16~dark~sel%402x.png">
+ <LogicalName>prefs-key-bindings-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-fonts-16.png">
<LogicalName>prefs-fonts-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-fonts-16%402x.png">
<LogicalName>prefs-fonts-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-fonts-16~dark.png">
+ <LogicalName>prefs-fonts-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-fonts-16~dark%402x.png">
+ <LogicalName>prefs-fonts-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-fonts-16~sel.png">
+ <LogicalName>prefs-fonts-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-fonts-16~sel%402x.png">
+ <LogicalName>prefs-fonts-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-fonts-16~dark~sel.png">
+ <LogicalName>prefs-fonts-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-fonts-16~dark~sel%402x.png">
+ <LogicalName>prefs-fonts-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-author-information-16.png">
<LogicalName>prefs-author-information-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-author-information-16%402x.png">
<LogicalName>prefs-author-information-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-author-information-16~dark.png">
+ <LogicalName>prefs-author-information-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-author-information-16~dark%402x.png">
+ <LogicalName>prefs-author-information-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-author-information-16~sel.png">
+ <LogicalName>prefs-author-information-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-author-information-16~sel%402x.png">
+ <LogicalName>prefs-author-information-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-author-information-16~dark~sel.png">
+ <LogicalName>prefs-author-information-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-author-information-16~dark~sel%402x.png">
+ <LogicalName>prefs-author-information-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-sdk-locations-16.png">
<LogicalName>prefs-sdk-locations-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-sdk-locations-16%402x.png">
<LogicalName>prefs-sdk-locations-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-sdk-locations-16~dark.png">
+ <LogicalName>prefs-sdk-locations-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-sdk-locations-16~dark%402x.png">
+ <LogicalName>prefs-sdk-locations-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-sdk-locations-16~sel.png">
+ <LogicalName>prefs-sdk-locations-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-sdk-locations-16~sel%402x.png">
+ <LogicalName>prefs-sdk-locations-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-sdk-locations-16~dark~sel.png">
+ <LogicalName>prefs-sdk-locations-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-sdk-locations-16~dark~sel%402x.png">
+ <LogicalName>prefs-sdk-locations-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-external-tools-16.png">
<LogicalName>prefs-external-tools-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-external-tools-16%402x.png">
<LogicalName>prefs-external-tools-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-external-tools-16~dark.png">
+ <LogicalName>prefs-external-tools-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-external-tools-16~dark%402x.png">
+ <LogicalName>prefs-external-tools-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-external-tools-16~sel.png">
+ <LogicalName>prefs-external-tools-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-external-tools-16~sel%402x.png">
+ <LogicalName>prefs-external-tools-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-external-tools-16~dark~sel.png">
+ <LogicalName>prefs-external-tools-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-external-tools-16~dark~sel%402x.png">
+ <LogicalName>prefs-external-tools-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-build-16.png">
<LogicalName>prefs-build-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-build-16%402x.png">
<LogicalName>prefs-build-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-build-16~dark.png">
+ <LogicalName>prefs-build-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-build-16~dark%402x.png">
+ <LogicalName>prefs-build-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-build-16~dark~sel.png">
+ <LogicalName>prefs-build-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-build-16~dark~sel%402x.png">
+ <LogicalName>prefs-build-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-build-16~sel.png">
+ <LogicalName>prefs-build-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-build-16~sel%402x.png">
+ <LogicalName>prefs-build-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-play-16.png">
<LogicalName>prefs-play-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-play-16%402x.png">
<LogicalName>prefs-play-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-play-16~dark.png">
+ <LogicalName>prefs-play-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-play-16~dark%402x.png">
+ <LogicalName>prefs-play-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-play-16~dark~sel.png">
+ <LogicalName>prefs-play-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-play-16~dark~sel%402x.png">
+ <LogicalName>prefs-play-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-play-16~sel.png">
+ <LogicalName>prefs-play-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-play-16~sel%402x.png">
+ <LogicalName>prefs-play-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-updates-16.png">
<LogicalName>prefs-updates-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-updates-16%402x.png">
<LogicalName>prefs-updates-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-updates-16~dark.png">
+ <LogicalName>prefs-updates-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-updates-16~dark%402x.png">
+ <LogicalName>prefs-updates-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-updates-16~sel.png">
+ <LogicalName>prefs-updates-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-updates-16~sel%402x.png">
+ <LogicalName>prefs-updates-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-updates-16~dark~sel.png">
+ <LogicalName>prefs-updates-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-updates-16~dark~sel%402x.png">
+ <LogicalName>prefs-updates-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-task-list-16.png">
<LogicalName>prefs-task-list-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-task-list-16%402x.png">
<LogicalName>prefs-task-list-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-task-list-16~dark.png">
+ <LogicalName>prefs-task-list-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-task-list-16~dark%402x.png">
+ <LogicalName>prefs-task-list-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-task-list-16~sel.png">
+ <LogicalName>prefs-task-list-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-task-list-16~sel%402x.png">
+ <LogicalName>prefs-task-list-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-task-list-16~dark~sel.png">
+ <LogicalName>prefs-task-list-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-task-list-16~dark~sel%402x.png">
+ <LogicalName>prefs-task-list-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-generic-16.png">
<LogicalName>prefs-generic-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-generic-16%402x.png">
<LogicalName>prefs-generic-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\prefs-csharp-16.png">
- <LogicalName>prefs-csharp-16.png</LogicalName>
+ <EmbeddedResource Include="icons\prefs-generic-16~dark.png">
+ <LogicalName>prefs-generic-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-generic-16~dark%402x.png">
+ <LogicalName>prefs-generic-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-generic-16~dark~sel.png">
+ <LogicalName>prefs-generic-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-generic-16~dark~sel%402x.png">
+ <LogicalName>prefs-generic-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-generic-16~sel.png">
+ <LogicalName>prefs-generic-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-generic-16~sel%402x.png">
+ <LogicalName>prefs-generic-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-source-16.png">
+ <LogicalName>prefs-source-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-source-16%402x.png">
+ <LogicalName>prefs-source-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-source-16~dark.png">
+ <LogicalName>prefs-source-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-source-16~dark%402x.png">
+ <LogicalName>prefs-source-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-source-16~sel.png">
+ <LogicalName>prefs-source-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-source-16~sel%402x.png">
+ <LogicalName>prefs-source-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-source-16~dark~sel.png">
+ <LogicalName>prefs-source-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-source-16~dark~sel%402x.png">
+ <LogicalName>prefs-source-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-header-16.png">
+ <LogicalName>prefs-header-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-header-16%402x.png">
+ <LogicalName>prefs-header-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-header-16~dark.png">
+ <LogicalName>prefs-header-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-header-16~dark%402x.png">
+ <LogicalName>prefs-header-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-header-16~sel.png">
+ <LogicalName>prefs-header-16~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\prefs-csharp-16%402x.png">
- <LogicalName>prefs-csharp-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\prefs-header-16~sel%402x.png">
+ <LogicalName>prefs-header-16~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\prefs-standard-header-16.png">
- <LogicalName>prefs-standard-header-16.png</LogicalName>
+ <EmbeddedResource Include="icons\prefs-header-16~dark~sel.png">
+ <LogicalName>prefs-header-16~dark~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\prefs-standard-header-16%402x.png">
- <LogicalName>prefs-standard-header-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\prefs-header-16~dark~sel%402x.png">
+ <LogicalName>prefs-header-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-dotnet-naming-policies-16.png">
<LogicalName>prefs-dotnet-naming-policies-16.png</LogicalName>
@@ -1569,83 +5080,323 @@
<EmbeddedResource Include="icons\prefs-dotnet-naming-policies-16%402x.png">
<LogicalName>prefs-dotnet-naming-policies-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-dotnet-naming-policies-16~dark.png">
+ <LogicalName>prefs-dotnet-naming-policies-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-dotnet-naming-policies-16~dark%402x.png">
+ <LogicalName>prefs-dotnet-naming-policies-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-dotnet-naming-policies-16~sel.png">
+ <LogicalName>prefs-dotnet-naming-policies-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-dotnet-naming-policies-16~sel%402x.png">
+ <LogicalName>prefs-dotnet-naming-policies-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-dotnet-naming-policies-16~dark~sel.png">
+ <LogicalName>prefs-dotnet-naming-policies-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-dotnet-naming-policies-16~dark~sel%402x.png">
+ <LogicalName>prefs-dotnet-naming-policies-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-code-templates-16.png">
<LogicalName>prefs-code-templates-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-code-templates-16%402x.png">
<LogicalName>prefs-code-templates-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-templates-16~dark.png">
+ <LogicalName>prefs-code-templates-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-templates-16~dark%402x.png">
+ <LogicalName>prefs-code-templates-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-templates-16~sel.png">
+ <LogicalName>prefs-code-templates-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-templates-16~sel%402x.png">
+ <LogicalName>prefs-code-templates-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-templates-16~dark~sel.png">
+ <LogicalName>prefs-code-templates-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-code-templates-16~dark~sel%402x.png">
+ <LogicalName>prefs-code-templates-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\prefs-name-conventions-16.png">
<LogicalName>prefs-name-conventions-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\prefs-name-conventions-16%402x.png">
<LogicalName>prefs-name-conventions-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-name-conventions-16~dark.png">
+ <LogicalName>prefs-name-conventions-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-name-conventions-16~dark%402x.png">
+ <LogicalName>prefs-name-conventions-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-name-conventions-16~sel.png">
+ <LogicalName>prefs-name-conventions-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-name-conventions-16~sel%402x.png">
+ <LogicalName>prefs-name-conventions-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-name-conventions-16~dark~sel.png">
+ <LogicalName>prefs-name-conventions-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\prefs-name-conventions-16~dark~sel%402x.png">
+ <LogicalName>prefs-name-conventions-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\copy-16.png">
<LogicalName>copy-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\copy-16%402x.png">
<LogicalName>copy-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\copy-16~dark.png">
+ <LogicalName>copy-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\copy-16~dark%402x.png">
+ <LogicalName>copy-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\find-16.png">
<LogicalName>find-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\find-16%402x.png">
<LogicalName>find-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\find-16~dark.png">
+ <LogicalName>find-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-16~dark%402x.png">
+ <LogicalName>find-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-16~sel.png">
+ <LogicalName>find-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-16~sel%402x.png">
+ <LogicalName>find-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-16~dark~sel.png">
+ <LogicalName>find-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-16~dark~sel%402x.png">
+ <LogicalName>find-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\find-and-replace-16.png">
<LogicalName>find-and-replace-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\find-and-replace-16%402x.png">
<LogicalName>find-and-replace-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\find-and-replace-16~dark.png">
+ <LogicalName>find-and-replace-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-and-replace-16~dark%402x.png">
+ <LogicalName>find-and-replace-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-and-replace-16~sel.png">
+ <LogicalName>find-and-replace-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-and-replace-16~sel%402x.png">
+ <LogicalName>find-and-replace-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-and-replace-16~dark~sel.png">
+ <LogicalName>find-and-replace-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\find-and-replace-16~dark~sel%402x.png">
+ <LogicalName>find-and-replace-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\go-back-16.png">
<LogicalName>go-back-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\go-back-16%402x.png">
<LogicalName>go-back-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\go-back-16~dark.png">
+ <LogicalName>go-back-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-back-16~dark%402x.png">
+ <LogicalName>go-back-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-back-16~disabled.png">
+ <LogicalName>go-back-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-back-16~disabled%402x.png">
+ <LogicalName>go-back-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-back-16~dark~disabled.png">
+ <LogicalName>go-back-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-back-16~dark~disabled%402x.png">
+ <LogicalName>go-back-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\go-down-16.png">
<LogicalName>go-down-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\go-down-16%402x.png">
<LogicalName>go-down-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\go-down-16~dark.png">
+ <LogicalName>go-down-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-down-16~dark%402x.png">
+ <LogicalName>go-down-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-down-16~disabled.png">
+ <LogicalName>go-down-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-down-16~disabled%402x.png">
+ <LogicalName>go-down-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-down-16~dark~disabled.png">
+ <LogicalName>go-down-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-down-16~dark~disabled%402x.png">
+ <LogicalName>go-down-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\go-forward-16.png">
<LogicalName>go-forward-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\go-forward-16%402x.png">
<LogicalName>go-forward-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\go-forward-16~dark.png">
+ <LogicalName>go-forward-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-forward-16~dark%402x.png">
+ <LogicalName>go-forward-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-forward-16~disabled.png">
+ <LogicalName>go-forward-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-forward-16~disabled%402x.png">
+ <LogicalName>go-forward-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-forward-16~dark~disabled.png">
+ <LogicalName>go-forward-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-forward-16~dark~disabled%402x.png">
+ <LogicalName>go-forward-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-to-line-16.png">
+ <LogicalName>go-to-line-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-to-line-16%402x.png">
+ <LogicalName>go-to-line-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-to-line-16~dark.png">
+ <LogicalName>go-to-line-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-to-line-16~dark%402x.png">
+ <LogicalName>go-to-line-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-to-matching-brace-16.png">
+ <LogicalName>go-to-matching-brace-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-to-matching-brace-16%402x.png">
+ <LogicalName>go-to-matching-brace-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-to-matching-brace-16~dark.png">
+ <LogicalName>go-to-matching-brace-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-to-matching-brace-16~dark%402x.png">
+ <LogicalName>go-to-matching-brace-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\go-up-16.png">
<LogicalName>go-up-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\go-up-16%402x.png">
<LogicalName>go-up-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\go-up-16~dark.png">
+ <LogicalName>go-up-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-up-16~dark%402x.png">
+ <LogicalName>go-up-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-up-16~disabled.png">
+ <LogicalName>go-up-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-up-16~disabled%402x.png">
+ <LogicalName>go-up-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-up-16~dark~disabled.png">
+ <LogicalName>go-up-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\go-up-16~dark~disabled%402x.png">
+ <LogicalName>go-up-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\undo-16.png">
<LogicalName>undo-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\undo-16%402x.png">
<LogicalName>undo-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\undo-16~dark.png">
+ <LogicalName>undo-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\undo-16~dark%402x.png">
+ <LogicalName>undo-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\undo-16~disabled.png">
+ <LogicalName>undo-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\undo-16~disabled%402x.png">
+ <LogicalName>undo-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\undo-16~dark~disabled.png">
+ <LogicalName>undo-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\undo-16~dark~disabled%402x.png">
+ <LogicalName>undo-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\home-16.png">
<LogicalName>home-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\home-16%402x.png">
<LogicalName>home-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\home-16~dark.png">
+ <LogicalName>home-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\home-16~dark%402x.png">
+ <LogicalName>home-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\home-16~dark~sel.png">
+ <LogicalName>home-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\home-16~dark~sel%402x.png">
+ <LogicalName>home-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\home-16~sel.png">
+ <LogicalName>home-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\home-16~sel%402x.png">
+ <LogicalName>home-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\jump-to-16.png">
<LogicalName>jump-to-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\jump-to-16%402x.png">
<LogicalName>jump-to-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\media-play-16.png">
- <LogicalName>media-play-16.png</LogicalName>
+ <EmbeddedResource Include="icons\jump-to-16~dark.png">
+ <LogicalName>jump-to-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\jump-to-16~dark%402x.png">
+ <LogicalName>jump-to-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\jump-to-16~disabled.png">
+ <LogicalName>jump-to-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\jump-to-16~disabled%402x.png">
+ <LogicalName>jump-to-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\jump-to-16~dark~disabled.png">
+ <LogicalName>jump-to-16~dark~disabled.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\media-play-16%402x.png">
- <LogicalName>media-play-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\jump-to-16~dark~disabled%402x.png">
+ <LogicalName>jump-to-16~dark~disabled@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\missing-image-16.png">
<LogicalName>missing-image-16.png</LogicalName>
@@ -1653,164 +5404,725 @@
<EmbeddedResource Include="icons\missing-image-16%402x.png">
<LogicalName>missing-image-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\missing-image-32.png">
+ <LogicalName>missing-image-32.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\missing-image-32%402x.png">
+ <LogicalName>missing-image-32@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\missing-image-48.png">
+ <LogicalName>missing-image-48.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\missing-image-48%402x.png">
+ <LogicalName>missing-image-48@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\open-16.png">
<LogicalName>open-16.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\open-16%402x.png">
+ <LogicalName>open-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\open-16~dark.png">
+ <LogicalName>open-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\open-16~dark%402x.png">
+ <LogicalName>open-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\refresh-16.png">
<LogicalName>refresh-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\refresh-16%402x.png">
<LogicalName>refresh-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\refresh-16~dark.png">
+ <LogicalName>refresh-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\refresh-16~dark%402x.png">
+ <LogicalName>refresh-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\refresh-16~disabled.png">
+ <LogicalName>refresh-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\refresh-16~disabled%402x.png">
+ <LogicalName>refresh-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\refresh-16~dark~disabled.png">
+ <LogicalName>refresh-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\refresh-16~dark~disabled%402x.png">
+ <LogicalName>refresh-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\region-16.png">
+ <LogicalName>region-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\region-16%402x.png">
+ <LogicalName>region-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\region-16~dark.png">
+ <LogicalName>region-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\region-16~dark%402x.png">
+ <LogicalName>region-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\region-16~sel.png">
+ <LogicalName>region-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\region-16~sel%402x.png">
+ <LogicalName>region-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\region-16~dark~sel.png">
+ <LogicalName>region-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\region-16~dark~sel%402x.png">
+ <LogicalName>region-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\save-16.png">
<LogicalName>save-16.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\save-16%402x.png">
+ <LogicalName>save-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\save-16~dark.png">
+ <LogicalName>save-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\save-16~dark%402x.png">
+ <LogicalName>save-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\save-all-16.png">
<LogicalName>save-all-16.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\save-all-16%402x.png">
+ <LogicalName>save-all-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\save-all-16~dark.png">
+ <LogicalName>save-all-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\save-all-16~dark%402x.png">
+ <LogicalName>save-all-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\zoom-actual-16.png">
+ <LogicalName>zoom-actual-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\zoom-actual-16%402x.png">
+ <LogicalName>zoom-actual-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\zoom-actual-16~dark.png">
+ <LogicalName>zoom-actual-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\zoom-actual-16~dark%402x.png">
+ <LogicalName>zoom-actual-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\zoom-actual-16~sel.png">
+ <LogicalName>zoom-actual-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\zoom-actual-16~sel%402x.png">
+ <LogicalName>zoom-actual-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\zoom-actual-16~dark~sel.png">
+ <LogicalName>zoom-actual-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\zoom-actual-16~dark~sel%402x.png">
+ <LogicalName>zoom-actual-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\zoom-in-16.png">
<LogicalName>zoom-in-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\zoom-in-16%402x.png">
<LogicalName>zoom-in-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\zoom-in-16~dark.png">
+ <LogicalName>zoom-in-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\zoom-in-16~dark%402x.png">
+ <LogicalName>zoom-in-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\zoom-in-16~dark~sel.png">
+ <LogicalName>zoom-in-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\zoom-in-16~dark~sel%402x.png">
+ <LogicalName>zoom-in-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\zoom-in-16~sel.png">
+ <LogicalName>zoom-in-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\zoom-in-16~sel%402x.png">
+ <LogicalName>zoom-in-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\zoom-out-16.png">
<LogicalName>zoom-out-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\zoom-out-16%402x.png">
<LogicalName>zoom-out-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\zoom-out-16~dark.png">
+ <LogicalName>zoom-out-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\zoom-out-16~dark%402x.png">
+ <LogicalName>zoom-out-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\zoom-out-16~dark~sel.png">
+ <LogicalName>zoom-out-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\zoom-out-16~dark~sel%402x.png">
+ <LogicalName>zoom-out-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\zoom-out-16~sel.png">
+ <LogicalName>zoom-out-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\zoom-out-16~sel%402x.png">
+ <LogicalName>zoom-out-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\spinner-14-1.png">
<LogicalName>spinner-14-1.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\spinner-14-1%402x.png">
<LogicalName>spinner-14-1@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-1~dark.png">
+ <LogicalName>spinner-14-1~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-1~dark%402x.png">
+ <LogicalName>spinner-14-1~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-1~dark~sel.png">
+ <LogicalName>spinner-14-1~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-1~dark~sel%402x.png">
+ <LogicalName>spinner-14-1~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-1~sel.png">
+ <LogicalName>spinner-14-1~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-1~sel%402x.png">
+ <LogicalName>spinner-14-1~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\spinner-14-2.png">
<LogicalName>spinner-14-2.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\spinner-14-2%402x.png">
<LogicalName>spinner-14-2@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-2~dark.png">
+ <LogicalName>spinner-14-2~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-2~dark%402x.png">
+ <LogicalName>spinner-14-2~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-2~dark~sel.png">
+ <LogicalName>spinner-14-2~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-2~dark~sel%402x.png">
+ <LogicalName>spinner-14-2~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-2~sel.png">
+ <LogicalName>spinner-14-2~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-2~sel%402x.png">
+ <LogicalName>spinner-14-2~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\spinner-14-3.png">
<LogicalName>spinner-14-3.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\spinner-14-3%402x.png">
<LogicalName>spinner-14-3@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-3~dark.png">
+ <LogicalName>spinner-14-3~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-3~dark%402x.png">
+ <LogicalName>spinner-14-3~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-3~dark~sel.png">
+ <LogicalName>spinner-14-3~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-3~dark~sel%402x.png">
+ <LogicalName>spinner-14-3~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-3~sel.png">
+ <LogicalName>spinner-14-3~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-3~sel%402x.png">
+ <LogicalName>spinner-14-3~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\spinner-14-4.png">
<LogicalName>spinner-14-4.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\spinner-14-4%402x.png">
<LogicalName>spinner-14-4@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-4~dark.png">
+ <LogicalName>spinner-14-4~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-4~dark%402x.png">
+ <LogicalName>spinner-14-4~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-4~dark~sel.png">
+ <LogicalName>spinner-14-4~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-4~dark~sel%402x.png">
+ <LogicalName>spinner-14-4~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-4~sel.png">
+ <LogicalName>spinner-14-4~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-4~sel%402x.png">
+ <LogicalName>spinner-14-4~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\spinner-14-5.png">
<LogicalName>spinner-14-5.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\spinner-14-5%402x.png">
<LogicalName>spinner-14-5@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-5~dark.png">
+ <LogicalName>spinner-14-5~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-5~dark%402x.png">
+ <LogicalName>spinner-14-5~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-5~dark~sel.png">
+ <LogicalName>spinner-14-5~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-5~dark~sel%402x.png">
+ <LogicalName>spinner-14-5~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-5~sel.png">
+ <LogicalName>spinner-14-5~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-14-5~sel%402x.png">
+ <LogicalName>spinner-14-5~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-1.png">
+ <LogicalName>spinner-16-1.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-1%402x.png">
+ <LogicalName>spinner-16-1@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-1~dark.png">
+ <LogicalName>spinner-16-1~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-1~dark%402x.png">
+ <LogicalName>spinner-16-1~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-1~dark~sel.png">
+ <LogicalName>spinner-16-1~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-1~dark~sel%402x.png">
+ <LogicalName>spinner-16-1~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-1~sel.png">
+ <LogicalName>spinner-16-1~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-1~sel%402x.png">
+ <LogicalName>spinner-16-1~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-2.png">
+ <LogicalName>spinner-16-2.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-2%402x.png">
+ <LogicalName>spinner-16-2@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-2~dark.png">
+ <LogicalName>spinner-16-2~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-2~dark%402x.png">
+ <LogicalName>spinner-16-2~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-2~dark~sel.png">
+ <LogicalName>spinner-16-2~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-2~dark~sel%402x.png">
+ <LogicalName>spinner-16-2~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-2~sel.png">
+ <LogicalName>spinner-16-2~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-2~sel%402x.png">
+ <LogicalName>spinner-16-2~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-3.png">
+ <LogicalName>spinner-16-3.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-3%402x.png">
+ <LogicalName>spinner-16-3@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-3~dark.png">
+ <LogicalName>spinner-16-3~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-3~dark%402x.png">
+ <LogicalName>spinner-16-3~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-3~dark~sel.png">
+ <LogicalName>spinner-16-3~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-3~dark~sel%402x.png">
+ <LogicalName>spinner-16-3~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-3~sel.png">
+ <LogicalName>spinner-16-3~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-3~sel%402x.png">
+ <LogicalName>spinner-16-3~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-4.png">
+ <LogicalName>spinner-16-4.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-4%402x.png">
+ <LogicalName>spinner-16-4@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-4~dark.png">
+ <LogicalName>spinner-16-4~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-4~dark%402x.png">
+ <LogicalName>spinner-16-4~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-4~dark~sel.png">
+ <LogicalName>spinner-16-4~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-4~dark~sel%402x.png">
+ <LogicalName>spinner-16-4~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-4~sel.png">
+ <LogicalName>spinner-16-4~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-4~sel%402x.png">
+ <LogicalName>spinner-16-4~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-5.png">
+ <LogicalName>spinner-16-5.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-5%402x.png">
+ <LogicalName>spinner-16-5@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-5~dark.png">
+ <LogicalName>spinner-16-5~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-5~dark%402x.png">
+ <LogicalName>spinner-16-5~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-5~dark~sel.png">
+ <LogicalName>spinner-16-5~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-5~dark~sel%402x.png">
+ <LogicalName>spinner-16-5~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-5~sel.png">
+ <LogicalName>spinner-16-5~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-16-5~sel%402x.png">
+ <LogicalName>spinner-16-5~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\spinner-18-1.png">
<LogicalName>spinner-18-1.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\spinner-18-1%402x.png">
<LogicalName>spinner-18-1@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-1~dark.png">
+ <LogicalName>spinner-18-1~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-1~dark%402x.png">
+ <LogicalName>spinner-18-1~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-1~dark~sel.png">
+ <LogicalName>spinner-18-1~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-1~dark~sel%402x.png">
+ <LogicalName>spinner-18-1~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-1~sel.png">
+ <LogicalName>spinner-18-1~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-1~sel%402x.png">
+ <LogicalName>spinner-18-1~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\spinner-18-2.png">
<LogicalName>spinner-18-2.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\spinner-18-2%402x.png">
<LogicalName>spinner-18-2@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-2~dark.png">
+ <LogicalName>spinner-18-2~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-2~dark%402x.png">
+ <LogicalName>spinner-18-2~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-2~dark~sel.png">
+ <LogicalName>spinner-18-2~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-2~dark~sel%402x.png">
+ <LogicalName>spinner-18-2~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-2~sel.png">
+ <LogicalName>spinner-18-2~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-2~sel%402x.png">
+ <LogicalName>spinner-18-2~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\spinner-18-3.png">
<LogicalName>spinner-18-3.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\spinner-18-3%402x.png">
<LogicalName>spinner-18-3@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-3~dark.png">
+ <LogicalName>spinner-18-3~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-3~dark%402x.png">
+ <LogicalName>spinner-18-3~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-3~dark~sel.png">
+ <LogicalName>spinner-18-3~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-3~dark~sel%402x.png">
+ <LogicalName>spinner-18-3~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-3~sel.png">
+ <LogicalName>spinner-18-3~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-3~sel%402x.png">
+ <LogicalName>spinner-18-3~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\spinner-18-4.png">
<LogicalName>spinner-18-4.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\spinner-18-4%402x.png">
<LogicalName>spinner-18-4@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-4~dark.png">
+ <LogicalName>spinner-18-4~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-4~dark%402x.png">
+ <LogicalName>spinner-18-4~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-4~dark~sel.png">
+ <LogicalName>spinner-18-4~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-4~dark~sel%402x.png">
+ <LogicalName>spinner-18-4~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-4~sel.png">
+ <LogicalName>spinner-18-4~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-4~sel%402x.png">
+ <LogicalName>spinner-18-4~sel@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\spinner-18-5.png">
<LogicalName>spinner-18-5.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\spinner-18-5%402x.png">
<LogicalName>spinner-18-5@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-5~dark.png">
+ <LogicalName>spinner-18-5~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-5~dark%402x.png">
+ <LogicalName>spinner-18-5~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-5~dark~sel.png">
+ <LogicalName>spinner-18-5~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-5~dark~sel%402x.png">
+ <LogicalName>spinner-18-5~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-5~sel.png">
+ <LogicalName>spinner-18-5~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\spinner-18-5~sel%402x.png">
+ <LogicalName>spinner-18-5~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\bug-16.png">
+ <LogicalName>bug-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\bug-16%402x.png">
+ <LogicalName>bug-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\bug-16~dark.png">
+ <LogicalName>bug-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\bug-16~dark%402x.png">
+ <LogicalName>bug-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\catchpoint-16.png">
<LogicalName>catchpoint-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\catchpoint-16%402x.png">
<LogicalName>catchpoint-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\catchpoint-16~dark.png">
+ <LogicalName>catchpoint-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\catchpoint-16~dark%402x.png">
+ <LogicalName>catchpoint-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\catchpoint-16~disabled.png">
+ <LogicalName>catchpoint-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\catchpoint-16~disabled%402x.png">
+ <LogicalName>catchpoint-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\catchpoint-16~dark~disabled.png">
+ <LogicalName>catchpoint-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\catchpoint-16~dark~disabled%402x.png">
+ <LogicalName>catchpoint-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\catchpoint-disabled-16.png">
<LogicalName>catchpoint-disabled-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\catchpoint-disabled-16%402x.png">
<LogicalName>catchpoint-disabled-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\project-status-information-16.png">
- <LogicalName>project-status-information-16.png</LogicalName>
+ <EmbeddedResource Include="icons\catchpoint-disabled-16~dark.png">
+ <LogicalName>catchpoint-disabled-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\catchpoint-disabled-16~dark%402x.png">
+ <LogicalName>catchpoint-disabled-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\project-status-information-16%402x.png">
- <LogicalName>project-status-information-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\catchpoint-disabled-16~disabled.png">
+ <LogicalName>catchpoint-disabled-16~disabled.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\project-status-warning-16.png">
- <LogicalName>project-status-warning-16.png</LogicalName>
+ <EmbeddedResource Include="icons\catchpoint-disabled-16~disabled%402x.png">
+ <LogicalName>catchpoint-disabled-16~disabled@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\project-status-warning-16%402x.png">
- <LogicalName>project-status-warning-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\catchpoint-disabled-16~dark~disabled.png">
+ <LogicalName>catchpoint-disabled-16~dark~disabled.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\project-status-error-16.png">
- <LogicalName>project-status-error-16.png</LogicalName>
+ <EmbeddedResource Include="icons\catchpoint-disabled-16~dark~disabled%402x.png">
+ <LogicalName>catchpoint-disabled-16~dark~disabled@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\project-status-error-16%402x.png">
- <LogicalName>project-status-error-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\platform-android-16.png">
+ <LogicalName>platform-android-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\platform-android-16%402x.png">
- <LogicalName>platform-android-light-16@2x.png</LogicalName>
+ <LogicalName>platform-android-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-android-16~dark.png">
+ <LogicalName>platform-android-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-android-16~dark%402x.png">
+ <LogicalName>platform-android-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-android-16~sel.png">
+ <LogicalName>platform-android-16~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\platform-cross-platform-16.png">
- <LogicalName>platform-cross-platform-light-16.png</LogicalName>
+ <EmbeddedResource Include="icons\platform-android-16~sel%402x.png">
+ <LogicalName>platform-android-16~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\platform-cross-platform-16%402x.png">
- <LogicalName>platform-cross-platform-light-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\platform-android-16~dark~sel.png">
+ <LogicalName>platform-android-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-android-16~dark~sel%402x.png">
+ <LogicalName>platform-android-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-crossplatform-16.png">
+ <LogicalName>platform-crossplatform-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-crossplatform-16%402x.png">
+ <LogicalName>platform-crossplatform-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-crossplatform-16~dark.png">
+ <LogicalName>platform-crossplatform-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-crossplatform-16~dark%402x.png">
+ <LogicalName>platform-crossplatform-16~dark@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\platform-ios-16.png">
- <LogicalName>platform-ios-light-16.png</LogicalName>
+ <LogicalName>platform-ios-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\platform-ios-16%402x.png">
- <LogicalName>platform-ios-light-16@2x.png</LogicalName>
+ <LogicalName>platform-ios-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-ios-16~dark.png">
+ <LogicalName>platform-ios-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-ios-16~dark%402x.png">
+ <LogicalName>platform-ios-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-ios-16~sel.png">
+ <LogicalName>platform-ios-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-ios-16~sel%402x.png">
+ <LogicalName>platform-ios-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-ios-16~dark~sel.png">
+ <LogicalName>platform-ios-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-ios-16~dark~sel%402x.png">
+ <LogicalName>platform-ios-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\platform-mac-16.png">
- <LogicalName>platform-mac-light-16.png</LogicalName>
+ <LogicalName>platform-mac-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\platform-mac-16%402x.png">
- <LogicalName>platform-mac-light-16@2x.png</LogicalName>
+ <LogicalName>platform-mac-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-mac-16~dark.png">
+ <LogicalName>platform-mac-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-mac-16~dark%402x.png">
+ <LogicalName>platform-mac-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-mac-16~sel.png">
+ <LogicalName>platform-mac-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-mac-16~sel%402x.png">
+ <LogicalName>platform-mac-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-mac-16~dark~sel.png">
+ <LogicalName>platform-mac-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-mac-16~dark~sel%402x.png">
+ <LogicalName>platform-mac-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\platform-other-16.png">
- <LogicalName>platform-other-light-16.png</LogicalName>
+ <LogicalName>platform-other-16.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\platform-other-16%402x.png">
- <LogicalName>platform-other-light-16@2x.png</LogicalName>
+ <LogicalName>platform-other-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\platform-android-16.png">
- <LogicalName>platform-android-light-16.png</LogicalName>
+ <EmbeddedResource Include="icons\platform-other-16~dark.png">
+ <LogicalName>platform-other-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-other-16~dark%402x.png">
+ <LogicalName>platform-other-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-other-16~sel.png">
+ <LogicalName>platform-other-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-other-16~sel%402x.png">
+ <LogicalName>platform-other-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-other-16~dark~sel.png">
+ <LogicalName>platform-other-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\platform-other-16~dark~sel%402x.png">
+ <LogicalName>platform-other-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="templates\images\project.png">
+ <LogicalName>project.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="templates\images\project%402x.png">
+ <LogicalName>project@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="templates\images\project~dark.png">
+ <LogicalName>project~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="templates\images\project~dark%402x.png">
+ <LogicalName>project~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="templates\images\generic-project.png">
- <LogicalName>generic-project.png</LogicalName>
+ <EmbeddedResource Include="templates\images\solution.png">
+ <LogicalName>solution.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="templates\images\generic-project%402x.png">
- <LogicalName>generic-project@2x.png</LogicalName>
+ <EmbeddedResource Include="templates\images\solution%402x.png">
+ <LogicalName>solution@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="templates\images\blank-solution.png">
- <LogicalName>blank-solution.png</LogicalName>
+ <EmbeddedResource Include="templates\images\solution~dark.png">
+ <LogicalName>solution~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="templates\images\blank-solution%402x.png">
- <LogicalName>blank-solution@2x.png</LogicalName>
+ <EmbeddedResource Include="templates\images\solution~dark%402x.png">
+ <LogicalName>solution~dark@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="templates\images\console-project.png">
<LogicalName>console-project.png</LogicalName>
@@ -1818,36 +6130,72 @@
<EmbeddedResource Include="templates\images\console-project%402x.png">
<LogicalName>console-project@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="templates\images\console-project~dark.png">
+ <LogicalName>console-project~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="templates\images\console-project~dark%402x.png">
+ <LogicalName>console-project~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="templates\images\library-project.png">
<LogicalName>library-project.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="templates\images\library-project%402x.png">
<LogicalName>library-project@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="templates\images\library-project~dark.png">
+ <LogicalName>library-project~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="templates\images\library-project~dark%402x.png">
+ <LogicalName>library-project~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="templates\images\pcl-project.png">
<LogicalName>pcl-project.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="templates\images\pcl-project%402x.png">
<LogicalName>pcl-project@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="templates\images\pcl-project~dark.png">
+ <LogicalName>pcl-project~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="templates\images\pcl-project~dark%402x.png">
+ <LogicalName>pcl-project~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="templates\images\shared-project.png">
<LogicalName>shared-project.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="templates\images\shared-project%402x.png">
<LogicalName>shared-project@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="templates\images\shared-project~dark.png">
+ <LogicalName>shared-project~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="templates\images\shared-project~dark%402x.png">
+ <LogicalName>shared-project~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="templates\images\workspace.png">
<LogicalName>workspace.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="templates\images\workspace%402x.png">
<LogicalName>workspace@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="templates\images\workspace~dark.png">
+ <LogicalName>workspace~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="templates\images\workspace~dark%402x.png">
+ <LogicalName>workspace~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="templates\images\gtk2-project.png">
<LogicalName>gtk2-project.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="templates\images\gtk2-project%402x.png">
<LogicalName>gtk2-project@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="templates\images\gtk2-project~dark.png">
+ <LogicalName>gtk2-project~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="templates\images\gtk2-project~dark%402x.png">
+ <LogicalName>gtk2-project~dark@2x.png</LogicalName>
+ </EmbeddedResource>
<EmbeddedResource Include="icons\preview-active-16.png">
<LogicalName>preview-active-16.png</LogicalName>
</EmbeddedResource>
@@ -1860,95 +6208,71 @@
<EmbeddedResource Include="icons\preview-hover-16%402x.png">
<LogicalName>preview-hover-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\preview-normal-16.png">
- <LogicalName>preview-normal-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\preview-normal-16%402x.png">
- <LogicalName>preview-normal-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\preview-hover-16~dark.png">
+ <LogicalName>preview-hover-16~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\preview-selected-16.png">
- <LogicalName>preview-selected-16.png</LogicalName>
+ <EmbeddedResource Include="icons\preview-hover-16~dark%402x.png">
+ <LogicalName>preview-hover-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\preview-selected-16%402x.png">
- <LogicalName>preview-selected-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\preview-hover-16~dark~sel.png">
+ <LogicalName>preview-hover-16~dark~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\spinner-normal-1-16.png">
- <LogicalName>spinner-normal-1-16.png</LogicalName>
+ <EmbeddedResource Include="icons\preview-hover-16~dark~sel%402x.png">
+ <LogicalName>preview-hover-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\spinner-normal-1-16%402x.png">
- <LogicalName>spinner-normal-1-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\preview-hover-16~sel.png">
+ <LogicalName>preview-hover-16~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\spinner-normal-2-16.png">
- <LogicalName>spinner-normal-2-16.png</LogicalName>
+ <EmbeddedResource Include="icons\preview-hover-16~sel%402x.png">
+ <LogicalName>preview-hover-16~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\spinner-normal-2-16%402x.png">
- <LogicalName>spinner-normal-2-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\preview-16.png">
+ <LogicalName>preview-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\spinner-normal-3-16.png">
- <LogicalName>spinner-normal-3-16.png</LogicalName>
+ <EmbeddedResource Include="icons\preview-16%402x.png">
+ <LogicalName>preview-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\spinner-normal-3-16%402x.png">
- <LogicalName>spinner-normal-3-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\preview-16~dark.png">
+ <LogicalName>preview-16~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\spinner-normal-4-16.png">
- <LogicalName>spinner-normal-4-16.png</LogicalName>
+ <EmbeddedResource Include="icons\preview-16~dark%402x.png">
+ <LogicalName>preview-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\spinner-normal-4-16%402x.png">
- <LogicalName>spinner-normal-4-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\preview-16~dark~sel.png">
+ <LogicalName>preview-16~dark~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\spinner-normal-5-16.png">
- <LogicalName>spinner-normal-5-16.png</LogicalName>
+ <EmbeddedResource Include="icons\preview-16~dark~sel%402x.png">
+ <LogicalName>preview-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\spinner-normal-5-16%402x.png">
- <LogicalName>spinner-normal-5-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\preview-16~sel.png">
+ <LogicalName>preview-16~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\spinner-selected-1-16.png">
- <LogicalName>spinner-selected-1-16.png</LogicalName>
+ <EmbeddedResource Include="icons\preview-16~sel%402x.png">
+ <LogicalName>preview-16~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\spinner-selected-1-16%402x.png">
- <LogicalName>spinner-selected-1-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\live-16.png">
+ <LogicalName>live-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\spinner-selected-2-16.png">
- <LogicalName>spinner-selected-2-16.png</LogicalName>
+ <EmbeddedResource Include="icons\live-16%402x.png">
+ <LogicalName>live-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\spinner-selected-2-16%402x.png">
- <LogicalName>spinner-selected-2-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\live-16~dark.png">
+ <LogicalName>live-16~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\spinner-selected-3-16.png">
- <LogicalName>spinner-selected-3-16.png</LogicalName>
+ <EmbeddedResource Include="icons\live-16~dark%402x.png">
+ <LogicalName>live-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\spinner-selected-3-16%402x.png">
- <LogicalName>spinner-selected-3-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\live-16~dark~sel.png">
+ <LogicalName>live-16~dark~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\spinner-selected-4-16.png">
- <LogicalName>spinner-selected-4-16.png</LogicalName>
+ <EmbeddedResource Include="icons\live-16~dark~sel%402x.png">
+ <LogicalName>live-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\spinner-selected-4-16%402x.png">
- <LogicalName>spinner-selected-4-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\live-16~sel.png">
+ <LogicalName>live-16~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\spinner-selected-5-16.png">
- <LogicalName>spinner-selected-5-16.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\spinner-selected-5-16%402x.png">
- <LogicalName>spinner-selected-5-16@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\done-24.png">
- <LogicalName>done-24.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\done-24%402x.png">
- <LogicalName>done-24@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\done-32.png">
- <LogicalName>done-32.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\done-32%402x.png">
- <LogicalName>done-32@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\done-48.png">
- <LogicalName>done-48.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\done-48%402x.png">
- <LogicalName>done-48@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\live-16~sel%402x.png">
+ <LogicalName>live-16~sel@2x.png</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="icons\project-nunit-overlay-32.png">
<LogicalName>project-nunit-overlay-32.png</LogicalName>
@@ -1956,586 +6280,1005 @@
<EmbeddedResource Include="icons\project-nunit-overlay-32%402x.png">
<LogicalName>project-nunit-overlay-32@2x.png</LogicalName>
</EmbeddedResource>
- </ItemGroup>
- <ItemGroup Condition=" '$(Configuration)' != 'DebugMac' AND '$(Configuration)' != 'ReleaseMac' ">
- <EmbeddedResource Include="icons\status-building-1-14.png">
- <LogicalName>status-building-1-14.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\status-building-1-14%402x.png">
- <LogicalName>status-building-1-14@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\status-building-2-14.png">
- <LogicalName>status-building-2-14.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\status-building-2-14%402x.png">
- <LogicalName>status-building-2-14@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\status-building-3-14.png">
- <LogicalName>status-building-3-14.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\status-building-3-14%402x.png">
- <LogicalName>status-building-3-14@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\status-building-4-14.png">
- <LogicalName>status-building-4-14.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\status-building-4-14%402x.png">
- <LogicalName>status-building-4-14@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\status-building-5-14.png">
- <LogicalName>status-building-5-14.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\status-building-5-14%402x.png">
- <LogicalName>status-building-5-14@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\status-searching-1-14.png">
- <LogicalName>status-searching-1-14.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\status-searching-1-14%402x.png">
- <LogicalName>status-searching-1-14@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\status-searching-2-14.png">
- <LogicalName>status-searching-2-14.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\status-searching-2-14%402x.png">
- <LogicalName>status-searching-2-14@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\status-searching-3-14.png">
- <LogicalName>status-searching-3-14.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\status-searching-3-14%402x.png">
- <LogicalName>status-searching-3-14@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\status-searching-4-14.png">
- <LogicalName>status-searching-4-14.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\status-searching-4-14%402x.png">
- <LogicalName>status-searching-4-14@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\status-pushing-1-14.png">
- <LogicalName>status-pushing-1-14.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\status-pushing-1-14%402x.png">
- <LogicalName>status-pushing-1-14@2x.png</LogicalName>
- </EmbeddedResource>
- <EmbeddedResource Include="icons\status-pushing-2-14.png">
- <LogicalName>status-pushing-2-14.png</LogicalName>
+ <EmbeddedResource Include="icons\project-nunit-overlay-32~dark.png">
+ <LogicalName>project-nunit-overlay-32~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pushing-2-14%402x.png">
- <LogicalName>status-pushing-2-14@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\project-nunit-overlay-32~dark%402x.png">
+ <LogicalName>project-nunit-overlay-32~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pushing-3-14.png">
- <LogicalName>status-pushing-3-14.png</LogicalName>
+ <EmbeddedResource Include="icons\project-nunit-overlay-32~sel.png">
+ <LogicalName>project-nunit-overlay-32~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pushing-3-14%402x.png">
- <LogicalName>status-pushing-3-14@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\project-nunit-overlay-32~sel%402x.png">
+ <LogicalName>project-nunit-overlay-32~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pushing-4-14.png">
- <LogicalName>status-pushing-4-14.png</LogicalName>
+ <EmbeddedResource Include="icons\project-nunit-overlay-32~dark~sel.png">
+ <LogicalName>project-nunit-overlay-32~dark~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pushing-4-14%402x.png">
- <LogicalName>status-pushing-4-14@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\project-nunit-overlay-32~dark~sel%402x.png">
+ <LogicalName>project-nunit-overlay-32~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pushing-5-14.png">
- <LogicalName>status-pushing-5-14.png</LogicalName>
+ <EmbeddedResource Include="icons\status-instrumentation-16.png">
+ <LogicalName>status-instrumentation-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pushing-5-14%402x.png">
- <LogicalName>status-pushing-5-14@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\status-instrumentation-16%402x.png">
+ <LogicalName>status-instrumentation-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pushing-6-14.png">
- <LogicalName>status-pushing-6-14.png</LogicalName>
+ <EmbeddedResource Include="icons\status-instrumentation-16~dark.png">
+ <LogicalName>status-instrumentation-16~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pushing-6-14%402x.png">
- <LogicalName>status-pushing-6-14@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\status-instrumentation-16~dark%402x.png">
+ <LogicalName>status-instrumentation-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pulling-1-14.png">
- <LogicalName>status-pulling-1-14.png</LogicalName>
+ <EmbeddedResource Include="resources\tabbar-back.9.png">
+ <LogicalName>tabbar-back.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pulling-1-14%402x.png">
- <LogicalName>status-pulling-1-14@2x.png</LogicalName>
+ <EmbeddedResource Include="resources\tabbar-back%402x.9.png">
+ <LogicalName>tabbar-back@2x.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pulling-2-14.png">
- <LogicalName>status-pulling-2-14.png</LogicalName>
+ <EmbeddedResource Include="resources\tabbar-back~dark.9.png">
+ <LogicalName>tabbar-back~dark.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pulling-2-14%402x.png">
- <LogicalName>status-pulling-2-14@2x.png</LogicalName>
+ <EmbeddedResource Include="resources\tabbar-back~dark%402x.9.png">
+ <LogicalName>tabbar-back~dark@2x.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pulling-3-14.png">
- <LogicalName>status-pulling-3-14.png</LogicalName>
+ <EmbeddedResource Include="resources\padbar-back.9.png">
+ <LogicalName>padbar-back.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pulling-3-14%402x.png">
- <LogicalName>status-pulling-3-14@2x.png</LogicalName>
+ <EmbeddedResource Include="resources\padbar-back%402x.9.png">
+ <LogicalName>padbar-back@2x.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pulling-4-14.png">
- <LogicalName>status-pulling-4-14.png</LogicalName>
+ <EmbeddedResource Include="resources\padbar-back~dark.9.png">
+ <LogicalName>padbar-back~dark.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pulling-4-14%402x.png">
- <LogicalName>status-pulling-4-14@2x.png</LogicalName>
+ <EmbeddedResource Include="resources\padbar-back~dark%402x.9.png">
+ <LogicalName>padbar-back~dark@2x.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pulling-5-14.png">
- <LogicalName>status-pulling-5-14.png</LogicalName>
+ <EmbeddedResource Include="resources\tabbar-inactive.9.png">
+ <LogicalName>tabbar-inactive.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pulling-5-14%402x.png">
- <LogicalName>status-pulling-5-14@2x.png</LogicalName>
+ <EmbeddedResource Include="resources\tabbar-inactive%402x.9.png">
+ <LogicalName>tabbar-inactive@2x.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pulling-6-14.png">
- <LogicalName>status-pulling-6-14.png</LogicalName>
+ <EmbeddedResource Include="resources\tabbar-inactive~dark.9.png">
+ <LogicalName>tabbar-inactive~dark.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-pulling-6-14%402x.png">
- <LogicalName>status-pulling-6-14@2x.png</LogicalName>
+ <EmbeddedResource Include="resources\tabbar-inactive~dark%402x.9.png">
+ <LogicalName>tabbar-inactive~dark@2x.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-opening-1-14.png">
- <LogicalName>status-opening-1-14.png</LogicalName>
+ <EmbeddedResource Include="resources\padbar-inactive.9.png">
+ <LogicalName>padbar-inactive.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-opening-1-14%402x.png">
- <LogicalName>status-opening-1-14@2x.png</LogicalName>
+ <EmbeddedResource Include="resources\padbar-inactive%402x.9.png">
+ <LogicalName>padbar-inactive@2x.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-opening-2-14.png">
- <LogicalName>status-opening-2-14.png</LogicalName>
+ <EmbeddedResource Include="resources\padbar-inactive~dark.9.png">
+ <LogicalName>padbar-inactive~dark.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-opening-2-14%402x.png">
- <LogicalName>status-opening-2-14@2x.png</LogicalName>
+ <EmbeddedResource Include="resources\padbar-inactive~dark%402x.9.png">
+ <LogicalName>padbar-inactive~dark@2x.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-opening-3-14.png">
- <LogicalName>status-opening-3-14.png</LogicalName>
+ <EmbeddedResource Include="resources\tabbar-active.9.png">
+ <LogicalName>tabbar-active.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-opening-3-14%402x.png">
- <LogicalName>status-opening-3-14@2x.png</LogicalName>
+ <EmbeddedResource Include="resources\tabbar-active%402x.9.png">
+ <LogicalName>tabbar-active@2x.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-opening-4-14.png">
- <LogicalName>status-opening-4-14.png</LogicalName>
+ <EmbeddedResource Include="resources\tabbar-active~dark.9.png">
+ <LogicalName>tabbar-active~dark.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-opening-4-14%402x.png">
- <LogicalName>status-opening-4-14@2x.png</LogicalName>
+ <EmbeddedResource Include="resources\tabbar-active~dark%402x.9.png">
+ <LogicalName>tabbar-active~dark@2x.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-opening-5-14.png">
- <LogicalName>status-opening-5-14.png</LogicalName>
+ <EmbeddedResource Include="resources\padbar-active.9.png">
+ <LogicalName>padbar-active.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-opening-5-14%402x.png">
- <LogicalName>status-opening-5-14@2x.png</LogicalName>
+ <EmbeddedResource Include="resources\padbar-active%402x.9.png">
+ <LogicalName>padbar-active@2x.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-opening-6-14.png">
- <LogicalName>status-opening-6-14.png</LogicalName>
+ <EmbeddedResource Include="resources\padbar-active~dark.9.png">
+ <LogicalName>padbar-active~dark.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-opening-6-14%402x.png">
- <LogicalName>status-opening-6-14@2x.png</LogicalName>
+ <EmbeddedResource Include="resources\padbar-active~dark%402x.9.png">
+ <LogicalName>padbar-active~dark@2x.9.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-ready-14.png">
- <LogicalName>status-ready-14.png</LogicalName>
+ <EmbeddedResource Include="icons\platform-tvos-16.png">
+ <LogicalName>platform-tvos-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-ready-14%402x.png">
- <LogicalName>status-ready-14@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\platform-tvos-16%402x.png">
+ <LogicalName>platform-tvos-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-success-14.png">
- <LogicalName>status-success-14.png</LogicalName>
+ <EmbeddedResource Include="icons\platform-tvos-16~dark.png">
+ <LogicalName>platform-tvos-16~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-success-14%402x.png">
- <LogicalName>status-success-14@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\platform-tvos-16~dark%402x.png">
+ <LogicalName>platform-tvos-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-warning-14.png">
- <LogicalName>status-warning-14.png</LogicalName>
+ <EmbeddedResource Include="icons\platform-tvos-16~sel.png">
+ <LogicalName>platform-tvos-16~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-warning-14%402x.png">
- <LogicalName>status-warning-14@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\platform-tvos-16~sel%402x.png">
+ <LogicalName>platform-tvos-16~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-failure-14.png">
- <LogicalName>status-failure-14.png</LogicalName>
+ <EmbeddedResource Include="icons\platform-tvos-16~dark~sel.png">
+ <LogicalName>platform-tvos-16~dark~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-failure-14%402x.png">
- <LogicalName>status-failure-14@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\platform-tvos-16~dark~sel%402x.png">
+ <LogicalName>platform-tvos-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-connecting-1-14.png">
- <LogicalName>status-connecting-1-14.png</LogicalName>
+ <EmbeddedResource Include="icons\platform-watchos-16.png">
+ <LogicalName>platform-watchos-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-connecting-1-14%402x.png">
- <LogicalName>status-connecting-1-14@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\platform-watchos-16%402x.png">
+ <LogicalName>platform-watchos-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-connecting-2-14.png">
- <LogicalName>status-connecting-2-14.png</LogicalName>
+ <EmbeddedResource Include="icons\platform-watchos-16~dark.png">
+ <LogicalName>platform-watchos-16~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-connecting-2-14%402x.png">
- <LogicalName>status-connecting-2-14@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\platform-watchos-16~dark%402x.png">
+ <LogicalName>platform-watchos-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-connecting-3-14.png">
- <LogicalName>status-connecting-3-14.png</LogicalName>
+ <EmbeddedResource Include="icons\platform-watchos-16~sel.png">
+ <LogicalName>platform-watchos-16~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-connecting-3-14%402x.png">
- <LogicalName>status-connecting-3-14@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\platform-watchos-16~sel%402x.png">
+ <LogicalName>platform-watchos-16~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-connecting-4-14.png">
- <LogicalName>status-connecting-4-14.png</LogicalName>
+ <EmbeddedResource Include="icons\platform-watchos-16~dark~sel.png">
+ <LogicalName>platform-watchos-16~dark~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-connecting-4-14%402x.png">
- <LogicalName>status-connecting-4-14@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\platform-watchos-16~dark~sel%402x.png">
+ <LogicalName>platform-watchos-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-connecting-5-14.png">
- <LogicalName>status-connecting-5-14.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-assets-16.png">
+ <LogicalName>folder-assets-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-connecting-5-14%402x.png">
- <LogicalName>status-connecting-5-14@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-assets-16%402x.png">
+ <LogicalName>folder-assets-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-connecting-6-14.png">
- <LogicalName>status-connecting-6-14.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-assets-16~dark.png">
+ <LogicalName>folder-assets-16~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-connecting-6-14%402x.png">
- <LogicalName>status-connecting-6-14@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-assets-16~dark%402x.png">
+ <LogicalName>folder-assets-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-waiting-1-14.png">
- <LogicalName>status-waiting-1-14.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-assets-16~sel.png">
+ <LogicalName>folder-assets-16~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-waiting-1-14%402x.png">
- <LogicalName>status-waiting-1-14@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-assets-16~sel%402x.png">
+ <LogicalName>folder-assets-16~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-waiting-2-14.png">
- <LogicalName>status-waiting-2-14.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-assets-16~dark~sel.png">
+ <LogicalName>folder-assets-16~dark~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-waiting-2-14%402x.png">
- <LogicalName>status-waiting-2-14@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\folder-assets-16~dark~sel%402x.png">
+ <LogicalName>folder-assets-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-waiting-3-14.png">
- <LogicalName>status-waiting-3-14.png</LogicalName>
+ <EmbeddedResource Include="icons\parser-16.png">
+ <LogicalName>parser-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-waiting-3-14%402x.png">
- <LogicalName>status-waiting-3-14@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\parser-16%402x.png">
+ <LogicalName>parser-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-waiting-4-14.png">
- <LogicalName>status-waiting-4-14.png</LogicalName>
+ <EmbeddedResource Include="icons\parser-16~dark.png">
+ <LogicalName>parser-16~dark.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-waiting-4-14%402x.png">
- <LogicalName>status-waiting-4-14@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\parser-16~dark%402x.png">
+ <LogicalName>parser-16~dark@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-waiting-5-14.png">
- <LogicalName>status-waiting-5-14.png</LogicalName>
+ <EmbeddedResource Include="icons\parser-16~sel.png">
+ <LogicalName>parser-16~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\status-waiting-5-14%402x.png">
- <LogicalName>status-waiting-5-14@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\parser-16~sel%402x.png">
+ <LogicalName>parser-16~sel@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\parser-16.png">
- <LogicalName>parser-16.png</LogicalName>
+ <EmbeddedResource Include="icons\parser-16~dark~sel.png">
+ <LogicalName>parser-16~dark~sel.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\parser-16%402x.png">
- <LogicalName>parser-16@2x.png</LogicalName>
+ <EmbeddedResource Include="icons\parser-16~dark~sel%402x.png">
+ <LogicalName>parser-16~dark~sel@2x.png</LogicalName>
</EmbeddedResource>
- </ItemGroup>
- <ItemGroup Condition=" '$(Configuration)' == 'DebugMac' OR '$(Configuration)' == 'ReleaseMac' ">
- <EmbeddedResource Include="icons\mac\status-building-1-16.png">
+ <EmbeddedResource Include="icons\status-building-1-16.png">
<LogicalName>status-building-1-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-building-1-16%402x.png">
+ <EmbeddedResource Include="icons\status-building-1-16%402x.png">
<LogicalName>status-building-1-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-building-2-16.png">
+ <EmbeddedResource Include="icons\status-building-1-16~dark.png">
+ <LogicalName>status-building-1-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-building-1-16~dark%402x.png">
+ <LogicalName>status-building-1-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-building-2-16.png">
<LogicalName>status-building-2-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-building-2-16%402x.png">
+ <EmbeddedResource Include="icons\status-building-2-16%402x.png">
<LogicalName>status-building-2-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-building-3-16.png">
+ <EmbeddedResource Include="icons\status-building-2-16~dark.png">
+ <LogicalName>status-building-2-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-building-2-16~dark%402x.png">
+ <LogicalName>status-building-2-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-building-3-16.png">
<LogicalName>status-building-3-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-building-3-16%402x.png">
+ <EmbeddedResource Include="icons\status-building-3-16%402x.png">
<LogicalName>status-building-3-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-building-4-16.png">
+ <EmbeddedResource Include="icons\status-building-3-16~dark.png">
+ <LogicalName>status-building-3-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-building-3-16~dark%402x.png">
+ <LogicalName>status-building-3-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-building-4-16.png">
<LogicalName>status-building-4-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-building-4-16%402x.png">
+ <EmbeddedResource Include="icons\status-building-4-16%402x.png">
<LogicalName>status-building-4-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-building-5-16.png">
+ <EmbeddedResource Include="icons\status-building-5-16.png">
<LogicalName>status-building-5-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-building-5-16%402x.png">
+ <EmbeddedResource Include="icons\status-building-5-16%402x.png">
<LogicalName>status-building-5-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-connecting-1-16.png">
+ <EmbeddedResource Include="icons\status-building-5-16~dark.png">
+ <LogicalName>status-building-5-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-building-5-16~dark%402x.png">
+ <LogicalName>status-building-5-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-connecting-1-16.png">
<LogicalName>status-connecting-1-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-connecting-1-16%402x.png">
+ <EmbeddedResource Include="icons\status-connecting-1-16%402x.png">
<LogicalName>status-connecting-1-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-connecting-2-16.png">
+ <EmbeddedResource Include="icons\status-connecting-1-16~dark.png">
+ <LogicalName>status-connecting-1-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-connecting-1-16~dark%402x.png">
+ <LogicalName>status-connecting-1-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-connecting-2-16.png">
<LogicalName>status-connecting-2-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-connecting-2-16%402x.png">
+ <EmbeddedResource Include="icons\status-connecting-2-16%402x.png">
<LogicalName>status-connecting-2-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-connecting-3-16.png">
+ <EmbeddedResource Include="icons\status-connecting-2-16~dark.png">
+ <LogicalName>status-connecting-2-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-connecting-2-16~dark%402x.png">
+ <LogicalName>status-connecting-2-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-connecting-3-16.png">
<LogicalName>status-connecting-3-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-connecting-3-16%402x.png">
+ <EmbeddedResource Include="icons\status-connecting-3-16%402x.png">
<LogicalName>status-connecting-3-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-connecting-4-16.png">
+ <EmbeddedResource Include="icons\status-connecting-3-16~dark.png">
+ <LogicalName>status-connecting-3-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-connecting-3-16~dark%402x.png">
+ <LogicalName>status-connecting-3-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-connecting-4-16.png">
<LogicalName>status-connecting-4-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-connecting-4-16%402x.png">
+ <EmbeddedResource Include="icons\status-connecting-4-16%402x.png">
<LogicalName>status-connecting-4-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-connecting-5-16.png">
+ <EmbeddedResource Include="icons\status-connecting-4-16~dark.png">
+ <LogicalName>status-connecting-4-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-connecting-4-16~dark%402x.png">
+ <LogicalName>status-connecting-4-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-connecting-5-16.png">
<LogicalName>status-connecting-5-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-connecting-5-16%402x.png">
+ <EmbeddedResource Include="icons\status-connecting-5-16%402x.png">
<LogicalName>status-connecting-5-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-connecting-6-16.png">
+ <EmbeddedResource Include="icons\status-connecting-5-16~dark.png">
+ <LogicalName>status-connecting-5-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-connecting-5-16~dark%402x.png">
+ <LogicalName>status-connecting-5-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-connecting-6-16.png">
<LogicalName>status-connecting-6-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-connecting-6-16%402x.png">
+ <EmbeddedResource Include="icons\status-connecting-6-16%402x.png">
<LogicalName>status-connecting-6-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-updates-paused-16.png">
+ <EmbeddedResource Include="icons\status-connecting-6-16~dark.png">
+ <LogicalName>status-connecting-6-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-connecting-6-16~dark%402x.png">
+ <LogicalName>status-connecting-6-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-updates-paused-16.png">
<LogicalName>status-updates-paused-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-updates-paused-16%402x.png">
+ <EmbeddedResource Include="icons\status-updates-paused-16%402x.png">
<LogicalName>status-updates-paused-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-updates-ready-16.png">
+ <EmbeddedResource Include="icons\status-updates-paused-16~dark.png">
+ <LogicalName>status-updates-paused-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-updates-paused-16~dark%402x.png">
+ <LogicalName>status-updates-paused-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-updates-ready-16.png">
<LogicalName>status-updates-ready-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-updates-ready-16%402x.png">
+ <EmbeddedResource Include="icons\status-updates-ready-16%402x.png">
<LogicalName>status-updates-ready-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-error-16.png">
+ <EmbeddedResource Include="icons\status-updates-ready-16~dark.png">
+ <LogicalName>status-updates-ready-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-updates-ready-16~dark%402x.png">
+ <LogicalName>status-updates-ready-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-error-16.png">
<LogicalName>status-error-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-error-16%402x.png">
+ <EmbeddedResource Include="icons\status-error-16%402x.png">
<LogicalName>status-error-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-error-count-16.png">
+ <EmbeddedResource Include="icons\status-error-16~dark.png">
+ <LogicalName>status-error-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-error-16~dark%402x.png">
+ <LogicalName>status-error-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-error-count-16.png">
<LogicalName>status-error-count-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-error-count-16%402x.png">
+ <EmbeddedResource Include="icons\status-error-count-16%402x.png">
<LogicalName>status-error-count-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-opening-1-16.png">
+ <EmbeddedResource Include="icons\status-error-count-16~dark.png">
+ <LogicalName>status-error-count-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-error-count-16~dark%402x.png">
+ <LogicalName>status-error-count-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-opening-1-16.png">
<LogicalName>status-opening-1-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-opening-1-16%402x.png">
+ <EmbeddedResource Include="icons\status-opening-1-16%402x.png">
<LogicalName>status-opening-1-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-opening-2-16.png">
+ <EmbeddedResource Include="icons\status-opening-1-16~dark.png">
+ <LogicalName>status-opening-1-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-opening-1-16~dark%402x.png">
+ <LogicalName>status-opening-1-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-opening-2-16.png">
<LogicalName>status-opening-2-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-opening-2-16%402x.png">
+ <EmbeddedResource Include="icons\status-opening-2-16%402x.png">
<LogicalName>status-opening-2-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-opening-3-16.png">
+ <EmbeddedResource Include="icons\status-opening-2-16~dark.png">
+ <LogicalName>status-opening-2-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-opening-2-16~dark%402x.png">
+ <LogicalName>status-opening-2-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-opening-3-16.png">
<LogicalName>status-opening-3-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-opening-3-16%402x.png">
+ <EmbeddedResource Include="icons\status-opening-3-16%402x.png">
<LogicalName>status-opening-3-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-opening-4-16.png">
+ <EmbeddedResource Include="icons\status-opening-3-16~dark.png">
+ <LogicalName>status-opening-3-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-opening-3-16~dark%402x.png">
+ <LogicalName>status-opening-3-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-opening-4-16.png">
<LogicalName>status-opening-4-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-opening-4-16%402x.png">
+ <EmbeddedResource Include="icons\status-opening-4-16%402x.png">
<LogicalName>status-opening-4-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-opening-5-16.png">
+ <EmbeddedResource Include="icons\status-opening-4-16~dark.png">
+ <LogicalName>status-opening-4-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-opening-4-16~dark%402x.png">
+ <LogicalName>status-opening-4-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-opening-5-16.png">
<LogicalName>status-opening-5-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-opening-5-16%402x.png">
+ <EmbeddedResource Include="icons\status-opening-5-16%402x.png">
<LogicalName>status-opening-5-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-opening-6-16.png">
+ <EmbeddedResource Include="icons\status-opening-5-16~dark.png">
+ <LogicalName>status-opening-5-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-opening-5-16~dark%402x.png">
+ <LogicalName>status-opening-5-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-opening-6-16.png">
<LogicalName>status-opening-6-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-opening-6-16%402x.png">
+ <EmbeddedResource Include="icons\status-opening-6-16%402x.png">
<LogicalName>status-opening-6-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-parsing-16.png">
+ <EmbeddedResource Include="icons\status-opening-6-16~dark.png">
+ <LogicalName>status-opening-6-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-opening-6-16~dark%402x.png">
+ <LogicalName>status-opening-6-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-parsing-16.png">
<LogicalName>status-parsing-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-parsing-16%402x.png">
+ <EmbeddedResource Include="icons\status-parsing-16%402x.png">
<LogicalName>status-parsing-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pulling-1-16.png">
+ <EmbeddedResource Include="icons\status-parsing-16~dark.png">
+ <LogicalName>status-parsing-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-parsing-16~dark%402x.png">
+ <LogicalName>status-parsing-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pulling-1-16.png">
<LogicalName>status-pulling-1-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pulling-1-16%402x.png">
+ <EmbeddedResource Include="icons\status-pulling-1-16%402x.png">
<LogicalName>status-pulling-1-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pulling-2-16.png">
+ <EmbeddedResource Include="icons\status-pulling-1-16~dark.png">
+ <LogicalName>status-pulling-1-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pulling-1-16~dark%402x.png">
+ <LogicalName>status-pulling-1-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pulling-2-16.png">
<LogicalName>status-pulling-2-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pulling-2-16%402x.png">
+ <EmbeddedResource Include="icons\status-pulling-2-16%402x.png">
<LogicalName>status-pulling-2-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pulling-3-16.png">
+ <EmbeddedResource Include="icons\status-pulling-2-16~dark.png">
+ <LogicalName>status-pulling-2-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pulling-2-16~dark%402x.png">
+ <LogicalName>status-pulling-2-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pulling-3-16.png">
<LogicalName>status-pulling-3-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pulling-3-16%402x.png">
+ <EmbeddedResource Include="icons\status-pulling-3-16%402x.png">
<LogicalName>status-pulling-3-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pulling-4-16.png">
+ <EmbeddedResource Include="icons\status-pulling-3-16~dark.png">
+ <LogicalName>status-pulling-3-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pulling-3-16~dark%402x.png">
+ <LogicalName>status-pulling-3-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pulling-4-16.png">
<LogicalName>status-pulling-4-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pulling-4-16%402x.png">
+ <EmbeddedResource Include="icons\status-pulling-4-16%402x.png">
<LogicalName>status-pulling-4-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pulling-5-16.png">
+ <EmbeddedResource Include="icons\status-pulling-4-16~dark.png">
+ <LogicalName>status-pulling-4-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pulling-4-16~dark%402x.png">
+ <LogicalName>status-pulling-4-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pulling-5-16.png">
<LogicalName>status-pulling-5-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pulling-5-16%402x.png">
+ <EmbeddedResource Include="icons\status-pulling-5-16%402x.png">
<LogicalName>status-pulling-5-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pulling-6-16.png">
+ <EmbeddedResource Include="icons\status-pulling-5-16~dark.png">
+ <LogicalName>status-pulling-5-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pulling-5-16~dark%402x.png">
+ <LogicalName>status-pulling-5-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pulling-6-16.png">
<LogicalName>status-pulling-6-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pulling-6-16%402x.png">
+ <EmbeddedResource Include="icons\status-pulling-6-16%402x.png">
<LogicalName>status-pulling-6-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pushing-1-16.png">
+ <EmbeddedResource Include="icons\status-pulling-6-16~dark.png">
+ <LogicalName>status-pulling-6-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pulling-6-16~dark%402x.png">
+ <LogicalName>status-pulling-6-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pushing-1-16.png">
<LogicalName>status-pushing-1-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pushing-1-16%402x.png">
+ <EmbeddedResource Include="icons\status-pushing-1-16%402x.png">
<LogicalName>status-pushing-1-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pushing-2-16.png">
+ <EmbeddedResource Include="icons\status-pushing-1-16~dark.png">
+ <LogicalName>status-pushing-1-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pushing-1-16~dark%402x.png">
+ <LogicalName>status-pushing-1-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pushing-2-16.png">
<LogicalName>status-pushing-2-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pushing-2-16%402x.png">
+ <EmbeddedResource Include="icons\status-pushing-2-16%402x.png">
<LogicalName>status-pushing-2-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pushing-3-16.png">
+ <EmbeddedResource Include="icons\status-pushing-2-16~dark.png">
+ <LogicalName>status-pushing-2-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pushing-2-16~dark%402x.png">
+ <LogicalName>status-pushing-2-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pushing-3-16.png">
<LogicalName>status-pushing-3-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pushing-3-16%402x.png">
+ <EmbeddedResource Include="icons\status-pushing-3-16%402x.png">
<LogicalName>status-pushing-3-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pushing-4-16.png">
+ <EmbeddedResource Include="icons\status-pushing-3-16~dark.png">
+ <LogicalName>status-pushing-3-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pushing-3-16~dark%402x.png">
+ <LogicalName>status-pushing-3-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pushing-4-16.png">
<LogicalName>status-pushing-4-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pushing-4-16%402x.png">
+ <EmbeddedResource Include="icons\status-pushing-4-16%402x.png">
<LogicalName>status-pushing-4-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pushing-5-16.png">
+ <EmbeddedResource Include="icons\status-pushing-4-16~dark.png">
+ <LogicalName>status-pushing-4-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pushing-4-16~dark%402x.png">
+ <LogicalName>status-pushing-4-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pushing-5-16.png">
<LogicalName>status-pushing-5-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pushing-5-16%402x.png">
+ <EmbeddedResource Include="icons\status-pushing-5-16%402x.png">
<LogicalName>status-pushing-5-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pushing-6-16.png">
+ <EmbeddedResource Include="icons\status-pushing-5-16~dark.png">
+ <LogicalName>status-pushing-5-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pushing-5-16~dark%402x.png">
+ <LogicalName>status-pushing-5-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pushing-6-16.png">
<LogicalName>status-pushing-6-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-pushing-6-16%402x.png">
+ <EmbeddedResource Include="icons\status-pushing-6-16%402x.png">
<LogicalName>status-pushing-6-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-ready-16.png">
+ <EmbeddedResource Include="icons\status-pushing-6-16~dark.png">
+ <LogicalName>status-pushing-6-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-pushing-6-16~dark%402x.png">
+ <LogicalName>status-pushing-6-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-ready-16.png">
<LogicalName>status-ready-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-ready-16%402x.png">
+ <EmbeddedResource Include="icons\status-ready-16%402x.png">
<LogicalName>status-ready-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-searching-1-16.png">
+ <EmbeddedResource Include="icons\status-ready-16~dark.png">
+ <LogicalName>status-ready-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-ready-16~dark%402x.png">
+ <LogicalName>status-ready-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-searching-1-16.png">
<LogicalName>status-searching-1-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-searching-1-16%402x.png">
+ <EmbeddedResource Include="icons\status-searching-1-16%402x.png">
<LogicalName>status-searching-1-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-searching-2-16.png">
+ <EmbeddedResource Include="icons\status-searching-1-16~dark.png">
+ <LogicalName>status-searching-1-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-searching-1-16~dark%402x.png">
+ <LogicalName>status-searching-1-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-searching-2-16.png">
<LogicalName>status-searching-2-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-searching-2-16%402x.png">
+ <EmbeddedResource Include="icons\status-searching-2-16%402x.png">
<LogicalName>status-searching-2-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-searching-3-16.png">
+ <EmbeddedResource Include="icons\status-searching-2-16~dark.png">
+ <LogicalName>status-searching-2-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-searching-2-16~dark%402x.png">
+ <LogicalName>status-searching-2-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-searching-3-16.png">
<LogicalName>status-searching-3-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-searching-3-16%402x.png">
+ <EmbeddedResource Include="icons\status-searching-3-16%402x.png">
<LogicalName>status-searching-3-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-searching-4-16.png">
+ <EmbeddedResource Include="icons\status-searching-3-16~dark.png">
+ <LogicalName>status-searching-3-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-searching-3-16~dark%402x.png">
+ <LogicalName>status-searching-3-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-searching-4-16.png">
<LogicalName>status-searching-4-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-searching-4-16%402x.png">
+ <EmbeddedResource Include="icons\status-searching-4-16%402x.png">
<LogicalName>status-searching-4-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-success-16.png">
+ <EmbeddedResource Include="icons\status-searching-4-16~dark.png">
+ <LogicalName>status-searching-4-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-searching-4-16~dark%402x.png">
+ <LogicalName>status-searching-4-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-success-16.png">
<LogicalName>status-success-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-success-16%402x.png">
+ <EmbeddedResource Include="icons\status-success-16%402x.png">
<LogicalName>status-success-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-updates-downloading-1-16.png">
+ <EmbeddedResource Include="icons\status-success-16~dark.png">
+ <LogicalName>status-success-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-success-16~dark%402x.png">
+ <LogicalName>status-success-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-updates-downloading-1-16.png">
<LogicalName>status-updates-downloading-1-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-updates-downloading-1-16%402x.png">
+ <EmbeddedResource Include="icons\status-updates-downloading-1-16%402x.png">
<LogicalName>status-updates-downloading-1-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-updates-downloading-2-16.png">
+ <EmbeddedResource Include="icons\status-updates-downloading-1-16~dark.png">
+ <LogicalName>status-updates-downloading-1-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-updates-downloading-1-16~dark%402x.png">
+ <LogicalName>status-updates-downloading-1-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-updates-downloading-2-16.png">
<LogicalName>status-updates-downloading-2-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-updates-downloading-2-16%402x.png">
+ <EmbeddedResource Include="icons\status-updates-downloading-2-16%402x.png">
<LogicalName>status-updates-downloading-2-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-updates-downloading-3-16.png">
+ <EmbeddedResource Include="icons\status-updates-downloading-2-16~dark.png">
+ <LogicalName>status-updates-downloading-2-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-updates-downloading-2-16~dark%402x.png">
+ <LogicalName>status-updates-downloading-2-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-updates-downloading-3-16.png">
<LogicalName>status-updates-downloading-3-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-updates-downloading-3-16%402x.png">
+ <EmbeddedResource Include="icons\status-updates-downloading-3-16%402x.png">
<LogicalName>status-updates-downloading-3-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-updates-downloading-4-16.png">
+ <EmbeddedResource Include="icons\status-updates-downloading-3-16~dark.png">
+ <LogicalName>status-updates-downloading-3-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-updates-downloading-3-16~dark%402x.png">
+ <LogicalName>status-updates-downloading-3-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-updates-downloading-4-16.png">
<LogicalName>status-updates-downloading-4-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-updates-downloading-4-16%402x.png">
+ <EmbeddedResource Include="icons\status-updates-downloading-4-16%402x.png">
<LogicalName>status-updates-downloading-4-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-updates-downloading-5-16.png">
+ <EmbeddedResource Include="icons\status-updates-downloading-4-16~dark.png">
+ <LogicalName>status-updates-downloading-4-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-updates-downloading-4-16~dark%402x.png">
+ <LogicalName>status-updates-downloading-4-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-updates-downloading-5-16.png">
<LogicalName>status-updates-downloading-5-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-updates-downloading-5-16%402x.png">
+ <EmbeddedResource Include="icons\status-updates-downloading-5-16%402x.png">
<LogicalName>status-updates-downloading-5-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-updates-downloading-6-16.png">
+ <EmbeddedResource Include="icons\status-updates-downloading-5-16~dark.png">
+ <LogicalName>status-updates-downloading-5-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-updates-downloading-5-16~dark%402x.png">
+ <LogicalName>status-updates-downloading-5-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-updates-downloading-6-16.png">
<LogicalName>status-updates-downloading-6-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-updates-downloading-6-16%402x.png">
+ <EmbeddedResource Include="icons\status-updates-downloading-6-16%402x.png">
<LogicalName>status-updates-downloading-6-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-waiting-1-16.png">
+ <EmbeddedResource Include="icons\status-updates-downloading-6-16~dark.png">
+ <LogicalName>status-updates-downloading-6-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-updates-downloading-6-16~dark%402x.png">
+ <LogicalName>status-updates-downloading-6-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-waiting-1-16.png">
<LogicalName>status-waiting-1-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-waiting-1-16%402x.png">
+ <EmbeddedResource Include="icons\status-waiting-1-16%402x.png">
<LogicalName>status-waiting-1-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-waiting-2-16.png">
+ <EmbeddedResource Include="icons\status-waiting-1-16~dark.png">
+ <LogicalName>status-waiting-1-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-waiting-1-16~dark%402x.png">
+ <LogicalName>status-waiting-1-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-waiting-2-16.png">
<LogicalName>status-waiting-2-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-waiting-2-16%402x.png">
+ <EmbeddedResource Include="icons\status-waiting-2-16%402x.png">
<LogicalName>status-waiting-2-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-waiting-3-16.png">
+ <EmbeddedResource Include="icons\status-waiting-2-16~dark.png">
+ <LogicalName>status-waiting-2-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-waiting-2-16~dark%402x.png">
+ <LogicalName>status-waiting-2-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-waiting-3-16.png">
<LogicalName>status-waiting-3-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-waiting-3-16%402x.png">
+ <EmbeddedResource Include="icons\status-waiting-3-16%402x.png">
<LogicalName>status-waiting-3-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-waiting-4-16.png">
+ <EmbeddedResource Include="icons\status-waiting-3-16~dark.png">
+ <LogicalName>status-waiting-3-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-waiting-3-16~dark%402x.png">
+ <LogicalName>status-waiting-3-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-waiting-4-16.png">
<LogicalName>status-waiting-4-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-waiting-4-16%402x.png">
+ <EmbeddedResource Include="icons\status-waiting-4-16%402x.png">
<LogicalName>status-waiting-4-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-waiting-5-16.png">
+ <EmbeddedResource Include="icons\status-waiting-4-16~dark.png">
+ <LogicalName>status-waiting-4-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-waiting-4-16~dark%402x.png">
+ <LogicalName>status-waiting-4-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-waiting-5-16.png">
<LogicalName>status-waiting-5-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-waiting-5-16%402x.png">
+ <EmbeddedResource Include="icons\status-waiting-5-16%402x.png">
<LogicalName>status-waiting-5-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-warning-16.png">
+ <EmbeddedResource Include="icons\status-waiting-5-16~dark.png">
+ <LogicalName>status-waiting-5-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-waiting-5-16~dark%402x.png">
+ <LogicalName>status-waiting-5-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-warning-16.png">
<LogicalName>status-warning-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-warning-16%402x.png">
+ <EmbeddedResource Include="icons\status-warning-16%402x.png">
<LogicalName>status-warning-16@2x.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-warning-count-16.png">
+ <EmbeddedResource Include="icons\status-warning-16~dark.png">
+ <LogicalName>status-warning-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-warning-16~dark%402x.png">
+ <LogicalName>status-warning-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-warning-count-16.png">
<LogicalName>status-warning-count-16.png</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="icons\mac\status-warning-count-16%402x.png">
+ <EmbeddedResource Include="icons\status-warning-count-16%402x.png">
<LogicalName>status-warning-count-16@2x.png</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="icons\status-warning-count-16~dark.png">
+ <LogicalName>status-warning-count-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\status-warning-count-16~dark%402x.png">
+ <LogicalName>status-warning-count-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\unindent-16.png">
+ <LogicalName>unindent-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\unindent-16%402x.png">
+ <LogicalName>unindent-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\unindent-16~dark.png">
+ <LogicalName>unindent-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\unindent-16~dark%402x.png">
+ <LogicalName>unindent-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\about-md-16.png">
+ <LogicalName>about-md-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\about-md-16%402x.png">
+ <LogicalName>about-md-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\about-md-16~dark.png">
+ <LogicalName>about-md-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\about-md-16~dark%402x.png">
+ <LogicalName>about-md-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\about-md-16~disabled.png">
+ <LogicalName>about-md-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\about-md-16~disabled%402x.png">
+ <LogicalName>about-md-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\about-md-16~dark~disabled.png">
+ <LogicalName>about-md-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\about-md-16~dark~disabled%402x.png">
+ <LogicalName>about-md-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\plugin-menu-16.png">
+ <LogicalName>plugin-menu-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\plugin-menu-16%402x.png">
+ <LogicalName>plugin-menu-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\plugin-menu-16~dark.png">
+ <LogicalName>plugin-menu-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\plugin-menu-16~dark%402x.png">
+ <LogicalName>plugin-menu-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\cut-16.png">
+ <LogicalName>cut-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\cut-16%402x.png">
+ <LogicalName>cut-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\cut-16~dark.png">
+ <LogicalName>cut-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\cut-16~dark%402x.png">
+ <LogicalName>cut-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\fullscreen-16.png">
+ <LogicalName>fullscreen-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\fullscreen-16%402x.png">
+ <LogicalName>fullscreen-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\fullscreen-16~dark.png">
+ <LogicalName>fullscreen-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\fullscreen-16~dark%402x.png">
+ <LogicalName>fullscreen-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\fullscreen-16~sel.png">
+ <LogicalName>fullscreen-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\fullscreen-16~sel%402x.png">
+ <LogicalName>fullscreen-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\fullscreen-16~dark~sel.png">
+ <LogicalName>fullscreen-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\fullscreen-16~dark~sel%402x.png">
+ <LogicalName>fullscreen-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\help-16.png">
+ <LogicalName>help-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\help-16%402x.png">
+ <LogicalName>help-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\help-16~dark.png">
+ <LogicalName>help-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\help-16~dark%402x.png">
+ <LogicalName>help-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\help-16~sel.png">
+ <LogicalName>help-16~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\help-16~sel%402x.png">
+ <LogicalName>help-16~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\help-16~dark~sel.png">
+ <LogicalName>help-16~dark~sel.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\help-16~dark~sel%402x.png">
+ <LogicalName>help-16~dark~sel@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\indent-16.png">
+ <LogicalName>indent-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\indent-16%402x.png">
+ <LogicalName>indent-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\indent-16~dark.png">
+ <LogicalName>indent-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\indent-16~dark%402x.png">
+ <LogicalName>indent-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\paste-16.png">
+ <LogicalName>paste-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\paste-16%402x.png">
+ <LogicalName>paste-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\paste-16~dark.png">
+ <LogicalName>paste-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\paste-16~dark%402x.png">
+ <LogicalName>paste-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\print-16.png">
+ <LogicalName>print-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\print-16%402x.png">
+ <LogicalName>print-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\print-16~dark.png">
+ <LogicalName>print-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\print-16~dark%402x.png">
+ <LogicalName>print-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\redo-16.png">
+ <LogicalName>redo-16.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\redo-16%402x.png">
+ <LogicalName>redo-16@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\redo-16~dark.png">
+ <LogicalName>redo-16~dark.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\redo-16~dark%402x.png">
+ <LogicalName>redo-16~dark@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\redo-16~disabled.png">
+ <LogicalName>redo-16~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\redo-16~disabled%402x.png">
+ <LogicalName>redo-16~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\redo-16~dark~disabled.png">
+ <LogicalName>redo-16~dark~disabled.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="icons\redo-16~dark~disabled%402x.png">
+ <LogicalName>redo-16~dark~disabled@2x.png</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="templates\AppManifest.xft.xml">
+ <LogicalName>AppManifest.xft.xml</LogicalName>
+ </EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Compile Include="MonoDevelop.Ide.Commands\CustomStringTagProvider.cs" />
@@ -2550,7 +7293,6 @@
<Compile Include="MonoDevelop.Ide.Gui\DisplayBindingService.cs" />
<Compile Include="MonoDevelop.Ide.Gui\BackgroundProgressMonitor.cs" />
<Compile Include="MonoDevelop.Ide.Gui\StatusProgressMonitor.cs" />
- <Compile Include="MonoDevelop.Ide.Tasks\Task.cs" />
<Compile Include="MonoDevelop.Ide.Tasks\TaskService.cs" />
<Compile Include="MonoDevelop.Ide.Codons\ContextPadCodon.cs" />
<Compile Include="MonoDevelop.Ide.Codons\WorkbenchContextCodon.cs" />
@@ -2571,19 +7313,14 @@
<Compile Include="MonoDevelop.Ide.Templates\SingleFileDescriptionTemplate.cs" />
<Compile Include="MonoDevelop.Ide.Templates\SolutionDescriptor.cs" />
<Compile Include="MonoDevelop.Ide.Templates\ResourceFileDescriptionTemplate.cs" />
- <Compile Include="MonoDevelop.Ide.Gui\AbstractBaseViewContent.cs" />
- <Compile Include="MonoDevelop.Ide.Gui\AbstractPadContent.cs" />
- <Compile Include="MonoDevelop.Ide.Gui\AbstractViewContent.cs" />
- <Compile Include="MonoDevelop.Ide.Gui\IBaseViewContent.cs" />
- <Compile Include="MonoDevelop.Ide.Gui\IPadContent.cs" />
- <Compile Include="MonoDevelop.Ide.Gui\IViewContent.cs" />
+ <Compile Include="MonoDevelop.Ide.Gui\BaseViewContent.cs" />
+ <Compile Include="MonoDevelop.Ide.Gui\ViewContent.cs" />
+ <Compile Include="MonoDevelop.Ide.Gui\PadContent.cs" />
<Compile Include="MonoDevelop.Ide.Gui\IWorkbenchWindow.cs" />
<Compile Include="MonoDevelop.Ide.Gui\ViewCommandHandlers.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Content\IBookmarkBuffer.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Content\IClipboardHandler.cs" />
- <Compile Include="MonoDevelop.Ide.Gui.Content\IEditableTextBuffer.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Content\IPrintable.cs" />
- <Compile Include="MonoDevelop.Ide.Gui.Content\ITextBuffer.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Dialogs\CommonAboutDialog.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Dialogs\DirtyFilesDialog.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Dialogs\NewLayoutDialog.cs" />
@@ -2636,7 +7373,6 @@
<Compile Include="MonoDevelop.Ide.Templates\CodeTranslationFileDescriptionTemplate.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Dialogs\SelectEncodingsDialog.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Dialogs\FileSelectorDialog.cs" />
- <Compile Include="MonoDevelop.Ide.Gui.Content\IEncodedTextContent.cs" />
<Compile Include="MonoDevelop.Ide.Tasks\TaskPriority.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Pads\ErrorListPad.cs" />
<Compile Include="gtk-gui\generated.cs" />
@@ -2645,12 +7381,9 @@
<Compile Include="MonoDevelop.Ide.Tasks\CommentTasksView.cs" />
<Compile Include="MonoDevelop.Ide.Tasks\UserTasksView.cs" />
<Compile Include="MonoDevelop.Ide.Gui\LayoutComboBox.cs" />
- <Compile Include="MonoDevelop.Ide.Gui.Content\IExtensibleTextEditor.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Pads.ProjectPad\UnknownEntryNodeBuilder.cs" />
- <Compile Include="MonoDevelop.Ide.Gui.Content\TextEditorExtension.cs" />
<Compile Include="MonoDevelop.Ide.Commands\NavigationCommands.cs" />
<Compile Include="MonoDevelop.Ide.StandardHeader\StandardHeaderService.cs" />
- <Compile Include="MonoDevelop.Ide.Gui\InternalLog.cs" />
<Compile Include="MonoDevelop.Ide.Gui.OptionPanels\KeyBindingsPanel.cs" />
<Compile Include="gtk-gui\MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs" />
<Compile Include="MonoDevelop.Ide.Commands\TextEditorCommands.cs" />
@@ -2671,7 +7404,6 @@
<Compile Include="MonoDevelop.Ide.Templates\FileTemplateCondition.cs" />
<Compile Include="MonoDevelop.Ide.Templates\PartialTypeFileTemplateCondition.cs" />
<Compile Include="MonoDevelop.Ide.Templates\ParentProjectFileTemplateCondition.cs" />
- <Compile Include="MonoDevelop.Ide.Gui.Content\CompletionTextEditorExtension.cs" />
<Compile Include="MonoDevelop.Ide.Gui\ToolbarComboBox.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Content\ISplittable.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Content\IFoldable.cs" />
@@ -2707,7 +7439,6 @@
<Compile Include="MonoDevelop.Ide.Gui.Components\TransactedTreeBuilder.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Content\INavigable.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Content\IOpenNamedElementHandler.cs" />
- <Compile Include="MonoDevelop.Ide.Gui.Content\ISmartIndenter.cs" />
<Compile Include="AssemblyInfo.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Content\ITextEditorResolver.cs" />
<Compile Include="MonoDevelop.Ide.Gui.OptionPanels\AuthorInformationPanel.cs" />
@@ -2748,8 +7479,6 @@
<Compile Include="MonoDevelop.Ide.FindInFiles\SearchResultWidget.cs" />
<Compile Include="MonoDevelop.Ide.FindInFiles\ISearchProgressMonitor.cs" />
<Compile Include="MonoDevelop.Ide.FindInFiles\SearchProgressMonitor.cs" />
- <Compile Include="MonoDevelop.Ide.Gui\IAttachableViewContent.cs" />
- <Compile Include="MonoDevelop.Ide.Gui\AbstractAttachableViewContent.cs" />
<Compile Include="MonoDevelop.Ide.CodeFormatting\CodeFormattingCommands.cs" />
<Compile Include="MonoDevelop.Ide.Execution\ParameterizedExecutionHandler.cs" />
<Compile Include="MonoDevelop.Ide.Execution\ExecutionModeCommandService.cs" />
@@ -2769,7 +7498,6 @@
<Compile Include="MonoDevelop.Ide.Tasks\TaskStore.cs" />
<Compile Include="MonoDevelop.Ide.Gui.OptionPanels\AssemblyFoldersPanel.cs" />
<Compile Include="gtk-gui\MonoDevelop.Ide.Gui.OptionPanels.AssemblyFoldersPanelWidget.cs" />
- <Compile Include="MonoDevelop.Ide.Gui.Content\ISupportsProjectReload.cs" />
<Compile Include="MonoDevelop.Ide.Gui.OptionPanels\BuildMessagePanel.cs" />
<Compile Include="gtk-gui\MonoDevelop.Ide.Gui.OptionPanels.BuildMessagePanelWidget.cs" />
<Compile Include="MonoDevelop.Ide.Gui\HiddenWorkbenchWindow.cs" />
@@ -2840,7 +7568,6 @@
<Compile Include="MonoDevelop.Components.Commands\CommandMenuItem.cs" />
<Compile Include="MonoDevelop.Components.Commands\CommandSystemCommands.cs" />
<Compile Include="MonoDevelop.Components.Commands\CommandToggleToolButton.cs" />
- <Compile Include="MonoDevelop.Components.Commands\CommandToolbar.cs" />
<Compile Include="MonoDevelop.Components.Commands\CommandToolButton.cs" />
<Compile Include="MonoDevelop.Components.Commands\CustomCommand.cs" />
<Compile Include="MonoDevelop.Components.Commands\CustomMenuItem.cs" />
@@ -2870,21 +7597,6 @@
<Compile Include="MonoDevelop.Components.Commands.ExtensionNodes\SeparatorItemCodon.cs" />
<Compile Include="MonoDevelop.Components.Commands.ExtensionNodes\LocalCommandItemCodon.cs" />
<Compile Include="MonoDevelop.Components.Commands.ExtensionNodes\SchemeExtensionNode.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\ArrowWindow.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\DockedPosition.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\DockGrip.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\DockToolbar.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\DockToolbarFrame.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\DockToolbarFrameLayout.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\DockToolbarFrameStatus.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\DockToolbarPanel.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\DockToolbarPosition.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\DockToolbarStatus.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\FixedPanel.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\FloatingDock.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\FloatingPosition.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\IDockBar.cs" />
- <Compile Include="MonoDevelop.Components.DockToolbars\PlaceholderWindow.cs" />
<Compile Include="MonoDevelop.Components.Extensions\PlatformDialog.cs" />
<Compile Include="MonoDevelop.Components.Extensions\ISelectFileDialog.cs" />
<Compile Include="MonoDevelop.Components.PropertyGrid\DefaultPropertyTab.cs" />
@@ -2907,7 +7619,6 @@
<Compile Include="MonoDevelop.Components.PropertyGrid.Editors\FlagsSelectorDialog.cs" />
<Compile Include="MonoDevelop.Components.PropertyGrid.Editors\FloatRange.cs" />
<Compile Include="MonoDevelop.Components.PropertyGrid.Editors\IntRange.cs" />
- <Compile Include="MonoDevelop.Components.PropertyGrid.Editors\TextEditor.cs" />
<Compile Include="MonoDevelop.Components.PropertyGrid.Editors\TextEditorDialog.cs" />
<Compile Include="MonoDevelop.Components.PropertyGrid.Editors\TimeSpanEditor.cs" />
<Compile Include="MonoDevelop.Components.PropertyGrid.Editors\BooleanEditorCell.cs" />
@@ -3103,19 +7814,12 @@
<Compile Include="MonoDevelop.Components.Extensions\AlertDialog.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Dialogs\GtkAlertDialog.cs" />
<Compile Include="MonoDevelop.Components.Extensions\TextQuestionDialog.cs" />
- <Compile Include="MonoDevelop.Components.Extensions\ErrorDialog.cs" />
- <Compile Include="MonoDevelop.Ide.Gui.Dialogs\GtkErrorDialog.cs" />
- <Compile Include="MonoDevelop.Ide.CodeFormatting\ICodeFormatter.cs" />
- <Compile Include="MonoDevelop.Ide.CodeFormatting\IAdvancedCodeFormatter.cs" />
<Compile Include="MonoDevelop.Ide.CodeFormatting\DefaultCodeFormatter.cs" />
<Compile Include="MonoDevelop.Ide.CodeFormatting\CodeFormatterExtensionNode.cs" />
- <Compile Include="MonoDevelop.Ide.CodeFormatting\CodeFormatter.cs" />
- <Compile Include="MonoDevelop.Ide.Gui\GtkSynchronizationContext.cs" />
<Compile Include="MonoDevelop.Ide.Projects\NewPolicySetDialog.cs" />
<Compile Include="gtk-gui\MonoDevelop.Ide.Projects.NewPolicySetDialog.cs" />
<Compile Include="MonoDevelop.Components\HeaderBox.cs" />
<Compile Include="MonoDevelop.Ide.Extensions\StartupHandlerExtensionAttribute.cs" />
- <Compile Include="MonoDevelop.Ide.FindInFiles\ReferencesFinder.cs" />
<Compile Include="MonoDevelop.Components\SectionList.cs" />
<Compile Include="MonoDevelop.Ide.Projects\TemplatePickerWidget.cs" />
<Compile Include="MonoDevelop.Ide.Projects\NewProjectOptionsWidget.cs" />
@@ -3131,8 +7835,6 @@
<Compile Include="gtk-gui\MonoDevelop.Ide.Projects.ProjectSelectorDialog.cs" />
<Compile Include="MonoDevelop.Ide.Projects\ImportProjectPolicyDialog.cs" />
<Compile Include="gtk-gui\MonoDevelop.Ide.Projects.ImportProjectPolicyDialog.cs" />
- <Compile Include="MonoDevelop.Ide.ProgressMonitoring\ProgressBarMonitor.cs" />
- <Compile Include="gtk-gui\MonoDevelop.Ide.ProgressMonitoring.ProgressBarMonitor.cs" />
<Compile Include="MonoDevelop.Ide.Projects\AddExternalFileDialog.cs" />
<Compile Include="gtk-gui\MonoDevelop.Ide.Projects.AddExternalFileDialog.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Components\PriorityList.cs" />
@@ -3175,7 +7877,6 @@
<Compile Include="MonoDevelop.Ide.WelcomePage\WelcomePageRecentProjectsList.cs" />
<Compile Include="MonoDevelop.Ide.WelcomePage\WelcomePageLinksList.cs" />
<Compile Include="MonoDevelop.Ide.Gui\ProjectLoadProgressMonitor.cs" />
- <Compile Include="MonoDevelop.Ide.Gui\CommonTextEditorOptions.cs" />
<Compile Include="MonoDevelop.Components\FileFilterSet.cs" />
<Compile Include="MonoDevelop.Ide\IdeVersionInfo.cs" />
<Compile Include="MonoDevelop.Components\ContextMenuTreeView.cs" />
@@ -3186,24 +7887,14 @@
<Compile Include="MonoDevelop.Components.Commands\CustomCommandTargetAttribute.cs" />
<Compile Include="MonoDevelop.Ide.Extensions\ServiceUrlExtensionNode.cs" />
<Compile Include="MonoDevelop.Ide\ProjectCreatedEventArgs.cs" />
- <Compile Include="MonoDevelop.Ide.FindInFiles\MemberCollector.cs" />
- <Compile Include="MonoDevelop.Ide.FindInFiles\SearchCollector.cs" />
- <Compile Include="MonoDevelop.Ide.TypeSystem\ProjectContentEventArgs.cs" />
<Compile Include="MonoDevelop.Ide.TypeSystem\TypeSystemService.cs" />
<Compile Include="MonoDevelop.Ide.TypeSystem\Ambience.cs" />
- <Compile Include="MonoDevelop.Ide.TypeSystem\AmbienceService.cs" />
- <Compile Include="MonoDevelop.Ide.TypeSystem\NetAmbience.cs" />
- <Compile Include="MonoDevelop.Ide.TypeSystem\OutputFlags.cs" />
- <Compile Include="MonoDevelop.Ide.TypeSystem\OutputSettings.cs" />
<Compile Include="MonoDevelop.Ide.TypeSystem\StockIcons.cs" />
<Compile Include="MonoDevelop.Ide.TypeSystem\FoldingRegion.cs" />
<Compile Include="MonoDevelop.Ide.TypeSystem\ParsedDocument.cs" />
<Compile Include="MonoDevelop.Ide.TypeSystem\Comment.cs" />
<Compile Include="MonoDevelop.Ide.TypeSystem\Tag.cs" />
- <Compile Include="MonoDevelop.Ide.TypeSystem\PreProcessorDefine.cs" />
- <Compile Include="MonoDevelop.Ide.TypeSystem\ConditionalRegion.cs" />
<Compile Include="MonoDevelop.Ide.TypeSystem\MarkupUtilities.cs" />
- <Compile Include="MonoDevelop.Ide.TypeSystem\CodeGenerationService.cs" />
<Compile Include="MonoDevelop.Ide.TypeSystem\CodeGenerator.cs" />
<Compile Include="MonoDevelop.Ide.TypeSystem\TypeSystemParserNode.cs" />
<Compile Include="MonoDevelop.Ide.TypeSystem\MonoDocDocumentationProvider.cs" />
@@ -3215,8 +7906,6 @@
<Compile Include="MonoDevelop.Components.MainToolbar\StatusArea.cs" />
<Compile Include="MonoDevelop.Components.MainToolbar\RoundButton.cs" />
<Compile Include="MonoDevelop.Components.MainToolbar\ButtonBar.cs" />
- <Compile Include="MonoDevelop.Ide.TypeSystem\ProjectCommentTags.cs" />
- <Compile Include="MonoDevelop.Components.MainToolbar\ProjectSearchCategory.cs" />
<Compile Include="MonoDevelop.Components.MainToolbar\SearchCategory.cs" />
<Compile Include="MonoDevelop.Components.MainToolbar\ISearchDataSource.cs" />
<Compile Include="MonoDevelop.Components.MainToolbar\FileSearchCategory.cs" />
@@ -3229,7 +7918,6 @@
<Compile Include="MonoDevelop.Components\TooltipPopoverWindow.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Components\AnimatedIcon.cs" />
<Compile Include="MonoDevelop.Ide\DefaultWebCertificateProvider.cs" />
- <Compile Include="MonoDevelop.Ide.TypeSystem\ParsedFileEventArgs.cs" />
<Compile Include="MonoDevelop.Ide.Extensions\MimeTypeExtensionNode.cs" />
<Compile Include="MonoDevelop.Ide.Gui\DocumentView.cs" />
<Compile Include="MonoDevelop.Components\VPanedThin.cs" />
@@ -3238,7 +7926,6 @@
<Compile Include="MonoDevelop.Components\ExtendedLabel.cs" />
<Compile Include="MonoDevelop.Ide.CodeCompletion\TooltipInformation.cs" />
<Compile Include="MonoDevelop.Ide.CodeCompletion\TooltipInformationWindow.cs" />
- <Compile Include="MonoDevelop.Ide.CodeCompletion\ParameterDataProvider.cs" />
<Compile Include="MonoDevelop.Ide.TypeSystem\TypeSystemParser.cs" />
<Compile Include="MonoDevelop.Ide.WelcomePage\WelcomePageSection.cs" />
<Compile Include="MonoDevelop.Ide.WelcomePage\Style.cs" />
@@ -3258,7 +7945,6 @@
<Compile Include="MonoDevelop.Ide.TextEditing\TopLevelWidgetExtension.cs" />
<Compile Include="MonoDevelop.Ide.TextEditing\VerticalAlignment.cs" />
<Compile Include="MonoDevelop.Ide.TextEditing\HorizontalAlignment.cs" />
- <Compile Include="MonoDevelop.Ide.TextEditing\TextLineMarkerExtension.cs" />
<Compile Include="MonoDevelop.Ide.TextEditing\TextFileEventArgs.cs" />
<Compile Include="MonoDevelop.Ide.TextEditing\LineCountEventArgs.cs" />
<Compile Include="MonoDevelop.Ide.TextEditing\FileExtension.cs" />
@@ -3285,17 +7971,14 @@
<Compile Include="MonoDevelop.Ide.Gui\StatusBarIcon.cs" />
<Compile Include="MonoDevelop.Ide.Gui\StatusBarContextImpl.cs" />
<Compile Include="MonoDevelop.Components.MainToolbar\MainStatusBarContextImpl.cs" />
- <Compile Include="MonoDevelop.Ide.TypeSystem\MonoDevelopProjectContent.cs" />
<Compile Include="MonoDevelop.Components.Commands\ICommandDelegator.cs" />
<Compile Include="MonoDevelop.Ide.CustomTools\ResXFileCodeGenerator.cs" />
- <Compile Include="MonoDevelop.Ide.CustomTools\ThreadAsyncOperation.cs" />
<Compile Include="MonoDevelop.Components\CellRendererImage.cs" />
<Compile Include="MonoDevelop.Components\ImageView.cs" />
<Compile Include="MonoDevelop.Ide.Projects\IdeFileSystemExtensionExtension.cs" />
<Compile Include="AddinInfo.cs" />
<Compile Include="MonoDevelop.Ide.CodeCompletion\CompletionCharacters.cs" />
<Compile Include="MonoDevelop.Ide.CodeCompletion\CompletionCharacterCodon.cs" />
- <Compile Include="MonoDevelop.Ide.TypeSystem\IRefactoringContext.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Pads.ProjectPad\ImplicitFrameworkAssemblyReferenceNodeBuilder.cs" />
<Compile Include="MonoDevelop.Ide.Gui.Pads.ProjectPad\PortableFrameworkSubsetNodeBuilder.cs" />
<Compile Include="MonoDevelop.Components.MainToolbar\SearchInSolutionSearchCategory.cs" />
@@ -3312,6 +7995,57 @@
<Compile Include="MonoDevelop.Ide.Templates\WorkspaceItemCreatedInformation.cs" />
<Compile Include="MonoDevelop.Ide.Templates\PackageReferencesForCreatedProject.cs" />
<Compile Include="MonoDevelop.Ide.Templates\ProjectTemplatePackageInstaller.cs" />
+ <Compile Include="MonoDevelop.Ide.TypeSystem\MonoDevelopTextLoader.cs" />
+ <Compile Include="MonoDevelop.Ide.TypeSystem\MonoDevelopSourceTextContainer.cs" />
+ <Compile Include="MonoDevelop.Ide.CustomTools\PublicResXFileCodeGenerator.cs" />
+ <Compile Include="MonoDevelop.Components\ImageLoader.cs" />
+ <Compile Include="MonoDevelop.Ide.CodeCompletion\ParameterHintingData.cs" />
+ <Compile Include="MonoDevelop.Ide.TypeSystem\MonoDevelopWorkspace.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\IDocumentLine.cs" />
+ <Compile Include="MonoDevelop.Ide.CodeTemplates\IListDataProvider.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\ITextEditorOptions.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\WordFindStrategy.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\InsertionPoint.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\TextLink.cs">
+ <DependentUpon>TextLinkModeEventArgs.cs</DependentUpon>
+ </Compile>
+ <Compile Include="MonoDevelop.Components\WindowTransparencyDecorator.cs" />
+ <Compile Include="MonoDevelop.Components\GtkWorkarounds.cs" />
+ <Compile Include="MonoDevelop.Components\PangoUtil.cs" />
+ <Compile Include="MonoDevelop.Components\HslColor.cs" />
+ <Compile Include="MonoDevelop.Components\HelperMethods.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\SelectionMode.cs" />
+ <Compile Include="MonoDevelop.Components\GtkGestures.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\FileSettingsStore.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\InsertionCursorEventArgs.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\IFoldSegment.cs" />
+ <Compile Include="MonoDevelop.Ide.TextEditing\TextLineMarkerExtension.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\ITextLineMarker.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\TooltipProvider.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\ITextSegmentMarker.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\DocumentRegion.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\TextMarkerMouseEventArgs.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\DefaultSourceEditorOptions.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\TextEditor.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\ITextDocument.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\TextEditorDisplayBinding.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Extension\AbstractUsagesExtension.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\TextEditorViewContent.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Extension\IndentationTracker.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Extension\SelectionSurroundingProvider.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Extension\TextPasteHandler.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\DocumentLocation.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Highlighting\SyntaxModeService.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Highlighting\AmbientColor.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Highlighting\ColorScheme.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Highlighting\ColorDescriptionAttribute.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Highlighting\TemplateCodon.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Highlighting\IStreamProvider.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Highlighting\TemplateExtensionNodeLoader.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\TextLinkModeEventArgs.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\InsertionModeOptions.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\TextLinkModeOptions.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Extension\CompletionTextEditorExtension.cs" />
<Compile Include="MonoDevelop.Components.DockNotebook\DockNotebook.cs" />
<Compile Include="MonoDevelop.Components.DockNotebook\PlaceholderWindow.cs" />
<Compile Include="MonoDevelop.Components.DockNotebook\TabStrip.cs" />
@@ -3328,12 +8062,25 @@
<Compile Include="MonoDevelop.Components\ContextMenuExtensionsMac.cs" />
<Compile Include="MonoDevelop.Components\ContextMenuExtensionsGtk.cs" />
<Compile Include="MonoDevelop.Ide.Gui\Split.cs" />
- <Compile Include="MonoDevelop.Ide.CustomTools\PublicResXFileCodeGenerator.cs" />
- <Compile Include="MonoDevelop.Components\ImageLoader.cs" />
<Compile Include="MonoDevelop.Components.DockNotebook\DockWindow.cs" />
<Compile Include="MonoDevelop.Ide.CustomTools\MSBuildCustomTool.cs" />
<Compile Include="MonoDevelop.Components\Mac\GtkMacInterop.cs" />
<Compile Include="MonoDevelop.Components\Control.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Extension\TextEditorExtension.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\IUnitTestMarker.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Highlighting\ChunkStyle.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\TextMarkerFactory.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\InternalExtensionAPI\ITextEditorImpl.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\InternalExtensionAPI\ITextMarkerFactory.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\InternalExtensionAPI\IEditorActionHost.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\EditActions.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\DocumentContext.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\InternalExtensionAPI\ITextEditorFactory.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\FoldSegmentFactory.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\IReadonlyTextDocument.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Extension\Usage.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\TextEditorFactory.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\AutoSave.cs" />
<Compile Include="MonoDevelop.Ide.Templates\SolutionTemplate.cs" />
<Compile Include="MonoDevelop.Ide.Templates\TemplateCategory.cs" />
<Compile Include="MonoDevelop.Ide.Templates\TemplateWizard.cs" />
@@ -3378,6 +8125,38 @@
<Compile Include="MonoDevelop.Components\Mac\NSViewContainer.cs" />
<Compile Include="MonoDevelop.Components\Mac\GtkEmbed.cs" />
<Compile Include="MonoDevelop.Components\Mac\WidgetWithNativeWindow.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Extension\IQuickTaskProvider.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Extension\QuickTask.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Highlighting\SemanticHighlighting.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Highlighting\ColoredSegment.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\SegmentTree.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Util\Diff.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Util\SimpleBracketMatcher.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Util\SimpleReadonlyDocument.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\Commands\DynamicAbbrevHandler.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Extension\ModifierKeys.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Extension\SpecialKey.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Extension\KeyDescriptor.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\MessageBubbles\MessageBubbleCommands.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\LineEventArgs.cs" />
+ <Compile Include="MonoDevelop.Ide.TypeSystem\Error.cs" />
+ <Compile Include="MonoDevelop.Ide.TypeSystem\MetadataReferenceCache.cs" />
+ <Compile Include="MonoDevelop.Ide.TypeSystem\IFoldingParser.cs" />
+ <Compile Include="MonoDevelop.Ide.TypeSystem\TypeSystemService_WorkspaceHandling.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\Projection\ProjectedSegment.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\Projection\Projection.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\Projection\ProjectedSemanticHighlighting.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\Projection\ProjectedTooltipProvider.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\Projection\ProjectedCompletionExtension.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\Projection\ProjectedDocumentContext.cs" />
+ <Compile Include="MonoDevelop.Ide.CodeCompletion\CompletionCategory.cs" />
+ <Compile Include="MonoDevelop.Ide.CodeCompletion\DisplayFlags.cs" />
+ <Compile Include="MonoDevelop.Ide.CodeCompletion\ParameterHintingResult.cs" />
+ <Compile Include="MonoDevelop.Ide.Tasks\TaskListEntry.cs" />
+ <Compile Include="MonoDevelop.Ide.TypeSystem\AmbienceTooltipProvider.cs" />
+ <Compile Include="MonoDevelop.Components.PropertyGrid.Editors\PropertyTextEditor.cs" />
+ <Compile Include="MonoDevelop.Ide.Tasks\ProjectCommentTags.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\CustomEditorOptions.cs" />
<Compile Include="MonoDevelop.Ide.Projects\NewProjectConfiguration.cs" />
<Compile Include="MonoDevelop.Components\EventBoxTooltip.cs" />
<Compile Include="MonoDevelop.Ide.Templates\ProjectTemplateCreateInformation.cs" />
@@ -3390,6 +8169,10 @@
<Compile Include="MonoDevelop.Components.MainToolbar\StatusBarContextHandler.cs" />
<Compile Include="MonoDevelop.Components.MainToolbar\IButtonBarButton.cs" />
<Compile Include="MonoDevelop.Components.MainToolbar\MainToolbarModels.cs" />
+ <Compile Include="MonoDevelop.Ide.CodeCompletion\MruCache.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\TooltipExtensionNode.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\Projection\IProjectionExtension.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\Projection\ProjectedFilterCompletionTextEditorExtension.cs" />
<Compile Include="MonoDevelop.Components.AutoTest\AppQuery.cs" />
<Compile Include="MonoDevelop.Components.AutoTest\AppResult.cs" />
<Compile Include="MonoDevelop.Components.AutoTest\IAutoTestSessionDebug.cs" />
@@ -3405,18 +8188,60 @@
<Compile Include="MonoDevelop.Components.AutoTest.Operations\TypeOperation.cs" />
<Compile Include="MonoDevelop.Components.AutoTest.Results\GtkTreeModelResult.cs" />
<Compile Include="MonoDevelop.Components.AutoTest.Results\GtkWidgetResult.cs" />
+ <Compile Include="MonoDevelop.Ide.CodeFormatting\AbstractCodeFormatter.cs" />
+ <Compile Include="MonoDevelop.Ide.CodeFormatting\CodeFormatter.cs" />
+ <Compile Include="MonoDevelop.Ide.TypeSystem\TypeSystemOutputTrackingNode.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\TextEditorType.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Extension\AbstractBraceMatcher.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Extension\BraceMatcherTextEditorExtension.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Extension\BraceMatchingResult.cs" />
<Compile Include="MonoDevelop.Components.AutoTest.Operations\ChildrenOperation.cs" />
<Compile Include="MonoDevelop.Components.AutoTest.Results\NSObjectResult.cs" />
+ <Compile Include="MonoDevelop.Ide.TypeSystem\MonoDevelopTemporaryStorageServiceFactory.cs" />
+ <Compile Include="MonoDevelop.Ide.TypeSystem\WorkspaceId.cs" />
+ <Compile Include="MonoDevelop.Ide.TypeSystem\MonoDevelopPersistentStorageServiceFactory.cs" />
+ <Compile Include="MonoDevelop.Ide.TypeSystem\SolutionSizeTracker.cs" />
<Compile Include="MonoDevelop.Components.AutoTest.Results\GtkNotebookResult.cs" />
+ <Compile Include="MonoDevelop.Ide\TaskUtil.cs" />
<Compile Include="MonoDevelop.Ide.Projects.OptionPanels\CodeAnalysisPanel.cs" />
+ <Compile Include="MonoDevelop.Ide.CodeCompletion\ICompletionKeyHandler.cs" />
+ <Compile Include="MonoDevelop.Ide.TypeSystem\NR5CompatibiltyExtensions.cs" />
<Compile Include="MonoDevelop.Ide.Projects\ProjectConfigurationControl.cs" />
+ <Compile Include="MonoDevelop.Ide.TypeSystem\MonoDevelopProjectCacheHostServiceFactory.cs" />
+ <Compile Include="MonoDevelop.Ide.TypeSystem\ProjectCacheService.cs">
+ <DependentUpon>MonoDevelopProjectCacheHostServiceFactory.cs</DependentUpon>
+ </Compile>
+ <Compile Include="MonoDevelop.Ide.TypeSystem\DocumentTrackingService.cs">
+ <DependentUpon>MonoDevelopProjectCacheHostServiceFactory.cs</DependentUpon>
+ </Compile>
<Compile Include="MonoDevelop.Components.AutoTest.Results\ObjectResult.cs" />
<Compile Include="MonoDevelop.Components.AutoTest\PropertyMetadata.cs" />
<Compile Include="MonoDevelop.Components.AutoTest\ObjectProperties.cs" />
+ <Compile Include="MonoDevelop.Components.MainToolbar\ISearchResultCallback.cs" />
+ <Compile Include="MonoDevelop.Ide.Templates\TemplateConditionEvaluator.cs" />
<Compile Include="MonoDevelop.Components.AutoTest.Operations\SelectedOperation.cs" />
<Compile Include="MonoDevelop.Components\Windows\GtkWPFWidget.cs" />
<Compile Include="MonoDevelop.Components\Windows\GtkWin32Interop.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Extension\AbstractNavigationExtension.cs" />
<Compile Include="MonoDevelop.Components\FileChooserAction.cs" />
+ <Compile Include="MonoDevelop.Components\IdeDialog.cs" />
+ <Compile Include="MonoDevelop.Components\IdeWindow.cs" />
+ <Compile Include="MonoDevelop.Components\IdeTheme.cs" />
+ <Compile Include="MonoDevelop.Ide.Templates\PropertyDescriptionTemplate.cs" />
+ <Compile Include="MonoDevelop.Ide.Templates\FileTemplateTagsModifier.cs" />
+ <Compile Include="MonoDevelop.Ide.Templates\CombinedTagModel.cs" />
+ <Compile Include="MonoDevelop.Components.Docking\DockPositionType.cs" />
+ <Compile Include="MonoDevelop.Components\ButtonEvent.cs" />
+ <Compile Include="MonoDevelop.Components\Window.cs" />
+ <Compile Include="MonoDevelop.Components\Dialog.cs" />
+ <Compile Include="MonoDevelop.Ide.TypeSystem\MonoDevelopSourceText.cs" />
+ <Compile Include="MonoDevelop.Components.AutoTest\DataTransferObjects.cs" />
+ <Compile Include="MonoDevelop.Ide.Templates\ProjectCreateInformationExtensions.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Extension\FoldingTextEditorExtension.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Extension\ErrorHandlerTextEditorExtension.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Extension\DefaultCommandTextEditorExtension.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor\EditSession.cs" />
+ <Compile Include="MonoDevelop.Ide.Editor.Extension\AutoInsertBracketTextEditorExtension.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Makefile.am" />
@@ -3460,23 +8285,26 @@
<Folder Include="MonoDevelop.Ide.WelcomePage\icons\" />
<Folder Include="MonoDevelop.Ide.TextEditing\" />
<Folder Include="MonoDevelop.Components.DockNotebook\" />
- <Folder Include="icons\mac\" />
+ <Folder Include="MonoDevelop.Ide.Editor.Util\" />
+ <Folder Include="MonoDevelop.Ide.Editor\Commands\" />
+ <Folder Include="MonoDevelop.Ide.Editor\MessageBubbles\" />
+ <Folder Include="MonoDevelop.Ide.Editor\Projection\" />
<Folder Include="MonoDevelop.Components\Windows\" />
</ItemGroup>
<ItemGroup>
- <Content Include="gtkrc.win32">
+ <Content Include="gtkrc">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="gtkrc.mac">
+ <Content Include="gtkrc.win32">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="gtkrc.mac-yosemite">
+ <Content Include="gtkrc.win32-dark">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="gtkrc">
+ <Content Include="gtkrc.mac">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="gtkrc.win32-vista">
+ <Content Include="gtkrc.mac-dark">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs
index 6cc56393b4..3a48180f21 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs
@@ -33,6 +33,7 @@ using System.IO;
using MonoDevelop.Components;
using MonoDevelop.Components.MainToolbar;
using MonoDevelop.Ide.Fonts;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide
{
@@ -64,10 +65,8 @@ namespace MonoDevelop.Ide
if (PlatformService.CanOpenTerminal)
Runtime.ProcessService.SetExternalConsoleHandler (PlatformService.StartConsoleProcess);
- FileService.FileRemoved += DispatchService.GuiDispatch (
- new EventHandler<FileEventArgs> (NotifyFileRemoved));
- FileService.FileRenamed += DispatchService.GuiDispatch (
- new EventHandler<FileCopyEventArgs> (NotifyFileRenamed));
+ FileService.FileRemoved += NotifyFileRemoved;
+ FileService.FileRenamed += NotifyFileRenamed;
// Ensure we initialize the native toolkit on the UI thread immediately
// so that we can safely access this property later in other threads
@@ -167,14 +166,32 @@ namespace MonoDevelop.Ide
if (!File.Exists (file))
return false;
- using (var f = File.OpenRead (file)) {
- var buf = new byte[8192];
- var read = f.Read (buf, 0, buf.Length);
- for (int i = 0; i < read; i++)
- if (buf [i] == 0)
- return false;
+ return !MonoDevelop.Core.Text.TextFileUtility.IsBinary (file);
+ }
+
+ public async static Task<bool> GetFileIsTextAsync (string file, string mimeType = null)
+ {
+ if (mimeType == null) {
+ mimeType = GetMimeTypeForUri (file);
+ }
+
+ if (mimeType != "application/octet-stream") {
+ return GetMimeTypeIsText (mimeType);
}
- return true;
+
+ return await Task<bool>.Factory.StartNew (delegate {
+ if (!File.Exists (file))
+ return false;
+
+ using (var f = File.OpenRead (file)) {
+ var buf = new byte[8192];
+ var read = f.Read (buf, 0, buf.Length);
+ for (int i = 0; i < read; i++)
+ if (buf [i] == 0)
+ return false;
+ }
+ return true;
+ });
}
public static bool GetMimeTypeIsSubtype (string subMimeType, string baseMimeType)
@@ -229,10 +246,10 @@ namespace MonoDevelop.Ide
{
PlatformService.SetFileAttributes (fileName, attributes);
}
-
- public static Gdk.Rectangle GetUsableMonitorGeometry (Gdk.Screen screen, int monitor)
+
+ public static Xwt.Rectangle GetUsableMonitorGeometry (int screenNumber, int monitorNumber)
{
- return PlatformService.GetUsableMonitorGeometry (screen, monitor);
+ return PlatformService.GetUsableMonitorGeometry (screenNumber, monitorNumber);
}
public static bool CanOpenTerminal {
@@ -302,13 +319,13 @@ namespace MonoDevelop.Ide
PlatformService.GrabDesktopFocus (window);
}
- public static void RemoveWindowShadow (Gtk.Window window)
+ public static void RemoveWindowShadow (Window window)
{
PlatformService.RemoveWindowShadow (window);
}
- public static void SetMainWindowDecorations (Gtk.Window window)
+ public static void SetMainWindowDecorations (Window window)
{
PlatformService.SetMainWindowDecorations (window);
}
@@ -324,12 +341,12 @@ namespace MonoDevelop.Ide
toolbar.Initialize ();
}
- public static bool GetIsFullscreen (Gtk.Window window)
+ public static bool GetIsFullscreen (Window window)
{
return PlatformService.GetIsFullscreen (window);
}
- public static void SetIsFullscreen (Gtk.Window window, bool isFullscreen)
+ public static void SetIsFullscreen (Window window, bool isFullscreen)
{
PlatformService.SetIsFullscreen (window, isFullscreen);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DispatchService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DispatchService.cs
index 68ef37c04a..648eb17bb8 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DispatchService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DispatchService.cs
@@ -36,93 +36,62 @@ using MonoDevelop.Core;
using MonoDevelop.Ide.Gui;
using System.Collections.Generic;
using System.Linq;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide
{
- public class DispatchService
+ public static class DispatchService
{
- static Queue<GenericMessageContainer> backgroundQueue = new Queue<GenericMessageContainer> ();
- static ManualResetEvent backgroundThreadWait = new ManualResetEvent (false);
- static Queue<GenericMessageContainer> guiQueue = new Queue<GenericMessageContainer> ();
- static Thread thrBackground;
- static uint iIdle = 0;
- static GLib.TimeoutHandler handler;
- static Thread guiThread;
static GuiSyncContext guiContext;
- static internal bool DispatchDebug;
- const string errormsg = "An exception was thrown while dispatching a method call in the UI thread.";
- internal static void Initialize ()
- {
- guiContext = new GuiSyncContext ();
- guiThread = Thread.CurrentThread;
-
- handler = new GLib.TimeoutHandler (guiDispatcher);
-
- thrBackground = new Thread (new ThreadStart (backgroundDispatcher)) {
- Name = "Background dispatcher",
- IsBackground = true,
- Priority = ThreadPriority.Lowest,
- };
- thrBackground.Start ();
-
- DispatchDebug = Environment.GetEnvironmentVariable ("MONODEVELOP_DISPATCH_DEBUG") != null;
- }
-
- public static void GuiDispatch (MessageHandler cb)
+ class GtkSynchronizationContext: SynchronizationContext
{
- if (IsGuiThread) {
- cb ();
- return;
+ public override void Post (SendOrPostCallback d, object state)
+ {
+ Gtk.Application.Invoke (delegate {
+ d (state);
+ });
}
- QueueMessage (new GenericMessageContainer (cb, false));
- }
-
- public static void GuiDispatch (StatefulMessageHandler cb, object state)
- {
- if (IsGuiThread) {
- cb (state);
- return;
+ public override void Send (SendOrPostCallback d, object state)
+ {
+ if (Runtime.IsMainThread) {
+ d (state);
+ return;
+ }
+ var ob = new object ();
+ lock (ob) {
+ Gtk.Application.Invoke (delegate {
+ try {
+ d (state);
+ } finally {
+ Monitor.Pulse (ob);
+ }
+ });
+ Monitor.Wait (ob);
+ }
}
- QueueMessage (new StatefulMessageContainer (cb, state, false));
+ public override SynchronizationContext CreateCopy ()
+ {
+ return new GtkSynchronizationContext ();
+ }
}
- public static void GuiSyncDispatch (MessageHandler cb)
+ internal static void Initialize ()
{
- if (IsGuiThread) {
- cb ();
+ if (guiContext != null)
return;
- }
+
+ guiContext = new GuiSyncContext ();
- GenericMessageContainer mc = new GenericMessageContainer (cb, true);
- lock (mc) {
- QueueMessage (mc);
- Monitor.Wait (mc);
- }
- if (mc.Exception != null)
- throw new Exception (errormsg, mc.Exception);
+ SynchronizationContext = new GtkSynchronizationContext ();
}
-
- public static void GuiSyncDispatch (StatefulMessageHandler cb, object state)
- {
- if (IsGuiThread) {
- cb (state);
- return;
- }
- StatefulMessageContainer mc = new StatefulMessageContainer (cb, state, true);
- lock (mc) {
- QueueMessage (mc);
- Monitor.Wait (mc);
- }
- if (mc.Exception != null)
- throw new Exception (errormsg, mc.Exception);
- }
+ public static SynchronizationContext SynchronizationContext { get; private set; }
static DateTime lastPendingEvents;
- public static void RunPendingEvents ()
+ internal static void RunPendingEvents ()
{
// The loop is limited to 1000 iterations as a workaround for an issue that some users
// have experienced. Sometimes EventsPending starts return 'true' for all iterations,
@@ -150,183 +119,8 @@ namespace MonoDevelop.Ide
sw.Stop ();
Gdk.Threads.Leave();
- guiDispatcher ();
- }
-
- static void QueueMessage (GenericMessageContainer msg)
- {
- lock (guiQueue) {
- guiQueue.Enqueue (msg);
- if (iIdle == 0)
- iIdle = GLib.Timeout.Add (0, handler);
- }
- }
-
- public static bool IsGuiThread
- {
- get { return guiThread == Thread.CurrentThread; }
- }
-
- public static void AssertGuiThread ()
- {
- if (guiThread != Thread.CurrentThread)
- throw new InvalidOperationException ("This method can only be called in the GUI thread");
- }
-
- public static Delegate GuiDispatch (Delegate del)
- {
- return guiContext.CreateSynchronizedDelegate (del);
- }
-
- public static T GuiDispatch<T> (T theDelegate)
- {
- if (guiContext == null)
- return theDelegate;
- Delegate del = (Delegate)(object)theDelegate;
- return (T)(object)guiContext.CreateSynchronizedDelegate (del);
- }
-
- /// <summary>
- /// Runs the provided delegate in the background, but waits until finished, pumping the
- /// message queue if necessary.
- /// </summary>
- public static void BackgroundDispatchAndWait (MessageHandler cb)
- {
- object eventObject = new object ();
- lock (eventObject) {
- BackgroundDispatch (delegate {
- try {
- cb ();
- } finally {
- lock (eventObject) {
- Monitor.Pulse (eventObject);
- }
- }
- });
- if (IsGuiThread) {
- while (true) {
- if (Monitor.Wait (eventObject, 50))
- return;
- RunPendingEvents ();
- }
- }
- else {
- Monitor.Wait (eventObject);
- }
- }
- }
-
- public static void BackgroundDispatch (MessageHandler cb)
- {
- QueueBackground (new GenericMessageContainer (cb, false));
- }
-
- public static void BackgroundDispatch (StatefulMessageHandler cb, object state)
- {
- QueueBackground (new StatefulMessageContainer (cb, state, false));
- }
-
- static void QueueBackground (GenericMessageContainer c)
- {
- lock (backgroundQueue) {
- backgroundQueue.Enqueue (c);
- if (backgroundQueue.Count == 1)
- backgroundThreadWait.Set ();
- }
- }
-
- public static void ThreadDispatch (MessageHandler cb)
- {
- GenericMessageContainer smc = new GenericMessageContainer (cb, false);
- Thread t = new Thread (new ThreadStart (smc.Run));
- t.Name = "Message dispatcher";
- t.IsBackground = true;
- t.Start ();
- }
-
- public static void ThreadDispatch (StatefulMessageHandler cb, object state)
- {
- StatefulMessageContainer smc = new StatefulMessageContainer (cb, state, false);
- Thread t = new Thread (new ThreadStart (smc.Run));
- t.Name = "Message dispatcher";
- t.IsBackground = true;
- t.Start ();
- }
-
- static bool guiDispatcher ()
- {
- GenericMessageContainer msg;
- int iterCount;
-
- lock (guiQueue) {
- iterCount = guiQueue.Count;
- if (iterCount == 0) {
- iIdle = 0;
- return false;
- }
- }
-
- for (int n=0; n<iterCount; n++) {
- lock (guiQueue) {
- if (guiQueue.Count == 0) {
- iIdle = 0;
- return false;
- }
- msg = guiQueue.Dequeue ();
- }
-
- msg.Run ();
-
- if (msg.IsSynchronous)
- lock (msg) Monitor.PulseAll (msg);
- else if (msg.Exception != null)
- HandlerError (msg);
- }
-
- lock (guiQueue) {
- if (guiQueue.Count == 0) {
- iIdle = 0;
- return false;
- } else
- return true;
- }
- }
-
- static void backgroundDispatcher ()
- {
- while (true) {
- GenericMessageContainer msg = null;
- bool wait = false;
- lock (backgroundQueue) {
- if (backgroundQueue.Count == 0) {
- backgroundThreadWait.Reset ();
- wait = true;
- } else
- msg = backgroundQueue.Dequeue ();
- }
-
- if (wait) {
- backgroundThreadWait.WaitOne ();
- continue;
- }
-
- if (msg != null) {
- msg.Run ();
- if (msg.Exception != null)
- HandlerError (msg);
- }
- }
}
- static void HandlerError (GenericMessageContainer msg)
- {
- if (msg.CallerStack != null) {
- LoggingService.LogError ("{0} {1}\nCaller stack:{2}", errormsg, msg.Exception.ToString (), msg.CallerStack);
- }
- else
- LoggingService.LogError ("{0} {1}\nCaller stack not available. Define the environment variable MONODEVELOP_DISPATCH_DEBUG to enable caller stack capture.", errormsg, msg.Exception.ToString ());
- }
-
#region Animations
/// <summary>
@@ -412,74 +206,4 @@ namespace MonoDevelop.Ide
#endregion
}
-
- public delegate void MessageHandler ();
- public delegate void StatefulMessageHandler (object state);
-
- class GenericMessageContainer
- {
- MessageHandler callback;
- protected Exception ex;
- protected bool isSynchronous;
- protected string callerStack;
-
- protected GenericMessageContainer () { }
-
- public GenericMessageContainer (MessageHandler cb, bool isSynchronous)
- {
- callback = cb;
- this.isSynchronous = isSynchronous;
- if (DispatchService.DispatchDebug) callerStack = Environment.StackTrace;
- }
-
- public virtual void Run ( )
- {
- try {
- callback ();
- }
- catch (Exception e) {
- ex = e;
- }
- }
-
- public Exception Exception
- {
- get { return ex; }
- }
-
- public bool IsSynchronous
- {
- get { return isSynchronous; }
- }
-
- public string CallerStack
- {
- get { return callerStack; }
- }
- }
-
- class StatefulMessageContainer : GenericMessageContainer
- {
- object data;
- StatefulMessageHandler callback;
-
- public StatefulMessageContainer (StatefulMessageHandler cb, object state, bool isSynchronous)
- {
- data = state;
- callback = cb;
- this.isSynchronous = isSynchronous;
- if (DispatchService.DispatchDebug) callerStack = Environment.StackTrace;
- }
-
- public override void Run ( )
- {
- try {
- callback (data);
- }
- catch (Exception e) {
- ex = e;
- }
- }
- }
-
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/FeedbackService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/FeedbackService.cs
index 32e4e54210..3f194ee00e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/FeedbackService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/FeedbackService.cs
@@ -184,7 +184,7 @@ namespace MonoDevelop.Ide
sw.Write (body);
}
}
- ).ContinueWith (HandleResponse);
+ ).ContinueWith (HandleResponse, TaskScheduler.FromCurrentSynchronizationContext ());
}
static void HandleResponse (Task<HttpWebResponse> t)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/HelpOperations.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/HelpOperations.cs
index 7fc48d4fb3..e24a612d50 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/HelpOperations.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/HelpOperations.cs
@@ -35,7 +35,6 @@ using MonoDevelop.Core.Execution;
using System.IO;
using MonoDevelop.Core;
using MonoDevelop.Projects;
-using ICSharpCode.NRefactory.Semantics;
namespace MonoDevelop.Ide
{
@@ -210,9 +209,8 @@ namespace MonoDevelop.Ide
return;
MessageService.ShowError (
- String.Format (
- "MonoDoc exited with exit code {0}.",
- pw.ExitCode, errWriter.ToString ()));
+ $"MonoDoc exited with exit code {pw.ExitCode}{Environment.NewLine}{errWriter.ToString()}."
+ );
pw = null;
}, true);
}
@@ -228,14 +226,14 @@ namespace MonoDevelop.Ide
}
}
- public bool CanShowHelp (ResolveResult result)
- {
- try {
- return CanShowHelp (HelpService.GetMonoDocHelpUrl (result));
- } catch (Exception e) {
- LoggingService.LogError ("Error while trying to get monodoc help.", e);
- return false;
- }
- }
+// public bool CanShowHelp (ResolveResult result)
+// {
+// try {
+// return CanShowHelp (HelpService.GetMonoDocHelpUrl (result));
+// } catch (Exception e) {
+// LoggingService.LogError ("Error while trying to get monodoc help.", e);
+// return false;
+// }
+// }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs
index 3a0224a252..b7138efba9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Ide.cs
@@ -165,8 +165,11 @@ namespace MonoDevelop.Ide
}
}
- public static void Initialize (IProgressMonitor monitor)
+ public static void Initialize (ProgressMonitor monitor)
{
+ // Already done in IdeSetup, but called again since unit tests don't use IdeSetup.
+ DispatchService.Initialize ();
+
Counters.Initialization.Trace ("Creating Workbench");
workbench = new Workbench ();
Counters.Initialization.Trace ("Creating Root Workspace");
@@ -201,8 +204,6 @@ namespace MonoDevelop.Ide
workbench.Initialize (monitor);
monitor.Step (1);
- InternalLog.EnableErrorNotification ();
-
MonoDevelop.Ide.WelcomePage.WelcomePageService.Initialize ();
MonoDevelop.Ide.WelcomePage.WelcomePageService.ShowWelcomePage ();
@@ -220,11 +221,8 @@ namespace MonoDevelop.Ide
commandService.EnableIdleUpdate = true;
- // Perser service initialization
- TypeSystemService.TrackFileChanges = true;
- TypeSystemService.ParseProgressMonitorFactory = new ParseProgressMonitorFactory ();
-
- Customizer.OnIdeInitialized ();
+ if (Customizer != null)
+ Customizer.OnIdeInitialized ();
// Startup commands
Counters.Initialization.Trace ("Running Startup Commands");
@@ -290,7 +288,7 @@ namespace MonoDevelop.Ide
MonoDevelop.Projects.HelpService.AsyncInitialize ();
UpdateInstrumentationIcon ();
- IdeApp.Preferences.EnableInstrumentationChanged += delegate {
+ IdeApp.Preferences.EnableInstrumentation.Changed += delegate {
UpdateInstrumentationIcon ();
};
AutoTestService.Start (commandService, Preferences.EnableAutomatedTesting);
@@ -343,7 +341,7 @@ namespace MonoDevelop.Ide
foreach (var file in filteredFiles) {
try {
- Workbench.OpenDocument (file.FileName, file.Line, file.Column, file.Options);
+ Workbench.OpenDocument (file.FileName, null, file.Line, file.Column, file.Options);
} catch (Exception ex) {
MessageService.ShowError (GettextCatalog.GetString ("Could not open file: {0}", file.FileName), ex);
}
@@ -409,7 +407,6 @@ namespace MonoDevelop.Ide
static void OnInitialRun ()
{
- Workbench.ResetToolbars ();
SetInitialLayout ();
}
@@ -417,7 +414,7 @@ namespace MonoDevelop.Ide
{
if (previousRevision <= 3) {
// Reset the current runtime when upgrading from <2.2, to ensure the default runtime is not stuck to an old mono install
- IdeApp.Preferences.DefaultTargetRuntime = Runtime.SystemAssemblyService.CurrentRuntime;
+ IdeApp.Preferences.DefaultTargetRuntime.Value = Runtime.SystemAssemblyService.CurrentRuntime;
}
if (previousRevision < 5)
SetInitialLayout ();
@@ -454,7 +451,7 @@ namespace MonoDevelop.Ide
{
if (IdeApp.Preferences.EnableInstrumentation) {
if (instrumentationStatusIcon == null) {
- instrumentationStatusIcon = IdeApp.Workbench.StatusBar.ShowStatusIcon (ImageService.GetIcon (MonoDevelop.Ide.Gui.Stock.Information));
+ instrumentationStatusIcon = IdeApp.Workbench.StatusBar.ShowStatusIcon (ImageService.GetIcon (MonoDevelop.Ide.Gui.Stock.StatusInstrumentation));
instrumentationStatusIcon.ToolTip = "Instrumentation service enabled";
instrumentationStatusIcon.Clicked += delegate {
InstrumentationService.StartMonitor ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdePreferences.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdePreferences.cs
index 00e54c306a..eabc788711 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdePreferences.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdePreferences.cs
@@ -28,8 +28,11 @@
using System;
using MonoDevelop.Core;
using MonoDevelop.Core.Assemblies;
-using MonoDevelop.Projects.Formats.MSBuild;
+using MonoDevelop.Projects.MSBuild;
using MonoDevelop.Ide.Fonts;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Ide.Editor.Highlighting;
+using System.Linq;
namespace MonoDevelop.Ide
{
@@ -65,246 +68,161 @@ namespace MonoDevelop.Ide
{
internal IdePreferences ()
{
- FontService.RegisterFontChangedCallback ("OutputPad", delegate {
- if (CustomOutputPadFontChanged != null)
- CustomOutputPadFontChanged (null, EventArgs.Empty);
- });
- FontService.RegisterFontChangedCallback ("Pad", delegate {
- if (CustomPadFontChanged != null)
- CustomPadFontChanged (null, EventArgs.Empty);
- });
- }
-
- public bool LoadPrevSolutionOnStartup {
- get { return PropertyService.Get ("SharpDevelop.LoadPrevProjectOnStartup", false); }
- set { PropertyService.Set ("SharpDevelop.LoadPrevProjectOnStartup", value); }
- }
-
- public event EventHandler<PropertyChangedEventArgs> LoadPrevSolutionOnStartupChanged {
- add { PropertyService.AddPropertyHandler ("SharpDevelop.LoadPrevProjectOnStartup", value); }
- remove { PropertyService.RemovePropertyHandler ("SharpDevelop.LoadPrevProjectOnStartup", value); }
- }
-
- public bool CreateFileBackupCopies {
- get { return PropertyService.Get ("SharpDevelop.CreateBackupCopy", false); }
- set { PropertyService.Set ("SharpDevelop.CreateBackupCopy", value); }
- }
-
- public event EventHandler<PropertyChangedEventArgs> CreateFileBackupCopiesChanged {
- add { PropertyService.AddPropertyHandler ("SharpDevelop.CreateBackupCopy", value); }
- remove { PropertyService.RemovePropertyHandler ("SharpDevelop.CreateBackupCopy", value); }
- }
-
- public bool LoadDocumentUserProperties {
- get { return PropertyService.Get ("SharpDevelop.LoadDocumentProperties", true); }
- set { PropertyService.Set ("SharpDevelop.LoadDocumentProperties", value); }
- }
-
- public event EventHandler<PropertyChangedEventArgs> LoadDocumentUserPropertiesChanged {
- add { PropertyService.AddPropertyHandler ("SharpDevelop.LoadDocumentProperties", value); }
- remove { PropertyService.RemovePropertyHandler ("SharpDevelop.LoadDocumentProperties", value); }
- }
-
- public bool BuildBeforeExecuting {
- get { return PropertyService.Get ("MonoDevelop.Ide.BuildBeforeExecuting", true); }
- set { PropertyService.Set ("MonoDevelop.Ide.BuildBeforeExecuting", value); }
- }
-
- public event EventHandler<PropertyChangedEventArgs> BuildBeforeExecutingChanged {
- add { PropertyService.AddPropertyHandler ("MonoDevelop.Ide.BuildBeforeExecuting", value); }
- remove { PropertyService.RemovePropertyHandler ("MonoDevelop.Ide.BuildBeforeExecuting", value); }
- }
-
- /*public BuildResultStates ShowOutputPadDuringBuild {
- get { return PropertyService.Get ("MonoDevelop.Ide.ShowOutputPadDuringBuild", BuildResultStates.Never); }
- set { PropertyService.Set ("MonoDevelop.Ide.ShowOutputPadDuringBuild", value); }
}
- public event EventHandler<PropertyChangedEventArgs> ShowOutputPadShowOutputPadDuringBuildChanged {
- add { PropertyService.AddPropertyHandler ("MonoDevelop.Ide.ShowOutputPadDuringBuild", value); }
- remove { PropertyService.RemovePropertyHandler ("MonoDevelop.Ide.ShowOutputPadDuringBuild", value); }
- }*/
-
- public BuildResultStates ShowOutputPadAfterBuild {
- get { return PropertyService.Get ("MonoDevelop.Ide.ShowOutputPadAfterBuild", BuildResultStates.Never); }
- set { PropertyService.Set ("MonoDevelop.Ide.ShowOutputPadAfterBuild", value); }
- }
+ public readonly ConfigurationProperty<bool> EnableInstrumentation = Runtime.Preferences.EnableInstrumentation;
+ public readonly ConfigurationProperty<bool> EnableAutomatedTesting = Runtime.Preferences.EnableAutomatedTesting;
- public event EventHandler<PropertyChangedEventArgs> ShowOutputPadAfterBuildChanged {
- add { PropertyService.AddPropertyHandler ("MonoDevelop.Ide.ShowOutputPadAfterBuild", value); }
- remove { PropertyService.RemovePropertyHandler ("MonoDevelop.Ide.ShowOutputPadAfterBuild", value); }
- }
- /*
- public BuildResultStates ShowErrorPadDuringBuild {
- get { return PropertyService.Get ("MonoDevelop.Ide.ShowErrorPadDuringBuild", BuildResultStates.Never); }
- set { PropertyService.Set ("MonoDevelop.Ide.ShowErrorPadDuringBuild", value); }
- }
+ public readonly ConfigurationProperty<string> ProjectsDefaultPath = ConfigurationProperty.Create ("MonoDevelop.Core.Gui.Dialogs.NewProjectDialog.DefaultPath", System.IO.Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), "Projects"));
- public event EventHandler<PropertyChangedEventArgs> ShowErrorPadDuringBuildChanged {
- add { PropertyService.AddPropertyHandler ("MonoDevelop.Ide.ShowErrorPadDuringBuild", value); }
- remove { PropertyService.RemovePropertyHandler ("MonoDevelop.Ide.ShowErrorPadDuringBuild", value); }
- }*/
-
- public BuildResultStates ShowErrorPadAfterBuild {
- get { return PropertyService.Get ("MonoDevelop.Ide.NewShowErrorPadAfterBuild", BuildResultStates.Never); }
- set { PropertyService.Set ("MonoDevelop.Ide.NewShowErrorPadAfterBuild", value); }
- }
+ public readonly ConfigurationProperty<bool> BuildBeforeExecuting = ConfigurationProperty.Create ("MonoDevelop.Ide.BuildBeforeExecuting", true);
+ public readonly ConfigurationProperty<bool> BuildBeforeRunningTests = ConfigurationProperty.Create ("BuildBeforeRunningTests", true);
+ public readonly ConfigurationProperty<BeforeCompileAction> BeforeBuildSaveAction = ConfigurationProperty.Create ("MonoDevelop.Ide.BeforeCompileAction", BeforeCompileAction.SaveAllFiles);
+ public readonly ConfigurationProperty<bool> RunWithWarnings = ConfigurationProperty.Create ("MonoDevelop.Ide.RunWithWarnings", true);
+ public readonly ConfigurationProperty<MSBuildVerbosity> MSBuildVerbosity = Runtime.Preferences.MSBuildVerbosity;
+ public readonly ConfigurationProperty<BuildResultStates> ShowOutputPadAfterBuild = ConfigurationProperty.Create ("MonoDevelop.Ide.ShowOutputPadAfterBuild", BuildResultStates.Never);
+ public readonly ConfigurationProperty<BuildResultStates> ShowErrorPadAfterBuild = ConfigurationProperty.Create ("MonoDevelop.Ide.NewShowErrorPadAfterBuild", BuildResultStates.Never);
+ public readonly ConfigurationProperty<JumpToFirst> JumpToFirstErrorOrWarning = ConfigurationProperty.Create ("MonoDevelop.Ide.NewJumpToFirstErrorOrWarning", JumpToFirst.Error);
+ public readonly ConfigurationProperty<bool> DefaultHideMessageBubbles = ConfigurationProperty.Create ("MonoDevelop.Ide.DefaultHideMessageBubbles", false);
+ public readonly ConfigurationProperty<ShowMessageBubbles> ShowMessageBubbles = ConfigurationProperty.Create ("MonoDevelop.Ide.NewShowMessageBubbles", MonoDevelop.Ide.ShowMessageBubbles.ForErrorsAndWarnings);
- public event EventHandler<PropertyChangedEventArgs> ShowErrorPadAfterBuildChanged {
- add { PropertyService.AddPropertyHandler ("MonoDevelop.Ide.NewShowErrorPadAfterBuild", value); }
- remove { PropertyService.RemovePropertyHandler ("MonoDevelop.Ide.NewShowErrorPadAfterBuild", value); }
- }
-
- public JumpToFirst JumpToFirstErrorOrWarning {
- get { return PropertyService.Get ("MonoDevelop.Ide.NewJumpToFirstErrorOrWarning", JumpToFirst.Error); }
- set { PropertyService.Set ("MonoDevelop.Ide.NewJumpToFirstErrorOrWarning", value); }
- }
-
- public event EventHandler<PropertyChangedEventArgs> AutoHideMessageBubblesChanged {
- add { PropertyService.AddPropertyHandler ("MonoDevelop.Ide.NewShowMessageBubbles", value); }
- remove { PropertyService.RemovePropertyHandler ("MonoDevelop.Ide.NewShowMessageBubbles", value); }
- }
-
- public bool DefaultHideMessageBubbles {
- get { return PropertyService.Get ("MonoDevelop.Ide.DefaultHideMessageBubbles", false); }
- set { PropertyService.Set ("MonoDevelop.Ide.DefaultHideMessageBubbles", value); }
- }
-
- public event EventHandler<PropertyChangedEventArgs> DefaultHideMessageBubblesChanged {
- add { PropertyService.AddPropertyHandler ("MonoDevelop.Ide.DefaultHideMessageBubbles", value); }
- remove { PropertyService.RemovePropertyHandler ("MonoDevelop.Ide.DefaultHideMessageBubbles", value); }
- }
-
- public ShowMessageBubbles ShowMessageBubbles {
- get { return PropertyService.Get ("MonoDevelop.Ide.NewShowMessageBubbles", ShowMessageBubbles.ForErrorsAndWarnings); }
- set { PropertyService.Set ("MonoDevelop.Ide.NewShowMessageBubbles", value); }
- }
-
- public event EventHandler<PropertyChangedEventArgs> ShowMessageBubblesChanged {
- add { PropertyService.AddPropertyHandler ("MonoDevelop.Ide.NewShowMessageBubbles", value); }
- remove { PropertyService.RemovePropertyHandler ("MonoDevelop.Ide.NewShowMessageBubbles", value); }
- }
-
- public BeforeCompileAction BeforeBuildSaveAction {
- get { return PropertyService.Get ("MonoDevelop.Ide.BeforeCompileAction", BeforeCompileAction.SaveAllFiles); }
- set { PropertyService.Set ("MonoDevelop.Ide.BeforeCompileAction", value); }
- }
-
- public event EventHandler<PropertyChangedEventArgs> BeforeBuildSaveActionChanged {
- add { PropertyService.AddPropertyHandler ("MonoDevelop.Ide.BeforeCompileAction", value); }
- remove { PropertyService.RemovePropertyHandler ("MonoDevelop.Ide.BeforeCompileAction", value); }
- }
-
- public bool RunWithWarnings {
- get { return PropertyService.Get ("MonoDevelop.Ide.RunWithWarnings", true); }
- set { PropertyService.Set ("MonoDevelop.Ide.RunWithWarnings", value); }
- }
+ public readonly ConfigurationProperty<TargetRuntime> DefaultTargetRuntime = new DefaultTargetRuntimeProperty ();
+ class DefaultTargetRuntimeProperty: ConfigurationProperty<TargetRuntime>
+ {
+ ConfigurationProperty<string> defaultTargetRuntimeText = ConfigurationProperty.Create ("MonoDevelop.Ide.DefaultTargetRuntime", "__current");
- public event EventHandler<PropertyChangedEventArgs> RunWithWarningsChanged {
- add { PropertyService.AddPropertyHandler ("MonoDevelop.Ide.RunWithWarnings", value); }
- remove { PropertyService.RemovePropertyHandler ("MonoDevelop.Ide.RunWithWarnings", value); }
- }
+ public DefaultTargetRuntimeProperty ()
+ {
+ defaultTargetRuntimeText.Changed += (s,e) => OnChanged ();
+ }
- public TargetRuntime DefaultTargetRuntime {
- get {
- string id = PropertyService.Get ("MonoDevelop.Ide.DefaultTargetRuntime", "__current");
+ protected override TargetRuntime OnGetValue ()
+ {
+ string id = defaultTargetRuntimeText.Value;
if (id == "__current")
return Runtime.SystemAssemblyService.CurrentRuntime;
TargetRuntime tr = Runtime.SystemAssemblyService.GetTargetRuntime (id);
return tr ?? Runtime.SystemAssemblyService.CurrentRuntime;
}
- set { PropertyService.Set ("MonoDevelop.Ide.DefaultTargetRuntime", value.IsRunning ? "__current" : value.Id); }
- }
- public event EventHandler<PropertyChangedEventArgs> DefaultTargetRuntimeChanged {
- add { PropertyService.AddPropertyHandler ("MonoDevelop.Ide.DefaultTargetRuntime", value); }
- remove { PropertyService.RemovePropertyHandler ("MonoDevelop.Ide.DefaultTargetRuntime", value); }
- }
-
- public MSBuildVerbosity MSBuildVerbosity {
- get { return PropertyService.Get ("MonoDevelop.Ide.MSBuildVerbosity", MSBuildVerbosity.Normal); }
- set { PropertyService.Set ("MonoDevelop.Ide.MSBuildVerbosity", value); }
+ protected override bool OnSetValue (TargetRuntime value)
+ {
+ defaultTargetRuntimeText.Value = value.IsRunning ? "__current" : value.Id;
+ return true;
+ }
}
- public bool EnableInstrumentation {
- get { return PropertyService.Get ("MonoDevelop.EnableInstrumentation", false); }
- set { PropertyService.Set ("MonoDevelop.EnableInstrumentation", value); }
- }
+ public readonly ConfigurationProperty<string> UserInterfaceLanguage = Runtime.Preferences.UserInterfaceLanguage;
+ public readonly ConfigurationProperty<string> UserInterfaceTheme = ConfigurationProperty.Create ("MonoDevelop.Ide.UserInterfaceTheme", Platform.IsLinux ? "" : "Light");
+ public readonly ConfigurationProperty<WorkbenchCompactness> WorkbenchCompactness = ConfigurationProperty.Create ("MonoDevelop.Ide.WorkbenchCompactness", MonoDevelop.Ide.WorkbenchCompactness.Normal);
+ public readonly ConfigurationProperty<bool> LoadPrevSolutionOnStartup = ConfigurationProperty.Create ("SharpDevelop.LoadPrevProjectOnStartup", false);
+ public readonly ConfigurationProperty<bool> CreateFileBackupCopies = ConfigurationProperty.Create ("SharpDevelop.CreateBackupCopy", false);
+ public readonly ConfigurationProperty<bool> LoadDocumentUserProperties = ConfigurationProperty.Create ("SharpDevelop.LoadDocumentProperties", true);
+ public readonly ConfigurationProperty<bool> EnableDocumentSwitchDialog = ConfigurationProperty.Create ("MonoDevelop.Core.Gui.EnableDocumentSwitchDialog", true);
+ public readonly ConfigurationProperty<bool> ShowTipsAtStartup = ConfigurationProperty.Create ("MonoDevelop.Core.Gui.Dialog.TipOfTheDayView.ShowTipsAtStartup", false);
- public event EventHandler<PropertyChangedEventArgs> EnableInstrumentationChanged {
- add { PropertyService.AddPropertyHandler ("MonoDevelop.EnableInstrumentation", value); }
- remove { PropertyService.RemovePropertyHandler ("MonoDevelop.EnableInstrumentation", value); }
- }
-
- public bool EnableAutomatedTesting {
- get { return PropertyService.Get ("MonoDevelop.EnableAutomatedTesting", false); }
- set { PropertyService.Set ("MonoDevelop.EnableAutomatedTesting", value); }
- }
+ internal readonly ConfigurationProperty<Properties> WorkbenchMemento = ConfigurationProperty.Create ("SharpDevelop.Workbench.WorkbenchMemento", new Properties ());
- public event EventHandler<PropertyChangedEventArgs> EnableAutomatedTestingChanged {
- add { PropertyService.AddPropertyHandler ("MonoDevelop.EnableAutomatedTesting", value); }
- remove { PropertyService.RemovePropertyHandler ("MonoDevelop.EnableAutomatedTesting", value); }
- }
-
/// <summary>
/// Font to use for treeview pads. Returns null if no custom font is set.
/// </summary>
- public Pango.FontDescription CustomPadFont {
- get { return FontService.GetFontDescription ("Pad", false); }
- }
-
- public event EventHandler<EventArgs> CustomPadFontChanged;
+ public readonly ConfigurationProperty<Pango.FontDescription> CustomPadFont = FontService.GetFontProperty ("Pad");
/// <summary>
/// Font to use for output pads. Returns null if no custom font is set.
/// </summary>
- public Pango.FontDescription CustomOutputPadFont {
- get { return FontService.GetFontDescription ("OutputPad", false); }
- }
+ public readonly ConfigurationProperty<Pango.FontDescription> CustomOutputPadFont = FontService.GetFontProperty ("OutputPad");
- public event EventHandler CustomOutputPadFontChanged;
+ public readonly ConfigurationProperty<bool> EnableCompletionCategoryMode = ConfigurationProperty.Create ("EnableCompletionCategoryMode", false);
+ public readonly ConfigurationProperty<bool> ForceSuggestionMode = ConfigurationProperty.Create ("ForceCompletionSuggestionMode", false);
+ public readonly ConfigurationProperty<bool> EnableAutoCodeCompletion = ConfigurationProperty.Create ("EnableAutoCodeCompletion", true);
+ public readonly ConfigurationProperty<bool> AddImportedItemsToCompletionList = ConfigurationProperty.Create ("AddImportedItemsToCompletionList", false);
+ public readonly ConfigurationProperty<bool> IncludeKeywordsInCompletionList = ConfigurationProperty.Create ("IncludeKeywordsInCompletionList", true);
+ public readonly ConfigurationProperty<bool> IncludeCodeSnippetsInCompletionList = ConfigurationProperty.Create ("IncludeCodeSnippetsInCompletionList", true);
+ public readonly ConfigurationProperty<bool> AddParenthesesAfterCompletion = ConfigurationProperty.Create ("AddParenthesesAfterCompletion", false);
+ public readonly ConfigurationProperty<bool> AddOpeningOnly = ConfigurationProperty.Create ("AddOpeningOnly", false);
+ public readonly ConfigurationProperty<bool> FilterCompletionListByEditorBrowsable = ConfigurationProperty.Create ("FilterCompletionListByEditorBrowsable", true);
+ public readonly ConfigurationProperty<bool> IncludeEditorBrowsableAdvancedMembers = ConfigurationProperty.Create ("IncludeEditorBrowsableAdvancedMembers", true);
- public string UserInterfaceLanguage {
- get { return PropertyService.Get ("MonoDevelop.Ide.UserInterfaceLanguage", ""); }
- set { PropertyService.Set ("MonoDevelop.Ide.UserInterfaceLanguage", value); }
- }
-
- public event EventHandler<PropertyChangedEventArgs> UserInterfaceLanguageChanged {
- add { PropertyService.AddPropertyHandler ("MonoDevelop.Ide.UserInterfaceLanguage", value); }
- remove { PropertyService.RemovePropertyHandler ("MonoDevelop.Ide.UserInterfaceLanguage", value); }
- }
-
- public string UserInterfaceTheme {
- get { return PropertyService.Get ("MonoDevelop.Ide.UserInterfaceTheme", ""); }
- set { PropertyService.Set ("MonoDevelop.Ide.UserInterfaceTheme", value); }
- }
-
- public event EventHandler<PropertyChangedEventArgs> UserInterfaceThemeChanged {
- add { PropertyService.AddPropertyHandler ("MonoDevelop.Ide.UserInterfaceTheme", value); }
- remove { PropertyService.RemovePropertyHandler ("MonoDevelop.Ide.UserInterfaceTheme", value); }
- }
-
- public WorkbenchCompactness WorkbenchCompactness {
- get { return PropertyService.Get ("MonoDevelop.Ide.WorkbenchCompactness", WorkbenchCompactness.Normal); }
- set { PropertyService.Set ("MonoDevelop.Ide.WorkbenchCompactness", value); }
+ public Skin UserInterfaceSkin {
+ get { return MonoDevelop.Components.IdeTheme.UserInterfaceSkin; }
}
-
- public event EventHandler<PropertyChangedEventArgs> WorkbenchCompactnessChanged {
- add { PropertyService.AddPropertyHandler ("MonoDevelop.Ide.WorkbenchCompactness", value); }
- remove { PropertyService.RemovePropertyHandler ("MonoDevelop.Ide.WorkbenchCompactness", value); }
- }
-
- public string ColorScheme {
- get { return PropertyService.Get ("ColorScheme", "Default"); }
- set { PropertyService.Set ("ColorScheme", value); }
- }
-
- public event EventHandler<PropertyChangedEventArgs> ColorSchemeChanged {
- add { PropertyService.AddPropertyHandler ("ColorScheme", value); }
- remove { PropertyService.RemovePropertyHandler ("ColorScheme", value); }
+
+ internal static readonly string DefaultLightColorScheme = "Light";
+ internal static readonly string DefaultDarkColorScheme = "Dark";
+
+ public readonly ConfigurationProperty<bool> EnableSourceAnalysis = ConfigurationProperty.Create ("MonoDevelop.AnalysisCore.AnalysisEnabled_V2", true);
+ public readonly ConfigurationProperty<bool> EnableUnitTestEditorIntegration = ConfigurationProperty.Create ("Testing.EnableUnitTestEditorIntegration", false);
+
+ public readonly SchemeConfigurationProperty ColorScheme = new SchemeConfigurationProperty ("ColorScheme", DefaultLightColorScheme, DefaultDarkColorScheme);
+
+ public readonly SkinConfigurationProperty<string> UserTasksHighPrioColor = new SkinConfigurationProperty<string> ("Monodevelop.UserTasksHighPrioColor", "", "rgb:ffff/ffff/ffff");
+ public readonly SkinConfigurationProperty<string> UserTasksNormalPrioColor = new SkinConfigurationProperty<string> ("Monodevelop.UserTasksNormalPrioColor", "", "rgb:ffff/ffff/ffff");
+ public readonly SkinConfigurationProperty<string> UserTasksLowPrioColor = new SkinConfigurationProperty<string> ("Monodevelop.UserTasksLowPrioColor", "", "rgb:ffff/ffff/ffff");
+
+ public class SkinConfigurationProperty<T>: ConfigurationProperty<T>
+ {
+ readonly ConfigurationProperty<T> lightConfiguration;
+ readonly ConfigurationProperty<T> darkConfiguration;
+
+ public SkinConfigurationProperty (string propertyName, T defaultLightValue, T defaultDarkValue, string oldName = null)
+ {
+ lightConfiguration = ConfigurationProperty.Create<T> (propertyName, defaultLightValue, oldName);
+ darkConfiguration = ConfigurationProperty.Create<T> (propertyName + "-Dark", defaultDarkValue, oldName + "-Dark");
+
+ lightConfiguration.Changed += (s,e) => OnChanged ();
+ darkConfiguration.Changed += (s,e) => OnChanged ();
+ MonoDevelop.Ide.Gui.Styles.Changed += (sender, e) => OnChanged ();
+ }
+
+ public T ValueForSkin (Skin skin)
+ {
+ switch (skin) {
+ case Skin.Light:
+ return lightConfiguration.Value;
+ case Skin.Dark:
+ return darkConfiguration.Value;
+ default:
+ throw new InvalidOperationException ();
+ }
+ }
+
+ protected override T OnGetValue ()
+ {
+ if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light)
+ return lightConfiguration;
+ else
+ return darkConfiguration;
+ }
+
+ protected override bool OnSetValue (T value)
+ {
+ if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light)
+ return lightConfiguration.Set (value);
+ else
+ return darkConfiguration.Set (value);
+ }
}
- public readonly PropertyWrapper<bool> BuildBeforeRunningTests = new PropertyWrapper<bool> ("BuildBeforeRunningTests", true);
+ public class SchemeConfigurationProperty: SkinConfigurationProperty<string>
+ {
+ public SchemeConfigurationProperty (string propertyName, string defaultLightValue, string defaultDarkValue, string oldName = null)
+ : base (propertyName, defaultLightValue, defaultDarkValue, oldName)
+ {
+ }
+
+ protected override string OnGetValue ()
+ {
+ var style = base.OnGetValue ();
+ if (SyntaxModeService.Styles.Contains (style))
+ return style;
+
+ var defaultStyle = SyntaxModeService.GetDefaultColorStyleName ();
+ LoggingService.LogWarning ("Highlighting Theme \"{0}\" not found, using default \"{1}\" instead", style, defaultStyle);
+ Value = defaultStyle;
+ return SyntaxModeService.GetDefaultColorStyleName ();
+ }
+ }
}
public enum BeforeCompileAction {
@@ -312,5 +230,11 @@ namespace MonoDevelop.Ide
SaveAllFiles,
PromptForSave,
}
+
+ public enum Skin
+ {
+ Light,
+ Dark
+ }
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs
index 9231b18f8a..d80e14e2ae 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs
@@ -51,6 +51,9 @@ using System.Diagnostics;
using System.Collections.Generic;
using MonoDevelop.Ide.Extensions;
using MonoDevelop.Components.Extensions;
+using MonoDevelop.Ide.Desktop;
+using System.Threading.Tasks;
+using MonoDevelop.Components;
namespace MonoDevelop.Ide
{
@@ -59,15 +62,14 @@ namespace MonoDevelop.Ide
Socket listen_socket = null;
ArrayList errorsList = new ArrayList ();
bool initialized;
- internal static string DefaultTheme;
static readonly int ipcBasePort = 40000;
- int IApplication.Run (string[] args)
+ Task<int> IApplication.Run (string[] args)
{
var options = MonoDevelopOptions.Parse (args);
if (options.Error != null || options.ShowHelp)
- return options.Error != null? -1 : 0;
- return Run (options);
+ return Task.FromResult (options.Error != null? -1 : 0);
+ return Task.FromResult (Run (options));
}
int Run (MonoDevelopOptions options)
@@ -80,9 +82,6 @@ namespace MonoDevelop.Ide
LoggingService.LogInfo ("Operating System: {0}", SystemInformation.GetOperatingSystemDescription ());
- IdeApp.Customizer = options.IdeCustomizer ?? new IdeCustomizer ();
- IdeApp.Customizer.Initialize ();
-
Counters.Initialization.BeginTiming ();
if (options.PerfLog) {
@@ -95,17 +94,18 @@ namespace MonoDevelop.Ide
if (Platform.IsWindows && !CheckWindowsGtk ())
return 1;
SetupExceptionManager ();
-
+
+ IdeApp.Customizer = options.IdeCustomizer ?? new IdeCustomizer ();
+ IdeApp.Customizer.Initialize ();
+
try {
GLibLogging.Enabled = true;
} catch (Exception ex) {
LoggingService.LogError ("Error initialising GLib logging.", ex);
}
- SetupTheme ();
-
var args = options.RemainingArgs.ToArray ();
- Gtk.Application.Init (BrandingService.ApplicationName, ref args);
+ IdeTheme.InitializeGtk (BrandingService.ApplicationName, ref args);
LoggingService.LogInfo ("Using GTK+ {0}", IdeVersionInfo.GetGtkVersion ());
@@ -115,23 +115,23 @@ namespace MonoDevelop.Ide
Xwt.Application.InitializeAsGuest (Xwt.ToolkitType.Gtk);
Xwt.Toolkit.CurrentEngine.RegisterBackend<IExtendedTitleBarWindowBackend,GtkExtendedTitleBarWindowBackend> ();
Xwt.Toolkit.CurrentEngine.RegisterBackend<IExtendedTitleBarDialogBackend,GtkExtendedTitleBarDialogBackend> ();
+ IdeTheme.SetupXwtTheme ();
//default to Windows IME on Windows
- if (Platform.IsWindows && Mono.TextEditor.GtkWorkarounds.GtkMinorVersion >= 16) {
+ if (Platform.IsWindows && GtkWorkarounds.GtkMinorVersion >= 16) {
var settings = Gtk.Settings.Default;
- var val = Mono.TextEditor.GtkWorkarounds.GetProperty (settings, "gtk-im-module");
+ var val = GtkWorkarounds.GetProperty (settings, "gtk-im-module");
if (string.IsNullOrEmpty (val.Val as string))
- Mono.TextEditor.GtkWorkarounds.SetProperty (settings, "gtk-im-module", new GLib.Value ("ime"));
+ GtkWorkarounds.SetProperty (settings, "gtk-im-module", new GLib.Value ("ime"));
}
- InternalLog.Initialize ();
string socket_filename = null;
EndPoint ep = null;
DispatchService.Initialize ();
// Set a synchronization context for the main gtk thread
- SynchronizationContext.SetSynchronizationContext (new GtkSynchronizationContext ());
+ SynchronizationContext.SetSynchronizationContext (DispatchService.SynchronizationContext);
Runtime.MainSynchronizationContext = SynchronizationContext.Current;
AddinManager.AddinLoadError += OnAddinError;
@@ -158,15 +158,9 @@ namespace MonoDevelop.Ide
Counters.Initialization.Trace ("Initializing theme");
- DefaultTheme = Gtk.Settings.Default.ThemeName;
- string theme = IdeApp.Preferences.UserInterfaceTheme;
- if (string.IsNullOrEmpty (theme))
- theme = DefaultTheme;
- ValidateGtkTheme (ref theme);
- if (theme != DefaultTheme)
- Gtk.Settings.Default.ThemeName = theme;
+ IdeTheme.SetupGtkTheme ();
- IProgressMonitor monitor = new MonoDevelop.Core.ProgressMonitoring.ConsoleProgressMonitor ();
+ ProgressMonitor monitor = new MonoDevelop.Core.ProgressMonitoring.ConsoleProgressMonitor ();
monitor.BeginTask (GettextCatalog.GetString ("Starting {0}", BrandingService.ApplicationName), 2);
@@ -203,12 +197,6 @@ namespace MonoDevelop.Ide
}
Counters.Initialization.Trace ("Checking System");
- string version = Assembly.GetEntryAssembly ().GetName ().Version.Major + "." + Assembly.GetEntryAssembly ().GetName ().Version.Minor;
-
- if (Assembly.GetEntryAssembly ().GetName ().Version.Build != 0)
- version += "." + Assembly.GetEntryAssembly ().GetName ().Version.Build;
- if (Assembly.GetEntryAssembly ().GetName ().Version.Revision != 0)
- version += "." + Assembly.GetEntryAssembly ().GetName ().Version.Revision;
CheckFileWatcher ();
@@ -237,20 +225,18 @@ namespace MonoDevelop.Ide
if (!CheckSCPlugin ())
return 1;
- // no alternative for Application.ThreadException?
- // Application.ThreadException += new ThreadExceptionEventHandler(ShowErrorBox);
-
// Load requested files
Counters.Initialization.Trace ("Opening Files");
// load previous combine
+ RecentFile openedProject = null;
if (IdeApp.Preferences.LoadPrevSolutionOnStartup && !startupInfo.HasSolutionFile && !IdeApp.Workspace.WorkspaceItemIsOpening && !IdeApp.Workspace.IsOpen) {
- var proj = DesktopService.RecentFiles.GetProjects ().FirstOrDefault ();
- if (proj != null)
- IdeApp.Workspace.OpenWorkspaceItem (proj.FileName).WaitForCompleted ();
+ openedProject = DesktopService.RecentFiles.GetProjects ().FirstOrDefault ();
+ if (openedProject != null)
+ IdeApp.Workspace.OpenWorkspaceItem (openedProject.FileName).ContinueWith (t => IdeApp.OpenFiles (startupInfo.RequestedFileList), TaskScheduler.FromCurrentSynchronizationContext ());
}
-
- IdeApp.OpenFiles (startupInfo.RequestedFileList);
+ if (openedProject == null)
+ IdeApp.OpenFiles (startupInfo.RequestedFileList);
monitor.Step (1);
@@ -272,7 +258,8 @@ namespace MonoDevelop.Ide
}
errorsList = null;
-
+ AddinManager.AddinLoadError -= OnAddinError;
+
// FIXME: we should probably track the last 'selected' one
// and do this more cleanly
try {
@@ -304,7 +291,6 @@ namespace MonoDevelop.Ide
IdeApp.Customizer.OnCoreShutdown ();
InstrumentationService.Stop ();
- AddinManager.AddinLoadError -= OnAddinError;
return 0;
}
@@ -341,31 +327,6 @@ namespace MonoDevelop.Ide
lockupCheckThread.Start ();
}
- void SetupTheme ()
- {
- // Use the bundled gtkrc only if the Xamarin theme is installed
- if (File.Exists (Path.Combine (Gtk.Rc.ModuleDir, "libxamarin.so")) || File.Exists (Path.Combine (Gtk.Rc.ModuleDir, "libxamarin.dll"))) {
- var gtkrc = "gtkrc";
- if (Platform.IsWindows) {
- gtkrc += ".win32";
- var osv = Environment.OSVersion.Version;
- if (osv.Major == 6 && osv.Minor < 1)
- gtkrc += "-vista";
- } else if (Platform.IsMac) {
- gtkrc += ".mac";
-
- var osv = Platform.OSVersion;
- if (osv.Major == 10 && osv.Minor >= 10) {
- gtkrc += "-yosemite";
- }
- }
-
- var gtkrcf = PropertyService.EntryAssemblyPath.Combine (gtkrc);
- LoggingService.LogInfo ("GTK: Using gtkrc from {0}", gtkrcf);
- Environment.SetEnvironmentVariable ("GTK2_RC_FILES", gtkrcf);
- }
- }
-
[System.Runtime.InteropServices.DllImport("kernel32.dll", CharSet = System.Runtime.InteropServices.CharSet.Unicode, SetLastError = true)]
[return: System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.Bool)]
static extern bool SetDllDirectory (string lpPathName);
@@ -503,47 +464,6 @@ namespace MonoDevelop.Ide
IdeApp.Workbench.Present ();
return false;
}
-
- internal static string[] gtkThemeFallbacks = new string[] {
- "Xamarin",// the best!
- "Gilouche", // SUSE
- "Mint-X", // MINT
- "Radiance", // Ubuntu 'light' theme (MD looks better with the light theme in 4.0 - if that changes switch this one)
- "Clearlooks" // GTK theme
- };
-
- static void ValidateGtkTheme (ref string theme)
- {
- if (!MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.IsBadGtkTheme (theme))
- return;
-
- var themes = MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.InstalledThemes;
-
- string fallback = gtkThemeFallbacks
- .Select (fb => themes.FirstOrDefault (t => string.Compare (fb, t, StringComparison.OrdinalIgnoreCase) == 0))
- .FirstOrDefault (t => t != null);
-
- string message = "Theme Not Supported";
-
- string detail;
- if (themes.Count > 0) {
- detail =
- "Your system is using the '{0}' GTK+ theme, which is known to be very unstable. MonoDevelop will " +
- "now switch to an alternate GTK+ theme.\n\n" +
- "This message will continue to be shown at startup until you set a alternate GTK+ theme as your " +
- "default in the GTK+ Theme Selector or MonoDevelop Preferences.";
- } else {
- detail =
- "Your system is using the '{0}' GTK+ theme, which is known to be very unstable, and no other GTK+ " +
- "themes appear to be installed. Please install another GTK+ theme.\n\n" +
- "This message will continue to be shown at startup until you install a different GTK+ theme and " +
- "set it as your default in the GTK+ Theme Selector or MonoDevelop Preferences.";
- }
-
- MessageService.GenericAlert (Gtk.Stock.DialogWarning, message, BrandingService.BrandApplicationName (detail), AlertButton.Ok);
-
- theme = fallback ?? themes.FirstOrDefault () ?? theme;
- }
void CheckFileWatcher ()
{
@@ -616,6 +536,14 @@ namespace MonoDevelop.Ide
static void HandleException (Exception ex, bool willShutdown)
{
var msg = String.Format ("An unhandled exception has occured. Terminating {0}? {1}", BrandingService.ApplicationName, willShutdown);
+ var aggregateException = ex as AggregateException;
+ if (aggregateException != null) {
+ aggregateException.Flatten ().Handle (innerEx => {
+ HandleException (innerEx, willShutdown);
+ return true;
+ });
+ return;
+ }
if (willShutdown)
LoggingService.LogFatalError (msg, ex);
@@ -648,6 +576,12 @@ namespace MonoDevelop.Ide
customizer = LoadBrandingCustomizer ();
options.IdeCustomizer = customizer;
+ if (!Platform.IsWindows) {
+ // Limit maximum threads when running on mono
+ int threadCount = 8 * Environment.ProcessorCount;
+ ThreadPool.SetMaxThreads (threadCount, threadCount);
+ }
+
int ret = -1;
try {
var exename = Path.GetFileNameWithoutExtension (Assembly.GetEntryAssembly ().Location);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeVersionInfo.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeVersionInfo.cs
index b520e3596f..35689ed93d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeVersionInfo.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeVersionInfo.cs
@@ -108,7 +108,7 @@ namespace MonoDevelop.Ide
}
string ISystemInformationProvider.Title {
- get { return BrandingService.ApplicationName; }
+ get { return BrandingService.ApplicationLongName; }
}
string ISystemInformationProvider.Description {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs
index 60e64618c6..1e7d4eb26d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ImageService.cs
@@ -38,6 +38,7 @@ using MonoDevelop.Ide.Gui.Components;
using System.Threading.Tasks;
using System.Net;
using Xwt.Backends;
+using Gtk;
namespace MonoDevelop.Ide
{
@@ -58,6 +59,7 @@ namespace MonoDevelop.Ide
static List<RuntimeAddin> addins = new List<RuntimeAddin> ();
static Dictionary<string, string> composedIcons = new Dictionary<string, string> ();
+ static Dictionary<RuntimeAddin, CustomImageLoader> imageLoaders = new Dictionary<RuntimeAddin, CustomImageLoader> ();
// Dictionary of extension nodes by stock icon id. It holds nodes that have not yet been loaded
static Dictionary<string, List<StockIconCodon>> iconStock = new Dictionary<string, List<StockIconCodon>> ();
@@ -88,16 +90,11 @@ namespace MonoDevelop.Ide
w = h = -1;
iconSizes[i].Width = w;
iconSizes[i].Height = h;
- }
- if (Platform.IsWindows) {
- iconSizes[(int)Gtk.IconSize.Menu].Width = 16;
- iconSizes[(int)Gtk.IconSize.Menu].Height = 16;
}
-
- // Preload icons defined in MD.Ide. Ensures that the gtk icon overrides are available.
- var current = AddinManager.CurrentAddin;
- foreach (var id in AddinManager.GetExtensionNodes (IconsExtensionPath).OfType<StockIconCodon> ().Where (c => c.Addin == current).Select (c => c.StockId).Distinct ())
- EnsureStockIconIsLoaded (id);
+ if (Platform.IsWindows) {
+ iconSizes[(int)Gtk.IconSize.Menu].Width = 16;
+ iconSizes[(int)Gtk.IconSize.Menu].Height = 16;
+ }
}
static Xwt.Drawing.Image LoadStockIcon (StockIconCodon iconCodon, bool forceWildcard)
@@ -108,92 +105,37 @@ namespace MonoDevelop.Ide
static Xwt.Drawing.Image LoadStockIcon (RuntimeAddin addin, string stockId, string resource, string imageFile, string iconId, Gtk.IconSize iconSize, string animation, bool forceWildcard)
{
try {
- Gdk.Pixbuf pixbuf = null, pixbuf2x = null;
AnimatedIcon animatedIcon = null;
Func<Stream[]> imageLoader = null;
+ Xwt.Drawing.Image img = null;
+
if (!string.IsNullOrEmpty (resource) || !string.IsNullOrEmpty (imageFile)) {
- // using the stream directly produces a gdk warning.
- byte[] buffer;
if (resource != null) {
- imageLoader = delegate {
- var stream = addin.GetResource (resource);
- var stream2x = addin.GetResource2x (resource);
- if (stream2x == null)
- return new [] { stream };
- else
- return new [] { stream, stream2x };
- };
+ CustomImageLoader loader;
+ if (!imageLoaders.TryGetValue (addin, out loader))
+ loader = imageLoaders [addin] = new CustomImageLoader (addin);
+ img = Xwt.Drawing.Image.FromCustomLoader (loader, resource);
}
else {
- imageLoader = delegate {
- var file = addin.GetFilePath (imageFile);
- var stream = File.OpenRead (file);
- Stream stream2x = null;
- var file2x = Path.Combine (Path.GetDirectoryName (file), Path.GetFileNameWithoutExtension (file) + "@2x" + Path.GetExtension (file));
- if (File.Exists (file2x))
- stream2x = File.OpenRead (file2x);
- else {
- file2x = file + "@2x";
- if (File.Exists (file2x))
- stream2x = File.OpenRead (file2x);
- }
- if (stream2x == null)
- return new [] { stream };
- else
- return new [] { stream, stream2x };
- };
- }
- var streams = imageLoader ();
-
- var st = streams[0];
- var st2x = streams.Length > 1 ? streams[1] : null;
-
- using (st) {
- if (st == null || st.Length < 0) {
- LoggingService.LogError ("Did not find resource '{0}' in addin '{1}' for icon '{2}'",
- resource, addin.Id, stockId);
- return null;
- }
- buffer = new byte [st.Length];
- st.Read (buffer, 0, (int)st.Length);
+ img = Xwt.Drawing.Image.FromFile (addin.GetFilePath (imageFile));
}
- pixbuf = new Gdk.Pixbuf (buffer);
-
- using (st2x) {
- if (st2x != null && st2x.Length >= 0) {
- buffer = new byte [st2x.Length];
- st2x.Read (buffer, 0, (int)st2x.Length);
- pixbuf2x = new Gdk.Pixbuf (buffer);
- }
- }
-
} else if (!string.IsNullOrEmpty (iconId)) {
var id = GetStockIdForImageSpec (addin, iconId, iconSize);
- pixbuf = GetPixbuf (id, iconSize);
- pixbuf2x = Get2xIconVariant (pixbuf);
+ img = GetIcon (id, iconSize);
// This may be an animation, get it
animationFactory.TryGetValue (id, out animatedIcon);
} else if (!string.IsNullOrEmpty (animation)) {
string id = GetStockIdForImageSpec (addin, "animation:" + animation, iconSize);
- pixbuf = GetPixbuf (id, iconSize);
+ img = GetIcon (id, iconSize);
// This *should* be an animation
animationFactory.TryGetValue (id, out animatedIcon);
}
- Gtk.IconSize size = forceWildcard? Gtk.IconSize.Invalid : iconSize;
- if (pixbuf != null)
- AddToIconFactory (stockId, pixbuf, pixbuf2x, size);
-
if (animatedIcon != null)
AddToAnimatedIconFactory (stockId, animatedIcon);
- var img = Xwt.Toolkit.CurrentEngine.WrapImage (pixbuf);
- if (pixbuf2x != null) {
- var img2x = Xwt.Toolkit.CurrentEngine.WrapImage (pixbuf2x);
- img = Xwt.Drawing.Image.CreateMultiResolutionImage (new [] { img, img2x });
- }
if (imageLoader != null)
img.SetStreamSource (imageLoader);
@@ -212,18 +154,20 @@ namespace MonoDevelop.Ide
static Gdk.Pixbuf Get2xIconVariant (Gdk.Pixbuf px)
{
- return Mono.TextEditor.GtkWorkarounds.Get2xVariant (px);
+ return GtkWorkarounds.Get2xVariant (px);
}
static void Set2xIconVariant (Gdk.Pixbuf px, Gdk.Pixbuf variant2x)
{
- Mono.TextEditor.GtkWorkarounds.Set2xVariant (px, variant2x);
+ GtkWorkarounds.Set2xVariant (px, variant2x);
}
static Dictionary<string,Xwt.Drawing.Image> icons = new Dictionary<string, Xwt.Drawing.Image> ();
- public static Xwt.Drawing.Image GetIcon (string name, Gtk.IconSize size)
+ public static Xwt.Drawing.Image GetIcon (string name, Gtk.IconSize size = IconSize.Menu)
{
+ // Converts an image spec into a real stock icon id
+ name = GetStockIdForImageSpec (name, size);
return GetIcon (name).WithSize (size);
}
@@ -242,7 +186,7 @@ namespace MonoDevelop.Ide
if (string.IsNullOrEmpty (name)) {
LoggingService.LogWarning ("Empty icon requested. Stack Trace: " + Environment.NewLine + Environment.StackTrace);
- icons [name] = img = CreateColorIcon ("#FF0000");
+ icons [name] = img = GetMissingIcon ();
return img;
}
@@ -258,15 +202,41 @@ namespace MonoDevelop.Ide
if (icons.TryGetValue (name, out img))
return img;
- Gtk.IconSet iconset = Gtk.IconFactory.LookupDefault (name);
- if (iconset == null && !Gtk.IconTheme.Default.HasIcon (name) && generateDefaultIcon) {
+ if (generateDefaultIcon) {
LoggingService.LogWarning ("Unknown icon: " + name);
- return CreateColorIcon ("#FF0000FF");
+ return GetMissingIcon ();
}
return icons [name] = img = Xwt.Toolkit.CurrentEngine.WrapImage (name);
}
+ static Xwt.Drawing.Image GetMissingIcon ()
+ {
+ Xwt.Drawing.Image img;
+ if (icons.TryGetValue ("gtk-missing-image", out img))
+ return img;
+
+ EnsureStockIconIsLoaded ("gtk-missing-image");
+
+ // Try again since it may have already been registered
+ if (icons.TryGetValue ("gtk-missing-image", out img))
+ return img;
+
+ // fallback to default Gtk icon if the Gtk theme has one
+ if (Gtk.IconTheme.Default.HasIcon ("gtk-missing-image"))
+ return icons ["gtk-missing-image"] = img = GtkUtil.GtkToolkit.WrapImage ("gtk-missing-image");
+
+ // we should never end up here, log an error
+ LoggingService.LogError ("Loading gtk-missing-image icon failed. Stack Trace: " + Environment.NewLine + Environment.StackTrace);
+ return CreateColorIcon ("#FF00FF");
+ }
+
+ public static Xwt.Drawing.Image GetImageResource (this RuntimeAddin addin, string resource)
+ {
+ var loader = new CustomImageLoader (addin);
+ return Xwt.Drawing.Image.FromCustomLoader (loader, resource);
+ }
+
static Gdk.Pixbuf GetPixbuf (string name, Gtk.IconSize size, bool generateDefaultIcon = true)
{
if (string.IsNullOrEmpty (name)) {
@@ -293,7 +263,7 @@ namespace MonoDevelop.Ide
if (iconset != null)
return iconset.RenderIcon (Gtk.Widget.DefaultStyle, Gtk.TextDirection.Ltr, Gtk.StateType.Normal, size, null, null);
- if (Gtk.IconTheme.Default.HasIcon (stockid)) {
+ if (Gtk.IconTheme.Default.HasIcon (stockid)) {
int h = iconSizes[(int)size].Height;
Gdk.Pixbuf result = Gtk.IconTheme.Default.LoadIcon (stockid, h, (Gtk.IconLookupFlags)0);
return result;
@@ -477,45 +447,6 @@ namespace MonoDevelop.Ide
return GetStockIdForImageSpec (addin, filename, iconSize);
}
- static void AddToIconFactory (string stockId, Gdk.Pixbuf pixbuf, Gdk.Pixbuf pixbuf2x, Gtk.IconSize iconSize)
- {
- Gtk.IconSet iconSet = iconFactory.Lookup (stockId);
- if (iconSet == null) {
- iconSet = new Gtk.IconSet ();
- iconFactory.Add (stockId, iconSet);
- }
-
- Gtk.IconSource source = new Gtk.IconSource ();
- Gtk.IconSource source2x = null;
-
- if (Platform.IsWindows) {
- var pixel_scale = Mono.TextEditor.GtkWorkarounds.GetPixelScale ();
- source.Pixbuf = pixbuf.ScaleSimple ((int)(pixbuf.Width * pixel_scale), (int)(pixbuf.Height * pixel_scale), Gdk.InterpType.Bilinear);
- } else {
- source.Pixbuf = pixbuf;
- }
-
- source.Size = iconSize;
- source.SizeWildcarded = iconSize == Gtk.IconSize.Invalid;
-
- if (pixbuf2x != null) {
- if (Mono.TextEditor.GtkWorkarounds.SetSourceScale (source, 1)) {
- Mono.TextEditor.GtkWorkarounds.SetSourceScaleWildcarded (source, false);
- source2x = new Gtk.IconSource ();
- source2x.Pixbuf = pixbuf2x;
- source2x.Size = iconSize;
- source2x.SizeWildcarded = iconSize == Gtk.IconSize.Invalid;
- Mono.TextEditor.GtkWorkarounds.SetSourceScale (source2x, 2);
- Mono.TextEditor.GtkWorkarounds.SetSourceScaleWildcarded (source2x, false);
- }
- } else {
- Mono.TextEditor.GtkWorkarounds.SetSourceScaleWildcarded (source, true);
- }
-
- iconSet.AddSource (source);
- if (source2x != null)
- iconSet.AddSource (source2x);
- }
static void AddToAnimatedIconFactory (string stockId, AnimatedIcon aicon)
{
@@ -566,9 +497,9 @@ namespace MonoDevelop.Ide
string stockId = "__asm" + addinId + "__" + id + "__" + size;
if (!hash.ContainsKey (stockId)) {
var aicon = new AnimatedIcon (addin, id, size);
- AddToIconFactory (stockId, aicon.FirstFrame.WithSize (size).ToPixbuf (), null, size);
AddToAnimatedIconFactory (stockId, aicon);
hash[stockId] = stockId;
+ icons [stockId] = aicon.FirstFrame;
}
return stockId;
}
@@ -591,6 +522,7 @@ namespace MonoDevelop.Ide
if (composedIcons.TryGetValue (id, out cid))
return cid;
System.Collections.ICollection col = size == Gtk.IconSize.Invalid ? Enum.GetValues (typeof(Gtk.IconSize)) : new object [] { size };
+ var frames = new List<Xwt.Drawing.Image> ();
foreach (Gtk.IconSize sz in col) {
if (sz == Gtk.IconSize.Invalid)
continue;
@@ -616,9 +548,10 @@ namespace MonoDevelop.Ide
ib.Context.DrawImage (px, 0, 0);
}
- if (icon != null)
- AddToIconFactory (id, ib.ToBitmap ().ToPixbuf (), ib.ToBitmap (2f).WithSize (icon.Width * 2, icon.Height * 2).ToPixbuf (), sz);
+ frames.Add (ib.ToVectorImage ());
}
+
+ icons [id] = Xwt.Drawing.Image.CreateMultiSizeIcon (frames);
composedIcons[id] = id;
return id;
}
@@ -630,6 +563,8 @@ namespace MonoDevelop.Ide
static string GetStockIdForImageSpec (RuntimeAddin addin, string filename, Gtk.IconSize size)
{
+ if (String.IsNullOrEmpty (filename))
+ return String.Empty;
if (filename.IndexOf ('|') == -1)
return PrivGetStockId (addin, filename, size);
@@ -893,4 +828,30 @@ namespace MonoDevelop.Ide
}
}
+ class CustomImageLoader : Xwt.Drawing.IImageLoader
+ {
+ RuntimeAddin addin;
+ Dictionary<System.Reflection.Assembly, string []> resources = new Dictionary<System.Reflection.Assembly, string[]> ();
+
+ public CustomImageLoader (RuntimeAddin addin)
+ {
+ this.addin = addin;
+ }
+
+ public IEnumerable<string> GetAlternativeFiles (string fileName, string baseName, string ext)
+ {
+ var r = addin.GetResourceInfo (fileName);
+
+ string [] resourceList;
+ if (!resources.TryGetValue (r.ReferencedAssembly, out resourceList))
+ resourceList = resources [r.ReferencedAssembly] = r.ReferencedAssembly.GetManifestResourceNames ();
+
+ return resourceList;
+ }
+
+ public Stream LoadImage (string fileName)
+ {
+ return addin.GetResource (fileName, true);
+ }
+ }
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs
index 33c61c8e22..cf5be4ac77 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MessageService.cs
@@ -30,10 +30,11 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Components.Extensions;
using MonoDevelop.Ide.Gui;
+using System.Threading.Tasks;
#if MAC
using AppKit;
@@ -87,8 +88,9 @@ namespace MonoDevelop.Ide
public static AlertButton Stop = new AlertButton (Gtk.Stock.Stop, true);
public static AlertButton Proceed = new AlertButton (GettextCatalog.GetString ("_Proceed"));
public static AlertButton Replace = new AlertButton (GettextCatalog.GetString ("_Replace"));
-
+
public static AlertButton OverwriteFile = new AlertButton (GettextCatalog.GetString ("_Overwrite file"));
+ public static AlertButton AddExistingFile = new AlertButton (GettextCatalog.GetString ("Add existing file"));
public string Label { get; set; }
@@ -128,52 +130,7 @@ namespace MonoDevelop.Ide
public static class MessageService
{
public static Window RootWindow { get; internal set; }
-
- #region ShowException
-
- public static void ShowException (Exception e)
- {
- ShowException ((Window)null, e);
- }
-
- public static void ShowException (Exception e, string message)
- {
- ShowException ((Window)null, e, message);
- }
-
- public static void ShowException (Exception e, string message, string title)
- {
- ShowException ((Window)null, e, message, title);
- }
-
- public static AlertButton ShowException (Exception e, string message, string title, params AlertButton[] buttons)
- {
- return ShowException ((Window)null, e, message, title, buttons);
- }
-
- public static void ShowException (Window parent, Exception e)
- {
- ShowException (parent, e, e.Message);
- }
-
- public static void ShowException (Window parent, Exception e, string message)
- {
- ShowException (parent, e, message, null);
- }
-
- public static void ShowException (Window parent, Exception e, string message, string title)
- {
- ShowException (parent, e, message, title, null);
- }
- public static AlertButton ShowException (Window parent, Exception e, string message, string title, params AlertButton[] buttons)
- {
- if (!IdeApp.IsInitialized)
- throw new Exception ("IdeApp has not been initialized. Propagating the exception.", e);
- return messageService.ShowException (parent, title, message, e, buttons);
- }
- #endregion
-
#region ShowError
public static void ShowError (string primaryText)
{
@@ -330,13 +287,13 @@ namespace MonoDevelop.Ide
return ShowCustomDialog (dialog, null);
}
- public static int ShowCustomDialog (Dialog dialog, Window parent)
+ public static int ShowCustomDialog (Dialog dlg, Window parent)
{
+ Gtk.Dialog dialog = dlg;
try {
- return RunCustomDialog (dialog, parent);
+ return RunCustomDialog (dlg, parent);
} finally {
- if (dialog != null)
- dialog.Destroy ();
+ dialog?.Destroy ();
}
}
@@ -348,9 +305,10 @@ namespace MonoDevelop.Ide
/// <summary>
/// Places and runs a transient dialog. Does not destroy it, so values can be retrieved from its widgets.
/// </summary>
- public static int RunCustomDialog (Dialog dialog, Window parent)
+ public static int RunCustomDialog (Dialog dlg, Window parent)
{
// if dialog is modal, make sure it's parented on any existing modal dialog
+ Gtk.Dialog dialog = dlg;
if (dialog.Modal) {
parent = GetDefaultModalParent ();
}
@@ -362,21 +320,22 @@ namespace MonoDevelop.Ide
dialog.TransientFor = parent;
dialog.DestroyWithParent = true;
+ MonoDevelop.Components.IdeTheme.ApplyTheme (dialog);
if (dialog.Title == null)
dialog.Title = BrandingService.ApplicationName;
#if MAC
- DispatchService.GuiSyncDispatch (() => {
+ Runtime.RunInMainThread (() => {
// If there is a native NSWindow model window running, we need
// to show the new dialog over that window.
if (NSApplication.SharedApplication.ModalWindow != null)
dialog.Shown += HandleShown;
else
PlaceDialog (dialog, parent);
- });
+ }).Wait ();
#endif
- return Mono.TextEditor.GtkWorkarounds.RunDialogWithNotification (dialog);
+ return GtkWorkarounds.RunDialogWithNotification (dialog);
}
#if MAC
@@ -403,26 +362,27 @@ namespace MonoDevelop.Ide
/// </summary>
public static Window GetDefaultModalParent ()
{
- foreach (Window w in Window.ListToplevels ())
+ foreach (Gtk.Window w in Gtk.Window.ListToplevels ())
if (w.Visible && w.HasToplevelFocus && w.Modal)
return w;
return GetFocusedToplevel ();
}
- static Window GetFocusedToplevel ()
+ static Gtk.Window GetFocusedToplevel ()
{
- return Window.ListToplevels ().FirstOrDefault (w => w.HasToplevelFocus) ?? RootWindow;
+ return Gtk.Window.ListToplevels ().FirstOrDefault (w => w.HasToplevelFocus) ?? RootWindow;
}
/// <summary>
/// Positions a dialog relative to its parent on platforms where default placement is known to be poor.
/// </summary>
- public static void PlaceDialog (Window child, Window parent)
+ public static void PlaceDialog (Window childControl, Window parent)
{
//HACK: this is a workaround for broken automatic window placement on Mac
if (!Platform.IsMac)
return;
+ Gtk.Window child = childControl;
//modal windows should always be placed o top of existing modal windows
if (child.Modal)
parent = GetDefaultModalParent ();
@@ -436,8 +396,10 @@ namespace MonoDevelop.Ide
}
/// <summary>Centers a window relative to its parent.</summary>
- static void CenterWindow (Window child, Window parent)
+ static void CenterWindow (Window childControl, Window parentControl)
{
+ Gtk.Window child = childControl;
+ Gtk.Window parent = parentControl;
child.Child.Show ();
int w, h, winw, winh, x, y, winx, winy;
child.GetSize (out w, out h);
@@ -500,6 +462,40 @@ namespace MonoDevelop.Ide
{
return messageService.GenericAlert (parent, message);
}
+
+ public static async Task<T> ExecuteTaskAndShowWaitDialog<T> (Task<T> task, string waitMessage, CancellationTokenSource cts)
+ {
+ bool taskFinished = false;
+ var dontExitMethodUntilDialogClosed = new TaskCompletionSource<bool> ();
+ var delayTask = Task.Delay (1000);//Don't show wait dialog immediately, wait 1 sec before showing
+ var finishedTask = await Task.WhenAny (delayTask, task).ConfigureAwait (false);
+ if (finishedTask == task)//If task finished before delayTask, great return value and never display dialog
+ return task.Result;
+ //cancelDialog is used to close dialog when task is finished
+ var cancelDialog = new CancellationTokenSource ();
+ Gtk.Application.Invoke (delegate {
+ if (cancelDialog.Token.IsCancellationRequested)
+ return;
+ var gm = new GenericMessage (waitMessage, null, cancelDialog.Token);
+ gm.Buttons.Add (AlertButton.Cancel);
+ gm.DefaultButton = 0;
+ GenericAlert (gm);
+ dontExitMethodUntilDialogClosed.SetResult (true);
+ if (!taskFinished) {
+ //Don't cancel if task finished already, we closed dialog via cancelDialog.Cancel ();
+ //caller of this method might reuse this cts for other tasks
+ cts.Cancel ();
+ }
+ });
+ try {
+ await task.ConfigureAwait (false);
+ } finally {
+ taskFinished = true;
+ cancelDialog.Cancel ();
+ }
+ await dontExitMethodUntilDialogClosed.Task.ConfigureAwait (false);
+ return task.Result;
+ }
public static string GetTextResponse (string question, string caption, string initialValue)
{
@@ -540,22 +536,6 @@ namespace MonoDevelop.Ide
//The real GTK# code is wrapped in a GuiSyncObject to make calls synchronous on the GUI thread
class InternalMessageService : GuiSyncObject
{
- public AlertButton ShowException (Window parent, string title, string message, Exception e, params AlertButton[] buttons)
- {
- if ((buttons == null || buttons.Length == 0) && (e is UserException) && ((UserException)e).AlreadyReportedToUser)
- return AlertButton.Ok;
-
- var exceptionDialog = new ExceptionDialog {
- Buttons = buttons ?? new [] { AlertButton.Ok },
- Title = title ?? GettextCatalog.GetString ("An error has occurred"),
- Message = message,
- Exception = e,
- TransientFor = parent ?? GetDefaultModalParent (),
- };
- exceptionDialog.Run ();
- return exceptionDialog.ResultButton;
- }
-
public AlertButton GenericAlert (Window parent, MessageDescription message)
{
var dialog = new AlertDialog (message) {
@@ -618,7 +598,7 @@ namespace MonoDevelop.Ide
AlertButtonClicked (this, args);
return args.CloseDialog;
}
-
+
public void AddOption (string id, string text, bool setByDefault)
{
Options.Add (new AlertOption (id, text) { Value = setByDefault });
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs
index e944b75f55..d83390e93f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs
@@ -40,19 +40,22 @@ using MonoDevelop.Core;
using MonoDevelop.Core.Execution;
using MonoDevelop.Core.ProgressMonitoring;
using MonoDevelop.Ide.ProgressMonitoring;
-using MonoDevelop.Ide.Tasks;
using MonoDevelop.Ide.Gui.Dialogs;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Projects;
using MonoDevelop.Core.Assemblies;
using MonoDevelop.Core.Instrumentation;
-using Mono.TextEditor;
using System.Diagnostics;
-using ICSharpCode.NRefactory.Documentation;
-using ICSharpCode.NRefactory.TypeSystem.Implementation;
using System.Text;
using MonoDevelop.Ide.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem;
+using System.Threading.Tasks;
+using System.Threading;
+using ExecutionContext = MonoDevelop.Projects.ExecutionContext;
+using MonoDevelop.Ide.Tasks;
+using MonoDevelop.Projects.MSBuild;
+using System.Collections.Immutable;
+using MonoDevelop.Ide.Editor;
+using MonoDevelop.Core.Text;
using MonoDevelop.Components.Extensions;
namespace MonoDevelop.Ide
@@ -62,14 +65,14 @@ namespace MonoDevelop.Ide
/// </summary>
public class ProjectOperations
{
- IAsyncOperation currentBuildOperation = NullAsyncOperation.Success;
- IAsyncOperation currentRunOperation = NullAsyncOperation.Success;
+ AsyncOperation<BuildResult> currentBuildOperation = new AsyncOperation<BuildResult> (Task.FromResult (BuildResult.CreateSuccess ()), null);
+ AsyncOperation currentRunOperation = AsyncOperation.CompleteOperation;
IBuildTarget currentBuildOperationOwner;
IBuildTarget currentRunOperationOwner;
SelectReferenceDialog selDialog = null;
- SolutionItem currentSolutionItem = null;
+ SolutionFolderItem currentSolutionItem = null;
WorkspaceItem currentWorkspaceItem = null;
object currentItem;
@@ -100,17 +103,23 @@ namespace MonoDevelop.Ide
public IBuildTarget CurrentSelectedBuildTarget {
get {
- if (currentSolutionItem != null)
- return currentSolutionItem;
- return currentWorkspaceItem;
+ if (currentSolutionItem is IBuildTarget)
+ return (IBuildTarget) currentSolutionItem;
+ return currentWorkspaceItem as IBuildTarget;
}
}
+ public WorkspaceObject CurrentSelectedObject {
+ get {
+ return (WorkspaceObject)currentSolutionItem ?? (WorkspaceObject) currentWorkspaceItem;
+ }
+ }
+
public WorkspaceItem CurrentSelectedWorkspaceItem {
get {
return currentWorkspaceItem;
}
- internal set {
+ set {
if (value != currentWorkspaceItem) {
WorkspaceItem oldValue = currentWorkspaceItem;
currentWorkspaceItem = value;
@@ -120,15 +129,15 @@ namespace MonoDevelop.Ide
}
}
- public SolutionItem CurrentSelectedSolutionItem {
+ public SolutionFolderItem CurrentSelectedSolutionItem {
get {
if (currentSolutionItem == null && CurrentSelectedSolution != null)
return CurrentSelectedSolution.RootFolder;
return currentSolutionItem;
}
- internal set {
+ set {
if (value != currentSolutionItem) {
- SolutionItem oldValue = currentSolutionItem;
+ SolutionFolderItem oldValue = currentSolutionItem;
currentSolutionItem = value;
if (oldValue is Project || value is Project)
OnCurrentProjectChanged (new ProjectEventArgs(currentSolutionItem as Project));
@@ -140,43 +149,36 @@ namespace MonoDevelop.Ide
get {
return currentItem;
}
- internal set {
- currentItem = value;
- }
- }
-
- public string ProjectsDefaultPath {
- get {
- return PropertyService.Get ("MonoDevelop.Core.Gui.Dialogs.NewProjectDialog.DefaultPath", System.IO.Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), "Projects"));
- }
set {
- PropertyService.Set ("MonoDevelop.Core.Gui.Dialogs.NewProjectDialog.DefaultPath", value);
+ currentItem = value;
}
}
- public IAsyncOperation CurrentBuildOperation {
+ public AsyncOperation CurrentBuildOperation {
get { return currentBuildOperation; }
}
- public IAsyncOperation CurrentRunOperation {
+ public AsyncOperation CurrentRunOperation {
get { return currentRunOperation; }
set {
- currentRunOperation = value ?? NullAsyncOperation.Success;
+ currentRunOperation = value ?? AsyncOperation.CompleteOperation;
OnCurrentRunOperationChanged (EventArgs.Empty);
}
}
- public bool IsBuilding (IBuildTarget target)
+ public bool IsBuilding (WorkspaceObject ob)
{
- return !currentBuildOperation.IsCompleted && ContainsTarget (target, currentBuildOperationOwner);
+ var owner = currentBuildOperationOwner as WorkspaceObject;
+ return owner != null && !currentBuildOperation.IsCompleted && ContainsTarget (ob, owner);
}
- public bool IsRunning (IBuildTarget target)
+ public bool IsRunning (WorkspaceObject target)
{
- return !currentRunOperation.IsCompleted && ContainsTarget (target, currentRunOperationOwner);
+ var owner = currentRunOperationOwner as WorkspaceObject;
+ return owner != null && !currentRunOperation.IsCompleted && ContainsTarget (target, owner);
}
- internal static bool ContainsTarget (IBuildTarget owner, IBuildTarget target)
+ internal static bool ContainsTarget (WorkspaceObject owner, WorkspaceObject target)
{
if (owner == target)
return true;
@@ -220,31 +222,33 @@ namespace MonoDevelop.Ide
return (GetDeclaredFile(item) != null);
}*/
- public bool CanJumpToDeclaration (object element)
+ public bool CanJumpToDeclaration (Microsoft.CodeAnalysis.ISymbol symbol)
{
- if (element is ICSharpCode.NRefactory.TypeSystem.IVariable)
- return true;
- var entity = element as ICSharpCode.NRefactory.TypeSystem.IEntity;
- if (entity == null && element is ICSharpCode.NRefactory.TypeSystem.IType)
- entity = ((ICSharpCode.NRefactory.TypeSystem.IType)element).GetDefinition ();
- if (entity == null)
+ if (symbol == null)
return false;
- if (entity.Region.IsEmpty) {
- var parentAssembly = entity.ParentAssembly;
- if (parentAssembly == null)
- return false;
- return !string.IsNullOrEmpty (parentAssembly.UnresolvedAssembly.Location);
+ switch (symbol.Kind) {
+ case Microsoft.CodeAnalysis.SymbolKind.Local:
+ case Microsoft.CodeAnalysis.SymbolKind.Parameter:
+ case Microsoft.CodeAnalysis.SymbolKind.NamedType:
+ case Microsoft.CodeAnalysis.SymbolKind.Method:
+ case Microsoft.CodeAnalysis.SymbolKind.Field:
+ case Microsoft.CodeAnalysis.SymbolKind.Property:
+ case Microsoft.CodeAnalysis.SymbolKind.Event:
+ case Microsoft.CodeAnalysis.SymbolKind.Label:
+ case Microsoft.CodeAnalysis.SymbolKind.TypeParameter:
+ case Microsoft.CodeAnalysis.SymbolKind.RangeVariable:
+ return true;
}
- return true;
+ return false;
}
- static MonoDevelop.Ide.FindInFiles.SearchResult GetJumpTypePartSearchResult (ICSharpCode.NRefactory.TypeSystem.IUnresolvedTypeDefinition part)
+ static MonoDevelop.Ide.FindInFiles.SearchResult GetJumpTypePartSearchResult (Microsoft.CodeAnalysis.ISymbol part, Microsoft.CodeAnalysis.Location location)
{
- var provider = new MonoDevelop.Ide.FindInFiles.FileProvider (part.Region.FileName);
- var doc = new Mono.TextEditor.TextDocument ();
+ var provider = new MonoDevelop.Ide.FindInFiles.FileProvider (location.SourceTree.FilePath);
+ var doc = TextEditorFactory.CreateNewDocument ();
doc.Text = provider.ReadString ();
- int position = doc.LocationToOffset (part.Region.BeginLine, part.Region.BeginColumn);
- while (position + part.Name.Length < doc.TextLength) {
+ int position = location.SourceSpan.Start;
+ while (position + part.Name.Length < doc.Length) {
if (doc.GetTextAt (position, part.Name.Length) == part.Name)
break;
position++;
@@ -252,90 +256,123 @@ namespace MonoDevelop.Ide
return new MonoDevelop.Ide.FindInFiles.SearchResult (provider, position, part.Name.Length);
}
- public void JumpToDeclaration (ICSharpCode.NRefactory.TypeSystem.INamedElement visitable, bool askIfMultipleLocations = true)
+ public async void JumpTo (Microsoft.CodeAnalysis.ISymbol symbol, Microsoft.CodeAnalysis.Location location, Project project = null)
{
- if (askIfMultipleLocations) {
- var type = visitable as ICSharpCode.NRefactory.TypeSystem.IType;
- if (type != null && type.GetDefinition () != null && type.GetDefinition ().Parts.Count > 1) {
- using (var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true)) {
- foreach (var part in type.GetDefinition ().Parts)
- monitor.ReportResult (GetJumpTypePartSearchResult (part));
+ if (location == null)
+ return;
+ if (location.IsInMetadata) {
+ string fileName = null;
+ var dn = project as DotNetProject;
+ if (dn == null)
+ return;
+ var metadataDllName = location.MetadataModule.Name;
+ if (metadataDllName == "CommonLanguageRuntimeLibrary")
+ metadataDllName = "corlib.dll";
+ foreach (var assembly in await dn.GetReferencedAssemblies (IdeApp.Workspace.ActiveConfiguration)) {
+ if (assembly.IndexOf (metadataDllName) > 0) {
+ fileName = dn.GetAbsoluteChildPath (assembly);
+ break;
}
+ }
+ if (fileName == null)
return;
+ var doc = await IdeApp.Workbench.OpenDocument (new FileOpenInformation (fileName, project));
+
+ if (doc != null) {
+ doc.RunWhenLoaded (delegate {
+ var handler = doc.PrimaryView.GetContent<MonoDevelop.Ide.Gui.Content.IOpenNamedElementHandler> ();
+ if (handler != null)
+ handler.Open (symbol);
+ });
}
- }
- JumpToDeclaration (visitable);
+ return;
+ }
+ var filePath = location.SourceTree.FilePath;
+ var offset = location.SourceSpan.Start;
+ if (project?.ParentSolution != null) {
+ string projectedName;
+ int projectedOffset;
+ if (TypeSystemService.GetWorkspace (project.ParentSolution).TryGetOriginalFileFromProjection (filePath, offset, out projectedName, out projectedOffset)) {
+ filePath = projectedName;
+ offset = projectedOffset;
+ }
+ }
+ await IdeApp.Workbench.OpenDocument (new FileOpenInformation (filePath, project) {
+ Offset = offset
+ });
}
-
- void JumpToDeclaration (ICSharpCode.NRefactory.TypeSystem.INamedElement element)
+
+ public void JumpToDeclaration (Microsoft.CodeAnalysis.ISymbol symbol, Project project = null, bool askIfMultipleLocations = true)
{
- var entity = element as ICSharpCode.NRefactory.TypeSystem.IEntity;
-
- if (entity == null && element is ICSharpCode.NRefactory.TypeSystem.IType)
- entity = ((ICSharpCode.NRefactory.TypeSystem.IType)element).GetDefinition ();
- if (entity is SpecializedMember)
- entity = ((SpecializedMember)entity).MemberDefinition;
-
- if (entity == null) {
- LoggingService.LogError ("Unknown element:" + element);
+ if (symbol == null)
+ throw new ArgumentNullException ("symbol");
+ var locations = symbol.Locations;
+
+ if (askIfMultipleLocations && locations.Length > 1) {
+ using (var monitor = IdeApp.Workbench.ProgressMonitors.GetSearchProgressMonitor (true, true)) {
+ foreach (var part in locations)
+ monitor.ReportResult (GetJumpTypePartSearchResult (symbol, part));
+ }
return;
}
- string fileName;
- bool isCecilProjectContent = entity.Region.IsEmpty;
- if (isCecilProjectContent) {
- fileName = entity.ParentAssembly.UnresolvedAssembly.Location;
- } else {
- fileName = entity.Region.FileName;
- }
- var project = (entity is ITypeDefinition ? ((ITypeDefinition )entity) : entity.DeclaringTypeDefinition).GetProjectWhereTypeIsDefined ();
- var doc = IdeApp.Workbench.OpenDocument (fileName,
- project,
- entity.Region.BeginLine,
- entity.Region.BeginColumn);
+ JumpTo (symbol, locations.FirstOrDefault (), project);
+ }
- if (isCecilProjectContent && doc != null) {
+ public async void JumpToMetadata (string metadataDllName, string documentationCommentId, Project project = null, bool openInPublicOnlyMode = true)
+ {
+ if (metadataDllName == null)
+ throw new ArgumentNullException ("metadataDllName");
+ if (documentationCommentId == null)
+ throw new ArgumentNullException ("documentationCommentId");
+ string fileName = metadataDllName;
+ if (metadataDllName == "CommonLanguageRuntimeLibrary")
+ metadataDllName = "corlib.dll";
+ var dn = project as DotNetProject;
+ if (dn != null) {
+ foreach (var assembly in await dn.GetReferencedAssemblies (IdeApp.Workspace.ActiveConfiguration)) {
+ if (assembly.IndexOf(metadataDllName, StringComparison.Ordinal) > 0) {
+ fileName = dn.GetAbsoluteChildPath (assembly);
+ break;
+ }
+ }
+ }
+ if (fileName == null || !File.Exists (fileName))
+ return;
+ var doc = await IdeApp.Workbench.OpenDocument (new FileOpenInformation (fileName));
+ if (doc != null) {
doc.RunWhenLoaded (delegate {
var handler = doc.PrimaryView.GetContent<MonoDevelop.Ide.Gui.Content.IOpenNamedElementHandler> ();
if (handler != null)
- handler.Open (entity);
+ handler.Open (documentationCommentId, openInPublicOnlyMode);
});
}
}
- public void JumpToDeclaration (ICSharpCode.NRefactory.TypeSystem.IVariable entity)
- {
- if (entity == null)
- throw new ArgumentNullException ("entity");
- string fileName = entity.Region.FileName;
- // variables are always in the same file -> file is already open, project not needed.
- IdeApp.Workbench.OpenDocument (fileName, null, entity.Region.BeginLine, entity.Region.BeginColumn);
- }
-
- public void RenameItem (IWorkspaceFileObject item, string newName)
+ public async void RenameItem (IWorkspaceFileObject item, string newName)
{
ProjectOptionsDialog.RenameItem (item, newName);
- if (item is SolutionItem) {
- Save (((SolutionItem)item).ParentSolution);
+ if (item is SolutionFolderItem) {
+ await SaveAsync (((SolutionFolderItem)item).ParentSolution);
} else {
- IdeApp.Workspace.Save ();
+ await IdeApp.Workspace.SaveAsync ();
IdeApp.Workspace.SavePreferences ();
}
}
- public void Export (WorkspaceItem item)
+ public void Export (Solution item)
{
Export (item, null);
}
- public void Export (WorkspaceItem item, FileFormat format)
+ public async void Export (IMSBuildFileObject item, MSBuildFileFormat format)
{
ExportSolutionDialog dlg = new ExportSolutionDialog (item, format);
try {
if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) {
- using (IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetToolOutputProgressMonitor (true)) {
- Services.ProjectService.Export (monitor, item.FileName, dlg.TargetFolder, dlg.Format);
+ using (ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetToolOutputProgressMonitor (true)) {
+ await Services.ProjectService.Export (monitor, item.FileName, dlg.TargetFolder, dlg.Format);
}
}
} finally {
@@ -344,29 +381,34 @@ namespace MonoDevelop.Ide
}
}
- public void Save (IEnumerable<SolutionEntityItem> entries)
+ public Task SaveAsync (IEnumerable<SolutionItem> entries)
{
List<IWorkspaceFileObject> items = new List<IWorkspaceFileObject> ();
foreach (IWorkspaceFileObject it in entries)
items.Add (it);
- Save (items);
+ return SaveAsync (items);
}
- public void Save (SolutionEntityItem entry)
+ public Task SaveAsync (SolutionItem entry)
{
- if (!entry.FileFormat.CanWrite (entry)) {
- IWorkspaceFileObject itemContainer = GetContainer (entry);
+ return SaveAsyncInernal (entry);
+ }
+
+ async Task SaveAsyncInernal (SolutionItem entry)
+ {
+ if (!entry.FileFormat.CanWriteFile (entry)) {
+ var itemContainer = (IMSBuildFileObject) GetContainer (entry);
if (SelectValidFileFormat (itemContainer))
- Save (itemContainer);
+ await SaveAsync (itemContainer);
return;
}
if (!AllowSave (entry))
return;
- IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetSaveProgressMonitor (true);
+ ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetSaveProgressMonitor (true);
try {
- entry.Save (monitor);
+ await entry.SaveAsync (monitor);
monitor.ReportSuccess (GettextCatalog.GetString ("Project saved."));
} catch (Exception ex) {
monitor.ReportError (GettextCatalog.GetString ("Save failed."), ex);
@@ -375,9 +417,14 @@ namespace MonoDevelop.Ide
}
}
- public void Save (Solution item)
+ public Task SaveAsync (Solution item)
{
- if (!item.FileFormat.CanWrite (item)) {
+ return SaveAsyncInternal (item);
+ }
+
+ async Task SaveAsyncInternal (Solution item)
+ {
+ if (!item.FileFormat.CanWriteFile (item)) {
if (!SelectValidFileFormat (item))
return;
}
@@ -385,9 +432,9 @@ namespace MonoDevelop.Ide
if (!AllowSave (item))
return;
- IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetSaveProgressMonitor (true);
+ ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetSaveProgressMonitor (true);
try {
- item.Save (monitor);
+ await item.SaveAsync (monitor);
monitor.ReportSuccess (GettextCatalog.GetString ("Solution saved."));
} catch (Exception ex) {
monitor.ReportError (GettextCatalog.GetString ("Save failed."), ex);
@@ -396,7 +443,12 @@ namespace MonoDevelop.Ide
}
}
- public void Save (IEnumerable<IWorkspaceFileObject> items)
+ public Task SaveAsync (IEnumerable<IWorkspaceFileObject> items)
+ {
+ return SaveAsyncInternal (items);
+ }
+
+ async Task SaveAsyncInternal (IEnumerable<IWorkspaceFileObject> items)
{
int count = items.Count ();
if (count == 0)
@@ -411,16 +463,17 @@ namespace MonoDevelop.Ide
IWorkspaceFileObject itemContainer = GetContainer (entry);
if (fixedItems.Contains (itemContainer) || failedItems.Contains (itemContainer))
continue;
- if (!entry.FileFormat.CanWrite (entry)) {
+ var msf = entry as IMSBuildFileObject;
+ if (msf != null && !msf.FileFormat.CanWriteFile (entry) && (itemContainer is IMSBuildFileObject)) {
// Can't save the project using this format. Try to find a valid format for the whole solution
- if (SelectValidFileFormat (itemContainer))
+ if (SelectValidFileFormat ((IMSBuildFileObject) itemContainer))
fixedItems.Add (itemContainer);
else
failedItems.Add (itemContainer);
}
}
if (fixedItems.Count > 0)
- Save (fixedItems);
+ await SaveAsync (fixedItems);
if (failedItems.Count > 0 || fixedItems.Count > 0) {
// Some file format changes were required, and some items were saved.
@@ -434,14 +487,17 @@ namespace MonoDevelop.Ide
items = notSavedEntries;
}
- IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetSaveProgressMonitor (true);
+ ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetSaveProgressMonitor (true);
try {
+ var tasks = new List<Task> ();
monitor.BeginTask (null, count);
foreach (IWorkspaceFileObject item in items) {
if (AllowSave (item))
- item.Save (monitor);
- monitor.Step (1);
+ tasks.Add (item.SaveAsync (monitor).ContinueWith (t => monitor.Step(1)));
+ else
+ monitor.Step (1);
}
+ await Task.WhenAll (tasks);
monitor.EndTask ();
monitor.ReportSuccess (GettextCatalog.GetString ("Items saved."));
} catch (Exception ex) {
@@ -451,26 +507,36 @@ namespace MonoDevelop.Ide
}
}
- public void Save (IWorkspaceFileObject item)
+ public Task SaveAsync (WorkspaceObject item)
{
- if (item is SolutionEntityItem)
- Save ((SolutionEntityItem) item);
+ if (item is IWorkspaceFileObject)
+ return SaveAsync ((IWorkspaceFileObject)item);
+ if (item.ParentObject != null)
+ return SaveAsync (item.ParentObject);
+ return Task.FromResult (0);
+ }
+
+ async Task SaveAsync (IWorkspaceFileObject item)
+ {
+ if (item is SolutionItem)
+ await SaveAsync ((SolutionItem) item);
else if (item is Solution)
- Save ((Solution)item);
-
- if (!item.FileFormat.CanWrite (item)) {
- IWorkspaceFileObject ci = GetContainer (item);
+ await SaveAsync ((Solution)item);
+
+ var msf = item as IMSBuildFileObject;
+ if (msf != null && !msf.FileFormat.CanWriteFile (item)) {
+ var ci = (IMSBuildFileObject) GetContainer (item);
if (SelectValidFileFormat (ci))
- Save (ci);
+ await SaveAsync (ci);
return;
}
if (!AllowSave (item))
return;
- IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetSaveProgressMonitor (true);
+ ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetSaveProgressMonitor (true);
try {
- item.Save (monitor);
+ await item.SaveAsync (monitor);
monitor.ReportSuccess (GettextCatalog.GetString ("Item saved."));
} catch (Exception ex) {
monitor.ReportError (GettextCatalog.GetString ("Save failed."), ex);
@@ -502,7 +568,7 @@ namespace MonoDevelop.Ide
if (item.ItemFilesChanged)
return true;
if (item is WorkspaceItem) {
- foreach (SolutionEntityItem eitem in ((WorkspaceItem)item).GetAllSolutionItems<SolutionEntityItem> ())
+ foreach (SolutionItem eitem in ((WorkspaceItem)item).GetAllItems<SolutionItem> ())
if (eitem.ItemFilesChanged)
return true;
}
@@ -511,19 +577,19 @@ namespace MonoDevelop.Ide
IWorkspaceFileObject GetContainer (IWorkspaceFileObject item)
{
- SolutionEntityItem si = item as SolutionEntityItem;
- if (si != null && si.ParentSolution != null && !si.ParentSolution.FileFormat.SupportsMixedFormats)
+ SolutionItem si = item as SolutionItem;
+ if (si != null && si.ParentSolution != null)
return si.ParentSolution;
else
return item;
}
- bool SelectValidFileFormat (IWorkspaceFileObject item)
+ bool SelectValidFileFormat (IMSBuildFileObject item)
{
var dlg = new SelectFileFormatDialog (item);
try {
if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok && dlg.Format != null) {
- item.ConvertToFormat (dlg.Format, true);
+ item.ConvertToFormat (dlg.Format);
return true;
}
return false;
@@ -544,15 +610,15 @@ namespace MonoDevelop.Ide
}
}
- public void ShowOptions (IWorkspaceObject entry)
+ public void ShowOptions (WorkspaceObject entry)
{
ShowOptions (entry, null);
}
- public void ShowOptions (IWorkspaceObject entry, string panelId)
+ public async void ShowOptions (WorkspaceObject entry, string panelId)
{
- if (entry is SolutionEntityItem) {
- var selectedProject = (SolutionEntityItem) entry;
+ if (entry is SolutionItem) {
+ var selectedProject = (SolutionItem) entry;
var optionsDialog = new ProjectOptionsDialog (IdeApp.Workbench.RootWindow, selectedProject);
var conf = selectedProject.GetConfiguration (IdeApp.Workspace.ActiveConfiguration);
@@ -565,11 +631,11 @@ namespace MonoDevelop.Ide
if (MessageService.RunCustomDialog (optionsDialog) == (int)Gtk.ResponseType.Ok) {
foreach (object ob in optionsDialog.ModifiedObjects) {
if (ob is Solution) {
- Save ((Solution)ob);
+ await SaveAsync ((Solution)ob);
return;
}
}
- Save (selectedProject);
+ await SaveAsync (selectedProject);
IdeApp.Workspace.SavePreferences ();
IdeApp.Workbench.ReparseOpenDocuments ();
}
@@ -586,8 +652,8 @@ namespace MonoDevelop.Ide
if (panelId != null)
optionsDialog.SelectPanel (panelId);
if (MessageService.RunCustomDialog (optionsDialog) == (int) Gtk.ResponseType.Ok) {
- Save (solution);
- IdeApp.Workspace.SavePreferences (solution);
+ await SaveAsync (solution);
+ await IdeApp.Workspace.SavePreferences (solution);
}
} finally {
optionsDialog.Destroy ();
@@ -601,11 +667,11 @@ namespace MonoDevelop.Ide
optionsDialog.SelectPanel (panelId);
if (MessageService.RunCustomDialog (optionsDialog) == (int) Gtk.ResponseType.Ok) {
if (entry is IWorkspaceFileObject)
- Save ((IWorkspaceFileObject) entry);
+ await SaveAsync ((IWorkspaceFileObject) entry);
else {
- SolutionItem si = entry as SolutionItem;
+ SolutionFolderItem si = entry as SolutionFolderItem;
if (si.ParentSolution != null)
- Save (si.ParentSolution);
+ await SaveAsync (si.ParentSolution);
}
IdeApp.Workspace.SavePreferences ();
}
@@ -632,12 +698,12 @@ namespace MonoDevelop.Ide
newProjectDialog.Show ();
}
- public WorkspaceItem AddNewWorkspaceItem (Workspace parentWorkspace)
+ public Task<WorkspaceItem> AddNewWorkspaceItem (Workspace parentWorkspace)
{
return AddNewWorkspaceItem (parentWorkspace, null);
}
- public WorkspaceItem AddNewWorkspaceItem (Workspace parentWorkspace, string defaultItemId)
+ public async Task<WorkspaceItem> AddNewWorkspaceItem (Workspace parentWorkspace, string defaultItemId)
{
var newProjectDialog = new NewProjectDialogController ();
newProjectDialog.BasePath = parentWorkspace.BaseDirectory;
@@ -646,13 +712,13 @@ namespace MonoDevelop.Ide
if (newProjectDialog.Show () && newProjectDialog.NewItem != null) {
parentWorkspace.Items.Add ((WorkspaceItem)newProjectDialog.NewItem);
- Save (parentWorkspace);
+ await SaveAsync ((WorkspaceObject)parentWorkspace);
return (WorkspaceItem)newProjectDialog.NewItem;
}
return null;
}
- public WorkspaceItem AddWorkspaceItem (Workspace parentWorkspace)
+ public async Task<WorkspaceItem> AddWorkspaceItem (Workspace parentWorkspace)
{
WorkspaceItem res = null;
@@ -667,13 +733,12 @@ namespace MonoDevelop.Ide
if (dlg.Run ()) {
try {
-
if (WorkspaceContainsWorkspaceItem (parentWorkspace, dlg.SelectedFile)) {
MessageService.ShowMessage (GettextCatalog.GetString ("The workspace already contains '{0}'.", Path.GetFileNameWithoutExtension (dlg.SelectedFile)));
return res;
}
- res = AddWorkspaceItem (parentWorkspace, dlg.SelectedFile);
+ res = await AddWorkspaceItem (parentWorkspace, dlg.SelectedFile);
} catch (Exception ex) {
MessageService.ShowError (GettextCatalog.GetString ("The file '{0}' could not be loaded.", dlg.SelectedFile), ex);
}
@@ -687,19 +752,19 @@ namespace MonoDevelop.Ide
return workspace.Items.Any (existingWorkspaceItem => existingWorkspaceItem.FileName == workspaceItemFileName);
}
- public WorkspaceItem AddWorkspaceItem (Workspace parentWorkspace, string itemFileName)
+ public async Task<WorkspaceItem> AddWorkspaceItem (Workspace parentWorkspace, string itemFileName)
{
- using (IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
- WorkspaceItem it = Services.ProjectService.ReadWorkspaceItem (monitor, itemFileName);
+ using (ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
+ WorkspaceItem it = await Services.ProjectService.ReadWorkspaceItem (monitor, itemFileName);
if (it != null) {
parentWorkspace.Items.Add (it);
- Save (parentWorkspace);
+ await SaveAsync ((IWorkspaceFileObject)parentWorkspace);
}
return it;
}
}
- public SolutionItem CreateProject (SolutionFolder parentFolder)
+ public SolutionFolderItem CreateProject (SolutionFolder parentFolder)
{
string basePath = parentFolder != null ? parentFolder.BaseDirectory : null;
var newProjectDialog = new NewProjectDialogController ();
@@ -707,7 +772,7 @@ namespace MonoDevelop.Ide
newProjectDialog.BasePath = basePath;
if (newProjectDialog.Show ()) {
- var item = newProjectDialog.NewItem as SolutionItem;
+ var item = newProjectDialog.NewItem as SolutionFolderItem;
if ((item is Project) && ProjectCreated != null)
ProjectCreated (this, new ProjectCreatedEventArgs (item as Project));
return item;
@@ -715,9 +780,9 @@ namespace MonoDevelop.Ide
return null;
}
- public SolutionItem AddSolutionItem (SolutionFolder parentFolder)
+ public async Task<SolutionFolderItem> AddSolutionItem (SolutionFolder parentFolder)
{
- SolutionItem res = null;
+ SolutionFolderItem res = null;
var dlg = new SelectFileDialog () {
Action = FileChooserAction.Open,
@@ -740,14 +805,14 @@ namespace MonoDevelop.Ide
}
try {
- res = AddSolutionItem (parentFolder, dlg.SelectedFile);
+ res = await AddSolutionItem (parentFolder, dlg.SelectedFile);
} catch (Exception ex) {
MessageService.ShowError (GettextCatalog.GetString ("The file '{0}' could not be loaded.", dlg.SelectedFile), ex);
}
}
if (res != null)
- IdeApp.Workspace.Save ();
+ await IdeApp.Workspace.SaveAsync ();
return res;
}
@@ -758,15 +823,15 @@ namespace MonoDevelop.Ide
return solution.GetAllProjects ().Any (existingProject => existingProject.FileName == projectFileName);
}
- public SolutionItem AddSolutionItem (SolutionFolder folder, string entryFileName)
+ public async Task<SolutionFolderItem> AddSolutionItem (SolutionFolder folder, string entryFileName)
{
AddEntryEventArgs args = new AddEntryEventArgs (folder, entryFileName);
if (AddingEntryToCombine != null)
AddingEntryToCombine (this, args);
if (args.Cancel)
return null;
- using (IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
- return folder.AddItem (monitor, args.FileName, true);
+ using (ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
+ return await folder.AddItem (monitor, args.FileName, true);
}
}
@@ -815,21 +880,25 @@ namespace MonoDevelop.Ide
foreach (var reference in editEventArgs.ReferencesToAdd)
project.References.Add (reference);
+ selDialog.SetProject (null);
+
return editEventArgs.ReferencesToAdd.Count > 0 || editEventArgs.ReferencesToRemove.Count > 0;
}
- else
+ else {
+ selDialog.SetProject (null);
return false;
+ }
} finally {
selDialog.Hide ();
}
}
- public void RemoveSolutionItem (SolutionItem item)
+ public void RemoveSolutionItem (SolutionFolderItem item)
{
string question = GettextCatalog.GetString ("Do you really want to remove project '{0}' from '{1}'?", item.Name, item.ParentFolder.Name);
string secondaryText = GettextCatalog.GetString ("The Remove option remove the project from the solution, but it will not physically delete any file from disk.");
- SolutionEntityItem prj = item as SolutionEntityItem;
+ SolutionItem prj = item as SolutionItem;
if (prj == null) {
if (MessageService.Confirm (question, AlertButton.Remove) && IdeApp.Workspace.RequestItemUnload (item))
RemoveItemFromSolution (prj);
@@ -850,7 +919,7 @@ namespace MonoDevelop.Ide
RemoveItemFromSolution (prj);
List<FilePath> files = dlg.GetFilesToDelete ();
- using (IProgressMonitor monitor = new MessageDialogProgressMonitor (true)) {
+ using (ProgressMonitor monitor = new MessageDialogProgressMonitor (true)) {
monitor.BeginTask (GettextCatalog.GetString ("Deleting Files..."), files.Count);
foreach (FilePath file in files) {
try {
@@ -876,14 +945,14 @@ namespace MonoDevelop.Ide
}
}
- void RemoveItemFromSolution (SolutionItem prj)
+ void RemoveItemFromSolution (SolutionFolderItem prj)
{
foreach (var doc in IdeApp.Workbench.Documents.Where (d => d.Project == prj).ToArray ())
doc.Close ();
Solution sol = prj.ParentSolution;
prj.ParentFolder.Items.Remove (prj);
prj.Dispose ();
- IdeApp.ProjectOperations.Save (sol);
+ IdeApp.ProjectOperations.SaveAsync (sol);
}
/// <summary>
@@ -911,13 +980,13 @@ namespace MonoDevelop.Ide
public bool CanExecute (IBuildTarget entry)
{
- ExecutionContext context = new ExecutionContext (Runtime.ProcessService.DefaultExecutionHandler, IdeApp.Workbench.ProgressMonitors, IdeApp.Workspace.ActiveExecutionTarget);
+ ExecutionContext context = new ExecutionContext (Runtime.ProcessService.DefaultExecutionHandler, IdeApp.Workbench.ProgressMonitors.ConsoleFactory, IdeApp.Workspace.ActiveExecutionTarget);
return CanExecute (entry, context);
}
public bool CanExecute (IBuildTarget entry, IExecutionHandler handler)
{
- ExecutionContext context = new ExecutionContext (handler, IdeApp.Workbench.ProgressMonitors, IdeApp.Workspace.ActiveExecutionTarget);
+ ExecutionContext context = new ExecutionContext (handler, IdeApp.Workbench.ProgressMonitors.ConsoleFactory, IdeApp.Workspace.ActiveExecutionTarget);
return entry.CanExecute (context, IdeApp.Workspace.ActiveConfiguration);
}
@@ -926,44 +995,53 @@ namespace MonoDevelop.Ide
return entry.CanExecute (context, IdeApp.Workspace.ActiveConfiguration);
}
- public IAsyncOperation Execute (IBuildTarget entry)
+ public AsyncOperation Execute (IBuildTarget entry, bool buildBeforeExecuting = true)
{
- return Execute (entry, Runtime.ProcessService.DefaultExecutionHandler);
+ return Execute (entry, Runtime.ProcessService.DefaultExecutionHandler, buildBeforeExecuting);
}
- public IAsyncOperation Execute (IBuildTarget entry, IExecutionHandler handler)
+ public AsyncOperation Execute (IBuildTarget entry, IExecutionHandler handler, bool buildBeforeExecuting = true)
{
- ExecutionContext context = new ExecutionContext (handler, IdeApp.Workbench.ProgressMonitors, IdeApp.Workspace.ActiveExecutionTarget);
- return Execute (entry, context);
+ ExecutionContext context = new ExecutionContext (handler, IdeApp.Workbench.ProgressMonitors.ConsoleFactory, IdeApp.Workspace.ActiveExecutionTarget);
+ return Execute (entry, context, buildBeforeExecuting);
}
- public IAsyncOperation Execute (IBuildTarget entry, ExecutionContext context)
+ public AsyncOperation Execute (IBuildTarget entry, ExecutionContext context, bool buildBeforeExecuting = true)
{
if (currentRunOperation != null && !currentRunOperation.IsCompleted) return currentRunOperation;
- NullProgressMonitor monitor = new NullProgressMonitor ();
+ var cs = new CancellationTokenSource ();
+ return new AsyncOperation (ExecuteAsync (entry, context, cs, buildBeforeExecuting), cs);
+ }
- DispatchService.ThreadDispatch (delegate {
- ExecuteSolutionItemAsync (monitor, entry, context);
- });
- CurrentRunOperation = monitor.AsyncOperation;
+ async Task ExecuteAsync (IBuildTarget entry, ExecutionContext context, CancellationTokenSource cs, bool buildBeforeExecuting)
+ {
+ if (buildBeforeExecuting) {
+ if (!await CheckAndBuildForExecute (entry, context))
+ return;
+ }
+
+ ProgressMonitor monitor = new ProgressMonitor (cs);
+
+ var t = ExecuteSolutionItemAsync (monitor, entry, context);
+
+ var op = new AsyncOperation (t, cs);
+ CurrentRunOperation = op;
currentRunOperationOwner = entry;
- currentRunOperation.Completed += delegate {
- DispatchService.GuiDispatch (() => {
- var error = monitor.Errors.FirstOrDefault ();
- if (error != null)
- IdeApp.Workbench.StatusBar.ShowError (error.Message);
- currentRunOperationOwner = null;
- });
- };
- return currentRunOperation;
+
+ await t;
+
+ var error = monitor.Errors.FirstOrDefault ();
+ if (error != null)
+ IdeApp.Workbench.StatusBar.ShowError (error.Message);
+ currentRunOperationOwner = null;
}
- void ExecuteSolutionItemAsync (IProgressMonitor monitor, IBuildTarget entry, ExecutionContext context)
+ async Task ExecuteSolutionItemAsync (ProgressMonitor monitor, IBuildTarget entry, ExecutionContext context)
{
try {
OnBeforeStartProject ();
- entry.Execute (monitor, context, IdeApp.Workspace.ActiveConfiguration);
+ await entry.Execute (monitor, context, IdeApp.Workspace.ActiveConfiguration);
} catch (Exception ex) {
monitor.ReportError (GettextCatalog.GetString ("Execution failed."), ex);
LoggingService.LogError ("Execution failed", ex);
@@ -971,22 +1049,59 @@ namespace MonoDevelop.Ide
monitor.Dispose ();
}
}
-
- public IAsyncOperation Clean (IBuildTarget entry)
+
+ public bool CanExecuteFile (string file, IExecutionHandler handler)
+ {
+ ExecutionContext context = new ExecutionContext (handler, IdeApp.Workbench.ProgressMonitors.ConsoleFactory, IdeApp.Workspace.ActiveExecutionTarget);
+ return CanExecuteFile (file, context);
+ }
+
+ public bool CanExecuteFile (string file, ExecutionContext context)
+ {
+ var cmd = Runtime.ProcessService.CreateCommand (file);
+ if (context.ExecutionHandler.CanExecute (cmd))
+ return true;
+ return false;
+ }
+
+ public AsyncOperation ExecuteFile (string file, IExecutionHandler handler)
+ {
+ ExecutionContext context = new ExecutionContext (handler, IdeApp.Workbench.ProgressMonitors.ConsoleFactory, IdeApp.Workspace.ActiveExecutionTarget);
+ return ExecuteFile (file, context);
+ }
+
+ public AsyncOperation ExecuteFile (string file, ExecutionContext context)
+ {
+ var cmd = Runtime.ProcessService.CreateCommand (file);
+ if (context.ExecutionHandler.CanExecute (cmd))
+ return context.ExecutionHandler.Execute (cmd, context.ConsoleFactory.CreateConsole ());
+ else {
+ MessageService.ShowError(GettextCatalog.GetString ("No runnable executable found."));
+ return AsyncOperation.CompleteOperation;
+ }
+ }
+
+ public AsyncOperation Clean (IBuildTarget entry, OperationContext operationContext = null)
{
if (currentBuildOperation != null && !currentBuildOperation.IsCompleted) return currentBuildOperation;
ITimeTracker tt = Counters.BuildItemTimer.BeginTiming ("Cleaning " + entry.Name);
try {
- IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetCleanProgressMonitor ();
+ var cs = new CancellationTokenSource ();
+ ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetCleanProgressMonitor ().WithCancellationSource (cs);
+
OnStartClean (monitor, tt);
- DispatchService.ThreadDispatch (() => CleanAsync (entry, monitor, tt, false));
-
- currentBuildOperation = monitor.AsyncOperation;
- currentBuildOperationOwner = entry;
- currentBuildOperation.Completed += delegate {
+
+ var t = CleanAsync (entry, monitor, tt, false, operationContext);
+
+ t = t.ContinueWith (ta => {
currentBuildOperationOwner = null;
- };
+ return ta.Result;
+ });
+
+ var op = new AsyncOperation<BuildResult> (t, cs);
+ currentBuildOperation = op;
+ currentBuildOperationOwner = entry;
}
catch {
tt.End ();
@@ -996,17 +1111,12 @@ namespace MonoDevelop.Ide
return currentBuildOperation;
}
- void CleanAsync (IBuildTarget entry, IProgressMonitor monitor, ITimeTracker tt, bool isRebuilding)
+ async Task<BuildResult> CleanAsync (IBuildTarget entry, ProgressMonitor monitor, ITimeTracker tt, bool isRebuilding, OperationContext operationContext)
{
+ BuildResult res = null;
try {
tt.Trace ("Cleaning item");
- SolutionItem it = entry as SolutionItem;
- if (it != null) {
- it.Clean (monitor, IdeApp.Workspace.ActiveConfiguration);
- }
- else {
- entry.RunTarget (monitor, ProjectService.CleanTarget, IdeApp.Workspace.ActiveConfiguration);
- }
+ res = await entry.Clean (monitor, IdeApp.Workspace.ActiveConfiguration, operationContext);
} catch (Exception ex) {
monitor.ReportError (GettextCatalog.GetString ("Clean failed."), ex);
} finally {
@@ -1015,14 +1125,15 @@ namespace MonoDevelop.Ide
if (isRebuilding) {
if (EndClean != null) {
- DispatchService.GuiSyncDispatch (() => OnEndClean (monitor, tt));
+ OnEndClean (monitor, tt);
}
} else {
- DispatchService.GuiDispatch (() => CleanDone (monitor, entry, tt));
+ CleanDone (monitor, entry, tt);
}
+ return res;
}
- void CleanDone (IProgressMonitor monitor, IBuildTarget entry, ITimeTracker tt)
+ void CleanDone (ProgressMonitor monitor, IBuildTarget entry, ITimeTracker tt)
{
tt.Trace ("Begin reporting clean result");
try {
@@ -1036,144 +1147,93 @@ namespace MonoDevelop.Ide
tt.End ();
}
}
-
- public IAsyncOperation BuildFile (string file)
- {
- Project tempProject = MonoDevelop.Projects.Services.ProjectService.CreateSingleFileProject (file);
- if (tempProject != null) {
- IAsyncOperation aop = Build (tempProject);
- aop.Completed += delegate { tempProject.Dispose (); };
- return aop;
- } else {
- MessageService.ShowError (GettextCatalog.GetString ("The file {0} can't be compiled.", file));
- return NullAsyncOperation.Failure;
- }
- }
-
- public IAsyncOperation ExecuteFile (string file)
- {
- Project tempProject = MonoDevelop.Projects.Services.ProjectService.CreateSingleFileProject (file);
- if (tempProject != null) {
- IAsyncOperation aop = Execute (tempProject);
- aop.Completed += delegate { tempProject.Dispose (); };
- return aop;
- } else {
- MessageService.ShowError(GettextCatalog.GetString ("No runnable executable found."));
- return NullAsyncOperation.Failure;
- }
- }
-
- public bool CanExecuteFile (string file)
- {
- return CanExecuteFile (file, Runtime.ProcessService.DefaultExecutionHandler);
- }
-
- public bool CanExecuteFile (string file, IExecutionHandler handler)
- {
- ExecutionContext context = new ExecutionContext (handler, IdeApp.Workbench.ProgressMonitors, IdeApp.Workspace.ActiveExecutionTarget);
- return CanExecuteFile (file, context);
- }
-
- public bool CanExecuteFile (string file, ExecutionContext context)
- {
- Project tempProject = MonoDevelop.Projects.Services.ProjectService.CreateSingleFileProject (file);
- if (tempProject != null) {
- bool res = CanExecute (tempProject, context);
- tempProject.Dispose ();
- return res;
- }
- else {
- var cmd = Runtime.ProcessService.CreateCommand (file);
- if (context.ExecutionHandler.CanExecute (cmd))
- return true;
- }
- return false;
- }
-
- public IAsyncOperation ExecuteFile (string file, IExecutionHandler handler)
+
+ public AsyncOperation<BuildResult> Rebuild (Project project, ProjectOperationContext operationContext = null)
{
- ExecutionContext context = new ExecutionContext (handler, IdeApp.Workbench.ProgressMonitors, IdeApp.Workspace.ActiveExecutionTarget);
- return ExecuteFile (file, context);
+ return Rebuild ((IBuildTarget)project, operationContext);
}
-
- public IAsyncOperation ExecuteFile (string file, ExecutionContext context)
+
+ public AsyncOperation<BuildResult> Rebuild (IBuildTarget entry, OperationContext operationContext = null)
{
- Project tempProject = MonoDevelop.Projects.Services.ProjectService.CreateSingleFileProject (file);
- if (tempProject != null) {
- IAsyncOperation aop = Execute (tempProject, context);
- aop.Completed += delegate { tempProject.Dispose (); };
- return aop;
- } else {
- MessageService.ShowError(GettextCatalog.GetString ("No runnable executable found."));
- return NullAsyncOperation.Failure;
- }
+ if (currentBuildOperation != null && !currentBuildOperation.IsCompleted) return currentBuildOperation;
+
+ var cs = new CancellationTokenSource ();
+ ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetRebuildProgressMonitor ().WithCancellationSource (cs);
+
+ var t = RebuildAsync (entry, monitor, operationContext);
+ t = t.ContinueWith (ta => {
+ currentBuildOperationOwner = null;
+ return ta.Result;
+ });
+
+ var op = new AsyncOperation<BuildResult> (t, cs);
+
+ return currentBuildOperation = op;
}
- public IAsyncOperation Rebuild (IBuildTarget entry)
+ async Task<BuildResult> RebuildAsync (IBuildTarget entry, ProgressMonitor monitor, OperationContext operationContext)
{
- return Rebuild (entry, null);
- }
-
- public IAsyncOperation Rebuild (IBuildTarget entry, ProjectOperationContext context)
- {
- if (currentBuildOperation != null && !currentBuildOperation.IsCompleted) return currentBuildOperation;
-
ITimeTracker tt = Counters.BuildItemTimer.BeginTiming ("Rebuilding " + entry.Name);
try {
- IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetRebuildProgressMonitor ();
OnStartClean (monitor, tt);
- DispatchService.ThreadDispatch (delegate {
- CleanAsync (entry, monitor, tt, true);
- if (monitor.AsyncOperation.IsCompleted && !monitor.AsyncOperation.Success) {
- tt.End ();
- monitor.Dispose ();
- return;
- }
- if (StartBuild != null) {
- DispatchService.GuiSyncDispatch (() => BeginBuild (monitor, tt, true));
- }
- BuildSolutionItemAsync (entry, monitor, tt, context:context);
- }, null);
- currentBuildOperation = monitor.AsyncOperation;
- currentBuildOperationOwner = entry;
- currentBuildOperation.Completed += delegate { currentBuildOperationOwner = null; };
- } catch {
+ var res = await CleanAsync (entry, monitor, tt, true, operationContext);
+ if (res.HasErrors) {
+ tt.End ();
+ monitor.Dispose ();
+ return res;
+ }
+ if (StartBuild != null) {
+ BeginBuild (monitor, tt, true);
+ }
+ return await BuildSolutionItemAsync (entry, monitor, tt, operationContext:operationContext);
+ } finally {
tt.End ();
- throw;
}
- return currentBuildOperation;
}
- public IAsyncOperation CheckAndBuildForExecute (IBuildTarget executionTarget)
+ async Task<bool> CheckAndBuildForExecute (IBuildTarget executionTarget, ExecutionContext context)
{
if (currentBuildOperation != null && !currentBuildOperation.IsCompleted) {
- return new FinishBuildAndCheckAgainOperation (currentBuildOperation, () => CheckAndBuildForExecute (executionTarget));
+ var bres = await currentBuildOperation.Task;
+ if (bres.HasErrors || !IdeApp.Preferences.RunWithWarnings && bres.HasWarnings)
+ return false;
}
//saves open documents since it may dirty the "needs building" check
- var r = DoBeforeCompileAction ();
+ var r = await DoBeforeCompileAction ();
if (r.Failed)
- return NullAsyncOperation.Failure;
+ return false;
var configuration = IdeApp.Workspace.ActiveConfiguration;
var buildTarget = executionTarget;
- var ewo = buildTarget as IExecutableWorkspaceObject;
- if (ewo != null) {
- var buildDeps = ewo.GetExecutionDependencies ().ToList ();
- if (buildDeps.Count > 1)
- throw new NotImplementedException ("Multiple execution dependencies not yet supported");
+ var buildDeps = buildTarget.GetExecutionDependencies ().ToList ();
+ if (buildDeps.Count > 1)
+ throw new NotImplementedException ("Multiple execution dependencies not yet supported");
+ if (buildDeps.Count != 0)
buildTarget = buildDeps [0];
- }
bool needsBuild = FastCheckNeedsBuild (buildTarget, configuration);
if (!needsBuild) {
- return NullAsyncOperation.Success;
+ return true;
}
if (IdeApp.Preferences.BuildBeforeExecuting) {
- return new CheckAndBuildForExecuteOperation (Build (buildTarget, true));
+ // Building the project may take some time, so we call PrepareExecution so that the target can
+ // prepare the execution (for example, it could start a simulator).
+ var cs = new CancellationTokenSource ();
+ var prepareExecution = buildTarget.PrepareExecution (new ProgressMonitor ().WithCancellationSource (cs), context, configuration);
+ var result = await Build (buildTarget, true).Task;
+
+ if (result.HasErrors || (!IdeApp.Preferences.RunWithWarnings && result.HasWarnings)) {
+ cs.Cancel ();
+ return false;
+ }
+ else {
+ await prepareExecution;
+ return true;
+ }
}
var bBuild = new AlertButton (GettextCatalog.GetString ("Build"));
@@ -1191,172 +1251,43 @@ namespace MonoDevelop.Ide
DispatchService.RunPendingEvents ();
if (res == bRun) {
- return NullAsyncOperation.Success;
+ return true;
}
if (res == bBuild) {
- return new CheckAndBuildForExecuteOperation (Build (buildTarget, true));
- }
-
- return NullAsyncOperation.Failure;
- }
-
- class CheckAndBuildForExecuteOperation : IAsyncOperation
- {
- IAsyncOperation wrapped;
-
- public CheckAndBuildForExecuteOperation (IAsyncOperation wrapped)
- {
- this.wrapped = wrapped;
- }
-
- public event OperationHandler Completed {
- add { wrapped.Completed += value; }
- remove {wrapped.Completed -= value; }
- }
-
- public void Cancel ()
- {
- wrapped.Cancel ();
- }
-
- public void WaitForCompleted ()
- {
- wrapped.WaitForCompleted ();
- }
-
- public bool IsCompleted {
- get { return wrapped.IsCompleted; }
- }
-
- public bool Success {
- get { return wrapped.Success || (wrapped.SuccessWithWarnings && IdeApp.Preferences.RunWithWarnings); }
- }
-
- public bool SuccessWithWarnings {
- get { return false; }
- }
- }
-
- class FinishBuildAndCheckAgainOperation : IAsyncOperation
- {
- object locker = new object ();
- IAsyncOperation buildOp;
- IAsyncOperation checkOp;
- bool cancelled;
- OperationHandler completedEvt;
- System.Threading.ManualResetEvent completedSignal;
-
- public FinishBuildAndCheckAgainOperation (IAsyncOperation build, Func<IAsyncOperation> checkAgain)
- {
- buildOp = build;
- build.Completed += bop => {
- if (!bop.Success) {
- MarkCompleted (false);
- return;
- }
- bool alreadyCancelled;
- lock (locker) {
- alreadyCancelled = cancelled;
- if (!alreadyCancelled)
- checkOp = checkAgain ();
- }
-
- if (alreadyCancelled) {
- MarkCompleted (false);
- } else {
- checkOp.Completed += o => MarkCompleted (o.Success);
- }
- };
- }
-
- void MarkCompleted (bool success)
- {
- OperationHandler evt;
- System.Threading.ManualResetEvent signal;
-
- lock (locker) {
- evt = completedEvt;
- signal = completedSignal;
- IsCompleted = true;
- Success = success;
- }
-
- if (evt != null)
- evt (this);
-
- if (signal != null)
- signal.Set ();
- }
-
- public event OperationHandler Completed {
- add {
- bool alreadyCompleted;
- lock (locker) {
- completedEvt += value;
- alreadyCompleted = IsCompleted;
- }
- if (alreadyCompleted)
- value (this);
- }
- remove {
- lock (locker) {
- completedEvt -= value;
- }
- }
- }
-
- public void Cancel ()
- {
- buildOp.Cancel ();
-
- bool checkStarted;
- lock (locker) {
- cancelled = true;
- checkStarted = checkOp != null;
- }
-
- if (checkStarted) {
- checkOp.Cancel ();
+ // Building the project may take some time, so we call PrepareExecution so that the target can
+ // prepare the execution (for example, it could start a simulator).
+ var cs = new CancellationTokenSource ();
+ var prepareExecution = buildTarget.PrepareExecution (new ProgressMonitor ().WithCancellationSource (cs), context, configuration);
+ var result = await Build (buildTarget, true).Task;
+
+ if (result.HasErrors || (!IdeApp.Preferences.RunWithWarnings && result.HasWarnings)) {
+ cs.Cancel ();
+ return false;
}
- }
-
- public void WaitForCompleted ()
- {
- if (IsCompleted)
- return;
- lock (locker) {
- if (IsCompleted)
- return;
- if (completedSignal == null)
- completedSignal = new System.Threading.ManualResetEvent (false);
+ else {
+ await prepareExecution;
+ return true;
}
- completedSignal.WaitOne ();
}
- public bool IsCompleted { get; private set; }
-
- public bool Success { get; private set; }
-
- public bool SuccessWithWarnings {
- get { return false; }
- }
+ return false;
}
-
+
bool FastCheckNeedsBuild (IBuildTarget target, ConfigurationSelector configuration)
{
var env = Environment.GetEnvironmentVariable ("DisableFastUpToDateCheck");
if (!string.IsNullOrEmpty (env) && env != "0" && !env.Equals ("false", StringComparison.OrdinalIgnoreCase))
return true;
- var sei = target as SolutionEntityItem;
+ var sei = target as Project;
if (sei != null) {
if (sei.FastCheckNeedsBuild (configuration))
return true;
//TODO: respect solution level dependencies
var deps = new HashSet<SolutionItem> ();
CollectReferencedItems (sei, deps, configuration);
- foreach (var dep in deps.OfType<SolutionEntityItem> ()) {
+ foreach (var dep in deps.OfType<Project> ()) {
if (dep.FastCheckNeedsBuild (configuration))
return true;
}
@@ -1365,7 +1296,7 @@ namespace MonoDevelop.Ide
var sln = target as Solution;
if (sln != null) {
- foreach (var item in sln.GetAllSolutionItems<SolutionEntityItem> ()) {
+ foreach (var item in sln.GetAllProjects ()) {
if (item.FastCheckNeedsBuild (configuration))
return true;
}
@@ -1387,45 +1318,31 @@ namespace MonoDevelop.Ide
// bool errorPadInitialized = false;
- public IAsyncOperation Build (IBuildTarget entry)
+ public AsyncOperation<BuildResult> Build (Project project, CancellationToken? cancellationToken = null, ProjectOperationContext operationContext = null)
{
- return Build (entry, false);
+ return Build (project, false, cancellationToken, operationContext);
}
- public IAsyncOperation Build (IBuildTarget entry, ProjectOperationContext context)
+ public AsyncOperation<BuildResult> Build (IBuildTarget entry, CancellationToken? cancellationToken = null, OperationContext operationContext = null)
{
- return Build (entry, false, context);
+ return Build (entry, false, cancellationToken, operationContext);
}
- IAsyncOperation Build (IBuildTarget entry, bool skipPrebuildCheck, ProjectOperationContext context = null)
+ AsyncOperation<BuildResult> Build (IBuildTarget entry, bool skipPrebuildCheck, CancellationToken? cancellationToken = null, OperationContext operationContext = null)
{
if (currentBuildOperation != null && !currentBuildOperation.IsCompleted) return currentBuildOperation;
- /*
- if (!errorPadInitialized) {
- try {
- Pad errorsPad = IdeApp.Workbench.GetPad<MonoDevelop.Ide.Gui.Pads.ErrorListPad> ();
- errorsPad.Window.PadHidden += delegate {
- content.IsOpenedAutomatically = false;
- };
-
- Pad monitorPad = IdeApp.Workbench.Pads.FirstOrDefault (pad => pad.Content == ((OutputProgressMonitor)((AggregatedProgressMonitor)monitor).MasterMonitor).OutputPad);
- monitorPad.Window.PadHidden += delegate {
- monitorPad.IsOpenedAutomatically = false;
- };
- } finally {
- errorPadInitialized = true;
- }
- }
- */
-
+
ITimeTracker tt = Counters.BuildItemTimer.BeginTiming ("Building " + entry.Name);
try {
- IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetBuildProgressMonitor ();
+ var cs = new CancellationTokenSource ();
+ if (cancellationToken != null)
+ cs = CancellationTokenSource.CreateLinkedTokenSource (cs.Token, cancellationToken.Value);
+ ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetBuildProgressMonitor ().WithCancellationSource (cs);
BeginBuild (monitor, tt, false);
- DispatchService.ThreadDispatch (() => BuildSolutionItemAsync (entry, monitor, tt, skipPrebuildCheck, context));
- currentBuildOperation = monitor.AsyncOperation;
+ var t = BuildSolutionItemAsync (entry, monitor, tt, skipPrebuildCheck, operationContext);
+ currentBuildOperation = new AsyncOperation<BuildResult> (t, cs);
currentBuildOperationOwner = entry;
- currentBuildOperation.Completed += delegate { currentBuildOperationOwner = null; };
+ t.ContinueWith ((ta) => currentBuildOperationOwner = null);
} catch {
tt.End ();
throw;
@@ -1433,27 +1350,21 @@ namespace MonoDevelop.Ide
return currentBuildOperation;
}
- void BuildSolutionItemAsync (IBuildTarget entry, IProgressMonitor monitor, ITimeTracker tt, bool skipPrebuildCheck = false, ProjectOperationContext context = null)
+ async Task<BuildResult> BuildSolutionItemAsync (IBuildTarget entry, ProgressMonitor monitor, ITimeTracker tt, bool skipPrebuildCheck = false, OperationContext operationContext = null)
{
BuildResult result = null;
try {
if (!skipPrebuildCheck) {
tt.Trace ("Pre-build operations");
- result = DoBeforeCompileAction ();
+ result = await DoBeforeCompileAction ();
}
//wait for any custom tools that were triggered by the save, since the build may depend on them
- MonoDevelop.Ide.CustomTools.CustomToolService.WaitForRunningTools (monitor);
+ await MonoDevelop.Ide.CustomTools.CustomToolService.WaitForRunningTools (monitor);
if (skipPrebuildCheck || result.ErrorCount == 0) {
tt.Trace ("Building item");
- SolutionItem it = entry as SolutionItem;
- if (it != null)
- result = it.Build (monitor, IdeApp.Workspace.ActiveConfiguration, true, context);
- else if (entry is WorkspaceItem)
- result = ((WorkspaceItem)entry).Build (monitor, IdeApp.Workspace.ActiveConfiguration, context);
- else
- result = entry.RunTarget (monitor, ProjectService.BuildTarget, IdeApp.Workspace.ActiveConfiguration);
+ result = await entry.Build (monitor, IdeApp.Workspace.ActiveConfiguration, true, operationContext);
}
} catch (Exception ex) {
monitor.ReportError (GettextCatalog.GetString ("Build failed."), ex);
@@ -1465,14 +1376,14 @@ namespace MonoDevelop.Ide
} finally {
tt.Trace ("Done building");
}
- DispatchService.GuiDispatch (
- delegate {
- BuildDone (monitor, result, entry, tt); // BuildDone disposes the monitor
- });
+
+ BuildDone (monitor, result, entry, tt); // BuildDone disposes the monitor
+
+ return result;
}
// Note: This must run in the main thread
- void PromptForSave (BuildResult result)
+ async Task PromptForSave (BuildResult result)
{
var couldNotSaveError = "The build has been aborted as the file '{0}' could not be saved";
@@ -1482,7 +1393,7 @@ namespace MonoDevelop.Ide
GettextCatalog.GetString ("Some of the open documents have unsaved changes."),
AlertButton.BuildWithoutSave, AlertButton.Save) == AlertButton.Save) {
MarkFileDirty (doc.FileName);
- doc.Save ();
+ await doc.Save ();
if (doc.IsDirty)
result.AddError (string.Format (couldNotSaveError, Path.GetFileName (doc.FileName)), doc.FileName);
} else
@@ -1492,48 +1403,50 @@ namespace MonoDevelop.Ide
}
// Note: This must run in the main thread
- void SaveAllFiles (BuildResult result)
+ async Task SaveAllFiles (BuildResult result)
{
var couldNotSaveError = "The build has been aborted as the file '{0}' could not be saved";
foreach (var doc in new List<MonoDevelop.Ide.Gui.Document> (IdeApp.Workbench.Documents)) {
if (doc.IsDirty && doc.Project != null) {
- doc.Save ();
- if (doc.IsDirty)
+ await doc.Save ();
+ if (doc.IsDirty) {
+ doc.Select ();
result.AddError (string.Format (couldNotSaveError, Path.GetFileName (doc.FileName)), doc.FileName);
+ }
}
}
}
- BuildResult DoBeforeCompileAction ()
+ async Task<BuildResult> DoBeforeCompileAction ()
{
BeforeCompileAction action = IdeApp.Preferences.BeforeBuildSaveAction;
var result = new BuildResult ();
switch (action) {
case BeforeCompileAction.Nothing: break;
- case BeforeCompileAction.PromptForSave: DispatchService.GuiSyncDispatch (delegate { PromptForSave (result); }); break;
- case BeforeCompileAction.SaveAllFiles: DispatchService.GuiSyncDispatch (delegate { SaveAllFiles (result); }); break;
+ case BeforeCompileAction.PromptForSave: await PromptForSave (result); break;
+ case BeforeCompileAction.SaveAllFiles: await SaveAllFiles (result); break;
default: System.Diagnostics.Debug.Assert (false); break;
}
return result;
}
- void BeginBuild (IProgressMonitor monitor, ITimeTracker tt, bool isRebuilding)
+ void BeginBuild (ProgressMonitor monitor, ITimeTracker tt, bool isRebuilding)
{
tt.Trace ("Start build event");
if (!isRebuilding) {
- TaskService.Errors.ClearByOwner (this);
+ MonoDevelop.Ide.Tasks.TaskService.Errors.ClearByOwner (this);
}
if (StartBuild != null) {
StartBuild (this, new BuildEventArgs (monitor, true));
}
}
- void BuildDone (IProgressMonitor monitor, BuildResult result, IBuildTarget entry, ITimeTracker tt)
+ void BuildDone (ProgressMonitor monitor, BuildResult result, IBuildTarget entry, ITimeTracker tt)
{
- Task[] tasks = null;
+ TaskListEntry[] tasks = null;
tt.Trace ("Begin reporting build result");
try {
if (result != null) {
@@ -1542,9 +1455,9 @@ namespace MonoDevelop.Ide
monitor.Log.WriteLine (GettextCatalog.GetString ("---------------------- Done ----------------------"));
tt.Trace ("Updating task service");
- tasks = new Task [result.Errors.Count];
+ tasks = new TaskListEntry [result.Errors.Count];
for (int n=0; n<tasks.Length; n++) {
- tasks [n] = new Task (result.Errors [n]);
+ tasks [n] = new TaskListEntry (result.Errors [n]);
tasks [n].Owner = this;
}
@@ -1557,7 +1470,7 @@ namespace MonoDevelop.Ide
string errorString = GettextCatalog.GetPluralString("{0} error", "{0} errors", result.ErrorCount, result.ErrorCount);
string warningString = GettextCatalog.GetPluralString("{0} warning", "{0} warnings", result.WarningCount, result.WarningCount);
- if (monitor.IsCancelRequested) {
+ if (monitor.CancellationToken.IsCancellationRequested) {
monitor.ReportError (GettextCatalog.GetString ("Build canceled."), null);
} else if (result.ErrorCount == 0 && result.WarningCount == 0 && lastResult.FailedBuildCount == 0) {
monitor.ReportSuccess (GettextCatalog.GetString ("Build successful."));
@@ -1569,7 +1482,7 @@ namespace MonoDevelop.Ide
monitor.ReportError(GettextCatalog.GetString("Build failed."), null);
}
tt.Trace ("End build event");
- OnEndBuild (monitor, lastResult.FailedBuildCount == 0, lastResult, entry as SolutionItem);
+ OnEndBuild (monitor, lastResult.FailedBuildCount == 0, lastResult, entry as SolutionFolderItem);
} else {
tt.Trace ("End build event");
OnEndBuild (monitor, false);
@@ -1579,7 +1492,7 @@ namespace MonoDevelop.Ide
try {
Pad errorsPad = IdeApp.Workbench.GetPad<MonoDevelop.Ide.Gui.Pads.ErrorListPad> ();
- switch (IdeApp.Preferences.ShowErrorPadAfterBuild) {
+ switch (IdeApp.Preferences.ShowErrorPadAfterBuild.Value) {
case BuildResultStates.Always:
if (!errorsPad.Visible)
errorsPad.IsOpenedAutomatically = true;
@@ -1600,8 +1513,8 @@ namespace MonoDevelop.Ide
} catch {}
if (tasks != null) {
- Task jumpTask = null;
- switch (IdeApp.Preferences.JumpToFirstErrorOrWarning) {
+ TaskListEntry jumpTask = null;
+ switch (IdeApp.Preferences.JumpToFirstErrorOrWarning.Value) {
case JumpToFirst.Error:
jumpTask = tasks.FirstOrDefault (t => t.Severity == TaskSeverity.Error && TaskStore.IsProjectTaskFile (t));
break;
@@ -1721,7 +1634,7 @@ namespace MonoDevelop.Ide
bool dialogShown = false;
bool supportsLinking = !(project is MonoDevelop.Projects.SharedAssetsProjects.SharedAssetsProject);
- IProgressMonitor monitor = null;
+ ProgressMonitor monitor = null;
if (files.Length > 10) {
monitor = new MessageDialogProgressMonitor (true);
@@ -1890,13 +1803,13 @@ namespace MonoDevelop.Ide
return true;
}
- public void TransferFiles (IProgressMonitor monitor, Project sourceProject, FilePath sourcePath, Project targetProject,
+ public void TransferFiles (ProgressMonitor monitor, Project sourceProject, FilePath sourcePath, Project targetProject,
FilePath targetPath, bool removeFromSource, bool copyOnlyProjectFiles)
{
TransferFilesInternal (monitor, sourceProject, sourcePath, targetProject, targetPath, removeFromSource, copyOnlyProjectFiles);
}
- internal static void TransferFilesInternal (IProgressMonitor monitor, Project sourceProject, FilePath sourcePath, Project targetProject,
+ internal static void TransferFilesInternal (ProgressMonitor monitor, Project sourceProject, FilePath sourcePath, Project targetProject,
FilePath targetPath, bool removeFromSource, bool copyOnlyProjectFiles)
{
// When transfering directories, targetPath is the directory where the source
@@ -2182,7 +2095,7 @@ namespace MonoDevelop.Ide
}
}
- void OnEndBuild (IProgressMonitor monitor, bool success, BuildResult result = null, SolutionItem item = null)
+ void OnEndBuild (ProgressMonitor monitor, bool success, BuildResult result = null, SolutionFolderItem item = null)
{
if (EndBuild == null)
return;
@@ -2199,7 +2112,7 @@ namespace MonoDevelop.Ide
EndBuild (this, args);
}
- void OnStartClean (IProgressMonitor monitor, ITimeTracker tt)
+ void OnStartClean (ProgressMonitor monitor, ITimeTracker tt)
{
tt.Trace ("Start clean event");
TaskService.Errors.ClearByOwner (this);
@@ -2208,7 +2121,7 @@ namespace MonoDevelop.Ide
}
}
- void OnEndClean (IProgressMonitor monitor, ITimeTracker tt)
+ void OnEndClean (ProgressMonitor monitor, ITimeTracker tt)
{
tt.Trace ("End clean event");
if (EndClean != null) {
@@ -2237,7 +2150,7 @@ namespace MonoDevelop.Ide
CurrentSelectedSolutionItem = null;
if (ContainsTarget (args.Item, currentWorkspaceItem))
CurrentSelectedWorkspaceItem = null;
- if ((currentItem is IBuildTarget) && ContainsTarget (args.Item, ((IBuildTarget)currentItem)))
+ if ((currentItem is IBuildTarget) && ContainsTarget (args.Item, ((WorkspaceObject)currentItem)))
CurrentSelectedItem = null;
}
@@ -2283,12 +2196,17 @@ namespace MonoDevelop.Ide
class ParseProgressMonitorFactory: IProgressMonitorFactory
{
- public IProgressMonitor CreateProgressMonitor ()
+ public ProgressMonitor CreateProgressMonitor ()
{
return new BackgroundProgressMonitor (GettextCatalog.GetString ("Code completion database generation"), "md-parser");
}
}
-
+
+ public interface ITextFileProvider
+ {
+ ITextDocument GetEditableTextFile (FilePath filePath);
+ }
+
public class TextFileProvider : ITextFileProvider
{
static TextFileProvider instance = new TextFileProvider ();
@@ -2301,101 +2219,19 @@ namespace MonoDevelop.Ide
TextFileProvider ()
{
}
-
- class ProviderProxy : ITextEditorDataProvider, IEditableTextFile
- {
- TextEditorData data;
- string encoding;
- bool bom;
-
- public ProviderProxy (TextEditorData data, string encoding, bool bom)
- {
- this.data = data;
- this.encoding = encoding;
- this.bom = bom;
- }
-
- public TextEditorData GetTextEditorData ()
- {
- return data;
- }
-
- void Save ()
- {
- TextFile.WriteFile (Name, Text, encoding, bom);
- }
-
- #region IEditableTextFile implementation
- public FilePath Name { get { return data.Document.FileName; } }
- public int Length { get { return data.Length; } }
-
- public string GetText (int startPosition, int endPosition)
- {
- return data.GetTextBetween (startPosition, endPosition);
- }
-
- public char GetCharAt (int position)
- {
- return data.GetCharAt (position);
- }
-
- public int GetPositionFromLineColumn (int line, int column)
- {
- return data.Document.LocationToOffset (line, column);
- }
-
- public void GetLineColumnFromPosition (int position, out int line, out int column)
- {
- var loc = data.Document.OffsetToLocation (position);
- line = loc.Line;
- column = loc.Column;
- }
-
- public int InsertText (int position, string text)
- {
- int result = data.Insert (position, text);
- Save ();
-
- return result;
- }
-
- public void DeleteText (int position, int length)
- {
- data.Remove (position, length);
- Save ();
- }
-
- public string Text {
- get {
- return data.Text;
- }
- set {
- data.Text = value;
- Save ();
- }
- }
-
- #endregion
- }
-
- public IEditableTextFile GetEditableTextFile (FilePath filePath)
+ public ITextDocument GetEditableTextFile (FilePath filePath)
{
if (IdeApp.IsInitialized) {
foreach (var doc in IdeApp.Workbench.Documents) {
if (doc.FileName == filePath) {
- IEditableTextFile ef = doc.GetContent<IEditableTextFile> ();
+ var ef = doc.Editor;
if (ef != null) return ef;
}
}
}
-
- TextFile file = TextFile.ReadFile (filePath);
- TextEditorData data = new TextEditorData ();
- data.Document.FileName = filePath;
- data.Text = file.Text;
-
- return new ProviderProxy (data, file.SourceEncoding, file.HadBOM);
+
+ return TextEditorFactory.CreateNewDocument (StringTextSource.ReadFrom (filePath), filePath);
}
/// <summary>
@@ -2404,18 +2240,16 @@ namespace MonoDevelop.Ide
/// <returns><c>true</c>, if file operation was saved, <c>false</c> otherwise.</returns>
/// <param name="filePath">File path.</param>
/// <param name="operation">The operation.</param>
- public bool EditFile (FilePath filePath, Action<TextEditorData> operation)
+ public bool EditFile (FilePath filePath, Action<ITextDocument> operation)
{
if (operation == null)
throw new ArgumentNullException ("operation");
- bool hadBom;
- Encoding encoding;
bool isOpen;
- var data = GetTextEditorData (filePath, out hadBom, out encoding, out isOpen);
+ var data = GetTextEditorData (filePath, out isOpen);
operation (data);
if (!isOpen) {
- try {
- Mono.TextEditor.Utils.TextFileUtility.WriteText (filePath, data.Text, encoding, hadBom);
+ try {
+ data.Save ();
} catch (Exception e) {
LoggingService.LogError ("Error while saving changes to : " + filePath, e);
return false;
@@ -2424,13 +2258,13 @@ namespace MonoDevelop.Ide
return true;
}
- public TextEditorData GetTextEditorData (FilePath filePath)
+ public ITextDocument GetTextEditorData (FilePath filePath)
{
bool isOpen;
return GetTextEditorData (filePath, out isOpen);
}
- public TextEditorData GetReadOnlyTextEditorData (FilePath filePath)
+ public IReadonlyTextDocument GetReadOnlyTextEditorData (FilePath filePath)
{
if (filePath.IsNullOrEmpty)
throw new ArgumentNullException ("filePath");
@@ -2439,42 +2273,29 @@ namespace MonoDevelop.Ide
return doc.Editor;
}
}
- bool hadBom;
- Encoding encoding;
- var text = Mono.TextEditor.Utils.TextFileUtility.ReadAllText (filePath, out hadBom, out encoding);
- var data = new TextEditorData (TextDocument.CreateImmutableDocument (text));
- data.Document.MimeType = DesktopService.GetMimeTypeForUri (filePath);
- data.Document.FileName = filePath;
- data.Text = text;
+ var data = TextEditorFactory.CreateNewReadonlyDocument (StringTextSource.ReadFrom (filePath), filePath);
return data;
}
- public TextEditorData GetTextEditorData (FilePath filePath, out bool isOpen)
- {
- bool hadBom;
- Encoding encoding;
- return GetTextEditorData (filePath, out hadBom, out encoding, out isOpen);
- }
-
- public TextEditorData GetTextEditorData (FilePath filePath, out bool hadBom, out Encoding encoding, out bool isOpen)
+ public ITextDocument GetTextEditorData (FilePath filePath, out bool isOpen)
{
- foreach (var doc in IdeApp.Workbench.Documents) {
- if (doc.FileName == filePath) {
- var content = doc.GetContent <MonoDevelop.Ide.Gui.Content.IEncodedTextContent> ();
- var theEncoding = content != null ? content.SourceEncoding : null;
-
- isOpen = true;
- hadBom = false;
- encoding = theEncoding ?? Encoding.Default;
- return doc.Editor;
+ if (IdeApp.Workbench != null) {
+ foreach (var doc in IdeApp.Workbench.Documents) {
+ if (doc.FileName == filePath) {
+ isOpen = true;
+ return doc.Editor;
+ }
}
}
- var text = Mono.TextEditor.Utils.TextFileUtility.ReadAllText (filePath, out hadBom, out encoding);
- TextEditorData data = new TextEditorData ();
- data.Document.SuppressHighlightUpdate = true;
- data.Document.MimeType = DesktopService.GetMimeTypeForUri (filePath);
- data.Document.FileName = filePath;
+ bool hadBom;
+ Encoding encoding;
+ var text = TextFileUtility.ReadAllText (filePath, out hadBom, out encoding);
+ var data = TextEditorFactory.CreateNewDocument ();
+ data.UseBOM = hadBom;
+ data.Encoding = encoding;
+ data.MimeType = DesktopService.GetMimeTypeForUri (filePath);
+ data.FileName = filePath;
data.Text = text;
isOpen = false;
return data;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs
index c18aa74bb2..f197f6408b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs
@@ -43,51 +43,26 @@ using MonoDevelop.Core.Instrumentation;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Projects;
using MonoDevelop.Core.Execution;
+using System.Threading.Tasks;
namespace MonoDevelop.Ide
{
- public class RootWorkspace: IBuildTarget, IWorkspaceObject
+ public sealed class RootWorkspace: WorkspaceObject, IBuildTarget
{
- WorkspaceItemCollection items;
+ RootWorkspaceItemCollection items;
// IParserDatabase parserDatabase;
string activeConfiguration;
bool useDefaultRuntime;
- ProjectFileEventHandler fileAddedToProjectHandler;
- ProjectFileEventHandler fileRemovedFromProjectHandler;
- ProjectFileRenamedEventHandler fileRenamedInProjectHandler;
- ProjectFileEventHandler fileChangedInProjectHandler;
- ProjectFileEventHandler filePropertyChangedInProjectHandler;
- ProjectReferenceEventHandler referenceAddedToProjectHandler;
- ProjectReferenceEventHandler referenceRemovedFromProjectHandler;
- SolutionItemChangeEventHandler itemAddedToSolutionHandler;
- SolutionItemChangeEventHandler itemRemovedFromSolutionHandler;
- EventHandler<WorkspaceItemChangeEventArgs> descendantItemAddedHandler;
- EventHandler<WorkspaceItemChangeEventArgs> descendantItemRemovedHandler;
- EventHandler configurationsChanged;
-
internal RootWorkspace ()
{
- fileAddedToProjectHandler = (ProjectFileEventHandler) DispatchService.GuiDispatch (new ProjectFileEventHandler (NotifyFileAddedToProject));
- fileRemovedFromProjectHandler = (ProjectFileEventHandler) DispatchService.GuiDispatch (new ProjectFileEventHandler (NotifyFileRemovedFromProject));
- fileRenamedInProjectHandler = (ProjectFileRenamedEventHandler) DispatchService.GuiDispatch (new ProjectFileRenamedEventHandler (NotifyFileRenamedInProject));
- fileChangedInProjectHandler = (ProjectFileEventHandler) DispatchService.GuiDispatch (new ProjectFileEventHandler (NotifyFileChangedInProject));
- filePropertyChangedInProjectHandler = (ProjectFileEventHandler) DispatchService.GuiDispatch (new ProjectFileEventHandler (NotifyFilePropertyChangedInProject));
- referenceAddedToProjectHandler = (ProjectReferenceEventHandler) DispatchService.GuiDispatch (new ProjectReferenceEventHandler (NotifyReferenceAddedToProject));
- referenceRemovedFromProjectHandler = (ProjectReferenceEventHandler) DispatchService.GuiDispatch (new ProjectReferenceEventHandler (NotifyReferenceRemovedFromProject));
-
- itemAddedToSolutionHandler = (SolutionItemChangeEventHandler) DispatchService.GuiDispatch (new SolutionItemChangeEventHandler (NotifyItemAddedToSolution));
- itemRemovedFromSolutionHandler = (SolutionItemChangeEventHandler) DispatchService.GuiDispatch (new SolutionItemChangeEventHandler (NotifyItemRemovedFromSolution));
-
- descendantItemAddedHandler = (EventHandler<WorkspaceItemChangeEventArgs>) DispatchService.GuiDispatch (new EventHandler<WorkspaceItemChangeEventArgs> (NotifyDescendantItemAdded));
- descendantItemRemovedHandler = (EventHandler<WorkspaceItemChangeEventArgs>) DispatchService.GuiDispatch (new EventHandler<WorkspaceItemChangeEventArgs> (NotifyDescendantItemRemoved));
- configurationsChanged = (EventHandler) DispatchService.GuiDispatch (new EventHandler (NotifyConfigurationsChanged));
-
- FileService.FileRenamed += (EventHandler<FileCopyEventArgs>) DispatchService.GuiDispatch (new EventHandler<FileCopyEventArgs> (CheckFileRename));
+ items = new RootWorkspaceItemCollection (this);
+
+ FileService.FileRenamed += CheckFileRename;
// Set the initial active runtime
UseDefaultRuntime = true;
- IdeApp.Preferences.DefaultTargetRuntimeChanged += delegate {
+ IdeApp.Preferences.DefaultTargetRuntime.Changed += delegate {
// If the default runtime changes and current active is default, update it
if (UseDefaultRuntime) {
Runtime.SystemAssemblyService.DefaultRuntime = IdeApp.Preferences.DefaultTargetRuntime;
@@ -95,13 +70,11 @@ namespace MonoDevelop.Ide
}
};
- FileService.FileChanged += (EventHandler<FileEventArgs>) DispatchService.GuiDispatch (new EventHandler<FileEventArgs> (CheckWorkspaceItems));;
+ FileService.FileChanged += CheckWorkspaceItems;
}
- public WorkspaceItemCollection Items {
+ public RootWorkspaceItemCollection Items {
get {
- if (items == null)
- items = new RootWorkspaceItemCollection (this, 256);
return items;
}
}
@@ -181,108 +154,53 @@ namespace MonoDevelop.Ide
get { return Items.Count > 0; }
}
- IDictionary IExtendedDataItem.ExtendedProperties {
- get {
- throw new NotSupportedException ("Root namespace can't have extended properties.");
- }
+ [ThreadSafe]
+ protected override string OnGetName ()
+ {
+ return "MonoDevelop Workspace";
}
- string IWorkspaceObject.Name {
- get {
- return "MonoDevelop Workspace";
- }
- set {
- throw new NotSupportedException ("Can't change the name of the root workspace.");
- }
+ protected override string OnGetBaseDirectory ()
+ {
+ return IdeApp.Preferences.ProjectsDefaultPath;
}
- public FilePath BaseDirectory {
- get {
- return IdeApp.ProjectOperations.ProjectsDefaultPath;
- }
- }
-
- FilePath IWorkspaceObject.BaseDirectory {
- get {
- return BaseDirectory;
- }
- set {
- throw new NotSupportedException ();
- }
- }
-
- FilePath IWorkspaceObject.ItemDirectory {
- get {
- return BaseDirectory;
- }
+ protected override string OnGetItemDirectory ()
+ {
+ return BaseDirectory;
}
-
-#region Model queries
-
- public SolutionEntityItem FindSolutionItem (string fileName)
+
+ protected override IEnumerable<WorkspaceObject> OnGetChildren ()
{
- foreach (WorkspaceItem it in Items) {
- SolutionEntityItem si = it.FindSolutionItem (fileName);
- if (si != null)
- return si;
- }
- return null;
+ return Items;
}
-
- public ReadOnlyCollection<SolutionItem> GetAllSolutionItems ()
+
+ public IEnumerable<IBuildTarget> GetExecutionDependencies ()
{
- return GetAllSolutionItems<SolutionItem> ();
+ if (IdeApp.ProjectOperations.CurrentSelectedSolution != null)
+ return IdeApp.ProjectOperations.CurrentSelectedSolution.GetExecutionDependencies ();
+ else
+ return new IBuildTarget [0];
}
+
+
+#region Model queries
- public virtual ReadOnlyCollection<T> GetAllSolutionItems<T> () where T: SolutionItem
+ public IEnumerable<SolutionItem> GetAllSolutionItems ()
{
- List<T> list = new List<T> ();
- foreach (WorkspaceItem it in Items) {
- list.AddRange (it.GetAllSolutionItems<T> ());
- }
- return list.AsReadOnly ();
+ return GetAllItems<SolutionItem> ();
}
- public ReadOnlyCollection<Project> GetAllProjects ()
+ public IEnumerable<Project> GetAllProjects ()
{
- return GetAllSolutionItems<Project> ();
+ return GetAllItems<Project> ();
}
- public ReadOnlyCollection<Solution> GetAllSolutions ()
+ public IEnumerable<Solution> GetAllSolutions ()
{
return GetAllItems<Solution> ();
}
- public ReadOnlyCollection<T> GetAllItems<T> () where T:WorkspaceItem
- {
- List<T> list = new List<T> ();
- foreach (WorkspaceItem it in Items)
- GetAllItems<T> (list, it);
- return list.AsReadOnly ();
- }
-
- void GetAllItems<T> (List<T> list, WorkspaceItem item) where T: WorkspaceItem
- {
- if (item is T)
- list.Add ((T) item);
-
- if (item is Workspace) {
- foreach (WorkspaceItem citem in ((Workspace)item).Items)
- GetAllItems<T> (list, citem);
- }
- }
-
- [Obsolete("Use GetProjectsContainingFile() (plural) instead")]
- public Project GetProjectContainingFile (string fileName)
- {
- foreach (WorkspaceItem it in Items) {
- Project p = it.GetProjectContainingFile (fileName);
- if (p != null)
- return p;
- }
- return null;
- }
-
public IEnumerable<Project> GetProjectsContainingFile (string fileName)
{
foreach (WorkspaceItem it in Items) {
@@ -296,11 +214,11 @@ namespace MonoDevelop.Ide
#region Build and run operations
- public void Save ()
+ public async Task SaveAsync ()
{
- IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetSaveProgressMonitor (true);
+ ProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetSaveProgressMonitor (true);
try {
- Save (monitor);
+ await SaveAsync (monitor);
monitor.ReportSuccess (GettextCatalog.GetString ("Workspace saved."));
} catch (Exception ex) {
monitor.ReportError (GettextCatalog.GetString ("Save failed."), ex);
@@ -308,34 +226,10 @@ namespace MonoDevelop.Ide
monitor.Dispose ();
}
}
-
- public IAsyncOperation Build ()
- {
- return IdeApp.ProjectOperations.Build (this);
- }
- public void Clean ()
+ bool IBuildTarget.CanBuild (ConfigurationSelector configuration)
{
- IdeApp.ProjectOperations.Clean (this);
- }
-
- public IAsyncOperation Execute ()
- {
- if (IdeApp.ProjectOperations.CurrentSelectedSolution != null)
- return IdeApp.ProjectOperations.Execute (IdeApp.ProjectOperations.CurrentSelectedSolution);
- else {
- MessageService.ShowError (GettextCatalog.GetString ("No solution has been selected"), GettextCatalog.GetString ("The solution to be executed must be selected in the solution pad."));
- return null;
- }
- }
-
- public bool CanExecute ()
- {
- if (IdeApp.ProjectOperations.CurrentSelectedSolution != null)
- return IdeApp.ProjectOperations.CanExecute (IdeApp.ProjectOperations.CurrentSelectedSolution);
- else {
- return false;
- }
+ return true;
}
bool IBuildTarget.CanExecute (ExecutionContext context, ConfigurationSelector configuration)
@@ -347,27 +241,23 @@ namespace MonoDevelop.Ide
}
}
- public void Dispose ()
- {
- }
-
- public void Save (IProgressMonitor monitor)
+ public async Task SaveAsync (ProgressMonitor monitor)
{
monitor.BeginTask (GettextCatalog.GetString ("Saving Workspace..."), Items.Count);
List<WorkspaceItem> items = new List<WorkspaceItem> (Items);
foreach (WorkspaceItem it in items) {
- it.Save (monitor);
+ await it.SaveAsync (monitor);
monitor.Step (1);
}
monitor.EndTask ();
}
- BuildResult IBuildTarget.RunTarget (IProgressMonitor monitor, string target, ConfigurationSelector configuration)
+ async Task<BuildResult> IBuildTarget.Build (ProgressMonitor monitor, ConfigurationSelector configuration, bool buildReferences, OperationContext operationContext)
{
BuildResult result = null;
- List<WorkspaceItem> items = new List<WorkspaceItem> (Items);
- foreach (WorkspaceItem it in items.Where (i => i.SupportsTarget (target))) {
- BuildResult res = it.RunTarget (monitor, target, configuration);
+ var items = Items.OfType<IBuildTarget> ().ToList ();
+ foreach (var it in items) {
+ BuildResult res = await it.Build (monitor, configuration, buildReferences, operationContext);
if (res != null) {
if (result == null)
result = new BuildResult ();
@@ -377,25 +267,31 @@ namespace MonoDevelop.Ide
return result;
}
- bool IBuildTarget.SupportsTarget (string target)
+ async Task<BuildResult> IBuildTarget.Clean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
- foreach (WorkspaceItem it in Items.ToArray ()) {
- if (it.SupportsTarget (target))
- return true;
+ BuildResult result = null;
+ var items = Items.OfType<IBuildTarget> ().ToList ();
+ foreach (var it in items) {
+ BuildResult res = await it.Clean (monitor, configuration, operationContext);
+ if (res != null) {
+ if (result == null)
+ result = new BuildResult ();
+ result.Append (res);
+ }
}
- return false;
+ return result;
}
- public void Execute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ Task IBuildTarget.PrepareExecution (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
{
- Solution sol = IdeApp.ProjectOperations.CurrentSelectedSolution;
- if (sol == null) {
- ReadOnlyCollection<Solution> sols = GetAllSolutions ();
- if (sols.Count > 0)
- sol = sols [0];
- }
+ return Task.FromResult (0);
+ }
+
+ public Task Execute (ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
+ {
+ Solution sol = IdeApp.ProjectOperations.CurrentSelectedSolution ?? GetAllSolutions ().FirstOrDefault ();
if (sol != null)
- sol.Execute (monitor, context, configuration);
+ return sol.Execute (monitor, context, configuration);
else
throw new UserException (GettextCatalog.GetString ("No solution has been selected."));
}
@@ -508,7 +404,7 @@ namespace MonoDevelop.Ide
if (RequestItemUnload (item)) {
if (closeItemFiles) {
- var projects = item.GetAllProjects ();
+ var projects = item.GetAllItems<Project> ();
foreach (Document doc in IdeApp.Workbench.Documents.Where (d => d.Project != null && projects.Contains (d.Project)).ToArray ()) {
if (!doc.Close ())
return;
@@ -519,7 +415,7 @@ namespace MonoDevelop.Ide
}
}
- public bool RequestItemUnload (IBuildTarget item)
+ public bool RequestItemUnload (WorkspaceObject item)
{
if (ItemUnloading != null) {
try {
@@ -533,154 +429,152 @@ namespace MonoDevelop.Ide
return true;
}
- IAsyncOperation openingItemOper;
+ System.Threading.CancellationTokenSource openingItemCancellationSource;
internal bool WorkspaceItemIsOpening {
- get { return openingItemOper != null && !openingItemOper.IsCompleted; }
+ get { return openingItemCancellationSource != null; }
}
- public IAsyncOperation OpenWorkspaceItem (FilePath file)
+ public Task<bool> OpenWorkspaceItem (FilePath file)
{
return OpenWorkspaceItem (file, true);
}
- public IAsyncOperation OpenWorkspaceItem (FilePath file, bool closeCurrent)
+ public Task<bool> OpenWorkspaceItem (FilePath file, bool closeCurrent)
{
return OpenWorkspaceItem (file, closeCurrent, true);
}
- public IAsyncOperation OpenWorkspaceItem (FilePath file, bool closeCurrent, bool loadPreferences)
+ public async Task<bool> OpenWorkspaceItem (FilePath file, bool closeCurrent, bool loadPreferences)
{
- if (openingItemOper != null && !openingItemOper.IsCompleted && closeCurrent)
- openingItemOper.Cancel ();
+ if (openingItemCancellationSource != null && closeCurrent) {
+ openingItemCancellationSource.Cancel ();
+ openingItemCancellationSource = null;
+ }
var item = GetAllItems<WorkspaceItem> ().FirstOrDefault (w => w.FileName == file.FullPath);
if (item != null) {
IdeApp.ProjectOperations.CurrentSelectedWorkspaceItem = item;
IdeApp.Workbench.StatusBar.ShowWarning (GettextCatalog.GetString ("{0} is already opened", item.FileName.FileName));
- return MonoDevelop.Core.ProgressMonitoring.NullAsyncOperation.Success;
+ return true;
}
if (closeCurrent) {
if (!Close ())
- return MonoDevelop.Core.ProgressMonitoring.NullAsyncOperation.Failure;
+ return false;
}
var monitor = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true);
bool reloading = IsReloading;
- var oper = monitor.AsyncOperation;
- openingItemOper = oper;
- oper.Completed += delegate {
- if (oper == openingItemOper)
- openingItemOper = null;
- };
- IdeApp.Workbench.LockGui ();
+ var cancellationSource = openingItemCancellationSource = new System.Threading.CancellationTokenSource ();
+ monitor = monitor.WithCancellationSource (cancellationSource);
- DispatchService.BackgroundDispatch (delegate {
- BackgroundLoadWorkspace (monitor, file, loadPreferences, reloading);
- });
- return oper;
+ IdeApp.Workbench.LockGui ();
+ ITimeTracker timer = Counters.OpenWorkspaceItemTimer.BeginTiming ();
+ try {
+ var oper = BackgroundLoadWorkspace (monitor, file, loadPreferences, reloading, timer);
+ return await oper;
+ } finally {
+ timer.End ();
+ monitor.Dispose ();
+ IdeApp.Workbench.UnlockGui ();
+ if (openingItemCancellationSource == cancellationSource)
+ openingItemCancellationSource = null;
+ }
}
void ReattachDocumentProjects (IEnumerable<string> closedDocs)
{
foreach (Document doc in IdeApp.Workbench.Documents) {
if (doc.Project == null && doc.IsFile) {
- Project p = GetProjectContainingFile (doc.FileName);
+ Project p = GetProjectsContainingFile (doc.FileName).FirstOrDefault ();
if (p != null)
doc.SetProject (p);
}
}
if (closedDocs != null) {
foreach (string doc in closedDocs) {
- IdeApp.Workbench.OpenDocument (doc, false);
+ IdeApp.Workbench.OpenDocument (doc, null, false);
}
}
}
- void BackgroundLoadWorkspace (IProgressMonitor monitor, FilePath file, bool loadPreferences, bool reloading)
+ async Task<bool> BackgroundLoadWorkspace (ProgressMonitor monitor, FilePath file, bool loadPreferences, bool reloading, ITimeTracker timer)
{
WorkspaceItem item = null;
- ITimeTracker timer = Counters.OpenWorkspaceItemTimer.BeginTiming ();
-
+
try {
if (reloading)
SetReloading (true);
if (!File.Exists (file)) {
monitor.ReportError (GettextCatalog.GetString ("File not found: {0}", file), null);
- monitor.Dispose ();
- return;
+ return false;
}
if (!Services.ProjectService.IsWorkspaceItemFile (file)) {
if (!Services.ProjectService.IsSolutionItemFile (file)) {
monitor.ReportError (GettextCatalog.GetString ("File is not a project or solution: {0}", file), null);
- monitor.Dispose ();
- return;
+ return false;
}
-
+
// It is a project, not a solution. Try to create a dummy solution and add the project to it
timer.Trace ("Getting wrapper solution");
- item = IdeApp.Services.ProjectService.GetWrapperSolution (monitor, file.ToString());
+ item = await IdeApp.Services.ProjectService.GetWrapperSolution (monitor, file);
}
if (item == null) {
timer.Trace ("Reading item");
- item = Services.ProjectService.ReadWorkspaceItem (monitor, file);
- if (monitor.IsCancelRequested) {
- monitor.Dispose ();
- return;
- }
+ item = await Services.ProjectService.ReadWorkspaceItem (monitor, file);
+ if (monitor.CancellationToken.IsCancellationRequested)
+ return false;
}
timer.Trace ("Registering to recent list");
DesktopService.RecentFiles.AddProject (item.FileName, item.Name);
} catch (Exception ex) {
+ LoggingService.LogError ("Load operation failed", ex);
monitor.ReportError ("Load operation failed.", ex);
- // Don't use 'finally' to dispose the monitor, since it has to be disposed later
- monitor.Dispose ();
if (item != null)
item.Dispose ();
- timer.End ();
- return;
+ return false;
} finally {
- Gtk.Application.Invoke ((s,o) => IdeApp.Workbench.UnlockGui ());
if (reloading)
SetReloading (false);
}
-
- Gtk.Application.Invoke (delegate {
- using (monitor) {
- try {
- // Add the item in the GUI thread. It is not safe to do it in the background thread.
- if (!monitor.IsCancelRequested)
- Items.Add (item);
- else {
- item.Dispose ();
- return;
- }
- if (IdeApp.ProjectOperations.CurrentSelectedWorkspaceItem == null)
- IdeApp.ProjectOperations.CurrentSelectedWorkspaceItem = GetAllSolutions ().FirstOrDefault ();
- if (Items.Count == 1 && loadPreferences) {
- timer.Trace ("Restoring workspace preferences");
- RestoreWorkspacePreferences (item);
- }
- timer.Trace ("Reattaching documents");
- ReattachDocumentProjects (null);
- monitor.ReportSuccess (GettextCatalog.GetString ("Solution loaded."));
- } finally {
- timer.End ();
- }
+
+ using (monitor) {
+ // Add the item in the GUI thread. It is not safe to do it in the background thread.
+ if (!monitor.CancellationToken.IsCancellationRequested) {
+ item.SetShared ();
+ Items.Add (item);
}
- });
+ else {
+ item.Dispose ();
+ return false;
+ }
+ if (IdeApp.ProjectOperations.CurrentSelectedWorkspaceItem == null)
+ IdeApp.ProjectOperations.CurrentSelectedWorkspaceItem = GetAllSolutions ().FirstOrDefault ();
+ if (Items.Count == 1 && loadPreferences) {
+ timer.Trace ("Restoring workspace preferences");
+ await RestoreWorkspacePreferences (item);
+ }
+ timer.Trace ("Reattaching documents");
+ ReattachDocumentProjects (null);
+ monitor.ReportSuccess (GettextCatalog.GetString ("Solution loaded."));
+
+ timer.Trace ("Reattaching documents");
+ ReattachDocumentProjects (null);
+ monitor.ReportSuccess (GettextCatalog.GetString ("Solution loaded."));
+ }
+ return true;
}
- void RestoreWorkspacePreferences (WorkspaceItem item)
+ async Task RestoreWorkspacePreferences (WorkspaceItem item)
{
// Restore local configuration data
@@ -718,7 +612,8 @@ namespace MonoDevelop.Ide
if (LoadingUserPreferences != null) {
UserPreferencesEventArgs args = new UserPreferencesEventArgs (item, item.UserProperties);
try {
- LoadingUserPreferences (this, args);
+ foreach (AsyncEventHandler<UserPreferencesEventArgs> d in LoadingUserPreferences.GetInvocationList ())
+ await d (this, args);
} catch (Exception ex) {
LoggingService.LogError ("Exception in LoadingUserPreferences.", ex);
}
@@ -748,7 +643,7 @@ namespace MonoDevelop.Ide
return bestConfig;
}
- public void SavePreferences (WorkspaceItem item)
+ public Task SavePreferences (WorkspaceItem item)
{
// Local configuration info
@@ -770,7 +665,7 @@ namespace MonoDevelop.Ide
// Save the file
- item.SaveUserProperties ();
+ return item.SaveUserProperties ();
}
public FileStatusTracker GetFileStatusTracker ()
@@ -802,43 +697,35 @@ namespace MonoDevelop.Ide
reloadingCount--;
}
- void CheckWorkspaceItems (object sender, FileEventArgs args)
+ async void CheckWorkspaceItems (object sender, FileEventArgs args)
{
HashSet<FilePath> files = new HashSet<FilePath> (args.Select (e => e.FileName.CanonicalPath));
foreach (Solution s in GetAllSolutions ().Where (sol => sol.GetItemFiles (false).Any (f => files.Contains (f.CanonicalPath))))
- OnCheckWorkspaceItem (s);
+ await OnCheckWorkspaceItem (s);
foreach (Project p in GetAllProjects ().Where (proj => proj.GetItemFiles (false).Any (f => files.Contains (f.CanonicalPath))))
- OnCheckProject (p);
+ await OnCheckProject (p);
}
- bool OnRunProjectChecks ()
- {
- // If any project has been modified, reload it
- foreach (WorkspaceItem it in new List<WorkspaceItem> (Items))
- OnCheckWorkspaceItem (it);
- return true;
- }
-
- void OnCheckWorkspaceItem (WorkspaceItem item)
+ async Task OnCheckWorkspaceItem (WorkspaceItem item)
{
if (item.NeedsReload) {
IEnumerable<string> closedDocs;
- if (AllowReload (item.GetAllProjects (), out closedDocs)) {
+ if (AllowReload (item.GetAllItems<Project> (), out closedDocs)) {
if (item.ParentWorkspace == null) {
string file = item.FileName;
try {
SetReloading (true);
SavePreferences ();
CloseWorkspaceItem (item, false);
- OpenWorkspaceItem (file, false, false);
+ await OpenWorkspaceItem (file, false, false);
} finally {
SetReloading (false);
}
}
else {
- using (IProgressMonitor m = IdeApp.Workbench.ProgressMonitors.GetSaveProgressMonitor (true)) {
- item.ParentWorkspace.ReloadItem (m, item);
+ using (ProgressMonitor m = IdeApp.Workbench.ProgressMonitors.GetSaveProgressMonitor (true)) {
+ await item.ParentWorkspace.ReloadItem (m, item);
ReattachDocumentProjects (closedDocs);
}
}
@@ -852,15 +739,15 @@ namespace MonoDevelop.Ide
Workspace ws = (Workspace) item;
List<WorkspaceItem> items = new List<WorkspaceItem> (ws.Items);
foreach (WorkspaceItem it in items)
- OnCheckWorkspaceItem (it);
+ await OnCheckWorkspaceItem (it);
}
else if (item is Solution) {
Solution sol = (Solution) item;
- OnCheckProject (sol.RootFolder);
+ await OnCheckProject (sol.RootFolder);
}
}
- void OnCheckProject (SolutionItem entry)
+ async Task OnCheckProject (SolutionFolderItem entry)
{
if (entry.NeedsReload) {
IEnumerable projects = null;
@@ -873,9 +760,9 @@ namespace MonoDevelop.Ide
IEnumerable<string> closedDocs;
if (AllowReload (projects, out closedDocs)) {
- using (IProgressMonitor m = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
+ using (ProgressMonitor m = IdeApp.Workbench.ProgressMonitors.GetProjectLoadProgressMonitor (true)) {
// Root folders never need to reload
- entry.ParentFolder.ReloadItem (m, entry);
+ await entry.ParentFolder.ReloadItem (m, entry);
ReattachDocumentProjects (closedDocs);
}
return;
@@ -885,10 +772,10 @@ namespace MonoDevelop.Ide
if (entry is SolutionFolder) {
ArrayList ens = new ArrayList ();
- foreach (SolutionItem ce in ((SolutionFolder)entry).Items)
+ foreach (SolutionFolderItem ce in ((SolutionFolder)entry).Items)
ens.Add (ce);
- foreach (SolutionItem ce in ens)
- OnCheckProject (ce);
+ foreach (SolutionFolderItem ce in ens)
+ await OnCheckProject (ce);
}
}
@@ -923,14 +810,9 @@ namespace MonoDevelop.Ide
hasUnsaved = true;
if (!doc.IsFile)
hasNoFiles = true;
- ISupportsProjectReload pr = doc.GetContent<ISupportsProjectReload> ();
- if (pr != null) {
- ProjectReloadCapability c = pr.ProjectReloadCapability;
- if ((int) c < (int) prc)
- prc = c;
- }
- else
- prc = ProjectReloadCapability.None;
+ var c = doc.ProjectReloadCapability;
+ if ((int) c < (int) prc)
+ prc = c;
}
string msg = null;
@@ -961,8 +843,7 @@ namespace MonoDevelop.Ide
foreach (Document doc in docs) {
if (doc.IsDirty)
hasUnsaved = true;
- ISupportsProjectReload pr = doc.GetContent<ISupportsProjectReload> ();
- if (pr != null)
+ if (doc.ProjectReloadCapability != ProjectReloadCapability.None)
doc.SetProject (null);
else {
FilePath file = doc.IsFile ? doc.FileName : FilePath.Null;
@@ -1004,7 +885,12 @@ namespace MonoDevelop.Ide
internal void NotifyItemAdded (WorkspaceItem item)
{
- if (DispatchService.IsGuiThread)
+ try {
+ MonoDevelop.Ide.TypeSystem.TypeSystemService.Load (item, null);
+ } catch (Exception ex) {
+ LoggingService.LogError ("Could not load parser database.", ex);
+ }
+ if (Runtime.IsMainThread)
NotifyItemAddedGui (item, IsReloading);
else {
bool reloading = IsReloading;
@@ -1013,24 +899,15 @@ namespace MonoDevelop.Ide
});
}
}
-
+
void NotifyItemAddedGui (WorkspaceItem item, bool reloading)
{
- try {
-// Mono.Profiler.RuntimeControls.EnableProfiler ();
- MonoDevelop.Ide.TypeSystem.TypeSystemService.Load (item);
-// Mono.Profiler.RuntimeControls.DisableProfiler ();
-// Console.WriteLine ("PARSE LOAD: " + (DateTime.Now - t).TotalMilliseconds);
- } catch (Exception ex) {
- LoggingService.LogError ("Could not load parser database.", ex);
- }
-
Workspace ws = item as Workspace;
if (ws != null) {
- ws.DescendantItemAdded += descendantItemAddedHandler;
- ws.DescendantItemRemoved += descendantItemRemovedHandler;
+ ws.DescendantItemAdded += NotifyDescendantItemAdded;
+ ws.DescendantItemRemoved += NotifyDescendantItemRemoved;
}
- item.ConfigurationsChanged += configurationsChanged;
+ item.ConfigurationsChanged += NotifyConfigurationsChanged;
WorkspaceItemEventArgs args = new WorkspaceItemEventArgs (item);
NotifyDescendantItemAdded (this, args);
@@ -1047,7 +924,7 @@ namespace MonoDevelop.Ide
internal void NotifyItemRemoved (WorkspaceItem item)
{
- if (DispatchService.IsGuiThread)
+ if (Runtime.IsMainThread)
NotifyItemRemovedGui (item, IsReloading);
else {
bool reloading = IsReloading;
@@ -1061,10 +938,10 @@ namespace MonoDevelop.Ide
{
Workspace ws = item as Workspace;
if (ws != null) {
- ws.DescendantItemAdded -= descendantItemAddedHandler;
- ws.DescendantItemRemoved -= descendantItemRemovedHandler;
+ ws.DescendantItemAdded -= NotifyDescendantItemAdded;
+ ws.DescendantItemRemoved -= NotifyDescendantItemRemoved;
}
- item.ConfigurationsChanged -= configurationsChanged;
+ item.ConfigurationsChanged -= NotifyConfigurationsChanged;
WorkspaceItemEventArgs args = new WorkspaceItemEventArgs (item);
NotifyConfigurationsChanged (null, args);
@@ -1072,41 +949,43 @@ namespace MonoDevelop.Ide
if (WorkspaceItemClosed != null)
WorkspaceItemClosed (this, args);
- if (Items.Count == 0 && !reloading) {
+ bool lastWorkspaceItemClosing = Items.Count == 0 && !reloading;
+ if (lastWorkspaceItemClosing) {
if (LastWorkspaceItemClosed != null)
LastWorkspaceItemClosed (this, EventArgs.Empty);
}
-
MonoDevelop.Ide.TypeSystem.TypeSystemService.Unload (item);
-// ParserDatabase.Unload (item);
-
+
+ if (lastWorkspaceItemClosing)
+ MonoDevelop.Ide.TypeSystem.MetadataReferenceCache.Clear ();
+
NotifyDescendantItemRemoved (this, args);
}
void SubscribeSolution (Solution sol)
{
- sol.FileAddedToProject += fileAddedToProjectHandler;
- sol.FileRemovedFromProject += fileRemovedFromProjectHandler;
- sol.FileRenamedInProject += fileRenamedInProjectHandler;
- sol.FileChangedInProject += fileChangedInProjectHandler;
- sol.FilePropertyChangedInProject += filePropertyChangedInProjectHandler;
- sol.ReferenceAddedToProject += referenceAddedToProjectHandler;
- sol.ReferenceRemovedFromProject += referenceRemovedFromProjectHandler;
- sol.SolutionItemAdded += itemAddedToSolutionHandler;
- sol.SolutionItemRemoved += itemRemovedFromSolutionHandler;
+ sol.FileAddedToProject += NotifyFileAddedToProject;
+ sol.FileRemovedFromProject += NotifyFileRemovedFromProject;
+ sol.FileRenamedInProject += NotifyFileRenamedInProject;
+ sol.FileChangedInProject += NotifyFileChangedInProject;
+ sol.FilePropertyChangedInProject += NotifyFilePropertyChangedInProject;
+ sol.ReferenceAddedToProject += NotifyReferenceAddedToProject;
+ sol.ReferenceRemovedFromProject += NotifyReferenceRemovedFromProject;
+ sol.SolutionItemAdded += NotifyItemAddedToSolution;
+ sol.SolutionItemRemoved += NotifyItemRemovedFromSolution;
}
void UnsubscribeSolution (Solution solution)
{
- solution.FileAddedToProject -= fileAddedToProjectHandler;
- solution.FileRemovedFromProject -= fileRemovedFromProjectHandler;
- solution.FileRenamedInProject -= fileRenamedInProjectHandler;
- solution.FileChangedInProject -= fileChangedInProjectHandler;
- solution.FilePropertyChangedInProject -= filePropertyChangedInProjectHandler;
- solution.ReferenceAddedToProject -= referenceAddedToProjectHandler;
- solution.ReferenceRemovedFromProject -= referenceRemovedFromProjectHandler;
- solution.SolutionItemAdded -= itemAddedToSolutionHandler;
- solution.SolutionItemRemoved -= itemRemovedFromSolutionHandler;
+ solution.FileAddedToProject -= NotifyFileAddedToProject;
+ solution.FileRemovedFromProject -= NotifyFileRemovedFromProject;
+ solution.FileRenamedInProject -= NotifyFileRenamedInProject;
+ solution.FileChangedInProject -= NotifyFileChangedInProject;
+ solution.FilePropertyChangedInProject -= NotifyFilePropertyChangedInProject;
+ solution.ReferenceAddedToProject -= NotifyReferenceAddedToProject;
+ solution.ReferenceRemovedFromProject -= NotifyReferenceRemovedFromProject;
+ solution.SolutionItemAdded -= NotifyItemAddedToSolution;
+ solution.SolutionItemRemoved -= NotifyItemRemovedFromSolution;
}
void NotifyConfigurationsChanged (object s, EventArgs a)
@@ -1177,20 +1056,23 @@ namespace MonoDevelop.Ide
void NotifyItemRemovedFromSolution (object sender, SolutionItemChangeEventArgs args)
{
- NotifyItemRemovedFromSolutionRec (sender, args.SolutionItem, args.Solution);
+ NotifyItemRemovedFromSolutionRec (sender, args.SolutionItem, args.Solution, args);
}
- void NotifyItemRemovedFromSolutionRec (object sender, SolutionItem e, Solution sol)
+ void NotifyItemRemovedFromSolutionRec (object sender, SolutionFolderItem e, Solution sol, SolutionItemChangeEventArgs originalArgs)
{
if (e == IdeApp.ProjectOperations.CurrentSelectedSolutionItem)
IdeApp.ProjectOperations.CurrentSelectedSolutionItem = null;
if (e is SolutionFolder) {
- foreach (SolutionItem ce in ((SolutionFolder)e).Items)
- NotifyItemRemovedFromSolutionRec (sender, ce, sol);
+ foreach (SolutionFolderItem ce in ((SolutionFolder)e).Items)
+ NotifyItemRemovedFromSolutionRec (sender, ce, sol, null);
}
+
+ // For the root item send the original args, since they contain reload information
+
if (ItemRemovedFromSolution != null)
- ItemRemovedFromSolution (sender, new SolutionItemChangeEventArgs (e, sol, false));
+ ItemRemovedFromSolution (sender, originalArgs ?? new SolutionItemChangeEventArgs (e, sol, false));
}
void NotifyDescendantItemAdded (object s, WorkspaceItemEventArgs args)
@@ -1199,7 +1081,7 @@ namespace MonoDevelop.Ide
// the top
if (s != this && Items.Contains (args.Item))
Items.Remove (args.Item);
- foreach (WorkspaceItem item in args.Item.GetAllItems ()) {
+ foreach (WorkspaceItem item in args.Item.GetAllItems<WorkspaceItem> ()) {
if (item is Solution)
SubscribeSolution ((Solution)item);
OnItemLoaded (item);
@@ -1208,7 +1090,7 @@ namespace MonoDevelop.Ide
void NotifyDescendantItemRemoved (object s, WorkspaceItemEventArgs args)
{
- foreach (WorkspaceItem item in args.Item.GetAllItems ()) {
+ foreach (WorkspaceItem item in args.Item.GetAllItems<WorkspaceItem> ()) {
OnItemUnloaded (item);
if (item is Solution)
UnsubscribeSolution ((Solution)item);
@@ -1317,7 +1199,7 @@ namespace MonoDevelop.Ide
/// once for the workspace, and once for each solution.
/// </remarks>
public event EventHandler<WorkspaceItemEventArgs> WorkspaceItemLoaded;
-
+
/// <summary>
/// Fired when a workspace item (a solution or workspace) is unloaded
/// </summary>
@@ -1350,7 +1232,7 @@ namespace MonoDevelop.Ide
/// Add-ins can subscribe to this event to load preferences previously
/// stored in the StoringUserPreferences event.
/// </remarks>
- public event EventHandler<UserPreferencesEventArgs> LoadingUserPreferences;
+ public event AsyncEventHandler<UserPreferencesEventArgs> LoadingUserPreferences;
/// <summary>
/// Fired when an item (a project, solution or workspace) is going to be unloaded.
@@ -1415,52 +1297,31 @@ namespace MonoDevelop.Ide
#endregion
}
- class RootWorkspaceItemCollection: WorkspaceItemCollection
+ public class RootWorkspaceItemCollection: ItemCollection<WorkspaceItem>
{
RootWorkspace parent;
- public RootWorkspaceItemCollection (RootWorkspace parent) : this(parent, 0)
- {
- }
-
- public RootWorkspaceItemCollection (RootWorkspace parent, int capacity) : base(new List<WorkspaceItem> (capacity))
+ internal RootWorkspaceItemCollection (RootWorkspace parent)
{
this.parent = parent;
}
-
- protected override void ClearItems ()
+
+
+ protected override void OnItemsRemoved (IEnumerable<WorkspaceItem> items)
{
+ base.OnItemsRemoved (items);
if (parent != null) {
- List<WorkspaceItem> items = new List<WorkspaceItem> (this);
foreach (WorkspaceItem it in items)
parent.NotifyItemRemoved (it);
}
- else
- base.ClearItems ();
- }
-
- protected override void InsertItem (int index, WorkspaceItem item)
- {
- base.InsertItem (index, item);
- if (parent != null)
- parent.NotifyItemAdded (item);
}
-
- protected override void RemoveItem (int index)
- {
- WorkspaceItem item = this [index];
- base.RemoveItem (index);
- if (parent != null)
- parent.NotifyItemRemoved (item);
- }
-
- protected override void SetItem (int index, WorkspaceItem item)
+
+ protected override void OnItemsAdded (IEnumerable<WorkspaceItem> items)
{
- WorkspaceItem oldItem = this [index];
- base.SetItem (index, item);
+ base.OnItemsAdded (items);
if (parent != null) {
- parent.NotifyItemRemoved (oldItem);
- parent.NotifyItemAdded (item);
+ foreach (var item in items)
+ parent.NotifyItemAdded (item);
}
}
}
@@ -1492,17 +1353,17 @@ namespace MonoDevelop.Ide
public class ItemUnloadingEventArgs: EventArgs
{
- IBuildTarget item;
+ WorkspaceObject item;
public bool Cancel { get; set; }
- public IBuildTarget Item {
+ public WorkspaceObject Item {
get {
return item;
}
}
- public ItemUnloadingEventArgs (IBuildTarget item)
+ public ItemUnloadingEventArgs (WorkspaceObject item)
{
this.item = item;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Services.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Services.cs
index 8bd77a8a7e..e96e8b7238 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Services.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/Services.cs
@@ -52,6 +52,7 @@ namespace MonoDevelop.Ide
internal static TimerCounter OpenWorkspaceItemTimer = InstrumentationService.CreateTimerCounter ("Solution opened in the IDE", "IDE", id:"Ide.Shell.SolutionOpened");
internal static TimerCounter OpenDocumentTimer = InstrumentationService.CreateTimerCounter ("Document opened", "IDE");
internal static TimerCounter DocumentOpened = InstrumentationService.CreateTimerCounter ("Document opened", "IDE", id:"Ide.Shell.DocumentOpened");
+ internal static Counter AutoSavedFiles = InstrumentationService.CreateCounter ("Autosaved Files", "Text Editor");
internal static TimerCounter BuildItemTimer = InstrumentationService.CreateTimerCounter ("Project/Solution built in the IDE", "IDE", id:"Ide.Shell.ProjectBuilt");
internal static Counter PadShown = InstrumentationService.CreateCounter ("Pad focused", "IDE", id:"Ide.Shell.PadShown");
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/TaskUtil.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/TaskUtil.cs
new file mode 100644
index 0000000000..8e0e832fa1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/TaskUtil.cs
@@ -0,0 +1,52 @@
+//
+// TaskUtil.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using MonoDevelop.Ide.TypeSystem;
+
+namespace MonoDevelop.Ide
+{
+ static class TaskUtil
+ {
+ public static Task<T> Default<T>()
+ {
+ return EmptyTask<T>.Instance;
+ }
+
+ public static Task<IEnumerable<T>> EmptyEnumerable<T>()
+ {
+ return EmptyTask<T>.EmptyEnumerable;
+ }
+
+ static class EmptyTask<T>
+ {
+ public static readonly Task<T> Instance = Task.FromResult<T>(default(T));
+ public static readonly Task<IEnumerable<T>> EmptyEnumerable = Task.FromResult<IEnumerable<T>>(new T[0]);
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/branding/AboutImage.png b/main/src/core/MonoDevelop.Ide/branding/AboutImage.png
index 6b2c38e02b..810e565711 100644
--- a/main/src/core/MonoDevelop.Ide/branding/AboutImage.png
+++ b/main/src/core/MonoDevelop.Ide/branding/AboutImage.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/branding/AboutImage@2x.png b/main/src/core/MonoDevelop.Ide/branding/AboutImage@2x.png
new file mode 100644
index 0000000000..8e1bbaa0c3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/branding/AboutImage@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/branding/WelcomePage_Logo.png b/main/src/core/MonoDevelop.Ide/branding/WelcomePage_Logo.png
deleted file mode 100644
index e81972cabd..0000000000
--- a/main/src/core/MonoDevelop.Ide/branding/WelcomePage_Logo.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/branding/WelcomePage_TopBorderRepeat.png b/main/src/core/MonoDevelop.Ide/branding/WelcomePage_TopBorderRepeat.png
deleted file mode 100644
index c4ab9643fe..0000000000
--- a/main/src/core/MonoDevelop.Ide/branding/WelcomePage_TopBorderRepeat.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/branding/welcome-logo.png b/main/src/core/MonoDevelop.Ide/branding/welcome-logo.png
new file mode 100644
index 0000000000..664e7914b3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/branding/welcome-logo.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/branding/welcome-logo@2x.png b/main/src/core/MonoDevelop.Ide/branding/welcome-logo@2x.png
new file mode 100644
index 0000000000..747f04de74
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/branding/welcome-logo@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/branding/welcome-tile.png b/main/src/core/MonoDevelop.Ide/branding/welcome-tile.png
new file mode 100644
index 0000000000..87d09ad51b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/branding/welcome-tile.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/branding/welcome-tile@2x.png b/main/src/core/MonoDevelop.Ide/branding/welcome-tile@2x.png
new file mode 100644
index 0000000000..b8ba2822d4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/branding/welcome-tile@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs
index 0754b6a148..72ee676759 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.CodeTemplates.EditTemplateDialog.cs
@@ -2,7 +2,7 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.Ide.CodeTemplates
{
- public partial class EditTemplateDialog
+ partial class EditTemplateDialog
{
private global::Gtk.HPaned hpaned1;
private global::Gtk.VBox vbox2;
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Execution.MonoExecutionParametersWidget.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Execution.MonoExecutionParametersWidget.cs
index 9d8eaea9db..6105f1f393 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Execution.MonoExecutionParametersWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Execution.MonoExecutionParametersWidget.cs
@@ -39,14 +39,11 @@ namespace MonoDevelop.Ide.Execution
this.buttonReset.Name = "buttonReset";
this.buttonReset.UseUnderline = true;
this.buttonReset.Label = global::Mono.Unix.Catalog.GetString ("Clear All Options");
- global::Gtk.Image w2 = new global::Gtk.Image ();
- w2.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-clear", global::Gtk.IconSize.Menu);
- this.buttonReset.Image = w2;
this.vbox4.Add (this.buttonReset);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.buttonReset]));
- w3.Position = 0;
- w3.Expand = false;
- w3.Fill = false;
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.buttonReset]));
+ w2.Position = 0;
+ w2.Expand = false;
+ w2.Fill = false;
// Container child vbox4.Gtk.Box+BoxChild
this.buttonPreview = new global::Gtk.Button ();
this.buttonPreview.CanFocus = true;
@@ -54,15 +51,15 @@ namespace MonoDevelop.Ide.Execution
this.buttonPreview.UseUnderline = true;
this.buttonPreview.Label = global::Mono.Unix.Catalog.GetString ("Preview Options");
this.vbox4.Add (this.buttonPreview);
- global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.buttonPreview]));
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.buttonPreview]));
+ w3.Position = 1;
+ w3.Expand = false;
+ w3.Fill = false;
+ this.hbox1.Add (this.vbox4);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox4]));
w4.Position = 1;
w4.Expand = false;
w4.Fill = false;
- this.hbox1.Add (this.vbox4);
- global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox4]));
- w5.Position = 1;
- w5.Expand = false;
- w5.Fill = false;
this.Add (this.hbox1);
if ((this.Child != null)) {
this.Child.ShowAll ();
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs
index 42c2cbb068..d28b1cfd20 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.FindInFiles.FindInFilesDialog.cs
@@ -5,23 +5,41 @@ namespace MonoDevelop.Ide.FindInFiles
public partial class FindInFilesDialog
{
private global::Gtk.VBox vbox2;
+
private global::Gtk.HBox hbox3;
+
private global::Gtk.RadioButton toggleFindInFiles;
+
private global::Gtk.VSeparator vseparator1;
+
private global::Gtk.RadioButton toggleReplaceInFiles;
+
private global::Gtk.HBox hbox1;
+
private global::Gtk.Table tableFindAndReplace;
+
private global::Gtk.ComboBoxEntry comboboxentryFind;
+
private global::Gtk.HBox hbox2;
+
private global::Gtk.ComboBox comboboxScope;
+
private global::Gtk.Label labelFind;
+
private global::Gtk.Label labelScope;
+
private global::Gtk.Table table1;
+
private global::Gtk.CheckButton checkbuttonCaseSensitive;
+
private global::Gtk.CheckButton checkbuttonRegexSearch;
+
private global::Gtk.CheckButton checkbuttonWholeWordsOnly;
+
private global::Gtk.Button buttonStop;
+
private global::Gtk.Button buttonClose;
+
private global::Gtk.Button buttonSearch;
protected virtual void Build ()
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs
index b9bb1ac53a..1224f0049f 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.AddinLoadErrorDialog.cs
@@ -5,14 +5,23 @@ namespace MonoDevelop.Ide.Gui.Dialogs
internal partial class AddinLoadErrorDialog
{
private global::Gtk.HBox hbox1;
- private global::Gtk.Image image1;
+
+ private global::MonoDevelop.Components.ImageView iconError;
+
private global::Gtk.VBox vbox4;
+
private global::Gtk.Label label4;
+
private global::Gtk.ScrolledWindow scrolledwindow1;
+
private global::Gtk.TreeView errorTree;
+
private global::Gtk.Label messageLabel;
+
private global::Gtk.Button noButton;
+
private global::Gtk.Button yesButton;
+
private global::Gtk.Button closeButton;
protected virtual void Build ()
@@ -35,13 +44,14 @@ namespace MonoDevelop.Ide.Gui.Dialogs
this.hbox1.Spacing = 12;
this.hbox1.BorderWidth = ((uint)(6));
// Container child hbox1.Gtk.Box+BoxChild
- this.image1 = new global::Gtk.Image ();
- this.image1.Name = "image1";
- this.image1.Xalign = 0F;
- this.image1.Yalign = 0F;
- this.image1.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-dialog-error", global::Gtk.IconSize.Dialog);
- this.hbox1.Add (this.image1);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.image1]));
+ this.iconError = new global::MonoDevelop.Components.ImageView ();
+ this.iconError.Name = "iconError";
+ this.iconError.Xalign = 0F;
+ this.iconError.Yalign = 0F;
+ this.iconError.IconId = "gtk-dialog-error";
+ this.iconError.IconSize = ((global::Gtk.IconSize)(6));
+ this.hbox1.Add (this.iconError);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.iconError]));
w2.Position = 0;
w2.Expand = false;
w2.Fill = false;
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs
index f4fdbc339a..ca122cc984 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.NewLayoutDialog.cs
@@ -104,14 +104,11 @@ namespace MonoDevelop.Ide.Gui.Dialogs
this.newButton.Name = "newButton";
this.newButton.UseUnderline = true;
this.newButton.Label = global::Mono.Unix.Catalog.GetString ("Create _Layout");
- global::Gtk.Image w10 = new global::Gtk.Image ();
- w10.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-new", global::Gtk.IconSize.Menu);
- this.newButton.Image = w10;
this.AddActionWidget (this.newButton, -5);
- global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w8 [this.newButton]));
- w11.Position = 1;
- w11.Expand = false;
- w11.Fill = false;
+ global::Gtk.ButtonBox.ButtonBoxChild w10 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w8 [this.newButton]));
+ w10.Position = 1;
+ w10.Expand = false;
+ w10.Fill = false;
if ((this.Child != null)) {
this.Child.ShowAll ();
}
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs
index 0f7f717e25..6ecb4fa2b4 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog.cs
@@ -2,24 +2,40 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.Ide.Gui.Dialogs
{
- public partial class SelectFileFormatDialog
+ partial class SelectFileFormatDialog
{
private global::Gtk.HBox hbox1;
+
private global::Gtk.VBox vbox3;
- private global::Gtk.Image image146;
+
+ private global::MonoDevelop.Components.ImageView iconWarning;
+
private global::Gtk.VBox vbox2;
+
private global::Gtk.Label label1;
+
private global::Gtk.Label labelMessage;
+
private global::Gtk.Label labelWarnings;
+
private global::Gtk.Label label6;
+
private global::Gtk.Alignment alignment2;
+
private global::Gtk.Table table1;
+
private global::Gtk.Alignment alignment3;
+
private global::Gtk.Label labelCurrentFormat;
+
private global::Gtk.ComboBox comboNewFormat;
+
private global::Gtk.Label label3;
+
private global::Gtk.Label label4;
+
private global::Gtk.Button buttonCancel;
+
private global::Gtk.Button buttonOk;
protected virtual void Build ()
@@ -43,11 +59,12 @@ namespace MonoDevelop.Ide.Gui.Dialogs
this.vbox3.Name = "vbox3";
this.vbox3.Spacing = 6;
// Container child vbox3.Gtk.Box+BoxChild
- this.image146 = new global::Gtk.Image ();
- this.image146.Name = "image146";
- this.image146.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-dialog-warning", global::Gtk.IconSize.Dialog);
- this.vbox3.Add (this.image146);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.image146]));
+ this.iconWarning = new global::MonoDevelop.Components.ImageView ();
+ this.iconWarning.Name = "iconWarning";
+ this.iconWarning.IconId = "gtk-dialog-warning";
+ this.iconWarning.IconSize = ((global::Gtk.IconSize)(6));
+ this.vbox3.Add (this.iconWarning);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.iconWarning]));
w2.Position = 0;
w2.Expand = false;
w2.Fill = false;
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs
index dc7193ad18..18c021446e 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.Dialogs.TipOfTheDayWindow.cs
@@ -5,16 +5,27 @@ namespace MonoDevelop.Ide.Gui.Dialogs
internal partial class TipOfTheDayWindow
{
private global::Gtk.VBox vbox2;
+
private global::Gtk.VBox vbox3;
+
private global::Gtk.HBox hbox7;
- private global::Gtk.Image image5;
+
+ private global::MonoDevelop.Components.ImageView iconInfo;
+
private global::Gtk.Label categoryLabel;
+
private global::Gtk.ScrolledWindow scrolledwindow2;
+
private global::Gtk.TextView tipTextview;
+
private global::Gtk.HBox hbox5;
+
private global::Gtk.CheckButton noshowCheckbutton;
+
private global::Gtk.HButtonBox hbuttonbox1;
+
private global::Gtk.Button nextButton;
+
private global::Gtk.Button closeButton;
protected virtual void Build ()
@@ -39,13 +50,14 @@ namespace MonoDevelop.Ide.Gui.Dialogs
this.hbox7.Name = "hbox7";
this.hbox7.Spacing = 5;
// Container child hbox7.Gtk.Box+BoxChild
- this.image5 = new global::Gtk.Image ();
- this.image5.Name = "image5";
- this.image5.Xalign = 0F;
- this.image5.Yalign = 0F;
- this.image5.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-dialog-info", global::Gtk.IconSize.Dialog);
- this.hbox7.Add (this.image5);
- global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.hbox7 [this.image5]));
+ this.iconInfo = new global::MonoDevelop.Components.ImageView ();
+ this.iconInfo.Name = "iconInfo";
+ this.iconInfo.Xalign = 0F;
+ this.iconInfo.Yalign = 0F;
+ this.iconInfo.IconId = "gtk-dialog-info";
+ this.iconInfo.IconSize = ((global::Gtk.IconSize)(6));
+ this.hbox7.Add (this.iconInfo);
+ global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.hbox7 [this.iconInfo]));
w1.Position = 0;
w1.Expand = false;
// Container child hbox7.Gtk.Box+BoxChild
@@ -107,13 +119,10 @@ namespace MonoDevelop.Ide.Gui.Dialogs
this.nextButton.Name = "nextButton";
this.nextButton.UseUnderline = true;
this.nextButton.Label = global::Mono.Unix.Catalog.GetString ("_Next Tip");
- global::Gtk.Image w8 = new global::Gtk.Image ();
- w8.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-forward", global::Gtk.IconSize.Button);
- this.nextButton.Image = w8;
this.hbuttonbox1.Add (this.nextButton);
- global::Gtk.ButtonBox.ButtonBoxChild w9 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox1 [this.nextButton]));
- w9.Expand = false;
- w9.Fill = false;
+ global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox1 [this.nextButton]));
+ w8.Expand = false;
+ w8.Fill = false;
// Container child hbuttonbox1.Gtk.ButtonBox+ButtonBoxChild
this.closeButton = new global::Gtk.Button ();
this.closeButton.CanDefault = true;
@@ -122,17 +131,17 @@ namespace MonoDevelop.Ide.Gui.Dialogs
this.closeButton.UseUnderline = true;
this.closeButton.Label = "gtk-close";
this.hbuttonbox1.Add (this.closeButton);
- global::Gtk.ButtonBox.ButtonBoxChild w10 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox1 [this.closeButton]));
- w10.Position = 1;
- w10.Expand = false;
- w10.Fill = false;
+ global::Gtk.ButtonBox.ButtonBoxChild w9 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox1 [this.closeButton]));
+ w9.Position = 1;
+ w9.Expand = false;
+ w9.Fill = false;
this.hbox5.Add (this.hbuttonbox1);
- global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox5 [this.hbuttonbox1]));
- w11.Position = 1;
+ global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox5 [this.hbuttonbox1]));
+ w10.Position = 1;
this.vbox2.Add (this.hbox5);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox5]));
- w12.Position = 1;
- w12.Expand = false;
+ global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox5]));
+ w11.Position = 1;
+ w11.Expand = false;
this.Add (this.vbox2);
if ((this.Child != null)) {
this.Child.ShowAll ();
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs
index 930f098990..2862f19dbb 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.cs
@@ -2,186 +2,214 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.Ide.Gui.OptionPanels
{
- internal partial class BuildPanelWidget
+ partial class BuildPanelWidget
{
private global::Gtk.VBox vbox66;
+
private global::Gtk.CheckButton buildBeforeRunCheckBox;
+
private global::Gtk.CheckButton runWithWarningsCheckBox;
+
+ private global::Gtk.CheckButton parallelBuildCheckbox;
+
private global::Gtk.CheckButton buildBeforeTestCheckBox;
+
private global::Gtk.Alignment alignment1;
+
private global::Gtk.HBox hbox1;
+
private global::Gtk.Label label1;
+
private global::Gtk.ComboBox verbosityCombo;
+
private global::Gtk.Label buildAndRunOptionsLabel;
+
private global::Gtk.HBox hbox44;
+
private global::Gtk.Label label71;
+
private global::Gtk.VBox vbox67;
+
private global::Gtk.RadioButton saveChangesRadioButton;
+
private global::Gtk.RadioButton promptChangesRadioButton;
+
private global::Gtk.RadioButton noSaveRadioButton;
- protected virtual void Build ()
+ protected virtual void Build()
{
- global::Stetic.Gui.Initialize (this);
+ global::Stetic.Gui.Initialize(this);
// Widget MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget
- global::Stetic.BinContainer.Attach (this);
+ global::Stetic.BinContainer.Attach(this);
this.Name = "MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget";
// Container child MonoDevelop.Ide.Gui.OptionPanels.BuildPanelWidget.Gtk.Container+ContainerChild
- this.vbox66 = new global::Gtk.VBox ();
+ this.vbox66 = new global::Gtk.VBox();
this.vbox66.Name = "vbox66";
this.vbox66.Spacing = 6;
// Container child vbox66.Gtk.Box+BoxChild
- this.buildBeforeRunCheckBox = new global::Gtk.CheckButton ();
+ this.buildBeforeRunCheckBox = new global::Gtk.CheckButton();
this.buildBeforeRunCheckBox.CanFocus = true;
this.buildBeforeRunCheckBox.Name = "buildBeforeRunCheckBox";
- this.buildBeforeRunCheckBox.Label = global::Mono.Unix.Catalog.GetString ("Build project before running");
+ this.buildBeforeRunCheckBox.Label = global::Mono.Unix.Catalog.GetString("Build project before running");
this.buildBeforeRunCheckBox.DrawIndicator = true;
this.buildBeforeRunCheckBox.UseUnderline = true;
- this.vbox66.Add (this.buildBeforeRunCheckBox);
- global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox66 [this.buildBeforeRunCheckBox]));
+ this.vbox66.Add(this.buildBeforeRunCheckBox);
+ global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox66[this.buildBeforeRunCheckBox]));
w1.Position = 0;
w1.Expand = false;
w1.Fill = false;
// Container child vbox66.Gtk.Box+BoxChild
- this.runWithWarningsCheckBox = new global::Gtk.CheckButton ();
+ this.runWithWarningsCheckBox = new global::Gtk.CheckButton();
this.runWithWarningsCheckBox.CanFocus = true;
this.runWithWarningsCheckBox.Name = "runWithWarningsCheckBox";
- this.runWithWarningsCheckBox.Label = global::Mono.Unix.Catalog.GetString ("Run project if build completed with warnings");
+ this.runWithWarningsCheckBox.Label = global::Mono.Unix.Catalog.GetString("Run project if build completed with warnings");
this.runWithWarningsCheckBox.DrawIndicator = true;
this.runWithWarningsCheckBox.UseUnderline = true;
- this.vbox66.Add (this.runWithWarningsCheckBox);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox66 [this.runWithWarningsCheckBox]));
+ this.vbox66.Add(this.runWithWarningsCheckBox);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox66[this.runWithWarningsCheckBox]));
w2.Position = 1;
w2.Expand = false;
w2.Fill = false;
// Container child vbox66.Gtk.Box+BoxChild
- this.buildBeforeTestCheckBox = new global::Gtk.CheckButton ();
+ this.parallelBuildCheckbox = new global::Gtk.CheckButton();
+ this.parallelBuildCheckbox.CanFocus = true;
+ this.parallelBuildCheckbox.Name = "parallelBuildCheckbox";
+ this.parallelBuildCheckbox.Label = global::Mono.Unix.Catalog.GetString("Enable parallel build of projects");
+ this.parallelBuildCheckbox.DrawIndicator = true;
+ this.parallelBuildCheckbox.UseUnderline = true;
+ this.vbox66.Add(this.parallelBuildCheckbox);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox66[this.parallelBuildCheckbox]));
+ w3.Position = 2;
+ w3.Expand = false;
+ w3.Fill = false;
+ // Container child vbox66.Gtk.Box+BoxChild
+ this.buildBeforeTestCheckBox = new global::Gtk.CheckButton();
this.buildBeforeTestCheckBox.CanFocus = true;
this.buildBeforeTestCheckBox.Name = "buildBeforeTestCheckBox";
- this.buildBeforeTestCheckBox.Label = global::Mono.Unix.Catalog.GetString ("Build project before executing unit tests");
+ this.buildBeforeTestCheckBox.Label = global::Mono.Unix.Catalog.GetString("Build project before executing unit tests");
this.buildBeforeTestCheckBox.DrawIndicator = true;
this.buildBeforeTestCheckBox.UseUnderline = true;
- this.vbox66.Add (this.buildBeforeTestCheckBox);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox66 [this.buildBeforeTestCheckBox]));
- w3.Position = 2;
- w3.Expand = false;
- w3.Fill = false;
+ this.vbox66.Add(this.buildBeforeTestCheckBox);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox66[this.buildBeforeTestCheckBox]));
+ w4.Position = 3;
+ w4.Expand = false;
+ w4.Fill = false;
// Container child vbox66.Gtk.Box+BoxChild
- this.alignment1 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
+ this.alignment1 = new global::Gtk.Alignment(0.5F, 0.5F, 1F, 1F);
this.alignment1.Name = "alignment1";
this.alignment1.LeftPadding = ((uint)(36));
// Container child alignment1.Gtk.Container+ContainerChild
- this.hbox1 = new global::Gtk.HBox ();
+ this.hbox1 = new global::Gtk.HBox();
this.hbox1.Name = "hbox1";
this.hbox1.Spacing = 6;
// Container child hbox1.Gtk.Box+BoxChild
- this.label1 = new global::Gtk.Label ();
+ this.label1 = new global::Gtk.Label();
this.label1.Name = "label1";
- this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("Log _verbosity:");
+ this.label1.LabelProp = global::Mono.Unix.Catalog.GetString("Log _verbosity:");
this.label1.UseUnderline = true;
- this.hbox1.Add (this.label1);
- global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label1]));
- w4.Position = 0;
- w4.Expand = false;
- w4.Fill = false;
+ this.hbox1.Add(this.label1);
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.label1]));
+ w5.Position = 0;
+ w5.Expand = false;
+ w5.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
- this.verbosityCombo = global::Gtk.ComboBox.NewText ();
- this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Quiet"));
- this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Minimal"));
- this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Normal"));
- this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Detailed"));
- this.verbosityCombo.AppendText (global::Mono.Unix.Catalog.GetString ("Diagnostic"));
+ this.verbosityCombo = global::Gtk.ComboBox.NewText();
+ this.verbosityCombo.AppendText(global::Mono.Unix.Catalog.GetString("Quiet"));
+ this.verbosityCombo.AppendText(global::Mono.Unix.Catalog.GetString("Minimal"));
+ this.verbosityCombo.AppendText(global::Mono.Unix.Catalog.GetString("Normal"));
+ this.verbosityCombo.AppendText(global::Mono.Unix.Catalog.GetString("Detailed"));
+ this.verbosityCombo.AppendText(global::Mono.Unix.Catalog.GetString("Diagnostic"));
this.verbosityCombo.Name = "verbosityCombo";
this.verbosityCombo.Active = 2;
- this.hbox1.Add (this.verbosityCombo);
- global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.verbosityCombo]));
- w5.Position = 1;
- w5.Expand = false;
- w5.Fill = false;
- this.alignment1.Add (this.hbox1);
- this.vbox66.Add (this.alignment1);
- global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox66 [this.alignment1]));
- w7.Position = 3;
- w7.Expand = false;
- w7.Fill = false;
+ this.hbox1.Add(this.verbosityCombo);
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.verbosityCombo]));
+ w6.Position = 1;
+ w6.Expand = false;
+ w6.Fill = false;
+ this.alignment1.Add(this.hbox1);
+ this.vbox66.Add(this.alignment1);
+ global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox66[this.alignment1]));
+ w8.Position = 4;
+ w8.Expand = false;
+ w8.Fill = false;
// Container child vbox66.Gtk.Box+BoxChild
- this.buildAndRunOptionsLabel = new global::Gtk.Label ();
+ this.buildAndRunOptionsLabel = new global::Gtk.Label();
this.buildAndRunOptionsLabel.Name = "buildAndRunOptionsLabel";
this.buildAndRunOptionsLabel.Xalign = 0F;
this.buildAndRunOptionsLabel.Yalign = 0F;
- this.buildAndRunOptionsLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>File Save Options Before Building</b>");
+ this.buildAndRunOptionsLabel.LabelProp = global::Mono.Unix.Catalog.GetString("<b>File Save Options Before Building</b>");
this.buildAndRunOptionsLabel.UseMarkup = true;
- this.vbox66.Add (this.buildAndRunOptionsLabel);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox66 [this.buildAndRunOptionsLabel]));
- w8.Position = 4;
- w8.Expand = false;
- w8.Fill = false;
- w8.Padding = ((uint)(6));
+ this.vbox66.Add(this.buildAndRunOptionsLabel);
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox66[this.buildAndRunOptionsLabel]));
+ w9.Position = 5;
+ w9.Expand = false;
+ w9.Fill = false;
+ w9.Padding = ((uint)(6));
// Container child vbox66.Gtk.Box+BoxChild
- this.hbox44 = new global::Gtk.HBox ();
+ this.hbox44 = new global::Gtk.HBox();
this.hbox44.Name = "hbox44";
this.hbox44.Spacing = 6;
// Container child hbox44.Gtk.Box+BoxChild
- this.label71 = new global::Gtk.Label ();
+ this.label71 = new global::Gtk.Label();
this.label71.Name = "label71";
this.label71.Xalign = 0F;
this.label71.Yalign = 0F;
this.label71.LabelProp = " ";
- this.hbox44.Add (this.label71);
- global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox44 [this.label71]));
- w9.Position = 0;
- w9.Expand = false;
- w9.Fill = false;
+ this.hbox44.Add(this.label71);
+ global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox44[this.label71]));
+ w10.Position = 0;
+ w10.Expand = false;
+ w10.Fill = false;
// Container child hbox44.Gtk.Box+BoxChild
- this.vbox67 = new global::Gtk.VBox ();
+ this.vbox67 = new global::Gtk.VBox();
this.vbox67.Name = "vbox67";
this.vbox67.Spacing = 6;
// Container child vbox67.Gtk.Box+BoxChild
- this.saveChangesRadioButton = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("_Save changes to open documents"));
+ this.saveChangesRadioButton = new global::Gtk.RadioButton(global::Mono.Unix.Catalog.GetString("_Save changes to open documents"));
this.saveChangesRadioButton.Name = "saveChangesRadioButton";
- this.saveChangesRadioButton.Active = true;
this.saveChangesRadioButton.DrawIndicator = true;
this.saveChangesRadioButton.UseUnderline = true;
- this.saveChangesRadioButton.Group = new global::GLib.SList (global::System.IntPtr.Zero);
- this.vbox67.Add (this.saveChangesRadioButton);
- global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox67 [this.saveChangesRadioButton]));
- w10.Position = 0;
- w10.Expand = false;
- w10.Fill = false;
+ this.saveChangesRadioButton.Group = new global::GLib.SList(global::System.IntPtr.Zero);
+ this.vbox67.Add(this.saveChangesRadioButton);
+ global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox67[this.saveChangesRadioButton]));
+ w11.Position = 0;
+ w11.Expand = false;
+ w11.Fill = false;
// Container child vbox67.Gtk.Box+BoxChild
- this.promptChangesRadioButton = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("_Prompt to save changes to open documents"));
+ this.promptChangesRadioButton = new global::Gtk.RadioButton(global::Mono.Unix.Catalog.GetString("_Prompt to save changes to open documents"));
this.promptChangesRadioButton.Name = "promptChangesRadioButton";
this.promptChangesRadioButton.DrawIndicator = true;
this.promptChangesRadioButton.UseUnderline = true;
this.promptChangesRadioButton.Group = this.saveChangesRadioButton.Group;
- this.vbox67.Add (this.promptChangesRadioButton);
- global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox67 [this.promptChangesRadioButton]));
- w11.Position = 1;
- w11.Expand = false;
- w11.Fill = false;
+ this.vbox67.Add(this.promptChangesRadioButton);
+ global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox67[this.promptChangesRadioButton]));
+ w12.Position = 1;
+ w12.Expand = false;
+ w12.Fill = false;
// Container child vbox67.Gtk.Box+BoxChild
- this.noSaveRadioButton = new global::Gtk.RadioButton (global::Mono.Unix.Catalog.GetString ("_Don't save changes to open documents "));
+ this.noSaveRadioButton = new global::Gtk.RadioButton(global::Mono.Unix.Catalog.GetString("_Don't save changes to open documents "));
this.noSaveRadioButton.Name = "noSaveRadioButton";
this.noSaveRadioButton.DrawIndicator = true;
this.noSaveRadioButton.UseUnderline = true;
this.noSaveRadioButton.Group = this.saveChangesRadioButton.Group;
- this.vbox67.Add (this.noSaveRadioButton);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox67 [this.noSaveRadioButton]));
- w12.Position = 2;
- w12.Expand = false;
- w12.Fill = false;
- this.hbox44.Add (this.vbox67);
- global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.hbox44 [this.vbox67]));
- w13.Position = 1;
+ this.vbox67.Add(this.noSaveRadioButton);
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox67[this.noSaveRadioButton]));
+ w13.Position = 2;
w13.Expand = false;
- this.vbox66.Add (this.hbox44);
- global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox66 [this.hbox44]));
- w14.Position = 5;
- this.Add (this.vbox66);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
+ w13.Fill = false;
+ this.hbox44.Add(this.vbox67);
+ global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox44[this.vbox67]));
+ w14.Position = 1;
+ w14.Expand = false;
+ this.vbox66.Add(this.hbox44);
+ global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox66[this.hbox44]));
+ w15.Position = 6;
+ this.Add(this.vbox66);
+ if ((this.Child != null))
+ {
+ this.Child.ShowAll();
}
- this.Show ();
+ this.Show();
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs
index cb945ba4ae..f12e3d37b7 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget.cs
@@ -2,7 +2,7 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.Ide.Gui.OptionPanels
{
- public partial class IDEStyleOptionsPanelWidget
+ partial class IDEStyleOptionsPanelWidget
{
private global::Gtk.VBox vbox13;
private global::Gtk.Table table1;
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs
index 1f7c68b751..9138732a01 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Gui.OptionPanels.KeyBindingsPanel.cs
@@ -28,7 +28,7 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
private global::Gtk.HBox warningBox;
- private global::Gtk.Image image3;
+ private global::MonoDevelop.Components.ImageView imageWarning;
private global::Gtk.Label label2;
@@ -140,11 +140,12 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
this.warningBox.Name = "warningBox";
this.warningBox.Spacing = 6;
// Container child warningBox.Gtk.Box+BoxChild
- this.image3 = new global::Gtk.Image ();
- this.image3.Name = "image3";
- this.image3.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-dialog-warning", global::Gtk.IconSize.Menu);
- this.warningBox.Add (this.image3);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.warningBox [this.image3]));
+ this.imageWarning = new global::MonoDevelop.Components.ImageView ();
+ this.imageWarning.Name = "imageWarning";
+ this.imageWarning.IconId = "gtk-dialog-warning";
+ this.imageWarning.IconSize = ((global::Gtk.IconSize)(1));
+ this.warningBox.Add (this.imageWarning);
+ global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.warningBox [this.imageWarning]));
w8.Position = 0;
w8.Expand = false;
w8.Fill = false;
@@ -231,19 +232,16 @@ namespace MonoDevelop.Ide.Gui.OptionPanels
this.updateButton.Name = "updateButton";
this.updateButton.UseUnderline = true;
this.updateButton.Label = global::Mono.Unix.Catalog.GetString ("Apply");
- global::Gtk.Image w20 = new global::Gtk.Image ();
- w20.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-apply", global::Gtk.IconSize.Button);
- this.updateButton.Image = w20;
this.hbox.Add (this.updateButton);
- global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.hbox [this.updateButton]));
- w21.Position = 2;
+ global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox [this.updateButton]));
+ w20.Position = 2;
+ w20.Expand = false;
+ w20.Fill = false;
+ this.vbox.Add (this.hbox);
+ global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox [this.hbox]));
+ w21.Position = 6;
w21.Expand = false;
w21.Fill = false;
- this.vbox.Add (this.hbox);
- global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox [this.hbox]));
- w22.Position = 6;
- w22.Expand = false;
- w22.Fill = false;
this.Add (this.vbox);
if ((this.Child != null)) {
this.Child.ShowAll ();
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.ProgressMonitoring.ProgressBarMonitor.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.ProgressMonitoring.ProgressBarMonitor.cs
deleted file mode 100644
index dae4d14160..0000000000
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.ProgressMonitoring.ProgressBarMonitor.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-
-// This file has been generated by the GUI designer. Do not modify.
-namespace MonoDevelop.Ide.ProgressMonitoring
-{
- public partial class ProgressBarMonitor
- {
- private global::Gtk.HBox hbox1;
- private global::Gtk.ProgressBar progressBar;
- private global::Gtk.Button buttonCancel;
-
- protected virtual void Build ()
- {
- global::Stetic.Gui.Initialize (this);
- // Widget MonoDevelop.Ide.ProgressMonitoring.ProgressBarMonitor
- global::Stetic.BinContainer.Attach (this);
- this.Name = "MonoDevelop.Ide.ProgressMonitoring.ProgressBarMonitor";
- // Container child MonoDevelop.Ide.ProgressMonitoring.ProgressBarMonitor.Gtk.Container+ContainerChild
- this.hbox1 = new global::Gtk.HBox ();
- this.hbox1.Name = "hbox1";
- this.hbox1.Spacing = 3;
- // Container child hbox1.Gtk.Box+BoxChild
- this.progressBar = new global::Gtk.ProgressBar ();
- this.progressBar.Name = "progressBar";
- this.hbox1.Add (this.progressBar);
- global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.progressBar]));
- w1.Position = 0;
- // Container child hbox1.Gtk.Box+BoxChild
- this.buttonCancel = new global::Gtk.Button ();
- this.buttonCancel.CanFocus = true;
- this.buttonCancel.Name = "buttonCancel";
- this.buttonCancel.UseUnderline = true;
- this.buttonCancel.Relief = ((global::Gtk.ReliefStyle)(2));
- this.buttonCancel.Label = "";
- global::Gtk.Image w2 = new global::Gtk.Image ();
- w2.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-cancel", global::Gtk.IconSize.Menu);
- this.buttonCancel.Image = w2;
- this.hbox1.Add (this.buttonCancel);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.buttonCancel]));
- w3.Position = 1;
- w3.Expand = false;
- w3.Fill = false;
- this.Add (this.hbox1);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
- }
- this.Hide ();
- }
- }
-}
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.AddExternalFileDialog.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.AddExternalFileDialog.cs
index f758b49f47..a492c3442c 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.AddExternalFileDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.AddExternalFileDialog.cs
@@ -5,22 +5,39 @@ namespace MonoDevelop.Ide.Projects
internal partial class AddExternalFileDialog
{
private global::Gtk.HBox hbox1;
+
private global::Gtk.VBox vbox3;
- private global::Gtk.Image image23;
+
+ private global::MonoDevelop.Components.ImageView iconQuestion;
+
private global::Gtk.VBox vbox2;
+
private global::Gtk.Label labelTitle;
+
private global::Gtk.Alignment alignment1;
+
private global::Gtk.VBox vbox4;
+
private global::Gtk.RadioButton radioKeep;
+
private global::Gtk.Label labelKeep;
+
private global::Gtk.RadioButton radioCopy;
+
private global::Gtk.Label label4;
+
private global::Gtk.RadioButton radioMove;
+
private global::Gtk.Label label5;
+
private global::Gtk.RadioButton radioLink;
+
private global::Gtk.Label label6;
+
private global::Gtk.CheckButton checkApplyAll;
+
private global::Gtk.Button buttonCancel;
+
private global::Gtk.Button buttonOk;
protected virtual void Build ()
@@ -44,11 +61,12 @@ namespace MonoDevelop.Ide.Projects
this.vbox3.Name = "vbox3";
this.vbox3.Spacing = 6;
// Container child vbox3.Gtk.Box+BoxChild
- this.image23 = new global::Gtk.Image ();
- this.image23.Name = "image23";
- this.image23.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-dialog-question", global::Gtk.IconSize.Dialog);
- this.vbox3.Add (this.image23);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.image23]));
+ this.iconQuestion = new global::MonoDevelop.Components.ImageView ();
+ this.iconQuestion.Name = "iconQuestion";
+ this.iconQuestion.IconId = "gtk-dialog-question";
+ this.iconQuestion.IconSize = ((global::Gtk.IconSize)(6));
+ this.vbox3.Add (this.iconQuestion);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.iconQuestion]));
w2.Position = 0;
w2.Expand = false;
w2.Fill = false;
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.AddMimeTypeDialog.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.AddMimeTypeDialog.cs
index 06a5ead747..61f30da982 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.AddMimeTypeDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.AddMimeTypeDialog.cs
@@ -5,12 +5,19 @@ namespace MonoDevelop.Ide.Projects
internal partial class AddMimeTypeDialog
{
private global::Gtk.VBox vbox2;
+
private global::Gtk.Label label1;
+
private global::Gtk.Entry entry;
+
private global::Gtk.HBox hbox1;
- private global::Gtk.Image image;
+
+ private global::MonoDevelop.Components.ImageView image;
+
private global::Gtk.Label labelDesc;
+
private global::Gtk.Button buttonCancel;
+
private global::Gtk.Button buttonOk;
protected virtual void Build ()
@@ -55,9 +62,10 @@ namespace MonoDevelop.Ide.Projects
this.hbox1.Name = "hbox1";
this.hbox1.Spacing = 6;
// Container child hbox1.Gtk.Box+BoxChild
- this.image = new global::Gtk.Image ();
+ this.image = new global::MonoDevelop.Components.ImageView ();
this.image.Name = "image";
- this.image.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-dialog-error", global::Gtk.IconSize.Menu);
+ this.image.IconId = "gtk-dialog-error";
+ this.image.IconSize = ((global::Gtk.IconSize)(1));
this.hbox1.Add (this.image);
global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.image]));
w4.Position = 0;
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.DeleteConfigDialog.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.DeleteConfigDialog.cs
index 85f290f362..6cf3df29ed 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.DeleteConfigDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.DeleteConfigDialog.cs
@@ -5,11 +5,17 @@ namespace MonoDevelop.Ide.Projects
internal partial class DeleteConfigDialog
{
private global::Gtk.HBox hbox64;
- private global::Gtk.Image image6;
+
+ private global::MonoDevelop.Components.ImageView imageQuestion;
+
private global::Gtk.VBox vbox80;
+
private global::Gtk.Label label107;
+
private global::Gtk.CheckButton deleteChildrenCheck;
+
private global::Gtk.Button button11;
+
private global::Gtk.Button button12;
protected virtual void Build ()
@@ -28,12 +34,13 @@ namespace MonoDevelop.Ide.Projects
this.hbox64.Spacing = 12;
this.hbox64.BorderWidth = ((uint)(12));
// Container child hbox64.Gtk.Box+BoxChild
- this.image6 = new global::Gtk.Image ();
- this.image6.Name = "image6";
- this.image6.Yalign = 0F;
- this.image6.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-dialog-question", global::Gtk.IconSize.Dialog);
- this.hbox64.Add (this.image6);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox64 [this.image6]));
+ this.imageQuestion = new global::MonoDevelop.Components.ImageView ();
+ this.imageQuestion.Name = "imageQuestion";
+ this.imageQuestion.Yalign = 0F;
+ this.imageQuestion.IconSize = ((global::Gtk.IconSize)(6));
+ this.imageQuestion.IconId = "gtk-dialog-question";
+ this.hbox64.Add (this.imageQuestion);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox64 [this.imageQuestion]));
w2.Position = 0;
w2.Expand = false;
w2.Fill = false;
@@ -68,7 +75,7 @@ namespace MonoDevelop.Ide.Projects
w5.Position = 1;
w1.Add (this.hbox64);
global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox64]));
- w6.Position = 2;
+ w6.Position = 0;
// Internal child MonoDevelop.Ide.Projects.DeleteConfigDialog.ActionArea
global::Gtk.HButtonBox w7 = this.ActionArea;
w7.Name = "dialog-action_area7";
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.GtkProjectConfigurationWidget.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.GtkProjectConfigurationWidget.cs
index e0ba21b333..ee403bd06f 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.GtkProjectConfigurationWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.GtkProjectConfigurationWidget.cs
@@ -127,7 +127,7 @@ namespace MonoDevelop.Ide.Projects
this.createProjectWithinSolutionDirectoryCheckBox = new global::Gtk.CheckButton ();
this.createProjectWithinSolutionDirectoryCheckBox.CanFocus = true;
this.createProjectWithinSolutionDirectoryCheckBox.Name = "createProjectWithinSolutionDirectoryCheckBox";
- this.createProjectWithinSolutionDirectoryCheckBox.Label = global::Mono.Unix.Catalog.GetString ("Create a project within the solution directory.");
+ this.createProjectWithinSolutionDirectoryCheckBox.Label = global::Mono.Unix.Catalog.GetString ("Create a project directory within the solution directory.");
this.createProjectWithinSolutionDirectoryCheckBox.Active = true;
this.createProjectWithinSolutionDirectoryCheckBox.DrawIndicator = true;
this.createProjectWithinSolutionDirectoryCheckBox.UseUnderline = true;
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.GtkProjectFolderPreviewWidget.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.GtkProjectFolderPreviewWidget.cs
index e896c5f91a..8e549ed264 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.GtkProjectFolderPreviewWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.GtkProjectFolderPreviewWidget.cs
@@ -33,7 +33,7 @@ namespace MonoDevelop.Ide.Projects
// Container child previewLabelHBox.Gtk.Box+BoxChild
this.previewLabel = new global::Gtk.Label ();
this.previewLabel.Name = "previewLabel";
- this.previewLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span weight=\'bold\' foreground=\'#555555\'>PREVIEW</span>");
+ this.previewLabel.LabelProp = "<span weight='bold' foreground='#555555'>PREVIEW</span>";
this.previewLabel.UseMarkup = true;
this.previewLabelHBox.Add (this.previewLabel);
global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.previewLabelHBox [this.previewLabel]));
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.NewFileDialog.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.NewFileDialog.cs
index 750573d55c..07a0fe3ac4 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.NewFileDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.NewFileDialog.cs
@@ -5,27 +5,49 @@ namespace MonoDevelop.Ide.Projects
internal partial class NewFileDialog
{
private global::Gtk.VBox vbox2;
+
private global::Gtk.HPaned hpaned1;
+
private global::Gtk.ScrolledWindow scrolledwindow1;
+
private global::Gtk.TreeView catView;
+
private global::Gtk.HPaned panedTemplates;
+
private global::Gtk.VBox boxTemplates;
+
private global::Gtk.ScrolledWindow scrolledInfo;
+
private global::Gtk.VBox boxInfo;
+
private global::Gtk.Label labelTemplateTitle;
+
private global::Gtk.Label infoLabel;
+
private global::Gtk.Label label1;
+
private global::Gtk.HBox hbox2;
+
private global::Gtk.Label label2;
+
private global::Gtk.Entry nameEntry;
+
private global::Gtk.VBox boxProject;
+
private global::Gtk.HBox hbox3;
+
private global::Gtk.CheckButton projectAddCheckbox;
+
private global::Gtk.ComboBox projectAddCombo;
+
private global::Gtk.HBox hbox4;
+
private global::Gtk.Label projectPathLabel;
+
private global::MonoDevelop.Components.FolderEntry projectFolderEntry;
+
private global::Gtk.Button cancelButton;
+
private global::Gtk.Button okButton;
protected virtual void Build ()
@@ -211,6 +233,7 @@ namespace MonoDevelop.Ide.Projects
// Container child hbox4.Gtk.Box+BoxChild
this.projectFolderEntry = new global::MonoDevelop.Components.FolderEntry ();
this.projectFolderEntry.Name = "projectFolderEntry";
+ this.projectFolderEntry.DisplayAsRelativePath = false;
this.hbox4.Add (this.projectFolderEntry);
global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.projectFolderEntry]));
w21.Position = 1;
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.OptionPanels.CodeFormattingPanelWidget.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.OptionPanels.CodeFormattingPanelWidget.cs
index 6f9d349c9a..025ca5444b 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.OptionPanels.CodeFormattingPanelWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.OptionPanels.CodeFormattingPanelWidget.cs
@@ -5,13 +5,21 @@ namespace MonoDevelop.Ide.Projects.OptionPanels
internal partial class CodeFormattingPanelWidget
{
private global::Gtk.VBox vbox1;
+
private global::Gtk.Label label1;
+
private global::Gtk.HBox hbox1;
+
private global::Gtk.ScrolledWindow GtkScrolledWindow;
+
private global::Gtk.TreeView tree;
+
private global::Gtk.VBox boxButtons;
+
private global::Gtk.Button buttonAdd;
+
private global::Gtk.Button buttonRemove;
+
private global::Gtk.Button buttonEdit;
protected virtual void Build ()
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.ProjectFileSelectorDialog.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.ProjectFileSelectorDialog.cs
index 2b8d39186d..61d4f351a8 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.ProjectFileSelectorDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.ProjectFileSelectorDialog.cs
@@ -5,18 +5,33 @@ namespace MonoDevelop.Ide.Projects
public partial class ProjectFileSelectorDialog
{
private global::Gtk.HPaned hpaned1;
+
private global::Gtk.VBox vbox3;
+
private global::Gtk.ScrolledWindow GtkScrolledWindow;
+
private global::Gtk.TreeView projectTree;
+
private global::Gtk.VBox vbox4;
+
private global::Gtk.ScrolledWindow GtkScrolledWindow1;
+
private global::Gtk.TreeView fileList;
+
private global::Gtk.HBox hbox2;
+
private global::Gtk.Button AddFileButton;
+
+ private global::MonoDevelop.Components.ImageView imageAdd;
+
private global::Gtk.HBox typeBox;
+
private global::Gtk.Label label2;
+
private global::Gtk.ComboBox fileTypeCombo;
+
private global::Gtk.Button buttonCancel;
+
private global::Gtk.Button buttonOk;
protected virtual void Build ()
@@ -80,12 +95,13 @@ namespace MonoDevelop.Ide.Projects
this.AddFileButton.TooltipMarkup = "Add existing files to the project";
this.AddFileButton.CanFocus = true;
this.AddFileButton.Name = "AddFileButton";
- this.AddFileButton.UseUnderline = true;
this.AddFileButton.Relief = ((global::Gtk.ReliefStyle)(2));
- this.AddFileButton.Label = "";
- global::Gtk.Image w7 = new global::Gtk.Image ();
- w7.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-add", global::Gtk.IconSize.Menu);
- this.AddFileButton.Image = w7;
+ // Container child AddFileButton.Gtk.Container+ContainerChild
+ this.imageAdd = new global::MonoDevelop.Components.ImageView ();
+ this.imageAdd.Name = "imageAdd";
+ this.imageAdd.IconSize = ((global::Gtk.IconSize)(1));
+ this.imageAdd.IconId = "gtk-add";
+ this.AddFileButton.Add (this.imageAdd);
this.hbox2.Add (this.AddFileButton);
global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.AddFileButton]));
w8.Position = 0;
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.SelectReferenceDialog.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.SelectReferenceDialog.cs
index 97c14e1eff..c0262c6ab2 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.SelectReferenceDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.Projects.SelectReferenceDialog.cs
@@ -5,18 +5,33 @@ namespace MonoDevelop.Ide.Projects
internal partial class SelectReferenceDialog
{
private global::Gtk.VBox vbox5;
+
private global::Gtk.HPaned hpaned1;
+
private global::Gtk.Alignment alignment1;
+
private global::Gtk.Alignment alignment2;
+
private global::Gtk.VBox boxRefs;
+
private global::Gtk.Alignment selectedHeader;
+
private global::Gtk.HBox hbox2;
+
private global::Gtk.Label label114;
+
private global::Gtk.Button RemoveReferenceButton;
+
+ private global::MonoDevelop.Components.ImageView imageAdd;
+
private global::Gtk.HBox hbox4;
+
private global::Gtk.ScrolledWindow scrolledwindow2;
+
private global::Gtk.TreeView ReferencesTreeView;
+
private global::Gtk.Button cancelbutton;
+
private global::Gtk.Button okbutton;
protected virtual void Build ()
@@ -80,35 +95,26 @@ namespace MonoDevelop.Ide.Projects
this.RemoveReferenceButton = new global::Gtk.Button ();
this.RemoveReferenceButton.TooltipMarkup = "Remove";
this.RemoveReferenceButton.Name = "RemoveReferenceButton";
- this.RemoveReferenceButton.UseUnderline = true;
this.RemoveReferenceButton.FocusOnClick = false;
this.RemoveReferenceButton.Relief = ((global::Gtk.ReliefStyle)(2));
// Container child RemoveReferenceButton.Gtk.Container+ContainerChild
- global::Gtk.Alignment w4 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
- // Container child GtkAlignment.Gtk.Container+ContainerChild
- global::Gtk.HBox w5 = new global::Gtk.HBox ();
- w5.Spacing = 2;
- // Container child GtkHBox.Gtk.Container+ContainerChild
- global::Gtk.Image w6 = new global::Gtk.Image ();
- w6.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-delete", global::Gtk.IconSize.Menu);
- w5.Add (w6);
- // Container child GtkHBox.Gtk.Container+ContainerChild
- global::Gtk.Label w8 = new global::Gtk.Label ();
- w5.Add (w8);
- w4.Add (w5);
- this.RemoveReferenceButton.Add (w4);
+ this.imageAdd = new global::MonoDevelop.Components.ImageView ();
+ this.imageAdd.Name = "imageAdd";
+ this.imageAdd.IconId = "gtk-delete";
+ this.imageAdd.IconSize = ((global::Gtk.IconSize)(1));
+ this.RemoveReferenceButton.Add (this.imageAdd);
this.hbox2.Add (this.RemoveReferenceButton);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.RemoveReferenceButton]));
- w12.PackType = ((global::Gtk.PackType)(1));
- w12.Position = 1;
- w12.Expand = false;
- w12.Fill = false;
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.RemoveReferenceButton]));
+ w5.PackType = ((global::Gtk.PackType)(1));
+ w5.Position = 1;
+ w5.Expand = false;
+ w5.Fill = false;
this.selectedHeader.Add (this.hbox2);
this.boxRefs.Add (this.selectedHeader);
- global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.boxRefs [this.selectedHeader]));
- w14.Position = 0;
- w14.Expand = false;
- w14.Fill = false;
+ global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.boxRefs [this.selectedHeader]));
+ w7.Position = 0;
+ w7.Expand = false;
+ w7.Fill = false;
// Container child boxRefs.Gtk.Box+BoxChild
this.hbox4 = new global::Gtk.HBox ();
this.hbox4.HeightRequest = 150;
@@ -124,27 +130,27 @@ namespace MonoDevelop.Ide.Projects
this.ReferencesTreeView.HeadersVisible = false;
this.scrolledwindow2.Add (this.ReferencesTreeView);
this.hbox4.Add (this.scrolledwindow2);
- global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.scrolledwindow2]));
- w16.Position = 0;
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.scrolledwindow2]));
+ w9.Position = 0;
this.boxRefs.Add (this.hbox4);
- global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.boxRefs [this.hbox4]));
- w17.Position = 1;
+ global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.boxRefs [this.hbox4]));
+ w10.Position = 1;
this.alignment2.Add (this.boxRefs);
this.hpaned1.Add (this.alignment2);
- global::Gtk.Paned.PanedChild w19 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.alignment2]));
- w19.Shrink = false;
+ global::Gtk.Paned.PanedChild w12 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.alignment2]));
+ w12.Shrink = false;
this.vbox5.Add (this.hpaned1);
- global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hpaned1]));
- w20.Position = 0;
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hpaned1]));
+ w13.Position = 0;
w1.Add (this.vbox5);
- global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox5]));
- w21.Position = 0;
+ global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox5]));
+ w14.Position = 0;
// Internal child MonoDevelop.Ide.Projects.SelectReferenceDialog.ActionArea
- global::Gtk.HButtonBox w22 = this.ActionArea;
- w22.Name = "dialog-action_area2";
- w22.Spacing = 10;
- w22.BorderWidth = ((uint)(5));
- w22.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
+ global::Gtk.HButtonBox w15 = this.ActionArea;
+ w15.Name = "dialog-action_area2";
+ w15.Spacing = 10;
+ w15.BorderWidth = ((uint)(5));
+ w15.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
// Container child dialog-action_area2.Gtk.ButtonBox+ButtonBoxChild
this.cancelbutton = new global::Gtk.Button ();
this.cancelbutton.Name = "cancelbutton";
@@ -152,9 +158,9 @@ namespace MonoDevelop.Ide.Projects
this.cancelbutton.UseUnderline = true;
this.cancelbutton.Label = "gtk-cancel";
this.AddActionWidget (this.cancelbutton, -6);
- global::Gtk.ButtonBox.ButtonBoxChild w23 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w22 [this.cancelbutton]));
- w23.Expand = false;
- w23.Fill = false;
+ global::Gtk.ButtonBox.ButtonBoxChild w16 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w15 [this.cancelbutton]));
+ w16.Expand = false;
+ w16.Fill = false;
// Container child dialog-action_area2.Gtk.ButtonBox+ButtonBoxChild
this.okbutton = new global::Gtk.Button ();
this.okbutton.Name = "okbutton";
@@ -162,10 +168,10 @@ namespace MonoDevelop.Ide.Projects
this.okbutton.UseUnderline = true;
this.okbutton.Label = "gtk-ok";
this.AddActionWidget (this.okbutton, -5);
- global::Gtk.ButtonBox.ButtonBoxChild w24 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w22 [this.okbutton]));
- w24.Position = 1;
- w24.Expand = false;
- w24.Fill = false;
+ global::Gtk.ButtonBox.ButtonBoxChild w17 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w15 [this.okbutton]));
+ w17.Position = 1;
+ w17.Expand = false;
+ w17.Fill = false;
if ((this.Child != null)) {
this.Child.ShowAll ();
}
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.SelectEncodingsDialog.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.SelectEncodingsDialog.cs
index addc17c850..00931c3aaf 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.SelectEncodingsDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.SelectEncodingsDialog.cs
@@ -5,23 +5,45 @@ namespace MonoDevelop.Ide
internal partial class SelectEncodingsDialog
{
private global::Gtk.Table table5;
+
private global::Gtk.Label label106;
+
private global::Gtk.Label label107;
+
private global::Gtk.ScrolledWindow scrolledwindow10;
+
private global::Gtk.TreeView listAvail;
+
private global::Gtk.ScrolledWindow scrolledwindow11;
+
private global::Gtk.TreeView listSelected;
+
private global::Gtk.VBox vbox74;
+
private global::Gtk.Label label108;
+
private global::Gtk.Button btnAdd;
+
+ private global::MonoDevelop.Components.ImageView imageAdd;
+
private global::Gtk.Button btnRemove;
+
+ private global::MonoDevelop.Components.ImageView imageRemove;
+
private global::Gtk.Label label109;
+
private global::Gtk.VBox vbox75;
+
private global::Gtk.Button btnUp;
- private global::Gtk.Image image9;
+
+ private global::MonoDevelop.Components.ImageView imageUp;
+
private global::Gtk.Button btnDown;
- private global::Gtk.Image image10;
+
+ private global::MonoDevelop.Components.ImageView imageDown;
+
private global::Gtk.Button cancelbutton1;
+
private global::Gtk.Button okbutton1;
protected virtual void Build ()
@@ -111,27 +133,28 @@ namespace MonoDevelop.Ide
// Container child vbox74.Gtk.Box+BoxChild
this.btnAdd = new global::Gtk.Button ();
this.btnAdd.Name = "btnAdd";
- this.btnAdd.UseUnderline = true;
- this.btnAdd.Label = "";
- global::Gtk.Image w9 = new global::Gtk.Image ();
- w9.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-forward", global::Gtk.IconSize.Button);
- this.btnAdd.Image = w9;
+ // Container child btnAdd.Gtk.Container+ContainerChild
+ this.imageAdd = new global::MonoDevelop.Components.ImageView ();
+ this.imageAdd.Name = "imageAdd";
+ this.imageAdd.IconSize = ((global::Gtk.IconSize)(4));
+ this.imageAdd.IconId = "gtk-add";
+ this.btnAdd.Add (this.imageAdd);
this.vbox74.Add (this.btnAdd);
global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox74 [this.btnAdd]));
w10.Position = 1;
- w10.Expand = false;
w10.Fill = false;
// Container child vbox74.Gtk.Box+BoxChild
this.btnRemove = new global::Gtk.Button ();
this.btnRemove.Name = "btnRemove";
- this.btnRemove.Label = null;
- global::Gtk.Image w11 = new global::Gtk.Image ();
- w11.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-back", global::Gtk.IconSize.SmallToolbar);
- this.btnRemove.Image = w11;
+ // Container child btnRemove.Gtk.Container+ContainerChild
+ this.imageRemove = new global::MonoDevelop.Components.ImageView ();
+ this.imageRemove.Name = "imageRemove";
+ this.imageRemove.IconSize = ((global::Gtk.IconSize)(4));
+ this.imageRemove.IconId = "gtk-remove";
+ this.btnRemove.Add (this.imageRemove);
this.vbox74.Add (this.btnRemove);
global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox74 [this.btnRemove]));
w12.Position = 2;
- w12.Expand = false;
w12.Fill = false;
// Container child vbox74.Gtk.Box+BoxChild
this.label109 = new global::Gtk.Label ();
@@ -157,13 +180,11 @@ namespace MonoDevelop.Ide
this.btnUp = new global::Gtk.Button ();
this.btnUp.Name = "btnUp";
// Container child btnUp.Gtk.Container+ContainerChild
- this.image9 = new global::Gtk.Image ();
- this.image9.Name = "image9";
- this.image9.Xalign = 0F;
- this.image9.Yalign = 0F;
- this.image9.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-up", global::Gtk.IconSize.Button);
- this.btnUp.Add (this.image9);
- this.btnUp.Label = null;
+ this.imageUp = new global::MonoDevelop.Components.ImageView ();
+ this.imageUp.Name = "imageUp";
+ this.imageUp.IconSize = ((global::Gtk.IconSize)(4));
+ this.imageUp.IconId = "gtk-go-up";
+ this.btnUp.Add (this.imageUp);
this.vbox75.Add (this.btnUp);
global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox75 [this.btnUp]));
w16.Position = 0;
@@ -173,13 +194,11 @@ namespace MonoDevelop.Ide
this.btnDown = new global::Gtk.Button ();
this.btnDown.Name = "btnDown";
// Container child btnDown.Gtk.Container+ContainerChild
- this.image10 = new global::Gtk.Image ();
- this.image10.Name = "image10";
- this.image10.Xalign = 0F;
- this.image10.Yalign = 0F;
- this.image10.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-down", global::Gtk.IconSize.Button);
- this.btnDown.Add (this.image10);
- this.btnDown.Label = null;
+ this.imageDown = new global::MonoDevelop.Components.ImageView ();
+ this.imageDown.Name = "imageDown";
+ this.imageDown.IconSize = ((global::Gtk.IconSize)(4));
+ this.imageDown.IconId = "gtk-go-down";
+ this.btnDown.Add (this.imageDown);
this.vbox75.Add (this.btnDown);
global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox75 [this.btnDown]));
w18.Position = 1;
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.StandardHeader.StandardHeaderPolicyPanelWidget.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.StandardHeader.StandardHeaderPolicyPanelWidget.cs
index 94a5eaabe9..b71bc465f0 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.StandardHeader.StandardHeaderPolicyPanelWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/MonoDevelop.Ide.StandardHeader.StandardHeaderPolicyPanelWidget.cs
@@ -2,11 +2,20 @@
// This file has been generated by the GUI designer. Do not modify.
namespace MonoDevelop.Ide.StandardHeader
{
- internal partial class StandardHeaderPolicyPanelWidget
+ public partial class StandardHeaderPolicyPanelWidget
{
private global::Gtk.VBox vbox2;
+
+ private global::Gtk.HBox hbox2;
+
private global::Gtk.ScrolledWindow GtkScrolledWindow;
+
private global::Gtk.TextView headerText;
+
+ private global::Gtk.ScrolledWindow GtkScrolledWindow1;
+
+ private global::Gtk.TreeView treeviewTemplates;
+
private global::Gtk.CheckButton includeAutoCheck;
protected virtual void Build ()
@@ -20,6 +29,10 @@ namespace MonoDevelop.Ide.StandardHeader
this.vbox2.Name = "vbox2";
this.vbox2.Spacing = 6;
// Container child vbox2.Gtk.Box+BoxChild
+ this.hbox2 = new global::Gtk.HBox ();
+ this.hbox2.Name = "hbox2";
+ this.hbox2.Spacing = 6;
+ // Container child hbox2.Gtk.Box+BoxChild
this.GtkScrolledWindow = new global::Gtk.ScrolledWindow ();
this.GtkScrolledWindow.Name = "GtkScrolledWindow";
this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
@@ -28,9 +41,24 @@ namespace MonoDevelop.Ide.StandardHeader
this.headerText.CanFocus = true;
this.headerText.Name = "headerText";
this.GtkScrolledWindow.Add (this.headerText);
- this.vbox2.Add (this.GtkScrolledWindow);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.GtkScrolledWindow]));
+ this.hbox2.Add (this.GtkScrolledWindow);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.GtkScrolledWindow]));
w2.Position = 0;
+ // Container child hbox2.Gtk.Box+BoxChild
+ this.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow ();
+ this.GtkScrolledWindow1.Name = "GtkScrolledWindow1";
+ this.GtkScrolledWindow1.ShadowType = ((global::Gtk.ShadowType)(1));
+ // Container child GtkScrolledWindow1.Gtk.Container+ContainerChild
+ this.treeviewTemplates = new global::Gtk.TreeView ();
+ this.treeviewTemplates.CanFocus = true;
+ this.treeviewTemplates.Name = "treeviewTemplates";
+ this.GtkScrolledWindow1.Add (this.treeviewTemplates);
+ this.hbox2.Add (this.GtkScrolledWindow1);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.GtkScrolledWindow1]));
+ w4.Position = 1;
+ this.vbox2.Add (this.hbox2);
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox2]));
+ w5.Position = 0;
// Container child vbox2.Gtk.Box+BoxChild
this.includeAutoCheck = new global::Gtk.CheckButton ();
this.includeAutoCheck.CanFocus = true;
@@ -39,10 +67,10 @@ namespace MonoDevelop.Ide.StandardHeader
this.includeAutoCheck.DrawIndicator = true;
this.includeAutoCheck.UseUnderline = true;
this.vbox2.Add (this.includeAutoCheck);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.includeAutoCheck]));
- w3.Position = 1;
- w3.Expand = false;
- w3.Fill = false;
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.includeAutoCheck]));
+ w6.Position = 1;
+ w6.Expand = false;
+ w6.Fill = false;
this.Add (this.vbox2);
if ((this.Child != null)) {
this.Child.ShowAll ();
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/generated.cs b/main/src/core/MonoDevelop.Ide/gtk-gui/generated.cs
index 5cdc11900b..886fd2e124 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/generated.cs
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/generated.cs
@@ -59,7 +59,8 @@ namespace Stetic
if ((this.uimanager != null)) {
Gtk.Widget w;
w = this.child.Toplevel;
- if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) {
+ if (((w != null)
+ && typeof(Gtk.Window).IsInstanceOfType (w))) {
((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup);
this.uimanager = null;
}
@@ -67,40 +68,6 @@ namespace Stetic
}
}
- internal class IconLoader
- {
- public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size)
- {
- Gdk.Pixbuf res = widget.RenderIcon (name, size, null);
- if ((res != null)) {
- return res;
- } else {
- int sz;
- int sy;
- global::Gtk.Icon.SizeLookup (size, out sz, out sy);
- try {
- return Gtk.IconTheme.Default.LoadIcon (name, sz, 0);
- } catch (System.Exception) {
- if ((name != "gtk-missing-image")) {
- return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size);
- } else {
- Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz);
- Gdk.GC gc = new Gdk.GC (pmap);
- gc.RgbFgColor = new Gdk.Color (255, 255, 255);
- pmap.DrawRectangle (gc, true, 0, 0, sz, sz);
- gc.RgbFgColor = new Gdk.Color (0, 0, 0);
- pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1));
- gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
- gc.RgbFgColor = new Gdk.Color (255, 0, 0);
- pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4)));
- pmap.DrawLine (gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)));
- return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
- }
- }
- }
- }
- }
-
internal class ActionGroups
{
public static Gtk.ActionGroup GetActionGroup (System.Type type)
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/gui.stetic b/main/src/core/MonoDevelop.Ide/gtk-gui/gui.stetic
index 7824c239d0..f9da3cca0e 100644
--- a/main/src/core/MonoDevelop.Ide/gtk-gui/gui.stetic
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/gui.stetic
@@ -331,9 +331,10 @@
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
- <widget class="Gtk.Image" id="image3">
+ <widget class="MonoDevelop.Components.ImageView" id="imageWarning">
<property name="MemberName" />
- <property name="Pixbuf">stock:gtk-dialog-warning Menu</property>
+ <property name="IconId">gtk-dialog-warning</property>
+ <property name="IconSize">Menu</property>
</widget>
<packing>
<property name="Position">0</property>
@@ -452,8 +453,7 @@
<widget class="Gtk.Button" id="updateButton">
<property name="MemberName" />
<property name="CanFocus">True</property>
- <property name="Type">TextAndIcon</property>
- <property name="Icon">stock:gtk-apply Button</property>
+ <property name="Type">TextOnly</property>
<property name="Label" translatable="yes">Apply</property>
<property name="UseUnderline">True</property>
</widget>
@@ -760,11 +760,12 @@
<property name="MemberName" />
<property name="Spacing">5</property>
<child>
- <widget class="Gtk.Image" id="image5">
+ <widget class="MonoDevelop.Components.ImageView" id="iconInfo">
<property name="MemberName" />
<property name="Xalign">0</property>
<property name="Yalign">0</property>
- <property name="Pixbuf">stock:gtk-dialog-info Dialog</property>
+ <property name="IconId">gtk-dialog-info</property>
+ <property name="IconSize">Dialog</property>
</widget>
<packing>
<property name="Position">0</property>
@@ -848,8 +849,7 @@
<child>
<widget class="Gtk.Button" id="nextButton">
<property name="MemberName" />
- <property name="Type">TextAndIcon</property>
- <property name="Icon">stock:gtk-go-forward Button</property>
+ <property name="Type">TextOnly</property>
<property name="Label" translatable="yes">_Next Tip</property>
<property name="UseUnderline">True</property>
</widget>
@@ -929,6 +929,22 @@
</packing>
</child>
<child>
+ <widget class="Gtk.CheckButton" id="parallelBuildCheckbox">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Label" translatable="yes">Enable parallel build of projects</property>
+ <property name="DrawIndicator">True</property>
+ <property name="HasLabel">True</property>
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
<widget class="Gtk.CheckButton" id="buildBeforeTestCheckBox">
<property name="MemberName" />
<property name="CanFocus">True</property>
@@ -938,7 +954,7 @@
<property name="UseUnderline">True</property>
</widget>
<packing>
- <property name="Position">2</property>
+ <property name="Position">3</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
@@ -991,7 +1007,7 @@ Diagnostic</property>
</child>
</widget>
<packing>
- <property name="Position">3</property>
+ <property name="Position">4</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
@@ -1006,7 +1022,7 @@ Diagnostic</property>
<property name="UseMarkup">True</property>
</widget>
<packing>
- <property name="Position">4</property>
+ <property name="Position">5</property>
<property name="AutoSize">False</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
@@ -1093,7 +1109,7 @@ Diagnostic</property>
</child>
</widget>
<packing>
- <property name="Position">5</property>
+ <property name="Position">6</property>
<property name="AutoSize">False</property>
</packing>
</child>
@@ -1673,8 +1689,7 @@ Diagnostic</property>
<property name="CanDefault">True</property>
<property name="HasDefault">True</property>
<property name="CanFocus">True</property>
- <property name="Type">TextAndIcon</property>
- <property name="Icon">stock:gtk-new Menu</property>
+ <property name="Type">TextOnly</property>
<property name="Label" translatable="yes">Create _Layout</property>
<property name="UseUnderline">True</property>
<property name="ResponseId">-5</property>
@@ -2438,11 +2453,15 @@ Diagnostic</property>
<child>
<widget class="Gtk.Button" id="btnAdd">
<property name="MemberName" />
- <property name="Type">TextAndIcon</property>
- <property name="Icon">stock:gtk-go-forward Button</property>
- <property name="Label" translatable="yes" />
- <property name="UseUnderline">True</property>
+ <property name="Type">Custom</property>
<signal name="Clicked" handler="OnAddClicked" />
+ <child>
+ <widget class="MonoDevelop.Components.ImageView" id="imageAdd">
+ <property name="MemberName" />
+ <property name="IconSize">Button</property>
+ <property name="IconId">gtk-add</property>
+ </widget>
+ </child>
</widget>
<packing>
<property name="Position">1</property>
@@ -2454,9 +2473,15 @@ Diagnostic</property>
<child>
<widget class="Gtk.Button" id="btnRemove">
<property name="MemberName" />
- <property name="Type">TextAndIcon</property>
- <property name="Icon">stock:gtk-go-back SmallToolbar</property>
+ <property name="Type">Custom</property>
<signal name="Clicked" handler="OnRemoveClicked" />
+ <child>
+ <widget class="MonoDevelop.Components.ImageView" id="imageRemove">
+ <property name="MemberName" />
+ <property name="IconSize">Button</property>
+ <property name="IconId">gtk-remove</property>
+ </widget>
+ </child>
</widget>
<packing>
<property name="Position">2</property>
@@ -2503,11 +2528,10 @@ Diagnostic</property>
<property name="Type">Custom</property>
<signal name="Clicked" handler="OnUpClicked" />
<child>
- <widget class="Gtk.Image" id="image9">
+ <widget class="MonoDevelop.Components.ImageView" id="imageUp">
<property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="Yalign">0</property>
- <property name="Pixbuf">stock:gtk-go-up Button</property>
+ <property name="IconSize">Button</property>
+ <property name="IconId">gtk-go-up</property>
</widget>
</child>
</widget>
@@ -2524,11 +2548,10 @@ Diagnostic</property>
<property name="Type">Custom</property>
<signal name="Clicked" handler="OnDownClicked" />
<child>
- <widget class="Gtk.Image" id="image10">
+ <widget class="MonoDevelop.Components.ImageView" id="imageDown">
<property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="Yalign">0</property>
- <property name="Pixbuf">stock:gtk-go-down Button</property>
+ <property name="IconSize">Button</property>
+ <property name="IconId">gtk-go-down</property>
</widget>
</child>
</widget>
@@ -2624,11 +2647,12 @@ Diagnostic</property>
<property name="Spacing">12</property>
<property name="BorderWidth">6</property>
<child>
- <widget class="Gtk.Image" id="image1">
+ <widget class="MonoDevelop.Components.ImageView" id="iconError">
<property name="MemberName" />
<property name="Xalign">0</property>
<property name="Yalign">0</property>
- <property name="Pixbuf">stock:gtk-dialog-error Dialog</property>
+ <property name="IconId">gtk-dialog-error</property>
+ <property name="IconSize">Dialog</property>
</widget>
<packing>
<property name="Position">0</property>
@@ -3075,6 +3099,7 @@ Diagnostic</property>
</child>
</widget>
<widget class="Gtk.Bin" id="MonoDevelop.Ide.Gui.OptionPanels.IDEStyleOptionsPanelWidget" design-size="315 285">
+ <property name="GeneratePublic">False</property>
<property name="MemberName" />
<child>
<widget class="Gtk.VBox" id="vbox13">
@@ -3679,22 +3704,48 @@ Diagnostic</property>
<widget class="Gtk.Bin" id="MonoDevelop.Ide.StandardHeader.StandardHeaderPolicyPanelWidget" design-size="541 409">
<property name="MemberName" />
<property name="Visible">False</property>
- <property name="GeneratePublic">False</property>
<child>
<widget class="Gtk.VBox" id="vbox2">
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
- <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
+ <widget class="Gtk.HBox" id="hbox2">
<property name="MemberName" />
- <property name="ShadowType">In</property>
+ <property name="Spacing">6</property>
<child>
- <widget class="Gtk.TextView" id="headerText">
+ <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
<property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="ShowScrollbars">True</property>
- <property name="Text" translatable="yes" />
+ <property name="ShadowType">In</property>
+ <child>
+ <widget class="Gtk.TextView" id="headerText">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="ShowScrollbars">True</property>
+ <property name="Text" translatable="yes" />
+ </widget>
+ </child>
</widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow1">
+ <property name="MemberName" />
+ <property name="ShadowType">In</property>
+ <child>
+ <widget class="Gtk.TreeView" id="treeviewTemplates">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="ShowScrollbars">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ </packing>
</child>
</widget>
<packing>
@@ -3718,9 +3769,6 @@ Diagnostic</property>
<property name="Fill">False</property>
</packing>
</child>
- <child>
- <placeholder />
- </child>
</widget>
</child>
</widget>
@@ -4803,6 +4851,7 @@ Diagnostic</property>
<property name="Tooltip" translatable="yes">Switch to Find in Files</property>
<property name="CanFocus">True</property>
<property name="Label" translatable="yes">Find in Files</property>
+ <property name="Active">True</property>
<property name="DrawIndicator">False</property>
<property name="HasLabel">True</property>
<property name="UseUnderline">True</property>
@@ -5838,6 +5887,7 @@ All solutions</property>
<widget class="Gtk.Dialog" id="MonoDevelop.Ide.Gui.Dialogs.SelectFileFormatDialog" design-size="638 246">
<property name="MemberName" />
<property name="Visible">False</property>
+ <property name="GeneratePublic">False</property>
<property name="Title" translatable="yes">Select File Format</property>
<property name="WindowPosition">CenterOnParent</property>
<property name="Buttons">2</property>
@@ -5856,9 +5906,10 @@ All solutions</property>
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
- <widget class="Gtk.Image" id="image146">
+ <widget class="MonoDevelop.Components.ImageView" id="iconWarning">
<property name="MemberName" />
- <property name="Pixbuf">stock:gtk-dialog-warning Dialog</property>
+ <property name="IconId">gtk-dialog-warning</property>
+ <property name="IconSize">Dialog</property>
</widget>
<packing>
<property name="Position">0</property>
@@ -7756,10 +7807,11 @@ All solutions</property>
<property name="Spacing">12</property>
<property name="BorderWidth">12</property>
<child>
- <widget class="Gtk.Image" id="image6">
+ <widget class="MonoDevelop.Components.ImageView" id="imageQuestion">
<property name="MemberName" />
<property name="Yalign">0</property>
- <property name="Pixbuf">stock:gtk-dialog-question Dialog</property>
+ <property name="IconSize">Dialog</property>
+ <property name="IconId">gtk-dialog-question</property>
</widget>
<packing>
<property name="Position">0</property>
@@ -8321,6 +8373,7 @@ All solutions</property>
<widget class="Gtk.Bin" id="MonoDevelop.Ide.Projects.OptionPanels.BaseDirectoryPanelWidget" design-size="463 44">
<property name="MemberName" />
<property name="Visible">False</property>
+ <property name="GeneratePublic">False</property>
<child>
<widget class="Gtk.VBox" id="vbox2">
<property name="MemberName" />
@@ -9077,12 +9130,17 @@ Visual Studio generates a default ID for embedded resources, instead of simply u
<property name="MemberName" />
<property name="Tooltip" translatable="yes">Add existing files to the project</property>
<property name="CanFocus">True</property>
- <property name="Type">TextAndIcon</property>
- <property name="Icon">stock:gtk-add Menu</property>
- <property name="Label" translatable="yes" />
+ <property name="Type">Custom</property>
<property name="UseUnderline">True</property>
<property name="Relief">None</property>
<signal name="Clicked" handler="OnAddFileButtonClicked" />
+ <child>
+ <widget class="MonoDevelop.Components.ImageView" id="imageAdd">
+ <property name="MemberName" />
+ <property name="IconSize">Menu</property>
+ <property name="IconId">gtk-add</property>
+ </widget>
+ </child>
</widget>
<packing>
<property name="Position">0</property>
@@ -9241,10 +9299,11 @@ Visual Studio generates a default ID for embedded resources, instead of simply u
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
- <widget class="Gtk.Image" id="image">
+ <widget class="MonoDevelop.Components.ImageView" id="image">
<property name="MemberName" />
<property name="Visible">False</property>
- <property name="Pixbuf">stock:gtk-dialog-error Menu</property>
+ <property name="IconId">gtk-dialog-error</property>
+ <property name="IconSize">Menu</property>
</widget>
<packing>
<property name="Position">0</property>
@@ -9827,8 +9886,7 @@ Visual Studio generates a default ID for embedded resources, instead of simply u
<widget class="Gtk.Button" id="buttonReset">
<property name="MemberName" />
<property name="CanFocus">True</property>
- <property name="Type">TextAndIcon</property>
- <property name="Icon">stock:gtk-clear Menu</property>
+ <property name="Type">TextOnly</property>
<property name="Label" translatable="yes">Clear All Options</property>
<property name="UseUnderline">True</property>
<signal name="Clicked" handler="OnButtonResetClicked" />
@@ -9940,13 +9998,17 @@ Visual Studio generates a default ID for embedded resources, instead of simply u
<widget class="Gtk.Button" id="RemoveReferenceButton">
<property name="MemberName" />
<property name="Tooltip">Remove</property>
- <property name="Type">TextAndIcon</property>
- <property name="Icon">stock:gtk-delete Menu</property>
- <property name="Label" />
- <property name="UseUnderline">True</property>
+ <property name="Type">Custom</property>
<property name="FocusOnClick">False</property>
<property name="Relief">None</property>
<signal name="Clicked" handler="RemoveReference" />
+ <child>
+ <widget class="MonoDevelop.Components.ImageView" id="imageAdd">
+ <property name="MemberName" />
+ <property name="IconId">gtk-delete</property>
+ <property name="IconSize">Menu</property>
+ </widget>
+ </child>
</widget>
<packing>
<property name="PackType">End</property>
@@ -10933,42 +10995,6 @@ Visual Studio generates a default ID for embedded resources, instead of simply u
</widget>
</child>
</widget>
- <widget class="Gtk.Bin" id="MonoDevelop.Ide.ProgressMonitoring.ProgressBarMonitor" design-size="300 28">
- <property name="MemberName" />
- <property name="Visible">False</property>
- <child>
- <widget class="Gtk.HBox" id="hbox1">
- <property name="MemberName" />
- <property name="Spacing">3</property>
- <child>
- <widget class="Gtk.ProgressBar" id="progressBar">
- <property name="MemberName" />
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Button" id="buttonCancel">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Type">TextAndIcon</property>
- <property name="Icon">stock:gtk-cancel Menu</property>
- <property name="Label" translatable="yes" />
- <property name="UseUnderline">True</property>
- <property name="Relief">None</property>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
<widget class="Gtk.Dialog" id="MonoDevelop.Ide.Projects.AddExternalFileDialog" design-size="536 286">
<property name="MemberName" />
<property name="GeneratePublic">False</property>
@@ -10990,9 +11016,10 @@ Visual Studio generates a default ID for embedded resources, instead of simply u
<property name="MemberName" />
<property name="Spacing">6</property>
<child>
- <widget class="Gtk.Image" id="image23">
+ <widget class="MonoDevelop.Components.ImageView" id="iconQuestion">
<property name="MemberName" />
- <property name="Pixbuf">stock:gtk-dialog-question Dialog</property>
+ <property name="IconId">gtk-dialog-question</property>
+ <property name="IconSize">Dialog</property>
</widget>
<packing>
<property name="Position">0</property>
@@ -11300,6 +11327,7 @@ Visual Studio generates a default ID for embedded resources, instead of simply u
<widget class="Gtk.Bin" id="MonoDevelop.Ide.Projects.OptionPanels.PortableRuntimeOptionsPanelWidget" design-size="300 300">
<property name="MemberName" />
<property name="Visible">False</property>
+ <property name="GeneratePublic">False</property>
<child>
<widget class="Gtk.VBox" id="vbox1">
<property name="MemberName" />
@@ -11325,7 +11353,7 @@ Visual Studio generates a default ID for embedded resources, instead of simply u
<child>
<widget class="Gtk.Label" id="previewLabel">
<property name="MemberName" />
- <property name="LabelProp" translatable="yes">&lt;span weight='bold' foreground='#555555'&gt;PREVIEW&lt;/span&gt;</property>
+ <property name="LabelProp">&lt;span weight='bold' foreground='#555555'&gt;PREVIEW&lt;/span&gt;</property>
<property name="UseMarkup">True</property>
</widget>
<packing>
@@ -11493,7 +11521,7 @@ Visual Studio generates a default ID for embedded resources, instead of simply u
<widget class="Gtk.CheckButton" id="createProjectWithinSolutionDirectoryCheckBox">
<property name="MemberName" />
<property name="CanFocus">True</property>
- <property name="Label" translatable="yes">Create a project within the solution directory.</property>
+ <property name="Label" translatable="yes">Create a project directory within the solution directory.</property>
<property name="Active">True</property>
<property name="DrawIndicator">True</property>
<property name="HasLabel">True</property>
@@ -11831,4 +11859,4 @@ Visual Studio generates a default ID for embedded resources, instead of simply u
</widget>
</child>
</widget>
-</stetic-interface>
+</stetic-interface> \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/gtk-gui/objects.xml b/main/src/core/MonoDevelop.Ide/gtk-gui/objects.xml
new file mode 100644
index 0000000000..6f84df8755
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/gtk-gui/objects.xml
@@ -0,0 +1,241 @@
+<objects attr-sync="off">
+ <object type="MonoDevelop.Components.ImageView" palette-category="General" allow-children="false" base-type="Gtk.Misc">
+ <itemgroups>
+ <itemgroup label="ImageView Properties">
+ <property name="IconId" />
+ <property name="IconSize" />
+ </itemgroup>
+ </itemgroups>
+ <signals />
+ </object>
+ <object type="MonoDevelop.Ide.Gui.Components.ExtensibleTreeView" palette-category="General" allow-children="false" base-type="Gtk.ScrolledWindow">
+ <itemgroups>
+ <itemgroup label="ExtensibleTreeView Properties">
+ <property name="Id" />
+ <property name="Zoom" />
+ </itemgroup>
+ </itemgroups>
+ <signals>
+ <itemgroup label="ExtensibleTreeView Signals">
+ <signal name="CurrentItemActivated" />
+ </itemgroup>
+ </signals>
+ </object>
+ <object type="MonoDevelop.Ide.Gui.Components.ExecutionModeComboBox" palette-category="General" allow-children="false" base-type="Gtk.Bin">
+ <itemgroups />
+ <signals>
+ <itemgroup label="ExecutionModeComboBox Signals">
+ <signal name="SelectionChanged" />
+ </itemgroup>
+ </signals>
+ </object>
+ <object type="MonoDevelop.Components.FileEntry" palette-category="MonoDevelop.Components" allow-children="false" base-type="Gtk.HBox">
+ <itemgroups />
+ <signals />
+ </object>
+ <object type="MonoDevelop.Components.FolderEntry" palette-category="MonoDevelop.Components" allow-children="false" base-type="Gtk.HBox">
+ <itemgroups />
+ <signals />
+ </object>
+ <object type="MonoDevelop.Components.MenuButton" palette-category="MonoDevelop.Components" allow-children="false" base-type="Gtk.Button">
+ <itemgroups>
+ <itemgroup label="MenuButton Properties">
+ <property name="Label" />
+ <property name="UseUnderline" />
+ <property name="UseMarkup" />
+ </itemgroup>
+ </itemgroups>
+ <signals />
+ </object>
+ <object type="MonoDevelop.Components.FixedWidthWrapLabel" palette-category="MonoDevelop.Components" allow-children="false" base-type="Gtk.Widget">
+ <itemgroups>
+ <itemgroup label="FixedWidthWrapLabel Properties">
+ <property name="MaxWidth" />
+ <property name="Markup" />
+ <property name="Text" />
+ <property name="Indent" />
+ <property name="BreakOnPunctuation" />
+ <property name="BreakOnCamelCasing" />
+ </itemgroup>
+ </itemgroups>
+ <signals />
+ </object>
+ <object type="MonoDevelop.Components.FolderListSelector" palette-category="General" allow-children="false" base-type="Gtk.Bin">
+ <itemgroups />
+ <signals />
+ </object>
+ <object type="MonoDevelop.Components.SearchEntry" palette-category="General" allow-children="false" base-type="Gtk.EventBox">
+ <itemgroups>
+ <itemgroup label="SearchEntry Properties">
+ <property name="ForceFilterButtonVisible" />
+ <property name="HasFrame" />
+ <property name="RoundedShape" />
+ <property name="IsCheckMenu" />
+ <property name="ActiveFilterID" />
+ <property name="EmptyMessage" />
+ <property name="Query" />
+ <property name="Ready" />
+ <property name="HasFocus" />
+ </itemgroup>
+ </itemgroups>
+ <signals>
+ <itemgroup label="SearchEntry Signals">
+ <signal name="Changed" />
+ <signal name="Activated" />
+ <signal name="FilterChanged" />
+ <signal name="RequestMenu" />
+ </itemgroup>
+ </signals>
+ </object>
+ <object type="MonoDevelop.Components.PropertyGrid.PropertyGrid" palette-category="MonoDevelop.Components" allow-children="false" base-type="Gtk.VBox">
+ <itemgroups>
+ <itemgroup label="PropertyGrid Properties">
+ <property name="ShowToolbar" />
+ <property name="ShowHelp" />
+ </itemgroup>
+ </itemgroups>
+ <signals>
+ <itemgroup label="PropertyGrid Signals">
+ <signal name="Changed" />
+ </itemgroup>
+ </signals>
+ </object>
+ <object type="MonoDevelop.Components.MenuButtonEntry" palette-category="MonoDevelop.Components" allow-children="false" base-type="Gtk.HBox">
+ <itemgroups>
+ <itemgroup label="MenuButtonEntry Properties">
+ <property name="Text" />
+ </itemgroup>
+ </itemgroups>
+ <signals />
+ </object>
+ <object type="MonoDevelop.Ide.Gui.Components.ProjectFileEntry" palette-category="General" allow-children="false" base-type="Gtk.HBox">
+ <itemgroups>
+ <itemgroup label="ProjectFileEntry Properties">
+ <property name="DialogTitle" />
+ <property name="DefaultFilter" />
+ <property name="VerifyFileExistsInProject" />
+ <property name="EntryIsEditable" />
+ </itemgroup>
+ </itemgroups>
+ <signals>
+ <itemgroup label="ProjectFileEntry Signals">
+ <signal name="Changed" />
+ </itemgroup>
+ </signals>
+ </object>
+ <object type="MonoDevelop.Ide.Projects.OptionPanels.BaseDirectoryPanelWidget" palette-category="MonoDevelop.Projects.Gui" allow-children="false" base-type="Gtk.Bin">
+ <itemgroups>
+ <itemgroup label="BaseDirectoryPanelWidget Properties">
+ <property name="BaseDirectory" />
+ </itemgroup>
+ </itemgroups>
+ <signals />
+ </object>
+ <object type="MonoDevelop.Ide.Gui.Components.EnvVarList" palette-category="MonoDevelop.Projects.Gui" allow-children="false" base-type="Gtk.ScrolledWindow">
+ <itemgroups />
+ <signals />
+ </object>
+ <object type="MonoDevelop.Ide.Gui.Components.StringTagSelectorButton" palette-category="General" allow-children="false" base-type="Gtk.Bin">
+ <itemgroups />
+ <signals />
+ </object>
+ <object type="MonoDevelop.Components.CompactScrolledWindow" palette-category="General" allow-children="false" base-type="Gtk.ScrolledWindow">
+ <itemgroups>
+ <itemgroup label="CompactScrolledWindow Properties">
+ <property name="ShowBorderLine" />
+ </itemgroup>
+ </itemgroups>
+ <signals />
+ </object>
+ <object type="MonoDevelop.Ide.Gui.Components.ProjectSelectorWidget" palette-category="General" allow-children="false" base-type="Gtk.Bin">
+ <itemgroups>
+ <itemgroup label="ProjectSelectorWidget Properties">
+ <property name="ShowCheckboxes" />
+ <property name="CascadeCheckboxSelection" />
+ </itemgroup>
+ </itemgroups>
+ <signals>
+ <itemgroup label="ProjectSelectorWidget Signals">
+ <signal name="SelectionChanged" />
+ <signal name="ActiveChanged" />
+ </itemgroup>
+ </signals>
+ </object>
+ <object type="MonoDevelop.Ide.ProgressMonitoring.ProgressBarMonitor" palette-category="General" allow-children="false" base-type="Gtk.Bin">
+ <itemgroups>
+ <itemgroup label="ProgressBarMonitor Properties">
+ <property name="AllowCancel" />
+ <property name="ShowErrorsDialog" />
+ </itemgroup>
+ </itemgroups>
+ <signals />
+ </object>
+ <object type="MonoDevelop.Ide.Gui.Components.PriorityList" palette-category="General" allow-children="false" base-type="Gtk.Bin">
+ <itemgroups />
+ <signals />
+ </object>
+ <object type="MonoDevelop.Ide.Projects.OptionPanels.PortableRuntimeOptionsPanelWidget" palette-category="General" allow-children="false" base-type="Gtk.Bin">
+ <itemgroups />
+ <signals />
+ </object>
+ <object type="MonoDevelop.Components.DropDownBox" palette-category="Widgets" allow-children="false" base-type="Gtk.Button">
+ <itemgroups>
+ <itemgroup label="DropDownBox Properties">
+ <property name="Text" />
+ <property name="DrawButtonShape" />
+ <property name="DrawRightBorder" />
+ <property name="DrawLeftBorder" />
+ <property name="DefaultIconHeight" />
+ <property name="DefaultIconWidth" />
+ <property name="FixedWidth" />
+ <property name="FixedHeight" />
+ </itemgroup>
+ </itemgroups>
+ <signals />
+ </object>
+ <object type="Mono.TextEditor.PopupWindow.TooltipWindow.FixedWidthWrapLabel" palette-category="MonoDevelop.Components" allow-children="false" base-type="Gtk.Widget">
+ <itemgroups>
+ <itemgroup label="FixedWidthWrapLabel Properties">
+ <property name="MaxWidth" />
+ <property name="Markup" />
+ <property name="Text" />
+ <property name="Indent" />
+ <property name="BreakOnPunctuation" />
+ <property name="BreakOnCamelCasing" />
+ </itemgroup>
+ </itemgroups>
+ <signals />
+ </object>
+ <object type="Mono.TextEditor.Theatrics.AnimatedVBox" palette-category="Mono.TextEditor" allow-children="false" base-type="Gtk.Container">
+ <itemgroups />
+ <signals />
+ </object>
+ <object type="Mono.TextEditor.TextEditor" palette-category="Mono.TextEditor" allow-children="false" base-type="Gtk.Container">
+ <itemgroups>
+ <itemgroup label="TextEditor Properties">
+ <property name="TabsToSpaces" />
+ <property name="IMModule" />
+ <property name="LineHeight" />
+ <property name="SelectedText" />
+ <property name="SelectionAnchor" />
+ <property name="Text" />
+ <property name="SearchPattern" />
+ <property name="HighlightSearchPattern" />
+ <property name="IsCaseSensitive" />
+ <property name="IsWholeWordOnly" />
+ </itemgroup>
+ </itemgroups>
+ <signals>
+ <itemgroup label="TextEditor Signals">
+ <signal name="VScroll" />
+ <signal name="HScroll" />
+ <signal name="SelectionChanged" />
+ <signal name="Painted" />
+ <signal name="LinkRequest" />
+ <signal name="EditorOptionsChanged" />
+ <signal name="HighlightSearchPatternChanged" />
+ <signal name="BeginHover" />
+ </itemgroup>
+ </signals>
+ </object>
+</objects> \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/gtkrc b/main/src/core/MonoDevelop.Ide/gtkrc
index cd967ef523..0144ec125d 100644
--- a/main/src/core/MonoDevelop.Ide/gtkrc
+++ b/main/src/core/MonoDevelop.Ide/gtkrc
@@ -1,26 +1,30 @@
-# Theme for Xamarin composed by Lanedo GmbH
-# Copyright 2012 Xamarin Inc.
-# Authors:
+# Xamarin Studio GTK Theme
+# Copyright 2012-2016 Xamarin Inc.
+# Authors:
# Christian Kellner <christian.kellner@lanedo.com>
# Carlos Garnacho <carlos.garnacho@lanedo.com>
+# Cody Russell <cody@xamarin.com>
+# Vsevolod Kukol <vsevolod.kukol@xamarin.com>
+# Vaclav Vancura <vaclav@xamarin.com>
+
gtk-color-scheme =
-"bg_color: #f5f5f5
-fg_color: #000
-base_color: #fff
-text_color: #000
+"bg_color: #f5f5f5
+fg_color: #000
+base_color: #fff
+text_color: #000
selected_bg_color: #649dd6
selected_fg_color: #fff
-tooltip_bg_color: #fff9e5
-tooltip_fg_color: #000"
-
-gtk-button-images = 0
-gtk-menu-images = 0
-gtk-toolbar-style = 0
-gtk-enable-mnemonics = 0
-gtk-icon-sizes = "gtk-small-toolbar=16,16:gtk-large-toolbar=22,22"
+tooltip_bg_color: #fff9e5
+tooltip_fg_color: #000
+
+gtk-button-images = 0
+gtk-menu-images = 0
+gtk-toolbar-style = 0
+gtk-enable-mnemonics = 0
+gtk-icon-sizes = "gtk-small-toolbar=16,16:gtk-large-toolbar=22,22"
gtk-toolbar-icon-size = large-toolbar
-gtk-auto-mnemonics = 1
+gtk-auto-mnemonics = 1
style "default" {
@@ -28,31 +32,33 @@ style "default" {
ythickness = 1
### colours
- bg[NORMAL] = @bg_color
- bg[PRELIGHT] = @bg_color
- bg[SELECTED] = @selected_bg_color
- bg[INSENSITIVE] = @bg_color
- bg[ACTIVE] = @bg_color
-
- fg[NORMAL] = @fg_color
- fg[PRELIGHT] = @fg_color
- fg[SELECTED] = @selected_fg_color
- fg[INSENSITIVE] = darker (@bg_color)
- fg[ACTIVE] = @fg_color
-
- text[NORMAL] = @text_color
- text[PRELIGHT] = @text_color
- text[SELECTED] = @selected_fg_color
+
+ bg[NORMAL] = @bg_color
+ bg[PRELIGHT] = @bg_color
+ bg[SELECTED] = @selected_bg_color
+ bg[INSENSITIVE] = @bg_color
+ bg[ACTIVE] = @bg_color
+
+ fg[NORMAL] = @fg_color
+ fg[PRELIGHT] = @fg_color
+ fg[SELECTED] = @selected_fg_color
+ fg[INSENSITIVE] = darker (@bg_color)
+ fg[ACTIVE] = @fg_color
+
+ text[NORMAL] = @fg_color
+ text[PRELIGHT] = @fg_color
+ text[SELECTED] = @selected_fg_color
text[INSENSITIVE] = darker (@bg_color)
- text[ACTIVE] = @text_color
+ text[ACTIVE] = @fg_color
- base[NORMAL] = @base_color
- base[PRELIGHT] = @selected_bg_color
- base[SELECTED] = @selected_bg_color
+ base[NORMAL] = @base_color
+ base[PRELIGHT] = @selected_bg_color
+ base[SELECTED] = @selected_bg_color
base[INSENSITIVE] = @bg_color
- base[ACTIVE] = shade (1.3, @selected_bg_color)
+ base[ACTIVE] = shade (1.3, @selected_bg_color)
### style properties
+
GtkWidget::new-tooltip-style = 1
GtkEntry::honors-transparent-bg-hint = 1
@@ -63,7 +69,7 @@ style "default" {
GtkButton::default-border = { 0, 0, 0, 0 }
GtkButton::inner-border = { 2, 2, 4, 4 }
- GtkTreeView::odd-row-color = @base_color
+ GtkTreeView::odd-row-color = "#fafafa"
GtkScrolledWindow::scrollbar-spacing = 0
GtkScale::slider-length = 14
@@ -74,17 +80,16 @@ style "default" {
GtkComboBox::arrow-size = 12
engine "xamarin" {
-
arrowstyle = 2
- rgba = TRUE
- roundness = 3
+ rgba = TRUE
+ roundness = 3
glazestyle = 0
- menustyle = 0
- menuitemstyle = 0
+ menustyle = 0
+ menuitemstyle = 0
menubaritemstyle = 0
- comboboxstyle = 1
- spinbuttonstyle = 1
+ comboboxstyle = 1
+ spinbuttonstyle = 1
colorize_scrollbar = FALSE
progressbarstyle = 0
trough_shades = { 0.842, 0.886 }
@@ -101,23 +106,23 @@ style "wider" = "default" {
ythickness = 3
}
-
style "button" {
xthickness = 2
ythickness = 4
- bg[NORMAL] = @bg_color
- bg[PRELIGHT] = shade(1.1, @bg_color)
- bg[ACTIVE] = @bg_color
+ bg[NORMAL] = @bg_color
+ bg[PRELIGHT] = shade(1.1, @bg_color)
+ bg[ACTIVE] = @bg_color
bg[INSENSITIVE] = @bg_color
+
GtkWidget::focus-padding = 0
engine "xamarin" {
contrast = 1.0
- gradient_shades = {0.96, 0.918, 0.926, 0.858}
- focus_color = shade(0.6, @bg_color)
- textstyle = 1
- }
+ gradient_shades = {0.96, 0.918, 0.926, 0.858}
+ focus_color = shade(0.6, @bg_color)
+ textstyle = 1
+ }
}
style "toggle-button" = "button" {
@@ -133,7 +138,7 @@ style "menu" {
engine "xamarin" {
roundness = 3
- gradient_shades = {1.02, 0.97, 0.92, 0.87}
+ gradient_shades = {1.02, 0.97, 0.92, 0.87}
}
}
@@ -145,13 +150,14 @@ style "menu-item" {
engine "xamarin" {
roundness = 0
- gradient_shades = {1.02, 0.97, 0.92, 0.87}
+ gradient_shades = {1.02, 0.97, 0.92, 0.87}
}
}
style "toolbar" = "default"
{
bg[NORMAL] = "#ddd"
+
engine "xamarin" {
toolbarstyle = 2
}
@@ -161,8 +167,8 @@ style "toolbar-button"
{
engine "xamarin" {
contrast = 1.0
- focus_color = @bg_color
- }
+ focus_color = @bg_color
+ }
}
style "tooltip"
@@ -176,11 +182,11 @@ style "tooltip"
style "treeview" = "default"
{
- GtkTreeView::odd-row-color = "#f5f5f5"
+ GtkTreeView::odd-row-color = @bg_color
engine "xamarin" {
roundness = 0
- gradient_shades = {1.0, 1.0, 1.0, 1.0}
+ gradient_shades = {1.0, 1.0, 1.0, 1.0}
}
}
@@ -198,21 +204,22 @@ style "icon-view" = "default"
{
bg[SELECTED] = "#f5f7fa"
base[SELECTED] = "#f5f7fa"
- fg[SELECTED] = "#000"
- text[SELECTED] = "#000"
+ fg[SELECTED] = @fg_color
+ text[SELECTED] = @fg_color
}
style "toolbar-combo-box" = "default"
{
fg[NORMAL] = "#616161"
text[NORMAL] = @fg_color
- bg[NORMAL] = "#fff"
- base[NORMAL] = "#fff"
+ bg[NORMAL] = @bg_color
+ base[NORMAL] = "@bg_color
+
ythickness = 4
xthickness = 2
engine "xamarin" {
- comboboxstyle = 0
+ comboboxstyle = 0
arrowstyle = 2
}
}
@@ -220,6 +227,7 @@ style "toolbar-combo-box" = "default"
style "combo-box" = "default"
{
fg[NORMAL] = "#616161"
+
xthickness = 2
ythickness = 4
@@ -248,6 +256,7 @@ style "combo-box-label" = "combo-box"
style "notebook" = "default"
{
GtkNotebook::tab-overlap = 1
+
bg[ACTIVE] = @base_color
bg[NORMAL] = @base_color
@@ -259,14 +268,16 @@ style "notebook" = "default"
style "radio-button" = "default"
{
GtkCheckButton::indicator-size = 15
- text[NORMAL] = lighter (@text_color)
+
+ text[NORMAL] = lighter (@fg_color)
base[NORMAL] = @base_color
- text[ACTIVE] = lighter(@text_color)
+ text[ACTIVE] = lighter(@fg_color)
}
style "check-box" = "default"
{
GtkCheckButton::indicator-size = 15
+
base[NORMAL] = "#f8f8f8"
text[NORMAL] = "#404040"
text[ACTIVE] = "#404040"
@@ -276,7 +287,9 @@ style "entry" = "default"
{
xthickness = 4
ythickness = 4
+
GtkEntry::inner-border = { 2, 2, 2, 2 }
+
base[INSENSITIVE] = shade(1.02, @bg_color)
}
@@ -284,6 +297,7 @@ style "search-entry" = "wider"
{
xthickness = 6
ythickness = 4
+
bg[NORMAL] = @base_color
}
@@ -308,6 +322,7 @@ style "progressbar" = "default"
{
bg[SELECTED] = "#62b3ec"
fg[SELECTED] = "#3a67a6"
+
xthickness = 0
ythickness = 0
}
@@ -330,20 +345,25 @@ style "scale" = "default"
style "spin-button" = "wider"
{
fg[NORMAL] = "#616161"
+
ythickness = 4
+
GtkEntry::inner-border = { 2, 2, 1, 1 }
+
engine "xamarin" {
arrowstyle = 3
}
}
+
### Apply the styles
-class "GtkWidget" style "default"
-class "GtkEntry" style "entry"
+class "GtkWidget" style "default"
+
+class "GtkEntry" style "entry"
class "GtkSpinButton" style "spin-button"
-class "GtkFrame" style "wider"
-class "GtkRange" style "wide"
+class "GtkFrame" style "wider"
+class "GtkRange" style "wide"
class "GtkSeparator" style "wide"
class "GtkScrollbar" style "scrollbar"
class "GtkProgressBar" style "progressbar"
@@ -357,21 +377,21 @@ class "GtkScale" style "scale"
#widget "*GtkEntry" style "entry"
widget "*search-entry*" style "search-entry"
-widget "*GtkTextView" style "entry"
-widget "wizard_dialog" style "wizard-dialog"
+widget "*GtkTextView" style "entry"
+widget "wizard_dialog" style "wizard-dialog"
-widget_class "*<GtkButton>" style "button"
+widget_class "*<GtkButton>" style "button"
widget_class "*<GtkToggleButton>" style "toggle-button"
-widget_class "*<GtkMenu>*" style "menu"
-widget_class "*<GtkMenuItem>*" style "menu-item"
+widget_class "*<GtkMenu>*" style "menu"
+widget_class "*<GtkMenuItem>*" style "menu-item"
widget_class "*<GtkToolbar>*" style "toolbar"
-widget_class "*ToolButton*" style "toolbar-button"
+widget_class "*ToolButton*" style "toolbar-button"
-widget_class "*.<GtkTreeView>*" style "treeview"
-widget_class "*.GtkTreeView.GtkButton" style "tree-header"
-widget_class "*.GtkList.GtkButton" style "tree-header"
+widget_class "*.<GtkTreeView>*" style "treeview"
+widget_class "*.GtkTreeView.GtkButton" style "tree-header"
+widget_class "*.GtkList.GtkButton" style "tree-header"
widget_class "*<GtkIconView>" style "icon-view"
@@ -390,4 +410,4 @@ widget_class "*.<GtkComboBox>.*.GtkLabel" style "combo-box-label"
widget_class "*.<GtkToolbar>.*.<GtkComboBox>.*" style "toolbar-combo-box"
widget "*MainToolbar*.GtkComboBox.*" style "toolbar-combo-box"
-widget "gtk-tooltip*" style "tooltip"
+widget "gtk-tooltip*" style "tooltip"
diff --git a/main/src/core/MonoDevelop.Ide/gtkrc.mac b/main/src/core/MonoDevelop.Ide/gtkrc.mac
index 6d6fced496..0c033dc745 100644
--- a/main/src/core/MonoDevelop.Ide/gtkrc.mac
+++ b/main/src/core/MonoDevelop.Ide/gtkrc.mac
@@ -1,61 +1,74 @@
-# Mac Theme for Xamarin composed by Lanedo GmbH
-# Copyright 2012 Xamarin Inc.
-# Authors:
+# Xamarin Studio Light Mac GTK Theme
+# Copyright 2012-2016 Xamarin Inc.
+# Authors:
# Christian Kellner <christian.kellner@lanedo.com>
# Carlos Garnacho <carlos.garnacho@lanedo.com>
+# Cody Russell <cody@xamarin.com>
+# Vsevolod Kukol <vsevolod.kukol@xamarin.com>
+# Vaclav Vancura <vaclav@xamarin.com>
+
gtk-color-scheme =
-"bg_color: #f5f5f5
-fg_color: #000
-base_color: #fff
-text_color: #000
-selected_bg_color: #649dd6
+"bg_color: #f5f5f5
+fg_color: #272727
+base_color: #fff
+text_color: #272727
+link_color: #5189ed
+selected_bg_color: #5189ed
selected_fg_color: #fff
-tooltip_bg_color: #f2f2f2
-tooltip_fg_color: #222222
+tooltip_bg_color: #f2f2f2
+tooltip_fg_color: #272727
tooltip_border_color: #b2b2b2"
-gtk-button-images = 0
-gtk-menu-images = 0
-gtk-toolbar-style = 0
-gtk-enable-mnemonics = 0
-gtk-icon-sizes = "gtk-small-toolbar=16,16:gtk-large-toolbar=22,22"
+gtk-button-images = 0
+gtk-menu-images = 0
+gtk-toolbar-style = 0
+gtk-enable-mnemonics = 0
+gtk-icon-sizes = "gtk-small-toolbar=16,16:gtk-large-toolbar=22,22"
gtk-toolbar-icon-size = large-toolbar
-gtk-auto-mnemonics = 1
+gtk-auto-mnemonics = 1
gtk-error-bell = 0
gtk-show-input-method-menu = 0
+gtk-font-name = "Helvetica Neue 12"
+
style "default" {
xthickness = 1
ythickness = 1
+ font_name = "Helvetica Neue 12"
+
### colours
- bg[NORMAL] = @bg_color
- bg[PRELIGHT] = @bg_color
- bg[SELECTED] = @selected_bg_color
- bg[INSENSITIVE] = @bg_color
- bg[ACTIVE] = @bg_color
-
- fg[NORMAL] = @fg_color
- fg[PRELIGHT] = @fg_color
- fg[SELECTED] = @selected_fg_color
- fg[INSENSITIVE] = darker (@bg_color)
- fg[ACTIVE] = @fg_color
-
- text[NORMAL] = @text_color
- text[PRELIGHT] = @text_color
- text[SELECTED] = @selected_fg_color
+
+ bg[NORMAL] = @bg_color
+ bg[PRELIGHT] = @bg_color
+ bg[SELECTED] = @selected_bg_color
+ bg[INSENSITIVE] = @bg_color
+ bg[ACTIVE] = @bg_color
+
+ fg[NORMAL] = @fg_color
+ fg[PRELIGHT] = @fg_color
+ fg[SELECTED] = @selected_fg_color
+ fg[INSENSITIVE] = darker (@bg_color)
+ fg[ACTIVE] = @fg_color
+
+ text[NORMAL] = @fg_color
+ text[PRELIGHT] = @fg_color
+ text[SELECTED] = @selected_fg_color
text[INSENSITIVE] = darker (@bg_color)
- text[ACTIVE] = @text_color
+ text[ACTIVE] = @fg_color
- base[NORMAL] = @base_color
- base[PRELIGHT] = @selected_bg_color
- base[SELECTED] = @selected_bg_color
+ base[NORMAL] = @base_color
+ base[PRELIGHT] = @selected_bg_color
+ base[SELECTED] = @selected_bg_color
base[INSENSITIVE] = @bg_color
- base[ACTIVE] = shade (1.3, @selected_bg_color)
+ base[ACTIVE] = shade (1.3, @selected_bg_color)
### style properties
+
GtkWidget::new-tooltip-style = 1
+ GtkWidget::link-color = @link_color
+ GtkWidget::visited-link-color = @link_color
GtkEntry::honors-transparent-bg-hint = 1
GtkEntry::inner-border = { 2, 2, 2, 2 }
@@ -68,10 +81,14 @@ style "default" {
GtkButtonBox::child-min-width = 70
GtkButtonBox::child-min-height = 22
- GtkTreeView::odd-row-color = @base_color
+ GtkCheckButton::indicator-size = 14
+ GtkCheckButton::indicator-spacing = 4
+
+ GtkTreeView::odd-row-color = "#fafafa"
GtkScrolledWindow::scrollbar-spacing = 0
GtkScrolledWindow::scrollbars-within-bevel = 1
+ GtkScrolledWindow::draw-child-bg = 1
GtkScale::slider-length = 14
GtkRange::trough-side-details = 1
@@ -80,25 +97,27 @@ style "default" {
GtkComboBox::arrow-size = 12
GtkMenu::vertical-padding = 4
- GtkMenuItem::horizontal-padding = 9
- GtkMenuItem::toggle-spacing = 0
+ GtkMenuItem::horizontal-padding = 3
+ GtkMenuItem::toggle-spacing = 6
GtkSeparatorMenuItem::horizontal-padding = 2
engine "xamarin" {
-
arrowstyle = 2
- rgba = TRUE
- roundness = 3
+ rgba = TRUE
+ roundness = 3
glazestyle = 0
- menustyle = 0
- menuitemstyle = 0
+ menustyle = 0
+ menuitemstyle = 0
menubaritemstyle = 0
- comboboxstyle = 1
- spinbuttonstyle = 1
+ comboboxstyle = 2
+ spinbuttonstyle = 1
colorize_scrollbar = FALSE
progressbarstyle = 0
- trough_shades = { 0.842, 0.886 }
+ gradient_shades = { 1.0, 1.0, 1.0, 1.0 }
+ fill_shade = 1.0
+
+ focusstyle = 0
}
}
@@ -112,78 +131,85 @@ style "wider" = "default" {
ythickness = 3
}
-
-style "button" {
+style "button" = "default" {
xthickness = 2
ythickness = 4
- bg[NORMAL] = @bg_color
- bg[PRELIGHT] = shade(1.1, @bg_color)
- bg[ACTIVE] = @bg_color
- bg[INSENSITIVE] = @bg_color
+ font_name = "Helvetica Neue 12"
+
+ bg[NORMAL] = @base_color
+ bg[PRELIGHT] = @base_color # Mac buttons have no hover state
+
GtkWidget::focus-padding = 0
+ GtkWidget::focus-line-width = 1
engine "xamarin" {
+ border_shades = {1.4, 1.3}
rgba = FALSE
contrast = 1.0
- gradient_shades = {0.96, 0.918, 0.926, 0.858}
- focus_color = shade(0.6, @bg_color)
- textstyle = 1
- }
+ focus_color = shade(0.6, @bg_color)
+ textstyle = 0
+ highlight_shade = 1.0
+ lightborder_shade = 1.0
+ }
}
-style "dialog-button" = "default" {
- xthickness = 3
- ythickness = 2
- font_name = "Lucida Grande 13"
-
- GtkWidget::draw-border = { 2, 2, 2, 2 }
- GtkWidget::focus-line-width = 1
- GtkButton::inner-border = { 8, 8, 0, 3 }
+style "dialog-button" = "button" {
+ GtkButton::inner-border = { 7, 7, 3, 4 }
- engine "quartz" {
- buttontype = "aqua"
+ engine "xamarin" {
+ default_button_color = "#51ADF3"
}
}
style "toggle-button" = "button" {
- bg[NORMAL] = @base_color
- bg[PRELIGHT] = shade(0.98, @base_color)
+ bg[PRELIGHT] = @base_color
engine "xamarin" {
rgba = FALSE
contrast = 1.0
- gradient_shades = {0.96, 0.918, 0.926, 0.858}
- focus_color = shade(0.6, @bg_color)
- textstyle = 1
+ focus_color = shade(0.6, @bg_color)
+ textstyle = 1
}
}
style "menu" {
- xthickness = 0
+ xthickness = 1
# ythickness = 0
- font_name = "Lucida Grande 14"
+
+ font_name = "Helvetica Neue 12"
bg[PRELIGHT] = @selected_fg_color
fg[PRELIGHT] = @selected_fg_color
text[PRELIGHT] = @selected_fg_color
- engine "quartz" {
- }
+ # engine "quartz" {
+ # }
}
style "menu-item" = "menu" {
ythickness = 2
+
GtkWidget::draw-border = { 0, 0, 0, 2 }
+
+ engine "xamarin" {
+ gradient_shades = {1.0, 1.0, 1.0, 1.0}
+ contrast = 0.0
+ roundness = 0
+ }
}
style "menu-separator" = "menu-item" {
ythickness = 3
+ engine "xamarin" {
+ contrast = 1.0
+ }
}
style "toolbar" = "default"
{
bg[NORMAL] = "#ddd"
+
engine "xamarin" {
toolbarstyle = 2
}
@@ -193,8 +219,8 @@ style "toolbar-button"
{
engine "xamarin" {
contrast = 1.0
- focus_color = @bg_color
- }
+ focus_color = @bg_color
+ }
}
style "tooltip"
@@ -205,23 +231,33 @@ style "tooltip"
fg[NORMAL] = @tooltip_fg_color
bg[NORMAL] = @tooltip_bg_color
bg[SELECTED] = @tooltip_border_color
- font_name = "Lucida Grande 12"
+
+ font_name = "Helvetica Neue 12"
engine "xamarin" {
- roundness = 0
+ roundness = 0
}
}
-style "tree-header" = "wide"
+style "treeview" = "default"
{
- bg[NORMAL] = "#f2f2f2"
+ base[SELECTED] = @selected_bg_color
+ base[ACTIVE] = @selected_bg_color
+ text[SELECTED] = @selected_fg_color
+ text[ACTIVE] = @selected_fg_color
engine "xamarin" {
- listviewheaderstyle = 3
- separatorstyle = 1
+ roundness = 0
+ gradient_shades = { 1.01, 1.01, 1.01, 1.01 }
+ glazestyle = 1
}
}
+style "tree-header"
+{
+ bg[NORMAL] = "#f2f2f2"
+}
+
style "icon-view" = "default"
{
bg[SELECTED] = "#f5f7fa"
@@ -234,78 +270,104 @@ style "toolbar-combo-box" = "default"
{
fg[NORMAL] = "#616161"
text[NORMAL] = @fg_color
- bg[NORMAL] = "#fff"
- base[NORMAL] = "#fff"
+ bg[NORMAL] = @bg_color
+ base[NORMAL] = @bg_color
+
ythickness = 4
xthickness = 2
engine "xamarin" {
- comboboxstyle = 0
+ comboboxstyle = 0
arrowstyle = 2
}
}
-style "combo-box" = "default"
+style "combo-box" = "button"
{
- fg[NORMAL] = "#616161"
- xthickness = 2
- ythickness = 4
+ bg[PRELIGHT] = @base_color
+ base[NORMAL] = "#cccccc"
+ base[ACTIVE] = "#6cb2f7"
+ base[PRELIGHT] = "#cccccc"
+ fg[NORMAL] = @base_color
+ fg[PRELIGHT] = @base_color
engine "xamarin" {
- arrowstyle = 4
+ arrowstyle = 3
+ fill_shade = 0.85
}
}
-style "wizard-dialog"
+style "combo-box-entry-button" = "combo-box"
{
- GtkDialog::content-area-border = 0
-}
+ bg[NORMAL] = "#cccccc"
+ bg[ACTIVE] = "#6cb2f7"
+ bg[PRELIGHT] = "#cccccc"
+ fg[NORMAL] = @base_color
+ fg[ACTIVE] = @fg_color
+ fg[PRELIGHT] = @base_color
-style "combo-box-entry" = "combo-box"
-{
engine "xamarin" {
arrowstyle = 3
+ fill_shade = 0.85
}
}
-style "combo-box-label" = "combo-box"
+style "wizard-dialog"
{
- fg[NORMAL] = "#595959"
+ GtkDialog::content-area-border = 0
}
style "combo-box-menu" = "menu" {
- font_name = "Lucida Grande 12"
+ font_name = "Helvetica Neue 12"
}
style "notebook" = "default"
{
GtkNotebook::tab-overlap = 1
- bg[ACTIVE] = @base_color
+ GtkNotebook::tab-curvature = 3
+
+ bg[ACTIVE] = "#e7e7e7"
bg[NORMAL] = @base_color
engine "xamarin" {
- gradient_shades = { 0.945, 0.945, 0.945, 0.685 }
+ roundness = 0
}
}
-style "radio-or-check-box"
+style "radio-or-check-box" = "default"
{
ythickness = 6
- GtkCheckButton::indicator-size = 14
- GtkCheckButton::indicator-spacing = 4
+
engine "quartz" {
}
}
+style "propertygrid-radio-or-check-box" = "radio-or-check-box"
+{
+ base[ACTIVE] = @base_color
+ base[SELECTED] = @base_color
+ base[PRELIGHT] = @base_color
+ text[SELECTED] = @fg_color
+ GtkCheckButton::indicator-spacing = 0
+
+ engine "xamarin" {
+ }
+}
+
style "entry" = "default"
{
xthickness = 4
ythickness = 4
+
GtkEntry::inner-border = { 2, 2, 2, 2 }
+
base[INSENSITIVE] = shade(1.02, @bg_color)
+ bg[SELECTED] = @selected_bg_color
engine "xamarin" {
rgba = FALSE
+ roundness = 0
+ focusstyle = 2
}
}
@@ -313,6 +375,7 @@ style "search-entry" = "wider"
{
xthickness = 6
ythickness = 4
+
bg[NORMAL] = @base_color
}
@@ -320,18 +383,35 @@ style "scrollbar" = "default"
{
GtkScrollbar::has-forward-stepper = 0
GtkScrollbar::has-backward-stepper = 0
- GtkRange::slider-width = 15
- GtkRange::trough-border = 0
+ GtkRange::slider-width = 7
+ GtkRange::trough-border = 2
GtkRange::trough-side-details = 0
-
- engine "quartz" {
+ GtkWidget::draw-border = { 0, 0, 0, 0 }
+
+ bg[NORMAL] = "#C0C0C0"
+ bg[PRELIGHT] = "#C0C0C0"
+
+ engine "xamarin"
+ {
+ roundness = 1
+ contrast = 0.0
+ border_colors = { "#C0C0C0", "#C0C0C0" }
+ trough_shades = { 1.0, 1.0 }
+ stepperstyle = 1
}
}
+style "completion_scrollbar" = "scrollbar"
+{
+ bg[NORMAL] = @bg_color
+}
+
style "progressbar" = "default"
{
- bg[SELECTED] = "#62b3ec"
- fg[SELECTED] = "#3a67a6"
+ GtkWidget::draw-border = { 0, 0, 0, 0 }
+ bg[ACTIVE] = @base_color
+ fg[SELECTED] = @selected_bg_color
+ fg[PRELIGHT] = @selected_fg_color
xthickness = 0
ythickness = 0
}
@@ -354,20 +434,30 @@ style "scale" = "default"
style "spin-button" = "wider"
{
fg[NORMAL] = "#616161"
+
ythickness = 4
+
GtkEntry::inner-border = { 2, 2, 1, 1 }
+
engine "xamarin" {
arrowstyle = 3
}
}
+style "link-label-fix"
+{
+ base[PRELIGHT] = @bg_color # disable link hover background
+}
+
+
### Apply the styles
-class "GtkWidget" style "default"
-class "GtkEntry" style "entry"
+class "GtkWidget" style "default"
+
+class "GtkEntry" style "entry"
class "GtkSpinButton" style "spin-button"
-class "GtkFrame" style "wider"
-class "GtkRange" style "wide"
+class "GtkFrame" style "wider"
+class "GtkRange" style "wide"
class "GtkSeparator" style "wide"
class "GtkScrollbar" style "scrollbar"
class "GtkProgressBar" style "progressbar"
@@ -375,56 +465,66 @@ class "GtkScrolledWindow" style "scrolled-window"
class "GtkNotebook" style "notebook"
class "GtkButton" style "button"
class "GtkToggleButton" style "toggle-button"
+class "GtkCheckButton" style "radio-or-check-box"
+class "GtkComboBox" style "combo-box"
class "GtkScale" style "scale"
#widget "*GtkEntry" style "entry"
widget "*search-entry*" style "search-entry"
-widget "*GtkTextView" style "entry"
+widget "*GtkTextView" style "entry"
+widget_class "*.GtkButton.*" style "button"
widget_class "<GtkDialog>.*.<GtkButton>" style "dialog-button"
widget_class "<GtkDialog>*<GtkCheckButton>" style "radio-or-check-box"
-widget_class "<GtkDialog>.<GtkVBox>.<GtkButtonBox>.<GtkButton>*" style "dialog-button"
-widget_class "<GtkDialog>.<GtkVBox>.<GtkHBox>.<GtkButtonBox>.<GtkButton>*" style "dialog-button"
+widget_class "<GtkDialog>.*.<GtkButtonBox>.*.<GtkButton>.*" style "dialog-button"
widget "*.toggleFindInFiles" style "toggle-button"
widget "*.toggleReplaceInFiles" style "toggle-button"
widget "wizard_dialog" style "wizard-dialog"
-widget_class "*<GtkMenu>*" style "menu"
-widget_class "*<GtkMenuItem>*" style "menu-item"
+widget "*CompletionScrolledWindow*" style "completion_scrollbar"
+
+widget_class "*<GtkMenu>*" style "menu"
+widget_class "*<GtkMenuItem>*" style "menu-item"
widget_class "*<GtkSeparatorMenuItem>" style "menu-separator"
widget "*.gtk-combobox-popup-menu*" style "combo-box-menu"
widget_class "*<GtkToolbar>*" style "toolbar"
-widget_class "*ToolButton*" style "toolbar-button"
+widget_class "*ToolButton*" style "toolbar-button"
-widget_class "*.GtkTreeView.GtkButton" style "tree-header"
-widget_class "*.GtkList.GtkButton" style "tree-header"
+widget_class "*.<GtkTreeView>*" style "treeview"
+widget_class "*.<GtkTreeView>.<GtkButton>" style "tree-header"
+widget_class "*.<GtkList>.<GtkButton>" style "tree-header"
widget_class "*<GtkIconView>" style "icon-view"
widget_class "*.<GtkComboBox>.*" style "combo-box"
-widget_class "*.<GtkComboBoxText>.*" style "combo-box-entry"
-widget_class "*.<GtkComboBoxEntry>.*" style "combo-box-entry"
widget_class "*.<GtkComboBoxText>.<GtkEntry>" style "entry"
widget_class "*.<GtkComboBoxEntry>.<GtkEntry>" style "entry"
-widget_class "*.<GtkComboBoxText>.<GtkToggleButton>" style "button"
-widget_class "*.<GtkComboBoxEntry>.<GtkToggleButton>" style "button"
-#widget_class "*.<GtkComboBoxEntry>.GtkEntry" style "entry"
-#widget_class "*.<GtkComboBoxEntry>.<GtkButton>" style "dialog-button"
-widget_class "*.<GtkComboBox>.*.GtkLabel" style "combo-box-label"
+widget_class "*.<GtkComboBoxText>.<GtkToggleButton>" style "combo-box-entry-button"
+widget_class "*.<GtkComboBoxEntry>.<GtkButton>*" style "combo-box-entry-button"
# Comboboxes within toolbars
widget_class "*.<GtkToolbar>.*.<GtkComboBox>.*" style "toolbar-combo-box"
widget "*MainToolbar*.GtkComboBox.*" style "toolbar-combo-box"
-widget "gtk-tooltip*" style "tooltip"
+widget "gtk-tooltip*" style "tooltip"
binding "gtk-mac-expand-collapse-cursor-row"
{
- unbind "Left"
- unbind "Right"
- bind "Left" { "expand-collapse-cursor-row" (0, 0, 0) }
- bind "Right" { "expand-collapse-cursor-row" (0, 1, 0) }
+ unbind "Left"
+ unbind "Right"
+ bind "Left" { "expand-collapse-cursor-row" (0, 0, 0) }
+ bind "Right" { "expand-collapse-cursor-row" (0, 1, 0) }
}
+
class "GtkTreeView" binding "gtk-mac-expand-collapse-cursor-row"
+
+# HACK: PropertyGrid toolbar option buttons must have murrine style
+widget "*MonoDevelop.PropertyGridToolbar.GtkRadioButton" style "toggle-button"
+
+# BooleanEditorCell must always have murrine style
+widget_class "*BooleanEditor*" style "propertygrid-radio-or-check-box"
+
+# disable hover background on link labels
+class "GtkLabel" style "link-label-fix"
diff --git a/main/src/core/MonoDevelop.Ide/gtkrc.mac-dark b/main/src/core/MonoDevelop.Ide/gtkrc.mac-dark
new file mode 100644
index 0000000000..27357e3187
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/gtkrc.mac-dark
@@ -0,0 +1,504 @@
+# Xamarin Studio Dark Mac GTK Theme
+# Copyright 2012-2016 Xamarin Inc.
+# Authors:
+# Christian Kellner <christian.kellner@lanedo.com>
+# Carlos Garnacho <carlos.garnacho@lanedo.com>
+# Cody Russell <cody@xamarin.com>
+# Vsevolod Kukol <vsevolod.kukol@xamarin.com>
+# Vaclav Vancura <vaclav@xamarin.com>
+
+
+gtk-color-scheme =
+"bg_color: #333
+fg_color: #d7d7d7
+base_color: #404040
+text_color: #d7d7d7
+link_color: #56bbf0
+dim_color: #777777
+selected_bg_color: #5189ed
+selected_fg_color: #fff
+tooltip_bg_color: #5a5a5a
+tooltip_fg_color: #d2d5cd
+tooltip_border_color: #b2b2b2"
+
+gtk-button-images = 0
+gtk-menu-images = 0
+gtk-toolbar-style = 0
+gtk-enable-mnemonics = 0
+gtk-icon-sizes = "gtk-small-toolbar=16,16:gtk-large-toolbar=22,22"
+gtk-toolbar-icon-size = large-toolbar
+gtk-auto-mnemonics = 1
+gtk-error-bell = 0
+gtk-show-input-method-menu = 0
+gtk-font-name = "Helvetica Neue 12"
+
+
+style "default" {
+ xthickness = 1
+ ythickness = 1
+
+ font_name = "Helvetica Neue 12"
+
+ ### colours
+
+ bg[NORMAL] = @bg_color
+ bg[PRELIGHT] = @bg_color
+ bg[SELECTED] = @selected_bg_color
+ bg[INSENSITIVE] = @bg_color
+ bg[ACTIVE] = @bg_color
+
+ fg[NORMAL] = @fg_color
+ fg[PRELIGHT] = @fg_color
+ fg[SELECTED] = @selected_fg_color
+ fg[INSENSITIVE] = @dim_color
+ fg[ACTIVE] = @fg_color
+
+ text[NORMAL] = @fg_color
+ text[PRELIGHT] = @fg_color
+ text[SELECTED] = @selected_fg_color
+ text[INSENSITIVE] = @dim_color
+ text[ACTIVE] = @fg_color
+
+ base[NORMAL] = @base_color
+ base[PRELIGHT] = @selected_bg_color
+ base[SELECTED] = @selected_bg_color
+ base[INSENSITIVE] = @bg_color
+ base[ACTIVE] = shade (0.7, @selected_bg_color)
+
+ ### style properties
+
+ GtkWidget::new-tooltip-style = 1
+ GtkWidget::link-color = @link_color
+ GtkWidget::visited-link-color = @link_color
+
+ GtkEntry::honors-transparent-bg-hint = 1
+ GtkEntry::inner-border = { 2, 2, 2, 2 }
+
+ GtkButton::child-displacement-x = 0
+ GtkButton::child-displacement-y = 0
+ GtkButton::default-border = { 0, 0, 0, 0 }
+ GtkButton::inner-border = { 2, 2, 4, 4 }
+
+ GtkButtonBox::child-min-width = 70
+ GtkButtonBox::child-min-height = 22
+
+ GtkCheckButton::indicator-size = 14
+ GtkCheckButton::indicator-spacing = 4
+
+ GtkTreeView::odd-row-color = "#3b3b3b"
+
+ GtkScrolledWindow::scrollbar-spacing = 0
+ GtkScrolledWindow::scrollbars-within-bevel = 1
+ GtkScrolledWindow::draw-child-bg = 1
+ GtkScale::slider-length = 14
+ GtkRange::trough-side-details = 1
+
+ GtkTreeView::expander-size = 8
+ GtkExpander::expander-size = 8
+ GtkComboBox::arrow-size = 12
+
+ GtkMenu::vertical-padding = 4
+ GtkMenuItem::horizontal-padding = 3
+ GtkMenuItem::toggle-spacing = 6
+ GtkSeparatorMenuItem::horizontal-padding = 2
+
+ engine "xamarin" {
+ arrowstyle = 2
+ rgba = TRUE
+ roundness = 3
+ glazestyle = 0
+
+ menustyle = 0
+ menuitemstyle = 0
+ menubaritemstyle = 0
+ comboboxstyle = 1
+ spinbuttonstyle = 1
+ colorize_scrollbar = FALSE
+ progressbarstyle = 0
+ trough_shades = { 0.842, 0.886 }
+ gradient_shades = { 1.0, 1.0, 1.0, 1.0 }
+ fill_shade = 1.0
+
+ focusstyle = 0
+ }
+}
+
+style "wide" = "default" {
+ xthickness = 2
+ ythickness = 2
+}
+
+style "wider" = "default" {
+ xthickness = 3
+ ythickness = 3
+}
+
+style "button" = "default" {
+ xthickness = 2
+ ythickness = 4
+
+ font_name = "Helvetica Neue 12"
+
+ bg[NORMAL] = "#595959"
+ bg[PRELIGHT] = "#595959" # Mac buttons have no hover state
+ bg[ACTIVE] = shade(1.2, "#595959")
+ bg[INSENSITIVE] = "#595959"
+
+ fg[NORMAL] = "#fff"
+ fg[PRELIGHT] = "#fff"
+ fg[ACTIVE] = "#fff"
+ fg[INSENSITIVE] = lighter ("#595959")
+
+ GtkWidget::draw-border = { 1, 1, 1, 1 }
+ GtkWidget::focus-padding = 0
+ GtkWidget::focus-line-width = 1
+
+ engine "xamarin" {
+ rgba = FALSE
+ contrast = 1.0
+ focus_color = shade(1.4, @bg_color)
+ focusstyle = 3
+ border_colors = { @bg_color, @bg_color }
+ textstyle = 0
+ highlight_shade = 1.0
+ lightborder_shade = 1.0
+ default_button_color = lighter ("#595959")
+ }
+}
+
+style "dialog-button" = "button" {
+ GtkButton::inner-border = { 7, 7, 3, 4 }
+
+ engine "xamarin" {
+ default_button_color = "#51ADF3"
+ }
+}
+
+style "toggle-button" = "button" {
+ bg[NORMAL] = @bg_color
+ bg[ACTIVE] = shade(0.98, @base_color)
+ bg[PRELIGHT] = shade(0.98, @base_color)
+
+ engine "xamarin" {
+ rgba = FALSE
+ contrast = 1.0
+ gradient_shades = {0.96, 0.918, 0.926, 0.858}
+ focus_color = shade(0.6, @bg_color)
+ textstyle = 1
+ }
+}
+
+style "menu" {
+ xthickness = 1
+ # ythickness = 0
+
+ font_name = "Helvetica Neue 12"
+
+ bg[PRELIGHT] = @selected_fg_color
+ fg[PRELIGHT] = @selected_fg_color
+ text[PRELIGHT] = @selected_fg_color
+
+ # engine "quartz" {
+ # }
+}
+
+style "menu-item" = "menu" {
+ ythickness = 2
+
+ GtkWidget::draw-border = { 0, 0, 0, 2 }
+
+ engine "xamarin" {
+ gradient_shades = {1.0, 1.0, 1.0, 1.0}
+ contrast = 0.0
+ roundness = 0
+ }
+}
+
+style "menu-separator" = "menu-item" {
+ ythickness = 3
+ engine "xamarin" {
+ contrast = 1.0
+ }
+}
+
+style "toolbar" = "default"
+{
+ bg[NORMAL] = @base_color
+}
+
+style "tooltip"
+{
+ xthickness = 5
+ ythickness = 5
+
+ fg[NORMAL] = @tooltip_fg_color
+ bg[NORMAL] = @tooltip_bg_color
+ bg[SELECTED] = @tooltip_border_color
+
+ font_name = "Helvetica Neue 12"
+
+ engine "xamarin" {
+ roundness = 0
+ }
+}
+
+style "treeview" = "default"
+{
+ base[SELECTED] = @selected_bg_color
+ base[ACTIVE] = @selected_bg_color
+ text[SELECTED] = @selected_fg_color
+ text[ACTIVE] = @selected_fg_color
+
+ engine "xamarin" {
+ roundness = 0
+ gradient_shades = { 1.01, 1.01, 1.01, 1.01 }
+ glazestyle = 1
+ }
+}
+
+style "tree-header"
+{
+ bg[NORMAL] = @bg_color
+ bg[INSENSITIVE] = @bg_color
+
+ engine "xamarin" {
+ border_colors = { @base_color, @base_color }
+ }
+}
+
+style "icon-view" = "default"
+{
+ bg[SELECTED] = "#f5f7fa"
+ base[SELECTED] = "#f5f7fa"
+ fg[SELECTED] = "#000"
+ text[SELECTED] = "#000"
+}
+
+style "combo-box" = "button"
+{
+ #bg[PRELIGHT] = @base_color
+ #fg[NORMAL] = @base_color
+ #fg[PRELIGHT] = @base_color
+
+ engine "xamarin" {
+ arrowstyle = 3
+ }
+}
+
+style "combo-box-entry-button" = "combo-box"
+{
+}
+
+style "wizard-dialog"
+{
+ GtkDialog::content-area-border = 0
+}
+
+style "combo-box-menu" = "menu" {
+ font_name = "Helvetica Neue 12"
+}
+
+style "notebook" = "default"
+{
+ GtkNotebook::tab-overlap = 1
+ GtkNotebook::tab-curvature = 3
+
+ bg[ACTIVE] = "#3b3b3b" # inactive tab color
+ bg[NORMAL] = @base_color # active tab and notebook bg color
+
+ engine "xamarin" {
+ roundness = 0
+ }
+}
+
+style "quartz-radio-or-check-box" = "default"
+{
+ ythickness = 6
+
+ engine "quartz" {
+ }
+}
+
+style "propertygrid-radio-or-check-box" = "default"
+{
+ GtkCheckButton::indicator-spacing = 0
+
+ base[NORMAL] = "#fff"
+ base[ACTIVE] = "#fff"
+ base[SELECTED] = "#fff"
+ base[PRELIGHT] = "#fff"
+ text[SELECTED] = @base_color
+
+ engine "xamarin" {
+ border_shades = { 1.33, 1.33 }
+ }
+}
+
+style "entry" = "default"
+{
+ xthickness = 4
+ ythickness = 4
+
+ GtkEntry::inner-border = { 2, 2, 2, 2 }
+
+ base[INSENSITIVE] = shade(1.02, @bg_color)
+ bg[SELECTED] = @selected_bg_color
+
+ engine "xamarin" {
+ rgba = FALSE
+ roundness = 0
+ focusstyle = 2
+ }
+}
+
+style "search-entry" = "wider"
+{
+ xthickness = 6
+ ythickness = 4
+
+ bg[NORMAL] = @base_color
+}
+
+style "scrollbar" = "default"
+{
+ GtkScrollbar::has-forward-stepper = 0
+ GtkScrollbar::has-backward-stepper = 0
+ GtkRange::slider-width = 7
+ GtkRange::trough-border = 2
+ GtkRange::trough-side-details = 0
+ GtkWidget::draw-border = { 0, 0, 0, 0 }
+
+ bg[NORMAL] = @fg_color
+ bg[PRELIGHT] = @fg_color
+
+ engine "xamarin"
+ {
+ roundness = 1
+ contrast = 0.0
+ trough_shades = { 1.0, 1.0 }
+ stepperstyle = 1
+ }
+}
+
+style "completion_scrollbar" = "scrollbar"
+{
+ bg[NORMAL] = @base_color
+}
+
+style "progressbar" = "default"
+{
+ GtkWidget::draw-border = { 0, 0, 0, 0 }
+ bg[ACTIVE] = @base_color
+ fg[SELECTED] = @selected_bg_color
+ fg[PRELIGHT] = @selected_fg_color
+ xthickness = 0
+ ythickness = 0
+}
+
+style "scrolled-window" = "default"
+{
+ xthickness = 1
+ ythickness = 1
+}
+
+style "scale" = "default"
+{
+ bg[SELECTED] = @selected_bg_color
+
+ engine "xamarin" {
+ roundness = 7
+ }
+}
+
+style "spin-button" = "wider"
+{
+ fg[NORMAL] = "#616161"
+
+ ythickness = 4
+
+ GtkEntry::inner-border = { 2, 2, 1, 1 }
+
+ engine "xamarin" {
+ arrowstyle = 3
+ }
+}
+
+style "link-label-fix"
+{
+ base[PRELIGHT] = @bg_color # disable link hover background
+}
+
+
+### Apply the styles
+
+class "GtkWidget" style "default"
+
+class "GtkEntry" style "entry"
+class "GtkSpinButton" style "spin-button"
+class "GtkFrame" style "wider"
+class "GtkRange" style "wide"
+class "GtkSeparator" style "wide"
+class "GtkScrollbar" style "scrollbar"
+class "GtkProgressBar" style "progressbar"
+class "GtkScrolledWindow" style "scrolled-window"
+class "GtkNotebook" style "notebook"
+class "GtkButton" style "button"
+class "GtkToggleButton" style "toggle-button"
+class "GtkCheckButton" style "quartz-radio-or-check-box"
+class "GtkComboBox" style "combo-box"
+
+class "GtkScale" style "scale"
+
+#widget "*GtkEntry" style "entry"
+widget "*search-entry*" style "search-entry"
+widget "*GtkTextView" style "entry"
+
+widget_class "*.GtkButton.*" style "button"
+widget_class "<GtkDialog>.*.<GtkButton>" style "dialog-button"
+widget_class "<GtkDialog>*<GtkCheckButton>" style "quartz-radio-or-check-box"
+widget_class "<GtkDialog>.*.<GtkButtonBox>.*.<GtkButton>.*" style "dialog-button"
+widget "*.toggleFindInFiles" style "toggle-button"
+widget "*.toggleReplaceInFiles" style "toggle-button"
+widget "wizard_dialog" style "wizard-dialog"
+
+widget "*CompletionScrolledWindow*" style "completion_scrollbar"
+
+widget_class "*<GtkMenu>*" style "menu"
+widget_class "*<GtkMenuItem>*" style "menu-item"
+widget_class "*<GtkSeparatorMenuItem>" style "menu-separator"
+widget "*.gtk-combobox-popup-menu*" style "combo-box-menu"
+
+widget_class "*<GtkToolbar>*" style "toolbar"
+
+widget_class "*.<GtkTreeView>*" style "treeview"
+widget_class "*.<GtkTreeView>.<GtkButton>" style "tree-header"
+widget_class "*.<GtkList>.<GtkButton>" style "tree-header"
+
+widget_class "*<GtkIconView>" style "icon-view"
+
+widget_class "*.<GtkComboBox>.*" style "combo-box"
+widget_class "*.<GtkComboBoxText>.<GtkEntry>" style "entry"
+widget_class "*.<GtkComboBoxEntry>.<GtkEntry>" style "entry"
+widget_class "*.<GtkComboBoxText>.<GtkToggleButton>" style "combo-box-entry-button"
+widget_class "*.<GtkComboBoxEntry>.<GtkButton>*" style "combo-box-entry-button"
+
+widget "gtk-tooltip*" style "tooltip"
+
+binding "gtk-mac-expand-collapse-cursor-row"
+{
+ unbind "Left"
+ unbind "Right"
+ bind "Left" { "expand-collapse-cursor-row" (0, 0, 0) }
+ bind "Right" { "expand-collapse-cursor-row" (0, 1, 0) }
+}
+
+class "GtkTreeView" binding "gtk-mac-expand-collapse-cursor-row"
+
+# HACK: PropertyGrid toolbar option buttons must have murrine style
+widget "*MonoDevelop.PropertyGridToolbar.GtkRadioButton" style "toggle-button"
+
+# BooleanEditorCell must always have murrine style
+widget_class "*BooleanEditor*" style "propertygrid-radio-or-check-box"
+
+# disable hover background on link labels
+class "GtkLabel" style "link-label-fix" \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/gtkrc.mac-yosemite b/main/src/core/MonoDevelop.Ide/gtkrc.mac-yosemite
deleted file mode 100644
index 486cdda2b5..0000000000
--- a/main/src/core/MonoDevelop.Ide/gtkrc.mac-yosemite
+++ /dev/null
@@ -1,26 +0,0 @@
-include "gtkrc.mac"
-
-style "default" {
- font_name = "Helvetica Neue 13"
-}
-
-style "dialog-button" {
- fg[ACTIVE] = @selected_fg_color
- font_name = "Helvetica Neue 13"
-}
-
-style "button" {
- font_name = "Helvetica Neue 13"
-}
-
-style "menu" {
- font_name = "Helvetica Neue 14"
-}
-
-style "combo-box-menu" {
- font_name = "Helvetica Neue 12"
-}
-
-style "tooltip" {
- font_name = "Helvetica Neue 12"
-}
diff --git a/main/src/core/MonoDevelop.Ide/gtkrc.win32 b/main/src/core/MonoDevelop.Ide/gtkrc.win32
index 73291d518a..c0beaba6da 100644
--- a/main/src/core/MonoDevelop.Ide/gtkrc.win32
+++ b/main/src/core/MonoDevelop.Ide/gtkrc.win32
@@ -1,101 +1,117 @@
-# Windows Theme for Xamarin composed by Lanedo GmbH
-# Copyright 2012 Xamarin Inc.
-# Authors:
+# Xamarin Studio Light Windows GTK Theme
+# Copyright 2012-2016 Xamarin Inc.
+# Authors:
# Christian Kellner <christian.kellner@lanedo.com>
# Carlos Garnacho <carlos.garnacho@lanedo.com>
+# Cody Russell <cody@xamarin.com>
+# Vsevolod Kukol <vsevolod.kukol@xamarin.com>
+# Vaclav Vancura <vaclav@xamarin.com>
+
gtk-color-scheme =
-"bg_color: #f5f5f5
-fg_color: #000
-base_color: #fff
-text_color: #000
-selected_bg_color: #649dd6
-selected_fg_color: #fff
-tooltip_bg_color: #f2f2f2
-tooltip_fg_color: #222222
+"bg_color: #f5f5f5
+fg_color: #000
+base_color: #fff
+text_color: #000
+link_color: #5189ed
+selected_bg_color: #cce8ff
+selected_fg_color: #000
+tooltip_bg_color: #f2f2f2
+tooltip_fg_color: #222222
tooltip_border_color: #b2b2b2"
-gtk-button-images = 0
-gtk-menu-images = 0
-gtk-toolbar-style = 0
-gtk-enable-mnemonics = 1
-gtk-icon-sizes = "gtk-small-toolbar=16,16:gtk-large-toolbar=22,22"
+gtk-button-images = 0
+gtk-menu-images = 0
+gtk-toolbar-style = 0
+gtk-enable-mnemonics = 1
+gtk-icon-sizes = "gtk-small-toolbar=16,16:gtk-large-toolbar=22,22"
gtk-toolbar-icon-size = large-toolbar
-gtk-auto-mnemonics = 1
+gtk-auto-mnemonics = 1
gtk-alternative-button-order = 1
gtk-error-bell = 0
gtk-show-input-method-menu = 0
gtk-font-name = "Segoe UI 9"
+
style "default" {
xthickness = 1
ythickness = 1
### colours
- bg[NORMAL] = @bg_color
- bg[PRELIGHT] = @bg_color
- bg[SELECTED] = @selected_bg_color
- bg[INSENSITIVE] = @bg_color
- bg[ACTIVE] = @bg_color
-
- fg[NORMAL] = @fg_color
- fg[PRELIGHT] = @fg_color
- fg[SELECTED] = @selected_fg_color
- fg[INSENSITIVE] = darker (@bg_color)
- fg[ACTIVE] = @fg_color
-
- text[NORMAL] = @text_color
- text[PRELIGHT] = @text_color
- text[SELECTED] = @selected_fg_color
+
+ bg[NORMAL] = @bg_color
+ bg[PRELIGHT] = @bg_color
+ bg[SELECTED] = @selected_bg_color
+ bg[INSENSITIVE] = @bg_color
+ bg[ACTIVE] = @bg_color
+
+ fg[NORMAL] = @fg_color
+ fg[PRELIGHT] = @fg_color
+ fg[SELECTED] = @selected_fg_color
+ fg[INSENSITIVE] = darker (@bg_color)
+ fg[ACTIVE] = @fg_color
+
+ text[NORMAL] = @fg_color
+ text[PRELIGHT] = @fg_color
+ text[SELECTED] = @selected_fg_color
text[INSENSITIVE] = darker (@bg_color)
- text[ACTIVE] = @text_color
+ text[ACTIVE] = @fg_color
- base[NORMAL] = @base_color
- base[PRELIGHT] = @selected_bg_color
- base[SELECTED] = @selected_bg_color
+ base[NORMAL] = @base_color
+ base[PRELIGHT] = @selected_bg_color
+ base[SELECTED] = @selected_bg_color
base[INSENSITIVE] = @bg_color
- base[ACTIVE] = shade (1.3, @selected_bg_color)
+ base[ACTIVE] = shade (1.3, @selected_bg_color)
### style properties
+
GtkWidget::new-tooltip-style = 1
+ GtkWidget::link-color = @link_color
+ GtkWidget::visited-link-color = @link_color
- GtkEntry::honors-transparent-bg-hint = 1
+ GtkEntry::honors-transparent-bg-hint = 1 # transparent search box background
GtkEntry::inner-border = { 2, 2, 2, 2 }
GtkButton::child-displacement-x = 0
GtkButton::child-displacement-y = 0
GtkButton::default-border = { 0, 0, 0, 0 }
- GtkButton::inner-border = { 2, 2, 2, 2 }
+ GtkButton::inner-border = { 2, 2, 4, 4 }
- GtkTreeView::odd-row-color = @base_color
+ GtkTreeView::odd-row-color = "#fafafa"
GtkScrolledWindow::scrollbar-spacing = 0
+ GtkScrolledWindow::scrollbars-within-bevel = 1
+ GtkScrolledWindow::draw-child-bg = 1
GtkScale::slider-length = 14
GtkMenu::horizontal-padding = 3
GtkMenu::vertical-padding = 3
- GtkMenuItem::horizontal-padding = 2
- GtkSeparatorMenuItem::horizontal-padding = 2
+ GtkMenuItem::horizontal-padding = 3
+ GtkMenuItem::toggle-spacing = 6
+ GtkSeparatorMenuItem::horizontal-padding = 0
GtkTreeView::expander-size = 8
GtkExpander::expander-size = 8
GtkComboBox::arrow-size = 8
+ GtkComboBox::appears-as-list = 0
engine "xamarin" {
-
arrowstyle = 2
- rgba = TRUE
- roundness = 3
+ rgba = TRUE
+ roundness = 0
glazestyle = 0
+ highlight_shade = 1.0
- menustyle = 0
- menuitemstyle = 0
+ menustyle = 0
+ menuitemstyle = 0
menubaritemstyle = 0
- comboboxstyle = 1
- spinbuttonstyle = 1
+ comboboxstyle = 0
+ spinbuttonstyle = 1
colorize_scrollbar = FALSE
progressbarstyle = 0
trough_shades = { 0.842, 0.886 }
+ gradient_shades = { 1.0, 1.0, 1.0, 1.0}
+ fill_shade = 1.0
}
}
@@ -109,12 +125,27 @@ style "wider" = "default" {
ythickness = 3
}
-
-style "button" {
+style "button" = "default" {
xthickness = 2
- ythickness = 1
+ ythickness = 4
+
+ bg[NORMAL] = "#e1e1e1"
+ bg[PRELIGHT] = "#bee6fd"
+ bg[ACTIVE] = "#c4e5f6"
+ bg[SELECTED] = "#ADADAD"
- engine "wimp" {
+ fg[SELECTED] = @fg_color
+
+ GtkWidget::focus-padding = 0
+ GtkWidget::focus-line-width = 1
+
+ engine "xamarin" {
+ rgba = FALSE
+ roundness = 0
+ contrast = 1.0
+ focus_color = "#3c7fb1"
+ focusstyle = 3
+ textstyle = 0
}
}
@@ -122,21 +153,39 @@ style "menu" = "default" {
xthickness = 0
ythickness = 0
- engine "wimp" {
- }
+ fg[PRELIGHT] = @selected_fg_color
+ text[PRELIGHT] = @selected_fg_color
}
-style "menu-item" = "default" {
+style "menubar" = "default" {
xthickness = 5
ythickness = 3
+}
- engine "wimp" {
+style "menu-item" = "menu" {
+ xthickness = 2
+ ythickness = 3
+ GtkMenuItem::arrow-scaling = 0.35
+
+ engine "xamarin" {
+ arrowstyle = 3
+ contrast = 0.0
+ }
+}
+
+style "menu-separator" = "menu-item" {
+ xthickness = 0
+ ythickness = 2
+
+ engine "xamarin" {
+ contrast = 1.0
}
}
style "toolbar" = "default"
{
bg[NORMAL] = "#ddd"
+
engine "xamarin" {
toolbarstyle = 2
}
@@ -146,8 +195,8 @@ style "toolbar-button"
{
engine "xamarin" {
contrast = 1.0
- focus_color = @bg_color
- }
+ focus_color = @bg_color
+ }
}
style "tooltip"
@@ -158,23 +207,14 @@ style "tooltip"
fg[NORMAL] = @tooltip_fg_color
bg[NORMAL] = @tooltip_bg_color
bg[SELECTED] = @tooltip_border_color
-
- engine "xamarin" {
- roundness = 0
- }
}
style "treeview" = "default"
{
- GtkTreeView::odd-row-color = "#f5f5f5"
-
- base[SELECTED] = "#bcd0d4"
- base[ACTIVE] = "#bcd0d4"
- text[SELECTED] = "#000"
+ base[ACTIVE] = @selected_bg_color
+ text[ACTIVE] = @selected_fg_color
engine "xamarin" {
- roundness = 0
- gradient_shades = {1.0, 0.95, 0.95, 0.90}
glazestyle = 1
}
}
@@ -182,10 +222,11 @@ style "treeview" = "default"
style "tree-header" = "wide"
{
bg[NORMAL] = "#f2f2f2"
+ bg[PRELIGHT] = "#d9ebf9"
+ bg[ACTIVE] = "#bcdcf4"
engine "xamarin" {
- listviewheaderstyle = 3
- separatorstyle = 1
+ focusstyle = 0
}
}
@@ -193,40 +234,57 @@ style "icon-view" = "default"
{
bg[SELECTED] = "#f5f7fa"
base[SELECTED] = "#f5f7fa"
- fg[SELECTED] = "#000"
- text[SELECTED] = "#000"
+ fg[SELECTED] = @fg_color
+ text[SELECTED] = @fg_color
}
-style "toolbar-combo-box" = "default"
+style "toolbar-combo-box" = "button"
{
- fg[NORMAL] = @fg_color
- text[NORMAL] = @fg_color
- bg[NORMAL] = "#fff"
- base[NORMAL] = "#fff"
+ bg[NORMAL] = @base_color
+ base[NORMAL] = @base_color
- engine "wimp" {
- comboboxstyle = 0
- arrowstyle = 2
+ ythickness = 4
+ xthickness = 2
+ GtkWidget::focus-padding = 0
+
+ engine "xamarin" {
+ roundness = 3
}
}
style "combo-box" = "default"
{
- fg[NORMAL] = "#616161"
+ bg[NORMAL] = @base_color
+ bg[ACTIVE] = @base_color
+ ythickness = 0
+ xthickness = 0
- engine "wimp" {
+ engine "xamarin" {
arrowstyle = 3
}
}
-style "combo-box-label" = "combo-box"
+style "combo-box-button" = "button"
+{
+ bg[PRELIGHT] = @base_color
+ base[PRELIGHT] = "#ADADAD"
+ bg[ACTIVE] = "#ADADAD"
+}
+
+style "combo-box-entry" = "entry"
+{
+ xthickness = 0
+ ythickness = 0
+}
+
+style "combo-box-entry-button" = "combo-box-button"
{
- fg[NORMAL] = "#595959"
}
style "notebook" = "default"
{
GtkNotebook::tab-overlap = 1
+
bg[ACTIVE] = @base_color
bg[NORMAL] = @base_color
@@ -235,37 +293,43 @@ style "notebook" = "default"
}
}
-style "radio-button" = "default"
+style "radio-check-box" = "button"
{
GtkCheckButton::indicator-size = 15
- text[NORMAL] = lighter (@text_color)
- base[NORMAL] = @base_color
- text[ACTIVE] = lighter(@text_color)
-}
-style "check-box" = "default"
-{
- GtkCheckButton::indicator-size = 15
- base[NORMAL] = "#f8f8f8"
- text[NORMAL] = "#404040"
- text[ACTIVE] = "#404040"
+ base[SELECTED] = @base_color
+ text[SELECTED] = @fg_color
+
+ engine "xamarin" {
+ focusstyle = 0
+ }
}
style "entry" = "default"
{
xthickness = 4
ythickness = 4
+
GtkEntry::inner-border = { 2, 2, 2, 2 }
}
style "search-entry" = "wider"
{
GtkEntry::inner-border = { 0, 0, 0, 0 }
+
xthickness = 6
ythickness = 4
+
bg[NORMAL] = @base_color
}
+style "search-entry-rounded" = "search-entry"
+{
+ engine "xamarin" {
+ roundness = 3
+ }
+}
+
style "wizard-dialog"
{
GtkDialog::content-area-border = 0
@@ -273,17 +337,38 @@ style "wizard-dialog"
style "scrollbar" = "default"
{
- GtkRange::slider-width = 7
- GtkRange::trough-border = 2
-
- engine "wimp" {
+ GtkRange::slider-width = 14
+ GtkRange::trough-border = 0
+ GtkWidget::draw-border = { 0, 0, 0, 0 }
+
+ bg[NORMAL] = "#CDCDCD" # default slider/stepper color
+ bg[INSENSITIVE] = "#CDCDCD" # disabled slider/stepper color
+ bg[PRELIGHT] = "#A6A6A6" # hover slider/stepper color
+ bg[ACTIVE] = "#CDCDCD" # pressed stepper color
+
+ engine "xamarin"
+ {
+ contrast = 0.0
+ trough_shades = { 1.0, 1.0 }
+ stepperstyle = 1
+ arrowstyle = 0
}
}
+style "completion_scrollbar" = "scrollbar"
+{
+ GtkScrollbar::has-forward-stepper = 0
+ GtkScrollbar::has-backward-stepper = 0
+ GtkRange::slider-width = 9
+
+ bg[NORMAL] = @bg_color
+}
+
style "progressbar" = "default"
{
bg[SELECTED] = "#62b3ec"
fg[SELECTED] = "#3a67a6"
+
xthickness = 0
ythickness = 0
}
@@ -301,52 +386,67 @@ style "scale" = "default"
}
}
+style "link-label-fix"
+{
+ base[PRELIGHT] = @bg_color # disable link hover background
+}
+
+
### Apply the styles
-class "GtkWidget" style "default"
+class "GtkWidget" style "default"
-class "GtkEntry" style "entry"
+class "GtkEntry" style "entry"
class "GtkSpinButton" style "wider"
-class "GtkFrame" style "wide"
-class "GtkRange" style "wide"
+class "GtkFrame" style "wide"
+class "GtkRange" style "wide"
class "GtkSeparator" style "wide"
class "GtkScrollbar" style "scrollbar"
class "GtkProgressBar" style "progressbar"
class "GtkScrolledWindow" style "scrolled-window"
class "GtkNotebook" style "notebook"
class "GtkButton" style "button"
+class "GtkComboBox" style "combo-box"
+class "GtkComboBoxEntry" style "combo-box-entry"
-class "GtkRadioButton" style "radio-button"
-class "GtkCheckButton" style "check-box"
+class "GtkRadioButton" style "radio-check-box"
+class "GtkCheckButton" style "radio-check-box"
class "GtkScale" style "scale"
widget "*GtkEntry" style:highest "entry"
widget "*search-entry*" style "search-entry"
+widget_class "*Toolbar*.*SearchEntry*" style:highest "search-entry-rounded"
+
+widget "wizard_dialog" style "wizard-dialog"
-widget_class "*<GtkButton>" style "button"
-widget "*.GtkToggleButton" style "button"
-widget "wizard_dialog" style "wizard-dialog"
+widget "*CompletionScrolledWindow*" style "completion_scrollbar"
-widget_class "*<GtkMenu>*" style "menu"
-widget_class "*<GtkMenuItem>*" style "menu-item"
+widget_class "*<GtkMenu>*" style "menu"
+widget_class "*<GtkMenuItem>*" style "menu-item"
+widget_class "*<GtkSeparatorMenuItem>*" style "menu-separator"
+widget_class "*<GtkMenuBar>" style "menubar"
widget_class "*<GtkToolbar>*" style "toolbar"
-widget_class "*ToolButton*" style "toolbar-button"
+widget_class "*ToolButton*" style "toolbar-button"
-widget_class "*.<GtkTreeView>*" style "treeview"
-widget_class "*.GtkTreeView.GtkButton" style "tree-header"
-widget_class "*.GtkList.GtkButton" style "tree-header"
+widget_class "*.<GtkTreeView>*" style "treeview"
+widget_class "*.<GtkTreeView>.<GtkButton>" style "tree-header"
+widget_class "*.<GtkList>.<GtkButton>" style "tree-header"
widget_class "*<GtkIconView>" style "icon-view"
-class "GtkComboBox" style "combo-box"
-widget_class "*.<GtkComboBox>.*" style "combo-box"
-widget_class "*.<GtkComboBoxText>.*" style "combo-box"
-widget_class "*.<GtkComboBoxEntry>.*" style "combo-box"
-widget_class "*.<GtkComboBoxText>.<GtkEntry>" style "entry"
-widget_class "*.<GtkComboBox>.*.GtkLabel" style "combo-box-label"
+widget_class "*<GtkComboBox>*" style "combo-box"
+widget_class "*.<GtkComboBox>*<GtkButton>*" style "combo-box-button"
+
+widget_class "*<GtkComboBoxText>*" style "combo-box-entry"
+widget_class "*.<GtkComboBoxText>*<GtkButton>*" style "combo-box-entry-button"
+widget_class "*<GtkComboBoxEntry>*" style "combo-box-entry"
+widget_class "*.<GtkComboBoxEntry>*<GtkButton>*" style "combo-box-entry-button"
# Comboboxes within toolbars
-widget_class "*.<GtkToolbar>.*.<GtkComboBox>.*" style "toolbar-combo-box"
-widget "*MainToolbar*.GtkComboBox.*" style "toolbar-combo-box"
+widget_class "*.<GtkToolbar>.<GtkComboBox>.<GtkButton>" style "toolbar-combo-box"
+widget "*MainToolbar*.GtkComboBox.*" style:highest "toolbar-combo-box"
+
+widget "gtk-tooltip*" style "tooltip"
-widget "gtk-tooltip*" style "tooltip"
+# disable hover background on link labels
+class "GtkLabel" style "link-label-fix"
diff --git a/main/src/core/MonoDevelop.Ide/gtkrc.win32-dark b/main/src/core/MonoDevelop.Ide/gtkrc.win32-dark
new file mode 100644
index 0000000000..6c1dfa887a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/gtkrc.win32-dark
@@ -0,0 +1,454 @@
+# Xamarin Studio Dark Windows GTK Theme
+# Copyright 2012-2016 Xamarin Inc.
+# Authors:
+# Christian Kellner <christian.kellner@lanedo.com>
+# Carlos Garnacho <carlos.garnacho@lanedo.com>
+# Cody Russell <cody@xamarin.com>
+# Vsevolod Kukol <vsevolod.kukol@xamarin.com>
+# Vaclav Vancura <vaclav@xamarin.com>
+
+
+gtk-color-scheme =
+"bg_color: #333
+fg_color: #d7d7d7
+base_color: #404040
+text_color: #d7d7d7
+link_color: #56bbf0
+dim_color: #777777
+selected_bg_color: #4c5e6e
+selected_fg_color: #bfbfbf
+tooltip_bg_color: #5a5a5a
+tooltip_fg_color: #d2d5cd
+tooltip_border_color: #b2b2b2"
+
+gtk-button-images = 0
+gtk-menu-images = 0
+gtk-toolbar-style = 0
+gtk-enable-mnemonics = 1
+gtk-icon-sizes = "gtk-small-toolbar=16,16:gtk-large-toolbar=22,22"
+gtk-toolbar-icon-size = large-toolbar
+gtk-auto-mnemonics = 1
+gtk-alternative-button-order = 1
+gtk-error-bell = 0
+gtk-show-input-method-menu = 0
+gtk-font-name = "Segoe UI 9"
+
+
+style "default" {
+ xthickness = 1
+ ythickness = 1
+
+ ### colours
+
+ bg[NORMAL] = @bg_color
+ bg[PRELIGHT] = @bg_color
+ bg[SELECTED] = @selected_bg_color
+ bg[INSENSITIVE] = @bg_color
+ bg[ACTIVE] = @bg_color
+
+ fg[NORMAL] = @fg_color
+ fg[PRELIGHT] = @fg_color
+ fg[SELECTED] = @selected_fg_color
+ fg[INSENSITIVE] = @dim_color
+ fg[ACTIVE] = @fg_color
+
+ text[NORMAL] = @fg_color
+ text[PRELIGHT] = @fg_color
+ text[SELECTED] = @selected_fg_color
+ text[INSENSITIVE] = @dim_color
+ text[ACTIVE] = @fg_color
+
+ base[NORMAL] = @base_color
+ base[PRELIGHT] = @selected_bg_color
+ base[SELECTED] = @selected_bg_color
+ base[INSENSITIVE] = @bg_color
+ base[ACTIVE] = shade (1.3, @selected_bg_color)
+
+ ### style properties
+
+ GtkWidget::new-tooltip-style = 1
+ GtkWidget::link-color = @link_color
+ GtkWidget::visited-link-color = @link_color
+
+ GtkEntry::honors-transparent-bg-hint = 1 # transparent search box background
+ GtkEntry::inner-border = { 2, 2, 2, 2 }
+
+ GtkButton::child-displacement-x = 0
+ GtkButton::child-displacement-y = 0
+ GtkButton::default-border = { 0, 0, 0, 0 }
+ GtkButton::inner-border = { 2, 2, 4, 4 }
+
+ GtkTreeView::odd-row-color = "#3b3b3b"
+
+ GtkScrolledWindow::scrollbar-spacing = 0
+ GtkScrolledWindow::scrollbars-within-bevel = 1
+ GtkScrolledWindow::draw-child-bg = 1
+ GtkScale::slider-length = 14
+
+ GtkMenu::horizontal-padding = 3
+ GtkMenu::vertical-padding = 3
+ GtkMenuItem::horizontal-padding = 3
+ GtkMenuItem::toggle-spacing = 6
+ GtkSeparatorMenuItem::horizontal-padding = 0
+
+ GtkTreeView::expander-size = 8
+ GtkExpander::expander-size = 8
+ GtkComboBox::arrow-size = 8
+ GtkComboBox::appears-as-list = 0
+
+ engine "xamarin" {
+ arrowstyle = 2
+ rgba = TRUE
+ roundness = 0
+ glazestyle = 0
+ highlight_shade = 1.0
+
+ menustyle = 0
+ menuitemstyle = 0
+ menubaritemstyle = 0
+ comboboxstyle = 0
+ spinbuttonstyle = 1
+ colorize_scrollbar = FALSE
+ progressbarstyle = 0
+ trough_shades = { 0.842, 0.886 }
+ gradient_shades = { 1.0, 1.0, 1.0, 1.0}
+ fill_shade = 1.0
+ }
+}
+
+style "wide" = "default" {
+ xthickness = 2
+ ythickness = 2
+}
+
+style "wider" = "default" {
+ xthickness = 3
+ ythickness = 3
+}
+
+style "button" = "default" {
+ xthickness = 2
+ ythickness = 4
+
+ bg[NORMAL] = "#3E3E40"
+ bg[PRELIGHT] ="#595959"
+ bg[ACTIVE] = "#595959"
+ bg[INSENSITIVE] = "#595959"
+
+ fg[NORMAL] = "#fff"
+ fg[PRELIGHT] = "#fff"
+ fg[ACTIVE] = "black"
+ fg[INSENSITIVE] = lighter ("#595959")
+
+ GtkWidget::focus-padding = 0
+ GtkWidget::focus-line-width = 1
+
+ engine "xamarin" {
+ rgba = FALSE
+ roundness = 0
+ contrast = 1.0
+ focus_color = shade(1.4, @bg_color)
+ focusstyle = 3
+ textstyle = 0
+ default_button_color = lighter ("#595959")
+ }
+}
+
+style "toggle-button" = "button" {
+ bg[NORMAL] = @base_color
+ bg[ACTIVE] = @bg_color
+ bg[PRELIGHT] = @bg_color
+ fg[ACTIVE] = "#fff"
+}
+
+style "menu" = "default" {
+ xthickness = 0
+ ythickness = 0
+
+ base[NORMAL] = @selected_fg_color # option menu color (FIXME: remove murrine dark shade)
+ base[PRELIGHT] = @selected_fg_color # option menu color (FIXME: remove murrine dark shade)
+ fg[PRELIGHT] = @selected_fg_color
+ text[PRELIGHT] = @selected_fg_color
+}
+
+style "menubar" = "default" {
+ xthickness = 5
+ ythickness = 3
+ bg[SELECTED] = @bg_color # selected/open background
+ fg[PRELIGHT] = @selected_fg_color # selected/open text
+}
+
+style "menu-item" = "menu" {
+ xthickness = 2
+ ythickness = 3
+ GtkMenuItem::arrow-scaling = 0.35
+
+ engine "xamarin" {
+ arrowstyle = 3
+ contrast = 0.0
+ }
+}
+
+style "menu-separator" = "menu-item" {
+ xthickness = 0
+ ythickness = 2
+ engine "xamarin" {
+ contrast = 1.0
+ }
+}
+
+style "toolbar" = "default"
+{
+ bg[NORMAL] = @base_color
+}
+
+style "tooltip"
+{
+ xthickness = 5
+ ythickness = 5
+
+ fg[NORMAL] = @tooltip_fg_color
+ bg[NORMAL] = @tooltip_bg_color
+ bg[SELECTED] = @tooltip_border_color
+}
+
+style "treeview" = "default"
+{
+ base[ACTIVE] = @selected_bg_color
+ text[ACTIVE] = @selected_fg_color
+
+ engine "xamarin" {
+ roundness = 0
+ gradient_shades = { 1.01, 1.01, 1.01, 1.01 }
+ glazestyle = 1
+ }
+}
+
+style "tree-header" = "wide"
+{
+ bg[NORMAL] = @bg_color
+ bg[PRELIGHT] = lighter (@bg_color)
+ bg[ACTIVE] = lighter (@bg_color)
+
+ engine "xamarin" {
+ focusstyle = 0
+ listviewheaderstyle = 3
+ separatorstyle = 1
+ }
+}
+
+style "icon-view" = "default"
+{
+ bg[SELECTED] = "#f5f7fa"
+ base[SELECTED] = "#f5f7fa"
+ fg[SELECTED] = "#000"
+ text[SELECTED] = "#000"
+}
+
+style "combo-box" = "default"
+ {
+ bg[NORMAL] = @base_color
+ bg[ACTIVE] = @base_color
+ ythickness = 0
+ xthickness = 0
+
+ engine "xamarin" {
+ arrowstyle = 3
+ }
+}
+
+style "combo-box-button" = "button"
+{
+}
+
+style "combo-box-entry" = "entry"
+{
+ xthickness = 0
+ ythickness = 0
+}
+
+style "combo-box-entry-button" = "combo-box-button"
+{
+}
+
+style "notebook" = "default"
+{
+ GtkNotebook::tab-overlap = 1
+
+ bg[ACTIVE] = @base_color
+ bg[NORMAL] = @base_color
+
+ engine "xamarin" {
+ gradient_shades = { 0.945, 0.945, 0.945, 0.685 }
+ }
+}
+
+style "radio-check-box" = "button"
+{
+ GtkCheckButton::indicator-size = 15
+
+ bg[ACTIVE] = @bg_color
+ fg[NORMAL] = @fg_color
+ fg[PRELIGHT] = "#fff"
+ fg[ACTIVE] = @fg_color
+
+ base[NORMAL] = @base_color
+ base[ACTIVE] = @base_color
+ base[SELECTED] = @base_color
+ base[PRELIGHT] = @base_color
+ text[PRELIGHT] = "#fff"
+
+ engine "xamarin" {
+ focusstyle = 0
+ }
+}
+
+style "entry" = "default"
+{
+ xthickness = 4
+ ythickness = 4
+
+ GtkEntry::inner-border = { 2, 2, 2, 2 }
+}
+
+style "search-entry" = "wider"
+{
+ GtkEntry::inner-border = { 0, 0, 0, 0 }
+
+ xthickness = 6
+ ythickness = 4
+
+ bg[NORMAL] = @base_color
+}
+
+style "search-entry-rounded" = "search-entry"
+{
+ engine "xamarin" {
+ roundness = 3
+ }
+}
+
+style "wizard-dialog"
+{
+ GtkDialog::content-area-border = 0
+}
+
+style "scrollbar" = "default"
+{
+ GtkRange::slider-width = 14
+ GtkRange::trough-border = 0
+ GtkWidget::draw-border = { 0, 0, 0, 0 }
+
+ fg[INSENSITIVE] = lighter (@base_color) # inactive arrow
+ fg[NORMAL] = "black" # active arrow
+ bg[NORMAL] = @fg_color # default slider/stepper color
+ bg[INSENSITIVE] = @fg_color # disabled slider/stepper color
+ bg[PRELIGHT] = shade (0.8, @fg_color) # hover slider/stepper color
+ bg[ACTIVE] = @fg_color # pressed stepper color
+
+ engine "xamarin"
+ {
+ contrast = 0.0
+ trough_shades = { 1.0, 1.0 }
+ stepperstyle = 1
+ arrowstyle = 0
+ }
+}
+
+style "completion_scrollbar" = "scrollbar"
+{
+ GtkScrollbar::has-forward-stepper = 0
+ GtkScrollbar::has-backward-stepper = 0
+ GtkRange::slider-width = 9
+
+ bg[NORMAL] = @base_color
+ bg[PRELIGHT] = shade (1.3, @base_color)
+}
+
+style "progressbar" = "default"
+{
+ bg[SELECTED] = "#62b3ec"
+ fg[SELECTED] = "#3a67a6"
+
+ xthickness = 0
+ ythickness = 0
+}
+
+style "scrolled-window" = "default"
+{
+ xthickness = 1
+ ythickness = 1
+}
+
+style "scale" = "default"
+{
+ engine "xamarin" {
+ roundness = 7
+ }
+}
+
+style "link-label-fix"
+{
+ base[PRELIGHT] = @bg_color # disable link hover background
+}
+
+
+### Apply the styles
+class "GtkWidget" style "default"
+
+class "GtkEntry" style "entry"
+class "GtkSpinButton" style "wider"
+class "GtkFrame" style "wide"
+class "GtkRange" style "wide"
+class "GtkSeparator" style "wide"
+class "GtkScrollbar" style "scrollbar"
+class "GtkProgressBar" style "progressbar"
+class "GtkScrolledWindow" style "scrolled-window"
+class "GtkNotebook" style "notebook"
+class "GtkButton" style "button"
+class "GtkToggleButton" style "toggle-button"
+class "GtkComboBox" style "combo-box"
+class "GtkComboBoxEntry" style "combo-box-entry"
+
+class "GtkRadioButton" style "radio-check-box"
+class "GtkCheckButton" style "radio-check-box"
+class "GtkScale" style "scale"
+
+widget "*GtkEntry" style:highest "entry"
+widget "*search-entry*" style "search-entry"
+#widget_class "*Toolbar*.*SearchEntry*" style:highest "search-entry-rounded"
+
+widget "wizard_dialog" style "wizard-dialog"
+
+widget "*CompletionScrolledWindow*" style "completion_scrollbar"
+
+widget_class "*<GtkMenu>*" style "menu"
+widget_class "*<GtkMenuItem>*" style "menu-item"
+widget_class "*<GtkSeparatorMenuItem>*" style "menu-separator"
+widget_class "*<GtkMenuBar>*" style "menubar"
+
+widget_class "*<GtkToolbar>*" style "toolbar"
+#widget_class "*ToolButton*" style "toolbar-button"
+
+widget_class "*.<GtkTreeView>*" style "treeview"
+widget_class "*.<GtkTreeView>.<GtkButton>" style "tree-header"
+widget_class "*.<GtkList>.<GtkButton>" style "tree-header"
+
+widget_class "*<GtkIconView>" style "icon-view"
+
+widget_class "*<GtkComboBox>*" style "combo-box"
+widget_class "*.<GtkComboBox>*<GtkButton>*" style "combo-box-button"
+
+widget_class "*<GtkComboBoxText>*" style "combo-box-entry"
+widget_class "*.<GtkComboBoxText>*<GtkButton>*" style "combo-box-entry-button"
+widget_class "*<GtkComboBoxEntry>*" style "combo-box-entry"
+widget_class "*.<GtkComboBoxEntry>*<GtkButton>*" style "combo-box-entry-button"
+
+# Comboboxes within toolbars
+#widget_class "*.<GtkToolbar>.<GtkComboBox>.<GtkButton>" style "toolbar-combo-box"
+#widget "*MainToolbar*.GtkComboBox.*" style:highest "toolbar-combo-box"
+
+widget "gtk-tooltip*" style "tooltip"
+
+# disable hover background on link labels
+class "GtkLabel" style "link-label-fix"
diff --git a/main/src/core/MonoDevelop.Ide/gtkrc.win32-vista b/main/src/core/MonoDevelop.Ide/gtkrc.win32-vista
deleted file mode 100644
index 58345088f5..0000000000
--- a/main/src/core/MonoDevelop.Ide/gtkrc.win32-vista
+++ /dev/null
@@ -1,351 +0,0 @@
-# Windows Theme for Xamarin composed by Lanedo GmbH
-# Copyright 2012 Xamarin Inc.
-# Authors:
-# Christian Kellner <christian.kellner@lanedo.com>
-# Carlos Garnacho <carlos.garnacho@lanedo.com>
-
-gtk-color-scheme =
-"bg_color: #f5f5f5
-fg_color: #000
-base_color: #fff
-text_color: #000
-selected_bg_color: #649dd6
-selected_fg_color: #fff
-tooltip_bg_color: #fff9e5
-tooltip_fg_color: #000"
-
-gtk-button-images = 0
-gtk-menu-images = 0
-gtk-toolbar-style = 0
-gtk-enable-mnemonics = 1
-gtk-icon-sizes = "gtk-small-toolbar=16,16:gtk-large-toolbar=22,22"
-gtk-toolbar-icon-size = large-toolbar
-gtk-auto-mnemonics = 1
-gtk-alternative-button-order = 1
-gtk-error-bell = 0
-gtk-show-input-method-menu = 0
-gtk-font-name = "Tahoma 8"
-
-style "default" {
- xthickness = 1
- ythickness = 1
-
- ### colours
- bg[NORMAL] = @bg_color
- bg[PRELIGHT] = @bg_color
- bg[SELECTED] = @selected_bg_color
- bg[INSENSITIVE] = @bg_color
- bg[ACTIVE] = @bg_color
-
- fg[NORMAL] = @fg_color
- fg[PRELIGHT] = @fg_color
- fg[SELECTED] = @selected_fg_color
- fg[INSENSITIVE] = darker (@bg_color)
- fg[ACTIVE] = @fg_color
-
- text[NORMAL] = @text_color
- text[PRELIGHT] = @text_color
- text[SELECTED] = @selected_fg_color
- text[INSENSITIVE] = darker (@bg_color)
- text[ACTIVE] = @text_color
-
- base[NORMAL] = @base_color
- base[PRELIGHT] = @selected_bg_color
- base[SELECTED] = @selected_bg_color
- base[INSENSITIVE] = @bg_color
- base[ACTIVE] = shade (1.3, @selected_bg_color)
-
- ### style properties
- GtkWidget::new-tooltip-style = 1
-
- GtkEntry::honors-transparent-bg-hint = 1
- GtkEntry::inner-border = { 2, 2, 2, 2 }
-
- GtkButton::child-displacement-x = 0
- GtkButton::child-displacement-y = 0
- GtkButton::default-border = { 0, 0, 0, 0 }
- GtkButton::inner-border = { 2, 2, 2, 2 }
-
- GtkTreeView::odd-row-color = @base_color
-
- GtkScrolledWindow::scrollbar-spacing = 0
- GtkScale::slider-length = 14
-
- GtkMenu::horizontal-padding = 3
- GtkMenu::vertical-padding = 3
- GtkMenuItem::horizontal-padding = 2
- GtkSeparatorMenuItem::horizontal-padding = 2
-
- GtkTreeView::expander-size = 8
- GtkExpander::expander-size = 8
- GtkComboBox::arrow-size = 8
-
- engine "xamarin" {
-
- arrowstyle = 2
- rgba = TRUE
- roundness = 3
- glazestyle = 0
-
- menustyle = 0
- menuitemstyle = 0
- menubaritemstyle = 0
- comboboxstyle = 1
- spinbuttonstyle = 1
- colorize_scrollbar = FALSE
- progressbarstyle = 0
- trough_shades = { 0.842, 0.886 }
- }
-}
-
-style "wide" = "default" {
- xthickness = 2
- ythickness = 2
-}
-
-style "wider" = "default" {
- xthickness = 3
- ythickness = 3
-}
-
-
-style "button" {
- xthickness = 2
- ythickness = 1
-
- engine "wimp" {
- }
-}
-
-style "menu" = "default" {
- xthickness = 0
- ythickness = 0
-
- engine "wimp" {
- }
-}
-
-style "menu-item" = "default" {
- xthickness = 5
- ythickness = 3
-
- engine "wimp" {
- }
-}
-
-style "toolbar" = "default"
-{
- bg[NORMAL] = "#ddd"
- engine "xamarin" {
- toolbarstyle = 2
- }
-}
-
-style "toolbar-button"
-{
- engine "xamarin" {
- contrast = 1.0
- focus_color = @bg_color
- }
-}
-
-style "tooltip"
-{
- xthickness = 5
- ythickness = 5
-
- fg[NORMAL] = @tooltip_fg_color
- bg[NORMAL] = @tooltip_bg_color
-
- engine "xamarin" {
- roundness = 0
- }
-}
-
-style "treeview" = "default"
-{
- GtkTreeView::odd-row-color = "#f5f5f5"
-
- base[SELECTED] = "#bcd0d4"
- base[ACTIVE] = "#bcd0d4"
- text[SELECTED] = "#000"
-
- engine "xamarin" {
- roundness = 0
- gradient_shades = {1.0, 0.95, 0.95, 0.90}
- glazestyle = 1
- }
-}
-
-style "tree-header" = "wide"
-{
- bg[NORMAL] = "#f2f2f2"
-
- engine "xamarin" {
- listviewheaderstyle = 3
- separatorstyle = 1
- }
-}
-
-style "icon-view" = "default"
-{
- bg[SELECTED] = "#f5f7fa"
- base[SELECTED] = "#f5f7fa"
- fg[SELECTED] = "#000"
- text[SELECTED] = "#000"
-}
-
-style "toolbar-combo-box" = "default"
-{
- fg[NORMAL] = @fg_color
- text[NORMAL] = @fg_color
- bg[NORMAL] = "#fff"
- base[NORMAL] = "#fff"
-
- engine "wimp" {
- comboboxstyle = 0
- arrowstyle = 2
- }
-}
-
-style "combo-box" = "default"
-{
- fg[NORMAL] = "#616161"
-
- engine "wimp" {
- arrowstyle = 3
- }
-}
-
-style "combo-box-label" = "combo-box"
-{
- fg[NORMAL] = "#595959"
-}
-
-style "notebook" = "default"
-{
- GtkNotebook::tab-overlap = 1
- bg[ACTIVE] = @base_color
- bg[NORMAL] = @base_color
-
- engine "xamarin" {
- gradient_shades = { 0.945, 0.945, 0.945, 0.685 }
- }
-}
-
-style "wizard-dialog"
-{
- GtkDialog::content-area-border = 0
-}
-
-style "radio-button" = "default"
-{
- GtkCheckButton::indicator-size = 15
- text[NORMAL] = lighter (@text_color)
- base[NORMAL] = @base_color
- text[ACTIVE] = lighter(@text_color)
-}
-
-style "check-box" = "default"
-{
- GtkCheckButton::indicator-size = 15
- base[NORMAL] = "#f8f8f8"
- text[NORMAL] = "#404040"
- text[ACTIVE] = "#404040"
-}
-
-style "entry" = "default"
-{
- xthickness = 4
- ythickness = 4
- GtkEntry::inner-border = { 2, 2, 2, 2 }
-}
-
-style "search-entry" = "wider"
-{
- GtkEntry::inner-border = { 0, 0, 0, 0 }
- xthickness = 6
- ythickness = 4
- bg[NORMAL] = @base_color
-}
-
-style "scrollbar" = "default"
-{
- GtkRange::slider-width = 7
- GtkRange::trough-border = 2
-
- engine "wimp" {
- }
-}
-
-style "progressbar" = "default"
-{
- bg[SELECTED] = "#62b3ec"
- fg[SELECTED] = "#3a67a6"
- xthickness = 0
- ythickness = 0
-}
-
-style "scrolled-window" = "default"
-{
- xthickness = 1
- ythickness = 1
-}
-
-style "scale" = "default"
-{
- engine "xamarin" {
- roundness = 7
- }
-}
-
-### Apply the styles
-class "GtkWidget" style "default"
-
-class "GtkEntry" style "entry"
-class "GtkSpinButton" style "wider"
-class "GtkFrame" style "wide"
-class "GtkRange" style "wide"
-class "GtkSeparator" style "wide"
-class "GtkScrollbar" style "scrollbar"
-class "GtkProgressBar" style "progressbar"
-class "GtkScrolledWindow" style "scrolled-window"
-class "GtkNotebook" style "notebook"
-class "GtkButton" style "button"
-
-class "GtkRadioButton" style "radio-button"
-class "GtkCheckButton" style "check-box"
-class "GtkScale" style "scale"
-
-widget "*GtkEntry" style:highest "entry"
-widget "*search-entry*" style "search-entry"
-
-widget_class "*<GtkButton>" style "button"
-widget "*.GtkToggleButton" style "button"
-
-widget "wizard_dialog" style "wizard-dialog"
-
-widget_class "*<GtkMenu>*" style "menu"
-widget_class "*<GtkMenuItem>*" style "menu-item"
-
-widget_class "*<GtkToolbar>*" style "toolbar"
-widget_class "*ToolButton*" style "toolbar-button"
-
-widget_class "*.<GtkTreeView>*" style "treeview"
-widget_class "*.GtkTreeView.GtkButton" style "tree-header"
-widget_class "*.GtkList.GtkButton" style "tree-header"
-
-widget_class "*<GtkIconView>" style "icon-view"
-
-class "GtkComboBox" style "combo-box"
-widget_class "*.<GtkComboBox>.*" style "combo-box"
-widget_class "*.<GtkComboBoxText>.*" style "combo-box"
-widget_class "*.<GtkComboBoxEntry>.*" style "combo-box"
-widget_class "*.<GtkComboBoxText>.<GtkEntry>" style "entry"
-widget_class "*.<GtkComboBox>.*.GtkLabel" style "combo-box-label"
-
-# Comboboxes within toolbars
-widget_class "*.<GtkToolbar>.*.<GtkComboBox>.*" style "toolbar-combo-box"
-widget "*MainToolbar*.GtkComboBox.*" style "toolbar-combo-box"
-
-widget "gtk-tooltip*" style "tooltip"
diff --git a/main/src/core/MonoDevelop.Ide/icons/about-md-16.png b/main/src/core/MonoDevelop.Ide/icons/about-md-16.png
new file mode 100644
index 0000000000..6cae3c906c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/about-md-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/about-md-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/about-md-16@2x.png
new file mode 100644
index 0000000000..d211c18c55
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/about-md-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/about-md-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/about-md-16~dark.png
new file mode 100644
index 0000000000..68846e0620
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/about-md-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/about-md-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/about-md-16~dark@2x.png
new file mode 100644
index 0000000000..989857e4cc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/about-md-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/about-md-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/about-md-16~dark~disabled.png
new file mode 100644
index 0000000000..df9ec9d7c6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/about-md-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/about-md-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/about-md-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..1be5a700bb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/about-md-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/about-md-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/about-md-16~disabled.png
new file mode 100644
index 0000000000..8e64f7bb37
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/about-md-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/about-md-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/about-md-16~disabled@2x.png
new file mode 100644
index 0000000000..557fef35d0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/about-md-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/add-16.png b/main/src/core/MonoDevelop.Ide/icons/add-16.png
index 1885122981..bda8b95c9e 100644
--- a/main/src/core/MonoDevelop.Ide/icons/add-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/add-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/add-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/add-16@2x.png
index 3b6dece125..9b47efa152 100644
--- a/main/src/core/MonoDevelop.Ide/icons/add-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/add-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/add-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/add-16~dark.png
new file mode 100644
index 0000000000..ed52029780
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/add-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/add-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/add-16~dark@2x.png
new file mode 100644
index 0000000000..77b62ea10f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/add-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/add-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/add-16~dark~disabled.png
new file mode 100644
index 0000000000..36f2f7dd03
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/add-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/add-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/add-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..80e73ad242
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/add-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/add-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/add-16~disabled.png
new file mode 100644
index 0000000000..2546d8bfe0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/add-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/add-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/add-16~disabled@2x.png
new file mode 100644
index 0000000000..5e389ec1c4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/add-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/add-namespace-16.png b/main/src/core/MonoDevelop.Ide/icons/add-namespace-16.png
deleted file mode 100644
index 46da2c1014..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/add-namespace-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/assembly-project-16.png b/main/src/core/MonoDevelop.Ide/icons/assembly-project-16.png
deleted file mode 100644
index 52552a1e07..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/assembly-project-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/assembly-project-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/assembly-project-16@2x.png
deleted file mode 100644
index a38862f132..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/assembly-project-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/assembly-reference-overlay-16.png b/main/src/core/MonoDevelop.Ide/icons/assembly-reference-overlay-16.png
deleted file mode 100644
index 2f7ad7f346..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/assembly-reference-overlay-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/assembly-reference-overlay-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/assembly-reference-overlay-16@2x.png
deleted file mode 100644
index a574aa2943..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/assembly-reference-overlay-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/bookmark-clear-all-16.png b/main/src/core/MonoDevelop.Ide/icons/bookmark-clear-all-16.png
new file mode 100644
index 0000000000..66478e2c22
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/bookmark-clear-all-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/bookmark-clear-all-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/bookmark-clear-all-16@2x.png
new file mode 100644
index 0000000000..581dda8c77
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/bookmark-clear-all-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/bookmark-clear-all-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/bookmark-clear-all-16~dark.png
new file mode 100644
index 0000000000..66478e2c22
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/bookmark-clear-all-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/bookmark-clear-all-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/bookmark-clear-all-16~dark@2x.png
new file mode 100644
index 0000000000..eeff290ba3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/bookmark-clear-all-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/bookmark-next-16.png b/main/src/core/MonoDevelop.Ide/icons/bookmark-next-16.png
new file mode 100644
index 0000000000..f89a194e5a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/bookmark-next-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/bookmark-next-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/bookmark-next-16@2x.png
new file mode 100644
index 0000000000..eaa78c08d2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/bookmark-next-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/bookmark-next-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/bookmark-next-16~dark.png
new file mode 100644
index 0000000000..e912b04f50
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/bookmark-next-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/bookmark-next-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/bookmark-next-16~dark@2x.png
new file mode 100644
index 0000000000..0dd176c5e2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/bookmark-next-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/bookmark-prev-16.png b/main/src/core/MonoDevelop.Ide/icons/bookmark-prev-16.png
new file mode 100644
index 0000000000..8583e40a44
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/bookmark-prev-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/bookmark-prev-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/bookmark-prev-16@2x.png
new file mode 100644
index 0000000000..7764c3eecf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/bookmark-prev-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/bookmark-prev-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/bookmark-prev-16~dark.png
new file mode 100644
index 0000000000..18cd50f54c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/bookmark-prev-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/bookmark-prev-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/bookmark-prev-16~dark@2x.png
new file mode 100644
index 0000000000..f457cfc19c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/bookmark-prev-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/bookmark-toggle-16.png b/main/src/core/MonoDevelop.Ide/icons/bookmark-toggle-16.png
new file mode 100644
index 0000000000..5479d0098a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/bookmark-toggle-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/bookmark-toggle-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/bookmark-toggle-16@2x.png
new file mode 100644
index 0000000000..87b6c392ff
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/bookmark-toggle-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/bookmark-toggle-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/bookmark-toggle-16~dark.png
new file mode 100644
index 0000000000..5ca7a0170a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/bookmark-toggle-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/bookmark-toggle-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/bookmark-toggle-16~dark@2x.png
new file mode 100644
index 0000000000..520fd91884
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/bookmark-toggle-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-16.png b/main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-16.png
new file mode 100644
index 0000000000..f16198f9d4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-16@2x.png
new file mode 100644
index 0000000000..ebef7a1c3d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-16~dark.png
new file mode 100644
index 0000000000..18f1b16c94
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-16~dark@2x.png
new file mode 100644
index 0000000000..7315cf8f17
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-normal-16.png b/main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-normal-16.png
deleted file mode 100644
index 6426e3012e..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-normal-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-normal-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-normal-16@2x.png
deleted file mode 100644
index 630ceb0e78..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/breadcrumb-next-normal-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breadcrumb-prev-16.png b/main/src/core/MonoDevelop.Ide/icons/breadcrumb-prev-16.png
new file mode 100644
index 0000000000..fc2e26d5e8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breadcrumb-prev-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breadcrumb-prev-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/breadcrumb-prev-16@2x.png
new file mode 100644
index 0000000000..bd4e5960b8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breadcrumb-prev-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breadcrumb-prev-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/breadcrumb-prev-16~dark.png
new file mode 100644
index 0000000000..d43c23f4e5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breadcrumb-prev-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breadcrumb-prev-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/breadcrumb-prev-16~dark@2x.png
new file mode 100644
index 0000000000..3025837c5a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breadcrumb-prev-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breadcrumb-previous-normal-16.png b/main/src/core/MonoDevelop.Ide/icons/breadcrumb-previous-normal-16.png
deleted file mode 100644
index 26b2f0315f..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/breadcrumb-previous-normal-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breadcrumb-previous-normal-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/breadcrumb-previous-normal-16@2x.png
deleted file mode 100644
index ad157a32c0..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/breadcrumb-previous-normal-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-16.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-16.png
index c0c017eb32..b9a52a2203 100644
--- a/main/src/core/MonoDevelop.Ide/icons/breakpoint-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-16@2x.png
index 9f68a52e2f..e9c7987cef 100644
--- a/main/src/core/MonoDevelop.Ide/icons/breakpoint-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-16~dark.png
new file mode 100644
index 0000000000..de38a0fb46
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-16~dark@2x.png
new file mode 100644
index 0000000000..040f23e224
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-16~dark~disabled.png
new file mode 100644
index 0000000000..2c4c08f2d9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..a411a244df
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-16~disabled.png
new file mode 100644
index 0000000000..40138ca93c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-16~disabled@2x.png
new file mode 100644
index 0000000000..0aa16e9590
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16.png
index d12cdee514..87543ee644 100644
--- a/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16@2x.png
index 9d79574af6..037ab42c60 100644
--- a/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~dark.png
new file mode 100644
index 0000000000..89d6ccbf67
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~dark@2x.png
new file mode 100644
index 0000000000..ed05a22c09
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~dark~disabled.png
new file mode 100644
index 0000000000..b135096f02
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..b666f5129d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~disabled.png
new file mode 100644
index 0000000000..7afd1bc898
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~disabled@2x.png
new file mode 100644
index 0000000000..898e585968
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disable-all-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16.png
index b6cd3c74bc..69f5eea9e3 100644
--- a/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16@2x.png
index 72441964d0..ea593b7d0d 100644
--- a/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~dark.png
new file mode 100644
index 0000000000..aef6a9bda3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~dark@2x.png
new file mode 100644
index 0000000000..6531f2ffbd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~dark~disabled.png
new file mode 100644
index 0000000000..2c4c08f2d9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..a411a244df
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~disabled.png
new file mode 100644
index 0000000000..40138ca93c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~disabled@2x.png
new file mode 100644
index 0000000000..0aa16e9590
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-disabled-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16.png
index c7075c7e8c..f66f7d2d02 100644
--- a/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16@2x.png
index 6a684c6baf..07ed4bcf72 100644
--- a/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~dark.png
new file mode 100644
index 0000000000..16f9f15a86
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~dark@2x.png
new file mode 100644
index 0000000000..cb7c2b5b6e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~dark~disabled.png
new file mode 100644
index 0000000000..9fb11ffc81
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..eedb4c9882
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~disabled.png
new file mode 100644
index 0000000000..1d08870951
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~disabled@2x.png
new file mode 100644
index 0000000000..ad843d4380
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-invalid-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16.png
index 186cab63bc..2ea56cf35a 100644
--- a/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16@2x.png
index fd0345e0d9..857860315c 100644
--- a/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~dark.png
new file mode 100644
index 0000000000..dc193a4aaa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~dark@2x.png
new file mode 100644
index 0000000000..afb832faf2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~dark~disabled.png
new file mode 100644
index 0000000000..daa3f9f87d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..a9c4706e8e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~disabled.png
new file mode 100644
index 0000000000..f79d53e45f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~disabled@2x.png
new file mode 100644
index 0000000000..ce5055b3ff
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-new-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16.png
index 99a37a5497..d022a7cf14 100644
--- a/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16@2x.png
index 4bdfc0bd33..9d43559fb8 100644
--- a/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~dark.png
new file mode 100644
index 0000000000..0e50ad3125
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~dark@2x.png
new file mode 100644
index 0000000000..0d9c4b60b5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~dark~disabled.png
new file mode 100644
index 0000000000..2c4c08f2d9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..a411a244df
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~disabled.png
new file mode 100644
index 0000000000..40138ca93c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~disabled@2x.png
new file mode 100644
index 0000000000..0aa16e9590
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/breakpoint-on-off-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/bug-16.png b/main/src/core/MonoDevelop.Ide/icons/bug-16.png
new file mode 100644
index 0000000000..50b4411287
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/bug-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/bug-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/bug-16@2x.png
new file mode 100644
index 0000000000..ee24941387
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/bug-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/bug-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/bug-16~dark.png
new file mode 100644
index 0000000000..6e7de4f75e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/bug-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/bug-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/bug-16~dark@2x.png
new file mode 100644
index 0000000000..5fe4e118e6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/bug-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/build-project-16.png b/main/src/core/MonoDevelop.Ide/icons/build-project-16.png
index ce7c26e701..a9dbcc3cc6 100644
--- a/main/src/core/MonoDevelop.Ide/icons/build-project-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/build-project-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/build-project-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/build-project-16@2x.png
new file mode 100644
index 0000000000..5a4ee87aef
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/build-project-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/build-project-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/build-project-16~dark.png
new file mode 100644
index 0000000000..165f735808
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/build-project-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/build-project-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/build-project-16~dark@2x.png
new file mode 100644
index 0000000000..f2f9ee1d15
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/build-project-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/build-solution-16.png b/main/src/core/MonoDevelop.Ide/icons/build-solution-16.png
index e92f7e2477..3853003b1e 100644
--- a/main/src/core/MonoDevelop.Ide/icons/build-solution-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/build-solution-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/build-solution-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/build-solution-16@2x.png
new file mode 100644
index 0000000000..2452a36725
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/build-solution-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/build-solution-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/build-solution-16~dark.png
new file mode 100644
index 0000000000..26b2a469f6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/build-solution-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/build-solution-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/build-solution-16~dark@2x.png
new file mode 100644
index 0000000000..6ebd3ee58f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/build-solution-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-16.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-16.png
index bc9ee4a041..efb0449ce6 100644
--- a/main/src/core/MonoDevelop.Ide/icons/catchpoint-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-16@2x.png
index cb1c8a2e3d..502eb453d0 100644
--- a/main/src/core/MonoDevelop.Ide/icons/catchpoint-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-16~dark.png
new file mode 100644
index 0000000000..7741a3b7e4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-16~dark@2x.png
new file mode 100644
index 0000000000..a0061883c6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-16~dark~disabled.png
new file mode 100644
index 0000000000..ca28c47ba7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..35442a52e4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-16~disabled.png
new file mode 100644
index 0000000000..50bc8b019e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-16~disabled@2x.png
new file mode 100644
index 0000000000..cb01ca4071
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16.png
index d22183af90..c1b925f53f 100644
--- a/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16@2x.png
index a5f671e0e7..169229370f 100644
--- a/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~dark.png
new file mode 100644
index 0000000000..a46283dd5c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~dark@2x.png
new file mode 100644
index 0000000000..17b10454fe
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~dark~disabled.png
new file mode 100644
index 0000000000..ca28c47ba7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..35442a52e4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~disabled.png
new file mode 100644
index 0000000000..50bc8b019e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~disabled@2x.png
new file mode 100644
index 0000000000..cb01ca4071
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-disabled-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16.png
new file mode 100644
index 0000000000..1639c4f57a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16@2x.png
new file mode 100644
index 0000000000..d7eb09fc97
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~dark.png
new file mode 100644
index 0000000000..54c96c820a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~dark@2x.png
new file mode 100644
index 0000000000..90224cc2c7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~dark~disabled.png
new file mode 100644
index 0000000000..2e5cc06a4b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..c9aca64add
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~disabled.png
new file mode 100644
index 0000000000..1bb9aa2223
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~disabled@2x.png
new file mode 100644
index 0000000000..ed8732b7ff
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/catchpoint-new-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/clear-16.png b/main/src/core/MonoDevelop.Ide/icons/clear-16.png
index 3805977ddf..b62ac911f2 100644
--- a/main/src/core/MonoDevelop.Ide/icons/clear-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/clear-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/clear-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/clear-16@2x.png
index 5a39227a15..635391b07a 100644
--- a/main/src/core/MonoDevelop.Ide/icons/clear-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/clear-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/clear-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/clear-16~dark.png
new file mode 100644
index 0000000000..787d66099d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/clear-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/clear-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/clear-16~dark@2x.png
new file mode 100644
index 0000000000..928f956606
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/clear-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/clear-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/clear-16~dark~disabled.png
new file mode 100644
index 0000000000..f27e2b1a60
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/clear-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/clear-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/clear-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..2b4c5be06a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/clear-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/clear-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/clear-16~disabled.png
new file mode 100644
index 0000000000..376de101a7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/clear-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/clear-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/clear-16~disabled@2x.png
new file mode 100644
index 0000000000..1272e3f9ee
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/clear-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/clear-all-bookmarks-16.png b/main/src/core/MonoDevelop.Ide/icons/clear-all-bookmarks-16.png
deleted file mode 100644
index e66d6645f4..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/clear-all-bookmarks-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/close-all-documents-16.png b/main/src/core/MonoDevelop.Ide/icons/close-all-documents-16.png
index 2b4c24715d..f64ef07440 100644
--- a/main/src/core/MonoDevelop.Ide/icons/close-all-documents-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/close-all-documents-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/close-all-documents-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/close-all-documents-16@2x.png
new file mode 100644
index 0000000000..d70f96c789
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/close-all-documents-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/close-all-documents-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/close-all-documents-16~dark.png
new file mode 100644
index 0000000000..cafbf5397f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/close-all-documents-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/close-all-documents-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/close-all-documents-16~dark@2x.png
new file mode 100644
index 0000000000..1b4a2c1e40
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/close-all-documents-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/close-solution-16.png b/main/src/core/MonoDevelop.Ide/icons/close-solution-16.png
index 68281f94b4..e7d1f389e6 100644
--- a/main/src/core/MonoDevelop.Ide/icons/close-solution-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/close-solution-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/close-solution-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/close-solution-16@2x.png
new file mode 100644
index 0000000000..72579100b7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/close-solution-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/close-solution-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/close-solution-16~dark.png
new file mode 100644
index 0000000000..1bc81154dd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/close-solution-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/close-solution-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/close-solution-16~dark@2x.png
new file mode 100644
index 0000000000..1310b54f52
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/close-solution-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/columns-one-16.png b/main/src/core/MonoDevelop.Ide/icons/columns-one-16.png
new file mode 100644
index 0000000000..f93870b639
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/columns-one-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/columns-one-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/columns-one-16@2x.png
new file mode 100644
index 0000000000..14b468dc66
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/columns-one-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/columns-one-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/columns-one-16~dark.png
new file mode 100644
index 0000000000..4209460934
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/columns-one-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/columns-one-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/columns-one-16~dark@2x.png
new file mode 100644
index 0000000000..d46d372889
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/columns-one-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/columns-two-16.png b/main/src/core/MonoDevelop.Ide/icons/columns-two-16.png
new file mode 100644
index 0000000000..c7a6e6c6da
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/columns-two-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/columns-two-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/columns-two-16@2x.png
new file mode 100644
index 0000000000..a601604afb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/columns-two-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/columns-two-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/columns-two-16~dark.png
new file mode 100644
index 0000000000..0de4c2f6bb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/columns-two-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/columns-two-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/columns-two-16~dark@2x.png
new file mode 100644
index 0000000000..8d85bf2f8b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/columns-two-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/command-16.png b/main/src/core/MonoDevelop.Ide/icons/command-16.png
index 442d0d8a0c..82e8c0b885 100644
--- a/main/src/core/MonoDevelop.Ide/icons/command-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/command-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/command-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/command-16@2x.png
index 8bee8dcf7d..df2fae955a 100644
--- a/main/src/core/MonoDevelop.Ide/icons/command-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/command-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/command-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/command-16~dark.png
new file mode 100644
index 0000000000..7a1068d660
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/command-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/command-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/command-16~dark@2x.png
new file mode 100644
index 0000000000..6f872077d8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/command-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/command-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/command-16~dark~sel.png
new file mode 100644
index 0000000000..d44254730c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/command-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/command-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/command-16~dark~sel@2x.png
new file mode 100644
index 0000000000..11303fa980
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/command-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/command-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/command-16~sel.png
new file mode 100644
index 0000000000..d44254730c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/command-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/command-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/command-16~sel@2x.png
new file mode 100644
index 0000000000..11303fa980
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/command-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/comment-16.png b/main/src/core/MonoDevelop.Ide/icons/comment-16.png
index 7c9ad146d5..f7fe199170 100644
--- a/main/src/core/MonoDevelop.Ide/icons/comment-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/comment-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/comment-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/comment-16@2x.png
index 0bf30e0162..1b90a2488f 100644
--- a/main/src/core/MonoDevelop.Ide/icons/comment-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/comment-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/comment-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/comment-16~dark.png
new file mode 100644
index 0000000000..70b522bc66
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/comment-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/comment-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/comment-16~dark@2x.png
new file mode 100644
index 0000000000..bf07f8869a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/comment-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/copy-16.png b/main/src/core/MonoDevelop.Ide/icons/copy-16.png
index 574162bafa..62187ea94a 100644
--- a/main/src/core/MonoDevelop.Ide/icons/copy-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/copy-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/copy-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/copy-16@2x.png
index 343cabc06c..13930e8cf6 100644
--- a/main/src/core/MonoDevelop.Ide/icons/copy-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/copy-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/copy-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/copy-16~dark.png
new file mode 100644
index 0000000000..c7f631e981
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/copy-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/copy-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/copy-16~dark@2x.png
new file mode 100644
index 0000000000..76a204a4aa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/copy-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/cut-16.png b/main/src/core/MonoDevelop.Ide/icons/cut-16.png
new file mode 100644
index 0000000000..d700cffe7a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/cut-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/cut-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/cut-16@2x.png
new file mode 100644
index 0000000000..efc2ff2697
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/cut-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/cut-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/cut-16~dark.png
new file mode 100644
index 0000000000..9de0c9af97
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/cut-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/cut-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/cut-16~dark@2x.png
new file mode 100644
index 0000000000..eb90494390
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/cut-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-down-16.png b/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-down-16.png
index 026eedc009..56603885d9 100644
--- a/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-down-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-down-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-down-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-down-16@2x.png
index df564c74ec..9bb18c73b8 100644
--- a/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-down-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-down-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-down-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-down-16~dark.png
new file mode 100644
index 0000000000..93bb055849
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-down-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-down-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-down-16~dark@2x.png
new file mode 100644
index 0000000000..248789e1e7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-down-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-up-16.png b/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-up-16.png
index 78bdd4b505..20a473afd7 100644
--- a/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-up-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-up-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-up-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-up-16@2x.png
index 84b5ecef99..20ae917ef9 100644
--- a/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-up-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-up-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-up-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-up-16~dark.png
new file mode 100644
index 0000000000..74f486e827
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-up-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-up-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-up-16~dark@2x.png
new file mode 100644
index 0000000000..3c0ea8f3ca
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/disclose-arrow-up-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-16.png b/main/src/core/MonoDevelop.Ide/icons/done-16.png
index e4bd153719..75263fa64a 100644
--- a/main/src/core/MonoDevelop.Ide/icons/done-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/done-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/done-16@2x.png
index 4edce4c8c1..a31681ab21 100644
--- a/main/src/core/MonoDevelop.Ide/icons/done-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/done-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/done-16~dark.png
new file mode 100644
index 0000000000..823307335a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/done-16~dark@2x.png
new file mode 100644
index 0000000000..7d086e66b2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/done-16~dark~sel.png
new file mode 100644
index 0000000000..d0cb814f71
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/done-16~dark~sel@2x.png
new file mode 100644
index 0000000000..2d843fdc49
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/done-16~sel.png
new file mode 100644
index 0000000000..d0cb814f71
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/done-16~sel@2x.png
new file mode 100644
index 0000000000..2d843fdc49
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-24.png b/main/src/core/MonoDevelop.Ide/icons/done-24.png
index 16f94a421c..9e3266d397 100644
--- a/main/src/core/MonoDevelop.Ide/icons/done-24.png
+++ b/main/src/core/MonoDevelop.Ide/icons/done-24.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-24@2x.png b/main/src/core/MonoDevelop.Ide/icons/done-24@2x.png
index 1a2f0f3181..8eba95a93e 100644
--- a/main/src/core/MonoDevelop.Ide/icons/done-24@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/done-24@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-24~dark.png b/main/src/core/MonoDevelop.Ide/icons/done-24~dark.png
new file mode 100644
index 0000000000..ab219b439e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-24~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-24~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/done-24~dark@2x.png
new file mode 100644
index 0000000000..1e59fbe9a7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-24~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-24~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/done-24~dark~sel.png
new file mode 100644
index 0000000000..435b61d126
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-24~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-24~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/done-24~dark~sel@2x.png
new file mode 100644
index 0000000000..bbf994981f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-24~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-24~sel.png b/main/src/core/MonoDevelop.Ide/icons/done-24~sel.png
new file mode 100644
index 0000000000..435b61d126
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-24~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-24~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/done-24~sel@2x.png
new file mode 100644
index 0000000000..bbf994981f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-24~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-32.png b/main/src/core/MonoDevelop.Ide/icons/done-32.png
index 4edce4c8c1..a31681ab21 100644
--- a/main/src/core/MonoDevelop.Ide/icons/done-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/done-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/done-32@2x.png
index c0e084b2c6..12b4821cde 100644
--- a/main/src/core/MonoDevelop.Ide/icons/done-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/done-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/done-32~dark.png
new file mode 100644
index 0000000000..7d086e66b2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/done-32~dark@2x.png
new file mode 100644
index 0000000000..5732873d1c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/done-32~dark~sel.png
new file mode 100644
index 0000000000..2d843fdc49
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/done-32~dark~sel@2x.png
new file mode 100644
index 0000000000..7e9e40c59d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/done-32~sel.png
new file mode 100644
index 0000000000..2d843fdc49
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/done-32~sel@2x.png
new file mode 100644
index 0000000000..7e9e40c59d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-48.png b/main/src/core/MonoDevelop.Ide/icons/done-48.png
index 1a2f0f3181..8eba95a93e 100644
--- a/main/src/core/MonoDevelop.Ide/icons/done-48.png
+++ b/main/src/core/MonoDevelop.Ide/icons/done-48.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-48@2x.png b/main/src/core/MonoDevelop.Ide/icons/done-48@2x.png
index a7089ce1b5..73f2ccff49 100644
--- a/main/src/core/MonoDevelop.Ide/icons/done-48@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/done-48@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-48~dark.png b/main/src/core/MonoDevelop.Ide/icons/done-48~dark.png
new file mode 100644
index 0000000000..1e59fbe9a7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-48~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-48~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/done-48~dark@2x.png
new file mode 100644
index 0000000000..81809b9f68
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-48~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-48~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/done-48~dark~sel.png
new file mode 100644
index 0000000000..bbf994981f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-48~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-48~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/done-48~dark~sel@2x.png
new file mode 100644
index 0000000000..1edb5ad0f0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-48~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-48~sel.png b/main/src/core/MonoDevelop.Ide/icons/done-48~sel.png
new file mode 100644
index 0000000000..bbf994981f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-48~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/done-48~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/done-48~sel@2x.png
new file mode 100644
index 0000000000..1edb5ad0f0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/done-48~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/edit-16.png b/main/src/core/MonoDevelop.Ide/icons/edit-16.png
index 2854ace426..83485e5988 100644
--- a/main/src/core/MonoDevelop.Ide/icons/edit-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/edit-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/edit-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/edit-16@2x.png
index 0e181c6ec5..95ba0548b1 100644
--- a/main/src/core/MonoDevelop.Ide/icons/edit-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/edit-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/edit-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/edit-16~dark.png
new file mode 100644
index 0000000000..e76036fa7f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/edit-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/edit-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/edit-16~dark@2x.png
new file mode 100644
index 0000000000..56aba3102b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/edit-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/edit-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/edit-16~dark~disabled.png
new file mode 100644
index 0000000000..eb3c27f0c7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/edit-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/edit-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/edit-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..f92a645531
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/edit-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/edit-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/edit-16~disabled.png
new file mode 100644
index 0000000000..64067d9961
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/edit-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/edit-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/edit-16~disabled@2x.png
new file mode 100644
index 0000000000..3f453bdd1a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/edit-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/edit-find-next-16.png b/main/src/core/MonoDevelop.Ide/icons/edit-find-next-16.png
deleted file mode 100644
index 627294400c..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/edit-find-next-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/edit-select-all-16.png b/main/src/core/MonoDevelop.Ide/icons/edit-select-all-16.png
deleted file mode 100644
index f4b0b19e09..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/edit-select-all-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-class-16.png b/main/src/core/MonoDevelop.Ide/icons/element-class-16.png
index ebba4ec2a0..b052db787b 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-class-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-class-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-class-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-class-16@2x.png
index 945d003d47..eaef15c0d3 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-class-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-class-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-class-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-class-16~dark.png
new file mode 100644
index 0000000000..85b904fba7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-class-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-class-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-class-16~dark@2x.png
new file mode 100644
index 0000000000..147b435ed3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-class-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-class-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-class-16~dark~sel.png
new file mode 100644
index 0000000000..905f7e31c9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-class-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-class-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-class-16~dark~sel@2x.png
new file mode 100644
index 0000000000..302cf6177e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-class-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-class-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-class-16~sel.png
new file mode 100644
index 0000000000..905f7e31c9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-class-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-class-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-class-16~sel@2x.png
new file mode 100644
index 0000000000..302cf6177e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-class-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-constant-16.png b/main/src/core/MonoDevelop.Ide/icons/element-constant-16.png
index 0f8e4b33fa..7dc3946986 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-constant-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-constant-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-constant-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-constant-16@2x.png
index 70e5f4f7b9..08d9af7557 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-constant-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-constant-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark.png
new file mode 100644
index 0000000000..294208b496
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark@2x.png
new file mode 100644
index 0000000000..23363677e3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark~sel.png
new file mode 100644
index 0000000000..c9b3888935
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark~sel@2x.png
new file mode 100644
index 0000000000..addbfe2b91
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-constant-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-constant-16~sel.png
new file mode 100644
index 0000000000..c9b3888935
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-constant-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-constant-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-constant-16~sel@2x.png
new file mode 100644
index 0000000000..addbfe2b91
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-constant-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-delegate-16.png b/main/src/core/MonoDevelop.Ide/icons/element-delegate-16.png
index cd0d67e8c9..fe1a992849 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-delegate-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-delegate-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-delegate-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-delegate-16@2x.png
index d2aeb13c36..5b8b3383ad 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-delegate-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-delegate-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-delegate-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-delegate-16~dark.png
new file mode 100644
index 0000000000..6e019b41c2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-delegate-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-delegate-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-delegate-16~dark@2x.png
new file mode 100644
index 0000000000..64ef8688f5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-delegate-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-delegate-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-delegate-16~dark~sel.png
new file mode 100644
index 0000000000..0ae362fe8e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-delegate-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-delegate-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-delegate-16~dark~sel@2x.png
new file mode 100644
index 0000000000..c09e843b72
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-delegate-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-delegate-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-delegate-16~sel.png
new file mode 100644
index 0000000000..0ae362fe8e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-delegate-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-delegate-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-delegate-16~sel@2x.png
new file mode 100644
index 0000000000..c09e843b72
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-delegate-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-enum-16.png b/main/src/core/MonoDevelop.Ide/icons/element-enum-16.png
new file mode 100644
index 0000000000..dc896b56b9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-enum-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-enum-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-enum-16@2x.png
new file mode 100644
index 0000000000..7ec66140dd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-enum-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-enum-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-enum-16~dark.png
new file mode 100644
index 0000000000..32ce34f3ce
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-enum-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-enum-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-enum-16~dark@2x.png
new file mode 100644
index 0000000000..173c25524a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-enum-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-enum-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-enum-16~dark~sel.png
new file mode 100644
index 0000000000..372b7e9d2e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-enum-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-enum-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-enum-16~dark~sel@2x.png
new file mode 100644
index 0000000000..f64d2a0af8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-enum-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-enum-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-enum-16~sel.png
new file mode 100644
index 0000000000..372b7e9d2e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-enum-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-enum-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-enum-16~sel@2x.png
new file mode 100644
index 0000000000..f64d2a0af8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-enum-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-enumeration-16.png b/main/src/core/MonoDevelop.Ide/icons/element-enumeration-16.png
deleted file mode 100644
index 1dacd4dfd8..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/element-enumeration-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-enumeration-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-enumeration-16@2x.png
deleted file mode 100644
index fef81daa07..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/element-enumeration-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-event-16.png b/main/src/core/MonoDevelop.Ide/icons/element-event-16.png
index d159a61587..1d1e1dac6b 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-event-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-event-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-event-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-event-16@2x.png
index c5636f6253..a40a378792 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-event-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-event-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-event-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-event-16~dark.png
new file mode 100644
index 0000000000..84cd47db79
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-event-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-event-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-event-16~dark@2x.png
new file mode 100644
index 0000000000..881e570336
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-event-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-event-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-event-16~dark~sel.png
new file mode 100644
index 0000000000..1b2150077b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-event-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-event-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-event-16~dark~sel@2x.png
new file mode 100644
index 0000000000..1b791c82a8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-event-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-event-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-event-16~sel.png
new file mode 100644
index 0000000000..1b2150077b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-event-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-event-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-event-16~sel@2x.png
new file mode 100644
index 0000000000..1b791c82a8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-event-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-exception-16.png b/main/src/core/MonoDevelop.Ide/icons/element-exception-16.png
index d25657e2af..c74bf41bf0 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-exception-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-exception-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-exception-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-exception-16@2x.png
index e926c3c9ab..cb9e722864 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-exception-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-exception-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-exception-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-exception-16~dark.png
new file mode 100644
index 0000000000..1a5ef6cbd1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-exception-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-exception-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-exception-16~dark@2x.png
new file mode 100644
index 0000000000..1584af2a41
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-exception-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-exception-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-exception-16~dark~sel.png
new file mode 100644
index 0000000000..0bf6b65547
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-exception-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-exception-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-exception-16~dark~sel@2x.png
new file mode 100644
index 0000000000..18a33c6fe9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-exception-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-exception-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-exception-16~sel.png
new file mode 100644
index 0000000000..0bf6b65547
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-exception-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-exception-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-exception-16~sel@2x.png
new file mode 100644
index 0000000000..18a33c6fe9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-exception-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16.png b/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16.png
index d1a6fa4546..aa3fc8cee5 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16@2x.png
index 7f7380185a..8c5418f6d3 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~dark.png
new file mode 100644
index 0000000000..c9b1ff954e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~dark@2x.png
new file mode 100644
index 0000000000..9305fff932
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~dark~sel.png
new file mode 100644
index 0000000000..0db275600b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~dark~sel@2x.png
new file mode 100644
index 0000000000..b0d5217c04
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~sel.png
new file mode 100644
index 0000000000..0db275600b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~sel@2x.png
new file mode 100644
index 0000000000..b0d5217c04
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-extensionmethod-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-field-16.png b/main/src/core/MonoDevelop.Ide/icons/element-field-16.png
index 78c9a95aa3..fa9b9624b9 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-field-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-field-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-field-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-field-16@2x.png
index 06a683ed2b..9101dc1136 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-field-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-field-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-field-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-field-16~dark.png
new file mode 100644
index 0000000000..b00faa8ccc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-field-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-field-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-field-16~dark@2x.png
new file mode 100644
index 0000000000..872030f6d3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-field-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-field-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-field-16~dark~sel.png
new file mode 100644
index 0000000000..427d88987f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-field-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-field-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-field-16~dark~sel@2x.png
new file mode 100644
index 0000000000..b6d66f5d4e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-field-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-field-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-field-16~sel.png
new file mode 100644
index 0000000000..427d88987f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-field-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-field-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-field-16~sel@2x.png
new file mode 100644
index 0000000000..b6d66f5d4e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-field-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16.png b/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16.png
index fdfd653023..f264ce2f1b 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16@2x.png
index 2e1b4c5ec9..468cb5ff47 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~dark.png
new file mode 100644
index 0000000000..32816de589
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~dark@2x.png
new file mode 100644
index 0000000000..7fecc3c826
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~dark~sel.png
new file mode 100644
index 0000000000..4c74c21e16
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~dark~sel@2x.png
new file mode 100644
index 0000000000..cfd82cf076
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~sel.png
new file mode 100644
index 0000000000..4c74c21e16
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~sel@2x.png
new file mode 100644
index 0000000000..cfd82cf076
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-fs-field-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-interface-16.png b/main/src/core/MonoDevelop.Ide/icons/element-interface-16.png
index 17c1185960..1adf7b08b6 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-interface-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-interface-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-interface-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-interface-16@2x.png
index 824a4e049f..439d806a65 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-interface-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-interface-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-interface-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-interface-16~dark.png
new file mode 100644
index 0000000000..612099859d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-interface-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-interface-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-interface-16~dark@2x.png
new file mode 100644
index 0000000000..5160066e3d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-interface-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-interface-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-interface-16~dark~sel.png
new file mode 100644
index 0000000000..83726abb16
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-interface-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-interface-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-interface-16~dark~sel@2x.png
new file mode 100644
index 0000000000..4e69aff776
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-interface-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-interface-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-interface-16~sel.png
new file mode 100644
index 0000000000..83726abb16
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-interface-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-interface-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-interface-16~sel@2x.png
new file mode 100644
index 0000000000..4e69aff776
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-interface-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-keyword-16.png b/main/src/core/MonoDevelop.Ide/icons/element-keyword-16.png
index 19a3545ca7..21aac83368 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-keyword-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-keyword-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-keyword-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-keyword-16@2x.png
index 9392908b50..a426ce536d 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-keyword-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-keyword-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-keyword-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-keyword-16~dark.png
new file mode 100644
index 0000000000..e45a3549e8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-keyword-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-keyword-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-keyword-16~dark@2x.png
new file mode 100644
index 0000000000..055e9adea5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-keyword-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-keyword-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-keyword-16~dark~sel.png
new file mode 100644
index 0000000000..8ea5be7b64
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-keyword-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-keyword-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-keyword-16~dark~sel@2x.png
new file mode 100644
index 0000000000..d71bfe1f0a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-keyword-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-keyword-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-keyword-16~sel.png
new file mode 100644
index 0000000000..8ea5be7b64
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-keyword-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-keyword-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-keyword-16~sel@2x.png
new file mode 100644
index 0000000000..d71bfe1f0a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-keyword-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-method-16.png b/main/src/core/MonoDevelop.Ide/icons/element-method-16.png
index c7981aee39..3b74b453b1 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-method-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-method-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-method-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-method-16@2x.png
index 0e81da2702..40aa43068d 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-method-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-method-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-method-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-method-16~dark.png
new file mode 100644
index 0000000000..461cbcdabd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-method-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-method-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-method-16~dark@2x.png
new file mode 100644
index 0000000000..c38242f9c7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-method-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-method-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-method-16~dark~sel.png
new file mode 100644
index 0000000000..633d2e6cfe
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-method-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-method-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-method-16~dark~sel@2x.png
new file mode 100644
index 0000000000..fd7e48ff80
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-method-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-method-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-method-16~sel.png
new file mode 100644
index 0000000000..633d2e6cfe
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-method-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-method-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-method-16~sel@2x.png
new file mode 100644
index 0000000000..fd7e48ff80
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-method-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-method-new-16.png b/main/src/core/MonoDevelop.Ide/icons/element-method-new-16.png
index 440b505bb8..7a927aeadd 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-method-new-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-method-new-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-method-new-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-method-new-16@2x.png
index d6011bb744..2d2169f0e8 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-method-new-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-method-new-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-method-new-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-method-new-16~dark.png
new file mode 100644
index 0000000000..9c887698b0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-method-new-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-method-new-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-method-new-16~dark@2x.png
new file mode 100644
index 0000000000..d995d046b4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-method-new-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-method-new-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-method-new-16~dark~sel.png
new file mode 100644
index 0000000000..e1e53bc800
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-method-new-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-method-new-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-method-new-16~dark~sel@2x.png
new file mode 100644
index 0000000000..93bd8f72f4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-method-new-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-method-new-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-method-new-16~sel.png
new file mode 100644
index 0000000000..e1e53bc800
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-method-new-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-method-new-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-method-new-16~sel@2x.png
new file mode 100644
index 0000000000..93bd8f72f4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-method-new-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-module-16.png b/main/src/core/MonoDevelop.Ide/icons/element-module-16.png
index 8c866474da..82b8073839 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-module-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-module-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-module-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-module-16@2x.png
index bd2192282e..35afbc2fc6 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-module-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-module-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-module-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-module-16~dark.png
new file mode 100644
index 0000000000..3fc4094379
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-module-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-module-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-module-16~dark@2x.png
new file mode 100644
index 0000000000..6109352ab7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-module-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-module-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-module-16~dark~sel.png
new file mode 100644
index 0000000000..7266232629
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-module-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-module-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-module-16~dark~sel@2x.png
new file mode 100644
index 0000000000..91c73d5786
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-module-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-module-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-module-16~sel.png
new file mode 100644
index 0000000000..7266232629
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-module-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-module-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-module-16~sel@2x.png
new file mode 100644
index 0000000000..91c73d5786
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-module-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-namespace-16.png b/main/src/core/MonoDevelop.Ide/icons/element-namespace-16.png
index 0b3f4a6be3..4b52c9f8db 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-namespace-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-namespace-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-namespace-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-namespace-16@2x.png
index 5783596758..671d3af669 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-namespace-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-namespace-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-namespace-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-namespace-16~dark.png
new file mode 100644
index 0000000000..a9740ed4d4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-namespace-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-namespace-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-namespace-16~dark@2x.png
new file mode 100644
index 0000000000..cffaa89c60
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-namespace-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-namespace-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-namespace-16~dark~sel.png
new file mode 100644
index 0000000000..8880206f60
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-namespace-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-namespace-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-namespace-16~dark~sel@2x.png
new file mode 100644
index 0000000000..985ef91fcc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-namespace-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-namespace-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-namespace-16~sel.png
new file mode 100644
index 0000000000..8880206f60
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-namespace-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-namespace-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-namespace-16~sel@2x.png
new file mode 100644
index 0000000000..985ef91fcc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-namespace-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16.png b/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16.png
index bb9955fb86..86d4ceb376 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16@2x.png
index e94d4d8b38..ac3055be32 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~dark.png
new file mode 100644
index 0000000000..eec94f65b4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~dark@2x.png
new file mode 100644
index 0000000000..879a9c829b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~dark~sel.png
new file mode 100644
index 0000000000..8449b2d0bb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~dark~sel@2x.png
new file mode 100644
index 0000000000..35c4b41f8e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~sel.png
new file mode 100644
index 0000000000..8449b2d0bb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~sel@2x.png
new file mode 100644
index 0000000000..35c4b41f8e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-other-declaration-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-property-16.png b/main/src/core/MonoDevelop.Ide/icons/element-property-16.png
index ce40ece193..9d4af253df 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-property-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-property-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-property-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-property-16@2x.png
index e251eb378f..061dce0bf8 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-property-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-property-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-property-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-property-16~dark.png
new file mode 100644
index 0000000000..b0b343bc6f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-property-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-property-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-property-16~dark@2x.png
new file mode 100644
index 0000000000..fa561785dc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-property-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-property-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-property-16~dark~sel.png
new file mode 100644
index 0000000000..ca1d80d28d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-property-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-property-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-property-16~dark~sel@2x.png
new file mode 100644
index 0000000000..1472f49647
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-property-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-property-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-property-16~sel.png
new file mode 100644
index 0000000000..ca1d80d28d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-property-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-property-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-property-16~sel@2x.png
new file mode 100644
index 0000000000..1472f49647
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-property-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16.png b/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16.png
new file mode 100644
index 0000000000..4d90bab2c8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16@2x.png
new file mode 100644
index 0000000000..b5b57d90fd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~dark.png
new file mode 100644
index 0000000000..87395a6004
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~dark@2x.png
new file mode 100644
index 0000000000..81171267d9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~dark~sel.png
new file mode 100644
index 0000000000..26ef9cc48f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~dark~sel@2x.png
new file mode 100644
index 0000000000..f72062a63f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~sel.png
new file mode 100644
index 0000000000..26ef9cc48f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~sel@2x.png
new file mode 100644
index 0000000000..f72062a63f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-static-overlay-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-struct-16.png b/main/src/core/MonoDevelop.Ide/icons/element-struct-16.png
new file mode 100644
index 0000000000..62ee87ece6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-struct-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-struct-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-struct-16@2x.png
new file mode 100644
index 0000000000..6d11c90cda
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-struct-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-struct-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-struct-16~dark.png
new file mode 100644
index 0000000000..9b2bf0c3d9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-struct-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-struct-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-struct-16~dark@2x.png
new file mode 100644
index 0000000000..f3ef21f350
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-struct-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-struct-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-struct-16~dark~sel.png
new file mode 100644
index 0000000000..55a51ea1c6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-struct-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-struct-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-struct-16~dark~sel@2x.png
new file mode 100644
index 0000000000..cb0a56615d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-struct-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-struct-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-struct-16~sel.png
new file mode 100644
index 0000000000..55a51ea1c6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-struct-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-struct-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-struct-16~sel@2x.png
new file mode 100644
index 0000000000..cb0a56615d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-struct-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-structure-16.png b/main/src/core/MonoDevelop.Ide/icons/element-structure-16.png
deleted file mode 100644
index 862257e473..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/element-structure-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-structure-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-structure-16@2x.png
deleted file mode 100644
index 6408dd5184..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/element-structure-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-template-16.png b/main/src/core/MonoDevelop.Ide/icons/element-template-16.png
index ba48bc0df4..bd96a3e05e 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-template-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-template-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-template-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-template-16@2x.png
index 052e26edf7..acd0b126c7 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-template-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-template-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-template-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-template-16~dark.png
new file mode 100644
index 0000000000..4c13fe0c0f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-template-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-template-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-template-16~dark@2x.png
new file mode 100644
index 0000000000..c463c30d34
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-template-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-template-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-template-16~dark~sel.png
new file mode 100644
index 0000000000..1422fb77c4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-template-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-template-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-template-16~dark~sel@2x.png
new file mode 100644
index 0000000000..4a697deccd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-template-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-template-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-template-16~sel.png
new file mode 100644
index 0000000000..1422fb77c4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-template-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-template-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-template-16~sel@2x.png
new file mode 100644
index 0000000000..4a697deccd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-template-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16.png b/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16.png
index 954be6e7af..ee19e422e1 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16@2x.png
index a0285c83f0..d89a974980 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~dark.png
new file mode 100644
index 0000000000..c56fd403c9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~dark@2x.png
new file mode 100644
index 0000000000..f905cb98d6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~dark~sel.png
new file mode 100644
index 0000000000..e1bd6d9bfa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~dark~sel@2x.png
new file mode 100644
index 0000000000..c343a58bdb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~sel.png
new file mode 100644
index 0000000000..e1bd6d9bfa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~sel@2x.png
new file mode 100644
index 0000000000..c343a58bdb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-template-surroundwith-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-type-16.png b/main/src/core/MonoDevelop.Ide/icons/element-type-16.png
index 53a2f5f33f..cdaf922d62 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-type-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-type-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-type-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-type-16@2x.png
index 11fcb74fd6..b1df3237b1 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-type-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-type-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-type-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-type-16~dark.png
new file mode 100644
index 0000000000..f310bc9da7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-type-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-type-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-type-16~dark@2x.png
new file mode 100644
index 0000000000..39efcfb5cc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-type-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-type-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-type-16~dark~sel.png
new file mode 100644
index 0000000000..ecae04d003
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-type-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-type-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-type-16~dark~sel@2x.png
new file mode 100644
index 0000000000..25ae1097c6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-type-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-type-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-type-16~sel.png
new file mode 100644
index 0000000000..ecae04d003
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-type-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-type-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-type-16~sel@2x.png
new file mode 100644
index 0000000000..25ae1097c6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-type-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-variable-16.png b/main/src/core/MonoDevelop.Ide/icons/element-variable-16.png
index 0aa76d6f18..cfd4a6c91b 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-variable-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-variable-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-variable-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-variable-16@2x.png
index dc9ab381c7..88540c51bb 100644
--- a/main/src/core/MonoDevelop.Ide/icons/element-variable-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/element-variable-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-variable-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-variable-16~dark.png
new file mode 100644
index 0000000000..9b011d8adc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-variable-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-variable-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-variable-16~dark@2x.png
new file mode 100644
index 0000000000..a1de1b954c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-variable-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-variable-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-variable-16~dark~sel.png
new file mode 100644
index 0000000000..8dc030b61f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-variable-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-variable-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-variable-16~dark~sel@2x.png
new file mode 100644
index 0000000000..08b3559269
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-variable-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-variable-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-variable-16~sel.png
new file mode 100644
index 0000000000..8dc030b61f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-variable-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-variable-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-variable-16~sel@2x.png
new file mode 100644
index 0000000000..08b3559269
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-variable-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-an-protected-overlay-16.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-an-protected-overlay-16.png
deleted file mode 100644
index 3ad97c17a9..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-an-protected-overlay-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-an-protected-overlay-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-an-protected-overlay-16@2x.png
deleted file mode 100644
index 17d9d009fb..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-an-protected-overlay-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16.png
new file mode 100644
index 0000000000..053c28d3a8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16@2x.png
new file mode 100644
index 0000000000..3f7337b05e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~dark.png
new file mode 100644
index 0000000000..c5e0f5d563
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~dark@2x.png
new file mode 100644
index 0000000000..b61592d085
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~dark~sel.png
new file mode 100644
index 0000000000..b81e27ef4a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~dark~sel@2x.png
new file mode 100644
index 0000000000..200c617a69
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~sel.png
new file mode 100644
index 0000000000..b81e27ef4a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~sel@2x.png
new file mode 100644
index 0000000000..200c617a69
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-diamond-overlay-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-or-protected-overlay-16.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-or-protected-overlay-16.png
deleted file mode 100644
index 1f2c6b4170..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-or-protected-overlay-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-or-protected-overlay-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-or-protected-overlay-16@2x.png
deleted file mode 100644
index d0f92e76d1..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-or-protected-overlay-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-overlay-16.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-overlay-16.png
deleted file mode 100644
index d2f0467a91..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-overlay-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-overlay-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-overlay-16@2x.png
deleted file mode 100644
index 52fdb73176..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-overlay-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16.png
new file mode 100644
index 0000000000..ae605bf04a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16@2x.png
new file mode 100644
index 0000000000..6708f9e3a8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~dark.png
new file mode 100644
index 0000000000..162ef27f0a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~dark@2x.png
new file mode 100644
index 0000000000..78a2470a05
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~dark~sel.png
new file mode 100644
index 0000000000..e05c767a44
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~dark~sel@2x.png
new file mode 100644
index 0000000000..11870ff7f8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~sel.png
new file mode 100644
index 0000000000..e05c767a44
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~sel@2x.png
new file mode 100644
index 0000000000..2ec4bace10
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-internal-square-overlay-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16.png
new file mode 100644
index 0000000000..4b18e5f4ff
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16@2x.png
new file mode 100644
index 0000000000..8bc281f420
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~dark.png
new file mode 100644
index 0000000000..785de23b87
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~dark@2x.png
new file mode 100644
index 0000000000..9ca123f7d9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~dark~sel.png
new file mode 100644
index 0000000000..2a3e88690b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~dark~sel@2x.png
new file mode 100644
index 0000000000..3488655ef9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~sel.png
new file mode 100644
index 0000000000..2a3e88690b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~sel@2x.png
new file mode 100644
index 0000000000..3488655ef9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-diamond-overlay-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-overlay-16.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-overlay-16.png
deleted file mode 100644
index ea6ce98978..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-overlay-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-overlay-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-overlay-16@2x.png
deleted file mode 100644
index 902b33f24d..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-overlay-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16.png
new file mode 100644
index 0000000000..ad5a319fc2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16@2x.png
new file mode 100644
index 0000000000..7f3b4d04e0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~dark.png
new file mode 100644
index 0000000000..57b49a4afa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~dark@2x.png
new file mode 100644
index 0000000000..7730f1b270
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~dark~sel.png
new file mode 100644
index 0000000000..8871b3e621
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~dark~sel@2x.png
new file mode 100644
index 0000000000..99141fc5d4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~sel.png
new file mode 100644
index 0000000000..8871b3e621
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~sel@2x.png
new file mode 100644
index 0000000000..99141fc5d4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-private-square-overlay-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16.png
new file mode 100644
index 0000000000..3e5ccf693e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16@2x.png
new file mode 100644
index 0000000000..899cc6d06c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~dark.png
new file mode 100644
index 0000000000..6d6f765678
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~dark@2x.png
new file mode 100644
index 0000000000..b914ba05a3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~dark~sel.png
new file mode 100644
index 0000000000..2a3e88690b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~dark~sel@2x.png
new file mode 100644
index 0000000000..3488655ef9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~sel.png
new file mode 100644
index 0000000000..2a3e88690b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~sel@2x.png
new file mode 100644
index 0000000000..3488655ef9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-diamond-overlay-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-overlay-16.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-overlay-16.png
deleted file mode 100644
index 99f63db331..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-overlay-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-overlay-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-overlay-16@2x.png
deleted file mode 100644
index 6fd869ba1e..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-overlay-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16.png
new file mode 100644
index 0000000000..7c4c58c0fe
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16@2x.png
new file mode 100644
index 0000000000..6c57f688da
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~dark.png
new file mode 100644
index 0000000000..dba7d673aa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~dark@2x.png
new file mode 100644
index 0000000000..2bd88acfd4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~dark~sel.png
new file mode 100644
index 0000000000..8871b3e621
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~dark~sel@2x.png
new file mode 100644
index 0000000000..99141fc5d4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~sel.png
new file mode 100644
index 0000000000..8871b3e621
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~sel@2x.png
new file mode 100644
index 0000000000..99141fc5d4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/element-visibility-protected-square-overlay-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-static-overlay-16.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-static-overlay-16.png
deleted file mode 100644
index c0daec3326..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/element-visibility-static-overlay-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/element-visibility-static-overlay-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-visibility-static-overlay-16@2x.png
deleted file mode 100644
index f611e2f7c3..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/element-visibility-static-overlay-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-16.png b/main/src/core/MonoDevelop.Ide/icons/error-16.png
index 30b5da6e9b..4a7c34afc7 100644
--- a/main/src/core/MonoDevelop.Ide/icons/error-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/error-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/error-16@2x.png
index adfd2b7b19..3f0b3fbb10 100644
--- a/main/src/core/MonoDevelop.Ide/icons/error-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/error-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/error-16~dark.png
new file mode 100644
index 0000000000..0543df48ad
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/error-16~dark@2x.png
new file mode 100644
index 0000000000..ed1da75fe8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/error-16~dark~sel.png
new file mode 100644
index 0000000000..8cf9c17624
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/error-16~dark~sel@2x.png
new file mode 100644
index 0000000000..1ad7c1da5d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/error-16~sel.png
new file mode 100644
index 0000000000..8cf9c17624
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/error-16~sel@2x.png
new file mode 100644
index 0000000000..1ad7c1da5d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-24.png b/main/src/core/MonoDevelop.Ide/icons/error-24.png
index 637ab79bff..8274a04ef3 100644
--- a/main/src/core/MonoDevelop.Ide/icons/error-24.png
+++ b/main/src/core/MonoDevelop.Ide/icons/error-24.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-24@2x.png b/main/src/core/MonoDevelop.Ide/icons/error-24@2x.png
index bf5a3b9f70..9f21bb4b4e 100644
--- a/main/src/core/MonoDevelop.Ide/icons/error-24@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/error-24@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-24~dark.png b/main/src/core/MonoDevelop.Ide/icons/error-24~dark.png
new file mode 100644
index 0000000000..4ea5f5d7a4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-24~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-24~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/error-24~dark@2x.png
new file mode 100644
index 0000000000..02426d716c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-24~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-24~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/error-24~dark~sel.png
new file mode 100644
index 0000000000..ef6c3a3a73
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-24~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-24~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/error-24~dark~sel@2x.png
new file mode 100644
index 0000000000..ed8a5c205f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-24~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-24~sel.png b/main/src/core/MonoDevelop.Ide/icons/error-24~sel.png
new file mode 100644
index 0000000000..ef6c3a3a73
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-24~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-24~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/error-24~sel@2x.png
new file mode 100644
index 0000000000..ed8a5c205f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-24~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-32.png b/main/src/core/MonoDevelop.Ide/icons/error-32.png
index adfd2b7b19..3f0b3fbb10 100644
--- a/main/src/core/MonoDevelop.Ide/icons/error-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/error-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/error-32@2x.png
index f422cb3969..1fe771aa66 100644
--- a/main/src/core/MonoDevelop.Ide/icons/error-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/error-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/error-32~dark.png
new file mode 100644
index 0000000000..ed1da75fe8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/error-32~dark@2x.png
new file mode 100644
index 0000000000..bf035b1e57
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/error-32~dark~sel.png
new file mode 100644
index 0000000000..1ad7c1da5d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/error-32~dark~sel@2x.png
new file mode 100644
index 0000000000..4acc1cd5f8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/error-32~sel.png
new file mode 100644
index 0000000000..1ad7c1da5d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/error-32~sel@2x.png
new file mode 100644
index 0000000000..4acc1cd5f8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-48.png b/main/src/core/MonoDevelop.Ide/icons/error-48.png
index bf5a3b9f70..9f21bb4b4e 100644
--- a/main/src/core/MonoDevelop.Ide/icons/error-48.png
+++ b/main/src/core/MonoDevelop.Ide/icons/error-48.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-48@2x.png b/main/src/core/MonoDevelop.Ide/icons/error-48@2x.png
index 1e2cd50f70..3f207f796b 100644
--- a/main/src/core/MonoDevelop.Ide/icons/error-48@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/error-48@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-48~dark.png b/main/src/core/MonoDevelop.Ide/icons/error-48~dark.png
new file mode 100644
index 0000000000..02426d716c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-48~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-48~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/error-48~dark@2x.png
new file mode 100644
index 0000000000..0e5a84db97
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-48~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-48~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/error-48~dark~sel.png
new file mode 100644
index 0000000000..ed8a5c205f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-48~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-48~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/error-48~dark~sel@2x.png
new file mode 100644
index 0000000000..b31b739ad1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-48~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-48~sel.png b/main/src/core/MonoDevelop.Ide/icons/error-48~sel.png
new file mode 100644
index 0000000000..ed8a5c205f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-48~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/error-48~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/error-48~sel@2x.png
new file mode 100644
index 0000000000..b31b739ad1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/error-48~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/execute-16.png b/main/src/core/MonoDevelop.Ide/icons/execute-16.png
new file mode 100644
index 0000000000..2c49488228
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/execute-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/execute-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/execute-16@2x.png
new file mode 100644
index 0000000000..b68fd2cf63
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/execute-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/execute-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/execute-16~dark.png
new file mode 100644
index 0000000000..914de00009
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/execute-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/execute-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/execute-16~dark@2x.png
new file mode 100644
index 0000000000..9311c37e55
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/execute-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/execute-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/execute-16~dark~disabled.png
new file mode 100644
index 0000000000..1e3b3d7a58
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/execute-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/execute-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/execute-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..a0004a6e1c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/execute-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/execute-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/execute-16~disabled.png
new file mode 100644
index 0000000000..3c2999f716
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/execute-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/execute-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/execute-16~disabled@2x.png
new file mode 100644
index 0000000000..03a60abf54
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/execute-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/execute-all-16.png b/main/src/core/MonoDevelop.Ide/icons/execute-all-16.png
new file mode 100644
index 0000000000..ad3dc49018
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/execute-all-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/execute-all-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/execute-all-16@2x.png
new file mode 100644
index 0000000000..b3ff32411b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/execute-all-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/execute-all-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/execute-all-16~dark.png
new file mode 100644
index 0000000000..f405523076
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/execute-all-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/execute-all-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/execute-all-16~dark@2x.png
new file mode 100644
index 0000000000..2d71a6411d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/execute-all-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/execute-all-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/execute-all-16~dark~disabled.png
new file mode 100644
index 0000000000..588c82ba2f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/execute-all-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/execute-all-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/execute-all-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..b91582f8fe
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/execute-all-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/execute-all-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/execute-all-16~disabled.png
new file mode 100644
index 0000000000..cc61f3e6f4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/execute-all-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/execute-all-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/execute-all-16~disabled@2x.png
new file mode 100644
index 0000000000..f328582e20
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/execute-all-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/feedback-16.png b/main/src/core/MonoDevelop.Ide/icons/feedback-16.png
index 84e22d720b..7d0758c672 100644
--- a/main/src/core/MonoDevelop.Ide/icons/feedback-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/feedback-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/feedback-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/feedback-16@2x.png
index bec324d649..5c6b1ad7d1 100644
--- a/main/src/core/MonoDevelop.Ide/icons/feedback-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/feedback-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/feedback-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/feedback-16~dark.png
new file mode 100644
index 0000000000..49172b1abc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/feedback-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/feedback-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/feedback-16~dark@2x.png
new file mode 100644
index 0000000000..de38b74cb7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/feedback-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/feedback-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/feedback-16~dark~disabled.png
new file mode 100644
index 0000000000..495b0409f4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/feedback-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/feedback-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/feedback-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..cfff0d303b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/feedback-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/feedback-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/feedback-16~disabled.png
new file mode 100644
index 0000000000..f65e98051a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/feedback-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/feedback-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/feedback-16~disabled@2x.png
new file mode 100644
index 0000000000..05833b79dc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/feedback-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-class-16.png b/main/src/core/MonoDevelop.Ide/icons/file-class-16.png
new file mode 100644
index 0000000000..640f9460b9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-class-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-class-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-class-16@2x.png
new file mode 100644
index 0000000000..49bbf3e74a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-class-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-class-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-class-16~dark.png
new file mode 100644
index 0000000000..02b7feb6e4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-class-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-class-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-class-16~dark@2x.png
new file mode 100644
index 0000000000..b66fa8c0ae
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-class-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-class-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-class-16~dark~sel.png
new file mode 100644
index 0000000000..9eca7de4a8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-class-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-class-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-class-16~dark~sel@2x.png
new file mode 100644
index 0000000000..90896ccf53
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-class-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-class-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-class-16~sel.png
new file mode 100644
index 0000000000..206a6f85db
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-class-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-class-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-class-16~sel@2x.png
new file mode 100644
index 0000000000..33c19c75a8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-class-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-class-32.png b/main/src/core/MonoDevelop.Ide/icons/file-class-32.png
index b34d144310..49bbf3e74a 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-class-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-class-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-class-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-class-32@2x.png
index 2cd3001e89..04937541d9 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-class-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-class-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-class-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-class-32~dark.png
new file mode 100644
index 0000000000..b66fa8c0ae
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-class-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-class-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-class-32~dark@2x.png
new file mode 100644
index 0000000000..bdc1bdf784
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-class-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-class-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-class-32~dark~sel.png
new file mode 100644
index 0000000000..90896ccf53
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-class-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-class-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-class-32~dark~sel@2x.png
new file mode 100644
index 0000000000..6cee96331e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-class-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-class-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-class-32~sel.png
new file mode 100644
index 0000000000..33c19c75a8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-class-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-class-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-class-32~sel@2x.png
new file mode 100644
index 0000000000..fcb696c055
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-class-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-css-16.png b/main/src/core/MonoDevelop.Ide/icons/file-css-16.png
new file mode 100644
index 0000000000..a089edc75e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-css-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-css-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-css-16@2x.png
new file mode 100644
index 0000000000..590e61be0a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-css-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-css-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-css-16~dark.png
new file mode 100644
index 0000000000..85262058c0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-css-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-css-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-css-16~dark@2x.png
new file mode 100644
index 0000000000..55a472f33c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-css-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-css-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-css-16~dark~sel.png
new file mode 100644
index 0000000000..034c254ceb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-css-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-css-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-css-16~dark~sel@2x.png
new file mode 100644
index 0000000000..6165758355
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-css-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-css-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-css-16~sel.png
new file mode 100644
index 0000000000..74dfb7e208
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-css-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-css-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-css-16~sel@2x.png
new file mode 100644
index 0000000000..f7bc1a2a0b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-css-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-css-32.png b/main/src/core/MonoDevelop.Ide/icons/file-css-32.png
new file mode 100644
index 0000000000..590e61be0a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-css-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-css-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-css-32@2x.png
new file mode 100644
index 0000000000..53232fcfd6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-css-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-css-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-css-32~dark.png
new file mode 100644
index 0000000000..55a472f33c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-css-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-css-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-css-32~dark@2x.png
new file mode 100644
index 0000000000..976b45be66
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-css-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-css-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-css-32~dark~sel.png
new file mode 100644
index 0000000000..6165758355
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-css-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-css-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-css-32~dark~sel@2x.png
new file mode 100644
index 0000000000..a03ff3fc98
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-css-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-css-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-css-32~sel.png
new file mode 100644
index 0000000000..f7bc1a2a0b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-css-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-css-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-css-32~sel@2x.png
new file mode 100644
index 0000000000..8c4c349e18
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-css-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-enum-16.png b/main/src/core/MonoDevelop.Ide/icons/file-enum-16.png
new file mode 100644
index 0000000000..6a0b6b195b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-enum-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-enum-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-enum-16@2x.png
new file mode 100644
index 0000000000..63ca67ae80
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-enum-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-enum-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-enum-16~dark.png
new file mode 100644
index 0000000000..d3d35f7eb9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-enum-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-enum-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-enum-16~dark@2x.png
new file mode 100644
index 0000000000..c52295de4b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-enum-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-enum-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-enum-16~dark~sel.png
new file mode 100644
index 0000000000..92c3fba40a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-enum-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-enum-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-enum-16~dark~sel@2x.png
new file mode 100644
index 0000000000..d3a740b615
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-enum-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-enum-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-enum-16~sel.png
new file mode 100644
index 0000000000..4f150ca7f7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-enum-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-enum-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-enum-16~sel@2x.png
new file mode 100644
index 0000000000..72a6247031
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-enum-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-enum-32.png b/main/src/core/MonoDevelop.Ide/icons/file-enum-32.png
new file mode 100644
index 0000000000..63ca67ae80
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-enum-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-enum-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-enum-32@2x.png
new file mode 100644
index 0000000000..205641247d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-enum-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-enum-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-enum-32~dark.png
new file mode 100644
index 0000000000..c52295de4b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-enum-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-enum-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-enum-32~dark@2x.png
new file mode 100644
index 0000000000..a8887cf69d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-enum-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-enum-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-enum-32~dark~sel.png
new file mode 100644
index 0000000000..d3a740b615
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-enum-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-enum-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-enum-32~dark~sel@2x.png
new file mode 100644
index 0000000000..2648642906
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-enum-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-enum-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-enum-32~sel.png
new file mode 100644
index 0000000000..72a6247031
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-enum-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-enum-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-enum-32~sel@2x.png
new file mode 100644
index 0000000000..04ba7e56ea
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-enum-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-enumeration-32.png b/main/src/core/MonoDevelop.Ide/icons/file-enumeration-32.png
deleted file mode 100644
index 166208a005..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/file-enumeration-32.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-enumeration-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-enumeration-32@2x.png
deleted file mode 100644
index 2949d1407d..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/file-enumeration-32@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-generic-16.png b/main/src/core/MonoDevelop.Ide/icons/file-generic-16.png
index a6e67ca604..115eed9273 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-generic-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-generic-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-generic-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-generic-16@2x.png
index 6a70591325..8bc8e0e513 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-generic-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-generic-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-generic-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-generic-16~dark.png
new file mode 100644
index 0000000000..c5661a84d7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-generic-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-generic-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-generic-16~dark@2x.png
new file mode 100644
index 0000000000..8bfe498231
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-generic-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-generic-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-generic-16~dark~sel.png
new file mode 100644
index 0000000000..3cbf0ebd0a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-generic-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-generic-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-generic-16~dark~sel@2x.png
new file mode 100644
index 0000000000..44ec4ec4c9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-generic-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-generic-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-generic-16~sel.png
new file mode 100644
index 0000000000..9d4e060bd8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-generic-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-generic-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-generic-16~sel@2x.png
new file mode 100644
index 0000000000..a4025ebaf4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-generic-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-generic-32.png b/main/src/core/MonoDevelop.Ide/icons/file-generic-32.png
index 6a70591325..8bc8e0e513 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-generic-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-generic-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-generic-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-generic-32@2x.png
index 87bddc3e2a..25b372da0d 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-generic-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-generic-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-generic-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-generic-32~dark.png
new file mode 100644
index 0000000000..8bfe498231
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-generic-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-generic-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-generic-32~dark@2x.png
new file mode 100644
index 0000000000..49b11420c6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-generic-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-generic-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-generic-32~dark~sel.png
new file mode 100644
index 0000000000..44ec4ec4c9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-generic-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-generic-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-generic-32~dark~sel@2x.png
new file mode 100644
index 0000000000..e2aae4532f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-generic-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-generic-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-generic-32~sel.png
new file mode 100644
index 0000000000..a4025ebaf4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-generic-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-generic-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-generic-32~sel@2x.png
new file mode 100644
index 0000000000..34a0cde413
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-generic-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-gtk-16.png b/main/src/core/MonoDevelop.Ide/icons/file-gtk-16.png
new file mode 100644
index 0000000000..14bd7dfaa4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-gtk-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-gtk-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-gtk-16@2x.png
new file mode 100644
index 0000000000..3a7dd1228f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-gtk-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-gtk-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-gtk-16~dark.png
new file mode 100644
index 0000000000..78f8cf9519
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-gtk-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-gtk-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-gtk-16~dark@2x.png
new file mode 100644
index 0000000000..d9cc1b4dbe
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-gtk-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-gtk-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-gtk-16~dark~sel.png
new file mode 100644
index 0000000000..ed170bae88
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-gtk-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-gtk-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-gtk-16~dark~sel@2x.png
new file mode 100644
index 0000000000..80baa05ff3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-gtk-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-gtk-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-gtk-16~sel.png
new file mode 100644
index 0000000000..2e0bb84e38
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-gtk-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-gtk-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-gtk-16~sel@2x.png
new file mode 100644
index 0000000000..ef27dc2aba
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-gtk-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-gtk-32.png b/main/src/core/MonoDevelop.Ide/icons/file-gtk-32.png
index 632b146f16..3a7dd1228f 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-gtk-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-gtk-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-gtk-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-gtk-32@2x.png
index d70e405738..71c39eb981 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-gtk-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-gtk-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-gtk-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-gtk-32~dark.png
new file mode 100644
index 0000000000..d9cc1b4dbe
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-gtk-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-gtk-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-gtk-32~dark@2x.png
new file mode 100644
index 0000000000..f4379154fa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-gtk-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-gtk-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-gtk-32~dark~sel.png
new file mode 100644
index 0000000000..80baa05ff3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-gtk-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-gtk-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-gtk-32~dark~sel@2x.png
new file mode 100644
index 0000000000..764af8e96f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-gtk-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-gtk-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-gtk-32~sel.png
new file mode 100644
index 0000000000..ef27dc2aba
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-gtk-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-gtk-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-gtk-32~sel@2x.png
new file mode 100644
index 0000000000..2b19de6ff5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-gtk-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-header-16.png b/main/src/core/MonoDevelop.Ide/icons/file-header-16.png
index 2b2d4e5cd9..aa7562d1ba 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-header-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-header-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-header-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-header-16@2x.png
index 709d650e11..1afd1ba94a 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-header-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-header-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-header-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-header-16~dark.png
new file mode 100644
index 0000000000..9cf0c88d0a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-header-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-header-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-header-16~dark@2x.png
new file mode 100644
index 0000000000..74c67076c0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-header-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-header-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-header-16~dark~sel.png
new file mode 100644
index 0000000000..29b6efd15b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-header-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-header-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-header-16~dark~sel@2x.png
new file mode 100644
index 0000000000..67ef89459e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-header-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-header-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-header-16~sel.png
new file mode 100644
index 0000000000..0e8403eba9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-header-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-header-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-header-16~sel@2x.png
new file mode 100644
index 0000000000..a60878e42a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-header-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-header-32.png b/main/src/core/MonoDevelop.Ide/icons/file-header-32.png
index 709d650e11..1afd1ba94a 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-header-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-header-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-header-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-header-32@2x.png
index a4eba324a8..9fd2025456 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-header-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-header-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-header-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-header-32~dark.png
new file mode 100644
index 0000000000..74c67076c0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-header-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-header-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-header-32~dark@2x.png
new file mode 100644
index 0000000000..46c3dc9790
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-header-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-header-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-header-32~dark~sel.png
new file mode 100644
index 0000000000..67ef89459e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-header-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-header-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-header-32~dark~sel@2x.png
new file mode 100644
index 0000000000..f09a4cd5bd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-header-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-header-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-header-32~sel.png
new file mode 100644
index 0000000000..a60878e42a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-header-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-header-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-header-32~sel@2x.png
new file mode 100644
index 0000000000..77bb2d64e4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-header-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-image-16.png b/main/src/core/MonoDevelop.Ide/icons/file-image-16.png
new file mode 100644
index 0000000000..28a761feb3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-image-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-image-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-image-16@2x.png
new file mode 100644
index 0000000000..409f76eead
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-image-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-image-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-image-16~dark.png
new file mode 100644
index 0000000000..c5518c3783
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-image-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-image-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-image-16~dark@2x.png
new file mode 100644
index 0000000000..ffebde0bf1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-image-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-image-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-image-16~dark~sel.png
new file mode 100644
index 0000000000..37ac713c70
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-image-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-image-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-image-16~dark~sel@2x.png
new file mode 100644
index 0000000000..1ad4758570
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-image-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-image-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-image-16~sel.png
new file mode 100644
index 0000000000..38a4ef2cf4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-image-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-image-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-image-16~sel@2x.png
new file mode 100644
index 0000000000..8cf0911abf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-image-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-image-32.png b/main/src/core/MonoDevelop.Ide/icons/file-image-32.png
new file mode 100644
index 0000000000..409f76eead
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-image-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-image-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-image-32@2x.png
new file mode 100644
index 0000000000..1e92d54431
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-image-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-image-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-image-32~dark.png
new file mode 100644
index 0000000000..ffebde0bf1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-image-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-image-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-image-32~dark@2x.png
new file mode 100644
index 0000000000..377598e268
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-image-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-image-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-image-32~dark~sel.png
new file mode 100644
index 0000000000..1ad4758570
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-image-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-image-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-image-32~dark~sel@2x.png
new file mode 100644
index 0000000000..7a9f5ace9d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-image-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-image-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-image-32~sel.png
new file mode 100644
index 0000000000..8cf0911abf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-image-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-image-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-image-32~sel@2x.png
new file mode 100644
index 0000000000..62681b5391
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-image-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-information-16.png b/main/src/core/MonoDevelop.Ide/icons/file-information-16.png
new file mode 100644
index 0000000000..5d1b857538
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-information-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-information-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-information-16@2x.png
new file mode 100644
index 0000000000..be66f4fc51
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-information-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-information-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-information-16~dark.png
new file mode 100644
index 0000000000..1c1b3d69a7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-information-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-information-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-information-16~dark@2x.png
new file mode 100644
index 0000000000..2e369572b5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-information-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-information-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-information-16~dark~sel.png
new file mode 100644
index 0000000000..9916c821d6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-information-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-information-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-information-16~dark~sel@2x.png
new file mode 100644
index 0000000000..fe5e25d190
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-information-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-information-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-information-16~sel.png
new file mode 100644
index 0000000000..2b8c7739aa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-information-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-information-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-information-16~sel@2x.png
new file mode 100644
index 0000000000..cace68b5c3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-information-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-information-32.png b/main/src/core/MonoDevelop.Ide/icons/file-information-32.png
new file mode 100644
index 0000000000..be66f4fc51
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-information-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-information-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-information-32@2x.png
new file mode 100644
index 0000000000..f8355f307e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-information-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-information-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-information-32~dark.png
new file mode 100644
index 0000000000..2e369572b5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-information-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-information-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-information-32~dark@2x.png
new file mode 100644
index 0000000000..7a81e3d102
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-information-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-information-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-information-32~dark~sel.png
new file mode 100644
index 0000000000..fe5e25d190
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-information-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-information-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-information-32~dark~sel@2x.png
new file mode 100644
index 0000000000..67a071e9cd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-information-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-information-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-information-32~sel.png
new file mode 100644
index 0000000000..cace68b5c3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-information-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-information-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-information-32~sel@2x.png
new file mode 100644
index 0000000000..cf352a83ce
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-information-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-interface-16.png b/main/src/core/MonoDevelop.Ide/icons/file-interface-16.png
new file mode 100644
index 0000000000..77606ce01f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-interface-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-interface-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-interface-16@2x.png
new file mode 100644
index 0000000000..b0dab439ad
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-interface-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-interface-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-interface-16~dark.png
new file mode 100644
index 0000000000..57b93cd34d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-interface-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-interface-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-interface-16~dark@2x.png
new file mode 100644
index 0000000000..c8ad092a08
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-interface-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-interface-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-interface-16~dark~sel.png
new file mode 100644
index 0000000000..4d00bc9271
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-interface-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-interface-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-interface-16~dark~sel@2x.png
new file mode 100644
index 0000000000..42a6a498e0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-interface-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-interface-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-interface-16~sel.png
new file mode 100644
index 0000000000..692454287f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-interface-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-interface-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-interface-16~sel@2x.png
new file mode 100644
index 0000000000..14d96f178e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-interface-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-interface-32.png b/main/src/core/MonoDevelop.Ide/icons/file-interface-32.png
index 239e8cf08a..b0dab439ad 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-interface-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-interface-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-interface-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-interface-32@2x.png
index 9c6c994728..b2e96baef2 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-interface-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-interface-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-interface-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-interface-32~dark.png
new file mode 100644
index 0000000000..c8ad092a08
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-interface-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-interface-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-interface-32~dark@2x.png
new file mode 100644
index 0000000000..85569fd532
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-interface-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-interface-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-interface-32~dark~sel.png
new file mode 100644
index 0000000000..42a6a498e0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-interface-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-interface-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-interface-32~dark~sel@2x.png
new file mode 100644
index 0000000000..1b711e7d4a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-interface-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-interface-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-interface-32~sel.png
new file mode 100644
index 0000000000..14d96f178e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-interface-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-interface-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-interface-32~sel@2x.png
new file mode 100644
index 0000000000..2efe26f113
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-interface-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-resource-16.png b/main/src/core/MonoDevelop.Ide/icons/file-resource-16.png
index bdb9547e73..70ced5200b 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-resource-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-resource-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-resource-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-resource-16@2x.png
index 70c9f15fe2..e12af222f3 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-resource-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-resource-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-resource-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-resource-16~dark.png
new file mode 100644
index 0000000000..24d9d66df1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-resource-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-resource-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-resource-16~dark@2x.png
new file mode 100644
index 0000000000..b18c0438a8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-resource-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-resource-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-resource-16~dark~sel.png
new file mode 100644
index 0000000000..46c1d10f0d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-resource-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-resource-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-resource-16~dark~sel@2x.png
new file mode 100644
index 0000000000..80b5f2dd71
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-resource-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-resource-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-resource-16~sel.png
new file mode 100644
index 0000000000..655ef0dfb3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-resource-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-resource-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-resource-16~sel@2x.png
new file mode 100644
index 0000000000..2cd99fc903
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-resource-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-resource-32.png b/main/src/core/MonoDevelop.Ide/icons/file-resource-32.png
index 70c9f15fe2..e12af222f3 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-resource-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-resource-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-resource-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-resource-32@2x.png
index b6cdc76469..9d8d9ab2aa 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-resource-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-resource-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-resource-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-resource-32~dark.png
new file mode 100644
index 0000000000..b18c0438a8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-resource-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-resource-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-resource-32~dark@2x.png
new file mode 100644
index 0000000000..bc13c63f02
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-resource-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-resource-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-resource-32~dark~sel.png
new file mode 100644
index 0000000000..80b5f2dd71
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-resource-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-resource-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-resource-32~dark~sel@2x.png
new file mode 100644
index 0000000000..cc7d5ed773
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-resource-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-resource-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-resource-32~sel.png
new file mode 100644
index 0000000000..2cd99fc903
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-resource-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-resource-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-resource-32~sel@2x.png
new file mode 100644
index 0000000000..352f3dc9ef
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-resource-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-script-16.png b/main/src/core/MonoDevelop.Ide/icons/file-script-16.png
index 78fab9fae2..a95949cb93 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-script-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-script-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-script-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-script-16@2x.png
index a77dfbe024..ff4af01b10 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-script-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-script-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-script-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-script-16~dark.png
new file mode 100644
index 0000000000..439412a30d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-script-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-script-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-script-16~dark@2x.png
new file mode 100644
index 0000000000..f8c04595f5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-script-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-script-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-script-16~dark~sel.png
new file mode 100644
index 0000000000..b763fc49a1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-script-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-script-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-script-16~dark~sel@2x.png
new file mode 100644
index 0000000000..4531a5946a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-script-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-script-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-script-16~sel.png
new file mode 100644
index 0000000000..ec73be7747
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-script-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-script-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-script-16~sel@2x.png
new file mode 100644
index 0000000000..cc2ad69682
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-script-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-script-32.png b/main/src/core/MonoDevelop.Ide/icons/file-script-32.png
index a77dfbe024..ff4af01b10 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-script-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-script-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-script-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-script-32@2x.png
index 892e70fc93..89ef3a4528 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-script-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-script-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-script-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-script-32~dark.png
new file mode 100644
index 0000000000..f8c04595f5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-script-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-script-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-script-32~dark@2x.png
new file mode 100644
index 0000000000..7e6a966734
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-script-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-script-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-script-32~dark~sel.png
new file mode 100644
index 0000000000..4531a5946a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-script-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-script-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-script-32~dark~sel@2x.png
new file mode 100644
index 0000000000..fe413182ba
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-script-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-script-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-script-32~sel.png
new file mode 100644
index 0000000000..cc2ad69682
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-script-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-script-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-script-32~sel@2x.png
new file mode 100644
index 0000000000..894f3a46e3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-script-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-source-16.png b/main/src/core/MonoDevelop.Ide/icons/file-source-16.png
index 34b7ac06e1..d888a48356 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-source-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-source-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-source-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-source-16@2x.png
index df5ea2bdc6..965feb2673 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-source-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-source-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-source-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-source-16~dark.png
new file mode 100644
index 0000000000..a28a4610ba
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-source-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-source-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-source-16~dark@2x.png
new file mode 100644
index 0000000000..4632a5af3e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-source-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-source-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-source-16~dark~sel.png
new file mode 100644
index 0000000000..3b13b595f1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-source-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-source-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-source-16~dark~sel@2x.png
new file mode 100644
index 0000000000..5dcf9b35e8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-source-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-source-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-source-16~sel.png
new file mode 100644
index 0000000000..5de35c8be5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-source-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-source-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-source-16~sel@2x.png
new file mode 100644
index 0000000000..daf1069540
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-source-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-source-32.png b/main/src/core/MonoDevelop.Ide/icons/file-source-32.png
index df5ea2bdc6..965feb2673 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-source-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-source-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-source-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-source-32@2x.png
index 9f39b45817..1252226622 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-source-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-source-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-source-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-source-32~dark.png
new file mode 100644
index 0000000000..4632a5af3e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-source-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-source-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-source-32~dark@2x.png
new file mode 100644
index 0000000000..c3635d4ae1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-source-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-source-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-source-32~dark~sel.png
new file mode 100644
index 0000000000..5dcf9b35e8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-source-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-source-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-source-32~dark~sel@2x.png
new file mode 100644
index 0000000000..4199735ac8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-source-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-source-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-source-32~sel.png
new file mode 100644
index 0000000000..daf1069540
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-source-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-source-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-source-32~sel@2x.png
new file mode 100644
index 0000000000..eaf899406e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-source-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-struct-16.png b/main/src/core/MonoDevelop.Ide/icons/file-struct-16.png
new file mode 100644
index 0000000000..94dd9ea8a7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-struct-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-struct-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-struct-16@2x.png
new file mode 100644
index 0000000000..24419be9fd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-struct-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-struct-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-struct-16~dark.png
new file mode 100644
index 0000000000..3ae7a0d03a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-struct-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-struct-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-struct-16~dark@2x.png
new file mode 100644
index 0000000000..0391753284
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-struct-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-struct-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-struct-16~dark~sel.png
new file mode 100644
index 0000000000..02beaab3cb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-struct-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-struct-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-struct-16~dark~sel@2x.png
new file mode 100644
index 0000000000..c67f49fa6a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-struct-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-struct-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-struct-16~sel.png
new file mode 100644
index 0000000000..a6ec420743
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-struct-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-struct-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-struct-16~sel@2x.png
new file mode 100644
index 0000000000..0fbcaf39a3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-struct-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-struct-32.png b/main/src/core/MonoDevelop.Ide/icons/file-struct-32.png
index 89009b7077..24419be9fd 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-struct-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-struct-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-struct-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-struct-32@2x.png
index b0e75e05a1..520492a74f 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-struct-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-struct-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-struct-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-struct-32~dark.png
new file mode 100644
index 0000000000..0391753284
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-struct-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-struct-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-struct-32~dark@2x.png
new file mode 100644
index 0000000000..9bf31dfbe3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-struct-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-struct-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-struct-32~dark~sel.png
new file mode 100644
index 0000000000..c67f49fa6a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-struct-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-struct-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-struct-32~dark~sel@2x.png
new file mode 100644
index 0000000000..76207918fe
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-struct-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-struct-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-struct-32~sel.png
new file mode 100644
index 0000000000..0fbcaf39a3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-struct-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-struct-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-struct-32~sel@2x.png
new file mode 100644
index 0000000000..c99789c673
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-struct-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-text-16.png b/main/src/core/MonoDevelop.Ide/icons/file-text-16.png
index 2287f67690..ed4f53f1b0 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-text-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-text-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-text-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-text-16@2x.png
index bf8958e404..7c097b9cbe 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-text-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-text-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-text-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-text-16~dark.png
new file mode 100644
index 0000000000..0c36f14c3b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-text-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-text-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-text-16~dark@2x.png
new file mode 100644
index 0000000000..5a993f2cce
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-text-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-text-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-text-16~dark~sel.png
new file mode 100644
index 0000000000..e68c0a4f66
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-text-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-text-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-text-16~dark~sel@2x.png
new file mode 100644
index 0000000000..d86b7d1e74
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-text-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-text-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-text-16~sel.png
new file mode 100644
index 0000000000..646373c4c2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-text-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-text-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-text-16~sel@2x.png
new file mode 100644
index 0000000000..1b466d2a9b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-text-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-text-32.png b/main/src/core/MonoDevelop.Ide/icons/file-text-32.png
index bf8958e404..7c097b9cbe 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-text-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-text-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-text-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-text-32@2x.png
index b0e4669507..7279b1097c 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-text-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-text-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-text-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-text-32~dark.png
new file mode 100644
index 0000000000..5a993f2cce
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-text-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-text-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-text-32~dark@2x.png
new file mode 100644
index 0000000000..cc0aba83f0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-text-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-text-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-text-32~dark~sel.png
new file mode 100644
index 0000000000..d86b7d1e74
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-text-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-text-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-text-32~dark~sel@2x.png
new file mode 100644
index 0000000000..0260f77ed2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-text-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-text-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-text-32~sel.png
new file mode 100644
index 0000000000..1b466d2a9b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-text-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-text-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-text-32~sel@2x.png
new file mode 100644
index 0000000000..8fc88db4d5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-text-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16.png b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16.png
new file mode 100644
index 0000000000..eb9cdf4ee9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16@2x.png
new file mode 100644
index 0000000000..aa86313c86
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~dark.png
new file mode 100644
index 0000000000..f72b3f4b52
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~dark@2x.png
new file mode 100644
index 0000000000..5c86825cff
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~dark~sel.png
new file mode 100644
index 0000000000..5eb96c2acc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~dark~sel@2x.png
new file mode 100644
index 0000000000..07fe59d25c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~sel.png
new file mode 100644
index 0000000000..7f27829726
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~sel@2x.png
new file mode 100644
index 0000000000..3724056aef
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32.png b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32.png
index 42633e88b5..aa86313c86 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32@2x.png
index 8fddb768f6..4c0809f42f 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~dark.png
new file mode 100644
index 0000000000..5c86825cff
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~dark@2x.png
new file mode 100644
index 0000000000..06ad0fede5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~dark~sel.png
new file mode 100644
index 0000000000..07fe59d25c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~dark~sel@2x.png
new file mode 100644
index 0000000000..68b995c7e3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~sel.png
new file mode 100644
index 0000000000..3724056aef
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~sel@2x.png
new file mode 100644
index 0000000000..d57dbc4c8d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-unit-test-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-web-16.png b/main/src/core/MonoDevelop.Ide/icons/file-web-16.png
index 23a6f417bd..b1267446ef 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-web-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-web-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-web-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-web-16@2x.png
index b6f836b4f8..ff6eba9fcc 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-web-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-web-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-web-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-web-16~dark.png
new file mode 100644
index 0000000000..3daf89c1a1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-web-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-web-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-web-16~dark@2x.png
new file mode 100644
index 0000000000..a94fad0752
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-web-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-web-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-web-16~dark~sel.png
new file mode 100644
index 0000000000..d6588df941
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-web-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-web-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-web-16~dark~sel@2x.png
new file mode 100644
index 0000000000..2e11c56aaa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-web-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-web-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-web-16~sel.png
new file mode 100644
index 0000000000..664bc434e1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-web-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-web-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-web-16~sel@2x.png
new file mode 100644
index 0000000000..a4d1d70422
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-web-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-web-32.png b/main/src/core/MonoDevelop.Ide/icons/file-web-32.png
index b6f836b4f8..ff6eba9fcc 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-web-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-web-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-web-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-web-32@2x.png
index bb99efb64d..5c141481e6 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-web-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-web-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-web-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-web-32~dark.png
new file mode 100644
index 0000000000..a94fad0752
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-web-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-web-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-web-32~dark@2x.png
new file mode 100644
index 0000000000..979afd3ab5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-web-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-web-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-web-32~dark~sel.png
new file mode 100644
index 0000000000..2e11c56aaa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-web-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-web-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-web-32~dark~sel@2x.png
new file mode 100644
index 0000000000..e99c144c09
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-web-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-web-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-web-32~sel.png
new file mode 100644
index 0000000000..a4d1d70422
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-web-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-web-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-web-32~sel@2x.png
new file mode 100644
index 0000000000..eee860591b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-web-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-xml-16.png b/main/src/core/MonoDevelop.Ide/icons/file-xml-16.png
index fc6082d1cb..512d91aa69 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-xml-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-xml-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-xml-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-xml-16@2x.png
index 0aef2fef5d..1094f86759 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-xml-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-xml-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-xml-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-xml-16~dark.png
new file mode 100644
index 0000000000..20e6363cc6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-xml-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-xml-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-xml-16~dark@2x.png
new file mode 100644
index 0000000000..6427beff27
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-xml-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-xml-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-xml-16~dark~sel.png
new file mode 100644
index 0000000000..712f58462a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-xml-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-xml-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-xml-16~dark~sel@2x.png
new file mode 100644
index 0000000000..2b56aa7bb5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-xml-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-xml-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-xml-16~sel.png
new file mode 100644
index 0000000000..c1fd928313
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-xml-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-xml-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-xml-16~sel@2x.png
new file mode 100644
index 0000000000..9b9f7fbae7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-xml-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-xml-32.png b/main/src/core/MonoDevelop.Ide/icons/file-xml-32.png
index 0aef2fef5d..1094f86759 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-xml-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-xml-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-xml-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-xml-32@2x.png
index 3896b8e119..7483b0dfab 100644
--- a/main/src/core/MonoDevelop.Ide/icons/file-xml-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/file-xml-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-xml-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/file-xml-32~dark.png
new file mode 100644
index 0000000000..6427beff27
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-xml-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-xml-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-xml-32~dark@2x.png
new file mode 100644
index 0000000000..17ca6ca5a9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-xml-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-xml-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-xml-32~dark~sel.png
new file mode 100644
index 0000000000..2b56aa7bb5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-xml-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-xml-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-xml-32~dark~sel@2x.png
new file mode 100644
index 0000000000..d28413a948
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-xml-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-xml-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/file-xml-32~sel.png
new file mode 100644
index 0000000000..9b9f7fbae7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-xml-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/file-xml-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/file-xml-32~sel@2x.png
new file mode 100644
index 0000000000..27034d0dce
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/file-xml-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-16.png b/main/src/core/MonoDevelop.Ide/icons/find-16.png
index 85e5d0df07..dc8f18a56f 100644
--- a/main/src/core/MonoDevelop.Ide/icons/find-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/find-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/find-16@2x.png
index f53fae3769..1bb1b0150b 100644
--- a/main/src/core/MonoDevelop.Ide/icons/find-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/find-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/find-16~dark.png
new file mode 100644
index 0000000000..51b0a5d059
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/find-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/find-16~dark@2x.png
new file mode 100644
index 0000000000..2cb367ceaf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/find-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/find-16~dark~sel.png
new file mode 100644
index 0000000000..70bcbb55ea
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/find-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/find-16~dark~sel@2x.png
new file mode 100644
index 0000000000..73e0ceea44
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/find-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/find-16~sel.png
new file mode 100644
index 0000000000..70bcbb55ea
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/find-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/find-16~sel@2x.png
new file mode 100644
index 0000000000..73e0ceea44
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/find-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16.png b/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16.png
index 4fd9e05804..fb797b81a7 100644
--- a/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16@2x.png
index 9ae65404e5..25771151fc 100644
--- a/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~dark.png
new file mode 100644
index 0000000000..8c3bb65314
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~dark@2x.png
new file mode 100644
index 0000000000..8d5957af23
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~dark~sel.png
new file mode 100644
index 0000000000..d4681e5c23
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~dark~sel@2x.png
new file mode 100644
index 0000000000..dcf7e16252
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~sel.png
new file mode 100644
index 0000000000..d4681e5c23
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~sel@2x.png
new file mode 100644
index 0000000000..dcf7e16252
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/find-and-replace-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-in-files-16.png b/main/src/core/MonoDevelop.Ide/icons/find-in-files-16.png
deleted file mode 100644
index c8fbe69b3a..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/find-in-files-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-next-16.png b/main/src/core/MonoDevelop.Ide/icons/find-next-16.png
new file mode 100644
index 0000000000..2290a6d5b4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/find-next-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-next-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/find-next-16@2x.png
new file mode 100644
index 0000000000..1b4c9984c4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/find-next-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-next-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/find-next-16~dark.png
new file mode 100644
index 0000000000..52993db038
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/find-next-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-next-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/find-next-16~dark@2x.png
new file mode 100644
index 0000000000..42afe8eeed
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/find-next-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-prev-16.png b/main/src/core/MonoDevelop.Ide/icons/find-prev-16.png
new file mode 100644
index 0000000000..8a431235e0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/find-prev-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-prev-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/find-prev-16@2x.png
new file mode 100644
index 0000000000..04a9bd7e8f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/find-prev-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-prev-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/find-prev-16~dark.png
new file mode 100644
index 0000000000..21fbef72aa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/find-prev-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/find-prev-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/find-prev-16~dark@2x.png
new file mode 100644
index 0000000000..970c868b58
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/find-prev-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-assets-16.png b/main/src/core/MonoDevelop.Ide/icons/folder-assets-16.png
new file mode 100644
index 0000000000..c39e8faaa1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-assets-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-assets-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-assets-16@2x.png
new file mode 100644
index 0000000000..698d7f8f11
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-assets-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-assets-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/folder-assets-16~dark.png
new file mode 100644
index 0000000000..9b9a329e68
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-assets-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-assets-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-assets-16~dark@2x.png
new file mode 100644
index 0000000000..6eb675e19e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-assets-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-assets-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/folder-assets-16~dark~sel.png
new file mode 100644
index 0000000000..a417da1f0c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-assets-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-assets-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-assets-16~dark~sel@2x.png
new file mode 100644
index 0000000000..aa0b68c93a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-assets-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-assets-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/folder-assets-16~sel.png
new file mode 100644
index 0000000000..a417da1f0c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-assets-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-assets-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-assets-16~sel@2x.png
new file mode 100644
index 0000000000..aa0b68c93a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-assets-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-component-16.png b/main/src/core/MonoDevelop.Ide/icons/folder-component-16.png
new file mode 100644
index 0000000000..66945c2c66
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-component-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-component-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-component-16@2x.png
new file mode 100644
index 0000000000..c0bc969fef
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-component-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-component-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/folder-component-16~dark.png
new file mode 100644
index 0000000000..63727d3270
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-component-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-component-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-component-16~dark@2x.png
new file mode 100644
index 0000000000..25326338e4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-component-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-component-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/folder-component-16~dark~sel.png
new file mode 100644
index 0000000000..7f5508f41c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-component-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-component-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-component-16~dark~sel@2x.png
new file mode 100644
index 0000000000..587aee4512
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-component-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-component-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/folder-component-16~sel.png
new file mode 100644
index 0000000000..7f5508f41c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-component-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-component-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-component-16~sel@2x.png
new file mode 100644
index 0000000000..587aee4512
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-component-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-component-mac-16.png b/main/src/core/MonoDevelop.Ide/icons/folder-component-mac-16.png
deleted file mode 100644
index 51fa67e549..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/folder-component-mac-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-component-mac-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-component-mac-16@2x.png
deleted file mode 100644
index b950a73ec0..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/folder-component-mac-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-component-win-16.png b/main/src/core/MonoDevelop.Ide/icons/folder-component-win-16.png
deleted file mode 100644
index 891aa54875..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/folder-component-win-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-component-win-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-component-win-16@2x.png
deleted file mode 100644
index 553126f036..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/folder-component-win-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-generic-16.png b/main/src/core/MonoDevelop.Ide/icons/folder-generic-16.png
new file mode 100644
index 0000000000..d03ab8e5b4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-generic-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-generic-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-generic-16@2x.png
new file mode 100644
index 0000000000..9dafc86fcf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-generic-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-generic-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/folder-generic-16~dark.png
new file mode 100644
index 0000000000..b55b41daf0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-generic-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-generic-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-generic-16~dark@2x.png
new file mode 100644
index 0000000000..8124a4acf1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-generic-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-generic-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/folder-generic-16~dark~sel.png
new file mode 100644
index 0000000000..8cbac06936
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-generic-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-generic-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-generic-16~dark~sel@2x.png
new file mode 100644
index 0000000000..979d664225
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-generic-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-generic-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/folder-generic-16~sel.png
new file mode 100644
index 0000000000..8cbac06936
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-generic-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-generic-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-generic-16~sel@2x.png
new file mode 100644
index 0000000000..979d664225
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-generic-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-generic-mac-16.png b/main/src/core/MonoDevelop.Ide/icons/folder-generic-mac-16.png
deleted file mode 100644
index 800b76d447..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/folder-generic-mac-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-generic-mac-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-generic-mac-16@2x.png
deleted file mode 100644
index c319f59bc2..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/folder-generic-mac-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-generic-win-16.png b/main/src/core/MonoDevelop.Ide/icons/folder-generic-win-16.png
deleted file mode 100644
index fe06916af8..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/folder-generic-win-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-generic-win-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-generic-win-16@2x.png
deleted file mode 100644
index c9443aae50..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/folder-generic-win-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-new-16.png b/main/src/core/MonoDevelop.Ide/icons/folder-new-16.png
deleted file mode 100644
index 426e6e92f1..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/folder-new-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-resource-16.png b/main/src/core/MonoDevelop.Ide/icons/folder-resource-16.png
new file mode 100644
index 0000000000..1eee3debbf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-resource-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-resource-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-resource-16@2x.png
new file mode 100644
index 0000000000..152fa4bf34
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-resource-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-resource-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/folder-resource-16~dark.png
new file mode 100644
index 0000000000..b44f689da1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-resource-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-resource-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-resource-16~dark@2x.png
new file mode 100644
index 0000000000..8741e36cd7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-resource-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-resource-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/folder-resource-16~dark~sel.png
new file mode 100644
index 0000000000..9ddb319954
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-resource-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-resource-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-resource-16~dark~sel@2x.png
new file mode 100644
index 0000000000..370c59d01a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-resource-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-resource-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/folder-resource-16~sel.png
new file mode 100644
index 0000000000..9ddb319954
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-resource-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-resource-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-resource-16~sel@2x.png
new file mode 100644
index 0000000000..370c59d01a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-resource-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-solution-16.png b/main/src/core/MonoDevelop.Ide/icons/folder-solution-16.png
new file mode 100644
index 0000000000..dcdc665905
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-solution-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-solution-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-solution-16@2x.png
new file mode 100644
index 0000000000..66814bcfb8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-solution-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-solution-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/folder-solution-16~dark.png
new file mode 100644
index 0000000000..7a7d388250
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-solution-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-solution-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-solution-16~dark@2x.png
new file mode 100644
index 0000000000..cc0aac54c9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-solution-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-solution-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/folder-solution-16~dark~sel.png
new file mode 100644
index 0000000000..ce6b1e02de
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-solution-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-solution-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-solution-16~dark~sel@2x.png
new file mode 100644
index 0000000000..b17c00c961
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-solution-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-solution-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/folder-solution-16~sel.png
new file mode 100644
index 0000000000..ce6b1e02de
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-solution-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-solution-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-solution-16~sel@2x.png
new file mode 100644
index 0000000000..45394e5e1e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/folder-solution-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-special-mac-16.png b/main/src/core/MonoDevelop.Ide/icons/folder-special-mac-16.png
deleted file mode 100644
index 43c2b89ca3..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/folder-special-mac-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-special-mac-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-special-mac-16@2x.png
deleted file mode 100644
index 89e8b80498..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/folder-special-mac-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-special-win-16.png b/main/src/core/MonoDevelop.Ide/icons/folder-special-win-16.png
deleted file mode 100644
index 883bee1822..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/folder-special-win-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-special-win-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-special-win-16@2x.png
deleted file mode 100644
index fe3524f326..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/folder-special-win-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-web-reference-mac-16.png b/main/src/core/MonoDevelop.Ide/icons/folder-web-reference-mac-16.png
deleted file mode 100644
index b017bd788e..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/folder-web-reference-mac-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-web-reference-mac-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-web-reference-mac-16@2x.png
deleted file mode 100644
index e4f89773dd..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/folder-web-reference-mac-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-web-reference-win-16.png b/main/src/core/MonoDevelop.Ide/icons/folder-web-reference-win-16.png
deleted file mode 100644
index 0f412c1753..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/folder-web-reference-win-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/folder-web-reference-win-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/folder-web-reference-win-16@2x.png
deleted file mode 100644
index 6b404b4007..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/folder-web-reference-win-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/fullscreen-16.png b/main/src/core/MonoDevelop.Ide/icons/fullscreen-16.png
new file mode 100644
index 0000000000..7ef13592eb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/fullscreen-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/fullscreen-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/fullscreen-16@2x.png
new file mode 100644
index 0000000000..168599b1a7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/fullscreen-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/fullscreen-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/fullscreen-16~dark.png
new file mode 100644
index 0000000000..d7c0ab66c1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/fullscreen-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/fullscreen-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/fullscreen-16~dark@2x.png
new file mode 100644
index 0000000000..14edaec9b8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/fullscreen-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/fullscreen-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/fullscreen-16~dark~sel.png
new file mode 100644
index 0000000000..df860e0fc5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/fullscreen-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/fullscreen-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/fullscreen-16~dark~sel@2x.png
new file mode 100644
index 0000000000..67efebeeda
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/fullscreen-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/fullscreen-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/fullscreen-16~sel.png
new file mode 100644
index 0000000000..df860e0fc5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/fullscreen-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/fullscreen-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/fullscreen-16~sel@2x.png
new file mode 100644
index 0000000000..67efebeeda
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/fullscreen-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-back-16.png b/main/src/core/MonoDevelop.Ide/icons/go-back-16.png
index a812575428..0c2c73df2e 100644
--- a/main/src/core/MonoDevelop.Ide/icons/go-back-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/go-back-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-back-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/go-back-16@2x.png
index dd2620713e..a8405c6ce8 100644
--- a/main/src/core/MonoDevelop.Ide/icons/go-back-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/go-back-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-back-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/go-back-16~dark.png
new file mode 100644
index 0000000000..7eb1a1f873
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-back-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-back-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/go-back-16~dark@2x.png
new file mode 100644
index 0000000000..5084a58ff6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-back-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-back-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/go-back-16~dark~disabled.png
new file mode 100644
index 0000000000..d43c23f4e5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-back-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-back-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/go-back-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..3025837c5a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-back-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-back-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/go-back-16~disabled.png
new file mode 100644
index 0000000000..fc2e26d5e8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-back-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-back-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/go-back-16~disabled@2x.png
new file mode 100644
index 0000000000..bd4e5960b8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-back-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-down-16.png b/main/src/core/MonoDevelop.Ide/icons/go-down-16.png
index 24c499b29c..4b7a134d9b 100644
--- a/main/src/core/MonoDevelop.Ide/icons/go-down-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/go-down-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-down-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/go-down-16@2x.png
index 2df5aecf13..7448643689 100644
--- a/main/src/core/MonoDevelop.Ide/icons/go-down-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/go-down-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-down-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/go-down-16~dark.png
new file mode 100644
index 0000000000..f82a370e6d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-down-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-down-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/go-down-16~dark@2x.png
new file mode 100644
index 0000000000..6073cdb86d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-down-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-down-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/go-down-16~dark~disabled.png
new file mode 100644
index 0000000000..8a8078c017
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-down-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-down-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/go-down-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..0270d5a66b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-down-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-down-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/go-down-16~disabled.png
new file mode 100644
index 0000000000..b35b632b41
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-down-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-down-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/go-down-16~disabled@2x.png
new file mode 100644
index 0000000000..fcf300acee
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-down-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-forward-16.png b/main/src/core/MonoDevelop.Ide/icons/go-forward-16.png
index 1d338ba1bb..35f57710eb 100644
--- a/main/src/core/MonoDevelop.Ide/icons/go-forward-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/go-forward-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-forward-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/go-forward-16@2x.png
index cd6c264767..d1b3396e25 100644
--- a/main/src/core/MonoDevelop.Ide/icons/go-forward-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/go-forward-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-forward-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/go-forward-16~dark.png
new file mode 100644
index 0000000000..f3ca72bda1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-forward-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-forward-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/go-forward-16~dark@2x.png
new file mode 100644
index 0000000000..73d39bf430
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-forward-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-forward-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/go-forward-16~dark~disabled.png
new file mode 100644
index 0000000000..18f1b16c94
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-forward-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-forward-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/go-forward-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..7315cf8f17
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-forward-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-forward-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/go-forward-16~disabled.png
new file mode 100644
index 0000000000..f16198f9d4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-forward-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-forward-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/go-forward-16~disabled@2x.png
new file mode 100644
index 0000000000..ebef7a1c3d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-forward-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-to-line-16.png b/main/src/core/MonoDevelop.Ide/icons/go-to-line-16.png
new file mode 100644
index 0000000000..b90f6cfd67
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-to-line-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-to-line-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/go-to-line-16@2x.png
new file mode 100644
index 0000000000..74fd0875d0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-to-line-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-to-line-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/go-to-line-16~dark.png
new file mode 100644
index 0000000000..388ec23b6c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-to-line-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-to-line-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/go-to-line-16~dark@2x.png
new file mode 100644
index 0000000000..9fd925bd50
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-to-line-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-to-matching-brace-16.png b/main/src/core/MonoDevelop.Ide/icons/go-to-matching-brace-16.png
new file mode 100644
index 0000000000..48edc8ba2a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-to-matching-brace-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-to-matching-brace-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/go-to-matching-brace-16@2x.png
new file mode 100644
index 0000000000..1f0a91f068
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-to-matching-brace-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-to-matching-brace-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/go-to-matching-brace-16~dark.png
new file mode 100644
index 0000000000..f6cfe4bcbc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-to-matching-brace-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-to-matching-brace-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/go-to-matching-brace-16~dark@2x.png
new file mode 100644
index 0000000000..25d405e0b8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-to-matching-brace-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-up-16.png b/main/src/core/MonoDevelop.Ide/icons/go-up-16.png
index 3d7f56a783..69617e1eaa 100644
--- a/main/src/core/MonoDevelop.Ide/icons/go-up-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/go-up-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-up-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/go-up-16@2x.png
index d768f10cfa..bc219c594b 100644
--- a/main/src/core/MonoDevelop.Ide/icons/go-up-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/go-up-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-up-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/go-up-16~dark.png
new file mode 100644
index 0000000000..9c924f6a82
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-up-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-up-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/go-up-16~dark@2x.png
new file mode 100644
index 0000000000..c25340732a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-up-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-up-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/go-up-16~dark~disabled.png
new file mode 100644
index 0000000000..2972604583
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-up-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-up-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/go-up-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..eeb135745b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-up-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-up-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/go-up-16~disabled.png
new file mode 100644
index 0000000000..d6403b1550
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-up-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/go-up-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/go-up-16~disabled@2x.png
new file mode 100644
index 0000000000..abb5f55bab
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/go-up-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/goto-next-bookmark-16.png b/main/src/core/MonoDevelop.Ide/icons/goto-next-bookmark-16.png
deleted file mode 100644
index f4f101ce60..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/goto-next-bookmark-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/goto-prev-bookmark-16.png b/main/src/core/MonoDevelop.Ide/icons/goto-prev-bookmark-16.png
deleted file mode 100644
index 5fc1e5a8a6..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/goto-prev-bookmark-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/group-by-category-16.png b/main/src/core/MonoDevelop.Ide/icons/group-by-category-16.png
index 503eb9c557..6c42b70df2 100644
--- a/main/src/core/MonoDevelop.Ide/icons/group-by-category-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/group-by-category-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/group-by-category-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/group-by-category-16@2x.png
index d67f994428..7258f23f8b 100644
--- a/main/src/core/MonoDevelop.Ide/icons/group-by-category-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/group-by-category-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/group-by-category-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/group-by-category-16~dark.png
new file mode 100644
index 0000000000..742b8ee9ff
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/group-by-category-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/group-by-category-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/group-by-category-16~dark@2x.png
new file mode 100644
index 0000000000..e3315f3ecf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/group-by-category-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/help-16.png b/main/src/core/MonoDevelop.Ide/icons/help-16.png
new file mode 100644
index 0000000000..d29e4ddaba
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/help-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/help-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/help-16@2x.png
new file mode 100644
index 0000000000..eb9da942d5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/help-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/help-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/help-16~dark.png
new file mode 100644
index 0000000000..b7e5b41b15
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/help-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/help-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/help-16~dark@2x.png
new file mode 100644
index 0000000000..d2299e6c91
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/help-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/help-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/help-16~dark~sel.png
new file mode 100644
index 0000000000..8c16140779
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/help-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/help-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/help-16~dark~sel@2x.png
new file mode 100644
index 0000000000..921059abdf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/help-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/help-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/help-16~sel.png
new file mode 100644
index 0000000000..8c16140779
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/help-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/help-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/help-16~sel@2x.png
new file mode 100644
index 0000000000..921059abdf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/help-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/home-16.png b/main/src/core/MonoDevelop.Ide/icons/home-16.png
index 33f0f125d1..a0394bc7ae 100644
--- a/main/src/core/MonoDevelop.Ide/icons/home-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/home-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/home-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/home-16@2x.png
index 4911d16866..e79d362863 100644
--- a/main/src/core/MonoDevelop.Ide/icons/home-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/home-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/home-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/home-16~dark.png
new file mode 100644
index 0000000000..a491b02dd3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/home-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/home-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/home-16~dark@2x.png
new file mode 100644
index 0000000000..f2e2415723
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/home-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/home-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/home-16~dark~sel.png
new file mode 100644
index 0000000000..7e7673d986
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/home-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/home-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/home-16~dark~sel@2x.png
new file mode 100644
index 0000000000..c54b31fd47
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/home-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/home-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/home-16~sel.png
new file mode 100644
index 0000000000..7e7673d986
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/home-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/home-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/home-16~sel@2x.png
new file mode 100644
index 0000000000..c54b31fd47
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/home-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/indent-16.png b/main/src/core/MonoDevelop.Ide/icons/indent-16.png
new file mode 100644
index 0000000000..566463dfaf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/indent-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/indent-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/indent-16@2x.png
new file mode 100644
index 0000000000..484325cf21
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/indent-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/indent-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/indent-16~dark.png
new file mode 100644
index 0000000000..e9a7d770f5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/indent-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/indent-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/indent-16~dark@2x.png
new file mode 100644
index 0000000000..75983aba3f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/indent-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-16.png b/main/src/core/MonoDevelop.Ide/icons/information-16.png
index fbddc185a4..874c8d5ec4 100644
--- a/main/src/core/MonoDevelop.Ide/icons/information-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/information-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/information-16@2x.png
index 5557a3de4a..1e5375cedc 100644
--- a/main/src/core/MonoDevelop.Ide/icons/information-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/information-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/information-16~dark.png
new file mode 100644
index 0000000000..5fb33e4650
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/information-16~dark@2x.png
new file mode 100644
index 0000000000..8497f8bfb9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/information-16~dark~sel.png
new file mode 100644
index 0000000000..36422baf2a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/information-16~dark~sel@2x.png
new file mode 100644
index 0000000000..16b54543ed
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/information-16~sel.png
new file mode 100644
index 0000000000..36422baf2a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/information-16~sel@2x.png
new file mode 100644
index 0000000000..16b54543ed
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-24.png b/main/src/core/MonoDevelop.Ide/icons/information-24.png
index 28e68fb1e2..0e1929869e 100644
--- a/main/src/core/MonoDevelop.Ide/icons/information-24.png
+++ b/main/src/core/MonoDevelop.Ide/icons/information-24.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-24@2x.png b/main/src/core/MonoDevelop.Ide/icons/information-24@2x.png
index b11eeacab1..a996498298 100644
--- a/main/src/core/MonoDevelop.Ide/icons/information-24@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/information-24@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-24~dark.png b/main/src/core/MonoDevelop.Ide/icons/information-24~dark.png
new file mode 100644
index 0000000000..10d5269f0b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-24~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-24~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/information-24~dark@2x.png
new file mode 100644
index 0000000000..740cde446f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-24~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-24~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/information-24~dark~sel.png
new file mode 100644
index 0000000000..3756036157
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-24~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-24~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/information-24~dark~sel@2x.png
new file mode 100644
index 0000000000..32a1de4bf0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-24~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-24~sel.png b/main/src/core/MonoDevelop.Ide/icons/information-24~sel.png
new file mode 100644
index 0000000000..3756036157
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-24~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-24~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/information-24~sel@2x.png
new file mode 100644
index 0000000000..32a1de4bf0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-24~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-32.png b/main/src/core/MonoDevelop.Ide/icons/information-32.png
index 5557a3de4a..1e5375cedc 100644
--- a/main/src/core/MonoDevelop.Ide/icons/information-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/information-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/information-32@2x.png
index e793ec82ae..4979139c0e 100644
--- a/main/src/core/MonoDevelop.Ide/icons/information-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/information-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/information-32~dark.png
new file mode 100644
index 0000000000..8497f8bfb9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/information-32~dark@2x.png
new file mode 100644
index 0000000000..86cd3e5521
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/information-32~dark~sel.png
new file mode 100644
index 0000000000..16b54543ed
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/information-32~dark~sel@2x.png
new file mode 100644
index 0000000000..1e24e4a0e5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/information-32~sel.png
new file mode 100644
index 0000000000..16b54543ed
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/information-32~sel@2x.png
new file mode 100644
index 0000000000..1e24e4a0e5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-48.png b/main/src/core/MonoDevelop.Ide/icons/information-48.png
index b11eeacab1..a996498298 100644
--- a/main/src/core/MonoDevelop.Ide/icons/information-48.png
+++ b/main/src/core/MonoDevelop.Ide/icons/information-48.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-48@2x.png b/main/src/core/MonoDevelop.Ide/icons/information-48@2x.png
index 8f1fc67009..3eea294793 100644
--- a/main/src/core/MonoDevelop.Ide/icons/information-48@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/information-48@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-48~dark.png b/main/src/core/MonoDevelop.Ide/icons/information-48~dark.png
new file mode 100644
index 0000000000..740cde446f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-48~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-48~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/information-48~dark@2x.png
new file mode 100644
index 0000000000..0f2f0f0fed
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-48~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-48~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/information-48~dark~sel.png
new file mode 100644
index 0000000000..32a1de4bf0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-48~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-48~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/information-48~dark~sel@2x.png
new file mode 100644
index 0000000000..05959eb154
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-48~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-48~sel.png b/main/src/core/MonoDevelop.Ide/icons/information-48~sel.png
new file mode 100644
index 0000000000..32a1de4bf0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-48~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/information-48~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/information-48~sel@2x.png
new file mode 100644
index 0000000000..05959eb154
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/information-48~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/invalid-reference-overlay-16.png b/main/src/core/MonoDevelop.Ide/icons/invalid-reference-overlay-16.png
deleted file mode 100644
index ecf13c9f69..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/invalid-reference-overlay-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/invalid-reference-overlay-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/invalid-reference-overlay-16@2x.png
deleted file mode 100644
index 9133b12c49..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/invalid-reference-overlay-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/jump-to-16.png b/main/src/core/MonoDevelop.Ide/icons/jump-to-16.png
index 274255670b..fc96996b2b 100644
--- a/main/src/core/MonoDevelop.Ide/icons/jump-to-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/jump-to-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/jump-to-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/jump-to-16@2x.png
index 2c0c87596d..1b2fe2c1d5 100644
--- a/main/src/core/MonoDevelop.Ide/icons/jump-to-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/jump-to-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/jump-to-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/jump-to-16~dark.png
new file mode 100644
index 0000000000..fcaa81804f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/jump-to-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/jump-to-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/jump-to-16~dark@2x.png
new file mode 100644
index 0000000000..75c6dcb90f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/jump-to-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/jump-to-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/jump-to-16~dark~disabled.png
new file mode 100644
index 0000000000..89d5be5e1f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/jump-to-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/jump-to-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/jump-to-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..0eae90ab44
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/jump-to-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/jump-to-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/jump-to-16~disabled.png
new file mode 100644
index 0000000000..aa3f607efd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/jump-to-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/jump-to-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/jump-to-16~disabled@2x.png
new file mode 100644
index 0000000000..c2930c227c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/jump-to-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/link-overlay-16.png b/main/src/core/MonoDevelop.Ide/icons/link-overlay-16.png
index 68a5379291..30bcedb2ac 100644
--- a/main/src/core/MonoDevelop.Ide/icons/link-overlay-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/link-overlay-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/link-overlay-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/link-overlay-16@2x.png
index bb823ed63a..7fdcfb10bf 100644
--- a/main/src/core/MonoDevelop.Ide/icons/link-overlay-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/link-overlay-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/link-overlay-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/link-overlay-16~dark.png
new file mode 100644
index 0000000000..8fbdf7977c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/link-overlay-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/link-overlay-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/link-overlay-16~dark@2x.png
new file mode 100644
index 0000000000..b2b23bab57
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/link-overlay-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/link-overlay-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/link-overlay-16~dark~sel.png
new file mode 100644
index 0000000000..cf26496350
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/link-overlay-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/link-overlay-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/link-overlay-16~dark~sel@2x.png
new file mode 100644
index 0000000000..f3ef53c242
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/link-overlay-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/link-overlay-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/link-overlay-16~sel.png
new file mode 100644
index 0000000000..cf26496350
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/link-overlay-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/link-overlay-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/link-overlay-16~sel@2x.png
new file mode 100644
index 0000000000..f3ef53c242
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/link-overlay-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/live-16.png b/main/src/core/MonoDevelop.Ide/icons/live-16.png
new file mode 100644
index 0000000000..5062b7b0ef
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/live-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/live-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/live-16@2x.png
new file mode 100644
index 0000000000..5981bd69a5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/live-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/live-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/live-16~dark.png
new file mode 100644
index 0000000000..b2dcbca9cf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/live-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/live-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/live-16~dark@2x.png
new file mode 100644
index 0000000000..d7b5fb0f53
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/live-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/live-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/live-16~dark~sel.png
new file mode 100644
index 0000000000..5ca6600be9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/live-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/live-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/live-16~dark~sel@2x.png
new file mode 100644
index 0000000000..cf2965cf4d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/live-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/live-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/live-16~sel.png
new file mode 100644
index 0000000000..5ca6600be9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/live-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/live-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/live-16~sel@2x.png
new file mode 100644
index 0000000000..cf2965cf4d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/live-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-building-1-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-building-1-16.png
deleted file mode 100644
index 059299242f..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-building-1-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-building-1-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-building-1-16@2x.png
deleted file mode 100644
index 9582fb826b..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-building-1-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-building-2-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-building-2-16.png
deleted file mode 100644
index 8298833939..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-building-2-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-building-2-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-building-2-16@2x.png
deleted file mode 100644
index 811ac2b60b..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-building-2-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-building-3-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-building-3-16.png
deleted file mode 100644
index fac4715fe2..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-building-3-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-building-3-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-building-3-16@2x.png
deleted file mode 100644
index 4cbf2b33b9..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-building-3-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-building-4-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-building-4-16.png
deleted file mode 100644
index 61d8a58aab..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-building-4-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-building-4-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-building-4-16@2x.png
deleted file mode 100644
index 2c2c5a8c1f..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-building-4-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-building-5-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-building-5-16.png
deleted file mode 100644
index 547dc0cfcd..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-building-5-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-building-5-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-building-5-16@2x.png
deleted file mode 100644
index 03da6159e3..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-building-5-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-1-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-1-16.png
deleted file mode 100644
index 45f37bf4ff..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-1-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-1-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-1-16@2x.png
deleted file mode 100644
index c65cd992ef..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-1-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-2-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-2-16.png
deleted file mode 100644
index 04995742ec..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-2-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-2-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-2-16@2x.png
deleted file mode 100644
index 42aa33a05e..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-2-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-3-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-3-16.png
deleted file mode 100644
index a9b2d1fe14..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-3-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-3-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-3-16@2x.png
deleted file mode 100644
index 09f51895a8..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-3-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-4-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-4-16.png
deleted file mode 100644
index 2375253ba9..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-4-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-4-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-4-16@2x.png
deleted file mode 100644
index 40b39d8b82..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-4-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-5-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-5-16.png
deleted file mode 100644
index 7564cdb511..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-5-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-5-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-5-16@2x.png
deleted file mode 100644
index 29eaa5b83f..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-5-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-6-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-6-16.png
deleted file mode 100644
index 4b26c3cbea..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-6-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-6-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-6-16@2x.png
deleted file mode 100644
index 14358643a3..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-connecting-6-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-error-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-error-16.png
deleted file mode 100644
index ea632d5fcb..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-error-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-error-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-error-16@2x.png
deleted file mode 100644
index 5fbd3dde4d..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-error-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-error-count-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-error-count-16.png
deleted file mode 100644
index 4a4c3adee3..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-error-count-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-error-count-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-error-count-16@2x.png
deleted file mode 100644
index 9623784f39..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-error-count-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-1-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-1-16.png
deleted file mode 100644
index 8fab4fa1ba..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-1-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-1-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-1-16@2x.png
deleted file mode 100644
index 092cc547dd..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-1-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-2-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-2-16.png
deleted file mode 100644
index e5005a1af1..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-2-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-2-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-2-16@2x.png
deleted file mode 100644
index 2d09645ba6..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-2-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-3-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-3-16.png
deleted file mode 100644
index 53f30de577..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-3-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-3-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-3-16@2x.png
deleted file mode 100644
index 3a979f157c..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-3-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-4-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-4-16.png
deleted file mode 100644
index 8b514d62f6..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-4-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-4-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-4-16@2x.png
deleted file mode 100644
index 2a21738802..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-4-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-5-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-5-16.png
deleted file mode 100644
index 0ec801254d..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-5-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-5-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-5-16@2x.png
deleted file mode 100644
index 40ede43e79..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-5-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-6-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-6-16.png
deleted file mode 100644
index 0ec801254d..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-6-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-6-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-6-16@2x.png
deleted file mode 100644
index eb5c7c4adc..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-opening-6-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-parsing-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-parsing-16.png
deleted file mode 100644
index e05d77a4c0..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-parsing-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-parsing-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-parsing-16@2x.png
deleted file mode 100644
index 7d492e434f..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-parsing-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-1-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-1-16.png
deleted file mode 100644
index 77fba962cb..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-1-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-1-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-1-16@2x.png
deleted file mode 100644
index 67ddbb74c8..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-1-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-2-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-2-16.png
deleted file mode 100644
index 82a0697e90..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-2-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-2-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-2-16@2x.png
deleted file mode 100644
index a2e57dbdc2..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-2-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-3-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-3-16.png
deleted file mode 100644
index 524efec497..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-3-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-3-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-3-16@2x.png
deleted file mode 100644
index 0b8aea2dfa..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-3-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-4-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-4-16.png
deleted file mode 100644
index 1d95a7becd..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-4-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-4-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-4-16@2x.png
deleted file mode 100644
index b11b9080c5..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-4-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-5-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-5-16.png
deleted file mode 100644
index 0a48211049..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-5-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-5-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-5-16@2x.png
deleted file mode 100644
index e979f85e05..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-5-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-6-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-6-16.png
deleted file mode 100644
index 3a0d47aee2..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-6-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-6-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-6-16@2x.png
deleted file mode 100644
index 17ab669215..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pulling-6-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-1-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-1-16.png
deleted file mode 100644
index 6d178e3efa..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-1-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-1-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-1-16@2x.png
deleted file mode 100644
index a3ccfa41bd..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-1-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-2-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-2-16.png
deleted file mode 100644
index acc8321abb..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-2-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-2-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-2-16@2x.png
deleted file mode 100644
index cb2d459e32..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-2-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-3-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-3-16.png
deleted file mode 100644
index 5ba6d34aca..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-3-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-3-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-3-16@2x.png
deleted file mode 100644
index f7ae869b34..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-3-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-4-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-4-16.png
deleted file mode 100644
index 8a357cdfb2..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-4-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-4-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-4-16@2x.png
deleted file mode 100644
index c0965d3989..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-4-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-5-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-5-16.png
deleted file mode 100644
index 7a974f18aa..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-5-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-5-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-5-16@2x.png
deleted file mode 100644
index 0a2945e01a..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-5-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-6-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-6-16.png
deleted file mode 100644
index 576d89fbd5..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-6-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-6-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-6-16@2x.png
deleted file mode 100644
index bc2c8c16ef..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-pushing-6-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-ready-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-ready-16.png
deleted file mode 100644
index 04b2716a49..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-ready-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-ready-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-ready-16@2x.png
deleted file mode 100644
index 7feb6bc0bd..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-ready-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-1-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-1-16.png
deleted file mode 100644
index bc40ce77ae..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-1-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-1-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-1-16@2x.png
deleted file mode 100644
index a19aa1ff54..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-1-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-2-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-2-16.png
deleted file mode 100644
index 25b8496839..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-2-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-2-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-2-16@2x.png
deleted file mode 100644
index 9b80f3607a..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-2-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-3-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-3-16.png
deleted file mode 100644
index 67ed69839c..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-3-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-3-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-3-16@2x.png
deleted file mode 100644
index 8831b8e26a..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-3-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-4-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-4-16.png
deleted file mode 100644
index 67ed69839c..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-4-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-4-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-4-16@2x.png
deleted file mode 100644
index 8dffd2513f..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-searching-4-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-success-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-success-16.png
deleted file mode 100644
index 975f275d69..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-success-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-success-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-success-16@2x.png
deleted file mode 100644
index 14f13da104..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-success-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-1-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-1-16.png
deleted file mode 100644
index 447e6fa8f9..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-1-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-1-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-1-16@2x.png
deleted file mode 100644
index 254cd96138..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-1-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-2-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-2-16.png
deleted file mode 100644
index ef539a4251..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-2-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-2-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-2-16@2x.png
deleted file mode 100644
index 21dc539c68..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-2-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-3-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-3-16.png
deleted file mode 100644
index db3a4311e8..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-3-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-3-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-3-16@2x.png
deleted file mode 100644
index bf9c182ef9..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-3-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-4-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-4-16.png
deleted file mode 100644
index b5de8fd925..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-4-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-4-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-4-16@2x.png
deleted file mode 100644
index e3b0e2c184..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-4-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-5-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-5-16.png
deleted file mode 100644
index 5d8d062f66..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-5-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-5-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-5-16@2x.png
deleted file mode 100644
index beb37df09c..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-5-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-6-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-6-16.png
deleted file mode 100644
index f48e288c6d..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-6-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-6-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-6-16@2x.png
deleted file mode 100644
index 3c0fc1eca3..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-6-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-paused-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-paused-16.png
deleted file mode 100644
index 916e656ab5..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-paused-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-paused-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-paused-16@2x.png
deleted file mode 100644
index 999d50106f..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-paused-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-ready-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-ready-16.png
deleted file mode 100644
index 447e6fa8f9..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-ready-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-ready-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-ready-16@2x.png
deleted file mode 100644
index 254cd96138..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-ready-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-1-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-1-16.png
deleted file mode 100644
index 230c52e0e0..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-1-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-1-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-1-16@2x.png
deleted file mode 100644
index 51053381ed..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-1-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-2-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-2-16.png
deleted file mode 100644
index 55a46a59d4..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-2-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-2-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-2-16@2x.png
deleted file mode 100644
index 376bb83e1e..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-2-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-3-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-3-16.png
deleted file mode 100644
index 217d819c8a..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-3-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-3-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-3-16@2x.png
deleted file mode 100644
index 76904d0785..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-3-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-4-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-4-16.png
deleted file mode 100644
index b49a1404b5..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-4-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-4-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-4-16@2x.png
deleted file mode 100644
index e6175c70d7..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-4-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-5-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-5-16.png
deleted file mode 100644
index 69f9012f3b..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-5-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-5-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-5-16@2x.png
deleted file mode 100644
index a490ba2791..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-waiting-5-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-warning-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-warning-16.png
deleted file mode 100644
index 11d705ea81..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-warning-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-warning-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-warning-16@2x.png
deleted file mode 100644
index c8d6e2e0cb..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-warning-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-warning-count-16.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-warning-count-16.png
deleted file mode 100644
index 205f29f277..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-warning-count-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-warning-count-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/mac/status-warning-count-16@2x.png
deleted file mode 100644
index ba0bc0a5e1..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-warning-count-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/media-play-16.png b/main/src/core/MonoDevelop.Ide/icons/media-play-16.png
deleted file mode 100644
index 7b5e2a5b1f..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/media-play-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/media-play-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/media-play-16@2x.png
deleted file mode 100644
index 4e2eaf097d..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/media-play-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/missing-image-16.png b/main/src/core/MonoDevelop.Ide/icons/missing-image-16.png
index bf13fbba53..06c6c11db8 100644
--- a/main/src/core/MonoDevelop.Ide/icons/missing-image-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/missing-image-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/missing-image-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/missing-image-16@2x.png
index 71dba1ed78..f207ccc0ed 100644
--- a/main/src/core/MonoDevelop.Ide/icons/missing-image-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/missing-image-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/missing-image-32.png b/main/src/core/MonoDevelop.Ide/icons/missing-image-32.png
new file mode 100644
index 0000000000..f207ccc0ed
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/missing-image-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/missing-image-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/missing-image-32@2x.png
new file mode 100644
index 0000000000..4d6cc8cd67
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/missing-image-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/missing-image-48.png b/main/src/core/MonoDevelop.Ide/icons/missing-image-48.png
new file mode 100644
index 0000000000..347fc57063
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/missing-image-48.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/missing-image-48@2x.png b/main/src/core/MonoDevelop.Ide/icons/missing-image-48@2x.png
new file mode 100644
index 0000000000..60f7c3b8a8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/missing-image-48@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/navigate-next-16.png b/main/src/core/MonoDevelop.Ide/icons/navigate-next-16.png
deleted file mode 100644
index ea295320f3..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/navigate-next-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/navigate-previous-16.png b/main/src/core/MonoDevelop.Ide/icons/navigate-previous-16.png
deleted file mode 100644
index d00ac807f2..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/navigate-previous-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-folder-16.png b/main/src/core/MonoDevelop.Ide/icons/new-folder-16.png
new file mode 100644
index 0000000000..e78339cecd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-folder-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-folder-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/new-folder-16@2x.png
new file mode 100644
index 0000000000..d5253f2868
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-folder-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-folder-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/new-folder-16~dark.png
new file mode 100644
index 0000000000..6419dcc00c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-folder-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-folder-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/new-folder-16~dark@2x.png
new file mode 100644
index 0000000000..1a204198aa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-folder-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-namespace-16.png b/main/src/core/MonoDevelop.Ide/icons/new-namespace-16.png
new file mode 100644
index 0000000000..7255aa8490
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-namespace-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-namespace-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/new-namespace-16@2x.png
new file mode 100644
index 0000000000..7509eb46ac
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-namespace-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-namespace-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/new-namespace-16~dark.png
new file mode 100644
index 0000000000..7351d826df
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-namespace-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-namespace-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/new-namespace-16~dark@2x.png
new file mode 100644
index 0000000000..1aab895d4b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-namespace-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-project-16.png b/main/src/core/MonoDevelop.Ide/icons/new-project-16.png
new file mode 100644
index 0000000000..3863a89871
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-project-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-project-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/new-project-16@2x.png
new file mode 100644
index 0000000000..a4595f8573
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-project-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-project-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/new-project-16~dark.png
new file mode 100644
index 0000000000..307e595675
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-project-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-project-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/new-project-16~dark@2x.png
new file mode 100644
index 0000000000..09b88d6a85
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-project-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-solution-16.png b/main/src/core/MonoDevelop.Ide/icons/new-solution-16.png
new file mode 100644
index 0000000000..4862aff2cc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-solution-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-solution-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/new-solution-16@2x.png
new file mode 100644
index 0000000000..81955bbbe0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-solution-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-solution-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/new-solution-16~dark.png
new file mode 100644
index 0000000000..4580ec2f94
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-solution-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-solution-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/new-solution-16~dark@2x.png
new file mode 100644
index 0000000000..6c5c7410ef
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-solution-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-solution-folder-16.png b/main/src/core/MonoDevelop.Ide/icons/new-solution-folder-16.png
new file mode 100644
index 0000000000..d0b5f6fa1f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-solution-folder-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-solution-folder-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/new-solution-folder-16@2x.png
new file mode 100644
index 0000000000..1a1d790783
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-solution-folder-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-solution-folder-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/new-solution-folder-16~dark.png
new file mode 100644
index 0000000000..8860f24280
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-solution-folder-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-solution-folder-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/new-solution-folder-16~dark@2x.png
new file mode 100644
index 0000000000..51909579f2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-solution-folder-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-workspace-16.png b/main/src/core/MonoDevelop.Ide/icons/new-workspace-16.png
new file mode 100644
index 0000000000..3cee932ce3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-workspace-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-workspace-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/new-workspace-16@2x.png
new file mode 100644
index 0000000000..fca97a0ac5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-workspace-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-workspace-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/new-workspace-16~dark.png
new file mode 100644
index 0000000000..8f577f51b3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-workspace-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/new-workspace-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/new-workspace-16~dark@2x.png
new file mode 100644
index 0000000000..b98c1f2a43
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/new-workspace-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/open-16.png b/main/src/core/MonoDevelop.Ide/icons/open-16.png
index fbb0cec986..4a533eb68b 100644
--- a/main/src/core/MonoDevelop.Ide/icons/open-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/open-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/open-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/open-16@2x.png
new file mode 100644
index 0000000000..8bd29c5329
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/open-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/open-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/open-16~dark.png
new file mode 100644
index 0000000000..bf44fd7264
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/open-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/open-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/open-16~dark@2x.png
new file mode 100644
index 0000000000..3fb2437a17
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/open-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-16.png b/main/src/core/MonoDevelop.Ide/icons/package-16.png
index be53353283..8519a6420d 100644
--- a/main/src/core/MonoDevelop.Ide/icons/package-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/package-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/package-16@2x.png
index 6f21d7aa77..9708a1eded 100644
--- a/main/src/core/MonoDevelop.Ide/icons/package-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/package-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/package-16~dark.png
new file mode 100644
index 0000000000..25d4814e13
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/package-16~dark@2x.png
new file mode 100644
index 0000000000..6b099dbfbc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/package-16~dark~sel.png
new file mode 100644
index 0000000000..9eeaade789
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/package-16~dark~sel@2x.png
new file mode 100644
index 0000000000..e58ff00899
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/package-16~sel.png
new file mode 100644
index 0000000000..9eeaade789
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/package-16~sel@2x.png
new file mode 100644
index 0000000000..e58ff00899
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-24.png b/main/src/core/MonoDevelop.Ide/icons/package-24.png
index 0e2e9604a4..073227d02c 100644
--- a/main/src/core/MonoDevelop.Ide/icons/package-24.png
+++ b/main/src/core/MonoDevelop.Ide/icons/package-24.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-24@2x.png b/main/src/core/MonoDevelop.Ide/icons/package-24@2x.png
index 81a5324fce..6dbcbea034 100644
--- a/main/src/core/MonoDevelop.Ide/icons/package-24@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/package-24@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-24~dark.png b/main/src/core/MonoDevelop.Ide/icons/package-24~dark.png
new file mode 100644
index 0000000000..c5f8cd9ba5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-24~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-24~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/package-24~dark@2x.png
new file mode 100644
index 0000000000..2fb74b25c1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-24~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-24~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/package-24~dark~sel.png
new file mode 100644
index 0000000000..8c10f8e492
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-24~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-24~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/package-24~dark~sel@2x.png
new file mode 100644
index 0000000000..7fec138598
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-24~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-24~sel.png b/main/src/core/MonoDevelop.Ide/icons/package-24~sel.png
new file mode 100644
index 0000000000..8c10f8e492
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-24~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-24~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/package-24~sel@2x.png
new file mode 100644
index 0000000000..7fec138598
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-24~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-32.png b/main/src/core/MonoDevelop.Ide/icons/package-32.png
index 6f21d7aa77..9708a1eded 100644
--- a/main/src/core/MonoDevelop.Ide/icons/package-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/package-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/package-32@2x.png
index 8b687efa3d..56b0c40ada 100644
--- a/main/src/core/MonoDevelop.Ide/icons/package-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/package-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/package-32~dark.png
new file mode 100644
index 0000000000..6b099dbfbc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/package-32~dark@2x.png
new file mode 100644
index 0000000000..70b6d95f29
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/package-32~dark~sel.png
new file mode 100644
index 0000000000..e58ff00899
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/package-32~dark~sel@2x.png
new file mode 100644
index 0000000000..ddb889f387
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/package-32~sel.png
new file mode 100644
index 0000000000..e58ff00899
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/package-32~sel@2x.png
new file mode 100644
index 0000000000..ddb889f387
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-48.png b/main/src/core/MonoDevelop.Ide/icons/package-48.png
index 81a5324fce..6dbcbea034 100644
--- a/main/src/core/MonoDevelop.Ide/icons/package-48.png
+++ b/main/src/core/MonoDevelop.Ide/icons/package-48.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-48@2x.png b/main/src/core/MonoDevelop.Ide/icons/package-48@2x.png
index 3862bac535..0484944163 100644
--- a/main/src/core/MonoDevelop.Ide/icons/package-48@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/package-48@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-48~dark.png b/main/src/core/MonoDevelop.Ide/icons/package-48~dark.png
new file mode 100644
index 0000000000..2fb74b25c1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-48~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-48~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/package-48~dark@2x.png
new file mode 100644
index 0000000000..07520b847c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-48~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-48~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/package-48~dark~sel.png
new file mode 100644
index 0000000000..7fec138598
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-48~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-48~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/package-48~dark~sel@2x.png
new file mode 100644
index 0000000000..e134ffbf43
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-48~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-48~sel.png b/main/src/core/MonoDevelop.Ide/icons/package-48~sel.png
new file mode 100644
index 0000000000..7fec138598
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-48~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-48~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/package-48~sel@2x.png
new file mode 100644
index 0000000000..e134ffbf43
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-48~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-source-16.png b/main/src/core/MonoDevelop.Ide/icons/package-source-16.png
index c01c3f5eb0..9850050463 100644
--- a/main/src/core/MonoDevelop.Ide/icons/package-source-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/package-source-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-source-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/package-source-16@2x.png
index 7e19f0f3b1..7aef0ee9bd 100644
--- a/main/src/core/MonoDevelop.Ide/icons/package-source-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/package-source-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-source-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/package-source-16~dark.png
new file mode 100644
index 0000000000..593d3a8b96
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-source-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-source-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/package-source-16~dark@2x.png
new file mode 100644
index 0000000000..e94c8ac213
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-source-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-source-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/package-source-16~dark~sel.png
new file mode 100644
index 0000000000..e3aee767a7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-source-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-source-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/package-source-16~dark~sel@2x.png
new file mode 100644
index 0000000000..28260cb4c2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-source-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-source-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/package-source-16~sel.png
new file mode 100644
index 0000000000..e3aee767a7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-source-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/package-source-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/package-source-16~sel@2x.png
new file mode 100644
index 0000000000..28260cb4c2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/package-source-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16.png b/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16.png
index 05d62b949f..7678a94b0a 100644
--- a/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16@2x.png
index e1791a2341..8acc4b1279 100644
--- a/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~dark.png
new file mode 100644
index 0000000000..a85230475b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~dark@2x.png
new file mode 100644
index 0000000000..12727393d6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~dark~sel.png
new file mode 100644
index 0000000000..f9ff247739
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~dark~sel@2x.png
new file mode 100644
index 0000000000..4113d8b83f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~sel.png
new file mode 100644
index 0000000000..e03961d11e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~sel@2x.png
new file mode 100644
index 0000000000..051da63ace
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-application-output-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-classes-16.png b/main/src/core/MonoDevelop.Ide/icons/pad-classes-16.png
new file mode 100644
index 0000000000..1d61a2dc11
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-classes-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-classes-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-classes-16@2x.png
new file mode 100644
index 0000000000..89a18c73ab
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-classes-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-classes-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/pad-classes-16~dark.png
new file mode 100644
index 0000000000..d095ccc5ba
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-classes-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-classes-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-classes-16~dark@2x.png
new file mode 100644
index 0000000000..5ff24b996a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-classes-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-classes-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-classes-16~dark~sel.png
new file mode 100644
index 0000000000..905f7e31c9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-classes-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-classes-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-classes-16~dark~sel@2x.png
new file mode 100644
index 0000000000..302cf6177e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-classes-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-classes-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-classes-16~sel.png
new file mode 100644
index 0000000000..905f7e31c9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-classes-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-classes-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-classes-16~sel@2x.png
new file mode 100644
index 0000000000..302cf6177e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-classes-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16.png
index 9aca71b41e..a04d781670 100644
--- a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16@2x.png
index 35ca144f90..99b7ff33fd 100644
--- a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~dark.png
new file mode 100644
index 0000000000..c2b7099889
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~dark@2x.png
new file mode 100644
index 0000000000..cce33fdaf2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~dark~sel.png
new file mode 100644
index 0000000000..88d9ed9924
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~dark~sel@2x.png
new file mode 100644
index 0000000000..30f3c11358
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~sel.png
new file mode 100644
index 0000000000..88d9ed9924
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~sel@2x.png
new file mode 100644
index 0000000000..30f3c11358
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16.png
index bf74a28182..69db0133df 100644
--- a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16@2x.png
index d7b6f5c971..473dfb3084 100644
--- a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark.png
new file mode 100644
index 0000000000..bed2fd1472
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark@2x.png
new file mode 100644
index 0000000000..cd21732d4c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark~disabled.png
new file mode 100644
index 0000000000..c2b7099889
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..cce33fdaf2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark~sel.png
new file mode 100644
index 0000000000..88d9ed9924
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark~sel@2x.png
new file mode 100644
index 0000000000..30f3c11358
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~disabled.png
new file mode 100644
index 0000000000..a04d781670
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~disabled@2x.png
new file mode 100644
index 0000000000..99b7ff33fd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~sel.png
new file mode 100644
index 0000000000..88d9ed9924
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~sel@2x.png
new file mode 100644
index 0000000000..30f3c11358
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-errors-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16.png
index d7674e20a1..6d1c250bee 100644
--- a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16@2x.png
index 2b20e60100..6dfe066165 100644
--- a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark.png
new file mode 100644
index 0000000000..5da3b1e8fc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark@2x.png
new file mode 100644
index 0000000000..cb8065913d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark~disabled.png
new file mode 100644
index 0000000000..5da3b1e8fc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..cb8065913d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark~sel.png
new file mode 100644
index 0000000000..b4345ae86d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark~sel@2x.png
new file mode 100644
index 0000000000..c0e74510a1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~disabled.png
new file mode 100644
index 0000000000..6d1c250bee
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~disabled@2x.png
new file mode 100644
index 0000000000..6dfe066165
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~sel.png
new file mode 100644
index 0000000000..b4345ae86d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~sel@2x.png
new file mode 100644
index 0000000000..c0e74510a1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-error-list-warnings-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-generic-16.png b/main/src/core/MonoDevelop.Ide/icons/pad-generic-16.png
new file mode 100644
index 0000000000..d861ac549a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-generic-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-generic-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-generic-16@2x.png
new file mode 100644
index 0000000000..04481de38c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-generic-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-generic-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/pad-generic-16~dark.png
new file mode 100644
index 0000000000..1d52c8c329
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-generic-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-generic-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-generic-16~dark@2x.png
new file mode 100644
index 0000000000..efcfcaf1c4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-generic-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-generic-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-generic-16~dark~sel.png
new file mode 100644
index 0000000000..dcd681705c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-generic-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-generic-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-generic-16~dark~sel@2x.png
new file mode 100644
index 0000000000..1065f945af
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-generic-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-generic-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-generic-16~sel.png
new file mode 100644
index 0000000000..dcd681705c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-generic-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-generic-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-generic-16~sel@2x.png
new file mode 100644
index 0000000000..1065f945af
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-generic-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-generic-pad-16.png b/main/src/core/MonoDevelop.Ide/icons/pad-generic-pad-16.png
deleted file mode 100644
index f6ea553b71..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/pad-generic-pad-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-generic-pad-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-generic-pad-16@2x.png
deleted file mode 100644
index 9e89538098..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/pad-generic-pad-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-help-16.png b/main/src/core/MonoDevelop.Ide/icons/pad-help-16.png
index af99ef09df..640566bb05 100644
--- a/main/src/core/MonoDevelop.Ide/icons/pad-help-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-help-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-help-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-help-16@2x.png
index 923d626671..882bdd164e 100644
--- a/main/src/core/MonoDevelop.Ide/icons/pad-help-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-help-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-help-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/pad-help-16~dark.png
new file mode 100644
index 0000000000..53a07a3c62
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-help-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-help-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-help-16~dark@2x.png
new file mode 100644
index 0000000000..5f6496ed8f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-help-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-help-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-help-16~dark~sel.png
new file mode 100644
index 0000000000..eca72a347b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-help-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-help-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-help-16~dark~sel@2x.png
new file mode 100644
index 0000000000..b1dcd6e7f0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-help-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-help-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-help-16~sel.png
new file mode 100644
index 0000000000..eca72a347b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-help-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-help-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-help-16~sel@2x.png
new file mode 100644
index 0000000000..b1dcd6e7f0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-help-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16.png b/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16.png
index 73668287fb..7678a94b0a 100644
--- a/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16@2x.png
index 3fb43534d5..8acc4b1279 100644
--- a/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~dark.png
new file mode 100644
index 0000000000..a85230475b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~dark@2x.png
new file mode 100644
index 0000000000..12727393d6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~dark~sel.png
new file mode 100644
index 0000000000..f9ff247739
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~dark~sel@2x.png
new file mode 100644
index 0000000000..4113d8b83f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~sel.png
new file mode 100644
index 0000000000..e03961d11e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~sel@2x.png
new file mode 100644
index 0000000000..051da63ace
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-immediate-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-search-16.png b/main/src/core/MonoDevelop.Ide/icons/pad-search-16.png
new file mode 100644
index 0000000000..c6e794702f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-search-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-search-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-search-16@2x.png
new file mode 100644
index 0000000000..c1f12aa259
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-search-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-search-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/pad-search-16~dark.png
new file mode 100644
index 0000000000..c3b71cfc5a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-search-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-search-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-search-16~dark@2x.png
new file mode 100644
index 0000000000..8aa943236d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-search-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-search-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-search-16~dark~sel.png
new file mode 100644
index 0000000000..3ad5af973d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-search-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-search-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-search-16~dark~sel@2x.png
new file mode 100644
index 0000000000..f2fcea39ca
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-search-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-search-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-search-16~sel.png
new file mode 100644
index 0000000000..3ad5af973d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-search-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-search-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-search-16~sel@2x.png
new file mode 100644
index 0000000000..f2fcea39ca
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-search-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-search-results-16.png b/main/src/core/MonoDevelop.Ide/icons/pad-search-results-16.png
deleted file mode 100644
index 85e5d0df07..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/pad-search-results-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-search-results-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-search-results-16@2x.png
deleted file mode 100644
index f53fae3769..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/pad-search-results-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-solution-16.png b/main/src/core/MonoDevelop.Ide/icons/pad-solution-16.png
new file mode 100644
index 0000000000..4862aff2cc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-solution-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-solution-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-solution-16@2x.png
new file mode 100644
index 0000000000..fa2f04788a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-solution-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-solution-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/pad-solution-16~dark.png
new file mode 100644
index 0000000000..4580ec2f94
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-solution-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-solution-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-solution-16~dark@2x.png
new file mode 100644
index 0000000000..24e2e19986
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-solution-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-solution-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-solution-16~dark~sel.png
new file mode 100644
index 0000000000..fac7faa890
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-solution-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-solution-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-solution-16~dark~sel@2x.png
new file mode 100644
index 0000000000..3469d279a6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-solution-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-solution-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-solution-16~sel.png
new file mode 100644
index 0000000000..fac7faa890
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-solution-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-solution-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-solution-16~sel@2x.png
new file mode 100644
index 0000000000..3469d279a6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-solution-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16.png b/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16.png
index e2b6ca1f54..35cd8c401f 100644
--- a/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16@2x.png
index 571b8d5d6e..42d87a3f4e 100644
--- a/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~dark.png
new file mode 100644
index 0000000000..ca7ef09e9a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~dark@2x.png
new file mode 100644
index 0000000000..d005245783
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~dark~sel.png
new file mode 100644
index 0000000000..6386ee383e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~dark~sel@2x.png
new file mode 100644
index 0000000000..a237744db8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~sel.png
new file mode 100644
index 0000000000..6386ee383e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~sel@2x.png
new file mode 100644
index 0000000000..a237744db8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pad-task-list-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/parser-16.png b/main/src/core/MonoDevelop.Ide/icons/parser-16.png
index 9ab8e516c4..4525824d1c 100644
--- a/main/src/core/MonoDevelop.Ide/icons/parser-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/parser-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/parser-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/parser-16@2x.png
index 5ca687b93d..07960aec3d 100644
--- a/main/src/core/MonoDevelop.Ide/icons/parser-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/parser-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/parser-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/parser-16~dark.png
new file mode 100644
index 0000000000..5f968710da
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/parser-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/parser-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/parser-16~dark@2x.png
new file mode 100644
index 0000000000..8ca627e7bf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/parser-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/parser-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/parser-16~dark~sel.png
new file mode 100644
index 0000000000..c077a84bc2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/parser-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/parser-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/parser-16~dark~sel@2x.png
new file mode 100644
index 0000000000..67177d974f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/parser-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/parser-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/parser-16~sel.png
new file mode 100644
index 0000000000..c077a84bc2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/parser-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/parser-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/parser-16~sel@2x.png
new file mode 100644
index 0000000000..67177d974f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/parser-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/paste-16.png b/main/src/core/MonoDevelop.Ide/icons/paste-16.png
new file mode 100644
index 0000000000..6a99fc60c0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/paste-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/paste-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/paste-16@2x.png
new file mode 100644
index 0000000000..ab525b89a2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/paste-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/paste-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/paste-16~dark.png
new file mode 100644
index 0000000000..22c5d93ffd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/paste-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/paste-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/paste-16~dark@2x.png
new file mode 100644
index 0000000000..df8a2b8267
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/paste-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-down-16.png b/main/src/core/MonoDevelop.Ide/icons/pin-down-16.png
index ed29a7a661..393afc2654 100644
--- a/main/src/core/MonoDevelop.Ide/icons/pin-down-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-down-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-down-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/pin-down-16@2x.png
index ddc041921f..c95d06a0a4 100644
--- a/main/src/core/MonoDevelop.Ide/icons/pin-down-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-down-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark.png
new file mode 100644
index 0000000000..74cfe2707f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark@2x.png
new file mode 100644
index 0000000000..f89c95c59d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark~disabled.png
new file mode 100644
index 0000000000..a64f14485c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..bf46987f2f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark~sel.png
new file mode 100644
index 0000000000..d0635f325d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark~sel@2x.png
new file mode 100644
index 0000000000..92e2847a9d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-down-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-down-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/pin-down-16~disabled.png
new file mode 100644
index 0000000000..e359f7a757
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-down-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-down-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/pin-down-16~disabled@2x.png
new file mode 100644
index 0000000000..f85039f95b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-down-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-down-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/pin-down-16~sel.png
new file mode 100644
index 0000000000..d0635f325d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-down-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-down-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pin-down-16~sel@2x.png
new file mode 100644
index 0000000000..92e2847a9d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-down-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-up-16.png b/main/src/core/MonoDevelop.Ide/icons/pin-up-16.png
index 564abe3c74..f8dc71e02f 100644
--- a/main/src/core/MonoDevelop.Ide/icons/pin-up-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-up-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-up-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/pin-up-16@2x.png
index 9f616764df..a75ed1a543 100644
--- a/main/src/core/MonoDevelop.Ide/icons/pin-up-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-up-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark.png
new file mode 100644
index 0000000000..17aaa37cff
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark@2x.png
new file mode 100644
index 0000000000..796511ce04
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark~disabled.png
new file mode 100644
index 0000000000..6167ae9f76
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..9b20dddbd3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark~sel.png
new file mode 100644
index 0000000000..25647dd012
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark~sel@2x.png
new file mode 100644
index 0000000000..bcb57a87b8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-up-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-up-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/pin-up-16~disabled.png
new file mode 100644
index 0000000000..0f0de21161
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-up-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-up-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/pin-up-16~disabled@2x.png
new file mode 100644
index 0000000000..897aaec82f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-up-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-up-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/pin-up-16~sel.png
new file mode 100644
index 0000000000..25647dd012
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-up-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/pin-up-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/pin-up-16~sel@2x.png
new file mode 100644
index 0000000000..bcb57a87b8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/pin-up-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-android-16.png b/main/src/core/MonoDevelop.Ide/icons/platform-android-16.png
index 0a8d08efba..e4b5e92e10 100644
--- a/main/src/core/MonoDevelop.Ide/icons/platform-android-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-android-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-android-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-android-16@2x.png
index e8e7f7ff31..c3f23628a1 100644
--- a/main/src/core/MonoDevelop.Ide/icons/platform-android-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-android-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-android-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/platform-android-16~dark.png
new file mode 100644
index 0000000000..f335e871b5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-android-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-android-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-android-16~dark@2x.png
new file mode 100644
index 0000000000..287a30da57
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-android-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-android-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/platform-android-16~dark~sel.png
new file mode 100644
index 0000000000..4df8fac976
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-android-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-android-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-android-16~dark~sel@2x.png
new file mode 100644
index 0000000000..687f8aa50f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-android-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-android-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/platform-android-16~sel.png
new file mode 100644
index 0000000000..4df8fac976
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-android-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-android-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-android-16~sel@2x.png
new file mode 100644
index 0000000000..687f8aa50f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-android-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-cross-platform-16.png b/main/src/core/MonoDevelop.Ide/icons/platform-cross-platform-16.png
deleted file mode 100644
index c108092880..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/platform-cross-platform-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-cross-platform-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-cross-platform-16@2x.png
deleted file mode 100644
index 7554a97a02..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/platform-cross-platform-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16.png b/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16.png
new file mode 100644
index 0000000000..ce7a3b59ed
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16@2x.png
new file mode 100644
index 0000000000..8c23666827
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~dark.png
new file mode 100644
index 0000000000..2e7b146bb6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~dark@2x.png
new file mode 100644
index 0000000000..344317c016
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~dark~sel.png
new file mode 100644
index 0000000000..fa6de7105f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~dark~sel@2x.png
new file mode 100644
index 0000000000..5d127e3fca
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~sel.png
new file mode 100644
index 0000000000..fa6de7105f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~sel@2x.png
new file mode 100644
index 0000000000..5d127e3fca
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-crossplatform-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-ios-16.png b/main/src/core/MonoDevelop.Ide/icons/platform-ios-16.png
index 3859a9c5d1..9dc49511ab 100644
--- a/main/src/core/MonoDevelop.Ide/icons/platform-ios-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-ios-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-ios-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-ios-16@2x.png
index e262d04e46..71f00883c6 100644
--- a/main/src/core/MonoDevelop.Ide/icons/platform-ios-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-ios-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-ios-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/platform-ios-16~dark.png
new file mode 100644
index 0000000000..06c16c60d3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-ios-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-ios-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-ios-16~dark@2x.png
new file mode 100644
index 0000000000..5d885f9a5c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-ios-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-ios-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/platform-ios-16~dark~sel.png
new file mode 100644
index 0000000000..6e821835e8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-ios-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-ios-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-ios-16~dark~sel@2x.png
new file mode 100644
index 0000000000..339c7e8e8f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-ios-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-ios-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/platform-ios-16~sel.png
new file mode 100644
index 0000000000..5740257c6b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-ios-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-ios-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-ios-16~sel@2x.png
new file mode 100644
index 0000000000..a6b22baa39
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-ios-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-mac-16.png b/main/src/core/MonoDevelop.Ide/icons/platform-mac-16.png
index 1d61d09bcd..9ef67b0f0e 100644
--- a/main/src/core/MonoDevelop.Ide/icons/platform-mac-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-mac-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-mac-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-mac-16@2x.png
index dca40f8bc2..9ed89c9ffe 100644
--- a/main/src/core/MonoDevelop.Ide/icons/platform-mac-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-mac-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-mac-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/platform-mac-16~dark.png
new file mode 100644
index 0000000000..ecc6f08a6d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-mac-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-mac-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-mac-16~dark@2x.png
new file mode 100644
index 0000000000..78cd12c56b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-mac-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-mac-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/platform-mac-16~dark~sel.png
new file mode 100644
index 0000000000..8ae189920b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-mac-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-mac-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-mac-16~dark~sel@2x.png
new file mode 100644
index 0000000000..df2bef21c9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-mac-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-mac-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/platform-mac-16~sel.png
new file mode 100644
index 0000000000..8ae189920b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-mac-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-mac-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-mac-16~sel@2x.png
new file mode 100644
index 0000000000..df2bef21c9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-mac-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-other-16.png b/main/src/core/MonoDevelop.Ide/icons/platform-other-16.png
index 324914455e..a59eab115f 100644
--- a/main/src/core/MonoDevelop.Ide/icons/platform-other-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-other-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-other-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-other-16@2x.png
index 4d4e199da6..1c9f485642 100644
--- a/main/src/core/MonoDevelop.Ide/icons/platform-other-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-other-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-other-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/platform-other-16~dark.png
new file mode 100644
index 0000000000..b458f83d38
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-other-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-other-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-other-16~dark@2x.png
new file mode 100644
index 0000000000..33fb312679
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-other-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-other-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/platform-other-16~dark~sel.png
new file mode 100644
index 0000000000..89c9aa8e45
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-other-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-other-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-other-16~dark~sel@2x.png
new file mode 100644
index 0000000000..ae628d9365
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-other-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-other-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/platform-other-16~sel.png
new file mode 100644
index 0000000000..89c9aa8e45
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-other-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-other-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-other-16~sel@2x.png
new file mode 100644
index 0000000000..ae628d9365
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-other-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16.png b/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16.png
new file mode 100644
index 0000000000..d526a4ea14
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16@2x.png
new file mode 100644
index 0000000000..85d499e3d7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~dark.png
new file mode 100644
index 0000000000..60943e0e60
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~dark@2x.png
new file mode 100644
index 0000000000..ed32d0c3c5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~dark~sel.png
new file mode 100644
index 0000000000..633e4cbfe0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~dark~sel@2x.png
new file mode 100644
index 0000000000..3dcf926030
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~sel.png
new file mode 100644
index 0000000000..633e4cbfe0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~sel@2x.png
new file mode 100644
index 0000000000..3dcf926030
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-tvos-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16.png b/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16.png
new file mode 100644
index 0000000000..6069374409
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16@2x.png
new file mode 100644
index 0000000000..911151ef6b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~dark.png
new file mode 100644
index 0000000000..9d5f701786
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~dark@2x.png
new file mode 100644
index 0000000000..02d6a11c64
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~dark~sel.png
new file mode 100644
index 0000000000..615638b0c0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~dark~sel@2x.png
new file mode 100644
index 0000000000..83261cce64
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~sel.png
new file mode 100644
index 0000000000..82edc41979
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~sel@2x.png
new file mode 100644
index 0000000000..1d24fb4b62
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/platform-watchos-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/plugin-menu-16.png b/main/src/core/MonoDevelop.Ide/icons/plugin-menu-16.png
new file mode 100644
index 0000000000..ea98899a86
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/plugin-menu-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/plugin-menu-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/plugin-menu-16@2x.png
new file mode 100644
index 0000000000..629db188c8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/plugin-menu-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/plugin-menu-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/plugin-menu-16~dark.png
new file mode 100644
index 0000000000..1db72f4529
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/plugin-menu-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/plugin-menu-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/plugin-menu-16~dark@2x.png
new file mode 100644
index 0000000000..305c9eac6d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/plugin-menu-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/popup-close-16.png b/main/src/core/MonoDevelop.Ide/icons/popup-close-16.png
index 9ccc4c0018..c290dfda23 100644
--- a/main/src/core/MonoDevelop.Ide/icons/popup-close-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/popup-close-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/popup-close-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/popup-close-16@2x.png
index 703311ea77..3c09c3e273 100644
--- a/main/src/core/MonoDevelop.Ide/icons/popup-close-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/popup-close-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/popup-close-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/popup-close-16~dark.png
new file mode 100644
index 0000000000..fcd2468a4e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/popup-close-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/popup-close-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/popup-close-16~dark@2x.png
new file mode 100644
index 0000000000..aa6afaec73
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/popup-close-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/popup-close-hover-16.png b/main/src/core/MonoDevelop.Ide/icons/popup-close-hover-16.png
index 64be74322c..2cb21c0a44 100644
--- a/main/src/core/MonoDevelop.Ide/icons/popup-close-hover-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/popup-close-hover-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/popup-close-hover-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/popup-close-hover-16@2x.png
index 6badd7e1eb..56ea4f6575 100644
--- a/main/src/core/MonoDevelop.Ide/icons/popup-close-hover-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/popup-close-hover-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/popup-close-hover-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/popup-close-hover-16~dark.png
new file mode 100644
index 0000000000..cd12367f41
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/popup-close-hover-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/popup-close-hover-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/popup-close-hover-16~dark@2x.png
new file mode 100644
index 0000000000..5ce2968a46
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/popup-close-hover-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preferences-16.png b/main/src/core/MonoDevelop.Ide/icons/preferences-16.png
index 93648c9b48..78bb996269 100644
--- a/main/src/core/MonoDevelop.Ide/icons/preferences-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/preferences-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preferences-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/preferences-16@2x.png
index 17934c90e5..0404b394ba 100644
--- a/main/src/core/MonoDevelop.Ide/icons/preferences-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/preferences-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preferences-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/preferences-16~dark.png
new file mode 100644
index 0000000000..1c6d47d2d7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/preferences-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preferences-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/preferences-16~dark@2x.png
new file mode 100644
index 0000000000..262eab6ac9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/preferences-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16.png b/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16.png
index a911510938..cb7fe7473d 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16@2x.png
index e6de7cb721..a8795580ad 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~dark.png
new file mode 100644
index 0000000000..247f33f3fd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~dark@2x.png
new file mode 100644
index 0000000000..b93b6fc873
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~dark~sel.png
new file mode 100644
index 0000000000..d8e9a9d918
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~dark~sel@2x.png
new file mode 100644
index 0000000000..d649953367
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~sel.png
new file mode 100644
index 0000000000..1a1c28d97c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~sel@2x.png
new file mode 100644
index 0000000000..9a9c266d99
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-author-information-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-build-16.png b/main/src/core/MonoDevelop.Ide/icons/prefs-build-16.png
index 45fd2732a6..6f2a26636d 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-build-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-build-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-build-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-build-16@2x.png
index 2e6aec66a5..2aa0589db4 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-build-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-build-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-build-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/prefs-build-16~dark.png
new file mode 100644
index 0000000000..032d3bc064
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-build-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-build-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-build-16~dark@2x.png
new file mode 100644
index 0000000000..5c21cfbc8d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-build-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-build-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-build-16~dark~sel.png
new file mode 100644
index 0000000000..32345f6e58
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-build-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-build-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-build-16~dark~sel@2x.png
new file mode 100644
index 0000000000..68aa75df87
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-build-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-build-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-build-16~sel.png
new file mode 100644
index 0000000000..32345f6e58
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-build-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-build-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-build-16~sel@2x.png
new file mode 100644
index 0000000000..68aa75df87
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-build-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16.png b/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16.png
index 66313da3bc..bef7c208f7 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16@2x.png
index 243e316934..d33f951610 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~dark.png
new file mode 100644
index 0000000000..b3e910546b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~dark@2x.png
new file mode 100644
index 0000000000..df27827d9c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~dark~sel.png
new file mode 100644
index 0000000000..3641679069
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~dark~sel@2x.png
new file mode 100644
index 0000000000..7227b6819a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~sel.png
new file mode 100644
index 0000000000..3641679069
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~sel@2x.png
new file mode 100644
index 0000000000..7227b6819a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-code-formatting-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16.png b/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16.png
index ba48bc0df4..ea029c013c 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16@2x.png
index 052e26edf7..239ffcf2f4 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~dark.png
new file mode 100644
index 0000000000..991ca960a6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~dark@2x.png
new file mode 100644
index 0000000000..7da53894fc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~dark~sel.png
new file mode 100644
index 0000000000..f109ee7b38
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~dark~sel@2x.png
new file mode 100644
index 0000000000..69fdfb3c57
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~sel.png
new file mode 100644
index 0000000000..bca8cd7ab8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~sel@2x.png
new file mode 100644
index 0000000000..c0ac46e31a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-code-templates-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-csharp-16.png b/main/src/core/MonoDevelop.Ide/icons/prefs-csharp-16.png
deleted file mode 100644
index 34b7ac06e1..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-csharp-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-csharp-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-csharp-16@2x.png
deleted file mode 100644
index df5ea2bdc6..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-csharp-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16.png b/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16.png
index e7e0d6f2e6..7255aa8490 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16@2x.png
index a5443dde5b..7509eb46ac 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~dark.png
new file mode 100644
index 0000000000..7351d826df
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~dark@2x.png
new file mode 100644
index 0000000000..1aab895d4b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~dark~sel.png
new file mode 100644
index 0000000000..504203d23e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~dark~sel@2x.png
new file mode 100644
index 0000000000..bb460cb4b8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~sel.png
new file mode 100644
index 0000000000..504203d23e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~sel@2x.png
new file mode 100644
index 0000000000..bb460cb4b8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-dotnet-naming-policies-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16.png b/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16.png
index 73668287fb..7678a94b0a 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16@2x.png
index 3fb43534d5..8acc4b1279 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~dark.png
new file mode 100644
index 0000000000..a85230475b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~dark@2x.png
new file mode 100644
index 0000000000..12727393d6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~dark~sel.png
new file mode 100644
index 0000000000..f9ff247739
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~dark~sel@2x.png
new file mode 100644
index 0000000000..4113d8b83f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~sel.png
new file mode 100644
index 0000000000..e03961d11e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~sel@2x.png
new file mode 100644
index 0000000000..051da63ace
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-external-tools-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16.png b/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16.png
index 72ed2240e2..04042bd33c 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16@2x.png
index 00609d0eca..5fd87299b2 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~dark.png
new file mode 100644
index 0000000000..e3ebeffe45
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~dark@2x.png
new file mode 100644
index 0000000000..d3b14adb75
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~dark~sel.png
new file mode 100644
index 0000000000..f4ecb7866d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~dark~sel@2x.png
new file mode 100644
index 0000000000..15aad3fa50
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~sel.png
new file mode 100644
index 0000000000..f4ecb7866d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~sel@2x.png
new file mode 100644
index 0000000000..15aad3fa50
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-fonts-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16.png b/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16.png
index 7e65a86774..82e8c0b885 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16@2x.png
index 593606db5f..df2fae955a 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~dark.png
new file mode 100644
index 0000000000..7a1068d660
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~dark@2x.png
new file mode 100644
index 0000000000..6f872077d8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~dark~sel.png
new file mode 100644
index 0000000000..d44254730c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~dark~sel@2x.png
new file mode 100644
index 0000000000..11303fa980
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~sel.png
new file mode 100644
index 0000000000..d44254730c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~sel@2x.png
new file mode 100644
index 0000000000..11303fa980
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-generic-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-header-16.png b/main/src/core/MonoDevelop.Ide/icons/prefs-header-16.png
new file mode 100644
index 0000000000..da065700f1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-header-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-header-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-header-16@2x.png
new file mode 100644
index 0000000000..f3b7c40f56
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-header-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-header-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/prefs-header-16~dark.png
new file mode 100644
index 0000000000..9cf0c88d0a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-header-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-header-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-header-16~dark@2x.png
new file mode 100644
index 0000000000..32dd2ee883
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-header-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-header-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-header-16~dark~sel.png
new file mode 100644
index 0000000000..29b6efd15b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-header-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-header-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-header-16~dark~sel@2x.png
new file mode 100644
index 0000000000..67ef89459e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-header-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-header-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-header-16~sel.png
new file mode 100644
index 0000000000..0e8403eba9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-header-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-header-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-header-16~sel@2x.png
new file mode 100644
index 0000000000..a60878e42a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-header-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16.png b/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16.png
index 52c35f86fb..cbc4bc7bc5 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16@2x.png
index 5184aa50c6..c9a20617fc 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~dark.png
new file mode 100644
index 0000000000..18692a25cb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~dark@2x.png
new file mode 100644
index 0000000000..03b6c78ca6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~dark~sel.png
new file mode 100644
index 0000000000..005796caa2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~dark~sel@2x.png
new file mode 100644
index 0000000000..798eaab111
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~sel.png
new file mode 100644
index 0000000000..005796caa2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~sel@2x.png
new file mode 100644
index 0000000000..798eaab111
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-key-bindings-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-language-16.png b/main/src/core/MonoDevelop.Ide/icons/prefs-language-16.png
index 19f2663360..87f2953c12 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-language-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-language-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-language-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-language-16@2x.png
index 1e4d00deb6..d5e0271f66 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-language-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-language-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-language-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/prefs-language-16~dark.png
new file mode 100644
index 0000000000..778eac0789
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-language-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-language-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-language-16~dark@2x.png
new file mode 100644
index 0000000000..7ac3c2cd5a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-language-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-language-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-language-16~dark~sel.png
new file mode 100644
index 0000000000..6038f48200
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-language-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-language-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-language-16~dark~sel@2x.png
new file mode 100644
index 0000000000..b2fb37ecd9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-language-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-language-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-language-16~sel.png
new file mode 100644
index 0000000000..6038f48200
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-language-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-language-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-language-16~sel@2x.png
new file mode 100644
index 0000000000..b2fb37ecd9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-language-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16.png b/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16.png
index 4cda9212c9..7aa9e74074 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16@2x.png
index 93c03d1a65..8c6dec814b 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~dark.png
new file mode 100644
index 0000000000..76c9b818ef
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~dark@2x.png
new file mode 100644
index 0000000000..a0999c040b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~dark~sel.png
new file mode 100644
index 0000000000..0fdb60432e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~dark~sel@2x.png
new file mode 100644
index 0000000000..6a3b0d38c8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~sel.png
new file mode 100644
index 0000000000..0fdb60432e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~sel@2x.png
new file mode 100644
index 0000000000..6a3b0d38c8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-load-save-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16.png b/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16.png
index e6a8ac57cf..37a58bdcbf 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16@2x.png
index 3267cddee2..72307162f4 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~dark.png
new file mode 100644
index 0000000000..090d3ee77c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~dark@2x.png
new file mode 100644
index 0000000000..eb37575e8f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~dark~sel.png
new file mode 100644
index 0000000000..e2253a115d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~dark~sel@2x.png
new file mode 100644
index 0000000000..512aa3a32b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~sel.png
new file mode 100644
index 0000000000..e2253a115d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~sel@2x.png
new file mode 100644
index 0000000000..512aa3a32b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-name-conventions-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-play-16.png b/main/src/core/MonoDevelop.Ide/icons/prefs-play-16.png
index 66bf188a37..1ac53e0a30 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-play-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-play-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-play-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-play-16@2x.png
index 417e6855b3..3e6e34bce1 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-play-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-play-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-play-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/prefs-play-16~dark.png
new file mode 100644
index 0000000000..5db07b06b6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-play-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-play-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-play-16~dark@2x.png
new file mode 100644
index 0000000000..782b120ea9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-play-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-play-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-play-16~dark~sel.png
new file mode 100644
index 0000000000..1e8e70b6c0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-play-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-play-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-play-16~dark~sel@2x.png
new file mode 100644
index 0000000000..49bcd138ea
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-play-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-play-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-play-16~sel.png
new file mode 100644
index 0000000000..1e8e70b6c0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-play-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-play-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-play-16~sel@2x.png
new file mode 100644
index 0000000000..49bcd138ea
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-play-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16.png b/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16.png
index 800b76d447..e78339cecd 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16@2x.png
index c319f59bc2..d5253f2868 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~dark.png
new file mode 100644
index 0000000000..6419dcc00c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~dark@2x.png
new file mode 100644
index 0000000000..1a204198aa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~dark~sel.png
new file mode 100644
index 0000000000..8cbac06936
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~dark~sel@2x.png
new file mode 100644
index 0000000000..979d664225
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~sel.png
new file mode 100644
index 0000000000..8cbac06936
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~sel@2x.png
new file mode 100644
index 0000000000..979d664225
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-sdk-locations-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-source-16.png b/main/src/core/MonoDevelop.Ide/icons/prefs-source-16.png
new file mode 100644
index 0000000000..87fd49e5a6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-source-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-source-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-source-16@2x.png
new file mode 100644
index 0000000000..9981f54f05
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-source-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-source-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/prefs-source-16~dark.png
new file mode 100644
index 0000000000..0166b821be
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-source-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-source-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-source-16~dark@2x.png
new file mode 100644
index 0000000000..948eb0c967
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-source-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-source-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-source-16~dark~sel.png
new file mode 100644
index 0000000000..3b13b595f1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-source-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-source-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-source-16~dark~sel@2x.png
new file mode 100644
index 0000000000..5dcf9b35e8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-source-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-source-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-source-16~sel.png
new file mode 100644
index 0000000000..5de35c8be5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-source-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-source-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-source-16~sel@2x.png
new file mode 100644
index 0000000000..daf1069540
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-source-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-standard-header-16.png b/main/src/core/MonoDevelop.Ide/icons/prefs-standard-header-16.png
deleted file mode 100644
index 83f9bcee6d..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-standard-header-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-standard-header-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-standard-header-16@2x.png
deleted file mode 100644
index 05d18fb6bd..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-standard-header-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16.png b/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16.png
index 17e0ea108d..1d2fca2301 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16@2x.png
index fe974de727..8d0626aabf 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~dark.png
new file mode 100644
index 0000000000..5b7aafd80d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~dark@2x.png
new file mode 100644
index 0000000000..bd0a2b1ed2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~dark~sel.png
new file mode 100644
index 0000000000..dbf93d603a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~dark~sel@2x.png
new file mode 100644
index 0000000000..1b73159aa9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~sel.png
new file mode 100644
index 0000000000..dbf93d603a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~sel@2x.png
new file mode 100644
index 0000000000..1b73159aa9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-task-list-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16.png b/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16.png
index 818f09fb65..831589022a 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16@2x.png
index 0582e35d0c..4835ff3ce0 100644
--- a/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~dark.png
new file mode 100644
index 0000000000..44de0e2701
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~dark@2x.png
new file mode 100644
index 0000000000..89de0f145e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~dark~sel.png
new file mode 100644
index 0000000000..68c115d59f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~dark~sel@2x.png
new file mode 100644
index 0000000000..95a911374a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~sel.png
new file mode 100644
index 0000000000..68c115d59f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~sel@2x.png
new file mode 100644
index 0000000000..95a911374a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/prefs-updates-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-16.png b/main/src/core/MonoDevelop.Ide/icons/preview-16.png
new file mode 100644
index 0000000000..7b8c7e9566
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/preview-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/preview-16@2x.png
new file mode 100644
index 0000000000..10489469d1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/preview-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/preview-16~dark.png
new file mode 100644
index 0000000000..ea423d3b87
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/preview-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/preview-16~dark@2x.png
new file mode 100644
index 0000000000..491a209df4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/preview-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/preview-16~dark~sel.png
new file mode 100644
index 0000000000..7c7225d1e9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/preview-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/preview-16~dark~sel@2x.png
new file mode 100644
index 0000000000..9413e65acd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/preview-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/preview-16~sel.png
new file mode 100644
index 0000000000..a1df6e6241
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/preview-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/preview-16~sel@2x.png
new file mode 100644
index 0000000000..59b83a27df
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/preview-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-active-16.png b/main/src/core/MonoDevelop.Ide/icons/preview-active-16.png
index e0de6365cb..31650e7344 100644
--- a/main/src/core/MonoDevelop.Ide/icons/preview-active-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/preview-active-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-active-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/preview-active-16@2x.png
index ca93f5f904..29bcecb68c 100644
--- a/main/src/core/MonoDevelop.Ide/icons/preview-active-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/preview-active-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-hover-16.png b/main/src/core/MonoDevelop.Ide/icons/preview-hover-16.png
index 7733740ebe..dd278ac139 100644
--- a/main/src/core/MonoDevelop.Ide/icons/preview-hover-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/preview-hover-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-hover-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/preview-hover-16@2x.png
index afc00674fb..afc849fcd2 100644
--- a/main/src/core/MonoDevelop.Ide/icons/preview-hover-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/preview-hover-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-hover-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/preview-hover-16~dark.png
new file mode 100644
index 0000000000..a15112a11f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/preview-hover-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-hover-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/preview-hover-16~dark@2x.png
new file mode 100644
index 0000000000..2da7812371
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/preview-hover-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-hover-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/preview-hover-16~dark~sel.png
new file mode 100644
index 0000000000..302f91bc1b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/preview-hover-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-hover-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/preview-hover-16~dark~sel@2x.png
new file mode 100644
index 0000000000..c3108d85d5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/preview-hover-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-hover-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/preview-hover-16~sel.png
new file mode 100644
index 0000000000..c83ba2edea
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/preview-hover-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-hover-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/preview-hover-16~sel@2x.png
new file mode 100644
index 0000000000..67a16fca44
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/preview-hover-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-normal-16.png b/main/src/core/MonoDevelop.Ide/icons/preview-normal-16.png
deleted file mode 100644
index f35c0427e5..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/preview-normal-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-normal-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/preview-normal-16@2x.png
deleted file mode 100644
index beaf9f827c..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/preview-normal-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-selected-16.png b/main/src/core/MonoDevelop.Ide/icons/preview-selected-16.png
deleted file mode 100644
index fb982aa4a8..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/preview-selected-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/preview-selected-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/preview-selected-16@2x.png
deleted file mode 100644
index aee1eecd8b..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/preview-selected-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/print-16.png b/main/src/core/MonoDevelop.Ide/icons/print-16.png
new file mode 100644
index 0000000000..2194be15cc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/print-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/print-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/print-16@2x.png
new file mode 100644
index 0000000000..7cfa2be366
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/print-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/print-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/print-16~dark.png
new file mode 100644
index 0000000000..dd42ee1b18
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/print-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/print-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/print-16~dark@2x.png
new file mode 100644
index 0000000000..236aa65754
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/print-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-128.png b/main/src/core/MonoDevelop.Ide/icons/project-128.png
deleted file mode 100644
index 8098e13c90..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/project-128.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-128@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-128@2x.png
deleted file mode 100644
index e9ac2a54fd..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/project-128@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-16.png b/main/src/core/MonoDevelop.Ide/icons/project-16.png
index d9be88353c..2e64bfff21 100644
--- a/main/src/core/MonoDevelop.Ide/icons/project-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/project-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-16@2x.png
index 1ad656f8ec..78cc9cfd3c 100644
--- a/main/src/core/MonoDevelop.Ide/icons/project-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/project-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/project-16~dark.png
new file mode 100644
index 0000000000..242d2cf7d8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-16~dark@2x.png
new file mode 100644
index 0000000000..2b7173f64a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/project-16~dark~sel.png
new file mode 100644
index 0000000000..864ef4b052
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-16~dark~sel@2x.png
new file mode 100644
index 0000000000..c0090f39fb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/project-16~sel.png
new file mode 100644
index 0000000000..864ef4b052
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-16~sel@2x.png
new file mode 100644
index 0000000000..c0090f39fb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-32.png b/main/src/core/MonoDevelop.Ide/icons/project-32.png
index 1ad656f8ec..a4595f8573 100644
--- a/main/src/core/MonoDevelop.Ide/icons/project-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/project-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-32@2x.png
index 2c924032af..b3170ccd54 100644
--- a/main/src/core/MonoDevelop.Ide/icons/project-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/project-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/project-32~dark.png
new file mode 100644
index 0000000000..09b88d6a85
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-32~dark@2x.png
new file mode 100644
index 0000000000..598617ba5d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/project-32~dark~sel.png
new file mode 100644
index 0000000000..c0090f39fb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-32~dark~sel@2x.png
new file mode 100644
index 0000000000..f91a61f2e8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/project-32~sel.png
new file mode 100644
index 0000000000..c0090f39fb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-32~sel@2x.png
new file mode 100644
index 0000000000..f91a61f2e8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-64.png b/main/src/core/MonoDevelop.Ide/icons/project-64.png
deleted file mode 100644
index 2c924032af..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/project-64.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-64@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-64@2x.png
deleted file mode 100644
index 8098e13c90..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/project-64@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-assembly-16.png b/main/src/core/MonoDevelop.Ide/icons/project-assembly-16.png
new file mode 100644
index 0000000000..01687e46bb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-assembly-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-assembly-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-assembly-16@2x.png
new file mode 100644
index 0000000000..0a490c4a98
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-assembly-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-assembly-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/project-assembly-16~dark.png
new file mode 100644
index 0000000000..fa70c917aa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-assembly-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-assembly-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-assembly-16~dark@2x.png
new file mode 100644
index 0000000000..b3091024de
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-assembly-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-assembly-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/project-assembly-16~dark~sel.png
new file mode 100644
index 0000000000..14b2e904dc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-assembly-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-assembly-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-assembly-16~dark~sel@2x.png
new file mode 100644
index 0000000000..afc9812992
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-assembly-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-assembly-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/project-assembly-16~sel.png
new file mode 100644
index 0000000000..14b2e904dc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-assembly-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-assembly-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-assembly-16~sel@2x.png
new file mode 100644
index 0000000000..afc9812992
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-assembly-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32.png b/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32.png
index df34213d91..bff732a7dc 100644
--- a/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32@2x.png
index d21ed7756c..cfa17b16e0 100644
--- a/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~dark.png
new file mode 100644
index 0000000000..203c7b497f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~dark@2x.png
new file mode 100644
index 0000000000..d1cc4826b2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~dark~sel.png
new file mode 100644
index 0000000000..e05e244df3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~dark~sel@2x.png
new file mode 100644
index 0000000000..ccb5cb455f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~sel.png
new file mode 100644
index 0000000000..076760c003
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~sel@2x.png
new file mode 100644
index 0000000000..d4a8eb5a4d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-console-overlay-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32.png b/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32.png
new file mode 100644
index 0000000000..e61ce45e90
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32@2x.png
new file mode 100644
index 0000000000..cb2a5e5cf4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~dark.png
new file mode 100644
index 0000000000..cdcab056bb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~dark@2x.png
new file mode 100644
index 0000000000..296f9d90c5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~dark~sel.png
new file mode 100644
index 0000000000..8e761459c0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~dark~sel@2x.png
new file mode 100644
index 0000000000..6e0d090d49
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~sel.png
new file mode 100644
index 0000000000..ed313e73dc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~sel@2x.png
new file mode 100644
index 0000000000..a1c8a9525a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-gtk2-overlay-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-gui-overlay-32.png b/main/src/core/MonoDevelop.Ide/icons/project-gui-overlay-32.png
deleted file mode 100644
index 5beba76bf9..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/project-gui-overlay-32.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-gui-overlay-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-gui-overlay-32@2x.png
deleted file mode 100644
index 0b84654151..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/project-gui-overlay-32@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32.png b/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32.png
index d71d03d382..87309c6a05 100644
--- a/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32@2x.png
index 4009bbed4f..45cae38161 100644
--- a/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~dark.png
new file mode 100644
index 0000000000..163358c3ad
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~dark@2x.png
new file mode 100644
index 0000000000..769513420f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~dark~sel.png
new file mode 100644
index 0000000000..212901e1c6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~dark~sel@2x.png
new file mode 100644
index 0000000000..913d23caee
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~sel.png
new file mode 100644
index 0000000000..4c89454011
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~sel@2x.png
new file mode 100644
index 0000000000..a662506c39
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-library-overlay-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-new-16.png b/main/src/core/MonoDevelop.Ide/icons/project-new-16.png
deleted file mode 100644
index 99022e53cc..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/project-new-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32.png b/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32.png
index daa6d0d2a5..94cd21390d 100644
--- a/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32@2x.png
index 664f413a7a..05e84865e9 100644
--- a/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~dark.png
new file mode 100644
index 0000000000..b67ac9d2e7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~dark@2x.png
new file mode 100644
index 0000000000..0a0c74b70b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~dark~sel.png
new file mode 100644
index 0000000000..5de67db489
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~dark~sel@2x.png
new file mode 100644
index 0000000000..e5dde885d9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~sel.png
new file mode 100644
index 0000000000..5de67db489
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~sel@2x.png
new file mode 100644
index 0000000000..e5dde885d9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-nunit-overlay-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32.png b/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32.png
index ba79bfa5fa..fce1208071 100644
--- a/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32@2x.png
index 755c6c6ef4..2ae916ed7e 100644
--- a/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~dark.png
new file mode 100644
index 0000000000..16ca398d87
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~dark@2x.png
new file mode 100644
index 0000000000..fe2da03e36
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~dark~sel.png
new file mode 100644
index 0000000000..ac0174f8ac
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~dark~sel@2x.png
new file mode 100644
index 0000000000..cd230bf060
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~sel.png
new file mode 100644
index 0000000000..ac0174f8ac
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~sel@2x.png
new file mode 100644
index 0000000000..cd230bf060
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-package-overlay-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-reference-overlay-16.png b/main/src/core/MonoDevelop.Ide/icons/project-reference-overlay-16.png
deleted file mode 100644
index 840eedc201..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/project-reference-overlay-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-reference-overlay-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-reference-overlay-16@2x.png
deleted file mode 100644
index 390b60e3fd..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/project-reference-overlay-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32.png b/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32.png
index 22a964cdf1..2dd8e56a31 100644
--- a/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32@2x.png
index 69e1d3ec2b..a36bf5a60b 100644
--- a/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~dark.png
new file mode 100644
index 0000000000..0343312b9e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~dark@2x.png
new file mode 100644
index 0000000000..8c656c0aac
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~dark~sel.png
new file mode 100644
index 0000000000..59eca30dad
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~dark~sel@2x.png
new file mode 100644
index 0000000000..a32f5ff5fe
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~sel.png
new file mode 100644
index 0000000000..59eca30dad
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~sel@2x.png
new file mode 100644
index 0000000000..a32f5ff5fe
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-shared-assets-overlay-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-status-error-16.png b/main/src/core/MonoDevelop.Ide/icons/project-status-error-16.png
deleted file mode 100644
index 303b0b6234..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/project-status-error-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-status-error-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-status-error-16@2x.png
deleted file mode 100644
index a64809d01d..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/project-status-error-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-status-information-16.png b/main/src/core/MonoDevelop.Ide/icons/project-status-information-16.png
deleted file mode 100644
index 9a1ed0325c..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/project-status-information-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-status-information-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-status-information-16@2x.png
deleted file mode 100644
index 4418693d5b..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/project-status-information-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-status-warning-16.png b/main/src/core/MonoDevelop.Ide/icons/project-status-warning-16.png
deleted file mode 100644
index 0844d58e39..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/project-status-warning-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-status-warning-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-status-warning-16@2x.png
deleted file mode 100644
index 54a99a5bc2..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/project-status-warning-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-web-32.png b/main/src/core/MonoDevelop.Ide/icons/project-web-32.png
new file mode 100644
index 0000000000..d96f0093c5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-web-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-web-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-web-32@2x.png
new file mode 100644
index 0000000000..c36c03a695
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-web-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-web-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/project-web-32~dark.png
new file mode 100644
index 0000000000..11668066e7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-web-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-web-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-web-32~dark@2x.png
new file mode 100644
index 0000000000..96aa2269f0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-web-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-web-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/project-web-32~dark~sel.png
new file mode 100644
index 0000000000..0636466f8f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-web-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-web-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-web-32~dark~sel@2x.png
new file mode 100644
index 0000000000..2a285aebcf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-web-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-web-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/project-web-32~sel.png
new file mode 100644
index 0000000000..0636466f8f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-web-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-web-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-web-32~sel@2x.png
new file mode 100644
index 0000000000..2a285aebcf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/project-web-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-web-overlay-32.png b/main/src/core/MonoDevelop.Ide/icons/project-web-overlay-32.png
deleted file mode 100644
index f1b05134c5..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/project-web-overlay-32.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/project-web-overlay-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/project-web-overlay-32@2x.png
deleted file mode 100644
index 0522ca44e1..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/project-web-overlay-32@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/properties-16.png b/main/src/core/MonoDevelop.Ide/icons/properties-16.png
deleted file mode 100644
index bff9c389c1..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/properties-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/properties-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/properties-16@2x.png
deleted file mode 100644
index e061e98cae..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/properties-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-16.png b/main/src/core/MonoDevelop.Ide/icons/question-16.png
index 32776fffc2..5f49f19699 100644
--- a/main/src/core/MonoDevelop.Ide/icons/question-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/question-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/question-16@2x.png
index 7840d7c0f7..a5f03e7de7 100644
--- a/main/src/core/MonoDevelop.Ide/icons/question-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/question-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/question-16~dark.png
new file mode 100644
index 0000000000..23042964aa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/question-16~dark@2x.png
new file mode 100644
index 0000000000..391a1586c6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/question-16~dark~sel.png
new file mode 100644
index 0000000000..8c16140779
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/question-16~dark~sel@2x.png
new file mode 100644
index 0000000000..921059abdf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/question-16~sel.png
new file mode 100644
index 0000000000..8c16140779
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/question-16~sel@2x.png
new file mode 100644
index 0000000000..921059abdf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-24.png b/main/src/core/MonoDevelop.Ide/icons/question-24.png
index dc79681156..eac063a56d 100644
--- a/main/src/core/MonoDevelop.Ide/icons/question-24.png
+++ b/main/src/core/MonoDevelop.Ide/icons/question-24.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-24@2x.png b/main/src/core/MonoDevelop.Ide/icons/question-24@2x.png
index 11fb9de802..75edcd40cb 100644
--- a/main/src/core/MonoDevelop.Ide/icons/question-24@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/question-24@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-24~dark.png b/main/src/core/MonoDevelop.Ide/icons/question-24~dark.png
new file mode 100644
index 0000000000..61be59835e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-24~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-24~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/question-24~dark@2x.png
new file mode 100644
index 0000000000..8f5008be81
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-24~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-24~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/question-24~dark~sel.png
new file mode 100644
index 0000000000..8712680669
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-24~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-24~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/question-24~dark~sel@2x.png
new file mode 100644
index 0000000000..34bc31f3ec
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-24~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-24~sel.png b/main/src/core/MonoDevelop.Ide/icons/question-24~sel.png
new file mode 100644
index 0000000000..8712680669
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-24~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-24~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/question-24~sel@2x.png
new file mode 100644
index 0000000000..34bc31f3ec
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-24~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-32.png b/main/src/core/MonoDevelop.Ide/icons/question-32.png
index 7840d7c0f7..a5f03e7de7 100644
--- a/main/src/core/MonoDevelop.Ide/icons/question-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/question-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/question-32@2x.png
index c8aa256070..fe72d7ce8d 100644
--- a/main/src/core/MonoDevelop.Ide/icons/question-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/question-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/question-32~dark.png
new file mode 100644
index 0000000000..391a1586c6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/question-32~dark@2x.png
new file mode 100644
index 0000000000..2f3fdc061c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/question-32~dark~sel.png
new file mode 100644
index 0000000000..921059abdf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/question-32~dark~sel@2x.png
new file mode 100644
index 0000000000..49f39a3efc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/question-32~sel.png
new file mode 100644
index 0000000000..921059abdf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/question-32~sel@2x.png
new file mode 100644
index 0000000000..49f39a3efc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-48.png b/main/src/core/MonoDevelop.Ide/icons/question-48.png
index 11fb9de802..75edcd40cb 100644
--- a/main/src/core/MonoDevelop.Ide/icons/question-48.png
+++ b/main/src/core/MonoDevelop.Ide/icons/question-48.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-48@2x.png b/main/src/core/MonoDevelop.Ide/icons/question-48@2x.png
index bed96c85fb..62349bdda2 100644
--- a/main/src/core/MonoDevelop.Ide/icons/question-48@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/question-48@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-48~dark.png b/main/src/core/MonoDevelop.Ide/icons/question-48~dark.png
new file mode 100644
index 0000000000..8f5008be81
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-48~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-48~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/question-48~dark@2x.png
new file mode 100644
index 0000000000..987bde7942
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-48~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-48~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/question-48~dark~sel.png
new file mode 100644
index 0000000000..34bc31f3ec
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-48~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-48~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/question-48~dark~sel@2x.png
new file mode 100644
index 0000000000..6c37843e42
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-48~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-48~sel.png b/main/src/core/MonoDevelop.Ide/icons/question-48~sel.png
new file mode 100644
index 0000000000..34bc31f3ec
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-48~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/question-48~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/question-48~sel@2x.png
new file mode 100644
index 0000000000..6c37843e42
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/question-48~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/redo-16.png b/main/src/core/MonoDevelop.Ide/icons/redo-16.png
new file mode 100644
index 0000000000..4b5ffa35b6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/redo-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/redo-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/redo-16@2x.png
new file mode 100644
index 0000000000..304a7a6edb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/redo-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/redo-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/redo-16~dark.png
new file mode 100644
index 0000000000..a28aac28cc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/redo-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/redo-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/redo-16~dark@2x.png
new file mode 100644
index 0000000000..9ef4e65b7e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/redo-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/redo-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/redo-16~dark~disabled.png
new file mode 100644
index 0000000000..95b66da2e1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/redo-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/redo-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/redo-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..fc31260f29
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/redo-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/redo-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/redo-16~disabled.png
new file mode 100644
index 0000000000..51b45ca7ed
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/redo-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/redo-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/redo-16~disabled@2x.png
new file mode 100644
index 0000000000..44d71e3a9d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/redo-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-16.png b/main/src/core/MonoDevelop.Ide/icons/reference-16.png
index b441192270..ad72926212 100644
--- a/main/src/core/MonoDevelop.Ide/icons/reference-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/reference-16@2x.png
index a59c599aca..dab4f3b6af 100644
--- a/main/src/core/MonoDevelop.Ide/icons/reference-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/reference-16~dark.png
new file mode 100644
index 0000000000..99719a15fc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/reference-16~dark@2x.png
new file mode 100644
index 0000000000..f9e7f3c9e7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/reference-16~dark~sel.png
new file mode 100644
index 0000000000..4030156741
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/reference-16~dark~sel@2x.png
new file mode 100644
index 0000000000..0ef2c6e282
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/reference-16~sel.png
new file mode 100644
index 0000000000..4030156741
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/reference-16~sel@2x.png
new file mode 100644
index 0000000000..0ef2c6e282
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16.png b/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16.png
new file mode 100644
index 0000000000..dd7539b34f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16@2x.png
new file mode 100644
index 0000000000..2edaba5e62
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~dark.png
new file mode 100644
index 0000000000..da2f04e748
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~dark@2x.png
new file mode 100644
index 0000000000..b02d98b3d1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~dark~sel.png
new file mode 100644
index 0000000000..b25654cc2c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~dark~sel@2x.png
new file mode 100644
index 0000000000..bbdfcf4db6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~sel.png
new file mode 100644
index 0000000000..b25654cc2c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~sel@2x.png
new file mode 100644
index 0000000000..bbdfcf4db6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-assembly-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16.png b/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16.png
new file mode 100644
index 0000000000..64073e6519
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16@2x.png
new file mode 100644
index 0000000000..897a89d695
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~dark.png
new file mode 100644
index 0000000000..7185844489
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~dark@2x.png
new file mode 100644
index 0000000000..98244b534f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~dark~sel.png
new file mode 100644
index 0000000000..d9b63d1eab
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~dark~sel@2x.png
new file mode 100644
index 0000000000..f5299e9484
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~sel.png
new file mode 100644
index 0000000000..d9b63d1eab
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~sel@2x.png
new file mode 100644
index 0000000000..f5299e9484
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-invalid-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-project-16.png b/main/src/core/MonoDevelop.Ide/icons/reference-project-16.png
new file mode 100644
index 0000000000..1eec14cd21
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-project-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-project-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/reference-project-16@2x.png
new file mode 100644
index 0000000000..d0b0e61933
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-project-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-project-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/reference-project-16~dark.png
new file mode 100644
index 0000000000..d70686d82e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-project-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-project-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/reference-project-16~dark@2x.png
new file mode 100644
index 0000000000..160f08203f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-project-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-project-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/reference-project-16~dark~sel.png
new file mode 100644
index 0000000000..edac0bae6e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-project-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-project-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/reference-project-16~dark~sel@2x.png
new file mode 100644
index 0000000000..e5d228ced4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-project-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-project-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/reference-project-16~sel.png
new file mode 100644
index 0000000000..edac0bae6e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-project-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/reference-project-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/reference-project-16~sel@2x.png
new file mode 100644
index 0000000000..e5d228ced4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/reference-project-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/refresh-16.png b/main/src/core/MonoDevelop.Ide/icons/refresh-16.png
index b7ffd20c72..1e79477e54 100644
--- a/main/src/core/MonoDevelop.Ide/icons/refresh-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/refresh-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/refresh-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/refresh-16@2x.png
index b65a18fc0a..1b258ff227 100644
--- a/main/src/core/MonoDevelop.Ide/icons/refresh-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/refresh-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/refresh-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/refresh-16~dark.png
new file mode 100644
index 0000000000..abca51c0c2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/refresh-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/refresh-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/refresh-16~dark@2x.png
new file mode 100644
index 0000000000..a3c8034f24
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/refresh-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/refresh-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/refresh-16~dark~disabled.png
new file mode 100644
index 0000000000..1470ae54ad
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/refresh-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/refresh-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/refresh-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..d6ba2156e6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/refresh-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/refresh-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/refresh-16~disabled.png
new file mode 100644
index 0000000000..1cadefe430
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/refresh-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/refresh-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/refresh-16~disabled@2x.png
new file mode 100644
index 0000000000..39ddb2e8a9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/refresh-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/region-16.png b/main/src/core/MonoDevelop.Ide/icons/region-16.png
new file mode 100644
index 0000000000..cba746219b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/region-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/region-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/region-16@2x.png
new file mode 100644
index 0000000000..5858204a6b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/region-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/region-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/region-16~dark.png
new file mode 100644
index 0000000000..652d5b9961
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/region-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/region-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/region-16~dark@2x.png
new file mode 100644
index 0000000000..a010059e13
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/region-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/region-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/region-16~dark~sel.png
new file mode 100644
index 0000000000..9995df44dc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/region-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/region-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/region-16~dark~sel@2x.png
new file mode 100644
index 0000000000..7a7bedb3c4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/region-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/region-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/region-16~sel.png
new file mode 100644
index 0000000000..9995df44dc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/region-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/region-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/region-16~sel@2x.png
new file mode 100644
index 0000000000..7a7bedb3c4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/region-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/remove-16.png b/main/src/core/MonoDevelop.Ide/icons/remove-16.png
index 7e76236f64..b273ff520e 100644
--- a/main/src/core/MonoDevelop.Ide/icons/remove-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/remove-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/remove-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/remove-16@2x.png
index 21318f43f2..ee9ae5ae81 100644
--- a/main/src/core/MonoDevelop.Ide/icons/remove-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/remove-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/remove-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/remove-16~dark.png
new file mode 100644
index 0000000000..fd98dbf53b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/remove-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/remove-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/remove-16~dark@2x.png
new file mode 100644
index 0000000000..94ead67a2a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/remove-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/remove-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/remove-16~dark~disabled.png
new file mode 100644
index 0000000000..0941c6aad1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/remove-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/remove-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/remove-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..f3d8c9c63e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/remove-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/remove-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/remove-16~disabled.png
new file mode 100644
index 0000000000..f44a63c7a0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/remove-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/remove-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/remove-16~disabled@2x.png
new file mode 100644
index 0000000000..4e7f7c25f6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/remove-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/replace-in-files-16.png b/main/src/core/MonoDevelop.Ide/icons/replace-in-files-16.png
deleted file mode 100644
index a7d9b56b75..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/replace-in-files-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/revert-16.png b/main/src/core/MonoDevelop.Ide/icons/revert-16.png
new file mode 100644
index 0000000000..a67e18840a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/revert-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/revert-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/revert-16@2x.png
new file mode 100644
index 0000000000..7faee37ac9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/revert-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/revert-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/revert-16~dark.png
new file mode 100644
index 0000000000..e990f97de7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/revert-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/revert-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/revert-16~dark@2x.png
new file mode 100644
index 0000000000..fbaadddd44
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/revert-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/revert-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/revert-16~dark~disabled.png
new file mode 100644
index 0000000000..c453434fcc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/revert-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/revert-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/revert-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..ef172c44f8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/revert-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/revert-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/revert-16~disabled.png
new file mode 100644
index 0000000000..261a85670d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/revert-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/revert-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/revert-16~disabled@2x.png
new file mode 100644
index 0000000000..af3cffa5b8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/revert-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/run-unit-tests-16.png b/main/src/core/MonoDevelop.Ide/icons/run-unit-tests-16.png
new file mode 100644
index 0000000000..08156925bf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/run-unit-tests-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/run-unit-tests-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/run-unit-tests-16@2x.png
new file mode 100644
index 0000000000..a626c128b9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/run-unit-tests-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/run-unit-tests-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/run-unit-tests-16~dark.png
new file mode 100644
index 0000000000..c73c3e92fd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/run-unit-tests-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/run-unit-tests-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/run-unit-tests-16~dark@2x.png
new file mode 100644
index 0000000000..392713f95a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/run-unit-tests-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/save-16.png b/main/src/core/MonoDevelop.Ide/icons/save-16.png
index 50d6447f3e..bbf2ef373d 100644
--- a/main/src/core/MonoDevelop.Ide/icons/save-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/save-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/save-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/save-16@2x.png
new file mode 100644
index 0000000000..6c62a26e95
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/save-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/save-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/save-16~dark.png
new file mode 100644
index 0000000000..86c454278f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/save-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/save-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/save-16~dark@2x.png
new file mode 100644
index 0000000000..ffaae445be
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/save-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/save-all-16.png b/main/src/core/MonoDevelop.Ide/icons/save-all-16.png
index 6c6ae344d2..34d67367a0 100644
--- a/main/src/core/MonoDevelop.Ide/icons/save-all-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/save-all-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/save-all-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/save-all-16@2x.png
new file mode 100644
index 0000000000..49f8e1168f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/save-all-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/save-all-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/save-all-16~dark.png
new file mode 100644
index 0000000000..ee2106e320
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/save-all-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/save-all-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/save-all-16~dark@2x.png
new file mode 100644
index 0000000000..dce47e0e76
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/save-all-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-16.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-16.png
deleted file mode 100644
index 9bcf6370b4..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-16@2x.png
deleted file mode 100644
index b5c13b6631..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-mac-16.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-mac-16.png
new file mode 100644
index 0000000000..f59eb830b0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-mac-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-mac-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-mac-16@2x.png
new file mode 100644
index 0000000000..79f10ce8c7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-mac-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-mac-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-mac-16~dark.png
new file mode 100644
index 0000000000..2faedc1d16
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-mac-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-mac-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-mac-16~dark@2x.png
new file mode 100644
index 0000000000..e560f6879c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-mac-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24.png
new file mode 100644
index 0000000000..5c7610206f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24~dark.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24~dark.png
new file mode 100644
index 0000000000..5c7610206f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24~hover.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24~hover.png
new file mode 100644
index 0000000000..aba7b0b7fa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24~hover.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24~hover~dark.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24~hover~dark.png
new file mode 100644
index 0000000000..aba7b0b7fa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24~hover~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24~pressed.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24~pressed.png
new file mode 100644
index 0000000000..fe155401ef
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24~pressed.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24~pressed~dark.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24~pressed~dark.png
new file mode 100644
index 0000000000..d3de93ee0a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/searchbox-clear-win-24~pressed~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-search-16.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-16.png
deleted file mode 100644
index f588df66a2..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/searchbox-search-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-search-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-16@2x.png
deleted file mode 100644
index c9e1abf19b..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/searchbox-search-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-search-mac-16.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-mac-16.png
new file mode 100644
index 0000000000..c6e794702f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-mac-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-search-mac-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-mac-16@2x.png
new file mode 100644
index 0000000000..c1f12aa259
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-mac-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-search-mac-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-mac-16~dark.png
new file mode 100644
index 0000000000..c3b71cfc5a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-mac-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-search-mac-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-mac-16~dark@2x.png
new file mode 100644
index 0000000000..8aa943236d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-mac-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24.png
new file mode 100644
index 0000000000..a93808d053
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24~dark.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24~dark.png
new file mode 100644
index 0000000000..a93808d053
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24~hover.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24~hover.png
new file mode 100644
index 0000000000..9567863c2f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24~hover.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24~hover~dark.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24~hover~dark.png
new file mode 100644
index 0000000000..9567863c2f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24~hover~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24~pressed.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24~pressed.png
new file mode 100644
index 0000000000..98283b9c55
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24~pressed.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24~pressed~dark.png b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24~pressed~dark.png
new file mode 100644
index 0000000000..19f2e5c32e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/searchbox-search-win-24~pressed~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/select-all-16.png b/main/src/core/MonoDevelop.Ide/icons/select-all-16.png
new file mode 100644
index 0000000000..c0185bdc7c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/select-all-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/select-all-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/select-all-16@2x.png
new file mode 100644
index 0000000000..bc1fe27ff3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/select-all-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/select-all-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/select-all-16~dark.png
new file mode 100644
index 0000000000..181f860a46
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/select-all-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/select-all-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/select-all-16~dark@2x.png
new file mode 100644
index 0000000000..ca3af34760
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/select-all-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/select-all-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/select-all-16~dark~disabled.png
new file mode 100644
index 0000000000..6ca2763cd1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/select-all-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/select-all-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/select-all-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..5fdc618d8c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/select-all-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/select-all-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/select-all-16~disabled.png
new file mode 100644
index 0000000000..344df7c435
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/select-all-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/select-all-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/select-all-16~disabled@2x.png
new file mode 100644
index 0000000000..2f4a8dcdb7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/select-all-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-128.png b/main/src/core/MonoDevelop.Ide/icons/solution-128.png
deleted file mode 100644
index e4fa7bb7f2..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/solution-128.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-128@2x.png b/main/src/core/MonoDevelop.Ide/icons/solution-128@2x.png
deleted file mode 100644
index 05c96c2e73..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/solution-128@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-16.png b/main/src/core/MonoDevelop.Ide/icons/solution-16.png
index 5581976af9..843f24e70d 100644
--- a/main/src/core/MonoDevelop.Ide/icons/solution-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/solution-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/solution-16@2x.png
index 10056155d5..1bdfbfb4a6 100644
--- a/main/src/core/MonoDevelop.Ide/icons/solution-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/solution-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/solution-16~dark.png
new file mode 100644
index 0000000000..3ab692dbdc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/solution-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/solution-16~dark@2x.png
new file mode 100644
index 0000000000..955ecb5578
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/solution-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/solution-16~dark~sel.png
new file mode 100644
index 0000000000..fac7faa890
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/solution-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/solution-16~dark~sel@2x.png
new file mode 100644
index 0000000000..bef4cbb6fa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/solution-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/solution-16~sel.png
new file mode 100644
index 0000000000..fac7faa890
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/solution-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/solution-16~sel@2x.png
new file mode 100644
index 0000000000..bef4cbb6fa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/solution-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-32.png b/main/src/core/MonoDevelop.Ide/icons/solution-32.png
index 10056155d5..81955bbbe0 100644
--- a/main/src/core/MonoDevelop.Ide/icons/solution-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/solution-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/solution-32@2x.png
index 8cc04b0b0f..6d5254b915 100644
--- a/main/src/core/MonoDevelop.Ide/icons/solution-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/solution-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/solution-32~dark.png
new file mode 100644
index 0000000000..6c5c7410ef
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/solution-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/solution-32~dark@2x.png
new file mode 100644
index 0000000000..e9a94b3b44
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/solution-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/solution-32~dark~sel.png
new file mode 100644
index 0000000000..bef4cbb6fa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/solution-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/solution-32~dark~sel@2x.png
new file mode 100644
index 0000000000..87dae2c7a9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/solution-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/solution-32~sel.png
new file mode 100644
index 0000000000..bef4cbb6fa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/solution-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/solution-32~sel@2x.png
new file mode 100644
index 0000000000..87dae2c7a9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/solution-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-64.png b/main/src/core/MonoDevelop.Ide/icons/solution-64.png
deleted file mode 100644
index 8cc04b0b0f..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/solution-64.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-64@2x.png b/main/src/core/MonoDevelop.Ide/icons/solution-64@2x.png
deleted file mode 100644
index e4fa7bb7f2..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/solution-64@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-folder-new-16.png b/main/src/core/MonoDevelop.Ide/icons/solution-folder-new-16.png
deleted file mode 100644
index 347c30efa8..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/solution-folder-new-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/solution-new-16.png b/main/src/core/MonoDevelop.Ide/icons/solution-new-16.png
deleted file mode 100644
index deb9e85d6a..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/solution-new-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/sort-alphabetically-16.png b/main/src/core/MonoDevelop.Ide/icons/sort-alphabetically-16.png
index ced221715a..b5d147850c 100644
--- a/main/src/core/MonoDevelop.Ide/icons/sort-alphabetically-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/sort-alphabetically-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/sort-alphabetically-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/sort-alphabetically-16@2x.png
index cde44a8f3a..71a05a2402 100644
--- a/main/src/core/MonoDevelop.Ide/icons/sort-alphabetically-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/sort-alphabetically-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/sort-alphabetically-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/sort-alphabetically-16~dark.png
new file mode 100644
index 0000000000..55a750cea7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/sort-alphabetically-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/sort-alphabetically-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/sort-alphabetically-16~dark@2x.png
new file mode 100644
index 0000000000..89324d9ab1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/sort-alphabetically-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-1.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-1.png
index 46bcd36296..cb147e22f0 100644
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-14-1.png
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-1.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-1@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-1@2x.png
index d223e473fc..f45863623a 100644
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-14-1@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-1@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-1~dark.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-1~dark.png
new file mode 100644
index 0000000000..6ffd207212
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-1~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-1~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-1~dark@2x.png
new file mode 100644
index 0000000000..280c6bddfa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-1~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-1~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-1~dark~sel.png
new file mode 100644
index 0000000000..13a9ebf79c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-1~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-1~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-1~dark~sel@2x.png
new file mode 100644
index 0000000000..fdb5f47ed4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-1~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-1~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-1~sel.png
new file mode 100644
index 0000000000..13a9ebf79c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-1~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-1~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-1~sel@2x.png
new file mode 100644
index 0000000000..fdb5f47ed4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-1~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-2.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-2.png
index b7d78f7bc1..d475d0a6f6 100644
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-14-2.png
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-2.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-2@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-2@2x.png
index 6a1b63bca9..b0d3a86f3d 100644
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-14-2@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-2@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-2~dark.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-2~dark.png
new file mode 100644
index 0000000000..f7308f075a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-2~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-2~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-2~dark@2x.png
new file mode 100644
index 0000000000..e27de8deea
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-2~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-2~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-2~dark~sel.png
new file mode 100644
index 0000000000..6b92967fac
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-2~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-2~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-2~dark~sel@2x.png
new file mode 100644
index 0000000000..5a233406af
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-2~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-2~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-2~sel.png
new file mode 100644
index 0000000000..6b92967fac
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-2~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-2~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-2~sel@2x.png
new file mode 100644
index 0000000000..5a233406af
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-2~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-3.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-3.png
index 778197b418..ede4a385b8 100644
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-14-3.png
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-3.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-3@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-3@2x.png
index 8832d93af8..8f3d978905 100644
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-14-3@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-3@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-3~dark.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-3~dark.png
new file mode 100644
index 0000000000..fff83cb7ec
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-3~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-3~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-3~dark@2x.png
new file mode 100644
index 0000000000..7f8851dbcd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-3~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-3~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-3~dark~sel.png
new file mode 100644
index 0000000000..527770e536
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-3~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-3~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-3~dark~sel@2x.png
new file mode 100644
index 0000000000..c638733481
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-3~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-3~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-3~sel.png
new file mode 100644
index 0000000000..527770e536
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-3~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-3~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-3~sel@2x.png
new file mode 100644
index 0000000000..c638733481
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-3~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-4.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-4.png
index bd3aada045..79d86835ef 100644
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-14-4.png
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-4.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-4@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-4@2x.png
index 910e6006e7..b3f7d06142 100644
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-14-4@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-4@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-4~dark.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-4~dark.png
new file mode 100644
index 0000000000..0b51e51acc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-4~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-4~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-4~dark@2x.png
new file mode 100644
index 0000000000..5b44c716c0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-4~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-4~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-4~dark~sel.png
new file mode 100644
index 0000000000..b4382b4d55
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-4~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-4~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-4~dark~sel@2x.png
new file mode 100644
index 0000000000..2d388b80de
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-4~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-4~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-4~sel.png
new file mode 100644
index 0000000000..b4382b4d55
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-4~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-4~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-4~sel@2x.png
new file mode 100644
index 0000000000..2d388b80de
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-4~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-5.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-5.png
index c6ca97cdac..ad8648ac29 100644
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-14-5.png
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-5.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-5@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-5@2x.png
index 1d65ac1a40..7267a63e97 100644
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-14-5@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-5@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-5~dark.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-5~dark.png
new file mode 100644
index 0000000000..f6534e0126
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-5~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-5~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-5~dark@2x.png
new file mode 100644
index 0000000000..f2acc90a35
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-5~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-5~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-5~dark~sel.png
new file mode 100644
index 0000000000..54b751ba4f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-5~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-5~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-5~dark~sel@2x.png
new file mode 100644
index 0000000000..b4d1726bc6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-5~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-5~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-5~sel.png
new file mode 100644
index 0000000000..54b751ba4f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-5~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-14-5~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-14-5~sel@2x.png
new file mode 100644
index 0000000000..b4d1726bc6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-14-5~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-1.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-1.png
new file mode 100644
index 0000000000..ce32f64b51
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-1.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-1@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-1@2x.png
new file mode 100644
index 0000000000..5482d173d7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-1@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-1~dark.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-1~dark.png
new file mode 100644
index 0000000000..7bae4a8f48
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-1~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-1~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-1~dark@2x.png
new file mode 100644
index 0000000000..85d8e5be02
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-1~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-1~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-1~dark~sel.png
new file mode 100644
index 0000000000..ef915e9687
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-1~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-1~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-1~dark~sel@2x.png
new file mode 100644
index 0000000000..41b181b168
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-1~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-1~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-1~sel.png
new file mode 100644
index 0000000000..ef915e9687
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-1~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-1~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-1~sel@2x.png
new file mode 100644
index 0000000000..41b181b168
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-1~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-2.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-2.png
new file mode 100644
index 0000000000..367b1a9263
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-2.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-2@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-2@2x.png
new file mode 100644
index 0000000000..b830343750
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-2@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-2~dark.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-2~dark.png
new file mode 100644
index 0000000000..df1506e288
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-2~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-2~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-2~dark@2x.png
new file mode 100644
index 0000000000..a410c9af9c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-2~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-2~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-2~dark~sel.png
new file mode 100644
index 0000000000..8e50d2e8f9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-2~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-2~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-2~dark~sel@2x.png
new file mode 100644
index 0000000000..10e1cec3ec
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-2~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-2~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-2~sel.png
new file mode 100644
index 0000000000..8e50d2e8f9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-2~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-2~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-2~sel@2x.png
new file mode 100644
index 0000000000..10e1cec3ec
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-2~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-3.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-3.png
new file mode 100644
index 0000000000..919bc9a5a5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-3.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-3@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-3@2x.png
new file mode 100644
index 0000000000..94e642e337
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-3@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-3~dark.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-3~dark.png
new file mode 100644
index 0000000000..fa54f18673
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-3~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-3~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-3~dark@2x.png
new file mode 100644
index 0000000000..3151de78fc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-3~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-3~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-3~dark~sel.png
new file mode 100644
index 0000000000..ec97b5612e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-3~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-3~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-3~dark~sel@2x.png
new file mode 100644
index 0000000000..373547e751
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-3~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-3~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-3~sel.png
new file mode 100644
index 0000000000..ec97b5612e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-3~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-3~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-3~sel@2x.png
new file mode 100644
index 0000000000..373547e751
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-3~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-4.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-4.png
new file mode 100644
index 0000000000..75c3f08084
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-4.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-4@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-4@2x.png
new file mode 100644
index 0000000000..e772abca8a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-4@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-4~dark.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-4~dark.png
new file mode 100644
index 0000000000..247780d1ba
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-4~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-4~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-4~dark@2x.png
new file mode 100644
index 0000000000..7aa539fc3b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-4~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-4~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-4~dark~sel.png
new file mode 100644
index 0000000000..e56d7b0b94
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-4~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-4~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-4~dark~sel@2x.png
new file mode 100644
index 0000000000..f68fa5398c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-4~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-4~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-4~sel.png
new file mode 100644
index 0000000000..e56d7b0b94
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-4~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-4~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-4~sel@2x.png
new file mode 100644
index 0000000000..f68fa5398c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-4~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-5.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-5.png
new file mode 100644
index 0000000000..82239eb249
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-5.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-5@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-5@2x.png
new file mode 100644
index 0000000000..cdbd458b99
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-5@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-5~dark.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-5~dark.png
new file mode 100644
index 0000000000..fb950ccd65
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-5~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-5~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-5~dark@2x.png
new file mode 100644
index 0000000000..c9e9b1e6e5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-5~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-5~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-5~dark~sel.png
new file mode 100644
index 0000000000..afded3ae22
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-5~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-5~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-5~dark~sel@2x.png
new file mode 100644
index 0000000000..f95400575d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-5~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-5~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-5~sel.png
new file mode 100644
index 0000000000..afded3ae22
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-5~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-16-5~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-16-5~sel@2x.png
new file mode 100644
index 0000000000..f95400575d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-16-5~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-1.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-1.png
index 13f98ff915..0a0af9366d 100644
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-18-1.png
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-1.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-1@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-1@2x.png
index 519289fc89..56f0b7b5d1 100644
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-18-1@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-1@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-1~dark.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-1~dark.png
new file mode 100644
index 0000000000..45ae5e8b60
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-1~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-1~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-1~dark@2x.png
new file mode 100644
index 0000000000..0a4e184e84
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-1~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-1~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-1~dark~sel.png
new file mode 100644
index 0000000000..62e66b7f2e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-1~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-1~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-1~dark~sel@2x.png
new file mode 100644
index 0000000000..3006c8a16e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-1~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-1~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-1~sel.png
new file mode 100644
index 0000000000..62e66b7f2e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-1~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-1~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-1~sel@2x.png
new file mode 100644
index 0000000000..3006c8a16e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-1~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-2.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-2.png
index 5c52a0e30c..e708dfa7a4 100644
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-18-2.png
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-2.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-2@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-2@2x.png
index f0fd719b19..340a4a22e7 100644
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-18-2@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-2@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-2~dark.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-2~dark.png
new file mode 100644
index 0000000000..9ee8f5a9af
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-2~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-2~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-2~dark@2x.png
new file mode 100644
index 0000000000..5403de9a59
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-2~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-2~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-2~dark~sel.png
new file mode 100644
index 0000000000..d358910f68
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-2~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-2~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-2~dark~sel@2x.png
new file mode 100644
index 0000000000..c686f492bd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-2~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-2~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-2~sel.png
new file mode 100644
index 0000000000..d358910f68
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-2~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-2~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-2~sel@2x.png
new file mode 100644
index 0000000000..c686f492bd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-2~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-3.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-3.png
index 951c2ed964..3cf69c3584 100644
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-18-3.png
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-3.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-3@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-3@2x.png
index 4be02f16ab..dce572171a 100644
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-18-3@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-3@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-3~dark.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-3~dark.png
new file mode 100644
index 0000000000..7e23e5d408
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-3~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-3~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-3~dark@2x.png
new file mode 100644
index 0000000000..d2ac747d4b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-3~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-3~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-3~dark~sel.png
new file mode 100644
index 0000000000..2091a92d9c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-3~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-3~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-3~dark~sel@2x.png
new file mode 100644
index 0000000000..479782bd1a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-3~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-3~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-3~sel.png
new file mode 100644
index 0000000000..2091a92d9c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-3~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-3~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-3~sel@2x.png
new file mode 100644
index 0000000000..479782bd1a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-3~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-4.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-4.png
index eb6291bba3..b46ef657e4 100644
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-18-4.png
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-4.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-4@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-4@2x.png
index 5a05ec623d..7bb1caf1b3 100644
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-18-4@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-4@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-4~dark.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-4~dark.png
new file mode 100644
index 0000000000..f2d62a5499
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-4~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-4~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-4~dark@2x.png
new file mode 100644
index 0000000000..479c8a9296
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-4~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-4~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-4~dark~sel.png
new file mode 100644
index 0000000000..4e4955d013
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-4~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-4~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-4~dark~sel@2x.png
new file mode 100644
index 0000000000..d40773009f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-4~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-4~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-4~sel.png
new file mode 100644
index 0000000000..4e4955d013
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-4~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-4~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-4~sel@2x.png
new file mode 100644
index 0000000000..d40773009f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-4~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-5.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-5.png
index ed0c2abec5..6c10e087dd 100644
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-18-5.png
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-5.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-5@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-5@2x.png
index 967eecfee7..e7b9b3ccaa 100644
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-18-5@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-5@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-5~dark.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-5~dark.png
new file mode 100644
index 0000000000..81115587b4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-5~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-5~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-5~dark@2x.png
new file mode 100644
index 0000000000..c2246c49c3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-5~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-5~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-5~dark~sel.png
new file mode 100644
index 0000000000..a8e86f66b3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-5~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-5~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-5~dark~sel@2x.png
new file mode 100644
index 0000000000..c5b86acf11
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-5~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-5~sel.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-5~sel.png
new file mode 100644
index 0000000000..a8e86f66b3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-5~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-18-5~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-18-5~sel@2x.png
new file mode 100644
index 0000000000..c5b86acf11
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/spinner-18-5~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-normal-1-16.png b/main/src/core/MonoDevelop.Ide/icons/spinner-normal-1-16.png
deleted file mode 100644
index 83c220b5e2..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-normal-1-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-normal-1-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-normal-1-16@2x.png
deleted file mode 100644
index de7d0b5071..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-normal-1-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-normal-2-16.png b/main/src/core/MonoDevelop.Ide/icons/spinner-normal-2-16.png
deleted file mode 100644
index 568de99d44..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-normal-2-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-normal-2-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-normal-2-16@2x.png
deleted file mode 100644
index c22c96c9a1..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-normal-2-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-normal-3-16.png b/main/src/core/MonoDevelop.Ide/icons/spinner-normal-3-16.png
deleted file mode 100644
index 2b6b145e9c..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-normal-3-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-normal-3-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-normal-3-16@2x.png
deleted file mode 100644
index 0599340f87..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-normal-3-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-normal-4-16.png b/main/src/core/MonoDevelop.Ide/icons/spinner-normal-4-16.png
deleted file mode 100644
index a3d2273086..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-normal-4-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-normal-4-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-normal-4-16@2x.png
deleted file mode 100644
index 832ea49a74..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-normal-4-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-normal-5-16.png b/main/src/core/MonoDevelop.Ide/icons/spinner-normal-5-16.png
deleted file mode 100644
index 11cb8827e4..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-normal-5-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-normal-5-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-normal-5-16@2x.png
deleted file mode 100644
index 04723238f8..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-normal-5-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-selected-1-16.png b/main/src/core/MonoDevelop.Ide/icons/spinner-selected-1-16.png
deleted file mode 100644
index ba54296b90..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-selected-1-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-selected-1-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-selected-1-16@2x.png
deleted file mode 100644
index ae808f4221..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-selected-1-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-selected-2-16.png b/main/src/core/MonoDevelop.Ide/icons/spinner-selected-2-16.png
deleted file mode 100644
index c933355f37..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-selected-2-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-selected-2-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-selected-2-16@2x.png
deleted file mode 100644
index cecc2e4370..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-selected-2-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-selected-3-16.png b/main/src/core/MonoDevelop.Ide/icons/spinner-selected-3-16.png
deleted file mode 100644
index 0713f0a018..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-selected-3-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-selected-3-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-selected-3-16@2x.png
deleted file mode 100644
index d0bd23352f..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-selected-3-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-selected-4-16.png b/main/src/core/MonoDevelop.Ide/icons/spinner-selected-4-16.png
deleted file mode 100644
index d48b80d110..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-selected-4-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-selected-4-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-selected-4-16@2x.png
deleted file mode 100644
index b5014abce9..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-selected-4-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-selected-5-16.png b/main/src/core/MonoDevelop.Ide/icons/spinner-selected-5-16.png
deleted file mode 100644
index 480ec10c31..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-selected-5-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/spinner-selected-5-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/spinner-selected-5-16@2x.png
deleted file mode 100644
index a4d85f145b..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/spinner-selected-5-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/star-16.png b/main/src/core/MonoDevelop.Ide/icons/star-16.png
index 9b29779062..084e7dd77e 100644
--- a/main/src/core/MonoDevelop.Ide/icons/star-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/star-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/star-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/star-16@2x.png
index b739ad5ae3..e8afdcea29 100644
--- a/main/src/core/MonoDevelop.Ide/icons/star-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/star-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/star-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/star-16~dark.png
new file mode 100644
index 0000000000..1591a25153
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/star-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/star-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/star-16~dark@2x.png
new file mode 100644
index 0000000000..f98c7f0a60
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/star-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/star-hover-16.png b/main/src/core/MonoDevelop.Ide/icons/star-hover-16.png
index 66cef74855..4bbf523b1e 100644
--- a/main/src/core/MonoDevelop.Ide/icons/star-hover-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/star-hover-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/star-hover-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/star-hover-16@2x.png
index 10b3e0107b..011fd239ca 100644
--- a/main/src/core/MonoDevelop.Ide/icons/star-hover-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/star-hover-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/star-overlay-16.png b/main/src/core/MonoDevelop.Ide/icons/star-overlay-16.png
deleted file mode 100644
index ac634c03b7..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/star-overlay-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/star-overlay-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/star-overlay-16@2x.png
deleted file mode 100644
index c7d97d3a51..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/star-overlay-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/star-overlay-hover-16.png b/main/src/core/MonoDevelop.Ide/icons/star-overlay-hover-16.png
deleted file mode 100644
index 8e20716aac..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/star-overlay-hover-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/star-overlay-hover-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/star-overlay-hover-16@2x.png
deleted file mode 100644
index d66150873a..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/star-overlay-hover-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-1-14.png b/main/src/core/MonoDevelop.Ide/icons/status-building-1-14.png
deleted file mode 100644
index f715a65777..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-building-1-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-1-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-building-1-14@2x.png
deleted file mode 100644
index 14dfadf925..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-building-1-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-1-16.png b/main/src/core/MonoDevelop.Ide/icons/status-building-1-16.png
new file mode 100644
index 0000000000..059f5a4773
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-building-1-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-1-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-building-1-16@2x.png
new file mode 100644
index 0000000000..580a935c5c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-building-1-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-1-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-building-1-16~dark.png
new file mode 100644
index 0000000000..e614ab5af8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-building-1-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-1-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-building-1-16~dark@2x.png
new file mode 100644
index 0000000000..c11fa43535
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-building-1-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-2-14.png b/main/src/core/MonoDevelop.Ide/icons/status-building-2-14.png
deleted file mode 100644
index cec1ab8584..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-building-2-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-2-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-building-2-14@2x.png
deleted file mode 100644
index 4e66f57d15..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-building-2-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-2-16.png b/main/src/core/MonoDevelop.Ide/icons/status-building-2-16.png
new file mode 100644
index 0000000000..e68df7495d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-building-2-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-2-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-building-2-16@2x.png
new file mode 100644
index 0000000000..7d68090e85
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-building-2-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-2-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-building-2-16~dark.png
new file mode 100644
index 0000000000..16b165f242
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-building-2-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-2-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-building-2-16~dark@2x.png
new file mode 100644
index 0000000000..c6a6271d7f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-building-2-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-3-14.png b/main/src/core/MonoDevelop.Ide/icons/status-building-3-14.png
deleted file mode 100644
index ad68453693..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-building-3-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-3-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-building-3-14@2x.png
deleted file mode 100644
index d0b4f43c2c..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-building-3-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-3-16.png b/main/src/core/MonoDevelop.Ide/icons/status-building-3-16.png
new file mode 100644
index 0000000000..41e96beef1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-building-3-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-3-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-building-3-16@2x.png
new file mode 100644
index 0000000000..8c3c6348e0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-building-3-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-3-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-building-3-16~dark.png
new file mode 100644
index 0000000000..abb46b00b7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-building-3-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-3-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-building-3-16~dark@2x.png
new file mode 100644
index 0000000000..7128914100
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-building-3-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-4-14.png b/main/src/core/MonoDevelop.Ide/icons/status-building-4-14.png
deleted file mode 100644
index 4549253d33..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-building-4-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-4-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-building-4-14@2x.png
deleted file mode 100644
index 663daaa52b..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-building-4-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-4-16.png b/main/src/core/MonoDevelop.Ide/icons/status-building-4-16.png
new file mode 100644
index 0000000000..fdb7562bbb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-building-4-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-4-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-building-4-16@2x.png
new file mode 100644
index 0000000000..c1c4239cf5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-building-4-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-4-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-building-4-16~dark.png
new file mode 100644
index 0000000000..2aa2ad2a8c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-building-4-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-4-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-building-4-16~dark@2x.png
new file mode 100644
index 0000000000..c104fa2f5f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-building-4-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-5-14.png b/main/src/core/MonoDevelop.Ide/icons/status-building-5-14.png
deleted file mode 100644
index 640125e635..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-building-5-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-5-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-building-5-14@2x.png
deleted file mode 100644
index 40b755eb04..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-building-5-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-5-16.png b/main/src/core/MonoDevelop.Ide/icons/status-building-5-16.png
new file mode 100644
index 0000000000..33dd57ea9c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-building-5-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-5-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-building-5-16@2x.png
new file mode 100644
index 0000000000..be00292c45
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-building-5-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-5-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-building-5-16~dark.png
new file mode 100644
index 0000000000..b4ea4da587
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-building-5-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-building-5-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-building-5-16~dark@2x.png
new file mode 100644
index 0000000000..19e06c340d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-building-5-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-1-14.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-1-14.png
deleted file mode 100644
index 9f53faf6fe..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-connecting-1-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-1-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-1-14@2x.png
deleted file mode 100644
index 19dd2075b0..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-connecting-1-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-1-16.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-1-16.png
new file mode 100644
index 0000000000..f7b7225e91
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-1-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-1-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-1-16@2x.png
new file mode 100644
index 0000000000..3a2db39612
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-1-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-1-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-1-16~dark.png
new file mode 100644
index 0000000000..c89cdd76b9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-1-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-1-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-1-16~dark@2x.png
new file mode 100644
index 0000000000..ba0a196e5f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-1-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-2-14.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-2-14.png
deleted file mode 100644
index 85e51a0e89..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-connecting-2-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-2-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-2-14@2x.png
deleted file mode 100644
index f6347902db..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-connecting-2-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-2-16.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-2-16.png
new file mode 100644
index 0000000000..89ae6b2616
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-2-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-2-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-2-16@2x.png
new file mode 100644
index 0000000000..581318d863
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-2-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-2-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-2-16~dark.png
new file mode 100644
index 0000000000..efe12eda21
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-2-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-2-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-2-16~dark@2x.png
new file mode 100644
index 0000000000..d83347d155
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-2-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-3-14.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-3-14.png
deleted file mode 100644
index 90b3191331..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-connecting-3-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-3-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-3-14@2x.png
deleted file mode 100644
index 949a95a435..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-connecting-3-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-3-16.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-3-16.png
new file mode 100644
index 0000000000..111dd7784a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-3-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-3-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-3-16@2x.png
new file mode 100644
index 0000000000..ec3a9a6ad2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-3-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-3-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-3-16~dark.png
new file mode 100644
index 0000000000..7279282f5b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-3-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-3-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-3-16~dark@2x.png
new file mode 100644
index 0000000000..09612802d3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-3-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-4-14.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-4-14.png
deleted file mode 100644
index 86c13340f1..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-connecting-4-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-4-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-4-14@2x.png
deleted file mode 100644
index ca3c138866..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-connecting-4-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-4-16.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-4-16.png
new file mode 100644
index 0000000000..0a21c8d19e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-4-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-4-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-4-16@2x.png
new file mode 100644
index 0000000000..64d7c6a901
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-4-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-4-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-4-16~dark.png
new file mode 100644
index 0000000000..c2836b8022
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-4-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-4-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-4-16~dark@2x.png
new file mode 100644
index 0000000000..765019023b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-4-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-5-14.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-5-14.png
deleted file mode 100644
index 563cdb9c35..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-connecting-5-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-5-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-5-14@2x.png
deleted file mode 100644
index 9c2c7390b2..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-connecting-5-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-5-16.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-5-16.png
new file mode 100644
index 0000000000..52ebac5d89
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-5-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-5-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-5-16@2x.png
new file mode 100644
index 0000000000..5d1bc1343d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-5-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-5-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-5-16~dark.png
new file mode 100644
index 0000000000..13f1385551
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-5-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-5-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-5-16~dark@2x.png
new file mode 100644
index 0000000000..5e3bf170ea
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-5-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-6-14.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-6-14.png
deleted file mode 100644
index a1ddbce672..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-connecting-6-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-6-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-6-14@2x.png
deleted file mode 100644
index 7b51dc09f4..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-connecting-6-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-6-16.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-6-16.png
new file mode 100644
index 0000000000..11ee403bc9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-6-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-6-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-6-16@2x.png
new file mode 100644
index 0000000000..5f01258c30
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-6-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-6-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-6-16~dark.png
new file mode 100644
index 0000000000..79f4c2d7f5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-6-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-connecting-6-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-connecting-6-16~dark@2x.png
new file mode 100644
index 0000000000..683d3c6d52
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-connecting-6-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-error-16.png b/main/src/core/MonoDevelop.Ide/icons/status-error-16.png
new file mode 100644
index 0000000000..0d94aefa1d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-error-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-error-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-error-16@2x.png
new file mode 100644
index 0000000000..8abbf94ae5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-error-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-error-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-error-16~dark.png
new file mode 100644
index 0000000000..f9be4ff7c1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-error-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-error-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-error-16~dark@2x.png
new file mode 100644
index 0000000000..4435b130bb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-error-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-error-count-16.png b/main/src/core/MonoDevelop.Ide/icons/status-error-count-16.png
new file mode 100644
index 0000000000..be5ffca301
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-error-count-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-error-count-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-error-count-16@2x.png
new file mode 100644
index 0000000000..14f1104dac
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-error-count-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-error-count-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-error-count-16~dark.png
new file mode 100644
index 0000000000..90ca4edc81
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-error-count-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-error-count-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-error-count-16~dark@2x.png
new file mode 100644
index 0000000000..52f8f078e8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-error-count-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-failure-14.png b/main/src/core/MonoDevelop.Ide/icons/status-failure-14.png
deleted file mode 100644
index 9b5b6e27e1..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-failure-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-failure-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-failure-14@2x.png
deleted file mode 100644
index fc260df7c0..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-failure-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-instrumentation-16.png b/main/src/core/MonoDevelop.Ide/icons/status-instrumentation-16.png
new file mode 100644
index 0000000000..3881148ee0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-instrumentation-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-instrumentation-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-instrumentation-16@2x.png
new file mode 100644
index 0000000000..b61e07d523
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-instrumentation-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-instrumentation-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-instrumentation-16~dark.png
new file mode 100644
index 0000000000..b57baf33c6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-instrumentation-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-instrumentation-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-instrumentation-16~dark@2x.png
new file mode 100644
index 0000000000..7612141812
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-instrumentation-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-1-14.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-1-14.png
deleted file mode 100644
index a6be8c2b51..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-opening-1-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-1-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-1-14@2x.png
deleted file mode 100644
index e6e8c5161c..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-opening-1-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-1-16.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-1-16.png
new file mode 100644
index 0000000000..2b2e76c928
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-1-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-1-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-1-16@2x.png
new file mode 100644
index 0000000000..0e86d9364c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-1-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-1-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-1-16~dark.png
new file mode 100644
index 0000000000..b1afb1c324
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-1-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-1-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-1-16~dark@2x.png
new file mode 100644
index 0000000000..e20571b363
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-1-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-2-14.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-2-14.png
deleted file mode 100644
index 79f8cc98b9..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-opening-2-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-2-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-2-14@2x.png
deleted file mode 100644
index 77cbcda634..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-opening-2-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-2-16.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-2-16.png
new file mode 100644
index 0000000000..89577eef08
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-2-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-2-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-2-16@2x.png
new file mode 100644
index 0000000000..7ed90db172
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-2-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-2-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-2-16~dark.png
new file mode 100644
index 0000000000..b66a405393
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-2-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-2-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-2-16~dark@2x.png
new file mode 100644
index 0000000000..4bc65835cd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-2-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-3-14.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-3-14.png
deleted file mode 100644
index 53c42aaa75..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-opening-3-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-3-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-3-14@2x.png
deleted file mode 100644
index 5e0411f783..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-opening-3-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-3-16.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-3-16.png
new file mode 100644
index 0000000000..13bfe54845
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-3-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-3-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-3-16@2x.png
new file mode 100644
index 0000000000..10aa1371c7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-3-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-3-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-3-16~dark.png
new file mode 100644
index 0000000000..81685a25ad
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-3-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-3-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-3-16~dark@2x.png
new file mode 100644
index 0000000000..5a202da86c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-3-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-4-14.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-4-14.png
deleted file mode 100644
index ade4ba363a..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-opening-4-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-4-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-4-14@2x.png
deleted file mode 100644
index c28445c0e6..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-opening-4-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-4-16.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-4-16.png
new file mode 100644
index 0000000000..f8908911f7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-4-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-4-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-4-16@2x.png
new file mode 100644
index 0000000000..10fd9a87e1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-4-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-4-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-4-16~dark.png
new file mode 100644
index 0000000000..f575618eb2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-4-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-4-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-4-16~dark@2x.png
new file mode 100644
index 0000000000..453b430ec6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-4-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-5-14.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-5-14.png
deleted file mode 100644
index b323c4fff2..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-opening-5-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-5-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-5-14@2x.png
deleted file mode 100644
index 8a05100f40..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-opening-5-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-5-16.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-5-16.png
new file mode 100644
index 0000000000..00c81658e4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-5-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-5-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-5-16@2x.png
new file mode 100644
index 0000000000..44ba8dd197
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-5-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-5-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-5-16~dark.png
new file mode 100644
index 0000000000..9b4c9c650a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-5-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-5-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-5-16~dark@2x.png
new file mode 100644
index 0000000000..e4f89ba014
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-5-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-6-14.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-6-14.png
deleted file mode 100644
index b323c4fff2..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-opening-6-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-6-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-6-14@2x.png
deleted file mode 100644
index 4330e12a52..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-opening-6-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-6-16.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-6-16.png
new file mode 100644
index 0000000000..00c81658e4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-6-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-6-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-6-16@2x.png
new file mode 100644
index 0000000000..6d2dcaada8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-6-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-6-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-6-16~dark.png
new file mode 100644
index 0000000000..9b4c9c650a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-6-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-opening-6-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-opening-6-16~dark@2x.png
new file mode 100644
index 0000000000..f91a41f161
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-opening-6-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-parsing-16.png b/main/src/core/MonoDevelop.Ide/icons/status-parsing-16.png
new file mode 100644
index 0000000000..383aaddf75
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-parsing-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-parsing-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-parsing-16@2x.png
new file mode 100644
index 0000000000..07960aec3d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-parsing-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-parsing-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-parsing-16~dark.png
new file mode 100644
index 0000000000..5ddc5e40a7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-parsing-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-parsing-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-parsing-16~dark@2x.png
new file mode 100644
index 0000000000..92cd09789d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-parsing-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-1-14.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-1-14.png
deleted file mode 100644
index 4f6e04a9ea..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pulling-1-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-1-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-1-14@2x.png
deleted file mode 100644
index ce7719ce1a..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pulling-1-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-1-16.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-1-16.png
new file mode 100644
index 0000000000..e270525bfa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-1-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-1-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-1-16@2x.png
new file mode 100644
index 0000000000..08efa15e1b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-1-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-1-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-1-16~dark.png
new file mode 100644
index 0000000000..d10a4c426f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-1-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-1-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-1-16~dark@2x.png
new file mode 100644
index 0000000000..3adec5eaf1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-1-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-2-14.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-2-14.png
deleted file mode 100644
index 6b5c446d52..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pulling-2-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-2-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-2-14@2x.png
deleted file mode 100644
index 714fdcf793..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pulling-2-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-2-16.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-2-16.png
new file mode 100644
index 0000000000..57f8179ffd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-2-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-2-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-2-16@2x.png
new file mode 100644
index 0000000000..39b3dc3f22
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-2-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-2-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-2-16~dark.png
new file mode 100644
index 0000000000..726d5b744c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-2-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-2-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-2-16~dark@2x.png
new file mode 100644
index 0000000000..b917e5b2a7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-2-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-3-14.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-3-14.png
deleted file mode 100644
index 947b218fd6..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pulling-3-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-3-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-3-14@2x.png
deleted file mode 100644
index 44ce4e8d8d..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pulling-3-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-3-16.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-3-16.png
new file mode 100644
index 0000000000..dec5a5fe22
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-3-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-3-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-3-16@2x.png
new file mode 100644
index 0000000000..113f8e2666
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-3-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-3-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-3-16~dark.png
new file mode 100644
index 0000000000..98e9716efa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-3-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-3-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-3-16~dark@2x.png
new file mode 100644
index 0000000000..04ec844219
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-3-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-4-14.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-4-14.png
deleted file mode 100644
index df2e53ee30..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pulling-4-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-4-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-4-14@2x.png
deleted file mode 100644
index 59e1abe805..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pulling-4-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-4-16.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-4-16.png
new file mode 100644
index 0000000000..d1c6bff739
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-4-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-4-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-4-16@2x.png
new file mode 100644
index 0000000000..e7e04944a5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-4-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-4-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-4-16~dark.png
new file mode 100644
index 0000000000..8fd9aa0dc6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-4-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-4-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-4-16~dark@2x.png
new file mode 100644
index 0000000000..b5704f4bf9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-4-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-5-14.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-5-14.png
deleted file mode 100644
index 1501fd1c54..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pulling-5-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-5-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-5-14@2x.png
deleted file mode 100644
index 0460855d86..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pulling-5-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-5-16.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-5-16.png
new file mode 100644
index 0000000000..87dd053bb8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-5-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-5-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-5-16@2x.png
new file mode 100644
index 0000000000..30b068829a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-5-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-5-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-5-16~dark.png
new file mode 100644
index 0000000000..ba53aadfca
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-5-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-5-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-5-16~dark@2x.png
new file mode 100644
index 0000000000..8b1c866e45
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-5-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-6-14.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-6-14.png
deleted file mode 100644
index f1d02a8625..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pulling-6-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-6-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-6-14@2x.png
deleted file mode 100644
index 41ac72a0ac..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pulling-6-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-6-16.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-6-16.png
new file mode 100644
index 0000000000..8fc0639eb6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-6-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-6-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-6-16@2x.png
new file mode 100644
index 0000000000..3bdf86eff5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-6-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-6-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-6-16~dark.png
new file mode 100644
index 0000000000..098afd74a5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-6-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pulling-6-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pulling-6-16~dark@2x.png
new file mode 100644
index 0000000000..7cd84d3a85
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pulling-6-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-1-14.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-1-14.png
deleted file mode 100644
index 211898c6b0..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pushing-1-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-1-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-1-14@2x.png
deleted file mode 100644
index 1804ef12e4..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pushing-1-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-1-16.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-1-16.png
new file mode 100644
index 0000000000..0b74921b23
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-1-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-1-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-1-16@2x.png
new file mode 100644
index 0000000000..590c65631a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-1-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-1-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-1-16~dark.png
new file mode 100644
index 0000000000..020efbd3a6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-1-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-1-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-1-16~dark@2x.png
new file mode 100644
index 0000000000..551c7aeea1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-1-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-2-14.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-2-14.png
deleted file mode 100644
index 46a33005ee..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pushing-2-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-2-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-2-14@2x.png
deleted file mode 100644
index 46b0aebe87..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pushing-2-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-2-16.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-2-16.png
new file mode 100644
index 0000000000..1164299287
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-2-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-2-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-2-16@2x.png
new file mode 100644
index 0000000000..7f00e81dbe
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-2-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-2-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-2-16~dark.png
new file mode 100644
index 0000000000..b57c8e5ba6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-2-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-2-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-2-16~dark@2x.png
new file mode 100644
index 0000000000..19aff4b2a4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-2-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-3-14.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-3-14.png
deleted file mode 100644
index 30dea6569f..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pushing-3-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-3-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-3-14@2x.png
deleted file mode 100644
index 9dbd4c6b0b..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pushing-3-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-3-16.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-3-16.png
new file mode 100644
index 0000000000..6cdbfc45bf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-3-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-3-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-3-16@2x.png
new file mode 100644
index 0000000000..cac0badc99
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-3-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-3-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-3-16~dark.png
new file mode 100644
index 0000000000..1807329736
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-3-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-3-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-3-16~dark@2x.png
new file mode 100644
index 0000000000..f24e14ca0b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-3-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-4-14.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-4-14.png
deleted file mode 100644
index fe86225c2b..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pushing-4-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-4-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-4-14@2x.png
deleted file mode 100644
index 3fdce25bc2..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pushing-4-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-4-16.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-4-16.png
new file mode 100644
index 0000000000..9e526ee981
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-4-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-4-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-4-16@2x.png
new file mode 100644
index 0000000000..67844b9783
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-4-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-4-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-4-16~dark.png
new file mode 100644
index 0000000000..38149582b2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-4-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-4-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-4-16~dark@2x.png
new file mode 100644
index 0000000000..4ae2e87822
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-4-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-5-14.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-5-14.png
deleted file mode 100644
index 1460483965..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pushing-5-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-5-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-5-14@2x.png
deleted file mode 100644
index 3bb4a42cdc..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pushing-5-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-5-16.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-5-16.png
new file mode 100644
index 0000000000..180ae0803b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-5-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-5-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-5-16@2x.png
new file mode 100644
index 0000000000..07673386d7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-5-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-5-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-5-16~dark.png
new file mode 100644
index 0000000000..aa0216faa2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-5-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-5-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-5-16~dark@2x.png
new file mode 100644
index 0000000000..fa21372248
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-5-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-6-14.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-6-14.png
deleted file mode 100644
index 7ec9e199d9..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pushing-6-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-6-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-6-14@2x.png
deleted file mode 100644
index 494a388be0..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-pushing-6-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-6-16.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-6-16.png
new file mode 100644
index 0000000000..d89bc5cf29
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-6-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-6-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-6-16@2x.png
new file mode 100644
index 0000000000..48175d2acf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-6-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-6-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-6-16~dark.png
new file mode 100644
index 0000000000..3bd6210d1f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-6-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-pushing-6-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-pushing-6-16~dark@2x.png
new file mode 100644
index 0000000000..20ee728c7c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-pushing-6-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-ready-14.png b/main/src/core/MonoDevelop.Ide/icons/status-ready-14.png
deleted file mode 100644
index 85e51a0e89..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-ready-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-ready-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-ready-14@2x.png
deleted file mode 100644
index f6347902db..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-ready-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-ready-16.png b/main/src/core/MonoDevelop.Ide/icons/status-ready-16.png
new file mode 100644
index 0000000000..30ec1f5e63
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-ready-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-ready-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-ready-16@2x.png
new file mode 100644
index 0000000000..8bcc769778
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-ready-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-ready-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-ready-16~dark.png
new file mode 100644
index 0000000000..d3f5178df2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-ready-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-ready-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-ready-16~dark@2x.png
new file mode 100644
index 0000000000..1d4591c31d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-ready-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-1-14.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-1-14.png
deleted file mode 100644
index 51b2c395e1..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-searching-1-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-1-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-1-14@2x.png
deleted file mode 100644
index f3db727139..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-searching-1-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-1-16.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-1-16.png
new file mode 100644
index 0000000000..89fee6dfbc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-searching-1-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-1-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-1-16@2x.png
new file mode 100644
index 0000000000..e33f9da7af
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-searching-1-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-1-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-1-16~dark.png
new file mode 100644
index 0000000000..5811a6939d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-searching-1-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-1-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-1-16~dark@2x.png
new file mode 100644
index 0000000000..ca0321540f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-searching-1-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-2-14.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-2-14.png
deleted file mode 100644
index a767357688..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-searching-2-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-2-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-2-14@2x.png
deleted file mode 100644
index 51eba469a1..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-searching-2-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-2-16.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-2-16.png
new file mode 100644
index 0000000000..210b7355f3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-searching-2-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-2-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-2-16@2x.png
new file mode 100644
index 0000000000..ec5f11bbec
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-searching-2-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-2-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-2-16~dark.png
new file mode 100644
index 0000000000..a4ddfb706a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-searching-2-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-2-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-2-16~dark@2x.png
new file mode 100644
index 0000000000..9831b667aa
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-searching-2-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-3-14.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-3-14.png
deleted file mode 100644
index 7d3222a1fa..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-searching-3-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-3-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-3-14@2x.png
deleted file mode 100644
index 9ba69b21e0..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-searching-3-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-3-16.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-3-16.png
new file mode 100644
index 0000000000..9cb9b069e4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-searching-3-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-3-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-3-16@2x.png
new file mode 100644
index 0000000000..b9981b9e05
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-searching-3-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-3-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-3-16~dark.png
new file mode 100644
index 0000000000..e72f403a5d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-searching-3-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-3-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-3-16~dark@2x.png
new file mode 100644
index 0000000000..da5690d900
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-searching-3-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-4-14.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-4-14.png
deleted file mode 100644
index 7d3222a1fa..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-searching-4-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-4-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-4-14@2x.png
deleted file mode 100644
index 36f6b433b2..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-searching-4-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-4-16.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-4-16.png
new file mode 100644
index 0000000000..54e2b44607
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-searching-4-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-4-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-4-16@2x.png
new file mode 100644
index 0000000000..ec729fd00a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-searching-4-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-4-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-4-16~dark.png
new file mode 100644
index 0000000000..1095f61f8f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-searching-4-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-searching-4-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-searching-4-16~dark@2x.png
new file mode 100644
index 0000000000..c4fc648428
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-searching-4-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-success-14.png b/main/src/core/MonoDevelop.Ide/icons/status-success-14.png
deleted file mode 100644
index 62a9df3a28..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-success-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-success-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-success-14@2x.png
deleted file mode 100644
index fb45b68058..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-success-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-success-16.png b/main/src/core/MonoDevelop.Ide/icons/status-success-16.png
new file mode 100644
index 0000000000..b828726029
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-success-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-success-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-success-16@2x.png
new file mode 100644
index 0000000000..ac7b095f29
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-success-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-success-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-success-16~dark.png
new file mode 100644
index 0000000000..c30da04130
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-success-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-success-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-success-16~dark@2x.png
new file mode 100644
index 0000000000..f4785e34d2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-success-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-1-16.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-1-16.png
new file mode 100644
index 0000000000..a625ccee7e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-1-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-1-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-1-16@2x.png
new file mode 100644
index 0000000000..e0e1accff8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-1-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-1-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-1-16~dark.png
new file mode 100644
index 0000000000..8920ca8309
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-1-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-1-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-1-16~dark@2x.png
new file mode 100644
index 0000000000..bd30876c89
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-1-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-16.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-16.png
index 447e6fa8f9..447e6fa8f9 100644
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-16@2x.png
index 254cd96138..254cd96138 100644
--- a/main/src/core/MonoDevelop.Ide/icons/mac/status-updates-downloading-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-2-16.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-2-16.png
new file mode 100644
index 0000000000..872d66c3cd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-2-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-2-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-2-16@2x.png
new file mode 100644
index 0000000000..0fabad263a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-2-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-2-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-2-16~dark.png
new file mode 100644
index 0000000000..c4a014f048
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-2-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-2-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-2-16~dark@2x.png
new file mode 100644
index 0000000000..f5859f7127
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-2-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-3-16.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-3-16.png
new file mode 100644
index 0000000000..87512b1ce9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-3-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-3-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-3-16@2x.png
new file mode 100644
index 0000000000..5e4336a3b2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-3-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-3-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-3-16~dark.png
new file mode 100644
index 0000000000..7ad2288a8a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-3-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-3-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-3-16~dark@2x.png
new file mode 100644
index 0000000000..0a20b61a00
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-3-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-4-16.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-4-16.png
new file mode 100644
index 0000000000..1d2f81fe12
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-4-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-4-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-4-16@2x.png
new file mode 100644
index 0000000000..937c6be098
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-4-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-4-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-4-16~dark.png
new file mode 100644
index 0000000000..584d70323c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-4-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-4-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-4-16~dark@2x.png
new file mode 100644
index 0000000000..9cac65ea61
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-4-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-5-16.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-5-16.png
new file mode 100644
index 0000000000..57f844698a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-5-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-5-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-5-16@2x.png
new file mode 100644
index 0000000000..0c4578ad5a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-5-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-5-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-5-16~dark.png
new file mode 100644
index 0000000000..2c2c41f20c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-5-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-5-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-5-16~dark@2x.png
new file mode 100644
index 0000000000..3efdb48f40
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-5-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-6-16.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-6-16.png
new file mode 100644
index 0000000000..fde5bb74b1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-6-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-6-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-6-16@2x.png
new file mode 100644
index 0000000000..a235860c76
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-6-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-6-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-6-16~dark.png
new file mode 100644
index 0000000000..f464596c8c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-6-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-6-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-6-16~dark@2x.png
new file mode 100644
index 0000000000..4a2c16f45a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-downloading-6-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-paused-16.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-paused-16.png
new file mode 100644
index 0000000000..c8801ab470
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-paused-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-paused-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-paused-16@2x.png
new file mode 100644
index 0000000000..5d9c6c13ff
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-paused-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-paused-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-paused-16~dark.png
new file mode 100644
index 0000000000..1f4757ab35
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-paused-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-paused-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-paused-16~dark@2x.png
new file mode 100644
index 0000000000..40e26a1c08
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-paused-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-ready-16.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-ready-16.png
new file mode 100644
index 0000000000..a625ccee7e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-ready-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-ready-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-ready-16@2x.png
new file mode 100644
index 0000000000..e0e1accff8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-ready-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-ready-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-ready-16~dark.png
new file mode 100644
index 0000000000..8920ca8309
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-ready-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-updates-ready-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-updates-ready-16~dark@2x.png
new file mode 100644
index 0000000000..bd30876c89
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-updates-ready-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-1-14.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-1-14.png
deleted file mode 100644
index 46bcd36296..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-waiting-1-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-1-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-1-14@2x.png
deleted file mode 100644
index d223e473fc..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-waiting-1-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-1-16.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-1-16.png
new file mode 100644
index 0000000000..db26f18dcc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-waiting-1-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-1-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-1-16@2x.png
new file mode 100644
index 0000000000..a12860f5b8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-waiting-1-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-1-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-1-16~dark.png
new file mode 100644
index 0000000000..f3348b66d7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-waiting-1-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-1-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-1-16~dark@2x.png
new file mode 100644
index 0000000000..d734ffe8a7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-waiting-1-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-2-14.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-2-14.png
deleted file mode 100644
index b7d78f7bc1..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-waiting-2-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-2-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-2-14@2x.png
deleted file mode 100644
index 6a1b63bca9..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-waiting-2-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-2-16.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-2-16.png
new file mode 100644
index 0000000000..e6f03f2340
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-waiting-2-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-2-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-2-16@2x.png
new file mode 100644
index 0000000000..0b6104e7de
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-waiting-2-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-2-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-2-16~dark.png
new file mode 100644
index 0000000000..31361339f0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-waiting-2-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-2-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-2-16~dark@2x.png
new file mode 100644
index 0000000000..45094d7bf5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-waiting-2-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-3-14.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-3-14.png
deleted file mode 100644
index 778197b418..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-waiting-3-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-3-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-3-14@2x.png
deleted file mode 100644
index 8832d93af8..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-waiting-3-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-3-16.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-3-16.png
new file mode 100644
index 0000000000..5654a4e518
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-waiting-3-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-3-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-3-16@2x.png
new file mode 100644
index 0000000000..4a9c5a6ccb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-waiting-3-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-3-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-3-16~dark.png
new file mode 100644
index 0000000000..8076ad64d4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-waiting-3-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-3-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-3-16~dark@2x.png
new file mode 100644
index 0000000000..027a7bff9d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-waiting-3-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-4-14.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-4-14.png
deleted file mode 100644
index bd3aada045..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-waiting-4-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-4-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-4-14@2x.png
deleted file mode 100644
index 910e6006e7..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-waiting-4-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-4-16.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-4-16.png
new file mode 100644
index 0000000000..c643719b2b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-waiting-4-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-4-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-4-16@2x.png
new file mode 100644
index 0000000000..4db7552a18
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-waiting-4-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-4-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-4-16~dark.png
new file mode 100644
index 0000000000..214a3d11ee
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-waiting-4-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-4-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-4-16~dark@2x.png
new file mode 100644
index 0000000000..ab5a6489ed
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-waiting-4-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-5-14.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-5-14.png
deleted file mode 100644
index c6ca97cdac..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-waiting-5-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-5-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-5-14@2x.png
deleted file mode 100644
index 1d65ac1a40..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-waiting-5-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-5-16.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-5-16.png
new file mode 100644
index 0000000000..c9b2c9538b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-waiting-5-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-5-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-5-16@2x.png
new file mode 100644
index 0000000000..3dc8b372ad
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-waiting-5-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-5-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-5-16~dark.png
new file mode 100644
index 0000000000..10bd19cabd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-waiting-5-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-waiting-5-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-waiting-5-16~dark@2x.png
new file mode 100644
index 0000000000..32559e6194
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-waiting-5-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-warning-14.png b/main/src/core/MonoDevelop.Ide/icons/status-warning-14.png
deleted file mode 100644
index 62879ed42f..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-warning-14.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-warning-14@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-warning-14@2x.png
deleted file mode 100644
index 65156cf8fb..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/status-warning-14@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-warning-16.png b/main/src/core/MonoDevelop.Ide/icons/status-warning-16.png
new file mode 100644
index 0000000000..a7e776e42f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-warning-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-warning-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-warning-16@2x.png
new file mode 100644
index 0000000000..a1fe8c14f2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-warning-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-warning-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-warning-16~dark.png
new file mode 100644
index 0000000000..6b9ae34540
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-warning-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-warning-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-warning-16~dark@2x.png
new file mode 100644
index 0000000000..de6759fe54
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-warning-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-warning-count-16.png b/main/src/core/MonoDevelop.Ide/icons/status-warning-count-16.png
new file mode 100644
index 0000000000..c6b7bab537
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-warning-count-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-warning-count-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-warning-count-16@2x.png
new file mode 100644
index 0000000000..3007a209bb
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-warning-count-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-warning-count-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/status-warning-count-16~dark.png
new file mode 100644
index 0000000000..9d1cde0661
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-warning-count-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/status-warning-count-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/status-warning-count-16~dark@2x.png
new file mode 100644
index 0000000000..5657d7dd35
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/status-warning-count-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/stop-16.png b/main/src/core/MonoDevelop.Ide/icons/stop-16.png
index ea37d34b8c..d8ca4c84de 100644
--- a/main/src/core/MonoDevelop.Ide/icons/stop-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/stop-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/stop-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/stop-16@2x.png
index d281d4f5be..b153b2253f 100644
--- a/main/src/core/MonoDevelop.Ide/icons/stop-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/stop-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/stop-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/stop-16~dark.png
new file mode 100644
index 0000000000..bb75fd9317
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/stop-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/stop-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/stop-16~dark@2x.png
new file mode 100644
index 0000000000..519db4744c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/stop-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/stop-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/stop-16~dark~disabled.png
new file mode 100644
index 0000000000..efd809bb13
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/stop-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/stop-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/stop-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..3698cb13e3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/stop-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/stop-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/stop-16~disabled.png
new file mode 100644
index 0000000000..681e77c03f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/stop-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/stop-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/stop-16~disabled@2x.png
new file mode 100644
index 0000000000..e71b1ee5bf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/stop-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tab-close-9.png b/main/src/core/MonoDevelop.Ide/icons/tab-close-9.png
new file mode 100644
index 0000000000..13e13896ae
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tab-close-9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tab-close-9@2x.png b/main/src/core/MonoDevelop.Ide/icons/tab-close-9@2x.png
new file mode 100644
index 0000000000..b33f4ca909
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tab-close-9@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tab-close-9~dark.png b/main/src/core/MonoDevelop.Ide/icons/tab-close-9~dark.png
new file mode 100644
index 0000000000..f3fadb1ad9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tab-close-9~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tab-close-9~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/tab-close-9~dark@2x.png
new file mode 100644
index 0000000000..d27ac42628
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tab-close-9~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tab-dirty-9.png b/main/src/core/MonoDevelop.Ide/icons/tab-dirty-9.png
new file mode 100644
index 0000000000..606d253526
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tab-dirty-9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tab-dirty-9@2x.png b/main/src/core/MonoDevelop.Ide/icons/tab-dirty-9@2x.png
new file mode 100644
index 0000000000..4bfe37a699
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tab-dirty-9@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tab-dirty-9~dark.png b/main/src/core/MonoDevelop.Ide/icons/tab-dirty-9~dark.png
new file mode 100644
index 0000000000..c3e997f674
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tab-dirty-9~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tab-dirty-9~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/tab-dirty-9~dark@2x.png
new file mode 100644
index 0000000000..016026927d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tab-dirty-9~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-12.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-12.png
new file mode 100644
index 0000000000..8af039b705
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-12.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-12@2x.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-12@2x.png
new file mode 100644
index 0000000000..44ceec7d3f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-12@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-12~dark.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-12~dark.png
new file mode 100644
index 0000000000..63c076ca89
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-12~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-12~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-12~dark@2x.png
new file mode 100644
index 0000000000..a094a2328f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-12~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-hover-12.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-hover-12.png
new file mode 100644
index 0000000000..8a411fb413
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-hover-12.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-hover-12@2x.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-hover-12@2x.png
new file mode 100644
index 0000000000..84b2caa036
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-hover-12@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-hover-12~dark.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-hover-12~dark.png
new file mode 100644
index 0000000000..54afcbe1b9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-hover-12~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-hover-12~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-hover-12~dark@2x.png
new file mode 100644
index 0000000000..37aea57bb8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-menu-hover-12~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-next-12.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-next-12.png
index 55d4079ff3..2e2d84cd68 100644
--- a/main/src/core/MonoDevelop.Ide/icons/tabbar-next-12.png
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-next-12.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-next-12@2x.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-next-12@2x.png
index 794071b147..5b80abf2f5 100644
--- a/main/src/core/MonoDevelop.Ide/icons/tabbar-next-12@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-next-12@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-next-12~dark.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-next-12~dark.png
new file mode 100644
index 0000000000..bac5a45834
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-next-12~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-next-12~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-next-12~dark@2x.png
new file mode 100644
index 0000000000..b230a74b75
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-next-12~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-next-hover-12.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-next-hover-12.png
new file mode 100644
index 0000000000..7c6e99f91e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-next-hover-12.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-next-hover-12@2x.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-next-hover-12@2x.png
new file mode 100644
index 0000000000..aa0a13572b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-next-hover-12@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-next-hover-12~dark.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-next-hover-12~dark.png
new file mode 100644
index 0000000000..d63b453359
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-next-hover-12~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-next-hover-12~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-next-hover-12~dark@2x.png
new file mode 100644
index 0000000000..606d753c2a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-next-hover-12~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-12.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-12.png
index 80268b5d56..724c1c263c 100644
--- a/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-12.png
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-12.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-12@2x.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-12@2x.png
index f8c627257b..9dcd26d387 100644
--- a/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-12@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-12@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-12~dark.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-12~dark.png
new file mode 100644
index 0000000000..c3497902c5
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-12~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-12~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-12~dark@2x.png
new file mode 100644
index 0000000000..25d259334d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-12~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-hover-12.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-hover-12.png
new file mode 100644
index 0000000000..5d137229f8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-hover-12.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-hover-12@2x.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-hover-12@2x.png
new file mode 100644
index 0000000000..74ab8a02cd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-hover-12@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-hover-12~dark.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-hover-12~dark.png
new file mode 100644
index 0000000000..f20863078c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-hover-12~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-hover-12~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-hover-12~dark@2x.png
new file mode 100644
index 0000000000..aeca7ec51f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/tabbar-prev-hover-12~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/toggle-bookmark-16.png b/main/src/core/MonoDevelop.Ide/icons/toggle-bookmark-16.png
deleted file mode 100644
index bd2686ed6e..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/toggle-bookmark-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tree-popup-button-down.png b/main/src/core/MonoDevelop.Ide/icons/tree-popup-button-down.png
deleted file mode 100644
index 5e9a7c9af5..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/tree-popup-button-down.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tree-popup-button-down@2x.png b/main/src/core/MonoDevelop.Ide/icons/tree-popup-button-down@2x.png
deleted file mode 100644
index e761190da0..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/tree-popup-button-down@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tree-popup-button-hover.png b/main/src/core/MonoDevelop.Ide/icons/tree-popup-button-hover.png
deleted file mode 100644
index 9d332a8895..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/tree-popup-button-hover.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tree-popup-button-hover@2x.png b/main/src/core/MonoDevelop.Ide/icons/tree-popup-button-hover@2x.png
deleted file mode 100644
index f9be6278cd..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/tree-popup-button-hover@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tree-popup-button.png b/main/src/core/MonoDevelop.Ide/icons/tree-popup-button.png
deleted file mode 100644
index 7736c0afe1..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/tree-popup-button.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/tree-popup-button@2x.png b/main/src/core/MonoDevelop.Ide/icons/tree-popup-button@2x.png
deleted file mode 100644
index 7f91e0d448..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/tree-popup-button@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/undo-16.png b/main/src/core/MonoDevelop.Ide/icons/undo-16.png
index 8a5836ce43..7d916d7bfb 100644
--- a/main/src/core/MonoDevelop.Ide/icons/undo-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/undo-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/undo-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/undo-16@2x.png
index 103f68d4bd..797a0e884e 100644
--- a/main/src/core/MonoDevelop.Ide/icons/undo-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/undo-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/undo-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/undo-16~dark.png
new file mode 100644
index 0000000000..b9d4ed2cd8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/undo-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/undo-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/undo-16~dark@2x.png
new file mode 100644
index 0000000000..dd24aa8dfd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/undo-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/undo-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/undo-16~dark~disabled.png
new file mode 100644
index 0000000000..838eb4808f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/undo-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/undo-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/undo-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..d2eb075a9f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/undo-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/undo-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/undo-16~disabled.png
new file mode 100644
index 0000000000..a15f5fd13c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/undo-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/undo-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/undo-16~disabled@2x.png
new file mode 100644
index 0000000000..4650a1f88e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/undo-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/unindent-16.png b/main/src/core/MonoDevelop.Ide/icons/unindent-16.png
new file mode 100644
index 0000000000..a62d09e651
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/unindent-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/unindent-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/unindent-16@2x.png
new file mode 100644
index 0000000000..75db3fea50
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/unindent-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/unindent-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/unindent-16~dark.png
new file mode 100644
index 0000000000..fa0d183936
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/unindent-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/unindent-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/unindent-16~dark@2x.png
new file mode 100644
index 0000000000..932c258758
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/unindent-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/unstar-16.png b/main/src/core/MonoDevelop.Ide/icons/unstar-16.png
index 39bfa485a2..dfd3f6321e 100644
--- a/main/src/core/MonoDevelop.Ide/icons/unstar-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/unstar-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/unstar-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/unstar-16@2x.png
index 0d191beceb..c9db385972 100644
--- a/main/src/core/MonoDevelop.Ide/icons/unstar-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/unstar-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/unstar-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/unstar-16~dark.png
new file mode 100644
index 0000000000..602bdb0248
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/unstar-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/unstar-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/unstar-16~dark@2x.png
new file mode 100644
index 0000000000..c2caa5e045
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/unstar-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/unstar-hover-16.png b/main/src/core/MonoDevelop.Ide/icons/unstar-hover-16.png
index ea839f22dd..98da41f29d 100644
--- a/main/src/core/MonoDevelop.Ide/icons/unstar-hover-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/unstar-hover-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/unstar-hover-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/unstar-hover-16@2x.png
index 0d95bf65ee..fc2bb00ac6 100644
--- a/main/src/core/MonoDevelop.Ide/icons/unstar-hover-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/unstar-hover-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/unstar-overlay-16.png b/main/src/core/MonoDevelop.Ide/icons/unstar-overlay-16.png
deleted file mode 100644
index 88a8a49409..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/unstar-overlay-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/unstar-overlay-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/unstar-overlay-16@2x.png
deleted file mode 100644
index d3ee714237..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/unstar-overlay-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/unstar-overlay-hover-16.png b/main/src/core/MonoDevelop.Ide/icons/unstar-overlay-hover-16.png
deleted file mode 100644
index 72bef5d614..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/unstar-overlay-hover-16.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/unstar-overlay-hover-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/unstar-overlay-hover-16@2x.png
deleted file mode 100644
index 8130f45dcc..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/unstar-overlay-hover-16@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/updates-16.png b/main/src/core/MonoDevelop.Ide/icons/updates-16.png
index 818f09fb65..97df672bde 100644
--- a/main/src/core/MonoDevelop.Ide/icons/updates-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/updates-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/updates-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/updates-16@2x.png
index 0582e35d0c..c7cad401de 100644
--- a/main/src/core/MonoDevelop.Ide/icons/updates-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/updates-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/updates-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/updates-16~dark.png
new file mode 100644
index 0000000000..efce32bec9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/updates-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/updates-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/updates-16~dark@2x.png
new file mode 100644
index 0000000000..90636c76ac
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/updates-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/updates-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/updates-16~dark~disabled.png
new file mode 100644
index 0000000000..19c4501c67
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/updates-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/updates-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/updates-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..b7b53642f9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/updates-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/updates-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/updates-16~disabled.png
new file mode 100644
index 0000000000..2696c86328
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/updates-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/updates-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/updates-16~disabled@2x.png
new file mode 100644
index 0000000000..09a8f84eea
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/updates-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-16.png b/main/src/core/MonoDevelop.Ide/icons/warning-16.png
index 36e3484d08..0b0b0b1f4d 100644
--- a/main/src/core/MonoDevelop.Ide/icons/warning-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/warning-16@2x.png
index c457998b0a..8dd44e1912 100644
--- a/main/src/core/MonoDevelop.Ide/icons/warning-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/warning-16~dark.png
new file mode 100644
index 0000000000..3c7035f038
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/warning-16~dark@2x.png
new file mode 100644
index 0000000000..2fd1c15cb9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/warning-16~dark~sel.png
new file mode 100644
index 0000000000..b4345ae86d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/warning-16~dark~sel@2x.png
new file mode 100644
index 0000000000..fec3df50da
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/warning-16~sel.png
new file mode 100644
index 0000000000..b4345ae86d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/warning-16~sel@2x.png
new file mode 100644
index 0000000000..fec3df50da
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-24.png b/main/src/core/MonoDevelop.Ide/icons/warning-24.png
index 433eaa4bea..45558c17a4 100644
--- a/main/src/core/MonoDevelop.Ide/icons/warning-24.png
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-24.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-24@2x.png b/main/src/core/MonoDevelop.Ide/icons/warning-24@2x.png
index a91093e50b..d05d776c65 100644
--- a/main/src/core/MonoDevelop.Ide/icons/warning-24@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-24@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-24~dark.png b/main/src/core/MonoDevelop.Ide/icons/warning-24~dark.png
new file mode 100644
index 0000000000..f4a158b26a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-24~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-24~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/warning-24~dark@2x.png
new file mode 100644
index 0000000000..142ffe58b2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-24~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-24~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/warning-24~dark~sel.png
new file mode 100644
index 0000000000..b847a63a47
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-24~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-24~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/warning-24~dark~sel@2x.png
new file mode 100644
index 0000000000..145afde3a1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-24~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-24~sel.png b/main/src/core/MonoDevelop.Ide/icons/warning-24~sel.png
new file mode 100644
index 0000000000..b847a63a47
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-24~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-24~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/warning-24~sel@2x.png
new file mode 100644
index 0000000000..145afde3a1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-24~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-32.png b/main/src/core/MonoDevelop.Ide/icons/warning-32.png
index c457998b0a..8dd44e1912 100644
--- a/main/src/core/MonoDevelop.Ide/icons/warning-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/warning-32@2x.png
index 1af1904486..1a83da5135 100644
--- a/main/src/core/MonoDevelop.Ide/icons/warning-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/warning-32~dark.png
new file mode 100644
index 0000000000..2fd1c15cb9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/warning-32~dark@2x.png
new file mode 100644
index 0000000000..c579d44d95
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/warning-32~dark~sel.png
new file mode 100644
index 0000000000..fec3df50da
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/warning-32~dark~sel@2x.png
new file mode 100644
index 0000000000..b8b7e11b7a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/warning-32~sel.png
new file mode 100644
index 0000000000..fec3df50da
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/warning-32~sel@2x.png
new file mode 100644
index 0000000000..b8b7e11b7a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-48.png b/main/src/core/MonoDevelop.Ide/icons/warning-48.png
index a91093e50b..d05d776c65 100644
--- a/main/src/core/MonoDevelop.Ide/icons/warning-48.png
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-48.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-48@2x.png b/main/src/core/MonoDevelop.Ide/icons/warning-48@2x.png
index 87fe80f662..33451e9571 100644
--- a/main/src/core/MonoDevelop.Ide/icons/warning-48@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-48@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-48~dark.png b/main/src/core/MonoDevelop.Ide/icons/warning-48~dark.png
new file mode 100644
index 0000000000..142ffe58b2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-48~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-48~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/warning-48~dark@2x.png
new file mode 100644
index 0000000000..116d965478
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-48~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-48~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/warning-48~dark~sel.png
new file mode 100644
index 0000000000..145afde3a1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-48~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-48~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/warning-48~dark~sel@2x.png
new file mode 100644
index 0000000000..cb69a0c91f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-48~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-48~sel.png b/main/src/core/MonoDevelop.Ide/icons/warning-48~sel.png
new file mode 100644
index 0000000000..145afde3a1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-48~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-48~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/warning-48~sel@2x.png
new file mode 100644
index 0000000000..cb69a0c91f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/warning-48~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-8.png b/main/src/core/MonoDevelop.Ide/icons/warning-8.png
deleted file mode 100644
index 888e69f00f..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/warning-8.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-8@2x.png b/main/src/core/MonoDevelop.Ide/icons/warning-8@2x.png
deleted file mode 100644
index 36e3484d08..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/warning-8@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-overlay-9.png b/main/src/core/MonoDevelop.Ide/icons/warning-overlay-9.png
deleted file mode 100644
index dcd12f891c..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/warning-overlay-9.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/warning-overlay-9@2x.png b/main/src/core/MonoDevelop.Ide/icons/warning-overlay-9@2x.png
deleted file mode 100644
index 2b640aeaf8..0000000000
--- a/main/src/core/MonoDevelop.Ide/icons/warning-overlay-9@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/web-search-16.png b/main/src/core/MonoDevelop.Ide/icons/web-search-16.png
index 2cef329e0d..7ff800d40b 100755..100644
--- a/main/src/core/MonoDevelop.Ide/icons/web-search-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/web-search-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/web-search-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/web-search-16@2x.png
new file mode 100644
index 0000000000..6fd81ad64d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/web-search-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/web-search-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/web-search-16~dark.png
new file mode 100644
index 0000000000..2ac4184d75
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/web-search-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/web-search-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/web-search-16~dark@2x.png
new file mode 100644
index 0000000000..7a0d07118d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/web-search-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/web-search-16~dark~disabled.png b/main/src/core/MonoDevelop.Ide/icons/web-search-16~dark~disabled.png
new file mode 100644
index 0000000000..f923f1c3a2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/web-search-16~dark~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/web-search-16~dark~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/web-search-16~dark~disabled@2x.png
new file mode 100644
index 0000000000..5577b0dd83
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/web-search-16~dark~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/web-search-16~disabled.png b/main/src/core/MonoDevelop.Ide/icons/web-search-16~disabled.png
new file mode 100644
index 0000000000..fe87b409de
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/web-search-16~disabled.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/web-search-16~disabled@2x.png b/main/src/core/MonoDevelop.Ide/icons/web-search-16~disabled@2x.png
new file mode 100644
index 0000000000..bca664c136
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/web-search-16~disabled@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/workspace-16.png b/main/src/core/MonoDevelop.Ide/icons/workspace-16.png
index 41551f2dd6..5f3599664e 100644
--- a/main/src/core/MonoDevelop.Ide/icons/workspace-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/workspace-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/workspace-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/workspace-16@2x.png
index a882b794f5..2d91a9b7de 100644
--- a/main/src/core/MonoDevelop.Ide/icons/workspace-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/workspace-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/workspace-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/workspace-16~dark.png
new file mode 100644
index 0000000000..69ba1115d3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/workspace-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/workspace-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/workspace-16~dark@2x.png
new file mode 100644
index 0000000000..4e8b63f9a0
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/workspace-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/workspace-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/workspace-16~dark~sel.png
new file mode 100644
index 0000000000..d5f1a83c76
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/workspace-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/workspace-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/workspace-16~dark~sel@2x.png
new file mode 100644
index 0000000000..c9dee101c6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/workspace-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/workspace-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/workspace-16~sel.png
new file mode 100644
index 0000000000..d5f1a83c76
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/workspace-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/workspace-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/workspace-16~sel@2x.png
new file mode 100644
index 0000000000..c9dee101c6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/workspace-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/workspace-32.png b/main/src/core/MonoDevelop.Ide/icons/workspace-32.png
index a882b794f5..fca97a0ac5 100644
--- a/main/src/core/MonoDevelop.Ide/icons/workspace-32.png
+++ b/main/src/core/MonoDevelop.Ide/icons/workspace-32.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/workspace-32@2x.png b/main/src/core/MonoDevelop.Ide/icons/workspace-32@2x.png
index 210a597e86..a36618ceb6 100644
--- a/main/src/core/MonoDevelop.Ide/icons/workspace-32@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/workspace-32@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/workspace-32~dark.png b/main/src/core/MonoDevelop.Ide/icons/workspace-32~dark.png
new file mode 100644
index 0000000000..b98c1f2a43
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/workspace-32~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/workspace-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/workspace-32~dark@2x.png
new file mode 100644
index 0000000000..c59a3f46a1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/workspace-32~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/workspace-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/workspace-32~dark~sel.png
new file mode 100644
index 0000000000..c9dee101c6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/workspace-32~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/workspace-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/workspace-32~dark~sel@2x.png
new file mode 100644
index 0000000000..9d3f476f12
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/workspace-32~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/workspace-32~sel.png b/main/src/core/MonoDevelop.Ide/icons/workspace-32~sel.png
new file mode 100644
index 0000000000..c9dee101c6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/workspace-32~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/workspace-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/workspace-32~sel@2x.png
new file mode 100644
index 0000000000..9d3f476f12
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/workspace-32~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16.png b/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16.png
new file mode 100644
index 0000000000..fe4bde6b69
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16@2x.png
new file mode 100644
index 0000000000..3040157d01
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~dark.png
new file mode 100644
index 0000000000..90f14ea1f9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~dark@2x.png
new file mode 100644
index 0000000000..747f6f7831
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~dark~sel.png
new file mode 100644
index 0000000000..390cd220f1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~dark~sel@2x.png
new file mode 100644
index 0000000000..10f99b72bc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~sel.png
new file mode 100644
index 0000000000..390cd220f1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~sel@2x.png
new file mode 100644
index 0000000000..10f99b72bc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-actual-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-in-16.png b/main/src/core/MonoDevelop.Ide/icons/zoom-in-16.png
index 74a0653a80..89f96d6eb4 100644
--- a/main/src/core/MonoDevelop.Ide/icons/zoom-in-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-in-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-in-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/zoom-in-16@2x.png
index a92d18dfa0..ea4ebe9b93 100644
--- a/main/src/core/MonoDevelop.Ide/icons/zoom-in-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-in-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-in-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/zoom-in-16~dark.png
new file mode 100644
index 0000000000..63c1b9583f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-in-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-in-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/zoom-in-16~dark@2x.png
new file mode 100644
index 0000000000..0c3743b875
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-in-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-in-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/zoom-in-16~dark~sel.png
new file mode 100644
index 0000000000..099e4df0d4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-in-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-in-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/zoom-in-16~dark~sel@2x.png
new file mode 100644
index 0000000000..3da3e51f2d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-in-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-in-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/zoom-in-16~sel.png
new file mode 100644
index 0000000000..099e4df0d4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-in-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-in-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/zoom-in-16~sel@2x.png
new file mode 100644
index 0000000000..3da3e51f2d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-in-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-out-16.png b/main/src/core/MonoDevelop.Ide/icons/zoom-out-16.png
index ea2ea187f3..e62bb360c3 100644
--- a/main/src/core/MonoDevelop.Ide/icons/zoom-out-16.png
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-out-16.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-out-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/zoom-out-16@2x.png
index 34e563fcce..7a7c751f83 100644
--- a/main/src/core/MonoDevelop.Ide/icons/zoom-out-16@2x.png
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-out-16@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-out-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/zoom-out-16~dark.png
new file mode 100644
index 0000000000..ccc5001f47
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-out-16~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-out-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/zoom-out-16~dark@2x.png
new file mode 100644
index 0000000000..e44abcbb96
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-out-16~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-out-16~dark~sel.png b/main/src/core/MonoDevelop.Ide/icons/zoom-out-16~dark~sel.png
new file mode 100644
index 0000000000..679f582947
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-out-16~dark~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-out-16~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/zoom-out-16~dark~sel@2x.png
new file mode 100644
index 0000000000..33dc3c1f58
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-out-16~dark~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-out-16~sel.png b/main/src/core/MonoDevelop.Ide/icons/zoom-out-16~sel.png
new file mode 100644
index 0000000000..679f582947
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-out-16~sel.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/icons/zoom-out-16~sel@2x.png b/main/src/core/MonoDevelop.Ide/icons/zoom-out-16~sel@2x.png
new file mode 100644
index 0000000000..33dc3c1f58
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/icons/zoom-out-16~sel@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/padbar-active.9.png b/main/src/core/MonoDevelop.Ide/resources/padbar-active.9.png
new file mode 100644
index 0000000000..4e88080bc1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/padbar-active.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/padbar-active@2x.9.png b/main/src/core/MonoDevelop.Ide/resources/padbar-active@2x.9.png
new file mode 100644
index 0000000000..a37ce00b0b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/padbar-active@2x.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/padbar-active~dark.9.png b/main/src/core/MonoDevelop.Ide/resources/padbar-active~dark.9.png
new file mode 100644
index 0000000000..ace406f87a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/padbar-active~dark.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/padbar-active~dark@2x.9.png b/main/src/core/MonoDevelop.Ide/resources/padbar-active~dark@2x.9.png
new file mode 100644
index 0000000000..3b86e914cf
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/padbar-active~dark@2x.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/padbar-back.9.png b/main/src/core/MonoDevelop.Ide/resources/padbar-back.9.png
new file mode 100644
index 0000000000..225177e867
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/padbar-back.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/padbar-back@2x.9.png b/main/src/core/MonoDevelop.Ide/resources/padbar-back@2x.9.png
new file mode 100644
index 0000000000..8d9fdd04d7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/padbar-back@2x.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/padbar-back~dark.9.png b/main/src/core/MonoDevelop.Ide/resources/padbar-back~dark.9.png
new file mode 100644
index 0000000000..b71ec9ba7a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/padbar-back~dark.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/padbar-back~dark@2x.9.png b/main/src/core/MonoDevelop.Ide/resources/padbar-back~dark@2x.9.png
new file mode 100644
index 0000000000..90d21b5a70
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/padbar-back~dark@2x.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/padbar-inactive.9.png b/main/src/core/MonoDevelop.Ide/resources/padbar-inactive.9.png
new file mode 100644
index 0000000000..7138ae8161
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/padbar-inactive.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/padbar-inactive@2x.9.png b/main/src/core/MonoDevelop.Ide/resources/padbar-inactive@2x.9.png
new file mode 100644
index 0000000000..29f2eb74b4
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/padbar-inactive@2x.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/padbar-inactive~dark.9.png b/main/src/core/MonoDevelop.Ide/resources/padbar-inactive~dark.9.png
new file mode 100644
index 0000000000..487b6ab6c3
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/padbar-inactive~dark.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/padbar-inactive~dark@2x.9.png b/main/src/core/MonoDevelop.Ide/resources/padbar-inactive~dark@2x.9.png
new file mode 100644
index 0000000000..f37bd4cd8d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/padbar-inactive~dark@2x.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/tabbar-active.9.png b/main/src/core/MonoDevelop.Ide/resources/tabbar-active.9.png
new file mode 100644
index 0000000000..4897a34497
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/tabbar-active.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/tabbar-active@2x.9.png b/main/src/core/MonoDevelop.Ide/resources/tabbar-active@2x.9.png
new file mode 100644
index 0000000000..b5151e049a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/tabbar-active@2x.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/tabbar-active~dark.9.png b/main/src/core/MonoDevelop.Ide/resources/tabbar-active~dark.9.png
new file mode 100644
index 0000000000..3bc15da732
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/tabbar-active~dark.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/tabbar-active~dark@2x.9.png b/main/src/core/MonoDevelop.Ide/resources/tabbar-active~dark@2x.9.png
new file mode 100644
index 0000000000..60dc5f3248
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/tabbar-active~dark@2x.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/tabbar-back.9.png b/main/src/core/MonoDevelop.Ide/resources/tabbar-back.9.png
new file mode 100644
index 0000000000..225177e867
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/tabbar-back.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/tabbar-back@2x.9.png b/main/src/core/MonoDevelop.Ide/resources/tabbar-back@2x.9.png
new file mode 100644
index 0000000000..8d9fdd04d7
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/tabbar-back@2x.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/tabbar-back~dark.9.png b/main/src/core/MonoDevelop.Ide/resources/tabbar-back~dark.9.png
new file mode 100644
index 0000000000..b71ec9ba7a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/tabbar-back~dark.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/tabbar-back~dark@2x.9.png b/main/src/core/MonoDevelop.Ide/resources/tabbar-back~dark@2x.9.png
new file mode 100644
index 0000000000..90d21b5a70
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/tabbar-back~dark@2x.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/tabbar-inactive.9.png b/main/src/core/MonoDevelop.Ide/resources/tabbar-inactive.9.png
new file mode 100644
index 0000000000..4db47df2e8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/tabbar-inactive.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/tabbar-inactive@2x.9.png b/main/src/core/MonoDevelop.Ide/resources/tabbar-inactive@2x.9.png
new file mode 100644
index 0000000000..3b51031327
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/tabbar-inactive@2x.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/tabbar-inactive~dark.9.png b/main/src/core/MonoDevelop.Ide/resources/tabbar-inactive~dark.9.png
new file mode 100644
index 0000000000..2f3222c6da
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/tabbar-inactive~dark.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/resources/tabbar-inactive~dark@2x.9.png b/main/src/core/MonoDevelop.Ide/resources/tabbar-inactive~dark@2x.9.png
new file mode 100644
index 0000000000..fb455a9b6d
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/resources/tabbar-inactive~dark@2x.9.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/AppManifest.xft.xml b/main/src/core/MonoDevelop.Ide/templates/AppManifest.xft.xml
new file mode 100644
index 0000000000..c0b41e995c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/AppManifest.xft.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0"?>
+<Template>
+ <TemplateConfiguration>
+ <_Name>App Manifest</_Name>
+ <Icon>md-xml-file-icon</Icon>
+ <_Category>General</_Category>
+ <LanguageName>*</LanguageName>
+ <_Description>Creates a Windows app manifest.</_Description>
+ <DefaultFilename>app</DefaultFilename>
+ </TemplateConfiguration>
+
+ <TemplateFiles>
+ <File name="${Name}" SuppressAutoOpen="False" BuildAction="None" DefaultExtension=".manifest">
+ <![CDATA[<?xml version="1.0" encoding="utf-8"?>
+<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
+ <assemblyIdentity version="1.0.0.0" name="${ProjectName}.app"/>
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+ <security>
+ <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
+<!-- UAC Manifest Options
+ If you want to change the Windows User Account Control level replace the
+ requestedExecutionLevel node with one of the following.
+ <requestedExecutionLevel level="asInvoker" uiAccess="false" />
+ <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
+ <requestedExecutionLevel level="highestAvailable" uiAccess="false" />
+ Specifying requestedExecutionLevel element will disable file and registry virtualization.
+ Remove this element if your application requires this virtualization for backwards
+ compatibility.
+ -->
+ <requestedExecutionLevel level="asInvoker" uiAccess="false" />
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+<!-- A list of the Windows versions that this application has been tested on and is
+ is designed to work with. Uncomment the appropriate elements and Windows will
+ automatically selected the most compatible environment. -->
+<!-- Windows Vista -->
+<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
+<!-- Windows 7 -->
+<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
+<!-- Windows 8 -->
+<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
+<!-- Windows 8.1 -->
+<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
+<!-- Windows 10 -->
+<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
+ </application>
+ </compatibility>
+<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
+ DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
+ to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
+ also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
+<!--
+ <application xmlns="urn:schemas-microsoft-com:asm.v3">
+ <windowsSettings>
+ <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
+ </windowsSettings>
+ </application>
+ -->
+<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
+<!--
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity
+ type="win32"
+ name="Microsoft.Windows.Common-Controls"
+ version="6.0.0.0"
+ processorArchitecture="*"
+ publicKeyToken="6595b64144ccf1df"
+ language="*"
+ />
+ </dependentAssembly>
+ </dependency>
+ -->
+</assembly>]]>
+ </File>
+ <Property type="ApplicationManifest" extension=".manifest">${Name}</Property>
+ </TemplateFiles>
+
+</Template> \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Ide/templates/EmptyClass.xft.xml b/main/src/core/MonoDevelop.Ide/templates/EmptyClass.xft.xml
index e97e5a55d9..1e2d2106a5 100644
--- a/main/src/core/MonoDevelop.Ide/templates/EmptyClass.xft.xml
+++ b/main/src/core/MonoDevelop.Ide/templates/EmptyClass.xft.xml
@@ -5,7 +5,7 @@
<_Name>Empty Class</_Name>
<Icon>md-class-file</Icon>
<_Category>General</_Category>
- <LanguageName>*</LanguageName>
+ <LanguageName>C#,VBNet</LanguageName>
<_Description>Creates an empty class.</_Description>
<DefaultFilename>EmptyClass</DefaultFilename>
</TemplateConfiguration>
diff --git a/main/src/core/MonoDevelop.Ide/templates/EmptyEnum.xft.xml b/main/src/core/MonoDevelop.Ide/templates/EmptyEnum.xft.xml
index 10a7086a19..4c950d0c93 100644
--- a/main/src/core/MonoDevelop.Ide/templates/EmptyEnum.xft.xml
+++ b/main/src/core/MonoDevelop.Ide/templates/EmptyEnum.xft.xml
@@ -5,7 +5,7 @@
<_Name>Empty Enumeration</_Name>
<Icon>md-enum-file</Icon>
<_Category>General</_Category>
- <LanguageName>*</LanguageName>
+ <LanguageName>C#,VBNet</LanguageName>
<_Description>Creates an empty enum.</_Description>
<DefaultFilename>EmptyEnumeration</DefaultFilename>
</TemplateConfiguration>
diff --git a/main/src/core/MonoDevelop.Ide/templates/EmptyInterface.xft.xml b/main/src/core/MonoDevelop.Ide/templates/EmptyInterface.xft.xml
index d8a889040b..0501e5be68 100644
--- a/main/src/core/MonoDevelop.Ide/templates/EmptyInterface.xft.xml
+++ b/main/src/core/MonoDevelop.Ide/templates/EmptyInterface.xft.xml
@@ -5,7 +5,7 @@
<_Name>Empty Interface</_Name>
<Icon>md-interface-file</Icon>
<_Category>General</_Category>
- <LanguageName>*</LanguageName>
+ <LanguageName>C#,VBNet</LanguageName>
<_Description>Creates an empty interface.</_Description>
<DefaultFilename>EmptyInterface</DefaultFilename>
</TemplateConfiguration>
diff --git a/main/src/core/MonoDevelop.Ide/templates/EmptyStruct.xft.xml b/main/src/core/MonoDevelop.Ide/templates/EmptyStruct.xft.xml
index f4d7647778..b26599b76e 100644
--- a/main/src/core/MonoDevelop.Ide/templates/EmptyStruct.xft.xml
+++ b/main/src/core/MonoDevelop.Ide/templates/EmptyStruct.xft.xml
@@ -5,7 +5,7 @@
<_Name>Empty Struct</_Name>
<Icon>md-struct-file</Icon>
<_Category>General</_Category>
- <LanguageName>*</LanguageName>
+ <LanguageName>C#,VBNet</LanguageName>
<_Description>Creates an empty struct.</_Description>
<DefaultFilename>EmptyStruct</DefaultFilename>
</TemplateConfiguration>
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/blank-solution.png b/main/src/core/MonoDevelop.Ide/templates/images/blank-solution.png
deleted file mode 100644
index df11fe9877..0000000000
--- a/main/src/core/MonoDevelop.Ide/templates/images/blank-solution.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/blank-solution@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/blank-solution@2x.png
deleted file mode 100644
index c4d0ed9986..0000000000
--- a/main/src/core/MonoDevelop.Ide/templates/images/blank-solution@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/console-project.png b/main/src/core/MonoDevelop.Ide/templates/images/console-project.png
index cf1766ba08..801b15a2de 100644
--- a/main/src/core/MonoDevelop.Ide/templates/images/console-project.png
+++ b/main/src/core/MonoDevelop.Ide/templates/images/console-project.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/console-project@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/console-project@2x.png
index f92dae0e23..27a4b3d18f 100644
--- a/main/src/core/MonoDevelop.Ide/templates/images/console-project@2x.png
+++ b/main/src/core/MonoDevelop.Ide/templates/images/console-project@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/console-project~dark.png b/main/src/core/MonoDevelop.Ide/templates/images/console-project~dark.png
new file mode 100644
index 0000000000..6d21522132
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/images/console-project~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/console-project~dark@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/console-project~dark@2x.png
new file mode 100644
index 0000000000..1c54434346
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/images/console-project~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/generic-project.png b/main/src/core/MonoDevelop.Ide/templates/images/generic-project.png
deleted file mode 100644
index a2bfc671e9..0000000000
--- a/main/src/core/MonoDevelop.Ide/templates/images/generic-project.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/generic-project@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/generic-project@2x.png
deleted file mode 100644
index 61d22fa403..0000000000
--- a/main/src/core/MonoDevelop.Ide/templates/images/generic-project@2x.png
+++ /dev/null
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/gtk2-project.png b/main/src/core/MonoDevelop.Ide/templates/images/gtk2-project.png
index b0dde6991b..6492480c5b 100644
--- a/main/src/core/MonoDevelop.Ide/templates/images/gtk2-project.png
+++ b/main/src/core/MonoDevelop.Ide/templates/images/gtk2-project.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/gtk2-project@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/gtk2-project@2x.png
index e29687e63d..d73b260f27 100644
--- a/main/src/core/MonoDevelop.Ide/templates/images/gtk2-project@2x.png
+++ b/main/src/core/MonoDevelop.Ide/templates/images/gtk2-project@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/gtk2-project~dark.png b/main/src/core/MonoDevelop.Ide/templates/images/gtk2-project~dark.png
new file mode 100644
index 0000000000..1c8dc96498
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/images/gtk2-project~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/gtk2-project~dark@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/gtk2-project~dark@2x.png
new file mode 100644
index 0000000000..fff2f70f17
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/images/gtk2-project~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/library-project.png b/main/src/core/MonoDevelop.Ide/templates/images/library-project.png
index f6210a7daa..127a22069e 100644
--- a/main/src/core/MonoDevelop.Ide/templates/images/library-project.png
+++ b/main/src/core/MonoDevelop.Ide/templates/images/library-project.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/library-project@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/library-project@2x.png
index b9c35577c2..3369a1640b 100644
--- a/main/src/core/MonoDevelop.Ide/templates/images/library-project@2x.png
+++ b/main/src/core/MonoDevelop.Ide/templates/images/library-project@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/library-project~dark.png b/main/src/core/MonoDevelop.Ide/templates/images/library-project~dark.png
new file mode 100644
index 0000000000..948625e8dd
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/images/library-project~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/library-project~dark@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/library-project~dark@2x.png
new file mode 100644
index 0000000000..e23a9c7585
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/images/library-project~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/pcl-project.png b/main/src/core/MonoDevelop.Ide/templates/images/pcl-project.png
index 81e7cd51fc..e21a761573 100644
--- a/main/src/core/MonoDevelop.Ide/templates/images/pcl-project.png
+++ b/main/src/core/MonoDevelop.Ide/templates/images/pcl-project.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/pcl-project@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/pcl-project@2x.png
index f23c248330..c3ab76c325 100644
--- a/main/src/core/MonoDevelop.Ide/templates/images/pcl-project@2x.png
+++ b/main/src/core/MonoDevelop.Ide/templates/images/pcl-project@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/pcl-project~dark.png b/main/src/core/MonoDevelop.Ide/templates/images/pcl-project~dark.png
new file mode 100644
index 0000000000..72458dffd6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/images/pcl-project~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/pcl-project~dark@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/pcl-project~dark@2x.png
new file mode 100644
index 0000000000..ec282dd4ac
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/images/pcl-project~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/project.png b/main/src/core/MonoDevelop.Ide/templates/images/project.png
new file mode 100644
index 0000000000..3fc8bfdd51
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/images/project.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/project@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/project@2x.png
new file mode 100644
index 0000000000..60adee9db1
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/images/project@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/project~dark.png b/main/src/core/MonoDevelop.Ide/templates/images/project~dark.png
new file mode 100644
index 0000000000..c91847dd1a
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/images/project~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/project~dark@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/project~dark@2x.png
new file mode 100644
index 0000000000..a6d19fb9ee
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/images/project~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/shared-project.png b/main/src/core/MonoDevelop.Ide/templates/images/shared-project.png
index 1b55f0a651..10188237ed 100644
--- a/main/src/core/MonoDevelop.Ide/templates/images/shared-project.png
+++ b/main/src/core/MonoDevelop.Ide/templates/images/shared-project.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/shared-project@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/shared-project@2x.png
index fa5f8c3ad9..24f440c804 100644
--- a/main/src/core/MonoDevelop.Ide/templates/images/shared-project@2x.png
+++ b/main/src/core/MonoDevelop.Ide/templates/images/shared-project@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/shared-project~dark.png b/main/src/core/MonoDevelop.Ide/templates/images/shared-project~dark.png
new file mode 100644
index 0000000000..d654704c8c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/images/shared-project~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/shared-project~dark@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/shared-project~dark@2x.png
new file mode 100644
index 0000000000..d2cdff451c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/images/shared-project~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/solution.png b/main/src/core/MonoDevelop.Ide/templates/images/solution.png
new file mode 100644
index 0000000000..2be1f05714
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/images/solution.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/solution@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/solution@2x.png
new file mode 100644
index 0000000000..e729221eca
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/images/solution@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/solution~dark.png b/main/src/core/MonoDevelop.Ide/templates/images/solution~dark.png
new file mode 100644
index 0000000000..fc067770cc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/images/solution~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/solution~dark@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/solution~dark@2x.png
new file mode 100644
index 0000000000..e94e6d3dca
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/images/solution~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/workspace.png b/main/src/core/MonoDevelop.Ide/templates/images/workspace.png
index 0d46904196..ed707535ca 100644
--- a/main/src/core/MonoDevelop.Ide/templates/images/workspace.png
+++ b/main/src/core/MonoDevelop.Ide/templates/images/workspace.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/workspace@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/workspace@2x.png
index e3bb3db121..9b87939cf9 100644
--- a/main/src/core/MonoDevelop.Ide/templates/images/workspace@2x.png
+++ b/main/src/core/MonoDevelop.Ide/templates/images/workspace@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/workspace~dark.png b/main/src/core/MonoDevelop.Ide/templates/images/workspace~dark.png
new file mode 100644
index 0000000000..80b1fb10cc
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/images/workspace~dark.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Ide/templates/images/workspace~dark@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/workspace~dark@2x.png
new file mode 100644
index 0000000000..9f454f0641
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/templates/images/workspace~dark@2x.png
Binary files differ
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/AssemblyInfo.v12.0.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/AssemblyInfo.v12.0.cs
index eff9423485..d8ee3d5e30 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/AssemblyInfo.v12.0.cs
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/AssemblyInfo.v12.0.cs
@@ -1,6 +1,6 @@
[assembly: System.Reflection.AssemblyTitle ("MonoDevelop MSBuild 12.0 Builder")]
-namespace MonoDevelop.Projects.Formats.MSBuild
+namespace MonoDevelop.Projects.MSBuild
{
static class MSBuildConsts
{
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/AssemblyInfo.v14.0.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/AssemblyInfo.v14.0.cs
index 6b3d27577c..09cae154f2 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/AssemblyInfo.v14.0.cs
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/AssemblyInfo.v14.0.cs
@@ -1,6 +1,6 @@
[assembly: System.Reflection.AssemblyTitle ("MonoDevelop MSBuild 14.0 Builder")]
-namespace MonoDevelop.Projects.Formats.MSBuild
+namespace MonoDevelop.Projects.MSBuild
{
static class MSBuildConsts
{
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/AssemblyInfo.v4.0.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/AssemblyInfo.v4.0.cs
index de5f65ec45..5ea952f86d 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/AssemblyInfo.v4.0.cs
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/AssemblyInfo.v4.0.cs
@@ -1,6 +1,6 @@
[assembly: System.Reflection.AssemblyTitle ("MonoDevelop MSBuild 4.0 Builder")]
-namespace MonoDevelop.Projects.Formats.MSBuild
+namespace MonoDevelop.Projects.MSBuild
{
static class MSBuildConsts
{
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/ChangeLog b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/ChangeLog
deleted file mode 100644
index 50a838aeb7..0000000000
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/ChangeLog
+++ /dev/null
@@ -1,41 +0,0 @@
-2010-03-18 Levi Bard <levi@unity3d.com>
-
- * Main.cs: Fix windows build. (Patch by Reapazor)
-
-2010-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * Main.cs:
- * Makefile.am:
- * MonoDevelop.Projects.Formats.MSBuild.csproj:
- * MonoDevelop.Projects.Formats.MSBuild/BuildEngine.cs:
- * MonoDevelop.Projects.Formats.MSBuild/IBuildEngine.cs:
- * MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.cs:
- * MonoDevelop.Projects.Formats.MSBuild/IProjectBuilder.cs:
- Projects now have to be explicitly loaded and unloaded.
- Added support for getting the list of assembly references of
- a project.
-
-2010-03-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.cs:
- Don't set the Platform property if no value is provided.
-
-2010-03-01 Lluis Sanchez Gual <lluis@novell.com>
-
- * Main.cs:
- * MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.cs: Exit
- the process if the parent dies. Removed some debug code.
-
-2009-11-19 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
-
- * MonoDevelop.Projects.Formats.MSBuild/MSBuildResult.cs: Fix
- build on windows.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Projects.Formats.MSBuild.csproj: Flush.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Add missing file.
-
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/Main.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/Main.cs
index 7436777040..d1b85e7c26 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/Main.cs
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/Main.cs
@@ -33,7 +33,7 @@ using System.Runtime.Remoting.Channels.Tcp;
using System.Threading;
using System.Diagnostics;
-namespace MonoDevelop.Projects.Formats.MSBuild
+namespace MonoDevelop.Projects.MSBuild
{
class MainClass
{
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.csproj b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.csproj
index 0d4ccd83d2..900f4d1219 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.csproj
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.csproj
@@ -52,6 +52,7 @@
<Compile Include="MonoDevelop.Projects.Formats.MSBuild\MSBuildResult.cs" />
<Compile Include="MonoDevelop.Projects.Formats.MSBuild\MSBuildEvaluatedItem.cs" />
<Compile Include="MonoDevelop.Projects.Formats.MSBuild\ProjectBuilder.Shared.cs" />
+ <Compile Include="MonoDevelop.Projects.Formats.MSBuild\BuildEngine.Shared.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.dotnet.v12.0.csproj b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.dotnet.v12.0.csproj
index db1de1236d..ef167e2e04 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.dotnet.v12.0.csproj
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.dotnet.v12.0.csproj
@@ -10,6 +10,7 @@
<AssemblyName>MonoDevelop.Projects.Formats.MSBuild</AssemblyName>
<RootNamespace>MonoDevelop.Projects.Formats.MSBuild</RootNamespace>
<BaseIntermediateOutputPath>obj\12.0</BaseIntermediateOutputPath>
+ <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>True</DebugSymbols>
@@ -40,18 +41,12 @@
<Reference Include="System.Xml" />
<Reference Include="Microsoft.Build, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>$(MSBuildProgramFiles32)\MSBuild\12.0\Bin\Microsoft.Build.dll</HintPath>
- <Private>False</Private>
- <SpecificVersion>True</SpecificVersion>
</Reference>
<Reference Include="Microsoft.Build.Framework, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>$(MSBuildProgramFiles32)\MSBuild\12.0\Bin\Microsoft.Build.Framework.dll</HintPath>
- <Private>False</Private>
- <SpecificVersion>True</SpecificVersion>
</Reference>
<Reference Include="Microsoft.Build.Utilities.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>$(MSBuildProgramFiles32)\MSBuild\12.0\Bin\Microsoft.Build.Utilities.v12.0.dll</HintPath>
- <Private>False</Private>
- <SpecificVersion>True</SpecificVersion>
</Reference>
</ItemGroup>
<ItemGroup>
@@ -68,6 +63,7 @@
<Compile Include="MonoDevelop.Projects.Formats.MSBuild\MSBuildResult.cs" />
<Compile Include="MonoDevelop.Projects.Formats.MSBuild\MSBuildEvaluatedItem.cs" />
<Compile Include="MonoDevelop.Projects.Formats.MSBuild\ProjectBuilder.Shared.cs" />
+ <Compile Include="MonoDevelop.Projects.Formats.MSBuild\BuildEngine.Shared.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.dotnet.v14.0.csproj b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.dotnet.v14.0.csproj
index 923f0f38d6..e75a355b85 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.dotnet.v14.0.csproj
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.dotnet.v14.0.csproj
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
@@ -34,7 +34,7 @@
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
- <StartupObject>MonoDevelop.Projects.Formats.MSBuild.MainClass</StartupObject>
+ <StartupObject>MonoDevelop.Projects.MSBuild.MainClass</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Build, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
@@ -51,6 +51,7 @@
</None>
</ItemGroup>
<ItemGroup>
+ <Compile Include="MonoDevelop.Projects.Formats.MSBuild\BuildEngine.Shared.cs" />
<Compile Include="MonoDevelop.Projects.Formats.MSBuild\BuildEngine.v4.0.cs" />
<Compile Include="MonoDevelop.Projects.Formats.MSBuild\IBuildEngine.cs" />
<Compile Include="MonoDevelop.Projects.Formats.MSBuild\ILogWriter.cs" />
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.dotnet.v4.0.csproj b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.dotnet.v4.0.csproj
index 06519793d6..04e52fc51a 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.dotnet.v4.0.csproj
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.dotnet.v4.0.csproj
@@ -56,6 +56,7 @@
<Compile Include="MonoDevelop.Projects.Formats.MSBuild\MSBuildResult.cs" />
<Compile Include="MonoDevelop.Projects.Formats.MSBuild\MSBuildEvaluatedItem.cs" />
<Compile Include="MonoDevelop.Projects.Formats.MSBuild\ProjectBuilder.Shared.cs" />
+ <Compile Include="MonoDevelop.Projects.Formats.MSBuild\BuildEngine.Shared.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.v4.0.csproj b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.v4.0.csproj
index f51652a4ed..bc8fcf33fa 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.v4.0.csproj
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.v4.0.csproj
@@ -55,6 +55,7 @@
<Compile Include="MonoDevelop.Projects.Formats.MSBuild\MSBuildResult.cs" />
<Compile Include="MonoDevelop.Projects.Formats.MSBuild\MSBuildEvaluatedItem.cs" />
<Compile Include="MonoDevelop.Projects.Formats.MSBuild\ProjectBuilder.Shared.cs" />
+ <Compile Include="MonoDevelop.Projects.Formats.MSBuild\BuildEngine.Shared.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.Shared.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.Shared.cs
new file mode 100644
index 0000000000..1fe71fd699
--- /dev/null
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.Shared.cs
@@ -0,0 +1,173 @@
+//
+// ProjectBuilder.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Threading;
+using System.Runtime.Remoting;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+
+//this is the builder for the deprecated build engine API
+#pragma warning disable 618
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ partial class BuildEngine: MarshalByRefObject, IBuildEngine
+ {
+ static readonly AutoResetEvent workDoneEvent = new AutoResetEvent (false);
+ static ThreadStart workDelegate;
+ static readonly object workLock = new object ();
+ static Thread workThread;
+ static Exception workError;
+
+ static List<int> cancelledTasks = new List<int> ();
+ static int currentTaskId;
+
+ readonly ManualResetEvent doneEvent = new ManualResetEvent (false);
+
+ public void Dispose ()
+ {
+ doneEvent.Set ();
+ }
+
+ internal WaitHandle WaitHandle {
+ get { return doneEvent; }
+ }
+
+ public void Ping ()
+ {
+ }
+
+ public override object InitializeLifetimeService ()
+ {
+ return null;
+ }
+
+ public void CancelTask (int taskId)
+ {
+ lock (cancelledTasks) {
+ if (currentTaskId == taskId)
+ AbortCurrentTask ();
+ else
+ cancelledTasks.Add (taskId);
+ }
+ }
+
+ static bool IsTaskCancelled (int taskId)
+ {
+ lock (cancelledTasks) {
+ return cancelledTasks.Contains (taskId);
+ }
+ }
+
+ static bool SetCurrentTask (int taskId)
+ {
+ lock (cancelledTasks) {
+ if (cancelledTasks.Contains (taskId))
+ return false;
+ currentTaskId = taskId;
+ return true;
+ }
+ }
+
+ static void ResetCurrentTask ()
+ {
+ lock (cancelledTasks) {
+ currentTaskId = -1;
+ }
+ }
+
+ static void AbortCurrentTask ()
+ {
+ workThread.Abort ();
+ workThread = null;
+ workDoneEvent.Set ();
+ }
+
+ internal static void RunSTA (ThreadStart ts)
+ {
+ RunSTA (-1, ts);
+ }
+
+ internal static void RunSTA (int taskId, ThreadStart ts)
+ {
+ lock (workLock) {
+ if (IsTaskCancelled (taskId))
+ return;
+ lock (threadLock) {
+ // Last chance to check for canceled task before the thread is started
+ if (IsTaskCancelled (taskId))
+ return;
+
+ workDelegate = ts;
+ workError = null;
+ if (workThread == null) {
+ workThread = new Thread (STARunner);
+ workThread.SetApartmentState (ApartmentState.STA);
+ workThread.IsBackground = true;
+ workThread.CurrentUICulture = uiCulture;
+ workThread.Start ();
+ }
+ else
+ // Awaken the existing thread
+ Monitor.Pulse (threadLock);
+ }
+ if (!SetCurrentTask (taskId)) {
+ // The task was aborted after all. Since the thread is already running we need to abort it
+ AbortCurrentTask ();
+ return;
+ }
+
+ workDoneEvent.WaitOne ();
+
+ ResetCurrentTask ();
+ }
+ if (workError != null)
+ throw new Exception ("MSBuild operation failed", workError);
+ }
+
+ static readonly object threadLock = new object ();
+
+ static void STARunner ()
+ {
+ lock (threadLock) {
+ do {
+ try {
+ workDelegate ();
+ }
+ catch (Exception ex) {
+ workError = ex;
+ }
+ workDoneEvent.Set ();
+ }
+ while (Monitor.Wait (threadLock, 60000));
+
+ workThread = null;
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.cs
index b8d08a7437..676ff9d933 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.cs
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.cs
@@ -25,45 +25,23 @@
// THE SOFTWARE.
using System;
-using System.Threading;
using System.Runtime.Remoting;
using System.Collections.Generic;
using Microsoft.Build.BuildEngine;
using System.Globalization;
-using System.IO;
//this is the builder for the deprecated build engine API
#pragma warning disable 618
-namespace MonoDevelop.Projects.Formats.MSBuild
+namespace MonoDevelop.Projects.MSBuild
{
- public class BuildEngine: MarshalByRefObject, IBuildEngine
+ public partial class BuildEngine: MarshalByRefObject, IBuildEngine
{
- static readonly AutoResetEvent workDoneEvent = new AutoResetEvent (false);
- static ThreadStart workDelegate;
- static readonly object workLock = new object ();
- static Thread workThread;
static CultureInfo uiCulture;
- static Exception workError;
-
- readonly ManualResetEvent doneEvent = new ManualResetEvent (false);
readonly Dictionary<string,string> unsavedProjects = new Dictionary<string, string> ();
internal readonly Engine Engine = new Engine { DefaultToolsVersion = MSBuildConsts.Version };
- public void Dispose ()
- {
- doneEvent.Set ();
- }
-
- internal WaitHandle WaitHandle {
- get { return doneEvent; }
- }
-
- public void Ping ()
- {
- }
-
public void SetCulture (CultureInfo uiCulture)
{
BuildEngine.uiCulture = uiCulture;
@@ -88,11 +66,6 @@ namespace MonoDevelop.Projects.Formats.MSBuild
RemotingServices.Disconnect ((MarshalByRefObject) pb);
}
- public override object InitializeLifetimeService ()
- {
- return null;
- }
-
internal void UnloadProject (string file)
{
lock (unsavedProjects)
@@ -119,48 +92,5 @@ namespace MonoDevelop.Projects.Formats.MSBuild
return content;
}
}
-
- internal static void RunSTA (ThreadStart ts)
- {
- lock (workLock) {
- lock (threadLock) {
- workDelegate = ts;
- workError = null;
- if (workThread == null) {
- workThread = new Thread (STARunner);
- workThread.SetApartmentState (ApartmentState.STA);
- workThread.IsBackground = true;
- workThread.CurrentUICulture = uiCulture;
- workThread.Start ();
- }
- else
- // Awaken the existing thread
- Monitor.Pulse (threadLock);
- }
- workDoneEvent.WaitOne ();
- }
- if (workError != null)
- throw new Exception ("MSBuild operation failed", workError);
- }
-
- static readonly object threadLock = new object ();
-
- static void STARunner ()
- {
- lock (threadLock) {
- do {
- try {
- workDelegate ();
- }
- catch (Exception ex) {
- workError = ex;
- }
- workDoneEvent.Set ();
- }
- while (Monitor.Wait (threadLock, 60000));
-
- workThread = null;
- }
- }
}
} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.v4.0.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.v4.0.cs
index aa6c02fa13..4afa977d9b 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.v4.0.cs
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.v4.0.cs
@@ -34,35 +34,14 @@ using Microsoft.Build.Construction;
using System.Linq;
using System.Globalization;
-namespace MonoDevelop.Projects.Formats.MSBuild
+namespace MonoDevelop.Projects.MSBuild
{
- public class BuildEngine: MarshalByRefObject, IBuildEngine
+ public partial class BuildEngine: MarshalByRefObject, IBuildEngine
{
- static readonly AutoResetEvent workDoneEvent = new AutoResetEvent (false);
- static ThreadStart workDelegate;
- static readonly object workLock = new object ();
- static Thread workThread;
static CultureInfo uiCulture;
- static Exception workError;
-
- readonly ManualResetEvent doneEvent = new ManualResetEvent (false);
readonly Dictionary<string, string> unsavedProjects = new Dictionary<string, string> ();
-
readonly ProjectCollection engine = new ProjectCollection { DefaultToolsVersion = MSBuildConsts.Version };
- public void Dispose ()
- {
- doneEvent.Set ();
- }
-
- internal WaitHandle WaitHandle {
- get { return doneEvent; }
- }
-
- public void Ping ()
- {
- }
-
public void SetCulture (CultureInfo uiCulture)
{
BuildEngine.uiCulture = uiCulture;
@@ -99,11 +78,6 @@ namespace MonoDevelop.Projects.Formats.MSBuild
return content;
}
}
-
- public override object InitializeLifetimeService ()
- {
- return null;
- }
internal void UnloadProject (string file)
{
@@ -118,48 +92,5 @@ namespace MonoDevelop.Projects.Formats.MSBuild
engine.UnloadAllProjects();
});
}
-
- internal static void RunSTA (ThreadStart ts)
- {
- lock (workLock) {
- lock (threadLock) {
- workDelegate = ts;
- workError = null;
- if (workThread == null) {
- workThread = new Thread (STARunner);
- workThread.SetApartmentState (ApartmentState.STA);
- workThread.IsBackground = true;
- workThread.CurrentUICulture = uiCulture;
- workThread.Start ();
- }
- else
- // Awaken the existing thread
- Monitor.Pulse (threadLock);
- }
- workDoneEvent.WaitOne ();
- }
- if (workError != null)
- throw new Exception ("MSBuild operation failed", workError);
- }
-
- static readonly object threadLock = new object ();
-
- static void STARunner ()
- {
- lock (threadLock) {
- do {
- try {
- workDelegate ();
- }
- catch (Exception ex) {
- workError = ex;
- }
- workDoneEvent.Set ();
- }
- while (Monitor.Wait (threadLock, 60000));
-
- workThread = null;
- }
- }
}
} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ConsoleLogger.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ConsoleLogger.cs
index a64fcab1f3..05aa2407a7 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ConsoleLogger.cs
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ConsoleLogger.cs
@@ -35,7 +35,7 @@ using System.Text;
using Microsoft.Build.Framework;
using Microsoft.Build.BuildEngine;
-namespace MonoDevelop.Projects.Formats.MSBuild {
+namespace MonoDevelop.Projects.MSBuild {
public class MDConsoleLogger : ILogger {
string parameters;
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/IBuildEngine.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/IBuildEngine.cs
index 95e8af6d80..d926143452 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/IBuildEngine.cs
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/IBuildEngine.cs
@@ -28,7 +28,7 @@ using System;
using System.Globalization;
using System.Collections.Generic;
-namespace MonoDevelop.Projects.Formats.MSBuild
+namespace MonoDevelop.Projects.MSBuild
{
public interface IBuildEngine: IDisposable
{
@@ -37,5 +37,6 @@ namespace MonoDevelop.Projects.Formats.MSBuild
IProjectBuilder LoadProject (string projectFile);
void UnloadProject (IProjectBuilder pb);
void Ping ();
+ void CancelTask (int taskId);
}
}
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ILogWriter.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ILogWriter.cs
index 8373877c11..744b177d75 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ILogWriter.cs
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ILogWriter.cs
@@ -28,11 +28,11 @@ using System;
using System.IO;
using System.Runtime.Remoting.Messaging;
-namespace MonoDevelop.Projects.Formats.MSBuild
+namespace MonoDevelop.Projects.MSBuild
{
public interface ILogWriter
{
- void WriteLine (string text);
+ void Write (string text);
}
public class LogWriter: MarshalByRefObject, ILogWriter
@@ -44,10 +44,9 @@ namespace MonoDevelop.Projects.Formats.MSBuild
this.writer = writer;
}
- [OneWayAttribute]
- public void WriteLine (string text)
+ public void Write (string text)
{
- writer.WriteLine (text);
+ writer.Write (text);
}
public override object InitializeLifetimeService ()
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/IProjectBuilder.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/IProjectBuilder.cs
index 7708964595..886a5937a9 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/IProjectBuilder.cs
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/IProjectBuilder.cs
@@ -29,7 +29,7 @@
using System;
using System.Collections.Generic;
-namespace MonoDevelop.Projects.Formats.MSBuild
+namespace MonoDevelop.Projects.MSBuild
{
public interface IProjectBuilder : IDisposable
{
@@ -37,10 +37,8 @@ namespace MonoDevelop.Projects.Formats.MSBuild
void RefreshWithContent (string projectContent);
MSBuildResult Run (
ProjectConfigurationInfo[] configurations, ILogWriter logWriter, MSBuildVerbosity verbosity,
- string[] runTargets, string[] evaluateItems, string[] evaluateProperties, Dictionary<string,string> globalProperties
+ string[] runTargets, string[] evaluateItems, string[] evaluateProperties, Dictionary<string,string> globalProperties, int taskId
);
-
- string[] GetSupportedTargets (ProjectConfigurationInfo[] configurations);
}
[Serializable]
@@ -50,5 +48,6 @@ namespace MonoDevelop.Projects.Formats.MSBuild
public string ProjectGuid;
public string Configuration;
public string Platform;
+ public bool Enabled;
}
}
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/LocalLogger.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/LocalLogger.cs
index 7d08df441e..6dcc8dd153 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/LocalLogger.cs
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/LocalLogger.cs
@@ -30,7 +30,7 @@ using System.Collections.Generic;
using Microsoft.Build.Utilities;
using Microsoft.Build.Framework;
-namespace MonoDevelop.Projects.Formats.MSBuild
+namespace MonoDevelop.Projects.MSBuild
{
public class LocalLogger: Logger
{
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/MSBuildEvaluatedItem.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/MSBuildEvaluatedItem.cs
index 221eb11b24..6e2d31916f 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/MSBuildEvaluatedItem.cs
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/MSBuildEvaluatedItem.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
-namespace MonoDevelop.Projects.Formats.MSBuild
+namespace MonoDevelop.Projects.MSBuild
{
[Serializable]
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/MSBuildResult.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/MSBuildResult.cs
index 358659d42a..843961a150 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/MSBuildResult.cs
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/MSBuildResult.cs
@@ -27,7 +27,7 @@
using System;
using System.Collections.Generic;
-namespace MonoDevelop.Projects.Formats.MSBuild
+namespace MonoDevelop.Projects.MSBuild
{
[Serializable]
public class MSBuildResult
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/MSBuildTargetResult.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/MSBuildTargetResult.cs
index 78115749b3..ba37f3ef32 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/MSBuildTargetResult.cs
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/MSBuildTargetResult.cs
@@ -27,7 +27,7 @@
using System;
using System.Text;
-namespace MonoDevelop.Projects.Formats.MSBuild
+namespace MonoDevelop.Projects.MSBuild
{
[Serializable]
public class MSBuildTargetResult
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.Shared.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.Shared.cs
index b33367b536..72d0eab144 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.Shared.cs
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.Shared.cs
@@ -29,11 +29,21 @@
using Microsoft.Build.Framework;
using System.Xml;
using System.IO;
+using System;
+using System.Text;
+using System.Threading;
-namespace MonoDevelop.Projects.Formats.MSBuild
+namespace MonoDevelop.Projects.MSBuild
{
partial class ProjectBuilder
{
+ ILogWriter currentLogWriter;
+ StringBuilder log = new StringBuilder ();
+ bool flushingLog;
+ Timer flushTimer;
+ object flushLogLock = new object ();
+ const int LogFlushTimeout = 100;
+
public void Dispose ()
{
buildEngine.UnloadProject (file);
@@ -50,10 +60,65 @@ namespace MonoDevelop.Projects.Formats.MSBuild
buildEngine.SetUnsavedProjectContent (file, projectContent);
}
+ /// <summary>
+ /// Prepares the logging infrastructure
+ /// </summary>
+ void InitLogger (ILogWriter logWriter)
+ {
+ currentLogWriter = logWriter;
+ if (currentLogWriter != null) {
+ log.Clear ();
+ flushingLog = false;
+ flushTimer = new Timer (o => FlushLog ());
+ }
+ }
+
+ /// <summary>
+ /// Flushes the log that has not yet been sent and disposes the logging infrastructure
+ /// </summary>
+ void DisposeLogger ()
+ {
+ if (currentLogWriter != null) {
+ flushTimer.Dispose ();
+ flushTimer = null;
+ FlushLog ();
+ currentLogWriter = null;
+ }
+ }
+
void LogWriteLine (string txt)
{
- if (currentLogWriter != null)
- currentLogWriter.WriteLine (txt);
+ if (currentLogWriter != null) {
+ lock (log) {
+ // Append the line to the log, and schedule the flush of the log, unless it has already been done
+ log.AppendLine (txt);
+ if (!flushingLog) {
+ // Flush the log after 100ms
+ flushingLog = true;
+ flushTimer.Change (LogFlushTimeout, Timeout.Infinite);
+ }
+ }
+ }
+ }
+
+ void FlushLog ()
+ {
+ // We need a lock for the whole method here because it is called from the timer
+ // and from DisposeLogger, and we want to make sure a flush is complete before
+ // trying another one
+
+ lock (flushLogLock) {
+ string txt;
+ lock (log) {
+ // Don't flush the log inside the lock since that would prevent LogWriteLine from writing
+ // more log while the current log is being flushed (that would slow down the whole build)
+ txt = log.ToString ();
+ log.Clear ();
+ flushingLog = false;
+ }
+ if (txt.Length > 0 && currentLogWriter != null)
+ currentLogWriter.Write (txt);
+ }
}
LoggerVerbosity GetVerbosity (MSBuildVerbosity verbosity)
@@ -103,6 +168,7 @@ namespace MonoDevelop.Projects.Formats.MSBuild
root.AppendChild (el);
el.SetAttribute ("Project", config.ProjectGuid);
el.SetAttribute ("AbsolutePath", config.ProjectFile);
+ el.SetAttribute ("BuildProjectInSolution", config.Enabled ? "True" : "False");
el.InnerText = string.Format (config.Configuration + "|" + config.Platform);
}
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.cs
index aee74a7348..2139d21456 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.cs
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.cs
@@ -27,7 +27,6 @@
// THE SOFTWARE.
using System;
-using System.Linq;
using System.IO;
using Microsoft.Build.BuildEngine;
using Microsoft.Build.Framework;
@@ -41,12 +40,11 @@ using System.Linq;
#pragma warning disable 618
-namespace MonoDevelop.Projects.Formats.MSBuild
+namespace MonoDevelop.Projects.MSBuild
{
public partial class ProjectBuilder: MarshalByRefObject, IProjectBuilder
{
readonly string file;
- ILogWriter currentLogWriter;
readonly MDConsoleLogger consoleLogger;
readonly BuildEngine buildEngine;
@@ -60,29 +58,15 @@ namespace MonoDevelop.Projects.Formats.MSBuild
//HACK: Mono does not implement 3.5 CustomMetadataNames API
FieldInfo evaluatedMetadataField = typeof(BuildItem).GetField ("evaluatedMetadata", BindingFlags.NonPublic | BindingFlags.Instance);
- public string[] GetSupportedTargets (ProjectConfigurationInfo[] configurations)
- {
- string[] result = null;
- BuildEngine.RunSTA (delegate {
- try {
- var project = SetupProject (configurations);
- result = project.Targets.OfType<Target> ().Select (t => t.Name).ToArray ();
- } catch {
- result = new string [0];
- }
- });
- return result;
- }
-
public MSBuildResult Run (
ProjectConfigurationInfo[] configurations, ILogWriter logWriter, MSBuildVerbosity verbosity,
- string[] runTargets, string[] evaluateItems, string[] evaluateProperties, Dictionary<string,string> globalProperties)
+ string[] runTargets, string[] evaluateItems, string[] evaluateProperties, Dictionary<string,string> globalProperties, int taskId)
{
MSBuildResult result = null;
- BuildEngine.RunSTA (delegate {
+ BuildEngine.RunSTA (taskId, delegate {
try {
- var project = SetupProject (configurations);
- currentLogWriter = logWriter;
+ var project = SetupProject (configurations);
+ InitLogger (logWriter);
buildEngine.Engine.UnregisterAllLoggers ();
@@ -97,7 +81,8 @@ namespace MonoDevelop.Projects.Formats.MSBuild
if (globalProperties != null) {
foreach (var p in globalProperties)
project.GlobalProperties.SetProperty (p.Key, p.Value);
- }
+ }
+
// We are using this BuildProject overload and the BuildSettings.None argument as a workaround to
// an xbuild bug which causes references to not be resolved after the project has been built once.
buildEngine.Engine.BuildProject (project, runTargets, new Hashtable (), BuildSettings.None);
@@ -136,11 +121,10 @@ namespace MonoDevelop.Projects.Formats.MSBuild
file, false, ex.ErrorSubcategory, ex.ErrorCode, ex.ProjectFile,
ex.LineNumber, ex.ColumnNumber, ex.EndLineNumber, ex.EndColumnNumber,
ex.BaseMessage, ex.HelpKeyword);
- if (logWriter != null)
- logWriter.WriteLine (r.ToString ());
+ LogWriteLine (r.ToString ());
result = new MSBuildResult (new [] { r });
} finally {
- currentLogWriter = null;
+ DisposeLogger ();
}
});
return result;
@@ -162,7 +146,7 @@ namespace MonoDevelop.Projects.Formats.MSBuild
p = null;
}
- Environment.CurrentDirectory = Path.GetDirectoryName (file);
+ Environment.CurrentDirectory = Path.GetDirectoryName (Path.GetFullPath (file));
if (p == null) {
p = new Project (buildEngine.Engine);
@@ -170,7 +154,7 @@ namespace MonoDevelop.Projects.Formats.MSBuild
if (content == null) {
p.Load (pc.ProjectFile);
} else {
- p.FullFileName = pc.ProjectFile;
+ p.FullFileName = Path.GetFullPath (pc.ProjectFile);
if (HasXbuildFileBug ()) {
// Workaround for Xamarin bug #14295: Project.Load incorrectly resets the FullFileName property
@@ -193,7 +177,7 @@ namespace MonoDevelop.Projects.Formats.MSBuild
project = p;
}
- Environment.CurrentDirectory = Path.GetDirectoryName (file);
+ Environment.CurrentDirectory = Path.GetDirectoryName (Path.GetFullPath (file));
return project;
}
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.v4.0.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.v4.0.cs
index b7642ec409..14b5b382f8 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.v4.0.cs
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/ProjectBuilder.v4.0.cs
@@ -36,13 +36,12 @@ using Microsoft.Build.Logging;
using Microsoft.Build.Execution;
using System.Xml;
-namespace MonoDevelop.Projects.Formats.MSBuild
+namespace MonoDevelop.Projects.MSBuild
{
public partial class ProjectBuilder: MarshalByRefObject, IProjectBuilder
{
readonly ProjectCollection engine;
readonly string file;
- ILogWriter currentLogWriter;
readonly BuildEngine buildEngine;
public ProjectBuilder (BuildEngine buildEngine, ProjectCollection engine, string file)
@@ -52,85 +51,70 @@ namespace MonoDevelop.Projects.Formats.MSBuild
this.buildEngine = buildEngine;
Refresh ();
}
-
- public string[] GetSupportedTargets (ProjectConfigurationInfo[] configurations)
- {
- string[] result = null;
- BuildEngine.RunSTA (delegate {
- try {
- var project = SetupProject (configurations);
- result = project.Targets.Select (t => t.Key).ToArray ();
- } catch {
- result = new string [0];
- }
- });
- return result;
- }
- public MSBuildResult Run (
- ProjectConfigurationInfo[] configurations, ILogWriter logWriter, MSBuildVerbosity verbosity,
- string[] runTargets, string[] evaluateItems, string[] evaluateProperties, Dictionary<string,string> globalProperties)
+ public MSBuildResult Run (
+ ProjectConfigurationInfo[] configurations, ILogWriter logWriter, MSBuildVerbosity verbosity,
+ string[] runTargets, string[] evaluateItems, string[] evaluateProperties, Dictionary<string,string> globalProperties, int taskId)
{
if (runTargets == null || runTargets.Length == 0)
throw new ArgumentException ("runTargets is empty");
- MSBuildResult result = null;
- BuildEngine.RunSTA (delegate {
+ MSBuildResult result = null;
+ BuildEngine.RunSTA (taskId, delegate {
try {
var project = SetupProject (configurations);
- currentLogWriter = logWriter;
+ InitLogger (logWriter);
- ILogger[] loggers;
- var logger = new LocalLogger (file);
+ ILogger[] loggers;
+ var logger = new LocalLogger (file);
if (logWriter != null) {
var consoleLogger = new ConsoleLogger (GetVerbosity (verbosity), LogWriteLine, null, null);
loggers = new ILogger[] { logger, consoleLogger };
} else {
- loggers = new ILogger[] { logger };
+ loggers = new ILogger[] { logger };
}
//building the project will create items and alter properties, so we use a new instance
- var pi = project.CreateProjectInstance ();
-
+ var pi = project.CreateProjectInstance ();
+
if (globalProperties != null)
foreach (var p in globalProperties)
pi.SetProperty (p.Key, p.Value);
+
+ pi.Build (runTargets, loggers);
+
+ result = new MSBuildResult (logger.BuildResult.ToArray ());
- pi.Build (runTargets, loggers);
-
- result = new MSBuildResult (logger.BuildResult.ToArray ());
-
if (evaluateProperties != null) {
foreach (var name in evaluateProperties) {
var prop = pi.GetProperty (name);
result.Properties [name] = prop != null? prop.EvaluatedValue : null;
- }
- }
+ }
+ }
- if (evaluateItems != null) {
- foreach (var name in evaluateItems) {
- var grp = pi.GetItems (name);
- var list = new List<MSBuildEvaluatedItem> ();
- foreach (var item in grp) {
- var evItem = new MSBuildEvaluatedItem (name, UnescapeString (item.EvaluatedInclude));
- foreach (var m in item.Metadata) {
- evItem.Metadata [m.Name] = UnescapeString (m.EvaluatedValue);
- }
- list.Add (evItem);
- }
+ if (evaluateItems != null) {
+ foreach (var name in evaluateItems) {
+ var grp = pi.GetItems (name);
+ var list = new List<MSBuildEvaluatedItem> ();
+ foreach (var item in grp) {
+ var evItem = new MSBuildEvaluatedItem (name, UnescapeString (item.EvaluatedInclude));
+ foreach (var m in item.Metadata) {
+ evItem.Metadata [m.Name] = UnescapeString (m.EvaluatedValue);
+ }
+ list.Add (evItem);
+ }
result.Items[name] = list;
- }
- }
+ }
+ }
} catch (Microsoft.Build.Exceptions.InvalidProjectFileException ex) {
- var r = new MSBuildTargetResult (
- file, false, ex.ErrorSubcategory, ex.ErrorCode, ex.ProjectFile,
- ex.LineNumber, ex.ColumnNumber, ex.EndLineNumber, ex.EndColumnNumber,
+ var r = new MSBuildTargetResult (
+ file, false, ex.ErrorSubcategory, ex.ErrorCode, ex.ProjectFile,
+ ex.LineNumber, ex.ColumnNumber, ex.EndLineNumber, ex.EndColumnNumber,
ex.BaseMessage, ex.HelpKeyword);
- if (logWriter != null)
- logWriter.WriteLine (r.ToString ());
- result = new MSBuildResult (new [] { r });
+ LogWriteLine (r.ToString ());
+ result = new MSBuildResult (new [] { r });
} finally {
- currentLogWriter = null;
+ DisposeLogger ();
}
});
return result;
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/BuildEngine.Shared.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/BuildEngine.Shared.cs
new file mode 100644
index 0000000000..5a55c5cbb2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/BuildEngine.Shared.cs
@@ -0,0 +1,320 @@
+//
+// ProjectBuilder.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Threading;
+using System.Runtime.Remoting;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+
+//this is the builder for the deprecated build engine API
+using MonoDevelop.Core.Execution;
+using System.Net.Configuration;
+using System.Diagnostics;
+#pragma warning disable 618
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ partial class BuildEngine
+ {
+ static readonly AutoResetEvent workDoneEvent = new AutoResetEvent (false);
+ static ThreadStart workDelegate;
+ static readonly object workLock = new object ();
+ static Thread workThread;
+ static Exception workError;
+
+ static List<int> cancelledTasks = new List<int> ();
+ static int currentTaskId;
+ static int projectIdCounter;
+ Dictionary<int, ProjectBuilder> projects = new Dictionary<int, ProjectBuilder> ();
+
+ readonly ManualResetEvent doneEvent = new ManualResetEvent (false);
+
+ static RemoteProcessServer server;
+
+ internal WaitHandle WaitHandle {
+ get { return doneEvent; }
+ }
+
+ public class LogWriter: ILogWriter
+ {
+ int id;
+
+ public LogWriter (int loggerId)
+ {
+ this.id = loggerId;
+ }
+
+ public void Write (string text)
+ {
+ server.SendMessage (new LogMessage { LoggerId = id, Text = text });
+ }
+ }
+
+ public class NullLogWriter: ILogWriter
+ {
+ public void Write (string text)
+ {
+ }
+ }
+
+ void WatchProcess (int procId)
+ {
+ var t = new Thread (delegate () {
+ while (true) {
+ Thread.Sleep (1000);
+ try {
+ // Throws exception if process is not running.
+ // When watching a .NET process from Mono, GetProcessById may
+ // return the process with HasExited=true
+ Process p = Process.GetProcessById (procId);
+ if (p.HasExited)
+ break;
+ }
+ catch {
+ break;
+ }
+ }
+ doneEvent.Set ();
+ });
+ t.IsBackground = true;
+ t.Start ();
+ }
+
+ public BuildEngine (RemoteProcessServer pserver)
+ {
+ server = pserver;
+ }
+
+ [MessageHandler]
+ public BinaryMessage Initialize (InitializeRequest msg)
+ {
+ WatchProcess (msg.IdeProcessId);
+ SetCulture (CultureInfo.GetCultureInfo (msg.CultureName));
+ SetGlobalProperties (msg.GlobalProperties);
+ return msg.CreateResponse ();
+ }
+
+ [MessageHandler]
+ public LoadProjectResponse LoadProject (LoadProjectRequest msg)
+ {
+ var pb = LoadProject (msg.ProjectFile);
+ lock (projects) {
+ var id = ++projectIdCounter;
+ projects [id] = pb;
+ return new LoadProjectResponse { ProjectId = id };
+ }
+ }
+
+ [MessageHandler]
+ public BinaryMessage UnloadProject (UnloadProjectRequest msg)
+ {
+ ProjectBuilder pb = null;
+ lock (projects) {
+ if (projects.TryGetValue (msg.ProjectId, out pb))
+ projects.Remove (msg.ProjectId);
+ }
+ if (pb != null)
+ UnloadProject (pb);
+ return msg.CreateResponse ();
+ }
+
+ [MessageHandler]
+ public BinaryMessage Dispose (DisposeRequest msg)
+ {
+ doneEvent.Set ();
+ return msg.CreateResponse ();
+ }
+
+ [MessageHandler]
+ public BinaryMessage Ping (PingRequest msg)
+ {
+ return msg.CreateResponse ();
+ }
+
+ [MessageHandler]
+ public BinaryMessage CancelTask (CancelTaskRequest msg)
+ {
+ lock (cancelledTasks) {
+ if (currentTaskId == msg.TaskId)
+ AbortCurrentTask ();
+ else
+ cancelledTasks.Add (msg.TaskId);
+ }
+ return msg.CreateResponse ();
+ }
+
+ [MessageHandler]
+ public BinaryMessage SetGlobalProperties (SetGlobalPropertiesRequest msg)
+ {
+ SetGlobalProperties (msg.Properties);
+ return msg.CreateResponse ();
+ }
+
+ [MessageHandler]
+ public BinaryMessage DisposeProject (DisposeProjectRequest msg)
+ {
+ var pb = GetProject (msg.ProjectId);
+ if (pb != null)
+ pb.Dispose ();
+ return msg.CreateResponse ();
+ }
+
+ [MessageHandler]
+ public BinaryMessage RefreshProject (RefreshProjectRequest msg)
+ {
+ var pb = GetProject (msg.ProjectId);
+ if (pb != null)
+ pb.Refresh ();
+ return msg.CreateResponse ();
+ }
+
+ [MessageHandler]
+ public BinaryMessage RefreshWithContent (RefreshWithContentRequest msg)
+ {
+ var pb = GetProject (msg.ProjectId);
+ if (pb != null)
+ pb.RefreshWithContent (msg.Content);
+ return msg.CreateResponse ();
+ }
+
+ [MessageHandler]
+ public BinaryMessage RunProject (RunProjectRequest msg)
+ {
+ var pb = GetProject (msg.ProjectId);
+ if (pb != null) {
+ var logger = msg.LogWriterId != -1 ? (ILogWriter) new LogWriter (msg.LogWriterId) : (ILogWriter) new NullLogWriter ();
+ var res = pb.Run (msg.Configurations, logger, msg.Verbosity, msg.RunTargets, msg.EvaluateItems, msg.EvaluateProperties, msg.GlobalProperties, msg.TaskId);
+ return new RunProjectResponse { Result = res };
+ }
+ return msg.CreateResponse ();
+ }
+
+ ProjectBuilder GetProject (int projectId)
+ {
+ lock (projects) {
+ ProjectBuilder pb;
+ if (projects.TryGetValue (projectId, out pb))
+ return pb;
+ return null;
+ }
+ }
+
+ static bool IsTaskCancelled (int taskId)
+ {
+ lock (cancelledTasks) {
+ return cancelledTasks.Contains (taskId);
+ }
+ }
+
+ static bool SetCurrentTask (int taskId)
+ {
+ lock (cancelledTasks) {
+ if (cancelledTasks.Contains (taskId))
+ return false;
+ currentTaskId = taskId;
+ return true;
+ }
+ }
+
+ static void ResetCurrentTask ()
+ {
+ lock (cancelledTasks) {
+ currentTaskId = -1;
+ }
+ }
+
+ static void AbortCurrentTask ()
+ {
+ workThread.Abort ();
+ workThread = null;
+ workDoneEvent.Set ();
+ }
+
+ internal static void RunSTA (ThreadStart ts)
+ {
+ RunSTA (-1, ts);
+ }
+
+ internal static void RunSTA (int taskId, ThreadStart ts)
+ {
+ lock (workLock) {
+ if (IsTaskCancelled (taskId))
+ return;
+ lock (threadLock) {
+ // Last chance to check for canceled task before the thread is started
+ if (IsTaskCancelled (taskId))
+ return;
+
+ workDelegate = ts;
+ workError = null;
+ if (workThread == null) {
+ workThread = new Thread (STARunner);
+ workThread.SetApartmentState (ApartmentState.STA);
+ workThread.IsBackground = true;
+ workThread.CurrentUICulture = uiCulture;
+ workThread.Start ();
+ }
+ else
+ // Awaken the existing thread
+ Monitor.Pulse (threadLock);
+ }
+ if (!SetCurrentTask (taskId)) {
+ // The task was aborted after all. Since the thread is already running we need to abort it
+ AbortCurrentTask ();
+ return;
+ }
+
+ workDoneEvent.WaitOne ();
+
+ ResetCurrentTask ();
+ }
+ if (workError != null)
+ throw new Exception ("MSBuild operation failed", workError);
+ }
+
+ static readonly object threadLock = new object ();
+
+ static void STARunner ()
+ {
+ lock (threadLock) {
+ do {
+ try {
+ workDelegate ();
+ }
+ catch (Exception ex) {
+ workError = ex;
+ }
+ workDoneEvent.Set ();
+ }
+ while (Monitor.Wait (threadLock, 60000));
+
+ workThread = null;
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/IBuildEngine.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/IBuildEngine.cs
new file mode 100644
index 0000000000..b3ef0b3c21
--- /dev/null
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/IBuildEngine.cs
@@ -0,0 +1,43 @@
+//
+// IProjectBuilder.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Globalization;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public interface IBuildEngine: IDisposable
+ {
+ Task SetCulture (CultureInfo uiCulture);
+ Task SetGlobalProperties (IDictionary<string, string> properties);
+ Task<IProjectBuilder> LoadProject (string projectFile);
+ Task UnloadProject (IProjectBuilder pb);
+ Task Ping ();
+ Task CancelTask (int taskId);
+ }
+}
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/ILogWriter.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/ILogWriter.cs
new file mode 100644
index 0000000000..6e8ec1225b
--- /dev/null
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/ILogWriter.cs
@@ -0,0 +1,57 @@
+//
+// ILogWriter.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.IO;
+using System.Runtime.Remoting.Messaging;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public interface ILogWriter
+ {
+ void Write (string text);
+ }
+
+ public class LogWriter: MarshalByRefObject, ILogWriter
+ {
+ TextWriter writer;
+
+ public LogWriter (TextWriter writer)
+ {
+ this.writer = writer;
+ }
+
+ public void Write (string text)
+ {
+ writer.Write (text);
+ }
+
+ public override object InitializeLifetimeService ()
+ {
+ return null;
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/IProjectBuilder.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/IProjectBuilder.cs
new file mode 100644
index 0000000000..8acbb5aa63
--- /dev/null
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/IProjectBuilder.cs
@@ -0,0 +1,44 @@
+//
+// IProjectBuilder.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+// Michael Hutchinson <m.j.hutchinson@gmail.com>
+//
+// Copyright (c) 2009-2011 Novell, Inc (http://www.novell.com)
+// Copyright (c) 2011-2015 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ public interface IProjectBuilder : IDisposable
+ {
+ Task Refresh ();
+ Task RefreshWithContent (string projectContent);
+ Task<MSBuildResult> Run (
+ ProjectConfigurationInfo[] configurations, ILogWriter logWriter, MSBuildVerbosity verbosity,
+ string[] runTargets, string[] evaluateItems, string[] evaluateProperties, Dictionary<string,string> globalProperties, int taskId
+ );
+ }
+}
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/MSBuildEvaluatedItem.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/MSBuildEvaluatedItem.cs
new file mode 100644
index 0000000000..f948e28109
--- /dev/null
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/MSBuildEvaluatedItem.cs
@@ -0,0 +1,56 @@
+//
+// MSBuildEvaluatedItem.cs
+//
+// Author:
+// Michael Hutchinson <m.j.hutchinson@gmail.com>
+//
+// Copyright (c) 2014 Xamarin Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using MonoDevelop.Core.Execution;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ [MessageDataTypeAttribute]
+ class MSBuildEvaluatedItem
+ {
+ public MSBuildEvaluatedItem ()
+ {
+ }
+
+ public MSBuildEvaluatedItem (string name, string itemSpec)
+ {
+ Name = name;
+ ItemSpec = itemSpec;
+ Metadata = new Dictionary<string, string> ();
+ }
+
+ [MessageDataProperty]
+ public Dictionary<string,string> Metadata { get; set; }
+
+ [MessageDataProperty]
+ public string ItemSpec { get; set; }
+
+ [MessageDataProperty]
+ public string Name { get; set; }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/MSBuildResult.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/MSBuildResult.cs
new file mode 100644
index 0000000000..e68b995cf9
--- /dev/null
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/MSBuildResult.cs
@@ -0,0 +1,69 @@
+//
+// MSBuildResult.cs
+//
+// Author:
+// Michael Hutchinson <m.j.hutchinson@gmail.com>
+//
+// Copyright (c) 2014 Xamarin Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using MonoDevelop.Core.Execution;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ [MessageDataTypeAttribute]
+ class MSBuildResult
+ {
+ [MessageDataProperty]
+ MSBuildTargetResult[] errors;
+
+ [MessageDataProperty]
+ Dictionary<string,string> properties;
+
+ [MessageDataProperty]
+ Dictionary<string,MSBuildEvaluatedItem[]> items;
+
+ internal MSBuildResult ()
+ {
+ }
+
+ public MSBuildResult (MSBuildTargetResult[] errors)
+ {
+ this.errors = errors;
+ this.properties = new Dictionary<string,string> ();
+ this.items = new Dictionary<string,MSBuildEvaluatedItem[]> ();
+ }
+
+ public MSBuildTargetResult[] Errors {
+ get { return errors; }
+ }
+
+ public Dictionary<string,MSBuildEvaluatedItem[]> Items {
+ get { return items; }
+ }
+
+ public Dictionary<string, string> Properties {
+ get { return properties; }
+ }
+ }
+
+}
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/MSBuildTargetResult.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/MSBuildTargetResult.cs
new file mode 100644
index 0000000000..df0080b9ac
--- /dev/null
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/MSBuildTargetResult.cs
@@ -0,0 +1,140 @@
+//
+// MSBuildTargetResult.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Text;
+using MonoDevelop.Core.Execution;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ [MessageDataType]
+ class MSBuildTargetResult
+ {
+ public MSBuildTargetResult ()
+ {
+ }
+
+ public MSBuildTargetResult (
+ string projectFile, bool isWarning, string subcategory, string code, string file,
+ int lineNumber, int columnNumber, int endLineNumber, int endColumnNumber,
+ string message, string helpKeyword)
+ {
+ ProjectFile = projectFile;
+ IsWarning = isWarning;
+ Subcategory = subcategory;
+ Code = code;
+ File = file;
+ LineNumber = lineNumber;
+ ColumnNumber = columnNumber;
+ EndLineNumber = endLineNumber;
+ EndColumnNumber = endColumnNumber;
+ Message = message;
+ HelpKeyword = helpKeyword;
+ }
+
+ [MessageDataProperty]
+ public string ProjectFile { get; set; }
+
+ [MessageDataProperty]
+ public bool IsWarning { get; set; }
+
+ [MessageDataProperty]
+ public string Subcategory { get; set; }
+
+ [MessageDataProperty]
+ public string Code { get; set; }
+
+ [MessageDataProperty]
+ public string File { get; set; }
+
+ [MessageDataProperty]
+ public int LineNumber { get; set; }
+
+ [MessageDataProperty]
+ public int ColumnNumber { get; set; }
+
+ [MessageDataProperty]
+ public int EndLineNumber { get; set; }
+
+ [MessageDataProperty]
+ public int EndColumnNumber { get; set; }
+
+ [MessageDataProperty]
+ public string Message { get; set; }
+
+ [MessageDataProperty]
+ public string HelpKeyword { get; set; }
+
+ public override string ToString ()
+ {
+ var sb = new StringBuilder ();
+ if (!string.IsNullOrEmpty (File)) {
+ sb.Append (File);
+ if (LineNumber > 0) {
+ //(line)
+ sb.Append ("(");
+ sb.Append (LineNumber);
+ if (ColumnNumber > 0) {
+ //(line,col)
+ sb.Append (",");
+ sb.Append (ColumnNumber);
+ if (EndColumnNumber > 0) {
+ if (EndLineNumber > 0) {
+ //(line,col,line,col)
+ sb.Append (",");
+ sb.Append (EndLineNumber);
+ sb.Append (",");
+ sb.Append (EndColumnNumber);
+ } else {
+ //(line,col-col)
+ sb.Append ("-");
+ sb.Append (EndColumnNumber);
+ }
+ }
+ } else if (EndLineNumber > 0) {
+ //(line-line)
+ sb.Append ("-");
+ sb.Append (EndLineNumber);
+ }
+ sb.Append (")");
+ }
+ sb.Append (": ");
+ }
+ if (!string.IsNullOrEmpty (Subcategory)) {
+ sb.Append (Subcategory);
+ sb.Append (" ");
+ }
+ sb.Append (IsWarning ? "warning" : "error");
+ if (!string.IsNullOrEmpty (Code)) {
+ sb.Append (" ");
+ sb.Append (Code);
+ }
+ sb.Append (": ");
+ sb.Append (Message);
+ return sb.ToString ();
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/Main.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/Main.cs
new file mode 100644
index 0000000000..cfc5126fd2
--- /dev/null
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/Main.cs
@@ -0,0 +1,50 @@
+//
+// Main.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.IO;
+using System.Collections;
+using System.Runtime.Serialization.Formatters.Binary;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Tcp;
+using System.Threading;
+using System.Diagnostics;
+using MonoDevelop.Core.Execution;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ class MainClass
+ {
+ [STAThread]
+ public static void Main (string[] args)
+ {
+ RemoteProcessServer server = new RemoteProcessServer ();
+ var builderEngine = new BuildEngine (server);
+ server.Connect (args, builderEngine);
+ builderEngine.WaitHandle.WaitOne ();
+ }
+ }
+}
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/MonoDevelop.Projects.MSBuild.Shared.projitems b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/MonoDevelop.Projects.MSBuild.Shared.projitems
new file mode 100644
index 0000000000..bd0e54a174
--- /dev/null
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/MonoDevelop.Projects.MSBuild.Shared.projitems
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
+ <HasSharedItems>true</HasSharedItems>
+ <SharedGUID>{DB95FF74-275D-4488-84E9-1060527988BF}</SharedGUID>
+ </PropertyGroup>
+ <PropertyGroup Label="Configuration">
+ <Import_RootNamespace>MonoDevelop.Projects.MSBuild.Shared</Import_RootNamespace>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="$(MSBuildThisFileDirectory)..\..\MonoDevelop.Core\MonoDevelop.Core.Execution\BinaryMessage.cs">
+ <Link>BinaryMessage.cs</Link>
+ </Compile>
+ <Compile Include="$(MSBuildThisFileDirectory)BuildEngine.Shared.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)RemoteBuildEngineMessages.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)ProjectBuilder.Shared.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)..\..\MonoDevelop.Core\MonoDevelop.Core.Execution\RemoteProcessServer.cs">
+ <Link>RemoteProcessServer.cs</Link>
+ </Compile>
+ <Compile Include="$(MSBuildThisFileDirectory)ILogWriter.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)MSBuildEvaluatedItem.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)MSBuildResult.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)MSBuildTargetResult.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Main.cs" />
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/MonoDevelop.Projects.MSBuild.Shared.shproj b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/MonoDevelop.Projects.MSBuild.Shared.shproj
new file mode 100644
index 0000000000..3538f4c628
--- /dev/null
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/MonoDevelop.Projects.MSBuild.Shared.shproj
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{DB95FF74-275D-4488-84E9-1060527988BF}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
+ <Import Project="MonoDevelop.Projects.MSBuild.Shared.projitems" Label="Shared" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
+</Project> \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/ProjectBuilder.Shared.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/ProjectBuilder.Shared.cs
new file mode 100644
index 0000000000..3a5a54fe9e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/ProjectBuilder.Shared.cs
@@ -0,0 +1,186 @@
+//
+// ProjectBuilder.Shared.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+// Michael Hutchinson <m.j.hutchinson@gmail.com>
+//
+// Copyright (c) 2009-2011 Novell, Inc (http://www.novell.com)
+// Copyright (c) 2011-2015 Xamarin Inc. (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using Microsoft.Build.Framework;
+using System.Xml;
+using System.IO;
+using System;
+using System.Text;
+using System.Threading;
+using MonoDevelop.Core.Execution;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ partial class ProjectBuilder
+ {
+ ILogWriter currentLogWriter;
+ StringBuilder log = new StringBuilder ();
+ bool flushingLog;
+ Timer flushTimer;
+ object flushLogLock = new object ();
+ const int LogFlushTimeout = 100;
+
+ public void Dispose ()
+ {
+ buildEngine.UnloadProject (file);
+ }
+
+ public void Refresh ()
+ {
+ buildEngine.UnloadProject (file);
+ }
+
+ public void RefreshWithContent (string projectContent)
+ {
+ buildEngine.UnloadProject (file);
+ buildEngine.SetUnsavedProjectContent (file, projectContent);
+ }
+
+ /// <summary>
+ /// Prepares the logging infrastructure
+ /// </summary>
+ void InitLogger (ILogWriter logWriter)
+ {
+ currentLogWriter = logWriter;
+ if (currentLogWriter != null) {
+ log.Clear ();
+ flushingLog = false;
+ flushTimer = new Timer (o => FlushLog ());
+ }
+ }
+
+ /// <summary>
+ /// Flushes the log that has not yet been sent and disposes the logging infrastructure
+ /// </summary>
+ void DisposeLogger ()
+ {
+ if (currentLogWriter != null) {
+ flushTimer.Dispose ();
+ flushTimer = null;
+ FlushLog ();
+ currentLogWriter = null;
+ }
+ }
+
+ void LogWriteLine (string txt)
+ {
+ if (currentLogWriter != null) {
+ lock (log) {
+ // Append the line to the log, and schedule the flush of the log, unless it has already been done
+ log.AppendLine (txt);
+ if (!flushingLog) {
+ // Flush the log after 100ms
+ flushingLog = true;
+ flushTimer.Change (LogFlushTimeout, Timeout.Infinite);
+ }
+ }
+ }
+ }
+
+ void FlushLog ()
+ {
+ // We need a lock for the whole method here because it is called from the timer
+ // and from DisposeLogger, and we want to make sure a flush is complete before
+ // trying another one
+
+ lock (flushLogLock) {
+ string txt;
+ lock (log) {
+ // Don't flush the log inside the lock since that would prevent LogWriteLine from writing
+ // more log while the current log is being flushed (that would slow down the whole build)
+ txt = log.ToString ();
+ log.Clear ();
+ flushingLog = false;
+ }
+ if (txt.Length > 0 && currentLogWriter != null)
+ currentLogWriter.Write (txt);
+ }
+ }
+
+ LoggerVerbosity GetVerbosity (MSBuildVerbosity verbosity)
+ {
+ switch (verbosity) {
+ case MSBuildVerbosity.Quiet:
+ return LoggerVerbosity.Quiet;
+ case MSBuildVerbosity.Minimal:
+ return LoggerVerbosity.Minimal;
+ default:
+ return LoggerVerbosity.Normal;
+ case MSBuildVerbosity.Detailed:
+ return LoggerVerbosity.Detailed;
+ case MSBuildVerbosity.Diagnostic:
+ return LoggerVerbosity.Diagnostic;
+ }
+ }
+
+ //from MSBuildProjectService
+ static string UnescapeString (string str)
+ {
+ int i = str.IndexOf ('%');
+ while (i != -1 && i < str.Length - 2) {
+ int c;
+ if (int.TryParse (str.Substring (i+1, 2), System.Globalization.NumberStyles.HexNumber, null, out c))
+ str = str.Substring (0, i) + (char) c + str.Substring (i + 3);
+ i = str.IndexOf ('%', i + 1);
+ }
+ return str;
+ }
+
+ string GenerateSolutionConfigurationContents (ProjectConfigurationInfo[] configurations)
+ {
+ // can't use XDocument because of the 2.0 builder
+ // and don't just build a string because things may need escaping
+
+ var doc = new XmlDocument ();
+ var root = doc.CreateElement ("SolutionConfiguration");
+ doc.AppendChild (root);
+ foreach (var config in configurations) {
+ var el = doc.CreateElement ("ProjectConfiguration");
+ root.AppendChild (el);
+ el.SetAttribute ("Project", config.ProjectGuid);
+ el.SetAttribute ("AbsolutePath", config.ProjectFile);
+ el.SetAttribute ("BuildProjectInSolution", config.Enabled ? "True" : "False");
+ el.InnerText = string.Format (config.Configuration + "|" + config.Platform);
+ }
+
+ //match MSBuild formatting
+ var options = new XmlWriterSettings {
+ Indent = true,
+ IndentChars = "",
+ OmitXmlDeclaration = true,
+ };
+ using (var sw = new StringWriter ())
+ using (var xw = XmlWriter.Create (sw, options)) {
+ doc.WriteTo (xw);
+ xw.Flush ();
+ return sw.ToString ();
+ }
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/RemoteBuildEngineMessages.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/RemoteBuildEngineMessages.cs
new file mode 100644
index 0000000000..23f22f4b16
--- /dev/null
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.MSBuild.Shared/RemoteBuildEngineMessages.cs
@@ -0,0 +1,195 @@
+//
+// RemoteBuildEngineMessages.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@xamarin.com>
+//
+// Copyright (c) 2016 Xamarin, Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using MonoDevelop.Core.Execution;
+
+namespace MonoDevelop.Projects.MSBuild
+{
+ [MessageDataTypeAttribute]
+ class InitializeRequest: BinaryMessage
+ {
+ [MessageDataProperty]
+ public int IdeProcessId { get; set; }
+
+ [MessageDataProperty]
+ public string CultureName { get; set; }
+
+ [MessageDataProperty]
+ public Dictionary<string, string> GlobalProperties { get; set; }
+ }
+
+ [MessageDataTypeAttribute]
+ class LoadProjectRequest: BinaryMessage<LoadProjectResponse>
+ {
+ [MessageDataProperty]
+ public string ProjectFile { get; set; }
+ }
+
+ [MessageDataTypeAttribute]
+ class LoadProjectResponse: BinaryMessage
+ {
+ [MessageDataProperty]
+ public int ProjectId { get; set; }
+ }
+
+ [MessageDataTypeAttribute]
+ class UnloadProjectRequest: BinaryMessage
+ {
+ [MessageDataProperty]
+ public int ProjectId { get; set; }
+ }
+
+ [MessageDataTypeAttribute]
+ class CancelTaskRequest: BinaryMessage
+ {
+ [MessageDataProperty]
+ public int TaskId { get; set; }
+ }
+
+ [MessageDataTypeAttribute]
+ class SetGlobalPropertiesRequest: BinaryMessage
+ {
+ [MessageDataProperty]
+ public Dictionary<string, string> Properties { get; set; }
+ }
+
+ [MessageDataTypeAttribute]
+ class PingRequest: BinaryMessage
+ {
+ [MessageDataProperty]
+ public int TaskId = 1;
+ }
+
+ [MessageDataTypeAttribute]
+ class DisposeRequest: BinaryMessage
+ {
+ }
+
+ [MessageDataTypeAttribute]
+ class DisposeProjectRequest: BinaryMessage
+ {
+ [MessageDataProperty]
+ public int ProjectId { get; set; }
+ }
+
+ [MessageDataTypeAttribute]
+ class RefreshProjectRequest: BinaryMessage
+ {
+ [MessageDataProperty]
+ public int ProjectId { get; set; }
+ }
+
+ [MessageDataTypeAttribute]
+ class RefreshWithContentRequest: BinaryMessage
+ {
+ [MessageDataProperty]
+ public int ProjectId { get; set; }
+
+ [MessageDataProperty]
+ public string Content { get; set; }
+ }
+
+ [MessageDataTypeAttribute]
+ class RunProjectRequest: BinaryMessage<RunProjectResponse>
+ {
+ [MessageDataProperty]
+ public int ProjectId { get; set; }
+
+ [MessageDataProperty]
+ public string Content { get; set; }
+
+ [MessageDataProperty]
+ public ProjectConfigurationInfo [] Configurations { get; set; }
+
+ [MessageDataProperty]
+ public int LogWriterId { get; set; }
+
+ [MessageDataProperty]
+ public MSBuildVerbosity Verbosity { get; set; }
+
+ [MessageDataProperty]
+ public string [] RunTargets { get; set; }
+
+ [MessageDataProperty]
+ public string [] EvaluateItems { get; set; }
+
+ [MessageDataProperty]
+ public string [] EvaluateProperties { get; set; }
+
+ [MessageDataProperty]
+ public Dictionary<string, string> GlobalProperties { get; set; }
+
+ [MessageDataProperty]
+ public int TaskId { get; set; }
+ }
+
+ [MessageDataTypeAttribute]
+ class RunProjectResponse : BinaryMessage
+ {
+ [MessageDataProperty]
+ public MSBuildResult Result { get; set; }
+ }
+
+ [MessageDataTypeAttribute]
+ class LogMessage : BinaryMessage
+ {
+ [MessageDataProperty]
+ public int LoggerId { get; set; }
+
+ [MessageDataProperty]
+ public string Text { get; set; }
+ }
+
+ public enum MSBuildVerbosity
+ {
+ Quiet,
+ Minimal,
+ Normal,
+ Detailed,
+ Diagnostic
+ }
+
+ [MessageDataTypeAttribute]
+ class ProjectConfigurationInfo
+ {
+ [MessageDataProperty]
+ public string ProjectFile { get; set; }
+
+ [MessageDataProperty]
+ public string ProjectGuid { get; set; }
+
+ [MessageDataProperty]
+ public string Configuration { get; set; }
+
+ [MessageDataProperty]
+ public string Platform { get; set; }
+
+ [MessageDataProperty]
+ public bool Enabled { get; set; }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Startup/ChangeLog b/main/src/core/MonoDevelop.Startup/ChangeLog
deleted file mode 100644
index 4d47f54411..0000000000
--- a/main/src/core/MonoDevelop.Startup/ChangeLog
+++ /dev/null
@@ -1,365 +0,0 @@
-2010-05-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup.csproj: Disable overflow checks.
-
-2010-03-22 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs: Bumped MD version.
-
-2009-10-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs: Bump MD version.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup.csproj: Flush.
-
-2009-10-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs: Bump MD version.
-
-2009-09-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * app.config: Added version redirect for SharpZipLib. Monodoc
- is linked to an old version, and fails on Windows. Removed
- old log4net stuff.
-
-2009-08-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup/MonoDevelopMain.cs: If the runtime could
- not be initialized, don't try to rebuild the registry.
-
-2009-06-19 Mike Krüger <mkrueger@novell.com>
-
- * AssemblyInfo.cs: Commented out empty assembly key file
- attribute (Bug 513981 - Project template causes CS1726
- errors).
-
-2009-06-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup\MonoDevelopMain.cs: On Windows log all
- process output to a file.
-
-2009-04-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup.csproj: Set output type to winexe. Use a
- local configuration directory when running inside md.
-
-2009-04-20 Mike Krüger <mkrueger@novell.com>
-
- * MonoDevelop.Startup/MonoDevelopMain.cs: Renamed a class.
-
-2009-04-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs: Bump MD version.
-
-2009-02-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup/MonoDevelopMain.cs: The runtime is now
- initialized by the Ide.
-
-2009-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Startup.csproj: Remove more inadvertent local
- copying of references.
-
-2009-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Startup.csproj: Add an x86 configuration because
- GTK# on Windows is only available in x86.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup.mdp:
- * MonoDevelop.Startup.csproj: Migrated to MSBuild file format.
-
-2009-02-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * AssemblyInfo.cs: Bump MD version.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Startup.mdp: Flush project format changes.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup.mdp: Set correct target framework.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup.mdp: Don't require a specific version of
- Mono.Addins.
-
-2008-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Make it work for parallel builds.
-
-2008-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * Makefile.am:
- * AssemblyInfo.cs:
- * AssemblyInfo.cs.in:
- * MonoDevelop.Startup.mdp: Add AssemblyInfo.cs files that are
- autogenerated from the addin manifests.
-
-2008-09-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup.mdp: Updated.
-
-2008-07-21 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup.mdp: Set some env vars when starting the project.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup.mdp, MonoDevelop.exe.addins, Makefile.am: Directory
- reorganization.
-
-2007-11-12 Michael Hutchinson <mhutchinson@novell.com>
-
- * MonoDevelop.Startup/MonoDevelopMain.cs: Use SetProcessName; "killall
- monodevelop" will work now. Convert some WriteLines to logging calls.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup.mdp: Project file names updated by change in MD path
- functions.
-
-2007-09-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * app.config: Change console log level to "WARN". Verbosity doesn't increase
- substantially, and the warning messages do generally indicate a problem.
-
-2007-08-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup.mdp, Makefile.am: Reorganized the extension point
- hierarchy. Embedded all add-in manifests as resources.
- * MonoDevelop.Startup/MonoDevelopMain.cs: The IDE is not implemented as an
- add-in anymore.
-
-2007-07-30 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup.glade, MonoDevelop.Startup.mdp: Removed unused
- file.
-
-2007-07-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup/MonoDevelopMain.cs: If MD fails to start, rebuild
- the add-in database and try again.
-
-2007-05-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Reference shared assemblies from the correct location.
-
-2007-05-07 Lluis Sanchez Gual <lluis@novell.com>
-
- * SharpDevelop.exe.manifest, MonoDevelop.Startup.mdp: Remove unused
- files.
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup.mdp, MonoDevelop.Startup/MonoDevelopMain.cs,
- MonoDevelop.exe.addins, Makefile.am: Migration to Mono.Addins.
-
-2007-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup.mdp: Don't copy referenced assemblies.
-
-2007-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Flush.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup.mdp, Makefile.am: Set target runtime to 2.0.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup.mdp, Makefile.am: Synchronized MD project and
- makefile.
-
-2007-02-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup.mdp, Makefile.am: distcheck fixes.
-
-2006-09-19 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * MonoDevelop.Startup.mdp: Updated.
-
-2006-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup.mdp: Updated.
-
-2006-04-05 David Makovský (Yakeen) <yakeen@sannyas-on.net>
-
- * MonoDevelop.Startup.mdp: Updated project files
-
-2006-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup/MonoDevelopMain.cs: Shutdown the runtime
- before exiting.
-
-2006-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Fix 'all' rule.
-
-2006-03-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup/MonoDevelopMain.cs: Enable assembly
- conflict check for the main MD app.
-
-2005-12-03 John Luke <john.luke@gmail.com>
-
- * MonoDevelop.Startup/AddinLoadErrorDialog.cs:
- * MonoDevelop.Startup/ExceptionBox.cs:
- * MonoDevelop.Startup/MonoDevelopOptions.cs: remove
- this stuff was all moved to MonoDevelop.IDE
- * Makefile.am:
- * AssemblyInfo.cs.in: update
-
-2005-10-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup/AddinLoadErrorDialog.cs:
- * MonoDevelop.Startup/MonoDevelopMain.cs: Moved most of code to
- MonoDevelop.Ide.
-
-2005-08-29 John Luke <john.luke@gmail.com>
-
- * MonoDevelop.Startup.glade: fix typo, bug #75914
-
-2005-08-13 Todd Berman <tberman@off.net>
-
- * MonoDevelopMain.cs: Fix the socket ObjectDisposed. Only to uncover
- another ObjectDisposed, that I do not understand how to debug.
-
-2005-08-10 Ben Motmans <ben.motmans@gmail.com>
-
- * MonoDevelop.Startup.mdp: references update
-
-2005-08-08 John Luke <john.luke@gmail.com>
-
- * Makefile.am: add glade file to EXTRA_DIST to pass distcheck
-
-2005-08-03 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopMain.cs: Show an error dialog if something goes wrong
- while initializing.
-
-2005-08-03 Ben Motmans <ben.motmans@gmail.com>
-
- * MonoDevelopMain.cs: Show a meaningfull error when the local
- hostname cannot be resolved
-
-2005-07-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelop.Startup.glade:
- * Dialogs/AddinLoadErrorDialog.cs: Improved the error dialog.
-
-2005-07-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopMain.cs: Show an error dialog if there is some error
- while initializing the addins.
- * Dialog/AggregatedProgressMonitor.cs: New dialog for showing addin
- load errors.
- * Makefile.am: Added glade file.
-
-2005-06-28 Raja R Harinath <rharinath@novell.com>
-
- * Makefile.am (FILES): Move AssemblyInfo.cs ...
- (GENERATED_FILES): ... here.
-
-2005-04-17 John Luke <john.luke@gmail.com>
-
- * Makefile.am: fix distcheck
-
-2005-04-01 Christian Hergert <christian.hergert@gmail.com>
-
- * Makefile.am: fix call to app.config
-
-2005-04-01 Christian Hergert <christian.hergert@gmail.com>
-
- * app.config: Add MonoDevelop.exe.config configuration file
- * Makefile.am: Update to include the configuration file
-
-2005-03-10 Christian Hergert <christian.hergert@gmail.com>
-
- * MonoDevelopMain.cs: Update the splash screen percentages
- and status messages.
-
-2005-01-27 John Luke <john.luke@gmail.com>
-
- * MonoDevelopMain.cs: remove unused code that
- caused warnings
-
-2005-01-14 Lluis Sanchez Gual <lluis@novell.com>
-
- * MonoDevelopMain.cs: Use new api for checking for combine files.
-
-2004-12-03 John Luke <john.luke@gmail.com>
-
- * Dialogs/ExceptionDialog.cs: remove obsolete gtype stuff
- * MonoDevelopMain.cs: comment out unused code
- * Makefile.am: remove ExceptionDialog from build
-
-2004-09-18 Todd Berman <tberman@off.net>
-
- * MonoDevelopMain.cs: Check if Build and Revision are not 0, and if
- so, use them as well when building the version #.
-
-2004-08-07 Todd Berman <tberman@off.net>
-
- * AssemblyInfo.cs.in: Use new ASSEMBLY_VERSION variable.
-
-2004-07-01 John Luke <jluke@cfl.rr.com>
-
- * MonoDevelopMain.cs: return 1 on error and 0 otherwise
- * MonoDevelopOptions.cs: remove unneeded -f option
- implement reusing MD instance only when we are getting passed
- arguments (like files). This allows more than one MD to be run
- at a time, and adding files from nautilus still works. Less
- than perfect, but better than what it was
-
-2004-07-01 John Luke <jluke@cfl.rr.com>
-
- * MonoDevelopMain.cs: implement nologo
- * MonoDevelopOptions.cs: add -f and --nologo args
-
-2004-07-01 John Luke <jluke@cfl.rr.com>
-
- * AssemblyInfo.cs.in: clean up and add some informaition used below
- * Makefile.am: add Mono.GetOptions reference and new file
- * MonoDevelopOptions.cs: new file for handling options
- * MonoDevelopMain.cs: begin using MonoDevelopOptions
-
-2004-07-01 Todd Berman <tberman@off.net>
-
- * MonoDevelopMain.cs: Dont attempt to load 0 length filenames.
-
-2004-06-28 Todd Berman <tberman@off.net>
-
- * MonoDevelopMain.cs: add Exit (0); and poof, issues are gone.
-
-2004-05-24 Todd Berman <tberman@sevenl.net>
-
- * Makefile.am: add Mono.Posix reference
- * MonoDevelopMain.cs: Use a unix socket to only allow one instance of
- MD to be open at a time. This should eventually use something like
- dbus or something else instead of a unix socket. Also, a --new-process
- arg should be added or something similar to allow more than one
- open copy of MD at a time.
-
-2004-04-19 Todd Berman <tberman@sevenl.net>
-
- * Makefile.am: only link the one .resources file we need.
-
-2004-04-07 John Luke <jluke@cfl.rr.com>
-
- * MonoDevelopMain.cs: use reflection for the name and version
-
-2004-04-02 Todd Berman <tberman@sevenl.net>
-
- * MonoDevelopMain.cs: move SharpDevelopMain.cs... damn i love svn.
-
-2004-04-02 Todd Berman <tberman@sevenl.net>
-
- * SharpDevelopMain.cs: bump to 0.3
diff --git a/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup.csproj b/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup.csproj
index 9a0c8ca36e..1ef0ba3942 100644
--- a/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup.csproj
+++ b/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup.csproj
@@ -22,15 +22,12 @@
<EnvironmentVariables>
<EnvironmentVariables>
<Variable name="MONODEVELOP_LOCALE_PATH" value="../locale" />
- <Variable name="MONODEVELOP_TEST_PROFILE" value="./test-profile" />
</EnvironmentVariables>
</EnvironmentVariables>
<PlatformTarget>x86</PlatformTarget>
- <Execution>
- <Execution clr-version="Net_2_0" />
- </Execution>
<NoWarn>1591;1573</NoWarn>
<DocumentationFile>..\..\..\build\bin\MonoDevelop.xml</DocumentationFile>
+ <Commandlineparameters>-no-redirect</Commandlineparameters>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
@@ -50,12 +47,8 @@
<EnvironmentVariables>
<EnvironmentVariables>
<Variable name="MONODEVELOP_LOCALE_PATH" value="../locale" />
- <Variable name="MONODEVELOP_TEST_PROFILE" value="./test-profile" />
</EnvironmentVariables>
</EnvironmentVariables>
- <Execution>
- <Execution clr-version="Net_2_0" />
- </Execution>
<Commandlineparameters>-no-redirect</Commandlineparameters>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -64,12 +57,34 @@
<OutputPath>..\..\..\build\bin</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
- <Execution>
- <Execution clr-version="Net_2_0" />
- </Execution>
<DebugSymbols>true</DebugSymbols>
<Commandlineparameters>-no-redirect</Commandlineparameters>
</PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+ <DebugSymbols>True</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\..\..\build\bin</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <EnvironmentVariables>
+ <EnvironmentVariables>
+ <Variable name="MONODEVELOP_LOCALE_PATH" value="../locale" />
+ </EnvironmentVariables>
+ </EnvironmentVariables>
+ <PlatformTarget>x64</PlatformTarget>
+ <Commandlineparameters>-no-redirect</Commandlineparameters>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>True</Optimize>
+ <OutputPath>..\..\..\build\bin</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <DebugSymbols>true</DebugSymbols>
+ <PlatformTarget>x64</PlatformTarget>
+ <Commandlineparameters>-no-redirect</Commandlineparameters>
+ </PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
diff --git a/main/src/core/MonoDevelop.Startup/MonoDevelop.exe.addins b/main/src/core/MonoDevelop.Startup/MonoDevelop.exe.addins
index d0f63c1fbd..9daab66b83 100644
--- a/main/src/core/MonoDevelop.Startup/MonoDevelop.exe.addins
+++ b/main/src/core/MonoDevelop.Startup/MonoDevelop.exe.addins
@@ -1,5 +1,4 @@
<Addins>
<Directory include-subdirs="true">../AddIns</Directory>
<Directory include-subdirs="true">../../../local-config</Directory>
- <Directory include-subdirs="true">../tests</Directory>
</Addins>
diff --git a/main/src/core/MonoDevelop.Startup/app.config b/main/src/core/MonoDevelop.Startup/app.config
index 7a19cb2817..706a0930a6 100644
--- a/main/src/core/MonoDevelop.Startup/app.config
+++ b/main/src/core/MonoDevelop.Startup/app.config
@@ -18,6 +18,12 @@
<assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.28.0" newVersion="4.2.28.0" />
</dependentAssembly>
- </assemblyBinding>
+ </assemblyBinding>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
+ <bindingRedirect oldVersion="2.0.0.0-4.3.1.0" newVersion="4.4.0.0"/>
+ </dependentAssembly>
+ </assemblyBinding>
</runtime>
</configuration>
diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/MiscActionsTest.cs b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/MiscActionsTest.cs
index e5873dc895..c5f25f49c1 100644
--- a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/MiscActionsTest.cs
+++ b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/MiscActionsTest.cs
@@ -251,6 +251,28 @@ eeeeeeeeee
ffffffffff");
}
+ /// <summary>
+ /// Bug 29193 - Last line of code is duplicated on the same line
+ /// </summary>
+ [Test()]
+ public void TestDuplicateLines_Bug29193 ()
+ {
+ var data = Create (@"aaaaaaaaa
+bbbbbbbbbb
+cccccccccc
+dddddddddd
+eeeeeeeeee
+ffffffffff$");
+ MiscActions.DuplicateLine (data);
+ Check (data, @"aaaaaaaaa
+bbbbbbbbbb
+cccccccccc
+dddddddddd
+eeeeeeeeee
+ffffffffff
+ffffffffff$");
+ }
+
[Test()]
public void TestDuplicateSelectedText ()
{
diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/AvlTreeTests.cs b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/AvlTreeTests.cs
deleted file mode 100644
index 9787ad00c8..0000000000
--- a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/AvlTreeTests.cs
+++ /dev/null
@@ -1,285 +0,0 @@
-//
-// AvlTreeTests.cs
-//
-// Author:
-// Mike Krüger <mkrueger@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using NUnit.Framework;
-using Mono.TextEditor.Utils;
-using System.Text;
-using System.Linq;
-
-namespace Mono.TextEditor.Tests
-{
- [TestFixture]
- public class AvlTreeTests
- {
- class TestNode : IAvlNode, System.IComparable
- {
- public readonly int val;
-
- public TestNode (int val)
- {
- this.val = val;
- }
-
- public void UpdateAugmentedData ()
- {
- }
-
- #region IComparable implementation
-
- public int CompareTo (object other)
- {
- return val.CompareTo (((TestNode)other).val);
- }
-
- #endregion
-
- public override string ToString ()
- {
- return string.Format ("[TestNode " + val + "]");
- }
-
- #region IAvlNode implementation
-
- public IAvlNode Parent {
- get;
- set;
- }
-
- public IAvlNode Left {
- get;
- set;
- }
-
- public IAvlNode Right {
- get;
- set;
- }
-
- public sbyte Balance {
- get;
- set;
- }
-
- #endregion
-
- }
-
- [Test]
- public void TestRemove ()
- {
- var tree = new AvlTree<TestNode> ();
- var t1 = new TestNode (1);
- var t2 = new TestNode (2);
- var t3 = new TestNode (3);
-
- tree.Add (t2);
- tree.Add (t1);
- tree.Add (t3);
- Assert.AreEqual (3, tree.Count);
-
- Assert.IsTrue (tree.Remove (t2));
-
- Assert.AreEqual (2, tree.Count);
- Assert.IsTrue (tree.Contains (t1));
- Assert.IsFalse (tree.Contains (t2));
- Assert.IsTrue (tree.Contains (t3));
- }
-
- [Test]
- public void TestAddInOrder ()
- {
- var tree = new AvlTree<TestNode> ();
- tree.Add (new TestNode (1));
- tree.Add (new TestNode (2));
- tree.Add (new TestNode (3));
- Assert.AreEqual (3, tree.Count);
- Assert.AreEqual ("1,2,3,", GetContent (tree));
- }
-
- [Test]
- public void TestAddReverseOrder ()
- {
- var tree = new AvlTree<TestNode> ();
- tree.Add (new TestNode (3));
- tree.Add (new TestNode (2));
- tree.Add (new TestNode (1));
- Assert.AreEqual (3, tree.Count);
- Assert.AreEqual ("1,2,3,", GetContent (tree));
- }
-
- [Test]
- public void TestAddOutOfOrder ()
- {
- var tree = new AvlTree<TestNode> ();
- tree.Add (new TestNode (3));
- tree.Add (new TestNode (1));
- tree.Add (new TestNode (2));
- Assert.AreEqual (3, tree.Count);
- Assert.AreEqual ("1,2,3,", GetContent (tree));
- }
-
- static string GetContent (AvlTree<TestNode> tree)
- {
- var sb = new StringBuilder ();
- foreach (var t in tree) {
- sb.Append (t.val + ",");
- }
- return sb.ToString ();
- }
-
- [Ignore]
- [Test]
- public void TestAddCase2 ()
- {
- var tree = new AvlTree<TestNode> ();
- var t3 = new TestNode (3);
- var t24 = new TestNode (24);
- var t26 = new TestNode (26);
-
- tree.Add (t3);
-
- Assert.AreEqual (1, tree.Count);
- tree.Remove (t3);
-
- tree.Add (new TestNode (37));
- tree.Add (new TestNode (70));
- tree.Add (new TestNode (12));
-
- Assert.AreEqual (3, tree.Count);
-
- tree.Add (new TestNode (90));
- tree.Add (new TestNode (25));
- tree.Add (new TestNode (99));
- tree.Add (new TestNode (91));
- tree.Add (t24);
- tree.Add (new TestNode (28));
- tree.Add (t26);
-
- // Should do a single left rotation on node with key 12
- tree.Remove (t24);
- Assert.IsTrue (tree.Root.Left == t26, "was:" + tree.Root.Left);
- }
-
- [Test]
- public void TestTreeRoationAtLeftChildAfterDeletingRoot ()
- {
- var tree = new AvlTree<TestNode> ();
- int[] keys = { 86, 110, 122, 2, 134, 26, 14, 182 };
- int[] expectedKeys = { 2, 14, 26, 86, 122, 134, 182 };
-
- foreach (var key in keys) {
- tree.Add (new TestNode (key));
- }
- tree.Remove (tree.First (t => t.val == 110));
-
- var node = tree.Root.AvlGetOuterLeft ();
- foreach (var expected in expectedKeys) {
- Assert.AreEqual (expected, node.val);
- node = node.AvlGetNextNode ();
- }
- }
-
- [Ignore]
- [Test]
- public void TestDetachNodesAtLeftChildAfterDeletingRoot()
- {
- var tree = new AvlTree<TestNode> ();
- int[] keys = { 110, 122, 2, 134, 86, 14, 26, 182 };
- foreach (var key in keys) {
- tree.Add (new TestNode (key));
- }
- tree.Remove (tree.First (t => t.val == 110));
- Assert.AreEqual (26, ((TestNode)tree.First (t => t.val == 14).Right).val);
- }
-
- [Ignore]
- [Test]
- public void TestRemoveInRightSubtree()
- {
- var tree = new AvlTree<TestNode> ();
- int[] keys = { 8, 4, 13, 6, 15, 7, 10, 5, 14, 2, 11, 3, 9, 1 };
- foreach (var key in keys) {
- tree.Add (new TestNode (key));
- }
- tree.Remove (tree.First (t => t.val == 13));
- Assert.AreEqual (11, ((TestNode)tree.First (t => t.val == 8).Right).val);
- }
-
- [Test]
- public void TestRemoveInLeftSubtree()
- {
- var tree = new AvlTree<TestNode> ();
- int[] keys = { 8, 4, 12, 6, 7, 16, 10, 5, 11, 9, 17, 5, 14, 2, 13, 1, 3 };
- foreach (var key in keys) {
- tree.Add (new TestNode (key));
- }
-
- tree.Remove (tree.First (t => t.val == 16));
-
- Assert.AreEqual( 8, tree.Root.val );
- Assert.AreEqual( 12, ((TestNode)tree.Root.Right).val );
- Assert.AreEqual( 14, ((TestNode)tree.Root.Right.Right).val );
-
- Assert.AreEqual (13, ((TestNode)tree.First (t => t.val == 14).Left).val);
- }
-
- [Test]
- public void TestReverseOrderRemoval ()
- {
- var tree = new AvlTree<TestNode> ();
- TestNode[] nodes = new TestNode[10];
- for (int i = 0; i < 10; i++) {
- tree.Add (nodes [i] = new TestNode (i));
- }
- Assert.AreEqual (10, tree.Count);
-
- for (int i = 0; i < 10; i++) {
- Assert.IsTrue (tree.Contains (nodes[9 - i]), "case : " + (9 - i));
- tree.Remove (nodes[9 - i]);
- Assert.IsFalse (tree.Contains (nodes[9 - i]), "case : " + (9 - i));
- }
- Assert.AreEqual (0, tree.Count);
- }
-
- [Test]
- public void TestInOrderRemoval ()
- {
- var tree = new AvlTree<TestNode> ();
- TestNode[] nodes = new TestNode[10];
- for (int i = 0; i < 10; i++) {
- tree.Add (nodes [i] = new TestNode (i));
- }
- Assert.AreEqual (10, tree.Count);
-
- for (int i = 0; i < 10; i++) {
- Assert.IsTrue (tree.Contains (nodes[i]), "case : " + i);
- tree.Remove (nodes[i]);
- Assert.IsFalse (tree.Contains (nodes[i]), "case : " + i);
- }
- Assert.AreEqual (0, tree.Count);
- }
- }
-}
-
diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/BufferTests.cs b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/BufferTests.cs
deleted file mode 100644
index 36ff408cde..0000000000
--- a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/BufferTests.cs
+++ /dev/null
@@ -1,331 +0,0 @@
-//
-// BufferTests.cs
-//
-// Author:
-// Mike Krüger <mkrueger@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Collections.Generic;
-using NUnit.Framework;
-using System.Linq;
-
-namespace Mono.TextEditor.Tests
-{
- [TestFixture()]
- public class BufferTests
- {
- [Test()]
- public void TestSearchForwardMany ()
- {
- GapBuffer buffer = new GapBuffer ();
- buffer.Text = new string ('a', 100);
- int cnt = 0;
- int o = 0;
- while ((o = buffer.IndexOf ("a", o, buffer.TextLength - o, StringComparison.Ordinal)) >= 0) {
- cnt++;
- o++;
- }
- Assert.AreEqual (100, cnt);
- }
-
- [Test()]
- public void TestSearchBackwardMany ()
- {
- GapBuffer buffer = new GapBuffer ();
- buffer.Text = new string ('a', 100);
- int cnt = 0;
- int o = buffer.TextLength;
- while (o > 0 && (o = buffer.LastIndexOf ("a", o - 1, o, StringComparison.Ordinal)) != -1) {
- cnt++;
- }
- Assert.AreEqual (100, cnt);
- }
-
- [Test()]
- public void TestSearchForward ()
- {
- GapBuffer buffer = new GapBuffer ();
- for (int i = 0; i < 100; i++) {
- buffer.Insert (0, "a");
- }
- var idx = new List<int> (new [] { 0, buffer.TextLength / 2, buffer.TextLength });
-
- idx.ForEach (i => buffer.Insert (i, "test"));
-
- // move gap to the beginning
- buffer.Replace (idx [0], 1, buffer.GetCharAt (idx [0]).ToString ());
-
- List<int> results = new List<int> ();
-
- int o = 0;
- while ((o = buffer.IndexOf ("test", o, buffer.TextLength - o, StringComparison.Ordinal)) >= 0) {
- results.Add (o);
- o++;
- }
-
-
- Assert.AreEqual (idx.Count, results.Count, "matches != " + idx.Count + " - found:" + results.Count);
- for (int i = 0; i < idx.Count; i++)
- Assert.AreEqual (idx [i], results [i], (i + 1) + ". match != " + idx [i] + " was " + results [i]);
-
- // move gap to the middle
- buffer.Replace (idx [1], 1, buffer.GetCharAt (idx [1]).ToString ());
-
- results = new List<int> ();
- o = 0;
- while ((o = buffer.IndexOf ("test", o, buffer.TextLength - o, StringComparison.Ordinal)) >= 0) {
- results.Add (o);
- o++;
- }
-
- Assert.AreEqual (idx.Count, results.Count, "matches != " + idx.Count + " - found:" + results.Count);
- for (int i = 0; i < idx.Count; i++)
- Assert.AreEqual (idx [i], results [i], (i + 1) + ". match != " + idx [i] + " was " + results [i]);
-
- // move gap to the end
- buffer.Replace (idx [2], 1, buffer.GetCharAt (idx [2]).ToString ());
-
- results = new List<int> ();
- o = 0;
- while ((o = buffer.IndexOf ("test", o, buffer.TextLength - o, StringComparison.Ordinal)) >= 0) {
- results.Add (o);
- o++;
- }
-
- Assert.AreEqual (idx.Count, results.Count, "matches != " + idx.Count + " - found:" + results.Count);
- for (int i = 0; i < idx.Count; i++)
- Assert.AreEqual (idx [i], results [i], (i + 1) + ". match != " + idx [i] + " was " + results [i]);
-
- // move gap to the end
- buffer.Replace (buffer.TextLength - 1, 1, buffer.GetCharAt (buffer.TextLength - 1).ToString ());
-
- results = new List<int> ();
- o = 0;
- while ((o = buffer.IndexOf ("test", o, buffer.TextLength - o, StringComparison.Ordinal)) >= 0) {
- results.Add (o);
- o++;
- }
-
- Assert.AreEqual (idx.Count, results.Count, "matches != " + idx.Count + " - found:" + results.Count);
- for (int i = 0; i < idx.Count; i++)
- Assert.AreEqual (idx[i], results[i], (i + 1) +". match != " + idx[i] + " was " + results[i]);
- }
-
- [Test()]
- public void TestSearchForwardIgnoreCase ()
- {
- GapBuffer buffer = new GapBuffer ();
- for (int i = 0; i < 100; i++) {
- buffer.Insert (0, "a");
- }
- var idx = new List<int> (new [] { 0, buffer.TextLength / 2, buffer.TextLength });
-
- idx.ForEach (i => buffer.Insert (i, "test"));
-
- // move gap to the beginning
- buffer.Replace (idx [0], 1, buffer.GetCharAt (idx [0]).ToString ());
-
- List<int> results = new List<int> ();
- int o = 0;
- while ((o = buffer.IndexOf ("TEST", o, buffer.TextLength - o, StringComparison.OrdinalIgnoreCase)) >= 0) {
- results.Add (o);
- o++;
- }
-
- Assert.AreEqual (idx.Count, results.Count, "matches != " + idx.Count + " - found:" + results.Count);
- for (int i = 0; i < idx.Count; i++)
- Assert.AreEqual (idx [i], results [i], (i + 1) + ". match != " + idx [i] + " was " + results [i]);
-
- // move gap to the middle
- buffer.Replace (idx [1], 1, buffer.GetCharAt (idx [1]).ToString ());
-
- results = new List<int> ();
- o = 0;
- while ((o = buffer.IndexOf ("TEST", o, buffer.TextLength - o, StringComparison.OrdinalIgnoreCase)) >= 0) {
- results.Add (o);
- o++;
- }
-
- Assert.AreEqual (idx.Count, results.Count, "matches != " + idx.Count + " - found:" + results.Count);
- for (int i = 0; i < idx.Count; i++)
- Assert.AreEqual (idx [i], results [i], (i + 1) + ". match != " + idx [i] + " was " + results [i]);
-
- // move gap to the end
- buffer.Replace (idx [2], 1, buffer.GetCharAt (idx [2]).ToString ());
-
- results = new List<int> ();
- o = 0;
- while ((o = buffer.IndexOf ("TEST", o, buffer.TextLength - o, StringComparison.OrdinalIgnoreCase)) >= 0) {
- results.Add (o);
- o++;
- }
- Assert.AreEqual (idx.Count, results.Count, "matches != " + idx.Count + " - found:" + results.Count);
- for (int i = 0; i < idx.Count; i++)
- Assert.AreEqual (idx [i], results [i], (i + 1) + ". match != " + idx [i] + " was " + results [i]);
-
- // move gap to the end
- buffer.Replace (buffer.TextLength - 1, 1, buffer.GetCharAt (buffer.TextLength - 1).ToString ());
-
- results = new List<int> ();
- o = 0;
- while ((o = buffer.IndexOf ("TEST", o, buffer.TextLength - o, StringComparison.OrdinalIgnoreCase)) >= 0) {
- results.Add (o);
- o++;
- }
-
- Assert.AreEqual (idx.Count, results.Count, "matches != " + idx.Count + " - found:" + results.Count);
- for (int i = 0; i < idx.Count; i++)
- Assert.AreEqual (idx[i], results[i], (i + 1) +". match != " + idx[i] + " was " + results[i]);
- }
-
- [Test()]
- public void TestSearchBackward ()
- {
- GapBuffer buffer = new GapBuffer ();
- for (int i = 0; i < 100; i++) {
- buffer.Insert (0, "a");
- }
- var idx = new List<int> (new [] { 0, buffer.TextLength / 2, buffer.TextLength });
-
- idx.ForEach (i => buffer.Insert (i, "test"));
-
- // move gap to the beginning
- buffer.Replace (idx [0], 1, buffer.GetCharAt (idx [0]).ToString ());
-
- List<int> results = new List<int> ();
- int o = buffer.TextLength;
- while (o > 0 && (o = buffer.LastIndexOf ("test", o - 1, o, StringComparison.Ordinal)) != -1) {
- results.Add (o);
- }
-
-
- Assert.AreEqual (idx.Count, results.Count, "matches != " + idx.Count + " - found:" + results.Count);
-
- for (int i = 0; i < idx.Count; i++)
- Assert.AreEqual (idx [idx.Count - 1 - i], results [i], (i + 1) + ". match != " + idx [idx.Count - 1 - i] + " was " + results [i]);
-
- // move gap to the middle
- buffer.Replace (idx [1], 1, buffer.GetCharAt (idx [1]).ToString ());
-
- results = new List<int> ();
- o = buffer.TextLength - 1;
- while (o > 0 && (o = buffer.LastIndexOf ("test", o - 1, o, StringComparison.Ordinal)) != -1) {
- results.Add (o);
- }
-
- Assert.AreEqual (idx.Count, results.Count, "matches != " + idx.Count + " - found:" + results.Count);
- for (int i = 0; i < idx.Count; i++)
- Assert.AreEqual (idx [idx.Count - 1 - i], results [i], (i + 1) + ". match != " + idx [idx.Count - 1 - i] + " was " + results [i]);
-
- // move gap to the end
- buffer.Replace (idx [2], 1, buffer.GetCharAt (idx [2]).ToString ());
-
- results = new List<int> ();
- o = buffer.TextLength - 1;
- while (o > 0 && (o = buffer.LastIndexOf ("test", o - 1, o, StringComparison.Ordinal)) != -1) {
- results.Add (o);
- }
-
- Assert.AreEqual (idx.Count, results.Count, "matches != " + idx.Count + " - found:" + results.Count);
- for (int i = 0; i < idx.Count; i++)
- Assert.AreEqual (idx [idx.Count - 1 - i], results [i], (i + 1) + ". match != " + idx [idx.Count - 1 - i] + " was " + results [i]);
-
- // move gap to the end
- buffer.Replace (buffer.TextLength - 1, 1, buffer.GetCharAt (buffer.TextLength - 1).ToString ());
-
- results = new List<int> ();
- o = buffer.TextLength - 1;
- while (o > 0 && (o = buffer.LastIndexOf ("test", o - 1, o, StringComparison.Ordinal)) != -1) {
- results.Add (o);
- }
- Assert.AreEqual (idx.Count, results.Count, "matches != " + idx.Count + " - found:" + results.Count);
- for (int i = 0; i < idx.Count; i++)
- Assert.AreEqual (idx[idx.Count - 1 - i], results[i], (i + 1) +". match != " + idx[idx.Count - 1 - i] + " was " + results[i]);
- }
-
- [Test()]
- public void TestSearchBackwardIgnoreCase ()
- {
- GapBuffer buffer = new GapBuffer ();
- for (int i = 0; i < 100; i++) {
- buffer.Insert (0, "a");
- }
- var idx = new List<int> (new [] { 0, buffer.TextLength / 2, buffer.TextLength });
-
- idx.ForEach (i => buffer.Insert (i, "test"));
-
- // move gap to the beginning
- buffer.Replace (idx [0], 1, buffer.GetCharAt (idx [0]).ToString ());
-
- List<int> results = new List<int> ();
- int o = buffer.TextLength - 1;
- while (o > 0 && (o = buffer.LastIndexOf ("TEST", o - 1, o, StringComparison.OrdinalIgnoreCase)) != -1) {
- results.Add (o);
- o--;
- }
- Assert.AreEqual (idx.Count, results.Count, "matches != " + idx.Count + " - found:" + results.Count);
-
- for (int i = 0; i < idx.Count; i++)
- Assert.AreEqual (idx [idx.Count - 1 - i], results [i], (i + 1) + ". match != " + idx [idx.Count - 1 - i] + " was " + results [i]);
-
- // move gap to the middle
- buffer.Replace (idx [1], 1, buffer.GetCharAt (idx [1]).ToString ());
-
- results = new List<int> ();
- o = buffer.TextLength - 1;
- while (o > 0 && (o = buffer.LastIndexOf ("TEST", o - 1, o, StringComparison.OrdinalIgnoreCase)) != -1) {
- results.Add (o);
- o--;
- }
- Assert.AreEqual (idx.Count, results.Count, "matches != " + idx.Count + " - found:" + results.Count);
- for (int i = 0; i < idx.Count; i++)
- Assert.AreEqual (idx [idx.Count - 1 - i], results [i], (i + 1) + ". match != " + idx [idx.Count - 1 - i] + " was " + results [i]);
-
- // move gap to the end
- buffer.Replace (idx [2], 1, buffer.GetCharAt (idx [2]).ToString ());
-
- results = new List<int> ();
- o = buffer.TextLength - 1;
- while (o > 0 && (o = buffer.LastIndexOf ("TEST", o - 1, o, StringComparison.OrdinalIgnoreCase)) != -1) {
- results.Add (o);
- o--;
- }
- Assert.AreEqual (idx.Count, results.Count, "matches != " + idx.Count + " - found:" + results.Count);
- for (int i = 0; i < idx.Count; i++)
- Assert.AreEqual (idx [idx.Count - 1 - i], results [i], (i + 1) + ". match != " + idx [idx.Count - 1 - i] + " was " + results [i]);
-
- // move gap to the end
- buffer.Replace (buffer.TextLength - 1, 1, buffer.GetCharAt (buffer.TextLength - 1).ToString ());
-
- results = new List<int> ();
- o = buffer.TextLength - 1;
- while (o > 0 && (o = buffer.LastIndexOf ("TEST", o - 1, o, StringComparison.OrdinalIgnoreCase)) != -1) {
- results.Add (o);
- o--;
- }
- Assert.AreEqual (idx.Count, results.Count, "matches != " + idx.Count + " - found:" + results.Count);
- for (int i = 0; i < idx.Count; i++)
- Assert.AreEqual (idx[idx.Count - 1 - i], results[i], (i + 1) +". match != " + idx[idx.Count - 1 - i] + " was " + results[i]);
- }
- }
-}
-
diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/DocumentTests.cs b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/DocumentTests.cs
index 496a914f1f..eaa3ce8c45 100644
--- a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/DocumentTests.cs
+++ b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/DocumentTests.cs
@@ -38,113 +38,113 @@ namespace Mono.TextEditor.Tests
public void TestDocumentCreation ()
{
var document = new Mono.TextEditor.TextDocument ();
-
+
string text =
- "1234567890\n" +
- "12345678\n" +
- "1234567\n" +
- "123456\n" +
- "12345\n" +
- "1234\n" +
- "123\n" +
- "12\n" +
- "1\n" +
- "\n";
- document.Text = text;
-
- Assert.AreEqual (text, document.Text);
- Assert.AreEqual (11, document.LineCount);
+ "1234567890\n" +
+ "12345678\n" +
+ "1234567\n" +
+ "123456\n" +
+ "12345\n" +
+ "1234\n" +
+ "123\n" +
+ "12\n" +
+ "1\n" +
+ "\n";
+ document.Text = text;
+
+ Assert.AreEqual (text, document.Text);
+ Assert.AreEqual (11, document.LineCount);
}
- [Test]
- public void TestDocumentInsert ()
- {
+ [Test]
+ public void TestDocumentInsert ()
+ {
var document = new Mono.TextEditor.TextDocument ();
-
- string top = "1234567890\n";
- string text =
- "12345678\n" +
- "1234567\n" +
- "123456\n" +
- "12345\n" +
- "1234\n" +
- "123\n" +
- "12\n" +
- "1\n" +
- "\n";
-
- document.Text = top;
- document.Insert (top.Length, text);
- Assert.AreEqual (top + text, document.Text);
+
+ string top = "1234567890\n";
+ string text =
+ "12345678\n" +
+ "1234567\n" +
+ "123456\n" +
+ "12345\n" +
+ "1234\n" +
+ "123\n" +
+ "12\n" +
+ "1\n" +
+ "\n";
+
+ document.Text = top;
+ document.Insert (top.Length, text);
+ Assert.AreEqual (top + text, document.Text);
}
- [Test]
- public void TestDocumentRemove ()
- {
+ [Test]
+ public void TestDocumentRemove ()
+ {
var document = new Mono.TextEditor.TextDocument ();
-
- string top = "1234567890\n";
- string testText =
- "12345678\n" +
- "1234567\n" +
- "123456\n" +
- "12345\n" +
- "1234\n" +
- "123\n" +
- "12\n" +
- "1\n" +
- "\n";
- document.Text = top + testText;
- document.Remove (0, top.Length);
- Assert.AreEqual (document.Text, testText);
-
- document.Remove (0, document.TextLength);
- DocumentLine line = document.GetLine (1);
- Assert.AreEqual (0, line.Offset);
- Assert.AreEqual (0, line.LengthIncludingDelimiter);
- Assert.AreEqual (0, document.TextLength);
- Assert.AreEqual (1, document.LineCount);
- }
+
+ string top = "1234567890\n";
+ string testText =
+ "12345678\n" +
+ "1234567\n" +
+ "123456\n" +
+ "12345\n" +
+ "1234\n" +
+ "123\n" +
+ "12\n" +
+ "1\n" +
+ "\n";
+ document.Text = top + testText;
+ document.Remove (0, top.Length);
+ Assert.AreEqual (document.Text, testText);
+
+ document.Remove (0, document.TextLength);
+ DocumentLine line = document.GetLine (1);
+ Assert.AreEqual (0, line.Offset);
+ Assert.AreEqual (0, line.LengthIncludingDelimiter);
+ Assert.AreEqual (0, document.TextLength);
+ Assert.AreEqual (1, document.LineCount);
+ }
- [Test]
- public void TestDocumentBug1Test()
- {
+ [Test]
+ public void TestDocumentBug1Test()
+ {
var document = new Mono.TextEditor.TextDocument ();
-
- string top = "1234567890";
- document.Text = top;
-
- Assert.AreEqual (document.GetLine (1).LengthIncludingDelimiter, document.TextLength);
-
- document.Remove(0, document.TextLength);
-
- DocumentLine line = document.GetLine (1);
- Assert.AreEqual(0, line.Offset);
- Assert.AreEqual(0, line.LengthIncludingDelimiter);
- Assert.AreEqual(0, document.TextLength);
- Assert.AreEqual(1, document.LineCount);
- }
-
- [Test]
- public void TestDocumentBug2Test()
- {
+
+ string top = "1234567890";
+ document.Text = top;
+
+ Assert.AreEqual (document.GetLine (1).LengthIncludingDelimiter, document.TextLength);
+
+ document.Remove(0, document.TextLength);
+
+ DocumentLine line = document.GetLine (1);
+ Assert.AreEqual(0, line.Offset);
+ Assert.AreEqual(0, line.LengthIncludingDelimiter);
+ Assert.AreEqual(0, document.TextLength);
+ Assert.AreEqual(1, document.LineCount);
+ }
+
+ [Test]
+ public void TestDocumentBug2Test()
+ {
var document = new Mono.TextEditor.TextDocument ();
-
- string top = "123\n456\n789\n0";
- string testText = "Hello World!";
-
- document.Text = top;
-
- document.Insert (top.Length, testText);
-
- DocumentLine line = document.GetLine (document.LineCount);
-
- Assert.AreEqual (top.Length - 1, line.Offset);
- Assert.AreEqual (testText.Length + 1, line.LengthIncludingDelimiter);
- }
+
+ string top = "123\n456\n789\n0";
+ string testText = "Hello World!";
+
+ document.Text = top;
+
+ document.Insert (top.Length, testText);
+
+ DocumentLine line = document.GetLine (document.LineCount);
+
+ Assert.AreEqual (top.Length - 1, line.Offset);
+ Assert.AreEqual (testText.Length + 1, line.LengthIncludingDelimiter);
+ }
- [Test]
- public void SplitterTest ()
+ [Test]
+ public void SplitterTest ()
{
var document = new Mono.TextEditor.TextDocument ();
for (int i = 0; i < 100; i++) {
@@ -163,6 +163,18 @@ namespace Mono.TextEditor.Tests
}
Assert.AreEqual (1, document.LineCount);
}
-
+
+ [Test]
+ public void TestBufferCreationIssue()
+ {
+ var document = new Mono.TextEditor.TextDocument ();
+
+ for (int i = 1; i < 1000; i++) {
+ var text = new string ('a', i);
+ document.Text = text;
+ Assert.AreEqual (i, document.TextLength);
+ Assert.AreEqual (text, document.Text);
+ }
+ }
}
}
diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/HtmlWriterTests.cs b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/HtmlWriterTests.cs
index 1e7b4d3fd7..35e999abb5 100644
--- a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/HtmlWriterTests.cs
+++ b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/HtmlWriterTests.cs
@@ -53,7 +53,7 @@ namespace Mono.TextEditor.Tests
</HEAD>
<BODY>
<FONT face = 'Mono'>
-<SPAN style='color:#3364a4;'>class</SPAN><SPAN style='color:#000000;'>&nbsp;Foo&nbsp;</SPAN><SPAN style='color:#000000;'>{}</SPAN></FONT>
+<SPAN style='color:#3364a4;'>class</SPAN><SPAN style='color:#222222;'>&nbsp;Foo&nbsp;</SPAN><SPAN style='color:#222222;'>{}</SPAN></FONT>
</BODY></HTML>
", generatedHtml);
}
@@ -82,10 +82,10 @@ namespace Mono.TextEditor.Tests
</HEAD>
<BODY>
<FONT face = 'Mono'>
-<SPAN style='color:#000000;'>&lt;</SPAN><SPAN style='color:#204987;'>foo</SPAN><BR>
-<SPAN style='color:#204987;'>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style='color:#f57800;'>attr1</SPAN><SPAN style='color:#000000;'>&nbsp;=</SPAN><SPAN style='color:#204987;'>&nbsp;</SPAN><SPAN style='color:#a40000;'>&quot;</SPAN><SPAN style='color:#a40000;'>1</SPAN><SPAN style='color:#a40000;'>&quot;</SPAN><BR>
-<SPAN style='color:#204987;'>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style='color:#f57800;'>attr2</SPAN><SPAN style='color:#000000;'>&nbsp;=</SPAN><SPAN style='color:#204987;'>&nbsp;</SPAN><SPAN style='color:#a40000;'>&quot;</SPAN><SPAN style='color:#a40000;'>2</SPAN><SPAN style='color:#a40000;'>&quot;</SPAN><BR>
-<SPAN style='color:#000000;'>/</SPAN><SPAN style='color:#000000;'>&gt;</SPAN></FONT>
+<SPAN style='color:#222222;'>&lt;</SPAN><SPAN style='color:#204987;'>foo</SPAN><BR>
+<SPAN style='color:#204987;'>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style='color:#f57800;'>attr1</SPAN><SPAN style='color:#222222;'>&nbsp;=</SPAN><SPAN style='color:#204987;'>&nbsp;</SPAN><SPAN style='color:#a40000;'>&quot;</SPAN><SPAN style='color:#a40000;'>1</SPAN><SPAN style='color:#a40000;'>&quot;</SPAN><BR>
+<SPAN style='color:#204987;'>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style='color:#f57800;'>attr2</SPAN><SPAN style='color:#222222;'>&nbsp;=</SPAN><SPAN style='color:#204987;'>&nbsp;</SPAN><SPAN style='color:#a40000;'>&quot;</SPAN><SPAN style='color:#a40000;'>2</SPAN><SPAN style='color:#a40000;'>&quot;</SPAN><BR>
+<SPAN style='color:#222222;'>/</SPAN><SPAN style='color:#222222;'>&gt;</SPAN></FONT>
</BODY></HTML>
"
, generatedHtml);
diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/LineSplitterTests.cs b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/LineSplitterTests.cs
index 0bfcf65a86..c67b5889f0 100644
--- a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/LineSplitterTests.cs
+++ b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/LineSplitterTests.cs
@@ -29,6 +29,7 @@
using System;
using System.Text;
using NUnit.Framework;
+using Mono.TextEditor.Utils;
namespace Mono.TextEditor.Tests
{
@@ -38,10 +39,10 @@ namespace Mono.TextEditor.Tests
[Test()]
public void TestLastLineCreation ()
{
- IBuffer buffer = new Mono.TextEditor.GapBuffer ();
+ var buffer = ImmutableText.Empty;
LineSplitter splitter = new Mono.TextEditor.LineSplitter ();
- buffer.Text = "1\n2\n3\n";
- splitter.TextReplaced (null, new DocumentChangeEventArgs (0, "", buffer.Text));
+ buffer = buffer.InsertText (0, "1\n2\n3\n");
+ splitter.TextReplaced (null, new DocumentChangeEventArgs (0, "", buffer.ToString ()));
Assert.AreEqual (4, splitter.Count);
for (int i = 0; i < 3; i++) {
Assert.AreEqual (i * 2, splitter.Get (i + 1).Offset);
@@ -58,13 +59,13 @@ namespace Mono.TextEditor.Tests
[Test()]
public void TestLastLineRemove ()
{
- IBuffer buffer = new Mono.TextEditor.GapBuffer ();
+ var buffer = ImmutableText.Empty;
LineSplitter splitter = new Mono.TextEditor.LineSplitter ();
- buffer.Text = "1\n2\n3\n";
- splitter.TextReplaced (null, new DocumentChangeEventArgs (0, "", buffer.Text));
+ buffer = buffer.InsertText (0, "1\n2\n3\n");
+ splitter.TextReplaced (null, new DocumentChangeEventArgs (0, "", buffer.ToString ()));
DocumentLine lastLine = splitter.Get (2);
- splitter.TextReplaced (null, new DocumentChangeEventArgs (lastLine.Offset, buffer.GetTextAt (lastLine.Offset, lastLine.LengthIncludingDelimiter), ""));
+ splitter.TextReplaced (null, new DocumentChangeEventArgs (lastLine.Offset, buffer.ToString (lastLine.Offset, lastLine.LengthIncludingDelimiter), ""));
Assert.AreEqual (3, splitter.Count);
diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/RtfWriterTests.cs b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/RtfWriterTests.cs
index 98e9074143..49d8525684 100644
--- a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/RtfWriterTests.cs
+++ b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/RtfWriterTests.cs
@@ -47,7 +47,7 @@ namespace Mono.TextEditor.Tests
{\fonttbl
{\f0\fnil\fprq1\fcharset128 Mono;}
}
-{\colortbl ;\red51\green100\blue164;\red0\green0\blue0;}\viewkind4\uc1\pard
+{\colortbl ;\red51\green100\blue164;\red34\green34\blue34;}\viewkind4\uc1\pard
\f0
\fs20\cf1
\cf1 class\cf2 Foo \{\}\line
@@ -70,7 +70,7 @@ namespace Mono.TextEditor.Tests
{\fonttbl
{\f0\fnil\fprq1\fcharset128 Mono;}
}
-{\colortbl ;\red0\green0\blue0;}\viewkind4\uc1\pard
+{\colortbl ;\red34\green34\blue34;}\viewkind4\uc1\pard
\f0
\fs20\cf1
\cf1 class Foo \{\}\line
@@ -93,7 +93,7 @@ namespace Mono.TextEditor.Tests
{\fonttbl
{\f0\fnil\fprq1\fcharset128 Mono;}
}
-{\colortbl ;\red0\green0\blue0;}\viewkind4\uc1\pard
+{\colortbl ;\red34\green34\blue34;}\viewkind4\uc1\pard
\f0
\fs20\cf1
\cf1 \uc1\u10004*\line
diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/SmartIndentModeTests.cs b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/SmartIndentModeTests.cs
index c97b81fc0f..7049a22fee 100644
--- a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/SmartIndentModeTests.cs
+++ b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/SmartIndentModeTests.cs
@@ -45,6 +45,13 @@ namespace Mono.TextEditor.Tests
}
#region IIndentationTracker implementation
+
+ public IndentatitonTrackerFeatures SupportedFeatures {
+ get {
+ return IndentatitonTrackerFeatures.All;
+ }
+ }
+
public string GetIndentationString (int offset)
{
return indentString;
diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/SyntaxHighlightingTests.cs b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/SyntaxHighlightingTests.cs
index 3dc7361e19..fee745dc89 100644
--- a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/SyntaxHighlightingTests.cs
+++ b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/SyntaxHighlightingTests.cs
@@ -48,7 +48,7 @@ namespace Mono.TextEditor.Tests
{
var data = new TextEditorData (new TextDocument (input));
data.Document.SyntaxMode = SyntaxModeService.GetSyntaxMode (data.Document, syntaxMode);
- data.ColorStyle = SyntaxModeService.GetColorStyle ("TangoLight");
+ data.ColorStyle = SyntaxModeService.GetColorStyle ("Light");
return data.GetMarkup (0, data.Length, false);
}
@@ -68,28 +68,28 @@ namespace Mono.TextEditor.Tests
public void TestSpans ()
{
TestOutput ("/* TestMe */",
- "<span foreground=\"#888888\" style=\"Italic\">/*</span><span foreground=\"#888888\" style=\"Italic\"> </span><span foreground=\"#888888\" style=\"Italic\">TestMe</span><span foreground=\"#888888\" style=\"Italic\"> </span><span foreground=\"#888888\" style=\"Italic\">*/</span>");
+ "<span foreground=\"#888A85\">/* TestMe */</span>");
}
[Test]
public void TestStringEscapes ()
{
TestOutput ("\"Escape:\\\" \"outtext",
- "<span foreground=\"#F57D00\">\"Escape:</span><span foreground=\"#A53E00\">\\\"</span><span foreground=\"#F57D00\"> \"</span><span foreground=\"#333333\">outtext</span>");
+ "<span foreground=\"#DB7100\">\"Escape:</span><span foreground=\"#A53E00\">\\\"</span><span foreground=\"#DB7100\"> \"</span><span foreground=\"#222222\">outtext</span>");
}
[Test]
public void TestVerbatimStringEscapes ()
{
TestOutput ("@\"Escape:\"\" \"outtext",
- "<span foreground=\"#F57D00\">@\"Escape:</span><span foreground=\"#A53E00\">\"\"</span><span foreground=\"#F57D00\"> \"</span><span foreground=\"#333333\">outtext</span>");
+ "<span foreground=\"#DB7100\">@\"Escape:</span><span foreground=\"#A53E00\">\"\"</span><span foreground=\"#DB7100\"> \"</span><span foreground=\"#222222\">outtext</span>");
}
[Test]
public void TestDoubleVerbatimStringEscapes ()
{
TestOutput ("@\"Escape:\"\"\"\" \"outtext",
- "<span foreground=\"#F57D00\">@\"Escape:</span><span foreground=\"#A53E00\">\"\"\"\"</span><span foreground=\"#F57D00\"> \"</span><span foreground=\"#333333\">outtext</span>");
+ "<span foreground=\"#DB7100\">@\"Escape:</span><span foreground=\"#A53E00\">\"\"\"\"</span><span foreground=\"#DB7100\"> \"</span><span foreground=\"#222222\">outtext</span>");
}
[Test]
@@ -97,28 +97,28 @@ namespace Mono.TextEditor.Tests
public void TestVerbatimStringEscapeLineBreak ()
{
TestOutput ("@\"Escape:\"\"\ntext\"",
- "<span foreground=\"#F57D00\">@\"Escape:</span><span foreground=\"#A53E00\">\"\"</span>\n<span foreground=\"#F57D00\">text\"</span>");
+ "<span foreground=\"#DB7100\">@\"Escape:</span><span foreground=\"#A53E00\">\"\"</span>\n<span foreground=\"#DB7100\">text\"</span>");
}
[Test]
public void TestHexDigit ()
{
TestOutput ("0x12345679AFFEuL",
- "<span foreground=\"#F57D00\">0x12345679AFFEuL</span>");
+ "<span foreground=\"#DB7100\">0x12345679AFFEuL</span>");
}
[Test]
public void TestDoubleDigit ()
{
TestOutput ("123.45678e-09d",
- "<span foreground=\"#F57D00\">123.45678e-09d</span>");
+ "<span foreground=\"#DB7100\">123.45678e-09d</span>");
}
[Test]
public void TestCDATASection ()
{
TestOutput ("<![CDATA[ test]]>",
- "<span foreground=\"#333333\">&lt;![CDATA[ test]]&gt;</span>",
+ "<span foreground=\"#222222\">&lt;![CDATA[ test]]&gt;</span>",
"application/xml");
}
@@ -130,7 +130,7 @@ namespace Mono.TextEditor.Tests
public void TestBug603 ()
{
TestOutput ("///<summary>foo bar</summary>",
- "<span foreground=\"#888888\" style=\"Italic\">///</span><span foreground=\"#888888\" style=\"Italic\">&lt;</span><span foreground=\"#888888\" style=\"Italic\">summary</span><span foreground=\"#888888\" style=\"Italic\">&gt;</span><span foreground=\"#888888\" style=\"Italic\">foo bar</span><span foreground=\"#888888\" style=\"Italic\">&lt;</span><span foreground=\"#888888\" style=\"Italic\">/</span><span foreground=\"#888888\" style=\"Italic\">summary</span><span foreground=\"#888888\" style=\"Italic\">&gt;</span>");
+ "<span foreground=\"#C8B97B\">///&lt;summary&gt;</span><span foreground=\"#97B488\">foo bar</span><span foreground=\"#C8B97B\">&lt;/summary&gt;</span>");
}
[Test]
@@ -138,7 +138,7 @@ namespace Mono.TextEditor.Tests
{
TestOutput (
"\n\n\nlet x = 2",
- "<span foreground=\"#009695\">let </span><span foreground=\"#333333\">x = </span><span foreground=\"#F57D00\">2</span>",
+ "<span foreground=\"#009695\">let</span><span foreground=\"#222222\"> x = </span><span foreground=\"#DB7100\">2</span>",
"text/x-fsharp");
}
}
diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/ViTests.cs b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/ViTests.cs
deleted file mode 100644
index fd129b4a2f..0000000000
--- a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/ViTests.cs
+++ /dev/null
@@ -1,575 +0,0 @@
-//
-// ViTests.cs
-//
-// Author:
-// Michael Hutchinson <mhutchinson@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using NUnit.Framework;
-using System.Reflection;
-using Mono.TextEditor.Vi;
-using System.Text;
-
-namespace Mono.TextEditor.Tests
-{
- [TestFixture]
- public class ViTests : TextEditorTestBase
- {
- [Test]
- public void ColumnMotion ()
- {
- var mode = new TestViEditMode () { Text = "Test\nText" };
- Assert.AreEqual (1, mode.Col);
- mode.Input ('l');
- Assert.AreEqual (2, mode.Col);
- mode.Input ("ll");
- Assert.AreEqual (4, mode.Col);
- mode.Input ('l');
- Assert.AreEqual (4, mode.Col);
- mode.Input ("hh");
- Assert.AreEqual (2, mode.Col);
- mode.Input ('h');
- Assert.AreEqual (1, mode.Col);
- mode.Input ('h');
- Assert.AreEqual (1, mode.Col);
- }
-
- [Test]
- public void LineMotion ()
- {
- var mode = new TestViEditMode () { Text =
-@"abc def
-ghy jklmn op
-qrstu
-vwxyz",
- };
- mode.Caret.Offset = 0;
- Assert.AreEqual (1, mode.Line);
- mode.Input ('j');
- Assert.AreEqual (2, mode.Line);
- mode.Input ('k');
- Assert.AreEqual (1, mode.Line);
- mode.Input ("jjjj");
- Assert.AreEqual (4, mode.Line);
- mode.Caret.Line = 2;
- mode.Caret.Column = 12;
- mode.Input ('j');
- Assert.AreEqual (5, mode.Col);
- mode.Input ('k');
- Assert.AreEqual (12, mode.Col);
- }
-
- [Test]
- public void ChangeWord ()
- {
- var mode = new TestViEditMode () { Text =
-@"abc def
-ghy jklmn op
-qrstu",
- };
- mode.Caret.Offset = 0;
- mode.Input ("jwcwhi");
- Assert.AreEqual ("ghy hi op", mode.GetLine ());
- }
-
- [Test]
- public void DeleteWord ()
- {
- var mode = new TestViEditMode () { Text =
-@"abc def
-ghy jklmn op
-qrstu",
- };
- mode.Caret.Offset = 0;
- mode.Input ("jwlldw");
- Assert.AreEqual ("ghy jkop", mode.GetLine ());
- }
-
- [Test]
- public void DeleteLine ()
- {
- var mode = new TestViEditMode () { Text =
-@" aaa aaa
- bbb bbb
- ccc ccc",
- };
- mode.Input ("jwlldd");
- Assert.AreEqual (2, mode.Line);
- Assert.AreEqual (4, mode.Col);
- Assert.AreEqual (
-@" aaa aaa
- ccc ccc", mode.Text);
- }
-
- [Test]
- [TestCase(0, ExpectedResult = " foo.bar[20]->baz_bay")]
- [TestCase(2, ExpectedResult = "iffoo.bar[20]->baz_bay")]
- [TestCase(3, ExpectedResult = "if .bar[20]->baz_bay")]
- [TestCase(5, ExpectedResult = "if .bar[20]->baz_bay")]
- [TestCase(6, ExpectedResult = "if foobar[20]->baz_bay")]
- [TestCase(16, ExpectedResult = "if foo.bar[20]->")]
- public string ChangeInnerWord(int column)
- {
- var mode = new TestViEditMode { Text = "if foo.bar[20]->baz_bay" };
- RepeatChar('l', column, mode);
- mode.Input ("ciw");
- return mode.Text;
- }
-
- [Test]
- public void ChangeLine ()
- {
- var mode = new TestViEditMode () { Text =
-@" aaa aaa
- bbb bbb
- ccc ccc",
- };
- mode.Input ("jwllcceeee");
- Assert.AreEqual (
-@" aaa aaa
- eeee
- ccc ccc", mode.Text);
- }
-
- [Test]
- [TestCase(0, ExpectedResult = "if (foo(baz) == bar) ")]
- [TestCase(2, ExpectedResult = "if (foo(baz) == bar) ")]
- [TestCase(3, ExpectedResult = "if () ")]
- [TestCase(6, ExpectedResult = "if () ")]
- [TestCase(7, ExpectedResult = "if (foo() == bar) ", Ignore = true)] // IBracketMatcher is misbehaving for test mode
- [TestCase(9, ExpectedResult = "if (foo() == bar) ")]
- [TestCase(10, ExpectedResult = "if (foo() == bar) ")]
- [TestCase(11, ExpectedResult = "if (foo() == bar) ")]
- [TestCase(12, ExpectedResult = "if () ")]
- [TestCase(18, ExpectedResult = "if () ")]
- [TestCase(19, ExpectedResult = "if () ")]
- [TestCase(20, ExpectedResult = "if (foo(baz) == bar) ")]
- public string ChangeInnerParen(int column)
- {
- var mode = new TestViEditMode { Text = "if (foo(baz) == bar) " };
- RepeatChar('l', column, mode);
- mode.Input ("ci)");
- return mode.Text;
- }
-
- [Test]
- [TestCase(0, 2, ExpectedResult = "do { \n\tfoo\n} forever;")]
- [TestCase(0, 3, ExpectedResult = "do {\n} forever;")]
- [TestCase(0, 4, ExpectedResult = "do {\n} forever;")]
- [TestCase(1, 0, ExpectedResult = "do {\n} forever;")]
- [TestCase(2, 0, ExpectedResult = "do {\n} forever;")]
- [TestCase(2, 1, ExpectedResult = "do { \n\tfoo\n} forever;")]
- public string ChangeInnerBrace (int row, int column)
- {
- var mode = new TestViEditMode { Text =
-@"do {
- foo
-} forever;" };
- RepeatChar ('j', row, mode);
- RepeatChar ('l', column, mode);
- mode.Input ("ci}");
- return mode.Text;
- }
-
- [Test]
- [TestCase(0, 0, ExpectedResult = "{\n}")]
- [TestCase(1, 0, ExpectedResult = "{\n}")]
- [TestCase(2, 0, ExpectedResult = "{\n}")]
- [TestCase(3, 0, ExpectedResult = "{\n\tdo\n\t{\n\t}\n\tdo {\n\t\tbar\n\t}\n}")]
- [TestCase(4, 0, ExpectedResult = "{\n\tdo\n\t{\n\t}\n\tdo {\n\t\tbar\n\t}\n}")]
- [TestCase(5, 0, ExpectedResult = "{\n}")]
- [TestCase(6, 0, ExpectedResult = "{\n\tdo\n\t{\n\t\tfoo\n\t}\n\tdo {\n\t}\n}")]
- [TestCase(7, 0, ExpectedResult = "{\n\tdo\n\t{\n\t\tfoo\n\t}\n\tdo {\n\t}\n}")]
- [TestCase(8, 0, ExpectedResult = "{\n}")]
- public string ChangeInnerBrace_WithNestedMatchingBraces(int row, int column)
- {
- var mode = new TestViEditMode { Text =
-@"{
- do
- {
- foo
- }
- do {
- bar
- }
-}" };
- RepeatChar('j', row, mode);
- RepeatChar('l', column, mode);
- mode.Input ("ci}");
- return mode.Text;
- }
-
- [Test]
- [Ignore("IBracketMatcher is misbehaving for test mode, this really does work.")]
- [TestCase('(', ')', '"')]
- [TestCase('{', '}', '"')]
- [TestCase('[', ']', '"')]
- [TestCase('<', '>', '"')]
- [TestCase('(', ')', '\'')]
- [TestCase('{', '}', '\'')]
- [TestCase('[', ']', '\'')]
- [TestCase('<', '>', '\'')]
- public void ChangeInnerBrace_IsntConfusedByQuotes (char startBrace, char endBrace, char quote)
- {
- var text = string.Format ("if {0}{2}{1}{2} == bar{1} ", startBrace, endBrace, quote);
- var mode = new TestViEditMode { Text = text };
- RepeatChar ('l', 4, mode);
-
- // Validate that our setups work. Use a specific case (the rest proved correct via induction).
- if (startBrace == '(' && quote == '\'') {
- Assert.AreEqual ("if (')' == bar) ", text,
- "Validating that our test input because it's a bit too generic to be easy to read.");
-
- var plusMinusOneCharContext = "" + mode.GetChar(mode.Caret.Offset-1) + mode.GetChar(mode.Caret.Offset)
- + mode.GetChar(mode.Caret.Offset+1);
- Assert.AreEqual ("(')", plusMinusOneCharContext, "The cursor is where we expect it to be.");
-
- Assert.NotNull(mode.Document.BracketMatcher);
- Assert.IsInstanceOf<DefaultBracketMatcher>(mode.Document.BracketMatcher);
-
- var matchingParen = mode.Document.GetMatchingBracketOffset (3);
- Assert.AreEqual (14, matchingParen, "Validate setup correctly enabled mode.Document functionality.");
- }
-
- mode.Input ("ci" + endBrace);
- var expectedText = string.Format ("if {0}{1} ", startBrace, endBrace, quote);
- Assert.AreEqual (expectedText, mode.Text);
- }
-
- [Test]
- public void VisualInnerParen()
- {
- var mode = new TestViEditMode { Text = "if (foo(baz) == bar) " };
- RepeatChar('l', 3, mode);
- mode.Input ("vi)");
- mode.AssertSelection (1, 5, 1, 20);
- }
-
- [Test]
- public void DeleteInnerParen()
- {
- var mode = new TestViEditMode { Text = "if (foo(baz) == bar) " };
- RepeatChar('l', 3, mode);
- mode.Input ("di)");
- Assert.AreEqual ("if () ", mode.Text);
- }
-
- [Test]
- public void YankInnerParen()
- {
- var mode = new TestViEditMode { Text = "if (foo(baz) == bar) " };
- RepeatChar('l', 3, mode);
- mode.Input ("yi)");
- mode.Input ("$p"); // HACK: I can't figure out how to test the register, so just paste at the end
- Assert.AreEqual ("if (foo(baz) == bar) foo(baz) == bar", mode.Text);
- }
-
- [Test]
- [TestCase(0, '\'', ExpectedResult = @"'' 'world\'s' 'worlder\\'s'")]
- [TestCase(1, '\'', ExpectedResult = @"'' 'world\'s' 'worlder\\'s'")]
- [TestCase(5, '\'', ExpectedResult = @"'' 'world\'s' 'worlder\\'s'")]
- [TestCase(6, '\'', ExpectedResult = @"'' 'world\'s' 'worlder\\'s'")]
- [TestCase(7, '\'', ExpectedResult = @"'hello''world\'s' 'worlder\\'s'")]
- [TestCase(8, '\'', ExpectedResult = @"'hello' '' 'worlder\\'s'", IgnoreReason = "Advanced scenario")]
- [TestCase(9, '\'', ExpectedResult = @"'hello' '' 'worlder\\'s'")]
- [TestCase(16, '\'', ExpectedResult = @"'hello' '' 'worlder\\'s'")]
- [TestCase(17, '\'', ExpectedResult = @"'hello' '' 'worlder\\'s'")]
- [TestCase(18, '\'', ExpectedResult = @"'hello' 'world\'s''worlder\\'s'")]
- [TestCase(19, '\'', ExpectedResult = @"'hello' 'world\'s' ''", IgnoreReason = "Advanced scenario")]
- [TestCase(29, '\'', ExpectedResult = @"'hello' 'world\'s' ''")]
- [TestCase(30, '\'', ExpectedResult = @"'hello' 'world\'s' ''")]
- [TestCase(31, '\'', ExpectedResult = @"'hello' 'world\'s' ''")]
- [TestCase(1, '"', ExpectedResult = @""""" ""world\""s"" ""worlder\\""s""")]
- [TestCase(31, '`', ExpectedResult = @"`hello` `world\`s` ``")]
- public string ChangeInnerQuote (int col, char quote)
- {
- var mode = new TestViEditMode { Text = @"'hello' 'world\'s' 'worlder\\'s'".Replace ('\'', quote) };
- RepeatChar('l', col, mode);
- mode.Input ("ci" + quote);
- return mode.Text;
- }
-
- [Test]
- public void ChangeOuterQuote()
- {
- var mode = new TestViEditMode { Text = "'hello'" };
- RepeatChar('l', 3, mode);
- mode.Input ("ca'");
- Assert.That (mode.Text, Is.Empty);
- }
-
- [Test]
- public void ChangeOuterParen()
- {
- var mode = new TestViEditMode { Text = "((hello))" };
- RepeatChar('l', 3, mode);
- mode.Input ("ca)");
- Assert.That (mode.Text, Is.EqualTo ("()"));
- }
-
- [Test]
- public void ChangeOuterParen_Multiline()
- {
- var mode = new TestViEditMode { Text = "((\n\thello\n))" };
- RepeatChar('j', 1, mode);
- RepeatChar('l', 4, mode);
- mode.Input ("ca)");
- Assert.That (mode.Text, Is.EqualTo ("()"));
- }
-
- static void RepeatChar(char c, int count, TestViEditMode mode)
- {
- string input = "";
- for (int i = 0; i < count; i++)
- input += c;
- mode.Input(input);
- }
-
- [Ignore("FixMe")]
- [Test]
- public void LineDeletePaste ()
- {
- var mode = new TestViEditMode () { Text =
-@" aaa aaa
- bbb bbb
- ccc ccc
- eee eee
- fff fff
- ggg ggg
- hhh hhh",
- };
- //move down, enter visual line mode, move down twice -> lines 2/3/4 selected -> delete
- mode.Input ("jjVjjd");
- Assert.AreEqual (
-@" aaa aaa
- bbb bbb
- ggg ggg
- hhh hhh", mode.Text);
- //enter visual line mode, move down once -> lines 1/2 selected -> delete
- mode.Input ("Vkd");
- Assert.AreEqual (
-@" aaa aaa
- hhh hhh", mode.Text);
- //paste last delete below current line (1)
- mode.Input ("p");
- Assert.AreEqual (
-@" aaa aaa
- hhh hhh
- bbb bbb
- ggg ggg", mode.Text);
- //paste last delete above current line (3)
- mode.Input ("P");
- Assert.AreEqual (
-@" aaa aaa
- hhh hhh
- bbb bbb
- bbb bbb
- ggg ggg
- ggg ggg", mode.Text);
- Assert.AreEqual (5, mode.Line);
- //movement to/across boundaries, check selection still okay by deleting lines 1/2/3
- mode.Input ("kVlllllhhhhhhhhhhjjjhhhhhjjjjkkkkkkkkkkkkjd");
- Assert.AreEqual (
-@" aaa aaa
- ggg ggg
- ggg ggg", mode.Text);
- }
-
- [Ignore("Got broken because 'RemoveTrailingWhitespaces' option was removed.")]
- [Test]
- public void DeleteToLineBoundary ()
- {
- var mode = new TestViEditMode () { Text =
-@" aaa bbb ccc ddd
- eee fff ggg hhh
- iii jjj kkk lll",
- };
- //move 3 words, delete to line end
- mode.Input ("wwwd$");
- Assert.AreEqual (
-@" aaa bbb
- eee fff ggg hhh
- iii jjj kkk lll", mode.Text);
- //move down to 0 position, move 3 words, delete to home
- mode.Input ("j0wwwd^");
- Assert.AreEqual (
-@" aaa bbb
- ggg hhh
- iii jjj kkk lll", mode.Text);
- //move down to 0 position, move 3 words, delete to 0
- mode.Input ("j0wwwd0");
- Assert.AreEqual (
-@" aaa bbb
- ggg hhh
-kkk lll", mode.Text);
- }
-
- [Test]
- public void VisualMotion ()
- {
- var mode = new TestViEditMode () { Text =
-@" aaa bbb ccc ddd
- eee fff ggg hhh
- iii jjj kkk lll
- mmm nnn ooo ppp
- qqq rrr sss ttt",
- };
- //move 2 lines down, 2 words in, enter visual mode
- mode.Input ("jjwwv");
- mode.AssertSelection (3, 8, 3, 9);
- //2 letters to right
- mode.Input ("ll");
- mode.AssertSelection (3, 8, 3, 11);
- //4 letters to left
- mode.Input ("hhhh");
- mode.AssertSelection (3, 9, 3, 6);
- //1 line up
- mode.Input ("k");
- mode.AssertSelection (3, 9, 2, 6);
- //1 line up
- mode.Input ("k");
- mode.AssertSelection (3, 9, 1, 6);
- //5 letters to right
- mode.Input ("lllll");
- mode.AssertSelection (3, 9, 1, 11);
- //3 lines down
- mode.Input ("jjj");
- mode.AssertSelection (3, 8, 4, 12);
- }
-
- [Test]
- public void KeyNotationRoundTrip ()
- {
- string command = "<C-m>av2f<Space>34<Esc><M-Space><S-C-M-Down>";
- var keys = ViKeyNotation.Parse (command);
- Assert.IsNotNull (keys);
- Assert.AreEqual (11, keys.Count);
- var s = ViKeyNotation.ToString (keys);
- Assert.AreEqual (command, s);
- }
- }
-
- class TestViEditMode : ViEditMode
- {
- public TestViEditMode () : this (new TextEditorData ())
- {
- Data.Options.WordFindStrategy = new Mono.TextEditor.Vi.ViWordFindStrategy ();
- }
-
- //used to prevent edit actions from the HandleKeypress causing Caret/SelectionPositionChanged
- bool inputting;
-
- public TestViEditMode (TextEditorData data)
- {
- data.CurrentMode = this;
- textEditorData = data;
- // Currently doesn't work on my mac (test doesn't terminate with mono 2.6.7).
- // var f = typeof (EditMode).GetField ("textEditorData", BindingFlags.NonPublic | BindingFlags.Instance);
- // f.SetValue (this, data);
-
- data.Caret.PositionChanged += delegate(object sender, DocumentLocationEventArgs e) {
- if (!inputting)
- this.CaretPositionChanged ();
- };
- data.SelectionChanged += delegate(object sender, EventArgs e) {
- if (!inputting)
- this.SelectionChanged ();
- };
- }
-
- public new TextEditorData Data {
- get { return base.Data; }
- }
-
- public new TextDocument Document {
- get { return base.Document; }
- }
-
- public new Caret Caret {
- get { return base.Caret; }
- }
-
- public int Col {
- get { return Caret.Column; }
- }
-
- public int Line {
- get { return Caret.Line; }
- }
-
- public string Text {
- get { return Data.Document.Text; }
- set { Data.Document.Text = value; }
- }
-
- public string GetLine ()
- {
- return GetLine (Line);
- }
-
- public string GetLine (int line)
- {
- var seg = Document.GetLine (line);
- return Document.GetTextAt (seg.Offset, seg.Length);
- }
-
- public char GetChar (int offset)
- {
- return Document.GetCharAt (offset);
- }
-
- public char GetChar ()
- {
- return Document.GetCharAt (Caret.Offset);
- }
-
- public void Input (Gdk.Key key, uint unicodeKey, Gdk.ModifierType modifier)
- {
- inputting = true;
- HandleKeypress (key, unicodeKey, modifier);
- inputting = false;
- }
-
- public void Input (char unicodeKey)
- {
- Input ((Gdk.Key)0, unicodeKey, Gdk.ModifierType.None);
- }
-
- public void Input (string sequence)
- {
- foreach (char c in sequence)
- Input ((Gdk.Key)0, c, Gdk.ModifierType.None);
- }
-
- public void AssertSelection (int anchorLine, int anchorCol, int leadLine, int leadCol)
- {
- var sel = Data.MainSelection;
- Assert.IsNotNull (sel);
- Assert.AreEqual (anchorLine, sel.Anchor.Line);
- Assert.AreEqual (anchorCol, sel.Anchor.Column);
- Assert.AreEqual (leadLine, sel.Lead.Line);
- Assert.AreEqual (leadCol, sel.Lead.Column);
- }
- }
-}
-
diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/VirtualIndentModeTests.cs b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/VirtualIndentModeTests.cs
index a163c4dcec..eca48ae577 100644
--- a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/VirtualIndentModeTests.cs
+++ b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/VirtualIndentModeTests.cs
@@ -168,8 +168,8 @@ namespace Mono.TextEditor.Tests
var data = CreateData ("test\n\n\n");
data.Caret.Location = new DocumentLocation (2, data.IndentationTracker.GetVirtualIndentationColumn (2, 1));
DeleteActions.Backspace (data);
- Assert.AreEqual (new DocumentLocation (2, data.IndentationTracker.GetVirtualIndentationColumn (2, 1) - 1), data.Caret.Location);
- Assert.AreEqual ("test\n\t\n\n", data.Document.Text);
+ Assert.AreEqual (new DocumentLocation (1, 5), data.Caret.Location);
+ Assert.AreEqual ("test\n\n", data.Document.Text);
}
[Test]
@@ -206,7 +206,7 @@ namespace Mono.TextEditor.Tests
CaretMoveActions.Up (data);
Assert.AreEqual (new DocumentLocation (1, 3), data.Caret.Location);
DeleteActions.Delete (data);
- Assert.AreEqual ("\t\t\t\ttest", data.Document.Text);
+ Assert.AreEqual ("\t\ttest", data.Document.Text);
}
[Test]
@@ -262,7 +262,7 @@ namespace Mono.TextEditor.Tests
data.Caret.Location = new DocumentLocation (2, 2);
DeleteActions.Backspace (data);
Assert.AreEqual ("\n\n\n", data.Document.Text);
- Assert.AreEqual (1, data.Caret.Column);
+ Assert.AreEqual (1, data.Caret.Offset);
}
[Test]
@@ -391,7 +391,7 @@ namespace Mono.TextEditor.Tests
data.Caret.Location = new DocumentLocation (1, 2);
DeleteActions.Backspace (data);
Assert.AreEqual ("", data.Document.Text);
- Assert.AreEqual (new DocumentLocation (1, 1), data.Caret.Location);
+ Assert.AreEqual (0, data.Caret.Offset);
}
/// <summary>
@@ -451,19 +451,111 @@ namespace Mono.TextEditor.Tests
{
var data = CreateData ("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n\t\t\r\n\r\n");
data.Options.DefaultEolMarker = "\r\n";
- data.IndentationTracker = new DefaultIndentationTracker (data.Document);
+ data.IndentationTracker = new DefaultIndentationTracker (data.Document) {
+ SupportedFeatures = IndentatitonTrackerFeatures.All
+ };
data.Caret.Location = new DocumentLocation (4, 3);
DeleteActions.Backspace (data);
- Assert.AreEqual (new DocumentLocation (4, 2), data.Caret.Location);
+ Assert.AreEqual (new DocumentLocation (3, 3), data.Caret.Location);
+
+ }
+
+ [Test]
+ public void TestSmartBackspaceBehavior ()
+ {
+ var data = CreateData ("\n\t\t\n\t\t");
+ data.Caret.Location = new DocumentLocation (3, 3);
DeleteActions.Backspace (data);
- Assert.AreEqual (new DocumentLocation (4, 1), data.Caret.Location);
+ Assert.AreEqual (new DocumentLocation (2, 3), data.Caret.Location);
+ Assert.AreEqual ("\n", data.Document.Text);
+ }
+ [Test]
+ public void TestSmartBackspaceBehaviorCase2 ()
+ {
+ var data = CreateData ("\n\t\tTest\n\t\t");
+ data.Caret.Location = new DocumentLocation (3, 3);
DeleteActions.Backspace (data);
- Assert.AreEqual (new DocumentLocation (3, 3), data.Caret.Location);
+ Assert.AreEqual (new DocumentLocation (2, 7), data.Caret.Location);
+ Assert.AreEqual ("\n\t\tTest", data.Document.Text);
+ }
+
+ [Test]
+ public void TestSmartBackspaceBehaviorCase3 ()
+ {
+ var data = CreateData ("\n\t\t Test");
+ data.Caret.Location = new DocumentLocation (2, 6);
+ DeleteActions.Backspace (data);
+
+ Assert.AreEqual (new DocumentLocation (2, 5), data.Caret.Location);
+ Assert.AreEqual ("\n\t\t Test", data.Document.Text);
+
+ DeleteActions.Backspace (data);
+ Assert.AreEqual (new DocumentLocation (2, 4), data.Caret.Location);
+ Assert.AreEqual ("\n\t\t Test", data.Document.Text);
+
+ DeleteActions.Backspace (data);
+ Assert.AreEqual (new DocumentLocation (2, 3), data.Caret.Location);
+ Assert.AreEqual ("\n\t\tTest", data.Document.Text);
+ }
+
+ [Test]
+ public void TestEmptyLineSmartBackspace ()
+ {
+ var data = CreateData ("\n\n\n\n");
+ data.IndentationTracker = new SmartIndentModeTests.TestIndentTracker ("\t");
+ data.Caret.Location = new DocumentLocation (3, 2);
+ DeleteActions.Backspace (data);
+ Assert.AreEqual (new DocumentLocation (2, 2), data.Caret.Location);
+ Assert.AreEqual ("\n\n\n", data.Document.Text);
+ DeleteActions.Backspace (data);
+ Assert.AreEqual (new DocumentLocation (1, 2), data.Caret.Location);
+ Assert.AreEqual ("\n\n", data.Document.Text);
+ }
+
+
+ [Test]
+ public void TestSmartExistingLineBackspace ()
+ {
+ var data = CreateData ("\n\t\t\n\t\tTest");
+ data.Caret.Location = new DocumentLocation (3, 3);
+ DeleteActions.Backspace (data);
+ Assert.AreEqual (new DocumentLocation (2, 3), data.Caret.Location);
+ Assert.AreEqual ("\n\t\tTest", data.Document.Text);
+ }
+
+
+ [Test]
+ public void TestSmartDeleteBehavior ()
+ {
+ var data = CreateData ("\n\t\t\n\t\t");
+ data.Caret.Location = new DocumentLocation (2, 3);
+ DeleteActions.Delete (data);
+ Assert.AreEqual (new DocumentLocation (2, 3), data.Caret.Location);
+ Assert.AreEqual ("\n", data.Document.Text);
+ }
+ [Test]
+ public void TestSmartDeleteBehaviorNonEmptyLines ()
+ {
+ var data = CreateData ("\n\t\tFoo\n\t\tBar");
+ data.Caret.Location = new DocumentLocation (2, 6);
+ DeleteActions.Delete (data);
+ Assert.AreEqual (new DocumentLocation (2, 6), data.Caret.Location);
+ Assert.AreEqual ("\n\t\tFooBar", data.Document.Text);
}
+
+ [Test]
+ public void TestSmartDeleteBehaviorBug1 ()
+ {
+ var data = CreateData ("\n\t\tFoo\n\t\t Bar");
+ data.Caret.Location = new DocumentLocation (2, 6);
+ DeleteActions.Delete (data);
+ Assert.AreEqual (new DocumentLocation (2, 6), data.Caret.Location);
+ Assert.AreEqual ("\n\t\tFooBar", data.Document.Text);
+ }
}
}
diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj b/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj
index e91c85430b..ed844bf61a 100644
--- a/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj
+++ b/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj
@@ -48,9 +48,7 @@
<Compile Include="Mono.TextEditor.Tests\UndoRedoTests.cs" />
<Compile Include="Mono.TextEditor.Tests\FoldingTests.cs" />
<Compile Include="Mono.TextEditor.Tests\SyntaxHighlightingTests.cs" />
- <Compile Include="Mono.TextEditor.Tests\ViTests.cs" />
<Compile Include="Mono.TextEditor.Tests\VirtualSpacesTests.cs" />
- <Compile Include="Mono.TextEditor.Tests\BufferTests.cs" />
<Compile Include="Mono.TextEditor.Tests\InsertionModeTests.cs" />
<Compile Include="Mono.TextEditor.Tests\TextBreakerTests.cs" />
<Compile Include="Mono.TextEditor.Tests\SegmentTreeTests.cs" />
@@ -73,7 +71,6 @@
<Compile Include="Mono.TextEditor.Tests.DefaultEditActions\MiscActionsTest.cs" />
<Compile Include="Mono.TextEditor.Tests\ClipboardTests.cs" />
<Compile Include="Mono.TextEditor.Tests\CompressingTreeListTests.cs" />
- <Compile Include="Mono.TextEditor.Tests\AvlTreeTests.cs" />
<Compile Include="Mono.TextEditor.Tests\SearchAndReplaceTests.cs" />
<Compile Include="Mono.TextEditor.Tests\SemanticRuleTests.cs" />
</ItemGroup>
diff --git a/main/src/tools/ChangeLog b/main/src/tools/ChangeLog
deleted file mode 100644
index e12d5b1bf2..0000000000
--- a/main/src/tools/ChangeLog
+++ /dev/null
@@ -1,9 +0,0 @@
-2010-03-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdmonitor:
- * Makefile.am: Added new instrumentation monitor tool.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * Tools.mds: Migrated to MSBuild file format.
-
diff --git a/main/src/tools/Makefile.am b/main/src/tools/Makefile.am
index d25ea39a9d..d6645b2da0 100644
--- a/main/src/tools/Makefile.am
+++ b/main/src/tools/Makefile.am
@@ -1 +1 @@
-SUBDIRS = SharpCoco mdhost mdtool mdmonitor
+SUBDIRS = mdhost mdtool mdmonitor
diff --git a/main/src/tools/SharpCoco/ChangeLog b/main/src/tools/SharpCoco/ChangeLog
deleted file mode 100644
index 53c72e8fd6..0000000000
--- a/main/src/tools/SharpCoco/ChangeLog
+++ /dev/null
@@ -1,8 +0,0 @@
-2005-01-27 John Luke <jluke@cfl.rr.com>
-
- * src/Parser.cs: comment unused line
-
-2004-04-08 John Luke <jluke@cfl.rr.com>
-
- * src/DFA.cs: use Path.Combine not + "\\Scanner.frame";
-
diff --git a/main/src/tools/SharpCoco/Makefile.am b/main/src/tools/SharpCoco/Makefile.am
deleted file mode 100644
index 99e7634136..0000000000
--- a/main/src/tools/SharpCoco/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-
-ASSEMBLY = SharpCoco.exe
-ATG = src/Coco.ATG
-
-FILES = src/AssemblyInfo.cs \
-src/Parser.cs \
-src/Trace.cs \
-src/Coco.cs \
-src/Tab.cs \
-src/ParserGen.cs \
-src/Scanner.cs \
-src/DFA.cs
-
-all: $(ASSEMBLY)
-
-$(ASSEMBLY): $(build_sources)
- $(CSC) $(CSC_FLAGS) $(build_sources) /out:$(ASSEMBLY)
-
-CLEANFILES = $(ASSEMBLY) $(ASSEMBLY).mdb
-EXTRA_DIST = $(FILES)
-include $(top_srcdir)/Makefile.include
-
diff --git a/main/src/tools/SharpCoco/readme.txt b/main/src/tools/SharpCoco/readme.txt
deleted file mode 100644
index 77a6131269..0000000000
--- a/main/src/tools/SharpCoco/readme.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-Modified version of Coco/R
-
-The original version can be found at:
-http://www.ssw.uni-linz.ac.at/Research/Projects/Coco/CSharp/
-
-Changes
-
-+ Added #line pragmas for the generated parser
-+ Now Coco uses more enums than ints...
-+ no static method generation (now all is public)
-+ Error & Scanner are now fields inside the parser, no more static
- calling
-
-Mike \ No newline at end of file
diff --git a/main/src/tools/SharpCoco/src/AssemblyInfo.cs b/main/src/tools/SharpCoco/src/AssemblyInfo.cs
deleted file mode 100644
index 198a48c0ab..0000000000
--- a/main/src/tools/SharpCoco/src/AssemblyInfo.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-// Information about this assembly is defined by the following
-// attributes.
-//
-// change them to the information which is associated with the assembly
-// you compile.
-
-[assembly: AssemblyTitle("")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// The assembly version has following format :
-//
-// Major.Minor.Build.Revision
-//
-// You can specify all values by your own or you can build default build and revision
-// numbers with the '*' character (the default):
-
-[assembly: AssemblyVersion("1.0.0.0")]
-
-// The following attributes specify the key for the sign of your assembly. See the
-// .NET Framework documentation for more information about signing.
-// This is not required, if you don't want signing let these attributes like they're.
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile("")]
diff --git a/main/src/tools/SharpCoco/src/Coco.atg b/main/src/tools/SharpCoco/src/Coco.atg
deleted file mode 100644
index 2f931c99a8..0000000000
--- a/main/src/tools/SharpCoco/src/Coco.atg
+++ /dev/null
@@ -1,432 +0,0 @@
-/* ------------------------------------------------------------------------
- * Coco.ATG
- * Attributed grammer of Coco/R
- * by H. Moessenboeck, Univ. of Linz
- * extended by
- * M. Loeberbauer & A. Woess, Univ. of Linz
- * ------------------------------------------------------------------------*/
-
-using System.Collections;
-using System.Text;
-
-COMPILER Coco
-
- const int id = 0;
- const int str = 1;
-
- static bool genScanner;
-
-/*-------------------------------------------------------------------------*/
-
-CHARACTERS
- letter = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".
- digit = "0123456789".
- cr = '\r'.
- lf = '\n'.
- tab = '\t'.
- stringCh = ANY - '"' - '\\' - cr - lf.
- charCh = ANY - '\'' - '\\' - cr - lf.
- printable = '\u0020' .. '\u007e'.
- hex = "0123456789abcdef".
-
-IGNORE cr + lf + tab
-
-TOKENS
- ident = letter { letter | digit }.
- number = digit { digit }.
- string = '"' { stringCh | '\\' printable } '"'.
- badString = '"' { stringCh | '\\' printable } (cr | lf).
- char = '\'' ( charCh | '\\' printable { hex } ) '\''.
-
-PRAGMAS
- ddtSym = '$' { digit | letter }. (. Tab.SetDDT(la.val); .)
-
-COMMENTS FROM "/*" TO "*/" NESTED
-
-/*-------------------------------------------------------------------------*/
-
-PRODUCTIONS
-
-Coco (. Symbol sym; Graph g; string gramName; .)
-=
- [ UsingDecl<out ParserGen.usingPos> ]
-
- "COMPILER" (. int gramLine = t.line;
- genScanner = true;
- bool ok = true;
- Tab.ignored = null;
- .)
- ident (. gramName = t.val;
- int beg = la.pos;
- .)
- { ANY } (. Tab.semDeclPos = new Position(beg, la.pos-beg, 0); .)
- { Declaration }
- SYNC
- "PRODUCTIONS" (. if (genScanner) DFA.MakeDeterministic();
- Graph.DeleteNodes();
- .)
- { ident (. sym = Symbol.Find(t.val);
- bool undef = sym == null;
- if (undef) sym = new Symbol(Node.nt, t.val, t.line);
- else {
- if (sym.typ == Node.nt) {
- if (sym.graph != null) SemErr("name declared twice");
- } else SemErr("this symbol kind not allowed on left side of production");
- sym.line = t.line;
- }
- bool noAttrs = sym.attrPos == null;
- sym.attrPos = null;
- .)
- [ AttrDecl<sym> ] (. if (!undef)
- if (noAttrs != (sym.attrPos == null))
- SemErr("attribute mismatch between declaration and use of this symbol");
- .)
- [ SemText<out sym.semPos> ] WEAK
- '='
- Expression<out g> (. sym.graph = g.l;
- Graph.Finish(g);
- .)
- WEAK
- '.'
- }
- "END" ident (. if (gramName != t.val)
- SemErr("name does not match grammar name");
- Tab.gramSy = Symbol.Find(gramName);
- if (Tab.gramSy == null)
- SemErr("missing production for grammar name");
- else {
- sym = Tab.gramSy;
- if (sym.attrPos != null)
- SemErr("grammar symbol must not have attributes");
- }
- Tab.noSym = new Symbol(Node.t, "???", 0); // noSym gets highest number
- Tab.SetupAnys();
- Tab.RenumberPragmas();
- if (Tab.ddt[2]) Node.PrintNodes();
- if (Errors.count == 0) {
- Console.WriteLine("checking");
- Tab.CompSymbolSets();
- ok = ok && Tab.GrammarOk();
- if (Tab.ddt[7]) Tab.XRef();
- if (ok) {
- Console.Write("parser");
- ParserGen.WriteParser();
- if (genScanner) {
- Console.Write(" + scanner");
- DFA.WriteScanner();
- if (Tab.ddt[0]) DFA.PrintStates();
- }
- Console.WriteLine(" generated");
- if (Tab.ddt[8]) ParserGen.WriteStatistics();
- }
- }
- if (Tab.ddt[6]) Tab.PrintSymbolTable();
- .)
- '.'
-.
-
-/*------------------------------------------------------------------------------------*/
-
-Declaration (. Graph g1, g2; bool nested = false; .)
-=
- "CHARACTERS" { SetDecl }
-| "TOKENS" { TokenDecl<Node.t> }
-| "PRAGMAS" { TokenDecl<Node.pr> }
-| "COMMENTS"
- "FROM" TokenExpr<out g1>
- "TO" TokenExpr<out g2>
- ( "NESTED" (. nested = true; .)
- | (. nested = false; .)
- ) (. new Comment(g1.l, g2.l, nested); .)
-| "IGNORE" Set<out Tab.ignored> (. Tab.ignored[' '] = true; /* ' ' is always ignored */
- if (Tab.ignored[0]) SemErr("may not ignore \'\\0\'"); .)
-| "TOKENNAMES" (. Symbol.tokenNames = new Hashtable(); .)
- { ( string | ident ) (. string key = t.val; .)
- "=" ident (. string val = t.val; Symbol.tokenNames.Add(key, val); .)
- }
-.
-
-/*------------------------------------------------------------------------------------*/
-
-SetDecl (. BitArray s; .)
-=
- ident (. string name = t.val;
- CharClass c = CharClass.Find(name);
- if (c != null) SemErr("name declared twice");
- .)
- '=' Set<out s> (. if (Sets.Elements(s) == 0) SemErr("character set must not be empty");
- c = new CharClass(name, s);
- .)
- '.'
-.
-
-/*------------------------------------------------------------------------------------*/
-
-Set<out BitArray s> (. BitArray s2; .)
-=
- SimSet<out s>
- { '+' SimSet<out s2> (. s.Or(s2); .)
- | '-' SimSet<out s2> (. Sets.Subtract(s, s2); .)
- }
-.
-
-/*------------------------------------------------------------------------------------*/
-
-SimSet<out BitArray s> (. int n1, n2; .)
-= (. s = new BitArray(CharClass.charSetSize); .)
-( ident (. CharClass c = CharClass.Find(t.val);
- if (c == null) SemErr("undefined name"); else s.Or(c.set);
- .)
-| string (. string name = t.val;
- name = DFA.Unescape(name.Substring(1, name.Length-2));
- foreach (char ch in name) s[ch] = true;
- .)
-| Char<out n1> (. s[n1] = true; .)
- [ ".." Char<out n2> (. for (int i = n1; i <= n2; i++) s[i] = true; .)
- ]
-| "ANY" (. s = new BitArray(CharClass.charSetSize, true);
- s[0] = false;
- .)
-)
-.
-
-/*--------------------------------------------------------------------------------------*/
-
-Char<out int n>
-=
- char (. string name = t.val;
- name = DFA.Unescape(name.Substring(1, name.Length-2));
- int max = CharClass.charSetSize;
- if (name.Length != 1 || name[0] > max-1) SemErr("unacceptable character value");
- n = name[0] % max;
- .)
-.
-
-/*------------------------------------------------------------------------------------*/
-
-TokenDecl<int typ> (. string name; int kind; Symbol sym; Graph g; .)
-=
- Sym<out name, out kind> (. sym = Symbol.Find(name);
- if (sym != null) SemErr("name declared twice");
- else {
- sym = new Symbol(typ, name, t.line);
- sym.tokenKind = Symbol.classToken;
- }
- .)
- SYNC
- ( '=' TokenExpr<out g> '.' (. if (kind != id) SemErr("a literal must not be declared with a structure");
- Graph.Finish(g);
- DFA.ConvertToStates(g.l, sym);
- .)
- | '.' (. if (typ != Node.rslv) SemErr("resolver is only allowed in RESOLVERS section"); .) /* ML-AW */
- | (. if (kind == id) genScanner = false;
- else DFA.MatchLiteral(sym);
- .)
- )
- ( SemText<out sym.semPos> (. if (typ == Node.t) SemErr("semantic action not allowed here"); .)
- | (. if (typ == Node.rslv) SemErr("resolvers must have a semantic action"); .) /* ML-AW */
- )
-.
-
-/*------------------------------------------------------------------------------------*/
-
-AttrDecl<Symbol sym>
-=
- '<' (. int beg = la.pos; int col = la.col; .)
- { ANY
- | badString (. SemErr("bad string in semantic action"); .)
- }
- '>' (. sym.attrPos = new Position(beg, t.pos - beg, col); .)
-.
-
-/*------------------------------------------------------------------------------------*/
-
-Expression<out Graph g> (. Graph g2; .)
-=
- Term<out g> (. bool first = true; .)
- { WEAK
- '|'
- Term<out g2> (. if (first) { Graph.MakeFirstAlt(g); first = false; }
- Graph.MakeAlternative(g, g2);
- .)
- }
-.
-
-/*------------------------------------------------------------------------------------*/
-
-Term<out Graph g> (. Graph g2; Position pos; Node rslv = null;
- g = null;
- .)
-= [ (. rslv = new Node(Node.rslv, null, la.line); .)
- ResolveExpr<out pos> (. rslv.pos = pos;
- g = new Graph(rslv);
- .)
- ]
- Factor<out g2> (. if (rslv != null) Graph.MakeSequence(g, g2);
- else g = g2;
- .)
- { Factor<out g2> (. Graph.MakeSequence(g, g2); .)
- }
-| (. g = new Graph(new Node(Node.eps, null, 0)); .)
-.
-
-/*------------------------------------------------------------------------------------*/
-
-Factor<out Graph g> (. string name; int kind; Position pos; bool weak = false;
- g = null;
- .)
-= [ "WEAK" (. weak = true; .)
- ]
- Sym<out name, out kind> (. Symbol sym = Symbol.Find(name);
- bool undef = sym == null;
- if (undef) {
- if (kind == id)
- sym = new Symbol(Node.nt, name, 0); // forward nt
- else if (genScanner) {
- sym = new Symbol(Node.t, name, t.line);
- DFA.MatchLiteral(sym);
- } else { // undefined string in production
- SemErr("undefined string in production");
- sym = Tab.eofSy; // dummy
- }
- }
- int typ = sym.typ;
- if (typ != Node.t && typ != Node.nt && typ != Node.rslv) /* ML */
- SemErr("this symbol kind is not allowed in a production");
- if (weak)
- if (typ == Node.t) typ = Node.wt;
- else SemErr("only terminals may be weak");
- Node p = new Node(typ, sym, t.line);
- g = new Graph(p);
- .)
- [ Attribs<p> (. if (kind != id) SemErr("a literal must not have attributes"); .)
- ] (. if (undef)
- sym.attrPos = p.pos; // dummy
- else if ((p.pos == null) != (sym.attrPos == null))
- SemErr("attribute mismatch between declaration and use of this symbol");
- .)
-| '(' Expression<out g> ')'
-| '[' Expression<out g> ']' (. Graph.MakeOption(g); .)
-| '{' Expression<out g> '}' (. Graph.MakeIteration(g); .)
-| SemText<out pos> (. Node p = new Node(Node.sem, null, 0);
- p.pos = pos;
- g = new Graph(p);
- .)
-| "ANY" (. Node p = new Node(Node.any, null, 0); // p.set is set in Tab.SetupAnys
- g = new Graph(p);
- .)
-| "SYNC" (. Node p = new Node(Node.sync, null, 0);
- g = new Graph(p);
- .)
-.
-
-/*------------------------------------------------------------------------------------*/
-
-ResolveExpr<out Position pos>
-=
- "IF" "(" (. int beg = la.pos; int col = la.col; .)
- ( ("=" | "!=") CondPart /* indicate the beginning of a syntax snippet.
- The condition is true if the actual input matches
- the given syntax snippet (or does not match for "!=")
- */
- | "(" CondPart ")"
- | ANY CondPart
- ) (. pos = new Position(beg, t.pos - beg, col); .)
-.
-
-/* ConPart exists to guarantee an equal number of opening and *
- * closing parentheses inside the conditional expression. */
-CondPart = { "(" CondPart | ANY } ")" .
-
-/*------------------------------------------------------------------------------------*/
-
-TokenExpr<out Graph g> (. Graph g2; .)
-=
- TokenTerm<out g> (. bool first = true; .)
- { WEAK
- '|'
- TokenTerm<out g2> (. if (first) { Graph.MakeFirstAlt(g); first = false; }
- Graph.MakeAlternative(g, g2);
- .)
- }
-.
-
-/*------------------------------------------------------------------------------------*/
-
-TokenTerm<out Graph g> (. Graph g2; .)
-=
- TokenFactor<out g>
- { TokenFactor<out g2> (. Graph.MakeSequence(g, g2); .)
- }
- [ "CONTEXT"
- '(' TokenExpr<out g2> (. Graph.SetContextTrans(g2.l); Graph.MakeSequence(g, g2); .)
- ')'
- ]
-.
-
-/*------------------------------------------------------------------------------------*/
-
-TokenFactor<out Graph g> (. string name; int kind; .)
-=
- (. g = new Graph(); .)
-( Sym<out name, out kind> (. if (kind == id) {
- CharClass c = CharClass.Find(name);
- if (c == null) {
- SemErr("undefined name");
- c = new CharClass(name, new BitArray(CharClass.charSetSize));
- }
- Node p = new Node(Node.clas, null, 0); p.val = c.n;
- g = new Graph(p);
- } else g = Graph.StrToGraph(name); // str
- .)
-| '(' TokenExpr<out g> ')'
-| '[' TokenExpr<out g> ']' (. Graph.MakeOption(g); .)
-| '{' TokenExpr<out g> '}' (. Graph.MakeIteration(g); .)
-)
-.
-
-/*------------------------------------------------------------------------------------*/
-
-Sym<out string name, out int kind>
-= (. name = "???"; kind = id; .)
-( ident (. kind = id; name = t.val; .)
-| (string (. name = t.val; .)
- | char (. name = "\"" + t.val.Substring(1, t.val.Length-2) + "\""; .)
- ) (. kind = str; .)
-)
-.
-
-/*------------------------------------------------------------------------------------*/
-
-Attribs<Node p>
-=
- '<' (. int beg = la.pos; int col = la.col; .)
- { ANY
- | badString (. SemErr("bad string in attributes"); .)
- }
- '>' (. p.pos = new Position(beg, t.pos - beg, col); .)
-.
-
-/*------------------------------------------------------------------------------------*/
-
-SemText<out Position pos>
-=
- "(." (. int beg = la.pos; int col = la.col; .)
- { ANY
- | badString (. SemErr("bad string in semantic action"); .)
- | "(." (. SemErr("missing end of previous semantic action"); .)
- }
- ".)" (. pos = new Position(beg, t.pos - beg, col); .)
-.
-
-/*------------------------------------------------------------------------------------*/
-
-UsingDecl<out Position pos>
-=
- "using" (. int beg = t.pos; .)
- { ANY } ';' (. int end = t.pos; .)
- { "using" { ANY } ';' (. end = t.pos; .)
- } (. pos = new Position(beg, end - beg + 1, 0); .)
-.
-
-END Coco.
diff --git a/main/src/tools/SharpCoco/src/Coco.cs b/main/src/tools/SharpCoco/src/Coco.cs
deleted file mode 100644
index dc0162f4b0..0000000000
--- a/main/src/tools/SharpCoco/src/Coco.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-------------------------------------------------------------------------
- Trace output options
- 0 | A: prints the states of the scanner automaton
- 1 | F: prints the First and Follow sets of all nonterminals
- 2 | G: prints the syntax graph of the productions
- 3 | I: traces the computation of the First sets
- 4 | J: prints the sets associated with ANYs and synchronisation sets
- 6 | S: prints the symbol table (terminals, nonterminals, pragmas)
- 7 | X: prints a cross reference list of all syntax symbols
- 8 | P: prints statistics about the Coco run
-
- Trace output can be switched on by the pragma
- $ { digit | letter }
- in the attributed grammar or as a command-line option
- -------------------------------------------------------------------------*/
-
-using System;
-using System.IO;
-
-namespace at.jku.ssw.Coco {
-
-public class Coco {
-
- public static void Main (string[] arg) {
- Console.WriteLine("Coco/R (Aug 4, 2003)");
- string ATGName = null;
- for (int i = 0; i < arg.Length; i++) {
- if (arg[i] == "-nonamespace") Tab.nsName = null;
- else if (arg[i] == "-namespace") Tab.nsName = arg[++i];
- else if (arg[i] == "-trace") Tab.SetDDT(arg[++i]);
- else ATGName = arg[i];
- }
- if (arg.Length > 0 && ATGName != null) {
- int pos = ATGName.LastIndexOf('/');
- if (pos < 0) pos = ATGName.LastIndexOf('\\');
- string file = ATGName;
- string dir = ATGName.Substring(0, pos+1);
-
- Scanner.Init(file);
- Trace.Init(dir);
- Tab.Init();
- DFA.Init(dir);
- ParserGen.Init(file, dir);
-
- Parser.Parse();
-
- Trace.Close();
- Console.WriteLine();
- Console.WriteLine("{0} errors detected", Errors.count);
- } else {
- Console.WriteLine("Usage: Coco {{Option}} Grammar.ATG {{Option}}{0}" +
- "Options:{0}" +
- " -nonamespace{0}" +
- " -namespace <packageName>{0}" +
- " -trace <traceString>{0}" +
- "Valid characters in the trace string:{0}" +
- " A trace automaton{0}" +
- " F list first/follow sets{0}" +
- " G print syntax graph{0}" +
- " I trace computation of first sets{0}" +
- " P print statistics{0}" +
- " S list symbol table{0}" +
- " X list cross reference table{0}" +
- "Scanner.frame and Parser.frame files needed in ATG directory{0}" +
- "or in a directory referenced by the environment variable CRFRAMES.",
- Environment.NewLine);
- }
- }
-} // end Coco
-
-} // end namespace
diff --git a/main/src/tools/SharpCoco/src/DFA.cs b/main/src/tools/SharpCoco/src/DFA.cs
deleted file mode 100644
index 12cc0386f8..0000000000
--- a/main/src/tools/SharpCoco/src/DFA.cs
+++ /dev/null
@@ -1,889 +0,0 @@
-// DFA.cs Scaner automaton gnerated by Coco/R H.Moessenboeck, Univ. of Linz
-//----------------------------------------------------------------------------
-using System;
-using System.IO;
-using System.Collections;
-using System.Text;
-
-namespace at.jku.ssw.Coco {
-
-//-----------------------------------------------------------------------------
-// State
-//-----------------------------------------------------------------------------
-
-public class State { // state of finite automaton
- public static int lastNr; // highest state number
- public int nr; // state number
- public Action firstAction;// to first action of this state
- public Symbol endOf; // recognized token if state is final
- public bool ctx; // true if state is reached via contextTrans
- public State next;
-
- public State() {
- nr = ++lastNr;
- }
-
- public void AddAction(Action act) {
- Action lasta = null, a = firstAction;
- while (a != null && act.typ >= a.typ) {lasta = a; a = a.next;}
- // collecting classes at the beginning gives better performance
- act.next = a;
- if (a==firstAction) firstAction = act; else lasta.next = act;
- }
-
- public void DetachAction(Action act) {
- Action lasta = null, a = firstAction;
- while (a != null && a != act) {lasta = a; a = a.next;}
- if (a != null)
- if (a == firstAction) firstAction = a.next; else lasta.next = a.next;
- }
-
- public Action TheAction(char ch) {
- BitArray s;
- for (Action a = firstAction; a != null; a = a.next)
- if (a.typ == Node.chr && ch == a.sym) return a;
- else if (a.typ == Node.clas) {
- s = CharClass.Set(a.sym);
- if (s[ch]) return a;
- }
- return null;
- }
-
- public void MeltWith(State s) { // copy actions of s to state
- Action a;
- for (Action action = s.firstAction; action != null; action = action.next) {
- a = new Action(action.typ, action.sym, action.tc);
- a.AddTargets(action);
- AddAction(a);
- }
- }
-
-}
-
-//-----------------------------------------------------------------------------
-// Action
-//-----------------------------------------------------------------------------
-
-public class Action { // action of finite automaton
- public int typ; // type of action symbol: clas, chr
- public int sym; // action symbol
- public int tc; // transition code: normalTrans, contextTrans
- public Target target; // states reached from this action
- public Action next;
-
- public Action(int typ, int sym, int tc) {
- this.typ = typ; this.sym = sym; this.tc = tc;
- }
-
- public void AddTarget(Target t) { // add t to the action.targets
- Target last = null;
- Target p = target;
- while (p != null && t.state.nr >= p.state.nr) {
- if (t.state == p.state) return;
- last = p; p = p.next;
- }
- t.next = p;
- if (p == target) target = t; else last.next = t;
- }
-
- public void AddTargets(Action a) { // add copy of a.targets to action.targets
- for (Target p = a.target; p != null; p = p.next) {
- Target t = new Target(p.state);
- AddTarget(t);
- }
- if (a.tc == Node.contextTrans) tc = Node.contextTrans;
- }
-
- public BitArray Symbols() {
- BitArray s;
- if (typ == Node.clas)
- s = (BitArray) CharClass.Set(sym).Clone();
- else {
- s = new BitArray(CharClass.charSetSize); s[sym] = true;
- }
- return s;
- }
-
- public void ShiftWith(BitArray s) {
- if (Sets.Elements(s) == 1) {
- typ = Node.chr; sym = Sets.First(s);
- } else {
- CharClass c = CharClass.Find(s);
- if (c == null) c = new CharClass("#", s); // class with dummy name
- typ = Node.clas; sym = c.n;
- }
- }
-
- public void GetTargetStates(out BitArray targets, out Symbol endOf, out bool ctx) {
- // compute the set of target states
- targets = new BitArray(DFA.maxStates); endOf = null;
- ctx = false;
- for (Target t = target; t != null; t = t.next) {
- int stateNr = t.state.nr;
- if (stateNr <= DFA.lastSimState) targets[stateNr] = true;
- else targets.Or(Melted.Set(stateNr));
- if (t.state.endOf != null)
- if (endOf == null || endOf == t.state.endOf)
- endOf = t.state.endOf;
- else {
- Console.WriteLine("Tokens {0} and {1} cannot be distinguished", endOf.name, t.state.endOf.name);
- Errors.count++;
- }
- if (t.state.ctx) {
- ctx = true;
- // The following check seems to be unnecessary. It reported an error
- // if a symbol + context was the prefix of another symbol, e.g.
- // s1 = "a" "b" "c".
- // s2 = "a" CONTEXT("b").
- // But this is ok.
- // if (t.state.endOf != null) {
- // Console.WriteLine("Ambiguous context clause");
- // Errors.count++;
- // }
- }
- }
- }
-
-}
-
-//-----------------------------------------------------------------------------
-// Target
-//-----------------------------------------------------------------------------
-
-public class Target { // set of states that are reached by an action
- public State state; // target state
- public Target next;
-
- public Target (State s) {
- state = s;
- }
-}
-
-//-----------------------------------------------------------------------------
-// Melted
-//-----------------------------------------------------------------------------
-
-public class Melted { // info about melted states
- public static Melted first; // head of melted state list
- public BitArray set; // set of old states
- public State state; // new state
- public Melted next;
-
- public Melted(BitArray set, State state) {
- this.set = set; this.state = state;
- this.next = first; first = this;
- }
-
- public static BitArray Set(int nr) {
- Melted m = first;
- while (m != null) {
- if (m.state.nr == nr) return m.set; else m = m.next;
- }
- throw new Exception("-- compiler error in Melted.Set");
- }
-
- public static Melted StateWithSet(BitArray s) {
- for (Melted m = first; m != null; m = m.next)
- if (Sets.Equals(s, m.set)) return m;
- return null;
- }
-
-}
-
-//-----------------------------------------------------------------------------
-// Comment
-//-----------------------------------------------------------------------------
-
-public class Comment { // info about comment syntax
- public static Comment first; // list of comments
- public string start;
- public string stop;
- public bool nested;
- public Comment next;
-
- static string Str(Node p) {
- StringBuilder s = new StringBuilder();
- while (p != null) {
- if (p.typ == Node.chr) {
- s.Append((char)p.val);
- } else if (p.typ == Node.clas) {
- BitArray set = CharClass.Set(p.val);
- if (Sets.Elements(set) != 1) Parser.SemErr("character set contains more than 1 character");
- s.Append((char)Sets.First(set));
- } else Parser.SemErr("comment delimiters may not be structured");
- p = p.next;
- }
- if (s.Length == 0 || s.Length > 2) {
- Parser.SemErr("comment delimiters must be 1 or 2 characters long");
- s = new StringBuilder("?");
- }
- return s.ToString();
- }
-
- public Comment(Node from, Node to, bool nested) {
- start = Str(from);
- stop = Str(to);
- this.nested = nested;
- this.next = first; first = this;
- }
-
-}
-
-//-----------------------------------------------------------------------------
-// DFA
-//-----------------------------------------------------------------------------
-
-public class DFA {
- public static int maxStates;
- public const int EOF = -1;
- public const char CR = '\r';
- public const char LF = '\n';
-
- public static State firstState;
- public static State lastState; // last allocated state
- public static int lastSimState; // last non melted state
- public static FileStream fram; // scanner frame input
- public static StreamWriter gen; // generated scanner file
- static string srcDir; // directory of attributed grammar file
- public static Symbol curSy; // current token to be recognized (in FindTrans)
- public static Node curGraph; // start of graph for current token (in FindTrans)
- public static bool dirtyDFA; // DFA may become nondeterministic in MatchedDFA
- public static bool hasCtxMoves; // DFA has context transitions
-
- //---------- Output primitives
- private static string Ch(char ch) {
- if (ch < ' ' || ch >= 127 || ch == '\'' || ch == '\\') return Convert.ToString((int)ch);
- else return String.Format("'{0}'", ch);
- }
-
- private static string ChCond(char ch) {
- return String.Format("ch == {0}", Ch(ch));
- }
-
- private static void PutRange(BitArray s) {
- int[] lo = new int[32];
- int[] hi = new int[32];
- // fill lo and hi
- int max = CharClass.charSetSize;
- int top = -1;
- int i = 0;
- while (i < max) {
- if (s[i]) {
- top++; lo[top] = i; i++;
- while (i < max && s[i]) i++;
- hi[top] = i-1;
- } else i++;
- }
- // print ranges
- if (top == 1 && lo[0] == 0 && hi[1] == max-1 && hi[0]+2 == lo[1]) {
- BitArray s1 = new BitArray(max); s1[hi[0]+1] = true;
- gen.Write("!"); PutRange(s1);
- } else {
- gen.Write("(");
- for (i = 0; i <= top; i++) {
- if (hi[i] == lo[i]) gen.Write("ch == {0}", Ch((char)lo[i]));
- else if (lo[i] == 0) gen.Write("ch <= {0}", Ch((char)hi[i]));
- else if (hi[i] == max-1) gen.Write("ch >= {0}", Ch((char)lo[i]));
- else gen.Write("ch >= {0} && ch <= {1}", Ch((char)lo[i]), Ch((char)hi[i]));
- if (i < top) gen.Write(" || ");
- }
- gen.Write(")");
- }
- }
-
- //---------- String handling
- static char Hex2Char(string s) {
- int val = 0;
- for (int i = 0; i < s.Length; i++) {
- char ch = s[i];
- if ('0' <= ch && ch <= '9') val = 16 * val + (ch - '0');
- else if ('a' <= ch && ch <= 'f') val = 16 * val + (10 + ch - 'a');
- else if ('A' <= ch && ch <= 'Z') val = 16 * val + (10 + ch - 'A');
- else Parser.SemErr("bad escape sequence in string or character");
- }
- return (char)val;
- }
-
- static string Char2Hex(char ch) {
- StringWriter w = new StringWriter();
- w.Write("\\u{0:x4}", (int)ch);
- return w.ToString();
- }
-
- public static string Unescape (string s) {
- /* replaces escape sequences in s by their Unicode values. */
- StringBuilder buf = new StringBuilder();
- int i = 0;
- while (i < s.Length) {
- if (s[i] == '\\') {
- switch (s[i+1]) {
- case '\\': buf.Append('\\'); i += 2; break;
- case '\'': buf.Append('\''); i += 2; break;
- case '\"': buf.Append('\"'); i += 2; break;
- case 'r': buf.Append('\r'); i += 2; break;
- case 'n': buf.Append('\n'); i += 2; break;
- case 't': buf.Append('\t'); i += 2; break;
- case '0': buf.Append('\0'); i += 2; break;
- case 'a': buf.Append('\a'); i += 2; break;
- case 'b': buf.Append('\b'); i += 2; break;
- case 'f': buf.Append('\f'); i += 2; break;
- case 'v': buf.Append('\v'); i += 2; break;
- case 'u': case 'x':
- if (i + 6 <= s.Length) {
- buf.Append(Hex2Char(s.Substring(i+2, 4))); i += 6; break;
- } else {
- Parser.SemErr("bad escape sequence in string or character"); i = s.Length; break;
- }
- default: Parser.SemErr("bad escape sequence in string or character"); i += 2; break;
- }
- } else {
- buf.Append(s[i]);
- i++;
- }
- }
- return buf.ToString();
- }
-
- public static string Escape (string s) {
- StringBuilder buf = new StringBuilder();
- foreach (char ch in s) {
- if (ch == '\\') buf.Append("\\\\");
- else if (ch == '"') buf.Append("\\\"");
- else if (ch < ' ' || ch > '\u007f') buf.Append(Char2Hex(ch));
- else buf.Append(ch);
- }
- return buf.ToString();
- }
-
- //---------- State handling
- static State NewState() {
- State s = new State();
- if (firstState == null) firstState = s; else lastState.next = s;
- lastState = s;
- return s;
- }
-
- static void NewTransition(State from, State to, int typ, int sym, int tc) {
- if (to == firstState) Parser.SemErr("token must not start with an iteration");
- Target t = new Target(to);
- Action a = new Action(typ, sym, tc); a.target = t;
- from.AddAction(a);
- }
-
- static void CombineShifts() {
- State state;
- Action a, b, c;
- BitArray seta, setb;
- for (state = firstState; state != null; state = state.next) {
- for (a = state.firstAction; a != null; a = a.next) {
- b = a.next;
- while (b != null)
- if (a.target.state == b.target.state && a.tc == b.tc) {
- seta = a.Symbols(); setb = b.Symbols();
- seta.Or(setb);
- a.ShiftWith(seta);
- c = b; b = b.next; state.DetachAction(c);
- } else b = b.next;
- }
- }
- }
-
- static void FindUsedStates(State state, BitArray used) {
- if (used[state.nr]) return;
- used[state.nr] = true;
- for (Action a = state.firstAction; a != null; a = a.next)
- FindUsedStates(a.target.state, used);
- }
-
- static void DeleteRedundantStates() {
- State[] newState = new State[State.lastNr + 1];
- BitArray used = new BitArray(State.lastNr + 1);
- FindUsedStates(firstState, used);
- // combine equal final states
- for (State s1 = firstState.next; s1 != null; s1 = s1.next) // firstState cannot be final
- if (used[s1.nr] && s1.endOf != null && s1.firstAction == null && !s1.ctx)
- for (State s2 = s1.next; s2 != null; s2 = s2.next)
- if (used[s2.nr] && s1.endOf == s2.endOf && s2.firstAction == null & !s2.ctx) {
- used[s2.nr] = false; newState[s2.nr] = s1;
- }
- for (State state = firstState; state != null; state = state.next)
- if (used[state.nr])
- for (Action a = state.firstAction; a != null; a = a.next)
- if (!used[a.target.state.nr])
- a.target.state = newState[a.target.state.nr];
- // delete unused states
- lastState = firstState; State.lastNr = 0; // firstState has number 0
- for (State state = firstState.next; state != null; state = state.next)
- if (used[state.nr]) {state.nr = ++State.lastNr; lastState = state;}
- else lastState.next = state.next;
- }
-
- static State TheState(Node p) {
- State state;
- if (p == null) {state = NewState(); state.endOf = curSy; return state;}
- else return p.state;
- }
-
- static void Step(State from, Node p, BitArray stepped) {
- if (p == null) return;
- stepped[p.n] = true;
- switch (p.typ) {
- case Node.clas: case Node.chr: {
- NewTransition(from, TheState(p.next), p.typ, p.val, p.code);
- break;
- }
- case Node.alt: {
- Step(from, p.sub, stepped); Step(from, p.down, stepped);
- break;
- }
- case Node.iter: case Node.opt: {
- if (p.next != null && !stepped[p.next.n]) Step(from, p.next, stepped);
- Step(from, p.sub, stepped);
- break;
- }
- }
- }
-
- static void NumberNodes(Node p, State state) {
- /* Assigns a state n.state to every node n. There will be a transition from
- n.state to n.next.state triggered by n.val. All nodes in an alternative
- chain are represented by the same state.
- */
- if (p == null) return;
- if (p.state != null) return; // already visited;
- if (state == null) state = NewState();
- p.state = state;
- if (Node.DelGraph(p)) state.endOf = curSy;
- switch (p.typ) {
- case Node.clas: case Node.chr: {
- NumberNodes(p.next, null);
- break;
- }
- case Node.opt: {
- NumberNodes(p.next, null); NumberNodes(p.sub, state);
- break;
- }
- case Node.iter: {
- NumberNodes(p.next, state); NumberNodes(p.sub, state);
- break;
- }
- case Node.alt: {
- NumberNodes(p.sub, state); NumberNodes(p.down, state);
- break;
- }
- }
- }
-
- static void FindTrans (Node p, bool start, BitArray marked) {
- if (p == null || marked[p.n]) return;
- marked[p.n] = true;
- if (start) Step(p.state, p, new BitArray(Node.nodes.Count)); // start of group of equally numbered nodes
- switch (p.typ) {
- case Node.clas: case Node.chr: {
- FindTrans(p.next, true, marked);
- break;
- }
- case Node.opt: {
- FindTrans(p.next, true, marked); FindTrans(p.sub, false, marked);
- break;
- }
- case Node.iter: {
- FindTrans(p.next, false, marked); FindTrans(p.sub, false, marked);
- break;
- }
- case Node.alt: {
- FindTrans(p.sub, false, marked); FindTrans(p.down, false, marked);
- break;
- }
- }
- }
-
- public static void ConvertToStates(Node p, Symbol sym) {
- curGraph = p; curSy = sym;
- if (Node.DelGraph(curGraph)) Parser.SemErr("token might be empty");
- NumberNodes(curGraph, firstState);
- FindTrans(curGraph, true, new BitArray(Node.nodes.Count));
- }
-
- static Symbol MatchedDFA(string s, Symbol sym) {
- int i, len = s.Length;
- bool weakMatch = false;
- // s has no quotes
- State state = firstState;
- for (i = 0; i < len; i++) { // try to match s against existing DFA
- Action a = state.TheAction(s[i]);
- if (a == null) break;
- if (a.typ == Node.clas) weakMatch = true;
- state = a.target.state;
- }
- // don't execute the following block if s was totally consumed and the DFA is in a final state
- if (weakMatch && (i != len || state.endOf == null)) {
- state = firstState; i = 0;
- dirtyDFA = true;
- }
- for (; i < len; i++) { // make new DFA for s[i..len-1]
- State to = NewState();
- NewTransition(state, to, Node.chr, s[i], Node.normalTrans);
- state = to;
- }
- Symbol matchedSym = state.endOf;
- if (state.endOf == null) state.endOf = sym;
- return matchedSym;
- }
-
- public static void MatchLiteral(Symbol sym) { // store string either as token or as literal
- string name = Unescape(sym.name.Substring(1, sym.name.Length-2));
- if (name.IndexOf('\0') >= 0) Parser.SemErr("\\0 not allowed here. Used as eof character");
- Symbol matchedSym = MatchedDFA(name, sym);
- if (matchedSym == null)
- sym.tokenKind = Symbol.classToken;
- else {
- matchedSym.tokenKind = Symbol.classLitToken;
- sym.tokenKind = Symbol.litToken;
- }
- }
-
- static void SplitActions(State state, Action a, Action b) {
- Action c; BitArray seta, setb, setc;
- seta = a.Symbols(); setb = b.Symbols();
- if (Sets.Equals(seta, setb)) {
- a.AddTargets(b);
- state.DetachAction(b);
- } else if (Sets.Includes(seta, setb)) {
- setc = (BitArray)seta.Clone(); Sets.Subtract(setc, setb);
- b.AddTargets(a);
- a.ShiftWith(setc);
- } else if (Sets.Includes(setb, seta)) {
- setc = (BitArray)setb.Clone(); Sets.Subtract(setc, seta);
- a.AddTargets(b);
- b.ShiftWith(setc);
- } else {
- setc = (BitArray)seta.Clone(); setc.And(setb);
- Sets.Subtract(seta, setc);
- Sets.Subtract(setb, setc);
- a.ShiftWith(seta);
- b.ShiftWith(setb);
- c = new Action(0, 0, Node.normalTrans); // typ and sym are set in ShiftWith
- c.AddTargets(a);
- c.AddTargets(b);
- c.ShiftWith(setc);
- state.AddAction(c);
- }
- }
-
- private static bool Overlap(Action a, Action b) {
- BitArray seta, setb;
- if (a.typ == Node.chr)
- if (b.typ == Node.chr) return a.sym == b.sym;
- else {setb = CharClass.Set(b.sym); return setb[a.sym];}
- else {
- seta = CharClass.Set(a.sym);
- if (b.typ ==Node.chr) return seta[b.sym];
- else {setb = CharClass.Set(b.sym); return Sets.Intersect(seta, setb);}
- }
- }
-
- static bool MakeUnique(State state) { // return true if actions were split
- bool changed = false;
- for (Action a = state.firstAction; a != null; a = a.next)
- for (Action b = a.next; b != null; b = b.next)
- if (Overlap(a, b)) {SplitActions(state, a, b); changed = true;}
- return changed;
- }
-
- static void MeltStates(State state) {
- bool changed, ctx;
- BitArray targets;
- Symbol endOf;
- for (Action action = state.firstAction; action != null; action = action.next) {
- if (action.target.next != null) {
- action.GetTargetStates(out targets, out endOf, out ctx);
- Melted melt = Melted.StateWithSet(targets);
- if (melt == null) {
- State s = NewState(); s.endOf = endOf; s.ctx = ctx;
- for (Target targ = action.target; targ != null; targ = targ.next)
- s.MeltWith(targ.state);
- do {changed = MakeUnique(s);} while (changed);
- melt = new Melted(targets, s);
- }
- action.target.next = null;
- action.target.state = melt.state;
- }
- }
- }
-
- static void FindCtxStates() {
- for (State state = firstState; state != null; state = state.next)
- for (Action a = state.firstAction; a != null; a = a.next)
- if (a.tc == Node.contextTrans) a.target.state.ctx = true;
- }
-
- public static void MakeDeterministic() {
- State state;
- bool changed;
- lastSimState = lastState.nr;
- maxStates = 2 * lastSimState; // heuristic for set size in Melted.set
- FindCtxStates();
- for (state = firstState; state != null; state = state.next)
- do {changed = MakeUnique(state);} while (changed);
- for (state = firstState; state != null; state = state.next)
- MeltStates(state);
- DeleteRedundantStates();
- CombineShifts();
- }
-
- public static void PrintStates() {
- Trace.WriteLine("\n---------- states ----------");
- for (State state = firstState; state != null; state = state.next) {
- bool first = true;
- if (state.endOf == null) Trace.Write(" ");
- else Trace.Write("E({0,12})", Node.Name(state.endOf.name));
- Trace.Write("{0,3}:", state.nr);
- if (state.firstAction == null) Trace.WriteLine();
- for (Action action = state.firstAction; action != null; action = action.next) {
- if (first) {Trace.Write(" "); first = false;} else Trace.Write(" ");
- if (action.typ == Node.clas) Trace.Write(((CharClass)CharClass.classes[action.sym]).name);
- else Trace.Write("{0, 3}", Ch((char)action.sym));
- for (Target targ = action.target; targ != null; targ = targ.next)
- Trace.Write(" {0, 3}", targ.state.nr);
- if (action.tc == Node.contextTrans) Trace.WriteLine(" context"); else Trace.WriteLine();
- }
- }
- Trace.WriteLine("\n---------- character classes ----------");
- CharClass.WriteClasses();
- }
-
- static void GenComBody(Comment com) {
- gen.WriteLine( "\t\t\tfor(;;) {");
- gen.Write ( "\t\t\t\tif ({0}) ", ChCond(com.stop[0])); gen.WriteLine("{");
- if (com.stop.Length == 1) {
- gen.WriteLine("\t\t\t\t\tlevel--;");
- gen.WriteLine("\t\t\t\t\tif (level == 0) { oldEols = line - line0; NextCh(); return true; }");
- gen.WriteLine("\t\t\t\t\tNextCh();");
- } else {
- gen.WriteLine("\t\t\t\t\tNextCh();");
- gen.WriteLine("\t\t\t\t\tif ({0}) {{", ChCond(com.stop[1]));
- gen.WriteLine("\t\t\t\t\t\tlevel--;");
- gen.WriteLine("\t\t\t\t\t\tif (level == 0) { oldEols = line - line0; NextCh(); return true; }");
- gen.WriteLine("\t\t\t\t\t\tNextCh();");
- gen.WriteLine("\t\t\t\t\t}");
- }
- if (com.nested) {
- gen.Write ("\t\t\t\t}"); gen.Write(" else if ({0}) ", ChCond(com.start[0])); gen.WriteLine("{");
- if (com.start.Length == 1)
- gen.WriteLine("\t\t\t\t\tlevel++; NextCh();");
- else {
- gen.WriteLine("\t\t\t\t\tNextCh();");
- gen.Write ("\t\t\t\t\tif ({0}) ", ChCond(com.start[1])); gen.WriteLine("{");
- gen.WriteLine("\t\t\t\t\t\tlevel++; NextCh();");
- gen.WriteLine("\t\t\t\t\t}");
- }
- }
- gen.WriteLine( "\t\t\t\t} else if (ch == EOF) return false;");
- gen.WriteLine( "\t\t\t\telse NextCh();");
- gen.WriteLine( "\t\t\t}");
- }
-
- static void GenComment(Comment com, int i) {
- gen.Write ("\n\tstatic bool Comment{0}() ", i); gen.WriteLine("{");
- gen.WriteLine("\t\tint level = 1, line0 = line, lineStart0 = lineStart;");
- if (com.start.Length == 1) {
- gen.WriteLine("\t\tNextCh();");
- GenComBody(com);
- } else {
- gen.WriteLine("\t\tNextCh();");
- gen.Write ("\t\tif ({0}) ", ChCond(com.start[1])); gen.WriteLine("{");
- gen.WriteLine("\t\t\tNextCh();");
- GenComBody(com);
- gen.WriteLine("\t\t} else {");
- gen.WriteLine("\t\t\tif (ch==EOL) {line--; lineStart = lineStart0;}");
- gen.WriteLine("\t\t\tpos = pos - 2; Buffer.Pos = pos+1; NextCh();");
- gen.WriteLine("\t\t}");
- gen.WriteLine("\t\treturn false;");
- }
- gen.WriteLine("\t}");
- }
-
- static void CopyFramePart(string stop) {
- char startCh = stop[0];
- int endOfStopString = stop.Length-1;
- int ch = fram.ReadByte();
- while (ch != EOF)
- if (ch == startCh) {
- int i = 0;
- do {
- if (i == endOfStopString) return; // stop[0..i] found
- ch = fram.ReadByte(); i++;
- } while (ch == stop[i]);
- // stop[0..i-1] found; continue with last read character
- gen.Write(stop.Substring(0, i));
- } else {
- gen.Write((char)ch); ch = fram.ReadByte();
- }
- Errors.Exception(" -- incomplete or corrupt scanner frame file");
- }
-
- static void GenLiterals () {
- foreach (Symbol sym in Symbol.terminals) {
- if (sym.tokenKind == Symbol.litToken) {
- // sym.name stores literals with quotes, e.g. "\"Literal\"",
- // therefore do NOT place any quotes around {0} after the case
- // or you'll get: case ""Literal"": t.kind = ..., which causes an error
- gen.WriteLine("\t\t\tcase {0}: t.kind = {1}; break;", sym.name, sym.n);
- }
- }
- gen.WriteLine("\t\t\tdefault: break;");
- }
-
- static void WriteState(State state) {
- Symbol endOf = state.endOf;
- gen.WriteLine("\t\t\tcase {0}:", state.nr);
- bool ctxEnd = state.ctx;
- for (Action action = state.firstAction; action != null; action = action.next) {
- if (action == state.firstAction) gen.Write("\t\t\t\tif (");
- else gen.Write("\t\t\t\telse if (");
- if (action.typ == Node.chr) gen.Write(ChCond((char)action.sym));
- else PutRange(CharClass.Set(action.sym));
- gen.Write(") {");
- if (action.tc == Node.contextTrans) {
- gen.Write("apx++; "); ctxEnd = false;
- } else if (state.ctx)
- gen.Write("apx = 0; ");
- gen.Write("buf.Append(ch); NextCh(); goto case {0};", action.target.state.nr);
- gen.WriteLine("}");
- }
- if (state.firstAction == null)
- gen.Write("\t\t\t\t{");
- else
- gen.Write("\t\t\t\telse {");
- if (ctxEnd) { // final context state: cut appendix
- gen.WriteLine();
- gen.WriteLine("\t\t\t\t\tbuf.Length = buf.Length - apx;");
- gen.WriteLine("\t\t\t\t\tpos = pos - apx - 1; line = t.line;");
- gen.WriteLine("\t\t\t\t\tBuffer.Pos = pos+1; NextCh();");
- gen.Write( "\t\t\t\t\t");
- }
- if (endOf == null) {
- gen.WriteLine("t.kind = noSym; goto done;}");
- } else {
- gen.Write("t.kind = {0}; ", endOf.n);
- if (endOf.tokenKind == Symbol.classLitToken) {
- gen.WriteLine("t.val = buf.ToString(); CheckLiteral(); return t;}");
- } else {
- gen.WriteLine("goto done;}");
- }
- }
- }
-
- static void FillStartTab(int[] startTab) {
- startTab[0] = State.lastNr + 1; // eof
- for (Action action = firstState.firstAction; action != null; action = action.next) {
- int targetState = action.target.state.nr;
- if (action.typ == Node.chr) startTab[action.sym] = targetState;
- else {
- BitArray s = CharClass.Set(action.sym);
- for (int i = 0; i < s.Count; i++)
- if (s[i]) startTab[i] = targetState;
- }
- }
- }
-
- public static void WriteScanner() {
- int i, j;
- int[] startTab = new int[CharClass.charSetSize];
- string dir = System.Environment.CurrentDirectory;
- string fr = Path.Combine (dir, "Scanner.frame");
- if (!File.Exists(fr)) {
- string frameDir = Environment.GetEnvironmentVariable("crframes");
- if (frameDir != null) fr = Path.Combine (frameDir.Trim(), "Scanner.frame");
- if (!File.Exists(fr)) Errors.Exception("-- Cannot find Scanner.frame");
- }
- try {
- fram = new FileStream(fr, FileMode.Open, FileAccess.Read, FileShare.Read);
- } catch (FileNotFoundException) {
- Errors.Exception("-- Cannot open Scanner.frame.");
- }
- try {
- string fn = dir + "\\Scanner.cs";
- if (File.Exists(fn)) File.Copy(fn, fn+".old", true);
- FileStream s = new FileStream(fn, FileMode.Create);
- gen = new StreamWriter(s);
- } catch (IOException) {
- Errors.Exception("-- Cannot generate scanner file.");
- }
- if (dirtyDFA) MakeDeterministic();
- FillStartTab(startTab);
-
- CopyFramePart("-->namespace");
- /* AW add namespace, if it exists */
- if (Tab.nsName != null && Tab.nsName.Length > 0) {
- gen.Write("namespace ");
- gen.Write(Tab.nsName);
- gen.Write(" {");
- }
- CopyFramePart("-->constants");
- gen.WriteLine("\tconst int maxT = {0};", Symbol.terminals.Count - 1);
- CopyFramePart("-->declarations");
- gen.WriteLine("\tconst int noSym = {0};", Tab.noSym.n);
- gen.WriteLine("\tstatic short[] start = {");
- for (i = 0; i < CharClass.charSetSize / 16; i++) {
- gen.Write("\t");
- for (j = 0; j < 16; j++)
- gen.Write("{0,3},", startTab[16*i+j]);
- gen.WriteLine();
- }
- gen.WriteLine("\t 0};");
- CopyFramePart("-->initialization");
- gen.WriteLine("\t\tignore = new BitArray({0});", CharClass.charSetSize);
- gen.Write("\t\t");
- if (Tab.ignored == null) gen.Write("ignore[' '] = true;");
- else {
- j = 0;
- for (i = 0; i < Tab.ignored.Count; i++)
- if (Tab.ignored[i]) {
- gen.Write("ignore[{0}] = true; ", i);
- if (++j % 4 == 0) { gen.WriteLine(); gen.Write("\t\t"); }
- }
- }
- CopyFramePart("-->comment");
- Comment com = Comment.first; i = 0;
- while (com != null) {
- GenComment(com, i);
- com = com.next; i++;
- }
- CopyFramePart("-->literals"); GenLiterals();
- CopyFramePart("-->scan1");
- if (Comment.first!=null) {
- gen.Write("\t\tif (");
- com = Comment.first; i = 0;
- while (com != null) {
- gen.Write(ChCond(com.start[0]));
- gen.Write(" && Comment{0}()", i);
- if (com.next != null) gen.Write(" ||");
- com = com.next; i++;
- }
- gen.Write(") return NextToken();");
- }
- if (hasCtxMoves) gen.WriteLine("\t\tint apx = 0;");
- CopyFramePart("-->scan2");
- for (State state = firstState.next; state != null; state = state.next)
- WriteState(state);
- gen.Write("\t\t\tcase "+(State.lastNr+1)+": {t.kind = 0; goto done;}");
- CopyFramePart("$$$");
- /* AW 12-20-02 close namespace, if it exists */
- if (Tab.nsName != null && Tab.nsName.Length > 0) gen.Write("}");
- gen.Close();
- }
-
- public static void Init (string dir) {
- srcDir = dir;
- firstState = null; lastState = null; State.lastNr = -1;
- firstState = NewState();
- Melted.first = null; Comment.first = null;
- dirtyDFA = false;
- hasCtxMoves = false;
- }
-
-} // end DFA
-
-} // end namespace
diff --git a/main/src/tools/SharpCoco/src/Parser.cs b/main/src/tools/SharpCoco/src/Parser.cs
deleted file mode 100644
index 198e325db3..0000000000
--- a/main/src/tools/SharpCoco/src/Parser.cs
+++ /dev/null
@@ -1,761 +0,0 @@
-using System.Collections;
-using System.Text;
-using System;
-using System.Reflection;
-
-namespace at.jku.ssw.Coco {
-
-
-
-public class Parser {
- const int maxT = 42;
-
- const bool T = true;
- const bool x = false;
- const int minErrDist = 2;
- const string errMsgFormat = "-- line {0} col {1}: {2}"; // 0=line, 1=column, 2=text
-
- static Token t; // last recognized token
- static Token la; // lookahead token
- static int errDist = minErrDist;
-
-const int id = 0;
- const int str = 1;
-
- static bool genScanner;
-
-/*-------------------------------------------------------------------------*/
-
-
-
- static void SynErr (int n) {
- if (errDist >= minErrDist) Errors.SynErr(la.line, la.col, n);
- errDist = 0;
- }
-
- public static void SemErr (string msg) {
- if (errDist >= minErrDist) Errors.Error(t.line, t.col, msg);
- errDist = 0;
- }
-
- static void Get () {
- for (;;) {
- t = la;
- la = Scanner.Scan();
- if (la.kind <= maxT) { ++errDist; break; } /* ML return changed to break */
- if (la.kind == 43) {
- Tab.SetDDT(la.val);
- }
-
- la = t;
- }
- }
-
- static void Expect (int n) {
- if (la.kind==n) Get(); else { SynErr(n); }
- }
-
- static bool StartOf (int s) {
- return set[s, la.kind];
- }
-
- static void ExpectWeak (int n, int follow) {
- if (la.kind == n) Get();
- else {
- SynErr(n);
- while (!StartOf(follow)) Get();
- }
- }
-
- static bool WeakSeparator (int n, int syFol, int repFol) {
- bool[] s = new bool[maxT+1];
- if (la.kind == n) { Get(); return true; }
- else if (StartOf(repFol)) return false;
- else {
- for (int i=0; i <= maxT; i++) {
- s[i] = set[syFol, i] || set[repFol, i] || set[0, i];
- }
- SynErr(n);
- while (!s[la.kind]) Get();
- return StartOf(syFol);
- }
- }
-
- static void Coco() {
- Symbol sym; Graph g; string gramName;
- if (la.kind == 40) {
- UsingDecl(out ParserGen.usingPos);
- }
- Expect(6);
- //int gramLine = t.line;
- genScanner = true;
- bool ok = true;
- Tab.ignored = null;
-
- Expect(1);
- gramName = t.val;
- int beg = la.pos;
-
- while (StartOf(1)) {
- Get();
- }
- Tab.semDeclPos = new Position(beg, la.pos-beg, 0);
- while (StartOf(2)) {
- Declaration();
- }
- while (!(la.kind == 0 || la.kind == 7)) {SynErr(43); Get();}
- Expect(7);
- if (genScanner) DFA.MakeDeterministic();
- Graph.DeleteNodes();
-
- while (la.kind == 1) {
- Get();
- sym = Symbol.Find(t.val);
- bool undef = sym == null;
- if (undef) sym = new Symbol(Node.nt, t.val, t.line);
- else {
- if (sym.typ == Node.nt) {
- if (sym.graph != null) SemErr("name declared twice");
- } else SemErr("this symbol kind not allowed on left side of production");
- sym.line = t.line;
- }
- bool noAttrs = sym.attrPos == null;
- sym.attrPos = null;
-
- if (la.kind == 24) {
- AttrDecl(sym);
- }
- if (!undef)
- if (noAttrs != (sym.attrPos == null))
- SemErr("attribute mismatch between declaration and use of this symbol");
-
- if (la.kind == 38) {
- SemText(out sym.semPos);
- }
- ExpectWeak(8, 3);
- Expression(out g);
- sym.graph = g.l;
- Graph.Finish(g);
-
- ExpectWeak(9, 4);
- }
- Expect(10);
- Expect(1);
- if (gramName != t.val)
- SemErr("name does not match grammar name");
- Tab.gramSy = Symbol.Find(gramName);
- if (Tab.gramSy == null)
- SemErr("missing production for grammar name");
- else {
- sym = Tab.gramSy;
- if (sym.attrPos != null)
- SemErr("grammar symbol must not have attributes");
- }
- Tab.noSym = new Symbol(Node.t, "???", 0); // noSym gets highest number
- Tab.SetupAnys();
- Tab.RenumberPragmas();
- if (Tab.ddt[2]) Node.PrintNodes();
- if (Errors.count == 0) {
- Console.WriteLine("checking");
- Tab.CompSymbolSets();
- ok = ok && Tab.GrammarOk();
- if (Tab.ddt[7]) Tab.XRef();
- if (ok) {
- Console.Write("parser");
- ParserGen.WriteParser();
- if (genScanner) {
- Console.Write(" + scanner");
- DFA.WriteScanner();
- if (Tab.ddt[0]) DFA.PrintStates();
- }
- Console.WriteLine(" generated");
- if (Tab.ddt[8]) ParserGen.WriteStatistics();
- }
- }
- if (Tab.ddt[6]) Tab.PrintSymbolTable();
-
- Expect(9);
- }
-
- static void UsingDecl(out Position pos) {
- Expect(40);
- int beg = t.pos;
- while (StartOf(5)) {
- Get();
- }
- Expect(41);
- int end = t.pos;
- while (la.kind == 40) {
- Get();
- while (StartOf(5)) {
- Get();
- }
- Expect(41);
- end = t.pos;
- }
- pos = new Position(beg, end - beg + 1, 0);
- }
-
- static void Declaration() {
- Graph g1, g2; bool nested = false;
- switch (la.kind) {
- case 11: {
- Get();
- while (la.kind == 1) {
- SetDecl();
- }
- break;
- }
- case 12: {
- Get();
- while (la.kind == 1 || la.kind == 3 || la.kind == 5) {
- TokenDecl(Node.t);
- }
- break;
- }
- case 13: {
- Get();
- while (la.kind == 1 || la.kind == 3 || la.kind == 5) {
- TokenDecl(Node.pr);
- }
- break;
- }
- case 14: {
- Get();
- Expect(15);
- TokenExpr(out g1);
- Expect(16);
- TokenExpr(out g2);
- if (la.kind == 17) {
- Get();
- nested = true;
- } else if (StartOf(6)) {
- nested = false;
- } else SynErr(44);
- new Comment(g1.l, g2.l, nested);
- break;
- }
- case 18: {
- Get();
- Set(out Tab.ignored);
- Tab.ignored[' '] = true; /* ' ' is always ignored */
- if (Tab.ignored[0]) SemErr("may not ignore \'\\0\'");
- break;
- }
- case 19: {
- Get();
- Symbol.tokenNames = new Hashtable();
- while (la.kind == 1 || la.kind == 3) {
- if (la.kind == 3) {
- Get();
- } else {
- Get();
- }
- string key = t.val;
- Expect(8);
- Expect(1);
- string val = t.val; Symbol.tokenNames.Add(key, val);
- }
- break;
- }
- default: SynErr(45); break;
- }
- }
-
- static void AttrDecl(Symbol sym) {
- Expect(24);
- int beg = la.pos; int col = la.col;
- while (StartOf(7)) {
- if (StartOf(8)) {
- Get();
- } else {
- Get();
- SemErr("bad string in semantic action");
- }
- }
- Expect(25);
- sym.attrPos = new Position(beg, t.pos - beg, col);
- }
-
- static void SemText(out Position pos) {
- Expect(38);
- int beg = la.pos; int col = la.col;
- while (StartOf(9)) {
- if (StartOf(10)) {
- Get();
- } else if (la.kind == 4) {
- Get();
- SemErr("bad string in semantic action");
- } else {
- Get();
- SemErr("missing end of previous semantic action");
- }
- }
- Expect(39);
- pos = new Position(beg, t.pos - beg, col);
- }
-
- static void Expression(out Graph g) {
- Graph g2;
- Term(out g);
- bool first = true;
- while (WeakSeparator(26,11,12) ) {
- Term(out g2);
- if (first) { Graph.MakeFirstAlt(g); first = false; }
- Graph.MakeAlternative(g, g2);
-
- }
- }
-
- static void SetDecl() {
- BitArray s;
- Expect(1);
- string name = t.val;
- CharClass c = CharClass.Find(name);
- if (c != null) SemErr("name declared twice");
-
- Expect(8);
- Set(out s);
- if (Sets.Elements(s) == 0) SemErr("character set must not be empty");
- c = new CharClass(name, s);
-
- Expect(9);
- }
-
- static void TokenDecl(int typ) {
- string name; int kind; Symbol sym; Graph g;
- Sym(out name, out kind);
- sym = Symbol.Find(name);
- if (sym != null) SemErr("name declared twice");
- else {
- sym = new Symbol(typ, name, t.line);
- sym.tokenKind = Symbol.classToken;
- }
-
- while (!(StartOf(13))) {SynErr(46); Get();}
- if (la.kind == 8) {
- Get();
- TokenExpr(out g);
- Expect(9);
- if (kind != id) SemErr("a literal must not be declared with a structure");
- Graph.Finish(g);
- DFA.ConvertToStates(g.l, sym);
-
- } else if (la.kind == 9) {
- Get();
- if (typ != Node.rslv) SemErr("resolver is only allowed in RESOLVERS section");
- } else if (StartOf(14)) {
- if (kind == id) genScanner = false;
- else DFA.MatchLiteral(sym);
-
- } else SynErr(47);
- if (la.kind == 38) {
- SemText(out sym.semPos);
- if (typ == Node.t) SemErr("semantic action not allowed here");
- } else if (StartOf(15)) {
- if (typ == Node.rslv) SemErr("resolvers must have a semantic action");
- } else SynErr(48);
- }
-
- static void TokenExpr(out Graph g) {
- Graph g2;
- TokenTerm(out g);
- bool first = true;
- while (WeakSeparator(26,16,17) ) {
- TokenTerm(out g2);
- if (first) { Graph.MakeFirstAlt(g); first = false; }
- Graph.MakeAlternative(g, g2);
-
- }
- }
-
- static void Set(out BitArray s) {
- BitArray s2;
- SimSet(out s);
- while (la.kind == 20 || la.kind == 21) {
- if (la.kind == 20) {
- Get();
- SimSet(out s2);
- s.Or(s2);
- } else {
- Get();
- SimSet(out s2);
- Sets.Subtract(s, s2);
- }
- }
- }
-
- static void SimSet(out BitArray s) {
- int n1, n2;
- s = new BitArray(CharClass.charSetSize);
- if (la.kind == 1) {
- Get();
- CharClass c = CharClass.Find(t.val);
- if (c == null) SemErr("undefined name"); else s.Or(c.set);
-
- } else if (la.kind == 3) {
- Get();
- string name = t.val;
- name = DFA.Unescape(name.Substring(1, name.Length-2));
- foreach (char ch in name) s[ch] = true;
-
- } else if (la.kind == 5) {
- Char(out n1);
- s[n1] = true;
- if (la.kind == 22) {
- Get();
- Char(out n2);
- for (int i = n1; i <= n2; i++) s[i] = true;
- }
- } else if (la.kind == 23) {
- Get();
- s = new BitArray(CharClass.charSetSize, true);
- s[0] = false;
-
- } else SynErr(49);
- }
-
- static void Char(out int n) {
- Expect(5);
- string name = t.val;
- name = DFA.Unescape(name.Substring(1, name.Length-2));
- int max = CharClass.charSetSize;
- if (name.Length != 1 || name[0] > max-1) SemErr("unacceptable character value");
- n = name[0] % max;
-
- }
-
- static void Sym(out string name, out int kind) {
- name = "???"; kind = id;
- if (la.kind == 1) {
- Get();
- kind = id; name = t.val;
- } else if (la.kind == 3 || la.kind == 5) {
- if (la.kind == 3) {
- Get();
- name = t.val;
- } else {
- Get();
- name = "\"" + t.val.Substring(1, t.val.Length-2) + "\"";
- }
- kind = str;
- } else SynErr(50);
- }
-
- static void Term(out Graph g) {
- Graph g2; Position pos; Node rslv = null;
- g = null;
-
- if (StartOf(18)) {
- if (la.kind == 35) {
- rslv = new Node(Node.rslv, null, la.line);
- ResolveExpr(out pos);
- rslv.pos = pos;
- g = new Graph(rslv);
-
- }
- Factor(out g2);
- if (rslv != null) Graph.MakeSequence(g, g2);
- else g = g2;
-
- while (StartOf(19)) {
- Factor(out g2);
- Graph.MakeSequence(g, g2);
- }
- } else if (StartOf(20)) {
- g = new Graph(new Node(Node.eps, null, 0));
- } else SynErr(51);
- }
-
- static void ResolveExpr(out Position pos) {
- Expect(35);
- Expect(28);
- int beg = la.pos; int col = la.col;
- if (la.kind == 8 || la.kind == 36) {
- if (la.kind == 8) {
- Get();
- } else {
- Get();
- }
- CondPart();
- } else if (la.kind == 28) {
- Get();
- CondPart();
- Expect(29);
- } else if (StartOf(21)) {
- Get();
- CondPart();
- } else SynErr(52);
- pos = new Position(beg, t.pos - beg, col);
- }
-
- static void Factor(out Graph g) {
- string name; int kind; Position pos; bool weak = false;
- g = null;
-
- switch (la.kind) {
- case 1: case 3: case 5: case 27: {
- if (la.kind == 27) {
- Get();
- weak = true;
- }
- Sym(out name, out kind);
- Symbol sym = Symbol.Find(name);
- bool undef = sym == null;
- if (undef) {
- if (kind == id)
- sym = new Symbol(Node.nt, name, 0); // forward nt
- else if (genScanner) {
- sym = new Symbol(Node.t, name, t.line);
- DFA.MatchLiteral(sym);
- } else { // undefined string in production
- SemErr("undefined string in production");
- sym = Tab.eofSy; // dummy
- }
- }
- int typ = sym.typ;
- if (typ != Node.t && typ != Node.nt && typ != Node.rslv) /* ML */
- SemErr("this symbol kind is not allowed in a production");
- if (weak)
- if (typ == Node.t) typ = Node.wt;
- else SemErr("only terminals may be weak");
- Node p = new Node(typ, sym, t.line);
- g = new Graph(p);
-
- if (la.kind == 24) {
- Attribs(p);
- if (kind != id) SemErr("a literal must not have attributes");
- }
- if (undef)
- sym.attrPos = p.pos; // dummy
- else if ((p.pos == null) != (sym.attrPos == null))
- SemErr("attribute mismatch between declaration and use of this symbol");
-
- break;
- }
- case 28: {
- Get();
- Expression(out g);
- Expect(29);
- break;
- }
- case 30: {
- Get();
- Expression(out g);
- Expect(31);
- Graph.MakeOption(g);
- break;
- }
- case 32: {
- Get();
- Expression(out g);
- Expect(33);
- Graph.MakeIteration(g);
- break;
- }
- case 38: {
- SemText(out pos);
- Node p = new Node(Node.sem, null, 0);
- p.pos = pos;
- g = new Graph(p);
-
- break;
- }
- case 23: {
- Get();
- Node p = new Node(Node.any, null, 0); // p.set is set in Tab.SetupAnys
- g = new Graph(p);
-
- break;
- }
- case 34: {
- Get();
- Node p = new Node(Node.sync, null, 0);
- g = new Graph(p);
-
- break;
- }
- default: SynErr(53); break;
- }
- }
-
- static void Attribs(Node p) {
- Expect(24);
- int beg = la.pos; int col = la.col;
- while (StartOf(7)) {
- if (StartOf(8)) {
- Get();
- } else {
- Get();
- SemErr("bad string in attributes");
- }
- }
- Expect(25);
- p.pos = new Position(beg, t.pos - beg, col);
- }
-
- static void CondPart() {
- while (StartOf(22)) {
- if (la.kind == 28) {
- Get();
- CondPart();
- } else {
- Get();
- }
- }
- Expect(29);
- }
-
- static void TokenTerm(out Graph g) {
- Graph g2;
- TokenFactor(out g);
- while (StartOf(16)) {
- TokenFactor(out g2);
- Graph.MakeSequence(g, g2);
- }
- if (la.kind == 37) {
- Get();
- Expect(28);
- TokenExpr(out g2);
- Graph.SetContextTrans(g2.l); Graph.MakeSequence(g, g2);
- Expect(29);
- }
- }
-
- static void TokenFactor(out Graph g) {
- string name; int kind;
- g = new Graph();
- if (la.kind == 1 || la.kind == 3 || la.kind == 5) {
- Sym(out name, out kind);
- if (kind == id) {
- CharClass c = CharClass.Find(name);
- if (c == null) {
- SemErr("undefined name");
- c = new CharClass(name, new BitArray(CharClass.charSetSize));
- }
- Node p = new Node(Node.clas, null, 0); p.val = c.n;
- g = new Graph(p);
- } else g = Graph.StrToGraph(name); // str
-
- } else if (la.kind == 28) {
- Get();
- TokenExpr(out g);
- Expect(29);
- } else if (la.kind == 30) {
- Get();
- TokenExpr(out g);
- Expect(31);
- Graph.MakeOption(g);
- } else if (la.kind == 32) {
- Get();
- TokenExpr(out g);
- Expect(33);
- Graph.MakeIteration(g);
- } else SynErr(54);
- }
-
-
-
- public static void Parse() {
- Errors.SynErr = new ErrorCodeProc(SynErr);
- la = new Token();
- la.val = "";
- Get();
- Coco();
-
- }
-
- static void SynErr (int line, int col, int n) {
- Errors.count++;
- string s;
- switch (n) {
- case 0: s = "EOF expected"; break;
- case 1: s = "ident expected"; break;
- case 2: s = "number expected"; break;
- case 3: s = "string expected"; break;
- case 4: s = "badString expected"; break;
- case 5: s = "char expected"; break;
- case 6: s = "\"COMPILER\" expected"; break;
- case 7: s = "\"PRODUCTIONS\" expected"; break;
- case 8: s = "\"=\" expected"; break;
- case 9: s = "\".\" expected"; break;
- case 10: s = "\"END\" expected"; break;
- case 11: s = "\"CHARACTERS\" expected"; break;
- case 12: s = "\"TOKENS\" expected"; break;
- case 13: s = "\"PRAGMAS\" expected"; break;
- case 14: s = "\"COMMENTS\" expected"; break;
- case 15: s = "\"FROM\" expected"; break;
- case 16: s = "\"TO\" expected"; break;
- case 17: s = "\"NESTED\" expected"; break;
- case 18: s = "\"IGNORE\" expected"; break;
- case 19: s = "\"TOKENNAMES\" expected"; break;
- case 20: s = "\"+\" expected"; break;
- case 21: s = "\"-\" expected"; break;
- case 22: s = "\"..\" expected"; break;
- case 23: s = "\"ANY\" expected"; break;
- case 24: s = "\"<\" expected"; break;
- case 25: s = "\">\" expected"; break;
- case 26: s = "\"|\" expected"; break;
- case 27: s = "\"WEAK\" expected"; break;
- case 28: s = "\"(\" expected"; break;
- case 29: s = "\")\" expected"; break;
- case 30: s = "\"[\" expected"; break;
- case 31: s = "\"]\" expected"; break;
- case 32: s = "\"{\" expected"; break;
- case 33: s = "\"}\" expected"; break;
- case 34: s = "\"SYNC\" expected"; break;
- case 35: s = "\"IF\" expected"; break;
- case 36: s = "\"!=\" expected"; break;
- case 37: s = "\"CONTEXT\" expected"; break;
- case 38: s = "\"(.\" expected"; break;
- case 39: s = "\".)\" expected"; break;
- case 40: s = "\"using\" expected"; break;
- case 41: s = "\";\" expected"; break;
- case 42: s = "??? expected"; break;
- case 43: s = "this symbol not expected in Coco"; break;
- case 44: s = "invalid Declaration"; break;
- case 45: s = "invalid Declaration"; break;
- case 46: s = "this symbol not expected in TokenDecl"; break;
- case 47: s = "invalid TokenDecl"; break;
- case 48: s = "invalid TokenDecl"; break;
- case 49: s = "invalid SimSet"; break;
- case 50: s = "invalid Sym"; break;
- case 51: s = "invalid Term"; break;
- case 52: s = "invalid ResolveExpr"; break;
- case 53: s = "invalid Factor"; break;
- case 54: s = "invalid TokenFactor"; break;
-
- default: s = "error " + n; break;
- }
- Console.WriteLine(errMsgFormat, line, col, s);
- }
-
- static bool[,] set = {
- {T,T,x,T, x,T,x,T, T,T,x,T, T,T,T,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x},
- {x,T,T,T, T,T,T,x, T,T,T,x, x,x,x,T, T,T,x,x, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,x},
- {x,x,x,x, x,x,x,x, x,x,x,T, T,T,T,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x},
- {T,T,x,T, x,T,x,T, T,T,x,T, T,T,T,x, x,x,T,T, x,x,x,T, x,x,T,T, T,x,T,x, T,x,T,T, x,x,T,x, x,x,x,x},
- {T,T,x,T, x,T,x,T, T,T,T,T, T,T,T,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x},
- {x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,T,x},
- {x,x,x,x, x,x,x,T, x,x,x,T, T,T,T,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x},
- {x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,x},
- {x,T,T,T, x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,x},
- {x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,x, T,T,T,x},
- {x,T,T,T, x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,x,x, T,T,T,x},
- {x,T,x,T, x,T,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,T,T, T,T,T,T, T,T,T,T, x,x,T,x, x,x,x,x},
- {x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,T, x,T,x,x, x,x,x,x, x,x,x,x},
- {T,T,x,T, x,T,x,T, T,T,x,T, T,T,T,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x},
- {x,T,x,T, x,T,x,T, x,x,x,T, T,T,T,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,x,x,x},
- {x,T,x,T, x,T,x,T, x,x,x,T, T,T,T,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x},
- {x,T,x,T, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,x, T,x,x,x, x,x,x,x, x,x,x,x},
- {x,x,x,x, x,x,x,T, x,T,x,T, T,T,T,x, T,T,T,T, x,x,x,x, x,x,x,x, x,T,x,T, x,T,x,x, x,x,x,x, x,x,x,x},
- {x,T,x,T, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,T, T,x,T,x, T,x,T,T, x,x,T,x, x,x,x,x},
- {x,T,x,T, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,T, T,x,T,x, T,x,T,x, x,x,T,x, x,x,x,x},
- {x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x, x,T,x,T, x,T,x,x, x,x,x,x, x,x,x,x},
- {x,T,T,T, T,T,T,T, x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, x,T,T,T, T,T,T,T, x,T,T,T, T,T,T,x},
- {x,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,x,T,T, T,T,T,T, T,T,T,T, T,T,T,x}
-
- };
-} // end Parser
-
-}
diff --git a/main/src/tools/SharpCoco/src/Parser.frame b/main/src/tools/SharpCoco/src/Parser.frame
deleted file mode 100644
index c0e61ba6b1..0000000000
--- a/main/src/tools/SharpCoco/src/Parser.frame
+++ /dev/null
@@ -1,120 +0,0 @@
-using System;
-using System.Reflection;
-
--->namespace
-
--->tokens
-
-public class Parser
-{
--->constants
- const bool T = true;
- const bool x = false;
- const int minErrDist = 2;
- const string errMsgFormat = "-- line {0} col {1}: {2}"; // 0=line, 1=column, 2=text
- int errDist = minErrDist;
- Errors errors;
- Lexer lexer;
-
- public Errors Errors {
- get {
- return errors;
- }
- }
-
--->declarations
-
-/*
--->pragmas
-*/
- void SynErr(int n)
- {
- if (errDist >= minErrDist) {
- errors.SynErr(lexer.LookAhead.line, lexer.LookAhead.col, n);
- }
- errDist = 0;
- }
-
- public void SemErr(string msg)
- {
- if (errDist >= minErrDist) {
- errors.Error(lexer.Token.line, lexer.Token.col, msg);
- }
- errDist = 0;
- }
-
- void Expect(int n)
- {
- if (lexer.LookAhead.kind == n) {
- lexer.NextToken();
- } else {
- SynErr(n);
- }
- }
-
- bool StartOf(int s)
- {
- return set[s, lexer.LookAhead.kind];
- }
-
- void ExpectWeak(int n, int follow)
- {
- if (lexer.LookAhead.kind == n) {
- lexer.NextToken();
- } else {
- SynErr(n);
- while (!StartOf(follow)) {
- lexer.NextToken();
- }
- }
- }
-
- bool WeakSeparator(int n, int syFol, int repFol)
- {
- bool[] s = new bool[maxT + 1];
-
- if (lexer.LookAhead.kind == n) {
- lexer.NextToken();
- return true;
- } else if (StartOf(repFol)) {
- return false;
- } else {
- for (int i = 0; i <= maxT; i++) {
- s[i] = set[syFol, i] || set[repFol, i] || set[0, i];
- }
- SynErr(n);
- while (!s[lexer.LookAhead.kind]) {
- lexer.NextToken();
- }
- return StartOf(syFol);
- }
- }
-
--->productions
-
- public void Parse(Lexer lexer)
- {
- this.errors = lexer.Errors;
- this.lexer = lexer;
- errors.SynErr = new ErrorCodeProc(SynErr);
- lexer.NextToken();
--->parseRoot
- }
-
- void SynErr(int line, int col, int errorNumber)
- {
- errors.count++;
- string s;
- switch (errorNumber) {
--->errors
- default: s = "error " + errorNumber; break;
- }
- errors.Error(line, col, s);
- }
-
- static bool[,] set = {
--->initialization
- };
-} // end Parser
-
-$$$
diff --git a/main/src/tools/SharpCoco/src/ParserGen.cs b/main/src/tools/SharpCoco/src/ParserGen.cs
deleted file mode 100644
index 5bbff51e5e..0000000000
--- a/main/src/tools/SharpCoco/src/ParserGen.cs
+++ /dev/null
@@ -1,430 +0,0 @@
-// ParserGen.cs Parser generator of Coco/R H.Moessenboeck, Univ. of Linz
-//----------------------------------------------------------------------------
-using System;
-using System.IO;
-using System.Collections;
-using System.Text;
-
-namespace at.jku.ssw.Coco {
-
-public class ParserGen {
-
- const int maxTerm = 3; // sets of size < maxTerm are enumerated
- const char CR = '\r';
- const char LF = '\n';
- const char TAB = '\t';
- const int EOF = -1;
-
- const int tErr = 0; // error codes
- const int altErr = 1;
- const int syncErr = 2;
-
- public static Position usingPos; // "using" definitions from the attributed grammar
-
- static int errorNr; // highest parser error number
- static Symbol curSy; // symbol whose production is currently generated
- static FileStream fram; // parser frame file
- static StreamWriter gen; // generated parser source file
- static StringWriter err; // generated parser error messages
- static string srcName; // name of attributed grammar file
- static string srcDir; // directory of attributed grammar file
- static ArrayList symSet = new ArrayList();
-
- static void Indent (int n) {
- for (int i = 1; i <= n; i++) gen.Write('\t');
- }
-
- /* AW: this replaces the method int Alternatives (Node p) */
- static bool UseSwitch (Node p) {
- if (p.typ != Node.alt) return false;
- int nAlts = 0;
- while (p != null) {
- ++nAlts;
- // must not optimize with switch-statement, if alt uses a resolver expression
- if (p.sub.typ == Node.rslv) return false;
- p = p.down;
- }
- return nAlts > 5;
- }
-
- static void CopyFramePart (string stop) {
- char startCh = stop[0];
- int endOfStopString = stop.Length-1;
- int ch = fram.ReadByte();
- while (ch != EOF)
- if (ch == startCh) {
- int i = 0;
- do {
- if (i == endOfStopString) return; // stop[0..i] found
- ch = fram.ReadByte(); i++;
- } while (ch == stop[i]);
- // stop[0..i-1] found; continue with last read character
- gen.Write(stop.Substring(0, i));
- } else {
- gen.Write((char)ch); ch = fram.ReadByte();
- }
- Errors.Exception(" -- incomplete or corrupt parser frame file");
- }
-
- static void CopySourcePart (Position pos, int indent) {
- // Copy text described by pos from atg to gen
- int ch, nChars, i;
- if (pos != null) {
- Buffer.Pos = pos.beg; ch = Buffer.Read(); nChars = pos.len - 1;
-// CHANGES BY M.KRUEGER (#line pragma generation)
- gen.WriteLine();
- gen.WriteLine(String.Format("#line {0} \"{1}\" ", Buffer.CountLines(pos.beg) + 1, Buffer.fileName));
-// EOC
- Indent(indent);
- while (nChars >= 0) {
- while (ch == CR || ch == LF) { // eol is either CR or CRLF or LF
- gen.WriteLine(); Indent(indent);
- if (ch == CR) { ch = Buffer.Read(); nChars--; } // skip CR
- if (ch == LF) { ch = Buffer.Read(); nChars--; } // skip LF
- for (i = 1; i <= pos.col && ch <= ' '; i++) {
- // skip blanks at beginning of line
- ch = Buffer.Read(); nChars--;
- }
- if (i <= pos.col) pos.col = i - 1; // heading TABs => not enough blanks
- if (nChars < 0) goto done;
- }
- gen.Write((char)ch);
- ch = Buffer.Read(); nChars--;
- }
- done:
- if (indent > 0) gen.WriteLine();
- }
- }
-
- static void GenErrorMsg (int errTyp, Symbol sym) {
- errorNr++;
- err.Write("\t\t\tcase " + errorNr + ": s = \"");
- switch (errTyp) {
- case tErr:
- if (sym.name[0] == '"') err.Write(DFA.Escape(sym.name) + " expected");
- else err.Write(sym.name + " expected");
- break;
- case altErr: err.Write("invalid " + sym.name); break;
- case syncErr: err.Write("this symbol not expected in " + sym.name); break;
- }
- err.WriteLine("\"; break;");
- }
-
- static int NewCondSet (BitArray s) {
- for (int i = 1; i < symSet.Count; i++) // skip symSet[0] (reserved for union of SYNC sets)
- if (Sets.Equals(s, (BitArray)symSet[i])) return i;
- symSet.Add(s.Clone());
- return symSet.Count - 1;
- }
-
- static void GenCond (BitArray s, Node p) {
- if (p.typ == Node.rslv) CopySourcePart(p.pos, 0);
- else {
- GenCond(s);
- if (p.typ == Node.alt) {
- // for { ... | IF ... | ... } or [ ... | IF ... | ... ]
- // generate conditions: StartOf(...) || IF
- Node q = p;
- while (q != null) {
- if (q.sub.typ == Node.rslv) {
- gen.Write(" || ");
- CopySourcePart(q.sub.pos, 0);
- }
- q = q.down;
- }
- }
- }
- }
-
- static void GenCond (BitArray s) {
- int n = Sets.Elements(s);
- if (n == 0) gen.Write("false"); // should never happen
- else if (n <= maxTerm)
- foreach (Symbol sym in Symbol.terminals) {
- if (s[sym.n]) {
- gen.Write("la.kind == {0}", sym.n);
- --n;
- if (n > 0) gen.Write(" || ");
- }
- }
- else gen.Write("StartOf({0})", NewCondSet(s));
- }
-
- static void PutCaseLabels (BitArray s) {
- foreach (Symbol sym in Symbol.terminals)
- if (s[sym.n]) gen.Write("case {0}: ", sym.n);
- }
-
- static void GenCode (Node p, int indent, BitArray isChecked) {
- Node p2;
- BitArray s1, s2;
- while (p != null) {
- switch (p.typ) {
- case Node.nt: {
- Indent(indent);
- gen.Write(p.sym.name + "(");
- CopySourcePart(p.pos, 0);
- gen.WriteLine(");");
- break;
- }
- case Node.t: {
- Indent(indent);
- // M.Krueger: changed Get() to lexer.NextToken();
- if (isChecked[p.sym.n]) gen.WriteLine("lexer.NextToken();");
- else gen.WriteLine("Expect({0});", p.sym.n);
- break;
- }
- case Node.wt: {
- Indent(indent);
- s1 = Tab.Expected(p.next, curSy);
- s1.Or(Tab.allSyncSets);
- gen.WriteLine("ExpectWeak({0}, {1});", p.sym.n, NewCondSet(s1));
- break;
- }
- case Node.any: {
- Indent(indent);
- // M.Krueger: changed Get() to lexer.NextToken();
- gen.WriteLine("lexer.NextToken();");
- break;
- }
- case Node.eps: break; // nothing
- case Node.sem: {
- CopySourcePart(p.pos, indent);
- break;
- }
- case Node.sync: {
- Indent(indent);
- GenErrorMsg(syncErr, curSy);
- s1 = (BitArray)p.set.Clone();
- gen.Write("while (!("); GenCond(s1); gen.Write(")) {");
- // M.Krueger: changed Get() to lexer.NextToken();
- gen.Write("SynErr({0}); lexer.NextToken(); ", errorNr); gen.WriteLine("}");
- break;
- }
- case Node.alt: {
- s1 = Tab.First(p);
- bool equal = Sets.Equals(s1, isChecked);
- bool useSwitch = UseSwitch(p);
- if (useSwitch) { Indent(indent); gen.WriteLine("switch (la.kind) {"); }
- p2 = p;
- while (p2 != null) {
- s1 = Tab.Expected(p2.sub, curSy, 1);
- Indent(indent);
- if (useSwitch) { PutCaseLabels(s1); gen.WriteLine("{"); }
- else if (p2 == p) {
- gen.Write("if ("); GenCond(s1, p2.sub); gen.WriteLine(") {");
- } else if (p2.down == null && equal) { gen.WriteLine("} else {");
- } else {
- gen.Write("} else if ("); GenCond(s1, p2.sub); gen.WriteLine(") {");
- }
- s1.Or(isChecked);
- if (p2.sub.typ != Node.rslv) GenCode(p2.sub, indent + 1, s1);
- else GenCode(p2.sub.next, indent + 1, s1);
- if (useSwitch) {
- Indent(indent); gen.WriteLine("\tbreak;");
- Indent(indent); gen.WriteLine("}");
- }
- p2 = p2.down;
- }
- Indent(indent);
- if (equal) {
- gen.WriteLine("}");
- } else {
- GenErrorMsg(altErr, curSy);
- if (useSwitch) {
- gen.WriteLine("default: SynErr({0}); break;", errorNr);
- Indent(indent); gen.WriteLine("}");
- } else {
- gen.Write("} "); gen.WriteLine("else SynErr({0});", errorNr);
- }
- }
- break;
- }
- case Node.iter: {
- Indent(indent);
- p2 = p.sub;
- gen.Write("while (");
- if (p2.typ == Node.wt) {
- s1 = Tab.Expected(p2.next, curSy);
- s2 = Tab.Expected(p.next, curSy);
- gen.Write("WeakSeparator({0},{1},{2}) ", p2.sym.n, NewCondSet(s1), NewCondSet(s2));
- s1 = new BitArray(Symbol.terminals.Count); // for inner structure
- if (p2.up || p2.next == null) p2 = null; else p2 = p2.next;
- } else {
- s1 = Tab.First(p2);
- GenCond(s1, p2);
- }
- gen.WriteLine(") {");
- GenCode(p2, indent + 1, s1);
- Indent(indent);
- gen.WriteLine("}");
- break;
- }
- case Node.opt:
- if (p.sub.typ != Node.rslv) s1 = Tab.First(p.sub);
- else s1 = Tab.First(p.sub.next);
- if (!Sets.Equals(isChecked, s1)) {
- Indent(indent);
- gen.Write("if ("); GenCond(s1, p.sub); gen.WriteLine(") {");
- if (p.sub.typ != Node.rslv) GenCode(p.sub, indent + 1, s1);
- else GenCode(p.sub.next, indent + 1, s1);
- Indent(indent); gen.WriteLine("}");
- } else GenCode(p.sub, indent, isChecked);
- break;
- }
- if (p.typ != Node.eps && p.typ != Node.sem && p.typ != Node.sync)
- isChecked.SetAll(false); // = new BitArray(Symbol.terminals.Count);
- if (p.up) break;
- p = p.next;
- }
- }
-
- /* ML 2002-09-07 Generates the class "Tokens" *
- * which maps the token number to meaningfully named integer constants, *
- * as specified in the NAMES section. */
- static void GenTokens() {
- if (Symbol.tokenNames != null && Symbol.tokenNames.Count > 0) {
-
- gen.WriteLine("public class Tokens {");
-
- foreach (DictionaryEntry entry in Symbol.tokenNames) {
- string token = entry.Key as string;
- string name = entry.Value as string;
- if (IsCSharpKW(name)) {
- Parser.SemErr(name + " is a C# keyword." +
- "Use another name for the token " + token);
- continue;
- }
-
- Symbol sym = Symbol.Find(token);
- if (sym != null && (sym.typ == Node.t || sym.typ == Node.wt))
- gen.WriteLine("\tpublic const int {0} = {1};", name, sym.n);
- }
-
- gen.WriteLine("}");
- }
- }
-
- /* AW 03-01-20 to generate token name: *
- * a C# keyword must not be used as an identifier */
- static bool IsCSharpKW (string name) {
- return Array.BinarySearch(csKeywords, name) >= 0;
- }
-
- static string[] csKeywords = new string[] {
- "abstract", "as", "base", "bool", "break", "byte",
- "case", "catch", "char", "checked", "class", "const",
- "continue", "decimal", "default", "delegate", "do", "double",
- "else", "enum", "event", "explicit", "extern", "false",
- "finally", "fixed", "float", "for", "foreach", "goto",
- "if", "implicit", "in", "int", "interface", "internal",
- "is", "lock", "long", "namespace", "new", "null",
- "object", "operator", "out", "override", "params", "private",
- "protected", "public", "readonly", "ref", "return", "sbyte",
- "sealed", "short", "sizeof", "stackalloc", "static", "string",
- "struct", "switch", "this", "throw", "true", "try",
- "typeof", "uint", "ulong", "unchecked", "unsafe", "ushort",
- "using", "virtual", "void", "volatile", "while"
- };
-
- static void GenCodePragmas() {
- foreach (Symbol sym in Symbol.pragmas) {
- gen.WriteLine("\t\t\t\tif (la.kind == {0}) {{", sym.n);
- CopySourcePart(sym.semPos, 4);
- gen.WriteLine("\t\t\t\t}");
- }
- }
-
- static void GenProductions() {
- foreach (Symbol sym in Symbol.nonterminals) {
- curSy = sym;
- gen.Write("\tvoid {0}(", sym.name);
- CopySourcePart(sym.attrPos, 0);
- gen.WriteLine(") {");
- CopySourcePart(sym.semPos, 2);
- GenCode(sym.graph, 2, new BitArray(Symbol.terminals.Count));
- gen.WriteLine("\t}"); gen.WriteLine();
- }
- }
-
- static void InitSets() {
- for (int i = 0; i < symSet.Count; i++) {
- BitArray s = (BitArray)symSet[i];
- gen.Write("\t{");
- int j = 0;
- foreach (Symbol sym in Symbol.terminals) {
- if (s[sym.n]) gen.Write("T,"); else gen.Write("x,");
- ++j;
- if (j%4 == 0) gen.Write(" ");
- }
- if (i == symSet.Count-1) gen.WriteLine("x}"); else gen.WriteLine("x},");
- }
- }
-
- public static void WriteParser () {
- FileStream s;
- symSet.Add(Tab.allSyncSets);
- string fr = srcDir + "Parser.frame";
- if (!File.Exists(fr)) {
- string frameDir = Environment.GetEnvironmentVariable("crframes");
- if (frameDir != null) fr = frameDir.Trim() + "\\Parser.frame";
- if (!File.Exists(fr)) Errors.Exception("-- Cannot find Parser.frame");
- }
- try {
- fram = new FileStream(fr, FileMode.Open, FileAccess.Read, FileShare.Read);
- } catch (IOException) {
- Errors.Exception("-- Cannot open Parser.frame.");
- }
- try {
- string fn = srcDir + "Parser.cs";
- if (File.Exists(fn)) File.Copy(fn, fn.Replace(".cs", ".old.cs"), true);
- s = new FileStream(fn, FileMode.Create);
- gen = new StreamWriter(s);
- } catch (IOException) {
- Errors.Exception("-- Cannot generate parser file");
- }
- err = new StringWriter();
- foreach (Symbol sym in Symbol.terminals) GenErrorMsg(tErr, sym);
- if (usingPos != null) CopySourcePart(usingPos, 0);
- gen.WriteLine();
- CopyFramePart("-->namespace");
- /* AW open namespace, if it exists */
- if (Tab.nsName != null && Tab.nsName.Length > 0) {
- gen.Write("namespace ");
- gen.Write(Tab.nsName);
- gen.Write(" {");
- }
- CopyFramePart("-->tokens"); GenTokens(); /* ML 2002/09/07 write the tokenkinds */
- CopyFramePart("-->constants");
- gen.WriteLine("\tconst int maxT = {0};", Symbol.terminals.Count-1);
- CopyFramePart("-->declarations"); CopySourcePart(Tab.semDeclPos, 0);
- CopyFramePart("-->pragmas"); GenCodePragmas();
- CopyFramePart("-->productions"); GenProductions();
- CopyFramePart("-->parseRoot"); gen.WriteLine("\t\t{0}();", Tab.gramSy.name);
- CopyFramePart("-->errors"); gen.Write(err.ToString());
- CopyFramePart("-->initialization"); InitSets();
- CopyFramePart("$$$");
- /* AW 2002-12-20 close namespace, if it exists */
- if (Tab.nsName != null && Tab.nsName.Length > 0) gen.Write("}");
- gen.Close();
- }
-
- public static void WriteStatistics () {
- Trace.WriteLine();
- Trace.WriteLine("{0} terminals", Symbol.terminals.Count);
- Trace.WriteLine("{0} symbols", Symbol.terminals.Count + Symbol.pragmas.Count +
- Symbol.nonterminals.Count);
- Trace.WriteLine("{0} nodes", Node.nodes.Count);
- Trace.WriteLine("{0} sets", symSet.Count);
- }
-
- public static void Init (string file, string dir) {
- srcName = file;
- srcDir = dir;
- errorNr = -1;
- usingPos = null;
- }
-
-} // end ParserGen
-
-} // end namespace
diff --git a/main/src/tools/SharpCoco/src/Scanner.cs b/main/src/tools/SharpCoco/src/Scanner.cs
deleted file mode 100644
index ed04d8fbd8..0000000000
--- a/main/src/tools/SharpCoco/src/Scanner.cs
+++ /dev/null
@@ -1,688 +0,0 @@
-using System;
-
-using System.IO;
-
-using System.Collections;
-
-using System.Text;
-
-
-
-namespace at.jku.ssw.Coco {
-
-
-
-public class Token {
-
- public int kind; // token kind
-
- public int pos; // token position in the source text (starting at 0)
-
- public int col; // token column (starting at 0)
-
- public int line; // token line (starting at 1)
-
- public string val; // token value
-
- public Token next; // AW 2003-03-07 Tokens are kept in linked list
-
-
-
- public Token () { }
-
- public Token (int kind) { this.kind = kind; }
-
-}
-
-
-
-public class Buffer {
-
- public const int eof = '\uffff';
-
- static byte[] buf;
- static int bufLen;
- static int pos;
- public static string fileName;
-
- public static int CountLines(int offset)
- {
- int line = 0;
- for (int i = 0; i <= offset; ++i) {
- if (buf[i] == '\n') {
- ++line;
- }
- }
- return line;
- }
-
- public static void Fill (string fileName) {
- Buffer.fileName = fileName;
- FileStream s = null;
- try {
- s = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
- bufLen = (int) s.Length;
- buf = new byte[bufLen];
- s.Read(buf, 0, bufLen);
- pos = 0;
-
- } catch (IOException) {
-
- Console.WriteLine("--- Cannot open file {0}", fileName);
-
- System.Environment.Exit(0);
-
- } finally {
-
- if (s != null) s.Close();
-
- }
-
- }
-
-
-
- public static int Read () {
-
- if (pos < bufLen) return buf[pos++];
-
- else return 0;
-
- }
-
-
-
- public static int Peek () {
-
- if (pos < bufLen) return buf[pos];
-
- else return 0;
-
- }
-
-
-
- /* AW 2003-03-10 moved this from ParserGen.cs */
-
- public static string GetString (int beg, int end) {
-
- StringBuilder s = new StringBuilder(64);
-
- int oldPos = Buffer.Pos;
-
- Buffer.Pos = beg;
-
- while (beg < end) { s.Append((char)Buffer.Read()); beg++; }
-
- Buffer.Pos = oldPos;
-
- return s.ToString();
-
- }
-
-
-
- public static int Pos {
-
- get { return pos; }
-
- set {
-
- if (value < 0) pos = 0;
-
- else if (value >= bufLen) pos = bufLen;
-
- else pos = value;
-
- }
-
- }
-
-}
-
-
-
-public class Scanner {
-
- const char EOF = '\0';
-
- const char EOL = '\n';
-
- const int maxT = 42;
-
-
-
-
-
- const int noSym = 42;
-
- static short[] start = {
-
- 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 27, 11, 0, 10, 0, 0, 5, 21, 22, 0, 15, 0, 16, 14, 0,
-
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 31, 18, 13, 19, 0,
-
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 23, 0, 24, 0, 0,
-
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 25, 20, 26, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0};
-
-
-
-
-
- static Token t; // current token
-
- static char ch; // current input character
-
- static int pos; // column number of current character
-
- static int line; // line number of current character
-
- static int lineStart; // start position of current line
-
- static int oldEols; // EOLs that appeared in a comment;
-
- static BitArray ignore; // set of characters to be ignored by the scanner
-
-
-
- /* ML ----- begin */
-
- static Token tokens; // the complete input token stream
-
- static Token pt; // current peek token
-
-
-
- static int peekCount = 0;
-
-
-
- public static int PeekCount { get { return peekCount; } }
-
-
-
- public static void Init (String fileName) {
-
- Buffer.Fill(fileName);
-
- pos = -1; line = 1; lineStart = 0;
-
- oldEols = 0;
-
- NextCh();
-
- ignore = new BitArray(256);
-
- ignore[9] = true; ignore[10] = true; ignore[13] = true; ignore[32] = true;
-
-
-
-
-
- /* AW 2003-03-07 fill token list */
-
- tokens = new Token(); // first token is a dummy
-
- Token node = tokens;
-
- do {
-
- node.next = NextToken();
-
- node = node.next;
-
- } while (node.kind != 0); /* AW: 0 => EOF */
-
- t = pt = tokens;
-
- }
-
-
-
- static void NextCh() {
-
- if (oldEols > 0) { ch = EOL; oldEols--; }
-
- else {
-
- ch = (char)Buffer.Read(); pos++;
-
- // replace isolated '\r' by '\n' in order to make
-
- // eol handling uniform across Windows, Unix and Mac
-
- if (ch == '\r' && Buffer.Peek() != '\n') ch = EOL;
-
- else if (ch > '\u007f') ch = '?';
-
- if (ch == EOL) { line++; lineStart = pos + 1; }
-
- }
-
- }
-
-
-
-
- static bool Comment0() {
-
- int level = 1, line0 = line, lineStart0 = lineStart;
-
- NextCh();
-
- if (ch == '*') {
-
- NextCh();
-
- for(;;) {
-
- if (ch == '*') {
-
- NextCh();
-
- if (ch == '/') {
-
- level--;
-
- if (level == 0) { oldEols = line - line0; NextCh(); return true; }
-
- NextCh();
-
- }
-
- } else if (ch == '/') {
-
- NextCh();
-
- if (ch == '*') {
-
- level++; NextCh();
-
- }
-
- } else if (ch == EOF) return false;
-
- else NextCh();
-
- }
-
- } else {
-
- if (ch==EOL) {line--; lineStart = lineStart0;}
-
- pos = pos - 2; Buffer.Pos = pos+1; NextCh();
-
- }
-
- return false;
-
- }
-
-
-
-
-
- static void CheckLiteral() {
-
- switch (t.val) {
-
- case "COMPILER": t.kind = 6; break;
-
- case "PRODUCTIONS": t.kind = 7; break;
-
- case "END": t.kind = 10; break;
-
- case "CHARACTERS": t.kind = 11; break;
-
- case "TOKENS": t.kind = 12; break;
-
- case "PRAGMAS": t.kind = 13; break;
-
- case "COMMENTS": t.kind = 14; break;
-
- case "FROM": t.kind = 15; break;
-
- case "TO": t.kind = 16; break;
-
- case "NESTED": t.kind = 17; break;
-
- case "IGNORE": t.kind = 18; break;
-
- case "TOKENNAMES": t.kind = 19; break;
-
- case "ANY": t.kind = 23; break;
-
- case "WEAK": t.kind = 27; break;
-
- case "SYNC": t.kind = 34; break;
-
- case "IF": t.kind = 35; break;
-
- case "CONTEXT": t.kind = 37; break;
-
- case "using": t.kind = 40; break;
-
- default: break;
-
-
-
- }
-
- }
-
-
-
- /* AW Scan() renamed to NextToken() */
-
- static Token NextToken() {
-
- while (ignore[ch]) NextCh();
-
- if (ch == '/' && Comment0()) return NextToken();
-
- t = new Token();
-
- t.pos = pos; t.col = pos - lineStart + 1; t.line = line;
-
- int state = start[ch];
-
- StringBuilder buf = new StringBuilder(16);
-
- buf.Append(ch); NextCh();
-
-
-
- switch (state) {
-
- case 0: { t.kind = noSym; goto done; } // NextCh already done
-
- case 1:
-
- if ((ch >= '0' && ch <= '9' || ch >= 'A' && ch <= 'Z' || ch >= 'a' && ch <= 'z')) {buf.Append(ch); NextCh(); goto case 1;}
-
- else {t.kind = 1; t.val = buf.ToString(); CheckLiteral(); return t;}
-
- case 2:
-
- if ((ch >= '0' && ch <= '9')) {buf.Append(ch); NextCh(); goto case 2;}
-
- else {t.kind = 2; goto done;}
-
- case 3:
-
- {t.kind = 3; goto done;}
-
- case 4:
-
- {t.kind = 4; goto done;}
-
- case 5:
-
- if ((ch >= 1 && ch <= 9 || ch >= 11 && ch <= 12 || ch >= 14 && ch <= '&' || ch >= '(' && ch <= '[' || ch >= ']')) {buf.Append(ch); NextCh(); goto case 6;}
-
- else if (ch == 92) {buf.Append(ch); NextCh(); goto case 7;}
-
- else {t.kind = noSym; goto done;}
-
- case 6:
-
- if (ch == 39) {buf.Append(ch); NextCh(); goto case 9;}
-
- else {t.kind = noSym; goto done;}
-
- case 7:
-
- if ((ch >= ' ' && ch <= '~')) {buf.Append(ch); NextCh(); goto case 8;}
-
- else {t.kind = noSym; goto done;}
-
- case 8:
-
- if ((ch >= '0' && ch <= '9' || ch >= 'a' && ch <= 'f')) {buf.Append(ch); NextCh(); goto case 8;}
-
- else if (ch == 39) {buf.Append(ch); NextCh(); goto case 9;}
-
- else {t.kind = noSym; goto done;}
-
- case 9:
-
- {t.kind = 5; goto done;}
-
- case 10:
-
- if ((ch >= '0' && ch <= '9' || ch >= 'A' && ch <= 'Z' || ch >= 'a' && ch <= 'z')) {buf.Append(ch); NextCh(); goto case 10;}
-
- else {t.kind = 43; goto done;}
-
- case 11:
-
- if ((ch >= 1 && ch <= 9 || ch >= 11 && ch <= 12 || ch >= 14 && ch <= '!' || ch >= '#' && ch <= '[' || ch >= ']')) {buf.Append(ch); NextCh(); goto case 11;}
-
- else if ((ch == 10 || ch == 13)) {buf.Append(ch); NextCh(); goto case 4;}
-
- else if (ch == '"') {buf.Append(ch); NextCh(); goto case 3;}
-
- else if (ch == 92) {buf.Append(ch); NextCh(); goto case 12;}
-
- else {t.kind = noSym; goto done;}
-
- case 12:
-
- if ((ch >= ' ' && ch <= '~')) {buf.Append(ch); NextCh(); goto case 11;}
-
- else {t.kind = noSym; goto done;}
-
- case 13:
-
- {t.kind = 8; goto done;}
-
- case 14:
-
- if (ch == '.') {buf.Append(ch); NextCh(); goto case 17;}
-
- else if (ch == ')') {buf.Append(ch); NextCh(); goto case 30;}
-
- else {t.kind = 9; goto done;}
-
- case 15:
-
- {t.kind = 20; goto done;}
-
- case 16:
-
- {t.kind = 21; goto done;}
-
- case 17:
-
- {t.kind = 22; goto done;}
-
- case 18:
-
- {t.kind = 24; goto done;}
-
- case 19:
-
- {t.kind = 25; goto done;}
-
- case 20:
-
- {t.kind = 26; goto done;}
-
- case 21:
-
- if (ch == '.') {buf.Append(ch); NextCh(); goto case 29;}
-
- else {t.kind = 28; goto done;}
-
- case 22:
-
- {t.kind = 29; goto done;}
-
- case 23:
-
- {t.kind = 30; goto done;}
-
- case 24:
-
- {t.kind = 31; goto done;}
-
- case 25:
-
- {t.kind = 32; goto done;}
-
- case 26:
-
- {t.kind = 33; goto done;}
-
- case 27:
-
- if (ch == '=') {buf.Append(ch); NextCh(); goto case 28;}
-
- else {t.kind = noSym; goto done;}
-
- case 28:
-
- {t.kind = 36; goto done;}
-
- case 29:
-
- {t.kind = 38; goto done;}
-
- case 30:
-
- {t.kind = 39; goto done;}
-
- case 31:
-
- {t.kind = 41; goto done;}
-
- case 32: {t.kind = 0; goto done;}
-
- }
-
- done:
-
- t.val = buf.ToString();
-
- return t;
-
- }
-
-
-
- /* AW 2003-03-07 get the next token, move on and synch peek token with current */
-
- public static Token Scan () {
-
- t = pt = t.next;
-
- return t;
-
- }
-
-
-
- /* AW 2003-03-07 get the next token, ignore pragmas */
-
- public static Token Peek () {
-
- do { // skip pragmas while peeking
-
- pt = pt.next;
-
- } while (pt != null && pt.kind > maxT);
-
- return pt;
-
- }
-
-
-
- /* AW 2003-03-11 to make sure peek start at current scan position */
-
- public static void StartPeek () { pt = t; }
-
-} // end Scanner
-
-
-
-
-
-public delegate void ErrorCodeProc (int line, int col, int n);
-
-public delegate void ErrorMsgProc (int line, int col, string msg);
-
-
-
-public class Errors {
-
- public static int count = 0; // number of errors detected
-
- public static ErrorCodeProc SynErr = new ErrorCodeProc(DefaultCodeError); // syntactic errors
-
- public static ErrorCodeProc SemErr = new ErrorCodeProc(DefaultCodeError); // semantic errors
-
- public static ErrorMsgProc Error = new ErrorMsgProc(DefaultMsgError); // user defined string based errors
-
-
-
- public static void Exception (string s) {
-
- Console.WriteLine(s);
-
- System.Environment.Exit(0);
-
- }
-
-
-
- static void DefaultCodeError (int line, int col, int n) {
-
- Console.WriteLine("-- line {0} col {1}: error {2}", line, col, n);
-
- count++;
-
- }
-
-
-
- static void DefaultMsgError (int line, int col, string s) {
-
- Console.WriteLine("-- line {0} col {1}: {2}", line, col, s);
-
- count++;
-
- }
-
-} // Errors
-
-
-
-}
diff --git a/main/src/tools/SharpCoco/src/Scanner.frame b/main/src/tools/SharpCoco/src/Scanner.frame
deleted file mode 100644
index 50ca7b3803..0000000000
--- a/main/src/tools/SharpCoco/src/Scanner.frame
+++ /dev/null
@@ -1,222 +0,0 @@
-using System;
-using System.Drawing;
-using System.IO;
-using System.Collections;
-using System.Text;
-
--->namespace
-
-public class Token {
- public int kind; // token kind
- public int pos; // token position in the source text (starting at 0)
- public int col; // token column (starting at 0)
- public int line; // token line (starting at 1)
- public string val; // token value
- public Token next; // AW 2003-03-07 Tokens are kept in linked list
-
- public Point Location {
- get {
- return new Point(line, col);
- }
- }
-
- public Token () { }
- public Token (int kind) { this.kind = kind; }
-}
-
-public class Buffer {
- public const int eof = '\uffff';
-
- static byte[] buf;
- static int bufLen;
- static int pos;
-
- public static void Fill (string fileName) {
- FileStream s = null;
- try {
- s = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
- Fill(s);
- } catch (IOException) {
- Console.WriteLine("--- Cannot open file {0}", fileName);
- System.Environment.Exit(0);
- } finally {
- if (s != null) s.Close();
- }
- }
-
- public static void Fill (Stream s) {
- bufLen = (int) s.Length;
- buf = new byte[bufLen];
- s.Read(buf, 0, bufLen);
- pos = 0;
- }
-
- public static int Read () {
- if (pos < bufLen) return buf[pos++];
- else return 0;
- }
-
- public static int Peek () {
- if (pos < bufLen) return buf[pos];
- else return 0;
- }
-
- /* AW 2003-03-10 moved this from ParserGen.cs */
- public static string GetString (int beg, int end) {
- StringBuilder s = new StringBuilder(64);
- int oldPos = Buffer.Pos;
- Buffer.Pos = beg;
- while (beg < end) { s.Append((char)Buffer.Read()); beg++; }
- Buffer.Pos = oldPos;
- return s.ToString();
- }
-
- public static int Pos {
- get { return pos; }
- set {
- if (value < 0) pos = 0;
- else if (value >= bufLen) pos = bufLen;
- else pos = value;
- }
- }
-}
-
-public class Scanner {
- const char EOF = '\0';
- const char EOL = '\n';
- const char CR = '\n';
-
--->constants
-
--->declarations
-
- static Token t; // current token
- static char ch; // current input character
- static int pos; // column number of current character
- static int line; // line number of current character
- static int lineStart; // start position of current line
- static int oldEols; // EOLs that appeared in a comment;
- static BitArray ignore; // set of characters to be ignored by the scanner
-
- /* ML ----- begin */
- static Token tokens; // the complete input token stream
- static Token pt; // current peek token
-
- static int peekCount = 0;
-
- public static int PeekCount { get { return peekCount; } }
-
- static void Init()
- {
- pos = -1; line = 1; lineStart = 0;
- oldEols = 0;
- NextCh();
--->initialization
-
- /* AW 2003-03-07 fill token list */
- tokens = new Token(); // first token is a dummy
- Token node = tokens;
- do {
- node.next = NextToken();
- node = node.next;
- } while (node.kind != 0); /* AW: 0 => EOF */
- t = pt = tokens;
- }
-
- public static void Init(String fileName) {
- Buffer.Fill(fileName);
- Init();
- }
-
- public static void Init(Stream s) {
- Buffer.Fill(s);
- Init();
- }
-
- static void NextCh() {
- if (oldEols > 0) { ch = EOL; oldEols--; }
- else {
- ch = (char)Buffer.Read(); pos++;
- // replace isolated '\r' by '\n' in order to make
- // eol handling uniform across Windows, Unix and Mac
- if (ch == '\r' && Buffer.Peek() != '\n') ch = EOL;
- else if (ch > '\u007f') ch = '?';
- if (ch == EOL) { line++; lineStart = pos + 1; }
- }
- }
-
--->comment
-
- static void CheckLiteral() {
- switch (t.val) {
--->literals
- }
- }
-
- /* AW Scan() renamed to NextToken() */
- static Token NextToken() {
- while (ignore[ch]) NextCh();
--->scan1
- t = new Token();
- t.pos = pos; t.col = pos - lineStart + 1; t.line = line;
- int state = start[ch];
- StringBuilder buf = new StringBuilder(16);
- buf.Append(ch); NextCh();
-
- switch (state) {
- case 0: { t.kind = noSym; goto done; } // NextCh already done
--->scan2
- }
- done:
- t.val = buf.ToString();
- return t;
- }
-
- /* AW 2003-03-07 get the next token, move on and synch peek token with current */
- public static Token Scan () {
- t = pt = t.next;
- return t;
- }
-
- /* AW 2003-03-07 get the next token, ignore pragmas */
- public static Token Peek () {
- do { // skip pragmas while peeking
- pt = pt.next;
- } while (pt != null && pt.kind > maxT);
- return pt;
- }
-
- /* AW 2003-03-11 to make sure peek start at current scan position */
- public static void StartPeek () { pt = t; }
-} // end Scanner
-
-
-public delegate void ErrorCodeProc (int line, int col, int n);
-public delegate void ErrorMsgProc (int line, int col, string msg);
-
-public class Errors {
- public static int count = 0; // number of errors detected
- public static ErrorCodeProc SynErr = new ErrorCodeProc(DefaultCodeError); // syntactic errors
- public static ErrorCodeProc SemErr = new ErrorCodeProc(DefaultCodeError); // semantic errors
- public static ErrorMsgProc Error = new ErrorMsgProc(DefaultMsgError); // user defined string based errors
- public static StringBuilder errorText = new StringBuilder();
-
- public static void Exception (string s) {
- Console.WriteLine(s);
- System.Environment.Exit(0);
- }
-
- static void DefaultCodeError (int line, int col, int n) {
- errorText.Append(String.Format("-- line {0} col {1}: error {2}", line, col, n));
- errorText.Append("\n");
- count++;
- }
-
- static void DefaultMsgError (int line, int col, string s) {
- errorText.Append(String.Format("-- line {0} col {1}: {2}", line, col, s));
- errorText.Append("\n");
- count++;
- }
-} // Errors
-
-$$$
diff --git a/main/src/tools/SharpCoco/src/Tab.cs b/main/src/tools/SharpCoco/src/Tab.cs
deleted file mode 100644
index 349275ae5a..0000000000
--- a/main/src/tools/SharpCoco/src/Tab.cs
+++ /dev/null
@@ -1,1068 +0,0 @@
-/* ------------------------------------------------------------------------
- * Tab.cs
- * Symbol table management of Coco/R
- * by H.Moessenboeck, Univ. of Linz
- * ------------------------------------------------------------------------*/
-using System;
-using System.IO;
-using System.Collections;
-
-namespace at.jku.ssw.Coco {
-
-public class Position { // position of source code stretch (e.g. semantic action, resolver expressions)
- public int beg; // start relative to the beginning of the file
- public int len; // length of stretch
- public int col; // column number of start position
-
- public Position(int beg, int len, int col) {
- this.beg = beg; this.len = len; this.col = col;
- }
-}
-
-
-//---------------------------------------------------------------------
-// Symbols
-//---------------------------------------------------------------------
-
-public class Symbol : IComparable {
- public static ArrayList terminals = new ArrayList();
- public static ArrayList pragmas = new ArrayList();
- public static ArrayList nonterminals = new ArrayList();
- public static Hashtable tokenNames = null; /* AW 2003-03-25 */
-
- public const int classToken = 0; // token kinds
- public const int litToken = 1;
- public const int classLitToken = 2;
-
- public int n; // symbol number
- public int typ; // t, nt, pr, unknown, rslv /* ML 29_11_2002 slv added */ /* AW slv --> rslv */
- public string name; // symbol name
- public Node graph; // nt: to first node of syntax graph
- public int tokenKind; // t: token kind (literal, class, ...)
- public bool deletable; // nt: true if nonterminal is deletable
- public bool firstReady; // nt: true if terminal start symbols have already been computed
- public BitArray first; // nt: terminal start symbols
- public BitArray follow; // nt: terminal followers
- public BitArray nts; // nt: nonterminals whose followers have to be added to this sym
- public int line; // source text line number of item in this node
- public Position attrPos; // nt: position of attributes in source text (or null)
- public Position semPos; // pr: pos of semantic action in source text (or null)
- // nt: pos of local declarations in source text (or null)
- public override string ToString()
- {
- return String.Format("[Symbol:Name={0}, n={1}]", name, n);
- }
- public Symbol(int typ, string name, int line) {
- if (name.Length == 2 && name[0] == '"') {
- Parser.SemErr("empty token not allowed"); name = "???";
- }
- if (name.IndexOf(' ') >= 0) Parser.SemErr("tokens must not contain blanks");
- this.typ = typ; this.name = name; this.line = line;
- switch (typ) {
- case Node.t: n = terminals.Count; terminals.Add(this); break;
- case Node.pr: pragmas.Add(this); break;
- case Node.nt: n = nonterminals.Count; nonterminals.Add(this); break;
- }
- }
-
- public static Symbol Find(string name) {
- foreach (Symbol s in terminals)
- if (s.name == name) return s;
- foreach (Symbol s in nonterminals)
- if (s.name == name) return s;
- return null;
- }
-
- public int CompareTo(object x) {
- return name.CompareTo(((Symbol)x).name);
- }
-
-}
-
-
-//---------------------------------------------------------------------
-// Syntax graph (class Node, class Graph)
-//---------------------------------------------------------------------
-
-public class Node {
- public static ArrayList nodes = new ArrayList();
- public static string[] nTyp =
- {" ", "t ", "pr ", "nt ", "clas", "chr ", "wt ", "any ", "eps ", /* AW 03-01-14 nTyp[0]: " " --> " " */
- "sync", "sem ", "alt ", "iter", "opt ", "rslv"};
-
- // constants for node kinds
- public const int t = 1; // terminal symbol
- public const int pr = 2; // pragma
- public const int nt = 3; // nonterminal symbol
- public const int clas = 4; // character class
- public const int chr = 5; // character
- public const int wt = 6; // weak terminal symbol
- public const int any = 7; //
- public const int eps = 8; // empty
- public const int sync = 9; // synchronization symbol
- public const int sem = 10; // semantic action: (. .)
- public const int alt = 11; // alternative: |
- public const int iter = 12; // iteration: { }
- public const int opt = 13; // option: [ ]
- public const int rslv = 14; // resolver expr /* ML */ /* AW 03-01-13 renamed slv --> rslv */
-
- public const int normalTrans = 0; // transition codes
- public const int contextTrans = 1;
-
- public int n; // node number
- public int typ; // t, nt, wt, chr, clas, any, eps, sem, sync, alt, iter, opt, rslv
- public Node next; // to successor node
- public Node down; // alt: to next alternative
- public Node sub; // alt, iter, opt: to first node of substructure
- public bool up; // true: "next" leads to successor in enclosing structure
- public Symbol sym; // nt, t, wt: symbol represented by this node
- public int val; // chr: ordinal character value
- // clas: index of character class
- public int code; // chr, clas: transition code
- public BitArray set; // any, sync: the set represented by this node
- public Position pos; // nt, t, wt: pos of actual attributes
- // sem: pos of semantic action in source text
- public int line; // source text line number of item in this node
- public State state; // DFA state corresponding to this node
- // (only used in DFA.ConvertToStates)
-
- public Node(int typ, Symbol sym, int line) {
- this.typ = typ; this.sym = sym; this.line = line;
- n = nodes.Count;
- nodes.Add(this);
- }
-
- public Node(int typ, Node sub): this(typ, null, 0) {
- this.sub = sub;
- }
-
- public Node(int typ, int val, int line): this(typ, null, line) {
- this.val = val;
- }
-
- public static bool DelGraph(Node p) {
- return p == null || DelNode(p) && DelGraph(p.next);
- }
-
- public static bool DelAlt(Node p) {
- return p == null || DelNode(p) && (p.up || DelAlt(p.next));
- }
-
- public static bool DelNode(Node p) {
- if (p.typ == nt) return p.sym.deletable;
- else if (p.typ == alt) return DelAlt(p.sub) || p.down != null && DelAlt(p.down);
- else return p.typ == eps || p.typ == iter || p.typ == opt || p.typ == sem || p.typ == sync;
- }
-
- //----------------- for printing ----------------------
-
- static int Ptr(Node p, bool up) {
- if (p == null) return 0;
- else if (up) return -p.n;
- else return p.n;
- }
-
- static string Pos(Position pos) {
- if (pos == null) return " "; else return String.Format("{0,5}", pos.beg);
- }
-
- public static string Name(string name) {
- return (name + " ").Substring(0, 12);
- /* isn't this better (less string allocations, easier to understand): *
- * return (name.Length > 12) ? name.Substring(0,12) : name; */
- }
-
- public static void PrintNodes() {
- Trace.WriteLine("Graph nodes:");
- Trace.WriteLine("----------------------------------------------------");
- Trace.WriteLine(" n type name next down sub pos line");
- Trace.WriteLine(" val code");
- Trace.WriteLine("----------------------------------------------------");
- foreach (Node p in nodes) {
- Trace.Write("{0,4} {1} ", p.n, nTyp[p.typ]);
- if (p.sym != null)
- Trace.Write("{0,12} ", Name(p.sym.name));
- else if (p.typ == Node.clas) {
- CharClass c = (CharClass)CharClass.classes[p.val];
- Trace.Write("{0,12} ", Name(c.name));
- } else Trace.Write(" ");
- Trace.Write("{0,5} ", Ptr(p.next, p.up));
- switch (p.typ) {
- case t: case nt: case wt:
- Trace.Write(" {0,5}", Pos(p.pos)); break;
- case chr:
- Trace.Write("{0,5} {1,5} ", p.val, p.code); break;
- case clas:
- Trace.Write(" {0,5} ", p.code); break;
- case alt: case iter: case opt:
- Trace.Write("{0,5} {1,5} ", Ptr(p.down, false), Ptr(p.sub, false)); break;
- case sem:
- Trace.Write(" {0,5}", Pos(p.pos)); break;
- case eps: case any: case sync:
- Trace.Write(" "); break;
- }
- Trace.WriteLine("{0,5}", p.line);
- }
- Trace.WriteLine();
- }
-
-}
-
-
-public class Graph {
- static Node dummyNode = new Node(Node.eps, null, 0);
-
- public Node l; // left end of graph = head
- public Node r; // right end of graph = list of nodes to be linked to successor graph
-
- public Graph() {
- l = null; r = null;
- }
-
- public Graph(Node left, Node right) {
- l = left; r = right;
- }
-
- public Graph(Node p) {
- l = p; r = p;
- }
-
- public static void MakeFirstAlt(Graph g) {
- g.l = new Node(Node.alt, g.l); g.l.line = g.l.sub.line; /* AW 2002-03-07 make line available for error handling */
- g.l.next = g.r;
- g.r = g.l;
- }
-
- public static void MakeAlternative(Graph g1, Graph g2) {
- g2.l = new Node(Node.alt, g2.l); g2.l.line = g2.l.sub.line;
- Node p = g1.l; while (p.down != null) p = p.down;
- p.down = g2.l;
- p = g1.r; while (p.next != null) p = p.next;
- p.next = g2.r;
- }
-
- public static void MakeSequence(Graph g1, Graph g2) {
- Node p = g1.r.next; g1.r.next = g2.l; // link head node
- while (p != null) { // link substructure
- Node q = p.next; p.next = g2.l; p.up = true;
- p = q;
- }
- g1.r = g2.r;
- }
-
- public static void MakeIteration(Graph g) {
- g.l = new Node(Node.iter, g.l);
- Node p = g.r;
- g.r = g.l;
- while (p != null) {
- Node q = p.next; p.next = g.l; p.up = true;
- p = q;
- }
- }
-
- public static void MakeOption(Graph g) {
- g.l = new Node(Node.opt, g.l);
- g.l.next = g.r;
- g.r = g.l;
- }
-
- public static void Finish(Graph g) {
- Node p = g.r;
- while (p != null) {
- Node q = p.next; p.next = null; p = q;
- }
- }
-
- public static void SetContextTrans(Node p) { // set transition code in the graph rooted at p
- DFA.hasCtxMoves = true;
- while (p != null) {
- if (p.typ == Node.chr || p.typ == Node.clas) {
- p.code = Node.contextTrans;
- } else if (p.typ == Node.opt || p.typ == Node.iter) {
- SetContextTrans(p.sub);
- } else if (p.typ == Node.alt) {
- SetContextTrans(p.sub); SetContextTrans(p.down);
- }
- if (p.up) break;
- p = p.next;
- }
- }
-
- public static void DeleteNodes() {
- Node.nodes = new ArrayList();
- dummyNode = new Node(Node.eps, null, 0);
- }
-
- public static Graph StrToGraph(string str) {
- string s = DFA.Unescape(str.Substring(1, str.Length-2));
- if (s.IndexOf('\0') >= 0) Parser.SemErr("\\0 not allowed here. Used as eof character");
- if (s.Length == 0) Parser.SemErr("empty token not allowed");
- Graph g = new Graph();
- g.r = dummyNode;
- for (int i = 0; i < s.Length; i++) {
- Node p = new Node(Node.chr, (int)s[i], 0);
- g.r.next = p; g.r = p;
- }
- g.l = dummyNode.next; dummyNode.next = null;
- return g;
- }
-
-}
-
-
-//----------------------------------------------------------------
-// Bit sets
-//----------------------------------------------------------------
-
-public class Sets {
-
- public static int First(BitArray s) {
- int max = s.Count;
- for (int i=0; i<max; i++)
- if (s[i]) return i;
- return -1;
- }
-
- public static int Elements(BitArray s) {
- int max = s.Count;
- int n = 0;
- for (int i=0; i<max; i++)
- if (s[i]) n++;
- return n;
- }
-
- public static bool Equals(BitArray a, BitArray b) {
- int max = a.Count;
- for (int i=0; i<max; i++)
- if (a[i] != b[i]) return false;
- return true;
- }
-
- public static bool Includes(BitArray a, BitArray b) { // a > b ?
- int max = a.Count;
- for (int i=0; i<max; i++)
- if (b[i] && ! a[i]) return false;
- return true;
- }
-
- public static bool Intersect(BitArray a, BitArray b) { // a * b != {}
- int max = a.Count;
- for (int i=0; i<max; i++)
- if (a[i] && b[i]) return true;
- return false;
- }
-
- public static void Subtract(BitArray a, BitArray b) { // a = a - b
- BitArray c = (BitArray) b.Clone();
- a.And(c.Not());
- }
-
- public static void PrintSet(BitArray s, int indent) {
- int col, len;
- col = indent;
- foreach (Symbol sym in Symbol.terminals) {
- if (s[sym.n]) {
- len = sym.name.Length;
- if (col + len >= 80) {
- Trace.WriteLine();
- for (col = 1; col < indent; col++) Trace.Write(" ");
- }
- Trace.Write("{0} ", sym.name);
- col += len + 1;
- }
- }
- if (col == indent) Trace.Write("-- empty set --");
- Trace.WriteLine();
- }
-
-}
-
-
-//---------------------------------------------------------------------
-// Character class management
-//---------------------------------------------------------------------
-
-public class CharClass {
- public static ArrayList classes = new ArrayList();
- public static int dummyName = 'A';
-
- public const int charSetSize = 256; // must be a multiple of 16
-
- public int n; // class number
- public string name; // class name
- public BitArray set; // set representing the class
-
- public CharClass(string name, BitArray s) {
- if (name == "#") name = "#" + (char)dummyName++;
- this.n = classes.Count; this.name = name; this.set = s;
- classes.Add(this);
- }
-
- public static CharClass Find(string name) {
- foreach (CharClass c in classes)
- if (c.name == name) return c;
- return null;
- }
-
- public static CharClass Find(BitArray s) {
- foreach (CharClass c in classes)
- if (Sets.Equals(s, c.set)) return c;
- return null;
- }
-
- public static BitArray Set(int i) {
- return ((CharClass)classes[i]).set;
- }
-
- static string Ch(int ch) {
- if (ch < ' ' || ch >= 127 || ch == '\'' || ch == '\\') return ch.ToString();
- else return String.Format("'{0}'", (char)ch);
- }
-
- static void WriteCharSet(BitArray s) {
- int i = 0, len = s.Count;
- while (i < len) {
- while (i < len && !s[i]) i++;
- if (i == len) break;
- int j = i;
- while (i < len && s[i]) i++;
- if (j < i-1) Trace.Write("{0}..{1} ", Ch(j), Ch(i-1));
- else Trace.Write("{0} ", Ch(j));
- }
- }
-
- public static void WriteClasses () {
- foreach (CharClass c in classes) {
- Trace.Write("{0,-10}: ", c.name);
- WriteCharSet(c.set);
- Trace.WriteLine();
- }
- Trace.WriteLine();
- }
-}
-
-
-//-----------------------------------------------------------
-// Symbol table management routines
-//-----------------------------------------------------------
-
-public class Tab {
- public static Position semDeclPos; // position of global semantic declarations
- public static BitArray ignored; // characters ignored by the scanner
- public static bool[] ddt = new bool[10]; // debug and test switches
- public static Symbol gramSy; // root nonterminal; filled by ATG
- public static Symbol eofSy; // end of file symbol
- public static Symbol noSym; // used in case of an error
- public static BitArray allSyncSets; // union of all synchronisation sets
- public static string nsName; // namespace for generated files
-
- static BitArray visited; // mark list for graph traversals
- static Symbol curSy; // current symbol in computation of sets
-
- //---------------------------------------------------------------------
- // Symbol set computations
- //---------------------------------------------------------------------
-
- /* Computes the first set for the given Node. */
- static BitArray First0(Node p, BitArray mark) {
- BitArray fs = new BitArray(Symbol.terminals.Count);
- while (p != null && !mark[p.n]) {
- mark[p.n] = true;
- switch (p.typ) {
- case Node.nt: {
- if (p.sym.firstReady) fs.Or(p.sym.first);
- else fs.Or(First0(p.sym.graph, mark));
- break;
- }
- case Node.t: case Node.wt: {
- fs[p.sym.n] = true; break;
- }
- case Node.any: {
- fs.Or(p.set); break;
- }
- case Node.alt: {
- fs.Or(First0(p.sub, mark));
- fs.Or(First0(p.down, mark));
- break;
- }
- case Node.iter: case Node.opt: {
- fs.Or(First0(p.sub, mark));
- break;
- }
- }
- if (!Node.DelNode(p)) break;
- p = p.next;
- }
- return fs;
- }
-
- /// <returns>
- /// BitArray which contains the first tokens.
- /// </returns>
- public static BitArray First(Node p) {
- BitArray fs = First0(p, new BitArray(Node.nodes.Count));
- if (ddt[3]) {
- Trace.WriteLine();
- if (p != null) Trace.WriteLine("First: node = {0}", p.n);
- else Trace.WriteLine("First: node = null");
- Sets.PrintSet(fs, 0);
- }
- return fs;
- }
-
-
- static void CompFirstSets() {
- foreach (Symbol sym in Symbol.nonterminals) {
- sym.first = new BitArray(Symbol.terminals.Count);
- sym.firstReady = false;
- }
- foreach (Symbol sym in Symbol.nonterminals) {
- sym.first = First(sym.graph);
- sym.firstReady = true;
- }
- }
-
- static void CompFollow(Node p) {
- while (p != null && !visited[p.n]) {
- visited[p.n] = true;
- if (p.typ == Node.nt) {
- BitArray s = First(p.next);
- p.sym.follow.Or(s);
- if (Node.DelGraph(p.next))
- p.sym.nts[curSy.n] = true;
- } else if (p.typ == Node.opt || p.typ == Node.iter) {
- CompFollow(p.sub);
- } else if (p.typ == Node.alt) {
- CompFollow(p.sub); CompFollow(p.down);
- }
- p = p.next;
- }
- }
-
- static void Complete(Symbol sym) {
- if (!visited[sym.n]) {
- visited[sym.n] = true;
- foreach (Symbol s in Symbol.nonterminals) {
- if (sym.nts[s.n]) {
- Complete(s);
- sym.follow.Or(s.follow);
- if (sym == curSy) sym.nts[s.n] = false;
- }
- }
- }
- }
-
- static void CompFollowSets() {
- foreach (Symbol sym in Symbol.nonterminals) {
- sym.follow = new BitArray(Symbol.terminals.Count);
- sym.nts = new BitArray(Symbol.nonterminals.Count);
- }
- visited = new BitArray(Node.nodes.Count);
- foreach (Symbol sym in Symbol.nonterminals) { // get direct successors of nonterminals
- curSy = sym;
- CompFollow(sym.graph);
- }
- foreach (Symbol sym in Symbol.nonterminals) { // add indirect successors to followers
- visited = new BitArray(Symbol.nonterminals.Count);
- curSy = sym;
- Complete(sym);
- }
- }
-
- static Node LeadingAny(Node p) {
- if (p == null) return null;
- Node a = null;
- if (p.typ == Node.any) a = p;
- else if (p.typ == Node.alt) {
- a = LeadingAny(p.sub);
- if (a == null) a = LeadingAny(p.down);
- }
- else if (p.typ == Node.opt || p.typ == Node.iter) a = LeadingAny(p.sub);
- else if (Node.DelNode(p) && !p.up) a = LeadingAny(p.next);
- return a;
- }
-
- static void FindAS(Node p) { // find ANY sets
- Node a;
- while (p != null) {
- if (p.typ == Node.opt || p.typ == Node.iter) {
- FindAS(p.sub);
- a = LeadingAny(p.sub);
- if (a != null) Sets.Subtract(a.set, First(p.next));
- } else if (p.typ == Node.alt) {
- BitArray s1 = new BitArray(Symbol.terminals.Count);
- Node q = p;
- while (q != null) {
- FindAS(q.sub);
- a = LeadingAny(q.sub);
- if (a != null)
- Sets.Subtract(a.set, First(q.down).Or(s1));
- else
- s1.Or(First(q.sub));
- q = q.down;
- }
- }
- if (p.up) break;
- p = p.next;
- }
- }
-
- static void CompAnySets() {
- foreach (Symbol sym in Symbol.nonterminals) FindAS(sym.graph);
- }
-
- public static BitArray Expected(Node p, Symbol curSy) {
- BitArray s = First(p);
- if (Node.DelGraph(p)) s.Or(curSy.follow);
- return s;
- }
-
- public static BitArray Expected(Node p, Symbol curSy, int outmost) {
- BitArray s = First(p);
- if (Node.DelGraph(p)) s.Or(curSy.follow);
- return s;
- }
-
- static void CompSync(Node p) {
- while (p != null && !visited[p.n]) {
- visited[p.n] = true;
- if (p.typ == Node.sync) {
- BitArray s = Expected(p.next, curSy);
- s[eofSy.n] = true;
- allSyncSets.Or(s);
- p.set = s;
- } else if (p.typ == Node.alt) {
- CompSync(p.sub); CompSync(p.down);
- } else if (p.typ == Node.opt || p.typ == Node.iter)
- CompSync(p.sub);
- p = p.next;
- }
- }
-
- static void CompSyncSets() {
- allSyncSets = new BitArray(Symbol.terminals.Count);
- allSyncSets[eofSy.n] = true;
- visited = new BitArray(Node.nodes.Count);
- foreach (Symbol sym in Symbol.nonterminals) {
- curSy = sym;
- CompSync(curSy.graph);
- }
- }
-
- public static void SetupAnys() {
- foreach (Node p in Node.nodes)
- if (p.typ == Node.any) {
- p.set = new BitArray(Symbol.terminals.Count, true);
- p.set[eofSy.n] = false;
- }
- }
-
- public static void CompDeletableSymbols() {
- bool changed;
- do {
- changed = false;
- foreach (Symbol sym in Symbol.nonterminals)
- if (!sym.deletable && sym.graph != null && Node.DelGraph(sym.graph)) {
- sym.deletable = true; changed = true;
- }
- } while (changed);
- foreach (Symbol sym in Symbol.nonterminals)
- if (sym.deletable) Console.WriteLine(" {0} deletable", sym.name);
- }
-
- public static void RenumberPragmas() {
- int n = Symbol.terminals.Count;
- foreach (Symbol sym in Symbol.pragmas) sym.n = n++;
- }
-
- public static void CompSymbolSets() {
- CompDeletableSymbols();
- CompFirstSets();
- CompFollowSets();
- CompAnySets();
- CompSyncSets();
- if (ddt[1]) {
- Trace.WriteLine();
- Trace.WriteLine("First & follow symbols:");
- Trace.WriteLine("----------------------"); Trace.WriteLine();
- foreach (Symbol sym in Symbol.nonterminals) {
- Trace.WriteLine(sym.name);
- Trace.Write("first: "); Sets.PrintSet(sym.first, 10);
- Trace.Write("follow: "); Sets.PrintSet(sym.follow, 10);
- Trace.WriteLine();
- }
- }
- if (ddt[4]) {
- Trace.WriteLine();
- Trace.WriteLine("ANY and SYNC sets:");
- Trace.WriteLine("-----------------");
- foreach (Node p in Node.nodes)
- if (p.typ == Node.any || p.typ == Node.sync) {
- Trace.Write("{0,4} {1,4}: ", p.n, Node.nTyp[p.typ]);
- Sets.PrintSet(p.set, 11);
- }
- }
- }
-
- //---------------------------------------------------------------------
- // Grammar checks
- //---------------------------------------------------------------------
-
- public static bool GrammarOk() {
- bool ok = NtsComplete()
- && AllNtReached()
- && NoCircularProductions()
- && AllNtToTerm();
- if (ok) CheckLL1();
- return ok;
- }
-
- //--------------- check for circular productions ----------------------
-
- class CNode { // node of list for finding circular productions
- public Symbol left, right;
-
- public CNode (Symbol l, Symbol r) {
- left = l; right = r;
- }
- }
-
- static void GetSingles(Node p, ArrayList singles) {
- if (p == null) return; // end of graph
- if (p.typ == Node.nt) {
- if (p.up || Node.DelGraph(p.next)) singles.Add(p.sym);
- } else if (p.typ == Node.alt || p.typ == Node.iter || p.typ == Node.opt) {
- if (p.up || Node.DelGraph(p.next)) {
- GetSingles(p.sub, singles);
- if (p.typ == Node.alt) GetSingles(p.down, singles);
- }
- }
- if (!p.up && Node.DelNode(p)) GetSingles(p.next, singles);
- }
-
- public static bool NoCircularProductions() {
- bool ok, changed, onLeftSide, onRightSide;
- ArrayList list = new ArrayList();
- foreach (Symbol sym in Symbol.nonterminals) {
- ArrayList singles = new ArrayList();
- GetSingles(sym.graph, singles); // get nonterminals s such that sym-->s
- foreach (Symbol s in singles) list.Add(new CNode(sym, s));
- }
- do {
- changed = false;
- for (int i = 0; i < list.Count; i++) {
- CNode n = (CNode)list[i];
- onLeftSide = false; onRightSide = false;
- foreach (CNode m in list) {
- if (n.left == m.right) onRightSide = true;
- if (n.right == m.left) onLeftSide = true;
- }
- if (!onLeftSide || !onRightSide) {
- list.Remove(n); i--; changed = true;
- }
- }
- } while(changed);
- ok = true;
- foreach (CNode n in list) {
- ok = false; Errors.count++;
- Console.WriteLine(" {0} --> {1}", n.left.name, n.right.name);
- }
- return ok;
- }
-
- //--------------- check for LL(1) errors ----------------------
-
- static void LL1Error(int cond, Symbol sym) {
- Console.Write(" LL1 warning in {0}: ", curSy.name);
- if (sym != null) Console.Write("{0} is ", sym.name);
- switch (cond) {
- case 1: Console.WriteLine(" start of several alternatives"); break;
- case 2: Console.WriteLine(" start & successor of deletable structure"); break;
- case 3: Console.WriteLine(" an ANY node that matches no symbol"); break;
- }
- }
-
- static void CheckOverlap(BitArray s1, BitArray s2, int cond) {
- foreach (Symbol sym in Symbol.terminals) {
- if (s1[sym.n] && s2[sym.n]) LL1Error(cond, sym);
- }
- }
-
- static void CheckAlts(Node p) {
- BitArray s1, s2;
- while (p != null) {
- if (p.typ == Node.alt) {
- Node q = p;
- s1 = new BitArray(Symbol.terminals.Count);
- while (q != null) { // for all alternatives
- s2 = Expected(q.sub, curSy);
- CheckOverlap(s1, s2, 1);
- s1.Or(s2);
- CheckAlts(q.sub);
- q = q.down;
- }
- } else if (p.typ == Node.opt || p.typ == Node.iter) {
- s1 = Expected(p.sub, curSy);
- s2 = Expected(p.next, curSy);
- CheckOverlap(s1, s2, 2);
- CheckAlts(p.sub);
- } else if (p.typ == Node.any) {
- if (Sets.Elements(p.set) == 0) LL1Error(3, null);
- // e.g. {ANY} ANY or [ANY] ANY
- }
- if (p.up) break;
- p = p.next;
- }
- }
-
- static void RSlvError(string msg) {
- Console.WriteLine(msg);
- }
-
-
- static void CheckResolver(Node p) {
- while (p != null) {
- // check subnodes of current node p
- if ((p.typ == Node.alt || p.typ == Node.iter || p.typ == Node.opt) &&
- !p.sub.up)
- if (p.sub.typ == Node.rslv) CheckResolver(p.sub.next);
- else CheckResolver(p.sub);
-
- // check current node p
- switch (p.typ) {
- case Node.alt:
- BitArray uncovered = new BitArray(Symbol.terminals.Count); // first symbols of alternatives without a resolver (not "covered" by a resolver)
- ArrayList coveredList = new ArrayList(); // list of follow symbols of each resolver (these are "covered" by the resolver)
- ArrayList rslvList = new ArrayList();
-
- // build set of uncovered first symbols & check for misplaced resolvers
- // (= not at the first n-1 of n conflicting alternatives)
- Node q = p;
- while (q != null) {
- BitArray curCovered;
- if (q.sub.typ == Node.rslv) {
- // get followers of resolver (these are "covered" by it)
- if (q.sub.next == null) curCovered = curSy.follow;
- else curCovered = First0(q.sub.next, new BitArray(Node.nodes.Count));
- coveredList.Add(curCovered);
- rslvList.Add(q.sub);
- // resolver must "cover" all but the last occurrence of a conflicting symbol
- if (Sets.Intersect(uncovered, curCovered))
- RSlvError("Misplaced resolver at line " + q.sub.line + " will never be evaluated. " +
- "Place resolver at previous conflicting alternative.");
- } else uncovered.Or(First0(q.sub, new BitArray(Node.nodes.Count)));
- q = q.down;
- }
-
- // check for obsolete resolvers
- // (= alternatives starting with resolvers, when there is no conflict)
- BitArray[] covered = (BitArray[]) coveredList.ToArray(typeof(BitArray));
- Node[] rslvs = (Node[]) rslvList.ToArray(typeof(Node));
- for (int i = 0; i < rslvs.Length; ++i) {
- if (!Sets.Intersect(uncovered, covered[i]))
- RSlvError("Obsolete resolver at line " + rslvs[i].line + ". " +
- "Neither of the start symbols of the alternative occurs without a resolver.");
- /*
- if (!Sets.Includes(uncovered, covered[i]))
- RSlvError("At least one of the symbols after the resolver at line " + rslvs[i].line +
- " does not appear without a resolver. Remove the last resolver covering this symbol.");
- */
- /*
- if (Sets.Equals(, covered[i]))
- RSlvError("Resolver at line " + rslvArr[i].line + " covers more symbols than necessary.\n" +
- "Place resolvers only in front of conflicting symbols.");
- */
- }
- break;
- case Node.iter: case Node.opt:
- if (p.sub.typ == Node.rslv) {
- BitArray fs = First0(p.sub.next, new BitArray(Node.nodes.Count));
- BitArray fsNext;
- if (p.next == null) fsNext = curSy.follow;
- else fsNext = First0(p.next, new BitArray(Node.nodes.Count));
- if (!Sets.Intersect(fs, fsNext))
- RSlvError("Obsolete resolver expression (IF ...) at line " + p.sub.line);
- }
- break;
- case Node.rslv:
- RSlvError("Unexpected Resolver in line " + p.line + ". Will cause parsing error.");
- break;
- }
- if (p.up) break;
- p = p.next;
- }
- }
-
- public static void CheckLL1() {
- foreach (Symbol sym in Symbol.nonterminals) {
- curSy = sym;
- CheckAlts(curSy.graph);
- CheckResolver(curSy.graph);
- }
- }
-
- //------------- check if every nts has a production --------------------
-
- public static bool NtsComplete() {
- bool complete = true;
- foreach (Symbol sym in Symbol.nonterminals) {
- if (sym.graph == null) {
- complete = false; Errors.count++;
- Console.WriteLine(" No production for {0}", sym.name);
- }
- }
- return complete;
- }
-
- //-------------- check if every nts can be reached -----------------
-
- static void MarkReachedNts(Node p) {
- while (p != null) {
- if (p.typ == Node.nt && !visited[p.sym.n]) { // new nt reached
- visited[p.sym.n] = true;
- MarkReachedNts(p.sym.graph);
- } else if (p.typ == Node.alt || p.typ == Node.iter || p.typ == Node.opt) {
- MarkReachedNts(p.sub);
- if (p.typ == Node.alt) MarkReachedNts(p.down);
- }
- if (p.up) break;
- p = p.next;
- }
- }
-
- public static bool AllNtReached() {
- bool ok = true;
- visited = new BitArray(Symbol.nonterminals.Count);
- visited[gramSy.n] = true;
- MarkReachedNts(gramSy.graph);
- foreach (Symbol sym in Symbol.nonterminals) {
- if (!visited[sym.n]) {
- ok = false; Errors.count++;
- Console.WriteLine(" {0} cannot be reached", sym.name);
- }
- }
- return ok;
- }
-
- //--------- check if every nts can be derived to terminals ------------
-
- static bool IsTerm(Node p, BitArray mark) { // true if graph can be derived to terminals
- while (p != null) {
- if (p.typ == Node.nt && !mark[p.sym.n]) return false;
- if (p.typ == Node.alt && !IsTerm(p.sub, mark)
- && (p.down == null || !IsTerm(p.down, mark))) return false;
- if (p.up) break;
- p = p.next;
- }
- return true;
- }
-
- public static bool AllNtToTerm() {
- bool changed, ok = true;
- BitArray mark = new BitArray(Symbol.nonterminals.Count);
- // a nonterminal is marked if it can be derived to terminal symbols
- do {
- changed = false;
- foreach (Symbol sym in Symbol.nonterminals)
- if (!mark[sym.n] && IsTerm(sym.graph, mark)) {
- mark[sym.n] = true; changed = true;
- }
- } while (changed);
- foreach (Symbol sym in Symbol.nonterminals)
- if (!mark[sym.n]) {
- ok = false; Errors.count++;
- Console.WriteLine(" {0} cannot be derived to terminals", sym.name);
- }
- return ok;
- }
-
- /*---------------------------------------------------------------------
- Utility functions
- ---------------------------------------------------------------------*/
-
- static int Num(Node p) {
- if (p == null) return 0; else return p.n;
- }
-
- static void PrintSym(Symbol sym) {
- Trace.Write("{0,3} {1,-14} {2}", sym.n, Node.Name(sym.name), Node.nTyp[sym.typ]);
- if (sym.attrPos==null) Trace.Write(" false "); else Trace.Write(" true ");
- if (sym.typ == Node.nt) {
- Trace.Write("{0,5}", Num(sym.graph));
- if (sym.deletable) Trace.Write(" true "); else Trace.Write(" false ");
- } else
- Trace.Write(" ");
- Trace.WriteLine("{0,5}", sym.line);
- }
-
- public static void PrintSymbolTable() {
- Trace.WriteLine("Symbol Table:");
- Trace.WriteLine("------------"); Trace.WriteLine();
- Trace.WriteLine(" nr name typ hasAt graph del line");
- foreach (Symbol sym in Symbol.terminals) PrintSym(sym);
- foreach (Symbol sym in Symbol.pragmas) PrintSym(sym);
- foreach (Symbol sym in Symbol.nonterminals) PrintSym(sym);
- Trace.WriteLine();
- }
-
- public static void XRef() {
- SortedList tab = new SortedList();
- // collect lines where symbols have been defined
- foreach (Symbol sym in Symbol.nonterminals) {
- ArrayList list = (ArrayList)tab[sym];
- if (list == null) {list = new ArrayList(); tab[sym] = list;}
- list.Add(- sym.line);
- }
- // collect lines where symbols have been referenced
- foreach (Node n in Node.nodes) {
- if (n.typ == Node.t || n.typ == Node.wt || n.typ == Node.nt) {
- ArrayList list = (ArrayList)tab[n.sym];
- if (list == null) {list = new ArrayList(); tab[n.sym] = list;}
- list.Add(n.line);
- }
- }
- // print cross reference list
- Trace.WriteLine();
- Trace.WriteLine("Cross reference list:");
- Trace.WriteLine("--------------------"); Trace.WriteLine();
- foreach (Symbol sym in tab.Keys) {
- Trace.Write(" {0,-12}", Node.Name(sym.name));
- ArrayList list = (ArrayList)tab[sym];
- int col = 14;
- foreach (int line in list) {
- if (col + 5 > 80) {
- Trace.WriteLine();
- for (col = 1; col <= 14; col++) Trace.Write(" ");
- }
- Trace.Write("{0,5}", line); col += 5;
- }
- Trace.WriteLine();
- }
- Trace.WriteLine(); Trace.WriteLine();
- }
-
- public static void SetDDT(string s) {
- s = s.ToUpper();
- foreach (char ch in s) {
- if ('0' <= ch && ch <= '9') ddt[ch - '0'] = true;
- else switch (ch) {
- case 'A' : ddt[0] = true; break; // trace automaton
- case 'F' : ddt[1] = true; break; // list first/follow sets
- case 'G' : ddt[2] = true; break; // print syntax graph
- case 'I' : ddt[3] = true; break; // trace computation of first sets
- case 'J' : ddt[4] = true; break; // print ANY and SYNC sets
- case 'P' : ddt[8] = true; break; // print statistics
- case 'S' : ddt[6] = true; break; // list symbol table
- case 'X' : ddt[7] = true; break; // list cross reference table
- default : break;
- }
- }
- }
-
- public static void Init () {
- eofSy = new Symbol(Node.t, "EOF", 0);
- }
-
-} // end Tab
-
-} // end namespace
diff --git a/main/src/tools/SharpCoco/src/Trace.cs b/main/src/tools/SharpCoco/src/Trace.cs
deleted file mode 100644
index 4a763ae9ac..0000000000
--- a/main/src/tools/SharpCoco/src/Trace.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System;
-using System.IO;
-
-namespace at.jku.ssw.Coco {
-
-class Trace {
- const string FILENAME = "trace.txt";
- static StreamWriter trace;
-
- public static void Init (String dir) {
- FileStream s;
- try {
- s = new FileStream(dir + FILENAME, FileMode.Create); /* AW use FILENAME */
- trace = new StreamWriter(s);
- } catch (IOException) {
- Errors.Exception("-- could not open trace file");
- }
- }
-
- public static void Write (string s) { trace.Write(s); }
-
- public static void Write (string s, params object[] args) {
- trace.Write(s, args);
- }
-
- public static void WriteLine (string s) { trace.WriteLine(s); }
-
- public static void WriteLine (string s, params object[] args) {
- trace.WriteLine(s, args);
- }
-
- public static void WriteLine () { trace.WriteLine(); }
-
- public static void Close () { trace.Close(); }
-}
-
-}
diff --git a/main/src/tools/mdhost/ChangeLog b/main/src/tools/mdhost/ChangeLog
deleted file mode 100644
index e8a50002f8..0000000000
--- a/main/src/tools/mdhost/ChangeLog
+++ /dev/null
@@ -1,148 +0,0 @@
-2009-12-02 Michael Hutchinson <mhutchinson@novell.com>
-
- * src/mdhost.cs: Name threads to make debugging easier.
-
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdhost.csproj: Flush.
-
-2009-09-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdhost.csproj:
- * src/mdhost.cs: Added a watch dog in mdhost. The process will
- exit if the main MD process dies.
-
-2009-08-27 Lluis Sanchez Gual <lluis@novell.com>
-
- * src/mdhost.cs: Route log messages to the main MD process.
-
-2009-07-31 Lluis Sanchez Gual <lluis@novell.com>
-
- * src/mdhost.cs: Track api changes. Always use the IpcChannel
- for connecting to MD.
-
-2009-06-19 Mike Krüger <mkrueger@novell.com>
-
- * src/AssemblyInfo.cs: Commented out empty assembly key file
- attribute (Bug 513981 - Project template causes CS1726
- errors).
-
-2009-02-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * src/mdhost.cs: Read the configuration data from the config
- file if one is provided.
-
-2009-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * mdhost.csproj: Build mdhost and mdrun as 32-bit too on
- Windows.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * mdhost.csproj: Flush MD's removal of newline at end of file
- that was introduced by manually editing with gedit.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * mdhost.csproj: Output to the correct directory.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdhost.mdp:
- * mdhost.csproj: Migrated to MSBuild file format.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * mdhost.mdp: Flush project format changes.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdhost.mdp: Fix target framework.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdhost.mdp: Don't require a specific version of Mono.Addins.
-
-2008-09-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdhost.mdp: Updated projects.
-
-2008-02-15 Geoff Norton <gnorton@novell.com>
-
- * src/mdhost.cs: Disable .NET remoting security on Tcp channels.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * src/mdhost.cs: Fix warnings.
-
-2007-12-13 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdhost.mdp: Add missing reference.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am, mdhost.mdp: Directory reorganization.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdhost.mdp: Project file names updated by change in MD path functions.
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.Addins.mdp: Updated.
- * Mono.Addins/ExtensionContext.cs: Fixed GetExtensionObjects overload
- which was not using the correct reuseCachedInstance value.
- * Mono.Addins/ExtensionTree.cs: Improved error message. When looking
- for a type in an assembly, avoid throwing an exception too early,
- since it may be found in other assemblies.
- * Mono.Addins.Database/AddinDatabase.cs: In the addin info cache, also
- store information about unsuccessful lookups, to avoid looking for
- an add-in again if we found that it doesn't exist. In Update(),
- don't use verbose output by default.
-
-2007-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdhost.mdp: Don't copy referenced assemblies.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * src/AssemblyInfo.cs: Avoid incremental change of version.
- * src/mdhost.cs: Improved handling of exceptions while shutting down.
- * mdhost.mdp: Set target runtime to 2.0.
-
-2006-12-06 Jacob Ilsø Christensen <jacobilsoe@gmail.com>
-
- * src/mdhost.cs: Fixed a couple of compiler warnings.
-
-2006-07-25 Lluis Sanchez Gual <lluis@novell.com>
-
- * src/mdhost.cs: Don't check for required add-ins here. The main
- process will do it. Added new LoadAddins method which can be
- used by the main process to remotely load add-ins.
-
-2006-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdhost.mdp: Updated.
-
-2006-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * src/mdhost.cs: Support the Unix channel for comunication
- with the main process.
-
- * mdhost.mdp:
- * Makefile.am: Added Mono.Posix reference.
-
-2006-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdhost.mdp: Updated.
- * Makefile.am: Use an unified format. Patch by Matze Braun.
-
-2006-02-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * src/mdhost.cs: Preload add-ins required by the provided type.
-
-2005-08-08 Lluis Sanchez Gual <lluis@novell.com>
-
- * src/mdhost.cs: Use an internal tcp channel for communication with
- host. Get the host object reference from the standard input. Make
- sure the ProcessHost's lease does not expire.
diff --git a/main/src/tools/mdhost/app.config b/main/src/tools/mdhost/app.config
index 6587006f63..cc6c17c27d 100644
--- a/main/src/tools/mdhost/app.config
+++ b/main/src/tools/mdhost/app.config
@@ -6,6 +6,10 @@
<assemblyIdentity name="ICSharpCode.SharpZipLib" publicKeyToken="1b03e6acf1164f73" culture="neutral" />
<bindingRedirect oldVersion="0.84.0.0" newVersion="2.84.0.0"/>
</dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
+ <bindingRedirect oldVersion="2.0.0.0-4.3.1.0" newVersion="4.4.0.0"/>
+ </dependentAssembly>
</assemblyBinding>
</runtime>
-</configuration> \ No newline at end of file
+</configuration>
diff --git a/main/src/tools/mdmonitor/ChangeLog b/main/src/tools/mdmonitor/ChangeLog
deleted file mode 100644
index b9fa820b55..0000000000
--- a/main/src/tools/mdmonitor/ChangeLog
+++ /dev/null
@@ -1,70 +0,0 @@
-2010-05-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdmonitor.csproj: Target x86.
-
-2010-05-10 Lluis Sanchez Gual <lluis@novell.com>
-
- * Main.cs:
- * gtk-gui/gui.stetic:
- * InstrumenationChartView.cs:
- * InstrumentationViewerDialog.cs:
- * gtk-gui/Mono.Instrumentation.Monitor.InstrumentationViewerDialog.cs:
- Allow loading intrumentation service log data from a file.
-
- * TimeStatisticsView.cs: Fix warning.
-
-2010-04-29 Andrew Jorgensen <ajorgensen@novell.com>
-
- * Makefile.am: dist resources also
-
-2010-03-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * mdmonitor.csproj: Add missing reference.
-
-2010-03-18 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * ChartView.cs:
- * TimeLineView.cs:
- * mdmonitor.csproj:
- * ChartSerieInfo.cs:
- * gtk-gui/gui.stetic:
- * TimeLineViewWindow.cs:
- * TimeStatisticsView.cs:
- * InstrumenationChartView.cs:
- * InstrumentationViewerDialog.cs:
- * gtk-gui/Mono.Instrumentation.Monitor.TimeStatisticsView.cs:
- * gtk-gui/Mono.Instrumentation.Monitor.InstrumenationChartView.cs:
- * gtk-gui/Mono.Instrumentation.Monitor.InstrumentationViewerDialog.cs:
- Added timer statistics view.
-
-2010-03-17 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am:
- * mdmonitor.csproj:
- * gtk-gui/gui.stetic: Merged MD.Projects into MD.Core, and
- MD.Projects.Gui, MD.Core.Gui and MD.Components into MD.Ide.
-
-2010-03-16 Lluis Sanchez Gual <lluis@novell.com>
-
- * gtk-gui:
- * Main.cs:
- * Makefile.am:
- * NewProfile.cs:
- * AssemblyInfo.cs:
- * TimeLineView.cs:
- * mdmonitor.csproj:
- * gtk-gui/gui.stetic:
- * gtk-gui/generated.cs:
- * TimeLineViewWindow.cs:
- * CounterSelectorDialog.cs:
- * InstrumenationChartView.cs:
- * InstrumentationViewerDialog.cs:
- * gtk-gui/Mono.Instrumentation.Monitor.NewProfile.cs:
- * gtk-gui/Mono.Instrumentation.Monitor.TimeLineViewWindow.cs:
- * gtk-gui/Mono.Instrumentation.Monitor.CounterSelectorDialog.cs:
- * gtk-gui/Mono.Instrumentation.Monitor.InstrumenationChartView.cs:
- * gtk-gui/Mono.Instrumentation.Monitor.InstrumentationViewerDialog.cs:
- Added new instrumentation monitor tool.
-
diff --git a/main/src/tools/mdmonitor/InstrumenationChartView.cs b/main/src/tools/mdmonitor/InstrumenationChartView.cs
deleted file mode 100644
index 0aab4edea5..0000000000
--- a/main/src/tools/mdmonitor/InstrumenationChartView.cs
+++ /dev/null
@@ -1,547 +0,0 @@
-//
-// InstrumenationChartView.cs
-//
-// Author:
-// Lluis Sanchez Gual <lluis@novell.com>
-//
-// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Linq;
-using System.Collections.Generic;
-using MonoDevelop.Core.Instrumentation;
-using MonoDevelop.Core.Serialization;
-using MonoDevelop.Components.Chart;
-using Gtk;
-using System.Globalization;
-
-namespace Mono.Instrumentation.Monitor
-{
- [System.ComponentModel.ToolboxItem(true)]
- internal partial class InstrumenationChartView : Gtk.Bin
- {
- InstrumentationViewerDialog parent;
- ListStore seriesStore;
- ChartView view = new ChartView ();
- ChartView originalView;
-
- ListStore listViewStore;
- TreeView listView;
- ScrolledWindow listViewScrolled;
-
- BasicChart countChart;
- BasicChart timeChart;
- DateTime startTime;
- DateTime endTime;
-
- DateTimeAxis countAxisX;
- IntegerAxis countAxisY;
- DateTimeAxis timeAxisX;
- IntegerAxis timeAxisY;
-
- TimeSpan visibleTime = TimeSpan.FromMinutes (5);
-
- List<Serie> currentSeries = new List<Serie> ();
-
- public InstrumenationChartView (InstrumentationViewerDialog parent)
- {
- Build ();
-
- this.parent = parent;
-
- // The list for the List Mode
-
- listViewStore = new ListStore (typeof(ListViewValueInfo), typeof(Gdk.Pixbuf), typeof (string), typeof(string), typeof(string), typeof (string), typeof (string));
- listView = new TreeView ();
- listView.Model = listViewStore;
-
- CellRendererText crx = new CellRendererText ();
- listView.AppendColumn ("Timestamp", crx, "text", 3);
-
- TreeViewColumn col = new TreeViewColumn ();
- col.Title = "Counter";
- CellRendererPixbuf crp = new CellRendererPixbuf ();
- col.PackStart (crp, false);
- col.AddAttribute (crp, "pixbuf", 1);
- col.PackStart (crx, true);
- col.AddAttribute (crx, "text", 2);
- listView.AppendColumn (col);
-
- listView.AppendColumn ("Count", crx, "text", 4);
- listView.AppendColumn ("Total Count", crx, "text", 5);
- listView.AppendColumn ("Time", crx, "text", 6);
-
- listView.RowActivated += HandleListViewRowActivated;
-
- listViewScrolled = new ScrolledWindow ();
- listViewScrolled.Add (listView);
- listViewScrolled.ShadowType = ShadowType.In;
- listViewScrolled.HscrollbarPolicy = PolicyType.Automatic;
- listViewScrolled.VscrollbarPolicy = PolicyType.Automatic;
- listViewScrolled.ShowAll ();
- boxCharts.PackStart (listViewScrolled, true, true, 0);
-
- // The series list
-
- seriesStore = new ListStore (typeof(bool), typeof(Gdk.Pixbuf), typeof (string), typeof(ChartSerieInfo), typeof(String), typeof(String), typeof (String));
- listSeries.Model = seriesStore;
-
- col = new TreeViewColumn ();
- col.Title = "Counter";
- CellRendererToggle crt = new CellRendererToggle ();
- col.PackStart (crt, false);
- col.AddAttribute (crt, "active", 0);
-
- crp = new CellRendererPixbuf ();
- col.PackStart (crp, false);
- col.AddAttribute (crp, "pixbuf", 1);
-
- crx = new CellRendererText ();
- col.PackStart (crx, true);
- col.AddAttribute (crx, "text", 2);
- listSeries.AppendColumn (col);
-
- listSeries.AppendColumn ("Last", crx, "text", 4);
- listSeries.AppendColumn ("Sel", crx, "text", 5);
- listSeries.AppendColumn ("Diff", crx, "text", 6);
-
- crt.Toggled += SerieToggled;
-
- countChart = new BasicChart ();
- countAxisY = new IntegerAxis (true);
- countAxisX = new DateTimeAxis (true);
- countChart.AddAxis (countAxisX, AxisPosition.Bottom);
- countChart.AddAxis (countAxisY, AxisPosition.Right);
- countChart.OriginY = 0;
- countChart.StartY = 0;
-// countChart.EndY = 100;
- countChart.AllowSelection = true;
- countChart.SetAutoScale (AxisDimension.Y, false, true);
- countChart.SelectionStart.LabelAxis = countAxisX;
- countChart.SelectionEnd.LabelAxis = countAxisX;
- countChart.SelectionChanged += CountChartSelectionChanged;
-
- timeChart = new BasicChart ();
- timeAxisY = new IntegerAxis (true);
- timeAxisX = new DateTimeAxis (true);
- timeChart.AddAxis (timeAxisX, AxisPosition.Bottom);
- timeChart.AddAxis (timeAxisY, AxisPosition.Right);
- timeChart.OriginY = 0;
- timeChart.StartY = 0;
- timeChart.EndY = 100;
- timeChart.AllowSelection = true;
-// timeChart.SetAutoScale (AxisDimension.Y, true, true);
- timeChart.SelectionStart.LabelAxis = timeAxisX;
- timeChart.SelectionEnd.LabelAxis = timeAxisX;
-
- frameCharts.PackStart (countChart, true, true, 0);
- frameCharts.PackStart (timeChart, true, true, 0);
- frameCharts.ShowAll ();
-
- if (App.FromFile) {
- if (visibleTime > App.Service.EndTime - App.Service.StartTime)
- visibleTime = App.Service.EndTime - App.Service.StartTime;
- startTime = App.Service.StartTime;
- endTime = startTime + visibleTime;
- }
- else {
- endTime = DateTime.Now;
- startTime = endTime - visibleTime;
- }
-
- DateTime st = App.Service.StartTime;
- if (st > startTime) st = startTime;
-
- chartScroller.Adjustment.Lower = st.Ticks;
-
- UpdateCharts ();
- chartScroller.Value = chartScroller.Adjustment.Upper;
-
- if (!App.FromFile)
- StartAutoscroll ();
-
- toggleTimeView.Active = true;
- }
-
- public void ShowAllTimers ()
- {
- hboxChartBar.Visible = hboxSeriesBar.Visible = false;
-
- view = new ChartView ();
- foreach (Counter c in App.Service.GetCounters ()) {
- if (c is TimerCounter)
- view.Add (c);
- }
-
- FillSelectedSeries ();
- toggleListView.Active = true;
- }
-
- void HandleListViewRowActivated (object o, RowActivatedArgs args)
- {
- TreeIter sel;
- if (!listView.Selection.GetSelected (out sel))
- return;
- ListViewValueInfo vinfo = (ListViewValueInfo) listViewStore.GetValue (sel, 0);
- if (vinfo.Value.HasTimerTraces) {
- TimeLineViewWindow win = new TimeLineViewWindow (vinfo.Serie.Counter, vinfo.Value);
- win.Show ();
- }
- }
-
- void CountChartSelectionChanged (object sender, EventArgs e)
- {
- UpdateListValues ();
- }
-
- void FillSelectedSeries ()
- {
- seriesStore.Clear ();
- foreach (ChartSerieInfo si in view.Series)
- seriesStore.AppendValues (si.Visible, si.ColorIcon, si.Name, si, "", "", "");
- }
-
- void SerieToggled (object o, ToggledArgs args)
- {
- TreeIter it;
- if (seriesStore.GetIterFromString (out it, args.Path)) {
- bool val = !(bool) seriesStore.GetValue (it, 0);
- seriesStore.SetValue (it, 0, val);
- ChartSerieInfo c = (ChartSerieInfo) seriesStore.GetValue (it, 3);
- if (c != null) {
- view.SetVisible (c, val);
- UpdateButtonStatus ();
- if (listViewScrolled.Visible)
- FillValuesList ();
- }
- }
- }
-
- void UpdateButtonStatus ()
- {
- parent.EnableSave (view.Modified);
- }
-
- void UpdateCharts ()
- {
- listViewScrolled.Visible = !toggleTimeView.Active;
- frameCharts.Visible = toggleTimeView.Active;
-
- if (frameCharts.Visible) {
- timeChart.Visible = false;
- countChart.Visible = true;
-
- foreach (Serie s in currentSeries) {
- countChart.RemoveSerie (s);
- timeChart.RemoveSerie (s);
- }
-
- UpdateCharView ();
-
- foreach (ChartSerieInfo si in view.Series) {
- si.UpdateSerie ();
- countChart.AddSerie (si.Serie);
- currentSeries.Add (si.Serie);
- }
-
- DateTime t = DateTime.Now;
- chartScroller.Adjustment.Upper = t.Ticks;
- UpdatePageSize ();
- }
- else if (listViewScrolled.Visible) {
- FillValuesList ();
- }
- }
-
- void FillValuesList ()
- {
- listViewStore.Clear ();
- List<ListViewValueInfo> values = new List<ListViewValueInfo> ();
-
- foreach (var serie in view.Series.Where (s => s.Visible)) {
- foreach (CounterValue val in serie.Counter.GetValues ())
- values.Add (new ListViewValueInfo () { Serie=serie, Value=val });
- }
-
- values.Sort (delegate (ListViewValueInfo v1, ListViewValueInfo v2) {
- return v1.Value.TimeStamp.CompareTo (v2.Value.TimeStamp);
- });
-
- foreach (ListViewValueInfo vinfo in values) {
- CounterValue val = vinfo.Value;
- string time = val.TimeStamp.ToLongTimeString ();
- listViewStore.AppendValues (vinfo, vinfo.Serie.ColorIcon, vinfo.Serie.Counter.Name, time, val.Value.ToString (), val.TotalCount.ToString (), val.HasTimerTraces ? val.Duration.TotalMilliseconds.ToString () : "");
- }
- }
-
- void UpdateCharView ()
- {
- countChart.StartX = startTime.Ticks;
- countChart.EndX = endTime.Ticks;
- timeChart.StartX = startTime.Ticks;
- timeChart.EndX = endTime.Ticks;
- countChart.OriginX = countChart.StartX;
- timeChart.OriginX = timeChart.StartX;
- }
-
- uint scrollFunc;
-
- void StartAutoscroll ()
- {
- scrollFunc = GLib.Timeout.Add (1000, ScrollCharts);
- }
-
- void StopAutoscroll ()
- {
- if (scrollFunc != 0) {
- GLib.Source.Remove (scrollFunc);
- scrollFunc = 0;
- }
- }
-
- bool IsShowingLatest {
- get {
- return (chartScroller.Value == chartScroller.Adjustment.Upper - chartScroller.Adjustment.PageSize);
- }
- }
-
- bool ScrollCharts ()
- {
- double ticks = DateTime.Now.Ticks;
- if (IsShowingLatest) {
- chartScroller.Adjustment.Upper = ticks;
- chartScroller.Value = chartScroller.Adjustment.Upper - chartScroller.Adjustment.PageSize;
- } else
- chartScroller.Adjustment.Upper = ticks;
-
- // If any of the counters has been disposed, update it
- foreach (ChartSerieInfo info in view.Series) {
- if (info.UpdateCounter ()) {
- UpdateCharts ();
- break;
- }
- }
- UpdateListValues ();
- view.UpdateSeries ();
- return true;
- }
-
- void UpdateListValues ()
- {
- TreeIter it;
- if (seriesStore.GetIterFirst (out it)) {
- do {
- ChartSerieInfo ci = (ChartSerieInfo) seriesStore.GetValue (it, 3);
- if (ci.Counter == null)
- continue;
- CounterValue val = ci.Counter.LastValue;
- seriesStore.SetValue (it, 4, val.Value.ToString ());
-
- if (countChart.ActiveCursor != null) {
- val = ci.Counter.GetValueAt (new DateTime ((long)countChart.ActiveCursor.Value));
- seriesStore.SetValue (it, 5, val.Value.ToString ());
- }
-
- val = ci.Counter.GetValueAt (new DateTime ((long)countChart.SelectionStart.Value));
- CounterValue val2 = ci.Counter.GetValueAt (new DateTime ((long)countChart.SelectionEnd.Value));
-
- seriesStore.SetValue (it, 6, (val2.Value - val.Value).ToString ());
- }
- while (seriesStore.IterNext (ref it));
- }
- }
-
- protected override void OnDestroyed ()
- {
- StopAutoscroll ();
- base.OnDestroyed ();
- }
-
-
- protected virtual void OnButtonOkClicked (object sender, System.EventArgs e)
- {
- Destroy ();
- }
-
- protected virtual void OnDeleteEvent (object o, Gtk.DeleteEventArgs args)
- {
- Destroy ();
- }
-
- protected virtual void OnChartScrollerValueChanged (object sender, System.EventArgs e)
- {
- startTime = new DateTime ((long)chartScroller.Value);
- endTime = startTime + visibleTime;
- UpdateCharView ();
- }
-
- void UpdatePageSize ()
- {
- chartScroller.Adjustment.PageSize = visibleTime.Ticks;
- chartScroller.Adjustment.PageIncrement = visibleTime.Ticks * 0.9;
- chartScroller.Adjustment.StepIncrement = visibleTime.Ticks * 0.1;
- }
-
- protected virtual void OnButtonZoomInClicked (object sender, System.EventArgs e)
- {
- if (countChart.SelectionStart.Value != countChart.SelectionEnd.Value) {
- startTime = new DateTime ((long)countChart.SelectionStart.Value);
- endTime = new DateTime ((long)countChart.SelectionEnd.Value);
- visibleTime = endTime - startTime;
- }
- else {
- long oldTime = visibleTime.Ticks;
- visibleTime = new TimeSpan ((long)(visibleTime.Ticks * 0.7));
- if (visibleTime < TimeSpan.FromSeconds (1))
- visibleTime = TimeSpan.FromSeconds (1);
- if (IsShowingLatest) {
- startTime = endTime - visibleTime;
- } else {
- DateTime t = new DateTime ((long)countChart.SelectionStart.Value);
- if (t > startTime && t < endTime)
- // Center to the cursor
- endTime = t + new TimeSpan (visibleTime.Ticks/2);
- else {
- long diff = oldTime - visibleTime.Ticks;
- endTime -= new TimeSpan (diff/2);
- }
- startTime = endTime - visibleTime;
- }
- }
- UpdatePageSize ();
- chartScroller.Value = startTime.Ticks;
- UpdateCharView ();
- }
-
- protected virtual void OnButtonZoomOutClicked (object sender, System.EventArgs e)
- {
- long oldTime = visibleTime.Ticks;
- visibleTime = new TimeSpan ((long)(visibleTime.Ticks * 1.4));
- if (visibleTime > TimeSpan.FromDays (2))
- visibleTime = TimeSpan.FromDays (2);
- long diff = visibleTime.Ticks - oldTime;
- endTime += new TimeSpan (diff/2);
- startTime = endTime - visibleTime;
- UpdatePageSize ();
- chartScroller.Value = startTime.Ticks;
- UpdateCharView ();
- }
-
- public void SetView (ChartView v)
- {
- originalView = v;
- view = new ChartView ();
-
- if (v.EditedView != null)
- view = v.EditedView;
- else {
- view.CopyFrom (v);
- v.EditedView = view;
- }
- FillSelectedSeries ();
- UpdateCharts ();
- UpdateButtonStatus ();
- }
-
- bool uppdatingToggles;
-
- protected virtual void OnToggleListViewToggled (object sender, System.EventArgs e)
- {
- if (uppdatingToggles)
- return;
- uppdatingToggles = true;
- if (!toggleListView.Active)
- toggleListView.Active = true;
- else
- toggleTimeView.Active = false;
- uppdatingToggles = false;
- UpdateCharts ();
- }
-
-
- protected virtual void OnToggleTimeViewToggled (object sender, System.EventArgs e)
- {
- if (uppdatingToggles)
- return;
- uppdatingToggles = true;
- if (!toggleTimeView.Active)
- toggleTimeView.Active = true;
- else
- toggleListView.Active = false;
- uppdatingToggles = false;
- UpdateCharts ();
- }
-
- public void Save ()
- {
- originalView.CopyFrom (view);
- view.Modified = false;
- parent.SaveViews ();
- UpdateButtonStatus ();
- }
-
- public void SaveAs ()
- {
- Application.Invoke (delegate {
- parent.NewView (view);
- });
- }
-
- public void Delete ()
- {
- Application.Invoke (delegate {
- parent.DeleteView (originalView);
- });
- }
-
- protected virtual void OnButtonRemoveCounterClicked (object sender, System.EventArgs e)
- {
- foreach (TreePath p in listSeries.Selection.GetSelectedRows ()) {
- TreeIter it;
- if (seriesStore.GetIter (out it, p)) {
- ChartSerieInfo s = (ChartSerieInfo) seriesStore.GetValue (it, 3);
- view.Remove (s.Counter);
- }
- }
- FillSelectedSeries ();
- }
-
- protected virtual void OnButtonAddCounterClicked (object sender, System.EventArgs e)
- {
- CounterSelectorDialog dlg = new CounterSelectorDialog ();
- dlg.TransientFor = (Gtk.Window) this.Toplevel;
- if (dlg.Run () == (int) ResponseType.Ok) {
- foreach (Counter c in dlg.Selection)
- view.Add (c);
- FillSelectedSeries ();
- UpdateCharts ();
- }
- dlg.Destroy ();
- }
- }
-
- class ListViewValueInfo
- {
- public CounterValue Value;
- public ChartSerieInfo Serie;
- }
-}
-
-
diff --git a/main/src/tools/mdmonitor/InstrumentationChartView.cs b/main/src/tools/mdmonitor/InstrumentationChartView.cs
new file mode 100644
index 0000000000..f5c2b4485b
--- /dev/null
+++ b/main/src/tools/mdmonitor/InstrumentationChartView.cs
@@ -0,0 +1,546 @@
+//
+// InstrumenationChartView.cs
+//
+// Author:
+// Lluis Sanchez Gual <lluis@novell.com>
+//
+// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using MonoDevelop.Core.Instrumentation;
+using MonoDevelop.Core.Serialization;
+using MonoDevelop.Components.Chart;
+using Gtk;
+using System.Globalization;
+
+namespace Mono.Instrumentation.Monitor
+{
+ [System.ComponentModel.ToolboxItem(true)]
+ internal partial class InstrumentationChartView : Gtk.Bin
+ {
+ InstrumentationViewerDialog parent;
+ ListStore seriesStore;
+ ChartView view = new ChartView ();
+ ChartView originalView;
+
+ ListStore listViewStore;
+ TreeView listView;
+ ScrolledWindow listViewScrolled;
+
+ BasicChart countChart;
+ BasicChart timeChart;
+ DateTime startTime;
+ DateTime endTime;
+
+ DateTimeAxis countAxisX;
+ IntegerAxis countAxisY;
+ DateTimeAxis timeAxisX;
+ IntegerAxis timeAxisY;
+
+ TimeSpan visibleTime = TimeSpan.FromMinutes (5);
+
+ List<Serie> currentSeries = new List<Serie> ();
+
+ public InstrumentationChartView (InstrumentationViewerDialog parent)
+ {
+ Build ();
+
+ this.parent = parent;
+
+ // The list for the List Mode
+
+ listViewStore = new ListStore (typeof(ListViewValueInfo), typeof(Gdk.Pixbuf), typeof (string), typeof(string), typeof(string), typeof (string), typeof (string));
+ listView = new TreeView ();
+ listView.Model = listViewStore;
+
+ CellRendererText crx = new CellRendererText ();
+ listView.AppendColumn ("Timestamp", crx, "text", 3);
+
+ TreeViewColumn col = new TreeViewColumn ();
+ col.Title = "Counter";
+ CellRendererPixbuf crp = new CellRendererPixbuf ();
+ col.PackStart (crp, false);
+ col.AddAttribute (crp, "pixbuf", 1);
+ col.PackStart (crx, true);
+ col.AddAttribute (crx, "text", 2);
+ listView.AppendColumn (col);
+
+ listView.AppendColumn ("Count", crx, "text", 4);
+ listView.AppendColumn ("Total Count", crx, "text", 5);
+ listView.AppendColumn ("Time", crx, "text", 6);
+
+ listView.RowActivated += HandleListViewRowActivated;
+
+ listViewScrolled = new ScrolledWindow ();
+ listViewScrolled.Add (listView);
+ listViewScrolled.ShadowType = ShadowType.In;
+ listViewScrolled.HscrollbarPolicy = PolicyType.Automatic;
+ listViewScrolled.VscrollbarPolicy = PolicyType.Automatic;
+ listViewScrolled.ShowAll ();
+ boxCharts.PackStart (listViewScrolled, true, true, 0);
+
+ // The series list
+
+ seriesStore = new ListStore (typeof(bool), typeof(Gdk.Pixbuf), typeof (string), typeof(ChartSerieInfo), typeof(String), typeof(String), typeof (String));
+ listSeries.Model = seriesStore;
+
+ col = new TreeViewColumn ();
+ col.Title = "Counter";
+ CellRendererToggle crt = new CellRendererToggle ();
+ col.PackStart (crt, false);
+ col.AddAttribute (crt, "active", 0);
+
+ crp = new CellRendererPixbuf ();
+ col.PackStart (crp, false);
+ col.AddAttribute (crp, "pixbuf", 1);
+
+ crx = new CellRendererText ();
+ col.PackStart (crx, true);
+ col.AddAttribute (crx, "text", 2);
+ listSeries.AppendColumn (col);
+
+ listSeries.AppendColumn ("Last", crx, "text", 4);
+ listSeries.AppendColumn ("Sel", crx, "text", 5);
+ listSeries.AppendColumn ("Diff", crx, "text", 6);
+
+ crt.Toggled += SerieToggled;
+
+ countChart = new BasicChart ();
+ countAxisY = new IntegerAxis (true);
+ countAxisX = new DateTimeAxis (true);
+ countChart.AddAxis (countAxisX, AxisPosition.Bottom);
+ countChart.AddAxis (countAxisY, AxisPosition.Right);
+ countChart.OriginY = 0;
+ countChart.StartY = 0;
+// countChart.EndY = 100;
+ countChart.AllowSelection = true;
+ countChart.SetAutoScale (AxisDimension.Y, false, true);
+ countChart.SelectionStart.LabelAxis = countAxisX;
+ countChart.SelectionEnd.LabelAxis = countAxisX;
+ countChart.SelectionChanged += CountChartSelectionChanged;
+
+ timeChart = new BasicChart ();
+ timeAxisY = new IntegerAxis (true);
+ timeAxisX = new DateTimeAxis (true);
+ timeChart.AddAxis (timeAxisX, AxisPosition.Bottom);
+ timeChart.AddAxis (timeAxisY, AxisPosition.Right);
+ timeChart.OriginY = 0;
+ timeChart.StartY = 0;
+ timeChart.EndY = 100;
+ timeChart.AllowSelection = true;
+// timeChart.SetAutoScale (AxisDimension.Y, true, true);
+ timeChart.SelectionStart.LabelAxis = timeAxisX;
+ timeChart.SelectionEnd.LabelAxis = timeAxisX;
+
+ frameCharts.PackStart (countChart, true, true, 0);
+ frameCharts.PackStart (timeChart, true, true, 0);
+ frameCharts.ShowAll ();
+
+ if (App.FromFile) {
+ if (visibleTime > App.Service.EndTime - App.Service.StartTime)
+ visibleTime = App.Service.EndTime - App.Service.StartTime;
+ startTime = App.Service.StartTime;
+ endTime = startTime + visibleTime;
+ }
+ else {
+ endTime = DateTime.Now;
+ startTime = endTime - visibleTime;
+ }
+
+ DateTime st = App.Service.StartTime;
+ if (st > startTime) st = startTime;
+
+ chartScroller.Adjustment.Lower = st.Ticks;
+
+ UpdateCharts ();
+ chartScroller.Value = chartScroller.Adjustment.Upper;
+
+ if (!App.FromFile)
+ StartAutoscroll ();
+
+ toggleTimeView.Active = true;
+ }
+
+ public void ShowAllTimers ()
+ {
+ hboxChartBar.Visible = hboxSeriesBar.Visible = false;
+
+ view = new ChartView ();
+ foreach (Counter c in App.Service.GetCounters ()) {
+ if (c is TimerCounter)
+ view.Add (c);
+ }
+
+ FillSelectedSeries ();
+ toggleListView.Active = true;
+ }
+
+ void HandleListViewRowActivated (object o, RowActivatedArgs args)
+ {
+ TreeIter sel;
+ if (!listView.Selection.GetSelected (out sel))
+ return;
+ ListViewValueInfo vinfo = (ListViewValueInfo) listViewStore.GetValue (sel, 0);
+ if (vinfo.Value.HasTimerTraces) {
+ TimeLineViewWindow win = new TimeLineViewWindow (vinfo.Serie.Counter, vinfo.Value);
+ win.Show ();
+ }
+ }
+
+ void CountChartSelectionChanged (object sender, EventArgs e)
+ {
+ UpdateListValues ();
+ }
+
+ void FillSelectedSeries ()
+ {
+ seriesStore.Clear ();
+ foreach (ChartSerieInfo si in view.Series)
+ seriesStore.AppendValues (si.Visible, si.ColorIcon, si.Name, si, "", "", "");
+ }
+
+ void SerieToggled (object o, ToggledArgs args)
+ {
+ TreeIter it;
+ if (seriesStore.GetIterFromString (out it, args.Path)) {
+ bool val = !(bool) seriesStore.GetValue (it, 0);
+ seriesStore.SetValue (it, 0, val);
+ ChartSerieInfo c = (ChartSerieInfo) seriesStore.GetValue (it, 3);
+ if (c != null) {
+ view.SetVisible (c, val);
+ UpdateButtonStatus ();
+ if (listViewScrolled.Visible)
+ FillValuesList ();
+ }
+ }
+ }
+
+ void UpdateButtonStatus ()
+ {
+ parent.EnableSave (view.Modified);
+ }
+
+ void UpdateCharts ()
+ {
+ listViewScrolled.Visible = !toggleTimeView.Active;
+ frameCharts.Visible = toggleTimeView.Active;
+
+ if (frameCharts.Visible) {
+ var timeWidget = timeChart.GetNativeWidget<Widget> ();
+ timeWidget.Visible = false;
+ var countWidget = countChart.GetNativeWidget<Widget> ();
+ countWidget.Visible = true;
+ foreach (Serie s in currentSeries) {
+ countChart.RemoveSerie (s);
+ timeChart.RemoveSerie (s);
+ }
+
+ UpdateCharView ();
+
+ foreach (ChartSerieInfo si in view.Series) {
+ si.UpdateSerie ();
+ countChart.AddSerie (si.Serie);
+ currentSeries.Add (si.Serie);
+ }
+
+ DateTime t = DateTime.Now;
+ chartScroller.Adjustment.Upper = t.Ticks;
+ UpdatePageSize ();
+ }
+ else if (listViewScrolled.Visible) {
+ FillValuesList ();
+ }
+ }
+
+ void FillValuesList ()
+ {
+ listViewStore.Clear ();
+ List<ListViewValueInfo> values = new List<ListViewValueInfo> ();
+
+ foreach (var serie in view.Series.Where (s => s.Visible)) {
+ foreach (CounterValue val in serie.Counter.GetValues ())
+ values.Add (new ListViewValueInfo () { Serie=serie, Value=val });
+ }
+
+ values.Sort (delegate (ListViewValueInfo v1, ListViewValueInfo v2) {
+ return v1.Value.TimeStamp.CompareTo (v2.Value.TimeStamp);
+ });
+
+ foreach (ListViewValueInfo vinfo in values) {
+ CounterValue val = vinfo.Value;
+ string time = val.TimeStamp.ToLongTimeString ();
+ listViewStore.AppendValues (vinfo, vinfo.Serie.ColorIcon, vinfo.Serie.Counter.Name, time, val.Value.ToString (), val.TotalCount.ToString (), val.HasTimerTraces ? val.Duration.TotalMilliseconds.ToString () : "");
+ }
+ }
+
+ void UpdateCharView ()
+ {
+ countChart.StartX = startTime.Ticks;
+ countChart.EndX = endTime.Ticks;
+ timeChart.StartX = startTime.Ticks;
+ timeChart.EndX = endTime.Ticks;
+ countChart.OriginX = countChart.StartX;
+ timeChart.OriginX = timeChart.StartX;
+ }
+
+ uint scrollFunc;
+
+ void StartAutoscroll ()
+ {
+ scrollFunc = GLib.Timeout.Add (1000, ScrollCharts);
+ }
+
+ void StopAutoscroll ()
+ {
+ if (scrollFunc != 0) {
+ GLib.Source.Remove (scrollFunc);
+ scrollFunc = 0;
+ }
+ }
+
+ bool IsShowingLatest {
+ get {
+ return (chartScroller.Value == chartScroller.Adjustment.Upper - chartScroller.Adjustment.PageSize);
+ }
+ }
+
+ bool ScrollCharts ()
+ {
+ double ticks = DateTime.Now.Ticks;
+ if (IsShowingLatest) {
+ chartScroller.Adjustment.Upper = ticks;
+ chartScroller.Value = chartScroller.Adjustment.Upper - chartScroller.Adjustment.PageSize;
+ } else
+ chartScroller.Adjustment.Upper = ticks;
+
+ // If any of the counters has been disposed, update it
+ foreach (ChartSerieInfo info in view.Series) {
+ if (info.UpdateCounter ()) {
+ UpdateCharts ();
+ break;
+ }
+ }
+ UpdateListValues ();
+ view.UpdateSeries ();
+ return true;
+ }
+
+ void UpdateListValues ()
+ {
+ TreeIter it;
+ if (seriesStore.GetIterFirst (out it)) {
+ do {
+ ChartSerieInfo ci = (ChartSerieInfo) seriesStore.GetValue (it, 3);
+ if (ci.Counter == null)
+ continue;
+ CounterValue val = ci.Counter.LastValue;
+ seriesStore.SetValue (it, 4, val.Value.ToString ());
+
+ if (countChart.ActiveCursor != null) {
+ val = ci.Counter.GetValueAt (new DateTime ((long)countChart.ActiveCursor.Value));
+ seriesStore.SetValue (it, 5, val.Value.ToString ());
+ }
+
+ val = ci.Counter.GetValueAt (new DateTime ((long)countChart.SelectionStart.Value));
+ CounterValue val2 = ci.Counter.GetValueAt (new DateTime ((long)countChart.SelectionEnd.Value));
+
+ seriesStore.SetValue (it, 6, (val2.Value - val.Value).ToString ());
+ }
+ while (seriesStore.IterNext (ref it));
+ }
+ }
+
+ protected override void OnDestroyed ()
+ {
+ StopAutoscroll ();
+ base.OnDestroyed ();
+ }
+
+
+ protected virtual void OnButtonOkClicked (object sender, System.EventArgs e)
+ {
+ Destroy ();
+ }
+
+ protected virtual void OnDeleteEvent (object o, Gtk.DeleteEventArgs args)
+ {
+ Destroy ();
+ }
+
+ protected virtual void OnChartScrollerValueChanged (object sender, System.EventArgs e)
+ {
+ startTime = new DateTime ((long)chartScroller.Value);
+ endTime = startTime + visibleTime;
+ UpdateCharView ();
+ }
+
+ void UpdatePageSize ()
+ {
+ chartScroller.Adjustment.PageSize = visibleTime.Ticks;
+ chartScroller.Adjustment.PageIncrement = visibleTime.Ticks * 0.9;
+ chartScroller.Adjustment.StepIncrement = visibleTime.Ticks * 0.1;
+ }
+
+ protected virtual void OnButtonZoomInClicked (object sender, System.EventArgs e)
+ {
+ if (countChart.SelectionStart.Value != countChart.SelectionEnd.Value) {
+ startTime = new DateTime ((long)countChart.SelectionStart.Value);
+ endTime = new DateTime ((long)countChart.SelectionEnd.Value);
+ visibleTime = endTime - startTime;
+ }
+ else {
+ long oldTime = visibleTime.Ticks;
+ visibleTime = new TimeSpan ((long)(visibleTime.Ticks * 0.7));
+ if (visibleTime < TimeSpan.FromSeconds (1))
+ visibleTime = TimeSpan.FromSeconds (1);
+ if (IsShowingLatest) {
+ startTime = endTime - visibleTime;
+ } else {
+ DateTime t = new DateTime ((long)countChart.SelectionStart.Value);
+ if (t > startTime && t < endTime)
+ // Center to the cursor
+ endTime = t + new TimeSpan (visibleTime.Ticks/2);
+ else {
+ long diff = oldTime - visibleTime.Ticks;
+ endTime -= new TimeSpan (diff/2);
+ }
+ startTime = endTime - visibleTime;
+ }
+ }
+ UpdatePageSize ();
+ chartScroller.Value = startTime.Ticks;
+ UpdateCharView ();
+ }
+
+ protected virtual void OnButtonZoomOutClicked (object sender, System.EventArgs e)
+ {
+ long oldTime = visibleTime.Ticks;
+ visibleTime = new TimeSpan ((long)(visibleTime.Ticks * 1.4));
+ if (visibleTime > TimeSpan.FromDays (2))
+ visibleTime = TimeSpan.FromDays (2);
+ long diff = visibleTime.Ticks - oldTime;
+ endTime += new TimeSpan (diff/2);
+ startTime = endTime - visibleTime;
+ UpdatePageSize ();
+ chartScroller.Value = startTime.Ticks;
+ UpdateCharView ();
+ }
+
+ public void SetView (ChartView v)
+ {
+ originalView = v;
+ view = new ChartView ();
+
+ if (v.EditedView != null)
+ view = v.EditedView;
+ else {
+ view.CopyFrom (v);
+ v.EditedView = view;
+ }
+ FillSelectedSeries ();
+ UpdateCharts ();
+ UpdateButtonStatus ();
+ }
+
+ bool uppdatingToggles;
+
+ protected virtual void OnToggleListViewToggled (object sender, System.EventArgs e)
+ {
+ if (uppdatingToggles)
+ return;
+ uppdatingToggles = true;
+ if (!toggleListView.Active)
+ toggleListView.Active = true;
+ else
+ toggleTimeView.Active = false;
+ uppdatingToggles = false;
+ UpdateCharts ();
+ }
+
+
+ protected virtual void OnToggleTimeViewToggled (object sender, System.EventArgs e)
+ {
+ if (uppdatingToggles)
+ return;
+ uppdatingToggles = true;
+ if (!toggleTimeView.Active)
+ toggleTimeView.Active = true;
+ else
+ toggleListView.Active = false;
+ uppdatingToggles = false;
+ UpdateCharts ();
+ }
+
+ public void Save ()
+ {
+ originalView.CopyFrom (view);
+ view.Modified = false;
+ parent.SaveViews ();
+ UpdateButtonStatus ();
+ }
+
+ public void SaveAs ()
+ {
+ Application.Invoke (delegate {
+ parent.NewView (view);
+ });
+ }
+
+ public void Delete ()
+ {
+ Application.Invoke (delegate {
+ parent.DeleteView (originalView);
+ });
+ }
+
+ protected virtual void OnButtonRemoveCounterClicked (object sender, System.EventArgs e)
+ {
+ foreach (TreePath p in listSeries.Selection.GetSelectedRows ()) {
+ TreeIter it;
+ if (seriesStore.GetIter (out it, p)) {
+ ChartSerieInfo s = (ChartSerieInfo) seriesStore.GetValue (it, 3);
+ view.Remove (s.Counter);
+ }
+ }
+ FillSelectedSeries ();
+ }
+
+ protected virtual void OnButtonAddCounterClicked (object sender, System.EventArgs e)
+ {
+ CounterSelectorDialog dlg = new CounterSelectorDialog ();
+ dlg.TransientFor = (Gtk.Window) this.Toplevel;
+ if (dlg.Run () == (int) ResponseType.Ok) {
+ foreach (Counter c in dlg.Selection)
+ view.Add (c);
+ FillSelectedSeries ();
+ UpdateCharts ();
+ }
+ dlg.Destroy ();
+ }
+ }
+
+ class ListViewValueInfo
+ {
+ public CounterValue Value;
+ public ChartSerieInfo Serie;
+ }
+}
diff --git a/main/src/tools/mdmonitor/InstrumentationViewerDialog.cs b/main/src/tools/mdmonitor/InstrumentationViewerDialog.cs
index f1e16c50e5..ecf5101a59 100644
--- a/main/src/tools/mdmonitor/InstrumentationViewerDialog.cs
+++ b/main/src/tools/mdmonitor/InstrumentationViewerDialog.cs
@@ -47,8 +47,8 @@ namespace Mono.Instrumentation.Monitor
// TreeIter iterStart;
TreeIter iterTimers;
TreeIter iterTimerStats;
- Dictionary<ChartView,InstrumenationChartView> chartWidgets = new Dictionary<ChartView, InstrumenationChartView> ();
- InstrumenationChartView timersWidget;
+ Dictionary<ChartView,InstrumentationChartView> chartWidgets = new Dictionary<ChartView, InstrumentationChartView> ();
+ InstrumentationChartView timersWidget;
public InstrumentationViewerDialog (): base ("Instrumentation Monitor")
{
@@ -194,7 +194,7 @@ namespace Mono.Instrumentation.Monitor
if (store.GetPath (it).Equals (store.GetPath (iterTimers))) {
if (timersWidget == null) {
- timersWidget = new InstrumenationChartView (this);
+ timersWidget = new InstrumentationChartView (this);
timersWidget.ShowAllTimers ();
}
SetView (timersWidget, "Timers", false);
@@ -208,9 +208,9 @@ namespace Mono.Instrumentation.Monitor
else {
ChartView v = (ChartView) store.GetValue (it, 1);
if (v != null) {
- InstrumenationChartView cv;
+ InstrumentationChartView cv;
if (!chartWidgets.TryGetValue (v, out cv)) {
- cv = new InstrumenationChartView (this);
+ cv = new InstrumentationChartView (this);
chartWidgets [v] = cv;
cv.SetView (v);
}
@@ -258,17 +258,17 @@ namespace Mono.Instrumentation.Monitor
protected virtual void OnButtonSaveClicked (object sender, System.EventArgs e)
{
- ((InstrumenationChartView)viewBox.Child).Save ();
+ ((InstrumentationChartView)viewBox.Child).Save ();
}
protected virtual void OnButtonSaveAsClicked (object sender, System.EventArgs e)
{
- ((InstrumenationChartView)viewBox.Child).SaveAs ();
+ ((InstrumentationChartView)viewBox.Child).SaveAs ();
}
protected virtual void OnButtonDeleteClicked (object sender, System.EventArgs e)
{
- ((InstrumenationChartView)viewBox.Child).Delete ();
+ ((InstrumentationChartView)viewBox.Child).Delete ();
}
protected virtual void OnFlushMemoryActionActivated (object sender, System.EventArgs e)
diff --git a/main/src/tools/mdmonitor/TimeLineView.cs b/main/src/tools/mdmonitor/TimeLineView.cs
index cac59f3169..613d5386e2 100644
--- a/main/src/tools/mdmonitor/TimeLineView.cs
+++ b/main/src/tools/mdmonitor/TimeLineView.cs
@@ -368,7 +368,7 @@ namespace Mono.Instrumentation.Monitor
ctx.NewPath ();
ctx.Rectangle (markerX, ytop + baseTime + 0.5, MarkerWidth/2, ((mainValue.Duration.TotalMilliseconds * scale) / 1000));
- Mono.TextEditor.HslColor hsl = Style.Foreground (Gtk.StateType.Normal);
+ HslColor hsl = Style.Foreground (Gtk.StateType.Normal);
hsl.L = 0.8;
ctx.SetSourceColor (hsl);
ctx.Fill ();
@@ -465,7 +465,7 @@ namespace Mono.Instrumentation.Monitor
ctx.NewPath ();
double dx = val == focusedValue ? 0 : 2;
ctx.Rectangle (lx + 0.5 + dx - SelectedValuePadding, ytime + 0.5, LineEndWidth - dx*2 + SelectedValuePadding, ((val.Duration.TotalMilliseconds * scale) / 1000));
- Mono.TextEditor.HslColor hsl = color;
+ HslColor hsl = color;
hsl.L = val == focusedValue ? 0.9 : 0.8;
ctx.SetSourceColor (hsl);
ctx.Fill ();
diff --git a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumenationChartView.cs b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumenationChartView.cs
deleted file mode 100644
index 05dd0d25aa..0000000000
--- a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumenationChartView.cs
+++ /dev/null
@@ -1,215 +0,0 @@
-
-// This file has been generated by the GUI designer. Do not modify.
-namespace Mono.Instrumentation.Monitor
-{
- internal partial class InstrumenationChartView
- {
- private global::Gtk.VBox vbox3;
- private global::Gtk.HPaned hpaned2;
- private global::Gtk.HBox hbox4;
- private global::Gtk.VBox boxCharts;
- private global::Gtk.HBox hboxChartBar;
- private global::Gtk.ToggleButton toggleTimeView;
- private global::Gtk.ToggleButton toggleListView;
- private global::Gtk.Button buttonZoomOut;
- private global::Gtk.Button buttonZoomIn;
- private global::Gtk.VBox frameCharts;
- private global::Gtk.HScrollbar chartScroller;
- private global::Gtk.VBox vbox5;
- private global::Gtk.HBox hboxSeriesBar;
- private global::Gtk.Button buttonRemoveCounter;
- private global::Gtk.Button buttonAddCounter;
- private global::Gtk.ScrolledWindow GtkScrolledWindow1;
- private global::Gtk.TreeView listSeries;
-
- protected virtual void Build ()
- {
- global::Stetic.Gui.Initialize (this);
- // Widget Mono.Instrumentation.Monitor.InstrumenationChartView
- global::Stetic.BinContainer.Attach (this);
- this.Name = "Mono.Instrumentation.Monitor.InstrumenationChartView";
- // Container child Mono.Instrumentation.Monitor.InstrumenationChartView.Gtk.Container+ContainerChild
- this.vbox3 = new global::Gtk.VBox ();
- this.vbox3.Name = "vbox3";
- this.vbox3.Spacing = 6;
- // Container child vbox3.Gtk.Box+BoxChild
- this.hpaned2 = new global::Gtk.HPaned ();
- this.hpaned2.CanFocus = true;
- this.hpaned2.Name = "hpaned2";
- this.hpaned2.Position = 471;
- // Container child hpaned2.Gtk.Paned+PanedChild
- this.hbox4 = new global::Gtk.HBox ();
- this.hbox4.Name = "hbox4";
- this.hbox4.Spacing = 6;
- // Container child hbox4.Gtk.Box+BoxChild
- this.boxCharts = new global::Gtk.VBox ();
- this.boxCharts.Name = "boxCharts";
- this.boxCharts.Spacing = 6;
- // Container child boxCharts.Gtk.Box+BoxChild
- this.hboxChartBar = new global::Gtk.HBox ();
- this.hboxChartBar.Name = "hboxChartBar";
- this.hboxChartBar.Spacing = 6;
- // Container child hboxChartBar.Gtk.Box+BoxChild
- this.toggleTimeView = new global::Gtk.ToggleButton ();
- this.toggleTimeView.CanFocus = true;
- this.toggleTimeView.Name = "toggleTimeView";
- this.toggleTimeView.UseUnderline = true;
- this.toggleTimeView.Relief = ((global::Gtk.ReliefStyle)(2));
- this.toggleTimeView.Label = global::Mono.Unix.Catalog.GetString ("Time View");
- this.hboxChartBar.Add (this.toggleTimeView);
- global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.hboxChartBar [this.toggleTimeView]));
- w1.Position = 0;
- w1.Expand = false;
- w1.Fill = false;
- // Container child hboxChartBar.Gtk.Box+BoxChild
- this.toggleListView = new global::Gtk.ToggleButton ();
- this.toggleListView.CanFocus = true;
- this.toggleListView.Name = "toggleListView";
- this.toggleListView.UseUnderline = true;
- this.toggleListView.Relief = ((global::Gtk.ReliefStyle)(2));
- this.toggleListView.Label = global::Mono.Unix.Catalog.GetString ("List View");
- this.hboxChartBar.Add (this.toggleListView);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hboxChartBar [this.toggleListView]));
- w2.Position = 1;
- w2.Expand = false;
- w2.Fill = false;
- // Container child hboxChartBar.Gtk.Box+BoxChild
- this.buttonZoomOut = new global::Gtk.Button ();
- this.buttonZoomOut.CanFocus = true;
- this.buttonZoomOut.Name = "buttonZoomOut";
- this.buttonZoomOut.UseUnderline = true;
- this.buttonZoomOut.Relief = ((global::Gtk.ReliefStyle)(2));
- this.buttonZoomOut.Label = "";
- global::Gtk.Image w3 = new global::Gtk.Image ();
- w3.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-zoom-out", global::Gtk.IconSize.Menu);
- this.buttonZoomOut.Image = w3;
- this.hboxChartBar.Add (this.buttonZoomOut);
- global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hboxChartBar [this.buttonZoomOut]));
- w4.PackType = ((global::Gtk.PackType)(1));
- w4.Position = 2;
- w4.Expand = false;
- w4.Fill = false;
- // Container child hboxChartBar.Gtk.Box+BoxChild
- this.buttonZoomIn = new global::Gtk.Button ();
- this.buttonZoomIn.CanFocus = true;
- this.buttonZoomIn.Name = "buttonZoomIn";
- this.buttonZoomIn.UseUnderline = true;
- this.buttonZoomIn.Relief = ((global::Gtk.ReliefStyle)(2));
- this.buttonZoomIn.Label = "";
- global::Gtk.Image w5 = new global::Gtk.Image ();
- w5.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-zoom-in", global::Gtk.IconSize.Menu);
- this.buttonZoomIn.Image = w5;
- this.hboxChartBar.Add (this.buttonZoomIn);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hboxChartBar [this.buttonZoomIn]));
- w6.PackType = ((global::Gtk.PackType)(1));
- w6.Position = 3;
- w6.Expand = false;
- w6.Fill = false;
- this.boxCharts.Add (this.hboxChartBar);
- global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.boxCharts [this.hboxChartBar]));
- w7.Position = 0;
- w7.Expand = false;
- w7.Fill = false;
- // Container child boxCharts.Gtk.Box+BoxChild
- this.frameCharts = new global::Gtk.VBox ();
- this.frameCharts.Name = "frameCharts";
- this.frameCharts.Spacing = 6;
- // Container child frameCharts.Gtk.Box+BoxChild
- this.chartScroller = new global::Gtk.HScrollbar (null);
- this.chartScroller.Name = "chartScroller";
- this.chartScroller.Adjustment.Upper = 100;
- this.chartScroller.Adjustment.PageIncrement = 10;
- this.chartScroller.Adjustment.PageSize = 10;
- this.chartScroller.Adjustment.StepIncrement = 1;
- this.frameCharts.Add (this.chartScroller);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.frameCharts [this.chartScroller]));
- w8.PackType = ((global::Gtk.PackType)(1));
- w8.Position = 2;
- w8.Expand = false;
- w8.Fill = false;
- this.boxCharts.Add (this.frameCharts);
- global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.boxCharts [this.frameCharts]));
- w9.Position = 1;
- this.hbox4.Add (this.boxCharts);
- global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.boxCharts]));
- w10.Position = 0;
- this.hpaned2.Add (this.hbox4);
- global::Gtk.Paned.PanedChild w11 = ((global::Gtk.Paned.PanedChild)(this.hpaned2 [this.hbox4]));
- w11.Resize = false;
- // Container child hpaned2.Gtk.Paned+PanedChild
- this.vbox5 = new global::Gtk.VBox ();
- this.vbox5.Name = "vbox5";
- this.vbox5.Spacing = 6;
- // Container child vbox5.Gtk.Box+BoxChild
- this.hboxSeriesBar = new global::Gtk.HBox ();
- this.hboxSeriesBar.Name = "hboxSeriesBar";
- this.hboxSeriesBar.Spacing = 6;
- // Container child hboxSeriesBar.Gtk.Box+BoxChild
- this.buttonRemoveCounter = new global::Gtk.Button ();
- this.buttonRemoveCounter.CanFocus = true;
- this.buttonRemoveCounter.Name = "buttonRemoveCounter";
- this.buttonRemoveCounter.UseStock = true;
- this.buttonRemoveCounter.UseUnderline = true;
- this.buttonRemoveCounter.Relief = ((global::Gtk.ReliefStyle)(2));
- this.buttonRemoveCounter.Label = "gtk-remove";
- this.hboxSeriesBar.Add (this.buttonRemoveCounter);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hboxSeriesBar [this.buttonRemoveCounter]));
- w12.PackType = ((global::Gtk.PackType)(1));
- w12.Position = 0;
- w12.Expand = false;
- w12.Fill = false;
- // Container child hboxSeriesBar.Gtk.Box+BoxChild
- this.buttonAddCounter = new global::Gtk.Button ();
- this.buttonAddCounter.CanFocus = true;
- this.buttonAddCounter.Name = "buttonAddCounter";
- this.buttonAddCounter.UseStock = true;
- this.buttonAddCounter.UseUnderline = true;
- this.buttonAddCounter.Relief = ((global::Gtk.ReliefStyle)(2));
- this.buttonAddCounter.Label = "gtk-add";
- this.hboxSeriesBar.Add (this.buttonAddCounter);
- global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.hboxSeriesBar [this.buttonAddCounter]));
- w13.PackType = ((global::Gtk.PackType)(1));
- w13.Position = 1;
- w13.Expand = false;
- w13.Fill = false;
- this.vbox5.Add (this.hboxSeriesBar);
- global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hboxSeriesBar]));
- w14.Position = 0;
- w14.Expand = false;
- w14.Fill = false;
- // Container child vbox5.Gtk.Box+BoxChild
- this.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow ();
- this.GtkScrolledWindow1.Name = "GtkScrolledWindow1";
- this.GtkScrolledWindow1.ShadowType = ((global::Gtk.ShadowType)(1));
- // Container child GtkScrolledWindow1.Gtk.Container+ContainerChild
- this.listSeries = new global::Gtk.TreeView ();
- this.listSeries.WidthRequest = 100;
- this.listSeries.CanFocus = true;
- this.listSeries.Name = "listSeries";
- this.listSeries.HeadersVisible = false;
- this.GtkScrolledWindow1.Add (this.listSeries);
- this.vbox5.Add (this.GtkScrolledWindow1);
- global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.GtkScrolledWindow1]));
- w16.Position = 1;
- this.hpaned2.Add (this.vbox5);
- global::Gtk.Paned.PanedChild w17 = ((global::Gtk.Paned.PanedChild)(this.hpaned2 [this.vbox5]));
- w17.Resize = false;
- w17.Shrink = false;
- this.vbox3.Add (this.hpaned2);
- global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hpaned2]));
- w18.Position = 0;
- this.Add (this.vbox3);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
- }
- this.Hide ();
- this.toggleTimeView.Toggled += new global::System.EventHandler (this.OnToggleTimeViewToggled);
- this.toggleListView.Toggled += new global::System.EventHandler (this.OnToggleListViewToggled);
- this.buttonZoomIn.Clicked += new global::System.EventHandler (this.OnButtonZoomInClicked);
- this.buttonZoomOut.Clicked += new global::System.EventHandler (this.OnButtonZoomOutClicked);
- this.chartScroller.ValueChanged += new global::System.EventHandler (this.OnChartScrollerValueChanged);
- this.buttonAddCounter.Clicked += new global::System.EventHandler (this.OnButtonAddCounterClicked);
- this.buttonRemoveCounter.Clicked += new global::System.EventHandler (this.OnButtonRemoveCounterClicked);
- }
- }
-}
diff --git a/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationChartView.cs b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationChartView.cs
new file mode 100644
index 0000000000..288c1812fa
--- /dev/null
+++ b/main/src/tools/mdmonitor/gtk-gui/Mono.Instrumentation.Monitor.InstrumentationChartView.cs
@@ -0,0 +1,215 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace Mono.Instrumentation.Monitor
+{
+ internal partial class InstrumentationChartView
+ {
+ private global::Gtk.VBox vbox3;
+ private global::Gtk.HPaned hpaned2;
+ private global::Gtk.HBox hbox4;
+ private global::Gtk.VBox boxCharts;
+ private global::Gtk.HBox hboxChartBar;
+ private global::Gtk.ToggleButton toggleTimeView;
+ private global::Gtk.ToggleButton toggleListView;
+ private global::Gtk.Button buttonZoomOut;
+ private global::Gtk.Button buttonZoomIn;
+ private global::Gtk.VBox frameCharts;
+ private global::Gtk.HScrollbar chartScroller;
+ private global::Gtk.VBox vbox5;
+ private global::Gtk.HBox hboxSeriesBar;
+ private global::Gtk.Button buttonRemoveCounter;
+ private global::Gtk.Button buttonAddCounter;
+ private global::Gtk.ScrolledWindow GtkScrolledWindow1;
+ private global::Gtk.TreeView listSeries;
+
+ protected virtual void Build ()
+ {
+ global::Stetic.Gui.Initialize (this);
+ // Widget Mono.Instrumentation.Monitor.InstrumenationChartView
+ global::Stetic.BinContainer.Attach (this);
+ this.Name = "Mono.Instrumentation.Monitor.InstrumenationChartView";
+ // Container child Mono.Instrumentation.Monitor.InstrumenationChartView.Gtk.Container+ContainerChild
+ this.vbox3 = new global::Gtk.VBox ();
+ this.vbox3.Name = "vbox3";
+ this.vbox3.Spacing = 6;
+ // Container child vbox3.Gtk.Box+BoxChild
+ this.hpaned2 = new global::Gtk.HPaned ();
+ this.hpaned2.CanFocus = true;
+ this.hpaned2.Name = "hpaned2";
+ this.hpaned2.Position = 471;
+ // Container child hpaned2.Gtk.Paned+PanedChild
+ this.hbox4 = new global::Gtk.HBox ();
+ this.hbox4.Name = "hbox4";
+ this.hbox4.Spacing = 6;
+ // Container child hbox4.Gtk.Box+BoxChild
+ this.boxCharts = new global::Gtk.VBox ();
+ this.boxCharts.Name = "boxCharts";
+ this.boxCharts.Spacing = 6;
+ // Container child boxCharts.Gtk.Box+BoxChild
+ this.hboxChartBar = new global::Gtk.HBox ();
+ this.hboxChartBar.Name = "hboxChartBar";
+ this.hboxChartBar.Spacing = 6;
+ // Container child hboxChartBar.Gtk.Box+BoxChild
+ this.toggleTimeView = new global::Gtk.ToggleButton ();
+ this.toggleTimeView.CanFocus = true;
+ this.toggleTimeView.Name = "toggleTimeView";
+ this.toggleTimeView.UseUnderline = true;
+ this.toggleTimeView.Relief = ((global::Gtk.ReliefStyle)(2));
+ this.toggleTimeView.Label = global::Mono.Unix.Catalog.GetString ("Time View");
+ this.hboxChartBar.Add (this.toggleTimeView);
+ global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.hboxChartBar [this.toggleTimeView]));
+ w1.Position = 0;
+ w1.Expand = false;
+ w1.Fill = false;
+ // Container child hboxChartBar.Gtk.Box+BoxChild
+ this.toggleListView = new global::Gtk.ToggleButton ();
+ this.toggleListView.CanFocus = true;
+ this.toggleListView.Name = "toggleListView";
+ this.toggleListView.UseUnderline = true;
+ this.toggleListView.Relief = ((global::Gtk.ReliefStyle)(2));
+ this.toggleListView.Label = global::Mono.Unix.Catalog.GetString ("List View");
+ this.hboxChartBar.Add (this.toggleListView);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hboxChartBar [this.toggleListView]));
+ w2.Position = 1;
+ w2.Expand = false;
+ w2.Fill = false;
+ // Container child hboxChartBar.Gtk.Box+BoxChild
+ this.buttonZoomOut = new global::Gtk.Button ();
+ this.buttonZoomOut.CanFocus = true;
+ this.buttonZoomOut.Name = "buttonZoomOut";
+ this.buttonZoomOut.UseUnderline = true;
+ this.buttonZoomOut.Relief = ((global::Gtk.ReliefStyle)(2));
+ this.buttonZoomOut.Label = "";
+ global::Gtk.Image w3 = new global::Gtk.Image ();
+ w3.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-zoom-out", global::Gtk.IconSize.Menu);
+ this.buttonZoomOut.Image = w3;
+ this.hboxChartBar.Add (this.buttonZoomOut);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hboxChartBar [this.buttonZoomOut]));
+ w4.PackType = ((global::Gtk.PackType)(1));
+ w4.Position = 2;
+ w4.Expand = false;
+ w4.Fill = false;
+ // Container child hboxChartBar.Gtk.Box+BoxChild
+ this.buttonZoomIn = new global::Gtk.Button ();
+ this.buttonZoomIn.CanFocus = true;
+ this.buttonZoomIn.Name = "buttonZoomIn";
+ this.buttonZoomIn.UseUnderline = true;
+ this.buttonZoomIn.Relief = ((global::Gtk.ReliefStyle)(2));
+ this.buttonZoomIn.Label = "";
+ global::Gtk.Image w5 = new global::Gtk.Image ();
+ w5.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-zoom-in", global::Gtk.IconSize.Menu);
+ this.buttonZoomIn.Image = w5;
+ this.hboxChartBar.Add (this.buttonZoomIn);
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hboxChartBar [this.buttonZoomIn]));
+ w6.PackType = ((global::Gtk.PackType)(1));
+ w6.Position = 3;
+ w6.Expand = false;
+ w6.Fill = false;
+ this.boxCharts.Add (this.hboxChartBar);
+ global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.boxCharts [this.hboxChartBar]));
+ w7.Position = 0;
+ w7.Expand = false;
+ w7.Fill = false;
+ // Container child boxCharts.Gtk.Box+BoxChild
+ this.frameCharts = new global::Gtk.VBox ();
+ this.frameCharts.Name = "frameCharts";
+ this.frameCharts.Spacing = 6;
+ // Container child frameCharts.Gtk.Box+BoxChild
+ this.chartScroller = new global::Gtk.HScrollbar (null);
+ this.chartScroller.Name = "chartScroller";
+ this.chartScroller.Adjustment.Upper = 100;
+ this.chartScroller.Adjustment.PageIncrement = 10;
+ this.chartScroller.Adjustment.PageSize = 10;
+ this.chartScroller.Adjustment.StepIncrement = 1;
+ this.frameCharts.Add (this.chartScroller);
+ global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.frameCharts [this.chartScroller]));
+ w8.PackType = ((global::Gtk.PackType)(1));
+ w8.Position = 2;
+ w8.Expand = false;
+ w8.Fill = false;
+ this.boxCharts.Add (this.frameCharts);
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.boxCharts [this.frameCharts]));
+ w9.Position = 1;
+ this.hbox4.Add (this.boxCharts);
+ global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.boxCharts]));
+ w10.Position = 0;
+ this.hpaned2.Add (this.hbox4);
+ global::Gtk.Paned.PanedChild w11 = ((global::Gtk.Paned.PanedChild)(this.hpaned2 [this.hbox4]));
+ w11.Resize = false;
+ // Container child hpaned2.Gtk.Paned+PanedChild
+ this.vbox5 = new global::Gtk.VBox ();
+ this.vbox5.Name = "vbox5";
+ this.vbox5.Spacing = 6;
+ // Container child vbox5.Gtk.Box+BoxChild
+ this.hboxSeriesBar = new global::Gtk.HBox ();
+ this.hboxSeriesBar.Name = "hboxSeriesBar";
+ this.hboxSeriesBar.Spacing = 6;
+ // Container child hboxSeriesBar.Gtk.Box+BoxChild
+ this.buttonRemoveCounter = new global::Gtk.Button ();
+ this.buttonRemoveCounter.CanFocus = true;
+ this.buttonRemoveCounter.Name = "buttonRemoveCounter";
+ this.buttonRemoveCounter.UseStock = true;
+ this.buttonRemoveCounter.UseUnderline = true;
+ this.buttonRemoveCounter.Relief = ((global::Gtk.ReliefStyle)(2));
+ this.buttonRemoveCounter.Label = "gtk-remove";
+ this.hboxSeriesBar.Add (this.buttonRemoveCounter);
+ global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hboxSeriesBar [this.buttonRemoveCounter]));
+ w12.PackType = ((global::Gtk.PackType)(1));
+ w12.Position = 0;
+ w12.Expand = false;
+ w12.Fill = false;
+ // Container child hboxSeriesBar.Gtk.Box+BoxChild
+ this.buttonAddCounter = new global::Gtk.Button ();
+ this.buttonAddCounter.CanFocus = true;
+ this.buttonAddCounter.Name = "buttonAddCounter";
+ this.buttonAddCounter.UseStock = true;
+ this.buttonAddCounter.UseUnderline = true;
+ this.buttonAddCounter.Relief = ((global::Gtk.ReliefStyle)(2));
+ this.buttonAddCounter.Label = "gtk-add";
+ this.hboxSeriesBar.Add (this.buttonAddCounter);
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.hboxSeriesBar [this.buttonAddCounter]));
+ w13.PackType = ((global::Gtk.PackType)(1));
+ w13.Position = 1;
+ w13.Expand = false;
+ w13.Fill = false;
+ this.vbox5.Add (this.hboxSeriesBar);
+ global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hboxSeriesBar]));
+ w14.Position = 0;
+ w14.Expand = false;
+ w14.Fill = false;
+ // Container child vbox5.Gtk.Box+BoxChild
+ this.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow ();
+ this.GtkScrolledWindow1.Name = "GtkScrolledWindow1";
+ this.GtkScrolledWindow1.ShadowType = ((global::Gtk.ShadowType)(1));
+ // Container child GtkScrolledWindow1.Gtk.Container+ContainerChild
+ this.listSeries = new global::Gtk.TreeView ();
+ this.listSeries.WidthRequest = 100;
+ this.listSeries.CanFocus = true;
+ this.listSeries.Name = "listSeries";
+ this.listSeries.HeadersVisible = false;
+ this.GtkScrolledWindow1.Add (this.listSeries);
+ this.vbox5.Add (this.GtkScrolledWindow1);
+ global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.GtkScrolledWindow1]));
+ w16.Position = 1;
+ this.hpaned2.Add (this.vbox5);
+ global::Gtk.Paned.PanedChild w17 = ((global::Gtk.Paned.PanedChild)(this.hpaned2 [this.vbox5]));
+ w17.Resize = false;
+ w17.Shrink = false;
+ this.vbox3.Add (this.hpaned2);
+ global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hpaned2]));
+ w18.Position = 0;
+ this.Add (this.vbox3);
+ if ((this.Child != null)) {
+ this.Child.ShowAll ();
+ }
+ this.Hide ();
+ this.toggleTimeView.Toggled += new global::System.EventHandler (this.OnToggleTimeViewToggled);
+ this.toggleListView.Toggled += new global::System.EventHandler (this.OnToggleListViewToggled);
+ this.buttonZoomIn.Clicked += new global::System.EventHandler (this.OnButtonZoomInClicked);
+ this.buttonZoomOut.Clicked += new global::System.EventHandler (this.OnButtonZoomOutClicked);
+ this.chartScroller.ValueChanged += new global::System.EventHandler (this.OnChartScrollerValueChanged);
+ this.buttonAddCounter.Clicked += new global::System.EventHandler (this.OnButtonAddCounterClicked);
+ this.buttonRemoveCounter.Clicked += new global::System.EventHandler (this.OnButtonRemoveCounterClicked);
+ }
+ }
+}
diff --git a/main/src/tools/mdmonitor/gtk-gui/generated.cs b/main/src/tools/mdmonitor/gtk-gui/generated.cs
index 0ada9fc5f0..097e9cb288 100644
--- a/main/src/tools/mdmonitor/gtk-gui/generated.cs
+++ b/main/src/tools/mdmonitor/gtk-gui/generated.cs
@@ -17,6 +17,7 @@ namespace Stetic
internal class BinContainer
{
private Gtk.Widget child;
+
private Gtk.UIManager uimanager;
public static BinContainer Attach (Gtk.Bin bin)
@@ -58,7 +59,8 @@ namespace Stetic
if ((this.uimanager != null)) {
Gtk.Widget w;
w = this.child.Toplevel;
- if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) {
+ if (((w != null)
+ && typeof (Gtk.Window).IsInstanceOfType (w))) {
((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup);
this.uimanager = null;
}
@@ -76,7 +78,7 @@ namespace Stetic
} else {
int sz;
int sy;
- global::Gtk.Icon.SizeLookup (size, out sz, out sy);
+ global::Gtk.Icon.SizeLookup (size, out sz, out sy);
try {
return Gtk.IconTheme.Default.LoadIcon (name, sz, 0);
} catch (System.Exception) {
@@ -91,8 +93,12 @@ namespace Stetic
pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1));
gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
gc.RgbFgColor = new Gdk.Color (255, 0, 0);
- pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4)));
- pmap.DrawLine (gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)));
+ pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1)
+ - (sz / 4)), ((sz - 1)
+ - (sz / 4)));
+ pmap.DrawLine (gc, ((sz - 1)
+ - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1)
+ - (sz / 4)));
return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
}
}
diff --git a/main/src/tools/mdmonitor/gtk-gui/gui.stetic b/main/src/tools/mdmonitor/gtk-gui/gui.stetic
index 3016971d49..49446c7ee4 100644
--- a/main/src/tools/mdmonitor/gtk-gui/gui.stetic
+++ b/main/src/tools/mdmonitor/gtk-gui/gui.stetic
@@ -9,7 +9,7 @@
<widget-library name="../../../../build/bin/MonoDevelop.Ide.dll" />
<widget-library name="../../../../build/bin/mdmonitor.exe" internal="true" />
</import>
- <widget class="Gtk.Bin" id="Mono.Instrumentation.Monitor.InstrumenationChartView" design-size="632 482">
+ <widget class="Gtk.Bin" id="Mono.Instrumentation.Monitor.InstrumentationChartView" design-size="632 482">
<property name="MemberName" />
<property name="Visible">False</property>
<property name="GeneratePublic">False</property>
@@ -1000,4 +1000,241 @@
</widget>
</child>
</widget>
+ <widget class="Gtk.Bin" id="Mono.Instrumentation.Monitor.InstrumentationChartView" design-size="632 482">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <property name="GeneratePublic">False</property>
+ <child>
+ <widget class="Gtk.VBox" id="vbox3">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.HPaned" id="hpaned2">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Position">471</property>
+ <child>
+ <widget class="Gtk.HBox" id="hbox4">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.VBox" id="boxCharts">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.HBox" id="hboxChartBar">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.ToggleButton" id="toggleTimeView">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">Time View</property>
+ <property name="UseUnderline">True</property>
+ <property name="Relief">None</property>
+ <signal name="Toggled" handler="OnToggleTimeViewToggled" />
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.ToggleButton" id="toggleListView">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">List View</property>
+ <property name="UseUnderline">True</property>
+ <property name="Relief">None</property>
+ <signal name="Toggled" handler="OnToggleListViewToggled" />
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="buttonZoomOut">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextAndIcon</property>
+ <property name="Icon">stock:gtk-zoom-out Menu</property>
+ <property name="Label" translatable="yes" />
+ <property name="UseUnderline">True</property>
+ <property name="Relief">None</property>
+ <signal name="Clicked" handler="OnButtonZoomOutClicked" />
+ </widget>
+ <packing>
+ <property name="PackType">End</property>
+ <property name="Position">2</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="buttonZoomIn">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextAndIcon</property>
+ <property name="Icon">stock:gtk-zoom-in Menu</property>
+ <property name="Label" translatable="yes" />
+ <property name="UseUnderline">True</property>
+ <property name="Relief">None</property>
+ <signal name="Clicked" handler="OnButtonZoomInClicked" />
+ </widget>
+ <packing>
+ <property name="PackType">End</property>
+ <property name="Position">3</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.VBox" id="frameCharts">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <placeholder />
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ <child>
+ <widget class="Gtk.HScrollbar" id="chartScroller">
+ <property name="MemberName" />
+ <property name="Upper">100</property>
+ <property name="PageIncrement">10</property>
+ <property name="PageSize">10</property>
+ <property name="StepIncrement">1</property>
+ <signal name="ValueChanged" handler="OnChartScrollerValueChanged" />
+ </widget>
+ <packing>
+ <property name="PackType">End</property>
+ <property name="Position">2</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Resize">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.VBox" id="vbox5">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.HBox" id="hboxSeriesBar">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Button" id="buttonRemoveCounter">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-remove</property>
+ <property name="Relief">None</property>
+ <signal name="Clicked" handler="OnButtonRemoveCounterClicked" />
+ <property name="label">gtk-remove</property>
+ </widget>
+ <packing>
+ <property name="PackType">End</property>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="buttonAddCounter">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-add</property>
+ <property name="Relief">None</property>
+ <signal name="Clicked" handler="OnButtonAddCounterClicked" />
+ <property name="label">gtk-add</property>
+ </widget>
+ <packing>
+ <property name="PackType">End</property>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow1">
+ <property name="MemberName" />
+ <property name="ShadowType">In</property>
+ <child>
+ <widget class="Gtk.TreeView" id="listSeries">
+ <property name="MemberName" />
+ <property name="WidthRequest">100</property>
+ <property name="CanFocus">True</property>
+ <property name="ShowScrollbars">True</property>
+ <property name="HeadersVisible">False</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Resize">False</property>
+ <property name="Shrink">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
</stetic-interface> \ No newline at end of file
diff --git a/main/src/tools/mdmonitor/mdmonitor.csproj b/main/src/tools/mdmonitor/mdmonitor.csproj
index ca74e1052c..586b5538fd 100644
--- a/main/src/tools/mdmonitor/mdmonitor.csproj
+++ b/main/src/tools/mdmonitor/mdmonitor.csproj
@@ -54,13 +54,11 @@
<Compile Include="Main.cs" />
<Compile Include="AssemblyInfo.cs" />
<Compile Include="CounterSelectorDialog.cs" />
- <Compile Include="InstrumenationChartView.cs" />
<Compile Include="InstrumentationViewerDialog.cs" />
<Compile Include="TimeLineView.cs" />
<Compile Include="TimeLineViewWindow.cs" />
<Compile Include="NewProfile.cs" />
<Compile Include="gtk-gui\Mono.Instrumentation.Monitor.InstrumentationViewerDialog.cs" />
- <Compile Include="gtk-gui\Mono.Instrumentation.Monitor.InstrumenationChartView.cs" />
<Compile Include="gtk-gui\Mono.Instrumentation.Monitor.NewProfile.cs" />
<Compile Include="gtk-gui\Mono.Instrumentation.Monitor.CounterSelectorDialog.cs" />
<Compile Include="gtk-gui\Mono.Instrumentation.Monitor.TimeLineViewWindow.cs" />
@@ -81,6 +79,8 @@
<Compile Include="..\..\addins\MacPlatform\MacInterop\CoreFoundation.cs">
<Link>MacIntegration\CoreFoundation.cs</Link>
</Compile>
+ <Compile Include="InstrumentationChartView.cs" />
+ <Compile Include="gtk-gui\Mono.Instrumentation.Monitor.InstrumentationChartView.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
diff --git a/main/src/tools/mdtool/ChangeLog b/main/src/tools/mdtool/ChangeLog
deleted file mode 100644
index a40349f0c5..0000000000
--- a/main/src/tools/mdtool/ChangeLog
+++ /dev/null
@@ -1,134 +0,0 @@
-2009-10-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdrun.csproj: Flush.
-
-2009-10-08 Ankit Jain <jankit@novell.com>
-
- * mdrun.csproj: Add 'app.config'.
-
-2009-08-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * src/mdrun.cs: Disable logging if verbose is not specified.
- Command line tools should already be providing feedback
- using the console.
-
-2009-06-19 Mike Krüger <mkrueger@novell.com>
-
- * src/AssemblyInfo.cs: Commented out empty assembly key file
- attribute (Bug 513981 - Project template causes CS1726
- errors).
-
-2009-03-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * src/mdrun.cs: Don't remove the console error logger, just
- control its verbosity. Fixes "Bug 480816 - mdtool removes
- console logger so that errors are swallowed silently".
-
-2009-02-08 Michael Hutchinson <mhutchinson@novell.com>
-
- * mdrun.csproj: Build mdhost and mdrun as 32-bit too on
- Windows.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * mdrun.csproj: Flush MD's removal of newline at end of file
- that was introduced by manually editing with gedit.
-
-2009-02-07 Michael Hutchinson <mhutchinson@novell.com>
-
- * mdrun.csproj: Output to the correct directory.
-
-2009-02-06 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdrun.mdp:
- * mdrun.csproj: Migrated to MSBuild file format.
-
-2009-01-26 Michael Hutchinson <mhutchinson@novell.com>
-
- * mdrun.mdp: Flush project format changes.
-
-2008-12-12 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdrun.mdp: Fix target framework.
-
-2008-12-09 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdrun.mdp: Don't require a specific version of Mono.Addins.
-
-2008-08-20 Michael Hutchinson <mhutchinson@novell.com>
-
- * app.config: Remove log4net residue.
-
-2008-06-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * src/mdrun.cs: Don't log internal messages to console by default.
- Added parameter for enabling the logging service.
-
-2008-01-16 Michael Hutchinson <mhutchinson@novell.com>
-
- * src/mdrun.cs: Set process name for mdtool.
-
-2007-12-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdrun.mdp, Makefile.am: Directory reorganization.
-
-2007-10-23 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdrun.mdp: Project file names updated by change in MD path functions.
-
-2007-08-02 Ankit Jain <jankit@novell.com>
-
- * src/mdrun.cs (Main): Show list of available apps with the usage.
-
-2007-07-02 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdrun.mdp, src/mdrun.cs, Makefile.am: Make sure the setup utility can
- be run even if the add-in registry is broken.
-
-2007-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * Mono.Addins.mdp: Updated.
- * Mono.Addins/ExtensionContext.cs: Fixed GetExtensionObjects overload
- which was not using the correct reuseCachedInstance value.
- * Mono.Addins/ExtensionTree.cs: Improved error message. When looking
- for a type in an assembly, avoid throwing an exception too early,
- since it may be found in other assemblies.
- * Mono.Addins.Database/AddinDatabase.cs: In the addin info cache, also
- store information about unsuccessful lookups, to avoid looking for
- an add-in again if we found that it doesn't exist. In Update(),
- don't use verbose output by default.
-
-2007-04-26 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdrun.mdp: Don't copy referenced assemblies.
-
-2007-02-15 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdrun.mdp: Set target runtime to 2.0.
- * src/AssemblyInfo.cs: Avoid incremental change of version.
-
-2006-05-05 Lluis Sanchez Gual <lluis@novell.com>
-
- * src/mdrun.cs: Added parameter for querying the available apps.
-
-2006-05-04 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdrun.mdp: Updated.
-
-2006-03-29 Lluis Sanchez Gual <lluis@novell.com>
-
- * src/mdrun.cs: Shutdown the runtime before exiting.
-
-2006-03-24 Lluis Sanchez Gual <lluis@novell.com>
-
- * mdrun.mdp: Updated.
- * Makefile.am: Use an unified format. Patch by Matze Braun.
-
-2005-10-11 Lluis Sanchez Gual <lluis@novell.com>
-
- * Makefile.am: Generate config file for the app.
- * app.config: Added.
-
-2005-09-28 Lluis Sanchez Gual <lluis@novell.com>
-
- * src/mdrun.cs: Created
diff --git a/main/src/tools/mdtool/app.config b/main/src/tools/mdtool/app.config
index e4a56c9fe3..71e161185a 100644
--- a/main/src/tools/mdtool/app.config
+++ b/main/src/tools/mdtool/app.config
@@ -9,6 +9,10 @@
<assemblyIdentity name="ICSharpCode.SharpZipLib" publicKeyToken="1b03e6acf1164f73" culture="neutral" />
<bindingRedirect oldVersion="0.84.0.0" newVersion="2.84.0.0"/>
</dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
+ <bindingRedirect oldVersion="2.0.0.0-4.3.1.0" newVersion="4.4.0.0"/>
+ </dependentAssembly>
</assemblyBinding>
</runtime>
</configuration> \ No newline at end of file
diff --git a/main/src/tools/mdtool/mdtool.csproj b/main/src/tools/mdtool/mdtool.csproj
index 7d0cbfbf99..a8a8b4d147 100644
--- a/main/src/tools/mdtool/mdtool.csproj
+++ b/main/src/tools/mdtool/mdtool.csproj
@@ -35,6 +35,29 @@
<NoWarn>1591;1573</NoWarn>
<DocumentationFile>..\..\..\build\bin\mdtool.xml</DocumentationFile>
</PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+ <DebugSymbols>True</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>False</Optimize>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <PlatformTarget>x64</PlatformTarget>
+ <Execution>
+ <Execution clr-version="Net_2_0" />
+ </Execution>
+ <DefineConstants>DEBUG</DefineConstants>
+ <NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\build\bin\mdtool.xml</DocumentationFile>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <WarningLevel>4</WarningLevel>
+ <PlatformTarget>x64</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\build\bin\mdtool.xml</DocumentationFile>
+ </PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
<Project>{7525BB88-6142-4A26-93B9-A30C6983390A}</Project>
diff --git a/main/src/tools/mdtool/src/mdtool.cs b/main/src/tools/mdtool/src/mdtool.cs
index e1364a0eb0..e3f82aad9a 100644
--- a/main/src/tools/mdtool/src/mdtool.cs
+++ b/main/src/tools/mdtool/src/mdtool.cs
@@ -35,12 +35,18 @@ using Mono.Addins.Setup;
using System.IO;
using System.Collections;
using MonoDevelop.Core.Logging;
+using System.Threading;
+using System.Collections.Generic;
+using System.Threading.Tasks;
-public class MonoDevelopProcessHost
+class MonoDevelopProcessHost
{
public static int Main (string[] args)
{
try {
+ var sc = new ConsoleSynchronizationContext ();
+ SynchronizationContext.SetSynchronizationContext (sc);
+
Runtime.SetProcessName ("mdtool");
EnabledLoggingLevel verbosity = EnabledLoggingLevel.Fatal;
@@ -129,7 +135,11 @@ public class MonoDevelopProcessHost
return badInput? 1 : 0;
}
- return tool.Run (toolArgs);
+ var task = tool.Run (toolArgs);
+ task.ContinueWith ((t) => sc.ExitLoop ());
+ sc.RunMainLoop ();
+ return task.Result;
+
} catch (UserException ex) {
Console.WriteLine (ex.Message);
return -1;
@@ -198,4 +208,67 @@ public class MonoDevelopProcessHost
Console.WriteLine ();
}
+ class ConsoleSynchronizationContext: SynchronizationContext
+ {
+ // This class implements a threading context based on a basic message loop, which emulates the
+ // behavior of a normal UI loop. This is necessary since there is no UI loop when running mdtool.
+
+ Queue<Tuple<SendOrPostCallback,object>> work = new Queue<Tuple<SendOrPostCallback, object>> ();
+ bool endLoop;
+
+ public override void Post (SendOrPostCallback d, object state)
+ {
+ lock (work) {
+ work.Enqueue (new Tuple<SendOrPostCallback, object> (d, state));
+ Monitor.Pulse (work);
+ }
+ }
+
+ public override void Send (SendOrPostCallback d, object state)
+ {
+ var evt = new ManualResetEventSlim (false);
+ Exception exception = null;
+ Post (s => {
+ try {
+ d.Invoke (state);
+ } catch (Exception ex) {
+ exception = ex;
+ } finally {
+ Thread.MemoryBarrier ();
+ evt.Set ();
+ }
+ }, null);
+ evt.Wait ();
+ if (exception != null)
+ throw exception;
+ }
+
+ public void RunMainLoop ()
+ {
+ do {
+ Tuple<SendOrPostCallback,object> next = null;
+ lock (work) {
+ if (work.Count > 0 && !endLoop)
+ next = work.Dequeue ();
+ else if (!endLoop)
+ Monitor.Wait (work);
+ }
+ if (next != null) {
+ try {
+ next.Item1 (next.Item2);
+ } catch (Exception ex) {
+ Console.WriteLine (ex);
+ }
+ }
+ } while (!endLoop);
+ }
+
+ public void ExitLoop ()
+ {
+ lock (work) {
+ endLoop = true;
+ Monitor.Pulse (work);
+ }
+ }
+ }
}